aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore5
-rw-r--r--HOWTO/BENCHMARKS.md73
-rw-r--r--HOWTO/BOOTSTRAP.md (renamed from README.bootstrap)24
-rw-r--r--HOWTO/DTRACE.md392
-rw-r--r--HOWTO/INSTALL-CROSS.md560
-rw-r--r--HOWTO/INSTALL-WIN32.md (renamed from INSTALL-WIN32.md)61
-rw-r--r--HOWTO/INSTALL.md (renamed from INSTALL.md)66
-rw-r--r--HOWTO/MARKDOWN.md (renamed from README.md.txt)4
-rw-r--r--HOWTO/SYSTEMTAP.md75
-rw-r--r--HOWTO/TESTING.md150
l---------INSTALL-CROSS.md1
-rw-r--r--Makefile.in133
-rw-r--r--README.md10
-rw-r--r--TAR.include8
-rw-r--r--aclocal.m4108
-rw-r--r--bootstrap/bin/start.bootbin5312 -> 5248 bytes
-rw-r--r--bootstrap/bin/start_clean.bootbin5312 -> 5248 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_asm.beambin11572 -> 11576 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_disasm.beambin24968 -> 25032 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_type.beambin13852 -> 14032 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_utils.beambin14552 -> 14604 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/beam_validator.beambin34476 -> 34536 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/cerl_inline.beambin37300 -> 37572 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/compile.beambin37112 -> 37460 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/compiler.app69
-rw-r--r--bootstrap/lib/compiler/ebin/compiler.appup1
-rw-r--r--bootstrap/lib/compiler/ebin/sys_core_fold.beambin47520 -> 46776 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/sys_pre_expand.beambin16188 -> 16292 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/v3_codegen.beambin52144 -> 51696 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/v3_core.beambin50992 -> 51076 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/v3_kernel.beambin44724 -> 42764 bytes
-rw-r--r--bootstrap/lib/compiler/ebin/v3_life.beambin22260 -> 19924 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/auth.beambin6328 -> 6480 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/code.beambin6708 -> 6960 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/code_server.beambin26228 -> 26256 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/disk_log.beambin37400 -> 37260 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/disk_log_1.beambin24896 -> 24928 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/erl_ddll.beambin2560 -> 2868 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/error_logger.beambin4344 -> 4416 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/erts_debug.beambin2808 -> 3916 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/file.beambin14152 -> 14416 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/file_io_server.beambin14132 -> 14248 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/hipe_unified_loader.beambin12496 -> 12732 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/inet.beambin20076 -> 20172 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/inet_config.beambin8192 -> 7468 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/inet_parse.beambin13056 -> 12832 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/kernel.app120
-rw-r--r--bootstrap/lib/kernel/ebin/kernel.appup (renamed from lib/asn1/test/testROSE.erl)33
-rw-r--r--bootstrap/lib/kernel/ebin/net_kernel.beambin22720 -> 22800 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/os.beambin5228 -> 5276 bytes
-rw-r--r--bootstrap/lib/kernel/ebin/rpc.beambin8748 -> 8748 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/binary.beambin2640 -> 3660 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/digraph_utils.beambin6800 -> 6808 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/epp.beambin24188 -> 24276 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/erl_compile.beambin5076 -> 4896 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/erl_eval.beambin23784 -> 23752 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/erl_internal.beambin5016 -> 5016 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/erl_lint.beambin85144 -> 85172 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/escript.beambin17032 -> 17056 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/ets.beambin20008 -> 21724 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/filelib.beambin7280 -> 7308 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/gen.beambin3856 -> 4112 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/gen_event.beambin17512 -> 17604 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/gen_fsm.beambin14940 -> 15348 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/gen_server.beambin16904 -> 17260 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/lib.beambin9060 -> 9068 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/lists.beambin29204 -> 29556 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/math.beambin308 -> 1104 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/ms_transform.beambin20224 -> 20180 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/otp_internal.beambin7020 -> 7156 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/qlc_pt.beambin71584 -> 71588 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/re.beambin12348 -> 12544 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/stdlib.app105
-rw-r--r--bootstrap/lib/stdlib/ebin/stdlib.appup (renamed from lib/asn1/test/testExternal.erl)32
-rw-r--r--bootstrap/lib/stdlib/ebin/string.beambin4744 -> 4872 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/supervisor.beambin21368 -> 22940 bytes
-rw-r--r--bootstrap/lib/stdlib/ebin/unicode.beambin11412 -> 11620 bytes
-rw-r--r--configure.in16
-rw-r--r--erts/Makefile.in19
-rw-r--r--erts/aclocal.m4108
-rw-r--r--erts/autoconf/vxworks/sed.general3
-rw-r--r--erts/configure.in229
-rw-r--r--erts/doc/src/Makefile24
-rw-r--r--erts/doc/src/driver.xml2
-rw-r--r--erts/doc/src/erl.xml35
-rw-r--r--erts/doc/src/erl_driver.xml56
-rw-r--r--erts/doc/src/erl_nif.xml26
-rw-r--r--erts/doc/src/erl_set_memory_block.xml172
-rw-r--r--erts/doc/src/erlang.xml3937
-rw-r--r--erts/doc/src/erlc.xml10
-rw-r--r--erts/doc/src/erlsrv.xml15
-rw-r--r--erts/doc/src/match_spec.xml8
-rw-r--r--erts/doc/src/notes.xml631
-rw-r--r--erts/doc/src/ref_man.xml1
-rw-r--r--erts/emulator/Makefile.in150
-rw-r--r--erts/emulator/beam/atom.names9
-rw-r--r--erts/emulator/beam/beam_bif_load.c769
-rw-r--r--erts/emulator/beam/beam_bp.c2004
-rw-r--r--erts/emulator/beam/beam_bp.h233
-rw-r--r--erts/emulator/beam/beam_catches.c136
-rw-r--r--erts/emulator/beam/beam_catches.h11
-rw-r--r--erts/emulator/beam/beam_debug.c30
-rw-r--r--erts/emulator/beam/beam_emu.c714
-rw-r--r--erts/emulator/beam/beam_load.c600
-rw-r--r--erts/emulator/beam/beam_load.h49
-rw-r--r--erts/emulator/beam/beam_ranges.c349
-rw-r--r--erts/emulator/beam/benchmark.c34
-rw-r--r--erts/emulator/beam/benchmark.h13
-rw-r--r--erts/emulator/beam/bif.c518
-rw-r--r--erts/emulator/beam/bif.h18
-rw-r--r--erts/emulator/beam/bif.tab32
-rw-r--r--erts/emulator/beam/big.c18
-rw-r--r--erts/emulator/beam/break.c154
-rw-r--r--erts/emulator/beam/code_ix.c166
-rw-r--r--erts/emulator/beam/code_ix.h141
-rw-r--r--erts/emulator/beam/copy.c446
-rw-r--r--erts/emulator/beam/dist.c258
-rw-r--r--erts/emulator/beam/dtrace-wrapper.h111
-rw-r--r--erts/emulator/beam/erl_alloc.c35
-rw-r--r--erts/emulator/beam/erl_alloc.h9
-rw-r--r--erts/emulator/beam/erl_alloc.types47
-rw-r--r--erts/emulator/beam/erl_alloc_util.c162
-rw-r--r--erts/emulator/beam/erl_alloc_util.h6
-rw-r--r--erts/emulator/beam/erl_async.c48
-rw-r--r--erts/emulator/beam/erl_bif_binary.c69
-rw-r--r--erts/emulator/beam/erl_bif_chksum.c13
-rw-r--r--erts/emulator/beam/erl_bif_ddll.c22
-rwxr-xr-x[-rw-r--r--]erts/emulator/beam/erl_bif_info.c216
-rw-r--r--erts/emulator/beam/erl_bif_os.c110
-rw-r--r--erts/emulator/beam/erl_bif_port.c52
-rw-r--r--erts/emulator/beam/erl_bif_re.c11
-rw-r--r--erts/emulator/beam/erl_bif_timer.c12
-rw-r--r--erts/emulator/beam/erl_bif_trace.c659
-rw-r--r--erts/emulator/beam/erl_bits.c12
-rw-r--r--erts/emulator/beam/erl_cpu_topology.c5
-rw-r--r--erts/emulator/beam/erl_db.c100
-rw-r--r--erts/emulator/beam/erl_db.h10
-rw-r--r--erts/emulator/beam/erl_db_hash.c63
-rw-r--r--erts/emulator/beam/erl_db_tree.c12
-rw-r--r--erts/emulator/beam/erl_db_util.c30
-rw-r--r--erts/emulator/beam/erl_db_util.h4
-rw-r--r--erts/emulator/beam/erl_debug.c270
-rw-r--r--erts/emulator/beam/erl_debug.h20
-rw-r--r--erts/emulator/beam/erl_driver.h13
-rw-r--r--erts/emulator/beam/erl_fun.h8
-rw-r--r--erts/emulator/beam/erl_gc.c106
-rw-r--r--erts/emulator/beam/erl_init.c299
-rw-r--r--erts/emulator/beam/erl_lock_check.c14
-rw-r--r--erts/emulator/beam/erl_lock_count.c31
-rw-r--r--erts/emulator/beam/erl_lock_count.h5
-rw-r--r--erts/emulator/beam/erl_message.c550
-rw-r--r--erts/emulator/beam/erl_message.h47
-rw-r--r--erts/emulator/beam/erl_mtrace.c2
-rw-r--r--erts/emulator/beam/erl_nif.c1167
-rw-r--r--erts/emulator/beam/erl_nif.h17
-rw-r--r--erts/emulator/beam/erl_nmgc.c1401
-rw-r--r--erts/emulator/beam/erl_nmgc.h364
-rw-r--r--erts/emulator/beam/erl_node_container_utils.h43
-rw-r--r--erts/emulator/beam/erl_node_tables.c61
-rw-r--r--erts/emulator/beam/erl_node_tables.h3
-rw-r--r--erts/emulator/beam/erl_port_task.c246
-rw-r--r--erts/emulator/beam/erl_port_task.h13
-rw-r--r--erts/emulator/beam/erl_printf_term.c5
-rw-r--r--erts/emulator/beam/erl_process.c5156
-rw-r--r--erts/emulator/beam/erl_process.h658
-rw-r--r--erts/emulator/beam/erl_process_dump.c15
-rw-r--r--erts/emulator/beam/erl_process_lock.c636
-rw-r--r--erts/emulator/beam/erl_process_lock.h425
-rw-r--r--erts/emulator/beam/erl_sched_spec_pre_alloc.c118
-rw-r--r--erts/emulator/beam/erl_sched_spec_pre_alloc.h7
-rw-r--r--erts/emulator/beam/erl_smp.h87
-rw-r--r--erts/emulator/beam/erl_term.c2
-rw-r--r--erts/emulator/beam/erl_thr_progress.c77
-rw-r--r--erts/emulator/beam/erl_thr_progress.h132
-rw-r--r--erts/emulator/beam/erl_thr_queue.c7
-rw-r--r--erts/emulator/beam/erl_threads.h350
-rw-r--r--erts/emulator/beam/erl_time.h4
-rw-r--r--erts/emulator/beam/erl_time_sup.c101
-rw-r--r--erts/emulator/beam/erl_trace.c427
-rw-r--r--erts/emulator/beam/erl_unicode.c185
-rw-r--r--erts/emulator/beam/erl_vm.h21
-rw-r--r--erts/emulator/beam/erlang_dtrace.d3636
-rw-r--r--erts/emulator/beam/export.c354
-rw-r--r--erts/emulator/beam/export.h48
-rw-r--r--erts/emulator/beam/external.c17
-rwxr-xr-x[-rw-r--r--]erts/emulator/beam/global.h518
-rw-r--r--erts/emulator/beam/index.c23
-rw-r--r--erts/emulator/beam/index.h14
-rw-r--r--erts/emulator/beam/io.c331
-rw-r--r--erts/emulator/beam/module.c159
-rw-r--r--erts/emulator/beam/module.h64
-rw-r--r--erts/emulator/beam/ops.tab109
-rw-r--r--erts/emulator/beam/register.c24
-rw-r--r--erts/emulator/beam/register.h4
-rw-r--r--erts/emulator/beam/sys.h179
-rw-r--r--erts/emulator/beam/utils.c342
-rw-r--r--erts/emulator/drivers/common/efile_drv.c933
-rw-r--r--erts/emulator/drivers/common/gzio.c5
-rw-r--r--erts/emulator/drivers/common/inet_drv.c307
-rw-r--r--erts/emulator/drivers/common/zlib_drv.c12
-rw-r--r--erts/emulator/drivers/unix/unix_efile.c584
-rw-r--r--erts/emulator/drivers/win32/registry_drv.c2
-rw-r--r--erts/emulator/drivers/win32/win_con.c4
-rw-r--r--erts/emulator/drivers/win32/win_efile.c7
-rw-r--r--erts/emulator/hipe/hipe_arm.c91
-rw-r--r--erts/emulator/hipe/hipe_arm_bifs.m420
-rw-r--r--erts/emulator/hipe/hipe_bif0.c59
-rw-r--r--erts/emulator/hipe/hipe_bif1.c27
-rw-r--r--erts/emulator/hipe/hipe_bif2.c25
-rw-r--r--erts/emulator/hipe/hipe_bif2.tab4
-rw-r--r--erts/emulator/hipe/hipe_bif_list.m41
-rw-r--r--erts/emulator/hipe/hipe_debug.c2
-rw-r--r--erts/emulator/hipe/hipe_gc.c328
-rw-r--r--erts/emulator/hipe/hipe_mkliterals.c6
-rw-r--r--erts/emulator/hipe/hipe_mode_switch.c10
-rw-r--r--erts/emulator/hipe/hipe_native_bif.h3
-rw-r--r--erts/emulator/hipe/hipe_ppc_bifs.m416
-rw-r--r--erts/emulator/hipe/hipe_primops.h1
-rw-r--r--erts/emulator/hipe/hipe_stack.c10
-rw-r--r--erts/emulator/hipe/hipe_stack.h15
-rw-r--r--erts/emulator/hipe/hipe_x86_gc.h5
-rw-r--r--erts/emulator/hipe/hipe_x86_glue.h3
-rw-r--r--erts/emulator/sys/common/erl_check_io.c21
-rw-r--r--erts/emulator/sys/common/erl_poll.c59
-rw-r--r--erts/emulator/sys/common/erl_poll.h2
-rw-r--r--erts/emulator/sys/unix/sys.c71
-rw-r--r--erts/emulator/sys/unix/sys_float.c8
-rw-r--r--erts/emulator/sys/vxworks/erl_main.c45
-rw-r--r--erts/emulator/sys/vxworks/erl_vxworks_sys.h184
-rw-r--r--erts/emulator/sys/vxworks/erl_vxworks_sys_ddll.c253
-rw-r--r--erts/emulator/sys/vxworks/sys.c2610
-rw-r--r--erts/emulator/sys/win32/erl_win_sys.h11
-rwxr-xr-xerts/emulator/sys/win32/sys.c113
-rw-r--r--erts/emulator/sys/win32/sys_env.c570
-rw-r--r--erts/emulator/sys/win32/sys_float.c8
-rw-r--r--erts/emulator/sys/win32/sys_interrupt.c6
-rw-r--r--erts/emulator/sys/win32/sys_time.c6
-rw-r--r--erts/emulator/test/Makefile23
-rw-r--r--erts/emulator/test/bif_SUITE.erl339
-rw-r--r--erts/emulator/test/binary_SUITE.erl11
-rw-r--r--erts/emulator/test/bs_construct_SUITE.erl10
-rw-r--r--erts/emulator/test/call_trace_SUITE.erl135
-rw-r--r--erts/emulator/test/call_trace_SUITE_data/my_upgrade_test.erl26
-rw-r--r--erts/emulator/test/code_SUITE.erl27
-rw-r--r--erts/emulator/test/code_parallel_load_SUITE.erl198
-rw-r--r--erts/emulator/test/distribution_SUITE.erl25
-rw-r--r--erts/emulator/test/driver_SUITE_data/chkio_drv.c2
-rw-r--r--erts/emulator/test/driver_SUITE_data/io_ready_exit_drv.c2
-rw-r--r--erts/emulator/test/driver_SUITE_data/ioq_exit_drv.c2
-rw-r--r--erts/emulator/test/driver_SUITE_data/missing_callback_drv.c2
-rw-r--r--erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c2
-rw-r--r--erts/emulator/test/driver_SUITE_data/timer_drv.c12
-rw-r--r--erts/emulator/test/emulator.spec1
-rw-r--r--erts/emulator/test/emulator.spec.vxworks26
-rw-r--r--erts/emulator/test/emulator_bench.spec1
-rw-r--r--erts/emulator/test/erts_debug_SUITE.erl67
-rw-r--r--erts/emulator/test/estone_SUITE.erl16
-rw-r--r--erts/emulator/test/estone_SUITE_data/estone_cat.c4
-rw-r--r--erts/emulator/test/float_SUITE.erl11
-rw-r--r--erts/emulator/test/fun_SUITE.erl20
-rw-r--r--erts/emulator/test/gc_SUITE.erl59
-rw-r--r--erts/emulator/test/hibernate_SUITE.erl12
-rw-r--r--erts/emulator/test/mtx_SUITE_data/Makefile.src7
-rw-r--r--erts/emulator/test/node_container_SUITE.erl18
-rw-r--r--erts/emulator/test/nofrag_SUITE.erl26
-rw-r--r--erts/emulator/test/port_SUITE.erl1218
-rw-r--r--erts/emulator/test/port_SUITE_data/dead_port.c24
-rw-r--r--erts/emulator/test/port_SUITE_data/port_test.c35
-rw-r--r--erts/emulator/test/port_SUITE_data/reclaim.h60
-rw-r--r--erts/emulator/test/port_bif_SUITE.erl393
-rw-r--r--erts/emulator/test/port_bif_SUITE_data/port_test.c37
-rw-r--r--erts/emulator/test/port_bif_SUITE_data/reclaim.h60
-rw-r--r--erts/emulator/test/process_SUITE.erl10
-rw-r--r--erts/emulator/test/statistics_SUITE.erl98
-rw-r--r--erts/emulator/test/system_profile_SUITE.erl2
-rw-r--r--erts/emulator/test/timer_bif_SUITE.erl67
-rw-r--r--erts/emulator/test/trace_local_SUITE.erl186
-rw-r--r--erts/emulator/test/trace_port_SUITE.erl9
-rwxr-xr-xerts/emulator/utils/beam_makeops56
-rwxr-xr-xerts/emulator/utils/make_preload3
-rwxr-xr-xerts/emulator/utils/make_tables2
-rw-r--r--erts/emulator/valgrind/suppress.patched.3.6.029
-rw-r--r--erts/emulator/valgrind/suppress.standard29
-rw-r--r--erts/epmd/src/Makefile.in4
-rw-r--r--erts/epmd/src/epmd.c2
-rw-r--r--erts/epmd/src/epmd_srv.c7
-rw-r--r--erts/epmd/test/Makefile8
-rw-r--r--erts/epmd/test/epmd_SUITE.erl4
-rw-r--r--erts/etc/common/Makefile.in136
-rw-r--r--erts/etc/common/dialyzer.c14
-rw-r--r--erts/etc/common/erlc.c12
-rw-r--r--erts/etc/common/erlexec.c218
-rw-r--r--erts/etc/common/escript.c5
-rw-r--r--erts/etc/common/heart.c115
-rw-r--r--erts/etc/common/inet_gethost.c14
-rw-r--r--erts/etc/unix/Install.src42
-rw-r--r--erts/etc/unix/cerl.src6
-rw-r--r--erts/etc/unix/erl.src.src6
-rw-r--r--erts/etc/unix/etp-commands806
-rw-r--r--erts/etc/unix/run_erl.c155
-rw-r--r--erts/etc/unix/to_erl.c2
-rw-r--r--erts/etc/vxworks/README.VxWorks350
-rw-r--r--erts/etc/vxworks/erl.exec.c129
-rw-r--r--erts/etc/vxworks/erl_io.c108
-rw-r--r--erts/etc/vxworks/erl_script.sam.in100
-rw-r--r--erts/etc/vxworks/heart_config.c60
-rw-r--r--erts/etc/vxworks/heart_config.h35
-rw-r--r--erts/etc/vxworks/rdate.c87
-rw-r--r--erts/etc/vxworks/reclaim.c551
-rw-r--r--erts/etc/vxworks/reclaim.h150
-rw-r--r--erts/etc/vxworks/reclaim_private.h44
-rw-r--r--erts/etc/vxworks/resolv.conf6
-rw-r--r--erts/etc/vxworks/vxcall.c145
-rw-r--r--erts/etc/vxworks/wd_example.c141
-rw-r--r--erts/etc/win32/Makefile18
-rw-r--r--erts/etc/win32/erlsrv/erlsrv_service.c5
-rw-r--r--erts/etc/win32/nsis/Makefile16
-rw-r--r--erts/etc/win32/nsis/erlang20.nsi50
-rw-r--r--erts/etc/win32/port_entry.c4
-rw-r--r--erts/etc/win32/start_erl.c5
-rw-r--r--erts/include/internal/ethr_atomics.h337
-rw-r--r--erts/include/internal/ethread.h2
-rw-r--r--erts/lib_src/Makefile.in28
-rw-r--r--erts/lib_src/common/erl_misc_utils.c10
-rw-r--r--erts/lib_src/common/erl_printf.c6
-rw-r--r--erts/lib_src/common/erl_printf_format.c15
-rw-r--r--erts/lib_src/common/ethr_atomics.c363
-rw-r--r--erts/lib_src/common/ethr_aux.c4
-rwxr-xr-xerts/lib_src/utils/make_atomics_api308
-rw-r--r--erts/ntbuild.erl332
-rw-r--r--erts/preloaded/ebin/erl_prim_loader.beambin52904 -> 54148 bytes
-rw-r--r--erts/preloaded/ebin/erlang.beambin41136 -> 88548 bytes
-rw-r--r--erts/preloaded/ebin/init.beambin48064 -> 48580 bytes
-rw-r--r--erts/preloaded/ebin/otp_ring0.beambin1448 -> 1448 bytes
-rw-r--r--erts/preloaded/ebin/prim_file.beambin39536 -> 40816 bytes
-rw-r--r--erts/preloaded/ebin/prim_inet.beambin69980 -> 69764 bytes
-rw-r--r--erts/preloaded/ebin/prim_zip.beambin23460 -> 23460 bytes
-rw-r--r--erts/preloaded/ebin/zlib.beambin12432 -> 12796 bytes
-rw-r--r--erts/preloaded/src/Makefile10
-rw-r--r--erts/preloaded/src/erl_prim_loader.erl361
-rw-r--r--erts/preloaded/src/erlang.erl2380
-rw-r--r--erts/preloaded/src/init.erl16
-rw-r--r--erts/preloaded/src/prim_file.erl108
-rw-r--r--erts/preloaded/src/prim_inet.erl21
-rw-r--r--erts/preloaded/src/zlib.erl74
-rw-r--r--erts/start_scripts/Makefile12
-rw-r--r--erts/test/Makefile22
-rw-r--r--erts/test/autoimport_SUITE.erl196
-rw-r--r--erts/test/erl_print_SUITE.erl6
-rw-r--r--erts/test/erl_print_SUITE_data/Makefile.src30
-rw-r--r--erts/test/erl_print_SUITE_data/erl_print_tests.c6
-rw-r--r--erts/test/erlc_SUITE.erl4
-rw-r--r--erts/test/erlexec_SUITE_data/Makefile.src10
-rw-r--r--erts/test/ethread_SUITE.erl19
-rw-r--r--erts/test/ethread_SUITE_data/Makefile.src10
-rw-r--r--erts/test/install_SUITE.erl6
-rw-r--r--erts/test/otp_SUITE.erl116
-rw-r--r--erts/test/run_erl_SUITE.erl4
-rw-r--r--erts/test/system.spec.vxworks2
-rw-r--r--erts/test/utils/gccifier.c15
-rwxr-xr-xerts/test/utils/gccifier.sh26
-rw-r--r--erts/test/z_SUITE.erl2
-rw-r--r--erts/vsn.mk4
-rw-r--r--lib/.gitignore1
-rw-r--r--lib/Makefile58
-rw-r--r--lib/appmon/doc/src/Makefile16
-rw-r--r--lib/appmon/doc/src/appmon.xml8
-rw-r--r--lib/appmon/doc/src/appmon_chapter.xml8
-rw-r--r--lib/appmon/doc/src/notes.xml22
-rw-r--r--lib/appmon/priv/Makefile6
-rw-r--r--lib/appmon/src/Makefile10
-rw-r--r--lib/appmon/src/appmon.erl7
-rw-r--r--lib/appmon/src/appmon_a.erl7
-rw-r--r--lib/appmon/src/appmon_lb.erl9
-rw-r--r--lib/appmon/src/appmon_txt.erl7
-rw-r--r--lib/appmon/vsn.mk2
-rw-r--r--lib/asn1/c_src/Makefile15
-rw-r--r--lib/asn1/c_src/asn1_erl_nif.c4
-rw-r--r--lib/asn1/doc/src/Makefile16
-rw-r--r--lib/asn1/doc/src/asn1ct.xml94
-rw-r--r--lib/asn1/doc/src/notes.xml97
-rw-r--r--lib/asn1/src/Makefile21
-rw-r--r--lib/asn1/src/asn1_db.erl263
-rw-r--r--lib/asn1/src/asn1ct.erl437
-rw-r--r--lib/asn1/src/asn1ct_check.erl172
-rw-r--r--lib/asn1/src/asn1ct_constructed_per.erl160
-rw-r--r--lib/asn1/src/asn1ct_gen.erl42
-rw-r--r--lib/asn1/src/asn1ct_gen_ber_bin_v2.erl6
-rw-r--r--lib/asn1/src/asn1ct_gen_per.erl46
-rw-r--r--lib/asn1/src/asn1ct_gen_per_rt2ct.erl45
-rw-r--r--lib/asn1/src/asn1ct_name.erl89
-rw-r--r--lib/asn1/src/asn1ct_parser2.erl39
-rw-r--r--lib/asn1/src/asn1ct_table.erl76
-rw-r--r--lib/asn1/src/asn1ct_value.erl79
-rw-r--r--lib/asn1/src/asn1rt_ber_bin_v2.erl6
-rw-r--r--lib/asn1/src/asn1rt_check.erl3
-rw-r--r--lib/asn1/src/asn1rt_per_bin.erl50
-rw-r--r--lib/asn1/src/asn1rt_per_bin_rt2ct.erl46
-rw-r--r--lib/asn1/test/Makefile60
-rw-r--r--lib/asn1/test/asn1_SUITE.erl1533
-rw-r--r--lib/asn1/test/asn1_SUITE.erl.src2372
-rw-r--r--lib/asn1/test/asn1_SUITE_data/Constraints.py6
-rw-r--r--lib/asn1/test/asn1_SUITE_data/EnumN2N.asn125
-rw-r--r--lib/asn1/test/asn1_SUITE_data/Extension-Addition-Group.asn20
-rw-r--r--lib/asn1/test/asn1_SUITE_data/LargeConstraints.py9
-rw-r--r--lib/asn1/test/asn1_app_test.erl4
-rw-r--r--lib/asn1/test/asn1_bin_particular_SUITE.erl.src2
-rw-r--r--lib/asn1/test/asn1_common_SUITE.erl.src95
-rw-r--r--lib/asn1/test/asn1_particular_SUITE.erl.src10
-rw-r--r--lib/asn1/test/asn1_test_lib.erl60
-rw-r--r--lib/asn1/test/ber_decode_error.erl13
-rw-r--r--lib/asn1/test/h323test.erl142
-rw-r--r--lib/asn1/test/pem_performance.erl (renamed from lib/asn1/test/asn1_bin_v2_particular_SUITE.erl.src)294
-rw-r--r--lib/asn1/test/testChoExtension.erl12
-rw-r--r--lib/asn1/test/testChoExternal.erl14
-rw-r--r--lib/asn1/test/testChoOptional.erl15
-rw-r--r--lib/asn1/test/testChoOptionalImplicitTag.erl14
-rw-r--r--lib/asn1/test/testChoPrim.erl13
-rw-r--r--lib/asn1/test/testChoRecursive.erl13
-rw-r--r--lib/asn1/test/testChoTypeRefCho.erl14
-rw-r--r--lib/asn1/test/testChoTypeRefPrim.erl14
-rw-r--r--lib/asn1/test/testChoTypeRefSeq.erl13
-rw-r--r--lib/asn1/test/testChoTypeRefSet.erl13
-rw-r--r--lib/asn1/test/testChoiceIndefinite.erl15
-rw-r--r--lib/asn1/test/testCompactBitString.erl20
-rw-r--r--lib/asn1/test/testConstraints.erl108
-rw-r--r--lib/asn1/test/testContextSwitchingTypes.erl20
-rw-r--r--lib/asn1/test/testDER.erl11
-rw-r--r--lib/asn1/test/testDeepTConstr.erl17
-rw-r--r--lib/asn1/test/testDef.erl13
-rw-r--r--lib/asn1/test/testDoubleEllipses.erl14
-rw-r--r--lib/asn1/test/testEnumExt.erl11
-rw-r--r--lib/asn1/test/testINSTANCE_OF.erl15
-rw-r--r--lib/asn1/test/testInfObj.erl40
-rw-r--r--lib/asn1/test/testInfObjectClass.erl16
-rw-r--r--lib/asn1/test/testMegaco.erl23
-rw-r--r--lib/asn1/test/testMergeCompile.erl22
-rw-r--r--lib/asn1/test/testMvrasn6.erl44
-rw-r--r--lib/asn1/test/testNBAPsystem.erl87
-rw-r--r--lib/asn1/test/testOpenTypeImplicitTag.erl13
-rw-r--r--lib/asn1/test/testParamBasic.erl20
-rw-r--r--lib/asn1/test/testParameterizedInfObj.erl14
-rw-r--r--lib/asn1/test/testPrim.erl15
-rw-r--r--lib/asn1/test/testPrimExternal.erl13
-rw-r--r--lib/asn1/test/testPrimStrings.erl19
-rw-r--r--lib/asn1/test/testRANAP.erl52
-rw-r--r--lib/asn1/test/testSSLspecs.erl71
-rw-r--r--lib/asn1/test/testSelectionTypes.erl11
-rw-r--r--lib/asn1/test/testSeq2738.erl11
-rw-r--r--lib/asn1/test/testSeqDefault.erl12
-rw-r--r--lib/asn1/test/testSeqExtension.erl13
-rw-r--r--lib/asn1/test/testSeqIndefinite.erl11
-rw-r--r--lib/asn1/test/testSeqOf.erl15
-rw-r--r--lib/asn1/test/testSeqOfCho.erl14
-rw-r--r--lib/asn1/test/testSeqOfIndefinite.erl34
-rw-r--r--lib/asn1/test/testSeqOfTag.erl15
-rw-r--r--lib/asn1/test/testSeqOptional.erl13
-rw-r--r--lib/asn1/test/testSeqPrim.erl12
-rw-r--r--lib/asn1/test/testSeqSetDefaultVal.erl11
-rw-r--r--lib/asn1/test/testSeqTag.erl13
-rw-r--r--lib/asn1/test/testSeqTypeRefCho.erl13
-rw-r--r--lib/asn1/test/testSeqTypeRefSeq.erl12
-rw-r--r--lib/asn1/test/testSeqTypeRefSet.erl12
-rw-r--r--lib/asn1/test/testSetDefault.erl13
-rw-r--r--lib/asn1/test/testSetExternal.erl14
-rw-r--r--lib/asn1/test/testSetIndefinite.erl11
-rw-r--r--lib/asn1/test/testSetOf.erl12
-rw-r--r--lib/asn1/test/testSetOfCho.erl12
-rw-r--r--lib/asn1/test/testSetOfExternal.erl12
-rw-r--r--lib/asn1/test/testSetOfTag.erl12
-rw-r--r--lib/asn1/test/testSetOptional.erl16
-rw-r--r--lib/asn1/test/testSetPrim.erl12
-rw-r--r--lib/asn1/test/testSetTag.erl13
-rw-r--r--lib/asn1/test/testSetTypeRefCho.erl12
-rw-r--r--lib/asn1/test/testSetTypeRefPrim.erl12
-rw-r--r--lib/asn1/test/testSetTypeRefSeq.erl12
-rw-r--r--lib/asn1/test/testSetTypeRefSet.erl12
-rw-r--r--lib/asn1/test/testTCAP.erl38
-rw-r--r--lib/asn1/test/testTcapsystem.erl90
-rw-r--r--lib/asn1/test/testTimer.erl8
-rw-r--r--lib/asn1/test/testTypeValueNotation.erl91
-rw-r--r--lib/asn1/test/testX420.erl39
-rw-r--r--lib/asn1/test/test_bad_values.erl29
-rw-r--r--lib/asn1/test/test_compile_options.erl13
-rw-r--r--lib/asn1/test/test_driver_load.erl23
-rw-r--r--lib/asn1/test/test_inline.erl81
-rw-r--r--lib/asn1/test/test_modified_x420.erl12
-rw-r--r--lib/asn1/test/test_partial_incomplete_decode.erl39
-rw-r--r--lib/asn1/test/test_selective_decode.erl11
-rw-r--r--lib/asn1/test/test_special_decode_performance.erl19
-rw-r--r--lib/asn1/test/test_undecoded_rest.erl60
-rw-r--r--lib/asn1/test/test_x691.erl17
-rw-r--r--lib/asn1/vsn.mk4
-rw-r--r--lib/common_test/doc/src/Makefile29
-rw-r--r--lib/common_test/doc/src/basics_chapter.xml7
-rw-r--r--lib/common_test/doc/src/common_test_app.xml89
-rw-r--r--lib/common_test/doc/src/config_file_chapter.xml23
-rw-r--r--lib/common_test/doc/src/cover_chapter.xml4
-rw-r--r--lib/common_test/doc/src/ct_hooks.xml20
-rw-r--r--lib/common_test/doc/src/ct_hooks_chapter.xml47
-rw-r--r--lib/common_test/doc/src/ct_master_chapter.xml51
-rw-r--r--lib/common_test/doc/src/ct_run.xml33
-rw-r--r--lib/common_test/doc/src/event_handler_chapter.xml12
-rw-r--r--lib/common_test/doc/src/example_chapter.xml5
-rw-r--r--lib/common_test/doc/src/getting_started_chapter.xml64
-rw-r--r--lib/common_test/doc/src/notes.xml534
-rw-r--r--lib/common_test/doc/src/ref_man.xml3
-rw-r--r--lib/common_test/doc/src/run_test_chapter.xml559
-rw-r--r--lib/common_test/doc/src/write_test_chapter.xml292
-rw-r--r--lib/common_test/include/ct.hrl15
-rw-r--r--lib/common_test/priv/Makefile.in16
-rw-r--r--lib/common_test/priv/ct_default.css27
-rw-r--r--lib/common_test/priv/jquery-latest.js154
-rw-r--r--lib/common_test/priv/jquery.tablesorter.min.js4
-rw-r--r--lib/common_test/src/Makefile23
-rw-r--r--lib/common_test/src/common_test.app.src11
-rw-r--r--lib/common_test/src/ct.erl617
-rw-r--r--lib/common_test/src/ct_config.erl258
-rw-r--r--lib/common_test/src/ct_conn_log_h.erl230
-rw-r--r--lib/common_test/src/ct_event.erl18
-rw-r--r--lib/common_test/src/ct_framework.erl470
-rw-r--r--lib/common_test/src/ct_ftp.erl8
-rw-r--r--lib/common_test/src/ct_gen_conn.erl256
-rw-r--r--lib/common_test/src/ct_hooks.erl20
-rw-r--r--lib/common_test/src/ct_logs.erl727
-rw-r--r--lib/common_test/src/ct_master.erl20
-rw-r--r--lib/common_test/src/ct_master_logs.erl256
-rw-r--r--lib/common_test/src/ct_netconfc.erl1835
-rw-r--r--lib/common_test/src/ct_netconfc.hrl58
-rw-r--r--lib/common_test/src/ct_repeat.erl92
-rw-r--r--lib/common_test/src/ct_run.erl907
-rw-r--r--lib/common_test/src/ct_snmp.erl335
-rw-r--r--lib/common_test/src/ct_ssh.erl292
-rw-r--r--lib/common_test/src/ct_telnet.erl4
-rw-r--r--lib/common_test/src/ct_testspec.erl931
-rw-r--r--lib/common_test/src/ct_util.erl122
-rw-r--r--lib/common_test/src/ct_util.hrl19
-rw-r--r--lib/common_test/src/cth_conn_log.erl124
-rw-r--r--lib/common_test/src/cth_log_redirect.erl17
-rw-r--r--lib/common_test/src/cth_surefire.erl219
-rw-r--r--lib/common_test/src/vts.erl6
-rw-r--r--lib/common_test/test/Makefile23
-rw-r--r--lib/common_test/test/common_test.spec2
-rw-r--r--lib/common_test/test/ct_auto_compile_SUITE.erl187
-rw-r--r--lib/common_test/test/ct_auto_compile_SUITE_data/bad_SUITE.erl (renamed from erts/test/autoimport_SUITE_data/dummy.txt)10
-rw-r--r--lib/common_test/test/ct_auto_compile_SUITE_data/dummy_SUITE.erl130
-rw-r--r--lib/common_test/test/ct_basic_html_SUITE.erl180
-rw-r--r--lib/common_test/test/ct_basic_html_SUITE_data/babbling_SUITE.erl130
-rw-r--r--lib/common_test/test/ct_config_SUITE.erl114
-rw-r--r--lib/common_test/test/ct_config_SUITE_data/config/config.txt3
-rw-r--r--lib/common_test/test/ct_config_SUITE_data/config/config.xml1
-rw-r--r--lib/common_test/test/ct_config_SUITE_data/config/shadow.txt12
-rw-r--r--lib/common_test/test/ct_config_SUITE_data/config/test/config_static_SUITE.erl92
-rw-r--r--lib/common_test/test/ct_error_SUITE.erl209
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/misc_error_1_SUITE.erl154
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_1_SUITE.erl72
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_5_SUITE.erl86
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_7_SUITE.erl6
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_helper.erl7
-rw-r--r--lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_utils.erl11
-rw-r--r--lib/common_test/test/ct_group_info_SUITE.erl174
-rw-r--r--lib/common_test/test/ct_groups_test_2_SUITE.erl10
-rw-r--r--lib/common_test/test/ct_hooks_SUITE.erl117
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_data_dir_SUITE.erl67
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_no_config_SUITE.erl64
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl548
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_config_cth.erl130
-rw-r--r--lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_data_dir_cth.erl95
-rw-r--r--lib/common_test/test/ct_master_SUITE.erl101
-rw-r--r--lib/common_test/test/ct_misc_1_SUITE.erl4
-rw-r--r--lib/common_test/test/ct_netconfc_SUITE.erl124
-rw-r--r--lib/common_test/test/ct_netconfc_SUITE_data/netconfc1.cfg6
-rw-r--r--lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl1132
-rw-r--r--lib/common_test/test/ct_netconfc_SUITE_data/ns.erl555
-rw-r--r--lib/common_test/test/ct_priv_dir_SUITE.erl277
-rw-r--r--lib/common_test/test/ct_priv_dir_SUITE_data/auto_per_run.spec5
-rw-r--r--lib/common_test/test/ct_priv_dir_SUITE_data/auto_per_tc.spec5
-rw-r--r--lib/common_test/test/ct_priv_dir_SUITE_data/default.spec3
-rw-r--r--lib/common_test/test/ct_priv_dir_SUITE_data/manual_per_tc.spec5
-rw-r--r--lib/common_test/test/ct_priv_dir_SUITE_data/priv_dir_SUITE.erl137
-rw-r--r--lib/common_test/test/ct_shell_SUITE.erl133
-rw-r--r--lib/common_test/test/ct_shell_SUITE_data/cfgdata2
-rw-r--r--lib/common_test/test/ct_snmp_SUITE.erl141
-rw-r--r--lib/common_test/test/ct_snmp_SUITE_data/snmp.cfg44
-rw-r--r--lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE.erl395
-rw-r--r--lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/community.conf1
-rw-r--r--lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/context.conf1
-rw-r--r--lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/notify.conf1
-rw-r--r--lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/standard.conf7
-rw-r--r--lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/target_addr.conf2
-rw-r--r--lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/target_params.conf1
-rw-r--r--lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/usm.conf1
-rw-r--r--lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/vacm.conf6
-rw-r--r--lib/common_test/test/ct_system_error_SUITE.erl132
-rw-r--r--lib/common_test/test/ct_system_error_SUITE_data/a_SUITE.erl122
-rw-r--r--lib/common_test/test/ct_test_server_if_1_SUITE.erl19
-rw-r--r--lib/common_test/test/ct_test_support.erl74
-rw-r--r--lib/common_test/test/ct_testspec_1_SUITE.erl114
-rw-r--r--lib/common_test/test/ct_testspec_2_SUITE.erl759
-rw-r--r--lib/common_test/test/ct_verbosity_SUITE.erl244
-rw-r--r--lib/common_test/test/ct_verbosity_SUITE_data/io_test_SUITE.erl156
-rw-r--r--lib/common_test/vsn.mk2
-rw-r--r--lib/compiler/doc/src/Makefile16
-rw-r--r--lib/compiler/doc/src/compile.xml13
-rw-r--r--lib/compiler/doc/src/notes.xml147
-rw-r--r--lib/compiler/src/Makefile10
-rw-r--r--lib/compiler/src/beam_disasm.erl12
-rw-r--r--lib/compiler/src/beam_type.erl17
-rw-r--r--lib/compiler/src/beam_utils.erl7
-rw-r--r--lib/compiler/src/beam_validator.erl18
-rw-r--r--lib/compiler/src/cerl_inline.erl26
-rw-r--r--lib/compiler/src/compile.erl30
-rw-r--r--lib/compiler/src/sys_core_fold.erl126
-rw-r--r--lib/compiler/src/sys_pre_expand.erl27
-rw-r--r--lib/compiler/src/v3_codegen.erl19
-rw-r--r--lib/compiler/src/v3_core.erl16
-rw-r--r--lib/compiler/src/v3_kernel.erl263
-rw-r--r--lib/compiler/src/v3_kernel.hrl3
-rw-r--r--lib/compiler/src/v3_life.erl99
-rw-r--r--lib/compiler/test/Makefile10
-rw-r--r--lib/compiler/test/beam_disasm_SUITE.erl4
-rw-r--r--lib/compiler/test/bs_construct_SUITE.erl6
-rw-r--r--lib/compiler/test/compilation_SUITE.erl3
-rw-r--r--lib/compiler/test/compilation_SUITE_data/on_load_inline.erl23
-rw-r--r--lib/compiler/test/compile_SUITE.erl43
-rw-r--r--lib/compiler/test/compile_SUITE_data/simple-phony.mk3
-rw-r--r--lib/compiler/test/core_SUITE.erl7
-rw-r--r--lib/compiler/test/core_SUITE_data/seq_in_guard.core66
-rw-r--r--lib/compiler/test/core_fold_SUITE.erl21
-rw-r--r--lib/compiler/test/error_SUITE.erl2
-rw-r--r--lib/compiler/test/guard_SUITE_data/guard_SUITE_tuple_size.S8
-rw-r--r--lib/compiler/test/misc_SUITE.erl11
-rw-r--r--lib/compiler/test/trycatch_SUITE.erl2
-rw-r--r--lib/compiler/vsn.mk2
-rw-r--r--lib/cosEvent/doc/src/Makefile16
-rw-r--r--lib/cosEvent/src/Makefile18
-rw-r--r--lib/cosEvent/test/Makefile12
-rw-r--r--lib/cosEventDomain/doc/src/Makefile16
-rw-r--r--lib/cosEventDomain/src/Makefile18
-rw-r--r--lib/cosEventDomain/test/Makefile8
-rw-r--r--lib/cosFileTransfer/doc/src/Makefile16
-rw-r--r--lib/cosFileTransfer/src/Makefile16
-rw-r--r--lib/cosFileTransfer/test/Makefile10
-rw-r--r--lib/cosFileTransfer/test/fileTransfer_SUITE.erl43
-rw-r--r--lib/cosNotification/doc/src/Makefile16
-rw-r--r--lib/cosNotification/src/Makefile16
-rw-r--r--lib/cosNotification/test/Makefile13
-rw-r--r--lib/cosProperty/doc/src/Makefile16
-rw-r--r--lib/cosProperty/src/Makefile16
-rw-r--r--lib/cosProperty/test/Makefile12
-rw-r--r--lib/cosTime/doc/src/Makefile16
-rw-r--r--lib/cosTime/src/Makefile16
-rw-r--r--lib/cosTime/test/Makefile12
-rw-r--r--lib/cosTransactions/doc/src/Makefile16
-rw-r--r--lib/cosTransactions/examples/Makefile8
-rw-r--r--lib/cosTransactions/src/Makefile14
-rw-r--r--lib/cosTransactions/test/Makefile12
-rw-r--r--lib/crypto/c_src/Makefile.in14
-rw-r--r--lib/crypto/c_src/crypto.c836
-rw-r--r--lib/crypto/doc/src/Makefile18
-rw-r--r--lib/crypto/doc/src/crypto.xml186
-rw-r--r--lib/crypto/doc/src/notes.xml47
-rw-r--r--lib/crypto/src/Makefile10
-rw-r--r--lib/crypto/src/crypto.erl234
-rw-r--r--lib/crypto/test/Makefile6
-rw-r--r--lib/crypto/test/crypto_SUITE.erl429
-rw-r--r--lib/crypto/vsn.mk2
-rw-r--r--lib/debugger/doc/src/Makefile16
-rw-r--r--lib/debugger/doc/src/notes.xml18
-rw-r--r--lib/debugger/priv/Makefile6
-rw-r--r--lib/debugger/src/Makefile10
-rw-r--r--lib/debugger/src/dbg_iserver.erl7
-rw-r--r--lib/debugger/src/dbg_ui_break_win.erl14
-rw-r--r--lib/debugger/src/dbg_ui_edit_win.erl8
-rw-r--r--lib/debugger/src/dbg_ui_filedialog_win.erl9
-rw-r--r--lib/debugger/src/dbg_ui_mon_win.erl15
-rw-r--r--lib/debugger/src/dbg_ui_trace_win.erl21
-rw-r--r--lib/debugger/src/dbg_ui_win.erl11
-rw-r--r--lib/debugger/src/dbg_ui_winman.erl7
-rw-r--r--lib/debugger/src/dbg_wx_trace_win.erl3
-rw-r--r--lib/debugger/test/Makefile12
-rw-r--r--lib/debugger/test/bs_construct_SUITE.erl10
-rw-r--r--lib/debugger/test/bs_match_misc_SUITE.erl2
-rw-r--r--lib/debugger/test/erl_eval_SUITE.erl34
-rw-r--r--lib/debugger/test/int_break_SUITE.erl5
-rw-r--r--lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl6
-rw-r--r--lib/debugger/vsn.mk2
-rw-r--r--lib/dialyzer/doc/src/Makefile14
-rw-r--r--lib/dialyzer/doc/src/notes.xml75
-rw-r--r--lib/dialyzer/src/Makefile15
-rw-r--r--lib/dialyzer/src/dialyzer.erl23
-rw-r--r--lib/dialyzer/src/dialyzer.hrl22
-rw-r--r--lib/dialyzer/src/dialyzer_analysis_callgraph.erl260
-rw-r--r--lib/dialyzer/src/dialyzer_behaviours.erl138
-rw-r--r--lib/dialyzer/src/dialyzer_callgraph.erl613
-rw-r--r--lib/dialyzer/src/dialyzer_cl.erl9
-rw-r--r--lib/dialyzer/src/dialyzer_cl_parse.erl23
-rw-r--r--lib/dialyzer/src/dialyzer_codeserver.erl297
-rw-r--r--lib/dialyzer/src/dialyzer_contracts.erl81
-rw-r--r--lib/dialyzer/src/dialyzer_coordinator.erl251
-rw-r--r--lib/dialyzer/src/dialyzer_dataflow.erl490
-rw-r--r--lib/dialyzer/src/dialyzer_gui.erl29
-rw-r--r--lib/dialyzer/src/dialyzer_gui_wx.erl393
-rw-r--r--lib/dialyzer/src/dialyzer_options.erl16
-rw-r--r--lib/dialyzer/src/dialyzer_plt.erl130
-rw-r--r--lib/dialyzer/src/dialyzer_races.erl40
-rw-r--r--lib/dialyzer/src/dialyzer_succ_typings.erl484
-rw-r--r--lib/dialyzer/src/dialyzer_timing.erl133
-rw-r--r--lib/dialyzer/src/dialyzer_typesig.erl1066
-rw-r--r--lib/dialyzer/src/dialyzer_utils.erl14
-rw-r--r--lib/dialyzer/src/dialyzer_worker.erl189
-rw-r--r--lib/dialyzer/test/Makefile12
-rw-r--r--lib/dialyzer/test/behaviour_SUITE_data/results/sample_behaviour16
-rw-r--r--lib/dialyzer/test/behaviour_SUITE_data/src/custom_sup.erl37
-rw-r--r--lib/dialyzer/test/behaviour_SUITE_data/src/sample_behaviour/sample_callback_wrong.erl3
-rw-r--r--lib/dialyzer/test/dialyzer_common.erl11
-rw-r--r--lib/dialyzer/test/opaque_SUITE_data/results/multiple_wrong_opaques2
-rw-r--r--lib/dialyzer/test/opaque_SUITE_data/results/queue1
-rw-r--r--lib/dialyzer/test/opaque_SUITE_data/src/multiple_wrong_opaques.erl8
-rw-r--r--lib/dialyzer/test/options1_SUITE_data/results/compiler1
-rw-r--r--lib/dialyzer/test/r9c_SUITE_data/results/asn14
-rw-r--r--lib/dialyzer/test/r9c_SUITE_data/results/inets17
-rw-r--r--lib/dialyzer/test/race_SUITE_data/results/ets_insert_args102
-rw-r--r--lib/dialyzer/test/race_SUITE_data/src/ets_insert_args10.erl19
-rw-r--r--lib/dialyzer/test/small_SUITE_data/results/cerl_hipeify2
-rw-r--r--lib/dialyzer/test/small_SUITE_data/results/contracts_with_subtypes31
-rw-r--r--lib/dialyzer/test/small_SUITE_data/results/fun_ref_match2
-rw-r--r--lib/dialyzer/test/small_SUITE_data/results/inf_loop22
-rw-r--r--lib/dialyzer/test/small_SUITE_data/results/no_local_return3
-rw-r--r--lib/dialyzer/test/small_SUITE_data/results/port_info_test3
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/collapse_lists/a.erl9
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/collapse_lists/b.erl5
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/contracts_with_subtypes.erl267
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/deep_lc.erl14
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/maybe_servers.erl31
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/no_local_return.erl12
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/on_load.erl11
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/port_info_test.erl6
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/remote_tuple_set.erl8
-rw-r--r--lib/dialyzer/test/user_SUITE_data/results/wsp_pdu2
-rw-r--r--lib/dialyzer/vsn.mk2
-rwxr-xr-xlib/diameter/autoconf/configure.vxworks147
-rw-r--r--lib/diameter/autoconf/vxworks/sed.general125
-rw-r--r--lib/diameter/autoconf/vxworks/sed.vxworks_cpu3245
-rw-r--r--lib/diameter/autoconf/vxworks/sed.vxworks_ppc3252
-rw-r--r--lib/diameter/autoconf/vxworks/sed.vxworks_ppc60351
-rw-r--r--lib/diameter/autoconf/vxworks/sed.vxworks_ppc603_nolongcall51
-rw-r--r--lib/diameter/autoconf/vxworks/sed.vxworks_ppc86050
-rw-r--r--lib/diameter/autoconf/vxworks/sed.vxworks_simlinux59
-rw-r--r--lib/diameter/autoconf/vxworks/sed.vxworks_simso64
-rw-r--r--lib/diameter/autoconf/vxworks/sed.vxworks_sparc38
-rw-r--r--lib/diameter/doc/src/Makefile26
-rw-r--r--lib/diameter/doc/src/diameter.xml922
-rw-r--r--lib/diameter/doc/src/diameter_app.xml148
-rw-r--r--lib/diameter/doc/src/diameter_compile.xml45
-rw-r--r--lib/diameter/doc/src/diameter_dict.xml10
-rw-r--r--lib/diameter/doc/src/diameter_examples.xml3
-rw-r--r--lib/diameter/doc/src/diameter_intro.xml27
-rw-r--r--lib/diameter/doc/src/diameter_sctp.xml52
-rw-r--r--lib/diameter/doc/src/diameter_tcp.xml53
-rw-r--r--lib/diameter/doc/src/diameter_transport.xml68
-rw-r--r--lib/diameter/doc/src/diameter_using.xml4
-rw-r--r--lib/diameter/doc/src/notes.xml100
-rw-r--r--lib/diameter/examples/code/GNUmakefile2
-rw-r--r--lib/diameter/examples/code/client.erl4
-rw-r--r--lib/diameter/examples/code/client_cb.erl4
-rw-r--r--lib/diameter/examples/code/peer.erl9
-rw-r--r--lib/diameter/examples/code/redirect.erl4
-rw-r--r--lib/diameter/examples/code/redirect_cb.erl2
-rw-r--r--lib/diameter/examples/code/relay.erl4
-rw-r--r--lib/diameter/examples/code/relay_cb.erl4
-rw-r--r--lib/diameter/examples/code/server.erl4
-rw-r--r--lib/diameter/examples/code/server_cb.erl6
-rw-r--r--lib/diameter/include/diameter.hrl5
-rw-r--r--lib/diameter/src/.gitignore1
-rw-r--r--lib/diameter/src/Makefile48
-rw-r--r--lib/diameter/src/base/diameter.appup.src25
-rw-r--r--lib/diameter/src/base/diameter.erl10
-rw-r--r--lib/diameter/src/base/diameter_codec.erl11
-rw-r--r--lib/diameter/src/base/diameter_config.erl5
-rw-r--r--lib/diameter/src/base/diameter_peer.erl143
-rw-r--r--lib/diameter/src/base/diameter_peer_fsm.erl176
-rw-r--r--lib/diameter/src/base/diameter_service.erl542
-rw-r--r--lib/diameter/src/base/diameter_stats.erl265
-rw-r--r--lib/diameter/src/base/diameter_watchdog.erl47
-rw-r--r--lib/diameter/src/modules.mk3
-rw-r--r--lib/diameter/src/transport/diameter_etcp.erl22
-rw-r--r--lib/diameter/src/transport/diameter_sctp.erl129
-rw-r--r--lib/diameter/src/transport/diameter_tcp.erl79
-rw-r--r--lib/diameter/src/transport/diameter_transport.erl55
-rw-r--r--lib/diameter/test/Makefile19
-rw-r--r--lib/diameter/test/diameter_capx_SUITE.erl6
-rw-r--r--lib/diameter/test/diameter_compiler_SUITE.erl4
-rw-r--r--lib/diameter/test/diameter_ct.erl13
-rw-r--r--lib/diameter/test/diameter_dict_SUITE.erl4
-rw-r--r--lib/diameter/test/diameter_failover_SUITE.erl4
-rw-r--r--lib/diameter/test/diameter_gen_sctp_SUITE.erl19
-rw-r--r--lib/diameter/test/diameter_reg_SUITE.erl4
-rw-r--r--lib/diameter/test/diameter_relay_SUITE.erl11
-rw-r--r--lib/diameter/test/diameter_stats_SUITE.erl94
-rw-r--r--lib/diameter/test/diameter_sync_SUITE.erl4
-rw-r--r--lib/diameter/test/diameter_tls_SUITE.erl4
-rw-r--r--lib/diameter/test/diameter_traffic_SUITE.erl137
-rw-r--r--lib/diameter/test/diameter_util.erl37
-rw-r--r--lib/diameter/vsn.mk4
-rw-r--r--lib/edoc/doc/src/Makefile14
-rw-r--r--lib/edoc/doc/src/notes.xml19
-rw-r--r--lib/edoc/include/Makefile4
-rw-r--r--lib/edoc/priv/Makefile6
-rw-r--r--lib/edoc/src/Makefile8
-rw-r--r--lib/edoc/src/edoc_data.erl5
-rw-r--r--lib/edoc/src/edoc_lib.erl4
-rw-r--r--lib/edoc/src/edoc_parser.yrl4
-rw-r--r--lib/edoc/test/Makefile10
-rw-r--r--lib/edoc/vsn.mk2
-rw-r--r--lib/eldap/.gitignore4
-rw-r--r--lib/eldap/AUTHORS7
-rw-r--r--lib/eldap/LICENSE21
-rw-r--r--lib/eldap/Makefile (renamed from lib/inviso/Makefile)34
-rw-r--r--lib/eldap/README33
-rw-r--r--lib/eldap/asn1/ELDAPv3.asn1278
-rw-r--r--lib/eldap/doc/html/.gitignore (renamed from lib/inviso/doc/html/.gitignore)0
-rw-r--r--lib/eldap/doc/man3/.gitignore (renamed from lib/inviso/doc/man3/.gitignore)0
-rw-r--r--lib/eldap/doc/pdf/.gitignore (renamed from lib/inviso/doc/pdf/.gitignore)0
-rw-r--r--lib/eldap/doc/src/Makefile (renamed from lib/inviso/doc/src/Makefile)55
-rw-r--r--lib/eldap/doc/src/book.xml (renamed from lib/inviso/doc/src/book.xml)17
-rw-r--r--lib/eldap/doc/src/eldap.xml342
-rw-r--r--lib/eldap/doc/src/fascicules.xml (renamed from lib/inviso/doc/src/fascicules.xml)4
-rw-r--r--lib/eldap/doc/src/note.gifbin0 -> 1539 bytes
-rw-r--r--lib/eldap/doc/src/notes.xml38
-rw-r--r--lib/eldap/doc/src/ref_man.xml (renamed from lib/inviso/doc/src/ref_man.xml)21
-rw-r--r--lib/eldap/doc/src/release_notes.xml37
-rw-r--r--lib/eldap/doc/src/usersguide.xml (renamed from lib/inviso/doc/src/part_notes.xml)21
-rw-r--r--lib/eldap/doc/src/warning.gifbin0 -> 1498 bytes
-rw-r--r--lib/eldap/ebin/.gitignore (renamed from lib/inviso/ebin/.gitignore)0
-rw-r--r--lib/eldap/include/eldap.hrl33
-rw-r--r--lib/eldap/info2
-rw-r--r--lib/eldap/src/Makefile110
-rw-r--r--lib/eldap/src/eldap.app.src8
-rw-r--r--lib/eldap/src/eldap.appup.src6
-rw-r--r--lib/eldap/src/eldap.erl1114
-rw-r--r--lib/eldap/test/Makefile83
-rw-r--r--lib/eldap/test/eldap.spec1
-rw-r--r--lib/eldap/test/eldap_basic_SUITE.erl222
-rw-r--r--lib/eldap/test/ldap_server/slapd.conf14
-rw-r--r--lib/eldap/vsn.mk1
-rw-r--r--lib/erl_docgen/doc/src/Makefile16
-rw-r--r--lib/erl_docgen/doc/src/notes.xml72
-rw-r--r--lib/erl_docgen/priv/bin/Makefile6
-rw-r--r--lib/erl_docgen/priv/css/Makefile10
-rw-r--r--lib/erl_docgen/priv/css/otp_doc.css29
-rw-r--r--lib/erl_docgen/priv/dtd/Makefile6
-rw-r--r--lib/erl_docgen/priv/dtd_html_entities/Makefile6
-rw-r--r--lib/erl_docgen/priv/dtd_man_entities/Makefile6
-rw-r--r--lib/erl_docgen/priv/images/Makefile10
-rw-r--r--lib/erl_docgen/priv/js/flipmenu/Makefile10
-rw-r--r--lib/erl_docgen/priv/xsl/Makefile6
-rw-r--r--lib/erl_docgen/priv/xsl/db_html.xsl21
-rw-r--r--lib/erl_docgen/priv/xsl/db_man.xsl26
-rw-r--r--lib/erl_docgen/priv/xsl/db_pdf.xsl22
-rw-r--r--lib/erl_docgen/src/Makefile10
-rw-r--r--lib/erl_docgen/src/docgen_edoc_xml_cb.erl37
-rw-r--r--lib/erl_docgen/vsn.mk2
-rw-r--r--lib/erl_interface/aclocal.m4108
-rw-r--r--lib/erl_interface/doc/src/Makefile20
-rw-r--r--lib/erl_interface/doc/src/notes.xml34
-rw-r--r--lib/erl_interface/src/Makefile.in52
-rw-r--r--lib/erl_interface/src/misc/ei_format.c2
-rw-r--r--lib/erl_interface/test/Makefile10
-rw-r--r--lib/erl_interface/test/all_SUITE_data/Makefile.src4
-rw-r--r--lib/erl_interface/test/all_SUITE_data/gccifier.c16
-rw-r--r--lib/erl_interface/test/all_SUITE_data/init_tc.erl7
-rw-r--r--lib/erl_interface/test/ei_tmo_SUITE.erl22
-rw-r--r--lib/erl_interface/test/erl_match_SUITE.erl32
-rw-r--r--lib/erl_interface/vsn.mk2
-rw-r--r--lib/et/doc/src/Makefile16
-rw-r--r--lib/et/doc/src/et_intro.xml6
-rw-r--r--lib/et/doc/src/notes.xml37
-rw-r--r--lib/et/examples/Makefile6
-rw-r--r--lib/et/src/Makefile18
-rw-r--r--lib/et/src/et_gs_contents_viewer.erl13
-rw-r--r--lib/et/src/et_gs_viewer.erl19
-rw-r--r--lib/et/src/et_wx_contents_viewer.erl23
-rw-r--r--lib/et/test/Makefile14
-rw-r--r--lib/et/vsn.mk2
-rw-r--r--lib/eunit/doc/overview.edoc8
-rw-r--r--lib/eunit/doc/src/Makefile14
-rw-r--r--lib/eunit/doc/src/notes.xml32
-rw-r--r--lib/eunit/examples/Makefile4
-rw-r--r--lib/eunit/include/eunit.hrl13
-rw-r--r--lib/eunit/src/Makefile24
-rw-r--r--lib/eunit/src/eunit.app.src1
-rw-r--r--lib/eunit/src/eunit.erl7
-rw-r--r--lib/eunit/src/eunit_data.erl39
-rw-r--r--lib/eunit/src/eunit_lib.erl94
-rw-r--r--lib/eunit/src/eunit_surefire.erl32
-rw-r--r--lib/eunit/src/eunit_test.erl26
-rw-r--r--lib/eunit/src/eunit_tty.erl59
-rw-r--r--lib/eunit/test/Makefile6
-rw-r--r--lib/eunit/vsn.mk2
-rw-r--r--lib/gs/contribs/bonk/Makefile18
-rw-r--r--lib/gs/contribs/bonk/bonk.erl8
-rw-r--r--lib/gs/contribs/cols/Makefile14
-rw-r--r--lib/gs/contribs/cols/cols.erl8
-rw-r--r--lib/gs/contribs/cols/highscore.erl9
-rw-r--r--lib/gs/contribs/mandel/Makefile14
-rw-r--r--lib/gs/contribs/mandel/mandel.erl7
-rw-r--r--lib/gs/contribs/othello/Makefile14
-rw-r--r--lib/gs/contribs/othello/othello_board.erl8
-rw-r--r--lib/gs/doc/src/Makefile16
-rw-r--r--lib/gs/doc/src/gs.xml6
-rw-r--r--lib/gs/doc/src/notes.xml24
-rw-r--r--lib/gs/examples/Makefile10
-rw-r--r--lib/gs/examples/ball.erl8
-rw-r--r--lib/gs/examples/browser.erl10
-rw-r--r--lib/gs/examples/calc.erl7
-rw-r--r--lib/gs/examples/calc2.erl8
-rw-r--r--lib/gs/examples/color_demo.erl7
-rw-r--r--lib/gs/examples/color_demo2.erl6
-rw-r--r--lib/gs/examples/distrib_draw.erl7
-rw-r--r--lib/gs/examples/entry_demo.erl8
-rw-r--r--lib/gs/examples/event_test.erl5
-rw-r--r--lib/gs/examples/file_dialog.erl7
-rw-r--r--lib/gs/examples/focus_demo.erl7
-rw-r--r--lib/gs/examples/frac.erl5
-rw-r--r--lib/gs/examples/line_demo.erl8
-rw-r--r--lib/gs/examples/man.erl11
-rw-r--r--lib/gs/examples/menu_demo.erl8
-rw-r--r--lib/gs/examples/rubber.erl10
-rw-r--r--lib/gs/src/Makefile14
-rw-r--r--lib/gs/src/gs.erl10
-rw-r--r--lib/gs/src/gs_frontend.erl4
-rw-r--r--lib/gs/src/gs_make.erl3
-rw-r--r--lib/gs/src/gse.erl64
-rw-r--r--lib/gs/src/gstk.erl4
-rw-r--r--lib/gs/src/gstk_arc.erl3
-rw-r--r--lib/gs/src/gstk_canvas.erl4
-rw-r--r--lib/gs/src/gstk_editor.erl5
-rw-r--r--lib/gs/src/gstk_entry.erl3
-rw-r--r--lib/gs/src/gstk_generic.erl5
-rw-r--r--lib/gs/src/gstk_grid.erl3
-rw-r--r--lib/gs/src/gstk_gridline.erl4
-rw-r--r--lib/gs/src/gstk_image.erl3
-rw-r--r--lib/gs/src/gstk_menu.erl3
-rw-r--r--lib/gs/src/gstk_menuitem.erl3
-rw-r--r--lib/gs/src/gstk_port_handler.erl3
-rw-r--r--lib/gs/src/gstk_rectangle.erl3
-rw-r--r--lib/gs/src/gstk_window.erl3
-rw-r--r--lib/gs/src/tcl2erl.erl3
-rw-r--r--lib/gs/src/tool_file_dialog.erl12
-rw-r--r--lib/gs/src/tool_utils.erl7
-rw-r--r--lib/gs/tcl/Makefile.in8
-rw-r--r--lib/gs/vsn.mk2
-rw-r--r--lib/hipe/Makefile23
-rw-r--r--lib/hipe/amd64/Makefile9
-rw-r--r--lib/hipe/arm/Makefile9
-rw-r--r--lib/hipe/boot_ebin/.gitignore (renamed from lib/inviso/include/.gitignore)0
-rw-r--r--lib/hipe/cerl/Makefile15
-rw-r--r--lib/hipe/cerl/cerl_hipe_primops.hrl3
-rw-r--r--lib/hipe/cerl/cerl_hipeify.erl3
-rw-r--r--lib/hipe/cerl/cerl_hybrid_transform.erl153
-rw-r--r--lib/hipe/cerl/cerl_messagean.erl3
-rw-r--r--lib/hipe/cerl/cerl_to_icode.erl5
-rw-r--r--lib/hipe/cerl/erl_bif_types.erl2519
-rw-r--r--lib/hipe/cerl/erl_types.erl49
-rw-r--r--lib/hipe/doc/Makefile5
-rw-r--r--lib/hipe/doc/src/Makefile15
-rw-r--r--lib/hipe/doc/src/notes.xml92
-rw-r--r--lib/hipe/flow/Makefile13
-rw-r--r--lib/hipe/flow/cfg.hrl2
-rw-r--r--lib/hipe/icode/Makefile13
-rw-r--r--lib/hipe/icode/hipe_beam_to_icode.erl75
-rw-r--r--lib/hipe/icode/hipe_icode.hrl8
-rw-r--r--lib/hipe/icode/hipe_icode_inline_bifs.erl5
-rw-r--r--lib/hipe/icode/hipe_icode_primops.erl8
-rw-r--r--lib/hipe/icode/hipe_icode_type.erl14
-rw-r--r--lib/hipe/main/Makefile15
-rw-r--r--lib/hipe/main/hipe.app.src4
-rw-r--r--lib/hipe/main/hipe.erl15
-rw-r--r--lib/hipe/misc/Makefile10
-rw-r--r--lib/hipe/native.mk4
-rw-r--r--lib/hipe/opt/Makefile9
-rw-r--r--lib/hipe/ppc/Makefile9
-rw-r--r--lib/hipe/regalloc/Makefile9
-rw-r--r--lib/hipe/rtl/Makefile11
-rw-r--r--lib/hipe/rtl/hipe_rtl_primops.erl2
-rw-r--r--lib/hipe/sparc/Makefile9
-rw-r--r--lib/hipe/sparc/hipe_rtl_to_sparc.erl38
-rw-r--r--lib/hipe/tools/Makefile6
-rw-r--r--lib/hipe/tools/hipe_tool.erl14
-rw-r--r--lib/hipe/util/Makefile13
-rw-r--r--lib/hipe/vsn.mk2
-rw-r--r--lib/hipe/x86/Makefile9
-rw-r--r--lib/ic/c_src/Makefile.in14
-rw-r--r--lib/ic/doc/src/Makefile16
-rw-r--r--lib/ic/doc/src/ic_clib.xml14
-rw-r--r--lib/ic/doc/src/notes.xml42
-rw-r--r--lib/ic/examples/pre_post_condition/Makefile6
-rw-r--r--lib/ic/java_src/com/ericsson/otp/ic/Makefile10
-rw-r--r--lib/ic/src/Makefile36
-rw-r--r--lib/ic/src/ic.erl4
-rw-r--r--lib/ic/src/ic_noc.erl21
-rw-r--r--lib/ic/src/ic_pp.erl41
-rw-r--r--lib/ic/test/Makefile52
-rw-r--r--lib/ic/test/c_client_erl_server_SUITE_data/Makefile.src23
-rw-r--r--lib/ic/test/c_client_erl_server_proto_SUITE_data/Makefile.src23
-rw-r--r--lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/Makefile.src26
-rw-r--r--lib/ic/test/erl_client_c_server_SUITE_data/Makefile.src19
-rw-r--r--lib/ic/test/erl_client_c_server_proto_SUITE_data/Makefile.src19
-rw-r--r--lib/ic/test/java_client_erl_server_SUITE.erl4
-rw-r--r--lib/ic/test/java_client_erl_server_SUITE_data/Makefile.src24
-rw-r--r--lib/ic/vsn.mk2
-rw-r--r--lib/inets/doc/src/Makefile17
-rw-r--r--lib/inets/doc/src/book.xml4
-rw-r--r--lib/inets/doc/src/fascicules.xml2
-rw-r--r--lib/inets/doc/src/ftp_client.xml4
-rw-r--r--lib/inets/doc/src/http_uri.xml160
-rw-r--r--lib/inets/doc/src/httpc.xml207
-rw-r--r--lib/inets/doc/src/httpd.xml545
-rw-r--r--lib/inets/doc/src/httpd_conf.xml58
-rw-r--r--lib/inets/doc/src/httpd_socket.xml29
-rw-r--r--lib/inets/doc/src/httpd_util.xml4
-rw-r--r--lib/inets/doc/src/inets_services.xml4
-rw-r--r--lib/inets/doc/src/mod_alias.xml92
-rw-r--r--lib/inets/doc/src/mod_auth.xml135
-rw-r--r--lib/inets/doc/src/notes.xml226
-rw-r--r--lib/inets/doc/src/notes_history.xml4
-rw-r--r--lib/inets/doc/src/part.xml4
-rw-r--r--lib/inets/doc/src/part_notes.xml4
-rw-r--r--lib/inets/doc/src/part_notes_history.xml4
-rw-r--r--lib/inets/doc/src/ref_man.xml9
-rw-r--r--lib/inets/doc/src/tftp.xml191
-rw-r--r--lib/inets/examples/httpd_load_test/Makefile4
-rw-r--r--lib/inets/examples/server_root/Makefile48
-rw-r--r--lib/inets/priv/Makefile6
-rw-r--r--lib/inets/src/ftp/Makefile12
-rw-r--r--lib/inets/src/ftp/ftp.erl2
-rw-r--r--lib/inets/src/http_client/Makefile12
-rw-r--r--lib/inets/src/http_client/httpc.erl122
-rw-r--r--lib/inets/src/http_client/httpc_handler.erl1015
-rw-r--r--lib/inets/src/http_client/httpc_internal.hrl2
-rw-r--r--lib/inets/src/http_client/httpc_manager.erl256
-rw-r--r--lib/inets/src/http_client/httpc_response.erl18
-rw-r--r--lib/inets/src/http_lib/Makefile12
-rw-r--r--lib/inets/src/http_lib/http_uri.erl127
-rw-r--r--lib/inets/src/http_server/Makefile14
-rw-r--r--lib/inets/src/http_server/httpd_conf.erl108
-rw-r--r--lib/inets/src/http_server/httpd_log.erl12
-rw-r--r--lib/inets/src/http_server/httpd_response.erl27
-rw-r--r--lib/inets/src/http_server/httpd_script_env.erl59
-rw-r--r--lib/inets/src/http_server/httpd_sup.erl19
-rw-r--r--lib/inets/src/http_server/mod_get.erl18
-rw-r--r--lib/inets/src/inets_app/Makefile19
-rw-r--r--lib/inets/src/inets_app/inets.app.src5
-rw-r--r--lib/inets/src/inets_app/inets.appup.src92
-rw-r--r--lib/inets/src/inets_app/inets.erl278
-rw-r--r--lib/inets/src/inets_app/inets.mk8
-rw-r--r--lib/inets/src/inets_app/inets_app.erl4
-rw-r--r--lib/inets/src/inets_app/inets_internal.hrl6
-rw-r--r--lib/inets/src/inets_app/inets_service.erl17
-rw-r--r--lib/inets/src/inets_app/inets_sup.erl12
-rw-r--r--lib/inets/src/inets_app/inets_trace.erl357
-rw-r--r--lib/inets/src/tftp/Makefile25
-rw-r--r--lib/inets/src/tftp/tftp.erl18
-rw-r--r--lib/inets/test/Makefile22
-rw-r--r--lib/inets/test/erl_make_certs.erl429
-rw-r--r--lib/inets/test/httpc_SUITE.erl926
-rw-r--r--lib/inets/test/httpc_proxy_SUITE.erl575
-rw-r--r--lib/inets/test/httpc_proxy_SUITE_data/apache2/apache2.conf87
-rw-r--r--lib/inets/test/httpc_proxy_SUITE_data/apache2/htdocs/index.html4
-rwxr-xr-xlib/inets/test/httpc_proxy_SUITE_data/server_proxy.sh198
-rw-r--r--lib/inets/test/httpd_SUITE.erl219
-rw-r--r--lib/inets/test/httpd_basic_SUITE.erl37
-rw-r--r--lib/inets/test/httpd_mod.erl264
-rw-r--r--lib/inets/test/httpd_test_lib.erl42
-rw-r--r--lib/inets/test/inets.spec.vxworks5
-rw-r--r--lib/inets/test/inets_test_lib.erl282
-rw-r--r--lib/inets/test/inets_test_lib.hrl5
-rw-r--r--lib/inets/test/rules.mk7
-rw-r--r--lib/inets/vsn.mk2
-rw-r--r--lib/inviso/AUTHORS4
-rw-r--r--lib/inviso/doc/src/inviso.xml693
-rw-r--r--lib/inviso/doc/src/inviso_as_lib.xml94
-rw-r--r--lib/inviso/doc/src/inviso_chapter.xml362
-rw-r--r--lib/inviso/doc/src/inviso_lfm.xml93
-rw-r--r--lib/inviso/doc/src/inviso_lfm_tpfreader.xml83
-rw-r--r--lib/inviso/doc/src/inviso_rt.xml246
-rw-r--r--lib/inviso/doc/src/inviso_rt_meta.xml78
-rw-r--r--lib/inviso/doc/src/inviso_users_guide_pic1.gifbin13514 -> 0 bytes
-rw-r--r--lib/inviso/doc/src/inviso_users_guide_pic1.ps24489
-rw-r--r--lib/inviso/doc/src/notes.xml278
-rw-r--r--lib/inviso/info2
-rw-r--r--lib/inviso/src/Makefile104
-rw-r--r--lib/inviso/src/inviso.app.src13
-rw-r--r--lib/inviso/src/inviso.appup.src1
-rw-r--r--lib/inviso/src/inviso.erl1056
-rw-r--r--lib/inviso/src/inviso_c.erl1335
-rw-r--r--lib/inviso/src/inviso_lfm.erl431
-rw-r--r--lib/inviso/src/inviso_lfm_tpfreader.erl388
-rw-r--r--lib/inviso/src/inviso_tool.erl3255
-rw-r--r--lib/inviso/src/inviso_tool_lib.erl379
-rw-r--r--lib/inviso/src/inviso_tool_sh.erl1749
-rw-r--r--lib/inviso/test/Makefile61
-rw-r--r--lib/inviso/test/inviso.cover2
-rw-r--r--lib/inviso/test/inviso.spec1
-rw-r--r--lib/inviso/test/inviso_tool_SUITE.erl1166
-rw-r--r--lib/inviso/test/inviso_tool_SUITE_data/tracecase1_off.trc12
-rw-r--r--lib/inviso/test/inviso_tool_SUITE_data/tracecase1_on.trc17
-rw-r--r--lib/inviso/test/inviso_tool_SUITE_data/tracecase2_off.trc12
-rw-r--r--lib/inviso/test/inviso_tool_SUITE_data/tracecase2_on.trc16
-rw-r--r--lib/inviso/test/inviso_tool_SUITE_data/tracecase3_on.trc9
-rw-r--r--lib/inviso/test/inviso_tool_SUITE_data/tracecase4_on.trc9
-rw-r--r--lib/inviso/test/inviso_tool_SUITE_data/tracecase5_off.trc11
-rw-r--r--lib/inviso/test/inviso_tool_SUITE_data/tracecase5_on.trc11
-rw-r--r--lib/inviso/test/inviso_tool_SUITE_data/tracecase_def.txt8
-rw-r--r--lib/inviso/test/inviso_tool_SUITE_data/tracecase_init.trc10
-rw-r--r--lib/inviso/vsn.mk1
-rw-r--r--lib/jinterface/doc/src/Makefile20
-rw-r--r--lib/jinterface/doc/src/notes.xml35
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/Makefile14
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangAtom.java4
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpErlangString.java19
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpMbox.java4
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpNode.java2
-rw-r--r--lib/jinterface/test/Makefile8
-rw-r--r--lib/jinterface/test/jitu.erl12
-rw-r--r--lib/jinterface/test/nc_SUITE.erl7
-rw-r--r--lib/jinterface/test/nc_SUITE_data/echo_server.java8
-rw-r--r--lib/jinterface/vsn.mk2
-rw-r--r--lib/kernel/doc/src/Makefile24
-rw-r--r--lib/kernel/doc/src/app.xml4
-rw-r--r--lib/kernel/doc/src/code.xml15
-rw-r--r--lib/kernel/doc/src/erl_ddll.xml159
-rw-r--r--lib/kernel/doc/src/error_logger.xml9
-rw-r--r--lib/kernel/doc/src/file.xml6
-rw-r--r--lib/kernel/doc/src/gen_sctp.xml43
-rw-r--r--lib/kernel/doc/src/gen_tcp.xml63
-rw-r--r--lib/kernel/doc/src/gen_udp.xml59
-rw-r--r--lib/kernel/doc/src/global.xml12
-rw-r--r--lib/kernel/doc/src/inet.xml89
-rw-r--r--lib/kernel/doc/src/kernel_app.xml4
-rw-r--r--lib/kernel/doc/src/notes.xml220
-rw-r--r--lib/kernel/doc/src/os.xml58
-rw-r--r--lib/kernel/doc/src/packages.xml8
-rw-r--r--lib/kernel/examples/Makefile4
-rw-r--r--lib/kernel/examples/uds_dist/c_src/uds_drv.c4
-rw-r--r--lib/kernel/src/Makefile16
-rw-r--r--lib/kernel/src/application.erl5
-rw-r--r--lib/kernel/src/application_controller.erl17
-rw-r--r--lib/kernel/src/auth.erl14
-rw-r--r--lib/kernel/src/code.erl86
-rw-r--r--lib/kernel/src/code_server.erl6
-rw-r--r--lib/kernel/src/disk_log.erl17
-rw-r--r--lib/kernel/src/disk_log.hrl4
-rw-r--r--lib/kernel/src/disk_log_1.erl2
-rw-r--r--lib/kernel/src/erl_ddll.erl94
-rw-r--r--lib/kernel/src/error_handler.erl2
-rw-r--r--lib/kernel/src/error_logger.erl14
-rw-r--r--lib/kernel/src/erts_debug.erl151
-rw-r--r--lib/kernel/src/file.erl28
-rw-r--r--lib/kernel/src/file_io_server.erl5
-rw-r--r--lib/kernel/src/gen_sctp.erl5
-rw-r--r--lib/kernel/src/gen_tcp.erl10
-rw-r--r--lib/kernel/src/gen_udp.erl7
-rw-r--r--lib/kernel/src/global.erl24
-rw-r--r--lib/kernel/src/heart.erl6
-rw-r--r--lib/kernel/src/hipe_unified_loader.erl62
-rw-r--r--lib/kernel/src/inet.erl70
-rw-r--r--lib/kernel/src/inet_config.erl59
-rw-r--r--lib/kernel/src/inet_int.hrl7
-rw-r--r--lib/kernel/src/inet_parse.erl16
-rw-r--r--lib/kernel/src/kernel.appup.src12
-rw-r--r--lib/kernel/src/net_kernel.erl13
-rw-r--r--lib/kernel/src/os.erl79
-rw-r--r--lib/kernel/src/rpc.erl4
-rw-r--r--lib/kernel/test/Makefile14
-rw-r--r--lib/kernel/test/bif_SUITE.erl96
-rw-r--r--lib/kernel/test/code_SUITE.erl101
-rw-r--r--lib/kernel/test/code_SUITE_data/other.erl38
-rw-r--r--lib/kernel/test/code_SUITE_data/upgrade_client.erl259
-rw-r--r--lib/kernel/test/code_SUITE_data/upgradee.erl123
-rw-r--r--lib/kernel/test/disk_log_SUITE.erl67
-rw-r--r--lib/kernel/test/disk_log_SUITE_data/Makefile.src15
-rw-r--r--lib/kernel/test/disk_log_SUITE_data/nfs_check.c46
-rw-r--r--lib/kernel/test/erl_prim_loader_SUITE.erl94
-rw-r--r--lib/kernel/test/file_SUITE.erl556
-rw-r--r--lib/kernel/test/file_name_SUITE.erl54
-rw-r--r--lib/kernel/test/gen_sctp_SUITE.erl200
-rw-r--r--lib/kernel/test/gen_tcp_echo_SUITE.erl25
-rw-r--r--lib/kernel/test/gen_tcp_misc_SUITE.erl212
-rw-r--r--lib/kernel/test/heart_SUITE.erl17
-rw-r--r--lib/kernel/test/heart_SUITE_data/simple_echo.c5
-rw-r--r--lib/kernel/test/inet_SUITE.erl19
-rw-r--r--lib/kernel/test/inet_sockopt_SUITE.erl2
-rw-r--r--lib/kernel/test/inet_sockopt_SUITE_data/sockopt_helper.c11
-rw-r--r--lib/kernel/test/init_SUITE.erl153
-rw-r--r--lib/kernel/test/interactive_shell_SUITE.erl8
-rw-r--r--lib/kernel/test/kernel.spec.wxworks63
-rw-r--r--lib/kernel/test/os_SUITE.erl2
-rw-r--r--lib/kernel/test/pdict_SUITE.erl1
-rw-r--r--lib/kernel/test/prim_file_SUITE.erl217
-rw-r--r--lib/kernel/test/sendfile_SUITE.erl88
-rw-r--r--lib/kernel/test/zlib_SUITE.erl21
-rw-r--r--lib/kernel/vsn.mk2
-rw-r--r--lib/megaco/Makefile27
-rw-r--r--lib/megaco/configure.in2
-rw-r--r--lib/megaco/doc/src/Makefile20
-rw-r--r--lib/megaco/doc/src/notes.xml145
-rw-r--r--lib/megaco/examples/meas/Makefile.in14
-rw-r--r--lib/megaco/examples/meas/meas.sh.skel.src3
-rw-r--r--lib/megaco/examples/meas/megaco_codec_mstone1.erl3
-rw-r--r--lib/megaco/examples/meas/megaco_codec_mstone2.erl5
-rw-r--r--lib/megaco/examples/meas/megaco_codec_mstone_lib.erl18
-rw-r--r--lib/megaco/examples/meas/mstone1.sh.skel.src25
-rw-r--r--lib/megaco/examples/simple/Makefile8
-rw-r--r--lib/megaco/src/app/Makefile18
-rw-r--r--lib/megaco/src/app/megaco.appup.src24
-rw-r--r--lib/megaco/src/binary/Makefile12
-rw-r--r--lib/megaco/src/engine/Makefile29
-rw-r--r--lib/megaco/src/engine/modules.mk3
-rw-r--r--lib/megaco/src/flex/Makefile.in29
-rw-r--r--lib/megaco/src/rules.mk4
-rw-r--r--lib/megaco/src/tcp/Makefile12
-rw-r--r--lib/megaco/src/text/Makefile12
-rw-r--r--lib/megaco/src/udp/Makefile12
-rw-r--r--lib/megaco/test/Makefile10
-rw-r--r--lib/megaco/test/megaco.spec.vxworks5
-rw-r--r--lib/megaco/test/megaco_mess_test.erl30
-rw-r--r--lib/megaco/vsn.mk4
-rw-r--r--lib/mnesia/doc/src/Makefile16
-rw-r--r--lib/mnesia/doc/src/company.erl45
-rw-r--r--lib/mnesia/doc/src/company_o.erl20
-rw-r--r--lib/mnesia/doc/src/notes.xml64
-rw-r--r--lib/mnesia/examples/Makefile12
-rw-r--r--lib/mnesia/examples/mnesia_tpcb.erl56
-rw-r--r--lib/mnesia/include/Makefile6
-rw-r--r--lib/mnesia/src/Makefile10
-rw-r--r--lib/mnesia/src/mnesia.appup.src6
-rw-r--r--lib/mnesia/src/mnesia_index.erl8
-rw-r--r--lib/mnesia/src/mnesia_loader.erl2
-rw-r--r--lib/mnesia/test/Makefile41
-rw-r--r--lib/mnesia/test/mnesia.spec.vxworks362
-rw-r--r--lib/mnesia/test/mnesia_bench.spec1
-rw-r--r--lib/mnesia/test/mnesia_bench_SUITE.erl69
-rw-r--r--lib/mnesia/test/mnesia_consistency_test.erl24
-rw-r--r--lib/mnesia/test/mnesia_dirty_access_test.erl5
-rw-r--r--lib/mnesia/test/mnesia_recovery_test.erl92
-rw-r--r--lib/mnesia/test/mnesia_test_lib.erl16
-rw-r--r--lib/mnesia/test/mnesia_trans_access_test.erl6
-rw-r--r--lib/mnesia/vsn.mk2
-rw-r--r--lib/observer/doc/src/Makefile18
-rw-r--r--lib/observer/doc/src/etop.xml33
-rw-r--r--lib/observer/doc/src/notes.xml69
-rw-r--r--lib/observer/priv/erlang_observer.pngbin4351 -> 2679 bytes
-rw-r--r--lib/observer/src/Makefile31
-rw-r--r--lib/observer/src/crashdump_viewer_html.erl4
-rw-r--r--lib/observer/src/etop.erl8
-rw-r--r--lib/observer/src/etop_gui.erl9
-rw-r--r--lib/observer/src/observer.app.src14
-rw-r--r--lib/observer/src/observer_app_wx.erl183
-rw-r--r--lib/observer/src/observer_lib.erl56
-rw-r--r--lib/observer/src/observer_perf_wx.erl575
-rw-r--r--lib/observer/src/observer_pro_wx.erl24
-rw-r--r--lib/observer/src/observer_procinfo.erl36
-rw-r--r--lib/observer/src/observer_sys_wx.erl4
-rw-r--r--lib/observer/src/observer_trace_wx.erl4
-rw-r--r--lib/observer/src/observer_traceoptions_wx.erl8
-rw-r--r--lib/observer/src/observer_tv_table.erl66
-rw-r--r--lib/observer/src/observer_wx.erl90
-rw-r--r--lib/observer/test/Makefile6
-rw-r--r--lib/observer/test/crashdump_viewer_SUITE.erl53
-rw-r--r--lib/observer/test/etop_SUITE.erl2
-rw-r--r--lib/observer/vsn.mk2
-rw-r--r--lib/odbc/aclocal.m4108
-rw-r--r--lib/odbc/c_src/Makefile.in14
-rw-r--r--lib/odbc/c_src/odbcserver.c60
-rw-r--r--lib/odbc/c_src/odbcserver.h2
-rw-r--r--lib/odbc/doc/src/Makefile16
-rw-r--r--lib/odbc/doc/src/notes.xml22
-rw-r--r--lib/odbc/src/Makefile14
-rw-r--r--lib/odbc/src/odbc.appup.src8
-rw-r--r--lib/odbc/src/odbc.erl35
-rw-r--r--lib/odbc/test/Makefile6
-rw-r--r--lib/odbc/test/odbc_test_lib.erl3
-rw-r--r--lib/odbc/vsn.mk2
-rw-r--r--lib/orber/COSS/CosNaming/Makefile12
-rw-r--r--lib/orber/c_src/Makefile.in32
-rw-r--r--lib/orber/doc/src/Makefile16
-rw-r--r--lib/orber/doc/src/ch_install.xml20
-rw-r--r--lib/orber/doc/src/notes.xml26
-rw-r--r--lib/orber/examples/Stack/Makefile6
-rw-r--r--lib/orber/java_src/Orber/Makefile6
-rw-r--r--lib/orber/priv/Makefile6
-rw-r--r--lib/orber/src/Makefile14
-rw-r--r--lib/orber/src/orber_ifr.erl4
-rw-r--r--lib/orber/src/orber_tb.erl2
-rw-r--r--lib/orber/test/Makefile14
-rw-r--r--lib/orber/test/csiv2_SUITE.erl104
-rw-r--r--lib/orber/test/orber_SUITE.erl38
-rw-r--r--lib/orber/test/orber_acl_SUITE.erl2
-rw-r--r--lib/orber/test/orber_test_lib.erl29
-rw-r--r--lib/orber/vsn.mk2
-rw-r--r--lib/os_mon/c_src/Makefile.in18
-rw-r--r--lib/os_mon/c_src/cpu_sup.c16
-rw-r--r--lib/os_mon/c_src/memsup.c110
-rw-r--r--lib/os_mon/c_src/win32sysinfo.c32
-rw-r--r--lib/os_mon/doc/src/Makefile20
-rw-r--r--lib/os_mon/doc/src/notes.xml42
-rw-r--r--lib/os_mon/mibs/Makefile18
-rw-r--r--lib/os_mon/src/Makefile12
-rw-r--r--lib/os_mon/src/disksup.erl12
-rw-r--r--lib/os_mon/src/memsup.erl8
-rw-r--r--lib/os_mon/src/os_mon.erl6
-rw-r--r--lib/os_mon/src/os_mon_sysinfo.erl2
-rw-r--r--lib/os_mon/test/Makefile9
-rw-r--r--lib/os_mon/test/os_mon.spec1
-rw-r--r--lib/os_mon/test/os_mon_mib_SUITE.cfg8
-rw-r--r--lib/os_mon/test/os_mon_mib_SUITE.erl147
-rw-r--r--lib/os_mon/vsn.mk2
-rw-r--r--lib/otp_mibs/doc/src/Makefile16
-rw-r--r--lib/otp_mibs/doc/src/notes.xml2
-rw-r--r--lib/otp_mibs/mibs/Makefile18
-rw-r--r--lib/otp_mibs/src/Makefile10
-rw-r--r--lib/parsetools/doc/src/Makefile16
-rw-r--r--lib/parsetools/src/Makefile14
-rw-r--r--lib/parsetools/test/Makefile10
-rw-r--r--lib/percept/doc/src/Makefile16
-rw-r--r--lib/percept/priv/Makefile30
-rw-r--r--lib/percept/src/Makefile14
-rw-r--r--lib/percept/src/percept.app.src30
-rw-r--r--lib/percept/test/Makefile10
-rw-r--r--lib/pman/doc/src/Makefile16
-rw-r--r--lib/pman/doc/src/notes.xml22
-rw-r--r--lib/pman/doc/src/pman.xml8
-rw-r--r--lib/pman/doc/src/pman_chapter.xml8
-rw-r--r--lib/pman/priv/Makefile4
-rw-r--r--lib/pman/src/Makefile10
-rw-r--r--lib/pman/src/pman_buf_converter.erl3
-rw-r--r--lib/pman/src/pman_buf_printer.erl4
-rw-r--r--lib/pman/src/pman_main.erl4
-rw-r--r--lib/pman/src/pman_module_info.erl4
-rw-r--r--lib/pman/src/pman_shell.erl6
-rw-r--r--lib/pman/src/pman_tool.erl3
-rw-r--r--lib/pman/src/pman_win.erl12
-rw-r--r--lib/pman/vsn.mk2
-rw-r--r--lib/public_key/asn1/Makefile14
-rw-r--r--lib/public_key/asn1/OTP-PKIX.asn118
-rw-r--r--lib/public_key/asn1/PKCS-1.asn13
-rw-r--r--lib/public_key/doc/src/Makefile16
-rw-r--r--lib/public_key/doc/src/notes.xml56
-rw-r--r--lib/public_key/doc/src/public_key.xml25
-rw-r--r--lib/public_key/src/Makefile14
-rw-r--r--lib/public_key/src/pubkey_cert.erl4
-rw-r--r--lib/public_key/src/pubkey_cert_records.erl11
-rw-r--r--lib/public_key/src/pubkey_ssh.erl235
-rw-r--r--lib/public_key/src/public_key.appup.src12
-rw-r--r--lib/public_key/src/public_key.erl128
-rw-r--r--lib/public_key/test/Makefile14
-rw-r--r--lib/public_key/test/public_key_SUITE.erl84
-rw-r--r--lib/public_key/test/public_key_SUITE_data/auth_keys4
-rw-r--r--lib/public_key/test/public_key_SUITE_data/known_hosts5
-rw-r--r--lib/public_key/test/public_key_SUITE_data/ssh1_auth_keys6
-rw-r--r--lib/public_key/test/public_key_SUITE_data/ssh1_known_hosts1
-rw-r--r--lib/public_key/vsn.mk2
-rw-r--r--lib/reltool/doc/src/Makefile16
-rw-r--r--lib/reltool/doc/src/notes.xml167
-rw-r--r--lib/reltool/doc/src/reltool.xml105
-rw-r--r--lib/reltool/doc/src/reltool_usage.xml11
-rw-r--r--lib/reltool/examples/Makefile6
-rw-r--r--lib/reltool/src/Makefile12
-rw-r--r--lib/reltool/src/reltool.erl6
-rw-r--r--lib/reltool/src/reltool.hrl98
-rw-r--r--lib/reltool/src/reltool_app_win.erl19
-rw-r--r--lib/reltool/src/reltool_mod_win.erl8
-rw-r--r--lib/reltool/src/reltool_server.erl2114
-rw-r--r--lib/reltool/src/reltool_sys_win.erl321
-rw-r--r--lib/reltool/src/reltool_target.erl251
-rw-r--r--lib/reltool/src/reltool_utils.erl95
-rw-r--r--lib/reltool/test/Makefile17
-rw-r--r--lib/reltool/test/reltool.spec1
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE.erl266
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE_data/Makefile.src28
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/ebin/x.app7
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/src/x1.erl5
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/src/x2.erl5
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/src/x3.erl5
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/ebin/y.app7
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/src/y1.erl5
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/src/y2.erl5
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/src/y3.erl5
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/z-1.0/ebin/z.app7
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/z-1.0/src/z1.erl5
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE_data/faulty_app_file/a-1.0/ebin/a.app1
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE_data/faulty_app_file/a-1.0/src/a.erl (renamed from lib/sasl/test/release_handler_SUITE_data/P2B/a-2.0/src/a.erl)2
-rw-r--r--lib/reltool/test/reltool_manual_gui_SUITE_data/faulty_app_file/a-1.0/src/a_sup.erl (renamed from lib/sasl/test/release_handler_SUITE_data/P2B/a-2.0/src/a_sup.erl)0
-rw-r--r--lib/reltool/test/reltool_server_SUITE.erl2006
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/Makefile.src49
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/ebin/x.app7
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/src/x1.erl5
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/src/x2.erl5
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/src/x3.erl5
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/ebin/y.app7
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/src/y0.erl5
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/src/y1.erl5
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/src/y2.erl5
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/dependencies/z-1.0/ebin/z.app7
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/dependencies/z-1.0/src/z1.erl5
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/dupl_mod/a-1.0/ebin/a.app7
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/escript/someapp-1.0/ebin/someapp.app6
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/escript/someapp-1.0/src/mymod.erl26
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/faulty_app_file/a-1.0/ebin/a.app1
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/faulty_app_file/a-1.0/src/a.erl49
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/faulty_app_file/a-1.0/src/a_sup.erl37
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-first/ebin/b.app6
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-first/src/b.erl4
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-second/ebin/b.app6
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-second/src/b.erl4
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/slim/a-1.0/ebin/a.app (renamed from lib/sasl/test/release_handler_SUITE_data/P2B/a-2.0/ebin/a.app)5
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/slim/a-1.0/src/a.erl49
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/slim/a-1.0/src/a_sup.erl37
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/sort_apps/x-1.0/ebin/x.app7
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/sort_apps/y-1.0/ebin/y.app7
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/sort_apps/z-1.0/ebin/z.app8
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-1.0/ebin/b.app6
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-1.0/rel/.gitignore (renamed from lib/inviso/priv)0
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-1.0/src/b.erl4
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-3.0/ebin/b.app6
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-3.0/src/b.erl4
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/lib2/b-2.0/ebin/b.app6
-rw-r--r--lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/lib2/b-2.0/src/b.erl4
-rw-r--r--lib/reltool/test/reltool_test_lib.erl6
-rw-r--r--lib/reltool/test/reltool_test_lib.hrl34
-rw-r--r--lib/reltool/test/reltool_wx_SUITE.erl43
-rw-r--r--lib/reltool/vsn.mk2
-rw-r--r--lib/runtime_tools/c_src/Makefile.in99
-rw-r--r--lib/runtime_tools/c_src/dtrace_user.d33
-rw-r--r--lib/runtime_tools/c_src/dyntrace.c127
-rw-r--r--lib/runtime_tools/c_src/trace_ip_drv.c33
-rw-r--r--lib/runtime_tools/doc/src/Makefile31
-rw-r--r--lib/runtime_tools/doc/src/book.xml3
-rw-r--r--lib/runtime_tools/doc/src/dyntrace.xml209
-rw-r--r--lib/runtime_tools/doc/src/notes.xml70
-rw-r--r--lib/runtime_tools/doc/src/part.xml (renamed from lib/inviso/doc/src/part.xml)19
-rw-r--r--lib/runtime_tools/doc/src/ref_man.xml3
-rw-r--r--lib/runtime_tools/examples/dist.d62
-rw-r--r--lib/runtime_tools/examples/dist.systemtap76
-rw-r--r--lib/runtime_tools/examples/driver1.d114
-rw-r--r--lib/runtime_tools/examples/driver1.systemtap125
-rw-r--r--lib/runtime_tools/examples/efile_drv.d104
-rw-r--r--lib/runtime_tools/examples/efile_drv.systemtap112
-rw-r--r--lib/runtime_tools/examples/function-calls.d57
-rw-r--r--lib/runtime_tools/examples/function-calls.systemtap67
-rw-r--r--lib/runtime_tools/examples/garbage-collection.d39
-rw-r--r--lib/runtime_tools/examples/garbage-collection.systemtap49
-rw-r--r--lib/runtime_tools/examples/memory1.d41
-rw-r--r--lib/runtime_tools/examples/memory1.systemtap51
-rw-r--r--lib/runtime_tools/examples/messages.d94
-rw-r--r--lib/runtime_tools/examples/messages.systemtap87
-rw-r--r--lib/runtime_tools/examples/port1.d142
-rw-r--r--lib/runtime_tools/examples/port1.systemtap152
-rw-r--r--lib/runtime_tools/examples/process-scheduling.d (renamed from erts/emulator/sys/vxworks/driver_int.h)33
-rw-r--r--lib/runtime_tools/examples/process-scheduling.systemtap45
-rw-r--r--lib/runtime_tools/examples/spawn-exit.d41
-rw-r--r--lib/runtime_tools/examples/spawn-exit.systemtap51
-rw-r--r--lib/runtime_tools/examples/user-probe-n.d44
-rw-r--r--lib/runtime_tools/examples/user-probe-n.systemtap53
-rw-r--r--lib/runtime_tools/examples/user-probe.d36
-rw-r--r--lib/runtime_tools/examples/user-probe.systemtap46
-rw-r--r--lib/runtime_tools/src/Makefile30
-rw-r--r--lib/runtime_tools/src/dbg.erl6
-rw-r--r--lib/runtime_tools/src/dyntrace.erl352
-rw-r--r--lib/runtime_tools/src/inviso_as_lib.erl155
-rw-r--r--lib/runtime_tools/src/inviso_autostart.erl201
-rw-r--r--lib/runtime_tools/src/inviso_autostart_server.erl311
-rw-r--r--lib/runtime_tools/src/inviso_rt.erl2885
-rw-r--r--lib/runtime_tools/src/inviso_rt_lib.erl474
-rw-r--r--lib/runtime_tools/src/inviso_rt_meta.erl1207
-rw-r--r--lib/runtime_tools/src/observer_backend.erl20
-rw-r--r--lib/runtime_tools/src/runtime_tools.app.src11
-rw-r--r--lib/runtime_tools/src/runtime_tools_sup.erl12
-rw-r--r--lib/runtime_tools/test/Makefile13
-rw-r--r--lib/runtime_tools/test/dbg_SUITE.erl65
-rw-r--r--lib/runtime_tools/test/dyntrace_SUITE.erl224
-rw-r--r--lib/runtime_tools/test/inviso_SUITE.erl2838
-rw-r--r--lib/runtime_tools/test/inviso_testmodule1_foo.erl9
-rw-r--r--lib/runtime_tools/test/runtime_tools_SUITE.erl21
-rw-r--r--lib/runtime_tools/vsn.mk2
-rw-r--r--lib/sasl/doc/src/Makefile22
-rw-r--r--lib/sasl/doc/src/appup.xml24
-rw-r--r--lib/sasl/doc/src/notes.xml98
-rw-r--r--lib/sasl/doc/src/rel.xml4
-rw-r--r--lib/sasl/examples/src/Makefile10
-rw-r--r--lib/sasl/src/Makefile12
-rw-r--r--lib/sasl/src/release_handler.erl4
-rw-r--r--lib/sasl/src/systools.hrl5
-rw-r--r--lib/sasl/src/systools_make.erl117
-rw-r--r--lib/sasl/src/systools_rc.erl40
-rw-r--r--lib/sasl/test/Makefile12
-rw-r--r--lib/sasl/test/installer.erl6
-rw-r--r--lib/sasl/test/rb_SUITE.erl27
-rw-r--r--lib/sasl/test/release_handler_SUITE.erl72
-rw-r--r--lib/sasl/test/release_handler_SUITE_data/Makefile.src12
-rw-r--r--lib/sasl/test/release_handler_SUITE_data/c/c.app2
-rw-r--r--lib/sasl/test/release_handler_SUITE_data/lib/a-1.0/ebin/a.app2
-rw-r--r--lib/sasl/test/release_handler_SUITE_data/lib/a-1.1/ebin/a.app2
-rw-r--r--lib/sasl/test/release_handler_SUITE_data/lib/a-1.2/ebin/a.app2
-rw-r--r--lib/sasl/test/release_handler_SUITE_data/lib/b-1.0/ebin/b.app2
-rw-r--r--lib/sasl/test/release_handler_SUITE_data/lib/b-2.0/ebin/b.app2
-rw-r--r--lib/sasl/test/release_handler_SUITE_data/lib/many_mods-1.0/ebin/many_mods.app12
-rw-r--r--lib/sasl/test/release_handler_SUITE_data/lib/many_mods-1.1/ebin/many_mods.app12
-rw-r--r--lib/sasl/test/release_handler_SUITE_data/lib/many_mods-2.0/ebin/many_mods.app2
-rw-r--r--lib/sasl/test/systools_SUITE.erl157
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_bad_app_vsn/lib/db-2.1/ebin/db.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_bad_app_vsn/lib/fe-3.1/ebin/fe.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_bad_appup/lib/fe-2.1/ebin/fe.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_bad_appup/lib/fe-3.1/ebin/fe.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_bad_mod+warn/lib/db-2.1/ebin/db.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_bad_mod+warn/lib/fe-3.1/ebin/fe.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_links/lib/db-2.1/ebin/db.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_missing_src/lib/db-2.1/ebin/db.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_missing_src/lib/fe-3.1/ebin/fe.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_no_appup/lib/fe-2.1/ebin/fe.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_no_appup/lib/fe-3.1/ebin/fe.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_no_appup/lib/fe-500.18.7/ebin/fe.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_normal/lib/db-1.0/ebin/db.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_normal/lib/db-1.1/ebin/db.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_normal/lib/db-2.1/ebin/db.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_normal/lib/fe-2.1.1/ebin/fe.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_normal/lib/fe-2.1/ebin/fe.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_normal/lib/fe-3.1/ebin/fe.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1.1/ebin/fe.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1/ebin/fe.app2
-rw-r--r--lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.app2
-rw-r--r--lib/sasl/test/systools_rc_SUITE.erl18
-rw-r--r--lib/sasl/vsn.mk2
-rw-r--r--lib/snmp/doc/src/Makefile28
-rw-r--r--lib/snmp/doc/src/notes.xml230
-rw-r--r--lib/snmp/doc/src/snmp.xml28
-rw-r--r--lib/snmp/doc/src/snmp_app.xml14
-rw-r--r--lib/snmp/doc/src/snmp_config.xml17
-rw-r--r--lib/snmp/doc/src/snmp_generic.xml81
-rw-r--r--lib/snmp/doc/src/snmp_manager_netif.xml43
-rw-r--r--lib/snmp/doc/src/snmpa.xml32
-rw-r--r--lib/snmp/doc/src/snmpa_network_interface_filter.xml8
-rw-r--r--lib/snmp/doc/src/snmpm.xml48
-rw-r--r--lib/snmp/doc/src/snmpm_network_interface_filter.xml13
-rw-r--r--lib/snmp/examples/ex1/Makefile4
-rw-r--r--lib/snmp/examples/ex2/Makefile4
-rw-r--r--lib/snmp/examples/ex2/snmp_ex2_manager.erl13
-rw-r--r--lib/snmp/include/snmp_types.hrl27
-rw-r--r--lib/snmp/mibs/Makefile.in26
-rw-r--r--lib/snmp/priv/conf/agent/Makefile8
-rw-r--r--lib/snmp/priv/conf/manager/Makefile8
-rw-r--r--lib/snmp/src/agent/Makefile16
-rw-r--r--lib/snmp/src/agent/depend.mk2
-rw-r--r--lib/snmp/src/agent/snmp_community_mib.erl21
-rw-r--r--lib/snmp/src/agent/snmp_framework_mib.erl27
-rw-r--r--lib/snmp/src/agent/snmp_generic_mnesia.erl2
-rw-r--r--lib/snmp/src/agent/snmp_notification_mib.erl19
-rw-r--r--lib/snmp/src/agent/snmp_standard_mib.erl30
-rw-r--r--lib/snmp/src/agent/snmp_target_mib.erl8
-rw-r--r--lib/snmp/src/agent/snmp_user_based_sm_mib.erl196
-rw-r--r--lib/snmp/src/agent/snmp_view_based_acm_mib.erl115
-rw-r--r--lib/snmp/src/agent/snmpa.erl24
-rw-r--r--lib/snmp/src/agent/snmpa_agent.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_internal.hrl2
-rw-r--r--lib/snmp/src/agent/snmpa_local_db.erl4
-rw-r--r--lib/snmp/src/agent/snmpa_mib.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_mib_lib.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_supervisor.erl2
-rw-r--r--lib/snmp/src/agent/snmpa_trap.erl2
-rw-r--r--lib/snmp/src/app/Makefile16
-rw-r--r--lib/snmp/src/app/snmp.app.src3
-rw-r--r--lib/snmp/src/app/snmp.appup.src570
-rw-r--r--lib/snmp/src/app/snmp.erl9
-rw-r--r--lib/snmp/src/compile/Makefile16
-rw-r--r--lib/snmp/src/compile/snmpc_lib.erl38
-rw-r--r--lib/snmp/src/manager/Makefile16
-rw-r--r--lib/snmp/src/manager/depend.mk9
-rw-r--r--lib/snmp/src/manager/modules.mk3
-rw-r--r--lib/snmp/src/manager/snmpm.erl25
-rw-r--r--lib/snmp/src/manager/snmpm_config.erl2
-rw-r--r--lib/snmp/src/manager/snmpm_mpd.erl8
-rw-r--r--lib/snmp/src/manager/snmpm_net_if_mt.erl1259
-rw-r--r--lib/snmp/src/misc/Makefile16
-rw-r--r--lib/snmp/src/misc/snmp_conf.erl17
-rw-r--r--lib/snmp/src/misc/snmp_config.erl95
-rw-r--r--lib/snmp/src/misc/snmp_log.erl110
-rw-r--r--lib/snmp/src/misc/snmp_pdus.erl112
-rw-r--r--lib/snmp/src/misc/snmp_verbosity.erl6
-rw-r--r--lib/snmp/test/Makefile17
-rw-r--r--lib/snmp/test/exp/.gitignore0
-rw-r--r--lib/snmp/test/exp/snmp_agent_bl_test.erl (renamed from lib/snmp/test/snmp_agent_bl_test.erl)59
-rw-r--r--lib/snmp/test/exp/snmp_agent_ms_test.erl (renamed from lib/snmp/test/snmp_agent_ms_test.erl)52
-rw-r--r--lib/snmp/test/exp/snmp_agent_mt_test.erl (renamed from lib/snmp/test/snmp_agent_mt_test.erl)52
-rw-r--r--lib/snmp/test/exp/snmp_agent_v1_test.erl (renamed from lib/snmp/test/snmp_agent_v1_test.erl)2
-rw-r--r--lib/snmp/test/exp/snmp_agent_v2_test.erl (renamed from lib/snmp/test/snmp_agent_v2_test.erl)52
-rw-r--r--lib/snmp/test/exp/snmp_agent_v3_test.erl (renamed from lib/snmp/test/snmp_agent_v3_test.erl)51
-rw-r--r--lib/snmp/test/modules.mk7
-rw-r--r--lib/snmp/test/snmp.spec.vxworks4
-rw-r--r--lib/snmp/test/snmp_SUITE.erl47
-rw-r--r--lib/snmp/test/snmp_agent_test.erl569
-rw-r--r--lib/snmp/test/snmp_agent_test_lib.erl222
-rw-r--r--lib/snmp/test/snmp_app_test.erl43
-rw-r--r--lib/snmp/test/snmp_compiler_test.erl109
-rw-r--r--lib/snmp/test/snmp_log_test.erl29
-rw-r--r--lib/snmp/test/snmp_manager_test.erl294
-rw-r--r--lib/snmp/test/snmp_pdus_test.erl178
-rw-r--r--lib/snmp/test/snmp_test_data/Test3.mib123
-rw-r--r--lib/snmp/test/snmp_test_lib.erl101
-rw-r--r--lib/snmp/test/snmp_test_mgr.erl1
-rw-r--r--lib/snmp/test/test-mibs/RMON-MIB.mib7782
-rw-r--r--lib/snmp/vsn.mk2
-rw-r--r--lib/ssh/doc/src/Makefile16
-rw-r--r--lib/ssh/doc/src/notes.xml174
-rw-r--r--lib/ssh/doc/src/ssh.xml84
-rw-r--r--lib/ssh/examples/Makefile6
-rw-r--r--lib/ssh/src/DSS.asn120
-rw-r--r--lib/ssh/src/Makefile75
-rw-r--r--lib/ssh/src/PKCS-1.asn1116
-rw-r--r--lib/ssh/src/prebuild.skip2
-rw-r--r--lib/ssh/src/ssh.app.src9
-rw-r--r--lib/ssh/src/ssh.appup.src40
-rw-r--r--lib/ssh/src/ssh.erl369
-rw-r--r--lib/ssh/src/ssh.hrl17
-rw-r--r--lib/ssh/src/ssh_acceptor.erl8
-rw-r--r--lib/ssh/src/ssh_auth.erl160
-rw-r--r--lib/ssh/src/ssh_auth.hrl2
-rw-r--r--lib/ssh/src/ssh_bits.erl6
-rw-r--r--lib/ssh/src/ssh_channel.erl4
-rw-r--r--lib/ssh/src/ssh_connect.hrl6
-rw-r--r--lib/ssh/src/ssh_connection.erl56
-rw-r--r--lib/ssh/src/ssh_connection_handler.erl298
-rw-r--r--lib/ssh/src/ssh_connection_manager.erl170
-rw-r--r--lib/ssh/src/ssh_connection_sup.erl119
-rw-r--r--lib/ssh/src/ssh_dsa.erl95
-rw-r--r--lib/ssh/src/ssh_file.erl646
-rw-r--r--lib/ssh/src/ssh_key_api.erl45
-rw-r--r--lib/ssh/src/ssh_rsa.erl298
-rw-r--r--lib/ssh/src/ssh_sftpd.erl36
-rw-r--r--lib/ssh/src/ssh_sftpd_file_api.erl62
-rw-r--r--lib/ssh/src/ssh_subsystem_sup.erl14
-rw-r--r--lib/ssh/src/ssh_system_sup.erl4
-rw-r--r--lib/ssh/src/ssh_transport.erl271
-rw-r--r--lib/ssh/src/ssh_xfer.erl16
-rw-r--r--lib/ssh/src/sshc_sup.erl26
-rw-r--r--lib/ssh/test/Makefile15
-rw-r--r--lib/ssh/test/ssh.spec.vxworks3
-rw-r--r--lib/ssh/test/ssh_SUITE.erl72
-rw-r--r--lib/ssh/test/ssh_basic_SUITE.erl329
-rw-r--r--lib/ssh/test/ssh_basic_SUITE_data/id_dsa.pub1
-rw-r--r--lib/ssh/test/ssh_basic_SUITE_data/id_rsa27
-rw-r--r--lib/ssh/test/ssh_basic_SUITE_data/id_rsa.pub1
-rw-r--r--lib/ssh/test/ssh_basic_SUITE_data/ssh_host_dsa_key20
-rw-r--r--lib/ssh/test/ssh_basic_SUITE_data/ssh_host_dsa_key.pub11
-rw-r--r--lib/ssh/test/ssh_basic_SUITE_data/ssh_host_rsa_key.pub5
-rw-r--r--lib/ssh/test/ssh_sftp_SUITE.erl132
-rw-r--r--lib/ssh/test/ssh_sftp_SUITE_data/ssh_host_dsa_key13
-rw-r--r--lib/ssh/test/ssh_sftp_SUITE_data/ssh_host_dsa_key.pub11
-rw-r--r--lib/ssh/test/ssh_sftpd_SUITE.erl120
-rw-r--r--lib/ssh/test/ssh_sftpd_SUITE_data/id_dsa13
-rw-r--r--lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl49
-rw-r--r--lib/ssh/test/ssh_sftpd_erlclient_SUITE_data/id_dsa13
-rw-r--r--lib/ssh/test/ssh_test_lib.erl192
-rw-r--r--lib/ssh/test/ssh_to_openssh_SUITE.erl131
-rw-r--r--lib/ssh/vsn.mk2
-rw-r--r--lib/ssl/doc/src/Makefile20
-rw-r--r--lib/ssl/doc/src/notes.xml113
-rw-r--r--lib/ssl/doc/src/ssl.xml103
-rw-r--r--lib/ssl/examples/certs/Makefile8
-rw-r--r--lib/ssl/examples/src/Makefile10
-rw-r--r--lib/ssl/examples/src/client_server.erl24
-rw-r--r--lib/ssl/src/Makefile33
-rw-r--r--lib/ssl/src/inet_tls_dist.erl16
-rw-r--r--lib/ssl/src/ssl.appup.src24
-rw-r--r--lib/ssl/src/ssl.erl198
-rw-r--r--lib/ssl/src/ssl_alert.erl4
-rw-r--r--lib/ssl/src/ssl_alert.hrl4
-rw-r--r--lib/ssl/src/ssl_certificate.erl13
-rw-r--r--lib/ssl/src/ssl_certificate_db.erl193
-rw-r--r--lib/ssl/src/ssl_cipher.erl320
-rw-r--r--lib/ssl/src/ssl_cipher.hrl46
-rw-r--r--lib/ssl/src/ssl_connection.erl714
-rw-r--r--lib/ssl/src/ssl_handshake.erl728
-rw-r--r--lib/ssl/src/ssl_handshake.hrl45
-rw-r--r--lib/ssl/src/ssl_internal.hrl14
-rw-r--r--lib/ssl/src/ssl_manager.erl206
-rw-r--r--lib/ssl/src/ssl_record.erl40
-rw-r--r--lib/ssl/src/ssl_record.hrl13
-rw-r--r--lib/ssl/src/ssl_session.erl120
-rw-r--r--lib/ssl/src/ssl_session_cache.erl4
-rw-r--r--lib/ssl/src/ssl_ssl3.erl54
-rw-r--r--lib/ssl/src/ssl_tls1.erl190
-rw-r--r--lib/ssl/src/ssl_tls_dist_proxy.erl48
-rw-r--r--lib/ssl/test/Makefile14
-rw-r--r--lib/ssl/test/make_certs.erl19
-rw-r--r--lib/ssl/test/ssl_basic_SUITE.erl522
-rw-r--r--lib/ssl/test/ssl_cipher_SUITE.erl68
-rw-r--r--lib/ssl/test/ssl_dist_SUITE.erl16
-rw-r--r--lib/ssl/test/ssl_handshake_SUITE.erl5
-rw-r--r--lib/ssl/test/ssl_npn_handshake_SUITE.erl310
-rw-r--r--lib/ssl/test/ssl_npn_hello_SUITE.erl117
-rw-r--r--lib/ssl/test/ssl_packet_SUITE.erl355
-rw-r--r--lib/ssl/test/ssl_payload_SUITE.erl58
-rw-r--r--lib/ssl/test/ssl_session_cache_SUITE.erl3
-rw-r--r--lib/ssl/test/ssl_test_lib.erl34
-rw-r--r--lib/ssl/test/ssl_to_openssl_SUITE.erl884
-rw-r--r--lib/ssl/vsn.mk2
-rw-r--r--lib/stdlib/doc/src/Makefile20
-rw-r--r--lib/stdlib/doc/src/binary.xml226
-rw-r--r--lib/stdlib/doc/src/digraph_utils.xml4
-rw-r--r--lib/stdlib/doc/src/epp.xml2
-rw-r--r--lib/stdlib/doc/src/ets.xml537
-rw-r--r--lib/stdlib/doc/src/filelib.xml9
-rw-r--r--lib/stdlib/doc/src/gb_trees.xml18
-rw-r--r--lib/stdlib/doc/src/gen_event.xml63
-rw-r--r--lib/stdlib/doc/src/gen_fsm.xml55
-rw-r--r--lib/stdlib/doc/src/gen_server.xml41
-rw-r--r--lib/stdlib/doc/src/lists.xml72
-rw-r--r--lib/stdlib/doc/src/math.xml57
-rw-r--r--lib/stdlib/doc/src/ms_transform.xml4
-rw-r--r--lib/stdlib/doc/src/notes.xml245
-rw-r--r--lib/stdlib/doc/src/re.xml94
-rw-r--r--lib/stdlib/doc/src/sofs.xml10
-rw-r--r--lib/stdlib/doc/src/string.xml26
-rw-r--r--lib/stdlib/doc/src/supervisor.xml46
-rw-r--r--lib/stdlib/doc/src/supervisor_bridge.xml7
-rw-r--r--lib/stdlib/doc/src/unicode.xml50
-rw-r--r--lib/stdlib/doc/src/unicode_usage.xml10
-rw-r--r--lib/stdlib/examples/Makefile4
-rw-r--r--lib/stdlib/examples/erl_id_trans.erl9
-rw-r--r--lib/stdlib/src/Makefile17
-rw-r--r--lib/stdlib/src/binary.erl194
-rw-r--r--lib/stdlib/src/dets.erl151
-rw-r--r--lib/stdlib/src/digraph_utils.erl4
-rw-r--r--lib/stdlib/src/epp.erl2
-rw-r--r--lib/stdlib/src/erl_compile.erl14
-rw-r--r--lib/stdlib/src/erl_eval.erl1
-rw-r--r--lib/stdlib/src/erl_expand_records.erl2
-rw-r--r--lib/stdlib/src/erl_internal.erl3
-rw-r--r--lib/stdlib/src/erl_lint.erl79
-rw-r--r--lib/stdlib/src/erl_scan.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/escript.erl32
-rw-r--r--lib/stdlib/src/ets.erl442
-rw-r--r--lib/stdlib/src/filelib.erl41
-rw-r--r--lib/stdlib/src/filename.erl4
-rw-r--r--lib/stdlib/src/gen.erl22
-rw-r--r--lib/stdlib/src/gen_event.erl12
-rw-r--r--lib/stdlib/src/gen_fsm.erl29
-rw-r--r--lib/stdlib/src/gen_server.erl27
-rw-r--r--lib/stdlib/src/io_lib.erl7
-rw-r--r--lib/stdlib/src/lib.erl4
-rw-r--r--lib/stdlib/src/lists.erl65
-rw-r--r--lib/stdlib/src/math.erl112
-rw-r--r--lib/stdlib/src/ms_transform.erl2
-rw-r--r--lib/stdlib/src/otp_internal.erl20
-rw-r--r--lib/stdlib/src/qlc_pt.erl4
-rw-r--r--lib/stdlib/src/re.erl72
-rw-r--r--lib/stdlib/src/stdlib.appup.src12
-rw-r--r--lib/stdlib/src/string.erl26
-rw-r--r--lib/stdlib/src/supervisor.erl195
-rw-r--r--lib/stdlib/src/unicode.erl48
-rw-r--r--lib/stdlib/src/zip.erl4
-rw-r--r--lib/stdlib/test/Makefile10
-rw-r--r--lib/stdlib/test/dets_SUITE.erl72
-rw-r--r--lib/stdlib/test/digraph_utils_SUITE.erl5
-rw-r--r--lib/stdlib/test/dummy_via.erl94
-rw-r--r--lib/stdlib/test/edlin_expand_SUITE.erl10
-rw-r--r--lib/stdlib/test/erl_eval_SUITE.erl41
-rw-r--r--lib/stdlib/test/erl_expand_records_SUITE.erl4
-rw-r--r--lib/stdlib/test/erl_lint_SUITE.erl54
-rw-r--r--lib/stdlib/test/escript_SUITE.erl153
-rw-r--r--lib/stdlib/test/escript_SUITE_data/archive_script/archive_script_main2.erl19
-rw-r--r--lib/stdlib/test/escript_SUITE_data/archive_script_file_access/archive_script_file_access.erl105
-rw-r--r--lib/stdlib/test/ets_SUITE.erl95
-rw-r--r--lib/stdlib/test/filelib_SUITE.erl57
-rw-r--r--lib/stdlib/test/filename_SUITE.erl263
-rw-r--r--lib/stdlib/test/gen_event_SUITE.erl26
-rw-r--r--lib/stdlib/test/gen_fsm_SUITE.erl88
-rw-r--r--lib/stdlib/test/gen_server_SUITE.erl94
-rw-r--r--lib/stdlib/test/id_transform_SUITE.erl11
-rw-r--r--lib/stdlib/test/io_proto_SUITE.erl29
-rw-r--r--lib/stdlib/test/ms_transform_SUITE.erl5
-rw-r--r--lib/stdlib/test/qlc_SUITE.erl41
-rw-r--r--lib/stdlib/test/re_SUITE.erl8
-rw-r--r--lib/stdlib/test/shell_SUITE.erl23
-rw-r--r--lib/stdlib/test/sofs_SUITE.erl59
-rw-r--r--lib/stdlib/test/stdlib.spec.vxworks8
-rw-r--r--lib/stdlib/test/supervisor_SUITE.erl122
-rw-r--r--lib/stdlib/test/supervisor_deadlock.erl45
-rw-r--r--lib/stdlib/test/sys_SUITE.erl88
-rw-r--r--lib/stdlib/test/timer_SUITE.erl8
-rw-r--r--lib/stdlib/vsn.mk2
-rw-r--r--lib/syntax_tools/doc/overview.edoc6
-rw-r--r--lib/syntax_tools/doc/src/Makefile16
-rw-r--r--lib/syntax_tools/doc/src/notes.xml35
-rw-r--r--lib/syntax_tools/examples/Makefile4
-rw-r--r--lib/syntax_tools/src/Makefile8
-rw-r--r--lib/syntax_tools/src/epp_dodger.erl4
-rw-r--r--lib/syntax_tools/src/erl_comment_scan.erl2
-rw-r--r--lib/syntax_tools/src/erl_prettypr.erl4
-rw-r--r--lib/syntax_tools/src/erl_recomment.erl4
-rw-r--r--lib/syntax_tools/src/erl_syntax.erl1913
-rw-r--r--lib/syntax_tools/src/erl_syntax_lib.erl4
-rw-r--r--lib/syntax_tools/src/erl_tidy.erl4
-rw-r--r--lib/syntax_tools/src/igor.erl4
-rw-r--r--lib/syntax_tools/src/prettypr.erl4
-rw-r--r--lib/syntax_tools/test/Makefile8
-rw-r--r--lib/syntax_tools/vsn.mk2
-rw-r--r--lib/test_server/doc/src/Makefile20
-rw-r--r--lib/test_server/doc/src/notes.xml223
-rw-r--r--lib/test_server/doc/src/test_server_ctrl.xml8
-rw-r--r--lib/test_server/doc/src/ts.xml31
-rw-r--r--lib/test_server/src/Makefile30
-rw-r--r--lib/test_server/src/configure.in36
-rw-r--r--lib/test_server/src/test_server.erl936
-rw-r--r--lib/test_server/src/test_server_ctrl.erl427
-rw-r--r--lib/test_server/src/test_server_h.erl46
-rw-r--r--lib/test_server/src/test_server_internal.hrl2
-rw-r--r--lib/test_server/src/test_server_node.erl76
-rw-r--r--lib/test_server/src/test_server_sup.erl76
-rw-r--r--lib/test_server/src/ts.erl210
-rw-r--r--lib/test_server/src/ts.hrl3
-rw-r--r--lib/test_server/src/ts_autoconf_vxworks.erl191
-rw-r--r--lib/test_server/src/ts_autoconf_win32.erl3
-rw-r--r--lib/test_server/src/ts_benchmark.erl91
-rw-r--r--lib/test_server/src/ts_erl_config.erl83
-rw-r--r--lib/test_server/src/ts_install.erl146
-rw-r--r--lib/test_server/src/ts_install_cth.erl50
-rw-r--r--lib/test_server/src/ts_lib.erl118
-rw-r--r--lib/test_server/src/ts_make.erl14
-rw-r--r--lib/test_server/src/ts_reports.erl545
-rw-r--r--lib/test_server/src/ts_run.erl58
-rw-r--r--lib/test_server/src/ts_selftest.erl120
-rw-r--r--lib/test_server/src/vxworks_client.erl243
-rw-r--r--lib/test_server/test/Makefile14
-rw-r--r--lib/test_server/test/test_server.cover5
-rw-r--r--lib/test_server/test/test_server_SUITE.erl38
-rw-r--r--lib/test_server/test/test_server_SUITE_data/test_server_SUITE.erl48
-rw-r--r--lib/test_server/test/test_server_line_SUITE.erl131
-rw-r--r--lib/test_server/test/test_server_line_SUITE_data/Makefile.src6
-rw-r--r--lib/test_server/test/test_server_line_SUITE_data/parse_transform_test.erl59
-rw-r--r--lib/test_server/vsn.mk2
-rw-r--r--lib/toolbar/doc/src/Makefile16
-rw-r--r--lib/toolbar/doc/src/notes.xml22
-rw-r--r--lib/toolbar/doc/src/toolbar.xml7
-rw-r--r--lib/toolbar/doc/src/toolbar_chapter.xml7
-rw-r--r--lib/toolbar/src/Makefile10
-rw-r--r--lib/toolbar/src/canvasbutton.erl5
-rw-r--r--lib/toolbar/src/toolbar.erl3
-rw-r--r--lib/toolbar/src/toolbar_graphics.erl5
-rw-r--r--lib/toolbar/src/toolbar_toolconfig.erl7
-rw-r--r--lib/toolbar/vsn.mk2
-rw-r--r--lib/tools/c_src/Makefile.in8
-rw-r--r--lib/tools/c_src/erl_memory.c2
-rw-r--r--lib/tools/doc/src/Makefile16
-rw-r--r--lib/tools/doc/src/eprof.xml12
-rw-r--r--lib/tools/doc/src/notes.xml90
-rw-r--r--lib/tools/doc/src/xref_chapter.xml4
-rw-r--r--lib/tools/emacs/Makefile24
-rw-r--r--lib/tools/emacs/erlang.el95
-rw-r--r--lib/tools/emacs/test.erl.indented45
-rw-r--r--lib/tools/emacs/test.erl.orig45
-rw-r--r--lib/tools/examples/Makefile4
-rw-r--r--lib/tools/priv/Makefile6
-rw-r--r--lib/tools/src/Makefile10
-rw-r--r--lib/tools/src/fprof.erl23
-rw-r--r--lib/tools/src/tools.app.src1
-rw-r--r--lib/tools/src/xref_utils.erl4
-rw-r--r--lib/tools/test/Makefile10
-rw-r--r--lib/tools/test/cover_SUITE.erl9
-rw-r--r--lib/tools/test/fprof_SUITE.erl2
-rw-r--r--lib/tools/test/xref_SUITE.erl26
-rw-r--r--lib/tools/vsn.mk2
-rw-r--r--lib/tv/doc/src/Makefile16
-rw-r--r--lib/tv/doc/src/notes.xml22
-rw-r--r--lib/tv/doc/src/table_visualizer_chapter.xml8
-rw-r--r--lib/tv/doc/src/tv.xml8
-rw-r--r--lib/tv/priv/Makefile6
-rw-r--r--lib/tv/src/Makefile10
-rw-r--r--lib/tv/src/tv_db.erl6
-rw-r--r--lib/tv/src/tv_db_search.erl14
-rw-r--r--lib/tv/src/tv_etsread.erl5
-rw-r--r--lib/tv/src/tv_info.erl10
-rw-r--r--lib/tv/src/tv_ip.erl8
-rw-r--r--lib/tv/src/tv_main.erl16
-rw-r--r--lib/tv/src/tv_new_table.erl12
-rw-r--r--lib/tv/src/tv_nodewin.erl11
-rw-r--r--lib/tv/src/tv_pb.erl5
-rw-r--r--lib/tv/src/tv_pb_funcs.erl8
-rw-r--r--lib/tv/src/tv_pc.erl3
-rw-r--r--lib/tv/src/tv_pc_menu_handling.erl6
-rw-r--r--lib/tv/src/tv_pd.erl7
-rw-r--r--lib/tv/src/tv_pd_display.erl9
-rw-r--r--lib/tv/src/tv_pd_frames.erl4
-rw-r--r--lib/tv/src/tv_pd_scale.erl4
-rw-r--r--lib/tv/src/tv_pg.erl3
-rw-r--r--lib/tv/src/tv_pg_gridfcns.erl6
-rw-r--r--lib/tv/src/tv_poll_dialog.erl10
-rw-r--r--lib/tv/src/tv_pw.erl3
-rw-r--r--lib/tv/src/tv_pw_window.erl6
-rw-r--r--lib/tv/src/tv_rec_edit.erl12
-rw-r--r--lib/tv/src/tv_utils.erl5
-rw-r--r--lib/tv/vsn.mk2
-rw-r--r--lib/typer/src/Makefile10
-rw-r--r--lib/typer/src/typer.erl14
-rw-r--r--lib/typer/vsn.mk2
-rw-r--r--lib/webtool/doc/src/Makefile18
-rw-r--r--lib/webtool/priv/Makefile16
-rw-r--r--lib/webtool/src/Makefile10
-rw-r--r--lib/wx/.gitignore2
-rw-r--r--lib/wx/Makefile54
-rw-r--r--lib/wx/Notes60
-rw-r--r--lib/wx/README35
-rw-r--r--lib/wx/TODO30
-rw-r--r--lib/wx/aclocal.m4108
-rw-r--r--lib/wx/api_gen/Makefile4
-rw-r--r--lib/wx/api_gen/README15
-rw-r--r--lib/wx/api_gen/gen_util.erl14
-rw-r--r--lib/wx/api_gen/gl_gen.erl22
-rw-r--r--lib/wx/api_gen/gl_gen_erl.erl436
-rw-r--r--lib/wx/api_gen/gl_scan_doc.erl286
-rw-r--r--lib/wx/api_gen/glapi.conf8
-rw-r--r--lib/wx/api_gen/wx_extra/wxEvtHandler.erl26
-rw-r--r--lib/wx/api_gen/wx_gen.erl9
-rw-r--r--lib/wx/api_gen/wx_gen_cpp.erl52
-rw-r--r--lib/wx/api_gen/wx_gen_erl.erl574
-rw-r--r--lib/wx/api_gen/wxapi.conf68
-rw-r--r--lib/wx/c_src/Makefile.in24
-rw-r--r--lib/wx/c_src/gen/gl_fdefs.h886
-rw-r--r--lib/wx/c_src/gen/gl_finit.h456
-rw-r--r--lib/wx/c_src/gen/gl_funcs.cpp2832
-rw-r--r--lib/wx/c_src/gen/glu_finit.h2
-rw-r--r--lib/wx/c_src/gen/wxe_derived_dest.h23
-rw-r--r--lib/wx/c_src/gen/wxe_events.cpp16
-rw-r--r--lib/wx/c_src/gen/wxe_funcs.cpp158
-rw-r--r--lib/wx/c_src/gen/wxe_macros.h5478
-rw-r--r--lib/wx/c_src/wxe_return.cpp12
-rw-r--r--lib/wx/c_src/wxe_return.h4
-rwxr-xr-xlib/wx/configure.in5
-rw-r--r--lib/wx/doc/src/Makefile83
-rw-r--r--lib/wx/doc/src/notes.xml19
-rw-r--r--lib/wx/examples/Makefile26
-rw-r--r--lib/wx/examples/demo/Makefile31
-rw-r--r--lib/wx/examples/simple/Makefile28
-rw-r--r--lib/wx/examples/sudoku/Makefile31
-rw-r--r--lib/wx/examples/xrc/Makefile12
-rw-r--r--lib/wx/include/gl.hrl1329
-rw-r--r--lib/wx/include/glu.hrl4
-rw-r--r--lib/wx/include/wx.hrl448
-rwxr-xr-xlib/wx/install.es302
-rw-r--r--lib/wx/src/Makefile23
-rw-r--r--lib/wx/src/gen/gl.erl17693
-rw-r--r--lib/wx/src/gen/glu.erl667
-rw-r--r--lib/wx/src/gen/wxAcceleratorEntry.erl47
-rw-r--r--lib/wx/src/gen/wxAcceleratorTable.erl14
-rw-r--r--lib/wx/src/gen/wxArtProvider.erl24
-rw-r--r--lib/wx/src/gen/wxAuiDockArt.erl4
-rw-r--r--lib/wx/src/gen/wxAuiManager.erl130
-rw-r--r--lib/wx/src/gen/wxAuiManagerEvent.erl46
-rw-r--r--lib/wx/src/gen/wxAuiNotebook.erl100
-rw-r--r--lib/wx/src/gen/wxAuiNotebookEvent.erl22
-rw-r--r--lib/wx/src/gen/wxAuiPaneInfo.erl332
-rw-r--r--lib/wx/src/gen/wxAuiTabArt.erl4
-rw-r--r--lib/wx/src/gen/wxBitmap.erl152
-rw-r--r--lib/wx/src/gen/wxBitmapButton.erl56
-rw-r--r--lib/wx/src/gen/wxBitmapDataObject.erl32
-rw-r--r--lib/wx/src/gen/wxBoxSizer.erl12
-rw-r--r--lib/wx/src/gen/wxBrush.erl55
-rw-r--r--lib/wx/src/gen/wxBufferedDC.erl78
-rw-r--r--lib/wx/src/gen/wxBufferedPaintDC.erl45
-rw-r--r--lib/wx/src/gen/wxButton.erl42
-rw-r--r--lib/wx/src/gen/wxCalendarCtrl.erl114
-rw-r--r--lib/wx/src/gen/wxCalendarDateAttr.erl112
-rw-r--r--lib/wx/src/gen/wxCalendarEvent.erl10
-rw-r--r--lib/wx/src/gen/wxCaret.erl62
-rw-r--r--lib/wx/src/gen/wxCheckBox.erl59
-rw-r--r--lib/wx/src/gen/wxCheckListBox.erl33
-rw-r--r--lib/wx/src/gen/wxChildFocusEvent.erl7
-rw-r--r--lib/wx/src/gen/wxChoice.erl46
-rw-r--r--lib/wx/src/gen/wxChoicebook.erl114
-rw-r--r--lib/wx/src/gen/wxClientDC.erl23
-rw-r--r--lib/wx/src/gen/wxClipboard.erl46
-rw-r--r--lib/wx/src/gen/wxCloseEvent.erl25
-rw-r--r--lib/wx/src/gen/wxColourData.erl29
-rw-r--r--lib/wx/src/gen/wxColourDialog.erl29
-rw-r--r--lib/wx/src/gen/wxColourPickerCtrl.erl53
-rw-r--r--lib/wx/src/gen/wxColourPickerEvent.erl7
-rw-r--r--lib/wx/src/gen/wxComboBox.erl92
-rw-r--r--lib/wx/src/gen/wxCommandEvent.erl31
-rw-r--r--lib/wx/src/gen/wxContextMenuEvent.erl10
-rw-r--r--lib/wx/src/gen/wxControl.erl10
-rw-r--r--lib/wx/src/gen/wxControlWithItems.erl67
-rw-r--r--lib/wx/src/gen/wxCursor.erl37
-rw-r--r--lib/wx/src/gen/wxDC.erl376
-rw-r--r--lib/wx/src/gen/wxDataObject.erl4
-rw-r--r--lib/wx/src/gen/wxDateEvent.erl7
-rw-r--r--lib/wx/src/gen/wxDatePickerCtrl.erl33
-rw-r--r--lib/wx/src/gen/wxDialog.erl66
-rw-r--r--lib/wx/src/gen/wxDirDialog.erl31
-rw-r--r--lib/wx/src/gen/wxDirPickerCtrl.erl42
-rw-r--r--lib/wx/src/gen/wxDisplayChangedEvent.erl4
-rw-r--r--lib/wx/src/gen/wxEraseEvent.erl7
-rw-r--r--lib/wx/src/gen/wxEvent.erl34
-rw-r--r--lib/wx/src/gen/wxEvtHandler.erl28
-rw-r--r--lib/wx/src/gen/wxFileDataObject.erl14
-rw-r--r--lib/wx/src/gen/wxFileDialog.erl63
-rw-r--r--lib/wx/src/gen/wxFileDirPickerEvent.erl7
-rw-r--r--lib/wx/src/gen/wxFilePickerCtrl.erl44
-rw-r--r--lib/wx/src/gen/wxFindReplaceData.erl29
-rw-r--r--lib/wx/src/gen/wxFindReplaceDialog.erl29
-rw-r--r--lib/wx/src/gen/wxFlexGridSizer.erl61
-rw-r--r--lib/wx/src/gen/wxFocusEvent.erl7
-rw-r--r--lib/wx/src/gen/wxFont.erl102
-rw-r--r--lib/wx/src/gen/wxFontData.erl50
-rw-r--r--lib/wx/src/gen/wxFontDialog.erl17
-rw-r--r--lib/wx/src/gen/wxFontPickerCtrl.erl46
-rw-r--r--lib/wx/src/gen/wxFontPickerEvent.erl7
-rw-r--r--lib/wx/src/gen/wxFrame.erl96
-rw-r--r--lib/wx/src/gen/wxGBSizerItem.erl4
-rw-r--r--lib/wx/src/gen/wxGLCanvas.erl60
-rw-r--r--lib/wx/src/gen/wxGauge.erl62
-rw-r--r--lib/wx/src/gen/wxGenericDirCtrl.erl83
-rw-r--r--lib/wx/src/gen/wxGraphicsBrush.erl4
-rw-r--r--lib/wx/src/gen/wxGraphicsContext.erl267
-rw-r--r--lib/wx/src/gen/wxGraphicsFont.erl4
-rw-r--r--lib/wx/src/gen/wxGraphicsMatrix.erl66
-rw-r--r--lib/wx/src/gen/wxGraphicsObject.erl18
-rw-r--r--lib/wx/src/gen/wxGraphicsPath.erl124
-rw-r--r--lib/wx/src/gen/wxGraphicsPen.erl4
-rw-r--r--lib/wx/src/gen/wxGraphicsRenderer.erl51
-rw-r--r--lib/wx/src/gen/wxGrid.erl796
-rw-r--r--lib/wx/src/gen/wxGridBagSizer.erl210
-rw-r--r--lib/wx/src/gen/wxGridCellAttr.erl73
-rw-r--r--lib/wx/src/gen/wxGridCellBoolEditor.erl19
-rw-r--r--lib/wx/src/gen/wxGridCellBoolRenderer.erl8
-rw-r--r--lib/wx/src/gen/wxGridCellChoiceEditor.erl18
-rw-r--r--lib/wx/src/gen/wxGridCellEditor.erl43
-rw-r--r--lib/wx/src/gen/wxGridCellFloatEditor.erl17
-rw-r--r--lib/wx/src/gen/wxGridCellFloatRenderer.erl29
-rw-r--r--lib/wx/src/gen/wxGridCellNumberEditor.erl20
-rw-r--r--lib/wx/src/gen/wxGridCellNumberRenderer.erl8
-rw-r--r--lib/wx/src/gen/wxGridCellRenderer.erl10
-rw-r--r--lib/wx/src/gen/wxGridCellStringRenderer.erl8
-rw-r--r--lib/wx/src/gen/wxGridCellTextEditor.erl11
-rw-r--r--lib/wx/src/gen/wxGridEvent.erl28
-rw-r--r--lib/wx/src/gen/wxGridSizer.erl43
-rw-r--r--lib/wx/src/gen/wxHelpEvent.erl22
-rw-r--r--lib/wx/src/gen/wxHtmlEasyPrinting.erl74
-rw-r--r--lib/wx/src/gen/wxHtmlLinkEvent.erl7
-rw-r--r--lib/wx/src/gen/wxHtmlWindow.erl92
-rw-r--r--lib/wx/src/gen/wxIcon.erl37
-rw-r--r--lib/wx/src/gen/wxIconBundle.erl42
-rw-r--r--lib/wx/src/gen/wxIconizeEvent.erl7
-rw-r--r--lib/wx/src/gen/wxIdleEvent.erl30
-rw-r--r--lib/wx/src/gen/wxImage.erl452
-rw-r--r--lib/wx/src/gen/wxImageList.erl82
-rw-r--r--lib/wx/src/gen/wxJoystickEvent.erl55
-rw-r--r--lib/wx/src/gen/wxKeyEvent.erl46
-rw-r--r--lib/wx/src/gen/wxLayoutAlgorithm.erl35
-rw-r--r--lib/wx/src/gen/wxListBox.erl66
-rw-r--r--lib/wx/src/gen/wxListCtrl.erl300
-rw-r--r--lib/wx/src/gen/wxListEvent.erl43
-rw-r--r--lib/wx/src/gen/wxListItem.erl89
-rw-r--r--lib/wx/src/gen/wxListItemAttr.erl38
-rw-r--r--lib/wx/src/gen/wxListView.erl34
-rw-r--r--lib/wx/src/gen/wxListbook.erl114
-rw-r--r--lib/wx/src/gen/wxLogNull.erl8
-rw-r--r--lib/wx/src/gen/wxMDIChildFrame.erl45
-rw-r--r--lib/wx/src/gen/wxMDIClientWindow.erl26
-rw-r--r--lib/wx/src/gen/wxMDIParentFrame.erl60
-rw-r--r--lib/wx/src/gen/wxMask.erl46
-rw-r--r--lib/wx/src/gen/wxMaximizeEvent.erl4
-rw-r--r--lib/wx/src/gen/wxMemoryDC.erl29
-rw-r--r--lib/wx/src/gen/wxMenu.erl334
-rw-r--r--lib/wx/src/gen/wxMenuBar.erl89
-rw-r--r--lib/wx/src/gen/wxMenuEvent.erl13
-rw-r--r--lib/wx/src/gen/wxMenuItem.erl99
-rw-r--r--lib/wx/src/gen/wxMessageDialog.erl17
-rw-r--r--lib/wx/src/gen/wxMiniFrame.erl30
-rw-r--r--lib/wx/src/gen/wxMirrorDC.erl21
-rw-r--r--lib/wx/src/gen/wxMouseCaptureChangedEvent.erl7
-rw-r--r--lib/wx/src/gen/wxMouseEvent.erl127
-rw-r--r--lib/wx/src/gen/wxMoveEvent.erl7
-rw-r--r--lib/wx/src/gen/wxMultiChoiceDialog.erl24
-rw-r--r--lib/wx/src/gen/wxNavigationKeyEvent.erl28
-rw-r--r--lib/wx/src/gen/wxNcPaintEvent.erl4
-rw-r--r--lib/wx/src/gen/wxNotebook.erl123
-rw-r--r--lib/wx/src/gen/wxNotebookEvent.erl16
-rw-r--r--lib/wx/src/gen/wxNotifyEvent.erl13
-rw-r--r--lib/wx/src/gen/wxPageSetupDialog.erl21
-rw-r--r--lib/wx/src/gen/wxPageSetupDialogData.erl111
-rw-r--r--lib/wx/src/gen/wxPaintDC.erl23
-rw-r--r--lib/wx/src/gen/wxPaintEvent.erl4
-rw-r--r--lib/wx/src/gen/wxPalette.erl27
-rw-r--r--lib/wx/src/gen/wxPaletteChangedEvent.erl10
-rw-r--r--lib/wx/src/gen/wxPanel.erl32
-rw-r--r--lib/wx/src/gen/wxPasswordEntryDialog.erl18
-rw-r--r--lib/wx/src/gen/wxPen.erl54
-rw-r--r--lib/wx/src/gen/wxPickerBase.erl52
-rw-r--r--lib/wx/src/gen/wxPostScriptDC.erl28
-rw-r--r--lib/wx/src/gen/wxPreviewCanvas.erl4
-rw-r--r--lib/wx/src/gen/wxPreviewControlBar.erl29
-rw-r--r--lib/wx/src/gen/wxPreviewFrame.erl30
-rw-r--r--lib/wx/src/gen/wxPrintData.erl80
-rw-r--r--lib/wx/src/gen/wxPrintDialog.erl34
-rw-r--r--lib/wx/src/gen/wxPrintDialogData.erl83
-rw-r--r--lib/wx/src/gen/wxPrintPreview.erl67
-rw-r--r--lib/wx/src/gen/wxPrinter.erl45
-rw-r--r--lib/wx/src/gen/wxPrintout.erl66
-rw-r--r--lib/wx/src/gen/wxProgressDialog.erl32
-rw-r--r--lib/wx/src/gen/wxQueryNewPaletteEvent.erl10
-rw-r--r--lib/wx/src/gen/wxRadioBox.erl118
-rw-r--r--lib/wx/src/gen/wxRadioButton.erl38
-rw-r--r--lib/wx/src/gen/wxRegion.erl166
-rw-r--r--lib/wx/src/gen/wxSashEvent.erl19
-rw-r--r--lib/wx/src/gen/wxSashLayoutWindow.erl59
-rw-r--r--lib/wx/src/gen/wxSashWindow.erl56
-rw-r--r--lib/wx/src/gen/wxScreenDC.erl20
-rw-r--r--lib/wx/src/gen/wxScrollBar.erl56
-rw-r--r--lib/wx/src/gen/wxScrollEvent.erl10
-rw-r--r--lib/wx/src/gen/wxScrollWinEvent.erl10
-rw-r--r--lib/wx/src/gen/wxScrolledWindow.erl67
-rw-r--r--lib/wx/src/gen/wxSetCursorEvent.erl19
-rw-r--r--lib/wx/src/gen/wxShowEvent.erl10
-rw-r--r--lib/wx/src/gen/wxSingleChoiceDialog.erl27
-rw-r--r--lib/wx/src/gen/wxSizeEvent.erl7
-rw-r--r--lib/wx/src/gen/wxSizer.erl402
-rw-r--r--lib/wx/src/gen/wxSizerFlags.erl46
-rw-r--r--lib/wx/src/gen/wxSizerItem.erl134
-rw-r--r--lib/wx/src/gen/wxSlider.erl65
-rw-r--r--lib/wx/src/gen/wxSpinButton.erl47
-rw-r--r--lib/wx/src/gen/wxSpinCtrl.erl71
-rw-r--r--lib/wx/src/gen/wxSpinEvent.erl10
-rw-r--r--lib/wx/src/gen/wxSplashScreen.erl25
-rw-r--r--lib/wx/src/gen/wxSplitterEvent.erl19
-rw-r--r--lib/wx/src/gen/wxSplitterWindow.erl115
-rw-r--r--lib/wx/src/gen/wxStaticBitmap.erl36
-rw-r--r--lib/wx/src/gen/wxStaticBox.erl30
-rw-r--r--lib/wx/src/gen/wxStaticBoxSizer.erl29
-rw-r--r--lib/wx/src/gen/wxStaticLine.erl37
-rw-r--r--lib/wx/src/gen/wxStaticText.erl39
-rw-r--r--lib/wx/src/gen/wxStatusBar.erl88
-rw-r--r--lib/wx/src/gen/wxStdDialogButtonSizer.erl23
-rw-r--r--lib/wx/src/gen/wxStyledTextCtrl.erl1414
-rw-r--r--lib/wx/src/gen/wxStyledTextEvent.erl76
-rw-r--r--lib/wx/src/gen/wxSysColourChangedEvent.erl4
-rw-r--r--lib/wx/src/gen/wxSystemOptions.erl32
-rw-r--r--lib/wx/src/gen/wxSystemSettings.erl33
-rw-r--r--lib/wx/src/gen/wxTaskBarIcon.erl102
-rw-r--r--lib/wx/src/gen/wxTaskBarIconEvent.erl64
-rw-r--r--lib/wx/src/gen/wxTextAttr.erl103
-rw-r--r--lib/wx/src/gen/wxTextCtrl.erl186
-rw-r--r--lib/wx/src/gen/wxTextDataObject.erl22
-rw-r--r--lib/wx/src/gen/wxTextEntryDialog.erl24
-rw-r--r--lib/wx/src/gen/wxToggleButton.erl38
-rw-r--r--lib/wx/src/gen/wxToolBar.erl269
-rw-r--r--lib/wx/src/gen/wxToolTip.erl24
-rw-r--r--lib/wx/src/gen/wxToolbook.erl114
-rw-r--r--lib/wx/src/gen/wxTopLevelWindow.erl91
-rw-r--r--lib/wx/src/gen/wxTreeCtrl.erl318
-rw-r--r--lib/wx/src/gen/wxTreeEvent.erl28
-rw-r--r--lib/wx/src/gen/wxTreebook.erl136
-rw-r--r--lib/wx/src/gen/wxUpdateUIEvent.erl61
-rw-r--r--lib/wx/src/gen/wxWindow.erl796
-rw-r--r--lib/wx/src/gen/wxWindowCreateEvent.erl4
-rw-r--r--lib/wx/src/gen/wxWindowDC.erl23
-rw-r--r--lib/wx/src/gen/wxWindowDestroyEvent.erl4
-rw-r--r--lib/wx/src/gen/wxXmlResource.erl103
-rw-r--r--lib/wx/src/gen/wx_misc.erl78
-rw-r--r--lib/wx/src/gen/wxe_debug.hrl5479
-rw-r--r--lib/wx/src/gen/wxe_funcs.hrl5477
-rw-r--r--lib/wx/src/wx.erl162
-rw-r--r--lib/wx/src/wxe_master.erl11
-rw-r--r--lib/wx/test/Makefile18
-rw-r--r--lib/wx/test/wx_class_SUITE.erl16
-rw-r--r--lib/wx/vsn.mk2
-rw-r--r--lib/xmerl/doc/src/Makefile18
-rw-r--r--lib/xmerl/doc/src/notes.xml60
-rw-r--r--lib/xmerl/doc/src/xmerl_sax_parser.xml7
-rw-r--r--lib/xmerl/doc/src/xmerl_ug.xmlsrc2
-rw-r--r--lib/xmerl/include/xmerl_xlink.hrl26
-rw-r--r--lib/xmerl/src/Makefile19
-rw-r--r--lib/xmerl/src/xmerl_sax_parser.erl5
-rw-r--r--lib/xmerl/src/xmerl_sax_parser_base.erlsrc415
-rw-r--r--lib/xmerl/src/xmerl_uri.erl2
-rw-r--r--lib/xmerl/src/xmerl_xsd.erl4
-rw-r--r--lib/xmerl/test/Makefile26
-rw-r--r--lib/xmerl/vsn.mk2
-rw-r--r--make/emd2exml.in23
-rw-r--r--make/otp.mk.in24
-rw-r--r--make/otp_release_targets.mk6
-rw-r--r--make/run_make.mk2
-rwxr-xr-xotp_build69
-rw-r--r--system/COPYRIGHT25
-rw-r--r--system/README7
-rw-r--r--system/doc/design_principles/Makefile8
-rw-r--r--system/doc/design_principles/spec_proc.xml4
-rw-r--r--system/doc/design_principles/sup_princ.xml4
-rw-r--r--system/doc/efficiency_guide/Makefile8
-rw-r--r--system/doc/efficiency_guide/profiling.xml4
-rw-r--r--system/doc/embedded/Makefile8
-rw-r--r--system/doc/embedded/part.xml1
-rw-r--r--system/doc/embedded/vxworks.xml193
-rw-r--r--system/doc/embedded/xmlfiles.mk3
-rw-r--r--system/doc/getting_started/Makefile8
-rw-r--r--system/doc/installation_guide/Makefile12
-rw-r--r--system/doc/installation_guide/part.xml4
-rw-r--r--system/doc/installation_guide/xmlfiles.mk3
-rw-r--r--system/doc/oam/Makefile4
-rw-r--r--system/doc/programming_examples/Makefile4
-rw-r--r--system/doc/reference_manual/Makefile8
-rw-r--r--system/doc/reference_manual/expressions.xml15
-rw-r--r--system/doc/reference_manual/modules.xml10
-rw-r--r--system/doc/system_architecture_intro/Makefile8
-rw-r--r--system/doc/system_principles/Makefile8
-rw-r--r--system/doc/top/Makefile8
-rw-r--r--system/doc/top/templates/index.html.src15
-rw-r--r--system/doc/tutorial/Makefile8
-rw-r--r--system/doc/tutorial/c_portdriver.xmlsrc8
-rw-r--r--xcomp/README.md38
-rw-r--r--xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf11
-rw-r--r--xcomp/erl-xcomp-avr32-atmel-linux-gnu.conf15
-rw-r--r--xcomp/erl-xcomp-mips-linux.conf11
-rw-r--r--xcomp/erl-xcomp-powerpc-dso-linux-gnu.conf258
-rw-r--r--xcomp/erl-xcomp-vars.sh4
-rw-r--r--xcomp/erl-xcomp-vxworks_ppc32.conf11
-rw-r--r--xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf11
-rw-r--r--xcomp/erl-xcomp.conf.template11
2231 files changed, 138585 insertions, 127290 deletions
diff --git a/.gitignore b/.gitignore
index 46a47febcb..3b0e21bde3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -86,6 +86,8 @@ lib/os_mon/priv/obj/win32/
lib/runtime_tools/c_src/win32/
lib/runtime_tools/priv/lib/
lib/runtime_tools/priv/obj/
+lib/runtime_tools/doc/src/DTRACE.xml
+lib/runtime_tools/doc/src/SYSTEMTAP.xml
lib/tools/bin/win32/
lib/tools/c_src/win32/
lib/tools/obj/win32/
@@ -110,6 +112,7 @@ JAVADOC-GENERATED
!/bootstrap/bin/*.boot
/bootstrap/lib/asn1
+/bootstrap/lib/common_test
/bootstrap/lib/hipe
/bootstrap/lib/ic
/bootstrap/lib/orber
@@ -119,6 +122,7 @@ JAVADOC-GENERATED
/bootstrap/lib/syntax_tools
/bootstrap/lib/test_server
/bootstrap/lib/wx
+/bootstrap/lib/xmerl
/Makefile
/configure
@@ -333,6 +337,7 @@ JAVADOC-GENERATED
/system/doc/installation_guide/INSTALL.xml
/system/doc/installation_guide/INSTALL-CROSS.xml
/system/doc/installation_guide/INSTALL-WIN32.xml
+/system/doc/installation_guide/MARKDOWN.xml
# test_server
diff --git a/HOWTO/BENCHMARKS.md b/HOWTO/BENCHMARKS.md
new file mode 100644
index 0000000000..b3df4638ea
--- /dev/null
+++ b/HOWTO/BENCHMARKS.md
@@ -0,0 +1,73 @@
+Benchmarking Erlang/OTP
+=======================
+
+The Erlang/OTP source tree contains a number of benchmarks. The same framework
+is used to run these benchmarks as is used to run tests. Therefore in order to
+run benchmarks you have to [release the tests][] just as you normally would.
+
+Note that many of these benchmarks were developed to test a specific feature
+under a specific setting. We strive to keep the benchmarks up-to-date, but alas
+time is not an endless resource so some benchmarks will be outdated and
+irrelevant.
+
+Running the benchmarks
+----------------------
+
+As with testing, `ts` is used to run the benchmarks. Before running any
+benchmarks you have to [install the tests][]. To get a listing of all
+benchmarks you have available call `ts:benchmarks()`.
+
+To run all benchmarks call `ts:bench()`. This will run all benchmarks using
+the emulator which is in you `$PATH` (Note that this does not have to be the
+same as from which the benchmarks were built from). All the results of the
+benchmarks are put in a folder in `$TESTROOT/test_server/` called
+`YYYY_MO_DDTHH_MI_SS`.
+
+Each benchmark is run multiple times and the data for all runs is collected in
+the files within the benchmark folder. All benchmarks are written so that a
+higher values are better.
+
+Writing benchmarks
+------------------
+
+Benchmarks are just normal testcases in Common Test suites. They are marked as
+benchmarks by being included in the `AppName_bench.spec` which is located in
+`lib/AppName/test/` for the applications which have benchmarks. Note that you
+might want to add a skip clause to `AppName.spec` for the benchmarks if you do
+not want them to be run in the nightly tests.
+
+Results of benchmarks are sent using the ct_event mechanism and automatically
+collected and formatted by ts.
+
+ ct_event:notify(
+ #event{name = benchmark_data,
+ data = [{value,TPS}]}).
+
+The application, suite and testcase associated with the value is automatically
+detected. If you want to supply your own you can include `suite` andor `name`
+with the data. i.e.
+
+ ct_event:notify(
+ #event{name = benchmark_data,
+ data = [{suite,"erts_bench"},
+ {name,"ets_transactions_per_sec"},
+ {value,TPS}]}).
+
+The reason for using the internal ct_event and not ct is because the benchmark
+code has to be backwards compatible with at least R14.
+
+The value which is reported should be as raw as possible. i.e. you should not
+do any averaging of the value before reporting. The tools we use to collect the
+benchmark data over time will do averages, means, stddev and more with the data.
+So the more data which is sent using `ct_event` the better.
+
+Viewing benchmarks
+------------------
+
+At the moment of writing this HOWTO the tool for viewing benchmark results is
+not available as opensource. This will hopefully change in the near future.
+
+
+ [release the tests]: TESTING.md#releasing-tests
+ [install the tests]: TESTING.md#configuring-the-test-environment
+
diff --git a/README.bootstrap b/HOWTO/BOOTSTRAP.md
index f42bc7aa47..59e31165cf 100644
--- a/README.bootstrap
+++ b/HOWTO/BOOTSTRAP.md
@@ -1,16 +1,16 @@
Notes about prebuilt beam files under version control
------------------------------------------------------
+=====================================================
This information applies mostly to developers, some parts only
to developers of the main branch i.e. Ericsson and HiPE personel.
There are two types of derived code under version control, namely:
-primary bootstrap - Resides in the $ERL_TOP/bootstrap/{lib,bin} directories.
-preloaded code - Resides in the $ERL_TOP/erts/preloaded directory.
+primary bootstrap - Resides in the `$ERL_TOP/bootstrap/{lib,bin}` directories.
+preloaded code - Resides in the `$ERL_TOP/erts/preloaded` directory.
Primary bootstrap
-.................
+-----------------
The two types of version controlled code are fundamentally
different. The primary bootstrap is code compiled from source files in
@@ -19,7 +19,7 @@ lib/orber/include. They are checked in in the version control system
to make it possible to build directly from the code base tree without
the need for an earlier version of the compiler. When a new version of
OTP is released, these files are updated manually (or rather, by using
-the $ERL_TOP/otp_build script) and checked in. The files can also be
+the `$ERL_TOP/otp_build` script) and checked in. The files can also be
updated due to changes in the compiler during the development
process. The primary bootstrap is always updated as a separate
deliberate process, never during a normal development build.
@@ -27,31 +27,31 @@ deliberate process, never during a normal development build.
If a prebuilt open source version of erlang is used, the directory
bootstrap initially does not contain any beam files, the directory is
instead populated by copying beam files from the
-$ERL_TOP/lib/{kernel,stdlib,compiler}/ebin directories. This
+`$ERL_TOP/lib/{kernel,stdlib,compiler}/ebin` directories. This
construction is to save space in the distribution, but the result
would be the same. Open source developers need not provide patches for
the precompiled beam files in the primary bootstrap, the bootstrap
update is always performed by the main developers.
Preloaded code
-..............
+--------------
-The directory $ERL_TOP/preloaded contains both src and ebin
+The directory `$ERL_TOP/preloaded` contains both src and ebin
subdirectories. The preloaded code is compiled into the virtual
machine and always present. When compiling the virtual machine, those
beam files need to be present and they are considered a part of the
virtual machine rather than a part of the kernel application. When
preloaded files are to be updated, the source code is built using a
-special Makefile in the $ERL_TOP/preloaded/src directory, which
+special Makefile in the `$ERL_TOP/preloaded/src` directory, which
creates beam files in the same directory. When they seem to compile
successfully, they can be used in an emulator build by being copied
-to the ebin directory. otp_build update_preloaded can be used to
+to the ebin directory. `otp_build update_preloaded` can be used to
ease the process (there are also similar targets in the
-$ERL_TOP/preloaded/src/Makefile).
+`$ERL_TOP/preloaded/src/Makefile`).
In prebuilt open source distributions, these beam files are also
present, but to update them one might need to change permission on the
-$ERL_TOP/preloaded/ebin directory, then build and then manually copy
+`$ERL_TOP/preloaded/ebin` directory, then build and then manually copy
the beam files from the source directory to ../ebin. If patches are
created that involve the source files used to build preloaded code,
always note this specially as the preloaded/ebin directory needs
diff --git a/HOWTO/DTRACE.md b/HOWTO/DTRACE.md
new file mode 100644
index 0000000000..b719c68c59
--- /dev/null
+++ b/HOWTO/DTRACE.md
@@ -0,0 +1,392 @@
+DTrace and Erlang/OTP
+=====================
+
+History
+-------
+
+The first implementation of DTrace probes for the Erlang virtual
+machine was presented at the [2008 Erlang User Conference] [1]. That
+work, based on the Erlang/OTP R12 release, was discontinued due to
+what appears to be miscommunication with the original developers.
+
+Several users have created Erlang port drivers, linked-in drivers, or
+NIFs that allow Erlang code to try to activate a probe,
+e.g. `foo_module:dtrace_probe("message goes here!")`.
+
+Goals
+-----
+
+* Annotate as much of the Erlang VM as is practical.
+ * The initial goal is to trace file I/O operations.
+* Support all platforms that implement DTrace: OS X, Solaris,
+ and (I hope) FreeBSD and NetBSD.
+* To the extent that it's practical, support SystemTap on Linux
+ via DTrace provider compatibility.
+* Allow Erlang code to supply annotations.
+
+Supported platforms
+-------------------
+
+* OS X 10.6.x / Snow Leopard. It should also work for 10.7 / Lion,
+ but I haven't personally tested it.
+* Solaris 10. I have done limited testing on Solaris 11 and
+ OpenIndiana release 151a, and both appear to work.
+* FreeBSD 9.0, though please see the "FreeBSD 9.0 Release Notes"
+ section below!
+* Linux via SystemTap compatibility. Please see
+ [$ERL_TOP/HOWTO/SYSTEMTAP.md][] for more details.
+
+Just add the `--with-dynamic-trace=dtrace` option to your command when you
+run the `configure` script. If you are using systemtap, the configure option
+is `--with-dynamic-trace=systemtap`
+
+Status
+------
+
+As of R15B01, the dynamic trace code is included in the OTP source distribution,
+although it's considered experimental. The main development of the dtrace code
+still happens outside of Ericsson, but there is no need to fetch a patched
+version of the OTP source to get the basic funtionality.
+
+Implementation summary
+----------------------
+
+So far, most effort has been focused on the `efile_drv.c` code,
+which implements most file I/O on behalf of the Erlang virtual
+machine. This driver also presents a big challenge: its use of an I/O
+worker pool (enabled by using the `erl +A 8` flag, for example) makes
+it much more difficult to trace I/O activity because each of the
+following may be executed in a different Pthread:
+
+* I/O initiation (Erlang code)
+* I/O proxy process handling, e.g. read/write when file is not opened
+ in `raw` mode, operations executed by the code & file server processes.
+ (Erlang code)
+* `efile_drv` command setup (C code)
+* `efile_drv` command execution (C code)
+* `efile_drv` status return (C code)
+
+Example output from `lib/runtime_tools/examples/efile_drv.d` while executing
+`file:rename("old-name", "new-name")`:
+
+ efile_drv enter tag={3,84} user tag some-user-tag | RENAME (12) | args: old-name new-name , 0 0 (port #Port<0.59>)
+ async I/O worker tag={3,83} | RENAME (12) | efile_drv-int_entry
+ async I/O worker tag={3,83} | RENAME (12) | efile_drv-int_return
+ efile_drv return tag={3,83} user tag | RENAME (12) | errno 2
+
+... where the following key can help decipher the output:
+
+* `{3,83}` is the Erlang scheduler thread number (3) and operation
+ counter number (83) assigned to this I/O operation. Together,
+ these two numbers form a unique ID for the I/O operation.
+* `12` is the command number for the rename operation. See the
+ definition for `FILE_RENAME` in the source code file `efile_drv.c`
+ or the `BEGIN` section of the D script `lib/runtime_tools/examples/efile_drv.d`.
+* `old-name` and `new-name` are the two string arguments for the
+ source and destination of the `rename(2)` system call.
+ The two integer arguments are unused; the simple formatting code
+ prints the arguments anyway, 0 and 0.
+* The worker pool code was called on behalf of Erlang port `#Port<0.59>`.
+* The system call failed with a POSIX errno value of 2: `ENOENT`,
+ because the path `old-name` does not exist.
+* The `efile_drv-int_entry` and `efile_drv_int_return` probes are
+ provided in case the user is
+ interested in measuring only the latency of code executed by
+ `efile_drv` asynchronous functions by I/O worker pool threads
+ and the OS system call that they encapsulate.
+
+So, where does the `some-user-tag` string come from?
+
+At the moment, the user tag comes from code like the following:
+
+ dyntrace:put_tag("some-user-tag"),
+ file:rename("old-name", "new-name"),
+
+This method of tagging I/O at the Erlang level is subject to change.
+
+Example DTrace probe specification
+----------------------------------
+
+ /**
+ * Fired when a message is sent from one local process to another.
+ *
+ * NOTE: The 'size' parameter is in machine-dependent words and
+ * that the actual size of any binary terms in the message
+ * are not included.
+ *
+ * @param sender the PID (string form) of the sender
+ * @param receiver the PID (string form) of the receiver
+ * @param size the size of the message being delivered (words)
+ * @param token_label for the sender's sequential trace token
+ * @param token_previous count for the sender's sequential trace token
+ * @param token_current count for the sender's sequential trace token
+ */
+ probe message__send(char *sender, char *receiver, uint32_t size,
+ int token_label, int token_previous, int token_current);
+
+ /**
+ * Fired when a message is sent from a local process to a remote process.
+ *
+ * NOTE: The 'size' parameter is in machine-dependent words and
+ * that the actual size of any binary terms in the message
+ * are not included.
+ *
+ * @param sender the PID (string form) of the sender
+ * @param node_name the Erlang node name (string form) of the receiver
+ * @param receiver the PID/name (string form) of the receiver
+ * @param size the size of the message being delivered (words)
+ * @param token_label for the sender's sequential trace token
+ * @param token_previous count for the sender's sequential trace token
+ * @param token_current count for the sender's sequential trace token
+ */
+ probe message__send__remote(char *sender, char *node_name, char *receiver,
+ uint32_t size,
+ int token_label, int token_previous, int token_current);
+
+ /**
+ * Fired when a message is queued to a local process. This probe
+ * will not fire if the sender's pid == receiver's pid.
+ *
+ * NOTE: The 'size' parameter is in machine-dependent words and
+ * that the actual size of any binary terms in the message
+ * are not included.
+ *
+ * @param receiver the PID (string form) of the receiver
+ * @param size the size of the message being delivered (words)
+ * @param queue_len length of the queue of the receiving process
+ * @param token_label for the sender's sequential trace token
+ * @param token_previous count for the sender's sequential trace token
+ * @param token_current count for the sender's sequential trace token
+ */
+ probe message__queued(char *receiver, uint32_t size, uint32_t queue_len,
+ int token_label, int token_previous, int token_current);
+
+ /**
+ * Fired when a message is 'receive'd by a local process and removed
+ * from its mailbox.
+ *
+ * NOTE: The 'size' parameter is in machine-dependent words and
+ * that the actual size of any binary terms in the message
+ * are not included.
+ *
+ * @param receiver the PID (string form) of the receiver
+ * @param size the size of the message being delivered (words)
+ * @param queue_len length of the queue of the receiving process
+ * @param token_label for the sender's sequential trace token
+ * @param token_previous count for the sender's sequential trace token
+ * @param token_current count for the sender's sequential trace token
+ */
+ probe message__receive(char *receiver, uint32_t size, uint32_t queue_len,
+ int token_label, int token_previous, int token_current);
+
+ /* ... */
+
+ /* Async driver pool */
+
+ /**
+ * Show the post-add length of the async driver thread pool member's queue.
+ *
+ * NOTE: The port name is not available: additional lock(s) must
+ * be acquired in order to get the port name safely in an SMP
+ * environment. The same is true for the aio__pool_get probe.
+ *
+ * @param port the Port (string form)
+ * @param new queue length
+ */
+ probe aio_pool__add(char *, int);
+
+ /**
+ * Show the post-get length of the async driver thread pool member's queue.
+ *
+ * @param port the Port (string form)
+ * @param new queue length
+ */
+ probe aio_pool__get(char *, int);
+
+ /* Probes for efile_drv.c */
+
+ /**
+ * Entry into the efile_drv.c file I/O driver
+ *
+ * For a list of command numbers used by this driver, see the section
+ * "Guide to probe arguments" in ../../../README.md. That section
+ * also contains explanation of the various integer and string
+ * arguments that may be present when any particular probe fires.
+ *
+ * TODO: Adding the port string, args[10], is a pain. Making that
+ * port string available to all the other efile_drv.c probes
+ * will be more pain. Is the pain worth it? If yes, then
+ * add them everywhere else and grit our teeth. If no, then
+ * rip it out.
+ *
+ * @param thread-id number of the scheduler Pthread arg0
+ * @param tag number: {thread-id, tag} uniquely names a driver operation
+ * @param user-tag string arg2
+ * @param command number arg3
+ * @param string argument 1 arg4
+ * @param string argument 2 arg5
+ * @param integer argument 1 arg6
+ * @param integer argument 2 arg7
+ * @param integer argument 3 arg8
+ * @param integer argument 4 arg9
+ * @param port the port ID of the busy port args[10]
+ */
+ probe efile_drv__entry(int, int, char *, int, char *, char *,
+ int64_t, int64_t, int64_t, int64_t, char *);
+
+ /**
+ * Entry into the driver's internal work function. Computation here
+ * is performed by a async worker pool Pthread.
+ *
+ * @param thread-id number
+ * @param tag number
+ * @param command number
+ */
+ probe efile_drv__int_entry(int, int, int);
+
+ /**
+ * Return from the driver's internal work function.
+ *
+ * @param thread-id number
+ * @param tag number
+ * @param command number
+ */
+ probe efile_drv__int_return(int, int, int);
+
+ /**
+ * Return from the efile_drv.c file I/O driver
+ *
+ * @param thread-id number arg0
+ * @param tag number arg1
+ * @param user-tag string arg2
+ * @param command number arg3
+ * @param Success? 1 is success, 0 is failure arg4
+ * @param If failure, the errno of the error. arg5
+ */
+ probe efile_drv__return(int, int, char *, int, int, int);
+
+Guide to efile_drv.c probe arguments
+------------------------------------
+
+ /* Driver op code: used by efile_drv-entry arg3 */
+ /* used by efile_drv-int_entry arg3 */
+ /* used by efile_drv-int_return arg3 */
+ /* used by efile_drv-return arg3 */
+
+ #define FILE_OPEN 1 (probe arg3)
+ probe arg6 = C driver dt_i1 = flags;
+ probe arg4 = C driver dt_s1 = path;
+
+ #define FILE_READ 2 (probe arg3)
+ probe arg6 = C driver dt_i1 = fd;
+ probe arg7 = C driver dt_i2 = flags;
+ probe arg8 = C driver dt_i3 = size;
+
+ #define FILE_LSEEK 3 (probe arg3)
+ probe arg6 = C driver dt_i1 = fd;
+ probe arg7 = C driver dt_i2 = offset;
+ probe arg8 = C driver dt_i3 = origin;
+
+ #define FILE_WRITE 4 (probe arg3)
+ probe arg6 = C driver dt_i1 = fd;
+ probe arg7 = C driver dt_i2 = flags;
+ probe arg8 = C driver dt_i3 = size;
+
+ #define FILE_FSTAT 5 (probe arg3)
+ probe arg6 = C driver dt_i1 = fd;
+
+ #define FILE_PWD 6 (probe arg3)
+ none
+
+ #define FILE_READDIR 7 (probe arg3)
+ probe arg4 = C driver dt_s1 = path;
+
+ #define FILE_CHDIR 8 (probe arg3)
+ probe arg4 = C driver dt_s1 = path;
+
+ #define FILE_FSYNC 9 (probe arg3)
+ probe arg6 = C driver dt_i1 = fd;
+
+ #define FILE_MKDIR 10 (probe arg3)
+ probe arg4 = C driver dt_s1 = path;
+
+ #define FILE_DELETE 11 (probe arg3)
+ probe arg4 = C driver dt_s1 = path;
+
+ #define FILE_RENAME 12 (probe arg3)
+ probe arg4 = C driver dt_s1 = old_name;
+ probe arg5 = C driver dt_s2 = new_name;
+
+ #define FILE_RMDIR 13 (probe arg3)
+ probe arg4 = C driver dt_s1 = path;
+
+ #define FILE_TRUNCATE 14 (probe arg3)
+ probe arg6 = C driver dt_i1 = fd;
+ probe arg7 = C driver dt_i2 = flags;
+
+ #define FILE_READ_FILE 15 (probe arg3)
+ probe arg4 = C driver dt_s1 = path;
+
+ #define FILE_WRITE_INFO 16 (probe arg3)
+ probe arg6 = C driver dt_i1 = mode;
+ probe arg7 = C driver dt_i2 = uid;
+ probe arg8 = C driver dt_i3 = gid;
+
+ #define FILE_LSTAT 19 (probe arg3)
+ probe arg4 = C driver dt_s1 = path;
+
+ #define FILE_READLINK 20 (probe arg3)
+ probe arg4 = C driver dt_s1 = path;
+
+ #define FILE_LINK 21 (probe arg3)
+ probe arg4 = C driver dt_s1 = existing_path;
+ probe arg5 = C driver dt_s2 = new_path;
+
+ #define FILE_SYMLINK 22 (probe arg3)
+ probe arg4 = C driver dt_s1 = existing_path;
+ probe arg5 = C driver dt_s2 = new_path;
+
+ #define FILE_CLOSE 23 (probe arg3)
+ probe arg6 = C driver dt_i1 = fd;
+ probe arg7 = C driver dt_i2 = flags;
+
+ #define FILE_PWRITEV 24 (probe arg3)
+ probe arg6 = C driver dt_i1 = fd;
+ probe arg7 = C driver dt_i2 = flags;
+ probe arg8 = C driver dt_i3 = size;
+
+ #define FILE_PREADV 25 (probe arg3)
+ probe arg6 = C driver dt_i1 = fd;
+ probe arg7 = C driver dt_i2 = flags;
+ probe arg8 = C driver dt_i3 = size;
+
+ #define FILE_SETOPT 26 (probe arg3)
+ probe arg6 = C driver dt_i1 = opt_name;
+ probe arg7 = C driver dt_i2 = opt_specific_value;
+
+ #define FILE_IPREAD 27 (probe arg3)
+ probe arg6 = C driver dt_i1 = fd;
+ probe arg7 = C driver dt_i2 = flags;
+ probe arg8 = C driver dt_i3 = offsets[0];
+ probe arg9 = C driver dt_i4 = size;
+
+ #define FILE_ALTNAME 28 (probe arg3)
+ probe arg4 = C driver dt_s1 = path;
+
+ #define FILE_READ_LINE 29 (probe arg3)
+ probe arg6 = C driver dt_i1 = fd;
+ probe arg7 = C driver dt_i2 = flags;
+ probe arg8 = C driver dt_i3 = read_offset;
+ probe arg9 = C driver dt_i4 = read_ahead;
+
+ #define FILE_FDATASYNC 30 (probe arg3)
+ probe arg6 = C driver dt_i1 = fd;
+
+ #define FILE_FADVISE 31 (probe arg3)
+ probe arg6 = C driver dt_i1 = fd;
+ probe arg7 = C driver dt_i2 = offset;
+ probe arg8 = C driver dt_i3 = length;
+ probe arg9 = C driver dt_i4 = advise_type;
+
+ [1]: http://www.erlang.org/euc/08/
+ [$ERL_TOP/HOWTO/SYSTEMTAP.md]: SYSTEMTAP.md
diff --git a/HOWTO/INSTALL-CROSS.md b/HOWTO/INSTALL-CROSS.md
new file mode 100644
index 0000000000..8a2b1bc8ad
--- /dev/null
+++ b/HOWTO/INSTALL-CROSS.md
@@ -0,0 +1,560 @@
+Cross Compiling Erlang/OTP
+==========================
+
+Introduction
+------------
+
+This document describes how to cross compile Erlang/OTP-%OTP-REL%. Note that
+the support for cross compiling Erlang/OTP should be considered as
+experimental. As far as we know, the %OTP-REL% release should cross compile
+fine, but since we currently have a very limited set of cross compilation
+environments to test with we cannot be sure. The cross compilation support
+will remain in an experimental state until we get a lot more cross compilation
+environments to test with.
+
+You are advised to read the whole document before attempting to cross
+compile Erlang/OTP. However, before reading this document, you should read
+the [$ERL_TOP/HOWTO/INSTALL.md][] document which describes building and installing
+Erlang/OTP in general. `$ERL_TOP` is the top directory in the source tree.
+
+### otp\_build Versus configure/make ###
+
+Building Erlang/OTP can be done either by using the `$ERL_TOP/otp_build`
+script, or by invoking `$ERL_TOP/configure` and `make` directly. Building using
+`otp_build` is easier since it involves fewer steps, but the `otp_build` build
+procedure is not as flexible as the `configure`/`make` build procedure. Note
+that `otp_build configure` will produce a default configuration that differs
+from what `configure` will produce by default. For example, currently
+`--disable-dynamic-ssl-lib` is added to the `configure` command line arguments
+unless `--enable-dynamic-ssl-lib` has been explicitly passed. The binary
+releases that we deliver are built using `otp_build`. The defaults used by
+`otp_build configure` may change at any time without prior notice.
+
+### Cross Configuration ###
+
+The `$ERL_TOP/xcomp/erl-xcomp.conf.template` file contains all available cross
+configuration variables and can be used as a template when creating a cross
+compilation configuration. All [cross configuration variables][] are also
+listed at the end of this document. For examples of working cross
+configurations see the `$ERL_TOP/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf`
+file and the `$ERL_TOP/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf` file. If the
+default behavior of a variable is satisfactory, the variable does not need to
+be set. However, the `configure` script will issue a warning when a default
+value is used. When a variable has been set, no warning will be issued.
+
+A cross configuration file can be passed to `otp_build configure` using the
+`--xcomp-conf` command line argument. Note that `configure` does not accept
+this command line argument. When using the `configure` script directly, pass
+the configuration variables as arguments to `configure` using a
+`<VARIABLE>=<VALUE>` syntax. Variables can also be passed as environment
+variables to `configure`. However, if you pass the configuration in the
+environment, make sure to unset all of these environment variables before
+invoking `make`; otherwise, the environment variables might set make variables
+in some applications, or parts of some applications, and you may end up with
+an erroneously configured build.
+
+### What can be Cross Compiled? ###
+
+All Erlang/OTP applications except the `wx` application can be cross compiled.
+The build of the `wx` driver will currently be automatically disabled when
+cross compiling.
+
+### Compatibility ###
+
+The build system, including cross compilation configuration variables used,
+may be subject to non backward compatible changes without prior notice.
+Current cross build system has been tested when cross compiling some Linux/GNU
+systems, but has only been partly tested for more esoteric platforms. The
+VxWorks example file is highly dependent on our environment and is here more
+or less only for internal use.
+
+### Patches ###
+
+Please submit any patches for cross compiling in a way consistent with this
+system. All input is welcome as we have a very limited set of cross compiling
+environments to test with. If a new configuration variable is needed, add it
+to `$ERL_TOP/xcomp/erl-xcomp.conf.template`, and use it in `configure.in`.
+Other files that might need to be updated are:
+
+- `$ERL_TOP/xcomp/erl-xcomp-vars.sh`
+- `$ERL_TOP/erl-build-tool-vars.sh`
+- `$ERL_TOP/erts/aclocal.m4`
+- `$ERL_TOP/xcomp/README.md`
+- `$ERL_TOP/xcomp/erl-xcomp-*.conf`
+
+Note that this might be an incomplete list of files that need to be updated.
+
+General information on how to submit patches can be found at:
+ <http://wiki.github.com/erlang/otp/submitting-patches>
+
+Build and Install Procedure
+---------------------------
+
+If you are building in Git, you want to read the [Building in Git][] section
+of [$ERL_TOP/HOWTO/INSTALL.md][] before proceeding.
+
+We will first go through the `configure`/`make` build procedure which people
+probably are most familiar with.
+
+### Building With configure/make Directly ###
+
+ (1)
+
+Change directory into the top directory of the Erlang/OTP source tree.
+
+ $ cd $ERL_TOP
+
+In order to compile Erlang code, a small Erlang bootstrap system has to be
+built, or an Erlang/OTP system of the same release as the one being built
+has to be provided in the `$PATH`. The Erlang/OTP for the target system will
+be built using this Erlang system, together with the cross compilation tools
+provided.
+
+If you want to build the documentation out of the same source tree as you are
+cross compiling in, you currently need a full Erlang/OTP system of the same
+release as the one being built for the build machine. If this is the case,
+build and install one for the build machine (or use one already built) and add
+it to the `$PATH` before cross building, and building the documentation. See
+the [How to Build the Documentation][] section in the [$ERL_TOP/HOWTO/INSTALL.md][]
+document for information on how to build the documentation.
+
+If you want to build using a compatible Erlang/OTP system in the `$PATH`,
+jump to (3).
+
+#### Building a Bootstrap System ####
+
+ (2)
+
+ $ ./configure --enable-bootstrap-only
+ $ make
+
+The `--enable-bootstrap-only` argument to `configure` isn't strictly necessary,
+but will speed things up. It will only run `configure` in applications
+necessary for the bootstrap, and will disable a lot of things not needed by
+the bootstrap system. If you run `configure` without `--enable-boostrap-only`
+you also have to run make as `make bootstrap`; otherwise, the whole system will
+be built.
+
+#### Cross Building the System ####
+
+ (3)
+
+ $ ./configure --host=<HOST> --build=<BUILD> [Other Config Args]
+ $ make
+
+`<HOST>` is the host/target system that you build for. It does not have to be
+a full `CPU-VENDOR-OS` triplet, but can be. The full `CPU-VENDOR-OS` triplet
+will be created by executing `$ERL_TOP/erts/autoconf/config.sub <HOST>`. If
+`config.sub` fails, you need to be more specific.
+
+`<BUILD>` should equal the `CPU-VENDOR-OS` triplet of the system that you
+build on. If you execute `$ERL_TOP/erts/autoconf/config.guess`, it will in
+most cases print the triplet you want to use for this.
+
+Pass the cross compilation variables as command line arguments to `configure`
+using a `<VARIABLE>=<VALUE>` syntax.
+
+> *NOTE*: You can *not* pass a configuration file using the `--xcomp-conf`
+> argument when you invoke `configure` directly. The `--xcomp-conf` argument
+> can only be passed to `otp_build configure`.
+
+`make` will verify that the Erlang/OTP system used when building is of the
+same release as the system being built, and will fail if this is not the case.
+It is possible, however not recommended, to force the cross compilation even
+though the wrong Erlang/OTP system is used. This by invoking `make` like this:
+`make ERL_XCOMP_FORCE_DIFFERENT_OTP=yes`.
+
+> *WARNING*: Invoking `make ERL_XCOMP_FORCE_DIFFERENT_OTP=yes` might fail,
+> silently produce suboptimal code, or silently produce erroneous code.
+
+#### Installing ####
+
+You can either install using the installation paths determined by `configure`
+(4), or install manually using (5).
+
+##### Installing Using Paths Determined by configure #####
+
+ (4)
+
+ $ make install DESTDIR=<TEMPORARY_PREFIX>
+
+`make install` will install at a location specified when doing `configure`.
+`configure` arguments specifying where the installation should reside are for
+example: `--prefix`, `--exec-prefix`, `--libdir`, `--bindir`, etc. By default
+it will install under `/usr/local`. You typically do not want to install your
+cross build under `/usr/local` on your build machine. Using [DESTDIR][]
+will cause the installation paths to be prefixed by `$DESTDIR`. This makes it
+possible to install and package the installation on the build machine without
+having to place the installation in the same directory on the build machine as
+it should be executed from on the target machine.
+
+When `make install` has finished, change directory into `$DESTDIR`, package
+the system, move it to the target machine, and unpack it. Note that the
+installation will only be working on the target machine at the location
+determined by `configure`.
+
+##### Installing Manually #####
+
+ (5)
+
+ $ make release RELEASE_ROOT=<RELEASE_DIR>
+
+`make release` will copy what you have built for the target machine to
+`<RELEASE_DIR>`. The `Install` script will not be run. The content of
+`<RELEASE_DIR>` is what by default ends up in `/usr/local/lib/erlang`.
+
+The `Install` script used when installing Erlang/OTP requires common Unix
+tools such as `sed` to be present in your `$PATH`. If your target system
+does not have such tools, you need to run the `Install` script on your
+build machine before packaging Erlang/OTP. The `Install` script should
+currently be invoked as follows in the directory where it resides
+(the top directory):
+
+ $ ./Install [-cross] [-minimal|-sasl] <ERL_ROOT>
+
+where:
+
+* `-minimal` Creates an installation that starts up a minimal amount
+ of applications, i.e., only `kernel` and `stdlib` are started. The
+ minimal system is normally enough, and is what `make install` uses.
+* `-sasl` Creates an installation that also starts up the `sasl`
+ application.
+* `-cross` For cross compilation. Informs the install script that it
+ is run on the build machine.
+* `<ERL_ROOT>` - The absolute path to the Erlang installation to use
+ at run time. This is often the same as the current working directory,
+ but does not have to be. It can follow any other path through the file
+ system to the same directory.
+
+If neither `-minimal`, nor `-sasl` is passed as argument you will be
+prompted.
+
+You can now either do:
+
+ (6)
+
+* Decide where the installation should be located on the target machine,
+ run the `Install` script on the build machine, and package the installed
+ installation. The installation just need to be unpacked at the right
+ location on the target machine:
+
+ $ cd <RELEASE_DIR>
+ $ ./Install -cross [-minimal|-sasl] <ABSOLUTE_INSTALL_DIR_ON_TARGET>
+
+or:
+
+ (7)
+
+* Package the installation in `<RELEASE_DIR>`, place it wherever you want
+ on your target machine, and run the `Install` script on your target
+ machine:
+
+ $ cd <ABSOLUTE_INSTALL_DIR_ON_TARGET>
+ $ ./Install [-minimal|-sasl] <ABSOLUTE_INSTALL_DIR_ON_TARGET>
+
+### Building With the otp\_build Script ###
+
+ (8)
+
+ $ cd $ERL_TOP
+
+ (9)
+
+ $ ./otp_build configure --xcomp-conf=<FILE> [Other Config Args]
+
+alternatively:
+
+ $ ./otp_build configure --host=<HOST> --build=<BUILD> [Other Config Args]
+
+If you have your cross compilation configuration in a file, pass it using the
+`--xcomp-conf=<FILE>` command line argument. If not, pass `--host=<HOST>`,
+`--build=<BUILD>`, and the configuration variables using a `<VARIABLE>=<VALUE>`
+syntax on the command line (same as in (3)). Note that `<HOST>` and `<BUILD>`
+have to be passed one way or the other; either by using `erl_xcomp_host=<HOST>`
+and `erl_xcomp_build=<BUILD>` in the configuration file, or by using the
+`--host=<HOST>`, and `--build=<BUILD>` command line arguments.
+
+`otp_build configure` will configure both for the boostrap system on the
+build machine and the cross host system.
+
+ (10)
+
+ $ ./otp_build boot -a
+
+`otp_build boot -a` will first build a bootstrap system for the build machine
+and then do the cross build of the system.
+
+ (11)
+
+ $ ./otp_build release -a <RELEASE_DIR>
+
+`otp_build release -a` will do the same as (5), and you will after this have
+to do a manual install either by doing (6), or (7).
+
+Testing the cross compiled system
+---------------------------------
+Some of the tests that come with erlang use native code to test. This means
+that when cross compiling erlang you also have to cross compile test suites
+in order to run tests on the target host. To do this you first have to release
+the tests as usual.
+
+ $ make release_tests
+
+or
+
+ $ ./otp_build tests
+
+The tests will be released into `$ERL_TOP/release/tests`. After releasing the
+tests you have to install the tests on the build machine. You supply the same
+xcomp file as to `./otp_build` in (9).
+
+ $ cd $ERL_TOP/release/tests/test_server/
+ $ $ERL_TOP/bootstrap/bin/erl -eval 'ts:install([{xcomp,"<FILE>"}])' -s ts compile_testcases -s init stop
+
+You should get a lot of printouts as the testcases are compiled. Once done you
+should copy the entire `$ERL_TOP/release/tests` folder to the cross host system.
+
+Then go to the cross host system and setup the erlang installed in (4) or (5)
+to be in your `$PATH`. Then go to what previously was
+`$ERL_TOP/release/tests/test_server` and issue the following command.
+
+ $ erl -s ts install -s ts run all_tests -s init stop
+
+The configure should be skipped and all tests should hopefully pass. For more
+details about how to use ts run `erl -s ts help -s init stop`
+
+Currently Used Configuration Variables
+--------------------------------------
+
+Note that you cannot define arbitrary variables in a cross compilation
+configuration file. Only the ones listed below will be guaranteed to be
+visible throughout the whole execution of all `configure` scripts. Other
+variables needs to be defined as arguments to `configure` or exported in
+the environment.
+
+### Variables for otp\_build Only ###
+
+Variables in this section are only used, when configuring Erlang/OTP for
+cross compilation using `$ERL_TOP/otp_build configure`.
+
+> *NOTE*: These variables currently have *no* effect if you configure using
+> the `configure` script directly.
+
+* `erl_xcomp_build` - The build system used. This value will be passed as
+ `--build=$erl_xcomp_build` argument to the `configure` script. It does
+ not have to be a full `CPU-VENDOR-OS` triplet, but can be. The full
+ `CPU-VENDOR-OS` triplet will be created by
+ `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_build`. If set to `guess`,
+ the build system will be guessed using
+ `$ERL_TOP/erts/autoconf/config.guess`.
+
+* `erl_xcomp_host` - Cross host/target system to build for. This value will
+ be passed as `--host=$erl_xcomp_host` argument to the `configure` script.
+ It does not have to be a full `CPU-VENDOR-OS` triplet, but can be. The
+ full `CPU-VENDOR-OS` triplet will be created by
+ `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host`.
+
+* `erl_xcomp_configure_flags` - Extra configure flags to pass to the
+ `configure` script.
+
+### Cross Compiler and Other Tools ###
+
+If the cross compilation tools are prefixed by `<HOST>-` you probably do
+not need to set these variables (where `<HOST>` is what has been passed as
+`--host=<HOST>` argument to `configure`).
+
+All variables in this section can also be used when native compiling.
+
+* `CC` - C compiler.
+
+* `CFLAGS` - C compiler flags.
+
+* `STATIC_CFLAGS` - Static C compiler flags.
+
+* `CFLAG_RUNTIME_LIBRARY_PATH` - This flag should set runtime library
+ search path for the shared libraries. Note that this actually is a
+ linker flag, but it needs to be passed via the compiler.
+
+* `CPP` - C pre-processor.
+
+* `CPPFLAGS` - C pre-processor flags.
+
+* `CXX` - C++ compiler.
+
+* `CXXFLAGS` - C++ compiler flags.
+
+* `LD` - Linker.
+
+* `LDFLAGS` - Linker flags.
+
+* `LIBS` - Libraries.
+
+#### Dynamic Erlang Driver Linking ####
+
+> *NOTE*: Either set all or none of the `DED_LD*` variables.
+
+* `DED_LD` - Linker for Dynamically loaded Erlang Drivers.
+
+* `DED_LDFLAGS` - Linker flags to use with `DED_LD`.
+
+* `DED_LD_FLAG_RUNTIME_LIBRARY_PATH` - This flag should set runtime library
+ search path for shared libraries when linking with `DED_LD`.
+
+#### Large File Support ####
+
+> *NOTE*: Either set all or none of the `LFS_*` variables.
+
+* `LFS_CFLAGS` - Large file support C compiler flags.
+
+* `LFS_LDFLAGS` - Large file support linker flags.
+
+* `LFS_LIBS` - Large file support libraries.
+
+#### Other Tools ####
+
+* `RANLIB` - `ranlib` archive index tool.
+
+* `AR` - `ar` archiving tool.
+
+* `GETCONF` - `getconf` system configuration inspection tool. `getconf` is
+ currently used for finding out large file support flags to use, and
+ on Linux systems for finding out if we have an NPTL thread library or
+ not.
+
+### Cross System Root Locations ###
+
+* `erl_xcomp_sysroot` - The absolute path to the system root of the cross
+ compilation environment. Currently, the `crypto`, `odbc`, `ssh` and
+ `ssl` applications need the system root. These applications will be
+ skipped if the system root has not been set. The system root might be
+ needed for other things too. If this is the case and the system root
+ has not been set, `configure` will fail and request you to set it.
+
+* `erl_xcomp_isysroot` - The absolute path to the system root for includes
+ of the cross compilation environment. If not set, this value defaults
+ to `$erl_xcomp_sysroot`, i.e., only set this value if the include system
+ root path is not the same as the system root path.
+
+### Optional Feature, and Bug Tests ###
+
+These tests cannot (always) be done automatically when cross compiling. You
+usually do not need to set these variables.
+
+> *WARNING*: Setting these variables wrong may cause hard to detect
+> runtime errors. If you need to change these values, *really* make sure
+> that the values are correct.
+
+> *NOTE*: Some of these values will override results of tests performed
+> by `configure`, and some will not be used until `configure` is sure that
+> it cannot figure the result out.
+
+The `configure` script will issue a warning when a default value is used.
+When a variable has been set, no warning will be issued.
+
+* `erl_xcomp_after_morecore_hook` - `yes|no`. Defaults to `no`. If `yes`,
+ the target system must have a working `__after_morecore_hook` that can be
+ used for tracking used `malloc()` implementations core memory usage.
+ This is currently only used by unsupported features.
+
+* `erl_xcomp_bigendian` - `yes|no`. No default. If `yes`, the target system
+ must be big endian. If `no`, little endian. This can often be
+ automatically detected, but not always. If not automatically detected,
+ `configure` will fail unless this variable is set. Since no default
+ value is used, `configure` will try to figure this out automatically.
+
+* `erl_xcomp_double_middle` - `yes|no`. Defaults to `no`.
+ If `yes`, the target system must have doubles in "middle-endian" format. If
+ `no`, it has "regular" endianness.
+
+* `erl_xcomp_clock_gettime_cpu_time` - `yes|no`. Defaults to `no`. If `yes`,
+ the target system must have a working `clock_gettime()` implementation
+ that can be used for retrieving process CPU time.
+
+* `erl_xcomp_getaddrinfo` - `yes|no`. Defaults to `no`. If `yes`, the target
+ system must have a working `getaddrinfo()` implementation that can
+ handle both IPv4 and IPv6.
+
+* `erl_xcomp_gethrvtime_procfs_ioctl` - `yes|no`. Defaults to `no`. If `yes`,
+ the target system must have a working `gethrvtime()` implementation and
+ is used with procfs `ioctl()`.
+
+* `erl_xcomp_dlsym_brk_wrappers` - `yes|no`. Defaults to `no`. If `yes`, the
+ target system must have a working `dlsym(RTLD_NEXT, <S>)` implementation
+ that can be used on `brk` and `sbrk` symbols used by the `malloc()`
+ implementation in use, and by this track the `malloc()` implementations
+ core memory usage. This is currently only used by unsupported features.
+
+* `erl_xcomp_kqueue` - `yes|no`. Defaults to `no`. If `yes`, the target
+ system must have a working `kqueue()` implementation that returns a file
+ descriptor which can be used by `poll()` and/or `select()`. If `no` and
+ the target system has not got `epoll()` or `/dev/poll`, the kernel-poll
+ feature will be disabled.
+
+* `erl_xcomp_linux_clock_gettime_correction` - `yes|no`. Defaults to `yes` on
+ Linux; otherwise, `no`. If `yes`, `clock_gettime(CLOCK_MONOTONIC, _)` on
+ the target system must work. This variable is recommended to be set to
+ `no` on Linux systems with kernel versions less than 2.6.
+
+* `erl_xcomp_linux_nptl` - `yes|no`. Defaults to `yes` on Linux; otherwise,
+ `no`. If `yes`, the target system must have NPTL (Native POSIX Thread
+ Library). Older Linux systems have LinuxThreads instead of NPTL (Linux
+ kernel versions typically less than 2.6).
+
+* `erl_xcomp_linux_usable_sigaltstack` - `yes|no`. Defaults to `yes` on Linux;
+ otherwise, `no`. If `yes`, `sigaltstack()` must be usable on the target
+ system. `sigaltstack()` on Linux kernel versions less than 2.4 are
+ broken.
+
+* `erl_xcomp_linux_usable_sigusrx` - `yes|no`. Defaults to `yes`. If `yes`,
+ the `SIGUSR1` and `SIGUSR2` signals must be usable by the ERTS. Old
+ LinuxThreads thread libraries (Linux kernel versions typically less than
+ 2.2) used these signals and made them unusable by the ERTS.
+
+* `erl_xcomp_poll` - `yes|no`. Defaults to `no` on Darwin/MacOSX; otherwise,
+ `yes`. If `yes`, the target system must have a working `poll()`
+ implementation that also can handle devices. If `no`, `select()` will be
+ used instead of `poll()`.
+
+* `erl_xcomp_putenv_copy` - `yes|no`. Defaults to `no`. If `yes`, the target
+ system must have a `putenv()` implementation that stores a copy of the
+ key/value pair.
+
+* `erl_xcomp_reliable_fpe` - `yes|no`. Defaults to `no`. If `yes`, the target
+ system must have reliable floating point exceptions.
+
+Copyright and License
+---------------------
+
+%CopyrightBegin%
+
+Copyright Ericsson AB 2009-2010. All Rights Reserved.
+
+The contents of this file are subject to the Erlang Public License,
+Version 1.1, (the "License"); you may not use this file except in
+compliance with the License. You should have received a copy of the
+Erlang Public License along with this software. If not, it can be
+retrieved online at http://www.erlang.org/.
+
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+the License for the specific language governing rights and limitations
+under the License.
+
+%CopyrightEnd%
+
+Modifying This Document
+-----------------------
+
+Before modifying this document you need to have a look at the
+[$ERL_TOP/HOWTO/MARKDOWN.md][] document.
+
+
+
+ [$ERL_TOP/HOWTO/INSTALL.md]: INSTALL.md
+ [Building in Git]: INSTALL.md#How-to-Build-and-Install-ErlangOTP_Building-in-Git
+ [How to Build the Documentation]: INSTALL.md#The-ErlangOTP-Documentation_How-to-Build-the-Documentation
+ [cross configuration variables]: #Currently-Used-Configuration-Variables
+ [DESTDIR]: http://www.gnu.org/prep/standards/html_node/DESTDIR.html
+ [$ERL_TOP/HOWTO/MARKDOWN.md]: MARKDOWN.md
+
+ [?TOC]: true
diff --git a/INSTALL-WIN32.md b/HOWTO/INSTALL-WIN32.md
index 1e5e1f45fa..94d3688f23 100644
--- a/INSTALL-WIN32.md
+++ b/HOWTO/INSTALL-WIN32.md
@@ -211,10 +211,10 @@ Frequently Asked Questions
A: For Cygwin and Msys alike, we try to use the latest releases
available when building. What versions you use shouldn't really
matter, I try to include workarounds for the bugs I've found in
- different Cygwin/Msys releases, please help me to add workarounds
+ different Cygwin/Msys releases, please help me add workarounds
for new Cygwin/Msys-related bugs as soon as you encounter
them. Also please do submit bug reports to the appropriate Cygwin
- adn/or Msys developers. The GCC we used for %OTP-REL% was version
+ and/or Msys developers. The GCC we used for %OTP-REL% was version
4.7.0 (MinGW 64bit) and 4.3.4 (Cygwin 32bit). We used VC++ 10.0
(i.e. Visual studio 2010), Sun's JDK 1.5.0\_17 (32bit) and Sun's
JDK 1.7.0\_1 (64bit), NSIS 2.46, and Win32 OpenSSL 0.9.8r. Please
@@ -291,7 +291,7 @@ OpenSSL. Well' here's the list:
used but Sun's Java compiler and virtual machine...
If you are going to build a 64bit Windows version, you should make
- sure to get MinGWs 64bit gcc installed with cygwin. It's in one of
+ sure to get MinGW's 64bit gcc installed with cygwin. It's in one of
the development packages.
URL: <http://www.cygwin.com>
@@ -428,7 +428,7 @@ OpenSSL. Well' here's the list:
e.g. `C:\Program`, they might still reside in `C:\Program Files`
in reality...
- If you are building a 64 bit verision of Erlang, you should set up
+ If you are building a 64 bit version of Erlang, you should set up
PATHs etc a little differently. I use the following script to
make things work in both Cygwin and Msys:
@@ -600,32 +600,36 @@ OpenSSL. Well' here's the list:
Windows command prompt (it should be on the same drive as where
you are going to install it if everything is to work smothly).
- `C:\> cd <some dir>`
+ C:\> cd <some dir>
Add ActiveState (or some other windows perl, not cygwins) to your PATH:
- `C:\...\> set PATH=C:\Perl\bin;%PATH%`
+ C:\...\> set PATH=C:\Perl\bin;%PATH%
+
+ Or if you installed the 64bit perl:
+
+ C:\...\> set PATH=C:\Perl64\bin;%PATH%
Configure OpenSSL for 32 bit:
- `C:\...\> perl Configure VC-WIN32 --prefix=/OpenSSL`
+ C:\...\> perl Configure VC-WIN32 --prefix=/OpenSSL
Or for 64 bit:
- `C:\...\> perl Configure VC-WIN64A --prefix=/OpenSSL-Win64`
+ C:\...\> perl Configure VC-WIN64A --prefix=/OpenSSL-Win64
Do some setup (for 32 bit):
- `C:\...\> ms\do_win32`
+ C:\...\> ms\do_ms
The same for 64 bit:
- `C:\...\> ms\do_win64a`
+ C:\...\> ms\do_win64a
Then build static libraries and install:
- `C:\...\> nmake -f ms\nt.mak`
- `C:\...\> nmake -f ms\nt.mak install`
+ C:\...\> nmake -f ms\nt.mak
+ C:\...\> nmake -f ms\nt.mak install
That's it - you now have your perfectly consistent static build of
openssl. If you want to get rid of any possibly patented
@@ -644,19 +648,21 @@ OpenSSL. Well' here's the list:
edit: `C:\cygwin\opt\local\pgm\wxMSW-2.8.11\include\wx\msw\setup.h`
enable `wxUSE_GLCANVAS`, `wxUSE_POSTSCRIPT` and `wxUSE_GRAPHICS_CONTEXT`
- build: From a command prompt with the VC tools available (usually started from a
- shortcut installed by the SDK/Visual Studio):
+ build: From a command prompt with the VC tools available (See the
+ instructions for OpenSSL build above for help on starting the
+ proper command prompt in RELEASE mode):
- `cd C:\cygwin\opt\local\pgm\wxMSW-2.8.11\build\msw`
- `nmake BUILD=release SHARED=0 UNICODE=1 USE_OPENGL=1 USE_GDIPLUS=1 DIR_SUFFIX_CPU= -f makefile.vc`
- `cd C:\cygwin\opt\local\pgm\wxMSW-2.8.11\contrib\build\stc`
- `nmake BUILD=release SHARED=0 UNICODE=1 USE_OPENGL=1 USE_GDIPLUS=1 DIR_SUFFIX_CPU= -f makefile.vc`
+ C:\...\> cd C:\cygwin\opt\local\pgm\wxMSW-2.8.11\build\msw
+ C:\...\> nmake BUILD=release SHARED=0 UNICODE=1 USE_OPENGL=1 USE_GDIPLUS=1 DIR_SUFFIX_CPU= -f makefile.vc
+ C:\...\> cd C:\cygwin\opt\local\pgm\wxMSW-2.8.11\contrib\build\stc
+ C:\...\> nmake BUILD=release SHARED=0 UNICODE=1 USE_OPENGL=1 USE_GDIPLUS=1 DIR_SUFFIX_CPU= -f makefile.vc
Or - if building a 64bit version:
- `cd C:\cygwin\opt\local\pgm\wxMSW-2.8.11\build\msw`
- `nmake TARGET_CPU=amd64 BUILD=release SHARED=0 UNICODE=1 USE_OPENGL=1 USE_GDIPLUS=1 DIR_SUFFIX_CPU= -f makefile.vc`
- `cd C:\cygwin\opt\local\pgm\wxMSW-2.8.11\contrib\build\stc`
- `nmake TARGET_CPU=amd64 BUILD=release SHARED=0 UNICODE=1 USE_OPENGL=1 USE_GDIPLUS=1 DIR_SUFFIX_CPU= -f makefile.vc`
+
+ C:\...\> cd C:\cygwin\opt\local\pgm\wxMSW-2.8.11\build\msw
+ C:\...\> nmake TARGET_CPU=amd64 BUILD=release SHARED=0 UNICODE=1 USE_OPENGL=1 USE_GDIPLUS=1 DIR_SUFFIX_CPU= -f makefile.vc
+ C:\...\> cd C:\cygwin\opt\local\pgm\wxMSW-2.8.11\contrib\build\stc
+ C:\...\> nmake TARGET_CPU=amd64 BUILD=release SHARED=0 UNICODE=1 USE_OPENGL=1 USE_GDIPLUS=1 DIR_SUFFIX_CPU= -f makefile.vc
* The Erlang source distribution (from <http://www.erlang.org/download.html>).
The same as for Unix platforms. Preferably use tar from within Cygwin to
@@ -971,7 +977,7 @@ URL:<http://code.google.com/p/msysgit/>
that makes a nice Git port. The msys prompt you get from MsysGIT is
however not compatible with the full version from MinGW, so you will
-need to check out files using MsysGITs command prompt and then switch
+need to check out files using MsysGIT's command prompt and then switch
to a common Msys command prompt for building. Also all test suites
cannot be built as MsysGIT/Msys does not handle symbolic links. To
build test suites on Windows, you will need Cygwin for now. Hopefully
@@ -996,11 +1002,11 @@ deserved.
Of course this would have been completely impossible without the
excellent Cygwin. The guys at Cygnus solutions and
-Redhat deserves a huge THANKS! as well as all the other people in the
+Redhat deserve a huge THANKS! as well as all the other people in the
free software community who have helped in creating the magnificent
software that constitutes Cygwin.
-Also the people developing the alternative command prompt Msys anfd
+Also the people developing the alternative command prompt Msys and
the MinGW compiler are worth huge THANKS! The 64bit port would have
been impossible without the 64bit MinGW compiler.
@@ -1012,7 +1018,7 @@ Copyright and License
%CopyrightBegin%
-Copyright Ericsson AB 2003-2011. All Rights Reserved.
+Copyright Ericsson AB 2003-2012. 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
@@ -1031,10 +1037,11 @@ Modifying This Document
-----------------------
Before modifying this document you need to have a look at the
-`$ERL_TOP/README.md.txt` document.
+[$ERL_TOP/HOWTO/MARKDOWN.md][] document.
[1]: http://www.erlang.org/faq.html "mailing lists"
+ [$ERL_TOP/HOWTO/MARKDOWN.md]: MARKDOWN.md
[?TOC]: true
diff --git a/INSTALL.md b/HOWTO/INSTALL.md
index 34868143db..4f7c317a47 100644
--- a/INSTALL.md
+++ b/HOWTO/INSTALL.md
@@ -18,10 +18,10 @@ Erlang/OTP should be possible to build from source on any Unix system,
including Mac OS X. This document describes how to native compile Erlang/OTP
on Unix. For detailed instructions on how to
-* cross compile Erlang/OTP, see the [$ERL_TOP/INSTALL-CROSS.md][]
+* cross compile Erlang/OTP, see the [$ERL_TOP/HOWTO/INSTALL-CROSS.md][]
document.
-* build Erlang/OTP on Windows, see the [$ERL_TOP/INSTALL-WIN32.md][]
+* build Erlang/OTP on Windows, see the [$ERL_TOP/HOWTO/INSTALL-WIN32.md][]
document.
Binary releases for Windows can be found at
@@ -63,7 +63,7 @@ At Ericsson we have a "Daily Build and Test" that runs on:
* x86
* OpenBSD 5.0
* x86\_64
-* Mac OS X 10.5.8 (Leopard), 10.6.0 (Snow Leopard), 10.7.2 (Lion)
+* Mac OS X 10.5.8 (Leopard), 10.6.0 (Snow Leopard), 10.7.3 (Lion)
* x86
* Windows XP SP3, 2003, Vista, 7
* x86
@@ -645,9 +645,6 @@ Use `hipe:help_options/0` to print out the available options.
Mac OS X (Darwin)
-----------------
-We test Mac OS X 10.4.11 (Tiger) and Mac OS X 10.5.x (Leopard) in our daily
-builds (but only on Intel processors).
-
Make sure that the command `hostname` returns a valid fully qualified host
name (this is configured in `/etc/hostconfig`).
@@ -656,6 +653,15 @@ If you develop linked-in drivers (shared library) you need to link using
include `-fno-common` in `CFLAGS` when compiling. Use `.so` as the library
suffix.
+Use the `--enable-darwin-64bit` configure flag to build a 64-bit
+binaries on Mac OS X.
+
+Building universal binaries on Mac OS X (obsolete information)
+--------------------------------------------------------------
+
+(This information was written when Mac OS X Leopard was the current
+release. It may no longer work.)
+
Universal 32bit binaries can be built on an Intel Mac using the
`--enable-darwin-universal` configure option. There still may occur
problems with certain applications using this option, but the base
@@ -687,34 +693,61 @@ Universal binaries and 64bit binaries are mutually exclusive options.
Building a fast Erlang VM on Mac OS Lion
----------------------------------------
-Starting with XCode 4.2, Apple no longer includes a "real" `gcc`
+Starting with Xcode 4.2, Apple no longer includes a "real" `gcc`
compiler (not based on the LLVM). Building with `llvm-gcc` or `clang`
will work, but the performance of the Erlang run-time system will not
be the best possible.
Note that if you have `gcc-4.2` installed and included in `PATH`
-(from a previous version of XCode), `configure` will automatically
+(from a previous version of Xcode), `configure` will automatically
make sure that `gcc-4.2` will be used to compile `beam_emu.c`
(the source file most in need of `gcc`).
If you don't have `gcc-4.2.` and want to build a run-time system with
the best possible performance, do like this:
-Install XCode from the AppStore if it is not already installed.
+Install Xcode from the AppStore if it is not already installed.
+
+If you have Xcode 4.3, or later, you will also need to download
+"Command Line Tools" via the Downloads preference pane in Xcode.
+
+Some tools may still be lacking or out-of-date, we recommend using
+[Homebrew](https://github.com/mxcl/homebrew/wiki/installation) or
+Macports to update those tools.
Install MacPorts (<http://www.macports.org/>). Then:
$ sudo port selfupdate
$ sudo port install gcc45 +universal
-If you want to build the `wx` application, get wxMac-2.8.12
+### Building with wxErlang ###
+
+If you want to build the `wx` application, you will need to get wxMac-2.8.12
(`wxMac-2.8.12.tar.gz` from
-<http://sourceforge.net/projects/wxwindows/files/2.8.12/>) and build:
+<http://sourceforge.net/projects/wxwindows/files/2.8.12/>) and install it.
+
+Export the path for MacOSX10.6.sdk:
+
+ $ export SDK=/Developer/SDKs/MacOSX10.6.sdk
- $ arch_flags="-arch i386" ./configure CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" LDFLAGS="$arch_flags" OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags" --prefix=/usr/local --with-macosx-sdk=/Developer/SDKs/MacOSX10.6.sdk --with-macosx-version-min=10.6 --enable-unicode --with-opengl --disable-shared
+In Xcode 4.3 the path has changed so use the following instead,
+
+ $ export SDK=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk
+
+Then configure and build wxMac:
+
+ $ arch_flags="-arch i386" ./configure CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" LDFLAGS="$arch_flags" OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags" --prefix=/usr/local --with-macosx-sdk="$SDK" --with-macosx-version-min=10.6 --enable-unicode --with-opengl --disable-shared
+ $ make
+ $ sudo make install
+
+To link wx properly you will also need to build and install `wxStyledTextCtrl`:
+
+ $ cd contrib/src/stc
$ make
$ sudo make install
+### Finish up ###
+
Build Erlang with the MacPorts GCC as the main compiler (using `clang`
for the Objective-C Cocoa code in the `wx` application):
@@ -768,7 +801,7 @@ Copyright and License
%CopyrightBegin%
-Copyright Ericsson AB 1998-2011. All Rights Reserved.
+Copyright Ericsson AB 1998-2012. 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
@@ -792,12 +825,12 @@ Modifying This Document
-----------------------
Before modifying this document you need to have a look at the
-`$ERL_TOP/README.md.txt` document.
+[$ERL_TOP/HOWTO/MARKDOWN.md][] document.
- [$ERL_TOP/INSTALL-CROSS.md]: INSTALL-CROSS
- [$ERL_TOP/INSTALL-WIN32.md]: INSTALL-WIN32
+ [$ERL_TOP/HOWTO/INSTALL-CROSS.md]: INSTALL-CROSS.md
+ [$ERL_TOP/HOWTO/INSTALL-WIN32.md]: INSTALL-WIN32.md
[DESTDIR]: http://www.gnu.org/prep/standards/html_node/DESTDIR.html
[Building in Git]: #How-to-Build-and-Install-ErlangOTP_Building-in-Git
[Pre-built Source Release]: #How-to-Build-and-Install-ErlangOTP_Prebuilt-Source-Release
@@ -805,5 +838,6 @@ Before modifying this document you need to have a look at the
[html documentation]: http://www.erlang.org/download/otp_doc_html_%OTP-REL%.tar.gz
[man pages]: http://www.erlang.org/download/otp_doc_man_%OTP-REL%.tar.gz
[the released source tar ball]: http://www.erlang.org/download/otp_src_%OTP-REL%.tar.gz
+ [$ERL_TOP/HOWTO/MARKDOWN.md]: MARKDOWN.md
[?TOC]: true
diff --git a/README.md.txt b/HOWTO/MARKDOWN.md
index a5a1bf4b7d..42045fb10c 100644
--- a/README.md.txt
+++ b/HOWTO/MARKDOWN.md
@@ -5,7 +5,7 @@ Introduction
------------
If you are looking for information on how to build and install Erlang/OTP you
-want to read the [$ERL_TOP/INSTALL.md][] document instead of this document
+want to read the [$ERL_TOP/HOWTO/INSTALL.md][] document instead of this document
(where `$ERL_TOP` is the top source directory in the source tree).
All files with the `.md` suffix (as well as this file) are ordinary text files
@@ -258,7 +258,7 @@ under the License.
- [$ERL_TOP/INSTALL.md]: doc/installation_guide:INSTALL
+ [$ERL_TOP/HOWTO/INSTALL.md]: INSTALL.md
[github]: http://github.com
[our github repository]: http://github.com/erlang/otp
diff --git a/HOWTO/SYSTEMTAP.md b/HOWTO/SYSTEMTAP.md
new file mode 100644
index 0000000000..ce9c0b2f0c
--- /dev/null
+++ b/HOWTO/SYSTEMTAP.md
@@ -0,0 +1,75 @@
+SystemTap and Erlang/OTP
+========================
+
+Introduction
+------------
+
+SystemTap is DTrace for Linux. In fact Erlang's SystemTap support
+is build using SystemTap's DTrace compatibility's layer. For an
+introduction to Erlang DTrace support read [$ERL_TOP/HOWTO/DTRACE.md][].
+
+Requisites
+----------
+
+* Linux Kernel with UTRACE support
+
+ check for UTRACE support in your current kernel:
+
+ # grep CONFIG_UTRACE /boot/config-`uname -r`
+ CONFIG_UTRACE=y
+
+ Fedora 16 is known to contain UTRACE, for most other Linux distributions
+ a custom build kernel will be required.
+ Check Fedora's SystemTap documentation for additional required packages
+ (e.g. Kernel Debug Symbols)
+
+* SystemTap > 1.6
+
+ A the time of writing this, the latest released version of SystemTap is
+ version 1.6. Erlang's DTrace support requires a MACRO that was introduced
+ after that release. So either get a newer release or build SystemTap from
+ git yourself (see: http://sourceware.org/systemtap/getinvolved.html)
+
+Building Erlang
+---------------
+
+Configure and build Erlang with SystemTap support:
+
+ # ./configure --with-dynamic-trace=systemtap + whatever args you need
+ # make
+
+Testing
+-------
+
+SystemTap, unlike DTrace, needs to know what binary it is tracing and has to
+be able to read that binary before it starts tracing. Your probe script
+therefor has to reference the correct beam emulator and stap needs to be able
+to find that binary.
+The examples are written for "beam", but other versions such as "beam.smp" or
+"beam.debug.smp" might exist (depending on your configuration). Make sure you
+either specify the full the path of the binary in the probe or your "beam"
+binary is in the search path.
+
+All available probes can be listed like this:
+
+ # stap -L 'process("beam").mark("*")'
+
+or:
+
+ # PATH=/path/to/beam:$PATH stap -L 'process("beam").mark("*")'
+
+
+Probes in the dtrace.so NIF library like this:
+
+ # PATH=/path/to/dtrace/priv/lib:$PATH stap -L 'process("dtrace.so").mark("*")'
+
+Running SystemTap scripts
+-------------------------
+
+Adjust the process("beam") reference to your beam version and attach the script
+to a running "beam" instance:
+
+ # stap /path/to/probe/script/port1.systemtap -x <pid of beam>
+
+
+ [$ERL_TOP/HOWTO/DTRACE.md]: DTRACE.md
diff --git a/HOWTO/TESTING.md b/HOWTO/TESTING.md
new file mode 100644
index 0000000000..34eaa68df8
--- /dev/null
+++ b/HOWTO/TESTING.md
@@ -0,0 +1,150 @@
+Testing Erlang/OTP
+==================
+
+Before you start testing you need to have the Erlang release which you
+are going to test in your path. See [$ERL_TOP/HOWTO/INSTALL.md][] for
+instructions on how to build an Erlang release.
+
+Short version
+-------------
+Move to the top directory of the Erlang release you want to test, i.e.
+cd /ldisk/work/otp
+
+ export ERL_TOP=`pwd`
+ ./otp_build setup -a
+ export PATH=`pwd`/bin:$PATH
+ ./otp_build tests
+ cd release/tests/test_server
+ erl -s ts install -s ts run all_tests -s init stop
+
+Where are the tests
+-------------------
+
+There are a lot of tests which test Erlang/OTP (as of 2012 about 12000) and
+they are located in different places throughout the source tree. Below is a list
+of the places where you can expect to find tests:
+
+* $ERL_TOP/lib/AppName/test/
+* $ERL_TOP/erts/test/
+* $ERL_TOP/erts/emulator/test/
+* $ERL_TOP/erts/epmd/test/
+
+Writing tests
+-------------
+
+All tests are [common_test][] suites and follow the same pattern as all
+[common_test][] suites. However, a couple of corner cases are
+handled by a test wrapper called `ts`. `ts` allows the test writer to put
+`Makefile.src` and `Makefile.first` files in the [data_dir][] and a special
+directory called `all_SUITE_data`.
+
+`Makefile.first` is run before any other Makefile and is typically used to
+generate .hrl files which are needed by other test suites. At the moment only
+the erl_interface tests use this feature and it should remain that way.
+
+`Makefile.src` is configured to a `Makefile` using the `variables` created when
+[configuring the tests][]. These `Makefile`s are later run by the test suite
+to compile whatever platform specific code the tests need to run.
+
+Releasing tests
+---------------
+
+If you cannot use [ct_run][] in the source tree you have to release the tests
+into a common test directory. The easiest way to do this is to use `otp_build`
+like this:
+
+ export ERL_TOP=`pwd`; ./otp_build tests
+
+This will release all tests in Erlang/OTP to `$ERL_TOP/release/tests/`. If you
+want to change the directory where the tests are released to use the `TESTROOT`
+environmental variable.
+
+In the `$TESTROOT` you should now see *_test folders. These folders contain
+everything needed to test Erlang/OTP and are platform independent; if you are
+testing Erlang on multiple platforms you just have to release on one and copy
+the tests to all other platforms.
+
+### Releasing cross tests
+
+For releasing tests in a cross compilation environment see [$ERL_TOP/HOWTO/INSTALL-CROSS.md][].
+
+Configuring and Running tests
+-----------------------------
+
+Running tests is done by first navigating to the `$TESTROOT/test_server` folder
+created when you released the tests and then start `erl` in that directory. The
+emulator flags specified will be used in the test runs. For example, if you want
+to test using async threads you have to supply `+A 10` to `erl` when you start it.
+
+To configure and run the tests `ts` is used. `ts` is a wrapper module to
+[common_test][] which takes care of configuration and build issues before
+[common_test][] is started.
+
+`ts` has a lot of special options and functions which can be usefull when
+testing Erlang/OTP. For a full listing issue `ts:help()` in the erlang shell.
+
+### Configuring the test environment
+
+Before running released tests you have to install them on the target system.
+Installing the tests is done by calling `ts:install().` in the Erlang shell
+which you intend to test from. `ts:install()` is basically a wrapper to a
+configure script and some Erlang code which figures out what your system looks
+like and what kind of emulator you are testing with. `ts:install()` can also
+take some arguments if necessary, see `ts:help()` for details.
+
+All variables created by `ts:install()` are found in
+`$TESTROOT/test_server/variables`.
+
+### Running the tests
+
+To run all test suites go to `$TESTROOT/test_server` fire up an Erlang shell and type:
+
+ ts:run().
+
+Note that running all tests will require several hours, so you may want to run
+the test cases for a single application
+
+ ts:run(Application, [batch]).
+
+or even part of the test suite for an application, for example
+
+ ts:run(emulator, bs, [batch]).
+
+to run all test suite modules starting with `bs` (i.e. all modules that test
+the bit syntax).
+
+To run a specific test case in a module, the full name of the module and test
+case must be specified:
+
+ ts:run(emulator, bs_bincomp_SUITE, byte_aligned, [batch]).
+
+Run `ts:help().` for more information.
+
+As of R14B02 it is also possibly to start all tests but the erl_interface tests
+by invoking Common Test directly from the released applications test directory,
+i.e.
+
+ cd $TESTROOT/test_server
+ $ERL_TOP/bin/ct_run -suite ../compiler_test/andor_SUITE -case t_orelse
+
+Running [ct_run][] from the command line still requires you to do the
+`ts:install()` step above.
+
+Examining the results
+---------------------
+
+Open the file `release/tests/test_server/index.html` in a web browser. Or open
+`release/tests/test_server/last_test.html` when a test suite is running to
+examine the results so far for the currently executing test suite (in R14B02 and
+later you want to open the `release/tests/test_server/all_runs.html` file to
+get to the currently running test)
+
+ [ct_run]: http://www.erlang.org/doc/man/ct_run.html
+ [ct hook]: http://www.erlang.org/doc/apps/common_test/ct_hooks_chapter.html
+ [$ERL_TOP/HOWTO/INSTALL.md]: INSTALL.md
+ [$ERL_TOP/HOWTO/INSTALL-CROSS.md]: INSTALL-CROSS.md#testing-the-cross-compiled-system
+ [common_test]: http://www.erlang.org/doc/man/ct.html
+ [data_dir]: http://www.erlang.org/doc/apps/common_test/write_test_chapter.html#data_priv_dir
+ [configuring the tests]: #configuring-the-test-environment
+
+ [?TOC]: true
diff --git a/INSTALL-CROSS.md b/INSTALL-CROSS.md
deleted file mode 120000
index 9e7743b9de..0000000000
--- a/INSTALL-CROSS.md
+++ /dev/null
@@ -1 +0,0 @@
-xcomp/README.md \ No newline at end of file
diff --git a/Makefile.in b/Makefile.in
index 648575e5fd..544233f097 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2011. All Rights Reserved.
+# Copyright Ericsson AB 1998-2012. 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
@@ -121,7 +121,7 @@ BINDIR = $(DESTDIR)$(EXTRA_PREFIX)$(bindir)
#
# Erlang base public files
#
-ERL_BASE_PUB_FILES=erl erlc epmd run_erl to_erl dialyzer typer escript run_test
+ERL_BASE_PUB_FILES=erl erlc epmd run_erl to_erl dialyzer typer escript ct_run run_test
# ERLANG_INST_LIBDIR is the top directory where the Erlang installation
# will be located when running.
@@ -157,6 +157,14 @@ ERLANG_LIBDIR = $(DESTDIR)$(ERLANG_INST_LIBDIR)
# Must be GNU make!
MAKE = @MAKE_PROG@
+NATIVE_LIBS_ENABLED = @NATIVE_LIBS_ENABLED@
+
+ifeq ($(NATIVE_LIBS_ENABLED),yes)
+HIPE_BOOTSTRAP_EBIN = boot_ebin
+else
+HIPE_BOOTSTRAP_EBIN = ebin
+endif
+
# This should be set to the target "arch-vendor-os"
TARGET := @TARGET@
include $(ERL_TOP)/make/target.mk
@@ -167,12 +175,14 @@ BOOTSTRAP_ONLY = @BOOTSTRAP_ONLY@
CROSS_COMPILING = @CROSS_COMPILING@
ifeq ($(CROSS_COMPILING),yes)
INSTALL_CROSS = -cross
+TARGET_HOST=$(shell $(ERL_TOP)/erts/autoconf/config.guess)
else
ifneq ($(DESTDIR),)
INSTALL_CROSS = -cross
else
INSTALL_CROSS =
endif
+TARGET_HOST=
endif
# A BSD compatible install program
@@ -220,8 +230,10 @@ BOOTSTRAP_ROOT = $(ERL_TOP)
LOCAL_PATH = $(ERL_TOP)/erts/bin/$(TARGET):$(ERL_TOP)/erts/bin
ifeq ($(TARGET),win32)
BOOT_PREFIX=$(WIN32_WRAPPER_PATH):$(BOOTSTRAP_ROOT)/bootstrap/bin:
+TEST_PATH_PREFIX=$(WIN32_WRAPPER_PATH):$(ERL_TOP)/bin/win32:
else
BOOT_PREFIX=$(BOOTSTRAP_ROOT)/bootstrap/bin:
+TEST_PATH_PREFIX=$(ERL_TOP)/bin/$(TARGET_HOST):
endif
# ----------------------------------------------------------------------
@@ -323,7 +335,7 @@ all: cross_check_erl depend emulator libs start_scripts
endif
cross_check_erl:
- @PATH=$(BOOT_PREFIX)$${PATH} $(ERL_TOP)/make/cross_check_erl \
+ @PATH=$(BOOT_PREFIX)"$${PATH}" $(ERL_TOP)/make/cross_check_erl \
-target $(TARGET) -otp $(OTP) -erl_top $(ERL_TOP) \
-force $(ERL_XCOMP_FORCE_DIFFERENT_OTP)
@@ -370,16 +382,16 @@ noboot_install:
release: $(INST_DEP)
ifeq ($(OTP_SMALL_BUILD),true)
cd $(ERL_TOP)/lib && \
- ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
- $(MAKE) TESTROOT=$(RELEASE_ROOT) release
+ ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)"$${PATH}" \
+ $(MAKE) TESTROOT="$(RELEASE_ROOT)" release
else
cd $(ERL_TOP)/lib && \
- ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
- $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release
+ ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)"$${PATH}" \
+ $(MAKE) BUILD_ALL=1 TESTROOT="$(RELEASE_ROOT)" release
endif
cd $(ERL_TOP)/erts && \
- ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
- $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release
+ ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)"$${PATH}" \
+ $(MAKE) BUILD_ALL=1 TESTROOT="$(RELEASE_ROOT)" release
# ---------------------------------------------------------------
# Target only used when building commercial ERTS patches
@@ -387,22 +399,22 @@ endif
release_docs docs: mod2app
ifeq ($(OTP_SMALL_BUILD),true)
cd $(ERL_TOP)/lib && \
- PATH=$(ERL_TOP)/bin:$${PATH} ERL_TOP=$(ERL_TOP) \
- $(MAKE) TESTROOT=$(RELEASE_ROOT) $@
+ PATH=$(ERL_TOP)/bin:"$${PATH}" ERL_TOP=$(ERL_TOP) \
+ $(MAKE) TESTROOT="$(RELEASE_ROOT)" $@
else
cd $(ERL_TOP)/lib && \
- PATH=$(ERL_TOP)/bin:$${PATH} ERL_TOP=$(ERL_TOP) \
- $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
+ PATH=$(ERL_TOP)/bin:"$${PATH}" ERL_TOP=$(ERL_TOP) \
+ $(MAKE) BUILD_ALL=1 TESTROOT="$(RELEASE_ROOT)" $@
endif
cd $(ERL_TOP)/erts && \
- PATH=$(ERL_TOP)/bin:$${PATH} ERL_TOP=$(ERL_TOP) \
- $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
+ PATH=$(ERL_TOP)/bin:"$${PATH}" ERL_TOP=$(ERL_TOP) \
+ $(MAKE) BUILD_ALL=1 TESTROOT="$(RELEASE_ROOT)" $@
cd $(ERL_TOP)/system/doc && \
- PATH=$(ERL_TOP)/bin:$${PATH} \
- ERL_TOP=$(ERL_TOP) $(MAKE) TESTROOT=$(RELEASE_ROOT) $@
+ PATH=$(ERL_TOP)/bin:"$${PATH}" \
+ ERL_TOP=$(ERL_TOP) $(MAKE) TESTROOT="$(RELEASE_ROOT)" $@
mod2app:
- PATH=$(ERL_TOP)/bin:$${PATH} escript $(ERL_TOP)/lib/erl_docgen/priv/bin/xref_mod_app.escript -topdir $(ERL_TOP) -outfile $(ERL_TOP)/make/$(TARGET)/mod2app.xml
+ PATH=$(ERL_TOP)/bin:"$${PATH}" escript $(ERL_TOP)/lib/erl_docgen/priv/bin/xref_mod_app.escript -topdir $(ERL_TOP) -outfile $(ERL_TOP)/make/$(TARGET)/mod2app.xml
# ----------------------------------------------------------------------
ERLANG_EARS=$(BOOTSTRAP_ROOT)/bootstrap/erts
@@ -419,46 +431,46 @@ emulator:
libs:
ifeq ($(OTP_SMALL_BUILD),true)
cd lib && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)"$${PATH}" \
$(MAKE) opt
else
cd lib && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)"$${PATH}" \
$(MAKE) opt BUILD_ALL=true
endif
kernel:
cd lib/kernel && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)"$${PATH}" \
$(MAKE) opt BUILD_ALL=true
stdlib:
cd lib/stdlib && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)"$${PATH}" \
$(MAKE) opt BUILD_ALL=true
compiler:
cd lib/compiler && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)"$${PATH}" \
$(MAKE) opt BUILD_ALL=true
hipe:
cd lib/hipe && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)"$${PATH}" \
$(MAKE) opt BUILD_ALL=true
typer:
cd lib/typer && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)"$${PATH}" \
$(MAKE) opt BUILD_ALL=true
syntax_tools:
cd lib/syntax_tools && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)"$${PATH}" \
$(MAKE) opt BUILD_ALL=true
preloaded:
cd erts/preloaded/src && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)"$${PATH}" \
$(MAKE) opt BUILD_ALL=true
dep depend:
@@ -519,13 +531,13 @@ bootstrap_setup_target:
secondary_bootstrap_build:
cd lib && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)"$${PATH}" \
$(MAKE) opt SECONDARY_BOOTSTRAP=true
secondary_bootstrap_copy:
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe ; fi
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin ; fi
- for x in lib/hipe/ebin/*.beam; do \
+ for x in lib/hipe/$(HIPE_BOOTSTRAP_EBIN)/*.beam; do \
BN=`basename $$x`; \
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin/$$BN; \
test -f $$TF && \
@@ -535,7 +547,6 @@ secondary_bootstrap_copy:
cp $$x $$TF; \
true; \
done
-# if test -f lib/hipe/ebin/hipe.beam ; then cp lib/hipe/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin; fi
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; fi
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; fi
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include ; fi
@@ -598,10 +609,22 @@ secondary_bootstrap_copy:
cp $$x $$TF; \
true; \
done
+ if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/xmerl ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/xmerl ; fi
+ if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/xmerl/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/xmerl/include ; fi
+ for x in lib/xmerl/include/*.hrl; do \
+ BN=`basename $$x`; \
+ TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/xmerl/include/$$BN; \
+ test -f $$TF && \
+ test '!' -z "`find $$x -newer $$TF -print`" && \
+ cp $$x $$TF; \
+ test '!' -f $$TF && \
+ cp $$x $$TF; \
+ true; \
+ done
tertiary_bootstrap_build:
cd lib && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)"$${PATH}" \
$(MAKE) opt TERTIARY_BOOTSTRAP=true
tertiary_bootstrap_copy:
@@ -630,6 +653,8 @@ tertiary_bootstrap_copy:
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/include ; fi
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server ; fi
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server/include ; fi
+ if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/common_test ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/common_test ; fi
+ if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/common_test/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/common_test/include ; fi
for x in lib/ic/ebin/*.beam; do \
BN=`basename $$x`; \
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin/$$BN; \
@@ -707,6 +732,7 @@ tertiary_bootstrap_copy:
true; \
done
+# copy test includes to be able to compile tests with bootstrap compiler
for x in lib/test_server/include/*.hrl; do \
BN=`basename $$x`; \
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/test_server/include/$$BN; \
@@ -717,6 +743,17 @@ tertiary_bootstrap_copy:
cp $$x $$TF; \
true; \
done
+
+ for x in lib/common_test/include/*.hrl; do \
+ BN=`basename $$x`; \
+ TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/common_test/include/$$BN; \
+ test -f $$TF && \
+ test '!' -z "`find $$x -newer $$TF -print`" && \
+ cp $$x $$TF; \
+ test '!' -f $$TF && \
+ cp $$x $$TF; \
+ true; \
+ done
# cp lib/syntax_tools/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin
.PHONY: check_recreate_primary_bootstrap recreate_primary_bootstrap
@@ -839,13 +876,13 @@ KERNEL_PRELOAD_BEAMS=$(KERNEL_PRELOAD:%=$(BOOTSTRAP_TOP)/lib/kernel/ebin/%.beam)
start_scripts:
@cd erts/start_scripts \
- && ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} $(MAKE) script
+ && ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)"$${PATH}" $(MAKE) script
# Creates "erl" and "erlc" scripts in bin/erl which uses the libraries in lib
local_setup:
@rm -f bin/erl bin/erlc bin/cerl
@cd erts && \
- ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
+ ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)"$${PATH}" \
$(MAKE) local_setup
@@ -867,8 +904,8 @@ tests release_tests: $(TEST_DIRS)
$(TEST_DIRS):
if test -f $@/Makefile; then \
- (cd $@; $(MAKE) TESTROOT=$(TESTSUITE_ROOT) \
- PATH=$(ERL_TOP)/bin:$(BOOT_PREFIX)$${PATH} release_tests) || exit $$?; \
+ (cd $@; $(MAKE) TESTROOT="$(TESTSUITE_ROOT)" \
+ PATH=$(TEST_PATH_PREFIX)$(BOOT_PREFIX)"$${PATH}" release_tests) || exit $$?; \
fi
#
@@ -881,29 +918,29 @@ INST_DEP += install.dirs install.emulator install.libs install.Install install.b
install: $(INST_DEP)
install-docs:
- ERL_TOP=$(ERL_TOP) INSTALLROOT=$(ERLANG_LIBDIR) PATH=$(BOOT_PREFIX)$${PATH} \
- $(MAKE) RELEASE_ROOT=$(ERLANG_LIBDIR) release_docs
+ ERL_TOP=$(ERL_TOP) INSTALLROOT="$(ERLANG_LIBDIR)" PATH=$(BOOT_PREFIX)"$${PATH}" \
+ $(MAKE) RELEASE_ROOT="$(ERLANG_LIBDIR)" release_docs
install.emulator:
cd erts && \
- ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
- $(MAKE) TESTROOT=$(ERLANG_LIBDIR) release
+ ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)"$${PATH}" \
+ $(MAKE) TESTROOT="$(ERLANG_LIBDIR)" release
install.libs:
ifeq ($(OTP_SMALL_BUILD),true)
cd lib && \
- ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
- $(MAKE) TESTROOT=$(ERLANG_LIBDIR) release
+ ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)"$${PATH}" \
+ $(MAKE) TESTROOT="$(ERLANG_LIBDIR)" release
else
cd lib && \
- ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
- $(MAKE) TESTROOT=$(ERLANG_LIBDIR) BUILD_ALL=true release
+ ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)"$${PATH}" \
+ $(MAKE) TESTROOT="$(ERLANG_LIBDIR)" BUILD_ALL=true release
endif
install.Install:
- (cd $(ERLANG_LIBDIR) \
- && ./Install $(INSTALL_CROSS) -minimal $(ERLANG_INST_LIBDIR))
+ (cd "$(ERLANG_LIBDIR)" \
+ && ./Install $(INSTALL_CROSS) -minimal "$(ERLANG_INST_LIBDIR)")
#
# Install erlang base public files
@@ -922,9 +959,9 @@ install.bin:
# Directories needed before we can install
#
install.dirs:
- test -d $(BINDIR) || ${MKSUBDIRS} $(BINDIR)
- ${MKSUBDIRS} $(ERLANG_LIBDIR)
- ${MKSUBDIRS} $(ERLANG_LIBDIR)/usr/lib
+ test -d "$(BINDIR)" || ${MKSUBDIRS} "$(BINDIR)"
+ ${MKSUBDIRS} "$(ERLANG_LIBDIR)"
+ ${MKSUBDIRS} "$(ERLANG_LIBDIR)/usr/lib"
.PHONY: strict_install
diff --git a/README.md b/README.md
index c38f097b0f..1bcf14e760 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ Building and Installing
-----------------------
Information on building and installing Erlang/OTP can be found
-in the `INSTALL.md` document.
+in the [$ERL_TOP/HOWTO/INSTALL.md] [5] document.
Contributing to Erlang/OTP
--------------------------
@@ -46,7 +46,7 @@ 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"
+* 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.
Copyright and License
@@ -54,7 +54,7 @@ Copyright and License
> %CopyrightBegin%
>
-> Copyright Ericsson AB 2010. All Rights Reserved.
+> Copyright Ericsson AB 2010-2012. 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
@@ -73,4 +73,6 @@ Copyright and License
[1]: http://www.erlang.org
[2]: http://wiki.github.com/erlang/otp/submitting-patches
- [3]: http://www.erlang.org/faq.html
+ [3]: http://www.erlang.org/static/doc/mailinglist.html
+ [4]: http://erlang.github.com/otp/
+ [5]: HOWTO/INSTALL.md
diff --git a/TAR.include b/TAR.include
index 5146458eea..87854d24c7 100644
--- a/TAR.include
+++ b/TAR.include
@@ -2,10 +2,10 @@ AUTHORS
EPLICENCE
Makefile.in
README.md
-README.md.txt
-INSTALL.md
-INSTALL-CROSS.md
-INSTALL-WIN32.md
+HOWTO/MARKDOWN.md
+HOWTO/INSTALL.md
+HOWTO/INSTALL-CROSS.md
+HOWTO/INSTALL-WIN32.md
configure.in
aclocal.m4
otp_build
diff --git a/aclocal.m4 b/aclocal.m4
index 339a15a2bb..b1cf1fe404 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,7 @@
dnl
dnl %CopyrightBegin%
dnl
-dnl Copyright Ericsson AB 1998-2011. All Rights Reserved.
+dnl Copyright Ericsson AB 1998-2012. All Rights Reserved.
dnl
dnl The contents of this file are subject to the Erlang Public License,
dnl Version 1.1, (the "License"); you may not use this file except in
@@ -59,6 +59,7 @@ AC_ARG_VAR(erl_xcomp_isysroot, [Absolute cross system root include path (only us
dnl Cross compilation variables
AC_ARG_VAR(erl_xcomp_bigendian, [big endian system: yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_double_middle_endian, [double-middle-endian system: yes|no (only used when cross compiling)])
AC_ARG_VAR(erl_xcomp_linux_clock_gettime_correction, [clock_gettime() can be used for time correction: yes|no (only used when cross compiling)])
AC_ARG_VAR(erl_xcomp_linux_nptl, [have Native POSIX Thread Library: yes|no (only used when cross compiling)])
AC_ARG_VAR(erl_xcomp_linux_usable_sigusrx, [SIGUSR1 and SIGUSR2 can be used: yes|no (only used when cross compiling)])
@@ -606,6 +607,103 @@ ifelse([$5], , , [$5
fi
])
+dnl ----------------------------------------------------------------------
+dnl
+dnl AC_DOUBLE_MIDDLE_ENDIAN
+dnl
+dnl Checks whether doubles are represented in "middle-endian" format.
+dnl Sets ac_cv_double_middle_endian={no,yes,unknown} accordingly,
+dnl as well as DOUBLE_MIDDLE_ENDIAN.
+dnl
+dnl
+
+AC_DEFUN([AC_C_DOUBLE_MIDDLE_ENDIAN],
+[AC_CACHE_CHECK(whether double word ordering is middle-endian, ac_cv_c_double_middle_endian,
+[# It does not; compile a test program.
+AC_RUN_IFELSE(
+[AC_LANG_SOURCE([[#include <stdlib.h>
+
+int
+main(void)
+{
+ int i = 0;
+ int zero = 0;
+ int bigendian;
+ int zero_index = 0;
+
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+
+ /* we'll use the one with 32-bit words */
+ union
+ {
+ double d;
+ unsigned int c[2];
+ } vint;
+
+ union
+ {
+ double d;
+ unsigned long c[2];
+ } vlong;
+
+ union
+ {
+ double d;
+ unsigned short c[2];
+ } vshort;
+
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ u.l = 1;
+ bigendian = (u.c[sizeof (long int) - 1] == 1);
+
+ zero_index = bigendian ? 1 : 0;
+
+ vint.d = 1.0;
+ vlong.d = 1.0;
+ vshort.d = 1.0;
+
+ if (sizeof(unsigned int) == 4)
+ {
+ if (vint.c[zero_index] != 0)
+ zero = 1;
+ }
+ else if (sizeof(unsigned long) == 4)
+ {
+ if (vlong.c[zero_index] != 0)
+ zero = 1;
+ }
+ else if (sizeof(unsigned short) == 4)
+ {
+ if (vshort.c[zero_index] != 0)
+ zero = 1;
+ }
+
+ exit (zero);
+}
+]])],
+ [ac_cv_c_double_middle_endian=no],
+ [ac_cv_c_double_middle_endian=yes],
+ [ac_cv_c_double_middle=unknown])])
+case $ac_cv_c_double_middle_endian in
+ yes)
+ m4_default([$1],
+ [AC_DEFINE([DOUBLE_MIDDLE_ENDIAN], 1,
+ [Define to 1 if your processor stores the words in a double in
+ middle-endian format (like some ARMs).])]) ;;
+ no)
+ $2 ;;
+ *)
+ m4_default([$3],
+ [AC_MSG_WARN([unknown double endianness
+presetting ac_cv_c_double_middle_endian=no (or yes) will help])]) ;;
+esac
+])# AC_C_DOUBLE_MIDDLE_ENDIAN
+
dnl ----------------------------------------------------------------------
dnl
@@ -1337,6 +1435,14 @@ if test "$ac_cv_c_bigendian" = "yes"; then
AC_DEFINE(ETHR_BIGENDIAN, 1, [Define if bigendian])
fi
+case X$erl_xcomp_double_middle_endian in
+ X) ;;
+ Xyes|Xno|Xunknown) ac_cv_c_double_middle_endian=$erl_xcomp_double_middle_endian;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_double_middle_endian value: $erl_xcomp_double_middle_endian]);;
+esac
+
+AC_C_DOUBLE_MIDDLE_ENDIAN
+
AC_ARG_ENABLE(native-ethr-impls,
AS_HELP_STRING([--disable-native-ethr-impls],
[disable native ethread implementations]),
diff --git a/bootstrap/bin/start.boot b/bootstrap/bin/start.boot
index bdaf605488..c6ebc852a2 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 bdaf605488..c6ebc852a2 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 4da4c26d92..7b1ee38ef8 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_disasm.beam b/bootstrap/lib/compiler/ebin/beam_disasm.beam
index f90b5c9ae7..ec48b89de7 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_type.beam b/bootstrap/lib/compiler/ebin/beam_type.beam
index 116da39f89..3cb5f06859 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 9c6ad019f9..523a6f03fb 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 52643de79a..41523ed185 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/cerl_inline.beam b/bootstrap/lib/compiler/ebin/cerl_inline.beam
index b640e22ce6..eed98ecd2c 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/compile.beam b/bootstrap/lib/compiler/ebin/compile.beam
index e2bd3c4ce0..c685035e23 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
new file mode 100644
index 0000000000..5170231c59
--- /dev/null
+++ b/bootstrap/lib/compiler/ebin/compiler.app
@@ -0,0 +1,69 @@
+% This is an -*- erlang -*- file.
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+
+{application, compiler,
+ [{description, "ERTS CXC 138 10"},
+ {vsn, "4.8.1"},
+ {modules, [
+ beam_asm,
+ beam_block,
+ beam_bool,
+ beam_bsm,
+ beam_clean,
+ beam_dead,
+ beam_dict,
+ beam_disasm,
+ beam_except,
+ beam_flatten,
+ beam_jump,
+ beam_listing,
+ beam_opcodes,
+ beam_peep,
+ beam_receive,
+ beam_split,
+ beam_trim,
+ beam_type,
+ beam_utils,
+ beam_validator,
+ cerl,
+ cerl_clauses,
+ cerl_inline,
+ cerl_trees,
+ compile,
+ core_scan,
+ core_lint,
+ core_parse,
+ core_pp,
+ core_lib,
+ erl_bifs,
+ rec_env,
+ sys_core_dsetel,
+ sys_core_fold,
+ sys_core_inline,
+ sys_expand_pmod,
+ sys_pre_attributes,
+ sys_pre_expand,
+ v3_codegen,
+ v3_core,
+ v3_kernel,
+ v3_kernel_pp,
+ v3_life
+ ]},
+ {registered, []},
+ {applications, [kernel, stdlib]},
+ {env, []}]}.
diff --git a/bootstrap/lib/compiler/ebin/compiler.appup b/bootstrap/lib/compiler/ebin/compiler.appup
new file mode 100644
index 0000000000..887d074b16
--- /dev/null
+++ b/bootstrap/lib/compiler/ebin/compiler.appup
@@ -0,0 +1 @@
+{"4.8.1",[],[]}.
diff --git a/bootstrap/lib/compiler/ebin/sys_core_fold.beam b/bootstrap/lib/compiler/ebin/sys_core_fold.beam
index 046a358910..c878868598 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 d716583b97..1a176b2e3f 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 a053c54295..12026564d9 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 ba92ff6fb0..84c005edc9 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 0c2e54032a..cd4bf48540 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/compiler/ebin/v3_life.beam b/bootstrap/lib/compiler/ebin/v3_life.beam
index ec8fcda8ee..aa8b6b227b 100644
--- a/bootstrap/lib/compiler/ebin/v3_life.beam
+++ b/bootstrap/lib/compiler/ebin/v3_life.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/auth.beam b/bootstrap/lib/kernel/ebin/auth.beam
index 3796221d6b..33f1ab875b 100644
--- a/bootstrap/lib/kernel/ebin/auth.beam
+++ b/bootstrap/lib/kernel/ebin/auth.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/code.beam b/bootstrap/lib/kernel/ebin/code.beam
index 31ccb7367d..f1fd519f50 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 adc53aa5f3..dc10d111d2 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 8dbe895823..fa221e7c9d 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/disk_log_1.beam b/bootstrap/lib/kernel/ebin/disk_log_1.beam
index 5e286cdd48..1deb5ad05e 100644
--- a/bootstrap/lib/kernel/ebin/disk_log_1.beam
+++ b/bootstrap/lib/kernel/ebin/disk_log_1.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/erl_ddll.beam b/bootstrap/lib/kernel/ebin/erl_ddll.beam
index b909dd2786..4fdec24b11 100644
--- a/bootstrap/lib/kernel/ebin/erl_ddll.beam
+++ b/bootstrap/lib/kernel/ebin/erl_ddll.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/error_logger.beam b/bootstrap/lib/kernel/ebin/error_logger.beam
index e07bef5657..bad3d6211f 100644
--- a/bootstrap/lib/kernel/ebin/error_logger.beam
+++ b/bootstrap/lib/kernel/ebin/error_logger.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/erts_debug.beam b/bootstrap/lib/kernel/ebin/erts_debug.beam
index b7bf2ea58e..5c6483e368 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 c3289ba11f..243be75c43 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 8193949718..b8e2df2a2d 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/hipe_unified_loader.beam b/bootstrap/lib/kernel/ebin/hipe_unified_loader.beam
index 9412148a16..1574686ba6 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 62d8cfe163..fe2d597723 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_config.beam b/bootstrap/lib/kernel/ebin/inet_config.beam
index fc1e2c8387..9479212ed0 100644
--- a/bootstrap/lib/kernel/ebin/inet_config.beam
+++ b/bootstrap/lib/kernel/ebin/inet_config.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/inet_parse.beam b/bootstrap/lib/kernel/ebin/inet_parse.beam
index 14ca272933..b74c0ee730 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/kernel.app b/bootstrap/lib/kernel/ebin/kernel.app
new file mode 100644
index 0000000000..48f6250828
--- /dev/null
+++ b/bootstrap/lib/kernel/ebin/kernel.app
@@ -0,0 +1,120 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+%% This is an -*- erlang -*- file.
+%%
+{application, kernel,
+ [
+ {description, "ERTS CXC 138 10"},
+ {vsn, "2.16"},
+ {modules, [application,
+ application_controller,
+ application_master,
+ application_starter,
+ auth,
+ code,
+ packages,
+ code_server,
+ dist_util,
+ erl_boot_server,
+ erl_distribution,
+ erl_reply,
+ error_handler,
+ error_logger,
+ file,
+ file_server,
+ file_io_server,
+ global,
+ global_group,
+ global_search,
+ group,
+ heart,
+ hipe_unified_loader,
+ inet6_tcp,
+ inet6_tcp_dist,
+ inet6_udp,
+ inet6_sctp,
+ inet_config,
+ inet_hosts,
+ inet_gethost_native,
+ inet_tcp_dist,
+ kernel,
+ kernel_config,
+ net,
+ net_adm,
+ net_kernel,
+ os,
+ ram_file,
+ rpc,
+ user,
+ user_drv,
+ user_sup,
+ disk_log,
+ disk_log_1,
+ disk_log_server,
+ disk_log_sup,
+ dist_ac,
+ erl_ddll,
+ erl_epmd,
+ erts_debug,
+ gen_tcp,
+ gen_udp,
+ gen_sctp,
+ inet,
+ inet_db,
+ inet_dns,
+ inet_parse,
+ inet_res,
+ inet_tcp,
+ inet_udp,
+ inet_sctp,
+ pg2,
+ seq_trace,
+ standard_error,
+ wrap_log_reader]},
+ {registered, [application_controller,
+ erl_reply,
+ auth,
+ boot_server,
+ code_server,
+ disk_log_server,
+ disk_log_sup,
+ erl_prim_loader,
+ error_logger,
+ file_server_2,
+ fixtable_server,
+ global_group,
+ global_name_server,
+ heart,
+ init,
+ kernel_config,
+ kernel_sup,
+ net_kernel,
+ net_sup,
+ rex,
+ user,
+ os_server,
+ ddll_server,
+ erl_epmd,
+ inet_db,
+ pg2]},
+ {applications, []},
+ {env, [{error_logger, tty}]},
+ {mod, {kernel, []}}
+ ]
+}.
diff --git a/lib/asn1/test/testROSE.erl b/bootstrap/lib/kernel/ebin/kernel.appup
index a692ec7682..b534b736be 100644
--- a/lib/asn1/test/testROSE.erl
+++ b/bootstrap/lib/kernel/ebin/kernel.appup
@@ -1,7 +1,7 @@
-%%
+%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2011. 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
@@ -15,22 +15,13 @@
%% under the License.
%%
%% %CopyrightEnd%
-%%
-%%
--module(testROSE).
-
--export([compile/3]).
-
--include_lib("test_server/include/test_server.hrl").
-
-
-
-compile(Config,Rules,Opt) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(DataDir ++ "Remote-Operations-Merged.set.asn1",
- [Rules,{outdir,OutDir}]++Opt).
-
+{"2.16",
+ %% Up from - max two major revisions back
+ [{<<"2\\.16(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R16
+ {<<"2\\.15(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15
+ {<<"2\\.14(\\.[0-9]+)*">>,[restart_new_emulator]}],%% R14
+ %% Down to - max two major revisions back
+ [{<<"2\\.16(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R16
+ {<<"2\\.15(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15
+ {<<"2\\.14(\\.[0-9]+)*">>,[restart_new_emulator]}] %% R14
+}.
diff --git a/bootstrap/lib/kernel/ebin/net_kernel.beam b/bootstrap/lib/kernel/ebin/net_kernel.beam
index a81f3e47d5..9eebd72403 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/os.beam b/bootstrap/lib/kernel/ebin/os.beam
index 1291f1cdfa..ea33408b31 100644
--- a/bootstrap/lib/kernel/ebin/os.beam
+++ b/bootstrap/lib/kernel/ebin/os.beam
Binary files differ
diff --git a/bootstrap/lib/kernel/ebin/rpc.beam b/bootstrap/lib/kernel/ebin/rpc.beam
index 4355f300e9..bfb80cf827 100644
--- a/bootstrap/lib/kernel/ebin/rpc.beam
+++ b/bootstrap/lib/kernel/ebin/rpc.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/binary.beam b/bootstrap/lib/stdlib/ebin/binary.beam
index 0cc6c6fce9..255c50aa01 100644
--- a/bootstrap/lib/stdlib/ebin/binary.beam
+++ b/bootstrap/lib/stdlib/ebin/binary.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/digraph_utils.beam b/bootstrap/lib/stdlib/ebin/digraph_utils.beam
index a578c67e00..39cb9d90da 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 55f5adc24d..2e2b3ef4ed 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_compile.beam b/bootstrap/lib/stdlib/ebin/erl_compile.beam
index 6fd4e3373e..e449884f0b 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 e646342e2b..6198c4f43a 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_internal.beam b/bootstrap/lib/stdlib/ebin/erl_internal.beam
index 07e7f2a377..94a0a75c29 100644
--- a/bootstrap/lib/stdlib/ebin/erl_internal.beam
+++ b/bootstrap/lib/stdlib/ebin/erl_internal.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/erl_lint.beam b/bootstrap/lib/stdlib/ebin/erl_lint.beam
index 6fa0884135..875ccf94c2 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/escript.beam b/bootstrap/lib/stdlib/ebin/escript.beam
index 93c1109b41..e832f973d7 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 642689d749..cc6521891b 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/filelib.beam b/bootstrap/lib/stdlib/ebin/filelib.beam
index 5d8a6f7b07..20f48fe18e 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/gen.beam b/bootstrap/lib/stdlib/ebin/gen.beam
index bd08292a87..0a39dc1c7e 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 c381a17787..23c4f53c30 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 f763cab747..c2713544ff 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 fe4e109508..5d68dda4cf 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/lib.beam b/bootstrap/lib/stdlib/ebin/lib.beam
index 4b67bbb774..3865cfb227 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 5e23551fb3..dfd689aa5a 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/math.beam b/bootstrap/lib/stdlib/ebin/math.beam
index e97284ca1e..9b662405ea 100644
--- a/bootstrap/lib/stdlib/ebin/math.beam
+++ b/bootstrap/lib/stdlib/ebin/math.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/ms_transform.beam b/bootstrap/lib/stdlib/ebin/ms_transform.beam
index f8689ddf72..bc16416161 100644
--- a/bootstrap/lib/stdlib/ebin/ms_transform.beam
+++ b/bootstrap/lib/stdlib/ebin/ms_transform.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/otp_internal.beam b/bootstrap/lib/stdlib/ebin/otp_internal.beam
index 5bbb23db1b..270d35ef33 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/qlc_pt.beam b/bootstrap/lib/stdlib/ebin/qlc_pt.beam
index f51bc3ccbd..8a25d95384 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 4b9cbb7cfc..e20546d45d 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/stdlib.app b/bootstrap/lib/stdlib/ebin/stdlib.app
new file mode 100644
index 0000000000..461531e1df
--- /dev/null
+++ b/bootstrap/lib/stdlib/ebin/stdlib.app
@@ -0,0 +1,105 @@
+%% This is an -*- erlang -*- file.
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+{application, stdlib,
+ [{description, "ERTS CXC 138 10"},
+ {vsn, "1.19"},
+ {modules, [array,
+ base64,
+ beam_lib,
+ binary,
+ c,
+ calendar,
+ dets,
+ dets_server,
+ dets_sup,
+ dets_utils,
+ dets_v8,
+ dets_v9,
+ dict,
+ digraph,
+ digraph_utils,
+ edlin,
+ edlin_expand,
+ epp,
+ eval_bits,
+ erl_bits,
+ erl_compile,
+ erl_eval,
+ erl_expand_records,
+ erl_internal,
+ erl_lint,
+ erl_parse,
+ erl_posix_msg,
+ erl_pp,
+ erl_scan,
+ erl_tar,
+ error_logger_file_h,
+ error_logger_tty_h,
+ escript,
+ ets,
+ file_sorter,
+ filelib,
+ filename,
+ gb_trees,
+ gb_sets,
+ gen,
+ gen_event,
+ gen_fsm,
+ gen_server,
+ io,
+ io_lib,
+ io_lib_format,
+ io_lib_fread,
+ io_lib_pretty,
+ lib,
+ lists,
+ log_mf_h,
+ math,
+ ms_transform,
+ orddict,
+ ordsets,
+ otp_internal,
+ pg,
+ pool,
+ proc_lib,
+ proplists,
+ qlc,
+ qlc_pt,
+ queue,
+ random,
+ re,
+ sets,
+ shell,
+ shell_default,
+ slave,
+ sofs,
+ string,
+ supervisor,
+ supervisor_bridge,
+ sys,
+ timer,
+ unicode,
+ win32reg,
+ zip]},
+ {registered,[timer_server,rsh_starter,take_over_monitor,pool_master,
+ dets]},
+ {applications, [kernel]},
+ {env, []}]}.
+
diff --git a/lib/asn1/test/testExternal.erl b/bootstrap/lib/stdlib/ebin/stdlib.appup
index 6e1fa0ee7d..ff9b5387c9 100644
--- a/lib/asn1/test/testExternal.erl
+++ b/bootstrap/lib/stdlib/ebin/stdlib.appup
@@ -1,7 +1,7 @@
-%%
+%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2011. 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
@@ -15,21 +15,13 @@
%% under the License.
%%
%% %CopyrightEnd%
-%%
-%%
--module(testExternal).
-
--export([compile/3]).
-
--include_lib("test_server/include/test_server.hrl").
-
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line test_server:format("Rules ~p~n",[Rules]),
- ?line ok = asn1ct:compile(DataDir ++ "External",[Rules,{outdir,OutDir}]++Options).
-
-
+{"1.19",
+ %% Up from - max two major revisions back
+ [{<<"1\\.19(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R16
+ {<<"1\\.18(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15
+ {<<"1\\.17(\\.[0-9]+)*">>,[restart_new_emulator]}],%% R14
+ %% Down to - max two major revisions back
+ [{<<"1\\.19(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R16
+ {<<"1\\.18(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15
+ {<<"1\\.17(\\.[0-9]+)*">>,[restart_new_emulator]}] %% R14
+}.
diff --git a/bootstrap/lib/stdlib/ebin/string.beam b/bootstrap/lib/stdlib/ebin/string.beam
index 3ace8184d0..e014257a58 100644
--- a/bootstrap/lib/stdlib/ebin/string.beam
+++ b/bootstrap/lib/stdlib/ebin/string.beam
Binary files differ
diff --git a/bootstrap/lib/stdlib/ebin/supervisor.beam b/bootstrap/lib/stdlib/ebin/supervisor.beam
index 98c8f6d42e..837027e93a 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 7dcf140730..074fe0534d 100644
--- a/bootstrap/lib/stdlib/ebin/unicode.beam
+++ b/bootstrap/lib/stdlib/ebin/unicode.beam
Binary files differ
diff --git a/configure.in b/configure.in
index c8d4561a44..e906c17ecc 100644
--- a/configure.in
+++ b/configure.in
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
dnl %CopyrightBegin%
dnl
-dnl Copyright Ericsson AB 1998-2011. All Rights Reserved.
+dnl Copyright Ericsson AB 1998-2012. All Rights Reserved.
dnl
dnl The contents of this file are subject to the Erlang Public License,
dnl Version 1.1, (the "License"); you may not use this file except in
@@ -225,6 +225,14 @@ AC_ARG_ENABLE(native-libs,
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([--without-dynamic-trace],
+ [don't enable any dynamic tracing (default)]))
+AC_ARG_ENABLE(vm-probes,
+AS_HELP_STRING([--enable-vm-probes],
+ [add dynamic trace probes to the Beam VM (only possible if --with-dynamic-trace is enabled, and then default)]))
AC_ARG_WITH(javac,
AS_HELP_STRING([--with-javac=JAVAC], [specify Java compiler to use])
AS_HELP_STRING([--with-javac], [use a Java compiler if found (default)])
@@ -361,6 +369,12 @@ if test X${enable_m32_build} = Xyes; then
export LDFLAGS
fi
+NATIVE_LIBS_ENABLED=
+if test X${enable_native_libs} = Xyes -a X${enable_hipe} != Xno; then
+ NATIVE_LIBS_ENABLED=yes
+fi
+AC_SUBST(NATIVE_LIBS_ENABLED)
+
export ERL_TOP
AC_CONFIG_SUBDIRS(lib erts)
diff --git a/erts/Makefile.in b/erts/Makefile.in
index 1979c50781..5df6d71ef3 100644
--- a/erts/Makefile.in
+++ b/erts/Makefile.in
@@ -31,21 +31,10 @@ ifeq ($(NO_START_SCRIPTS),)
ERTSDIRS += start_scripts
endif
-# Until hybrid is nofrag, don't build it.
-#BUILD_HYBRID_EMU=@ERTS_BUILD_HYBRID_EMU@
-BUILD_HYBRID_EMU=no
-
EXTRA_FLAVORS=smp
-ifeq ($(BUILD_HYBRID_EMU),yes)
-EXTRA_FLAVORS += hybrid
-endif
.PHONY: all
-ifneq ($(BUILD_HYBRID_EMU),yes)
all: smp opt
-else
-all: hybrid smp opt
-endif
.PHONY: docs
docs:
@@ -68,13 +57,6 @@ debug opt clean:
$(EXTRA_FLAVORS):
( cd emulator && $(MAKE) opt FLAVOR=$@ )
-ifneq ($(BUILD_HYBRID_EMU),yes)
-.PHONY: hybrid
-hybrid:
- @echo '*** Omitted build of hybrid heap emulator'
- @echo '*** since target is $(TARGET)'
-endif
-
# Make erl script and erlc in $(ERL_TOP)/bin which runs the compiled version
# Note that erlc is not a script and requires extra handling on cygwin.
# also note that this file is not created by autoconf, that's why @EXEEXT@
@@ -106,6 +88,7 @@ local_setup:
chmod 755 $(ERL_TOP)/bin/erl.exe $(ERL_TOP)/bin/erlc.exe \
$(ERL_TOP)/bin/werl.exe; \
make_local_ini.sh $(ERL_TOP); \
+ cp $(ERL_TOP)/bin/erl.ini $(ERL_TOP)/bin/$(TARGET)/erl.ini; \
else \
sed -e "s;%FINAL_ROOTDIR%;$(ERL_TOP);" \
-e "s;erts-.*/bin;bin/$(TARGET);" \
diff --git a/erts/aclocal.m4 b/erts/aclocal.m4
index 339a15a2bb..b1cf1fe404 100644
--- a/erts/aclocal.m4
+++ b/erts/aclocal.m4
@@ -1,7 +1,7 @@
dnl
dnl %CopyrightBegin%
dnl
-dnl Copyright Ericsson AB 1998-2011. All Rights Reserved.
+dnl Copyright Ericsson AB 1998-2012. All Rights Reserved.
dnl
dnl The contents of this file are subject to the Erlang Public License,
dnl Version 1.1, (the "License"); you may not use this file except in
@@ -59,6 +59,7 @@ AC_ARG_VAR(erl_xcomp_isysroot, [Absolute cross system root include path (only us
dnl Cross compilation variables
AC_ARG_VAR(erl_xcomp_bigendian, [big endian system: yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_double_middle_endian, [double-middle-endian system: yes|no (only used when cross compiling)])
AC_ARG_VAR(erl_xcomp_linux_clock_gettime_correction, [clock_gettime() can be used for time correction: yes|no (only used when cross compiling)])
AC_ARG_VAR(erl_xcomp_linux_nptl, [have Native POSIX Thread Library: yes|no (only used when cross compiling)])
AC_ARG_VAR(erl_xcomp_linux_usable_sigusrx, [SIGUSR1 and SIGUSR2 can be used: yes|no (only used when cross compiling)])
@@ -606,6 +607,103 @@ ifelse([$5], , , [$5
fi
])
+dnl ----------------------------------------------------------------------
+dnl
+dnl AC_DOUBLE_MIDDLE_ENDIAN
+dnl
+dnl Checks whether doubles are represented in "middle-endian" format.
+dnl Sets ac_cv_double_middle_endian={no,yes,unknown} accordingly,
+dnl as well as DOUBLE_MIDDLE_ENDIAN.
+dnl
+dnl
+
+AC_DEFUN([AC_C_DOUBLE_MIDDLE_ENDIAN],
+[AC_CACHE_CHECK(whether double word ordering is middle-endian, ac_cv_c_double_middle_endian,
+[# It does not; compile a test program.
+AC_RUN_IFELSE(
+[AC_LANG_SOURCE([[#include <stdlib.h>
+
+int
+main(void)
+{
+ int i = 0;
+ int zero = 0;
+ int bigendian;
+ int zero_index = 0;
+
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+
+ /* we'll use the one with 32-bit words */
+ union
+ {
+ double d;
+ unsigned int c[2];
+ } vint;
+
+ union
+ {
+ double d;
+ unsigned long c[2];
+ } vlong;
+
+ union
+ {
+ double d;
+ unsigned short c[2];
+ } vshort;
+
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ u.l = 1;
+ bigendian = (u.c[sizeof (long int) - 1] == 1);
+
+ zero_index = bigendian ? 1 : 0;
+
+ vint.d = 1.0;
+ vlong.d = 1.0;
+ vshort.d = 1.0;
+
+ if (sizeof(unsigned int) == 4)
+ {
+ if (vint.c[zero_index] != 0)
+ zero = 1;
+ }
+ else if (sizeof(unsigned long) == 4)
+ {
+ if (vlong.c[zero_index] != 0)
+ zero = 1;
+ }
+ else if (sizeof(unsigned short) == 4)
+ {
+ if (vshort.c[zero_index] != 0)
+ zero = 1;
+ }
+
+ exit (zero);
+}
+]])],
+ [ac_cv_c_double_middle_endian=no],
+ [ac_cv_c_double_middle_endian=yes],
+ [ac_cv_c_double_middle=unknown])])
+case $ac_cv_c_double_middle_endian in
+ yes)
+ m4_default([$1],
+ [AC_DEFINE([DOUBLE_MIDDLE_ENDIAN], 1,
+ [Define to 1 if your processor stores the words in a double in
+ middle-endian format (like some ARMs).])]) ;;
+ no)
+ $2 ;;
+ *)
+ m4_default([$3],
+ [AC_MSG_WARN([unknown double endianness
+presetting ac_cv_c_double_middle_endian=no (or yes) will help])]) ;;
+esac
+])# AC_C_DOUBLE_MIDDLE_ENDIAN
+
dnl ----------------------------------------------------------------------
dnl
@@ -1337,6 +1435,14 @@ if test "$ac_cv_c_bigendian" = "yes"; then
AC_DEFINE(ETHR_BIGENDIAN, 1, [Define if bigendian])
fi
+case X$erl_xcomp_double_middle_endian in
+ X) ;;
+ Xyes|Xno|Xunknown) ac_cv_c_double_middle_endian=$erl_xcomp_double_middle_endian;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_double_middle_endian value: $erl_xcomp_double_middle_endian]);;
+esac
+
+AC_C_DOUBLE_MIDDLE_ENDIAN
+
AC_ARG_ENABLE(native-ethr-impls,
AS_HELP_STRING([--disable-native-ethr-impls],
[disable native ethread implementations]),
diff --git a/erts/autoconf/vxworks/sed.general b/erts/autoconf/vxworks/sed.general
index 88697b788d..162fd38c2b 100644
--- a/erts/autoconf/vxworks/sed.general
+++ b/erts/autoconf/vxworks/sed.general
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -70,7 +70,6 @@ s|@HCLIBS@||
s|@ENABLE_ALLOC_TYPE_VARS@||
s|@TERMCAP_LIB@||
s|@ERTS_BUILD_SMP_EMU@|no|
-s|@ERTS_BUILD_HYBRID_EMU@|no|
s|@HAVE_VALGRIND@|no|
s|@EXEEXT@||
s|@WITH_SCTP@||
diff --git a/erts/configure.in b/erts/configure.in
index b801994e14..6ad1951a4e 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -157,14 +157,6 @@ AS_HELP_STRING([--without-termcap],
[],
[with_termcap=yes])
-
-AC_ARG_ENABLE(hybrid-heap,
-AS_HELP_STRING([--enable-hybrid-heap], [enable hybrid heap]),
-[ case "$enableval" in
- no) enable_hybrid_heap=no ;;
- *) enable_hybrid_heap=yes ;;
- esac ], enable_hybrid_heap=unknown)
-
AC_ARG_ENABLE(lock-checking,
AS_HELP_STRING([--enable-lock-checking], [enable lock checking]),
[ case "$enableval" in
@@ -276,6 +268,61 @@ else
[Define to enable hrvtime() on Linux systems with perfctr extension])
fi
+
+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([--without-dynamic-trace],
+ [don't enable any dynamic tracing (default)]))
+
+if test X"$with_dynamic_trace" = X""; then
+ with_dynamic_trace=no
+fi
+
+case "$with_dynamic_trace" in
+ no) DYNAMIC_TRACE_FRAMEWORK=;;
+ dtrace)
+ AC_DEFINE(USE_DTRACE,[1],
+ [Define if you want to use dtrace for dynamic tracing])
+ DYNAMIC_TRACE_FRAMEWORK=dtrace;;
+ systemtap)
+ AC_DEFINE(USE_SYSTEMTAP,[1],
+ [Define if you want to use systemtap for dynamic tracing])
+ DYNAMIC_TRACE_FRAMEWORK=systemtap;;
+ *)
+ AC_MSG_ERROR(Unknown dynamic tracing framework specified with --with-dynamic-trace!);;
+esac
+
+if test X"$DYNAMIC_TRACE_FRAMEWORK" != X""; then
+ AC_DEFINE(USE_DYNAMIC_TRACE,[1],
+ [Define if you want to use dynamic tracing])
+fi
+
+AC_ARG_ENABLE(vm-probes,
+AS_HELP_STRING([--enable-vm-probes],
+ [add dynamic trace probes to the Beam VM (only possible if --with-dynamic-trace is enabled, and then default)]),
+ [ case "$enableval" in
+ no) use_vm_probes=no ;;
+ *)
+ if test X"$DYNAMIC_TRACE_FRAMEWORK" != X""; then
+ use_vm_probes=yes ;
+ else
+ AC_MSG_ERROR(Can not enable VM probes without any dynamic tracing framework!);
+ fi;;
+ esac ], if test X"$DYNAMIC_TRACE_FRAMEWORK" != X""; then
+ use_vm_probes=yes ;
+ else
+ use_vm_probes=no
+ 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])
+fi
+
+
AC_ARG_ENABLE(clock-gettime,
AS_HELP_STRING([--enable-clock-gettime],
[use clock-gettime for time correction]),
@@ -571,6 +618,8 @@ case $chk_arch_ in
armv5b) ARCH=arm;;
armv5teb) ARCH=arm;;
armv5tel) ARCH=arm;;
+ armv5tejl) ARCH=arm;;
+ armv7l) ARCH=arm;;
tile) ARCH=tile;;
*) ARCH=noarch;;
esac
@@ -1681,6 +1730,7 @@ case X$erl_xcomp_bigendian in
esac
AC_C_BIGENDIAN
+AC_C_DOUBLE_MIDDLE_ENDIAN
dnl fdatasync syscall (Unix only)
AC_CHECK_FUNCS([fdatasync])
@@ -1832,9 +1882,10 @@ AC_CHECK_FUNCS([ieee_handler fpsetmask finite isnan isinf res_gethostbyname dlop
pread pwrite writev memmove strerror strerror_r strncasecmp \
gethrtime localtime_r gmtime_r inet_pton mmap mremap memcpy mallopt \
sbrk _sbrk __sbrk brk _brk __brk \
- flockfile fstat strlcpy strlcat setsid posix2time setlocale nl_langinfo poll])
+ flockfile fstat strlcpy strlcat setsid posix2time time2posix \
+ setlocale nl_langinfo poll])
-AC_CHECK_DECLS([posix2time],,,[#include <time.h>])
+AC_CHECK_DECLS([posix2time, time2posix],,,[#include <time.h>])
disable_vfork=false
if test "x$EMU_THR_LIB_NAME" != "x"; then
@@ -1894,6 +1945,64 @@ AC_CHECK_FUNCS([openpty])
AC_CHECK_HEADERS(net/if_dl.h ifaddrs.h netpacket/packet.h)
AC_CHECK_FUNCS([getifaddrs])
+dnl Checks for variables in6addr_any and in6addr_loopback,
+dnl
+dnl They normally declared by netinet/in.h, according to POSIX,
+dnl but not on Windows 7 (Windows SDK 7.1). I would have liked
+dnl to just write AC_CHECK_DECL([in6addr_any], ...) but if doing so,
+dnl the configure check fails erroneously on Linux with the error
+dnl "cannot convert to a pointer type", on a line looking like
+dnl "char *p = (char *) in6addr_any;", so work around that
+dnl with some more code.
+AC_CACHE_CHECK(
+ [whether in6addr_any is declared],
+ [erts_cv_have_in6addr_any],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ ]],
+ [[printf("%d", in6addr_any.s6_addr[16]);]]
+ )],
+ [erts_cv_have_in6addr_any=yes],
+ [erts_cv_have_in6addr_any=no]
+ )]
+)
+
+case "$erts_cv_have_in6addr_any" in
+ yes)
+ AC_DEFINE([HAVE_IN6ADDR_ANY], [1],
+ [Define to 1 if you have the variable in6addr_any declared.])
+esac
+
+AC_CACHE_CHECK(
+ [whether in6addr_loopback is declared],
+ [erts_cv_have_in6addr_loopback],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ ]],
+ [[printf("%d", in6addr_loopback.s6_addr[16]);]]
+ )],
+ [erts_cv_have_in6addr_loopback=yes],
+ [erts_cv_have_in6addr_loopback=no]
+ )]
+)
+
+case "$erts_cv_have_in6addr_loopback" in
+ yes)
+ AC_DEFINE([HAVE_IN6ADDR_LOOPBACK], [1],
+ [Define to 1 if you have the variable in6addr_loopback declared.])
+esac
+
+AC_CHECK_DECLS([IN6ADDR_ANY_INIT, IN6ADDR_LOOPBACK_INIT], [], [],
+ [#include <netinet/in.h>])
+
dnl ----------------------------------------------------------------------
dnl Checks for features/quirks in the system that affects Erlang.
dnl ----------------------------------------------------------------------
@@ -3079,33 +3188,6 @@ fi
AC_SUBST(TSP_APP)
#
-# Check if we should build hybrid emulator
-#
-
-AC_MSG_CHECKING([whether a hybrid heap emulator should be built])
-case $enable_hybrid_heap-$host_os in
- yes-*)
- AC_MSG_RESULT([yes; enabled by user])
- ERTS_BUILD_HYBRID_EMU=yes;;
- no-*)
- AC_MSG_RESULT([no; disabled by user])
- ERTS_BUILD_HYBRID_EMU=no;;
- *-win32|*-vxworks) # vxworks have their own "configure scripts"...
- AC_MSG_RESULT([no; default on this platform])
- ERTS_BUILD_HYBRID_EMU=no;;
- *)
- AC_MSG_RESULT([yes; default on this platform])
- ERTS_BUILD_HYBRID_EMU=yes;;
-esac
-
-
-if test $ERTS_BUILD_HYBRID_EMU = yes; then
- AC_DEFINE(ERTS_HAVE_HYBRID_EMU, 1, [Define if the hybrid emulator is built])
-fi
-
-AC_SUBST(ERTS_BUILD_HYBRID_EMU)
-
-#
# Check if we should enable HiPE.
#
@@ -3493,6 +3575,11 @@ case $host_os in
DED_LDFLAGS="-m32 $DED_LDFLAGS"
fi
;;
+ openbsd*)
+ DED_LD="$CC"
+ DED_LD_FLAG_RUNTIME_LIBRARY_PATH="$CFLAG_RUNTIME_LIBRARY_PATH"
+ DED_LDFLAGS="-shared"
+ ;;
osf*)
# NOTE! Whitespace after -rpath is important.
DED_LD_FLAG_RUNTIME_LIBRARY_PATH="-rpath "
@@ -3546,6 +3633,74 @@ dnl
LM_FIND_EMU_CC
dnl
+dnl DTrace
+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_dtrace_test=yes;;
+ *) enable_dtrace_test=no;;
+esac
+
+AC_SUBST(DTRACE)
+
+AC_SUBST(DTRACE_CPP)
+AC_SUBST(DTRACE_ENABLED)
+AC_SUBST(DTRACE_ENABLED_2STEP)
+DTRACE_CPP=-C
+DTRACE_ENABLED=
+DTRACE_ENABLED_2STEP=
+DTRACE_2STEP_TEST=./dtrace-test.o
+DTRACE_BITS_FLAG=
+case $OPSYS in
+ freebsd)
+ if test "$BITS64" = "yes" ; then
+ DTRACE_BITS_FLAG=-64
+ else
+ DTRACE_BITS_FLAG=-32
+ fi
+ ;;
+ *)
+ : # Nothing to do
+ ;;
+esac
+if test "$enable_dtrace_test" = "yes" ; then
+ if test "$DTRACE" = "dtrace" ; then
+ AC_CHECK_HEADERS(sys/sdt.h)
+ # The OS X version of dtrace prints a spurious line here.
+ if ! dtrace -h $DTRACE_CPP -Iemulator/beam -o ./foo-dtrace.h -s emulator/beam/erlang_dtrace.d; then
+ AC_MSG_ERROR([Could not precompile erlang_dtrace.d: dtrace -h failed])
+ fi
+ rm -f foo-dtrace.h
+
+ $RM -f $DTRACE_2STEP_TEST
+ if dtrace -G $DTRACE_CPP $DTRACE_BITS_FLAG -Iemulator/beam -o $DTRACE_2STEP_TEST -s emulator/beam/erlang_dtrace.d 2> /dev/null && \
+ test -f $DTRACE_2STEP_TEST ; then
+ rm $DTRACE_2STEP_TEST
+ DTRACE_ENABLED_2STEP=yes
+ AC_MSG_NOTICE([dtrace precompilation for 2-stage DTrace successful])
+ else
+ AC_MSG_NOTICE([dtrace precompilation for 1-stage DTrace successful])
+ fi
+ DTRACE_ENABLED=yes
+ case $OPSYS in
+ linux)
+ : # No extra libs to add to LIBS
+ ;;
+ freebsd)
+ LIBS="$LIBS -lelf"
+ ;;
+ *)
+ LIBS="$LIBS -ldtrace"
+ ;;
+ esac
+ else
+ AC_MSG_ERROR([Dtrace preprocessing test failed.])
+ fi
+fi
+
+dnl
dnl SSL, SSH and CRYPTO need the OpenSSL libraries
dnl
dnl Check flags --with-ssl, --without-ssl --with-ssl=PATH.
diff --git a/erts/doc/src/Makefile b/erts/doc/src/Makefile
index cfa5527474..91e823fdb1 100644
--- a/erts/doc/src/Makefile
+++ b/erts/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -55,7 +55,6 @@ XML_REF3_EFILES = \
XML_REF3_FILES = \
driver_entry.xml \
erl_nif.xml \
- erl_set_memory_block.xml \
erl_driver.xml \
erl_prim_loader.xml \
erlang.xml \
@@ -158,9 +157,6 @@ $(SPECDIR)/specs_driver_entry.xml:
$(SPECDIR)/specs_erl_nif.xml:
escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \
-o$(dir $@) -module erl_nif
-$(SPECDIR)/specs_erl_set_memory_block.xml:
- escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \
- -o$(dir $@) -module erl_set_memory_block
$(SPECDIR)/specs_erl_driver.xml:
escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \
-o$(dir $@) -module erl_driver
@@ -174,15 +170,15 @@ $(SPECDIR)/specs_erts_alloc.xml:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man1
- $(INSTALL_DATA) $(MAN1_FILES) $(RELEASE_PATH)/man/man1
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man1"
+ $(INSTALL_DATA) $(MAN1_FILES) "$(RELEASE_PATH)/man/man1"
release_spec:
diff --git a/erts/doc/src/driver.xml b/erts/doc/src/driver.xml
index ac5729880d..52283879c7 100644
--- a/erts/doc/src/driver.xml
+++ b/erts/doc/src/driver.xml
@@ -31,7 +31,7 @@
<note><p>This document was written a long time ago. A lot of it is still
interesting since it explains important concepts, but it was
- written for an older driver interface so the examples does not
+ written for an older driver interface so the examples do not
work anymore. The reader is encouraged to read
<seealso marker="erl_driver">erl_driver</seealso> and the
<seealso marker="driver_entry">driver_entry</seealso> documentation.
diff --git a/erts/doc/src/erl.xml b/erts/doc/src/erl.xml
index cfbc38f176..93d1289e8d 100644
--- a/erts/doc/src/erl.xml
+++ b/erts/doc/src/erl.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
- <year>1996</year><year>2011</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -442,11 +442,7 @@
system with SMP support is available. <c>-smp auto</c> starts
the Erlang runtime system with SMP support enabled if it is
available and more than one logical processor are detected.
- <c>-smp disable</c> starts a runtime system without SMP support.
- By default <c>-smp auto</c> will be used unless a conflicting
- parameter has been passed, then <c>-smp disable</c> will be
- used. Currently only the <c>-hybrid</c> parameter conflicts
- with <c>-smp auto</c>.</p>
+ <c>-smp disable</c> starts a runtime system without SMP support.</p>
<p><em>NOTE</em>: The runtime system with SMP support will not
be available on all supported platforms. See also the
<seealso marker="#+S">+S</seealso> flag.</p>
@@ -537,7 +533,7 @@
<p>Force the <c>compressed</c> option on all ETS tables.
Only intended for test and evaluation.</p>
</item>
- <tag><c><![CDATA[+fnl]]></c></tag>
+ <tag><marker id="file_name_encoding"></marker><c><![CDATA[+fnl]]></c></tag>
<item>
<p>The VM works with file names as if they are encoded using the ISO-latin-1 encoding, disallowing Unicode characters with codepoints beyond 255. This is default on operating systems that have transparent file naming, i.e. all Unixes except MacOSX.</p>
</item>
@@ -590,7 +586,9 @@
<item>
<p>Sets the maximum number of concurrent processes for this
system. <c><![CDATA[Number]]></c> must be in the range 16..134217727.
- Default is 32768.</p>
+ Default is 32768.</p>
+ <p><em>NOTE</em>: It is possible to choose any value in the range
+ but powers of 2 perform best.</p>
</item>
<tag><marker id="compat_rel"><c><![CDATA[+R ReleaseNumber]]></c></marker></tag>
<item>
@@ -766,6 +764,16 @@
<seealso marker="erlang#system_info_scheduler_bindings">erlang:system_info(scheduler_bindings)</seealso>.
</p>
</item>
+ <tag><marker id="+sbwt"><c>+sbwt none|very_short|short|medium|long|very_long</c></marker></tag>
+ <item>
+ <p>Set scheduler busy wait threshold. Default is <c>medium</c>.
+ The threshold determines how long schedulers should busy
+ wait when running out of work before going to sleep.
+ </p>
+ <p><em>NOTE:</em> This flag may be removed or changed at any time
+ without prior notice.
+ </p>
+ </item>
<tag><marker id="+scl"><c>+scl true|false</c></marker></tag>
<item>
<p>Enable or disable scheduler compaction of load. By default
@@ -901,6 +909,17 @@
<p>For more information, see
<seealso marker="erlang#system_info_cpu_topology">erlang:system_info(cpu_topology)</seealso>.</p>
</item>
+ <tag><marker id="+sws"><c>+sws default|legacy|proposal</c></marker></tag>
+ <item>
+ <p>Set scheduler wakeup strategy. Default is <c>legacy</c> (has been
+ used since OTP-R13B). The <c>proposal</c> strategy is the currently
+ proposed strategy for OTP-R16. Note that the <c>proposal</c> strategy
+ might change during OTP-R15.
+ </p>
+ <p><em>NOTE:</em> This flag may be removed or changed at any time
+ without prior notice.
+ </p>
+ </item>
<tag><marker id="+swt"><c>+swt very_low|low|medium|high|very_high</c></marker></tag>
<item>
<p>Set scheduler wakeup threshold. Default is <c>medium</c>.
diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml
index b5df4ca0c8..187c263b60 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>2011</year>
+ <year>2001</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -43,8 +43,8 @@
to the runtime system at driver initialization, and some new
driver API functions. </p>
<note>
- <p>As of erts version 5.9 old drivers has to be recompiled
- and has to use the extended interface. They also has to be
+ <p>As of erts version 5.9 old drivers have to be recompiled
+ and have to use the extended interface. They also have to be
adjusted to the
<seealso marker="#rewrites_for_64_bits">64-bit capable driver interface.
</seealso>
@@ -283,7 +283,7 @@
called return garbage sizes to the emulator causing it
to read random memory and create huge incorrect result blobs.</p>
<p>Therefore it is not enough to just recompile drivers written with
- version management for pre-R15B types; the types has to be changed
+ version management for pre-R15B types; the types have to be changed
in the driver suggesting other rewrites especially regarding
size variables. Investigate all warnings when recompiling!</p>
<p>Also, the API driver functions <c>driver_output*</c>,
@@ -356,19 +356,19 @@
<p>
Driver callback
<c><seealso marker="driver_entry#output">output</seealso></c>
- now gets <c>ErlDrvSizeT</c> as 3:rd argument instead
+ now gets <c>ErlDrvSizeT</c> as 3rd argument instead
of previously <c>int</c>.
</p>
<p>
Driver callback
<c><seealso marker="driver_entry#control">control</seealso></c>
- now gets <c>ErlDrvSizeT</c> as 4:th and 6:th arguments instead
+ now gets <c>ErlDrvSizeT</c> as 4th and 6th arguments instead
of previously <c>int</c>.
</p>
<p>
Driver callback
<c><seealso marker="driver_entry#call">call</seealso></c>
- now gets <c>ErlDrvSizeT</c> as 4:th and 6:th arguments instead
+ now gets <c>ErlDrvSizeT</c> as 4th and 6th arguments instead
of previously <c>int</c>.
</p>
<p>
@@ -410,54 +410,54 @@
<tag>Arguments and return values in the driver API</tag>
<item>
<p>
- Many driver API functions has changed argument type
+ Many driver API functions have changed argument type
and/or return value to <c>ErlDrvSizeT</c> from mostly <c>int</c>.
Automatic type casting probably makes these changes necessary only
for a driver that encounters sizes larger than 32 bits.
</p>
<taglist>
<tag><seealso marker="#driver_output">driver_output</seealso></tag>
- <item>3:rd argument</item>
+ <item>3rd argument</item>
<tag><seealso marker="#driver_output2">driver_output2</seealso></tag>
- <item>3:rd and 5:th arguments</item>
+ <item>3rd and 5th arguments</item>
<tag>
<seealso marker="#driver_output_binary">driver_output_binary</seealso>
</tag>
- <item>3:rd 5:th and 6:th arguments</item>
+ <item>3rd 5th and 6th arguments</item>
<tag><seealso marker="#driver_outputv">driver_outputv</seealso></tag>
- <item>3:rd and 5:th arguments</item>
+ <item>3rd and 5th arguments</item>
<tag>
<seealso marker="#driver_vec_to_buf">driver_vec_to_buf</seealso>
</tag>
- <item>3:rd argument and return value</item>
+ <item>3rd argument and return value</item>
<tag><seealso marker="#driver_alloc">driver_alloc</seealso></tag>
- <item>1:st argument</item>
+ <item>1st argument</item>
<tag><seealso marker="#driver_realloc">driver_realloc</seealso></tag>
- <item>2:nd argument</item>
+ <item>2nd argument</item>
<tag>
<seealso marker="#driver_alloc_binary">driver_alloc_binary</seealso>
</tag>
- <item>1:st argument</item>
+ <item>1st argument</item>
<tag>
<seealso marker="#driver_realloc_binary">driver_realloc_binary</seealso>
</tag>
- <item>2:nd argument</item>
+ <item>2nd argument</item>
<tag><seealso marker="#driver_enq">driver_enq</seealso></tag>
- <item>3:rd argument</item>
+ <item>3rd argument</item>
<tag><seealso marker="#driver_pushq">driver_pushq</seealso></tag>
- <item>3:rd argument</item>
+ <item>3rd argument</item>
<tag><seealso marker="#driver_deq">driver_deq</seealso></tag>
- <item>2:nd argument and return value</item>
+ <item>2nd argument and return value</item>
<tag><seealso marker="#driver_sizeq">driver_sizeq</seealso></tag>
<item>return value</item>
<tag><seealso marker="#driver_enq_bin">driver_enq_bin</seealso></tag>
- <item>3:rd and 4:th argument</item>
+ <item>3rd and 4th argument</item>
<tag><seealso marker="#driver_pushq_bin">driver_pushq_bin</seealso></tag>
- <item>3:rd and 4:th argument</item>
+ <item>3rd and 4th argument</item>
<tag><seealso marker="#driver_enqv">driver_enqv</seealso></tag>
- <item>3:rd argument</item>
+ <item>3rd argument</item>
<tag><seealso marker="#driver_pushqv">driver_pushqv</seealso></tag>
- <item>3:rd argument</item>
+ <item>3rd argument</item>
<tag><seealso marker="#driver_peekqv">driver_peekqv</seealso></tag>
<item>return value</item>
</taglist>
@@ -1067,7 +1067,7 @@ typedef struct ErlIOVec {
</desc>
</func>
<func>
- <name><ret>ErlDrvBinary*</ret><nametext>driver_alloc_binary(ErlDrvSizeT size)</nametext></name>
+ <name><ret>ErlDrvBinary *</ret><nametext>driver_alloc_binary(ErlDrvSizeT size)</nametext></name>
<fsummary>Allocate a driver binary</fsummary>
<desc>
<marker id="driver_alloc_binary"></marker>
@@ -1087,7 +1087,7 @@ typedef struct ErlIOVec {
</desc>
</func>
<func>
- <name><ret>ErlDrvBinary*</ret><nametext>driver_realloc_binary(ErlDrvBinary *bin, ErlDrvSizeT size)</nametext></name>
+ <name><ret>ErlDrvBinary *</ret><nametext>driver_realloc_binary(ErlDrvBinary *bin, ErlDrvSizeT size)</nametext></name>
<fsummary>Resize a driver binary</fsummary>
<desc>
<marker id="driver_realloc_binary"></marker>
@@ -1277,7 +1277,7 @@ typedef struct ErlIOVec {
</desc>
</func>
<func>
- <name><ret>SysIOVec*</ret><nametext>driver_peekq(ErlDrvPort port, int *vlen)</nametext></name>
+ <name><ret>SysIOVec *</ret><nametext>driver_peekq(ErlDrvPort port, int *vlen)</nametext></name>
<fsummary>Get the driver queue as a vector</fsummary>
<desc>
<marker id="driver_peekq"></marker>
@@ -1481,7 +1481,7 @@ typedef struct ErlIOVec {
</desc>
</func>
<func>
- <name><ret>char*</ret><nametext>erl_errno_id(int error)</nametext></name>
+ <name><ret>char *</ret><nametext>erl_errno_id(int error)</nametext></name>
<fsummary>Get erlang error atom name from error number</fsummary>
<desc>
<marker id="erl_errno_id"></marker>
diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml
index 5fc6508aad..f484e9eaf7 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>2011</year>
+ <year>2001</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -472,7 +472,7 @@ typedef enum {
</section>
<funcs>
- <func><name><ret>void*</ret><nametext>enif_alloc(size_t size)</nametext></name>
+ <func><name><ret>void *</ret><nametext>enif_alloc(size_t size)</nametext></name>
<fsummary>Allocate dynamic memory.</fsummary>
<desc><p>Allocate memory of <c>size</c> bytes. Return NULL if allocation failed.</p></desc>
</func>
@@ -489,7 +489,7 @@ typedef enum {
<p>Return true on success or false if allocation failed.</p>
</desc>
</func>
- <func><name><ret>ErlNifEnv*</ret><nametext>enif_alloc_env()</nametext></name>
+ <func><name><ret>ErlNifEnv *</ret><nametext>enif_alloc_env()</nametext></name>
<fsummary>Create a new environment</fsummary>
<desc><p>Allocate a new process independent environment. The environment can
be used to hold terms that is not bound to any process. Such terms can
@@ -499,7 +499,7 @@ typedef enum {
<p>Return pointer to the new environment.</p>
</desc>
</func>
- <func><name><ret>void*</ret><nametext>enif_alloc_resource(ErlNifResourceType* type, unsigned size)</nametext></name>
+ <func><name><ret>void *</ret><nametext>enif_alloc_resource(ErlNifResourceType* type, unsigned size)</nametext></name>
<fsummary>Allocate a memory managed resource object</fsummary>
<desc><p>Allocate a memory managed resource object of type <c>type</c> and size <c>size</c> bytes.</p></desc>
</func>
@@ -522,7 +522,7 @@ typedef enum {
<desc><p>Same as <seealso marker="erl_driver#erl_drv_cond_broadcast">erl_drv_cond_broadcast</seealso>.
</p></desc>
</func>
- <func><name><ret>ErlNifCond*</ret><nametext>enif_cond_create(char *name)</nametext></name>
+ <func><name><ret>ErlNifCond *</ret><nametext>enif_cond_create(char *name)</nametext></name>
<fsummary></fsummary>
<desc><p>Same as <seealso marker="erl_driver#erl_drv_cond_create">erl_drv_cond_create</seealso>.
</p></desc>
@@ -840,7 +840,7 @@ typedef enum {
<fsummary>Create an integer term from a long int</fsummary>
<desc><p>Create an integer term from a <c>long int</c>.</p></desc>
</func>
- <func><name><ret>unsigned char*</ret><nametext>enif_make_new_binary(ErlNifEnv* env, size_t size, ERL_NIF_TERM* termp)</nametext></name>
+ <func><name><ret>unsigned char *</ret><nametext>enif_make_new_binary(ErlNifEnv* env, size_t size, ERL_NIF_TERM* termp)</nametext></name>
<fsummary>Allocate and create a new binary term</fsummary>
<desc><p>Allocate a binary of size <c>size</c> bytes and create an owning
term. The binary data is mutable until the calling NIF returns. This is a
@@ -951,7 +951,7 @@ typedef enum {
<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>
</func>
- <func><name><ret>ErlNifMutex*</ret><nametext>enif_mutex_create(char *name)</nametext></name>
+ <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>.
</p></desc>
@@ -976,7 +976,7 @@ typedef enum {
<desc><p>Same as <seealso marker="erl_driver#erl_drv_mutex_unlock">erl_drv_mutex_unlock</seealso>.
</p></desc>
</func>
- <func><name><ret>ErlNifResourceType*</ret><nametext>enif_open_resource_type(ErlNifEnv* env,
+ <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>
<fsummary>Create or takeover a resource type</fsummary>
@@ -1005,7 +1005,7 @@ typedef enum {
and <seealso marker="#upgrade">upgrade</seealso>.</p>
</desc>
</func>
- <func><name><ret>void*</ret><nametext>enif_priv_data(ErlNifEnv* env)</nametext></name>
+ <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>,
<c>reload</c> or <c>upgrade</c>.</p>
@@ -1033,7 +1033,7 @@ typedef enum {
References made by <seealso marker="#enif_make_resource">enif_make_resource</seealso>
can only be removed by the garbage collector.</p></desc>
</func>
- <func><name><ret>ErlNifRWLock*</ret><nametext>enif_rwlock_create(char *name)</nametext></name>
+ <func><name><ret>ErlNifRWLock *</ret><nametext>enif_rwlock_create(char *name)</nametext></name>
<fsummary></fsummary>
<desc><p>Same as <seealso marker="erl_driver#erl_drv_rwlock_create">erl_drv_rwlock_create</seealso>.
</p></desc>
@@ -1073,7 +1073,7 @@ typedef enum {
<desc><p>Same as <seealso marker="erl_driver#erl_drv_rwlock_tryrwlock">erl_drv_rwlock_tryrwlock</seealso>.
</p></desc>
</func>
- <func><name><ret>ErlNifPid*</ret><nametext>enif_self(ErlNifEnv* caller_env, ErlNifPid* pid)</nametext></name>
+ <func><name><ret>ErlNifPid *</ret><nametext>enif_self(ErlNifEnv* caller_env, ErlNifPid* pid)</nametext></name>
<fsummary>Get the pid of the calling process.</fsummary>
<desc><p>Initialize the pid variable <c>*pid</c> to represent the
calling process. Return <c>pid</c>.</p></desc>
@@ -1129,7 +1129,7 @@ typedef enum {
<desc><p>Same as <seealso marker="erl_driver#erl_drv_thread_join">erl_drv_thread_join </seealso>.
</p></desc>
</func>
- <func><name><ret>ErlNifThreadOpts*</ret><nametext>enif_thread_opts_create(char *name)</nametext></name>
+ <func><name><ret>ErlNifThreadOpts *</ret><nametext>enif_thread_opts_create(char *name)</nametext></name>
<fsummary></fsummary>
<desc><p>Same as <seealso marker="erl_driver#erl_drv_thread_opts_create">erl_drv_thread_opts_create</seealso>.
</p></desc>
@@ -1154,7 +1154,7 @@ typedef enum {
<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>
+ <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>
diff --git a/erts/doc/src/erl_set_memory_block.xml b/erts/doc/src/erl_set_memory_block.xml
deleted file mode 100644
index d77da56d95..0000000000
--- a/erts/doc/src/erl_set_memory_block.xml
+++ /dev/null
@@ -1,172 +0,0 @@
-<?xml version="1.0" encoding="latin1" ?>
-<!DOCTYPE cref SYSTEM "cref.dtd">
-
-<cref>
- <header>
- <copyright>
- <year>1998</year><year>2009</year>
- <holder>Ericsson AB. All Rights Reserved.</holder>
- </copyright>
- <legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
-
- </legalnotice>
-
- <title>erl_set_memory_block</title>
- <prepared>Patrik Nyblom</prepared>
- <responsible></responsible>
- <docno></docno>
- <approved></approved>
- <checked></checked>
- <date>98-08-05</date>
- <rev>A</rev>
- <file>erl_set_memory_block.xml</file>
- </header>
- <lib>erl_set_memory_block</lib>
- <libsummary>Custom memory allocation for Erlang on VxWorks&reg;</libsummary>
- <description>
- <p>This documentation is specific to VxWorks.</p>
- <p>The <c><![CDATA[erl_set_memory_block]]></c> function/command initiates custom
- memory allocation for the Erlang emulator. It has to be called
- before the Erlang emulator is started and makes Erlang use one
- single large memory block for all memory allocation.</p>
- <p>The memory within the block can be utilized by other tasks than
- Erlang. This is accomplished by calling the functions
- <c><![CDATA[sys_alloc]]></c>, <c><![CDATA[sys_realloc]]></c> and <c><![CDATA[sys_free]]></c> instead
- of <c><![CDATA[malloc]]></c>, <c><![CDATA[realloc]]></c> and <c><![CDATA[free]]></c> respectively.</p>
- <p>The purpose of this is to avoid problems inherent in the
- VxWorks systems <c><![CDATA[malloc]]></c> library. The memory allocation within the
- large memory block avoids fragmentation by using an "address
- order first fit" algorithm. Another advantage of using a
- separate memory block is that resource reclamation can be made
- more easily when Erlang is stopped.</p>
- <p>The <c><![CDATA[erl_set_memory_block]]></c> function is callable from any C
- program as an ordinary 10 argument function as well as
- from the commandline.</p>
- </description>
- <funcs>
- <func>
- <name><ret>int</ret><nametext>erl_set_memory_block(size_t size, void *ptr, int warn_mixed_malloc, int realloc_always_moves, int use_reclaim, ...)</nametext></name>
- <fsummary>Specify parameters for Erlang internal memory allocation.</fsummary>
- <desc>
- <p>The function is called before Erlang is
- started to specify a large memory block where Erlang can
- maintain memory internally.</p>
- <p>Parameters:</p>
- <taglist>
- <tag>size_t size</tag>
- <item>The size in bytes of Erlang's internal memory block. Has to
- be specified. Note that the VxWorks system uses dynamic
- memory allocation heavily, so leave some memory to the system.</item>
- <tag>void *ptr</tag>
- <item>
- <p>A pointer to the actual memory block of size
- <c><![CDATA[size]]></c>. If this is specified as 0 (NULL), Erlang will
- allocate the memory when starting and will reclaim the
- memory block (as a whole) when stopped.</p>
- <p>If a memory block is allocated and provided here, the
- <c><![CDATA[sys_alloc]]></c> etc routines can still be used after
- the Erlang emulator is stopped. The Erlang emulator can
- also be restarted while other tasks using the memory
- block are running without destroying the memory. If
- Erlang is to be restarted, also set the
- <c><![CDATA[use_reclaim]]></c> flag.</p>
- <p>If 0 is specified here, the Erlang system should not
- be stopped while some other task uses the memory block
- (has called <c><![CDATA[sys_alloc]]></c>).</p>
- </item>
- <tag>int warn_mixed_malloc</tag>
- <item>
- <p>If this flag is set to true (anything else than 0), the
- system will write a warning message on the console if a
- program is mixing normal <c><![CDATA[malloc]]></c> with
- <c><![CDATA[sys_realloc]]></c> or <c><![CDATA[sys_free]]></c>.</p>
- </item>
- <tag>int realloc_always_moves</tag>
- <item>
- <p>If this flag is set to true (anything else than 0), all
- calls to <c><![CDATA[sys_realloc]]></c> result in a moved memory
- block. This can in certain conditions give less
- fragmentation. This flag may be removed in future releases.</p>
- </item>
- <tag>int use_reclaim</tag>
- <item>
- <p>If this flag is set to true (anything else than 0), all
- memory allocated with <c><![CDATA[sys_alloc]]></c> is automatically
- reclaimed as soon as a task exits. This is very useful
- to make writing port programs (and other programs as
- well) easier. Combine this with using the routines
- <c><![CDATA[save_open]]></c> etc. specified in the reclaim.h
- file delivered in the Erlang distribution.</p>
- </item>
- </taglist>
- <p>Return Value:</p>
- <p>Returns 0 (OK) on success, otherwise a value &lt;&gt; 0.</p>
- </desc>
- </func>
- <func>
- <name><ret>int</ret><nametext>erl_memory_show(...)</nametext></name>
- <fsummary>A utility similar to VxWorks <c><![CDATA[memShow]]></c>, but for the Erlang memory area.</fsummary>
- <desc>
- <p>Return Value:</p>
- <p>Returns 0 (OK) on success, otherwise a value &lt;&gt; 0.</p>
- </desc>
- </func>
- <func>
- <name><ret>int</ret><nametext>erl_mem_info_get(MEM_PART_STATS *stats)</nametext></name>
- <fsummary>A utility similar to VxWorks <c><![CDATA[memPartInfoGet]]></c>, but for the Erlang memory area.</fsummary>
- <desc>
- <p>Parameter:</p>
- <taglist>
- <tag>MEM_PART_STATS *stats</tag>
- <item>A pointer to a MEM_PART_STATS structure as defined in
- <c><![CDATA[<memLib.h>]]></c>. A successful call will fill in all
- fields of the structure, on error all fields are left untouched. </item>
- </taglist>
- <p>Return Value:</p>
- <p>Returns 0 (OK) on success, otherwise a value &lt;&gt; 0</p>
- </desc>
- </func>
- </funcs>
-
- <section>
- <title>NOTES</title>
- <p>The memory block used by Erlang actually does not need to be
- inside the area known to ordinary <c><![CDATA[malloc]]></c>. It is possible
- to set the <c><![CDATA[USER_RESERVED_MEM]]></c> preprocessor symbol when compiling
- the wind kernel and then use user reserved memory for
- Erlang. Erlang can therefor utilize memory above the 32 Mb limit
- of VxWorks on the PowerPC architecture.</p>
- <p>Example:</p>
- <p>In config.h for the wind kernel:</p>
- <code type="none"><![CDATA[
- #undef LOCAL_MEM_AUTOSIZE
- #undef LOCAL_MEM_SIZE
- #undef USER_RESERVED_MEM
-
- #define LOCAL_MEM_SIZE 0x05000000
- #define USER_RESERVED_MEM 0x03000000
- ]]></code>
- <p>In the start-up script/code for the VxWorks node:</p>
- <code type="none"><![CDATA[
-erl_set_memory_block(sysPhysMemTop()-sysMemTop(),sysMemTop(),0,0,1);
- ]]></code>
- <p>Setting the <c><![CDATA[use_reclaim]]></c> flag decreases performance of the
- system, but makes programming much easier. Other similar
- facilities are present in the Erlang system even without using a
- separate memory block. The routines called <c><![CDATA[save_malloc]]></c>,
- <c><![CDATA[save_realloc]]></c> and <c><![CDATA[save_free]]></c> provide the same
- facilities by using VxWorks own <c><![CDATA[malloc]]></c>. Similar routines
- exist for files, see the file <c><![CDATA[reclaim.h]]></c> in the distribution.</p>
- </section>
-</cref>
-
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index a21021d864..ef0e6fea84 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2011</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -65,14 +65,14 @@
<funcs>
<func>
- <name>abs(Number) -> integer() | float()</name>
+ <name name="abs" arity="1" clause_i="1"/>
+ <name name="abs" arity="1" clause_i="2"/>
+ <type variable="Float" name_i="1"/>
+ <type variable="Int" name_i="2"/>
<fsummary>Arithmetical absolute value</fsummary>
- <type>
- <v>Number = number()</v>
- </type>
<desc>
<p>Returns an integer or float which is the arithmetical
- absolute value of <c>Number</c>.</p>
+ absolute value of <c><anno>Float</anno></c> or <c><anno>Int</anno></c>.</p>
<pre>
> <input>abs(-3.33).</input>
3.33
@@ -82,26 +82,19 @@
</desc>
</func>
<func>
- <name>erlang:adler32(Data) -> integer()</name>
+ <name name="adler32" arity="1"/>
<fsummary>Compute adler32 checksum</fsummary>
- <type>
- <v>Data = iodata()</v>
- </type>
<desc>
- <p>Computes and returns the adler32 checksum for <c>Data</c>.</p>
+ <p>Computes and returns the adler32 checksum for <c><anno>Data</anno></c>.</p>
</desc>
</func>
<func>
- <name>erlang:adler32(OldAdler, Data) -> integer()</name>
+ <name name="adler32" arity="2"/>
<fsummary>Compute adler32 checksum</fsummary>
- <type>
- <v>OldAdler = integer()</v>
- <v>Data = iodata()</v>
- </type>
<desc>
<p>Continue computing the adler32 checksum by combining
- the previous checksum, <c>OldAdler</c>, with the checksum of
- <c>Data</c>.</p>
+ the previous checksum, <c><anno>OldAdler</anno></c>, with the checksum of
+ <c><anno>Data</anno></c>.</p>
<p>The following code:</p>
<code>
X = erlang:adler32(Data1),
@@ -114,12 +107,8 @@
</desc>
</func>
<func>
- <name>erlang:adler32_combine(FirstAdler, SecondAdler, SecondSize) -> integer()</name>
+ <name name="adler32_combine" arity="3"/>
<fsummary>Combine two adler32 checksums</fsummary>
- <type>
- <v>FirstAdler = SecondAdler = integer()</v>
- <v>SecondSize = integer()</v>
- </type>
<desc>
<p>Combines two previously computed adler32 checksums.
This computation requires the size of the data object for
@@ -138,18 +127,14 @@
</desc>
</func>
<func>
- <name>erlang:append_element(Tuple1, Term) -> Tuple2</name>
+ <name name="append_element" arity="2"/>
<fsummary>Append an extra element to a tuple</fsummary>
- <type>
- <v>Tuple1 = Tuple2 = tuple()</v>
- <v>Term = term()</v>
- </type>
<desc>
<p>Returns a new tuple which has one element more than
- <c>Tuple1</c>, and contains the elements in <c>Tuple1</c>
- followed by <c>Term</c> as the last element. Semantically
+ <c><anno>Tuple1</anno></c>, and contains the elements in <c><anno>Tuple1</anno></c>
+ followed by <c><anno>Term</anno></c> as the last element. Semantically
equivalent to
- <c>list_to_tuple(tuple_to_list(Tuple) ++ [Term])</c>, but much
+ <c>list_to_tuple(tuple_to_list(<anno>Tuple1</anno>) ++ [<anno>Term</anno>])</c>, but much
faster.</p>
<pre>
> <input>erlang:append_element({one, two}, three).</input>
@@ -204,27 +189,24 @@
</desc>
</func>
<func>
- <name>atom_to_binary(Atom, Encoding) -> binary()</name>
+ <name name="atom_to_binary" arity="2"/>
<fsummary>Return the binary representation of an atom</fsummary>
- <type>
- <v>Atom = atom()</v>
- <v>Encoding = latin1 | utf8 | unicode</v>
- </type>
<desc>
<p>Returns a binary which corresponds to the text
- representation of <c>Atom</c>. If <c>Encoding</c>
+ representation of <c><anno>Atom</anno></c>. If <c><anno>Encoding</anno></c>
is <c>latin1</c>, there will be one byte for each character
- in the text representation. If <c>Encoding</c> is <c>utf8</c> or
+ in the text representation. If <c><anno>Encoding</anno></c> is
+ <c>utf8</c> or
<c>unicode</c>, the characters will be encoded using UTF-8
(meaning that characters from 16#80 up to 0xFF will be
encoded in two bytes).</p>
- <note><p>Currently, <c>atom_to_binary(Atom, latin1)</c> can
+ <note><p>Currently, <c>atom_to_binary(<anno>Atom</anno>, latin1)</c> can
never fail because the text representation of an atom can only contain
characters from 0 to 16#FF. In a future release, the text representation
of atoms might be allowed to contain any Unicode character
- and <c>atom_to_binary(Atom, latin1)</c> will fail if the
- text representation for the <c>Atom</c> contains a Unicode
+ and <c>atom_to_binary(<anno>Atom</anno>, latin1)</c> will fail if the
+ text representation for the <c><anno>Atom</anno></c> contains a Unicode
character greater than 16#FF.</p></note>
<pre>
@@ -233,30 +215,21 @@
</desc>
</func>
<func>
- <name>atom_to_list(Atom) -> string()</name>
+ <name name="atom_to_list" arity="1"/>
<fsummary>Text representation of an atom</fsummary>
- <type>
- <v>Atom = atom()</v>
- </type>
<desc>
<p>Returns a string which corresponds to the text
- representation of <c>Atom</c>.</p>
+ representation of <c><anno>Atom</anno></c>.</p>
<pre>
> <input>atom_to_list('Erlang').</input>
"Erlang"</pre>
</desc>
</func>
<func>
- <name>binary_part(Subject, PosLen) -> binary()</name>
+ <name name="binary_part" arity="2"/>
<fsummary>Extracts a part of a binary</fsummary>
- <type>
- <v>Subject = binary()</v>
- <v>PosLen = {Start,Length}</v>
- <v>Start = integer() >= 0</v>
- <v>Length = integer() >= 0</v>
- </type>
- <desc>
- <p>Extracts the part of the binary described by <c>PosLen</c>.</p>
+ <desc>
+ <p>Extracts the part of the binary described by <c><anno>PosLen</anno></c>.</p>
<p>Negative length can be used to extract bytes at the end of a binary:</p>
@@ -266,53 +239,44 @@
&lt;&lt;6,7,8,9,10&gt;&gt;
</code>
- <p>If <c>PosLen</c> in any way references outside the binary, a <c>badarg</c> exception is raised.</p>
+ <p>If <c><anno>PosLen</anno></c> in any way references outside the binary, a <c>badarg</c> exception is raised.</p>
- <p><c>Start</c> is zero-based, i.e.:</p>
+ <p><c><anno>Start</anno></c> is zero-based, i.e.:</p>
<code>
1> Bin = &lt;&lt;1,2,3&gt;&gt;
2> binary_part(Bin,{0,2}).
&lt;&lt;1,2&gt;&gt;
</code>
- <p>See the STDLIB module <c>binary</c> for details about the <c>PosLen</c> semantics.</p>
+ <p>See the STDLIB module <c>binary</c> for details about the <c><anno>PosLen</anno></c> semantics.</p>
<p>Allowed in guard tests.</p>
</desc>
</func>
<func>
- <name>binary_part(Subject, Start, Length) -> binary()</name>
+ <name name="binary_part" arity="3"/>
<fsummary>Extracts a part of a binary</fsummary>
- <type>
- <v>Subject = binary()</v>
- <v>Start = integer() >= 0</v>
- <v>Length = integer() >= 0</v>
- </type>
<desc>
- <p>The same as <c>binary_part(Subject, {Pos, Len})</c>.</p>
+ <p>The same as <c>binary_part(<anno>Subject</anno>, {<anno>Start</anno>, <anno>Length</anno>})</c>.</p>
<p>Allowed in guard tests.</p>
</desc>
</func>
<func>
- <name>binary_to_atom(Binary, Encoding) -> atom()</name>
+ <name name="binary_to_atom" arity="2"/>
<fsummary>Convert from text representation to an atom</fsummary>
- <type>
- <v>Binary = binary()</v>
- <v>Encoding = latin1 | utf8 | unicode</v>
- </type>
<desc>
<p>Returns the atom whose text representation is
- <c>Binary</c>. If <c>Encoding</c> is <c>latin1</c>, no
- translation of bytes in the binary is done. If <c>Encoding</c>
+ <c><anno>Binary</anno></c>. If <c><anno>Encoding</anno></c> is <c>latin1</c>, no
+ translation of bytes in the binary is done. If <c><anno>Encoding</anno></c>
is <c>utf8</c> or <c>unicode</c>, the binary must contain
valid UTF-8 sequences; furthermore, only Unicode characters up
to 0xFF are allowed.</p>
- <note><p><c>binary_to_atom(Binary, utf8)</c> will fail if
+ <note><p><c>binary_to_atom(<anno>Binary</anno>, utf8)</c> will fail if
the binary contains Unicode characters greater than 16#FF.
In a future release, such Unicode characters might be allowed
- and <c>binary_to_atom(Binary, utf8)</c>
+ and <c>binary_to_atom(<anno>Binary</anno>, utf8)</c>
will not fail in that case.</p></note>
<pre>
@@ -325,12 +289,8 @@
</desc>
</func>
<func>
- <name>binary_to_existing_atom(Binary, Encoding) -> atom()</name>
+ <name name="binary_to_existing_atom" arity="2"/>
<fsummary>Convert from text representation to an atom</fsummary>
- <type>
- <v>Binary = binary()</v>
- <v>Encoding = latin1 | utf8 | unicode</v>
- </type>
<desc>
<p>Works like <seealso marker="#binary_to_atom/2">binary_to_atom/2</seealso>,
but the atom must already exist.</p>
@@ -338,27 +298,21 @@
</desc>
</func>
<func>
- <name>binary_to_list(Binary) -> [char()]</name>
+ <name name="binary_to_list" arity="1"/>
<fsummary>Convert a binary to a list</fsummary>
- <type>
- <v>Binary = binary()</v>
- </type>
<desc>
<p>Returns a list of integers which correspond to the bytes of
- <c>Binary</c>.</p>
+ <c><anno>Binary</anno></c>.</p>
</desc>
</func>
<func>
- <name>binary_to_list(Binary, Start, Stop) -> [char()]</name>
+ <name name="binary_to_list" arity="3"/>
<fsummary>Convert part of a binary to a list</fsummary>
- <type>
- <v>Binary = binary()</v>
- <v>Start = Stop = 1..byte_size(Binary)</v>
- </type>
+ <type_desc variable="Start">1..byte_size(<anno>Binary</anno>)</type_desc>
<desc>
<p>As <c>binary_to_list/1</c>, but returns a list of integers
- corresponding to the bytes from position <c>Start</c> to
- position <c>Stop</c> in <c>Binary</c>. Positions in the
+ corresponding to the bytes from position <c><anno>Start</anno></c> to
+ position <c><anno>Stop</anno></c> in <c><anno>Binary</anno></c>. Positions in the
binary are numbered starting from 1.</p>
<note><p>This function's indexing style of using one-based indices for
@@ -368,27 +322,21 @@
</desc>
</func>
<func>
- <name>bitstring_to_list(Bitstring) -> [char()|bitstring()]</name>
+ <name name="bitstring_to_list" arity="1"/>
<fsummary>Convert a bitstring to a list</fsummary>
- <type>
- <v>Bitstring = bitstring()</v>
- </type>
<desc>
<p>Returns a list of integers which correspond to the bytes of
- <c>Bitstring</c>. If the number of bits in the binary is not
+ <c><anno>Bitstring</anno></c>. If the number of bits in the binary is not
divisible by 8, the last element of the list will be a bitstring
containing the remaining bits (1 up to 7 bits).</p>
</desc>
</func>
<func>
- <name>binary_to_term(Binary) -> term()</name>
+ <name name="binary_to_term" arity="1"/>
<fsummary>Decode an Erlang external term format binary</fsummary>
- <type>
- <v>Binary = <seealso marker="#type-ext_binary">ext_binary()</seealso></v>
- </type>
<desc>
<p>Returns an Erlang term which is the result of decoding
- the binary object <c>Binary</c>, which must be encoded
+ the binary object <c><anno>Binary</anno></c>, which must be encoded
according to the Erlang external term format.</p>
<warning>
<p>When decoding binaries from untrusted sources, consider using
@@ -401,12 +349,8 @@
</desc>
</func>
<func>
- <name>binary_to_term(Binary, Opts) -> term()</name>
+ <name name="binary_to_term" arity="2"/>
<fsummary>Decode an Erlang external term format binary</fsummary>
- <type>
- <v>Opts = [safe]</v>
- <v>Binary = <seealso marker="#type-ext_binary">ext_binary()</seealso></v>
- </type>
<desc>
<p>As <c>binary_to_term/1</c>, but takes options that affect decoding
of the binary.</p>
@@ -436,13 +380,10 @@
</desc>
</func>
<func>
- <name>bit_size(Bitstring) -> integer() >= 0</name>
+ <name name="bit_size" arity="1"/>
<fsummary>Return the size of a bitstring</fsummary>
- <type>
- <v>Bitstring = bitstring()</v>
- </type>
<desc>
- <p>Returns an integer which is the size in bits of <c>Bitstring</c>.</p>
+ <p>Returns an integer which is the size in bits of <c><anno>Bitstring</anno></c>.</p>
<pre>
> <input>bit_size(&lt;&lt;433:16,3:3&gt;&gt;).</input>
19
@@ -452,11 +393,8 @@
</desc>
</func>
<func>
- <name>erlang:bump_reductions(Reductions) -> void()</name>
+ <name name="bump_reductions" arity="1"/>
<fsummary>Increment the reduction counter</fsummary>
- <type>
- <v>Reductions = integer() >= 0</v>
- </type>
<desc>
<p>This implementation-dependent function increments
the reduction counter for the calling process. In the Beam
@@ -472,14 +410,11 @@
</desc>
</func>
<func>
- <name>byte_size(Bitstring) -> integer() >= 0</name>
+ <name name="byte_size" arity="1"/>
<fsummary>Return the size of a bitstring (or binary)</fsummary>
- <type>
- <v>Bitstring = bitstring()</v>
- </type>
<desc>
<p>Returns an integer which is the number of bytes needed to contain
- <c>Bitstring</c>. (That is, if the number of bits in <c>Bitstring</c> is not
+ <c><anno>Bitstring</anno></c>. (That is, if the number of bits in <c><anno>Bitstring</anno></c> is not
divisible by 8, the resulting number of bytes will be rounded <em>up</em>.)</p>
<pre>
> <input>byte_size(&lt;&lt;433:16,3:3&gt;&gt;).</input>
@@ -490,21 +425,17 @@
</desc>
</func>
<func>
- <name>erlang:cancel_timer(TimerRef) -> Time | false</name>
+ <name name="cancel_timer" arity="1"/>
<fsummary>Cancel a timer</fsummary>
- <type>
- <v>TimerRef = reference()</v>
- <v>Time = integer() >= 0</v>
- </type>
<desc>
- <p>Cancels a timer, where <c>TimerRef</c> was returned by
+ <p>Cancels a timer, where <c><anno>TimerRef</anno></c> was returned by
either
<seealso marker="#send_after/3">erlang:send_after/3</seealso>
or
<seealso marker="#start_timer/3">erlang:start_timer/3</seealso>.
If the timer is there to be removed, the function returns
the time in milliseconds left until the timer would have expired,
- otherwise <c>false</c> (which means that <c>TimerRef</c> was
+ otherwise <c>false</c> (which means that <c><anno>TimerRef</anno></c> was
never a timer, that it has already been cancelled, or that it
has already delivered its message).</p>
<p>See also
@@ -518,27 +449,20 @@
</func>
<func>
- <name>check_old_code(Module) -> boolean()</name>
+ <name name="check_old_code" arity="1"/>
<fsummary>Check if a module has old code</fsummary>
- <type>
- <v>Module = atom()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if the <c>Module</c> has old code,
+ <p>Returns <c>true</c> if the <c><anno>Module</anno></c> has old code,
and <c>false</c> otherwise.</p>
<p>See also <seealso marker="kernel:code">code(3)</seealso>.</p>
</desc>
</func>
<func>
- <name>check_process_code(Pid, Module) -> boolean()</name>
+ <name name="check_process_code" arity="2"/>
<fsummary>Check if a process is executing old code for a module</fsummary>
- <type>
- <v>Pid = pid()</v>
- <v>Module = atom()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if the process <c>Pid</c> is executing
- old code for <c>Module</c>. That is, if the current call of
+ <p>Returns <c>true</c> if the process <c><anno>Pid</anno></c> is executing
+ old code for <c><anno>Module</anno></c>. That is, if the current call of
the process executes old code for this module, or if the
process has references to old code for this module, or if the
process contains funs that references old code for this
@@ -550,26 +474,19 @@ false</pre>
</desc>
</func>
<func>
- <name>erlang:crc32(Data) -> integer() >= 0</name>
+ <name name="crc32" arity="1"/>
<fsummary>Compute crc32 (IEEE 802.3) checksum</fsummary>
- <type>
- <v>Data = iodata()</v>
- </type>
<desc>
- <p>Computes and returns the crc32 (IEEE 802.3 style) checksum for <c>Data</c>.</p>
+ <p>Computes and returns the crc32 (IEEE 802.3 style) checksum for <c><anno>Data</anno></c>.</p>
</desc>
</func>
<func>
- <name>erlang:crc32(OldCrc, Data) -> integer() >= 0</name>
+ <name name="crc32" arity="2"/>
<fsummary>Compute crc32 (IEEE 802.3) checksum</fsummary>
- <type>
- <v>OldCrc = integer() >= 0</v>
- <v>Data = iodata()</v>
- </type>
<desc>
<p>Continue computing the crc32 checksum by combining
- the previous checksum, <c>OldCrc</c>, with the checksum of
- <c>Data</c>.</p>
+ the previous checksum, <c><anno>OldCrc</anno></c>, with the checksum of
+ <c><anno>Data</anno></c>.</p>
<p>The following code:</p>
<code>
X = erlang:crc32(Data1),
@@ -582,12 +499,8 @@ false</pre>
</desc>
</func>
<func>
- <name>erlang:crc32_combine(FirstCrc, SecondCrc, SecondSize) -> integer() >= 0</name>
+ <name name="crc32_combine" arity="3"/>
<fsummary>Combine two crc32 (IEEE 802.3) checksums</fsummary>
- <type>
- <v>FirstCrc = SecondCrc = integer() >= 0</v>
- <v>SecondSize = integer() >= 0</v>
- </type>
<desc>
<p>Combines two previously computed crc32 checksums.
This computation requires the size of the data object for
@@ -606,11 +519,8 @@ false</pre>
</desc>
</func>
<func>
- <name>date() -> Date</name>
+ <name name="date" arity="0"/>
<fsummary>Current date</fsummary>
- <type>
- <v>Date = <seealso marker="calendar#type-date">calendar:date()</seealso></v>
- </type>
<desc>
<p>Returns the current date as <c>{Year, Month, Day}</c>.</p>
<p>The time zone and daylight saving time correction depend on
@@ -621,47 +531,24 @@ false</pre>
</desc>
</func>
<func>
- <name>erlang:decode_packet(Type,Bin,Options) -> {ok,Packet,Rest} | {more,Length} | {error,Reason}</name>
+ <name name="decode_packet" arity="3"/>
<fsummary>Extracts a protocol packet from a binary</fsummary>
- <type>
- <v>Bin = binary()</v>
- <v>Options = [Opt]</v>
- <v>Packet = binary() | HttpPacket</v>
- <v>Rest = binary()</v>
- <v>Length = integer() > 0 | undefined</v>
- <v>Reason = term()</v>
- <v>&nbsp;Type, Opt -- see below</v>
- <v></v>
- <v>HttpPacket = HttpRequest | HttpResponse | HttpHeader | http_eoh | HttpError</v>
- <v>HttpRequest = {http_request, HttpMethod, HttpUri, HttpVersion}</v>
- <v>HttpResponse = {http_response, HttpVersion, integer(), HttpString}</v>
- <v>HttpHeader = {http_header, integer(), HttpField, Reserved=term(), Value=HttpString}</v>
- <v>HttpError = {http_error, HttpString}</v>
- <v>HttpMethod = HttpMethodAtom | HttpString</v>
- <v>HttpMethodAtom = 'OPTIONS' | 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'TRACE'</v>
- <v>HttpUri = '*' | {absoluteURI, http|https, Host=HttpString, Port=integer()|undefined, Path=HttpString} |
- {scheme, Scheme=HttpString, HttpString} | {abs_path, HttpString} | HttpString</v>
- <v>HttpVersion = {Major=integer(), Minor=integer()}</v>
- <v>HttpString = string() | binary()</v>
- <v>HttpField = HttpFieldAtom | HttpString</v>
- <v>HttpFieldAtom = 'Cache-Control' | 'Connection' | 'Date' | 'Pragma' | 'Transfer-Encoding' | 'Upgrade' | 'Via' | 'Accept' | 'Accept-Charset' | 'Accept-Encoding' | 'Accept-Language' | 'Authorization' | 'From' | 'Host' | 'If-Modified-Since' | 'If-Match' | 'If-None-Match' | 'If-Range' | 'If-Unmodified-Since' | 'Max-Forwards' | 'Proxy-Authorization' | 'Range' | 'Referer' | 'User-Agent' | 'Age' | 'Location' | 'Proxy-Authenticate' | 'Public' | 'Retry-After' | 'Server' | 'Vary' | 'Warning' | 'Www-Authenticate' | 'Allow' | 'Content-Base' | 'Content-Encoding' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-Md5' | 'Content-Range' | 'Content-Type' | 'Etag' | 'Expires' | 'Last-Modified' | 'Accept-Ranges' | 'Set-Cookie' | 'Set-Cookie2' | 'X-Forwarded-For' | 'Cookie' | 'Keep-Alive' | 'Proxy-Connection'</v>
- <v></v>
- </type>
- <desc>
- <p>Decodes the binary <c>Bin</c> according to the packet
- protocol specified by <c>Type</c>. Very similar to the packet
- handling done by sockets with the option {packet,Type}.</p>
- <p>If an entire packet is contained in <c>Bin</c> it is
+ <desc>
+
+ <p>Decodes the binary <c><anno>Bin</anno></c> according to the packet
+ protocol specified by <c><anno>Type</anno></c>. Very similar to the packet
+ handling done by sockets with the option {packet,<anno>Type</anno>}.</p>
+ <p>If an entire packet is contained in <c><anno>Bin</anno></c> it is
returned together with the remainder of the binary as
- <c>{ok,Packet,Rest}</c>.</p>
- <p>If <c>Bin</c> does not contain the entire packet,
- <c>{more,Length}</c> is returned. <c>Length</c> is either the
+ <c>{ok,<anno>Packet</anno>,<anno>Rest</anno>}</c>.</p>
+ <p>If <c><anno>Bin</anno></c> does not contain the entire packet,
+ <c>{more,<anno>Length</anno>}</c> is returned. <c><anno>Length</anno></c> is either the
expected <em>total size</em> of the packet or <c>undefined</c>
if the expected packet size is not known. <c>decode_packet</c>
can then be called again with more data added.</p>
<p>If the packet does not conform to the protocol format
- <c>{error,Reason}</c> is returned.</p>
- <p>The following values of <c>Type</c> are valid:</p>
+ <c>{error,<anno>Reason</anno>}</c> is returned.</p>
+ <p>The following values of <c><anno>Type</anno></c> are valid:</p>
<taglist>
<tag><c>raw | 0</c></tag>
<item>
@@ -699,15 +586,15 @@ false</pre>
<item>
<p>The Hypertext Transfer Protocol. The packets
are returned with the format according to
- <c>HttpPacket</c> described above. A packet is either a
+ <c><anno>HttpPacket</anno></c> described above. A packet is either a
request, a response, a header or an end of header
- mark. Invalid lines are returned as <c>HttpError</c>.</p>
+ mark. Invalid lines are returned as <c><anno>HttpError</anno></c>.</p>
<p>Recognized request methods and header fields are returned as atoms.
Others are returned as strings.</p>
<p>The protocol type <c>http</c> should only be used for
- the first line when a <c>HttpRequest</c> or a
- <c>HttpResponse</c> is expected. The following calls
- should use <c>httph</c> to get <c>HttpHeader</c>'s until
+ the first line when a <c><anno>HttpRequest</anno></c> or a
+ <c><anno>HttpResponse</anno></c> is expected. The following calls
+ should use <c>httph</c> to get <c><anno>HttpHeader</anno></c>'s until
<c>http_eoh</c> is returned that marks the end of the
headers and the beginning of any following message body.</p>
<p>The variants <c>http_bin</c> and <c>httph_bin</c> will return
@@ -716,14 +603,14 @@ false</pre>
</taglist>
<p>The following options are available:</p>
<taglist>
- <tag><c>{packet_size, integer()}</c></tag>
+ <tag><c>{packet_size, integer() >= 0}</c></tag>
<item><p>Sets the max allowed size 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. Default is 0 which means no
size limit.</p>
</item>
- <tag><c>{line_length, integer()}</c></tag>
+ <tag><c>{line_length, integer() >= 0}</c></tag>
<item><p>For packet type <c>line</c>, truncate lines longer
than the indicated length.</p>
<p>Option <c>line_length</c> also applies to <c>http*</c>
@@ -740,13 +627,10 @@ false</pre>
</desc>
</func>
<func>
- <name>delete_module(Module) -> true | undefined</name>
+ <name name="delete_module" arity="1"/>
<fsummary>Make the current code for a module old</fsummary>
- <type>
- <v>Module = atom()</v>
- </type>
<desc>
- <p>Makes the current code for <c>Module</c> become old code, and
+ <p>Makes the current code for <c><anno>Module</anno></c> become old code, and
deletes all references for this module from the export table.
Returns <c>undefined</c> if the module does not exist,
otherwise <c>true</c>.</p>
@@ -760,27 +644,24 @@ false</pre>
</desc>
</func>
<func>
- <name>demonitor(MonitorRef) -> true</name>
+ <name name="demonitor" arity="1"/>
<fsummary>Stop monitoring</fsummary>
- <type>
- <v>MonitorRef = reference()</v>
- </type>
<desc>
- <p>If <c>MonitorRef</c> is a reference which the calling process
+ <p>If <c><anno>MonitorRef</anno></c> is a reference which the calling process
obtained by calling
<seealso marker="#monitor/2">monitor/2</seealso>,
this monitoring is turned off. If the monitoring is already
turned off, nothing happens.</p>
- <p>Once <c>demonitor(MonitorRef)</c> has returned it is
- guaranteed that no <c>{'DOWN', MonitorRef, _, _, _}</c> message
+ <p>Once <c>demonitor(<anno>MonitorRef</anno>)</c> has returned it is
+ guaranteed that no <c>{'DOWN', <anno>MonitorRef</anno>, _, _, _}</c> message
due to the monitor will be placed in the caller's message queue
- in the future. A <c>{'DOWN', MonitorRef, _, _, _}</c> message
+ in the future. A <c>{'DOWN', <anno>MonitorRef</anno>, _, _, _}</c> message
might have been placed in the caller's message queue prior to
the call, though. Therefore, in most cases, it is advisable
to remove such a <c>'DOWN'</c> message from the message queue
after monitoring has been stopped.
- <seealso marker="#demonitor/2">demonitor(MonitorRef, [flush])</seealso> can be used instead of
- <c>demonitor(MonitorRef)</c> if this cleanup is wanted.</p>
+ <seealso marker="#demonitor/2">demonitor(<anno>MonitorRef</anno>, [flush])</seealso> can be used instead of
+ <c>demonitor(<anno>MonitorRef</anno>)</c> if this cleanup is wanted.</p>
<note>
<p>Prior to OTP release R11B (erts version 5.5) <c>demonitor/1</c>
behaved completely asynchronous, i.e., the monitor was active
@@ -792,35 +673,30 @@ false</pre>
asynchronously send a "demonitor signal" to the monitored entity
and ignore any future results of the monitor. </p>
</note>
- <p>Failure: It is an error if <c>MonitorRef</c> refers to a
+ <p>Failure: It is an error if <c><anno>MonitorRef</anno></c> refers to a
monitoring started by another process. Not all such cases are
cheap to check; if checking is cheap, the call fails with
- <c>badarg</c> (for example if <c>MonitorRef</c> is a remote
+ <c>badarg</c> (for example if <c><anno>MonitorRef</anno></c> is a remote
reference).</p>
</desc>
</func>
<func>
- <name>demonitor(MonitorRef, OptionList) -> boolean()</name>
+ <name name="demonitor" arity="2"/>
<fsummary>Stop monitoring</fsummary>
- <type>
- <v>MonitorRef = reference()</v>
- <v>OptionList = [Option]</v>
- <v>&nbsp;Option = flush | info</v>
- </type>
<desc>
<p>The returned value is <c>true</c> unless <c>info</c> is part
- of <c>OptionList</c>.
+ of <c><anno>OptionList</anno></c>.
</p>
- <p><c>demonitor(MonitorRef, [])</c> is equivalent to
- <seealso marker="#demonitor/1">demonitor(MonitorRef)</seealso>.</p>
- <p>Currently the following <c>Option</c>s are valid:</p>
+ <p><c>demonitor(<anno>MonitorRef</anno>, [])</c> is equivalent to
+ <seealso marker="#demonitor/1">demonitor(<anno>MonitorRef</anno>)</seealso>.</p>
+ <p>Currently the following <c><anno>Option</anno></c>s are valid:</p>
<taglist>
<tag><c>flush</c></tag>
<item>
- <p>Remove (one) <c>{_, MonitorRef, _, _, _}</c> message,
+ <p>Remove (one) <c>{_, <anno>MonitorRef</anno>, _, _, _}</c> message,
if there is one, from the caller's message queue after
monitoring has been stopped.</p>
- <p>Calling <c>demonitor(MonitorRef, [flush])</c>
+ <p>Calling <c>demonitor(<anno>MonitorRef</anno>, [flush])</c>
is equivalent to the following, but more efficient:</p>
<code type="none">
@@ -860,8 +736,8 @@ false</pre>
<note>
<p>More options may be added in the future.</p>
</note>
- <p>Failure: <c>badarg</c> if <c>OptionList</c> is not a list, or
- if <c>Option</c> is not a valid option, or the same failure as for
+ <p>Failure: <c>badarg</c> if <c><anno>OptionList</anno></c> is not a list, or
+ if <c><anno>Option</anno></c> is not a valid option, or the same failure as for
<seealso marker="#demonitor/1">demonitor/1</seealso></p>
</desc>
</func>
@@ -878,13 +754,10 @@ false</pre>
</desc>
</func>
<func>
- <name>erlang:display(Term) -> true</name>
+ <name name="display" arity="1"/>
<fsummary>Print a term on standard output</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
- <p>Prints a text representation of <c>Term</c> on the standard
+ <p>Prints a text representation of <c><anno>Term</anno></c> on the standard
output.</p>
<warning>
<p>This BIF is intended for debugging only.</p>
@@ -892,15 +765,12 @@ false</pre>
</desc>
</func>
<func>
- <name>element(N, Tuple) -> term()</name>
+ <name name="element" arity="2"/>
+ <type_desc variable="N">1..tuple_size(<anno>Tuple</anno>)</type_desc>
<fsummary>Get Nth element of a tuple</fsummary>
- <type>
- <v>N = 1..tuple_size(Tuple)</v>
- <v>Tuple = tuple()</v>
- </type>
<desc>
- <p>Returns the <c>N</c>th element (numbering from 1) of
- <c>Tuple</c>.</p>
+ <p>Returns the <c><anno>N</anno></c>th element (numbering from 1) of
+ <c><anno>Tuple</anno></c>.</p>
<pre>
> <input>element(2, {a, b, c}).</input>
b</pre>
@@ -908,11 +778,8 @@ b</pre>
</desc>
</func>
<func>
- <name>erase() -> [{Key, Val}]</name>
+ <name name="erase" arity="0"/>
<fsummary>Return and delete the process dictionary</fsummary>
- <type>
- <v>Key = Val = term()</v>
- </type>
<desc>
<p>Returns the process dictionary and deletes it.</p>
<pre>
@@ -923,15 +790,12 @@ b</pre>
</desc>
</func>
<func>
- <name>erase(Key) -> Val | undefined</name>
+ <name name="erase" arity="1"/>
<fsummary>Return and delete a value from the process dictionary</fsummary>
- <type>
- <v>Key = Val = term()</v>
- </type>
<desc>
- <p>Returns the value <c>Val</c> associated with <c>Key</c> and
+ <p>Returns the value <c><anno>Val</anno></c> associated with <c><anno>Key</anno></c> and
deletes it from the process dictionary. Returns
- <c>undefined</c> if no value is associated with <c>Key</c>.</p>
+ <c>undefined</c> if no value is associated with <c><anno>Key</anno></c>.</p>
<pre>
> <input>put(key1, {merry, lambs, are, playing}),</input>
<input>X = erase(key1),</input>
@@ -940,15 +804,12 @@ b</pre>
</desc>
</func>
<func>
- <name>error(Reason)</name>
+ <name name="error" arity="1"/>
<fsummary>Stop execution with a given reason</fsummary>
- <type>
- <v>Reason = term()</v>
- </type>
<desc>
<p>Stops the execution of the calling process with the reason
- <c>Reason</c>, where <c>Reason</c> is any term. The actual
- exit reason will be <c>{Reason, Where}</c>, where <c>Where</c>
+ <c><anno>Reason</anno></c>, where <c><anno>Reason</anno></c> is any term. The actual
+ exit reason will be <c>{<anno>Reason</anno>, Where}</c>, where <c>Where</c>
is a list of the functions most recently called (the current
function first). Since evaluating this function causes
the process to terminate, it has no return value.</p>
@@ -962,18 +823,14 @@ b</pre>
</desc>
</func>
<func>
- <name>error(Reason, Args)</name>
+ <name name="error" arity="2"/>
<fsummary>Stop execution with a given reason</fsummary>
- <type>
- <v>Reason = term()</v>
- <v>Args = [term()]</v>
- </type>
<desc>
<p>Stops the execution of the calling process with the reason
- <c>Reason</c>, where <c>Reason</c> is any term. The actual
- exit reason will be <c>{Reason, Where}</c>, where <c>Where</c>
+ <c><anno>Reason</anno></c>, where <c><anno>Reason</anno></c> is any term. The actual
+ exit reason will be <c>{<anno>Reason</anno>, Where}</c>, where <c>Where</c>
is a list of the functions most recently called (the current
- function first). <c>Args</c> is expected to be the list of
+ function first). <c><anno>Args</anno></c> is expected to be the list of
arguments for the current function; in Beam it will be used
to provide the actual arguments for the current function in
the <c>Where</c> term. Since evaluating this function causes
@@ -981,14 +838,11 @@ b</pre>
</desc>
</func>
<func>
- <name>exit(Reason)</name>
+ <name name="exit" arity="1"/>
<fsummary>Stop execution with a given reason</fsummary>
- <type>
- <v>Reason = term()</v>
- </type>
<desc>
<p>Stops the execution of the calling process with the exit
- reason <c>Reason</c>, where <c>Reason</c> is any term. Since
+ reason <c><anno>Reason</anno></c>, where <c><anno>Reason</anno></c> is any term. Since
evaluating this function causes the process to terminate, it
has no return value.</p>
<pre>
@@ -999,78 +853,67 @@ b</pre>
</desc>
</func>
<func>
- <name>exit(Pid, Reason) -> true</name>
+ <name name="exit" arity="2"/>
<fsummary>Send an exit signal to a process</fsummary>
- <type>
- <v>Pid = pid()</v>
- <v>Reason = term()</v>
- </type>
- <desc>
- <p>Sends an exit signal with exit reason <c>Reason</c> to
- the process <c>Pid</c>.</p>
- <p>The following behavior apply if <c>Reason</c> is any term
+ <desc>
+ <p>Sends an exit signal with exit reason <c><anno>Reason</anno></c> to
+ the process <c><anno>Pid</anno></c>.</p>
+ <p>The following behavior apply if <c><anno>Reason</anno></c> is any term
except <c>normal</c> or <c>kill</c>:</p>
- <p>If <c>Pid</c> is not trapping exits, <c>Pid</c> itself will
- exit with exit reason <c>Reason</c>. If <c>Pid</c> is trapping
+ <p>If <c><anno>Pid</anno></c> is not trapping exits, <c><anno>Pid</anno></c> itself will
+ exit with exit reason <c><anno>Reason</anno></c>. If <c><anno>Pid</anno></c> is trapping
exits, the exit signal is transformed into a message
- <c>{'EXIT', From, Reason}</c> and delivered to the message
- queue of <c>Pid</c>. <c>From</c> is the pid of the process
+ <c>{'EXIT', From, <anno>Reason</anno>}</c> and delivered to the message
+ queue of <c><anno>Pid</anno></c>. <c>From</c> is the pid of the process
which sent the exit signal. See also
<seealso marker="#process_flag/2">process_flag/2</seealso>.</p>
- <p>If <c>Reason</c> is the atom <c>normal</c>, <c>Pid</c> will
+ <p>If <c><anno>Reason</anno></c> is the atom <c>normal</c>, <c><anno>Pid</anno></c> will
not exit. If it is trapping exits, the exit signal is
transformed into a message <c>{'EXIT', From, normal}</c>
and delivered to its message queue.</p>
- <p>If <c>Reason</c> is the atom <c>kill</c>, that is if
- <c>exit(Pid, kill)</c> is called, an untrappable exit signal
- is sent to <c>Pid</c> which will unconditionally exit with
+ <p>If <c><anno>Reason</anno></c> is the atom <c>kill</c>, that is if
+ <c>exit(<anno>Pid</anno>, kill)</c> is called, an untrappable exit signal
+ is sent to <c><anno>Pid</anno></c> which will unconditionally exit with
exit reason <c>killed</c>.</p>
</desc>
</func>
<func>
- <name>erlang:external_size(Term) -> integer() >= 0</name>
+ <name name="external_size" arity="1"/>
<fsummary>Calculate the maximum size for a term encoded in the Erlang
external term format</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
<p>Calculates, without doing the encoding, the maximum byte size for
a term encoded in the Erlang external term format. The following
condition applies always:</p>
<p>
<pre>
-> <input>Size1 = byte_size(term_to_binary(Term)),</input>
-> <input>Size2 = erlang:external_size(Term),</input>
+> <input>Size1 = byte_size(term_to_binary(<anno>Term</anno>)),</input>
+> <input>Size2 = erlang:external_size(<anno>Term</anno>),</input>
> <input>true = Size1 =&lt; Size2.</input>
true
</pre>
</p>
- <p>This is equivalent to a call to: <code>erlang:external_size(Term, [])
+ <p>This is equivalent to a call to: <code>erlang:external_size(<anno>Term</anno>, [])
</code></p>
</desc>
</func>
<func>
- <name>erlang:external_size(Term, [Option]) -> integer() >= 0</name>
+ <name name="external_size" arity="2"/>
<fsummary>Calculate the maximum size for a term encoded in the Erlang
external term format</fsummary>
- <type>
- <v>Term = term()</v>
- <v>Option = {minor_version, Version}</v>
- </type>
<desc>
<p>Calculates, without doing the encoding, the maximum byte size for
a term encoded in the Erlang external term format. The following
condition applies always:</p>
<p>
<pre>
-> <input>Size1 = byte_size(term_to_binary(Term, Options)),</input>
-> <input>Size2 = erlang:external_size(Term, Options),</input>
+> <input>Size1 = byte_size(term_to_binary(<anno>Term</anno>, <anno>Options</anno>)),</input>
+> <input>Size2 = erlang:external_size(<anno>Term</anno>, <anno>Options</anno>),</input>
> <input>true = Size1 =&lt; Size2.</input>
true
</pre>
</p>
- <p>The option <c>{minor_version, Version}</c> specifies how floats
+ <p>The option <c>{minor_version, <anno>Version</anno>}</c> specifies how floats
are encoded. See
<seealso marker="#term_to_binary/2">term_to_binary/2</seealso> for
a more detailed description.
@@ -1078,13 +921,10 @@ true
</desc>
</func>
<func>
- <name>float(Number) -> float()</name>
+ <name name="float" arity="1"/>
<fsummary>Convert a number to a float</fsummary>
- <type>
- <v>Number = number()</v>
- </type>
<desc>
- <p>Returns a float by converting <c>Number</c> to a float.</p>
+ <p>Returns a float by converting <c><anno>Number</anno></c> to a float.</p>
<pre>
> <input>float(55).</input>
55.0</pre>
@@ -1101,14 +941,11 @@ true
</desc>
</func>
<func>
- <name>float_to_list(Float) -> string()</name>
+ <name name="float_to_list" arity="1"/>
<fsummary>Text representation of a float</fsummary>
- <type>
- <v>Float = float()</v>
- </type>
<desc>
<p>Returns a string which corresponds to the text
- representation of <c>Float</c>.</p>
+ representation of <c><anno>Float</anno></c>.</p>
<pre>
> <input>float_to_list(7.0).</input>
"7.00000000000000000000e+00"</pre>
@@ -1213,18 +1050,15 @@ true
</desc>
</func>
<func>
- <name>erlang:fun_info(Fun, Item) -> {Item, Info}</name>
+ <name name="fun_info" arity="2"/>
+ <type name="fun_info_item"/>
<fsummary>Information about a fun</fsummary>
- <type>
- <v>Fun = fun()</v>
- <v>Item, Info -- see below</v>
- </type>
- <desc>
- <p>Returns information about <c>Fun</c> as specified by
- <c>Item</c>, in the form <c>{Item,Info}</c>.</p>
- <p>For any fun, <c>Item</c> can be any of the atoms
+ <desc>
+ <p>Returns information about <c><anno>Fun</anno></c> as specified by
+ <c><anno>Item</anno></c>, in the form <c>{<anno>Item</anno>,<anno>Info</anno>}</c>.</p>
+ <p>For any fun, <c><anno>Item</anno></c> can be any of the atoms
<c>module</c>, <c>name</c>, <c>arity</c>, <c>env</c>, or <c>type</c>.</p>
- <p>For a local fun, <c>Item</c> can also be any of the atoms
+ <p>For a local fun, <c><anno>Item</anno></c> can also be any of the atoms
<c>index</c>, <c>new_index</c>, <c>new_uniq</c>,
<c>uniq</c>, and <c>pid</c>. For an external fun, the value
of any of these items is always the atom <c>undefined</c>.</p>
@@ -1233,33 +1067,26 @@ true
</desc>
</func>
<func>
- <name>erlang:fun_to_list(Fun) -> string()</name>
+ <name name="fun_to_list" arity="1"/>
<fsummary>Text representation of a fun</fsummary>
- <type>
- <v>Fun = fun()</v>
- </type>
<desc>
<p>Returns a string which corresponds to the text
- representation of <c>Fun</c>.</p>
+ representation of <c><anno>Fun</anno></c>.</p>
</desc>
</func>
<func>
- <name>erlang:function_exported(Module, Function, Arity) -> boolean()</name>
+ <name name="function_exported" arity="3"/>
<fsummary>Check if a function is exported and loaded</fsummary>
- <type>
- <v>Module = Function = atom()</v>
- <v>Arity = arity()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if the module <c>Module</c> is loaded
- and contains an exported function <c>Function/Arity</c>;
+ <p>Returns <c>true</c> if the module <c><anno>Module</anno></c> is loaded
+ and contains an exported function <c><anno>Function</anno>/<anno>Arity</anno></c>;
otherwise <c>false</c>.</p>
<p>Returns <c>false</c> for any BIF (functions implemented in C
rather than in Erlang).</p>
</desc>
</func>
<func>
- <name>garbage_collect() -> true</name>
+ <name name="garbage_collect" arity="0"/>
<fsummary>Force an immediate garbage collection of the calling process</fsummary>
<desc>
<p>Forces an immediate garbage collection of the currently
@@ -1276,26 +1103,20 @@ true
</desc>
</func>
<func>
- <name>garbage_collect(Pid) -> boolean()</name>
+ <name name="garbage_collect" arity="1"/>
<fsummary>Force an immediate garbage collection of a process</fsummary>
- <type>
- <v>Pid = pid()</v>
- </type>
<desc>
<p>Works like <c>erlang:garbage_collect()</c> but on any
process. The same caveats apply. Returns <c>false</c> if
- <c>Pid</c> refers to a dead process; <c>true</c> otherwise.</p>
+ <c><anno>Pid</anno></c> refers to a dead process; <c>true</c> otherwise.</p>
</desc>
</func>
<func>
- <name>get() -> [{Key, Val}]</name>
+ <name name="get" arity="0"/>
<fsummary>Return the process dictionary</fsummary>
- <type>
- <v>Key = Val = term()</v>
- </type>
<desc>
<p>Returns the process dictionary as a list of
- <c>{Key, Val}</c> tuples.</p>
+ <c>{<anno>Key</anno>, <anno>Val</anno>}</c> tuples.</p>
<pre>
> <input>put(key1, merry),</input>
<input>put(key2, lambs),</input>
@@ -1305,14 +1126,11 @@ true
</desc>
</func>
<func>
- <name>get(Key) -> Val | undefined</name>
+ <name name="get" arity="1"/>
<fsummary>Return a value from the process dictionary</fsummary>
- <type>
- <v>Key = Val = term()</v>
- </type>
<desc>
- <p>Returns the value <c>Val</c>associated with <c>Key</c> in
- the process dictionary, or <c>undefined</c> if <c>Key</c>
+ <p>Returns the value <c><anno>Val</anno></c>associated with <c><anno>Key</anno></c> in
+ the process dictionary, or <c>undefined</c> if <c><anno>Key</anno></c>
does not exist.</p>
<pre>
> <input>put(key1, merry),</input>
@@ -1331,14 +1149,11 @@ true
</desc>
</func>
<func>
- <name>get_keys(Val) -> [Key]</name>
+ <name name="get_keys" arity="1"/>
<fsummary>Return a list of keys from the process dictionary</fsummary>
- <type>
- <v>Val = Key = term()</v>
- </type>
<desc>
<p>Returns a list of keys which are associated with the value
- <c>Val</c> in the process dictionary.</p>
+ <c><anno>Val</anno></c> in the process dictionary.</p>
<pre>
> <input>put(mary, {1, 2}),</input>
<input>put(had, {1, 2}),</input>
@@ -1351,28 +1166,23 @@ true
</desc>
</func>
<func>
- <name>erlang:get_stacktrace() -> [{Module, Function, Arity | Args, Location}]</name>
+ <name name="get_stacktrace" arity="0"/>
<fsummary>Get the call stack back-trace of the last exception</fsummary>
- <type>
- <v>Module = Function = atom()</v>
- <v>Arity = arity()</v>
- <v>Args = [term()]</v>
- <v>Location = [{atom(),term()}]</v>
- </type>
+ <type name="stack_item"/>
<desc>
<p>Get the call stack back-trace (<em>stacktrace</em>) of the last
exception in the calling process as a list of
- <c>{Module,Function,Arity,Location}</c> tuples.
- The <c>Arity</c> field in the first tuple may be the argument
+ <c>{<anno>Module</anno>,<anno>Function</anno>,<anno>Arity</anno>,<anno>Location</anno>}</c> tuples.
+ The <c><anno>Arity</anno></c> field in the first tuple may be the argument
list of that function call instead of an arity integer,
depending on the exception.</p>
<p>If there has not been any exceptions in a process, the
- stacktrace is []. After a code change for the process,
+ stacktrace is <c>[]</c>. After a code change for the process,
the stacktrace may also be reset to [].</p>
<p>The stacktrace is the same data as the <c>catch</c> operator
returns, for example:</p>
<p><c>{'EXIT',{badarg,Stacktrace}} = catch abs(x)</c></p>
- <p><c>Location</c> is a (possibly empty) list of two-tuples that
+ <p><c><anno>Location</anno></c> is a (possibly empty) list of two-tuples that
may indicate the location in the source code of the function.
The first element is an atom that describes the type of
information in the second element. Currently the following
@@ -1397,11 +1207,8 @@ true
</desc>
</func>
<func>
- <name>group_leader() -> GroupLeader</name>
+ <name name="group_leader" arity="0"/>
<fsummary>Get the group leader for the calling process</fsummary>
- <type>
- <v>GroupLeader = pid()</v>
- </type>
<desc>
<p>Returns the pid of the group leader for the process which
evaluates the function.</p>
@@ -1414,13 +1221,10 @@ true
</desc>
</func>
<func>
- <name>group_leader(GroupLeader, Pid) -> true</name>
+ <name name="group_leader" arity="2"/>
<fsummary>Set the group leader for a process</fsummary>
- <type>
- <v>GroupLeader = Pid = pid()</v>
- </type>
<desc>
- <p>Sets the group leader of <c>Pid</c> to <c>GroupLeader</c>.
+ <p>Sets the group leader of <c><anno>Pid</anno></c> to <c><anno>GroupLeader</anno></c>.
Typically, this is used when a processes started from a
certain shell should have another group leader than
<c>init</c>.</p>
@@ -1429,40 +1233,72 @@ true
</desc>
</func>
<func>
- <name>halt()</name>
+ <name name="halt" arity="0"/>
<fsummary>Halt the Erlang runtime system and indicate normal exit to the calling environment</fsummary>
<desc>
- <p>Halts the Erlang runtime system and indicates normal exit to
- the calling environment. Has no return value.</p>
+ <p>The same as
+ <seealso marker="#halt/2"><c>halt(0, [])</c></seealso>.</p>
<pre>
> <input>halt().</input>
-os_prompt%</pre>
+os_prompt% </pre>
+ </desc>
+ </func>
+ <func>
+ <name name="halt" arity="1"/>
+ <fsummary>Halt the Erlang runtime system</fsummary>
+ <desc>
+ <p>The same as
+ <seealso marker="#halt/2"><c>halt(<anno>Status</anno>, [])</c></seealso>.</p>
+ <pre>
+> <input>halt(17).</input>
+os_prompt% <input>echo $?</input>
+17
+os_prompt% </pre>
</desc>
</func>
<func>
- <name>halt(Status)</name>
+ <name name="halt" arity="2"/>
<fsummary>Halt the Erlang runtime system</fsummary>
- <type>
- <v>Status = integer() >= 0 | string()</v>
- </type>
<desc>
- <p><c>Status</c> must be a non-negative integer, or a string.
- Halts the Erlang runtime system. Has no return value.
- If <c>Status</c> is an integer, it is returned as an exit
- status of Erlang to the calling environment.
- If <c>Status</c> is a string, produces an Erlang crash dump
- with <c>String</c> as slogan, and then exits with a non-zero
- status code.</p>
- <p>Note that on many platforms, only the status codes 0-255 are
- supported by the operating system.</p>
+ <p><c><anno>Status</anno></c> must be a non-negative integer, a string,
+ or the atom <c>abort</c>.
+ Halts the Erlang runtime system. Has no return value.
+ Depending on <c><anno>Status</anno></c>:
+ </p>
+ <taglist>
+ <tag>integer()</tag>
+ <item>The runtime system exits with the integer value <c><anno>Status</anno></c>
+ as status code to the calling environment (operating system).
+ </item>
+ <tag>string()</tag>
+ <item>An erlang crash dump is produced with <c><anno>Status</anno></c> as slogan,
+ and then the runtime system exits with status code <c>1</c>.
+ </item>
+ <tag><c>abort</c></tag>
+ <item>
+ The runtime system aborts producing a core dump, if that is
+ enabled in the operating system.
+ </item>
+ </taglist>
+ <p>Note that on many platforms, only the status codes 0-255 are
+ supported by the operating system.
+ </p>
+ <p>For integer <c><anno>Status</anno></c> the Erlang runtime system closes all ports
+ and allows async threads to finish their operations before exiting.
+ To exit without such flushing use
+ <c><anno>Option</anno></c> as <c>{flush,false}</c>.
+ </p>
+ <p>For statuses <c>string()</c> and <c>abort</c> the <c>flush</c>
+ option is ignored and flushing is <em>not</em> done.
+ </p>
</desc>
</func>
<func>
- <name>erlang:hash(Term, Range) -> Hash</name>
+ <name name="hash" arity="2"/>
<fsummary>Hash function (deprecated)</fsummary>
<desc>
- <p>Returns a hash value for <c>Term</c> within the range
- <c>1..Range</c>. The allowed range is 1..2^27-1.</p>
+ <p>Returns a hash value for <c><anno>Term</anno></c> within the range
+ <c>1..<anno>Range</anno></c>. The allowed range is 1..2^27-1.</p>
<warning>
<p>This BIF is deprecated as the hash value may differ on
different architectures. Also the hash values for integer
@@ -1475,35 +1311,28 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>hd(List) -> term()</name>
+ <name name="hd" arity="1"/>
<fsummary>Head of a list</fsummary>
- <type>
- <v>List = [term()]</v>
- </type>
<desc>
- <p>Returns the head of <c>List</c>, that is, the first element.</p>
+ <p>Returns the head of <c><anno>List</anno></c>, that is, the first element.</p>
<pre>
> <input>hd([1,2,3,4,5]).</input>
1</pre>
<p>Allowed in guard tests.</p>
- <p>Failure: <c>badarg</c> if <c>List</c> is the empty list [].</p>
+ <p>Failure: <c>badarg</c> if <c><anno>List</anno></c> is the empty list [].</p>
</desc>
</func>
<func>
- <name>erlang:hibernate(Module, Function, Args)</name>
+ <name name="hibernate" arity="3"/>
<fsummary>Hibernate a process until a message is sent to it</fsummary>
- <type>
- <v>Module = Function = atom()</v>
- <v>Args = [term()]</v>
- </type>
<desc>
<p>Puts the calling process into a wait state where its memory
allocation has been reduced as much as possible, which is
useful if the process does not expect to receive any messages
in the near future.</p>
<p>The process will be awaken when a message is sent to it, and
- control will resume in <c>Module:Function</c> with
- the arguments given by <c>Args</c> with the call stack
+ control will resume in <c><anno>Module</anno>:<anno>Function</anno></c> with
+ the arguments given by <c><anno>Args</anno></c> with the call stack
emptied, meaning that the process will terminate when that
function returns. Thus <c>erlang:hibernate/3</c> will never
return to its caller.</p>
@@ -1533,14 +1362,11 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>integer_to_list(Integer) -> string()</name>
+ <name name="integer_to_list" arity="1"/>
<fsummary>Text representation of an integer</fsummary>
- <type>
- <v>Integer = integer()</v>
- </type>
<desc>
<p>Returns a string which corresponds to the text
- representation of <c>Integer</c>.</p>
+ representation of <c><anno>Integer</anno></c>.</p>
<pre>
> <input>integer_to_list(77).</input>
"77"</pre>
@@ -1558,14 +1384,11 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>iolist_to_binary(IoListOrBinary) -> binary()</name>
+ <name name="iolist_to_binary" arity="1"/>
<fsummary>Convert an iolist to a binary</fsummary>
- <type>
- <v>IoListOrBinary = iolist() | binary()</v>
- </type>
<desc>
<p>Returns a binary which is made from the integers and
- binaries in <c>IoListOrBinary</c>.</p>
+ binaries in <c><anno>IoListOrBinary</anno></c>.</p>
<pre>
> <input>Bin1 = &lt;&lt;1,2,3&gt;&gt;.</input>
&lt;&lt;1,2,3&gt;&gt;
@@ -1578,22 +1401,19 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>iolist_size(Item) -> integer() >= 0</name>
+ <name name="iolist_size" arity="1"/>
<fsummary>Size of an iolist</fsummary>
- <type>
- <v>Item = iolist() | binary()</v>
- </type>
<desc>
<p>Returns an integer which is the size in bytes
of the binary that would be the result of
- <c>iolist_to_binary(Item)</c>.</p>
+ <c>iolist_to_binary(<anno>Item</anno>)</c>.</p>
<pre>
> <input>iolist_size([1,2|&lt;&lt;3,4>>]).</input>
4</pre>
</desc>
</func>
<func>
- <name>is_alive() -> boolean()</name>
+ <name name="is_alive" arity="0"/>
<fsummary>Check whether the local node is alive</fsummary>
<desc>
<p>Returns <c>true</c> if the local node is alive; that is, if
@@ -1602,25 +1422,19 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>is_atom(Term) -> boolean()</name>
+ <name name="is_atom" arity="1"/>
<fsummary>Check whether a term is an atom</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Term</c> is an atom;
+ <p>Returns <c>true</c> if <c><anno>Term</anno></c> is an atom;
otherwise returns <c>false</c>.</p>
<p>Allowed in guard tests.</p>
</desc>
</func>
<func>
- <name>is_binary(Term) -> boolean()</name>
+ <name name="is_binary" arity="1"/>
<fsummary>Check whether a term is a binary</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Term</c> is a binary;
+ <p>Returns <c>true</c> if <c><anno>Term</anno></c> is a binary;
otherwise returns <c>false</c>.</p>
<p>A binary always contains a complete number of bytes.</p>
@@ -1629,78 +1443,58 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>is_bitstring(Term) -> boolean()</name>
+ <name name="is_bitstring" arity="1"/>
<fsummary>Check whether a term is a bitstring</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Term</c> is a bitstring (including a binary);
+ <p>Returns <c>true</c> if <c><anno>Term</anno></c> is a bitstring (including a binary);
otherwise returns <c>false</c>.</p>
<p>Allowed in guard tests.</p>
</desc>
</func>
<func>
- <name>is_boolean(Term) -> boolean()</name>
+ <name name="is_boolean" arity="1"/>
<fsummary>Check whether a term is a boolean</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Term</c> is
+ <p>Returns <c>true</c> if <c><anno>Term</anno></c> is
either the atom <c>true</c> or the atom <c>false</c>
(i.e. a boolean); otherwise returns <c>false</c>.</p>
<p>Allowed in guard tests.</p>
</desc>
</func>
<func>
- <name>erlang:is_builtin(Module, Function, Arity) -> boolean()</name>
+ <name name="is_builtin" arity="3"/>
<fsummary>Check if a function is a BIF implemented in C</fsummary>
- <type>
- <v>Module = Function = atom()</v>
- <v>Arity = arity()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Module:Function/Arity</c> is
+ <p>Returns <c>true</c> if <c><anno>Module</anno>:<anno>Function</anno>/<anno>Arity</anno></c> is
a BIF implemented in C; otherwise returns <c>false</c>.
This BIF is useful for builders of cross reference tools.</p>
</desc>
</func>
<func>
- <name>is_float(Term) -> boolean()</name>
+ <name name="is_float" arity="1"/>
<fsummary>Check whether a term is a float</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Term</c> is a floating point
+ <p>Returns <c>true</c> if <c><anno>Term</anno></c> is a floating point
number; otherwise returns <c>false</c>.</p>
<p>Allowed in guard tests.</p>
</desc>
</func>
<func>
- <name>is_function(Term) -> boolean()</name>
+ <name name="is_function" arity="1"/>
<fsummary>Check whether a term is a fun</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Term</c> is a fun; otherwise
+ <p>Returns <c>true</c> if <c><anno>Term</anno></c> is a fun; otherwise
returns <c>false</c>.</p>
<p>Allowed in guard tests.</p>
</desc>
</func>
<func>
- <name>is_function(Term, Arity) -> boolean()</name>
+ <name name="is_function" arity="2"/>
<fsummary>Check whether a term is a fun with a given arity</fsummary>
- <type>
- <v>Term = term()</v>
- <v>Arity = arity()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Term</c> is a fun that can be
- applied with <c>Arity</c> number of arguments; otherwise
+ <p>Returns <c>true</c> if <c><anno>Term</anno></c> is a fun that can be
+ applied with <c><anno>Arity</anno></c> number of arguments; otherwise
returns <c>false</c>.</p>
<p>Allowed in guard tests.</p>
<warning>
@@ -1713,74 +1507,56 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>is_integer(Term) -> boolean()</name>
+ <name name="is_integer" arity="1"/>
<fsummary>Check whether a term is an integer</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Term</c> is an integer;
+ <p>Returns <c>true</c> if <c><anno>Term</anno></c> is an integer;
otherwise returns <c>false</c>.</p>
<p>Allowed in guard tests.</p>
</desc>
</func>
<func>
- <name>is_list(Term) -> boolean()</name>
+ <name name="is_list" arity="1"/>
<fsummary>Check whether a term is a list</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Term</c> is a list with
+ <p>Returns <c>true</c> if <c><anno>Term</anno></c> is a list with
zero or more elements; otherwise returns <c>false</c>.</p>
<p>Allowed in guard tests.</p>
</desc>
</func>
<func>
- <name>is_number(Term) -> boolean()</name>
+ <name name="is_number" arity="1"/>
<fsummary>Check whether a term is a number</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Term</c> is either an integer or a
+ <p>Returns <c>true</c> if <c><anno>Term</anno></c> is either an integer or a
floating point number; otherwise returns <c>false</c>.</p>
<p>Allowed in guard tests.</p>
</desc>
</func>
<func>
- <name>is_pid(Term) -> boolean()</name>
+ <name name="is_pid" arity="1"/>
<fsummary>Check whether a term is a pid</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Term</c> is a pid (process
+ <p>Returns <c>true</c> if <c><anno>Term</anno></c> is a pid (process
identifier); otherwise returns <c>false</c>.</p>
<p>Allowed in guard tests.</p>
</desc>
</func>
<func>
- <name>is_port(Term) -> boolean()</name>
+ <name name="is_port" arity="1"/>
<fsummary>Check whether a term is a port</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Term</c> is a port identifier;
+ <p>Returns <c>true</c> if <c><anno>Term</anno></c> is a port identifier;
otherwise returns <c>false</c>.</p>
<p>Allowed in guard tests.</p>
</desc>
</func>
<func>
- <name>is_process_alive(Pid) -> boolean()</name>
+ <name name="is_process_alive" arity="1"/>
<fsummary>Check whether a process is alive</fsummary>
- <type>
- <v>Pid = pid()</v>
- </type>
<desc>
<p>
- <c>Pid</c> must refer to a process at the local node.
+ <c><anno>Pid</anno></c> must refer to a process at the local node.
Returns <c>true</c> if the process exists and is alive, that
is, is not exiting and has not exited. Otherwise, returns
<c>false</c>.
@@ -1788,41 +1564,32 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>is_record(Term, RecordTag) -> boolean()</name>
+ <name name="is_record" arity="2"/>
<fsummary>Check whether a term appears to be a record</fsummary>
- <type>
- <v>Term = term()</v>
- <v>RecordTag = atom()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Term</c> is a tuple and its first
- element is <c>RecordTag</c>. Otherwise, returns <c>false</c>.</p>
+ <p>Returns <c>true</c> if <c><anno>Term</anno></c> is a tuple and its first
+ element is <c><anno>RecordTag</anno></c>. Otherwise, returns <c>false</c>.</p>
<note>
<p>Normally the compiler treats calls to <c>is_record/2</c>
- specially. It emits code to verify that <c>Term</c> is a
- tuple, that its first element is <c>RecordTag</c>, and that
- the size is correct. However, if the <c>RecordTag</c> is
+ specially. It emits code to verify that <c><anno>Term</anno></c> is a
+ tuple, that its first element is <c><anno>RecordTag</anno></c>, and that
+ the size is correct. However, if the <c><anno>RecordTag</anno></c> is
not a literal atom, the <c>is_record/2</c> BIF will be
called instead and the size of the tuple will not be
verified.</p>
</note>
- <p>Allowed in guard tests, if <c>RecordTag</c> is a literal
+ <p>Allowed in guard tests, if <c><anno>RecordTag</anno></c> is a literal
atom.</p>
</desc>
</func>
<func>
- <name>is_record(Term, RecordTag, Size) -> boolean()</name>
+ <name name="is_record" arity="3"/>
<fsummary>Check whether a term appears to be a record</fsummary>
- <type>
- <v>Term = term()</v>
- <v>RecordTag = atom()</v>
- <v>Size = integer()</v>
- </type>
- <desc>
- <p><c>RecordTag</c> must be an atom. Returns <c>true</c> if
- <c>Term</c> is a tuple, its first element is <c>RecordTag</c>,
- and its size is <c>Size</c>. Otherwise, returns <c>false</c>.</p>
- <p>Allowed in guard tests, provided that <c>RecordTag</c> is
+ <desc>
+ <p><c><anno>RecordTag</anno></c> must be an atom. Returns <c>true</c> if
+ <c><anno>Term</anno></c> is a tuple, its first element is <c><anno>RecordTag</anno></c>,
+ and its size is <c><anno>Size</anno></c>. Otherwise, returns <c>false</c>.</p>
+ <p>Allowed in guard tests, provided that <c><anno>RecordTag</anno></c> is
a literal atom and <c>Size</c> is a literal integer.</p>
<note>
<p>This BIF is documented for completeness. In most cases
@@ -1831,37 +1598,28 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>is_reference(Term) -> boolean()</name>
+ <name name="is_reference" arity="1"/>
<fsummary>Check whether a term is a reference</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Term</c> is a reference;
+ <p>Returns <c>true</c> if <c><anno>Term</anno></c> is a reference;
otherwise returns <c>false</c>.</p>
<p>Allowed in guard tests.</p>
</desc>
</func>
<func>
- <name>is_tuple(Term) -> boolean()</name>
+ <name name="is_tuple" arity="1"/>
<fsummary>Check whether a term is a tuple</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Term</c> is a tuple;
+ <p>Returns <c>true</c> if <c><anno>Term</anno></c> is a tuple;
otherwise returns <c>false</c>.</p>
<p>Allowed in guard tests.</p>
</desc>
</func>
<func>
- <name>length(List) -> integer() >= 0</name>
+ <name name="length" arity="1"/>
<fsummary>Length of a list</fsummary>
- <type>
- <v>List = [term()]</v>
- </type>
<desc>
- <p>Returns the length of <c>List</c>.</p>
+ <p>Returns the length of <c><anno>List</anno></c>.</p>
<pre>
> <input>length([1,2,3,4,5,6,7,8,9]).</input>
9</pre>
@@ -1869,52 +1627,47 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>link(Pid) -> true</name>
+ <name name="link" arity="1"/>
<fsummary>Create a link to another process (or port)</fsummary>
- <type>
- <v>Pid = pid() | port()</v>
- </type>
<desc>
<p>Creates a link between the calling process and another
- process (or port) <c>Pid</c>, if there is not such a link
+ process (or port) <c><anno>PidOrPort</anno></c>, if there is not such a link
already. If a process attempts to create a link to itself,
nothing is done. Returns <c>true</c>.</p>
- <p>If <c>Pid</c> does not exist, the behavior of the BIF depends
+ <p>If <c><anno>PidOrPort</anno></c> does not exist, the behavior of the BIF depends
on if the calling process is trapping exits or not (see
<seealso marker="#process_flag/2">process_flag/2</seealso>):</p>
<list type="bulleted">
<item>If the calling process is not trapping exits, and
- checking <c>Pid</c> is cheap -- that is, if <c>Pid</c> is
+ checking <c><anno>PidOrPort</anno></c> is cheap -- that is, if <c><anno>PidOrPort</anno></c> is
local -- <c>link/1</c> fails with reason <c>noproc</c>.</item>
<item>Otherwise, if the calling process is trapping exits,
- and/or <c>Pid</c> is remote, <c>link/1</c> returns
+ and/or <c><anno>PidOrPort</anno></c> is remote, <c>link/1</c> returns
<c>true</c>, but an exit signal with reason <c>noproc</c>
is sent to the calling process.</item>
</list>
</desc>
</func>
<func>
- <name>list_to_atom(String) -> atom()</name>
+ <name name="list_to_atom" arity="1"/>
<fsummary>Convert from text representation to an atom</fsummary>
- <type>
- <v>String = string()</v>
- </type>
<desc>
- <p>Returns the atom whose text representation is <c>String</c>.</p>
+ <p>Returns the atom whose text representation is <c><anno>String</anno></c>.</p>
+ <p><c><anno>String</anno></c> may only contain ISO-latin-1
+ characterns (i.e. numbers below 256) as the current
+ implementation does not allow unicode characters >= 256 in
+ atoms.</p>
<pre>
> <input>list_to_atom("Erlang").</input>
'Erlang'</pre>
</desc>
</func>
<func>
- <name>list_to_binary(IoList) -> binary()</name>
+ <name name="list_to_binary" arity="1"/>
<fsummary>Convert a list to a binary</fsummary>
- <type>
- <v>IoList = iolist()</v>
- </type>
<desc>
<p>Returns a binary which is made from the integers and
- binaries in <c>IoList</c>.</p>
+ binaries in <c><anno>IoList</anno></c>.</p>
<pre>
> <input>Bin1 = &lt;&lt;1,2,3&gt;&gt;.</input>
&lt;&lt;1,2,3&gt;&gt;
@@ -1927,14 +1680,12 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>list_to_bitstring(BitstringList) -> bitstring()</name>
+ <name name="list_to_bitstring" arity="1"/>
+ <type name="bitstring_list"/>
<fsummary>Convert a list to a bitstring</fsummary>
- <type>
- <v>BitstringList = [BitstringList | bitstring() | char()]</v>
- </type>
<desc>
<p>Returns a bitstring which is made from the integers and
- bitstrings in <c>BitstringList</c>. (The last tail in <c>BitstringList</c>
+ bitstrings in <c><anno>BitstringList</anno></c>. (The last tail in <c><anno>BitstringList</anno></c>
is allowed to be a bitstring.)</p>
<pre>
> <input>Bin1 = &lt;&lt;1,2,3&gt;&gt;.</input>
@@ -1943,51 +1694,42 @@ os_prompt%</pre>
&lt;&lt;4,5&gt;&gt;
> <input>Bin3 = &lt;&lt;6,7:4,&gt;&gt;.</input>
&lt;&lt;6&gt;&gt;
-> <input>list_to_binary([Bin1,1,[2,3,Bin2],4|Bin3]).</input>
+> <input>list_to_bitstring([Bin1,1,[2,3,Bin2],4|Bin3]).</input>
&lt;&lt;1,2,3,1,2,3,4,5,4,6,7:46&gt;&gt;</pre>
</desc>
</func>
<func>
- <name>list_to_existing_atom(String) -> atom()</name>
+ <name name="list_to_existing_atom" arity="1"/>
<fsummary>Convert from text representation to an atom</fsummary>
- <type>
- <v>String = string()</v>
- </type>
<desc>
- <p>Returns the atom whose text representation is <c>String</c>,
+ <p>Returns the atom whose text representation is <c><anno>String</anno></c>,
but only if there already exists such atom.</p>
<p>Failure: <c>badarg</c> if there does not already exist an atom
- whose text representation is <c>String</c>.</p>
+ whose text representation is <c><anno>String</anno></c>.</p>
</desc>
</func>
<func>
- <name>list_to_float(String) -> float()</name>
+ <name name="list_to_float" arity="1"/>
<fsummary>Convert from text representation to a float</fsummary>
- <type>
- <v>String = string()</v>
- </type>
<desc>
- <p>Returns the float whose text representation is <c>String</c>.</p>
+ <p>Returns the float whose text representation is <c><anno>String</anno></c>.</p>
<pre>
> <input>list_to_float("2.2017764e+0").</input>
2.2017764</pre>
- <p>Failure: <c>badarg</c> if <c>String</c> contains a bad
+ <p>Failure: <c>badarg</c> if <c><anno>String</anno></c> contains a bad
representation of a float.</p>
</desc>
</func>
<func>
- <name>list_to_integer(String) -> integer()</name>
+ <name name="list_to_integer" arity="1"/>
<fsummary>Convert from text representation to an integer</fsummary>
- <type>
- <v>String = string()</v>
- </type>
<desc>
<p>Returns an integer whose text representation is
- <c>String</c>.</p>
+ <c><anno>String</anno></c>.</p>
<pre>
> <input>list_to_integer("123").</input>
123</pre>
- <p>Failure: <c>badarg</c> if <c>String</c> contains a bad
+ <p>Failure: <c>badarg</c> if <c><anno>String</anno></c> contains a bad
representation of an integer.</p>
</desc>
</func>
@@ -2005,13 +1747,10 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>list_to_pid(String) -> pid()</name>
+ <name name="list_to_pid" arity="1"/>
<fsummary>Convert from text representation to a pid</fsummary>
- <type>
- <v>String = string()</v>
- </type>
<desc>
- <p>Returns a pid whose text representation is <c>String</c>.</p>
+ <p>Returns a pid whose text representation is <c><anno>String</anno></c>.</p>
<warning>
<p>This BIF is intended for debugging and for use in
the Erlang operating system. It should not be used in
@@ -2020,18 +1759,15 @@ os_prompt%</pre>
<pre>
> <input>list_to_pid("&lt;0.4.1>").</input>
&lt;0.4.1></pre>
- <p>Failure: <c>badarg</c> if <c>String</c> contains a bad
+ <p>Failure: <c>badarg</c> if <c><anno>String</anno></c> contains a bad
representation of a pid.</p>
</desc>
</func>
<func>
- <name>list_to_tuple(List) -> tuple()</name>
+ <name name="list_to_tuple" arity="1"/>
<fsummary>Convert a list to a tuple</fsummary>
- <type>
- <v>List = [term()]</v>
- </type>
<desc>
- <p>Returns a tuple which corresponds to <c>List</c>. <c>List</c>
+ <p>Returns a tuple which corresponds to <c><anno>List</anno></c>. <c><anno>List</anno></c>
can contain any Erlang terms.</p>
<pre>
> <input>list_to_tuple([share, ['Ericsson_B', 163]]).</input>
@@ -2039,38 +1775,30 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>load_module(Module, Binary) -> {module, Module} | {error, Reason}</name>
+ <name name="load_module" arity="2"/>
<fsummary>Load object code for a module</fsummary>
- <type>
- <v>Module = atom()</v>
- <v>Binary = binary()</v>
- <v>Reason = badfile | not_purged | badfile</v>
- </type>
- <desc>
- <p>If <c>Binary</c> contains the object code for the module
- <c>Module</c>, this BIF loads that object code. Also, if
- the code for the module <c>Module</c> already exists, all
+ <desc>
+ <p>If <c><anno>Binary</anno></c> contains the object code for the module
+ <c><anno>Module</anno></c>, this BIF loads that object code. Also, if
+ the code for the module <c><anno>Module</anno></c> already exists, all
export references are replaced so they point to the newly
loaded code. The previously loaded code is kept in the system
as old code, as there may still be processes which are
executing that code. It returns either
- <c>{module, Module}</c>, or <c>{error, Reason}</c> if loading
- fails. <c>Reason</c> is one of the following:</p>
+ <c>{module, <anno>Module</anno>}</c>, or <c>{error, <anno>Reason</anno>}</c> if loading
+ fails. <c><anno>Reason</anno></c> is one of the following:</p>
<taglist>
<tag><c>badfile</c></tag>
<item>
- <p>The object code in <c>Binary</c> has an incorrect format.</p>
+ <p>The object code in <c><anno>Binary</anno></c> has an
+ incorrect format <em>or</em> the object code contains code
+ for another module than <c><anno>Module</anno></c>.</p>
</item>
<tag><c>not_purged</c></tag>
<item>
- <p><c>Binary</c> contains a module which cannot be loaded
+ <p><c><anno>Binary</anno></c> contains a module which cannot be loaded
because old code for this module already exists.</p>
</item>
- <tag><c>badfile</c></tag>
- <item>
- <p>The object code contains code for another module than
- <c>Module</c></p>
- </item>
</taglist>
<warning>
<p>This BIF is intended for the code server (see
@@ -2080,15 +1808,8 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>erlang:load_nif(Path, LoadInfo) -> ok | {error, {Reason, Text}}</name>
+ <name name="load_nif" arity="2"/>
<fsummary>Load NIF library</fsummary>
- <type>
- <v>Path = string()</v>
- <v>LoadInfo = term()</v>
- <v>Reason = load_failed | bad_lib | load | reload |
- upgrade | old_code</v>
- <v>Text = string()</v>
- </type>
<desc>
<note>
<p>In releases older than OTP R14B, NIFs were an
@@ -2099,21 +1820,21 @@ os_prompt%</pre>
<c>{error,Reason,Text}</c>.</p>
</note>
<p>Loads and links a dynamic library containing native
- implemented functions (NIFs) for a module. <c>Path</c> is a
+ implemented functions (NIFs) for a module. <c><anno>Path</anno></c> is a
file path to the sharable object/dynamic library file minus
the OS-dependent file extension (.so for Unix and .dll for
Windows). See <seealso marker="erl_nif">erl_nif</seealso>
on how to implement a NIF library.</p>
- <p><c>LoadInfo</c> can be any term. It will be passed on to
+ <p><c><anno>LoadInfo</anno></c> can be any term. It will be passed on to
the library as part of the initialization. A good practice is
to include a module version number to support future code
upgrade scenarios.</p>
<p>The call to <c>load_nif/2</c> must be made
<em>directly</em> from the Erlang code of the module that the
NIF library belongs to.</p>
- <p>It returns either <c>ok</c>, or <c>{error,{Reason,Text}}</c>
- if loading fails. <c>Reason</c> is one of the atoms below,
- while <c>Text</c> is a human readable string that may give
+ <p>It returns either <c>ok</c>, or <c>{error,{<anno>Reason</anno>,Text}}</c>
+ if loading fails. <c><anno>Reason</anno></c> is one of the atoms below,
+ while <c><anno>Text</anno></c> is a human readable string that may give
some more information about the failure.</p>
<taglist>
<tag><c>load_failed</c></tag>
@@ -2139,11 +1860,8 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>erlang:loaded() -> [Module]</name>
+ <name name="loaded" arity="0"/>
<fsummary>List of all loaded modules</fsummary>
- <type>
- <v>Module = atom()</v>
- </type>
<desc>
<p>Returns a list of all loaded Erlang modules (current and/or
old code), including preloaded modules.</p>
@@ -2151,11 +1869,8 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>erlang:localtime() -> DateTime</name>
+ <name name="localtime" arity="0"/>
<fsummary>Current local date and time</fsummary>
- <type>
- <v>DateTime = <seealso marker="calendar#type-datetime">calendar:datetime()</seealso></v>
- </type>
<desc>
<p>Returns the current local date and time
<c>{{Year, Month, Day}, {Hour, Minute, Second}}</c>.</p>
@@ -2172,32 +1887,27 @@ os_prompt%</pre>
<desc>
<p>Converts local date and time to Universal Time Coordinated
(UTC), if this is supported by the underlying OS. Otherwise,
- no conversion is done and <c>{<anno>Date1</anno>, <anno>Time1</anno>}</c> is returned.</p>
+ no conversion is done and <c><anno>Localtime</anno></c> is returned.</p>
<pre>
> <input>erlang:localtime_to_universaltime({{1996,11,6},{14,45,17}}).</input>
{{1996,11,6},{13,45,17}}</pre>
- <p>Failure: <c>badarg</c> if <c>Date1</c> or <c>Time1</c> do
- not denote a valid date or time.</p>
+ <p>Failure: <c>badarg</c> if <c><anno>Localtime</anno></c> does not denote
+ a valid date and time.</p>
</desc>
</func>
<func>
- <name>erlang:localtime_to_universaltime({Date1, Time1}, IsDst) -> {Date2, Time2}</name>
+ <name name="localtime_to_universaltime" arity="2"/>
<fsummary>Convert from local to Universal Time Coordinated (UTC) date and time</fsummary>
- <type>
- <v>Date1 = Date2 = <seealso marker="calendar#type-date">calendar:date()</seealso></v>
- <v>Time1 = Time2 = <seealso marker="calendar#type-time">calendar:time()</seealso></v>
- <v>IsDst = true | false | undefined</v>
- </type>
<desc>
<p>Converts local date and time to Universal Time Coordinated
(UTC) just like <c>erlang:localtime_to_universaltime/1</c>,
but the caller decides if daylight saving time is active or
not.</p>
- <p>If <c>IsDst == true</c> the <c>{Date1, Time1}</c> is during
- daylight saving time, if <c>IsDst == false</c> it is not,
- and if <c>IsDst == undefined</c> the underlying OS may
+ <p>If <c><anno>IsDst</anno> == true</c> the <c><anno>Localtime</anno></c> is during
+ daylight saving time, if <c><anno>IsDst</anno> == false</c> it is not,
+ and if <c><anno>IsDst</anno> == undefined</c> the underlying OS may
guess, which is the same as calling
- <c>erlang:localtime_to_universaltime({Date1, Time1})</c>.</p>
+ <c>erlang:localtime_to_universaltime(<anno>Localtime</anno>)</c>.</p>
<pre>
> <input>erlang:localtime_to_universaltime({{1996,11,6},{14,45,17}}, true).</input>
{{1996,11,6},{12,45,17}}
@@ -2205,12 +1915,12 @@ os_prompt%</pre>
{{1996,11,6},{13,45,17}}
> <input>erlang:localtime_to_universaltime({{1996,11,6},{14,45,17}}, undefined).</input>
{{1996,11,6},{13,45,17}}</pre>
- <p>Failure: <c>badarg</c> if <c>Date1</c> or <c>Time1</c> do
- not denote a valid date or time.</p>
+ <p>Failure: <c>badarg</c> if <c><anno>Localtime</anno></c> does not denote
+ a valid date and time.</p>
</desc>
</func>
<func>
- <name>make_ref() -> reference()</name>
+ <name name="make_ref" arity="0"/>
<fsummary>Return an almost unique reference</fsummary>
<desc>
<p>Returns an almost unique reference.</p>
@@ -2222,33 +1932,23 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>erlang:make_tuple(Arity, InitialValue) -> tuple()</name>
+ <name name="make_tuple" arity="2"/>
<fsummary>Create a new tuple of a given arity</fsummary>
- <type>
- <v>Arity = arity()</v>
- <v>InitialValue = term()</v>
- </type>
<desc>
- <p>Returns a new tuple of the given <c>Arity</c>, where all
- elements are <c>InitialValue</c>.</p>
+ <p>Returns a new tuple of the given <c><anno>Arity</anno></c>, where all
+ elements are <c><anno>InitialValue</anno></c>.</p>
<pre>
> <input>erlang:make_tuple(4, []).</input>
{[],[],[],[]}</pre>
</desc>
</func>
<func>
- <name>erlang:make_tuple(Arity, Default, InitList) -> tuple()</name>
+ <name name="make_tuple" arity="3"/>
<fsummary>Create a new tuple with given arity and contents</fsummary>
- <type>
- <v>Arity = arity()</v>
- <v>Default = term()</v>
- <v>InitList = [{Position,term()}]</v>
- <v>Position = integer()</v>
- </type>
- <desc>
- <p><c>erlang:make_tuple</c> first creates a tuple of size <c>Arity</c>
- where each element has the value <c>Default</c>. It then fills
- in values from <c>InitList</c>. Each list element in <c>InitList</c>
+ <desc>
+ <p><c>erlang:make_tuple</c> first creates a tuple of size <c><anno>Arity</anno></c>
+ where each element has the value <c><anno>DefaultValue</anno></c>. It then fills
+ in values from <c><anno>InitList</anno></c>. Each list element in <c><anno>InitList</anno></c>
must be a two-tuple where the first element is a position in the
newly created tuple and the second element is any term. If a position
occurs more than once in the list, the term corresponding to
@@ -2267,15 +1967,11 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>erlang:md5(Data) -> Digest</name>
+ <name name="md5" arity="1"/>
<fsummary>Compute an MD5 message digest</fsummary>
- <type>
- <v>Data = iodata()</v>
- <v>Digest = binary()</v>
- </type>
<desc>
- <p>Computes an <c>MD5</c> message digest from <c>Data</c>, where
- the length of the digest is 128 bits (16 bytes). <c>Data</c>
+ <p>Computes an <c>MD5</c> message digest from <c><anno>Data</anno></c>, where
+ the length of the digest is 128 bits (16 bytes). <c><anno>Data</anno></c>
is a binary or a list of small integers and binaries.</p>
<p>See The MD5 Message Digest Algorithm (RFC 1321) for more
information about MD5.</p>
@@ -2284,51 +1980,39 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>erlang:md5_final(Context) -> Digest</name>
+ <name name="md5_final" arity="1"/>
<fsummary>Finish the update of an MD5 context and return the computed MD5 message digest</fsummary>
- <type>
- <v>Context = Digest = binary()</v>
- </type>
<desc>
- <p>Finishes the update of an MD5 <c>Context</c> and returns
+ <p>Finishes the update of an MD5 <c><anno>Context</anno></c> and returns
the computed <c>MD5</c> message digest.</p>
</desc>
</func>
<func>
- <name>erlang:md5_init() -> Context</name>
+ <name name="md5_init" arity="0"/>
<fsummary>Create an MD5 context</fsummary>
- <type>
- <v>Context = binary()</v>
- </type>
<desc>
<p>Creates an MD5 context, to be used in subsequent calls to
<c>md5_update/2</c>.</p>
</desc>
</func>
<func>
- <name>erlang:md5_update(Context, Data) -> NewContext</name>
+ <name name="md5_update" arity="2"/>
<fsummary>Update an MD5 context with data, and return a new context</fsummary>
- <type>
- <v>Data = iodata()</v>
- <v>Context = NewContext = binary()</v>
- </type>
<desc>
- <p>Updates an MD5 <c>Context</c> with <c>Data</c>, and returns
- a <c>NewContext</c>.</p>
+ <p>Updates an MD5 <c><anno>Context</anno></c> with <c><anno>Data</anno></c>, and returns
+ a <c><anno>NewContext</anno></c>.</p>
</desc>
</func>
<func>
- <name>erlang:memory() -> [{Type, Size}]</name>
+ <name name="memory" arity="0"/>
+ <type name="memory_type"/>
<fsummary>Information about dynamically allocated memory</fsummary>
- <type>
- <v>Type, Size -- see below</v>
- </type>
<desc>
<p>Returns a list containing information about memory
dynamically allocated by the Erlang emulator. Each element of
the list is a tuple <c>{Type, Size}</c>. The first element
- <c>Type</c>is an atom describing memory type. The second
- element <c>Size</c>is memory size in bytes. A description of
+ <c><anno>Type</anno></c>is an atom describing memory type. The second
+ element <c><anno>Size</anno></c>is memory size in bytes. A description of
each memory type follows:</p>
<taglist>
<tag><c>total</c></tag>
@@ -2390,6 +2074,14 @@ os_prompt%</pre>
<p>This memory is part of the memory presented as
<c>system</c> memory.</p>
</item>
+ <tag><c>low</c></tag>
+ <item>
+ <p>Only on 64-bit halfword emulator.</p>
+ <p>The total amount of memory allocated in low memory areas
+ that are restricted to less than 4 Gb even though
+ the system may have more physical memory.</p>
+ <p>May be removed in future releases of halfword emulator.</p>
+ </item>
<tag><c>maximum</c></tag>
<item>
<p>The maximum total amount of memory allocated since
@@ -2401,14 +2093,6 @@ os_prompt%</pre>
<seealso marker="tools:instrument">instrument(3)</seealso>
and/or <seealso marker="erts:erl">erl(1)</seealso>.</p>
</item>
- <tag><c>low</c></tag>
- <item>
- <p>Only on 64-bit halfword emulator.</p>
- <p>The total amount of memory allocated in low memory areas
- that are restricted to less than 4 Gb even though
- the system may have more physical memory.</p>
- <p>May be removed in future releases of halfword emulator.</p>
- </item>
</taglist>
<note>
<p>The <c>system</c> value is not complete. Some allocated
@@ -2472,16 +2156,15 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>erlang:memory(Type | [Type]) -> Size | [{Type, Size}]</name>
+ <name name="memory" arity="1" clause_i="1"/>
+ <name name="memory" arity="1" clause_i="2"/>
+ <type name="memory_type"/>
<fsummary>Information about dynamically allocated memory</fsummary>
- <type>
- <v>Type, Size -- see below</v>
- </type>
<desc>
<p>Returns the memory size in bytes allocated for memory of
- type <c>Type</c>. The argument can also be given as a list
- of <c>Type</c> atoms, in which case a corresponding list of
- <c>{Type, Size}</c> tuples is returned.</p>
+ type <c><anno>Type</anno></c>. The argument can also be given as a list
+ of <c>memory_type()</c> atoms, in which case a corresponding list of
+ <c>{memory_type(), Size :: integer >= 0}</c> tuples is returned.</p>
<note>
<p>
Since erts version 5.6.4 <c>erlang:memory/1</c> requires that
@@ -2493,13 +2176,13 @@ os_prompt%</pre>
<taglist>
<tag><c>badarg</c></tag>
<item>
- If <c>Type</c> is not one of the memory types listed in the
+ If <c><anno>Type</anno></c> is not one of the memory types listed in the
documentation of
<seealso marker="#memory/0">erlang:memory/0</seealso>.
</item>
<tag><c>badarg</c></tag>
<item>
- If <c>maximum</c> is passed as <c>Type</c> and the emulator
+ If <c>maximum</c> is passed as <c><anno>Type</anno></c> and the emulator
is not run in instrumented mode.
</item>
<tag><c>notsup</c></tag>
@@ -2521,13 +2204,10 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>module_loaded(Module) -> boolean()</name>
+ <name name="module_loaded" arity="1"/>
<fsummary>Check if a module is loaded</fsummary>
- <type>
- <v>Module = atom()</v>
- </type>
<desc>
- <p>Returns <c>true</c> if the module <c>Module</c> is loaded,
+ <p>Returns <c>true</c> if the module <c><anno>Module</anno></c> is loaded,
otherwise returns <c>false</c>. It does not attempt to load
the module.</p>
<warning>
@@ -2538,22 +2218,15 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>monitor(Type, Item) -> MonitorRef</name>
+ <name name="monitor" arity="2"/>
<fsummary>Start monitoring</fsummary>
- <type>
- <v>Type = process</v>
- <v>Item = pid() | {RegName, Node} | RegName</v>
- <v>&nbsp;RegName = atom()</v>
- <v>&nbsp;Node = node()</v>
- <v>MonitorRef = reference()</v>
- </type>
- <desc>
- <p>The calling process starts monitoring <c>Item</c> which is
- an object of type <c>Type</c>.</p>
+ <desc>
+ <p>The calling process starts monitoring <c><anno>Item</anno></c> which is
+ an object of type <c><anno>Type</anno></c>.</p>
<p>Currently only processes can be monitored, i.e. the only
- allowed <c>Type</c> is <c>process</c>, but other types may be
+ allowed <c><anno>Type</anno></c> is <c>process</c>, but other types may be
allowed in the future.</p>
- <p><c>Item</c> can be:</p>
+ <p><c><anno>Item</anno></c> can be:</p>
<taglist>
<tag><c>pid()</c></tag>
<item>
@@ -2579,8 +2252,8 @@ os_prompt%</pre>
unregistered.</p>
</note>
<p>A <c>'DOWN'</c> message will be sent to the monitoring
- process if <c>Item</c> dies, if <c>Item</c> does not exist,
- or if the connection is lost to the node which <c>Item</c>
+ process if <c><anno>Item</anno></c> dies, if <c><anno>Item</anno></c> does not exist,
+ or if the connection is lost to the node which <c><anno>Item</anno></c>
resides on. A <c>'DOWN'</c> message has the following pattern:</p>
<code type="none">
{'DOWN', MonitorRef, Type, Object, Info}</code>
@@ -2591,11 +2264,11 @@ os_prompt%</pre>
<item>
<p>A reference to the monitored object:</p>
<list type="bulleted">
- <item>the pid of the monitored process, if <c>Item</c> was
+ <item>the pid of the monitored process, if <c><anno>Item</anno></c> was
specified as a pid.</item>
- <item><c>{RegName, Node}</c>, if <c>Item</c> was specified as
+ <item><c>{RegName, Node}</c>, if <c><anno>Item</anno></c> was specified as
<c>{RegName, Node}</c>.</item>
- <item><c>{RegName, Node}</c>, if <c>Item</c> was specified as
+ <item><c>{RegName, Node}</c>, if <c><anno>Item</anno></c> was specified as
<c>RegName</c>. <c>Node</c> will in this case be the
name of the local node (<c>node()</c>).</item>
</list>
@@ -2604,7 +2277,7 @@ os_prompt%</pre>
<item>
<p>Either the exit reason of the process, <c>noproc</c>
(non-existing process), or <c>noconnection</c> (no
- connection to <c>Node</c>).</p>
+ connection to <c><anno>Node</anno></c>).</p>
</item>
</taglist>
<note>
@@ -2622,7 +2295,7 @@ os_prompt%</pre>
where remote process monitoring by registered name is not
implemented), the call fails with <c>badarg</c>.</p>
<p>Making several calls to <c>monitor/2</c> for the same
- <c>Item</c> is not an error; it results in as many, completely
+ <c><anno>Item</anno></c> is not an error; it results in as many, completely
independent, monitorings.</p>
<note>
<p>The format of the <c>'DOWN'</c> message changed in the 5.2
@@ -2640,25 +2313,21 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>monitor_node(Node, Flag) -> true</name>
+ <name name="monitor_node" arity="2"/>
<fsummary>Monitor the status of a node</fsummary>
- <type>
- <v>Node = node()</v>
- <v>Flag = boolean()</v>
- </type>
<desc>
- <p>Monitors the status of the node <c>Node</c>. If <c>Flag</c>
- is <c>true</c>, monitoring is turned on; if <c>Flag</c> is
+ <p>Monitors the status of the node <c><anno>Node</anno></c>. If <c><anno>Flag</anno></c>
+ is <c>true</c>, monitoring is turned on; if <c><anno>Flag</anno></c> is
<c>false</c>, monitoring is turned off.</p>
<p>Making several calls to <c>monitor_node(Node, true)</c> for
- the same <c>Node</c> is not an error; it results in as many,
+ the same <c><anno>Node</anno></c> is not an error; it results in as many,
completely independent, monitorings.</p>
- <p>If <c>Node</c> fails or does not exist, the message
+ <p>If <c><anno>Node</anno></c> fails or does not exist, the message
<c>{nodedown, Node}</c> is delivered to the process. If a
process has made two calls to <c>monitor_node(Node, true)</c>
- and <c>Node</c> terminates, two <c>nodedown</c> messages are
+ and <c><anno>Node</anno></c> terminates, two <c>nodedown</c> messages are
delivered to the process. If there is no connection to
- <c>Node</c>, there will be an attempt to create one. If this
+ <c><anno>Node</anno></c>, there will be an attempt to create one. If this
fails, a <c>nodedown</c> message is delivered.</p>
<p>Nodes connected through hidden connections can be monitored
as any other node.</p>
@@ -2666,14 +2335,8 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>erlang:monitor_node(Node, Flag, Options) -> true</name>
+ <name name="monitor_node" arity="3"/>
<fsummary>Monitor the status of a node</fsummary>
- <type>
- <v>Node = node()</v>
- <v>Flag = boolean()</v>
- <v>Options = [Option]</v>
- <v>Option = allow_passive_connect</v>
- </type>
<desc>
<p>Behaves as <c>monitor_node/2</c> except that it allows an
extra option to be given, namely <c>allow_passive_connect</c>.
@@ -2696,11 +2359,8 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>erlang:nif_error(Reason)</name>
+ <name name="nif_error" arity="1"/>
<fsummary>Stop execution with a given reason</fsummary>
- <type>
- <v>Reason = term()</v>
- </type>
<desc>
<p>Works exactly like
<seealso marker="#error/1">erlang:error/1</seealso>,
@@ -2711,12 +2371,8 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>erlang:nif_error(Reason, Args)</name>
+ <name name="nif_error" arity="2"/>
<fsummary>Stop execution with a given reason</fsummary>
- <type>
- <v>Reason = term()</v>
- <v>Args = [term()]</v>
- </type>
<desc>
<p>Works exactly like
<seealso marker="#error/2">erlang:error/2</seealso>,
@@ -2727,11 +2383,8 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>node() -> Node</name>
+ <name name="node" arity="0"/>
<fsummary>Name of the local node</fsummary>
- <type>
- <v>Node = node()</v>
- </type>
<desc>
<p>Returns the name of the local node. If the node is not alive,
<c>nonode@nohost</c> is returned instead.</p>
@@ -2739,14 +2392,10 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>node(Arg) -> Node</name>
+ <name name="node" arity="1"/>
<fsummary>At which node is a pid, port or reference located</fsummary>
- <type>
- <v>Arg = pid() | port() | reference()</v>
- <v>Node = node()</v>
- </type>
<desc>
- <p>Returns the node where <c>Arg</c> is located. <c>Arg</c> can
+ <p>Returns the node where <c><anno>Arg</anno></c> is located. <c><anno>Arg</anno></c> can
be a pid, a reference, or a port. If the local node is not
alive, <c>nonode@nohost</c> is returned.</p>
<p>Allowed in guard tests.</p>
@@ -2761,17 +2410,13 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>nodes(Arg | [Arg]) -> Nodes</name>
+ <name name="nodes" arity="1"/>
<fsummary>All nodes of a certain type in the system</fsummary>
- <type>
- <v>Arg = visible | hidden | connected | this | known</v>
- <v>Nodes = [node()]</v>
- </type>
<desc>
<p>Returns a list of nodes according to argument given.
The result returned when the argument is a list, is the list
of nodes satisfying the disjunction(s) of the list elements.</p>
- <p><c>Arg</c> can be any of the following:</p>
+ <p><c><anno>NodeType</anno></c> can be any of the following:</p>
<taglist>
<tag><c>visible</c></tag>
<item>
@@ -2800,15 +2445,12 @@ os_prompt%</pre>
<c>nodes() = nodes(visible)</c>.</p>
<p>If the local node is not alive,
<c>nodes(this) == nodes(known) == [nonode@nohost]</c>, for
- any other <c>Arg</c> the empty list [] is returned.</p>
+ any other <c><anno>Arg</anno></c> the empty list [] is returned.</p>
</desc>
</func>
<func>
- <name>now() -> timestamp()</name>
- <type>
- <v>timestamp() = {MegaSecs, Secs, MicroSecs}</v>
- <v>MegaSecs = Secs = MicroSecs = integer() >= 0</v>
- </type>
+ <name name="now" arity="0"/>
+ <type name="timestamp"/>
<fsummary>Elapsed time since 00:00 GMT</fsummary>
<desc>
<p>Returns the tuple <c>{MegaSecs, Secs, MicroSecs}</c> which is
@@ -2823,38 +2465,26 @@ os_prompt%</pre>
<p>It can only be used to check the local time of day if
the time-zone info of the underlying operating system is
properly configured.</p>
+ <p>If you do not need the return value to be unique and
+ monotonically increasing, use
+ <seealso marker="kernel:os#timestamp/0">os:timestamp/0</seealso>
+ instead to avoid some overhead.</p>
</desc>
</func>
<func>
- <name>open_port(PortName, PortSettings) -> port()</name>
+ <name name="open_port" arity="2"/>
<fsummary>Open a port</fsummary>
- <type>
- <v>PortName = {spawn, Command} | {spawn_driver, Command} | {spawn_executable, FileName} | {fd, In, Out}</v>
- <v>&nbsp;Command = string()</v>
- <v>&nbsp;FileName = [ FileNameChar ] | binary()</v>
- <v>&nbsp;FileNameChar = integer() (1..255 or any Unicode codepoint, see description)</v>
- <v>&nbsp;In = Out = integer()</v>
- <v>PortSettings = [Opt]</v>
- <v>&nbsp;Opt = {packet, N} | stream | {line, L} | {cd, Dir} | {env, Env} | {args, [ ArgString ]} | {arg0, ArgString} | exit_status | use_stdio | nouse_stdio | stderr_to_stdout | in | out | binary | eof</v>
- <v>&nbsp;&nbsp;N = 1 | 2 | 4</v>
- <v>&nbsp;&nbsp;L = integer()</v>
- <v>&nbsp;&nbsp;Dir = string()</v>
- <v>&nbsp;&nbsp;ArgString = [ FileNameChar ] | binary()</v>
- <v>&nbsp;&nbsp;Env = [{Name, Val}]</v>
- <v>&nbsp;&nbsp;&nbsp;Name = string()</v>
- <v>&nbsp;&nbsp;&nbsp;Val = string() | false</v>
- </type>
<desc>
<p>Returns a port identifier as the result of opening a
new Erlang port. A port can be seen as an external Erlang
- process. <c>PortName</c> is one of the following:</p>
+ process. <c><anno>PortName</anno></c> is one of the following:</p>
<taglist>
- <tag><c>{spawn, Command}</c></tag>
+ <tag><c>{spawn, <anno>Command</anno>}</c></tag>
<item>
- <p>Starts an external program. <c>Command</c> is the name
- of the external program which will be run. <c>Command</c>
+ <p>Starts an external program. <c><anno>Command</anno></c> is the name
+ of the external program which will be run. <c><anno>Command</anno></c>
runs outside the Erlang work space unless an Erlang
- driver with the name <c>Command</c> is found. If found,
+ driver with the name <c><anno>Command</anno></c> is found. If found,
that driver will be started. A driver runs in the Erlang
workspace, which means that it is linked with the Erlang
runtime system.</p>
@@ -2874,24 +2504,24 @@ os_prompt%</pre>
name of the executable (or driver). This (among other
things) makes this option unsuitable for running
programs having spaces in file or directory names. Use
- {spawn_executable, Command} instead if spaces in executable
+ {spawn_executable, <anno>Command</anno>} instead if spaces in executable
file names is desired.</p>
</item>
- <tag><c>{spawn_driver, Command}</c></tag>
+ <tag><c>{spawn_driver, <anno>Command</anno>}</c></tag>
<item>
- <p>Works like <c>{spawn, Command}</c>, but demands the
+ <p>Works like <c>{spawn, <anno>Command</anno>}</c>, but demands the
first (space separated) token of the command to be the name of a
loaded driver. If no driver with that name is loaded, a
<c>badarg</c> error is raised.</p>
</item>
- <tag><c>{spawn_executable, Command}</c></tag>
+ <tag><c>{spawn_executable, <anno>FileName</anno>}</c></tag>
<item>
- <p>Works like <c>{spawn, Command}</c>, but only runs
- external executables. The <c>Command</c> in its whole
+ <p>Works like <c>{spawn, <anno>FileName</anno>}</c>, but only runs
+ external executables. The <c><anno>FileName</anno></c> in its whole
is used as the name of the executable, including any
spaces. If arguments are to be passed, the
- <c>args</c> and <c>arg0</c> <c>PortSettings</c> can be used.</p>
+ <c>args</c> and <c>arg0</c> <c><anno>PortSettings</anno></c> can be used.</p>
<p>The shell is not usually invoked to start the
program, it's executed directly. Neither is the
@@ -2922,7 +2552,7 @@ os_prompt%</pre>
of the executable is limited to the ISO-latin-1
character set.</p></note>
- <p>If the <c>Command</c> cannot be run, an error
+ <p>If the <c><anno>FileName</anno></c> cannot be run, an error
exception, with the posix error code as the reason, is
raised. The error reason may differ between operating
systems. Typically the error <c>enoent</c> is raised
@@ -2930,23 +2560,23 @@ os_prompt%</pre>
<c>eaccess</c> is raised when the given file is not
executable.</p>
</item>
- <tag><c>{fd, In, Out}</c></tag>
+ <tag><c>{fd, <anno>In</anno>, <anno>Out</anno>}</c></tag>
<item>
<p>Allows an Erlang process to access any currently opened
file descriptors used by Erlang. The file descriptor
- <c>In</c> can be used for standard input, and the file
- descriptor <c>Out</c> for standard output. It is only
+ <c><anno>In</anno></c> can be used for standard input, and the file
+ descriptor <c><anno>Out</anno></c> for standard output. It is only
used for various servers in the Erlang operating system
(<c>shell</c> and <c>user</c>). Hence, its use is very
limited.</p>
</item>
</taglist>
- <p><c>PortSettings</c> is a list of settings for the port.
+ <p><c><anno>PortSettings</anno></c> is a list of settings for the port.
Valid settings are:</p>
<taglist>
- <tag><c>{packet, N}</c></tag>
+ <tag><c>{packet, <anno>N</anno>}</c></tag>
<item>
- <p>Messages are preceded by their length, sent in <c>N</c>
+ <p>Messages are preceded by their length, sent in <c><anno>N</anno></c>
bytes, with the most significant byte first. Valid values
for <c>N</c> are 1, 2, or 4.</p>
</item>
@@ -2956,7 +2586,7 @@ os_prompt%</pre>
user-defined protocol must be used between the Erlang
process and the external object.</p>
</item>
- <tag><c>{line, L}</c></tag>
+ <tag><c>{line, <anno>L</anno>}</c></tag>
<item>
<p>Messages are delivered on a per line basis. Each line
(delimited by the OS-dependent newline sequence) is
@@ -2964,7 +2594,7 @@ os_prompt%</pre>
is <c>{Flag, Line}</c>, where <c>Flag</c> is either
<c>eol</c> or <c>noeol</c> and <c>Line</c> is the actual
data delivered (without the newline sequence).</p>
- <p><c>L</c> specifies the maximum line length in bytes.
+ <p><c><anno>L</anno></c> specifies the maximum line length in bytes.
Lines longer than this will be delivered in more than one
message, with the <c>Flag</c> set to <c>noeol</c> for all
but the last message. If end of file is encountered
@@ -2972,36 +2602,40 @@ os_prompt%</pre>
sequence, the last line will also be delivered with
the <c>Flag</c> set to <c>noeol</c>. In all other cases,
lines are delivered with <c>Flag</c> set to <c>eol</c>.</p>
- <p>The <c>{packet, N}</c> and <c>{line, L}</c> settings are
+ <p>The <c>{packet, <anno>N</anno>}</c> and <c>{line, <anno>L</anno>}</c> settings are
mutually exclusive.</p>
</item>
- <tag><c>{cd, Dir}</c></tag>
+ <tag><c>{cd, <anno>Dir</anno>}</c></tag>
<item>
- <p>This is only valid for <c>{spawn, Command}</c> and
- <c>{spawn_executable, Command}</c>.
- The external program starts using <c>Dir</c> as its
- working directory. <c>Dir</c> must be a string. Not
- available on VxWorks.</p>
+ <p>This is only valid for <c>{spawn, <anno>Command</anno>}</c> and
+ <c>{spawn_executable, <anno>FileName</anno>}</c>.
+ The external program starts using <c><anno>Dir</anno></c> as its
+ working directory. <c><anno>Dir</anno></c> must be a string.
+ </p>
</item>
- <tag><c>{env, Env}</c></tag>
+ <tag><c>{env, <anno>Env</anno>}</c></tag>
<item>
- <p>This is only valid for <c>{spawn, Command}</c> and
- <c>{spawn_executable, Command}</c>.
+ <p>This is only valid for <c>{spawn, <anno>Command</anno>}</c> and
+ <c>{spawn_executable, <anno>FileName</anno>}</c>.
The environment of the started process is extended using
- the environment specifications in <c>Env</c>.</p>
- <p><c>Env</c> should be a list of tuples <c>{Name, Val}</c>,
- where <c>Name</c> is the name of an environment variable,
- and <c>Val</c> is the value it is to have in the spawned
- port process. Both <c>Name</c> and <c>Val</c> must be
- strings. The one exception is <c>Val</c> being the atom
+ the environment specifications in <c><anno>Env</anno></c>.</p>
+ <p><c><anno>Env</anno></c> should be a list of tuples <c>{<anno>Name</anno>, <anno>Val</anno>}</c>,
+ where <c><anno>Name</anno></c> is the name of an environment variable,
+ and <c><anno>Val</anno></c> is the value it is to have in the spawned
+ port process. Both <c><anno>Name</anno></c> and <c><anno>Val</anno></c> must be
+ strings. The one exception is <c><anno>Val</anno></c> being the atom
<c>false</c> (in analogy with <c>os:getenv/1</c>), which
- removes the environment variable. Not available on
- VxWorks.</p>
+ removes the environment variable.
+ </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>Name</c> and
+ <c>Value</c>) may contain characters with codepoints > 255.</p>
</item>
- <tag><c>{args, [ string() ]}</c></tag>
+ <tag><c>{args, [ string() | binary() ]}</c></tag>
<item>
- <p>This option is only valid for <c>{spawn_executable, Command}</c>
+ <p>This option is only valid for <c>{spawn_executable, <anno>FileName</anno>}</c>
and specifies arguments to the executable. Each argument
is given as a separate string and (on Unix) eventually
ends up as one element each in the argument vector. On
@@ -3044,10 +2678,10 @@ os_prompt%</pre>
option can be used.</p>
</item>
- <tag><c>{arg0, string()}</c></tag>
+ <tag><c>{arg0, string() | binary()}</c></tag>
<item>
- <p>This option is only valid for <c>{spawn_executable, Command}</c>
+ <p>This option is only valid for <c>{spawn_executable, <anno>FileName</anno>}</c>
and explicitly specifies the program name argument when
running an executable. This might in some circumstances,
on some operating systems, be desirable. How the program
@@ -3061,9 +2695,9 @@ os_prompt%</pre>
<tag><c>exit_status</c></tag>
<item>
- <p>This is only valid for <c>{spawn, Command}</c> where
- <c>Command</c> refers to an external program, and for
- <c>{spawn_executable, Command}</c>.</p>
+ <p>This is only valid for <c>{spawn, <anno>Command</anno>}</c> where
+ <c><anno>Command</anno></c> refers to an external program, and for
+ <c>{spawn_executable, <anno>FileName</anno>}</c>.</p>
<p>When the external process connected to the port exits, a
message of the form <c>{Port,{exit_status,Status}}</c> is
sent to the connected process, where <c>Status</c> is the
@@ -3078,8 +2712,8 @@ os_prompt%</pre>
</item>
<tag><c>use_stdio</c></tag>
<item>
- <p>This is only valid for <c>{spawn, Command}</c> and
- <c>{spawn_executable, Command}</c>. It
+ <p>This is only valid for <c>{spawn, <anno>Command</anno>}</c> and
+ <c>{spawn_executable, <anno>FileName</anno>}</c>. It
allows the standard input and output (file descriptors 0
and 1) of the spawned (UNIX) process for communication
with Erlang.</p>
@@ -3176,7 +2810,7 @@ os_prompt%</pre>
</item>
<tag><c>enoent</c></tag>
<item>
- <p>The <c>Command</c> given in <c>{spawn_executable, Command}</c> does not point out an existing file.</p>
+ <p>The <c><anno>FileName</anno></c> given in <c>{spawn_executable, <anno>FileName</anno>}</c> does not point out an existing file.</p>
</item>
</taglist>
<p>During use of a port opened using <c>{spawn, Name}</c>,
@@ -3192,56 +2826,47 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>erlang:phash(Term, Range) -> Hash</name>
+ <name name="phash" arity="2"/>
+ <type_desc variable="Range">Range = 1..2^32, Hash = 1..Range</type_desc>
<fsummary>Portable hash function</fsummary>
- <type>
- <v>Term = term()</v>
- <v>Range = 1..2^32</v>
- <v>Hash = 1..Range</v>
- </type>
<desc>
<p>Portable hash function that will give the same hash for
the same Erlang term regardless of machine architecture and
ERTS version (the BIF was introduced in ERTS 4.9.1.1). Range
can be between 1 and 2^32, the function returns a hash value
- for <c>Term</c> within the range <c>1..Range</c>.</p>
+ for <c><anno>Term</anno></c> within the range <c>1..<anno>Range</anno></c>.</p>
<p>This BIF could be used instead of the old deprecated
<c>erlang:hash/2</c> BIF, as it calculates better hashes for
all data-types, but consider using <c>phash2/1,2</c> instead.</p>
</desc>
</func>
<func>
- <name>erlang:phash2(Term [, Range]) -> Hash</name>
+ <name name="phash2" arity="1"/>
+ <name name="phash2" arity="2"/>
+ <type_desc variable="Range">1..2^32</type_desc>
+ <type_desc variable="Hash">0..Range-1</type_desc>
<fsummary>Portable hash function</fsummary>
- <type>
- <v>Term = term()</v>
- <v>Range = 1..2^32</v>
- <v>Hash = 0..Range-1</v>
- </type>
<desc>
<p>Portable hash function that will give the same hash for
the same Erlang term regardless of machine architecture and
ERTS version (the BIF was introduced in ERTS 5.2). Range can
be between 1 and 2^32, the function returns a hash value for
- <c>Term</c> within the range <c>0..Range-1</c>. When called
- without the <c>Range</c> argument, a value in the range
+ <c><anno>Term</anno></c> within the range <c>0..<anno>Range</anno>-1</c>. When called
+ without the <c><anno>Range</anno></c> argument, a value in the range
<c>0..2^27-1</c> is returned.</p>
<p>This BIF should always be used for hashing terms. It
distributes small integers better than <c>phash/2</c>, and
it is faster for bignums and binaries.</p>
- <p>Note that the range <c>0..Range-1</c> is different from
- the range of <c>phash/2</c> (<c>1..Range</c>).</p>
+ <p>Note that the range <c>0..<anno>Range</anno>-1</c> is different from
+ the range of <c>phash/2</c> (<c>1..<anno>Range</anno></c>).</p>
</desc>
</func>
<func>
- <name>pid_to_list(Pid) -> string()</name>
+ <name name="pid_to_list" arity="1"/>
<fsummary>Text representation of a pid</fsummary>
- <type>
- <v>Pid = pid()</v>
- </type>
<desc>
<p>Returns a string which corresponds to the text
- representation of <c>Pid</c>.</p>
+ representation of <c><anno>Pid</anno></c>.</p>
<warning>
<p>This BIF is intended for debugging and for use in
the Erlang operating system. It should not be used in
@@ -3250,88 +2875,74 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>port_close(Port) -> true</name>
+ <name name="port_close" arity="1"/>
<fsummary>Close an open port</fsummary>
- <type>
- <v>Port = port() | atom()</v>
- </type>
<desc>
<p>Closes an open port. Roughly the same as
- <c>Port ! {self(), close}</c> except for the error behaviour
+ <c><anno>Port</anno> ! {self(), close}</c> except for the error behaviour
(see below), and that the port does <em>not</em> reply with
<c>{Port, closed}</c>. Any process may close a port with
<c>port_close/1</c>, not only the port owner (the connected
process).</p>
- <p>For comparison: <c>Port ! {self(), close}</c> fails with
- <c>badarg</c> if <c>Port</c> cannot be sent to (i.e.,
- <c>Port</c> refers neither to a port nor to a process). If
- <c>Port</c> is a closed port nothing happens. If <c>Port</c>
+ <p>For comparison: <c><anno>Port</anno> ! {self(), close}</c> fails with
+ <c>badarg</c> if <c><anno>Port</anno></c> cannot be sent to (i.e.,
+ <c><anno>Port</anno></c> refers neither to a port nor to a process). If
+ <c><anno>Port</anno></c> is a closed port nothing happens. If <c><anno>Port</anno></c>
is an open port and the calling process is the port owner,
the port replies with <c>{Port, closed}</c> when all buffers
have been flushed and the port really closes, but if
the calling process is not the port owner the <em>port owner</em> fails with <c>badsig</c>.</p>
<p>Note that any process can close a port using
- <c>Port ! {PortOwner, close}</c> just as if it itself was
+ <c><anno>Port</anno> ! {PortOwner, close}</c> just as if it itself was
the port owner, but the reply always goes to the port owner.</p>
<p>In short: <c>port_close(Port)</c> has a cleaner and more
- logical behaviour than <c>Port ! {self(), close}</c>.</p>
- <p>Failure: <c>badarg</c> if <c>Port</c> is not an open port or
+ logical behaviour than <c><anno>Port</anno> ! {self(), close}</c>.</p>
+ <p>Failure: <c>badarg</c> if <c><anno>Port</anno></c> is not an open port or
the registered name of an open port.</p>
</desc>
</func>
<func>
- <name>port_command(Port, Data) -> true</name>
+ <name name="port_command" arity="2"/>
<fsummary>Send data to a port</fsummary>
- <type>
- <v>Port = port() | atom()</v>
- <v>Data = iodata()</v>
- </type>
<desc>
<p>Sends data to a port. Same as
- <c>Port ! {self(), {command, Data}}</c> except for the error
+ <c><anno>Port</anno> ! {self(), {command, Data}}</c> except for the error
behaviour (see below). Any process may send data to a port
with <c>port_command/2</c>, not only the port owner
(the connected process).</p>
- <p>For comparison: <c>Port ! {self(), {command, Data}}</c>
- fails with <c>badarg</c> if <c>Port</c> cannot be sent to
- (i.e., <c>Port</c> refers neither to a port nor to a process).
- If <c>Port</c> is a closed port the data message disappears
- without a sound. If <c>Port</c> is open and the calling
+ <p>For comparison: <c><anno>Port</anno> ! {self(), {command, Data}}</c>
+ fails with <c>badarg</c> if <c><anno>Port</anno></c> cannot be sent to
+ (i.e., <c><anno>Port</anno></c> refers neither to a port nor to a process).
+ If <c><anno>Port</anno></c> is a closed port the data message disappears
+ without a sound. If <c><anno>Port</anno></c> is open and the calling
process is not the port owner, the <em>port owner</em> fails
with <c>badsig</c>. The port owner fails with <c>badsig</c>
- also if <c>Data</c> is not a valid IO list.</p>
+ also if <c><anno>Data</anno></c> is not a valid IO list.</p>
<p>Note that any process can send to a port using
- <c>Port ! {PortOwner, {command, Data}}</c> just as if it
+ <c><anno>Port</anno> ! {PortOwner, {command, <anno>Data</anno>}}</c> just as if it
itself was the port owner.</p>
- <p>In short: <c>port_command(Port, Data)</c> has a cleaner and
+ <p>In short: <c>port_command(<anno>Port</anno>, <anno>Data</anno>)</c> has a cleaner and
more logical behaviour than
- <c>Port ! {self(), {command, Data}}</c>.</p>
+ <c><anno>Port</anno> ! {self(), {command, Data}}</c>.</p>
<p>If the port is busy, the calling process will be suspended
until the port is not busy anymore.</p>
<p>Failures:</p>
<taglist>
<tag><c>badarg</c></tag>
<item>
- If <c>Port</c> is not an open port or the registered name
+ If <c><anno>Port</anno></c> is not an open port or the registered name
of an open port.
</item>
<tag><c>badarg</c></tag>
<item>
- If <c>Data</c> is not a valid io list.
+ If <c><anno>Data</anno></c> is not a valid io list.
</item>
</taglist>
</desc>
</func>
<func>
- <name>port_command(Port, Data, OptionList) -> boolean()</name>
+ <name name="port_command" arity="3"/>
<fsummary>Send data to a port</fsummary>
- <type>
- <v>Port = port() | atom()</v>
- <v>Data = iodata()</v>
- <v>OptionList = [Option]</v>
- <v>Option = force</v>
- <v>Option = nosuspend</v>
- </type>
<desc>
<p>Sends data to a port. <c>port_command(Port, Data, [])</c>
equals <c>port_command(Port, Data)</c>.</p>
@@ -3339,7 +2950,7 @@ os_prompt%</pre>
otherwise, <c>true</c> is returned.</p>
<p>If the port is busy, the calling process will be suspended
until the port is not busy anymore.</p>
- <p>Currently the following <c>Option</c>s are valid:</p>
+ <p>Currently the following <c><anno>Option</anno></c>s are valid:</p>
<taglist>
<tag><c>force</c></tag>
<item>The calling process will not be suspended if the port is
@@ -3363,16 +2974,16 @@ os_prompt%</pre>
<taglist>
<tag><c>badarg</c></tag>
<item>
- If <c>Port</c> is not an open port or the registered name
+ If <c><anno>Port</anno></c> is not an open port or the registered name
of an open port.
</item>
<tag><c>badarg</c></tag>
<item>
- If <c>Data</c> is not a valid io list.
+ If <c><anno>Data</anno></c> is not a valid io list.
</item>
<tag><c>badarg</c></tag>
<item>
- If <c>OptionList</c> is not a valid option list.
+ If <c><anno>OptionList</anno></c> is not a valid option list.
</item>
<tag><c>notsup</c></tag>
<item>
@@ -3384,15 +2995,11 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>port_connect(Port, Pid) -> true</name>
+ <name name="port_connect" arity="2"/>
<fsummary>Set the owner of a port</fsummary>
- <type>
- <v>Port = port() | atom()</v>
- <v>Pid = pid()</v>
- </type>
<desc>
- <p>Sets the port owner (the connected port) to <c>Pid</c>.
- Roughly the same as <c>Port ! {self(), {connect, Pid}}</c>
+ <p>Sets the port owner (the connected port) to <c><anno>Pid</anno></c>.
+ Roughly the same as <c><anno>Port</anno> ! {self(), {connect, <anno>Pid</anno>}}</c>
except for the following:</p>
<list type="bulleted">
<item>
@@ -3410,160 +3017,146 @@ os_prompt%</pre>
<c>unlink(Port)</c> if this is not desired. Any process may
set the port owner to be any process with
<c>port_connect/2</c>.</p>
- <p>For comparison: <c>Port ! {self(), {connect, Pid}}</c> fails
- with <c>badarg</c> if <c>Port</c> cannot be sent to (i.e.,
- <c>Port</c> refers neither to a port nor to a process). If
- <c>Port</c> is a closed port nothing happens. If <c>Port</c>
+ <p>For comparison: <c><anno>Port</anno> ! {self(), {connect, <anno>Pid</anno>}}</c> fails
+ with <c>badarg</c> if <c><anno>Port</anno></c> cannot be sent to (i.e.,
+ <c><anno>Port</anno></c> refers neither to a port nor to a process). If
+ <c><anno>Port</anno></c> is a closed port nothing happens. If <c><anno>Port</anno></c>
is an open port and the calling process is the port owner,
the port replies with <c>{Port, connected}</c> to the old
port owner. Note that the old port owner is still linked to
- the port, and that the new is not. If <c>Port</c> is an open
+ the port, and that the new is not. If <c><anno>Port</anno></c> is an open
port and the calling process is not the port owner,
the <em>port owner</em> fails with <c>badsig</c>. The port
- owner fails with <c>badsig</c> also if <c>Pid</c> is not an
+ owner fails with <c>badsig</c> also if <c><anno>Pid</anno></c> is not an
existing local pid.</p>
<p>Note that any process can set the port owner using
- <c>Port ! {PortOwner, {connect, Pid}}</c> just as if it
+ <c><anno>Port</anno> ! {PortOwner, {connect, <anno>Pid</anno>}}</c> just as if it
itself was the port owner, but the reply always goes to
the port owner.</p>
- <p>In short: <c>port_connect(Port, Pid)</c> has a cleaner and
+ <p>In short: <c>port_connect(<anno>Port</anno>, <anno>Pid</anno>)</c> has a cleaner and
more logical behaviour than
- <c>Port ! {self(),{connect,Pid}}</c>.</p>
- <p>Failure: <c>badarg</c> if <c>Port</c> is not an open port
- or the registered name of an open port, or if <c>Pid</c> is
+ <c><anno>Port</anno> ! {self(),{connect,<anno>Pid</anno>}}</c>.</p>
+ <p>Failure: <c>badarg</c> if <c><anno>Port</anno></c> is not an open port
+ or the registered name of an open port, or if <c><anno>Pid</anno></c> is
not an existing local pid.</p>
</desc>
</func>
<func>
- <name>port_control(Port, Operation, Data) -> Res</name>
+ <name name="port_control" arity="3"/>
<fsummary>Perform a synchronous control operation on a port</fsummary>
- <type>
- <v>Port = port() | atom()</v>
- <v>Operation = integer()</v>
- <v>Data = Res = iodata()</v>
- </type>
<desc>
<p>Performs a synchronous control operation on a port.
- The meaning of <c>Operation</c> and <c>Data</c> depends on
+ The meaning of <c><anno>Operation</anno></c> and <c><anno>Data</anno></c> depends on
the port, i.e., on the port driver. Not all port drivers
support this control feature.</p>
<p>Returns: a list of integers in the range 0 through 255, or a
binary, depending on the port driver. The meaning of
the returned data also depends on the port driver.</p>
- <p>Failure: <c>badarg</c> if <c>Port</c> is not an open port or
- the registered name of an open port, if <c>Operation</c>
+ <p>Failure: <c>badarg</c> if <c><anno>Port</anno></c> is not an open port or
+ the registered name of an open port, if <c><anno>Operation</anno></c>
cannot fit in a 32-bit integer, if the port driver does not
support synchronous control operations, or if the port driver
so decides for any reason (probably something wrong with
- <c>Operation</c> or <c>Data</c>).</p>
+ <c><anno>Operation</anno></c> or <c><anno>Data</anno></c>).</p>
</desc>
</func>
<func>
- <name>erlang:port_call(Port, Operation, Data) -> term()</name>
+ <name name="port_call" arity="3"/>
<fsummary>Synchronous call to a port with term data</fsummary>
- <type>
- <v>Port = port() | atom()</v>
- <v>Operation = integer()</v>
- <v>Data = term()</v>
- </type>
<desc>
<p>Performs a synchronous call to a port. The meaning of
- <c>Operation</c> and <c>Data</c> depends on the port, i.e.,
+ <c><anno>Operation</anno></c> and <c><anno>Data</anno></c> depends on the port, i.e.,
on the port driver. Not all port drivers support this feature.</p>
- <p><c>Port</c> is a port identifier, referring to a driver.</p>
- <p><c>Operation</c> is an integer, which is passed on to
+ <p><c><anno>Port</anno></c> is a port identifier, referring to a driver.</p>
+ <p><c><anno>Operation</anno></c> is an integer, which is passed on to
the driver.</p>
- <p><c>Data</c> is any Erlang term. This data is converted to
+ <p><c><anno>Data</anno></c> is any Erlang term. This data is converted to
binary term format and sent to the port.</p>
<p>Returns: a term from the driver. The meaning of the returned
data also depends on the port driver.</p>
- <p>Failure: <c>badarg</c> if <c>Port</c> is not an open port or
- the registered name of an open port, if <c>Operation</c>
+ <p>Failure: <c>badarg</c> if <c><anno>Port</anno></c> is not an open port or
+ the registered name of an open port, if <c><anno>Operation</anno></c>
cannot fit in a 32-bit integer, if the port driver does not
support synchronous control operations, or if the port driver
so decides for any reason (probably something wrong with
- <c>Operation</c> or <c>Data</c>).</p>
+ <c><anno>Operation</anno></c> or <c><anno>Data</anno></c>).</p>
</desc>
</func>
<func>
- <name>erlang:port_info(Port) -> [{Item, Info}] | undefined</name>
+ <name name="port_info" arity="1"/>
+ <type name="port_info_result_item"/>
<fsummary>Information about a port</fsummary>
- <type>
- <v>Port = port() | atom()</v>
- <v>Item, Info -- see below</v>
- </type>
<desc>
<p>Returns a list containing tuples with information about
- the <c>Port</c>, or <c>undefined</c> if the port is not open.
+ the <c><anno>Port</anno></c>, or <c>undefined</c> if the port is not open.
The order of the tuples is not defined, nor are all the
tuples mandatory.</p>
<taglist>
- <tag><c>{registered_name, RegName}</c></tag>
+ <tag><c>{registered_name, <anno>RegName</anno>}</c></tag>
<item>
- <p><c>RegName</c> (an atom) is the registered name of
+ <p><c><anno>RegName</anno></c> (an atom) is the registered name of
the port. If the port has no registered name, this tuple
is not present in the list.</p>
</item>
- <tag><c>{id, Index}</c></tag>
+ <tag><c>{id, <anno>Index</anno>}</c></tag>
<item>
- <p><c>Index</c> (an integer) is the internal index of the
+ <p><c><anno>Index</anno></c> (an integer) is the internal index of the
port. This index may be used to separate ports.</p>
</item>
- <tag><c>{connected, Pid}</c></tag>
+ <tag><c>{connected, <anno>Pid</anno>}</c></tag>
<item>
- <p><c>Pid</c> is the process connected to the port.</p>
+ <p><c><anno>Pid</anno></c> is the process connected to the port.</p>
</item>
- <tag><c>{links, Pids}</c></tag>
+ <tag><c>{links, <anno>Pids</anno>}</c></tag>
<item>
- <p><c>Pids</c> is a list of pids to which processes the
+ <p><c><anno>Pids</anno></c> is a list of pids to which processes the
port is linked.</p>
</item>
- <tag><c>{name, String}</c></tag>
+ <tag><c>{name, <anno>String</anno>}</c></tag>
<item>
- <p><c>String</c> is the command name set by
+ <p><c><anno>String</anno></c> is the command name set by
<c>open_port</c>.</p>
</item>
- <tag><c>{input, Bytes}</c></tag>
+ <tag><c>{input, <anno>Bytes</anno>}</c></tag>
<item>
- <p><c>Bytes</c> is the total number of bytes read from
+ <p><c><anno>Bytes</anno></c> is the total number of bytes read from
the port.</p>
</item>
- <tag><c>{output, Bytes}</c></tag>
+ <tag><c>{output, <anno>Bytes</anno>}</c></tag>
<item>
- <p><c>Bytes</c> is the total number of bytes written to
+ <p><c><anno>Bytes</anno></c> is the total number of bytes written to
the port.</p>
</item>
+ <tag><c>{os_pid, <anno>OsPid</anno> | undefined}</c></tag>
+ <item>
+ <p><c> <anno>OsPid</anno></c> is the process identifier (or equivalent) of an OS process created with <c>open_port({spawn | spawn_executable, Command}, Options)</c>. If the port is not the result of spawning an OS process, the value is <c>undefined</c>.</p>
+ </item>
</taglist>
- <p>Failure: <c>badarg</c> if <c>Port</c> is not a local port.</p>
+ <p>Failure: <c>badarg</c> if <c><anno>Port</anno></c> is not a local port.</p>
</desc>
</func>
<func>
- <name>erlang:port_info(Port, Item) -> {Item, Info} | undefined | []</name>
+ <name name="port_info" arity="2"/>
+ <type name="port_info_item"/>
+ <type name="port_info_result_item"/>
<fsummary>Information about a port</fsummary>
- <type>
- <v>Port = port() | atom()</v>
- <v>Item, Info -- see below</v>
- </type>
- <desc>
- <p>Returns information about <c>Port</c> as specified
- by <c>Item</c>, or <c>undefined</c> if the port is not open.
- Also, if <c>Item == registered_name</c> and the port has no
- registered name, [] is returned.</p>
- <p>For valid values of <c>Item</c>, and corresponding
- values of <c>Info</c>, see
+ <desc>
+ <p>Returns information about <c><anno>Port</anno></c> as specified
+ by <c><anno>Item</anno></c>, or <c>undefined</c> if the port is not open.
+ Also, if <c>Item =:= registered_name</c> and the port has no
+ registered name, <c>[]</c> is returned.</p>
+ <p>For valid values of <c><anno>Item</anno></c>, and corresponding
+ values of <c><anno>Result</anno></c>, see
<seealso marker="#port_info/1">erlang:port_info/1</seealso>.</p>
- <p>Failure: <c>badarg</c> if <c>Port</c> is not a local port.</p>
+ <p>Failure: <c>badarg</c> if <c><anno>Port</anno></c> is not a local port.</p>
</desc>
</func>
<func>
- <name>erlang:port_to_list(Port) -> string()</name>
+ <name name="port_to_list" arity="1"/>
<fsummary>Text representation of a port identifier</fsummary>
- <type>
- <v>Port = port()</v>
- </type>
<desc>
<p>Returns a string which corresponds to the text
- representation of the port identifier <c>Port</c>.</p>
+ representation of the port identifier <c><anno>Port</anno></c>.</p>
<warning>
<p>This BIF is intended for debugging and for use in
the Erlang operating system. It should not be used in
@@ -3572,18 +3165,15 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>erlang:ports() -> [port()]</name>
+ <name name="ports" arity="0"/>
<fsummary>All open ports</fsummary>
<desc>
<p>Returns a list of all ports on the local node.</p>
</desc>
</func>
<func>
- <name>pre_loaded() -> [Module]</name>
+ <name name="pre_loaded" arity="0"/>
<fsummary>List of all pre-loaded modules</fsummary>
- <type>
- <v>Module = atom()</v>
- </type>
<desc>
<p>Returns a list of Erlang modules which are pre-loaded in
the system. As all loading of code is done through the file
@@ -3592,220 +3182,222 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>erlang:process_display(Pid, Type) -> void()</name>
+ <name name="process_display" arity="2"/>
<fsummary>Write information about a local process on standard error</fsummary>
- <type>
- <v>Pid = pid()</v>
- <v>Type = backtrace</v>
- </type>
<desc>
- <p>Writes information about the local process <c>Pid</c> on
+ <p>Writes information about the local process <c><anno>Pid</anno></c> on
standard error. The currently allowed value for the atom
- <c>Type</c> is <c>backtrace</c>, which shows the contents of
+ <c><anno>Type</anno></c> is <c>backtrace</c>, which shows the contents of
the call stack, including information about the call chain, with
the current function printed first. The format of the output
is not further defined.</p>
</desc>
</func>
<func>
- <name>process_flag(Flag, Value) -> OldValue</name>
- <fsummary>Set process flags for the calling process</fsummary>
- <type>
- <v>Flag, Value, OldValue -- see below</v>
- </type>
+ <name name="process_flag" arity="2" clause_i="1"/>
+ <fsummary>Set process flag trap_exit for the calling process</fsummary>
<desc>
- <p>Sets certain flags for the process which calls this
- function. Returns the old value of the flag.</p>
- <taglist>
- <tag><c>process_flag(trap_exit, Boolean)</c></tag>
- <item>
- <p>When <c>trap_exit</c> is set to <c>true</c>, exit signals
- arriving to a process are converted to <c>{'EXIT', From, Reason}</c> messages, which can be received as ordinary
- messages. If <c>trap_exit</c> is set to <c>false</c>, the
- process exits if it receives an exit signal other than
- <c>normal</c> and the exit signal is propagated to its
- linked processes. Application processes should normally
- not trap exits.</p>
- <p>See also <seealso marker="#exit/2">exit/2</seealso>.</p>
- </item>
- <tag><c>process_flag(error_handler, Module)</c></tag>
- <item>
- <p>This is used by a process to redefine the error handler
- for undefined function calls and undefined registered
- processes. Inexperienced users should not use this flag
- since code auto-loading is dependent on the correct
- operation of the error handling module.</p>
- </item>
- <tag><c>process_flag(min_heap_size, MinHeapSize)</c></tag>
- <item>
- <p>This changes the minimum heap size for the calling
- process.</p>
- </item>
- <tag><c>process_flag(min_bin_vheap_size, MinBinVHeapSize)</c></tag>
- <item>
- <p>This changes the minimum binary virtual heap size for the calling
- process.</p>
- </item>
- <tag><marker id="process_flag_priority"><c>process_flag(priority, Level)</c></marker></tag>
- <item>
- <p>This sets the process priority. <c>Level</c> is an atom.
- There are currently four priority levels: <c>low</c>,
- <c>normal</c>, <c>high</c>, and <c>max</c>. The default
- priority level is <c>normal</c>. <em>NOTE</em>: The
- <c>max</c> priority level is reserved for internal use in
- the Erlang runtime system, and should <em>not</em> be used
- by others.
- </p>
- <p>Internally in each priority level processes are scheduled
- in a round robin fashion.
- </p>
- <p>Execution of processes on priority <c>normal</c> and
- priority <c>low</c> will be interleaved. Processes on
- priority <c>low</c> will be selected for execution less
- frequently than processes on priority <c>normal</c>.
- </p>
- <p>When there are runnable processes on priority <c>high</c>
- no processes on priority <c>low</c>, or <c>normal</c> will
- be selected for execution. Note, however, that this does
- <em>not</em> mean that no processes on priority <c>low</c>,
- or <c>normal</c> will be able to run when there are
- processes on priority <c>high</c> running. On the runtime
- system with SMP support there might be more processes running
- in parallel than processes on priority <c>high</c>, i.e.,
- a <c>low</c>, and a <c>high</c> priority process might
- execute at the same time.
- </p>
- <p>When there are runnable processes on priority <c>max</c>
- no processes on priority <c>low</c>, <c>normal</c>, or
- <c>high</c> will be selected for execution. As with the
- <c>high</c> priority, processes on lower priorities might
- execute in parallel with processes on priority <c>max</c>.
- </p>
- <p>Scheduling is preemptive. Regardless of priority, a process
- is preempted when it has consumed more than a certain amount
- of reductions since the last time it was selected for
- execution.
- </p>
- <p><em>NOTE</em>: You should not depend on the scheduling
- to remain exactly as it is today. Scheduling, at least on
- the runtime system with SMP support, is very likely to be
- modified in the future in order to better utilize available
- processor cores.
- </p>
- <p>There is currently <em>no</em> automatic mechanism for
- avoiding priority inversion, such as priority inheritance,
- or priority ceilings. When using priorities you have
- to take this into account and handle such scenarios by
- yourself.
- </p>
- <p>Making calls from a <c>high</c> priority process into code
- that you don't have control over may cause the <c>high</c>
- priority process to wait for a processes with lower
- priority, i.e., effectively decreasing the priority of the
- <c>high</c> priority process during the call. Even if this
- isn't the case with one version of the code that you don't
- have under your control, it might be the case in a future
- version of it. This might, for example, happen if a
- <c>high</c> priority process triggers code loading, since
- the code server runs on priority <c>normal</c>.
- </p>
- <p>Other priorities than <c>normal</c> are normally not needed.
- When other priorities are used, they need to be used
- with care, especially the <c>high</c> priority <em>must</em>
- be used with care. A process on <c>high</c> priority should
- only perform work for short periods of time. Busy looping for
- long periods of time in a <c>high</c> priority process will
- most likely cause problems, since there are important servers
- in OTP running on priority <c>normal</c>.
- </p>
- </item>
-
- <tag><c>process_flag(save_calls, N)</c></tag>
- <item>
- <p><c>N</c> must be an integer in the interval 0..10000.
- If <c>N</c> &gt; 0, call saving is made active for the
- process, which means that information about the <c>N</c>
- most recent global function calls, BIF calls, sends and
- receives made by the process are saved in a list, which
- can be retrieved with
- <c>process_info(Pid, last_calls)</c>. A global function
- call is one in which the module of the function is
- explicitly mentioned. Only a fixed amount of information
- is saved: a tuple <c>{Module, Function, Arity}</c> for
- function calls, and the mere atoms <c>send</c>,
- <c>'receive'</c> and <c>timeout</c> for sends and receives
- (<c>'receive'</c> when a message is received and
- <c>timeout</c> when a receive times out). If <c>N</c> = 0,
- call saving is disabled for the process, which is the
- default. Whenever the size of the call saving list is set,
- its contents are reset.</p>
- </item>
- <tag><c>process_flag(sensitive, Boolean)</c></tag>
- <item>
- <p>Set or clear the <c>sensitive</c> flag for the current process.
- When a process has been marked as sensitive by calling
- <c>process_flag(sensitive, true)</c>, features in the run-time
- system that can be used for examining the data and/or inner working
- of the process are silently disabled.</p>
- <p>Features that are disabled include (but are not limited to)
- the following:</p>
- <p>Tracing: Trace flags can still be set for the process, but no
- trace messages of any kind will be generated.
- (If the <c>sensitive</c> flag is turned off, trace messages will
- again be generated if there are any trace flags set.)</p>
- <p>Sequential tracing: The sequential trace token will be propagated
- as usual, but no sequential trace messages will be generated.</p>
- <p><c>process_info/1,2</c> cannot be used to read out the message
- queue or the process dictionary (both will be returned as empty lists).</p>
- <p>Stack back-traces cannot be displayed for the process.</p>
- <p>In crash dumps, the stack, messages, and the process dictionary
- will be omitted.</p>
- <p>If <c>{save_calls,N}</c> has been set for the process, no
- function calls will be saved to the call saving list.
- (The call saving list will not be cleared; furthermore, send, receive,
- and timeout events will still be added to the list.)</p>
- </item>
- </taglist>
+ <p>When <c>trap_exit</c> is set to <c>true</c>, exit signals
+ arriving to a process are converted to <c>{'EXIT', From, Reason}</c> messages, which can be received as ordinary
+ messages. If <c>trap_exit</c> is set to <c>false</c>, the
+ process exits if it receives an exit signal other than
+ <c>normal</c> and the exit signal is propagated to its
+ linked processes. Application processes should normally
+ not trap exits.</p>
+ <p>Returns the old value of the flag.</p>
+ <p>See also <seealso marker="#exit/2">exit/2</seealso>.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="process_flag" arity="2" clause_i="2"/>
+ <fsummary>Set process flag error_handler for the calling process</fsummary>
+ <desc>
+ <p>This is used by a process to redefine the error handler
+ for undefined function calls and undefined registered
+ processes. Inexperienced users should not use this flag
+ since code auto-loading is dependent on the correct
+ operation of the error handling module.</p>
+ <p>Returns the old value of the flag.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="process_flag" arity="2" clause_i="3"/>
+ <fsummary>Set process flag min_heap_size for the calling process</fsummary>
+ <desc>
+ <p>This changes the minimum heap size for the calling
+ process.</p>
+ <p>Returns the old value of the flag.</p>
</desc>
</func>
<func>
- <name>process_flag(Pid, Flag, Value) -> OldValue</name>
+ <name name="process_flag" arity="2" clause_i="4"/>
+ <fsummary>Set process flag min_bin_vheap_size for the calling process</fsummary>
+ <desc>
+ <p>This changes the minimum binary virtual heap size for the calling
+ process.</p>
+ <p>Returns the old value of the flag.</p> </desc>
+ </func>
+ <func>
+ <name name="process_flag" arity="2" clause_i="5"/>
+ <type name="priority_level"/>
+ <fsummary>Set process flag priority for the calling process</fsummary>
+ <desc>
+ <p><marker id="process_flag_priority"></marker>
+ This sets the process priority. <c><anno>Level</anno></c> is an atom.
+ There are currently four priority levels: <c>low</c>,
+ <c>normal</c>, <c>high</c>, and <c>max</c>. The default
+ priority level is <c>normal</c>. <em>NOTE</em>: The
+ <c>max</c> priority level is reserved for internal use in
+ the Erlang runtime system, and should <em>not</em> be used
+ by others.
+ </p>
+ <p>Internally in each priority level processes are scheduled
+ in a round robin fashion.
+ </p>
+ <p>Execution of processes on priority <c>normal</c> and
+ priority <c>low</c> will be interleaved. Processes on
+ priority <c>low</c> will be selected for execution less
+ frequently than processes on priority <c>normal</c>.
+ </p>
+ <p>When there are runnable processes on priority <c>high</c>
+ no processes on priority <c>low</c>, or <c>normal</c> will
+ be selected for execution. Note, however, that this does
+ <em>not</em> mean that no processes on priority <c>low</c>,
+ or <c>normal</c> will be able to run when there are
+ processes on priority <c>high</c> running. On the runtime
+ system with SMP support there might be more processes running
+ in parallel than processes on priority <c>high</c>, i.e.,
+ a <c>low</c>, and a <c>high</c> priority process might
+ execute at the same time.
+ </p>
+ <p>When there are runnable processes on priority <c>max</c>
+ no processes on priority <c>low</c>, <c>normal</c>, or
+ <c>high</c> will be selected for execution. As with the
+ <c>high</c> priority, processes on lower priorities might
+ execute in parallel with processes on priority <c>max</c>.
+ </p>
+ <p>Scheduling is preemptive. Regardless of priority, a process
+ is preempted when it has consumed more than a certain amount
+ of reductions since the last time it was selected for
+ execution.
+ </p>
+ <p><em>NOTE</em>: You should not depend on the scheduling
+ to remain exactly as it is today. Scheduling, at least on
+ the runtime system with SMP support, is very likely to be
+ modified in the future in order to better utilize available
+ processor cores.
+ </p>
+ <p>There is currently <em>no</em> automatic mechanism for
+ avoiding priority inversion, such as priority inheritance,
+ or priority ceilings. When using priorities you have
+ to take this into account and handle such scenarios by
+ yourself.
+ </p>
+ <p>Making calls from a <c>high</c> priority process into code
+ that you don't have control over may cause the <c>high</c>
+ priority process to wait for a processes with lower
+ priority, i.e., effectively decreasing the priority of the
+ <c>high</c> priority process during the call. Even if this
+ isn't the case with one version of the code that you don't
+ have under your control, it might be the case in a future
+ version of it. This might, for example, happen if a
+ <c>high</c> priority process triggers code loading, since
+ the code server runs on priority <c>normal</c>.
+ </p>
+ <p>Other priorities than <c>normal</c> are normally not needed.
+ When other priorities are used, they need to be used
+ with care, especially the <c>high</c> priority <em>must</em>
+ be used with care. A process on <c>high</c> priority should
+ only perform work for short periods of time. Busy looping for
+ long periods of time in a <c>high</c> priority process will
+ most likely cause problems, since there are important servers
+ in OTP running on priority <c>normal</c>.
+ </p>
+ <p>Returns the old value of the flag.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="process_flag" arity="2" clause_i="6"/>
+ <fsummary>Set process flag save_calls for the calling process</fsummary>
+ <desc>
+ <p><c><anno>N</anno></c> must be an integer in the interval 0..10000.
+ If <c><anno>N</anno></c> &gt; 0, call saving is made active for the
+ process, which means that information about the <c><anno>N</anno></c>
+ most recent global function calls, BIF calls, sends and
+ receives made by the process are saved in a list, which
+ can be retrieved with
+ <c>process_info(Pid, last_calls)</c>. A global function
+ call is one in which the module of the function is
+ explicitly mentioned. Only a fixed amount of information
+ is saved: a tuple <c>{Module, Function, Arity}</c> for
+ function calls, and the mere atoms <c>send</c>,
+ <c>'receive'</c> and <c>timeout</c> for sends and receives
+ (<c>'receive'</c> when a message is received and
+ <c>timeout</c> when a receive times out). If <c>N</c> = 0,
+ call saving is disabled for the process, which is the
+ default. Whenever the size of the call saving list is set,
+ its contents are reset.</p>
+ <p>Returns the old value of the flag.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="process_flag" arity="2" clause_i="7"/>
+ <fsummary>Set process flag sensitive for the calling process</fsummary>
+ <desc>
+ <p>Set or clear the <c>sensitive</c> flag for the current process.
+ When a process has been marked as sensitive by calling
+ <c>process_flag(sensitive, true)</c>, features in the run-time
+ system that can be used for examining the data and/or inner working
+ of the process are silently disabled.</p>
+ <p>Features that are disabled include (but are not limited to)
+ the following:</p>
+ <p>Tracing: Trace flags can still be set for the process, but no
+ trace messages of any kind will be generated.
+ (If the <c>sensitive</c> flag is turned off, trace messages will
+ again be generated if there are any trace flags set.)</p>
+ <p>Sequential tracing: The sequential trace token will be propagated
+ as usual, but no sequential trace messages will be generated.</p>
+ <p><c>process_info/1,2</c> cannot be used to read out the message
+ queue or the process dictionary (both will be returned as empty lists).</p>
+ <p>Stack back-traces cannot be displayed for the process.</p>
+ <p>In crash dumps, the stack, messages, and the process dictionary
+ will be omitted.</p>
+ <p>If <c>{save_calls,N}</c> has been set for the process, no
+ function calls will be saved to the call saving list.
+ (The call saving list will not be cleared; furthermore, send, receive,
+ and timeout events will still be added to the list.)</p>
+ <p>Returns the old value of the flag.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="process_flag" arity="3"/>
<fsummary>Set process flags for a process</fsummary>
- <type>
- <v>Pid = pid()</v>
- <v>Flag, Value, OldValue -- see below</v>
- </type>
<desc>
- <p>Sets certain flags for the process <c>Pid</c>, in the same
+ <p>Sets certain flags for the process <c><anno>Pid</anno></c>, in the same
manner as
<seealso marker="#process_flag/2">process_flag/2</seealso>.
Returns the old value of the flag. The allowed values for
- <c>Flag</c> are only a subset of those allowed in
+ <c><anno>Flag</anno></c> are only a subset of those allowed in
<c>process_flag/2</c>, namely: <c>save_calls</c>.</p>
- <p>Failure: <c>badarg</c> if <c>Pid</c> is not a local process.</p>
+ <p>Failure: <c>badarg</c> if <c><anno>Pid</anno></c> is not a local process.</p>
</desc>
</func>
<func>
- <name>process_info(Pid) -> InfoResult</name>
+ <name name="process_info" arity="1"/>
+ <type name="process_info_result_item"/>
+ <type name="priority_level"/>
+ <type name="stack_item"/>
<fsummary>Information about a process</fsummary>
- <type>
- <v>Pid = pid()</v>
- <v>Item = atom()</v>
- <v>Info = term()</v>
- <v>InfoTuple = {Item, Info}</v>
- <v>InfoTupleList = [InfoTuple]</v>
- <v>InfoResult = InfoTupleList | undefined</v>
- </type>
- <desc>
- <p>Returns a list containing <c>InfoTuple</c>s with
+ <desc>
+ <p>Returns a list containing <c><anno>InfoTuple</anno></c>s with
miscellaneous information about the process identified by
<c>Pid</c>, or <c>undefined</c> if the process is not alive.
</p>
<p>
- The order of the <c>InfoTuple</c>s is not defined, nor
- are all the <c>InfoTuple</c>s mandatory. The <c>InfoTuple</c>s
+ The order of the <c><anno>InfoTuple</anno></c>s is not defined, nor
+ are all the <c><anno>InfoTuple</anno></c>s mandatory. The <c><anno>InfoTuple</anno></c>s
part of the result may be changed without prior notice.
- Currently <c>InfoTuple</c>s with the following <c>Item</c>s
+ Currently <c><anno>InfoTuple</anno></c>s with the following items
are part of the result:
<c>current_function</c>, <c>initial_call</c>, <c>status</c>,
<c>message_queue_len</c>, <c>messages</c>, <c>links</c>,
@@ -3813,12 +3405,12 @@ os_prompt%</pre>
<c>priority</c>, <c>group_leader</c>, <c>total_heap_size</c>,
<c>heap_size</c>, <c>stack_size</c>, <c>reductions</c>, and
<c>garbage_collection</c>.
- If the process identified by <c>Pid</c> has a registered name
- also an <c>InfoTuple</c> with <c>Item == registered_name</c>
+ If the process identified by <c><anno>Pid</anno></c> has a registered name
+ also an <c><anno>InfoTuple</anno></c> with the item <c>registered_name</c>
will appear.
</p>
<p>See <seealso marker="#process_info/2">process_info/2</seealso>
- for information about specific <c>InfoTuple</c>s.</p>
+ for information about specific <c><anno>InfoTuple</anno></c>s.</p>
<warning>
<p>This BIF is intended for <em>debugging only</em>, use
<seealso marker="#process_info/2">process_info/2</seealso>
@@ -3829,113 +3421,108 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>process_info(Pid, ItemSpec) -> InfoResult</name>
+ <name name="process_info" arity="2" clause_i="1"/>
+ <name name="process_info" arity="2" clause_i="2"/>
+ <type name="process_info_item"/>
+ <type name="process_info_result_item"/>
+ <type name="stack_item"/>
+ <type name="priority_level"/>
<fsummary>Information about a process</fsummary>
- <type>
- <v>Pid = pid()</v>
- <v>Item = atom()</v>
- <v>Info = term()</v>
- <v>ItemList = [Item]</v>
- <v>ItemSpec = Item | ItemList</v>
- <v>InfoTuple = {Item, Info}</v>
- <v>InfoTupleList = [InfoTuple]</v>
- <v>InfoResult = InfoTuple | InfoTupleList | undefined | []</v>
- </type>
- <desc>
- <p>Returns information about the process identified by <c>Pid</c>
- as specified by the <c>ItemSpec</c>, or <c>undefined</c> if the
+ <desc>
+ <p>Returns information about the process identified by <c><anno>Pid</anno></c>
+ as specified by the <c><anno>Item</anno></c> or the <c><anno>ItemList</anno></c>, or <c>undefined</c> if the
process is not alive.
</p>
- <p>If the process is alive and <c>ItemSpec</c> is a single
- <c>Item</c>, the returned value is the corresponding
- <c>InfoTuple</c> unless <c>ItemSpec == registered_name</c>
+ <p>If the process is alive and a single <c><anno>Item</anno></c> is given,
+ the returned value is the corresponding
+ <c><anno>InfoTuple</anno></c> unless <c>Item =:= registered_name</c>
and the process has no registered name. In this case
<c>[]</c> is returned. This strange behavior is due to
historical reasons, and is kept for backward compatibility.
</p>
- <p>If <c>ItemSpec</c> is an <c>ItemList</c>, the result is an
- <c>InfoTupleList</c>. The <c>InfoTuple</c>s in the
- <c>InfoTupleList</c> will appear with the corresponding
- <c>Item</c>s in the same order as the <c>Item</c>s appeared
- in the <c>ItemList</c>. Valid <c>Item</c>s may appear multiple
- times in the <c>ItemList</c>.
+ <p>If an <c>ItemList</c> is given, the result is an
+ <c><anno>InfoTupleList</anno></c>. The <c><anno>InfoTuple</anno></c>s in the
+ <c><anno>InfoTupleList</anno></c> will appear with the corresponding
+ <c><anno>Item</anno></c>s in the same order as the <c><anno>Item</anno></c>s appeared
+ in the <c><anno>ItemList</anno></c>. Valid <c><anno>Item</anno></c>s may appear multiple
+ times in the <c><anno>ItemList</anno></c>.
</p>
- <note><p>If <c>registered_name</c> is part of an <c>ItemList</c>
+ <note><p>If <c>registered_name</c> is part of an <c><anno>ItemList</anno></c>
and the process has no name registered a
- <c>{registered_name, []}</c> <c>InfoTuple</c> <em>will</em>
- appear in the resulting <c>InfoTupleList</c>. This
- behavior is different than when
- <c>ItemSpec == registered_name</c>, and than when
+ <c>{registered_name, []}</c> <c><anno>InfoTuple</anno></c> <em>will</em>
+ appear in the resulting <c><anno>InfoTupleList</anno></c>. This
+ behavior is different than when a single
+ <c>Item =:= registered_name</c> is given, and than when
<c>process_info/1</c> is used.
</p></note>
- <p>Currently the following <c>InfoTuple</c>s with corresponding
- <c>Item</c>s are valid:</p>
+ <p>Currently the following <c><anno>InfoTuple</anno></c>s with corresponding
+ <c><anno>Item</anno></c>s are valid:</p>
<taglist>
- <tag><c>{backtrace, Bin}</c></tag>
+ <tag><c>{backtrace, <anno>Bin</anno>}</c></tag>
<item>
- <p>The binary <c>Bin</c> contains the same information as
+ <p>The binary <c><anno>Bin</anno></c> contains the same information as
the output from
- <c>erlang:process_display(Pid, backtrace)</c>. Use
+ <c>erlang:process_display(<anno>Pid</anno>, backtrace)</c>. Use
<c>binary_to_list/1</c> to obtain the string of characters
from the binary.</p>
</item>
- <tag><c>{binary, BinInfo}</c></tag>
+ <tag><c>{binary, <anno>BinInfo</anno>}</c></tag>
<item>
- <p><c>BinInfo</c> is a list containing miscellaneous information
+ <p><c><anno>BinInfo</anno></c> is a list containing miscellaneous information
about binaries currently being referred to by this process.
- This <c>InfoTuple</c> may be changed or removed without prior
+ This <c><anno>InfoTuple</anno></c> may be changed or removed without prior
notice.</p>
</item>
- <tag><c>{catchlevel, CatchLevel}</c></tag>
+ <tag><c>{catchlevel, <anno>CatchLevel</anno>}</c></tag>
<item>
- <p><c>CatchLevel</c> is the number of currently active
- catches in this process. This <c>InfoTuple</c> may be
+ <p><c><anno>CatchLevel</anno></c> is the number of currently active
+ catches in this process. This <c><anno>InfoTuple</anno></c> may be
changed or removed without prior notice.</p>
</item>
- <tag><c>{current_function, {Module, Function, Arity}}</c></tag>
+ <tag><c>{current_function, {<anno>Module</anno>, <anno>Function</anno>, <anno>Arity</anno>}}</c></tag>
<item>
- <p><c>Module</c>, <c>Function</c>, <c>Arity</c> is
+ <p><c><anno>Module</anno></c>, <c><anno>Function</anno></c>, <c><anno>Arity</anno></c> is
the current function call of the process.</p>
</item>
- <tag><c>{current_location, {Module, Function, Arity, Location}}</c></tag>
+ <tag><c>{current_location, {<anno>Module</anno>, <anno>Function</anno>, <anno>Arity</anno>, <anno>Location</anno>}}</c></tag>
<item>
- <p><c>Module</c>, <c>Function</c>, <c>Arity</c> is
+ <p><c><anno>Module</anno></c>, <c><anno>Function</anno></c>, <c><anno>Arity</anno></c> is
the current function call of the process.
- <c>Location</c> is a list of two-tuples that describes the
+ <c><anno>Location</anno></c> is a list of two-tuples that describes the
location in the source code.
</p>
</item>
- <tag><c>{current_stacktrace, Stack}</c></tag>
+ <tag><c>{current_stacktrace, <anno>Stack</anno>}</c></tag>
<item>
<p>Return the current call stack back-trace (<em>stacktrace</em>)
of the process. The stack has the same format as returned by
<seealso marker="#get_stacktrace/0">erlang:get_stacktrace/0</seealso>.
</p>
</item>
- <tag><c>{dictionary, Dictionary}</c></tag>
+ <tag><c>{dictionary, <anno>Dictionary</anno>}</c></tag>
<item>
- <p><c>Dictionary</c> is the dictionary of the process.</p>
+ <p><c><anno>Dictionary</anno></c> is the dictionary of the process.</p>
</item>
- <tag><c>{error_handler, Module}</c></tag>
+ <tag><c>{error_handler, <anno>Module</anno>}</c></tag>
<item>
- <p><c>Module</c> is the error handler module used by
+ <p><c><anno>Module</anno></c> is the error handler module used by
the process (for undefined function calls, for example).</p>
</item>
- <tag><c>{garbage_collection, GCInfo}</c></tag>
+ <tag><c>{garbage_collection, <anno>GCInfo</anno>}</c></tag>
<item>
- <p><c>GCInfo</c> is a list which contains miscellaneous
+ <p><c><anno>GCInfo</anno></c> is a list which contains miscellaneous
information about garbage collection for this process.
- The content of <c>GCInfo</c> may be changed without
+ The content of <c><anno>GCInfo</anno></c> may be changed without
prior notice.</p>
</item>
- <tag><c>{group_leader, GroupLeader}</c></tag>
+ <tag><c>{group_leader, <anno>GroupLeader</anno>}</c></tag>
<item>
- <p><c>GroupLeader</c> is group leader for the IO of
+ <p><c><anno>GroupLeader</anno></c> is group leader for the IO of
the process.</p>
</item>
- <tag><c>{heap_size, Size}</c></tag>
+ <tag><c>{heap_size, <anno>Size</anno>}</c></tag>
<item>
- <p><c>Size</c> is the size in words of youngest heap generation
+ <p><c><anno>Size</anno></c> is the size in words of youngest heap generation
of the process. This generation currently include the stack
of the process. This information is highly implementation
dependent, and may change if the implementation change.
@@ -3947,9 +3534,9 @@ os_prompt%</pre>
the initial function call with which the process was
spawned.</p>
</item>
- <tag><c>{links, Pids}</c></tag>
+ <tag><c>{links, <anno>Pids</anno>}</c></tag>
<item>
- <p><c>Pids</c> is a list of pids, with processes to
+ <p><c><anno>Pids</anno></c> is a list of pids, with processes to
which the process has a link.</p>
</item>
<tag><c>{last_calls, false|Calls}</c></tag>
@@ -3960,139 +3547,131 @@ os_prompt%</pre>
If call saving is active, a list is returned, in which
the last element is the most recent called.</p>
</item>
- <tag><c>{memory, Size}</c></tag>
+ <tag><c>{memory, <anno>Size</anno>}</c></tag>
<item>
- <p><c>Size</c> is the size in bytes of the process. This
+ <p><c><anno>Size</anno></c> is the size in bytes of the process. This
includes call stack, heap and internal structures.</p>
</item>
- <tag><c>{message_binary, BinInfo}</c></tag>
+ <tag><c>{message_queue_len, <anno>MessageQueueLen</anno>}</c></tag>
<item>
- <p><c>BinInfo</c> is a list containing miscellaneous information
- about binaries currently being referred to by the message
- area. This <c>InfoTuple</c> is only valid on an emulator
- using the hybrid heap type. This <c>InfoTuple</c> may be
- changed or removed without prior notice.</p>
- </item>
- <tag><c>{message_queue_len, MessageQueueLen}</c></tag>
- <item>
- <p><c>MessageQueueLen</c> is the number of messages
+ <p><c><anno>MessageQueueLen</anno></c> is the number of messages
currently in the message queue of the process. This is
- the length of the list <c>MessageQueue</c> returned as
+ the length of the list <c><anno>MessageQueue</anno></c> returned as
the info item <c>messages</c> (see below).</p>
</item>
- <tag><c>{messages, MessageQueue}</c></tag>
+ <tag><c>{messages, <anno>MessageQueue</anno>}</c></tag>
<item>
- <p><c>MessageQueue</c> is a list of the messages to
+ <p><c><anno>MessageQueue</anno></c> is a list of the messages to
the process, which have not yet been processed.</p>
</item>
- <tag><c>{min_heap_size, MinHeapSize}</c></tag>
+ <tag><c>{min_heap_size, <anno>MinHeapSize</anno>}</c></tag>
<item>
- <p><c>MinHeapSize</c> is the minimum heap size for the process.</p>
+ <p><c><anno>MinHeapSize</anno></c> is the minimum heap size for the process.</p>
</item>
- <tag><c>{min_bin_vheap_size, MinBinVHeapSize}</c></tag>
+ <tag><c>{min_bin_vheap_size, <anno>MinBinVHeapSize</anno>}</c></tag>
<item>
- <p><c>MinBinVHeapSize</c> is the minimum binary virtual heap size for the process.</p>
+ <p><c><anno>MinBinVHeapSize</anno></c> is the minimum binary virtual heap size for the process.</p>
</item>
- <tag><c>{monitored_by, Pids}</c></tag>
+ <tag><c>{monitored_by, <anno>Pids</anno>}</c></tag>
<item>
<p>A list of pids that are monitoring the process (with
<c>monitor/2</c>).</p>
</item>
- <tag><c>{monitors, Monitors}</c></tag>
+ <tag><c>{monitors, <anno>Monitors</anno>}</c></tag>
<item>
<p>A list of monitors (started by <c>monitor/2</c>)
that are active for the process. For a local process
monitor or a remote process monitor by pid, the list item
- is <c>{process, Pid}</c>, and for a remote process
+ is <c>{process, <anno>Pid</anno>}</c>, and for a remote process
monitor by name, the list item is
- <c>{process, {RegName, Node}}</c>.</p>
+ <c>{process, {<anno>RegName</anno>, <anno>Node</anno>}}</c>.</p>
</item>
<tag><c>{priority, Level}</c></tag>
<item>
- <p><c>Level</c> is the current priority level for
+ <p><c><anno>Level</anno></c> is the current priority level for
the process. For more information on priorities see
<seealso marker="#process_flag_priority">process_flag(priority, Level)</seealso>.</p>
</item>
- <tag><c>{reductions, Number}</c></tag>
+ <tag><c>{reductions, <anno>Number</anno>}</c></tag>
<item>
- <p><c>Number</c> is the number of reductions executed by
+ <p><c><anno>Number</anno></c> is the number of reductions executed by
the process.</p>
</item>
- <tag><c>{registered_name, Atom}</c></tag>
+ <tag><c>{registered_name, <anno>Atom</anno>}</c></tag>
<item>
- <p><c>Atom</c> is the registered name of the process. If
+ <p><c><anno>Atom</anno></c> is the registered name of the process. If
the process has no registered name, this tuple is not
present in the list.</p>
</item>
- <tag><c>{sequential_trace_token, [] | SequentialTraceToken}</c></tag>
+ <tag><c>{sequential_trace_token, [] | <anno>SequentialTraceToken</anno>}</c></tag>
<item>
- <p><c>SequentialTraceToken</c> the sequential trace token for
- the process. This <c>InfoTuple</c> may be changed or removed
+ <p><c><anno>SequentialTraceToken</anno></c> the sequential trace token for
+ the process. This <c><anno>InfoTuple</anno></c> may be changed or removed
without prior notice.</p>
</item>
- <tag><c>{stack_size, Size}</c></tag>
+ <tag><c>{stack_size, <anno>Size</anno>}</c></tag>
<item>
- <p><c>Size</c> is the stack size of the process in words.</p>
+ <p><c><anno>Size</anno></c> is the stack size of the process in words.</p>
</item>
- <tag><c>{status, Status}</c></tag>
+ <tag><c>{status, <anno>Status</anno>}</c></tag>
<item>
- <p><c>Status</c> is the status of the process. <c>Status</c>
+ <p><c><anno>Status</anno></c> is the status of the process. <c><anno>Status</anno></c>
is <c>exiting</c>, <c>garbage_collecting</c>,
<c>waiting</c> (for a message), <c>running</c>,
<c>runnable</c> (ready to run, but another process is
running), or <c>suspended</c> (suspended on a "busy" port
or by the <c>erlang:suspend_process/[1,2]</c> BIF).</p>
</item>
- <tag><c>{suspending, SuspendeeList}</c></tag>
+ <tag><c>{suspending, <anno>SuspendeeList</anno>}</c></tag>
<item>
- <p><c>SuspendeeList</c> is a list of <c>{Suspendee,
- ActiveSuspendCount, OutstandingSuspendCount}</c> tuples.
- <c>Suspendee</c> is the pid of a process that have been or is to
- be suspended by the process identified by <c>Pid</c> via the
+ <p><c><anno>SuspendeeList</anno></c> is a list of <c>{<anno>Suspendee</anno>,
+ <anno>ActiveSuspendCount</anno>, <anno>OutstandingSuspendCount</anno>}</c> tuples.
+ <c><anno>Suspendee</anno></c> is the pid of a process that have been or is to
+ be suspended by the process identified by <c><anno>Pid</anno></c> via the
<seealso marker="#suspend_process/2">erlang:suspend_process/2</seealso>
BIF, or the
<seealso marker="#suspend_process/1">erlang:suspend_process/1</seealso>
- BIF. <c>ActiveSuspendCount</c> is the number of times the
- <c>Suspendee</c> has been suspended by <c>Pid</c>.
- <c>OutstandingSuspendCount</c> is the number of not yet
- completed suspend requests sent by <c>Pid</c>. That is,
- if <c>ActiveSuspendCount /= 0</c>, <c>Suspendee</c> is
+ BIF. <c><anno>ActiveSuspendCount</anno></c> is the number of times the
+ <c><anno>Suspendee</anno></c> has been suspended by <c><anno>Pid</anno></c>.
+ <c><anno>OutstandingSuspendCount</anno></c> is the number of not yet
+ completed suspend requests sent by <c><anno>Pid</anno></c>. That is,
+ if <c><anno>ActiveSuspendCount</anno> =/= 0</c>, <c><anno>Suspendee</anno></c> is
currently in the suspended state, and if
- <c>OutstandingSuspendCount /= 0</c> the <c>asynchronous</c>
+ <c><anno>OutstandingSuspendCount</anno> =/= 0</c> the <c>asynchronous</c>
option of <c>erlang:suspend_process/2</c> has been used and
- the suspendee has not yet been suspended by <c>Pid</c>.
- Note that the <c>ActiveSuspendCount</c> and
- <c>OutstandingSuspendCount</c> are not the total suspend count
- on <c>Suspendee</c>, only the parts contributed by <c>Pid</c>.
+ the suspendee has not yet been suspended by <c><anno>Pid</anno></c>.
+ Note that the <c><anno>ActiveSuspendCount</anno></c> and
+ <c><anno>OutstandingSuspendCount</anno></c> are not the total suspend count
+ on <c><anno>Suspendee</anno></c>, only the parts contributed by <c>Pid</c>.
</p>
</item>
- <tag><c>{total_heap_size, Size}</c></tag>
+ <tag><c>{total_heap_size, <anno>Size</anno>}</c></tag>
<item>
- <p><c>Size</c> is the total size in words of all heap
+ <p><c><anno>Size</anno></c> is the total size in words of all heap
fragments of the process. This currently include the stack
of the process.
</p>
</item>
- <tag><c>{trace, InternalTraceFlags}</c></tag>
+ <tag><c>{trace, <anno>InternalTraceFlags</anno>}</c></tag>
<item>
- <p><c>InternalTraceFlags</c> is an integer representing
- internal trace flag for this process. This <c>InfoTuple</c>
+ <p><c><anno>InternalTraceFlags</anno></c> is an integer representing
+ internal trace flag for this process. This <c><anno>InfoTuple</anno></c>
may be changed or removed without prior notice.</p>
</item>
- <tag><c>{trap_exit, Boolean}</c></tag>
+ <tag><c>{trap_exit, <anno>Boolean</anno>}</c></tag>
<item>
- <p><c>Boolean</c> is <c>true</c> if the process is trapping
+ <p><c><anno>Boolean</anno></c> is <c>true</c> if the process is trapping
exits, otherwise it is <c>false</c>.</p>
</item>
</taglist>
<p>Note however, that not all implementations support every one
- of the above <c>Items</c>.</p>
- <p>Failure: <c>badarg</c> if <c>Pid</c> is not a local process,
- or if <c>Item</c> is not a valid <c>Item</c>.</p>
+ of the above <c><anno>Item</anno></c>s.</p>
+ <p>Failure: <c>badarg</c> if <c><anno>Pid</anno></c> is not a local process,
+ or if <c><anno>Item</anno></c> is not a valid <c><anno>Item</anno></c>.</p>
</desc>
</func>
<func>
- <name>processes() -> [pid()]</name>
+ <name name="processes" arity="0"/>
<fsummary>All processes</fsummary>
<desc>
<p>Returns a list of process identifiers corresponding to
@@ -4109,13 +3688,10 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>purge_module(Module) -> void()</name>
+ <name name="purge_module" arity="1"/>
<fsummary>Remove old code for a module</fsummary>
- <type>
- <v>Module = atom()</v>
- </type>
<desc>
- <p>Removes old code for <c>Module</c>. Before this BIF is used,
+ <p>Removes old code for <c><anno>Module</anno></c>. Before this BIF is used,
<c>erlang:check_process_code/2</c> should be called to check
that no processes are executing old code in the module.</p>
<warning>
@@ -4124,20 +3700,17 @@ os_prompt%</pre>
used elsewhere.</p>
</warning>
<p>Failure: <c>badarg</c> if there is no old code for
- <c>Module</c>.</p>
+ <c><anno>Module</anno></c>.</p>
</desc>
</func>
<func>
- <name>put(Key, Val) -> OldVal | undefined</name>
+ <name name="put" arity="2"/>
<fsummary>Add a new value to the process dictionary</fsummary>
- <type>
- <v>Key = Val = OldVal = term()</v>
- </type>
- <desc>
- <p>Adds a new <c>Key</c> to the process dictionary, associated
- with the value <c>Val</c>, and returns <c>undefined</c>. If
- <c>Key</c> already exists, the old value is deleted and
- replaced by <c>Val</c> and the function returns the old value.</p>
+ <desc>
+ <p>Adds a new <c><anno>Key</anno></c> to the process dictionary, associated
+ with the value <c><anno>Val</anno></c>, and returns <c>undefined</c>. If
+ <c><anno>Key</anno></c> already exists, the old value is deleted and
+ replaced by <c><anno>Val</anno></c> and the function returns the old value.</p>
<note>
<p>The values stored when <c>put</c> is evaluated within
the scope of a <c>catch</c> will not be retracted if a
@@ -4151,17 +3724,9 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>erlang:raise(Class, Reason, Stacktrace)</name>
+ <name name="raise" arity="3"/>
+ <type name="raise_stacktrace"/>
<fsummary>Stop execution with an exception of given class, reason and call stack backtrace</fsummary>
- <type>
- <v>Class = error | exit | throw</v>
- <v>Reason = term()</v>
- <v>Stacktrace = [{Module, Function, Arity | Args} | {Fun, Args}]</v>
- <v>&nbsp;Module = Function = atom()</v>
- <v>&nbsp;Arity = arity()</v>
- <v>&nbsp;Args = [term()]</v>
- <v>&nbsp;Fun = [fun()]</v>
- </type>
<desc>
<p>Stops the execution of the calling process with an
exception of given class, reason and call stack backtrace
@@ -4172,11 +3737,11 @@ os_prompt%</pre>
be avoided in applications, unless you know
very well what you are doing.</p>
</warning>
- <p><c>Class</c> is one of <c>error</c>, <c>exit</c> or
+ <p><c><anno>Class</anno></c> is one of <c>error</c>, <c>exit</c> or
<c>throw</c>, so if it were not for the stacktrace
- <c>erlang:raise(Class, Reason, Stacktrace)</c> is
- equivalent to <c>erlang:Class(Reason)</c>.
- <c>Reason</c> is any term and <c>Stacktrace</c> is a list as
+ <c>erlang:raise(<anno>Class</anno>, <anno>Reason</anno>, <anno>Stacktrace</anno>)</c> is
+ equivalent to <c>erlang:<anno>Class</anno>(<anno>Reason</anno>)</c>.
+ <c><anno>Reason</anno></c> is any term and <c><anno>Stacktrace</anno></c> is a list as
returned from <c>get_stacktrace()</c>, that is a list of
4-tuples <c>{Module, Function, Arity | Args,
Location}</c> where <c>Module</c> and <c>Function</c>
@@ -4193,24 +3758,21 @@ os_prompt%</pre>
terminate, it has no return value - unless the arguments are
invalid, in which case the function <em>returns the error reason</em>, that is <c>badarg</c>. If you want to be
really sure not to return you can call
- <c>error(erlang:raise(Class, Reason, Stacktrace))</c>
+ <c>error(erlang:raise(<anno>Class</anno>, <anno>Reason</anno>, <anno>Stacktrace</anno>))</c>
and hope to distinguish exceptions later.</p>
</desc>
</func>
<func>
- <name>erlang:read_timer(TimerRef) -> integer() >= 0 | false</name>
+ <name name="read_timer" arity="1"/>
<fsummary>Number of milliseconds remaining for a timer</fsummary>
- <type>
- <v>TimerRef = reference()</v>
- </type>
<desc>
- <p><c>TimerRef</c> is a timer reference returned by
+ <p><c><anno>TimerRef</anno></c> is a timer reference returned by
<seealso marker="#send_after/3">erlang:send_after/3</seealso>
or
<seealso marker="#start_timer/3">erlang:start_timer/3</seealso>.
If the timer is active, the function returns the time in
milliseconds left until the timer will expire, otherwise
- <c>false</c> (which means that <c>TimerRef</c> was never a
+ <c>false</c> (which means that <c><anno>TimerRef</anno></c> was never a
timer, that it has been cancelled, or that it has already
delivered its message).</p>
<p>See also
@@ -4221,14 +3783,11 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>erlang:ref_to_list(Ref) -> string()</name>
+ <name name="ref_to_list" arity="1"/>
<fsummary>Text representation of a reference</fsummary>
- <type>
- <v>Ref = reference()</v>
- </type>
<desc>
<p>Returns a string which corresponds to the text
- representation of <c>Ref</c>.</p>
+ representation of <c><anno>Ref</anno></c>.</p>
<warning>
<p>This BIF is intended for debugging and for use in
the Erlang operating system. It should not be used in
@@ -4237,33 +3796,25 @@ os_prompt%</pre>
</desc>
</func>
<func>
- <name>register(RegName, Pid | Port) -> true</name>
+ <name name="register" arity="2"/>
<fsummary>Register a name for a pid (or port)</fsummary>
- <type>
- <v>RegName = atom()</v>
- <v>Pid = pid()</v>
- <v>Port = port()</v>
- </type>
- <desc>
- <p>Associates the name <c>RegName</c> with a pid or a port
- identifier. <c>RegName</c>, which must be an atom, can be used
+ <desc>
+ <p>Associates the name <c><anno>RegName</anno></c> with a pid or a port
+ identifier. <c><anno>RegName</anno></c>, which must be an atom, can be used
instead of the pid / port identifier in the send operator
- (<c>RegName ! Message</c>).</p>
+ (<c><anno>RegName</anno> ! Message</c>).</p>
<pre>
> <input>register(db, Pid).</input>
true</pre>
- <p>Failure: <c>badarg</c> if <c>Pid</c> is not an existing,
- local process or port, if <c>RegName</c> is already in use,
+ <p>Failure: <c>badarg</c> if <c><anno>PidOrPort</anno></c> is not an existing,
+ local process or port, if <c><anno>RegName</anno></c> is already in use,
if the process or port is already registered (already has a
- name), or if <c>RegName</c> is the atom <c>undefined</c>.</p>
+ name), or if <c><anno>RegName</anno></c> is the atom <c>undefined</c>.</p>
</desc>
</func>
<func>
- <name>registered() -> [RegName]</name>
+ <name name="registered" arity="0"/>
<fsummary>All registered names</fsummary>
- <type>
- <v>RegName = atom()</v>
- </type>
<desc>
<p>Returns a list of names which have been registered using
<seealso marker="#register/2">register/2</seealso>.</p>
@@ -4273,22 +3824,19 @@ true</pre>
</desc>
</func>
<func>
- <name>erlang:resume_process(Suspendee) -> true</name>
+ <name name="resume_process" arity="1"/>
<fsummary>Resume a suspended process</fsummary>
- <type>
- <v>Suspendee = pid()</v>
- </type>
<desc>
<p>Decreases the suspend count on the process identified by
- <c>Suspendee</c>. <c>Suspendee</c> should previously have been
+ <c><anno>Suspendee</anno></c>. <c><anno>Suspendee</anno></c> should previously have been
suspended via
<seealso marker="#suspend_process/2">erlang:suspend_process/2</seealso>,
or
<seealso marker="#suspend_process/1">erlang:suspend_process/1</seealso>
- by the process calling <c>erlang:resume_process(Suspendee)</c>. When
- the suspend count on <c>Suspendee</c> reach zero, <c>Suspendee</c>
+ by the process calling <c>erlang:resume_process(<anno>Suspendee</anno>)</c>. When
+ the suspend count on <c><anno>Suspendee</anno></c> reach zero, <c><anno>Suspendee</anno></c>
will be resumed, i.e., the state of the <c>Suspendee</c> is changed
- from suspended into the state <c>Suspendee</c> was in before it was
+ from suspended into the state <c><anno>Suspendee</anno></c> was in before it was
suspended.
</p>
<warning>
@@ -4298,29 +3846,26 @@ true</pre>
<taglist>
<tag><c>badarg</c></tag>
<item>
- If <c>Suspendee</c> isn't a process identifier.
+ If <c><anno>Suspendee</anno></c> isn't a process identifier.
</item>
<tag><c>badarg</c></tag>
<item>
If the process calling <c>erlang:resume_process/1</c> had
not previously increased the suspend count on the process
- identified by <c>Suspendee</c>.
+ identified by <c><anno>Suspendee</anno></c>.
</item>
<tag><c>badarg</c></tag>
<item>
- If the process identified by <c>Suspendee</c> is not alive.
+ If the process identified by <c><anno>Suspendee</anno></c> is not alive.
</item>
</taglist>
</desc>
</func>
<func>
- <name>round(Number) -> integer()</name>
+ <name name="round" arity="1"/>
<fsummary>Return an integer by rounding a number</fsummary>
- <type>
- <v>Number = number()</v>
- </type>
<desc>
- <p>Returns an integer by rounding <c>Number</c>.</p>
+ <p>Returns an integer by rounding <c><anno>Number</anno></c>.</p>
<pre>
> <input>round(5.5).</input>
6</pre>
@@ -4328,7 +3873,7 @@ true</pre>
</desc>
</func>
<func>
- <name>self() -> pid()</name>
+ <name name="self" arity="0"/>
<fsummary>Pid of the calling process</fsummary>
<desc>
<p>Returns the pid (process identifier) of the calling process.</p>
@@ -4339,33 +3884,21 @@ true</pre>
</desc>
</func>
<func>
- <name>erlang:send(Dest, Msg) -> Msg</name>
+ <name name="send" arity="2"/>
<fsummary>Send a message</fsummary>
- <type>
- <v>Dest = pid() | port() | RegName | {RegName, Node}</v>
- <v>Msg = term()</v>
- <v>&nbsp;RegName = atom()</v>
- <v>&nbsp;Node = node()</v>
- </type>
- <desc>
- <p>Sends a message and returns <c>Msg</c>. This is the same as
- <c>Dest ! Msg</c>.</p>
- <p><c>Dest</c> may be a remote or local pid, a (local) port, a
- locally registered name, or a tuple <c>{RegName, Node}</c>
+ <type name="dst"/>
+ <desc>
+ <p>Sends a message and returns <c><anno>Msg</anno></c>. This is the same as
+ <c><anno>Dest</anno> ! <anno>Msg</anno></c>.</p>
+ <p><c><anno>Dest</anno></c> may be a remote or local pid, a (local) port, a
+ locally registered name, or a tuple <c>{<anno>RegName</anno>, <anno>Node</anno>}</c>
for a registered name at another node.</p>
</desc>
</func>
<func>
- <name>erlang:send(Dest, Msg, [Option]) -> Res</name>
+ <name name="send" arity="3"/>
+ <type name="dst"/>
<fsummary>Send a message conditionally</fsummary>
- <type>
- <v>Dest = pid() | port() | RegName | {RegName, Node}</v>
- <v>&nbsp;RegName = atom()</v>
- <v>&nbsp;Node = node()</v>
- <v>Msg = term()</v>
- <v>Option = nosuspend | noconnect</v>
- <v>Res = ok | nosuspend | noconnect</v>
- </type>
<desc>
<p>Sends a message and returns <c>ok</c>, or does not send
the message but returns something else (see below). Otherwise
@@ -4395,28 +3928,24 @@ true</pre>
</desc>
</func>
<func>
- <name>erlang:send_after(Time, Dest, Msg) -> TimerRef</name>
+ <name name="send_after" arity="3"/>
+ <type_desc variable="Time">0 &lt;= Time &lt;= 4294967295</type_desc>
<fsummary>Start a timer</fsummary>
- <type>
- <v>Time = integer() >= 0</v>
- <v>&nbsp;0 &lt;= Time &lt;= 4294967295</v>
- <v>Dest = pid() | RegName </v>
- <v>&nbsp;LocalPid = pid() (of a process, alive or dead, on the local node)</v>
- <v>Msg = term()</v>
- <v>TimerRef = reference()</v>
- </type>
<desc>
<p>Starts a timer which will send the message <c>Msg</c>
- to <c>Dest</c> after <c>Time</c> milliseconds.</p>
- <p>If <c>Dest</c> is an atom, it is supposed to be the name of
+ to <c><anno>Dest</anno></c> after <c><anno>Time</anno></c> milliseconds.</p>
+ <p>If <c><anno>Dest</anno></c> is a <c>pid()</c> it has to be a <c>pid()</c> of a local process, dead or alive.</p>
+ <p>The <c><anno>Time</anno></c> value can, in the current implementation, not be greater than 4294967295.</p>
+ <p>If <c><anno>Dest</anno></c> is an <c>atom()</c>, it is supposed to be the name of
a registered process. The process referred to by the name is
looked up at the time of delivery. No error is given if
the name does not refer to a process.</p>
- <p>If <c>Dest</c> is a pid, the timer will be automatically
- canceled if the process referred to by the pid is not alive,
+
+ <p>If <c><anno>Dest</anno></c> is a <c>pid()</c>, the timer will be automatically
+ canceled if the process referred to by the <c>pid()</c> is not alive,
or when the process exits. This feature was introduced in
erts version 5.4.11. Note that timers will not be
- automatically canceled when <c>Dest</c> is an atom.</p>
+ automatically canceled when <c><anno>Dest</anno></c> is an <c>atom</c>.</p>
<p>See also
<seealso marker="#start_timer/3">erlang:start_timer/3</seealso>,
<seealso marker="#cancel_timer/1">erlang:cancel_timer/1</seealso>,
@@ -4516,32 +4045,25 @@ true</pre>
</desc>
</func>
<func>
- <name>setelement(Index, Tuple1, Value) -> Tuple2</name>
+ <name name="setelement" arity="3"/>
+ <type_desc variable="Index">1..tuple_size(<anno>Tuple1</anno>)</type_desc>
<fsummary>Set Nth element of a tuple</fsummary>
- <type>
- <v>Index = 1..tuple_size(Tuple1)</v>
- <v>Tuple1 = Tuple2 = tuple()</v>
- <v>Value = term()</v>
- </type>
- <desc>
- <p>Returns a tuple which is a copy of the argument <c>Tuple1</c>
- with the element given by the integer argument <c>Index</c>
+ <desc>
+ <p>Returns a tuple which is a copy of the argument <c><anno>Tuple1</anno></c>
+ with the element given by the integer argument <c><anno>Index</anno></c>
(the first element is the element with index 1) replaced by
- the argument <c>Value</c>.</p>
+ the argument <c><anno>Value</anno></c>.</p>
<pre>
> <input>setelement(2, {10, green, bottles}, red).</input>
{10,red,bottles}</pre>
</desc>
</func>
<func>
- <name>size(Item) -> integer() >= 0</name>
+ <name name="size" arity="1"/>
<fsummary>Size of a tuple or binary</fsummary>
- <type>
- <v>Item = tuple() | binary()</v>
- </type>
<desc>
<p>Returns an integer which is the size of the argument
- <c>Item</c>, which must be either a tuple or a binary.</p>
+ <c><anno>Item</anno></c>, which must be either a tuple or a binary.</p>
<pre>
> <input>size({morni, mulle, bwange}).</input>
3</pre>
@@ -4569,20 +4091,16 @@ true</pre>
</desc>
</func>
<func>
- <name>spawn(Module, Function, Args) -> pid()</name>
+ <name name="spawn" arity="3"/>
<fsummary>Create a new process with a function as entry point</fsummary>
- <type>
- <v>Module = Function = atom()</v>
- <v>Args = [term()]</v>
- </type>
<desc>
<p>Returns the pid of a new process started by the application
- of <c>Module:Function</c> to <c>Args</c>. The new process
+ of <c><anno>Module</anno>:<anno>Function</anno></c> to <c><anno>Args</anno></c>. The new process
created will be placed in the system scheduler queue and be
run some time later.</p>
- <p><c>error_handler:undefined_function(Module, Function, Args)</c> is evaluated by the new process if
- <c>Module:Function/Arity</c> does not exist (where
- <c>Arity</c> is the length of <c>Args</c>). The error handler
+ <p><c>error_handler:undefined_function(<anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>)</c> is evaluated by the new process if
+ <c><anno>Module</anno>:<anno>Function</anno>/Arity</c> does not exist (where
+ <c>Arity</c> is the length of <c><anno>Args</anno></c>). The error handler
can be redefined (see
<seealso marker="#process_flag/2">process_flag/2</seealso>).
If <c>error_handler</c> is undefined, or the user has
@@ -4629,15 +4147,11 @@ true</pre>
</desc>
</func>
<func>
- <name>spawn_link(Module, Function, Args) -> pid()</name>
+ <name name="spawn_link" arity="3"/>
<fsummary>Create and link to a new process with a function as entry point</fsummary>
- <type>
- <v>Module = Function = atom()</v>
- <v>Args = [term()]</v>
- </type>
<desc>
<p>Returns the pid of a new process started by the application
- of <c>Module:Function</c> to <c>Args</c>. A link is created
+ of <c><anno>Module</anno>:<anno>Function</anno></c> to <c><anno>Args</anno></c>. A link is created
between the calling process and the new process, atomically.
Otherwise works like
<seealso marker="#spawn/3">spawn/3</seealso>.</p>
@@ -4816,15 +4330,12 @@ true</pre>
</desc>
</func>
<func>
- <name>split_binary(Bin, Pos) -> {Bin1, Bin2}</name>
+ <name name="split_binary" arity="2"/>
+ <type_desc variable="Pos">0..byte_size(Bin)</type_desc>
<fsummary>Split a binary into two</fsummary>
- <type>
- <v>Bin = Bin1 = Bin2 = binary()</v>
- <v>Pos = 0..byte_size(Bin)</v>
- </type>
<desc>
<p>Returns a tuple containing the binaries which are the result
- of splitting <c>Bin</c> into two parts at position <c>Pos</c>.
+ of splitting <c><anno>Bin</anno></c> into two parts at position <c><anno>Pos</anno></c>.
This is not a destructive operation. After the operation,
there will be three binaries altogether.</p>
<pre>
@@ -4841,30 +4352,24 @@ true</pre>
</desc>
</func>
<func>
- <name>erlang:start_timer(Time, Dest, Msg) -> TimerRef</name>
+ <name name="start_timer" arity="3"/>
+ <type_desc variable="Time">0 &lt;= Time &lt;= 4294967295</type_desc>
<fsummary>Start a timer</fsummary>
- <type>
- <v>Time = integer() >= 0</v>
- <v>&nbsp;0 &lt;= Time &lt;= 4294967295</v>
- <v>Dest = LocalPid | RegName </v>
- <v>&nbsp;LocalPid = pid() (of a process, alive or dead, on the local node)</v>
- <v>&nbsp;RegName = atom()</v>
- <v>Msg = term()</v>
- <v>TimerRef = reference()</v>
- </type>
<desc>
<p>Starts a timer which will send the message
- <c>{timeout, TimerRef, Msg}</c> to <c>Dest</c>
- after <c>Time</c> milliseconds.</p>
- <p>If <c>Dest</c> is an atom, it is supposed to be the name of
+ <c>{timeout, <anno>TimerRef</anno>, <anno>Msg</anno>}</c> to <c><anno>Dest</anno></c>
+ after <c><anno>Time</anno></c> milliseconds.</p>
+ <p>If <c><anno>Dest</anno></c> is a <c>pid()</c> it has to be a <c>pid()</c> of a local process, dead or alive.</p>
+ <p>The <c><anno>Time</anno></c> value can, in the current implementation, not be greater than 4294967295.</p>
+ <p>If <c><anno>Dest</anno></c> is an <c>atom()</c>, it is supposed to be the name of
a registered process. The process referred to by the name is
looked up at the time of delivery. No error is given if
the name does not refer to a process.</p>
- <p>If <c>Dest</c> is a pid, the timer will be automatically
- canceled if the process referred to by the pid is not alive,
+ <p>If <c><anno>Dest</anno></c> is a <c>pid()</c>, the timer will be automatically
+ canceled if the process referred to by the <c>pid()</c> is not alive,
or when the process exits. This feature was introduced in
erts version 5.4.11. Note that timers will not be
- automatically canceled when <c>Dest</c> is an atom.</p>
+ automatically canceled when <c><anno>Dest</anno></c> is an <c>atom()</c>.</p>
<p>See also
<seealso marker="#send_after/3">erlang:send_after/3</seealso>,
<seealso marker="#cancel_timer/1">erlang:cancel_timer/1</seealso>,
@@ -4875,94 +4380,167 @@ true</pre>
</desc>
</func>
<func>
- <name>statistics(Type) -> Res</name>
- <fsummary>Information about the system</fsummary>
- <type>
- <v>Type, Res -- see below</v>
- </type>
+ <name name="statistics" arity="1" clause_i="1"/>
+ <fsummary>Information about context switches</fsummary>
<desc>
- <p>Returns information about the system as specified by
- <c>Type</c>:</p>
- <taglist>
- <tag><c>context_switches</c></tag>
- <item>
- <p>Returns <c>{ContextSwitches, 0}</c>, where
- <c>ContextSwitches</c> is the total number of context
- switches since the system started.</p>
- </item>
- <tag><marker id="statistics_exact_reductions"><c>exact_reductions</c></marker></tag>
- <item>
- <p>Returns
- <c>{Total_Exact_Reductions, Exact_Reductions_Since_Last_Call}</c>.</p>
- <p><em>NOTE:</em><c>statistics(exact_reductions)</c> is
- a more expensive operation than
- <seealso marker="#statistics_reductions">statistics(reductions)</seealso>
- especially on an Erlang machine with SMP support.</p>
- </item>
- <tag><c>garbage_collection</c></tag>
- <item>
- <p>Returns <c>{Number_of_GCs, Words_Reclaimed, 0}</c>. This
- information may not be valid for all implementations.</p>
- </item>
- <tag><c>io</c></tag>
- <item>
- <p>Returns <c>{{input, Input}, {output, Output}}</c>,
- where <c>Input</c> is the total number of bytes received
- through ports, and <c>Output</c> is the total number of
- bytes output to ports.</p>
- </item>
- <tag><marker id="statistics_reductions"><c>reductions</c></marker></tag>
- <item>
- <p>Returns
- <c>{Total_Reductions, Reductions_Since_Last_Call}</c>.</p>
- <p><em>NOTE:</em> From erts version 5.5 (OTP release R11B)
- this value does not include reductions performed in current
- time slices of currently scheduled processes. If an
- exact value is wanted, use
- <seealso marker="#statistics_exact_reductions">statistics(exact_reductions)</seealso>.</p>
- </item>
- <tag><c>run_queue</c></tag>
- <item>
- <p>Returns the length of the run queue, that is, the number
- of processes that are ready to run.</p>
- </item>
- <tag><c>runtime</c></tag>
- <item>
- <p>Returns <c>{Total_Run_Time, Time_Since_Last_Call}</c>.
- Note that the run-time is the sum of the run-time for all
- threads in the Erlang run-time system and may therefore be greater
- than the wall-clock time.</p>
- </item>
- <tag><c>wall_clock</c></tag>
- <item>
- <p>Returns
- <c>{Total_Wallclock_Time, Wallclock_Time_Since_Last_Call}</c>.
- <c>wall_clock</c> can be used in the same manner as
- <c>runtime</c>, except that real time is measured as
- opposed to runtime or CPU time.</p>
- </item>
- </taglist>
- <p>All times are in milliseconds.</p>
+ <p><c><anno>ContextSwitches</anno></c> is the total number of context
+ switches since the system started.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="statistics" arity="1" clause_i="2"/>
+ <fsummary>Information about exact reductions</fsummary>
+ <desc>
+ <marker id="statistics_exact_reductions"></marker>
+ <note><p><c>statistics(exact_reductions)</c> is
+ a more expensive operation than
+ <seealso marker="#statistics_reductions">statistics(reductions)</seealso>
+ especially on an Erlang machine with SMP support.</p>
+ </note>
+ </desc>
+ </func>
+ <func>
+ <name name="statistics" arity="1" clause_i="3"/>
+ <fsummary>Information about garbage collection</fsummary>
+ <desc>
+ <p>This information may not be valid for all implementations.</p>
+ <pre>
+> <input>statistics(garbage_collection).</input>
+{85,23961,0}
+</pre>
+ </desc>
+ </func>
+ <func>
+ <name name="statistics" arity="1" clause_i="4"/>
+ <fsummary>Information about io</fsummary>
+ <desc>
+ <p><c><anno>Input</anno></c> is the total number of bytes received
+ through ports, and <c><anno>Output</anno></c> is the total number of
+ bytes output to ports.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="statistics" arity="1" clause_i="5"/>
+ <fsummary>Information about reductions</fsummary>
+ <desc>
+ <marker id="statistics_reductions"></marker>
+ <note>
+ <p>Since erts-5.5 (OTP release R11B)
+ this value does not include reductions performed in current
+ time slices of currently scheduled processes. If an
+ exact value is wanted, use
+ <seealso marker="#statistics_exact_reductions">statistics(exact_reductions)</seealso>.</p>
+ </note>
<pre>
-> <input>statistics(runtime).</input>
-{1690,1620}
> <input>statistics(reductions).</input>
{2046,11}
-> <input>statistics(garbage_collection).</input>
-{85,23961,0}</pre>
+</pre>
+ </desc>
+ </func>
+ <func>
+ <name name="statistics" arity="1" clause_i="6"/>
+ <fsummary>Information about the run-queue</fsummary>
+ <desc>
+ <p>Returns the length of the run queue, that is, the number
+ of processes that are ready to run.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="statistics" arity="1" clause_i="7"/>
+ <fsummary>Information about run-time</fsummary>
+ <desc>
+ <p>Note that the run-time is the sum of the run-time for all
+ threads in the Erlang run-time system and may therefore be greater
+ than the wall-clock time.</p>
+ <pre>
+> <input>statistics(runtime).</input>
+{1690,1620}
+</pre>
</desc>
</func>
<func>
- <name>erlang:suspend_process(Suspendee, OptList) -> boolean()</name>
+ <name name="statistics" arity="1" clause_i="8"/>
+ <fsummary>Information about each schedulers work time</fsummary>
+ <desc>
+ <marker id="statistics_scheduler_wall_time"></marker>
+ <p>
+ Returns a list of tuples with <c>{<anno>SchedulerId</anno>,
+ <anno>ActiveTime</anno>, <anno>TotalTime</anno>}</c>, where
+ <c>SchedulerId</c> is an integer id of the scheduler, <c>ActiveTime</c> is
+ the duration the scheduler has been busy, <c>TotalTime</c> is the total time duration since
+ <seealso marker="#system_flag_scheduler_wall_time">scheduler_wall_time</seealso>
+ activation. The time unit is not defined and may be subject to change
+ between releases, operating systems and system restarts.
+ <c>scheduler_wall_time</c> should only be used to calculate relative
+ values for scheduler-utilization. <c>ActiveTime</c> can never exceed <c>TotalTime</c>.
+ </p>
+
+ <p>The definition of a busy scheduler is when it is not idle or not
+ scheduling (selecting) a process or port, meaning; executing process
+ code, executing linked-in-driver or NIF code, executing
+ built-in-functions or any other runtime handling, garbage collecting
+ or handling any other memory management. Note, a scheduler may also be
+ busy even if the operating system has scheduled out the scheduler
+ thread.
+ </p>
+
+ <p>
+ Returns <c>undefined</c> if the system flag
+ <seealso marker="#system_flag_scheduler_wall_time">scheduler_wall_time</seealso>
+ is turned off.
+ </p>
+
+ <p>The list of scheduler information is unsorted and may appear in different order
+ between calls.
+ </p>
+ <p>Using <c>scheduler_wall_time</c> to calculate scheduler utilization.</p>
+<pre>
+> <input>erlang:system_flag(scheduler_wall_time, true).</input>
+false
+> <input>Ts0 = lists:sort(erlang:statistics(scheduler_wall_time)), ok.</input>
+ok
+</pre>
+ <p>Some time later we will take another snapshot and calculate scheduler-utilization per scheduler.</p>
+<pre>
+> <input>Ts1 = lists:sort(erlang:statistics(scheduler_wall_time)), ok.</input>
+ok
+> <input>lists:map(fun({{I, A0, T0}, {I, A1, T1}}) ->
+ {I, (A1 - A0)/(T1 - T0)} end, lists:zip(Ts0,Ts1)).</input>
+[{1,0.9743474730177548},
+ {2,0.9744843782751444},
+ {3,0.9995902361669045},
+ {4,0.9738012596572161},
+ {5,0.9717956667018103},
+ {6,0.9739235846420741},
+ {7,0.973237033077876},
+ {8,0.9741297293248656}]
+</pre>
+ <p>Using the same snapshots to calculate a total scheduler-utilization.</p>
+<pre>
+> <input>{A, T} = lists:foldl(fun({{_, A0, T0}, {_, A1, T1}}, {Ai,Ti}) ->
+ {Ai + (A1 - A0), Ti + (T1 - T0)} end, {0, 0}, lists:zip(Ts0,Ts1)), A/T.</input>
+0.9769136803764825
+</pre>
+ <note>
+ <p><c>scheduler_wall_time</c> is by default disabled. Use <c>erlang:system_flag(scheduler_wall_time, true)</c> to enable it. </p>
+ </note>
+ </desc>
+ </func>
+ <func>
+ <name name="statistics" arity="1" clause_i="9"/>
+ <fsummary>Information about wall-clock</fsummary>
+ <desc>
+ <p><c>wall_clock</c> can be used in the same manner as
+ <c>runtime</c>, except that real time is measured as
+ opposed to runtime or CPU time.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="suspend_process" arity="2"/>
<fsummary>Suspend a process</fsummary>
- <type>
- <v>Suspendee = pid()</v>
- <v>OptList = [Opt]</v>
- <v>Opt = atom()</v>
- </type>
<desc>
<p>Increases the suspend count on the process identified by
- <c>Suspendee</c> and puts it in the suspended state if it isn't
+ <c><anno>Suspendee</anno></c> and puts it in the suspended state if it isn't
already in the suspended state. A suspended process will not be
scheduled for execution until the process has been resumed.
</p>
@@ -4970,49 +4548,49 @@ true</pre>
<p>A process can be suspended by multiple processes and can
be suspended multiple times by a single process. A suspended
process will not leave the suspended state until its suspend
- count reach zero. The suspend count of <c>Suspendee</c> is
- decreased when
- <seealso marker="#resume_process/1">erlang:resume_process(Suspendee)</seealso>
+ count reach zero. The suspend count of <c><anno>Suspendee</anno></c>
+ is decreased when
+ <seealso marker="#resume_process/1">erlang:resume_process(<anno>Suspendee</anno>)</seealso>
is called by the same process that called
- <c>erlang:suspend_process(Suspendee)</c>. All increased suspend
+ <c>erlang:suspend_process(<anno>Suspendee</anno>)</c>. All increased suspend
counts on other processes acquired by a process will automatically be
decreased when the process terminates.</p>
- <p>Currently the following options (<c>Opt</c>s) are available:</p>
+ <p>Currently the following options (<c><anno>Opt</anno></c>s) are available:</p>
<taglist>
<tag><c>asynchronous</c></tag>
<item>
A suspend request is sent to the process identified by
- <c>Suspendee</c>. <c>Suspendee</c> will eventually suspend
+ <c><anno>Suspendee</anno></c>. <c><anno>Suspendee</anno></c> will eventually suspend
unless it is resumed before it was able to suspend. The caller
of <c>erlang:suspend_process/2</c> will return immediately,
- regardless of whether the <c>Suspendee</c> has suspended yet
- or not. Note that the point in time when the <c>Suspendee</c>
+ regardless of whether the <c><anno>Suspendee</anno></c> has suspended yet
+ or not. Note that the point in time when the <c><anno>Suspendee</anno></c>
will actually suspend cannot be deduced from other events
in the system. The only guarantee given is that the
- <c>Suspendee</c> will <em>eventually</em> suspend (unless it
+ <c><anno>Suspendee</anno></c> will <em>eventually</em> suspend (unless it
is resumed). If the <c>asynchronous</c> option has <em>not</em>
been passed, the caller of <c>erlang:suspend_process/2</c> will
- be blocked until the <c>Suspendee</c> has actually suspended.
+ be blocked until the <c><anno>Suspendee</anno></c> has actually suspended.
</item>
<tag><c>unless_suspending</c></tag>
<item>
- The process identified by <c>Suspendee</c> will be suspended
+ The process identified by <c><anno>Suspendee</anno></c> will be suspended
unless the calling process already is suspending the
- <c>Suspendee</c>. If <c>unless_suspending</c> is combined
+ <c><anno>Suspendee</anno></c>. If <c>unless_suspending</c> is combined
with the <c>asynchronous</c> option, a suspend request will be
sent unless the calling process already is suspending the
- <c>Suspendee</c> or if a suspend request already has been sent
+ <c><anno>Suspendee</anno></c> or if a suspend request already has been sent
and is in transit. If the calling process already is suspending
- the <c>Suspendee</c>, or if combined with the <c>asynchronous</c>
+ the <c><anno>Suspendee</anno></c>, or if combined with the <c>asynchronous</c>
option and a send request already is in transit,
- <c>false</c> is returned and the suspend count on <c>Suspendee</c>
+ <c>false</c> is returned and the suspend count on <c><anno>Suspendee</anno></c>
will remain unchanged.
</item>
</taglist>
<p>If the suspend count on the process identified by
- <c>Suspendee</c> was increased, <c>true</c> is returned; otherwise,
+ <c><anno>Suspendee</anno></c> was increased, <c>true</c> is returned; otherwise,
<c>false</c> is returned.</p>
<warning>
@@ -5022,28 +4600,28 @@ true</pre>
<taglist>
<tag><c>badarg</c></tag>
<item>
- If <c>Suspendee</c> isn't a process identifier.
+ If <c><anno>Suspendee</anno></c> isn't a process identifier.
</item>
<tag><c>badarg</c></tag>
<item>
- If the process identified by <c>Suspendee</c> is same the process as
+ If the process identified by <c><anno>Suspendee</anno></c> is same the process as
the process calling <c>erlang:suspend_process/2</c>.
</item>
<tag><c>badarg</c></tag>
<item>
- If the process identified by <c>Suspendee</c> is not alive.
+ If the process identified by <c><anno>Suspendee</anno></c> is not alive.
</item>
<tag><c>badarg</c></tag>
<item>
- If the process identified by <c>Suspendee</c> resides on another node.
+ If the process identified by <c><anno>Suspendee</anno></c> resides on another node.
</item>
<tag><c>badarg</c></tag>
<item>
- If <c>OptList</c> isn't a proper list of valid <c>Opt</c>s.
+ If <c><anno>OptList</anno></c> isn't a proper list of valid <c><anno>Opt</anno></c>s.
</item>
<tag><c>system_limit</c></tag>
<item>
- If the process identified by <c>Suspendee</c> has been suspended more
+ If the process identified by <c><anno>Suspendee</anno></c> has been suspended more
times by the calling process than can be represented by the
currently used internal data structures. The current system limit
is larger than 2 000 000 000 suspends, and it will never be less
@@ -5066,283 +4644,322 @@ true</pre>
</desc>
</func>
<func>
- <name>erlang:system_flag(Flag, Value) -> OldValue</name>
- <fsummary>Set system flags</fsummary>
- <type>
- <v>Flag, Value, OldValue -- see below</v>
- </type>
+ <name name="system_flag" arity="2" clause_i="1"/>
+ <fsummary>Set system flag backtrace_depth</fsummary>
+ <desc>
+ <p>Sets the maximum depth of call stack back-traces in the
+ exit reason element of <c>'EXIT'</c> tuples.</p>
+ <p>Returns the old value of the flag.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="system_flag" arity="2" clause_i="2"/>
+ <type name="cpu_topology"/>
+ <type name="level_entry"/>
+ <type name="level_tag"/>
+ <type name="sub_level"/>
+ <type name="info_list"/>
+ <fsummary>Set system flag cpu_topology</fsummary>
+ <desc>
+ <warning>
+ <p><marker id="system_flag_cpu_topology"></marker>
+ This argument is <em>deprecated</em> and
+ scheduled for removal in erts-5.10/OTP-R16. Instead of using
+ this argument you are advised to use the <c>erl</c> command
+ line argument <seealso marker="erts:erl#+sct">+sct</seealso>.
+ When this argument has been removed a final CPU topology to use
+ will be determined at emulator boot time.</p>
+ </warning>
+ <p>Sets the user defined <c><anno>CpuTopology</anno></c>. The user defined
+ CPU topology will override any automatically detected
+ CPU topology. By passing <c>undefined</c> as <c><anno>CpuTopology</anno></c>
+ the system will revert back to the CPU topology automatically
+ detected. The returned value equals the value returned
+ from <c>erlang:system_info(cpu_topology)</c> before the
+ change was made.
+ </p>
+ <p>Returns the old value of the flag.</p>
+ <p>The CPU topology is used when binding schedulers to logical
+ processors. If schedulers are already bound when the CPU
+ topology is changed, the schedulers will be sent a request
+ to rebind according to the new CPU topology.
+ </p>
+ <p>The user defined CPU topology can also be set by passing
+ the <seealso marker="erts:erl#+sct">+sct</seealso> command
+ line argument to <c>erl</c>.
+ </p>
+ <p>For information on the <c><anno>CpuTopology</anno></c> type
+ and more, see the documentation of
+ <seealso marker="#system_info_cpu_topology">erlang:system_info(cpu_topology)</seealso>,
+ and the <c>erl</c> <seealso marker="erts:erl#+sct">+sct</seealso>
+ and <seealso marker="erts:erl#+sbt">+sbt</seealso>
+ command line flags.
+ </p>
+ </desc>
+ </func>
+ <func>
+ <name name="system_flag" arity="2" clause_i="3"/>
+ <fsummary>Set system flag fullsweep_after</fsummary>
+ <desc>
+ <p><c><anno>Number</anno></c> is a non-negative integer which indicates
+ how many times generational garbage collections can be
+ done without forcing a fullsweep collection. The value
+ applies to new processes; processes already running are
+ not affected.</p>
+ <p>Returns the old value of the flag.</p>
+ <p>In low-memory systems (especially without virtual
+ memory), setting the value to 0 can help to conserve
+ memory.</p>
+ <p>An alternative way to set this value is through the
+ (operating system) environment variable
+ <c>ERL_FULLSWEEP_AFTER</c>.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="system_flag" arity="2" clause_i="4"/>
+ <fsummary>Set system flag min_heap_size</fsummary>
+ <desc>
+ <p>Sets the default minimum heap size for processes. The
+ size is given in words. The new <c>min_heap_size</c> only
+ effects processes spawned after the change of
+ <c>min_heap_size</c> has been made.
+ The <c>min_heap_size</c> can be set for individual
+ processes by use of
+ <seealso marker="#spawn_opt/4">spawn_opt/N</seealso> or
+ <seealso marker="#process_flag/2">process_flag/2</seealso>. </p>
+ <p>Returns the old value of the flag.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="system_flag" arity="2" clause_i="5"/>
+ <fsummary>Set system flag min_bin_vheap_size</fsummary>
+ <desc>
+ <p>Sets the default minimum binary virtual heap size for processes. The
+ size is given in words. The new <c>min_bin_vhheap_size</c> only
+ effects processes spawned after the change of
+ <c>min_bin_vhheap_size</c> has been made.
+ The <c>min_bin_vheap_size</c> can be set for individual
+ processes by use of
+ <seealso marker="#spawn_opt/4">spawn_opt/N</seealso> or
+ <seealso marker="#process_flag/2">process_flag/2</seealso>. </p>
+ <p>Returns the old value of the flag.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="system_flag" arity="2" clause_i="6"/>
+ <fsummary>Set system flag multi_scheduling</fsummary>
+ <desc>
+ <p><marker id="system_flag_multi_scheduling"></marker>
+ If multi-scheduling is enabled, more than one scheduler
+ thread is used by the emulator. Multi-scheduling can be
+ blocked. When multi-scheduling has been blocked, only
+ one scheduler thread will schedule Erlang processes.</p>
+ <p>If <c><anno>BlockState</anno> =:= block</c>, multi-scheduling will
+ be blocked. If <c><anno>BlockState</anno> =:= unblock</c> and no-one
+ else is blocking multi-scheduling and this process has
+ only blocked one time, multi-scheduling will be unblocked.
+ One process can block multi-scheduling multiple times.
+ If a process has blocked multiple times, it has to
+ unblock exactly as many times as it has blocked before it
+ has released its multi-scheduling block. If a process that
+ has blocked multi-scheduling exits, it will release its
+ blocking of multi-scheduling.</p>
+ <p>The return values are <c>disabled</c>, <c>blocked</c>,
+ or <c>enabled</c>. The returned value describes the
+ state just after the call to
+ <c>erlang:system_flag(multi_scheduling, <anno>BlockState</anno>)</c>
+ has been made. The return values are described in the
+ documentation of <seealso marker="#system_info_multi_scheduling">erlang:system_info(multi_scheduling)</seealso>.</p>
+ <p><em>NOTE</em>: Blocking of multi-scheduling should normally
+ not be needed. If you feel that you need to
+ block multi-scheduling, think through the
+ problem at least a couple of times again.
+ Blocking multi-scheduling should only be used
+ as a last resort since it will most likely be
+ a <em>very inefficient</em> way to solve the
+ problem.</p>
+ <p>See also <seealso marker="#system_info_multi_scheduling">erlang:system_info(multi_scheduling)</seealso>,
+ <seealso marker="#system_info_multi_scheduling_blockers">erlang:system_info(multi_scheduling_blockers)</seealso>, and
+ <seealso marker="#system_info_schedulers">erlang:system_info(schedulers)</seealso>.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="system_flag" arity="2" clause_i="7"/>
+ <type name="scheduler_bind_type"/>
+ <fsummary>Set system flag scheduler_bind_type</fsummary>
<desc>
<warning>
- <p>The
- <seealso marker="#system_flag_cpu_topology">cpu_topology</seealso>,
- and
- <seealso marker="#system_flag_scheduler_bind_type">scheduler_bind_type</seealso>
- <c>Flag</c>s are <em>deprecated</em> and have been scheduled for
- removal in erts-5.10/OTP-R16.</p>
+ <p><marker id="system_flag_scheduler_bind_type"></marker>
+ This argument is <em>deprecated</em> and
+ scheduled for removal in erts-5.10/OTP-R16. Instead of using
+ this argument you are advised to use the <c>erl</c> command
+ line argument <seealso marker="erts:erl#+sbt">+sbt</seealso>.
+ When this argument has been removed a final scheduler bind type
+ to use will be determined at emulator boot time.</p>
</warning>
- <p>Sets various system properties of the Erlang node. Returns
- the old value of the flag.</p>
+ <p>Controls if and how schedulers are bound to logical
+ processors.</p>
+ <p>When <c>erlang:system_flag(scheduler_bind_type, <anno>How</anno>)</c> is
+ called, an asynchronous signal is sent to all schedulers
+ online which causes them to try to bind or unbind as requested.
+ <em>NOTE:</em> If a scheduler fails to bind, this
+ will often be silently ignored. This since it isn't always
+ possible to verify valid logical processor identifiers. If
+ an error is reported, it will be reported to the
+ <c>error_logger</c>. If you want to verify that the
+ schedulers actually have bound as requested, call
+ <seealso marker="#system_info_scheduler_bindings">erlang:system_info(scheduler_bindings)</seealso>.
+ </p>
+ <p>Schedulers can currently only be bound on newer Linux,
+ Solaris, FreeBSD, and Windows systems, but more systems will be
+ supported in the future.
+ </p>
+ <p>In order for the runtime system to be able to bind schedulers,
+ the CPU topology needs to be known. If the runtime system fails
+ to automatically detect the CPU topology, it can be defined.
+ For more information on how to define the CPU topology, see
+ the <c>erl</c> <seealso marker="erts:erl#+sct">+sct</seealso> command
+ line flag.
+ </p>
+ <p>The runtime system will by default <em>not</em> bind schedulers
+ to logical processors.
+ </p>
+ <p><em>NOTE:</em> If the Erlang runtime system is the only
+ operating system process that binds threads to logical processors,
+ this improves the performance of the runtime system. However,
+ if other operating system processes (as for example another Erlang
+ runtime system) also bind threads to logical processors, there
+ might be a performance penalty instead. In some cases this
+ performance penalty might be severe. If this is the case, you
+ are advised to not bind the schedulers.</p>
+ <p>Schedulers can be bound in different ways. The <c><anno>How</anno></c>
+ argument determines how schedulers are bound. <c><anno>How</anno></c> can
+ currently be one of:</p>
<taglist>
- <tag><c>erlang:system_flag(backtrace_depth, Depth)</c></tag>
- <item>
- <p>Sets the maximum depth of call stack back-traces in the
- exit reason element of <c>'EXIT'</c> tuples.</p>
- </item>
- <tag><marker id="system_flag_cpu_topology"><c>erlang:system_flag(cpu_topology, CpuTopology)</c></marker></tag>
- <item>
- <p><em>NOTE:</em> This argument is <em>deprecated</em> and
- scheduled for removal in erts-5.10/OTP-R16. Instead of using
- this argument you are advised to use the <c>erl</c> command
- line argument <seealso marker="erts:erl#+sct">+sct</seealso>.
- When this argument has been removed a final CPU topology to use
- will be determined at emulator boot time.</p>
- <p>Sets the user defined <c>CpuTopology</c>. The user defined
- CPU topology will override any automatically detected
- CPU topology. By passing <c>undefined</c> as <c>CpuTopology</c>
- the system will revert back to the CPU topology automatically
- detected. The returned value equals the value returned
- from <c>erlang:system_info(cpu_topology)</c> before the
- change was made.
- </p>
- <p>The CPU topology is used when binding schedulers to logical
- processors. If schedulers are already bound when the CPU
- topology is changed, the schedulers will be sent a request
- to rebind according to the new CPU topology.
- </p>
- <p>The user defined CPU topology can also be set by passing
- the <seealso marker="erts:erl#+sct">+sct</seealso> command
- line argument to <c>erl</c>.
- </p>
- <p>For information on the <c>CpuTopology</c> type
- and more, see the documentation of
- <seealso marker="#system_info_cpu_topology">erlang:system_info(cpu_topology)</seealso>,
- and the <c>erl</c> <seealso marker="erts:erl#+sct">+sct</seealso>
- and <seealso marker="erts:erl#+sbt">+sbt</seealso>
- command line flags.
- </p>
- </item>
- <tag><c>erlang:system_flag(fullsweep_after, Number)</c></tag>
- <item>
- <p><c>Number</c> is a non-negative integer which indicates
- how many times generational garbage collections can be
- done without forcing a fullsweep collection. The value
- applies to new processes; processes already running are
- not affected.</p>
- <p>In low-memory systems (especially without virtual
- memory), setting the value to 0 can help to conserve
- memory.</p>
- <p>An alternative way to set this value is through the
- (operating system) environment variable
- <c>ERL_FULLSWEEP_AFTER</c>.</p>
- </item>
- <tag><c>erlang:system_flag(min_heap_size, MinHeapSize)</c></tag>
- <item>
- <p>Sets the default minimum heap size for processes. The
- size is given in words. The new <c>min_heap_size</c> only
- effects processes spawned after the change of
- <c>min_heap_size</c> has been made.
- The <c>min_heap_size</c> can be set for individual
- processes by use of
- <seealso marker="#spawn_opt/4">spawn_opt/N</seealso> or
- <seealso marker="#process_flag/2">process_flag/2</seealso>. </p>
- </item>
- <tag><c>erlang:system_flag(min_bin_vheap_size, MinBinVHeapSize)</c></tag>
- <item>
- <p>Sets the default minimum binary virtual heap size for processes. The
- size is given in words. The new <c>min_bin_vhheap_size</c> only
- effects processes spawned after the change of
- <c>min_bin_vhheap_size</c> has been made.
- The <c>min_bin_vheap_size</c> can be set for individual
- processes by use of
- <seealso marker="#spawn_opt/4">spawn_opt/N</seealso> or
- <seealso marker="#process_flag/2">process_flag/2</seealso>. </p>
- </item>
- <tag><marker id="system_flag_multi_scheduling"><c>erlang:system_flag(multi_scheduling, BlockState)</c></marker></tag>
- <item>
- <p><c>BlockState = block | unblock</c></p>
- <p>If multi-scheduling is enabled, more than one scheduler
- thread is used by the emulator. Multi-scheduling can be
- blocked. When multi-scheduling has been blocked, only
- one scheduler thread will schedule Erlang processes.</p>
- <p>If <c>BlockState =:= block</c>, multi-scheduling will
- be blocked. If <c>BlockState =:= unblock</c> and no-one
- else is blocking multi-scheduling and this process has
- only blocked one time, multi-scheduling will be unblocked.
- One process can block multi-scheduling multiple times.
- If a process has blocked multiple times, it has to
- unblock exactly as many times as it has blocked before it
- has released its multi-scheduling block. If a process that
- has blocked multi-scheduling exits, it will release its
- blocking of multi-scheduling.</p>
- <p>The return values are <c>disabled</c>, <c>blocked</c>,
- or <c>enabled</c>. The returned value describes the
- state just after the call to
- <c>erlang:system_flag(multi_scheduling, BlockState)</c>
- has been made. The return values are described in the
- documentation of <seealso marker="#system_info_multi_scheduling">erlang:system_info(multi_scheduling)</seealso>.</p>
- <p><em>NOTE</em>: Blocking of multi-scheduling should normally
- not be needed. If you feel that you need to
- block multi-scheduling, think through the
- problem at least a couple of times again.
- Blocking multi-scheduling should only be used
- as a last resort since it will most likely be
- a <em>very inefficient</em> way to solve the
- problem.</p>
- <p>See also <seealso marker="#system_info_multi_scheduling">erlang:system_info(multi_scheduling)</seealso>,
- <seealso marker="#system_info_multi_scheduling_blockers">erlang:system_info(multi_scheduling_blockers)</seealso>, and
- <seealso marker="#system_info_schedulers">erlang:system_info(schedulers)</seealso>.</p>
- </item>
- <tag><marker id="system_flag_scheduler_bind_type"><c>erlang:system_flag(scheduler_bind_type, How)</c></marker></tag>
+ <tag><c>unbound</c></tag>
+ <item><p>Same as the <c>erl</c> command line argument
+ <seealso marker="erts:erl#+sbt">+sbt u</seealso>.
+ </p></item>
+ <tag><c>no_spread</c></tag>
+ <item><p>Same as the <c>erl</c> command line argument
+ <seealso marker="erts:erl#+sbt">+sbt ns</seealso>.
+ </p></item>
+ <tag><c>thread_spread</c></tag>
+ <item><p>Same as the <c>erl</c> command line argument
+ <seealso marker="erts:erl#+sbt">+sbt ts</seealso>.
+ </p></item>
+ <tag><c>processor_spread</c></tag>
+ <item><p>Same as the <c>erl</c> command line argument
+ <seealso marker="erts:erl#+sbt">+sbt ps</seealso>.
+ </p></item>
+ <tag><c>spread</c></tag>
+ <item><p>Same as the <c>erl</c> command line argument
+ <seealso marker="erts:erl#+sbt">+sbt s</seealso>.
+ </p></item>
+ <tag><c>no_node_thread_spread</c></tag>
+ <item><p>Same as the <c>erl</c> command line argument
+ <seealso marker="erts:erl#+sbt">+sbt nnts</seealso>.
+ </p></item>
+ <tag><c>no_node_processor_spread</c></tag>
+ <item><p>Same as the <c>erl</c> command line argument
+ <seealso marker="erts:erl#+sbt">+sbt nnps</seealso>.
+ </p></item>
+ <tag><c>thread_no_node_processor_spread</c></tag>
+ <item><p>Same as the <c>erl</c> command line argument
+ <seealso marker="erts:erl#+sbt">+sbt tnnps</seealso>.
+ </p></item>
+ <tag><c>default_bind</c></tag>
+ <item><p>Same as the <c>erl</c> command line argument
+ <seealso marker="erts:erl#+sbt">+sbt db</seealso>.
+ </p></item>
+ </taglist>
+ <p>The value returned equals <c><anno>How</anno></c> before the
+ <c>scheduler_bind_type</c> flag was changed.</p>
+ <p>Failure:</p>
+ <taglist>
+ <tag><c>notsup</c></tag>
<item>
- <p><em>NOTE:</em> This argument is <em>deprecated</em> and
- scheduled for removal in erts-5.10/OTP-R16. Instead of using
- this argument you are advised to use the <c>erl</c> command
- line argument <seealso marker="erts:erl#+sbt">+sbt</seealso>.
- When this argument has been removed a final scheduler bind type
- to use will be determined at emulator boot time.</p>
- <p>Controls if and how schedulers are bound to logical
- processors.</p>
- <p>When <c>erlang:system_flag(scheduler_bind_type, How)</c> is
- called, an asynchronous signal is sent to all schedulers
- online which causes them to try to bind or unbind as requested.
- <em>NOTE:</em> If a scheduler fails to bind, this
- will often be silently ignored. This since it isn't always
- possible to verify valid logical processor identifiers. If
- an error is reported, it will be reported to the
- <c>error_logger</c>. If you want to verify that the
- schedulers actually have bound as requested, call
- <seealso marker="#system_info_scheduler_bindings">erlang:system_info(scheduler_bindings)</seealso>.
- </p>
- <p>Schedulers can currently only be bound on newer Linux,
- Solaris, FreeBSD, and Windows systems, but more systems will be
- supported in the future.
- </p>
- <p>In order for the runtime system to be able to bind schedulers,
- the CPU topology needs to be known. If the runtime system fails
- to automatically detect the CPU topology, it can be defined.
- For more information on how to define the CPU topology, see
- the <c>erl</c> <seealso marker="erts:erl#+sct">+sct</seealso> command
- line flag.
- </p>
- <p>The runtime system will by default <em>not</em> bind schedulers
- to logical processors.
- </p>
- <p><em>NOTE:</em> If the Erlang runtime system is the only
- operating system process that binds threads to logical processors,
- this improves the performance of the runtime system. However,
- if other operating system processes (as for example another Erlang
- runtime system) also bind threads to logical processors, there
- might be a performance penalty instead. In some cases this
- performance penalty might be severe. If this is the case, you
- are advised to not bind the schedulers.</p>
- <p>Schedulers can be bound in different ways. The <c>How</c>
- argument determines how schedulers are bound. <c>How</c> can
- currently be one of:</p>
- <taglist>
- <tag><c>unbound</c></tag>
- <item><p>Same as the <c>erl</c> command line argument
- <seealso marker="erts:erl#+sbt">+sbt u</seealso>.
- </p></item>
- <tag><c>no_spread</c></tag>
- <item><p>Same as the <c>erl</c> command line argument
- <seealso marker="erts:erl#+sbt">+sbt ns</seealso>.
- </p></item>
- <tag><c>thread_spread</c></tag>
- <item><p>Same as the <c>erl</c> command line argument
- <seealso marker="erts:erl#+sbt">+sbt ts</seealso>.
- </p></item>
- <tag><c>processor_spread</c></tag>
- <item><p>Same as the <c>erl</c> command line argument
- <seealso marker="erts:erl#+sbt">+sbt ps</seealso>.
- </p></item>
- <tag><c>spread</c></tag>
- <item><p>Same as the <c>erl</c> command line argument
- <seealso marker="erts:erl#+sbt">+sbt s</seealso>.
- </p></item>
- <tag><c>no_node_thread_spread</c></tag>
- <item><p>Same as the <c>erl</c> command line argument
- <seealso marker="erts:erl#+sbt">+sbt nnts</seealso>.
- </p></item>
- <tag><c>no_node_processor_spread</c></tag>
- <item><p>Same as the <c>erl</c> command line argument
- <seealso marker="erts:erl#+sbt">+sbt nnps</seealso>.
- </p></item>
- <tag><c>thread_no_node_processor_spread</c></tag>
- <item><p>Same as the <c>erl</c> command line argument
- <seealso marker="erts:erl#+sbt">+sbt tnnps</seealso>.
- </p></item>
- <tag><c>default_bind</c></tag>
- <item><p>Same as the <c>erl</c> command line argument
- <seealso marker="erts:erl#+sbt">+sbt db</seealso>.
- </p></item>
- </taglist>
- <p>The value returned equals <c>How</c> before the
- <c>scheduler_bind_type</c> flag was changed.</p>
- <p>Failure:</p>
- <taglist>
- <tag><c>notsup</c></tag>
- <item>
- <p>If binding of schedulers is not supported.</p>
- </item>
- <tag><c>badarg</c></tag>
- <item>
- <p>If <c>How</c> isn't one of the documented alternatives.</p>
- </item>
- <tag><c>badarg</c></tag>
- <item>
- <p>If no CPU topology information is available.</p>
- </item>
- </taglist>
- <p>The scheduler bind type can also be set by passing
- the <seealso marker="erts:erl#+sbt">+sbt</seealso> command
- line argument to <c>erl</c>.
- </p>
- <p>For more information, see
- <seealso marker="#system_info_scheduler_bind_type">erlang:system_info(scheduler_bind_type)</seealso>,
- <seealso marker="#system_info_scheduler_bindings">erlang:system_info(scheduler_bindings)</seealso>,
- the <c>erl</c> <seealso marker="erts:erl#+sbt">+sbt</seealso>
- and <seealso marker="erts:erl#+sct">+sct</seealso> command line
- flags.
- </p>
+ <p>If binding of schedulers is not supported.</p>
</item>
- <tag><marker id="system_flag_schedulers_online"><c>erlang:system_flag(schedulers_online, SchedulersOnline)</c></marker></tag>
+ <tag><c>badarg</c></tag>
<item>
- <p>Sets the amount of schedulers online. Valid range is
- <![CDATA[1 <= SchedulerId <= erlang:system_info(schedulers)]]>.
- </p>
- <p>For more information see,
- <seealso marker="#system_info_schedulers">erlang:system_info(schedulers)</seealso>,
- and
- <seealso marker="#system_info_schedulers_online">erlang:system_info(schedulers_online)</seealso>.
- </p>
+ <p>If <c>How</c> isn't one of the documented alternatives.</p>
</item>
- <tag><c>erlang:system_flag(trace_control_word, TCW)</c></tag>
+ <tag><c>badarg</c></tag>
<item>
- <p>Sets the value of the node's trace control word to
- <c>TCW</c>. <c>TCW</c> should be an unsigned integer. For
- more information see documentation of the
- <seealso marker="erts:match_spec#set_tcw">set_tcw</seealso>
- function in the match specification documentation in the
- ERTS User's Guide.</p>
+ <p>If no CPU topology information is available.</p>
</item>
</taglist>
- <note>
- <p>The <c>schedulers</c> option has been removed as
- of erts version 5.5.3. The number of scheduler
- threads is determined at emulator boot time, and
- cannot be changed after that.</p>
- </note>
+ <p>The scheduler bind type can also be set by passing
+ the <seealso marker="erts:erl#+sbt">+sbt</seealso> command
+ line argument to <c>erl</c>.
+ </p>
+ <p>For more information, see
+ <seealso marker="#system_info_scheduler_bind_type">erlang:system_info(scheduler_bind_type)</seealso>,
+ <seealso marker="#system_info_scheduler_bindings">erlang:system_info(scheduler_bindings)</seealso>,
+ the <c>erl</c> <seealso marker="erts:erl#+sbt">+sbt</seealso>
+ and <seealso marker="erts:erl#+sct">+sct</seealso> command line
+ flags.
+ </p>
</desc>
</func>
<func>
- <name>erlang:system_info(Type) -> Res</name>
- <fsummary>Information about the system</fsummary>
- <type>
- <v>Type, Res -- see below</v>
- </type>
+ <name name="system_flag" arity="2" clause_i="8"/>
+ <fsummary>Set system flag scheduler_wall_time</fsummary>
+ <desc><p><marker id="system_flag_scheduler_wall_time"></marker>
+ Turns on/off scheduler wall time measurements. </p>
+ <p>For more information see,
+ <seealso marker="#statistics_scheduler_wall_time">erlang:statistics(scheduler_wall_time)</seealso>.
+ </p>
+ </desc>
+ </func>
+ <func>
+ <name name="system_flag" arity="2" clause_i="9"/>
+ <fsummary>Set system flag schedulers_online</fsummary>
<desc>
- <p>Returns various information about the current system
- (emulator) as specified by <c>Type</c>:</p>
+ <p><marker id="system_flag_schedulers_online"></marker>
+ Sets the amount of schedulers online. Valid range is
+ <![CDATA[1 <= SchedulersOnline <= erlang:system_info(schedulers)]]>.
+ </p>
+ <p>Returns the old value of the flag.</p>
+ <p>For more information see,
+ <seealso marker="#system_info_schedulers">erlang:system_info(schedulers)</seealso>,
+ and
+ <seealso marker="#system_info_schedulers_online">erlang:system_info(schedulers_online)</seealso>.
+ </p>
+ </desc>
+ </func>
+ <func>
+ <name name="system_flag" arity="2" clause_i="10"/>
+ <fsummary>Set system flag trace_control_word</fsummary>
+ <desc>
+ <p>Sets the value of the node's trace control word to
+ <c><anno>TCW</anno></c>. <c><anno>TCW</anno></c> should be an unsigned integer. For
+ more information see documentation of the
+ <seealso marker="erts:match_spec#set_tcw">set_tcw</seealso>
+ function in the match specification documentation in the
+ ERTS User's Guide.</p>
+ <p>Returns the old value of the flag.</p>
+ </desc>
+ </func>
+ <func>
+ <name name="system_info" arity="1" clause_i="1"/>
+ <name name="system_info" arity="1" clause_i="2"/>
+ <name name="system_info" arity="1" clause_i="3"/>
+ <name name="system_info" arity="1" clause_i="4"/>
+ <name name="system_info" arity="1" clause_i="5"/>
+ <type variable="Allocator" name_i="2"/>
+ <type variable="Version" name_i="2"/>
+ <type variable="Features" name_i="2"/>
+ <type variable="Settings" name_i="2"/>
+ <type variable="Alloc" name_i="3"/>
+ <fsummary>Information about the allocators of the system</fsummary>
+ <desc>
+ <p>
+ Returns various information about the
+ <marker id="system_info_allocator_tags">allocators</marker> of the
+ current system (emulator) as specified by
+ <c><anno>Item</anno></c>:</p>
<taglist>
<tag><marker id="system_info_allocated_areas"><c>allocated_areas</c></marker></tag>
<item>
@@ -5367,37 +4984,27 @@ true</pre>
</item>
<tag><marker id="system_info_allocator"><c>allocator</c></marker></tag>
<item>
- <p>Returns <c>{Allocator, Version, Features, Settings}.</c></p>
- <p>Types:</p>
- <list type="bulleted">
- <item><c>Allocator = undefined | glibc</c></item>
- <item><c>Version = [integer()]</c></item>
- <item><c>Features = [atom()]</c></item>
- <item><c>Settings = [{Subsystem, [{Parameter, Value}]}]</c></item>
- <item><c>Subsystem = atom()</c></item>
- <item><c>Parameter = atom()</c></item>
- <item><c>Value = term()</c></item>
- </list>
+ <p>Returns <c>{<anno>Allocator</anno>, <anno>Version</anno>, <anno>Features</anno>, <anno>Settings</anno>}.</c></p>
<p>Explanation:</p>
<list type="bulleted">
<item>
- <p><c>Allocator</c> corresponds to the <c>malloc()</c>
- implementation used. If <c>Allocator</c> equals
+ <p><c><anno>Allocator</anno></c> corresponds to the <c>malloc()</c>
+ implementation used. If <c><anno>Allocator</anno></c> equals
<c>undefined</c>, the <c>malloc()</c> implementation
used could not be identified. Currently
<c>glibc</c> can be identified.</p>
</item>
<item>
- <p><c>Version</c> is a list of integers (but not a
+ <p><c><anno>Version</anno></c> is a list of integers (but not a
string) representing the version of
the <c>malloc()</c> implementation used.</p>
</item>
<item>
- <p><c>Features</c> is a list of atoms representing
+ <p><c><anno>Features</anno></c> is a list of atoms representing
allocation features used.</p>
</item>
<item>
- <p><c>Settings</c> is a list of subsystems, their
+ <p><c><anno>Settings</anno></c> is a list of subsystems, their
configurable parameters, and used values. Settings
may differ between different combinations of
platforms, allocators, and allocation features.
@@ -5417,15 +5024,15 @@ true</pre>
erts_alloc(3)</seealso> documentation.
</p>
</item>
- <tag><marker id="system_info_allocator_tuple"><c>{allocator, Alloc}</c></marker></tag>
+ <tag><marker id="system_info_allocator_tuple"><c>{allocator, <anno>Alloc</anno>}</c></marker></tag>
<item>
<p>Returns information about the specified allocator.
As of erts version 5.6.1 the return value is a list
of <c>{instance, InstanceNo, InstanceInfo}</c> tuples
where <c>InstanceInfo</c> contains information about
a specific instance of the allocator.
- If <c>Alloc</c> is not a recognized allocator,
- <c>undefined</c> is returned. If <c>Alloc</c> is disabled,
+ If <c><anno>Alloc</anno></c> is not a recognized allocator,
+ <c>undefined</c> is returned. If <c><anno>Alloc</anno></c> is disabled,
<c>false</c> is returned.</p>
<p><em>Note:</em> The information returned is highly
implementation dependent and may be changed, or removed
@@ -5454,54 +5061,51 @@ true</pre>
values. The first value is memory pool size and
the second value used memory size.</p>
</item>
- <tag><marker id="system_info_allocator_sizes"><c>{allocator_sizes, Alloc}</c></marker></tag>
+ <tag><marker id="system_info_allocator_sizes"><c>{allocator_sizes, <anno>Alloc</anno>}</c></marker></tag>
<item>
<p>Returns various size information for the specified
allocator. The information returned is a subset of the
information returned by
- <seealso marker="#system_info_allocator_tuple">erlang:system_info({allocator, Alloc})</seealso>.
+ <seealso marker="#system_info_allocator_tuple">erlang:system_info({allocator, <anno>Alloc</anno>})</seealso>.
</p>
</item>
- <tag><c>build_type</c></tag>
- <item>
- <p>Returns an atom describing the build type of the runtime
- system. This is normally the atom <c>opt</c> for optimized.
- Other possible return values are <c>debug</c>, <c>purify</c>,
- <c>quantify</c>, <c>purecov</c>, <c>gcov</c>, <c>valgrind</c>,
- <c>gprof</c>, and <c>lcnt</c>. Possible return values
- may be added and/or removed at any time without prior notice.
- </p>
- </item>
- <tag><c>c_compiler_used</c></tag>
- <item>
- <p>Returns a two-tuple describing the C compiler used when
- compiling the runtime system. The first element is an
- atom describing the name of the compiler, or <c>undefined</c>
- if unknown. The second element is a term describing the
- version of the compiler, or <c>undefined</c> if unknown.
- </p>
- </item>
- <tag><c>check_io</c></tag>
- <item>
- <p>Returns a list containing miscellaneous information
- regarding the emulators internal I/O checking. Note,
- the content of the returned list may vary between
- platforms and over time. The only thing guaranteed is
- that a list is returned.</p>
- </item>
- <tag><c>compat_rel</c></tag>
- <item>
- <p>Returns the compatibility mode of the local node as
- an integer. The integer returned represents the
- Erlang/OTP release which the current emulator has been
- set to be backward compatible with. The compatibility
- mode can be configured at startup by using the command
- line flag <c>+R</c>, see
- <seealso marker="erts:erl#compat_rel">erl(1)</seealso>.</p>
- </item>
- <tag><marker id="system_info_cpu_topology"><c>cpu_topology</c></marker></tag>
+ </taglist>
+ </desc>
+ </func>
+ <func>
+ <name name="system_info" arity="1" clause_i="10"/>
+ <name name="system_info" arity="1" clause_i="11"/>
+ <type name="cpu_topology"/>
+ <type name="level_entry"/>
+ <type_desc name="cpu_topology">
+ <marker id="system_info_cpu_topology"></marker>
+ All <c><anno>LevelEntry</anno></c>s of a list
+ must contain the same <c><anno>LevelTag</anno></c>, except
+ on the top level where both <c>node</c> and
+ <c>processor</c> <c><anno>LevelTag</anno></c>s may co-exist.
+ </type_desc>
+ <type_desc name="level_entry">
+ <c>{<anno>LevelTag</anno>, <anno>SubLevel</anno>} == {<anno>LevelTag</anno>, [], <anno>SubLevel</anno>}</c>
+ </type_desc>
+ <type name="level_tag"/>
+ <type_desc name="level_tag">
+ More <c><anno>LevelTag</anno></c>s may be introduced in the future.
+ </type_desc>
+ <type name="sub_level"/>
+ <type name="info_list"/>
+ <type_desc name="info_list">
+ The <c>info_list()</c> may be extended in the future.
+ </type_desc>
+ <fsummary>Information about the CPU topology of the system</fsummary>
+ <desc>
+ <p>Returns various information about the
+ <marker id="system_info_cpu_topology_tags">CPU topology</marker>
+ of the current system
+ (emulator) as specified by <c><anno>Item</anno></c>:</p>
+ <taglist>
+ <tag><c>cpu_topology</c></tag>
<item>
- <p>Returns the <c>CpuTopology</c> which currently is used by the
+ <p>Returns the <c><anno>CpuTopology</anno></c> which currently is used by the
emulator. The CPU topology is used when binding schedulers
to logical processors. The CPU topology used is the
<seealso marker="erlang#system_info_cpu_topology_defined">user
@@ -5509,31 +5113,11 @@ true</pre>
<seealso marker="erlang#system_info_cpu_topology_detected">automatically
detected CPU topology</seealso> if such exists. If no CPU topology
exists, <c>undefined</c> is returned.</p>
- <p>Types:</p>
- <list type="bulleted">
- <item><c>CpuTopology = LevelEntryList | undefined</c></item>
- <item><c>LevelEntryList = [LevelEntry]</c> (all
- <c>LevelEntry</c>s of a <c>LevelEntryList</c>
- must contain the same <c>LevelTag</c>, except
- on the top level where both <c>node</c> and
- <c>processor</c> <c>LevelTag</c>s may co-exist)</item>
- <item><c>LevelEntry = {LevelTag, SubLevel}
- | {LevelTag, InfoList, SubLevel}</c>
- (<c>{LevelTag, SubLevel}
- == {LevelTag, [], SubLevel}</c>)</item>
- <item><c>LevelTag = node|processor|core|thread</c>
- (more <c>LevelTag</c>s may be introduced in
- the future)</item>
- <item><c>SubLevel = [LevelEntry] | LogicalCpuId</c></item>
- <item><c>LogicalCpuId = {logical, integer()}</c></item>
- <item><c>InfoList = []</c> (the <c>InfoList</c>
- may be extended in the future)</item>
- </list>
<p><c>node</c> refers to NUMA (non-uniform memory access)
nodes, and <c>thread</c> refers to hardware threads
(e.g. Intels hyper-threads).</p>
- <p>A level in the <c>CpuTopology</c> term can be omitted if
- only one entry exists and the <c>InfoList</c> is empty.
+ <p>A level in the <c><anno>CpuTopology</anno></c> term can be omitted if
+ only one entry exists and the <c><anno>InfoList</anno></c> is empty.
</p>
<p><c>thread</c> can only be a sub level to <c>core</c>.
<c>core</c> can be a sub level to either <c>processor</c>
@@ -5545,15 +5129,15 @@ true</pre>
consist of a mix of processor internal and external
NUMA nodes, as long as each logical CPU belongs to one
and only one NUMA node. Cache hierarchy is not part of
- the <c>CpuTopology</c> type yet, but will be in the
+ the <c><anno>CpuTopology</anno></c> type yet, but will be in the
future. Other things may also make it into the CPU
topology in the future. In other words, expect the
- <c>CpuTopology</c> type to change.
+ <c><anno>CpuTopology</anno></c> type to change.
</p>
</item>
<tag><marker id="system_info_cpu_topology_defined"><c>{cpu_topology, defined}</c></marker></tag>
<item>
- <p>Returns the user defined <c>CpuTopology</c>. For more
+ <p>Returns the user defined <c><anno>CpuTopology</anno></c>. For more
information see the documentation of
the <c>erl</c> <seealso marker="erts:erl#+sct">+sct</seealso> command
line flag, and the documentation of the
@@ -5563,7 +5147,7 @@ true</pre>
</item>
<tag><marker id="system_info_cpu_topology_detected"><c>{cpu_topology, detected}</c></marker></tag>
<item>
- <p>Returns the automatically detected <c>CpuTopology</c>. The
+ <p>Returns the automatically detected <c><anno>CpuTopology</anno></c>. The
emulator currently only detects the CPU topology on some newer
Linux, Solaris, FreeBSD, and Windows systems. On Windows system with
more than 32 logical processors the CPU topology is not detected.
@@ -5575,13 +5159,112 @@ true</pre>
</item>
<tag><c>{cpu_topology, used}</c></tag>
<item>
- <p>Returns the <c>CpuTopology</c> which is used by the
+ <p>Returns the <c><anno>CpuTopology</anno></c> which is used by the
emulator. For more information see the
documentation of the
<seealso marker="#system_info_cpu_topology">cpu_topology</seealso>
argument.
</p>
</item>
+ </taglist>
+ </desc>
+ </func>
+ <func>
+ <name name="system_info" arity="1" clause_i="6"/>
+ <name name="system_info" arity="1" clause_i="7"/>
+ <name name="system_info" arity="1" clause_i="8"/>
+ <name name="system_info" arity="1" clause_i="9"/>
+ <name name="system_info" arity="1" clause_i="12"/>
+ <name name="system_info" arity="1" clause_i="13"/>
+ <name name="system_info" arity="1" clause_i="14"/>
+ <name name="system_info" arity="1" clause_i="15"/>
+ <name name="system_info" arity="1" clause_i="16"/>
+ <name name="system_info" arity="1" clause_i="17"/>
+ <name name="system_info" arity="1" clause_i="18"/>
+ <name name="system_info" arity="1" clause_i="19"/>
+ <name name="system_info" arity="1" clause_i="20"/>
+ <name name="system_info" arity="1" clause_i="21"/>
+ <name name="system_info" arity="1" clause_i="22"/>
+ <name name="system_info" arity="1" clause_i="23"/>
+ <name name="system_info" arity="1" clause_i="24"/>
+ <name name="system_info" arity="1" clause_i="25"/>
+ <name name="system_info" arity="1" clause_i="26"/>
+ <name name="system_info" arity="1" clause_i="27"/>
+ <name name="system_info" arity="1" clause_i="28"/>
+ <name name="system_info" arity="1" clause_i="29"/>
+ <name name="system_info" arity="1" clause_i="30"/>
+ <name name="system_info" arity="1" clause_i="31"/>
+ <name name="system_info" arity="1" clause_i="32"/>
+ <name name="system_info" arity="1" clause_i="33"/>
+ <name name="system_info" arity="1" clause_i="34"/>
+ <name name="system_info" arity="1" clause_i="35"/>
+ <name name="system_info" arity="1" clause_i="36"/>
+ <name name="system_info" arity="1" clause_i="37"/>
+ <name name="system_info" arity="1" clause_i="38"/>
+ <name name="system_info" arity="1" clause_i="39"/>
+ <name name="system_info" arity="1" clause_i="40"/>
+ <name name="system_info" arity="1" clause_i="41"/>
+ <name name="system_info" arity="1" clause_i="42"/>
+ <name name="system_info" arity="1" clause_i="43"/>
+ <name name="system_info" arity="1" clause_i="44"/>
+ <name name="system_info" arity="1" clause_i="45"/>
+ <name name="system_info" arity="1" clause_i="46"/>
+ <name name="system_info" arity="1" clause_i="47"/>
+ <name name="system_info" arity="1" clause_i="48"/>
+ <name name="system_info" arity="1" clause_i="49"/>
+ <name name="system_info" arity="1" clause_i="50"/>
+ <name name="system_info" arity="1" clause_i="51"/>
+ <fsummary>Information about the system</fsummary>
+ <desc>
+ <p>Returns various information about the current system
+ (emulator) as specified by <c><anno>Item</anno></c>:</p>
+ <taglist>
+ <tag><c>allocated_areas</c>, <c>allocator</c>,
+ <c>alloc_util_allocators</c>, <c>allocator_sizes</c></tag>
+ <item>
+ <p>See <seealso marker="#system_info_allocator_tags">above</seealso>.</p>
+ </item>
+ <tag><c>build_type</c></tag>
+ <item>
+ <p>Returns an atom describing the build type of the runtime
+ system. This is normally the atom <c>opt</c> for optimized.
+ Other possible return values are <c>debug</c>, <c>purify</c>,
+ <c>quantify</c>, <c>purecov</c>, <c>gcov</c>, <c>valgrind</c>,
+ <c>gprof</c>, and <c>lcnt</c>. Possible return values
+ may be added and/or removed at any time without prior notice.
+ </p>
+ </item>
+ <tag><c>c_compiler_used</c></tag>
+ <item>
+ <p>Returns a two-tuple describing the C compiler used when
+ compiling the runtime system. The first element is an
+ atom describing the name of the compiler, or <c>undefined</c>
+ if unknown. The second element is a term describing the
+ version of the compiler, or <c>undefined</c> if unknown.
+ </p>
+ </item>
+ <tag><c>check_io</c></tag>
+ <item>
+ <p>Returns a list containing miscellaneous information
+ regarding the emulators internal I/O checking. Note,
+ the content of the returned list may vary between
+ platforms and over time. The only thing guaranteed is
+ that a list is returned.</p>
+ </item>
+ <tag><c>compat_rel</c></tag>
+ <item>
+ <p>Returns the compatibility mode of the local node as
+ an integer. The integer returned represents the
+ Erlang/OTP release which the current emulator has been
+ set to be backward compatible with. The compatibility
+ mode can be configured at startup by using the command
+ line flag <c>+R</c>, see
+ <seealso marker="erts:erl#compat_rel">erl(1)</seealso>.</p>
+ </item>
+ <tag><c>cpu_topology</c></tag>
+ <item>
+ <p>See <seealso marker="#system_info_cpu_topology_tags">above</seealso>.</p>
+ </item>
<tag><c>creation</c></tag>
<item>
<p>Returns the creation of the local node as an integer.
@@ -5611,10 +5294,10 @@ true</pre>
<item>
<p>Returns a list of tuples
<c>{Node, ControllingEntity}</c>, one entry for each
- connected remote node. The <c>Node</c> is the name of the
- node and the <c>ControllingEntity</c> is the port or pid
+ connected remote node. The <c><anno>Node</anno></c> is the name of the
+ node and the <c><anno>ControllingEntity</anno></c> is the port or pid
responsible for the communication to that node. More
- specifically, the <c>ControllingEntity</c> for nodes
+ specifically, the <c><anno>ControllingEntity</anno></c> for nodes
connected via TCP/IP (the normal case) is the socket
actually used in communication with the specific node.</p>
</item>
@@ -5624,6 +5307,29 @@ true</pre>
used by the runtime system. It will be on the form
<seealso marker="erts:erl_driver#version_management">"&lt;major ver&gt;.&lt;minor ver&gt;"</seealso>.</p>
</item>
+ <tag><c>dynamic_trace</c></tag>
+ <item>
+ <p>Returns an atom describing the dynamic trace framework
+ compiled into the virtual machine. It can currently be either
+ <c>dtrace</c>, <c>systemtap</c> or <c>none</c>. For a
+ commercial or standard build, this is always <c>none</c>,
+ the other return values indicate a custom configuration
+ (e.g. <c>./configure --with-dynamic-trace=dtrace</c>). See
+ the <seealso marker="runtime_tools:dyntrace">dyntrace
+ </seealso> manual page and the
+ <c>README.dtrace</c>/<c>README.systemtap</c> files in the
+ Erlang source code top directory for more information
+ about dynamic tracing.</p>
+ </item>
+ <tag><c>dynamic_trace_probes</c></tag>
+ <item>
+ <p>Returns a <c>boolean()</c> indicating if dynamic trace probes
+ (either dtrace or systemtap) are built into the
+ emulator. This can only be <c>true</c> if the virtual
+ machine was built for dynamic tracing
+ (i.e. <c>system_info(dynamic_trace)</c> returns
+ <c>dtrace</c> or <c>systemtap</c>).</p>
+ </item>
<tag><c>elib_malloc</c></tag>
<item>
<p>This option will be removed in a future release.
@@ -5639,7 +5345,7 @@ true</pre>
</item>
<tag><c>fullsweep_after</c></tag>
<item>
- <p>Returns <c>{fullsweep_after, integer()}</c> which is the
+ <p>Returns <c>{fullsweep_after, integer() >= 0}</c> which is the
<c>fullsweep_after</c> garbage collection setting used
by default. For more information see
<c>garbage_collection</c> described below.</p>
@@ -5656,10 +5362,6 @@ true</pre>
can spawn a process that does not use the default
settings.</p>
</item>
- <tag><c>global_heaps_size</c></tag>
- <item>
- <p>Returns the current size of the shared (global) heap.</p>
- </item>
<tag><c>heap_sizes</c></tag>
<item>
<p>Returns a list of integers representing valid heap sizes
@@ -5669,7 +5371,7 @@ true</pre>
<tag><c>heap_type</c></tag>
<item>
<p>Returns the heap type used by the current emulator.
- Currently the following heap types exist:</p>
+ Currently only the following heap type exists:</p>
<taglist>
<tag><c>private</c></tag>
<item>
@@ -5678,17 +5380,6 @@ true</pre>
allowed. Messages passed between processes are copied
between heaps.</p>
</item>
- <tag><c>shared</c></tag>
- <item>
- <p>One heap for use by all processes. Messages passed
- between processes are passed by reference.</p>
- </item>
- <tag><c>hybrid</c></tag>
- <item>
- <p>A hybrid of the <c>private</c> and <c>shared</c> heap
- types. A shared heap as well as private heaps are
- used.</p>
- </item>
</taglist>
</item>
<tag><c>info</c></tag>
@@ -5747,12 +5438,12 @@ true</pre>
</item>
<tag><c>min_heap_size</c></tag>
<item>
- <p>Returns <c>{min_heap_size, MinHeapSize}</c> where <c>MinHeapSize</c> is the current system wide
+ <p>Returns <c>{min_heap_size, <anno>MinHeapSize</anno>}</c> where <c><anno>MinHeapSize</anno></c> is the current system wide
minimum heap size for spawned processes.</p>
</item>
<tag><c>min_bin_vheap_size</c></tag>
<item>
- <p>Returns <c>{min_bin_vheap_size, MinBinVHeapSize}</c> where <c>MinBinVHeapSize</c> is the current system wide
+ <p>Returns <c>{min_bin_vheap_size, <anno>MinBinVHeapSize</anno>}</c> where <c><anno>MinBinVHeapSize</anno></c> is the current system wide
minimum binary virtual heap size for spawned processes.</p>
</item>
<tag><c>modified_timing_level</c></tag>
@@ -5796,10 +5487,10 @@ true</pre>
</item>
<tag><marker id="system_info_multi_scheduling_blockers"><c>multi_scheduling_blockers</c></marker></tag>
<item>
- <p>Returns a list of <c>PID</c>s when multi-scheduling
- is blocked; otherwise, the empty list. The <c>PID</c>s
- in the list is <c>PID</c>s of the processes currently
- blocking multi-scheduling. A <c>PID</c> will only be
+ <p>Returns a list of <c><anno>PID</anno></c>s when multi-scheduling
+ is blocked; otherwise, the empty list. The <c><anno>PID</anno></c>s
+ in the list is <c><anno>PID</anno></c>s of the processes currently
+ blocking multi-scheduling. A <c><anno>PID</anno></c> will only be
present once in the list, even if the corresponding
process has blocked multiple times.</p>
<p>See also <seealso marker="#system_flag_multi_scheduling">erlang:system_flag(multi_scheduling, BlockState)</seealso>,
@@ -5874,7 +5565,7 @@ true</pre>
<item>
<p>Returns the scheduler id (<c>SchedulerId</c>) of the
scheduler thread that the calling process is executing
- on. <c>SchedulerId</c> is a positive integer; where
+ on. <c><anno>SchedulerId</anno></c> is a positive integer; where
<c><![CDATA[1 <= SchedulerId <= erlang:system_info(schedulers)]]></c>. See also
<seealso marker="#system_info_schedulers">erlang:system_info(schedulers)</seealso>.</p>
</item>
@@ -5906,7 +5597,8 @@ true</pre>
<seealso marker="#system_info_schedulers">erlang:system_info(schedulers)</seealso>,
and
<seealso marker="#system_flag_schedulers_online">erlang:system_flag(schedulers_online, SchedulersOnline)</seealso>.
- </p>
+ </p> <name name="system_info" arity="1" clause_i="49"/>
+
</item>
<tag><c>smp_support</c></tag>
<item>
@@ -6000,53 +5692,39 @@ true</pre>
</func>
<func>
- <name>erlang:system_monitor() -> MonSettings</name>
+ <name name="system_monitor" arity="0"/>
+ <type name="system_monitor_option"/>
<fsummary>Current system performance monitoring settings</fsummary>
- <type>
- <v>MonSettings -> {MonitorPid, Options} | undefined</v>
- <v>&nbsp;MonitorPid = pid()</v>
- <v>&nbsp;Options = [Option]</v>
- <v>&nbsp;&nbsp;Option = {long_gc, Time} | {large_heap, Size} | busy_port | busy_dist_port</v>
- <v>&nbsp;&nbsp;&nbsp;Time = Size = integer()</v>
- </type>
<desc>
<p>Returns the current system monitoring settings set by
<seealso marker="#system_monitor/2">erlang:system_monitor/2</seealso>
- as <c>{MonitorPid, Options}</c>, or <c>undefined</c> if there
+ as <c>{<anno>MonitorPid</anno>, <anno>Options</anno>}</c>, or <c>undefined</c> if there
are no settings. The order of the options may be different
from the one that was set.</p>
</desc>
</func>
<func>
- <name>erlang:system_monitor(undefined | {MonitorPid, Options}) -> MonSettings</name>
+ <name name="system_monitor" arity="1"/>
+ <type name="system_monitor_option"/>
<fsummary>Set or clear system performance monitoring options</fsummary>
- <type>
- <v>MonitorPid, Options, MonSettings -- see below</v>
- </type>
<desc>
<p>When called with the argument <c>undefined</c>, all
system performance monitoring settings are cleared.</p>
- <p>Calling the function with <c>{MonitorPid, Options}</c> as
+ <p>Calling the function with <c>{<anno>MonitorPid</anno>, <anno>Options</anno>}</c> as
argument, is the same as calling
- <seealso marker="#system_monitor/2">erlang:system_monitor(MonitorPid, Options)</seealso>.</p>
+ <seealso marker="#system_monitor/2">erlang:system_monitor(<anno>MonitorPid</anno>, <anno>Options</anno>)</seealso>.</p>
<p>Returns the previous system monitor settings just like
<seealso marker="#system_monitor/0">erlang:system_monitor/0</seealso>.</p>
</desc>
</func>
<func>
- <name>erlang:system_monitor(MonitorPid, [Option]) -> MonSettings</name>
+ <name name="system_monitor" arity="2"/>
+ <type name="system_monitor_option"/>
<fsummary>Set system performance monitoring options</fsummary>
- <type>
- <v>MonitorPid = pid()</v>
- <v>Option = {long_gc, Time} | {large_heap, Size} | busy_port | busy_dist_port</v>
- <v>&nbsp;Time = Size = integer()</v>
- <v>MonSettings = {OldMonitorPid, [Option]}</v>
- <v>&nbsp;OldMonitorPid = pid()</v>
- </type>
- <desc>
- <p>Sets system performance monitoring options. <c>MonitorPid</c>
+ <desc>
+ <p>Sets system performance monitoring options. <c><anno>MonitorPid</anno></c>
is a local pid that will receive system monitor messages, and
the second argument is a list of monitoring options:</p>
<taglist>
@@ -6055,7 +5733,7 @@ true</pre>
<p>If a garbage collection in the system takes at least
<c>Time</c> wallclock milliseconds, a message
<c>{monitor, GcPid, long_gc, Info}</c> is sent to
- <c>MonitorPid</c>. <c>GcPid</c> is the pid that was
+ <c><anno>MonitorPid</anno></c>. <c>GcPid</c> is the pid that was
garbage collected and <c>Info</c> is a list of two-element
tuples describing the result of the garbage collection.
One of the tuples is <c>{timeout, GcTime}</c> where
@@ -6078,7 +5756,7 @@ true</pre>
<p>If a garbage collection in the system results in
the allocated size of a heap being at least <c>Size</c>
words, a message <c>{monitor, GcPid, large_heap, Info}</c>
- is sent to <c>MonitorPid</c>. <c>GcPid</c> and <c>Info</c>
+ is sent to <c><anno>MonitorPid</anno></c>. <c>GcPid</c> and <c>Info</c>
are the same as for <c>long_gc</c> above, except that
the tuple tagged with <c>timeout</c> is not present.
<em>Note</em>: As of erts version 5.6 the monitor message
@@ -6094,7 +5772,7 @@ true</pre>
<p>If a process in the system gets suspended because it
sends to a busy port, a message
<c>{monitor, SusPid, busy_port, Port}</c> is sent to
- <c>MonitorPid</c>. <c>SusPid</c> is the pid that got
+ <c><anno>MonitorPid</anno></c>. <c>SusPid</c> is the pid that got
suspended when sending to <c>Port</c>.</p>
</item>
<tag><c>busy_dist_port</c></tag>
@@ -6103,7 +5781,7 @@ true</pre>
sends to a process on a remote node whose inter-node
communication was handled by a busy port, a message
<c>{monitor, SusPid, busy_dist_port, Port}</c> is sent to
- <c>MonitorPid</c>. <c>SusPid</c> is the pid that got
+ <c><anno>MonitorPid</anno></c>. <c>SusPid</c> is the pid that got
suspended when sending through the inter-node
communication port <c>Port</c>.</p>
</item>
@@ -6118,48 +5796,48 @@ true</pre>
<p>Keep the monitoring process neat and do not set the system
monitor limits too tight.</p>
</note>
- <p>Failure: <c>badarg</c> if <c>MonitorPid</c> does not exist.</p>
+ <p>Failure: <c>badarg</c> if <c><anno>MonitorPid</anno></c> does not exist or is not a local process.</p>
</desc>
</func>
<func>
- <name>erlang:system_profile() -> ProfilerSettings</name>
+ <name name="system_profile" arity="0"/>
+ <type name="system_profile_option"/>
<fsummary>Current system profiling settings</fsummary>
- <type>
- <v>ProfilerSettings -> {ProfilerPid, Options} | undefined</v>
- <v>&nbsp;ProfilerPid = pid() | port()</v>
- <v>&nbsp;Options = [Option]</v>
- <v>&nbsp;&nbsp;Option = runnable_procs | runnable_ports | scheduler | exclusive</v>
- </type>
<desc>
<p>Returns the current system profiling settings set by
<seealso marker="#system_profile/2">erlang:system_profile/2</seealso>
- as <c>{ProfilerPid, Options}</c>, or <c>undefined</c> if there
+ as <c>{<anno>ProfilerPid</anno>, <anno>Options</anno>}</c>, or <c>undefined</c> if there
are no settings. The order of the options may be different
from the one that was set.</p>
</desc>
</func>
<func>
- <name>erlang:system_profile(ProfilerPid, Options) -> ProfilerSettings</name>
+ <name name="system_profile" arity="2"/>
+ <type name="system_profile_option"/>
<fsummary>Current system profiling settings</fsummary>
- <type>
- <v>ProfilerSettings -> {ProfilerPid, Options} | undefined</v>
- <v>&nbsp;ProfilerPid = pid() | port()</v>
- <v>&nbsp;Options = [Option]</v>
- <v>&nbsp;&nbsp;Option = runnable_procs | runnable_ports | scheduler | exclusive</v>
- </type>
- <desc>
- <p>Sets system profiler options. <c>ProfilerPid</c>
+ <desc>
+ <p>Sets system profiler options. <c><anno>ProfilerPid</anno></c>
is a local pid or port that will receive profiling messages. The
receiver is excluded from all profiling.
The second argument is a list of profiling options:</p>
<taglist>
+ <tag><c>exclusive</c></tag>
+ <item>
+ <p>
+ If a synchronous call to a port from a process is done, the
+ calling process is considered not runnable during the call
+ runtime to the port. The calling process is notified as
+ <c>inactive</c> and subsequently <c>active</c> when the port
+ callback returns.
+ </p>
+ </item>
<tag><c>runnable_procs</c></tag>
<item>
<p>If a process is put into or removed from the run queue a message,
<c>{profile, Pid, State, Mfa, Ts}</c>, is sent to
- <c>ProfilerPid</c>. Running processes that is reinserted into the
+ <c><anno>ProfilerPid</anno></c>. Running processes that is reinserted into the
run queue after having been preemptively scheduled out will not trigger this
message.
</p>
@@ -6168,24 +5846,14 @@ true</pre>
<item>
<p>If a port is put into or removed from the run queue a message,
<c>{profile, Port, State, 0, Ts}</c>, is sent to
- <c>ProfilerPid</c>.
+ <c><anno>ProfilerPid</anno></c>.
</p>
</item>
<tag><c>scheduler</c></tag>
<item>
<p>If a scheduler is put to sleep or awoken a message,
<c>{profile, scheduler, Id, State, NoScheds, Ts}</c>, is sent
- to <c>ProfilerPid</c>.
- </p>
- </item>
- <tag><c>exclusive</c></tag>
- <item>
- <p>
- If a synchronous call to a port from a process is done, the
- calling process is considered not runnable during the call
- runtime to the port. The calling process is notified as
- <c>inactive</c> and subsequently <c>active</c> when the port
- callback returns.
+ to <c><anno>ProfilerPid</anno></c>.
</p>
</item>
</taglist>
@@ -6196,14 +5864,11 @@ true</pre>
</func>
<func>
- <name>term_to_binary(Term) -> ext_binary()</name>
+ <name name="term_to_binary" arity="1"/>
<fsummary>Encode a term to an Erlang external term format binary</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
<p>Returns a binary data object which is the result of encoding
- <c>Term</c> according to the Erlang external term format.</p>
+ <c><anno>Term</anno></c> according to the Erlang external term format.</p>
<p>This can be used for a variety of purposes, for example
writing a term to a file in an efficient way, or sending an
Erlang term to some type of communications channel not
@@ -6213,20 +5878,16 @@ true</pre>
</desc>
</func>
<func>
- <name>term_to_binary(Term, [Option]) -> ext_binary()</name>
+ <name name="term_to_binary" arity="2"/>
<fsummary>Encode a term to en Erlang external term format binary</fsummary>
- <type>
- <v>Term = term()</v>
- <v>Option = compressed | {compressed,Level} | {minor_version,Version}</v>
- </type>
<desc>
<p>Returns a binary data object which is the result of encoding
- <c>Term</c> according to the Erlang external term format.</p>
+ <c><anno>Term</anno></c> according to the Erlang external term format.</p>
<p>If the option <c>compressed</c> is provided, the external
term format will be compressed. The compressed format is
automatically recognized by <c>binary_to_term/1</c> in R7B and later.</p>
<p>It is also possible to specify a compression level by giving
- the option <c>{compressed,Level}</c>, where <c>Level</c> is an
+ the option <c>{compressed, <anno>Level</anno>}</c>, where <c><anno>Level</anno></c> is an
integer from 0 through 9. <c>0</c> means that no compression
will be done (it is the same as not giving any <c>compressed</c> option);
<c>1</c> will take the least time but may not compress as well as
@@ -6235,16 +5896,16 @@ true</pre>
on the input term, level 9 compression may or may not produce a smaller
result than level 1 compression.</p>
<p>Currently, <c>compressed</c> gives the same result as
- <c>{compressed,6}</c>.</p>
- <p>The option <c>{minor_version,Version}</c> can be use to control
+ <c>{compressed, 6}</c>.</p>
+ <p>The option <c>{minor_version, <anno>Version</anno>}</c> can be use to control
some details of the encoding. This option was
- introduced in R11B-4. Currently, the allowed values for <c>Version</c>
+ introduced in R11B-4. Currently, the allowed values for <c><anno>Version</anno></c>
are <c>0</c> and <c>1</c>.</p>
- <p><c>{minor_version,1}</c> forces any floats in the term to be encoded
+ <p><c>{minor_version, 1}</c> forces any floats in the term to be encoded
in a more space-efficient and exact way (namely in the 64-bit IEEE format,
rather than converted to a textual representation). <c>binary_to_term/1</c>
in R11B-4 and later is able decode the new representation.</p>
- <p><c>{minor_version,0}</c> is currently the default, meaning that floats
+ <p><c>{minor_version, 0}</c> is currently the default, meaning that floats
will be encoded using a textual representation; this option is useful if
you want to ensure that releases prior to R11B-4 can decode resulting
binary.</p>
@@ -6253,14 +5914,11 @@ true</pre>
</desc>
</func>
<func>
- <name>throw(Any)</name>
+ <name name="throw" arity="1"/>
<fsummary>Throw an exception</fsummary>
- <type>
- <v>Any = term()</v>
- </type>
<desc>
<p>A non-local return from a function. If evaluated within a
- <c>catch</c>, <c>catch</c> will return the value <c>Any</c>.</p>
+ <c>catch</c>, <c>catch</c> will return the value <c><anno>Any</anno></c>.</p>
<pre>
> <input>catch throw({hello, there}).</input>
{hello,there}</pre>
@@ -6268,11 +5926,8 @@ true</pre>
</desc>
</func>
<func>
- <name>time() -> {Hour, Minute, Second}</name>
+ <name name="time" arity="0"/>
<fsummary>Current time</fsummary>
- <type>
- <v>Hour = Minute = Second = integer() >= 0</v>
- </type>
<desc>
<p>Returns the current time as <c>{Hour, Minute, Second}</c>.</p>
<p>The time zone and daylight saving time correction depend on
@@ -6283,35 +5938,27 @@ true</pre>
</desc>
</func>
<func>
- <name>tl(List1) -> List2</name>
+ <name name="tl" arity="1"/>
<fsummary>Tail of a list</fsummary>
- <type>
- <v>List1 = List2 = [term()]</v>
- </type>
<desc>
- <p>Returns the tail of <c>List1</c>, that is, the list minus
+ <p>Returns the tail of <c><anno>List</anno></c>, that is, the list minus
the first element.</p>
<pre>
> <input>tl([geesties, guilies, beasties]).</input>
[guilies, beasties]</pre>
<p>Allowed in guard tests.</p>
- <p>Failure: <c>badarg</c> if <c>List</c> is the empty list [].</p>
+ <p>Failure: <c>badarg</c> if <c><anno>List</anno></c> is the empty list [].</p>
</desc>
</func>
<func>
- <name>erlang:trace(PidSpec, How, FlagList) -> integer() >= 0</name>
+ <name name="trace" arity="3"/>
+ <type name="trace_flag"/>
<fsummary>Set trace flags for a process or processes</fsummary>
- <type>
- <v>PidSpec = pid() | existing | new | all</v>
- <v>How = boolean()</v>
- <v>FlagList = [Flag]</v>
- <v>&nbsp;Flag -- see below</v>
- </type>
- <desc>
- <p>Turns on (if <c>How == true</c>) or off (if
- <c>How == false</c>) the trace flags in <c>FlagList</c> for
- the process or processes represented by <c>PidSpec</c>.</p>
- <p><c>PidSpec</c> is either a pid for a local process, or one of
+ <desc>
+ <p>Turns on (if <c><anno>How</anno> == true</c>) or off (if
+ <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 pid for a local process, or one of
the following atoms:</p>
<taglist>
<tag><c>existing</c></tag>
@@ -6328,7 +5975,7 @@ true</pre>
will be created in the future.</p>
</item>
</taglist>
- <p><c>FlagList</c> can contain any number of the following
+ <p><c><anno>FlagList</anno></c> can contain any number of the following
flags (the "message tags" refers to the list of messages
following below):</p>
<taglist>
@@ -6643,11 +6290,11 @@ true</pre>
<p>Only one process can trace a particular process. For this
reason, attempts to trace an already traced process will fail.</p>
<p>Returns: A number indicating the number of processes that
- matched <c>PidSpec</c>. If <c>PidSpec</c> is a pid,
- the return value will be <c>1</c>. If <c>PidSpec</c> is
+ matched <c><anno>PidSpec</anno></c>. If <c><anno>PidSpec</anno></c> is a pid,
+ the return value will be <c>1</c>. If <c><anno>PidSpec</anno></c> is
<c>all</c> or <c>existing</c> the return value will be
the number of processes running, excluding tracer processes.
- If <c>PidSpec</c> is <c>new</c>, the return value will be
+ If <c><anno>PidSpec</anno></c> is <c>new</c>, the return value will be
<c>0</c>.</p>
<p>Failure: If specified arguments are not supported. For
example <c>cpu_timestamp</c> is not supported on all
@@ -6655,64 +6302,58 @@ true</pre>
</desc>
</func>
<func>
- <name>erlang:trace_delivered(Tracee) -> Ref</name>
+ <name name="trace_delivered" arity="1"/>
<fsummary>Notification when trace has been delivered</fsummary>
- <type>
- <v>Tracee = pid() | all</v>
- <v>Ref = reference()</v>
- </type>
<desc>
<p>The delivery of trace messages is dislocated on the time-line
compared to other events in the system. If you know that the
- <c>Tracee</c> has passed some specific point in its execution,
+ <c><anno>Tracee</anno></c> has passed some specific point in its execution,
and you want to know when at least all trace messages
corresponding to events up to this point have reached the tracer
- you can use <c>erlang:trace_delivered(Tracee)</c>. A
- <c>{trace_delivered, Tracee, Ref}</c> message is sent to
- the caller of <c>erlang:trace_delivered(Tracee)</c> when it
+ you can use <c>erlang:trace_delivered(<anno>Tracee</anno>)</c>. A
+ <c>{trace_delivered, <anno>Tracee</anno>, <anno>Ref</anno>}</c> message is sent to
+ the caller of <c>erlang:trace_delivered(<anno>Tracee</anno>)</c> when it
is guaranteed that all trace messages have been delivered to
- the tracer up to the point that the <c>Tracee</c> had reached
+ the tracer up to the point that the <c><anno>Tracee</anno></c> had reached
at the time of the call to
- <c>erlang:trace_delivered(Tracee)</c>.</p>
+ <c>erlang:trace_delivered(<anno>Tracee</anno>)</c>.</p>
<p>Note that the <c>trace_delivered</c> message does <em>not</em>
imply that trace messages have been delivered; instead, it implies
that all trace messages that <em>should</em> be delivered have
- been delivered. It is not an error if <c>Tracee</c> isn't, and
+ been delivered. It is not an error if <c><anno>Tracee</anno></c> isn't, and
hasn't been traced by someone, but if this is the case,
<em>no</em> trace messages will have been delivered when the
<c>trace_delivered</c> message arrives.</p>
- <p>Note that <c>Tracee</c> has to refer to a process currently,
+ <p>Note that <c><anno>Tracee</anno></c> has to refer to a process currently,
or previously existing on the same node as the caller of
- <c>erlang:trace_delivered(Tracee)</c> resides on.
- The special <c>Tracee</c> atom <c>all</c> denotes all processes
+ <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>
- <p>An example: Process <c>A</c> is tracee, port <c>B</c> is
+ <p>An 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 <c>A</c> exits. <c>C</c>
can ensure that the trace isn't truncated by calling
<c>erlang:trace_delivered(A)</c> when <c>A</c> exits and wait
- for the <c>{trace_delivered, A, Ref}</c> message before closing
+ for the <c>{trace_delivered, A, <anno>Ref</anno>}</c> message before closing
<c>B</c>.</p>
- <p>Failure: <c>badarg</c> if <c>Tracee</c> does not refer to a
+ <p>Failure: <c>badarg</c> if <c><anno>Tracee</anno></c> does not refer to a
process (dead or alive) on the same node as the caller of
- <c>erlang:trace_delivered(Tracee)</c> resides on.</p>
+ <c>erlang:trace_delivered(<anno>Tracee</anno>)</c> resides on.</p>
</desc>
</func>
<func>
- <name>erlang:trace_info(PidOrFunc, Item) -> Res</name>
+ <name name="trace_info" arity="2"/>
+ <type name="trace_info_return"/>
+ <type name="trace_info_item_result"/>
+ <type name="trace_info_flag"/>
+ <type name="trace_match_spec"/>
<fsummary>Trace information about a process or function</fsummary>
- <type>
- <v>PidOrFunc = pid() | new | {Module, Function, Arity} | on_load</v>
- <v>&nbsp;Module = Function = atom()</v>
- <v>&nbsp;Arity = arity()</v>
- <v>Item, Res -- see below</v>
- </type>
<desc>
<p>Returns trace information about a process or function.</p>
- <p>To get information about a process, <c>PidOrFunc</c> should
+ <p>To get information about a process, <c><anno>PidOrFunc</anno></c> should
be a pid or the atom <c>new</c>. The atom <c>new</c> means
that the default trace state for processes to be created will
- be returned. <c>Item</c> must have one of the following
+ be returned. <c><anno>Item</anno></c> must have one of the following
values:</p>
<taglist>
<tag><c>flags</c></tag>
@@ -6792,22 +6433,24 @@ true</pre>
<tag><c>all</c></tag>
<item>
- <p>Return a list containing the <c>{Item, Value}</c> tuples
+ <p>Return a list containing the <c>{<anno>Item</anno>, Value}</c> tuples
for all other items, or return <c>false</c> if no tracing
is active for this function.</p>
</item>
</taglist>
- <p>The actual return value will be <c>{Item, Value}</c>, where
+ <p>The actual return value will be <c>{<anno>Item</anno>, Value}</c>, where
<c>Value</c> is the requested information as described above.
If a pid for a dead process was given, or the name of a
non-existing function, <c>Value</c> will be <c>undefined</c>.</p>
- <p>If <c>PidOrFunc</c> is the <c>on_load</c>, the information
+ <p>If <c><anno>PidOrFunc</anno></c> is the <c>on_load</c>, the information
returned refers to the default value for code that will be
loaded.</p>
</desc>
</func>
<func>
- <name>erlang:trace_pattern(MFA, MatchSpec) -> integer() >= 0</name>
+ <name name="trace_pattern" arity="2" clause_i="1"/>
+ <type name="trace_pattern_mfa"/>
+ <type name="trace_match_spec"/>
<fsummary>Set trace patterns for global call tracing</fsummary>
<desc>
<p>The same as
@@ -6816,11 +6459,11 @@ true</pre>
</desc>
</func>
<func>
- <name>erlang:trace_pattern(MFA, MatchSpec, FlagList) -> integer() >= 0</name>
+ <name name="trace_pattern" arity="3"/>
+ <type name="trace_pattern_mfa"/>
+ <type name="trace_match_spec"/>
+ <type name="trace_pattern_flag"/>
<fsummary>Set trace patterns for tracing of function calls</fsummary>
- <type>
- <v>MFA, MatchSpec, FlagList -- see below</v>
- </type>
<desc>
<p>This BIF is used to enable or disable call tracing for
exported functions. It must be combined with
@@ -6845,7 +6488,7 @@ true</pre>
and an action to be performed. The default action is to send a
trace message. If the pattern does not match or the guard
fails, the action will not be executed.</p>
- <p>The <c>MFA</c> argument should be a tuple like
+ <p>The <c><anno>MFA</anno></c> argument should be a tuple like
<c>{Module, Function, Arity}</c> or the atom <c>on_load</c>
(described below). It can be the module, function, and arity
for an exported function (or a BIF in any module).
@@ -6868,11 +6511,11 @@ true</pre>
</taglist>
<p>Other combinations, such as <c>{Module,'_',Arity}</c>, are
not allowed. Local functions will match wildcards only if
- the <c>local</c> option is in the <c>FlagList</c>.</p>
- <p>If the <c>MFA</c> argument is the atom <c>on_load</c>,
+ the <c>local</c> option is in the <c><anno>FlagList</anno></c>.</p>
+ <p>If the <c><anno>MFA</anno></c> argument is the atom <c>on_load</c>,
the match specification and flag list will be used on all
modules that are newly loaded.</p>
- <p>The <c>MatchSpec</c> argument can take any of the following
+ <p>The <c><anno>MatchSpec</anno></c> argument can take any of the following
forms:</p>
<taglist>
<tag><c>false</c></tag>
@@ -6884,7 +6527,7 @@ true</pre>
<item>
<p>Enable tracing for the matching function(s).</p>
</item>
- <tag><c>MatchSpecList</c></tag>
+ <tag><c><anno>MatchSpecList</anno></c></tag>
<item>
<p>A list of match specifications. An empty list is
equivalent to <c>true</c>. See the ERTS User's Guide
@@ -6892,18 +6535,18 @@ true</pre>
</item>
<tag><c>restart</c></tag>
<item>
- <p>For the <c>FlagList</c> option <c>call_count</c> and <c>call_time</c>:
+ <p>For the <c><anno>FlagList</anno></c> option <c>call_count</c> and <c>call_time</c>:
restart the existing counters. The behaviour is undefined
- for other <c>FlagList</c> options.</p>
+ for other <c><anno>FlagList</anno></c> options.</p>
</item>
<tag><c>pause</c></tag>
<item>
- <p>For the <c>FlagList</c> option <c>call_count</c> and <c>call_time</c>: pause
+ <p>For the <c><anno>FlagList</anno></c> option <c>call_count</c> and <c>call_time</c>: pause
the existing counters. The behaviour is undefined for
other <c>FlagList</c> options.</p>
</item>
</taglist>
- <p>The <c>FlagList</c> parameter is a list of options.
+ <p>The <c><anno>FlagList</anno></c> parameter is a list of options.
The following options are allowed:</p>
<taglist>
<tag><c>global</c></tag>
@@ -6922,13 +6565,13 @@ true</pre>
the process, a <c>return_to</c> message will also be sent
when this function returns to its caller.</p>
</item>
- <tag><c>meta | {meta, Pid}</c></tag>
+ <tag><c>meta | {meta, <anno>Pid</anno>}</c></tag>
<item>
<p>Turn on or off meta tracing for all types of function
calls. Trace messages will be sent to the tracer process
- or port <c>Pid</c> whenever any of the specified
+ or port <c><anno>Pid</anno></c> whenever any of the specified
functions are called, regardless of how they are called.
- If no <c>Pid</c> is specified, <c>self()</c> is used as a
+ If no <c><anno>Pid</anno></c> 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>,
@@ -6940,32 +6583,32 @@ true</pre>
</item>
<tag><c>call_count</c></tag>
<item>
- <p>Starts (<c>MatchSpec == true</c>) or stops
- (<c>MatchSpec == false</c>) call count tracing for all
+ <p>Starts (<c><anno>MatchSpec</anno> == true</c>) or stops
+ (<c><anno>MatchSpec</anno> == false</c>) call count tracing for all
types of function calls. For every function a counter is
incremented when the function is called, in any process.
No process trace flags need to be activated.</p>
<p>If call count tracing is started while already running,
the count is restarted from zero. Running counters can be
- paused with <c>MatchSpec == pause</c>. Paused and running
+ paused with <c><anno>MatchSpec</anno> == pause</c>. Paused and running
counters can be restarted from zero with
- <c>MatchSpec == restart</c>.</p>
+ <c><anno>MatchSpec</anno> == restart</c>.</p>
<p>The counter value can be read with
<seealso marker="#trace_info/2">erlang:trace_info/2</seealso>.</p>
</item>
<tag><c>call_time</c></tag>
<item>
- <p>Starts (<c>MatchSpec == true</c>) or stops
- (<c>MatchSpec == false</c>) call time tracing for all
+ <p>Starts (<c><anno>MatchSpec</anno> == true</c>) or stops
+ (<c><anno>MatchSpec</anno> == false</c>) call time tracing for all
types of function calls. For every function a counter is
incremented when the function is called. Time spent in the function
is accumulated in two other counters, seconds and micro-seconds.
The counters are stored for each call traced process.</p>
<p>If call time tracing is started while already running,
the count and time is restarted from zero. Running counters can be
- paused with <c>MatchSpec == pause</c>. Paused and running
+ paused with <c><anno>MatchSpec</anno> == pause</c>. Paused and running
counters can be restarted from zero with
- <c>MatchSpec == restart</c>.</p>
+ <c><anno>MatchSpec</anno> == restart</c>.</p>
<p>The counter value can be read with
<seealso marker="#trace_info/2">erlang:trace_info/2</seealso>.</p>
</item>
@@ -6991,18 +6634,15 @@ true</pre>
<seealso marker="#trace_info/2">erlang:trace_info/2</seealso>
BIF to retrieve the existing match specification.</p>
<p>Returns the number of exported functions that matched
- the <c>MFA</c> argument. This will be zero if none matched at
+ the <c><anno>MFA</anno></c> argument. This will be zero if none matched at
all.</p>
</desc>
</func>
<func>
- <name>trunc(Number) -> integer()</name>
+ <name name="trunc" arity="1"/>
<fsummary>Return an integer by the truncating a number</fsummary>
- <type>
- <v>Number = number()</v>
- </type>
<desc>
- <p>Returns an integer by the truncating <c>Number</c>.</p>
+ <p>Returns an integer by the truncating <c><anno>Number</anno></c>.</p>
<pre>
> <input>trunc(5.5).</input>
5</pre>
@@ -7010,13 +6650,10 @@ true</pre>
</desc>
</func>
<func>
- <name>tuple_size(Tuple) -> integer() >= 0</name>
+ <name name="tuple_size" arity="1"/>
<fsummary>Return the size of a tuple</fsummary>
- <type>
- <v>Tuple = tuple()</v>
- </type>
<desc>
- <p>Returns an integer which is the number of elements in <c>Tuple</c>.</p>
+ <p>Returns an integer which is the number of elements in <c><anno>Tuple</anno></c>.</p>
<pre>
> <input>tuple_size({morni, mulle, bwange}).</input>
3</pre>
@@ -7024,25 +6661,19 @@ true</pre>
</desc>
</func>
<func>
- <name>tuple_to_list(Tuple) -> [term()]</name>
+ <name name="tuple_to_list" arity="1"/>
<fsummary>Convert a tuple to a list</fsummary>
- <type>
- <v>Tuple = tuple()</v>
- </type>
<desc>
- <p>Returns a list which corresponds to <c>Tuple</c>.
- <c>Tuple</c> may contain any Erlang terms.</p>
+ <p>Returns a list which corresponds to <c><anno>Tuple</anno></c>.
+ <c><anno>Tuple</anno></c> may contain any Erlang terms.</p>
<pre>
> <input>tuple_to_list({share, {'Ericsson_B', 163}}).</input>
[share,{'Ericsson_B',163}]</pre>
</desc>
</func>
<func>
- <name>erlang:universaltime() -> DateTime</name>
+ <name name="universaltime" arity="0"/>
<fsummary>Current date and time according to Universal Time Coordinated (UTC)</fsummary>
- <type>
- <v>DateTime = <seealso marker="calendar#type-datetime">calendar:datetime()</seealso></v>
- </type>
<desc>
<p>Returns the current date and time according to Universal
Time Coordinated (UTC), also called GMT, in the form
@@ -7056,46 +6687,39 @@ true</pre>
</desc>
</func>
<func>
- <name>erlang:universaltime_to_localtime({Date1, Time1}) -> {Date2, Time2}</name>
+ <name name="universaltime_to_localtime" arity="1"/>
<fsummary>Convert from Universal Time Coordinated (UTC) to local date and time</fsummary>
- <type>
- <v>Date1 = Date2 = <seealso marker="calendar#type-date">calendar:date()</seealso></v>
- <v>Time1 = Time2 = <seealso marker="calendar#type-time">calendar:time()</seealso></v>
- </type>
<desc>
<p>Converts Universal Time Coordinated (UTC) date and time to
local date and time, if this is supported by the underlying
OS. Otherwise, no conversion is done, and
- <c>{Date1, Time1}</c> is returned.</p>
+ <c><anno>Universaltime</anno></c> is returned.</p>
<pre>
> <input>erlang:universaltime_to_localtime({{1996,11,6},{14,18,43}}).</input>
{{1996,11,7},{15,18,43}}</pre>
- <p>Failure: <c>badarg</c> if <c>Date1</c> or <c>Time1</c> do
- not denote a valid date or time.</p>
+ <p>Failure: <c>badarg</c> if <c>Universaltime</c> does not denote
+ a valid date and time.</p>
</desc>
</func>
<func>
- <name>unlink(Id) -> true</name>
+ <name name="unlink" arity="1"/>
<fsummary>Remove a link, if there is one, to another process or port</fsummary>
- <type>
- <v>Id = pid() | port()</v>
- </type>
<desc>
<p>Removes the link, if there is one, between the calling
- process and the process or port referred to by <c>Id</c>.</p>
+ process and the process or port referred to by <c><anno>Id</anno></c>.</p>
<p>Returns <c>true</c> and does not fail, even if there is no
- link to <c>Id</c>, or if <c>Id</c> does not exist.</p>
- <p>Once <c>unlink(Id)</c> has returned it is guaranteed that
+ link to <c><anno>Id</anno></c>, or if <c><anno>Id</anno></c> does not exist.</p>
+ <p>Once <c>unlink(<anno>Id</anno>)</c> has returned it is guaranteed that
the link between the caller and the entity referred to by
- <c>Id</c> has no effect on the caller in the future (unless
+ <c><anno>Id</anno></c> has no effect on the caller in the future (unless
the link is setup again). If caller is trapping exits, an
- <c>{'EXIT', Id, _}</c> message due to the link might have
+ <c>{'EXIT', <anno>Id</anno>, _}</c> message due to the link might have
been placed in the caller's message queue prior to the call,
- though. Note, the <c>{'EXIT', Id, _}</c> message can be the
- result of the link, but can also be the result of <c>Id</c>
+ though. Note, the <c>{'EXIT', <anno>Id</anno>, _}</c> message can be the
+ result of the link, but can also be the result of <c><anno>Id</anno></c>
calling <c>exit/2</c>. Therefore, it <em>may</em> be
appropriate to cleanup the message queue when trapping exits
- after the call to <c>unlink(Id)</c>, as follow:</p>
+ after the call to <c>unlink(<anno>Id</anno>)</c>, as follow:</p>
<code type="none">
unlink(Id),
@@ -7118,13 +6742,10 @@ true</pre>
</desc>
</func>
<func>
- <name>unregister(RegName) -> true</name>
+ <name name="unregister" arity="1"/>
<fsummary>Remove the registered name for a process (or port)</fsummary>
- <type>
- <v>RegName = atom()</v>
- </type>
<desc>
- <p>Removes the registered name <c>RegName</c>, associated with a
+ <p>Removes the registered name <c><anno>RegName</anno></c>, associated with a
pid or a port identifier.</p>
<pre>
> <input>unregister(db).</input>
@@ -7135,7 +6756,7 @@ true</pre>
</desc>
</func>
<func>
- <name>whereis(RegName) -> pid() | port() | undefined</name>
+ <name name="whereis" arity="1"/>
<fsummary>Get the pid (or port) with a given registered name</fsummary>
<desc>
<p>Returns the pid or port identifier with the registered name
diff --git a/erts/doc/src/erlc.xml b/erts/doc/src/erlc.xml
index ebf76a2afe..81dffe45cf 100644
--- a/erts/doc/src/erlc.xml
+++ b/erts/doc/src/erlc.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
- <year>1997</year><year>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -67,7 +67,7 @@
<item>
<p>Instructs the compiler to search for include files in
the specified directory. When encountering an
- <c><![CDATA[-include]]></c> or <c><![CDATA[-include_dir]]></c> directive, the
+ <c><![CDATA[-include]]></c> or <c><![CDATA[-include_lib]]></c> directive, the
compiler searches for header files in the following
directories:</p>
<list type="ordered">
@@ -129,12 +129,6 @@
This option will be ignored by compilers that have a
a single output format.</p>
</item>
- <tag>-hybrid</tag>
- <item>
- <p>Compile using the hybrid-heap emulator. This is mainly useful
- for compiling native code, which needs to be compiled with the same
- run-time system that it should be run on.</p>
- </item>
<tag>-smp</tag>
<item>
<p>Compile using the SMP emulator. This is mainly useful
diff --git a/erts/doc/src/erlsrv.xml b/erts/doc/src/erlsrv.xml
index c1ecbc7b77..365ae21d39 100644
--- a/erts/doc/src/erlsrv.xml
+++ b/erts/doc/src/erlsrv.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
- <year>1998</year><year>2011</year>
+ <year>1998</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -357,11 +357,12 @@ The environment of an Erlang machine started
the console subsystem and programs running as window
applications. An application which runs in the console subsystem
(normal for port programs) uses the win32 function
- <c><![CDATA[SetConsoleCtrlHandler]]></c> to a control handler that returns
- TRUE in answer to the <c><![CDATA[CTRL_LOGOFF_EVENT]]></c>. Other
- applications just forward <c><![CDATA[WM_ENDSESSION]]></c> and
- <c><![CDATA[WM_QUERYENDSESSION]]></c> to the default window procedure. Here
- is a brief example in C of how to set the console control
+ <c><![CDATA[SetConsoleCtrlHandler]]></c> to register a control handler
+ that returns TRUE in answer to the <c><![CDATA[CTRL_LOGOFF_EVENT]]></c>
+ and <c><![CDATA[CTRL_SHUTDOWN_EVENT]]></c> events. Other applications
+ just forward <c><![CDATA[WM_ENDSESSION]]></c> and
+ <c><![CDATA[WM_QUERYENDSESSION]]></c> to the default window procedure.
+ Here is a brief example in C of how to set the console control
handler:</p>
<code type="none"><![CDATA[
#include <windows.h>
@@ -372,6 +373,8 @@ The environment of an Erlang machine started
BOOL WINAPI service_aware_handler(DWORD ctrl){
if(ctrl == CTRL_LOGOFF_EVENT)
return TRUE;
+ if(ctrl == CTRL_SHUTDOWN_EVENT)
+ return TRUE;
return FALSE;
}
diff --git a/erts/doc/src/match_spec.xml b/erts/doc/src/match_spec.xml
index f0390c9db8..bdcf9c3816 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>2010</year>
+ <year>1999</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -75,7 +75,7 @@
<item>MatchCondition ::= { GuardFunction } |
{ GuardFunction, ConditionExpression, ... }
</item>
- <item>BoolFunction ::= <c><![CDATA[is_atom]]></c> | <c><![CDATA[is_constant]]></c> |
+ <item>BoolFunction ::= <c><![CDATA[is_atom]]></c> |
<c><![CDATA[is_float]]></c> | <c><![CDATA[is_integer]]></c> | <c><![CDATA[is_list]]></c> |
<c><![CDATA[is_number]]></c> | <c><![CDATA[is_pid]]></c> | <c><![CDATA[is_port]]></c> |
<c><![CDATA[is_reference]]></c> | <c><![CDATA[is_tuple]]></c> | <c><![CDATA[is_binary]]></c> |
@@ -133,7 +133,7 @@
<item>MatchCondition ::= { GuardFunction } |
{ GuardFunction, ConditionExpression, ... }
</item>
- <item>BoolFunction ::= <c><![CDATA[is_atom]]></c> | <c><![CDATA[is_constant]]></c> |
+ <item>BoolFunction ::= <c><![CDATA[is_atom]]></c> |
<c><![CDATA[is_float]]></c> | <c><![CDATA[is_integer]]></c> | <c><![CDATA[is_list]]></c> |
<c><![CDATA[is_number]]></c> | <c><![CDATA[is_pid]]></c> | <c><![CDATA[is_port]]></c> |
<c><![CDATA[is_reference]]></c> | <c><![CDATA[is_tuple]]></c> | <c><![CDATA[is_binary]]></c> |
@@ -172,7 +172,7 @@
<title>Functions allowed in all types of match specifications</title>
<p>The different functions allowed in <c><![CDATA[match_spec]]></c> work like this:
</p>
- <p><em>is_atom, is_constant, is_float, is_integer, is_list, is_number, is_pid, is_port, is_reference, is_tuple, is_binary, is_function: </em> Like the corresponding guard tests in
+ <p><em>is_atom, is_float, is_integer, is_list, is_number, is_pid, is_port, is_reference, is_tuple, is_binary, is_function: </em> Like the corresponding guard tests in
Erlang, return <c><![CDATA[true]]></c> or <c><![CDATA[false]]></c>.
</p>
<p><em>is_record: </em>Takes an additional parameter, which SHALL
diff --git a/erts/doc/src/notes.xml b/erts/doc/src/notes.xml
index d7967212b1..cdb72b2b98 100644
--- a/erts/doc/src/notes.xml
+++ b/erts/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,6 +30,635 @@
</header>
<p>This document describes the changes made to the ERTS application.</p>
+<section><title>Erts 5.9.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fix erl_prim_loader errors in handling of primary
+ archive. The following errors have been corrected:</p>
+ <p>
+ <list> <item> If primary archive was named "xxx", then a
+ file in the same directory named "xxxyyy" would be
+ interpreted as a file named "yyy" inside the archive.
+ </item> <item> erl_prim_loader did not correctly create
+ and normalize absolute paths for primary archive and
+ files inside it, so unless given with exact same path
+ files inside the archive would not be found. E.g. if
+ escript was started as /full/path/to/xxx then
+ "./xxx/file" would not be found since erl_prim_loader
+ would try to match /full/path/to/xxx with
+ /full/path/to/./xxx. Same problem with ../. </item>
+ <item> Depending on how the primary archive was built,
+ erl_prim_loader:list_dir/1 would sometimes return an
+ empty string inside the file list. This was a virtual
+ element representing the top directory of the archive.
+ This has been removed. </item> </list></p>
+ <p>
+ Thanks to Tuncer Ayaz and Shunichi Shinohara for
+ reporting and co-authoring corrections.</p>
+ <p>
+ Own Id: OTP-10071</p>
+ </item>
+ <item>
+ <p>Fix: Add port-I/O statistics for active once and true
+ and not only active false.</p>
+ <p>
+ Own Id: OTP-10073</p>
+ </item>
+ <item>
+ <p>
+ The 64-bit windows installer did not look in the right
+ directories for 64-bit version of Microsoft Visual C++
+ 2010 Redistibutable Package and hence took the wrong
+ decision about having to install the redistributable
+ package if the 32-bit version was installed but not the
+ 64-bit and vice versa. This bug has now been fixed
+ Furthermore the sub-installer for the redistributable
+ package is now run in silent mode if the erlang installer
+ is.</p>
+ <p>
+ Own Id: OTP-10096</p>
+ </item>
+ <item>
+ <p>
+ epmd would fail to start automatically when starting a
+ distributed erlang node installed in a location with a
+ whitespace in the path.</p>
+ <p>
+ Own Id: OTP-10106</p>
+ </item>
+ <item>
+ <p>
+ A more or less harmless bug that sometimes caused memory
+ deallocations to be delayed longer than intended has been
+ fixed.</p>
+ <p>
+ Own Id: OTP-10116</p>
+ </item>
+ <item>
+ <p>
+ Fix bug causing emulator crash when running HiPE on ARM.
+ Bug has existed since R15B.</p>
+ <p>
+ Own Id: OTP-10137</p>
+ </item>
+ <item>
+ <p> A bug regarding spaces in C function prototypes has
+ been fixed. (Thanks to Richard O'Keefe.) </p>
+ <p>
+ Own Id: OTP-10138</p>
+ </item>
+ <item>
+ <p>
+ Corrected dtrace pid length in message related probes.
+ (Thanks to Zheng Siyao)</p>
+ <p>
+ Own Id: OTP-10142</p>
+ </item>
+ <item>
+ <p>
+ Correct formating in exit error messages</p>
+ <p>
+ Ensure displayed sizes are not negative. (Thanks to
+ Michael Santos)</p>
+ <p>
+ Own Id: OTP-10148</p>
+ </item>
+ <item>
+ <p>
+ fix escript/primary archive reloading</p>
+ <p>
+ If the mtime of an escript/primary archive file changes
+ after being added to the code path, correctly reload the
+ archive and update the cache. (Thanks to Tuncer Ayaz)</p>
+ <p>
+ Own Id: OTP-10151</p>
+ </item>
+ <item>
+ <p>
+ Doc fix: link from erlang:now/0 to os:timestamp/0</p>
+ <p>
+ Sometimes os:timestamp/0 is more appropriate than
+ erlang:now/0. The documentation for the former has a link
+ to the latter; this patch adds a link in the other
+ direction to make os:timestamp/0 more visible. Thanks to
+ Magnus Henoch</p>
+ <p>
+ Own Id: OTP-10180</p>
+ </item>
+ <item>
+ <p>
+ The caret in the werl window (on Windows) could appear at
+ the wrong place after regaining focus. This is now
+ corrected.</p>
+ <p>
+ Own Id: OTP-10181</p>
+ </item>
+ <item>
+ <p>
+ Fix bug that in some cases could cause corrupted binaries
+ in ETS tables with <c>compressed</c> option.</p>
+ <p>
+ Own Id: OTP-10182</p>
+ </item>
+ <item>
+ <p>
+ Fix use of "clever" mktime</p>
+ <p>
+ Commit 1eef765 introduced regression (conditional
+ _always_ evaluates to true) in which
+ erlang:localtime_to_universaltime/2 stopped working on
+ systems configured with timezone without DST (i.e. UTC)
+ on *BSD platforms: 1>
+ erlang:localtime_to_universaltime({{2012,1,1},{0,0,0}},
+ true). ** exception error: bad argument Thanks to Piotr
+ Sikora</p>
+ <p>
+ Own Id: OTP-10187</p>
+ </item>
+ <item>
+ <p>
+ Relocate bodies of DTrace probes to the statically-linked
+ VM.</p>
+ <p>
+ Due to various operating systems (in both the DTrace and
+ SystemTap worlds) not fully supporting DTrace probes (or
+ SystemTap-compatibility mode probes) in shared libraries,
+ we relocate those probes to the statically-linked virtual
+ machine. This could be seen as pollution of the pristine
+ VM by a (yet) experimental feature. However:</p>
+ <p>
+ 1. This code can be eliminated completely by the C
+ preprocessor. 2. Leaving the probes in the dyntrace NIF
+ shared library simply does not work correctly on too many
+ platforms. *Many* thanks to Macneil Shonle at Basho for
+ assisting when my RSI-injured fingers gave out. (note:
+ Solaris 10 and FreeBSD 9.0-RELEASE can take a long time
+ to compile)</p>
+ <p>
+ Own Id: OTP-10189</p>
+ </item>
+ <item>
+ <p>
+ Fix bug in <c>ets:test_ms/2</c> that could cause emulator
+ crash when using <c>'$_'</c> in match spec.</p>
+ <p>
+ Own Id: OTP-10190</p>
+ </item>
+ <item>
+ <p>
+ Supplying a filename longer than the operating system
+ MAX_PATH to file:read_link/1 would cause a crash
+ (Segemntation fault/Critical Error) on all platforms.
+ This is now corrected.</p>
+ <p>
+ Own Id: OTP-10200</p>
+ </item>
+ <item>
+ <p>
+ If Perl was configured to interpret files as being
+ encoded in UTF-8, the build would crash in
+ <c>make_preload</c>. (Thanks to Aaron Harnly for noticing
+ this issue.)</p>
+ <p>
+ Own Id: OTP-10201</p>
+ </item>
+ <item>
+ <p>
+ Fix the erlc -MP flag</p>
+ <p>
+ Because of a copy-and-paste error in erlc.c, the -MP flag
+ had the same effect as -MG. As a workaround, you had to
+ pass +makedep_phony to enable the MP option. This patch
+ makes -MP work as intended.</p>
+ <p>
+ Own Id: OTP-10211</p>
+ </item>
+ <item>
+ <p>
+ Allow mixed IPv4 and IPv6 addresses to sctp_bindx</p>
+ <p>
+ Also allow mixed address families to bind, since the
+ first address on a multihomed sctp socket must be bound
+ with bind, while the rest are to be bound using
+ sctp_bindx. At least Linux supports adding address of
+ mixing families. Make inet_set_faddress function
+ available also when HAVE_SCTP is not defined, since we
+ use it to find an address for bind to be able to mix ipv4
+ and ipv6 addresses. Thanks to Tomas Abrahamsson</p>
+ <p>
+ Own Id: OTP-10217</p>
+ </item>
+ <item>
+ <p>
+ Fix support for leap seconds-aware timezones</p>
+ <p>
+ erlang:universaltime_to_localtime is leap seconds-aware
+ (since 2008), however erlang:localtime_to_universaltime
+ is not, which gives surprising results on systems
+ configured with leap seconds-aware timezones: 1>
+ erlang:universaltime_to_localtime({{2012,1,1},{0,0,0}}).
+ {{2012,1,1},{0,0,0}} 2>
+ erlang:localtime_to_universaltime({{2012,1,1},{0,0,0}}).
+ {{2012,1,1},{0,0,24}} and completely breaks
+ calendar:local_time_to_universal_time_dst: 3>
+ calendar:local_time_to_universal_time_dst({{2011,1,1},{0,0,0}}).
+ [] Thanks to Piotr Sikora</p>
+ <p>
+ Own Id: OTP-10227</p>
+ </item>
+ <item>
+ <p>
+ erlsrv: gracefully stop emulator on Windows shutdown</p>
+ <p>
+ Windows will send the SERVICE_CONTROL_SHUTDOWN event to
+ the service control handler when shutting down the
+ system. Instead of ignoring the event, erlsrv will now
+ invoke the stop action. Likewise, the Erlang emulator
+ (and it's po drivers) must not quit upon reception of the
+ CTRL_SHUTDOWN_EVENT event in th console control handler.
+ Thanks to Jan Kloetzke</p>
+ <p>
+ Own Id: OTP-10228</p>
+ </item>
+ <item>
+ <p>
+ Fix dtrace bug in file rename operation.</p>
+ <p>
+ Own Id: OTP-10234</p>
+ </item>
+ <item>
+ <p>
+ Fix bug in memory management of driver port data locks
+ (PDL). In some cases PDLs could be deallocated before
+ <c>ready_async</c> or <c>async_free</c> callback was
+ called.</p>
+ <p>
+ Own Id: OTP-10249</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>Add port and suspend options to lock-counter
+ profiling. (Thanks to Rick Reed)</p>
+ <p>
+ Own Id: OTP-10051</p>
+ </item>
+ <item>
+ <p>
+ Latency when using the active_once option in gen_tcp
+ communication is reduced.</p>
+ <p>
+ Own Id: OTP-10055 Aux Id: sto139 </p>
+ </item>
+ <item>
+ <p>Remove bit8 option support from inet</p>
+ <p>
+ Own Id: OTP-10056</p>
+ </item>
+ <item>
+ <p>
+ The OS Pid of a port program is now available by calling
+ erlang:port_info(Port,os_pid), Thanks to Matthias Lang
+ for the original patch.</p>
+ <p>
+ Own Id: OTP-10057</p>
+ </item>
+ <item>
+ <p>
+ Fix openpty usage in run_erl. </p>
+ <p>
+ Reopening a slave file descriptor which was closed
+ earlier could lead to a misbehaving connection. This has
+ now been remedied.</p>
+ <p>
+ Own Id: OTP-10076</p>
+ </item>
+ <item>
+ <p>
+ Remove all code, documentation, options and diagnostic
+ functions which were related to the experimental hybrid
+ heap implementation.</p>
+ <p>
+ Own Id: OTP-10105</p>
+ </item>
+ <item>
+ <p>
+ Optimizations of memory deallocations.</p>
+ <p>
+ Own Id: OTP-10162 Aux Id: OTP-7775 </p>
+ </item>
+ <item>
+ <p>
+ Optimization of process locking.</p>
+ <p>
+ Own Id: OTP-10163</p>
+ </item>
+ <item>
+ <p>
+ Added a xcomp example file for powerpc-dso-linux-gnu</p>
+ <p>
+ Own Id: OTP-10198</p>
+ </item>
+ <item>
+ <p>
+ Detect when middle endian doubles are used by a platform
+ and account for it when decoding floats. (Thanks to Mike
+ Sperber)</p>
+ <p>
+ Own Id: OTP-10209</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Erts 5.9.1.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ On Linux systems using heart (erl -heart) and a
+ HEAR_BEAT_TIMEOUT less than default, heart could fire
+ even though Erlang was running fine after approx 298 to
+ 497 days (depending on kernel config). This was due to
+ the behaviour of the times(2) system call. Usage of
+ times(2) is now replaced with clock_gettime(2) and the
+ CLOCK_MONOTONIC clock, resulting in a more stable
+ solution. The Erlang VM itself has used clock_gettime(2)
+ on linux since before R12B, so this only affects the
+ heart program.</p>
+ <p>
+ Own Id: OTP-10111 Aux Id: seq12075 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Erts 5.9.1.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ If threads support for the runtime system had been
+ disabled at compile time (<c>--disable-threads</c> had
+ been passed to <c>configure</c>), and the <c>+A</c>
+ command line argument of <c>erl</c> was passed when
+ starting the runtime system, <seealso
+ marker="erl_driver#driver_system_info">driver_system_info()</seealso>
+ erroneously claimed that the runtime system had async
+ threads even though it had not.</p>
+ <p>
+ Due to this bug the file driver did not split tasks into
+ smaller chunks, but instead completed the whole task at
+ once, i.e., the scheduler got occupied with I/O for a
+ longer time than intended.</p>
+ <p>
+ Own Id: OTP-10059</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ A proposal for a new scheduler wakeup strategy has been
+ implemented. For more information see the documentation
+ of the <seealso marker="erl#+sws">+sws</seealso> command
+ line argument of <c>erl</c>.</p>
+ <p>
+ Own Id: OTP-10033 Aux Id: Seq12025 </p>
+ </item>
+ <item>
+ <p>
+ A switch for configuration of busy wait length for
+ scheduler threads has been added. For more information
+ see the documentation of the <seealso
+ marker="erl#+sbwt">+sbwt</seealso> command line argument
+ of <c>erl</c>.</p>
+ <p>
+ Own Id: OTP-10044 Aux Id: Seq11976 </p>
+ </item>
+ <item>
+ <p>
+ The extra memory barriers introduced by bug-fix OTP-9281
+ were unnecessarily used also on tables without the
+ <c>write_concurrency</c> option enabled. This could
+ unnecessarily degrade performance of ETS tables without
+ <c>write_concurrency</c> on some hardware (e.g. PowerPC)
+ while not effecting performance at all on other hardware
+ (e.g. x86/x86_64).</p>
+ <p>
+ OTP-9281 (R14B03): ETS tables using the
+ <c>write_concurrency</c> option could potentially get
+ into an internally inconsistent state.</p>
+ <p>
+ Own Id: OTP-10048 Aux Id: OTP-9281 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Erts 5.9.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p><c>erlang:system_profile</c> errorneous profiled the
+ profiler process when observing runnable processes. This
+ has been corrected. </p>
+ <p>
+ Own Id: OTP-9849</p>
+ </item>
+ <item>
+ <p>Calling trace_info/2 asking for information about a
+ function that had native could could crash the run-time
+ system.</p>
+ <p>
+ Own Id: OTP-9886</p>
+ </item>
+ <item>
+ <p>
+ reduce smp locking time range in erts_garbage_collect
+ (thanks to Jovi Zhang)</p>
+ <p>
+ Own Id: OTP-9912</p>
+ </item>
+ <item>
+ <p>
+ Fix typo in supervisor behaviour doc (Thanks to Ricardo
+ Catalinas Jim�nez)</p>
+ <p>
+ Own Id: OTP-9924</p>
+ </item>
+ <item>
+ <p>
+ Correct spelling of registered (Thanks to Richard
+ Carlsson)</p>
+ <p>
+ Own Id: OTP-9925</p>
+ </item>
+ <item>
+ <p>
+ erts: Remove unused variable (Thanks to Jovi Zhang)</p>
+ <p>
+ Own Id: OTP-9926</p>
+ </item>
+ <item>
+ <p>
+ Fix bug in ETS with <c>compressed</c> option and
+ insertion of term containing large integers (>2G) on
+ 64-bit machines. Seen to cause emulator crash. (Thanks to
+ Diego Llarrull for excellent bug report)</p>
+ <p>
+ Own Id: OTP-9932</p>
+ </item>
+ <item>
+ <p>
+ Handle Linux OS where /sys/devices/system/node is only
+ readable by root. Fallback to /sys/devices/system/cpu for
+ topology info.</p>
+ <p>
+ Own Id: OTP-9978</p>
+ </item>
+ <item>
+ <p> When an escript ends now all printout to standard
+ output and standard error gets out on the terminal. This
+ bug has been corrected by changing the behaviour of
+ erlang:halt/0,1, which should fix the same problem for
+ other escript-like applications, i.e that data stored in
+ the output port driver buffers got lost when printing on
+ a TTY and exiting through erlang:halt/0,1. </p>
+ <p> The BIF:s erlang:halt/0,1 has gotten improved
+ semantics and there is a new BIF erlang:halt/2 to
+ accomplish something like the old semantics. See the
+ documentation. </p>
+ <p> Now erlang:halt/0 and erlang:halt/1 with an integer
+ argument will close all ports and allow all pending async
+ threads operations to finish before exiting the emulator.
+ Previously erlang:halt/0 and erlang:halt(0) would just
+ wait for pending async threads operations but not close
+ ports. And erlang:halt/1 with a non-zero integer argument
+ would not even wait for pending async threads operations.
+ </p>
+ <p> To roughly the old behaviour, to not wait for ports
+ and async threads operations when you exit the emulator,
+ you use erlang:halt/2 with an integer first argument and
+ an option list containing {flush,false} as the second
+ argument. Note that now is flushing not dependant of the
+ exit code, and you can not only flush async threads
+ operations which we deemed as a strange behaviour anyway.
+ </p>
+ <p>Also, erlang:halt/1,2 has gotten a new feature: If the
+ first argument is the atom 'abort' the emulator is
+ aborted producing a core dump, if the operating system so
+ allows. </p>
+ <p>
+ Own Id: OTP-9985</p>
+ </item>
+ <item>
+ <p>
+ Added check to inet driver to avoid building on operating
+ systems that do not yet have IPv6 compatible socket API.
+ (Thanks to Peer Stritzinger)</p>
+ <p>
+ Own Id: OTP-9996</p>
+ </item>
+ <item>
+ <p>
+ Fix bug when the number of CPUs actually found is lower
+ than the configured value. (Thanks to Benjamin
+ Herrenschmidt)</p>
+ <p>
+ Own Id: OTP-10004</p>
+ </item>
+ <item>
+ <p>
+ The runtime system without SMP support and without thread
+ support erroneously busy waited when no work was present.
+ This bug first appeared in <c>erts-5.9</c>.</p>
+ <p>
+ Own Id: OTP-10019</p>
+ </item>
+ <item>
+ <p>
+ Various typographical errors corrected in documentation
+ for common_test, driver, erl_driver and windows
+ installation instructions. (Thanks to Tuncer Ayaz)</p>
+ <p>
+ Own Id: OTP-10037</p>
+ </item>
+ <item>
+ <p>
+ Fix memory leak caused by race on exiting process</p>
+ <p>
+ Own Id: OTP-10041</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>Add <c>erlang:statistics(scheduler_wall_time)</c> to
+ ensure correct determination of scheduler utilization.
+ Measuring scheduler utilization is strongly preferred
+ over CPU utilization, since CPU utilization gives very
+ poor indications of actual scheduler/vm usage.</p>
+ <p>
+ Own Id: OTP-9858</p>
+ </item>
+ <item>
+ <p>
+ ERTS internal API improvements. In some cases the amount
+ of atomic read operations needed have been reduced due to
+ this.</p>
+ <p>
+ Own Id: OTP-9922</p>
+ </item>
+ <item>
+ <p>
+ The DTrace source patch from Scott Lystig Fritchie is
+ integrated in the source tree. Using an emulator with
+ dtrace probe is still not supported for production use,
+ but may be a valuable debugging tool. Configure with
+ --with-dynamic-trace=dtrace (or
+ --with-dynamic-trace=systemtap) to create a build with
+ dtrace probes enabled. See runtime_tools for
+ documentation and examples.</p>
+ <p>
+ Own Id: OTP-10017</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Known Bugs and Problems</title>
+ <list>
+ <item>
+ <p>
+ enif_make_copy may invalidate enif_inspect_binary.</p>
+ <p>
+ Own Id: OTP-9828</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Erts 5.9.0.1</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/erts/doc/src/ref_man.xml b/erts/doc/src/ref_man.xml
index 2042cf28bd..5c9938075c 100644
--- a/erts/doc/src/ref_man.xml
+++ b/erts/doc/src/ref_man.xml
@@ -49,7 +49,6 @@
<xi:include href="escript.xml"/>
<xi:include href="erlsrv.xml"/>
<xi:include href="start_erl.xml"/>
- <xi:include href="erl_set_memory_block.xml"/>
<xi:include href="run_erl.xml"/>
<xi:include href="start.xml"/>
<xi:include href="erl_driver.xml"/>
diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in
index 2bd7297231..7e966c81bb 100644
--- a/erts/emulator/Makefile.in
+++ b/erts/emulator/Makefile.in
@@ -23,6 +23,9 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk
ENABLE_ALLOC_TYPE_VARS = @ENABLE_ALLOC_TYPE_VARS@
HIPE_ENABLED=@HIPE_ENABLED@
+DTRACE_ENABLED=@DTRACE_ENABLED@
+DTRACE_ENABLED_2STEP=@DTRACE_ENABLED_2STEP@
+USE_VM_PROBES=@USE_VM_PROBES@
LIBS = @LIBS@
Z_LIB=@Z_LIB@
NO_INLINE_FUNCTIONS=false
@@ -133,13 +136,6 @@ ENABLE_ALLOC_TYPE_VARS += smp nofrag
M4FLAGS += -DERTS_SMP=1
else
-ifeq ($(FLAVOR),hybrid)
-FLAVOR_MARKER=.hybrid
-FLAVOR_FLAGS=-DHYBRID
-ENABLE_ALLOC_TYPE_VARS += hybrid
-else
-
-
# If flavor isn't one of the above, it *is* plain flavor...
override FLAVOR=plain
FLAVOR_MARKER=
@@ -148,7 +144,6 @@ ENABLE_ALLOC_TYPE_VARS += nofrag
M4FLAGS +=
endif
-endif
TF_MARKER=$(TYPEMARKER)$(FLAVOR_MARKER)
@@ -337,15 +332,11 @@ LIBS += $(THR_LIBS)
ifneq ($(findstring erts_internal_r, $(THR_LIBS)),erts_internal_r)
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
-ERTS_INTERNAL_LIB=erts_internal
-else
ifneq ($(strip $(THR_LIB_NAME)),)
ERTS_INTERNAL_LIB=erts_internal_r
else
ERTS_INTERNAL_LIB=erts_internal
endif
-endif
LIBS += -l$(ERTS_INTERNAL_LIB)$(TYPEMARKER)
@@ -441,18 +432,18 @@ release_spec:
@echo $(VOID_EMULATOR)' - omitted target release_spec (install)'
else
release_spec: all
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/man
- $(INSTALL_DIR) $(RELSYSDIR)/doc
- $(INSTALL_DIR) $(RELSYSDIR)/bin
- $(INSTALL_DIR) $(RELEASE_PATH)/usr/include
- $(INSTALL_DATA) $(RELEASE_INCLUDES) $(RELEASE_PATH)/usr/include
- $(INSTALL_DATA) $(RELEASE_INCLUDES) $(RELSYSDIR)/include
- $(INSTALL_PROGRAM) $(BINDIR)/$(EMULATOR_EXECUTABLE) $(RELSYSDIR)/bin
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/man"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc"
+ $(INSTALL_DIR) "$(RELSYSDIR)/bin"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/usr/include"
+ $(INSTALL_DATA) $(RELEASE_INCLUDES) "$(RELEASE_PATH)/usr/include"
+ $(INSTALL_DATA) $(RELEASE_INCLUDES) "$(RELSYSDIR)/include"
+ $(INSTALL_PROGRAM) $(BINDIR)/$(EMULATOR_EXECUTABLE) "$(RELSYSDIR)/bin"
ifeq ($(ERLANG_OSTYPE), unix)
- $(INSTALL_PROGRAM) $(BINDIR)/$(CS_EXECUTABLE) $(RELSYSDIR)/bin
+ $(INSTALL_PROGRAM) $(BINDIR)/$(CS_EXECUTABLE) "$(RELSYSDIR)/bin"
endif
endif
@@ -468,8 +459,6 @@ _create_dirs := $(shell mkdir -p $(CREATE_DIRS))
GENERATE =
HIPE_ASM =
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
-else
ifdef HIPE_ENABLED
HIPE_ASM += $(TTF_DIR)/hipe_x86_asm.h \
$(TTF_DIR)/hipe_amd64_asm.h \
@@ -481,6 +470,13 @@ GENERATE += $(HIPE_ASM) \
$(TTF_DIR)/hipe_literals.h \
$(BINDIR)/hipe_mkliterals$(TF_MARKER)
endif
+
+ifdef DTRACE_ENABLED
+# global.h causes problems by including dtrace-wrapper.h which includes
+# the autogenerated erlang_dtrace.h ... so make erlang_dtrace.h very early.
+generate: $(TARGET)/erlang_dtrace.h $(GENERATE)
+else
+generate: $(GENERATE)
endif
ifdef HIPE_ENABLED
@@ -498,6 +494,7 @@ $(TTF_DIR)/OPCODES-GENERATED: $(OPCODE_TABLES) utils/beam_makeops
LANG=C $(PERL) utils/beam_makeops \
-wordsize @EXTERNAL_WORD_SIZE@ \
-outdir $(TTF_DIR) \
+ -DUSE_VM_PROBES=$(if $(USE_VM_PROBES),1,0) \
-emulator $(OPCODE_TABLES) && echo $? >$(TTF_DIR)/OPCODES-GENERATED
GENERATE += $(TTF_DIR)/OPCODES-GENERATED
@@ -546,12 +543,17 @@ $(TTF_DIR)/driver_tab.c: Makefile.in
LANG=C $(PERL) utils/make_driver_tab -o $@ $(DRV_OBJS)
GENERATE += $(TTF_DIR)/driver_tab.c
+
+
# Preloaded code.
#
# This list must be consistent with PRE_LOADED_MODULES in
# lib/kernel/src/Makefile.
ifeq ($(TARGET),win32)
-$(TARGET)/beams.rc: $(ERL_TOP)/erts/preloaded/ebin/otp_ring0.beam \
+# On windows the preloaded objects are in a resource object.
+PRELOAD_OBJ = $(OBJDIR)/beams.$(RES_EXT)
+PRELOAD_SRC = $(TARGET)/beams.rc
+$(PRELOAD_SRC): $(ERL_TOP)/erts/preloaded/ebin/otp_ring0.beam \
$(ERL_TOP)/erts/preloaded/ebin/init.beam \
$(ERL_TOP)/erts/preloaded/ebin/prim_inet.beam \
$(ERL_TOP)/erts/preloaded/ebin/prim_file.beam \
@@ -560,9 +562,10 @@ $(TARGET)/beams.rc: $(ERL_TOP)/erts/preloaded/ebin/otp_ring0.beam \
$(ERL_TOP)/erts/preloaded/ebin/erl_prim_loader.beam \
$(ERL_TOP)/erts/preloaded/ebin/erlang.beam
LANG=C $(PERL) utils/make_preload $(MAKE_PRELOAD_EXTRA) -rc $^ > $@
-GENERATE += $(TARGET)/beams.rc
else
-$(TARGET)/preload.c: $(ERL_TOP)/erts/preloaded/ebin/otp_ring0.beam \
+PRELOAD_OBJ = $(OBJDIR)/preload.o
+PRELOAD_SRC = $(TARGET)/preload.c
+$(PRELOAD_SRC): $(ERL_TOP)/erts/preloaded/ebin/otp_ring0.beam \
$(ERL_TOP)/erts/preloaded/ebin/init.beam \
$(ERL_TOP)/erts/preloaded/ebin/prim_inet.beam \
$(ERL_TOP)/erts/preloaded/ebin/prim_file.beam \
@@ -571,7 +574,6 @@ $(TARGET)/preload.c: $(ERL_TOP)/erts/preloaded/ebin/otp_ring0.beam \
$(ERL_TOP)/erts/preloaded/ebin/erl_prim_loader.beam \
$(ERL_TOP)/erts/preloaded/ebin/erlang.beam
LANG=C $(PERL) utils/make_preload -old $^ > $@
-GENERATE += $(TARGET)/preload.c
endif
.PHONY : generate
@@ -579,11 +581,17 @@ ifdef VOID_EMULATOR
generate:
@echo $(VOID_EMULATOR)' - omitted target generate'
else
-generate: $(TTF_DIR)/GENERATED
+generate: $(TTF_DIR)/GENERATED $(PRELOAD_SRC)
+
$(TTF_DIR)/GENERATED: $(GENERATE)
echo $? >$(TTF_DIR)/GENERATED
endif
+$(TARGET)/erlang_dtrace.h: beam/erlang_dtrace.d
+ dtrace -h -C -Ibeam -s $< -o ./erlang_dtrace.tmp
+ sed -e '/^#define[ ]*ERLANG_[A-Z0-9_]*(.*)/y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' ./erlang_dtrace.tmp > $@
+ rm ./erlang_dtrace.tmp
+
# ----------------------------------------------------------------------
# Pattern rules
#
@@ -601,11 +609,6 @@ ifdef PERFCTR_PATH
INCLUDES += -I$(PERFCTR_PATH)/usr.lib -I$(PERFCTR_PATH)/linux/include
endif
-# Need to include etc dir on VxWorks
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
-INCLUDES += -I$(ERL_TOP)/erts/etc/vxworks
-endif
-
ifeq ($(TARGET),win32)
$(OBJDIR)/dll_sys.o: sys/$(ERLANG_OSTYPE)/sys.c
$(CC) $(CFLAGS) -DERL_RUN_SHARED_LIB=1 $(INCLUDES) -c $< -o $@
@@ -627,7 +630,6 @@ $(OBJDIR)/beam_emu.o: beam/beam_emu.c
$(EMU_CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
endif
-
$(OBJDIR)/%.o: beam/%.c
$(CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
@@ -649,18 +651,12 @@ $(OBJDIR)/%.o: drivers/common/%.c
$(OBJDIR)/%.o: drivers/$(ERLANG_OSTYPE)/%.c
$(CC) $(CFLAGS) $(INCLUDES) -Idrivers/common -Idrivers/$(ERLANG_OSTYPE) -I../etc/$(ERLANG_OSTYPE) -c $< -o $@
-# VxWorks uses unix drivers too...
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
-$(OBJDIR)/%.o: drivers/unix/%.c
- $(CC) $(CFLAGS) $(INCLUDES) -Idrivers/common -c $< -o $@
-endif
-
# ----------------------------------------------------------------------
# Specials
#
CS_SRC = sys/$(ERLANG_OSTYPE)/erl_child_setup.c
-$(BINDIR)/$(CS_EXECUTABLE): $(TTF_DIR)/GENERATED $(CS_SRC) $(ERTS_LIB)
+$(BINDIR)/$(CS_EXECUTABLE): $(TTF_DIR)/GENERATED $(PRELOAD_SRC) $(CS_SRC) $(ERTS_LIB)
$(CS_PURIFY) $(CC) $(CS_LDFLAGS) -o $(BINDIR)/$(CS_EXECUTABLE) \
$(CS_CFLAGS) $(COMMON_INCLUDES) $(CS_SRC) $(CS_LIBS)
@@ -689,22 +685,15 @@ $(ERL_TOP)/lib/%.beam:
# Object files
#
-# On windows the preloaded objects are in a resource object.
-
-ifeq ($(TARGET),win32)
-PRELOAD = $(OBJDIR)/beams.$(RES_EXT)
-else
-PRELOAD = $(OBJDIR)/preload.o
-endif
-
-
-INIT_OBJS = $(OBJDIR)/erl_main.o $(PRELOAD)
+INIT_OBJS = $(OBJDIR)/erl_main.o $(PRELOAD_OBJ)
EMU_OBJS = \
$(OBJDIR)/beam_emu.o $(OBJDIR)/beam_opcodes.o \
$(OBJDIR)/beam_load.o $(OBJDIR)/beam_bif_load.o \
$(OBJDIR)/beam_debug.o $(OBJDIR)/beam_bp.o \
- $(OBJDIR)/beam_catches.o
+ $(OBJDIR)/beam_catches.o \
+ $(OBJDIR)/code_ix.o \
+ $(OBJDIR)/beam_ranges.o
RUN_OBJS = \
$(OBJDIR)/erl_pbifs.o $(OBJDIR)/benchmark.o \
@@ -735,7 +724,7 @@ RUN_OBJS = \
$(OBJDIR)/register.o $(OBJDIR)/break.o \
$(OBJDIR)/erl_async.o $(OBJDIR)/erl_lock_check.o \
$(OBJDIR)/erl_gc.o $(OBJDIR)/erl_lock_count.o \
- $(OBJDIR)/erl_nmgc.o $(OBJDIR)/erl_posix_str.o \
+ $(OBJDIR)/erl_posix_str.o \
$(OBJDIR)/erl_bits.o $(OBJDIR)/erl_math.o \
$(OBJDIR)/erl_fun.o $(OBJDIR)/erl_bif_port.o \
$(OBJDIR)/erl_term.o $(OBJDIR)/erl_node_tables.o \
@@ -774,12 +763,8 @@ OS_OBJS = \
$(OBJDIR)/gzio.o \
$(OBJDIR)/elib_memmove.o
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
- OS_OBJS += $(OBJDIR)/int64.o
-else
OS_OBJS += $(OBJDIR)/sys_float.o \
$(OBJDIR)/sys_time.o
-endif
DRV_OBJS = \
$(OBJDIR)/efile_drv.o \
$(OBJDIR)/inet_drv.o \
@@ -787,9 +772,7 @@ DRV_OBJS = \
$(OBJDIR)/ram_file_drv.o
endif
-ifneq ($(findstring vxworks,$(TARGET)),vxworks)
DRV_OBJS += $(OBJDIR)/ttsl_drv.o
-endif
ifeq ($(ERTS_ENABLE_KERNEL_POLL),yes)
OS_OBJS += $(OBJDIR)/erl_poll.kp.o \
@@ -836,7 +819,18 @@ endif
BASE_OBJS = $(RUN_OBJS) $(EMU_OBJS) $(OS_OBJS) $(EXTRA_BASE_OBJS)
-OBJS = $(BASE_OBJS) $(DRV_OBJS)
+before_DTrace_OBJS = $(BASE_OBJS) $(DRV_OBJS)
+
+DTRACE_OBJS =
+ifdef DTRACE_ENABLED_2STEP
+DTRACE_OBJS = $(OBJDIR)/erlang_dtrace.o
+$(OBJDIR)/erlang_dtrace.o: $(before_DTrace_OBJS) $(TARGET)/erlang_dtrace.h
+ dtrace -G -C -Ibeam \
+ -s beam/erlang_dtrace.d \
+ -o $@ $(before_DTrace_OBJS)
+endif
+
+OBJS = $(before_DTrace_OBJS) $(DTRACE_OBJS)
$(INIT_OBJS): $(TTF_DIR)/GENERATED
$(OBJS): $(TTF_DIR)/GENERATED
@@ -908,33 +902,13 @@ $(TTF_DIR)/hipe_arm_bifs.S: hipe/hipe_arm_bifs.m4 hipe/hipe_arm_asm.m4 \
$(OBJDIR)/hipe_arm_bifs.o: $(TTF_DIR)/hipe_arm_bifs.S \
$(TTF_DIR)/hipe_literals.h
-# end of HiPE section
-########################################
+# Use -fomit-frame-pointer to work around gcc (v4.5.2) bug causing
+# "error: r7 cannot be used in asm here" for DEBUG build.
+$(OBJDIR)/hipe_arm.o: hipe/hipe_arm.c
+ $(CC) $(subst O2,O3, $(CFLAGS)) -fomit-frame-pointer $(INCLUDES) -c $< -o $@
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
-########################################
-# Extract what we need from libgcc.a
+# end of HiPE section
########################################
-GCCLIBFLAGS=@GCCLIBFLAGS@
-STRIP=@STRIP@
-SYMPREFIX=@SYMPREFIX@
-
-NEEDFUNCTIONS=__divdi3 __moddi3 __udivdi3
-KEEPSYMS=$(NEEDFUNCTIONS:%=-K $(SYMPREFIX)%)
-
-$(OBJDIR)/int64.o: $(TARGET)/int64.c
- $(CC) -o $(OBJDIR)/int64tmp.o -c $(TARGET)/int64.c
- $(LD) -o $(OBJDIR)/int64.o $(OBJDIR)/int64tmp.o $(LDFLAGS) $(GCCLIBFLAGS)
- $(STRIP) $(KEEPSYMS) $(OBJDIR)/int64.o
-
-$(TARGET)/int64.c:
- echo 'void dummy(void); void dummy(void) {' > $(TARGET)/int64.c
- for x in $(NEEDFUNCTIONS); do echo 'extern void '$$x'();' \
- >> $(TARGET)/int64.c; done
- for x in $(NEEDFUNCTIONS); do echo $$x'();' >> $(TARGET)/int64.c; done
- echo '}' >> $(TARGET)/int64.c
-
-endif
# ----------------------------------------------------------------------
# The emulator itself
@@ -1035,7 +1009,7 @@ depend:
@echo $(VOID_EMULATOR)' - omitted target depend'
else
depend: $(TTF_DIR)/depend.mk
-$(TTF_DIR)/depend.mk: $(TTF_DIR)/GENERATED
+$(TTF_DIR)/depend.mk: $(TTF_DIR)/GENERATED $(PRELOAD_SRC)
$(DEP_CC) $(DEP_FLAGS) $(BEAM_SRC) \
| $(SED_DEPEND) > $(TTF_DIR)/depend.mk
$(DEP_CC) $(DEP_FLAGS) -DLIBSCTP=$(LIBSCTP) $(DRV_COMMON_SRC) \
diff --git a/erts/emulator/beam/atom.names b/erts/emulator/beam/atom.names
index 71454b3e57..106fad030b 100644
--- a/erts/emulator/beam/atom.names
+++ b/erts/emulator/beam/atom.names
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -95,6 +95,7 @@ atom atom
atom atom_used
atom attributes
atom await_proc_exit
+atom await_sched_wall_time_modifications
atom awaiting_load
atom awaiting_unload
atom backtrace backtrace_depth
@@ -239,13 +240,14 @@ atom generational
atom get_seq_token
atom get_tcw
atom getenv
+atom gather_sched_wall_time_result
atom getting_linked
atom getting_unlinked
atom global
-atom global_heaps_size
atom Gt='>'
atom grun
atom group_leader
+atom have_dt_utag
atom heap_block_size
atom heap_size
atom heap_sizes
@@ -256,7 +258,6 @@ atom hide
atom high
atom hipe_architecture
atom http httph https http_response http_request http_header http_eoh http_error http_bin httph_bin
-atom hybrid
atom id
atom if_clause
atom imports
@@ -388,6 +389,7 @@ atom opt
atom or
atom ordered_set
atom orelse
+atom os_pid
atom os_type
atom os_version
atom ose_bg_proc
@@ -554,6 +556,7 @@ atom waiting
atom wall_clock
atom warning
atom warning_msg
+atom scheduler_wall_time
atom wordsize
atom write_concurrency
atom xor
diff --git a/erts/emulator/beam/beam_bif_load.c b/erts/emulator/beam/beam_bif_load.c
index 78a9d76a20..e8f8a04344 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2012. 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
@@ -37,25 +37,83 @@
static void set_default_trace_pattern(Eterm module);
static Eterm check_process_code(Process* rp, Module* modp);
-static void delete_code(Process *c_p, ErtsProcLocks c_p_locks, Module* modp);
-static void delete_export_references(Eterm module);
-static int purge_module(int module);
+static void delete_code(Module* modp);
static void decrement_refc(BeamInstr* code);
static int is_native(BeamInstr* code);
static int any_heap_ref_ptrs(Eterm* start, Eterm* end, char* mod_start, Uint mod_size);
static int any_heap_refs(Eterm* start, Eterm* end, char* mod_start, Uint mod_size);
-static void remove_from_address_table(BeamInstr* code);
-Eterm
-load_module_2(BIF_ALIST_2)
+
+
+BIF_RETTYPE code_is_module_native_1(BIF_ALIST_1)
+{
+ Module* modp;
+ Eterm res;
+ ErtsCodeIndex code_ix;
+
+ if (is_not_atom(BIF_ARG_1)) {
+ BIF_ERROR(BIF_P, BADARG);
+ }
+ code_ix = erts_active_code_ix();
+ if ((modp = erts_get_module(BIF_ARG_1, code_ix)) == NULL) {
+ return am_undefined;
+ }
+ erts_rlock_old_code(code_ix);
+ res = ((modp->curr.code && is_native(modp->curr.code)) ||
+ (modp->old.code != 0 && is_native(modp->old.code))) ?
+ am_true : am_false;
+ erts_runlock_old_code(code_ix);
+ return res;
+}
+
+BIF_RETTYPE code_make_stub_module_3(BIF_ALIST_3)
{
- Eterm reason;
- Eterm* hp;
- int sz;
- byte* code;
+ Module* modp;
Eterm res;
+
+ if (!erts_try_seize_code_write_permission(BIF_P)) {
+ ERTS_BIF_YIELD3(bif_export[BIF_code_make_stub_module_3],
+ BIF_P, BIF_ARG_1, BIF_ARG_2, BIF_ARG_3);
+ }
+
+ erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
+ erts_smp_thr_progress_block();
+
+ modp = erts_get_module(BIF_ARG_1, erts_active_code_ix());
+
+ if (modp && modp->curr.num_breakpoints > 0) {
+ ASSERT(modp->curr.code != NULL);
+ erts_clear_module_break(modp);
+ ASSERT(modp->curr.num_breakpoints == 0);
+ }
+
+ erts_start_staging_code_ix();
+
+ res = erts_make_stub_module(BIF_P, BIF_ARG_1, BIF_ARG_2, BIF_ARG_3);
+
+ if (res == BIF_ARG_1) {
+ erts_end_staging_code_ix();
+ erts_commit_staging_code_ix();
+ }
+ else {
+ erts_abort_staging_code_ix();
+ }
+ erts_smp_thr_progress_unblock();
+ erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
+ erts_release_code_write_permission();
+ return res;
+}
+
+BIF_RETTYPE
+prepare_loading_2(BIF_ALIST_2)
+{
byte* temp_alloc = NULL;
- struct LoaderState* stp;
+ byte* code;
+ Uint sz;
+ Binary* magic;
+ Eterm reason;
+ Eterm* hp;
+ Eterm res;
if (is_not_atom(BIF_ARG_1)) {
error:
@@ -65,108 +123,277 @@ load_module_2(BIF_ALIST_2)
if ((code = erts_get_aligned_binary_bytes(BIF_ARG_2, &temp_alloc)) == NULL) {
goto error;
}
- hp = HAlloc(BIF_P, 3);
- /*
- * Read the BEAM file and prepare the module for loading.
- */
- stp = erts_alloc_loader_state();
+ magic = erts_alloc_loader_state();
sz = binary_size(BIF_ARG_2);
- reason = erts_prepare_loading(stp, BIF_P, BIF_P->group_leader,
+ reason = erts_prepare_loading(magic, BIF_P, BIF_P->group_leader,
&BIF_ARG_1, code, sz);
erts_free_aligned_binary_bytes(temp_alloc);
if (reason != NIL) {
+ hp = HAlloc(BIF_P, 3);
res = TUPLE2(hp, am_error, reason);
BIF_RET(res);
}
+ hp = HAlloc(BIF_P, PROC_BIN_SIZE);
+ res = erts_mk_magic_binary_term(&hp, &MSO(BIF_P), magic);
+ erts_refc_dec(&magic->refc, 1);
+ BIF_RET(res);
+}
- /*
- * Stop all other processes and finish the loading of the module.
- */
- erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
- erts_smp_thr_progress_block();
+struct m {
+ Binary* code;
+ Eterm module;
+ Module* modp;
+ Uint exception;
+};
- reason = erts_finish_loading(stp, BIF_P, 0, &BIF_ARG_1);
- if (reason != NIL) {
- res = TUPLE2(hp, am_error, reason);
- } else {
- set_default_trace_pattern(BIF_ARG_1);
- res = TUPLE2(hp, am_module, BIF_ARG_1);
- }
+static Eterm staging_epilogue(Process* c_p, int, Eterm res, int, struct m*, int);
- erts_smp_thr_progress_unblock();
- erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
- BIF_RET(res);
+static Eterm
+exception_list(Process* p, Eterm tag, struct m* mp, Sint exceptions)
+{
+ Eterm* hp = HAlloc(p, 3 + 2*exceptions);
+ Eterm res = NIL;
+
+ mp += exceptions - 1;
+ while (exceptions > 0) {
+ if (mp->exception) {
+ res = CONS(hp, mp->module, res);
+ hp += 2;
+ exceptions--;
+ }
+ mp--;
+ }
+ return TUPLE2(hp, tag, res);
}
-BIF_RETTYPE purge_module_1(BIF_ALIST_1)
+
+BIF_RETTYPE
+finish_loading_1(BIF_ALIST_1)
{
- int purge_res;
+ int i;
+ int n;
+ struct m* p = NULL;
+ Uint exceptions;
+ Eterm res;
+ int is_blocking = 0;
+ int do_commit = 0;
- if (is_not_atom(BIF_ARG_1)) {
- BIF_ERROR(BIF_P, BADARG);
+ if (!erts_try_seize_code_write_permission(BIF_P)) {
+ ERTS_BIF_YIELD1(bif_export[BIF_finish_loading_1], BIF_P, BIF_ARG_1);
}
- erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
- erts_smp_thr_progress_block();
+ /*
+ * Validate the argument before we start loading; it must be a
+ * proper list where each element is a magic binary containing
+ * prepared (not previously loaded) code.
+ *
+ * First count the number of elements and allocate an array
+ * to keep the elements in.
+ */
- erts_export_consolidate();
- purge_res = purge_module(atom_val(BIF_ARG_1));
+ n = list_length(BIF_ARG_1);
+ if (n == -1) {
+ ERTS_BIF_PREP_ERROR(res, BIF_P, BADARG);
+ goto done;
+ }
+ p = erts_alloc(ERTS_ALC_T_LOADER_TMP, n*sizeof(struct m));
- erts_smp_thr_progress_unblock();
- erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
+ /*
+ * We now know that the argument is a proper list. Validate
+ * and collect the binaries into the array.
+ */
- if (purge_res < 0) {
- BIF_ERROR(BIF_P, BADARG);
+ for (i = 0; i < n; i++) {
+ Eterm* cons = list_val(BIF_ARG_1);
+ Eterm term = CAR(cons);
+ ProcBin* pb;
+
+ if (!ERTS_TERM_IS_MAGIC_BINARY(term)) {
+ ERTS_BIF_PREP_ERROR(res, BIF_P, BADARG);
+ goto done;
+ }
+ pb = (ProcBin*) binary_val(term);
+ p[i].code = pb->val;
+ p[i].module = erts_module_for_prepared_code(p[i].code);
+ if (p[i].module == NIL) {
+ ERTS_BIF_PREP_ERROR(res, BIF_P, BADARG);
+ goto done;
+ }
+ BIF_ARG_1 = CDR(cons);
}
- BIF_RET(am_true);
-}
-BIF_RETTYPE code_is_module_native_1(BIF_ALIST_1)
-{
- Module* modp;
+ /*
+ * Since we cannot handle atomic loading of a group of modules
+ * if one or more of them uses on_load, we will only allow one
+ * element in the list. This limitation is intended to be
+ * lifted in the future.
+ */
- if (is_not_atom(BIF_ARG_1)) {
- BIF_ERROR(BIF_P, BADARG);
+ if (n > 1) {
+ ERTS_BIF_PREP_ERROR(res, BIF_P, SYSTEM_LIMIT);
+ goto done;
}
- if ((modp = erts_get_module(BIF_ARG_1)) == NULL) {
- return am_undefined;
+
+ /*
+ * All types are correct. There cannot be a BADARG from now on.
+ * Before we can start loading, we must check whether any of
+ * the modules already has old code. To avoid a race, we must
+ * not allow other process to initiate a code loading operation
+ * from now on.
+ */
+
+ res = am_ok;
+ erts_start_staging_code_ix();
+
+ for (i = 0; i < n; i++) {
+ p[i].modp = erts_put_module(p[i].module);
+ }
+ for (i = 0; i < n; i++) {
+ if (p[i].modp->curr.num_breakpoints > 0 ||
+ p[i].modp->curr.num_traced_exports > 0 ||
+ erts_is_default_trace_enabled()) {
+ /* tracing involved, fallback with thread blocking */
+ erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
+ erts_smp_thr_progress_block();
+ is_blocking = 1;
+ break;
+ }
}
- return ((modp->code && is_native(modp->code)) ||
- (modp->old_code != 0 && is_native(modp->old_code))) ?
- am_true : am_false;
-}
-BIF_RETTYPE code_make_stub_module_3(BIF_ALIST_3)
-{
- Eterm res;
+ if (is_blocking) {
+ for (i = 0; i < n; i++) {
+ if (p[i].modp->curr.num_breakpoints) {
+ erts_clear_module_break(p[i].modp);
+ ASSERT(p[i].modp->curr.num_breakpoints == 0);
+ }
+ }
+ }
- erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
- erts_smp_thr_progress_block();
+ exceptions = 0;
+ for (i = 0; i < n; i++) {
+ p[i].exception = 0;
+ if (p[i].modp->curr.code && p[i].modp->old.code) {
+ p[i].exception = 1;
+ exceptions++;
+ }
+ }
- erts_export_consolidate();
- res = erts_make_stub_module(BIF_P, BIF_ARG_1, BIF_ARG_2, BIF_ARG_3);
+ if (exceptions) {
+ res = exception_list(BIF_P, am_not_purged, p, exceptions);
+ } else {
+ /*
+ * Now we can load all code. This can't fail.
+ */
- erts_smp_thr_progress_unblock();
- erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
- return res;
+ exceptions = 0;
+ for (i = 0; i < n; i++) {
+ Eterm mod;
+ Eterm retval;
+
+ erts_refc_inc(&p[i].code->refc, 1);
+ retval = erts_finish_loading(p[i].code, BIF_P, 0, &mod);
+ ASSERT(retval == NIL || retval == am_on_load);
+ if (retval == am_on_load) {
+ p[i].exception = 1;
+ exceptions++;
+ }
+ }
+
+ /*
+ * Check whether any module has an on_load_handler.
+ */
+
+ if (exceptions) {
+ res = exception_list(BIF_P, am_on_load, p, exceptions);
+ }
+ do_commit = 1;
+ }
+
+done:
+ return staging_epilogue(BIF_P, do_commit, res, is_blocking, p, n);
+}
+
+static Eterm
+staging_epilogue(Process* c_p, int commit, Eterm res, int is_blocking,
+ struct m* loaded, int nloaded)
+{
+#ifdef ERTS_SMP
+ if (is_blocking || !commit)
+#endif
+ {
+ if (commit) {
+ erts_end_staging_code_ix();
+ erts_commit_staging_code_ix();
+ if (loaded) {
+ int i;
+ for (i=0; i < nloaded; i++) {
+ set_default_trace_pattern(loaded[i].module);
+ }
+ }
+ }
+ else {
+ erts_abort_staging_code_ix();
+ }
+ if (loaded) {
+ erts_free(ERTS_ALC_T_LOADER_TMP, loaded);
+ }
+ if (is_blocking) {
+ erts_smp_thr_progress_unblock();
+ erts_smp_proc_lock(c_p, ERTS_PROC_LOCK_MAIN);
+ }
+ erts_release_code_write_permission();
+ return res;
+ }
+#ifdef ERTS_SMP
+ else {
+ ErtsThrPrgrVal later;
+ ASSERT(is_value(res));
+
+ if (loaded) {
+ erts_free(ERTS_ALC_T_LOADER_TMP, loaded);
+ }
+ erts_end_staging_code_ix();
+ /*
+ * Now we must wait for all schedulers to do a memory barrier before
+ * we can activate and let them access the new staged code. This allows
+ * schedulers to read active code_ix in a safe way while executing
+ * without any memory barriers at all.
+ */
+
+ later = erts_thr_progress_later(c_p->scheduler_data);
+ erts_thr_progress_wakeup(c_p->scheduler_data, later);
+ erts_notify_code_ix_activation(c_p, later);
+ erts_suspend(c_p, ERTS_PROC_LOCK_MAIN, NULL);
+ /*
+ * handle_code_ix_activation() will do the rest "later"
+ * and resume this process to return 'res'.
+ */
+ ERTS_BIF_YIELD_RETURN(c_p, res);
+ }
+#endif
}
BIF_RETTYPE
check_old_code_1(BIF_ALIST_1)
{
+ ErtsCodeIndex code_ix;
Module* modp;
+ Eterm res = am_false;
if (is_not_atom(BIF_ARG_1)) {
BIF_ERROR(BIF_P, BADARG);
}
- modp = erts_get_module(BIF_ARG_1);
- if (modp == NULL) { /* Doesn't exist. */
- BIF_RET(am_false);
- } else if (modp->old_code == NULL) { /* No old code. */
- BIF_RET(am_false);
+ code_ix = erts_active_code_ix();
+ modp = erts_get_module(BIF_ARG_1, code_ix);
+ if (modp != NULL) {
+ erts_rlock_old_code(code_ix);
+ if (modp->old.code != NULL) {
+ res = am_true;
+ }
+ erts_runlock_old_code(code_ix);
}
- BIF_RET(am_true);
+ BIF_RET(res);
}
Eterm
@@ -180,14 +407,20 @@ check_process_code_2(BIF_ALIST_2)
}
if (is_internal_pid(BIF_ARG_1)) {
Eterm res;
+ ErtsCodeIndex code_ix;
if (internal_pid_index(BIF_ARG_1) >= erts_max_processes)
goto error;
- modp = erts_get_module(BIF_ARG_2);
+ code_ix = erts_active_code_ix();
+ modp = erts_get_module(BIF_ARG_2, code_ix);
if (modp == NULL) { /* Doesn't exist. */
return am_false;
- } else if (modp->old_code == NULL) { /* No old code. */
+ }
+ erts_rlock_old_code(code_ix);
+ if (modp->old.code == NULL) { /* No old code. */
+ erts_runlock_old_code(code_ix);
return am_false;
}
+ erts_runlock_old_code(code_ix);
#ifdef ERTS_SMP
rp = erts_pid2proc_suspend(BIF_P, ERTS_PROC_LOCK_MAIN,
@@ -202,7 +435,14 @@ check_process_code_2(BIF_ALIST_2)
ERTS_BIF_YIELD2(bif_export[BIF_check_process_code_2], BIF_P,
BIF_ARG_1, BIF_ARG_2);
}
- res = check_process_code(rp, modp);
+ erts_rlock_old_code(code_ix);
+ if (modp->old.code != NULL) { /* must check again */
+ res = check_process_code(rp, modp);
+ }
+ else {
+ res = am_false;
+ }
+ erts_runlock_old_code(code_ix);
#ifdef ERTS_SMP
if (BIF_P != rp) {
erts_resume(rp, ERTS_PROC_LOCK_MAIN);
@@ -223,56 +463,71 @@ check_process_code_2(BIF_ALIST_2)
BIF_RETTYPE delete_module_1(BIF_ALIST_1)
{
- int res;
+ ErtsCodeIndex code_ix;
+ Module* modp;
+ int is_blocking = 0;
+ int success = 0;
+ Eterm res = NIL;
- if (is_not_atom(BIF_ARG_1))
- goto badarg;
+ if (is_not_atom(BIF_ARG_1)) {
+ BIF_ERROR(BIF_P, BADARG);
+ }
- erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
- erts_smp_thr_progress_block();
+ if (!erts_try_seize_code_write_permission(BIF_P)) {
+ ERTS_BIF_YIELD1(bif_export[BIF_delete_module_1], BIF_P, BIF_ARG_1);
+ }
{
- Module *modp = erts_get_module(BIF_ARG_1);
+ erts_start_staging_code_ix();
+ code_ix = erts_staging_code_ix();
+ modp = erts_get_module(BIF_ARG_1, code_ix);
if (!modp) {
res = am_undefined;
}
- else if (modp->old_code != 0) {
+ else if (modp->old.code != 0) {
erts_dsprintf_buf_t *dsbufp = erts_create_logger_dsbuf();
erts_dsprintf(dsbufp, "Module %T must be purged before loading\n",
BIF_ARG_1);
erts_send_error_to_logger(BIF_P->group_leader, dsbufp);
- res = am_badarg;
+ ERTS_BIF_PREP_ERROR(res, BIF_P, BADARG);
}
else {
- delete_export_references(BIF_ARG_1);
- delete_code(BIF_P, 0, modp);
+ if (modp->curr.num_breakpoints > 0 ||
+ modp->curr.num_traced_exports > 0) {
+ /* we have tracing, retry single threaded */
+ erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
+ erts_smp_thr_progress_block();
+ is_blocking = 1;
+ if (modp->curr.num_breakpoints) {
+ erts_clear_module_break(modp);
+ ASSERT(modp->curr.num_breakpoints == 0);
+ }
+ }
+ delete_code(modp);
res = am_true;
+ success = 1;
}
}
-
- erts_smp_thr_progress_unblock();
- erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
-
- if (res == am_badarg) {
- badarg:
- BIF_ERROR(BIF_P, BADARG);
- }
- BIF_RET(res);
+ return staging_epilogue(BIF_P, success, res, is_blocking, NULL, 0);
}
BIF_RETTYPE module_loaded_1(BIF_ALIST_1)
{
Module* modp;
+ ErtsCodeIndex code_ix;
+ Eterm res = am_false;
if (is_not_atom(BIF_ARG_1)) {
BIF_ERROR(BIF_P, BADARG);
}
- if ((modp = erts_get_module(BIF_ARG_1)) == NULL ||
- modp->code == NULL ||
- modp->code[MI_ON_LOAD_FUNCTION_PTR] != 0) {
- BIF_RET(am_false);
+ code_ix = erts_active_code_ix();
+ if ((modp = erts_get_module(BIF_ARG_1, code_ix)) != NULL) {
+ if (modp->curr.code != NULL
+ && modp->curr.code[MI_ON_LOAD_FUNCTION_PTR] == 0) {
+ res = am_true;
+ }
}
- BIF_RET(am_true);
+ BIF_RET(res);
}
BIF_RETTYPE pre_loaded_0(BIF_ALIST_0)
@@ -282,27 +537,28 @@ BIF_RETTYPE pre_loaded_0(BIF_ALIST_0)
BIF_RETTYPE loaded_0(BIF_ALIST_0)
{
+ ErtsCodeIndex code_ix = erts_active_code_ix();
+ Module* modp;
Eterm previous = NIL;
Eterm* hp;
int i;
int j = 0;
-
- for (i = 0; i < module_code_size(); i++) {
- if (module_code(i) != NULL &&
- ((module_code(i)->code_length != 0) ||
- (module_code(i)->old_code_length != 0))) {
+
+ for (i = 0; i < module_code_size(code_ix); i++) {
+ if ((modp = module_code(i, code_ix)) != NULL &&
+ ((modp->curr.code_length != 0) ||
+ (modp->old.code_length != 0))) {
j++;
}
}
if (j > 0) {
hp = HAlloc(BIF_P, j*2);
- for (i = 0; i < module_code_size(); i++) {
- if (module_code(i) != NULL &&
- ((module_code(i)->code_length != 0) ||
- (module_code(i)->old_code_length != 0))) {
- previous = CONS(hp, make_atom(module_code(i)->module),
- previous);
+ for (i = 0; i < module_code_size(code_ix); i++) {
+ if ((modp=module_code(i,code_ix)) != NULL &&
+ ((modp->curr.code_length != 0) ||
+ (modp->old.code_length != 0))) {
+ previous = CONS(hp, make_atom(modp->module), previous);
hp += 2;
}
}
@@ -312,54 +568,65 @@ BIF_RETTYPE loaded_0(BIF_ALIST_0)
BIF_RETTYPE call_on_load_function_1(BIF_ALIST_1)
{
- Module* modp = erts_get_module(BIF_ARG_1);
- Eterm on_load;
+ Module* modp = erts_get_module(BIF_ARG_1, erts_active_code_ix());
- if (!modp || modp->code == 0) {
- error:
- BIF_ERROR(BIF_P, BADARG);
+ if (modp && modp->curr.code) {
+ BIF_TRAP_CODE_PTR_0(BIF_P, modp->curr.code[MI_ON_LOAD_FUNCTION_PTR]);
}
- if ((on_load = modp->code[MI_ON_LOAD_FUNCTION_PTR]) == 0) {
- goto error;
+ else {
+ BIF_ERROR(BIF_P, BADARG);
}
- BIF_TRAP_CODE_PTR_0(BIF_P, on_load);
}
BIF_RETTYPE finish_after_on_load_2(BIF_ALIST_2)
{
- Module* modp = erts_get_module(BIF_ARG_1);
+ ErtsCodeIndex code_ix;
+ Module* modp;
Eterm on_load;
- if (!modp || modp->code == 0) {
+ if (!erts_try_seize_code_write_permission(BIF_P)) {
+ ERTS_BIF_YIELD2(bif_export[BIF_finish_after_on_load_2],
+ BIF_P, BIF_ARG_1, BIF_ARG_2);
+ }
+
+ /* ToDo: Use code_ix staging instead of thread blocking */
+
+ erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
+ erts_smp_thr_progress_block();
+
+ code_ix = erts_active_code_ix();
+ modp = erts_get_module(BIF_ARG_1, code_ix);
+
+ if (!modp || modp->curr.code == 0) {
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 ((on_load = modp->code[MI_ON_LOAD_FUNCTION_PTR]) == 0) {
+ if ((on_load = modp->curr.code[MI_ON_LOAD_FUNCTION_PTR]) == 0) {
goto error;
}
if (BIF_ARG_2 != am_false && BIF_ARG_2 != am_true) {
goto error;
}
- erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
- erts_smp_thr_progress_block();
-
if (BIF_ARG_2 == am_true) {
int i;
/*
* The on_load function succeded. Fix up export entries.
*/
- for (i = 0; i < export_list_size(); i++) {
- Export *ep = export_list(i);
+ 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) {
- ep->address = (void *) ep->code[4];
+ ep->addressv[code_ix] = (void *) ep->code[4];
ep->code[4] = 0;
}
}
- modp->code[MI_ON_LOAD_FUNCTION_PTR] = 0;
+ modp->curr.code[MI_ON_LOAD_FUNCTION_PTR] = 0;
set_default_trace_pattern(BIF_ARG_1);
} else if (BIF_ARG_2 == am_false) {
BeamInstr* code;
@@ -370,19 +637,21 @@ BIF_RETTYPE finish_after_on_load_2(BIF_ALIST_2)
* This is an combination of delete and purge. We purge
* the current code; the old code is not touched.
*/
- erts_total_code_size -= modp->code_length;
- code = modp->code;
- end = (BeamInstr *)((char *)code + modp->code_length);
+ erts_total_code_size -= modp->curr.code_length;
+ code = modp->curr.code;
+ end = (BeamInstr *)((char *)code + modp->curr.code_length);
erts_cleanup_funs_on_purge(code, end);
- beam_catches_delmod(modp->catches, code, modp->code_length);
+ beam_catches_delmod(modp->curr.catches, code, modp->curr.code_length,
+ erts_active_code_ix());
erts_free(ERTS_ALC_T_CODE, (void *) code);
- modp->code = NULL;
- modp->code_length = 0;
- modp->catches = BEAM_CATCHES_NIL;
- remove_from_address_table(code);
+ modp->curr.code = NULL;
+ modp->curr.code_length = 0;
+ modp->curr.catches = BEAM_CATCHES_NIL;
+ erts_remove_from_ranges(code);
}
erts_smp_thr_progress_unblock();
erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
+ erts_release_code_write_permission();
BIF_RET(am_true);
}
@@ -403,11 +672,11 @@ set_default_trace_pattern(Eterm module)
if (trace_pattern_is_on) {
Eterm mfa[1];
mfa[0] = module;
- (void) erts_set_trace_pattern(mfa, 1,
+ (void) erts_set_trace_pattern(0, mfa, 1,
match_spec,
meta_match_spec,
1, trace_pattern_flags,
- meta_tracer_pid);
+ meta_tracer_pid, 1);
}
}
@@ -419,20 +688,18 @@ check_process_code(Process* rp, Module* modp)
Uint mod_size;
BeamInstr* end;
Eterm* sp;
-#ifndef HYBRID /* FIND ME! */
struct erl_off_heap_header* oh;
int done_gc = 0;
-#endif
#define INSIDE(a) (start <= (a) && (a) < end)
/*
* Pick up limits for the module.
*/
- start = modp->old_code;
- end = (BeamInstr *)((char *)start + modp->old_code_length);
+ start = modp->old.code;
+ end = (BeamInstr *)((char *)start + modp->old.code_length);
mod_start = (char *) start;
- mod_size = modp->old_code_length;
+ mod_size = modp->old.code_length;
/*
* Check if current instruction or continuation pointer points into module.
@@ -481,7 +748,6 @@ check_process_code(Process* rp, Module* modp)
* See if there are funs that refer to the old version of the module.
*/
-#ifndef HYBRID /* FIND ME! */
rescan:
for (oh = MSO(rp).first; oh; oh = oh->next) {
if (thing_subtag(oh->thing_word) == FUN_SUBTAG) {
@@ -507,7 +773,6 @@ check_process_code(Process* rp, Module* modp)
}
}
}
-#endif
/*
* See if there are constants inside the module referenced by the process.
@@ -566,10 +831,10 @@ check_process_code(Process* rp, Module* modp)
done_gc = 1;
FLAGS(rp) |= F_NEED_FULLSWEEP;
(void) erts_garbage_collect(rp, 0, rp->arg_reg, rp->arity);
- literals = (Eterm *) modp->old_code[MI_LITERALS_START];
- lit_size = (Eterm *) modp->old_code[MI_LITERALS_END] - literals;
+ literals = (Eterm *) modp->old.code[MI_LITERALS_START];
+ lit_size = (Eterm *) modp->old.code[MI_LITERALS_END] - literals;
oh = (struct erl_off_heap_header *)
- modp->old_code[MI_LITERALS_OFF_HEAP];
+ modp->old.code[MI_LITERALS_OFF_HEAP];
erts_garbage_collect_literals(rp, literals, lit_size, oh);
}
}
@@ -628,53 +893,82 @@ any_heap_refs(Eterm* start, Eterm* end, char* mod_start, Uint mod_size)
#undef in_area
-
-static int
-purge_module(int module)
+BIF_RETTYPE purge_module_1(BIF_ALIST_1)
{
+ ErtsCodeIndex code_ix;
BeamInstr* code;
BeamInstr* end;
Module* modp;
+ int is_blocking = 0;
+ Eterm ret;
- /*
- * Correct module?
- */
-
- if ((modp = erts_get_module(make_atom(module))) == NULL) {
- return -2;
+ if (is_not_atom(BIF_ARG_1)) {
+ BIF_ERROR(BIF_P, BADARG);
}
- /*
- * Any code to purge?
- */
- if (modp->old_code == 0) {
- return -1;
+ if (!erts_try_seize_code_write_permission(BIF_P)) {
+ ERTS_BIF_YIELD1(bif_export[BIF_purge_module_1], BIF_P, BIF_ARG_1);
}
+ code_ix = erts_active_code_ix();
+
/*
- * Unload any NIF library
+ * Correct module?
*/
- if (modp->old_nif != NULL) {
- erts_unload_nif(modp->old_nif);
- modp->old_nif = NULL;
+
+ if ((modp = erts_get_module(BIF_ARG_1, code_ix)) == NULL) {
+ ERTS_BIF_PREP_ERROR(ret, BIF_P, BADARG);
}
+ else {
+ erts_rwlock_old_code(code_ix);
- /*
- * Remove the old code.
- */
- ASSERT(erts_total_code_size >= modp->old_code_length);
- erts_total_code_size -= modp->old_code_length;
- code = modp->old_code;
- end = (BeamInstr *)((char *)code + modp->old_code_length);
- erts_cleanup_funs_on_purge(code, end);
- beam_catches_delmod(modp->old_catches, code, modp->old_code_length);
- decrement_refc(code);
- erts_free(ERTS_ALC_T_CODE, (void *) code);
- modp->old_code = NULL;
- modp->old_code_length = 0;
- modp->old_catches = BEAM_CATCHES_NIL;
- remove_from_address_table(code);
- return 0;
+ /*
+ * Any code to purge?
+ */
+ if (modp->old.code == 0) {
+ ERTS_BIF_PREP_ERROR(ret, BIF_P, BADARG);
+ }
+ else {
+ /*
+ * Unload any NIF library
+ */
+ if (modp->old.nif != NULL) {
+ /* ToDo: Do unload nif without blocking */
+ erts_rwunlock_old_code(code_ix);
+ erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
+ erts_smp_thr_progress_block();
+ is_blocking = 1;
+ erts_rwlock_old_code(code_ix);
+ erts_unload_nif(modp->old.nif);
+ modp->old.nif = NULL;
+ }
+
+ /*
+ * Remove the old code.
+ */
+ ASSERT(erts_total_code_size >= modp->old.code_length);
+ erts_total_code_size -= modp->old.code_length;
+ code = modp->old.code;
+ end = (BeamInstr *)((char *)code + modp->old.code_length);
+ erts_cleanup_funs_on_purge(code, end);
+ beam_catches_delmod(modp->old.catches, code, modp->old.code_length,
+ code_ix);
+ decrement_refc(code);
+ erts_free(ERTS_ALC_T_CODE, (void *) code);
+ modp->old.code = NULL;
+ modp->old.code_length = 0;
+ modp->old.catches = BEAM_CATCHES_NIL;
+ erts_remove_from_ranges(code);
+ ERTS_BIF_PREP_RET(ret, am_true);
+ }
+ erts_rwunlock_old_code(code_ix);
+ }
+ if (is_blocking) {
+ erts_smp_thr_progress_unblock();
+ erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
+ }
+ erts_release_code_write_permission();
+ return ret;
}
static void
@@ -694,92 +988,48 @@ decrement_refc(BeamInstr* code)
}
}
-static void
-remove_from_address_table(BeamInstr* code)
-{
- int i;
-
- for (i = 0; i < num_loaded_modules; i++) {
- if (modules[i].start == code) {
- num_loaded_modules--;
- while (i < num_loaded_modules) {
- modules[i] = modules[i+1];
- i++;
- }
- mid_module = &modules[num_loaded_modules/2];
- return;
- }
- }
- ASSERT(0); /* Not found? */
-}
-
-
/*
- * Move code from current to old.
+ * Move code from current to old and null all export entries for the module
*/
-static void
-delete_code(Process *c_p, ErtsProcLocks c_p_locks, Module* modp)
-{
-#ifdef ERTS_ENABLE_LOCK_CHECK
-#ifdef ERTS_SMP
- if (c_p && c_p_locks)
- erts_proc_lc_chk_only_proc_main(c_p);
- else
-#endif
- erts_lc_check_exact(NULL, 0);
-#endif
-
- /*
- * Clear breakpoints if any
- */
- if (modp->code != NULL && modp->code[MI_NUM_BREAKPOINTS] > 0) {
- if (c_p && c_p_locks)
- erts_smp_proc_unlock(c_p, ERTS_PROC_LOCK_MAIN);
- erts_smp_thr_progress_block();
- erts_clear_module_break(modp);
- modp->code[MI_NUM_BREAKPOINTS] = 0;
- erts_smp_thr_progress_unblock();
- if (c_p && c_p_locks)
- erts_smp_proc_lock(c_p, ERTS_PROC_LOCK_MAIN);
- }
- modp->old_code = modp->code;
- modp->old_code_length = modp->code_length;
- modp->old_catches = modp->catches;
- modp->old_nif = modp->nif;
- modp->code = NULL;
- modp->code_length = 0;
- modp->catches = BEAM_CATCHES_NIL;
- modp->nif = NULL;
-}
-
-
-/* null all references on the export table for the module called with the
- atom index below */
-
static void
-delete_export_references(Eterm module)
+delete_code(Module* modp)
{
+ ErtsCodeIndex code_ix = erts_staging_code_ix();
+ Eterm module = make_atom(modp->module);
int i;
- ASSERT(is_atom(module));
-
- for (i = 0; i < export_list_size(); i++) {
- Export *ep = export_list(i);
+ for (i = 0; i < export_list_size(code_ix); i++) {
+ Export *ep = export_list(i, code_ix);
if (ep != NULL && (ep->code[0] == module)) {
- if (ep->address == ep->code+3 &&
- (ep->code[3] == (BeamInstr) em_apply_bif)) {
- 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(modp->curr.num_traced_exports > 0);
+ erts_clear_export_break(modp, ep->code+3);
+ }
+ else ASSERT(ep->code[3] == (BeamInstr) em_call_error_handler
+ || !erts_initialized);
}
- ep->address = ep->code+3;
+ ep->addressv[code_ix] = ep->code+3;
ep->code[3] = (BeamInstr) em_call_error_handler;
ep->code[4] = 0;
- MatchSetUnref(ep->match_prog_set);
- ep->match_prog_set = NULL;
}
}
+
+ ASSERT(modp->curr.num_breakpoints == 0);
+ ASSERT(modp->curr.num_traced_exports == 0);
+ modp->old = modp->curr;
+ modp->curr.code = NULL;
+ modp->curr.code_length = 0;
+ modp->curr.catches = BEAM_CATCHES_NIL;
+ modp->curr.nif = NULL;
}
-
+
Eterm
beam_make_current_old(Process *c_p, ErtsProcLocks c_p_locks, Eterm module)
@@ -791,11 +1041,10 @@ beam_make_current_old(Process *c_p, ErtsProcLocks c_p_locks, Eterm module)
* if not, delete old code; error if old code already exists.
*/
- if (modp->code != NULL && modp->old_code != NULL) {
+ if (modp->curr.code != NULL && modp->old.code != NULL) {
return am_not_purged;
- } else if (modp->old_code == NULL) { /* Make the current version old. */
- delete_code(c_p, c_p_locks, modp);
- delete_export_references(module);
+ } else if (modp->old.code == NULL) { /* Make the current version old. */
+ delete_code(modp);
}
return NIL;
}
diff --git a/erts/emulator/beam/beam_bp.c b/erts/emulator/beam/beam_bp.c
index dd13cd179a..50d18b0347 100644
--- a/erts/emulator/beam/beam_bp.c
+++ b/erts/emulator/beam/beam_bp.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2012. 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
@@ -44,67 +44,34 @@
#define ReAlloc(P, SIZ) erts_realloc(ERTS_ALC_T_BPD, (P), (SZ))
#define Free(P) erts_free(ERTS_ALC_T_BPD, (P))
-/*
-** Doubly linked ring macros
-*/
-
-#define BpInit(a,i) \
-do { \
- (a)->orig_instr = (i); \
- (a)->next = (a); \
- (a)->prev = (a); \
-} while (0)
-
-#define BpSpliceNext(a,b) \
-do { \
- register BpData *c = (a), *d = (b), *e; \
- e = c->next->prev; \
- c->next->prev = d->next->prev; \
- d->next->prev = e; \
- e = c->next; \
- c->next = d->next; \
- d->next = e; \
-} while (0)
-
-#define BpSplicePrev(a,b) \
-do { \
- register BpData *c = (a), *d = (b), *e; \
- e = c->prev->next; \
- c->prev->next = d->prev->next; \
- d->prev->next = e; \
- e = c->prev; \
- c->prev = d->prev; \
- d->prev = e; \
-} while (0)
-
-#ifdef DEBUG
-# define BpSingleton(a) ((a)->next == (a) && (a)->prev == (a))
+#if defined(ERTS_ENABLE_LOCK_CHECK) && defined(ERTS_SMP)
+# define ERTS_SMP_REQ_PROC_MAIN_LOCK(P) \
+ if ((P)) erts_proc_lc_require_lock((P), ERTS_PROC_LOCK_MAIN)
+# define ERTS_SMP_UNREQ_PROC_MAIN_LOCK(P) \
+ if ((P)) erts_proc_lc_unrequire_lock((P), ERTS_PROC_LOCK_MAIN)
#else
-# define BpSingleton(a) ((a)->next == (a))
+# define ERTS_SMP_REQ_PROC_MAIN_LOCK(P)
+# define ERTS_SMP_UNREQ_PROC_MAIN_LOCK(P)
#endif
-#define BpInitAndSpliceNext(a,i,b) \
-do { \
- (a)->orig_instr = (i); \
- (a)->prev = (b); \
- (b)->next->prev = (a); \
- (a)->next = (b)->next; \
- (b)->next = (a); \
-} while (0)
+#define ERTS_BPF_LOCAL_TRACE 0x01
+#define ERTS_BPF_META_TRACE 0x02
+#define ERTS_BPF_COUNT 0x04
+#define ERTS_BPF_COUNT_ACTIVE 0x08
+#define ERTS_BPF_DEBUG 0x10
+#define ERTS_BPF_TIME_TRACE 0x20
+#define ERTS_BPF_TIME_TRACE_ACTIVE 0x40
+#define ERTS_BPF_GLOBAL_TRACE 0x80
-#define BpInitAndSplicePrev(a,i,b) \
-do { \
- (a)->orig_instr = (i); \
- (a)->next = (b); \
- (b)->prev->next = (a); \
- (a)->prev = (b)->prev; \
- (b)->prev = (a); \
-} while (0)
+#define ERTS_BPF_ALL 0xFF
+extern Eterm beam_return_to_trace[1]; /* OpCode(i_return_to_trace) */
+extern Eterm beam_return_trace[1]; /* OpCode(i_return_trace) */
+extern Eterm beam_exception_trace[1]; /* OpCode(i_exception_trace) */
+extern Eterm beam_return_time_trace[1]; /* OpCode(i_return_time_trace) */
-#define BREAK_IS_BIF (1)
-#define BREAK_IS_ERL (0)
-
+erts_smp_atomic32_t erts_active_bp_index;
+erts_smp_atomic32_t erts_staging_bp_index;
/* *************************************************************************
** Local prototypes
@@ -113,26 +80,30 @@ do { \
/*
** Helpers
*/
-
-static int set_break(Eterm mfa[3], int specified,
- Binary *match_spec, BeamInstr break_op,
- enum erts_break_op count_op, Eterm tracer_pid);
-static int set_module_break(Module *modp, Eterm mfa[3], int specified,
- Binary *match_spec, BeamInstr break_op,
- enum erts_break_op count_op, Eterm tracer_pid);
-static int set_function_break(Module *modp, BeamInstr *pc, int bif,
- Binary *match_spec, BeamInstr break_op,
- enum erts_break_op count_op, Eterm tracer_pid);
-
-static int clear_break(Eterm mfa[3], int specified,
- BeamInstr break_op);
-static int clear_module_break(Module *modp, Eterm mfa[3], int specified,
- BeamInstr break_op);
-static int clear_function_break(Module *modp, BeamInstr *pc, int bif,
- BeamInstr break_op);
-
-static BpData *is_break(BeamInstr *pc, BeamInstr break_op);
-static BpData *get_break(Process *p, BeamInstr *pc, BeamInstr break_op);
+static Eterm do_call_trace(Process* c_p, BeamInstr* I, Eterm* reg,
+ int local, Binary* ms, Eterm tracer_pid);
+static void set_break(BpFunctions* f, Binary *match_spec, Uint break_flags,
+ enum erts_break_op count_op, Eterm tracer_pid);
+static void set_function_break(BeamInstr *pc,
+ Binary *match_spec,
+ Uint break_flags,
+ enum erts_break_op count_op,
+ Eterm tracer_pid);
+
+static void clear_break(BpFunctions* f, Uint break_flags);
+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_time_diff(bp_data_time_item_t *item,
+ process_breakpoint_time_t *pbt,
+ Uint ms, Uint s, Uint us);
+
+static void bp_meta_unref(BpMetaPid* bmp);
+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);
+static void uninstall_breakpoint(BeamInstr* pc);
/* bp_hash */
#define BP_TIME_ADD(pi0, pi1) \
@@ -152,240 +123,996 @@ static ERTS_INLINE bp_data_time_item_t * bp_hash_get(bp_time_hash_t *hash, bp_da
static ERTS_INLINE bp_data_time_item_t * bp_hash_put(bp_time_hash_t *hash, bp_data_time_item_t *sitem);
static void bp_hash_delete(bp_time_hash_t *hash);
-
/* *************************************************************************
** External interfaces
*/
-erts_smp_spinlock_t erts_bp_lock;
-
void
erts_bp_init(void) {
- erts_smp_spinlock_init(&erts_bp_lock, "breakpoints");
+ erts_smp_atomic32_init_nob(&erts_active_bp_index, 0);
+ erts_smp_atomic32_init_nob(&erts_staging_bp_index, 1);
}
-int
-erts_set_trace_break(Eterm mfa[3], int specified, Binary *match_spec,
- Eterm tracer_pid) {
- ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
- return set_break(mfa, specified, match_spec,
- (BeamInstr) BeamOp(op_i_trace_breakpoint), 0, tracer_pid);
+
+void
+erts_bp_match_functions(BpFunctions* f, Eterm mfa[3], int specified)
+{
+ ErtsCodeIndex code_ix = erts_active_code_ix();
+ Uint max_funcs = 0;
+ int current;
+ int max_modules = module_code_size(code_ix);
+ int num_modules = 0;
+ Module* modp;
+ Module** module;
+ Uint i;
+
+ module = (Module **) Alloc(max_modules*sizeof(Module *));
+ num_modules = 0;
+ for (current = 0; current < max_modules; current++) {
+ modp = module_code(current, code_ix);
+ if (modp->curr.code) {
+ max_funcs += modp->curr.code[MI_NUM_FUNCTIONS];
+ module[num_modules++] = modp;
+ }
+ }
+
+ f->matching = (BpFunction *) Alloc(max_funcs*sizeof(BpFunction));
+ i = 0;
+ for (current = 0; current < num_modules; current++) {
+ BeamInstr** code_base = (BeamInstr **) module[current]->curr.code;
+ BeamInstr* code;
+ Uint num_functions = (Uint) code_base[MI_NUM_FUNCTIONS];
+ Uint fi;
+
+ if (specified > 0) {
+ if (mfa[0] != make_atom(module[current]->module)) {
+ /* Wrong module name */
+ continue;
+ }
+ }
+
+ for (fi = 0; fi < num_functions; fi++) {
+ Eterm* pc;
+ int wi;
+
+ code = code_base[MI_FUNCTIONS+fi];
+ ASSERT(code[0] == (BeamInstr) BeamOp(op_i_func_info_IaaI));
+ pc = code+5;
+ if (erts_is_native_break(pc)) {
+ continue;
+ }
+ if (is_nil(code[3])) { /* Ignore BIF stub */
+ continue;
+ }
+ for (wi = 0;
+ wi < specified && (Eterm) code[2+wi] == mfa[wi];
+ wi++) {
+ /* Empty loop body */
+ }
+ if (wi == specified) {
+ /* Store match */
+ f->matching[i].pc = pc;
+ f->matching[i].mod = module[current];
+ i++;
+ }
+ }
+ }
+ f->matched = i;
+ Free(module);
}
-int
-erts_set_mtrace_break(Eterm mfa[3], int specified, Binary *match_spec,
- Eterm tracer_pid) {
- ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
- return set_break(mfa, specified, match_spec,
- (BeamInstr) BeamOp(op_i_mtrace_breakpoint), 0, tracer_pid);
+void
+erts_bp_match_export(BpFunctions* f, Eterm mfa[3], int specified)
+{
+ ErtsCodeIndex code_ix = erts_active_code_ix();
+ int i;
+ int num_exps = export_list_size(code_ix);
+ int ne;
+
+ f->matching = (BpFunction *) Alloc(num_exps*sizeof(BpFunction));
+ ne = 0;
+ for (i = 0; i < num_exps; i++) {
+ Export* ep = export_list(i, code_ix);
+ BeamInstr* pc;
+ int j;
+
+ for (j = 0; j < specified && mfa[j] == ep->code[j]; j++) {
+ /* Empty loop body */
+ }
+ if (j < specified) {
+ continue;
+ }
+ pc = ep->code+3;
+ if (ep->addressv[code_ix] == pc) {
+ if ((*pc == (BeamInstr) em_apply_bif ||
+ *pc == (BeamInstr) em_call_error_handler)) {
+ continue;
+ }
+ ASSERT(*pc == (BeamInstr) BeamOp(op_i_generic_breakpoint));
+ } else if (erts_is_native_break(ep->addressv[code_ix])) {
+ continue;
+ }
+
+ f->matching[ne].pc = pc;
+ f->matching[ne].mod = erts_get_module(ep->code[0], code_ix);
+ ne++;
+
+ }
+ f->matched = ne;
}
-/* set breakpoint data for on exported bif entry */
+void
+erts_bp_free_matched_functions(BpFunctions* f)
+{
+ Free(f->matching);
+}
void
-erts_set_mtrace_bif(BeamInstr *pc, Binary *match_spec, Eterm tracer_pid) {
- ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
- set_function_break(NULL, pc, BREAK_IS_BIF, match_spec, (BeamInstr) BeamOp(op_i_mtrace_breakpoint), 0, tracer_pid);
+erts_consolidate_bp_data(BpFunctions* f, int local)
+{
+ BpFunction* fs = f->matching;
+ Uint i;
+ Uint n = f->matched;
+
+ ERTS_SMP_LC_ASSERT(erts_is_code_ix_locked());
+
+ for (i = 0; i < n; i++) {
+ consolidate_bp_data(fs[i].mod, fs[i].pc, local);
+ }
}
-void erts_set_time_trace_bif(BeamInstr *pc, enum erts_break_op count_op) {
- set_function_break(NULL, pc, BREAK_IS_BIF, NULL, (BeamInstr) BeamOp(op_i_time_breakpoint), count_op, NIL);
+void
+erts_consolidate_bif_bp_data(void)
+{
+ int i;
+
+ ERTS_SMP_LC_ASSERT(erts_is_code_ix_locked());
+ for (i = 0; i < BIF_SIZE; i++) {
+ Export *ep = bif_export[i];
+ consolidate_bp_data(0, ep->code+3, 0);
+ }
}
-void erts_clear_time_trace_bif(BeamInstr *pc) {
- clear_function_break(NULL, pc, BREAK_IS_BIF, (BeamInstr) BeamOp(op_i_time_breakpoint));
+static void
+consolidate_bp_data(Module* modp, BeamInstr* pc, int local)
+{
+ GenericBp* g = (GenericBp *) pc[-4];
+ GenericBpData* src;
+ GenericBpData* dst;
+ Uint flags;
+
+ if (g == 0) {
+ return;
+ }
+
+ src = &g->data[erts_active_bp_ix()];
+ dst = &g->data[erts_staging_bp_ix()];
+
+ /*
+ * The contents of the staging area may be out of date.
+ * Decrement all reference pointers.
+ */
+
+ flags = dst->flags;
+ if (flags & (ERTS_BPF_LOCAL_TRACE|ERTS_BPF_GLOBAL_TRACE)) {
+ MatchSetUnref(dst->local_ms);
+ }
+ if (flags & ERTS_BPF_META_TRACE) {
+ bp_meta_unref(dst->meta_pid);
+ MatchSetUnref(dst->meta_ms);
+ }
+ if (flags & ERTS_BPF_COUNT) {
+ bp_count_unref(dst->count);
+ }
+ if (flags & ERTS_BPF_TIME_TRACE) {
+ bp_time_unref(dst->time);
+ }
+
+ /*
+ * If all flags are zero, deallocate all breakpoint data.
+ */
+
+ flags = dst->flags = src->flags;
+ if (flags == 0) {
+ if (modp) {
+ if (local) {
+ modp->curr.num_breakpoints--;
+ } else {
+ modp->curr.num_traced_exports--;
+ }
+ ASSERT(modp->curr.num_breakpoints >= 0);
+ ASSERT(modp->curr.num_traced_exports >= 0);
+ ASSERT(*pc != (BeamInstr) BeamOp(op_i_generic_breakpoint));
+ }
+ pc[-4] = 0;
+ Free(g);
+ return;
+ }
+
+ /*
+ * Copy the active data to the staging area (making it ready
+ * for the next time it will be used).
+ */
+
+ if (flags & (ERTS_BPF_LOCAL_TRACE|ERTS_BPF_GLOBAL_TRACE)) {
+ dst->local_ms = src->local_ms;
+ 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_ms = src->meta_ms;
+ MatchSetRef(dst->meta_ms);
+ }
+ if (flags & ERTS_BPF_COUNT) {
+ dst->count = src->count;
+ erts_refc_inc(&dst->count->refc, 1);
+ }
+ if (flags & ERTS_BPF_TIME_TRACE) {
+ dst->time = src->time;
+ erts_refc_inc(&dst->time->refc, 1);
+ ASSERT(dst->time->hash);
+ }
}
-int
-erts_set_debug_break(Eterm mfa[3], int specified) {
- ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
- return set_break(mfa, specified, NULL,
- (BeamInstr) BeamOp(op_i_debug_breakpoint), 0, NIL);
+void
+erts_commit_staged_bp(void)
+{
+ ErtsBpIndex staging = erts_staging_bp_ix();
+ ErtsBpIndex active = erts_active_bp_ix();
+
+ erts_smp_atomic32_set_nob(&erts_active_bp_index, staging);
+ erts_smp_atomic32_set_nob(&erts_staging_bp_index, active);
}
-int
-erts_set_count_break(Eterm mfa[3], int specified, enum erts_break_op count_op) {
- ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
- return set_break(mfa, specified, NULL,
- (BeamInstr) BeamOp(op_i_count_breakpoint), count_op, NIL);
+void
+erts_install_breakpoints(BpFunctions* f)
+{
+ Uint i;
+ Uint n = f->matched;
+ BeamInstr br = (BeamInstr) BeamOp(op_i_generic_breakpoint);
+
+ for (i = 0; i < n; i++) {
+ BeamInstr* pc = f->matching[i].pc;
+ GenericBp* g = (GenericBp *) pc[-4];
+ if (*pc != br && g) {
+ Module* modp = f->matching[i].mod;
+
+ /*
+ * The breakpoint must be disabled in the active data
+ * (it will enabled later by switching bp indices),
+ * and enabled in the staging data.
+ */
+ ASSERT(g->data[erts_active_bp_ix()].flags == 0);
+ ASSERT(g->data[erts_staging_bp_ix()].flags != 0);
+
+ /*
+ * The following write is not protected by any lock. We
+ * assume that the hardware guarantees that a write of an
+ * aligned word-size (or half-word) writes is atomic
+ * (i.e. that other processes executing this code will not
+ * see a half pointer).
+ */
+ *pc = br;
+ modp->curr.num_breakpoints++;
+ }
+ }
}
-int
-erts_set_time_break(Eterm mfa[3], int specified, enum erts_break_op count_op) {
- ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
- return set_break(mfa, specified, NULL,
- (BeamInstr) BeamOp(op_i_time_breakpoint), count_op, NIL);
+void
+erts_uninstall_breakpoints(BpFunctions* f)
+{
+ Uint i;
+ Uint n = f->matched;
+
+ for (i = 0; i < n; i++) {
+ BeamInstr* pc = f->matching[i].pc;
+ uninstall_breakpoint(pc);
+ }
}
-int
-erts_clear_trace_break(Eterm mfa[3], int specified) {
- ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
- return clear_break(mfa, specified,
- (BeamInstr) BeamOp(op_i_trace_breakpoint));
+static void
+uninstall_breakpoint(BeamInstr* pc)
+{
+ if (*pc == (BeamInstr) BeamOp(op_i_generic_breakpoint)) {
+ GenericBp* g = (GenericBp *) pc[-4];
+ if (g->data[erts_active_bp_ix()].flags == 0) {
+ /*
+ * The following write is not protected by any lock. We
+ * assume that the hardware guarantees that a write of an
+ * aligned word-size (or half-word) writes is atomic
+ * (i.e. that other processes executing this code will not
+ * see a half pointer).
+ */
+ *pc = g->orig_instr;
+ }
+ }
}
-int
-erts_clear_mtrace_break(Eterm mfa[3], int specified) {
- ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
- return clear_break(mfa, specified,
- (BeamInstr) BeamOp(op_i_mtrace_breakpoint));
+void
+erts_set_trace_break(BpFunctions* f, Binary *match_spec)
+{
+ set_break(f, match_spec, ERTS_BPF_LOCAL_TRACE, 0, am_true);
}
void
-erts_clear_mtrace_bif(BeamInstr *pc) {
- clear_function_break(NULL, pc, BREAK_IS_BIF, (BeamInstr) BeamOp(op_i_mtrace_breakpoint));
+erts_set_mtrace_break(BpFunctions* f, Binary *match_spec, Eterm tracer_pid)
+{
+ set_break(f, match_spec, ERTS_BPF_META_TRACE, 0, tracer_pid);
}
-int
-erts_clear_debug_break(Eterm mfa[3], int specified) {
- ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
- return clear_break(mfa, specified,
- (BeamInstr) BeamOp(op_i_debug_breakpoint));
+void
+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);
}
-int
-erts_clear_count_break(Eterm mfa[3], int specified) {
- ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
- return clear_break(mfa, specified,
- (BeamInstr) BeamOp(op_i_count_breakpoint));
+void
+erts_set_mtrace_bif(BeamInstr *pc, Binary *match_spec, Eterm tracer_pid)
+{
+ set_function_break(pc, match_spec, ERTS_BPF_META_TRACE, 0, tracer_pid);
}
-int
-erts_clear_time_break(Eterm mfa[3], int specified) {
- ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
- return clear_break(mfa, specified,
- (BeamInstr) BeamOp(op_i_time_breakpoint));
+void
+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);
}
-int
-erts_clear_break(Eterm mfa[3], int specified) {
+void
+erts_clear_time_trace_bif(BeamInstr *pc) {
+ clear_function_break(pc, ERTS_BPF_TIME_TRACE|ERTS_BPF_TIME_TRACE_ACTIVE);
+}
+
+void
+erts_set_debug_break(BpFunctions* f) {
+ set_break(f, NULL, ERTS_BPF_DEBUG, 0, 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);
+}
+
+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);
+}
+
+void
+erts_clear_trace_break(BpFunctions* f)
+{
+ clear_break(f, ERTS_BPF_LOCAL_TRACE);
+}
+
+void
+erts_clear_call_trace_bif(BeamInstr *pc, int local)
+{
+ GenericBp* g = (GenericBp *) pc[-4];
+
+ if (g) {
+ Uint flags = local ? ERTS_BPF_LOCAL_TRACE : ERTS_BPF_GLOBAL_TRACE;
+ if (g->data[erts_staging_bp_ix()].flags & flags) {
+ clear_function_break(pc, flags);
+ }
+ }
+}
+
+void
+erts_clear_mtrace_break(BpFunctions* f)
+{
+ clear_break(f, ERTS_BPF_META_TRACE);
+}
+
+void
+erts_clear_mtrace_bif(BeamInstr *pc)
+{
+ clear_function_break(pc, ERTS_BPF_META_TRACE);
+}
+
+void
+erts_clear_debug_break(BpFunctions* f)
+{
ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
- return clear_break(mfa, specified, 0);
+ clear_break(f, ERTS_BPF_DEBUG);
+}
+
+void
+erts_clear_count_break(BpFunctions* f)
+{
+ clear_break(f, ERTS_BPF_COUNT|ERTS_BPF_COUNT_ACTIVE);
+}
+
+void
+erts_clear_time_break(BpFunctions* f)
+{
+ clear_break(f, ERTS_BPF_TIME_TRACE|ERTS_BPF_TIME_TRACE_ACTIVE);
+}
+
+void
+erts_clear_all_breaks(BpFunctions* f)
+{
+ clear_break(f, ERTS_BPF_ALL);
}
int
erts_clear_module_break(Module *modp) {
+ BeamInstr** code_base;
+ Uint n;
+ Uint i;
+
ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
ASSERT(modp);
- return clear_module_break(modp, NULL, 0, 0);
+ code_base = (BeamInstr **) modp->curr.code;
+ if (code_base == NULL) {
+ return 0;
+ }
+ n = (Uint) code_base[MI_NUM_FUNCTIONS];
+ for (i = 0; i < n; ++i) {
+ BeamInstr* pc;
+
+ pc = code_base[MI_FUNCTIONS+i] + 5;
+ if (erts_is_native_break(pc)) {
+ continue;
+ }
+ clear_function_break(pc, ERTS_BPF_ALL);
+ }
+
+ erts_commit_staged_bp();
+
+ for (i = 0; i < n; ++i) {
+ BeamInstr* pc;
+
+ pc = code_base[MI_FUNCTIONS+i] + 5;
+ if (erts_is_native_break(pc)) {
+ continue;
+ }
+ uninstall_breakpoint(pc);
+ consolidate_bp_data(modp, pc, 1);
+ ASSERT(pc[-4] == 0);
+ }
+ return n;
}
-int
-erts_clear_function_break(Module *modp, BeamInstr *pc) {
+void
+erts_clear_export_break(Module* modp, BeamInstr* pc)
+{
ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
- ASSERT(modp);
- return clear_function_break(modp, pc, BREAK_IS_ERL, 0);
+
+ clear_function_break(pc, ERTS_BPF_ALL);
+ erts_commit_staged_bp();
+ *pc = (BeamInstr) 0;
+ consolidate_bp_data(modp, pc, 0);
+ ASSERT(pc[-4] == 0);
}
+BeamInstr
+erts_generic_breakpoint(Process* c_p, BeamInstr* I, Eterm* reg)
+{
+ GenericBp* g;
+ GenericBpData* bp;
+ Uint bp_flags;
+ ErtsBpIndex ix = erts_active_bp_ix();
+
+ g = (GenericBp *) I[-4];
+ bp = &g->data[ix];
+ bp_flags = bp->flags;
+ ASSERT((bp_flags & ~ERTS_BPF_ALL) == 0);
+ if (bp_flags & (ERTS_BPF_LOCAL_TRACE|
+ ERTS_BPF_GLOBAL_TRACE|
+ ERTS_BPF_TIME_TRACE_ACTIVE) &&
+ !IS_TRACED_FL(c_p, F_TRACE_CALLS)) {
+ bp_flags &= ~(ERTS_BPF_LOCAL_TRACE|
+ ERTS_BPF_GLOBAL_TRACE|
+ ERTS_BPF_TIME_TRACE|
+ ERTS_BPF_TIME_TRACE_ACTIVE);
+ if (bp_flags == 0) { /* Quick exit */
+ return g->orig_instr;
+ }
+ }
+
+ 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);
+ } else if (bp_flags & ERTS_BPF_GLOBAL_TRACE) {
+ (void) do_call_trace(c_p, I, reg, 0, bp->local_ms, am_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);
+ }
+ }
+
+ if (bp_flags & ERTS_BPF_COUNT_ACTIVE) {
+ erts_smp_atomic_inc_nob(&bp->count->acount);
+ }
+
+ if (bp_flags & ERTS_BPF_TIME_TRACE_ACTIVE) {
+ Eterm w;
+ erts_trace_time_call(c_p, I, bp->time);
+ w = (BeamInstr) *c_p->cp;
+ if (! (w == (BeamInstr) BeamOp(op_i_return_time_trace) ||
+ w == (BeamInstr) BeamOp(op_return_trace) ||
+ w == (BeamInstr) BeamOp(op_i_return_to_trace)) ) {
+ Eterm* E = c_p->stop;
+ ASSERT(c_p->htop <= E && E <= c_p->hend);
+ if (E - 2 < c_p->htop) {
+ (void) erts_garbage_collect(c_p, 2, reg, I[-1]);
+ ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p);
+ }
+ E = c_p->stop;
+ ASSERT(c_p->htop <= E && E <= c_p->hend);
+
+ E -= 2;
+ E[0] = make_cp(I);
+ E[1] = make_cp(c_p->cp); /* original return address */
+ c_p->cp = beam_return_time_trace;
+ c_p->stop = E;
+ }
+ }
+
+ if (bp_flags & ERTS_BPF_DEBUG) {
+ return (BeamInstr) BeamOp(op_i_debug_breakpoint);
+ } else {
+ return g->orig_instr;
+ }
+}
/*
- * SMP NOTE: Process p may have become exiting on return!
+ * Entry point called by the trace wrap functions in erl_bif_wrap.c
+ *
+ * The trace wrap functions are themselves called through the export
+ * entries instead of the original BIF functions.
*/
-BeamInstr
-erts_trace_break(Process *p, BeamInstr *pc, Eterm *args,
- Uint32 *ret_flags, Eterm *tracer_pid) {
- Eterm tpid1, tpid2;
- BpData **bds = (BpData **) (pc)[-4];
- BpDataTrace *bdt = NULL;
+Eterm
+erts_bif_trace(int bif_index, Process* p, Eterm* args, BeamInstr* I)
+{
+ Eterm result;
+ Eterm (*func)(Process*, Eterm*, BeamInstr*);
+ Export* ep = bif_export[bif_index];
+ Uint32 flags = 0, flags_meta = 0;
+ Eterm meta_tracer_pid = NIL;
+ int applying = (I == &(ep->code[3])); /* Yup, the apply code for a bif
+ * is actually in the
+ * export entry */
+ BeamInstr *cp = p->cp;
+ GenericBp* g;
+ GenericBpData* bp;
+ Uint bp_flags = 0;
+
+ ERTS_SMP_CHK_HAVE_ONLY_MAIN_PROC_LOCK(p);
+
+ g = (GenericBp *) ep->fake_op_func_info_for_hipe[1];
+ if (g) {
+ bp = &g->data[erts_active_bp_ix()];
+ bp_flags = bp->flags;
+ }
- ASSERT(bds);
- ASSERT(pc[-5] == (BeamInstr) BeamOp(op_i_func_info_IaaI));
- bdt = (BpDataTrace *) bds[bp_sched2ix_proc(p)];
- ASSERT(bdt);
- bdt = (BpDataTrace *) bdt->next;
- ASSERT(bdt);
- ASSERT(ret_flags);
- ASSERT(tracer_pid);
-
- ErtsSmpBPLock(bdt);
- tpid1 = tpid2 = bdt->tracer_pid;
- ErtsSmpBPUnlock(bdt);
-
- *ret_flags = erts_call_trace(p, pc-3/*mfa*/, bdt->match_spec, args,
- 1, &tpid2);
- *tracer_pid = tpid2;
- if (tpid1 != tpid2) {
- ErtsSmpBPLock(bdt);
- bdt->tracer_pid = tpid2;
- ErtsSmpBPUnlock(bdt);
- }
- bds[bp_sched2ix_proc(p)] = (BpData *) bdt;
- return bdt->orig_instr;
+ /*
+ * Make continuation pointer OK, it is not during direct BIF calls,
+ * but it is correct during apply of bif.
+ */
+ if (!applying) {
+ p->cp = I;
+ }
+ if (bp_flags & (ERTS_BPF_LOCAL_TRACE|ERTS_BPF_GLOBAL_TRACE) &&
+ 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, &p->tracer_proc);
+ }
+ if (bp_flags & ERTS_BPF_META_TRACE) {
+ Eterm tpid1, tpid2;
+
+ tpid1 = tpid2 =
+ (Eterm) erts_smp_atomic_read_nob(&bp->meta_pid->pid);
+ 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);
+ }
+ }
+ if (bp_flags & ERTS_BPF_TIME_TRACE_ACTIVE &&
+ IS_TRACED_FL(p, F_TRACE_CALLS)) {
+ BeamInstr *pc = (BeamInstr *)ep->code+3;
+ erts_trace_time_call(p, pc, bp->time);
+ }
+
+ /* Restore original continuation pointer (if changed). */
+ p->cp = cp;
+
+ func = bif_table[bif_index].f;
+
+ result = func(p, args, I);
+
+ if (applying && (flags & MATCH_SET_RETURN_TO_TRACE)) {
+ BeamInstr i_return_trace = beam_return_trace[0];
+ BeamInstr i_return_to_trace = beam_return_to_trace[0];
+ BeamInstr i_return_time_trace = beam_return_time_trace[0];
+ Eterm *cpp;
+ /* Maybe advance cp to skip trace stack frames */
+ for (cpp = p->stop; ; cp = cp_val(*cpp++)) {
+ if (*cp == i_return_trace) {
+ /* Skip stack frame variables */
+ while (is_not_CP(*cpp)) cpp++;
+ cpp += 2; /* Skip return_trace parameters */
+ } else if (*cp == i_return_time_trace) {
+ /* Skip stack frame variables */
+ while (is_not_CP(*cpp)) cpp++;
+ cpp += 1; /* Skip return_time_trace parameters */
+ } else if (*cp == i_return_to_trace) {
+ /* A return_to trace message is going to be generated
+ * by normal means, so we do not have to.
+ */
+ cp = NULL;
+ break;
+ } else break;
+ }
+ }
+
+ /* Try to get these in the order
+ * they usually appear in normal code... */
+ if (is_non_value(result)) {
+ Uint reason = p->freason;
+ 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;
+ ASSERT(is_tuple(value));
+ tp = tuple_val(value);
+ value = tp[1];
+ }
+ if ((reason & EXF_THROWN) && (p->catches <= 0)) {
+ value = TUPLE2(nocatch, am_nocatch, value);
+ reason = EXC_ERROR;
+ }
+ /* Note: expand_error_value() could theoretically
+ * allocate on the heap, but not for any error
+ * returned by a BIF, and it would do no harm,
+ * just be annoying.
+ */
+ value = expand_error_value(p, reason, value);
+ class = exception_tag[GET_EXC_CLASS(reason)];
+
+ if (flags_meta & MATCH_SET_EXCEPTION_TRACE) {
+ erts_trace_exception(p, ep->code, class, value,
+ &meta_tracer_pid);
+ }
+ if (flags & MATCH_SET_EXCEPTION_TRACE) {
+ erts_trace_exception(p, ep->code, class, value,
+ &p->tracer_proc);
+ }
+ if ((flags & MATCH_SET_RETURN_TO_TRACE) && p->catches > 0) {
+ /* can only happen if(local)*/
+ Eterm *ptr = p->stop;
+ ASSERT(is_CP(*ptr));
+ ASSERT(ptr <= STACK_START(p));
+ /* Search the nearest stack frame for a catch */
+ while (++ptr < STACK_START(p)) {
+ if (is_CP(*ptr)) break;
+ if (is_catch(*ptr)) {
+ if (applying) {
+ /* Apply of BIF, cp is in calling function */
+ if (cp) erts_trace_return_to(p, cp);
+ } else {
+ /* Direct bif call, I points into
+ * calling function */
+ erts_trace_return_to(p, I);
+ }
+ }
+ }
+ }
+ UnUseTmpHeapNoproc(3);
+ if ((flags_meta|flags) & MATCH_SET_EXCEPTION_TRACE) {
+ erts_smp_proc_lock(p, ERTS_PROC_LOCKS_ALL_MINOR);
+ p->trace_flags |= F_EXCEPTION_TRACE;
+ erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL_MINOR);
+ }
+ }
+ } else {
+ if (flags_meta & MATCH_SET_RX_TRACE) {
+ erts_trace_return(p, ep->code, result, &meta_tracer_pid);
+ }
+ /* MATCH_SET_RETURN_TO_TRACE cannot occur if(meta) */
+ if (flags & MATCH_SET_RX_TRACE) {
+ erts_trace_return(p, ep->code, result, &p->tracer_proc);
+ }
+ if (flags & MATCH_SET_RETURN_TO_TRACE) {
+ /* can only happen if(local)*/
+ if (applying) {
+ /* Apply of BIF, cp is in calling function */
+ if (cp) erts_trace_return_to(p, cp);
+ } else {
+ /* Direct bif call, I points into calling function */
+ erts_trace_return_to(p, I);
+ }
+ }
+ }
+ ERTS_SMP_CHK_HAVE_ONLY_MAIN_PROC_LOCK(p);
+ return result;
+}
+
+static Eterm
+do_call_trace(Process* c_p, BeamInstr* I, Eterm* reg,
+ int local, Binary* ms, Eterm tracer_pid)
+{
+ Eterm* cpp;
+ int return_to_trace = 0;
+ BeamInstr w;
+ BeamInstr *cp_save;
+ Uint32 flags;
+ Uint need = 0;
+ Eterm* E = c_p->stop;
+
+ w = *c_p->cp;
+ if (w == (BeamInstr) BeamOp(op_return_trace)) {
+ cpp = &E[2];
+ } else if (w == (BeamInstr) BeamOp(op_i_return_to_trace)) {
+ return_to_trace = 1;
+ cpp = &E[0];
+ } else if (w == (BeamInstr) BeamOp(op_i_return_time_trace)) {
+ cpp = &E[0];
+ } else {
+ cpp = NULL;
+ }
+ if (cpp) {
+ for (;;) {
+ BeamInstr w = *cp_val(*cpp);
+ if (w == (BeamInstr) BeamOp(op_return_trace)) {
+ cpp += 3;
+ } else if (w == (BeamInstr) BeamOp(op_i_return_to_trace)) {
+ return_to_trace = 1;
+ cpp += 1;
+ } else if (w == (BeamInstr) BeamOp(op_i_return_time_trace)) {
+ cpp += 2;
+ } else {
+ break;
+ }
+ }
+ cp_save = c_p->cp;
+ c_p->cp = (BeamInstr *) cp_val(*cpp);
+ 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);
+ ERTS_SMP_REQ_PROC_MAIN_LOCK(c_p);
+ if (cpp) {
+ c_p->cp = cp_save;
+ }
+
+ ASSERT(!ERTS_PROC_IS_EXITING(c_p));
+ if ((flags & MATCH_SET_RETURN_TO_TRACE) && !return_to_trace) {
+ need += 1;
+ }
+ if (flags & MATCH_SET_RX_TRACE) {
+ need += 3;
+ }
+ if (need) {
+ ASSERT(c_p->htop <= E && E <= c_p->hend);
+ if (E - need < c_p->htop) {
+ (void) erts_garbage_collect(c_p, need, reg, I[-1]);
+ ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p);
+ E = c_p->stop;
+ }
+ }
+ if (flags & MATCH_SET_RETURN_TO_TRACE && !return_to_trace) {
+ E -= 1;
+ ASSERT(c_p->htop <= E && E <= c_p->hend);
+ E[0] = make_cp(c_p->cp);
+ c_p->cp = (BeamInstr *) beam_return_to_trace;
+ }
+ if (flags & MATCH_SET_RX_TRACE) {
+ E -= 3;
+ 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));
+ E[2] = make_cp(c_p->cp);
+ E[1] = tracer_pid;
+ E[0] = make_cp(I - 3); /* We ARE at the beginning of an
+ instruction,
+ the funcinfo is above i. */
+ c_p->cp = (flags & MATCH_SET_EXCEPTION_TRACE) ?
+ beam_exception_trace : beam_return_trace;
+ erts_smp_proc_lock(c_p, ERTS_PROC_LOCKS_ALL_MINOR);
+ c_p->trace_flags |= F_EXCEPTION_TRACE;
+ erts_smp_proc_unlock(c_p, ERTS_PROC_LOCKS_ALL_MINOR);
+ }
+ c_p->stop = E;
+ return tracer_pid;
}
+void
+erts_trace_time_call(Process* c_p, BeamInstr* I, BpDataTime* bdt)
+{
+ Uint ms,s,us;
+ process_breakpoint_time_t *pbt = NULL;
+ bp_data_time_item_t sitem, *item = NULL;
+ bp_time_hash_t *h = NULL;
+ BpDataTime *pbdt = NULL;
+ ASSERT(c_p);
+ ASSERT(erts_smp_atomic32_read_acqb(&c_p->state) & ERTS_PSFLG_RUNNING);
-/*
- * SMP NOTE: Process p may have become exiting on return!
- */
-Uint32
-erts_bif_mtrace(Process *p, BeamInstr *pc, Eterm *args, int local,
- Eterm *tracer_pid) {
- BpData **bds = (BpData **) (pc)[-4];
- BpDataTrace *bdt = NULL;
+ /* get previous timestamp and breakpoint
+ * from the process psd */
+ pbt = ERTS_PROC_GET_CALL_TIME(c_p);
+ get_sys_now(&ms, &s, &us);
- ASSERT(tracer_pid);
- if (bds) {
- Eterm tpid1, tpid2;
- Uint32 flags;
- bdt = (BpDataTrace *)bds[bp_sched2ix_proc(p)];
+ /* get pbt
+ * timestamp = t0
+ * lookup bdt from code
+ * set ts0 to pbt
+ * add call count here?
+ */
+ 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);
+ } else {
+ ASSERT(pbt->pc);
+ /* add time to previous code */
+ bp_time_diff(&sitem, pbt, ms, s, us);
+ sitem.pid = c_p->id;
+ sitem.count = 0;
- ErtsSmpBPLock(bdt);
- tpid1 = tpid2 = bdt->tracer_pid;
- ErtsSmpBPUnlock(bdt);
+ /* previous breakpoint */
+ pbdt = get_time_break(pbt->pc);
- flags = erts_call_trace(p, pc-3/*mfa*/, bdt->match_spec, args,
- local, &tpid2);
- *tracer_pid = tpid2;
- if (tpid1 != tpid2) {
- ErtsSmpBPLock(bdt);
- bdt->tracer_pid = tpid2;
- ErtsSmpBPUnlock(bdt);
+ /* if null then the breakpoint was removed */
+ if (pbdt) {
+ h = &(pbdt->hash[bp_sched2ix_proc(c_p)]);
+
+ ASSERT(h);
+ ASSERT(h->item);
+
+ item = bp_hash_get(h, &sitem);
+ if (!item) {
+ item = bp_hash_put(h, &sitem);
+ } else {
+ BP_TIME_ADD(item, &sitem);
+ }
}
- return flags;
}
- *tracer_pid = NIL;
- return 0;
+
+ /* Add count to this code */
+ sitem.pid = c_p->id;
+ sitem.count = 1;
+ sitem.s_time = 0;
+ sitem.us_time = 0;
+
+ /* this breakpoint */
+ ASSERT(bdt);
+ h = &(bdt->hash[bp_sched2ix_proc(c_p)]);
+
+ ASSERT(h);
+ ASSERT(h->item);
+
+ item = bp_hash_get(h, &sitem);
+ if (!item) {
+ item = bp_hash_put(h, &sitem);
+ } else {
+ BP_TIME_ADD(item, &sitem);
+ }
+
+ pbt->pc = I;
+ pbt->ms = ms;
+ pbt->s = s;
+ pbt->us = us;
}
+void
+erts_trace_time_return(Process *p, BeamInstr *pc)
+{
+ Uint ms,s,us;
+ process_breakpoint_time_t *pbt = NULL;
+ bp_data_time_item_t sitem, *item = NULL;
+ bp_time_hash_t *h = NULL;
+ BpDataTime *pbdt = NULL;
+
+ ASSERT(p);
+ ASSERT(erts_smp_atomic32_read_acqb(&p->state) & ERTS_PSFLG_RUNNING);
+ /* get previous timestamp and breakpoint
+ * from the process psd */
+
+ pbt = ERTS_PROC_GET_CALL_TIME(p);
+ get_sys_now(&ms,&s,&us);
+
+ /* get pbt
+ * lookup bdt from code
+ * timestamp = t1
+ * get ts0 from pbt
+ * get item from bdt->hash[bp_hash(p->id)]
+ * ack diff (t1, t0) to item
+ */
+
+ if (pbt) {
+ /* might have been removed due to
+ * trace_pattern(false)
+ */
+ ASSERT(pbt->pc);
+
+ bp_time_diff(&sitem, pbt, ms, s, us);
+ sitem.pid = p->id;
+ sitem.count = 0;
+
+ /* previous breakpoint */
+ pbdt = get_time_break(pbt->pc);
+
+ /* beware, the trace_pattern might have been removed */
+ if (pbdt) {
+ h = &(pbdt->hash[bp_sched2ix_proc(p)]);
+
+ ASSERT(h);
+ ASSERT(h->item);
+
+ item = bp_hash_get(h, &sitem);
+ if (!item) {
+ item = bp_hash_put(h, &sitem);
+ } else {
+ BP_TIME_ADD(item, &sitem);
+ }
+ }
+
+ pbt->pc = pc;
+ pbt->ms = ms;
+ pbt->s = s;
+ pbt->us = us;
+ }
+}
int
-erts_is_trace_break(BeamInstr *pc, Binary **match_spec_ret, Eterm *tracer_pid_ret) {
- BpDataTrace *bdt =
- (BpDataTrace *) is_break(pc, (BeamInstr) BeamOp(op_i_trace_breakpoint));
-
- if (bdt) {
+erts_is_trace_break(BeamInstr *pc, Binary **match_spec_ret, int local)
+{
+ Uint flags = local ? ERTS_BPF_LOCAL_TRACE : ERTS_BPF_GLOBAL_TRACE;
+ GenericBpData* bp = check_break(pc, flags);
+
+ if (bp) {
if (match_spec_ret) {
- *match_spec_ret = bdt->match_spec;
+ *match_spec_ret = bp->local_ms;
}
- if (tracer_pid_ret) {
- ErtsSmpBPLock(bdt);
- *tracer_pid_ret = bdt->tracer_pid;
- ErtsSmpBPUnlock(bdt);
- }
- return !0;
+ return 1;
}
return 0;
}
int
-erts_is_mtrace_break(BeamInstr *pc, Binary **match_spec_ret, Eterm *tracer_pid_ret) {
- BpDataTrace *bdt =
- (BpDataTrace *) is_break(pc, (BeamInstr) BeamOp(op_i_mtrace_breakpoint));
+erts_is_mtrace_break(BeamInstr *pc, Binary **match_spec_ret,
+ Eterm *tracer_pid_ret)
+{
+ GenericBpData* bp = check_break(pc, ERTS_BPF_META_TRACE);
- if (bdt) {
+ if (bp) {
if (match_spec_ret) {
- *match_spec_ret = bdt->match_spec;
+ *match_spec_ret = bp->meta_ms;
}
if (tracer_pid_ret) {
- ErtsSmpBPLock(bdt);
- *tracer_pid_ret = bdt->tracer_pid;
- ErtsSmpBPUnlock(bdt);
+ *tracer_pid_ret =
+ (Eterm) erts_smp_atomic_read_nob(&bp->meta_pid->pid);
}
- return !0;
+ return 1;
}
return 0;
}
@@ -402,15 +1129,15 @@ erts_is_native_break(BeamInstr *pc) {
}
int
-erts_is_count_break(BeamInstr *pc, Sint *count_ret) {
- BpDataCount *bdc =
- (BpDataCount *) is_break(pc, (BeamInstr) BeamOp(op_i_count_breakpoint));
+erts_is_count_break(BeamInstr *pc, Uint *count_ret)
+{
+ GenericBpData* bp = check_break(pc, ERTS_BPF_COUNT);
- if (bdc) {
+ if (bp) {
if (count_ret) {
- *count_ret = (Sint) erts_smp_atomic_read_nob(&bdc->acount);
+ *count_ret = (Uint) erts_smp_atomic_read_nob(&bp->count->acount);
}
- return !0;
+ return 1;
}
return 0;
}
@@ -421,7 +1148,7 @@ int erts_is_time_break(Process *p, BeamInstr *pc, Eterm *retval) {
Uint size;
Eterm *hp, t;
bp_data_time_item_t *item = NULL;
- BpDataTime *bdt = (BpDataTime *) is_break(pc, (BeamInstr) BeamOp(op_i_time_breakpoint));
+ BpDataTime *bdt = get_time_break(pc);
if (bdt) {
if (retval) {
@@ -464,7 +1191,7 @@ int erts_is_time_break(Process *p, BeamInstr *pc, Eterm *retval) {
}
bp_hash_delete(&hash);
}
- return !0;
+ return 1;
}
return 0;
@@ -478,15 +1205,16 @@ erts_find_local_func(Eterm mfa[3]) {
BeamInstr* code_ptr;
Uint i,n;
- if ((modp = erts_get_module(mfa[0])) == NULL)
+ if ((modp = erts_get_module(mfa[0], erts_active_code_ix())) == NULL)
return NULL;
- if ((code_base = (BeamInstr **) modp->code) == NULL)
+ if ((code_base = (BeamInstr **) modp->curr.code) == NULL)
return NULL;
n = (BeamInstr) code_base[MI_NUM_FUNCTIONS];
for (i = 0; i < n; ++i) {
code_ptr = code_base[MI_FUNCTIONS+i];
ASSERT(((BeamInstr) BeamOp(op_i_func_info_IaaI)) == code_ptr[0]);
- ASSERT(mfa[0] == ((Eterm) code_ptr[2]));
+ ASSERT(mfa[0] == ((Eterm) code_ptr[2]) ||
+ is_nil((Eterm) code_ptr[2]));
if (mfa[1] == ((Eterm) code_ptr[3]) &&
((BeamInstr) mfa[2]) == code_ptr[4]) {
return code_ptr + 5;
@@ -654,7 +1382,7 @@ void erts_schedule_time_break(Process *p, Uint schedule) {
* the previous breakpoint.
*/
- pbdt = (BpDataTime *) get_break(p, pbt->pc, (BeamInstr) BeamOp(op_i_time_breakpoint));
+ pbdt = get_time_break(pbt->pc);
if (pbdt) {
get_sys_now(&ms,&s,&us);
bp_time_diff(&sitem, pbt, ms, s, us);
@@ -692,669 +1420,259 @@ void erts_schedule_time_break(Process *p, Uint schedule) {
} /* pbt */
}
-/* call_time breakpoint
- * Accumulated times are added to the previous bp,
- * not the current one. The current one is saved
- * for future reference.
- * The previous breakpoint is stored in the process it self, the psd.
- * We do not need to store in a stack frame.
- * There is no need for locking, each thread has its own
- * area in each bp to save data.
- * Since we need to diffrentiate between processes for each bp,
- * every bp has a hash (per thread) to process-bp statistics.
- * - egil
- */
-
-void erts_trace_time_break(Process *p, BeamInstr *pc, BpDataTime *bdt, Uint type) {
- Uint ms,s,us;
- process_breakpoint_time_t *pbt = NULL;
- bp_data_time_item_t sitem, *item = NULL;
- bp_time_hash_t *h = NULL;
- BpDataTime *pbdt = NULL;
-
- ASSERT(p);
- ASSERT(p->status == P_RUNNING);
-
- /* get previous timestamp and breakpoint
- * from the process psd */
-
- pbt = ERTS_PROC_GET_CALL_TIME(p);
- get_sys_now(&ms,&s,&us);
-
- switch(type) {
- /* get pbt
- * timestamp = t0
- * lookup bdt from code
- * set ts0 to pbt
- * add call count here?
- */
- case ERTS_BP_CALL_TIME_CALL:
- case ERTS_BP_CALL_TIME_TAIL_CALL:
-
- if (pbt) {
- ASSERT(pbt->pc);
- /* add time to previous code */
- bp_time_diff(&sitem, pbt, ms, s, us);
- sitem.pid = p->id;
- sitem.count = 0;
-
- /* previous breakpoint */
- pbdt = (BpDataTime *) get_break(p, pbt->pc, (BeamInstr) BeamOp(op_i_time_breakpoint));
-
- /* if null then the breakpoint was removed */
- if (pbdt) {
- h = &(pbdt->hash[bp_sched2ix_proc(p)]);
-
- ASSERT(h);
- ASSERT(h->item);
-
- item = bp_hash_get(h, &sitem);
- if (!item) {
- item = bp_hash_put(h, &sitem);
- } else {
- BP_TIME_ADD(item, &sitem);
- }
- }
-
- } else {
- /* first call of process to instrumented function */
- pbt = Alloc(sizeof(process_breakpoint_time_t));
- (void *) ERTS_PROC_SET_CALL_TIME(p, ERTS_PROC_LOCK_MAIN, pbt);
- }
- /* add count to this code */
- sitem.pid = p->id;
- sitem.count = 1;
- sitem.s_time = 0;
- sitem.us_time = 0;
-
- /* this breakpoint */
- ASSERT(bdt);
- h = &(bdt->hash[bp_sched2ix_proc(p)]);
-
- ASSERT(h);
- ASSERT(h->item);
-
- item = bp_hash_get(h, &sitem);
- if (!item) {
- item = bp_hash_put(h, &sitem);
- } else {
- BP_TIME_ADD(item, &sitem);
- }
-
- pbt->pc = pc;
- pbt->ms = ms;
- pbt->s = s;
- pbt->us = us;
- break;
-
- case ERTS_BP_CALL_TIME_RETURN:
- /* get pbt
- * lookup bdt from code
- * timestamp = t1
- * get ts0 from pbt
- * get item from bdt->hash[bp_hash(p->id)]
- * ack diff (t1, t0) to item
- */
-
- if(pbt) {
- /* might have been removed due to
- * trace_pattern(false)
- */
- ASSERT(pbt->pc);
-
- bp_time_diff(&sitem, pbt, ms, s, us);
- sitem.pid = p->id;
- sitem.count = 0;
-
- /* previous breakpoint */
- pbdt = (BpDataTime *) get_break(p, pbt->pc, (BeamInstr) BeamOp(op_i_time_breakpoint));
-
- /* beware, the trace_pattern might have been removed */
- if (pbdt) {
- h = &(pbdt->hash[bp_sched2ix_proc(p)]);
-
- ASSERT(h);
- ASSERT(h->item);
-
- item = bp_hash_get(h, &sitem);
- if (!item) {
- item = bp_hash_put(h, &sitem);
- } else {
- BP_TIME_ADD(item, &sitem);
- }
- }
-
- pbt->pc = pc;
- pbt->ms = ms;
- pbt->s = s;
- pbt->us = us;
- }
- break;
- default :
- ASSERT(0);
- /* will never happen */
- break;
- }
-}
-
-
/* *************************************************************************
** Local helpers
*/
-static int set_break(Eterm mfa[3], int specified,
- Binary *match_spec, BeamInstr break_op,
- enum erts_break_op count_op, Eterm tracer_pid)
+static void
+set_break(BpFunctions* f, Binary *match_spec, Uint break_flags,
+ enum erts_break_op count_op, Eterm tracer_pid)
{
- Module *modp;
- int num_processed = 0;
- if (!specified) {
- /* Find and process all modules in the system... */
- int current;
- int last = module_code_size();
- for (current = 0; current < last; current++) {
- modp = module_code(current);
- ASSERT(modp != NULL);
- num_processed +=
- set_module_break(modp, mfa, specified,
- match_spec, break_op, count_op,
- tracer_pid);
- }
- } else {
- /* Process a single module */
- if ((modp = erts_get_module(mfa[0])) != NULL) {
- num_processed +=
- set_module_break(modp, mfa, specified,
- match_spec, break_op, count_op,
- tracer_pid);
- }
- }
- return num_processed;
-}
-
-static int set_module_break(Module *modp, Eterm mfa[3], int specified,
- Binary *match_spec, BeamInstr break_op,
- enum erts_break_op count_op, Eterm tracer_pid) {
- BeamInstr** code_base;
- BeamInstr* code_ptr;
- int num_processed = 0;
- Uint i,n;
+ Uint i;
+ Uint n;
- ASSERT(break_op);
- ASSERT(modp);
- code_base = (BeamInstr **) modp->code;
- if (code_base == NULL) {
- return 0;
+ n = f->matched;
+ for (i = 0; i < n; i++) {
+ BeamInstr* pc = f->matching[i].pc;
+ set_function_break(pc, match_spec, break_flags,
+ count_op, tracer_pid);
}
- n = (BeamInstr) code_base[MI_NUM_FUNCTIONS];
- for (i = 0; i < n; ++i) {
- code_ptr = code_base[MI_FUNCTIONS+i];
- ASSERT(code_ptr[0] == (BeamInstr) BeamOp(op_i_func_info_IaaI));
- if ((specified < 2 || mfa[1] == ((Eterm) code_ptr[3])) &&
- (specified < 3 || ((int) mfa[2]) == ((int) code_ptr[4]))) {
- BeamInstr *pc = code_ptr+5;
-
- num_processed +=
- set_function_break(modp, pc, BREAK_IS_ERL, match_spec,
- break_op, count_op, tracer_pid);
- }
- }
- return num_processed;
}
-static int set_function_break(Module *modp, BeamInstr *pc, int bif,
- Binary *match_spec, BeamInstr break_op,
- enum erts_break_op count_op, Eterm tracer_pid) {
-
- BeamInstr **code_base = NULL;
- BpData *bd, **r, ***rs;
- size_t size;
- Uint ix = 0;
-
- if (bif == BREAK_IS_ERL) {
- code_base = (BeamInstr **)modp->code;
- ASSERT(code_base);
- ASSERT(code_base <= (BeamInstr **)pc);
- ASSERT((BeamInstr **)pc < code_base + (modp->code_length/sizeof(BeamInstr *)));
- } else {
- ASSERT(*pc == (BeamInstr) em_apply_bif);
- ASSERT(modp == NULL);
+static void
+set_function_break(BeamInstr *pc, Binary *match_spec, Uint break_flags,
+ enum erts_break_op count_op, Eterm tracer_pid)
+{
+ GenericBp* g;
+ GenericBpData* bp;
+ Uint common;
+ ErtsBpIndex ix = erts_staging_bp_ix();
+
+ ERTS_SMP_LC_ASSERT(erts_is_code_ix_locked());
+ g = (GenericBp *) pc[-4];
+ if (g == 0) {
+ int i;
+ if (count_op == erts_break_reset || count_op == erts_break_stop) {
+ /* Do not insert a new breakpoint */
+ return;
+ }
+ g = Alloc(sizeof(GenericBp));
+ g->orig_instr = *pc;
+ for (i = 0; i < ERTS_NUM_BP_IX; i++) {
+ g->data[i].flags = 0;
+ }
+ pc[-4] = (BeamInstr) g;
}
+ bp = &g->data[ix];
/*
- * Currently no trace support for native code.
+ * If we are changing an existing breakpoint, clean up old data.
*/
- if (erts_is_native_break(pc)) {
- return 0;
- }
- /* Do not allow two breakpoints of the same kind */
- if ( (bd = is_break(pc, break_op))) {
- if (break_op == (BeamInstr) BeamOp(op_i_trace_breakpoint)
- || break_op == (BeamInstr) BeamOp(op_i_mtrace_breakpoint)) {
-
- BpDataTrace *bdt = (BpDataTrace *) bd;
- Binary *old_match_spec;
-
- /* Update match spec and tracer */
- MatchSetRef(match_spec);
- ErtsSmpBPLock(bdt);
- old_match_spec = bdt->match_spec;
- bdt->match_spec = match_spec;
- bdt->tracer_pid = tracer_pid;
- ErtsSmpBPUnlock(bdt);
- MatchSetUnref(old_match_spec);
- } else {
- BpDataCount *bdc = (BpDataCount *) bd;
- erts_aint_t count = 0;
- erts_aint_t res = 0;
-
- ASSERT(! match_spec);
- ASSERT(is_nil(tracer_pid));
-
- if (break_op == (BeamInstr) BeamOp(op_i_count_breakpoint)) {
- if (count_op == erts_break_stop) {
- count = erts_smp_atomic_read_nob(&bdc->acount);
- if (count >= 0) {
- while(1) {
- res = erts_smp_atomic_cmpxchg_nob(&bdc->acount, -count - 1, count);
- if ((res == count) || count < 0) break;
- count = res;
- }
- }
- } else {
- /* Reset call counter */
- erts_smp_atomic_set_nob(&bdc->acount, 0);
- }
-
- } else if (break_op == (BeamInstr) BeamOp(op_i_time_breakpoint)) {
- BpDataTime *bdt = (BpDataTime *) bd;
- Uint i = 0;
-
- ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
-
- if (count_op == erts_break_stop) {
- bdt->pause = 1;
- } else {
- bdt->pause = 0;
- for (i = 0; i < bdt->n; i++) {
- bp_hash_delete(&(bdt->hash[i]));
- bp_hash_init(&(bdt->hash[i]), 32);
- }
- }
- } else {
- ASSERT (! count_op);
- }
- }
- return 1;
- }
- if (break_op == (BeamInstr) BeamOp(op_i_trace_breakpoint) ||
- break_op == (BeamInstr) BeamOp(op_i_mtrace_breakpoint)) {
- size = sizeof(BpDataTrace);
- } else {
- ASSERT(! match_spec);
- ASSERT(is_nil(tracer_pid));
- if (break_op == (BeamInstr) BeamOp(op_i_count_breakpoint)) {
- if (count_op == erts_break_reset || count_op == erts_break_stop) {
- /* Do not insert a new breakpoint */
- return 1;
- }
- size = sizeof(BpDataCount);
- } else if (break_op == (BeamInstr) BeamOp(op_i_time_breakpoint)) {
- if (count_op == erts_break_reset || count_op == erts_break_stop) {
- /* Do not insert a new breakpoint */
- return 1;
- }
- size = sizeof(BpDataTime);
+ common = break_flags & bp->flags;
+ if (common & (ERTS_BPF_LOCAL_TRACE|ERTS_BPF_GLOBAL_TRACE)) {
+ MatchSetUnref(bp->local_ms);
+ } else if (common & ERTS_BPF_META_TRACE) {
+ MatchSetUnref(bp->meta_ms);
+ bp_meta_unref(bp->meta_pid);
+ } else if (common & ERTS_BPF_COUNT) {
+ if (count_op == erts_break_stop) {
+ bp->flags &= ~ERTS_BPF_COUNT_ACTIVE;
} else {
- ASSERT(! count_op);
- ASSERT(break_op == (BeamInstr) BeamOp(op_i_debug_breakpoint));
- size = sizeof(BpDataDebug);
+ bp->flags |= ERTS_BPF_COUNT_ACTIVE;
+ erts_smp_atomic_set_nob(&bp->count->acount, 0);
}
- }
- rs = (BpData ***) (pc-4);
- if (! *rs) {
- size_t ssize = sizeof(BeamInstr) * erts_no_schedulers;
- *rs = (BpData **) Alloc(ssize);
- sys_memzero(*rs, ssize);
- }
-
- r = &((*rs)[0]);
-
- if (! *r) {
- ASSERT(*pc != (BeamInstr) BeamOp(op_i_trace_breakpoint));
- ASSERT(*pc != (BeamInstr) BeamOp(op_i_mtrace_breakpoint));
- ASSERT(*pc != (BeamInstr) BeamOp(op_i_debug_breakpoint));
- ASSERT(*pc != (BeamInstr) BeamOp(op_i_count_breakpoint));
- ASSERT(*pc != (BeamInstr) BeamOp(op_i_time_breakpoint));
- /* First breakpoint; create singleton ring */
- bd = Alloc(size);
- BpInit(bd, *pc);
- *r = bd;
- if (bif == BREAK_IS_ERL) {
- *pc = break_op;
- }
- } else {
- ASSERT(*pc == (BeamInstr) BeamOp(op_i_trace_breakpoint) ||
- *pc == (BeamInstr) BeamOp(op_i_mtrace_breakpoint) ||
- *pc == (BeamInstr) BeamOp(op_i_debug_breakpoint) ||
- *pc == (BeamInstr) BeamOp(op_i_time_breakpoint) ||
- *pc == (BeamInstr) BeamOp(op_i_count_breakpoint) ||
- *pc == (BeamInstr) em_apply_bif);
- if (*pc == (BeamInstr) BeamOp(op_i_debug_breakpoint)) {
- /* Debug bp must be last, so if it is also first;
- * it must be singleton. */
- ASSERT(BpSingleton(*r));
- /* Insert new bp first in the ring, i.e second to last. */
- bd = Alloc(size);
- BpInitAndSpliceNext(bd, *pc, *r);
- if (bif == BREAK_IS_ERL) {
- *pc = break_op;
- }
- } else if ((*r)->prev->orig_instr
- == (BeamInstr) BeamOp(op_i_debug_breakpoint)) {
- /* Debug bp last in the ring; insert new second to last. */
- bd = Alloc(size);
- BpInitAndSplicePrev(bd, (*r)->prev->orig_instr, *r);
- (*r)->prev->orig_instr = break_op;
+ ASSERT((bp->flags & ~ERTS_BPF_ALL) == 0);
+ return;
+ } else if (common & ERTS_BPF_TIME_TRACE) {
+ BpDataTime* bdt = bp->time;
+ Uint i = 0;
+
+ if (count_op == erts_break_stop) {
+ bp->flags &= ~ERTS_BPF_TIME_TRACE_ACTIVE;
} else {
- /* Just insert last in the ring */
- bd = Alloc(size);
- BpInitAndSpliceNext(bd, (*r)->orig_instr, *r);
- (*r)->orig_instr = break_op;
- *r = bd;
+ bp->flags |= ERTS_BPF_TIME_TRACE_ACTIVE;
+ for (i = 0; i < bdt->n; i++) {
+ bp_hash_delete(&(bdt->hash[i]));
+ bp_hash_init(&(bdt->hash[i]), 32);
+ }
}
- }
- for (ix = 1; ix < erts_no_schedulers; ++ix) {
- (*rs)[ix] = (*rs)[0];
+ ASSERT((bp->flags & ~ERTS_BPF_ALL) == 0);
+ return;
}
- bd->this_instr = break_op;
- /* Init the bp type specific data */
- if (break_op == (BeamInstr) BeamOp(op_i_trace_breakpoint) ||
- break_op == (BeamInstr) BeamOp(op_i_mtrace_breakpoint)) {
-
- BpDataTrace *bdt = (BpDataTrace *) bd;
-
- MatchSetRef(match_spec);
- bdt->match_spec = match_spec;
- bdt->tracer_pid = tracer_pid;
- } else if (break_op == (BeamInstr) BeamOp(op_i_time_breakpoint)) {
- BpDataTime *bdt = (BpDataTime *) bd;
- Uint i = 0;
-
- bdt->pause = 0;
- bdt->n = erts_no_schedulers;
- bdt->hash = Alloc(sizeof(bp_time_hash_t)*(bdt->n));
+ /*
+ * Initialize the new breakpoint data.
+ */
+ if (break_flags & (ERTS_BPF_LOCAL_TRACE|ERTS_BPF_GLOBAL_TRACE)) {
+ MatchSetRef(match_spec);
+ bp->local_ms = match_spec;
+ } else if (break_flags & ERTS_BPF_META_TRACE) {
+ BpMetaPid* bmp;
+ 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;
+ } else if (break_flags & ERTS_BPF_COUNT) {
+ BpCount* bcp;
+
+ ASSERT((bp->flags & ERTS_BPF_COUNT) == 0);
+ bcp = Alloc(sizeof(BpCount));
+ erts_refc_init(&bcp->refc, 1);
+ erts_smp_atomic_init_nob(&bcp->acount, 0);
+ bp->count = bcp;
+ } else if (break_flags & ERTS_BPF_TIME_TRACE) {
+ BpDataTime* bdt;
+ int i;
+
+ ASSERT((bp->flags & ERTS_BPF_TIME_TRACE) == 0);
+ bdt = Alloc(sizeof(BpDataTime));
+ erts_refc_init(&bdt->refc, 1);
+ bdt->n = erts_no_schedulers;
+ bdt->hash = Alloc(sizeof(bp_time_hash_t)*(bdt->n));
for (i = 0; i < bdt->n; i++) {
bp_hash_init(&(bdt->hash[i]), 32);
}
- } else if (break_op == (BeamInstr) BeamOp(op_i_count_breakpoint)) {
- BpDataCount *bdc = (BpDataCount *) bd;
- erts_smp_atomic_init_nob(&bdc->acount, 0);
+ bp->time = bdt;
}
- if (bif == BREAK_IS_ERL) {
- ++(*(BeamInstr*)&code_base[MI_NUM_BREAKPOINTS]);
+ bp->flags |= break_flags;
+ ASSERT((bp->flags & ~ERTS_BPF_ALL) == 0);
+}
+
+static void
+clear_break(BpFunctions* f, Uint break_flags)
+{
+ Uint i;
+ Uint n;
+
+ n = f->matched;
+ for (i = 0; i < n; i++) {
+ BeamInstr* pc = f->matching[i].pc;
+ clear_function_break(pc, break_flags);
}
- return 1;
}
-static int clear_break(Eterm mfa[3], int specified, BeamInstr break_op)
+static int
+clear_function_break(BeamInstr *pc, Uint break_flags)
{
- int num_processed = 0;
- Module *modp;
+ GenericBp* g;
+ GenericBpData* bp;
+ Uint common;
+ ErtsBpIndex ix = erts_staging_bp_ix();
- if (!specified) {
- /* Iterate over all modules */
- int current;
- int last = module_code_size();
+ ERTS_SMP_LC_ASSERT(erts_is_code_ix_locked());
- for (current = 0; current < last; current++) {
- modp = module_code(current);
- ASSERT(modp != NULL);
- num_processed += clear_module_break(modp, mfa, specified, break_op);
- }
- } else {
- /* Process a single module */
- if ((modp = erts_get_module(mfa[0])) != NULL) {
- num_processed +=
- clear_module_break(modp, mfa, specified, break_op);
- }
+ if ((g = (GenericBp *) pc[-4]) == 0) {
+ return 1;
}
- return num_processed;
-}
-static int clear_module_break(Module *m, Eterm mfa[3], int specified,
- BeamInstr break_op) {
- BeamInstr** code_base;
- BeamInstr* code_ptr;
- int num_processed = 0;
- Uint i;
- BeamInstr n;
-
- ASSERT(m);
- code_base = (BeamInstr **) m->code;
- if (code_base == NULL) {
- return 0;
+ bp = &g->data[ix];
+ ASSERT((bp->flags & ~ERTS_BPF_ALL) == 0);
+ common = bp->flags & break_flags;
+ bp->flags &= ~break_flags;
+ if (common & (ERTS_BPF_LOCAL_TRACE|ERTS_BPF_GLOBAL_TRACE)) {
+ MatchSetUnref(bp->local_ms);
}
- n = (BeamInstr) code_base[MI_NUM_FUNCTIONS];
- for (i = 0; i < n; ++i) {
- code_ptr = code_base[MI_FUNCTIONS+i];
- if ((specified < 2 || mfa[1] == ((Eterm) code_ptr[3])) &&
- (specified < 3 || ((int) mfa[2]) == ((int) code_ptr[4]))) {
- BeamInstr *pc = code_ptr + 5;
-
- num_processed +=
- clear_function_break(m, pc, BREAK_IS_ERL, break_op);
- }
+ if (common & ERTS_BPF_META_TRACE) {
+ MatchSetUnref(bp->meta_ms);
+ }
+ if (common & ERTS_BPF_COUNT) {
+ ASSERT((bp->flags & ERTS_BPF_COUNT_ACTIVE) == 0);
+ bp_count_unref(bp->count);
+ }
+ if (common & ERTS_BPF_TIME_TRACE) {
+ ASSERT((bp->flags & ERTS_BPF_TIME_TRACE_ACTIVE) == 0);
+ bp_time_unref(bp->time);
}
- return num_processed;
-}
-static int clear_function_break(Module *m, BeamInstr *pc, int bif, BeamInstr break_op) {
- BpData *bd;
- Uint ix = 0;
- BeamInstr **code_base = NULL;
+ ASSERT((bp->flags & ~ERTS_BPF_ALL) == 0);
+ return 1;
+}
- if (bif == BREAK_IS_ERL) {
- code_base = (BeamInstr **)m->code;
- ASSERT(code_base);
- ASSERT(code_base <= (BeamInstr **)pc);
- ASSERT((BeamInstr **)pc < code_base + (m->code_length/sizeof(BeamInstr *)));
- } else {
- ASSERT(*pc == (BeamInstr) em_apply_bif);
- ASSERT(m == NULL);
+static void
+bp_meta_unref(BpMetaPid* bmp)
+{
+ if (erts_refc_dectest(&bmp->refc, 0) <= 0) {
+ Free(bmp);
}
+}
- /*
- * Currently no trace support for native code.
- */
- if (erts_is_native_break(pc)) {
- return 0;
+static void
+bp_count_unref(BpCount* bcp)
+{
+ if (erts_refc_dectest(&bcp->refc, 0) <= 0) {
+ Free(bcp);
}
+}
- while ( (bd = is_break(pc, break_op))) {
- /* Remove all breakpoints of this type.
- * There should be only one of each type,
- * but break_op may be 0 which matches any type.
+static void
+bp_time_unref(BpDataTime* bdt)
+{
+ if (erts_refc_dectest(&bdt->refc, 0) <= 0) {
+ Uint i = 0;
+ Uint j = 0;
+ Process *h_p = NULL;
+ bp_data_time_item_t* item = NULL;
+ process_breakpoint_time_t* pbt = NULL;
+
+ /* remove all psd associated with the hash
+ * and then delete the hash.
+ * ... sigh ...
*/
- BeamInstr op;
- BpData ***rs = (BpData ***) (pc - 4);
- BpData **r = NULL;
-
-#ifdef DEBUG
- for (ix = 1; ix < erts_no_schedulers; ++ix) {
- ASSERT((*rs)[ix] == (*rs)[0]);
- }
-#endif
-
- r = &((*rs)[0]);
-
- ASSERT(*r);
- /* Find opcode for this breakpoint */
- if (break_op) {
- op = break_op;
- } else {
- if (bd == (*r)->next) {
- /* First breakpoint in ring */
- op = *pc;
- } else {
- op = bd->prev->orig_instr;
- }
- }
- if (BpSingleton(bd)) {
- ASSERT(*r == bd);
- /* Only one breakpoint to remove */
- if (bif == BREAK_IS_ERL) {
- *pc = bd->orig_instr;
- }
- Free(*rs);
- *rs = NULL;
- } else {
- BpData *bd_prev = bd->prev;
-
- BpSpliceNext(bd, bd_prev);
- ASSERT(BpSingleton(bd));
- if (bd == *r) {
- /* We removed the last breakpoint in the ring */
- *r = bd_prev;
- bd_prev->orig_instr = bd->orig_instr;
- } else if (bd_prev == *r) {
- /* We removed the first breakpoint in the ring */
- if (bif == BREAK_IS_ERL) {
- *pc = bd->orig_instr;
- }
- } else {
- bd_prev->orig_instr = bd->orig_instr;
- }
- }
- if (op == (BeamInstr) BeamOp(op_i_trace_breakpoint) ||
- op == (BeamInstr) BeamOp(op_i_mtrace_breakpoint)) {
-
- BpDataTrace *bdt = (BpDataTrace *) bd;
- MatchSetUnref(bdt->match_spec);
- }
- if (op == (BeamInstr) BeamOp(op_i_time_breakpoint)) {
- BpDataTime *bdt = (BpDataTime *) bd;
- Uint i = 0;
- Uint j = 0;
- Process *h_p = NULL;
- bp_data_time_item_t *item = NULL;
- process_breakpoint_time_t *pbt = NULL;
-
- /* remove all psd associated with the hash
- * and then delete the hash.
- * ... sigh ...
- */
- for( i = 0; i < bdt->n; ++i) {
- if (bdt->hash[i].used) {
- for (j = 0; j < bdt->hash[i].n; ++j) {
- item = &(bdt->hash[i].item[j]);
- if (item->pid != NIL) {
- h_p = process_tab[internal_pid_index(item->pid)];
- if (h_p) {
- pbt = ERTS_PROC_SET_CALL_TIME(h_p, ERTS_PROC_LOCK_MAIN, NULL);
- if (pbt) {
- Free(pbt);
- }
+ for (i = 0; i < bdt->n; ++i) {
+ if (bdt->hash[i].used) {
+ for (j = 0; j < bdt->hash[i].n; ++j) {
+ item = &(bdt->hash[i].item[j]);
+ if (item->pid != NIL) {
+ 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);
+ if (pbt) {
+ Free(pbt);
}
+ erts_smp_proc_unlock(h_p, ERTS_PROC_LOCK_MAIN);
}
}
}
- bp_hash_delete(&(bdt->hash[i]));
}
- Free(bdt->hash);
- bdt->hash = NULL;
- bdt->n = 0;
+ bp_hash_delete(&(bdt->hash[i]));
}
- Free(bd);
- if (bif == BREAK_IS_ERL) {
- ASSERT(((BeamInstr) code_base[MI_NUM_BREAKPOINTS]) > 0);
- --(*(BeamInstr*)&code_base[MI_NUM_BREAKPOINTS]);
- }
- if (*rs) {
- for (ix = 1; ix < erts_no_schedulers; ++ix) {
- (*rs)[ix] = (*rs)[0];
- }
- }
- } /* while bd != NULL */
- return 1;
+ Free(bdt->hash);
+ Free(bdt);
+ }
}
-
-
-/*
-** Searches (linear forward) the breakpoint ring for a specified opcode
-** and returns a pointer to the breakpoint data structure or NULL if
-** not found. If the specified opcode is 0, the last breakpoint is
-** returned. The program counter must point to the first executable
-** (breakpoint) instruction of the function.
-*/
-
-BpData *erts_get_time_break(Process *p, BeamInstr *pc) {
- return get_break(p, pc, (BeamInstr) BeamOp(op_i_time_breakpoint));
+static BpDataTime*
+get_time_break(BeamInstr *pc)
+{
+ GenericBpData* bp = check_break(pc, ERTS_BPF_TIME_TRACE);
+ return bp ? bp->time : 0;
}
-static BpData *get_break(Process *p, BeamInstr *pc, BeamInstr break_op) {
- ASSERT(pc[-5] == (BeamInstr) BeamOp(op_i_func_info_IaaI));
- if (! erts_is_native_break(pc)) {
- BpData **rs = (BpData **) pc[-4];
- BpData *bd = NULL, *ebd = NULL;
-
- if (! rs) {
- return NULL;
- }
-
- bd = ebd = rs[bp_sched2ix_proc(p)];
- ASSERT(bd);
- if (bd->this_instr == break_op) {
- return bd;
- }
-
- bd = bd->next;
- while (bd != ebd) {
- ASSERT(bd);
- if (bd->this_instr == break_op) {
- ASSERT(bd);
- return bd;
- }
- bd = bd->next;
- }
- }
- return NULL;
-}
+static GenericBpData*
+check_break(BeamInstr *pc, Uint break_flags)
+{
+ GenericBp* g = (GenericBp *) pc[-4];
-static BpData *is_break(BeamInstr *pc, BeamInstr break_op) {
- BpData **rs;
- BpData *bd = NULL, *ebd = NULL;
ASSERT(pc[-5] == (BeamInstr) BeamOp(op_i_func_info_IaaI));
-
if (erts_is_native_break(pc)) {
- return NULL;
- }
- rs = (BpData **) pc[-4];
- if (! rs) {
- return NULL;
- }
-
- bd = ebd = rs[erts_bp_sched2ix()];
- ASSERT(bd);
- if ( (break_op == 0) || (bd->this_instr == break_op)) {
- return bd;
+ return 0;
}
-
- bd = bd->next;
- while (bd != ebd) {
- ASSERT(bd);
- if (bd->this_instr == break_op) {
- ASSERT(bd);
- return bd;
+ if (g) {
+ GenericBpData* bp = &g->data[erts_active_bp_ix()];
+ ASSERT((bp->flags & ~ERTS_BPF_ALL) == 0);
+ if (bp->flags & break_flags) {
+ return bp;
}
- bd = bd->next;
}
- return NULL;
+ return 0;
}
diff --git a/erts/emulator/beam/beam_bp.h b/erts/emulator/beam/beam_bp.h
index 167069552f..28aaaa462a 100644
--- a/erts/emulator/beam/beam_bp.h
+++ b/erts/emulator/beam/beam_bp.h
@@ -25,77 +25,6 @@
#include "erl_vm.h"
#include "global.h"
-
-
-/* A couple of gotchas:
- *
- * The breakpoint structure from BeamInstr,
- * In beam_emu where the instruction counter pointer, I (or pc),
- * points to the *current* instruction. At that time, if the instruction
- * is a breakpoint instruction the pc looks like the following,
- *
- * I[-5] | op_i_func_info_IaaI | scheduler specific entries
- * I[-4] | BpData** bpa | --> | BpData * bdas1 | ... | BpData * bdasN |
- * I[-3] | Tagged Module | | |
- * I[-2] | Tagged Function | V V
- * I[-1] | Arity | BpData -> BpData -> BpData -> BpData
- * I[0] | The bp instruction | ^ * the bp wheel * |
- * |------------------------------
- *
- * Common struct to all bp_data_*
- *
- * 1) The type of bp_data structure in the ring is deduced from the
- * orig_instr field of the structure _before_ in the ring, except for
- * the first structure in the ring that has its instruction in
- * pc[0] of the code to execute.
- * This is valid as long as you don't search for the function while it is
- * being executed by something else. Or is in the middle of its rotation for
- * any other reason.
- * A key, the bp beam instruction, is included for this reason.
- *
- * 2) pc[-4][sched_id - 1] points to the _last_ structure in the ring before the
- * breakpoints are being executed.
- *
- * So, as an example, when a breakpointed function starts to execute,
- * the first instruction that is a breakpoint instruction at pc[0] finds
- * its data at ((BpData **) pc[-4][sched_id - 1])->next and has to cast that pointer
- * to the correct bp_data type.
-*/
-
-typedef struct bp_data {
- struct bp_data *next; /* Doubly linked ring pointers */
- struct bp_data *prev; /* -"- */
- BeamInstr orig_instr; /* The original instruction to execute */
- BeamInstr this_instr; /* key */
-} BpData;
-/*
-** All the following bp_data_.. structs must begin the same way
-*/
-
-typedef struct bp_data_trace {
- struct bp_data *next;
- struct bp_data *prev;
- BeamInstr orig_instr;
- BeamInstr this_instr; /* key */
- Binary *match_spec;
- Eterm tracer_pid;
-} BpDataTrace;
-
-typedef struct bp_data_debug {
- struct bp_data *next;
- struct bp_data *prev;
- BeamInstr orig_instr;
- BeamInstr this_instr; /* key */
-} BpDataDebug;
-
-typedef struct bp_data_count { /* Call count */
- struct bp_data *next;
- struct bp_data *prev;
- BeamInstr orig_instr;
- BeamInstr this_instr; /* key */
- erts_smp_atomic_t acount;
-} BpDataCount;
-
typedef struct {
Eterm pid;
Sint count;
@@ -110,13 +39,9 @@ typedef struct {
} bp_time_hash_t;
typedef struct bp_data_time { /* Call time */
- struct bp_data *next;
- struct bp_data *prev;
- BeamInstr orig_instr;
- BeamInstr this_instr; /* key */
- Uint pause;
- Uint n;
- bp_time_hash_t *hash;
+ Uint n;
+ bp_time_hash_t *hash;
+ erts_refc_t refc;
} BpDataTime;
typedef struct {
@@ -126,64 +51,42 @@ typedef struct {
BeamInstr *pc;
} process_breakpoint_time_t; /* used within psd */
-extern erts_smp_spinlock_t erts_bp_lock;
+typedef struct {
+ erts_smp_atomic_t acount;
+ erts_refc_t refc;
+} BpCount;
+
+typedef struct {
+ erts_smp_atomic_t pid;
+ erts_refc_t refc;
+} BpMetaPid;
+
+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 */
+ BpCount* count; /* For call count */
+ BpDataTime* time; /* For time trace */
+} GenericBpData;
+
+#define ERTS_NUM_BP_IX 2
+
+typedef struct generic_bp {
+ BeamInstr orig_instr;
+ GenericBpData data[ERTS_NUM_BP_IX];
+} GenericBp;
#define ERTS_BP_CALL_TIME_SCHEDULE_IN (0)
#define ERTS_BP_CALL_TIME_SCHEDULE_OUT (1)
#define ERTS_BP_CALL_TIME_SCHEDULE_EXITING (2)
-#define ERTS_BP_CALL_TIME_CALL (0)
-#define ERTS_BP_CALL_TIME_RETURN (1)
-#define ERTS_BP_CALL_TIME_TAIL_CALL (2)
-
-#ifdef ERTS_SMP
-#define ErtsSmpBPLock(BDC) erts_smp_spin_lock(&erts_bp_lock)
-#define ErtsSmpBPUnlock(BDC) erts_smp_spin_unlock(&erts_bp_lock)
-#else
-#define ErtsSmpBPLock(BDC)
-#define ErtsSmpBPUnlock(BDC)
-#endif
-
#ifdef ERTS_SMP
#define bp_sched2ix_proc(p) ((p)->scheduler_data->no - 1)
#else
#define bp_sched2ix_proc(p) (0)
#endif
-#define ErtsCountBreak(p, pc,instr_result) \
-do { \
- BpData **bds = (BpData **) (pc)[-4]; \
- BpDataCount *bdc = NULL; \
- Uint ix = bp_sched2ix_proc( (p) ); \
- erts_aint_t count = 0; \
- \
- ASSERT((pc)[-5] == (BeamInstr) BeamOp(op_i_func_info_IaaI)); \
- ASSERT(bds); \
- bdc = (BpDataCount *) bds[ix]; \
- bdc = (BpDataCount *) bdc->next; \
- ASSERT(bdc); \
- bds[ix] = (BpData *) bdc; \
- count = erts_smp_atomic_read_nob(&bdc->acount); \
- if (count >= 0) erts_smp_atomic_inc_nob(&bdc->acount); \
- *(instr_result) = bdc->orig_instr; \
-} while (0)
-
-#define ErtsBreakSkip(p, pc,instr_result) \
-do { \
- BpData **bds = (BpData **) (pc)[-4]; \
- BpData *bd = NULL; \
- Uint ix = bp_sched2ix_proc( (p) ); \
- \
- ASSERT((pc)[-5] == (BeamInstr) BeamOp(op_i_func_info_IaaI)); \
- ASSERT(bds); \
- bd = bds[ix]; \
- ASSERT(bd); \
- bd = bd->next; \
- ASSERT(bd); \
- bds[ix] = bd; \
- *(instr_result) = bd->orig_instr; \
-} while (0)
-
enum erts_break_op{
erts_break_nop = 0, /* Must be false */
erts_break_set = !0, /* Must be true */
@@ -191,7 +94,17 @@ enum erts_break_op{
erts_break_stop
};
+typedef Uint32 ErtsBpIndex;
+typedef struct {
+ BeamInstr* pc;
+ Module* mod;
+} BpFunction;
+
+typedef struct {
+ Uint matched; /* Number matched */
+ BpFunction* matching; /* Matching functions */
+} BpFunctions;
/*
** Function interface exported from beam_bp.c
@@ -199,49 +112,66 @@ enum erts_break_op{
void erts_bp_init(void);
-int erts_set_trace_break(Eterm mfa[3], int specified, Binary *match_spec,
- Eterm tracer_pid);
-int erts_clear_trace_break(Eterm mfa[3], int specified);
-int erts_set_mtrace_break(Eterm mfa[3], int specified, Binary *match_spec,
+void erts_prepare_bp_staging(void);
+void erts_commit_staged_bp(void);
+
+ERTS_GLB_INLINE ErtsBpIndex erts_active_bp_ix(void);
+ERTS_GLB_INLINE ErtsBpIndex erts_staging_bp_ix(void);
+
+void erts_bp_match_functions(BpFunctions* f, Eterm mfa[3], int specified);
+void erts_bp_match_export(BpFunctions* f, Eterm mfa[3], int specified);
+void erts_bp_free_matched_functions(BpFunctions* f);
+
+void erts_install_breakpoints(BpFunctions* f);
+void erts_uninstall_breakpoints(BpFunctions* f);
+void erts_consolidate_bp_data(BpFunctions* f, int local);
+void erts_consolidate_bif_bp_data(void);
+
+void erts_set_trace_break(BpFunctions *f, Binary *match_spec);
+void erts_clear_trace_break(BpFunctions *f);
+
+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);
-int erts_clear_mtrace_break(Eterm mfa[3], int specified);
+void erts_clear_mtrace_break(BpFunctions *f);
void erts_set_mtrace_bif(BeamInstr *pc, Binary *match_spec,
Eterm tracer_pid);
void erts_clear_mtrace_bif(BeamInstr *pc);
-int erts_set_debug_break(Eterm mfa[3], int specified);
-int erts_clear_debug_break(Eterm mfa[3], int specified);
-int erts_set_count_break(Eterm mfa[3], int specified, enum erts_break_op);
-int erts_clear_count_break(Eterm mfa[3], int specified);
+void erts_set_debug_break(BpFunctions *f);
+void erts_clear_debug_break(BpFunctions *f);
+void erts_set_count_break(BpFunctions *f, enum erts_break_op);
+void erts_clear_count_break(BpFunctions *f);
-int erts_clear_break(Eterm mfa[3], int specified);
+
+void erts_clear_all_breaks(BpFunctions* f);
int erts_clear_module_break(Module *modp);
-int erts_clear_function_break(Module *modp, BeamInstr *pc);
+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 erts_bif_mtrace(Process *p, BeamInstr *pc, Eterm *args,
- int local, Eterm *tracer_pid);
-int erts_is_trace_break(BeamInstr *pc, Binary **match_spec_ret,
- Eterm *tracer_pid_ret);
+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);
int erts_is_mtrace_bif(BeamInstr *pc, Binary **match_spec_ret,
Eterm *tracer_pid_ret);
int erts_is_native_break(BeamInstr *pc);
-int erts_is_count_break(BeamInstr *pc, Sint *count_ret);
+int erts_is_count_break(BeamInstr *pc, Uint *count_ret);
int erts_is_time_break(Process *p, BeamInstr *pc, Eterm *call_time);
-void erts_trace_time_break(Process *p, BeamInstr *pc, BpDataTime *bdt, Uint type);
+void erts_trace_time_call(Process* c_p, BeamInstr* pc, BpDataTime* bdt);
+void erts_trace_time_return(Process* c_p, BeamInstr* pc);
void erts_schedule_time_break(Process *p, Uint out);
-int erts_set_time_break(Eterm mfa[3], int specified, enum erts_break_op);
-int erts_clear_time_break(Eterm mfa[3], int specified);
+void erts_set_time_break(BpFunctions *f, enum erts_break_op);
+void erts_clear_time_break(BpFunctions *f);
int erts_is_time_trace_bif(Process *p, BeamInstr *pc, Eterm *call_time);
void erts_set_time_trace_bif(BeamInstr *pc, enum erts_break_op);
void erts_clear_time_trace_bif(BeamInstr *pc);
-BpData *erts_get_time_break(Process *p, BeamInstr *pc);
BeamInstr *erts_find_local_func(Eterm mfa[3]);
@@ -258,6 +188,19 @@ ERTS_GLB_INLINE Uint erts_bp_sched2ix(void)
return 0;
#endif
}
+
+extern erts_smp_atomic32_t erts_active_bp_index;
+extern erts_smp_atomic32_t erts_staging_bp_index;
+
+ERTS_GLB_INLINE ErtsBpIndex erts_active_bp_ix(void)
+{
+ return erts_smp_atomic32_read_nob(&erts_active_bp_index);
+}
+
+ERTS_GLB_INLINE ErtsBpIndex erts_staging_bp_ix(void)
+{
+ return erts_smp_atomic32_read_nob(&erts_staging_bp_index);
+}
#endif
#endif /* _BEAM_BP_H */
diff --git a/erts/emulator/beam/beam_catches.c b/erts/emulator/beam/beam_catches.c
index 406ef1db5f..92f7ffe5a2 100644
--- a/erts/emulator/beam/beam_catches.c
+++ b/erts/emulator/beam/beam_catches.c
@@ -31,78 +31,144 @@ typedef struct {
unsigned cdr;
} beam_catch_t;
-static int free_list;
-static unsigned high_mark;
-static unsigned tabsize;
-static beam_catch_t *beam_catches;
+#ifdef DEBUG
+# define IF_DEBUG(x) x
+#else
+# define IF_DEBUG(x)
+#endif
+
+struct bc_pool {
+ int free_list;
+ unsigned high_mark;
+ unsigned tabsize;
+ beam_catch_t *beam_catches;
+ /*
+ * Note that the 'beam_catches' area is shared by pools. Used slots
+ * are readonly as long as the module is not purgable. The free-list is
+ * protected by the code_ix lock.
+ */
+
+ IF_DEBUG(int is_staging;)
+};
+
+static struct bc_pool bccix[ERTS_NUM_CODE_IX];
void beam_catches_init(void)
{
- tabsize = DEFAULT_TABSIZE;
- free_list = -1;
- high_mark = 0;
+ int i;
+
+ bccix[0].tabsize = DEFAULT_TABSIZE;
+ bccix[0].free_list = -1;
+ bccix[0].high_mark = 0;
+ bccix[0].beam_catches = erts_alloc(ERTS_ALC_T_CODE,
+ sizeof(beam_catch_t)*DEFAULT_TABSIZE);
+ IF_DEBUG(bccix[0].is_staging = 0);
+ for (i=1; i<ERTS_NUM_CODE_IX; i++) {
+ bccix[i] = bccix[i-1];
+ }
+ /* For initial load: */
+ IF_DEBUG(bccix[erts_staging_code_ix()].is_staging = 1);
+}
- beam_catches = erts_alloc(ERTS_ALC_T_CODE, sizeof(beam_catch_t)*DEFAULT_TABSIZE);
+
+static void gc_old_vec(beam_catch_t* vec)
+{
+ int i;
+ for (i=0; i<ERTS_NUM_CODE_IX; i++) {
+ if (bccix[i].beam_catches == vec) {
+ return;
+ }
+ }
+ erts_free(ERTS_ALC_T_CODE, vec);
+}
+
+
+void beam_catches_start_staging(void)
+{
+ ErtsCodeIndex dst = erts_staging_code_ix();
+ ErtsCodeIndex src = erts_active_code_ix();
+ beam_catch_t* prev_vec = bccix[dst].beam_catches;
+
+ ASSERT(!bccix[src].is_staging && !bccix[dst].is_staging);
+
+ bccix[dst] = bccix[src];
+ gc_old_vec(prev_vec);
+ IF_DEBUG(bccix[dst].is_staging = 1);
+}
+
+void beam_catches_end_staging(int commit)
+{
+ IF_DEBUG(bccix[erts_staging_code_ix()].is_staging = 0);
}
unsigned beam_catches_cons(BeamInstr *cp, unsigned cdr)
{
int i;
+ struct bc_pool* p = &bccix[erts_staging_code_ix()];
+ ASSERT(p->is_staging);
/*
* Allocate from free_list while it is non-empty.
* If free_list is empty, allocate at high_mark.
- *
- * This avoids the need to initialise the free list in
- * beam_catches_init(), which would cost O(TABSIZ) time.
*/
- if( free_list >= 0 ) {
- i = free_list;
- free_list = beam_catches[i].cdr;
- } else if( high_mark < tabsize ) {
- i = high_mark;
- high_mark++;
- } else {
- /* No free slots and table is full: realloc table */
- tabsize = 2*tabsize;
- beam_catches = erts_realloc(ERTS_ALC_T_CODE, beam_catches, sizeof(beam_catch_t)*tabsize);
- i = high_mark;
- high_mark++;
+ if (p->free_list >= 0) {
+ i = p->free_list;
+ p->free_list = p->beam_catches[i].cdr;
+ }
+ else {
+ if (p->high_mark >= p->tabsize) {
+ /* No free slots and table is full: realloc table */
+ beam_catch_t* prev_vec = p->beam_catches;
+ unsigned newsize = p->tabsize*2;
+
+ p->beam_catches = erts_alloc(ERTS_ALC_T_CODE,
+ newsize*sizeof(beam_catch_t));
+ sys_memcpy(p->beam_catches, prev_vec,
+ p->tabsize*sizeof(beam_catch_t));
+ gc_old_vec(prev_vec);
+ p->tabsize = newsize;
+ }
+ i = p->high_mark++;
}
- beam_catches[i].cp = cp;
- beam_catches[i].cdr = cdr;
+ p->beam_catches[i].cp = cp;
+ p->beam_catches[i].cdr = cdr;
return i;
}
BeamInstr *beam_catches_car(unsigned i)
{
- if( i >= tabsize ) {
+ struct bc_pool* p = &bccix[erts_active_code_ix()];
+
+ if (i >= p->tabsize ) {
erl_exit(1, "beam_catches_delmod: index %#x is out of range\r\n", i);
}
- return beam_catches[i].cp;
+ return p->beam_catches[i].cp;
}
-void beam_catches_delmod(unsigned head, BeamInstr *code, unsigned code_bytes)
+void beam_catches_delmod(unsigned head, BeamInstr *code, unsigned code_bytes,
+ ErtsCodeIndex code_ix)
{
+ struct bc_pool* p = &bccix[code_ix];
unsigned i, cdr;
+ ASSERT((code_ix == erts_active_code_ix()) != bccix[erts_staging_code_ix()].is_staging);
for(i = head; i != (unsigned)-1;) {
- if( i >= tabsize ) {
+ if (i >= p->tabsize) {
erl_exit(1, "beam_catches_delmod: index %#x is out of range\r\n", i);
}
- if( (char*)beam_catches[i].cp - (char*)code >= code_bytes ) {
+ if( (char*)p->beam_catches[i].cp - (char*)code >= code_bytes ) {
erl_exit(1,
"beam_catches_delmod: item %#x has cp %#lx which is not "
"in module's range [%#lx,%#lx[\r\n",
- i, (long)beam_catches[i].cp,
+ i, (long)p->beam_catches[i].cp,
(long)code, (long)((char*)code + code_bytes));
}
- beam_catches[i].cp = 0;
- cdr = beam_catches[i].cdr;
- beam_catches[i].cdr = free_list;
- free_list = i;
+ p->beam_catches[i].cp = 0;
+ cdr = p->beam_catches[i].cdr;
+ p->beam_catches[i].cdr = p->free_list;
+ p->free_list = i;
i = cdr;
}
}
diff --git a/erts/emulator/beam/beam_catches.h b/erts/emulator/beam/beam_catches.h
index 6223427f0d..b2bd2351a5 100644
--- a/erts/emulator/beam/beam_catches.h
+++ b/erts/emulator/beam/beam_catches.h
@@ -20,12 +20,21 @@
#ifndef __BEAM_CATCHES_H
#define __BEAM_CATCHES_H
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "sys.h"
+#include "code_ix.h"
+
#define BEAM_CATCHES_NIL (-1)
void beam_catches_init(void);
+void beam_catches_start_staging(void);
+void beam_catches_end_staging(int commit);
unsigned beam_catches_cons(BeamInstr* cp, unsigned cdr);
BeamInstr *beam_catches_car(unsigned i);
-void beam_catches_delmod(unsigned head, BeamInstr* code, unsigned code_bytes);
+void beam_catches_delmod(unsigned head, BeamInstr* code, unsigned code_bytes,
+ ErtsCodeIndex);
#define catch_pc(x) beam_catches_car(catch_val((x)))
diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c
index 8041c92162..a609ed8c71 100644
--- a/erts/emulator/beam/beam_debug.c
+++ b/erts/emulator/beam/beam_debug.c
@@ -84,6 +84,7 @@ erts_debug_breakpoint_2(BIF_ALIST_2)
int i;
int specified = 0;
Eterm res;
+ BpFunctions f;
if (bool != am_true && bool != am_false)
goto error;
@@ -114,18 +115,30 @@ erts_debug_breakpoint_2(BIF_ALIST_2)
mfa[2] = signed_val(mfa[2]);
}
+ if (!erts_try_seize_code_write_permission(BIF_P)) {
+ ERTS_BIF_YIELD2(bif_export[BIF_erts_debug_breakpoint_2],
+ BIF_P, BIF_ARG_1, BIF_ARG_2);
+ }
erts_smp_proc_unlock(p, ERTS_PROC_LOCK_MAIN);
erts_smp_thr_progress_block();
+ erts_bp_match_functions(&f, mfa, specified);
if (bool == am_true) {
- res = make_small(erts_set_debug_break(mfa, specified));
+ erts_set_debug_break(&f);
+ erts_install_breakpoints(&f);
+ erts_commit_staged_bp();
} else {
- res = make_small(erts_clear_debug_break(mfa, specified));
+ erts_clear_debug_break(&f);
+ erts_commit_staged_bp();
+ erts_uninstall_breakpoints(&f);
}
+ erts_consolidate_bp_data(&f, 1);
+ res = make_small(f.matched);
+ erts_bp_free_matched_functions(&f);
erts_smp_thr_progress_unblock();
erts_smp_proc_lock(p, ERTS_PROC_LOCK_MAIN);
-
+ erts_release_code_write_permission();
return res;
error:
@@ -207,6 +220,7 @@ erts_debug_disassemble_1(BIF_ALIST_1)
BIF_RET(am_false);
}
} else if (is_tuple(addr)) {
+ ErtsCodeIndex code_ix;
Module* modp;
Eterm mod;
Eterm name;
@@ -225,14 +239,14 @@ erts_debug_disassemble_1(BIF_ALIST_1)
goto error;
}
arity = signed_val(tp[3]);
- modp = erts_get_module(mod);
+ code_ix = erts_active_code_ix();
+ modp = erts_get_module(mod, code_ix);
/*
* Try the export entry first to allow disassembly of special functions
* such as erts_debug:apply/4. Then search for it in the module.
*/
-
- if ((ep = erts_find_function(mod, name, arity)) != NULL) {
+ if ((ep = erts_find_function(mod, name, arity, code_ix)) != NULL) {
/* XXX: add "&& ep->address != ep->code+3" condition?
* Consider a traced function.
* Its ep will have ep->address == ep->code+3.
@@ -241,9 +255,9 @@ erts_debug_disassemble_1(BIF_ALIST_1)
* But this code_ptr will point to the start of the Export,
* not the function's func_info instruction. BOOM !?
*/
- code_ptr = ((BeamInstr *) ep->address) - 5;
+ code_ptr = ((BeamInstr *) ep->addressv[code_ix]) - 5;
funcinfo = code_ptr+2;
- } else if (modp == NULL || (code_base = modp->code) == NULL) {
+ } else if (modp == NULL || (code_base = modp->curr.code) == NULL) {
BIF_RET(am_undef);
} else {
n = code_base[MI_NUM_FUNCTIONS];
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index c65b2be106..7b1ae624ce 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -26,7 +26,6 @@
#include "erl_vm.h"
#include "global.h"
#include "erl_process.h"
-#include "erl_nmgc.h"
#include "error.h"
#include "bif.h"
#include "big.h"
@@ -41,6 +40,7 @@
#include "hipe_mode_switch.h"
#include "hipe_bif1.h"
#endif
+#include "dtrace-wrapper.h"
/* #define HARDDEBUG 1 */
@@ -63,11 +63,7 @@
# define PROCESS_MAIN_CHK_LOCKS(P) \
do { \
if ((P)) { \
- erts_pix_lock_t *pix_lock__ = ERTS_PIX2PIXLOCK(internal_pid_index((P)->id));\
erts_proc_lc_chk_only_proc_main((P)); \
- erts_pix_lock(pix_lock__); \
- ASSERT(0 < (P)->lock.refc && (P)->lock.refc < erts_no_schedulers*5);\
- erts_pix_unlock(pix_lock__); \
} \
else \
erts_lc_check_exact(NULL, 0); \
@@ -221,7 +217,6 @@ BeamInstr beam_continue_exit[1];
BeamInstr* em_call_error_handler;
BeamInstr* em_apply_bif;
-BeamInstr* em_call_traced_function;
/* NOTE These should be the only variables containing trace instructions.
@@ -236,11 +231,6 @@ BeamInstr beam_return_time_trace[1]; /* OpCode(i_return_time_trace) */
/*
- * We should warn only once for tuple funs.
- */
-static erts_smp_atomic_t warned_for_tuple_funs;
-
-/*
* All Beam instructions in numerical order.
*/
@@ -252,20 +242,6 @@ void** beam_ops;
extern int count_instructions;
#endif
-#if defined(HYBRID)
-#define SWAPIN \
- g_htop = global_htop; \
- g_hend = global_hend; \
- HTOP = HEAP_TOP(c_p); \
- E = c_p->stop
-
-#define SWAPOUT \
- global_htop = g_htop; \
- global_hend = g_hend; \
- HEAP_TOP(c_p) = HTOP; \
- c_p->stop = E
-
-#else
#define SWAPIN \
HTOP = HEAP_TOP(c_p); \
E = c_p->stop
@@ -293,8 +269,6 @@ extern int count_instructions;
#define LIGHT_SWAPIN HTOP = HEAP_TOP(c_p)
-#endif
-
#ifdef FORCE_HEAP_FRAGS
# define HEAP_SPACE_VERIFIED(Words) do { \
c_p->space_verified = (Words); \
@@ -456,36 +430,6 @@ extern int count_instructions;
CHECK_TERM(r(0)); \
} while (0)
-#ifdef HYBRID
-#ifdef INCREMENTAL
-#define TestGlobalHeap(Nh, Live, hp) \
- do { \
- unsigned need = (Nh); \
- ASSERT(global_heap <= g_htop && g_htop <= global_hend); \
- SWAPOUT; \
- reg[0] = r(0); \
- FCALLS -= need; \
- (hp) = IncAlloc(c_p,need,reg,(Live)); \
- r(0) = reg[0]; \
- SWAPIN; \
- } while (0)
-#else
-#define TestGlobalHeap(Nh, Live, hp) \
- do { \
- unsigned need = (Nh); \
- ASSERT(global_heap <= g_htop && g_htop <= global_hend); \
- if (g_hend - g_htop < need) { \
- SWAPOUT; \
- reg[0] = r(0); \
- FCALLS -= erts_global_garbage_collect(c_p, need, reg, (Live)); \
- r(0) = reg[0]; \
- SWAPIN; \
- } \
- (hp) = global_htop; \
- } while (0)
-#endif
-#endif /* HYBRID */
-
#define Init(N) make_blank(yb(N))
#define Init2(Y1, Y2) do { make_blank(Y1); make_blank(Y2); } while (0)
@@ -541,7 +485,7 @@ extern int count_instructions;
do { \
if (FCALLS > 0) { \
Eterm* dis_next; \
- SET_I(((Export *) Arg(0))->address); \
+ SET_I(((Export *) Arg(0))->addressv[erts_active_code_ix()]); \
dis_next = (Eterm *) *I; \
FCALLS--; \
CHECK_ARGS(I); \
@@ -550,7 +494,7 @@ extern int count_instructions;
&& FCALLS > neg_o_reds) { \
goto save_calls1; \
} else { \
- SET_I(((Export *) Arg(0))->address); \
+ SET_I(((Export *) Arg(0))->addressv[erts_active_code_ix()]); \
CHECK_ARGS(I); \
goto context_switch; \
} \
@@ -1011,17 +955,9 @@ static void save_stacktrace(Process* c_p, BeamInstr* pc, Eterm* reg,
static struct StackTrace * get_trace_from_exc(Eterm exc);
static Eterm make_arglist(Process* c_p, Eterm* reg, int a);
-#if defined(VXWORKS)
-static int init_done;
-#endif
-
void
init_emulator(void)
{
-#if defined(VXWORKS)
- init_done = 0;
-#endif
- erts_smp_atomic_init_nob(&warned_for_tuple_funs, (erts_aint_t) 0);
process_main();
}
@@ -1050,6 +986,101 @@ init_emulator(void)
# define REG_tmp_arg2
#endif
+#ifdef USE_VM_PROBES
+# define USE_VM_CALL_PROBES
+#endif
+
+#ifdef USE_VM_CALL_PROBES
+
+#define DTRACE_LOCAL_CALL(p, m, f, a) \
+ if (DTRACE_ENABLED(local_function_entry)) { \
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE); \
+ DTRACE_CHARBUF(mfa, DTRACE_TERM_BUF_SIZE); \
+ int depth = STACK_START(p) - STACK_TOP(p); \
+ dtrace_fun_decode(p, m, f, a, \
+ process_name, mfa); \
+ DTRACE3(local_function_entry, process_name, mfa, depth); \
+ }
+
+#define DTRACE_GLOBAL_CALL(p, m, f, a) \
+ if (DTRACE_ENABLED(global_function_entry)) { \
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE); \
+ DTRACE_CHARBUF(mfa, DTRACE_TERM_BUF_SIZE); \
+ int depth = STACK_START(p) - STACK_TOP(p); \
+ dtrace_fun_decode(p, m, f, a, \
+ process_name, mfa); \
+ DTRACE3(global_function_entry, process_name, mfa, depth); \
+ }
+
+#define DTRACE_RETURN(p, m, f, a) \
+ if (DTRACE_ENABLED(function_return)) { \
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE); \
+ DTRACE_CHARBUF(mfa, DTRACE_TERM_BUF_SIZE); \
+ int depth = STACK_START(p) - STACK_TOP(p); \
+ dtrace_fun_decode(p, m, f, a, \
+ process_name, mfa); \
+ DTRACE3(function_return, process_name, mfa, depth); \
+ }
+
+#define DTRACE_BIF_ENTRY(p, m, f, a) \
+ if (DTRACE_ENABLED(bif_entry)) { \
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE); \
+ DTRACE_CHARBUF(mfa, DTRACE_TERM_BUF_SIZE); \
+ dtrace_fun_decode(p, m, f, a, \
+ process_name, mfa); \
+ DTRACE2(bif_entry, process_name, mfa); \
+ }
+
+#define DTRACE_BIF_RETURN(p, m, f, a) \
+ if (DTRACE_ENABLED(bif_return)) { \
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE); \
+ DTRACE_CHARBUF(mfa, DTRACE_TERM_BUF_SIZE); \
+ dtrace_fun_decode(p, m, f, a, \
+ process_name, mfa); \
+ DTRACE2(bif_return, process_name, mfa); \
+ }
+
+#define DTRACE_NIF_ENTRY(p, m, f, a) \
+ if (DTRACE_ENABLED(nif_entry)) { \
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE); \
+ DTRACE_CHARBUF(mfa, DTRACE_TERM_BUF_SIZE); \
+ dtrace_fun_decode(p, m, f, a, \
+ process_name, mfa); \
+ DTRACE2(nif_entry, process_name, mfa); \
+ }
+
+#define DTRACE_NIF_RETURN(p, m, f, a) \
+ if (DTRACE_ENABLED(nif_return)) { \
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE); \
+ DTRACE_CHARBUF(mfa, DTRACE_TERM_BUF_SIZE); \
+ dtrace_fun_decode(p, m, f, a, \
+ process_name, mfa); \
+ DTRACE2(nif_return, process_name, mfa); \
+ }
+
+#else /* USE_VM_PROBES */
+
+#define DTRACE_LOCAL_CALL(p, m, f, a) do {} while (0)
+#define DTRACE_GLOBAL_CALL(p, m, f, a) do {} while (0)
+#define DTRACE_RETURN(p, m, f, a) do {} while (0)
+#define DTRACE_BIF_ENTRY(p, m, f, a) do {} while (0)
+#define DTRACE_BIF_RETURN(p, m, f, a) do {} while (0)
+#define DTRACE_NIF_ENTRY(p, m, f, a) do {} while (0)
+#define DTRACE_NIF_RETURN(p, m, f, a) do {} while (0)
+
+#endif /* USE_VM_PROBES */
+
+#ifdef USE_VM_PROBES
+void
+dtrace_drvport_str(ErlDrvPort drvport, char *port_buf)
+{
+ Port *port = erts_drvport2port(drvport);
+
+ erts_snprintf(port_buf, DTRACE_TERM_BUF_SIZE, "#Port<%lu.%lu>",
+ port_channel_no(port->id),
+ port_number(port->id));
+}
+#endif
/*
* process_main() is called twice:
* The first call performs some initialisation, including exporting
@@ -1058,9 +1089,7 @@ init_emulator(void)
*/
void process_main(void)
{
-#if !defined(VXWORKS)
static int init_done = 0;
-#endif
Process* c_p = NULL;
int reds_used;
#ifdef DEBUG
@@ -1082,12 +1111,6 @@ void process_main(void)
*/
register Eterm* HTOP REG_htop = NULL;
-
-#ifdef HYBRID
- Eterm *g_htop;
- Eterm *g_hend;
-#endif
-
/* Stack pointer. Grows downwards; points
* to last item pushed (normally a saved
* continuation pointer).
@@ -1221,6 +1244,30 @@ void process_main(void)
#endif
SWAPIN;
ASSERT(VALID_INSTR(next));
+
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(process_scheduled)) {
+ DTRACE_CHARBUF(process_buf, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(fun_buf, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(c_p, process_buf);
+
+ if (ERTS_PROC_IS_EXITING(c_p)) {
+ strcpy(fun_buf, "<exiting>");
+ } else {
+ BeamInstr *fptr = find_function_from_pc(c_p->i);
+ if (fptr) {
+ dtrace_fun_decode(c_p, (Eterm)fptr[0],
+ (Eterm)fptr[1], (Uint)fptr[2],
+ NULL, fun_buf);
+ } else {
+ erts_snprintf(fun_buf, sizeof(fun_buf),
+ "<unknown/%p>", next);
+ }
+ }
+
+ DTRACE2(process_scheduled, process_buf, fun_buf);
+ }
+#endif
Goto(next);
}
@@ -1397,6 +1444,7 @@ void process_main(void)
/* FALL THROUGH */
OpCase(i_call_only_f): {
SET_I((BeamInstr *) Arg(0));
+ DTRACE_LOCAL_CALL(c_p, (Eterm)I[-3], (Eterm)I[-2], I[-1]);
Dispatch();
}
@@ -1408,6 +1456,7 @@ void process_main(void)
RESTORE_CP(E);
E = ADD_BYTE_OFFSET(E, Arg(1));
SET_I((BeamInstr *) Arg(0));
+ DTRACE_LOCAL_CALL(c_p, (Eterm)I[-3], (Eterm)I[-2], I[-1]);
Dispatch();
}
@@ -1419,6 +1468,7 @@ void process_main(void)
OpCase(i_call_f): {
SET_CP(c_p, I+2);
SET_I((BeamInstr *) Arg(0));
+ DTRACE_LOCAL_CALL(c_p, (Eterm)I[-3], (Eterm)I[-2], I[-1]);
Dispatch();
}
@@ -1435,6 +1485,12 @@ void process_main(void)
* is not loaded, it points to code which will invoke the error handler
* (see lb_call_error_handler below).
*/
+#ifdef USE_VM_CALL_PROBES
+ if (DTRACE_ENABLED(global_function_entry)) {
+ BeamInstr* fp = (BeamInstr *) (((Export *) Arg(0))->addressv[erts_active_code_ix()]);
+ DTRACE_GLOBAL_CALL(c_p, (Eterm)fp[-3], (Eterm)fp[-2], fp[-1]);
+ }
+#endif
Dispatchx();
OpCase(i_move_call_ext_cre): {
@@ -1444,6 +1500,12 @@ void process_main(void)
/* FALL THROUGH */
OpCase(i_call_ext_e):
SET_CP(c_p, I+2);
+#ifdef USE_VM_CALL_PROBES
+ if (DTRACE_ENABLED(global_function_entry)) {
+ BeamInstr* fp = (BeamInstr *) (((Export *) Arg(0))->addressv[erts_active_code_ix()]);
+ DTRACE_GLOBAL_CALL(c_p, (Eterm)fp[-3], (Eterm)fp[-2], fp[-1]);
+ }
+#endif
Dispatchx();
OpCase(i_move_call_ext_only_ecr): {
@@ -1451,6 +1513,12 @@ void process_main(void)
}
/* FALL THROUGH */
OpCase(i_call_ext_only_e):
+#ifdef USE_VM_CALL_PROBES
+ if (DTRACE_ENABLED(global_function_entry)) {
+ BeamInstr* fp = (BeamInstr *) (((Export *) Arg(0))->addressv[erts_active_code_ix()]);
+ DTRACE_GLOBAL_CALL(c_p, (Eterm)fp[-3], (Eterm)fp[-2], fp[-1]);
+ }
+#endif
Dispatchx();
OpCase(init_y): {
@@ -1486,7 +1554,16 @@ void process_main(void)
OpCase(return): {
+#ifdef USE_VM_CALL_PROBES
+ BeamInstr* fptr;
+#endif
SET_I(c_p->cp);
+
+#ifdef USE_VM_CALL_PROBES
+ if (DTRACE_ENABLED(function_return) && (fptr = find_function_from_pc(c_p->cp))) {
+ DTRACE_RETURN(c_p, (Eterm)fptr[0], (Eterm)fptr[1], (Uint)fptr[2]);
+ }
+#endif
/*
* We must clear the CP to make sure that a stale value do not
* create a false module dependcy preventing code upgrading.
@@ -1729,13 +1806,12 @@ void process_main(void)
msgp = PEEK_MESSAGE(c_p);
if (msgp)
erts_smp_proc_unlock(c_p, ERTS_PROC_LOCKS_MSG_RECEIVE);
- else {
+ else
#endif
+ {
SET_I((BeamInstr *) Arg(0));
Goto(*I); /* Jump to a wait or wait_timeout instruction */
-#ifdef ERTS_SMP
}
-#endif
}
ErtsMoveMsgAttachmentIntoProc(msgp, c_p, E, HTOP, FCALLS,
{
@@ -1755,6 +1831,7 @@ void process_main(void)
* remove it...
*/
ASSERT(!msgp->data.attached);
+ /* TODO: Add DTrace probe for this bad message situation? */
UNLINK_MESSAGE(c_p, msgp);
free_message(msgp);
goto loop_rec__;
@@ -1780,24 +1857,88 @@ void process_main(void)
save_calls(c_p, &exp_receive);
}
if (ERL_MESSAGE_TOKEN(msgp) == NIL) {
- SEQ_TRACE_TOKEN(c_p) = NIL;
+#ifdef USE_VM_PROBES
+ if (DT_UTAG(c_p) != NIL) {
+ if (DT_UTAG_FLAGS(c_p) & DT_UTAG_PERMANENT) {
+ SEQ_TRACE_TOKEN(c_p) = am_have_dt_utag;
+#ifdef DTRACE_TAG_HARDDEBUG
+ if (DT_UTAG_FLAGS(c_p) & DT_UTAG_SPREADING)
+ erts_fprintf(stderr,
+ "Dtrace -> (%T) stop spreading "
+ "tag %T with message %T\r\n",
+ c_p->id,DT_UTAG(c_p),ERL_MESSAGE_TERM(msgp));
+#endif
+ } else {
+#ifdef DTRACE_TAG_HARDDEBUG
+ erts_fprintf(stderr,
+ "Dtrace -> (%T) kill tag %T with "
+ "message %T\r\n",
+ c_p->id,DT_UTAG(c_p),ERL_MESSAGE_TERM(msgp));
+#endif
+ DT_UTAG(c_p) = NIL;
+ SEQ_TRACE_TOKEN(c_p) = NIL;
+ }
+ } else {
+#endif
+ SEQ_TRACE_TOKEN(c_p) = NIL;
+#ifdef USE_VM_PROBES
+ }
+ DT_UTAG_FLAGS(c_p) &= ~DT_UTAG_SPREADING;
+#endif
} else if (ERL_MESSAGE_TOKEN(msgp) != am_undefined) {
Eterm msg;
SEQ_TRACE_TOKEN(c_p) = ERL_MESSAGE_TOKEN(msgp);
- ASSERT(is_tuple(SEQ_TRACE_TOKEN(c_p)));
- ASSERT(SEQ_TRACE_TOKEN_ARITY(c_p) == 5);
- ASSERT(is_small(SEQ_TRACE_TOKEN_SERIAL(c_p)));
- ASSERT(is_small(SEQ_TRACE_TOKEN_LASTCNT(c_p)));
- ASSERT(is_small(SEQ_TRACE_TOKEN_FLAGS(c_p)));
- ASSERT(is_pid(SEQ_TRACE_TOKEN_SENDER(c_p)));
- c_p->seq_trace_lastcnt = unsigned_val(SEQ_TRACE_TOKEN_SERIAL(c_p));
- if (c_p->seq_trace_clock < unsigned_val(SEQ_TRACE_TOKEN_SERIAL(c_p))) {
- c_p->seq_trace_clock = unsigned_val(SEQ_TRACE_TOKEN_SERIAL(c_p));
+#ifdef USE_VM_PROBES
+ if (ERL_MESSAGE_TOKEN(msgp) == am_have_dt_utag) {
+ if (DT_UTAG(c_p) == NIL) {
+ DT_UTAG(c_p) = ERL_MESSAGE_DT_UTAG(msgp);
+ }
+ DT_UTAG_FLAGS(c_p) |= DT_UTAG_SPREADING;
+#ifdef DTRACE_TAG_HARDDEBUG
+ erts_fprintf(stderr,
+ "Dtrace -> (%T) receive tag (%T) "
+ "with message %T\r\n",
+ c_p->id, DT_UTAG(c_p), ERL_MESSAGE_TERM(msgp));
+#endif
+ } else {
+#endif
+ ASSERT(is_tuple(SEQ_TRACE_TOKEN(c_p)));
+ ASSERT(SEQ_TRACE_TOKEN_ARITY(c_p) == 5);
+ ASSERT(is_small(SEQ_TRACE_TOKEN_SERIAL(c_p)));
+ ASSERT(is_small(SEQ_TRACE_TOKEN_LASTCNT(c_p)));
+ ASSERT(is_small(SEQ_TRACE_TOKEN_FLAGS(c_p)));
+ ASSERT(is_pid(SEQ_TRACE_TOKEN_SENDER(c_p)));
+ c_p->seq_trace_lastcnt = unsigned_val(SEQ_TRACE_TOKEN_SERIAL(c_p));
+ if (c_p->seq_trace_clock < unsigned_val(SEQ_TRACE_TOKEN_SERIAL(c_p))) {
+ c_p->seq_trace_clock = unsigned_val(SEQ_TRACE_TOKEN_SERIAL(c_p));
+ }
+ msg = ERL_MESSAGE_TERM(msgp);
+ seq_trace_output(SEQ_TRACE_TOKEN(c_p), msg, SEQ_TRACE_RECEIVE,
+ c_p->id, c_p);
+#ifdef USE_VM_PROBES
}
- msg = ERL_MESSAGE_TERM(msgp);
- seq_trace_output(SEQ_TRACE_TOKEN(c_p), msg, SEQ_TRACE_RECEIVE,
- c_p->id, c_p);
+#endif
}
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(message_receive)) {
+ Eterm token2 = NIL;
+ DTRACE_CHARBUF(receiver_name, DTRACE_TERM_BUF_SIZE);
+ Sint tok_label = 0;
+ Sint tok_lastcnt = 0;
+ Sint tok_serial = 0;
+
+ dtrace_proc_str(c_p, receiver_name);
+ token2 = SEQ_TRACE_TOKEN(c_p);
+ if (token2 != NIL && token2 != am_have_dt_utag) {
+ tok_label = signed_val(SEQ_TRACE_T_LABEL(token2));
+ tok_lastcnt = signed_val(SEQ_TRACE_T_LASTCNT(token2));
+ tok_serial = signed_val(SEQ_TRACE_T_SERIAL(token2));
+ }
+ DTRACE6(message_receive,
+ receiver_name, size_object(ERL_MESSAGE_TERM(msgp)),
+ c_p->msg.len - 1, tok_label, tok_lastcnt, tok_serial);
+ }
+#endif
UNLINK_MESSAGE(c_p, msgp);
JOIN_MESSAGE(c_p);
CANCEL_TIMER(c_p);
@@ -1899,11 +2040,11 @@ void process_main(void)
OpCase(wait_f):
wait2: {
- ASSERT(!ERTS_PROC_IS_EXITING(c_p));
c_p->i = (BeamInstr *) Arg(0); /* L1 */
SWAPOUT;
c_p->arity = 0;
- c_p->status = P_WAITING;
+ erts_smp_atomic32_read_band_relb(&c_p->state, ~ERTS_PSFLG_ACTIVE);
+ ASSERT(!ERTS_PROC_IS_EXITING(c_p));
erts_smp_proc_unlock(c_p, ERTS_PROC_LOCKS_MSG_RECEIVE);
c_p->current = NULL;
goto do_schedule;
@@ -2982,10 +3123,6 @@ void process_main(void)
c_p->arg_reg[0] = r(0);
SWAPOUT;
c_p->i = I;
- erts_smp_proc_lock(c_p, ERTS_PROC_LOCK_STATUS);
- if (c_p->status != P_SUSPENDED)
- erts_add_to_runq(c_p);
- erts_smp_proc_unlock(c_p, ERTS_PROC_LOCK_STATUS);
goto do_schedule1;
}
@@ -3157,6 +3294,7 @@ void process_main(void)
*/
BifFunction vbf;
+ DTRACE_NIF_ENTRY(c_p, (Eterm)I[-3], (Eterm)I[-2], (Uint)I[-1]);
c_p->current = I-3; /* current and vbf set to please handle_error */
SWAPOUT;
c_p->fcalls = FCALLS - 1;
@@ -3178,6 +3316,8 @@ void process_main(void)
ASSERT(!ERTS_PROC_IS_EXITING(c_p) || is_non_value(nif_bif_result));
PROCESS_MAIN_CHK_LOCKS(c_p);
ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p);
+
+ DTRACE_NIF_RETURN(c_p, (Eterm)I[-3], (Eterm)I[-2], (Uint)I[-1]);
goto apply_bif_or_nif_epilogue;
OpCase(apply_bif):
@@ -3197,6 +3337,8 @@ void process_main(void)
c_p->arity = 0; /* To allow garbage collection on ourselves
* (check_process_code/2).
*/
+ DTRACE_BIF_ENTRY(c_p, (Eterm)I[-3], (Eterm)I[-2], (Uint)I[-1]);
+
SWAPOUT;
c_p->fcalls = FCALLS - 1;
vbf = (BifFunction) Arg(0);
@@ -3216,6 +3358,8 @@ void process_main(void)
PROCESS_MAIN_CHK_LOCKS(c_p);
}
+ DTRACE_BIF_RETURN(c_p, (Eterm)I[-3], (Eterm)I[-2], (Uint)I[-1]);
+
apply_bif_or_nif_epilogue:
ERTS_SMP_REQ_PROC_MAIN_LOCK(c_p);
ERTS_HOLE_CHECK(c_p);
@@ -4411,64 +4555,6 @@ void process_main(void)
* Trace and debugging support.
*/
- /*
- * At this point, I points to the code[3] in the export entry for
- * a trace-enabled function.
- *
- * code[0]: Module
- * code[1]: Function
- * code[2]: Arity
- * code[3]: &&call_traced_function
- * code[4]: Address of function.
- */
- OpCase(call_traced_function): {
- if (IS_TRACED_FL(c_p, F_TRACE_CALLS)) {
- unsigned offset = offsetof(Export, code) + 3*sizeof(BeamInstr);
- Export* ep = (Export *) (((char *)I)-offset);
- Uint32 flags;
-
- SWAPOUT;
- reg[0] = r(0);
- PROCESS_MAIN_CHK_LOCKS(c_p);
- ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p);
- flags = erts_call_trace(c_p, ep->code, ep->match_prog_set, reg,
- 0, &c_p->tracer_proc);
- ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p);
- ERTS_SMP_REQ_PROC_MAIN_LOCK(c_p);
- PROCESS_MAIN_CHK_LOCKS(c_p);
- ASSERT(!ERTS_PROC_IS_EXITING(c_p));
- SWAPIN;
-
- if (flags & MATCH_SET_RX_TRACE) {
- ASSERT(c_p->htop <= E && E <= c_p->hend);
- if (E - 3 < HTOP) {
- /* SWAPOUT, SWAPIN was done and r(0) was saved above */
- PROCESS_MAIN_CHK_LOCKS(c_p);
- FCALLS -= erts_garbage_collect(c_p, 3, reg, ep->code[2]);
- ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p);
- PROCESS_MAIN_CHK_LOCKS(c_p);
- r(0) = reg[0];
- SWAPIN;
- }
- E -= 3;
- ASSERT(c_p->htop <= E && E <= c_p->hend);
- ASSERT(is_CP((BeamInstr)(ep->code)));
- ASSERT(is_internal_pid(c_p->tracer_proc) ||
- is_internal_port(c_p->tracer_proc));
- E[2] = make_cp(c_p->cp); /* Code in lower range on halfword */
- E[1] = am_true; /* Process tracer */
- E[0] = make_cp(ep->code);
- c_p->cp = (flags & MATCH_SET_EXCEPTION_TRACE)
- ? beam_exception_trace : beam_return_trace;
- erts_smp_proc_lock(c_p, ERTS_PROC_LOCKS_ALL_MINOR);
- c_p->trace_flags |= F_EXCEPTION_TRACE;
- erts_smp_proc_unlock(c_p, ERTS_PROC_LOCKS_ALL_MINOR);
- }
- }
- SET_I((BeamInstr *)Arg(0));
- Dispatch();
- }
-
OpCase(return_trace): {
BeamInstr* code = (BeamInstr *) (UWord) E[0];
@@ -4483,80 +4569,22 @@ void process_main(void)
Goto(*I);
}
- OpCase(i_count_breakpoint): {
+ OpCase(i_generic_breakpoint): {
BeamInstr real_I;
-
- ErtsCountBreak(c_p, (BeamInstr *) I, &real_I);
+ ASSERT(I[-5] == (BeamInstr) BeamOp(op_i_func_info_IaaI));
+ SWAPOUT;
+ reg[0] = r(0);
+ real_I = erts_generic_breakpoint(c_p, I, reg);
+ r(0) = reg[0];
+ SWAPIN;
ASSERT(VALID_INSTR(real_I));
Goto(real_I);
}
- /* need to send mfa instead of bdt pointer
- * the pointer might be deallocated.
- */
-
- OpCase(i_time_breakpoint): {
- BeamInstr real_I;
- BpData **bds = (BpData **) (I)[-4];
- BpDataTime *bdt = NULL;
- Uint ix = 0;
-#ifdef ERTS_SMP
- ix = c_p->scheduler_data->no - 1;
-#else
- ix = 0;
-#endif
- bdt = (BpDataTime *)bds[ix];
-
- ASSERT((I)[-5] == (BeamInstr) BeamOp(op_i_func_info_IaaI));
- ASSERT(bdt);
- bdt = (BpDataTime *) bdt->next;
- ASSERT(bdt);
- bds[ix] = (BpData *) bdt;
- real_I = bdt->orig_instr;
- ASSERT(VALID_INSTR(real_I));
-
- if (IS_TRACED_FL(c_p, F_TRACE_CALLS) && !(bdt->pause)) {
- if ( (*(c_p->cp) == (BeamInstr) OpCode(i_return_time_trace)) ||
- (*(c_p->cp) == (BeamInstr) OpCode(return_trace)) ||
- (*(c_p->cp) == (BeamInstr) OpCode(i_return_to_trace))) {
- /* This _IS_ a tail recursive call */
- SWAPOUT;
- erts_trace_time_break(c_p, I, bdt, ERTS_BP_CALL_TIME_TAIL_CALL);
- SWAPIN;
- } else {
- SWAPOUT;
- erts_trace_time_break(c_p, I, bdt, ERTS_BP_CALL_TIME_CALL);
-
- /* r register needs to be copied to the array
- * for the garbage collector
- */
- ASSERT(c_p->htop <= E && E <= c_p->hend);
- if (E - 2 < HTOP) {
- reg[0] = r(0);
- PROCESS_MAIN_CHK_LOCKS(c_p);
- FCALLS -= erts_garbage_collect(c_p, 2, reg, I[-1]);
- ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p);
- PROCESS_MAIN_CHK_LOCKS(c_p);
- r(0) = reg[0];
- }
- SWAPIN;
-
- ASSERT(c_p->htop <= E && E <= c_p->hend);
-
- E -= 2;
- E[0] = make_cp(I);
- E[1] = make_cp(c_p->cp); /* original return address */
- c_p->cp = beam_return_time_trace;
- }
- }
-
- Goto(real_I);
- }
-
OpCase(i_return_time_trace): {
BeamInstr *pc = (BeamInstr *) (UWord) E[0];
SWAPOUT;
- erts_trace_time_break(c_p, pc, NULL, ERTS_BP_CALL_TIME_RETURN);
+ erts_trace_time_return(c_p, pc);
SWAPIN;
c_p->cp = NULL;
SET_I((BeamInstr *) cp_val(E[1]));
@@ -4564,114 +4592,6 @@ void process_main(void)
Goto(*I);
}
- OpCase(i_trace_breakpoint):
- if (! IS_TRACED_FL(c_p, F_TRACE_CALLS)) {
- BeamInstr real_I;
-
- ErtsBreakSkip(c_p, (BeamInstr *) I, &real_I);
- Goto(real_I);
- }
- /* Fall through to next case */
- OpCase(i_mtrace_breakpoint): {
- BeamInstr real_I;
- Uint32 flags;
- Eterm tracer_pid;
- Uint* cpp;
- int return_to_trace = 0, need = 0;
- flags = 0;
- SWAPOUT;
- reg[0] = r(0);
-
- if (*(c_p->cp) == (BeamInstr) OpCode(return_trace)) {
- cpp = &E[2];
- } else if (*(c_p->cp) == (BeamInstr) OpCode(i_return_to_trace)) {
- return_to_trace = !0;
- cpp = &E[0];
- } else if (*(c_p->cp) == (BeamInstr) OpCode(i_return_time_trace)) {
- return_to_trace = !0;
- cpp = &E[0];
- } else {
- cpp = NULL;
- }
- if (cpp) {
- /* This _IS_ a tail recursive call, if there are
- * return_trace and/or i_return_to_trace stackframes
- * on the stack, they are not intermixed with y registers
- */
- BeamInstr *cp_save = c_p->cp;
- for (;;) {
- ASSERT(is_CP(*cpp));
- if (*cp_val(*cpp) == (BeamInstr) OpCode(return_trace)) {
- cpp += 3;
- } else if (*cp_val(*cpp) == (BeamInstr) OpCode(i_return_to_trace)) {
- return_to_trace = !0;
- cpp += 1;
- } else if (*cp_val(*cpp) == (BeamInstr) OpCode(i_return_time_trace)) {
- cpp += 2;
- } else
- break;
- }
- c_p->cp = (BeamInstr *) cp_val(*cpp);
- ASSERT(is_CP(*cpp));
- ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p);
- real_I = erts_trace_break(c_p, I, reg, &flags, &tracer_pid);
- ERTS_SMP_REQ_PROC_MAIN_LOCK(c_p);
- SWAPIN; /* Needed by shared heap. */
- c_p->cp = cp_save;
- } else {
- ERTS_SMP_UNREQ_PROC_MAIN_LOCK(c_p);
- real_I = erts_trace_break(c_p, I, reg, &flags, &tracer_pid);
- ERTS_SMP_REQ_PROC_MAIN_LOCK(c_p);
- SWAPIN; /* Needed by shared heap. */
- }
-
- ASSERT(!ERTS_PROC_IS_EXITING(c_p));
-
- if ((flags & MATCH_SET_RETURN_TO_TRACE) && !return_to_trace) {
- need += 1;
- }
- if (flags & MATCH_SET_RX_TRACE) {
- need += 3;
- }
- if (need) {
- ASSERT(c_p->htop <= E && E <= c_p->hend);
- if (E - need < HTOP) {
- /* SWAPOUT was done and r(0) was saved above */
- PROCESS_MAIN_CHK_LOCKS(c_p);
- FCALLS -= erts_garbage_collect(c_p, need, reg, I[-1]);
- ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p);
- PROCESS_MAIN_CHK_LOCKS(c_p);
- r(0) = reg[0];
- SWAPIN;
- }
- }
- if ((flags & MATCH_SET_RETURN_TO_TRACE) && !return_to_trace) {
- E -= 1;
- ASSERT(c_p->htop <= E && E <= c_p->hend);
- E[0] = make_cp(c_p->cp);
- c_p->cp = (BeamInstr *) beam_return_to_trace;
- }
- if (flags & MATCH_SET_RX_TRACE) {
- E -= 3;
- 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));
- E[2] = make_cp(c_p->cp);
- E[1] = tracer_pid;
- E[0] = make_cp(I - 3); /* We ARE at the beginning of an
- instruction,
- the funcinfo is above i. */
- c_p->cp =
- (flags & MATCH_SET_EXCEPTION_TRACE)
- ? beam_exception_trace : beam_return_trace;
- erts_smp_proc_lock(c_p, ERTS_PROC_LOCKS_ALL_MINOR);
- c_p->trace_flags |= F_EXCEPTION_TRACE;
- erts_smp_proc_unlock(c_p, ERTS_PROC_LOCKS_ALL_MINOR);
- }
- Goto(real_I);
- }
-
OpCase(i_return_to_trace): {
if (IS_TRACED_FL(c_p, F_TRACE_RETURN_TO)) {
Uint *cpp = (Uint*) E;
@@ -4941,9 +4861,6 @@ void process_main(void)
c_p->arity = 1; /* One living register (the 'true' return value) */
SWAPOUT;
c_p->i = I + 1; /* Next instruction */
- erts_smp_proc_lock(c_p, ERTS_PROC_LOCK_STATUS);
- erts_add_to_runq(c_p);
- erts_smp_proc_unlock(c_p, ERTS_PROC_LOCK_STATUS);
c_p->current = NULL;
goto do_schedule;
}
@@ -5024,7 +4941,6 @@ void process_main(void)
#endif /* NO_JUMP_TABLE */
em_call_error_handler = OpCode(call_error_handler);
- em_call_traced_function = OpCode(call_traced_function);
em_apply_bif = OpCode(apply_bif);
beam_apply[0] = (BeamInstr) OpCode(i_apply);
@@ -5065,7 +4981,7 @@ void process_main(void)
save_calls(c_p, (Export *) Arg(0));
- SET_I(((Export *) Arg(0))->address);
+ SET_I(((Export *) Arg(0))->addressv[erts_active_code_ix()]);
dis_next = (Eterm *) *I;
FCALLS--;
@@ -5742,7 +5658,8 @@ call_error_handler(Process* p, BeamInstr* fi, Eterm* reg, Eterm func)
/*
* Search for the error_handler module.
*/
- ep = erts_find_function(erts_proc_get_error_handler(p), func, 3);
+ ep = erts_find_function(erts_proc_get_error_handler(p), func, 3,
+ erts_active_code_ix());
if (ep == NULL) { /* No error handler */
p->current = fi;
p->freason = EXC_UNDEF;
@@ -5772,7 +5689,7 @@ call_error_handler(Process* p, BeamInstr* fi, Eterm* reg, Eterm func)
reg[0] = fi[0];
reg[1] = fi[1];
reg[2] = args;
- return ep->address;
+ return ep->addressv[erts_active_code_ix()];
}
@@ -5786,7 +5703,7 @@ apply_setup_error_handler(Process* p, Eterm module, Eterm function, Uint arity,
* there is no error handler module.
*/
- if ((ep = erts_find_export_entry(erts_proc_get_error_handler(p),
+ if ((ep = erts_active_export_entry(erts_proc_get_error_handler(p),
am_undefined_function, 3)) == NULL) {
return NULL;
} else {
@@ -5893,13 +5810,19 @@ apply(Process* p, Eterm module, Eterm function, Eterm args, Eterm* reg)
* Note: All BIFs have export entries; thus, no special case is needed.
*/
- if ((ep = erts_find_export_entry(module, function, arity)) == NULL) {
+ if ((ep = erts_active_export_entry(module, function, arity)) == NULL) {
if ((ep = apply_setup_error_handler(p, module, function, arity, reg)) == NULL) goto error;
} else if (ERTS_PROC_GET_SAVED_CALLS_BUF(p)) {
save_calls(p, ep);
}
- return ep->address;
+#ifdef USE_VM_CALL_PROBES
+ if (DTRACE_ENABLED(global_function_entry)) {
+ BeamInstr *fptr = (BeamInstr *) ep->addressv[erts_active_code_ix()];
+ DTRACE_GLOBAL_CALL(p, (Eterm)fptr[-3], (Eterm)fptr[-2], (Uint)fptr[-1]);
+ }
+#endif
+ return ep->addressv[erts_active_code_ix()];
}
static BeamInstr*
@@ -5941,14 +5864,20 @@ fixed_apply(Process* p, Eterm* reg, Uint arity)
* Note: All BIFs have export entries; thus, no special case is needed.
*/
- if ((ep = erts_find_export_entry(module, function, arity)) == NULL) {
+ if ((ep = erts_active_export_entry(module, function, arity)) == NULL) {
if ((ep = apply_setup_error_handler(p, module, function, arity, reg)) == NULL)
goto error;
} else if (ERTS_PROC_GET_SAVED_CALLS_BUF(p)) {
save_calls(p, ep);
}
- return ep->address;
+#ifdef USE_VM_CALL_PROBES
+ if (DTRACE_ENABLED(global_function_entry)) {
+ BeamInstr *fptr = (BeamInstr *) ep->addressv[erts_active_code_ix()];
+ DTRACE_GLOBAL_CALL(p, (Eterm)fptr[-3], (Eterm)fptr[-2], (Uint)fptr[-1]);
+ }
+#endif
+ return ep->addressv[erts_active_code_ix()];
}
int
@@ -5997,6 +5926,15 @@ erts_hibernate(Process* c_p, Eterm module, Eterm function, Eterm args, Eterm* re
c_p->max_arg_reg = sizeof(c_p->def_arg_reg)/sizeof(c_p->def_arg_reg[0]);
}
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(process_hibernate)) {
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(mfa, DTRACE_TERM_BUF_SIZE);
+ dtrace_fun_decode(c_p, module, function, arity,
+ process_name, mfa);
+ DTRACE2(process_hibernate, process_name, mfa);
+ }
+#endif
/*
* Arrange for the process to be resumed at the given MFA with
* the stack cleared.
@@ -6016,9 +5954,7 @@ erts_hibernate(Process* c_p, Eterm module, Eterm function, Eterm args, Eterm* re
*/
erts_smp_proc_lock(c_p, ERTS_PROC_LOCK_MSGQ|ERTS_PROC_LOCK_STATUS);
ERTS_SMP_MSGQ_MV_INQ2PRIVQ(c_p);
- if (c_p->msg.len > 0) {
- erts_add_to_runq(c_p);
- } else {
+ if (!c_p->msg.len) {
erts_smp_proc_unlock(c_p, ERTS_PROC_LOCK_MSGQ|ERTS_PROC_LOCK_STATUS);
c_p->fvalue = NIL;
PROCESS_MAIN_CHK_LOCKS(c_p);
@@ -6026,14 +5962,12 @@ erts_hibernate(Process* c_p, Eterm module, Eterm function, Eterm args, Eterm* re
ERTS_VERIFY_UNUSED_TEMP_ALLOC(c_p);
PROCESS_MAIN_CHK_LOCKS(c_p);
erts_smp_proc_lock(c_p, ERTS_PROC_LOCK_MSGQ|ERTS_PROC_LOCK_STATUS);
- ASSERT(!ERTS_PROC_IS_EXITING(c_p));
#ifdef ERTS_SMP
ERTS_SMP_MSGQ_MV_INQ2PRIVQ(c_p);
- if (c_p->msg.len > 0)
- erts_add_to_runq(c_p);
- else
+ if (!c_p->msg.len)
#endif
- c_p->status = P_WAITING;
+ erts_smp_atomic32_read_band_relb(&c_p->state, ~ERTS_PSFLG_ACTIVE);
+ ASSERT(!ERTS_PROC_IS_EXITING(c_p));
}
erts_smp_proc_unlock(c_p, ERTS_PROC_LOCK_MSGQ|ERTS_PROC_LOCK_STATUS);
c_p->current = bif_export[BIF_hibernate_3]->code;
@@ -6050,7 +5984,6 @@ call_fun(Process* p, /* Current process. */
Eterm fun = reg[arity];
Eterm hdr;
int i;
- Eterm function;
Eterm* hp;
if (!is_boxed(fun)) {
@@ -6072,6 +6005,9 @@ call_fun(Process* p, /* Current process. */
actual_arity = (int) code_ptr[-1];
if (actual_arity == arity+num_free) {
+ DTRACE_LOCAL_CALL(p, (Eterm)code_ptr[-3],
+ (Eterm)code_ptr[-2],
+ code_ptr[-1]);
if (num_free == 0) {
return code_ptr;
} else {
@@ -6089,7 +6025,7 @@ call_fun(Process* p, /* Current process. */
} else {
/*
* Something wrong here. First build a list of the arguments.
- */
+ */
if (is_non_value(args)) {
Uint sz = 2 * arity;
@@ -6118,7 +6054,7 @@ call_fun(Process* p, /* Current process. */
Export* ep;
Module* modp;
Eterm module;
-
+ ErtsCodeIndex code_ix = erts_active_code_ix();
/*
* No arity. There is no module loaded that defines the fun,
@@ -6126,9 +6062,9 @@ call_fun(Process* p, /* Current process. */
* representation (the module has never been loaded),
* or the module defining the fun has been unloaded.
*/
-
module = fe->module;
- if ((modp = erts_get_module(module)) != NULL && modp->code != NULL) {
+ if ((modp = erts_get_module(module, code_ix)) != NULL
+ && modp->curr.code != NULL) {
/*
* There is a module loaded, but obviously the fun is not
* defined in it. We must not call the error_handler
@@ -6143,7 +6079,7 @@ call_fun(Process* p, /* Current process. */
*/
ep = erts_find_function(erts_proc_get_error_handler(p),
- am_undefined_lambda, 3);
+ am_undefined_lambda, 3, code_ix);
if (ep == NULL) { /* No error handler */
p->current = NULL;
p->freason = EXC_UNDEF;
@@ -6153,7 +6089,7 @@ call_fun(Process* p, /* Current process. */
reg[1] = fun;
reg[2] = args;
reg[3] = NIL;
- return ep->address;
+ return ep->addressv[erts_active_code_ix()];
}
}
} else if (is_export_header(hdr)) {
@@ -6164,7 +6100,8 @@ call_fun(Process* p, /* Current process. */
actual_arity = (int) ep->code[2];
if (arity == actual_arity) {
- return ep->address;
+ DTRACE_GLOBAL_CALL(p, ep->code[0], ep->code[1], (Uint)ep->code[2]);
+ return ep->addressv[erts_active_code_ix()];
} else {
/*
* Wrong arity. First build a list of the arguments.
@@ -6184,62 +6121,6 @@ call_fun(Process* p, /* Current process. */
p->fvalue = TUPLE2(hp, fun, args);
return NULL;
}
- } else if (hdr == make_arityval(2)) {
- Eterm* tp;
- Export* ep;
- Eterm module;
-
- tp = tuple_val(fun);
- module = tp[1];
- function = tp[2];
- if (!is_atom(module) || !is_atom(function)) {
- goto badfun;
- }
-
- /*
- * If this is the first time a tuple fun is used,
- * send a warning to the logger.
- */
- if (erts_smp_atomic_xchg_nob(&warned_for_tuple_funs,
- (erts_aint_t) 1) == 0) {
- erts_dsprintf_buf_t* dsbufp;
-
- dsbufp = erts_create_logger_dsbuf();
- erts_dsprintf(dsbufp, "Call to tuple fun {%T,%T}.\n\n"
- "Tuple funs are deprecated and will be removed "
- "in R16. Use \"fun M:F/A\" instead, for example "
- "\"fun %T:%T/%d\".\n\n"
- "(This warning will only be shown the first time "
- "a tuple fun is called.)\n",
- module, function, module, function, arity);
- erts_send_warning_to_logger(p->group_leader, dsbufp);
- }
-
- if ((ep = erts_find_export_entry(module, function, arity)) == NULL) {
- ep = erts_find_export_entry(erts_proc_get_error_handler(p),
- am_undefined_function, 3);
- if (ep == NULL) {
- p->freason = EXC_UNDEF;
- return 0;
- }
- if (is_non_value(args)) {
- Uint sz = 2 * arity;
- if (HeapWordsLeft(p) < sz) {
- erts_garbage_collect(p, sz, reg, arity);
- }
- hp = HEAP_TOP(p);
- HEAP_TOP(p) += sz;
- args = NIL;
- while (arity-- > 0) {
- args = CONS(hp, reg[arity], args);
- hp += 2;
- }
- }
- reg[0] = module;
- reg[1] = function;
- reg[2] = args;
- }
- return ep->address;
} else {
badfun:
p->current = NULL;
@@ -6301,10 +6182,8 @@ new_fun(Process* p, Eterm* reg, ErlFunEntry* fe, int num_free)
hp = funp->env;
erts_refc_inc(&fe->refc, 2);
funp->thing_word = HEADER_FUN;
-#ifndef HYBRID /* FIND ME! */
funp->next = MSO(p).first;
MSO(p).first = (struct erl_off_heap_header*) funp;
-#endif
funp->fe = fe;
funp->num_free = num_free;
funp->creator = p->id;
@@ -6344,7 +6223,8 @@ erts_is_builtin(Eterm Mod, Eterm Name, int arity)
if ((ep = export_get(&e)) == NULL) {
return 0;
}
- return ep->address == ep->code+3 && (ep->code[3] == (BeamInstr) em_apply_bif);
+ return ep->addressv[erts_active_code_ix()] == ep->code+3
+ && (ep->code[3] == (BeamInstr) em_apply_bif);
}
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index dd788df6e4..25ae480dc7 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -352,27 +352,6 @@ typedef struct LoaderState {
int loc_size; /* Size of location info in bytes (2/4) */
} LoaderState;
-/*
- * Layout of the line table.
- */
-
-#define MI_LINE_FNAME_PTR 0
-#define MI_LINE_LOC_TAB 1
-#define MI_LINE_LOC_SIZE 2
-#define MI_LINE_FUNC_TAB 3
-
-#define LINE_INVALID_LOCATION (0)
-
-/*
- * Macros for manipulating locations.
- */
-
-#define IS_VALID_LOCATION(File, Line) \
- ((unsigned) (File) < 255 && (unsigned) (Line) < ((1 << 24) - 1))
-#define MAKE_LOCATION(File, Line) (((File) << 24) | (Line))
-#define LOC_FILE(Loc) ((Loc) >> 24)
-#define LOC_LINE(Loc) ((Loc) & ((1 << 24)-1))
-
#define GetTagAndValue(Stp, Tag, Val) \
do { \
BeamInstr __w; \
@@ -496,7 +475,8 @@ typedef struct LoaderState {
} while (0)
-static void free_state(LoaderState* stp);
+static void free_loader_state(Binary* magic);
+static void loader_state_dtor(Binary* magic);
static Eterm insert_new_code(Process *c_p, ErtsProcLocks c_p_locks,
Eterm group_leader, Eterm module,
BeamInstr* code, Uint size);
@@ -507,6 +487,7 @@ static int verify_chunks(LoaderState* stp);
static int load_atom_table(LoaderState* stp);
static int load_import_table(LoaderState* stp);
static int read_export_table(LoaderState* stp);
+static int is_bif(Eterm mod, Eterm func, unsigned arity);
static int read_lambda_table(LoaderState* stp);
static int read_literal_table(LoaderState* stp);
static int read_line_table(LoaderState* stp);
@@ -548,22 +529,9 @@ static Eterm native_addresses(Process* p, Eterm mod);
int patch_funentries(Eterm Patchlist);
int patch(Eterm Addresses, Uint fe);
static int safe_mul(UWord a, UWord b, UWord* resp);
-static void lookup_loc(FunctionInfo* fi, BeamInstr* pc,
- BeamInstr* modp, int idx);
-
static int must_swap_floats;
-/*
- * The following variables keep a sorted list of address ranges for
- * each module. It allows us to quickly find a function given an
- * instruction pointer.
- */
-Range* modules = NULL; /* Sorted lists of module addresses. */
-int num_loaded_modules; /* Number of loaded modules. */
-int allocated_modules; /* Number of slots allocated. */
-Range* mid_module = NULL; /* Cached search start point */
-
Uint erts_total_code_size;
/**********************************************************************/
@@ -579,11 +547,7 @@ void init_load(void)
f.fd = 1.0;
must_swap_floats = (f.fw[0] == 0);
- allocated_modules = 128;
- modules = (Range *) erts_alloc(ERTS_ALC_T_MODULE_REFS,
- allocated_modules*sizeof(Range));
- mid_module = modules;
- num_loaded_modules = 0;
+ erts_init_ranges();
}
static void
@@ -595,7 +559,7 @@ define_file(LoaderState* stp, char* name, int idx)
}
Eterm
-erts_load_module(Process *c_p,
+erts_preload_module(Process *c_p,
ErtsProcLocks c_p_locks,
Eterm group_leader, /* Group leader or NIL if none. */
Eterm* modp, /*
@@ -605,15 +569,16 @@ erts_load_module(Process *c_p,
byte* code, /* Points to the code to load */
Uint size) /* Size of code to load. */
{
- LoaderState* stp = erts_alloc_loader_state();
+ Binary* magic = erts_alloc_loader_state();
Eterm retval;
- retval = erts_prepare_loading(stp, c_p, group_leader, modp,
+ ASSERT(!erts_initialized);
+ retval = erts_prepare_loading(magic, c_p, group_leader, modp,
code, size);
if (retval != NIL) {
return retval;
}
- return erts_finish_loading(stp, c_p, c_p_locks, modp);
+ return erts_finish_loading(magic, c_p, c_p_locks, modp);
}
/* #define LOAD_MEMORY_HARD_DEBUG 1*/
@@ -629,11 +594,13 @@ extern void check_allocated_block(Uint type, void *blk);
#endif
Eterm
-erts_prepare_loading(LoaderState* stp, Process *c_p, Eterm group_leader,
+erts_prepare_loading(Binary* magic, Process *c_p, Eterm group_leader,
Eterm* modp, byte* code, Uint unloaded_size)
{
Eterm retval = am_badfile;
+ LoaderState* stp;
+ stp = ERTS_MAGIC_BIN_DATA(magic);
stp->module = *modp;
stp->group_leader = group_leader;
@@ -666,7 +633,7 @@ erts_prepare_loading(LoaderState* stp, Process *c_p, Eterm group_leader,
/*
* Initialize code area.
*/
- stp->code_buffer_size = erts_next_heap_size(2048 + stp->num_functions, 0);
+ stp->code_buffer_size = 2048 + stp->num_functions;
stp->code = (BeamInstr *) erts_alloc(ERTS_ALC_T_CODE,
sizeof(BeamInstr) * stp->code_buffer_size);
@@ -679,8 +646,6 @@ erts_prepare_loading(LoaderState* stp, Process *c_p, Eterm group_leader,
stp->code[MI_COMPILE_PTR] = 0;
stp->code[MI_COMPILE_SIZE] = 0;
stp->code[MI_COMPILE_SIZE_ON_HEAP] = 0;
- stp->code[MI_NUM_BREAKPOINTS] = 0;
-
/*
* Read the atom table.
@@ -774,23 +739,24 @@ erts_prepare_loading(LoaderState* stp, Process *c_p, Eterm group_leader,
load_error:
if (retval != NIL) {
- free_state(stp);
+ free_loader_state(magic);
}
return retval;
}
Eterm
-erts_finish_loading(LoaderState* stp, Process* c_p,
+erts_finish_loading(Binary* magic, Process* c_p,
ErtsProcLocks c_p_locks, Eterm* modp)
{
Eterm retval;
+ LoaderState* stp = ERTS_MAGIC_BIN_DATA(magic);
/*
* No other process may run since we will update the export
* table which is not protected by any locks.
*/
- ERTS_SMP_LC_ASSERT(erts_initialized == 0 ||
+ ERTS_SMP_LC_ASSERT(erts_initialized == 0 || erts_is_code_ix_locked() ||
erts_smp_thr_progress_is_blocking());
/*
@@ -811,7 +777,6 @@ erts_finish_loading(LoaderState* stp, Process* c_p,
* exported and imported functions. This can't fail.
*/
- erts_export_consolidate();
CHKBLK(ERTS_ALC_T_CODE,stp->code);
final_touch(stp);
@@ -837,16 +802,20 @@ erts_finish_loading(LoaderState* stp, Process* c_p,
}
load_error:
- free_state(stp);
+ free_loader_state(magic);
return retval;
}
-LoaderState*
+Binary*
erts_alloc_loader_state(void)
{
LoaderState* stp;
+ Binary* magic;
- stp = erts_alloc(ERTS_ALC_T_LOADER_TMP, sizeof(LoaderState));
+ magic = erts_create_magic_binary(sizeof(LoaderState),
+ loader_state_dtor);
+ erts_refc_inc(&magic->refc, 1);
+ stp = ERTS_MAGIC_BIN_DATA(magic);
stp->bin = NULL;
stp->function = THE_NON_VALUE; /* Function not known yet */
stp->arity = 0;
@@ -875,76 +844,123 @@ erts_alloc_loader_state(void)
stp->line_instr = 0;
stp->func_line = 0;
stp->fname = 0;
- return stp;
+ return magic;
+}
+
+/*
+ * Return the module name (a tagged atom) for the prepared code
+ * in the magic binary, or NIL if the binary does not contain
+ * prepared code.
+ */
+Eterm
+erts_module_for_prepared_code(Binary* magic)
+{
+ LoaderState* stp;
+
+ if (ERTS_MAGIC_BIN_DESTRUCTOR(magic) != loader_state_dtor) {
+ return NIL;
+ }
+ stp = ERTS_MAGIC_BIN_DATA(magic);
+ if (stp->code != 0) {
+ return stp->module;
+ } else {
+ return NIL;
+ }
}
static void
-free_state(LoaderState* stp)
+free_loader_state(Binary* magic)
{
+ loader_state_dtor(magic);
+ if (erts_refc_dectest(&magic->refc, 0) == 0) {
+ erts_bin_free(magic);
+ }
+}
+
+/*
+ * This destructor function can safely be called multiple times.
+ */
+static void
+loader_state_dtor(Binary* magic)
+{
+ LoaderState* stp = ERTS_MAGIC_BIN_DATA(magic);
+
if (stp->bin != 0) {
driver_free_binary(stp->bin);
+ stp->bin = 0;
}
if (stp->code != 0) {
erts_free(ERTS_ALC_T_CODE, stp->code);
+ stp->code = 0;
}
- if (stp->labels != NULL) {
- erts_free(ERTS_ALC_T_LOADER_TMP, (void *) stp->labels);
+ if (stp->labels != 0) {
+ erts_free(ERTS_ALC_T_PREPARED_CODE, (void *) stp->labels);
+ stp->labels = 0;
}
- if (stp->atom != NULL) {
- erts_free(ERTS_ALC_T_LOADER_TMP, (void *) stp->atom);
+ if (stp->atom != 0) {
+ erts_free(ERTS_ALC_T_PREPARED_CODE, (void *) stp->atom);
+ stp->atom = 0;
}
- if (stp->import != NULL) {
- erts_free(ERTS_ALC_T_LOADER_TMP, (void *) stp->import);
+ if (stp->import != 0) {
+ erts_free(ERTS_ALC_T_PREPARED_CODE, (void *) stp->import);
+ stp->import = 0;
}
- if (stp->export != NULL) {
- erts_free(ERTS_ALC_T_LOADER_TMP, (void *) stp->export);
+ if (stp->export != 0) {
+ erts_free(ERTS_ALC_T_PREPARED_CODE, (void *) stp->export);
+ stp->export = 0;
}
if (stp->lambdas != stp->def_lambdas) {
- erts_free(ERTS_ALC_T_LOADER_TMP, (void *) stp->lambdas);
+ erts_free(ERTS_ALC_T_PREPARED_CODE, (void *) stp->lambdas);
+ stp->lambdas = stp->def_lambdas;
}
- if (stp->literals != NULL) {
+ if (stp->literals != 0) {
int i;
for (i = 0; i < stp->num_literals; i++) {
- if (stp->literals[i].heap != NULL) {
- erts_free(ERTS_ALC_T_LOADER_TMP,
+ if (stp->literals[i].heap != 0) {
+ erts_free(ERTS_ALC_T_PREPARED_CODE,
(void *) stp->literals[i].heap);
+ stp->literals[i].heap = 0;
}
}
- erts_free(ERTS_ALC_T_LOADER_TMP, (void *) stp->literals);
+ erts_free(ERTS_ALC_T_PREPARED_CODE, (void *) stp->literals);
+ stp->literals = 0;
}
- while (stp->literal_patches != NULL) {
+ while (stp->literal_patches != 0) {
LiteralPatch* next = stp->literal_patches->next;
- erts_free(ERTS_ALC_T_LOADER_TMP, (void *) stp->literal_patches);
+ erts_free(ERTS_ALC_T_PREPARED_CODE, (void *) stp->literal_patches);
stp->literal_patches = next;
}
- while (stp->string_patches != NULL) {
+ while (stp->string_patches != 0) {
StringPatch* next = stp->string_patches->next;
- erts_free(ERTS_ALC_T_LOADER_TMP, (void *) stp->string_patches);
+ erts_free(ERTS_ALC_T_PREPARED_CODE, (void *) stp->string_patches);
stp->string_patches = next;
}
- while (stp->genop_blocks) {
- GenOpBlock* next = stp->genop_blocks->next;
- erts_free(ERTS_ALC_T_LOADER_TMP, (void *) stp->genop_blocks);
- stp->genop_blocks = next;
- }
if (stp->line_item != 0) {
- erts_free(ERTS_ALC_T_LOADER_TMP, stp->line_item);
+ erts_free(ERTS_ALC_T_PREPARED_CODE, stp->line_item);
+ stp->line_item = 0;
}
if (stp->line_instr != 0) {
- erts_free(ERTS_ALC_T_LOADER_TMP, stp->line_instr);
+ erts_free(ERTS_ALC_T_PREPARED_CODE, stp->line_instr);
+ stp->line_instr = 0;
}
if (stp->func_line != 0) {
- erts_free(ERTS_ALC_T_LOADER_TMP, stp->func_line);
+ erts_free(ERTS_ALC_T_PREPARED_CODE, stp->func_line);
+ stp->func_line = 0;
}
if (stp->fname != 0) {
- erts_free(ERTS_ALC_T_LOADER_TMP, stp->fname);
+ erts_free(ERTS_ALC_T_PREPARED_CODE, stp->fname);
+ stp->fname = 0;
}
- erts_free(ERTS_ALC_T_LOADER_TMP, stp);
+ /*
+ * The following data items should have been freed earlier.
+ */
+
+ ASSERT(stp->genop_blocks == 0);
}
static Eterm
@@ -954,7 +970,6 @@ insert_new_code(Process *c_p, ErtsProcLocks c_p_locks,
{
Module* modp;
Eterm retval;
- int i;
if ((retval = beam_make_current_old(c_p, c_p_locks, module)) != NIL) {
erts_dsprintf_buf_t *dsbufp = erts_create_logger_dsbuf();
@@ -971,30 +986,15 @@ insert_new_code(Process *c_p, ErtsProcLocks c_p_locks,
erts_total_code_size += size;
modp = erts_put_module(module);
- modp->code = code;
- modp->code_length = size;
- modp->catches = BEAM_CATCHES_NIL; /* Will be filled in later. */
+ modp->curr.code = code;
+ modp->curr.code_length = size;
+ modp->curr.catches = BEAM_CATCHES_NIL; /* Will be filled in later. */
/*
- * Update address table (used for finding a function from a PC value).
+ * Update ranges (used for finding a function from a PC value).
*/
- if (num_loaded_modules == allocated_modules) {
- allocated_modules *= 2;
- modules = (Range *) erts_realloc(ERTS_ALC_T_MODULE_REFS,
- (void *) modules,
- allocated_modules * sizeof(Range));
- }
- for (i = num_loaded_modules; i > 0; i--) {
- if (code > modules[i-1].start) {
- break;
- }
- modules[i] = modules[i-1];
- }
- modules[i].start = code;
- modules[i].end = (BeamInstr *) (((byte *)code) + size);
- num_loaded_modules++;
- mid_module = &modules[num_loaded_modules/2];
+ erts_update_ranges(code, size);
return NIL;
}
@@ -1217,9 +1217,8 @@ load_atom_table(LoaderState* stp)
GetInt(stp, 4, stp->num_atoms);
stp->num_atoms++;
- stp->atom = erts_alloc(ERTS_ALC_T_LOADER_TMP,
- erts_next_heap_size((stp->num_atoms*sizeof(Eterm)),
- 0));
+ stp->atom = erts_alloc(ERTS_ALC_T_PREPARED_CODE,
+ stp->num_atoms*sizeof(Eterm));
/*
* Read all atoms.
@@ -1263,10 +1262,8 @@ load_import_table(LoaderState* stp)
int i;
GetInt(stp, 4, stp->num_imports);
- stp->import = erts_alloc(ERTS_ALC_T_LOADER_TMP,
- erts_next_heap_size((stp->num_imports *
- sizeof(ImportEntry)),
- 0));
+ stp->import = erts_alloc(ERTS_ALC_T_PREPARED_CODE,
+ stp->num_imports * sizeof(ImportEntry));
for (i = 0; i < stp->num_imports; i++) {
int n;
Eterm mod;
@@ -1296,7 +1293,7 @@ load_import_table(LoaderState* stp)
* If the export entry refers to a BIF, get the pointer to
* the BIF function.
*/
- if ((e = erts_find_export_entry(mod, func, arity)) != NULL) {
+ if ((e = erts_active_export_entry(mod, func, arity)) != NULL) {
if (e->code[3] == (BeamInstr) em_apply_bif) {
stp->import[i].bf = (BifFunction) e->code[4];
if (func == am_load_nif && mod == am_erlang && arity == 2) {
@@ -1315,16 +1312,8 @@ load_import_table(LoaderState* stp)
static int
read_export_table(LoaderState* stp)
{
- static struct {
- Eterm mod;
- Eterm func;
- int arity;
- } allow_redef[] = {
- /* The BIFs that are allowed to be redefined by Erlang code */
- {am_erlang,am_apply,2},
- {am_erlang,am_apply,3},
- };
int i;
+ BeamInstr* address;
GetInt(stp, 4, stp->num_exps);
if (stp->num_exps > stp->num_functions) {
@@ -1332,7 +1321,7 @@ read_export_table(LoaderState* stp)
stp->num_exps, stp->num_functions);
}
stp->export
- = (ExportEntry *) erts_alloc(ERTS_ALC_T_LOADER_TMP,
+ = (ExportEntry *) erts_alloc(ERTS_ALC_T_PREPARED_CODE,
(stp->num_exps * sizeof(ExportEntry)));
for (i = 0; i < stp->num_exps; i++) {
@@ -1340,7 +1329,6 @@ read_export_table(LoaderState* stp)
Uint value;
Eterm func;
Uint arity;
- Export* e;
GetInt(stp, 4, n);
GetAtom(stp, n, func);
@@ -1358,29 +1346,34 @@ read_export_table(LoaderState* stp)
if (value == 0) {
LoadError2(stp, "export table entry %d: label %d not resolved", i, n);
}
- stp->export[i].address = stp->code + value;
+ stp->export[i].address = address = stp->code + value;
/*
- * Check that we are not redefining a BIF (except the ones allowed to
- * redefine).
+ * Find out if there is a BIF with the same name.
*/
- if ((e = erts_find_export_entry(stp->module, func, arity)) != NULL) {
- if (e->code[3] == (BeamInstr) em_apply_bif) {
- int j;
- for (j = 0; j < sizeof(allow_redef)/sizeof(allow_redef[0]); j++) {
- if (stp->module == allow_redef[j].mod &&
- func == allow_redef[j].func &&
- arity == allow_redef[j].arity) {
- break;
- }
- }
- if (j == sizeof(allow_redef)/sizeof(allow_redef[0])) {
- LoadError2(stp, "exported function %T/%d redefines BIF",
- func, arity);
- }
- }
+ if (!is_bif(stp->module, func, arity)) {
+ continue;
+ }
+
+ /*
+ * This is a stub for a BIF.
+ *
+ * It should not be exported, and the information in its
+ * func_info instruction should be invalidated so that it
+ * can be filtered out by module_info(functions) and by
+ * any other functions that walk through all local functions.
+ */
+
+ if (stp->labels[n].patches) {
+ LoadError3(stp, "there are local calls to the stub for "
+ "the BIF %T:%T/%d",
+ stp->module, func, arity);
}
+ stp->export[i].address = NULL;
+ address[-1] = 0;
+ address[-2] = NIL;
+ address[-3] = NIL;
}
return 1;
@@ -1388,15 +1381,39 @@ read_export_table(LoaderState* stp)
return 0;
}
+
+static int
+is_bif(Eterm mod, Eterm func, unsigned arity)
+{
+ Export* e = erts_active_export_entry(mod, func, arity);
+ if (e == NULL) {
+ return 0;
+ }
+ if (e->code[3] != (BeamInstr) em_apply_bif) {
+ return 0;
+ }
+ if (mod == am_erlang && func == am_apply && arity == 3) {
+ /*
+ * erlang:apply/3 is a special case -- it is implemented
+ * as an instruction and it is OK to redefine it.
+ */
+ return 0;
+ }
+ return 1;
+}
+
static int
read_lambda_table(LoaderState* stp)
{
int i;
GetInt(stp, 4, stp->num_lambdas);
- stp->lambdas_allocated = stp->num_lambdas;
- stp->lambdas = (Lambda *) erts_alloc(ERTS_ALC_T_LOADER_TMP,
- stp->num_lambdas * sizeof(Lambda));
+ if (stp->num_lambdas > stp->lambdas_allocated) {
+ ASSERT(stp->lambdas == stp->def_lambdas);
+ stp->lambdas_allocated = stp->num_lambdas;
+ stp->lambdas = (Lambda *) erts_alloc(ERTS_ALC_T_PREPARED_CODE,
+ stp->num_lambdas * sizeof(Lambda));
+ }
for (i = 0; i < stp->num_lambdas; i++) {
Uint n;
Uint32 Index;
@@ -1446,7 +1463,7 @@ read_literal_table(LoaderState* stp)
stp->file_p = uncompressed;
stp->file_left = (unsigned) uncompressed_sz;
GetInt(stp, 4, stp->num_literals);
- stp->literals = (Literal *) erts_alloc(ERTS_ALC_T_LOADER_TMP,
+ stp->literals = (Literal *) erts_alloc(ERTS_ALC_T_PREPARED_CODE,
stp->num_literals * sizeof(Literal));
stp->allocated_literals = stp->num_literals;
@@ -1466,7 +1483,7 @@ read_literal_table(LoaderState* stp)
if ((heap_size = erts_decode_ext_size(p, sz)) < 0) {
LoadError1(stp, "literal %d: bad external format", i);
}
- hp = stp->literals[i].heap = erts_alloc(ERTS_ALC_T_LOADER_TMP,
+ hp = stp->literals[i].heap = erts_alloc(ERTS_ALC_T_PREPARED_CODE,
heap_size*sizeof(Eterm));
stp->literals[i].off_heap.first = 0;
stp->literals[i].off_heap.overhead = 0;
@@ -1538,7 +1555,7 @@ read_line_table(LoaderState* stp)
*/
num_line_items++;
- lp = (BeamInstr *) erts_alloc(ERTS_ALC_T_LOADER_TMP,
+ lp = (BeamInstr *) erts_alloc(ERTS_ALC_T_PREPARED_CODE,
num_line_items * sizeof(BeamInstr));
stp->line_item = lp;
stp->num_line_items = num_line_items;
@@ -1594,7 +1611,7 @@ read_line_table(LoaderState* stp)
*/
if (stp->num_fnames != 0) {
- stp->fname = (Eterm *) erts_alloc(ERTS_ALC_T_LOADER_TMP,
+ stp->fname = (Eterm *) erts_alloc(ERTS_ALC_T_PREPARED_CODE,
stp->num_fnames *
sizeof(Eterm));
for (i = 0; i < stp->num_fnames; i++) {
@@ -1610,11 +1627,11 @@ read_line_table(LoaderState* stp)
/*
* Allocate the arrays to be filled while code is being loaded.
*/
- stp->line_instr = (LineInstr *) erts_alloc(ERTS_ALC_T_LOADER_TMP,
+ stp->line_instr = (LineInstr *) erts_alloc(ERTS_ALC_T_PREPARED_CODE,
stp->num_line_instrs *
sizeof(LineInstr));
stp->current_li = 0;
- stp->func_line = (int *) erts_alloc(ERTS_ALC_T_LOADER_TMP,
+ stp->func_line = (int *) erts_alloc(ERTS_ALC_T_PREPARED_CODE,
stp->num_functions *
sizeof(int));
@@ -1677,7 +1694,7 @@ read_code_header(LoaderState* stp)
* Initialize label table.
*/
- stp->labels = (Label *) erts_alloc(ERTS_ALC_T_LOADER_TMP,
+ stp->labels = (Label *) erts_alloc(ERTS_ALC_T_PREPARED_CODE,
stp->num_labels * sizeof(Label));
for (i = 0; i < stp->num_labels; i++) {
stp->labels[i].value = 0;
@@ -1703,9 +1720,9 @@ read_code_header(LoaderState* stp)
#define CodeNeed(w) do { \
ASSERT(ci <= code_buffer_size); \
if (code_buffer_size < ci+(w)) { \
- code_buffer_size = erts_next_heap_size(ci+(w), 0); \
- stp->code = code \
- = (BeamInstr *) erts_realloc(ERTS_ALC_T_CODE, \
+ code_buffer_size = 2*ci+(w); \
+ stp->code = code = \
+ (BeamInstr *) erts_realloc(ERTS_ALC_T_CODE, \
(void *) code, \
code_buffer_size * sizeof(BeamInstr)); \
} \
@@ -1731,6 +1748,7 @@ load_code(LoaderState* stp)
GenOp* last_op = NULL;
GenOp** last_op_next = NULL;
int arity;
+ int retval = 1;
/*
* The size of the loaded func_info instruction is needed
@@ -2457,7 +2475,11 @@ load_code(LoaderState* stp)
case op_int_code_end:
stp->code_buffer_size = code_buffer_size;
stp->ci = ci;
- return 1;
+ stp->function = THE_NON_VALUE;
+ stp->genop = NULL;
+ stp->specific_op = -1;
+ retval = 1;
+ goto cleanup;
}
/*
@@ -2471,9 +2493,20 @@ load_code(LoaderState* stp)
}
}
-
load_error:
- return 0;
+ retval = 0;
+
+ cleanup:
+ /*
+ * Clean up everything that is not needed any longer.
+ */
+
+ while (stp->genop_blocks) {
+ GenOpBlock* next = stp->genop_blocks->next;
+ erts_free(ERTS_ALC_T_LOADER_TMP, (void *) stp->genop_blocks);
+ stp->genop_blocks = next;
+ }
+ return retval;
}
@@ -4265,24 +4298,31 @@ final_touch(LoaderState* stp)
index = next;
}
modp = erts_put_module(stp->module);
- modp->catches = catches;
+ modp->curr.catches = catches;
/*
* Export functions.
*/
for (i = 0; i < stp->num_exps; i++) {
- Export* ep = erts_export_put(stp->module, stp->export[i].function,
- stp->export[i].arity);
+ Export* ep;
+ BeamInstr* address = stp->export[i].address;
+
+ if (address == NULL) {
+ /* Skip stub for a BIF */
+ continue;
+ }
+ ep = erts_export_put(stp->module, stp->export[i].function,
+ stp->export[i].arity);
if (!on_load) {
- ep->address = stp->export[i].address;
+ ep->addressv[erts_staging_code_ix()] = address;
} else {
/*
* Don't make any of the exported functions
* callable yet.
*/
- ep->address = ep->code+3;
- ep->code[4] = (BeamInstr) stp->export[i].address;
+ ep->addressv[erts_staging_code_ix()] = ep->code+3;
+ ep->code[4] = (BeamInstr) address;
}
}
@@ -4926,7 +4966,7 @@ new_label(LoaderState* stp)
int num = stp->num_labels;
stp->num_labels++;
- stp->labels = (Label *) erts_realloc(ERTS_ALC_T_LOADER_TMP,
+ stp->labels = (Label *) erts_realloc(ERTS_ALC_T_PREPARED_CODE,
(void *) stp->labels,
stp->num_labels * sizeof(Label));
stp->labels[num].value = 0;
@@ -4937,7 +4977,8 @@ new_label(LoaderState* stp)
static void
new_literal_patch(LoaderState* stp, int pos)
{
- LiteralPatch* p = erts_alloc(ERTS_ALC_T_LOADER_TMP, sizeof(LiteralPatch));
+ LiteralPatch* p = erts_alloc(ERTS_ALC_T_PREPARED_CODE,
+ sizeof(LiteralPatch));
p->pos = pos;
p->next = stp->literal_patches;
stp->literal_patches = p;
@@ -4946,7 +4987,7 @@ new_literal_patch(LoaderState* stp, int pos)
static void
new_string_patch(LoaderState* stp, int pos)
{
- StringPatch* p = erts_alloc(ERTS_ALC_T_LOADER_TMP, sizeof(StringPatch));
+ StringPatch* p = erts_alloc(ERTS_ALC_T_PREPARED_CODE, sizeof(StringPatch));
p->pos = pos;
p->next = stp->string_patches;
stp->string_patches = p;
@@ -4964,14 +5005,14 @@ new_literal(LoaderState* stp, Eterm** hpp, Uint heap_size)
ASSERT(stp->num_literals == 0);
stp->allocated_literals = 8;
need = stp->allocated_literals * sizeof(Literal);
- stp->literals = (Literal *) erts_alloc(ERTS_ALC_T_LOADER_TMP,
+ stp->literals = (Literal *) erts_alloc(ERTS_ALC_T_PREPARED_CODE,
need);
} else if (stp->allocated_literals <= stp->num_literals) {
Uint need;
stp->allocated_literals *= 2;
need = stp->allocated_literals * sizeof(Literal);
- stp->literals = (Literal *) erts_realloc(ERTS_ALC_T_LOADER_TMP,
+ stp->literals = (Literal *) erts_realloc(ERTS_ALC_T_PREPARED_CODE,
(void *) stp->literals,
need);
}
@@ -4980,7 +5021,7 @@ new_literal(LoaderState* stp, Eterm** hpp, Uint heap_size)
lit = stp->literals + stp->num_literals;
lit->offset = 0;
lit->heap_size = heap_size;
- lit->heap = erts_alloc(ERTS_ALC_T_LOADER_TMP, heap_size*sizeof(Eterm));
+ lit->heap = erts_alloc(ERTS_ALC_T_PREPARED_CODE, heap_size*sizeof(Eterm));
lit->term = make_boxed(lit->heap);
lit->off_heap.first = 0;
lit->off_heap.overhead = 0;
@@ -4999,7 +5040,7 @@ erts_module_info_0(Process* p, Eterm module)
return THE_NON_VALUE;
}
- if (erts_get_module(module) == NULL) {
+ if (erts_get_module(module, erts_active_code_ix()) == NULL) {
return THE_NON_VALUE;
}
@@ -5054,32 +5095,43 @@ functions_in_module(Process* p, /* Process whose heap to use. */
BeamInstr* code;
int i;
Uint num_functions;
+ Uint need;
Eterm* hp;
+ Eterm* hp_end;
Eterm result = NIL;
if (is_not_atom(mod)) {
return THE_NON_VALUE;
}
- modp = erts_get_module(mod);
+ modp = erts_get_module(mod, erts_active_code_ix());
if (modp == NULL) {
return THE_NON_VALUE;
}
- code = modp->code;
+ code = modp->curr.code;
num_functions = code[MI_NUM_FUNCTIONS];
- hp = HAlloc(p, 5*num_functions);
+ need = 5*num_functions;
+ hp = HAlloc(p, need);
+ hp_end = hp + need;
for (i = num_functions-1; i >= 0 ; i--) {
BeamInstr* func_info = (BeamInstr *) code[MI_FUNCTIONS+i];
Eterm name = (Eterm) func_info[3];
int arity = (int) func_info[4];
Eterm tuple;
- ASSERT(is_atom(name));
- tuple = TUPLE2(hp, name, make_small(arity));
- hp += 3;
- result = CONS(hp, tuple, result);
- hp += 2;
+ /*
+ * If the function name is [], this entry is a stub for
+ * a BIF that should be ignored.
+ */
+ ASSERT(is_atom(name) || is_nil(name));
+ if (is_atom(name)) {
+ tuple = TUPLE2(hp, name, make_small(arity));
+ hp += 3;
+ result = CONS(hp, tuple, result);
+ hp += 2;
+ }
}
+ HRelease(p, hp_end, hp);
return result;
}
@@ -5106,12 +5158,12 @@ native_addresses(Process* p, Eterm mod)
return THE_NON_VALUE;
}
- modp = erts_get_module(mod);
+ modp = erts_get_module(mod, erts_active_code_ix());
if (modp == NULL) {
return THE_NON_VALUE;
}
- code = modp->code;
+ code = modp->curr.code;
num_functions = code[MI_NUM_FUNCTIONS];
need = (6+BIG_UINT_HEAP_SIZE)*num_functions;
hp = HAlloc(p, need);
@@ -5122,9 +5174,11 @@ native_addresses(Process* p, Eterm mod)
int arity = (int) func_info[4];
Eterm tuple;
- ASSERT(is_atom(name));
+ ASSERT(is_atom(name) || is_nil(name)); /* [] if BIF stub */
if (func_info[1] != 0) {
- Eterm addr = erts_bld_uint(&hp, NULL, func_info[1]);
+ Eterm addr;
+ ASSERT(is_atom(name));
+ addr = erts_bld_uint(&hp, NULL, func_info[1]);
tuple = erts_bld_tuple(&hp, NULL, 3, name, make_small(arity), addr);
result = erts_bld_cons(&hp, NULL, tuple, result);
}
@@ -5149,18 +5203,20 @@ exported_from_module(Process* p, /* Process whose heap to use. */
Eterm* hp = NULL;
Eterm* hend = NULL;
Eterm result = NIL;
+ ErtsCodeIndex code_ix;
if (is_not_atom(mod)) {
return THE_NON_VALUE;
}
- for (i = 0; i < export_list_size(); i++) {
- Export* ep = export_list(i);
+ code_ix = erts_active_code_ix();
+ for (i = 0; i < export_list_size(code_ix); i++) {
+ Export* ep = export_list(i,code_ix);
if (ep->code[0] == mod) {
Eterm tuple;
- if (ep->address == ep->code+3 &&
+ if (ep->addressv[code_ix] == ep->code+3 &&
ep->code[3] == (BeamInstr) em_call_error_handler) {
/* There is a call to the function, but it does not exist. */
continue;
@@ -5204,11 +5260,11 @@ attributes_for_module(Process* p, /* Process whose heap to use. */
return THE_NON_VALUE;
}
- modp = erts_get_module(mod);
+ modp = erts_get_module(mod, erts_active_code_ix());
if (modp == NULL) {
return THE_NON_VALUE;
}
- code = modp->code;
+ code = modp->curr.code;
ext = (byte *) code[MI_ATTR_PTR];
if (ext != NULL) {
hp = HAlloc(p, code[MI_ATTR_SIZE_ON_HEAP]);
@@ -5244,11 +5300,11 @@ compilation_info_for_module(Process* p, /* Process whose heap to use. */
return THE_NON_VALUE;
}
- modp = erts_get_module(mod);
+ modp = erts_get_module(mod, erts_active_code_ix());
if (modp == NULL) {
return THE_NON_VALUE;
}
- code = modp->code;
+ code = modp->curr.code;
ext = (byte *) code[MI_COMPILE_PTR];
if (ext != NULL) {
hp = HAlloc(p, code[MI_COMPILE_SIZE_ON_HEAP]);
@@ -5263,113 +5319,6 @@ compilation_info_for_module(Process* p, /* Process whose heap to use. */
}
/*
- * Find a function from the given pc and fill information in
- * the FunctionInfo struct. If the full_info is non-zero, fill
- * in all available information (including location in the
- * source code). If no function is found, the 'current' field
- * will be set to NULL.
- */
-
-void
-erts_lookup_function_info(FunctionInfo* fi, BeamInstr* pc, int full_info)
-{
- Range* low = modules;
- Range* high = low + num_loaded_modules;
- Range* mid = mid_module;
-
- fi->current = NULL;
- fi->needed = 5;
- fi->loc = LINE_INVALID_LOCATION;
- while (low < high) {
- if (pc < mid->start) {
- high = mid;
- } else if (pc > mid->end) {
- low = mid + 1;
- } else {
- BeamInstr** low1 = (BeamInstr **) (mid->start + MI_FUNCTIONS);
- BeamInstr** high1 = low1 + mid->start[MI_NUM_FUNCTIONS];
- BeamInstr** mid1;
-
- while (low1 < high1) {
- mid1 = low1 + (high1-low1) / 2;
- if (pc < mid1[0]) {
- high1 = mid1;
- } else if (pc < mid1[1]) {
- mid_module = mid;
- fi->current = mid1[0]+2;
- if (full_info) {
- BeamInstr** fp = (BeamInstr **) (mid->start +
- MI_FUNCTIONS);
- int idx = mid1 - fp;
- lookup_loc(fi, pc, mid->start, idx);
- }
- return;
- } else {
- low1 = mid1 + 1;
- }
- }
- return;
- }
- mid = low + (high-low) / 2;
- }
-}
-
-static void
-lookup_loc(FunctionInfo* fi, BeamInstr* orig_pc, BeamInstr* modp, int idx)
-{
- Eterm* line = (Eterm *) modp[MI_LINE_TABLE];
- Eterm* low;
- Eterm* high;
- Eterm* mid;
- Eterm pc;
-
- if (line == 0) {
- return;
- }
-
- pc = (Eterm) (BeamInstr) orig_pc;
- fi->fname_ptr = (Eterm *) (BeamInstr) line[MI_LINE_FNAME_PTR];
- low = (Eterm *) (BeamInstr) line[MI_LINE_FUNC_TAB+idx];
- high = (Eterm *) (BeamInstr) line[MI_LINE_FUNC_TAB+idx+1];
- while (high > low) {
- mid = low + (high-low) / 2;
- if (pc < mid[0]) {
- high = mid;
- } else if (pc < mid[1]) {
- int file;
- int index = mid - (Eterm *) (BeamInstr) line[MI_LINE_FUNC_TAB];
-
- if (line[MI_LINE_LOC_SIZE] == 2) {
- Uint16* loc_table =
- (Uint16 *) (BeamInstr) line[MI_LINE_LOC_TAB];
- fi->loc = loc_table[index];
- } else {
- Uint32* loc_table =
- (Uint32 *) (BeamInstr) line[MI_LINE_LOC_TAB];
- ASSERT(line[MI_LINE_LOC_SIZE] == 4);
- fi->loc = loc_table[index];
- }
- if (fi->loc == LINE_INVALID_LOCATION) {
- return;
- }
- fi->needed += 3+2+3+2;
- file = LOC_FILE(fi->loc);
- if (file == 0) {
- /* Special case: Module name with ".erl" appended */
- Atom* mod_atom = atom_tab(atom_val(fi->current[0]));
- fi->needed += 2*(mod_atom->len+4);
- } else {
- Atom* ap = atom_tab(atom_val((fi->fname_ptr)[file-1]));
- fi->needed += 2*ap->len;
- }
- return;
- } else {
- low = mid + 1;
- }
- }
-}
-
-/*
* Build a single {M,F,A,Loction} item to be part of
* a stack trace.
*/
@@ -5449,6 +5398,7 @@ code_get_chunk_2(BIF_ALIST_2)
Process* p = BIF_P;
Eterm Bin = BIF_ARG_1;
Eterm Chunk = BIF_ARG_2;
+ Binary* magic = 0;
LoaderState* stp;
Uint chunk = 0;
ErlSubBin* sb;
@@ -5461,12 +5411,13 @@ code_get_chunk_2(BIF_ALIST_2)
Eterm real_bin;
byte* temp_alloc = NULL;
- stp = erts_alloc_loader_state();
+ magic = erts_alloc_loader_state();
+ stp = ERTS_MAGIC_BIN_DATA(magic);
if ((start = erts_get_aligned_binary_bytes(Bin, &temp_alloc)) == NULL) {
error:
erts_free_aligned_binary_bytes(temp_alloc);
- if (stp) {
- free_state(stp);
+ if (magic) {
+ free_loader_state(magic);
}
BIF_ERROR(p, BADARG);
}
@@ -5511,7 +5462,7 @@ code_get_chunk_2(BIF_ALIST_2)
done:
erts_free_aligned_binary_bytes(temp_alloc);
- free_state(stp);
+ free_loader_state(magic);
return res;
}
@@ -5524,14 +5475,16 @@ code_module_md5_1(BIF_ALIST_1)
{
Process* p = BIF_P;
Eterm Bin = BIF_ARG_1;
+ Binary* magic;
LoaderState* stp;
byte* bytes;
byte* temp_alloc = NULL;
Eterm res;
- stp = erts_alloc_loader_state();
+ magic = erts_alloc_loader_state();
+ stp = ERTS_MAGIC_BIN_DATA(magic);
if ((bytes = erts_get_aligned_binary_bytes(Bin, &temp_alloc)) == NULL) {
- free_state(stp);
+ free_loader_state(magic);
BIF_ERROR(p, BADARG);
}
stp->module = THE_NON_VALUE; /* Suppress diagnostiscs */
@@ -5545,7 +5498,7 @@ code_module_md5_1(BIF_ALIST_1)
done:
erts_free_aligned_binary_bytes(temp_alloc);
- free_state(stp);
+ free_loader_state(magic);
return res;
}
@@ -5574,7 +5527,8 @@ stub_copy_info(LoaderState* stp,
int chunk, /* Chunk: ATTR_CHUNK or COMPILE_CHUNK */
byte* info, /* Where to store info. */
BeamInstr* ptr_word, /* Where to store pointer into info. */
- BeamInstr* size_word) /* Where to store size of info. */
+ BeamInstr* size_word, /* Where to store size into info. */
+ BeamInstr* size_on_heap_word) /* Where to store size on heap. */
{
Sint decoded_size;
Uint size = stp->chunks[chunk].size;
@@ -5585,7 +5539,8 @@ stub_copy_info(LoaderState* stp,
if (decoded_size < 0) {
return 0;
}
- *size_word = decoded_size;
+ *size_word = (BeamInstr) size;
+ *size_on_heap_word = decoded_size;
}
return info + size;
}
@@ -5601,7 +5556,7 @@ stub_read_export_table(LoaderState* stp)
stp->num_exps, stp->num_functions);
}
stp->export
- = (ExportEntry *) erts_alloc(ERTS_ALC_T_LOADER_TMP,
+ = (ExportEntry *) erts_alloc(ERTS_ALC_T_PREPARED_CODE,
stp->num_exps * sizeof(ExportEntry));
for (i = 0; i < stp->num_exps; i++) {
@@ -5627,20 +5582,29 @@ stub_final_touch(LoaderState* stp, BeamInstr* fp)
{
int i;
int n = stp->num_exps;
+ Eterm mod = fp[2];
Eterm function = fp[3];
int arity = fp[4];
#ifdef HIPE
Lambda* lp;
#endif
+ if (is_bif(mod, function, arity)) {
+ fp[1] = 0;
+ fp[2] = 0;
+ fp[3] = 0;
+ fp[4] = 0;
+ return;
+ }
+
/*
* Test if the function should be exported.
*/
for (i = 0; i < n; i++) {
if (stp->export[i].function == function && stp->export[i].arity == arity) {
- Export* ep = erts_export_put(fp[2], function, arity);
- ep->address = fp+5;
+ Export* ep = erts_export_put(mod, function, arity);
+ ep->addressv[erts_staging_code_ix()] = fp+5;
return;
}
}
@@ -5819,6 +5783,7 @@ patch_funentries(Eterm Patchlist)
Eterm
erts_make_stub_module(Process* p, Eterm Mod, Eterm Beam, Eterm Info)
{
+ Binary* magic;
LoaderState* stp;
BeamInstr Funcs;
BeamInstr Patchlist;
@@ -5840,7 +5805,8 @@ erts_make_stub_module(Process* p, Eterm Mod, Eterm Beam, Eterm Info)
* Must initialize stp->lambdas here because the error handling code
* at label 'error' uses it.
*/
- stp = erts_alloc_loader_state();
+ magic = erts_alloc_loader_state();
+ stp = ERTS_MAGIC_BIN_DATA(magic);
if (is_not_atom(Mod)) {
goto error;
@@ -5920,7 +5886,6 @@ erts_make_stub_module(Process* p, Eterm Mod, Eterm Beam, Eterm Info)
code[MI_COMPILE_PTR] = 0;
code[MI_COMPILE_SIZE] = 0;
code[MI_COMPILE_SIZE_ON_HEAP] = 0;
- code[MI_NUM_BREAKPOINTS] = 0;
code[MI_LITERALS_START] = 0;
code[MI_LITERALS_END] = 0;
code[MI_LITERALS_OFF_HEAP] = 0;
@@ -5997,12 +5962,16 @@ erts_make_stub_module(Process* p, Eterm Mod, Eterm Beam, Eterm Info)
info = (byte *) fp;
info = stub_copy_info(stp, ATTR_CHUNK, info,
- code+MI_ATTR_PTR, code+MI_ATTR_SIZE_ON_HEAP);
+ code+MI_ATTR_PTR,
+ code+MI_ATTR_SIZE,
+ code+MI_ATTR_SIZE_ON_HEAP);
if (info == NULL) {
goto error;
}
info = stub_copy_info(stp, COMPILE_CHUNK, info,
- code+MI_COMPILE_PTR, code+MI_COMPILE_SIZE_ON_HEAP);
+ code+MI_COMPILE_PTR,
+ code+MI_COMPILE_SIZE,
+ code+MI_COMPILE_SIZE_ON_HEAP);
if (info == NULL) {
goto error;
}
@@ -6028,13 +5997,13 @@ erts_make_stub_module(Process* p, Eterm Mod, Eterm Beam, Eterm Info)
if (patch_funentries(Patchlist)) {
erts_free_aligned_binary_bytes(temp_alloc);
- free_state(stp);
+ free_loader_state(magic);
return Mod;
}
error:
erts_free_aligned_binary_bytes(temp_alloc);
- free_state(stp);
+ free_loader_state(magic);
BIF_ERROR(p, BADARG);
}
@@ -6051,3 +6020,4 @@ static int safe_mul(UWord a, UWord b, UWord* resp)
return (res / b) == a;
}
}
+
diff --git a/erts/emulator/beam/beam_load.h b/erts/emulator/beam/beam_load.h
index 997ba197db..1048f258a5 100644
--- a/erts/emulator/beam/beam_load.h
+++ b/erts/emulator/beam/beam_load.h
@@ -49,11 +49,6 @@ extern void** beam_ops;
extern BeamInstr beam_debug_apply[];
extern BeamInstr* em_call_error_handler;
extern BeamInstr* em_apply_bif;
-extern BeamInstr* em_call_traced_function;
-typedef struct {
- BeamInstr* start; /* Pointer to start of module. */
- BeamInstr* end; /* Points one word beyond last function in module. */
-} Range;
/*
* The following variables keep a sorted list of address ranges for
@@ -61,11 +56,6 @@ typedef struct {
* instruction pointer.
*/
-extern Range* modules;
-extern int num_loaded_modules;
-extern int allocated_modules;
-extern Range* mid_module;
-
/* Total code size in bytes */
extern Uint erts_total_code_size;
/*
@@ -94,27 +84,22 @@ extern Uint erts_total_code_size;
#define MI_COMPILE_SIZE_ON_HEAP 6
/*
- * Number of breakpoints in module is stored in this word
- */
-#define MI_NUM_BREAKPOINTS 7
-
-/*
* Literal area (constant pool).
*/
-#define MI_LITERALS_START 8
-#define MI_LITERALS_END 9
-#define MI_LITERALS_OFF_HEAP 10
+#define MI_LITERALS_START 7
+#define MI_LITERALS_END 8
+#define MI_LITERALS_OFF_HEAP 9
/*
* Pointer to the on_load function (or NULL if none).
*/
-#define MI_ON_LOAD_FUNCTION_PTR 11
+#define MI_ON_LOAD_FUNCTION_PTR 10
/*
* Pointer to the line table (or NULL if none).
*/
-#define MI_LINE_TABLE 12
+#define MI_LINE_TABLE 11
/*
* Start of function pointer table. This table contains pointers to
@@ -125,5 +110,27 @@ extern Uint erts_total_code_size;
* this table.
*/
-#define MI_FUNCTIONS 13
+#define MI_FUNCTIONS 12
+
+/*
+ * Layout of the line table.
+ */
+
+#define MI_LINE_FNAME_PTR 0
+#define MI_LINE_LOC_TAB 1
+#define MI_LINE_LOC_SIZE 2
+#define MI_LINE_FUNC_TAB 3
+
+#define LINE_INVALID_LOCATION (0)
+
+/*
+ * Macros for manipulating locations.
+ */
+
+#define IS_VALID_LOCATION(File, Line) \
+ ((unsigned) (File) < 255 && (unsigned) (Line) < ((1 << 24) - 1))
+#define MAKE_LOCATION(File, Line) (((File) << 24) | (Line))
+#define LOC_FILE(Loc) ((Loc) >> 24)
+#define LOC_LINE(Loc) ((Loc) & ((1 << 24)-1))
+
#endif /* _BEAM_LOAD_H */
diff --git a/erts/emulator/beam/beam_ranges.c b/erts/emulator/beam/beam_ranges.c
new file mode 100644
index 0000000000..0f2d5d0c2a
--- /dev/null
+++ b/erts/emulator/beam/beam_ranges.c
@@ -0,0 +1,349 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Ericsson AB 2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "sys.h"
+#include "erl_vm.h"
+#include "global.h"
+#include "beam_load.h"
+
+typedef struct {
+ BeamInstr* start; /* Pointer to start of module. */
+ erts_smp_atomic_t end; /* (BeamInstr*) Points one word beyond last function in module. */
+} Range;
+
+/* Range 'end' needs to be atomic as we purge module
+ by setting end=start in active code_ix */
+#define RANGE_END(R) ((BeamInstr*)erts_smp_atomic_read_nob(&(R)->end))
+
+static Range* find_range(BeamInstr* pc);
+static void lookup_loc(FunctionInfo* fi, BeamInstr* pc,
+ BeamInstr* modp, int idx);
+
+/*
+ * The following variables keep a sorted list of address ranges for
+ * each module. It allows us to quickly find a function given an
+ * instruction pointer.
+ */
+struct ranges {
+ Range* modules; /* Sorted lists of module addresses. */
+ Sint n; /* Number of range entries. */
+ Sint allocated; /* Number of allocated entries. */
+ erts_smp_atomic_t mid; /* Cached search start point */
+};
+static struct ranges r[ERTS_NUM_CODE_IX];
+static erts_smp_atomic_t mem_used;
+
+#ifdef HARD_DEBUG
+static void check_consistency(struct ranges* p)
+{
+ int i;
+
+ ASSERT(p->n <= p->allocated);
+ ASSERT((Uint)(p->mid - p->modules) < p->n ||
+ (p->mid == p->modules && p->n == 0));
+ for (i = 0; i < p->n; i++) {
+ ASSERT(p->modules[i].start <= RANGE_END(&p->modules[i]));
+ ASSERT(!i || RANGE_END(&p->modules[i-1]) < p->modules[i].start);
+ }
+}
+# define CHECK(r) check_consistency(r)
+#else
+# define CHECK(r)
+#endif /* HARD_DEBUG */
+
+
+void
+erts_init_ranges(void)
+{
+ Sint i;
+
+ erts_smp_atomic_init_nob(&mem_used, 0);
+ for (i = 0; i < ERTS_NUM_CODE_IX; i++) {
+ r[i].modules = 0;
+ r[i].n = 0;
+ r[i].allocated = 0;
+ erts_smp_atomic_init_nob(&r[i].mid, 0);
+ }
+}
+
+void
+erts_start_staging_ranges(void)
+{
+ ErtsCodeIndex dst = erts_staging_code_ix();
+
+ if (r[dst].modules) {
+ erts_smp_atomic_add_nob(&mem_used, -r[dst].allocated);
+ erts_free(ERTS_ALC_T_MODULE_REFS, r[dst].modules);
+ r[dst].modules = NULL;
+ }
+}
+
+void
+erts_end_staging_ranges(int commit)
+{
+ ErtsCodeIndex dst = erts_staging_code_ix();
+
+ if (commit && r[dst].modules == NULL) {
+ Sint i;
+ Sint n;
+
+ /* No modules added, just clone src and remove purged code. */
+ ErtsCodeIndex src = erts_active_code_ix();
+
+ erts_smp_atomic_add_nob(&mem_used, r[src].n);
+ r[dst].modules = erts_alloc(ERTS_ALC_T_MODULE_REFS,
+ r[src].n * sizeof(Range));
+ r[dst].allocated = r[src].n;
+ n = 0;
+ for (i = 0; i < r[src].n; i++) {
+ Range* rp = r[src].modules+i;
+ if (rp->start < RANGE_END(rp)) {
+ /* Only insert a module that has not been purged. */
+ r[dst].modules[n] = *rp;
+ n++;
+ }
+ }
+ r[dst].n = n;
+ erts_smp_atomic_set_nob(&r[dst].mid,
+ (erts_aint_t) (r[dst].modules + n / 2));
+ }
+}
+
+void
+erts_update_ranges(BeamInstr* code, Uint size)
+{
+ ErtsCodeIndex dst = erts_staging_code_ix();
+ ErtsCodeIndex src = erts_active_code_ix();
+ Sint i;
+ Sint n;
+ Sint need;
+
+ if (src == dst) {
+ ASSERT(!erts_initialized);
+
+ /*
+ * During start-up of system, the indices are the same.
+ * Handle this by faking a source area.
+ */
+ src = (src+1) % ERTS_NUM_CODE_IX;
+ if (r[src].modules) {
+ erts_smp_atomic_add_nob(&mem_used, -r[src].allocated);
+ erts_free(ERTS_ALC_T_MODULE_REFS, r[src].modules);
+ }
+ r[src] = r[dst];
+ r[dst].modules = 0;
+ }
+
+ CHECK(&r[src]);
+
+ ASSERT(r[dst].modules == NULL);
+ need = r[dst].allocated = r[src].n + 1;
+ erts_smp_atomic_add_nob(&mem_used, need);
+ r[dst].modules = (Range *) erts_alloc(ERTS_ALC_T_MODULE_REFS,
+ need * sizeof(Range));
+ n = 0;
+ for (i = 0; i < r[src].n; i++) {
+ Range* rp = r[src].modules+i;
+ if (code < rp->start) {
+ r[dst].modules[n].start = code;
+ erts_smp_atomic_init_nob(&r[dst].modules[n].end,
+ (erts_aint_t)(((byte *)code) + size));
+ ASSERT(!n || RANGE_END(&r[dst].modules[n-1]) < code);
+ n++;
+ break;
+ }
+ if (rp->start < RANGE_END(rp)) {
+ /* Only insert a module that has not been purged. */
+ r[dst].modules[n].start = rp->start;
+ erts_smp_atomic_init_nob(&r[dst].modules[n].end,
+ (erts_aint_t)(RANGE_END(rp)));
+ ASSERT(!n || RANGE_END(&r[dst].modules[n-1]) < rp->start);
+ n++;
+ }
+ }
+
+ while (i < r[src].n) {
+ Range* rp = r[src].modules+i;
+ if (rp->start < RANGE_END(rp)) {
+ /* Only insert a module that has not been purged. */
+ r[dst].modules[n].start = rp->start;
+ erts_smp_atomic_init_nob(&r[dst].modules[n].end,
+ (erts_aint_t)(RANGE_END(rp)));
+ ASSERT(!n || RANGE_END(&r[dst].modules[n-1]) < rp->start);
+ n++;
+ }
+ i++;
+ }
+
+ if (n == 0 || code > r[dst].modules[n-1].start) {
+ r[dst].modules[n].start = code;
+ erts_smp_atomic_init_nob(&r[dst].modules[n].end,
+ (erts_aint_t)(((byte *)code) + size));
+ ASSERT(!n || RANGE_END(&r[dst].modules[n-1]) < code);
+ n++;
+ }
+
+ ASSERT(n <= r[src].n+1);
+ r[dst].n = n;
+ erts_smp_atomic_set_nob(&r[dst].mid,
+ (erts_aint_t) (r[dst].modules + n / 2));
+
+ CHECK(&r[dst]);
+ CHECK(&r[src]);
+}
+
+void
+erts_remove_from_ranges(BeamInstr* code)
+{
+ Range* rp = find_range(code);
+ erts_smp_atomic_set_nob(&rp->end, (erts_aint_t)rp->start);
+}
+
+UWord
+erts_ranges_sz(void)
+{
+ return erts_smp_atomic_read_nob(&mem_used) * sizeof(Range);
+}
+
+/*
+ * Find a function from the given pc and fill information in
+ * the FunctionInfo struct. If the full_info is non-zero, fill
+ * in all available information (including location in the
+ * source code). If no function is found, the 'current' field
+ * will be set to NULL.
+ */
+
+void
+erts_lookup_function_info(FunctionInfo* fi, BeamInstr* pc, int full_info)
+{
+ BeamInstr** low;
+ BeamInstr** high;
+ BeamInstr** mid;
+ Range* rp;
+
+ fi->current = NULL;
+ fi->needed = 5;
+ fi->loc = LINE_INVALID_LOCATION;
+ rp = find_range(pc);
+ if (rp == 0) {
+ return;
+ }
+
+ low = (BeamInstr **) (rp->start + MI_FUNCTIONS);
+ high = low + rp->start[MI_NUM_FUNCTIONS];
+ while (low < high) {
+ mid = low + (high-low) / 2;
+ if (pc < mid[0]) {
+ high = mid;
+ } else if (pc < mid[1]) {
+ fi->current = mid[0]+2;
+ if (full_info) {
+ BeamInstr** fp = (BeamInstr **) (rp->start +
+ MI_FUNCTIONS);
+ int idx = mid - fp;
+ lookup_loc(fi, pc, rp->start, idx);
+ }
+ return;
+ } else {
+ low = mid + 1;
+ }
+ }
+}
+
+static Range*
+find_range(BeamInstr* pc)
+{
+ ErtsCodeIndex active = erts_active_code_ix();
+ Range* low = r[active].modules;
+ Range* high = low + r[active].n;
+ Range* mid = (Range *) erts_smp_atomic_read_nob(&r[active].mid);
+
+ CHECK(&r[active]);
+ while (low < high) {
+ if (pc < mid->start) {
+ high = mid;
+ } else if (pc > RANGE_END(mid)) {
+ low = mid + 1;
+ } else {
+ erts_smp_atomic_set_nob(&r[active].mid, (erts_aint_t) mid);
+ return mid;
+ }
+ mid = low + (high-low) / 2;
+ }
+ return 0;
+}
+
+static void
+lookup_loc(FunctionInfo* fi, BeamInstr* orig_pc, BeamInstr* modp, int idx)
+{
+ Eterm* line = (Eterm *) modp[MI_LINE_TABLE];
+ Eterm* low;
+ Eterm* high;
+ Eterm* mid;
+ Eterm pc;
+
+ if (line == 0) {
+ return;
+ }
+
+ pc = (Eterm) (BeamInstr) orig_pc;
+ fi->fname_ptr = (Eterm *) (BeamInstr) line[MI_LINE_FNAME_PTR];
+ low = (Eterm *) (BeamInstr) line[MI_LINE_FUNC_TAB+idx];
+ high = (Eterm *) (BeamInstr) line[MI_LINE_FUNC_TAB+idx+1];
+ while (high > low) {
+ mid = low + (high-low) / 2;
+ if (pc < mid[0]) {
+ high = mid;
+ } else if (pc < mid[1]) {
+ int file;
+ int index = mid - (Eterm *) (BeamInstr) line[MI_LINE_FUNC_TAB];
+
+ if (line[MI_LINE_LOC_SIZE] == 2) {
+ Uint16* loc_table =
+ (Uint16 *) (BeamInstr) line[MI_LINE_LOC_TAB];
+ fi->loc = loc_table[index];
+ } else {
+ Uint32* loc_table =
+ (Uint32 *) (BeamInstr) line[MI_LINE_LOC_TAB];
+ ASSERT(line[MI_LINE_LOC_SIZE] == 4);
+ fi->loc = loc_table[index];
+ }
+ if (fi->loc == LINE_INVALID_LOCATION) {
+ return;
+ }
+ fi->needed += 3+2+3+2;
+ file = LOC_FILE(fi->loc);
+ if (file == 0) {
+ /* Special case: Module name with ".erl" appended */
+ Atom* mod_atom = atom_tab(atom_val(fi->current[0]));
+ fi->needed += 2*(mod_atom->len+4);
+ } else {
+ Atom* ap = atom_tab(atom_val((fi->fname_ptr)[file-1]));
+ fi->needed += 2*ap->len;
+ }
+ return;
+ } else {
+ low = mid + 1;
+ }
+ }
+}
diff --git a/erts/emulator/beam/benchmark.c b/erts/emulator/beam/benchmark.c
index 7fbf44a03c..8613131176 100644
--- a/erts/emulator/beam/benchmark.c
+++ b/erts/emulator/beam/benchmark.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2012. 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
@@ -33,17 +33,6 @@ unsigned long long messages_copied;
unsigned long long messages_ego;
unsigned long long minor_gc;
unsigned long long major_gc;
-#ifdef HYBRID
-unsigned long long minor_global_gc;
-unsigned long long major_global_gc;
-unsigned long long gc_in_copy;
-#ifdef INCREMENTAL
-unsigned long long minor_gc_cycles;
-unsigned long long major_gc_cycles;
-unsigned long long minor_gc_stages;
-unsigned long long major_gc_stages;
-#endif
-#endif
#endif /* BM_COUNTERS */
#ifdef BM_TIMERS
@@ -191,17 +180,6 @@ void init_benchmarking()
messages_ego = 0;
minor_gc = 0;
major_gc = 0;
-#ifdef HYBRID
- minor_global_gc = 0;
- major_global_gc = 0;
- gc_in_copy = 0;
-#ifdef INCREMENTAL
- minor_gc_cycles = 0;
- major_gc_cycles = 0;
- minor_gc_stages = 0;
- major_gc_stages = 0;
-#endif
-#endif
#endif /* BM_COUNTERS */
#ifdef BM_HEAP_SIZES
@@ -243,16 +221,6 @@ void save_statistics()
erts_fprintf(file,"Number of processes spawned: %lld\n",processes_spawned);
erts_fprintf(file,"Number of local minor GCs: %lld\n",minor_gc);
erts_fprintf(file,"Number of local major GCs: %lld\n",major_gc);
-#ifdef HYBRID
- erts_fprintf(file,"Number of global minor GCs: %lld\n",minor_global_gc);
- erts_fprintf(file,"Number of global major GCs: %lld\n",major_global_gc);
-#ifdef INCREMENTAL
- erts_fprintf(file,"Number of minor GC-cycles: %lld\n",minor_gc_cycles);
- erts_fprintf(file,"Number of major GC-cycles: %lld\n",major_gc_cycles);
- erts_fprintf(file,"Number of minor GC-stages: %lld\n",minor_gc_stages);
- erts_fprintf(file,"Number of major GC-stages: %lld\n",major_gc_stages);
-#endif
-#endif
erts_fprintf(file,"Number of messages sent: %lld\n",messages_sent);
erts_fprintf(file,"Number of messages copied: %lld\n",messages_copied);
erts_fprintf(file,"Number of messages sent to self: %lld\n",messages_ego);
diff --git a/erts/emulator/beam/benchmark.h b/erts/emulator/beam/benchmark.h
index eedb06a1b6..766edaac42 100644
--- a/erts/emulator/beam/benchmark.h
+++ b/erts/emulator/beam/benchmark.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2012. 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
@@ -99,17 +99,6 @@ extern unsigned long long messages_copied;
extern unsigned long long messages_ego;
extern unsigned long long minor_gc;
extern unsigned long long major_gc;
-#ifdef HYBRID
-extern unsigned long long minor_global_gc;
-extern unsigned long long major_global_gc;
-extern unsigned long long gc_in_copy;
-#ifdef INCREMENTAL
-extern unsigned long long minor_gc_cycles;
-extern unsigned long long major_gc_cycles;
-extern unsigned long long minor_gc_stages;
-extern unsigned long long major_gc_stages;
-#endif
-#endif
#define BM_COUNT(var) (var)++;
diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c
index 55f4798892..1cdce49eef 100644
--- a/erts/emulator/beam/bif.c
+++ b/erts/emulator/beam/bif.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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,6 +43,9 @@ static Export* set_cpu_topology_trap = NULL;
static Export* await_proc_exit_trap = NULL;
Export* erts_format_cpu_topology_trap = NULL;
+static Export *await_sched_wall_time_mod_trap;
+static erts_smp_atomic32_t sched_wall_time;
+
#define DECL_AM(S) Eterm AM_ ## S = am_atom_put(#S, sizeof(#S) - 1)
/*
@@ -230,15 +233,17 @@ BIF_RETTYPE link_1(BIF_ALIST_1)
BIF_ERROR(BIF_P, BADARG);
- res_no_proc:
- if (BIF_P->flags & F_TRAPEXIT) {
- ErtsProcLocks locks = ERTS_PROC_LOCK_MAIN;
- erts_deliver_exit_message(BIF_ARG_1, BIF_P, &locks, am_noproc, NIL);
- erts_smp_proc_unlock(BIF_P, ~ERTS_PROC_LOCK_MAIN & locks);
- BIF_RET(am_true);
+res_no_proc: {
+ erts_aint32_t state = erts_smp_atomic32_read_nob(&BIF_P->state);
+ if (state & ERTS_PSFLG_TRAP_EXIT) {
+ ErtsProcLocks locks = ERTS_PROC_LOCK_MAIN;
+ erts_deliver_exit_message(BIF_ARG_1, BIF_P, &locks, am_noproc, NIL);
+ erts_smp_proc_unlock(BIF_P, ~ERTS_PROC_LOCK_MAIN & locks);
+ BIF_RET(am_true);
+ }
+ else
+ BIF_ERROR(BIF_P, EXC_NOPROC);
}
- else
- BIF_ERROR(BIF_P, EXC_NOPROC);
}
#define ERTS_DEMONITOR_FALSE 2
@@ -560,7 +565,11 @@ 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, bp, tup, NIL);
+ erts_queue_message(p, p_locksp, bp, tup, NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
}
static BIF_RETTYPE
@@ -1096,8 +1105,9 @@ BIF_RETTYPE hibernate_3(BIF_ALIST_3)
if (erts_hibernate(BIF_P, BIF_ARG_1, BIF_ARG_2, BIF_ARG_3, reg)) {
/*
- * If hibernate succeeded, TRAP. The process will be suspended
- * if status is P_WAITING or continue (if any message was in the queue).
+ * If hibernate succeeded, TRAP. The process will be wait in a
+ * hibernated state if its state is inactive (!ERTS_PSFLG_ACTIVE);
+ * otherwise, continue executing (if any message was in the queue).
*/
BIF_TRAP_CODE_PTR_(BIF_P, BIF_P->i);
}
@@ -1396,9 +1406,8 @@ BIF_RETTYPE exit_2(BIF_ALIST_2)
}
else {
rp_locks = ERTS_PROC_LOCKS_XSIG_SEND;
- rp = erts_pid2proc_opt(BIF_P, ERTS_PROC_LOCK_MAIN,
- BIF_ARG_1, rp_locks,
- ERTS_P2P_FLG_SMP_INC_REFC);
+ rp = erts_pid2proc(BIF_P, ERTS_PROC_LOCK_MAIN,
+ BIF_ARG_1, rp_locks);
if (!rp) {
BIF_RET(am_true);
}
@@ -1420,8 +1429,6 @@ BIF_RETTYPE exit_2(BIF_ALIST_2)
rp_locks &= ~ERTS_PROC_LOCK_MAIN;
if (rp_locks)
erts_smp_proc_unlock(rp, rp_locks);
- if (rp != BIF_P)
- erts_smp_proc_dec_refc(rp);
#endif
/*
* We may have exited ourselves and may have to take action.
@@ -1495,14 +1502,13 @@ BIF_RETTYPE process_flag_2(BIF_ALIST_2)
BIF_RET(old_value);
}
else if (BIF_ARG_1 == am_priority) {
- erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_STATUS);
old_value = erts_set_process_priority(BIF_P, BIF_ARG_2);
- erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_STATUS);
if (old_value == THE_NON_VALUE)
goto error;
BIF_RET(old_value);
}
else if (BIF_ARG_1 == am_trap_exit) {
+ erts_aint32_t state;
Uint trap_exit;
if (BIF_ARG_2 == am_true) {
trap_exit = 1;
@@ -1517,59 +1523,52 @@ BIF_RETTYPE process_flag_2(BIF_ALIST_2)
* For more info, see implementation of erts_send_exit_signal().
*/
erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_STATUS);
+ ERTS_SMP_LC_ASSERT((ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS)
+ & erts_proc_lc_my_proc_locks(BIF_P));
ERTS_SMP_BIF_CHK_PENDING_EXIT(BIF_P,
ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS);
- old_value = ERTS_PROC_IS_TRAPPING_EXITS(BIF_P) ? am_true : am_false;
- if (trap_exit) {
- ERTS_PROC_SET_TRAP_EXIT(BIF_P);
- } else {
- ERTS_PROC_UNSET_TRAP_EXIT(BIF_P);
- }
+ if (trap_exit)
+ state = erts_smp_atomic32_read_bor_nob(&BIF_P->state,
+ ERTS_PSFLG_TRAP_EXIT);
+ else
+ state = erts_smp_atomic32_read_band_nob(&BIF_P->state,
+ ~ERTS_PSFLG_TRAP_EXIT);
+ old_value = (state & ERTS_PSFLG_TRAP_EXIT) ? am_true : am_false;
erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_STATUS);
BIF_RET(old_value);
}
else if (BIF_ARG_1 == am_scheduler) {
- int yield;
- ErtsRunQueue *old;
- ErtsRunQueue *new;
+ ErtsRunQueue *old, *new, *curr;
Sint sched;
+ erts_aint32_t state;
+
if (!is_small(BIF_ARG_2))
goto error;
sched = signed_val(BIF_ARG_2);
if (sched < 0 || erts_no_schedulers < sched)
goto error;
- erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_STATUS);
- old = BIF_P->bound_runq;
-#ifdef ERTS_SMP
- ASSERT(!old || old == BIF_P->run_queue);
-#endif
- new = !sched ? NULL : erts_schedid2runq(sched);
-#ifndef ERTS_SMP
- yield = 0;
-#else
- if (new == old)
- yield = 0;
+
+ if (sched == 0) {
+ new = NULL;
+ state = erts_smp_atomic32_read_band_mb(&BIF_P->state,
+ ~ERTS_PSFLG_BOUND);
+ }
else {
- ErtsRunQueue *curr = BIF_P->run_queue;
- if (!new)
- erts_smp_runq_lock(curr);
- else
- erts_smp_runqs_lock(curr, new);
- yield = new && BIF_P->run_queue != new;
-#endif
- BIF_P->bound_runq = new;
+ new = erts_schedid2runq(sched);
#ifdef ERTS_SMP
- if (new)
- BIF_P->run_queue = new;
- if (!new)
- erts_smp_runq_unlock(curr);
- else
- erts_smp_runqs_unlock(curr, new);
- }
+ erts_atomic_set_nob(&BIF_P->run_queue, (erts_aint_t) new);
#endif
- erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_STATUS);
+ state = erts_smp_atomic32_read_bor_mb(&BIF_P->state,
+ ERTS_PSFLG_BOUND);
+ }
+
+ curr = ERTS_GET_SCHEDULER_DATA_FROM_PROC(BIF_P)->run_queue;
+ old = (ERTS_PSFLG_BOUND & state) ? curr : NULL;
+
+ ASSERT(!old || old == curr);
+
old_value = old ? make_small(old->ix+1) : make_small(0);
- if (yield)
+ if (new && new != curr)
ERTS_BIF_YIELD_RETURN_X(BIF_P, old_value, am_scheduler);
else
BIF_RET(old_value);
@@ -1819,8 +1818,7 @@ do_send(Process *p, Eterm to, Eterm msg, int suspend) {
if (internal_pid_index(to) >= erts_max_processes)
return SEND_BADARG;
- rp = erts_pid2proc_opt(p, ERTS_PROC_LOCK_MAIN,
- to, 0, ERTS_P2P_FLG_SMP_INC_REFC);
+ rp = erts_proc_lookup_raw(to);
if (!rp) {
ERTS_SMP_ASSERT_IS_NOT_EXITING(p);
@@ -1858,7 +1856,7 @@ do_send(Process *p, Eterm to, Eterm msg, int suspend) {
}
erts_whereis_name(p, ERTS_PROC_LOCK_MAIN,
to,
- &rp, 0, ERTS_P2P_FLG_SMP_INC_REFC,
+ &rp, 0, 0,
&pt);
if (pt) {
@@ -1941,7 +1939,11 @@ do_send(Process *p, Eterm to, Eterm msg, int suspend) {
if (ERTS_PROC_GET_SAVED_CALLS_BUF(p))
save_calls(p, &exp_send);
- if (SEQ_TRACE_TOKEN(p) != NIL) {
+ if (SEQ_TRACE_TOKEN(p) != NIL
+#ifdef USE_VM_PROBES
+ && SEQ_TRACE_TOKEN(p) != am_have_dt_utag
+#endif
+ ) {
seq_trace_update_send(p);
seq_trace_output(SEQ_TRACE_TOKEN(p), msg,
SEQ_TRACE_SEND, portid, p);
@@ -2006,7 +2008,7 @@ do_send(Process *p, Eterm to, Eterm msg, int suspend) {
erts_whereis_name(p, ERTS_PROC_LOCK_MAIN,
tp[1],
- &rp, 0, ERTS_P2P_FLG_SMP_INC_REFC,
+ &rp, 0, 0,
&pt);
if (pt) {
portid = pt->id;
@@ -2049,23 +2051,15 @@ do_send(Process *p, Eterm to, Eterm msg, int suspend) {
rp_locks |= ERTS_PROC_LOCK_MAIN;
#endif
/* send to local process */
- erts_send_message(p, rp, &rp_locks, msg, 0);
- if (!erts_use_sender_punish)
+ res = erts_send_message(p, rp, &rp_locks, msg, 0);
+ if (erts_use_sender_punish)
+ res *= 4;
+ else
res = 0;
- else {
-#ifdef ERTS_SMP
- res = rp->msg_inq.len*4;
- if (ERTS_PROC_LOCK_MAIN & rp_locks)
- res += rp->msg.len*4;
-#else
- res = rp->msg.len*4;
-#endif
- }
erts_smp_proc_unlock(rp,
p == rp
? (rp_locks & ~ERTS_PROC_LOCK_MAIN)
: rp_locks);
- erts_smp_proc_dec_refc(rp);
return res;
}
}
@@ -2850,7 +2844,7 @@ BIF_RETTYPE float_to_list_1(BIF_ALIST_1)
if (is_not_float(BIF_ARG_1))
BIF_ERROR(BIF_P, BADARG);
GET_DOUBLE(BIF_ARG_1, f);
- if ((i = sys_double_to_chars(f.fd, fbuf)) <= 0)
+ if ((i = sys_double_to_chars(f.fd, fbuf, sizeof(fbuf))) <= 0)
BIF_ERROR(BIF_P, EXC_INTERNAL_ERROR);
need = i*2;
hp = HAlloc(BIF_P, need);
@@ -3475,7 +3469,7 @@ BIF_RETTYPE garbage_collect_1(BIF_ALIST_1)
if (rp == ERTS_PROC_LOCK_BUSY)
ERTS_BIF_YIELD1(bif_export[BIF_garbage_collect_1], BIF_P, BIF_ARG_1);
#else
- rp = erts_pid2proc(BIF_P, 0, BIF_ARG_1, 0);
+ rp = erts_proc_lookup(BIF_ARG_1);
#endif
if (!rp)
BIF_RET(am_false);
@@ -3506,22 +3500,6 @@ BIF_RETTYPE garbage_collect_0(BIF_ALIST_0)
}
/**********************************************************************/
-/* Perform garbage collection of the message area */
-
-BIF_RETTYPE garbage_collect_message_area_0(BIF_ALIST_0)
-{
-#if defined(HYBRID) && !defined(INCREMENTAL)
- int reds = 0;
-
- FLAGS(BIF_P) |= F_NEED_FULLSWEEP;
- reds = erts_global_garbage_collect(BIF_P, 0, NULL, 0);
- BIF_RET2(am_true, reds);
-#else
- BIF_RET(am_false);
-#endif
-}
-
-/**********************************************************************/
/* Return a list of active ports */
BIF_RETTYPE ports_0(BIF_ALIST_0)
@@ -3662,43 +3640,122 @@ BIF_RETTYPE display_nl_0(BIF_ALIST_0)
/* ARGSUSED */
BIF_RETTYPE halt_0(BIF_ALIST_0)
{
- VERBOSE(DEBUG_SYSTEM,("System halted by BIF halt/0\n"));
- erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
- erl_exit(0, "");
- return NIL; /* Pedantic (lint does not know about erl_exit) */
+ VERBOSE(DEBUG_SYSTEM,("System halted by BIF halt()\n"));
+ erl_halt(0);
+ ERTS_BIF_YIELD1(bif_export[BIF_halt_1], BIF_P, am_undefined);
}
/**********************************************************************/
-#define MSG_SIZE 200
+#define HALT_MSG_SIZE 200
+static char halt_msg[HALT_MSG_SIZE];
/* stop the system with exit code */
/* ARGSUSED */
BIF_RETTYPE halt_1(BIF_ALIST_1)
{
Sint code;
- static char msg[MSG_SIZE];
- int i;
if (is_small(BIF_ARG_1) && (code = signed_val(BIF_ARG_1)) >= 0) {
- VERBOSE(DEBUG_SYSTEM,("System halted by BIF halt(%d)\n", code));
+ VERBOSE(DEBUG_SYSTEM,("System halted by BIF halt(%T)\n", BIF_ARG_1));
+ erl_halt((int)(- code));
+ ERTS_BIF_YIELD1(bif_export[BIF_halt_1], BIF_P, am_undefined);
+ }
+ else if (ERTS_IS_ATOM_STR("abort", BIF_ARG_1)) {
+ VERBOSE(DEBUG_SYSTEM,("System halted by BIF halt(%T)\n", BIF_ARG_1));
erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
- erl_exit(-code, "");
- } else if (is_string(BIF_ARG_1) || BIF_ARG_1 == NIL) {
- if ((i = intlist_to_buf(BIF_ARG_1, msg, MSG_SIZE-1)) < 0) {
+ erl_exit(ERTS_ABORT_EXIT, "");
+ }
+ else if (is_string(BIF_ARG_1) || BIF_ARG_1 == NIL) {
+ int i;
+
+ if ((i = intlist_to_buf(BIF_ARG_1, halt_msg, HALT_MSG_SIZE-1)) < 0) {
goto error;
}
- msg[i] = '\0';
- VERBOSE(DEBUG_SYSTEM,("System halted by BIF halt(%s)\n", msg));
+ halt_msg[i] = '\0';
+ VERBOSE(DEBUG_SYSTEM,("System halted by BIF halt(%T)\n", BIF_ARG_1));
erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
- erl_exit(ERTS_DUMP_EXIT, "%s\n", msg);
- } else {
- error:
+ erl_exit(ERTS_DUMP_EXIT, "%s\n", halt_msg);
+ }
+ else
+ goto error;
+ return NIL; /* Pedantic (lint does not know about erl_exit) */
+ error:
BIF_ERROR(BIF_P, BADARG);
+}
+
+/**********************************************************************/
+
+/* stop the system with exit code and flags */
+/* ARGSUSED */
+BIF_RETTYPE halt_2(BIF_ALIST_2)
+{
+ Sint code;
+ Eterm optlist = BIF_ARG_2;
+ int flush = 0;
+
+ for (optlist = BIF_ARG_2;
+ is_list(optlist);
+ optlist = CDR(list_val(optlist))) {
+ Eterm *tp, opt = CAR(list_val(optlist));
+ if (is_not_tuple(opt))
+ goto error;
+ tp = tuple_val(opt);
+ if (tp[0] != make_arityval(2))
+ goto error;
+ if (tp[1] == am_flush) {
+ if (tp[2] == am_true)
+ flush = 1;
+ else if (tp[2] == am_false)
+ flush = 0;
+ else
+ goto error;
+ }
+ else
+ goto error;
+ }
+ if (is_not_nil(optlist))
+ goto error;
+
+ if (is_small(BIF_ARG_1) && (code = signed_val(BIF_ARG_1)) >= 0) {
+ VERBOSE(DEBUG_SYSTEM,
+ ("System halted by BIF halt(%T, %T)\n", BIF_ARG_1, BIF_ARG_2));
+ if (flush) {
+ erl_halt((int)(- code));
+ ERTS_BIF_YIELD1(bif_export[BIF_halt_1], BIF_P, am_undefined);
+ }
+ else {
+ erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
+ erl_exit((int)(- code), "");
+ }
+ }
+ else if (ERTS_IS_ATOM_STR("abort", BIF_ARG_1)) {
+ VERBOSE(DEBUG_SYSTEM,
+ ("System halted by BIF halt(%T, %T)\n", BIF_ARG_1, BIF_ARG_2));
+ erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
+ erl_exit(ERTS_ABORT_EXIT, "");
+ }
+ else if (is_string(BIF_ARG_1) || BIF_ARG_1 == NIL) {
+ int i;
+
+ if ((i = intlist_to_buf(BIF_ARG_1, halt_msg, HALT_MSG_SIZE-1)) < 0) {
+ goto error;
+ }
+ halt_msg[i] = '\0';
+ VERBOSE(DEBUG_SYSTEM,
+ ("System halted by BIF halt(%T, %T)\n", BIF_ARG_1, BIF_ARG_2));
+ erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
+ erl_exit(ERTS_DUMP_EXIT, "%s\n", halt_msg);
}
+ else
+ goto error;
return NIL; /* Pedantic (lint does not know about erl_exit) */
+ error:
+ BIF_ERROR(BIF_P, BADARG);
}
+/**********************************************************************/
+
BIF_RETTYPE function_exported_3(BIF_ALIST_3)
{
if (is_not_atom(BIF_ARG_1) ||
@@ -3706,7 +3763,8 @@ BIF_RETTYPE function_exported_3(BIF_ALIST_3)
is_not_small(BIF_ARG_3)) {
BIF_ERROR(BIF_P, BADARG);
}
- if (erts_find_function(BIF_ARG_1, BIF_ARG_2, signed_val(BIF_ARG_3)) == NULL) {
+ if (erts_find_function(BIF_ARG_1, BIF_ARG_2, signed_val(BIF_ARG_3),
+ erts_active_code_ix()) == NULL) {
BIF_RET(am_false);
}
BIF_RET(am_true);
@@ -4142,15 +4200,23 @@ BIF_RETTYPE system_flag_2(BIF_ALIST_2)
erts_smp_thr_progress_block();
for (i = 0; i < erts_max_processes; i++) {
- if (process_tab[i] != (Process*) 0) {
- Process* p = process_tab[i];
+ Process *p = erts_pix2proc(i);
+ if (p) {
+#ifdef USE_VM_PROBES
+ p->seq_trace_token = (p->dt_utag != NIL) ? am_have_dt_utag : NIL;
+#else
p->seq_trace_token = NIL;
+#endif
p->seq_trace_clock = 0;
p->seq_trace_lastcnt = 0;
ERTS_SMP_MSGQ_MV_INQ2PRIVQ(p);
mp = p->msg.first;
while(mp != NULL) {
+#ifdef USE_VM_PROBES
+ ERL_MESSAGE_TOKEN(mp) = (ERL_MESSAGE_DT_UTAG(mp) != NIL) ? am_have_dt_utag : NIL;
+#else
ERL_MESSAGE_TOKEN(mp) = NIL;
+#endif
mp = mp->next;
}
}
@@ -4160,6 +4226,18 @@ BIF_RETTYPE system_flag_2(BIF_ALIST_2)
erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
BIF_RET(am_true);
+ } else if (BIF_ARG_1 == am_scheduler_wall_time) {
+ if (BIF_ARG_2 == am_true || BIF_ARG_2 == am_false) {
+ erts_aint32_t new = BIF_ARG_2 == am_true ? 1 : 0;
+ erts_aint32_t old = erts_smp_atomic32_xchg_nob(&sched_wall_time,
+ new);
+ Eterm ref = erts_sched_wall_time_request(BIF_P, 1, new);
+ ASSERT(is_value(ref));
+ BIF_TRAP2(await_sched_wall_time_mod_trap,
+ BIF_P,
+ ref,
+ old ? am_true : am_false);
+ }
} else if (ERTS_IS_ATOM_STR("scheduling_statistics", BIF_ARG_1)) {
int what;
if (ERTS_IS_ATOM_STR("disable", BIF_ARG_2))
@@ -4419,6 +4497,21 @@ erts_bif_prep_await_proc_exit_apply_trap(Process *c_p,
Export bif_return_trap_export;
+void erts_init_trap_export(Export* ep, Eterm m, Eterm f, Uint a,
+ Eterm (*bif)(BIF_ALIST_0))
+{
+ int i;
+ sys_memset((void *) ep, 0, sizeof(Export));
+ for (i=0; i<ERTS_NUM_CODE_IX; i++) {
+ ep->addressv[i] = &ep->code[3];
+ }
+ ep->code[0] = m;
+ ep->code[1] = f;
+ ep->code[2] = a;
+ ep->code[3] = (BeamInstr) em_apply_bif;
+ ep->code[4] = (BeamInstr) bif;
+}
+
void erts_init_bif(void)
{
reference0 = 0;
@@ -4434,17 +4527,13 @@ void erts_init_bif(void)
* yield the calling process traps to. The only thing it does:
* return the value passed as argument.
*/
- sys_memset((void *) &bif_return_trap_export, 0, sizeof(Export));
- bif_return_trap_export.address = &bif_return_trap_export.code[3];
- bif_return_trap_export.code[0] = am_erlang;
- bif_return_trap_export.code[1] = am_bif_return_trap;
+ erts_init_trap_export(&bif_return_trap_export, am_erlang, am_bif_return_trap,
#ifdef DEBUG
- bif_return_trap_export.code[2] = 2;
+ 2
#else
- bif_return_trap_export.code[2] = 1;
+ 1
#endif
- bif_return_trap_export.code[3] = (BeamInstr) em_apply_bif;
- bif_return_trap_export.code[4] = (BeamInstr) &bif_return_trap;
+ , &bif_return_trap);
flush_monitor_message_trap = erts_export_put(am_erlang,
am_flush_monitor_message,
@@ -4457,6 +4546,9 @@ void erts_init_bif(void)
am_format_cpu_topology,
1);
await_proc_exit_trap = erts_export_put(am_erlang,am_await_proc_exit,3);
+ await_sched_wall_time_mod_trap
+ = erts_export_put(am_erlang, am_await_sched_wall_time_modifications, 2);
+ erts_smp_atomic32_init_nob(&sched_wall_time, 0);
}
#ifdef HARDDEBUG
@@ -4533,3 +4625,193 @@ BIF_RETTYPE get_module_info_2(BIF_ALIST_2)
}
BIF_RET(ret);
}
+
+BIF_RETTYPE dt_put_tag_1(BIF_ALIST_1)
+{
+#ifdef USE_VM_PROBES
+ Eterm otag;
+ if (BIF_ARG_1 == am_undefined) {
+ otag = (DT_UTAG(BIF_P) == NIL) ? am_undefined : DT_UTAG(BIF_P);
+ DT_UTAG(BIF_P) = NIL;
+ DT_UTAG_FLAGS(BIF_P) = 0;
+ if (SEQ_TRACE_TOKEN(BIF_P) == am_have_dt_utag) {
+ SEQ_TRACE_TOKEN(BIF_P) = NIL;
+ }
+ BIF_RET(otag);
+ }
+ if (!is_binary(BIF_ARG_1)) {
+ BIF_ERROR(BIF_P,BADARG);
+ }
+ otag = (DT_UTAG(BIF_P) == NIL) ? am_undefined : DT_UTAG(BIF_P);
+ DT_UTAG(BIF_P) = BIF_ARG_1;
+ DT_UTAG_FLAGS(BIF_P) |= DT_UTAG_PERMANENT;
+ if (SEQ_TRACE_TOKEN(BIF_P) == NIL) {
+ SEQ_TRACE_TOKEN(BIF_P) = am_have_dt_utag;
+ }
+ BIF_RET(otag);
+#else
+ BIF_RET(am_undefined);
+#endif
+}
+
+BIF_RETTYPE dt_get_tag_0(BIF_ALIST_0)
+{
+#ifdef USE_VM_PROBES
+ BIF_RET((DT_UTAG(BIF_P) == NIL || !(DT_UTAG_FLAGS(BIF_P) & DT_UTAG_PERMANENT)) ? am_undefined : DT_UTAG(BIF_P));
+#else
+ BIF_RET(am_undefined);
+#endif
+}
+BIF_RETTYPE dt_get_tag_data_0(BIF_ALIST_0)
+{
+#ifdef USE_VM_PROBES
+ BIF_RET((DT_UTAG(BIF_P) == NIL) ? am_undefined : DT_UTAG(BIF_P));
+#else
+ BIF_RET(am_undefined);
+#endif
+}
+BIF_RETTYPE dt_prepend_vm_tag_data_1(BIF_ALIST_1)
+{
+#ifdef USE_VM_PROBES
+ Eterm b;
+ Eterm *hp;
+ hp = HAlloc(BIF_P,2);
+ if (is_binary((DT_UTAG(BIF_P)))) {
+ Uint sz = binary_size(DT_UTAG(BIF_P));
+ int i;
+ unsigned char *p,*q;
+ byte *temp_alloc = NULL;
+ b = new_binary(BIF_P,NULL,sz+1);
+ q = binary_bytes(b);
+ p = erts_get_aligned_binary_bytes(DT_UTAG(BIF_P),&temp_alloc);
+ for(i=0;i<sz;++i) {
+ q[i] = p[i];
+ }
+ erts_free_aligned_binary_bytes(temp_alloc);
+ q[sz] = '\0';
+ } else {
+ b = new_binary(BIF_P,(byte *)"\0",1);
+ }
+ BIF_RET(CONS(hp,b,BIF_ARG_1));
+#else
+ BIF_RET(BIF_ARG_1);
+#endif
+}
+BIF_RETTYPE dt_append_vm_tag_data_1(BIF_ALIST_1)
+{
+#ifdef USE_VM_PROBES
+ Eterm b;
+ Eterm *hp;
+ hp = HAlloc(BIF_P,2);
+ if (is_binary((DT_UTAG(BIF_P)))) {
+ Uint sz = binary_size(DT_UTAG(BIF_P));
+ int i;
+ unsigned char *p,*q;
+ byte *temp_alloc = NULL;
+ b = new_binary(BIF_P,NULL,sz+1);
+ q = binary_bytes(b);
+ p = erts_get_aligned_binary_bytes(DT_UTAG(BIF_P),&temp_alloc);
+ for(i=0;i<sz;++i) {
+ q[i] = p[i];
+ }
+ erts_free_aligned_binary_bytes(temp_alloc);
+ q[sz] = '\0';
+ } else {
+ b = new_binary(BIF_P,(byte *)"\0",1);
+ }
+ BIF_RET(CONS(hp,BIF_ARG_1,b));
+#else
+ BIF_RET(BIF_ARG_1);
+#endif
+}
+BIF_RETTYPE dt_spread_tag_1(BIF_ALIST_1)
+{
+#ifdef USE_VM_PROBES
+ Eterm ret;
+ Eterm *hp;
+#endif
+ if (BIF_ARG_1 != am_true && BIF_ARG_1 != am_false) {
+ BIF_ERROR(BIF_P,BADARG);
+ }
+#ifdef USE_VM_PROBES
+ hp = HAlloc(BIF_P,3);
+ ret = TUPLE2(hp,make_small(DT_UTAG_FLAGS(BIF_P)),DT_UTAG(BIF_P));
+ if (DT_UTAG(BIF_P) != NIL) {
+ if (BIF_ARG_1 == am_true) {
+ DT_UTAG_FLAGS(BIF_P) |= DT_UTAG_SPREADING;
+#ifdef DTRACE_TAG_HARDDEBUG
+ erts_fprintf(stderr,
+ "Dtrace -> (%T) start spreading tag %T\r\n",
+ BIF_P->id,DT_UTAG(BIF_P));
+#endif
+ } else {
+ DT_UTAG_FLAGS(BIF_P) &= ~DT_UTAG_SPREADING;
+#ifdef DTRACE_TAG_HARDDEBUG
+ erts_fprintf(stderr,
+ "Dtrace -> (%T) stop spreading tag %T\r\n",
+ BIF_P->id,DT_UTAG(BIF_P));
+#endif
+ }
+ }
+ BIF_RET(ret);
+#else
+ BIF_RET(am_true);
+#endif
+}
+BIF_RETTYPE dt_restore_tag_1(BIF_ALIST_1)
+{
+#ifdef USE_VM_PROBES
+ Eterm *tpl;
+ Uint x;
+ if (is_not_tuple(BIF_ARG_1)) {
+ BIF_ERROR(BIF_P,BADARG);
+ }
+ tpl = tuple_val(BIF_ARG_1);
+ if(arityval(*tpl) != 2 || is_not_small(tpl[1]) || (is_not_binary(tpl[2]) && tpl[2] != NIL)) {
+ BIF_ERROR(BIF_P,BADARG);
+ }
+ if (tpl[2] == NIL) {
+ if (DT_UTAG(BIF_P) != NIL) {
+#ifdef DTRACE_TAG_HARDDEBUG
+ erts_fprintf(stderr,
+ "Dtrace -> (%T) restore Killing tag!\r\n",
+ BIF_P->id);
+#endif
+ }
+ DT_UTAG(BIF_P) = NIL;
+ if (SEQ_TRACE_TOKEN(BIF_P) == am_have_dt_utag) {
+ SEQ_TRACE_TOKEN(BIF_P) = NIL;
+ }
+ DT_UTAG_FLAGS(BIF_P) = 0;
+ } else {
+ x = unsigned_val(tpl[1]) & (DT_UTAG_SPREADING | DT_UTAG_PERMANENT);
+#ifdef DTRACE_TAG_HARDDEBUG
+
+ if (!(x & DT_UTAG_SPREADING) && (DT_UTAG_FLAGS(BIF_P) &
+ DT_UTAG_SPREADING)) {
+ erts_fprintf(stderr,
+ "Dtrace -> (%T) restore stop spreading "
+ "tag %T\r\n",
+ BIF_P->id, tpl[2]);
+ } else if ((x & DT_UTAG_SPREADING) &&
+ !(DT_UTAG_FLAGS(BIF_P) & DT_UTAG_SPREADING)) {
+ erts_fprintf(stderr,
+ "Dtrace -> (%T) restore start spreading "
+ "tag %T\r\n",BIF_P->id,tpl[2]);
+ }
+#endif
+ DT_UTAG_FLAGS(BIF_P) = x;
+ DT_UTAG(BIF_P) = tpl[2];
+ if (SEQ_TRACE_TOKEN(BIF_P) == NIL) {
+ SEQ_TRACE_TOKEN(BIF_P) = am_have_dt_utag;
+ }
+ }
+#else
+ if (BIF_ARG_1 != am_true) {
+ BIF_ERROR(BIF_P,BADARG);
+ }
+#endif
+ BIF_RET(am_true);
+}
+
+
diff --git a/erts/emulator/beam/bif.h b/erts/emulator/beam/bif.h
index d20089a9fb..7cb2c78815 100644
--- a/erts/emulator/beam/bif.h
+++ b/erts/emulator/beam/bif.h
@@ -125,7 +125,7 @@ do { \
#define ERTS_BIF_PREP_TRAP0(Ret, Trap, Proc) \
do { \
(Proc)->arity = 0; \
- (Proc)->i = (BeamInstr*) ((Trap)->address); \
+ (Proc)->i = (BeamInstr*) ((Trap)->addressv[erts_active_code_ix()]); \
(Proc)->freason = TRAP; \
(Ret) = THE_NON_VALUE; \
} while (0)
@@ -135,7 +135,7 @@ do { \
Eterm* reg = ERTS_PROC_GET_SCHDATA((Proc))->x_reg_array; \
(Proc)->arity = 1; \
reg[0] = (Eterm) (A0); \
- (Proc)->i = (BeamInstr*) ((Trap)->address); \
+ (Proc)->i = (BeamInstr*) ((Trap)->addressv[erts_active_code_ix()]); \
(Proc)->freason = TRAP; \
(Ret) = THE_NON_VALUE; \
} while (0)
@@ -146,7 +146,7 @@ do { \
(Proc)->arity = 2; \
reg[0] = (Eterm) (A0); \
reg[1] = (Eterm) (A1); \
- (Proc)->i = (BeamInstr*) ((Trap)->address); \
+ (Proc)->i = (BeamInstr*) ((Trap)->addressv[erts_active_code_ix()]); \
(Proc)->freason = TRAP; \
(Ret) = THE_NON_VALUE; \
} while (0)
@@ -158,7 +158,7 @@ do { \
reg[0] = (Eterm) (A0); \
reg[1] = (Eterm) (A1); \
reg[2] = (Eterm) (A2); \
- (Proc)->i = (BeamInstr*) ((Trap)->address); \
+ (Proc)->i = (BeamInstr*) ((Trap)->addressv[erts_active_code_ix()]); \
(Proc)->freason = TRAP; \
(Ret) = THE_NON_VALUE; \
} while (0)
@@ -170,13 +170,13 @@ do { \
reg[0] = (Eterm) (A0); \
reg[1] = (Eterm) (A1); \
reg[2] = (Eterm) (A2); \
- (Proc)->i = (BeamInstr*) ((Trap)->address); \
+ (Proc)->i = (BeamInstr*) ((Trap)->addressv[erts_active_code_ix()]); \
(Proc)->freason = TRAP; \
} while (0)
#define BIF_TRAP0(p, Trap_) do { \
(p)->arity = 0; \
- (p)->i = (BeamInstr*) ((Trap_)->address); \
+ (p)->i = (BeamInstr*) ((Trap_)->addressv[erts_active_code_ix()]); \
(p)->freason = TRAP; \
return THE_NON_VALUE; \
} while(0)
@@ -185,7 +185,7 @@ do { \
Eterm* reg = ERTS_PROC_GET_SCHDATA((p))->x_reg_array; \
(p)->arity = 1; \
reg[0] = (A0); \
- (p)->i = (BeamInstr*) ((Trap_)->address); \
+ (p)->i = (BeamInstr*) ((Trap_)->addressv[erts_active_code_ix()]); \
(p)->freason = TRAP; \
return THE_NON_VALUE; \
} while(0)
@@ -195,7 +195,7 @@ do { \
(p)->arity = 2; \
reg[0] = (A0); \
reg[1] = (A1); \
- (p)->i = (BeamInstr*) ((Trap_)->address); \
+ (p)->i = (BeamInstr*) ((Trap_)->addressv[erts_active_code_ix()]); \
(p)->freason = TRAP; \
return THE_NON_VALUE; \
} while(0)
@@ -206,7 +206,7 @@ do { \
reg[0] = (A0); \
reg[1] = (A1); \
reg[2] = (A2); \
- (p)->i = (BeamInstr*) ((Trap_)->address); \
+ (p)->i = (BeamInstr*) ((Trap_)->addressv[erts_active_code_ix()]); \
(p)->freason = TRAP; \
return THE_NON_VALUE; \
} while(0)
diff --git a/erts/emulator/beam/bif.tab b/erts/emulator/beam/bif.tab
index 8cc568b16c..f7dad2767f 100644
--- a/erts/emulator/beam/bif.tab
+++ b/erts/emulator/beam/bif.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -99,8 +99,6 @@ bif erlang:garbage_collect/0
bif 'erl.system':garbage_collect/0 ebif_garbage_collect_0
bif erlang:garbage_collect/1
bif 'erl.system':garbage_collect/1 ebif_garbage_collect_1
-bif erlang:garbage_collect_message_area/0
-bif 'erl.system':garbage_collect_message_area/0 ebif_garbage_collect_message_area_0
bif erlang:get/0
bif 'erl.lang.proc.pdict':get/0 ebif_get_0
bif erlang:get/1
@@ -115,6 +113,8 @@ bif erlang:halt/0
bif 'erl.lang.system':halt/0 ebif_halt_0
bif erlang:halt/1
bif 'erl.lang.system':halt/1 ebif_halt_1
+bif erlang:halt/2
+bif 'erl.lang.system':halt/2 ebif_halt_2
bif erlang:phash/2
bif erlang:phash2/1
bif erlang:phash2/2
@@ -142,8 +142,6 @@ bif erlang:list_to_pid/1
bif 'erl.lang.proc':string_to_pid/1 ebif_string_to_pid_1 list_to_pid_1
bif erlang:list_to_tuple/1
bif 'erl.lang.tuple':from_list/1 ebif_list_to_tuple_1
-bif erlang:load_module/2
-bif 'erl.system.code':load/2 ebif_load_module_2
bif erlang:loaded/0
bif 'erl.system.code':loaded/0 ebif_loaded_0
bif erlang:localtime/0
@@ -812,6 +810,30 @@ bif erlang:check_old_code/1
#
bif erlang:universaltime_to_posixtime/1
bif erlang:posixtime_to_universaltime/1
+
+#
+# New in R15B01
+#
+
+# The dtrace BIF's are always present, but give dummy results if dynamic trace is not enabled in the build
+bif erlang:dt_put_tag/1
+bif erlang:dt_get_tag/0
+bif erlang:dt_get_tag_data/0
+bif erlang:dt_spread_tag/1
+bif erlang:dt_restore_tag/1
+
+# These are dummies even with enabled dynamic trace unless vm probes are enabled.
+# They are also internal, for dtrace tags sent to the VM's own drivers (efile)
+bif erlang:dt_prepend_vm_tag_data/1
+bif erlang:dt_append_vm_tag_data/1
+
+
+#
+# New in R16B.
+#
+bif erlang:prepare_loading/2
+bif erlang:finish_loading/1
+
#
# Obsolete
#
diff --git a/erts/emulator/beam/big.c b/erts/emulator/beam/big.c
index 976f05c990..5a5b162b9c 100644
--- a/erts/emulator/beam/big.c
+++ b/erts/emulator/beam/big.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -1844,6 +1844,7 @@ dsize_t big_bytes(Eterm x)
/*
** Load a bignum from bytes
** xsz is the number of bytes in xp
+** *r is untouched if number fits in small
*/
Eterm bytes_to_big(byte *xp, dsize_t xsz, int xsgn, Eterm *r)
{
@@ -1852,7 +1853,7 @@ Eterm bytes_to_big(byte *xp, dsize_t xsz, int xsgn, Eterm *r)
ErtsDigit d;
int i;
- while(xsz >= sizeof(ErtsDigit)) {
+ while(xsz > sizeof(ErtsDigit)) {
d = 0;
for(i = sizeof(ErtsDigit); --i >= 0;)
d = (d << 8) | xp[i];
@@ -1867,11 +1868,20 @@ Eterm bytes_to_big(byte *xp, dsize_t xsz, int xsgn, Eterm *r)
d = 0;
for(i = xsz; --i >= 0;)
d = (d << 8) | xp[i];
+ if (++rsz == 1 && IS_USMALL(xsgn,d)) {
+ if (xsgn) d = -d;
+ return make_small(d);
+ }
*rwp = d;
rwp++;
- rsz++;
}
- return big_norm(r, rsz, (short) xsgn);
+ if (xsgn) {
+ *r = make_neg_bignum_header(rsz);
+ }
+ else {
+ *r = make_pos_bignum_header(rsz);
+ }
+ return make_big(r);
}
/*
diff --git a/erts/emulator/beam/break.c b/erts/emulator/beam/break.c
index 0d3b6a4dba..376201c309 100644
--- a/erts/emulator/beam/break.c
+++ b/erts/emulator/beam/break.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -71,9 +71,10 @@ process_info(int to, void *to_arg)
{
int i;
for (i = 0; i < erts_max_processes; i++) {
- if ((process_tab[i] != NULL) && (process_tab[i]->i != ENULL)) {
- if (process_tab[i]->status != P_EXITING)
- print_process_info(to, to_arg, process_tab[i]);
+ Process *p = erts_pix2proc(i);
+ if (p && p->i != ENULL) {
+ if (!ERTS_PROC_IS_EXITING(p))
+ print_process_info(to, to_arg, p);
}
}
@@ -89,7 +90,8 @@ process_killer(void)
erts_printf("\n\nProcess Information\n\n");
erts_printf("--------------------------------------------------\n");
for (i = erts_max_processes-1; i >= 0; i--) {
- if (((rp = process_tab[i]) != NULL) && rp->i != ENULL) {
+ rp = erts_pix2proc(i);
+ if (rp && rp->i != ENULL) {
int br;
print_process_info(ERTS_PRINT_STDOUT, NULL, rp);
erts_printf("(k)ill (n)ext (r)eturn:\n");
@@ -97,11 +99,20 @@ process_killer(void)
if ((j = sys_get_key(0)) <= 0)
erl_exit(0, "");
switch(j) {
- case 'k':
- if (rp->status == P_WAITING) {
- ErtsProcLocks rp_locks = ERTS_PROC_LOCKS_XSIG_SEND;
- erts_smp_proc_inc_refc(rp);
- erts_smp_proc_lock(rp, rp_locks);
+ case 'k': {
+ ErtsProcLocks rp_locks = ERTS_PROC_LOCKS_XSIG_SEND;
+ erts_aint32_t state;
+ erts_smp_proc_inc_refc(rp);
+ erts_smp_proc_lock(rp, rp_locks);
+ state = erts_smp_atomic32_read_acqb(&rp->state);
+ if (state & (ERTS_PSFLG_FREE
+ | ERTS_PSFLG_EXITING
+ | ERTS_PSFLG_ACTIVE
+ | ERTS_PSFLG_IN_RUNQ
+ | ERTS_PSFLG_RUNNING)) {
+ erts_printf("Can only kill WAITING processes this way\n");
+ }
+ else {
(void) erts_send_exit_signal(NULL,
NIL,
rp,
@@ -110,12 +121,10 @@ process_killer(void)
NIL,
NULL,
0);
- erts_smp_proc_unlock(rp, rp_locks);
- erts_smp_proc_dec_refc(rp);
}
- else
- erts_printf("Can only kill WAITING processes this way\n");
-
+ erts_smp_proc_unlock(rp, rp_locks);
+ erts_smp_proc_dec_refc(rp);
+ }
case 'n': br = 1; break;
case 'r': return;
default: return;
@@ -180,42 +189,38 @@ static void doit_print_monitor(ErtsMonitor *mon, void *vpcontext)
void
print_process_info(int to, void *to_arg, Process *p)
{
+ time_t approx_started;
int garbing = 0;
int running = 0;
- time_t tmp_t;
struct saved_calls *scb;
+ erts_aint32_t state;
/* display the PID */
erts_print(to, to_arg, "=proc:%T\n", p->id);
/* Display the state */
erts_print(to, to_arg, "State: ");
- switch (p->status) {
- case P_FREE:
+
+ state = erts_smp_atomic32_read_acqb(&p->state);
+ if (state & ERTS_PSFLG_FREE)
erts_print(to, to_arg, "Non Existing\n"); /* Should never happen */
- break;
- case P_RUNABLE:
- erts_print(to, to_arg, "Scheduled\n");
- break;
- case P_WAITING:
- erts_print(to, to_arg, "Waiting\n");
- break;
- case P_SUSPENDED:
- erts_print(to, to_arg, "Suspended\n");
- break;
- case P_RUNNING:
- erts_print(to, to_arg, "Running\n");
- running = 1;
- break;
- case P_EXITING:
+ else if (state & ERTS_PSFLG_EXITING)
erts_print(to, to_arg, "Exiting\n");
- break;
- case P_GARBING:
- erts_print(to, to_arg, "Garbing\n");
+ else if (state & ERTS_PSFLG_GC) {
garbing = 1;
running = 1;
- break;
+ erts_print(to, to_arg, "Garbing\n");
+ }
+ else if (state & ERTS_PSFLG_SUSPENDED)
+ erts_print(to, to_arg, "Suspended\n");
+ else if (state & ERTS_PSFLG_RUNNING) {
+ running = 1;
+ erts_print(to, to_arg, "Running\n");
}
+ else if (state & ERTS_PSFLG_ACTIVE)
+ erts_print(to, to_arg, "Scheduled\n");
+ else
+ erts_print(to, to_arg, "Waiting\n");
/*
* If the process is registered as a global process, display the
@@ -245,8 +250,8 @@ print_process_info(int to, void *to_arg, Process *p)
}
erts_print(to, to_arg, "Spawned by: %T\n", p->parent);
- tmp_t = p->started.tv_sec;
- erts_print(to, to_arg, "Started: %s", ctime(&tmp_t));
+ approx_started = (time_t) p->approx_started;
+ erts_print(to, to_arg, "Started: %s", ctime(&approx_started));
ERTS_SMP_MSGQ_MV_INQ2PRIVQ(p);
erts_print(to, to_arg, "Message queue length: %d\n", p->msg.len);
@@ -377,17 +382,22 @@ loaded(int to, void *to_arg)
int old = 0;
int cur = 0;
BeamInstr* code;
+ Module* modp;
+ ErtsCodeIndex code_ix;
+
+ code_ix = erts_active_code_ix();
+ erts_rlock_old_code(code_ix);
/*
* Calculate and print totals.
*/
- for (i = 0; i < module_code_size(); i++) {
- if (module_code(i) != NULL &&
- ((module_code(i)->code_length != 0) ||
- (module_code(i)->old_code_length != 0))) {
- cur += module_code(i)->code_length;
- if (module_code(i)->old_code_length != 0) {
- old += module_code(i)->old_code_length;
+ for (i = 0; i < module_code_size(code_ix); i++) {
+ if ((modp = module_code(i, code_ix)) != NULL &&
+ ((modp->curr.code_length != 0) ||
+ (modp->old.code_length != 0))) {
+ cur += modp->curr.code_length;
+ if (modp->old.code_length != 0) {
+ old += modp->old.code_length;
}
}
}
@@ -398,21 +408,22 @@ loaded(int to, void *to_arg)
* Print one line per module.
*/
- for (i = 0; i < module_code_size(); i++) {
+ for (i = 0; i < module_code_size(code_ix); i++) {
+ modp = module_code(i, code_ix);
if (!ERTS_IS_CRASH_DUMPING) {
/*
* Interactive dump; keep it brief.
*/
- if (module_code(i) != NULL &&
- ((module_code(i)->code_length != 0) ||
- (module_code(i)->old_code_length != 0))) {
- erts_print(to, to_arg, "%T", make_atom(module_code(i)->module));
- cur += module_code(i)->code_length;
- erts_print(to, to_arg, " %d", module_code(i)->code_length );
- if (module_code(i)->old_code_length != 0) {
+ if (modp != NULL &&
+ ((modp->curr.code_length != 0) ||
+ (modp->old.code_length != 0))) {
+ erts_print(to, to_arg, "%T", make_atom(modp->module));
+ cur += modp->curr.code_length;
+ erts_print(to, to_arg, " %d", modp->curr.code_length );
+ if (modp->old.code_length != 0) {
erts_print(to, to_arg, " (%d old)",
- module_code(i)->old_code_length );
- old += module_code(i)->old_code_length;
+ modp->old.code_length );
+ old += modp->old.code_length;
}
erts_print(to, to_arg, "\n");
}
@@ -420,15 +431,15 @@ loaded(int to, void *to_arg)
/*
* To crash dump; make it parseable.
*/
- if (module_code(i) != NULL &&
- ((module_code(i)->code_length != 0) ||
- (module_code(i)->old_code_length != 0))) {
+ if (modp != NULL &&
+ ((modp->curr.code_length != 0) ||
+ (modp->old.code_length != 0))) {
erts_print(to, to_arg, "=mod:");
- erts_print(to, to_arg, "%T", make_atom(module_code(i)->module));
+ erts_print(to, to_arg, "%T", make_atom(modp->module));
erts_print(to, to_arg, "\n");
erts_print(to, to_arg, "Current size: %d\n",
- module_code(i)->code_length);
- code = module_code(i)->code;
+ modp->curr.code_length);
+ code = modp->curr.code;
if (code != NULL && code[MI_ATTR_PTR]) {
erts_print(to, to_arg, "Current attributes: ");
dump_attributes(to, to_arg, (byte *) code[MI_ATTR_PTR],
@@ -440,9 +451,9 @@ loaded(int to, void *to_arg)
code[MI_COMPILE_SIZE]);
}
- if (module_code(i)->old_code_length != 0) {
- erts_print(to, to_arg, "Old size: %d\n", module_code(i)->old_code_length);
- code = module_code(i)->old_code;
+ if (modp->old.code_length != 0) {
+ erts_print(to, to_arg, "Old size: %d\n", modp->old.code_length);
+ code = modp->old.code;
if (code[MI_ATTR_PTR]) {
erts_print(to, to_arg, "Old attributes: ");
dump_attributes(to, to_arg, (byte *) code[MI_ATTR_PTR],
@@ -457,6 +468,7 @@ loaded(int to, void *to_arg)
}
}
}
+ erts_runlock_old_code(code_ix);
}
@@ -616,7 +628,8 @@ bin_check(void)
int i, printed = 0;
for (i=0; i < erts_max_processes; i++) {
- if ((rp = process_tab[i]) == NULL)
+ rp = erts_pix2proc(i);
+ if (!rp)
continue;
for (hdr = rp->off_heap.first; hdr; hdr = hdr->next) {
if (hdr->thing_word == HEADER_PROC_BIN) {
@@ -646,6 +659,9 @@ bin_check(void)
void
erl_crash_dump_v(char *file, int line, char* fmt, va_list args)
{
+#ifdef ERTS_SMP
+ ErtsThrPrgrData tpd_buf; /* in case we aren't a managed thread... */
+#endif
int fd;
time_t now;
size_t dumpnamebufsize = MAXPATHLEN;
@@ -663,7 +679,7 @@ erl_crash_dump_v(char *file, int line, char* fmt, va_list args)
* We do not release system again. We expect an exit() or abort() after
* dump has been written.
*/
- erts_thr_progress_fatal_error_block(60000);
+ erts_thr_progress_fatal_error_block(60000, &tpd_buf);
/* Either worked or not... */
/* Allow us to pass certain places without locking... */
@@ -675,7 +691,7 @@ erl_crash_dump_v(char *file, int line, char* fmt, va_list args)
erts_sys_prepare_crash_dump();
- if (erts_sys_getenv("ERL_CRASH_DUMP",&dumpnamebuf[0],&dumpnamebufsize) != 0)
+ if (erts_sys_getenv_raw("ERL_CRASH_DUMP",&dumpnamebuf[0],&dumpnamebufsize) != 0)
dumpname = "erl_crash.dump";
else
dumpname = &dumpnamebuf[0];
@@ -701,7 +717,7 @@ erl_crash_dump_v(char *file, int line, char* fmt, va_list args)
erts_print_nif_taints(fd, NULL);
erts_fdprintf(fd, "Atoms: %d\n", atom_table_size());
info(fd, NULL); /* General system info */
- if (process_tab != NULL) /* XXX true at init */
+ if (erts_proc.tab)
process_info(fd, NULL); /* Info about each process and port */
db_info(fd, NULL, 0);
erts_print_bif_timer_info(fd, NULL);
diff --git a/erts/emulator/beam/code_ix.c b/erts/emulator/beam/code_ix.c
new file mode 100644
index 0000000000..8025058ee0
--- /dev/null
+++ b/erts/emulator/beam/code_ix.c
@@ -0,0 +1,166 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Ericsson AB 2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "code_ix.h"
+#include "global.h"
+#include "beam_catches.h"
+
+
+
+#if 0
+# define CIX_TRACE(text) erts_fprintf(stderr, "CIX_TRACE: " text " act=%u load=%u\r\n", erts_active_code_ix(), erts_staging_code_ix())
+#else
+# define CIX_TRACE(text)
+#endif
+
+erts_smp_atomic32_t the_active_code_index;
+erts_smp_atomic32_t the_staging_code_index;
+
+static int the_code_ix_lock = 0;
+struct code_ix_queue_item {
+ Process *p;
+ struct code_ix_queue_item* next;
+};
+static struct code_ix_queue_item* the_code_ix_queue = NULL;
+static erts_smp_mtx_t the_code_ix_queue_lock;
+
+#ifdef ERTS_ENABLE_LOCK_CHECK
+static erts_tsd_key_t has_code_write_permission;
+#endif
+
+void erts_code_ix_init(void)
+{
+ /* We start emulator by initializing preloaded modules
+ * single threaded with active and staging set both to zero.
+ * Preloading is finished by a commit that will set things straight.
+ */
+ erts_smp_atomic32_init_nob(&the_active_code_index, 0);
+ erts_smp_atomic32_init_nob(&the_staging_code_index, 0);
+ erts_smp_mtx_init(&the_code_ix_queue_lock, "code_ix_queue");
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ erts_tsd_key_create(&has_code_write_permission);
+#endif
+ CIX_TRACE("init");
+}
+
+void erts_start_staging_code_ix(void)
+{
+ beam_catches_start_staging();
+ export_start_staging();
+ module_start_staging();
+ erts_start_staging_ranges();
+ CIX_TRACE("start");
+}
+
+
+void erts_end_staging_code_ix(void)
+{
+ beam_catches_end_staging(1);
+ export_end_staging(1);
+ module_end_staging(1);
+ erts_end_staging_ranges(1);
+ CIX_TRACE("end");
+}
+
+void erts_commit_staging_code_ix(void)
+{
+ ErtsCodeIndex ix;
+ /* We need to this lock as we are now making the staging export table active */
+ export_staging_lock();
+ ix = erts_staging_code_ix();
+ erts_smp_atomic32_set_nob(&the_active_code_index, ix);
+ ix = (ix + 1) % ERTS_NUM_CODE_IX;
+ erts_smp_atomic32_set_nob(&the_staging_code_index, ix);
+ export_staging_unlock();
+ CIX_TRACE("activate");
+}
+
+void erts_abort_staging_code_ix(void)
+{
+ beam_catches_end_staging(0);
+ export_end_staging(0);
+ module_end_staging(0);
+ erts_end_staging_ranges(0);
+ CIX_TRACE("abort");
+}
+
+
+/*
+ * Calller _must_ yield if we return 0
+ */
+int erts_try_seize_code_write_permission(Process* c_p)
+{
+ int success;
+#ifdef ERTS_SMP
+ ASSERT(!erts_smp_thr_progress_is_blocking()); /* to avoid deadlock */
+#endif
+
+ erts_smp_mtx_lock(&the_code_ix_queue_lock);
+ success = !the_code_ix_lock;
+ if (success) {
+ the_code_ix_lock = 1;
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ erts_tsd_set(has_code_write_permission, (void *) 1);
+#endif
+ }
+ else { /* Already locked */
+ struct code_ix_queue_item* qitem;
+ qitem = erts_alloc(ERTS_ALC_T_CODE_IX_LOCK_Q, sizeof(*qitem));
+ qitem->p = c_p;
+ erts_smp_proc_inc_refc(c_p);
+ qitem->next = the_code_ix_queue;
+ the_code_ix_queue = qitem;
+ erts_suspend(c_p, ERTS_PROC_LOCK_MAIN, NULL);
+ }
+ erts_smp_mtx_unlock(&the_code_ix_queue_lock);
+ return success;
+}
+
+void erts_release_code_write_permission(void)
+{
+ ERTS_SMP_LC_ASSERT(erts_is_code_ix_locked());
+ erts_smp_mtx_lock(&the_code_ix_queue_lock);
+ while (the_code_ix_queue != NULL) { /* unleash the entire herd */
+ struct code_ix_queue_item* qitem = the_code_ix_queue;
+ erts_smp_proc_lock(qitem->p, ERTS_PROC_LOCK_STATUS);
+ if (!ERTS_PROC_IS_EXITING(qitem->p)) {
+ erts_resume(qitem->p, ERTS_PROC_LOCK_STATUS);
+ }
+ erts_smp_proc_unlock(qitem->p, ERTS_PROC_LOCK_STATUS);
+ the_code_ix_queue = qitem->next;
+ erts_smp_proc_dec_refc(qitem->p);
+ erts_free(ERTS_ALC_T_CODE_IX_LOCK_Q, qitem);
+ }
+ the_code_ix_lock = 0;
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ erts_tsd_set(has_code_write_permission, (void *) 0);
+#endif
+ erts_smp_mtx_unlock(&the_code_ix_queue_lock);
+}
+
+#ifdef ERTS_ENABLE_LOCK_CHECK
+int erts_is_code_ix_locked(void)
+{
+ return the_code_ix_lock && erts_tsd_get(has_code_write_permission);
+}
+#endif
diff --git a/erts/emulator/beam/code_ix.h b/erts/emulator/beam/code_ix.h
new file mode 100644
index 0000000000..6b2680044e
--- /dev/null
+++ b/erts/emulator/beam/code_ix.h
@@ -0,0 +1,141 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Ericsson AB 2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+/* Description:
+ * This is the interface that facilitate changing the beam code
+ * (load,upgrade,delete) while allowing executing Erlang processes to
+ * access the code without any locks or other expensive memory barriers.
+ *
+ * The basic idea is to maintain several "logical copies" of the code. These
+ * copies are identified by a global 'code index', an integer of 0, 1 or 2.
+ * The code index is used as argument to code access structures like
+ * export, module, beam_catches, beam_ranges.
+ *
+ * The current 'active' code index is used to access the current running
+ * code. The 'staging' code index is used by the process that performs
+ * a code change operation. When a code change operation completes
+ * succesfully, the staging code index becomes the new active code index.
+ *
+ * The third code index is not explicitly used. It can be thought of as
+ * the "previous active" or the "next staging" index. It is needed to make
+ * sure that we do not reuse a code index for staging until we are sure
+ * that no executing BIFs are still referring it.
+ * We could get by with only two (0 and 1), but that would require that we
+ * must wait for all schedulers to re-schedule before each code change
+ * operation can start staging.
+ *
+ * Note that the 'code index' is very loosely coupled to the concept of
+ * 'current' and 'old' module versions. You can almost say that they are
+ * orthogonal to each other. Code index is an emulator global concept while
+ * 'current' and 'old' is specific for each module.
+ */
+
+#ifndef __CODE_IX_H__
+#define __CODE_IX_H__
+
+#ifndef __SYS_H__
+# ifdef HAVE_CONFIG_H
+# include "config.h"
+# endif
+# include "sys.h"
+#endif
+struct process;
+
+
+#define ERTS_NUM_CODE_IX 3
+typedef unsigned ErtsCodeIndex;
+
+
+/* Called once at emulator initialization.
+ */
+void erts_code_ix_init(void);
+
+/* Return active code index.
+ * Is guaranteed to be valid until the calling BIF returns.
+ * To get a consistent view of the code, only one call to erts_active_code_ix()
+ * should be made and the returned ix reused within the same BIF call.
+ */
+ERTS_GLB_INLINE
+ErtsCodeIndex erts_active_code_ix(void);
+
+/* Return staging code ix.
+ * Only used by a process performing code loading/upgrading/deleting/purging.
+ * code_ix must be locked.
+ */
+ERTS_GLB_INLINE
+ErtsCodeIndex erts_staging_code_ix(void);
+
+/* Try seize exclusive code write permission. Needed for code staging.
+ * Main process lock (only) must be held.
+ * System thread progress must not be blocked.
+ * Caller is suspended and *must* yield if 0 is returned.
+ */
+int erts_try_seize_code_write_permission(struct process*);
+
+/* Release code write permission.
+ * Will resume any suspended waiters.
+ */
+void erts_release_code_write_permission(void);
+
+/* Prepare the "staging area" to be a complete copy of the active code.
+ * Code write permission must have been seized.
+ * Must be followed by calls to either "end" and "commit" or "abort" before
+ * code write permission can be released.
+ */
+void erts_start_staging_code_ix(void);
+
+/* End the staging.
+ * Preceded by "start" and must be followed by "commit".
+ */
+void erts_end_staging_code_ix(void);
+
+/* Set staging code index as new active code index.
+ * Preceded by "end".
+ */
+void erts_commit_staging_code_ix(void);
+
+/* Abort the staging.
+ * Preceded by "start".
+ */
+void erts_abort_staging_code_ix(void);
+
+#ifdef ERTS_ENABLE_LOCK_CHECK
+int erts_is_code_ix_locked(void);
+#endif
+
+
+
+#if ERTS_GLB_INLINE_INCL_FUNC_DEF
+
+extern erts_smp_atomic32_t the_active_code_index;
+extern erts_smp_atomic32_t the_staging_code_index;
+
+ERTS_GLB_INLINE ErtsCodeIndex erts_active_code_ix(void)
+{
+ return erts_smp_atomic32_read_nob(&the_active_code_index);
+}
+ERTS_GLB_INLINE ErtsCodeIndex erts_staging_code_ix(void)
+{
+ return erts_smp_atomic32_read_nob(&the_staging_code_index);
+}
+
+#endif /* ERTS_GLB_INLINE_INCL_FUNC_DEF */
+
+#endif /* !__CODE_IX_H__ */
+
diff --git a/erts/emulator/beam/copy.c b/erts/emulator/beam/copy.c
index 1d968fb147..36eda04de2 100644
--- a/erts/emulator/beam/copy.c
+++ b/erts/emulator/beam/copy.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -26,29 +26,13 @@
#include "global.h"
#include "erl_process.h"
#include "erl_gc.h"
-#include "erl_nmgc.h"
#include "big.h"
#include "erl_binary.h"
#include "erl_bits.h"
-
-#ifdef HYBRID
-MA_STACK_DECLARE(src);
-MA_STACK_DECLARE(dst);
-MA_STACK_DECLARE(offset);
-#endif
+#include "dtrace-wrapper.h"
static void move_one_frag(Eterm** hpp, Eterm* src, Uint src_sz, ErlOffHeap*);
-void
-init_copy(void)
-{
-#ifdef HYBRID
- MA_STACK_ALLOC(src);
- MA_STACK_ALLOC(dst);
- MA_STACK_ALLOC(offset);
-#endif
-}
-
/*
* Copy object "obj" to process p.
*/
@@ -59,6 +43,14 @@ copy_object(Eterm obj, Process* to)
Eterm* hp = HAlloc(to, size);
Eterm res;
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(copy_object)) {
+ DTRACE_CHARBUF(proc_name, 64);
+
+ erts_snprintf(proc_name, sizeof(proc_name), "%T", to->id);
+ DTRACE2(copy_object, proc_name, size);
+ }
+#endif
res = copy_struct(obj, size, &hp, &to->off_heap);
#ifdef DEBUG
if (eq(obj, res) == 0) {
@@ -213,6 +205,8 @@ Eterm copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap)
if (IS_CONST(obj))
return obj;
+ DTRACE1(copy_struct, (int32_t)sz);
+
hp = htop = *hpp;
hbot = htop + sz;
hstart = (char *)htop;
@@ -421,12 +415,10 @@ Eterm copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap)
while (i--) {
*htop++ = *objp++;
}
-#ifndef HYBRID /* FIND ME! */
funp = (ErlFunThing *) tp;
funp->next = off_heap->first;
off_heap->first = (struct erl_off_heap_header*) funp;
erts_refc_inc(&funp->fe->refc, 2);
-#endif
*argp = make_fun_rel(tp, dst_base);
}
break;
@@ -489,420 +481,6 @@ Eterm copy_struct(Eterm obj, Uint sz, Eterm** hpp, ErlOffHeap* off_heap)
return res;
}
-#ifdef HYBRID
-
-#ifdef BM_MESSAGE_SIZES
-# define BM_ADD(var,val) (var) += (val);
-#else
-# define BM_ADD(var,val)
-#endif
-
-#ifdef DEBUG
-# define CLEARMEM(PTR,SIZE) memset(PTR,0,SIZE*sizeof(Eterm))
-#else
-# define CLEARMEM(PTR,SIZE)
-#endif
-
-#ifdef INCREMENTAL
-#define GlobalAlloc(p, need, hp) \
-do { \
- Uint n = (need); \
- BM_ADD(words_copied,n); \
- BM_SWAP_TIMER(copy,system); \
- /* If a new collection cycle is started during copy, the message * \
- * will end up in the old generation and all allocations * \
- * thereafter must go directly into the old generation. */ \
- if (alloc_old) { \
- erts_incremental_gc((p),n,&dest,1); \
- (hp) = erts_inc_alloc(n); \
- } else { \
- (hp) = IncAlloc((p),n,&dest,1); \
- if (ma_gc_flags & GC_CYCLE_START) { \
- alloc_old = 1; \
- global_htop = global_heap; \
- (hp) = erts_inc_alloc(n); \
- } \
- } \
- CLEARMEM((hp),(n)); \
- BM_SWAP_TIMER(system,copy); \
-} while(0)
-
-#else /* no INCREMELNTAL */
-
-#define GlobalAlloc(p, need, hp) \
-do { \
- Uint n = (need); \
- total_need += n; \
- if (total_need >= global_heap_sz) \
- erl_exit(ERTS_ABORT_EXIT, "Copying a message (%d words) larger than the nursery simply won't work...\n", total_need); \
- if (global_hend - n < global_htop) { \
- BM_SWAP_TIMER(copy,system); \
- erts_global_garbage_collect((p),total_need,NULL,0); \
- BM_SWAP_TIMER(system,copy); \
- total_need = 0; \
- ma_src_top = 0; \
- ma_dst_top = 0; \
- ma_offset_top = 0; \
- goto copy_start; \
- } \
- (hp) = global_htop; \
- global_htop += n; \
- BM_ADD(words_copied,n); \
-} while(0)
-#endif /* INCREMENTAL */
-
-/* Copy a message to the message area. */
-Eterm copy_struct_lazy(Process *from, Eterm orig, Uint offs)
-{
- Eterm obj;
- Eterm dest;
-#ifdef INCREMENTAL
- int alloc_old = 0;
-#else
- int total_need = 0;
-#endif
-
- VERBOSE(DEBUG_MESSAGES,
- ("COPY START; %T is sending a message @ 0x%016x\n%T\n",
- from->id, orig, orig));
-
-#ifndef INCREMENTAL
- copy_start:
-#endif
- MA_STACK_PUSH(src,orig);
- MA_STACK_PUSH(dst,&dest);
- MA_STACK_PUSH(offset,offs);
-
- while (ma_src_top > 0) {
- obj = MA_STACK_POP(src);
-
- /* copy_struct_lazy should never be called with something that
- * do not need to be copied. Within the loop, nothing that do
- * not need copying should be placed in the src-stack.
- */
- ASSERT(!NO_COPY(obj));
-
- switch (primary_tag(obj)) {
- case TAG_PRIMARY_LIST: {
- Eterm *hp;
- Eterm *objp;
-
- GlobalAlloc(from,2,hp);
- objp = list_val(obj);
-
- MA_STACK_UPDATE(dst,MA_STACK_POP(offset),make_list(hp));
- MA_STACK_POP(dst);
-
- /* TODO: Byt ordningen nedan så att CDR pushas först. */
-
- if (NO_COPY(*objp)) {
- hp[0] = *objp;
-#ifdef INCREMENTAL
- if (ptr_within(ptr_val(*objp),inc_fromspc,inc_fromend))
- INC_STORE(gray,hp,2);
-#endif
- } else {
- MA_STACK_PUSH(src,*objp);
- MA_STACK_PUSH(dst,hp);
- MA_STACK_PUSH(offset,0);
- }
-
- objp++;
-
- if (NO_COPY(*objp)) {
- hp[1] = *objp;
-#ifdef INCREMENTAL
- if (ptr_within(ptr_val(*objp),inc_fromspc,inc_fromend))
- INC_STORE(gray,hp,2);
-#endif
- }
- else {
- MA_STACK_PUSH(src,*objp);
- MA_STACK_PUSH(dst,hp);
- MA_STACK_PUSH(offset,1);
- }
- continue;
- }
-
- case TAG_PRIMARY_BOXED: {
- Eterm *objp = boxed_val(obj);
-
- switch (*objp & _TAG_HEADER_MASK) {
- case ARITYVAL_SUBTAG: {
- Uint ari = arityval(*objp);
- Uint i;
- Eterm *hp;
- GlobalAlloc(from,ari + 1,hp);
- /* A GC above might invalidate the value of objp */
- objp = boxed_val(obj);
- MA_STACK_UPDATE(dst,MA_STACK_POP(offset),make_tuple(hp));
- MA_STACK_POP(dst);
- *hp = *objp++;
- for (i = 1; i <= ari; i++) {
- switch (primary_tag(*objp)) {
- case TAG_PRIMARY_LIST:
- case TAG_PRIMARY_BOXED:
- if (NO_COPY(*objp)) {
- hp[i] = *objp;
-#ifdef INCREMENTAL
- if (ptr_within(ptr_val(*objp),
- inc_fromspc,inc_fromend))
- INC_STORE(gray,hp,BOXED_NEED(hp,*hp));
-#endif
- objp++;
- } else {
- MA_STACK_PUSH(src,*objp++);
- MA_STACK_PUSH(dst,hp);
- MA_STACK_PUSH(offset,i);
- }
- break;
- default:
- hp[i] = *objp++;
- }
- }
- continue;
- }
-
- case REFC_BINARY_SUBTAG: {
- ProcBin *pb;
- Uint i = thing_arityval(*objp) + 1;
- Eterm *hp;
- GlobalAlloc(from,i,hp);
- /* A GC above might invalidate the value of objp */
- objp = boxed_val(obj);
- MA_STACK_UPDATE(dst,MA_STACK_POP(offset),make_binary(hp));
- MA_STACK_POP(dst);
- pb = (ProcBin*) hp;
- while (i--) {
- *hp++ = *objp++;
- }
- erts_refc_inc(&pb->val->refc, 2);
- pb->next = erts_global_offheap.first;
- erts_global_offheap.first = pb;
- OH_OVERHEAD(off_heap, pb->size / sizeof(Eterm));
- continue;
- }
-
- case FUN_SUBTAG: {
- ErlFunThing *funp = (ErlFunThing*) objp;
- Uint i = thing_arityval(*objp) + 1;
- Uint j = i + 1 + funp->num_free;
- Uint k = i;
- Eterm *hp, *hp_start;
- GlobalAlloc(from,j,hp);
- /* A GC above might invalidate the value of objp */
- objp = boxed_val(obj);
- hp_start = hp;
- MA_STACK_UPDATE(dst,MA_STACK_POP(offset),make_fun(hp));
- MA_STACK_POP(dst);
- funp = (ErlFunThing*) hp;
- while (i--) {
- *hp++ = *objp++;
- }
-#ifndef HYBRID /* FIND ME! */
- funp->next = erts_global_offheap.first;
- erts_global_offheap.first = funp;
- erts_refc_inc(&funp->fe->refc, 2);
-#endif
- for (i = k; i < j; i++) {
- switch (primary_tag(*objp)) {
- case TAG_PRIMARY_LIST:
- case TAG_PRIMARY_BOXED:
- if (NO_COPY(*objp)) {
-#ifdef INCREMENTAL
- if (ptr_within(ptr_val(*objp),
- inc_fromspc,inc_fromend))
- INC_STORE(gray,hp,BOXED_NEED(hp,*hp));
-#endif
- *hp++ = *objp++;
- } else {
- MA_STACK_PUSH(src,*objp++);
- MA_STACK_PUSH(dst,hp_start);
- MA_STACK_PUSH(offset,i);
- hp++;
- }
- break;
- default:
- *hp++ = *objp++;
- }
- }
- continue;
- }
-
- case EXTERNAL_PID_SUBTAG:
- case EXTERNAL_PORT_SUBTAG:
- case EXTERNAL_REF_SUBTAG: {
- ExternalThing *etp;
- Uint i = thing_arityval(*objp) + 1;
- Eterm *hp;
- GlobalAlloc(from,i,hp);
- /* A GC above might invalidate the value of objp */
- objp = boxed_val(obj);
- MA_STACK_UPDATE(dst,MA_STACK_POP(offset),make_external(hp));
- MA_STACK_POP(dst);
- etp = (ExternalThing*) hp;
- while (i--) {
- *hp++ = *objp++;
- }
-
- etp->next = erts_global_offheap.first;
- erts_global_offheap.first = etp;
- erts_refc_inc(&etp->node->refc, 2);
- continue;
- }
-
- case SUB_BINARY_SUBTAG: {
- ErlSubBin *sb = (ErlSubBin *) objp;
- Eterm *hp;
- Eterm res_binary;
- Eterm real_bin = sb->orig;
- Uint bit_offset = sb->bitoffs;
- Uint bit_size = sb -> bitsize;
- Uint sub_offset = sb->offs;
- size_t size = sb->size;
- Uint extra_bytes;
- Uint real_size;
- Uint sub_binary_heapneed;
- if ((bit_size + bit_offset) > 8) {
- extra_bytes = 2;
- sub_binary_heapneed = ERL_SUB_BIN_SIZE;
- } else if ((bit_size + bit_offset) > 0) {
- extra_bytes = 1;
- sub_binary_heapneed = ERL_SUB_BIN_SIZE;
- } else {
- extra_bytes = 0;
- sub_binary_heapneed = 0;
- }
-
- real_size = size+extra_bytes;
- objp = binary_val(real_bin);
- if (thing_subtag(*objp) == HEAP_BINARY_SUBTAG) {
- ErlHeapBin *from_bin;
- ErlHeapBin *to_bin;
- Uint i = heap_bin_size(real_size);
- GlobalAlloc(from,i+sub_binary_heapneed,hp);
- from_bin = (ErlHeapBin *) objp;
- to_bin = (ErlHeapBin *) hp;
- to_bin->thing_word = header_heap_bin(real_size);
- to_bin->size = real_size;
- sys_memcpy(to_bin->data, ((byte *)from_bin->data) +
- sub_offset, real_size);
- res_binary = make_binary(to_bin);
- hp += i;
- } else {
- ProcBin *from_bin;
- ProcBin *to_bin;
-
- ASSERT(thing_subtag(*objp) == REFC_BINARY_SUBTAG);
- from_bin = (ProcBin *) objp;
- erts_refc_inc(&from_bin->val->refc, 2);
- GlobalAlloc(from,PROC_BIN_SIZE+sub_binary_heapneed,hp);
- to_bin = (ProcBin *) hp;
- to_bin->thing_word = HEADER_PROC_BIN;
- to_bin->size = real_size;
- to_bin->val = from_bin->val;
- to_bin->bytes = from_bin->bytes + sub_offset;
- to_bin->next = erts_global_offheap.first;
- erts_global_offheap.first = to_bin;
- OH_OVERHEAD(&erts_global_offheap, to_bin->size / sizeof(Eterm));
- res_binary=make_binary(to_bin);
- hp += PROC_BIN_SIZE;
- }
- if (extra_bytes != 0) {
- ErlSubBin* res;
- res = (ErlSubBin *) hp;
- res->thing_word = HEADER_SUB_BIN;
- res->size = size;
- res->bitsize = bit_size;
- res->bitoffs = bit_offset;
- res->offs = 0;
- res->is_writable = 0;
- res->orig = res_binary;
- res_binary = make_binary(hp);
- }
- MA_STACK_UPDATE(dst,MA_STACK_POP(offset),res_binary);
- MA_STACK_POP(dst);
- continue;
- }
-
- case BIN_MATCHSTATE_SUBTAG:
- erl_exit(ERTS_ABORT_EXIT,
- "copy_struct_lazy: matchstate term not allowed");
-
- default: {
- Uint size = thing_arityval(*objp) + 1;
- Eterm *hp;
- GlobalAlloc(from,size,hp);
- /* A GC above might invalidate the value of objp */
- objp = boxed_val(obj);
- MA_STACK_UPDATE(dst,MA_STACK_POP(offset),make_boxed(hp));
- MA_STACK_POP(dst);
- while (size--) {
- *hp++ = *objp++;
- }
- continue;
- }
- }
- continue;
- }
-
- case TAG_PRIMARY_HEADER:
- ASSERT((obj & _TAG_HEADER_MASK) == ARITYVAL_SUBTAG);
- {
- Eterm *objp = &obj;
- Uint ari = arityval(obj);
- Uint i;
- Eterm *hp;
- GlobalAlloc(from,ari + 1,hp);
- MA_STACK_UPDATE(dst,MA_STACK_POP(offset),make_tuple(hp));
- MA_STACK_POP(dst);
- *hp = *objp++;
- for (i = 1; i <= ari; i++) {
- switch (primary_tag(*objp)) {
- case TAG_PRIMARY_LIST:
- case TAG_PRIMARY_BOXED:
- if (NO_COPY(*objp)) {
-#ifdef INCREMENTAL
- if (ptr_within(ptr_val(*objp),inc_fromspc,inc_fromend))
- INC_STORE(gray,hp,ari + 1);
-#endif
- hp[i] = *objp++;
- } else {
- MA_STACK_PUSH(src,*objp++);
- MA_STACK_PUSH(dst,hp);
- MA_STACK_PUSH(offset,i);
- }
- break;
- default:
- hp[i] = *objp++;
- }
- }
- continue;
- }
-
- default:
- erl_exit(ERTS_ABORT_EXIT,
- "%s, line %d: Internal error in copy_struct_lazy: 0x%08x\n",
- __FILE__, __LINE__,obj);
- }
- }
-
- VERBOSE(DEBUG_MESSAGES,
- ("Copy allocated @ 0x%08lx:\n%T\n",
- (unsigned long)ptr_val(dest),dest));
-
- ma_gc_flags &= ~GC_CYCLE_START;
-
- ASSERT(eq(orig, dest));
- ASSERT(ma_src_top == 0);
- ASSERT(ma_dst_top == 0);
- ASSERT(ma_offset_top == 0);
- return dest;
-}
-
-#undef NO_COPY
-#endif /* HYBRID */
-
/*
* Copy a term that is guaranteed to be contained in a single
* heap block. The heap block is copied word by word, and any
diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c
index bee61e7273..28c4621ff2 100644
--- a/erts/emulator/beam/dist.c
+++ b/erts/emulator/beam/dist.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -42,6 +42,7 @@
#include "external.h"
#include "erl_binary.h"
#include "erl_thr_progress.h"
+#include "dtrace-wrapper.h"
/* Turn this on to get printouts of all distribution messages
* which go on the line
@@ -381,7 +382,11 @@ static void doit_node_link_net_exits(ErtsLink *lnk, void *vnecp)
Eterm tup;
Eterm *hp = erts_alloc_message_heap(3,&bp,&ohp,rp,&rp_locks);
tup = TUPLE2(hp, am_nodedown, name);
- erts_queue_message(rp, &rp_locks, bp, tup, NIL);
+ erts_queue_message(rp, &rp_locks, bp, tup, NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
}
erts_smp_proc_unlock(rp, rp_locks);
}
@@ -740,19 +745,50 @@ erts_dsig_send_msg(ErtsDSigData *dsdp, Eterm remote, Eterm message)
Eterm token = NIL;
Process *sender = dsdp->proc;
int res;
+#ifdef USE_VM_PROBES
+ Sint tok_label = 0;
+ Sint tok_lastcnt = 0;
+ Sint tok_serial = 0;
+ Uint msize = 0;
+ DTRACE_CHARBUF(node_name, 64);
+ DTRACE_CHARBUF(sender_name, 64);
+ DTRACE_CHARBUF(receiver_name, 64);
+#endif
UseTmpHeapNoproc(5);
- if (SEQ_TRACE_TOKEN(sender) != NIL) {
+ if (SEQ_TRACE_TOKEN(sender) != NIL
+#ifdef USE_VM_PROBES
+ && SEQ_TRACE_TOKEN(sender) != am_have_dt_utag
+#endif
+ ) {
seq_trace_update_send(sender);
token = SEQ_TRACE_TOKEN(sender);
seq_trace_output(token, message, SEQ_TRACE_SEND, remote, sender);
}
+#ifdef USE_VM_PROBES
+ *node_name = *sender_name = *receiver_name = '\0';
+ if (DTRACE_ENABLED(message_send) || DTRACE_ENABLED(message_send_remote)) {
+ erts_snprintf(node_name, sizeof(node_name), "%T", dsdp->dep->sysname);
+ erts_snprintf(sender_name, sizeof(sender_name), "%T", sender->id);
+ erts_snprintf(receiver_name, sizeof(receiver_name), "%T", remote);
+ msize = size_object(message);
+ if (token != NIL && token != am_have_dt_utag) {
+ tok_label = signed_val(SEQ_TRACE_T_LABEL(token));
+ tok_lastcnt = signed_val(SEQ_TRACE_T_LASTCNT(token));
+ tok_serial = signed_val(SEQ_TRACE_T_SERIAL(token));
+ }
+ }
+#endif
if (token != NIL)
ctl = TUPLE4(&ctl_heap[0],
make_small(DOP_SEND_TT), am_Cookie, remote, token);
else
ctl = TUPLE3(&ctl_heap[0], make_small(DOP_SEND), am_Cookie, 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,
+ msize, tok_label, tok_lastcnt, tok_serial);
res = dsig_send(dsdp, ctl, message, 0);
UnUseTmpHeapNoproc(5);
return res;
@@ -766,13 +802,41 @@ erts_dsig_send_reg_msg(ErtsDSigData *dsdp, Eterm remote_name, Eterm message)
Eterm token = NIL;
Process *sender = dsdp->proc;
int res;
+#ifdef USE_VM_PROBES
+ Sint tok_label = 0;
+ Sint tok_lastcnt = 0;
+ Sint tok_serial = 0;
+ Uint32 msize = 0;
+ DTRACE_CHARBUF(node_name, 64);
+ DTRACE_CHARBUF(sender_name, 64);
+ DTRACE_CHARBUF(receiver_name, 128);
+#endif
UseTmpHeapNoproc(6);
- if (SEQ_TRACE_TOKEN(sender) != NIL) {
+ if (SEQ_TRACE_TOKEN(sender) != NIL
+#ifdef USE_VM_PROBES
+ && SEQ_TRACE_TOKEN(sender) != am_have_dt_utag
+#endif
+ ) {
seq_trace_update_send(sender);
token = SEQ_TRACE_TOKEN(sender);
seq_trace_output(token, message, SEQ_TRACE_SEND, remote_name, sender);
}
+#ifdef USE_VM_PROBES
+ *node_name = *sender_name = *receiver_name = '\0';
+ if (DTRACE_ENABLED(message_send) || DTRACE_ENABLED(message_send_remote)) {
+ erts_snprintf(node_name, sizeof(node_name), "%T", dsdp->dep->sysname);
+ erts_snprintf(sender_name, sizeof(sender_name), "%T", sender->id);
+ erts_snprintf(receiver_name, sizeof(receiver_name),
+ "{%T,%s}", remote_name, node_name);
+ msize = size_object(message);
+ if (token != NIL && token != am_have_dt_utag) {
+ tok_label = signed_val(SEQ_TRACE_T_LABEL(token));
+ tok_lastcnt = signed_val(SEQ_TRACE_T_LASTCNT(token));
+ tok_serial = signed_val(SEQ_TRACE_T_SERIAL(token));
+ }
+ }
+#endif
if (token != NIL)
ctl = TUPLE5(&ctl_heap[0], make_small(DOP_REG_SEND_TT),
@@ -780,6 +844,10 @@ erts_dsig_send_reg_msg(ErtsDSigData *dsdp, Eterm remote_name, Eterm message)
else
ctl = TUPLE4(&ctl_heap[0], make_small(DOP_REG_SEND),
sender->id, am_Cookie, 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,
+ msize, tok_label, tok_lastcnt, tok_serial);
res = dsig_send(dsdp, ctl, message, 0);
UnUseTmpHeapNoproc(6);
return res;
@@ -793,9 +861,23 @@ erts_dsig_send_exit_tt(ErtsDSigData *dsdp, Eterm local, Eterm remote,
Eterm ctl;
DeclareTmpHeapNoproc(ctl_heap,6);
int res;
+#ifdef USE_VM_PROBES
+ Process *sender = dsdp->proc;
+ Sint tok_label = 0;
+ Sint tok_lastcnt = 0;
+ Sint tok_serial = 0;
+ DTRACE_CHARBUF(node_name, 64);
+ DTRACE_CHARBUF(sender_name, 64);
+ DTRACE_CHARBUF(remote_name, 128);
+ DTRACE_CHARBUF(reason_str, 128);
+#endif
UseTmpHeapNoproc(6);
- if (token != NIL) {
+ if (token != NIL
+#ifdef USE_VM_PROBES
+ && token != am_have_dt_utag
+#endif
+ ) {
seq_trace_update_send(dsdp->proc);
seq_trace_output_exit(token, reason, SEQ_TRACE_SEND, remote, local);
ctl = TUPLE5(&ctl_heap[0],
@@ -803,6 +885,23 @@ erts_dsig_send_exit_tt(ErtsDSigData *dsdp, Eterm local, Eterm remote,
} else {
ctl = TUPLE4(&ctl_heap[0], make_small(DOP_EXIT), local, remote, reason);
}
+#ifdef USE_VM_PROBES
+ *node_name = *sender_name = *remote_name = '\0';
+ if (DTRACE_ENABLED(process_exit_signal_remote)) {
+ erts_snprintf(node_name, sizeof(node_name), "%T", dsdp->dep->sysname);
+ erts_snprintf(sender_name, sizeof(sender_name), "%T", sender->id);
+ erts_snprintf(remote_name, sizeof(remote_name),
+ "{%T,%s}", remote, node_name);
+ erts_snprintf(reason_str, sizeof(reason), "%T", reason);
+ if (token != NIL && token != am_have_dt_utag) {
+ tok_label = signed_val(SEQ_TRACE_T_LABEL(token));
+ tok_lastcnt = signed_val(SEQ_TRACE_T_LASTCNT(token));
+ tok_serial = signed_val(SEQ_TRACE_T_SERIAL(token));
+ }
+ }
+#endif
+ DTRACE7(process_exit_signal_remote, sender_name, node_name,
+ remote_name, reason_str, tok_label, tok_lastcnt, tok_serial);
/* forced, i.e ignore busy */
res = dsig_send(dsdp, ctl, THE_NON_VALUE, 1);
UnUseTmpHeapNoproc(6);
@@ -869,16 +968,16 @@ erts_dsig_send_group_leader(ErtsDSigData *dsdp, Eterm leader, Eterm remote)
#define VALGRIND_PRINTF_XML VALGRIND_PRINTF
#endif
-# define PURIFY_MSG(msg) \
- do { \
- char buf__[1]; size_t bufsz__ = sizeof(buf__); \
- if (erts_sys_getenv("VALGRIND_LOG_XML", buf__, &bufsz__) >= 0) { \
- VALGRIND_PRINTF_XML("<erlang_error_log>" \
- "%s, line %d: %s</erlang_error_log>\n", \
- __FILE__, __LINE__, msg); \
- } else { \
- VALGRIND_PRINTF("%s, line %d: %s", __FILE__, __LINE__, msg); \
- } \
+# define PURIFY_MSG(msg) \
+ do { \
+ char buf__[1]; size_t bufsz__ = sizeof(buf__); \
+ if (erts_sys_getenv_raw("VALGRIND_LOG_XML", buf__, &bufsz__) >= 0) { \
+ VALGRIND_PRINTF_XML("<erlang_error_log>" \
+ "%s, line %d: %s</erlang_error_log>\n", \
+ __FILE__, __LINE__, msg); \
+ } else { \
+ VALGRIND_PRINTF("%s, line %d: %s", __FILE__, __LINE__, msg); \
+ } \
} while (0)
#else
# define PURIFY_MSG(msg)
@@ -1213,7 +1312,7 @@ int erts_net_message(Port *prt,
if (is_not_pid(from) || is_not_atom(to)){
goto invalid_message;
}
- rp = erts_whereis_process(NULL, 0, to, 0, ERTS_P2P_FLG_SMP_INC_REFC);
+ rp = erts_whereis_process(NULL, 0, to, 0, 0);
if (rp) {
Uint xsize = (type == DOP_REG_SEND
? 0
@@ -1239,7 +1338,6 @@ int erts_net_message(Port *prt,
erts_queue_dist_message(rp, &locks, ede_copy, token);
if (locks)
erts_smp_proc_unlock(rp, locks);
- erts_smp_proc_dec_refc(rp);
}
break;
@@ -1265,7 +1363,7 @@ int erts_net_message(Port *prt,
if (is_not_pid(to)) {
goto invalid_message;
}
- rp = erts_pid2proc_opt(NULL, 0, to, 0, ERTS_P2P_FLG_SMP_INC_REFC);
+ rp = erts_proc_lookup(to);
if (rp) {
Uint xsize = type == DOP_SEND ? 0 : ERTS_HEAP_FRAG_SIZE(token_size);
ErtsProcLocks locks = 0;
@@ -1289,7 +1387,6 @@ int erts_net_message(Port *prt,
erts_queue_dist_message(rp, &locks, ede_copy, token);
if (locks)
erts_smp_proc_unlock(rp, locks);
- erts_smp_proc_dec_refc(rp);
}
break;
@@ -1445,8 +1542,7 @@ int erts_net_message(Port *prt,
if (is_not_pid(from) || is_not_internal_pid(to)) {
goto invalid_message;
}
- rp = erts_pid2proc_opt(NULL, 0, to, rp_locks,
- ERTS_P2P_FLG_SMP_INC_REFC);
+ rp = erts_pid2proc(NULL, 0, to, rp_locks);
if (rp) {
(void) erts_send_exit_signal(NULL,
from,
@@ -1457,7 +1553,6 @@ int erts_net_message(Port *prt,
NULL,
0);
erts_smp_proc_unlock(rp, rp_locks);
- erts_smp_proc_dec_refc(rp);
}
break;
}
@@ -1483,11 +1578,9 @@ int erts_net_message(Port *prt,
}
erts_cleanup_offheap(&off_heap);
-#ifndef HYBRID /* FIND ME! */
if (ctl != ctl_default) {
erts_free(ERTS_ALC_T_DCTRL_BUF, (void *) ctl);
}
-#endif
UnUseTmpHeapNoproc(DIST_CTL_DEFAULT_SIZE);
ERTS_SMP_CHK_NO_PROC_LOCKS;
return 0;
@@ -1500,11 +1593,9 @@ int erts_net_message(Port *prt,
data_error:
PURIFY_MSG("data error");
erts_cleanup_offheap(&off_heap);
-#ifndef HYBRID /* FIND ME! */
if (ctl != ctl_default) {
erts_free(ERTS_ALC_T_DCTRL_BUF, (void *) ctl);
}
-#endif
UnUseTmpHeapNoproc(DIST_CTL_DEFAULT_SIZE);
erts_do_exit_port(prt, dep->cid, am_killed);
ERTS_SMP_CHK_NO_PROC_LOCKS;
@@ -1619,6 +1710,18 @@ dsig_send(ErtsDSigData *dsdp, Eterm ctl, Eterm msg, int force_busy)
if (!(dep->qflgs & ERTS_DE_QFLG_BUSY)) {
if (suspended)
resume = 1; /* was busy when we started, but isn't now */
+#ifdef USE_VM_PROBES
+ if (resume && DTRACE_ENABLED(dist_port_not_busy)) {
+ DTRACE_CHARBUF(port_str, 64);
+ DTRACE_CHARBUF(remote_str, 64);
+
+ erts_snprintf(port_str, sizeof(port_str), "%T", cid);
+ erts_snprintf(remote_str, sizeof(remote_str),
+ "%T", dep->sysname);
+ DTRACE3(dist_port_not_busy, erts_this_node_sysname,
+ port_str, remote_str);
+ }
+#endif
}
else {
/* Enqueue suspended process on dist entry */
@@ -1668,6 +1771,19 @@ dsig_send(ErtsDSigData *dsdp, Eterm ctl, Eterm msg, int force_busy)
}
if (suspended) {
+#ifdef USE_VM_PROBES
+ if (!resume && DTRACE_ENABLED(dist_port_busy)) {
+ DTRACE_CHARBUF(port_str, 64);
+ DTRACE_CHARBUF(remote_str, 64);
+ DTRACE_CHARBUF(pid_str, 16);
+
+ erts_snprintf(port_str, sizeof(port_str), "%T", cid);
+ erts_snprintf(remote_str, sizeof(remote_str), "%T", dep->sysname);
+ erts_snprintf(pid_str, sizeof(pid_str), "%T", c_p->id);
+ DTRACE4(dist_port_busy, erts_this_node_sysname,
+ port_str, remote_str, pid_str);
+ }
+#endif
if (!resume && erts_system_monitor_flags.busy_dist_port)
monitor_generic(c_p, am_busy_dist_port, cid);
return ERTS_DSIG_SEND_YIELD;
@@ -1691,6 +1807,18 @@ dist_port_command(Port *prt, ErtsDistOutputBuf *obuf)
"(%beu bytes) passed.\n",
size);
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(dist_output)) {
+ DTRACE_CHARBUF(port_str, 64);
+ DTRACE_CHARBUF(remote_str, 64);
+
+ erts_snprintf(port_str, sizeof(port_str), "%T", prt->id);
+ erts_snprintf(remote_str, sizeof(remote_str),
+ "%T", prt->dist_entry->sysname);
+ DTRACE4(dist_output, erts_this_node_sysname, port_str,
+ remote_str, size);
+ }
+#endif
prt->caller = NIL;
fpe_was_unmasked = erts_block_fpe();
(*prt->drv_ptr->output)((ErlDrvData) prt->drv_data,
@@ -1733,6 +1861,18 @@ dist_port_commandv(Port *prt, ErtsDistOutputBuf *obuf)
ASSERT(prt->drv_ptr->outputv);
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(dist_outputv)) {
+ DTRACE_CHARBUF(port_str, 64);
+ DTRACE_CHARBUF(remote_str, 64);
+
+ erts_snprintf(port_str, sizeof(port_str), "%T", prt->id);
+ erts_snprintf(remote_str, sizeof(remote_str),
+ "%T", prt->dist_entry->sysname);
+ DTRACE4(dist_outputv, erts_this_node_sysname, port_str,
+ remote_str, size);
+ }
+#endif
prt->caller = NIL;
fpe_was_unmasked = erts_block_fpe();
(*prt->drv_ptr->outputv)((ErlDrvData) prt->drv_data, &eiov);
@@ -1829,6 +1969,7 @@ erts_dist_command(Port *prt, int reds_limit)
bw(foq.first->extp, size);
#endif
reds += ERTS_PORT_REDS_DIST_CMD_DATA(size);
+ erts_smp_atomic_add_nob(&erts_bytes_out, size);
fob = foq.first;
obufsize += size_obuf(fob);
foq.first = foq.first->next;
@@ -1912,6 +2053,7 @@ erts_dist_command(Port *prt, int reds_limit)
bw(oq.first->extp, size);
#endif
reds += ERTS_PORT_REDS_DIST_CMD_DATA(size);
+ erts_smp_atomic_add_nob(&erts_bytes_out, size);
fob = oq.first;
obufsize += size_obuf(fob);
oq.first = oq.first->next;
@@ -2052,6 +2194,18 @@ erts_dist_command(Port *prt, int reds_limit)
void
erts_dist_port_not_busy(Port *prt)
{
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(dist_port_not_busy)) {
+ DTRACE_CHARBUF(port_str, 64);
+ DTRACE_CHARBUF(remote_str, 64);
+
+ erts_snprintf(port_str, sizeof(port_str), "%T", prt->id);
+ erts_snprintf(remote_str, sizeof(remote_str),
+ "%T", prt->dist_entry->sysname);
+ DTRACE3(dist_port_not_busy, erts_this_node_sysname,
+ port_str, remote_str);
+ }
+#endif
erts_schedule_dist_command(prt, NULL);
}
@@ -2086,7 +2240,7 @@ static void doit_print_monitor_info(ErtsMonitor *mon, void *vptdp)
void *arg = ((struct print_to_data *) vptdp)->arg;
Process *rp;
ErtsMonitor *rmon;
- rp = erts_pid2proc_unlocked(mon->pid);
+ rp = erts_proc_lookup(mon->pid);
if (!rp || (rmon = erts_lookup_monitor(rp->monitors, mon->ref)) == NULL) {
erts_print(to, arg, "Warning, stray monitor for: %T\n", mon->pid);
} else if (mon->type == MON_ORIGIN) {
@@ -2125,7 +2279,7 @@ static void doit_print_link_info2(ErtsLink *lnk, void *vpplc)
static void doit_print_link_info(ErtsLink *lnk, void *vptdp)
{
- if (is_internal_pid(lnk->pid) && erts_pid2proc_unlocked(lnk->pid)) {
+ if (is_internal_pid(lnk->pid) && erts_proc_lookup(lnk->pid)) {
PrintLinkContext plc = {(struct print_to_data *) vptdp, lnk->pid};
erts_doforall_links(ERTS_LINK_ROOT(lnk), &doit_print_link_info2, &plc);
}
@@ -2147,7 +2301,7 @@ static void doit_print_nodelink_info(ErtsLink *lnk, void *vpcontext)
{
PrintNodeLinkContext *pcontext = vpcontext;
- if (is_internal_pid(lnk->pid) && erts_pid2proc_unlocked(lnk->pid))
+ if (is_internal_pid(lnk->pid) && erts_proc_lookup(lnk->pid))
erts_print(pcontext->ptd.to, pcontext->ptd.arg,
"Remote monitoring: %T %T\n", lnk->pid, pcontext->sysname);
}
@@ -2295,15 +2449,15 @@ BIF_RETTYPE setnode_2(BIF_ALIST_2)
goto error;
/* Check that all trap functions are defined !! */
- if (dsend2_trap->address == NULL ||
- dsend3_trap->address == NULL ||
+ if (dsend2_trap->addressv[0] == NULL ||
+ dsend3_trap->addressv[0] == NULL ||
/* dsend_nosuspend_trap->address == NULL ||*/
- dlink_trap->address == NULL ||
- dunlink_trap->address == NULL ||
- dmonitor_node_trap->address == NULL ||
- dgroup_leader_trap->address == NULL ||
- dmonitor_p_trap->address == NULL ||
- dexit_trap->address == NULL) {
+ dlink_trap->addressv[0] == NULL ||
+ dunlink_trap->addressv[0] == NULL ||
+ dmonitor_node_trap->addressv[0] == NULL ||
+ dgroup_leader_trap->addressv[0] == NULL ||
+ dmonitor_p_trap->addressv[0] == NULL ||
+ dexit_trap->addressv[0] == NULL) {
goto error;
}
@@ -2550,9 +2704,8 @@ BIF_RETTYPE dist_exit_3(BIF_ALIST_3)
}
else {
lp_locks = ERTS_PROC_LOCKS_XSIG_SEND;
- lp = erts_pid2proc_opt(BIF_P, ERTS_PROC_LOCK_MAIN,
- local, lp_locks,
- ERTS_P2P_FLG_SMP_INC_REFC);
+ lp = erts_pid2proc(BIF_P, ERTS_PROC_LOCK_MAIN,
+ local, lp_locks);
if (!lp) {
BIF_RET(am_true); /* ignore */
}
@@ -2571,9 +2724,7 @@ BIF_RETTYPE dist_exit_3(BIF_ALIST_3)
lp_locks &= ~ERTS_PROC_LOCK_MAIN;
#endif
erts_smp_proc_unlock(lp, lp_locks);
- if (lp != BIF_P)
- erts_smp_proc_dec_refc(lp);
- else {
+ if (lp == BIF_P) {
/*
* We may have exited current process and may have to take action.
*/
@@ -2972,7 +3123,11 @@ send_nodes_mon_msg(Process *rp,
}
ASSERT(hend == hp);
- erts_queue_message(rp, rp_locksp, bp, msg, NIL);
+ erts_queue_message(rp, rp_locksp, bp, msg, NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
}
static void
@@ -2985,6 +3140,21 @@ send_nodes_mon_msgs(Process *c_p, Eterm what, Eterm node, Eterm type, Eterm reas
ASSERT(is_immed(what));
ASSERT(is_immed(node));
ASSERT(is_immed(type));
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(dist_monitor)) {
+ DTRACE_CHARBUF(what_str, 12);
+ DTRACE_CHARBUF(node_str, 64);
+ DTRACE_CHARBUF(type_str, 12);
+ DTRACE_CHARBUF(reason_str, 64);
+
+ erts_snprintf(what_str, sizeof(what_str), "%T", what);
+ erts_snprintf(node_str, sizeof(node_str), "%T", node);
+ erts_snprintf(type_str, sizeof(type_str), "%T", type);
+ erts_snprintf(reason_str, sizeof(reason_str), "%T", reason);
+ DTRACE5(dist_monitor, erts_this_node_sysname,
+ what_str, node_str, type_str, reason_str);
+ }
+#endif
ERTS_SMP_LC_ASSERT(!c_p
|| (erts_proc_lc_my_proc_locks(c_p)
diff --git a/erts/emulator/beam/dtrace-wrapper.h b/erts/emulator/beam/dtrace-wrapper.h
new file mode 100644
index 0000000000..6ec0c91e21
--- /dev/null
+++ b/erts/emulator/beam/dtrace-wrapper.h
@@ -0,0 +1,111 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Dustin Sallings, Michal Ptaszek, Scott Lystig Fritchie 2011-2012.
+ * All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+#ifndef __DTRACE_WRAPPER_H
+#define __DTRACE_WRAPPER_H
+
+#define DTRACE_TERM_BUF_SIZE 256
+
+/*
+ * Some varieties of SystemTap macros do not like statically-sized
+ * char[N] buffers. (For example, CentOS 6's macros.)
+ * So, we'll play a game to humor them.
+ *
+ * The code necessary to play nice with CentOS 6's SystemTap looks
+ * stupid to a C programmer's eyes, so we hide the ugliness with this
+ * macro, which expands:
+ *
+ * DTRACE_CHARBUF(proc_name, 64);
+ *
+ * to become:
+ *
+ * char proc_name_BUFFER[64], *proc_name = proc_name_BUFFER;
+ */
+
+#define DTRACE_CHARBUF(name, size) \
+ char name##_BUFFER[size], *name = name##_BUFFER
+
+#define DTRACE_CHARBUF_NAME(name) name##_BUFFER
+
+#if defined(USE_DYNAMIC_TRACE) && defined(USE_VM_PROBES)
+
+#include "erlang_dtrace.h"
+
+#define DTRACE_ENABLED(name) \
+ erlang_##name##_enabled()
+#define DTRACE0(name) \
+ erlang_##name()
+#define DTRACE1(name, a0) \
+ erlang_##name(a0)
+#define DTRACE2(name, a0, a1) \
+ erlang_##name((a0), (a1))
+#define DTRACE3(name, a0, a1, a2) \
+ erlang_##name((a0), (a1), (a2))
+#define DTRACE4(name, a0, a1, a2, a3) \
+ erlang_##name((a0), (a1), (a2), (a3))
+#define DTRACE5(name, a0, a1, a2, a3, a4) \
+ erlang_##name((a0), (a1), (a2), (a3), (a4))
+#define DTRACE6(name, a0, a1, a2, a3, a4, a5) \
+ erlang_##name((a0), (a1), (a2), (a3), (a4), (a5))
+#define DTRACE7(name, a0, a1, a2, a3, a4, a5, a6) \
+ erlang_##name((a0), (a1), (a2), (a3), (a4), (a5), (a6))
+#define DTRACE10(name, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) \
+ erlang_##name((a0), (a1), (a2), (a3), (a4), (a5), (a6), (a7), (a8), (a9))
+#define DTRACE11(name, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) \
+ erlang_##name((a0), (a1), (a2), (a3), (a4), (a5), (a6), (a7), (a8), (a9), (a10))
+
+#if defined(_SDT_PROBE) && !defined(STAP_PROBE11)
+/* SLF: This is Ubuntu 11-style SystemTap hackery */
+/* work arround for missing STAP macro */
+#define STAP_PROBE11(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \
+ _SDT_PROBE(provider, name, 11, \
+ (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11))
+#define _SDT_ASM_OPERANDS_11(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \
+ _SDT_ASM_OPERANDS_10(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9,arg10), \
+ _SDT_ARG(11, arg11)
+#endif
+
+#ifdef STAP_PROBE_ADDR
+/* SLF: This is CentOS 5-style SystemTap hackery */
+/* SystemTap compat mode cannot support 11 args. We'll ignore the 11th */
+#define STAP_PROBE11(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11) \
+ STAP_PROBE10(provider,probe,(parm1),(parm2),(parm3),(parm4),(parm5),(parm6),(parm7),(parm8),(parm9),(parm10))
+#endif /* STAP_PROBE_ADDR */
+
+#else /* USE_DYNAMIC_TRACE && USE_VM_PROBES */
+
+/* Render all macros to do nothing */
+#define DTRACE_ENABLED(name) 0
+#define DTRACE0(name) do {} while (0)
+#define DTRACE1(name, a0) do {} while (0)
+#define DTRACE2(name, a0, a1) do {} while (0)
+#define DTRACE3(name, a0, a1, a2) do {} while (0)
+#define DTRACE4(name, a0, a1, a2, a3) do {} while (0)
+#define DTRACE5(name, a0, a1, a2, a3, a4) do {} while (0)
+#define DTRACE6(name, a0, a1, a2, a3, a4, a5) do {} while (0)
+#define DTRACE7(name, a0, a1, a2, a3, a4, a5, a6) do {} while (0)
+#define DTRACE10(name, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) \
+ do {} while (0)
+#define DTRACE11(name, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) \
+ do {} while (0)
+
+#endif /* USE_DYNAMIC_TRACE && USE_VM_PROBES */
+
+#endif /* __DTRACE_WRAPPER_H */
diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c
index 4d02a67d54..3eee53eba3 100644
--- a/erts/emulator/beam/erl_alloc.c
+++ b/erts/emulator/beam/erl_alloc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2012. 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
@@ -1577,9 +1577,11 @@ erts_alloc_register_scheduler(void *vesdp)
}
}
+#ifdef ERTS_SMP
void
erts_alloc_scheduler_handle_delayed_dealloc(void *vesdp,
int *need_thr_progress,
+ ErtsThrPrgrVal *thr_prgr_p,
int *more_work)
{
ErtsSchedulerData *esdp = (ErtsSchedulerData *) vesdp;
@@ -1599,10 +1601,12 @@ erts_alloc_scheduler_handle_delayed_dealloc(void *vesdp,
erts_alcu_check_delayed_dealloc(allctr,
1,
need_thr_progress,
+ thr_prgr_p,
more_work);
}
}
}
+#endif
erts_aint32_t
erts_alloc_fix_alloc_shrink(int ix, erts_aint32_t flgs)
@@ -1671,7 +1675,7 @@ erts_alc_fatal_error(int error, int func, ErtsAlcType_t n, ...)
t_str = type_no_str(n);
if (!t_str) {
- sprintf(buf, "%d", (int) n);
+ erts_snprintf(buf, sizeof(buf), "%d", (int) n);
t_str = buf;
}
@@ -2134,9 +2138,6 @@ erts_memory(int *print_to_p, void *print_to_arg, void *proc, Eterm earg)
tmp = alcu_size(ERTS_ALC_A_EHEAP, NULL, 0);
}
tmp += erts_max_processes*sizeof(Process*);
-#ifdef HYBRID
- tmp += erts_max_processes*sizeof(Process*);
-#endif
tmp += erts_bif_timer_memory_size();
tmp += erts_tot_link_lh_size();
@@ -2181,9 +2182,9 @@ erts_memory(int *print_to_p, void *print_to_arg, void *proc, Eterm earg)
if (want.code) {
size.code = module_table_sz();
size.code += export_table_sz();
- size.code += export_list_size() * sizeof(Export);
+ size.code += export_entries_sz();
size.code += erts_fun_table_sz();
- size.code += allocated_modules*sizeof(Range);
+ size.code += erts_ranges_sz();
size.code += erts_total_code_size;
}
@@ -2299,11 +2300,7 @@ erts_allocated_areas(int *print_to_p, void *print_to_arg, void *proc)
values[i].name = "static";
values[i].ui[0] =
erts_max_ports*sizeof(Port) /* Port table */
- + erts_timer_wheel_memory_size() /* Timer wheel */
-#ifdef SYS_TMP_BUF_SIZE
- + SYS_TMP_BUF_SIZE /* tmp_buf in sys on vxworks & ose */
-#endif
- ;
+ + erts_timer_wheel_memory_size(); /* Timer wheel */
i++;
erts_atom_get_text_space_sizes(&reserved_atom_space, &atom_space);
@@ -2331,7 +2328,7 @@ erts_allocated_areas(int *print_to_p, void *print_to_arg, void *proc)
values[i].arity = 2;
values[i].name = "export_list";
- values[i].ui[0] = export_list_size() * sizeof(Export);
+ values[i].ui[0] = export_entries_sz();
i++;
values[i].arity = 2;
@@ -2346,7 +2343,7 @@ erts_allocated_areas(int *print_to_p, void *print_to_arg, void *proc)
values[i].arity = 2;
values[i].name = "module_refs";
- values[i].ui[0] = allocated_modules*sizeof(Range);
+ values[i].ui[0] = erts_ranges_sz();
i++;
values[i].arity = 2;
@@ -2997,7 +2994,11 @@ reply_alloc_info(void *vair)
HRelease(rp, hp_end, hp);
}
- erts_queue_message(rp, &rp_locks, bp, msg, NIL);
+ erts_queue_message(rp, &rp_locks, bp, msg, NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
if (air->req_sched == sched_id)
rp_locks &= ~ERTS_PROC_LOCK_MAIN;
@@ -3571,12 +3572,12 @@ check_memory_fence(void *ptr, Uint *size, ErtsAlcType_t n, int func)
ftype = type_no_str(found_type);
if (!ftype) {
- sprintf(fbuf, "%d", (int) found_type);
+ erts_snprintf(fbuf, sizeof(fbuf), "%d", (int) found_type);
ftype = fbuf;
}
otype = type_no_str(n);
if (!otype) {
- sprintf(obuf, "%d", (int) n);
+ erts_snprintf(obuf, sizeof(obuf), "%d", (int) n);
otype = obuf;
}
diff --git a/erts/emulator/beam/erl_alloc.h b/erts/emulator/beam/erl_alloc.h
index 991061c48e..e475f9d8a2 100644
--- a/erts/emulator/beam/erl_alloc.h
+++ b/erts/emulator/beam/erl_alloc.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2012. 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
@@ -21,6 +21,10 @@
#define ERL_ALLOC_H__
#include "erl_alloc_types.h"
+#undef ERL_THR_PROGRESS_TSD_TYPE_ONLY
+#define ERL_THR_PROGRESS_TSD_TYPE_ONLY
+#include "erl_thr_progress.h"
+#undef ERL_THR_PROGRESS_TSD_TYPE_ONLY
#include "erl_alloc_util.h"
#ifdef USE_THREADS
#include "erl_threads.h"
@@ -132,9 +136,12 @@ typedef struct {
extern ErtsAllocatorThrSpec_t erts_allctr_thr_spec[ERTS_ALC_A_MAX+1];
void erts_alloc_register_scheduler(void *vesdp);
+#ifdef ERTS_SMP
void erts_alloc_scheduler_handle_delayed_dealloc(void *vesdp,
int *need_thr_progress,
+ ErtsThrPrgrVal *thr_prgr_p,
int *more_work);
+#endif
erts_aint32_t erts_alloc_fix_alloc_shrink(int ix, erts_aint32_t flgs);
__decl_noreturn void erts_alloc_enomem(ErtsAlcType_t,Uint)
diff --git a/erts/emulator/beam/erl_alloc.types b/erts/emulator/beam/erl_alloc.types
index 962db8b831..0a4407f009 100644
--- a/erts/emulator/beam/erl_alloc.types
+++ b/erts/emulator/beam/erl_alloc.types
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2011. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -164,6 +164,7 @@ type MSG_REF FIXED_SIZE PROCESSES msg_ref
type MSG_ROOTS TEMPORARY PROCESSES msg_roots
type ROOTSET TEMPORARY PROCESSES root_set
type LOADER_TMP TEMPORARY CODE loader_tmp
+type PREPARED_CODE SHORT_LIVED CODE prepared_code
type BIF_TIMER_TABLE LONG_LIVED SYSTEM bif_timer_table
type SL_BIF_TIMER SHORT_LIVED PROCESSES bif_timer_sl
type LL_BIF_TIMER STANDARD PROCESSES bif_timer_ll
@@ -263,6 +264,8 @@ 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
+type CODE_IX_LOCK_Q SHORT_LIVED SYSTEM code_ix_lock_q
+type PROC_INTERVAL LONG_LIVED SYSTEM process_interval
+if threads_no_smp
# Need thread safe allocs, but std_alloc and fix_alloc are not;
@@ -291,7 +294,6 @@ type PORT_LOCK STANDARD SYSTEM port_lock
type DRIVER_LOCK STANDARD SYSTEM driver_lock
type XPORTS_LIST SHORT_LIVED SYSTEM extra_port_list
type PROC_LCK_WTR LONG_LIVED SYSTEM proc_lock_waiter
-type PROC_LCK_QS LONG_LIVED SYSTEM proc_lock_queues
type RUNQ_BLNS LONG_LIVED SYSTEM run_queue_balancing
type THR_PRGR_IDATA LONG_LIVED SYSTEM thr_prgr_internal_data
type THR_PRGR_DATA LONG_LIVED SYSTEM thr_prgr_data
@@ -317,24 +319,13 @@ type ACTIVE_PROCS STANDARD PROCESSES active_procs
+endif
-+if hybrid
-
-type ACTIVE_PROCS STANDARD PROCESSES active_procs
-
-# Used for all memory involved in incremental gc of the message area
-# that is, young (x2) and old generation, forwarding pointers and blackmap
-type MESSAGE_AREA LONG_LIVED PROCESSES message_area
-
-# Used in MA_STACK (global.h) and INC_STORAGE (erl_nmgc.h)
-type OBJECT_STACK STANDARD PROCESSES object_stack
-
-+endif
-
+if smp
type SL_PTIMER SHORT_LIVED SYSTEM ptimer_sl
type LL_PTIMER STANDARD SYSTEM ptimer_ll
type SYS_MSG_Q SHORT_LIVED PROCESSES system_messages_queue
type FP_EXCEPTION LONG_LIVED SYSTEM fp_exception
+type LL_MPATHS LONG_LIVED SYSTEM ll_migration_paths
+type SL_MPATHS SHORT_LIVED SYSTEM sl_migration_paths
+endif
+if hipe
@@ -367,6 +358,7 @@ type EXPORT LONG_LIVED_LOW CODE export_entry
type MONITOR_SH STANDARD_LOW PROCESSES monitor_sh
type NLINK_SH STANDARD_LOW PROCESSES nlink_sh
type AINFO_REQ STANDARD_LOW SYSTEM alloc_info_request
+type SCHED_WTIME_REQ STANDARD_LOW SYSTEM sched_wall_time_request
+else # "fullword"
@@ -383,6 +375,7 @@ type EXPORT LONG_LIVED CODE export_entry
type MONITOR_SH FIXED_SIZE PROCESSES monitor_sh
type NLINK_SH FIXED_SIZE PROCESSES nlink_sh
type AINFO_REQ SHORT_LIVED SYSTEM alloc_info_request
+type SCHED_WTIME_REQ SHORT_LIVED SYSTEM sched_wall_time_request
+endif
@@ -426,28 +419,4 @@ type CON_VPRINTF_BUF TEMPORARY SYSTEM con_vprintf_buf
+endif
-+if vxworks
-
-type SYS_TMP_BUF LONG_LIVED SYSTEM sys_tmp_buf
-type PEND_DATA SYSTEM SYSTEM pending_data
-type FD_TAB LONG_LIVED SYSTEM fd_tab
-type FD_ENTRY_BUF SYSTEM SYSTEM fd_entry_buf
-
-+endif
-
-+if ose
-
-type SYS_TMP_BUF LONG_LIVED SYSTEM sys_tmp_buf
-type PUTENV_STR SYSTEM SYSTEM putenv_string
-type GETENV_STR SYSTEM SYSTEM getenv_string
-type GETENV_STATE SYSTEM SYSTEM getenv_state
-type SIG_ENTRY SYSTEM SYSTEM sig_entry
-type DRIVER_DATA SYSTEM SYSTEM driver_data
-type PGM_TAB SYSTEM SYSTEM pgm_tab
-type PGM_ENTRY SYSTEM SYSTEM pgm_entry
-type PRT_TAB SYSTEM SYSTEM prt_tab
-type PRT_ENTRY SYSTEM SYSTEM prt_entry
-
-+endif
-
# ----------------------------------------------------------------------------
diff --git a/erts/emulator/beam/erl_alloc_util.c b/erts/emulator/beam/erl_alloc_util.c
index 2e1a92f61d..97ba306a79 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2012. 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
@@ -829,46 +829,83 @@ init_dd_queue(ErtsAllctrDDQueue_t *ddq)
ddq->head.used_marker = 1;
}
-static ERTS_INLINE erts_aint_t
-ddq_managed_thread_enqueue(ErtsAllctrDDQueue_t *ddq, void *ptr)
+static ERTS_INLINE int
+ddq_managed_thread_enqueue(ErtsAllctrDDQueue_t *ddq, void *ptr, int cinit)
{
- erts_aint_t ilast, itmp;
- ErtsAllctrDDBlock_t *this = ptr;
+ erts_aint_t itmp;
+ ErtsAllctrDDBlock_t *enq, *this = ptr;
erts_atomic_init_nob(&this->atmc_next, ERTS_AINT_NULL);
-
/* Enqueue at end of list... */
- ilast = erts_atomic_read_nob(&ddq->tail.data.last);
- while (1) {
- ErtsAllctrDDBlock_t *last = (ErtsAllctrDDBlock_t *) ilast;
- itmp = erts_atomic_cmpxchg_mb(&last->atmc_next,
- (erts_aint_t) this,
- ERTS_AINT_NULL);
- if (itmp == ERTS_AINT_NULL)
- break;
- ilast = itmp;
+ enq = (ErtsAllctrDDBlock_t *) erts_atomic_read_nob(&ddq->tail.data.last);
+ itmp = erts_atomic_cmpxchg_relb(&enq->atmc_next,
+ (erts_aint_t) this,
+ ERTS_AINT_NULL);
+ if (itmp == ERTS_AINT_NULL) {
+ /* We are required to move last pointer */
+#ifdef DEBUG
+ ASSERT(ERTS_AINT_NULL == erts_atomic_read_nob(&this->atmc_next));
+ ASSERT(((erts_aint_t) enq)
+ == erts_atomic_xchg_relb(&ddq->tail.data.last,
+ (erts_aint_t) this));
+#else
+ erts_atomic_set_relb(&ddq->tail.data.last, (erts_aint_t) this);
+#endif
+ return 1;
}
+ else {
+ /*
+ * We *need* to insert element somewhere in between the
+ * last element we read earlier and the actual last element.
+ */
+ int i = cinit;
- /* Move last pointer forward... */
- while (1) {
- if (erts_atomic_read_rb(&this->atmc_next) != ERTS_AINT_NULL) {
- /* Someone else will move it forward */
- return erts_atomic_read_rb(&ddq->tail.data.last);
+ while (1) {
+ erts_aint_t itmp2;
+ erts_atomic_set_nob(&this->atmc_next, itmp);
+ itmp2 = erts_atomic_cmpxchg_relb(&enq->atmc_next,
+ (erts_aint_t) this,
+ itmp);
+ if (itmp == itmp2)
+ return 0; /* inserted this */
+ if ((i & 1) == 0)
+ itmp = itmp2;
+ else {
+ enq = (ErtsAllctrDDBlock_t *) itmp2;
+ itmp = erts_atomic_read_acqb(&enq->atmc_next);
+ ASSERT(itmp != ERTS_AINT_NULL);
+ }
+ i++;
+ }
+ }
+}
+
+static ERTS_INLINE erts_aint_t
+check_insert_marker(ErtsAllctrDDQueue_t *ddq, erts_aint_t ilast)
+{
+ if (!ddq->head.used_marker
+ && ddq->head.unref_end == (ErtsAllctrDDBlock_t *) ilast) {
+ erts_aint_t itmp;
+ ErtsAllctrDDBlock_t *last = (ErtsAllctrDDBlock_t *) ilast;
+
+ erts_atomic_init_nob(&ddq->tail.data.marker.atmc_next, ERTS_AINT_NULL);
+ itmp = erts_atomic_cmpxchg_relb(&last->atmc_next,
+ (erts_aint_t) &ddq->tail.data.marker,
+ ERTS_AINT_NULL);
+ if (itmp == ERTS_AINT_NULL) {
+ ilast = (erts_aint_t) &ddq->tail.data.marker;
+ ddq->head.used_marker = !0;
+ erts_atomic_set_relb(&ddq->tail.data.last, ilast);
}
- itmp = erts_atomic_cmpxchg_mb(&ddq->tail.data.last,
- (erts_aint_t) this,
- ilast);
- if (ilast == itmp)
- return (erts_aint_t) this;
- ilast = itmp;
}
+ return ilast;
}
static ERTS_INLINE int
-ddq_enqueue(ErtsAlcType_t type, ErtsAllctrDDQueue_t *ddq, void *ptr)
+ddq_enqueue(ErtsAlcType_t type, ErtsAllctrDDQueue_t *ddq, void *ptr, int cinit)
{
- erts_aint_t ilast;
+ int last_elem;
int um_refc_ix = 0;
int managed_thread = erts_thr_progress_is_managed_thread();
if (!managed_thread) {
@@ -884,11 +921,11 @@ ddq_enqueue(ErtsAlcType_t type, ErtsAllctrDDQueue_t *ddq, void *ptr)
}
}
- ilast = ddq_managed_thread_enqueue(ddq, ptr);
+ last_elem = ddq_managed_thread_enqueue(ddq, ptr, cinit);
if (!managed_thread)
erts_atomic_dec_relb(&ddq->tail.data.um_refc[um_refc_ix]);
- return ilast == (erts_aint_t) ptr;
+ return last_elem;
}
static ERTS_INLINE void *
@@ -934,23 +971,18 @@ ddq_check_incoming(ErtsAllctrDDQueue_t *ddq)
int um_refc_ix;
ddq->head.next.thr_progress_reached = 1;
um_refc_ix = ddq->head.next.um_refc_ix;
- if (erts_atomic_read_acqb(&ddq->tail.data.um_refc[um_refc_ix]) == 0) {
+ if (erts_atomic_read_nob(&ddq->tail.data.um_refc[um_refc_ix]) == 0) {
/* Move unreferenced end pointer forward... */
+ ETHR_MEMBAR(ETHR_LoadLoad|ETHR_LoadStore);
+
ddq->head.unref_end = ddq->head.next.unref_end;
- if (!ddq->head.used_marker
- && ddq->head.unref_end == (ErtsAllctrDDBlock_t *) ilast) {
- ddq->head.used_marker = 1;
- ilast = ddq_managed_thread_enqueue(ddq, &ddq->tail.data.marker);
- }
+ ilast = check_insert_marker(ddq, ilast);
- if (ddq->head.unref_end == (ErtsAllctrDDBlock_t *) ilast)
- ERTS_THR_MEMORY_BARRIER;
- else {
+ if (ddq->head.unref_end != (ErtsAllctrDDBlock_t *) ilast) {
ddq->head.next.unref_end = (ErtsAllctrDDBlock_t *) ilast;
- ERTS_THR_MEMORY_BARRIER;
- ddq->head.next.thr_progress = erts_thr_progress_later();
+ ddq->head.next.thr_progress = erts_thr_progress_later(NULL);
erts_atomic32_set_relb(&ddq->tail.data.um_refc_ix,
um_refc_ix);
ddq->head.next.um_refc_ix = um_refc_ix == 0 ? 1 : 0;
@@ -961,12 +993,24 @@ ddq_check_incoming(ErtsAllctrDDQueue_t *ddq)
return 1;
}
+static ERTS_INLINE void
+store_earliest_thr_prgr(ErtsThrPrgrVal *prev_val, ErtsAllctrDDQueue_t *ddq)
+{
+ if (!ddq->head.next.thr_progress_reached
+ && (*prev_val == ERTS_THR_PRGR_INVALID
+ || erts_thr_progress_cmp(ddq->head.next.thr_progress,
+ *prev_val) < 0)) {
+ *prev_val = ddq->head.next.thr_progress;
+ }
+}
+
static ERTS_INLINE int
handle_delayed_dealloc(Allctr_t *allctr,
int allctr_locked,
int use_limit,
int ops_limit,
int *need_thr_progress,
+ ErtsThrPrgrVal *thr_prgr_p,
int *need_more_work)
{
int need_thr_prgr = 0;
@@ -1008,8 +1052,12 @@ handle_delayed_dealloc(Allctr_t *allctr,
if (have_checked_incoming)
break;
need_thr_prgr = ddq_check_incoming(ddq);
- if (need_thr_progress)
+ if (need_thr_progress) {
*need_thr_progress |= need_thr_prgr;
+ if (need_thr_prgr)
+ store_earliest_thr_prgr(thr_prgr_p, ddq);
+
+ }
have_checked_incoming = 1;
goto dequeue;
}
@@ -1067,6 +1115,8 @@ handle_delayed_dealloc(Allctr_t *allctr,
if (need_thr_progress && !(need_thr_prgr | need_mr_wrk)) {
need_thr_prgr = ddq_check_incoming(ddq);
*need_thr_progress |= need_thr_prgr;
+ if (need_thr_prgr)
+ store_earliest_thr_prgr(thr_prgr_p, ddq);
}
if (allctr->thread_safe && !allctr_locked)
@@ -1075,36 +1125,41 @@ handle_delayed_dealloc(Allctr_t *allctr,
}
static ERTS_INLINE void
-enqueue_dealloc_other_instance(ErtsAlcType_t type, Allctr_t *allctr, void *ptr)
+enqueue_dealloc_other_instance(ErtsAlcType_t type,
+ Allctr_t *allctr,
+ void *ptr,
+ int cinit)
{
if (allctr->fix)
((UWord *) ptr)[ERTS_ALCU_DD_FIX_TYPE_OFFS] = (UWord) type;
- if (ddq_enqueue(type, &allctr->dd.q, ptr))
+ if (ddq_enqueue(type, &allctr->dd.q, ptr, cinit))
erts_alloc_notify_delayed_dealloc(allctr->ix);
}
#endif
+#ifdef ERTS_SMP
void
erts_alcu_check_delayed_dealloc(Allctr_t *allctr,
int limit,
int *need_thr_progress,
+ ErtsThrPrgrVal *thr_prgr_p,
int *more_work)
{
-#ifdef ERTS_SMP
handle_delayed_dealloc(allctr,
0,
limit,
ERTS_ALCU_DD_OPS_LIM_HIGH,
need_thr_progress,
+ thr_prgr_p,
more_work);
-#endif
}
+#endif
#define ERTS_ALCU_HANDLE_DD_IN_OP(Allctr, Locked) \
handle_delayed_dealloc((Allctr), (Locked), 1, \
- ERTS_ALCU_DD_OPS_LIM_LOW, NULL, NULL)
+ ERTS_ALCU_DD_OPS_LIM_LOW, NULL, NULL, NULL)
/* Multi block carrier alloc/realloc/free ... */
@@ -3594,7 +3649,11 @@ erts_alcu_free_thr_pref(ErtsAlcType_t type, void *extra, void *p)
get_pref_allctr(extra, &pref_allctr);
ptr = get_used_allctr(extra, p, &used_allctr, NULL);
if (pref_allctr != used_allctr)
- enqueue_dealloc_other_instance(type, used_allctr, ptr);
+ enqueue_dealloc_other_instance(type,
+ used_allctr,
+ ptr,
+ (used_allctr->dd.ix
+ - pref_allctr->dd.ix));
else {
if (used_allctr->thread_safe)
erts_mtx_lock(&used_allctr->mutex);
@@ -3969,7 +4028,11 @@ realloc_thr_pref(ErtsAlcType_t type, void *extra, void *p, Uint size,
sys_memcpy(res, p, cpy_size);
if (!force_move || used_allctr != pref_allctr)
- enqueue_dealloc_other_instance(type, used_allctr, ptr);
+ enqueue_dealloc_other_instance(type,
+ used_allctr,
+ ptr,
+ (used_allctr->dd.ix
+ - pref_allctr->dd.ix));
else {
do_erts_alcu_free(type, used_allctr, ptr);
ASSERT(pref_allctr == used_allctr);
@@ -4160,6 +4223,7 @@ erts_alcu_start(Allctr_t *allctr, AllctrInit_t *init)
allctr->dd.use = 1;
init_dd_queue(&allctr->dd.q);
+ allctr->dd.ix = init->ix;
}
else
#endif
diff --git a/erts/emulator/beam/erl_alloc_util.h b/erts/emulator/beam/erl_alloc_util.h
index fc1eddb116..cedf4ccf85 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2012. 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
@@ -170,7 +170,9 @@ Eterm erts_alcu_info(Allctr_t *, int, int *, void *, Uint **, Uint *);
void erts_alcu_init(AlcUInit_t *);
void erts_alcu_current_size(Allctr_t *, AllctrSize_t *,
ErtsAlcUFixInfo_t *, int);
-void erts_alcu_check_delayed_dealloc(Allctr_t *, int, int *, int *);
+#ifdef ERTS_SMP
+void erts_alcu_check_delayed_dealloc(Allctr_t *, int, int *, ErtsThrPrgrVal *, int *);
+#endif
erts_aint32_t erts_alcu_fix_alloc_shrink(Allctr_t *, erts_aint32_t);
#endif
diff --git a/erts/emulator/beam/erl_async.c b/erts/emulator/beam/erl_async.c
index 8bca9ae582..c5f432bea1 100644
--- a/erts/emulator/beam/erl_async.c
+++ b/erts/emulator/beam/erl_async.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2012. 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
@@ -26,6 +26,7 @@
#include "erl_threads.h"
#include "erl_thr_queue.h"
#include "erl_async.h"
+#include "dtrace-wrapper.h"
#define ERTS_MAX_ASYNC_READY_CALLS_IN_SEQ 20
@@ -121,6 +122,17 @@ typedef struct {
#endif
} ErtsAsyncData;
+#if defined(USE_THREADS) && defined(USE_VM_PROBES)
+
+/*
+ * Some compilers, e.g. GCC 4.2.1 and -O3, will optimize away DTrace
+ * calls if they're the last thing in the function. :-(
+ * Many thanks to Trond Norbye, via:
+ * https://github.com/memcached/memcached/commit/6298b3978687530bc9d219b6ac707a1b681b2a46
+ */
+static unsigned gcc_optimizer_hack = 0;
+#endif
+
int erts_async_max_threads; /* Initialized by erl_init.c */
int erts_async_thread_suggested_stack_size; /* Initialized by erl_init.c */
@@ -244,6 +256,10 @@ erts_get_async_ready_queue(Uint sched_id)
static ERTS_INLINE void async_add(ErtsAsync *a, ErtsAsyncQ* q)
{
+#ifdef USE_VM_PROBES
+ int len;
+#endif
+
if (is_internal_port(a->port)) {
#if ERTS_USE_ASYNC_READY_Q
ErtsAsyncReadyQ *arq = async_ready_q(a->sched_id);
@@ -259,6 +275,17 @@ static ERTS_INLINE void async_add(ErtsAsync *a, ErtsAsyncQ* q)
#endif
erts_thr_q_enqueue(&q->thr_q, a);
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(aio_pool_add)) {
+ DTRACE_CHARBUF(port_str, 16);
+
+ erts_snprintf(port_str, sizeof(port_str), "%T", a->port);
+ /* DTRACE TODO: Get the queue length from erts_thr_q_enqueue() ? */
+ len = -1;
+ DTRACE2(aio_pool_add, port_str, len);
+ }
+ gcc_optimizer_hack++;
+#endif
}
static ERTS_INLINE ErtsAsync *async_get(ErtsThrQ_t *q,
@@ -269,6 +296,9 @@ static ERTS_INLINE ErtsAsync *async_get(ErtsThrQ_t *q,
int saved_fin_deq = 0;
ErtsThrQFinDeQ_t fin_deq;
#endif
+#ifdef USE_VM_PROBES
+ int len;
+#endif
while (1) {
ErtsAsync *a = (ErtsAsync *) erts_thr_q_dequeue(q);
@@ -280,7 +310,16 @@ 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_VM_PROBES
+ if (DTRACE_ENABLED(aio_pool_get)) {
+ DTRACE_CHARBUF(port_str, 16);
+ erts_snprintf(port_str, sizeof(port_str), "%T", a->port);
+ /* DTRACE TODO: Get the length from erts_thr_q_dequeue() ? */
+ len = -1;
+ DTRACE2(aio_pool_get, port_str, len);
+ }
+#endif
return a;
}
@@ -358,6 +397,8 @@ static ERTS_INLINE void call_async_ready(ErtsAsync *a)
}
erts_port_release(p);
}
+ if (a->pdl)
+ driver_pdl_dec_refc(a->pdl);
if (a->hndl)
erts_ddll_dereference_driver(a->hndl);
}
@@ -367,9 +408,6 @@ static ERTS_INLINE void async_reply(ErtsAsync *a, ErtsThrQPrepEnQ_t *prep_enq)
#if ERTS_USE_ASYNC_READY_Q
ErtsAsyncReadyQ *arq;
- if (a->pdl)
- driver_pdl_dec_refc(a->pdl);
-
#if ERTS_ASYNC_PRINT_JOB
erts_fprintf(stderr, "=>> %ld\n", a->async_id);
#endif
@@ -389,8 +427,6 @@ static ERTS_INLINE void async_reply(ErtsAsync *a, ErtsThrQPrepEnQ_t *prep_enq)
#else /* ERTS_USE_ASYNC_READY_Q */
call_async_ready(a);
- if (a->pdl)
- driver_pdl_dec_refc(a->pdl);
erts_free(ERTS_ALC_T_ASYNC, (void *) a);
#endif /* ERTS_USE_ASYNC_READY_Q */
diff --git a/erts/emulator/beam/erl_bif_binary.c b/erts/emulator/beam/erl_bif_binary.c
index cc4f2be8eb..474151d454 100644
--- a/erts/emulator/beam/erl_bif_binary.c
+++ b/erts/emulator/beam/erl_bif_binary.c
@@ -72,52 +72,29 @@ binary_matches(Process *p, Eterm arg1, Eterm arg2, Eterm arg3);
void erts_init_bif_binary(void)
{
- sys_memset((void *) &binary_match_trap_export, 0, sizeof(Export));
- binary_match_trap_export.address = &binary_match_trap_export.code[3];
- binary_match_trap_export.code[0] = am_erlang;
- binary_match_trap_export.code[1] = am_binary_match_trap;
- binary_match_trap_export.code[2] = 3;
- binary_match_trap_export.code[3] = (BeamInstr) em_apply_bif;
- binary_match_trap_export.code[4] = (BeamInstr) &binary_match_trap;
-
- sys_memset((void *) &binary_matches_trap_export, 0, sizeof(Export));
- binary_matches_trap_export.address = &binary_matches_trap_export.code[3];
- binary_matches_trap_export.code[0] = am_erlang;
- binary_matches_trap_export.code[1] = am_binary_matches_trap;
- binary_matches_trap_export.code[2] = 3;
- binary_matches_trap_export.code[3] = (BeamInstr) em_apply_bif;
- binary_matches_trap_export.code[4] = (BeamInstr) &binary_matches_trap;
-
- sys_memset((void *) &binary_longest_prefix_trap_export, 0, sizeof(Export));
- binary_longest_prefix_trap_export.address = &binary_longest_prefix_trap_export.code[3];
- binary_longest_prefix_trap_export.code[0] = am_erlang;
- binary_longest_prefix_trap_export.code[1] = am_binary_longest_prefix_trap;
- binary_longest_prefix_trap_export.code[2] = 3;
- binary_longest_prefix_trap_export.code[3] = (BeamInstr) em_apply_bif;
- binary_longest_prefix_trap_export.code[4] = (BeamInstr) &binary_longest_prefix_trap;
-
- sys_memset((void *) &binary_longest_suffix_trap_export, 0, sizeof(Export));
- binary_longest_suffix_trap_export.address = &binary_longest_suffix_trap_export.code[3];
- binary_longest_suffix_trap_export.code[0] = am_erlang;
- binary_longest_suffix_trap_export.code[1] = am_binary_longest_suffix_trap;
- binary_longest_suffix_trap_export.code[2] = 3;
- binary_longest_suffix_trap_export.code[3] = (BeamInstr) em_apply_bif;
- binary_longest_suffix_trap_export.code[4] = (BeamInstr) &binary_longest_suffix_trap;
-
- sys_memset((void *) &binary_bin_to_list_trap_export, 0, sizeof(Export));
- binary_bin_to_list_trap_export.address = &binary_bin_to_list_trap_export.code[3];
- binary_bin_to_list_trap_export.code[0] = am_erlang;
- binary_bin_to_list_trap_export.code[1] = am_binary_bin_to_list_trap;
- binary_bin_to_list_trap_export.code[2] = 3;
- binary_bin_to_list_trap_export.code[3] = (BeamInstr) em_apply_bif;
- binary_bin_to_list_trap_export.code[4] = (BeamInstr) &binary_bin_to_list_trap;
- sys_memset((void *) &binary_copy_trap_export, 0, sizeof(Export));
- binary_copy_trap_export.address = &binary_copy_trap_export.code[3];
- binary_copy_trap_export.code[0] = am_erlang;
- binary_copy_trap_export.code[1] = am_binary_copy_trap;
- binary_copy_trap_export.code[2] = 2;
- binary_copy_trap_export.code[3] = (BeamInstr) em_apply_bif;
- binary_copy_trap_export.code[4] = (BeamInstr) &binary_copy_trap;
+ erts_init_trap_export(&binary_match_trap_export,
+ am_erlang, am_binary_match_trap, 3,
+ &binary_match_trap);
+
+ erts_init_trap_export(&binary_matches_trap_export,
+ am_erlang, am_binary_matches_trap, 3,
+ &binary_matches_trap);
+
+ erts_init_trap_export(&binary_longest_prefix_trap_export,
+ am_erlang, am_binary_longest_prefix_trap, 3,
+ &binary_longest_prefix_trap);
+
+ erts_init_trap_export(&binary_longest_suffix_trap_export,
+ am_erlang, am_binary_longest_suffix_trap, 3,
+ &binary_longest_suffix_trap);
+
+ erts_init_trap_export(&binary_bin_to_list_trap_export,
+ am_erlang, am_binary_bin_to_list_trap, 3,
+ &binary_bin_to_list_trap);
+
+ erts_init_trap_export(&binary_copy_trap_export,
+ am_erlang, am_binary_copy_trap, 2,
+ &binary_copy_trap);
max_loop_limit = 0;
return;
diff --git a/erts/emulator/beam/erl_bif_chksum.c b/erts/emulator/beam/erl_bif_chksum.c
index 06b7ffdf32..ff5ce3cc7a 100644
--- a/erts/emulator/beam/erl_bif_chksum.c
+++ b/erts/emulator/beam/erl_bif_chksum.c
@@ -42,16 +42,9 @@ static Export chksum_md5_2_exp;
void erts_init_bif_chksum(void)
{
/* Non visual BIF to trap to. */
- memset(&chksum_md5_2_exp, 0, sizeof(Export));
- chksum_md5_2_exp.address =
- &chksum_md5_2_exp.code[3];
- chksum_md5_2_exp.code[0] = am_erlang;
- chksum_md5_2_exp.code[1] = am_atom_put("md5_trap",8);
- chksum_md5_2_exp.code[2] = 2;
- chksum_md5_2_exp.code[3] =
- (BeamInstr) em_apply_bif;
- chksum_md5_2_exp.code[4] =
- (BeamInstr) &md5_2;
+ erts_init_trap_export(&chksum_md5_2_exp,
+ am_erlang, am_atom_put("md5_trap",8), 2,
+ &md5_2);
}
diff --git a/erts/emulator/beam/erl_bif_ddll.c b/erts/emulator/beam/erl_bif_ddll.c
index 37d540b41b..7f7c975e78 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2012. 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
@@ -45,6 +45,7 @@
#include "big.h"
#include "dist.h"
#include "erl_version.h"
+#include "dtrace-wrapper.h"
#ifdef ERTS_SMP
#define DDLL_SMP 1
@@ -367,13 +368,11 @@ BIF_RETTYPE erl_ddll_try_load_3(BIF_ALIST_3)
#endif
for (j = 0; j < erts_max_ports; j++) {
Port* prt = &erts_port[j];
-#ifdef DDLL_SMP
erts_smp_port_state_lock(prt);
-#endif
if (!(prt->status & FREE_PORT_FLAGS) &&
prt->drv_ptr->handle == dh) {
-#if DDLL_SMP
erts_smp_atomic_inc_nob(&prt->refc);
+#if DDLL_SMP
/* Extremely rare spinlock */
while(prt->status & ERTS_PORT_SFLG_INITIALIZING) {
erts_smp_port_state_unlock(prt);
@@ -597,13 +596,11 @@ done:
#endif
for (j = 0; j < erts_max_ports; j++) {
Port* prt = &erts_port[j];
-#if DDLL_SMP
erts_smp_port_state_lock(prt);
-#endif
if (!(prt->status & FREE_PORT_FLAGS)
&& prt->drv_ptr->handle == dh) {
-#if DDLL_SMP
erts_smp_atomic_inc_nob(&prt->refc);
+#if DDLL_SMP
/* Extremely rare spinlock */
while(prt->status & ERTS_PORT_SFLG_INITIALIZING) {
erts_smp_port_state_unlock(prt);
@@ -1059,13 +1056,11 @@ void erts_ddll_proc_dead(Process *p, ErtsProcLocks plocks)
#endif
for (j = 0; j < erts_max_ports; j++) {
Port* prt = &erts_port[j];
-#if DDLL_SMP
erts_smp_port_state_lock(prt);
-#endif
if (!(prt->status & FREE_PORT_FLAGS) &&
prt->drv_ptr->handle == dh) {
-#if DDLL_SMP
erts_smp_atomic_inc_nob(&prt->refc);
+#if DDLL_SMP
while(prt->status & ERTS_PORT_SFLG_INITIALIZING) {
erts_smp_port_state_unlock(prt);
erts_smp_port_state_lock(prt);
@@ -1647,6 +1642,7 @@ static int do_unload_driver_entry(DE_Handle *dh, Eterm *save_name)
diver_list lock here!*/
if (q->finish) {
int fpe_was_unmasked = erts_block_fpe();
+ DTRACE1(driver_finish, q->name);
(*(q->finish))();
erts_unblock_fpe(fpe_was_unmasked);
}
@@ -1760,7 +1756,11 @@ 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, bp, mess, am_undefined);
+ erts_queue_message(proc, &rp_locks, bp, mess, am_undefined
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
erts_smp_proc_unlock(proc, rp_locks);
ERTS_SMP_CHK_NO_PROC_LOCKS;
}
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index 5a806777fe..a3811ccdb0 100644..100755
--- 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2012. 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
@@ -25,7 +25,6 @@
#include "erl_vm.h"
#include "global.h"
#include "erl_process.h"
-#include "erl_nmgc.h"
#include "error.h"
#include "erl_driver.h"
#include "bif.h"
@@ -57,6 +56,8 @@
static Export* alloc_info_trap = NULL;
static Export* alloc_sizes_trap = NULL;
+static Export *gather_sched_wall_time_res_trap;
+
#define DECL_AM(S) Eterm AM_ ## S = am_atom_put(#S, sizeof(#S) - 1)
/* Keep erts_system_version as a global variable for easy access from a core */
@@ -87,12 +88,6 @@ static char erts_system_version[] = ("Erlang " ERLANG_OTP_RELEASE
#ifdef ERTS_ENABLE_KERNEL_POLL
" [kernel-poll:%s]"
#endif
-#ifdef HYBRID
- " [hybrid heap]"
-#endif
-#ifdef INCREMENTAL
- " [incremental GC]"
-#endif
#ifdef ET_DEBUG
#if ET_DEBUG
" [type-assertions]"
@@ -113,6 +108,12 @@ static char erts_system_version[] = ("Erlang " ERLANG_OTP_RELEASE
#ifdef VALGRIND
" [valgrind-compiled]"
#endif
+#ifdef USE_DTRACE
+ " [dtrace]"
+#endif
+#ifdef USE_SYSTEMTAP
+ " [systemtap]"
+#endif
"\n");
#define ASIZE(a) (sizeof(a)/sizeof(a[0]))
@@ -568,9 +569,6 @@ static Eterm pi_args[] = {
am_min_bin_vheap_size,
am_current_location,
am_current_stacktrace,
-#ifdef HYBRID
- am_message_binary
-#endif
};
#define ERTS_PI_ARGS ((int) (sizeof(pi_args)/sizeof(Eterm)))
@@ -618,9 +616,6 @@ pi_arg2ix(Eterm arg)
case am_min_bin_vheap_size: return 28;
case am_current_location: return 29;
case am_current_stacktrace: return 30;
-#ifdef HYBRID
- case am_message_binary: return 31;
-#endif
default: return -1;
}
}
@@ -1073,12 +1068,8 @@ process_info_aux(Process *BIF_P,
if (rp != BIF_P) {
Eterm msg = ERL_MESSAGE_TERM(mq[i].msgp);
if (is_value(msg)) {
- mq[i].copy_struct_size = (is_immed(msg)
-#ifdef HYBRID
- || NO_COPY(msg)
-#endif
- ? 0
- : size_object(msg));
+ mq[i].copy_struct_size = (is_immed(msg)? 0 :
+ size_object(msg));
}
else if (mq[i].msgp->data.attached) {
mq[i].copy_struct_size
@@ -1347,13 +1338,15 @@ process_info_aux(Process *BIF_P,
hp = HAlloc(BIF_P, 3);
break;
- case am_trap_exit:
+ case am_trap_exit: {
+ erts_aint32_t state = erts_smp_atomic32_read_nob(&rp->state);
hp = HAlloc(BIF_P, 3);
- if (rp->flags & F_TRAPEXIT)
+ if (state & ERTS_PSFLG_TRAP_EXIT)
res = am_true;
else
res = am_false;
break;
+ }
case am_error_handler:
hp = HAlloc(BIF_P, 3);
@@ -1518,16 +1511,6 @@ process_info_aux(Process *BIF_P,
break;
}
-#ifdef HYBRID
- case am_message_binary: {
- Uint sz = 3;
- (void) bld_bin_list(NULL, &sz, erts_global_offheap.mso);
- hp = HAlloc(BIF_P, sz);
- res = bld_bin_list(&hp, NULL, erts_global_offheap.mso);
- break;
- }
-#endif
-
case am_sequential_trace_token:
res = copy_object(rp->seq_trace_token, BIF_P);
hp = HAlloc(BIF_P, 3);
@@ -1716,7 +1699,7 @@ static int check_if_xml(void)
{
char buf[1];
size_t bufsz = sizeof(buf);
- return erts_sys_getenv("VALGRIND_LOG_XML", buf, &bufsz) >= 0;
+ return erts_sys_getenv_raw("VALGRIND_LOG_XML", buf, &bufsz) >= 0;
}
#else
#define check_if_xml() 0
@@ -2346,36 +2329,8 @@ BIF_RETTYPE system_info_1(BIF_ALIST_1)
#endif
} else if (BIF_ARG_1 == am_heap_sizes) {
return erts_heap_sizes(BIF_P);
- } else if (BIF_ARG_1 == am_global_heaps_size) {
-#ifdef HYBRID
- Uint hsz = 0;
- Uint sz = 0;
-
- sz += global_heap_sz;
-#ifdef INCREMENTAL
- /* The size of the old generation is a bit hard to define here...
- * The amount of live data in the last collection perhaps..? */
- sz = 0;
-#else
- if (global_old_hend && global_old_heap)
- sz += global_old_hend - global_old_heap;
-#endif
-
- sz *= sizeof(Eterm);
-
- (void) erts_bld_uint(NULL, &hsz, sz);
- hp = hsz ? HAlloc(BIF_P, hsz) : NULL;
- res = erts_bld_uint(&hp, NULL, sz);
-#else
- res = make_small(0);
-#endif
- return res;
} else if (BIF_ARG_1 == am_heap_type) {
-#if defined(HYBRID)
- return am_hybrid;
-#else
return am_private;
-#endif
} else if (ERTS_IS_ATOM_STR("cpu_topology", BIF_ARG_1)) {
res = erts_get_cpu_topology_term(BIF_P, am_used);
BIF_TRAP1(erts_format_cpu_topology_trap, BIF_P, res);
@@ -2718,6 +2673,24 @@ BIF_RETTYPE system_info_1(BIF_ALIST_1)
#endif
BIF_RET(am_true);
}
+ else if (ERTS_IS_ATOM_STR("dynamic_trace", BIF_ARG_1)) {
+#if defined(USE_DTRACE)
+ DECL_AM(dtrace);
+ BIF_RET(AM_dtrace);
+#elif defined(USE_SYSTEMTAP)
+ DECL_AM(systemtap);
+ BIF_RET(AM_systemtap);
+#else
+ BIF_RET(am_none);
+#endif
+ }
+ else if (ERTS_IS_ATOM_STR("dynamic_trace_probes", BIF_ARG_1)) {
+#if defined(USE_VM_PROBES)
+ BIF_RET(am_true);
+#else
+ BIF_RET(am_false);
+#endif
+ }
#ifdef ERTS_SMP
else if (ERTS_IS_ATOM_STR("thread_progress", BIF_ARG_1)) {
erts_thr_progress_dbg_print_state();
@@ -2739,7 +2712,8 @@ port_info_1(BIF_ALIST_1)
am_id,
am_connected,
am_input,
- am_output
+ am_output,
+ am_os_pid
};
Eterm items[ASIZE(keys)];
Eterm result = NIL;
@@ -2796,6 +2770,7 @@ port_info_1(BIF_ALIST_1)
** name String
** input Number of bytes input from port program
** output Number of bytes output to the port program
+** os_pid The child's process ID
*/
BIF_RETTYPE port_info_2(BIF_ALIST_2)
@@ -2896,6 +2871,18 @@ static BIF_RETTYPE port_info(Process* p, Eterm portid, Eterm item)
hp = HAlloc(p, hsz);
res = erts_bld_uint(&hp, NULL, n);
}
+ else if (item == am_os_pid) {
+ if (prt->os_pid >= 0) {
+ Uint hsz = 3;
+ UWord n = prt->os_pid;
+ (void) erts_bld_uword(NULL, &hsz, n);
+ hp = HAlloc(p, hsz);
+ res = erts_bld_uword(&hp, NULL, n);
+ } else {
+ hp = HAlloc(p, 3);
+ res = am_undefined;
+ }
+ }
else if (item == am_registered_name) {
RegProc *reg;
reg = prt->reg;
@@ -3113,15 +3100,13 @@ BIF_RETTYPE is_process_alive_1(BIF_ALIST_1)
if(internal_pid_index(BIF_ARG_1) >= erts_max_processes)
BIF_ERROR(BIF_P, BADARG);
- rp = erts_pid2proc(BIF_P, ERTS_PROC_LOCK_MAIN,
- BIF_ARG_1, ERTS_PROC_LOCK_STATUS);
+ rp = erts_proc_lookup(BIF_ARG_1);
if (!rp) {
BIF_RET(am_false);
}
else {
- int have_pending_exit = ERTS_PROC_PENDING_EXIT(rp);
- erts_smp_proc_unlock(rp, ERTS_PROC_LOCK_STATUS);
- if (have_pending_exit)
+ if (erts_smp_atomic32_read_acqb(&rp->state)
+ & (ERTS_PSFLG_PENDING_EXIT|ERTS_PSFLG_EXITING))
ERTS_BIF_AWAIT_X_DATA_TRAP(BIF_P, BIF_ARG_1, am_false);
else
BIF_RET(am_true);
@@ -3180,7 +3165,12 @@ BIF_RETTYPE statistics_1(BIF_ALIST_1)
Eterm res;
Eterm* hp;
- if (BIF_ARG_1 == am_context_switches) {
+ if (BIF_ARG_1 == am_scheduler_wall_time) {
+ res = erts_sched_wall_time_request(BIF_P, 0, 0);
+ if (is_non_value(res))
+ BIF_RET(am_undefined);
+ BIF_TRAP1(gather_sched_wall_time_res_trap, BIF_P, res);
+ } else if (BIF_ARG_1 == am_context_switches) {
Eterm cs = erts_make_integer(erts_get_total_context_switches(), BIF_P);
hp = HAlloc(BIF_P, 3);
res = TUPLE2(hp, cs, SMALL_ZERO);
@@ -3720,9 +3710,8 @@ BIF_RETTYPE erts_debug_set_internal_state_2(BIF_ALIST_2)
&& is_internal_pid(tp[2])) {
int xres;
ErtsProcLocks rp_locks = ERTS_PROC_LOCKS_XSIG_SEND;
- Process *rp = erts_pid2proc_opt(BIF_P, ERTS_PROC_LOCK_MAIN,
- tp[2], rp_locks,
- ERTS_P2P_FLG_SMP_INC_REFC);
+ Process *rp = erts_pid2proc(BIF_P, ERTS_PROC_LOCK_MAIN,
+ tp[2], rp_locks);
if (!rp) {
DECL_AM(dead);
BIF_RET(AM_dead);
@@ -3748,7 +3737,6 @@ BIF_RETTYPE erts_debug_set_internal_state_2(BIF_ALIST_2)
rp_locks &= ~ERTS_PROC_LOCK_MAIN;
#endif
erts_smp_proc_unlock(rp, rp_locks);
- erts_smp_proc_dec_refc(rp);
if (xres > 1) {
DECL_AM(message);
BIF_RET(AM_message);
@@ -3959,7 +3947,7 @@ static Eterm lcnt_build_lock_term(Eterm **hpp, Uint *szp, erts_lcnt_lock_t *lock
id = am_atom_put(ltype, strlen(ltype));
} else if (lock->flag & ERTS_LCNT_LT_PROCLOCK) {
/* use registered names as id's for process locks if available */
- proc = erts_pid2proc_unlocked(lock->id);
+ proc = erts_proc_lookup(lock->id);
if (proc && proc->reg) {
id = proc->reg->name;
} else {
@@ -4079,48 +4067,52 @@ BIF_RETTYPE erts_debug_lock_counters_1(BIF_ALIST_1)
Eterm* tp = tuple_val(BIF_ARG_1);
switch (arityval(tp[0])) {
- case 2:
+ case 2: {
+ int opt = 0;
+ int val = 0;
if (ERTS_IS_ATOM_STR("copy_save", tp[1])) {
- erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
- erts_smp_thr_progress_block();
- if (tp[2] == am_true) {
-
- res = erts_lcnt_set_rt_opt(ERTS_LCNT_OPT_COPYSAVE) ? am_true : am_false;
-
- } else if (tp[2] == am_false) {
-
- res = erts_lcnt_clear_rt_opt(ERTS_LCNT_OPT_COPYSAVE) ? am_true : am_false;
-
- } else {
- erts_smp_thr_progress_unblock();
- erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
- BIF_ERROR(BIF_P, BADARG);
- }
- erts_smp_thr_progress_unblock();
- erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
- BIF_RET(res);
-
+ opt = ERTS_LCNT_OPT_COPYSAVE;
} else if (ERTS_IS_ATOM_STR("process_locks", tp[1])) {
- erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
- erts_smp_thr_progress_block();
- if (tp[2] == am_true) {
-
- res = erts_lcnt_set_rt_opt(ERTS_LCNT_OPT_PROCLOCK) ? am_true : am_false;
-
- } else if (tp[2] == am_false) {
-
- res = erts_lcnt_set_rt_opt(ERTS_LCNT_OPT_PROCLOCK) ? am_true : am_false;
+ opt = ERTS_LCNT_OPT_PROCLOCK;
+ } else if (ERTS_IS_ATOM_STR("port_locks", tp[1])) {
+ opt = ERTS_LCNT_OPT_PORTLOCK;
+ } else if (ERTS_IS_ATOM_STR("suspend", tp[1])) {
+ opt = ERTS_LCNT_OPT_SUSPEND;
+ } else if (ERTS_IS_ATOM_STR("location", tp[1])) {
+ opt = ERTS_LCNT_OPT_LOCATION;
+ } else {
+ BIF_ERROR(BIF_P, BADARG);
+ }
+ if (tp[2] == am_true) {
+ val = 1;
+ } else if (tp[2] == am_false) {
+ val = 0;
+ } else {
+ BIF_ERROR(BIF_P, BADARG);
+ }
- } else {
- erts_smp_thr_progress_unblock();
- erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
- BIF_ERROR(BIF_P, BADARG);
+ erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
+ erts_smp_thr_progress_block();
+
+ if (val) {
+ res = erts_lcnt_set_rt_opt(opt) ? am_true : am_false;
+ } else {
+ res = erts_lcnt_clear_rt_opt(opt) ? am_true : am_false;
+ }
+#ifdef ERTS_SMP
+ if (res != tp[2]) {
+ if (opt == ERTS_LCNT_OPT_PORTLOCK) {
+ erts_lcnt_enable_io_lock_count(val);
+ } else if (opt == ERTS_LCNT_OPT_PROCLOCK) {
+ erts_lcnt_enable_proc_lock_count(val);
}
- erts_smp_thr_progress_unblock();
- erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
- BIF_RET(res);
- }
- break;
+ }
+#endif
+ erts_smp_thr_progress_unblock();
+ erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
+ BIF_RET(res);
+ break;
+ }
default:
break;
@@ -4160,6 +4152,8 @@ erts_bif_info_init(void)
alloc_info_trap = erts_export_put(am_erlang, am_alloc_info, 1);
alloc_sizes_trap = erts_export_put(am_erlang, am_alloc_sizes, 1);
+ gather_sched_wall_time_res_trap
+ = erts_export_put(am_erlang, am_gather_sched_wall_time_result, 1);
process_info_init();
os_info_init();
}
diff --git a/erts/emulator/beam/erl_bif_os.c b/erts/emulator/beam/erl_bif_os.c
index 58d48199fa..1062d4379b 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-2010. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2012. 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
@@ -58,7 +58,7 @@ BIF_RETTYPE os_getpid_0(BIF_ALIST_0)
char pid_string[21]; /* enough for a 64 bit number */
int n;
Eterm* hp;
- sys_get_pid(pid_string); /* In sys.c */
+ sys_get_pid(pid_string, sizeof(pid_string)); /* In sys.c */
n = sys_strlen(pid_string);
hp = HAlloc(BIF_P, n*2);
BIF_RET(buf_to_intlist(&hp, pid_string, n, NIL));
@@ -71,15 +71,13 @@ BIF_RETTYPE os_getenv_0(BIF_ALIST_0)
Eterm* hp;
Eterm ret;
Eterm str;
- int len;
init_getenv_state(&state);
ret = NIL;
while ((cp = getenv_string(&state)) != NULL) {
- len = strlen(cp);
- hp = HAlloc(BIF_P, len*2+2);
- str = buf_to_intlist(&hp, cp, len, NIL);
+ str = erts_convert_native_to_filename(BIF_P,(byte *)cp);
+ hp = HAlloc(BIF_P, 2);
ret = CONS(hp, str, ret);
}
@@ -88,32 +86,30 @@ BIF_RETTYPE os_getenv_0(BIF_ALIST_0)
return ret;
}
-
+#define STATIC_BUF_SIZE 1024
BIF_RETTYPE os_getenv_1(BIF_ALIST_1)
{
Process* p = BIF_P;
- Eterm key = BIF_ARG_1;
Eterm str;
- int len, res;
+ Sint len;
+ int res;
char *key_str, *val;
- char buf[1024];
+ char buf[STATIC_BUF_SIZE];
size_t val_size = sizeof(buf);
- len = is_string(key);
- if (!len) {
+ key_str = erts_convert_filename_to_native(BIF_ARG_1,buf,STATIC_BUF_SIZE,
+ ERTS_ALC_T_TMP,1,0,&len);
+
+ if (!key_str) {
BIF_ERROR(p, BADARG);
}
- /* Leave at least one byte in buf for value */
- key_str = len < sizeof(buf)-2 ? &buf[0] : erts_alloc(ERTS_ALC_T_TMP, len+1);
- if (intlist_to_buf(key, key_str, len) != len)
- erl_exit(1, "%s:%d: Internal error\n", __FILE__, __LINE__);
- key_str[len] = '\0';
if (key_str != &buf[0])
val = &buf[0];
else {
- val_size -= len + 1;
- val = &buf[len + 1];
+ /* len includes zero byte */
+ val_size -= len;
+ val = &buf[len];
}
res = erts_sys_getenv(key_str, val, &val_size);
@@ -121,7 +117,6 @@ BIF_RETTYPE os_getenv_1(BIF_ALIST_1)
no_var:
str = am_false;
} else {
- Eterm* hp;
if (res > 0) {
val = erts_alloc(ERTS_ALC_T_TMP, val_size);
while (1) {
@@ -134,9 +129,7 @@ BIF_RETTYPE os_getenv_1(BIF_ALIST_1)
val = erts_realloc(ERTS_ALC_T_TMP, val, val_size);
}
}
- if (val_size)
- hp = HAlloc(p, val_size*2);
- str = buf_to_intlist(&hp, val, val_size, NIL);
+ str = erts_convert_native_to_filename(p,(byte *)val);
}
if (key_str != &buf[0])
erts_free(ERTS_ALC_T_TMP, key_str);
@@ -147,46 +140,43 @@ BIF_RETTYPE os_getenv_1(BIF_ALIST_1)
BIF_RETTYPE os_putenv_2(BIF_ALIST_2)
{
- Process* p = BIF_P;
- Eterm key = BIF_ARG_1;
- Eterm value = BIF_ARG_2;
- char def_buf[1024];
- char *buf = NULL;
- int sep_ix, i, key_len, value_len, tot_len;
- key_len = is_string(key);
- if (!key_len) {
- error:
- if (buf)
- erts_free(ERTS_ALC_T_TMP, (void *) buf);
- BIF_ERROR(p, BADARG);
+ char def_buf_key[STATIC_BUF_SIZE];
+ char def_buf_value[STATIC_BUF_SIZE];
+ char *key_buf, *value_buf;
+
+ key_buf = erts_convert_filename_to_native(BIF_ARG_1,def_buf_key,
+ STATIC_BUF_SIZE,
+ ERTS_ALC_T_TMP,0,0,NULL);
+ if (!key_buf) {
+ BIF_ERROR(BIF_P, BADARG);
}
- if (is_nil(value))
- value_len = 0;
- else {
- value_len = is_string(value);
- if (!value_len)
- goto error;
+ value_buf = erts_convert_filename_to_native(BIF_ARG_2,def_buf_value,
+ STATIC_BUF_SIZE,
+ ERTS_ALC_T_TMP,1,0,
+ NULL);
+ if (!value_buf) {
+ if (key_buf != def_buf_key) {
+ erts_free(ERTS_ALC_T_TMP, key_buf);
+ }
+ BIF_ERROR(BIF_P, BADARG);
+ }
+
+
+ if (erts_sys_putenv(key_buf, value_buf)) {
+ if (key_buf != def_buf_key) {
+ erts_free(ERTS_ALC_T_TMP, key_buf);
+ }
+ if (value_buf != def_buf_value) {
+ erts_free(ERTS_ALC_T_TMP, value_buf);
+ }
+ BIF_ERROR(BIF_P, BADARG);
+ }
+ if (key_buf != def_buf_key) {
+ erts_free(ERTS_ALC_T_TMP, key_buf);
}
- tot_len = key_len + 1 + value_len + 1;
- if (tot_len <= sizeof(def_buf))
- buf = &def_buf[0];
- else
- buf = erts_alloc(ERTS_ALC_T_TMP, tot_len);
- i = intlist_to_buf(key, buf, key_len);
- if (i != key_len)
- erl_exit(1, "%s:%d: Internal error\n", __FILE__, __LINE__);
- sep_ix = i;
- buf[i++] = '=';
- if (is_not_nil(value))
- i += intlist_to_buf(value, &buf[i], value_len);
- if (i != key_len + 1 + value_len)
- erl_exit(1, "%s:%d: Internal error\n", __FILE__, __LINE__);
- buf[i] = '\0';
- if (erts_sys_putenv(buf, sep_ix)) {
- goto error;
+ if (value_buf != def_buf_value) {
+ erts_free(ERTS_ALC_T_TMP, value_buf);
}
- if (buf != &def_buf[0])
- erts_free(ERTS_ALC_T_TMP, (void *) buf);
BIF_RET(am_true);
}
diff --git a/erts/emulator/beam/erl_bif_port.c b/erts/emulator/beam/erl_bif_port.c
index cd423eb200..f9009166c0 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2012. 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
@@ -40,6 +40,7 @@
#include "external.h"
#include "packet_parser.h"
#include "erl_bits.h"
+#include "dtrace-wrapper.h"
static int open_port(Process* p, Eterm name, Eterm settings, int *err_nump);
static byte* convert_environment(Process* p, Eterm env);
@@ -264,7 +265,7 @@ port_call(Process* c_p, Eterm arg1, Eterm arg2, Eterm arg3)
Eterm res;
Sint result_size;
Eterm *hp;
- Eterm *hp_end; /* To satisfy hybrid heap architecture */
+ Eterm *hp_end;
unsigned ret_flags = 0U;
int fpe_was_unmasked;
@@ -343,6 +344,16 @@ port_call(Process* c_p, Eterm arg1, Eterm arg2, Eterm arg3)
__FILE__, __LINE__, endp - (bytes + size));
}
erts_smp_proc_unlock(c_p, ERTS_PROC_LOCK_MAIN);
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(driver_call)) {
+ DTRACE_CHARBUF(process_str, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(port_str, DTRACE_TERM_BUF_SIZE);
+
+ dtrace_pid_str(p->connected, process_str);
+ dtrace_port_str(p, port_str);
+ DTRACE5(driver_call, process_str, port_str, p->name, op, real_size);
+ }
+#endif
prc = (char *) port_resp;
fpe_was_unmasked = erts_block_fpe();
ret = drv->call((ErlDrvData)p->drv_data,
@@ -539,6 +550,18 @@ BIF_RETTYPE port_connect_2(BIF_ALIST_2)
prt->connected = pid; /* internal pid */
erts_smp_port_unlock(prt);
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(port_connect)) {
+ DTRACE_CHARBUF(process_str, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(port_str, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(newprocess_str, DTRACE_TERM_BUF_SIZE);
+
+ dtrace_pid_str(prt->connected, process_str);
+ erts_snprintf(port_str, sizeof(port_str), "%T", prt->id);
+ dtrace_proc_str(rp, newprocess_str);
+ DTRACE4(port_connect, process_str, port_str, prt->name, newprocess_str);
+ }
+#endif
BIF_RET(am_true);
}
@@ -695,7 +718,7 @@ open_port(Process* p, Eterm name, Eterm settings, int *err_nump)
} else if (option == am_arg0) {
char *a0;
- if ((a0 = erts_convert_filename_to_native(*tp, ERTS_ALC_T_TMP, 1)) == NULL) {
+ if ((a0 = erts_convert_filename_to_native(*tp, NULL, 0, ERTS_ALC_T_TMP, 1, 1, NULL)) == NULL) {
goto badarg;
}
if (opts.argv == NULL) {
@@ -822,7 +845,7 @@ open_port(Process* p, Eterm name, Eterm settings, int *err_nump)
goto badarg;
}
name = tp[1];
- if ((name_buf = erts_convert_filename_to_native(name,ERTS_ALC_T_TMP,0)) == NULL) {
+ if ((name_buf = erts_convert_filename_to_native(name, NULL, 0, ERTS_ALC_T_TMP,0,1, NULL)) == NULL) {
goto badarg;
}
opts.spawn_type = ERTS_SPAWN_EXECUTABLE;
@@ -886,7 +909,7 @@ open_port(Process* p, Eterm name, Eterm settings, int *err_nump)
}
opts.wd = (char *) dir;
} else {
- if ((opts.wd = erts_convert_filename_to_native(edir,ERTS_ALC_T_TMP,0)) == NULL) {
+ if ((opts.wd = erts_convert_filename_to_native(edir, NULL, 0, ERTS_ALC_T_TMP,0,1,NULL)) == NULL) {
goto badarg;
}
}
@@ -904,7 +927,16 @@ open_port(Process* p, Eterm name, Eterm settings, int *err_nump)
erts_smp_proc_unlock(p, ERTS_PROC_LOCK_MAIN);
port_num = erts_open_driver(driver, p->id, name_buf, &opts, err_nump);
+#ifdef USE_VM_PROBES
+ if (port_num >= 0 && DTRACE_ENABLED(port_open)) {
+ DTRACE_CHARBUF(process_str, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(port_str, DTRACE_TERM_BUF_SIZE);
+ dtrace_proc_str(p, process_str);
+ erts_snprintf(port_str, sizeof(port_str), "%T", erts_port[port_num].id);
+ DTRACE3(port_open, process_str, name_buf, port_str);
+ }
+#endif
erts_smp_proc_lock(p, ERTS_PROC_LOCK_MAIN);
if (port_num < 0) {
@@ -968,7 +1000,7 @@ static char **convert_args(Eterm l)
pp[i++] = erts_default_arg0;
while (is_list(l)) {
str = CAR(list_val(l));
- if ((b = erts_convert_filename_to_native(str,ERTS_ALC_T_TMP,1)) == NULL) {
+ if ((b = erts_convert_filename_to_native(str,NULL,0,ERTS_ALC_T_TMP,1,1,NULL)) == NULL) {
int j;
for (j = 1; j < i; ++j)
erts_free(ERTS_ALC_T_TMP, pp[j]);
@@ -1003,8 +1035,9 @@ static byte* convert_environment(Process* p, Eterm env)
Eterm* hp;
Uint heap_size;
int n;
- Uint size;
+ Sint size;
byte* bytes;
+ int encoding = erts_get_native_filename_encoding();
if ((n = list_length(env)) < 0) {
return NULL;
@@ -1047,7 +1080,8 @@ static byte* convert_environment(Process* p, Eterm env)
if (is_not_nil(env)) {
goto done;
}
- if (erts_iolist_size(all, &size)) {
+
+ if ((size = erts_native_filename_need(all,encoding)) < 0) {
goto done;
}
@@ -1055,7 +1089,7 @@ static byte* convert_environment(Process* p, Eterm env)
* Put the result in a binary (no risk for a memory leak that way).
*/
(void) erts_new_heap_binary(p, NULL, size, &bytes);
- io_list_to_buf(all, (char*)bytes, size);
+ erts_native_filename_put(all,encoding,bytes);
done:
erts_free(ERTS_ALC_T_TMP, temp_heap);
diff --git a/erts/emulator/beam/erl_bif_re.c b/erts/emulator/beam/erl_bif_re.c
index 6b843d2e08..b036c5ef5c 100644
--- a/erts/emulator/beam/erl_bif_re.c
+++ b/erts/emulator/beam/erl_bif_re.c
@@ -71,14 +71,9 @@ void erts_init_bif_re(void)
erts_pcre_stack_free = &erts_erts_pcre_stack_free;
default_table = NULL; /* ISO8859-1 default, forced into pcre */
max_loop_limit = CONTEXT_REDS * LOOP_FACTOR;
-
- sys_memset((void *) &re_exec_trap_export, 0, sizeof(Export));
- re_exec_trap_export.address = &re_exec_trap_export.code[3];
- re_exec_trap_export.code[0] = am_erlang;
- re_exec_trap_export.code[1] = am_re_run_trap;
- re_exec_trap_export.code[2] = 3;
- re_exec_trap_export.code[3] = (BeamInstr) em_apply_bif;
- re_exec_trap_export.code[4] = (BeamInstr) &re_exec_trap;
+
+ erts_init_trap_export(&re_exec_trap_export, am_erlang, am_re_run_trap, 3,
+ &re_exec_trap);
grun_trap_exportp = erts_export_put(am_re,am_grun,3);
urun_trap_exportp = erts_export_put(am_re,am_urun,3);
diff --git a/erts/emulator/beam/erl_bif_timer.c b/erts/emulator/beam/erl_bif_timer.c
index a922a33da3..525b11f61c 100644
--- a/erts/emulator/beam/erl_bif_timer.c
+++ b/erts/emulator/beam/erl_bif_timer.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2012. 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
@@ -324,10 +324,9 @@ bif_timer_timeout(ErtsBifTimer* btm)
ASSERT(!erts_get_current_process());
if (btm->flags & BTM_FLG_BYNAME)
- rp = erts_whereis_process(NULL,0,btm->receiver.name,0,ERTS_P2P_FLG_SMP_INC_REFC);
+ rp = erts_whereis_process(NULL, 0, btm->receiver.name, 0, 0);
else {
rp = btm->receiver.proc.ess;
- erts_smp_proc_inc_refc(rp);
unlink_proc(btm);
}
@@ -373,9 +372,12 @@ bif_timer_timeout(ErtsBifTimer* btm)
message = TUPLE3(hp, am_timeout, ref, message);
}
- erts_queue_message(rp, &rp_locks, bp, message, NIL);
+ erts_queue_message(rp, &rp_locks, bp, message, NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
erts_smp_proc_unlock(rp, rp_locks);
- erts_smp_proc_dec_refc(rp);
}
}
diff --git a/erts/emulator/beam/erl_bif_trace.c b/erts/emulator/beam/erl_bif_trace.c
index b0a58c80ea..06cec1795d 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2012. 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
@@ -42,12 +42,24 @@
#define DECL_AM(S) Eterm AM_ ## S = am_atom_put(#S, sizeof(#S) - 1)
const struct trace_pattern_flags erts_trace_pattern_flags_off = {0, 0, 0, 0, 0};
+
+/*
+ * The following variables are protected by code write permission.
+ */
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 struct { /* Protected by code write permission */
+ int current;
+ int install;
+ int local;
+ BpFunctions f; /* Local functions */
+ BpFunctions e; /* Export entries */
+} finish_bp;
+
static Eterm
trace_pattern(Process* p, Eterm MFA, Eterm Pattern, Eterm flaglist);
static BIF_RETTYPE
@@ -60,12 +72,11 @@ 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);
-static int setup_func_trace(Export* ep, void* match_prog);
-static int reset_func_trace(Export* ep);
-static void reset_bif_trace(int bif_index);
-static void setup_bif_trace(int bif_index);
-static void set_trace_bif(int bif_index, void* match_prog);
-static void clear_trace_bif(int bif_index);
+static void reset_bif_trace(void);
+static void setup_bif_trace(void);
+static void install_exp_breakpoints(BpFunctions* f);
+static void uninstall_exp_breakpoints(BpFunctions* f);
+static void clean_export_entries(BpFunctions* f);
void
erts_bif_trace_init(void)
@@ -98,7 +109,7 @@ trace_pattern(Process* p, Eterm MFA, Eterm Pattern, Eterm flaglist)
{
DeclareTmpHeap(mfa,3,p); /* Not really heap here, but might be when setting pattern */
int i;
- int matches = 0;
+ int matches = -1;
int specified = 0;
enum erts_break_op on;
Binary* match_prog_set;
@@ -108,8 +119,10 @@ trace_pattern(Process* p, Eterm MFA, Eterm Pattern, Eterm flaglist)
Process *meta_tracer_proc = p;
Eterm meta_tracer_pid = p->id;
- erts_smp_proc_unlock(p, ERTS_PROC_LOCK_MAIN);
- erts_smp_thr_progress_block();
+ if (!erts_try_seize_code_write_permission(p)) {
+ ERTS_BIF_YIELD3(bif_export[BIF_trace_pattern_3], p, MFA, Pattern, flaglist);
+ }
+ finish_bp.current = -1;
UseTmpHeap(3,p);
/*
@@ -241,7 +254,6 @@ trace_pattern(Process* p, Eterm MFA, Eterm Pattern, Eterm flaglist)
erts_default_meta_match_spec = NULL;
erts_default_meta_tracer_pid = NIL;
}
- MatchSetUnref(match_prog_set);
if (erts_default_trace_pattern_flags.breakpoint &&
flags.breakpoint) {
/* Breakpoint trace -> breakpoint trace */
@@ -297,8 +309,7 @@ trace_pattern(Process* p, Eterm MFA, Eterm Pattern, Eterm flaglist)
erts_default_trace_pattern_is_on = !!flags.breakpoint;
}
}
-
- goto done;
+ matches = 0;
} else if (is_tuple(MFA)) {
Eterm *tp = tuple_val(MFA);
if (tp[0] != make_arityval(3)) {
@@ -322,35 +333,37 @@ trace_pattern(Process* p, Eterm MFA, Eterm Pattern, Eterm flaglist)
if (is_small(mfa[2])) {
mfa[2] = signed_val(mfa[2]);
}
- } else {
- goto error;
- }
- if (meta_tracer_proc) {
- meta_tracer_proc->trace_flags |= F_TRACER;
- }
+ if (meta_tracer_proc) {
+ meta_tracer_proc->trace_flags |= F_TRACER;
+ }
+ matches = erts_set_trace_pattern(p, mfa, specified,
+ match_prog_set, match_prog_set,
+ on, flags, meta_tracer_pid, 0);
+ }
- matches = erts_set_trace_pattern(mfa, specified,
- match_prog_set, match_prog_set,
- on, flags, meta_tracer_pid);
+ error:
MatchSetUnref(match_prog_set);
-
- done:
UnUseTmpHeap(3,p);
- erts_smp_thr_progress_unblock();
- erts_smp_proc_lock(p, ERTS_PROC_LOCK_MAIN);
- return make_small(matches);
-
- error:
+#ifdef ERTS_SMP
+ if (finish_bp.current >= 0) {
+ ASSERT(matches >= 0);
+ erts_notify_finish_breakpointing(p);
+ erts_suspend(p, ERTS_PROC_LOCK_MAIN, NULL);
+ ERTS_BIF_YIELD_RETURN(p, make_small(matches));
+ }
+#endif
- MatchSetUnref(match_prog_set);
+ erts_release_code_write_permission();
- UnUseTmpHeap(3,p);
- erts_smp_thr_progress_unblock();
- erts_smp_proc_lock(p, ERTS_PROC_LOCK_MAIN);
- BIF_ERROR(p, BADARG);
+ if (matches >= 0) {
+ return make_small(matches);
+ }
+ else {
+ BIF_ERROR(p, BADARG);
+ }
}
void
@@ -360,6 +373,8 @@ erts_get_default_trace_pattern(int *trace_pattern_is_on,
struct trace_pattern_flags *trace_pattern_flags,
Eterm *meta_tracer_pid)
{
+ ERTS_SMP_LC_ASSERT(erts_is_code_ix_locked() ||
+ erts_smp_thr_progress_is_blocking());
if (trace_pattern_is_on)
*trace_pattern_is_on = erts_default_trace_pattern_is_on;
if (match_spec)
@@ -372,7 +387,12 @@ erts_get_default_trace_pattern(int *trace_pattern_is_on,
*meta_tracer_pid = erts_default_meta_tracer_pid;
}
-
+int erts_is_default_trace_enabled(void)
+{
+ ERTS_SMP_LC_ASSERT(erts_is_code_ix_locked() ||
+ erts_smp_thr_progress_is_blocking());
+ return erts_default_trace_pattern_is_on;
+}
Uint
erts_trace_flag2bit(Eterm flag)
@@ -466,6 +486,10 @@ Eterm trace_3(BIF_ALIST_3)
BIF_ERROR(p, BADARG);
}
+ 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);
+ }
+
if (is_nil(tracer) || is_internal_pid(tracer)) {
Process *tracer_proc = erts_pid2proc(p,
ERTS_PROC_LOCK_MAIN,
@@ -653,8 +677,7 @@ Eterm trace_3(BIF_ALIST_3)
if (procs || mods) {
/* tracing of processes */
for (i = 0; i < erts_max_processes; i++) {
- Process* tracee_p = process_tab[i];
-
+ Process* tracee_p = erts_pix2proc(i);
if (! tracee_p)
continue;
if (tracer != NIL) {
@@ -730,6 +753,7 @@ Eterm trace_3(BIF_ALIST_3)
erts_smp_proc_lock(p, ERTS_PROC_LOCK_MAIN);
}
#endif
+ erts_release_code_write_permission();
BIF_RET(make_small(matches));
@@ -745,6 +769,7 @@ Eterm trace_3(BIF_ALIST_3)
erts_smp_proc_lock(p, ERTS_PROC_LOCK_MAIN);
}
#endif
+ erts_release_code_write_permission();
BIF_ERROR(p, BADARG);
}
@@ -772,8 +797,7 @@ static int port_already_traced(Process *c_p, Port *tracee_port, Eterm tracer)
return 1;
}
else if(is_internal_pid(tracee_port->tracer_proc)) {
- Process *tracer_p = erts_pid2proc(c_p, ERTS_PROC_LOCK_MAIN,
- tracee_port->tracer_proc, 0);
+ Process *tracer_p = erts_proc_lookup(tracee_port->tracer_proc);
if (!tracer_p) {
/* Current trace process now invalid
* - discard it and approve the new. */
@@ -813,8 +837,7 @@ static int already_traced(Process *c_p, Process *tracee_p, Eterm tracer)
return 1;
}
else if(is_internal_pid(tracee_p->tracer_proc)) {
- Process *tracer_p = erts_pid2proc(c_p, ERTS_PROC_LOCK_MAIN,
- tracee_p->tracer_proc, 0);
+ Process *tracer_p = erts_proc_lookup(tracee_p->tracer_proc);
if (!tracer_p) {
/* Current trace process now invalid
* - discard it and approve the new. */
@@ -841,6 +864,11 @@ Eterm trace_info_2(BIF_ALIST_2)
Eterm What = BIF_ARG_1;
Eterm Key = BIF_ARG_2;
Eterm res;
+
+ if (!erts_try_seize_code_write_permission(p)) {
+ ERTS_BIF_YIELD2(bif_export[BIF_trace_info_2], p, What, Key);
+ }
+
if (What == am_on_load) {
res = trace_info_on_load(p, Key);
} else if (is_atom(What) || is_pid(What)) {
@@ -848,8 +876,10 @@ Eterm trace_info_2(BIF_ALIST_2)
} else if (is_tuple(What)) {
res = trace_info_func(p, What, Key);
} else {
+ erts_release_code_write_permission();
BIF_ERROR(p, BADARG);
}
+ erts_release_code_write_permission();
BIF_RET(res);
}
@@ -876,7 +906,7 @@ trace_info_pid(Process* p, Eterm pid_spec, Eterm key)
}
if (is_internal_pid(tracer)) {
- if (!erts_pid2proc(p, ERTS_PROC_LOCK_MAIN, tracer, 0)) {
+ if (!erts_proc_lookup(tracer)) {
reset_tracer:
tracee->trace_flags &= ~TRACEE_FLAGS;
trace_flags = tracee->trace_flags;
@@ -977,64 +1007,54 @@ static int function_is_traced(Process *p,
Binary **ms, /* out */
Binary **ms_meta, /* out */
Eterm *tracer_pid_meta, /* out */
- Sint *count, /* out */
+ Uint *count, /* out */
Eterm *call_time) /* out */
{
Export e;
Export* ep;
- int i;
- BeamInstr *code;
+ BeamInstr* pc;
/* First look for an export entry */
e.code[0] = mfa[0];
e.code[1] = mfa[1];
e.code[2] = mfa[2];
if ((ep = export_get(&e)) != NULL) {
- if (ep->address == ep->code+3 &&
- ep->code[3] != (BeamInstr) em_call_error_handler) {
- if (ep->code[3] == (BeamInstr) em_call_traced_function) {
- *ms = ep->match_prog_set;
+ pc = ep->code+3;
+ if (ep->addressv[erts_active_code_ix()] == pc &&
+ *pc != (BeamInstr) em_call_error_handler) {
+
+ int r = 0;
+
+ ASSERT(*pc == (BeamInstr) em_apply_bif ||
+ *pc == (BeamInstr) BeamOp(op_i_generic_breakpoint));
+
+ if (erts_is_trace_break(pc, ms, 0)) {
return FUNC_TRACE_GLOBAL_TRACE;
}
- if (ep->code[3] == (BeamInstr) em_apply_bif) {
- for (i = 0; i < BIF_SIZE; ++i) {
- if (bif_export[i] == ep) {
- int r = 0;
-
- if (erts_bif_trace_flags[i] & BIF_TRACE_AS_GLOBAL) {
- *ms = ep->match_prog_set;
- return FUNC_TRACE_GLOBAL_TRACE;
- } else {
- if (erts_bif_trace_flags[i] & BIF_TRACE_AS_LOCAL) {
- r |= FUNC_TRACE_LOCAL_TRACE;
- *ms = ep->match_prog_set;
- }
- if (erts_is_mtrace_break(ep->code+3, ms_meta,
- tracer_pid_meta)) {
- r |= FUNC_TRACE_META_TRACE;
- }
- if (erts_is_time_break(p, ep->code+3, call_time)) {
- r |= FUNC_TRACE_TIME_TRACE;
- }
- }
- return r ? r : FUNC_TRACE_UNTRACED;
- }
- }
- erl_exit(1,"Impossible ghost bif encountered in trace_info.");
+
+ if (erts_is_trace_break(pc, ms, 1)) {
+ r |= FUNC_TRACE_LOCAL_TRACE;
+ }
+ if (erts_is_mtrace_break(pc, ms_meta, tracer_pid_meta)) {
+ r |= FUNC_TRACE_META_TRACE;
+ }
+ if (erts_is_time_break(p, pc, call_time)) {
+ r |= FUNC_TRACE_TIME_TRACE;
}
+ return r ? r : FUNC_TRACE_UNTRACED;
}
}
/* OK, now look for breakpoint tracing */
- if ((code = erts_find_local_func(mfa)) != NULL) {
+ if ((pc = erts_find_local_func(mfa)) != NULL) {
int r =
- (erts_is_trace_break(code, ms, NULL)
+ (erts_is_trace_break(pc, ms, 1)
? FUNC_TRACE_LOCAL_TRACE : 0)
- | (erts_is_mtrace_break(code, ms_meta, tracer_pid_meta)
+ | (erts_is_mtrace_break(pc, ms_meta, tracer_pid_meta)
? FUNC_TRACE_META_TRACE : 0)
- | (erts_is_count_break(code, count)
+ | (erts_is_count_break(pc, count)
? FUNC_TRACE_COUNT_TRACE : 0)
- | (erts_is_time_break(p, code, call_time)
+ | (erts_is_time_break(p, pc, call_time)
? FUNC_TRACE_TIME_TRACE : 0);
return r ? r : FUNC_TRACE_UNTRACED;
@@ -1049,7 +1069,7 @@ trace_info_func(Process* p, Eterm func_spec, Eterm key)
Eterm* hp;
DeclareTmpHeap(mfa,3,p); /* Not really heap here, but might be when setting pattern */
Binary *ms = NULL, *ms_meta = NULL;
- Sint count = 0;
+ Uint count = 0;
Eterm traced = am_false;
Eterm match_spec = am_false;
Eterm retval = am_false;
@@ -1137,9 +1157,7 @@ trace_info_func(Process* p, Eterm func_spec, Eterm key)
break;
case am_call_count:
if (r & FUNC_TRACE_COUNT_TRACE) {
- retval = count < 0 ?
- erts_make_integer(-count-1, p) :
- erts_make_integer(count, p);
+ retval = erts_make_integer(count, p);
}
break;
case am_call_time:
@@ -1328,38 +1346,53 @@ trace_info_on_load(Process* p, Eterm key)
#undef FUNC_TRACE_LOCAL_TRACE
int
-erts_set_trace_pattern(Eterm* mfa, int specified,
+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)
+ Eterm meta_tracer_pid, int is_blocking)
{
+ const ErtsCodeIndex code_ix = erts_active_code_ix();
int matches = 0;
int i;
+ int n;
+ BpFunction* fp;
/*
* First work on normal functions (not real BIFs).
*/
-
- for (i = 0; i < export_list_size(); i++) {
- Export* ep = export_list(i);
- int j;
-
- if (ExportIsBuiltIn(ep)) {
- continue;
- }
-
- for (j = 0; j < specified && mfa[j] == ep->code[j]; j++) {
- /* Empty loop body */
- }
- if (j == specified) {
- if (on) {
- if (! flags.breakpoint)
- matches += setup_func_trace(ep, match_prog_set);
- else
- reset_func_trace(ep);
- } else if (! flags.breakpoint) {
- matches += reset_func_trace(ep);
+ erts_bp_match_export(&finish_bp.e, mfa, specified);
+ fp = finish_bp.e.matching;
+ n = finish_bp.e.matched;
+
+ for (i = 0; i < n; i++) {
+ BeamInstr* pc = fp[i].pc;
+ Export* ep = (Export *)(((char *)(pc-3)) - offsetof(Export, code));
+
+ if (on && !flags.breakpoint) {
+ /* Turn on global call tracing */
+ if (ep->addressv[code_ix] != pc) {
+ fp[i].mod->curr.num_traced_exports++;
+#ifdef DEBUG
+ pc[-5] = (BeamInstr) BeamOp(op_i_func_info_IaaI);
+#endif
+ pc[0] = (BeamInstr) BeamOp(op_jump_f);
+ pc[1] = (BeamInstr) ep->addressv[code_ix];
+ }
+ erts_set_call_trace_bif(pc, match_prog_set, 0);
+ if (ep->addressv[code_ix] != pc) {
+ pc[0] = (BeamInstr) BeamOp(op_i_generic_breakpoint);
+ }
+ } else if (!on && flags.breakpoint) {
+ /* Turn off breakpoint tracing -- nothing to do here. */
+ } else {
+ /*
+ * Turn off global tracing, either explicitly or implicitly
+ * before turning on breakpoint tracing.
+ */
+ erts_clear_call_trace_bif(pc, 0);
+ if (pc[0] == (BeamInstr) BeamOp(op_i_generic_breakpoint)) {
+ pc[0] = (BeamInstr) BeamOp(op_jump_f);
}
}
}
@@ -1384,26 +1417,15 @@ erts_set_trace_pattern(Eterm* mfa, int specified,
/* Empty loop body */
}
if (j == specified) {
+ BeamInstr* pc = (BeamInstr *)bif_export[i]->code + 3;
+
if (! flags.breakpoint) { /* Export entry call trace */
if (on) {
- if (erts_bif_trace_flags[i] & BIF_TRACE_AS_META) {
- ASSERT(ExportIsBuiltIn(bif_export[i]));
- erts_clear_mtrace_bif
- ((BeamInstr *)bif_export[i]->code + 3);
- erts_bif_trace_flags[i] &= ~BIF_TRACE_AS_META;
- }
- set_trace_bif(i, match_prog_set);
- erts_bif_trace_flags[i] &= ~BIF_TRACE_AS_LOCAL;
- erts_bif_trace_flags[i] |= BIF_TRACE_AS_GLOBAL;
- setup_bif_trace(i);
+ erts_clear_call_trace_bif(pc, 1);
+ erts_clear_mtrace_bif(pc);
+ erts_set_call_trace_bif(pc, match_prog_set, 0);
} else { /* off */
- if (erts_bif_trace_flags[i] & BIF_TRACE_AS_GLOBAL) {
- clear_trace_bif(i);
- erts_bif_trace_flags[i] &= ~BIF_TRACE_AS_GLOBAL;
- }
- if (! erts_bif_trace_flags[i]) {
- reset_bif_trace(i);
- }
+ erts_clear_call_trace_bif(pc, 0);
}
matches++;
} else { /* Breakpoint call trace */
@@ -1411,52 +1433,33 @@ erts_set_trace_pattern(Eterm* mfa, int specified,
if (on) {
if (flags.local) {
- set_trace_bif(i, match_prog_set);
- erts_bif_trace_flags[i] |= BIF_TRACE_AS_LOCAL;
- erts_bif_trace_flags[i] &= ~BIF_TRACE_AS_GLOBAL;
+ erts_clear_call_trace_bif(pc, 0);
+ erts_set_call_trace_bif(pc, match_prog_set, 1);
m = 1;
}
if (flags.meta) {
- erts_set_mtrace_bif
- ((BeamInstr *)bif_export[i]->code + 3,
- meta_match_prog_set, meta_tracer_pid);
- erts_bif_trace_flags[i] |= BIF_TRACE_AS_META;
- erts_bif_trace_flags[i] &= ~BIF_TRACE_AS_GLOBAL;
+ erts_set_mtrace_bif(pc, meta_match_prog_set,
+ meta_tracer_pid);
m = 1;
}
if (flags.call_time) {
- erts_set_time_trace_bif(bif_export[i]->code + 3, on);
+ erts_set_time_trace_bif(pc, on);
/* I don't want to remove any other tracers */
- erts_bif_trace_flags[i] |= BIF_TRACE_AS_CALL_TIME;
m = 1;
}
- if (erts_bif_trace_flags[i]) {
- setup_bif_trace(i);
- }
} else { /* off */
if (flags.local) {
- if (erts_bif_trace_flags[i] & BIF_TRACE_AS_LOCAL) {
- clear_trace_bif(i);
- erts_bif_trace_flags[i] &= ~BIF_TRACE_AS_LOCAL;
- }
+ erts_clear_call_trace_bif(pc, 1);
m = 1;
}
if (flags.meta) {
- if (erts_bif_trace_flags[i] & BIF_TRACE_AS_META) {
- erts_clear_mtrace_bif
- ((BeamInstr *)bif_export[i]->code + 3);
- erts_bif_trace_flags[i] &= ~BIF_TRACE_AS_META;
- }
+ erts_clear_mtrace_bif(pc);
m = 1;
}
if (flags.call_time) {
- erts_clear_time_trace_bif(bif_export[i]->code + 3);
- erts_bif_trace_flags[i] &= ~BIF_TRACE_AS_CALL_TIME;
+ erts_clear_time_trace_bif(pc);
m = 1;
}
- if (! erts_bif_trace_flags[i]) {
- reset_bif_trace(i);
- }
}
matches += m;
}
@@ -1466,176 +1469,242 @@ erts_set_trace_pattern(Eterm* mfa, int specified,
/*
** So, now for breakpoint tracing
*/
+ erts_bp_match_functions(&finish_bp.f, mfa, specified);
if (on) {
if (! flags.breakpoint) {
- erts_clear_trace_break(mfa, specified);
- erts_clear_mtrace_break(mfa, specified);
- erts_clear_count_break(mfa, specified);
- erts_clear_time_break(mfa, specified);
+ erts_clear_all_breaks(&finish_bp.f);
} else {
- int m = 0;
if (flags.local) {
- m = erts_set_trace_break(mfa, specified, match_prog_set,
- am_true);
+ erts_set_trace_break(&finish_bp.f, match_prog_set);
}
if (flags.meta) {
- m = erts_set_mtrace_break(mfa, specified, meta_match_prog_set,
- meta_tracer_pid);
+ erts_set_mtrace_break(&finish_bp.f, meta_match_prog_set,
+ meta_tracer_pid);
}
if (flags.call_count) {
- m = erts_set_count_break(mfa, specified, on);
+ erts_set_count_break(&finish_bp.f, on);
}
if (flags.call_time) {
- m = erts_set_time_break(mfa, specified, on);
+ erts_set_time_break(&finish_bp.f, on);
}
- /* All assignments to 'm' above should give the same value,
- * so just use the last */
- matches += m;
}
} else {
- int m = 0;
if (flags.local) {
- m = erts_clear_trace_break(mfa, specified);
+ erts_clear_trace_break(&finish_bp.f);
}
if (flags.meta) {
- m = erts_clear_mtrace_break(mfa, specified);
+ erts_clear_mtrace_break(&finish_bp.f);
}
if (flags.call_count) {
- m = erts_clear_count_break(mfa, specified);
+ erts_clear_count_break(&finish_bp.f);
}
if (flags.call_time) {
- m = erts_clear_time_break(mfa, specified);
+ erts_clear_time_break(&finish_bp.f);
+ }
+ }
+
+ finish_bp.current = 0;
+ finish_bp.install = on;
+ finish_bp.local = flags.breakpoint;
+
+#ifdef ERTS_SMP
+ if (is_blocking) {
+ ERTS_SMP_LC_ASSERT(erts_smp_thr_progress_is_blocking());
+#endif
+ while (erts_finish_breakpointing()) {
+ /* Empty loop body */
}
- /* All assignments to 'm' above should give the same value,
- * so just use the last */
- matches += m;
+#ifdef ERTS_SMP
+ finish_bp.current = -1;
}
+#endif
+ if (flags.breakpoint) {
+ matches += finish_bp.f.matched;
+ } else {
+ matches += finish_bp.e.matched;
+ }
return matches;
}
-/*
- * Setup function tracing for the given exported function.
- *
- * Return Value: 1 if entry refers to a BIF or loaded function,
- * 0 if the entry refers to a function not loaded.
- */
-
-static int
-setup_func_trace(Export* ep, void* match_prog)
+int
+erts_finish_breakpointing(void)
{
- if (ep->address == ep->code+3) {
- if (ep->code[3] == (BeamInstr) em_call_error_handler) {
- return 0;
- } else if (ep->code[3] == (BeamInstr) em_call_traced_function) {
- MatchSetUnref(ep->match_prog_set);
- ep->match_prog_set = match_prog;
- MatchSetRef(ep->match_prog_set);
- return 1;
- } else {
- /*
- * We ignore apply/3 and anything else.
- */
- return 0;
- }
- }
-
+ ERTS_SMP_LC_ASSERT(erts_is_code_ix_locked());
+
/*
- * Currently no trace support for native code.
+ * Memory barriers will be issued for all processes *before*
+ * each of the stages below. (Unless the other schedulers
+ * are blocked, in which case memory barriers will be issued
+ * when they are awaken.)
*/
- if (erts_is_native_break(ep->address)) {
+
+ switch (finish_bp.current++) {
+ case 0:
+ /*
+ * At this point, in all functions that are to be breakpointed,
+ * a pointer to a GenericBp struct has already been added,
+ *
+ * Insert the new breakpoints (if any) into the
+ * code. Different schedulers may see breakpoint instruction
+ * at different times, but it does not matter since the newly
+ * added breakpoints are disabled.
+ */
+ if (finish_bp.install) {
+ if (finish_bp.local) {
+ erts_install_breakpoints(&finish_bp.f);
+ } else {
+ install_exp_breakpoints(&finish_bp.e);
+ }
+ }
+ setup_bif_trace();
+ return 1;
+ case 1:
+ /*
+ * Switch index for the breakpoint data, activating the staged
+ * data. (Depending on the changes in the breakpoint data,
+ * that could either activate breakpoints or disable
+ * breakpoints.)
+ */
+ erts_commit_staged_bp();
+ return 1;
+ case 2:
+ /*
+ * Remove breakpoints instructions for disabled breakpoints
+ * (if any).
+ */
+ if (finish_bp.install) {
+ if (finish_bp.local) {
+ uninstall_exp_breakpoints(&finish_bp.e);
+ } else {
+ erts_uninstall_breakpoints(&finish_bp.f);
+ }
+ } else {
+ if (finish_bp.local) {
+ erts_uninstall_breakpoints(&finish_bp.f);
+ } else {
+ uninstall_exp_breakpoints(&finish_bp.e);
+ }
+ }
+ reset_bif_trace();
+ return 1;
+ case 3:
+ /*
+ * Now all breakpoints have either been inserted or removed.
+ * For all updated breakpoints, copy the active breakpoint
+ * data to the staged breakpoint data to make them equal
+ * (simplifying for the next time breakpoints are to be
+ * updated). If any breakpoints have been totally disabled,
+ * deallocate the GenericBp structs for them.
+ */
+ erts_consolidate_bif_bp_data();
+ clean_export_entries(&finish_bp.e);
+ erts_consolidate_bp_data(&finish_bp.e, 0);
+ erts_consolidate_bp_data(&finish_bp.f, 1);
+ erts_bp_free_matched_functions(&finish_bp.e);
+ erts_bp_free_matched_functions(&finish_bp.f);
return 0;
+ default:
+ ASSERT(0);
}
-
- ep->code[3] = (BeamInstr) em_call_traced_function;
- ep->code[4] = (BeamInstr) ep->address;
- ep->address = ep->code+3;
- ep->match_prog_set = match_prog;
- MatchSetRef(ep->match_prog_set);
- return 1;
+ return 0;
}
-static void setup_bif_trace(int bif_index) {
- Export *ep = bif_export[bif_index];
-
- ASSERT(ExportIsBuiltIn(ep));
- ASSERT(ep->code[4]);
- ep->code[4] = (BeamInstr) bif_table[bif_index].traced;
-}
+static void
+install_exp_breakpoints(BpFunctions* f)
+{
+ const ErtsCodeIndex code_ix = erts_active_code_ix();
+ BpFunction* fp = f->matching;
+ Uint ne = f->matched;
+ Uint i;
+ Uint offset = offsetof(Export, code) + 3*sizeof(BeamInstr);
-static void set_trace_bif(int bif_index, void* match_prog) {
- Export *ep = bif_export[bif_index];
-
-#ifdef HARDDEBUG
- erts_fprintf(stderr, "set_trace_bif: %T:%T/%bpu\n",
- ep->code[0], ep->code[1], ep->code[2]);
-#endif
- ASSERT(ExportIsBuiltIn(ep));
- MatchSetUnref(ep->match_prog_set);
- ep->match_prog_set = match_prog;
- MatchSetRef(ep->match_prog_set);
-}
+ for (i = 0; i < ne; i++) {
+ BeamInstr* pc = fp[i].pc;
+ Export* ep = (Export *) (((char *)pc)-offset);
-/*
- * Reset function tracing for the given exported function.
- *
- * Return Value: 1 if entry refers to a BIF or loaded function,
- * 0 if the entry refers to a function not loaded.
- */
+ ep->addressv[code_ix] = pc;
+ }
+}
-static int
-reset_func_trace(Export* ep)
+static void
+uninstall_exp_breakpoints(BpFunctions* f)
{
- if (ep->address == ep->code+3) {
- if (ep->code[3] == (BeamInstr) em_call_error_handler) {
- return 0;
- } else if (ep->code[3] == (BeamInstr) em_call_traced_function) {
- ep->address = (Uint *) ep->code[4];
- MatchSetUnref(ep->match_prog_set);
- ep->match_prog_set = NULL;
- return 1;
- } else {
- /*
- * We ignore apply/3 and anything else.
- */
- return 0;
+ const ErtsCodeIndex code_ix = erts_active_code_ix();
+ BpFunction* fp = f->matching;
+ Uint ne = f->matched;
+ Uint i;
+ Uint offset = offsetof(Export, code) + 3*sizeof(BeamInstr);
+
+ for (i = 0; i < ne; i++) {
+ BeamInstr* pc = fp[i].pc;
+ Export* ep = (Export *) (((char *)pc)-offset);
+
+ if (ep->addressv[code_ix] != pc) {
+ continue;
}
+ ASSERT(*pc == (BeamInstr) BeamOp(op_jump_f));
+ ep->addressv[code_ix] = (BeamInstr *) ep->code[4];
}
-
- /*
- * Currently no trace support for native code.
- */
- if (erts_is_native_break(ep->address)) {
- return 0;
- }
-
- /*
- * Nothing to do, but the export entry matches.
- */
+}
+
+static void
+clean_export_entries(BpFunctions* f)
+{
+ const ErtsCodeIndex code_ix = erts_active_code_ix();
+ BpFunction* fp = f->matching;
+ Uint ne = f->matched;
+ Uint i;
+ Uint offset = offsetof(Export, code) + 3*sizeof(BeamInstr);
- return 1;
+ for (i = 0; i < ne; i++) {
+ BeamInstr* pc = fp[i].pc;
+ Export* ep = (Export *) (((char *)pc)-offset);
+
+ if (ep->addressv[code_ix] == pc) {
+ continue;
+ }
+ if (*pc == (BeamInstr) BeamOp(op_jump_f)) {
+ ep->code[3] = (BeamInstr) 0;
+ ep->code[4] = (BeamInstr) 0;
+ }
+ }
}
-static void reset_bif_trace(int bif_index) {
- Export *ep = bif_export[bif_index];
-
- ASSERT(ExportIsBuiltIn(ep));
- ASSERT(ep->code[4]);
- ASSERT(! ep->match_prog_set);
- ASSERT(! erts_is_mtrace_break((BeamInstr *)ep->code+3, NULL, NULL));
- ep->code[4] = (BeamInstr) bif_table[bif_index].f;
+static void
+setup_bif_trace(void)
+{
+ int i;
+
+ for (i = 0; i < BIF_SIZE; ++i) {
+ Export *ep = bif_export[i];
+ GenericBp* g = (GenericBp *) ep->fake_op_func_info_for_hipe[1];
+ if (g) {
+ if (ExportIsBuiltIn(ep)) {
+ ASSERT(ep->code[4]);
+ ep->code[4] = (BeamInstr) bif_table[i].traced;
+ }
+ }
+ }
}
-static void clear_trace_bif(int bif_index) {
- Export *ep = bif_export[bif_index];
-
-#ifdef HARDDEBUG
- erts_fprintf(stderr, "clear_trace_bif: %T:%T/%bpu\n",
- ep->code[0], ep->code[1], ep->code[2]);
-#endif
- ASSERT(ExportIsBuiltIn(ep));
- MatchSetUnref(ep->match_prog_set);
- ep->match_prog_set = NULL;
+static void
+reset_bif_trace(void)
+{
+ int i;
+ ErtsBpIndex active = erts_active_bp_ix();
+
+ for (i = 0; i < BIF_SIZE; ++i) {
+ Export *ep = bif_export[i];
+ BeamInstr* pc = ep->code+3;
+ GenericBp* g = (GenericBp *) pc[-4];
+ if (g && g->data[active].flags == 0) {
+ if (ExportIsBuiltIn(ep)) {
+ ASSERT(ep->code[4]);
+ ep->code[4] = (BeamInstr) bif_table[i].f;
+ }
+ }
+ }
}
/*
@@ -1744,9 +1813,17 @@ Eterm erts_seq_trace(Process *p, Eterm arg1, Eterm arg2,
return THE_NON_VALUE;
}
if (build_result) {
+#ifdef USE_VM_PROBES
+ old_value = (SEQ_TRACE_TOKEN(p) == am_have_dt_utag) ? NIL : SEQ_TRACE_TOKEN(p);
+#else
old_value = SEQ_TRACE_TOKEN(p);
+#endif
}
+#ifdef USE_VM_PROBES
+ SEQ_TRACE_TOKEN(p) = (DT_UTAG(p) != NIL) ? am_have_dt_utag : NIL;
+#else
SEQ_TRACE_TOKEN(p) = NIL;
+#endif
return old_value;
}
else {
@@ -1759,7 +1836,11 @@ new_seq_trace_token(Process* p)
{
Eterm* hp;
- if (SEQ_TRACE_TOKEN(p) == NIL) {
+ if (SEQ_TRACE_TOKEN(p) == NIL
+#ifdef USE_VM_PROBES
+ || SEQ_TRACE_TOKEN(p) == am_have_dt_utag
+#endif
+ ) {
hp = HAlloc(p, 6);
SEQ_TRACE_TOKEN(p) = TUPLE5(hp, make_small(0), /* Flags */
make_small(0), /* Label */
@@ -1779,7 +1860,11 @@ BIF_RETTYPE erl_seq_trace_info(Process *p, Eterm item)
BIF_ERROR(p, BADARG);
}
- if (SEQ_TRACE_TOKEN(p) == NIL) {
+ if (SEQ_TRACE_TOKEN(p) == NIL
+#ifdef USE_VM_PROBES
+ || SEQ_TRACE_TOKEN(p) == am_have_dt_utag
+#endif
+ ) {
if ((item == am_send) || (item == am_receive) ||
(item == am_print) || (item == am_timestamp)) {
hp = HAlloc(p,3);
@@ -1836,8 +1921,13 @@ BIF_RETTYPE seq_trace_info_1(BIF_ALIST_1)
*/
BIF_RETTYPE seq_trace_print_1(BIF_ALIST_1)
{
- if (SEQ_TRACE_TOKEN(BIF_P) == NIL)
+ if (SEQ_TRACE_TOKEN(BIF_P) == NIL
+#ifdef USE_VM_PROBES
+ || SEQ_TRACE_TOKEN(BIF_P) == am_have_dt_utag
+#endif
+ ) {
BIF_RET(am_false);
+ }
seq_trace_update_send(BIF_P);
seq_trace_output(SEQ_TRACE_TOKEN(BIF_P), BIF_ARG_1,
SEQ_TRACE_PRINT, NIL, BIF_P);
@@ -1854,8 +1944,13 @@ BIF_RETTYPE seq_trace_print_1(BIF_ALIST_1)
*/
BIF_RETTYPE seq_trace_print_2(BIF_ALIST_2)
{
- if (SEQ_TRACE_TOKEN(BIF_P) == NIL)
+ if (SEQ_TRACE_TOKEN(BIF_P) == NIL
+#ifdef USE_VM_PROBES
+ || SEQ_TRACE_TOKEN(BIF_P) == am_have_dt_utag
+#endif
+ ) {
BIF_RET(am_false);
+ }
if (!(is_atom(BIF_ARG_1) || is_small(BIF_ARG_1))) {
BIF_ERROR(BIF_P, BADARG);
}
@@ -2116,9 +2211,9 @@ BIF_RETTYPE system_profile_2(BIF_ALIST_2)
/* Check if valid process, no locks are taken */
if (is_internal_pid(profiler)) {
- if (internal_pid_index(profiler) >= erts_max_processes) goto error;
- profiler_p = process_tab[internal_pid_index(profiler)];
- if (INVALID_PID(profiler_p, profiler)) goto error;
+ profiler_p = erts_proc_lookup(profiler);
+ if (!profiler_p)
+ goto error;
} else if (is_internal_port(profiler)) {
if (internal_port_index(profiler) >= erts_max_ports) goto error;
profiler_port = &erts_port[internal_port_index(profiler)];
diff --git a/erts/emulator/beam/erl_bits.c b/erts/emulator/beam/erl_bits.c
index 6f7309f493..6bc227eeda 100644
--- a/erts/emulator/beam/erl_bits.c
+++ b/erts/emulator/beam/erl_bits.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2012. 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
@@ -1005,8 +1005,13 @@ erts_new_bs_put_float(Process *c_p, Eterm arg, Uint num_bits, int flags)
if (is_float(arg)) {
FloatDef *fdp = (FloatDef*)(float_val(arg) + 1);
+#ifdef DOUBLE_MIDDLE_ENDIAN
+ a = fdp->fw[1];
+ b = fdp->fw[0];
+#else
a = fdp->fw[0];
b = fdp->fw[1];
+#endif
} else if (is_small(arg)) {
u.f64 = (double) signed_val(arg);
a = u.i32[0];
@@ -1015,8 +1020,13 @@ erts_new_bs_put_float(Process *c_p, Eterm arg, Uint num_bits, int flags)
if (big_to_double(arg, &u.f64) < 0) {
return 0;
}
+#ifdef DOUBLE_MIDDLE_ENDIAN
+ a = u.i32[1];
+ b = u.i32[0];
+#else
a = u.i32[0];
b = u.i32[1];
+#endif
} else {
return 0;
}
diff --git a/erts/emulator/beam/erl_cpu_topology.c b/erts/emulator/beam/erl_cpu_topology.c
index fe3693d0ca..3f90f34736 100644
--- a/erts/emulator/beam/erl_cpu_topology.c
+++ b/erts/emulator/beam/erl_cpu_topology.c
@@ -486,7 +486,7 @@ erts_sched_check_cpu_bind_post_suspend(ErtsSchedulerData *esdp)
erts_thr_set_main_status(1, (int) esdp->no);
/* Make sure we check if we should bind to a cpu or not... */
- esdp->run_queue->flags |= ERTS_RUNQ_FLG_CHK_CPU_BIND;
+ (void) ERTS_RUNQ_FLGS_SET(esdp->run_queue, ERTS_RUNQ_FLG_CHK_CPU_BIND);
}
#endif
@@ -498,9 +498,6 @@ erts_sched_check_cpu_bind(ErtsSchedulerData *esdp)
erts_cpu_groups_map_t *cgm;
erts_cpu_groups_callback_list_t *cgcl;
erts_cpu_groups_callback_call_t *cgcc;
-#ifdef ERTS_SMP
- esdp->run_queue->flags &= ~ERTS_RUNQ_FLG_CHK_CPU_BIND;
-#endif
erts_smp_runq_unlock(esdp->run_queue);
erts_smp_rwmtx_rwlock(&cpuinfo_rwmtx);
cpu_id = scheduler2cpu_map[esdp->no].bind_id;
diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c
index eb89baf1c9..4c30905495 100644
--- a/erts/emulator/beam/erl_db.c
+++ b/erts/emulator/beam/erl_db.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -224,8 +224,9 @@ Export ets_select_continue_exp;
static Export ets_delete_continue_exp;
static void
-free_dbtable(DbTable* tb)
+free_dbtable(void *vtb)
{
+ DbTable *tb = (DbTable *) vtb;
#ifdef HARDDEBUG
if (erts_smp_atomic_read_nob(&tb->common.memory_size) != sizeof(DbTable)) {
erts_fprintf(stderr, "ets: free_dbtable memory remain=%ld fix=%x\n",
@@ -251,20 +252,8 @@ free_dbtable(DbTable* tb)
ASSERT(is_immed(tb->common.heir_data));
erts_db_free(ERTS_ALC_T_DB_TABLE, tb, (void *) tb, sizeof(DbTable));
ERTS_ETS_MISC_MEM_ADD(-sizeof(DbTable));
- ERTS_THR_MEMORY_BARRIER;
}
-#ifdef ERTS_SMP
-static void
-chk_free_dbtable(void *vtb)
-{
- DbTable * tb = (DbTable *) vtb;
- ERTS_THR_MEMORY_BARRIER;
- if (erts_refc_dectest(&tb->common.ref, 0) == 0)
- free_dbtable(tb);
-}
-#endif
-
static void schedule_free_dbtable(DbTable* tb)
{
/*
@@ -275,15 +264,10 @@ static void schedule_free_dbtable(DbTable* tb)
* need to unlock the table lock after this
* function has returned).
*/
-#ifdef ERTS_SMP
- int scheds = erts_get_max_no_executing_schedulers();
- ASSERT(scheds >= 1);
ASSERT(erts_refc_read(&tb->common.ref, 0) == 0);
- erts_refc_init(&tb->common.ref, scheds);
- erts_schedule_multi_misc_aux_work(0, scheds, chk_free_dbtable, tb);
-#else
- free_dbtable(tb);
-#endif
+ erts_schedule_thr_prgr_later_op(free_dbtable,
+ (void *) tb,
+ &tb->release.data);
}
static ERTS_INLINE void db_init_lock(DbTable* tb, int use_frequent_read_lock,
@@ -542,10 +526,6 @@ static int remove_named_tab(DbTable *tb, int have_lock)
&rwlock);
#ifdef ERTS_SMP
if (!have_lock && erts_smp_rwmtx_tryrwlock(rwlock) == EBUSY) {
- /*
- * We keep our increased refc over this op in order to
- * prevent the table from disapearing.
- */
db_unlock(tb, LCK_WRITE);
erts_smp_rwmtx_rwlock(rwlock);
db_lock(tb, LCK_WRITE);
@@ -1481,7 +1461,7 @@ BIF_RETTYPE ets_new_2(BIF_ALIST_2)
"** Too many db tables **\n");
free_heir_data(tb);
tb->common.meth->db_free_table(tb);
- free_dbtable(tb);
+ free_dbtable((void *) tb);
BIF_ERROR(BIF_P, SYSTEM_LIMIT);
}
@@ -2816,7 +2796,6 @@ void init_db(void)
{
DbTable init_tb;
int i;
- extern BeamInstr* em_apply_bif;
Eterm *hp;
unsigned bits;
size_t size;
@@ -2850,7 +2829,7 @@ void init_db(void)
else
db_max_tabs = user_requested_db_max_tabs;
- bits = erts_fit_in_bits(db_max_tabs-1);
+ bits = erts_fit_in_bits_int32(db_max_tabs-1);
if (bits > SMALL_BITS) {
erl_exit(1,"Max limit for ets tabled too high %u (max %u).",
db_max_tabs, ((Uint)1)<<SMALL_BITS);
@@ -2949,49 +2928,24 @@ void init_db(void)
}
/* Non visual BIF to trap to. */
- memset(&ets_select_delete_continue_exp, 0, sizeof(Export));
- ets_select_delete_continue_exp.address =
- &ets_select_delete_continue_exp.code[3];
- ets_select_delete_continue_exp.code[0] = am_ets;
- ets_select_delete_continue_exp.code[1] = am_atom_put("delete_trap",11);
- ets_select_delete_continue_exp.code[2] = 1;
- ets_select_delete_continue_exp.code[3] =
- (BeamInstr) em_apply_bif;
- ets_select_delete_continue_exp.code[4] =
- (BeamInstr) &ets_select_delete_1;
+ erts_init_trap_export(&ets_select_delete_continue_exp,
+ am_ets, am_atom_put("delete_trap",11), 1,
+ &ets_select_delete_1);
/* Non visual BIF to trap to. */
- memset(&ets_select_count_continue_exp, 0, sizeof(Export));
- ets_select_count_continue_exp.address =
- &ets_select_count_continue_exp.code[3];
- ets_select_count_continue_exp.code[0] = am_ets;
- ets_select_count_continue_exp.code[1] = am_atom_put("count_trap",11);
- ets_select_count_continue_exp.code[2] = 1;
- ets_select_count_continue_exp.code[3] =
- (BeamInstr) em_apply_bif;
- ets_select_count_continue_exp.code[4] =
- (BeamInstr) &ets_select_count_1;
+ erts_init_trap_export(&ets_select_count_continue_exp,
+ am_ets, am_atom_put("count_trap",11), 1,
+ &ets_select_count_1);
/* Non visual BIF to trap to. */
- memset(&ets_select_continue_exp, 0, sizeof(Export));
- ets_select_continue_exp.address =
- &ets_select_continue_exp.code[3];
- ets_select_continue_exp.code[0] = am_ets;
- ets_select_continue_exp.code[1] = am_atom_put("select_trap",11);
- ets_select_continue_exp.code[2] = 1;
- ets_select_continue_exp.code[3] =
- (BeamInstr) em_apply_bif;
- ets_select_continue_exp.code[4] =
- (BeamInstr) &ets_select_trap_1;
+ erts_init_trap_export(&ets_select_continue_exp,
+ am_ets, am_atom_put("select_trap",11), 1,
+ &ets_select_trap_1);
/* Non visual BIF to trap to. */
- memset(&ets_delete_continue_exp, 0, sizeof(Export));
- ets_delete_continue_exp.address = &ets_delete_continue_exp.code[3];
- ets_delete_continue_exp.code[0] = am_ets;
- ets_delete_continue_exp.code[1] = am_atom_put("delete_trap",11);
- ets_delete_continue_exp.code[2] = 1;
- ets_delete_continue_exp.code[3] = (BeamInstr) em_apply_bif;
- ets_delete_continue_exp.code[4] = (BeamInstr) &ets_delete_trap;
+ erts_init_trap_export(&ets_delete_continue_exp,
+ am_ets, am_atom_put("delete_trap",11), 1,
+ &ets_delete_trap);
hp = ms_delete_all_buff;
ms_delete_all = CONS(hp, am_true, NIL);
@@ -3124,7 +3078,7 @@ retry:
if (to_proc == NULL) {
return 0; /* heir not alive, table still mine */
}
- if (erts_cmp_timeval(&to_proc->started, &tb->common.heir_started) != 0) {
+ if (to_proc->started_interval != tb->common.heir_started_interval) {
erts_smp_proc_unlock(to_proc, to_locks);
return 0; /* heir dead and pid reused, table still mine */
}
@@ -3520,14 +3474,14 @@ static void set_heir(Process* me, DbTable* tb, Eterm heir, UWord heir_data)
return;
}
if (heir == me->id) {
- tb->common.heir_started = me->started;
+ erts_ensure_later_proc_interval(me->started_interval);
+ tb->common.heir_started_interval = me->started_interval;
}
else {
- Process* heir_proc= erts_pid2proc_opt(me, ERTS_PROC_LOCK_MAIN, heir,
- 0, ERTS_P2P_FLG_SMP_INC_REFC);
+ Process* heir_proc= erts_proc_lookup(heir);
if (heir_proc != NULL) {
- tb->common.heir_started = heir_proc->started;
- erts_smp_proc_dec_refc(heir_proc);
+ erts_ensure_later_proc_interval(heir_proc->started_interval);
+ tb->common.heir_started_interval = heir_proc->started_interval;
} else {
tb->common.heir = am_none;
}
@@ -3816,7 +3770,7 @@ void db_info(int to, void *to_arg, int show) /* Called by break handler */
Uint
erts_get_ets_misc_mem_size(void)
{
- ERTS_THR_MEMORY_BARRIER;
+ ERTS_SMP_MEMORY_BARRIER;
/* Memory not allocated in ets_alloc */
return (Uint) erts_smp_atomic_read_nob(&erts_ets_misc_mem_size);
}
diff --git a/erts/emulator/beam/erl_db.h b/erts/emulator/beam/erl_db.h
index 2e5deaf338..e9a661efbc 100644
--- a/erts/emulator/beam/erl_db.h
+++ b/erts/emulator/beam/erl_db.h
@@ -27,6 +27,10 @@
#define __DB_H__
#include "sys.h"
+#undef ERL_THR_PROGRESS_TSD_TYPE_ONLY
+#define ERL_THR_PROGRESS_TSD_TYPE_ONLY
+#include "erl_thr_progress.h"
+#undef ERL_THR_PROGRESS_TSD_TYPE_ONLY
#include "bif.h"
#include "erl_db_util.h" /* Flags */
@@ -36,6 +40,11 @@
Uint erts_get_ets_misc_mem_size(void);
+typedef struct {
+ DbTableCommon common;
+ ErtsThrPrgrLaterOp data;
+} DbTableRelease;
+
/*
* So, the structure for a database table, NB this is only
* interesting in db.c.
@@ -44,6 +53,7 @@ union db_table {
DbTableCommon common; /* Any type of db table */
DbTableHash hash; /* Linear hash array specific data */
DbTableTree tree; /* AVL tree specific data */
+ DbTableRelease release;
/*TT*/
};
diff --git a/erts/emulator/beam/erl_db_hash.c b/erts/emulator/beam/erl_db_hash.c
index 038a667b06..2fea4671e1 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2012. 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
@@ -105,10 +105,19 @@
#define NSEG_2 256 /* Size of second segment table */
#define NSEG_INC 128 /* Number of segments to grow after that */
+#ifdef ERTS_SMP
+# define DB_USING_FINE_LOCKING(TB) (((TB))->common.type & DB_FINE_LOCKED)
+#else
+# define DB_USING_FINE_LOCKING(TB) 0
+#endif
+
#ifdef ETHR_ORDERED_READ_DEPEND
-#define SEGTAB(tb) ((struct segment**)erts_smp_atomic_read_nob(&(tb)->segtab))
+#define SEGTAB(tb) ((struct segment**) erts_smp_atomic_read_nob(&(tb)->segtab))
#else
-#define SEGTAB(tb) ((struct segment**)erts_smp_atomic_read_rb(&(tb)->segtab))
+#define SEGTAB(tb) \
+ (DB_USING_FINE_LOCKING(tb) \
+ ? ((struct segment**) erts_smp_atomic_read_ddrb(&(tb)->segtab)) \
+ : ((struct segment**) erts_smp_atomic_read_nob(&(tb)->segtab)))
#endif
#define NACTIVE(tb) ((int)erts_smp_atomic_read_nob(&(tb)->nactive))
#define NITEMS(tb) ((int)erts_smp_atomic_read_nob(&(tb)->common.nitems))
@@ -126,7 +135,9 @@
*/
static ERTS_INLINE Uint hash_to_ix(DbTableHash* tb, HashValue hval)
{
- Uint mask = erts_smp_atomic_read_acqb(&tb->szm);
+ Uint mask = (DB_USING_FINE_LOCKING(tb)
+ ? erts_smp_atomic_read_acqb(&tb->szm)
+ : erts_smp_atomic_read_nob(&tb->szm));
Uint ix = hval & mask;
if (ix >= erts_smp_atomic_read_nob(&tb->nactive)) {
ix &= mask>>1;
@@ -323,7 +334,10 @@ struct ext_segment {
static ERTS_INLINE void SET_SEGTAB(DbTableHash* tb,
struct segment** segtab)
{
- erts_smp_atomic_set_wb(&tb->segtab, (erts_aint_t) segtab);
+ if (DB_USING_FINE_LOCKING(tb))
+ erts_smp_atomic_set_wb(&tb->segtab, (erts_aint_t) segtab);
+ else
+ erts_smp_atomic_set_nob(&tb->segtab, (erts_aint_t) segtab);
#ifdef VALGRIND
tb->top_ptr_to_segment_with_active_segtab = EXTSEG(segtab);
#endif
@@ -2505,6 +2519,28 @@ static Eterm build_term_list(Process* p, HashDbTerm* ptr1, HashDbTerm* ptr2,
return list;
}
+static ERTS_INLINE int
+begin_resizing(DbTableHash* tb)
+{
+ if (DB_USING_FINE_LOCKING(tb))
+ return !erts_smp_atomic_xchg_acqb(&tb->is_resizing, 1);
+ else {
+ if (erts_smp_atomic_read_nob(&tb->is_resizing))
+ return 0;
+ erts_smp_atomic_set_nob(&tb->is_resizing, 1);
+ return 1;
+ }
+}
+
+static ERTS_INLINE void
+done_resizing(DbTableHash* tb)
+{
+ if (DB_USING_FINE_LOCKING(tb))
+ erts_smp_atomic_set_relb(&tb->is_resizing, 0);
+ else
+ erts_smp_atomic_set_nob(&tb->is_resizing, 0);
+}
+
/* Grow table with one new bucket.
** Allocate new segment if needed.
*/
@@ -2517,9 +2553,8 @@ static void grow(DbTableHash* tb, int nactive)
int from_ix;
int szm;
- if (erts_smp_atomic_xchg_acqb(&tb->is_resizing, 1)) {
+ if (!begin_resizing(tb))
return; /* already in progress */
- }
if (NACTIVE(tb) != nactive) {
goto abort; /* already done (race) */
}
@@ -2551,9 +2586,12 @@ static void grow(DbTableHash* tb, int nactive)
}
erts_smp_atomic_inc_nob(&tb->nactive);
if (from_ix == 0) {
- erts_smp_atomic_set_relb(&tb->szm, szm);
+ if (DB_USING_FINE_LOCKING(tb))
+ erts_smp_atomic_set_relb(&tb->szm, szm);
+ else
+ erts_smp_atomic_set_nob(&tb->szm, szm);
}
- erts_smp_atomic_set_relb(&tb->is_resizing, 0);
+ done_resizing(tb);
/* Finally, let's split the bucket. We try to do it in a smart way
to keep link order and avoid unnecessary updates of next-pointers */
@@ -2585,7 +2623,7 @@ static void grow(DbTableHash* tb, int nactive)
return;
abort:
- erts_smp_atomic_set_relb(&tb->is_resizing, 0);
+ done_resizing(tb);
}
@@ -2594,9 +2632,8 @@ abort:
*/
static void shrink(DbTableHash* tb, int nactive)
{
- if (erts_smp_atomic_xchg_acqb(&tb->is_resizing, 1)) {
+ if (!begin_resizing(tb))
return; /* already in progress */
- }
if (NACTIVE(tb) == nactive) {
erts_smp_rwmtx_t* lck;
int src_ix = nactive - 1;
@@ -2643,7 +2680,7 @@ static void shrink(DbTableHash* tb, int nactive)
}
/*else already done */
- erts_smp_atomic_set_relb(&tb->is_resizing, 0);
+ done_resizing(tb);
}
diff --git a/erts/emulator/beam/erl_db_tree.c b/erts/emulator/beam/erl_db_tree.c
index 312050b931..faa7f31d99 100644
--- a/erts/emulator/beam/erl_db_tree.c
+++ b/erts/emulator/beam/erl_db_tree.c
@@ -452,16 +452,8 @@ DbTableMethod db_tree =
void db_initialize_tree(void)
{
- memset(&ets_select_reverse_exp, 0, sizeof(Export));
- ets_select_reverse_exp.address =
- &ets_select_reverse_exp.code[3];
- ets_select_reverse_exp.code[0] = am_ets;
- ets_select_reverse_exp.code[1] = am_reverse;
- ets_select_reverse_exp.code[2] = 3;
- ets_select_reverse_exp.code[3] =
- (BeamInstr) em_apply_bif;
- ets_select_reverse_exp.code[4] =
- (BeamInstr) &ets_select_reverse;
+ erts_init_trap_export(&ets_select_reverse_exp, am_ets, am_reverse, 3,
+ &ets_select_reverse);
return;
};
diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c
index 4821a7d9fb..0c9ca83ce4 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2012. 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
@@ -1233,7 +1233,7 @@ static Eterm erts_match_set_run_ets(Process *p, Binary *mpsp,
Eterm ret;
ret = db_prog_match(p, mpsp, args, NULL, NULL, num_args,
- ERTS_PAM_CONTIGUOUS_TUPLE | ERTS_PAM_COPY_RESULT,
+ ERTS_PAM_COPY_RESULT,
return_flags);
#if defined(HARDDEBUG)
if (is_non_value(ret)) {
@@ -2203,7 +2203,11 @@ restart:
*esp++ = am_true;
break;
case matchIsSeqTrace:
- if (SEQ_TRACE_TOKEN(c_p) != NIL)
+ if (SEQ_TRACE_TOKEN(c_p) != NIL
+#ifdef USE_VM_PROBES
+ && SEQ_TRACE_TOKEN(c_p) != am_have_dt_utag
+#endif
+ )
*esp++ = am_true;
else
*esp++ = am_false;
@@ -2227,7 +2231,11 @@ restart:
--esp;
break;
case matchGetSeqToken:
- if (SEQ_TRACE_TOKEN(c_p) == NIL)
+ if (SEQ_TRACE_TOKEN(c_p) == NIL
+#ifdef USE_VM_PROBES
+ || SEQ_TRACE_TOKEN(c_p) == am_have_dt_utag
+#endif
+ )
*esp++ = NIL;
else {
Eterm sender = SEQ_TRACE_TOKEN_SENDER(c_p);
@@ -2472,7 +2480,7 @@ Eterm db_format_dmc_err_info(Process *p, DMCErrInfo *ei)
vnum = tmp->variable;
}
if (vnum >= 0)
- sprintf(buff,tmp->error_string, vnum);
+ erts_snprintf(buff,sizeof(buff)+20,tmp->error_string, vnum);
else
strcpy(buff,tmp->error_string);
sl = strlen(buff);
@@ -2987,7 +2995,7 @@ Eterm db_copy_from_comp(DbTableCommon* tb, DbTerm* bp, Eterm** hpp,
}
ASSERT((*hpp - hp) <= bp->size);
#ifdef DEBUG_CLONE
- ASSERT(eq_rel(make_tuple(hp),make_tuple(bp->debug_clone),bp->debug_clone));
+ ASSERT(eq_rel(make_tuple(hp),NULL,make_tuple(bp->debug_clone),bp->debug_clone));
#endif
return make_tuple(hp);
}
@@ -3010,7 +3018,7 @@ Eterm db_copy_element_from_ets(DbTableCommon* tb, Process* p,
hp += extra;
HRelease(p, endp, hp);
#ifdef DEBUG_CLONE
- ASSERT(eq_rel(copy, obj->debug_clone[pos], obj->debug_clone));
+ ASSERT(eq_rel(copy, NULL, obj->debug_clone[pos], obj->debug_clone));
#endif
return copy;
}
@@ -4477,7 +4485,9 @@ static DMCRet dmc_fun(DMCContext *context,
if (context->err_info != NULL) {
/* Ugly, should define a better RETURN_TERM_ERROR interface... */
char buff[100];
- sprintf(buff, "Function %%T/%d does_not_exist.", (int)a - 1);
+ erts_snprintf(buff, sizeof(buff),
+ "Function %%T/%d does_not_exist.",
+ (int)a - 1);
RETURN_TERM_ERROR(buff, p[1], context, *constant);
} else {
return retFail;
@@ -4492,7 +4502,7 @@ static DMCRet dmc_fun(DMCContext *context,
if (context->err_info != NULL) {
/* Ugly, should define a better RETURN_TERM_ERROR interface... */
char buff[100];
- sprintf(buff,
+ erts_snprintf(buff, sizeof(buff),
"Function %%T/%d cannot be called in this context.",
(int)a - 1);
RETURN_TERM_ERROR(buff, p[1], context, *constant);
@@ -4756,7 +4766,7 @@ static int match_compact(ErlHeapFragment *expr, DMCErrInfo *err_info)
for (j = 0; j < x && DMC_PEEK(heap,j) != n; ++j)
;
ASSERT(j < x);
- sprintf(buff+1,"%u", (unsigned) j);
+ erts_snprintf(buff+1, sizeof(buff) - 1, "%u", (unsigned) j);
/* Yes, writing directly into terms, they ARE off heap */
*p = am_atom_put(buff, strlen(buff));
}
diff --git a/erts/emulator/beam/erl_db_util.h b/erts/emulator/beam/erl_db_util.h
index 6a96e174e1..dcecc4251a 100644
--- a/erts/emulator/beam/erl_db_util.h
+++ b/erts/emulator/beam/erl_db_util.h
@@ -209,7 +209,7 @@ typedef struct db_fixation {
*/
typedef struct db_table_common {
- erts_refc_t ref; /* fixation counter and delete counter */
+ erts_refc_t ref; /* fixation counter */
#ifdef ERTS_SMP
erts_smp_rwmtx_t rwlock; /* rw lock on table */
erts_smp_mtx_t fixlock; /* Protects fixations,megasec,sec,microsec */
@@ -219,7 +219,7 @@ typedef struct db_table_common {
Eterm owner; /* Pid of the creator */
Eterm heir; /* Pid of the heir */
UWord heir_data; /* To send in ETS-TRANSFER (is_immed or (DbTerm*) */
- SysTimeval heir_started; /* To further identify the heir */
+ Uint64 heir_started_interval; /* To further identify the heir */
Eterm the_name; /* an atom */
Eterm id; /* atom | integer */
DbTableMethod* meth; /* table methods */
diff --git a/erts/emulator/beam/erl_debug.c b/erts/emulator/beam/erl_debug.c
index d7d6fcf0a2..22e873afc6 100644
--- a/erts/emulator/beam/erl_debug.c
+++ b/erts/emulator/beam/erl_debug.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2010. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2012. 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
@@ -25,7 +25,6 @@
#include "erl_vm.h"
#include "global.h"
#include "erl_process.h"
-#include "erl_nmgc.h"
#include "big.h"
#include "bif.h"
#include "beam_catches.h"
@@ -33,34 +32,9 @@
#define WITHIN(ptr, x, y) ((x) <= (ptr) && (ptr) < (y))
-#if defined(HYBRID)
-#if defined(INCREMENTAL)
-/* Hybrid + Incremental */
-#define IN_HEAP(p, ptr) \
- (WITHIN((ptr), p->heap, p->hend) || \
- (OLD_HEAP(p) && WITHIN((ptr), OLD_HEAP(p), OLD_HEND(p))) || \
- WITHIN((ptr), global_heap, global_hend) || \
- (inc_fromspc && WITHIN((ptr), inc_fromspc, inc_fromend)) || \
- WITHIN((ptr), global_old_heap, global_old_hend))
-
-#define IN_MA(ptr) \
- (WITHIN((ptr), global_heap, global_hend) || \
- (inc_fromspc && WITHIN((ptr), inc_fromspc, inc_fromend)) || \
- WITHIN((ptr), global_old_heap, global_old_hend))
-#else
-/* Hybrid */
-#define IN_HEAP(p, ptr) \
- (WITHIN((ptr), p->heap, p->hend) || \
- (OLD_HEAP(p) && WITHIN((ptr), OLD_HEAP(p), OLD_HEND(p))) || \
- WITHIN((ptr), global_heap, global_hend) || \
- (global_old_heap && WITHIN((ptr),global_old_heap,global_old_hend)))
-#endif
-#else
-/* Private */
#define IN_HEAP(p, ptr) \
(WITHIN((ptr), p->heap, p->hend) || \
(OLD_HEAP(p) && WITHIN((ptr), OLD_HEAP(p), OLD_HEND(p))))
-#endif
#ifdef __GNUC__
@@ -266,13 +240,6 @@ static int verify_eterm(Process *p,Eterm element)
}
}
}
-#ifdef INCREMENTAL
- else {
- if (IN_MA(ptr))
- return 1;
- }
-#endif
-
return 0;
}
@@ -447,51 +414,12 @@ void verify_process(Process *p)
VERIFY_ETERM("fvalue",p->fvalue);
VERIFY_ETERM("ftrace",p->ftrace);
-#ifdef HYBRID
- VERIFY_AREA("rrma",p->rrma,p->nrr);
-#endif
-
VERBOSE(DEBUG_MEMORY,("...done\n"));
#undef VERIFY_AREA
#undef VERIFY_ETERM
}
-void verify_everything()
-{
-#ifdef HYBRID
- Uint i;
- Uint n = erts_num_active_procs;
-
-#ifdef INCREMENTAL_FREE_SIZES_NEEDS_TO_BE_TAGGED_AS_HEADERS_WITH_ARITY
- INC_Page *page = inc_used_mem;
-#endif
-
- for (i = 0; i < n; i++) {
- verify_process(erts_active_procs[i]);
- }
-
- erts_check_memory(NULL,global_heap,global_htop);
-
-#ifdef INCREMENTAL_FREE_SIZES_NEEDS_TO_BE_TAGGED_AS_HEADERS_WITH_ARITY
- while (page)
- {
- Eterm *end = page + INC_PAGE_SIZE;
- Eterm *pos = page->start;
-
- while( pos < end) {
- Eterm val = *pos++;
- if(is_header(val))
- pos += thing_arityval(val);
- else
- verify_eterm(NULL,val);
- }
- page = page->next;
- }
-#endif
-#endif /* HYBRID */
-}
-
/*
* print_untagged_memory will print the contents of given memory area.
*/
@@ -582,83 +510,6 @@ void print_tagged_memory(Eterm *pos, Eterm *end)
erts_printf("+-%s-+-%s-+\n",dashes,dashes);
}
-#ifdef HYBRID
-void print_ma_info(void)
-{
- erts_printf("Message Area (start - top - end): "
- "0x%0*lx - 0x%0*lx - 0x%0*lx\n",
- PTR_SIZE, (unsigned long)global_heap,
- PTR_SIZE, (unsigned long)global_htop,
- PTR_SIZE, (unsigned long)global_hend);
-#ifndef INCREMENTAL
- erts_printf(" High water: 0x%0*lx "
- "Old gen: 0x%0*lx - 0x%0*lx - 0x%0*lx\n",
- PTR_SIZE, (unsigned long)global_high_water,
- PTR_SIZE, (unsigned long)global_old_heap,
- PTR_SIZE, (unsigned long)global_old_htop,
- PTR_SIZE, (unsigned long)global_old_hend);
-#endif
-}
-
-void print_message_area(void)
-{
- Eterm *pos = global_heap;
- Eterm *end = global_htop;
-
- erts_printf("From: 0x%0*lx to 0x%0*lx\n",
- PTR_SIZE,(unsigned long)pos,PTR_SIZE,(unsigned long)end);
- erts_printf("(Old generation: 0x%0*lx to 0x%0*lx\n",
- PTR_SIZE, (unsigned long)global_old_heap,
- PTR_SIZE, (unsigned long)global_old_hend);
- erts_printf("| %-*s | %-*s |\n",PTR_SIZE,"Address",PTR_SIZE,"Contents");
- erts_printf("|-%s-|-%s-|\n",dashes,dashes);
- while( pos < end ) {
- Eterm val = pos[0];
- erts_printf("| 0x%0*lx | 0x%0*lx | ",
- PTR_SIZE,(unsigned long)pos,PTR_SIZE,(unsigned long)val);
- ++pos;
- if( is_arity_value(val) ) {
- erts_printf("Arity(%lu)", arityval(val));
- } else if( is_thing(val) ) {
- unsigned int ari = thing_arityval(val);
- erts_printf("Thing Arity(%u) Tag(%lu)", ari, thing_subtag(val));
- while( ari ) {
- erts_printf("\n| 0x%0*lx | 0x%0*lx | THING",
- PTR_SIZE, (unsigned long)pos,
- PTR_SIZE, (unsigned long)*pos);
- ++pos;
- --ari;
- }
- } else
- erts_printf("%.30T", val);
- erts_printf("\n");
- }
- erts_printf("+-%s-+-%s-+\n",dashes,dashes);
-}
-
-void check_message_area()
-{
- Eterm *pos = global_heap;
- Eterm *end = global_htop;
-
- while( pos < end ) {
- Eterm val = *pos++;
- if(is_header(val))
- pos += thing_arityval(val);
- else if(!is_immed(val))
- if ((ptr_val(val) < global_heap || ptr_val(val) >= global_htop) &&
- (ptr_val(val) < global_old_heap ||
- ptr_val(val) >= global_old_hend))
- {
- erts_printf("check_message_area: Stray pointer found\n");
- print_message_area();
- erts_printf("Crashing to make it look real...\n");
- pos = 0;
- }
- }
-}
-#endif /* HYBRID */
-
static void print_process_memory(Process *p);
static void print_process_memory(Process *p)
{
@@ -703,19 +554,6 @@ static void print_process_memory(Process *p)
erts_printf(" Fvalue: 0x%0*lx\n",PTR_SIZE,p->fvalue);
erts_printf(" Ftrace: 0x%0*lx\n",PTR_SIZE,p->ftrace);
-#ifdef HYBRID
- if (p->nrr > 0) {
- int i;
- erts_printf(" Remembered Roots:\n");
- for (i = 0; i < p->nrr; i++)
- if (p->rrsrc[i] != NULL)
- erts_printf("0x%0*lx -> 0x%0*lx\n",
- PTR_SIZE, (unsigned long)p->rrsrc[i],
- PTR_SIZE, (unsigned long)p->rrma[i]);
- erts_printf("\n");
- }
-#endif
-
erts_printf("+- %-*s -+ 0x%0*lx 0x%0*lx %s-%s-+\n",
PTR_SIZE, "Stack",
PTR_SIZE, (unsigned long)STACK_TOP(p),
@@ -757,92 +595,6 @@ void print_memory(Process *p)
if (p != NULL) {
print_process_memory(p);
}
-#ifdef HYBRID
- else {
- Uint i;
- Uint n = erts_num_active_procs;
-
- for (i = 0; i < n; i++) {
- Process *p = erts_active_procs[i];
- print_process_memory(p);
- }
-
- erts_printf("==================\n");
- erts_printf("|| Message area ||\n");
- erts_printf("==================\n");
- erts_printf("+-%s-+-%s-%s-%s-%s-+\n",
- dashes,dashes,dashes,dashes,dashes);
- erts_printf("| %-*s | 0x%0*lx - 0x%0*lx - 0x%0*lx%*s|\n",
- PTR_SIZE, "Young",
- PTR_SIZE, (unsigned long)global_heap,
- PTR_SIZE, (unsigned long)global_htop,
- PTR_SIZE, (unsigned long)global_hend,
- PTR_SIZE, "");
- erts_printf("+-%s-+-%s-%s-%s-%s-+\n",
- dashes,dashes,dashes,dashes,dashes);
-
- print_untagged_memory(global_heap,global_htop);
-
-
- erts_printf("+-%s-+-%s-%s-%s-%s-+\n",
- dashes,dashes,dashes,dashes,dashes);
- erts_printf("| %-*s | 0x%0*lx - 0x%0*lx %*s |\n",
- PTR_SIZE, "Old",
- PTR_SIZE, (unsigned long)global_old_heap,
- PTR_SIZE, (unsigned long)global_old_hend,
- 2 * PTR_SIZE, "");
- erts_printf("+-%s-+-%s-%s-%s-%s-+\n",
- dashes,dashes,dashes,dashes,dashes);
-
-#ifdef INCREMENTAL
- {
- INC_Page *page = inc_used_mem;
- /* Genom att g� igenom fri-listan f�rst kan vi markera de
- omr�den som inte �r allokerade och bara skriva ut de som
- lever.
- char markarea[INC_PAGESIZE];
- */
-
- while (page) {
- Eterm *ptr = (Eterm*)page->start;
- Eterm *end = (Eterm*)page->start + INC_PAGESIZE;
-
- erts_printf("| %*s | This: 0x%0*lx Next: 0x%0*lx %*s|\n",
- PTR_SIZE, "",
- PTR_SIZE, (unsigned long)page,
- PTR_SIZE, (unsigned long)page->next,
- 2 * PTR_SIZE - 8, "");
- print_untagged_memory(ptr,end);
- page = page->next;
- }
- }
-
- {
- INC_MemBlock *this = inc_free_list;
-
- erts_printf("-- %-*s --%s-%s-%s-%s-\n",PTR_SIZE+2,"Free list",
- dashes,dashes,dashes,dashes);
- while (this) {
- erts_printf("Block @ 0x%0*lx sz: %8d prev: 0x%0*lx next: 0x%0*lx\n",
- PTR_SIZE, (unsigned long)this,this->size,
- PTR_SIZE, (unsigned long)this->prev,
- PTR_SIZE, (unsigned long)this->next);
- this = this->next;
- }
- erts_printf("--%s---%s-%s-%s-%s--\n",
- dashes,dashes,dashes,dashes,dashes);
- }
-
- if (inc_fromspc != NULL) {
- erts_printf("-- fromspace - 0x%0*lx 0x%0*lx "
- "------------------------------\n",
- PTR_SIZE, (unsigned long)inc_fromspc,
- PTR_SIZE, (unsigned long)inc_fromend);
- print_untagged_memory(inc_fromspc,inc_fromend);
- }
-#endif /* INCREMENTAL */
- }
-#endif /* HYBRID */
}
void print_memory_info(Process *p)
@@ -869,26 +621,6 @@ void print_memory_info(Process *p)
erts_printf("|| Memory info ||\n");
erts_printf("=================\n");
}
-#ifdef HYBRID
- erts_printf("|- message area --%s-%s-%s-%s-|\n",
- dashes,dashes,dashes,dashes);
- erts_printf("| Young | 0x%0*lx - 0x%0*lx - 0x%0*lx %*s |\n",
- PTR_SIZE, (unsigned long)global_heap,
- PTR_SIZE, (unsigned long)global_htop,
- PTR_SIZE, (unsigned long)global_hend,
- PTR_SIZE, "");
- erts_printf("| Old | 0x%0*lx - 0x%0*lx %*s |\n",
- PTR_SIZE, (unsigned long)global_old_heap,
- PTR_SIZE, (unsigned long)global_old_hend,
- 2 * PTR_SIZE, "");
-#endif
-#ifdef INCREMENTAL
- if (inc_fromspc != NULL)
- erts_printf("| Frmsp | 0x%0*lx - 0x%0*lx %*s |\n",
- PTR_SIZE, (unsigned long)inc_fromspc,
- PTR_SIZE, (unsigned long)inc_fromend,
- 2 * PTR_SIZE, "");
-#endif
erts_printf("+-----------------%s-%s-%s-%s-+\n",dashes,dashes,dashes,dashes);
}
#if !HEAP_ON_C_STACK && defined(DEBUG)
diff --git a/erts/emulator/beam/erl_debug.h b/erts/emulator/beam/erl_debug.h
index c49354a2b3..af51212281 100644
--- a/erts/emulator/beam/erl_debug.h
+++ b/erts/emulator/beam/erl_debug.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2012. 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
@@ -42,12 +42,11 @@
#define DEBUG_DEFAULT 0x0000 /* No flags are set per default */
#define DEBUG_SYSTEM 0x0001 /* Misc system info at startup and end */
#define DEBUG_PRIVATE_GC 0x0002 /* GC of private heaps */
-#define DEBUG_HYBRID_GC 0x0004 /* GC of the message area */
-#define DEBUG_ALLOCATION 0x0008 /* HAlloc. To find holes in the heap */
-#define DEBUG_MESSAGES 0x0010 /* Message passing */
-#define DEBUG_THREADS 0x0020 /* Thread-related stuff */
-#define DEBUG_PROCESSES 0x0040 /* Process creation and removal */
-#define DEBUG_MEMORY 0x0080 /* Display results of memory checks */
+#define DEBUG_ALLOCATION 0x0004 /* HAlloc. To find holes in the heap */
+#define DEBUG_MESSAGES 0x0008 /* Message passing */
+#define DEBUG_THREADS 0x0010 /* Thread-related stuff */
+#define DEBUG_PROCESSES 0x0020 /* Process creation and removal */
+#define DEBUG_MEMORY 0x0040 /* Display results of memory checks */
extern Uint32 verbose;
@@ -88,7 +87,6 @@ extern void erts_check_stack(Process *p);
extern void erts_check_heap(Process *p);
extern void erts_check_memory(Process *p, Eterm *start, Eterm *end);
extern void verify_process(Process *p);
-extern void verify_everything(void);
extern void print_tagged_memory(Eterm *start, Eterm *end);
extern void print_untagged_memory(Eterm *start, Eterm *end);
extern void print_memory(Process *p);
@@ -99,10 +97,4 @@ extern void erts_debug_use_tmp_heap(int, Process *);
extern void erts_debug_unuse_tmp_heap(int, Process *);
#endif
-#ifdef HYBRID
-extern void print_ma_info(void);
-extern void print_message_area(void);
-extern void check_message_area(void);
-#endif
-
#endif /* _ERL_DEBUG_H_ */
diff --git a/erts/emulator/beam/erl_driver.h b/erts/emulator/beam/erl_driver.h
index 7510f6b724..771ee46d2b 100644
--- a/erts/emulator/beam/erl_driver.h
+++ b/erts/emulator/beam/erl_driver.h
@@ -87,10 +87,7 @@
#include <stdlib.h>
#include <string.h> /* ssize_t on Mac OS X */
-#if defined(VXWORKS)
-# include <ioLib.h>
-typedef struct iovec SysIOVec;
-#elif defined(__WIN32__) || defined(_WIN32) || defined(_WIN32_)
+#if defined(__WIN32__) || defined(_WIN32) || defined(_WIN32_)
#ifndef STATIC_ERLANG_DRIVER
/* Windows dynamic drivers, everything is different... */
#define ERL_DRIVER_TYPES_ONLY
@@ -370,11 +367,7 @@ typedef struct erl_drv_entry {
/* For windows dynamic drivers */
#ifndef ERL_DRIVER_TYPES_ONLY
-#if defined(VXWORKS)
-# define DRIVER_INIT(DRIVER_NAME) \
- ErlDrvEntry* DRIVER_NAME ## _init(void); \
- ErlDrvEntry* DRIVER_NAME ## _init(void)
-#elif defined(__WIN32__)
+#if defined(__WIN32__)
# define DRIVER_INIT(DRIVER_NAME) \
__declspec(dllexport) ErlDrvEntry* driver_init(void); \
__declspec(dllexport) ErlDrvEntry* driver_init(void)
@@ -649,6 +642,8 @@ EXTERN int erl_drv_getenv(char *key, char *value, size_t *value_size);
#endif
+/* also in global.h, but driver's can't include global.h */
+void dtrace_drvport_str(ErlDrvPort port, char *port_buf);
diff --git a/erts/emulator/beam/erl_fun.h b/erts/emulator/beam/erl_fun.h
index 2f165afa06..b673ef6b3c 100644
--- a/erts/emulator/beam/erl_fun.h
+++ b/erts/emulator/beam/erl_fun.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2000-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2012. 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
@@ -54,9 +54,7 @@ typedef struct erl_fun_entry {
typedef struct erl_fun_thing {
Eterm thing_word; /* Subtag FUN_SUBTAG. */
ErlFunEntry* fe; /* Pointer to fun entry. */
-#ifndef HYBRID /* FIND ME! */
struct erl_off_heap_header* next;
-#endif
#ifdef HIPE
UWord* native_address; /* Native code for the fun. */
#endif
@@ -79,13 +77,9 @@ ErlFunEntry* erts_get_fun_entry(Eterm mod, int uniq, int index);
ErlFunEntry* erts_put_fun_entry2(Eterm mod, int old_uniq, int old_index,
byte* uniq, int index, int arity);
-ErlFunEntry* erts_get_fun_entry2(Eterm mod, int old_uniq, int old_index,
- byte* uniq, int index, int arity);
void erts_erase_fun_entry(ErlFunEntry* fe);
-#ifndef HYBRID /* FIND ME! */
void erts_cleanup_funs(ErlFunThing* funp);
-#endif
void erts_cleanup_funs_on_purge(BeamInstr* start, BeamInstr* end);
void erts_dump_fun_entries(int, void *);
diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c
index 9590aa4a74..6075a527c3 100644
--- a/erts/emulator/beam/erl_gc.c
+++ b/erts/emulator/beam/erl_gc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2002-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2012. 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
@@ -35,6 +35,7 @@
#include "hipe_stack.h"
#include "hipe_mode_switch.h"
#endif
+#include "dtrace-wrapper.h"
#define ERTS_INACT_WR_PB_LEAVE_MUCH_LIMIT 1
#define ERTS_INACT_WR_PB_LEAVE_MUCH_PERCENTAGE 20
@@ -349,18 +350,17 @@ erts_garbage_collect(Process* p, int need, Eterm* objv, int nobj)
Uint reclaimed_now = 0;
int done = 0;
Uint ms1, s1, us1;
-
+#ifdef USE_VM_PROBES
+ DTRACE_CHARBUF(pidbuf, DTRACE_TERM_BUF_SIZE);
+#endif
if (IS_TRACED_FL(p, F_TRACE_GC)) {
trace_gc(p, am_gc_start);
}
- erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS);
- p->gcstatus = p->status;
- p->status = P_GARBING;
+ erts_smp_atomic32_read_bor_nob(&p->state, ERTS_PSFLG_GC);
if (erts_system_monitor_long_gc != 0) {
get_now(&ms1, &s1, &us1);
}
- erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
ERTS_CHK_OFFHEAP(p);
@@ -368,15 +368,27 @@ erts_garbage_collect(Process* p, int need, Eterm* objv, int nobj)
if (GEN_GCS(p) >= MAX_GEN_GCS(p)) {
FLAGS(p) |= F_NEED_FULLSWEEP;
}
-
+#ifdef USE_VM_PROBES
+ *pidbuf = '\0';
+ if (DTRACE_ENABLED(gc_major_start)
+ || DTRACE_ENABLED(gc_major_end)
+ || DTRACE_ENABLED(gc_minor_start)
+ || DTRACE_ENABLED(gc_minor_end)) {
+ dtrace_proc_str(p, pidbuf);
+ }
+#endif
/*
* Test which type of GC to do.
*/
while (!done) {
if ((FLAGS(p) & F_NEED_FULLSWEEP) != 0) {
+ DTRACE2(gc_major_start, pidbuf, need);
done = major_collection(p, need, objv, nobj, &reclaimed_now);
+ DTRACE2(gc_major_end, pidbuf, reclaimed_now);
} else {
+ DTRACE2(gc_minor_start, pidbuf, need);
done = minor_collection(p, need, objv, nobj, &reclaimed_now);
+ DTRACE2(gc_minor_end, pidbuf, reclaimed_now);
}
}
@@ -388,9 +400,8 @@ erts_garbage_collect(Process* p, int need, Eterm* objv, int nobj)
ErtsGcQuickSanityCheck(p);
- erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS);
- p->status = p->gcstatus;
- erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
+ 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);
}
@@ -474,10 +485,7 @@ erts_garbage_collect_hibernate(Process* p)
/*
* Preliminaries.
*/
- erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS);
- p->gcstatus = p->status;
- p->status = P_GARBING;
- erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
+ erts_smp_atomic32_read_bor_nob(&p->state, ERTS_PSFLG_GC);
ErtsGcQuickSanityCheck(p);
ASSERT(p->mbuf_sz == 0);
ASSERT(p->mbuf == 0);
@@ -588,9 +596,7 @@ erts_garbage_collect_hibernate(Process* p)
ErtsGcQuickSanityCheck(p);
- erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS);
- p->status = p->gcstatus;
- erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
+ erts_smp_atomic32_read_band_nob(&p->state, ~ERTS_PSFLG_GC);
}
@@ -614,10 +620,7 @@ erts_garbage_collect_literals(Process* p, Eterm* literals,
/*
* Set GC state.
*/
- erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS);
- p->gcstatus = p->status;
- p->status = P_GARBING;
- erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
+ erts_smp_atomic32_read_bor_nob(&p->state, ERTS_PSFLG_GC);
/*
* We assume that the caller has already done a major collection
@@ -759,9 +762,7 @@ erts_garbage_collect_literals(Process* p, Eterm* literals,
/*
* Restore status.
*/
- erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS);
- p->status = p->gcstatus;
- erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
+ erts_smp_atomic32_read_band_nob(&p->state, ~ERTS_PSFLG_GC);
}
static int
@@ -1117,6 +1118,15 @@ do_minor(Process *p, Uint new_sz, Eterm* objv, int nobj)
sys_memcpy(n_heap + new_sz - n, p->stop, n * sizeof(Eterm));
p->stop = n_heap + new_sz - n;
+#ifdef USE_VM_PROBES
+ if (HEAP_SIZE(p) != new_sz && DTRACE_ENABLED(process_heap_grow)) {
+ DTRACE_CHARBUF(pidbuf, DTRACE_TERM_BUF_SIZE);
+
+ dtrace_proc_str(p, pidbuf);
+ DTRACE3(process_heap_grow, pidbuf, HEAP_SIZE(p), new_sz);
+ }
+#endif
+
ERTS_HEAP_FREE(ERTS_ALC_T_HEAP,
(void*)HEAP_START(p),
HEAP_SIZE(p) * sizeof(Eterm));
@@ -1338,6 +1348,15 @@ major_collection(Process* p, int need, Eterm* objv, int nobj, Uint *recl)
sys_memcpy(n_heap + new_sz - n, p->stop, n * sizeof(Eterm));
p->stop = n_heap + new_sz - n;
+#ifdef USE_VM_PROBES
+ if (HEAP_SIZE(p) != new_sz && DTRACE_ENABLED(process_heap_grow)) {
+ DTRACE_CHARBUF(pidbuf, DTRACE_TERM_BUF_SIZE);
+
+ dtrace_proc_str(p, pidbuf);
+ DTRACE3(process_heap_grow, pidbuf, HEAP_SIZE(p), new_sz);
+ }
+#endif
+
ERTS_HEAP_FREE(ERTS_ALC_T_HEAP,
(void *) HEAP_START(p),
(HEAP_END(p) - HEAP_START(p)) * sizeof(Eterm));
@@ -1906,7 +1925,13 @@ setup_rootset(Process *p, Eterm *objv, int nobj, Rootset *rootset)
roots[n].sz = 1;
n++;
}
-
+#ifdef USE_VM_PROBES
+ if (is_not_immed(p->dt_utag)) {
+ roots[n].v = &p->dt_utag;
+ roots[n].sz = 1;
+ n++;
+ }
+#endif
ASSERT(is_nil(p->tracer_proc) ||
is_internal_pid(p->tracer_proc) ||
is_internal_port(p->tracer_proc));
@@ -2008,6 +2033,16 @@ grow_new_heap(Process *p, Uint new_sz, Eterm* objv, int nobj)
HEAP_TOP(p) = new_heap + heap_size;
HEAP_START(p) = new_heap;
}
+
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(process_heap_grow)) {
+ DTRACE_CHARBUF(pidbuf, DTRACE_TERM_BUF_SIZE);
+
+ dtrace_proc_str(p, pidbuf);
+ DTRACE3(process_heap_grow, pidbuf, HEAP_SIZE(p), new_sz);
+ }
+#endif
+
HEAP_SIZE(p) = new_sz;
}
@@ -2017,7 +2052,6 @@ shrink_new_heap(Process *p, Uint new_sz, Eterm *objv, int nobj)
Eterm* new_heap;
Uint heap_size = HEAP_TOP(p) - HEAP_START(p);
Sint offs;
-
Uint stack_size = p->hend - p->stop;
ASSERT(new_sz < p->heap_sz);
@@ -2046,6 +2080,16 @@ shrink_new_heap(Process *p, Uint new_sz, Eterm *objv, int nobj)
HEAP_TOP(p) = new_heap + heap_size;
HEAP_START(p) = new_heap;
}
+
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(process_heap_shrink)) {
+ DTRACE_CHARBUF(pidbuf, DTRACE_TERM_BUF_SIZE);
+
+ dtrace_proc_str(p, pidbuf);
+ DTRACE3(process_heap_shrink, pidbuf, HEAP_SIZE(p), new_sz);
+ }
+#endif
+
HEAP_SIZE(p) = new_sz;
}
@@ -2428,6 +2472,13 @@ offset_mqueue(Process *p, Sint offs, char* area, Uint area_size)
if (is_boxed(mesg) && in_area(ptr_val(mesg), area, area_size)) {
ERL_MESSAGE_TOKEN(mp) = offset_ptr(mesg, offs);
}
+#ifdef USE_VM_PROBES
+ mesg = ERL_MESSAGE_DT_UTAG(mp);
+ if (is_boxed(mesg) && in_area(ptr_val(mesg), area, area_size)) {
+ ERL_MESSAGE_DT_UTAG(mp) = offset_ptr(mesg, offs);
+ }
+#endif
+
ASSERT((is_nil(ERL_MESSAGE_TOKEN(mp)) ||
is_tuple(ERL_MESSAGE_TOKEN(mp)) ||
is_atom(ERL_MESSAGE_TOKEN(mp))));
@@ -2447,6 +2498,9 @@ offset_one_rootset(Process *p, Sint offs, char* area, Uint area_size,
offset_heap_ptr(&p->fvalue, 1, offs, area, area_size);
offset_heap_ptr(&p->ftrace, 1, offs, area, area_size);
offset_heap_ptr(&p->seq_trace_token, 1, offs, area, area_size);
+#ifdef USE_VM_PROBES
+ offset_heap_ptr(&p->dt_utag, 1, offs, area, area_size);
+#endif
offset_heap_ptr(&p->group_leader, 1, offs, area, area_size);
offset_mqueue(p, offs, area, area_size);
offset_heap_ptr(p->stop, (STACK_START(p) - p->stop), offs, area, area_size);
diff --git a/erts/emulator/beam/erl_init.c b/erts/emulator/beam/erl_init.c
index 717315d8bd..4b90e5394a 100644
--- a/erts/emulator/beam/erl_init.c
+++ b/erts/emulator/beam/erl_init.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2012. 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
@@ -34,7 +34,6 @@
#include "erl_binary.h"
#include "dist.h"
#include "erl_mseg.h"
-#include "erl_nmgc.h"
#include "erl_threads.h"
#include "erl_bif_timer.h"
#include "erl_instrument.h"
@@ -56,6 +55,61 @@
#endif
/*
+ * The variables below (prefixed with etp_) are for erts/etc/unix/etp-commands
+ * only. Do not remove even though they aren't used elsewhere in the emulator!
+ */
+#ifdef ERTS_SMP
+const int etp_smp_compiled = 1;
+#else
+const int etp_smp_compiled = 0;
+#endif
+#ifdef USE_THREADS
+const int etp_thread_compiled = 1;
+#else
+const int etp_thread_compiled = 0;
+#endif
+const char etp_erts_version[] = ERLANG_VERSION;
+const char etp_otp_release[] = ERLANG_OTP_RELEASE;
+const char etp_compile_date[] = ERLANG_COMPILE_DATE;
+const char etp_arch[] = ERLANG_ARCHITECTURE;
+#ifdef ERTS_ENABLE_KERNEL_POLL
+const int etp_kernel_poll_support = 1;
+#else
+const int etp_kernel_poll_support = 0;
+#endif
+#if defined(ARCH_64)
+const int etp_arch_bits = 64;
+#elif defined(ARCH_32)
+const int etp_arch_bits = 32;
+#else
+# error "Not 64-bit, nor 32-bit arch"
+#endif
+#if HALFWORD_HEAP
+const int etp_halfword = 1;
+#else
+const int etp_halfword = 0;
+#endif
+#ifdef HIPE
+const int etp_hipe = 1;
+#else
+const int etp_hipe = 0;
+#endif
+#ifdef DEBUG
+const int etp_debug_compiled = 1;
+#else
+const int etp_debug_compiled = 0;
+#endif
+#ifdef ERTS_ENABLE_LOCK_COUNT
+const int etp_lock_count = 1;
+#else
+const int etp_lock_count = 0;
+#endif
+#ifdef ERTS_ENABLE_LOCK_CHECK
+const int etp_lock_check = 1;
+#else
+const int etp_lock_check = 0;
+#endif
+/*
* Note about VxWorks: All variables must be initialized by executable code,
* not by an initializer. Otherwise a new instance of the emulator will
* inherit previous values.
@@ -154,28 +208,6 @@ Export *erts_delay_trap = NULL;
int erts_use_r9_pids_ports;
-#ifdef HYBRID
-Eterm *global_heap;
-Eterm *global_hend;
-Eterm *global_htop;
-Eterm *global_saved_htop;
-Eterm *global_old_heap;
-Eterm *global_old_hend;
-ErlOffHeap erts_global_offheap;
-Uint global_heap_sz = SH_DEFAULT_SIZE;
-
-#ifndef INCREMENTAL
-Eterm *global_high_water;
-Eterm *global_old_htop;
-#endif
-
-Uint16 global_gen_gcs;
-Uint16 global_max_gen_gcs;
-Uint global_gc_flags;
-
-Uint global_heap_min_sz = SH_DEFAULT_SIZE;
-#endif
-
int ignore_break;
int replace_intr;
@@ -264,6 +296,7 @@ erl_init(int ncpu)
erts_init_trace();
erts_init_binary();
erts_init_bits();
+ erts_code_ix_init();
erts_init_fun_table();
init_atom_table();
init_export_table();
@@ -281,7 +314,6 @@ erl_init(int ncpu)
erl_drv_thr_init();
erts_init_async();
init_io();
- init_copy();
init_load();
erts_init_bif();
erts_init_bif_chksum();
@@ -302,45 +334,6 @@ erl_init(int ncpu)
}
static void
-init_shared_memory(int argc, char **argv)
-{
-#ifdef HYBRID
- int arg_size = 0;
-
- global_heap_sz = erts_next_heap_size(global_heap_sz,0);
-
- /* Make sure arguments will fit on the heap, no one else will check! */
- while (argc--)
- arg_size += 2 + strlen(argv[argc]);
- if (global_heap_sz < arg_size)
- global_heap_sz = erts_next_heap_size(arg_size,1);
-
-#ifndef INCREMENTAL
- global_heap = (Eterm *) ERTS_HEAP_ALLOC(ERTS_ALC_T_HEAP,
- sizeof(Eterm) * global_heap_sz);
- global_hend = global_heap + global_heap_sz;
- global_htop = global_heap;
- global_high_water = global_heap;
- global_old_hend = global_old_htop = global_old_heap = NULL;
-#endif
-
- global_gen_gcs = 0;
- global_max_gen_gcs = (Uint16) erts_smp_atomic32_read_nob(&erts_max_gen_gcs);
- global_gc_flags = erts_default_process_flags;
-
- erts_global_offheap.mso = NULL;
-#ifndef HYBRID /* FIND ME! */
- erts_global_offheap.funs = NULL;
-#endif
- erts_global_offheap.overhead = 0;
-#endif
-
-#ifdef INCREMENTAL
- erts_init_incgc();
-#endif
-}
-
-static void
erl_first_process_otp(char* modname, void* code, unsigned size, int argc, char** argv)
{
int i;
@@ -352,7 +345,8 @@ erl_first_process_otp(char* modname, void* code, unsigned size, int argc, char**
Eterm env;
start_mod = am_atom_put(modname, sys_strlen(modname));
- if (erts_find_function(start_mod, am_start, 2) == NULL) {
+ if (erts_find_function(start_mod, am_start, 2,
+ erts_active_code_ix()) == NULL) {
erl_exit(5, "No function %s:start/2\n", modname);
}
@@ -451,7 +445,7 @@ load_preloaded(void)
if ((code = sys_preload_begin(&preload_p[i])) == 0)
erl_exit(1, "Failed to find preloaded code for module %s\n",
name);
- res = erts_load_module(NULL, 0, NIL, &module_name, code, length);
+ res = erts_preload_module(NULL, 0, NIL, &module_name, code, length);
sys_preload_end(&preload_p[i]);
if (res != NIL)
erl_exit(1,"Failed loading preloaded module %s (%T)\n",
@@ -511,10 +505,14 @@ void erts_usage(void)
erts_fprintf(stderr, "-rg amount set reader groups limit\n");
erts_fprintf(stderr, "-sbt type set scheduler bind type, valid types are:\n");
erts_fprintf(stderr, " u|ns|ts|ps|s|nnts|nnps|tnnps|db\n");
+ erts_fprintf(stderr, "-sbwt val set scheduler busy wait threshold, valid values are:\n");
+ erts_fprintf(stderr, " none|very_short|short|medium|long|very_long.\n");
erts_fprintf(stderr, "-scl bool enable/disable compaction of scheduler load,\n");
erts_fprintf(stderr, " see the erl(1) documentation for more info.\n");
erts_fprintf(stderr, "-sct cput set cpu topology,\n");
erts_fprintf(stderr, " see the erl(1) documentation for more info.\n");
+ erts_fprintf(stderr, "-sws val set scheduler wakeup strategy, valid values are:\n");
+ erts_fprintf(stderr, " default|legacy|proposal.\n");
erts_fprintf(stderr, "-swt val set scheduler wakeup threshold, valid values are:\n");
erts_fprintf(stderr, " very_low|low|medium|high|very_high.\n");
erts_fprintf(stderr, "-sss size suggested stack size in kilo words for scheduler threads,\n");
@@ -614,6 +612,7 @@ early_init(int *argc, char **argv) /*
erts_printf_eterm_func = erts_printf_term;
erts_disable_tolerant_timeofday = 0;
display_items = 200;
+ erts_proc.max = ERTS_DEFAULT_MAX_PROCESSES;
erts_backtrace_depth = DEFAULT_BACKTRACE_SIZE;
erts_async_max_threads = 0;
erts_async_thread_suggested_stack_size = ERTS_ASYNC_THREAD_MIN_STACK_SIZE;
@@ -682,7 +681,7 @@ early_init(int *argc, char **argv) /*
envbufsz = sizeof(envbuf);
- /* erts_sys_getenv() not initialized yet; need erts_sys_getenv__() */
+ /* erts_sys_getenv(_raw)() not initialized yet; need erts_sys_getenv__() */
if (erts_sys_getenv__("ERL_THREAD_POOL_SIZE", envbuf, &envbufsz) == 0)
erts_async_max_threads = atoi(envbuf);
else
@@ -790,6 +789,10 @@ early_init(int *argc, char **argv) /*
}
}
+#ifndef USE_THREADS
+ erts_async_max_threads = 0;
+#endif
+
#ifdef ERTS_SMP
no_schedulers = schdlrs;
no_schedulers_online = schdlrs_onln;
@@ -901,13 +904,13 @@ erl_start(int argc, char **argv)
int ncpu = early_init(&argc, argv);
envbufsz = sizeof(envbuf);
- if (erts_sys_getenv(ERL_MAX_ETS_TABLES_ENV, envbuf, &envbufsz) == 0)
+ if (erts_sys_getenv_raw(ERL_MAX_ETS_TABLES_ENV, envbuf, &envbufsz) == 0)
user_requested_db_max_tabs = atoi(envbuf);
else
user_requested_db_max_tabs = 0;
envbufsz = sizeof(envbuf);
- if (erts_sys_getenv("ERL_FULLSWEEP_AFTER", envbuf, &envbufsz) == 0) {
+ if (erts_sys_getenv_raw("ERL_FULLSWEEP_AFTER", envbuf, &envbufsz) == 0) {
Uint16 max_gen_gcs = atoi(envbuf);
erts_smp_atomic32_set_nob(&erts_max_gen_gcs,
(erts_aint32_t) max_gen_gcs);
@@ -991,7 +994,6 @@ erl_start(int argc, char **argv)
switch (*ch) {
case 's': verbose |= DEBUG_SYSTEM; break;
case 'g': verbose |= DEBUG_PRIVATE_GC; break;
- case 'h': verbose |= DEBUG_HYBRID_GC; break;
case 'M': verbose |= DEBUG_MEMORY; break;
case 'a': verbose |= DEBUG_ALLOCATION; break;
case 't': verbose |= DEBUG_THREADS; break;
@@ -1004,7 +1006,6 @@ erl_start(int argc, char **argv)
erts_printf("Verbose level: ");
if (verbose & DEBUG_SYSTEM) erts_printf("SYSTEM ");
if (verbose & DEBUG_PRIVATE_GC) erts_printf("PRIVATE_GC ");
- if (verbose & DEBUG_HYBRID_GC) erts_printf("HYBRID_GC ");
if (verbose & DEBUG_MEMORY) erts_printf("PARANOID_MEMORY ");
if (verbose & DEBUG_ALLOCATION) erts_printf("ALLOCATION ");
if (verbose & DEBUG_THREADS) erts_printf("THREADS ");
@@ -1032,12 +1033,6 @@ erl_start(int argc, char **argv)
#ifdef HIPE
strcat(tmp, ",HIPE");
#endif
-#ifdef INCREMENTAL
- strcat(tmp, ",INCREMENTAL_GC");
-#endif
-#ifdef HYBRID
- strcat(tmp, ",HYBRID");
-#endif
erts_fprintf(stderr, "Erlang ");
if (tmp[1]) {
erts_fprintf(stderr, "(%s) ", tmp+1);
@@ -1160,7 +1155,7 @@ erl_start(int argc, char **argv)
case 'P':
/* set maximum number of processes */
Parg = get_arg(argv[i]+2, argv[i+1], &i);
- erts_max_processes = atoi(Parg);
+ erts_proc.max = atoi(Parg);
/* Check of result is delayed until later. This is because +R
may be given after +P. */
break;
@@ -1198,6 +1193,16 @@ erl_start(int argc, char **argv)
erts_usage();
}
}
+ else if (has_prefix("bwt", sub_param)) {
+ arg = get_arg(sub_param+3, argv[i+1], &i);
+ if (erts_sched_set_busy_wait_threshold(arg) != 0) {
+ erts_fprintf(stderr, "bad scheduler busy wait threshold: %s\n",
+ arg);
+ erts_usage();
+ }
+ VERBOSE(DEBUG_SYSTEM,
+ ("scheduler wakup threshold: %s\n", arg));
+ }
else if (has_prefix("cl", sub_param)) {
arg = get_arg(sub_param+2, argv[i+1], &i);
if (sys_strcmp("true", arg) == 0)
@@ -1258,13 +1263,23 @@ erl_start(int argc, char **argv)
erts_use_sender_punish = 0;
else if (sys_strcmp("wt", sub_param) == 0) {
arg = get_arg(sub_param+2, argv[i+1], &i);
- if (erts_sched_set_wakeup_limit(arg) != 0) {
+ if (erts_sched_set_wakeup_other_thresold(arg) != 0) {
erts_fprintf(stderr, "scheduler wakeup threshold: %s\n",
arg);
erts_usage();
}
VERBOSE(DEBUG_SYSTEM,
- ("scheduler wakup threshold: %s\n", arg));
+ ("scheduler wakeup threshold: %s\n", arg));
+ }
+ else if (sys_strcmp("ws", sub_param) == 0) {
+ arg = get_arg(sub_param+2, argv[i+1], &i);
+ if (erts_sched_set_wakeup_other_type(arg) != 0) {
+ erts_fprintf(stderr, "scheduler wakeup strategy: %s\n",
+ arg);
+ erts_usage();
+ }
+ VERBOSE(DEBUG_SYSTEM,
+ ("scheduler wakeup threshold: %s\n", arg));
}
else if (has_prefix("ss", sub_param)) {
/* suggested stack size (Kilo Words) for scheduler threads */
@@ -1439,10 +1454,10 @@ erl_start(int argc, char **argv)
}
/* Delayed check of +P flag */
- if (erts_max_processes < ERTS_MIN_PROCESSES
- || erts_max_processes > ERTS_MAX_PROCESSES
+ if (erts_proc.max < ERTS_MIN_PROCESSES
+ || erts_proc.max > ERTS_MAX_PROCESSES
|| (erts_use_r9_pids_ports
- && erts_max_processes > ERTS_MAX_R9_PROCESSES)) {
+ && erts_proc.max > ERTS_MAX_R9_PROCESSES)) {
erts_fprintf(stderr, "bad number of processes %s\n", Parg);
erts_usage();
}
@@ -1469,8 +1484,9 @@ erl_start(int argc, char **argv)
erl_init(ncpu);
- init_shared_memory(boot_argc, boot_argv);
load_preloaded();
+ erts_end_staging_code_ix();
+ erts_commit_staging_code_ix();
erts_initialized = 1;
@@ -1510,7 +1526,7 @@ __decl_noreturn void erts_thr_fatal_error(int err, char *what)
#endif
static void
-system_cleanup(int exit_code)
+system_cleanup(int flush_async)
{
/*
* Make sure only one thread exits the runtime system.
@@ -1542,7 +1558,7 @@ system_cleanup(int exit_code)
* (in threaded non smp case).
*/
- if (exit_code != 0
+ if (!flush_async
|| !erts_initialized
#if defined(USE_THREADS) && !defined(ERTS_SMP)
|| !erts_equal_tids(main_thread, erts_thr_self())
@@ -1556,50 +1572,15 @@ system_cleanup(int exit_code)
#endif
#endif
-#ifdef HYBRID
- if (ma_src_stack) erts_free(ERTS_ALC_T_OBJECT_STACK,
- (void *)ma_src_stack);
- if (ma_dst_stack) erts_free(ERTS_ALC_T_OBJECT_STACK,
- (void *)ma_dst_stack);
- if (ma_offset_stack) erts_free(ERTS_ALC_T_OBJECT_STACK,
- (void *)ma_offset_stack);
- ma_src_stack = NULL;
- ma_dst_stack = NULL;
- ma_offset_stack = NULL;
- erts_cleanup_offheap(&erts_global_offheap);
-#endif
-
-#if defined(HYBRID) && !defined(INCREMENTAL)
- if (global_heap) {
- ERTS_HEAP_FREE(ERTS_ALC_T_HEAP,
- (void*) global_heap,
- sizeof(Eterm) * global_heap_sz);
- }
- global_heap = NULL;
-#endif
-
-#ifdef INCREMENTAL
- erts_cleanup_incgc();
-#endif
-
erts_exit_flush_async();
}
-/*
- * Common exit function, all exits from the system go through here.
- * n <= 0 -> normal exit with status n;
- * n = 127 -> Erlang crash dump produced, exit with status 1;
- * other positive n -> Erlang crash dump and core dump produced.
- */
-
-__decl_noreturn void erl_exit0(char *file, int line, int n, char *fmt,...)
+static __decl_noreturn void __noreturn
+erl_exit_vv(int n, int flush_async, char *fmt, va_list args1, va_list args2)
{
unsigned int an;
- va_list args;
-
- va_start(args, fmt);
- system_cleanup(n);
+ system_cleanup(flush_async);
save_statistics();
@@ -1609,66 +1590,42 @@ __decl_noreturn void erl_exit0(char *file, int line, int n, char *fmt,...)
erts_mtrace_exit((Uint32) an);
/* Produce an Erlang core dump if error */
- if (n > 0 && erts_initialized &&
- (erts_no_crash_dump == 0 || n == ERTS_DUMP_EXIT)) {
- erl_crash_dump_v(file, line, fmt, args);
+ if (((n > 0 && erts_no_crash_dump == 0) || n == ERTS_DUMP_EXIT)
+ && erts_initialized) {
+ erl_crash_dump_v((char*) NULL, 0, fmt, args1);
}
- /* need to reinitialize va_args thing */
- va_end(args);
- va_start(args, fmt);
-
if (fmt != NULL && *fmt != '\0')
- erl_error(fmt, args); /* Print error message. */
- va_end(args);
+ erl_error(fmt, args2); /* Print error message. */
sys_tty_reset(n);
if (n == ERTS_INTR_EXIT)
exit(0);
- else if (n == 127)
+ else if (n == ERTS_DUMP_EXIT)
ERTS_EXIT_AFTER_DUMP(1);
else if (n > 0 || n == ERTS_ABORT_EXIT)
abort();
exit(an);
}
-__decl_noreturn void erl_exit(int n, char *fmt,...)
+/* Exit without flushing async threads */
+__decl_noreturn void __noreturn erl_exit(int n, char *fmt, ...)
{
- unsigned int an;
- va_list args;
-
- va_start(args, fmt);
-
- system_cleanup(n);
-
- save_statistics();
-
- an = abs(n);
-
- if (erts_mtrace_enabled)
- erts_mtrace_exit((Uint32) an);
-
- /* Produce an Erlang core dump if error */
- if (n > 0 && erts_initialized &&
- (erts_no_crash_dump == 0 || n == ERTS_DUMP_EXIT)) {
- erl_crash_dump_v((char*) NULL, 0, fmt, args);
- }
-
- /* need to reinitialize va_args thing */
- va_end(args);
- va_start(args, fmt);
-
- if (fmt != NULL && *fmt != '\0')
- erl_error(fmt, args); /* Print error message. */
- va_end(args);
- sys_tty_reset(n);
-
- if (n == ERTS_INTR_EXIT)
- exit(0);
- else if (n == ERTS_DUMP_EXIT)
- ERTS_EXIT_AFTER_DUMP(1);
- else if (n > 0 || n == ERTS_ABORT_EXIT)
- abort();
- exit(an);
+ va_list args1, args2;
+ va_start(args1, fmt);
+ va_start(args2, fmt);
+ erl_exit_vv(n, 0, fmt, args1, args2);
+ va_end(args2);
+ va_end(args1);
}
+/* Exit after flushing async threads */
+__decl_noreturn void __noreturn erl_exit_flush_async(int n, char *fmt, ...)
+{
+ va_list args1, args2;
+ va_start(args1, fmt);
+ va_start(args2, fmt);
+ erl_exit_vv(n, 1, fmt, args1, args2);
+ va_end(args2);
+ va_end(args1);
+}
diff --git a/erts/emulator/beam/erl_lock_check.c b/erts/emulator/beam/erl_lock_check.c
index 09e85893c3..11fed4079d 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2012. 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
@@ -82,8 +82,8 @@ static erts_lc_lock_order_t erts_lock_order[] = {
#ifdef ERTS_SMP
{ "bif_timers", NULL },
{ "reg_tab", NULL },
- { "migration_info_update", NULL },
{ "proc_main", "pid" },
+ { "old_code", "address" },
#ifdef HIPE
{ "hipe_mfait_lock", NULL },
#endif
@@ -93,6 +93,7 @@ static erts_lc_lock_order_t erts_lock_order[] = {
{ "proc_msgq", "pid" },
{ "dist_entry", "address" },
{ "dist_entry_links", "address" },
+ { "code_ix_queue", NULL },
{ "proc_status", "pid" },
{ "proc_tab", NULL },
{ "ports_snapshot", NULL },
@@ -124,6 +125,7 @@ static erts_lc_lock_order_t erts_lock_order[] = {
{ "removed_fd_pre_alloc_lock", "address" },
{ "state_prealloc", NULL },
{ "schdlr_sspnd", NULL },
+ { "migration_info_update", NULL },
{ "run_queue", "address" },
{ "cpu_info", NULL },
{ "pollset", "address" },
@@ -175,14 +177,14 @@ static erts_lc_lock_order_t erts_lock_order[] = {
{ "sched_stat", NULL },
#endif
{ "async_init_mtx", NULL },
-#ifdef ERTS_SMP
- { "proc_lck_qs_alloc", NULL },
-#endif
#ifdef __WIN32__
#ifdef DEBUG
{ "save_ops_lock", NULL },
#endif
#endif
+#ifdef USE_VM_PROBES
+ { "efile_drv dtrace mutex", NULL },
+#endif
{ "mtrace_buf", NULL },
{ "erts_alloc_hard_debug", NULL }
};
@@ -443,7 +445,7 @@ print_lock2(char *prefix, Sint16 id, Wterm extra, Uint16 flags, char *suffix)
"%s'%s:%p%s'%s%s",
prefix,
lname,
- boxed_val(extra),
+ _unchecked_boxed_val(extra),
lock_type(flags),
rw_op_str(flags),
suffix);
diff --git a/erts/emulator/beam/erl_lock_count.c b/erts/emulator/beam/erl_lock_count.c
index a36c53560e..5f75b0ac0b 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-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2012. 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
@@ -49,7 +49,7 @@ const char *str_undefined = "undefined";
static ethr_tsd_key lcnt_thr_data_key;
static int lcnt_n_thr;
-static erts_lcnt_thread_data_t *lcnt_thread_data[1024];
+static erts_lcnt_thread_data_t *lcnt_thread_data[4096];
/* local functions */
@@ -240,7 +240,7 @@ void erts_lcnt_init() {
lcnt_lock();
- erts_lcnt_rt_options = ERTS_LCNT_OPT_PROCLOCK;
+ erts_lcnt_rt_options = ERTS_LCNT_OPT_PROCLOCK | ERTS_LCNT_OPT_LOCATION;
eltd = lcnt_thread_data_alloc();
@@ -312,7 +312,7 @@ void erts_lcnt_list_insert(erts_lcnt_lock_list_t *list, erts_lcnt_lock_t *lock)
}
void erts_lcnt_list_delete(erts_lcnt_lock_list_t *list, erts_lcnt_lock_t *lock) {
-
+
if (lock->next) lock->next->prev = lock->prev;
if (lock->prev) lock->prev->next = lock->next;
if (list->head == lock) list->head = lock->next;
@@ -334,6 +334,10 @@ void erts_lcnt_init_lock(erts_lcnt_lock_t *lock, char *name, Uint16 flag ) {
}
void erts_lcnt_init_lock_x(erts_lcnt_lock_t *lock, char *name, Uint16 flag, Eterm id) {
int i;
+ if (!name) {
+ lock->flag = 0;
+ return;
+ }
lcnt_lock();
lock->next = NULL;
@@ -363,6 +367,8 @@ void erts_lcnt_init_lock_x(erts_lcnt_lock_t *lock, char *name, Uint16 flag, Eter
void erts_lcnt_destroy_lock(erts_lcnt_lock_t *lock) {
erts_lcnt_lock_t *deleted_lock;
+ if (!ERTS_LCNT_LOCK_TYPE(lock)) return;
+
lcnt_lock();
if (erts_lcnt_rt_options & ERTS_LCNT_OPT_COPYSAVE) {
@@ -378,6 +384,7 @@ void erts_lcnt_destroy_lock(erts_lcnt_lock_t *lock) {
}
/* delete original */
erts_lcnt_list_delete(erts_lcnt_data->current_locks, lock);
+ lock->flag = 0;
lcnt_unlock();
}
@@ -389,6 +396,7 @@ void erts_lcnt_lock_opt(erts_lcnt_lock_t *lock, Uint16 option) {
erts_lcnt_thread_data_t *eltd;
if (erts_lcnt_rt_options & ERTS_LCNT_OPT_SUSPEND) return;
+ if (!ERTS_LCNT_LOCK_TYPE(lock)) return;
eltd = lcnt_get_thread_data();
@@ -422,6 +430,7 @@ void erts_lcnt_lock(erts_lcnt_lock_t *lock) {
erts_lcnt_thread_data_t *eltd;
if (erts_lcnt_rt_options & ERTS_LCNT_OPT_SUSPEND) return;
+ if (!ERTS_LCNT_LOCK_TYPE(lock)) return;
w_state = ethr_atomic_read(&lock->w_state);
ethr_atomic_inc( &lock->w_state);
@@ -452,6 +461,7 @@ void erts_lcnt_lock_unaquire(erts_lcnt_lock_t *lock) {
/* should check if this thread was "waiting" */
if (erts_lcnt_rt_options & ERTS_LCNT_OPT_SUSPEND) return;
+ if (!ERTS_LCNT_LOCK_TYPE(lock)) return;
ethr_atomic_dec( &lock->w_state);
}
@@ -475,6 +485,7 @@ void erts_lcnt_lock_post_x(erts_lcnt_lock_t *lock, char *file, unsigned int line
#endif
if (erts_lcnt_rt_options & ERTS_LCNT_OPT_SUSPEND) return;
+ if (!ERTS_LCNT_LOCK_TYPE(lock)) return;
#ifdef DEBUG
if (!(lock->flag & (ERTS_LCNT_LT_RWMUTEX | ERTS_LCNT_LT_RWSPINLOCK))) {
@@ -489,9 +500,13 @@ void erts_lcnt_lock_post_x(erts_lcnt_lock_t *lock, char *file, unsigned int line
ASSERT(eltd);
/* if lock was in conflict, time it */
-
- stats = lcnt_get_lock_stats(lock, file, line);
+ if (erts_lcnt_rt_options & ERTS_LCNT_OPT_LOCATION) {
+ stats = lcnt_get_lock_stats(lock, file, line);
+ } else {
+ stats = &lock->stats[0];
+ }
+
if (eltd->timer_set) {
lcnt_time(&timer);
@@ -510,6 +525,7 @@ void erts_lcnt_lock_post_x(erts_lcnt_lock_t *lock, char *file, unsigned int line
void erts_lcnt_unlock_opt(erts_lcnt_lock_t *lock, Uint16 option) {
if (erts_lcnt_rt_options & ERTS_LCNT_OPT_SUSPEND) return;
+ if (!ERTS_LCNT_LOCK_TYPE(lock)) return;
if (option & ERTS_LCNT_LO_WRITE) ethr_atomic_dec(&lock->w_state);
if (option & ERTS_LCNT_LO_READ ) ethr_atomic_dec(&lock->r_state);
}
@@ -520,6 +536,7 @@ void erts_lcnt_unlock(erts_lcnt_lock_t *lock) {
erts_aint_t flowstate;
#endif
if (erts_lcnt_rt_options & ERTS_LCNT_OPT_SUSPEND) return;
+ if (!ERTS_LCNT_LOCK_TYPE(lock)) return;
#ifdef DEBUG
/* flowstate */
flowstate = ethr_atomic_read(&lock->flowstate);
@@ -537,6 +554,7 @@ void erts_lcnt_unlock(erts_lcnt_lock_t *lock) {
void erts_lcnt_trylock_opt(erts_lcnt_lock_t *lock, int res, Uint16 option) {
if (erts_lcnt_rt_options & ERTS_LCNT_OPT_SUSPEND) return;
+ if (!ERTS_LCNT_LOCK_TYPE(lock)) return;
/* Determine lock_state via res instead of state */
if (res != EBUSY) {
if (option & ERTS_LCNT_LO_WRITE) ethr_atomic_inc(&lock->w_state);
@@ -555,6 +573,7 @@ void erts_lcnt_trylock(erts_lcnt_lock_t *lock, int res) {
erts_aint_t flowstate;
#endif
if (erts_lcnt_rt_options & ERTS_LCNT_OPT_SUSPEND) return;
+ if (!ERTS_LCNT_LOCK_TYPE(lock)) return;
if (res != EBUSY) {
#ifdef DEBUG
diff --git a/erts/emulator/beam/erl_lock_count.h b/erts/emulator/beam/erl_lock_count.h
index 6306580ae4..a4fc91b510 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-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2012. 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
@@ -89,6 +89,7 @@
#define ERTS_LCNT_OPT_LOCATION (((Uint16) 1) << 1)
#define ERTS_LCNT_OPT_PROCLOCK (((Uint16) 1) << 2)
#define ERTS_LCNT_OPT_COPYSAVE (((Uint16) 1) << 3)
+#define ERTS_LCNT_OPT_PORTLOCK (((Uint16) 1) << 4)
typedef struct {
unsigned long s;
@@ -201,5 +202,7 @@ void erts_lcnt_clear_counters(void);
char *erts_lcnt_lock_type(Uint16 type);
erts_lcnt_data_t *erts_lcnt_get_data(void);
+#define ERTS_LCNT_LOCK_TYPE(lockp) ((lockp)->flag & ERTS_LCNT_LT_ALL)
+
#endif /* ifdef ERTS_ENABLE_LOCK_COUNT */
#endif /* ifndef ERTS_LOCK_COUNT_H__ */
diff --git a/erts/emulator/beam/erl_message.c b/erts/emulator/beam/erl_message.c
index ab1ab7b1ea..e397f075d1 100644
--- a/erts/emulator/beam/erl_message.c
+++ b/erts/emulator/beam/erl_message.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2012. 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
@@ -29,8 +29,8 @@
#include "global.h"
#include "erl_message.h"
#include "erl_process.h"
-#include "erl_nmgc.h"
#include "erl_binary.h"
+#include "dtrace-wrapper.h"
ERTS_SCHED_PREF_QUICK_ALLOC_IMPL(message,
ErlMessage,
@@ -296,38 +296,6 @@ erts_msg_distext2heap(Process *pp,
return THE_NON_VALUE;
}
-static ERTS_INLINE void
-notify_new_message(Process *receiver)
-{
- ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS
- & erts_proc_lc_my_proc_locks(receiver));
-
- ACTIVATE(receiver);
-
- switch (receiver->status) {
- case P_GARBING:
- switch (receiver->gcstatus) {
- case P_SUSPENDED:
- goto suspended;
- case P_WAITING:
- goto waiting;
- default:
- break;
- }
- break;
- case P_SUSPENDED:
- suspended:
- receiver->rstatus = P_RUNABLE;
- break;
- case P_WAITING:
- waiting:
- erts_add_to_runq(receiver);
- break;
- default:
- break;
- }
-}
-
void
erts_queue_dist_message(Process *rcvr,
ErtsProcLocks *rcvr_locks,
@@ -335,8 +303,13 @@ erts_queue_dist_message(Process *rcvr,
Eterm token)
{
ErlMessage* mp;
+#ifdef USE_VM_PROBES
+ Sint tok_label = 0;
+ Sint tok_lastcnt = 0;
+ Sint tok_serial = 0;
+#endif
#ifdef ERTS_SMP
- ErtsProcLocks need_locks;
+ erts_aint_t state;
#endif
ERTS_SMP_LC_ASSERT(*rcvr_locks == erts_proc_lc_my_proc_locks(rcvr));
@@ -344,20 +317,21 @@ erts_queue_dist_message(Process *rcvr,
mp = message_alloc();
#ifdef ERTS_SMP
- need_locks = ~(*rcvr_locks) & (ERTS_PROC_LOCK_MSGQ|ERTS_PROC_LOCK_STATUS);
- if (need_locks) {
- *rcvr_locks |= need_locks;
- if (erts_smp_proc_trylock(rcvr, need_locks) == EBUSY) {
- if (need_locks == ERTS_PROC_LOCK_MSGQ) {
+ if (!(*rcvr_locks & ERTS_PROC_LOCK_MSGQ)) {
+ if (erts_smp_proc_trylock(rcvr, ERTS_PROC_LOCK_MSGQ) == EBUSY) {
+ ErtsProcLocks need_locks = ERTS_PROC_LOCK_MSGQ;
+ if (*rcvr_locks & ERTS_PROC_LOCK_STATUS) {
erts_smp_proc_unlock(rcvr, ERTS_PROC_LOCK_STATUS);
- need_locks = (ERTS_PROC_LOCK_MSGQ
- | ERTS_PROC_LOCK_STATUS);
+ need_locks |= ERTS_PROC_LOCK_STATUS;
}
erts_smp_proc_lock(rcvr, need_locks);
}
}
- if (rcvr->is_exiting || ERTS_PROC_PENDING_EXIT(rcvr)) {
+ state = erts_smp_atomic32_read_acqb(&rcvr->state);
+ if (state & (ERTS_PSFLG_PENDING_EXIT|ERTS_PSFLG_EXITING)) {
+ if (!(*rcvr_locks & ERTS_PROC_LOCK_MSGQ))
+ erts_smp_proc_unlock(rcvr, ERTS_PROC_LOCK_MSGQ);
/* Drop message if receiver is exiting or has a pending exit ... */
if (is_not_nil(token)) {
ErlHeapFragment *heap_frag;
@@ -373,37 +347,96 @@ erts_queue_dist_message(Process *rcvr,
/* Ahh... need to decode it in order to trace it... */
ErlHeapFragment *mbuf;
Eterm msg;
+ if (!(*rcvr_locks & ERTS_PROC_LOCK_MSGQ))
+ erts_smp_proc_unlock(rcvr, ERTS_PROC_LOCK_MSGQ);
message_free(mp);
msg = erts_msg_distext2heap(rcvr, rcvr_locks, &mbuf, &token, dist_ext);
if (is_value(msg))
- erts_queue_message(rcvr, rcvr_locks, mbuf, msg, token);
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(message_queued)) {
+ DTRACE_CHARBUF(receiver_name, DTRACE_TERM_BUF_SIZE);
+
+ dtrace_proc_str(rcvr, receiver_name);
+ if (token != NIL && token != am_have_dt_utag) {
+ tok_label = signed_val(SEQ_TRACE_T_LABEL(token));
+ tok_lastcnt = signed_val(SEQ_TRACE_T_LASTCNT(token));
+ tok_serial = signed_val(SEQ_TRACE_T_SERIAL(token));
+ }
+ DTRACE6(message_queued,
+ receiver_name, size_object(msg), rcvr->msg.len,
+ tok_label, tok_lastcnt, tok_serial);
+ }
+#endif
+ erts_queue_message(rcvr, rcvr_locks, mbuf, msg, token
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
}
else {
/* Enqueue message on external format */
ERL_MESSAGE_TERM(mp) = THE_NON_VALUE;
- ERL_MESSAGE_TOKEN(mp) = token;
+#ifdef USE_VM_PROBES
+ ERL_MESSAGE_DT_UTAG(mp) = NIL;
+ if (token == am_have_dt_utag) {
+ ERL_MESSAGE_TOKEN(mp) = NIL;
+ } else {
+#endif
+ ERL_MESSAGE_TOKEN(mp) = token;
+#ifdef USE_VM_PROBES
+ }
+#endif
mp->next = NULL;
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(message_queued)) {
+ DTRACE_CHARBUF(receiver_name, DTRACE_TERM_BUF_SIZE);
+
+ dtrace_proc_str(rcvr, receiver_name);
+ if (token != NIL && token != am_have_dt_utag) {
+ tok_label = signed_val(SEQ_TRACE_T_LABEL(token));
+ tok_lastcnt = signed_val(SEQ_TRACE_T_LASTCNT(token));
+ tok_serial = signed_val(SEQ_TRACE_T_SERIAL(token));
+ }
+ /*
+ * TODO: We don't know the real size of the external message here.
+ * -1 will appear to a D script as 4294967295.
+ */
+ DTRACE6(message_queued, receiver_name, -1, rcvr->msg.len + 1,
+ tok_label, tok_lastcnt, tok_serial);
+ }
+#endif
mp->data.dist_ext = dist_ext;
LINK_MESSAGE(rcvr, mp);
- notify_new_message(rcvr);
+ if (!(*rcvr_locks & ERTS_PROC_LOCK_MSGQ))
+ erts_smp_proc_unlock(rcvr, ERTS_PROC_LOCK_MSGQ);
+
+ erts_proc_notify_new_message(rcvr);
}
}
/* Add a message last in message queue */
-void
-erts_queue_message(Process* receiver,
- ErtsProcLocks *receiver_locks,
- ErlHeapFragment* bp,
- Eterm message,
- Eterm seq_trace_token)
+static Sint
+queue_message(Process *c_p,
+ Process* receiver,
+ ErtsProcLocks *receiver_locks,
+ erts_aint32_t *receiver_state,
+ ErlHeapFragment* bp,
+ Eterm message,
+ Eterm seq_trace_token
+#ifdef USE_VM_PROBES
+ , Eterm dt_utag
+#endif
+ )
{
+ Sint res;
ErlMessage* mp;
-#ifdef ERTS_SMP
- ErtsProcLocks need_locks;
-#else
+ int locked_msgq = 0;
+ erts_aint_t state;
+
+#ifndef ERTS_SMP
ASSERT(bp != NULL || receiver->mbuf == NULL);
#endif
@@ -411,38 +444,58 @@ erts_queue_message(Process* receiver,
mp = message_alloc();
+ if (receiver_state)
+ state = *receiver_state;
+ else
+ state = erts_smp_atomic32_read_acqb(&receiver->state);
+
#ifdef ERTS_SMP
- need_locks = ~(*receiver_locks) & (ERTS_PROC_LOCK_MSGQ
- | ERTS_PROC_LOCK_STATUS);
- if (need_locks) {
- *receiver_locks |= need_locks;
- if (erts_smp_proc_trylock(receiver, need_locks) == EBUSY) {
- if (need_locks == ERTS_PROC_LOCK_MSGQ) {
+
+ if (state & (ERTS_PSFLG_EXITING|ERTS_PSFLG_PENDING_EXIT))
+ goto exiting;
+
+ 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;
+ if (*receiver_locks & ERTS_PROC_LOCK_STATUS) {
erts_smp_proc_unlock(receiver, ERTS_PROC_LOCK_STATUS);
- need_locks = (ERTS_PROC_LOCK_MSGQ
- | ERTS_PROC_LOCK_STATUS);
+ need_locks |= ERTS_PROC_LOCK_STATUS;
}
erts_smp_proc_lock(receiver, need_locks);
}
+ locked_msgq = 1;
+ state = erts_smp_atomic32_read_nob(&receiver->state);
+ if (receiver_state)
+ *receiver_state = state;
}
- if (receiver->is_exiting || ERTS_PROC_PENDING_EXIT(receiver)) {
- /* Drop message if receiver is exiting or has a pending
- * exit ...
- */
+#endif
+
+ if (state & (ERTS_PSFLG_PENDING_EXIT|ERTS_PSFLG_EXITING)) {
+#ifdef ERTS_SMP
+ exiting:
+#endif
+ /* Drop message if receiver is exiting or has a pending exit... */
+ if (locked_msgq)
+ erts_smp_proc_unlock(receiver, ERTS_PROC_LOCK_MSGQ);
if (bp)
free_message_buffer(bp);
message_free(mp);
- return;
+ return 0;
}
-#endif
ERL_MESSAGE_TERM(mp) = message;
ERL_MESSAGE_TOKEN(mp) = seq_trace_token;
+#ifdef USE_VM_PROBES
+ ERL_MESSAGE_DT_UTAG(mp) = dt_utag;
+#endif
mp->next = NULL;
mp->data.heap_frag = bp;
-#ifdef ERTS_SMP
+#ifndef ERTS_SMP
+ res = receiver->msg.len;
+#else
+ res = receiver->u.alive.msg_inq.len;
if (*receiver_locks & ERTS_PROC_LOCK_MAIN) {
/*
* We move 'in queue' to 'private queue' and place
@@ -452,25 +505,71 @@ erts_queue_message(Process* receiver,
* we don't need to include the 'in queue' in
* the root set when garbage collecting.
*/
+ res += receiver->msg.len;
ERTS_SMP_MSGQ_MV_INQ2PRIVQ(receiver);
LINK_MESSAGE_PRIVQ(receiver, mp);
}
- else {
+ else
+#endif
+ {
LINK_MESSAGE(receiver, mp);
}
-#else
- LINK_MESSAGE(receiver, mp);
-#endif
- notify_new_message(receiver);
+#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));
+ }
+ 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)) {
+ if (IS_TRACED_FL(receiver, F_TRACE_RECEIVE))
trace_receive(receiver, message);
- }
-
+
+ if (locked_msgq)
+ erts_smp_proc_unlock(receiver, ERTS_PROC_LOCK_MSGQ);
+
+ erts_proc_notify_new_message(receiver);
+
#ifndef ERTS_SMP
ERTS_HOLE_CHECK(receiver);
#endif
+ return res;
+}
+
+void
+erts_queue_message(Process* receiver,
+ ErtsProcLocks *receiver_locks,
+ ErlHeapFragment* bp,
+ Eterm message,
+ Eterm seq_trace_token
+#ifdef USE_VM_PROBES
+ , Eterm dt_utag
+#endif
+ )
+{
+ queue_message(NULL,
+ receiver,
+ receiver_locks,
+ NULL,
+ bp,
+ message,
+ seq_trace_token
+#ifdef USE_VM_PROBES
+ , dt_utag
+#endif
+ );
}
void
@@ -497,41 +596,66 @@ erts_move_msg_mbuf_to_heap(Eterm** hpp, ErlOffHeap* off_heap, ErlMessage *msg)
Sint offs;
Uint sz;
ErlHeapFragment *bp;
+#ifdef USE_VM_PROBES
+ Eterm utag;
+#endif
#ifdef HARD_DEBUG
- ProcBin *dbg_mso_start = off_heap->mso;
- ErlFunThing *dbg_fun_start = off_heap->funs;
- ExternalThing *dbg_external_start = off_heap->externals;
+ struct erl_off_heap_header* dbg_oh_start = off_heap->first;
Eterm dbg_term, dbg_token;
ErlHeapFragment *dbg_bp;
Uint *dbg_hp, *dbg_thp_start;
Uint dbg_term_sz, dbg_token_sz;
+#ifdef USE_VM_PROBES
+ Eterm dbg_utag;
+ Uint dbg_utag_sz;
+#endif
#endif
bp = msg->data.heap_frag;
term = ERL_MESSAGE_TERM(msg);
token = ERL_MESSAGE_TOKEN(msg);
+#ifdef USE_VM_PROBES
+ utag = ERL_MESSAGE_DT_UTAG(msg);
+#endif
if (!bp) {
+#ifdef USE_VM_PROBES
+ ASSERT(is_immed(term) && is_immed(token) && is_immed(utag));
+#else
ASSERT(is_immed(term) && is_immed(token));
+#endif
return;
}
#ifdef HARD_DEBUG
dbg_term_sz = size_object(term);
dbg_token_sz = size_object(token);
+ dbg_bp = new_message_buffer(dbg_term_sz + dbg_token_sz);
+#ifdef USE_VM_PROBES
+ dbg_utag_sz = size_object(utag);
+ dbg_bp = new_message_buffer(dbg_term_sz + dbg_token_sz + dbg_utag_sz );
+#endif
/*ASSERT(dbg_term_sz + dbg_token_sz == erts_msg_used_frag_sz(msg));
Copied size may be smaller due to removed SubBins's or garbage.
Copied size may be larger due to duplicated shared terms.
*/
- dbg_bp = new_message_buffer(dbg_term_sz + dbg_token_sz);
dbg_hp = dbg_bp->mem;
dbg_term = copy_struct(term, dbg_term_sz, &dbg_hp, &dbg_bp->off_heap);
dbg_token = copy_struct(token, dbg_token_sz, &dbg_hp, &dbg_bp->off_heap);
- dbg_thp_start = *hpp;
+#ifdef USE_VM_PROBES
+ dbg_utag = copy_struct(utag, dbg_utag_sz, &dbg_hp, &dbg_bp->off_heap);
+#endif
+ dbg_thp_start = *hpp;
#endif
if (bp->next != NULL) {
- move_multi_frags(hpp, off_heap, bp, msg->m, 2);
+ move_multi_frags(hpp, off_heap, bp, msg->m,
+#ifdef USE_VM_PROBES
+ 3
+#else
+ 2
+#endif
+ );
goto copy_done;
}
@@ -633,6 +757,16 @@ erts_move_msg_mbuf_to_heap(Eterm** hpp, ErlOffHeap* off_heap, ErlMessage *msg)
ASSERT(hp > ptr_val(ERL_MESSAGE_TERM(msg)));
#endif
}
+#ifdef USE_VM_PROBES
+ if (is_not_immed(utag)) {
+ ASSERT(in_heapfrag(ptr_val(utag), bp));
+ ERL_MESSAGE_DT_UTAG(msg) = offset_ptr(utag, offs);
+#ifdef HARD_DEBUG
+ ASSERT(dbg_thp_start <= ptr_val(ERL_MESSAGE_DT_UTAG(msg)));
+ ASSERT(hp > ptr_val(ERL_MESSAGE_DT_UTAG(msg)));
+#endif
+ }
+#endif
copy_done:
@@ -641,48 +775,16 @@ copy_done:
int i, j;
ErlHeapFragment* frag;
{
- ProcBin *mso = off_heap->mso;
- i = j = 0;
- while (mso != dbg_mso_start) {
- mso = mso->next;
- i++;
- }
- for (frag=bp; frag; frag=frag->next) {
- mso = frag->off_heap.mso;
- while (mso) {
- mso = mso->next;
- j++;
- }
- }
- ASSERT(i == j);
- }
- {
- ErlFunThing *fun = off_heap->funs;
- i = j = 0;
- while (fun != dbg_fun_start) {
- fun = fun->next;
- i++;
- }
- for (frag=bp; frag; frag=frag->next) {
- fun = frag->off_heap.funs;
- while (fun) {
- fun = fun->next;
- j++;
- }
- }
- ASSERT(i == j);
- }
- {
- ExternalThing *external = off_heap->externals;
+ struct erl_off_heap_header* dbg_oh = off_heap->first;
i = j = 0;
- while (external != dbg_external_start) {
- external = external->next;
+ while (dbg_oh != dbg_oh_start) {
+ dbg_oh = dbg_oh->next;
i++;
}
for (frag=bp; frag; frag=frag->next) {
- external = frag->off_heap.externals;
- while (external) {
- external = external->next;
+ dbg_oh = frag->off_heap.first;
+ while (dbg_oh) {
+ dbg_oh = dbg_oh->next;
j++;
}
}
@@ -699,6 +801,9 @@ copy_done:
#ifdef HARD_DEBUG
ASSERT(eq(ERL_MESSAGE_TERM(msg), dbg_term));
ASSERT(eq(ERL_MESSAGE_TOKEN(msg), dbg_token));
+#ifdef USE_VM_PROBES
+ ASSERT(eq(ERL_MESSAGE_DT_UTAG(msg), dbg_utag));
+#endif
free_message_buffer(dbg_bp);
#endif
@@ -764,7 +869,7 @@ erts_move_msg_attached_data_to_heap(Eterm **hpp, ErlOffHeap *ohp, ErlMessage *ms
* Send a local message when sender & receiver processes are known.
*/
-void
+Sint
erts_send_message(Process* sender,
Process* receiver,
ErtsProcLocks *receiver_locks,
@@ -774,85 +879,105 @@ erts_send_message(Process* sender,
Uint msize;
ErlHeapFragment* bp = NULL;
Eterm token = NIL;
-
+ Sint res = 0;
+#ifdef USE_VM_PROBES
+ DTRACE_CHARBUF(sender_name, 64);
+ DTRACE_CHARBUF(receiver_name, 64);
+ Sint tok_label = 0;
+ Sint tok_lastcnt = 0;
+ Sint tok_serial = 0;
+#endif
BM_STOP_TIMER(system);
BM_MESSAGE(message,sender,receiver);
BM_START_TIMER(send);
+ #ifdef USE_VM_PROBES
+ *sender_name = *receiver_name = '\0';
+ if (DTRACE_ENABLED(message_send)) {
+ erts_snprintf(sender_name, sizeof(DTRACE_CHARBUF_NAME(sender_name)), "%T", sender->id);
+ erts_snprintf(receiver_name, sizeof(DTRACE_CHARBUF_NAME(receiver_name)), "%T", receiver->id);
+ }
+#endif
if (SEQ_TRACE_TOKEN(sender) != NIL && !(flags & ERTS_SND_FLG_NO_SEQ_TRACE)) {
Eterm* hp;
+ Eterm stoken = SEQ_TRACE_TOKEN(sender);
+ Uint seq_trace_size = 0;
+#ifdef USE_VM_PROBES
+ Uint dt_utag_size = 0;
+ Eterm utag = NIL;
+#endif
- BM_SWAP_TIMER(send,size);
+ BM_SWAP_TIMER(send,size);
msize = size_object(message);
- BM_SWAP_TIMER(size,send);
+ BM_SWAP_TIMER(size,send);
+
+#ifdef USE_VM_PROBES
+ if (stoken != am_have_dt_utag) {
+#endif
+
+ seq_trace_update_send(sender);
+ seq_trace_output(stoken, message, SEQ_TRACE_SEND,
+ receiver->id, sender);
+ seq_trace_size = 6; /* TUPLE5 */
+#ifdef USE_VM_PROBES
+ }
+ if (DT_UTAG_FLAGS(sender) & DT_UTAG_SPREADING) {
+ dt_utag_size = size_object(DT_UTAG(sender));
+ } else if (stoken == am_have_dt_utag ) {
+ stoken = NIL;
+ }
+#endif
- seq_trace_update_send(sender);
- seq_trace_output(SEQ_TRACE_TOKEN(sender), message, SEQ_TRACE_SEND,
- receiver->id, sender);
- bp = new_message_buffer(msize + 6 /* TUPLE5 */);
+ bp = new_message_buffer(msize + seq_trace_size
+#ifdef USE_VM_PROBES
+ + dt_utag_size
+#endif
+ );
hp = bp->mem;
BM_SWAP_TIMER(send,copy);
- token = copy_struct(SEQ_TRACE_TOKEN(sender),
- 6 /* TUPLE5 */,
+ token = copy_struct(stoken,
+ seq_trace_size,
&hp,
&bp->off_heap);
message = copy_struct(message, msize, &hp, &bp->off_heap);
+#ifdef USE_VM_PROBES
+ if (DT_UTAG_FLAGS(sender) & DT_UTAG_SPREADING) {
+ utag = copy_struct(DT_UTAG(sender), dt_utag_size, &hp, &bp->off_heap);
+#ifdef DTRACE_TAG_HARDDEBUG
+ erts_fprintf(stderr,
+ "Dtrace -> (%T) Spreading tag (%T) with "
+ "message %T!\r\n",sender->id, utag, message);
+#endif
+ }
+#endif
BM_MESSAGE_COPIED(msize);
BM_SWAP_TIMER(copy,send);
- erts_queue_message(receiver,
- receiver_locks,
- bp,
- message,
- token);
- BM_SWAP_TIMER(send,system);
-#ifdef HYBRID
- } else {
- ErlMessage* mp = message_alloc();
- BM_SWAP_TIMER(send,copy);
-#ifdef INCREMENTAL
- /* TODO: During GC activate processes if the message relies in
- * the fromspace and the sender is active. During major
- * collections add the message to the gray stack if it relies
- * in the old generation and the sender is active and the
- * receiver is inactive.
-
- if (!IS_CONST(message) && (ma_gc_flags & GC_CYCLE) &&
- (ptr_val(message) >= inc_fromspc &&
- ptr_val(message) < inc_fromend) && INC_IS_ACTIVE(sender))
- INC_ACTIVATE(receiver);
- else if (!IS_CONST(message) && (ma_gc_flags & GC_CYCLE) &&
- (ptr_val(message) >= global_old_heap &&
- ptr_val(message) < global_old_hend) &&
- INC_IS_ACTIVE(sender) && !INC_IS_ACTIVE(receiver))
- Mark message in blackmap and add it to the gray stack
- */
-
- if (!IS_CONST(message))
- INC_ACTIVATE(receiver);
-#endif
- LAZY_COPY(sender,message);
- BM_SWAP_TIMER(copy,send);
- ERL_MESSAGE_TERM(mp) = message;
- ERL_MESSAGE_TOKEN(mp) = NIL;
- mp->next = NULL;
- LINK_MESSAGE(receiver, mp);
- ACTIVATE(receiver);
-
- if (receiver->status == P_WAITING) {
- erts_add_to_runq(receiver);
- } else if (receiver->status == P_SUSPENDED) {
- receiver->rstatus = P_RUNABLE;
- }
- if (IS_TRACED_FL(receiver, F_TRACE_RECEIVE)) {
- trace_receive(receiver, message);
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(message_send)) {
+ if (stoken != NIL && stoken != am_have_dt_utag) {
+ tok_label = signed_val(SEQ_TRACE_T_LABEL(stoken));
+ tok_lastcnt = signed_val(SEQ_TRACE_T_LASTCNT(stoken));
+ tok_serial = signed_val(SEQ_TRACE_T_SERIAL(stoken));
+ }
+ DTRACE6(message_send, sender_name, receiver_name,
+ msize, tok_label, tok_lastcnt, tok_serial);
}
-
+#endif
+ res = queue_message(NULL,
+ receiver,
+ receiver_locks,
+ NULL,
+ bp,
+ message,
+ token
+#ifdef USE_VM_PROBES
+ , utag
+#endif
+ );
BM_SWAP_TIMER(send,system);
- return;
-#else
} else if (sender == receiver) {
/* Drop message if receiver has a pending exit ... */
#ifdef ERTS_SMP
@@ -874,9 +999,14 @@ erts_send_message(Process* sender,
{
ErlMessage* mp = message_alloc();
+ DTRACE6(message_send, sender_name, receiver_name,
+ size_object(message), tok_label, tok_lastcnt, tok_serial);
mp->data.attached = NULL;
ERL_MESSAGE_TERM(mp) = message;
ERL_MESSAGE_TOKEN(mp) = NIL;
+#ifdef USE_VM_PROBES
+ ERL_MESSAGE_DT_UTAG(mp) = NIL;
+#endif
mp->next = NULL;
/*
* We move 'in queue' to 'private queue' and place
@@ -890,25 +1020,45 @@ erts_send_message(Process* sender,
ERTS_SMP_MSGQ_MV_INQ2PRIVQ(receiver);
LINK_MESSAGE_PRIVQ(receiver, mp);
+ res = receiver->msg.len;
+
if (IS_TRACED_FL(receiver, F_TRACE_RECEIVE)) {
trace_receive(receiver, message);
}
}
BM_SWAP_TIMER(send,system);
- return;
} else {
#ifdef ERTS_SMP
ErlOffHeap *ohp;
Eterm *hp;
+ erts_aint32_t state;
+
BM_SWAP_TIMER(send,size);
msize = size_object(message);
BM_SWAP_TIMER(size,send);
- hp = erts_alloc_message_heap(msize,&bp,&ohp,receiver,receiver_locks);
+ hp = erts_alloc_message_heap_state(msize,
+ &bp,
+ &ohp,
+ receiver,
+ receiver_locks,
+ &state);
BM_SWAP_TIMER(send,copy);
message = copy_struct(message, msize, &hp, ohp);
BM_MESSAGE_COPIED(msz);
BM_SWAP_TIMER(copy,send);
- erts_queue_message(receiver, receiver_locks, bp, message, token);
+ DTRACE6(message_send, sender_name, receiver_name,
+ msize, tok_label, tok_lastcnt, tok_serial);
+ res = queue_message(sender,
+ receiver,
+ receiver_locks,
+ &state,
+ bp,
+ message,
+ token
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
BM_SWAP_TIMER(send,system);
#else
ErlMessage* mp = message_alloc();
@@ -928,25 +1078,27 @@ erts_send_message(Process* sender,
message = copy_struct(message, msize, &hp, &receiver->off_heap);
BM_MESSAGE_COPIED(msize);
BM_SWAP_TIMER(copy,send);
+ DTRACE6(message_send, sender_name, receiver_name,
+ (uint32_t)msize, tok_label, tok_lastcnt, tok_serial);
ERL_MESSAGE_TERM(mp) = message;
ERL_MESSAGE_TOKEN(mp) = NIL;
+#ifdef USE_VM_PROBES
+ ERL_MESSAGE_DT_UTAG(mp) = NIL;
+#endif
mp->next = NULL;
mp->data.attached = NULL;
LINK_MESSAGE(receiver, mp);
+ res = receiver->msg.len;
+ erts_proc_notify_new_message(receiver);
- if (receiver->status == P_WAITING) {
- erts_add_to_runq(receiver);
- } else if (receiver->status == P_SUSPENDED) {
- receiver->rstatus = P_RUNABLE;
- }
if (IS_TRACED_FL(receiver, F_TRACE_RECEIVE)) {
trace_receive(receiver, message);
}
BM_SWAP_TIMER(send,system);
#endif /* #ifndef ERTS_SMP */
return;
-#endif /* HYBRID */
}
+ return res;
}
/*
@@ -968,7 +1120,11 @@ erts_deliver_exit_message(Eterm from, Process *to, ErtsProcLocks *to_locksp,
Eterm temptoken;
ErlHeapFragment* bp = NULL;
- if (token != NIL) {
+ if (token != NIL
+#ifdef USE_VM_PROBES
+ && token != am_have_dt_utag
+#endif
+ ) {
ASSERT(is_tuple(token));
sz_reason = size_object(reason);
@@ -983,7 +1139,11 @@ 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->id, NULL);
temptoken = copy_struct(token, sz_token, &hp, &bp->off_heap);
- erts_queue_message(to, to_locksp, bp, save, temptoken);
+ erts_queue_message(to, to_locksp, bp, save, temptoken
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
} else {
ErlOffHeap *ohp;
sz_reason = size_object(reason);
@@ -1000,7 +1160,11 @@ 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, bp, save, NIL);
+ erts_queue_message(to, to_locksp, bp, save, NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
}
}
diff --git a/erts/emulator/beam/erl_message.h b/erts/emulator/beam/erl_message.h
index 5aca0db6fe..2ae94965b1 100644
--- a/erts/emulator/beam/erl_message.h
+++ b/erts/emulator/beam/erl_message.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2010. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2012. 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
@@ -70,11 +70,18 @@ typedef struct erl_mesg {
ErlHeapFragment *heap_frag;
void *attached;
} data;
+#ifdef USE_VM_PROBES
+ Eterm m[3]; /* m[0] = message, m[1] = seq trace token, m[3] = dynamic trace user tag */
+#else
Eterm m[2]; /* m[0] = message, m[1] = seq trace token */
+#endif
} ErlMessage;
#define ERL_MESSAGE_TERM(mp) ((mp)->m[0])
#define ERL_MESSAGE_TOKEN(mp) ((mp)->m[1])
+#ifdef USE_VM_PROBES
+#define ERL_MESSAGE_DT_UTAG(mp) ((mp)->m[2])
+#endif
/* Size of default message buffer (erl_message.c) */
#define ERL_MESSAGE_BUF_SZ 500
@@ -83,7 +90,7 @@ typedef struct {
ErlMessage* first;
ErlMessage** last; /* point to the last next pointer */
ErlMessage** save;
- int len; /* queue length */
+ Sint len; /* queue length */
/*
* The following two fields are used by the recv_mark/1 and
@@ -98,7 +105,7 @@ typedef struct {
typedef struct {
ErlMessage* first;
ErlMessage** last; /* point to the last next pointer */
- int len; /* queue length */
+ Sint len; /* queue length */
} ErlMessageInQueue;
#endif
@@ -118,23 +125,23 @@ typedef struct {
#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; \
- } \
+#define ERTS_SMP_MSGQ_MV_INQ2PRIVQ(P) \
+do { \
+ if ((P)->u.alive.msg_inq.first) { \
+ *(P)->msg.last = (P)->u.alive.msg_inq.first; \
+ (P)->msg.last = (P)->u.alive.msg_inq.last; \
+ (P)->msg.len += (P)->u.alive.msg_inq.len; \
+ (P)->u.alive.msg_inq.first = NULL; \
+ (P)->u.alive.msg_inq.last = &(P)->u.alive.msg_inq.first; \
+ (P)->u.alive.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++; \
+ *(p)->u.alive.msg_inq.last = (mp); \
+ (p)->u.alive.msg_inq.last = &(mp)->next; \
+ (p)->u.alive.msg_inq.len++; \
} while(0)
#else
@@ -221,9 +228,13 @@ ErlHeapFragment* erts_resize_message_buffer(ErlHeapFragment *, Uint,
Eterm *, Uint);
void free_message_buffer(ErlHeapFragment *);
void erts_queue_dist_message(Process*, ErtsProcLocks*, ErtsDistExternal *, Eterm);
-void erts_queue_message(Process*, ErtsProcLocks*, ErlHeapFragment*, Eterm, Eterm);
+void erts_queue_message(Process*, ErtsProcLocks*, ErlHeapFragment*, Eterm, Eterm
+#ifdef USE_VM_PROBES
+ , Eterm dt_utag
+#endif
+);
void erts_deliver_exit_message(Eterm, Process*, ErtsProcLocks *, Eterm, Eterm);
-void erts_send_message(Process*, Process*, ErtsProcLocks*, Eterm, unsigned);
+Sint erts_send_message(Process*, Process*, ErtsProcLocks*, Eterm, unsigned);
void erts_link_mbuf_to_proc(Process *proc, ErlHeapFragment *bp);
void erts_move_msg_mbuf_to_heap(Eterm**, ErlOffHeap*, ErlMessage *);
diff --git a/erts/emulator/beam/erl_mtrace.c b/erts/emulator/beam/erl_mtrace.c
index 358c67bf20..5a6fb8589f 100644
--- a/erts/emulator/beam/erl_mtrace.c
+++ b/erts/emulator/beam/erl_mtrace.c
@@ -611,7 +611,7 @@ void erts_mtrace_init(char *receiver, char *nodename)
if (erts_sock_gethostname(hostname, MAXHOSTNAMELEN) != 0)
hostname[0] = '\0';
hostname[MAXHOSTNAMELEN-1] = '\0';
- sys_get_pid(pid);
+ sys_get_pid(pid, sizeof(pid));
write_trace_header(nodename ? nodename : "", pid, hostname);
erts_mtrace_update_heap_size();
}
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 58a09986d2..0dca588847 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2012. 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
@@ -33,6 +33,10 @@
#include "big.h"
#include "beam_bp.h"
#include "erl_thr_progress.h"
+#include "dtrace-wrapper.h"
+#if defined(USE_DYNAMIC_TRACE) && (defined(USE_DTRACE) || defined(USE_SYSTEMTAP))
+#define HAVE_USE_DTRACE 1
+#endif
#include <limits.h>
#include <stddef.h> /* offsetof */
@@ -66,6 +70,9 @@ static void add_readonly_check(ErlNifEnv*, unsigned char* ptr, unsigned sz);
static int is_offheap(const ErlOffHeap* off_heap);
#endif
+#ifdef USE_VM_PROBES
+void dtrace_nifenv_str(ErlNifEnv *, char *);
+#endif
#define MIN_HEAP_FRAG_SZ 200
static Eterm* alloc_heap_heavy(ErlNifEnv* env, unsigned need, Eterm* hp);
@@ -308,6 +315,7 @@ int enif_send(ErlNifEnv* env, const ErlNifPid* to_pid,
#endif
Eterm receiver = to_pid->pid;
int flush_me = 0;
+ int scheduler = erts_get_scheduler_id() != 0;
if (env != NULL) {
c_p = env->proc;
@@ -327,8 +335,11 @@ int enif_send(ErlNifEnv* env, const ErlNifPid* to_pid,
#if defined(ERTS_ENABLE_LOCK_CHECK) && defined(ERTS_SMP)
rp_had_locks = rp_locks;
#endif
- rp = erts_pid2proc_opt(c_p, ERTS_PROC_LOCK_MAIN,
- receiver, rp_locks, ERTS_P2P_FLG_SMP_INC_REFC);
+
+ rp = (scheduler
+ ? erts_proc_lookup(receiver)
+ : erts_pid2proc_opt(c_p, ERTS_PROC_LOCK_MAIN,
+ receiver, rp_locks, ERTS_P2P_FLG_SMP_INC_REFC));
if (rp == NULL) {
ASSERT(env == NULL || receiver != c_p->id);
return 0;
@@ -350,13 +361,17 @@ int enif_send(ErlNifEnv* env, const ErlNifPid* to_pid,
if (flush_me) {
flush_env(env); /* Needed for ERTS_HOLE_CHECK */
}
- erts_queue_message(rp, &rp_locks, frags, msg, am_undefined);
- if (rp_locks) {
- ERTS_SMP_LC_ASSERT(rp_locks == (rp_had_locks | (ERTS_PROC_LOCK_MSGQ |
- ERTS_PROC_LOCK_STATUS)));
- erts_smp_proc_unlock(rp, (ERTS_PROC_LOCK_MSGQ | ERTS_PROC_LOCK_STATUS));
- }
- erts_smp_proc_dec_refc(rp);
+ erts_queue_message(rp, &rp_locks, frags, msg, am_undefined
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
+ if (c_p == rp)
+ rp_locks &= ~ERTS_PROC_LOCK_MAIN;
+ if (rp_locks)
+ erts_smp_proc_unlock(rp, rp_locks);
+ if (!scheduler)
+ erts_smp_proc_dec_refc(rp);
if (flush_me) {
cache_env(env);
}
@@ -1513,6 +1528,7 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
if (len < 0) {
BIF_ERROR(BIF_P, BADARG);
}
+
lib_name = (char *) erts_alloc(ERTS_ALC_T_TMP, len + 1);
if (intlist_to_buf(BIF_ARG_1, lib_name, len) != len) {
@@ -1521,6 +1537,12 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
}
lib_name[len] = '\0';
+ if (!erts_try_seize_code_write_permission(BIF_P)) {
+ erts_free(ERTS_ALC_T_TMP, lib_name);
+ ERTS_BIF_YIELD2(bif_export[BIF_load_nif_2],
+ BIF_P, BIF_ARG_1, BIF_ARG_2);
+ }
+
/* Block system (is this the right place to do it?) */
erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN);
erts_smp_thr_progress_block();
@@ -1534,11 +1556,11 @@ 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);
+ mod=erts_get_module(mod_atom, erts_active_code_ix());
ASSERT(mod != NULL);
- if (!in_area(caller, mod->code, mod->code_length)) {
- ASSERT(in_area(caller, mod->old_code, mod->old_code_length));
+ if (!in_area(caller, mod->curr.code, mod->curr.code_length)) {
+ ASSERT(in_area(caller, mod->old.code, mod->old.code_length));
ret = load_nif_error(BIF_P, "old_code", "Calling load_nif from old "
"module '%T' not allowed", mod_atom);
@@ -1584,7 +1606,7 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
BeamInstr** code_pp;
ErlNifFunc* f = &entry->funcs[i];
if (!erts_atom_get(f->name, sys_strlen(f->name), &f_atom)
- || (code_pp = get_func_pp(mod->code, f_atom, f->arity))==NULL) {
+ || (code_pp = get_func_pp(mod->curr.code, 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);
}
@@ -1613,18 +1635,18 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
erts_refc_init(&lib->rt_dtor_cnt, 0);
lib->mod = mod;
env.mod_nif = lib;
- if (mod->nif != NULL) { /* Reload */
+ if (mod->curr.nif != NULL) { /* Reload */
int k;
- lib->priv_data = mod->nif->priv_data;
+ lib->priv_data = mod->curr.nif->priv_data;
- ASSERT(mod->nif->entry != NULL);
+ ASSERT(mod->curr.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 */
- for (k=0; k < mod->nif->entry->num_of_funcs; k++) {
- ErlNifFunc* old_func = &mod->nif->entry->funcs[k];
+ for (k=0; k < mod->curr.nif->entry->num_of_funcs; k++) {
+ ErlNifFunc* old_func = &mod->curr.nif->entry->funcs[k];
for (i=0; i < entry->num_of_funcs; i++) {
if (old_func->arity == entry->funcs[i].arity
&& sys_strcmp(old_func->name, entry->funcs[i].name) == 0) {
@@ -1645,24 +1667,24 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
ret = load_nif_error(BIF_P, reload, "Library reload-call unsuccessful.");
}
else {
- mod->nif->entry = NULL; /* to prevent 'unload' callback */
- erts_unload_nif(mod->nif);
+ mod->curr.nif->entry = NULL; /* to prevent 'unload' callback */
+ erts_unload_nif(mod->curr.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 (mod->old.nif != NULL) { /* Upgrade */
+ void* prev_old_data = mod->old.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);
+ veto = entry->upgrade(&env, &lib->priv_data, &mod->old.nif->priv_data, BIF_ARG_2);
erts_post_nif(&env);
if (veto) {
- mod->old_nif->priv_data = prev_old_data;
+ mod->old.nif->priv_data = prev_old_data;
ret = load_nif_error(BIF_P, upgrade, "Library upgrade-call unsuccessful.");
}
/*else if (mod->old_nif->priv_data != prev_old_data) {
@@ -1682,20 +1704,21 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
/*
** Everything ok, patch the beam code with op_call_nif
*/
- mod->nif = lib;
+ mod->curr.nif = lib;
for (i=0; i < entry->num_of_funcs; i++)
{
BeamInstr* code_ptr;
erts_atom_get(entry->funcs[i].name, sys_strlen(entry->funcs[i].name), &f_atom);
- code_ptr = *get_func_pp(mod->code, f_atom, entry->funcs[i].arity);
+ code_ptr = *get_func_pp(mod->curr.code, f_atom, entry->funcs[i].arity);
if (code_ptr[1] == 0) {
code_ptr[5+0] = (BeamInstr) BeamOp(op_call_nif);
}
else { /* Function traced, patch the original instruction word */
- BpData** bps = (BpData**) code_ptr[1];
- BpData* bp = (BpData*) bps[erts_bp_sched2ix()];
- bp->orig_instr = (BeamInstr) BeamOp(op_call_nif);
+ GenericBp* g = (GenericBp *) code_ptr[1];
+ ASSERT(code_ptr[5+0] ==
+ (BeamInstr) BeamOp(op_i_generic_breakpoint));
+ g->orig_instr = (BeamInstr) BeamOp(op_call_nif);
}
code_ptr[5+1] = (BeamInstr) entry->funcs[i].fptr;
code_ptr[5+2] = (BeamInstr) lib;
@@ -1715,6 +1738,7 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
erts_smp_thr_progress_unblock();
erts_smp_proc_lock(BIF_P, ERTS_PROC_LOCK_MAIN);
+ erts_release_code_write_permission();
erts_free(ERTS_ALC_T_TMP, lib_name);
if (reload_warning) {
@@ -1779,6 +1803,13 @@ void erl_nif_init()
resource_type_list.name = THE_NON_VALUE;
}
+#ifdef USE_VM_PROBES
+void dtrace_nifenv_str(ErlNifEnv *env, char *process_buf)
+{
+ dtrace_pid_str(env->proc->id, process_buf);
+}
+#endif
+
#ifdef READONLY_CHECK
/* Use checksums to assert that NIFs do not write into inspected binaries
*/
@@ -1827,3 +1858,1079 @@ static unsigned calc_checksum(unsigned char* ptr, unsigned size)
#endif /* READONLY_CHECK */
+#ifdef HAVE_USE_DTRACE
+
+#define MESSAGE_BUFSIZ 1024
+
+static void get_string_maybe(ErlNifEnv *env, const ERL_NIF_TERM term,
+ char **ptr, char *buf, int bufsiz)
+{
+ ErlNifBinary str_bin;
+
+ if (!enif_inspect_iolist_as_binary(env, term, &str_bin) ||
+ str_bin.size > bufsiz) {
+ *ptr = NULL;
+ } else {
+ memcpy(buf, (char *) str_bin.data, str_bin.size);
+ buf[str_bin.size] = '\0';
+ *ptr = buf;
+ }
+}
+
+ERL_NIF_TERM erl_nif_user_trace_s1(ErlNifEnv* env, int argc,
+ const ERL_NIF_TERM argv[])
+{
+ ErlNifBinary message_bin;
+ DTRACE_CHARBUF(messagebuf, MESSAGE_BUFSIZ + 1);
+
+ if (DTRACE_ENABLED(user_trace_s1)) {
+ if (!enif_inspect_iolist_as_binary(env, argv[0], &message_bin) ||
+ message_bin.size > MESSAGE_BUFSIZ) {
+ return am_badarg;
+ }
+ memcpy(messagebuf, (char *) message_bin.data, message_bin.size);
+ messagebuf[message_bin.size] = '\0';
+ DTRACE1(user_trace_s1, messagebuf);
+ return am_true;
+ } else {
+ return am_false;
+ }
+}
+
+ERL_NIF_TERM erl_nif_user_trace_i4s4(ErlNifEnv* env, int argc,
+ const ERL_NIF_TERM argv[])
+{
+ DTRACE_CHARBUF(procbuf, 32 + 1);
+ DTRACE_CHARBUF(user_tagbuf, MESSAGE_BUFSIZ + 1);
+ char *utbuf = NULL;
+ ErlNifSInt64 i1, i2, i3, i4;
+ DTRACE_CHARBUF(messagebuf1, MESSAGE_BUFSIZ + 1);
+ DTRACE_CHARBUF(messagebuf2, MESSAGE_BUFSIZ + 1);
+ DTRACE_CHARBUF(messagebuf3, MESSAGE_BUFSIZ + 1);
+ DTRACE_CHARBUF(messagebuf4, MESSAGE_BUFSIZ + 1);
+ char *mbuf1 = NULL, *mbuf2 = NULL, *mbuf3 = NULL, *mbuf4 = NULL;
+
+ if (DTRACE_ENABLED(user_trace_i4s4)) {
+ dtrace_nifenv_str(env, procbuf);
+ get_string_maybe(env, argv[0], &utbuf, user_tagbuf, MESSAGE_BUFSIZ);
+ if (! enif_get_int64(env, argv[1], &i1))
+ i1 = 0;
+ if (! enif_get_int64(env, argv[2], &i2))
+ i2 = 0;
+ if (! enif_get_int64(env, argv[3], &i3))
+ i3 = 0;
+ if (! enif_get_int64(env, argv[4], &i4))
+ i4 = 0;
+ get_string_maybe(env, argv[5], &mbuf1, messagebuf1, MESSAGE_BUFSIZ);
+ get_string_maybe(env, argv[6], &mbuf2, messagebuf2, MESSAGE_BUFSIZ);
+ get_string_maybe(env, argv[7], &mbuf3, messagebuf3, MESSAGE_BUFSIZ);
+ get_string_maybe(env, argv[8], &mbuf4, messagebuf4, MESSAGE_BUFSIZ);
+ DTRACE10(user_trace_i4s4, procbuf, utbuf,
+ i1, i2, i3, i4, mbuf1, mbuf2, mbuf3, mbuf4);
+ return am_true;
+ } else {
+ return am_false;
+ }
+}
+
+#define DTRACE10_LABEL(name, label, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) \
+ erlang_##name##label((a0), (a1), (a2), (a3), (a4), (a5), (a6), (a7), (a8), (a9))
+#define N_STATEMENT(the_label) \
+ case the_label: \
+ if (DTRACE_ENABLED(user_trace_n##the_label)) { \
+ dtrace_nifenv_str(env, procbuf); \
+ get_string_maybe(env, argv[1], &utbuf, user_tagbuf, MESSAGE_BUFSIZ); \
+ if (! enif_get_int64(env, argv[2], &i1)) \
+ i1 = 0; \
+ if (! enif_get_int64(env, argv[3], &i2)) \
+ i2 = 0; \
+ if (! enif_get_int64(env, argv[4], &i3)) \
+ i3 = 0; \
+ if (! enif_get_int64(env, argv[5], &i4)) \
+ i4 = 0; \
+ get_string_maybe(env, argv[6], &mbuf1, messagebuf1, MESSAGE_BUFSIZ); \
+ get_string_maybe(env, argv[7], &mbuf2, messagebuf2, MESSAGE_BUFSIZ); \
+ get_string_maybe(env, argv[8], &mbuf3, messagebuf3, MESSAGE_BUFSIZ); \
+ get_string_maybe(env, argv[9], &mbuf4, messagebuf4, MESSAGE_BUFSIZ); \
+ DTRACE10_LABEL(user_trace_n, the_label, procbuf, utbuf, \
+ i1, i2, i3, i4, mbuf1, mbuf2, mbuf3, mbuf4); \
+ return am_true; \
+ } else { \
+ return am_false; \
+ } \
+ break
+
+ERL_NIF_TERM erl_nif_user_trace_n(ErlNifEnv* env, int argc,
+ const ERL_NIF_TERM argv[])
+{
+ DTRACE_CHARBUF(procbuf, 32 + 1);
+ DTRACE_CHARBUF(user_tagbuf, MESSAGE_BUFSIZ + 1);
+ char *utbuf = NULL;
+ ErlNifSInt64 i1, i2, i3, i4;
+ DTRACE_CHARBUF(messagebuf1, MESSAGE_BUFSIZ + 1);
+ DTRACE_CHARBUF(messagebuf2, MESSAGE_BUFSIZ + 1);
+ DTRACE_CHARBUF(messagebuf3, MESSAGE_BUFSIZ + 1);
+ DTRACE_CHARBUF(messagebuf4, MESSAGE_BUFSIZ + 1);
+ char *mbuf1 = NULL, *mbuf2 = NULL, *mbuf3 = NULL, *mbuf4 = NULL;
+ ErlNifSInt64 label = 0;
+
+ if (! enif_get_int64(env, argv[0], &label) || label < 0 || label > 1023) {
+ return am_badarg;
+ }
+ switch (label) {
+ N_STATEMENT(0);
+ N_STATEMENT(1);
+ N_STATEMENT(2);
+ N_STATEMENT(3);
+ N_STATEMENT(4);
+ N_STATEMENT(5);
+ N_STATEMENT(6);
+ N_STATEMENT(7);
+ N_STATEMENT(8);
+ N_STATEMENT(9);
+ N_STATEMENT(10);
+ N_STATEMENT(11);
+ N_STATEMENT(12);
+ N_STATEMENT(13);
+ N_STATEMENT(14);
+ N_STATEMENT(15);
+ N_STATEMENT(16);
+ N_STATEMENT(17);
+ N_STATEMENT(18);
+ N_STATEMENT(19);
+ N_STATEMENT(20);
+ N_STATEMENT(21);
+ N_STATEMENT(22);
+ N_STATEMENT(23);
+ N_STATEMENT(24);
+ N_STATEMENT(25);
+ N_STATEMENT(26);
+ N_STATEMENT(27);
+ N_STATEMENT(28);
+ N_STATEMENT(29);
+ N_STATEMENT(30);
+ N_STATEMENT(31);
+ N_STATEMENT(32);
+ N_STATEMENT(33);
+ N_STATEMENT(34);
+ N_STATEMENT(35);
+ N_STATEMENT(36);
+ N_STATEMENT(37);
+ N_STATEMENT(38);
+ N_STATEMENT(39);
+ N_STATEMENT(40);
+ N_STATEMENT(41);
+ N_STATEMENT(42);
+ N_STATEMENT(43);
+ N_STATEMENT(44);
+ N_STATEMENT(45);
+ N_STATEMENT(46);
+ N_STATEMENT(47);
+ N_STATEMENT(48);
+ N_STATEMENT(49);
+ N_STATEMENT(50);
+ N_STATEMENT(51);
+ N_STATEMENT(52);
+ N_STATEMENT(53);
+ N_STATEMENT(54);
+ N_STATEMENT(55);
+ N_STATEMENT(56);
+ N_STATEMENT(57);
+ N_STATEMENT(58);
+ N_STATEMENT(59);
+ N_STATEMENT(60);
+ N_STATEMENT(61);
+ N_STATEMENT(62);
+ N_STATEMENT(63);
+ N_STATEMENT(64);
+ N_STATEMENT(65);
+ N_STATEMENT(66);
+ N_STATEMENT(67);
+ N_STATEMENT(68);
+ N_STATEMENT(69);
+ N_STATEMENT(70);
+ N_STATEMENT(71);
+ N_STATEMENT(72);
+ N_STATEMENT(73);
+ N_STATEMENT(74);
+ N_STATEMENT(75);
+ N_STATEMENT(76);
+ N_STATEMENT(77);
+ N_STATEMENT(78);
+ N_STATEMENT(79);
+ N_STATEMENT(80);
+ N_STATEMENT(81);
+ N_STATEMENT(82);
+ N_STATEMENT(83);
+ N_STATEMENT(84);
+ N_STATEMENT(85);
+ N_STATEMENT(86);
+ N_STATEMENT(87);
+ N_STATEMENT(88);
+ N_STATEMENT(89);
+ N_STATEMENT(90);
+ N_STATEMENT(91);
+ N_STATEMENT(92);
+ N_STATEMENT(93);
+ N_STATEMENT(94);
+ N_STATEMENT(95);
+ N_STATEMENT(96);
+ N_STATEMENT(97);
+ N_STATEMENT(98);
+ N_STATEMENT(99);
+ N_STATEMENT(100);
+ N_STATEMENT(101);
+ N_STATEMENT(102);
+ N_STATEMENT(103);
+ N_STATEMENT(104);
+ N_STATEMENT(105);
+ N_STATEMENT(106);
+ N_STATEMENT(107);
+ N_STATEMENT(108);
+ N_STATEMENT(109);
+ N_STATEMENT(110);
+ N_STATEMENT(111);
+ N_STATEMENT(112);
+ N_STATEMENT(113);
+ N_STATEMENT(114);
+ N_STATEMENT(115);
+ N_STATEMENT(116);
+ N_STATEMENT(117);
+ N_STATEMENT(118);
+ N_STATEMENT(119);
+ N_STATEMENT(120);
+ N_STATEMENT(121);
+ N_STATEMENT(122);
+ N_STATEMENT(123);
+ N_STATEMENT(124);
+ N_STATEMENT(125);
+ N_STATEMENT(126);
+ N_STATEMENT(127);
+ N_STATEMENT(128);
+ N_STATEMENT(129);
+ N_STATEMENT(130);
+ N_STATEMENT(131);
+ N_STATEMENT(132);
+ N_STATEMENT(133);
+ N_STATEMENT(134);
+ N_STATEMENT(135);
+ N_STATEMENT(136);
+ N_STATEMENT(137);
+ N_STATEMENT(138);
+ N_STATEMENT(139);
+ N_STATEMENT(140);
+ N_STATEMENT(141);
+ N_STATEMENT(142);
+ N_STATEMENT(143);
+ N_STATEMENT(144);
+ N_STATEMENT(145);
+ N_STATEMENT(146);
+ N_STATEMENT(147);
+ N_STATEMENT(148);
+ N_STATEMENT(149);
+ N_STATEMENT(150);
+ N_STATEMENT(151);
+ N_STATEMENT(152);
+ N_STATEMENT(153);
+ N_STATEMENT(154);
+ N_STATEMENT(155);
+ N_STATEMENT(156);
+ N_STATEMENT(157);
+ N_STATEMENT(158);
+ N_STATEMENT(159);
+ N_STATEMENT(160);
+ N_STATEMENT(161);
+ N_STATEMENT(162);
+ N_STATEMENT(163);
+ N_STATEMENT(164);
+ N_STATEMENT(165);
+ N_STATEMENT(166);
+ N_STATEMENT(167);
+ N_STATEMENT(168);
+ N_STATEMENT(169);
+ N_STATEMENT(170);
+ N_STATEMENT(171);
+ N_STATEMENT(172);
+ N_STATEMENT(173);
+ N_STATEMENT(174);
+ N_STATEMENT(175);
+ N_STATEMENT(176);
+ N_STATEMENT(177);
+ N_STATEMENT(178);
+ N_STATEMENT(179);
+ N_STATEMENT(180);
+ N_STATEMENT(181);
+ N_STATEMENT(182);
+ N_STATEMENT(183);
+ N_STATEMENT(184);
+ N_STATEMENT(185);
+ N_STATEMENT(186);
+ N_STATEMENT(187);
+ N_STATEMENT(188);
+ N_STATEMENT(189);
+ N_STATEMENT(190);
+ N_STATEMENT(191);
+ N_STATEMENT(192);
+ N_STATEMENT(193);
+ N_STATEMENT(194);
+ N_STATEMENT(195);
+ N_STATEMENT(196);
+ N_STATEMENT(197);
+ N_STATEMENT(198);
+ N_STATEMENT(199);
+ N_STATEMENT(200);
+ N_STATEMENT(201);
+ N_STATEMENT(202);
+ N_STATEMENT(203);
+ N_STATEMENT(204);
+ N_STATEMENT(205);
+ N_STATEMENT(206);
+ N_STATEMENT(207);
+ N_STATEMENT(208);
+ N_STATEMENT(209);
+ N_STATEMENT(210);
+ N_STATEMENT(211);
+ N_STATEMENT(212);
+ N_STATEMENT(213);
+ N_STATEMENT(214);
+ N_STATEMENT(215);
+ N_STATEMENT(216);
+ N_STATEMENT(217);
+ N_STATEMENT(218);
+ N_STATEMENT(219);
+ N_STATEMENT(220);
+ N_STATEMENT(221);
+ N_STATEMENT(222);
+ N_STATEMENT(223);
+ N_STATEMENT(224);
+ N_STATEMENT(225);
+ N_STATEMENT(226);
+ N_STATEMENT(227);
+ N_STATEMENT(228);
+ N_STATEMENT(229);
+ N_STATEMENT(230);
+ N_STATEMENT(231);
+ N_STATEMENT(232);
+ N_STATEMENT(233);
+ N_STATEMENT(234);
+ N_STATEMENT(235);
+ N_STATEMENT(236);
+ N_STATEMENT(237);
+ N_STATEMENT(238);
+ N_STATEMENT(239);
+ N_STATEMENT(240);
+ N_STATEMENT(241);
+ N_STATEMENT(242);
+ N_STATEMENT(243);
+ N_STATEMENT(244);
+ N_STATEMENT(245);
+ N_STATEMENT(246);
+ N_STATEMENT(247);
+ N_STATEMENT(248);
+ N_STATEMENT(249);
+ N_STATEMENT(250);
+ N_STATEMENT(251);
+ N_STATEMENT(252);
+ N_STATEMENT(253);
+ N_STATEMENT(254);
+ N_STATEMENT(255);
+ N_STATEMENT(256);
+ N_STATEMENT(257);
+ N_STATEMENT(258);
+ N_STATEMENT(259);
+ N_STATEMENT(260);
+ N_STATEMENT(261);
+ N_STATEMENT(262);
+ N_STATEMENT(263);
+ N_STATEMENT(264);
+ N_STATEMENT(265);
+ N_STATEMENT(266);
+ N_STATEMENT(267);
+ N_STATEMENT(268);
+ N_STATEMENT(269);
+ N_STATEMENT(270);
+ N_STATEMENT(271);
+ N_STATEMENT(272);
+ N_STATEMENT(273);
+ N_STATEMENT(274);
+ N_STATEMENT(275);
+ N_STATEMENT(276);
+ N_STATEMENT(277);
+ N_STATEMENT(278);
+ N_STATEMENT(279);
+ N_STATEMENT(280);
+ N_STATEMENT(281);
+ N_STATEMENT(282);
+ N_STATEMENT(283);
+ N_STATEMENT(284);
+ N_STATEMENT(285);
+ N_STATEMENT(286);
+ N_STATEMENT(287);
+ N_STATEMENT(288);
+ N_STATEMENT(289);
+ N_STATEMENT(290);
+ N_STATEMENT(291);
+ N_STATEMENT(292);
+ N_STATEMENT(293);
+ N_STATEMENT(294);
+ N_STATEMENT(295);
+ N_STATEMENT(296);
+ N_STATEMENT(297);
+ N_STATEMENT(298);
+ N_STATEMENT(299);
+ N_STATEMENT(300);
+ N_STATEMENT(301);
+ N_STATEMENT(302);
+ N_STATEMENT(303);
+ N_STATEMENT(304);
+ N_STATEMENT(305);
+ N_STATEMENT(306);
+ N_STATEMENT(307);
+ N_STATEMENT(308);
+ N_STATEMENT(309);
+ N_STATEMENT(310);
+ N_STATEMENT(311);
+ N_STATEMENT(312);
+ N_STATEMENT(313);
+ N_STATEMENT(314);
+ N_STATEMENT(315);
+ N_STATEMENT(316);
+ N_STATEMENT(317);
+ N_STATEMENT(318);
+ N_STATEMENT(319);
+ N_STATEMENT(320);
+ N_STATEMENT(321);
+ N_STATEMENT(322);
+ N_STATEMENT(323);
+ N_STATEMENT(324);
+ N_STATEMENT(325);
+ N_STATEMENT(326);
+ N_STATEMENT(327);
+ N_STATEMENT(328);
+ N_STATEMENT(329);
+ N_STATEMENT(330);
+ N_STATEMENT(331);
+ N_STATEMENT(332);
+ N_STATEMENT(333);
+ N_STATEMENT(334);
+ N_STATEMENT(335);
+ N_STATEMENT(336);
+ N_STATEMENT(337);
+ N_STATEMENT(338);
+ N_STATEMENT(339);
+ N_STATEMENT(340);
+ N_STATEMENT(341);
+ N_STATEMENT(342);
+ N_STATEMENT(343);
+ N_STATEMENT(344);
+ N_STATEMENT(345);
+ N_STATEMENT(346);
+ N_STATEMENT(347);
+ N_STATEMENT(348);
+ N_STATEMENT(349);
+ N_STATEMENT(350);
+ N_STATEMENT(351);
+ N_STATEMENT(352);
+ N_STATEMENT(353);
+ N_STATEMENT(354);
+ N_STATEMENT(355);
+ N_STATEMENT(356);
+ N_STATEMENT(357);
+ N_STATEMENT(358);
+ N_STATEMENT(359);
+ N_STATEMENT(360);
+ N_STATEMENT(361);
+ N_STATEMENT(362);
+ N_STATEMENT(363);
+ N_STATEMENT(364);
+ N_STATEMENT(365);
+ N_STATEMENT(366);
+ N_STATEMENT(367);
+ N_STATEMENT(368);
+ N_STATEMENT(369);
+ N_STATEMENT(370);
+ N_STATEMENT(371);
+ N_STATEMENT(372);
+ N_STATEMENT(373);
+ N_STATEMENT(374);
+ N_STATEMENT(375);
+ N_STATEMENT(376);
+ N_STATEMENT(377);
+ N_STATEMENT(378);
+ N_STATEMENT(379);
+ N_STATEMENT(380);
+ N_STATEMENT(381);
+ N_STATEMENT(382);
+ N_STATEMENT(383);
+ N_STATEMENT(384);
+ N_STATEMENT(385);
+ N_STATEMENT(386);
+ N_STATEMENT(387);
+ N_STATEMENT(388);
+ N_STATEMENT(389);
+ N_STATEMENT(390);
+ N_STATEMENT(391);
+ N_STATEMENT(392);
+ N_STATEMENT(393);
+ N_STATEMENT(394);
+ N_STATEMENT(395);
+ N_STATEMENT(396);
+ N_STATEMENT(397);
+ N_STATEMENT(398);
+ N_STATEMENT(399);
+ N_STATEMENT(400);
+ N_STATEMENT(401);
+ N_STATEMENT(402);
+ N_STATEMENT(403);
+ N_STATEMENT(404);
+ N_STATEMENT(405);
+ N_STATEMENT(406);
+ N_STATEMENT(407);
+ N_STATEMENT(408);
+ N_STATEMENT(409);
+ N_STATEMENT(410);
+ N_STATEMENT(411);
+ N_STATEMENT(412);
+ N_STATEMENT(413);
+ N_STATEMENT(414);
+ N_STATEMENT(415);
+ N_STATEMENT(416);
+ N_STATEMENT(417);
+ N_STATEMENT(418);
+ N_STATEMENT(419);
+ N_STATEMENT(420);
+ N_STATEMENT(421);
+ N_STATEMENT(422);
+ N_STATEMENT(423);
+ N_STATEMENT(424);
+ N_STATEMENT(425);
+ N_STATEMENT(426);
+ N_STATEMENT(427);
+ N_STATEMENT(428);
+ N_STATEMENT(429);
+ N_STATEMENT(430);
+ N_STATEMENT(431);
+ N_STATEMENT(432);
+ N_STATEMENT(433);
+ N_STATEMENT(434);
+ N_STATEMENT(435);
+ N_STATEMENT(436);
+ N_STATEMENT(437);
+ N_STATEMENT(438);
+ N_STATEMENT(439);
+ N_STATEMENT(440);
+ N_STATEMENT(441);
+ N_STATEMENT(442);
+ N_STATEMENT(443);
+ N_STATEMENT(444);
+ N_STATEMENT(445);
+ N_STATEMENT(446);
+ N_STATEMENT(447);
+ N_STATEMENT(448);
+ N_STATEMENT(449);
+ N_STATEMENT(450);
+ N_STATEMENT(451);
+ N_STATEMENT(452);
+ N_STATEMENT(453);
+ N_STATEMENT(454);
+ N_STATEMENT(455);
+ N_STATEMENT(456);
+ N_STATEMENT(457);
+ N_STATEMENT(458);
+ N_STATEMENT(459);
+ N_STATEMENT(460);
+ N_STATEMENT(461);
+ N_STATEMENT(462);
+ N_STATEMENT(463);
+ N_STATEMENT(464);
+ N_STATEMENT(465);
+ N_STATEMENT(466);
+ N_STATEMENT(467);
+ N_STATEMENT(468);
+ N_STATEMENT(469);
+ N_STATEMENT(470);
+ N_STATEMENT(471);
+ N_STATEMENT(472);
+ N_STATEMENT(473);
+ N_STATEMENT(474);
+ N_STATEMENT(475);
+ N_STATEMENT(476);
+ N_STATEMENT(477);
+ N_STATEMENT(478);
+ N_STATEMENT(479);
+ N_STATEMENT(480);
+ N_STATEMENT(481);
+ N_STATEMENT(482);
+ N_STATEMENT(483);
+ N_STATEMENT(484);
+ N_STATEMENT(485);
+ N_STATEMENT(486);
+ N_STATEMENT(487);
+ N_STATEMENT(488);
+ N_STATEMENT(489);
+ N_STATEMENT(490);
+ N_STATEMENT(491);
+ N_STATEMENT(492);
+ N_STATEMENT(493);
+ N_STATEMENT(494);
+ N_STATEMENT(495);
+ N_STATEMENT(496);
+ N_STATEMENT(497);
+ N_STATEMENT(498);
+ N_STATEMENT(499);
+ N_STATEMENT(500);
+ N_STATEMENT(501);
+ N_STATEMENT(502);
+ N_STATEMENT(503);
+ N_STATEMENT(504);
+ N_STATEMENT(505);
+ N_STATEMENT(506);
+ N_STATEMENT(507);
+ N_STATEMENT(508);
+ N_STATEMENT(509);
+ N_STATEMENT(510);
+ N_STATEMENT(511);
+ N_STATEMENT(512);
+ N_STATEMENT(513);
+ N_STATEMENT(514);
+ N_STATEMENT(515);
+ N_STATEMENT(516);
+ N_STATEMENT(517);
+ N_STATEMENT(518);
+ N_STATEMENT(519);
+ N_STATEMENT(520);
+ N_STATEMENT(521);
+ N_STATEMENT(522);
+ N_STATEMENT(523);
+ N_STATEMENT(524);
+ N_STATEMENT(525);
+ N_STATEMENT(526);
+ N_STATEMENT(527);
+ N_STATEMENT(528);
+ N_STATEMENT(529);
+ N_STATEMENT(530);
+ N_STATEMENT(531);
+ N_STATEMENT(532);
+ N_STATEMENT(533);
+ N_STATEMENT(534);
+ N_STATEMENT(535);
+ N_STATEMENT(536);
+ N_STATEMENT(537);
+ N_STATEMENT(538);
+ N_STATEMENT(539);
+ N_STATEMENT(540);
+ N_STATEMENT(541);
+ N_STATEMENT(542);
+ N_STATEMENT(543);
+ N_STATEMENT(544);
+ N_STATEMENT(545);
+ N_STATEMENT(546);
+ N_STATEMENT(547);
+ N_STATEMENT(548);
+ N_STATEMENT(549);
+ N_STATEMENT(550);
+ N_STATEMENT(551);
+ N_STATEMENT(552);
+ N_STATEMENT(553);
+ N_STATEMENT(554);
+ N_STATEMENT(555);
+ N_STATEMENT(556);
+ N_STATEMENT(557);
+ N_STATEMENT(558);
+ N_STATEMENT(559);
+ N_STATEMENT(560);
+ N_STATEMENT(561);
+ N_STATEMENT(562);
+ N_STATEMENT(563);
+ N_STATEMENT(564);
+ N_STATEMENT(565);
+ N_STATEMENT(566);
+ N_STATEMENT(567);
+ N_STATEMENT(568);
+ N_STATEMENT(569);
+ N_STATEMENT(570);
+ N_STATEMENT(571);
+ N_STATEMENT(572);
+ N_STATEMENT(573);
+ N_STATEMENT(574);
+ N_STATEMENT(575);
+ N_STATEMENT(576);
+ N_STATEMENT(577);
+ N_STATEMENT(578);
+ N_STATEMENT(579);
+ N_STATEMENT(580);
+ N_STATEMENT(581);
+ N_STATEMENT(582);
+ N_STATEMENT(583);
+ N_STATEMENT(584);
+ N_STATEMENT(585);
+ N_STATEMENT(586);
+ N_STATEMENT(587);
+ N_STATEMENT(588);
+ N_STATEMENT(589);
+ N_STATEMENT(590);
+ N_STATEMENT(591);
+ N_STATEMENT(592);
+ N_STATEMENT(593);
+ N_STATEMENT(594);
+ N_STATEMENT(595);
+ N_STATEMENT(596);
+ N_STATEMENT(597);
+ N_STATEMENT(598);
+ N_STATEMENT(599);
+ N_STATEMENT(600);
+ N_STATEMENT(601);
+ N_STATEMENT(602);
+ N_STATEMENT(603);
+ N_STATEMENT(604);
+ N_STATEMENT(605);
+ N_STATEMENT(606);
+ N_STATEMENT(607);
+ N_STATEMENT(608);
+ N_STATEMENT(609);
+ N_STATEMENT(610);
+ N_STATEMENT(611);
+ N_STATEMENT(612);
+ N_STATEMENT(613);
+ N_STATEMENT(614);
+ N_STATEMENT(615);
+ N_STATEMENT(616);
+ N_STATEMENT(617);
+ N_STATEMENT(618);
+ N_STATEMENT(619);
+ N_STATEMENT(620);
+ N_STATEMENT(621);
+ N_STATEMENT(622);
+ N_STATEMENT(623);
+ N_STATEMENT(624);
+ N_STATEMENT(625);
+ N_STATEMENT(626);
+ N_STATEMENT(627);
+ N_STATEMENT(628);
+ N_STATEMENT(629);
+ N_STATEMENT(630);
+ N_STATEMENT(631);
+ N_STATEMENT(632);
+ N_STATEMENT(633);
+ N_STATEMENT(634);
+ N_STATEMENT(635);
+ N_STATEMENT(636);
+ N_STATEMENT(637);
+ N_STATEMENT(638);
+ N_STATEMENT(639);
+ N_STATEMENT(640);
+ N_STATEMENT(641);
+ N_STATEMENT(642);
+ N_STATEMENT(643);
+ N_STATEMENT(644);
+ N_STATEMENT(645);
+ N_STATEMENT(646);
+ N_STATEMENT(647);
+ N_STATEMENT(648);
+ N_STATEMENT(649);
+ N_STATEMENT(650);
+ N_STATEMENT(651);
+ N_STATEMENT(652);
+ N_STATEMENT(653);
+ N_STATEMENT(654);
+ N_STATEMENT(655);
+ N_STATEMENT(656);
+ N_STATEMENT(657);
+ N_STATEMENT(658);
+ N_STATEMENT(659);
+ N_STATEMENT(660);
+ N_STATEMENT(661);
+ N_STATEMENT(662);
+ N_STATEMENT(663);
+ N_STATEMENT(664);
+ N_STATEMENT(665);
+ N_STATEMENT(666);
+ N_STATEMENT(667);
+ N_STATEMENT(668);
+ N_STATEMENT(669);
+ N_STATEMENT(670);
+ N_STATEMENT(671);
+ N_STATEMENT(672);
+ N_STATEMENT(673);
+ N_STATEMENT(674);
+ N_STATEMENT(675);
+ N_STATEMENT(676);
+ N_STATEMENT(677);
+ N_STATEMENT(678);
+ N_STATEMENT(679);
+ N_STATEMENT(680);
+ N_STATEMENT(681);
+ N_STATEMENT(682);
+ N_STATEMENT(683);
+ N_STATEMENT(684);
+ N_STATEMENT(685);
+ N_STATEMENT(686);
+ N_STATEMENT(687);
+ N_STATEMENT(688);
+ N_STATEMENT(689);
+ N_STATEMENT(690);
+ N_STATEMENT(691);
+ N_STATEMENT(692);
+ N_STATEMENT(693);
+ N_STATEMENT(694);
+ N_STATEMENT(695);
+ N_STATEMENT(696);
+ N_STATEMENT(697);
+ N_STATEMENT(698);
+ N_STATEMENT(699);
+ N_STATEMENT(700);
+ N_STATEMENT(701);
+ N_STATEMENT(702);
+ N_STATEMENT(703);
+ N_STATEMENT(704);
+ N_STATEMENT(705);
+ N_STATEMENT(706);
+ N_STATEMENT(707);
+ N_STATEMENT(708);
+ N_STATEMENT(709);
+ N_STATEMENT(710);
+ N_STATEMENT(711);
+ N_STATEMENT(712);
+ N_STATEMENT(713);
+ N_STATEMENT(714);
+ N_STATEMENT(715);
+ N_STATEMENT(716);
+ N_STATEMENT(717);
+ N_STATEMENT(718);
+ N_STATEMENT(719);
+ N_STATEMENT(720);
+ N_STATEMENT(721);
+ N_STATEMENT(722);
+ N_STATEMENT(723);
+ N_STATEMENT(724);
+ N_STATEMENT(725);
+ N_STATEMENT(726);
+ N_STATEMENT(727);
+ N_STATEMENT(728);
+ N_STATEMENT(729);
+ N_STATEMENT(730);
+ N_STATEMENT(731);
+ N_STATEMENT(732);
+ N_STATEMENT(733);
+ N_STATEMENT(734);
+ N_STATEMENT(735);
+ N_STATEMENT(736);
+ N_STATEMENT(737);
+ N_STATEMENT(738);
+ N_STATEMENT(739);
+ N_STATEMENT(740);
+ N_STATEMENT(741);
+ N_STATEMENT(742);
+ N_STATEMENT(743);
+ N_STATEMENT(744);
+ N_STATEMENT(745);
+ N_STATEMENT(746);
+ N_STATEMENT(747);
+ N_STATEMENT(748);
+ N_STATEMENT(749);
+ N_STATEMENT(750);
+ N_STATEMENT(751);
+ N_STATEMENT(752);
+ N_STATEMENT(753);
+ N_STATEMENT(754);
+ N_STATEMENT(755);
+ N_STATEMENT(756);
+ N_STATEMENT(757);
+ N_STATEMENT(758);
+ N_STATEMENT(759);
+ N_STATEMENT(760);
+ N_STATEMENT(761);
+ N_STATEMENT(762);
+ N_STATEMENT(763);
+ N_STATEMENT(764);
+ N_STATEMENT(765);
+ N_STATEMENT(766);
+ N_STATEMENT(767);
+ N_STATEMENT(768);
+ N_STATEMENT(769);
+ N_STATEMENT(770);
+ N_STATEMENT(771);
+ N_STATEMENT(772);
+ N_STATEMENT(773);
+ N_STATEMENT(774);
+ N_STATEMENT(775);
+ N_STATEMENT(776);
+ N_STATEMENT(777);
+ N_STATEMENT(778);
+ N_STATEMENT(779);
+ N_STATEMENT(780);
+ N_STATEMENT(781);
+ N_STATEMENT(782);
+ N_STATEMENT(783);
+ N_STATEMENT(784);
+ N_STATEMENT(785);
+ N_STATEMENT(786);
+ N_STATEMENT(787);
+ N_STATEMENT(788);
+ N_STATEMENT(789);
+ N_STATEMENT(790);
+ N_STATEMENT(791);
+ N_STATEMENT(792);
+ N_STATEMENT(793);
+ N_STATEMENT(794);
+ N_STATEMENT(795);
+ N_STATEMENT(796);
+ N_STATEMENT(797);
+ N_STATEMENT(798);
+ N_STATEMENT(799);
+ N_STATEMENT(800);
+ N_STATEMENT(801);
+ N_STATEMENT(802);
+ N_STATEMENT(803);
+ N_STATEMENT(804);
+ N_STATEMENT(805);
+ N_STATEMENT(806);
+ N_STATEMENT(807);
+ N_STATEMENT(808);
+ N_STATEMENT(809);
+ N_STATEMENT(810);
+ N_STATEMENT(811);
+ N_STATEMENT(812);
+ N_STATEMENT(813);
+ N_STATEMENT(814);
+ N_STATEMENT(815);
+ N_STATEMENT(816);
+ N_STATEMENT(817);
+ N_STATEMENT(818);
+ N_STATEMENT(819);
+ N_STATEMENT(820);
+ N_STATEMENT(821);
+ N_STATEMENT(822);
+ N_STATEMENT(823);
+ N_STATEMENT(824);
+ N_STATEMENT(825);
+ N_STATEMENT(826);
+ N_STATEMENT(827);
+ N_STATEMENT(828);
+ N_STATEMENT(829);
+ N_STATEMENT(830);
+ N_STATEMENT(831);
+ N_STATEMENT(832);
+ N_STATEMENT(833);
+ N_STATEMENT(834);
+ N_STATEMENT(835);
+ N_STATEMENT(836);
+ N_STATEMENT(837);
+ N_STATEMENT(838);
+ N_STATEMENT(839);
+ N_STATEMENT(840);
+ N_STATEMENT(841);
+ N_STATEMENT(842);
+ N_STATEMENT(843);
+ N_STATEMENT(844);
+ N_STATEMENT(845);
+ N_STATEMENT(846);
+ N_STATEMENT(847);
+ N_STATEMENT(848);
+ N_STATEMENT(849);
+ N_STATEMENT(850);
+ N_STATEMENT(851);
+ N_STATEMENT(852);
+ N_STATEMENT(853);
+ N_STATEMENT(854);
+ N_STATEMENT(855);
+ N_STATEMENT(856);
+ N_STATEMENT(857);
+ N_STATEMENT(858);
+ N_STATEMENT(859);
+ N_STATEMENT(860);
+ N_STATEMENT(861);
+ N_STATEMENT(862);
+ N_STATEMENT(863);
+ N_STATEMENT(864);
+ N_STATEMENT(865);
+ N_STATEMENT(866);
+ N_STATEMENT(867);
+ N_STATEMENT(868);
+ N_STATEMENT(869);
+ N_STATEMENT(870);
+ N_STATEMENT(871);
+ N_STATEMENT(872);
+ N_STATEMENT(873);
+ N_STATEMENT(874);
+ N_STATEMENT(875);
+ N_STATEMENT(876);
+ N_STATEMENT(877);
+ N_STATEMENT(878);
+ N_STATEMENT(879);
+ N_STATEMENT(880);
+ N_STATEMENT(881);
+ N_STATEMENT(882);
+ N_STATEMENT(883);
+ N_STATEMENT(884);
+ N_STATEMENT(885);
+ N_STATEMENT(886);
+ N_STATEMENT(887);
+ N_STATEMENT(888);
+ N_STATEMENT(889);
+ N_STATEMENT(890);
+ N_STATEMENT(891);
+ N_STATEMENT(892);
+ N_STATEMENT(893);
+ N_STATEMENT(894);
+ N_STATEMENT(895);
+ N_STATEMENT(896);
+ N_STATEMENT(897);
+ N_STATEMENT(898);
+ N_STATEMENT(899);
+ N_STATEMENT(900);
+ N_STATEMENT(901);
+ N_STATEMENT(902);
+ N_STATEMENT(903);
+ N_STATEMENT(904);
+ N_STATEMENT(905);
+ N_STATEMENT(906);
+ N_STATEMENT(907);
+ N_STATEMENT(908);
+ N_STATEMENT(909);
+ N_STATEMENT(910);
+ N_STATEMENT(911);
+ N_STATEMENT(912);
+ N_STATEMENT(913);
+ N_STATEMENT(914);
+ N_STATEMENT(915);
+ N_STATEMENT(916);
+ N_STATEMENT(917);
+ N_STATEMENT(918);
+ N_STATEMENT(919);
+ N_STATEMENT(920);
+ N_STATEMENT(921);
+ N_STATEMENT(922);
+ N_STATEMENT(923);
+ N_STATEMENT(924);
+ N_STATEMENT(925);
+ N_STATEMENT(926);
+ N_STATEMENT(927);
+ N_STATEMENT(928);
+ N_STATEMENT(929);
+ N_STATEMENT(930);
+ N_STATEMENT(931);
+ N_STATEMENT(932);
+ N_STATEMENT(933);
+ N_STATEMENT(934);
+ N_STATEMENT(935);
+ N_STATEMENT(936);
+ N_STATEMENT(937);
+ N_STATEMENT(938);
+ N_STATEMENT(939);
+ N_STATEMENT(940);
+ N_STATEMENT(941);
+ N_STATEMENT(942);
+ N_STATEMENT(943);
+ N_STATEMENT(944);
+ N_STATEMENT(945);
+ N_STATEMENT(946);
+ N_STATEMENT(947);
+ N_STATEMENT(948);
+ N_STATEMENT(949);
+ N_STATEMENT(950);
+ }
+ return am_error; /* NOTREACHED, shut up the compiler */
+}
+
+#endif /* HAVE_USE_DTRACE */
diff --git a/erts/emulator/beam/erl_nif.h b/erts/emulator/beam/erl_nif.h
index e5d99dc4f1..93e56332e1 100644
--- a/erts/emulator/beam/erl_nif.h
+++ b/erts/emulator/beam/erl_nif.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2009-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2009-2012. All Rights Reserved.
*
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
@@ -187,11 +187,7 @@ extern TWinDynNifCallbacks WinDynNifCallbacks;
#else
# define ERL_NIF_INIT_GLOB
# define ERL_NIF_INIT_BODY
-# if defined(VXWORKS)
-# define ERL_NIF_INIT_DECL(MODNAME) ErlNifEntry* MODNAME ## _init(void)
-# else
-# define ERL_NIF_INIT_DECL(MODNAME) ErlNifEntry* nif_init(void)
-# endif
+# define ERL_NIF_INIT_DECL(MODNAME) ErlNifEntry* nif_init(void)
#endif
@@ -226,6 +222,15 @@ ERL_NIF_INIT_DECL(NAME) \
} \
ERL_NIF_INIT_EPILOGUE
+#if defined(USE_DYNAMIC_TRACE) && (defined(USE_DTRACE) || defined(USE_SYSTEMTAP))
+#define HAVE_USE_DTRACE 1
+#endif
+
+#ifdef HAVE_USE_DTRACE
+ERL_NIF_TERM erl_nif_user_trace_s1(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM erl_nif_user_trace_i4s4(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM erl_nif_user_trace_n(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+#endif
#endif /* __ERL_NIF_H__ */
diff --git a/erts/emulator/beam/erl_nmgc.c b/erts/emulator/beam/erl_nmgc.c
deleted file mode 100644
index 2a8c819360..0000000000
--- a/erts/emulator/beam/erl_nmgc.c
+++ /dev/null
@@ -1,1401 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-#include "global.h"
-#include "erl_gc.h"
-#include "erl_binary.h"
-#include "erl_nmgc.h"
-#include "erl_debug.h"
-#if HIPE
-#include "hipe_stack.h"
-#endif
-
-
-#ifdef INCREMENTAL
-/***************************************************************************
- * *
- * Incremental Garbage Collector for the Message Area *
- * *
- ***************************************************************************/
-
-/*
- * The heap pointers are declared in erl_init.c
- * global_heap is the nursery
- * global_old_heap is the old generation
- */
-unsigned char *blackmap = NULL;
-INC_Page *inc_used_mem = NULL;
-INC_MemBlock *inc_free_list = NULL;
-Eterm *inc_fromspc;
-Eterm *inc_fromend;
-Eterm *inc_nursery_scn_ptr;
-Eterm **fwdptrs;
-Eterm *inc_alloc_limit;
-Process *inc_active_proc;
-Process *inc_active_last;
-int inc_words_to_go;
-
-static Eterm *inc_last_nursery;
-static int inc_pages = INC_NoPAGES;
-static INC_Page *inc_bibop = NULL;
-static int inc_used_pages;
-
-/* Used when growing the old generation */
-/*
-#define INC_ROOTSAVE 16384
-static Eterm *root_save[INC_ROOTSAVE];
-static int roots_saved = 0;
-*/
-
-INC_STORAGE_DECLARATION(,gray);
-
-static void inc_minor_gc(Process *p, int need, Eterm* objv, int nobj);
-static void inc_major_gc(Process *p, int need, Eterm* objv, int nobj);
-
-#ifdef INC_TIME_BASED
-#if USE_PERFCTR
-
-/*
- * This uses the Linux perfctr extension to virtualise the
- * time-stamp counter.
- */
-#include "libperfctr.h"
-static struct vperfctr *vperfctr;
-static double cpu_khz;
-static double tsc_to_cpu_mult;
-
-static void inc_start_hrvtime(void)
-{
- struct perfctr_info info;
- struct vperfctr_control control;
-
- if( vperfctr != NULL )
- return;
- vperfctr = vperfctr_open();
- if( vperfctr == NULL )
- return;
- if( vperfctr_info(vperfctr, &info) >= 0 ) {
- cpu_khz = (double)info.cpu_khz;
- tsc_to_cpu_mult = (double)(info.tsc_to_cpu_mult ? : 1);
- if( info.cpu_features & PERFCTR_FEATURE_RDTSC ) {
- memset(&control, 0, sizeof control);
- control.cpu_control.tsc_on = 1;
- if( vperfctr_control(vperfctr, &control) >= 0 )
- return;
- }
- }
- vperfctr_close(vperfctr);
- vperfctr = NULL;
-}
-
-#define inc_get_hrvtime() (((double)vperfctr_read_tsc(vperfctr) * tsc_to_cpu_mult) / cpu_khz)
-
-#endif /* USE_PERFCTR */
-#endif /* INC_TIME_BASED */
-
-#ifdef INC_TIME_BASED
-# define timeslice 1 /* milli seconds */
-# define WORK_MORE (inc_get_hrvtime() < start_time + timeslice)
-#else
-//# define inc_min_work 100 /* words */
-# define inc_min_work global_heap_sz + inc_pages * INC_FULLPAGE /* words */
-# define WORK_MORE (inc_words_to_go > 0)
-#endif
-
-void erts_init_incgc(void)
-{
- int i;
- int size = inc_pages * INC_FULLPAGE;
-
- /* Young generation */
- global_heap = (Eterm *)erts_alloc(ERTS_ALC_T_MESSAGE_AREA,
- sizeof(Eterm) * global_heap_sz);
- global_hend = global_heap + global_heap_sz;
- global_htop = global_heap;
- inc_alloc_limit = global_hend;
-
- /* Fromspace */
- inc_last_nursery = (Eterm *) erts_alloc(ERTS_ALC_T_MESSAGE_AREA,
- global_heap_sz * sizeof(Eterm));
- inc_fromspc = inc_fromend = NULL;
-
- /* Forward-pointers */
- fwdptrs = erts_alloc(ERTS_ALC_T_MESSAGE_AREA,
- global_heap_sz * sizeof(Eterm*));
- /* Old generation */
- global_old_heap = (Eterm *)erts_alloc(ERTS_ALC_T_MESSAGE_AREA,
- size * sizeof(Eterm));
- global_old_hend = global_old_heap + size;
-
- /* Pages i BiBOP */
- for (i = 0; i < inc_pages; i++)
- {
- INC_Page *this = (INC_Page*)(global_old_heap + i * INC_FULLPAGE);
- this->next = (INC_Page*)((Eterm*)this + INC_FULLPAGE);
- }
-
- inc_bibop = (INC_Page*)global_old_heap;
- ((INC_Page*)(global_old_heap + (inc_pages - 1) * INC_FULLPAGE))->next =
- NULL;
-
- inc_used_mem = inc_bibop;
- inc_bibop = inc_bibop->next;
- inc_used_mem->next = NULL;
- inc_used_pages = 1;
-
- /* Free-list */
- inc_free_list = (INC_MemBlock*)inc_used_mem->start;
- inc_free_list->size = INC_PAGESIZE;
- inc_free_list->prev = NULL;
- inc_free_list->next = NULL;
-
- /* Blackmap */
- blackmap = (unsigned char*)erts_alloc(ERTS_ALC_T_MESSAGE_AREA,
- INC_FULLPAGE * inc_pages);
- /* Gray stack */
- INC_STORAGE_INIT(gray);
-
- inc_active_proc = NULL;
- inc_active_last = NULL;
-
-#ifdef INC_TIME_BASED
- inc_start_hrvtime();
-#endif
-}
-
-void erts_cleanup_incgc(void)
-{
- INC_STORAGE_ERASE(gray);
-
- if (inc_fromspc)
- inc_last_nursery = inc_fromspc;
-
- erts_free(ERTS_ALC_T_MESSAGE_AREA,(void*)global_heap);
- erts_free(ERTS_ALC_T_MESSAGE_AREA,(void*)inc_last_nursery);
- erts_free(ERTS_ALC_T_MESSAGE_AREA,(void*)global_old_heap);
- erts_free(ERTS_ALC_T_MESSAGE_AREA,(void*)blackmap);
- erts_free(ERTS_ALC_T_MESSAGE_AREA,(void*)fwdptrs);
-}
-
-void erts_incremental_gc(Process* p, int need, Eterm* objv, int nobj)
-{
- int repeat_minor;
-#ifdef INC_TIME_BASED
- double start_time = inc_get_hrvtime();
- int work_left_before = inc_words_to_go;
-#endif
- /* Used when growing the fromspace */
- static char inc_growing_nurs = 0;
-
- BM_STOP_TIMER(system);
- //BM_MMU_READ();
- BM_RESET_TIMER(gc);
- BM_START_TIMER(gc);
-
- VERBOSE(DEBUG_HYBRID_GC,
- ("INCGC: Incremental GC START Caused by: %T Need: %d\n",
- p->id,need));
-
- ma_gc_flags |= GC_GLOBAL;
- ma_gc_flags &= ~GC_CYCLE_START;
-
-#ifndef INC_TIME_BASED
- /* Decide how much work to do this GC stage. The work is meassured
- * in number of words copied from the young generation to the old
- * plus number of work marked in the old generation.
- */
- if (ma_gc_flags & GC_MAJOR) {
- int wm = (need > inc_min_work) ? need : inc_min_work;
- inc_words_to_go = (int)((wm * (((inc_used_pages * INC_PAGESIZE) /
- (double)global_heap_sz) + 1)) + 0.5);
- }
- else
- inc_words_to_go = (need > inc_min_work) ? need : inc_min_work;
-#endif
-
- do {
- if (ma_gc_flags & GC_MAJOR) {
- /* This is a major collection cycle. */
- inc_major_gc(p,need,objv,nobj);
- } else if (ma_gc_flags & GC_CYCLE) {
- /* This is a minor collection cycle. */
- inc_minor_gc(p,need,objv,nobj);
- } else {
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Collection cycle START\n"));
- ma_gc_flags |= (GC_CYCLE | GC_CYCLE_START);
- inc_fromspc = global_heap;
- inc_fromend = global_htop;
- global_heap = global_htop = inc_last_nursery;
- global_hend = global_heap + global_heap_sz;
- inc_nursery_scn_ptr = global_heap;
-#ifdef INC_TIME_BASED
- work_left_before = inc_words_to_go = global_heap_sz;
-#endif
-#ifdef DEBUG
- inc_last_nursery = NULL;
-#endif
- memset(fwdptrs,0,global_heap_sz * sizeof(Eterm));
-
- {
- /* TODO: Alla processer ska v�l egentligen inte aktiveras h�r... */
- int i;
- for (i = 0; i < erts_num_active_procs; i++) {
- Process *cp = erts_active_procs[i];
- INC_ACTIVATE(cp);
- cp->scan_top = cp->high_water;
- }
- }
-
- if (ma_gc_flags & GC_NEED_MAJOR) {
- /* The previous collection cycle caused the old generation to
- * overflow. This collection cycle will therefore be a major
- * one.
- */
- BM_COUNT(major_gc_cycles);
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: MAJOR cycle\n"));
- inc_major_gc(p,need,objv,nobj);
- } else {
- BM_COUNT(minor_gc_cycles);
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: MINOR cycle\n"));
- inc_minor_gc(p,need,objv,nobj);
- }
- }
-
- repeat_minor = 0;
- if (!(ma_gc_flags & GC_CYCLE)) {
- inc_alloc_limit = global_hend;
- inc_last_nursery = inc_fromspc;
- inc_fromspc = inc_fromend = NULL;
- ASSERT(INC_STORAGE_EMPTY(gray));
-
- if (inc_growing_nurs) {
- /*
- * The previous collection cycle caused the nursery to
- * grow, now we have to grow the from-space as well.
- */
- inc_last_nursery =
- (Eterm*) erts_realloc(ERTS_ALC_T_MESSAGE_AREA,
- (void*)inc_last_nursery,
- sizeof(Eterm) * global_heap_sz);
- inc_growing_nurs = 0;
- }
-
- if (global_hend - global_htop <= need) {
- /*
- * Initiate a new GC cycle immediately and, if necessary,
- * enlarge the nursery.
- */
- if (global_heap_sz <= need) {
- VERBOSE(DEBUG_HYBRID_GC,
- ("INCGC: Allocating a larger nursery\n"));
- global_heap_sz = erts_next_heap_size(need * 1.5,0);
- inc_last_nursery =
- (Eterm*) erts_realloc(ERTS_ALC_T_MESSAGE_AREA,
- (void*)inc_last_nursery,
- sizeof(Eterm) * global_heap_sz);
- fwdptrs = erts_realloc(ERTS_ALC_T_MESSAGE_AREA,fwdptrs,
- global_heap_sz * sizeof(Eterm*));
- inc_growing_nurs = 1;
- }
- repeat_minor = 1;
- }
-
-#ifdef DEBUG
- /* Fill the from-space with bad things */
- memset(inc_last_nursery,DEBUG_BAD_BYTE,
- global_heap_sz * sizeof(Eterm));
-#endif
- }
- } while (repeat_minor);
-
-
- /* Clean up after garbage collection ********************************/
-
- if (inc_alloc_limit != global_hend) {
-
-#ifdef INC_TIME_BASED
- if ((work_left_before - inc_words_to_go) == 0) {
- inc_alloc_limit = global_htop + need;
- } else {
- inc_alloc_limit = (global_hend - global_htop) /
- (inc_words_to_go / (work_left_before - inc_words_to_go)) +
- global_htop;
- if (inc_alloc_limit > global_hend)
- inc_alloc_limit = global_hend;
- }
-#else
- inc_alloc_limit = (Eterm*)(global_htop + (need > inc_min_work) ?
- need : inc_min_work);
- if (inc_alloc_limit > global_hend)
- inc_alloc_limit = global_hend;
-#endif
- }
-
- ma_gc_flags &= ~GC_GLOBAL;
-
- /* INC_TIME_BASED: If this fails we have to increase the timeslice! */
- ASSERT(inc_alloc_limit - global_htop > need);
-
- BM_STOP_TIMER(gc);
-#ifdef BM_TIMERS
- minor_global_gc_time += gc_time;
- if (gc_time > max_global_minor_time)
- max_global_minor_time = gc_time;
-
- pause_times[(((gc_time * 1000) < MAX_PAUSE_TIME) ?
- (int)(gc_time * 1000) :
- MAX_PAUSE_TIME - 1)]++;
-#endif
- //BM_MMU_INIT();
- { static long long verif = 0;
- //erts_printf("innan verify: %d\n",++verif);
- if (verif==168) print_memory(NULL);
- verify_everything();
- //erts_printf("efter verify: %d\n",verif);
- }
- BM_START_TIMER(system);
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Incremental GC END\n"));
-}
-
-
-/***************************************************************************
- * *
- * Minor collection - Copy live data from young generation to old *
- * *
- ***************************************************************************/
-
-#define MINOR_SCAN(PTR,END) do { \
- ASSERT(PTR <= END); \
- while (WORK_MORE && PTR < END) { \
- Eterm val = *PTR; \
- Eterm *obj_ptr = ptr_val(val); \
- switch (primary_tag(val)) { \
- case TAG_PRIMARY_LIST: \
- if (ptr_within(obj_ptr,inc_fromspc,inc_fromend)) { \
- if (INC_IS_FORWARDED(obj_ptr)) { \
- *PTR = make_list(INC_FORWARD_VALUE(obj_ptr)); \
- } \
- else { \
- Eterm *hp = erts_inc_alloc(2); \
- INC_STORE(gray,hp,2); \
- INC_COPY_CONS(obj_ptr,hp,PTR); \
- } \
- } \
- break; \
- case TAG_PRIMARY_BOXED: \
- if (ptr_within(obj_ptr,inc_fromspc,inc_fromend)) { \
- if (INC_IS_FORWARDED(obj_ptr)) { \
- *PTR = make_boxed(INC_FORWARD_VALUE(obj_ptr)); \
- } \
- else { \
- Eterm *hp = erts_inc_alloc(BOXED_NEED(obj_ptr,*obj_ptr)); \
- INC_STORE(gray,hp,BOXED_NEED(obj_ptr,*obj_ptr)); \
- INC_COPY_BOXED(obj_ptr,hp,PTR); \
- } \
- } \
- break; \
- case TAG_PRIMARY_HEADER: \
- switch (val & _TAG_HEADER_MASK) { \
- case ARITYVAL_SUBTAG: break; \
- default: PTR += thing_arityval(val); break; \
- } \
- break; \
- } \
- PTR++; \
- } \
-} while(0)
-
-
-/* Returns: TRUE (1) if the need is greater than the available space
- * and the garbage collector needs to be restarted immediately. FALSE
- * (0) otherwise.
- */
-static void inc_minor_gc(Process* p, int need, Eterm* objv, int nobj)
-{
- BM_COUNT(minor_gc_stages);
-
- /* Start with looking at gray objects found in earlier collection
- * stages.
- */
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Rescue gray found from nursery\n"));
- {
- INC_Object *obj = NULL;
- Eterm *ptr;
-
- while (WORK_MORE && !INC_STORAGE_EMPTY(gray)) {
- obj = INC_STORAGE_GET(gray);
- if ((*obj->this & _TAG_HEADER_MASK) == FUN_SUBTAG) {
- ptr = obj->this + thing_arityval(*obj->this) + 1;
- } else {
- ptr = obj->this;
- }
- MINOR_SCAN(ptr,obj->this + obj->size);
- }
- /* TODO: Se f�reg�ende uppdatering av gr� objekt */
- if (!WORK_MORE && obj != NULL)
- INC_STORE(gray,obj->this,obj->size);
- }
-
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Scan root-set\n"));
- while (WORK_MORE && inc_active_proc) {
- Rootset rootset;
- Process *cp = inc_active_proc;
-
- ASSERT(INC_IS_ACTIVE(cp));
-
- /* TODO: Hur dyrt �r det att bygga nytt rootset varje g�ng? */
-
- /* TODO: Fundera p� ordningen! Rootset, Heap, Old heap... */
-
- /* TODO: Scanna stacken fr�n p->send till p->stop! [Brooks84] */
- /* Notera: Vi GC:ar inte de yngsta objekten - de som allokeras
- under GC-cykeln. Detta ger ynglingarna en chans att d� innan
- GC:n b�rjar kopiera dem. [StefanovicMcKinleyMoss@OOPSLA99] */
-
- /* TODO: N�r rootset �r scannat borde processen inte vara
- aktiv mer. Den b�r aktiveras i schedule, endast om en
- process har k�rt beh�ver vi scanna rootset igen. */
-
- /* MT: In a multithreaded system the process cp needs to be
- * locked here.
- */
-
- if (cp == p)
- rootset.n = setup_rootset(cp, objv, nobj, &rootset);
- else
- rootset.n = setup_rootset(cp, cp->arg_reg, cp->arity, &rootset);
-
- //MA_GENSWEEP_NSTACK(cp, old_htop, n_htop, objv, nobj);
-
- while (WORK_MORE && rootset.n--) {
- Eterm *g_ptr = rootset.v[rootset.n];
- Uint g_sz = rootset.sz[rootset.n];
-
- while (WORK_MORE && g_sz--) {
- Eterm gval = *g_ptr;
- switch (primary_tag(gval)) {
- case TAG_PRIMARY_LIST: {
- Eterm *ptr = list_val(gval);
- if (ptr_within(ptr,inc_fromspc,inc_fromend)) {
- if (INC_IS_FORWARDED(ptr)) {
- *g_ptr++ = make_list(INC_FORWARD_VALUE(ptr));
- }
- else {
- Eterm *hp = erts_inc_alloc(2);
- INC_STORE(gray,hp,2);
- INC_COPY_CONS(ptr,hp,g_ptr++);
- }
- }
- else
- ++g_ptr;
- continue;
- }
-
- case TAG_PRIMARY_BOXED: {
- Eterm *ptr = boxed_val(gval);
- if (ptr_within(ptr,inc_fromspc,inc_fromend)) {
- if (INC_IS_FORWARDED(ptr)) {
- *g_ptr++ = make_boxed(INC_FORWARD_VALUE(ptr));
- }
- else {
- Eterm *hp = erts_inc_alloc(BOXED_NEED(ptr,*ptr));
- INC_STORE(gray,hp,BOXED_NEED(ptr,*ptr));
- INC_COPY_BOXED(ptr,hp,g_ptr++);
- }
- }
- else
- ++g_ptr;
- continue;
- }
-
- default:
- g_ptr++;
- continue;
- }
- }
- }
-
- restore_one_rootset(cp, &rootset);
-
- /* MT: cp can be unlocked now. */
-
- /* VERBOSE(DEBUG_HYBRID_GC,("INCGC: Scan private nursery\n")); */
- if (cp->scan_top != HEAP_TOP(cp)) {
- Eterm *ptr = cp->scan_top;
- MINOR_SCAN(ptr,HEAP_TOP(cp));
- /* TODO: F�r att spara scan_top h�r m�ste alla ma-pekare
- * som hittas l�ggas till i cp->rrma.
- */
- //cp->scan_top = ptr;
- }
-
- /* VERBOSE(DEBUG_HYBRID_GC,("INCGC: Scan heap fragments\n")); */
- {
- ErlHeapFragment* bp = MBUF(cp);
-
- while (WORK_MORE && bp) {
- Eterm *ptr = bp->mem;
- if ((ARITH_HEAP(cp) >= bp->mem) &&
- (ARITH_HEAP(cp) < bp->mem + bp->size)) {
- MINOR_SCAN(ptr,ARITH_HEAP(cp));
- } else {
- MINOR_SCAN(ptr,bp->mem + bp->size);
- }
- bp = bp->next;
- }
- }
-
- /* VERBOSE(DEBUG_HYBRID_GC,("INCGC: Scan gray\n")); */
- {
- INC_Object *obj = NULL;
- Eterm *ptr;
- while (WORK_MORE && !INC_STORAGE_EMPTY(gray)) {
- obj = INC_STORAGE_GET(gray);
- if ((*obj->this & _TAG_HEADER_MASK) == FUN_SUBTAG) {
- ptr = obj->this + thing_arityval(*obj->this) + 1;
- } else {
- ptr = obj->this;
- }
- MINOR_SCAN(ptr,obj->this + obj->size);
- }
- /* TODO: INC_STORE(gray,ptr,obj->size-(ptr-obj->this)); Typ.. */
- if (!WORK_MORE && obj != NULL)
- INC_STORE(gray,obj->this,obj->size);
- }
-
- if (WORK_MORE) {
- //printf("Rootset after:\r\n");
- //print_one_rootset(&rootset);
- INC_DEACTIVATE(cp);
- }
- }
-
- /* Update new pointers in the nursery to new copies in old generation. */
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Update nursery\n"));
- {
- Eterm *ptr = inc_nursery_scn_ptr;
- MINOR_SCAN(ptr,global_htop);
- inc_nursery_scn_ptr = ptr;
- }
-
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Rescue gray found from nursery\n"));
- {
- INC_Object *obj = NULL;
- Eterm *ptr;
-
- while (WORK_MORE && !INC_STORAGE_EMPTY(gray)) {
- obj = INC_STORAGE_GET(gray);
- if ((*obj->this & _TAG_HEADER_MASK) == FUN_SUBTAG) {
- ptr = obj->this + thing_arityval(*obj->this) + 1;
- } else {
- ptr = obj->this;
- }
- MINOR_SCAN(ptr,obj->this + obj->size);
- }
- /* TODO: Se f�reg�ende uppdatering av gr� objekt */
- if (!WORK_MORE && obj != NULL)
- INC_STORE(gray,obj->this,obj->size);
- }
-
- /* Atomic phase */
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Update copy stack\n"));
- {
- Uint i;
- for (i = 0; i < ma_dst_top; i++) {
- if (ptr_within(ma_dst_stack[i],inc_fromspc,inc_fromend)) {
- if (INC_IS_FORWARDED(ma_dst_stack[i]))
- ma_dst_stack[i] = INC_FORWARD_VALUE(ma_dst_stack[i]);
- }
- }
- }
-
- if (WORK_MORE) {
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Update offheap-lists\n"));
- {
- ExternalThing **prev = &erts_global_offheap.externals;
- ExternalThing *ptr = erts_global_offheap.externals;
-
- /* Atomic phase */
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Sweep proc externals\n"));
- while (ptr) {
- Eterm *ppt = (Eterm*) ptr;
-
- if (ptr_within(ppt,global_old_heap,global_old_hend)) {
- prev = &ptr->next;
- ptr = ptr->next;
- } else if (ptr_within(ppt, inc_fromspc, inc_fromend) &&
- INC_IS_FORWARDED(ppt)) {
- ExternalThing *ro = (ExternalThing*)INC_FORWARD_VALUE(ppt);
- *prev = ro; /* Patch to moved pos */
- prev = &ro->next;
- ptr = ro->next;
- } else {
- erts_deref_node_entry(ptr->node);
- *prev = ptr = ptr->next;
- }
- }
- ASSERT(*prev == NULL);
- }
-
- {
- ProcBin **prev = &erts_global_offheap.mso;
- ProcBin *ptr = erts_global_offheap.mso;
-
- /* Atomic phase */
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Sweep proc bins\n"));
- while (ptr) {
- Eterm *ppt = (Eterm*)ptr;
-
- if (ptr_within(ppt,global_old_heap,global_old_hend)) {
- prev = &ptr->next;
- ptr = ptr->next;
- } else if (ptr_within(ppt, inc_fromspc, inc_fromend) &&
- INC_IS_FORWARDED(ppt)) {
- ProcBin *ro = (ProcBin*)INC_FORWARD_VALUE(ppt);
- *prev = ro; /* Patch to moved pos */
- prev = &ro->next;
- ptr = ro->next;
- } else {
- Binary *bptr;
- *prev = ptr->next;
- bptr = ptr->val;
- if (erts_refc_dectest(&bptr->refc, 0) == 0)
- erts_bin_free(bptr);
- ptr = *prev;
- }
- }
- ASSERT(*prev == NULL);
- }
-
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Minor collection cycle END\n"));
- ma_gc_flags &= ~GC_CYCLE;
- }
-}
-
-
-
-
-/***************************************************************************
- * *
- * Major collection - CopyMark - Copy young to old, Mark-Sweep old *
- * *
- ***************************************************************************/
-
-#define COPYMARK(PTR,END) do { \
- ASSERT(PTR <= END); \
- while (WORK_MORE && PTR < END) { \
- Eterm val = *PTR; \
- Eterm *obj_ptr = ptr_val(val); \
- switch (primary_tag(val)) { \
- case TAG_PRIMARY_LIST: \
- COPYMARK_CONS(obj_ptr,aging_htop,PTR,aging_end); break; \
- case TAG_PRIMARY_BOXED: \
- COPYMARK_BOXED(obj_ptr,aging_htop,PTR,aging_end); break; \
- case TAG_PRIMARY_HEADER: \
- switch (val & _TAG_HEADER_MASK) { \
- case ARITYVAL_SUBTAG: break; \
- default: \
- PTR += thing_arityval(val); \
- break; \
- } \
- break; \
- default: break; \
- } \
- PTR++; \
- } \
-} while(0);
-/* TODO:
- if (aging_htop + 10 > aging + INC_FULLPAGE) {
- aging->next = inc_used_mem;
- inc_used_mem = aging;
- }
-*/
-
-static void inc_major_gc(Process *p, int need, Eterm* objv, int nobj)
-{
- Eterm *free_start = NULL;
- Uint live = 0;
- Uint old_gen_sz = 0;
- static INC_Page *aging;
- static Eterm *aging_htop;
- static Eterm *aging_end;
- BM_NEW_TIMER(old_gc);
-
- BM_SWAP_TIMER(gc,old_gc);
- BM_COUNT(major_gc_stages);
-
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Major collection START\n"));
-
- ma_gc_flags |= GC_INCLUDE_ALL;
-
- if (ma_gc_flags & GC_NEED_MAJOR)
- {
- INC_Page *page = inc_used_mem;
-
- ma_gc_flags |= GC_MAJOR;
- ma_gc_flags &= ~GC_NEED_MAJOR;
-
- while (page)
- {
- memset(blackmap +
- ((void*)page - (void*)global_old_heap) / sizeof(void*),
- 0, INC_FULLPAGE);
- page = page->next;
- }
-
- if (inc_bibop) {
- aging = inc_bibop;
- inc_bibop = inc_bibop->next;
- aging->next = NULL;
- memset(blackmap +
- ((void*)aging - (void*)global_old_heap) / sizeof(void*),
- 1, INC_FULLPAGE);
- aging_htop = aging->start;
- aging_end = aging->start + INC_PAGESIZE;
- }
- else {
- /* There are no free pages.. Either fragmentation is a
- * problem or we are simply out of memory. Allocation in
- * the old generation will be done through the free-list
- * this GC cycle.
- */
- aging = NULL;
- aging_htop = aging_end = NULL;
- }
- }
-
- /* Start with looking at gray objects found in earlier collection
- * stages.
- */
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Copy-Mark gray\n"));
- {
- INC_Object *obj = NULL;
-
- while (WORK_MORE && !INC_STORAGE_EMPTY(gray)) {
- Eterm *ptr;
-
- obj = INC_STORAGE_GET(gray);
- if ((*obj->this & _TAG_HEADER_MASK) == FUN_SUBTAG) {
- ptr = obj->this + thing_arityval(*obj->this) + 1;
- } else {
- ptr = obj->this;
- }
- COPYMARK(ptr,obj->this + obj->size);
- }
- /* TODO: Titta p� motsvarande i minor. */
- if (!WORK_MORE && obj != NULL)
- INC_STORE(gray,obj->this,obj->size);
- }
-
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Copy-Mark roots\n"));
- while (WORK_MORE && inc_active_proc)
- {
- /* For each process: Scan all areas containing pointers to the
- * message area. When a process is done here, all it's
- * message-pointers should be to the old generation.
- */
- Rootset rootset;
- Process *cp = inc_active_proc;
-
- ASSERT(INC_IS_ACTIVE(cp));
-
- /* MT: In a multithreaded system the process cp needs to be
- * locked here.
- */
- if (cp == p)
- rootset.n = setup_rootset(cp, objv, nobj, &rootset);
- else
- rootset.n = setup_rootset(cp, cp->arg_reg, cp->arity, &rootset);
-
- while (WORK_MORE && rootset.n--)
- {
- Eterm *ptr = rootset.v[rootset.n];
- Eterm *end = ptr + rootset.sz[rootset.n];
-
- while (WORK_MORE && ptr < end) {
- Eterm val = *ptr;
- Eterm *obj_ptr = ptr_val(val);
-
- switch (primary_tag(val)) {
- case TAG_PRIMARY_LIST:
- {
- COPYMARK_CONS(obj_ptr,aging_htop,ptr,aging_end);
- break;
- }
-
- case TAG_PRIMARY_BOXED:
- {
- COPYMARK_BOXED(obj_ptr,aging_htop,ptr,aging_end);
- break;
- }
- }
- ptr++;
- }
- }
-
-#ifdef HIPE
- /* Atomic phase */
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Native stack scan: %T\n",cp->id));
- aging_htop = ma_fullsweep_nstack(cp,aging_htop,aging_end);
-#endif
- restore_one_rootset(cp, &rootset);
-
- /* MT: cp can be unlocked now. But beware!! The message queue
- * might be updated with new pointers to the fromspace while
- * we work below. The send operation can not assume that all
- * active processes will look through their message queue
- * before deactivating as is the case in non-MT incremental
- * collection.
- */
-
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Copy-Mark process heap\n"));
- {
- Eterm *ptr = cp->scan_top;
- COPYMARK(ptr,cp->htop);
- //cp->scan_top = ptr;
- }
-
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Copy-Mark heap fragments\n"));
- {
- ErlHeapFragment* bp = MBUF(cp);
-
- while (WORK_MORE && bp) {
- Eterm *ptr = bp->mem;
- Eterm *end;
-
- if ((ARITH_HEAP(cp) >= bp->mem) &&
- (ARITH_HEAP(cp) < bp->mem + bp->size)) {
- end = ARITH_HEAP(cp);
- } else {
- end = bp->mem + bp->size;
- }
-
- COPYMARK(ptr,end);
- bp = bp->next;
- }
- }
-
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Copy-Mark gray stack\n"));
- {
- INC_Object *obj = NULL;
-
- while (WORK_MORE && !INC_STORAGE_EMPTY(gray)) {
- Eterm *ptr;
-
- obj = INC_STORAGE_GET(gray);
- if ((*obj->this & _TAG_HEADER_MASK) == FUN_SUBTAG) {
- ptr = obj->this + thing_arityval(*obj->this) + 1;
- } else {
- ptr = obj->this;
- }
- COPYMARK(ptr,obj->this + obj->size);
- }
- /* TODO: Titta p� motsvarande i minor. */
- if (!WORK_MORE && obj != NULL)
- INC_STORE(gray,obj->this,obj->size);
- }
-
- if (WORK_MORE) {
- INC_DEACTIVATE(cp);
- }
- }
-
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Copy-Mark nursery\n"));
- {
- Eterm *ptr = inc_nursery_scn_ptr;
- COPYMARK(ptr,global_htop);
- inc_nursery_scn_ptr = ptr;
- }
-
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Copy-Mark gray found in nursery\n"));
- {
- INC_Object *obj = NULL;
-
- while (WORK_MORE && !INC_STORAGE_EMPTY(gray)) {
- Eterm *ptr;
-
- obj = INC_STORAGE_GET(gray);
- if ((*obj->this & _TAG_HEADER_MASK) == FUN_SUBTAG) {
- ptr = obj->this + thing_arityval(*obj->this) + 1;
- } else {
- ptr = obj->this;
- }
- COPYMARK(ptr,obj->this + obj->size);
- }
- /* TODO: Titta p� motsvarande i minor. */
- if (!WORK_MORE && obj != NULL)
- INC_STORE(gray,obj->this,obj->size);
- }
-
-
- /**********************************************************************/
- if (WORK_MORE) {
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Sweep phase\n"));
-
- /* Atomic phase */
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Sweep externals in old generation\n"));
- {
- ExternalThing** prev = &erts_global_offheap.externals;
- ExternalThing* ptr = erts_global_offheap.externals;
-
- while (ptr) {
- Eterm* ppt = (Eterm *) ptr;
-
- if ((ptr_within(ppt, global_old_heap, global_old_hend) &&
- blackmap[ppt - global_old_heap] == 0) ||
- (ptr_within(ppt, inc_fromspc, inc_fromend) &&
- !INC_IS_FORWARDED(ppt)))
- {
- erts_deref_node_entry(ptr->node);
- *prev = ptr = ptr->next;
- } else if (ptr_within(ppt, inc_fromspc, inc_fromend)) {
- ExternalThing* ro = (ExternalThing*)INC_FORWARD_VALUE(ppt);
- *prev = ro; /* Patch to moved pos */
- prev = &ro->next;
- ptr = ro->next;
- } else {
- prev = &ptr->next;
- ptr = ptr->next;
- }
- }
- ASSERT(*prev == NULL);
- }
-
- /* Atomic phase */
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Sweep refc bins in old generation\n"));
- {
- ProcBin** prev = &erts_global_offheap.mso;
- ProcBin* ptr = erts_global_offheap.mso;
-
- while (ptr) {
- Eterm *ppt = (Eterm*)ptr;
-
- if ((ptr_within(ppt, global_old_heap, global_old_hend) &&
- blackmap[ppt - global_old_heap] == 0) ||
- (ptr_within(ppt, inc_fromspc, inc_fromend) &&
- !INC_IS_FORWARDED(ppt)))
- {
- Binary* bptr;
- *prev = ptr->next;
- bptr = ptr->val;
- if (erts_refc_dectest(&bptr->refc, 0) == 0)
- erts_bin_free(bptr);
- ptr = *prev;
- } else if (ptr_within(ppt, inc_fromspc, inc_fromend)) {
- ProcBin* ro = (ProcBin*)INC_FORWARD_VALUE(ppt);
- *prev = ro; /* Patch to moved pos */
- prev = &ro->next;
- ptr = ro->next;
- } else {
- prev = &ptr->next;
- ptr = ptr->next;
- }
- }
- ASSERT(*prev == NULL);
- }
-
- /* TODO: Currently atomic phase - Can not be later of course. */
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Sweep old generation\n"));
- {
- INC_Page *page = inc_used_mem;
- INC_Page *prev = NULL;
- inc_free_list = NULL;
-
- while (page) {
- int scavenging = 0;
- int n = page->start - global_old_heap;
- int stop = n + INC_PAGESIZE;
-
- old_gen_sz += INC_PAGESIZE;
- while (n < stop) {
- if (blackmap[n] != 0) {
- if (scavenging) {
- Eterm *ptr = global_old_heap + n;
- scavenging = 0;
- if ((ptr - free_start) * sizeof(Eterm) >=
- sizeof(INC_MemBlock))
- {
- INC_MemBlock *new = (INC_MemBlock*)free_start;
- new->size = ptr - free_start;
- new->prev = NULL;
- new->next = inc_free_list;
- if (inc_free_list)
- inc_free_list->prev = new;
- inc_free_list = new;
- }
- }
- if (blackmap[n] == 255) {
- unsigned int size =
- *(unsigned int*)(((long)&blackmap[n]+4) & ~3);
- live += size;
- n += size;
- }
- else {
- live += blackmap[n];
- n += blackmap[n];
- }
- }
- else if (!scavenging) {
- free_start = global_old_heap + n;
- scavenging = 1;
- n++;
- }
- else {
- n++;
- }
- }
-
- if (scavenging) {
- if ((global_old_heap + n - free_start) * sizeof(Eterm) >
- sizeof(INC_MemBlock))
- {
- INC_MemBlock *new = (INC_MemBlock*)free_start;
- new->size = global_old_heap + n - free_start;
- new->prev = NULL;
- new->next = inc_free_list;
- if (inc_free_list)
- inc_free_list->prev = new;
- inc_free_list = new;
- }
- else if (free_start == page->start) {
- INC_Page *next = page->next;
-
- if (prev)
- prev->next = page->next;
- else
- inc_used_mem = page->next;
-
- page->next = inc_bibop;
- inc_bibop = page;
- inc_used_pages--;
- page = next;
- continue;
- }
- }
- prev = page;
- page = page->next;
- }
- }
- }
-
- ASSERT(inc_bibop);
- /*
- This code is not expected to work right now.
- if (!inc_bibop) {
- int i;
- int new_pages = inc_pages * 2;
- int size = sizeof(Eterm) * new_pages * INC_FULLPAGE;
- Eterm *new_heap = erts_alloc(ERTS_ALC_T_MESSAGE_AREA,size);
- Eterm *new_hend = new_heap + size;
- Eterm *new_htop;
- Eterm *last_page_end;
- INC_Page *new_used_mem;
- INC_Page *page;
-
- erts_printf("The last page has been allocated..\n");
- erts_printf("We need to copy things!\n");
-
- / * Create new, bigger bag of pages * /
- for (i = 0; i < new_pages; i++)
- {
- INC_Page *this =
- (INC_Page*)(new_heap + i * INC_FULLPAGE);
- this->next = (INC_Page*)((Eterm*)this + INC_FULLPAGE);
- }
- inc_bibop = (INC_Page*)new_heap;
- ((INC_Page*)(new_heap + (new_pages - 1) *
- INC_FULLPAGE))->next = NULL;
-
- new_used_mem = inc_bibop;
- inc_bibop = inc_bibop->next;
- new_used_mem->next = NULL;
-
- / * Move stuff from old bag to new * /
- inc_free_list = NULL;
- new_htop = new_used_mem->start;
- last_page_end = new_htop + INC_PAGESIZE;
- page = inc_used_mem;
- while (page)
- {
- Eterm *ptr = page->start;
- Eterm *page_end = ptr + INC_PAGESIZE;
- int n = offsetof(INC_Page,start) / sizeof(void*) +
- ((Eterm*)page - global_old_heap);
- while (ptr < page_end)
- {
- if (blackmap[n] > 0)
- {
- if (last_page_end - new_htop < blackmap[n])
- {
- INC_Page *new_page = inc_bibop;
- inc_bibop = inc_bibop->next;
- new_page->next = new_used_mem;
- new_used_mem = new_page;
- new_htop = new_page->start;
- last_page_end = new_htop + INC_PAGESIZE;
- }
-
- memcpy(new_htop,ptr,blackmap[n] * sizeof(Eterm));
- for (i = 0; i < blackmap[n]; i++)
- {
- *ptr++ = (Eterm)new_htop++;
- }
- //new_htop += blackmap[n];
- //ptr += blackmap[n];
- / *
- if (blackmap[n] == 255) Do the right thing...
- * /
- n += blackmap[n];
- }
- else
- {
- n++; ptr++;
- }
- }
- page = page->next;
- }
-
- page = inc_used_mem;
- while (page)
- {
- Eterm *ptr = page->start;
- Eterm *page_end = ptr + INC_PAGESIZE;
-
- / * TODO: If inc_used_mem is sorted in address order, this
- * pass can be done at the same time as copying. * /
- while (ptr < page_end)
- {
- if (ptr_within(ptr_val(*ptr),global_old_heap,global_old_hend))
- {
- *ptr = *((Eterm*)ptr_val(*ptr));
- }
- ptr++;
- }
- page = page->next;
- }
-
- printf("Restore rootset after heap move. Roots: %d\r\n",roots_saved);
- while (roots_saved--)
- {
- Eterm *ptr = root_save[roots_saved];
- *ptr = *((Eterm*)ptr_val(*ptr));
- }
-
- erts_free(ERTS_ALC_T_MESSAGE_AREA,(void*)global_old_heap);
-
- global_old_heap = new_heap;
- global_old_hend = new_hend;
- inc_used_mem = new_used_mem;
- inc_pages = new_pages;
-
- if ((last_page_end - new_htop) * sizeof(Eterm) >=
- sizeof(INC_MemBlock))
- {
- inc_free_list = (INC_MemBlock*)(new_htop);
- inc_free_list->size = last_page_end - new_htop;
- inc_free_list->prev = NULL;
- inc_free_list->next = NULL;
- }
- }
- */
-
- /* I vilka l�gen kan vi vilja sl�nga p� en extra sida.. ( < 25% kvar?)
- if ()
- {
- INC_Page *new_page = inc_bibop;
- INC_MemBlock *new_free =
- (INC_MemBlock*)new_page->start;
-
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Fetching new page\n"));
- inc_bibop = inc_bibop->next;
-
- new_page->next = inc_used_mem;
- if (inc_used_mem)
- inc_used_mem->prev = new_page;
- inc_used_mem = new_page;
-
- // kolla detta med normal sidstorlek! old_gen_sz += INC_PAGESIZE;
- //BM_SWAP_TIMER(gc,misc1);
- memset(blackmap +
- ((void*)new_page - (void*)global_old_heap) / sizeof(void*),
- 0, INC_FULLPAGE);
- //BM_SWAP_TIMER(misc1,gc);
-
- new_free->prev = NULL;
- new_free->next = inc_free_list;
- new_free->size = INC_PAGESIZE;
- if (inc_free_list)
- inc_free_list->prev = new_free;
- inc_free_list = new_free;
- //printf("Snatched a new page @ 0x%08x\r\n",(int)new_page);
- //print_free_list();
- found = new_free;
- }
- */
-
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Update copy stack\n"));
- {
- Uint i;
- for (i = 0; i < ma_dst_top; i++) {
- if (ptr_within(ma_dst_stack[i],inc_fromspc,inc_fromend)) {
- if (INC_IS_FORWARDED(ma_dst_stack[i]))
- ma_dst_stack[i] = INC_FORWARD_VALUE(ma_dst_stack[i]);
- }
- }
- }
-
- if (WORK_MORE)
- {
- int size_left = INC_PAGESIZE - (aging_htop - aging->start);
-
- if (size_left > sizeof(INC_MemBlock))
- {
- ((INC_MemBlock*)aging_htop)->size = size_left;
- ((INC_MemBlock*)aging_htop)->prev = NULL;
- ((INC_MemBlock*)aging_htop)->next = inc_free_list;
- if (inc_free_list)
- inc_free_list->prev = (INC_MemBlock*)aging_htop;
- inc_free_list = (INC_MemBlock*)aging_htop;
- }
- aging->next = inc_used_mem;
- inc_used_mem = aging;
- inc_used_pages++;
-
- ma_gc_flags &= ~GC_MAJOR;
- ma_gc_flags &= ~GC_CYCLE;
-
- VERBOSE(DEBUG_HYBRID_GC,("INCGC: Major collection cycle END\n"));
- }
-
- ma_gc_flags &= ~GC_INCLUDE_ALL;
-
- BM_STOP_TIMER(old_gc);
-#ifdef BM_TIMER
- major_global_gc_time += old_gc_time;
- if (old_gc_time > max_global_major_time)
- max_global_major_time = old_gc_time;
-
- if ((old_gc_time * 1000) < MAX_PAUSE_TIME)
- pause_times_old[(int)(old_gc_time * 1000)]++;
- else
- pause_times_old[MAX_PAUSE_TIME - 1]++;
-#endif
- BM_START_TIMER(gc);
-}
-
-
-
-/***************************************************************************
- * *
- * Allocation in the old generation. Used in minor colection and when *
- * copying the rest of a message after a GC. *
- * *
- ***************************************************************************/
-
-
-Eterm *erts_inc_alloc(int need)
-{
- INC_MemBlock *this = inc_free_list;
-
- ASSERT(need < INC_PAGESIZE);
- while (this && (this->size) < need)
- {
- this = this->next;
- }
-
- if (!this)
- {
- /* If a free block large enough is not found, a new page is
- * allocated. GC_NEED_MAJOR is set so that the next garbage
- * collection cycle will be a major one, that is, both
- * generations will be garbage collected.
- */
- INC_Page *new_page = inc_bibop;
- INC_MemBlock *new_free = (INC_MemBlock*)new_page->start;
-
- if (new_page)
- {
- VERBOSE(DEBUG_HYBRID_GC,
- ("INCGC: Allocation grabs a new page\n"));
- inc_bibop = inc_bibop->next;
- new_page->next = inc_used_mem;
- inc_used_mem = new_page;
- inc_used_pages++;
-
- new_free->prev = NULL;
- new_free->next = inc_free_list;
- new_free->size = INC_PAGESIZE;
- if (inc_free_list)
- inc_free_list->prev = new_free;
- inc_free_list = new_free;
-
- this = new_free;
- if (!(ma_gc_flags & GC_MAJOR))
- ma_gc_flags |= GC_NEED_MAJOR;
- }
- else
- {
- erl_exit(-1, "inc_alloc ran out of pages!\n");
- }
- }
-
- if (((this->size) - need) * sizeof(Eterm) >= sizeof(INC_MemBlock))
- {
- INC_MemBlock *rest = (INC_MemBlock*)((Eterm*)this + need);
-
- /* The order here IS important! */
- rest->next = this->next;
-
- if (rest->next)
- rest->next->prev = rest;
-
- rest->prev = this->prev;
-
- if (rest->prev)
- rest->prev->next = rest;
- else
- inc_free_list = rest;
-
- rest->size = this->size - need;
- }
- else
- {
- if (this->prev)
- this->prev->next = this->next;
- else
- inc_free_list = this->next;
-
- if (this->next)
- this->next->prev = this->prev;
- }
-
- if (ma_gc_flags & GC_MAJOR) {
- if (need > 254) {
- blackmap[(Eterm*)this - global_old_heap] = 255;
- *(int*)((UWord)(&blackmap[(Eterm*)this - global_old_heap]+4) & ~3) =
- need;
- } else
- blackmap[(Eterm*)this - global_old_heap] = need;
- }
- return (Eterm*)this;
-}
-#endif /* INCREMENTAL */
diff --git a/erts/emulator/beam/erl_nmgc.h b/erts/emulator/beam/erl_nmgc.h
deleted file mode 100644
index b207dd37fa..0000000000
--- a/erts/emulator/beam/erl_nmgc.h
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 2004-2009. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-
-#ifndef __ERL_NMGC_H__
-#define __ERL_NMGC_H__
-
-#ifdef INCREMENTAL
-#include <stddef.h> /* offsetof() */
-#include "erl_process.h"
-
-#define INC_FULLPAGE (INC_PAGESIZE + offsetof(INC_Page,start) / sizeof(void*))
-
-#define BOXED_NEED(PTR,HDR) \
- (((HDR) & _HEADER_SUBTAG_MASK) == SUB_BINARY_SUBTAG ? \
- header_arity(HDR) + 2 : \
- ((HDR) & _HEADER_SUBTAG_MASK) == FUN_SUBTAG ? \
- header_arity(HDR) + ((ErlFunThing*)(PTR))->num_free + 2 : \
- header_arity(HDR) + 1)
-
-
-#define INC_DECREASE_WORK(n) inc_words_to_go -= (n);
-
-#define INC_COPY_CONS(FROM,TO,PTR) \
-do { \
- TO[0] = FROM[0]; \
- TO[1] = FROM[1]; \
- INC_MARK_FORWARD(FROM,TO); \
- *(PTR) = make_list(TO); \
- INC_DECREASE_WORK(2); \
- (TO) += 2; \
-} while(0)
-
-#define INC_COPY_BOXED(FROM,TO,PTR) \
-do { \
- Sint nelts; \
- Eterm hdr = *(FROM); \
- \
- ASSERT(is_header(hdr)); \
- INC_MARK_FORWARD(FROM,TO); \
- *(PTR) = make_boxed(TO); \
- *(TO)++ = *(FROM)++; \
- nelts = header_arity(hdr); \
- switch ((hdr) & _HEADER_SUBTAG_MASK) { \
- case SUB_BINARY_SUBTAG: nelts++; break; \
- case FUN_SUBTAG: nelts+=((ErlFunThing*)(FROM-1))->num_free+1; break;\
- } \
- INC_DECREASE_WORK(nelts + 1); \
- while (nelts--) \
- *(TO)++ = *(FROM)++; \
-} while(0)
-
-
-/* Things copied to the old generation are not marked in the blackmap.
- * This is ok since the page they are copied to (aging) is not part of
- * the sweep.
- */
-#define COPYMARK_CONS(FROM,TO,PTR,LIMIT) \
-do { \
- if (ptr_within(FROM,inc_fromspc,inc_fromend)) { \
- if (INC_IS_FORWARDED(FROM)) { \
- *PTR = make_list(INC_FORWARD_VALUE(FROM)); \
- } else if (TO + 2 <= LIMIT) { \
- INC_STORE(gray,TO,2); \
- INC_COPY_CONS(FROM,TO,PTR); \
- } else { \
- Eterm *hp = erts_inc_alloc(2); \
- INC_STORE(gray,hp,2); \
- INC_COPY_CONS(FROM,hp,PTR); \
- } \
- } else if (ptr_within(FROM,global_old_heap,global_old_hend) && \
- (blackmap[FROM - global_old_heap] == 0)) { \
- blackmap[FROM - global_old_heap] = 2; \
- INC_DECREASE_WORK(2); \
- INC_STORE(gray,FROM,2); \
- } \
-} while(0)
-
-#define COPYMARK_BOXED(FROM,TO,PTR,LIMIT) \
-do { \
- if (ptr_within(FROM,inc_fromspc,inc_fromend)) { \
- int size = BOXED_NEED(FROM,*FROM); \
- if (INC_IS_FORWARDED(FROM)) { \
- *PTR = make_boxed(INC_FORWARD_VALUE(FROM)); \
- } else if (TO + size <= LIMIT) { \
- INC_STORE(gray,TO,size); \
- INC_COPY_BOXED(FROM,TO,PTR); \
- } else { \
- Eterm *hp = erts_inc_alloc(size); \
- INC_STORE(gray,hp,size); \
- INC_COPY_BOXED(FROM,hp,PTR); \
- } \
- } else if (ptr_within(FROM,global_old_heap,global_old_hend) && \
- (blackmap[FROM - global_old_heap] == 0)) { \
- int size = BOXED_NEED(FROM,*FROM); \
- if (size > 254) { \
- blackmap[FROM - global_old_heap] = 255; \
- *(int*)((long)(&blackmap[FROM - \
- global_old_heap] + 4) & ~3) = size; \
- } else \
- blackmap[FROM - global_old_heap] = size; \
- INC_DECREASE_WORK(size); \
- INC_STORE(gray,FROM,size); \
- } \
-} while(0)
-
-#define INC_MARK_FORWARD(ptr,dst) fwdptrs[(ptr) - inc_fromspc] = (dst);
-#define INC_IS_FORWARDED(ptr) (fwdptrs[(ptr) - inc_fromspc] != 0)
-#define INC_FORWARD_VALUE(ptr) fwdptrs[(ptr) - inc_fromspc]
-
-/* Note for BM_TIMER: Active timer should always be 'system' when IncAlloc
- * is called!
- */
-#define IncAlloc(p, sz, objv, nobj) \
- (ASSERT_EXPR((sz) >= 0), \
- (((inc_alloc_limit - global_htop) <= (sz)) ? \
- erts_incremental_gc((p),(sz),(objv),(nobj)) : 0), \
- ASSERT_EXPR(global_hend - global_htop > (sz)), \
- global_htop += (sz), global_htop - (sz))
-
-
-/************************************************************************
- * INC_STORAGE, a dynamic circular storage for objects (INC_Object). *
- * Use INC_STORE to add objects to the storage. The storage can then *
- * be used either as a queue, using INC_STORAGE_GET to retreive *
- * values, or as a stack, using INC_STORAGE_POP. It is OK to mix calls *
- * to GET and POP if that is desired. *
- * An iterator can be declared to traverse the storage without removing *
- * any elements, and INC_STORAGE_STEP will then return each element in *
- * turn, oldest first. *
- ***********************************************************************/
-
-/* Declare a new storage; must be in the beginning of a block. Give
- * the storage a name that is used in all later calls to the storage.
- * If this is an external declaration of the storage, pass the keyword
- * external as the first argument, otherwise leave it empty.
- */
-#define INC_STORAGE_DECLARATION(ext,name) \
- ext INC_Storage *name##head; \
- ext INC_Storage *name##tail; \
- ext INC_Object *name##free; \
- ext INC_Object *name##last_free; \
- ext int name##size;
-
-
-/* Initialize the storage. Note that memory allocation is involved -
- * don't forget to erase the storage when you are done.
- */
-#define INC_STORAGE_INIT(name) do { \
- name##head = (INC_Storage*)erts_alloc(ERTS_ALC_T_OBJECT_STACK, \
- sizeof(INC_Storage)); \
- name##head->next = name##head; \
- name##head->prev = name##head; \
- name##tail = name##head; \
- name##free = name##head->data; \
- name##last_free = name##free + INC_STORAGE_SIZE - 1; \
- name##size = 0; \
-} while(0)
-
-
-/*
-#define INC_STORAGE_SWAP(s1,s2) do { \
- INC_Storage *tmphead = s1##head; \
- INC_Storage *tmptail = s1##tail; \
- INC_Object *tmpfree = s1##free; \
- INC_Object *tmplast = s1##last_free; \
- int tmpsize = s1##size; \
- s1##head = s2##head; \
- s1##tail = s2##tail; \
- s1##free = s2##free; \
- s1##last_free = s2##last_free; \
- s1##size = s2##size; \
- s2##head = tmphead; \
- s2##tail = tmptail; \
- s2##free = tmpfree; \
- s2##last_free = tmplast; \
- s2##size = tmpsize; \
-} while(0)
-*/
-
-
-/* Return and remove the youngest element - treat the storage as a
- * stack. Always check that there are elements in the queue before
- * using INC_STORAGE_POP!
- */
-#define INC_STORAGE_POP(name) (ASSERT_EXPR(name##size != 0), \
- name##size--, \
- (--name##free != name##head->data - 1) ? \
- name##free : (name##head = name##head->prev, \
- name##free = name##head->data + INC_STORAGE_SIZE - 1))
-
-
-/* Return and remove the oldest element - treat the storage as a
- * queue. Always check that there are elements in the queue before
- * using INC_STORAGE_GET!
- */
-#define INC_STORAGE_GET(name) (ASSERT_EXPR(name##size != 0), \
- name##size--, \
- (++name##last_free != name##tail->data + INC_STORAGE_SIZE) ? \
- name##last_free : (name##tail = name##tail->next, \
- name##last_free = name##tail->data))
-
-
-/* Advance the head to the next free location. If the storage is full,
- * a new storage is allocated and linked into the list.
- */
-#define INC_STORAGE_NEXT(name) do { \
- if (name##free == name##last_free) { \
- name##tail = (INC_Storage*)erts_alloc(ERTS_ALC_T_OBJECT_STACK, \
- sizeof(INC_Storage)); \
- memcpy(name##tail->data,name##head->data, \
- INC_STORAGE_SIZE * sizeof(INC_Object)); \
- name##tail->next = name##head->next; \
- name##head->next = name##tail; \
- name##tail->prev = name##tail->next->prev; \
- name##tail->next->prev = name##tail; \
- name##last_free = ((void*)name##tail + \
- ((void*)name##last_free - (void*)name##head)); \
- } \
- name##free++; \
- name##size++; \
- if (name##free == name##head->data + INC_STORAGE_SIZE) { \
- name##head = name##head->next; \
- name##free = name##head->data; \
- } \
-} while(0)
-
-
-/* The head of this storage is the next free location. This is where
- * the next element will be stored.
- */
-#define INC_STORAGE_HEAD(name) (name##free)
-
-
-/* Return the top - the youngest element in the storage. */
-/* #define INC_STORAGE_TOP(name) (name##free - 1 with some magic..) */
-
-
-/* True if the storage is empty, false otherwise */
-#define INC_STORAGE_EMPTY(name) (name##size == 0)
-
-
-/* Store a new element in the head of the storage and advance the head
- * to the next free location.
- */
-#define INC_STORE(name,ptr,sz) do { \
- INC_STORAGE_HEAD(name)->this = ptr; \
- INC_STORAGE_HEAD(name)->size = sz; \
- INC_STORAGE_NEXT(name); \
-} while(0)
-
-
-/* An iterator. Use it together with INC_STORAGE_STEP to browse throuh
- * the storage. Please note that it is not possible to remove an entry
- * in the middle of the storage, use GET or POP to remove enties.
- */
-#define INC_STORAGE_ITERATOR(name) \
- INC_Storage *name##iterator_head = name##tail; \
- INC_Object *name##iterator_current = name##last_free; \
- int name##iterator_left = name##size;
-
-
-/* Return the next element in the storage (sorted by age, oldest
- * first) or NULL if the storage is empty or the last element has been
- * returned already.
- */
-#define INC_STORAGE_STEP(name) (name##iterator_left == 0 ? NULL : \
- (name##iterator_left--, \
- (++name##iterator_current != name##iterator_head->data + \
- INC_STORAGE_SIZE) ? name##iterator_current : \
- (name##iterator_head = name##iterator_head->next, \
- name##iterator_current = name##iterator_head->data)))
-
-
-/* Erase the storage. */
-#define INC_STORAGE_ERASE(name)do { \
- name##head->prev->next = NULL; \
- while (name##head != NULL) { \
- name##tail = name##head; \
- name##head = name##head->next; \
- erts_free(ERTS_ALC_T_OBJECT_STACK,(void*)name##tail); \
- } \
- name##tail = NULL; \
- name##free = NULL; \
- name##last_free = NULL; \
- name##size = 0; \
-} while(0)
-
-/*
- * Structures used by the non-moving memory manager
- */
-
-typedef struct
-{
- Eterm *this;
- unsigned long size;
-} INC_Object;
-
-typedef struct inc_storage {
- struct inc_storage *next;
- struct inc_storage *prev;
- INC_Object data[INC_STORAGE_SIZE];
-} INC_Storage;
-
-typedef struct inc_mem_block
-{
- unsigned long size;
- struct inc_mem_block *prev;
- struct inc_mem_block *next;
-} INC_MemBlock;
-
-typedef struct inc_page
-{
- struct inc_page *next;
- Eterm start[1]; /* Has to be last in struct, this is where the data start */
-} INC_Page;
-
-
-/*
- * Heap pointers for the non-moving memory area.
- */
-extern INC_Page *inc_used_mem;
-extern INC_MemBlock *inc_free_list;
-extern unsigned char *blackmap;
-
-extern Eterm **fwdptrs;
-extern Eterm *inc_fromspc;
-extern Eterm *inc_fromend;
-extern Process *inc_active_proc;
-extern Process *inc_active_last;
-extern Eterm *inc_alloc_limit;
-extern int inc_words_to_go;
-
-INC_STORAGE_DECLARATION(extern,gray);
-INC_STORAGE_DECLARATION(extern,root);
-
-void erts_init_incgc(void);
-void erts_cleanup_incgc(void);
-void erts_incremental_gc(Process *p, int sz, Eterm* objv, int nobj);
-Eterm *erts_inc_alloc(int need);
-
-#else
-# define INC_STORE(lst,ptr,sz)
-# define INC_MARK_FORWARD(ptr)
-# define INC_IS_FORWARDED(ptr)
-# define INC_FORWARD_VALUE(ptr)
-#endif /* INCREMENTAL */
-
-#endif /* _ERL_NMGC_H_ */
diff --git a/erts/emulator/beam/erl_node_container_utils.h b/erts/emulator/beam/erl_node_container_utils.h
index 329a2204cc..7b4cb7b042 100644
--- a/erts/emulator/beam/erl_node_container_utils.h
+++ b/erts/emulator/beam/erl_node_container_utils.h
@@ -128,8 +128,47 @@ extern int erts_use_r9_pids_ports;
* Pids *
\* */
-#define internal_pid_index(x) (internal_pid_data((x)) \
- & erts_process_tab_index_mask)
+#define erts_max_processes erts_proc.max
+
+typedef struct {
+ erts_smp_atomic_t *tab;
+ int max;
+ int tab_cache_lines;
+ int pix_per_cache_line;
+ int pix_cl_mask;
+ int pix_cl_shift;
+ int pix_cli_mask;
+ int pix_cli_shift;
+} ErtsProcTab;
+
+extern ErtsProcTab erts_proc;
+
+ERTS_GLB_INLINE int erts_pid_data2ix(Eterm pid_data);
+
+#if ERTS_GLB_INLINE_INCL_FUNC_DEF
+
+ERTS_GLB_INLINE int erts_pid_data2ix(Eterm pid_data)
+{
+ int n, pix;
+
+ n = (int) pid_data;
+ if (erts_proc.pix_cl_mask) {
+ pix = ((n & erts_proc.pix_cl_mask) << erts_proc.pix_cl_shift);
+ pix += ((n >> erts_proc.pix_cli_shift) & erts_proc.pix_cli_mask);
+ }
+ else {
+ n %= erts_proc.max;
+ pix = n % erts_proc.tab_cache_lines;
+ pix *= erts_proc.pix_per_cache_line;
+ pix += n / erts_proc.tab_cache_lines;
+ }
+ ASSERT(0 <= pix && pix < erts_proc.max);
+ return pix;
+}
+
+#endif
+
+#define internal_pid_index(x) erts_pid_data2ix(internal_pid_data((x)))
#define internal_pid_node_name(x) (internal_pid_node((x))->sysname)
#define external_pid_node_name(x) (external_pid_node((x))->sysname)
diff --git a/erts/emulator/beam/erl_node_tables.c b/erts/emulator/beam/erl_node_tables.c
index 908ba755ed..40837d3817 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2012. 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
@@ -27,6 +27,7 @@
#include "big.h"
#include "error.h"
#include "erl_thr_progress.h"
+#include "dtrace-wrapper.h"
Hash erts_dist_table;
Hash erts_node_table;
@@ -42,6 +43,8 @@ Sint erts_no_of_not_connected_dist_entries;
DistEntry *erts_this_dist_entry;
ErlNode *erts_this_node;
+char erts_this_node_sysname_BUFFER[256],
+ *erts_this_node_sysname = "uninitialized yet";
static Uint node_entries;
static Uint dist_entries;
@@ -702,6 +705,9 @@ erts_set_this_node(Eterm sysname, Uint creation)
(void) hash_erase(&erts_node_table, (void *) erts_this_node);
erts_this_node->sysname = sysname;
erts_this_node->creation = creation;
+ erts_this_node_sysname = erts_this_node_sysname_BUFFER;
+ erts_snprintf(erts_this_node_sysname, sizeof(erts_this_node_sysname),
+ "%T", sysname);
(void) hash_put(&erts_node_table, (void *) erts_this_node);
erts_smp_rwmtx_rwunlock(&erts_dist_table_rwmtx);
@@ -789,6 +795,9 @@ void erts_init_node_tables(void)
erts_this_node->sysname = am_Noname;
erts_this_node->creation = 0;
erts_this_node->dist_entry = erts_this_dist_entry;
+ erts_this_node_sysname = erts_this_node_sysname_BUFFER;
+ erts_snprintf(erts_this_node_sysname, sizeof(erts_this_node_sysname),
+ "%T", erts_this_node->sysname);
(void) hash_put(&erts_node_table, (void *) erts_this_node);
@@ -840,9 +849,6 @@ static Eterm AM_dist_references;
static Eterm AM_node_references;
static Eterm AM_system;
static Eterm AM_timer;
-#ifdef HYBRID
-static Eterm AM_processes;
-#endif
static void setup_reference_table(void);
static Eterm reference_table_term(Uint **hpp, Uint *szp);
@@ -927,9 +933,6 @@ erts_get_node_and_dist_references(struct process *proc)
INIT_AM(node_references);
INIT_AM(timer);
INIT_AM(system);
-#ifdef HYBRID
- INIT_AM(processes);
-#endif
references_atoms_need_init = 0;
}
@@ -1292,30 +1295,25 @@ setup_reference_table(void)
SYSTEM_REF,
TUPLE2(&heap[0], AM_system, am_undefined));
-#ifdef HYBRID
- /* Insert Heap */
- insert_offheap(&erts_global_offheap,
- HEAP_REF,
- TUPLE2(&heap[0], AM_processes, am_undefined));
-#endif
UnUseTmpHeapNoproc(3);
/* Insert all processes */
- for (i = 0; i < erts_max_processes; i++)
- if (process_tab[i]) {
+ for (i = 0; i < erts_max_processes; i++) {
+ Process *proc = erts_pix2proc(i);
+ if (proc) {
ErlMessage *msg;
/* Insert Heap */
- insert_offheap(&(process_tab[i]->off_heap),
+ insert_offheap(&(proc->off_heap),
HEAP_REF,
- process_tab[i]->id);
+ proc->id);
/* Insert message buffers */
- for(hfp = process_tab[i]->mbuf; hfp; hfp = hfp->next)
+ for(hfp = proc->mbuf; hfp; hfp = hfp->next)
insert_offheap(&(hfp->off_heap),
HEAP_REF,
- process_tab[i]->id);
+ proc->id);
/* Insert msg msg buffers */
- for (msg = process_tab[i]->msg.first; msg; msg = msg->next) {
+ for (msg = proc->msg.first; msg; msg = msg->next) {
ErlHeapFragment *heap_frag = NULL;
if (msg->data.attached) {
if (is_value(ERL_MESSAGE_TERM(msg)))
@@ -1323,7 +1321,7 @@ setup_reference_table(void)
else {
if (msg->data.dist_ext->dep)
insert_dist_entry(msg->data.dist_ext->dep,
- HEAP_REF, process_tab[i]->id, 0);
+ HEAP_REF, proc->id, 0);
if (is_not_nil(ERL_MESSAGE_TOKEN(msg)))
heap_frag = erts_dist_ext_trailer(msg->data.dist_ext);
}
@@ -1331,10 +1329,10 @@ setup_reference_table(void)
if (heap_frag)
insert_offheap(&(heap_frag->off_heap),
HEAP_REF,
- process_tab[i]->id);
+ proc->id);
}
#ifdef ERTS_SMP
- for (msg = process_tab[i]->msg_inq.first; msg; msg = msg->next) {
+ for (msg = proc->u.alive.msg_inq.first; msg; msg = msg->next) {
ErlHeapFragment *heap_frag = NULL;
if (msg->data.attached) {
if (is_value(ERL_MESSAGE_TERM(msg)))
@@ -1342,7 +1340,7 @@ setup_reference_table(void)
else {
if (msg->data.dist_ext->dep)
insert_dist_entry(msg->data.dist_ext->dep,
- HEAP_REF, process_tab[i]->id, 0);
+ HEAP_REF, proc->id, 0);
if (is_not_nil(ERL_MESSAGE_TOKEN(msg)))
heap_frag = erts_dist_ext_trailer(msg->data.dist_ext);
}
@@ -1350,21 +1348,22 @@ setup_reference_table(void)
if (heap_frag)
insert_offheap(&(heap_frag->off_heap),
HEAP_REF,
- process_tab[i]->id);
+ proc->id);
}
#endif
/* Insert links */
- if(process_tab[i]->nlinks)
- insert_links(process_tab[i]->nlinks, process_tab[i]->id);
- if(process_tab[i]->monitors)
- insert_monitors(process_tab[i]->monitors, process_tab[i]->id);
+ if(proc->nlinks)
+ insert_links(proc->nlinks, proc->id);
+ if(proc->monitors)
+ insert_monitors(proc->monitors, proc->id);
/* Insert controller */
{
- DistEntry *dep = ERTS_PROC_GET_DIST_ENTRY(process_tab[i]);
+ DistEntry *dep = ERTS_PROC_GET_DIST_ENTRY(proc);
if (dep)
- insert_dist_entry(dep, CTRL_REF, process_tab[i]->id, 0);
+ insert_dist_entry(dep, CTRL_REF, proc->id, 0);
}
}
+ }
#ifdef ERTS_SMP
erts_foreach_sys_msg_in_q(insert_sys_msg);
diff --git a/erts/emulator/beam/erl_node_tables.h b/erts/emulator/beam/erl_node_tables.h
index b0a63ae035..4a015bdef9 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-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2012. 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
@@ -169,6 +169,7 @@ extern Sint erts_no_of_not_connected_dist_entries;
extern DistEntry *erts_this_dist_entry;
extern ErlNode *erts_this_node;
+extern char *erts_this_node_sysname; /* must match erl_node_tables.c */
DistEntry *erts_channel_no_to_dist_entry(Uint);
DistEntry *erts_sysname_to_connected_dist_entry(Eterm);
diff --git a/erts/emulator/beam/erl_port_task.c b/erts/emulator/beam/erl_port_task.c
index a2b08fcf56..86454fe1fa 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2012. 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
@@ -32,6 +32,7 @@
#include "global.h"
#include "erl_port_task.h"
#include "dist.h"
+#include "dtrace-wrapper.h"
#if defined(DEBUG) && 0
#define HARD_DEBUG
@@ -55,11 +56,19 @@
#define ERTS_PORT_IS_IN_RUNQ(RQ, P) \
((P)->sched.next || (P)->sched.prev || (RQ)->ports.start == (P))
-#define ERTS_PORT_NOT_IN_RUNQ(P) \
-do { \
- (P)->sched.prev = NULL; \
- (P)->sched.next = NULL; \
-} while (0)
+#ifdef USE_VM_PROBES
+#define DTRACE_DRIVER(PROBE_NAME, PP) \
+ if (DTRACE_ENABLED(driver_ready_input)) { \
+ DTRACE_CHARBUF(process_str, DTRACE_TERM_BUF_SIZE); \
+ DTRACE_CHARBUF(port_str, DTRACE_TERM_BUF_SIZE); \
+ \
+ dtrace_pid_str(PP->connected, process_str); \
+ dtrace_port_str(PP, port_str); \
+ DTRACE3(PROBE_NAME, process_str, port_str, PP->name); \
+ }
+#else
+#define DTRACE_DRIVER(PROBE_NAME, PP) do {} while(0)
+#endif
erts_smp_atomic_t erts_port_task_outstanding_io_tasks;
@@ -152,7 +161,7 @@ enqueue_port(ErtsRunQueue *runq, Port *pp)
{
ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(runq));
pp->sched.next = NULL;
- pp->sched.prev = runq->ports.end;
+ pp->sched.in_runq = 1;
if (runq->ports.end) {
ASSERT(runq->ports.start);
runq->ports.end->sched.next = pp;
@@ -162,39 +171,10 @@ enqueue_port(ErtsRunQueue *runq, Port *pp)
runq->ports.start = pp;
}
- runq->ports.info.len++;
- if (runq->ports.info.max_len < runq->ports.info.len)
- runq->ports.info.max_len = runq->ports.info.len;
- runq->len++;
- if (runq->max_len < runq->len)
- runq->max_len = runq->len;
runq->ports.end = pp;
ASSERT(runq->ports.start && runq->ports.end);
-}
-static ERTS_INLINE void
-dequeue_port(ErtsRunQueue *runq, Port *pp)
-{
- ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(runq));
- if (pp->sched.next)
- pp->sched.next->sched.prev = pp->sched.prev;
- else {
- ASSERT(runq->ports.end == pp);
- runq->ports.end = pp->sched.prev;
- }
- if (pp->sched.prev)
- pp->sched.prev->sched.next = pp->sched.next;
- else {
- ASSERT(runq->ports.start == pp);
- runq->ports.start = pp->sched.next;
- }
-
- ASSERT(runq->ports.info.len > 0);
- runq->ports.info.len--;
- ASSERT(runq->len > 0);
- runq->len--;
- ASSERT(runq->ports.start || !runq->ports.end);
- ASSERT(runq->ports.end || !runq->ports.start);
+ erts_smp_inc_runq_len(runq, &runq->ports.info, ERTS_PORT_PRIO_LEVEL);
}
static ERTS_INLINE Port *
@@ -207,16 +187,11 @@ pop_port(ErtsRunQueue *runq)
}
else {
runq->ports.start = runq->ports.start->sched.next;
- if (runq->ports.start)
- runq->ports.start->sched.prev = NULL;
- else {
+ if (!runq->ports.start) {
ASSERT(runq->ports.end == pp);
runq->ports.end = NULL;
}
- ASSERT(runq->ports.info.len > 0);
- runq->ports.info.len--;
- ASSERT(runq->len > 0);
- runq->len--;
+ erts_smp_dec_runq_len(runq, &runq->ports.info, ERTS_PORT_PRIO_LEVEL);
}
ASSERT(runq->ports.start || !runq->ports.end);
@@ -270,7 +245,7 @@ check_port_queue(ErtsRunQueue *runq, Port *chk_pp, int inq)
}
ASSERT(no_forward == no_backward);
}
- ASSERT(no_forward == runq->ports.info.len);
+ ASSERT(no_forward == RUNQ_READ_LEN(&runq->ports.info.len));
if (chk_pp) {
if (chk_pp->sched.taskq || chk_pp->sched.exe_taskq) {
ASSERT(chk_pp->sched.taskq != chk_pp->sched.exe_taskq);
@@ -452,10 +427,11 @@ erts_port_task_abort(Eterm id, ErtsPortTaskHandle *pthp)
ErtsPortTaskQueue *ptqp;
ErtsPortTask *ptp;
Port *pp;
- int port_is_dequeued = 0;
pp = &erts_port[internal_port_index(id)];
runq = erts_port_runq(pp);
+ if (!runq)
+ return 1;
ptp = handle2task(pthp);
@@ -490,22 +466,12 @@ erts_port_task_abort(Eterm id, ErtsPortTaskHandle *pthp)
if (ptqp->first || pp->sched.taskq != ptqp)
ptqp = NULL;
- else {
+ else
pp->sched.taskq = NULL;
- if (!pp->sched.exe_taskq) {
- dequeue_port(runq, pp);
- ERTS_PORT_NOT_IN_RUNQ(pp);
- port_is_dequeued = 1;
- }
- }
ERTS_PT_CHK_PRES_PORTQ(runq, pp);
erts_smp_runq_unlock(runq);
-
- if (erts_system_profile_flags.runnable_ports && port_is_dequeued) {
- profile_runnable_port(pp, am_inactive);
- }
port_task_free(ptp);
if (ptqp)
@@ -560,7 +526,7 @@ erts_port_task_schedule(Eterm id,
if (!pp->sched.taskq) {
pp->sched.taskq = port_taskq_init(port_taskq_alloc(), pp);
- enq_port = !pp->sched.exe_taskq;
+ enq_port = !pp->sched.in_runq && !pp->sched.exe_taskq;
}
#ifdef ERTS_SMP
@@ -570,13 +536,13 @@ erts_port_task_schedule(Eterm id,
/* Port emigrated ... */
erts_smp_atomic_set_nob(&pp->run_queue, (erts_aint_t) xrunq);
erts_smp_runq_unlock(runq);
- runq = xrunq;
+ runq = erts_port_runq(pp);
+ if (!runq)
+ return -1;
}
}
#endif
- ASSERT(!enq_port || !(runq->flags & ERTS_RUNQ_FLG_SUSPENDED));
-
ASSERT(pp->sched.taskq);
ASSERT(ptp);
@@ -618,7 +584,7 @@ erts_port_task_schedule(Eterm id,
#elif defined(DEBUG)
if (!enq_port && !pp->sched.exe_taskq) {
/* We should be in port run q */
- ASSERT(pp->sched.prev || runq->ports.start == pp);
+ ASSERT(pp->sched.in_runq);
}
#endif
#endif
@@ -646,63 +612,54 @@ void
erts_port_task_free_port(Port *pp)
{
ErtsRunQueue *runq;
- int port_is_dequeued = 0;
+ ErtsPortTaskQueue *ptqp;
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(pp));
ASSERT(!(pp->status & ERTS_PORT_SFLGS_DEAD));
runq = erts_port_runq(pp);
ASSERT(runq);
ERTS_PT_CHK_PRES_PORTQ(runq, pp);
- if (pp->sched.exe_taskq) {
+ ptqp = pp->sched.exe_taskq;
+ if (ptqp) {
/* I (this thread) am currently executing this port, free it
when scheduled out... */
- ErtsPortTask *ptp = port_task_alloc();
+ ErtsPortTask *ptp;
+ enqueue_free:
+ ptp = port_task_alloc();
erts_smp_port_state_lock(pp);
pp->status &= ~ERTS_PORT_SFLG_CLOSING;
pp->status |= ERTS_PORT_SFLG_FREE_SCHEDULED;
erts_may_save_closed_port(pp);
erts_smp_port_state_unlock(pp);
- ERTS_SMP_LC_ASSERT(erts_smp_atomic_read_nob(&pp->refc) > 1);
+ ERTS_LC_ASSERT(erts_smp_atomic_read_nob(&pp->refc) > 1);
ptp->type = ERTS_PORT_TASK_FREE;
ptp->event = (ErlDrvEvent) -1;
ptp->event_data = NULL;
set_handle(ptp, NULL);
- push_task(pp->sched.exe_taskq, ptp);
+ push_task(ptqp, ptp);
ERTS_PT_CHK_PRES_PORTQ(runq, pp);
erts_smp_runq_unlock(runq);
}
else {
- ErtsPortTaskQueue *ptqp = pp->sched.taskq;
- if (ptqp) {
- dequeue_port(runq, pp);
- ERTS_PORT_NOT_IN_RUNQ(pp);
- port_is_dequeued = 1;
+ if (pp->sched.in_runq) {
+ ptqp = pp->sched.taskq;
+ if (!ptqp)
+ pp->sched.taskq = ptqp = port_taskq_init(port_taskq_alloc(), pp);
+ goto enqueue_free;
}
+ ASSERT(!pp->sched.taskq);
erts_smp_port_state_lock(pp);
pp->status &= ~ERTS_PORT_SFLG_CLOSING;
pp->status |= ERTS_PORT_SFLG_FREE_SCHEDULED;
erts_may_save_closed_port(pp);
erts_smp_port_state_unlock(pp);
-#ifdef ERTS_SMP
erts_smp_atomic_dec_nob(&pp->refc); /* Not alive */
-#endif
- ERTS_SMP_LC_ASSERT(erts_smp_atomic_read_nob(&pp->refc) > 0); /* Lock */
+ ERTS_LC_ASSERT(erts_smp_atomic_read_nob(&pp->refc) > 0); /* Lock */
handle_remaining_tasks(runq, pp); /* May release runq lock */
ASSERT(!pp->sched.exe_taskq && (!ptqp || !ptqp->first));
pp->sched.taskq = NULL;
ERTS_PT_CHK_PRES_PORTQ(runq, pp);
-#ifndef ERTS_SMP
- ASSERT(pp->status & ERTS_PORT_SFLG_PORT_DEBUG);
- erts_port_status_set(pp, ERTS_PORT_SFLG_FREE);
-#endif
erts_smp_runq_unlock(runq);
-
- if (erts_system_profile_flags.runnable_ports && port_is_dequeued) {
- profile_runnable_port(pp, am_inactive);
- }
-
- if (ptqp)
- port_taskq_free(ptqp);
}
}
@@ -723,7 +680,6 @@ typedef struct {
int
erts_port_task_execute(ErtsRunQueue *runq, Port **curr_port_pp)
{
- int port_was_enqueued = 0;
Port *pp;
ErtsPortTaskQueue *ptqp;
ErtsPortTask *ptp;
@@ -742,11 +698,18 @@ erts_port_task_execute(ErtsRunQueue *runq, Port **curr_port_pp)
goto done;
}
- ERTS_PORT_NOT_IN_RUNQ(pp);
+ ASSERT(pp->sched.in_runq);
+ pp->sched.in_runq = 0;
+ if (!pp->sched.taskq) {
+ if (erts_system_profile_flags.runnable_ports)
+ profile_runnable_port(pp, am_inactive);
+ res = (erts_smp_atomic_read_nob(&erts_port_task_outstanding_io_tasks)
+ != (erts_aint_t) 0);
+ goto done;
+ }
*curr_port_pp = pp;
- ASSERT(pp->sched.taskq);
ASSERT(pp->sched.taskq->first);
ptqp = pp->sched.taskq;
pp->sched.taskq = NULL;
@@ -808,12 +771,8 @@ erts_port_task_execute(ErtsRunQueue *runq, Port **curr_port_pp)
handle_remaining_tasks(runq, pp);
ASSERT(!ptqp->first
&& (!pp->sched.taskq || !pp->sched.taskq->first));
-#ifdef ERTS_SMP
erts_smp_atomic_dec_nob(&pp->refc); /* Not alive */
- ERTS_SMP_LC_ASSERT(erts_smp_atomic_read_nob(&pp->refc) > 0); /* Lock */
-#else
- erts_port_status_bor_set(pp, ERTS_PORT_SFLG_FREE);
-#endif
+ ERTS_LC_ASSERT(erts_smp_atomic_read_nob(&pp->refc) > 0); /* Lock */
port_task_free(ptp);
if (pp->sched.taskq)
@@ -823,12 +782,15 @@ erts_port_task_execute(ErtsRunQueue *runq, Port **curr_port_pp)
goto tasks_done;
case ERTS_PORT_TASK_TIMEOUT:
reds += ERTS_PORT_REDS_TIMEOUT;
- if (!(pp->status & ERTS_PORT_SFLGS_DEAD))
+ if (!(pp->status & ERTS_PORT_SFLGS_DEAD)) {
+ DTRACE_DRIVER(driver_timeout, pp);
(*pp->drv_ptr->timeout)((ErlDrvData) pp->drv_data);
+ }
break;
case ERTS_PORT_TASK_INPUT:
reds += ERTS_PORT_REDS_INPUT;
ASSERT((pp->status & ERTS_PORT_SFLGS_DEAD) == 0);
+ DTRACE_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, ptp->event);
io_tasks_executed++;
@@ -836,12 +798,14 @@ erts_port_task_execute(ErtsRunQueue *runq, Port **curr_port_pp)
case ERTS_PORT_TASK_OUTPUT:
reds += ERTS_PORT_REDS_OUTPUT;
ASSERT((pp->status & ERTS_PORT_SFLGS_DEAD) == 0);
+ DTRACE_DRIVER(driver_ready_output, pp);
(*pp->drv_ptr->ready_output)((ErlDrvData) pp->drv_data, ptp->event);
io_tasks_executed++;
break;
case ERTS_PORT_TASK_EVENT:
reds += ERTS_PORT_REDS_EVENT;
ASSERT((pp->status & ERTS_PORT_SFLGS_DEAD) == 0);
+ DTRACE_DRIVER(driver_event, pp);
(*pp->drv_ptr->event)((ErlDrvData) pp->drv_data, ptp->event, ptp->event_data);
io_tasks_executed++;
break;
@@ -898,6 +862,8 @@ erts_port_task_execute(ErtsRunQueue *runq, Port **curr_port_pp)
if (!pp->sched.taskq) {
ASSERT(pp->sched.exe_taskq);
pp->sched.exe_taskq = NULL;
+ if (erts_system_profile_flags.runnable_ports)
+ profile_runnable_port(pp, am_inactive);
}
else {
#ifdef ERTS_SMP
@@ -920,14 +886,20 @@ erts_port_task_execute(ErtsRunQueue *runq, Port **curr_port_pp)
else {
/* Port emigrated ... */
erts_smp_atomic_set_nob(&pp->run_queue, (erts_aint_t) xrunq);
- enqueue_port(xrunq, pp);
- ASSERT(pp->sched.exe_taskq);
- pp->sched.exe_taskq = NULL;
- erts_smp_runq_unlock(xrunq);
- erts_smp_notify_inc_runq(xrunq);
+ erts_smp_runq_unlock(runq);
+
+ xrunq = erts_port_runq(pp);
+ if (xrunq) {
+ enqueue_port(xrunq, pp);
+ ASSERT(pp->sched.exe_taskq);
+ pp->sched.exe_taskq = NULL;
+ erts_smp_runq_unlock(xrunq);
+ erts_smp_notify_inc_runq(xrunq);
+ }
+
+ erts_smp_runq_lock(runq);
}
#endif
- port_was_enqueued = 1;
}
res = (erts_smp_atomic_read_nob(&erts_port_task_outstanding_io_tasks)
@@ -937,10 +909,6 @@ erts_port_task_execute(ErtsRunQueue *runq, Port **curr_port_pp)
port_taskq_free(ptqp);
- if (erts_system_profile_flags.runnable_ports && (port_was_enqueued != 1)) {
- profile_runnable_port(pp, am_inactive);
- }
-
/* trace port scheduling, out */
if (IS_TRACED_FL(pp, F_TRACE_SCHED_PORTS)) {
trace_sched_ports(pp, am_out);
@@ -1029,63 +997,33 @@ erts_port_is_scheduled(Port *pp)
{
int res;
ErtsRunQueue *runq = erts_port_runq(pp);
+ if (!runq)
+ return 0;
res = pp->sched.taskq || pp->sched.exe_taskq;
erts_smp_runq_unlock(runq);
return res;
}
#ifdef ERTS_SMP
+void
+erts_enqueue_port(ErtsRunQueue *rq, Port *pp)
+{
+ ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(rq));
+ ASSERT(rq == (ErtsRunQueue *) erts_smp_atomic_read_nob(&pp->run_queue));
+ ASSERT(pp->sched.in_runq);
+ enqueue_port(rq, pp);
+}
-ErtsMigrateResult
-erts_port_migrate(Port *prt, int *prt_locked,
- ErtsRunQueue *from_rq, int *from_locked,
- ErtsRunQueue *to_rq, int *to_locked)
+Port *
+erts_dequeue_port(ErtsRunQueue *rq)
{
- ERTS_SMP_LC_ASSERT(*from_locked);
- ERTS_SMP_LC_CHK_RUNQ_LOCK(from_rq, *from_locked);
- ERTS_SMP_LC_CHK_RUNQ_LOCK(to_rq, *to_locked);
-
- if (!*from_locked || !*to_locked) {
- if (from_rq < to_rq) {
- if (!*to_locked) {
- if (!*from_locked)
- erts_smp_runq_lock(from_rq);
- erts_smp_runq_lock(to_rq);
- }
- else if (erts_smp_runq_trylock(from_rq) == EBUSY) {
- erts_smp_runq_unlock(to_rq);
- erts_smp_runq_lock(from_rq);
- erts_smp_runq_lock(to_rq);
- }
- }
- else {
- if (!*from_locked) {
- if (!*to_locked)
- erts_smp_runq_lock(to_rq);
- erts_smp_runq_lock(from_rq);
- }
- else if (erts_smp_runq_trylock(to_rq) == EBUSY) {
- erts_smp_runq_unlock(from_rq);
- erts_smp_runq_lock(to_rq);
- erts_smp_runq_lock(from_rq);
- }
- }
- *to_locked = *from_locked = 1;
- }
- ERTS_SMP_LC_CHK_RUNQ_LOCK(from_rq, *from_locked);
- ERTS_SMP_LC_CHK_RUNQ_LOCK(to_rq, *to_locked);
-
- /* Refuse to migrate to a suspended run queue */
- if (to_rq->flags & ERTS_RUNQ_FLG_SUSPENDED)
- return ERTS_MIGRATE_FAILED_RUNQ_SUSPENDED;
- if (from_rq != (ErtsRunQueue *) erts_smp_atomic_read_nob(&prt->run_queue))
- return ERTS_MIGRATE_FAILED_RUNQ_CHANGED;
- if (!ERTS_PORT_IS_IN_RUNQ(from_rq, prt))
- return ERTS_MIGRATE_FAILED_NOT_IN_RUNQ;
- dequeue_port(from_rq, prt);
- erts_smp_atomic_set_nob(&prt->run_queue, (erts_aint_t) to_rq);
- enqueue_port(to_rq, prt);
- return ERTS_MIGRATE_SUCCESS;
+ Port *pp;
+ ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(rq));
+ pp = pop_port(rq);
+ ASSERT(!pp
+ || rq == (ErtsRunQueue *) erts_smp_atomic_read_nob(&pp->run_queue));
+ ASSERT(!pp || pp->sched.in_runq);
+ return pp;
}
#endif
diff --git a/erts/emulator/beam/erl_port_task.h b/erts/emulator/beam/erl_port_task.h
index d7104e1143..fd88b1c1ff 100644
--- a/erts/emulator/beam/erl_port_task.h
+++ b/erts/emulator/beam/erl_port_task.h
@@ -62,7 +62,7 @@ typedef struct ErtsPortTaskQueue_ ErtsPortTaskQueue;
typedef struct {
Port *next;
- Port *prev;
+ int in_runq;
ErtsPortTaskQueue *taskq;
ErtsPortTaskQueue *exe_taskq;
} ErtsPortTaskSched;
@@ -92,7 +92,7 @@ ERTS_GLB_INLINE void
erts_port_task_init_sched(ErtsPortTaskSched *ptsp)
{
ptsp->next = NULL;
- ptsp->prev = NULL;
+ ptsp->in_runq = 0;
ptsp->taskq = NULL;
ptsp->exe_taskq = NULL;
}
@@ -123,13 +123,10 @@ int erts_port_task_schedule(Eterm,
ErlDrvEventData);
void erts_port_task_free_port(Port *);
int erts_port_is_scheduled(Port *);
+
#ifdef ERTS_SMP
-ErtsMigrateResult erts_port_migrate(Port *,
- int *,
- ErtsRunQueue *,
- int *,
- ErtsRunQueue *,
- int *);
+void erts_enqueue_port(ErtsRunQueue *rq, Port *pp);
+Port *erts_dequeue_port(ErtsRunQueue *rq);
#endif
#undef ERTS_INCLUDE_SCHEDULER_INTERNALS
#endif /* ERL_PORT_TASK_H__ */
diff --git a/erts/emulator/beam/erl_printf_term.c b/erts/emulator/beam/erl_printf_term.c
index 34da9cab84..2320b64295 100644
--- a/erts/emulator/beam/erl_printf_term.c
+++ b/erts/emulator/beam/erl_printf_term.c
@@ -437,7 +437,10 @@ print_term(fmtfn_t fn, void* arg, Eterm obj, long *dcount,
}
break;
case BINARY_DEF:
- {
+ if (header_is_bin_matchstate(*boxed_val(wobj))) {
+ PRINT_STRING(res, fn, arg, "#MatchState");
+ }
+ else {
ProcBin* pb = (ProcBin *) binary_val(wobj);
if (pb->size == 1)
PRINT_STRING(res, fn, arg, "<<1 byte>>");
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index 5469a59d8c..ddc43e621d 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -28,7 +28,6 @@
#include "erl_vm.h"
#include "global.h"
#include "erl_process.h"
-#include "erl_nmgc.h"
#include "error.h"
#include "bif.h"
#include "erl_db.h"
@@ -42,6 +41,7 @@
#include "erl_thr_progress.h"
#include "erl_thr_queue.h"
#include "erl_async.h"
+#include "dtrace-wrapper.h"
#define ERTS_RUNQ_CHECK_BALANCE_REDS_PER_SCHED (2000*CONTEXT_REDS)
#define ERTS_RUNQ_CALL_CHECK_BALANCE_REDS \
@@ -51,21 +51,22 @@
#define ERTS_SCHED_SPIN_UNTIL_YIELD 100
-#define ERTS_SCHED_SYS_SLEEP_SPINCOUNT 10
+#define ERTS_SCHED_SYS_SLEEP_SPINCOUNT_VERY_LONG 40
+#define ERTS_SCHED_AUX_WORK_SLEEP_SPINCOUNT_FACT_VERY_LONG 1000
+#define ERTS_SCHED_SYS_SLEEP_SPINCOUNT_LONG 20
+#define ERTS_SCHED_AUX_WORK_SLEEP_SPINCOUNT_FACT_LONG 1000
+#define ERTS_SCHED_SYS_SLEEP_SPINCOUNT_MEDIUM 10
+#define ERTS_SCHED_AUX_WORK_SLEEP_SPINCOUNT_FACT_MEDIUM 1000
+#define ERTS_SCHED_SYS_SLEEP_SPINCOUNT_SHORT 10
+#define ERTS_SCHED_AUX_WORK_SLEEP_SPINCOUNT_FACT_SHORT 0
+#define ERTS_SCHED_SYS_SLEEP_SPINCOUNT_VERY_SHORT 5
+#define ERTS_SCHED_AUX_WORK_SLEEP_SPINCOUNT_FACT_VERY_SHORT 0
+#define ERTS_SCHED_SYS_SLEEP_SPINCOUNT_NONE 0
+#define ERTS_SCHED_AUX_WORK_SLEEP_SPINCOUNT_FACT_NONE 0
+
#define ERTS_SCHED_TSE_SLEEP_SPINCOUNT_FACT 1000
-#define ERTS_SCHED_TSE_SLEEP_SPINCOUNT \
- (ERTS_SCHED_SYS_SLEEP_SPINCOUNT*ERTS_SCHED_TSE_SLEEP_SPINCOUNT_FACT)
#define ERTS_SCHED_SUSPEND_SLEEP_SPINCOUNT 0
-#define ERTS_WAKEUP_OTHER_LIMIT_VERY_HIGH (200*CONTEXT_REDS)
-#define ERTS_WAKEUP_OTHER_LIMIT_HIGH (50*CONTEXT_REDS)
-#define ERTS_WAKEUP_OTHER_LIMIT_MEDIUM (10*CONTEXT_REDS)
-#define ERTS_WAKEUP_OTHER_LIMIT_LOW (CONTEXT_REDS)
-#define ERTS_WAKEUP_OTHER_LIMIT_VERY_LOW (CONTEXT_REDS/10)
-
-#define ERTS_WAKEUP_OTHER_DEC 10
-#define ERTS_WAKEUP_OTHER_FIXED_INC (CONTEXT_REDS/10)
-
#if 0 || defined(DEBUG)
#define ERTS_FAKE_SCHED_BIND_PRINT_SORTED_CPU_DATA
#endif
@@ -93,33 +94,194 @@
#define HIGH_BIT (1 << PRIORITY_HIGH)
#define NORMAL_BIT (1 << PRIORITY_NORMAL)
#define LOW_BIT (1 << PRIORITY_LOW)
+#define PORT_BIT (1 << ERTS_PORT_PRIO_LEVEL)
+
+#define ERTS_EMPTY_RUNQ(RQ) \
+ ((ERTS_RUNQ_FLGS_GET_NOB((RQ)) & ERTS_RUNQ_FLGS_QMASK) == 0 \
+ && (RQ)->misc.start == NULL)
+
+#undef RUNQ_READ_RQ
+#undef RUNQ_SET_RQ
+#define RUNQ_READ_RQ(X) ((ErtsRunQueue *) erts_smp_atomic_read_nob((X)))
+#define RUNQ_SET_RQ(X, RQ) erts_smp_atomic_set_nob((X), (erts_aint_t) (RQ))
-#define ERTS_MAYBE_SAVE_TERMINATING_PROCESS(P) \
-do { \
- ERTS_SMP_LC_ASSERT(erts_lc_mtx_is_locked(&proc_tab_mtx)); \
- if (saved_term_procs.end) \
- save_terminating_process((P)); \
+#ifdef DEBUG
+# if defined(ARCH_64) && !HALFWORD_HEAP
+# define ERTS_DBG_SET_INVALID_RUNQP(RQP, N) \
+ (RUNQ_SET_RQ((RQP), (0xdeadbeefdead0003LL | ((N) << 4)))
+# define ERTS_DBG_VERIFY_VALID_RUNQP(RQP) \
+do { \
+ ASSERT((RQP) != NULL); \
+ ASSERT(((((Uint) (RQP)) & ((Uint) 0x3))) == ((Uint) 0)); \
+ ASSERT((((Uint) (RQP)) & ~((Uint) 0xffff)) != ((Uint) 0xdeadbeefdead0000LL));\
+} while (0)
+# else
+# define ERTS_DBG_SET_INVALID_RUNQP(RQP, N) \
+ (RUNQ_SET_RQ((RQP), (0xdead0003 | ((N) << 4))))
+# define ERTS_DBG_VERIFY_VALID_RUNQP(RQP) \
+do { \
+ ASSERT((RQP) != NULL); \
+ ASSERT(((((UWord) (RQP)) & ((UWord) 1))) == ((UWord) 0)); \
+ ASSERT((((UWord) (RQP)) & ~((UWord) 0xffff)) != ((UWord) 0xdead0000)); \
} while (0)
+# endif
+#else
+# define ERTS_DBG_SET_INVALID_RUNQP(RQP, N)
+# define ERTS_DBG_VERIFY_VALID_RUNQP(RQP)
+#endif
-#define ERTS_EMPTY_RUNQ(RQ) \
- ((RQ)->len == 0 && (RQ)->misc.start == NULL)
+#define ERTS_EMPTY_RUNQ_PORTS(RQ) \
+ (RUNQ_READ_LEN(&(RQ)->ports.info.len) == 0 && (RQ)->misc.start == NULL)
extern BeamInstr beam_apply[];
extern BeamInstr beam_exit[];
extern BeamInstr beam_continue_exit[];
-static Sint p_last;
-static Sint p_next;
-static Sint p_serial;
-static Uint p_serial_mask;
-static Uint p_serial_shift;
+#ifdef ARCH_32
+
+union {
+ erts_smp_dw_atomic_t pid_data;
+ char align[ERTS_CACHE_LINE_SIZE];
+} last erts_align_attribute(ERTS_CACHE_LINE_SIZE);
+
+
+static ERTS_INLINE Uint64
+dw_aint_to_uint64(erts_dw_aint_t *dw)
+{
+#ifdef ETHR_SU_DW_NAINT_T__
+ return (Uint64) dw->dw_sint;
+#else
+ Uint64 res;
+ res = (Uint64) ((Uint32) dw->sint[ERTS_DW_AINT_HIGH_WORD]);
+ res <<= 32;
+ res |= (Uint64) ((Uint32) dw->sint[ERTS_DW_AINT_LOW_WORD]);
+ return res;
+#endif
+}
+
+static void
+unint64_to_dw_aint(erts_dw_aint_t *dw, Uint64 val)
+{
+#ifdef ETHR_SU_DW_NAINT_T__
+ dw->dw_sint = (ETHR_SU_DW_NAINT_T__) val;
+#else
+ dw->sint[ERTS_DW_AINT_LOW_WORD] = (erts_aint_t) (val & 0xffffffff);
+ dw->sint[ERTS_DW_AINT_HIGH_WORD] = (erts_aint_t) ((val >> 32) & 0xffffffff);
+#endif
+}
+
+static ERTS_INLINE void
+last_pid_data_init_nob(Uint64 val)
+{
+ erts_dw_aint_t dw;
+ unint64_to_dw_aint(&dw, val);
+ erts_smp_dw_atomic_init_nob(&last.pid_data, &dw);
+}
+
+static ERTS_INLINE void
+last_pid_data_set_relb(Uint64 val)
+{
+ erts_dw_aint_t dw;
+ unint64_to_dw_aint(&dw, val);
+ erts_smp_dw_atomic_set_relb(&last.pid_data, &dw);
+}
+
+static ERTS_INLINE Uint64
+last_pid_data_read_nob(void)
+{
+ erts_dw_aint_t dw;
+ erts_smp_dw_atomic_read_nob(&last.pid_data, &dw);
+ return dw_aint_to_uint64(&dw);
+}
+
+static ERTS_INLINE Uint64
+last_pid_data_read_acqb(void)
+{
+ erts_dw_aint_t dw;
+ erts_smp_dw_atomic_read_acqb(&last.pid_data, &dw);
+ return dw_aint_to_uint64(&dw);
+}
+
+static ERTS_INLINE Uint64
+last_pid_data_cmpxchg_relb(Uint64 new, Uint64 exp)
+{
+ erts_dw_aint_t dw_new, dw_xchg;
+
+ unint64_to_dw_aint(&dw_new, new);
+ unint64_to_dw_aint(&dw_xchg, exp);
+
+ if (erts_smp_dw_atomic_cmpxchg_relb(&last.pid_data, &dw_new, &dw_xchg))
+ return exp;
+ else
+ return dw_aint_to_uint64(&dw_xchg);
+}
+
+#elif defined(ARCH_64)
+
+union {
+ erts_smp_atomic_t pid_data;
+ char align[ERTS_CACHE_LINE_SIZE];
+} last erts_align_attribute(ERTS_CACHE_LINE_SIZE);
+
+static ERTS_INLINE void
+last_pid_data_init_nob(Uint64 val)
+{
+ erts_smp_atomic_init_nob(&last.pid_data, (erts_aint_t) val);
+}
+
+static ERTS_INLINE void
+last_pid_data_set_relb(Uint64 val)
+{
+ erts_smp_atomic_set_relb(&last.pid_data, (erts_aint_t) val);
+}
+
+static ERTS_INLINE Uint64
+last_pid_data_read_nob(void)
+{
+ return (Uint64) erts_smp_atomic_read_nob(&last.pid_data);
+}
+
+static ERTS_INLINE Uint64
+last_pid_data_read_acqb(void)
+{
+ return (Uint64) erts_smp_atomic_read_acqb(&last.pid_data);
+}
+
+static ERTS_INLINE Uint64
+last_pid_data_cmpxchg_relb(Uint64 new, Uint64 exp)
+{
+ return (Uint64) erts_smp_atomic_cmpxchg_relb(&last.pid_data,
+ (erts_aint_t) new,
+ (erts_aint_t) exp);
+}
+
+#else
+# error "Not 64-bit, nor 32-bit architecture..."
+#endif
+
+static ERTS_INLINE int
+last_pid_data_cmp(Uint64 lpd1, Uint64 lpd2)
+{
+ Uint64 lpd1_wrap;
+
+ if (lpd1 == lpd2)
+ return 0;
+
+ lpd1_wrap = lpd1 + (((Uint64) 1) << 63);
+
+ if (lpd1 < lpd1_wrap)
+ return (lpd1 < lpd2 && lpd2 < lpd1_wrap) ? -1 : 1;
+ else
+ return (lpd1_wrap <= lpd2 && lpd2 < lpd1) ? 1 : -1;
+}
+
+
+#define ERTS_PID_DATA_MASK__ ((1 << _PID_DATA_SIZE) - 1)
int erts_sched_compact_load;
Uint erts_no_schedulers;
-Uint erts_max_processes = ERTS_DEFAULT_MAX_PROCESSES;
-Uint erts_process_tab_index_mask;
-static int wakeup_other_limit;
+ErtsProcTab erts_proc erts_align_attribute(ERTS_CACHE_LINE_SIZE);
int erts_sched_thread_suggested_stack_size = -1;
@@ -127,6 +289,12 @@ int erts_sched_thread_suggested_stack_size = -1;
ErtsLcPSDLocks erts_psd_required_locks[ERTS_PSD_SIZE];
#endif
+static struct {
+ int aux_work;
+ int tse;
+ int sys_schedule;
+} sched_busy_wait;
+
#ifdef ERTS_SMP
int erts_disable_proc_not_running_opt;
@@ -180,7 +348,7 @@ static struct {
struct {
int active_runqs;
int reds;
- int max_len;
+ erts_aint32_t max_len;
} prev_rise;
Uint n;
} balance_info;
@@ -200,7 +368,7 @@ erts_sched_stat_t erts_sched_stat;
static erts_tsd_key_t sched_data_key;
#endif
-static erts_smp_mtx_t proc_tab_mtx;
+erts_smp_rwmtx_t erts_proc_tab_rwmtx;
static erts_smp_atomic32_t function_calls;
@@ -223,12 +391,10 @@ typedef union {
static ErtsAlignedSchedulerSleepInfo *aligned_sched_sleep_info;
-Process** process_tab;
static Uint last_reductions;
static Uint last_exact_reductions;
Uint erts_default_process_flags;
Eterm erts_system_monitor;
-Eterm erts_system_monitor_msg_queue_len;
Eterm erts_system_monitor_long_gc;
Eterm erts_system_monitor_large_heap;
struct erts_system_monitor_flags_t erts_system_monitor_flags;
@@ -237,11 +403,6 @@ struct erts_system_monitor_flags_t erts_system_monitor_flags;
Eterm erts_system_profile;
struct erts_system_profile_flags_t erts_system_profile_flags;
-#ifdef HYBRID
-Uint erts_num_active_procs;
-Process** erts_active_procs;
-#endif
-
#if ERTS_MAX_PROCESSES > 0x7fffffff
#error "Need to store process_count in another type"
#endif
@@ -255,11 +416,11 @@ struct ErtsTermProcElement_ {
union {
struct {
Eterm pid;
- SysTimeval spawned;
- SysTimeval exited;
+ Uint64 spawned;
+ Uint64 exited;
} process;
struct {
- SysTimeval time;
+ Uint64 interval;
} bif_invocation;
} u;
};
@@ -348,40 +509,34 @@ dbg_chk_aux_work_val(erts_aint32_t value)
{
erts_aint32_t valid = 0;
-#ifdef ERTS_SSI_AUX_WORK_SET_TMO
valid |= ERTS_SSI_AUX_WORK_SET_TMO;
-#endif
-#ifdef ERTS_SSI_AUX_WORK_CHECK_CHILDREN
- valid |= ERTS_SSI_AUX_WORK_CHECK_CHILDREN;
-#endif
-#ifdef ERTS_SSI_AUX_WORK_MISC
valid |= ERTS_SSI_AUX_WORK_MISC;
-#endif
-#ifdef ERTS_SSI_AUX_WORK_MISC_THR_PRGR
- valid |= ERTS_SSI_AUX_WORK_MISC_THR_PRGR;
-#endif
-#ifdef ERTS_SSI_AUX_WORK_ASYNC_READY
- valid |= ERTS_SSI_AUX_WORK_ASYNC_READY;
-#endif
-#ifdef ERTS_SSI_AUX_WORK_ASYNC_READY_CLEAN
- valid |= ERTS_SSI_AUX_WORK_ASYNC_READY_CLEAN;
-#endif
-
-#ifdef ERTS_SSI_AUX_WORK_FIX_ALLOC_LOWER_LIM
valid |= ERTS_SSI_AUX_WORK_FIX_ALLOC_LOWER_LIM;
-#endif
-#ifdef ERTS_SSI_AUX_WORK_FIX_ALLOC_DEALLOC
valid |= ERTS_SSI_AUX_WORK_FIX_ALLOC_DEALLOC;
+#if ERTS_USE_ASYNC_READY_Q
+ valid |= ERTS_SSI_AUX_WORK_ASYNC_READY;
+ valid |= ERTS_SSI_AUX_WORK_ASYNC_READY_CLEAN;
#endif
-#ifdef ERTS_SSI_AUX_WORK_DD
+#ifdef ERTS_SMP
+ valid |= ERTS_SSI_AUX_WORK_DELAYED_AW_WAKEUP;
+ valid |= ERTS_SSI_AUX_WORK_MISC_THR_PRGR;
valid |= ERTS_SSI_AUX_WORK_DD;
-#endif
-#ifdef ERTS_SSI_AUX_WORK_DD
valid |= ERTS_SSI_AUX_WORK_DD_THR_PRGR;
+ valid |= ERTS_SSI_AUX_WORK_THR_PRGR_LATER_OP;
#endif
-#ifdef ERTS_SSI_AUX_WORK_MSEG_CACHE_CHECK
+#if HAVE_ERTS_MSEG
valid |= ERTS_SSI_AUX_WORK_MSEG_CACHE_CHECK;
#endif
+#ifdef ERTS_SMP_SCHEDULERS_NEED_TO_CHECK_CHILDREN
+ valid |= ERTS_SSI_AUX_WORK_CHECK_CHILDREN;
+#endif
+#ifdef ERTS_SMP
+ valid |= ERTS_SSI_AUX_WORK_CODE_IX_ACTIVATION;
+ valid |= ERTS_SSI_AUX_WORK_FINISH_BP;
+#endif
+#ifdef ERTS_SSI_AUX_WORK_REAP_PORTS
+ valid |= ERTS_SSI_AUX_WORK_REAP_PORTS;
+#endif
if (~valid & value)
erl_exit(ERTS_ABORT_EXIT,
@@ -408,6 +563,53 @@ erts_smp_lc_runq_is_locked(ErtsRunQueue *runq)
}
#endif
+static erts_interval_t *proc_interval;
+
+static void
+proc_interval_init(void)
+{
+ proc_interval = erts_alloc_permanent_cache_aligned(
+ ERTS_ALC_T_PROC_INTERVAL,
+ sizeof(erts_interval_t));
+ erts_smp_interval_init(proc_interval);
+}
+
+static ERTS_INLINE Uint64
+get_proc_interval(void)
+{
+ return erts_smp_current_interval_nob(proc_interval);
+}
+
+static ERTS_INLINE Uint64
+ensure_later_proc_interval(Uint64 interval)
+{
+ return erts_smp_ensure_later_interval_nob(proc_interval, interval);
+}
+
+static ERTS_INLINE Uint64
+step_proc_interval(void)
+{
+ return erts_smp_step_interval_nob(proc_interval);
+}
+
+Uint64
+erts_get_proc_interval(void)
+{
+ return get_proc_interval();
+}
+
+Uint64
+erts_ensure_later_proc_interval(Uint64 interval)
+{
+ return ensure_later_proc_interval(interval);
+}
+
+Uint64
+erts_step_proc_interval(void)
+{
+ return step_proc_interval();
+}
+
void
erts_pre_init_process(void)
{
@@ -457,7 +659,16 @@ erts_pre_init_process(void)
void
erts_init_process(int ncpu)
{
- Uint proc_bits = ERTS_PROC_BITS;
+ int proc_tab_sz;
+ int max_proc_bits;
+ int proc_bits = ERTS_PROC_BITS;
+ erts_smp_atomic_t *proc_entry;
+ char *proc_tab_end;
+ erts_smp_rwmtx_opt_t proc_tab_rwmtx_opts = ERTS_SMP_RWMTX_OPT_DEFAULT_INITER;
+ proc_tab_rwmtx_opts.type = ERTS_SMP_RWMTX_TYPE_EXTREMELY_FREQUENT_READ;
+ proc_tab_rwmtx_opts.lived = ERTS_SMP_RWMTX_LONG_LIVED;
+
+ proc_interval_init();
#ifdef ERTS_SMP
erts_disable_proc_not_running_opt = 0;
@@ -468,29 +679,51 @@ erts_init_process(int ncpu)
erts_smp_atomic32_init_nob(&process_count, 0);
- if (erts_use_r9_pids_ports) {
+ if (erts_use_r9_pids_ports)
proc_bits = ERTS_R9_PROC_BITS;
- ASSERT(erts_max_processes <= (1 << ERTS_R9_PROC_BITS));
+
+ if (erts_proc.max > (1 << proc_bits))
+ erts_proc.max = 1 << proc_bits;
+
+ proc_tab_sz = ERTS_ALC_CACHE_LINE_ALIGN_SIZE(erts_proc.max
+ * sizeof(erts_smp_atomic_t));
+ erts_proc.tab = erts_alloc(ERTS_ALC_T_PROC_TABLE, proc_tab_sz);
+ proc_tab_end = ((char *) erts_proc.tab) + proc_tab_sz;
+ proc_entry = erts_proc.tab;
+ while (proc_tab_end > ((char *) proc_entry)) {
+ erts_smp_atomic_init_nob(proc_entry, ERTS_AINT_NULL);
+ proc_entry++;
}
- process_tab = (Process**) erts_alloc(ERTS_ALC_T_PROC_TABLE,
- erts_max_processes*sizeof(Process*));
- sys_memzero(process_tab, erts_max_processes * sizeof(Process*));
-#ifdef HYBRID
- erts_active_procs = (Process**)
- erts_alloc(ERTS_ALC_T_ACTIVE_PROCS,
- erts_max_processes * sizeof(Process*));
- erts_num_active_procs = 0;
-#endif
+ erts_smp_rwmtx_init_opt(&erts_proc_tab_rwmtx,
+ &proc_tab_rwmtx_opts,
+ "proc_tab");
+ last_pid_data_init_nob(~((Uint64) 0));
+
+ max_proc_bits = erts_fit_in_bits_int32((Sint32) erts_proc.max - 1);
- erts_smp_mtx_init(&proc_tab_mtx, "proc_tab");
- p_last = -1;
- p_next = 0;
- p_serial = 0;
+ erts_proc.tab_cache_lines = proc_tab_sz/ERTS_CACHE_LINE_SIZE;
+ erts_proc.pix_per_cache_line = ERTS_CACHE_LINE_SIZE/sizeof(erts_smp_atomic_t);
+ if ((erts_proc.max & (erts_proc.max - 1))
+ | (erts_proc.pix_per_cache_line & (erts_proc.pix_per_cache_line - 1))) {
+ /*
+ * erts_proc.max or erts_proc.pix_per_cache_line
+ * not a power of 2 :(
+ */
+ erts_proc.pix_cl_mask = 0;
+ erts_proc.pix_cl_shift = 0;
+ erts_proc.pix_cli_mask = 0;
+ erts_proc.pix_cli_shift = 0;
+ }
+ else {
+ ASSERT((erts_proc.tab_cache_lines
+ & (erts_proc.tab_cache_lines - 1)) == 0);
+ erts_proc.pix_cl_mask = erts_proc.tab_cache_lines-1;
+ erts_proc.pix_cl_shift = erts_fit_in_bits_int32(erts_proc.pix_per_cache_line-1);
+ erts_proc.pix_cli_shift = erts_fit_in_bits_int32(erts_proc.pix_cl_mask);
+ erts_proc.pix_cli_mask = (1 << (max_proc_bits - erts_proc.pix_cli_shift)) - 1;
+ }
- p_serial_shift = erts_fit_in_bits(erts_max_processes - 1);
- p_serial_mask = ((~(~((Uint) 0) << proc_bits)) >> p_serial_shift);
- erts_process_tab_index_mask = ~(~((Uint) 0) << p_serial_shift);
last_reductions = 0;
last_exact_reductions = 0;
erts_default_process_flags = 0;
@@ -537,12 +770,220 @@ erts_late_init_process(void)
}
+static void
+init_sched_wall_time(ErtsSchedWallTime *swtp)
+{
+ swtp->enabled = 0;
+ swtp->start = 0;
+ swtp->working.total = 0;
+ swtp->working.start = 0;
+ swtp->working.currently = 0;
+}
+
+static ERTS_INLINE Uint64
+sched_wall_time_ts(void)
+{
+#ifdef HAVE_GETHRTIME
+ return (Uint64) sys_gethrtime();
+#else
+ Uint64 res;
+ SysTimeval tv;
+ sys_gettimeofday(&tv);
+ res = (Uint64) tv.tv_sec*1000000;
+ res += (Uint64) tv.tv_usec;
+ return res;
+#endif
+}
+
+static ERTS_INLINE void
+sched_wall_time_change(ErtsSchedulerData *esdp, int working)
+{
+ if (esdp->sched_wall_time.enabled) {
+ Uint64 ts = sched_wall_time_ts();
+ if (working) {
+#ifdef DEBUG
+ ASSERT(!esdp->sched_wall_time.working.currently);
+ esdp->sched_wall_time.working.currently = 1;
+#endif
+ ts -= esdp->sched_wall_time.start;
+ esdp->sched_wall_time.working.start = ts;
+ }
+ else {
+#ifdef DEBUG
+ ASSERT(esdp->sched_wall_time.working.currently);
+ esdp->sched_wall_time.working.currently = 0;
+#endif
+ ts -= esdp->sched_wall_time.start;
+ ts -= esdp->sched_wall_time.working.start;
+ esdp->sched_wall_time.working.total += ts;
+ }
+ }
+}
+
+typedef struct {
+ int set;
+ int enable;
+ Process *proc;
+ Eterm ref;
+ Eterm ref_heap[REF_THING_SIZE];
+ Uint req_sched;
+ erts_smp_atomic32_t refc;
+} ErtsSchedWallTimeReq;
+
+#if !HALFWORD_HEAP
+ERTS_SCHED_PREF_QUICK_ALLOC_IMPL(swtreq,
+ ErtsSchedWallTimeReq,
+ 5,
+ ERTS_ALC_T_SCHED_WTIME_REQ)
+#else
+static ERTS_INLINE ErtsSchedWallTimeReq *
+swtreq_alloc(void)
+{
+ return erts_alloc(ERTS_ALC_T_SCHED_WTIME_REQ,
+ sizeof(ErtsSchedWallTimeReq));
+}
+
+static ERTS_INLINE void
+swtreq_free(ErtsSchedWallTimeReq *ptr)
+{
+ erts_free(ERTS_ALC_T_SCHED_WTIME_REQ, ptr);
+}
+#endif
+
+static void
+reply_sched_wall_time(void *vswtrp)
+{
+ Uint64 working = 0, total = 0;
+ ErtsSchedulerData *esdp = erts_get_scheduler_data();
+ ErtsSchedWallTimeReq *swtrp = (ErtsSchedWallTimeReq *) vswtrp;
+ ErtsProcLocks rp_locks = (swtrp->req_sched == esdp->no
+ ? ERTS_PROC_LOCK_MAIN
+ : 0);
+ Process *rp = swtrp->proc;
+ Eterm ref_copy = NIL, msg;
+ Eterm *hp = NULL;
+ Eterm **hpp;
+ Uint sz, *szp;
+ ErlOffHeap *ohp = NULL;
+ ErlHeapFragment *bp = NULL;
+
+ ASSERT(esdp);
+
+ if (swtrp->set) {
+ if (!swtrp->enable && esdp->sched_wall_time.enabled)
+ esdp->sched_wall_time.enabled = 0;
+ else if (swtrp->enable && !esdp->sched_wall_time.enabled) {
+ Uint64 ts = sched_wall_time_ts();
+ esdp->sched_wall_time.enabled = 1;
+ esdp->sched_wall_time.start = ts;
+ esdp->sched_wall_time.working.total = 0;
+ esdp->sched_wall_time.working.start = 0;
+ esdp->sched_wall_time.working.currently = 1;
+ }
+ }
+
+ if (esdp->sched_wall_time.enabled) {
+ Uint64 ts = sched_wall_time_ts();
+ ASSERT(esdp->sched_wall_time.working.currently);
+ ts -= esdp->sched_wall_time.start;
+ total = ts;
+ ts -= esdp->sched_wall_time.working.start;
+ working = esdp->sched_wall_time.working.total + ts;
+ }
+
+ sz = 0;
+ hpp = NULL;
+ szp = &sz;
+
+ while (1) {
+ if (hpp)
+ ref_copy = STORE_NC(hpp, ohp, swtrp->ref);
+ else
+ *szp += REF_THING_SIZE;
+
+ if (swtrp->set)
+ msg = ref_copy;
+ else {
+ msg = (!esdp->sched_wall_time.enabled
+ ? am_notsup
+ : erts_bld_tuple(hpp, szp, 3,
+ make_small(esdp->no),
+ erts_bld_uint64(hpp, szp, working),
+ erts_bld_uint64(hpp, szp, total)));
+
+ msg = erts_bld_tuple(hpp, szp, 2, ref_copy, msg);
+ }
+ if (hpp)
+ break;
+
+ hp = erts_alloc_message_heap(sz, &bp, &ohp, rp, &rp_locks);
+ szp = NULL;
+ hpp = &hp;
+ }
+
+ erts_queue_message(rp, &rp_locks, bp, msg, NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
+
+ if (swtrp->req_sched == esdp->no)
+ rp_locks &= ~ERTS_PROC_LOCK_MAIN;
+
+ if (rp_locks)
+ erts_smp_proc_unlock(rp, rp_locks);
+
+ erts_smp_proc_dec_refc(rp);
+
+ if (erts_smp_atomic32_dec_read_nob(&swtrp->refc) == 0)
+ swtreq_free(vswtrp);
+}
+
+Eterm
+erts_sched_wall_time_request(Process *c_p, int set, int enable)
+{
+ ErtsSchedulerData *esdp = ERTS_PROC_GET_SCHDATA(c_p);
+ Eterm ref;
+ ErtsSchedWallTimeReq *swtrp;
+ Eterm *hp;
+
+ if (!set && !esdp->sched_wall_time.enabled)
+ return THE_NON_VALUE;
+
+ swtrp = swtreq_alloc();
+ ref = erts_make_ref(c_p);
+ hp = &swtrp->ref_heap[0];
+
+ swtrp->set = set;
+ swtrp->enable = enable;
+ swtrp->proc = c_p;
+ swtrp->ref = STORE_NC(&hp, NULL, ref);
+ swtrp->req_sched = esdp->no;
+ erts_smp_atomic32_init_nob(&swtrp->refc,
+ (erts_aint32_t) erts_no_schedulers);
+
+ erts_smp_proc_add_refc(c_p, (Sint32) erts_no_schedulers);
+
+#ifdef ERTS_SMP
+ if (erts_no_schedulers > 1)
+ erts_schedule_multi_misc_aux_work(1,
+ erts_no_schedulers,
+ reply_sched_wall_time,
+ (void *) swtrp);
+#endif
+
+ reply_sched_wall_time((void *) swtrp);
+
+ return ref;
+}
+
static ERTS_INLINE ErtsProcList *
proclist_create(Process *p)
{
ErtsProcList *plp = proclist_alloc();
+ ensure_later_proc_interval(p->started_interval);
plp->pid = p->id;
- plp->started = p->started;
+ plp->started_interval = p->started_interval;
return plp;
}
@@ -555,8 +996,7 @@ proclist_destroy(ErtsProcList *plp)
static ERTS_INLINE int
proclist_same(ErtsProcList *plp, Process *p)
{
- return (plp->pid == p->id
- && erts_cmp_timeval(&plp->started, &p->started) == 0);
+ return plp->pid == p->id && plp->started_interval == p->started_interval;
}
ErtsProcList *
@@ -674,8 +1114,6 @@ set_aux_work_flags_wakeup_nob(ErtsSchedulerSleepInfo *ssi,
}
}
-#if 0 /* Currently not used */
-
static ERTS_INLINE void
set_aux_work_flags_wakeup_relb(ErtsSchedulerSleepInfo *ssi,
erts_aint32_t flgs)
@@ -695,8 +1133,6 @@ set_aux_work_flags_wakeup_relb(ErtsSchedulerSleepInfo *ssi,
}
}
-#endif
-
static ERTS_INLINE erts_aint32_t
set_aux_work_flags(ErtsSchedulerSleepInfo *ssi, erts_aint32_t flgs)
{
@@ -709,6 +1145,81 @@ unset_aux_work_flags(ErtsSchedulerSleepInfo *ssi, erts_aint32_t flgs)
return erts_atomic32_read_band_nob(&ssi->aux_work, ~flgs);
}
+#ifdef ERTS_SMP
+
+static ERTS_INLINE void
+haw_thr_prgr_current_reset(ErtsAuxWorkData *awdp)
+{
+ awdp->current_thr_prgr = ERTS_THR_PRGR_INVALID;
+}
+
+static ERTS_INLINE ErtsThrPrgrVal
+haw_thr_prgr_current(ErtsAuxWorkData *awdp)
+{
+ ErtsThrPrgrVal current = awdp->current_thr_prgr;
+ if (current == ERTS_THR_PRGR_INVALID) {
+ current = erts_thr_progress_current();
+ awdp->current_thr_prgr = current;
+ }
+ return current;
+}
+
+static ERTS_INLINE void
+haw_thr_prgr_current_check_progress(ErtsAuxWorkData *awdp)
+{
+ ErtsThrPrgrVal current = awdp->current_thr_prgr;
+ if (current != ERTS_THR_PRGR_INVALID
+ && !erts_thr_progress_equal(current, erts_thr_progress_current())) {
+ /*
+ * We have used a previouly read current value that isn't the
+ * latest; need to poke ourselfs in order to guarantee no loss
+ * of wakeups.
+ */
+ erts_sched_poke(awdp->ssi);
+ }
+}
+
+static ERTS_INLINE erts_aint32_t
+handle_delayed_aux_work_wakeup(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
+{
+ int jix, max_jix;
+ unset_aux_work_flags(awdp->ssi, ERTS_SSI_AUX_WORK_DELAYED_AW_WAKEUP);
+
+ ERTS_THR_MEMORY_BARRIER;
+
+ max_jix = awdp->delayed_wakeup.jix;
+ awdp->delayed_wakeup.jix = -1;
+ for (jix = 0; jix <= max_jix; jix++) {
+ int sched = awdp->delayed_wakeup.job[jix].sched;
+ erts_aint32_t aux_work = awdp->delayed_wakeup.job[jix].aux_work;
+
+ ASSERT(awdp->delayed_wakeup.sched2jix[sched] == jix);
+ awdp->delayed_wakeup.sched2jix[sched] = -1;
+ set_aux_work_flags_wakeup_nob(ERTS_SCHED_SLEEP_INFO_IX(sched-1),
+ aux_work);
+ }
+ return aux_work & ~ERTS_SSI_AUX_WORK_DELAYED_AW_WAKEUP;
+}
+
+static ERTS_INLINE void
+schedule_aux_work_wakeup(ErtsAuxWorkData *awdp, int sched, erts_aint32_t aux_work)
+{
+ int jix = awdp->delayed_wakeup.sched2jix[sched];
+ if (jix >= 0) {
+ ASSERT(awdp->delayed_wakeup.job[jix].sched == sched);
+ awdp->delayed_wakeup.job[jix].aux_work |= aux_work;
+ }
+ else {
+ jix = ++awdp->delayed_wakeup.jix;
+ awdp->delayed_wakeup.sched2jix[sched] = jix;
+ awdp->delayed_wakeup.job[jix].sched = sched;
+ awdp->delayed_wakeup.job[jix].aux_work = aux_work;
+ }
+ set_aux_work_flags_wakeup_nob(awdp->ssi, ERTS_SSI_AUX_WORK_DELAYED_AW_WAKEUP);
+}
+
+#endif
+
typedef struct erts_misc_aux_work_t_ erts_misc_aux_work_t;
struct erts_misc_aux_work_t_ {
void (*func)(void *);
@@ -781,7 +1292,7 @@ misc_aux_work_clean(ErtsThrQ_t *q,
return aux_work;
}
-static erts_aint32_t
+static ERTS_INLINE erts_aint32_t
handle_misc_aux_work(ErtsAuxWorkData *awdp,
erts_aint32_t aux_work)
{
@@ -801,12 +1312,13 @@ handle_misc_aux_work(ErtsAuxWorkData *awdp,
#ifdef ERTS_SMP
-static erts_aint32_t
+static ERTS_INLINE erts_aint32_t
handle_misc_aux_work_thr_prgr(ErtsAuxWorkData *awdp,
erts_aint32_t aux_work)
{
- if (!erts_thr_progress_has_reached(awdp->misc.thr_prgr))
- return aux_work;
+ if (!erts_thr_progress_has_reached_this(haw_thr_prgr_current(awdp),
+ awdp->misc.thr_prgr))
+ return aux_work & ~ERTS_SSI_AUX_WORK_MISC_THR_PRGR;
unset_aux_work_flags(awdp->ssi, ERTS_SSI_AUX_WORK_MISC_THR_PRGR);
@@ -879,7 +1391,7 @@ erts_notify_check_async_ready_queue(void *vno)
ERTS_SSI_AUX_WORK_ASYNC_READY);
}
-static erts_aint32_t
+static ERTS_INLINE erts_aint32_t
handle_async_ready(ErtsAuxWorkData *awdp,
erts_aint32_t aux_work)
{
@@ -901,7 +1413,7 @@ handle_async_ready(ErtsAuxWorkData *awdp,
| ERTS_SSI_AUX_WORK_ASYNC_READY_CLEAN);
}
-static erts_aint32_t
+static ERTS_INLINE erts_aint32_t
handle_async_ready_clean(ErtsAuxWorkData *awdp,
erts_aint32_t aux_work)
{
@@ -909,7 +1421,8 @@ handle_async_ready_clean(ErtsAuxWorkData *awdp,
#ifdef ERTS_SMP
if (awdp->async_ready.need_thr_prgr
- && !erts_thr_progress_has_reached(awdp->async_ready.thr_prgr)) {
+ && !erts_thr_progress_has_reached_this(haw_thr_prgr_current(awdp),
+ awdp->async_ready.thr_prgr)) {
return aux_work & ~ERTS_SSI_AUX_WORK_ASYNC_READY_CLEAN;
}
@@ -935,9 +1448,96 @@ handle_async_ready_clean(ErtsAuxWorkData *awdp,
}
}
+#endif /* ERTS_USE_ASYNC_READY_Q */
+
+#ifdef ERTS_SMP
+void
+erts_notify_code_ix_activation(Process* p, ErtsThrPrgrVal later)
+{
+ ErtsAuxWorkData* awdp = &p->scheduler_data->aux_work_data;
+ ASSERT(awdp->code_ix_activation.code_stager == NULL);
+ awdp->code_ix_activation.code_stager = p;
+ awdp->code_ix_activation.thr_prgr = later;
+ erts_smp_proc_inc_refc(p);
+ set_aux_work_flags_wakeup_relb(p->scheduler_data->ssi,
+ ERTS_SSI_AUX_WORK_CODE_IX_ACTIVATION);
+}
+
+static erts_aint32_t
+handle_code_ix_activation(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
+{
+ Process* p;
+ if (!erts_thr_progress_has_reached(awdp->code_ix_activation.thr_prgr)) {
+ return aux_work & ~ERTS_SSI_AUX_WORK_CODE_IX_ACTIVATION;
+ }
+ unset_aux_work_flags(awdp->ssi, ERTS_SSI_AUX_WORK_CODE_IX_ACTIVATION);
+ p = awdp->code_ix_activation.code_stager;
+ ASSERT(p);
+#ifdef DEBUG
+ awdp->code_ix_activation.code_stager = NULL;
#endif
+ erts_commit_staging_code_ix();
+ erts_release_code_write_permission();
+ erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS);
+ if (!ERTS_PROC_IS_EXITING(p)) {
+ erts_resume(p, ERTS_PROC_LOCK_STATUS);
+ }
+ erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
+ erts_smp_proc_dec_refc(p);
+ return aux_work & ~ERTS_SSI_AUX_WORK_CODE_IX_ACTIVATION;
+}
+#endif /* ERTS_SMP */
+
+#ifdef ERTS_SMP
+void
+erts_notify_finish_breakpointing(Process* p)
+{
+ ErtsAuxWorkData* awdp = &p->scheduler_data->aux_work_data;
+
+ ASSERT(awdp->bp_ix_activation.stager == NULL);
+ awdp->bp_ix_activation.stager = p;
+ awdp->bp_ix_activation.thr_prgr = erts_thr_progress_later(awdp->esdp);
+ erts_thr_progress_wakeup(awdp->esdp, awdp->bp_ix_activation.thr_prgr);
+ erts_smp_proc_inc_refc(p);
+ set_aux_work_flags_wakeup_relb(p->scheduler_data->ssi,
+ ERTS_SSI_AUX_WORK_FINISH_BP);
+}
static erts_aint32_t
+handle_finish_bp(ErtsAuxWorkData* awdp, erts_aint32_t aux_work)
+{
+ ErtsThrPrgrVal current = haw_thr_prgr_current(awdp);
+
+ if (!erts_thr_progress_has_reached_this(current,
+ awdp->bp_ix_activation.thr_prgr)) {
+ return aux_work & ~ERTS_SSI_AUX_WORK_FINISH_BP;
+ }
+ if (erts_finish_breakpointing()) { /* Not done */
+ /* Arrange for being called again */
+ awdp->bp_ix_activation.thr_prgr =
+ erts_thr_progress_later(awdp->esdp);
+ erts_thr_progress_wakeup(awdp->esdp, awdp->bp_ix_activation.thr_prgr);
+ } else { /* Done */
+ Process* p;
+
+ unset_aux_work_flags(awdp->ssi, ERTS_SSI_AUX_WORK_FINISH_BP);
+ p = awdp->bp_ix_activation.stager;
+#ifdef DEBUG
+ awdp->bp_ix_activation.stager = NULL;
+#endif
+ erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS);
+ if (!ERTS_PROC_IS_EXITING(p)) {
+ erts_resume(p, ERTS_PROC_LOCK_STATUS);
+ }
+ erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
+ erts_smp_proc_dec_refc(p);
+ erts_release_code_write_permission();
+ }
+ return aux_work & ~ERTS_SSI_AUX_WORK_FINISH_BP;
+}
+#endif /* ERTS_SMP */
+
+static ERTS_INLINE erts_aint32_t
handle_fix_alloc(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
{
ErtsSchedulerSleepInfo *ssi = awdp->ssi;
@@ -961,20 +1561,28 @@ handle_fix_alloc(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
void
erts_alloc_notify_delayed_dealloc(int ix)
{
- set_aux_work_flags_wakeup_nob(ERTS_SCHED_SLEEP_INFO_IX(ix-1),
- ERTS_SSI_AUX_WORK_DD);
+ ErtsSchedulerData *esdp = erts_get_scheduler_data();
+ if (esdp)
+ schedule_aux_work_wakeup(&esdp->aux_work_data,
+ ix,
+ ERTS_SSI_AUX_WORK_DD);
+ else
+ set_aux_work_flags_wakeup_relb(ERTS_SCHED_SLEEP_INFO_IX(ix-1),
+ ERTS_SSI_AUX_WORK_DD);
}
-static erts_aint32_t
+static ERTS_INLINE erts_aint32_t
handle_delayed_dealloc(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
{
ErtsSchedulerSleepInfo *ssi = awdp->ssi;
int need_thr_progress = 0;
+ ErtsThrPrgrVal wakeup = ERTS_THR_PRGR_INVALID;
int more_work = 0;
unset_aux_work_flags(ssi, ERTS_SSI_AUX_WORK_DD);
erts_alloc_scheduler_handle_delayed_dealloc((void *) awdp->esdp,
&need_thr_progress,
+ &wakeup,
&more_work);
if (more_work) {
if (set_aux_work_flags(ssi, ERTS_SSI_AUX_WORK_DD)
@@ -986,9 +1594,12 @@ handle_delayed_dealloc(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
}
if (need_thr_progress) {
+ if (wakeup == ERTS_THR_PRGR_INVALID)
+ wakeup = erts_thr_progress_later(awdp->esdp);
+ awdp->dd.thr_prgr = wakeup;
set_aux_work_flags(ssi, ERTS_SSI_AUX_WORK_DD_THR_PRGR);
- awdp->dd.thr_prgr = erts_thr_progress_later();
- erts_thr_progress_wakeup(awdp->esdp, awdp->dd.thr_prgr);
+ awdp->dd.thr_prgr = wakeup;
+ erts_thr_progress_wakeup(awdp->esdp, wakeup);
}
else if (awdp->dd.completed_callback) {
awdp->dd.completed_callback(awdp->dd.completed_arg);
@@ -998,14 +1609,16 @@ handle_delayed_dealloc(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
return aux_work & ~ERTS_SSI_AUX_WORK_DD;
}
-static erts_aint32_t
+static ERTS_INLINE erts_aint32_t
handle_delayed_dealloc_thr_prgr(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
{
ErtsSchedulerSleepInfo *ssi;
int need_thr_progress;
int more_work;
+ ErtsThrPrgrVal wakeup = ERTS_THR_PRGR_INVALID;
+ ErtsThrPrgrVal current = haw_thr_prgr_current(awdp);
- if (!erts_thr_progress_has_reached(awdp->dd.thr_prgr))
+ if (!erts_thr_progress_has_reached_this(current, awdp->dd.thr_prgr))
return aux_work & ~ERTS_SSI_AUX_WORK_DD_THR_PRGR;
ssi = awdp->ssi;
@@ -1014,6 +1627,7 @@ handle_delayed_dealloc_thr_prgr(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
erts_alloc_scheduler_handle_delayed_dealloc((void *) awdp->esdp,
&need_thr_progress,
+ &wakeup,
&more_work);
if (more_work) {
set_aux_work_flags(ssi, ERTS_SSI_AUX_WORK_DD);
@@ -1023,8 +1637,10 @@ handle_delayed_dealloc_thr_prgr(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
}
if (need_thr_progress) {
- awdp->dd.thr_prgr = erts_thr_progress_later();
- erts_thr_progress_wakeup(awdp->esdp, awdp->dd.thr_prgr);
+ if (wakeup == ERTS_THR_PRGR_INVALID)
+ wakeup = erts_thr_progress_later(awdp->esdp);
+ awdp->dd.thr_prgr = wakeup;
+ erts_thr_progress_wakeup(awdp->esdp, wakeup);
}
else {
unset_aux_work_flags(ssi, ERTS_SSI_AUX_WORK_DD_THR_PRGR);
@@ -1038,6 +1654,74 @@ handle_delayed_dealloc_thr_prgr(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
return aux_work & ~ERTS_SSI_AUX_WORK_DD_THR_PRGR;
}
+/*
+ * Handle scheduled thread progress later operations.
+ */
+#define ERTS_MAX_THR_PRGR_LATER_OPS 50
+
+static ERTS_INLINE erts_aint32_t
+handle_thr_prgr_later_op(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
+{
+ int lops;
+ ErtsThrPrgrVal current = haw_thr_prgr_current(awdp);
+
+ for (lops = 0; lops < ERTS_MAX_THR_PRGR_LATER_OPS; lops++) {
+ ErtsThrPrgrLaterOp *lop = awdp->later_op.first;
+ if (!erts_thr_progress_has_reached_this(current, lop->later))
+ return aux_work & ~ERTS_SSI_AUX_WORK_THR_PRGR_LATER_OP;
+ awdp->later_op.first = lop->next;
+ lop->func(lop->data);
+ if (!awdp->later_op.first) {
+ awdp->later_op.last = NULL;
+ unset_aux_work_flags(awdp->ssi,
+ ERTS_SSI_AUX_WORK_THR_PRGR_LATER_OP);
+ return aux_work & ~ERTS_SSI_AUX_WORK_THR_PRGR_LATER_OP;
+ }
+ }
+
+ return aux_work;
+}
+
+#endif /* ERTS_SMP */
+
+void
+erts_schedule_thr_prgr_later_op(void (*later_func)(void *),
+ void *later_data,
+ ErtsThrPrgrLaterOp *lop)
+{
+#ifndef ERTS_SMP
+ later_func(later_data);
+#else
+ ErtsSchedulerData *esdp;
+ ErtsAuxWorkData *awdp;
+ int request_wakeup = 1;
+
+ esdp = erts_get_scheduler_data();
+ ASSERT(esdp);
+ awdp = &esdp->aux_work_data;
+
+ lop->func = later_func;
+ lop->data = later_data;
+ lop->later = erts_thr_progress_later(esdp);
+ lop->next = NULL;
+ if (!awdp->later_op.last)
+ awdp->later_op.first = lop;
+ else {
+ ErtsThrPrgrLaterOp *last = awdp->later_op.last;
+ last->next = lop;
+ if (erts_thr_progress_equal(last->later, lop->later))
+ request_wakeup = 0;
+ }
+ awdp->later_op.last = lop;
+ set_aux_work_flags_wakeup_nob(awdp->ssi,
+ ERTS_SSI_AUX_WORK_THR_PRGR_LATER_OP);
+ if (request_wakeup)
+ erts_thr_progress_wakeup(esdp, lop->later);
+#endif
+}
+
+#ifdef ERTS_SMP
+
static erts_atomic32_t completed_dealloc_count;
static void
@@ -1121,7 +1805,7 @@ erts_smp_notify_check_children_needed(void)
ERTS_SSI_AUX_WORK_CHECK_CHILDREN);
}
-static erts_aint32_t
+static ERTS_INLINE erts_aint32_t
handle_check_children(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
{
unset_aux_work_flags(awdp->ssi, ERTS_SSI_AUX_WORK_CHECK_CHILDREN);
@@ -1131,9 +1815,68 @@ handle_check_children(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
#endif
-#ifdef ERTS_SSI_AUX_WORK_MSEG_CACHE_CHECK
+static void
+notify_reap_ports_relb(void)
+{
+ int i;
+ for (i = 0; i < erts_no_schedulers; i++) {
+ set_aux_work_flags_wakeup_relb(ERTS_SCHED_SLEEP_INFO_IX(i),
+ ERTS_SSI_AUX_WORK_REAP_PORTS);
+ }
+}
-static erts_aint32_t
+erts_smp_atomic32_t erts_halt_progress;
+int erts_halt_code;
+
+static ERTS_INLINE erts_aint32_t
+handle_reap_ports(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
+{
+ unset_aux_work_flags(awdp->ssi, ERTS_SSI_AUX_WORK_REAP_PORTS);
+ awdp->esdp->run_queue->halt_in_progress = 1;
+ if (erts_smp_atomic32_dec_read_acqb(&erts_halt_progress) == 0) {
+ int i;
+ erts_smp_atomic32_set_nob(&erts_halt_progress, 1);
+ for (i = 0; i < erts_max_ports; i++) {
+ Port *prt = &erts_port[i];
+ erts_smp_port_state_lock(prt);
+ if ((prt->status & (ERTS_PORT_SFLGS_INVALID_DRIVER_LOOKUP
+ | ERTS_PORT_SFLG_HALT))) {
+ erts_smp_port_state_unlock(prt);
+ continue;
+ }
+ /* We need to set the halt flag - get the port lock */
+#ifdef ERTS_SMP
+ erts_smp_atomic_inc_nob(&prt->refc);
+#endif
+ erts_smp_port_state_unlock(prt);
+#ifdef ERTS_SMP
+ erts_smp_mtx_lock(prt->lock);
+#endif
+ if ((prt->status & (ERTS_PORT_SFLGS_INVALID_DRIVER_LOOKUP
+ | ERTS_PORT_SFLG_HALT))) {
+ erts_port_release(prt);
+ continue;
+ }
+ erts_port_status_bor_set(prt, ERTS_PORT_SFLG_HALT);
+ erts_smp_atomic32_inc_nob(&erts_halt_progress);
+ if (prt->status & (ERTS_PORT_SFLG_EXITING
+ | ERTS_PORT_SFLG_CLOSING)) {
+ erts_port_release(prt);
+ continue;
+ }
+ erts_do_exit_port(prt, prt->id, am_killed);
+ erts_port_release(prt);
+ }
+ if (erts_smp_atomic32_dec_read_nob(&erts_halt_progress) == 0) {
+ erl_exit_flush_async(erts_halt_code, "");
+ }
+ }
+ return aux_work & ~ERTS_SSI_AUX_WORK_REAP_PORTS;
+}
+
+#if HAVE_ERTS_MSEG
+
+static ERTS_INLINE erts_aint32_t
handle_mseg_cache_check(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
{
unset_aux_work_flags(awdp->ssi, ERTS_SSI_AUX_WORK_MSEG_CACHE_CHECK);
@@ -1143,7 +1886,7 @@ handle_mseg_cache_check(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
#endif
-static erts_aint32_t
+static ERTS_INLINE erts_aint32_t
handle_setup_aux_work_timer(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
{
unset_aux_work_flags(awdp->ssi, ERTS_SSI_AUX_WORK_SET_TMO);
@@ -1151,69 +1894,117 @@ handle_setup_aux_work_timer(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
return aux_work & ~ERTS_SSI_AUX_WORK_SET_TMO;
}
-static ERTS_INLINE erts_aint32_t
-handle_aux_work(ErtsAuxWorkData *awdp, erts_aint32_t aux_work)
+static erts_aint32_t
+handle_aux_work(ErtsAuxWorkData *awdp, erts_aint32_t orig_aux_work, int waiting)
{
+#undef HANDLE_AUX_WORK
+#define HANDLE_AUX_WORK(FLG, HNDLR) \
+ ignore |= FLG; \
+ if (aux_work & FLG) { \
+ aux_work = HNDLR(awdp, aux_work); \
+ ERTS_DBG_CHK_AUX_WORK_VAL(aux_work); \
+ if (!(aux_work & ~ignore)) { \
+ ERTS_DBG_CHK_AUX_WORK_VAL(aux_work); \
+ return aux_work; \
+ } \
+ }
+
+ erts_aint32_t aux_work = orig_aux_work;
+ erts_aint32_t ignore = 0;
+
+#ifdef ERTS_SMP
+ haw_thr_prgr_current_reset(awdp);
+#endif
+
+ ERTS_DBG_CHK_AUX_WORK_VAL(aux_work);
+ ASSERT(aux_work);
+
/*
* Handlers are *only* allowed to modify flags in return value
* and ssi flags that are explicity handled by the handler.
* Handlers are, e.g., not allowed to read the ssi flag field and
* then unconditionally return that value.
+ *
+ * Flag field returned should only contain flags for work that
+ * can continue immediately.
+ */
+
+ /*
+ * Keep ERTS_SSI_AUX_WORK flags in expected frequency order relative
+ * eachother. Most frequent first.
*/
- ERTS_DBG_CHK_AUX_WORK_VAL(aux_work);
- if (aux_work & ERTS_SSI_AUX_WORK_SET_TMO) {
- aux_work = handle_setup_aux_work_timer(awdp, aux_work);
- ERTS_DBG_CHK_AUX_WORK_VAL(aux_work);
- }
#ifdef ERTS_SMP
- if (aux_work & ERTS_SSI_AUX_WORK_MISC_THR_PRGR) {
- aux_work = handle_misc_aux_work_thr_prgr(awdp, aux_work);
- ERTS_DBG_CHK_AUX_WORK_VAL(aux_work);
- }
+ HANDLE_AUX_WORK(ERTS_SSI_AUX_WORK_DELAYED_AW_WAKEUP,
+ handle_delayed_aux_work_wakeup);
+ HANDLE_AUX_WORK(ERTS_SSI_AUX_WORK_DD,
+ handle_delayed_dealloc);
+ /* DD must be before DD_THR_PRGR */
+ HANDLE_AUX_WORK(ERTS_SSI_AUX_WORK_DD_THR_PRGR,
+ handle_delayed_dealloc_thr_prgr);
#endif
- if (aux_work & ERTS_SSI_AUX_WORK_MISC) {
- aux_work = handle_misc_aux_work(awdp, aux_work);
- ERTS_DBG_CHK_AUX_WORK_VAL(aux_work);
- }
+
+ HANDLE_AUX_WORK((ERTS_SSI_AUX_WORK_FIX_ALLOC_LOWER_LIM
+ | ERTS_SSI_AUX_WORK_FIX_ALLOC_DEALLOC),
+ handle_fix_alloc);
+
+#ifdef ERTS_SMP
+ HANDLE_AUX_WORK(ERTS_SSI_AUX_WORK_THR_PRGR_LATER_OP,
+ handle_thr_prgr_later_op);
+#endif
+
#if ERTS_USE_ASYNC_READY_Q
- if (aux_work & ERTS_SSI_AUX_WORK_ASYNC_READY) {
- aux_work = handle_async_ready(awdp, aux_work);
- ERTS_DBG_CHK_AUX_WORK_VAL(aux_work);
- }
- if (aux_work & ERTS_SSI_AUX_WORK_ASYNC_READY_CLEAN) {
- aux_work = handle_async_ready_clean(awdp, aux_work);
- ERTS_DBG_CHK_AUX_WORK_VAL(aux_work);
- }
+ HANDLE_AUX_WORK(ERTS_SSI_AUX_WORK_ASYNC_READY,
+ handle_async_ready);
+ /* ASYNC_READY must be before ASYNC_READY_CLEAN */
+ HANDLE_AUX_WORK(ERTS_SSI_AUX_WORK_ASYNC_READY_CLEAN,
+ handle_async_ready_clean);
#endif
+
+#ifdef ERTS_SMP
+ HANDLE_AUX_WORK(ERTS_SSI_AUX_WORK_MISC_THR_PRGR,
+ handle_misc_aux_work_thr_prgr);
+#endif
+ /* MISC_THR_PRGR must be before MISC */
+ HANDLE_AUX_WORK(ERTS_SSI_AUX_WORK_MISC,
+ handle_misc_aux_work);
+
#ifdef ERTS_SMP_SCHEDULERS_NEED_TO_CHECK_CHILDREN
- if (aux_work & ERTS_SSI_AUX_WORK_CHECK_CHILDREN) {
- aux_work = handle_check_children(awdp, aux_work);
- ERTS_DBG_CHK_AUX_WORK_VAL(aux_work);
- }
+ HANDLE_AUX_WORK(ERTS_SSI_AUX_WORK_CHECK_CHILDREN,
+ handle_check_children);
#endif
- if (aux_work & (ERTS_SSI_AUX_WORK_FIX_ALLOC_LOWER_LIM
- | ERTS_SSI_AUX_WORK_FIX_ALLOC_DEALLOC)) {
- aux_work = handle_fix_alloc(awdp, aux_work);
- ERTS_DBG_CHK_AUX_WORK_VAL(aux_work);
- }
+
+ HANDLE_AUX_WORK(ERTS_SSI_AUX_WORK_SET_TMO,
+ handle_setup_aux_work_timer);
+
+#if HAVE_ERTS_MSEG
+ HANDLE_AUX_WORK(ERTS_SSI_AUX_WORK_MSEG_CACHE_CHECK,
+ handle_mseg_cache_check);
+#endif
+
#ifdef ERTS_SMP
- if (aux_work & ERTS_SSI_AUX_WORK_DD) {
- aux_work = handle_delayed_dealloc(awdp, aux_work);
- ERTS_DBG_CHK_AUX_WORK_VAL(aux_work);
- }
- if (aux_work & ERTS_SSI_AUX_WORK_DD_THR_PRGR) {
- aux_work = handle_delayed_dealloc_thr_prgr(awdp, aux_work);
- ERTS_DBG_CHK_AUX_WORK_VAL(aux_work);
- }
+ HANDLE_AUX_WORK(ERTS_SSI_AUX_WORK_CODE_IX_ACTIVATION,
+ handle_code_ix_activation);
#endif
-#ifdef ERTS_SSI_AUX_WORK_MSEG_CACHE_CHECK
- if (aux_work & ERTS_SSI_AUX_WORK_MSEG_CACHE_CHECK) {
- aux_work = handle_mseg_cache_check(awdp, aux_work);
- ERTS_DBG_CHK_AUX_WORK_VAL(aux_work);
- }
+
+ HANDLE_AUX_WORK(ERTS_SSI_AUX_WORK_REAP_PORTS,
+ handle_reap_ports);
+
+#ifdef ERTS_SMP
+ HANDLE_AUX_WORK(ERTS_SSI_AUX_WORK_FINISH_BP,
+ handle_finish_bp);
#endif
+
ERTS_DBG_CHK_AUX_WORK_VAL(aux_work);
+
+#ifdef ERTS_SMP
+ if (waiting && !aux_work)
+ haw_thr_prgr_current_check_progress(awdp);
+#endif
+
return aux_work;
+
+#undef HANDLE_AUX_WORK
+
}
typedef struct {
@@ -1361,8 +2152,8 @@ sched_waiting_sys(Uint no, ErtsRunQueue *rq)
{
ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(rq));
ASSERT(rq->waiting >= 0);
- rq->flags |= (ERTS_RUNQ_FLG_OUT_OF_WORK
- | ERTS_RUNQ_FLG_HALFTIME_OUT_OF_WORK);
+ (void) ERTS_RUNQ_FLGS_SET(rq, (ERTS_RUNQ_FLG_OUT_OF_WORK
+ | ERTS_RUNQ_FLG_HALFTIME_OUT_OF_WORK));
rq->waiting++;
rq->waiting *= -1;
rq->woken = 0;
@@ -1438,8 +2229,8 @@ static ERTS_INLINE void
sched_waiting(Uint no, ErtsRunQueue *rq)
{
ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(rq));
- rq->flags |= (ERTS_RUNQ_FLG_OUT_OF_WORK
- | ERTS_RUNQ_FLG_HALFTIME_OUT_OF_WORK);
+ (void) ERTS_RUNQ_FLGS_SET(rq, (ERTS_RUNQ_FLG_OUT_OF_WORK
+ | ERTS_RUNQ_FLG_HALFTIME_OUT_OF_WORK));
if (rq->waiting < 0)
rq->waiting--;
else
@@ -1471,9 +2262,8 @@ ongoing_multi_scheduling_block(void)
static ERTS_INLINE void
empty_runq(ErtsRunQueue *rq)
{
- erts_aint32_t oifls = erts_smp_atomic32_read_band_nob(&rq->info_flags,
- ~ERTS_RUNQ_IFLG_NONEMPTY);
- if (oifls & ERTS_RUNQ_IFLG_NONEMPTY) {
+ Uint32 old_flags = ERTS_RUNQ_FLGS_UNSET(rq, ERTS_RUNQ_FLG_NONEMPTY|ERTS_RUNQ_FLG_PROTECTED);
+ if (old_flags & ERTS_RUNQ_FLG_NONEMPTY) {
#ifdef DEBUG
erts_aint32_t empty = erts_smp_atomic32_read_nob(&no_empty_run_queues);
/*
@@ -1489,9 +2279,8 @@ empty_runq(ErtsRunQueue *rq)
static ERTS_INLINE void
non_empty_runq(ErtsRunQueue *rq)
{
- erts_aint32_t oifls = erts_smp_atomic32_read_bor_nob(&rq->info_flags,
- ERTS_RUNQ_IFLG_NONEMPTY);
- if (!(oifls & ERTS_RUNQ_IFLG_NONEMPTY)) {
+ Uint32 old_flags = ERTS_RUNQ_FLGS_SET(rq, ERTS_RUNQ_FLG_NONEMPTY);
+ if (!(old_flags & ERTS_RUNQ_FLG_NONEMPTY)) {
#ifdef DEBUG
erts_aint32_t empty = erts_smp_atomic32_read_nob(&no_empty_run_queues);
/*
@@ -1638,7 +2427,7 @@ thr_prgr_fin_wait(void *vssi)
| ERTS_SSI_FLG_TSE_SLEEPING));
}
-static void init_aux_work_data(ErtsAuxWorkData *awdp, ErtsSchedulerData *esdp);
+static void init_aux_work_data(ErtsAuxWorkData *awdp, ErtsSchedulerData *esdp, char *dawwp);
static void *
aux_thread(void *unused)
@@ -1658,7 +2447,7 @@ aux_thread(void *unused)
callbacks.finalize_wait = thr_prgr_fin_wait;
erts_thr_progress_register_managed_thread(NULL, &callbacks, 1);
- init_aux_work_data(awdp, NULL);
+ init_aux_work_data(awdp, NULL, NULL);
awdp->ssi = ssi;
sched_prep_spin_wait(ssi);
@@ -1670,7 +2459,7 @@ aux_thread(void *unused)
if (aux_work) {
if (!thr_prgr_active)
erts_thr_progress_active(NULL, thr_prgr_active = 1);
- aux_work = handle_aux_work(awdp, aux_work);
+ aux_work = handle_aux_work(awdp, aux_work, 1);
if (aux_work && erts_thr_progress_update(NULL))
erts_thr_progress_leader_update(NULL);
}
@@ -1707,6 +2496,7 @@ aux_thread(void *unused)
static void
scheduler_wait(int *fcalls, ErtsSchedulerData *esdp, ErtsRunQueue *rq)
{
+ int working = 1;
ErtsSchedulerSleepInfo *ssi = esdp->ssi;
int spincount;
erts_aint32_t aux_work = 0;
@@ -1733,17 +2523,22 @@ scheduler_wait(int *fcalls, ErtsSchedulerData *esdp, ErtsRunQueue *rq)
erts_smp_runq_unlock(rq);
- spincount = ERTS_SCHED_TSE_SLEEP_SPINCOUNT;
+ spincount = sched_busy_wait.tse;
tse_wait:
+ if (thr_prgr_active != working)
+ sched_wall_time_change(esdp, thr_prgr_active);
+
while (1) {
aux_work = erts_atomic32_read_acqb(&ssi->aux_work);
if (aux_work) {
- if (!thr_prgr_active)
+ if (!thr_prgr_active) {
erts_thr_progress_active(esdp, thr_prgr_active = 1);
- aux_work = handle_aux_work(&esdp->aux_work_data, aux_work);
+ sched_wall_time_change(esdp, 1);
+ }
+ aux_work = handle_aux_work(&esdp->aux_work_data, aux_work, 1);
if (aux_work && erts_thr_progress_update(esdp))
erts_thr_progress_leader_update(esdp);
}
@@ -1751,8 +2546,10 @@ scheduler_wait(int *fcalls, ErtsSchedulerData *esdp, ErtsRunQueue *rq)
if (aux_work)
flgs = erts_smp_atomic32_read_acqb(&ssi->flags);
else {
- if (thr_prgr_active)
+ if (thr_prgr_active) {
erts_thr_progress_active(esdp, thr_prgr_active = 0);
+ sched_wall_time_change(esdp, 0);
+ }
erts_thr_progress_prepare_wait(esdp);
flgs = sched_spin_wait(ssi, spincount);
@@ -1777,7 +2574,7 @@ scheduler_wait(int *fcalls, ErtsSchedulerData *esdp, ErtsRunQueue *rq)
}
flgs = sched_prep_cont_spin_wait(ssi);
- spincount = ERTS_SCHED_TSE_SLEEP_SPINCOUNT;
+ spincount = sched_busy_wait.aux_work;
if (!(flgs & ERTS_SSI_FLG_WAITING)) {
ASSERT(!(flgs & ERTS_SSI_FLG_SLEEPING));
@@ -1789,8 +2586,10 @@ scheduler_wait(int *fcalls, ErtsSchedulerData *esdp, ErtsRunQueue *rq)
if (flgs & ~ERTS_SSI_FLG_SUSPENDED)
erts_smp_atomic32_read_band_nob(&ssi->flags, ERTS_SSI_FLG_SUSPENDED);
- if (!thr_prgr_active)
+ if (!thr_prgr_active) {
erts_thr_progress_active(esdp, thr_prgr_active = 1);
+ sched_wall_time_change(esdp, 1);
+ }
erts_smp_runq_lock(rq);
sched_active(esdp->no, rq);
@@ -1806,14 +2605,23 @@ scheduler_wait(int *fcalls, ErtsSchedulerData *esdp, ErtsRunQueue *rq)
sched_waiting_sys(esdp->no, rq);
+
erts_smp_runq_unlock(rq);
- spincount = ERTS_SCHED_SYS_SLEEP_SPINCOUNT;
+ ASSERT(working);
+ sched_wall_time_change(esdp, working = 0);
+
+ spincount = sched_busy_wait.sys_schedule;
+ if (spincount == 0)
+ goto sys_aux_work;
while (spincount-- > 0) {
sys_poll_aux_work:
+ if (working)
+ sched_wall_time_change(esdp, working = 0);
+
ASSERT(!erts_port_task_have_outstanding_io_tasks());
erl_sys_schedule(1); /* Might give us something to do */
@@ -1828,11 +2636,13 @@ scheduler_wait(int *fcalls, ErtsSchedulerData *esdp, ErtsRunQueue *rq)
aux_work = erts_atomic32_read_acqb(&ssi->aux_work);
if (aux_work) {
+ if (!working)
+ sched_wall_time_change(esdp, working = 1);
#ifdef ERTS_SMP
if (!thr_prgr_active)
erts_thr_progress_active(esdp, thr_prgr_active = 1);
#endif
- aux_work = handle_aux_work(&esdp->aux_work_data, aux_work);
+ aux_work = handle_aux_work(&esdp->aux_work_data, aux_work, 1);
#ifdef ERTS_SMP
if (aux_work && erts_thr_progress_update(esdp))
erts_thr_progress_leader_update(esdp);
@@ -1920,6 +2730,9 @@ scheduler_wait(int *fcalls, ErtsSchedulerData *esdp, ErtsRunQueue *rq)
erts_smp_runq_unlock(rq);
+ if (working)
+ sched_wall_time_change(esdp, working = 0);
+
#ifdef ERTS_SMP
if (thr_prgr_active)
erts_thr_progress_active(esdp, thr_prgr_active = 0);
@@ -1955,6 +2768,8 @@ scheduler_wait(int *fcalls, ErtsSchedulerData *esdp, ErtsRunQueue *rq)
if (flgs & ~ERTS_SSI_FLG_SUSPENDED)
erts_smp_atomic32_read_band_nob(&ssi->flags, ERTS_SSI_FLG_SUSPENDED);
#endif
+ if (!working)
+ sched_wall_time_change(esdp, working = 1);
sched_active_sys(esdp->no, rq);
}
@@ -2080,19 +2895,16 @@ try_inc_no_active_runqs(int active)
static ERTS_INLINE int
chk_wake_sched(ErtsRunQueue *crq, int ix, int activate)
{
- erts_aint32_t iflgs;
+ Uint32 flags;
ErtsRunQueue *wrq;
if (crq->ix == ix)
return 0;
wrq = ERTS_RUNQ_IX(ix);
- iflgs = erts_smp_atomic32_read_nob(&wrq->info_flags);
- if (!(iflgs & (ERTS_RUNQ_IFLG_SUSPENDED|ERTS_RUNQ_IFLG_NONEMPTY))) {
+ flags = ERTS_RUNQ_FLGS_GET(wrq);
+ if (!(flags & (ERTS_RUNQ_FLG_SUSPENDED|ERTS_RUNQ_FLG_NONEMPTY))) {
if (activate) {
- if (try_inc_no_active_runqs(ix+1)) {
- erts_smp_xrunq_lock(crq, wrq);
- wrq->flags &= ~ERTS_RUNQ_FLG_INACTIVE;
- erts_smp_xrunq_unlock(crq, wrq);
- }
+ if (try_inc_no_active_runqs(ix+1))
+ (void) ERTS_RUNQ_FLGS_UNSET(wrq, ERTS_RUNQ_FLG_INACTIVE);
}
wake_scheduler(wrq, 0);
return 1;
@@ -2159,9 +2971,7 @@ erts_sched_notify_check_cpu_bind(void)
int ix;
for (ix = 0; ix < erts_no_run_queues; ix++) {
ErtsRunQueue *rq = ERTS_RUNQ_IX(ix);
- erts_smp_runq_lock(rq);
- rq->flags |= ERTS_RUNQ_FLG_CHK_CPU_BIND;
- erts_smp_runq_unlock(rq);
+ (void) ERTS_RUNQ_FLGS_SET(rq, ERTS_RUNQ_FLG_CHK_CPU_BIND);
wake_scheduler(rq, 0);
}
#else
@@ -2170,404 +2980,547 @@ erts_sched_notify_check_cpu_bind(void)
}
-#ifdef ERTS_SMP
+static ERTS_INLINE void
+enqueue_process(ErtsRunQueue *runq, int prio, Process *p)
+{
+ ErtsRunPrioQueue *rpq;
-ErtsRunQueue *
-erts_prepare_emigrate(ErtsRunQueue *c_rq, ErtsRunQueueInfo *c_rqi, int prio)
+ ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(runq));
+
+ erts_smp_inc_runq_len(runq, &runq->procs.prio_info[prio], prio);
+
+ if (prio == PRIORITY_LOW) {
+ p->schedule_count = RESCHEDULE_LOW;
+ rpq = &runq->procs.prio[PRIORITY_NORMAL];
+ }
+ else {
+ p->schedule_count = 1;
+ rpq = &runq->procs.prio[prio];
+ }
+
+ p->next = NULL;
+ if (rpq->last)
+ rpq->last->next = p;
+ else
+ rpq->first = p;
+ rpq->last = p;
+}
+
+
+static ERTS_INLINE void
+unqueue_process(ErtsRunQueue *runq,
+ ErtsRunPrioQueue *rpq,
+ ErtsRunQueueInfo *rqi,
+ int prio,
+ Process *prev_proc,
+ Process *proc)
{
- ASSERT(ERTS_CHK_RUNQ_FLG_EMIGRATE(c_rq->flags, prio));
- ASSERT(ERTS_CHK_RUNQ_FLG_EVACUATE(c_rq->flags, prio)
- || c_rqi->len >= c_rqi->migrate.limit.this);
+ ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(runq));
- while (1) {
- ErtsRunQueue *n_rq = c_rqi->migrate.runq;
- ERTS_DBG_VERIFY_VALID_RUNQP(n_rq);
- erts_smp_xrunq_lock(c_rq, n_rq);
-
- /*
- * erts_smp_xrunq_lock() may release lock on c_rq! We have
- * to check that we still want to emigrate and emigrate
- * to the same run queue as before.
- */
+ if (prev_proc)
+ prev_proc->next = proc->next;
+ else
+ rpq->first = proc->next;
+ if (!proc->next)
+ rpq->last = prev_proc;
- if (ERTS_CHK_RUNQ_FLG_EMIGRATE(c_rq->flags, prio)) {
- Uint32 force = (ERTS_CHK_RUNQ_FLG_EVACUATE(c_rq->flags, prio)
- | (c_rq->flags & ERTS_RUNQ_FLG_INACTIVE));
- if (force || c_rqi->len > c_rqi->migrate.limit.this) {
- ErtsRunQueueInfo *n_rqi;
- /* We still want to emigrate */
-
- if (n_rq != c_rqi->migrate.runq) {
- /* Ahh... run queue changed; need to do it all over again... */
- erts_smp_runq_unlock(n_rq);
- continue;
- }
- else {
+ if (!rpq->first)
+ rpq->last = NULL;
- if (prio == ERTS_PORT_PRIO_LEVEL)
- n_rqi = &n_rq->ports.info;
- else
- n_rqi = &n_rq->procs.prio_info[prio];
+ erts_smp_dec_runq_len(runq, rqi, prio);
+}
- if (force || (n_rqi->len < c_rqi->migrate.limit.other)) {
- /* emigrate ... */
- return n_rq;
- }
- }
- }
- }
- ASSERT(n_rq != c_rq);
- erts_smp_runq_unlock(n_rq);
- if (!(c_rq->flags & ERTS_RUNQ_FLG_INACTIVE)) {
- /* No more emigrations to this runq */
- ERTS_UNSET_RUNQ_FLG_EMIGRATE(c_rq->flags, prio);
- ERTS_DBG_SET_INVALID_RUNQP(c_rqi->migrate.runq, 0x3);
- }
+static ERTS_INLINE Process *
+dequeue_process(ErtsRunQueue *runq, int prio_q, erts_aint32_t *statep)
+{
+ erts_aint32_t state;
+ int prio;
+ ErtsRunPrioQueue *rpq;
+ ErtsRunQueueInfo *rqi;
+ Process *p;
+
+ ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(runq));
+ ASSERT(PRIORITY_NORMAL == prio_q
+ || PRIORITY_HIGH == prio_q
+ || PRIORITY_MAX == prio_q);
+
+ rpq = &runq->procs.prio[prio_q];
+ p = rpq->first;
+ if (!p)
return NULL;
+
+ ERTS_SMP_DATA_DEPENDENCY_READ_MEMORY_BARRIER;
+
+ state = erts_smp_atomic32_read_nob(&p->state);
+ if (statep)
+ *statep = state;
+
+ prio = (int) (ERTS_PSFLG_PRIO_MASK & state);
+
+ rqi = &runq->procs.prio_info[prio];
+
+ if (p)
+ unqueue_process(runq, rpq, rqi, prio, NULL, p);
+
+ return p;
+}
+
+static ERTS_INLINE int
+check_requeue_process(ErtsRunQueue *rq, int prio_q)
+{
+ ErtsRunPrioQueue *rpq = &rq->procs.prio[prio_q];
+ Process *p = rpq->first;
+ if (--p->schedule_count > 0 && p != rpq->last) {
+ /* reschedule */
+ rpq->first = p->next;
+ rpq->last->next = p;
+ rpq->last = p;
+ p->next = NULL;
+ return 1;
+ }
+ return 0;
+}
+
+#ifdef ERTS_SMP
+
+static ErtsRunQueue *
+check_immigration_need(ErtsRunQueue *c_rq, ErtsMigrationPath *mp, int prio)
+{
+ int len;
+ Uint32 f_flags, f_rq_flags;
+ ErtsRunQueue *f_rq;
+
+ f_flags = mp->prio[prio].flags;
+
+ ASSERT(ERTS_CHK_RUNQ_FLG_IMMIGRATE(mp->flags, prio));
+
+ f_rq = mp->prio[prio].runq;
+ if (!f_rq)
+ return NULL;
+
+ f_rq_flags = ERTS_RUNQ_FLGS_GET(f_rq);
+ if (f_rq_flags & ERTS_RUNQ_FLG_PROTECTED)
+ return NULL;
+
+ if (ERTS_CHK_RUNQ_FLG_EVACUATE(f_flags, prio))
+ return f_rq;
+
+ if (f_rq_flags & ERTS_RUNQ_FLG_INACTIVE)
+ return f_rq;
+
+ if (prio == ERTS_PORT_PRIO_LEVEL)
+ len = RUNQ_READ_LEN(&c_rq->ports.info.len);
+ else
+ len = RUNQ_READ_LEN(&c_rq->procs.prio_info[prio].len);
+
+ if (len < mp->prio[prio].limit.this) {
+ if (prio == ERTS_PORT_PRIO_LEVEL)
+ len = RUNQ_READ_LEN(&f_rq->ports.info.len);
+ else
+ len = RUNQ_READ_LEN(&f_rq->procs.prio_info[prio].len);
+
+ if (len > mp->prio[prio].limit.other)
+ return f_rq;
}
+ return NULL;
}
static void
-immigrate(ErtsRunQueue *rq)
+immigrate(ErtsRunQueue *c_rq, ErtsMigrationPath *mp)
{
- int prio;
+ Uint32 iflags, iflag;
+ erts_smp_runq_unlock(c_rq);
- ASSERT(rq->flags & ERTS_RUNQ_FLGS_IMMIGRATE_QMASK);
+ ASSERT(erts_thr_progress_is_managed_thread());
- for (prio = 0; prio < ERTS_NO_PRIO_LEVELS; prio++) {
- if (ERTS_CHK_RUNQ_FLG_IMMIGRATE(rq->flags, prio)) {
- ErtsRunQueueInfo *rqi = (prio == ERTS_PORT_PRIO_LEVEL
- ? &rq->ports.info
- : &rq->procs.prio_info[prio]);
- ErtsRunQueue *from_rq = rqi->migrate.runq;
- int rq_locked, from_rq_locked;
+ iflags = mp->flags & ERTS_RUNQ_FLGS_IMMIGRATE_QMASK;
- ERTS_DBG_VERIFY_VALID_RUNQP(from_rq);
+ iflag = iflags & -iflags;
- rq_locked = 1;
- from_rq_locked = 1;
- erts_smp_xrunq_lock(rq, from_rq);
- /*
- * erts_smp_xrunq_lock() may release lock on rq! We have
- * to check that we still want to immigrate from the same
- * run queue as before.
- */
- if (ERTS_CHK_RUNQ_FLG_IMMIGRATE(rq->flags, prio)
- && from_rq == rqi->migrate.runq) {
- ErtsRunQueueInfo *from_rqi = (prio == ERTS_PORT_PRIO_LEVEL
- ? &from_rq->ports.info
- : &from_rq->procs.prio_info[prio]);
- if ((ERTS_CHK_RUNQ_FLG_EVACUATE(rq->flags, prio)
- && ERTS_CHK_RUNQ_FLG_EVACUATE(from_rq->flags, prio)
- && from_rqi->len)
- || (from_rqi->len > rqi->migrate.limit.other
- && rqi->len < rqi->migrate.limit.this)) {
- if (prio == ERTS_PORT_PRIO_LEVEL) {
- Port *prt = from_rq->ports.start;
- if (prt) {
- int prt_locked = 0;
- (void) erts_port_migrate(prt, &prt_locked,
- from_rq, &from_rq_locked,
- rq, &rq_locked);
- if (prt_locked)
- erts_smp_port_unlock(prt);
- }
- }
- else {
- Process *proc;
- ErtsRunPrioQueue *from_rpq;
- from_rpq = (prio == PRIORITY_LOW
- ? &from_rq->procs.prio[PRIORITY_NORMAL]
- : &from_rq->procs.prio[prio]);
- for (proc = from_rpq->first; proc; proc = proc->next)
- if (proc->prio == prio && !proc->bound_runq)
- break;
- if (proc) {
- ErtsProcLocks proc_locks = 0;
- (void) erts_proc_migrate(proc, &proc_locks,
- from_rq, &from_rq_locked,
- rq, &rq_locked);
- if (proc_locks)
- erts_smp_proc_unlock(proc, proc_locks);
- }
+ while (iflag) {
+ ErtsRunQueue *rq;
+ int prio;
+
+ switch (iflag) {
+ case (MAX_BIT << ERTS_RUNQ_FLGS_IMMIGRATE_SHFT):
+ prio = PRIORITY_MAX;
+ break;
+ case (HIGH_BIT << ERTS_RUNQ_FLGS_IMMIGRATE_SHFT):
+ prio = PRIORITY_HIGH;
+ break;
+ case (NORMAL_BIT << ERTS_RUNQ_FLGS_IMMIGRATE_SHFT):
+ prio = PRIORITY_NORMAL;
+ break;
+ case (LOW_BIT << ERTS_RUNQ_FLGS_IMMIGRATE_SHFT):
+ prio = PRIORITY_LOW;
+ break;
+ case (PORT_BIT << ERTS_RUNQ_FLGS_IMMIGRATE_SHFT):
+ prio = ERTS_PORT_PRIO_LEVEL;
+ break;
+ default:
+ erl_exit(ERTS_ABORT_EXIT,
+ "%s:%d:%s(): Invalid immigrate queue mask",
+ __FILE__, __LINE__, __func__);
+ prio = 0;
+ break;
+ }
+
+ iflags &= ~iflag;
+ iflag = iflags & -iflags;
+
+ rq = check_immigration_need(c_rq, mp, prio);
+ if (rq) {
+ erts_smp_runq_lock(rq);
+ if (prio == ERTS_PORT_PRIO_LEVEL) {
+ Port *prt;
+ prt = erts_dequeue_port(rq);
+ if (prt)
+ RUNQ_SET_RQ(&prt->run_queue, c_rq);
+ erts_smp_runq_unlock(rq);
+ if (prt) {
+ /* port might terminate while we have no lock... */
+ rq = erts_port_runq(prt);
+ if (rq) {
+ if (rq != c_rq)
+ erl_exit(ERTS_ABORT_EXIT,
+ "%s:%d:%s(): Internal error",
+ __FILE__, __LINE__, __func__);
+ erts_enqueue_port(c_rq, prt);
+ if (!iflag)
+ return; /* done */
+ erts_smp_runq_unlock(c_rq);
}
}
- else {
- ERTS_UNSET_RUNQ_FLG_IMMIGRATE(rq->flags, prio);
- ERTS_DBG_SET_INVALID_RUNQP(rqi->migrate.runq, 0x1);
+ }
+ else {
+ ErtsRunPrioQueue *rpq = &rq->procs.prio[prio == PRIORITY_LOW
+ ? PRIORITY_NORMAL
+ : prio];
+ Process *prev_proc = NULL;
+ Process *proc = rpq->first;
+ int rq_locked = 1;
+
+ while (proc) {
+ erts_aint32_t state;
+ state = erts_smp_atomic32_read_acqb(&proc->state);
+ if (!(ERTS_PSFLG_BOUND & state)
+ && (prio == (int) (ERTS_PSFLG_PRIO_MASK & state))) {
+ ErtsRunQueueInfo *rqi = &rq->procs.prio_info[prio];
+ unqueue_process(rq, rpq, rqi, prio, prev_proc, proc);
+ erts_smp_runq_unlock(rq);
+ RUNQ_SET_RQ(&proc->run_queue, c_rq);
+ rq_locked = 0;
+
+ erts_smp_runq_lock(c_rq);
+ enqueue_process(c_rq, prio, proc);
+ if (!iflag)
+ return; /* done */
+ erts_smp_runq_unlock(c_rq);
+ break;
+ }
+ prev_proc = proc;
+ proc = proc->next;
}
+ if (rq_locked)
+ erts_smp_runq_unlock(rq);
}
- if (from_rq_locked)
- erts_smp_runq_unlock(from_rq);
- if (!rq_locked)
- erts_smp_runq_lock(rq);
}
}
+
+ erts_smp_runq_lock(c_rq);
+}
+
+static ERTS_INLINE void
+suspend_run_queue(ErtsRunQueue *rq)
+{
+ erts_smp_atomic32_read_bor_nob(&rq->scheduler->ssi->flags,
+ ERTS_SSI_FLG_SUSPENDED);
+ (void) ERTS_RUNQ_FLGS_SET(rq, ERTS_RUNQ_FLG_SUSPENDED);
+
+ wake_scheduler(rq, 0);
+}
+
+static void scheduler_ix_resume_wake(Uint ix);
+
+static ERTS_INLINE void
+resume_run_queue(ErtsRunQueue *rq)
+{
+ int pix;
+
+ erts_smp_runq_lock(rq);
+
+ (void) ERTS_RUNQ_FLGS_MASK_SET(rq,
+ (ERTS_RUNQ_FLG_OUT_OF_WORK
+ | ERTS_RUNQ_FLG_HALFTIME_OUT_OF_WORK
+ | ERTS_RUNQ_FLG_SUSPENDED),
+ (ERTS_RUNQ_FLG_OUT_OF_WORK
+ | ERTS_RUNQ_FLG_HALFTIME_OUT_OF_WORK));
+
+ rq->check_balance_reds = ERTS_RUNQ_CALL_CHECK_BALANCE_REDS;
+ for (pix = 0; pix < ERTS_NO_PROC_PRIO_LEVELS; pix++) {
+ rq->procs.prio_info[pix].max_len = 0;
+ rq->procs.prio_info[pix].reds = 0;
+ }
+ rq->ports.info.max_len = 0;
+ rq->ports.info.reds = 0;
+ rq->max_len = 0;
+
+ erts_smp_runq_unlock(rq);
+
+ scheduler_ix_resume_wake(rq->ix);
}
+typedef struct {
+ Process *first;
+ Process *last;
+} ErtsStuckBoundProcesses;
+
static void
-evacuate_run_queue(ErtsRunQueue *evac_rq, ErtsRunQueue *rq)
+schedule_bound_processes(ErtsRunQueue *rq,
+ ErtsStuckBoundProcesses *sbpp)
{
- Port *prt;
- int notify_to_rq = 0;
- int prio;
- int prt_locked = 0;
- int rq_locked = 0;
- int evac_rq_locked = 1;
- ErtsMigrateResult mres;
+ Process *proc, *next;
+ ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(rq));
- erts_smp_runq_lock(evac_rq);
+ proc = sbpp->first;
+ while (proc) {
+ erts_aint32_t state = erts_smp_atomic32_read_acqb(&proc->state);
+ next = proc->next;
+ enqueue_process(rq, (int) (ERTS_PSFLG_PRIO_MASK & state), proc);
+ proc = next;
+ }
+}
- erts_smp_atomic32_read_bor_nob(&evac_rq->scheduler->ssi->flags,
- ERTS_SSI_FLG_SUSPENDED);
+static void
+evacuate_run_queue(ErtsRunQueue *rq,
+ ErtsStuckBoundProcesses *sbpp)
+{
+ int prio_q;
+ ErtsRunQueue *to_rq;
+ ErtsMigrationPaths *mps;
+ ErtsMigrationPath *mp;
- evac_rq->flags &= ~ERTS_RUNQ_FLGS_IMMIGRATE_QMASK;
- evac_rq->flags |= (ERTS_RUNQ_FLGS_EMIGRATE_QMASK
- | ERTS_RUNQ_FLGS_EVACUATE_QMASK
- | ERTS_RUNQ_FLG_SUSPENDED);
+ ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(rq));
- erts_smp_atomic32_read_bor_nob(&evac_rq->info_flags, ERTS_RUNQ_IFLG_SUSPENDED);
- /*
- * Need to set up evacuation paths first since we
- * may release the run queue lock on evac_rq
- * when evacuating.
- */
- evac_rq->misc.evac_runq = rq;
- evac_rq->ports.info.migrate.runq = rq;
- for (prio = 0; prio < ERTS_NO_PROC_PRIO_LEVELS; prio++)
- evac_rq->procs.prio_info[prio].migrate.runq = rq;
+ (void) ERTS_RUNQ_FLGS_UNSET(rq, ERTS_RUNQ_FLG_PROTECTED);
+
+ mps = erts_get_migration_paths_managed();
+ mp = &mps->mpath[rq->ix];
/* Evacuate scheduled misc ops */
- if (evac_rq->misc.start) {
- rq_locked = 1;
- erts_smp_xrunq_lock(evac_rq, rq);
- if (rq->misc.end)
- rq->misc.end->next = evac_rq->misc.start;
+ if (rq->misc.start) {
+ ErtsMiscOpList *start, *end;
+
+ to_rq = mp->misc_evac_runq;
+ if (!to_rq)
+ return;
+
+ start = rq->misc.start;
+ end = rq->misc.end;
+ rq->misc.start = NULL;
+ rq->misc.end = NULL;
+ erts_smp_runq_unlock(rq);
+
+ erts_smp_runq_lock(to_rq);
+ if (to_rq->misc.end)
+ to_rq->misc.end->next = start;
else
- rq->misc.start = evac_rq->misc.start;
- rq->misc.end = evac_rq->misc.end;
- evac_rq->misc.start = NULL;
- evac_rq->misc.end = NULL;
+ to_rq->misc.start = start;
+
+ to_rq->misc.end = end;
+ erts_smp_runq_unlock(to_rq);
+ smp_notify_inc_runq(to_rq);
+ erts_smp_runq_lock(to_rq);
}
- /* Evacuate scheduled ports */
- prt = evac_rq->ports.start;
- while (prt) {
- mres = erts_port_migrate(prt, &prt_locked,
- evac_rq, &evac_rq_locked,
- rq, &rq_locked);
- if (mres == ERTS_MIGRATE_SUCCESS)
- notify_to_rq = 1;
- if (prt_locked)
- erts_smp_port_unlock(prt);
- if (!evac_rq_locked) {
- evac_rq_locked = 1;
- erts_smp_runq_lock(evac_rq);
+ if (rq->ports.start) {
+ Port *prt;
+
+ to_rq = mp->prio[ERTS_PORT_PRIO_LEVEL].runq;
+ if (!to_rq)
+ return;
+
+ /* Evacuate scheduled ports */
+ prt = rq->ports.start;
+ while (prt) {
+ ErtsRunQueue *prt_rq;
+ prt = erts_dequeue_port(rq);
+ RUNQ_SET_RQ(&prt->run_queue, to_rq);
+ erts_smp_runq_unlock(rq);
+ /*
+ * The port might terminate while
+ * we have no lock on it...
+ */
+ prt_rq = erts_port_runq(prt);
+ if (prt_rq) {
+ if (prt_rq != to_rq)
+ erl_exit(ERTS_ABORT_EXIT,
+ "%s:%d:%s() internal error\n",
+ __FILE__, __LINE__, __func__);
+ erts_enqueue_port(to_rq, prt);
+ erts_smp_runq_unlock(to_rq);
+ }
+ erts_smp_runq_lock(rq);
+ prt = rq->ports.start;
}
- prt = evac_rq->ports.start;
+ smp_notify_inc_runq(to_rq);
}
/* Evacuate scheduled processes */
- for (prio = 0; prio < ERTS_NO_PROC_PRIO_LEVELS; prio++) {
+ for (prio_q = 0; prio_q < ERTS_NO_PROC_PRIO_QUEUES; prio_q++) {
+ erts_aint32_t state;
Process *proc;
+ int notify = 0;
+ to_rq = NULL;
- switch (prio) {
- case PRIORITY_MAX:
- case PRIORITY_HIGH:
- case PRIORITY_NORMAL:
- proc = evac_rq->procs.prio[prio].first;
- while (proc) {
- ErtsProcLocks proc_locks = 0;
-
- /* Bound processes are stuck... */
- while (proc->bound_runq) {
- proc = proc->next;
- if (!proc)
- goto end_of_proc;
- }
-
- mres = erts_proc_migrate(proc, &proc_locks,
- evac_rq, &evac_rq_locked,
- rq, &rq_locked);
- if (mres == ERTS_MIGRATE_SUCCESS)
- notify_to_rq = 1;
- if (proc_locks)
- erts_smp_proc_unlock(proc, proc_locks);
- if (!evac_rq_locked) {
- erts_smp_runq_lock(evac_rq);
- evac_rq_locked = 1;
- }
+ if (!mp->prio[prio_q].runq)
+ return;
+ if (prio_q == PRIORITY_NORMAL && !mp->prio[PRIORITY_LOW].runq)
+ return;
- proc = evac_rq->procs.prio[prio].first;
+ proc = dequeue_process(rq, prio_q, &state);
+ while (proc) {
+ if (ERTS_PSFLG_BOUND & state) {
+ /* Bound processes get stuck here... */
+ proc->next = NULL;
+ if (sbpp->last)
+ sbpp->last->next = proc;
+ else
+ sbpp->first = proc;
+ sbpp->last = proc;
}
+ else {
+ int prio = (int) (ERTS_PSFLG_PRIO_MASK & state);
+ erts_smp_runq_unlock(rq);
- end_of_proc:
+ to_rq = mp->prio[prio].runq;
+ RUNQ_SET_RQ(&proc->run_queue, to_rq);
-#ifdef DEBUG
- for (proc = evac_rq->procs.prio[prio].first;
- proc;
- proc = proc->next) {
- ASSERT(proc->bound_runq);
+ erts_smp_runq_lock(to_rq);
+ enqueue_process(to_rq, prio, proc);
+ erts_smp_runq_unlock(to_rq);
+ notify = 1;
+
+ erts_smp_runq_lock(rq);
}
-#endif
- break;
- case PRIORITY_LOW:
- break;
- default:
- ASSERT(!"Invalid process priority");
- break;
+ proc = dequeue_process(rq, prio_q, &state);
}
+ if (notify)
+ smp_notify_inc_runq(to_rq);
}
- if (rq_locked)
- erts_smp_runq_unlock(rq);
-
- if (evac_rq_locked)
- erts_smp_runq_unlock(evac_rq);
-
- if (notify_to_rq)
- smp_notify_inc_runq(rq);
-
- wake_scheduler(evac_rq, 0);
+ if (ERTS_EMPTY_RUNQ(rq))
+ empty_runq(rq);
}
static int
-try_steal_task_from_victim(ErtsRunQueue *rq, int *rq_lockedp, ErtsRunQueue *vrq)
+try_steal_task_from_victim(ErtsRunQueue *rq, int *rq_lockedp, ErtsRunQueue *vrq, Uint32 flags)
{
- Process *proc;
- int vrq_locked;
+ Uint32 procs_qmask = flags & ERTS_RUNQ_FLGS_PROCS_QMASK;
+ int max_prio_bit;
+ ErtsRunPrioQueue *rpq;
- if (*rq_lockedp)
- erts_smp_xrunq_lock(rq, vrq);
- else
- erts_smp_runq_lock(vrq);
- vrq_locked = 1;
+ if (*rq_lockedp) {
+ erts_smp_runq_unlock(rq);
+ *rq_lockedp = 0;
+ }
+
+ ERTS_SMP_LC_ASSERT(!erts_smp_lc_runq_is_locked(rq));
+
+ erts_smp_runq_lock(vrq);
- ERTS_SMP_LC_CHK_RUNQ_LOCK(rq, *rq_lockedp);
- ERTS_SMP_LC_CHK_RUNQ_LOCK(vrq, vrq_locked);
+ if (rq->halt_in_progress)
+ goto no_procs;
/*
* Check for a runnable process to steal...
*/
- switch (vrq->flags & ERTS_RUNQ_FLGS_PROCS_QMASK) {
- case MAX_BIT:
- case MAX_BIT|HIGH_BIT:
- case MAX_BIT|NORMAL_BIT:
- case MAX_BIT|LOW_BIT:
- case MAX_BIT|HIGH_BIT|NORMAL_BIT:
- case MAX_BIT|HIGH_BIT|LOW_BIT:
- case MAX_BIT|NORMAL_BIT|LOW_BIT:
- case MAX_BIT|HIGH_BIT|NORMAL_BIT|LOW_BIT:
- for (proc = vrq->procs.prio[PRIORITY_MAX].last;
- proc;
- proc = proc->prev) {
- if (!proc->bound_runq)
- break;
- }
- if (proc)
+ while (procs_qmask) {
+ Process *prev_proc;
+ Process *proc;
+
+ max_prio_bit = procs_qmask & -procs_qmask;
+ switch (max_prio_bit) {
+ case MAX_BIT:
+ rpq = &vrq->procs.prio[PRIORITY_MAX];
break;
- case HIGH_BIT:
- case HIGH_BIT|NORMAL_BIT:
- case HIGH_BIT|LOW_BIT:
- case HIGH_BIT|NORMAL_BIT|LOW_BIT:
- for (proc = vrq->procs.prio[PRIORITY_HIGH].last;
- proc;
- proc = proc->prev) {
- if (!proc->bound_runq)
- break;
- }
- if (proc)
+ case HIGH_BIT:
+ rpq = &vrq->procs.prio[PRIORITY_HIGH];
break;
- case NORMAL_BIT:
- case LOW_BIT:
- case NORMAL_BIT|LOW_BIT:
- for (proc = vrq->procs.prio[PRIORITY_NORMAL].last;
- proc;
- proc = proc->prev) {
- if (!proc->bound_runq)
- break;
- }
- if (proc)
+ case NORMAL_BIT:
+ case LOW_BIT:
+ rpq = &vrq->procs.prio[PRIORITY_NORMAL];
break;
- case 0:
- proc = NULL;
- break;
- default:
- ASSERT(!"Invalid queue mask");
- proc = NULL;
- break;
- }
+ case 0:
+ goto no_procs;
+ default:
+ ASSERT(!"Invalid queue mask");
+ goto no_procs;
+ }
- if (proc) {
- ErtsProcLocks proc_locks = 0;
- int res;
- ErtsMigrateResult mres;
- mres = erts_proc_migrate(proc, &proc_locks,
- vrq, &vrq_locked,
- rq, rq_lockedp);
- if (proc_locks)
- erts_smp_proc_unlock(proc, proc_locks);
- res = !0;
- switch (mres) {
- case ERTS_MIGRATE_FAILED_RUNQ_SUSPENDED:
- res = 0;
- case ERTS_MIGRATE_SUCCESS:
- if (vrq_locked)
+ prev_proc = NULL;
+ proc = rpq->first;
+
+ while (proc) {
+ erts_aint32_t state = erts_smp_atomic32_read_acqb(&proc->state);
+ if (!(ERTS_PSFLG_BOUND & state)) {
+ /* Steal process */
+ int prio = (int) (ERTS_PSFLG_PRIO_MASK & state);
+ ErtsRunQueueInfo *rqi = &vrq->procs.prio_info[prio];
+ unqueue_process(vrq, rpq, rqi, prio, prev_proc, proc);
erts_smp_runq_unlock(vrq);
- return res;
- default: /* Other failures */
- break;
- }
- }
+ RUNQ_SET_RQ(&proc->run_queue, rq);
- ERTS_SMP_LC_CHK_RUNQ_LOCK(rq, *rq_lockedp);
- ERTS_SMP_LC_CHK_RUNQ_LOCK(vrq, vrq_locked);
+ erts_smp_runq_lock(rq);
+ *rq_lockedp = 1;
+ enqueue_process(rq, prio, proc);
+ return !0;
+ }
+ prev_proc = proc;
+ proc = proc->next;
+ }
- if (!vrq_locked) {
- if (*rq_lockedp)
- erts_smp_xrunq_lock(rq, vrq);
- else
- erts_smp_runq_lock(vrq);
- vrq_locked = 1;
+ procs_qmask &= ~max_prio_bit;
}
- ERTS_SMP_LC_CHK_RUNQ_LOCK(rq, *rq_lockedp);
- ERTS_SMP_LC_CHK_RUNQ_LOCK(vrq, vrq_locked);
+no_procs:
+
+ ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(vrq));
/*
* Check for a runnable port to steal...
*/
- if (vrq->ports.info.len) {
- Port *prt = vrq->ports.end;
- int prt_locked = 0;
- int res;
- ErtsMigrateResult mres;
-
- mres = erts_port_migrate(prt, &prt_locked,
- vrq, &vrq_locked,
- rq, rq_lockedp);
- if (prt_locked)
- erts_smp_port_unlock(prt);
- res = !0;
- switch (mres) {
- case ERTS_MIGRATE_FAILED_RUNQ_SUSPENDED:
- res = 0;
- case ERTS_MIGRATE_SUCCESS:
- if (vrq_locked)
- erts_smp_runq_unlock(vrq);
- return res;
- default: /* Other failures */
- break;
+ if (vrq->ports.start) {
+ ErtsRunQueue *prt_rq;
+ Port *prt = erts_dequeue_port(vrq);
+ RUNQ_SET_RQ(&prt->run_queue, rq);
+ erts_smp_runq_unlock(vrq);
+
+ /*
+ * The port might terminate while
+ * we have no lock on it...
+ */
+
+ prt_rq = erts_port_runq(prt);
+ if (!prt_rq)
+ return 0;
+ else {
+ if (prt_rq != rq)
+ erl_exit(ERTS_ABORT_EXIT,
+ "%s:%d:%s() internal error\n",
+ __FILE__, __LINE__, __func__);
+ *rq_lockedp = 1;
+ erts_enqueue_port(rq, prt);
+ return !0;
}
}
- if (vrq_locked)
- erts_smp_runq_unlock(vrq);
+ erts_smp_runq_unlock(vrq);
return 0;
}
@@ -2577,9 +3530,10 @@ static ERTS_INLINE int
check_possible_steal_victim(ErtsRunQueue *rq, int *rq_lockedp, int vix)
{
ErtsRunQueue *vrq = ERTS_RUNQ_IX(vix);
- erts_aint32_t iflgs = erts_smp_atomic32_read_nob(&vrq->info_flags);
- if (iflgs & ERTS_RUNQ_IFLG_NONEMPTY)
- return try_steal_task_from_victim(rq, rq_lockedp, vrq);
+ Uint32 flags = ERTS_RUNQ_FLGS_GET(vrq);
+ if ((flags & (ERTS_RUNQ_FLG_NONEMPTY
+ | ERTS_RUNQ_FLG_PROTECTED)) == ERTS_RUNQ_FLG_NONEMPTY)
+ return try_steal_task_from_victim(rq, rq_lockedp, vrq, flags);
else
return 0;
}
@@ -2589,15 +3543,12 @@ static int
try_steal_task(ErtsRunQueue *rq)
{
int res, rq_locked, vix, active_rqs, blnc_rqs;
+ Uint32 flags;
- /*
- * We are not allowed to steal jobs to this run queue
- * if it is suspended. Note that it might get suspended
- * at any time when we don't have the lock on the run
- * queue.
- */
- if (rq->flags & ERTS_RUNQ_FLG_SUSPENDED)
- return 0;
+ /* Protect jobs we steal from getting stolen from us... */
+ flags = ERTS_RUNQ_FLGS_SET(rq, ERTS_RUNQ_FLG_PROTECTED);
+ if (flags & ERTS_RUNQ_FLG_SUSPENDED)
+ return 0; /* go suspend instead... */
res = 0;
rq_locked = 1;
@@ -2650,7 +3601,8 @@ try_steal_task(ErtsRunQueue *rq)
erts_smp_runq_lock(rq);
if (!res)
- res = !ERTS_EMPTY_RUNQ(rq);
+ res = rq->halt_in_progress ?
+ !ERTS_EMPTY_RUNQ_PORTS(rq) : !ERTS_EMPTY_RUNQ(rq);
return res;
}
@@ -2715,12 +3667,123 @@ do { \
ASSERT(sum__ == (RQ)->full_reds_history_sum); \
} while (0);
+#define ERTS_PRE_ALLOCED_MPATHS 8
+
+erts_atomic_t erts_migration_paths;
+
+static struct {
+ size_t size;
+ ErtsMigrationPaths *freelist;
+ struct {
+ ErtsMigrationPaths *first;
+ ErtsMigrationPaths *last;
+ } retired;
+} mpaths;
+
+static void
+init_migration_paths(void)
+{
+ int qix, i;
+ char *p;
+ ErtsMigrationPaths *mps;
+
+ mpaths.size = sizeof(ErtsMigrationPaths);
+ mpaths.size += sizeof(ErtsMigrationPath)*(erts_no_schedulers-1);
+ mpaths.size = ERTS_ALC_CACHE_LINE_ALIGN_SIZE(mpaths.size);
+
+ p = erts_alloc_permanent_cache_aligned(ERTS_ALC_T_LL_MPATHS,
+ (mpaths.size
+ * ERTS_PRE_ALLOCED_MPATHS));
+ mpaths.freelist = NULL;
+ for (i = 0; i < ERTS_PRE_ALLOCED_MPATHS-1; i++) {
+ mps = (ErtsMigrationPaths *) p;
+ mps->next = mpaths.freelist;
+ mpaths.freelist = mps;
+ p += mpaths.size;
+ }
+
+ mps = (ErtsMigrationPaths *) p;
+ mps->block = NULL;
+ for (qix = 0; qix < erts_no_run_queues; qix++) {
+ int pix;
+ mps->mpath[qix].flags = 0;
+ mps->mpath[qix].misc_evac_runq = NULL;
+ for (pix = 0; pix < ERTS_NO_PRIO_LEVELS; pix++) {
+ mps->mpath[qix].prio[pix].limit.this = -1;
+ mps->mpath[qix].prio[pix].limit.other = -1;
+ mps->mpath[qix].prio[pix].runq = NULL;
+ mps->mpath[qix].prio[pix].flags = 0;
+ }
+ }
+ erts_atomic_init_wb(&erts_migration_paths, (erts_aint_t) mps);
+}
+
+static ERTS_INLINE ErtsMigrationPaths *
+alloc_mpaths(void)
+{
+ void *block;
+ ErtsMigrationPaths *res;
+ ERTS_SMP_LC_ASSERT(erts_smp_lc_mtx_is_locked(&balance_info.update_mtx));
+
+ res = mpaths.freelist;
+ if (res) {
+ mpaths.freelist = res->next;
+ res->block = NULL;
+ return res;
+ }
+ res = erts_alloc(ERTS_ALC_T_SL_MPATHS,
+ mpaths.size+ERTS_CACHE_LINE_SIZE);
+ block = (void *) res;
+ if (((UWord) res) & ERTS_CACHE_LINE_MASK)
+ res = (ErtsMigrationPaths *) ((((UWord) res) & ~ERTS_CACHE_LINE_MASK)
+ + ERTS_CACHE_LINE_SIZE);
+ res->block = block;
+ return res;
+}
+
+static ERTS_INLINE void
+retire_mpaths(ErtsMigrationPaths *mps)
+{
+ ErtsThrPrgrVal current;
+
+ ERTS_SMP_LC_ASSERT(erts_smp_lc_mtx_is_locked(&balance_info.update_mtx));
+
+ current = erts_thr_progress_current();
+
+ while (mpaths.retired.first) {
+ ErtsMigrationPaths *tmp = mpaths.retired.first;
+ if (!erts_thr_progress_has_reached_this(current, tmp->thr_prgr))
+ break;
+ mpaths.retired.first = tmp->next;
+ if (tmp->block) {
+ erts_free(ERTS_ALC_T_SL_MPATHS, tmp->block);
+ }
+ else {
+ tmp->next = mpaths.freelist;
+ mpaths.freelist = tmp;
+ }
+ }
+
+ if (!mpaths.retired.first)
+ mpaths.retired.last = NULL;
+
+ mps->thr_prgr = erts_thr_progress_later(NULL);
+ mps->next = NULL;
+
+ if (mpaths.retired.last)
+ mpaths.retired.last->next = mps;
+ else
+ mpaths.retired.first = mps;
+ mpaths.retired.last = mps;
+}
+
static void
check_balance(ErtsRunQueue *c_rq)
{
#if ERTS_MAX_PROCESSES >= (1 << 27)
# error check_balance() assumes ERTS_MAX_PROCESS < (1 << 27)
#endif
+ ErtsMigrationPaths *new_mpaths, *old_mpaths;
ErtsRunQueueBalance avg = {0};
Sint64 scheds_reds, full_scheds_reds;
int forced, active, current_active, oowc, half_full_scheds, full_scheds,
@@ -2746,9 +3809,9 @@ check_balance(ErtsRunQueue *c_rq)
ERTS_FOREACH_RUNQ(rq,
{
if (rq->waiting)
- rq->flags |= ERTS_RUNQ_FLG_HALFTIME_OUT_OF_WORK;
+ (void) ERTS_RUNQ_FLGS_SET(rq, ERTS_RUNQ_FLG_HALFTIME_OUT_OF_WORK);
else
- rq->flags &= ~ERTS_RUNQ_FLG_HALFTIME_OUT_OF_WORK;
+ (void) ERTS_RUNQ_FLGS_UNSET(rq, ERTS_RUNQ_FLG_HALFTIME_OUT_OF_WORK);
rq->check_balance_reds = ERTS_RUNQ_CALL_CHECK_BALANCE_REDS;
});
@@ -2790,7 +3853,7 @@ check_balance(ErtsRunQueue *c_rq)
ErtsRunQueue *rq = ERTS_RUNQ_IX(qix);
erts_smp_runq_lock(rq);
- run_queue_info[qix].flags = rq->flags;
+ run_queue_info[qix].flags = ERTS_RUNQ_FLGS_GET_NOB(rq);
for (pix = 0; pix < ERTS_NO_PROC_PRIO_LEVELS; pix++) {
run_queue_info[qix].prio[pix].max_len
= rq->procs.prio_info[pix].max_len;
@@ -3124,47 +4187,27 @@ erts_fprintf(stderr, "--------------------------------\n");
set_no_active_runqs(active);
balance_info.halftime = 1;
- erts_smp_atomic32_set_nob(&balance_info.checking_balance, 0);
+ new_mpaths = alloc_mpaths();
+
+ /* Write migration paths */
- /* Write migration paths and reset balance statistics in all queues */
for (qix = 0; qix < blnc_no_rqs; qix++) {
int mqix;
- Uint32 flags;
- ErtsRunQueue *rq = ERTS_RUNQ_IX(qix);
- ErtsRunQueueInfo *rqi;
- flags = run_queue_info[qix].flags;
- erts_smp_runq_lock(rq);
- flags |= (rq->flags & ~ERTS_RUNQ_FLGS_MIGRATION_INFO);
- ASSERT(!(flags & ERTS_RUNQ_FLG_OUT_OF_WORK));
- if (rq->waiting)
- flags |= ERTS_RUNQ_FLG_OUT_OF_WORK;
+ Uint32 flags = run_queue_info[qix].flags;
+ ErtsMigrationPath *mp = &new_mpaths->mpath[qix];
- rq->full_reds_history_sum
- = run_queue_info[qix].full_reds_history_sum;
- rq->full_reds_history[freds_hist_ix]
- = run_queue_info[qix].full_reds_history_change;
+ mp->flags = flags;
+ mp->misc_evac_runq = NULL;
- ERTS_DBG_CHK_FULL_REDS_HISTORY(rq);
-
- rq->out_of_work_count = 0;
- rq->flags = flags;
- rq->max_len = rq->len;
for (pix = 0; pix < ERTS_NO_PRIO_LEVELS; pix++) {
- rqi = (pix == ERTS_PORT_PRIO_LEVEL
- ? &rq->ports.info
- : &rq->procs.prio_info[pix]);
- rqi->max_len = rqi->len;
- rqi->reds = 0;
if (!(ERTS_CHK_RUNQ_FLG_EMIGRATE(flags, pix)
| ERTS_CHK_RUNQ_FLG_IMMIGRATE(flags, pix))) {
ASSERT(run_queue_info[qix].prio[pix].immigrate_from < 0);
ASSERT(run_queue_info[qix].prio[pix].emigrate_to < 0);
-#ifdef DEBUG
- rqi->migrate.limit.this = -1;
- rqi->migrate.limit.other = -1;
- ERTS_DBG_SET_INVALID_RUNQP(rqi->migrate.runq, 0x2);
-#endif
-
+ mp->prio[pix].limit.this = -1;
+ mp->prio[pix].limit.other = -1;
+ mp->prio[pix].runq = NULL;
+ mp->prio[pix].flags = 0;
}
else if (ERTS_CHK_RUNQ_FLG_EMIGRATE(flags, pix)) {
ASSERT(!ERTS_CHK_RUNQ_FLG_IMMIGRATE(flags, pix));
@@ -3172,11 +4215,12 @@ erts_fprintf(stderr, "--------------------------------\n");
ASSERT(run_queue_info[qix].prio[pix].emigrate_to >= 0);
mqix = run_queue_info[qix].prio[pix].emigrate_to;
- rqi->migrate.limit.this
+ mp->prio[pix].limit.this
= run_queue_info[qix].prio[pix].migration_limit;
- rqi->migrate.limit.other
+ mp->prio[pix].limit.other
= run_queue_info[mqix].prio[pix].migration_limit;
- rqi->migrate.runq = ERTS_RUNQ_IX(mqix);
+ mp->prio[pix].runq = ERTS_RUNQ_IX(mqix);
+ mp->prio[pix].flags = run_queue_info[mqix].flags;
}
else {
ASSERT(ERTS_CHK_RUNQ_FLG_IMMIGRATE(flags, pix));
@@ -3184,24 +4228,142 @@ erts_fprintf(stderr, "--------------------------------\n");
ASSERT(run_queue_info[qix].prio[pix].immigrate_from >= 0);
mqix = run_queue_info[qix].prio[pix].immigrate_from;
- rqi->migrate.limit.this
+ mp->prio[pix].limit.this
= run_queue_info[qix].prio[pix].migration_limit;
- rqi->migrate.limit.other
+ mp->prio[pix].limit.other
= run_queue_info[mqix].prio[pix].migration_limit;
- rqi->migrate.runq = ERTS_RUNQ_IX(mqix);
+ mp->prio[pix].runq = ERTS_RUNQ_IX(mqix);
+ mp->prio[pix].flags = run_queue_info[mqix].flags;
}
}
+ }
+
+ old_mpaths = erts_get_migration_paths_managed();
+
+ /* Keep offline run-queues as is */
+ for (qix = blnc_no_rqs; qix < erts_no_schedulers; qix++) {
+ ErtsMigrationPath *nmp = &new_mpaths->mpath[qix];
+ ErtsMigrationPath *omp = &old_mpaths->mpath[qix];
+
+ nmp->flags = omp->flags;
+ nmp->misc_evac_runq = omp->misc_evac_runq;
+
+ for (pix = 0; pix < ERTS_NO_PRIO_LEVELS; pix++) {
+ nmp->prio[pix].limit.this = omp->prio[pix].limit.this;
+ nmp->prio[pix].limit.other = omp->prio[pix].limit.other;
+ nmp->prio[pix].runq = omp->prio[pix].runq;
+ nmp->prio[pix].flags = omp->prio[pix].flags;
+ }
+ }
+
+
+ /* Publish new migration paths... */
+ erts_atomic_set_wb(&erts_migration_paths, (erts_aint_t) new_mpaths);
+
+ /* Reset balance statistics in all online queues */
+ for (qix = 0; qix < blnc_no_rqs; qix++) {
+ Uint32 flags = run_queue_info[qix].flags;
+ ErtsRunQueue *rq = ERTS_RUNQ_IX(qix);
+
+ erts_smp_runq_lock(rq);
+ ASSERT(!(flags & ERTS_RUNQ_FLG_OUT_OF_WORK));
+ if (rq->waiting)
+ flags |= ERTS_RUNQ_FLG_OUT_OF_WORK;
+
+ rq->full_reds_history_sum
+ = run_queue_info[qix].full_reds_history_sum;
+ rq->full_reds_history[freds_hist_ix]
+ = run_queue_info[qix].full_reds_history_change;
+
+ ERTS_DBG_CHK_FULL_REDS_HISTORY(rq);
+
+ rq->out_of_work_count = 0;
+ (void) ERTS_RUNQ_FLGS_MASK_SET(rq, ERTS_RUNQ_FLGS_MIGRATION_INFO, flags);
+
+ rq->max_len = rq->len;
+ for (pix = 0; pix < ERTS_NO_PRIO_LEVELS; pix++) {
+ ErtsRunQueueInfo *rqi;
+ rqi = (pix == ERTS_PORT_PRIO_LEVEL
+ ? &rq->ports.info
+ : &rq->procs.prio_info[pix]);
+ erts_smp_reset_max_len(rq, rqi);
+ rqi->reds = 0;
+ }
rq->check_balance_reds = ERTS_RUNQ_CALL_CHECK_BALANCE_REDS;
erts_smp_runq_unlock(rq);
}
+ erts_smp_atomic32_set_nob(&balance_info.checking_balance, 0);
+
balance_info.n++;
+ retire_mpaths(old_mpaths);
erts_smp_mtx_unlock(&balance_info.update_mtx);
erts_smp_runq_lock(c_rq);
}
+static void
+change_no_used_runqs(int used)
+{
+ ErtsMigrationPaths *new_mpaths, *old_mpaths;
+ int active, qix;
+ erts_smp_mtx_lock(&balance_info.update_mtx);
+ get_no_runqs(&active, NULL);
+ set_no_used_runqs(used);
+
+ old_mpaths = erts_get_migration_paths_managed();
+ new_mpaths = alloc_mpaths();
+
+ /* Write migration paths... */
+
+ for (qix = 0; qix < used; qix++) {
+ int pix;
+ ErtsMigrationPath *omp = &old_mpaths->mpath[qix];
+ ErtsMigrationPath *nmp = &new_mpaths->mpath[qix];
+
+ nmp->flags = omp->flags & ~ERTS_RUNQ_FLGS_MIGRATION_QMASKS;
+ nmp->misc_evac_runq = NULL;
+
+ for (pix = 0; pix < ERTS_NO_PRIO_LEVELS; pix++) {
+ nmp->prio[pix].limit.this = -1;
+ nmp->prio[pix].limit.other = -1;
+ nmp->prio[pix].runq = NULL;
+ nmp->prio[pix].flags = 0;
+ }
+ }
+ for (qix = used; qix < erts_no_run_queues; qix++) {
+ int pix;
+ ErtsRunQueue *to_rq = ERTS_RUNQ_IX(qix % used);
+ ErtsMigrationPath *nmp = &new_mpaths->mpath[qix];
+
+ nmp->flags = (ERTS_RUNQ_FLGS_EMIGRATE_QMASK
+ | ERTS_RUNQ_FLGS_EVACUATE_QMASK);
+ nmp->misc_evac_runq = to_rq;
+ for (pix = 0; pix < ERTS_NO_PRIO_LEVELS; pix++) {
+ nmp->prio[pix].limit.this = -1;
+ nmp->prio[pix].limit.other = -1;
+ nmp->prio[pix].runq = to_rq;
+ nmp->prio[pix].flags = 0;
+ }
+ }
+
+ /* ... and publish them. */
+ erts_atomic_set_wb(&erts_migration_paths, (erts_aint_t) new_mpaths);
+
+ retire_mpaths(old_mpaths);
+
+ /* Make sure that we balance soon... */
+ balance_info.forced_check_balance = 1;
+
+ erts_smp_mtx_unlock(&balance_info.update_mtx);
+
+ erts_smp_runq_lock(ERTS_RUNQ_IX(0));
+ ERTS_RUNQ_IX(0)->check_balance_reds = 0;
+ erts_smp_runq_unlock(ERTS_RUNQ_IX(0));
+}
+
+
#endif /* #ifdef ERTS_SMP */
Uint
@@ -3218,33 +4380,287 @@ erts_debug_nbalance(void)
#endif
}
+/* Wakeup other schedulers */
+
+typedef enum {
+ ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_VERY_HIGH,
+ ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_HIGH,
+ ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_MEDIUM,
+ ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_LOW,
+ ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_VERY_LOW
+} ErtsSchedWakeupOtherThreshold;
+
+typedef enum {
+ ERTS_SCHED_WAKEUP_OTHER_TYPE_PROPOSAL,
+ ERTS_SCHED_WAKEUP_OTHER_TYPE_LEGACY
+} ErtsSchedWakeupOtherType;
+
+/* First proposal */
+
+#define ERTS_WAKEUP_OTHER_LIMIT_VERY_HIGH (200*CONTEXT_REDS)
+#define ERTS_WAKEUP_OTHER_LIMIT_HIGH (50*CONTEXT_REDS)
+#define ERTS_WAKEUP_OTHER_LIMIT_MEDIUM (10*CONTEXT_REDS)
+#define ERTS_WAKEUP_OTHER_LIMIT_LOW (CONTEXT_REDS)
+#define ERTS_WAKEUP_OTHER_LIMIT_VERY_LOW (CONTEXT_REDS/10)
+
+#define ERTS_WAKEUP_OTHER_DEC_SHIFT_VERY_HIGH 3
+#define ERTS_WAKEUP_OTHER_DEC_SHIFT_HIGH 1
+#define ERTS_WAKEUP_OTHER_DEC_SHIFT_MEDIUM 0
+#define ERTS_WAKEUP_OTHER_DEC_SHIFT_LOW -2
+#define ERTS_WAKEUP_OTHER_DEC_SHIFT_VERY_LOW -5
+
+#define ERTS_WAKEUP_OTHER_DEC_SHIFT 2
+#define ERTS_WAKEUP_OTHER_FIXED_INC (CONTEXT_REDS/10)
+
+/* To be legacy */
+
+#define ERTS_WAKEUP_OTHER_LIMIT_VERY_HIGH_LEGACY (200*CONTEXT_REDS)
+#define ERTS_WAKEUP_OTHER_LIMIT_HIGH_LEGACY (50*CONTEXT_REDS)
+#define ERTS_WAKEUP_OTHER_LIMIT_MEDIUM_LEGACY (10*CONTEXT_REDS)
+#define ERTS_WAKEUP_OTHER_LIMIT_LOW_LEGACY (CONTEXT_REDS)
+#define ERTS_WAKEUP_OTHER_LIMIT_VERY_LOW_LEGACY (CONTEXT_REDS/10)
+
+#define ERTS_WAKEUP_OTHER_DEC_LEGACY 10
+#define ERTS_WAKEUP_OTHER_FIXED_INC_LEGACY (CONTEXT_REDS/10)
+
+#ifdef ERTS_SMP
+
+static struct {
+ ErtsSchedWakeupOtherThreshold threshold;
+ ErtsSchedWakeupOtherType type;
+ int limit;
+ int dec_shift;
+ int dec_mask;
+ void (*check)(ErtsRunQueue *rq, Uint32 flags);
+} wakeup_other;
+
+static void
+wakeup_other_check(ErtsRunQueue *rq, Uint32 flags)
+{
+ int wo_reds = rq->wakeup_other_reds;
+ if (wo_reds) {
+ int left_len = rq->len - 1;
+ if (left_len < 1) {
+ int wo_reduce = wo_reds << wakeup_other.dec_shift;
+ wo_reduce &= wakeup_other.dec_mask;
+ rq->wakeup_other -= wo_reduce;
+ if (rq->wakeup_other < 0)
+ rq->wakeup_other = 0;
+ }
+ else {
+ rq->wakeup_other += (left_len*wo_reds
+ + ERTS_WAKEUP_OTHER_FIXED_INC);
+ if (rq->wakeup_other > wakeup_other.limit) {
+ int empty_rqs =
+ erts_smp_atomic32_read_acqb(&no_empty_run_queues);
+ if (flags & ERTS_RUNQ_FLG_PROTECTED)
+ (void) ERTS_RUNQ_FLGS_UNSET(rq, ERTS_RUNQ_FLG_PROTECTED);
+ if (empty_rqs != 0)
+ wake_scheduler_on_empty_runq(rq);
+ rq->wakeup_other = 0;
+ }
+ }
+ rq->wakeup_other_reds = 0;
+ }
+}
+
+static void
+wakeup_other_set_limit(void)
+{
+ switch (wakeup_other.threshold) {
+ case ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_VERY_HIGH:
+ wakeup_other.limit = ERTS_WAKEUP_OTHER_LIMIT_VERY_HIGH;
+ wakeup_other.dec_shift = ERTS_WAKEUP_OTHER_DEC_SHIFT_VERY_HIGH;
+ break;
+ case ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_HIGH:
+ wakeup_other.limit = ERTS_WAKEUP_OTHER_LIMIT_HIGH;
+ wakeup_other.dec_shift = ERTS_WAKEUP_OTHER_DEC_SHIFT_HIGH;
+ break;
+ case ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_MEDIUM:
+ wakeup_other.limit = ERTS_WAKEUP_OTHER_LIMIT_MEDIUM;
+ wakeup_other.dec_shift = ERTS_WAKEUP_OTHER_DEC_SHIFT_MEDIUM;
+ break;
+ case ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_LOW:
+ wakeup_other.limit = ERTS_WAKEUP_OTHER_LIMIT_LOW;
+ wakeup_other.dec_shift = ERTS_WAKEUP_OTHER_DEC_SHIFT_LOW;
+ break;
+ case ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_VERY_LOW:
+ wakeup_other.limit = ERTS_WAKEUP_OTHER_LIMIT_VERY_LOW;
+ wakeup_other.dec_shift = ERTS_WAKEUP_OTHER_DEC_SHIFT_VERY_LOW;
+ break;
+ }
+ if (wakeup_other.dec_shift < 0)
+ wakeup_other.dec_mask = (1 << (sizeof(wakeup_other.dec_mask)*8
+ + wakeup_other.dec_shift)) - 1;
+ else {
+ wakeup_other.dec_mask = 0;
+ wakeup_other.dec_mask = ~wakeup_other.dec_mask;
+ }
+}
+
+static void
+wakeup_other_check_legacy(ErtsRunQueue *rq, Uint32 flags)
+{
+ int wo_reds = rq->wakeup_other_reds;
+ if (wo_reds) {
+ erts_aint32_t len = rq->len;
+ if (len < 2) {
+ rq->wakeup_other -= ERTS_WAKEUP_OTHER_DEC_LEGACY*wo_reds;
+ if (rq->wakeup_other < 0)
+ rq->wakeup_other = 0;
+ }
+ else if (rq->wakeup_other < wakeup_other.limit)
+ rq->wakeup_other += len*wo_reds + ERTS_WAKEUP_OTHER_FIXED_INC_LEGACY;
+ else {
+ if (flags & ERTS_RUNQ_FLG_PROTECTED)
+ (void) ERTS_RUNQ_FLGS_UNSET(rq, ERTS_RUNQ_FLG_PROTECTED);
+ if (erts_smp_atomic32_read_acqb(&no_empty_run_queues) != 0) {
+ wake_scheduler_on_empty_runq(rq);
+ rq->wakeup_other = 0;
+ }
+ rq->wakeup_other = 0;
+ }
+ }
+ rq->wakeup_other_reds = 0;
+}
+
+static void
+wakeup_other_set_limit_legacy(void)
+{
+ switch (wakeup_other.threshold) {
+ case ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_VERY_HIGH:
+ wakeup_other.limit = ERTS_WAKEUP_OTHER_LIMIT_VERY_HIGH_LEGACY;
+ break;
+ case ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_HIGH:
+ wakeup_other.limit = ERTS_WAKEUP_OTHER_LIMIT_HIGH_LEGACY;
+ break;
+ case ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_MEDIUM:
+ wakeup_other.limit = ERTS_WAKEUP_OTHER_LIMIT_MEDIUM_LEGACY;
+ break;
+ case ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_LOW:
+ wakeup_other.limit = ERTS_WAKEUP_OTHER_LIMIT_LOW_LEGACY;
+ break;
+ case ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_VERY_LOW:
+ wakeup_other.limit = ERTS_WAKEUP_OTHER_LIMIT_VERY_LOW_LEGACY;
+ break;
+ }
+}
+
+static void
+set_wakeup_other_data(void)
+{
+ switch (wakeup_other.type) {
+ case ERTS_SCHED_WAKEUP_OTHER_TYPE_PROPOSAL:
+ wakeup_other.check = wakeup_other_check;
+ wakeup_other_set_limit();
+ break;
+ case ERTS_SCHED_WAKEUP_OTHER_TYPE_LEGACY:
+ wakeup_other.check = wakeup_other_check_legacy;
+ wakeup_other_set_limit_legacy();
+ break;
+ }
+}
+
+#endif
+
void
erts_early_init_scheduling(int no_schedulers)
{
aux_work_timeout_early_init(no_schedulers);
- wakeup_other_limit = ERTS_WAKEUP_OTHER_LIMIT_MEDIUM;
+#ifdef ERTS_SMP
+ wakeup_other.threshold = ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_MEDIUM;
+ wakeup_other.type = ERTS_SCHED_WAKEUP_OTHER_TYPE_LEGACY;
+#endif
+ sched_busy_wait.sys_schedule = ERTS_SCHED_SYS_SLEEP_SPINCOUNT_MEDIUM;
+ sched_busy_wait.tse = (ERTS_SCHED_SYS_SLEEP_SPINCOUNT_MEDIUM
+ * ERTS_SCHED_TSE_SLEEP_SPINCOUNT_FACT);
+ sched_busy_wait.aux_work = (ERTS_SCHED_SYS_SLEEP_SPINCOUNT_MEDIUM
+ * ERTS_SCHED_AUX_WORK_SLEEP_SPINCOUNT_FACT_MEDIUM);
}
int
-erts_sched_set_wakeup_limit(char *str)
+erts_sched_set_wakeup_other_thresold(char *str)
{
+ ErtsSchedWakeupOtherThreshold threshold;
if (sys_strcmp(str, "very_high") == 0)
- wakeup_other_limit = ERTS_WAKEUP_OTHER_LIMIT_VERY_HIGH;
+ threshold = ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_VERY_HIGH;
else if (sys_strcmp(str, "high") == 0)
- wakeup_other_limit = ERTS_WAKEUP_OTHER_LIMIT_HIGH;
+ threshold = ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_HIGH;
else if (sys_strcmp(str, "medium") == 0)
- wakeup_other_limit = ERTS_WAKEUP_OTHER_LIMIT_MEDIUM;
+ threshold = ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_MEDIUM;
else if (sys_strcmp(str, "low") == 0)
- wakeup_other_limit = ERTS_WAKEUP_OTHER_LIMIT_LOW;
+ threshold = ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_LOW;
else if (sys_strcmp(str, "very_low") == 0)
- wakeup_other_limit = ERTS_WAKEUP_OTHER_LIMIT_VERY_LOW;
+ threshold = ERTS_SCHED_WAKEUP_OTHER_THRESHOLD_VERY_LOW;
+ else
+ return EINVAL;
+#ifdef ERTS_SMP
+ wakeup_other.threshold = threshold;
+ set_wakeup_other_data();
+#endif
+ return 0;
+}
+
+int
+erts_sched_set_wakeup_other_type(char *str)
+{
+ ErtsSchedWakeupOtherType type;
+ if (sys_strcmp(str, "proposal") == 0)
+ type = ERTS_SCHED_WAKEUP_OTHER_TYPE_PROPOSAL;
+ else if (sys_strcmp(str, "default") == 0)
+ type = ERTS_SCHED_WAKEUP_OTHER_TYPE_LEGACY;
+ else if (sys_strcmp(str, "legacy") == 0)
+ type = ERTS_SCHED_WAKEUP_OTHER_TYPE_LEGACY;
else
return EINVAL;
+#ifdef ERTS_SMP
+ wakeup_other.type = type;
+#endif
return 0;
}
+int
+erts_sched_set_busy_wait_threshold(char *str)
+{
+ int sys_sched;
+ int aux_work_fact;
+
+ if (sys_strcmp(str, "very_long") == 0) {
+ sys_sched = ERTS_SCHED_SYS_SLEEP_SPINCOUNT_VERY_LONG;
+ aux_work_fact = ERTS_SCHED_AUX_WORK_SLEEP_SPINCOUNT_FACT_VERY_LONG;
+ }
+ else if (sys_strcmp(str, "long") == 0) {
+ sys_sched = ERTS_SCHED_SYS_SLEEP_SPINCOUNT_LONG;
+ aux_work_fact = ERTS_SCHED_AUX_WORK_SLEEP_SPINCOUNT_FACT_LONG;
+ }
+ else if (sys_strcmp(str, "medium") == 0) {
+ sys_sched = ERTS_SCHED_SYS_SLEEP_SPINCOUNT_MEDIUM;
+ aux_work_fact = ERTS_SCHED_AUX_WORK_SLEEP_SPINCOUNT_FACT_MEDIUM;
+ }
+ else if (sys_strcmp(str, "short") == 0) {
+ sys_sched = ERTS_SCHED_SYS_SLEEP_SPINCOUNT_SHORT;
+ aux_work_fact = ERTS_SCHED_AUX_WORK_SLEEP_SPINCOUNT_FACT_SHORT;
+ }
+ else if (sys_strcmp(str, "very_short") == 0) {
+ sys_sched = ERTS_SCHED_SYS_SLEEP_SPINCOUNT_VERY_SHORT;
+ aux_work_fact = ERTS_SCHED_AUX_WORK_SLEEP_SPINCOUNT_FACT_VERY_SHORT;
+ }
+ else if (sys_strcmp(str, "none") == 0) {
+ sys_sched = ERTS_SCHED_SYS_SLEEP_SPINCOUNT_NONE;
+ aux_work_fact = ERTS_SCHED_AUX_WORK_SLEEP_SPINCOUNT_FACT_NONE;
+ }
+ else {
+ return EINVAL;
+ }
+
+ sched_busy_wait.sys_schedule = sys_sched;
+ sched_busy_wait.tse = sys_sched*ERTS_SCHED_TSE_SLEEP_SPINCOUNT_FACT;
+ sched_busy_wait.aux_work = sys_sched*aux_work_fact;
+
+ return 0;
+}
static void
-init_aux_work_data(ErtsAuxWorkData *awdp, ErtsSchedulerData *esdp)
+init_aux_work_data(ErtsAuxWorkData *awdp, ErtsSchedulerData *esdp, char *dawwp)
{
awdp->sched_id = esdp ? (int) esdp->no : 0;
awdp->esdp = esdp;
@@ -3254,6 +4670,8 @@ init_aux_work_data(ErtsAuxWorkData *awdp, ErtsSchedulerData *esdp)
awdp->dd.thr_prgr = ERTS_THR_PRGR_VAL_WAITING;
awdp->dd.completed_callback = NULL;
awdp->dd.completed_arg = NULL;
+ awdp->later_op.first = NULL;
+ awdp->later_op.last = NULL;
#endif
#ifdef ERTS_USE_ASYNC_READY_Q
#ifdef ERTS_SMP
@@ -3262,15 +4680,39 @@ init_aux_work_data(ErtsAuxWorkData *awdp, ErtsSchedulerData *esdp)
#endif
awdp->async_ready.queue = NULL;
#endif
+#ifdef ERTS_SMP
+ if (!dawwp) {
+ awdp->delayed_wakeup.job = NULL;
+ awdp->delayed_wakeup.sched2jix = NULL;
+ awdp->delayed_wakeup.jix = -1;
+ }
+ else {
+ int i;
+ awdp->delayed_wakeup.job = (ErtsDelayedAuxWorkWakeupJob *) dawwp;
+ dawwp += sizeof(ErtsDelayedAuxWorkWakeupJob)*(erts_no_schedulers+1);
+ awdp->delayed_wakeup.sched2jix = (int *) dawwp;
+ awdp->delayed_wakeup.jix = -1;
+ for (i = 0; i <= erts_no_schedulers; i++)
+ awdp->delayed_wakeup.sched2jix[i] = -1;
+ }
+#endif
}
void
erts_init_scheduling(int no_schedulers, int no_schedulers_online)
{
int ix, n, no_ssi;
+ char *daww_ptr;
+#ifdef ERTS_SMP
+ size_t daww_sz;
+#endif
init_misc_op_list_alloc();
+#ifdef ERTS_SMP
+ set_wakeup_other_data();
+#endif
+
ASSERT(no_schedulers_online <= no_schedulers);
ASSERT(no_schedulers_online >= 1);
ASSERT(no_schedulers >= 1);
@@ -3293,7 +4735,6 @@ erts_init_scheduling(int no_schedulers, int no_schedulers_online)
ErtsRunQueue *rq = ERTS_RUNQ_IX(ix);
rq->ix = ix;
- erts_smp_atomic32_init_nob(&rq->info_flags, ERTS_RUNQ_IFLG_NONEMPTY);
/* make sure that the "extra" id correponds to the schedulers
* id if the esdp->no <-> ix+1 mapping change.
@@ -3304,7 +4745,7 @@ erts_init_scheduling(int no_schedulers, int no_schedulers_online)
rq->waiting = 0;
rq->woken = 0;
- rq->flags = 0;
+ ERTS_RUNQ_FLGS_INIT(rq, ERTS_RUNQ_FLG_NONEMPTY);
rq->check_balance_reds = ERTS_RUNQ_CALL_CHECK_BALANCE_REDS;
rq->full_reds_history_sum = 0;
for (rix = 0; rix < ERTS_FULL_REDS_HISTORY_SIZE; rix++) {
@@ -3316,20 +4757,16 @@ erts_init_scheduling(int no_schedulers, int no_schedulers_online)
rq->len = 0;
rq->wakeup_other = 0;
rq->wakeup_other_reds = 0;
+ rq->halt_in_progress = 0;
- rq->procs.len = 0;
rq->procs.pending_exiters = NULL;
rq->procs.context_switches = 0;
rq->procs.reductions = 0;
for (pix = 0; pix < ERTS_NO_PROC_PRIO_LEVELS; pix++) {
- rq->procs.prio_info[pix].len = 0;
+ erts_smp_atomic32_init_nob(&rq->procs.prio_info[pix].len, 0);
rq->procs.prio_info[pix].max_len = 0;
rq->procs.prio_info[pix].reds = 0;
- rq->procs.prio_info[pix].migrate.limit.this = 0;
- rq->procs.prio_info[pix].migrate.limit.other = 0;
- ERTS_DBG_SET_INVALID_RUNQP(rq->procs.prio_info[pix].migrate.runq,
- 0x0);
if (pix < ERTS_NO_PROC_PRIO_LEVELS - 1) {
rq->procs.prio[pix].first = NULL;
rq->procs.prio[pix].last = NULL;
@@ -3338,14 +4775,10 @@ erts_init_scheduling(int no_schedulers, int no_schedulers_online)
rq->misc.start = NULL;
rq->misc.end = NULL;
- rq->misc.evac_runq = NULL;
- rq->ports.info.len = 0;
+ erts_smp_atomic32_init_nob(&rq->ports.info.len, 0);
rq->ports.info.max_len = 0;
rq->ports.info.reds = 0;
- rq->ports.info.migrate.limit.this = 0;
- rq->ports.info.migrate.limit.other = 0;
- rq->ports.info.migrate.runq = NULL;
rq->ports.start = NULL;
rq->ports.end = NULL;
}
@@ -3395,6 +4828,15 @@ erts_init_scheduling(int no_schedulers, int no_schedulers_online)
/* Create and initialize scheduler specific data */
+#ifdef ERTS_SMP
+ daww_sz = ERTS_ALC_CACHE_LINE_ALIGN_SIZE((sizeof(ErtsDelayedAuxWorkWakeupJob)
+ + sizeof(int))*(n+1));
+ daww_ptr = erts_alloc_permanent_cache_aligned(ERTS_ALC_T_SCHDLR_DATA,
+ daww_sz*n);
+#else
+ daww_ptr = NULL;
+#endif
+
erts_aligned_scheduler_data =
erts_alloc_permanent_cache_aligned(ERTS_ALC_T_SCHDLR_DATA,
n*sizeof(ErtsAlignedSchedulerData));
@@ -3429,10 +4871,18 @@ erts_init_scheduling(int no_schedulers, int no_schedulers_online)
esdp->run_queue = ERTS_RUNQ_IX(ix);
esdp->run_queue->scheduler = esdp;
- init_aux_work_data(&esdp->aux_work_data, esdp);
+ init_aux_work_data(&esdp->aux_work_data, esdp, daww_ptr);
+#ifdef ERTS_SMP
+ daww_ptr += daww_sz;
+#endif
+ init_sched_wall_time(&esdp->sched_wall_time);
}
init_misc_aux_work();
+#if !HALFWORD_HEAP
+ init_swtreq_alloc();
+#endif
+
#ifdef ERTS_SMP
@@ -3463,10 +4913,12 @@ erts_init_scheduling(int no_schedulers, int no_schedulers_online)
balance_info.prev_rise.reds = 0;
balance_info.n = 0;
+ init_migration_paths();
+
if (no_schedulers_online < no_schedulers) {
+ change_no_used_runqs(no_schedulers_online);
for (ix = no_schedulers_online; ix < erts_no_run_queues; ix++)
- evacuate_run_queue(ERTS_RUNQ_IX(ix),
- ERTS_RUNQ_IX(ix % no_schedulers_online));
+ suspend_run_queue(ERTS_RUNQ_IX(ix));
}
schdlr_sspnd.wait_curr_online = no_schedulers_online;
@@ -3505,6 +4957,9 @@ erts_init_scheduling(int no_schedulers, int no_schedulers_online)
ERTS_VERIFY_UNUSED_TEMP_ALLOC(NULL);
#endif
#endif
+
+ erts_smp_atomic32_init_relb(&erts_halt_progress, -1);
+ erts_halt_code = 0;
}
ErtsRunQueue *
@@ -3526,91 +4981,197 @@ erts_get_scheduler_data(void)
#endif
-static int remove_proc_from_runq(ErtsRunQueue *rq, Process *p, int to_inactive);
+/*
+ * scheduler_out_process() return with c_rq locked.
+ */
+static ERTS_INLINE int
+schedule_out_process(ErtsRunQueue *c_rq, erts_aint32_t state, Process *p)
+{
+ erts_aint32_t a, e, n;
+ int res = 0;
+
+ a = state;
+
+ while (1) {
+ n = e = a;
+
+ ASSERT(a & ERTS_PSFLG_RUNNING);
+ ASSERT(!(a & ERTS_PSFLG_IN_RUNQ));
+
+ n &= ~ERTS_PSFLG_RUNNING;
+ if ((a & (ERTS_PSFLG_ACTIVE|ERTS_PSFLG_SUSPENDED)) == ERTS_PSFLG_ACTIVE)
+ n |= ERTS_PSFLG_IN_RUNQ;
+ a = erts_smp_atomic32_cmpxchg_mb(&p->state, n, e);
+ if (a == e)
+ break;
+ }
+
+ if (!(n & ERTS_PSFLG_IN_RUNQ)) {
+ if (erts_system_profile_flags.runnable_procs)
+ profile_runnable_proc(p, am_inactive);
+ }
+ else {
+ int prio = (int) (ERTS_PSFLG_PRIO_MASK & n);
+ ErtsRunQueue *runq = erts_get_runq_proc(p);
+
+ ASSERT(!(n & ERTS_PSFLG_SUSPENDED));
+
+#ifdef ERTS_SMP
+ if (!(ERTS_PSFLG_BOUND & n)) {
+ ErtsRunQueue *new_runq = erts_check_emigration_need(runq, prio);
+ if (new_runq) {
+ RUNQ_SET_RQ(&p->run_queue, new_runq);
+ runq = new_runq;
+ }
+ }
+#endif
+ ASSERT(runq);
+ res = 1;
+
+ erts_smp_runq_lock(runq);
+
+ /* Enqueue the process */
+ enqueue_process(runq, prio, p);
+
+ if (runq == c_rq)
+ return res;
+ erts_smp_runq_unlock(runq);
+ smp_notify_inc_runq(runq);
+ }
+ erts_smp_runq_lock(c_rq);
+ return res;
+}
static ERTS_INLINE void
-suspend_process(ErtsRunQueue *rq, Process *p)
+add2runq(Process *p, erts_aint32_t state)
{
- ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS & erts_proc_lc_my_proc_locks(p));
- ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(rq));
- p->rcount++; /* count number of suspend */
-#ifdef ERTS_SMP
- ASSERT(!(p->runq_flags & ERTS_PROC_RUNQ_FLG_RUNNING)
- || p == erts_get_current_process());
- ASSERT(p->status != P_RUNNING
- || p->runq_flags & ERTS_PROC_RUNQ_FLG_RUNNING);
- if (p->status_flags & ERTS_PROC_SFLG_PENDADD2SCHEDQ)
- goto runable;
-#endif
- switch(p->status) {
- case P_SUSPENDED:
- break;
- case P_RUNABLE:
+ int prio = (int) (ERTS_PSFLG_PRIO_MASK & state);
+ ErtsRunQueue *runq = erts_get_runq_proc(p);
+
#ifdef ERTS_SMP
- runable:
- if (!ERTS_PROC_PENDING_EXIT(p))
+ if (!(ERTS_PSFLG_BOUND & state)) {
+ ErtsRunQueue *new_runq = erts_check_emigration_need(runq, prio);
+ if (new_runq) {
+ RUNQ_SET_RQ(&p->run_queue, new_runq);
+ runq = new_runq;
+ }
+ }
#endif
- remove_proc_from_runq(rq, p, 1);
- /* else:
- * leave process in schedq so it will discover the pending exit
- */
- p->rstatus = P_RUNABLE; /* wakeup as runnable */
- break;
- case P_RUNNING:
- p->rstatus = P_RUNABLE; /* wakeup as runnable */
- break;
- case P_WAITING:
- p->rstatus = P_WAITING; /* wakeup as waiting */
- break;
- case P_EXITING:
- return; /* ignore this */
- case P_GARBING:
- case P_FREE:
- erl_exit(1, "bad state in suspend_process()\n");
+ ASSERT(runq);
+
+ erts_smp_runq_lock(runq);
+
+ /* Enqueue the process */
+ enqueue_process(runq, prio, p);
+
+ erts_smp_runq_unlock(runq);
+ smp_notify_inc_runq(runq);
+
+}
+
+static ERTS_INLINE void
+schedule_process(Process *p, erts_aint32_t state, int active_enq)
+{
+ erts_aint32_t a = state, n;
+
+ while (1) {
+ erts_aint32_t e;
+ n = e = a;
+
+ if (a & ERTS_PSFLG_FREE)
+ return; /* We don't want to schedule free processes... */
+ n |= ERTS_PSFLG_ACTIVE;
+ if (!(a & (ERTS_PSFLG_SUSPENDED|ERTS_PSFLG_RUNNING)))
+ n |= ERTS_PSFLG_IN_RUNQ;
+ a = erts_smp_atomic32_cmpxchg_mb(&p->state, n, e);
+ if (a == e)
+ break;
+ if (!active_enq && (a & ERTS_PSFLG_ACTIVE))
+ return; /* Someone else activated process ... */
}
- if ((erts_system_profile_flags.runnable_procs) && (p->rcount == 1) && (p->status != P_WAITING)) {
- profile_runnable_proc(p, am_inactive);
+ if (erts_system_profile_flags.runnable_procs
+ && !(a & (ERTS_PSFLG_ACTIVE|ERTS_PSFLG_SUSPENDED))) {
+ profile_runnable_proc(p, am_active);
}
- p->status = P_SUSPENDED;
-
+ if ((n & ERTS_PSFLG_IN_RUNQ) && !(a & ERTS_PSFLG_IN_RUNQ))
+ add2runq(p, n);
}
-static ERTS_INLINE void
-resume_process(Process *p)
+void
+erts_schedule_process(Process *p, erts_aint32_t state)
{
- Uint32 *statusp;
+ schedule_process(p, state, 0);
+}
+
+static ERTS_INLINE int
+suspend_process(Process *c_p, Process *p)
+{
+ erts_aint32_t state = erts_smp_atomic32_read_acqb(&p->state);
+ int suspended = 0;
ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS & erts_proc_lc_my_proc_locks(p));
- switch (p->status) {
- case P_SUSPENDED:
- statusp = &p->status;
- break;
- case P_GARBING:
- if (p->gcstatus == P_SUSPENDED) {
- statusp = &p->gcstatus;
- break;
+
+ if ((state & ERTS_PSFLG_SUSPENDED))
+ suspended = -1;
+ else {
+ if (c_p == p) {
+ state = erts_smp_atomic32_read_bor_relb(&p->state,
+ ERTS_PSFLG_SUSPENDED);
+ state |= ERTS_PSFLG_SUSPENDED;
+ ASSERT(state & ERTS_PSFLG_RUNNING);
+ suspended = 1;
+ }
+ else {
+ while (!(state & (ERTS_PSFLG_RUNNING|ERTS_PSFLG_EXITING))) {
+ erts_aint32_t e, n;
+ n = e = state;
+ n |= ERTS_PSFLG_SUSPENDED;
+ state = erts_smp_atomic32_cmpxchg_relb(&p->state, n, e);
+ if (state == e) {
+ state = n;
+ suspended = 1;
+ break;
+ }
+ }
}
- /* Fall through */
- default:
- return;
}
+ if (state & ERTS_PSFLG_SUSPENDED) {
+
+ ASSERT(!(ERTS_PSFLG_RUNNING & state)
+ || p == erts_get_current_process());
+
+ if (erts_system_profile_flags.runnable_procs
+ && (p->rcount == 0)
+ && (state & ERTS_PSFLG_ACTIVE)) {
+ profile_runnable_proc(p, am_inactive);
+ }
+
+ p->rcount++; /* count number of suspend */
+ }
+ return suspended;
+}
+
+static ERTS_INLINE void
+resume_process(Process *p)
+{
+ erts_aint32_t state;
+ ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS & erts_proc_lc_my_proc_locks(p));
+
ASSERT(p->rcount > 0);
if (--p->rcount > 0) /* multiple suspend */
return;
- switch(p->rstatus) {
- case P_RUNABLE:
- erts_add_to_runq(p);
- break;
- case P_WAITING:
- *statusp = P_WAITING;
- break;
- default:
- erl_exit(1, "bad state in resume_process()\n");
+
+ state = erts_smp_atomic32_read_band_mb(&p->state, ~ERTS_PSFLG_SUSPENDED);
+ state &= ~ERTS_PSFLG_SUSPENDED;
+ if ((state & (ERTS_PSFLG_EXITING
+ | ERTS_PSFLG_ACTIVE
+ | ERTS_PSFLG_IN_RUNQ
+ | ERTS_PSFLG_RUNNING)) == ERTS_PSFLG_ACTIVE) {
+ schedule_process(p, state, 1);
}
- p->rstatus = P_FREE;
}
int
@@ -3734,6 +5295,7 @@ suspend_scheduler(ErtsSchedulerData *esdp)
int wake = 0;
erts_aint32_t aux_work;
int thr_prgr_active = 1;
+ ErtsStuckBoundProcesses sbp = {NULL, NULL};
/*
* Schedulers may be suspended in two different ways:
@@ -3748,6 +5310,8 @@ suspend_scheduler(ErtsSchedulerData *esdp)
ASSERT(no != 1);
+ evacuate_run_queue(esdp->run_queue, &sbp);
+
erts_smp_runq_unlock(esdp->run_queue);
erts_sched_check_cpu_bind_prep_suspend(esdp);
@@ -3755,6 +5319,8 @@ suspend_scheduler(ErtsSchedulerData *esdp)
if (erts_system_profile_flags.scheduler)
profile_scheduler(make_small(esdp->no), am_inactive);
+ sched_wall_time_change(esdp, 0);
+
erts_smp_mtx_lock(&schdlr_sspnd.mtx);
flgs = sched_prep_spin_suspended(ssi, ERTS_SSI_FLG_SUSPENDED);
@@ -3809,20 +5375,35 @@ suspend_scheduler(ErtsSchedulerData *esdp)
erts_smp_mtx_unlock(&schdlr_sspnd.mtx);
while (1) {
+ erts_aint32_t qmask;
erts_aint32_t flgs;
+ qmask = (ERTS_RUNQ_FLGS_GET(esdp->run_queue)
+ & ERTS_RUNQ_FLGS_QMASK);
aux_work = erts_atomic32_read_acqb(&ssi->aux_work);
- if (aux_work) {
- if (!thr_prgr_active)
+ if (aux_work|qmask) {
+ if (!thr_prgr_active) {
erts_thr_progress_active(esdp, thr_prgr_active = 1);
- aux_work = handle_aux_work(&esdp->aux_work_data, aux_work);
+ sched_wall_time_change(esdp, 1);
+ }
+ if (aux_work)
+ aux_work = handle_aux_work(&esdp->aux_work_data,
+ aux_work,
+ 1);
if (aux_work && erts_thr_progress_update(esdp))
erts_thr_progress_leader_update(esdp);
+ if (qmask) {
+ erts_smp_runq_lock(esdp->run_queue);
+ evacuate_run_queue(esdp->run_queue, &sbp);
+ erts_smp_runq_unlock(esdp->run_queue);
+ }
}
if (!aux_work) {
- if (thr_prgr_active)
+ if (thr_prgr_active) {
erts_thr_progress_active(esdp, thr_prgr_active = 0);
+ sched_wall_time_change(esdp, 0);
+ }
erts_thr_progress_prepare_wait(esdp);
flgs = sched_spin_suspended(ssi,
ERTS_SCHED_SUSPEND_SLEEP_SPINCOUNT);
@@ -3877,62 +5458,19 @@ suspend_scheduler(ErtsSchedulerData *esdp)
if (erts_system_profile_flags.scheduler)
profile_scheduler(make_small(esdp->no), am_active);
- if (!thr_prgr_active)
+ if (!thr_prgr_active) {
erts_thr_progress_active(esdp, thr_prgr_active = 1);
+ sched_wall_time_change(esdp, 1);
+ }
erts_smp_runq_lock(esdp->run_queue);
non_empty_runq(esdp->run_queue);
+ schedule_bound_processes(esdp->run_queue, &sbp);
+
erts_sched_check_cpu_bind_post_suspend(esdp);
}
-#define ERTS_RUNQ_RESET_SUSPEND_INFO(RQ, DBG_ID) \
-do { \
- int pix__; \
- (RQ)->misc.evac_runq = NULL; \
- (RQ)->ports.info.migrate.runq = NULL; \
- (RQ)->flags &= ~(ERTS_RUNQ_FLGS_IMMIGRATE_QMASK \
- | ERTS_RUNQ_FLGS_EMIGRATE_QMASK \
- | ERTS_RUNQ_FLGS_EVACUATE_QMASK \
- | ERTS_RUNQ_FLG_SUSPENDED); \
- (RQ)->flags |= (ERTS_RUNQ_FLG_OUT_OF_WORK \
- | ERTS_RUNQ_FLG_HALFTIME_OUT_OF_WORK); \
- (RQ)->check_balance_reds = ERTS_RUNQ_CALL_CHECK_BALANCE_REDS; \
- erts_smp_atomic32_read_band_nob(&(RQ)->info_flags, ~ERTS_RUNQ_IFLG_SUSPENDED);\
- for (pix__ = 0; pix__ < ERTS_NO_PROC_PRIO_LEVELS; pix__++) { \
- (RQ)->procs.prio_info[pix__].max_len = 0; \
- (RQ)->procs.prio_info[pix__].reds = 0; \
- ERTS_DBG_SET_INVALID_RUNQP((RQ)->procs.prio_info[pix__].migrate.runq,\
- (DBG_ID)); \
- } \
- (RQ)->ports.info.max_len = 0; \
- (RQ)->ports.info.reds = 0; \
-} while (0)
-
-#define ERTS_RUNQ_RESET_MIGRATION_PATHS__(RQ) \
-do { \
- ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked((RQ))); \
- (RQ)->misc.evac_runq = NULL; \
- (RQ)->ports.info.migrate.runq = NULL; \
- (RQ)->flags &= ~(ERTS_RUNQ_FLGS_IMMIGRATE_QMASK \
- | ERTS_RUNQ_FLGS_EMIGRATE_QMASK \
- | ERTS_RUNQ_FLGS_EVACUATE_QMASK); \
-} while (0)
-
-#ifdef DEBUG
-#define ERTS_RUNQ_RESET_MIGRATION_PATHS(RQ, DBG_ID) \
-do { \
- int pix__; \
- ERTS_RUNQ_RESET_MIGRATION_PATHS__((RQ)); \
- for (pix__ = 0; pix__ < ERTS_NO_PROC_PRIO_LEVELS; pix__++) \
- ERTS_DBG_SET_INVALID_RUNQP((RQ)->procs.prio_info[pix__].migrate.runq,\
- (DBG_ID)); \
-} while (0)
-#else
-#define ERTS_RUNQ_RESET_MIGRATION_PATHS(RQ, DBG_ID) \
- ERTS_RUNQ_RESET_MIGRATION_PATHS__((RQ))
-#endif
-
ErtsSchedSuspendResult
erts_schedulers_state(Uint *total,
Uint *online,
@@ -4002,27 +5540,13 @@ erts_set_schedulers_online(Process *p,
have_unlocked_plocks = 1;
erts_smp_proc_unlock(p, plocks);
}
- erts_smp_mtx_unlock(&schdlr_sspnd.mtx);
- erts_smp_mtx_lock(&balance_info.update_mtx);
- for (ix = online; ix < no; ix++) {
- ErtsRunQueue *rq = ERTS_RUNQ_IX(ix);
- erts_smp_runq_lock(rq);
- ERTS_RUNQ_RESET_SUSPEND_INFO(rq, 0x5);
- erts_smp_runq_unlock(rq);
- scheduler_ix_resume_wake(ix);
- }
- /*
- * Spread evacuation paths among all online
- * run queues.
- */
- for (ix = no; ix < erts_no_run_queues; ix++) {
- ErtsRunQueue *from_rq = ERTS_RUNQ_IX(ix);
- ErtsRunQueue *to_rq = ERTS_RUNQ_IX(ix % no);
- evacuate_run_queue(from_rq, to_rq);
- }
- set_no_used_runqs(no);
- erts_smp_mtx_unlock(&balance_info.update_mtx);
- erts_smp_mtx_lock(&schdlr_sspnd.mtx);
+ change_no_used_runqs(no);
+
+ for (ix = online; ix < no; ix++)
+ resume_run_queue(ERTS_RUNQ_IX(ix));
+
+ for (ix = no; ix < erts_no_run_queues; ix++)
+ suspend_run_queue(ERTS_RUNQ_IX(ix));
}
res = ERTS_SCHDLR_SSPND_DONE;
}
@@ -4049,25 +5573,11 @@ erts_set_schedulers_online(Process *p,
have_unlocked_plocks = 1;
erts_smp_proc_unlock(p, plocks);
}
- erts_smp_mtx_unlock(&schdlr_sspnd.mtx);
- erts_smp_mtx_lock(&balance_info.update_mtx);
-
- for (ix = 0; ix < online; ix++) {
- ErtsRunQueue *rq = ERTS_RUNQ_IX(ix);
- erts_smp_runq_lock(rq);
- ERTS_RUNQ_RESET_MIGRATION_PATHS(rq, 0x6);
- erts_smp_runq_unlock(rq);
- }
- /*
- * Evacutation order important! Newly suspended run queues
- * has to be evacuated last.
- */
- for (ix = erts_no_run_queues-1; ix >= no; ix--)
- evacuate_run_queue(ERTS_RUNQ_IX(ix),
- ERTS_RUNQ_IX(ix % no));
- set_no_used_runqs(no);
- erts_smp_mtx_unlock(&balance_info.update_mtx);
- erts_smp_mtx_lock(&schdlr_sspnd.mtx);
+
+ change_no_used_runqs(no);
+ for (ix = no; ix < erts_no_run_queues; ix++)
+ suspend_run_queue(ERTS_RUNQ_IX(ix));
+
for (ix = no; ix < online; ix++) {
ErtsRunQueue *rq = ERTS_RUNQ_IX(ix);
wake_scheduler(rq, 0);
@@ -4164,25 +5674,14 @@ erts_block_multi_scheduling(Process *p, ErtsProcLocks plocks, int on, int all)
schdlr_sspnd.msb.wait_active = 2;
}
- erts_smp_mtx_unlock(&schdlr_sspnd.mtx);
- erts_smp_mtx_lock(&balance_info.update_mtx);
- set_no_used_runqs(1);
- for (ix = 0; ix < online; ix++) {
+ change_no_used_runqs(1);
+ for (ix = 1; ix < erts_no_run_queues; ix++)
+ suspend_run_queue(ERTS_RUNQ_IX(ix));
+
+ for (ix = 1; ix < online; ix++) {
ErtsRunQueue *rq = ERTS_RUNQ_IX(ix);
- erts_smp_runq_lock(rq);
- ASSERT(!(rq->flags & ERTS_RUNQ_FLG_SUSPENDED));
- ERTS_RUNQ_RESET_MIGRATION_PATHS(rq, 0x7);
- erts_smp_runq_unlock(rq);
+ wake_scheduler(rq, 0);
}
- /*
- * Evacuate all activities in all other run queues
- * into the first run queue. Note order is important,
- * online run queues has to be evacuated last.
- */
- for (ix = erts_no_run_queues-1; ix >= 1; ix--)
- evacuate_run_queue(ERTS_RUNQ_IX(ix), ERTS_RUNQ_IX(0));
- erts_smp_mtx_unlock(&balance_info.update_mtx);
- erts_smp_mtx_lock(&schdlr_sspnd.mtx);
if (erts_smp_atomic32_read_nob(&schdlr_sspnd.active)
!= schdlr_sspnd.msb.wait_active) {
@@ -4226,15 +5725,6 @@ erts_block_multi_scheduling(Process *p, ErtsProcLocks plocks, int on, int all)
plp = proclist_create(p);
plp->next = schdlr_sspnd.msb.procs;
schdlr_sspnd.msb.procs = plp;
-#ifdef DEBUG
- ERTS_FOREACH_RUNQ(srq,
- {
- if (srq != ERTS_RUNQ_IX(0)) {
- ASSERT(ERTS_EMPTY_RUNQ(srq));
- ASSERT(srq->flags & ERTS_RUNQ_FLG_SUSPENDED);
- }
- });
-#endif
ASSERT(p->scheduler_data);
}
}
@@ -4266,27 +5756,6 @@ erts_block_multi_scheduling(Process *p, ErtsProcLocks plocks, int on, int all)
res = ERTS_SCHDLR_SSPND_DONE_MSCHED_BLOCKED;
else {
ERTS_SCHDLR_SSPND_CHNG_SET(ERTS_SCHDLR_SSPND_CHNG_MSB, 0);
-#ifdef DEBUG
- ERTS_FOREACH_RUNQ(rq,
- {
- if (rq != p->scheduler_data->run_queue) {
- if (!ERTS_EMPTY_RUNQ(rq)) {
- Process *rp;
- int pix;
- ASSERT(rq->ports.info.len == 0);
- for (pix = 0; pix < ERTS_NO_PROC_PRIO_LEVELS; pix++) {
- for (rp = rq->procs.prio[pix].first;
- rp;
- rp = rp->next) {
- ASSERT(rp->bound_runq);
- }
- }
- }
-
- ASSERT(rq->flags & ERTS_RUNQ_FLG_SUSPENDED);
- }
- });
-#endif
p->flags &= ~F_HAVE_BLCKD_MSCHED;
schdlr_sspnd.msb.ongoing = 0;
if (schdlr_sspnd.online == 1) {
@@ -4296,35 +5765,19 @@ erts_block_multi_scheduling(Process *p, ErtsProcLocks plocks, int on, int all)
}
else {
int online = schdlr_sspnd.online;
- erts_smp_mtx_unlock(&schdlr_sspnd.mtx);
if (plocks) {
have_unlocked_plocks = 1;
erts_smp_proc_unlock(p, plocks);
}
- erts_smp_mtx_lock(&balance_info.update_mtx);
+
+ change_no_used_runqs(online);
/* Resume all online run queues */
- for (ix = 1; ix < online; ix++) {
- ErtsRunQueue *rq = ERTS_RUNQ_IX(ix);
- erts_smp_runq_lock(rq);
- ERTS_RUNQ_RESET_SUSPEND_INFO(rq, 0x4);
- erts_smp_runq_unlock(rq);
- scheduler_ix_resume_wake(ix);
- }
+ for (ix = 1; ix < online; ix++)
+ resume_run_queue(ERTS_RUNQ_IX(ix));
- /* Spread evacuation paths among all online run queues */
for (ix = online; ix < erts_no_run_queues; ix++)
- evacuate_run_queue(ERTS_RUNQ_IX(ix),
- ERTS_RUNQ_IX(ix % online));
-
- set_no_used_runqs(online);
- /* Make sure that we balance soon... */
- balance_info.forced_check_balance = 1;
- erts_smp_runq_lock(ERTS_RUNQ_IX(0));
- ERTS_RUNQ_IX(0)->check_balance_reds = 0;
- erts_smp_runq_unlock(ERTS_RUNQ_IX(0));
- erts_smp_mtx_unlock(&balance_info.update_mtx);
- erts_smp_mtx_lock(&schdlr_sspnd.mtx);
+ suspend_run_queue(ERTS_RUNQ_IX(ix));
}
res = ERTS_SCHDLR_SSPND_DONE;
}
@@ -4631,10 +6084,7 @@ handle_pend_sync_suspend(Process *suspendee,
if (suspender) {
ASSERT(is_nil(suspender->suspendee));
if (suspendee_alive) {
- ErtsRunQueue *rq = erts_get_runq_proc(suspendee);
- erts_smp_runq_lock(rq);
- suspend_process(rq, suspendee);
- erts_smp_runq_unlock(rq);
+ erts_suspend(suspendee, suspendee_locks, NULL);
suspender->suspendee = suspendee->id;
}
/* suspender is suspended waiting for suspendee to suspend;
@@ -4677,10 +6127,9 @@ pid2proc_not_running(Process *c_p, ErtsProcLocks c_p_locks,
resume_process(rp);
}
else {
- ErtsRunQueue *cp_rq, *rp_rq;
rp = erts_pid2proc(c_p, c_p_locks|ERTS_PROC_LOCK_STATUS,
- pid, ERTS_PROC_LOCK_STATUS);
+ pid, pid_locks|ERTS_PROC_LOCK_STATUS);
if (!rp) {
c_p->flags &= ~F_P2PNR_RESCHED;
@@ -4689,58 +6138,36 @@ pid2proc_not_running(Process *c_p, ErtsProcLocks c_p_locks,
ASSERT(!(c_p->flags & F_P2PNR_RESCHED));
- cp_rq = erts_get_runq_proc(c_p);
- rp_rq = erts_get_runq_proc(rp);
- erts_smp_runqs_lock(cp_rq, rp_rq);
- if (rp->runq_flags & ERTS_PROC_RUNQ_FLG_RUNNING) {
- running:
- /* Phiu... */
-
- /*
- * If we got pending suspenders and suspend ourselves waiting
- * to suspend another process we might deadlock.
- * In this case we have to yield, be suspended by
- * someone else and then do it all over again.
- */
- if (!c_p->pending_suspenders) {
- /* Mark rp pending for suspend by c_p */
- add_pend_suspend(rp, c_p->id, handle_pend_sync_suspend);
- ASSERT(is_nil(c_p->suspendee));
-
- /* Suspend c_p; when rp is suspended c_p will be resumed. */
- suspend_process(cp_rq, c_p);
- c_p->flags |= F_P2PNR_RESCHED;
- }
- /* Yield (caller is assumed to yield immediately in bif). */
- erts_smp_proc_unlock(rp, ERTS_PROC_LOCK_STATUS);
- rp = ERTS_PROC_LOCK_BUSY;
+ if (suspend) {
+ if (suspend_process(c_p, rp))
+ goto done;
}
else {
- ErtsProcLocks need_locks = pid_locks & ~ERTS_PROC_LOCK_STATUS;
- if (need_locks && erts_smp_proc_trylock(rp, need_locks) == EBUSY) {
- erts_smp_runqs_unlock(cp_rq, rp_rq);
- erts_smp_proc_unlock(rp, ERTS_PROC_LOCK_STATUS);
- rp = erts_pid2proc(c_p, c_p_locks|ERTS_PROC_LOCK_STATUS,
- pid, pid_locks|ERTS_PROC_LOCK_STATUS);
- if (!rp)
- goto done;
- /* run-queues may have changed */
- cp_rq = erts_get_runq_proc(c_p);
- rp_rq = erts_get_runq_proc(rp);
- erts_smp_runqs_lock(cp_rq, rp_rq);
- if (rp->runq_flags & ERTS_PROC_RUNQ_FLG_RUNNING) {
- /* Ahh... */
- erts_smp_proc_unlock(rp,
- pid_locks & ~ERTS_PROC_LOCK_STATUS);
- goto running;
- }
- }
+ if (!(ERTS_PSFLG_RUNNING & erts_smp_atomic32_read_acqb(&rp->state)))
+ goto done;
+
+ }
+
+ /* Other process running */
+
+ /*
+ * If we got pending suspenders and suspend ourselves waiting
+ * to suspend another process we might deadlock.
+ * In this case we have to yield, be suspended by
+ * someone else and then do it all over again.
+ */
+ if (!c_p->pending_suspenders) {
+ /* Mark rp pending for suspend by c_p */
+ add_pend_suspend(rp, c_p->id, handle_pend_sync_suspend);
+ ASSERT(is_nil(c_p->suspendee));
- /* rp is not running and we got the locks we want... */
- if (suspend)
- suspend_process(rp_rq, rp);
+ /* Suspend c_p; when rp is suspended c_p will be resumed. */
+ suspend_process(c_p, c_p);
+ c_p->flags |= F_P2PNR_RESCHED;
}
- erts_smp_runqs_unlock(cp_rq, rp_rq);
+ /* Yield (caller is assumed to yield immediately in bif). */
+ erts_smp_proc_unlock(rp, pid_locks|ERTS_PROC_LOCK_STATUS);
+ rp = ERTS_PROC_LOCK_BUSY;
}
done:
@@ -4797,36 +6224,26 @@ erts_pid2proc_nropt(Process *c_p, ErtsProcLocks c_p_locks,
return erts_pid2proc_not_running(c_p, c_p_locks, pid, pid_locks);
}
-static ERTS_INLINE void
-do_bif_suspend_process(ErtsSuspendMonitor *smon,
- Process *suspendee,
- ErtsRunQueue *locked_runq)
+static ERTS_INLINE int
+do_bif_suspend_process(Process *c_p,
+ ErtsSuspendMonitor *smon,
+ Process *suspendee)
{
ASSERT(suspendee);
- ASSERT(!suspendee->is_exiting);
+ ASSERT(!ERTS_PROC_IS_EXITING(suspendee));
ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS
& erts_proc_lc_my_proc_locks(suspendee));
if (smon) {
if (!smon->active) {
- ErtsRunQueue *rq;
-
- if (locked_runq)
- rq = locked_runq;
- else {
- rq = erts_get_runq_proc(suspendee);
- erts_smp_runq_lock(rq);
- }
-
- suspend_process(rq, suspendee);
-
- if (!locked_runq)
- erts_smp_runq_unlock(rq);
+ if (!suspend_process(c_p, suspendee))
+ return 0;
}
smon->active += smon->pending;
ASSERT(smon->active);
smon->pending = 0;
+ return 1;
}
-
+ return 0;
}
static void
@@ -4849,10 +6266,17 @@ handle_pend_bif_sync_suspend(Process *suspendee,
erts_delete_suspend_monitor(&suspender->suspend_monitors,
suspendee->id);
else {
+#ifdef DEBUG
+ int res;
+#endif
ErtsSuspendMonitor *smon;
smon = erts_lookup_suspend_monitor(suspender->suspend_monitors,
suspendee->id);
- do_bif_suspend_process(smon, suspendee, NULL);
+#ifdef DEBUG
+ res =
+#endif
+ do_bif_suspend_process(suspendee, smon, suspendee);
+ ASSERT(!smon || res != 0);
suspender->suspendee = suspendee->id;
}
/* suspender is suspended waiting for suspendee to suspend;
@@ -4884,10 +6308,17 @@ handle_pend_bif_async_suspend(Process *suspendee,
erts_delete_suspend_monitor(&suspender->suspend_monitors,
suspendee->id);
else {
+#ifdef DEBUG
+ int res;
+#endif
ErtsSuspendMonitor *smon;
smon = erts_lookup_suspend_monitor(suspender->suspend_monitors,
suspendee->id);
- do_bif_suspend_process(smon, suspendee, NULL);
+#ifdef DEBUG
+ res =
+#endif
+ do_bif_suspend_process(suspendee, smon, suspendee);
+ ASSERT(!smon || res != 0);
}
erts_smp_proc_unlock(suspender, ERTS_PROC_LOCK_LINK);
}
@@ -4972,7 +6403,8 @@ suspend_process_2(BIF_ALIST_2)
/* This is really a piece of cake without SMP support... */
if (!smon->active) {
- suspend_process(ERTS_RUNQ_IX(0), suspendee);
+ erts_smp_atomic32_read_bor_nob(&suspendee->state, ERTS_PSFLG_SUSPENDED);
+ suspend_process(BIF_P, suspendee);
smon->active++;
res = am_true;
}
@@ -5015,21 +6447,15 @@ suspend_process_2(BIF_ALIST_2)
if (smon->pending && unless_suspending)
res = am_false;
else {
- ErtsRunQueue *rq;
if (smon->pending == INT_MAX)
goto system_limit;
smon->pending++;
- rq = erts_get_runq_proc(suspendee);
- erts_smp_runq_lock(rq);
- if (suspendee->runq_flags & ERTS_PROC_RUNQ_FLG_RUNNING)
+ if (!do_bif_suspend_process(BIF_P, smon, suspendee))
add_pend_suspend(suspendee,
BIF_P->id,
handle_pend_bif_async_suspend);
- else
- do_bif_suspend_process(smon, suspendee, rq);
- erts_smp_runq_unlock(rq);
res = am_true;
}
@@ -5066,7 +6492,6 @@ suspend_process_2(BIF_ALIST_2)
/* done */
}
else {
- ErtsRunQueue *cp_rq, *s_rq;
/* We haven't got any active suspends on the suspendee */
/*
@@ -5083,12 +6508,7 @@ suspend_process_2(BIF_ALIST_2)
if (!unless_suspending || smon->pending == 0)
smon->pending++;
- cp_rq = erts_get_runq_proc(BIF_P);
- s_rq = erts_get_runq_proc(suspendee);
- erts_smp_runqs_lock(cp_rq, s_rq);
- if (!(suspendee->runq_flags & ERTS_PROC_RUNQ_FLG_RUNNING)) {
- do_bif_suspend_process(smon, suspendee, s_rq);
- erts_smp_runqs_unlock(cp_rq, s_rq);
+ if (do_bif_suspend_process(BIF_P, smon, suspendee)) {
res = (!unless_suspending || smon->active == 1
? am_true
: am_false);
@@ -5108,8 +6528,7 @@ suspend_process_2(BIF_ALIST_2)
* This time with BIF_P->suspendee == BIF_ARG_1 (see
* above).
*/
- suspend_process(cp_rq, BIF_P);
- erts_smp_runqs_unlock(cp_rq, s_rq);
+ suspend_process(BIF_P, BIF_P);
goto yield;
}
}
@@ -5117,9 +6536,15 @@ suspend_process_2(BIF_ALIST_2)
}
#endif /* ERTS_SMP */
-
- ASSERT(suspendee->status == P_SUSPENDED || (asynchronous && smon->pending));
- ASSERT(suspendee->status == P_SUSPENDED || !smon->active);
+#ifdef DEBUG
+ {
+ erts_aint32_t state = erts_smp_atomic32_read_acqb(&suspendee->state);
+ ASSERT((state & ERTS_PSFLG_SUSPENDED)
+ || (asynchronous && smon->pending));
+ ASSERT((state & ERTS_PSFLG_SUSPENDED)
+ || !smon->active);
+ }
+#endif
erts_smp_proc_unlock(suspendee, ERTS_PROC_LOCK_STATUS);
erts_smp_proc_unlock(BIF_P, xlocks);
@@ -5214,9 +6639,8 @@ resume_process_1(BIF_ALIST_1)
if (!suspendee)
goto no_suspendee;
- ASSERT(suspendee->status == P_SUSPENDED
- || (suspendee->status == P_GARBING
- && suspendee->gcstatus == P_SUSPENDED));
+ ASSERT(ERTS_PSFLG_SUSPENDED
+ & erts_smp_atomic32_read_nob(&suspendee->state));
resume_process(suspendee);
erts_smp_proc_unlock(suspendee, ERTS_PROC_LOCK_STATUS);
@@ -5245,449 +6669,46 @@ erts_run_queues_len(Uint *qlen)
Uint len = 0;
ERTS_ATOMIC_FOREACH_RUNQ(rq,
{
- if (qlen)
- qlen[i++] = rq->procs.len;
- len += rq->procs.len;
+ Sint pqlen = 0;
+ int pix;
+ for (pix = 0; pix < ERTS_NO_PROC_PRIO_LEVELS; pix++)
+ pqlen += RUNQ_READ_LEN(&rq->procs.prio_info[pix].len);
+
+ if (pqlen < 0)
+ pqlen = 0;
+ if (qlen)
+ qlen[i++] = pqlen;
+ len += pqlen;
}
);
return len;
}
-#ifdef HARDDEBUG_RUNQS
-static void
-check_procs_runq(ErtsRunQueue *runq, Process *p_in_q, Process *p_not_in_q)
-{
- int len[ERTS_NO_PROC_PRIO_LEVELS] = {0};
- int tot_len;
- int prioq, prio;
- int found_p_in_q;
- Process *p, *prevp;
-
- found_p_in_q = 0;
- for (prioq = 0; prioq < ERTS_NO_PROC_PRIO_LEVELS - 1; prioq++) {
- prevp = NULL;
- for (p = runq->procs.prio[prioq].first; p; p = p->next) {
- ASSERT(p != p_not_in_q);
- if (p == p_in_q)
- found_p_in_q = 1;
- switch (p->prio) {
- case PRIORITY_MAX:
- case PRIORITY_HIGH:
- case PRIORITY_NORMAL:
- ASSERT(prioq == p->prio);
- break;
- case PRIORITY_LOW:
- ASSERT(prioq == PRIORITY_NORMAL);
- break;
- default:
- ASSERT(!"Bad prio on process");
- }
- len[p->prio]++;
- ASSERT(prevp == p->prev);
- if (p->prev) {
- ASSERT(p->prev->next == p);
- }
- else {
- ASSERT(runq->procs.prio[prioq].first == p);
- }
- if (p->next) {
- ASSERT(p->next->prev == p);
- }
- else {
- ASSERT(runq->procs.prio[prioq].last == p);
- }
- ASSERT(p->run_queue == runq);
- prevp = p;
- }
- }
-
- ASSERT(!p_in_q || found_p_in_q);
-
- tot_len = 0;
- for (prio = 0; prio < ERTS_NO_PROC_PRIO_LEVELS; prio++) {
- ASSERT(len[prio] == runq->procs.prio_info[prio].len);
- if (len[prio]) {
- ASSERT(runq->flags & (1 << prio));
- }
- else {
- ASSERT(!(runq->flags & (1 << prio)));
- }
- tot_len += len[prio];
- }
- ASSERT(runq->procs.len == tot_len);
-}
-# define ERTS_DBG_CHK_PROCS_RUNQ(RQ) check_procs_runq((RQ), NULL, NULL)
-# define ERTS_DBG_CHK_PROCS_RUNQ_PROC(RQ, P) check_procs_runq((RQ), (P), NULL)
-# define ERTS_DBG_CHK_PROCS_RUNQ_NOPROC(RQ, P) check_procs_runq((RQ), NULL, (P))
-#else
-# define ERTS_DBG_CHK_PROCS_RUNQ(RQ)
-# define ERTS_DBG_CHK_PROCS_RUNQ_PROC(RQ, P)
-# define ERTS_DBG_CHK_PROCS_RUNQ_NOPROC(RQ, P)
-#endif
-
-
-static ERTS_INLINE void
-enqueue_process(ErtsRunQueue *runq, Process *p)
-{
- ErtsRunPrioQueue *rpq;
- ErtsRunQueueInfo *rqi;
-
- ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(runq));
- ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS & erts_proc_lc_my_proc_locks(p));
-
- ASSERT(p->bound_runq || !(runq->flags & ERTS_RUNQ_FLG_SUSPENDED));
-
- rqi = &runq->procs.prio_info[p->prio];
- rqi->len++;
- if (rqi->max_len < rqi->len)
- rqi->max_len = rqi->len;
-
- runq->procs.len++;
- runq->len++;
- if (runq->max_len < runq->len)
- runq->max_len = runq->len;
-
- runq->flags |= (1 << p->prio);
-
- rpq = (p->prio == PRIORITY_LOW
- ? &runq->procs.prio[PRIORITY_NORMAL]
- : &runq->procs.prio[p->prio]);
-
- p->next = NULL;
- p->prev = rpq->last;
- if (rpq->last)
- rpq->last->next = p;
- else
- rpq->first = p;
- rpq->last = p;
-
- switch (p->status) {
- case P_EXITING:
- break;
- case P_GARBING:
- p->gcstatus = P_RUNABLE;
- break;
- default:
- p->status = P_RUNABLE;
- break;
- }
-
-#ifdef ERTS_SMP
- p->status_flags |= ERTS_PROC_SFLG_INRUNQ;
-#endif
-
- ERTS_DBG_CHK_PROCS_RUNQ_PROC(runq, p);
-}
-
-
-static ERTS_INLINE int
-dequeue_process(ErtsRunQueue *runq, Process *p)
-{
- ErtsRunPrioQueue *rpq;
- int res = 1;
-
- ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(runq));
- ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS & erts_proc_lc_my_proc_locks(p));
-
- ERTS_DBG_CHK_PROCS_RUNQ(runq);
-
- rpq = &runq->procs.prio[p->prio == PRIORITY_LOW ? PRIORITY_NORMAL : p->prio];
- if (p->prev) {
- p->prev->next = p->next;
- }
- else if (rpq->first == p) {
- rpq->first = p->next;
- }
- else {
- res = 0;
- }
- if (p->next) {
- p->next->prev = p->prev;
- }
- else if (rpq->last == p) {
- rpq->last = p->prev;
- }
- else {
- ASSERT(res == 0);
- }
-
- if (res) {
-
- if (--runq->procs.prio_info[p->prio].len == 0)
- runq->flags &= ~(1 << p->prio);
- runq->procs.len--;
- runq->len--;
-
-#ifdef ERTS_SMP
- p->status_flags &= ~ERTS_PROC_SFLG_INRUNQ;
-#endif
- }
-
- ERTS_DBG_CHK_PROCS_RUNQ_NOPROC(runq, p);
- return res;
-}
-
-/* schedule a process */
-static ERTS_INLINE ErtsRunQueue *
-internal_add_to_runq(ErtsRunQueue *runq, Process *p)
-{
- Uint32 prev_status = p->status;
- ErtsRunQueue *add_runq;
-#ifdef ERTS_SMP
-
- ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS & erts_proc_lc_my_proc_locks(p));
- ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(runq));
-
- if (p->status_flags & ERTS_PROC_SFLG_INRUNQ)
- return NULL;
- else if (p->runq_flags & ERTS_PROC_RUNQ_FLG_RUNNING) {
- ASSERT(ERTS_PROC_IS_EXITING(p) || p->rcount == 0);
- ERTS_DBG_CHK_PROCS_RUNQ_NOPROC(runq, p);
- p->status_flags |= ERTS_PROC_SFLG_PENDADD2SCHEDQ;
- return NULL;
- }
- ASSERT(!p->scheduler_data);
-#endif
-
- ERTS_DBG_CHK_PROCS_RUNQ_NOPROC(runq, p);
-#ifndef ERTS_SMP
- /* Never schedule a suspended process (ok in smp case) */
- ASSERT(ERTS_PROC_IS_EXITING(p) || p->rcount == 0);
- add_runq = runq;
-#else
- ASSERT(!p->bound_runq || p->bound_runq == p->run_queue);
- if (p->bound_runq) {
- if (p->bound_runq == runq)
- add_runq = runq;
- else {
- add_runq = p->bound_runq;
- erts_smp_xrunq_lock(runq, add_runq);
- }
- }
- else {
- add_runq = erts_check_emigration_need(runq, p->prio);
- if (!add_runq)
- add_runq = runq;
- else /* Process emigrated */
- p->run_queue = add_runq;
- }
-#endif
-
- /* Enqueue the process */
- enqueue_process(add_runq, p);
-
- if ((erts_system_profile_flags.runnable_procs)
- && (prev_status == P_WAITING
- || prev_status == P_SUSPENDED)) {
- profile_runnable_proc(p, am_active);
- }
-
- if (add_runq != runq)
- erts_smp_runq_unlock(add_runq);
-
- return add_runq;
-}
-
-
-void
-erts_add_to_runq(Process *p)
-{
- ErtsRunQueue *notify_runq;
- ErtsRunQueue *runq = erts_get_runq_proc(p);
- erts_smp_runq_lock(runq);
- notify_runq = internal_add_to_runq(runq, p);
- erts_smp_runq_unlock(runq);
- smp_notify_inc_runq(notify_runq);
-
-}
-
-/* Possibly remove a scheduled process we need to suspend */
-
-static int
-remove_proc_from_runq(ErtsRunQueue *rq, Process *p, int to_inactive)
-{
- int res;
-
- ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS & erts_proc_lc_my_proc_locks(p));
-
-#ifdef ERTS_SMP
- if (p->status_flags & ERTS_PROC_SFLG_PENDADD2SCHEDQ) {
- p->status_flags &= ~ERTS_PROC_SFLG_PENDADD2SCHEDQ;
- ASSERT(!remove_proc_from_runq(rq, p, 0));
- return 1;
- }
-#endif
-
- res = dequeue_process(rq, p);
-
- if (res && erts_system_profile_flags.runnable_procs && to_inactive)
- profile_runnable_proc(p, am_inactive);
-
-#ifdef ERTS_SMP
- ASSERT(!(p->status_flags & ERTS_PROC_SFLG_INRUNQ));
-#endif
-
- return res;
-}
-
-#ifdef ERTS_SMP
-
-ErtsMigrateResult
-erts_proc_migrate(Process *p, ErtsProcLocks *plcks,
- ErtsRunQueue *from_rq, int *from_locked,
- ErtsRunQueue *to_rq, int *to_locked)
-{
- ERTS_SMP_LC_ASSERT(*plcks == erts_proc_lc_my_proc_locks(p));
- ERTS_SMP_LC_ASSERT((ERTS_PROC_LOCK_STATUS & *plcks)
- || from_locked);
- ERTS_SMP_LC_CHK_RUNQ_LOCK(from_rq, *from_locked);
- ERTS_SMP_LC_CHK_RUNQ_LOCK(to_rq, *to_locked);
-
- /*
- * If we have the lock on the run queue to migrate to,
- * check that it isn't suspended. If it is suspended,
- * we will refuse to migrate to it anyway.
- */
- if (*to_locked && (to_rq->flags & ERTS_RUNQ_FLG_SUSPENDED))
- return ERTS_MIGRATE_FAILED_RUNQ_SUSPENDED;
-
- /* We need status lock on process and locks on both run queues */
-
- if (!(ERTS_PROC_LOCK_STATUS & *plcks)) {
- if (erts_smp_proc_trylock(p, ERTS_PROC_LOCK_STATUS) == EBUSY) {
- ErtsProcLocks lcks = *plcks;
- Eterm pid = p->id;
- Process *proc = *plcks ? p : NULL;
-
- if (*from_locked) {
- *from_locked = 0;
- erts_smp_runq_unlock(from_rq);
- }
- if (*to_locked) {
- *to_locked = 0;
- erts_smp_runq_unlock(to_rq);
- }
-
- proc = erts_pid2proc_opt(proc,
- lcks,
- pid,
- lcks|ERTS_PROC_LOCK_STATUS,
- ERTS_P2P_FLG_ALLOW_OTHER_X);
- if (!proc) {
- *plcks = 0;
- return ERTS_MIGRATE_FAILED_NOT_IN_RUNQ;
- }
- ASSERT(proc == p);
- }
- *plcks |= ERTS_PROC_LOCK_STATUS;
- }
-
- ASSERT(!p->bound_runq);
-
- ERTS_SMP_LC_CHK_RUNQ_LOCK(from_rq, *from_locked);
- ERTS_SMP_LC_CHK_RUNQ_LOCK(to_rq, *to_locked);
-
- if (p->run_queue != from_rq)
- return ERTS_MIGRATE_FAILED_RUNQ_CHANGED;
-
- if (!*from_locked || !*to_locked) {
- if (from_rq < to_rq) {
- if (!*to_locked) {
- if (!*from_locked)
- erts_smp_runq_lock(from_rq);
- erts_smp_runq_lock(to_rq);
- }
- else if (erts_smp_runq_trylock(from_rq) == EBUSY) {
- erts_smp_runq_unlock(to_rq);
- erts_smp_runq_lock(from_rq);
- erts_smp_runq_lock(to_rq);
- }
- }
- else {
- if (!*from_locked) {
- if (!*to_locked)
- erts_smp_runq_lock(to_rq);
- erts_smp_runq_lock(from_rq);
- }
- else if (erts_smp_runq_trylock(to_rq) == EBUSY) {
- erts_smp_runq_unlock(from_rq);
- erts_smp_runq_lock(to_rq);
- erts_smp_runq_lock(from_rq);
- }
- }
- *to_locked = *from_locked = 1;
- }
-
- ERTS_SMP_LC_CHK_RUNQ_LOCK(from_rq, *from_locked);
- ERTS_SMP_LC_CHK_RUNQ_LOCK(to_rq, *to_locked);
-
- /* Ok we now got all locks we need; do it... */
-
- /* Refuse to migrate to a suspended run queue */
- if (to_rq->flags & ERTS_RUNQ_FLG_SUSPENDED)
- return ERTS_MIGRATE_FAILED_RUNQ_SUSPENDED;
-
- if ((p->runq_flags & ERTS_PROC_RUNQ_FLG_RUNNING)
- || !(p->status_flags & ERTS_PROC_SFLG_INRUNQ))
- return ERTS_MIGRATE_FAILED_NOT_IN_RUNQ;
-
- dequeue_process(from_rq, p);
- p->run_queue = to_rq;
- enqueue_process(to_rq, p);
-
- return ERTS_MIGRATE_SUCCESS;
-}
-#endif /* ERTS_SMP */
-
Eterm
erts_process_status(Process *c_p, ErtsProcLocks c_p_locks,
Process *rp, Eterm rpid)
{
Eterm res = am_undefined;
- Process *p;
-
- if (rp) {
- ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS
- & erts_proc_lc_my_proc_locks(rp));
- p = rp;
- }
- else {
- p = erts_pid2proc_opt(c_p, c_p_locks,
- rpid, ERTS_PROC_LOCK_STATUS,
- ERTS_P2P_FLG_ALLOW_OTHER_X);
- }
+ Process *p = rp ? rp : erts_proc_lookup_raw(rpid);
if (p) {
- switch (p->status) {
- case P_RUNABLE:
- res = am_runnable;
- break;
- case P_WAITING:
- res = am_waiting;
- break;
- case P_RUNNING:
- res = am_running;
- break;
- case P_EXITING:
+ erts_aint32_t state = erts_smp_atomic32_read_acqb(&p->state);
+ if (state & ERTS_PSFLG_FREE)
+ res = am_free;
+ else if (state & ERTS_PSFLG_EXITING)
res = am_exiting;
- break;
- case P_GARBING:
+ else if (state & ERTS_PSFLG_GC)
res = am_garbage_collecting;
- break;
- case P_SUSPENDED:
+ else if (state & ERTS_PSFLG_SUSPENDED)
res = am_suspended;
- break;
- case P_FREE: /* We cannot look up a process in P_FREE... */
- default: /* Not a valid status... */
- erl_exit(1, "Bad status (%b32u) found for process %T\n",
- p->status, p->id);
- break;
- }
-
-#ifdef ERTS_SMP
- if (!rp && (p != c_p || !(ERTS_PROC_LOCK_STATUS & c_p_locks)))
- erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
+ else if (state & ERTS_PSFLG_RUNNING)
+ res = am_running;
+ else if (state & ERTS_PSFLG_ACTIVE)
+ res = am_runnable;
+ else
+ res = am_waiting;
}
+#ifdef ERTS_SMP
else {
int i;
ErtsSchedulerData *esdp;
@@ -5702,42 +6723,40 @@ erts_process_status(Process *c_p, ErtsProcLocks c_p_locks,
}
erts_smp_runq_unlock(esdp->run_queue);
}
-
-#endif
-
}
-
+#endif
return res;
}
/*
-** Suspend a process
+** Suspend a currently executing process
** If we are to suspend on a port the busy_port is the thing
** otherwise busy_port is NIL
*/
void
-erts_suspend(Process* process, ErtsProcLocks process_locks, Port *busy_port)
+erts_suspend(Process* c_p, ErtsProcLocks c_p_locks, Port *busy_port)
{
- ErtsRunQueue *rq;
-
- ERTS_SMP_LC_ASSERT(process_locks == erts_proc_lc_my_proc_locks(process));
- if (!(process_locks & ERTS_PROC_LOCK_STATUS))
- erts_smp_proc_lock(process, ERTS_PROC_LOCK_STATUS);
-
- rq = erts_get_runq_proc(process);
-
- erts_smp_runq_lock(rq);
+#ifdef DEBUG
+ int res;
+#endif
+ ASSERT(c_p == erts_get_current_process());
+ ERTS_SMP_LC_ASSERT(c_p_locks == erts_proc_lc_my_proc_locks(c_p));
+ if (!(c_p_locks & ERTS_PROC_LOCK_STATUS))
+ erts_smp_proc_lock(c_p, ERTS_PROC_LOCK_STATUS);
- suspend_process(rq, process);
+#ifdef DEBUG
+ res =
+#endif
+ suspend_process(c_p, c_p);
- erts_smp_runq_unlock(rq);
+ ASSERT(res);
if (busy_port)
- erts_wake_process_later(busy_port, process);
+ erts_wake_process_later(busy_port, c_p);
- if (!(process_locks & ERTS_PROC_LOCK_STATUS))
- erts_smp_proc_unlock(process, ERTS_PROC_LOCK_STATUS);
+ if (!(c_p_locks & ERTS_PROC_LOCK_STATUS))
+ erts_smp_proc_unlock(c_p, ERTS_PROC_LOCK_STATUS);
}
@@ -5778,57 +6797,54 @@ erts_resume_processes(ErtsProcList *plp)
Eterm
erts_get_process_priority(Process *p)
{
- ErtsRunQueue *rq;
- Eterm value;
- ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS & erts_proc_lc_my_proc_locks(p));
- rq = erts_get_runq_proc(p);
- erts_smp_runq_lock(rq);
- switch(p->prio) {
- case PRIORITY_MAX: value = am_max; break;
- case PRIORITY_HIGH: value = am_high; break;
- case PRIORITY_NORMAL: value = am_normal; break;
- case PRIORITY_LOW: value = am_low; break;
- default: ASSERT(0); value = am_undefined; break;
+ erts_aint32_t state = erts_smp_atomic32_read_nob(&p->state);
+ switch (state & ERTS_PSFLG_PRIO_MASK) {
+ case PRIORITY_MAX: return am_max;
+ case PRIORITY_HIGH: return am_high;
+ case PRIORITY_NORMAL: return am_normal;
+ case PRIORITY_LOW: return am_low;
+ default: ASSERT(0); return am_undefined;
}
- erts_smp_runq_unlock(rq);
- return value;
}
Eterm
-erts_set_process_priority(Process *p, Eterm new_value)
+erts_set_process_priority(Process *p, Eterm value)
{
- ErtsRunQueue *rq;
- Eterm old_value;
- ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS & erts_proc_lc_my_proc_locks(p));
- rq = erts_get_runq_proc(p);
-#ifdef ERTS_SMP
- ASSERT(!(p->status_flags & ERTS_PROC_SFLG_INRUNQ));
-#endif
- erts_smp_runq_lock(rq);
- switch(p->prio) {
- case PRIORITY_MAX: old_value = am_max; break;
- case PRIORITY_HIGH: old_value = am_high; break;
- case PRIORITY_NORMAL: old_value = am_normal; break;
- case PRIORITY_LOW: old_value = am_low; break;
- default: ASSERT(0); old_value = am_undefined; break;
- }
- switch (new_value) {
- case am_max: p->prio = PRIORITY_MAX; break;
- case am_high: p->prio = PRIORITY_HIGH; break;
- case am_normal: p->prio = PRIORITY_NORMAL; break;
- case am_low: p->prio = PRIORITY_LOW; break;
- default: old_value = THE_NON_VALUE; break;
+ erts_aint32_t a, oprio, nprio;
+
+ switch (value) {
+ case am_max: nprio = (erts_aint32_t) PRIORITY_MAX; break;
+ case am_high: nprio = (erts_aint32_t) PRIORITY_HIGH; break;
+ case am_normal: nprio = (erts_aint32_t) PRIORITY_NORMAL; break;
+ case am_low: nprio = (erts_aint32_t) PRIORITY_LOW; break;
+ default: return THE_NON_VALUE; break;
}
- erts_smp_runq_unlock(rq);
- return old_value;
-}
-/* note that P_RUNNING is only set so that we don't try to remove
-** running processes from the schedule queue if they exit - a running
-** process not being in the schedule queue!!
-** Schedule for up to INPUT_REDUCTIONS context switches,
-** return 1 if more to do.
-*/
+ a = erts_smp_atomic32_read_nob(&p->state);
+ if (nprio == (a & ERTS_PSFLG_PRIO_MASK))
+ oprio = nprio;
+ else {
+ erts_aint32_t e, n;
+ do {
+ oprio = a & ERTS_PSFLG_PRIO_MASK;
+ n = e = a;
+
+ ASSERT(!(a & ERTS_PSFLG_IN_RUNQ));
+
+ n &= ~ERTS_PSFLG_PRIO_MASK;
+ n |= nprio;
+ a = erts_smp_atomic32_cmpxchg_mb(&p->state, n, e);
+ } while (a != e);
+ }
+
+ switch (oprio) {
+ case PRIORITY_MAX: return am_max;
+ case PRIORITY_HIGH: return am_high;
+ case PRIORITY_NORMAL: return am_normal;
+ case PRIORITY_LOW: return am_low;
+ default: ASSERT(0); return am_undefined;
+ }
+}
/*
* schedule() is called from BEAM (process_main()) or HiPE
@@ -5851,7 +6867,6 @@ erts_set_process_priority(Process *p, Eterm new_value)
Process *schedule(Process *p, int calls)
{
ErtsRunQueue *rq;
- ErtsRunPrioQueue *rpq;
erts_aint_t dt;
ErtsSchedulerData *esdp;
int context_reds;
@@ -5859,6 +6874,17 @@ Process *schedule(Process *p, int calls)
int input_reductions;
int actual_reds;
int reds;
+ Uint32 flags;
+ erts_aint32_t state = 0; /* Supress warning... */
+
+#ifdef USE_VM_PROBES
+ if (p != NULL && DTRACE_ENABLED(process_unscheduled)) {
+ DTRACE_CHARBUF(process_buf, DTRACE_TERM_BUF_SIZE);
+
+ dtrace_proc_str(p, process_buf);
+ DTRACE1(process_unscheduled, process_buf);
+ }
+#endif
if (ERTS_USE_MODIFIED_TIMING()) {
context_reds = ERTS_MODIFIED_TIMING_CONTEXT_REDS;
@@ -5905,92 +6931,60 @@ Process *schedule(Process *p, int calls)
erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS);
- if ((erts_system_profile_flags.runnable_procs)
- && (p->status == P_WAITING)) {
- profile_runnable_proc(p, am_inactive);
- }
+ state = erts_smp_atomic32_read_acqb(&p->state);
if (IS_TRACED(p)) {
- if (IS_TRACED_FL(p, F_TRACE_CALLS) && p->status != P_FREE) {
+ if (IS_TRACED_FL(p, F_TRACE_CALLS) && !(state & ERTS_PSFLG_FREE)) {
erts_schedule_time_break(p, ERTS_BP_CALL_TIME_SCHEDULE_OUT);
}
- switch (p->status) {
- case P_EXITING:
+ if (state & (ERTS_PSFLG_FREE|ERTS_PSFLG_EXITING)) {
if (ARE_TRACE_FLAGS_ON(p, F_TRACE_SCHED_EXIT))
- trace_sched(p, am_out_exiting);
- break;
- case P_FREE:
- if (ARE_TRACE_FLAGS_ON(p, F_TRACE_SCHED_EXIT))
- trace_sched(p, am_out_exited);
- break;
- default:
+ trace_sched(p, ((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);
- break;
}
}
#ifdef ERTS_SMP
- if (ERTS_PROC_PENDING_EXIT(p)) {
- erts_handle_pending_exit(p,
- ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS);
- p->status_flags |= ERTS_PROC_SFLG_PENDADD2SCHEDQ;
- }
-
- if (p->pending_suspenders) {
- handle_pending_suspend(p,
- ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS);
- ASSERT(!(p->status_flags & ERTS_PROC_SFLG_PENDADD2SCHEDQ)
- || p->rcount == 0);
- }
+ if (state & ERTS_PSFLG_PENDING_EXIT)
+ erts_handle_pending_exit(p, (ERTS_PROC_LOCK_MAIN
+ | ERTS_PROC_LOCK_STATUS));
+ if (p->pending_suspenders)
+ handle_pending_suspend(p, (ERTS_PROC_LOCK_MAIN
+ | ERTS_PROC_LOCK_STATUS));
#endif
- erts_smp_runq_lock(rq);
- ERTS_PROC_REDUCTIONS_EXECUTED(rq, p->prio, reds, actual_reds);
+ schedule_out_process(rq, state, p); /* Returns with rq locked! */
+
+ ERTS_PROC_REDUCTIONS_EXECUTED(rq,
+ (int) (state & ERTS_PSFLG_PRIO_MASK),
+ reds,
+ actual_reds);
esdp->current_process = NULL;
#ifdef ERTS_SMP
p->scheduler_data = NULL;
- p->runq_flags &= ~ERTS_PROC_RUNQ_FLG_RUNNING;
- p->status_flags &= ~ERTS_PROC_SFLG_RUNNING;
-
- if (p->status_flags & ERTS_PROC_SFLG_PENDADD2SCHEDQ) {
- ErtsRunQueue *notify_runq;
- p->status_flags &= ~ERTS_PROC_SFLG_PENDADD2SCHEDQ;
- notify_runq = internal_add_to_runq(rq, p);
- if (notify_runq != rq)
- smp_notify_inc_runq(notify_runq);
- }
#endif
- if (p->status == P_FREE) {
+ if (state & ERTS_PSFLG_FREE) {
#ifdef ERTS_SMP
ASSERT(esdp->free_process == p);
esdp->free_process = NULL;
- erts_smp_proc_unlock(p, ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS);
- erts_smp_proc_dec_refc(p);
#else
erts_free_proc(p);
#endif
- } else {
- erts_smp_proc_unlock(p, ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS);
}
-#ifdef ERTS_SMP
- {
- ErtsProcList *pnd_xtrs = rq->procs.pending_exiters;
- rq->procs.pending_exiters = NULL;
+ erts_smp_proc_unlock(p, ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS);
- if (pnd_xtrs) {
- erts_smp_runq_unlock(rq);
- handle_pending_exiters(pnd_xtrs);
- erts_smp_runq_lock(rq);
- }
-
- }
+#ifdef ERTS_SMP
ASSERT(!esdp->free_process);
#endif
ASSERT(!esdp->current_process);
@@ -6010,8 +7004,23 @@ Process *schedule(Process *p, int calls)
ERTS_SMP_LC_ASSERT(!erts_thr_progress_is_blocking());
check_activities_to_run: {
+#ifdef ERTS_SMP
+ ErtsMigrationPaths *mps;
+ ErtsMigrationPath *mp;
#ifdef ERTS_SMP
+ {
+ ErtsProcList *pnd_xtrs = rq->procs.pending_exiters;
+ rq->procs.pending_exiters = NULL;
+
+ if (pnd_xtrs) {
+ erts_smp_runq_unlock(rq);
+ handle_pending_exiters(pnd_xtrs);
+ erts_smp_runq_lock(rq);
+ }
+
+ }
+#endif
if (rq->check_balance_reds <= 0)
check_balance(rq);
@@ -6019,20 +7028,28 @@ Process *schedule(Process *p, int calls)
ERTS_SMP_LC_ASSERT(!erts_thr_progress_is_blocking());
ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(rq));
- if (rq->flags & ERTS_RUNQ_FLGS_IMMIGRATE_QMASK)
- immigrate(rq);
+ mps = erts_get_migration_paths_managed();
+ mp = &mps->mpath[rq->ix];
+
+ if (mp->flags & ERTS_RUNQ_FLGS_IMMIGRATE_QMASK)
+ immigrate(rq, mp);
+
+ continue_check_activities_to_run:
+ flags = ERTS_RUNQ_FLGS_GET_NOB(rq);
+ continue_check_activities_to_run_known_flags:
- continue_check_activities_to_run:
- if (rq->flags & (ERTS_RUNQ_FLG_CHK_CPU_BIND
- | ERTS_RUNQ_FLG_SUSPENDED)) {
- if (rq->flags & ERTS_RUNQ_FLG_SUSPENDED) {
- ASSERT(erts_smp_atomic32_read_nob(&esdp->ssi->flags)
- & ERTS_SSI_FLG_SUSPENDED);
+ if (flags & (ERTS_RUNQ_FLG_CHK_CPU_BIND|ERTS_RUNQ_FLG_SUSPENDED)) {
+
+ if (flags & ERTS_RUNQ_FLG_SUSPENDED) {
suspend_scheduler(esdp);
+ flags = ERTS_RUNQ_FLGS_GET_NOB(rq);
}
- if (rq->flags & ERTS_RUNQ_FLG_CHK_CPU_BIND)
+ if (flags & ERTS_RUNQ_FLG_CHK_CPU_BIND) {
+ flags = ERTS_RUNQ_FLGS_UNSET(rq, ERTS_RUNQ_FLG_CHK_CPU_BIND);
+ flags &= ~ ERTS_RUNQ_FLG_CHK_CPU_BIND;
erts_sched_check_cpu_bind(esdp);
+ }
}
{
@@ -6044,7 +7061,7 @@ Process *schedule(Process *p, int calls)
if (leader_update)
erts_thr_progress_leader_update(esdp);
if (aux_work)
- handle_aux_work(&esdp->aux_work_data, aux_work);
+ handle_aux_work(&esdp->aux_work_data, aux_work, 0);
erts_smp_runq_lock(rq);
}
}
@@ -6057,16 +7074,16 @@ Process *schedule(Process *p, int calls)
erts_aint32_t aux_work;
aux_work = erts_atomic32_read_acqb(&esdp->ssi->aux_work);
if (aux_work)
- handle_aux_work(&esdp->aux_work_data, aux_work);
+ handle_aux_work(&esdp->aux_work_data, aux_work, 0);
}
#endif /* ERTS_SMP */
- ASSERT(rq->len == rq->procs.len + rq->ports.info.len);
-
- if (rq->len == 0 && !rq->misc.start) {
+ flags = ERTS_RUNQ_FLGS_GET_NOB(rq);
+ if ((!(flags & ERTS_RUNQ_FLGS_QMASK) && !rq->misc.start)
+ || (rq->halt_in_progress && ERTS_EMPTY_RUNQ_PORTS(rq))) {
+ /* Prepare for scheduler wait */
#ifdef ERTS_SMP
-
ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(rq));
rq->wakeup_other = 0;
@@ -6074,21 +7091,27 @@ Process *schedule(Process *p, int calls)
empty_runq(rq);
- if (rq->flags & ERTS_RUNQ_FLG_SUSPENDED) {
- ASSERT(erts_smp_atomic32_read_nob(&esdp->ssi->flags)
- & ERTS_SSI_FLG_SUSPENDED);
+ flags = ERTS_RUNQ_FLGS_GET_NOB(rq);
+ if (flags & ERTS_RUNQ_FLG_SUSPENDED) {
non_empty_runq(rq);
- goto continue_check_activities_to_run;
+ goto continue_check_activities_to_run_known_flags;
}
- else if (!(rq->flags & ERTS_RUNQ_FLG_INACTIVE)) {
+ else if (!(flags & ERTS_RUNQ_FLG_INACTIVE)) {
+ if (try_steal_task(rq)) {
+ non_empty_runq(rq);
+ goto continue_check_activities_to_run;
+ }
+
+ (void) ERTS_RUNQ_FLGS_UNSET(rq, ERTS_RUNQ_FLG_PROTECTED);
+
/*
* Check for ERTS_RUNQ_FLG_SUSPENDED has to be done
* after trying to steal a task.
*/
- if (try_steal_task(rq)
- || (rq->flags & ERTS_RUNQ_FLG_SUSPENDED)) {
+ flags = ERTS_RUNQ_FLGS_GET_NOB(rq);
+ if (flags & ERTS_RUNQ_FLG_SUSPENDED) {
non_empty_runq(rq);
- goto continue_check_activities_to_run;
+ goto continue_check_activities_to_run_known_flags;
}
}
@@ -6119,6 +7142,7 @@ Process *schedule(Process *p, int calls)
erl_sys_schedule(1);
dt = erts_do_time_read_and_reset();
if (dt) erts_bump_timer(dt);
+
#ifdef ERTS_SMP
erts_smp_runq_lock(rq);
clear_sys_scheduling();
@@ -6132,36 +7156,18 @@ Process *schedule(Process *p, int calls)
exec_misc_ops(rq);
#ifdef ERTS_SMP
- {
- int wo_reds = rq->wakeup_other_reds;
- if (wo_reds) {
- if (rq->len < 2) {
- rq->wakeup_other -= ERTS_WAKEUP_OTHER_DEC*wo_reds;
- if (rq->wakeup_other < 0)
- rq->wakeup_other = 0;
- }
- else if (rq->wakeup_other < wakeup_other_limit)
- rq->wakeup_other += rq->len*wo_reds + ERTS_WAKEUP_OTHER_FIXED_INC;
- else {
- if (erts_smp_atomic32_read_acqb(&no_empty_run_queues) != 0) {
- wake_scheduler_on_empty_runq(rq);
- rq->wakeup_other = 0;
- }
- rq->wakeup_other = 0;
- }
- }
- rq->wakeup_other_reds = 0;
- }
+ wakeup_other.check(rq, flags);
#endif
/*
* Find a new port to run.
*/
- if (rq->ports.info.len) {
+ if (RUNQ_READ_LEN(&rq->ports.info.len)) {
int have_outstanding_io;
have_outstanding_io = erts_port_task_execute(rq, &esdp->current_port);
- if (have_outstanding_io && fcalls > 2*input_reductions) {
+ if ((have_outstanding_io && fcalls > 2*input_reductions)
+ || rq->halt_in_progress) {
/*
* If we have performed more than 2*INPUT_REDUCTIONS since
* last call to erl_sys_schedule() and we still haven't
@@ -6184,160 +7190,122 @@ Process *schedule(Process *p, int calls)
/*
* Find a new process to run.
*/
- pick_next_process:
-
- ERTS_DBG_CHK_PROCS_RUNQ(rq);
-
- switch (rq->flags & ERTS_RUNQ_FLGS_PROCS_QMASK) {
- case MAX_BIT:
- case MAX_BIT|HIGH_BIT:
- case MAX_BIT|NORMAL_BIT:
- case MAX_BIT|LOW_BIT:
- case MAX_BIT|HIGH_BIT|NORMAL_BIT:
- case MAX_BIT|HIGH_BIT|LOW_BIT:
- case MAX_BIT|NORMAL_BIT|LOW_BIT:
- case MAX_BIT|HIGH_BIT|NORMAL_BIT|LOW_BIT:
- rpq = &rq->procs.prio[PRIORITY_MAX];
- break;
- case HIGH_BIT:
- case HIGH_BIT|NORMAL_BIT:
- case HIGH_BIT|LOW_BIT:
- case HIGH_BIT|NORMAL_BIT|LOW_BIT:
- rpq = &rq->procs.prio[PRIORITY_HIGH];
- break;
- case NORMAL_BIT:
- rpq = &rq->procs.prio[PRIORITY_NORMAL];
- break;
- case LOW_BIT:
- rpq = &rq->procs.prio[PRIORITY_NORMAL];
- break;
- case NORMAL_BIT|LOW_BIT:
- rpq = &rq->procs.prio[PRIORITY_NORMAL];
- ASSERT(rpq->first != NULL);
- p = rpq->first;
- if (p->prio == PRIORITY_LOW) {
- if (p == rpq->last || p->skipped >= RESCHEDULE_LOW-1)
- p->skipped = 0;
- else {
- /* skip it */
- p->skipped++;
- rpq->first = p->next;
- rpq->first->prev = NULL;
- rpq->last->next = p;
- p->prev = rpq->last;
- p->next = NULL;
- rpq->last = p;
+ pick_next_process: {
+ int prio_q;
+ int qmask;
+
+ flags = ERTS_RUNQ_FLGS_GET_NOB(rq);
+ qmask = (int) (flags & ERTS_RUNQ_FLGS_PROCS_QMASK);
+ switch (qmask & -qmask) {
+ case MAX_BIT:
+ prio_q = PRIORITY_MAX;
+ break;
+ case HIGH_BIT:
+ prio_q = PRIORITY_HIGH;
+ break;
+ case NORMAL_BIT:
+ case LOW_BIT:
+ prio_q = PRIORITY_NORMAL;
+ if (check_requeue_process(rq, PRIORITY_NORMAL))
goto pick_next_process;
- }
+ break;
+ case 0: /* No process at all */
+ default:
+ ASSERT(qmask == 0);
+ goto check_activities_to_run;
}
- break;
- case 0: /* No process at all */
- default:
- ASSERT((rq->flags & ERTS_RUNQ_FLGS_PROCS_QMASK) == 0);
- ASSERT(rq->procs.len == 0);
- goto check_activities_to_run;
- }
-
- BM_START_TIMER(system);
-
- /*
- * Take the chosen process out of the queue.
- */
- ASSERT(rpq->first); /* Wrong qmask in rq->flags? */
- p = rpq->first;
-#ifdef ERTS_SMP
- ERTS_SMP_LC_ASSERT(rq == p->run_queue);
-#endif
- rpq->first = p->next;
- if (!rpq->first)
- rpq->last = NULL;
- else
- rpq->first->prev = NULL;
- p->next = p->prev = NULL;
+ BM_START_TIMER(system);
- if (--rq->procs.prio_info[p->prio].len == 0)
- rq->flags &= ~(1 << p->prio);
- ASSERT(rq->procs.len > 0);
- rq->procs.len--;
- ASSERT(rq->len > 0);
- rq->len--;
+ /*
+ * Take the chosen process out of the queue.
+ */
+ p = dequeue_process(rq, prio_q, &state);
- {
- Uint32 ee_flgs = (ERTS_RUNQ_FLG_EVACUATE(p->prio)
- | ERTS_RUNQ_FLG_EMIGRATE(p->prio));
+ ASSERT(p); /* Wrong qmask in rq->flags? */
- if ((rq->flags & (ERTS_RUNQ_FLG_SUSPENDED|ee_flgs)) == ee_flgs)
- ERTS_UNSET_RUNQ_FLG_EVACUATE(rq->flags, p->prio);
- }
+ while (1) {
+ erts_aint32_t exp, new, tmp;
+ tmp = new = exp = state;
+ new &= ~ERTS_PSFLG_IN_RUNQ;
+ tmp = state & (ERTS_PSFLG_SUSPENDED|ERTS_PSFLG_PENDING_EXIT);
+ if (tmp != ERTS_PSFLG_SUSPENDED)
+ new |= ERTS_PSFLG_RUNNING;
+ state = erts_smp_atomic32_cmpxchg_relb(&p->state, new, exp);
+ if (state == exp) {
+ tmp = state & (ERTS_PSFLG_SUSPENDED|ERTS_PSFLG_PENDING_EXIT);
+ if (tmp == ERTS_PSFLG_SUSPENDED)
+ goto pick_next_process;
+ state = new;
+ break;
+ }
+ }
- ERTS_DBG_CHK_PROCS_RUNQ_NOPROC(rq, p);
+ rq->procs.context_switches++;
- rq->procs.context_switches++;
+ esdp->current_process = p;
- esdp->current_process = p;
+ }
#ifdef ERTS_SMP
- p->runq_flags |= ERTS_PROC_RUNQ_FLG_RUNNING;
erts_smp_runq_unlock(rq);
+ if (flags & ERTS_RUNQ_FLG_PROTECTED)
+ (void) ERTS_RUNQ_FLGS_UNSET(rq, ERTS_RUNQ_FLG_PROTECTED);
+
ERTS_SMP_CHK_NO_PROC_LOCKS;
erts_smp_proc_lock(p, ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS);
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);
int migrated = old && old != esdp->no;
+ prio = (int) (state & ERTS_PSFLG_PRIO_MASK);
+
erts_smp_spin_lock(&erts_sched_stat.lock);
- erts_sched_stat.prio[p->prio].total_executed++;
- erts_sched_stat.prio[p->prio].executed++;
+ erts_sched_stat.prio[prio].total_executed++;
+ erts_sched_stat.prio[prio].executed++;
if (migrated) {
- erts_sched_stat.prio[p->prio].total_migrated++;
- erts_sched_stat.prio[p->prio].migrated++;
+ erts_sched_stat.prio[prio].total_migrated++;
+ erts_sched_stat.prio[prio].migrated++;
}
erts_smp_spin_unlock(&erts_sched_stat.lock);
}
- p->status_flags |= ERTS_PROC_SFLG_RUNNING;
- p->status_flags &= ~ERTS_PROC_SFLG_INRUNQ;
if (ERTS_PROC_PENDING_EXIT(p)) {
erts_handle_pending_exit(p,
ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS);
+ state = erts_smp_atomic32_read_nob(&p->state);
}
ASSERT(!p->scheduler_data);
p->scheduler_data = esdp;
-
#endif
- ASSERT(p->status != P_SUSPENDED); /* Never run a suspended process */
+ /* Never run a suspended process */
+ ASSERT(!(ERTS_PSFLG_SUSPENDED & erts_smp_atomic32_read_nob(&p->state)));
- ACTIVATE(p);
reds = context_reds;
if (IS_TRACED(p)) {
- switch (p->status) {
- case P_EXITING:
+ if (state & ERTS_PSFLG_EXITING) {
if (ARE_TRACE_FLAGS_ON(p, F_TRACE_SCHED_EXIT))
trace_sched(p, am_in_exiting);
- break;
- default:
+ }
+ 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);
- break;
}
if (IS_TRACED_FL(p, F_TRACE_CALLS)) {
erts_schedule_time_break(p, ERTS_BP_CALL_TIME_SCHEDULE_IN);
}
}
- if (p->status != P_EXITING)
- p->status = P_RUNNING;
-
erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
#ifdef ERTS_SMP
@@ -6345,7 +7313,7 @@ Process *schedule(Process *p, int calls)
erts_check_my_tracer_proc(p);
#endif
- if (!ERTS_PROC_IS_EXITING(p)
+ if (!(state & ERTS_PSFLG_EXITING)
&& ((FLAGS(p) & F_FORCE_GC)
|| (MSO(p).overhead > BIN_VHEAP_SZ(p)))) {
reds -= erts_garbage_collect(p, 0, p->arg_reg, p->arity);
@@ -6355,7 +7323,6 @@ Process *schedule(Process *p, int calls)
}
p->fcalls = reds;
- ASSERT(IS_ACTIVE(p));
ERTS_SMP_CHK_HAVE_ONLY_MAIN_PROC_LOCK(p);
return p;
}
@@ -6437,17 +7404,19 @@ erts_schedule_misc_op(void (*func)(void *), void *arg)
ErtsSchedulerData *esdp = erts_get_scheduler_data();
ErtsRunQueue *rq = esdp ? esdp->run_queue : ERTS_RUNQ_IX(0);
ErtsMiscOpList *molp = misc_op_list_alloc();
+#ifdef ERTS_SMP
+ ErtsMigrationPaths *mpaths = erts_get_migration_paths();
- erts_smp_runq_lock(rq);
-
- while (rq->misc.evac_runq) {
- ErtsRunQueue *tmp_rq = rq->misc.evac_runq;
- erts_smp_runq_unlock(rq);
- rq = tmp_rq;
- erts_smp_runq_lock(rq);
+ if (!mpaths)
+ rq = ERTS_RUNQ_IX(0);
+ else {
+ ErtsRunQueue *erq = mpaths->mpath[rq->ix].misc_evac_runq;
+ if (erq)
+ rq = erq;
}
+#endif
- ASSERT(!(rq->flags & ERTS_RUNQ_FLG_SUSPENDED));
+ erts_smp_runq_lock(rq);
molp->next = NULL;
molp->func = func;
@@ -6457,7 +7426,9 @@ erts_schedule_misc_op(void (*func)(void *), void *arg)
else
rq->misc.start = molp;
rq->misc.end = molp;
+
erts_smp_runq_unlock(rq);
+
smp_notify_inc_runq(rq);
}
@@ -6547,44 +7518,50 @@ erts_get_exact_total_reductions(Process *c_p, Uint *redsp, Uint *diffp)
Sint
erts_test_next_pid(int set, Uint next)
{
+ Uint64 lpd;
Sint res;
- Sint p_prev;
+ Eterm pid_data;
+ int first_pix = -1;
+ erts_smp_rwmtx_rwlock(&erts_proc_tab_rwmtx);
- erts_smp_mtx_lock(&proc_tab_mtx);
-
- if (!set) {
- res = p_next < 0 ? -1 : (p_serial << p_serial_shift | p_next);
- }
+ if (!set)
+ lpd = last_pid_data_read_nob();
else {
- p_serial = (Sint) ((next >> p_serial_shift) & p_serial_mask);
- p_next = (Sint) (erts_process_tab_index_mask & next);
-
- if (p_next >= erts_max_processes) {
- p_next = 0;
- p_serial++;
- p_serial &= p_serial_mask;
+ lpd = (Uint64) next;
+ pid_data = (Eterm) (lpd & ERTS_PID_DATA_MASK__);
+ if (ERTS_INVALID_PID == make_internal_pid(pid_data)) {
+ lpd += erts_proc.max;
+ ASSERT(erts_pid_data2ix(pid_data)
+ == erts_pid_data2ix(lpd & ERTS_PID_DATA_MASK__));
}
+ last_pid_data_set_relb(lpd);
+ }
- p_prev = p_next;
-
- do {
- if (!process_tab[p_next])
- break;
- p_next++;
- if(p_next >= erts_max_processes) {
- p_next = 0;
- p_serial++;
- p_serial &= p_serial_mask;
+ while (1) {
+ int pix;
+ lpd++;
+ pix = (int) (lpd % erts_proc.max);
+ if (first_pix < 0)
+ first_pix = pix;
+ else if (pix == first_pix) {
+ res = -1;
+ break;
+ }
+ if (ERTS_AINT_NULL == erts_smp_atomic_read_nob(&erts_proc.tab[pix])) {
+ pid_data = (Eterm) (lpd & ERTS_PID_DATA_MASK__);
+ if (ERTS_INVALID_PID == make_internal_pid(pid_data)) {
+ lpd += erts_proc.max;
+ ASSERT(erts_pid_data2ix(pid_data)
+ == erts_pid_data2ix(lpd & ERTS_PID_DATA_MASK__));
}
- } while (p_prev != p_next);
-
- res = process_tab[p_next] ? -1 : (p_serial << p_serial_shift | p_next);
-
+ res = lpd & ERTS_PID_DATA_MASK__;
+ break;
+ }
}
- erts_smp_mtx_unlock(&proc_tab_mtx);
+ erts_smp_rwmtx_rwunlock(&erts_proc_tab_rwmtx);
return res;
@@ -6593,6 +7570,8 @@ erts_test_next_pid(int set, Uint next)
Uint erts_process_count(void)
{
erts_aint32_t res = erts_smp_atomic32_read_nob(&process_count);
+ if (res > erts_proc.max)
+ return erts_proc.max;
ASSERT(res >= 0);
return (Uint) res;
}
@@ -6600,97 +7579,138 @@ Uint erts_process_count(void)
void
erts_free_proc(Process *p)
{
-#if defined(ERTS_ENABLE_LOCK_COUNT) && defined(ERTS_SMP)
- erts_lcnt_proc_lock_destroy(p);
+#ifdef ERTS_SMP
+ erts_proc_lock_fin(p);
#endif
erts_free(ERTS_ALC_T_PROC, (void *) p);
}
-
/*
** Allocate process and find out where to place next process.
*/
static Process*
-alloc_process(void)
+alloc_process(ErtsRunQueue *rq, erts_aint32_t state)
{
-#ifdef ERTS_SMP
- erts_pix_lock_t *pix_lock;
-#endif
+ int pix;
Process* p;
- int p_prev;
+ Uint64 lpd, exp_lpd;
+ Eterm pid_data;
+ erts_aint32_t proc_count;
+#ifdef DEBUG
+ Eterm pid;
+#endif
+
+ erts_smp_rwmtx_rlock(&erts_proc_tab_rwmtx);
- erts_smp_mtx_lock(&proc_tab_mtx);
+ proc_count = erts_smp_atomic32_inc_read_acqb(&process_count);
+ if (proc_count > erts_proc.max) {
+ while (1) {
+ erts_aint32_t act_proc_count;
- if (p_next == -1) {
- p = NULL;
- goto error; /* Process table full! */
+ act_proc_count = erts_smp_atomic32_cmpxchg_relb(&process_count,
+ proc_count-1,
+ proc_count);
+ if (act_proc_count == proc_count)
+ goto system_limit;
+ proc_count = act_proc_count;
+ if (proc_count <= erts_proc.max)
+ break;
+ }
}
p = (Process*) erts_alloc_fnf(ERTS_ALC_T_PROC, sizeof(Process));
if (!p)
- goto error; /* ENOMEM */
+ goto enomem;
- p_last = p_next;
+ p->approx_started = erts_get_approx_time();
+ p->started_interval = get_proc_interval();
- erts_get_emu_time(&p->started);
+ lpd = last_pid_data_read_acqb();
-#ifdef ERTS_SMP
- pix_lock = ERTS_PIX2PIXLOCK(p_next);
- erts_pix_lock(pix_lock);
-#endif
- ASSERT(!process_tab[p_next]);
+ /* Reserve slot */
+ while (1) {
+ lpd++;
+ pix = erts_pid_data2ix((Eterm) (lpd & ERTS_PID_DATA_MASK__));
+ if (erts_smp_atomic_read_nob(&erts_proc.tab[pix]) == ERTS_AINT_NULL) {
+ erts_aint_t val;
+ val = erts_smp_atomic_cmpxchg_relb(&erts_proc.tab[pix],
+ ((erts_aint_t)
+ ERTS_PROC_LOCK_BUSY),
+ ERTS_AINT_NULL);
+
+ if (ERTS_AINT_NULL == val)
+ break;
+ }
+ }
- process_tab[p_next] = p;
- erts_smp_atomic32_inc_nob(&process_count);
- p->id = make_internal_pid(p_serial << p_serial_shift | p_next);
+ pid_data = (Eterm) lpd & ERTS_PID_DATA_MASK__;
+
+ p->id = make_internal_pid(pid_data);
if (p->id == ERTS_INVALID_PID) {
/* Do not use the invalid pid; change serial */
- p_serial++;
- p_serial &= p_serial_mask;
- p->id = make_internal_pid(p_serial << p_serial_shift | p_next);
+ lpd += erts_proc.max;
+ ASSERT(pix == erts_pid_data2ix((Eterm) (lpd & ERTS_PID_DATA_MASK__)));
+ pid_data = (Eterm) lpd & ERTS_PID_DATA_MASK__;
+ p->id = make_internal_pid(pid_data);
ASSERT(p->id != ERTS_INVALID_PID);
}
- ASSERT(internal_pid_serial(p->id) <= (erts_use_r9_pids_ports
- ? ERTS_MAX_PID_R9_SERIAL
- : ERTS_MAX_PID_SERIAL));
+
+ exp_lpd = last_pid_data_read_nob();
+
+ /* Move last pid data forward */
+ while (1) {
+ Uint64 act_lpd;
+ if (last_pid_data_cmp(lpd, exp_lpd) < 0)
+ break;
+ act_lpd = last_pid_data_cmpxchg_relb(lpd, exp_lpd);
+ if (act_lpd == exp_lpd)
+ break;
+ exp_lpd = act_lpd;
+ }
#ifdef ERTS_SMP
- erts_proc_lock_init(p); /* All locks locked */
- erts_pix_unlock(pix_lock);
+ RUNQ_SET_RQ(&p->run_queue, rq);
#endif
- p->rstatus = P_FREE;
- p->rcount = 0;
+ erts_smp_atomic32_init_relb(&p->state, state);
- /*
- * set p_next to the next available slot
- */
+#ifdef DEBUG
+ pid = p->id;
+#endif
- p_prev = p_next;
+#ifdef ERTS_SMP
+ erts_proc_lock_init(p); /* All locks locked */
+#endif
- while (1) {
- p_next++;
- if(p_next >= erts_max_processes) {
- p_serial++;
- p_serial &= p_serial_mask;
- p_next = 0;
- }
+ /* Move into slot reserved */
+#ifdef DEBUG
+ ASSERT(ERTS_PROC_LOCK_BUSY
+ == (Process *) erts_smp_atomic_xchg_relb(&erts_proc.tab[pix],
+ (erts_aint_t) p));
+#else
+ erts_smp_atomic_set_relb(&erts_proc.tab[pix], (erts_aint_t) p);
+#endif
- if (p_prev == p_next) {
- p_next = -1;
- break; /* Table full! */
- }
+ ASSERT(internal_pid_serial(p->id) <= (erts_use_r9_pids_ports
+ ? ERTS_MAX_PID_R9_SERIAL
+ : ERTS_MAX_PID_SERIAL));
- if (!process_tab[p_next])
- break; /* found a free slot */
- }
+ erts_smp_rwmtx_runlock(&erts_proc_tab_rwmtx);
- error:
+ p->rcount = 0;
- erts_smp_mtx_unlock(&proc_tab_mtx);
+ ASSERT(p == (Process *)
+ erts_smp_atomic_read_nob(
+ &erts_proc.tab[internal_pid_index(pid)]));
return p;
+enomem:
+system_limit:
+
+ erts_smp_rwmtx_runlock(&erts_proc_tab_rwmtx);
+ return NULL;
+
}
Eterm
@@ -6700,31 +7720,20 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
Eterm args, /* Arguments for function (must be well-formed list). */
ErlSpawnOpts* so) /* Options for spawn. */
{
- ErtsRunQueue *rq, *notify_runq;
+ ErtsRunQueue *rq = NULL;
Process *p;
Sint arity; /* Number of arguments. */
-#ifndef HYBRID
Uint arg_size; /* Size of arguments. */
-#endif
Uint sz; /* Needed words on heap. */
Uint heap_need; /* Size needed on heap. */
Eterm res = THE_NON_VALUE;
+ erts_aint32_t state = 0;
+ erts_aint32_t prio = (erts_aint32_t) PRIORITY_NORMAL;
#ifdef ERTS_SMP
erts_smp_proc_lock(parent, ERTS_PROC_LOCKS_ALL_MINOR);
#endif
-#ifdef HYBRID
- /*
- * Copy the arguments to the global heap
- * Since global GC might occur we want to do this before adding the
- * new process to the process_tab.
- */
- BM_SWAP_TIMER(system,copy);
- LAZY_COPY(parent,args);
- BM_SWAP_TIMER(copy,system);
- heap_need = 0;
-#endif /* HYBRID */
/*
* Check for errors.
*/
@@ -6733,8 +7742,24 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
so->error_code = BADARG;
goto error;
}
- p = alloc_process(); /* All proc locks are locked by this thread
- on success */
+
+ if (so->flags & SPO_USE_ARGS) {
+ if (so->scheduler) {
+ int ix = so->scheduler-1;
+ ASSERT(0 <= ix && ix < erts_no_run_queues);
+ rq = ERTS_RUNQ_IX(ix);
+ state |= ERTS_PSFLG_BOUND;
+ }
+ prio = (erts_aint32_t) so->priority;
+ }
+
+ state |= (prio & ERTS_PSFLG_PRIO_MASK);
+
+ if (!rq)
+ rq = erts_get_runq_proc(parent);
+
+ p = alloc_process(rq, state); /* All proc locks are locked by this thread
+ on success */
if (!p) {
erts_send_error_to_logger_str(parent->group_leader,
"Too many processes\n");
@@ -6747,31 +7772,23 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
#endif
BM_COUNT(processes_spawned);
-#ifndef HYBRID
BM_SWAP_TIMER(system,size);
arg_size = size_object(args);
BM_SWAP_TIMER(size,system);
heap_need = arg_size;
-#endif
p->flags = erts_default_process_flags;
- /* Scheduler queue mutex should be locked when changeing
- * prio. In this case we don't have to lock it, since
- * noone except us has access to the process.
- */
if (so->flags & SPO_USE_ARGS) {
p->min_heap_size = so->min_heap_size;
p->min_vheap_size = so->min_vheap_size;
- p->prio = so->priority;
p->max_gen_gcs = so->max_gen_gcs;
} else {
p->min_heap_size = H_MIN_SIZE;
p->min_vheap_size = BIN_VH_MIN_SIZE;
- p->prio = PRIORITY_NORMAL;
p->max_gen_gcs = (Uint16) erts_smp_atomic32_read_nob(&erts_max_gen_gcs);
}
- p->skipped = 0;
+ p->schedule_count = 0;
ASSERT(p->min_heap_size == erts_next_heap_size(p->min_heap_size, 0));
p->initial[INITIAL_MOD] = mod;
@@ -6803,9 +7820,6 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
p->heap = (Eterm *) ERTS_HEAP_ALLOC(ERTS_ALC_T_HEAP, sizeof(Eterm)*sz);
p->old_hend = p->old_htop = p->old_heap = NULL;
p->high_water = p->heap;
-#ifdef INCREMENTAL
- p->scan_top = p->high_water;
-#endif
p->gen_gcs = 0;
p->stop = p->hend = p->heap + sz;
p->htop = p->heap;
@@ -6831,19 +7845,10 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
BM_STOP_TIMER(system);
BM_MESSAGE(args,p,parent);
BM_START_TIMER(system);
-#ifdef HYBRID
- p->arg_reg[2] = args;
-#ifdef INCREMENTAL
- p->active = 0;
- if (ptr_val(args) >= inc_fromspc && ptr_val(args) < inc_fromend)
- INC_ACTIVATE(p);
-#endif
-#else
BM_SWAP_TIMER(system,copy);
p->arg_reg[2] = copy_struct(args, arg_size, &p->htop, &p->off_heap);
BM_MESSAGE_COPIED(arg_size);
BM_SWAP_TIMER(copy,system);
-#endif
p->arity = 3;
p->fvalue = NIL;
@@ -6852,9 +7857,9 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
p->reds = 0;
#ifdef ERTS_SMP
- p->u.ptimer = NULL;
+ p->u.alive.ptimer = NULL;
#else
- sys_memset(&p->u.tm, 0, sizeof(ErlTimer));
+ sys_memset(&p->u.alive.tm, 0, sizeof(ErlTimer));
#endif
p->reg = NULL;
@@ -6882,10 +7887,9 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
p->msg.save = &p->msg.first;
p->msg.len = 0;
#ifdef ERTS_SMP
- p->msg_inq.first = NULL;
- p->msg_inq.last = &p->msg_inq.first;
- p->msg_inq.len = 0;
- p->bound_runq = NULL;
+ p->u.alive.msg_inq.first = NULL;
+ p->u.alive.msg_inq.last = &p->u.alive.msg_inq.first;
+ p->u.alive.msg_inq.len = 0;
#endif
p->bif_timers = NULL;
p->mbuf = NULL;
@@ -6895,14 +7899,11 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
p->seq_trace_lastcnt = 0;
p->seq_trace_clock = 0;
SEQ_TRACE_TOKEN(p) = NIL;
- p->parent = parent->id == ERTS_INVALID_PID ? NIL : parent->id;
-
-#ifdef HYBRID
- p->rrma = NULL;
- p->rrsrc = NULL;
- p->nrr = 0;
- p->rrsz = 0;
+#ifdef USE_VM_PROBES
+ DT_UTAG(p) = NIL;
+ DT_UTAG_FLAGS(p) = 0;
#endif
+ p->parent = parent->id == ERTS_INVALID_PID ? NIL : parent->id;
INIT_HOLE_CHECK(p);
#ifdef DEBUG
@@ -6972,60 +7973,39 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
so->mref = mref;
}
-#ifdef HYBRID
- /*
- * Add process to the array of active processes.
- */
- ACTIVATE(p);
- p->active_index = erts_num_active_procs++;
- erts_active_procs[p->active_index] = p;
-#endif
-
#ifdef ERTS_SMP
p->scheduler_data = NULL;
- p->is_exiting = 0;
- p->status_flags = 0;
- p->runq_flags = 0;
p->suspendee = NIL;
p->pending_suspenders = NULL;
- p->pending_exit.reason = THE_NON_VALUE;
- p->pending_exit.bp = NULL;
+ p->u.alive.pending_exit.reason = THE_NON_VALUE;
+ p->u.alive.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);
+
+ res = p->id;
+
/*
* Schedule process for execution.
*/
- if (!((so->flags & SPO_USE_ARGS) && so->scheduler))
- rq = erts_get_runq_proc(parent);
- else {
- int ix = so->scheduler-1;
- ASSERT(0 <= ix && ix < erts_no_run_queues);
- rq = ERTS_RUNQ_IX(ix);
- p->bound_runq = rq;
- }
-
- erts_smp_runq_lock(rq);
-
-#ifdef ERTS_SMP
- p->run_queue = rq;
-#endif
-
- p->status = P_WAITING;
- notify_runq = internal_add_to_runq(rq, p);
+ schedule_process(p, state, 0);
- erts_smp_runq_unlock(rq);
+ VERBOSE(DEBUG_PROCESSES, ("Created a new process: %T\n",p->id));
- smp_notify_inc_runq(notify_runq);
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(process_spawn)) {
+ DTRACE_CHARBUF(process_name, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(mfa, DTRACE_TERM_BUF_SIZE);
- res = p->id;
- erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL);
-
- VERBOSE(DEBUG_PROCESSES, ("Created a new process: %T\n",p->id));
+ dtrace_fun_decode(p, mod, func, arity, process_name, mfa);
+ DTRACE2(process_spawn, process_name, mfa);
+ }
+#endif
error:
@@ -7049,12 +8029,8 @@ void erts_init_empty_process(Process *p)
p->max_gen_gcs = 0;
p->min_heap_size = 0;
p->min_vheap_size = 0;
- p->status = P_RUNABLE;
- p->gcstatus = P_RUNABLE;
- p->rstatus = P_RUNABLE;
p->rcount = 0;
p->id = ERTS_INVALID_PID;
- p->prio = PRIORITY_NORMAL;
p->reds = 0;
p->tracer_proc = NIL;
p->trace_flags = F_INITIAL_TRACE_FLAGS;
@@ -7070,10 +8046,9 @@ void erts_init_empty_process(Process *p)
p->bin_old_vheap = 0;
p->bin_vheap_mature = 0;
#ifdef ERTS_SMP
- p->u.ptimer = NULL;
- p->bound_runq = NULL;
+ p->u.alive.ptimer = NULL;
#else
- memset(&(p->u.tm), 0, sizeof(ErlTimer));
+ memset(&(p->u.alive.tm), 0, sizeof(ErlTimer));
#endif
p->next = NULL;
p->off_heap.first = NULL;
@@ -7081,9 +8056,6 @@ void erts_init_empty_process(Process *p)
p->reg = NULL;
p->heap_sz = 0;
p->high_water = NULL;
-#ifdef INCREMENTAL
- p->scan_top = NULL;
-#endif
p->old_hend = NULL;
p->old_htop = NULL;
p->old_heap = NULL;
@@ -7125,8 +8097,8 @@ void erts_init_empty_process(Process *p)
p->def_arg_reg[5] = 0;
p->parent = NIL;
- p->started.tv_sec = 0;
- p->started.tv_usec = 0;
+ p->approx_started = 0;
+ p->started_interval = 0;
#ifdef HIPE
hipe_init_process(&p->hipe);
@@ -7135,35 +8107,25 @@ void erts_init_empty_process(Process *p)
#endif
#endif
- ACTIVATE(p);
-
-#ifdef HYBRID
- p->rrma = NULL;
- p->rrsrc = NULL;
- p->nrr = 0;
- p->rrsz = 0;
-#endif
INIT_HOLE_CHECK(p);
#ifdef DEBUG
p->last_old_htop = NULL;
#endif
+ erts_smp_atomic32_init_nob(&p->state, (erts_aint32_t) PRIORITY_NORMAL);
#ifdef ERTS_SMP
p->scheduler_data = NULL;
- p->is_exiting = 0;
- p->status_flags = 0;
- p->runq_flags = 0;
- p->msg_inq.first = NULL;
- p->msg_inq.last = &p->msg_inq.first;
- p->msg_inq.len = 0;
+ p->u.alive.msg_inq.first = NULL;
+ p->u.alive.msg_inq.last = &p->u.alive.msg_inq.first;
+ p->u.alive.msg_inq.len = 0;
p->suspendee = NIL;
p->pending_suspenders = NULL;
- p->pending_exit.reason = THE_NON_VALUE;
- p->pending_exit.bp = NULL;
+ p->u.alive.pending_exit.reason = THE_NON_VALUE;
+ p->u.alive.pending_exit.bp = NULL;
erts_proc_lock_init(p);
erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL);
- p->run_queue = ERTS_RUNQ_IX(0);
+ RUNQ_SET_RQ(&p->run_queue, ERTS_RUNQ_IX(0));
#endif
#if !defined(NO_FPE_SIGNALS) || defined(HIPE)
@@ -7190,9 +8152,6 @@ erts_debug_verify_clean_empty_process(Process* p)
ASSERT(p->reg == NULL);
ASSERT(p->heap_sz == 0);
ASSERT(p->high_water == NULL);
-#ifdef INCREMENTAL
- ASSERT(p->scan_top == NULL);
-#endif
ASSERT(p->old_hend == NULL);
ASSERT(p->old_htop == NULL);
ASSERT(p->old_heap == NULL);
@@ -7213,12 +8172,12 @@ erts_debug_verify_clean_empty_process(Process* p)
ASSERT(p->parent == NIL);
#ifdef ERTS_SMP
- ASSERT(p->msg_inq.first == NULL);
- ASSERT(p->msg_inq.len == 0);
+ ASSERT(p->u.alive.msg_inq.first == NULL);
+ ASSERT(p->u.alive.msg_inq.len == 0);
ASSERT(p->suspendee == NIL);
ASSERT(p->pending_suspenders == NULL);
- ASSERT(p->pending_exit.reason == THE_NON_VALUE);
- ASSERT(p->pending_exit.bp == NULL);
+ ASSERT(p->u.alive.pending_exit.reason == THE_NON_VALUE);
+ ASSERT(p->u.alive.pending_exit.bp == NULL);
#endif
/* Thing that erts_cleanup_empty_process() cleans up */
@@ -7244,8 +8203,8 @@ erts_cleanup_empty_process(Process* p)
free_message_buffer(p->mbuf);
p->mbuf = NULL;
}
-#if defined(ERTS_ENABLE_LOCK_COUNT) && defined(ERTS_SMP)
- erts_lcnt_proc_lock_destroy(p);
+#ifdef ERTS_SMP
+ erts_proc_lock_fin(p);
#endif
#ifdef DEBUG
erts_debug_verify_clean_empty_process(p);
@@ -7340,44 +8299,36 @@ delete_process(Process* p)
ASSERT(!p->suspend_monitors);
p->fvalue = NIL;
+}
-#ifdef HYBRID
- erts_active_procs[p->active_index] =
- erts_active_procs[--erts_num_active_procs];
- erts_active_procs[p->active_index]->active_index = p->active_index;
-#ifdef INCREMENTAL
- if (INC_IS_ACTIVE(p))
- INC_DEACTIVATE(p);
-#endif
-
- if (p->rrma != NULL) {
- erts_free(ERTS_ALC_T_ROOTSET,p->rrma);
- erts_free(ERTS_ALC_T_ROOTSET,p->rrsrc);
+static ERTS_INLINE erts_aint32_t
+set_proc_exiting_state(Process *p, erts_aint32_t state)
+{
+ erts_aint32_t a, n, e;
+ a = state;
+ while (1) {
+ n = e = a;
+ n &= ~(ERTS_PSFLG_SUSPENDED|ERTS_PSFLG_PENDING_EXIT);
+ n |= ERTS_PSFLG_EXITING|ERTS_PSFLG_ACTIVE;
+ if (!(a & (ERTS_PSFLG_IN_RUNQ|ERTS_PSFLG_RUNNING)))
+ n |= ERTS_PSFLG_IN_RUNQ;
+ a = erts_smp_atomic32_cmpxchg_relb(&p->state, n, e);
+ if (a == e)
+ break;
}
-#endif
-
+ return a;
}
static ERTS_INLINE void
-set_proc_exiting(Process *p, Eterm reason, ErlHeapFragment *bp)
+set_proc_exiting(Process *p,
+ erts_aint32_t state,
+ Eterm reason,
+ ErlHeapFragment *bp)
{
-#ifdef ERTS_SMP
- erts_pix_lock_t *pix_lock = ERTS_PID2PIXLOCK(p->id);
ERTS_SMP_LC_ASSERT(erts_proc_lc_my_proc_locks(p) == ERTS_PROC_LOCKS_ALL);
- /*
- * You are required to have all proc locks and the pix lock when going
- * to status P_EXITING. This makes it is enough to take any lock when
- * looking up a process (pid2proc()) to prevent the looked up process
- * from exiting until the lock has been released.
- */
- erts_pix_lock(pix_lock);
- p->is_exiting = 1;
-#endif
- p->status = P_EXITING;
-#ifdef ERTS_SMP
- erts_pix_unlock(pix_lock);
-#endif
+ state = set_proc_exiting_state(p, state);
+
p->fvalue = reason;
if (bp)
erts_link_mbuf_to_proc(p, bp);
@@ -7390,6 +8341,14 @@ set_proc_exiting(Process *p, Eterm reason, ErlHeapFragment *bp)
KILL_CATCHES(p);
cancel_timer(p);
p->i = (BeamInstr *) beam_exit;
+
+ if (erts_system_profile_flags.runnable_procs
+ && !(state & (ERTS_PSFLG_ACTIVE|ERTS_PSFLG_SUSPENDED))) {
+ profile_runnable_proc(p, am_active);
+ }
+
+ if (!(state & (ERTS_PSFLG_IN_RUNQ|ERTS_PSFLG_RUNNING)))
+ add2runq(p, state);
}
@@ -7399,11 +8358,11 @@ void
erts_handle_pending_exit(Process *c_p, ErtsProcLocks locks)
{
ErtsProcLocks xlocks;
- ASSERT(is_value(c_p->pending_exit.reason));
+ ASSERT(is_value(c_p->u.alive.pending_exit.reason));
ERTS_SMP_LC_ASSERT(erts_proc_lc_my_proc_locks(c_p) == locks);
ERTS_SMP_LC_ASSERT(locks & ERTS_PROC_LOCK_MAIN);
- ERTS_SMP_LC_ASSERT(c_p->status != P_EXITING);
- ERTS_SMP_LC_ASSERT(c_p->status != P_FREE);
+ ERTS_SMP_LC_ASSERT(!((ERTS_PSFLG_EXITING|ERTS_PSFLG_FREE)
+ & erts_smp_atomic32_read_nob(&c_p->state)));
/* Ensure that all locks on c_p are locked before proceeding... */
if (locks == ERTS_PROC_LOCKS_ALL)
@@ -7416,9 +8375,12 @@ erts_handle_pending_exit(Process *c_p, ErtsProcLocks locks)
}
}
- set_proc_exiting(c_p, c_p->pending_exit.reason, c_p->pending_exit.bp);
- c_p->pending_exit.reason = THE_NON_VALUE;
- c_p->pending_exit.bp = NULL;
+ set_proc_exiting(c_p,
+ erts_smp_atomic32_read_acqb(&c_p->state),
+ c_p->u.alive.pending_exit.reason,
+ c_p->u.alive.pending_exit.bp);
+ c_p->u.alive.pending_exit.reason = THE_NON_VALUE;
+ c_p->u.alive.pending_exit.bp = NULL;
if (xlocks)
erts_smp_proc_unlock(c_p, xlocks);
@@ -7432,11 +8394,12 @@ handle_pending_exiters(ErtsProcList *pnd_xtrs)
while (plp) {
Process *p = erts_pid2proc(NULL, 0, plp->pid, ERTS_PROC_LOCKS_ALL);
if (p) {
- if (proclist_same(plp, p)
- && !(p->status_flags & ERTS_PROC_SFLG_RUNNING)) {
- ASSERT(p->status_flags & ERTS_PROC_SFLG_INRUNQ);
- ASSERT(ERTS_PROC_PENDING_EXIT(p));
- erts_handle_pending_exit(p, ERTS_PROC_LOCKS_ALL);
+ if (proclist_same(plp, p)) {
+ erts_aint32_t state = erts_smp_atomic32_read_acqb(&p->state);
+ if (!(state & ERTS_PSFLG_RUNNING)) {
+ ASSERT(state & ERTS_PSFLG_PENDING_EXIT);
+ erts_handle_pending_exit(p, ERTS_PROC_LOCKS_ALL);
+ }
}
erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL);
}
@@ -7464,7 +8427,7 @@ save_pending_exiter(Process *p)
rq->procs.pending_exiters = plp;
erts_smp_runq_unlock(rq);
-
+ wake_scheduler(rq, 1);
}
#endif
@@ -7478,7 +8441,11 @@ static ERTS_INLINE void
send_exit_message(Process *to, ErtsProcLocks *to_locksp,
Eterm exit_term, Uint term_size, Eterm token)
{
- if (token == NIL) {
+ if (token == NIL
+#ifdef USE_VM_PROBES
+ || token == am_have_dt_utag
+#endif
+ ) {
Eterm* hp;
Eterm mess;
ErlHeapFragment* bp;
@@ -7486,7 +8453,11 @@ send_exit_message(Process *to, ErtsProcLocks *to_locksp,
hp = erts_alloc_message_heap(term_size, &bp, &ohp, to, to_locksp);
mess = copy_struct(exit_term, term_size, &hp, ohp);
- erts_queue_message(to, to_locksp, bp, mess, NIL);
+ erts_queue_message(to, to_locksp, bp, mess, NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
} else {
ErlHeapFragment* bp;
Eterm* hp;
@@ -7502,7 +8473,11 @@ send_exit_message(Process *to, ErtsProcLocks *to_locksp,
/* the trace token must in this case be updated by the caller */
seq_trace_output(token, mess, SEQ_TRACE_SEND, to->id, NULL);
temp_token = copy_struct(token, sz_token, &hp, &bp->off_heap);
- erts_queue_message(to, to_locksp, bp, mess, temp_token);
+ erts_queue_message(to, to_locksp, bp, mess, temp_token
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
}
}
@@ -7514,7 +8489,7 @@ send_exit_message(Process *to, ErtsProcLocks *to_locksp,
* SMP emulator). When the signal is received the receiver receives an
* 'EXIT' message if it is trapping exits; otherwise, it will either
* ignore the signal if the exit reason is normal, or go into an
- * exiting state (status P_EXITING). When a process has gone into the
+ * exiting state (ERTS_PSFLG_EXITING). When a process has gone into the
* exiting state it will not execute any more Erlang code, but it might
* take a while before it actually exits. The exit signal is being
* received when the 'EXIT' message is put in the message queue, the
@@ -7587,6 +8562,7 @@ send_exit_signal(Process *c_p, /* current process if and only
Uint32 flags /* flags */
)
{
+ erts_aint32_t state = erts_smp_atomic32_read_nob(&rp->state);
Eterm rsn = reason == am_kill ? am_killed : reason;
ERTS_SMP_LC_ASSERT(*rp_locks == erts_proc_lc_my_proc_locks(rp));
@@ -7595,9 +8571,26 @@ send_exit_signal(Process *c_p, /* current process if and only
ASSERT(reason != THE_NON_VALUE);
- if (ERTS_PROC_IS_TRAPPING_EXITS(rp)
+#ifdef USE_VM_PROBES
+ if(DTRACE_ENABLED(process_exit_signal) && is_pid(from)) {
+ DTRACE_CHARBUF(sender_str, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(receiver_str, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(reason_buf, DTRACE_TERM_BUF_SIZE);
+
+ dtrace_pid_str(from, sender_str);
+ dtrace_proc_str(rp, receiver_str);
+ erts_snprintf(reason_buf, sizeof(reason_buf) - 1, "%T", reason);
+ DTRACE3(process_exit_signal, sender_str, receiver_str, reason_buf);
+ }
+#endif
+
+ if ((state & ERTS_PSFLG_TRAP_EXIT)
&& (reason != am_kill || (flags & ERTS_XSIG_FLG_IGN_KILL))) {
- if (is_not_nil(token) && token_update)
+ if (is_not_nil(token)
+#ifdef USE_VM_PROBES
+ && token != am_have_dt_utag
+#endif
+ && token_update)
seq_trace_update_send(token_update);
if (is_value(exit_tuple))
send_exit_message(rp, rp_locks, exit_tuple, exit_tuple_sz, token);
@@ -7607,10 +8600,8 @@ send_exit_signal(Process *c_p, /* current process if and only
}
else if (reason != am_normal || (flags & ERTS_XSIG_FLG_NO_IGN_NORMAL)) {
#ifdef ERTS_SMP
- if (!ERTS_PROC_PENDING_EXIT(rp) && !rp->is_exiting) {
- ASSERT(rp->status != P_EXITING);
- ASSERT(rp->status != P_FREE);
- ASSERT(!rp->pending_exit.bp);
+ if (!(state & (ERTS_PSFLG_EXITING|ERTS_PSFLG_PENDING_EXIT))) {
+ ASSERT(!rp->u.alive.pending_exit.bp);
if (rp == c_p && (*rp_locks & ERTS_PROC_LOCK_MAIN)) {
/* Ensure that all locks on c_p are locked before
@@ -7625,9 +8616,9 @@ send_exit_signal(Process *c_p, /* current process if and only
}
*rp_locks = ERTS_PROC_LOCKS_ALL;
}
- set_proc_exiting(c_p, rsn, NULL);
+ set_proc_exiting(c_p, state, rsn, NULL);
}
- else if (!(rp->status_flags & ERTS_PROC_SFLG_RUNNING)) {
+ else if (!(state & ERTS_PSFLG_RUNNING)) {
/* Process not running ... */
ErtsProcLocks need_locks = ~(*rp_locks) & ERTS_PROC_LOCKS_ALL;
if (need_locks
@@ -7644,6 +8635,7 @@ send_exit_signal(Process *c_p, /* current process if and only
/* ...and we have all locks on it... */
*rp_locks = ERTS_PROC_LOCKS_ALL;
set_proc_exiting(rp,
+ state,
(is_immed(rsn)
? rsn
: copy_object(rsn, rp)),
@@ -7659,7 +8651,7 @@ send_exit_signal(Process *c_p, /* current process if and only
set_pending_exit:
if (is_immed(rsn)) {
- rp->pending_exit.reason = rsn;
+ rp->u.alive.pending_exit.reason = rsn;
}
else {
Eterm *hp;
@@ -7667,17 +8659,15 @@ send_exit_signal(Process *c_p, /* current process if and only
ErlHeapFragment *bp = new_message_buffer(sz);
hp = &bp->mem[0];
- rp->pending_exit.reason = copy_struct(rsn,
- sz,
- &hp,
- &bp->off_heap);
- rp->pending_exit.bp = bp;
+ rp->u.alive.pending_exit.reason = copy_struct(rsn,
+ sz,
+ &hp,
+ &bp->off_heap);
+ rp->u.alive.pending_exit.bp = bp;
}
- ASSERT(ERTS_PROC_PENDING_EXIT(rp));
+ erts_smp_atomic32_read_bor_relb(&rp->state,
+ ERTS_PSFLG_PENDING_EXIT);
}
- if (!(rp->status_flags
- & (ERTS_PROC_SFLG_INRUNQ|ERTS_PROC_SFLG_RUNNING)))
- erts_add_to_runq(rp);
}
/* else:
*
@@ -7689,18 +8679,14 @@ send_exit_signal(Process *c_p, /* current process if and only
* exit or by itself before seeing the pending exit.
*/
#else /* !ERTS_SMP */
- if (c_p == rp) {
- rp->status = P_EXITING;
- c_p->fvalue = rsn;
- }
- else if (rp->status != P_EXITING) { /* No recursive process exits /PaN */
- Eterm old_status = rp->status;
+ erts_aint32_t state = erts_smp_atomic32_read_nob(&rp->state);
+ if (!(state & ERTS_PSFLG_EXITING)) {
set_proc_exiting(rp,
- is_immed(rsn) ? rsn : copy_object(rsn, rp),
+ state,
+ (is_immed(rsn) || c_p == rp
+ ? rsn
+ : copy_object(rsn, rp)),
NULL);
- ACTIVATE(rp);
- if (old_status != P_RUNABLE && old_status != P_RUNNING)
- erts_add_to_runq(rp);
}
#endif
return -1; /* Receiver will exit */
@@ -8003,12 +8989,14 @@ resume_suspend_monitor(ErtsSuspendMonitor *smon, void *vc_p)
erts_destroy_suspend_monitor(smon);
}
-static void
-continue_exit_process(Process *p
#ifdef ERTS_SMP
- , erts_pix_lock_t *pix_lock
+static void
+proc_dec_refc(void *vproc)
+{
+ erts_smp_proc_dec_refc((Process *) vproc);
+}
#endif
- );
+
/* this function fishishes a process and propagates exit messages - called
by process_main when a process dies */
@@ -8016,41 +9004,41 @@ void
erts_do_exit_process(Process* p, Eterm reason)
{
#ifdef ERTS_SMP
- erts_pix_lock_t *pix_lock = ERTS_PID2PIXLOCK(p->id);
+ erts_aint32_t state;
#endif
-
p->arity = 0; /* No live registers */
p->fvalue = reason;
-
+
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(process_exit)) {
+ DTRACE_CHARBUF(process_buf, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(reason_buf, DTRACE_TERM_BUF_SIZE);
+
+ dtrace_proc_str(p, process_buf);
+ erts_snprintf(reason_buf, DTRACE_TERM_BUF_SIZE - 1, "%T", reason);
+ DTRACE2(process_exit, process_buf, reason_buf);
+ }
+#endif
+
#ifdef ERTS_SMP
ERTS_SMP_CHK_HAVE_ONLY_MAIN_PROC_LOCK(p);
/* By locking all locks (main lock is already locked) when going
- to status P_EXITING, it is enough to take any lock when
+ to exiting state (ERTS_PSFLG_EXITING), it is enough to take any lock when
looking up a process (erts_pid2proc()) to prevent the looked up
process from exiting until the lock has been released. */
erts_smp_proc_lock(p, ERTS_PROC_LOCKS_ALL_MINOR);
#endif
-
- if (erts_system_profile_flags.runnable_procs && (p->status != P_WAITING)) {
- profile_runnable_proc(p, am_inactive);
- }
-#ifdef ERTS_SMP
- erts_pix_lock(pix_lock);
- p->is_exiting = 1;
-#endif
-
- p->status = P_EXITING;
-
-#ifdef ERTS_SMP
- erts_pix_unlock(pix_lock);
-
- if (ERTS_PROC_PENDING_EXIT(p)) {
+#ifndef ERTS_SMP
+ set_proc_exiting_state(p, erts_smp_atomic32_read_nob(&p->state));
+#else
+ state = set_proc_exiting_state(p, erts_smp_atomic32_read_nob(&p->state));
+ if (state & ERTS_PSFLG_PENDING_EXIT) {
/* Process exited before pending exit was received... */
- p->pending_exit.reason = THE_NON_VALUE;
- if (p->pending_exit.bp) {
- free_message_buffer(p->pending_exit.bp);
- p->pending_exit.bp = NULL;
+ p->u.alive.pending_exit.reason = THE_NON_VALUE;
+ if (p->u.alive.pending_exit.bp) {
+ free_message_buffer(p->u.alive.pending_exit.bp);
+ p->u.alive.pending_exit.bp = NULL;
}
}
@@ -8084,29 +9072,11 @@ erts_do_exit_process(Process* p, Eterm reason)
erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL_MINOR);
-#ifdef ERTS_SMP
- continue_exit_process(p, pix_lock);
-#else
- continue_exit_process(p);
-#endif
+ erts_continue_exit_process(p);
}
void
-erts_continue_exit_process(Process *c_p)
-{
-#ifdef ERTS_SMP
- continue_exit_process(c_p, ERTS_PID2PIXLOCK(c_p->id));
-#else
- continue_exit_process(c_p);
-#endif
-}
-
-static void
-continue_exit_process(Process *p
-#ifdef ERTS_SMP
- , erts_pix_lock_t *pix_lock
-#endif
- )
+erts_continue_exit_process(Process *p)
{
ErtsLink* lnk;
ErtsMonitor *mon;
@@ -8122,11 +9092,7 @@ continue_exit_process(Process *p
ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_MAIN == erts_proc_lc_my_proc_locks(p));
-#ifdef DEBUG
- erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS);
- ASSERT(p->status == P_EXITING);
- erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
-#endif
+ ASSERT(ERTS_PROC_IS_EXITING(p));
#ifdef ERTS_SMP
if (p->flags & F_HAVE_BLCKD_MSCHED) {
@@ -8194,48 +9160,47 @@ continue_exit_process(Process *p
#endif
{
+ int maybe_save;
int pix;
/* Do *not* use erts_get_runq_proc() */
ErtsRunQueue *rq;
rq = erts_get_runq_current(ERTS_GET_SCHEDULER_DATA_FROM_PROC(p));
- ASSERT(internal_pid_index(p->id) < erts_max_processes);
pix = internal_pid_index(p->id);
- erts_smp_mtx_lock(&proc_tab_mtx);
+ erts_smp_rwmtx_rlock(&erts_proc_tab_rwmtx);
+ maybe_save = saved_term_procs.end != NULL;
+ if (maybe_save) {
+ erts_smp_rwmtx_runlock(&erts_proc_tab_rwmtx);
+ erts_smp_rwmtx_rwlock(&erts_proc_tab_rwmtx);
+ }
+
erts_smp_runq_lock(rq);
#ifdef ERTS_SMP
- erts_pix_lock(pix_lock);
-
ASSERT(p->scheduler_data);
ASSERT(p->scheduler_data->current_process == p);
ASSERT(p->scheduler_data->free_process == NULL);
p->scheduler_data->current_process = NULL;
p->scheduler_data->free_process = p;
- p->status_flags = 0;
#endif
- process_tab[pix] = NULL; /* Time of death! */
+ /* Time of death! */
+ erts_smp_atomic_set_relb(&erts_proc.tab[pix], ERTS_AINT_NULL);
+
ASSERT(erts_smp_atomic32_read_nob(&process_count) > 0);
- erts_smp_atomic32_dec_nob(&process_count);
+ erts_smp_atomic32_dec_relb(&process_count);
-#ifdef ERTS_SMP
- erts_pix_unlock(pix_lock);
-#endif
erts_smp_runq_unlock(rq);
- if (p_next < 0) {
- if (p_last >= p_next) {
- p_serial++;
- p_serial &= p_serial_mask;
- }
- p_next = pix;
+ if (!maybe_save)
+ erts_smp_rwmtx_runlock(&erts_proc_tab_rwmtx);
+ else {
+ if (saved_term_procs.end)
+ save_terminating_process(p);
+ erts_smp_rwmtx_rwunlock(&erts_proc_tab_rwmtx);
}
- ERTS_MAYBE_SAVE_TERMINATING_PROCESS(p);
-
- erts_smp_mtx_unlock(&proc_tab_mtx);
}
/*
@@ -8250,7 +9215,21 @@ continue_exit_process(Process *p
lnk = p->nlinks;
p->nlinks = NULL;
- p->status = P_FREE;
+
+ {
+ /* Inactivate and notify free */
+ erts_aint32_t n, e, a = erts_smp_atomic32_read_nob(&p->state);
+ while (1) {
+ n = e = a;
+ ASSERT(a & ERTS_PSFLG_EXITING);
+ n |= ERTS_PSFLG_FREE;
+ n &= ~ERTS_PSFLG_ACTIVE;
+ a = erts_smp_atomic32_cmpxchg_mb(&p->state, n, e);
+ if (a == e)
+ break;
+ }
+ }
+
dep = ((p->flags & F_DISTRIBUTION)
? ERTS_PROC_SET_DIST_ENTRY(p, ERTS_PROC_LOCKS_ALL, NULL)
: NULL);
@@ -8305,8 +9284,13 @@ continue_exit_process(Process *p
delete_process(p);
+#ifdef ERTS_SMP
+ erts_schedule_thr_prgr_later_op(proc_dec_refc,
+ (void *) p,
+ &p->u.release_data);
erts_smp_proc_lock(p, ERTS_PROC_LOCK_MAIN);
ERTS_SMP_CHK_HAVE_ONLY_MAIN_PROC_LOCK(p);
+#endif
return;
@@ -8319,8 +9303,6 @@ continue_exit_process(Process *p
ERTS_SMP_LC_ASSERT(curr_locks == erts_proc_lc_my_proc_locks(p));
ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_MAIN & curr_locks);
- ASSERT(p->status == P_EXITING);
-
p->i = (BeamInstr *) beam_continue_exit;
if (!(curr_locks & ERTS_PROC_LOCK_STATUS)) {
@@ -8328,8 +9310,6 @@ continue_exit_process(Process *p
curr_locks |= ERTS_PROC_LOCK_STATUS;
}
- erts_add_to_runq(p);
-
if (curr_locks != ERTS_PROC_LOCK_MAIN)
erts_smp_proc_unlock(p, ~ERTS_PROC_LOCK_MAIN & curr_locks);
@@ -8341,33 +9321,15 @@ continue_exit_process(Process *p
static void
timeout_proc(Process* p)
{
+ erts_aint32_t state;
BeamInstr** pi = (BeamInstr **) p->def_arg_reg;
p->i = *pi;
p->flags |= F_TIMO;
p->flags &= ~F_INSLPQUEUE;
- switch (p->status) {
- case P_GARBING:
- switch (p->gcstatus) {
- case P_SUSPENDED:
- goto suspended;
- case P_WAITING:
- goto waiting;
- default:
- break;
- }
- break;
- case P_WAITING:
- waiting:
- erts_add_to_runq(p);
- break;
- case P_SUSPENDED:
- suspended:
- p->rstatus = P_RUNABLE; /* MUST set resume status to runnable */
- break;
- default:
- break;
- }
+ state = erts_smp_atomic32_read_acqb(&p->state);
+ if (!(state & ERTS_PSFLG_ACTIVE))
+ schedule_process(p, state, 0);
}
@@ -8377,9 +9339,9 @@ cancel_timer(Process* p)
ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_MAIN & erts_proc_lc_my_proc_locks(p));
p->flags &= ~(F_INSLPQUEUE|F_TIMO);
#ifdef ERTS_SMP
- erts_cancel_smp_ptimer(p->u.ptimer);
+ erts_cancel_smp_ptimer(p->u.alive.ptimer);
#else
- erts_cancel_timer(&p->u.tm);
+ erts_cancel_timer(&p->u.alive.tm);
#endif
}
@@ -8400,12 +9362,12 @@ set_timer(Process* p, Uint timeout)
p->flags &= ~F_TIMO;
#ifdef ERTS_SMP
- erts_create_smp_ptimer(&p->u.ptimer,
+ erts_create_smp_ptimer(&p->u.alive.ptimer,
p->id,
(ErlTimeoutProc) timeout_proc,
timeout);
#else
- erts_set_timer(&p->u.tm,
+ erts_set_timer(&p->u.alive.tm,
(ErlTimeoutProc) timeout_proc,
NULL,
(void*) p,
@@ -8435,6 +9397,7 @@ erts_stack_dump(int to, void *to_arg, Process *p)
void
erts_program_counter_info(int to, void *to_arg, Process *p)
{
+ erts_aint32_t state;
int i;
erts_print(to, to_arg, "Program counter: %p (", p->i);
@@ -8443,7 +9406,8 @@ erts_program_counter_info(int to, void *to_arg, Process *p)
erts_print(to, to_arg, "CP: %p (", p->cp);
print_function_from_pc(to, to_arg, p->cp);
erts_print(to, to_arg, ")\n");
- if (!((p->status == P_RUNNING) || (p->status == P_GARBING))) {
+ state = erts_smp_atomic32_read_acqb(&p->state);
+ if (!(state & (ERTS_PSFLG_RUNNING|ERTS_PSFLG_GC))) {
erts_print(to, to_arg, "arity = %d\n",p->arity);
if (!ERTS_IS_CRASH_DUMPING) {
/*
@@ -8489,7 +9453,7 @@ stack_element_dump(int to, void *to_arg, Process* p, Eterm* sp, int yreg)
erts_print(to, to_arg, "\n%p ", sp);
} else {
char sbuf[16];
- sprintf(sbuf, "y(%d)", yreg);
+ erts_snprintf(sbuf, sizeof(sbuf), "y(%d)", yreg);
erts_print(to, to_arg, "%-8s ", sbuf);
yreg++;
}
@@ -8616,13 +9580,13 @@ do { \
#endif
#if ERTS_PROCESSES_BIF_DEBUGLEVEL >= ERTS_PROCS_DBGLVL_CHK_FOUND_PIDS
-# define ERTS_PROCS_DBG_CHK_PID_FOUND(PBDP, PID, TVP) \
- debug_processes_check_found_pid((PBDP), (PID), (TVP), 1)
-# define ERTS_PROCS_DBG_CHK_PID_NOT_FOUND(PBDP, PID, TVP) \
- debug_processes_check_found_pid((PBDP), (PID), (TVP), 0)
+# define ERTS_PROCS_DBG_CHK_PID_FOUND(PBDP, PID, IC) \
+ debug_processes_check_found_pid((PBDP), (PID), (IC), 1)
+# define ERTS_PROCS_DBG_CHK_PID_NOT_FOUND(PBDP, PID, IC) \
+ debug_processes_check_found_pid((PBDP), (PID), (IC), 0)
#else
-# define ERTS_PROCS_DBG_CHK_PID_FOUND(PBDP, PID, TVP)
-# define ERTS_PROCS_DBG_CHK_PID_NOT_FOUND(PBDP, PID, TVP)
+# define ERTS_PROCS_DBG_CHK_PID_FOUND(PBDP, PID, IC)
+# define ERTS_PROCS_DBG_CHK_PID_NOT_FOUND(PBDP, PID, IC)
#endif
#if ERTS_PROCESSES_BIF_DEBUGLEVEL >= ERTS_PROCS_DBGLVL_CHK_TERM_PROC_LIST
@@ -8667,7 +9631,7 @@ static Uint processes_bif_tab_chunks;
static Export processes_trap_export;
typedef struct {
- SysTimeval time;
+ Uint64 interval;
} ErtsProcessesBifChunkInfo;
typedef enum {
@@ -8692,7 +9656,7 @@ typedef struct {
struct {
Eterm caller;
#if ERTS_PROCESSES_BIF_DEBUGLEVEL >= ERTS_PROCS_DBGLVL_CHK_FOUND_PIDS
- SysTimeval *pid_started;
+ Uint64 *pid_started;
#endif
#if ERTS_PROCESSES_BIF_DEBUGLEVEL >= ERTS_PROCS_DBGLVL_CHK_HALLOC
Eterm *heap;
@@ -8721,11 +9685,10 @@ static void debug_processes_verify_all_pids(ErtsProcessesBifData *pbdp);
#if ERTS_PROCESSES_BIF_DEBUGLEVEL >= ERTS_PROCS_DBGLVL_CHK_FOUND_PIDS
static void debug_processes_check_found_pid(ErtsProcessesBifData *pbdp,
Eterm pid,
- SysTimeval *started,
+ Uint64 ic,
int pid_should_be_found);
#endif
#if ERTS_PROCESSES_BIF_DEBUGLEVEL >= ERTS_PROCS_DBGLVL_CHK_TERM_PROC_LIST
-static SysTimeval debug_tv_start;
static void debug_processes_check_term_proc_list(void);
static void debug_processes_check_term_proc_free_list(ErtsTermProcElement *tpep);
#endif
@@ -8736,7 +9699,7 @@ save_terminating_process(Process *p)
ErtsTermProcElement *tpep = erts_alloc(ERTS_ALC_T_PROCS_TPROC_EL,
sizeof(ErtsTermProcElement));
ERTS_PROCS_ASSERT(saved_term_procs.start && saved_term_procs.end);
- ERTS_SMP_LC_ASSERT(erts_lc_mtx_is_locked(&proc_tab_mtx));
+ ERTS_SMP_LC_ASSERT(erts_lc_rwmtx_is_rwlocked(&erts_proc_tab_rwmtx));
ERTS_PROCS_DBG_CHK_TPLIST();
@@ -8744,19 +9707,19 @@ save_terminating_process(Process *p)
tpep->next = NULL;
tpep->ix = internal_pid_index(p->id);
tpep->u.process.pid = p->id;
- tpep->u.process.spawned = p->started;
- erts_get_emu_time(&tpep->u.process.exited);
+ tpep->u.process.spawned = p->started_interval;
+ tpep->u.process.exited = get_proc_interval();
saved_term_procs.end->next = tpep;
saved_term_procs.end = tpep;
ERTS_PROCS_DBG_CHK_TPLIST();
- ERTS_PROCS_ASSERT((tpep->prev->ix >= 0
- ? erts_cmp_timeval(&tpep->u.process.exited,
- &tpep->prev->u.process.exited)
- : erts_cmp_timeval(&tpep->u.process.exited,
- &tpep->prev->u.bif_invocation.time)) > 0);
+ ERTS_PROCS_ASSERT(tpep->prev->ix >= 0
+ ? (tpep->u.process.exited
+ >= tpep->prev->u.process.exited)
+ : (tpep->u.process.exited
+ >= tpep->prev->u.bif_invocation.interval));
}
static void
@@ -8787,7 +9750,7 @@ cleanup_processes_bif_data(Binary *bp)
if (pbdp->bif_invocation) {
ErtsTermProcElement *tpep;
- erts_smp_mtx_lock(&proc_tab_mtx);
+ erts_smp_rwmtx_rwlock(&erts_proc_tab_rwmtx);
ERTS_PROCS_DBG_TRACE(pbdp->debug.caller,
cleanup_processes_bif_data,
@@ -8841,7 +9804,7 @@ cleanup_processes_bif_data(Binary *bp)
ERTS_PROCS_DBG_CHK_TPLIST();
- erts_smp_mtx_unlock(&proc_tab_mtx);
+ erts_smp_rwmtx_rwunlock(&erts_proc_tab_rwmtx);
}
}
@@ -8869,7 +9832,7 @@ processes_bif_engine(Process *p, Eterm *res_accp, Binary *mbp)
pbdp->tix = 0;
pbdp->pid_ix = 0;
- erts_smp_mtx_lock(&proc_tab_mtx);
+ erts_smp_rwmtx_rwlock(&erts_proc_tab_rwmtx);
locked = 1;
ERTS_PROCS_DBG_TRACE(p->id, processes_bif_engine, init);
@@ -8880,7 +9843,7 @@ processes_bif_engine(Process *p, Eterm *res_accp, Binary *mbp)
#if ERTS_PROCESSES_BIF_DEBUGLEVEL >= ERTS_PROCS_DBGLVL_CHK_FOUND_PIDS
pbdp->debug.pid_started = erts_alloc(ERTS_ALC_T_PROCS_PIDS,
- sizeof(SysTimeval)*pbdp->pid_sz);
+ sizeof(Uint64)*pbdp->pid_sz);
#endif
ERTS_PROCS_DBG_SAVE_PIDS(pbdp);
@@ -8895,7 +9858,8 @@ processes_bif_engine(Process *p, Eterm *res_accp, Binary *mbp)
pbdp->bif_invocation = erts_alloc(ERTS_ALC_T_PROCS_TPROC_EL,
sizeof(ErtsTermProcElement));
pbdp->bif_invocation->ix = -1;
- erts_get_emu_time(&pbdp->bif_invocation->u.bif_invocation.time);
+ pbdp->bif_invocation->u.bif_invocation.interval
+ = step_proc_interval();
ERTS_PROCS_DBG_CHK_TPLIST();
pbdp->bif_invocation->next = NULL;
@@ -8922,30 +9886,31 @@ processes_bif_engine(Process *p, Eterm *res_accp, Binary *mbp)
int indices = ERTS_PROCESSES_BIF_TAB_CHUNK_SIZE;
int cix = ix / ERTS_PROCESSES_BIF_TAB_CHUNK_SIZE;
int end_ix = ix + indices;
- SysTimeval *invocation_timep;
+ Uint64 *invocation_interval_p;
- invocation_timep = (pbdp->bif_invocation
- ? &pbdp->bif_invocation->u.bif_invocation.time
- : NULL);
+ invocation_interval_p
+ = (pbdp->bif_invocation
+ ? &pbdp->bif_invocation->u.bif_invocation.interval
+ : NULL);
ERTS_PROCS_ASSERT(is_nil(*res_accp));
if (!locked) {
- erts_smp_mtx_lock(&proc_tab_mtx);
+ erts_smp_rwmtx_rwlock(&erts_proc_tab_rwmtx);
locked = 1;
}
- ERTS_SMP_LC_ASSERT(erts_lc_mtx_is_locked(&proc_tab_mtx));
+ ERTS_SMP_LC_ASSERT(erts_lc_rwmtx_is_rwlocked(&erts_proc_tab_rwmtx));
ERTS_PROCS_DBG_TRACE(p->id, processes_bif_engine, insp_table);
if (cix != 0)
- erts_get_emu_time(&pbdp->chunk[cix].time);
+ pbdp->chunk[cix].interval = step_proc_interval();
else if (pbdp->bif_invocation)
- pbdp->chunk[0].time = *invocation_timep;
- /* else: Time is irrelevant */
+ pbdp->chunk[0].interval = *invocation_interval_p;
+ /* else: interval is irrelevant */
- if (end_ix >= erts_max_processes) {
+ if (end_ix >= erts_proc.max) {
ERTS_PROCS_ASSERT(cix+1 == processes_bif_tab_chunks);
- end_ix = erts_max_processes;
+ end_ix = erts_proc.max;
indices = end_ix - ix;
/* What to do when done with this chunk */
pbdp->state = (processes_bif_tab_chunks == 1
@@ -8954,16 +9919,15 @@ processes_bif_engine(Process *p, Eterm *res_accp, Binary *mbp)
}
for (; ix < end_ix; ix++) {
- Process *rp = process_tab[ix];
+ Process *rp = erts_pix2proc(ix);
if (rp
- && (!invocation_timep
- || erts_cmp_timeval(&rp->started,
- invocation_timep) < 0)) {
+ && (!invocation_interval_p
+ || rp->started_interval < *invocation_interval_p)) {
ERTS_PROCS_ASSERT(is_internal_pid(rp->id));
pbdp->pid[pbdp->pid_ix] = rp->id;
#if ERTS_PROCESSES_BIF_DEBUGLEVEL >= ERTS_PROCS_DBGLVL_CHK_FOUND_PIDS
- pbdp->debug.pid_started[pbdp->pid_ix] = rp->started;
+ pbdp->debug.pid_started[pbdp->pid_ix] = rp->started_interval;
#endif
pbdp->pid_ix++;
@@ -8973,7 +9937,7 @@ processes_bif_engine(Process *p, Eterm *res_accp, Binary *mbp)
pbdp->tix = end_ix;
- erts_smp_mtx_unlock(&proc_tab_mtx);
+ erts_smp_rwmtx_rwunlock(&erts_proc_tab_rwmtx);
locked = 0;
reds = indices/ERTS_PROCESSES_BIF_TAB_INSPECT_INDICES_PER_RED;
@@ -8985,8 +9949,8 @@ processes_bif_engine(Process *p, Eterm *res_accp, Binary *mbp)
ix = pbdp->tix;
indices = ERTS_PROCESSES_BIF_TAB_CHUNK_SIZE;
end_ix = ix + indices;
- if (end_ix > erts_max_processes) {
- end_ix = erts_max_processes;
+ if (end_ix > erts_proc.max) {
+ end_ix = erts_proc.max;
indices = end_ix - ix;
}
@@ -9005,20 +9969,20 @@ processes_bif_engine(Process *p, Eterm *res_accp, Binary *mbp)
int i;
int max_reds;
int free_term_procs = 0;
- SysTimeval *invocation_timep;
+ Uint64 invocation_interval;
ErtsTermProcElement *tpep;
ErtsTermProcElement *free_list = NULL;
tpep = pbdp->bif_invocation;
ERTS_PROCS_ASSERT(tpep);
- invocation_timep = &tpep->u.bif_invocation.time;
+ invocation_interval = tpep->u.bif_invocation.interval;
max_reds = have_reds = ERTS_BIF_REDS_LEFT(p);
if (max_reds > ERTS_PROCESSES_INSPECT_TERM_PROC_MAX_REDS)
max_reds = ERTS_PROCESSES_INSPECT_TERM_PROC_MAX_REDS;
reds = 0;
- erts_smp_mtx_lock(&proc_tab_mtx);
+ erts_smp_rwmtx_rwlock(&erts_proc_tab_rwmtx);
ERTS_PROCS_DBG_TRACE(p->id, processes_bif_engine, insp_term_procs);
ERTS_PROCS_DBG_CHK_TPLIST();
@@ -9057,20 +10021,19 @@ processes_bif_engine(Process *p, Eterm *res_accp, Binary *mbp)
}
else {
int cix = tpep->ix/ERTS_PROCESSES_BIF_TAB_CHUNK_SIZE;
- SysTimeval *chunk_timep = &pbdp->chunk[cix].time;
+ Uint64 chunk_interval = pbdp->chunk[cix].interval;
Eterm pid = tpep->u.process.pid;
ERTS_PROCS_ASSERT(is_internal_pid(pid));
- if (erts_cmp_timeval(&tpep->u.process.spawned,
- invocation_timep) < 0) {
- if (erts_cmp_timeval(&tpep->u.process.exited,
- chunk_timep) < 0) {
+ if (tpep->u.process.spawned < invocation_interval) {
+ if (tpep->u.process.exited < chunk_interval) {
ERTS_PROCS_DBG_CHK_PID_NOT_FOUND(pbdp,
pid,
- &tpep->u.process.spawned);
+ tpep->u.process.spawned);
pbdp->pid[pbdp->pid_ix] = pid;
#if ERTS_PROCESSES_BIF_DEBUGLEVEL >= ERTS_PROCS_DBGLVL_CHK_FOUND_PIDS
- pbdp->debug.pid_started[pbdp->pid_ix] = tpep->u.process.spawned;
+ pbdp->debug.pid_started[pbdp->pid_ix]
+ = tpep->u.process.spawned;
#endif
pbdp->pid_ix++;
ERTS_PROCS_ASSERT(pbdp->pid_ix <= pbdp->pid_sz);
@@ -9078,13 +10041,13 @@ processes_bif_engine(Process *p, Eterm *res_accp, Binary *mbp)
else {
ERTS_PROCS_DBG_CHK_PID_FOUND(pbdp,
pid,
- &tpep->u.process.spawned);
+ tpep->u.process.spawned);
}
}
else {
ERTS_PROCS_DBG_CHK_PID_NOT_FOUND(pbdp,
pid,
- &tpep->u.process.spawned);
+ tpep->u.process.spawned);
}
i++;
@@ -9133,7 +10096,7 @@ processes_bif_engine(Process *p, Eterm *res_accp, Binary *mbp)
ERTS_PROCS_DBG_CHK_TPLIST();
ERTS_PROCS_DBG_CHK_FREELIST(free_list);
- erts_smp_mtx_unlock(&proc_tab_mtx);
+ erts_smp_rwmtx_rwunlock(&erts_proc_tab_rwmtx);
/*
* We do the actual free of term proc structures now when we
@@ -9193,8 +10156,9 @@ processes_bif_engine(Process *p, Eterm *res_accp, Binary *mbp)
sizeof(Eterm)*pbdp->pid_sz);
#if ERTS_PROCESSES_BIF_DEBUGLEVEL >= ERTS_PROCS_DBGLVL_CHK_FOUND_PIDS
pbdp->debug.pid_started = erts_realloc(ERTS_ALC_T_PROCS_PIDS,
- pbdp->debug.pid_started,
- sizeof(SysTimeval)*pbdp->pid_sz);
+ pbdp->debug.pid_started,
+ (sizeof(Uint64)
+ * pbdp->pid_sz));
#endif
}
reds = conses/ERTS_PROCESSES_BIF_BUILD_RESULT_CONSES_PER_RED;
@@ -9314,22 +10278,13 @@ init_processes_bif(void)
{
saved_term_procs.start = NULL;
saved_term_procs.end = NULL;
- processes_bif_tab_chunks = (((erts_max_processes - 1)
+ processes_bif_tab_chunks = (((erts_proc.max - 1)
/ ERTS_PROCESSES_BIF_TAB_CHUNK_SIZE)
+ 1);
/* processes_trap/2 is a hidden BIF that the processes/0 BIF traps to. */
- sys_memset((void *) &processes_trap_export, 0, sizeof(Export));
- processes_trap_export.address = &processes_trap_export.code[3];
- processes_trap_export.code[0] = am_erlang;
- processes_trap_export.code[1] = am_processes_trap;
- processes_trap_export.code[2] = 2;
- processes_trap_export.code[3] = (BeamInstr) em_apply_bif;
- processes_trap_export.code[4] = (BeamInstr) &processes_trap;
-
-#if ERTS_PROCESSES_BIF_DEBUGLEVEL >= ERTS_PROCS_DBGLVL_CHK_TERM_PROC_LIST
- erts_get_emu_time(&debug_tv_start);
-#endif
+ erts_init_trap_export(&processes_trap_export, am_erlang, am_processes_trap, 2,
+ &processes_trap);
}
@@ -9362,31 +10317,29 @@ erts_debug_processes(Process *c_p)
Eterm res;
Eterm* hp;
Process *p;
-#ifdef DEBUG
Eterm *hp_end;
-#endif
- erts_smp_mtx_lock(&proc_tab_mtx);
+ erts_smp_rwmtx_rwlock(&erts_proc_tab_rwmtx);
res = NIL;
need = erts_process_count() * 2;
hp = HAlloc(c_p, need); /* we need two heap words for each pid */
-#ifdef DEBUG
hp_end = hp + need;
-#endif
/* make the list by scanning bakward */
- for (i = erts_max_processes-1; i >= 0; i--) {
- if ((p = process_tab[i]) != NULL) {
- res = CONS(hp, process_tab[i]->id, res);
+ for (i = erts_proc.max-1; i >= 0; i--) {
+ p = erts_pix2proc(i);
+ if (p) {
+ res = CONS(hp, p->id, res);
hp += 2;
}
}
- ASSERT(hp == hp_end);
- erts_smp_mtx_unlock(&proc_tab_mtx);
+ erts_smp_rwmtx_rwunlock(&erts_proc_tab_rwmtx);
+
+ HRelease(c_p, hp_end, hp);
return res;
}
@@ -9418,14 +10371,12 @@ erts_debug_processes_bif_info(Process *c_p)
static void
debug_processes_check_found_pid(ErtsProcessesBifData *pbdp,
Eterm pid,
- SysTimeval *tvp,
+ Uint64 ic,
int pid_should_be_found)
{
int i;
for (i = 0; i < pbdp->pid_ix; i++) {
- if (pbdp->pid[i] == pid
- && pbdp->debug.pid_started[i].tv_sec == tvp->tv_sec
- && pbdp->debug.pid_started[i].tv_usec == tvp->tv_usec) {
+ if (pbdp->pid[i] == pid && pbdp->debug.pid_started[i] == ic) {
ERTS_PROCS_ASSERT(pid_should_be_found);
return;
}
@@ -9459,8 +10410,8 @@ debug_processes_save_all_pids(ErtsProcessesBifData *pbdp)
pbdp->debug.correct_pids = erts_alloc(ERTS_ALC_T_PROCS_PIDS,
sizeof(Eterm)*pbdp->pid_sz);
- for (tix = 0, cpix = 0; tix < erts_max_processes; tix++) {
- Process *rp = process_tab[tix];
+ for (tix = 0, cpix = 0; tix < erts_proc.max; tix++) {
+ Process *rp = erts_pix2proc(tix);
if (rp) {
ERTS_PROCS_ASSERT(is_internal_pid(rp->id));
pbdp->debug.correct_pids[cpix++] = rp->id;
@@ -9513,14 +10464,13 @@ debug_processes_verify_all_pids(ErtsProcessesBifData *pbdp)
static void
debug_processes_check_term_proc_list(void)
{
- ERTS_SMP_LC_ASSERT(erts_lc_mtx_is_locked(&proc_tab_mtx));
+ ERTS_SMP_LC_ASSERT(erts_lc_rwmtx_is_rwlocked(&erts_proc_tab_rwmtx));
if (!saved_term_procs.start)
ERTS_PROCS_ASSERT(!saved_term_procs.end);
else {
- SysTimeval tv_now;
- SysTimeval *prev_xtvp = NULL;
+ Uint64 curr_interval = get_proc_interval();
+ Uint64 *prev_x_interval_p = NULL;
ErtsTermProcElement *tpep;
- erts_get_emu_time(&tv_now);
for (tpep = saved_term_procs.start; tpep; tpep = tpep->next) {
if (!tpep->prev)
@@ -9532,20 +10482,17 @@ debug_processes_check_term_proc_list(void)
else
ERTS_PROCS_ASSERT(tpep->next->prev == tpep);
if (tpep->ix < 0) {
- SysTimeval *tvp = &tpep->u.bif_invocation.time;
- ERTS_PROCS_ASSERT(erts_cmp_timeval(&debug_tv_start, tvp) < 0
- && erts_cmp_timeval(tvp, &tv_now) < 0);
+ Uint64 interval = tpep->u.bif_invocation.interval;
+ ERTS_PROCS_ASSERT(interval <= curr_interval);
}
else {
- SysTimeval *stvp = &tpep->u.process.spawned;
- SysTimeval *xtvp = &tpep->u.process.exited;
+ Uint64 s_interval = tpep->u.process.spawned;
+ Uint64 x_interval = tpep->u.process.exited;
- ERTS_PROCS_ASSERT(erts_cmp_timeval(&debug_tv_start,
- stvp) < 0);
- ERTS_PROCS_ASSERT(erts_cmp_timeval(stvp, xtvp) < 0);
- if (prev_xtvp)
- ERTS_PROCS_ASSERT(erts_cmp_timeval(prev_xtvp, xtvp) < 0);
- prev_xtvp = xtvp;
+ ERTS_PROCS_ASSERT(s_interval <= x_interval);
+ if (prev_x_interval_p)
+ ERTS_PROCS_ASSERT(*prev_x_interval_p <= x_interval);
+ prev_x_interval_p = &tpep->u.process.exited;
ERTS_PROCS_ASSERT(is_internal_pid(tpep->u.process.pid));
ERTS_PROCS_ASSERT(tpep->ix
== internal_pid_index(tpep->u.process.pid));
@@ -9587,3 +10534,30 @@ debug_processes_assert_error(char* expr, char* file, int line)
/* *\
* End of the processes/0 BIF implementation. *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * A nice system halt closing all open port goes as follows:
+ * 1) This function schedules the aux work ERTS_SSI_AUX_WORK_REAP_PORTS
+ * on all schedulers, then schedules itself out.
+ * 2) All shedulers detect this and set the flag halt_in_progress
+ * on their run queue. The last scheduler sets all non-closed ports
+ * ERTS_PORT_SFLG_HALT. Global atomic erts_halt_progress is used
+ * as refcount to determine which is last.
+ * 3) While the run ques has flag halt_in_progress no processes
+ * will be scheduled, only ports.
+ * 4) When the last port closes that scheduler calls erlang:halt/1.
+ * The same global atomic is used as refcount.
+ *
+ * A BIF that calls this should make sure to schedule out to never come back:
+ * erl_halt((int)(- code));
+ * ERTS_BIF_YIELD1(bif_export[BIF_erlang_halt_1], BIF_P, NIL);
+ */
+void erl_halt(int code)
+{
+ if (-1 == erts_smp_atomic32_cmpxchg_acqb(&erts_halt_progress,
+ erts_no_schedulers,
+ -1)) {
+ erts_halt_code = code;
+ notify_reap_ports_relb();
+ }
+}
diff --git a/erts/emulator/beam/erl_process.h b/erts/emulator/beam/erl_process.h
index a51b380bb0..1436e246d6 100644
--- a/erts/emulator/beam/erl_process.h
+++ b/erts/emulator/beam/erl_process.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -112,28 +112,29 @@ extern int erts_sched_thread_suggested_stack_size;
#define PRIORITY_NORMAL 2
#define PRIORITY_LOW 3
#define ERTS_NO_PROC_PRIO_LEVELS 4
+#define ERTS_NO_PROC_PRIO_QUEUES 3
#define ERTS_PORT_PRIO_LEVEL ERTS_NO_PROC_PRIO_LEVELS
+#define ERTS_NO_PRIO_LEVELS (ERTS_NO_PROC_PRIO_LEVELS + 1)
#define ERTS_RUNQ_FLGS_PROCS_QMASK \
((((Uint32) 1) << ERTS_NO_PROC_PRIO_LEVELS) - 1)
-#define ERTS_NO_PRIO_LEVELS (ERTS_NO_PROC_PRIO_LEVELS + 1)
-#define ERTS_RUNQ_FLGS_MIGRATE_QMASK \
+#define ERTS_RUNQ_FLGS_QMASK \
((((Uint32) 1) << ERTS_NO_PRIO_LEVELS) - 1)
#define ERTS_RUNQ_FLGS_EMIGRATE_SHFT \
- ERTS_NO_PROC_PRIO_LEVELS
+ ERTS_NO_PRIO_LEVELS
#define ERTS_RUNQ_FLGS_IMMIGRATE_SHFT \
(ERTS_RUNQ_FLGS_EMIGRATE_SHFT + ERTS_NO_PRIO_LEVELS)
#define ERTS_RUNQ_FLGS_EVACUATE_SHFT \
(ERTS_RUNQ_FLGS_IMMIGRATE_SHFT + ERTS_NO_PRIO_LEVELS)
#define ERTS_RUNQ_FLGS_EMIGRATE_QMASK \
- (ERTS_RUNQ_FLGS_MIGRATE_QMASK << ERTS_RUNQ_FLGS_EMIGRATE_SHFT)
+ (ERTS_RUNQ_FLGS_QMASK << ERTS_RUNQ_FLGS_EMIGRATE_SHFT)
#define ERTS_RUNQ_FLGS_IMMIGRATE_QMASK \
- (ERTS_RUNQ_FLGS_MIGRATE_QMASK << ERTS_RUNQ_FLGS_IMMIGRATE_SHFT)
+ (ERTS_RUNQ_FLGS_QMASK << ERTS_RUNQ_FLGS_IMMIGRATE_SHFT)
#define ERTS_RUNQ_FLGS_EVACUATE_QMASK \
- (ERTS_RUNQ_FLGS_MIGRATE_QMASK << ERTS_RUNQ_FLGS_EVACUATE_SHFT)
+ (ERTS_RUNQ_FLGS_QMASK << ERTS_RUNQ_FLGS_EVACUATE_SHFT)
#define ERTS_RUNQ_FLG_BASE2 \
(ERTS_RUNQ_FLGS_EVACUATE_SHFT + ERTS_NO_PRIO_LEVELS)
@@ -148,14 +149,18 @@ extern int erts_sched_thread_suggested_stack_size;
(((Uint32) 1) << (ERTS_RUNQ_FLG_BASE2 + 3))
#define ERTS_RUNQ_FLG_INACTIVE \
(((Uint32) 1) << (ERTS_RUNQ_FLG_BASE2 + 4))
+#define ERTS_RUNQ_FLG_NONEMPTY \
+ (((Uint32) 1) << (ERTS_RUNQ_FLG_BASE2 + 5))
+#define ERTS_RUNQ_FLG_PROTECTED \
+ (((Uint32) 1) << (ERTS_RUNQ_FLG_BASE2 + 6))
#define ERTS_RUNQ_FLGS_MIGRATION_QMASKS \
(ERTS_RUNQ_FLGS_EMIGRATE_QMASK \
| ERTS_RUNQ_FLGS_IMMIGRATE_QMASK \
| ERTS_RUNQ_FLGS_EVACUATE_QMASK)
+
#define ERTS_RUNQ_FLGS_MIGRATION_INFO \
- (ERTS_RUNQ_FLGS_MIGRATION_QMASKS \
- | ERTS_RUNQ_FLG_INACTIVE \
+ (ERTS_RUNQ_FLG_INACTIVE \
| ERTS_RUNQ_FLG_OUT_OF_WORK \
| ERTS_RUNQ_FLG_HALFTIME_OUT_OF_WORK)
@@ -186,33 +191,45 @@ extern int erts_sched_thread_suggested_stack_size;
#define ERTS_UNSET_RUNQ_FLG_EVACUATE(FLGS, PRIO) \
((FLGS) &= ~ERTS_RUNQ_FLG_EVACUATE((PRIO)))
-#define ERTS_RUNQ_IFLG_SUSPENDED (((erts_aint32_t) 1) << 0)
-#define ERTS_RUNQ_IFLG_NONEMPTY (((erts_aint32_t) 1) << 1)
-
-
-#ifdef DEBUG
-# if defined(ARCH_64) && !HALFWORD_HEAP
-# define ERTS_DBG_SET_INVALID_RUNQP(RQP, N) \
- (*((char **) &(RQP)) = (char *) (0xdeadbeefdead0003 | ((N) << 4)))
-# define ERTS_DBG_VERIFY_VALID_RUNQP(RQP) \
-do { \
- ASSERT((RQP) != NULL); \
- ASSERT(((((Uint) (RQP)) & ((Uint) 0x3))) == ((Uint) 0)); \
- ASSERT((((Uint) (RQP)) & ~((Uint) 0xffff)) != ((Uint) 0xdeadbeefdead0000));\
-} while (0)
-# else
-# define ERTS_DBG_SET_INVALID_RUNQP(RQP, N) \
- (*((char **) &(RQP)) = (char *) (0xdead0003 | ((N) << 4)))
-# define ERTS_DBG_VERIFY_VALID_RUNQP(RQP) \
-do { \
- ASSERT((RQP) != NULL); \
- ASSERT(((((UWord) (RQP)) & ((UWord) 1))) == ((UWord) 0)); \
- ASSERT((((UWord) (RQP)) & ~((UWord) 0xffff)) != ((UWord) 0xdead0000)); \
-} while (0)
-# endif
-#else
-# define ERTS_DBG_SET_INVALID_RUNQP(RQP, N)
-# define ERTS_DBG_VERIFY_VALID_RUNQP(RQP)
+#define ERTS_RUNQ_FLGS_INIT(RQ, INIT) \
+ erts_smp_atomic32_init_nob(&(RQ)->flags, (erts_aint32_t) (INIT))
+#define ERTS_RUNQ_FLGS_SET(RQ, FLGS) \
+ ((Uint32) erts_smp_atomic32_read_bor_relb(&(RQ)->flags, \
+ (erts_aint32_t) (FLGS)))
+#define ERTS_RUNQ_FLGS_UNSET(RQ, FLGS) \
+ ((Uint32) erts_smp_atomic32_read_band_relb(&(RQ)->flags, \
+ (erts_aint32_t) ~(FLGS)))
+#define ERTS_RUNQ_FLGS_GET(RQ) \
+ ((Uint32) erts_smp_atomic32_read_acqb(&(RQ)->flags))
+#define ERTS_RUNQ_FLGS_GET_NOB(RQ) \
+ ((Uint32) erts_smp_atomic32_read_nob(&(RQ)->flags))
+#define ERTS_RUNQ_FLGS_GET_MB(RQ) \
+ ((Uint32) erts_smp_atomic32_read_mb(&(RQ)->flags))
+#define ERTS_RUNQ_FLGS_MASK_SET(RQ, MSK, FLGS) \
+ ((Uint32) erts_smp_atomic32_mask_set_relb(&(RQ)->flags, \
+ (erts_aint32_t) (MSK), \
+ (erts_aint32_t) (FLGS)))
+
+ERTS_GLB_INLINE erts_aint32_t
+erts_smp_atomic32_mask_set_relb(erts_smp_atomic32_t *a32p,
+ erts_aint32_t mask,
+ erts_aint32_t set);
+#if ERTS_GLB_INLINE_INCL_FUNC_DEF
+ERTS_GLB_INLINE erts_aint32_t
+erts_smp_atomic32_mask_set_relb(erts_smp_atomic32_t *a32p,
+ erts_aint32_t mask,
+ erts_aint32_t set)
+{
+ erts_aint32_t act = erts_smp_atomic32_read_nob(a32p);
+ while (1) {
+ erts_aint32_t exp = act;
+ erts_aint32_t new = exp & ~mask;
+ new |= (mask & set);
+ act = erts_smp_atomic32_cmpxchg_relb(a32p, new, exp);
+ if (act == exp)
+ return act;
+ }
+}
#endif
typedef enum {
@@ -248,25 +265,27 @@ typedef enum {
| ERTS_SSI_FLG_WAITING \
| ERTS_SSI_FLG_SUSPENDED)
-#define ERTS_SSI_AUX_WORK_SET_TMO (((erts_aint32_t) 1) << 0)
-#define ERTS_SSI_AUX_WORK_CHECK_CHILDREN (((erts_aint32_t) 1) << 1)
-#define ERTS_SSI_AUX_WORK_MISC (((erts_aint32_t) 1) << 2)
-#ifdef ERTS_SMP
-#define ERTS_SSI_AUX_WORK_MISC_THR_PRGR (((erts_aint32_t) 1) << 3)
-#endif
+/*
+ * Keep ERTS_SSI_AUX_WORK flags in expected frequency order relative
+ * eachother. Most frequent - lowest bit number.
+ */
+
+#define ERTS_SSI_AUX_WORK_DELAYED_AW_WAKEUP (((erts_aint32_t) 1) << 0)
+#define ERTS_SSI_AUX_WORK_DD (((erts_aint32_t) 1) << 1)
+#define ERTS_SSI_AUX_WORK_DD_THR_PRGR (((erts_aint32_t) 1) << 2)
+#define ERTS_SSI_AUX_WORK_FIX_ALLOC_DEALLOC (((erts_aint32_t) 1) << 3)
#define ERTS_SSI_AUX_WORK_FIX_ALLOC_LOWER_LIM (((erts_aint32_t) 1) << 4)
-#define ERTS_SSI_AUX_WORK_FIX_ALLOC_DEALLOC (((erts_aint32_t) 1) << 5)
+#define ERTS_SSI_AUX_WORK_THR_PRGR_LATER_OP (((erts_aint32_t) 1) << 5)
#define ERTS_SSI_AUX_WORK_ASYNC_READY (((erts_aint32_t) 1) << 6)
#define ERTS_SSI_AUX_WORK_ASYNC_READY_CLEAN (((erts_aint32_t) 1) << 7)
-#ifdef ERTS_SMP
-#define ERTS_SSI_AUX_WORK_DD (((erts_aint32_t) 1) << 8)
-#define ERTS_SSI_AUX_WORK_DD_THR_PRGR (((erts_aint32_t) 1) << 9)
-#endif
-#define ERTS_SSI_AUX_WORK_MSEG_CACHE_CHECK (((erts_aint32_t) 1) << 10)
-
-#if !HAVE_ERTS_MSEG
-# undef ERTS_SSI_AUX_WORK_MSEG_CACHE_CHECK
-#endif
+#define ERTS_SSI_AUX_WORK_MISC_THR_PRGR (((erts_aint32_t) 1) << 8)
+#define ERTS_SSI_AUX_WORK_MISC (((erts_aint32_t) 1) << 9)
+#define ERTS_SSI_AUX_WORK_CHECK_CHILDREN (((erts_aint32_t) 1) << 10)
+#define ERTS_SSI_AUX_WORK_SET_TMO (((erts_aint32_t) 1) << 11)
+#define ERTS_SSI_AUX_WORK_MSEG_CACHE_CHECK (((erts_aint32_t) 1) << 12)
+#define ERTS_SSI_AUX_WORK_CODE_IX_ACTIVATION (((erts_aint32_t) 1) << 13)
+#define ERTS_SSI_AUX_WORK_REAP_PORTS (((erts_aint32_t) 1) << 14)
+#define ERTS_SSI_AUX_WORK_FINISH_BP (((erts_aint32_t) 1) << 15)
typedef struct ErtsSchedulerSleepInfo_ ErtsSchedulerSleepInfo;
@@ -292,7 +311,7 @@ struct ErtsSchedulerSleepInfo_ {
typedef struct ErtsProcList_ ErtsProcList;
struct ErtsProcList_ {
Eterm pid;
- SysTimeval started;
+ Uint64 started_interval;
ErtsProcList* next;
};
@@ -313,21 +332,39 @@ typedef struct ErtsSchedulerData_ ErtsSchedulerData;
typedef struct ErtsRunQueue_ ErtsRunQueue;
typedef struct {
- int len;
- int max_len;
+ erts_smp_atomic32_t len;
+ erts_aint32_t max_len;
int reds;
+} ErtsRunQueueInfo;
+
+#ifdef ERTS_SMP
+
+typedef struct {
+ Uint32 flags;
+ ErtsRunQueue *misc_evac_runq;
struct {
struct {
int this;
int other;
} limit;
ErtsRunQueue *runq;
- } migrate;
-} ErtsRunQueueInfo;
+ Uint32 flags;
+ } prio[ERTS_NO_PRIO_LEVELS];
+} ErtsMigrationPath;
+
+typedef struct ErtsMigrationPaths_ ErtsMigrationPaths;
+
+struct ErtsMigrationPaths_ {
+ void *block;
+ ErtsMigrationPaths *next;
+ ErtsThrPrgrVal thr_prgr;
+ ErtsMigrationPath mpath[1];
+};
+
+#endif /* ERTS_SMP */
struct ErtsRunQueue_ {
int ix;
- erts_smp_atomic32_t info_flags;
erts_smp_mtx_t mtx;
erts_smp_cnd_t cnd;
@@ -335,18 +372,18 @@ struct ErtsRunQueue_ {
ErtsSchedulerData *scheduler;
int waiting; /* < 0 in sys schedule; > 0 on cnd variable */
int woken;
- Uint32 flags;
+ erts_smp_atomic32_t flags;
int check_balance_reds;
int full_reds_history_sum;
int full_reds_history[ERTS_FULL_REDS_HISTORY_SIZE];
int out_of_work_count;
- int max_len;
- int len;
+ erts_aint32_t max_len;
+ erts_aint32_t len;
int wakeup_other;
int wakeup_other_reds;
+ int halt_in_progress;
struct {
- int len;
ErtsProcList *pending_exiters;
Uint context_switches;
Uint reductions;
@@ -361,7 +398,7 @@ struct ErtsRunQueue_ {
struct {
ErtsMiscOpList *start;
ErtsMiscOpList *end;
- ErtsRunQueue *evac_runq;
+ erts_smp_atomic_t evac_runq;
} misc;
struct {
@@ -381,7 +418,7 @@ extern ErtsAlignedRunQueue *erts_aligned_run_queues;
#define ERTS_PROC_REDUCTIONS_EXECUTED(RQ, PRIO, REDS, AREDS) \
do { \
(RQ)->procs.reductions += (AREDS); \
- (RQ)->procs.prio_info[p->prio].reds += (REDS); \
+ (RQ)->procs.prio_info[(PRIO)].reds += (REDS); \
(RQ)->check_balance_reds -= (REDS); \
(RQ)->wakeup_other_reds += (AREDS); \
} while (0)
@@ -394,9 +431,27 @@ do { \
} while (0)
typedef struct {
+ int enabled;
+ Uint64 start;
+ struct {
+ Uint64 total;
+ Uint64 start;
+ int currently;
+ } working;
+} ErtsSchedWallTime;
+
+typedef struct {
+ int sched;
+ erts_aint32_t aux_work;
+} ErtsDelayedAuxWorkWakeupJob;
+
+typedef struct {
int sched_id;
ErtsSchedulerData *esdp;
ErtsSchedulerSleepInfo *ssi;
+#ifdef ERTS_SMP
+ ErtsThrPrgrVal current_thr_prgr;
+#endif
struct {
int ix;
#ifdef ERTS_SMP
@@ -409,6 +464,10 @@ typedef struct {
void (*completed_callback)(void *);
void (*completed_arg)(void *);
} dd;
+ struct {
+ ErtsThrPrgrLaterOp *first;
+ ErtsThrPrgrLaterOp *last;
+ } later_op;
#endif
#ifdef ERTS_USE_ASYNC_READY_Q
struct {
@@ -419,6 +478,21 @@ typedef struct {
void *queue;
} async_ready;
#endif
+#ifdef ERTS_SMP
+ struct {
+ Process* code_stager;
+ ErtsThrPrgrVal thr_prgr;
+ } code_ix_activation;
+ struct {
+ Process* stager;
+ ErtsThrPrgrVal thr_prgr;
+ } bp_ix_activation;
+ struct {
+ int *sched2jix;
+ int jix;
+ ErtsDelayedAuxWorkWakeupJob *job;
+ } delayed_wakeup;
+#endif
} ErtsAuxWorkData;
struct ErtsSchedulerData_ {
@@ -452,11 +526,12 @@ struct ErtsSchedulerData_ {
int virtual_reds;
int cpu_id; /* >= 0 when bound */
ErtsAuxWorkData aux_work_data;
-
ErtsAtomCacheMap atom_cache_map;
ErtsSchedAllocData alloc_data;
+ ErtsSchedWallTime sched_wall_time;
+
#ifdef ERTS_DO_VERIFY_UNUSED_TEMP_ALLOC
erts_alloc_verify_func_t verify_unused_temp_alloc;
Allctr_t *verify_unused_temp_alloc_data;
@@ -474,6 +549,90 @@ extern ErtsAlignedSchedulerData *erts_aligned_scheduler_data;
extern ErtsSchedulerData *erts_scheduler_data;
#endif
+#if defined(ERTS_SMP) && defined(ERTS_ENABLE_LOCK_CHECK)
+int erts_smp_lc_runq_is_locked(ErtsRunQueue *);
+#endif
+
+#ifdef ERTS_INCLUDE_SCHEDULER_INTERNALS
+
+/*
+ * Run queue locked during modifications. We use atomic ops since
+ * other threads peek at values without run queue lock.
+ */
+
+ERTS_GLB_INLINE void erts_smp_inc_runq_len(ErtsRunQueue *rq, ErtsRunQueueInfo *rqi, int prio);
+ERTS_GLB_INLINE void erts_smp_dec_runq_len(ErtsRunQueue *rq, ErtsRunQueueInfo *rqi, int prio);
+ERTS_GLB_INLINE void erts_smp_reset_max_len(ErtsRunQueue *rq, ErtsRunQueueInfo *rqi);
+
+#if ERTS_GLB_INLINE_INCL_FUNC_DEF
+
+ERTS_GLB_INLINE void
+erts_smp_inc_runq_len(ErtsRunQueue *rq, ErtsRunQueueInfo *rqi, int prio)
+{
+ erts_aint32_t len;
+
+ ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(rq));
+
+ len = erts_smp_atomic32_read_nob(&rqi->len);
+ ASSERT(len >= 0);
+ if (len == 0) {
+ ASSERT((erts_smp_atomic32_read_nob(&rq->flags)
+ & ((erts_aint32_t) (1 << prio))) == 0);
+ erts_smp_atomic32_read_bor_nob(&rq->flags,
+ (erts_aint32_t) (1 << prio));
+ }
+ len++;
+ if (rqi->max_len < len)
+ rqi->max_len = len;
+
+ erts_smp_atomic32_set_relb(&rqi->len, len);
+
+ rq->len++;
+ if (rq->max_len < rq->len)
+ rq->max_len = len;
+ ASSERT(rq->len > 0);
+}
+
+ERTS_GLB_INLINE void
+erts_smp_dec_runq_len(ErtsRunQueue *rq, ErtsRunQueueInfo *rqi, int prio)
+{
+ erts_aint32_t len;
+
+ ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(rq));
+
+ len = erts_smp_atomic32_read_nob(&rqi->len);
+ len--;
+ ASSERT(len >= 0);
+ if (len == 0) {
+ ASSERT((erts_smp_atomic32_read_nob(&rq->flags)
+ & ((erts_aint32_t) (1 << prio))));
+ erts_smp_atomic32_read_band_nob(&rq->flags,
+ ~((erts_aint32_t) (1 << prio)));
+ }
+ erts_smp_atomic32_set_relb(&rqi->len, len);
+
+ rq->len--;
+ ASSERT(rq->len >= 0);
+}
+
+ERTS_GLB_INLINE void
+erts_smp_reset_max_len(ErtsRunQueue *rq, ErtsRunQueueInfo *rqi)
+{
+ erts_aint32_t len;
+
+ ERTS_SMP_LC_ASSERT(erts_smp_lc_runq_is_locked(rq));
+
+ len = erts_smp_atomic32_read_nob(&rqi->len);
+ ASSERT(rqi->max_len >= len);
+ rqi->max_len = len;
+}
+
+#endif /* ERTS_GLB_INLINE_INCL_FUNC_DEF */
+
+#define RUNQ_READ_LEN(X) erts_smp_atomic32_read_nob((X))
+
+#endif /* ERTS_INCLUDE_SCHEDULER_INTERNALS */
+
/*
* Process Specific Data.
*
@@ -586,6 +745,8 @@ struct ErtsPendingSuspend_ {
# define BIN_OLD_VHEAP(p) (p)->bin_old_vheap
struct process {
+ Eterm id; /* The pid of this process
+ (need to be first in struct) */
/* All fields in the PCB that differs between different heap
* architectures, have been moved to the end of this struct to
* make sure that as few offsets as possible differ. Different
@@ -628,13 +789,9 @@ struct process {
* Number of reductions left to execute.
* Only valid for the current process.
*/
- Uint32 status; /* process STATE */
- Uint32 gcstatus; /* process gc STATE */
- Uint32 rstatus; /* process resume STATE */
Uint32 rcount; /* suspend count */
- Eterm id; /* The pid of this process */
int prio; /* Priority of process */
- int skipped; /* Times a low prio process has been rescheduled */
+ int schedule_count; /* Times left to reschedule a low prio process */
Uint reds; /* No of reductions for this process */
Eterm tracer_proc; /* If proc is traced, this is the tracer
(can NOT be boxed) */
@@ -647,7 +804,6 @@ struct process {
Eterm ftrace; /* Latest exception stack trace dump */
Process *next; /* Pointer to next process in run queue */
- Process *prev; /* Pointer to prev process in run queue */
struct reg_proc *reg; /* NULL iff not registered */
ErtsLink *nlinks;
@@ -669,6 +825,10 @@ struct process {
Uint seq_trace_lastcnt;
Eterm seq_trace_token; /* Sequential trace token (tuple size 5 see below) */
+#ifdef USE_VM_PROBES
+ Eterm dt_utag; /* Place to store the dynamc trace user tag */
+ Uint dt_utag_flags; /* flag field for the dt_utag */
+#endif
BeamInstr initial[3]; /* Initial module(0), function(1), arity(2), often used instead
of pointer to funcinfo instruction, hence the BeamInstr datatype */
BeamInstr* current; /* Current Erlang function, part of the funcinfo:
@@ -681,8 +841,8 @@ struct process {
* Information mainly for post-mortem use (erl crash dump).
*/
Eterm parent; /* Pid of process that created this process. */
- SysTimeval started; /* Time when started. */
-
+ erts_approx_time_t approx_started; /* Time when started. */
+ Uint64 started_interval;
/* This is the place, where all fields that differs between memory
* architectures, have gone to.
@@ -705,50 +865,34 @@ struct process {
Uint64 bin_old_vheap; /* Virtual old heap size for binaries */
union {
+ struct {
#ifdef ERTS_SMP
- ErtsSmpPTimer *ptimer;
+ ErtsSmpPTimer *ptimer;
+ ErlMessageInQueue msg_inq;
+ ErtsPendExit pending_exit;
#else
- ErlTimer tm; /* Timer entry */
+ ErlTimer tm; /* Timer entry */
+#endif
+ } alive; /* when process is alive */
+#ifdef ERTS_SMP
+ ErtsThrPrgrLaterOp release_data; /* when releasing process struct */
#endif
void *exit_data; /* Misc data referred during termination */
} u;
- ErtsRunQueue *bound_runq;
+ erts_smp_atomic32_t state; /* Process state flags (see ERTS_PSFLG_*) */
#ifdef ERTS_SMP
erts_proc_lock_t lock;
ErtsSchedulerData *scheduler_data;
- int is_exiting;
- Uint32 runq_flags;
- Uint32 status_flags;
- ErlMessageInQueue msg_inq;
Eterm suspendee;
ErtsPendingSuspend *pending_suspenders;
- ErtsPendExit pending_exit;
- ErtsRunQueue *run_queue;
+ erts_smp_atomic_t run_queue;
#ifdef HIPE
struct hipe_process_state_smp hipe_smp;
#endif
#endif
-#ifdef HYBRID
- Eterm *rrma; /* Remembered roots to Message Area */
- Eterm **rrsrc; /* The source of the root */
- Uint nrr; /* Number of remembered roots */
- Uint rrsz; /* Size of root array */
-#endif
-
-#ifdef HYBRID
- Uint active; /* Active since last major collection? */
- Uint active_index; /* Index in the active process array */
-#endif
-
-#ifdef INCREMENTAL
- Process *active_next; /* Active processes to scan for roots */
- Process *active_prev; /* in collection of the message area */
- Eterm *scan_top;
-#endif
-
#ifdef CHECK_FOR_HOLES
Eterm* last_htop; /* No need to scan the heap below this point. */
ErlHeapFragment* last_mbuf; /* No need to scan beyond this mbuf. */
@@ -797,6 +941,29 @@ void erts_check_for_holes(Process* p);
#define SEQ_TRACE_TOKEN(p) ((p)->seq_trace_token)
+#if ERTS_NO_PROC_PRIO_LEVELS > 4
+# error "Need to increase ERTS_PSFLG_PRIO_SHIFT"
+#endif
+
+#define ERTS_PSFLG_PRIO_SHIFT 2
+
+#define ERTS_PSFLG_BIT(N) \
+ (((erts_aint32_t) 1) << (ERTS_PSFLG_PRIO_SHIFT + (N)))
+
+#define ERTS_PSFLG_PRIO_MASK (ERTS_PSFLG_BIT(0) - 1)
+
+#define ERTS_PSFLG_FREE ERTS_PSFLG_BIT(0)
+#define ERTS_PSFLG_EXITING ERTS_PSFLG_BIT(1)
+#define ERTS_PSFLG_PENDING_EXIT ERTS_PSFLG_BIT(2)
+#define ERTS_PSFLG_ACTIVE ERTS_PSFLG_BIT(3)
+#define ERTS_PSFLG_IN_RUNQ ERTS_PSFLG_BIT(4)
+#define ERTS_PSFLG_RUNNING ERTS_PSFLG_BIT(5)
+#define ERTS_PSFLG_SUSPENDED ERTS_PSFLG_BIT(6)
+#define ERTS_PSFLG_GC ERTS_PSFLG_BIT(7)
+#define ERTS_PSFLG_BOUND ERTS_PSFLG_BIT(8)
+#define ERTS_PSFLG_TRAP_EXIT ERTS_PSFLG_BIT(9)
+
+
/* The sequential tracing token is a tuple of size 5:
*
* {Flags, Label, Serial, Sender}
@@ -869,13 +1036,8 @@ Eterm* erts_heap_alloc(Process* p, Uint need, Uint xtra);
Eterm* erts_set_hole_marker(Eterm* ptr, Uint sz);
#endif
-extern Process** process_tab;
-#ifdef HYBRID
-extern Uint erts_num_active_procs;
-extern Process** erts_active_procs;
-#endif
-extern Uint erts_max_processes;
-extern Uint erts_process_tab_index_mask;
+extern erts_smp_rwmtx_t erts_proc_tab_rwmtx;
+extern erts_smp_atomic_t *erts_proc_tab;
extern Uint erts_default_process_flags;
extern erts_smp_rwmtx_t erts_cpu_bind_rwmtx;
/* If any of the erts_system_monitor_* variables are set (enabled),
@@ -903,17 +1065,13 @@ struct erts_system_profile_flags_t {
unsigned int exclusive : 1;
};
extern struct erts_system_profile_flags_t erts_system_profile_flags;
-
-#define INVALID_PID(p, pid) ((p) == NULL \
- || (p)->id != (pid) \
- || (p)->status == P_EXITING)
#define IS_TRACED(p) ( (p)->tracer_proc != NIL )
#define ARE_TRACE_FLAGS_ON(p,tf) ( ((p)->trace_flags & (tf|F_SENSITIVE)) == (tf) )
#define IS_TRACED_FL(p,tf) ( IS_TRACED(p) && ARE_TRACE_FLAGS_ON(p,tf) )
/* process flags */
-#define F_TRAPEXIT (1 << 0)
+#define F_HIBERNATE_SCHED (1 << 0) /* Schedule out after hibernate op */
#define F_INSLPQUEUE (1 << 1) /* Set if in timer queue */
#define F_TIMO (1 << 2) /* Set if timeout */
#define F_HEAP_GROW (1 << 3)
@@ -924,7 +1082,6 @@ extern struct erts_system_profile_flags_t erts_system_profile_flags;
#define F_HAVE_BLCKD_MSCHED (1 << 8) /* Process has blocked multi-scheduling */
#define F_P2PNR_RESCHED (1 << 9) /* Process has been rescheduled via erts_pid2proc_not_running() */
#define F_FORCE_GC (1 << 10) /* Force gc at process in-scheduling */
-#define F_HIBERNATE_SCHED (1 << 11) /* Schedule out after hibernate op */
/* process trace_flags */
#define F_SENSITIVE (1 << 0)
@@ -984,66 +1141,17 @@ extern struct erts_system_profile_flags_t erts_system_profile_flags;
#define SEQ_TRACE_PRINT (1 << 2)
#define SEQ_TRACE_TIMESTAMP (1 << 3)
-#ifdef ERTS_SMP
-/* Status flags ... */
-#define ERTS_PROC_SFLG_PENDADD2SCHEDQ (((Uint32) 1) << 0) /* Pending
- add to
- schedule q */
-#define ERTS_PROC_SFLG_INRUNQ (((Uint32) 1) << 1) /* Process is
- in run q */
-#define ERTS_PROC_SFLG_TRAPEXIT (((Uint32) 1) << 2) /* Process is
- trapping
- exit */
-#define ERTS_PROC_SFLG_RUNNING (((Uint32) 1) << 3) /* Process is
- running */
-/* Scheduler flags in process struct... */
-#define ERTS_PROC_RUNQ_FLG_RUNNING (((Uint32) 1) << 0) /* Process is
- running */
-
-#endif
-
-
-#ifdef ERTS_SMP
-#define ERTS_PROC_IS_TRAPPING_EXITS(P) \
- (ERTS_SMP_LC_ASSERT(erts_proc_lc_my_proc_locks((P)) \
- & ERTS_PROC_LOCK_STATUS), \
- (P)->status_flags & ERTS_PROC_SFLG_TRAPEXIT)
-
-#define ERTS_PROC_SET_TRAP_EXIT(P) \
- (ERTS_SMP_LC_ASSERT(((ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS) \
- & erts_proc_lc_my_proc_locks((P))) \
- == (ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS)), \
- (P)->status_flags |= ERTS_PROC_SFLG_TRAPEXIT, \
- (P)->flags |= F_TRAPEXIT, \
- 1)
-
-#define ERTS_PROC_UNSET_TRAP_EXIT(P) \
- (ERTS_SMP_LC_ASSERT(((ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS) \
- & erts_proc_lc_my_proc_locks((P))) \
- == (ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS)), \
- (P)->status_flags &= ~ERTS_PROC_SFLG_TRAPEXIT, \
- (P)->flags &= ~F_TRAPEXIT, \
- 0)
-#else
-#define ERTS_PROC_IS_TRAPPING_EXITS(P) ((P)->flags & F_TRAPEXIT)
-#define ERTS_PROC_SET_TRAP_EXIT(P) ((P)->flags |= F_TRAPEXIT, 1)
-#define ERTS_PROC_UNSET_TRAP_EXIT(P) ((P)->flags &= ~F_TRAPEXIT, 0)
+#ifdef USE_VM_PROBES
+#define DT_UTAG_PERMANENT (1 << 0)
+#define DT_UTAG_SPREADING (1 << 1)
+#define DT_UTAG(P) ((P)->dt_utag)
+#define DT_UTAG_FLAGS(P) ((P)->dt_utag_flags)
#endif
/* Option flags to erts_send_exit_signal() */
#define ERTS_XSIG_FLG_IGN_KILL (((Uint32) 1) << 0)
#define ERTS_XSIG_FLG_NO_IGN_NORMAL (((Uint32) 1) << 1)
-
-/* Process status values */
-#define P_FREE 0
-#define P_RUNABLE 1
-#define P_WAITING 2
-#define P_RUNNING 3
-#define P_EXITING 4
-#define P_GARBING 5
-#define P_SUSPENDED 6
-
#define CANCEL_TIMER(p) \
do { \
if ((p)->flags & (F_INSLPQUEUE)) \
@@ -1064,11 +1172,22 @@ void erts_late_init_process(void);
void erts_early_init_scheduling(int);
void erts_init_scheduling(int, int);
+Eterm erts_sched_wall_time_request(Process *c_p, int set, int enable);
+Uint64 erts_get_proc_interval(void);
+Uint64 erts_ensure_later_proc_interval(Uint64);
+Uint64 erts_step_proc_interval(void);
+
ErtsProcList *erts_proclist_create(Process *);
void erts_proclist_destroy(ErtsProcList *);
int erts_proclist_same(ErtsProcList *, Process *);
-int erts_sched_set_wakeup_limit(char *str);
+int erts_sched_set_wakeup_other_thresold(char *str);
+int erts_sched_set_wakeup_other_type(char *str);
+int erts_sched_set_busy_wait_threshold(char *str);
+
+void erts_schedule_thr_prgr_later_op(void (*)(void *),
+ void *,
+ ErtsThrPrgrLaterOp *);
#if defined(ERTS_SMP) && defined(ERTS_ENABLE_LOCK_CHECK)
int erts_dbg_check_halloc_lock(Process *p);
@@ -1096,6 +1215,10 @@ void erts_smp_notify_check_children_needed(void);
#if ERTS_USE_ASYNC_READY_Q
void erts_notify_check_async_ready_queue(void *);
#endif
+#ifdef ERTS_SMP
+void erts_notify_code_ix_activation(Process* p, ErtsThrPrgrVal later);
+void erts_notify_finish_breakpointing(Process* p);
+#endif
void erts_schedule_misc_aux_work(int sched_id,
void (*func)(void *),
void *arg);
@@ -1116,14 +1239,6 @@ Eterm erts_get_schedulers_binds(Process *c_p);
Eterm erts_set_cpu_topology(Process *c_p, Eterm term);
Eterm erts_bind_schedulers(Process *c_p, Eterm how);
ErtsRunQueue *erts_schedid2runq(Uint);
-#ifdef ERTS_SMP
-ErtsMigrateResult erts_proc_migrate(Process *,
- ErtsProcLocks *,
- ErtsRunQueue *,
- int *,
- ErtsRunQueue *,
- int *);
-#endif
Process *schedule(Process*, int);
void erts_schedule_misc_op(void (*)(void *), void *);
Eterm erl_create_process(Process*, Eterm, Eterm, Eterm, ErlSpawnOpts*);
@@ -1172,8 +1287,7 @@ int erts_send_exit_signal(Process *,
#ifdef ERTS_SMP
void erts_handle_pending_exit(Process *, ErtsProcLocks);
#define ERTS_PROC_PENDING_EXIT(P) \
- (ERTS_SMP_LC_ASSERT(erts_proc_lc_my_proc_locks((P)) & ERTS_PROC_LOCK_STATUS),\
- (P)->pending_exit.reason != THE_NON_VALUE)
+ (ERTS_PSFLG_PENDING_EXIT & erts_smp_atomic32_read_acqb(&(P)->state))
#else
#define ERTS_PROC_PENDING_EXIT(P) 0
#endif
@@ -1225,13 +1339,26 @@ ErtsSchedulerData *erts_get_scheduler_data(void)
#endif
#endif
+void erts_schedule_process(Process *, erts_aint32_t);
+
+ERTS_GLB_INLINE void erts_proc_notify_new_message(Process *p);
+#if ERTS_GLB_INLINE_INCL_FUNC_DEF
+ERTS_GLB_INLINE void
+erts_proc_notify_new_message(Process *p)
+{
+ /* No barrier needed, due to msg lock */
+ erts_aint32_t state = erts_smp_atomic32_read_nob(&p->state);
+ if (!(state & ERTS_PSFLG_ACTIVE))
+ erts_schedule_process(p, state);
+}
+#endif
+
#if defined(ERTS_SMP) && defined(ERTS_ENABLE_LOCK_CHECK)
#define ERTS_PROCESS_LOCK_ONLY_LOCK_CHECK_PROTO__
#include "erl_process_lock.h"
#undef ERTS_PROCESS_LOCK_ONLY_LOCK_CHECK_PROTO__
-int erts_smp_lc_runq_is_locked(ErtsRunQueue *);
#define ERTS_SMP_LC_CHK_RUNQ_LOCK(RQ, L) \
do { \
if ((L)) \
@@ -1357,13 +1484,91 @@ erts_proc_set_error_handler(Process *p, ErtsProcLocks plocks, Eterm handler)
#endif
+#ifdef ERTS_INCLUDE_SCHEDULER_INTERNALS
+
#ifdef ERTS_SMP
-ErtsRunQueue *erts_prepare_emigrate(ErtsRunQueue *c_rq,
- ErtsRunQueueInfo *c_rqi,
- int prio);
+#include "erl_thr_progress.h"
+
+extern erts_atomic_t erts_migration_paths;
+
+ERTS_GLB_INLINE ErtsMigrationPaths *erts_get_migration_paths_managed(void);
+ERTS_GLB_INLINE ErtsMigrationPaths *erts_get_migration_paths(void);
ERTS_GLB_INLINE ErtsRunQueue *erts_check_emigration_need(ErtsRunQueue *c_rq,
int prio);
+#if ERTS_GLB_INLINE_INCL_FUNC_DEF
+
+ERTS_GLB_INLINE ErtsMigrationPaths *
+erts_get_migration_paths_managed(void)
+{
+ return (ErtsMigrationPaths *) erts_atomic_read_ddrb(&erts_migration_paths);
+}
+
+ERTS_GLB_INLINE ErtsMigrationPaths *
+erts_get_migration_paths(void)
+{
+ if (erts_thr_progress_is_managed_thread())
+ return erts_get_migration_paths_managed();
+ else
+ return NULL;
+}
+
+ERTS_GLB_INLINE ErtsRunQueue *
+erts_check_emigration_need(ErtsRunQueue *c_rq, int prio)
+{
+ ErtsMigrationPaths *mps = erts_get_migration_paths();
+ ErtsMigrationPath *mp;
+ Uint32 flags;
+
+ if (!mps)
+ return NULL;
+
+ mp = &mps->mpath[c_rq->ix];
+ flags = mp->flags;
+
+ if (ERTS_CHK_RUNQ_FLG_EMIGRATE(flags, prio)) {
+ int len;
+
+ if (ERTS_CHK_RUNQ_FLG_EVACUATE(flags, prio)) {
+ /* force emigration */
+ return mp->prio[prio].runq;
+ }
+
+ if (flags & ERTS_RUNQ_FLG_INACTIVE) {
+ /*
+ * Run queue was inactive at last balance. Verify that
+ * it still is before forcing emigration.
+ */
+ if (ERTS_RUNQ_FLGS_GET(c_rq) & ERTS_RUNQ_FLG_INACTIVE)
+ return mp->prio[prio].runq;
+ }
+
+
+ if (prio == ERTS_PORT_PRIO_LEVEL)
+ len = RUNQ_READ_LEN(&c_rq->ports.info.len);
+ else
+ len = RUNQ_READ_LEN(&c_rq->procs.prio_info[prio].len);
+
+ if (len > mp->prio[prio].limit.this) {
+ ErtsRunQueue *n_rq = mp->prio[prio].runq;
+ if (n_rq) {
+ if (prio == ERTS_PORT_PRIO_LEVEL)
+ len = RUNQ_READ_LEN(&n_rq->ports.info.len);
+ else
+ len = RUNQ_READ_LEN(&n_rq->procs.prio_info[prio].len);
+
+ if (len < mp->prio[prio].limit.other)
+ return n_rq;
+ }
+ }
+ }
+ return NULL;
+}
+
+#endif
+
+#endif
+
#endif
ERTS_GLB_INLINE int erts_is_scheduler_bound(ErtsSchedulerData *esdp);
@@ -1372,39 +1577,20 @@ ERTS_GLB_INLINE Eterm erts_get_current_pid(void);
ERTS_GLB_INLINE Uint erts_get_scheduler_id(void);
ERTS_GLB_INLINE ErtsRunQueue *erts_get_runq_proc(Process *p);
ERTS_GLB_INLINE ErtsRunQueue *erts_get_runq_current(ErtsSchedulerData *esdp);
+#ifndef ERTS_ENABLE_LOCK_COUNT
ERTS_GLB_INLINE void erts_smp_runq_lock(ErtsRunQueue *rq);
+#endif
ERTS_GLB_INLINE int erts_smp_runq_trylock(ErtsRunQueue *rq);
ERTS_GLB_INLINE void erts_smp_runq_unlock(ErtsRunQueue *rq);
+#ifndef ERTS_ENABLE_LOCK_COUNT
ERTS_GLB_INLINE void erts_smp_xrunq_lock(ErtsRunQueue *rq, ErtsRunQueue *xrq);
+#endif
ERTS_GLB_INLINE void erts_smp_xrunq_unlock(ErtsRunQueue *rq, ErtsRunQueue *xrq);
ERTS_GLB_INLINE void erts_smp_runqs_lock(ErtsRunQueue *rq1, ErtsRunQueue *rq2);
ERTS_GLB_INLINE void erts_smp_runqs_unlock(ErtsRunQueue *rq1, ErtsRunQueue *rq2);
#if ERTS_GLB_INLINE_INCL_FUNC_DEF
-#ifdef ERTS_SMP
-ERTS_GLB_INLINE ErtsRunQueue *
-erts_check_emigration_need(ErtsRunQueue *c_rq, int prio)
-{
- ErtsRunQueueInfo *c_rqi;
-
- if (!ERTS_CHK_RUNQ_FLG_EMIGRATE(c_rq->flags, prio))
- return NULL;
-
- if (prio == ERTS_PORT_PRIO_LEVEL)
- c_rqi = &c_rq->ports.info;
- else
- c_rqi = &c_rq->procs.prio_info[prio];
-
- if (!ERTS_CHK_RUNQ_FLG_EVACUATE(c_rq->flags, prio)
- && !(c_rq->flags & ERTS_RUNQ_FLG_INACTIVE)
- && c_rqi->len <= c_rqi->migrate.limit.this)
- return NULL;
-
- return erts_prepare_emigrate(c_rq, c_rqi, prio);
-}
-#endif
-
ERTS_GLB_INLINE
int erts_is_scheduler_bound(ErtsSchedulerData *esdp)
{
@@ -1442,10 +1628,9 @@ Uint erts_get_scheduler_id(void)
ERTS_GLB_INLINE ErtsRunQueue *
erts_get_runq_proc(Process *p)
{
- ERTS_SMP_LC_ASSERT(ERTS_PROC_LOCK_STATUS & erts_proc_lc_my_proc_locks(p));
#ifdef ERTS_SMP
- ASSERT(p->run_queue);
- return p->run_queue;
+ ASSERT(ERTS_AINT_NULL != erts_atomic_read_nob(&p->run_queue));
+ return (ErtsRunQueue *) erts_atomic_read_nob(&p->run_queue);
#else
return ERTS_RUNQ_IX(0);
#endif
@@ -1464,6 +1649,12 @@ erts_get_runq_current(ErtsSchedulerData *esdp)
#endif
}
+#ifdef ERTS_ENABLE_LOCK_COUNT
+
+#define erts_smp_runq_lock(rq) erts_smp_mtx_lock_x(&(rq)->mtx, __FILE__, __LINE__)
+
+#else
+
ERTS_GLB_INLINE void
erts_smp_runq_lock(ErtsRunQueue *rq)
{
@@ -1472,6 +1663,8 @@ erts_smp_runq_lock(ErtsRunQueue *rq)
#endif
}
+#endif
+
ERTS_GLB_INLINE int
erts_smp_runq_trylock(ErtsRunQueue *rq)
{
@@ -1490,6 +1683,31 @@ erts_smp_runq_unlock(ErtsRunQueue *rq)
#endif
}
+#ifdef ERTS_ENABLE_LOCK_COUNT
+
+#define erts_smp_xrunq_lock(rq, xrq) erts_smp_xrunq_lock_x((rq), (xrq), __FILE__, __LINE__)
+
+ERTS_GLB_INLINE void
+erts_smp_xrunq_lock_x(ErtsRunQueue *rq, ErtsRunQueue *xrq, char* file, int line)
+{
+#ifdef ERTS_SMP
+ ERTS_SMP_LC_ASSERT(erts_smp_lc_mtx_is_locked(&rq->mtx));
+ if (xrq != rq) {
+ if (erts_smp_mtx_trylock(&xrq->mtx) == EBUSY) {
+ if (rq < xrq)
+ erts_smp_mtx_lock_x(&xrq->mtx, file, line);
+ else {
+ erts_smp_mtx_unlock(&rq->mtx);
+ erts_smp_mtx_lock_x(&xrq->mtx, file, line);
+ erts_smp_mtx_lock_x(&rq->mtx, file, line);
+ }
+ }
+ }
+#endif
+}
+
+#else
+
ERTS_GLB_INLINE void
erts_smp_xrunq_lock(ErtsRunQueue *rq, ErtsRunQueue *xrq)
{
@@ -1509,6 +1727,8 @@ erts_smp_xrunq_lock(ErtsRunQueue *rq, ErtsRunQueue *xrq)
#endif
}
+#endif
+
ERTS_GLB_INLINE void
erts_smp_xrunq_unlock(ErtsRunQueue *rq, ErtsRunQueue *xrq)
{
@@ -1581,25 +1801,13 @@ extern int erts_disable_proc_not_running_opt;
#ifdef DEBUG
#define ERTS_SMP_ASSERT_IS_NOT_EXITING(P) \
- do { ASSERT(!(P)->is_exiting); } while (0)
+ do { ASSERT(!ERTS_PROC_IS_EXITING((P))); } while (0)
#else
#define ERTS_SMP_ASSERT_IS_NOT_EXITING(P)
#endif
-/* NOTE: At least one process lock has to be held on P! */
-#ifdef ERTS_ENABLE_LOCK_CHECK
-#define ERTS_PROC_IS_EXITING(P) \
- (ERTS_SMP_LC_ASSERT(erts_proc_lc_my_proc_locks((P)) != 0 \
- || erts_lc_pix_lock_is_locked(ERTS_PID2PIXLOCK((P)->id))),\
- (P)->is_exiting)
-#else
-#define ERTS_PROC_IS_EXITING(P) ((P)->is_exiting)
-#endif
-
#else /* !ERTS_SMP */
-#define ERTS_PROC_IS_EXITING(P) ((P)->status == P_EXITING)
-
#define ERTS_SMP_ASSERT_IS_NOT_EXITING(P)
#define erts_pid2proc_not_running erts_pid2proc
@@ -1607,6 +1815,10 @@ extern int erts_disable_proc_not_running_opt;
#endif
+#define ERTS_PROC_IS_EXITING(P) \
+ (ERTS_PSFLG_EXITING & erts_smp_atomic32_read_acqb(&(P)->state))
+
+
/* Minimum NUMBER of processes for a small system to start */
#ifdef ERTS_SMP
#define ERTS_MIN_PROCESSES ERTS_NO_OF_PIX_LOCKS
@@ -1645,4 +1857,6 @@ erts_sched_poke(ErtsSchedulerSleepInfo *ssi)
#endif
-
+void erl_halt(int code);
+extern erts_smp_atomic32_t erts_halt_progress;
+extern int erts_halt_code;
diff --git a/erts/emulator/beam/erl_process_dump.c b/erts/emulator/beam/erl_process_dump.c
index 3550f1396c..542c5ed0d9 100644
--- a/erts/emulator/beam/erl_process_dump.c
+++ b/erts/emulator/beam/erl_process_dump.c
@@ -65,14 +65,11 @@ erts_deep_process_dump(int to, void *to_arg)
all_binaries = NULL;
for (i = 0; i < erts_max_processes; i++) {
- if ((process_tab[i] != NULL) && (process_tab[i]->i != ENULL)) {
- if (process_tab[i]->status != P_EXITING) {
- Process* p = process_tab[i];
-
- if (p->status != P_GARBING) {
- dump_process_info(to, to_arg, p);
- }
- }
+ Process *p = erts_pix2proc(i);
+ if (p && p->i != ENULL) {
+ erts_aint32_t state = erts_smp_atomic32_read_acqb(&p->state);
+ if (!(state & (ERTS_PSFLG_EXITING|ERTS_PSFLG_GC)))
+ dump_process_info(to, to_arg, p);
}
}
@@ -326,7 +323,7 @@ heap_dump(int to, void *to_arg, Eterm x)
int i;
GET_DOUBLE_DATA((ptr+1), f);
- i = sys_double_to_chars(f.fd, (char*) sbuf);
+ i = sys_double_to_chars(f.fd, (char*) sbuf, sizeof(sbuf));
sys_memset(sbuf+i, 0, 31-i);
erts_print(to, to_arg, "F%X:%s\n", i, sbuf);
*ptr = OUR_NIL;
diff --git a/erts/emulator/beam/erl_process_lock.c b/erts/emulator/beam/erl_process_lock.c
index a5a753b798..7777ba1d3d 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2012. 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
@@ -67,10 +67,12 @@
#include "erl_process.h"
-const Process erts_proc_lock_busy;
+const Process erts_proc_lock_busy = {ERTS_INVALID_PID};
#ifdef ERTS_SMP
+#if ERTS_PROC_LOCK_OWN_IMPL
+
#define ERTS_PROC_LOCK_SPIN_COUNT_MAX 2000
#define ERTS_PROC_LOCK_SPIN_COUNT_SCHED_INC 32
#define ERTS_PROC_LOCK_SPIN_COUNT_BASE 1000
@@ -90,15 +92,12 @@ static void check_queue(erts_proc_lock_t *lck);
#error "The size of the 'uflgs' field of the erts_tse_t type is too small"
#endif
-struct erts_proc_lock_queues_t_ {
- erts_proc_lock_queues_t *next;
- erts_tse_t *queue[ERTS_PROC_LOCK_MAX_BIT+1];
-};
+static int proc_lock_spin_count;
+static int aux_thr_proc_lock_spin_count;
-static erts_proc_lock_queues_t zeroqs = {0};
+static void cleanup_tse(void);
-static erts_smp_spinlock_t qs_lock;
-static erts_proc_lock_queues_t *queue_free_list;
+#endif /* ERTS_PROC_LOCK_OWN_IMPL */
#ifdef ERTS_ENABLE_LOCK_CHECK
static struct {
@@ -111,16 +110,11 @@ static struct {
erts_pix_lock_t erts_pix_locks[ERTS_NO_OF_PIX_LOCKS];
-static int proc_lock_spin_count;
-static int aux_thr_proc_lock_spin_count;
-
-static void cleanup_tse(void);
void
erts_init_proc_lock(int cpus)
{
int i;
- erts_smp_spinlock_init(&qs_lock, "proc_lck_qs_alloc");
for (i = 0; i < ERTS_NO_OF_PIX_LOCKS; i++) {
#ifdef ERTS_ENABLE_LOCK_COUNT
erts_mtx_init_x(&erts_pix_locks[i].u.mtx,
@@ -129,14 +123,8 @@ erts_init_proc_lock(int cpus)
erts_mtx_init(&erts_pix_locks[i].u.mtx, "pix_lock");
#endif
}
- queue_free_list = NULL;
+#if ERTS_PROC_LOCK_OWN_IMPL
erts_thr_install_exit_handler(cleanup_tse);
-#ifdef ERTS_ENABLE_LOCK_CHECK
- lc_id.proc_lock_main = erts_lc_get_lock_order_id("proc_main");
- lc_id.proc_lock_link = erts_lc_get_lock_order_id("proc_link");
- lc_id.proc_lock_msgq = erts_lc_get_lock_order_id("proc_msgq");
- lc_id.proc_lock_status = erts_lc_get_lock_order_id("proc_status");
-#endif
if (cpus > 1) {
proc_lock_spin_count = ERTS_PROC_LOCK_SPIN_COUNT_BASE;
proc_lock_spin_count += (ERTS_PROC_LOCK_SPIN_COUNT_SCHED_INC
@@ -153,19 +141,19 @@ erts_init_proc_lock(int cpus)
}
if (proc_lock_spin_count > ERTS_PROC_LOCK_SPIN_COUNT_MAX)
proc_lock_spin_count = ERTS_PROC_LOCK_SPIN_COUNT_MAX;
+#endif
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ lc_id.proc_lock_main = erts_lc_get_lock_order_id("proc_main");
+ lc_id.proc_lock_link = erts_lc_get_lock_order_id("proc_link");
+ lc_id.proc_lock_msgq = erts_lc_get_lock_order_id("proc_msgq");
+ lc_id.proc_lock_status = erts_lc_get_lock_order_id("proc_status");
+#endif
}
+#if ERTS_PROC_LOCK_OWN_IMPL
+
#ifdef ERTS_ENABLE_LOCK_CHECK
-static void
-check_unused_tse(erts_tse_t *wtr)
-{
- int i;
- erts_proc_lock_queues_t *queues = wtr->udata;
- ERTS_LC_ASSERT(wtr->uflgs == 0);
- for (i = 0; i <= ERTS_PROC_LOCK_MAX_BIT; i++)
- ERTS_LC_ASSERT(!queues->queue[i]);
-}
-#define CHECK_UNUSED_TSE(W) check_unused_tse((W))
+#define CHECK_UNUSED_TSE(W) ERTS_LC_ASSERT((W)->uflgs == 0)
#else
#define CHECK_UNUSED_TSE(W)
#endif
@@ -174,112 +162,64 @@ static ERTS_INLINE erts_tse_t *
tse_fetch(erts_pix_lock_t *pix_lock)
{
erts_tse_t *tse = erts_tse_fetch();
- if (!tse->udata) {
- erts_proc_lock_queues_t *qs;
-#if ERTS_PROC_LOCK_SPINLOCK_IMPL && !ERTS_PROC_LOCK_ATOMIC_IMPL
- if (pix_lock)
- erts_pix_unlock(pix_lock);
-#endif
- erts_smp_spin_lock(&qs_lock);
- qs = queue_free_list;
- if (qs) {
- queue_free_list = queue_free_list->next;
- erts_smp_spin_unlock(&qs_lock);
- }
- else {
- erts_smp_spin_unlock(&qs_lock);
- qs = erts_alloc(ERTS_ALC_T_PROC_LCK_QS,
- sizeof(erts_proc_lock_queues_t));
- sys_memcpy((void *) qs,
- (void *) &zeroqs,
- sizeof(erts_proc_lock_queues_t));
- }
- tse->udata = qs;
-#if ERTS_PROC_LOCK_SPINLOCK_IMPL && !ERTS_PROC_LOCK_ATOMIC_IMPL
- if (pix_lock)
- erts_pix_lock(pix_lock);
-#endif
- }
tse->uflgs = 0;
return tse;
}
static ERTS_INLINE void
-tse_return(erts_tse_t *tse, int force_free_q)
+tse_return(erts_tse_t *tse)
{
CHECK_UNUSED_TSE(tse);
- if (force_free_q || erts_tse_is_tmp(tse)) {
- erts_proc_lock_queues_t *qs = tse->udata;
- ASSERT(qs);
- erts_smp_spin_lock(&qs_lock);
- qs->next = queue_free_list;
- queue_free_list = qs;
- erts_smp_spin_unlock(&qs_lock);
- tse->udata = NULL;
- }
erts_tse_return(tse);
}
-void
-erts_proc_lock_prepare_proc_lock_waiter(void)
-{
- tse_return(tse_fetch(NULL), 0);
-}
-
-
static void
cleanup_tse(void)
{
erts_tse_t *tse = erts_tse_fetch();
- if (tse) {
- if (tse->udata)
- tse_return(tse, 1);
- else
- erts_tse_return(tse);
- }
+ if (tse)
+ erts_tse_return(tse);
}
/*
* Waiters are queued in a circular double linked list;
- * where qs->queue[lock_ix] is the first waiter in queue, and
- * qs->queue[lock_ix]->prev is the last waiter in queue.
+ * where lck->queue[lock_ix] is the first waiter in queue, and
+ * lck->queue[lock_ix]->prev is the last waiter in queue.
*/
static ERTS_INLINE void
-enqueue_waiter(erts_proc_lock_queues_t *qs,
- int ix,
- erts_tse_t *wtr)
+enqueue_waiter(erts_proc_lock_t *lck, int ix, erts_tse_t *wtr)
{
- if (!qs->queue[ix]) {
- qs->queue[ix] = wtr;
+ if (!lck->queue[ix]) {
+ lck->queue[ix] = wtr;
wtr->next = wtr;
wtr->prev = wtr;
}
else {
- ERTS_LC_ASSERT(qs->queue[ix]->next && qs->queue[ix]->prev);
- wtr->next = qs->queue[ix];
- wtr->prev = qs->queue[ix]->prev;
+ ERTS_LC_ASSERT(lck->queue[ix]->next && lck->queue[ix]->prev);
+ wtr->next = lck->queue[ix];
+ wtr->prev = lck->queue[ix]->prev;
wtr->prev->next = wtr;
- qs->queue[ix]->prev = wtr;
+ lck->queue[ix]->prev = wtr;
}
}
static erts_tse_t *
-dequeue_waiter(erts_proc_lock_queues_t *qs, int ix)
+dequeue_waiter(erts_proc_lock_t *lck, int ix)
{
- erts_tse_t *wtr = qs->queue[ix];
- ERTS_LC_ASSERT(qs->queue[ix]);
+ erts_tse_t *wtr = lck->queue[ix];
+ ERTS_LC_ASSERT(lck->queue[ix]);
if (wtr->next == wtr) {
- ERTS_LC_ASSERT(qs->queue[ix]->prev == wtr);
- qs->queue[ix] = NULL;
+ ERTS_LC_ASSERT(lck->queue[ix]->prev == wtr);
+ lck->queue[ix] = NULL;
}
else {
ERTS_LC_ASSERT(wtr->next != wtr);
ERTS_LC_ASSERT(wtr->prev != wtr);
wtr->next->prev = wtr->prev;
wtr->prev->next = wtr->next;
- qs->queue[ix] = wtr->next;
+ lck->queue[ix] = wtr->next;
}
return wtr;
}
@@ -300,19 +240,18 @@ try_aquire(erts_proc_lock_t *lck, erts_tse_t *wtr)
ErtsProcLocks locks = wtr->uflgs;
int lock_no;
- ERTS_LC_ASSERT(lck->queues);
ERTS_LC_ASSERT(got_locks != locks);
for (lock_no = 0; lock_no <= ERTS_PROC_LOCK_MAX_BIT; lock_no++) {
ErtsProcLocks lock = ((ErtsProcLocks) 1) << lock_no;
if (locks & lock) {
ErtsProcLocks wflg, old_lflgs;
- if (lck->queues->queue[lock_no]) {
+ if (lck->queue[lock_no]) {
/* Others already waiting */
enqueue:
ERTS_LC_ASSERT(ERTS_PROC_LOCK_FLGS_READ_(lck)
& (lock << ERTS_PROC_LOCK_WAITER_SHIFT));
- enqueue_waiter(lck->queues, lock_no, wtr);
+ enqueue_waiter(lck, lock_no, wtr);
break;
}
wflg = lock << ERTS_PROC_LOCK_WAITER_SHIFT;
@@ -364,7 +303,6 @@ transfer_locks(Process *p,
for (lock_no = 0; tlocks && lock_no <= ERTS_PROC_LOCK_MAX_BIT; lock_no++) {
ErtsProcLocks lock = ((ErtsProcLocks) 1) << lock_no;
if (tlocks & lock) {
- erts_proc_lock_queues_t *qs = p->lock.queues;
/* Transfer lock */
#ifdef ERTS_ENABLE_LOCK_CHECK
tlocks &= ~lock;
@@ -372,9 +310,9 @@ transfer_locks(Process *p,
ERTS_LC_ASSERT(ERTS_PROC_LOCK_FLGS_READ_(&p->lock)
& (lock << ERTS_PROC_LOCK_WAITER_SHIFT));
transferred++;
- wtr = dequeue_waiter(qs, lock_no);
+ wtr = dequeue_waiter(&p->lock, lock_no);
ERTS_LC_ASSERT(wtr);
- if (!qs->queue[lock_no])
+ if (!p->lock.queue[lock_no])
unset_waiter |= lock;
ERTS_LC_ASSERT(wtr->uflgs & lock);
wtr->uflgs &= ~lock;
@@ -463,7 +401,6 @@ wait_for_locks(Process *p,
{
erts_pix_lock_t *pix_lock = pixlck ? pixlck : ERTS_PID2PIXLOCK(p->id);
erts_tse_t *wtr;
- erts_proc_lock_queues_t *qs;
/* Acquire a waiter object on which this thread can wait. */
wtr = tse_fetch(pix_lock);
@@ -479,18 +416,6 @@ wait_for_locks(Process *p,
ERTS_LC_ASSERT(erts_lc_pix_lock_is_locked(pix_lock));
- qs = wtr->udata;
- ASSERT(qs);
- /* Provide the process with waiter queues, if it doesn't have one. */
- if (!p->lock.queues) {
- qs->next = NULL;
- p->lock.queues = qs;
- }
- else {
- qs->next = p->lock.queues->next;
- p->lock.queues->next = qs;
- }
-
#ifdef ERTS_PROC_LOCK_HARD_DEBUG
check_queue(&p->lock);
#endif
@@ -504,7 +429,9 @@ wait_for_locks(Process *p,
check_queue(&p->lock);
#endif
- if (wtr->uflgs) {
+ if (wtr->uflgs == 0)
+ erts_pix_unlock(pix_lock);
+ else {
/* We didn't get them all; need to wait... */
ASSERT((wtr->uflgs & ~ERTS_PROC_LOCKS_ALL) == 0);
@@ -529,28 +456,12 @@ wait_for_locks(Process *p,
} while (res != 0);
}
- erts_pix_lock(pix_lock);
-
ASSERT(wtr->uflgs == 0);
}
- /* Recover some queues to store in the waiter. */
- ERTS_LC_ASSERT(p->lock.queues);
- if (p->lock.queues->next) {
- qs = p->lock.queues->next;
- p->lock.queues->next = qs->next;
- }
- else {
- qs = p->lock.queues;
- p->lock.queues = NULL;
- }
- wtr->udata = qs;
-
- erts_pix_unlock(pix_lock);
-
ERTS_LC_ASSERT(locks == (ERTS_PROC_LOCK_FLGS_READ_(&p->lock) & locks));
- tse_return(wtr, 0);
+ tse_return(wtr);
}
/*
@@ -651,6 +562,16 @@ erts_proc_unlock_failed(Process *p,
transfer_locks(p, wait_locks, pix_lock, 1); /* unlocks pix_lock */
}
+#endif /* ERTS_PROC_LOCK_OWN_IMPL */
+
+void
+erts_proc_lock_prepare_proc_lock_waiter(void)
+{
+#if ERTS_PROC_LOCK_OWN_IMPL
+ tse_return(tse_fetch(NULL));
+#endif
+}
+
/*
* proc_safelock() locks process locks on two processes. In order
* to avoid a deadlock, proc_safelock() unlocks those locks that
@@ -659,12 +580,11 @@ erts_proc_unlock_failed(Process *p,
*/
static void
-proc_safelock(Process *a_proc,
- erts_pix_lock_t *a_pix_lck,
+proc_safelock(int is_sched,
+ Process *a_proc,
ErtsProcLocks a_have_locks,
ErtsProcLocks a_need_locks,
Process *b_proc,
- erts_pix_lock_t *b_pix_lck,
ErtsProcLocks b_have_locks,
ErtsProcLocks b_need_locks)
{
@@ -672,7 +592,6 @@ proc_safelock(Process *a_proc,
#ifdef ERTS_ENABLE_LOCK_CHECK
Eterm pid1, pid2;
#endif
- erts_pix_lock_t *pix_lck1, *pix_lck2;
ErtsProcLocks need_locks1, have_locks1, need_locks2, have_locks2;
ErtsProcLocks unlock_mask;
int lock_no, refc1 = 0, refc2 = 0;
@@ -689,14 +608,12 @@ proc_safelock(Process *a_proc,
#ifdef ERTS_ENABLE_LOCK_CHECK
pid1 = a_proc->id;
#endif
- pix_lck1 = a_pix_lck;
need_locks1 = a_need_locks;
have_locks1 = a_have_locks;
p2 = b_proc;
#ifdef ERTS_ENABLE_LOCK_CHECK
pid2 = b_proc->id;
#endif
- pix_lck2 = b_pix_lck;
need_locks2 = b_need_locks;
have_locks2 = b_have_locks;
}
@@ -705,14 +622,12 @@ proc_safelock(Process *a_proc,
#ifdef ERTS_ENABLE_LOCK_CHECK
pid1 = b_proc->id;
#endif
- pix_lck1 = b_pix_lck;
need_locks1 = b_need_locks;
have_locks1 = b_have_locks;
p2 = a_proc;
#ifdef ERTS_ENABLE_LOCK_CHECK
pid2 = a_proc->id;
#endif
- pix_lck2 = a_pix_lck;
need_locks2 = a_need_locks;
have_locks2 = a_have_locks;
}
@@ -723,14 +638,12 @@ proc_safelock(Process *a_proc,
#ifdef ERTS_ENABLE_LOCK_CHECK
pid1 = a_proc->id;
#endif
- pix_lck1 = a_pix_lck;
need_locks1 = a_need_locks | b_need_locks;
have_locks1 = a_have_locks | b_have_locks;
p2 = NULL;
#ifdef ERTS_ENABLE_LOCK_CHECK
pid2 = 0;
#endif
- pix_lck2 = NULL;
need_locks2 = 0;
have_locks2 = 0;
}
@@ -740,14 +653,12 @@ proc_safelock(Process *a_proc,
#ifdef ERTS_ENABLE_LOCK_CHECK
pid1 = b_proc->id;
#endif
- pix_lck1 = b_pix_lck;
need_locks1 = b_need_locks;
have_locks1 = b_have_locks;
p2 = NULL;
#ifdef ERTS_ENABLE_LOCK_CHECK
pid2 = 0;
#endif
- pix_lck2 = NULL;
need_locks2 = 0;
have_locks2 = 0;
#ifdef ERTS_ENABLE_LOCK_CHECK
@@ -795,21 +706,21 @@ proc_safelock(Process *a_proc,
if (unlock_locks) {
have_locks1 &= ~unlock_locks;
need_locks1 |= unlock_locks;
- if (!have_locks1) {
+ if (!is_sched && !have_locks1) {
refc1 = 1;
erts_smp_proc_inc_refc(p1);
}
- erts_smp_proc_unlock__(p1, pix_lck1, unlock_locks);
+ erts_smp_proc_unlock(p1, unlock_locks);
}
unlock_locks = unlock_mask & have_locks2;
if (unlock_locks) {
have_locks2 &= ~unlock_locks;
need_locks2 |= unlock_locks;
- if (!have_locks2) {
+ if (!is_sched && !have_locks2) {
refc2 = 1;
erts_smp_proc_inc_refc(p2);
}
- erts_smp_proc_unlock__(p2, pix_lck2, unlock_locks);
+ erts_smp_proc_unlock(p2, unlock_locks);
}
}
@@ -840,7 +751,7 @@ proc_safelock(Process *a_proc,
if (need_locks2 & lock)
lock_no--;
locks = need_locks1 & lock_mask;
- erts_smp_proc_lock__(p1, pix_lck1, locks);
+ erts_smp_proc_lock(p1, locks);
have_locks1 |= locks;
need_locks1 &= ~locks;
}
@@ -851,7 +762,7 @@ proc_safelock(Process *a_proc,
lock = (1 << ++lock_no);
}
locks = need_locks2 & lock_mask;
- erts_smp_proc_lock__(p2, pix_lck2, locks);
+ erts_smp_proc_lock(p2, locks);
have_locks2 |= locks;
need_locks2 &= ~locks;
}
@@ -886,10 +797,12 @@ proc_safelock(Process *a_proc,
}
#endif
- if (refc1)
- erts_smp_proc_dec_refc(p1);
- if (refc2)
- erts_smp_proc_dec_refc(p2);
+ if (!is_sched) {
+ if (refc1)
+ erts_smp_proc_dec_refc(p1);
+ if (refc2)
+ erts_smp_proc_dec_refc(p2);
+ }
}
void
@@ -900,77 +813,192 @@ erts_proc_safelock(Process *a_proc,
ErtsProcLocks b_have_locks,
ErtsProcLocks b_need_locks)
{
- proc_safelock(a_proc,
- a_proc ? ERTS_PID2PIXLOCK(a_proc->id) : NULL,
+ proc_safelock(erts_get_scheduler_id() != 0,
+ a_proc,
a_have_locks,
a_need_locks,
b_proc,
- b_proc ? ERTS_PID2PIXLOCK(b_proc->id) : NULL,
b_have_locks,
b_need_locks);
}
-/*
- * erts_pid2proc_safelock() is called from erts_pid2proc_opt() when
- * it wasn't possible to trylock all locks needed.
- * c_p - current process
- * c_p_have_locks - locks held on c_p
- * pid - process id of process we are looking up
- * proc - process struct of process we are looking
- * up (both in and out argument)
- * need_locks - all locks we need (including have_locks)
- * pix_lock - pix lock for process we are looking up
- * flags - option flags
- */
-void
-erts_pid2proc_safelock(Process *c_p,
- ErtsProcLocks c_p_have_locks,
- Process **proc,
- ErtsProcLocks need_locks,
- erts_pix_lock_t *pix_lock,
- int flags)
+Process *
+erts_pid2proc_opt(Process *c_p,
+ ErtsProcLocks c_p_have_locks,
+ Eterm pid,
+ ErtsProcLocks pid_need_locks,
+ int flags)
{
- Process *p = *proc;
- ERTS_LC_ASSERT(p->lock.refc > 0);
- ERTS_LC_ASSERT(process_tab[internal_pid_index(p->id)] == p);
- p->lock.refc++;
- erts_pix_unlock(pix_lock);
-
- proc_safelock(c_p,
- c_p ? ERTS_PID2PIXLOCK(c_p->id) : NULL,
- c_p_have_locks,
- c_p_have_locks,
- p,
- pix_lock,
- 0,
- need_locks);
+ Process *dec_refc_proc = NULL;
+ int need_ptl;
+ ErtsProcLocks need_locks;
+ Uint pix;
+ Process *proc;
+#if ERTS_PROC_LOCK_OWN_IMPL && defined(ERTS_ENABLE_LOCK_COUNT)
+ ErtsProcLocks lcnt_locks;
+#endif
- erts_pix_lock(pix_lock);
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ if (c_p) {
+ ErtsProcLocks might_unlock = c_p_have_locks & pid_need_locks;
+ if (might_unlock)
+ erts_proc_lc_might_unlock(c_p, might_unlock);
+ }
+#endif
- if (!p->is_exiting
- || ((flags & ERTS_P2P_FLG_ALLOW_OTHER_X)
- && process_tab[internal_pid_index(p->id)] == p)) {
- ERTS_LC_ASSERT(p->lock.refc > 1);
- p->lock.refc--;
+ if (is_not_internal_pid(pid))
+ return NULL;
+ pix = internal_pid_index(pid);
+
+ ERTS_LC_ASSERT((pid_need_locks & ERTS_PROC_LOCKS_ALL) == pid_need_locks);
+ need_locks = pid_need_locks;
+
+ if (c_p && c_p->id == pid) {
+ ASSERT(c_p->id != ERTS_INVALID_PID);
+ ASSERT(c_p == erts_pix2proc(pix));
+
+ if (!(flags & ERTS_P2P_FLG_ALLOW_OTHER_X)
+ && ERTS_PROC_IS_EXITING(c_p))
+ return NULL;
+ need_locks &= ~c_p_have_locks;
+ if (!need_locks) {
+ if (flags & ERTS_P2P_FLG_SMP_INC_REFC)
+ erts_smp_proc_inc_refc(c_p);
+ return c_p;
+ }
}
- else {
- /* No proc. Note, we need to keep refc until after process unlock */
- erts_pix_unlock(pix_lock);
- erts_smp_proc_unlock__(p, pix_lock, need_locks);
- *proc = NULL;
- erts_pix_lock(pix_lock);
- ERTS_LC_ASSERT(p->lock.refc > 0);
- if (--p->lock.refc == 0) {
- erts_pix_unlock(pix_lock);
- erts_free_proc(p);
- erts_pix_lock(pix_lock);
+
+ need_ptl = !erts_get_scheduler_id();
+
+ if (need_ptl)
+ erts_smp_rwmtx_rwlock(&erts_proc_tab_rwmtx);
+
+ proc = (Process *) erts_smp_atomic_read_ddrb(&erts_proc.tab[pix]);
+
+ if (proc) {
+ if (proc->id != pid)
+ proc = NULL;
+ else if (!need_locks) {
+ if (flags & ERTS_P2P_FLG_SMP_INC_REFC)
+ erts_smp_proc_inc_refc(proc);
}
+ else {
+ int busy;
+
+#if ERTS_PROC_LOCK_OWN_IMPL
+#ifdef ERTS_ENABLE_LOCK_COUNT
+ lcnt_locks = need_locks;
+ if (!(flags & ERTS_P2P_FLG_TRY_LOCK)) {
+ erts_lcnt_proc_lock(&proc->lock, need_locks);
+ }
+#endif
+
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ /* Make sure erts_pid2proc_safelock() is enough to handle
+ a potential lock order violation situation... */
+ busy = erts_proc_lc_trylock_force_busy(proc, need_locks);
+ if (!busy)
+#endif
+#endif /* ERTS_PROC_LOCK_OWN_IMPL */
+ {
+ /* Try a quick trylock to grab all the locks we need. */
+ busy = (int) erts_smp_proc_raw_trylock__(proc, need_locks);
+
+#if ERTS_PROC_LOCK_OWN_IMPL && defined(ERTS_ENABLE_LOCK_CHECK)
+ erts_proc_lc_trylock(proc, need_locks, !busy);
+#endif
+#ifdef ERTS_PROC_LOCK_DEBUG
+ if (!busy)
+ erts_proc_lock_op_debug(proc, need_locks, 1);
+#endif
+ }
+
+#if ERTS_PROC_LOCK_OWN_IMPL && defined(ERTS_ENABLE_LOCK_COUNT)
+ if (flags & ERTS_P2P_FLG_TRY_LOCK)
+ erts_lcnt_proc_trylock(&proc->lock, need_locks,
+ busy ? EBUSY : 0);
+#endif
+
+ if (!busy) {
+ if (flags & ERTS_P2P_FLG_SMP_INC_REFC)
+ erts_smp_proc_inc_refc(proc);
+
+#if ERTS_PROC_LOCK_OWN_IMPL && defined(ERTS_ENABLE_LOCK_COUNT)
+ /* all is great */
+ if (!(flags & ERTS_P2P_FLG_TRY_LOCK))
+ erts_lcnt_proc_lock_post_x(&proc->lock, lcnt_locks,
+ __FILE__, __LINE__);
+#endif
+
+ }
+ else {
+ if (flags & ERTS_P2P_FLG_TRY_LOCK)
+ proc = ERTS_PROC_LOCK_BUSY;
+ else {
+ if (flags & ERTS_P2P_FLG_SMP_INC_REFC)
+ erts_smp_proc_inc_refc(proc);
+
+#if ERTS_PROC_LOCK_OWN_IMPL && defined(ERTS_ENABLE_LOCK_COUNT)
+ erts_lcnt_proc_lock_unaquire(&proc->lock, lcnt_locks);
+#endif
+
+ if (need_ptl) {
+ erts_smp_proc_inc_refc(proc);
+ dec_refc_proc = proc;
+ erts_smp_rwmtx_rwunlock(&erts_proc_tab_rwmtx);
+ need_ptl = 0;
+ }
+
+ proc_safelock(!need_ptl,
+ c_p,
+ c_p_have_locks,
+ c_p_have_locks,
+ proc,
+ 0,
+ need_locks);
+ }
+ }
+ }
+ }
+
+ if (need_ptl)
+ erts_smp_rwmtx_rwunlock(&erts_proc_tab_rwmtx);
+
+ if (need_locks
+ && proc
+ && proc != ERTS_PROC_LOCK_BUSY
+ && (!(flags & ERTS_P2P_FLG_ALLOW_OTHER_X)
+ ? ERTS_PROC_IS_EXITING(proc)
+ : (proc
+ != (Process *) erts_smp_atomic_read_nob(&erts_proc.tab[pix])))) {
+
+ erts_smp_proc_unlock(proc, need_locks);
+
+ if (flags & ERTS_P2P_FLG_SMP_INC_REFC)
+ dec_refc_proc = proc;
+ proc = NULL;
+
}
+
+ if (dec_refc_proc)
+ erts_smp_proc_dec_refc(dec_refc_proc);
+
+#if ERTS_PROC_LOCK_OWN_IMPL && defined(ERTS_PROC_LOCK_DEBUG)
+ ERTS_LC_ASSERT(!proc
+ || proc == ERTS_PROC_LOCK_BUSY
+ || (pid_need_locks ==
+ (ERTS_PROC_LOCK_FLGS_READ_(&proc->lock)
+ & pid_need_locks)));
+#endif
+
+ return proc;
}
void
erts_proc_lock_init(Process *p)
{
+#if ERTS_PROC_LOCK_OWN_IMPL
+ int i;
/* We always start with all locks locked */
#if ERTS_PROC_LOCK_ATOMIC_IMPL
erts_smp_atomic32_init_nob(&p->lock.flags,
@@ -978,31 +1006,64 @@ erts_proc_lock_init(Process *p)
#else
p->lock.flags = ERTS_PROC_LOCKS_ALL;
#endif
- p->lock.queues = NULL;
- p->lock.refc = 1;
+ for (i = 0; i <= ERTS_PROC_LOCK_MAX_BIT; i++)
+ p->lock.queue[i] = NULL;
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ erts_proc_lc_trylock(p, ERTS_PROC_LOCKS_ALL, 1);
+#endif
+#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
+ erts_mtx_init_x(&p->lock.main, "proc_main", p->id);
+ ethr_mutex_lock(&p->lock.main.mtx);
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ erts_lc_trylock(1, &p->lock.main.lc);
+#endif
+ erts_mtx_init_x(&p->lock.link, "proc_link", p->id);
+ ethr_mutex_lock(&p->lock.link.mtx);
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ erts_lc_trylock(1, &p->lock.link.lc);
+#endif
+ erts_mtx_init_x(&p->lock.msgq, "proc_msgq", p->id);
+ ethr_mutex_lock(&p->lock.msgq.mtx);
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ erts_lc_trylock(1, &p->lock.msgq.lc);
+#endif
+ erts_mtx_init_x(&p->lock.status, "proc_status", p->id);
+ ethr_mutex_lock(&p->lock.status.mtx);
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ erts_lc_trylock(1, &p->lock.status.lc);
+#endif
+#endif
+ erts_atomic32_init_nob(&p->lock.refc, 1);
+#ifdef ERTS_PROC_LOCK_DEBUG
+ for (i = 0; i <= ERTS_PROC_LOCK_MAX_BIT; i++)
+ erts_smp_atomic32_init_nob(&p->lock.locked[i], (erts_aint32_t) 1);
+#endif
#ifdef ERTS_ENABLE_LOCK_COUNT
erts_lcnt_proc_lock_init(p);
erts_lcnt_proc_lock(&(p->lock), ERTS_PROC_LOCKS_ALL);
erts_lcnt_proc_lock_post_x(&(p->lock), ERTS_PROC_LOCKS_ALL, __FILE__, __LINE__);
#endif
-
-#ifdef ERTS_ENABLE_LOCK_CHECK
- erts_proc_lc_trylock(p, ERTS_PROC_LOCKS_ALL, 1);
+}
+
+void
+erts_proc_lock_fin(Process *p)
+{
+#if ERTS_PROC_LOCK_RAW_MUTEX_IMPL
+ erts_mtx_destroy(&p->lock.main);
+ erts_mtx_destroy(&p->lock.link);
+ erts_mtx_destroy(&p->lock.msgq);
+ erts_mtx_destroy(&p->lock.status);
#endif
-#ifdef ERTS_PROC_LOCK_DEBUG
- {
- int i;
- for (i = 0; i <= ERTS_PROC_LOCK_MAX_BIT; i++)
- erts_smp_atomic32_init_nob(&p->lock.locked[i], (erts_aint32_t) 1);
- }
+#if defined(ERTS_ENABLE_LOCK_COUNT) && defined(ERTS_SMP)
+ erts_lcnt_proc_lock_destroy(p);
#endif
}
/* --- Process lock counting ----------------------------------------------- */
-#ifdef ERTS_ENABLE_LOCK_COUNT
+#if ERTS_PROC_LOCK_OWN_IMPL && defined(ERTS_ENABLE_LOCK_COUNT)
void erts_lcnt_proc_lock_init(Process *p) {
-
+ if (erts_lcnt_rt_options & ERTS_LCNT_OPT_PROCLOCK) {
if (p->id != ERTS_INVALID_PID) {
erts_lcnt_init_lock_x(&(p->lock.lcnt_main), "proc_main", ERTS_LCNT_LT_PROCLOCK, p->id);
erts_lcnt_init_lock_x(&(p->lock.lcnt_msgq), "proc_msgq", ERTS_LCNT_LT_PROCLOCK, p->id);
@@ -1014,6 +1075,12 @@ void erts_lcnt_proc_lock_init(Process *p) {
erts_lcnt_init_lock(&(p->lock.lcnt_link), "proc_link", ERTS_LCNT_LT_PROCLOCK);
erts_lcnt_init_lock(&(p->lock.lcnt_status), "proc_status", ERTS_LCNT_LT_PROCLOCK);
}
+ } else {
+ sys_memzero(&(p->lock.lcnt_main), sizeof(p->lock.lcnt_main));
+ sys_memzero(&(p->lock.lcnt_msgq), sizeof(p->lock.lcnt_msgq));
+ sys_memzero(&(p->lock.lcnt_link), sizeof(p->lock.lcnt_link));
+ sys_memzero(&(p->lock.lcnt_status), sizeof(p->lock.lcnt_status));
+ }
}
@@ -1108,6 +1175,26 @@ void erts_lcnt_proc_trylock(erts_proc_lock_t *lock, ErtsProcLocks locks, int res
}
}
+
+void erts_lcnt_enable_proc_lock_count(int enable) {
+ int i;
+
+ for (i = 0; i < erts_max_processes; ++i) {
+ Process* p = erts_pix2proc(i);
+ if (p) {
+ if (enable) {
+ if (!ERTS_LCNT_LOCK_TYPE(&(p->lock.lcnt_main))) {
+ erts_lcnt_proc_lock_init(p);
+ }
+ } else {
+ if (ERTS_LCNT_LOCK_TYPE(&(p->lock.lcnt_main))) {
+ erts_lcnt_proc_lock_destroy(p);
+ }
+ }
+ }
+ }
+}
+
#endif /* ifdef ERTS_ENABLE_LOCK_COUNT */
@@ -1115,6 +1202,8 @@ void erts_lcnt_proc_trylock(erts_proc_lock_t *lock, ErtsProcLocks locks, int res
#ifdef ERTS_ENABLE_LOCK_CHECK
+#if ERTS_PROC_LOCK_OWN_IMPL
+
void
erts_proc_lc_lock(Process *p, ErtsProcLocks locks)
{
@@ -1187,9 +1276,12 @@ erts_proc_lc_unlock(Process *p, ErtsProcLocks locks)
}
}
+#endif /* ERTS_PROC_LOCK_OWN_IMPL */
+
void
erts_proc_lc_might_unlock(Process *p, ErtsProcLocks locks)
{
+#if ERTS_PROC_LOCK_OWN_IMPL
erts_lc_lock_t lck = ERTS_LC_LOCK_INIT(-1,
p->id,
ERTS_LC_FLG_LT_PROCLOCK);
@@ -1209,11 +1301,22 @@ erts_proc_lc_might_unlock(Process *p, ErtsProcLocks locks)
lck.id = lc_id.proc_lock_main;
erts_lc_might_unlock(&lck);
}
+#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
+ if (locks & ERTS_PROC_LOCK_MAIN)
+ erts_lc_might_unlock(&p->lock.main.lc);
+ if (locks & ERTS_PROC_LOCK_LINK)
+ erts_lc_might_unlock(&p->lock.link.lc);
+ if (locks & ERTS_PROC_LOCK_MSGQ)
+ erts_lc_might_unlock(&p->lock.msgq.lc);
+ if (locks & ERTS_PROC_LOCK_STATUS)
+ erts_lc_might_unlock(&p->lock.status.lc);
+#endif
}
void
erts_proc_lc_require_lock(Process *p, ErtsProcLocks locks)
{
+#if ERTS_PROC_LOCK_OWN_IMPL
erts_lc_lock_t lck = ERTS_LC_LOCK_INIT(-1,
p->id,
ERTS_LC_FLG_LT_PROCLOCK);
@@ -1233,11 +1336,22 @@ erts_proc_lc_require_lock(Process *p, ErtsProcLocks locks)
lck.id = lc_id.proc_lock_status;
erts_lc_require_lock(&lck);
}
+#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
+ if (locks & ERTS_PROC_LOCK_MAIN)
+ erts_lc_require_lock(&p->lock.main.lc);
+ if (locks & ERTS_PROC_LOCK_LINK)
+ erts_lc_require_lock(&p->lock.link.lc);
+ if (locks & ERTS_PROC_LOCK_MSGQ)
+ erts_lc_require_lock(&p->lock.msgq.lc);
+ if (locks & ERTS_PROC_LOCK_STATUS)
+ erts_lc_require_lock(&p->lock.status.lc);
+#endif
}
void
erts_proc_lc_unrequire_lock(Process *p, ErtsProcLocks locks)
{
+#if ERTS_PROC_LOCK_OWN_IMPL
erts_lc_lock_t lck = ERTS_LC_LOCK_INIT(-1,
p->id,
ERTS_LC_FLG_LT_PROCLOCK);
@@ -1257,8 +1371,19 @@ erts_proc_lc_unrequire_lock(Process *p, ErtsProcLocks locks)
lck.id = lc_id.proc_lock_main;
erts_lc_unrequire_lock(&lck);
}
+#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
+ if (locks & ERTS_PROC_LOCK_MAIN)
+ erts_lc_unrequire_lock(&p->lock.main.lc);
+ if (locks & ERTS_PROC_LOCK_LINK)
+ erts_lc_unrequire_lock(&p->lock.link.lc);
+ if (locks & ERTS_PROC_LOCK_MSGQ)
+ erts_lc_unrequire_lock(&p->lock.msgq.lc);
+ if (locks & ERTS_PROC_LOCK_STATUS)
+ erts_lc_unrequire_lock(&p->lock.status.lc);
+#endif
}
+#if ERTS_PROC_LOCK_OWN_IMPL
int
erts_proc_lc_trylock_force_busy(Process *p, ErtsProcLocks locks)
@@ -1284,21 +1409,30 @@ erts_proc_lc_trylock_force_busy(Process *p, ErtsProcLocks locks)
return 0;
}
+#endif /* ERTS_PROC_LOCK_OWN_IMPL */
+
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->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
}
+#if ERTS_PROC_LOCK_OWN_IMPL
#define ERTS_PROC_LC_EMPTY_LOCK_INIT \
ERTS_LC_LOCK_INIT(-1, THE_NON_VALUE, ERTS_LC_FLG_LT_PROCLOCK)
+#endif /* ERTS_PROC_LOCK_OWN_IMPL */
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[4] = {ERTS_PROC_LC_EMPTY_LOCK_INIT,
ERTS_PROC_LC_EMPTY_LOCK_INIT,
ERTS_PROC_LC_EMPTY_LOCK_INIT,
@@ -1319,7 +1453,17 @@ 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->id;
}
-
+#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
+ erts_lc_lock_t have_locks[4];
+ 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_STATUS)
+ have_locks[have_locks_len++] = p->lock.status.lc;
+#endif
erts_lc_check(have_locks, have_locks_len, NULL, 0);
}
@@ -1328,6 +1472,7 @@ 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[4] = {ERTS_PROC_LC_EMPTY_LOCK_INIT,
ERTS_PROC_LC_EMPTY_LOCK_INIT,
ERTS_PROC_LC_EMPTY_LOCK_INIT,
@@ -1369,6 +1514,27 @@ 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->id;
}
+#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
+ erts_lc_lock_t have_locks[4];
+ erts_lc_lock_t have_not_locks[4];
+
+ if (locks & ERTS_PROC_LOCK_MAIN)
+ have_locks[have_locks_len++] = p->lock.main.lc;
+ else
+ have_not_locks[have_not_locks_len++] = p->lock.main.lc;
+ if (locks & ERTS_PROC_LOCK_LINK)
+ have_locks[have_locks_len++] = p->lock.link.lc;
+ else
+ have_not_locks[have_not_locks_len++] = p->lock.link.lc;
+ if (locks & ERTS_PROC_LOCK_MSGQ)
+ have_locks[have_locks_len++] = p->lock.msgq.lc;
+ else
+ have_not_locks[have_not_locks_len++] = p->lock.msgq.lc;
+ if (locks & ERTS_PROC_LOCK_STATUS)
+ have_locks[have_locks_len++] = p->lock.status.lc;
+ else
+ have_not_locks[have_not_locks_len++] = p->lock.status.lc;
+#endif
erts_lc_check(have_locks, have_locks_len,
have_not_locks, have_not_locks_len);
@@ -1378,6 +1544,8 @@ ErtsProcLocks
erts_proc_lc_my_proc_locks(Process *p)
{
int resv[4];
+ ErtsProcLocks res = 0;
+#if ERTS_PROC_LOCK_OWN_IMPL
erts_lc_lock_t locks[4] = {ERTS_LC_LOCK_INIT(lc_id.proc_lock_main,
p->id,
ERTS_LC_FLG_LT_PROCLOCK),
@@ -1390,8 +1558,12 @@ erts_proc_lc_my_proc_locks(Process *p)
ERTS_LC_LOCK_INIT(lc_id.proc_lock_status,
p->id,
ERTS_LC_FLG_LT_PROCLOCK)};
-
- ErtsProcLocks res = 0;
+#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
+ erts_lc_lock_t locks[4] = {p->lock.main.lc,
+ p->lock.link.lc,
+ p->lock.msgq.lc,
+ p->lock.status.lc};
+#endif
erts_lc_have_locks(resv, locks, 4);
if (resv[0])
@@ -1424,7 +1596,7 @@ erts_proc_lc_chk_no_proc_locks(char *file, int line)
#endif /* #ifdef ERTS_ENABLE_LOCK_CHECK */
-#ifdef ERTS_PROC_LOCK_HARD_DEBUG
+#if ERTS_PROC_LOCK_OWN_IMPL && defined(ERTS_PROC_LOCK_HARD_DEBUG)
void
check_queue(erts_proc_lock_t *lck)
{
@@ -1437,24 +1609,24 @@ check_queue(erts_proc_lock_t *lck)
if (lflgs & wtr) {
int n;
erts_tse_t *wtr;
- ERTS_LC_ASSERT(lck->queues && lck->queues->queue[lock_no]);
- wtr = lck->queues->queue[lock_no];
+ ERTS_LC_ASSERT(lck->queue[lock_no]);
+ wtr = lck->queue[lock_no];
n = 0;
do {
wtr = wtr->next;
n++;
- } while (wtr != lck->queues->queue[lock_no]);
+ } while (wtr != lck->queue[lock_no]);
do {
wtr = wtr->prev;
n--;
- } while (wtr != lck->queues->queue[lock_no]);
+ } while (wtr != lck->queue[lock_no]);
ERTS_LC_ASSERT(n == 0);
}
else {
- ERTS_LC_ASSERT(!lck->queues || !lck->queues->queue[lock_no]);
+ ERTS_LC_ASSERT(!lck->queue[lock_no]);
}
}
}
#endif
-#endif /* ERTS_SMP (the whole file) */
+#endif /* ERTS_SMP */
diff --git a/erts/emulator/beam/erl_process_lock.h b/erts/emulator/beam/erl_process_lock.h
index 97e554914e..4aec19c8c3 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2012. 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
@@ -37,10 +37,21 @@
#include "erl_smp.h"
+#if defined(VALGRIND) || defined(ETHR_DISABLE_NATIVE_IMPLS)
+# define ERTS_PROC_LOCK_OWN_IMPL 0
+#else
+# define ERTS_PROC_LOCK_OWN_IMPL 1
+#endif
+
#define ERTS_PROC_LOCK_ATOMIC_IMPL 0
#define ERTS_PROC_LOCK_SPINLOCK_IMPL 0
#define ERTS_PROC_LOCK_MUTEX_IMPL 0
+#if !ERTS_PROC_LOCK_OWN_IMPL
+#define ERTS_PROC_LOCK_RAW_MUTEX_IMPL 1
+#else
+#define ERTS_PROC_LOCK_RAW_MUTEX_IMPL 0
+
#if defined(ETHR_HAVE_32BIT_NATIVE_ATOMIC_OPS)
# undef ERTS_PROC_LOCK_ATOMIC_IMPL
# define ERTS_PROC_LOCK_ATOMIC_IMPL 1
@@ -52,29 +63,38 @@
# define ERTS_PROC_LOCK_MUTEX_IMPL 1
#endif
+#endif
+
#define ERTS_PROC_LOCK_MAX_BIT 3
typedef erts_aint32_t ErtsProcLocks;
-typedef struct erts_proc_lock_queues_t_ erts_proc_lock_queues_t;
-
typedef struct erts_proc_lock_t_ {
+#if ERTS_PROC_LOCK_OWN_IMPL
#if ERTS_PROC_LOCK_ATOMIC_IMPL
erts_smp_atomic32_t flags;
#else
ErtsProcLocks flags;
#endif
- erts_proc_lock_queues_t *queues;
- Sint32 refc;
-#ifdef ERTS_PROC_LOCK_DEBUG
- erts_smp_atomic32_t locked[ERTS_PROC_LOCK_MAX_BIT+1];
-#endif
+ erts_tse_t *queue[ERTS_PROC_LOCK_MAX_BIT+1];
#ifdef ERTS_ENABLE_LOCK_COUNT
erts_lcnt_lock_t lcnt_main;
erts_lcnt_lock_t lcnt_link;
erts_lcnt_lock_t lcnt_msgq;
erts_lcnt_lock_t lcnt_status;
#endif
+#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
+ erts_mtx_t main;
+ erts_mtx_t link;
+ erts_mtx_t msgq;
+ erts_mtx_t status;
+#else
+# error "no implementation"
+#endif
+ erts_atomic32_t refc;
+#ifdef ERTS_PROC_LOCK_DEBUG
+ erts_smp_atomic32_t locked[ERTS_PROC_LOCK_MAX_BIT+1];
+#endif
} erts_proc_lock_t;
/* Process lock flags */
@@ -107,11 +127,9 @@ typedef struct erts_proc_lock_t_ {
/*
* Status lock:
* Protects the following fields in the process structure:
- * * status
- * * rstatus
- * * status_flags
* * pending_suspenders
* * suspendee
+ * * ...
*/
#define ERTS_PROC_LOCK_STATUS (((ErtsProcLocks) 1) << ERTS_PROC_LOCK_MAX_BIT)
@@ -143,14 +161,11 @@ typedef struct erts_proc_lock_t_ {
* Other rules regarding process locking:
*
* Exiting processes:
- * When changing status to P_EXITING on a process, you are required
- * to take all process locks (ERTS_PROC_LOCKS_ALL). Thus, by holding
- * at least one process lock (whichever one doesn't matter) you
- * are guaranteed that the process won't exit until the lock you are
- * holding has been released. Appart from all process locks also
- * the pix lock corresponding to the process has to be held.
- * At the same time as status is changed to P_EXITING, also the
- * field 'is_exiting' in the process structure is set to a value != 0.
+ * When changing state to exiting (ERTS_PSFLG_EXITING) on a process,
+ * you are required to take all process locks (ERTS_PROC_LOCKS_ALL).
+ * Thus, by holding at least one process lock (whichever one doesn't
+ * matter) you are guaranteed that the process won't exit until the
+ * lock you are holding has been released.
*
* Lock order:
* Process locks with low numeric values has to be locked before
@@ -215,6 +230,8 @@ void erts_lcnt_proc_lock_unaquire(erts_proc_lock_t *lock, ErtsProcLocks locks);
void erts_lcnt_proc_unlock(erts_proc_lock_t *lock, ErtsProcLocks locks);
void erts_lcnt_proc_trylock(erts_proc_lock_t *lock, ErtsProcLocks locks, int res);
+void erts_lcnt_enable_proc_lock_count(int enable);
+
#endif /* ERTS_ENABLE_LOCK_COUNT*/
@@ -260,12 +277,10 @@ typedef struct {
} u;
} erts_pix_lock_t;
-#define ERTS_PIX2PIXLOCKIX(PIX) \
- ((PIX) & ((1 << ERTS_PIX_LOCKS_BITS) - 1))
-#define ERTS_PIX2PIXLOCK(PIX) \
- (&erts_pix_locks[ERTS_PIX2PIXLOCKIX((PIX))])
#define ERTS_PID2PIXLOCK(PID) \
- ERTS_PIX2PIXLOCK(internal_pid_data((PID)))
+ (&erts_pix_locks[(internal_pid_data((PID)) & ((1 << ERTS_PIX_LOCKS_BITS) - 1))])
+
+#if ERTS_PROC_LOCK_OWN_IMPL
#if ERTS_PROC_LOCK_ATOMIC_IMPL
@@ -335,11 +350,13 @@ erts_proc_lock_flags_cmpxchg(erts_proc_lock_t *lck, ErtsProcLocks new,
#define ERTS_PROC_LOCK_FLGS_READ_(L) ((L)->flags)
#endif /* end no opt atomic ops */
+#endif /* ERTS_PROC_LOCK_OWN_IMPL */
extern erts_pix_lock_t erts_pix_locks[ERTS_NO_OF_PIX_LOCKS];
void erts_init_proc_lock(int cpus);
void erts_proc_lock_prepare_proc_lock_waiter(void);
+#if ERTS_PROC_LOCK_OWN_IMPL
void erts_proc_lock_failed(Process *,
erts_pix_lock_t *,
ErtsProcLocks,
@@ -347,6 +364,7 @@ void erts_proc_lock_failed(Process *,
void erts_proc_unlock_failed(Process *,
erts_pix_lock_t *,
ErtsProcLocks);
+#endif
ERTS_GLB_INLINE void erts_pix_lock(erts_pix_lock_t *);
ERTS_GLB_INLINE void erts_pix_unlock(erts_pix_lock_t *);
@@ -410,6 +428,7 @@ ERTS_GLB_INLINE int erts_lc_pix_lock_is_locked(erts_pix_lock_t *pixlck)
ERTS_GLB_INLINE ErtsProcLocks
erts_smp_proc_raw_trylock__(Process *p, ErtsProcLocks locks)
{
+#if ERTS_PROC_LOCK_OWN_IMPL
ErtsProcLocks expct_lflgs = 0;
while (1) {
@@ -429,8 +448,38 @@ erts_smp_proc_raw_trylock__(Process *p, ErtsProcLocks locks)
/* cmpxchg failed, try again (should be rare). */
expct_lflgs = lflgs;
}
-}
+#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
+
+ if (locks & ERTS_PROC_LOCK_MAIN)
+ if (erts_mtx_trylock(&p->lock.main) == EBUSY)
+ goto busy_main;
+ if (locks & ERTS_PROC_LOCK_LINK)
+ if (erts_mtx_trylock(&p->lock.link) == EBUSY)
+ goto busy_link;
+ if (locks & ERTS_PROC_LOCK_MSGQ)
+ if (erts_mtx_trylock(&p->lock.msgq) == EBUSY)
+ goto busy_msgq;
+ if (locks & ERTS_PROC_LOCK_STATUS)
+ if (erts_mtx_trylock(&p->lock.status) == EBUSY)
+ goto busy_status;
+
+ return 0;
+
+busy_status:
+ if (locks & ERTS_PROC_LOCK_MSGQ)
+ erts_mtx_unlock(&p->lock.msgq);
+busy_msgq:
+ if (locks & ERTS_PROC_LOCK_LINK)
+ erts_mtx_unlock(&p->lock.link);
+busy_link:
+ if (locks & ERTS_PROC_LOCK_MAIN)
+ erts_mtx_unlock(&p->lock.main);
+busy_main:
+
+ return EBUSY;
+#endif
+}
ERTS_GLB_INLINE void
#ifdef ERTS_ENABLE_LOCK_COUNT
@@ -444,10 +493,13 @@ erts_smp_proc_lock__(Process *p,
ErtsProcLocks locks)
#endif
{
+#if ERTS_PROC_LOCK_OWN_IMPL
+
ErtsProcLocks old_lflgs;
#if !ERTS_PROC_LOCK_ATOMIC_IMPL
erts_pix_lock(pix_lck);
#endif
+
#ifdef ERTS_ENABLE_LOCK_COUNT
erts_lcnt_proc_lock(&(p->lock), locks);
#endif
@@ -471,12 +523,14 @@ erts_smp_proc_lock__(Process *p,
erts_pix_unlock(pix_lck);
}
#endif
+
#ifdef ERTS_ENABLE_LOCK_COUNT
erts_lcnt_proc_lock_post_x(&(p->lock), locks, file, line);
#endif
#ifdef ERTS_ENABLE_LOCK_CHECK
erts_proc_lc_lock(p, locks);
#endif
+
#ifdef ERTS_PROC_LOCK_DEBUG
erts_proc_lock_op_debug(p, locks, 1);
#endif
@@ -484,6 +538,22 @@ erts_smp_proc_lock__(Process *p,
#if ERTS_PROC_LOCK_ATOMIC_IMPL
ETHR_COMPILER_BARRIER;
#endif
+
+#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
+ if (locks & ERTS_PROC_LOCK_MAIN)
+ erts_mtx_lock(&p->lock.main);
+ if (locks & ERTS_PROC_LOCK_LINK)
+ erts_mtx_lock(&p->lock.link);
+ if (locks & ERTS_PROC_LOCK_MSGQ)
+ erts_mtx_lock(&p->lock.msgq);
+ if (locks & ERTS_PROC_LOCK_STATUS)
+ erts_mtx_lock(&p->lock.status);
+
+#ifdef ERTS_PROC_LOCK_DEBUG
+ erts_proc_lock_op_debug(p, locks, 1);
+#endif
+
+#endif
}
ERTS_GLB_INLINE void
@@ -491,6 +561,7 @@ erts_smp_proc_unlock__(Process *p,
erts_pix_lock_t *pix_lck,
ErtsProcLocks locks)
{
+#if ERTS_PROC_LOCK_OWN_IMPL
ErtsProcLocks old_lflgs;
#if ERTS_PROC_LOCK_ATOMIC_IMPL
@@ -555,6 +626,23 @@ erts_smp_proc_unlock__(Process *p,
break;
}
+
+#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
+
+#ifdef ERTS_PROC_LOCK_DEBUG
+ erts_proc_lock_op_debug(p, locks, 0);
+#endif
+
+ if (locks & ERTS_PROC_LOCK_STATUS)
+ erts_mtx_unlock(&p->lock.status);
+ if (locks & ERTS_PROC_LOCK_MSGQ)
+ erts_mtx_unlock(&p->lock.msgq);
+ if (locks & ERTS_PROC_LOCK_LINK)
+ erts_mtx_unlock(&p->lock.link);
+ if (locks & ERTS_PROC_LOCK_MAIN)
+ erts_mtx_unlock(&p->lock.main);
+#endif
+
}
ERTS_GLB_INLINE int
@@ -562,6 +650,7 @@ erts_smp_proc_trylock__(Process *p,
erts_pix_lock_t *pix_lck,
ErtsProcLocks locks)
{
+#if ERTS_PROC_LOCK_OWN_IMPL
int res;
#ifdef ERTS_ENABLE_LOCK_CHECK
@@ -573,6 +662,7 @@ erts_smp_proc_trylock__(Process *p,
else
#endif
{
+
#if !ERTS_PROC_LOCK_ATOMIC_IMPL
erts_pix_lock(pix_lck);
#endif
@@ -611,8 +701,18 @@ erts_smp_proc_trylock__(Process *p,
#if ERTS_PROC_LOCK_ATOMIC_IMPL
ETHR_COMPILER_BARRIER;
#endif
-
return res;
+
+#elif ERTS_PROC_LOCK_RAW_MUTEX_IMPL
+ if (erts_smp_proc_raw_trylock__(p, locks) != 0)
+ return EBUSY;
+ else {
+#ifdef ERTS_PROC_LOCK_DEBUG
+ erts_proc_lock_op_debug(p, locks, 1);
+#endif
+ return 0;
+ }
+#endif
}
#ifdef ERTS_PROC_LOCK_DEBUG
@@ -711,44 +811,36 @@ erts_smp_proc_trylock(Process *p, ErtsProcLocks locks)
#endif
}
-
ERTS_GLB_INLINE void erts_smp_proc_inc_refc(Process *p)
{
#ifdef ERTS_SMP
- erts_pix_lock_t *pixlck = ERTS_PID2PIXLOCK(p->id);
- erts_pix_lock(pixlck);
- ERTS_LC_ASSERT(p->lock.refc > 0);
- p->lock.refc++;
- erts_pix_unlock(pixlck);
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ erts_aint32_t refc = erts_atomic32_inc_read_nob(&p->lock.refc);
+ ERTS_SMP_LC_ASSERT(refc > 1);
+#else
+ erts_atomic32_inc_nob(&p->lock.refc);
+#endif
#endif
}
ERTS_GLB_INLINE void erts_smp_proc_dec_refc(Process *p)
{
#ifdef ERTS_SMP
- Process *fp;
- erts_pix_lock_t *pixlck = ERTS_PID2PIXLOCK(p->id);
- erts_pix_lock(pixlck);
- ERTS_LC_ASSERT(p->lock.refc > 0);
- fp = --p->lock.refc == 0 ? p : NULL;
- erts_pix_unlock(pixlck);
- if (fp)
- erts_free_proc(fp);
+ erts_aint32_t refc = erts_atomic32_dec_read_nob(&p->lock.refc);
+ ERTS_SMP_LC_ASSERT(refc >= 0);
+ if (refc == 0)
+ erts_free_proc(p);
#endif
}
-ERTS_GLB_INLINE void erts_smp_proc_add_refc(Process *p, Sint32 refc)
+ERTS_GLB_INLINE void erts_smp_proc_add_refc(Process *p, Sint32 add_refc)
{
#ifdef ERTS_SMP
- Process *fp;
- erts_pix_lock_t *pixlck = ERTS_PID2PIXLOCK(p->id);
- erts_pix_lock(pixlck);
- ERTS_LC_ASSERT(p->lock.refc > 0);
- p->lock.refc += refc;
- fp = p->lock.refc == 0 ? p : NULL;
- erts_pix_unlock(pixlck);
- if (fp)
- erts_free_proc(fp);
+ erts_aint32_t refc = erts_atomic32_add_read_nob(&p->lock.refc,
+ (erts_aint32_t) add_refc);
+ ERTS_SMP_LC_ASSERT(refc >= 0);
+ if (refc == 0)
+ erts_free_proc(p);
#endif
}
@@ -756,6 +848,7 @@ ERTS_GLB_INLINE void erts_smp_proc_add_refc(Process *p, Sint32 refc)
#ifdef ERTS_SMP
void erts_proc_lock_init(Process *);
+void erts_proc_lock_fin(Process *);
void erts_proc_safelock(Process *a_proc,
ErtsProcLocks a_have_locks,
ErtsProcLocks a_need_locks,
@@ -788,211 +881,75 @@ extern const Process erts_proc_lock_busy;
#define erts_pid2proc(PROC, HL, PID, NL) \
erts_pid2proc_opt((PROC), (HL), (PID), (NL), 0)
-ERTS_GLB_INLINE Process *
-erts_pid2proc_opt(Process *, ErtsProcLocks, Eterm, ErtsProcLocks, int);
-#ifdef ERTS_SMP
-void
-erts_pid2proc_safelock(Process *c_p,
- ErtsProcLocks c_p_have_locks,
- Process **proc,
- ErtsProcLocks need_locks,
- erts_pix_lock_t *pix_lock,
- int flags);
-ERTS_GLB_INLINE Process *erts_pid2proc_unlocked_opt(Eterm pid, int flags);
-#define erts_pid2proc_unlocked(PID) erts_pid2proc_unlocked_opt((PID), 0)
-#else
-#define erts_pid2proc_unlocked_opt(PID, FLGS) \
- erts_pid2proc_opt(NULL, 0, (PID), 0, FLGS)
-#define erts_pid2proc_unlocked(PID) erts_pid2proc_opt(NULL, 0, (PID), 0, 0)
+ERTS_GLB_INLINE Process *erts_pix2proc(int ix);
+ERTS_GLB_INLINE Process *erts_proc_lookup_raw(Eterm pid);
+ERTS_GLB_INLINE Process *erts_proc_lookup(Eterm pid);
+
+#ifndef ERTS_SMP
+ERTS_GLB_INLINE
#endif
+Process *erts_pid2proc_opt(Process *, ErtsProcLocks, Eterm, ErtsProcLocks, int);
#if ERTS_GLB_INLINE_INCL_FUNC_DEF
-ERTS_GLB_INLINE Process *
-#ifdef ERTS_SMP
-erts_pid2proc_unlocked_opt(Eterm pid, int flags)
-#else
-erts_pid2proc_opt(Process *c_p_unused,
- ErtsProcLocks c_p_have_locks_unused,
- Eterm pid,
- ErtsProcLocks pid_need_locks_unused,
- int flags)
-#endif
+ERTS_GLB_INLINE Process *erts_pix2proc(int ix)
{
- Uint pix;
Process *proc;
+ ASSERT(0 <= ix && ix < erts_proc.max);
+ proc = (Process *) erts_smp_atomic_read_nob(&erts_proc.tab[ix]);
+ return proc == ERTS_PROC_LOCK_BUSY ? NULL : proc;
+}
+
+ERTS_GLB_INLINE Process *erts_proc_lookup_raw(Eterm pid)
+{
+ Process *proc;
+ int pix;
+
+ /*
+ * In SMP case: Only scheduler threads are allowed
+ * to use this function. Other threads need to
+ * atomicaly increment refc at lookup, i.e., use
+ * erts_pid2proc_opt() with ERTS_P2P_FLG_SMP_INC_REFC.
+ */
+ ERTS_SMP_LC_ASSERT(erts_get_scheduler_id());
if (is_not_internal_pid(pid))
return NULL;
pix = internal_pid_index(pid);
- if(pix >= erts_max_processes)
+
+ proc = (Process *) erts_smp_atomic_read_ddrb(&erts_proc.tab[pix]);
+
+ if (proc && proc->id != pid)
return NULL;
- proc = process_tab[pix];
- if (proc) {
- if (proc->id != pid
- || (!(flags & ERTS_P2P_FLG_ALLOW_OTHER_X)
- && proc->status == P_EXITING))
- proc = NULL;
- }
+
return proc;
}
-#ifdef ERTS_SMP
+ERTS_GLB_INLINE Process *erts_proc_lookup(Eterm pid)
+{
+ Process *proc = erts_proc_lookup_raw(pid);
+ if (proc && ERTS_PROC_IS_EXITING(proc))
+ return NULL;
+ return proc;
+}
+#ifndef ERTS_SMP
ERTS_GLB_INLINE Process *
-erts_pid2proc_opt(Process *c_p,
- ErtsProcLocks c_p_have_locks,
+erts_pid2proc_opt(Process *c_p_unused,
+ ErtsProcLocks c_p_have_locks_unused,
Eterm pid,
- ErtsProcLocks pid_need_locks,
+ ErtsProcLocks pid_need_locks_unused,
int flags)
{
- erts_pix_lock_t *pix_lock;
- ErtsProcLocks need_locks;
- Uint pix;
- Process *proc;
-#ifdef ERTS_ENABLE_LOCK_COUNT
- ErtsProcLocks lcnt_locks;
-#endif
-
-#ifdef ERTS_ENABLE_LOCK_CHECK
- if (c_p) {
- ErtsProcLocks might_unlock = c_p_have_locks & pid_need_locks;
- if (might_unlock)
- erts_proc_lc_might_unlock(c_p, might_unlock);
- }
-#endif
- if (is_not_internal_pid(pid)) {
- proc = NULL;
- goto done;
- }
- pix = internal_pid_index(pid);
- if(pix >= erts_max_processes) {
- proc = NULL;
- goto done;
- }
-
- ERTS_LC_ASSERT((pid_need_locks & ERTS_PROC_LOCKS_ALL) == pid_need_locks);
- need_locks = pid_need_locks;
-
- pix_lock = ERTS_PIX2PIXLOCK(pix);
-
- if (c_p && c_p->id == pid) {
- ASSERT(c_p->id != ERTS_INVALID_PID);
- ASSERT(c_p == process_tab[pix]);
- if (!(flags & ERTS_P2P_FLG_ALLOW_OTHER_X) && c_p->is_exiting) {
- proc = NULL;
- goto done;
- }
- need_locks &= ~c_p_have_locks;
- if (!need_locks) {
- proc = c_p;
- erts_pix_lock(pix_lock);
- if (flags & ERTS_P2P_FLG_SMP_INC_REFC)
- proc->lock.refc++;
- erts_pix_unlock(pix_lock);
- goto done;
- }
- }
-
- erts_pix_lock(pix_lock);
-
- proc = process_tab[pix];
- if (proc) {
- if (proc->id != pid || (!(flags & ERTS_P2P_FLG_ALLOW_OTHER_X)
- && ERTS_PROC_IS_EXITING(proc))) {
- proc = NULL;
- }
- else if (!need_locks) {
- if (flags & ERTS_P2P_FLG_SMP_INC_REFC)
- proc->lock.refc++;
- }
- else {
- int busy;
-
-#ifdef ERTS_ENABLE_LOCK_COUNT
- lcnt_locks = need_locks;
- if (!(flags & ERTS_P2P_FLG_TRY_LOCK)) {
- erts_lcnt_proc_lock(&proc->lock, need_locks);
- }
-#endif
-
-#ifdef ERTS_ENABLE_LOCK_CHECK
- /* Make sure erts_pid2proc_safelock() is enough to handle
- a potential lock order violation situation... */
- busy = erts_proc_lc_trylock_force_busy(proc, need_locks);
- if (!busy)
-#endif
- {
- /* Try a quick trylock to grab all the locks we need. */
- busy = (int) erts_smp_proc_raw_trylock__(proc, need_locks);
-#ifdef ERTS_ENABLE_LOCK_CHECK
- erts_proc_lc_trylock(proc, need_locks, !busy);
-#endif
-#ifdef ERTS_PROC_LOCK_DEBUG
- if (!busy)
- erts_proc_lock_op_debug(proc, need_locks, 1);
-#endif
- }
-
-#ifdef ERTS_ENABLE_LOCK_COUNT
- if (flags & ERTS_P2P_FLG_TRY_LOCK) {
- if (busy) {
- erts_lcnt_proc_trylock(&proc->lock, need_locks, EBUSY);
- } else {
- erts_lcnt_proc_trylock(&proc->lock, need_locks, 0);
- }
- }
-#endif
- if (!busy) {
- if (flags & ERTS_P2P_FLG_SMP_INC_REFC)
- proc->lock.refc++;
-#ifdef ERTS_ENABLE_LOCK_COUNT
- /* all is great */
- if (!(flags & ERTS_P2P_FLG_TRY_LOCK)) {
- erts_lcnt_proc_lock_post_x(&proc->lock, lcnt_locks, __FILE__, __LINE__);
- }
-#endif
- }
- else {
- if (flags & ERTS_P2P_FLG_TRY_LOCK)
- proc = ERTS_PROC_LOCK_BUSY;
- else {
- if (flags & ERTS_P2P_FLG_SMP_INC_REFC)
- proc->lock.refc++;
-#ifdef ERTS_ENABLE_LOCK_COUNT
- erts_lcnt_proc_lock_unaquire(&proc->lock, lcnt_locks);
-#endif
- erts_pid2proc_safelock(c_p,
- c_p_have_locks,
- &proc,
- pid_need_locks,
- pix_lock,
- flags);
- }
- }
- }
- }
-
- erts_pix_unlock(pix_lock);
-#ifdef ERTS_PROC_LOCK_DEBUG
- ERTS_LC_ASSERT(!proc
- || proc == ERTS_PROC_LOCK_BUSY
- || (pid_need_locks ==
- (ERTS_PROC_LOCK_FLGS_READ_(&proc->lock)
- & pid_need_locks)));
-#endif
-
-
- done:
-
-#if ERTS_PROC_LOCK_ATOMIC_IMPL
- ETHR_COMPILER_BARRIER;
-#endif
-
- return proc;
+ Process *proc = erts_proc_lookup_raw(pid);
+ return ((!(flags & ERTS_P2P_FLG_ALLOW_OTHER_X)
+ && proc
+ && ERTS_PROC_IS_EXITING(proc))
+ ? NULL
+ : proc);
}
-#endif /* ERTS_SMP */
+#endif /* !ERTS_SMP */
#endif /* #if ERTS_GLB_INLINE_INCL_FUNC_DEF */
diff --git a/erts/emulator/beam/erl_sched_spec_pre_alloc.c b/erts/emulator/beam/erl_sched_spec_pre_alloc.c
index a7ccea7403..a490aec734 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. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2012. 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
@@ -116,54 +116,84 @@ erts_sspa_create(size_t blk_sz, int pa_size)
return data;
}
-static ERTS_INLINE erts_aint_t
+static ERTS_INLINE void
enqueue_remote_managed_thread(erts_sspa_chunk_header_t *chdr,
erts_sspa_blk_t *this,
- int want_last)
+ int cinit)
{
- erts_aint_t ilast, itmp;
+ erts_aint_t itmp;
+ erts_sspa_blk_t *enq;
erts_atomic_init_nob(&this->next_atmc, ERTS_AINT_NULL);
-
/* Enqueue at end of list... */
- ilast = erts_atomic_read_nob(&chdr->tail.data.last);
- while (1) {
- erts_sspa_blk_t *last = (erts_sspa_blk_t *) ilast;
- itmp = erts_atomic_cmpxchg_mb(&last->next_atmc,
- (erts_aint_t) this,
- ERTS_AINT_NULL);
- if (itmp == ERTS_AINT_NULL)
- break;
- ilast = itmp;
+ enq = (erts_sspa_blk_t *) erts_atomic_read_nob(&chdr->tail.data.last);
+ itmp = erts_atomic_cmpxchg_relb(&enq->next_atmc,
+ (erts_aint_t) this,
+ ERTS_AINT_NULL);
+ if (itmp == ERTS_AINT_NULL) {
+ /* We are required to move last pointer */
+#ifdef DEBUG
+ ASSERT(ERTS_AINT_NULL == erts_atomic_read_nob(&this->next_atmc));
+ ASSERT(((erts_aint_t) enq)
+ == erts_atomic_xchg_relb(&chdr->tail.data.last,
+ (erts_aint_t) this));
+#else
+ erts_atomic_set_relb(&chdr->tail.data.last, (erts_aint_t) this);
+#endif
}
+ else {
+ /*
+ * We *need* to insert element somewhere in between the
+ * last element we read earlier and the actual last element.
+ */
+ int i = cinit;
- /* Move last pointer forward... */
- while (1) {
- erts_aint_t itmp;
- if (want_last) {
- if (erts_atomic_read_rb(&this->next_atmc) != ERTS_AINT_NULL) {
- /* Someone else will move it forward */
- return erts_atomic_read_nob(&chdr->tail.data.last);
+ while (1) {
+ erts_aint_t itmp2;
+ erts_atomic_set_nob(&this->next_atmc, itmp);
+ itmp2 = erts_atomic_cmpxchg_relb(&enq->next_atmc,
+ (erts_aint_t) this,
+ itmp);
+ if (itmp == itmp2)
+ break; /* inserted this */
+ if ((i & 1) == 0)
+ itmp = itmp2;
+ else {
+ enq = (erts_sspa_blk_t *) itmp;
+ itmp = erts_atomic_read_acqb(&enq->next_atmc);
+ ASSERT(itmp != ERTS_AINT_NULL);
}
+ i++;
}
- else {
- if (erts_atomic_read_nob(&this->next_atmc) != ERTS_AINT_NULL) {
- /* Someone else will move it forward */
- return ERTS_AINT_NULL;
- }
+ }
+}
+
+static ERTS_INLINE erts_aint_t
+check_insert_marker(erts_sspa_chunk_header_t *chdr, erts_aint_t ilast)
+{
+ if (!chdr->head.used_marker
+ && chdr->head.unref_end == (erts_sspa_blk_t *) ilast) {
+ erts_aint_t itmp;
+ erts_sspa_blk_t *last = (erts_sspa_blk_t *) ilast;
+
+ erts_atomic_init_nob(&chdr->tail.data.marker.next_atmc, ERTS_AINT_NULL);
+ itmp = erts_atomic_cmpxchg_relb(&last->next_atmc,
+ (erts_aint_t) &chdr->tail.data.marker,
+ ERTS_AINT_NULL);
+ if (itmp == ERTS_AINT_NULL) {
+ ilast = (erts_aint_t) &chdr->tail.data.marker;
+ chdr->head.used_marker = !0;
+ erts_atomic_set_relb(&chdr->tail.data.last, ilast);
}
- itmp = erts_atomic_cmpxchg_mb(&chdr->tail.data.last,
- (erts_aint_t) this,
- ilast);
- if (ilast == itmp)
- return want_last ? (erts_aint_t) this : ERTS_AINT_NULL;
- ilast = itmp;
}
+ return ilast;
}
void
-erts_sspa_remote_free(erts_sspa_chunk_header_t *chdr, erts_sspa_blk_t *blk)
+erts_sspa_remote_free(erts_sspa_chunk_header_t *chdr,
+ erts_sspa_blk_t *blk,
+ int cinit)
{
int um_refc_ix = 0;
int managed_thread = erts_thr_progress_is_managed_thread();
@@ -180,7 +210,7 @@ erts_sspa_remote_free(erts_sspa_chunk_header_t *chdr, erts_sspa_blk_t *blk)
}
}
- (void) enqueue_remote_managed_thread(chdr, blk, 0);
+ enqueue_remote_managed_thread(chdr, blk, cinit);
if (!managed_thread)
erts_atomic_dec_relb(&chdr->tail.data.um_refc[um_refc_ix]);
@@ -208,27 +238,19 @@ fetch_remote(erts_sspa_chunk_header_t *chdr, int max)
int um_refc_ix;
chdr->head.next.thr_progress_reached = 1;
um_refc_ix = chdr->head.next.um_refc_ix;
- if (erts_atomic_read_acqb(&chdr->tail.data.um_refc[um_refc_ix]) == 0) {
+ if (erts_atomic_read_nob(&chdr->tail.data.um_refc[um_refc_ix]) == 0) {
+
+ ETHR_MEMBAR(ETHR_LoadLoad|ETHR_LoadStore);
/* Move unreferenced end pointer forward... */
chdr->head.unref_end = chdr->head.next.unref_end;
- if (!chdr->head.used_marker
- && chdr->head.unref_end == (erts_sspa_blk_t *) ilast) {
- /* Need to equeue marker */
- chdr->head.used_marker = 1;
- ilast = enqueue_remote_managed_thread(chdr,
- &chdr->tail.data.marker,
- 1);
- }
+ ilast = check_insert_marker(chdr, ilast);
- if (chdr->head.unref_end == (erts_sspa_blk_t *) ilast)
- ERTS_THR_MEMORY_BARRIER;
- else {
+ if (chdr->head.unref_end != (erts_sspa_blk_t *) ilast) {
chdr->head.next.unref_end = (erts_sspa_blk_t *) ilast;
- ERTS_THR_MEMORY_BARRIER;
- chdr->head.next.thr_progress = erts_thr_progress_later();
+ chdr->head.next.thr_progress = erts_thr_progress_later(NULL);
erts_atomic32_set_relb(&chdr->tail.data.um_refc_ix,
um_refc_ix);
chdr->head.next.um_refc_ix = um_refc_ix == 0 ? 1 : 0;
diff --git a/erts/emulator/beam/erl_sched_spec_pre_alloc.h b/erts/emulator/beam/erl_sched_spec_pre_alloc.h
index d36066c399..9144c73acd 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. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2012. 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
@@ -142,7 +142,8 @@ check_local_list(erts_sspa_chunk_header_t *chdr)
erts_sspa_data_t *erts_sspa_create(size_t blk_sz,
int pa_size);
void erts_sspa_remote_free(erts_sspa_chunk_header_t *chdr,
- erts_sspa_blk_t *blk);
+ erts_sspa_blk_t *blk,
+ int cinit);
erts_sspa_blk_t *erts_sspa_process_remote_frees(erts_sspa_chunk_header_t *chdr,
erts_sspa_blk_t *old_res);
@@ -216,7 +217,7 @@ erts_sspa_free(erts_sspa_data_t *data, int cix, char *cblk)
chdr = &chnk->aligned.header;
if (chnk_cix != cix) {
/* Remote chunk */
- erts_sspa_remote_free(chdr, blk);
+ erts_sspa_remote_free(chdr, blk, chnk_cix - cix);
}
else {
/* Local chunk */
diff --git a/erts/emulator/beam/erl_smp.h b/erts/emulator/beam/erl_smp.h
index 63179dfad4..a32e9d9d7c 100644
--- a/erts/emulator/beam/erl_smp.h
+++ b/erts/emulator/beam/erl_smp.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2012. 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
@@ -61,6 +61,11 @@ typedef erts_spinlock_t erts_smp_spinlock_t;
typedef erts_rwlock_t erts_smp_rwlock_t;
void erts_thr_fatal_error(int, char *); /* implemented in erl_init.c */
+#define ERTS_SMP_MEMORY_BARRIER ERTS_THR_MEMORY_BARRIER
+#define ERTS_SMP_WRITE_MEMORY_BARRIER ERTS_THR_WRITE_MEMORY_BARRIER
+#define ERTS_SMP_READ_MEMORY_BARRIER ERTS_THR_READ_MEMORY_BARRIER
+#define ERTS_SMP_DATA_DEPENDENCY_READ_MEMORY_BARRIER ERTS_THR_DATA_DEPENDENCY_READ_MEMORY_BARRIER
+
#else /* #ifdef ERTS_SMP */
#define ERTS_SMP_THR_OPTS_DEFAULT_INITER {0}
@@ -95,6 +100,11 @@ typedef struct { int gcc_is_buggy; } erts_smp_spinlock_t;
typedef struct { int gcc_is_buggy; } erts_smp_rwlock_t;
#endif
+#define ERTS_SMP_MEMORY_BARRIER
+#define ERTS_SMP_WRITE_MEMORY_BARRIER
+#define ERTS_SMP_READ_MEMORY_BARRIER
+#define ERTS_SMP_DATA_DEPENDENCY_READ_MEMORY_BARRIER
+
#endif /* #ifdef ERTS_SMP */
ERTS_GLB_INLINE void erts_smp_thr_init(erts_smp_thr_init_data_t *id);
@@ -206,13 +216,8 @@ ERTS_GLB_INLINE void erts_smp_thr_sigwait(const sigset_t *set, int *sig);
#endif /* #ifdef ERTS_THR_HAVE_SIG_FUNCS */
/*
- * Functions implementing atomic operations with with no (nob),
- * full (mb), acquire (acqb), release (relb), read (rb), and
- * write (wb) memory barriers.
- *
- * If SMP support has been disabled, they are mapped to functions
- * that performs the same operation, but aren't atomic and don't
- * imply memory barriers.
+ * See "Documentation of atomics and memory barriers" at the top
+ * of erl_threads.h for info on atomics.
*/
#ifdef ERTS_SMP
@@ -239,6 +244,11 @@ ERTS_GLB_INLINE void erts_smp_thr_sigwait(const sigset_t *set, int *sig);
#define erts_smp_dw_atomic_read_relb erts_dw_atomic_read_relb
#define erts_smp_dw_atomic_cmpxchg_relb erts_dw_atomic_cmpxchg_relb
+#define erts_smp_dw_atomic_init_ddrb erts_dw_atomic_init_ddrb
+#define erts_smp_dw_atomic_set_ddrb erts_dw_atomic_set_ddrb
+#define erts_smp_dw_atomic_read_ddrb erts_dw_atomic_read_ddrb
+#define erts_smp_dw_atomic_cmpxchg_ddrb erts_dw_atomic_cmpxchg_ddrb
+
#define erts_smp_dw_atomic_init_rb erts_dw_atomic_init_rb
#define erts_smp_dw_atomic_set_rb erts_dw_atomic_set_rb
#define erts_smp_dw_atomic_read_rb erts_dw_atomic_read_rb
@@ -307,6 +317,20 @@ ERTS_GLB_INLINE void erts_smp_thr_sigwait(const sigset_t *set, int *sig);
#define erts_smp_atomic_xchg_relb erts_atomic_xchg_relb
#define erts_smp_atomic_cmpxchg_relb erts_atomic_cmpxchg_relb
+#define erts_smp_atomic_init_ddrb erts_atomic_init_ddrb
+#define erts_smp_atomic_set_ddrb erts_atomic_set_ddrb
+#define erts_smp_atomic_read_ddrb erts_atomic_read_ddrb
+#define erts_smp_atomic_inc_read_ddrb erts_atomic_inc_read_ddrb
+#define erts_smp_atomic_dec_read_ddrb erts_atomic_dec_read_ddrb
+#define erts_smp_atomic_inc_ddrb erts_atomic_inc_ddrb
+#define erts_smp_atomic_dec_ddrb erts_atomic_dec_ddrb
+#define erts_smp_atomic_add_read_ddrb erts_atomic_add_read_ddrb
+#define erts_smp_atomic_add_ddrb erts_atomic_add_ddrb
+#define erts_smp_atomic_read_bor_ddrb erts_atomic_read_bor_ddrb
+#define erts_smp_atomic_read_band_ddrb erts_atomic_read_band_ddrb
+#define erts_smp_atomic_xchg_ddrb erts_atomic_xchg_ddrb
+#define erts_smp_atomic_cmpxchg_ddrb erts_atomic_cmpxchg_ddrb
+
#define erts_smp_atomic_init_rb erts_atomic_init_rb
#define erts_smp_atomic_set_rb erts_atomic_set_rb
#define erts_smp_atomic_read_rb erts_atomic_read_rb
@@ -393,6 +417,20 @@ ERTS_GLB_INLINE void erts_smp_thr_sigwait(const sigset_t *set, int *sig);
#define erts_smp_atomic32_xchg_relb erts_atomic32_xchg_relb
#define erts_smp_atomic32_cmpxchg_relb erts_atomic32_cmpxchg_relb
+#define erts_smp_atomic32_init_ddrb erts_atomic32_init_ddrb
+#define erts_smp_atomic32_set_ddrb erts_atomic32_set_ddrb
+#define erts_smp_atomic32_read_ddrb erts_atomic32_read_ddrb
+#define erts_smp_atomic32_inc_read_ddrb erts_atomic32_inc_read_ddrb
+#define erts_smp_atomic32_dec_read_ddrb erts_atomic32_dec_read_ddrb
+#define erts_smp_atomic32_inc_ddrb erts_atomic32_inc_ddrb
+#define erts_smp_atomic32_dec_ddrb erts_atomic32_dec_ddrb
+#define erts_smp_atomic32_add_read_ddrb erts_atomic32_add_read_ddrb
+#define erts_smp_atomic32_add_ddrb erts_atomic32_add_ddrb
+#define erts_smp_atomic32_read_bor_ddrb erts_atomic32_read_bor_ddrb
+#define erts_smp_atomic32_read_band_ddrb erts_atomic32_read_band_ddrb
+#define erts_smp_atomic32_xchg_ddrb erts_atomic32_xchg_ddrb
+#define erts_smp_atomic32_cmpxchg_ddrb erts_atomic32_cmpxchg_ddrb
+
#define erts_smp_atomic32_init_rb erts_atomic32_init_rb
#define erts_smp_atomic32_set_rb erts_atomic32_set_rb
#define erts_smp_atomic32_read_rb erts_atomic32_read_rb
@@ -445,6 +483,11 @@ ERTS_GLB_INLINE void erts_smp_thr_sigwait(const sigset_t *set, int *sig);
#define erts_smp_dw_atomic_read_relb erts_no_dw_atomic_read
#define erts_smp_dw_atomic_cmpxchg_relb erts_no_dw_atomic_cmpxchg
+#define erts_smp_dw_atomic_init_ddrb erts_no_dw_atomic_init
+#define erts_smp_dw_atomic_set_ddrb erts_no_dw_atomic_set
+#define erts_smp_dw_atomic_read_ddrb erts_no_dw_atomic_read
+#define erts_smp_dw_atomic_cmpxchg_ddrb erts_no_dw_atomic_cmpxchg
+
#define erts_smp_dw_atomic_init_rb erts_no_dw_atomic_init
#define erts_smp_dw_atomic_set_rb erts_no_dw_atomic_set
#define erts_smp_dw_atomic_read_rb erts_no_dw_atomic_read
@@ -513,6 +556,20 @@ ERTS_GLB_INLINE void erts_smp_thr_sigwait(const sigset_t *set, int *sig);
#define erts_smp_atomic_xchg_relb erts_no_atomic_xchg
#define erts_smp_atomic_cmpxchg_relb erts_no_atomic_cmpxchg
+#define erts_smp_atomic_init_ddrb erts_no_atomic_set
+#define erts_smp_atomic_set_ddrb erts_no_atomic_set
+#define erts_smp_atomic_read_ddrb erts_no_atomic_read
+#define erts_smp_atomic_inc_read_ddrb erts_no_atomic_inc_read
+#define erts_smp_atomic_dec_read_ddrb erts_no_atomic_dec_read
+#define erts_smp_atomic_inc_ddrb erts_no_atomic_inc
+#define erts_smp_atomic_dec_ddrb erts_no_atomic_dec
+#define erts_smp_atomic_add_read_ddrb erts_no_atomic_add_read
+#define erts_smp_atomic_add_ddrb erts_no_atomic_add
+#define erts_smp_atomic_read_bor_ddrb erts_no_atomic_read_bor
+#define erts_smp_atomic_read_band_ddrb erts_no_atomic_read_band
+#define erts_smp_atomic_xchg_ddrb erts_no_atomic_xchg
+#define erts_smp_atomic_cmpxchg_ddrb erts_no_atomic_cmpxchg
+
#define erts_smp_atomic_init_rb erts_no_atomic_set
#define erts_smp_atomic_set_rb erts_no_atomic_set
#define erts_smp_atomic_read_rb erts_no_atomic_read
@@ -599,6 +656,20 @@ ERTS_GLB_INLINE void erts_smp_thr_sigwait(const sigset_t *set, int *sig);
#define erts_smp_atomic32_xchg_relb erts_no_atomic32_xchg
#define erts_smp_atomic32_cmpxchg_relb erts_no_atomic32_cmpxchg
+#define erts_smp_atomic32_init_ddrb erts_no_atomic32_set
+#define erts_smp_atomic32_set_ddrb erts_no_atomic32_set
+#define erts_smp_atomic32_read_ddrb erts_no_atomic32_read
+#define erts_smp_atomic32_inc_read_ddrb erts_no_atomic32_inc_read
+#define erts_smp_atomic32_dec_read_ddrb erts_no_atomic32_dec_read
+#define erts_smp_atomic32_inc_ddrb erts_no_atomic32_inc
+#define erts_smp_atomic32_dec_ddrb erts_no_atomic32_dec
+#define erts_smp_atomic32_add_read_ddrb erts_no_atomic32_add_read
+#define erts_smp_atomic32_add_ddrb erts_no_atomic32_add
+#define erts_smp_atomic32_read_bor_ddrb erts_no_atomic32_read_bor
+#define erts_smp_atomic32_read_band_ddrb erts_no_atomic32_read_band
+#define erts_smp_atomic32_xchg_ddrb erts_no_atomic32_xchg
+#define erts_smp_atomic32_cmpxchg_ddrb erts_no_atomic32_cmpxchg
+
#define erts_smp_atomic32_init_rb erts_no_atomic32_set
#define erts_smp_atomic32_set_rb erts_no_atomic32_set
#define erts_smp_atomic32_read_rb erts_no_atomic32_read
diff --git a/erts/emulator/beam/erl_term.c b/erts/emulator/beam/erl_term.c
index f77e8b798f..bf7774f882 100644
--- a/erts/emulator/beam/erl_term.c
+++ b/erts/emulator/beam/erl_term.c
@@ -105,7 +105,7 @@ unsigned tag_val_def(Wterm x)
break;
}
}
- sprintf(msg, "tag_val_def: %#lx", (unsigned long) x);
+ erts_snprintf(msg, sizeof(msg), "tag_val_def: %#lx", (unsigned long) x);
et_abort(msg, file, line);
#undef file
#undef line
diff --git a/erts/emulator/beam/erl_thr_progress.c b/erts/emulator/beam/erl_thr_progress.c
index 75f8209c3b..88524bdd4c 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. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2012. 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
@@ -33,10 +33,11 @@
* This module keeps track of the progress of a set of managed threads. Only
* threads that behave well can be allowed to be managed. A managed thread
* should update its thread progress frequently. Currently only scheduler
- * threads and the aux_thread are managed threads. We typically do not want
- * any async threads as managed threads since they cannot guarantee a
- * frequent update of thread progress, since they execute user implemented
- * driver code.
+ * threads, the system-message-dispatcher threads, and the aux-thread are
+ * managed threads. We typically do not want any async threads as managed
+ * threads since they cannot guarantee a frequent update of thread progress,
+ * since they execute user implemented driver code that is assumed to be
+ * time consuming.
*
* erts_thr_progress_current() returns the global current thread progress
* value of managed threads. I.e., the latest progress value that all
@@ -112,8 +113,10 @@
*
* On 32-bit systems we therefore need a double word atomic.
*/
-
+#undef read_acqb
#define read_acqb erts_thr_prgr_read_acqb__
+#undef read_nob
+#define read_nob erts_thr_prgr_read_nob__
#ifdef ARCH_64
@@ -129,12 +132,6 @@ set_nob(ERTS_THR_PRGR_ATOMIC *atmc, ErtsThrPrgrVal val)
erts_atomic_set_nob(atmc, val);
}
-static ERTS_INLINE ErtsThrPrgrVal
-read_nob(ERTS_THR_PRGR_ATOMIC *atmc)
-{
- return (ErtsThrPrgrVal) erts_atomic_read_nob(atmc);
-}
-
static ERTS_INLINE void
init_nob(ERTS_THR_PRGR_ATOMIC *atmc, ErtsThrPrgrVal val)
{
@@ -143,52 +140,44 @@ init_nob(ERTS_THR_PRGR_ATOMIC *atmc, ErtsThrPrgrVal val)
#else
-#undef dw_sint_to_val
-#define dw_sint_to_val erts_thr_prgr_dw_sint_to_val__
+#undef dw_aint_to_val
+#define dw_aint_to_val erts_thr_prgr_dw_aint_to_val__
static void
-val_to_dw_sint(ethr_dw_sint_t *dw_sint, ErtsThrPrgrVal val)
+val_to_dw_aint(erts_dw_aint_t *dw_aint, ErtsThrPrgrVal val)
{
#ifdef ETHR_SU_DW_NAINT_T__
- dw_sint->dw_sint = (ETHR_SU_DW_NAINT_T__) val;
+ dw_aint->dw_sint = (ETHR_SU_DW_NAINT_T__) val;
#else
- dw_sint->sint[ETHR_DW_SINT_LOW_WORD]
- = (ethr_sint_t) (val & 0xffffffff);
- dw_sint->sint[ETHR_DW_SINT_HIGH_WORD]
- = (ethr_sint_t) ((val >> 32) & 0xffffffff);
+ dw_aint->sint[ERTS_DW_AINT_LOW_WORD]
+ = (erts_aint_t) (val & 0xffffffff);
+ dw_aint->sint[ERTS_DW_AINT_HIGH_WORD]
+ = (erts_aint_t) ((val >> 32) & 0xffffffff);
#endif
}
static ERTS_INLINE void
set_mb(ERTS_THR_PRGR_ATOMIC *atmc, ErtsThrPrgrVal val)
{
- ethr_dw_sint_t dw_sint;
- val_to_dw_sint(&dw_sint, val);
- erts_dw_atomic_set_mb(atmc, &dw_sint);
+ erts_dw_aint_t dw_aint;
+ val_to_dw_aint(&dw_aint, val);
+ erts_dw_atomic_set_mb(atmc, &dw_aint);
}
static ERTS_INLINE void
set_nob(ERTS_THR_PRGR_ATOMIC *atmc, ErtsThrPrgrVal val)
{
- ethr_dw_sint_t dw_sint;
- val_to_dw_sint(&dw_sint, val);
- erts_dw_atomic_set_nob(atmc, &dw_sint);
-}
-
-static ERTS_INLINE ErtsThrPrgrVal
-read_nob(ERTS_THR_PRGR_ATOMIC *atmc)
-{
- ethr_dw_sint_t dw_sint;
- erts_dw_atomic_read_nob(atmc, &dw_sint);
- return erts_thr_prgr_dw_sint_to_val__(&dw_sint);
+ erts_dw_aint_t dw_aint;
+ val_to_dw_aint(&dw_aint, val);
+ erts_dw_atomic_set_nob(atmc, &dw_aint);
}
static ERTS_INLINE void
init_nob(ERTS_THR_PRGR_ATOMIC *atmc, ErtsThrPrgrVal val)
{
- ethr_dw_sint_t dw_sint;
- val_to_dw_sint(&dw_sint, val);
- erts_dw_atomic_init_nob(atmc, &dw_sint);
+ erts_dw_aint_t dw_aint;
+ val_to_dw_aint(&dw_aint, val);
+ erts_dw_atomic_init_nob(atmc, &dw_aint);
}
#endif
@@ -902,16 +891,16 @@ has_reached_wakeup(ErtsThrPrgrVal wakeup)
ErtsThrPrgrVal limit;
/*
* erts_thr_progress_later() returns values which are
- * equal to 'current + 2'. That is, users should never
- * get a hold of values larger than that.
+ * equal to 'current + 2', or 'current + 3'. That is, users
+ * should never get a hold of values larger than that.
*
- * That is, valid values are values less than 'current + 3'.
+ * That is, valid values are values less than 'current + 4'.
*
* Values larger than this won't work with the wakeup
* algorithm.
*/
- limit = current + 3;
+ limit = current + 4;
if (limit == ERTS_THR_PRGR_VAL_WAITING)
limit = 0;
else if (limit < current) /* Wrapped */
@@ -1222,9 +1211,9 @@ erts_thr_progress_block(void)
}
void
-erts_thr_progress_fatal_error_block(SWord timeout)
+erts_thr_progress_fatal_error_block(SWord timeout,
+ ErtsThrPrgrData *tmp_tpd_bufp)
{
- ErtsThrPrgrData tpd_buf;
ErtsThrPrgrData *tpd = perhaps_thr_prgr_data(NULL);
erts_aint32_t bc;
SWord time_left = timeout;
@@ -1248,7 +1237,7 @@ erts_thr_progress_fatal_error_block(SWord timeout)
* since we never complete an unblock after a fatal error
* block.
*/
- tpd = &tpd_buf;
+ tpd = tmp_tpd_bufp;
init_tmp_thr_prgr_data(tpd);
}
diff --git a/erts/emulator/beam/erl_thr_progress.h b/erts/emulator/beam/erl_thr_progress.h
index 68d14174b9..e72321cf48 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. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2012. 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
@@ -44,7 +44,6 @@
#define erts_smp_thr_progress_unblock erts_thr_progress_unblock
#define erts_smp_thr_progress_is_blocking erts_thr_progress_is_blocking
-void erts_thr_progress_fatal_error_block(SWord timeout);
void erts_thr_progress_block(void);
void erts_thr_progress_unblock(void);
int erts_thr_progress_is_blocking(void);
@@ -73,8 +72,22 @@ typedef struct {
ErtsThrPrgrVal current;
} previous;
} ErtsThrPrgrData;
+
+void erts_thr_progress_fatal_error_block(SWord timeout,
+ ErtsThrPrgrData *tmp_tpd_bufp);
+
#endif /* ERTS_SMP */
+typedef struct ErtsThrPrgrLaterOp_ ErtsThrPrgrLaterOp;
+struct ErtsThrPrgrLaterOp_ {
+#ifdef ERTS_SMP
+ ErtsThrPrgrVal later;
+#endif
+ void (*func)(void *);
+ void *data;
+ ErtsThrPrgrLaterOp *next;
+};
+
#endif
#if !defined(ERL_THR_PROGRESS_H__) && !defined(ERL_THR_PROGRESS_TSD_TYPE_ONLY)
@@ -86,6 +99,7 @@ typedef struct {
#ifdef ERTS_SMP
#define ERTS_THR_PRGR_VAL_WAITING (~((ErtsThrPrgrVal) 0))
+#define ERTS_THR_PRGR_INVALID (~((ErtsThrPrgrVal) 0))
extern erts_tsd_key_t erts_thr_prgr_data_key__;
@@ -127,14 +141,21 @@ void erts_thr_progress_dbg_print_state(void);
#ifdef ARCH_32
#define ERTS_THR_PRGR_ATOMIC erts_dw_atomic_t
-ERTS_GLB_INLINE ErtsThrPrgrVal erts_thr_prgr_dw_sint_to_val__(ethr_dw_sint_t *dw_sint);
+ERTS_GLB_INLINE ErtsThrPrgrVal erts_thr_prgr_dw_aint_to_val__(erts_dw_aint_t *dw_aint);
#endif
+ERTS_GLB_INLINE ErtsThrPrgrVal erts_thr_prgr_read_nob__(ERTS_THR_PRGR_ATOMIC *atmc);
ERTS_GLB_INLINE ErtsThrPrgrVal erts_thr_prgr_read_acqb__(ERTS_THR_PRGR_ATOMIC *atmc);
+ERTS_GLB_INLINE ErtsThrPrgrVal erts_thr_prgr_read_mb__(ERTS_THR_PRGR_ATOMIC *atmc);
ERTS_GLB_INLINE int erts_thr_progress_is_managed_thread(void);
-ERTS_GLB_INLINE ErtsThrPrgrVal erts_thr_progress_later(void);
+ERTS_GLB_INLINE ErtsThrPrgrVal erts_thr_progress_current_to_later__(ErtsThrPrgrVal val);
+ERTS_GLB_INLINE ErtsThrPrgrVal erts_thr_progress_later(ErtsSchedulerData *);
ERTS_GLB_INLINE ErtsThrPrgrVal erts_thr_progress_current(void);
ERTS_GLB_INLINE int erts_thr_progress_has_passed__(ErtsThrPrgrVal val1, ErtsThrPrgrVal val2);
+ERTS_GLB_INLINE int erts_thr_progress_has_reached_this(ErtsThrPrgrVal this, ErtsThrPrgrVal val);
+ERTS_GLB_INLINE int erts_thr_progress_equal(ErtsThrPrgrVal val1,
+ ErtsThrPrgrVal val2);
+ERTS_GLB_INLINE int erts_thr_progress_cmp(ErtsThrPrgrVal val1, ErtsThrPrgrVal val2);
ERTS_GLB_INLINE int erts_thr_progress_has_reached(ErtsThrPrgrVal val);
#if ERTS_GLB_INLINE_INCL_FUNC_DEF
@@ -142,33 +163,61 @@ ERTS_GLB_INLINE int erts_thr_progress_has_reached(ErtsThrPrgrVal val);
#ifdef ARCH_64
ERTS_GLB_INLINE ErtsThrPrgrVal
+erts_thr_prgr_read_nob__(ERTS_THR_PRGR_ATOMIC *atmc)
+{
+ return (ErtsThrPrgrVal) erts_atomic_read_nob(atmc);
+}
+
+ERTS_GLB_INLINE ErtsThrPrgrVal
erts_thr_prgr_read_acqb__(ERTS_THR_PRGR_ATOMIC *atmc)
{
return (ErtsThrPrgrVal) erts_atomic_read_acqb(atmc);
}
+ERTS_GLB_INLINE ErtsThrPrgrVal
+erts_thr_prgr_read_mb__(ERTS_THR_PRGR_ATOMIC *atmc)
+{
+ return (ErtsThrPrgrVal) erts_atomic_read_mb(atmc);
+}
+
#else /* ARCH_32 */
ERTS_GLB_INLINE ErtsThrPrgrVal
-erts_thr_prgr_dw_sint_to_val__(ethr_dw_sint_t *dw_sint)
+erts_thr_prgr_dw_aint_to_val__(erts_dw_aint_t *dw_aint)
{
#ifdef ETHR_SU_DW_NAINT_T__
- return (ErtsThrPrgrVal) dw_sint->dw_sint;
+ return (ErtsThrPrgrVal) dw_aint->dw_sint;
#else
ErtsThrPrgrVal res;
- res = (ErtsThrPrgrVal) ((Uint32) dw_sint->sint[ETHR_DW_SINT_HIGH_WORD]);
+ res = (ErtsThrPrgrVal) ((Uint32) dw_aint->sint[ERTS_DW_AINT_HIGH_WORD]);
res <<= 32;
- res |= (ErtsThrPrgrVal) ((Uint32) dw_sint->sint[ETHR_DW_SINT_LOW_WORD]);
+ res |= (ErtsThrPrgrVal) ((Uint32) dw_aint->sint[ERTS_DW_AINT_LOW_WORD]);
return res;
#endif
}
ERTS_GLB_INLINE ErtsThrPrgrVal
+erts_thr_prgr_read_nob__(ERTS_THR_PRGR_ATOMIC *atmc)
+{
+ erts_dw_aint_t dw_aint;
+ erts_dw_atomic_read_nob(atmc, &dw_aint);
+ return erts_thr_prgr_dw_aint_to_val__(&dw_aint);
+}
+
+ERTS_GLB_INLINE ErtsThrPrgrVal
erts_thr_prgr_read_acqb__(ERTS_THR_PRGR_ATOMIC *atmc)
{
- ethr_dw_sint_t dw_sint;
- erts_dw_atomic_read_acqb(atmc, &dw_sint);
- return erts_thr_prgr_dw_sint_to_val__(&dw_sint);
+ erts_dw_aint_t dw_aint;
+ erts_dw_atomic_read_acqb(atmc, &dw_aint);
+ return erts_thr_prgr_dw_aint_to_val__(&dw_aint);
+}
+
+ERTS_GLB_INLINE ErtsThrPrgrVal
+erts_thr_prgr_read_mb__(ERTS_THR_PRGR_ATOMIC *atmc)
+{
+ erts_dw_aint_t dw_aint;
+ erts_dw_atomic_read_mb(atmc, &dw_aint);
+ return erts_thr_prgr_dw_aint_to_val__(&dw_aint);
}
#endif
@@ -181,9 +230,8 @@ erts_thr_progress_is_managed_thread(void)
}
ERTS_GLB_INLINE ErtsThrPrgrVal
-erts_thr_progress_later(void)
+erts_thr_progress_current_to_later__(ErtsThrPrgrVal val)
{
- ErtsThrPrgrVal val = erts_thr_prgr_read_acqb__(&erts_thr_prgr__.current);
if (val == (ERTS_THR_PRGR_VAL_WAITING-((ErtsThrPrgrVal)2)))
return ((ErtsThrPrgrVal) 0);
else if (val == (ERTS_THR_PRGR_VAL_WAITING-((ErtsThrPrgrVal)1)))
@@ -193,9 +241,33 @@ erts_thr_progress_later(void)
}
ERTS_GLB_INLINE ErtsThrPrgrVal
+erts_thr_progress_later(ErtsSchedulerData *esdp)
+{
+ ErtsThrPrgrData *tpd;
+ ErtsThrPrgrVal val;
+ if (esdp) {
+ tpd = &esdp->thr_progress_data;
+ managed_thread:
+ val = tpd->previous.local;
+ ERTS_THR_MEMORY_BARRIER;
+ }
+ else {
+ tpd = erts_tsd_get(erts_thr_prgr_data_key__);
+ if (tpd && tpd->is_managed)
+ goto managed_thread;
+ val = erts_thr_prgr_read_mb__(&erts_thr_prgr__.current);
+ }
+ ASSERT(val != ERTS_THR_PRGR_VAL_WAITING);
+ return erts_thr_progress_current_to_later__(val);
+}
+
+ERTS_GLB_INLINE ErtsThrPrgrVal
erts_thr_progress_current(void)
{
- return erts_thr_prgr_read_acqb__(&erts_thr_prgr__.current);
+ if (erts_thr_progress_is_managed_thread())
+ return erts_thr_prgr_read_nob__(&erts_thr_prgr__.current);
+ else
+ return erts_thr_prgr_read_acqb__(&erts_thr_prgr__.current);
}
ERTS_GLB_INLINE int
@@ -217,13 +289,35 @@ erts_thr_progress_has_passed__(ErtsThrPrgrVal val1, ErtsThrPrgrVal val0)
}
ERTS_GLB_INLINE int
-erts_thr_progress_has_reached(ErtsThrPrgrVal val)
+erts_thr_progress_has_reached_this(ErtsThrPrgrVal this, ErtsThrPrgrVal val)
{
- ErtsThrPrgrVal current;
- current = erts_thr_prgr_read_acqb__(&erts_thr_prgr__.current);
- if (current == val)
+ if (this == val)
return 1;
- return erts_thr_progress_has_passed__(current, val);
+ return erts_thr_progress_has_passed__(this, val);
+}
+
+ERTS_GLB_INLINE int
+erts_thr_progress_equal(ErtsThrPrgrVal val1, ErtsThrPrgrVal val2)
+{
+ return val1 == val2 && val1 != ERTS_THR_PRGR_INVALID;
+}
+
+ERTS_GLB_INLINE int
+erts_thr_progress_cmp(ErtsThrPrgrVal val1, ErtsThrPrgrVal val2)
+{
+ if (val1 == val2)
+ return 0;
+ if (erts_thr_progress_has_passed__(val1, val2))
+ return 1;
+ else
+ return -1;
+}
+
+ERTS_GLB_INLINE int
+erts_thr_progress_has_reached(ErtsThrPrgrVal val)
+{
+ ErtsThrPrgrVal current = erts_thr_progress_current();
+ return erts_thr_progress_has_reached_this(current, val);
}
#endif
diff --git a/erts/emulator/beam/erl_thr_queue.c b/erts/emulator/beam/erl_thr_queue.c
index efb8c635d7..f07964a265 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. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2012. 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
@@ -418,12 +418,11 @@ clean(ErtsThrQ_t *q, int max_ops, int do_notify)
}
if (q->head.unref_end == (ErtsThrQElement_t *) ilast)
- ERTS_THR_MEMORY_BARRIER;
+ ERTS_SMP_MEMORY_BARRIER;
else {
q->head.next.unref_end = (ErtsThrQElement_t *) ilast;
- ERTS_THR_MEMORY_BARRIER;
#ifdef ERTS_SMP
- q->head.next.thr_progress = erts_thr_progress_later();
+ q->head.next.thr_progress = erts_thr_progress_later(NULL);
#endif
erts_atomic32_set_relb(&q->tail.data.um_refc_ix,
um_refc_ix);
diff --git a/erts/emulator/beam/erl_threads.h b/erts/emulator/beam/erl_threads.h
index 065e7077c0..17628286bc 100644
--- a/erts/emulator/beam/erl_threads.h
+++ b/erts/emulator/beam/erl_threads.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2012. 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
@@ -25,14 +25,239 @@
#ifndef ERL_THREAD_H__
#define ERL_THREAD_H__
+/*
+ * --- Documentation of atomics and memory barriers --------------------------
+ *
+ * The following explicit memory barriers exist:
+ *
+ * - ERTS_THR_MEMORY_BARRIER
+ * Full memory barrier. Orders both loads, and stores. No
+ * load or store is allowed to be reordered over the
+ * barrier.
+ * - ERTS_THR_WRITE_MEMORY_BARRIER
+ * Write barrier. Orders *only* stores. These are not
+ * allowed to be reordered over the barrier.
+ * - ERTS_THR_READ_MEMORY_BARRIER
+ * Read barrier. Orders *only* loads. These are not
+ * allowed to be reordered over the barrier.
+ * - ERTS_THR_DATA_DEPENDENCY_READ_MEMORY_BARRIER
+ * Data dependency read barrier. Orders *only* loads
+ * according to data dependency across the barrier.
+ *
+ * If thread support has been disabled, these barriers will become no-ops.
+ *
+ * If the prefix ERTS_THR_ is replaced with ERTS_SMP_, the barriers will
+ * be enabled only in the SMP enabled runtime system.
+ *
+ * --- Atomic operations ---
+ *
+ * Atomics operations exist for 32-bit, word size, and double word size
+ * integers. Function prototypes are listed below.
+ *
+ * Each function implementing an atomic operation exist with the following
+ * implied memory barrier semantics. Not all combinations are useful, but
+ * all of them exist for simplicity. <B> is suffix in function name:
+ *
+ * - <B> - Description
+ *
+ * - mb - Full memory barrier. Orders both loads, and
+ * stores before, and after the atomic operation.
+ * No load or store is allowed to be reordered
+ * over the atomic operation.
+ * - relb - Release barrier. Orders both loads, and
+ * stores appearing *before* the atomic
+ * operation. These are not allowed to be
+ * reordered over the atomic operation.
+ * - acqb - Acquire barrier. Orders both loads, and stores
+ * appearing *after* the atomic operation. These
+ * are not allowed to be reordered over the
+ * atomic operation.
+ * - wb - Write barrier. Orders *only* stores. These are
+ * not allowed to be reordered over the barrier.
+ * Store in atomic operation is ordered *after*
+ * the barrier.
+ * - rb - Read barrier. Orders *only* loads. These are
+ * not allowed to be reordered over the barrier.
+ * Load in atomic operation is ordered *before*
+ * the barrier.
+ * - ddrb - Data dependency read barrier. Orders *only*
+ * loads according to data dependency across the
+ * barrier. Load in atomic operation is ordered
+ * before the barrier.
+ *
+ * If thread support has been disabled, these functions are mapped to
+ * functions that performs the same operation, but aren't atomic
+ * and don't imply any memory barriers.
+ *
+ * If the atomic operations are prefixed with erts_smp_ instead of only
+ * erts_ the atomic operations will only be atomic in the SMP enabled
+ * runtime system, and will be mapped to non-atomic operations without
+ * memory barriers in the runtime system without SMP support. Atomic
+ * operations with erts_smp_ prefix should use the atomic types
+ * erts_smp_atomic32_t, erts_smp_atomic_t, and erts_smp_dw_atomic_t
+ * instead of erts_atomic32_t, erts_atomic_t, and erts_dw_atomic_t. The
+ * integer data types erts_aint32_t, erts_aint_t, and erts_dw_atomic_t
+ * are the same.
+ *
+ * --- 32-bit atomic operations ---
+ *
+ * The following 32-bit atomic operations exist. <B> should be
+ * replaced with a supported memory barrier (see above). Note
+ * that sizeof(erts_atomic32_t) might be larger than 4!
+ *
+ *
+ * Initialize (not necessarily the same as the set operation):
+ * void erts_atomic32_init_<B>(erts_atomic32_t *atmc,
+ * erts_aint32_t val);
+ *
+ * Set value:
+ * void erts_atomic32_set_<B>(erts_atomic32_t *atmc,
+ * erts_aint32_t val);
+ *
+ * Read; returns current value:
+ * erts_aint32_t erts_atomic32_read_<B>(erts_atomic32_t *atmc);
+ *
+ * Increment; returns resulting value:
+ * erts_aint32_t erts_atomic32_inc_read_<B>(erts_atomic32_t *atmc);
+ *
+ * Decrement; returns resulting value:
+ * erts_aint32_t erts_atomic32_dec_read_<B>(erts_atomic32_t *atmc);
+ *
+ * Increment:
+ * void erts_atomic32_inc_<B>(erts_atomic32_t *atmc);
+ *
+ * Decrement:
+ * void erts_atomic32_dec_<B>(erts_atomic32_t *atmc);
+ *
+ * Add value; returns resulting value:
+ * erts_aint32_t erts_atomic32_add_read_<B>(erts_atomic32_t *atmc,
+ * erts_aint32_t val);
+ *
+ * Add value:
+ * void erts_atomic32_add_<B>(erts_atomic32_t *atmc,
+ * erts_aint32_t val);
+ *
+ * Bitwise-or; returns previous value:
+ * erts_aint32_t erts_atomic32_read_bor_<B>(erts_atomic32_t *atmc,
+ * erts_aint32_t val);
+ *
+ * Bitwise-and; returns previous value:
+ * erts_aint32_t erts_atomic32_read_band_<B>(erts_atomic32_t *atmc,
+ * erts_aint32_t val);
+ *
+ * Exchange; returns previous value:
+ * erts_aint32_t erts_atomic32_xchg_<B>(erts_atomic32_t *atmc,
+ * erts_aint32_t val);
+ *
+ * Compare and exchange; returns previous or current value. If
+ * returned value equals 'exp' the value was changed to 'new';
+ * otherwise not:
+ * erts_aint32_t erts_atomic32_cmpxchg_<B>(erts_atomic32_t *a,
+ * erts_aint32_t new,
+ * erts_aint32_t exp);
+ *
+ * --- Word size atomic operations ---
+ *
+ * The following word size (same size as sizeof(void *)) atomic
+ * operations exist. <B> should be replaced with a supported
+ * memory barrier (see above). Note that sizeof(erts_atomic_t)
+ * might be larger than sizeof(void *)!
+ *
+ * Initialize (not necessarily the same as the set operation):
+ * void erts_atomic_init_<B>(erts_atomic_t *atmc,
+ * erts_aint_t val);
+ *
+ * Set value;
+ * void erts_atomic_set_<B>(erts_atomic_t *atmc,
+ * erts_aint_t val);
+ *
+ * Read; returns current value:
+ * erts_aint_t erts_atomic_read_<B>(erts_atomic_t *atmc);
+ *
+ * Increment; returns resulting value:
+ * erts_aint_t erts_atomic_inc_read_<B>(erts_atomic_t *atmc);
+ *
+ * Decrement; returns resulting value:
+ * erts_aint_t erts_atomic_dec_read_<B>(erts_atomic_t *atmc);
+ *
+ * Increment:
+ * void erts_atomic_inc_<B>(erts_atomic_t *atmc);
+ *
+ * Decrement:
+ * void erts_atomic_dec_<B>(erts_atomic_t *atmc);
+ *
+ * Add value; returns resulting value:
+ * erts_aint_t erts_atomic_add_read_<B>(erts_atomic_t *atmc,
+ * erts_aint_t val);
+ *
+ * Add value:
+ * void erts_atomic_add_<B>(erts_atomic_t *atmc,
+ * erts_aint_t val);
+ *
+ * Bitwise-or; returns previous value:
+ * erts_aint_t erts_atomic_read_bor_<B>(erts_atomic_t *atmc,
+ * erts_aint_t val);
+ *
+ * Bitwise-and; returns previous value:
+ * erts_aint_t erts_atomic_read_band_<B>(erts_atomic_t *atmc,
+ * erts_aint_t val);
+ *
+ * Exchange; returns previous value:
+ * erts_aint_t erts_atomic_xchg_<B>(erts_atomic_t *atmc,
+ * erts_aint_t val);
+ *
+ * Compare and exchange; returns previous or current value. If
+ * returned value equals 'exp' the value was changed to 'new';
+ * otherwise not:
+ * erts_aint_t erts_atomic_cmpxchg_<B>(erts_atomic_t *a,
+ * erts_aint_t new,
+ * erts_aint_t exp);
+ *
+ * --- Double word size atomic operations ---
+ *
+ * The following double word atomic operations exist. <B> should be
+ * replaced with a supported memory barrier (see above).
+ *
+ * Note that sizeof(erts_dw_atomic_t) usually is larger than
+ * 2*sizeof(void *)!
+ *
+ * The erts_dw_aint_t data type should be accessed as if it was defined
+ * like this:
+ *
+ * typedef struct {
+ * erts_aint_t sint[2];
+ * } erts_dw_aint_t;
+ *
+ * Most significant word is 'sint[ERTS_DW_AINT_HIGH_WORD]' and least
+ * significant word is 'sint[ERTS_DW_AINT_LOW_WORD]'.
+ *
+ *
+ * Initialize (not necessarily the same as the set operation):
+ * void erts_dw_atomic_init_<B>(erts_dw_atomic_t *var,
+ * erts_dw_aint_t *val);
+ *
+ * Set; value is written into 'val':
+ * void erts_dw_atomic_set_<B>(erts_dw_atomic_t *var,
+ * erts_dw_aint_t *val);
+ *
+ * Read; value is written into 'val':
+ * void erts_dw_atomic_read_<B>(erts_dw_atomic_t *var,
+ * erts_dw_aint_t *val);
+ *
+ * Compare and exchange; returns a value != 0 if exchange was
+ * made; otherwise 0. 'new_val' contains new value to set. If 'exp_act'
+ * contains the same value as in memory when the function is called,
+ * 'new' is written to memory; otherwise, not. If exchange was not
+ * made, 'exp_act' contains the actual value in memory:
+ * int erts_dw_atomic_cmpxchg_<B>(erts_dw_atomic_t *var,
+ * erts_dw_aint_t *new,
+ * erts_dw_aint_t *exp_act);
+ */
+
#define ERTS_SPIN_BODY ETHR_SPIN_BODY
#include "sys.h"
-typedef struct { SWord sint[2]; } erts_no_dw_atomic_t;
-typedef SWord erts_no_atomic_t;
-typedef Sint32 erts_no_atomic32_t;
-
#ifdef USE_THREADS
#define ETHR_TRY_INLINE_FUNCS
@@ -52,6 +277,9 @@ typedef Sint32 erts_no_atomic32_t;
#endif
#define ERTS_THR_MEMORY_BARRIER ETHR_MEMORY_BARRIER
+#define ERTS_THR_WRITE_MEMORY_BARRIER ETHR_WRITE_MEMORY_BARRIER
+#define ERTS_THR_READ_MEMORY_BARRIER ETHR_READ_MEMORY_BARRIER
+#define ERTS_THR_DATA_DEPENDENCY_READ_MEMORY_BARRIER ETHR_READ_DEPEND_MEMORY_BARRIER
#ifdef ERTS_ENABLE_LOCK_COUNT
#define erts_mtx_lock(L) erts_mtx_lock_x(L, __FILE__, __LINE__)
@@ -113,6 +341,9 @@ typedef ethr_ts_event erts_tse_t;
#define erts_aint32_t ethr_sint32_t
#define erts_atomic32_t ethr_atomic32_t
+#define ERTS_DW_AINT_HIGH_WORD ETHR_DW_SINT_HIGH_WORD
+#define ERTS_DW_AINT_LOW_WORD ETHR_DW_SINT_LOW_WORD
+
/* spinlock */
typedef struct {
ethr_spinlock_t slck;
@@ -149,6 +380,9 @@ __decl_noreturn void __noreturn erts_thr_fatal_error(int, char *);
#else /* #ifdef USE_THREADS */
#define ERTS_THR_MEMORY_BARRIER
+#define ERTS_THR_WRITE_MEMORY_BARRIER
+#define ERTS_THR_READ_MEMORY_BARRIER
+#define ERTS_THR_DATA_DEPENDENCY_READ_MEMORY_BARRIER
#define ERTS_THR_OPTS_DEFAULT_INITER 0
typedef int erts_thr_opts_t;
@@ -173,12 +407,15 @@ typedef struct {
typedef int erts_rwmtx_t;
typedef int erts_tsd_key_t;
typedef int erts_tse_t;
-#define erts_dw_aint_t erts_no_dw_atomic_t
-#define erts_dw_atomic_t erts_no_dw_atomic_t
-#define erts_aint_t SWord
-#define erts_atomic_t erts_no_atomic_t
-#define erts_aint32_t Sint32
-#define erts_atomic32_t erts_no_atomic32_t
+
+typedef struct { SWord sint[2]; } erts_dw_aint_t;
+typedef SWord erts_aint_t;
+typedef Sint32 erts_aint32_t;
+
+#define erts_dw_atomic_t erts_dw_aint_t
+#define erts_atomic_t erts_aint_t
+#define erts_atomic32_t erts_aint32_t
+
#if __GNUC__ > 2
typedef struct { } erts_spinlock_t;
typedef struct { } erts_rwlock_t;
@@ -187,6 +424,14 @@ typedef struct { int gcc_is_buggy; } erts_spinlock_t;
typedef struct { int gcc_is_buggy; } erts_rwlock_t;
#endif
+#ifdef WORDS_BIGENDIAN
+#define ERTS_DW_AINT_LOW_WORD 1
+#define ERTS_DW_AINT_HIGH_WORD 0
+#else
+#define ERTS_DW_AINT_LOW_WORD 0
+#define ERTS_DW_AINT_HIGH_WORD 1
+#endif
+
#define ERTS_MTX_INITER 0
#define ERTS_CND_INITER 0
#define ERTS_THR_INIT_DATA_DEF_INITER 0
@@ -195,6 +440,10 @@ typedef struct { int gcc_is_buggy; } erts_rwlock_t;
#endif /* #ifdef USE_THREADS */
+#define erts_no_dw_atomic_t erts_dw_aint_t
+#define erts_no_atomic_t erts_aint_t
+#define erts_no_atomic32_t erts_aint32_t
+
#define ERTS_AINT_NULL ((erts_aint_t) NULL)
#define ERTS_AINT_T_MAX (~(((erts_aint_t) 1) << (sizeof(erts_aint_t)*8-1)))
@@ -361,18 +610,13 @@ ERTS_GLB_INLINE void erts_thr_sigmask(int how, const sigset_t *set,
ERTS_GLB_INLINE void erts_thr_sigwait(const sigset_t *set, int *sig);
#endif /* #ifdef HAVE_ETHR_SIG_FUNCS */
+#ifdef USE_THREADS
+
/*
- * Functions implementing atomic operations with with no (nob),
- * full (mb), acquire (acqb), release (relb), read (rb), and
- * write (wb) memory barriers.
- *
- * If thread support has been disabled, they are mapped to
- * functions that performs the same operation, but aren't atomic
- * and don't imply memory barriers.
+ * See "Documentation of atomics and memory barriers" at the top
+ * of this file for info on atomics.
*/
-#ifdef USE_THREADS
-
/* Double word size atomics */
#define erts_dw_atomic_init_nob ethr_dw_atomic_init
@@ -395,6 +639,11 @@ ERTS_GLB_INLINE void erts_thr_sigwait(const sigset_t *set, int *sig);
#define erts_dw_atomic_read_relb ethr_dw_atomic_read_relb
#define erts_dw_atomic_cmpxchg_relb ethr_dw_atomic_cmpxchg_relb
+#define erts_dw_atomic_init_ddrb ethr_dw_atomic_init_ddrb
+#define erts_dw_atomic_set_ddrb ethr_dw_atomic_set_ddrb
+#define erts_dw_atomic_read_ddrb ethr_dw_atomic_read_ddrb
+#define erts_dw_atomic_cmpxchg_ddrb ethr_dw_atomic_cmpxchg_ddrb
+
#define erts_dw_atomic_init_rb ethr_dw_atomic_init_rb
#define erts_dw_atomic_set_rb ethr_dw_atomic_set_rb
#define erts_dw_atomic_read_rb ethr_dw_atomic_read_rb
@@ -463,6 +712,20 @@ ERTS_GLB_INLINE void erts_thr_sigwait(const sigset_t *set, int *sig);
#define erts_atomic_xchg_relb ethr_atomic_xchg_relb
#define erts_atomic_cmpxchg_relb ethr_atomic_cmpxchg_relb
+#define erts_atomic_init_ddrb ethr_atomic_init_ddrb
+#define erts_atomic_set_ddrb ethr_atomic_set_ddrb
+#define erts_atomic_read_ddrb ethr_atomic_read_ddrb
+#define erts_atomic_inc_read_ddrb ethr_atomic_inc_read_ddrb
+#define erts_atomic_dec_read_ddrb ethr_atomic_dec_read_ddrb
+#define erts_atomic_inc_ddrb ethr_atomic_inc_ddrb
+#define erts_atomic_dec_ddrb ethr_atomic_dec_ddrb
+#define erts_atomic_add_read_ddrb ethr_atomic_add_read_ddrb
+#define erts_atomic_add_ddrb ethr_atomic_add_ddrb
+#define erts_atomic_read_bor_ddrb ethr_atomic_read_bor_ddrb
+#define erts_atomic_read_band_ddrb ethr_atomic_read_band_ddrb
+#define erts_atomic_xchg_ddrb ethr_atomic_xchg_ddrb
+#define erts_atomic_cmpxchg_ddrb ethr_atomic_cmpxchg_ddrb
+
#define erts_atomic_init_rb ethr_atomic_init_rb
#define erts_atomic_set_rb ethr_atomic_set_rb
#define erts_atomic_read_rb ethr_atomic_read_rb
@@ -549,6 +812,20 @@ ERTS_GLB_INLINE void erts_thr_sigwait(const sigset_t *set, int *sig);
#define erts_atomic32_xchg_relb ethr_atomic32_xchg_relb
#define erts_atomic32_cmpxchg_relb ethr_atomic32_cmpxchg_relb
+#define erts_atomic32_init_ddrb ethr_atomic32_init_ddrb
+#define erts_atomic32_set_ddrb ethr_atomic32_set_ddrb
+#define erts_atomic32_read_ddrb ethr_atomic32_read_ddrb
+#define erts_atomic32_inc_read_ddrb ethr_atomic32_inc_read_ddrb
+#define erts_atomic32_dec_read_ddrb ethr_atomic32_dec_read_ddrb
+#define erts_atomic32_inc_ddrb ethr_atomic32_inc_ddrb
+#define erts_atomic32_dec_ddrb ethr_atomic32_dec_ddrb
+#define erts_atomic32_add_read_ddrb ethr_atomic32_add_read_ddrb
+#define erts_atomic32_add_ddrb ethr_atomic32_add_ddrb
+#define erts_atomic32_read_bor_ddrb ethr_atomic32_read_bor_ddrb
+#define erts_atomic32_read_band_ddrb ethr_atomic32_read_band_ddrb
+#define erts_atomic32_xchg_ddrb ethr_atomic32_xchg_ddrb
+#define erts_atomic32_cmpxchg_ddrb ethr_atomic32_cmpxchg_ddrb
+
#define erts_atomic32_init_rb ethr_atomic32_init_rb
#define erts_atomic32_set_rb ethr_atomic32_set_rb
#define erts_atomic32_read_rb ethr_atomic32_read_rb
@@ -601,6 +878,11 @@ ERTS_GLB_INLINE void erts_thr_sigwait(const sigset_t *set, int *sig);
#define erts_dw_atomic_read_relb erts_no_dw_atomic_read
#define erts_dw_atomic_cmpxchg_relb erts_no_dw_atomic_cmpxchg
+#define erts_dw_atomic_init_ddrb erts_no_dw_atomic_init
+#define erts_dw_atomic_set_ddrb erts_no_dw_atomic_set
+#define erts_dw_atomic_read_ddrb erts_no_dw_atomic_read
+#define erts_dw_atomic_cmpxchg_ddrb erts_no_dw_atomic_cmpxchg
+
#define erts_dw_atomic_init_rb erts_no_dw_atomic_init
#define erts_dw_atomic_set_rb erts_no_dw_atomic_set
#define erts_dw_atomic_read_rb erts_no_dw_atomic_read
@@ -669,6 +951,20 @@ ERTS_GLB_INLINE void erts_thr_sigwait(const sigset_t *set, int *sig);
#define erts_atomic_xchg_relb erts_no_atomic_xchg
#define erts_atomic_cmpxchg_relb erts_no_atomic_cmpxchg
+#define erts_atomic_init_ddrb erts_no_atomic_set
+#define erts_atomic_set_ddrb erts_no_atomic_set
+#define erts_atomic_read_ddrb erts_no_atomic_read
+#define erts_atomic_inc_read_ddrb erts_no_atomic_inc_read
+#define erts_atomic_dec_read_ddrb erts_no_atomic_dec_read
+#define erts_atomic_inc_ddrb erts_no_atomic_inc
+#define erts_atomic_dec_ddrb erts_no_atomic_dec
+#define erts_atomic_add_read_ddrb erts_no_atomic_add_read
+#define erts_atomic_add_ddrb erts_no_atomic_add
+#define erts_atomic_read_bor_ddrb erts_no_atomic_read_bor
+#define erts_atomic_read_band_ddrb erts_no_atomic_read_band
+#define erts_atomic_xchg_ddrb erts_no_atomic_xchg
+#define erts_atomic_cmpxchg_ddrb erts_no_atomic_cmpxchg
+
#define erts_atomic_init_rb erts_no_atomic_set
#define erts_atomic_set_rb erts_no_atomic_set
#define erts_atomic_read_rb erts_no_atomic_read
@@ -755,6 +1051,20 @@ ERTS_GLB_INLINE void erts_thr_sigwait(const sigset_t *set, int *sig);
#define erts_atomic32_xchg_relb erts_no_atomic32_xchg
#define erts_atomic32_cmpxchg_relb erts_no_atomic32_cmpxchg
+#define erts_atomic32_init_ddrb erts_no_atomic32_set
+#define erts_atomic32_set_ddrb erts_no_atomic32_set
+#define erts_atomic32_read_ddrb erts_no_atomic32_read
+#define erts_atomic32_inc_read_ddrb erts_no_atomic32_inc_read
+#define erts_atomic32_dec_read_ddrb erts_no_atomic32_dec_read
+#define erts_atomic32_inc_ddrb erts_no_atomic32_inc
+#define erts_atomic32_dec_ddrb erts_no_atomic32_dec
+#define erts_atomic32_add_read_ddrb erts_no_atomic32_add_read
+#define erts_atomic32_add_ddrb erts_no_atomic32_add
+#define erts_atomic32_read_bor_ddrb erts_no_atomic32_read_bor
+#define erts_atomic32_read_band_ddrb erts_no_atomic32_read_band
+#define erts_atomic32_xchg_ddrb erts_no_atomic32_xchg
+#define erts_atomic32_cmpxchg_ddrb erts_no_atomic32_cmpxchg
+
#define erts_atomic32_init_rb erts_no_atomic32_set
#define erts_atomic32_set_rb erts_no_atomic32_set
#define erts_atomic32_read_rb erts_no_atomic32_read
diff --git a/erts/emulator/beam/erl_time.h b/erts/emulator/beam/erl_time.h
index 6c6e193818..4bbdcaa3e3 100644
--- a/erts/emulator/beam/erl_time.h
+++ b/erts/emulator/beam/erl_time.h
@@ -118,9 +118,11 @@ ERTS_GLB_INLINE void erts_do_time_add(erts_short_time_t elapsed)
void erts_get_now_cpu(Uint* megasec, Uint* sec, Uint* microsec);
#endif
+typedef UWord erts_approx_time_t;
+erts_approx_time_t erts_get_approx_time(void);
+
void erts_get_timeval(SysTimeval *tv);
erts_time_t erts_get_time(void);
-void erts_get_emu_time(SysTimeval *);
ERTS_GLB_INLINE int erts_cmp_timeval(SysTimeval *t1p, SysTimeval *t2p);
diff --git a/erts/emulator/beam/erl_time_sup.c b/erts/emulator/beam/erl_time_sup.c
index 1d0735aa99..3272a5326d 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2012. 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
@@ -91,6 +91,41 @@ static SysTimeval then; /* Used in get_now */
static SysTimeval last_emu_time; /* Used in erts_get_emu_time() */
SysTimeval erts_first_emu_time; /* Used in erts_get_emu_time() */
+union {
+ erts_smp_atomic_t time;
+ char align[ERTS_CACHE_LINE_SIZE];
+} approx erts_align_attribute(ERTS_CACHE_LINE_SIZE);
+
+static void
+init_approx_time(void)
+{
+ erts_smp_atomic_init_nob(&approx.time, 0);
+}
+
+static ERTS_INLINE erts_approx_time_t
+get_approx_time(void)
+{
+ return (erts_approx_time_t) erts_smp_atomic_read_nob(&approx.time);
+}
+
+static ERTS_INLINE void
+update_approx_time(SysTimeval *tv)
+{
+ erts_approx_time_t new_secs = (erts_approx_time_t) tv->tv_sec;
+ erts_approx_time_t old_secs = get_approx_time();
+ if (old_secs != new_secs)
+ erts_smp_atomic_set_nob(&approx.time, new_secs);
+}
+
+/*
+ * erts_get_approx_time() returns an *approximate* time
+ * in seconds. NOTE that this time may jump backwards!!!
+ */
+erts_approx_time_t
+erts_get_approx_time(void)
+{
+ return get_approx_time();
+}
#ifdef HAVE_GETHRTIME
@@ -351,7 +386,7 @@ static int clock_resolution;
/*
** The clock resolution should really be the resolution of the
** time function in use, which on most platforms
-** is 1. On VxWorks the resolution shold be
+** is 1. On VxWorks the resolution should be
** the number of ticks per second (or 1, which would work nicely to).
**
** Setting lower resolutions is mostly interesting when timers are used
@@ -398,6 +433,8 @@ erts_init_time_sup(void)
{
erts_smp_mtx_init(&erts_timeofday_mtx, "timeofday");
+ init_approx_time();
+
last_emu_time.tv_sec = 0;
last_emu_time.tv_usec = 0;
@@ -417,7 +454,7 @@ erts_init_time_sup(void)
gtv = inittv;
then.tv_sec = then.tv_usec = 0;
- erts_get_emu_time(&erts_first_emu_time);
+ erts_deliver_time();
return CLOCK_RESOLUTION;
}
@@ -717,6 +754,11 @@ int univ_to_seconds(Sint year, Sint month, Sint day, Sint hour, Sint minute, Sin
return 1;
}
+#if defined(HAVE_TIME2POSIX) && defined(HAVE_DECL_TIME2POSIX) && \
+ !HAVE_DECL_TIME2POSIX
+extern time_t time2posix(time_t);
+#endif
+
int
local_to_univ(Sint *year, Sint *month, Sint *day,
Sint *hour, Sint *minute, Sint *second, int isdst)
@@ -757,7 +799,7 @@ local_to_univ(Sint *year, Sint *month, Sint *day,
refuses to give us a DST time, we simulate the Linux/Solaris
behaviour of giving the same data as if is_dst was not set. */
t.tm_isdst = 0;
- if (erl_mktime(&the_clock, &t)) {
+ if (erl_mktime(&the_clock, &t) < 0) {
/* Failed anyway, something else is bad - will be a badarg */
return 0;
}
@@ -766,6 +808,11 @@ local_to_univ(Sint *year, Sint *month, Sint *day,
return 0;
}
}
+
+#ifdef HAVE_TIME2POSIX
+ the_clock = time2posix(the_clock);
+#endif
+
#ifdef HAVE_GMTIME_R
tm = gmtime_r(&the_clock, &tmbuf);
#else
@@ -873,6 +920,8 @@ get_now(Uint* megasec, Uint* sec, Uint* microsec)
*megasec = (Uint) (now.tv_sec / 1000000);
*sec = (Uint) (now.tv_sec % 1000000);
*microsec = (Uint) (now.tv_usec);
+
+ update_approx_time(&now);
}
void
@@ -885,6 +934,8 @@ get_sys_now(Uint* megasec, Uint* sec, Uint* microsec)
*megasec = (Uint) (now.tv_sec / 1000000);
*sec = (Uint) (now.tv_sec % 1000000);
*microsec = (Uint) (now.tv_usec);
+
+ update_approx_time(&now);
}
@@ -901,6 +952,8 @@ void erts_deliver_time(void) {
do_erts_deliver_time(&now);
erts_smp_mtx_unlock(&erts_timeofday_mtx);
+
+ update_approx_time(&now);
}
/* get *real* time (not ticks) remaining until next timeout - if there
@@ -949,6 +1002,7 @@ void erts_get_timeval(SysTimeval *tv)
erts_smp_mtx_lock(&erts_timeofday_mtx);
get_tolerant_timeofday(tv);
erts_smp_mtx_unlock(&erts_timeofday_mtx);
+ update_approx_time(tv);
}
erts_time_t
@@ -961,7 +1015,9 @@ erts_get_time(void)
get_tolerant_timeofday(&sys_tv);
erts_smp_mtx_unlock(&erts_timeofday_mtx);
-
+
+ update_approx_time(&sys_tv);
+
return sys_tv.tv_sec;
}
@@ -977,38 +1033,3 @@ void erts_get_now_cpu(Uint* megasec, Uint* sec, Uint* microsec) {
*sec = (Uint)(tp.tv_sec % 1000000);
}
#endif
-
-
-/*
- * erts_get_emu_time() is similar to get_now(). You will
- * always get different times from erts_get_emu_time(), but they
- * may equal a time from get_now().
- *
- * erts_get_emu_time() is only used internally in the emulator in
- * order to order emulator internal events.
- */
-
-void
-erts_get_emu_time(SysTimeval *this_emu_time_p)
-{
- erts_smp_mtx_lock(&erts_timeofday_mtx);
-
- get_tolerant_timeofday(this_emu_time_p);
-
- /* Make sure time is later than last */
- if (last_emu_time.tv_sec > this_emu_time_p->tv_sec ||
- (last_emu_time.tv_sec == this_emu_time_p->tv_sec
- && last_emu_time.tv_usec >= this_emu_time_p->tv_usec)) {
- *this_emu_time_p = last_emu_time;
- this_emu_time_p->tv_usec++;
- }
- /* Check for carry from above + general reasonability */
- if (this_emu_time_p->tv_usec >= 1000000) {
- this_emu_time_p->tv_usec = 0;
- this_emu_time_p->tv_sec++;
- }
-
- last_emu_time = *this_emu_time_p;
-
- erts_smp_mtx_unlock(&erts_timeofday_mtx);
-}
diff --git a/erts/emulator/beam/erl_trace.c b/erts/emulator/beam/erl_trace.c
index b1d1e1d9b0..d04a91f18c 100644
--- a/erts/emulator/beam/erl_trace.c
+++ b/erts/emulator/beam/erl_trace.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1999-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2012. 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
@@ -64,7 +64,7 @@ int erts_cpu_timestamp;
#endif
static erts_smp_mtx_t smq_mtx;
-static erts_smp_mtx_t sys_trace_mtx;
+static erts_smp_rwmtx_t sys_trace_rwmtx;
enum ErtsSysMsgType {
SYS_MSG_TYPE_UNDEFINED,
@@ -91,7 +91,12 @@ static void init_sys_msg_dispatcher(void);
#endif
void erts_init_trace(void) {
- erts_smp_mtx_init(&sys_trace_mtx, "sys_tracers");
+ erts_smp_rwmtx_opt_t rwmtx_opts = ERTS_SMP_RWMTX_OPT_DEFAULT_INITER;
+ rwmtx_opts.type = ERTS_SMP_RWMTX_TYPE_EXTREMELY_FREQUENT_READ;
+ rwmtx_opts.lived = ERTS_SMP_RWMTX_LONG_LIVED;
+
+ erts_smp_rwmtx_init_opt(&sys_trace_rwmtx, &rwmtx_opts, "sys_tracers");
+
#ifdef HAVE_ERTS_NOW_CPU
erts_cpu_timestamp = 0;
#endif
@@ -125,8 +130,13 @@ do { \
enqueue_sys_msg_unlocked(SYS_MSG_TYPE_TRACE, (FPID), (TPID), (MSG), (BP)); \
} while(0)
#else
+#ifdef USE_VM_PROBES
+#define ERTS_ENQ_TRACE_MSG(FPID, TPROC, MSG, BP) \
+ erts_queue_message((TPROC), NULL, (BP), (MSG), NIL, NIL)
+#else
#define ERTS_ENQ_TRACE_MSG(FPID, TPROC, MSG, BP) \
- erts_queue_message((TPROC), NULL, (BP), (MSG), NIL)
+ erts_queue_message((TPROC), NULL, (BP), (MSG), NIL)
+#endif
#endif
/*
@@ -146,8 +156,8 @@ do { (RES) = (TPID); } while(0)
#define ERTS_TRACER_REF_TYPE Process *
#define ERTS_GET_TRACER_REF(RES, TPID, TRACEE_FLGS) \
do { \
- (RES) = process_tab[internal_pid_index((TPID))]; \
- if (INVALID_PID((RES), (TPID)) || !((RES)->trace_flags & F_TRACER)) { \
+ (RES) = erts_proc_lookup((TPID)); \
+ if (!(RES) || !((RES)->trace_flags & F_TRACER)) { \
(TPID) = NIL; \
(TRACEE_FLGS) &= ~TRACEE_FLAGS; \
return; \
@@ -164,10 +174,10 @@ erts_system_profile_setup_active_schedulers(void)
active_sched = erts_active_schedulers();
}
-void
-erts_trace_check_exiting(Eterm exiting)
+static void
+exiting_reset(Eterm exiting)
{
- erts_smp_mtx_lock(&sys_trace_mtx);
+ erts_smp_rwmtx_rwlock(&sys_trace_rwmtx);
if (exiting == default_tracer) {
default_tracer = NIL;
default_trace_flags &= TRACEE_FLAGS;
@@ -197,29 +207,49 @@ erts_trace_check_exiting(Eterm exiting)
erts_system_profile_clear(NULL);
#endif
}
- erts_smp_mtx_unlock(&sys_trace_mtx);
+ erts_smp_rwmtx_rwunlock(&sys_trace_rwmtx);
+}
+
+void
+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)
+ reset = 1;
+ else if (exiting == system_profile)
+ reset = 1;
+ erts_smp_rwmtx_runlock(&sys_trace_rwmtx);
+ if (reset)
+ 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)
{
- Eterm old = THE_NON_VALUE;
+ Eterm old;
- if (new != am_false) {
- if (!erts_pid2proc(c_p, c_p_locks, new, 0)
- && !erts_is_valid_tracer_port(new)) {
- return old;
- }
- }
+ if (new != am_false && !is_valid_tracer(new))
+ return THE_NON_VALUE;
- erts_smp_mtx_lock(&sys_trace_mtx);
+ erts_smp_rwmtx_rwlock(&sys_trace_rwmtx);
old = system_seq_tracer;
system_seq_tracer = new;
#ifdef DEBUG_PRINTOUTS
erts_fprintf(stderr, "set seq tracer new=%T old=%T\n", new, old);
#endif
- erts_smp_mtx_unlock(&sys_trace_mtx);
+ erts_smp_rwmtx_rwunlock(&sys_trace_rwmtx);
return old;
}
@@ -227,12 +257,12 @@ Eterm
erts_get_system_seq_tracer(void)
{
Eterm st;
- erts_smp_mtx_lock(&sys_trace_mtx);
+ 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_mtx_unlock(&sys_trace_mtx);
+ erts_smp_rwmtx_runlock(&sys_trace_rwmtx);
return st;
}
@@ -245,7 +275,7 @@ get_default_tracing(Uint *flagsp, Eterm *tracerp)
if (is_nil(default_tracer)) {
default_trace_flags &= ~TRACEE_FLAGS;
} else if (is_internal_pid(default_tracer)) {
- if (!erts_pid2proc(NULL, 0, default_tracer, 0)) {
+ if (!erts_proc_lookup(default_tracer)) {
reset_tracer:
default_trace_flags &= ~TRACEE_FLAGS;
default_tracer = NIL;
@@ -265,7 +295,7 @@ get_default_tracing(Uint *flagsp, Eterm *tracerp)
void
erts_change_default_tracing(int setflags, Uint *flagsp, Eterm *tracerp)
{
- erts_smp_mtx_lock(&sys_trace_mtx);
+ erts_smp_rwmtx_rwlock(&sys_trace_rwmtx);
if (flagsp) {
if (setflags)
default_trace_flags |= *flagsp;
@@ -275,48 +305,48 @@ erts_change_default_tracing(int setflags, Uint *flagsp, Eterm *tracerp)
if (tracerp)
default_tracer = *tracerp;
get_default_tracing(flagsp, tracerp);
- erts_smp_mtx_unlock(&sys_trace_mtx);
+ erts_smp_rwmtx_rwunlock(&sys_trace_rwmtx);
}
void
erts_get_default_tracing(Uint *flagsp, Eterm *tracerp)
{
- erts_smp_mtx_lock(&sys_trace_mtx);
+ erts_smp_rwmtx_rlock(&sys_trace_rwmtx);
get_default_tracing(flagsp, tracerp);
- erts_smp_mtx_unlock(&sys_trace_mtx);
+ erts_smp_rwmtx_runlock(&sys_trace_rwmtx);
}
void
erts_set_system_monitor(Eterm monitor)
{
- erts_smp_mtx_lock(&sys_trace_mtx);
+ erts_smp_rwmtx_rwlock(&sys_trace_rwmtx);
system_monitor = monitor;
- erts_smp_mtx_unlock(&sys_trace_mtx);
+ erts_smp_rwmtx_rwunlock(&sys_trace_rwmtx);
}
Eterm
erts_get_system_monitor(void)
{
Eterm monitor;
- erts_smp_mtx_lock(&sys_trace_mtx);
+ erts_smp_rwmtx_rlock(&sys_trace_rwmtx);
monitor = system_monitor;
- erts_smp_mtx_unlock(&sys_trace_mtx);
+ erts_smp_rwmtx_runlock(&sys_trace_rwmtx);
return monitor;
}
/* Performance monitoring */
void erts_set_system_profile(Eterm profile) {
- erts_smp_mtx_lock(&sys_trace_mtx);
+ erts_smp_rwmtx_rwlock(&sys_trace_rwmtx);
system_profile = profile;
- erts_smp_mtx_unlock(&sys_trace_mtx);
+ erts_smp_rwmtx_rwunlock(&sys_trace_rwmtx);
}
Eterm
erts_get_system_profile(void) {
Eterm profile;
- erts_smp_mtx_lock(&sys_trace_mtx);
+ erts_smp_rwmtx_rlock(&sys_trace_rwmtx);
profile = system_profile;
- erts_smp_mtx_unlock(&sys_trace_mtx);
+ erts_smp_rwmtx_runlock(&sys_trace_rwmtx);
return profile;
}
@@ -379,13 +409,9 @@ WRITE_SYS_MSG_TO_PORT(Eterm unused_to,
}
#ifndef ERTS_SMP
- if (!INVALID_TRACER_PORT(trace_port, trace_port->id)) {
+ if (!INVALID_TRACER_PORT(trace_port, trace_port->id))
#endif
erts_raw_port_command(trace_port, buffer, ptr-buffer);
-#ifndef ERTS_SMP
- erts_port_release(trace_port);
- }
-#endif
erts_free(ERTS_ALC_T_TMP, (void *) buffer);
}
@@ -460,13 +486,13 @@ send_to_port(Process *c_p, Eterm message,
trace_port = NULL;
#else
- if (is_not_internal_port(*tracer_pid))
- goto invalid_tracer_port;
- trace_port = &erts_port[internal_port_index(*tracer_pid)];
+ trace_port = erts_id2port_sflgs(*tracer_pid,
+ NULL,
+ 0,
+ ERTS_PORT_SFLGS_INVALID_TRACER_LOOKUP);
- if (INVALID_TRACER_PORT(trace_port, *tracer_pid)) {
- invalid_tracer_port:
+ if (!trace_port) {
*tracee_flags &= ~TRACEE_FLAGS;
*tracer_pid = NIL;
return;
@@ -486,6 +512,7 @@ send_to_port(Process *c_p, Eterm message,
SYS_MSG_TYPE_TRACE,
message);
#ifndef ERTS_SMP
+ erts_port_release(trace_port);
return;
}
@@ -532,6 +559,9 @@ send_to_port(Process *c_p, Eterm message,
*/
do_send_schedfix_to_port(trace_port, c_p->id, ts);
}
+
+ erts_port_release(trace_port);
+
UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
#undef LOCAL_HEAP_SIZE
#endif
@@ -561,29 +591,38 @@ profile_send(Eterm from, Eterm message) {
Port *profiler_port = NULL;
/* not smp */
-
-
- profiler_port = &erts_port[internal_port_index(profiler)];
-
- do_send_to_port(profiler,
- profiler_port,
- NIL, /* or current process->id */
- SYS_MSG_TYPE_SYSPROF,
- message);
+
+ profiler_port = erts_id2port_sflgs(profiler,
+ NULL,
+ 0,
+ ERTS_PORT_SFLGS_INVALID_TRACER_LOOKUP);
+ if (profiler_port) {
+ do_send_to_port(profiler,
+ profiler_port,
+ NIL, /* or current process->id */
+ SYS_MSG_TYPE_SYSPROF,
+ message);
+ erts_port_release(profiler_port);
+ }
} else {
ASSERT(is_internal_pid(profiler)
&& internal_pid_index(profiler) < erts_max_processes);
- profile_p = process_tab[internal_pid_index(profiler)];
+ profile_p = erts_proc_lookup(profiler);
- if (INVALID_PID(profile_p, profiler)) return;
+ if (!profile_p)
+ return;
sz = size_object(message);
hp = erts_alloc_message_heap(sz, &bp, &off_heap, profile_p, 0);
msg = copy_struct(message, sz, &hp, &bp->off_heap);
- erts_queue_message(profile_p, NULL, bp, msg, NIL);
+ erts_queue_message(profile_p, NULL, bp, msg, NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
}
}
@@ -617,13 +656,11 @@ seq_trace_send_to_port(Process *c_p,
trace_port = NULL;
#else
- if (is_not_internal_port(seq_tracer))
- goto invalid_tracer_port;
-
- trace_port = &erts_port[internal_port_index(seq_tracer)];
-
- if (INVALID_TRACER_PORT(trace_port, seq_tracer)) {
- invalid_tracer_port:
+ 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);
@@ -641,6 +678,7 @@ seq_trace_send_to_port(Process *c_p,
message);
#ifndef ERTS_SMP
+ erts_port_release(trace_port);
UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
return;
}
@@ -682,6 +720,9 @@ seq_trace_send_to_port(Process *c_p,
*/
do_send_schedfix_to_port(trace_port, c_p->id, ts);
}
+
+ erts_port_release(trace_port);
+
UnUseTmpHeapNoproc(LOCAL_HEAP_SIZE);
#undef LOCAL_HEAP_SIZE
#endif
@@ -780,13 +821,8 @@ trace_sched_aux(Process *p, Eterm what, int never_fake_sched)
ERTS_GET_TRACER_REF(tracer_ref, p->tracer_proc, p->trace_flags);
}
- if (ERTS_PROC_IS_EXITING(p)
-#ifndef ERTS_SMP
- || p->status == P_FREE
-#endif
- ) {
+ if (ERTS_PROC_IS_EXITING(p))
curr_func = 0;
- }
else {
if (!p->current)
p->current = find_function_from_pc(p->i);
@@ -865,7 +901,7 @@ trace_send(Process *p, Eterm to, Eterm msg)
operation = am_send;
if (is_internal_pid(to)) {
- if (!erts_pid2proc(p, ERTS_PROC_LOCK_MAIN, to, 0))
+ if (!erts_proc_lookup(to))
goto send_to_non_existing_process;
}
else if(is_external_pid(to)
@@ -994,9 +1030,13 @@ seq_trace_update_send(Process *p)
{
Eterm seq_tracer = erts_get_system_seq_tracer();
ASSERT((is_tuple(SEQ_TRACE_TOKEN(p)) || is_nil(SEQ_TRACE_TOKEN(p))));
- if ( (p->id == seq_tracer) || (SEQ_TRACE_TOKEN(p) == NIL))
+ if ( (p->id == seq_tracer) || (SEQ_TRACE_TOKEN(p) == NIL)
+#ifdef USE_VM_PROBES
+ || (SEQ_TRACE_TOKEN(p) == am_have_dt_utag)
+#endif
+ ) {
return 0;
-
+ }
SEQ_TRACE_TOKEN_SENDER(p) = p->id; /* Internal pid */
SEQ_TRACE_TOKEN_SERIAL(p) =
make_small(++(p -> seq_trace_clock));
@@ -1103,8 +1143,8 @@ seq_trace_output_generic(Eterm token, Eterm msg, Uint type,
#ifndef ERTS_SMP
- tracer = process_tab[internal_pid_index(seq_tracer)];
- if (INVALID_PID(tracer, tracer->id)) {
+ tracer = erts_proc_lookup(seq_tracer);
+ if (!tracer) {
system_seq_tracer = am_false;
return; /* no need to send anything */
}
@@ -1178,7 +1218,11 @@ seq_trace_output_generic(Eterm token, Eterm msg, Uint type,
enqueue_sys_msg_unlocked(SYS_MSG_TYPE_SEQTRACE, NIL, NIL, mess, bp);
erts_smp_mtx_unlock(&smq_mtx);
#else
- erts_queue_message(tracer, NULL, bp, mess, NIL); /* trace_token must be NIL here */
+ erts_queue_message(tracer, NULL, bp, mess, NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ ); /* trace_token must be NIL here */
#endif
}
}
@@ -2090,187 +2134,6 @@ void save_calls(Process *p, Export *e)
}
}
-/*
- * Entry point called by the trace wrap functions in erl_bif_wrap.c
- *
- * The trace wrap functions are themselves called through the export
- * entries instead of the original BIF functions.
- */
-Eterm
-erts_bif_trace(int bif_index, Process* p, Eterm* args, BeamInstr* I)
-{
- Eterm result;
- int meta = !!(erts_bif_trace_flags[bif_index] & BIF_TRACE_AS_META);
-
- ERTS_SMP_CHK_HAVE_ONLY_MAIN_PROC_LOCK(p);
-
- if (!ARE_TRACE_FLAGS_ON(p, F_TRACE_CALLS) && (! meta)) {
- /* Warning! This is an Optimization.
- *
- * If neither meta trace is active nor process trace flags then
- * no tracing will occur. Doing the whole else branch will
- * also do nothing, only slower.
- */
- Eterm (*func)(Process*, Eterm*, BeamInstr*) = bif_table[bif_index].f;
- result = func(p, args, I);
- } else {
- Eterm (*func)(Process*, Eterm*, BeamInstr*);
- Export* ep = bif_export[bif_index];
- Uint32 flags = 0, flags_meta = 0;
- int global = !!(erts_bif_trace_flags[bif_index] & BIF_TRACE_AS_GLOBAL);
- int local = !!(erts_bif_trace_flags[bif_index] & BIF_TRACE_AS_LOCAL);
- int time = !!(erts_bif_trace_flags[bif_index] & BIF_TRACE_AS_CALL_TIME);
- Eterm meta_tracer_pid = NIL;
- int applying = (I == &(ep->code[3])); /* Yup, the apply code for a bif
- * is actually in the
- * export entry */
- BeamInstr *cp = p->cp;
-
- /*
- * Make continuation pointer OK, it is not during direct BIF calls,
- * but it is correct during apply of bif.
- */
- if (!applying) {
- p->cp = I;
- }
- if (global || local) {
- flags = erts_call_trace(p, ep->code, ep->match_prog_set, args,
- local, &p->tracer_proc);
- }
- if (meta) {
- flags_meta = erts_bif_mtrace(p, ep->code+3, args, local,
- &meta_tracer_pid);
- }
- if (time) {
- BpDataTime *bdt = NULL;
- BeamInstr *pc = (BeamInstr *)ep->code+3;
-
- bdt = (BpDataTime *) erts_get_time_break(p, pc);
- ASSERT(bdt);
-
- if (!bdt->pause) {
- erts_trace_time_break(p, pc, bdt, ERTS_BP_CALL_TIME_CALL);
- }
- }
- /* Restore original continuation pointer (if changed). */
- p->cp = cp;
-
- func = bif_table[bif_index].f;
-
- result = func(p, args, I);
-
- if (applying && (flags & MATCH_SET_RETURN_TO_TRACE)) {
- BeamInstr i_return_trace = beam_return_trace[0];
- BeamInstr i_return_to_trace = beam_return_to_trace[0];
- BeamInstr i_return_time_trace = beam_return_time_trace[0];
- Eterm *cpp;
- /* Maybe advance cp to skip trace stack frames */
- for (cpp = p->stop; ; cp = cp_val(*cpp++)) {
- if (*cp == i_return_trace) {
- /* Skip stack frame variables */
- while (is_not_CP(*cpp)) cpp++;
- cpp += 2; /* Skip return_trace parameters */
- } else if (*cp == i_return_time_trace) {
- /* Skip stack frame variables */
- while (is_not_CP(*cpp)) cpp++;
- cpp += 1; /* Skip return_time_trace parameters */
- } else if (*cp == i_return_to_trace) {
- /* A return_to trace message is going to be generated
- * by normal means, so we do not have to.
- */
- cp = NULL;
- break;
- } else break;
- }
- }
-
- /* Try to get these in the order
- * they usually appear in normal code... */
- if (is_non_value(result)) {
- Uint reason = p->freason;
- 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;
- ASSERT(is_tuple(value));
- tp = tuple_val(value);
- value = tp[1];
- }
- if ((reason & EXF_THROWN) && (p->catches <= 0)) {
- value = TUPLE2(nocatch, am_nocatch, value);
- reason = EXC_ERROR;
- }
- /* Note: expand_error_value() could theoretically
- * allocate on the heap, but not for any error
- * returned by a BIF, and it would do no harm,
- * just be annoying.
- */
- value = expand_error_value(p, reason, value);
- class = exception_tag[GET_EXC_CLASS(reason)];
-
- if (flags_meta & MATCH_SET_EXCEPTION_TRACE) {
- erts_trace_exception(p, ep->code, class, value,
- &meta_tracer_pid);
- }
- if (flags & MATCH_SET_EXCEPTION_TRACE) {
- erts_trace_exception(p, ep->code, class, value,
- &p->tracer_proc);
- }
- if ((flags & MATCH_SET_RETURN_TO_TRACE) && p->catches > 0) {
- /* can only happen if(local)*/
- Eterm *ptr = p->stop;
- ASSERT(is_CP(*ptr));
- ASSERT(ptr <= STACK_START(p));
- /* Search the nearest stack frame for a catch */
- while (++ptr < STACK_START(p)) {
- if (is_CP(*ptr)) break;
- if (is_catch(*ptr)) {
- if (applying) {
- /* Apply of BIF, cp is in calling function */
- if (cp) erts_trace_return_to(p, cp);
- } else {
- /* Direct bif call, I points into
- * calling function */
- erts_trace_return_to(p, I);
- }
- }
- }
- }
- UnUseTmpHeapNoproc(3);
- if ((flags_meta|flags) & MATCH_SET_EXCEPTION_TRACE) {
- erts_smp_proc_lock(p, ERTS_PROC_LOCKS_ALL_MINOR);
- p->trace_flags |= F_EXCEPTION_TRACE;
- erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL_MINOR);
- }
- }
- } else {
- if (flags_meta & MATCH_SET_RX_TRACE) {
- erts_trace_return(p, ep->code, result, &meta_tracer_pid);
- }
- /* MATCH_SET_RETURN_TO_TRACE cannot occur if(meta) */
- if (flags & MATCH_SET_RX_TRACE) {
- erts_trace_return(p, ep->code, result, &p->tracer_proc);
- }
- if (flags & MATCH_SET_RETURN_TO_TRACE) {
- /* can only happen if(local)*/
- if (applying) {
- /* Apply of BIF, cp is in calling function */
- if (cp) erts_trace_return_to(p, cp);
- } else {
- /* Direct bif call, I points into calling function */
- erts_trace_return_to(p, I);
- }
- }
- }
- }
- ERTS_SMP_CHK_HAVE_ONLY_MAIN_PROC_LOCK(p);
- return result;
-}
-
/* Sends trace message:
* {trace_ts, Pid, What, Msg, Timestamp}
* or {trace, Pid, What, Msg}
@@ -2434,10 +2297,9 @@ monitor_long_gc(Process *p, Uint time) {
#ifndef ERTS_SMP
ASSERT(is_internal_pid(system_monitor)
&& internal_pid_index(system_monitor) < erts_max_processes);
- monitor_p = process_tab[internal_pid_index(system_monitor)];
- if (INVALID_PID(monitor_p, system_monitor) || p == monitor_p) {
+ monitor_p = erts_proc_lookup(system_monitor);
+ if (!monitor_p || p == monitor_p)
return;
- }
#endif
hsz = 0;
@@ -2469,7 +2331,11 @@ monitor_long_gc(Process *p, Uint time) {
#ifdef ERTS_SMP
enqueue_sys_msg(SYS_MSG_TYPE_SYSMON, p->id, NIL, msg, bp);
#else
- erts_queue_message(monitor_p, NULL, bp, msg, NIL);
+ erts_queue_message(monitor_p, NULL, bp, msg, NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
#endif
}
@@ -2506,8 +2372,8 @@ monitor_large_heap(Process *p) {
#ifndef ERTS_SMP
ASSERT(is_internal_pid(system_monitor)
&& internal_pid_index(system_monitor) < erts_max_processes);
- monitor_p = process_tab[internal_pid_index(system_monitor)];
- if (INVALID_PID(monitor_p, system_monitor) || p == monitor_p) {
+ monitor_p = erts_proc_lookup(system_monitor);
+ if (monitor_p || p == monitor_p) {
return;
}
#endif
@@ -2541,7 +2407,11 @@ monitor_large_heap(Process *p) {
#ifdef ERTS_SMP
enqueue_sys_msg(SYS_MSG_TYPE_SYSMON, p->id, NIL, msg, bp);
#else
- erts_queue_message(monitor_p, NULL, bp, msg, NIL);
+ erts_queue_message(monitor_p, NULL, bp, msg, NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
#endif
}
@@ -2557,10 +2427,9 @@ monitor_generic(Process *p, Eterm type, Eterm spec) {
#ifndef ERTS_SMP
ASSERT(is_internal_pid(system_monitor)
&& internal_pid_index(system_monitor) < erts_max_processes);
- monitor_p = process_tab[internal_pid_index(system_monitor)];
- if (INVALID_PID(monitor_p, system_monitor) || p == monitor_p) {
+ monitor_p = erts_proc_lookup(system_monitor);
+ if (!monitor_p || p == monitor_p)
return;
- }
#endif
hp = ERTS_ALLOC_SYSMSG_HEAP(5, &bp, &off_heap, monitor_p);
@@ -2571,7 +2440,11 @@ monitor_generic(Process *p, Eterm type, Eterm spec) {
#ifdef ERTS_SMP
enqueue_sys_msg(SYS_MSG_TYPE_SYSMON, p->id, NIL, msg, bp);
#else
- erts_queue_message(monitor_p, NULL, bp, msg, NIL);
+ erts_queue_message(monitor_p, NULL, bp, msg, NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
#endif
}
@@ -3120,10 +2993,10 @@ sys_msg_disp_failure(ErtsSysMsgQ *smqp, Eterm receiver)
break;
case SYS_MSG_TYPE_SEQTRACE:
/* Reset seq_tracer if it hasn't changed */
- erts_smp_mtx_lock(&sys_trace_mtx);
+ erts_smp_rwmtx_rwlock(&sys_trace_rwmtx);
if (system_seq_tracer == receiver)
system_seq_tracer = am_false;
- erts_smp_mtx_unlock(&sys_trace_mtx);
+ erts_smp_rwmtx_rwunlock(&sys_trace_rwmtx);
break;
case SYS_MSG_TYPE_SYSMON:
if (receiver == NIL
@@ -3357,7 +3230,11 @@ sys_msg_dispatcher_func(void *unused)
}
else {
queue_proc_msg:
- erts_queue_message(proc,&proc_locks,smqp->bp,smqp->msg,NIL);
+ erts_queue_message(proc,&proc_locks,smqp->bp,smqp->msg,NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
#ifdef DEBUG_PRINTOUTS
erts_fprintf(stderr, "delivered\n");
#endif
@@ -3374,12 +3251,12 @@ sys_msg_dispatcher_func(void *unused)
goto queue_proc_msg;
}
else if (is_internal_port(receiver)) {
- port = erts_id2port(receiver, NULL, 0);
- if (INVALID_TRACER_PORT(port, receiver)) {
- if (port)
- erts_port_release(port);
+ port = erts_id2port_sflgs(receiver,
+ NULL,
+ 0,
+ ERTS_PORT_SFLGS_INVALID_TRACER_LOOKUP);
+ if (!port)
goto failure;
- }
else {
write_sys_msg_to_port(receiver,
port,
diff --git a/erts/emulator/beam/erl_unicode.c b/erts/emulator/beam/erl_unicode.c
index 6d5eae73b0..51559aea1c 100644
--- a/erts/emulator/beam/erl_unicode.c
+++ b/erts/emulator/beam/erl_unicode.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2012. 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
@@ -77,66 +77,25 @@ void erts_init_unicode(void)
{
max_loop_limit = CONTEXT_REDS * LOOP_FACTOR;
/* Non visual BIFs to trap to. */
- memset(&characters_to_utf8_trap_exp, 0, sizeof(Export));
- characters_to_utf8_trap_exp.address =
- &characters_to_utf8_trap_exp.code[3];
- characters_to_utf8_trap_exp.code[0] = am_erlang;
- characters_to_utf8_trap_exp.code[1] =
- am_atom_put("characters_to_utf8_trap",23);
- characters_to_utf8_trap_exp.code[2] = 3;
- characters_to_utf8_trap_exp.code[3] =
- (BeamInstr) em_apply_bif;
- characters_to_utf8_trap_exp.code[4] =
- (BeamInstr) &characters_to_utf8_trap;
-
- memset(&characters_to_list_trap_1_exp, 0, sizeof(Export));
- characters_to_list_trap_1_exp.address =
- &characters_to_list_trap_1_exp.code[3];
- characters_to_list_trap_1_exp.code[0] = am_erlang;
- characters_to_list_trap_1_exp.code[1] =
- am_atom_put("characters_to_list_trap_1",25);
- characters_to_list_trap_1_exp.code[2] = 3;
- characters_to_list_trap_1_exp.code[3] =
- (BeamInstr) em_apply_bif;
- characters_to_list_trap_1_exp.code[4] =
- (BeamInstr) &characters_to_list_trap_1;
-
- memset(&characters_to_list_trap_2_exp, 0, sizeof(Export));
- characters_to_list_trap_2_exp.address =
- &characters_to_list_trap_2_exp.code[3];
- characters_to_list_trap_2_exp.code[0] = am_erlang;
- characters_to_list_trap_2_exp.code[1] =
- am_atom_put("characters_to_list_trap_2",25);
- characters_to_list_trap_2_exp.code[2] = 3;
- characters_to_list_trap_2_exp.code[3] =
- (BeamInstr) em_apply_bif;
- characters_to_list_trap_2_exp.code[4] =
- (BeamInstr) &characters_to_list_trap_2;
-
-
- memset(&characters_to_list_trap_3_exp, 0, sizeof(Export));
- characters_to_list_trap_3_exp.address =
- &characters_to_list_trap_3_exp.code[3];
- characters_to_list_trap_3_exp.code[0] = am_erlang;
- characters_to_list_trap_3_exp.code[1] =
- am_atom_put("characters_to_list_trap_3",25);
- characters_to_list_trap_3_exp.code[2] = 3;
- characters_to_list_trap_3_exp.code[3] =
- (BeamInstr) em_apply_bif;
- characters_to_list_trap_3_exp.code[4] =
- (BeamInstr) &characters_to_list_trap_3;
-
- memset(&characters_to_list_trap_4_exp, 0, sizeof(Export));
- characters_to_list_trap_4_exp.address =
- &characters_to_list_trap_4_exp.code[3];
- characters_to_list_trap_4_exp.code[0] = am_erlang;
- characters_to_list_trap_4_exp.code[1] =
- am_atom_put("characters_to_list_trap_4",25);
- characters_to_list_trap_4_exp.code[2] = 1;
- characters_to_list_trap_4_exp.code[3] =
- (BeamInstr) em_apply_bif;
- characters_to_list_trap_4_exp.code[4] =
- (BeamInstr) &characters_to_list_trap_4;
+ erts_init_trap_export(&characters_to_utf8_trap_exp,
+ am_erlang, am_atom_put("characters_to_utf8_trap",23), 3,
+ &characters_to_utf8_trap);
+
+ erts_init_trap_export(&characters_to_list_trap_1_exp,
+ am_erlang, am_atom_put("characters_to_list_trap_1",25), 3,
+ &characters_to_list_trap_1);
+
+ erts_init_trap_export(&characters_to_list_trap_2_exp,
+ am_erlang, am_atom_put("characters_to_list_trap_2",25), 3,
+ &characters_to_list_trap_2);
+
+ erts_init_trap_export(&characters_to_list_trap_3_exp,
+ am_erlang, am_atom_put("characters_to_list_trap_3",25), 3,
+ &characters_to_list_trap_3);
+
+ erts_init_trap_export(&characters_to_list_trap_4_exp,
+ am_erlang, am_atom_put("characters_to_list_trap_4",25), 1,
+ &characters_to_list_trap_4);
c_to_b_int_trap_exportp = erts_export_put(am_unicode,am_characters_to_binary_int,2);
c_to_l_int_trap_exportp = erts_export_put(am_unicode,am_characters_to_list_int,2);
@@ -2027,12 +1986,14 @@ BIF_RETTYPE binary_to_existing_atom_2(BIF_ALIST_2)
* string routines, that will certainly fail on some OS.
*/
-char *erts_convert_filename_to_native(Eterm name, ErtsAlcType_t alloc_type, int allow_empty)
+char *erts_convert_filename_to_native(Eterm name, char *statbuf, size_t statbuf_size, ErtsAlcType_t alloc_type, int allow_empty, int allow_atom, Sint *used)
{
int encoding = erts_get_native_filename_encoding();
char* name_buf = NULL;
- if (is_atom(name) || is_list(name) || (allow_empty && is_nil(name))) {
+ if ((allow_atom && is_atom(name)) ||
+ is_list(name) ||
+ (allow_empty && is_nil(name))) {
Sint need;
if ((need = erts_native_filename_need(name,encoding)) < 0) {
return NULL;
@@ -2042,7 +2003,13 @@ char *erts_convert_filename_to_native(Eterm name, ErtsAlcType_t alloc_type, int
} else {
++need;
}
- name_buf = (char *) erts_alloc(alloc_type, need);
+ if (used)
+ *used = (Sint) need;
+ if (need > statbuf_size) {
+ name_buf = (char *) erts_alloc(alloc_type, need);
+ } else {
+ name_buf = statbuf;
+ }
erts_native_filename_put(name,encoding,(byte *)name_buf);
name_buf[need-1] = 0;
if (encoding == ERL_FILENAME_WIN_WCHAR) {
@@ -2058,14 +2025,26 @@ char *erts_convert_filename_to_native(Eterm name, ErtsAlcType_t alloc_type, int
bytes = erts_get_aligned_binary_bytes(name, &temp_alloc);
if (encoding != ERL_FILENAME_WIN_WCHAR) {
/*Add 0 termination only*/
- name_buf = (char *) erts_alloc(alloc_type, size+1);
+ if (used)
+ *used = (Sint) size+1;
+ if (size+1 > statbuf_size) {
+ name_buf = (char *) erts_alloc(alloc_type, size+1);
+ } else {
+ name_buf = statbuf;
+ }
memcpy(name_buf,bytes,size);
name_buf[size]=0;
} else if (erts_analyze_utf8(bytes,size,&err_pos,&num_chars,NULL) != ERTS_UTF8_OK ||
erts_get_user_requested_filename_encoding() == ERL_FILENAME_LATIN1) {
byte *p;
/* What to do now? Maybe latin1, so just take byte for byte instead */
- name_buf = (char *) erts_alloc(alloc_type, (size+1)*2);
+ if (used)
+ *used = (Sint) (size+1)*2;
+ if ((size+1)*2 > statbuf_size) {
+ name_buf = (char *) erts_alloc(alloc_type, (size+1)*2);
+ } else {
+ name_buf = statbuf;
+ }
p = (byte *) name_buf;
while (size--) {
*p++ = *bytes++;
@@ -2074,7 +2053,13 @@ char *erts_convert_filename_to_native(Eterm name, ErtsAlcType_t alloc_type, int
*p++ = 0;
*p++ = 0;
} else { /* WIN_WCHAR and valid UTF8 */
- name_buf = (char *) erts_alloc(alloc_type, (num_chars+1)*2);
+ if (used)
+ *used = (Sint) (num_chars+1)*2;
+ if ((num_chars+1)*2 > statbuf_size) {
+ name_buf = (char *) erts_alloc(alloc_type, (num_chars+1)*2);
+ } else {
+ name_buf = statbuf;
+ }
erts_copy_utf8_to_utf16_little((byte *) name_buf, bytes, num_chars);
name_buf[num_chars*2] = 0;
name_buf[num_chars*2+1] = 0;
@@ -2086,6 +2071,71 @@ char *erts_convert_filename_to_native(Eterm name, ErtsAlcType_t alloc_type, int
return name_buf;
}
+static int filename_len_16bit(byte *str)
+{
+ byte *p = str;
+ while(*p != '\0' || p[1] != '\0') {
+ p += 2;
+ }
+ return (p - str);
+}
+Eterm erts_convert_native_to_filename(Process *p, byte *bytes)
+{
+ Uint size,num_chars;
+ Eterm *hp;
+ byte *err_pos;
+ Uint num_built; /* characters */
+ Uint num_eaten; /* bytes */
+ Eterm ret;
+ int mac = 0;
+
+ switch (erts_get_native_filename_encoding()) {
+ case ERL_FILENAME_LATIN1:
+ goto noconvert;
+ case ERL_FILENAME_UTF8_MAC:
+ mac = 1;
+ case ERL_FILENAME_UTF8:
+ size = strlen((char *) bytes);
+ if (erts_analyze_utf8(bytes,size,&err_pos,&num_chars,NULL) != ERTS_UTF8_OK) {
+ goto noconvert;
+ }
+ num_built = 0;
+ num_eaten = 0;
+ if (mac) {
+ ret = do_utf8_to_list_normalize(p, num_chars, bytes, size);
+ } else {
+ ret = do_utf8_to_list(p, num_chars, bytes, size, num_chars, &num_built, &num_eaten, NIL);
+ }
+ return ret;
+ case ERL_FILENAME_WIN_WCHAR:
+ size=filename_len_16bit(bytes);
+ if ((size % 2) != 0) { /* Panic fixup to avoid crashing the emulator */
+ size--;
+ hp = HAlloc(p, size+2);
+ ret = CONS(hp,make_small((Uint) bytes[size]),NIL);
+ hp += 2;
+ } else {
+ hp = HAlloc(p, size);
+ ret = NIL;
+ }
+ bytes += size-1;
+ while (size > 0) {
+ Uint x = ((Uint) *bytes--) << 8;
+ x |= ((Uint) *bytes--);
+ size -= 2;
+ ret = CONS(hp,make_small(x),ret);
+ hp += 2;
+ }
+ return ret;
+ default:
+ goto noconvert;
+ }
+ noconvert:
+ size = strlen((char *) bytes);
+ hp = HAlloc(p, 2 * size);
+ return erts_bin_bytes_to_list(NIL, hp, bytes, size, 0);
+}
+
Sint erts_native_filename_need(Eterm ioterm, int encoding)
{
@@ -2619,3 +2669,4 @@ BIF_RETTYPE file_native_name_encoding_0(BIF_ALIST_0)
BIF_RET(am_undefined);
}
}
+
diff --git a/erts/emulator/beam/erl_vm.h b/erts/emulator/beam/erl_vm.h
index 5dc307e383..c962955de9 100644
--- a/erts/emulator/beam/erl_vm.h
+++ b/erts/emulator/beam/erl_vm.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -29,19 +29,10 @@
/* #define FORCE_HEAP_FRAGS */
-#if defined(HYBRID)
-/* # define CHECK_FOR_HOLES */
-#endif
-
#if defined(DEBUG) && !defined(CHECK_FOR_HOLES) && !defined(__WIN32__)
# define CHECK_FOR_HOLES
#endif
-#if defined(HYBRID)
-/* # define INCREMENTAL 1 */ /* Incremental garbage collection */
-/* # define INC_TIME_BASED 1 */ /* Time-based incremental GC (vs Work-based) */
-#endif
-
#define BEAM 1
#define EMULATOR "BEAM"
#define SEQ_TRACE 1
@@ -70,16 +61,6 @@
#define H_DEFAULT_SIZE 233 /* default (heap + stack) min size */
#define VH_DEFAULT_SIZE 32768 /* default virtual (bin) heap min size (words) */
-#ifdef HYBRID
-# define SH_DEFAULT_SIZE 2629425 /* default message area min size */
-#endif
-
-#ifdef INCREMENTAL
-# define INC_NoPAGES 256 /* Number of pages in the old generation */
-# define INC_PAGESIZE 32768 /* The size of each page */
-# define INC_STORAGE_SIZE 1024 /* The size of gray stack and similar */
-#endif
-
#define CP_SIZE 1
#define ErtsHAllocLockCheck(P) \
diff --git a/erts/emulator/beam/erlang_dtrace.d b/erts/emulator/beam/erlang_dtrace.d
new file mode 100644
index 0000000000..e3ebbb84f4
--- /dev/null
+++ b/erts/emulator/beam/erlang_dtrace.d
@@ -0,0 +1,3636 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Dustin Sallings, Michal Ptaszek, Scott Lystig Fritchie 2011-2012.
+ * All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+/*
+ * A note on probe naming: if "__" appears in a provider probe
+ * definition, then two things happen during compilation:
+ *
+ * 1. The "__" will turn into a hypen, "-", for the probe name.
+ * 2. The "__" will turn into a single underscore, "_", for the
+ * macro names and function definitions that the compiler and
+ * C developers will see.
+ *
+ * We'll try to use the following naming convention. We're a bit
+ * limited because, as a USDT probe, we can only specify the 4th part
+ * of the probe name, e.g. erlang*:::mumble. The 2nd part of the
+ * probe name is always going to be "beam" or "beam.smp", and the 3rd
+ * part of the probe name will always be the name of the function
+ * that's calling the probe.
+ *
+ * So, all probes will be have names defined in this file using the
+ * convention category__name or category__sub_category__name. This
+ * will translate to probe names of category-name or
+ * category-sub_category-name.
+ *
+ * Each of "category", "sub_category", and "name" may have underscores
+ * but may not have hyphens.
+ */
+
+provider erlang {
+ /**
+ * Fired when a message is sent from one local process to another.
+ *
+ * NOTE: The 'size' parameter is in machine-dependent words and
+ * that the actual size of any binary terms in the message
+ * are not included.
+ *
+ * @param sender the PID (string form) of the sender
+ * @param receiver the PID (string form) of the receiver
+ * @param size the size of the message being delivered (words)
+ * @param token_label for the sender's sequential trace token
+ * @param token_previous count for the sender's sequential trace token
+ * @param token_current count for the sender's sequential trace token
+ */
+ probe message__send(char *sender, char *receiver, uint32_t size,
+ int token_label, int token_previous, int token_current);
+
+ /**
+ * Fired when a message is sent from a local process to a remote process.
+ *
+ * NOTE: The 'size' parameter is in machine-dependent words and
+ * that the actual size of any binary terms in the message
+ * are not included.
+ *
+ * @param sender the PID (string form) of the sender
+ * @param node_name the Erlang node name (string form) of the receiver
+ * @param receiver the PID/name (string form) of the receiver
+ * @param size the size of the message being delivered (words)
+ * @param token_label for the sender's sequential trace token
+ * @param token_previous count for the sender's sequential trace token
+ * @param token_current count for the sender's sequential trace token
+ */
+ probe message__send__remote(char *sender, char *node_name, char *receiver,
+ uint32_t size,
+ int token_label, int token_previous, int token_current);
+
+ /**
+ * Fired when a message is queued to a local process. This probe
+ * will not fire if the sender's pid == receiver's pid.
+ *
+ * NOTE: The 'size' parameter is in machine-dependent words and
+ * that the actual size of any binary terms in the message
+ * are not included.
+ *
+ * NOTE: In cases of messages in external format (i.e. from another
+ * Erlang node), we probably don't know the message size
+ * without performing substantial extra computation. To
+ * avoid the extra CPU overhead, the message size may be
+ * reported as -1, which can appear to a D script as 4294967295.
+ *
+ * @param receiver the PID (string form) of the receiver
+ * @param size the size of the message being delivered (words)
+ * @param queue_len length of the queue of the receiving process
+ * @param token_label for the sender's sequential trace token
+ * @param token_previous count for the sender's sequential trace token
+ * @param token_current count for the sender's sequential trace token
+ */
+ probe message__queued(char *receiver, uint32_t size, uint32_t queue_len,
+ int token_label, int token_previous, int token_current);
+
+ /**
+ * Fired when a message is 'receive'd by a local process and removed
+ * from its mailbox.
+ *
+ * NOTE: The 'size' parameter is in machine-dependent words and
+ * that the actual size of any binary terms in the message
+ * are not included.
+ *
+ * NOTE: In cases of messages in external format (i.e. from another
+ * Erlang node), we probably don't know the message size
+ * without performing substantial extra computation. To
+ * avoid the extra CPU overhead, the message size may be
+ * reported as -1, which can appear to a D script as 4294967295.
+ *
+ * @param receiver the PID (string form) of the receiver
+ * @param size the size of the message being delivered (words)
+ * @param queue_len length of the queue of the receiving process
+ * @param token_label for the sender's sequential trace token
+ * @param token_previous count for the sender's sequential trace token
+ * @param token_current count for the sender's sequential trace token
+ */
+ probe message__receive(char *receiver, uint32_t size, uint32_t queue_len,
+ int token_label, int token_previous, int token_current);
+
+ /**
+ * Fired when an Eterm structure is being copied.
+ *
+ * NOTE: Due to the placement of this probe, the process ID of
+ * owner of the Eterm is not available.
+ *
+ * @param size the size of the structure
+ */
+ probe copy__struct(uint32_t size);
+
+ /**
+ * Fired when an Eterm is being copied onto a process.
+ *
+ * @param proc the PID (string form) of the recipient process
+ * @param size the size of the structure
+ */
+ probe copy__object(char *proc, uint32_t size);
+
+ /* PID, Module, Function, Arity */
+
+ /**
+ * Fired whenever a user function is being called locally.
+ *
+ * @param p the PID (string form) of the process
+ * @param mfa the m:f/a of the function
+ * @param depth the stack depth
+ */
+ probe local__function__entry(char *p, char *mfa, int depth);
+
+ /**
+ * Fired whenever a user function is called externally
+ * (through an export entry).
+ *
+ * @param p the PID (string form) of the process
+ * @param mfa the m:f/a of the function
+ * @param depth the stack depth
+ */
+ probe global__function__entry(char *p, char *mfa, int depth);
+
+ /**
+ * Fired whenever a user function returns.
+ *
+ * @param p the PID (string form) of the process
+ * @param mfa the m:f/a of the function
+ * @param depth the stack depth
+ */
+ probe function__return(char *p, char *mfa, int depth);
+
+ /**
+ * Fired whenever a Built In Function is called.
+ *
+ * @param p the PID (string form) of the process
+ * @param mfa the m:f/a of the function
+ */
+ probe bif__entry(char *p, char *mfa);
+
+ /**
+ * Fired whenever a Built In Function returns.
+ *
+ * @param p the PID (string form) of the process
+ * @param mfa the m:f/a of the function
+ */
+ probe bif__return(char *p, char *mfa);
+
+ /**
+ * Fired whenever a Native Function is called.
+ *
+ * @param p the PID (string form) of the process
+ * @param mfa the m:f/a of the function
+ */
+ probe nif__entry(char *p, char *mfa);
+
+ /**
+ * Fired whenever a Native Function returns.
+ *
+ * @param p the PID (string form) of the process
+ * @param mfa the m:f/a of the function
+ */
+ probe nif__return(char *p, char *mfa);
+
+ /**
+ * Fired when a major GC is starting.
+ *
+ * @param p the PID (string form) of the exiting process
+ * @param need the number of words needed on the heap
+ */
+ probe gc_major__start(char *p, int need);
+
+ /**
+ * Fired when a minor GC is starting.
+ *
+ * @param p the PID (string form) of the exiting process
+ * @param need the number of words needed on the heap
+ */
+ probe gc_minor__start(char *p, int need);
+
+ /**
+ * Fired when a major GC is starting.
+ *
+ * @param p the PID (string form) of the exiting process
+ * @param reclaimed the amount of space reclaimed
+ */
+ probe gc_major__end(char *p, int reclaimed);
+
+ /**
+ * Fired when a minor GC is starting.
+ *
+ * @param p the PID (string form) of the exiting process
+ * @param reclaimed the amount of space reclaimed
+ */
+ probe gc_minor__end(char *p, int reclaimed);
+
+ /**
+ * Fired when a process is spawned.
+ *
+ * @param p the PID (string form) of the new process.
+ * @param mfa the m:f/a of the function
+ */
+ probe process__spawn(char *p, char *mfa);
+
+ /**
+ * Fired when a process is exiting.
+ *
+ * @param p the PID (string form) of the exiting process
+ * @param reason the reason for the exit (may be truncated)
+ */
+ probe process__exit(char *p, char *reason);
+
+ /**
+ * Fired when exit signal is delivered to a local process.
+ *
+ * @param sender the PID (string form) of the exiting process
+ * @param receiver the PID (string form) of the process receiving EXIT signal
+ * @param reason the reason for the exit (may be truncated)
+ */
+ probe process__exit_signal(char *sender, char *receiver, char *reason);
+
+ /**
+ * Fired when exit signal is delivered to a remote process.
+ *
+ * @param sender the PID (string form) of the exiting process
+ * @param node_name the Erlang node name (string form) of the receiver
+ * @param receiver the PID (string form) of the process receiving EXIT signal
+ * @param reason the reason for the exit (may be truncated)
+ * @param token_label for the sender's sequential trace token
+ * @param token_previous count for the sender's sequential trace token
+ * @param token_current count for the sender's sequential trace token
+ */
+ probe process__exit_signal__remote(char *sender, char *node_name,
+ char *receiver, char *reason,
+ int token_label, int token_previous, int token_current);
+
+ /**
+ * Fired when a process is scheduled.
+ *
+ * @param p the PID (string form) of the newly scheduled process
+ * @param mfa the m:f/a of the function it should run next
+ */
+ probe process__scheduled(char *p, char *mfa);
+
+ /**
+ * Fired when a process is unscheduled.
+ *
+ * @param p the PID (string form) of the process that has been
+ * unscheduled.
+ */
+ probe process__unscheduled(char *p);
+
+ /**
+ * Fired when a process goes into hibernation.
+ *
+ * @param p the PID (string form) of the process entering hibernation
+ * @param mfa the m:f/a of the location to resume
+ */
+ probe process__hibernate(char *p, char *mfa);
+
+ /**
+ * Fired when a process is unblocked after a port has been unblocked.
+ *
+ * @param p the PID (string form) of the process that has been
+ * unscheduled.
+ * @param port the port that is no longer busy (i.e., is now unblocked)
+ */
+ probe process__port_unblocked(char *p, char *port);
+
+ /**
+ * Fired when process' heap is growing.
+ *
+ * @param p the PID (string form)
+ * @param old_size the size of the old heap
+ * @param new_size the size of the new heap
+ */
+ probe process__heap_grow(char *p, int old_size, int new_size);
+
+ /**
+ * Fired when process' heap is shrinking.
+ *
+ * @param p the PID (string form)
+ * @param old_size the size of the old heap
+ * @param new_size the size of the new heap
+ */
+ probe process__heap_shrink(char *p, int old_size, int new_size);
+
+ /* network distribution */
+
+ /**
+ * Fired when network distribution event monitor events are triggered.
+ *
+ * @param node the name of the reporting node
+ * @param what the type of event, e.g., nodeup, nodedown
+ * @param monitored_node the name of the monitored node
+ * @param type the type of node, e.g., visible, hidden
+ * @param reason the reason term, e.g., normal, connection_closed, term()
+ */
+ probe dist__monitor(char *node, char *what, char *monitored_node,
+ char *type, char *reason);
+
+ /**
+ * Fired when network distribution port is busy (i.e. blocked),
+ * usually due to the remote node not consuming distribution
+ * data quickly enough.
+ *
+ * @param node the name of the reporting node
+ * @param port the port ID of the busy port
+ * @param remote_node the name of the remote node.
+ * @param pid the PID (string form) of the local process that has
+ * become unschedulable until the port becomes unblocked.
+ */
+ probe dist__port_busy(char *node, char *port, char *remote_node,
+ char *pid);
+
+ /**
+ * Fired when network distribution's driver's "output" callback is called
+ *
+ * @param node the name of the reporting node
+ * @param port the port ID of the busy port
+ * @param remote_node the name of the remote node.
+ * @param bytes the number of bytes written
+ */
+ probe dist__output(char *node, char *port, char *remote_node, int bytes);
+
+ /**
+ * Fired when network distribution's driver's "outputv" callback is called
+ *
+ * @param node the name of the reporting node
+ * @param port the port ID of the busy port
+ * @param remote_node the name of the remote node.
+ * @param bytes the number of bytes written
+ */
+ probe dist__outputv(char *node, char *port, char *remote_node, int bytes);
+
+ /**
+ * Fired when network distribution port is no longer busy (i.e. blocked).
+ *
+ * NOTE: This probe may fire multiple times after the same single
+ * dist-port_busy probe firing.
+ *
+ * @param node the name of the reporting node
+ * @param port the port ID of the busy port
+ * @param remote_node the name of the remote node.
+ */
+ probe dist__port_not_busy(char *node, char *port, char *remote_node);
+
+ /* ports */
+
+ /**
+ * Fired when new port is opened.
+ *
+ * @param process the PID (string form)
+ * @param port_name the string used when the port was opened
+ * @param port the Port (string form) of the new port
+ */
+ probe port__open(char *process, char *port_name, char *port);
+
+ /**
+ * Fired when port_command is issued.
+ *
+ * @param process the PID (string form)
+ * @param port the Port (string form)
+ * @param port_name the string used when the port was opened
+ * @param command_type type of the issued command, one of: "close", "command" or "connect"
+ */
+ probe port__command(char *process, char *port, char *port_name, char *command_type);
+
+ /**
+ * Fired when port_control is issued.
+ *
+ * @param process the PID (string form)
+ * @param port the Port (string form)
+ * @param port_name the string used when the port was opened
+ * @param command_no command number that has been issued to the port
+ */
+ probe port__control(char *process, char *port, char *port_name, int command_no);
+
+ /**
+ * Fired when port is closed via port_close/1 (reason = 'normal')
+ * or is sent an exit signal.
+ *
+ * @param process the PID (string form)
+ * @param port the Port (string form)
+ * @param port_name the string used when the port was opened
+ * @param reason Erlang term representing the exit signal, e.g. 'normal'
+ */
+ probe port__exit(char *process, char *port, char *port_name,
+ char *new_process);
+
+ /**
+ * Fired when port_connect is issued.
+ *
+ * @param process the PID (string form) of the current port owner
+ * @param port the Port (string form)
+ * @param port_name the string used when the port was opened
+ * @param new_process the PID (string form) of the new port owner
+ */
+ probe port__connect(char *process, char *port, char *port_name,
+ char *new_process);
+
+ /**
+ * Fired when a port is busy (i.e. blocked)
+ *
+ * @param port the port ID of the busy port
+ */
+ probe port__busy(char *port);
+
+ /**
+ * Fired when a port is no longer busy (i.e. no longer blocked)
+ *
+ * @param port the port ID of the not busy port
+ */
+ probe port__not_busy(char *port);
+
+ /* drivers */
+
+ /**
+ * Fired when drivers's "init" callback is called.
+ *
+ * @param name the name of the driver
+ * @param major the major version number
+ * @param minor the minor version number
+ * @param flags the flags argument
+ */
+ probe driver__init(char *name, int major, int minor, int flags);
+
+ /**
+ * Fired when drivers's "start" callback is called.
+ *
+ * @param process the PID (string form) of the calling process
+ * @param name the name of the driver
+ * @param port the Port (string form) of the driver's port
+ */
+ probe driver__start(char *process, char *name, char *port);
+
+ /**
+ * Fired when drivers's "stop" callback is called.
+ *
+ * @param process the PID (string form) of the calling process
+ * @param name the name of the driver
+ * @param port the Port (string form) of the driver's port
+ */
+ probe driver__stop(char *process, char *name, char *port);
+
+ /**
+ * Fired when drivers's "finish" callback is called.
+ *
+ * @param name the name of the driver
+ */
+ probe driver__finish(char *name);
+
+ /**
+ * Fired when drivers's "flush" callback is called.
+ *
+ * @param process the PID (string form)
+ * @param port the Port (string form)
+ * @param port_name the string used when the port was opened
+ */
+ probe driver__flush(char *process, char *port, char *port_name);
+
+ /**
+ * Fired when driver's "output" callback is called
+ *
+ * @param process the PID (string form)
+ * @param port the Port (string form)
+ * @param port_name the string used when the port was opened
+ * @param bytes the number of bytes written
+ */
+ probe driver__output(char *node, char *port, char *port_name, int bytes);
+
+ /**
+ * Fired when driver's "outputv" callback is called
+ *
+ * @param process the PID (string form)
+ * @param port the Port (string form)
+ * @param port_name the string used when the port was opened
+ * @param bytes the number of bytes written
+ */
+ probe driver__outputv(char *node, char *port, char *port_name, int bytes);
+
+ /**
+ * Fired when driver's "control" callback is called
+ *
+ * @param process the PID (string form)
+ * @param port the Port (string form)
+ * @param port_name the string used when the port was opened
+ * @param command the command #
+ * @param bytes the number of bytes written
+ */
+ probe driver__control(char *node, char *port, char *port_name,
+ int command, int bytes);
+
+ /**
+ * Fired when driver's "call" callback is called
+ *
+ * @param process the PID (string form)
+ * @param port the Port (string form)
+ * @param port_name the string used when the port was opened
+ * @param command the command #
+ * @param bytes the number of bytes written
+ */
+ probe driver__call(char *node, char *port, char *port_name,
+ int command, int bytes);
+
+ /**
+ * Fired when driver's "event" callback is called
+ *
+ * @param process the PID (string form)
+ * @param port the Port (string form)
+ * @param port_name the string used when the port was opened
+ */
+ probe driver__event(char *node, char *port, char *port_name);
+
+ /**
+ * Fired when driver's "ready_input" callback is called
+ *
+ * @param process the PID (string form)
+ * @param port the Port (string form)
+ * @param port_name the string used when the port was opened
+ */
+ probe driver__ready_input(char *node, char *port, char *port_name);
+
+ /**
+ * Fired when driver's "read_output" callback is called
+ *
+ * @param process the PID (string form)
+ * @param port the Port (string form)
+ * @param port_name the string used when the port was opened
+ */
+ probe driver__ready_output(char *node, char *port, char *port_name);
+
+ /**
+ * Fired when driver's "timeout" callback is called
+ *
+ * @param process the PID (string form)
+ * @param port the Port (string form)
+ * @param port_name the string used when the port was opened
+ */
+ probe driver__timeout(char *node, char *port, char *port_name);
+
+ /**
+ * Fired when drivers's "ready_async" callback is called.
+ *
+ * @param process the PID (string form)
+ * @param port the Port (string form)
+ * @param port_name the string used when the port was opened
+ */
+ probe driver__ready_async(char *process, char *port, char *port_name);
+
+ /**
+ * Fired when driver's "process_exit" callback is called
+ *
+ * @param process the PID (string form)
+ * @param port the Port (string form)
+ * @param port_name the string used when the port was opened
+ */
+ probe driver__process_exit(char *node, char *port, char *port_name);
+
+ /**
+ * Fired when driver's "stop_select" callback is called
+ *
+ * @param name the name of the driver
+ */
+ probe driver__stop_select(char *name);
+
+
+ /* Async driver pool */
+
+ /**
+ * Show the post-add length of the async driver thread pool member's queue.
+ *
+ * NOTE: The port name is not available: additional lock(s) must
+ * be acquired in order to get the port name safely in an SMP
+ * environment. The same is true for the aio__pool_get probe.
+ *
+ * @param port the Port (string form)
+ * @param new queue length
+ */
+ probe aio_pool__add(char *, int);
+
+ /**
+ * Show the post-get length of the async driver thread pool member's queue.
+ *
+ * @param port the Port (string form)
+ * @param new queue length
+ */
+ probe aio_pool__get(char *, int);
+
+ /* Probes for efile_drv.c */
+
+ /**
+ * Entry into the efile_drv.c file I/O driver
+ *
+ * For a list of command numbers used by this driver, see the section
+ * "Guide to efile_drv.c probe arguments" in ../../../HOWTO/DTRACE.md.
+ * That section also contains explanation of the various integer and
+ * string arguments that may be present when any particular probe fires.
+ *
+ * NOTE: Not all Linux platforms (using SystemTap) can support
+ * arguments beyond arg9.
+ *
+ *
+ * TODO: Adding the port string, args[10], is a pain. Making that
+ * port string available to all the other efile_drv.c probes
+ * will be more pain. Is the pain worth it? If yes, then
+ * add them everywhere else and grit our teeth. If no, then
+ * rip it out.
+ *
+ * @param thread-id number of the scheduler Pthread arg0
+ * @param tag number: {thread-id, tag} uniquely names a driver operation
+ * @param user-tag string arg2
+ * @param command number arg3
+ * @param string argument 1 arg4
+ * @param string argument 2 arg5
+ * @param integer argument 1 arg6
+ * @param integer argument 2 arg7
+ * @param integer argument 3 arg8
+ * @param integer argument 4 arg9
+ * @param port the port ID of the busy port args[10]
+ */
+ probe efile_drv__entry(int, int, char *, int, char *, char *,
+ int64_t, int64_t, int64_t, int64_t, char *);
+
+ /**
+ * Entry into the driver's internal work function. Computation here
+ * is performed by a async worker pool Pthread.
+ *
+ * @param thread-id number
+ * @param tag number
+ * @param command number
+ */
+ probe efile_drv__int_entry(int, int, int);
+
+ /**
+ * Return from the driver's internal work function.
+ *
+ * @param thread-id number
+ * @param tag number
+ * @param command number
+ */
+ probe efile_drv__int_return(int, int, int);
+
+ /**
+ * Return from the efile_drv.c file I/O driver
+ *
+ * @param thread-id number arg0
+ * @param tag number arg1
+ * @param user-tag string arg2
+ * @param command number arg3
+ * @param Success? 1 is success, 0 is failure arg4
+ * @param If failure, the errno of the error. arg5
+ */
+ probe efile_drv__return(int, int, char *, int, int, int);
+
+/*
+ * NOTE:
+ * For formatting int64_t arguments within a D script, see:
+ *
+ * http://mail.opensolaris.org/pipermail/dtrace-discuss/2006-November/002830.html
+ * Summary:
+ * "1) you don't need the 'l' printf() modifiers with DTrace ever"
+ */
+
+/*
+ * NOTE: For file_drv_return + SMP + R14B03 (and perhaps other
+ * releases), the sched-thread-id will be the same as the
+ * work-thread-id: erl_async.c's async_main() function
+ * will call the asynchronous invoke function and then
+ * immediately call the drivers ready_async function while
+ * inside the same I/O worker pool thread.
+ * For R14B03's source, see erl_async.c lines 302-317.
+ */
+
+/*
+ * The set of probes for use by Erlang code ... moved to here from
+ * lib/runtime_tools/c_src/dtrace_user.d until a more portable solution
+ * is found. This move pollutes the Erlang VM with functions that are
+ * only used by the NIF shared library code in
+ * lib/runtime_tools/c_src/dyntrace.c. The reason this is necessary is
+ * in order to work around an issue on several platforms, including
+ * SystemTap 1.3 and Solaris. The Solaris issue is discussed in the
+ * `dtrace-discuss` mailing list thread on 01 Dec 2011 17:58:15.
+ */
+ /**
+ * If you use only a single probe, but you also embed that probe
+ * in many different places in your code, if that probe fires 100K
+ * or more times per second, then it *will* hurt when you have to
+ * enable that probe.
+ *
+ * However, if you have any different probes, then you can ensure
+ * that any probe on a hot code path will use separate probe(s)
+ * than everyone else ... and you can then enable many non-hot
+ * probes in production without worry about creating too much
+ * measurement overhead.
+ *
+ * In an ideal world, we would use the libusdt library to be able
+ * to create arbitrary DTrace probes with more convenient and
+ * meaningful names than "user_trace-n7". But libusdt doesn't
+ * (yet) support all of the platforms that DTrace does, and there
+ * is no known (yet) equivalent for SystemTap.
+ */
+ probe user_trace__n0(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n1(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n2(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n3(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n4(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n5(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n6(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n7(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n8(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n9(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n10(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n11(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n12(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n13(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n14(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n15(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n16(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n17(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n18(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n19(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n20(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n21(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n22(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n23(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n24(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n25(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n26(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n27(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n28(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n29(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n30(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n31(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n32(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n33(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n34(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n35(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n36(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n37(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n38(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n39(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n40(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n41(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n42(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n43(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n44(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n45(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n46(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n47(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n48(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n49(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n50(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n51(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n52(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n53(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n54(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n55(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n56(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n57(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n58(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n59(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n60(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n61(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n62(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n63(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n64(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n65(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n66(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n67(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n68(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n69(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n70(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n71(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n72(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n73(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n74(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n75(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n76(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n77(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n78(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n79(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n80(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n81(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n82(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n83(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n84(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n85(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n86(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n87(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n88(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n89(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n90(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n91(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n92(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n93(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n94(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n95(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n96(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n97(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n98(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n99(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n100(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n101(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n102(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n103(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n104(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n105(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n106(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n107(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n108(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n109(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n110(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n111(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n112(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n113(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n114(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n115(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n116(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n117(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n118(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n119(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n120(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n121(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n122(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n123(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n124(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n125(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n126(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n127(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n128(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n129(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n130(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n131(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n132(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n133(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n134(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n135(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n136(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n137(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n138(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n139(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n140(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n141(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n142(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n143(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n144(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n145(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n146(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n147(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n148(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n149(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n150(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n151(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n152(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n153(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n154(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n155(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n156(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n157(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n158(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n159(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n160(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n161(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n162(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n163(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n164(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n165(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n166(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n167(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n168(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n169(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n170(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n171(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n172(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n173(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n174(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n175(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n176(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n177(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n178(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n179(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n180(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n181(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n182(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n183(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n184(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n185(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n186(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n187(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n188(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n189(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n190(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n191(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n192(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n193(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n194(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n195(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n196(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n197(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n198(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n199(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n200(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n201(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n202(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n203(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n204(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n205(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n206(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n207(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n208(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n209(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n210(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n211(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n212(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n213(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n214(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n215(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n216(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n217(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n218(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n219(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n220(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n221(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n222(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n223(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n224(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n225(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n226(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n227(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n228(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n229(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n230(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n231(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n232(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n233(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n234(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n235(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n236(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n237(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n238(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n239(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n240(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n241(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n242(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n243(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n244(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n245(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n246(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n247(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n248(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n249(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n250(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n251(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n252(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n253(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n254(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n255(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n256(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n257(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n258(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n259(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n260(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n261(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n262(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n263(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n264(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n265(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n266(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n267(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n268(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n269(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n270(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n271(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n272(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n273(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n274(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n275(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n276(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n277(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n278(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n279(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n280(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n281(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n282(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n283(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n284(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n285(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n286(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n287(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n288(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n289(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n290(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n291(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n292(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n293(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n294(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n295(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n296(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n297(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n298(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n299(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n300(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n301(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n302(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n303(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n304(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n305(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n306(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n307(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n308(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n309(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n310(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n311(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n312(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n313(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n314(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n315(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n316(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n317(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n318(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n319(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n320(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n321(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n322(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n323(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n324(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n325(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n326(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n327(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n328(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n329(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n330(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n331(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n332(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n333(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n334(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n335(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n336(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n337(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n338(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n339(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n340(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n341(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n342(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n343(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n344(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n345(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n346(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n347(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n348(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n349(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n350(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n351(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n352(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n353(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n354(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n355(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n356(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n357(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n358(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n359(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n360(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n361(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n362(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n363(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n364(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n365(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n366(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n367(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n368(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n369(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n370(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n371(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n372(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n373(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n374(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n375(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n376(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n377(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n378(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n379(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n380(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n381(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n382(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n383(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n384(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n385(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n386(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n387(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n388(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n389(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n390(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n391(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n392(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n393(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n394(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n395(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n396(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n397(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n398(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n399(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n400(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n401(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n402(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n403(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n404(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n405(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n406(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n407(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n408(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n409(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n410(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n411(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n412(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n413(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n414(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n415(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n416(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n417(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n418(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n419(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n420(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n421(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n422(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n423(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n424(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n425(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n426(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n427(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n428(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n429(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n430(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n431(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n432(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n433(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n434(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n435(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n436(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n437(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n438(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n439(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n440(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n441(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n442(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n443(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n444(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n445(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n446(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n447(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n448(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n449(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n450(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n451(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n452(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n453(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n454(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n455(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n456(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n457(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n458(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n459(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n460(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n461(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n462(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n463(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n464(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n465(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n466(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n467(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n468(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n469(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n470(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n471(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n472(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n473(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n474(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n475(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n476(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n477(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n478(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n479(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n480(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n481(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n482(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n483(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n484(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n485(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n486(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n487(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n488(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n489(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n490(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n491(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n492(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n493(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n494(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n495(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n496(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n497(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n498(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n499(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n500(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n501(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n502(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n503(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n504(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n505(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n506(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n507(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n508(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n509(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n510(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n511(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n512(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n513(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n514(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n515(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n516(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n517(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n518(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n519(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n520(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n521(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n522(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n523(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n524(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n525(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n526(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n527(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n528(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n529(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n530(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n531(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n532(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n533(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n534(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n535(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n536(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n537(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n538(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n539(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n540(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n541(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n542(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n543(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n544(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n545(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n546(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n547(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n548(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n549(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n550(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n551(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n552(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n553(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n554(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n555(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n556(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n557(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n558(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n559(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n560(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n561(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n562(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n563(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n564(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n565(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n566(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n567(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n568(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n569(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n570(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n571(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n572(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n573(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n574(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n575(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n576(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n577(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n578(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n579(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n580(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n581(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n582(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n583(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n584(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n585(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n586(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n587(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n588(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n589(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n590(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n591(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n592(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n593(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n594(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n595(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n596(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n597(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n598(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n599(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n600(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n601(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n602(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n603(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n604(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n605(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n606(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n607(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n608(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n609(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n610(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n611(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n612(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n613(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n614(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n615(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n616(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n617(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n618(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n619(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n620(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n621(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n622(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n623(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n624(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n625(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n626(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n627(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n628(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n629(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n630(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n631(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n632(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n633(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n634(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n635(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n636(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n637(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n638(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n639(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n640(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n641(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n642(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n643(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n644(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n645(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n646(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n647(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n648(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n649(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n650(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n651(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n652(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n653(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n654(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n655(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n656(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n657(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n658(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n659(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n660(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n661(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n662(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n663(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n664(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n665(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n666(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n667(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n668(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n669(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n670(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n671(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n672(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n673(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n674(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n675(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n676(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n677(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n678(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n679(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n680(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n681(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n682(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n683(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n684(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n685(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n686(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n687(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n688(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n689(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n690(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n691(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n692(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n693(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n694(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n695(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n696(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n697(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n698(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n699(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n700(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n701(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n702(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n703(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n704(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n705(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n706(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n707(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n708(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n709(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n710(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n711(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n712(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n713(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n714(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n715(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n716(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n717(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n718(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n719(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n720(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n721(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n722(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n723(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n724(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n725(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n726(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n727(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n728(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n729(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n730(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n731(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n732(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n733(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n734(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n735(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n736(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n737(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n738(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n739(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n740(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n741(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n742(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n743(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n744(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n745(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n746(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n747(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n748(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n749(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n750(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n751(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n752(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n753(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n754(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n755(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n756(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n757(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n758(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n759(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n760(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n761(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n762(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n763(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n764(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n765(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n766(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n767(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n768(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n769(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n770(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n771(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n772(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n773(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n774(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n775(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n776(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n777(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n778(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n779(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n780(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n781(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n782(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n783(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n784(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n785(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n786(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n787(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n788(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n789(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n790(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n791(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n792(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n793(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n794(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n795(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n796(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n797(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n798(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n799(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n800(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n801(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n802(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n803(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n804(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n805(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n806(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n807(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n808(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n809(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n810(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n811(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n812(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n813(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n814(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n815(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n816(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n817(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n818(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n819(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n820(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n821(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n822(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n823(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n824(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n825(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n826(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n827(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n828(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n829(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n830(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n831(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n832(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n833(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n834(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n835(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n836(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n837(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n838(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n839(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n840(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n841(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n842(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n843(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n844(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n845(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n846(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n847(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n848(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n849(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n850(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n851(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n852(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n853(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n854(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n855(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n856(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n857(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n858(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n859(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n860(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n861(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n862(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n863(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n864(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n865(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n866(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n867(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n868(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n869(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n870(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n871(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n872(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n873(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n874(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n875(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n876(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n877(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n878(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n879(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n880(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n881(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n882(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n883(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n884(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n885(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n886(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n887(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n888(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n889(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n890(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n891(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n892(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n893(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n894(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n895(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n896(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n897(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n898(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n899(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n900(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n901(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n902(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n903(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n904(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n905(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n906(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n907(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n908(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n909(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n910(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n911(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n912(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n913(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n914(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n915(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n916(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n917(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n918(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n919(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n920(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n921(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n922(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n923(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n924(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n925(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n926(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n927(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n928(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n929(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n930(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n931(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n932(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n933(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n934(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n935(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n936(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n937(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n938(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n939(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n940(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n941(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n942(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n943(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n944(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n945(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n946(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n947(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n948(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n949(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ probe user_trace__n950(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+ /**
+ * Send a single string to a probe.
+ * This probe is deprecated.
+ *
+ * @param NUL-terminated string
+ */
+ probe user_trace__s1(char* message);
+
+ /**
+ * Multi-purpose probe: up to 4 NUL-terminated strings and 4
+ * 64-bit integer arguments.
+ * This probe is deprecated.
+ *
+ * @param proc, the PID (string form) of the sending process
+ * @param user_tag, the user tag of the sender
+ * @param i1, integer
+ * @param i2, integer
+ * @param i3, integer
+ * @param i4, integer
+ * @param s1, string/iolist. D's arg6 is NULL if not given by Erlang
+ * @param s2, string/iolist. D's arg7 is NULL if not given by Erlang
+ * @param s3, string/iolist. D's arg8 is NULL if not given by Erlang
+ * @param s4, string/iolist. D's arg9 is NULL if not given by Erlang
+ */
+ probe user_trace__i4s4(char *proc, char *user_tag,
+ int i1, int i2, int i3, int i4,
+ char *s1, char *s2, char *s3, char *s4);
+
+};
+
+#pragma D attributes Evolving/Evolving/Common provider erlang provider
+#pragma D attributes Private/Private/Common provider erlang module
+#pragma D attributes Private/Private/Common provider erlang function
+#pragma D attributes Evolving/Evolving/Common provider erlang name
+#pragma D attributes Evolving/Evolving/Common provider erlang args
diff --git a/erts/emulator/beam/export.c b/erts/emulator/beam/export.c
index fb0ee99119..6b5121f917 100644
--- a/erts/emulator/beam/export.c
+++ b/erts/emulator/beam/export.c
@@ -32,98 +32,162 @@
#define EXPORT_HASH(m,f,a) ((m)*(f)+(a))
-static IndexTable export_table; /* Not locked. */
-static Hash secondary_export_table; /* Locked. */
+#ifdef DEBUG
+# define IF_DEBUG(x) x
+#else
+# define IF_DEBUG(x)
+#endif
-#include "erl_smp.h"
+static IndexTable export_tables[ERTS_NUM_CODE_IX]; /* Active not locked */
-static erts_smp_rwmtx_t export_table_lock; /* Locks the secondary export table. */
+static erts_smp_atomic_t total_entries_bytes;
-#define export_read_lock() erts_smp_rwmtx_rlock(&export_table_lock)
-#define export_read_unlock() erts_smp_rwmtx_runlock(&export_table_lock)
-#define export_write_lock() erts_smp_rwmtx_rwlock(&export_table_lock)
-#define export_write_unlock() erts_smp_rwmtx_rwunlock(&export_table_lock)
+#include "erl_smp.h"
+
+/* This lock protects the staging export table from concurrent access
+ * AND it protects the staging table from becoming active.
+ */
+erts_smp_mtx_t export_staging_lock;
extern BeamInstr* em_call_error_handler;
extern BeamInstr* em_call_traced_function;
+struct export_entry
+{
+ IndexSlot slot; /* MUST BE LOCATED AT TOP OF STRUCT!!! */
+ Export* ep;
+};
+
+/* Helper struct that brings things together in one allocation
+*/
+struct export_blob
+{
+ Export exp;
+ struct export_entry entryv[ERTS_NUM_CODE_IX];
+ /* Note that entryv is not indexed by "code_ix".
+ */
+};
+
+/* Helper struct only used as template
+*/
+struct export_templ
+{
+ struct export_entry entry;
+ Export exp;
+};
+
+static struct export_blob* entry_to_blob(struct export_entry* ee)
+{
+ return (struct export_blob*)
+ ((char*)ee->ep - offsetof(struct export_blob,exp));
+}
+
void
export_info(int to, void *to_arg)
{
#ifdef ERTS_SMP
int lock = !ERTS_IS_CRASH_DUMPING;
if (lock)
- export_read_lock();
+ export_staging_lock();
#endif
- index_info(to, to_arg, &export_table);
- hash_info(to, to_arg, &secondary_export_table);
+ index_info(to, to_arg, &export_tables[erts_active_code_ix()]);
+ hash_info(to, to_arg, &export_tables[erts_staging_code_ix()].htable);
#ifdef ERTS_SMP
if (lock)
- export_read_unlock();
+ export_staging_unlock();
#endif
}
static HashValue
-export_hash(Export* x)
+export_hash(struct export_entry* ee)
{
+ Export* x = ee->ep;
return EXPORT_HASH(x->code[0], x->code[1], x->code[2]);
}
static int
-export_cmp(Export* tmpl, Export* obj)
+export_cmp(struct export_entry* tmpl_e, struct export_entry* obj_e)
{
+ Export* tmpl = tmpl_e->ep;
+ Export* obj = obj_e->ep;
return !(tmpl->code[0] == obj->code[0] &&
tmpl->code[1] == obj->code[1] &&
tmpl->code[2] == obj->code[2]);
}
-static Export*
-export_alloc(Export* tmpl)
+static struct export_entry*
+export_alloc(struct export_entry* tmpl_e)
{
- Export* obj = (Export*) erts_alloc(ERTS_ALC_T_EXPORT, sizeof(Export));
-
- obj->fake_op_func_info_for_hipe[0] = 0;
- obj->fake_op_func_info_for_hipe[1] = 0;
- obj->code[0] = tmpl->code[0];
- obj->code[1] = tmpl->code[1];
- obj->code[2] = tmpl->code[2];
- obj->slot.index = -1;
- obj->address = obj->code+3;
- obj->code[3] = (BeamInstr) em_call_error_handler;
- obj->code[4] = 0;
- obj->match_prog_set = NULL;
- return obj;
+ struct export_blob* blob;
+ unsigned ix;
+
+ if (tmpl_e->slot.index == -1) { /* Template, allocate blob */
+ Export* tmpl = tmpl_e->ep;
+ Export* obj;
+
+ blob = (struct export_blob*) erts_alloc(ERTS_ALC_T_EXPORT, sizeof(*blob));
+ erts_smp_atomic_add_nob(&total_entries_bytes, sizeof(*blob));
+ obj = &blob->exp;
+ obj->fake_op_func_info_for_hipe[0] = 0;
+ obj->fake_op_func_info_for_hipe[1] = 0;
+ obj->code[0] = tmpl->code[0];
+ obj->code[1] = tmpl->code[1];
+ obj->code[2] = tmpl->code[2];
+ obj->code[3] = (BeamInstr) em_call_error_handler;
+ obj->code[4] = 0;
+
+ for (ix=0; ix<ERTS_NUM_CODE_IX; ix++) {
+ obj->addressv[ix] = obj->code+3;
+
+ blob->entryv[ix].slot.index = -1;
+ blob->entryv[ix].ep = &blob->exp;
+ }
+ ix = 0;
+ }
+ else { /* Existing entry in another table, use free entry in blob */
+ blob = entry_to_blob(tmpl_e);
+ for (ix = 0; blob->entryv[ix].slot.index >= 0; ix++) {
+ ASSERT(ix < ERTS_NUM_CODE_IX);
+ }
+ }
+ return &blob->entryv[ix];
}
-
-static void
-export_free(Export* obj)
+static void
+export_free(struct export_entry* obj)
{
- erts_free(ERTS_ALC_T_EXPORT, (void*) obj);
+ struct export_blob* blob = entry_to_blob(obj);
+ int i;
+ obj->slot.index = -1;
+ for (i=0; i < ERTS_NUM_CODE_IX; i++) {
+ if (blob->entryv[i].slot.index >= 0) {
+ return;
+ }
+ }
+ erts_free(ERTS_ALC_T_EXPORT, blob);
+ erts_smp_atomic_add_nob(&total_entries_bytes, -sizeof(*blob));
}
-
void
init_export_table(void)
{
HashFunctions f;
- erts_smp_rwmtx_opt_t rwmtx_opt = ERTS_SMP_RWMTX_OPT_DEFAULT_INITER;
- rwmtx_opt.type = ERTS_SMP_RWMTX_TYPE_FREQUENT_READ;
- rwmtx_opt.lived = ERTS_SMP_RWMTX_LONG_LIVED;
+ int i;
- erts_smp_rwmtx_init_opt(&export_table_lock, &rwmtx_opt, "export_tab");
+ erts_smp_mtx_init(&export_staging_lock, "export_tab");
+ erts_smp_atomic_init_nob(&total_entries_bytes, 0);
f.hash = (H_FUN) export_hash;
f.cmp = (HCMP_FUN) export_cmp;
f.alloc = (HALLOC_FUN) export_alloc;
f.free = (HFREE_FUN) export_free;
- erts_index_init(ERTS_ALC_T_EXPORT_TABLE, &export_table, "export_list",
- EXPORT_INITIAL_SIZE, EXPORT_LIMIT, f);
- hash_init(ERTS_ALC_T_EXPORT_TABLE, &secondary_export_table,
- "secondary_export_table", 50, f);
+ for (i=0; i<ERTS_NUM_CODE_IX; i++) {
+ erts_index_init(ERTS_ALC_T_EXPORT_TABLE, &export_tables[i], "export_list",
+ EXPORT_INITIAL_SIZE, EXPORT_LIMIT, f);
+ }
}
/*
@@ -138,29 +202,42 @@ init_export_table(void)
* called through such an export entry.
* 3) This function is suitable for the implementation of erlang:apply/3.
*/
+extern Export* /* inline-helper */
+erts_find_export_entry(Eterm m, Eterm f, unsigned int a,ErtsCodeIndex code_ix);
Export*
-erts_find_export_entry(Eterm m, Eterm f, unsigned int a)
+erts_find_export_entry(Eterm m, Eterm f, unsigned int a, ErtsCodeIndex code_ix)
{
HashValue hval = EXPORT_HASH((BeamInstr) m, (BeamInstr) f, (BeamInstr) a);
int ix;
HashBucket* b;
- ix = hval % export_table.htable.size;
- b = export_table.htable.bucket[ix];
+ ix = hval % export_tables[code_ix].htable.size;
+ b = export_tables[code_ix].htable.bucket[ix];
/*
* Note: We have inlined the code from hash.c for speed.
*/
while (b != (HashBucket*) 0) {
- Export* ep = (Export *) b;
+ Export* ep = ((struct export_entry*) b)->ep;
if (ep->code[0] == m && ep->code[1] == f && ep->code[2] == a) {
- break;
+ return ep;
}
b = b->next;
}
- return (Export*)b;
+ return NULL;
+}
+
+static struct export_entry* init_template(struct export_templ* templ,
+ Eterm m, Eterm f, unsigned a)
+{
+ templ->entry.ep = &templ->exp;
+ templ->entry.slot.index = -1;
+ templ->exp.code[0] = m;
+ templ->exp.code[1] = f;
+ templ->exp.code[2] = a;
+ return &templ->entry;
}
@@ -176,47 +253,42 @@ erts_find_export_entry(Eterm m, Eterm f, unsigned int a)
*/
Export*
-erts_find_function(Eterm m, Eterm f, unsigned int a)
+erts_find_function(Eterm m, Eterm f, unsigned int a, ErtsCodeIndex code_ix)
{
- Export e;
- Export* ep;
-
- e.code[0] = m;
- e.code[1] = f;
- e.code[2] = a;
-
- ep = hash_get(&export_table.htable, (void*) &e);
- if (ep != NULL && ep->address == ep->code+3 &&
- ep->code[3] != (BeamInstr) em_call_traced_function) {
- ep = NULL;
+ struct export_templ templ;
+ struct export_entry* ee;
+
+ ee = hash_get(&export_tables[code_ix].htable, init_template(&templ, m, f, a));
+ if (ee == NULL ||
+ (ee->ep->addressv[code_ix] == ee->ep->code+3 &&
+ ee->ep->code[3] != (BeamInstr) BeamOp(op_i_generic_breakpoint))) {
+ return NULL;
}
- return ep;
+ return ee->ep;
}
/*
* Returns a pointer to an existing export entry for a MFA,
* or creates a new one and returns the pointer.
*
- * This function provides unlocked write access to the main export
- * table. It should only be used during start up or when
- * all other threads are blocked.
+ * This function acts on the staging export table. It should only be used
+ * to load new code.
*/
Export*
erts_export_put(Eterm mod, Eterm func, unsigned int arity)
{
- Export e;
- int ix;
+ ErtsCodeIndex code_ix = erts_staging_code_ix();
+ struct export_templ templ;
+ struct export_entry* ee;
- ERTS_SMP_LC_ASSERT(erts_initialized == 0
- || erts_smp_thr_progress_is_blocking());
ASSERT(is_atom(mod));
ASSERT(is_atom(func));
- e.code[0] = mod;
- e.code[1] = func;
- e.code[2] = arity;
- ix = index_put(&export_table, (void*) &e);
- return (Export*) erts_index_lookup(&export_table, ix);
+ export_staging_lock();
+ ee = (struct export_entry*) index_put_entry(&export_tables[code_ix],
+ init_template(&templ, mod, func, arity));
+ export_staging_unlock();
+ return ee->ep;
}
/*
@@ -224,77 +296,117 @@ erts_export_put(Eterm mod, Eterm func, unsigned int arity)
* export entry (making a call through it will cause the error_handler to
* be called).
*
- * Stub export entries will be placed in the secondary export table.
- * erts_export_consolidate() will move all stub export entries into the
- * main export table (will be done the next time code is loaded).
+ * Stub export entries will be placed in the loader export table.
*/
Export*
erts_export_get_or_make_stub(Eterm mod, Eterm func, unsigned int arity)
{
- Export e;
+ ErtsCodeIndex code_ix;
Export* ep;
+ IF_DEBUG(int retrying = 0;)
ASSERT(is_atom(mod));
ASSERT(is_atom(func));
-
- e.code[0] = mod;
- e.code[1] = func;
- e.code[2] = arity;
- ep = erts_find_export_entry(mod, func, arity);
- if (ep == 0) {
- /*
- * The code is not loaded (yet). Put the export in the secondary
- * export table, to avoid having to lock the main export table.
- */
- export_write_lock();
- ep = (Export *) hash_put(&secondary_export_table, (void*) &e);
- export_write_unlock();
- }
+
+ do {
+ code_ix = erts_active_code_ix();
+ ep = erts_find_export_entry(mod, func, arity, code_ix);
+ if (ep == 0) {
+ /*
+ * The code is not loaded (yet). Put the export in the staging
+ * export table, to avoid having to lock the active export table.
+ */
+ export_staging_lock();
+ if (erts_active_code_ix() == code_ix) {
+ struct export_templ templ;
+ struct export_entry* entry;
+
+ IndexTable* tab = &export_tables[erts_staging_code_ix()];
+ init_template(&templ, mod, func, arity);
+ entry = (struct export_entry *) index_put_entry(tab, &templ.entry);
+ ep = entry->ep;
+ ASSERT(ep);
+ }
+ else { /* race */
+ ASSERT(!retrying);
+ IF_DEBUG(retrying = 1);
+ }
+ export_staging_unlock();
+ }
+ } while (!ep);
return ep;
}
-/*
- * To be called before loading code (with other threads blocked).
- * This function will move all export entries from the secondary
- * export table into the primary.
- */
-void
-erts_export_consolidate(void)
+Export *export_list(int i, ErtsCodeIndex code_ix)
{
-#ifdef DEBUG
- HashInfo hi;
-#endif
-
- ERTS_SMP_LC_ASSERT(erts_initialized == 0
- || erts_smp_thr_progress_is_blocking());
-
- export_write_lock();
- erts_index_merge(&secondary_export_table, &export_table);
- erts_hash_merge(&secondary_export_table, &export_table.htable);
- export_write_unlock();
-#ifdef DEBUG
- hash_get_info(&hi, &export_table.htable);
- ASSERT(export_table.entries == hi.objs);
-#endif
+ return ((struct export_entry*) erts_index_lookup(&export_tables[code_ix], i))->ep;
}
-Export *export_list(int i)
+int export_list_size(ErtsCodeIndex code_ix)
{
- return (Export*) erts_index_lookup(&export_table, i);
+ return export_tables[code_ix].entries;
}
-int export_list_size(void)
+int export_table_sz(void)
+{
+ int i, bytes = 0;
+
+ export_staging_lock();
+ for (i=0; i<ERTS_NUM_CODE_IX; i++) {
+ bytes += index_table_sz(&export_tables[i]);
+ }
+ export_staging_unlock();
+ return bytes;
+}
+int export_entries_sz(void)
{
- return export_table.entries;
+ return erts_smp_atomic_read_nob(&total_entries_bytes);
}
+Export *export_get(Export *e)
+{
+ struct export_entry ee;
+ struct export_entry* entry;
-int export_table_sz(void)
+ ee.ep = e;
+ entry = (struct export_entry*)hash_get(&export_tables[erts_active_code_ix()].htable, &ee);
+ return entry ? entry->ep : NULL;
+}
+
+IF_DEBUG(static ErtsCodeIndex debug_start_load_ix = 0;)
+
+
+void export_start_staging(void)
{
- return index_table_sz(&export_table);
+ ErtsCodeIndex dst_ix = erts_staging_code_ix();
+ ErtsCodeIndex src_ix = erts_active_code_ix();
+ IndexTable* dst = &export_tables[dst_ix];
+ IndexTable* src = &export_tables[src_ix];
+ struct export_entry* src_entry;
+ struct export_entry* dst_entry;
+ int i;
+
+ ASSERT(dst_ix != src_ix);
+ ASSERT(debug_start_load_ix == -1);
+
+ export_staging_lock();
+ /*
+ * Insert all entries in src into dst table
+ */
+ for (i = 0; i < src->entries; i++) {
+ src_entry = (struct export_entry*) erts_index_lookup(src, i);
+ src_entry->ep->addressv[dst_ix] = src_entry->ep->addressv[src_ix];
+ dst_entry = (struct export_entry*) index_put_entry(dst, src_entry);
+ ASSERT(entry_to_blob(src_entry) == entry_to_blob(dst_entry));
+ }
+ export_staging_unlock();
+
+ IF_DEBUG(debug_start_load_ix = dst_ix);
}
-Export *export_get(Export *e)
+void export_end_staging(int commit)
{
- return hash_get(&export_table.htable, e);
+ ASSERT(debug_start_load_ix == erts_staging_code_ix());
+ IF_DEBUG(debug_start_load_ix = -1);
}
+
diff --git a/erts/emulator/beam/export.h b/erts/emulator/beam/export.h
index c604fdf7c3..ee06e69aff 100644
--- a/erts/emulator/beam/export.h
+++ b/erts/emulator/beam/export.h
@@ -28,14 +28,15 @@
#include "index.h"
#endif
+#include "code_ix.h"
+
/*
** Export entry
*/
+
typedef struct export
{
- IndexSlot slot; /* MUST BE LOCATED AT TOP OF STRUCT!!! */
- void* address; /* Pointer to code for function. */
- struct binary* match_prog_set; /* Match program for tracing. */
+ void* addressv[ERTS_NUM_CODE_IX]; /* Pointer to code for function. */
BeamInstr fake_op_func_info_for_hipe[2]; /* MUST be just before code[] */
/*
@@ -44,12 +45,12 @@ typedef struct export
* code[2]: Arity (untagged integer).
* code[3]: This entry is 0 unless the 'address' field points to it.
* Threaded code instruction to load function
- * (em_call_error_handler), execute BIF (em_apply_bif,
- * em_apply_apply), or call a traced function
- * (em_call_traced_function).
- * code[4]: Function pointer to BIF function (for BIFs only)
+ * (em_call_error_handler), execute BIF (em_apply_bif),
+ * or a breakpoint instruction (op_i_generic_breakpoint).
+ * code[4]: Function pointer to BIF function (for BIFs only),
* or pointer to threaded code if the module has an
- * on_load function that has not been run yet.
+ * on_load function that has not been run yet, or pointer
+ * to code for function code[3] is a breakpont instruction.
* Otherwise: 0.
*/
BeamInstr code[5];
@@ -59,21 +60,38 @@ typedef struct export
void init_export_table(void);
void export_info(int, void *);
-Export* erts_find_export_entry(Eterm m, Eterm f, unsigned int a);
+ERTS_GLB_INLINE Export* erts_active_export_entry(Eterm m, Eterm f, unsigned a);
Export* erts_export_put(Eterm mod, Eterm func, unsigned int arity);
-
Export* erts_export_get_or_make_stub(Eterm, Eterm, unsigned);
-void erts_export_consolidate(void);
-Export *export_list(int);
-int export_list_size(void);
+Export *export_list(int,ErtsCodeIndex);
+int export_list_size(ErtsCodeIndex);
int export_table_sz(void);
+int export_entries_sz(void);
Export *export_get(Export*);
+void export_start_staging(void);
+void export_end_staging(int commit);
+
+extern erts_smp_mtx_t export_staging_lock;
+#define export_staging_lock() erts_smp_mtx_lock(&export_staging_lock)
+#define export_staging_unlock() erts_smp_mtx_unlock(&export_staging_lock)
#include "beam_load.h" /* For em_* extern declarations */
#define ExportIsBuiltIn(EntryPtr) \
-(((EntryPtr)->address == (EntryPtr)->code + 3) && \
+(((EntryPtr)->addressv[erts_active_code_ix()] == (EntryPtr)->code + 3) && \
((EntryPtr)->code[3] == (BeamInstr) em_apply_bif))
-#endif
+#if ERTS_GLB_INLINE_INCL_FUNC_DEF
+
+ERTS_GLB_INLINE Export*
+erts_active_export_entry(Eterm m, Eterm f, unsigned int a)
+{
+ extern Export* erts_find_export_entry(Eterm m, Eterm f, unsigned a, ErtsCodeIndex);
+ return erts_find_export_entry(m, f, a, erts_active_code_ix());
+}
+
+#endif /* ERTS_GLB_INLINE_INCL_FUNC_DEF */
+
+#endif /* __EXPORT_H__ */
+
diff --git a/erts/emulator/beam/external.c b/erts/emulator/beam/external.c
index 152dbcf085..ab1065aaa1 100644
--- a/erts/emulator/beam/external.c
+++ b/erts/emulator/beam/external.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -1850,8 +1850,8 @@ enc_term(ErtsAtomCacheMap *acmp, Eterm obj, byte* ep, Uint32 dflags,
} else {
*ep++ = FLOAT_EXT;
- /* now the sprintf which does the work */
- i = sys_double_to_chars(f.fd, (char*) ep);
+ /* now the erts_snprintf which does the work */
+ i = sys_double_to_chars(f.fd, (char*) ep, (size_t)31);
/* Don't leave garbage after the float! (Bad practice in general,
* and Purify complains.)
@@ -1889,7 +1889,9 @@ enc_term(ErtsAtomCacheMap *acmp, Eterm obj, byte* ep, Uint32 dflags,
*ep++ = BINARY_INTERNAL_REF;
}
if (pb->flags) {
+ char* before_realloc = pb->val->orig_bytes;
erts_emasculate_writable_binary(pb);
+ bytes += (pb->val->orig_bytes - before_realloc);
}
erts_refc_inc(&pb->val->refc, 2);
@@ -2562,7 +2564,7 @@ dec_term_atom_common:
goto error;
}
if (edep && (edep->flags & ERTS_DIST_EXT_BTT_SAFE)) {
- if (!erts_find_export_entry(mod, name, arity))
+ if (!erts_active_export_entry(mod, name, arity))
goto error;
}
*objp = make_export(hp);
@@ -2626,14 +2628,12 @@ dec_term_atom_common:
}
old_uniq = unsigned_val(temp);
-#ifndef HYBRID /* FIND ME! */
/*
* It is safe to link the fun into the fun list only when
* no more validity tests can fail.
*/
funp->next = off_heap->first;
off_heap->first = (struct erl_off_heap_header*)funp;
-#endif
funp->fe = erts_put_fun_entry2(module, old_uniq, old_index,
uniq, index, arity);
@@ -2704,14 +2704,12 @@ dec_term_atom_common:
goto error;
}
-#ifndef HYBRID /* FIND ME! */
/*
* It is safe to link the fun into the fun list only when
* no more validity tests can fail.
*/
funp->next = off_heap->first;
off_heap->first = (struct erl_off_heap_header*)funp;
-#endif
old_uniq = unsigned_val(temp);
funp->fe = erts_put_fun_entry(module, old_uniq, old_index);
@@ -3118,6 +3116,9 @@ decoded_size(byte *ep, byte* endp, int internal_tags)
case LARGE_BIG_EXT:
CHKSIZE(4);
n = get_int32(ep);
+ if (n > BIG_ARITY_MAX*sizeof(ErtsDigit)) {
+ return -1;
+ }
SKIP2(n,4+1); /* skip, size,sign,digits */
heap_size += 1+1+(n+sizeof(Eterm)-1)/sizeof(Eterm); /* XXX: 1 too much? */
break;
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h
index f1335f600d..1503d793ab 100644..100755
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -28,6 +28,7 @@
#include "hash.h"
#include "index.h"
#include "atom.h"
+#include "code_ix.h"
#include "export.h"
#include "module.h"
#include "register.h"
@@ -143,8 +144,8 @@ typedef struct ErtsXPortsList_ ErtsXPortsList;
struct port {
ErtsPortTaskSched sched;
ErtsPortTaskHandle timeout_task;
-#ifdef ERTS_SMP
erts_smp_atomic_t refc;
+#ifdef ERTS_SMP
erts_smp_mtx_t *lock;
ErtsXPortsList *xports;
erts_smp_atomic_t run_queue;
@@ -173,6 +174,7 @@ struct port {
char *name; /* String used in the open */
erts_driver_t* drv_ptr;
UWord drv_data;
+ SWord os_pid; /* Child process ID */
ErtsProcList *suspended; /* List of suspended processes. */
LineBuf *linebuf; /* Buffer to hold data not ready for
process to get (line oriented I/O)*/
@@ -196,6 +198,8 @@ erts_port_runq(Port *prt)
#ifdef ERTS_SMP
ErtsRunQueue *rq1, *rq2;
rq1 = (ErtsRunQueue *) erts_smp_atomic_read_nob(&prt->run_queue);
+ if (!rq1)
+ return NULL;
while (1) {
erts_smp_runq_lock(rq1);
rq2 = (ErtsRunQueue *) erts_smp_atomic_read_nob(&prt->run_queue);
@@ -203,6 +207,8 @@ erts_port_runq(Port *prt)
return rq1;
erts_smp_runq_unlock(rq1);
rq1 = rq2;
+ if (!rq1)
+ return NULL;
}
#else
return ERTS_RUNQ_IX(0);
@@ -564,92 +570,6 @@ extern erts_smp_atomic32_t erts_max_gen_gcs;
extern int erts_disable_tolerant_timeofday;
-#ifdef HYBRID
-
-/* Message Area heap pointers */
-extern Eterm *global_heap; /* Heap start */
-extern Eterm *global_hend; /* Heap end */
-extern Eterm *global_htop; /* Heap top (heap pointer) */
-extern Eterm *global_saved_htop; /* Saved heap top (heap pointer) */
-extern Uint global_heap_sz; /* Heap size, in words */
-extern Eterm *global_old_heap; /* Old generation */
-extern Eterm *global_old_hend;
-extern ErlOffHeap erts_global_offheap; /* Global MSO (OffHeap) list */
-
-extern Uint16 global_gen_gcs;
-extern Uint16 global_max_gen_gcs;
-extern Uint global_gc_flags;
-
-#ifdef INCREMENTAL
-#define ACTIVATE(p)
-#define DEACTIVATE(p)
-#define IS_ACTIVE(p) 1
-
-#define INC_ACTIVATE(p) do { \
- if ((p)->active) { \
- if ((p)->active_next != NULL) { \
- (p)->active_next->active_prev = (p)->active_prev; \
- if ((p)->active_prev) { \
- (p)->active_prev->active_next = (p)->active_next; \
- } else { \
- inc_active_proc = (p)->active_next; \
- } \
- inc_active_last->active_next = (p); \
- (p)->active_next = NULL; \
- (p)->active_prev = inc_active_last; \
- inc_active_last = (p); \
- } \
- } else { \
- (p)->active_next = NULL; \
- (p)->active_prev = inc_active_last; \
- if (inc_active_last) { \
- inc_active_last->active_next = (p); \
- } else { \
- inc_active_proc = (p); \
- } \
- inc_active_last = (p); \
- (p)->active = 1; \
- } \
-} while(0);
-
-#define INC_DEACTIVATE(p) do { \
- ASSERT((p)->active == 1); \
- if ((p)->active_next == NULL) { \
- inc_active_last = (p)->active_prev; \
- } else { \
- (p)->active_next->active_prev = (p)->active_prev; \
- } \
- if ((p)->active_prev == NULL) { \
- inc_active_proc = (p)->active_next; \
- } else { \
- (p)->active_prev->active_next = (p)->active_next; \
- } \
- (p)->active = 0; \
-} while(0);
-
-#define INC_IS_ACTIVE(p) ((p)->active != 0)
-
-#else
-extern Eterm *global_old_htop;
-extern Eterm *global_high_water;
-#define ACTIVATE(p) (p)->active = 1;
-#define DEACTIVATE(p) (p)->active = 0;
-#define IS_ACTIVE(p) ((p)->active != 0)
-#define INC_ACTIVATE(p)
-#define INC_IS_ACTIVE(p) 1
-#endif /* INCREMENTAL */
-
-#else
-# define ACTIVATE(p)
-# define DEACTIVATE(p)
-# define IS_ACTIVE(p) 1
-# define INC_ACTIVATE(p)
-#endif /* HYBRID */
-
-#ifdef HYBRID
-extern Uint global_heap_min_sz;
-#endif
-
extern int bif_reductions; /* reductions + fcalls (when doing call_bif) */
extern int stackdump_on_exit;
@@ -806,6 +726,8 @@ do { \
/* Port uses port specific locking (opposed to driver specific locking) */
#define ERTS_PORT_SFLG_PORT_SPECIFIC_LOCK ((Uint32) (1 << 13))
#define ERTS_PORT_SFLG_INVALID ((Uint32) (1 << 14))
+/* Last port to terminate halts the emulator */
+#define ERTS_PORT_SFLG_HALT ((Uint32) (1 << 15))
#ifdef DEBUG
/* Only debug: make sure all flags aren't cleared unintentionally */
#define ERTS_PORT_SFLG_PORT_DEBUG ((Uint32) (1 << 31))
@@ -847,6 +769,8 @@ void erts_queue_monitor_message(Process *,
Eterm,
Eterm,
Eterm);
+void erts_init_trap_export(Export* ep, Eterm m, Eterm f, Uint a,
+ Eterm (*bif)(Process*,Eterm*));
void erts_init_bif(void);
Eterm erl_send(Process *p, Eterm to, Eterm msg);
@@ -869,24 +793,33 @@ typedef struct {
Eterm* fname_ptr; /* Pointer to fname table */
} FunctionInfo;
-struct LoaderState* erts_alloc_loader_state(void);
-Eterm erts_prepare_loading(struct LoaderState*, Process *c_p,
+Binary* erts_alloc_loader_state(void);
+Eterm erts_module_for_prepared_code(Binary* magic);
+Eterm erts_prepare_loading(Binary* loader_state, Process *c_p,
Eterm group_leader, Eterm* modp,
byte* code, Uint size);
-Eterm erts_finish_loading(struct LoaderState* stp, Process* c_p,
+Eterm erts_finish_loading(Binary* loader_state, Process* c_p,
ErtsProcLocks c_p_locks, Eterm* modp);
-Eterm erts_load_module(Process *c_p, ErtsProcLocks c_p_locks,
- Eterm group_leader, Eterm* mod, byte* code, Uint size);
+Eterm erts_preload_module(Process *c_p, ErtsProcLocks c_p_locks,
+ Eterm group_leader, Eterm* mod, byte* code, Uint size);
void init_load(void);
BeamInstr* find_function_from_pc(BeamInstr* pc);
Eterm* erts_build_mfa_item(FunctionInfo* fi, Eterm* hp,
Eterm args, Eterm* mfa_p);
-void erts_lookup_function_info(FunctionInfo* fi, BeamInstr* pc, int full_info);
void erts_set_current_function(FunctionInfo* fi, BeamInstr* current);
Eterm erts_module_info_0(Process* p, Eterm module);
Eterm erts_module_info_1(Process* p, Eterm module, Eterm what);
Eterm erts_make_stub_module(Process* p, Eterm Mod, Eterm Beam, Eterm Info);
+/* beam_ranges.c */
+void erts_init_ranges(void);
+void erts_start_staging_ranges(void);
+void erts_end_staging_ranges(int commit);
+void erts_update_ranges(BeamInstr* code, Uint size);
+void erts_remove_from_ranges(BeamInstr* code);
+UWord erts_ranges_sz(void);
+void erts_lookup_function_info(FunctionInfo* fi, BeamInstr* pc, int full_info);
+
/* break.c */
void init_break_handler(void);
void erts_set_ignore_break(void);
@@ -899,16 +832,10 @@ void loaded(int, void *);
/* config.c */
__decl_noreturn void __noreturn erl_exit(int n, char*, ...);
-__decl_noreturn void __noreturn erl_exit0(char *, int, int n, char*, ...);
+__decl_noreturn void __noreturn erl_exit_flush_async(int n, char*, ...);
void erl_error(char*, va_list);
-#define ERL_EXIT0(n,f) erl_exit0(__FILE__, __LINE__, n, f)
-#define ERL_EXIT1(n,f,a) erl_exit0(__FILE__, __LINE__, n, f, a)
-#define ERL_EXIT2(n,f,a,b) erl_exit0(__FILE__, __LINE__, n, f, a, b)
-#define ERL_EXIT3(n,f,a,b,c) erl_exit0(__FILE__, __LINE__, n, f, a, b, c)
-
/* copy.c */
-void init_copy(void);
Eterm copy_object(Eterm, Process*);
#if HALFWORD_HEAP
@@ -938,116 +865,6 @@ Eterm copy_shallow(Eterm*, Uint, Eterm**, ErlOffHeap*);
void move_multi_frags(Eterm** hpp, ErlOffHeap*, ErlHeapFragment* first,
Eterm* refs, unsigned nrefs);
-#ifdef HYBRID
-#define RRMA_DEFAULT_SIZE 256
-#define RRMA_STORE(p,ptr,src) do { \
- ASSERT((p)->rrma != NULL); \
- ASSERT((p)->rrsrc != NULL); \
- (p)->rrma[(p)->nrr] = (ptr); \
- (p)->rrsrc[(p)->nrr++] = (src); \
- if ((p)->nrr == (p)->rrsz) \
- { \
- (p)->rrsz *= 2; \
- (p)->rrma = (Eterm *) erts_realloc(ERTS_ALC_T_ROOTSET, \
- (void*)(p)->rrma, \
- sizeof(Eterm) * (p)->rrsz); \
- (p)->rrsrc = (Eterm **) erts_realloc(ERTS_ALC_T_ROOTSET, \
- (void*)(p)->rrsrc, \
- sizeof(Eterm) * (p)->rrsz); \
- } \
-} while(0)
-
-/* Note that RRMA_REMOVE decreases the given index after deletion.
- * This is done so that a loop with an increasing index can call
- * remove without having to decrease the index to see the element
- * placed in the hole after the deleted element.
- */
-#define RRMA_REMOVE(p,index) do { \
- p->rrsrc[index] = p->rrsrc[--p->nrr]; \
- p->rrma[index--] = p->rrma[p->nrr]; \
- } while(0);
-
-
-/* The MessageArea STACKs are used while copying messages to the
- * message area.
- */
-#define MA_STACK_EXTERNAL_DECLARE(type,_s_) \
- typedef type ma_##_s_##_type; \
- extern ma_##_s_##_type *ma_##_s_##_stack; \
- extern Uint ma_##_s_##_top; \
- extern Uint ma_##_s_##_size;
-
-#define MA_STACK_DECLARE(_s_) \
- ma_##_s_##_type *ma_##_s_##_stack; Uint ma_##_s_##_top; Uint ma_##_s_##_size;
-
-#define MA_STACK_ALLOC(_s_) do { \
- ma_##_s_##_top = 0; \
- ma_##_s_##_size = 512; \
- ma_##_s_##_stack = (ma_##_s_##_type*)erts_alloc(ERTS_ALC_T_OBJECT_STACK, \
- sizeof(ma_##_s_##_type) * ma_##_s_##_size); \
-} while(0)
-
-
-#define MA_STACK_PUSH(_s_,val) do { \
- ma_##_s_##_stack[ma_##_s_##_top++] = (val); \
- if (ma_##_s_##_top == ma_##_s_##_size) \
- { \
- ma_##_s_##_size *= 2; \
- ma_##_s_##_stack = \
- (ma_##_s_##_type*) erts_realloc(ERTS_ALC_T_OBJECT_STACK, \
- (void*)ma_##_s_##_stack, \
- sizeof(ma_##_s_##_type) * ma_##_s_##_size); \
- } \
-} while(0)
-
-#define MA_STACK_POP(_s_) (ma_##_s_##_top != 0 ? ma_##_s_##_stack[--ma_##_s_##_top] : 0)
-#define MA_STACK_TOP(_s_) (ma_##_s_##_stack[ma_##_s_##_top - 1])
-#define MA_STACK_UPDATE(_s_,offset,value) \
- *(ma_##_s_##_stack[ma_##_s_##_top - 1] + (offset)) = (value)
-#define MA_STACK_SIZE(_s_) (ma_##_s_##_top)
-#define MA_STACK_ELM(_s_,i) ma_##_s_##_stack[i]
-
-MA_STACK_EXTERNAL_DECLARE(Eterm,src);
-MA_STACK_EXTERNAL_DECLARE(Eterm*,dst);
-MA_STACK_EXTERNAL_DECLARE(Uint,offset);
-
-
-#ifdef INCREMENTAL
-extern Eterm *ma_pending_stack;
-extern Uint ma_pending_top;
-extern Uint ma_pending_size;
-
-#define NO_COPY(obj) (IS_CONST(obj) || \
- (((ptr_val(obj) >= global_heap) && \
- (ptr_val(obj) < global_htop)) || \
- ((ptr_val(obj) >= inc_fromspc) && \
- (ptr_val(obj) < inc_fromend)) || \
- ((ptr_val(obj) >= global_old_heap) && \
- (ptr_val(obj) < global_old_hend))))
-
-#else
-
-#define NO_COPY(obj) (IS_CONST(obj) || \
- (((ptr_val(obj) >= global_heap) && \
- (ptr_val(obj) < global_htop)) || \
- ((ptr_val(obj) >= global_old_heap) && \
- (ptr_val(obj) < global_old_hend))))
-
-#endif /* INCREMENTAL */
-
-#define LAZY_COPY(from,obj) do { \
- if (!NO_COPY(obj)) { \
- BM_LAZY_COPY_START; \
- BM_COUNT(messages_copied); \
- obj = copy_struct_lazy(from,obj,0); \
- BM_LAZY_COPY_STOP; \
- } \
-} while(0)
-
-Eterm copy_struct_lazy(Process*, Eterm, Uint);
-
-#endif /* HYBRID */
-
/* Utilities */
extern void erts_delete_nodes_monitors(Process *, ErtsProcLocks);
extern Eterm erts_monitor_nodes(Process *, Eterm, Eterm);
@@ -1141,10 +958,6 @@ void erts_offset_heap_ptr(Eterm*, Uint, Sint, Eterm*, Eterm*);
void erts_offset_heap(Eterm*, Uint, Sint, Eterm*, Eterm*);
void erts_free_heap_frags(Process* p);
-#ifdef HYBRID
-int erts_global_garbage_collect(Process*, int, Eterm*, int);
-#endif
-
/* io.c */
struct erl_drv_port_data_lock {
@@ -1190,6 +1003,10 @@ void erts_fire_port_monitor(Port *prt, Eterm ref);
void erts_smp_xports_unlock(Port *);
#endif
+#if defined(ERTS_SMP) && defined(ERTS_ENABLE_LOCK_COUNT)
+void erts_lcnt_enable_io_lock_count(int enable);
+#endif
+
#if defined(ERTS_SMP) && defined(ERTS_ENABLE_LOCK_CHECK)
int erts_lc_is_port_locked(Port *);
#endif
@@ -1223,28 +1040,29 @@ erts_smp_port_state_unlock(Port *prt)
ERTS_GLB_INLINE int
erts_smp_port_trylock(Port *prt)
{
-#ifdef ERTS_SMP
int res;
ASSERT(erts_smp_atomic_read_nob(&prt->refc) > 0);
erts_smp_atomic_inc_nob(&prt->refc);
+
+#ifdef ERTS_SMP
res = erts_smp_mtx_trylock(prt->lock);
if (res == EBUSY) {
erts_smp_atomic_dec_nob(&prt->refc);
}
+#else
+ res = 0;
+#endif
return res;
-#else /* !ERTS_SMP */
- return 0;
-#endif
}
ERTS_GLB_INLINE void
erts_smp_port_lock(Port *prt)
{
-#ifdef ERTS_SMP
ASSERT(erts_smp_atomic_read_nob(&prt->refc) > 0);
erts_smp_atomic_inc_nob(&prt->refc);
+#ifdef ERTS_SMP
erts_smp_mtx_lock(prt->lock);
#endif
}
@@ -1252,14 +1070,14 @@ erts_smp_port_lock(Port *prt)
ERTS_GLB_INLINE void
erts_smp_port_unlock(Port *prt)
{
-#ifdef ERTS_SMP
erts_aint_t refc;
+#ifdef ERTS_SMP
erts_smp_mtx_unlock(prt->lock);
+#endif
refc = erts_smp_atomic_dec_read_nob(&prt->refc);
ASSERT(refc >= 0);
if (refc == 0)
erts_port_cleanup(prt);
-#endif
}
#endif /* #if ERTS_GLB_INLINE_INCL_FUNC_DEF */
@@ -1322,12 +1140,12 @@ erts_id2port_sflgs(Eterm id, Process *c_p, ErtsProcLocks c_p_locks, Uint32 sflgs
erts_smp_port_state_unlock(prt);
prt = NULL;
}
-#ifdef ERTS_SMP
else {
erts_smp_atomic_inc_nob(&prt->refc);
erts_smp_port_state_unlock(prt);
- if (no_proc_locks)
+#ifdef ERTS_SMP
+ if (no_proc_locks)
erts_smp_mtx_lock(prt->lock);
else if (erts_smp_mtx_trylock(prt->lock) == EBUSY) {
/* Unlock process locks, and acquire locks in lock order... */
@@ -1343,21 +1161,17 @@ erts_id2port_sflgs(Eterm id, Process *c_p, ErtsProcLocks c_p_locks, Uint32 sflgs
erts_smp_port_unlock(prt); /* Also decrements refc... */
prt = NULL;
}
- }
#endif
+ }
+
return prt;
}
ERTS_GLB_INLINE void
erts_port_release(Port *prt)
{
-#ifdef ERTS_SMP
erts_smp_port_unlock(prt);
-#else
- if (prt->status & ERTS_PORT_SFLGS_DEAD)
- erts_port_cleanup(prt);
-#endif
}
ERTS_GLB_INLINE Port*
@@ -1474,6 +1288,122 @@ void erl_drv_thr_init(void);
/* utils.c */
+typedef struct {
+#ifdef DEBUG
+ int smp_api;
+#endif
+ union {
+ Uint64 not_atomic;
+#ifdef ARCH_64
+ erts_atomic_t atomic;
+#else
+ erts_dw_atomic_t atomic;
+#endif
+ } counter;
+} erts_interval_t;
+
+void erts_interval_init(erts_interval_t *);
+void erts_smp_interval_init(erts_interval_t *);
+Uint64 erts_step_interval_nob(erts_interval_t *);
+Uint64 erts_step_interval_relb(erts_interval_t *);
+Uint64 erts_smp_step_interval_nob(erts_interval_t *);
+Uint64 erts_smp_step_interval_relb(erts_interval_t *);
+Uint64 erts_ensure_later_interval_nob(erts_interval_t *, Uint64);
+Uint64 erts_ensure_later_interval_acqb(erts_interval_t *, Uint64);
+Uint64 erts_smp_ensure_later_interval_nob(erts_interval_t *, Uint64);
+Uint64 erts_smp_ensure_later_interval_acqb(erts_interval_t *, Uint64);
+#ifdef ARCH_32
+ERTS_GLB_INLINE Uint64 erts_interval_dw_aint_to_val__(erts_dw_aint_t *);
+#endif
+ERTS_GLB_INLINE Uint64 erts_current_interval_nob__(erts_interval_t *);
+ERTS_GLB_INLINE Uint64 erts_current_interval_acqb__(erts_interval_t *);
+ERTS_GLB_INLINE Uint64 erts_current_interval_nob(erts_interval_t *);
+ERTS_GLB_INLINE Uint64 erts_current_interval_acqb(erts_interval_t *);
+ERTS_GLB_INLINE Uint64 erts_smp_current_interval_nob(erts_interval_t *);
+ERTS_GLB_INLINE Uint64 erts_smp_current_interval_acqb(erts_interval_t *);
+
+#if ERTS_GLB_INLINE_INCL_FUNC_DEF
+
+#ifdef ARCH_32
+
+ERTS_GLB_INLINE Uint64
+erts_interval_dw_aint_to_val__(erts_dw_aint_t *dw)
+{
+#ifdef ETHR_SU_DW_NAINT_T__
+ return (Uint64) dw->dw_sint;
+#else
+ Uint64 res;
+ res = (Uint64) ((Uint32) dw->sint[ERTS_DW_AINT_HIGH_WORD]);
+ res <<= 32;
+ res |= (Uint64) ((Uint32) dw->sint[ERTS_DW_AINT_LOW_WORD]);
+ return res;
+#endif
+}
+
+#endif
+
+ERTS_GLB_INLINE Uint64
+erts_current_interval_nob__(erts_interval_t *icp)
+{
+#ifdef ARCH_64
+ return (Uint64) erts_atomic_read_nob(&icp->counter.atomic);
+#else
+ erts_dw_aint_t dw;
+ erts_dw_atomic_read_nob(&icp->counter.atomic, &dw);
+ return erts_interval_dw_aint_to_val__(&dw);
+#endif
+}
+
+ERTS_GLB_INLINE Uint64
+erts_current_interval_acqb__(erts_interval_t *icp)
+{
+#ifdef ARCH_64
+ return (Uint64) erts_atomic_read_acqb(&icp->counter.atomic);
+#else
+ erts_dw_aint_t dw;
+ erts_dw_atomic_read_acqb(&icp->counter.atomic, &dw);
+ return erts_interval_dw_aint_to_val__(&dw);
+#endif
+}
+
+ERTS_GLB_INLINE Uint64
+erts_current_interval_nob(erts_interval_t *icp)
+{
+ ASSERT(!icp->smp_api);
+ return erts_current_interval_nob__(icp);
+}
+
+ERTS_GLB_INLINE Uint64
+erts_current_interval_acqb(erts_interval_t *icp)
+{
+ ASSERT(!icp->smp_api);
+ return erts_current_interval_acqb__(icp);
+}
+
+ERTS_GLB_INLINE Uint64
+erts_smp_current_interval_nob(erts_interval_t *icp)
+{
+ ASSERT(icp->smp_api);
+#ifdef ERTS_SMP
+ return erts_current_interval_nob__(icp);
+#else
+ return icp->counter.not_atomic;
+#endif
+}
+
+ERTS_GLB_INLINE Uint64
+erts_smp_current_interval_acqb(erts_interval_t *icp)
+{
+ ASSERT(icp->smp_api);
+#ifdef ERTS_SMP
+ return erts_current_interval_acqb__(icp);
+#else
+ return icp->counter.not_atomic;
+#endif
+}
+
+#endif /* ERTS_GLB_INLINE_INCL_FUNC_DEF */
+
/*
* To be used to silence unused result warnings, but do not abuse it.
*/
@@ -1481,9 +1411,10 @@ void erts_silence_warn_unused_result(long unused);
void erts_cleanup_offheap(ErlOffHeap *offheap);
-Uint erts_fit_in_bits(Uint);
+int erts_fit_in_bits_int64(Sint64);
+int erts_fit_in_bits_int32(Sint32);
int list_length(Eterm);
-Export* erts_find_function(Eterm, Eterm, unsigned int);
+Export* erts_find_function(Eterm, Eterm, unsigned int, ErtsCodeIndex);
int erts_is_builtin(Eterm, Eterm, int);
Uint32 make_broken_hash(Eterm);
Uint32 block_hash(byte *, unsigned, Uint32);
@@ -1585,8 +1516,12 @@ Sint erts_native_filename_need(Eterm ioterm, int encoding);
void erts_copy_utf8_to_utf16_little(byte *target, byte *bytes, int num_chars);
int erts_analyze_utf8(byte *source, Uint size,
byte **err_pos, Uint *num_chars, int *left);
-char *erts_convert_filename_to_native(Eterm name, ErtsAlcType_t alloc_type, int allow_empty);
-
+char *erts_convert_filename_to_native(Eterm name, char *statbuf,
+ size_t statbuf_size,
+ ErtsAlcType_t alloc_type,
+ int allow_empty, int allow_atom,
+ Sint *used /* out */);
+Eterm erts_convert_native_to_filename(Process *p, byte *bytes);
#define ERTS_UTF8_OK 0
#define ERTS_UTF8_INCOMPLETE 1
#define ERTS_UTF8_ERROR 2
@@ -1751,17 +1686,19 @@ struct trace_pattern_flags {
};
extern const struct trace_pattern_flags erts_trace_pattern_flags_off;
extern int erts_call_time_breakpoint_tracing;
-int erts_set_trace_pattern(Eterm* mfa, int specified,
+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,
- Eterm meta_tracer_pid);
+ Eterm meta_tracer_pid, int is_blocking);
void
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);
+int erts_is_default_trace_enabled(void);
void erts_bif_trace_init(void);
+int erts_finish_breakpointing(void);
/*
** Call_trace uses this API for the parameter matching functions
@@ -1807,20 +1744,19 @@ extern void erts_match_prog_foreach_offheap(Binary *b,
breakpoint functions */
#define MATCH_SET_EXCEPTION_TRACE (0x4) /* exception trace requested */
#define MATCH_SET_RX_TRACE (MATCH_SET_RETURN_TRACE|MATCH_SET_EXCEPTION_TRACE)
-/*
- * Flag values when tracing bif
- * Future note: flag field is 8 bits
- */
-#define BIF_TRACE_AS_LOCAL (0x1)
-#define BIF_TRACE_AS_GLOBAL (0x2)
-#define BIF_TRACE_AS_META (0x4)
-#define BIF_TRACE_AS_CALL_TIME (0x8)
extern erts_driver_t vanilla_driver;
extern erts_driver_t spawn_driver;
extern erts_driver_t fd_driver;
/* Should maybe be placed in erl_message.h, but then we get an include mess. */
+ERTS_GLB_INLINE Eterm *
+erts_alloc_message_heap_state(Uint size,
+ ErlHeapFragment **bpp,
+ ErlOffHeap **ohpp,
+ Process *receiver,
+ ErtsProcLocks *receiver_locks,
+ erts_aint32_t *statep);
ERTS_GLB_INLINE Eterm *
erts_alloc_message_heap(Uint size,
@@ -1843,16 +1779,22 @@ erts_alloc_message_heap(Uint size,
*/
ERTS_GLB_INLINE Eterm *
-erts_alloc_message_heap(Uint size,
- ErlHeapFragment **bpp,
- ErlOffHeap **ohpp,
- Process *receiver,
- ErtsProcLocks *receiver_locks)
+erts_alloc_message_heap_state(Uint size,
+ ErlHeapFragment **bpp,
+ ErlOffHeap **ohpp,
+ Process *receiver,
+ ErtsProcLocks *receiver_locks,
+ erts_aint32_t *statep)
{
Eterm *hp;
+ erts_aint32_t state;
#ifdef ERTS_SMP
int locked_main = 0;
- ErtsProcLocks ulocks = *receiver_locks & ERTS_PROC_LOCKS_MSG_SEND;
+ state = erts_smp_atomic32_read_acqb(&receiver->state);
+ if (statep)
+ *statep = state;
+ if (state & (ERTS_PSFLG_EXITING|ERTS_PSFLG_PENDING_EXIT))
+ goto allocate_in_mbuf;
#endif
if (size > (Uint) INT_MAX)
@@ -1868,20 +1810,19 @@ erts_alloc_message_heap(Uint size,
#ifdef ERTS_SMP
try_allocate_on_heap:
#endif
- if (ERTS_PROC_IS_EXITING(receiver)
+ state = erts_smp_atomic32_read_nob(&receiver->state);
+ if (statep)
+ *statep = state;
+ if ((state & (ERTS_PSFLG_EXITING|ERTS_PSFLG_PENDING_EXIT))
|| HEAP_LIMIT(receiver) - HEAP_TOP(receiver) <= size) {
#ifdef ERTS_SMP
- if (locked_main)
- ulocks |= ERTS_PROC_LOCK_MAIN;
+ if (locked_main) {
+ *receiver_locks &= ~ERTS_PROC_LOCK_MAIN;
+ erts_smp_proc_unlock(receiver, ERTS_PROC_LOCK_MAIN);
+ }
#endif
goto allocate_in_mbuf;
}
-#ifdef ERTS_SMP
- if (ulocks) {
- erts_smp_proc_unlock(receiver, ulocks);
- *receiver_locks &= ~ulocks;
- }
-#endif
hp = HEAP_TOP(receiver);
HEAP_TOP(receiver) = hp + size;
*bpp = NULL;
@@ -1897,12 +1838,6 @@ erts_alloc_message_heap(Uint size,
else {
ErlHeapFragment *bp;
allocate_in_mbuf:
-#ifdef ERTS_SMP
- if (ulocks) {
- *receiver_locks &= ~ulocks;
- erts_smp_proc_unlock(receiver, ulocks);
- }
-#endif
bp = new_message_buffer(size);
hp = bp->mem;
*bpp = bp;
@@ -1912,6 +1847,17 @@ erts_alloc_message_heap(Uint size,
return hp;
}
+ERTS_GLB_INLINE Eterm *
+erts_alloc_message_heap(Uint size,
+ ErlHeapFragment **bpp,
+ ErlOffHeap **ohpp,
+ Process *receiver,
+ ErtsProcLocks *receiver_locks)
+{
+ return erts_alloc_message_heap_state(size, bpp, ohpp, receiver,
+ receiver_locks, NULL);
+}
+
#endif /* #if ERTS_GLB_INLINE_INCL_FUNC_DEF */
#if !HEAP_ON_C_STACK
@@ -1977,4 +1923,46 @@ erts_alloc_message_heap(Uint size,
# define UseTmpHeapNoproc(Size) /* Nothing */
# define UnUseTmpHeapNoproc(Size) /* Nothing */
#endif /* HEAP_ON_C_STACK */
+
+#if ERTS_GLB_INLINE_INCL_FUNC_DEF
+
+#include "dtrace-wrapper.h"
+
+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));
+}
+
+ERTS_GLB_INLINE void
+dtrace_proc_str(Process *process, char *process_buf)
+{
+ dtrace_pid_str(process->id, 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->id),
+ port_number(port->id));
+}
+
+ERTS_GLB_INLINE void
+dtrace_fun_decode(Process *process,
+ Eterm module, Eterm function, int arity,
+ char *process_buf, char *mfa_buf)
+{
+ if (process_buf) {
+ dtrace_proc_str(process, process_buf);
+ }
+
+ erts_snprintf(mfa_buf, DTRACE_TERM_BUF_SIZE, "%T:%T/%d",
+ module, function, arity);
+}
+#endif /* #if ERTS_GLB_INLINE_INCL_FUNC_DEF */
+
#endif /* !__GLOBAL_H__ */
diff --git a/erts/emulator/beam/index.c b/erts/emulator/beam/index.c
index a4a3007f93..25d5cce0f3 100644
--- a/erts/emulator/beam/index.c
+++ b/erts/emulator/beam/index.c
@@ -68,14 +68,14 @@ erts_index_init(ErtsAlcType_t type, IndexTable* t, char* name,
return t;
}
-int
-index_put(IndexTable* t, void* tmpl)
+IndexSlot*
+index_put_entry(IndexTable* t, void* tmpl)
{
int ix;
IndexSlot* p = (IndexSlot*) hash_put(&t->htable, tmpl);
if (p->index >= 0) {
- return p->index;
+ return p;
}
ix = t->entries;
@@ -92,7 +92,7 @@ index_put(IndexTable* t, void* tmpl)
t->entries++;
p->index = ix;
t->seg_table[ix>>INDEX_PAGE_SHIFT][ix&INDEX_PAGE_MASK] = p;
- return ix;
+ return p;
}
int index_get(IndexTable* t, void* tmpl)
@@ -135,3 +135,18 @@ void erts_index_merge(Hash* src, IndexTable* dst)
}
}
}
+
+void index_erase_latest_from(IndexTable* t, Uint from_ix)
+{
+ if(from_ix < (Uint)t->entries) {
+ int ix;
+ for (ix = from_ix; ix < t->entries; ix++) {
+ IndexSlot* obj = t->seg_table[ix>>INDEX_PAGE_SHIFT][ix&INDEX_PAGE_MASK];
+ hash_erase(&t->htable, obj);
+ }
+ t->entries = from_ix;
+ }
+ else {
+ ASSERT(from_ix == t->entries);
+ }
+}
diff --git a/erts/emulator/beam/index.h b/erts/emulator/beam/index.h
index 4eb9b1f992..3afe48d007 100644
--- a/erts/emulator/beam/index.h
+++ b/erts/emulator/beam/index.h
@@ -55,12 +55,24 @@ void index_info(int, void *, IndexTable*);
int index_table_sz(IndexTable *);
int index_get(IndexTable*, void*);
-int index_put(IndexTable*, void*);
+
+IndexSlot* index_put_entry(IndexTable*, void*);
void erts_index_merge(Hash*, IndexTable*);
+/* Erase all entries with index 'ix' and higher
+*/
+void index_erase_latest_from(IndexTable*, Uint ix);
+
+ERTS_GLB_INLINE int index_put(IndexTable*, void*);
ERTS_GLB_INLINE IndexSlot* erts_index_lookup(IndexTable*, Uint);
#if ERTS_GLB_INLINE_INCL_FUNC_DEF
+
+ERTS_GLB_INLINE int index_put(IndexTable* t, void* tmpl)
+{
+ return index_put_entry(t, tmpl)->index;
+}
+
ERTS_GLB_INLINE IndexSlot*
erts_index_lookup(IndexTable* t, Uint ix)
{
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index b23b1f628d..dec51f3be5 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -43,6 +43,7 @@
#include "erl_version.h"
#include "error.h"
#include "erl_async.h"
+#include "dtrace-wrapper.h"
extern ErlDrvEntry fd_driver_entry;
extern ErlDrvEntry vanilla_driver_entry;
@@ -180,6 +181,20 @@ typedef struct line_buf_context {
#define LINEBUF_INITIAL 100
+#ifdef USE_VM_PROBES
+#define DTRACE_FORMAT_COMMON_PID_AND_PORT(PID, PORT) \
+ DTRACE_CHARBUF(process_str, DTRACE_TERM_BUF_SIZE); \
+ DTRACE_CHARBUF(port_str, DTRACE_TERM_BUF_SIZE); \
+ \
+ dtrace_pid_str((PID), process_str); \
+ dtrace_port_str((PORT), port_str);
+#define DTRACE_FORMAT_COMMON_PROC_AND_PORT(PID, PORT) \
+ DTRACE_CHARBUF(process_str, DTRACE_TERM_BUF_SIZE); \
+ DTRACE_CHARBUF(port_str, DTRACE_TERM_BUF_SIZE); \
+ \
+ dtrace_proc_str((PID), process_str); \
+ dtrace_port_str((PORT), port_str);
+#endif
/* The 'number' field in a port now has two parts: the lowest bits
contain the index in the port table, and the higher bits are a counter
@@ -244,10 +259,8 @@ get_free_port(void)
}
}
port->status = ERTS_PORT_SFLG_INITIALIZING;
-#ifdef ERTS_SMP
- ERTS_SMP_LC_ASSERT(erts_smp_atomic_read_nob(&port->refc) == 0);
+ ERTS_LC_ASSERT(erts_smp_atomic_read_nob(&port->refc) == 0);
erts_smp_atomic_set_nob(&port->refc, 2); /* Port alive + lock */
-#endif
erts_smp_port_state_unlock(port);
return num & port_num_mask;
}
@@ -325,10 +338,14 @@ port_cleanup(Port *prt)
prt->drv_ptr = NULL;
ASSERT(driver);
-#ifdef ERTS_SMP
-
ASSERT(prt->status & ERTS_PORT_SFLG_FREE_SCHEDULED);
- ERTS_SMP_LC_ASSERT(erts_smp_atomic_read_nob(&prt->refc) == 0);
+ ERTS_LC_ASSERT(erts_smp_atomic_read_nob(&prt->refc) == 0);
+
+ ASSERT(prt->status & ERTS_PORT_SFLG_PORT_DEBUG);
+ ASSERT(!(prt->status & ERTS_PORT_SFLG_FREE));
+ prt->status = ERTS_PORT_SFLG_FREE;
+
+#ifdef ERTS_SMP
port_specific = (prt->status & ERTS_PORT_SFLG_PORT_SPECIFIC_LOCK);
@@ -337,10 +354,6 @@ port_cleanup(Port *prt)
prt->lock = NULL;
- ASSERT(prt->status & ERTS_PORT_SFLG_PORT_DEBUG);
- ASSERT(!(prt->status & ERTS_PORT_SFLG_FREE));
- prt->status = ERTS_PORT_SFLG_FREE;
-
erts_smp_port_state_unlock(prt);
erts_smp_mtx_unlock(mtx);
@@ -425,6 +438,7 @@ setup_port(Port* prt, Eterm pid, erts_driver_t *driver,
sys_strcpy(new_name, name);
erts_smp_runq_lock(runq);
erts_smp_port_state_lock(prt);
+ prt->os_pid = -1;
prt->status = ERTS_PORT_SFLG_CONNECTED | xstatus;
prt->snapshot = erts_smp_atomic32_read_nob(&erts_ports_snapshot);
old_name = prt->name;
@@ -590,10 +604,8 @@ erts_open_driver(erts_driver_t* driver, /* Pointer to driver. */
/* Need to mark the port as free again */
erts_smp_port_state_lock(port);
port->status = ERTS_PORT_SFLG_FREE;
-#ifdef ERTS_SMP
- ERTS_SMP_LC_ASSERT(erts_smp_atomic_read_nob(&port->refc) == 2);
+ ERTS_LC_ASSERT(erts_smp_atomic_read_nob(&port->refc) == 2);
erts_smp_atomic_set_nob(&port->refc, 0);
-#endif
erts_smp_port_state_unlock(port);
return -3;
}
@@ -610,7 +622,11 @@ erts_open_driver(erts_driver_t* driver, /* Pointer to driver. */
port->lock = erts_alloc(ERTS_ALC_T_PORT_LOCK,
sizeof(erts_smp_mtx_t));
erts_smp_mtx_init_x(port->lock,
+#ifdef ERTS_ENABLE_LOCK_COUNT
+ (erts_lcnt_rt_options & ERTS_LCNT_OPT_PORTLOCK) ? "port_lock" : NULL,
+#else
"port_lock",
+#endif
port->id);
xstatus |= ERTS_PORT_SFLG_PORT_SPECIFIC_LOCK;
}
@@ -639,6 +655,12 @@ erts_open_driver(erts_driver_t* driver, /* Pointer to driver. */
trace_sched_ports_where(port, am_in, am_start);
}
port->caller = pid;
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(driver_start)) {
+ DTRACE_FORMAT_COMMON_PID_AND_PORT(pid, port)
+ DTRACE3(driver_start, process_str, driver->name, port_str);
+ }
+#endif
fpe_was_unmasked = erts_block_fpe();
drv_data = (*driver->start)((ErlDrvPort)(port_ix),
name, opts);
@@ -743,7 +765,7 @@ driver_create_port(ErlDrvPort creator_port_ix, /* Creating port */
return (ErlDrvTermData) -1; /* pid does not exist */
}
if ((port_num = get_free_port()) < 0) {
- errno = ENFILE;
+ errno = SYSTEM_LIMIT;
erts_smp_proc_unlock(rp, ERTS_PROC_LOCK_LINK);
erts_smp_mtx_unlock(&erts_driver_list_lock);
return (ErlDrvTermData) -1;
@@ -762,7 +784,13 @@ driver_create_port(ErlDrvPort creator_port_ix, /* Creating port */
creator_port->xports = xplp;
port->lock = erts_alloc(ERTS_ALC_T_PORT_LOCK,
sizeof(erts_smp_mtx_t));
- erts_smp_mtx_init_locked_x(port->lock, "port_lock", port_id);
+ erts_smp_mtx_init_locked_x(port->lock,
+#ifdef ERTS_ENABLE_LOCK_COUNT
+ (erts_lcnt_rt_options & ERTS_LCNT_OPT_PORTLOCK) ? "port_lock" : NULL,
+#else
+ "port_lock",
+#endif
+ port_id);
xstatus |= ERTS_PORT_SFLG_PORT_SPECIFIC_LOCK;
}
@@ -1170,6 +1198,12 @@ int erts_write_to_port(Eterm caller_id, Port *p, Eterm list)
ev.size = size; /* total size */
ev.iov = ivp;
ev.binv = bvp;
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(driver_outputv)) {
+ DTRACE_FORMAT_COMMON_PID_AND_PORT(caller_id, p)
+ DTRACE4(driver_outputv, process_str, port_str, p->name, size);
+ }
+#endif
fpe_was_unmasked = erts_block_fpe();
(*drv->outputv)((ErlDrvData)p->drv_data, &ev);
erts_unblock_fpe(fpe_was_unmasked);
@@ -1189,8 +1223,21 @@ int erts_write_to_port(Eterm caller_id, Port *p, Eterm list)
buf = erts_alloc(ERTS_ALC_T_TMP, size+1);
r = io_list_to_buf(list, buf, size);
+#ifdef USE_VM_PROBES
+ if(DTRACE_ENABLED(port_command)) {
+ DTRACE_FORMAT_COMMON_PID_AND_PORT(caller_id, p)
+ DTRACE4(port_command, process_str, port_str, p->name, "command");
+ }
+#endif
+
if (r >= 0) {
size -= r;
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(driver_output)) {
+ DTRACE_FORMAT_COMMON_PID_AND_PORT(caller_id, p)
+ DTRACE4(driver_output, process_str, port_str, p->name, size);
+ }
+#endif
fpe_was_unmasked = erts_block_fpe();
(*drv->output)((ErlDrvData)p->drv_data, buf, size);
erts_unblock_fpe(fpe_was_unmasked);
@@ -1214,6 +1261,12 @@ int erts_write_to_port(Eterm caller_id, Port *p, Eterm list)
*/
buf = erts_alloc(ERTS_ALC_T_TMP, size+1);
r = io_list_to_buf(list, buf, size);
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(driver_output)) {
+ DTRACE_FORMAT_COMMON_PID_AND_PORT(caller_id, p)
+ DTRACE4(driver_output, process_str, port_str, p->name, size);
+ }
+#endif
fpe_was_unmasked = erts_block_fpe();
(*drv->output)((ErlDrvData)p->drv_data, buf, size);
erts_unblock_fpe(fpe_was_unmasked);
@@ -1257,7 +1310,7 @@ void init_io(void)
pdl_init();
- if (erts_sys_getenv("ERL_MAX_PORTS", maxports, &maxportssize) == 0)
+ if (erts_sys_getenv_raw("ERL_MAX_PORTS", maxports, &maxportssize) == 0)
erts_max_ports = atoi(maxports);
else
erts_max_ports = sys_max_files();
@@ -1273,7 +1326,7 @@ void init_io(void)
erts_max_ports = ERTS_MAX_R9_PORTS;
}
- port_extra_shift = erts_fit_in_bits(erts_max_ports - 1);
+ port_extra_shift = erts_fit_in_bits_int32(erts_max_ports - 1);
port_num_mask = (1 << ports_bits) - 1;
erts_port_tab_index_mask = ~(~((Uint) 0) << port_extra_shift);
@@ -1297,11 +1350,17 @@ void init_io(void)
for (i = 0; i < erts_max_ports; i++) {
erts_port_task_init_sched(&erts_port[i].sched);
-#ifdef ERTS_SMP
erts_smp_atomic_init_nob(&erts_port[i].refc, 0);
+#ifdef ERTS_SMP
erts_port[i].lock = NULL;
erts_port[i].xports = NULL;
- erts_smp_spinlock_init_x(&erts_port[i].state_lck, "port_state", make_small(i));
+ erts_smp_spinlock_init_x(&erts_port[i].state_lck,
+#ifdef ERTS_ENABLE_LOCK_COUNT
+ (erts_lcnt_rt_options & ERTS_LCNT_OPT_PORTLOCK) ? "port_state" : NULL,
+#else
+ "port_state",
+#endif
+ make_small(0));
#endif
erts_port[i].tracer_proc = NIL;
erts_port[i].trace_flags = 0;
@@ -1334,6 +1393,27 @@ void init_io(void)
erts_smp_mtx_unlock(&erts_driver_list_lock);
}
+#if defined(ERTS_ENABLE_LOCK_COUNT) && defined(ERTS_SMP)
+void erts_lcnt_enable_io_lock_count(int enable) {
+ int i;
+
+ for (i = 0; i < erts_max_ports; i++) {
+ Port* p = &erts_port[i];
+ if (enable) {
+ erts_lcnt_init_lock_x(&p->state_lck.lcnt, "port_state", ERTS_LCNT_LT_SPINLOCK, make_small(i));
+ if (p->lock) {
+ erts_lcnt_init_lock_x(&p->lock->lcnt, "port_lock", ERTS_LCNT_LT_MUTEX, make_small(i));
+ }
+ } else {
+ erts_lcnt_destroy_lock(&p->state_lck.lcnt);
+ if (p->lock) {
+ erts_lcnt_destroy_lock(&p->lock->lcnt);
+ }
+ }
+ }
+}
+#endif
+
/*
* Buffering of data when using line oriented I/O on ports
*/
@@ -1510,6 +1590,7 @@ deliver_result(Eterm sender, Eterm pid, Eterm res)
{
Process *rp;
ErtsProcLocks rp_locks = 0;
+ int scheduler = erts_get_scheduler_id() != 0;
ERTS_SMP_CHK_NO_PROC_LOCKS;
@@ -1517,7 +1598,9 @@ deliver_result(Eterm sender, Eterm pid, Eterm res)
&& is_internal_pid(pid)
&& internal_pid_index(pid) < erts_max_processes);
- rp = erts_pid2proc_opt(NULL, 0, pid, 0, ERTS_P2P_FLG_SMP_INC_REFC);
+ rp = (scheduler
+ ? erts_proc_lookup(pid)
+ : erts_pid2proc_opt(NULL, 0, pid, 0, ERTS_P2P_FLG_SMP_INC_REFC));
if (rp) {
Eterm tuple;
@@ -1529,9 +1612,15 @@ deliver_result(Eterm sender, Eterm pid, Eterm res)
hp = erts_alloc_message_heap(sz_res + 3, &bp, &ohp, rp, &rp_locks);
res = copy_struct(res, sz_res, &hp, ohp);
tuple = TUPLE2(hp, sender, res);
- erts_queue_message(rp, &rp_locks, bp, tuple, NIL);
+ erts_queue_message(rp, &rp_locks, bp, tuple, NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
erts_smp_proc_unlock(rp, rp_locks);
- erts_smp_proc_dec_refc(rp);
+ if (!scheduler)
+ erts_smp_proc_dec_refc(rp);
+
}
}
@@ -1556,6 +1645,7 @@ static void deliver_read_message(Port* prt, Eterm to,
ErlHeapFragment *bp;
ErlOffHeap *ohp;
ErtsProcLocks rp_locks = 0;
+ int scheduler = erts_get_scheduler_id() != 0;
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(prt));
ERTS_SMP_CHK_NO_PROC_LOCKS;
@@ -1570,7 +1660,10 @@ static void deliver_read_message(Port* prt, Eterm to,
need += 2*len;
}
- rp = erts_pid2proc_opt(NULL, 0, to, 0, ERTS_P2P_FLG_SMP_INC_REFC);
+ rp = (scheduler
+ ? erts_proc_lookup(to)
+ : erts_pid2proc_opt(NULL, 0, to, 0, ERTS_P2P_FLG_SMP_INC_REFC));
+
if (!rp)
return;
@@ -1618,9 +1711,15 @@ static void deliver_read_message(Port* prt, Eterm to,
tuple = TUPLE2(hp, prt->id, tuple);
hp += 3;
- erts_queue_message(rp, &rp_locks, bp, tuple, am_undefined);
- erts_smp_proc_unlock(rp, rp_locks);
- erts_smp_proc_dec_refc(rp);
+ erts_queue_message(rp, &rp_locks, bp, tuple, am_undefined
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
+ if (rp_locks)
+ erts_smp_proc_unlock(rp, rp_locks);
+ if (!scheduler)
+ erts_smp_proc_dec_refc(rp);
}
/*
@@ -1687,6 +1786,7 @@ deliver_vec_message(Port* prt, /* Port */
ErlHeapFragment *bp;
ErlOffHeap *ohp;
ErtsProcLocks rp_locks = 0;
+ int scheduler = erts_get_scheduler_id() != 0;
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(prt));
ERTS_SMP_CHK_NO_PROC_LOCKS;
@@ -1695,7 +1795,10 @@ deliver_vec_message(Port* prt, /* Port */
* Check arguments for validity.
*/
- rp = erts_pid2proc_opt(NULL, 0, to, 0, ERTS_P2P_FLG_SMP_INC_REFC);
+
+ rp = (scheduler
+ ? erts_proc_lookup(to)
+ : erts_pid2proc_opt(NULL, 0, to, 0, ERTS_P2P_FLG_SMP_INC_REFC));
if (!rp)
return;
@@ -1771,9 +1874,14 @@ deliver_vec_message(Port* prt, /* Port */
tuple = TUPLE2(hp, prt->id, tuple);
hp += 3;
- erts_queue_message(rp, &rp_locks, bp, tuple, am_undefined);
+ erts_queue_message(rp, &rp_locks, bp, tuple, am_undefined
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
erts_smp_proc_unlock(rp, rp_locks);
- erts_smp_proc_dec_refc(rp);
+ if (!scheduler)
+ erts_smp_proc_dec_refc(rp);
}
@@ -1810,6 +1918,12 @@ static void flush_port(Port *p)
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(p));
if (p->drv_ptr->flush != NULL) {
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(driver_flush)) {
+ DTRACE_FORMAT_COMMON_PID_AND_PORT(p->connected, p)
+ DTRACE3(driver_flush, process_str, port_str, p->name);
+ }
+#endif
if (IS_TRACED_FL(p, F_TRACE_SCHED_PORTS)) {
trace_sched_ports_where(p, am_in, am_flush);
}
@@ -1837,6 +1951,7 @@ terminate_port(Port *prt)
Eterm send_closed_port_id;
Eterm connected_id = NIL /* Initialize to silence compiler */;
erts_driver_t *drv;
+ int halt;
ERTS_SMP_CHK_NO_PROC_LOCKS;
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(prt));
@@ -1844,6 +1959,8 @@ terminate_port(Port *prt)
ASSERT(!prt->nlinks);
ASSERT(!prt->monitors);
+ /* prt->status may be altered by kill_port()below */
+ halt = (prt->status & ERTS_PORT_SFLG_HALT) != 0;
if (prt->status & ERTS_PORT_SFLG_SEND_CLOSED) {
erts_port_status_band_set(prt, ~ERTS_PORT_SFLG_SEND_CLOSED);
send_closed_port_id = prt->id;
@@ -1862,6 +1979,12 @@ terminate_port(Port *prt)
drv = prt->drv_ptr;
if ((drv != NULL) && (drv->stop != NULL)) {
int fpe_was_unmasked = erts_block_fpe();
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(driver_stop)) {
+ DTRACE_FORMAT_COMMON_PID_AND_PORT(prt->connected, prt)
+ DTRACE3(driver_stop, process_str, drv->name, port_str);
+ }
+#endif
(*drv->stop)((ErlDrvData)prt->drv_data);
erts_unblock_fpe(fpe_was_unmasked);
#ifdef ERTS_SMP
@@ -1895,6 +2018,10 @@ terminate_port(Port *prt)
* We don't want to send the closed message until after the
* port has been removed from the port table (in kill_port()).
*/
+ if (halt && (erts_smp_atomic32_dec_read_nob(&erts_halt_progress) == 0)) {
+ erts_smp_port_unlock(prt); /* We will exit and never return */
+ erl_exit_flush_async(erts_halt_code, "");
+ }
if (is_internal_port(send_closed_port_id))
deliver_result(send_closed_port_id, connected_id, am_closed);
@@ -2019,6 +2146,19 @@ erts_do_exit_port(Port *p, Eterm from, Eterm reason)
rreason = (reason == am_kill) ? am_killed : reason;
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(port_exit)) {
+ DTRACE_CHARBUF(from_str, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(port_str, DTRACE_TERM_BUF_SIZE);
+ DTRACE_CHARBUF(rreason_str, 64);
+
+ erts_snprintf(from_str, sizeof(from_str), "%T", from);
+ dtrace_port_str(p, port_str);
+ erts_snprintf(rreason_str, sizeof(rreason_str), "%T", rreason);
+ DTRACE4(port_exit, from_str, port_str, p->name, rreason_str);
+ }
+#endif
+
if ((p->status & (ERTS_PORT_SFLGS_DEAD
| ERTS_PORT_SFLG_EXITING
| ERTS_PORT_SFLG_IMMORTAL))
@@ -2119,6 +2259,13 @@ void erts_port_command(Process *proc,
if (tp[2] == am_close) {
erts_port_status_bor_set(port, ERTS_PORT_SFLG_SEND_CLOSED);
erts_do_exit_port(port, pid, am_normal);
+
+#ifdef USE_VM_PROBES
+ if(DTRACE_ENABLED(port_command)) {
+ DTRACE_FORMAT_COMMON_PROC_AND_PORT(proc, port)
+ DTRACE4(port_command, process_str, port_str, port->name, "close");
+ }
+#endif
goto done;
} else if (is_tuple_arity(tp[2], 2)) {
tp = tuple_val(tp[2]);
@@ -2126,6 +2273,12 @@ void erts_port_command(Process *proc,
if (erts_write_to_port(caller_id, port, tp[2]) == 0)
goto done;
} else if ((tp[1] == am_connect) && is_internal_pid(tp[2])) {
+#ifdef USE_VM_PROBES
+ if(DTRACE_ENABLED(port_command)) {
+ DTRACE_FORMAT_COMMON_PROC_AND_PORT(proc, port)
+ DTRACE4(port_command, process_str, port_str, port->name, "connect");
+ }
+#endif
port->connected = tp[2];
deliver_result(port->id, pid, am_connected);
goto done;
@@ -2136,9 +2289,8 @@ void erts_port_command(Process *proc,
{
ErtsProcLocks rp_locks = ERTS_PROC_LOCKS_XSIG_SEND;
- Process* rp = erts_pid2proc_opt(NULL, 0,
- port->connected, rp_locks,
- ERTS_P2P_FLG_SMP_INC_REFC);
+ Process* rp = erts_pid2proc(NULL, 0,
+ port->connected, rp_locks);
if (rp) {
(void) erts_send_exit_signal(NULL,
port->id,
@@ -2149,7 +2301,6 @@ void erts_port_command(Process *proc,
NULL,
0);
erts_smp_proc_unlock(rp, rp_locks);
- erts_smp_proc_dec_refc(rp);
}
}
@@ -2228,6 +2379,15 @@ erts_port_control(Process* p, Port* prt, Uint command, Eterm iolist)
erts_smp_proc_unlock(p, ERTS_PROC_LOCK_MAIN);
ERTS_SMP_CHK_NO_PROC_LOCKS;
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(port_control) || DTRACE_ENABLED(driver_control)) {
+ DTRACE_FORMAT_COMMON_PROC_AND_PORT(p, prt);
+ DTRACE4(port_control, process_str, port_str, prt->name, command);
+ DTRACE5(driver_control, process_str, port_str, prt->name,
+ command, to_len);
+ }
+#endif
+
/*
* Call the port's control routine.
*/
@@ -2368,6 +2528,10 @@ print_port_info(int to, void *arg, int i)
void
set_busy_port(ErlDrvPort port_num, int on)
{
+#ifdef USE_VM_PROBES
+ DTRACE_CHARBUF(port_str, 16);
+#endif
+
ERTS_SMP_CHK_NO_PROC_LOCKS;
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(&erts_port[port_num]));
@@ -2375,12 +2539,26 @@ set_busy_port(ErlDrvPort port_num, int on)
if (on) {
erts_port_status_bor_set(&erts_port[port_num],
ERTS_PORT_SFLG_PORT_BUSY);
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(port_busy)) {
+ erts_snprintf(port_str, sizeof(port_str),
+ "%T", erts_port[port_num].id);
+ DTRACE1(port_busy, port_str);
+ }
+#endif
} else {
ErtsProcList* plp = erts_port[port_num].suspended;
erts_port_status_band_set(&erts_port[port_num],
~ERTS_PORT_SFLG_PORT_BUSY);
erts_port[port_num].suspended = NULL;
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(port_not_busy)) {
+ erts_snprintf(port_str, sizeof(port_str),
+ "%T", erts_port[port_num].id);
+ DTRACE1(port_not_busy, port_str);
+ }
+#endif
if (erts_port[port_num].dist_entry) {
/*
* Processes suspended on distribution ports are
@@ -2398,6 +2576,28 @@ set_busy_port(ErlDrvPort port_num, int on)
*/
if (plp) {
+#ifdef USE_VM_PROBES
+ /*
+ * Hrm, for blocked dist ports, plp always seems to be NULL.
+ * That's not so fun.
+ * Well, another way to get the same info is using a D
+ * script to correlate an earlier process-port_blocked+pid
+ * event with a later process-scheduled event. That's
+ * subject to the multi-CPU races with how events are
+ * handled, but hey, that way works most of the time.
+ */
+ if (DTRACE_ENABLED(process_port_unblocked)) {
+ DTRACE_CHARBUF(pid_str, 16);
+ ErtsProcList* plp2 = plp;
+
+ erts_snprintf(port_str, sizeof(port_str),
+ "%T", erts_port[port_num]);
+ while (plp2 != NULL) {
+ erts_snprintf(pid_str, sizeof(pid_str), "%T", plp2->pid);
+ DTRACE2(process_port_unblocked, pid_str, port_str);
+ }
+ }
+#endif
/* First proc should be resumed last */
if (plp->next) {
erts_resume_processes(plp->next);
@@ -2444,6 +2644,14 @@ void erts_raw_port_command(Port* p, byte* buf, Uint len)
p->drv_ptr->name ? p->drv_ptr->name : "unknown");
p->caller = NIL;
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(driver_output)) {
+ DTRACE_CHARBUF(port_str, DTRACE_TERM_BUF_SIZE);
+
+ dtrace_port_str(p, port_str);
+ DTRACE4(driver_output, "-raw-", port_str, p->name, len);
+ }
+#endif
fpe_was_unmasked = erts_block_fpe();
(*p->drv_ptr->output)((ErlDrvData)p->drv_data, (char*) buf, (int) len);
erts_unblock_fpe(fpe_was_unmasked);
@@ -2459,6 +2667,12 @@ int async_ready(Port *p, void* data)
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(p));
ASSERT(!(p->status & ERTS_PORT_SFLGS_DEAD));
if (p->drv_ptr->ready_async != NULL) {
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(driver_ready_async)) {
+ DTRACE_FORMAT_COMMON_PID_AND_PORT(p->connected, p)
+ DTRACE3(driver_ready_async, process_str, port_str, p->name);
+ }
+#endif
(*p->drv_ptr->ready_async)((ErlDrvData)p->drv_data, data);
need_free = 0;
#ifdef ERTS_SMP
@@ -2637,13 +2851,17 @@ void driver_report_exit(int ix, int status)
ErlHeapFragment *bp = NULL;
ErlOffHeap *ohp;
ErtsProcLocks rp_locks = 0;
+ int scheduler = erts_get_scheduler_id() != 0;
ERTS_SMP_CHK_NO_PROC_LOCKS;
ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(prt));
pid = prt->connected;
ASSERT(is_internal_pid(pid));
- rp = erts_pid2proc_opt(NULL, 0, pid, 0, ERTS_P2P_FLG_SMP_INC_REFC);
+
+ rp = (scheduler
+ ? erts_proc_lookup(pid)
+ : erts_pid2proc_opt(NULL, 0, pid, 0, ERTS_P2P_FLG_SMP_INC_REFC));
if (!rp)
return;
@@ -2653,10 +2871,15 @@ void driver_report_exit(int ix, int status)
hp += 3;
tuple = TUPLE2(hp, prt->id, tuple);
- erts_queue_message(rp, &rp_locks, bp, tuple, am_undefined);
+ erts_queue_message(rp, &rp_locks, bp, tuple, am_undefined
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
erts_smp_proc_unlock(rp, rp_locks);
- erts_smp_proc_dec_refc(rp);
+ if (!scheduler)
+ erts_smp_proc_dec_refc(rp);
}
@@ -2787,6 +3010,7 @@ driver_deliver_term(ErlDrvPort port,
ErlOffHeap *ohp;
ErtsProcLocks rp_locks = 0;
struct b2t_states__ b2t;
+ int scheduler = 1; /* Silence erroneous warning... */
init_b2t_states(&b2t);
@@ -2978,7 +3202,13 @@ driver_deliver_term(ErlDrvPort port,
if (res <= 0)
goto done;
- rp = erts_pid2proc_opt(NULL, 0, to, rp_locks, ERTS_P2P_FLG_SMP_INC_REFC);
+ /*
+ * Increase refc on proc if done from a non-scheduler thread.
+ */
+ scheduler = erts_get_scheduler_id() != 0;
+ rp = (scheduler
+ ? erts_proc_lookup(to)
+ : erts_pid2proc_opt(NULL, 0, to, 0, ERTS_P2P_FLG_SMP_INC_REFC));
if (!rp) {
res = 0;
goto done;
@@ -3052,6 +3282,8 @@ driver_deliver_term(ErlDrvPort port,
Uint size = ptr[1];
Uint offset = ptr[2];
+ erts_smp_atomic_add_nob(&erts_bytes_in, (erts_aint_t) size);
+
if (size <= ERL_ONHEAP_BIN_LIMIT) {
ErlHeapBin* hbp = (ErlHeapBin *) hp;
hp += heap_bin_size(size);
@@ -3083,6 +3315,9 @@ driver_deliver_term(ErlDrvPort port,
case ERL_DRV_BUF2BINARY: { /* char*, size */
byte *bufp = (byte *) ptr[0];
Uint size = (Uint) ptr[1];
+
+ erts_smp_atomic_add_nob(&erts_bytes_in, (erts_aint_t) size);
+
if (size <= ERL_ONHEAP_BIN_LIMIT) {
ErlHeapBin* hbp = (ErlHeapBin *) hp;
hp += heap_bin_size(size);
@@ -3119,6 +3354,7 @@ driver_deliver_term(ErlDrvPort port,
}
case ERL_DRV_STRING: /* char*, length */
+ erts_smp_atomic_add_nob(&erts_bytes_in, (erts_aint_t) ptr[1]);
mess = buf_to_intlist(&hp, (char*)ptr[0], ptr[1], NIL);
ptr += 2;
break;
@@ -3203,7 +3439,11 @@ driver_deliver_term(ErlDrvPort port,
HRelease(rp, hp_end, hp);
}
/* send message */
- erts_queue_message(rp, &rp_locks, bp, mess, am_undefined);
+ erts_queue_message(rp, &rp_locks, bp, mess, am_undefined
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
}
else {
if (b2t.ix > b2t.used)
@@ -3220,7 +3460,8 @@ driver_deliver_term(ErlDrvPort port,
if (rp) {
if (rp_locks)
erts_smp_proc_unlock(rp, rp_locks);
- erts_smp_proc_dec_refc(rp);
+ if (!scheduler)
+ erts_smp_proc_dec_refc(rp);
}
#endif
cleanup_b2t_states(&b2t);
@@ -4434,6 +4675,12 @@ void erts_fire_port_monitor(Port *prt, Eterm ref)
ASSERT(callback != NULL);
ref_to_driver_monitor(ref,&drv_monitor);
DRV_MONITOR_UNLOCK_PDL(prt);
+#ifdef USE_VM_PROBES
+ if (DTRACE_ENABLED(driver_process_exit)) {
+ DTRACE_FORMAT_COMMON_PID_AND_PORT(prt->connected, prt)
+ DTRACE3(driver_process_exit, process_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);
@@ -4877,6 +5124,8 @@ init_driver(erts_driver_t *drv, ErlDrvEntry *de, DE_Handle *handle)
else {
int res;
int fpe_was_unmasked = erts_block_fpe();
+ DTRACE4(driver_init, drv->name, drv->version.major, drv->version.minor,
+ drv->flags);
res = (*de->init)();
erts_unblock_fpe(fpe_was_unmasked);
return res;
@@ -5001,11 +5250,11 @@ int null_func(void)
int
erl_drv_putenv(char *key, char *value)
{
- return erts_write_env(key, value);
+ return erts_sys_putenv_raw(key, value);
}
int
erl_drv_getenv(char *key, char *value, size_t *value_size)
{
- return erts_sys_getenv(key, value, value_size);
+ return erts_sys_getenv_raw(key, value, value_size);
}
diff --git a/erts/emulator/beam/module.c b/erts/emulator/beam/module.c
index b93b1ad09a..1ef71cda79 100644
--- a/erts/emulator/beam/module.c
+++ b/erts/emulator/beam/module.c
@@ -26,21 +26,32 @@
#include "global.h"
#include "module.h"
+#ifdef DEBUG
+# define IF_DEBUG(x) x
+#else
+# define IF_DEBUG(x)
+#endif
+
#define MODULE_SIZE 50
#define MODULE_LIMIT (64*1024)
-static IndexTable module_table;
+static IndexTable module_tables[ERTS_NUM_CODE_IX];
-/*
- * SMP note: We don't need to look accesses to the module table because
- * there is one only scheduler thread when we update it.
+erts_smp_rwmtx_t the_old_code_rwlocks[ERTS_NUM_CODE_IX];
+
+static erts_smp_atomic_t tot_module_bytes;
+
+/* SMP note: Active module table lookup and current module instance can be
+ * read without any locks. Old module instances are protected by
+ * "the_old_code_rwlocks" as purging is done on active module table.
+ * Staging table is protected by the "code_ix lock".
*/
#include "erl_smp.h"
void module_info(int to, void *to_arg)
{
- index_info(to, to_arg, &module_table);
+ index_info(to, to_arg, &module_tables[erts_active_code_ix()]);
}
@@ -59,45 +70,67 @@ static int module_cmp(Module* tmpl, Module* obj)
static Module* module_alloc(Module* tmpl)
{
Module* obj = (Module*) erts_alloc(ERTS_ALC_T_MODULE, sizeof(Module));
+ erts_smp_atomic_add_nob(&tot_module_bytes, sizeof(Module));
obj->module = tmpl->module;
- obj->code = 0;
- obj->old_code = 0;
- obj->code_length = 0;
- obj->old_code_length = 0;
+ obj->curr.code = 0;
+ obj->old.code = 0;
+ obj->curr.code_length = 0;
+ obj->old.code_length = 0;
obj->slot.index = -1;
- obj->nif = NULL;
- obj->old_nif = NULL;
+ obj->curr.nif = NULL;
+ obj->old.nif = NULL;
+ obj->curr.num_breakpoints = 0;
+ obj->old.num_breakpoints = 0;
+ obj->curr.num_traced_exports = 0;
+ obj->old.num_traced_exports = 0;
return obj;
}
+static void module_free(Module* mod)
+{
+ erts_free(ERTS_ALC_T_MODULE, mod);
+ erts_smp_atomic_add_nob(&tot_module_bytes, -sizeof(Module));
+}
void init_module_table(void)
{
HashFunctions f;
+ int i;
f.hash = (H_FUN) module_hash;
f.cmp = (HCMP_FUN) module_cmp;
f.alloc = (HALLOC_FUN) module_alloc;
- f.free = 0;
+ f.free = (HFREE_FUN) module_free;
+
+ for (i = 0; i < ERTS_NUM_CODE_IX; i++) {
+ erts_index_init(ERTS_ALC_T_MODULE_TABLE, &module_tables[i], "module_code",
+ MODULE_SIZE, MODULE_LIMIT, f);
+ }
- erts_index_init(ERTS_ALC_T_MODULE_TABLE, &module_table, "module_code",
- MODULE_SIZE, MODULE_LIMIT, f);
+ for (i=0; i<ERTS_NUM_CODE_IX; i++) {
+ erts_smp_rwmtx_init_x(&the_old_code_rwlocks[i], "old_code", make_small(i));
+ }
+ erts_smp_atomic_init_nob(&tot_module_bytes, 0);
}
Module*
-erts_get_module(Eterm mod)
+erts_get_module(Eterm mod, ErtsCodeIndex code_ix)
{
Module e;
int index;
+ IndexTable* mod_tab;
ASSERT(is_atom(mod));
+
+ mod_tab = &module_tables[code_ix];
+
e.module = atom_val(mod);
- index = index_get(&module_table, (void*) &e);
+ index = index_get(mod_tab, (void*) &e);
if (index == -1) {
return NULL;
} else {
- return (Module*) erts_index_lookup(&module_table, index);
+ return (Module*) erts_index_lookup(mod_tab, index);
}
}
@@ -105,27 +138,101 @@ Module*
erts_put_module(Eterm mod)
{
Module e;
- int index;
+ IndexTable* mod_tab;
+ int oldsz, newsz;
+ Module* res;
ASSERT(is_atom(mod));
ERTS_SMP_LC_ASSERT(erts_initialized == 0
- || erts_smp_thr_progress_is_blocking());
+ || erts_is_code_ix_locked());
+
+ mod_tab = &module_tables[erts_staging_code_ix()];
e.module = atom_val(mod);
- index = index_put(&module_table, (void*) &e);
- return (Module*) erts_index_lookup(&module_table, index);
+ oldsz = index_table_sz(mod_tab);
+ res = (Module*) index_put_entry(mod_tab, (void*) &e);
+ newsz = index_table_sz(mod_tab);
+ erts_smp_atomic_add_nob(&tot_module_bytes, (newsz - oldsz));
+ return res;
}
-Module *module_code(int i)
+Module *module_code(int i, ErtsCodeIndex code_ix)
{
- return (Module*) erts_index_lookup(&module_table, i);
+ return (Module*) erts_index_lookup(&module_tables[code_ix], i);
}
-int module_code_size(void)
+int module_code_size(ErtsCodeIndex code_ix)
{
- return module_table.entries;
+ return module_tables[code_ix].entries;
}
int module_table_sz(void)
{
- return index_table_sz(&module_table);
+ return erts_smp_atomic_read_nob(&tot_module_bytes);
+}
+
+#ifdef DEBUG
+static ErtsCodeIndex dbg_load_code_ix = 0;
+#endif
+
+static int entries_at_start_staging = 0;
+
+void module_start_staging(void)
+{
+ IndexTable* src = &module_tables[erts_active_code_ix()];
+ IndexTable* dst = &module_tables[erts_staging_code_ix()];
+ Module* src_mod;
+ Module* dst_mod;
+ int i, oldsz, newsz;
+
+ ASSERT(dbg_load_code_ix == -1);
+ ASSERT(dst->entries <= src->entries);
+
+ /*
+ * Make sure our existing modules are up-to-date
+ */
+ for (i = 0; i < dst->entries; i++) {
+ src_mod = (Module*) erts_index_lookup(src, i);
+ dst_mod = (Module*) erts_index_lookup(dst, i);
+ ASSERT(src_mod->module == dst_mod->module);
+
+ dst_mod->curr = src_mod->curr;
+ dst_mod->old = src_mod->old;
+ }
+
+ /*
+ * Copy all new modules from active table
+ */
+ oldsz = index_table_sz(dst);
+ for (i = dst->entries; i < src->entries; i++) {
+ src_mod = (Module*) erts_index_lookup(src, i);
+ dst_mod = (Module*) index_put_entry(dst, src_mod);
+ ASSERT(dst_mod != src_mod);
+
+ dst_mod->curr = src_mod->curr;
+ dst_mod->old = src_mod->old;
+ }
+ newsz = index_table_sz(dst);
+ erts_smp_atomic_add_nob(&tot_module_bytes, (newsz - oldsz));
+
+ entries_at_start_staging = dst->entries;
+ IF_DEBUG(dbg_load_code_ix = erts_staging_code_ix());
+}
+
+void module_end_staging(int commit)
+{
+ ASSERT(dbg_load_code_ix == erts_staging_code_ix());
+
+ if (!commit) { /* abort */
+ IndexTable* tab = &module_tables[erts_staging_code_ix()];
+ int oldsz, newsz;
+
+ ASSERT(entries_at_start_staging <= tab->entries);
+ oldsz = index_table_sz(tab);
+ index_erase_latest_from(tab, entries_at_start_staging);
+ newsz = index_table_sz(tab);
+ erts_smp_atomic_add_nob(&tot_module_bytes, (newsz - oldsz));
+ }
+
+ IF_DEBUG(dbg_load_code_ix = -1);
}
+
diff --git a/erts/emulator/beam/module.h b/erts/emulator/beam/module.h
index 694e4ab72f..6e123a0ffe 100644
--- a/erts/emulator/beam/module.h
+++ b/erts/emulator/beam/module.h
@@ -24,28 +24,72 @@
#include "index.h"
#endif
+struct erl_module_instance {
+ BeamInstr* code;
+ int code_length; /* Length of loaded code in bytes. */
+ unsigned catches;
+ struct erl_module_nif* nif;
+ int num_breakpoints;
+ int num_traced_exports;
+};
typedef struct erl_module {
IndexSlot slot; /* Must be located at top of struct! */
int module; /* Atom index for module (not tagged). */
- BeamInstr* code;
- BeamInstr* old_code;
- int code_length; /* Length of loaded code in bytes. */
- int old_code_length; /* Length of old loaded code in bytes */
- unsigned catches, old_catches;
- struct erl_module_nif* nif;
- struct erl_module_nif* old_nif;
+ struct erl_module_instance curr;
+ struct erl_module_instance old; /* protected by "old_code" rwlock */
} Module;
-Module* erts_get_module(Eterm mod);
+Module* erts_get_module(Eterm mod, ErtsCodeIndex code_ix);
Module* erts_put_module(Eterm mod);
void init_module_table(void);
+void module_start_staging(void);
+void module_end_staging(int commit);
void module_info(int, void *);
-Module *module_code(int);
-int module_code_size(void);
+Module *module_code(int, ErtsCodeIndex);
+int module_code_size(ErtsCodeIndex);
int module_table_sz(void);
+ERTS_GLB_INLINE void erts_rwlock_old_code(ErtsCodeIndex);
+ERTS_GLB_INLINE void erts_rwunlock_old_code(ErtsCodeIndex);
+ERTS_GLB_INLINE void erts_rlock_old_code(ErtsCodeIndex);
+ERTS_GLB_INLINE void erts_runlock_old_code(ErtsCodeIndex);
+#ifdef ERTS_ENABLE_LOCK_CHECK
+int erts_is_old_code_rlocked(ErtsCodeIndex);
+#endif
+
+#if ERTS_GLB_INLINE_INCL_FUNC_DEF
+
+extern erts_smp_rwmtx_t the_old_code_rwlocks[ERTS_NUM_CODE_IX];
+
+ERTS_GLB_INLINE void erts_rwlock_old_code(ErtsCodeIndex code_ix)
+{
+ erts_smp_rwmtx_rwlock(&the_old_code_rwlocks[code_ix]);
+}
+ERTS_GLB_INLINE void erts_rwunlock_old_code(ErtsCodeIndex code_ix)
+{
+ erts_smp_rwmtx_rwunlock(&the_old_code_rwlocks[code_ix]);
+}
+ERTS_GLB_INLINE void erts_rlock_old_code(ErtsCodeIndex code_ix)
+{
+ erts_smp_rwmtx_rlock(&the_old_code_rwlocks[code_ix]);
+}
+ERTS_GLB_INLINE void erts_runlock_old_code(ErtsCodeIndex code_ix)
+{
+ erts_smp_rwmtx_runlock(&the_old_code_rwlocks[code_ix]);
+}
+
+#ifdef ERTS_ENABLE_LOCK_CHECK
+ERTS_GLB_INLINE int erts_is_old_code_rlocked(ErtsCodeIndex code_ix)
+{
+ return erts_smp_lc_rwmtx_is_rlocked(&the_old_code_rwlocks[code_ix]);
+}
#endif
+
+#endif /* ERTS_GLB_INLINE_INCL_FUNC_DEF */
+
+
+#endif /* !__MODULE_H__ */
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab
index fc53a88a3a..6764e88c81 100644
--- a/erts/emulator/beam/ops.tab
+++ b/erts/emulator/beam/ops.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -62,11 +62,8 @@ label L
i_func_info I a a I
int_code_end
-i_trace_breakpoint
-i_mtrace_breakpoint
+i_generic_breakpoint
i_debug_breakpoint
-i_count_breakpoint
-i_time_breakpoint
i_return_time_trace
i_return_to_trace
i_yield
@@ -522,7 +519,6 @@ apply_bif
call_nif
call_error_handler
error_action_code
-call_traced_function
return_trace
#
@@ -829,16 +825,20 @@ call_ext_only Ar=u==2 Bif=u$bif:erlang:load_nif/2 => allocate u Ar | i_call_ext
#
-# The apply/2 and apply/3 BIFs are instructions.
+# apply/2 is an instruction, not a BIF.
#
call_ext u==2 u$func:erlang:apply/2 => i_apply_fun
call_ext_last u==2 u$func:erlang:apply/2 D => i_apply_fun_last D
call_ext_only u==2 u$func:erlang:apply/2 => i_apply_fun_only
-call_ext u==3 u$func:erlang:apply/3 => i_apply
-call_ext_last u==3 u$func:erlang:apply/3 D => i_apply_last D
-call_ext_only u==3 u$func:erlang:apply/3 => i_apply_only
+#
+# The apply/3 BIF is an instruction.
+#
+
+call_ext u==3 u$bif:erlang:apply/3 => i_apply
+call_ext_last u==3 u$bif:erlang:apply/3 D => i_apply_last D
+call_ext_only u==3 u$bif:erlang:apply/3 => i_apply_only
#
# The exit/1 and throw/1 BIFs never execute the instruction following them;
@@ -883,6 +883,95 @@ call_ext_last u==3 u$func:erlang:hibernate/3 D => i_hibernate
call_ext_only u==3 u$func:erlang:hibernate/3 => i_hibernate
#
+# If VM probes are not enabled, we want to short-circult calls to
+# the dt tag BIFs to make them as cheap as possible.
+#
+
+%unless USE_VM_PROBES
+
+call_ext Arity u$func:erlang:dt_get_tag/0 => \
+ move a=am_undefined r
+call_ext_last Arity u$func:erlang:dt_get_tag/0 D => \
+ move a=am_undefined r | deallocate D | return
+call_ext_only Arity u$func:erlang:dt_get_tag/0 => \
+ move a=am_undefined r | return
+
+move Any r | call_ext Arity u$func:erlang:dt_put_tag/1 => \
+ move a=am_undefined r
+move Any r | call_ext_last Arity u$func:erlang:dt_put_tag/1 D => \
+ move a=am_undefined r | deallocate D | return
+move Any r | call_ext_only Arity u$func:erlang:dt_put_tag/1 => \
+ move a=am_undefined r | return
+call_ext Arity u$func:erlang:dt_put_tag/1 => \
+ move a=am_undefined r
+call_ext_last Arity u$func:erlang:dt_put_tag/1 D => \
+ move a=am_undefined r | deallocate D | return
+call_ext_only Arity u$func:erlang:dt_put_tag/1 => \
+ move a=am_undefined r | return
+
+call_ext Arity u$func:erlang:dt_get_tag_data/0 => \
+ move a=am_undefined r
+call_ext_last Arity u$func:erlang:dt_get_tag_data/0 D => \
+ move a=am_undefined r | deallocate D | return
+call_ext_only Arity u$func:erlang:dt_get_tag_data/0 => \
+ move a=am_undefined r | return
+
+move Any r | call_ext Arity u$func:erlang:dt_spread_tag/1 => \
+ move a=am_true r
+move Any r | call_ext_last Arity u$func:erlang:dt_spread_tag/1 D => \
+ move a=am_true r | deallocate D | return
+move Any r | call_ext_only Arity u$func:erlang:dt_spread_tag/1 => \
+ move a=am_true r | return
+call_ext Arity u$func:erlang:dt_spread_tag/1 => \
+ move a=am_true r
+call_ext_last Arity u$func:erlang:dt_spread_tag/1 D => \
+ move a=am_true r | deallocate D | return
+call_ext_only Arity u$func:erlang:dt_spread_tag/1 => \
+ move a=am_true r | return
+
+move Any r | call_ext Arity u$func:erlang:dt_restore_tag/1 => \
+ move a=am_true r
+move Any r | call_ext_last Arity u$func:erlang:dt_restore_tag/1 D => \
+ move a=am_true r | deallocate D | return
+move Any r | call_ext_only Arity u$func:erlang:dt_restore_tag/1 => \
+ move a=am_true r | return
+call_ext Arity u$func:erlang:dt_restore_tag/1 => \
+ move a=am_true r
+call_ext_last Arity u$func:erlang:dt_restore_tag/1 D => \
+ move a=am_true r | deallocate D | return
+call_ext_only Arity u$func:erlang:dt_restore_tag/1 => \
+ move a=am_true r | return
+
+move Any r | call_ext Arity u$func:erlang:dt_prepend_vm_tag_data/1 => \
+ move Any r
+move Any r | call_ext_last Arity u$func:erlang:dt_prepend_vm_tag_data/1 D => \
+ move Any r | deallocate D | return
+move Any r | call_ext_only Arity u$func:erlang:dt_prepend_vm_tag_data/1 => \
+ move Any r | return
+call_ext Arity u$func:erlang:dt_prepend_vm_tag_data/1 =>
+call_ext_last Arity u$func:erlang:dt_prepend_vm_tag_data/1 D => \
+ deallocate D | return
+call_ext_only Arity u$func:erlang:dt_prepend_vm_tag_data/1 => \
+ return
+
+move Any r | call_ext Arity u$func:erlang:dt_append_vm_tag_data/1 => \
+ move Any r
+move Any r | call_ext_last Arity u$func:erlang:dt_append_vm_tag_data/1 D => \
+ move Any r | deallocate D | return
+move Any r | call_ext_only Arity u$func:erlang:dt_append_vm_tag_data/1 => \
+ move Any r | return
+call_ext Arity u$func:erlang:dt_append_vm_tag_data/1 =>
+call_ext_last Arity u$func:erlang:dt_append_vm_tag_data/1 D => \
+ deallocate D | return
+call_ext_only Arity u$func:erlang:dt_append_vm_tag_data/1 => \
+ return
+
+# Can happen after one of the transformations above.
+move Discarded r | move Something r => move Something r
+
+%endif
+
+#
# The general case for BIFs that have no special instructions.
# A BIF used in the tail must be followed by a return instruction.
#
diff --git a/erts/emulator/beam/register.c b/erts/emulator/beam/register.c
index 26d64887d0..c02872ef80 100644
--- a/erts/emulator/beam/register.c
+++ b/erts/emulator/beam/register.c
@@ -93,19 +93,14 @@ reg_safe_write_lock(Process *c_p, ErtsProcLocks *c_p_locks)
reg_write_lock();
}
+#endif
+
static ERTS_INLINE int
is_proc_alive(Process *p)
{
- int res;
- erts_pix_lock_t *pixlck = ERTS_PID2PIXLOCK(p->id);
- erts_pix_lock(pixlck);
- res = !p->is_exiting;
- erts_pix_unlock(pixlck);
- return res;
+ return !ERTS_PROC_IS_EXITING(p);
}
-#endif
-
void register_info(int to, void *to_arg)
{
int lock = !ERTS_IS_CRASH_DUMPING;
@@ -389,8 +384,7 @@ erts_whereis_name(Process *c_p,
}
#else
if (rp->p
- && ((flags & ERTS_P2P_FLG_ALLOW_OTHER_X)
- || rp->p->status != P_EXITING))
+ && ((flags & ERTS_P2P_FLG_ALLOW_OTHER_X) || is_proc_alive(rp->p)))
*proc = rp->p;
else
*proc = NULL;
@@ -402,7 +396,9 @@ erts_whereis_name(Process *c_p,
if (!rp || !rp->pt)
*port = NULL;
else {
-#ifdef ERTS_SMP
+#ifndef ERTS_SMP
+ erts_smp_atomic_inc_nob(&rp->pt->refc);
+#else
if (pending_port == rp->pt)
pending_port = NULL;
else {
@@ -509,9 +505,11 @@ int erts_unregister_name(Process *c_p,
if ((rp = (RegProc*) hash_get(&process_reg, (void*) &r)) != NULL) {
if (rp->pt) {
if (port != rp->pt) {
-#ifdef ERTS_SMP
+#ifndef ERTS_SMP
+ erts_smp_atomic_inc_nob(&rp->pt->refc);
+#else
if (port) {
- ERTS_SMP_LC_ASSERT(port != c_prt);
+ ASSERT(port != c_prt);
erts_smp_port_unlock(port);
port = NULL;
}
diff --git a/erts/emulator/beam/register.h b/erts/emulator/beam/register.h
index 97bab3ab71..38e8cfbf28 100644
--- a/erts/emulator/beam/register.h
+++ b/erts/emulator/beam/register.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -41,7 +41,7 @@ struct port;
typedef struct reg_proc
{
HashBucket bucket; /* MUST BE LOCATED AT TOP OF STRUCT!!! */
- Process *p; /* The process registerd (only one of this and
+ Process *p; /* The process registered (only one of this and
'pt' is non-NULL */
struct port *pt; /* The port registered */
Eterm name; /* Atom name */
diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h
index eb6f2f8516..0e6bec352e 100644
--- a/erts/emulator/beam/sys.h
+++ b/erts/emulator/beam/sys.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -25,11 +25,6 @@
# define NO_FPE_SIGNALS
#endif
-/* xxxP __VXWORKS__ */
-#ifdef VXWORKS
-#include <vxWorks.h>
-#endif
-
#ifdef DISABLE_CHILD_WAITER_THREAD
#undef ENABLE_CHILD_WAITER_THREAD
#endif
@@ -39,10 +34,10 @@
#define ENABLE_CHILD_WAITER_THREAD 1
#endif
+#define ERTS_I64_LITERAL(X) X##LL
+
#if defined (__WIN32__)
# include "erl_win_sys.h"
-#elif defined (VXWORKS)
-# include "erl_vxworks_sys.h"
#else
# include "erl_unix_sys.h"
#ifndef UNIX
@@ -91,14 +86,22 @@ typedef ERTS_SYS_FD_TYPE ErtsSysFdType;
# endif
#endif
-#ifdef __GNUC__
-# if __GNUC__ < 3 && (__GNUC__ != 2 || __GNUC_MINOR__ < 96)
-# define ERTS_LIKELY(BOOL) (BOOL)
-# define ERTS_UNLIKELY(BOOL) (BOOL)
-# else
-# define ERTS_LIKELY(BOOL) __builtin_expect((BOOL), !0)
-# define ERTS_UNLIKELY(BOOL) __builtin_expect((BOOL), 0)
-# endif
+#if !defined(__GNUC__)
+# define ERTS_AT_LEAST_GCC_VSN__(MAJ, MIN, PL) 0
+#elif !defined(__GNUC_MINOR__)
+# define ERTS_AT_LEAST_GCC_VSN__(MAJ, MIN, PL) \
+ ((__GNUC__ << 24) >= (((MAJ) << 24) | ((MIN) << 12) | (PL)))
+#elif !defined(__GNUC_PATCHLEVEL__)
+# define ERTS_AT_LEAST_GCC_VSN__(MAJ, MIN, PL) \
+ (((__GNUC__ << 24) | (__GNUC_MINOR__ << 12)) >= (((MAJ) << 24) | ((MIN) << 12) | (PL)))
+#else
+# define ERTS_AT_LEAST_GCC_VSN__(MAJ, MIN, PL) \
+ (((__GNUC__ << 24) | (__GNUC_MINOR__ << 12) | __GNUC_PATCHLEVEL__) >= (((MAJ) << 24) | ((MIN) << 12) | (PL)))
+#endif
+
+#if ERTS_AT_LEAST_GCC_VSN__(2, 96, 0)
+# define ERTS_LIKELY(BOOL) __builtin_expect((BOOL), !0)
+# define ERTS_UNLIKELY(BOOL) __builtin_expect((BOOL), 0)
#else
# define ERTS_LIKELY(BOOL) (BOOL)
# define ERTS_UNLIKELY(BOOL) (BOOL)
@@ -172,10 +175,16 @@ void erl_assert_error(char* expr, char* file, int line);
# define const
#endif
-#ifdef VXWORKS
-/* Replace VxWorks' printf with a real one that does fprintf(stdout, ...) */
-int real_printf(const char *fmt, ...);
-# define printf real_printf
+#undef __deprecated
+#if ERTS_AT_LEAST_GCC_VSN__(3, 0, 0)
+# define __deprecated __attribute__((deprecated))
+#else
+# define __deprecated
+#endif
+#if ERTS_AT_LEAST_GCC_VSN__(3, 0, 4)
+# define erts_align_attribute(SZ) __attribute__ ((aligned (SZ)))
+#else
+# define erts_align_attribute(SZ)
#endif
/* In VC++, noreturn is a declspec that has to be before the types,
@@ -185,12 +194,6 @@ int real_printf(const char *fmt, ...);
#if __GNUC__
# define __decl_noreturn
# define __noreturn __attribute__((noreturn))
-# undef __deprecated
-# if __GNUC__ >= 3
-# define __deprecated __attribute__((deprecated))
-# else
-# define __deprecated
-# endif
#else
# if defined(__WIN32__) && defined(_MSC_VER)
# define __noreturn
@@ -199,7 +202,6 @@ int real_printf(const char *fmt, ...);
# define __noreturn
# define __decl_noreturn
# endif
-# define __deprecated
#endif
/*
@@ -471,38 +473,28 @@ static unsigned long zero_value = 0, one_value = 1;
# define SET_NONBLOCKING(fd) ioctlsocket((fd), FIONBIO, &one_value)
# else
-# ifdef VXWORKS
-# include <fcntl.h> /* xxxP added for O_WRONLY etc ... macro:s ... */
-# include <ioLib.h>
-static const int zero_value = 0, one_value = 1;
-# define SET_BLOCKING(fd) ioctl((fd), FIONBIO, (int)&zero_value)
-# define SET_NONBLOCKING(fd) ioctl((fd), FIONBIO, (int)&one_value)
-# define ERRNO_BLOCK EWOULDBLOCK
-
-# else
-# ifdef NB_FIONBIO /* Old BSD */
-# include <sys/ioctl.h>
+# ifdef NB_FIONBIO /* Old BSD */
+# include <sys/ioctl.h>
static const int zero_value = 0, one_value = 1;
-# define SET_BLOCKING(fd) ioctl((fd), FIONBIO, &zero_value)
-# define SET_NONBLOCKING(fd) ioctl((fd), FIONBIO, &one_value)
-# define ERRNO_BLOCK EWOULDBLOCK
-# else /* !NB_FIONBIO */
-# include <fcntl.h>
-# ifdef NB_O_NDELAY /* Nothing needs this? */
-# define NB_FLAG O_NDELAY
-# ifndef ERRNO_BLOCK /* allow override (e.g. EAGAIN) via Makefile */
-# define ERRNO_BLOCK EWOULDBLOCK
-# endif
-# else /* !NB_O_NDELAY */ /* The True Way - POSIX!:-) */
-# define NB_FLAG O_NONBLOCK
-# define ERRNO_BLOCK EAGAIN
-# endif /* !NB_O_NDELAY */
-# define SET_BLOCKING(fd) fcntl((fd), F_SETFL, \
- fcntl((fd), F_GETFL, 0) & ~NB_FLAG)
-# define SET_NONBLOCKING(fd) fcntl((fd), F_SETFL, \
- fcntl((fd), F_GETFL, 0) | NB_FLAG)
-# endif /* !NB_FIONBIO */
-# endif /* _WXWORKS_ */
+# define SET_BLOCKING(fd) ioctl((fd), FIONBIO, &zero_value)
+# define SET_NONBLOCKING(fd) ioctl((fd), FIONBIO, &one_value)
+# define ERRNO_BLOCK EWOULDBLOCK
+# else /* !NB_FIONBIO */
+# include <fcntl.h>
+# ifdef NB_O_NDELAY /* Nothing needs this? */
+# define NB_FLAG O_NDELAY
+# ifndef ERRNO_BLOCK /* allow override (e.g. EAGAIN) via Makefile */
+# define ERRNO_BLOCK EWOULDBLOCK
+# endif
+# else /* !NB_O_NDELAY */ /* The True Way - POSIX!:-) */
+# define NB_FLAG O_NONBLOCK
+# define ERRNO_BLOCK EAGAIN
+# endif /* !NB_O_NDELAY */
+# define SET_BLOCKING(fd) fcntl((fd), F_SETFL, \
+ fcntl((fd), F_GETFL, 0) & ~NB_FLAG)
+# define SET_NONBLOCKING(fd) fcntl((fd), F_SETFL, \
+ fcntl((fd), F_GETFL, 0) | NB_FLAG)
+# endif /* !NB_FIONBIO */
# endif /* !__WIN32__ */
#endif /* WANT_NONBLOCKING */
@@ -511,7 +503,7 @@ __decl_noreturn void __noreturn erl_exit(int n, char*, ...);
/* Some special erl_exit() codes: */
#define ERTS_INTR_EXIT INT_MIN /* called from signal handler */
#define ERTS_ABORT_EXIT (INT_MIN + 1) /* no crash dump; only abort() */
-#define ERTS_DUMP_EXIT (127) /* crash dump; then exit() */
+#define ERTS_DUMP_EXIT (INT_MIN + 2) /* crash dump; then exit() */
Eterm erts_check_io_info(void *p);
@@ -699,22 +691,25 @@ void fini_getenv_state(GETENV_STATE *);
/* xxxP */
void init_sys_float(void);
int sys_chars_to_double(char*, double*);
-int sys_double_to_chars(double, char*);
-void sys_get_pid(char *);
+int sys_double_to_chars(double, char*, size_t);
+void sys_get_pid(char *, size_t);
/* erts_sys_putenv() returns, 0 on success and a value != 0 on failure. */
-int erts_sys_putenv(char *key_value, int sep_ix);
+int erts_sys_putenv(char *key, char *value);
+/* Simple variant used from drivers, raw eightbit interface */
+int erts_sys_putenv_raw(char *key, char *value);
/* erts_sys_getenv() returns 0 on success (length of value string in
*size), a value > 0 if value buffer is too small (*size is set to needed
size), and a value < 0 on failure. */
int erts_sys_getenv(char *key, char *value, size_t *size);
+/* Simple variant used from drivers, raw eightbit interface */
+int erts_sys_getenv_raw(char *key, char *value, size_t *size);
/* erts_sys_getenv__() is only allowed to be used in early init phase */
int erts_sys_getenv__(char *key, char *value, size_t *size);
/* Easier to use, but not as efficient, environment functions */
char *erts_read_env(char *key);
void erts_free_read_env(void *value);
-int erts_write_env(char *key, char *value);
/* utils.c */
@@ -855,13 +850,6 @@ erts_refc_read(erts_refc_t *refcp, erts_aint_t min_val)
extern int erts_use_kernel_poll;
#endif
-#if defined(VXWORKS)
-/* NOTE! sys_calloc2 does not exist on other
- platforms than VxWorks and OSE */
-void* sys_calloc2(Uint, Uint);
-#endif /* VXWORKS || OSE */
-
-
#define sys_memcpy(s1,s2,n) memcpy(s1,s2,n)
#define sys_memmove(s1,s2,n) memmove(s1,s2,n)
#define sys_memcmp(s1,s2,n) memcmp(s1,s2,n)
@@ -968,43 +956,6 @@ void erl_bin_write(unsigned char *, int, int);
# define DEBUGF(x)
#endif
-
-#ifdef VXWORKS
-/* This includes redefines of malloc etc
- this should be done after sys_alloc, etc, above */
-# include "reclaim.h"
-/*********************Malloc and friends************************
- * There is a problem with the naming of malloc and friends,
- * malloc is used throughout sys.c and the resolver to mean save_alloc,
- * but it should actually mean either sys_alloc or sys_alloc2,
- * so the definitions from reclaim_master.h are not any
- * good, i redefine the malloc family here, although it's quite
- * ugly, actually it would be preferrable to use the
- * names sys_alloc and so on throughout the offending code, but
- * that will be saved as an later exercise...
- * I also add an own calloc, to make the BSD resolver source happy.
- ***************************************************************/
-/* Undefine malloc and friends */
-# ifdef malloc
-# undef malloc
-# endif
-# ifdef calloc
-# undef calloc
-# endif
-# ifdef realloc
-# undef realloc
-# endif
-# ifdef free
-# undef free
-# endif
-/* Redefine malloc and friends */
-# define malloc sys_alloc
-# define calloc sys_calloc
-# define realloc sys_realloc
-# define free sys_free
-
-#endif
-
#ifdef __WIN32__
#ifdef ARCH_64
#define ERTS_ALLOC_ALIGN_BYTES 16
@@ -1020,23 +971,20 @@ void erl_bin_write(unsigned char *, int, int);
#ifdef __WIN32__
-
void call_break_handler(void);
char* last_error(void);
char* win32_errorstr(int);
-
-
#endif
/************************************************************************
* Find out the native filename encoding of the process (look at locale of
* Unix processes and just do UTF16 on windows
************************************************************************/
-#define ERL_FILENAME_UNKNOWN 0
-#define ERL_FILENAME_LATIN1 1
-#define ERL_FILENAME_UTF8 2
-#define ERL_FILENAME_UTF8_MAC 3
-#define ERL_FILENAME_WIN_WCHAR 4
+#define ERL_FILENAME_UNKNOWN (0)
+#define ERL_FILENAME_LATIN1 (1)
+#define ERL_FILENAME_UTF8 (2)
+#define ERL_FILENAME_UTF8_MAC (3)
+#define ERL_FILENAME_WIN_WCHAR (4)
int erts_get_native_filename_encoding(void);
/* The set function is only to be used by erl_init! */
@@ -1046,4 +994,3 @@ int erts_get_user_requested_filename_encoding(void);
void erts_init_sys_common_misc(void);
#endif
-
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c
index 49b6618f73..1969fc762c 100644
--- a/erts/emulator/beam/utils.c
+++ b/erts/emulator/beam/utils.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -268,16 +268,42 @@ list_length(Eterm list)
return i;
}
-Uint erts_fit_in_bits(Uint n)
+static const struct {
+ Sint64 mask;
+ int bits;
+} fib_data[] = {{ERTS_I64_LITERAL(0x2), 1},
+ {ERTS_I64_LITERAL(0xc), 2},
+ {ERTS_I64_LITERAL(0xf0), 4},
+ {ERTS_I64_LITERAL(0xff00), 8},
+ {ERTS_I64_LITERAL(0xffff0000), 16},
+ {ERTS_I64_LITERAL(0xffffffff00000000), 32}};
+
+static ERTS_INLINE int
+fit_in_bits(Sint64 value, int start)
{
- Uint i;
+ int bits = 0;
+ int i;
- i = 0;
- while (n > 0) {
- i++;
- n >>= 1;
- }
- return i;
+ for (i = start; i >= 0; i--) {
+ if (value & fib_data[i].mask) {
+ value >>= fib_data[i].bits;
+ bits |= fib_data[i].bits;
+ }
+ }
+
+ bits++;
+
+ return bits;
+}
+
+int erts_fit_in_bits_int64(Sint64 value)
+{
+ return fit_in_bits(value, 5);
+}
+
+int erts_fit_in_bits_int32(Sint32 value)
+{
+ return fit_in_bits((Sint64) (Uint32) value, 4);
}
int
@@ -1640,12 +1666,20 @@ static int do_send_to_logger(Eterm tag, Eterm gleader, char *buf, int len)
}
#ifndef ERTS_SMP
- if (
#ifdef USE_THREADS
- !erts_get_scheduler_data() || /* Must be scheduler thread */
+ p = NULL;
+ if (erts_get_scheduler_data()) /* Must be scheduler thread */
#endif
- (p = erts_whereis_process(NULL, 0, am_error_logger, 0, 0)) == NULL
- || p->status == P_RUNNING) {
+ {
+ p = erts_whereis_process(NULL, 0, am_error_logger, 0, 0);
+ if (p) {
+ erts_aint32_t state = erts_smp_atomic32_read_acqb(&p->state);
+ if (state & ERTS_PSFLG_RUNNING)
+ p = NULL;
+ }
+ }
+
+ if (!p) {
/* buf *always* points to a null terminated string */
erts_fprintf(stderr, "(no error logger present) %T: \"%s\"\n",
tag, buf);
@@ -1697,7 +1731,11 @@ static int do_send_to_logger(Eterm tag, Eterm gleader, char *buf, int len)
erts_queue_error_logger_message(from, tuple3, bp);
}
#else
- erts_queue_message(p, NULL /* only used for smp build */, bp, tuple3, NIL);
+ erts_queue_message(p, NULL /* only used for smp build */, bp, tuple3, NIL
+#ifdef USE_VM_PROBES
+ , NIL
+#endif
+ );
#endif
return 0;
}
@@ -3236,7 +3274,7 @@ ptimer_timeout(ErtsSmpPTimer *ptimer)
ERTS_PROC_LOCK_MAIN|ERTS_PROC_LOCK_STATUS,
ERTS_P2P_FLG_ALLOW_OTHER_X);
if (p) {
- if (!p->is_exiting
+ if (!ERTS_PROC_IS_EXITING(p)
&& !(ptimer->timer.flags & ERTS_PTMR_FLG_CANCELLED)) {
ASSERT(*ptimer->timer.timer_ref == ptimer);
*ptimer->timer.timer_ref = NULL;
@@ -3405,7 +3443,7 @@ erts_read_env(char *key)
char *value = erts_alloc(ERTS_ALC_T_TMP, value_len);
int res;
while (1) {
- res = erts_sys_getenv(key, value, &value_len);
+ res = erts_sys_getenv_raw(key, value, &value_len);
if (res <= 0)
break;
value = erts_realloc(ERTS_ALC_T_TMP, value, value_len);
@@ -3424,28 +3462,6 @@ erts_free_read_env(void *value)
erts_free(ERTS_ALC_T_TMP, value);
}
-int
-erts_write_env(char *key, char *value)
-{
- int ix, res;
- size_t key_len = sys_strlen(key), value_len = sys_strlen(value);
- char *key_value = erts_alloc_fnf(ERTS_ALC_T_TMP,
- key_len + 1 + value_len + 1);
- if (!key_value) {
- errno = ENOMEM;
- return -1;
- }
- sys_memcpy((void *) key_value, (void *) key, key_len);
- ix = key_len;
- key_value[ix++] = '=';
- sys_memcpy((void *) key_value, (void *) value, value_len);
- ix += value_len;
- key_value[ix] = '\0';
- res = erts_sys_putenv(key_value, key_len);
- erts_free(ERTS_ALC_T_TMP, key_value);
- return res;
-}
-
/*
* To be used to silence unused result warnings, but do not abuse it.
*/
@@ -3454,6 +3470,254 @@ void erts_silence_warn_unused_result(long unused)
}
+/*
+ * Interval counts
+ */
+void
+erts_interval_init(erts_interval_t *icp)
+{
+#ifdef ARCH_64
+ erts_atomic_init_nob(&icp->counter.atomic, 0);
+#else
+ erts_dw_aint_t dw;
+#ifdef ETHR_SU_DW_NAINT_T__
+ dw.dw_sint = 0;
+#else
+ dw.sint[ERTS_DW_AINT_HIGH_WORD] = 0;
+ dw.sint[ERTS_DW_AINT_LOW_WORD] = 0;
+#endif
+ erts_dw_atomic_init_nob(&icp->counter.atomic, &dw);
+
+#endif
+#ifdef DEBUG
+ icp->smp_api = 0;
+#endif
+}
+
+void
+erts_smp_interval_init(erts_interval_t *icp)
+{
+#ifdef ERTS_SMP
+ erts_interval_init(icp);
+#else
+ icp->counter.not_atomic = 0;
+#endif
+#ifdef DEBUG
+ icp->smp_api = 1;
+#endif
+}
+
+static ERTS_INLINE Uint64
+step_interval_nob(erts_interval_t *icp)
+{
+#ifdef ARCH_64
+ return (Uint64) erts_atomic_inc_read_nob(&icp->counter.atomic);
+#else
+ erts_dw_aint_t exp;
+
+ erts_dw_atomic_read_nob(&icp->counter.atomic, &exp);
+ while (1) {
+ erts_dw_aint_t new = exp;
+
+#ifdef ETHR_SU_DW_NAINT_T__
+ new.dw_sint++;
+#else
+ new.sint[ERTS_DW_AINT_LOW_WORD]++;
+ if (new.sint[ERTS_DW_AINT_LOW_WORD] == 0)
+ new.sint[ERTS_DW_AINT_HIGH_WORD]++;
+#endif
+
+ if (erts_dw_atomic_cmpxchg_nob(&icp->counter.atomic, &new, &exp))
+ return erts_interval_dw_aint_to_val__(&new);
+
+ }
+#endif
+}
+
+static ERTS_INLINE Uint64
+step_interval_relb(erts_interval_t *icp)
+{
+#ifdef ARCH_64
+ return (Uint64) erts_atomic_inc_read_relb(&icp->counter.atomic);
+#else
+ erts_dw_aint_t exp;
+
+ erts_dw_atomic_read_nob(&icp->counter.atomic, &exp);
+ while (1) {
+ erts_dw_aint_t new = exp;
+
+#ifdef ETHR_SU_DW_NAINT_T__
+ new.dw_sint++;
+#else
+ new.sint[ERTS_DW_AINT_LOW_WORD]++;
+ if (new.sint[ERTS_DW_AINT_LOW_WORD] == 0)
+ new.sint[ERTS_DW_AINT_HIGH_WORD]++;
+#endif
+
+ if (erts_dw_atomic_cmpxchg_relb(&icp->counter.atomic, &new, &exp))
+ return erts_interval_dw_aint_to_val__(&new);
+
+ }
+#endif
+}
+
+
+static ERTS_INLINE Uint64
+ensure_later_interval_nob(erts_interval_t *icp, Uint64 ic)
+{
+ Uint64 curr_ic;
+#ifdef ARCH_64
+ curr_ic = (Uint64) erts_atomic_read_nob(&icp->counter.atomic);
+ if (curr_ic > ic)
+ return curr_ic;
+ return (Uint64) erts_atomic_inc_read_nob(&icp->counter.atomic);
+#else
+ erts_dw_aint_t exp;
+
+ erts_dw_atomic_read_nob(&icp->counter.atomic, &exp);
+ curr_ic = erts_interval_dw_aint_to_val__(&exp);
+ if (curr_ic > ic)
+ return curr_ic;
+
+ while (1) {
+ erts_dw_aint_t new = exp;
+
+#ifdef ETHR_SU_DW_NAINT_T__
+ new.dw_sint++;
+#else
+ new.sint[ERTS_DW_AINT_LOW_WORD]++;
+ if (new.sint[ERTS_DW_AINT_LOW_WORD] == 0)
+ new.sint[ERTS_DW_AINT_HIGH_WORD]++;
+#endif
+
+ if (erts_dw_atomic_cmpxchg_nob(&icp->counter.atomic, &new, &exp))
+ return erts_interval_dw_aint_to_val__(&new);
+
+ curr_ic = erts_interval_dw_aint_to_val__(&exp);
+ if (curr_ic > ic)
+ return curr_ic;
+ }
+#endif
+}
+
+
+static ERTS_INLINE Uint64
+ensure_later_interval_acqb(erts_interval_t *icp, Uint64 ic)
+{
+ Uint64 curr_ic;
+#ifdef ARCH_64
+ curr_ic = (Uint64) erts_atomic_read_acqb(&icp->counter.atomic);
+ if (curr_ic > ic)
+ return curr_ic;
+ return (Uint64) erts_atomic_inc_read_acqb(&icp->counter.atomic);
+#else
+ erts_dw_aint_t exp;
+
+ erts_dw_atomic_read_acqb(&icp->counter.atomic, &exp);
+ curr_ic = erts_interval_dw_aint_to_val__(&exp);
+ if (curr_ic > ic)
+ return curr_ic;
+
+ while (1) {
+ erts_dw_aint_t new = exp;
+
+#ifdef ETHR_SU_DW_NAINT_T__
+ new.dw_sint++;
+#else
+ new.sint[ERTS_DW_AINT_LOW_WORD]++;
+ if (new.sint[ERTS_DW_AINT_LOW_WORD] == 0)
+ new.sint[ERTS_DW_AINT_HIGH_WORD]++;
+#endif
+
+ if (erts_dw_atomic_cmpxchg_acqb(&icp->counter.atomic, &new, &exp))
+ return erts_interval_dw_aint_to_val__(&new);
+
+ curr_ic = erts_interval_dw_aint_to_val__(&exp);
+ if (curr_ic > ic)
+ return curr_ic;
+ }
+#endif
+}
+
+Uint64
+erts_step_interval_nob(erts_interval_t *icp)
+{
+ ASSERT(!icp->smp_api);
+ return step_interval_nob(icp);
+}
+
+Uint64
+erts_step_interval_relb(erts_interval_t *icp)
+{
+ ASSERT(!icp->smp_api);
+ return step_interval_relb(icp);
+}
+
+Uint64
+erts_smp_step_interval_nob(erts_interval_t *icp)
+{
+ ASSERT(icp->smp_api);
+#ifdef ERTS_SMP
+ return step_interval_nob(icp);
+#else
+ return ++icp->counter.not_atomic;
+#endif
+}
+
+Uint64
+erts_smp_step_interval_relb(erts_interval_t *icp)
+{
+ ASSERT(icp->smp_api);
+#ifdef ERTS_SMP
+ return step_interval_relb(icp);
+#else
+ return ++icp->counter.not_atomic;
+#endif
+}
+
+Uint64
+erts_ensure_later_interval_nob(erts_interval_t *icp, Uint64 ic)
+{
+ ASSERT(!icp->smp_api);
+ return ensure_later_interval_nob(icp, ic);
+}
+
+Uint64
+erts_ensure_later_interval_acqb(erts_interval_t *icp, Uint64 ic)
+{
+ ASSERT(!icp->smp_api);
+ return ensure_later_interval_acqb(icp, ic);
+}
+
+Uint64
+erts_smp_ensure_later_interval_nob(erts_interval_t *icp, Uint64 ic)
+{
+ ASSERT(icp->smp_api);
+#ifdef ERTS_SMP
+ return ensure_later_interval_nob(icp, ic);
+#else
+ if (icp->counter.not_atomic > ic)
+ return icp->counter.not_atomic;
+ else
+ return ++icp->counter.not_atomic;
+#endif
+}
+
+Uint64
+erts_smp_ensure_later_interval_acqb(erts_interval_t *icp, Uint64 ic)
+{
+ ASSERT(icp->smp_api);
+#ifdef ERTS_SMP
+ return ensure_later_interval_acqb(icp, ic);
+#else
+ if (icp->counter.not_atomic > ic)
+ return icp->counter.not_atomic;
+ else
+ return ++icp->counter.not_atomic;
+#endif
+}
+
+
#ifdef DEBUG
/*
* Handy functions when using a debugger - don't use in the code!
@@ -3486,7 +3750,7 @@ Process *p;
void ppi(Eterm pid)
{
- pp(erts_pid2proc_unlocked(pid));
+ pp(erts_proc_lookup(pid));
}
void td(Eterm x)
diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c
index 36ed108b76..912f5d3d8b 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -100,7 +100,7 @@
#endif
#include <stdlib.h>
-// Need (NON)BLOCKING macros for sendfile
+/* Need (NON)BLOCKING macros for sendfile */
#ifndef WANT_NONBLOCKING
#define WANT_NONBLOCKING
#endif
@@ -112,6 +112,7 @@
#include "erl_threads.h"
#include "zlib.h"
#include "gzio.h"
+#include "dtrace-wrapper.h"
#include <ctype.h>
#include <sys/types.h>
@@ -119,6 +120,39 @@ void erl_exit(int n, char *fmt, ...);
static ErlDrvSysInfo sys_info;
+/* For explanation of this var, see comment for same var in erl_async.c */
+static unsigned gcc_optimizer_hack = 0;
+
+#ifdef USE_VM_PROBES
+
+#define DTRACE_EFILE_BUFSIZ 128
+
+#define DTRACE_INVOKE_SETUP(op) \
+ do { DTRACE3(efile_drv_int_entry, d->sched_i1, d->sched_i2, op); } while (0)
+#define DTRACE_INVOKE_SETUP_BY_NAME(op) \
+ struct t_data *d = (struct t_data *) data ; \
+ DTRACE_INVOKE_SETUP(op)
+#define DTRACE_INVOKE_RETURN(op) \
+ do { DTRACE3(efile_drv_int_return, d->sched_i1, d->sched_i2, \
+ op); } while (0) ; gcc_optimizer_hack++ ;
+
+/* Assign human-friendlier id numbers to scheduler & I/O worker threads */
+int dt_driver_idnum = 0;
+int dt_driver_io_worker_base = 5000;
+erts_mtx_t dt_driver_mutex;
+pthread_key_t dt_driver_key;
+
+typedef struct {
+ int thread_num;
+ Uint64 tag;
+} dt_private;
+
+dt_private *get_dt_private(int);
+#else /* USE_VM_PROBES */
+#define DTRACE_INVOKE_SETUP(op) do {} while (0)
+#define DTRACE_INVOKE_SETUP_BY_NAME(op) do {} while (0)
+#define DTRACE_INVOKE_RETURN(op) do {} while (0)
+#endif /* USE_VM_PROBES */
/* #define TRACE 1 */
#ifdef TRACE
@@ -156,11 +190,11 @@ static ErlDrvSysInfo sys_info;
* DARWIN. The testcase t_sendfile_crashduring reproduces
* this error when using +A 10.
*/
-#if !defined(DARWIN)
-#define USE_THRDS_FOR_SENDFILE (sys_info.async_threads > 0)
-#else
+#if defined(__APPLE__) && defined(__MACH__)
#define USE_THRDS_FOR_SENDFILE 0
-#endif /* !DARWIN */
+#else
+#define USE_THRDS_FOR_SENDFILE (sys_info.async_threads > 0)
+#endif /* defined(__APPLE__) && defined(__MACH__) */
@@ -172,8 +206,14 @@ static ErlDrvSysInfo sys_info;
# define KEY(desc) (&(desc)->key)
#endif
+#ifndef MAX
+# define MAX(x, y) (((x) > (y)) ? (x) : (y))
+#endif
#ifdef FILENAMES_16BIT
+#ifdef USE_VM_PROBES
+#error 16bit characters in filenames and dtrace in combination is not supported.
+#endif
# define FILENAME_BYTELEN(Str) filename_len_16bit(Str)
# define FILENAME_COPY(To,From) filename_cpy_16bit((To),(From))
# define FILENAME_CHARSIZE 2
@@ -259,6 +299,7 @@ static void file_stop_select(ErlDrvEvent event, void* _);
enum e_timer {timer_idle, timer_again, timer_write};
#ifdef HAVE_SENDFILE
enum e_sendfile {sending, not_sending};
+static void free_sendfile(void *data);
#endif /* HAVE_SENDFILE */
struct t_data;
@@ -288,6 +329,10 @@ typedef struct {
ErlDrvPDL q_mtx; /* Mutex for the driver queue, known by the emulator. Also used for
mutual exclusion when accessing field(s) below. */
size_t write_buffered;
+#ifdef USE_VM_PROBES
+ int idnum; /* Unique ID # for this driver thread/desc */
+ char port_str[DTRACE_TERM_BUF_SIZE];
+#endif
} file_descriptor;
@@ -385,6 +430,11 @@ struct t_data
void (*free)(void *);
int again;
int reply;
+#ifdef USE_VM_PROBES
+ int sched_i1;
+ Uint64 sched_i2;
+ char sched_utag[DTRACE_EFILE_BUFSIZ+1];
+#endif
int result_ok;
Efile_error errInfo;
int flags;
@@ -445,6 +495,8 @@ struct t_data
} fadvise;
#ifdef HAVE_SENDFILE
struct {
+ ErlDrvPort port;
+ ErlDrvPDL q_mtx;
int out_fd;
off_t offset;
Uint64 nbytes;
@@ -455,8 +507,6 @@ struct t_data
char b[1];
};
-
-
#define EF_ALLOC(S) driver_alloc((S))
#define EF_REALLOC(P, S) driver_realloc((P), (S))
#define EF_SAFE_ALLOC(S) ef_safe_alloc((S))
@@ -475,7 +525,7 @@ static void *ef_safe_alloc(Uint s)
static void *ef_safe_realloc(void *op, Uint s)
{
void *p = EF_REALLOC(op, s);
- if (!p) erl_exit(1, "efile drv: Can't reallocate %d bytes of memory\n", s);
+ if (!p) erl_exit(1, "efile drv: Can't reallocate %lu bytes of memory\n", (unsigned long)s);
return p;
}
@@ -485,7 +535,7 @@ static void *ef_safe_realloc(void *op, Uint s)
* ErlIOVec manipulation functions.
*/
-/* char EV_CHAR(ErlIOVec *ev, int p, int q) */
+/* char EV_CHAR_P(ErlIOVec *ev, int p, int q) */
#define EV_CHAR_P(ev, p, q) \
(((char *)(ev)->iov[(q)].iov_base) + (p))
@@ -680,6 +730,11 @@ file_init(void)
: 0);
driver_system_info(&sys_info, sizeof(ErlDrvSysInfo));
+#ifdef USE_VM_PROBES
+ erts_mtx_init(&dt_driver_mutex, "efile_drv dtrace mutex");
+ pthread_key_create(&dt_driver_key, NULL);
+#endif /* USE_VM_PROBES */
+
return 0;
}
@@ -719,6 +774,10 @@ file_start(ErlDrvPort port, char* command)
desc->write_error = 0;
MUTEX_INIT(desc->q_mtx, port); /* Refc is one, referenced by emulator now */
desc->write_buffered = 0;
+#ifdef USE_VM_PROBES
+ dtrace_drvport_str(port, desc->port_str);
+ get_dt_private(0); /* throw away return value */
+#endif /* USE_VM_PROBES */
return (ErlDrvData) desc;
}
@@ -738,8 +797,10 @@ static void do_close(int flags, SWord fd) {
static void invoke_close(void *data)
{
struct t_data *d = (struct t_data *) data;
+ DTRACE_INVOKE_SETUP(FILE_CLOSE);
d->again = 0;
do_close(d->flags, d->fd);
+ DTRACE_INVOKE_RETURN(FILE_CLOSE);
}
/*********************************************************************
@@ -752,15 +813,6 @@ file_stop(ErlDrvData e)
TRACE_C('p');
-#ifdef HAVE_SENDFILE
- if (desc->sendfile_state == sending && !USE_THRDS_FOR_SENDFILE) {
- driver_select(desc->port,(ErlDrvEvent)(long)desc->d->c.sendfile.out_fd,
- ERL_DRV_WRITE|ERL_DRV_USE,0);
- } else if (desc->sendfile_state == sending) {
- SET_NONBLOCKING(desc->d->c.sendfile.out_fd);
- }
-#endif /* HAVE_SENDFILE */
-
if (desc->fd != FILE_FD_INVALID) {
do_close(desc->flags, desc->fd);
desc->fd = FILE_FD_INVALID;
@@ -978,49 +1030,63 @@ static void invoke_name(void *data, int (*f)(Efile_error *, char *))
static void invoke_mkdir(void *data)
{
+ DTRACE_INVOKE_SETUP_BY_NAME(FILE_MKDIR);
invoke_name(data, efile_mkdir);
+ DTRACE_INVOKE_RETURN(FILE_MKDIR);
}
static void invoke_rmdir(void *data)
{
+ DTRACE_INVOKE_SETUP_BY_NAME(FILE_RMDIR);
invoke_name(data, efile_rmdir);
+ DTRACE_INVOKE_RETURN(FILE_RMDIR);
}
static void invoke_delete_file(void *data)
{
+ DTRACE_INVOKE_SETUP_BY_NAME(FILE_DELETE);
invoke_name(data, efile_delete_file);
+ DTRACE_INVOKE_RETURN(FILE_DELETE);
}
static void invoke_chdir(void *data)
{
+ DTRACE_INVOKE_SETUP_BY_NAME(FILE_CHDIR);
invoke_name(data, efile_chdir);
+ DTRACE_INVOKE_RETURN(FILE_CHDIR);
}
static void invoke_fdatasync(void *data)
{
struct t_data *d = (struct t_data *) data;
int fd = (int) d->fd;
+ DTRACE_INVOKE_SETUP(FILE_FDATASYNC);
d->again = 0;
d->result_ok = efile_fdatasync(&d->errInfo, fd);
+ DTRACE_INVOKE_RETURN(FILE_FDATASYNC);
}
static void invoke_fsync(void *data)
{
struct t_data *d = (struct t_data *) data;
int fd = (int) d->fd;
+ DTRACE_INVOKE_SETUP(FILE_FSYNC);
d->again = 0;
d->result_ok = efile_fsync(&d->errInfo, fd);
+ DTRACE_INVOKE_RETURN(FILE_FSYNC);
}
static void invoke_truncate(void *data)
{
struct t_data *d = (struct t_data *) data;
int fd = (int) d->fd;
+ DTRACE_INVOKE_SETUP(FILE_TRUNCATE);
d->again = 0;
d->result_ok = efile_truncate_file(&d->errInfo, &fd, d->flags);
+ DTRACE_INVOKE_RETURN(FILE_TRUNCATE);
}
static void invoke_read(void *data)
@@ -1028,6 +1094,7 @@ static void invoke_read(void *data)
struct t_data *d = (struct t_data *) data;
int status, segment;
size_t size, read_size;
+ DTRACE_INVOKE_SETUP(FILE_READ);
segment = d->again && d->c.read.bin_size >= 2*FILE_SEGMENT_READ;
if (segment) {
@@ -1062,6 +1129,7 @@ static void invoke_read(void *data)
} else {
d->again = 0;
}
+ DTRACE_INVOKE_RETURN(FILE_READ);
}
static void free_read(void *data)
@@ -1078,6 +1146,7 @@ static void invoke_read_line(void *data)
int status;
size_t read_size;
int local_loop = (d->again == 0);
+ DTRACE_INVOKE_SETUP(FILE_READ_LINE);
do {
size_t size = (d->c.read_line.binp)->orig_size -
@@ -1169,6 +1238,7 @@ static void invoke_read_line(void *data)
break;
}
} while (local_loop);
+ DTRACE_INVOKE_RETURN(FILE_READ_LINE);
}
static void free_read_line(void *data)
@@ -1184,6 +1254,7 @@ static void invoke_read_file(void *data)
struct t_data *d = (struct t_data *) data;
size_t read_size;
int chop;
+ DTRACE_INVOKE_SETUP(FILE_READ_FILE);
if (! d->c.read_file.binp) { /* First invocation only */
int fd;
@@ -1220,12 +1291,14 @@ static void invoke_read_file(void *data)
&read_size);
if (d->result_ok) {
d->c.read_file.offset += read_size;
- if (chop) return; /* again */
+ if (chop) goto chop_done; /* again */
}
close:
efile_closefile((int) d->fd);
done:
d->again = 0;
+ chop_done:
+ DTRACE_INVOKE_RETURN(FILE_READ_FILE);
}
static void free_read_file(void *data)
@@ -1245,6 +1318,7 @@ static void invoke_preadv(void *data)
ErlIOVec *ev = &c->eiov;
size_t bytes_read_so_far = 0;
unsigned char *p = (unsigned char *)ev->iov[0].iov_base + 4+4+8*c->cnt;
+ DTRACE_INVOKE_SETUP(FILE_PREADV);
while (c->cnt < c->n) {
size_t read_size = ev->iov[1 + c->cnt].iov_len - c->size;
@@ -1266,7 +1340,7 @@ static void invoke_preadv(void *data)
bytes_read_so_far += bytes_read;
if (chop && bytes_read == read_size) {
c->size += bytes_read;
- return;
+ goto done;
}
ASSERT(bytes_read <= read_size);
ev->iov[1 + c->cnt].iov_len = bytes_read + c->size;
@@ -1277,7 +1351,7 @@ static void invoke_preadv(void *data)
if (d->again
&& bytes_read_so_far >= FILE_SEGMENT_READ
&& c->cnt < c->n) {
- return;
+ goto done;
}
} else {
/* In case of a read error, ev->size will not be correct,
@@ -1288,6 +1362,8 @@ static void invoke_preadv(void *data)
}
}
d->again = 0;
+ done:
+ DTRACE_INVOKE_RETURN(FILE_PREADV);
}
static void free_preadv(void *data) {
@@ -1309,6 +1385,7 @@ static void invoke_ipread(void *data)
size_t bytes_read = 0;
char buf[2*sizeof(Uint32)];
Uint32 offset, size;
+ DTRACE_INVOKE_SETUP(FILE_IPREAD);
/* Read indirection header */
if (! efile_pread(&d->errInfo, (int) d->fd, c->offsets[0],
@@ -1347,14 +1424,17 @@ static void invoke_ipread(void *data)
/* Read data block */
d->invoke = invoke_preadv;
invoke_preadv(data);
+ DTRACE_INVOKE_RETURN(FILE_IPREAD);
return;
error:
d->result_ok = 0;
d->again = 0;
+ DTRACE_INVOKE_RETURN(FILE_IPREAD);
return;
done:
d->result_ok = !0;
d->again = 0;
+ DTRACE_INVOKE_RETURN(FILE_IPREAD);
}
/* invoke_writev and invoke_pwritev are the only thread functions that
@@ -1377,6 +1457,7 @@ static void invoke_writev(void *data) {
size_t size;
size_t p;
int segment;
+ DTRACE_INVOKE_SETUP(FILE_WRITE);
segment = d->again && d->c.writev.size >= 2*FILE_SEGMENT_WRITE;
if (segment) {
@@ -1450,6 +1531,7 @@ static void invoke_writev(void *data) {
TRACE_F(("w%lu", (unsigned long)size));
}
+ DTRACE_INVOKE_RETURN(FILE_WRITE);
}
static void free_writev(void *data) {
@@ -1463,34 +1545,40 @@ static void free_writev(void *data) {
static void invoke_pwd(void *data)
{
struct t_data *d = (struct t_data *) data;
+ DTRACE_INVOKE_SETUP(FILE_PWD);
d->again = 0;
d->result_ok = efile_getdcwd(&d->errInfo,d->drive, d->b+1,
RESBUFSIZE-1);
+ DTRACE_INVOKE_RETURN(FILE_PWD);
}
static void invoke_readlink(void *data)
{
struct t_data *d = (struct t_data *) data;
char resbuf[RESBUFSIZE]; /* Result buffer. */
+ DTRACE_INVOKE_SETUP(FILE_READLINK);
d->again = 0;
d->result_ok = efile_readlink(&d->errInfo, d->b, resbuf+1,
RESBUFSIZE-1);
if (d->result_ok != 0)
FILENAME_COPY((char *) d->b + 1, resbuf+1);
+ DTRACE_INVOKE_RETURN(FILE_READLINK);
}
static void invoke_altname(void *data)
{
struct t_data *d = (struct t_data *) data;
char resbuf[RESBUFSIZE]; /* Result buffer. */
+ DTRACE_INVOKE_SETUP(FILE_ALTNAME);
d->again = 0;
d->result_ok = efile_altname(&d->errInfo, d->b, resbuf+1,
RESBUFSIZE-1);
if (d->result_ok != 0)
FILENAME_COPY((char *) d->b + 1, resbuf+1);
+ DTRACE_INVOKE_RETURN(FILE_ALTNAME);
}
static void invoke_pwritev(void *data) {
@@ -1503,6 +1591,7 @@ static void invoke_pwritev(void *data) {
size_t p;
int segment;
size_t size, write_size;
+ DTRACE_INVOKE_SETUP(FILE_PWRITEV);
segment = d->again && c->size >= 2*FILE_SEGMENT_WRITE;
if (segment) {
@@ -1582,6 +1671,7 @@ static void invoke_pwritev(void *data) {
}
done:
EF_FREE(iov); /* Free our copy of the vector, nothing to restore */
+ DTRACE_INVOKE_RETURN(FILE_PWRITEV);
}
static void free_pwritev(void *data) {
@@ -1597,9 +1687,14 @@ static void invoke_flstat(void *data)
{
struct t_data *d = (struct t_data *) data;
+ DTRACE3(efile_drv_int_entry, d->sched_i1, d->sched_i2,
+ d->command == FILE_LSTAT ? FILE_LSTAT : FILE_FSTAT);
d->again = 0;
d->result_ok = efile_fileinfo(&d->errInfo, &d->info,
d->b, d->command == FILE_LSTAT);
+ DTRACE3(efile_drv_int_entry, d->sched_i1, d->sched_i2,
+ d->command == FILE_LSTAT ? FILE_LSTAT : FILE_FSTAT);
+ gcc_optimizer_hack++;
}
static void invoke_link(void *data)
@@ -1607,10 +1702,12 @@ static void invoke_link(void *data)
struct t_data *d = (struct t_data *) data;
char *name = d->b;
char *new_name;
+ DTRACE_INVOKE_SETUP(FILE_LINK);
d->again = 0;
new_name = name+FILENAME_BYTELEN(name)+FILENAME_CHARSIZE;
d->result_ok = efile_link(&d->errInfo, name, new_name);
+ DTRACE_INVOKE_RETURN(FILE_LINK);
}
static void invoke_symlink(void *data)
@@ -1618,10 +1715,12 @@ static void invoke_symlink(void *data)
struct t_data *d = (struct t_data *) data;
char *name = d->b;
char *new_name;
+ DTRACE_INVOKE_SETUP(FILE_SYMLINK);
d->again = 0;
new_name = name+FILENAME_BYTELEN(name)+FILENAME_CHARSIZE;
d->result_ok = efile_symlink(&d->errInfo, name, new_name);
+ DTRACE_INVOKE_RETURN(FILE_SYMLINK);
}
static void invoke_rename(void *data)
@@ -1629,24 +1728,29 @@ static void invoke_rename(void *data)
struct t_data *d = (struct t_data *) data;
char *name = d->b;
char *new_name;
+ DTRACE_INVOKE_SETUP(FILE_RENAME);
d->again = 0;
new_name = name+FILENAME_BYTELEN(name)+FILENAME_CHARSIZE;
d->result_ok = efile_rename(&d->errInfo, name, new_name);
+ DTRACE_INVOKE_RETURN(FILE_RENAME);
}
static void invoke_write_info(void *data)
{
struct t_data *d = (struct t_data *) data;
+ DTRACE_INVOKE_SETUP(FILE_WRITE_INFO);
d->again = 0;
d->result_ok = efile_write_info(&d->errInfo, &d->info, d->b);
+ DTRACE_INVOKE_RETURN(FILE_WRITE_INFO);
}
static void invoke_lseek(void *data)
{
struct t_data *d = (struct t_data *) data;
int status;
+ DTRACE_INVOKE_SETUP(FILE_LSEEK);
d->again = 0;
if (d->flags & EFILE_COMPRESSED) {
@@ -1671,6 +1775,7 @@ static void invoke_lseek(void *data)
&d->c.lseek.location);
}
d->result_ok = status;
+ DTRACE_INVOKE_RETURN(FILE_LSEEK);
}
static void invoke_readdir(void *data)
@@ -1681,6 +1786,7 @@ static void invoke_readdir(void *data)
size_t n = 0, total = 0;
struct t_readdir_buf *b = NULL;
int res = 0;
+ DTRACE_INVOKE_SETUP(FILE_READDIR);
d->again = 0;
d->errInfo.posix_errno = 0;
@@ -1716,13 +1822,14 @@ static void invoke_readdir(void *data)
} while(res);
d->result_ok = (d->errInfo.posix_errno == 0);
+ DTRACE_INVOKE_RETURN(FILE_READDIR);
}
static void invoke_open(void *data)
{
struct t_data *d = (struct t_data *) data;
-
int status = 1; /* Status of open call. */
+ DTRACE_INVOKE_SETUP(FILE_OPEN);
d->again = 0;
if ((d->flags & EFILE_COMPRESSED) == 0) {
@@ -1755,6 +1862,7 @@ static void invoke_open(void *data)
}
d->result_ok = status;
+ DTRACE_INVOKE_RETURN(FILE_OPEN);
}
static void invoke_fadvise(void *data)
@@ -1764,9 +1872,11 @@ static void invoke_fadvise(void *data)
off_t offset = (off_t) d->c.fadvise.offset;
off_t length = (off_t) d->c.fadvise.length;
int advise = (int) d->c.fadvise.advise;
+ DTRACE_INVOKE_SETUP(FILE_FADVISE);
d->again = 0;
d->result_ok = efile_fadvise(&d->errInfo, fd, offset, length, advise);
+ DTRACE_INVOKE_RETURN(FILE_FADVISE);
}
#ifdef HAVE_SENDFILE
@@ -1783,26 +1893,31 @@ static void invoke_sendfile(void *data)
d->c.sendfile.written += nbytes;
- if (result == 1) {
- if (USE_THRDS_FOR_SENDFILE) {
- d->result_ok = 0;
- } else if (d->c.sendfile.nbytes == 0 && nbytes != 0) {
- d->result_ok = 1;
- } else if ((d->c.sendfile.nbytes - nbytes) != 0) {
- d->result_ok = 1;
- d->c.sendfile.nbytes -= nbytes;
- } else {
- d->result_ok = 0;
- }
+ if (result == 1 || (result == 0 && USE_THRDS_FOR_SENDFILE)) {
+ d->result_ok = 0;
} else if (result == 0 && (d->errInfo.posix_errno == EAGAIN
|| d->errInfo.posix_errno == EINTR)) {
+ if ((d->c.sendfile.nbytes - nbytes) != 0) {
d->result_ok = 1;
+ if (d->c.sendfile.nbytes != 0)
+ d->c.sendfile.nbytes -= nbytes;
+ } else
+ d->result_ok = 0;
} else {
d->result_ok = -1;
}
}
static void free_sendfile(void *data) {
+ struct t_data *d = (struct t_data *)data;
+ if (USE_THRDS_FOR_SENDFILE) {
+ SET_NONBLOCKING(d->c.sendfile.out_fd);
+ } else {
+ MUTEX_LOCK(d->c.sendfile.q_mtx);
+ driver_deq(d->c.sendfile.port,1);
+ MUTEX_UNLOCK(d->c.sendfile.q_mtx);
+ driver_select(d->c.sendfile.port, (ErlDrvEvent)(long)d->c.sendfile.out_fd, ERL_DRV_USE_NO_CALLBACK|ERL_DRV_WRITE, 0);
+ }
EF_FREE(data);
}
@@ -1812,7 +1927,7 @@ static void file_ready_output(ErlDrvData data, ErlDrvEvent event)
switch (fd->d->command) {
case FILE_SENDFILE:
- driver_select(fd->port, event,
+ driver_select(fd->d->c.sendfile.port, event,
(int)ERL_DRV_WRITE,(int) 0);
invoke_sendfile((void *)fd->d);
file_async_ready(data, (ErlDrvThreadData)fd->d);
@@ -1826,6 +1941,15 @@ static void file_stop_select(ErlDrvEvent event, void* _)
{
}
+
+static int flush_sendfile(file_descriptor *desc,void *_) {
+ if (desc->sendfile_state == sending) {
+ desc->d->result_ok = -1;
+ desc->d->errInfo.posix_errno = ECONNABORTED;
+ file_async_ready((ErlDrvData)desc,(ErlDrvThreadData)desc->d);
+ }
+ return 1;
+}
#endif /* HAVE_SENDFILE */
@@ -1833,6 +1957,7 @@ static void free_readdir(void *data)
{
struct t_data *d = (struct t_data *) data;
struct t_readdir_buf *b1 = d->c.read_dir.first_buf;
+
while (b1) {
struct t_readdir_buf *b2 = b1;
b1 = b1->next;
@@ -1901,12 +2026,16 @@ static void cq_execute(file_descriptor *desc) {
DRIVER_ASYNC(d->level, desc, d->invoke, void_ptr=d, d->free);
}
-static int async_write(file_descriptor *desc, int *errp,
- int reply, Uint32 reply_size) {
+static struct t_data *async_write(file_descriptor *desc, int *errp,
+ int reply, Uint32 reply_size
+#ifdef USE_VM_PROBES
+ ,Sint64 *dt_i1, Sint64 *dt_i2, Sint64 *dt_i3
+#endif
+) {
struct t_data *d;
if (! (d = EF_ALLOC(sizeof(struct t_data) - 1))) {
if (errp) *errp = ENOMEM;
- return -1;
+ return NULL;
}
TRACE_F(("w%lu", (unsigned long)desc->write_buffered));
d->command = FILE_WRITE;
@@ -1915,6 +2044,13 @@ static int async_write(file_descriptor *desc, int *errp,
d->c.writev.port = desc->port;
d->c.writev.q_mtx = desc->q_mtx;
d->c.writev.size = desc->write_buffered;
+#ifdef USE_VM_PROBES
+ if (dt_i1 != NULL) {
+ *dt_i1 = d->fd;
+ *dt_i2 = d->flags;
+ *dt_i3 = d->c.writev.size;
+ }
+#endif
d->reply = reply;
d->c.writev.free_size = 0;
d->c.writev.reply_size = reply_size;
@@ -1923,18 +2059,49 @@ static int async_write(file_descriptor *desc, int *errp,
d->level = 1;
cq_enq(desc, d);
desc->write_buffered = 0;
- return 0;
+ return d;
}
-static int flush_write(file_descriptor *desc, int *errp) {
- int result;
+static int flush_write(file_descriptor *desc, int *errp
+#ifdef USE_VM_PROBES
+ , dt_private *dt_priv, char *dt_utag
+#endif
+) {
+ int result = 0;
+#ifdef USE_VM_PROBES
+ Sint64 dt_i1 = 0, dt_i2 = 0, dt_i3 = 0;
+#endif
+ struct t_data *d = NULL;
+
MUTEX_LOCK(desc->q_mtx);
if (desc->write_buffered > 0) {
- result = async_write(desc, errp, 0, 0);
- } else {
- result = 0;
+ if ((d = async_write(desc, errp, 0, 0
+#ifdef USE_VM_PROBES
+ ,&dt_i1, &dt_i2, &dt_i3
+#endif
+ )) == NULL) {
+ result = -1;
+ }
}
MUTEX_UNLOCK(desc->q_mtx);
+#ifdef USE_VM_PROBES
+ if (d != NULL) {
+ d->sched_i1 = dt_priv->thread_num;
+ d->sched_i2 = dt_priv->tag;
+ d->sched_utag[0] = '\0';
+ if (dt_utag != NULL) {
+ if (dt_utag[0] == '\0') {
+ dt_utag = NULL;
+ } else {
+ strncpy(d->sched_utag, dt_utag, sizeof(d->sched_utag) - 1);
+ d->sched_utag[sizeof(d->sched_utag) - 1] = '\0';
+ }
+ }
+ DTRACE11(efile_drv_entry, dt_priv->thread_num, dt_priv->tag++,
+ dt_utag, FILE_WRITE,
+ NULL, NULL, dt_i1, dt_i2, dt_i3, 0, desc->port_str);
+ }
+#endif /* USE_VM_PROBES */
return result;
}
@@ -1947,9 +2114,17 @@ static int check_write_error(file_descriptor *desc, int *errp) {
return 0;
}
-static int flush_write_check_error(file_descriptor *desc, int *errp) {
+static int flush_write_check_error(file_descriptor *desc, int *errp
+#ifdef USE_VM_PROBES
+ , dt_private *dt_priv, char *dt_utag
+#endif
+ ) {
int r;
- if ( (r = flush_write(desc, errp)) != 0) {
+ if ( (r = flush_write(desc, errp
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ )) != 0) {
check_write_error(desc, NULL);
return r;
} else {
@@ -1957,12 +2132,16 @@ static int flush_write_check_error(file_descriptor *desc, int *errp) {
}
}
-static int async_lseek(file_descriptor *desc, int *errp, int reply,
- Sint64 offset, int origin) {
+static struct t_data *async_lseek(file_descriptor *desc, int *errp, int reply,
+ Sint64 offset, int origin
+#ifdef USE_VM_PROBES
+ , Sint64 *dt_i1, Sint64 *dt_i2, Sint64 *dt_i3
+#endif
+ ) {
struct t_data *d;
if (! (d = EF_ALLOC(sizeof(struct t_data)))) {
*errp = ENOMEM;
- return -1;
+ return NULL;
}
d->flags = desc->flags;
d->fd = desc->fd;
@@ -1970,11 +2149,18 @@ static int async_lseek(file_descriptor *desc, int *errp, int reply,
d->reply = reply;
d->c.lseek.offset = offset;
d->c.lseek.origin = origin;
+#ifdef USE_VM_PROBES
+ if (dt_i1 != NULL) {
+ *dt_i1 = d->fd;
+ *dt_i2 = d->c.lseek.offset;
+ *dt_i3 = d->c.lseek.origin;
+ }
+#endif
d->invoke = invoke_lseek;
d->free = free_data;
d->level = 1;
cq_enq(desc, d);
- return 0;
+ return d;
}
static void flush_read(file_descriptor *desc) {
@@ -1986,18 +2172,45 @@ static void flush_read(file_descriptor *desc) {
}
}
-static int lseek_flush_read(file_descriptor *desc, int *errp) {
+static int lseek_flush_read(file_descriptor *desc, int *errp
+#ifdef USE_VM_PROBES
+ ,dt_private *dt_priv, char *dt_utag
+#endif
+ ) {
int r = 0;
size_t read_size = desc->read_size;
+#ifdef USE_VM_PROBES
+ Sint64 dt_i1 = 0, dt_i2 = 0, dt_i3 = 0;
+#endif
+ struct t_data *d;
+
+ flush_read(desc);
if (read_size != 0) {
- flush_read(desc);
- if ((r = async_lseek(desc, errp, 0,
- -((ssize_t)read_size), EFILE_SEEK_CUR))
- < 0) {
- return r;
- }
- } else {
- flush_read(desc);
+ if ((d = async_lseek(desc, errp, 0,
+ -((ssize_t)read_size), EFILE_SEEK_CUR
+#ifdef USE_VM_PROBES
+ , &dt_i1, &dt_i2, &dt_i3
+#endif
+ )) == NULL) {
+ r = -1;
+ } else {
+#ifdef USE_VM_PROBES
+ d->sched_i1 = dt_priv->thread_num;
+ d->sched_i2 = dt_priv->tag;
+ d->sched_utag[0] = '\0';
+ if (dt_utag != NULL) {
+ if (dt_utag[0] == '\0') {
+ dt_utag = NULL;
+ } else {
+ strncpy(d->sched_utag, dt_utag, sizeof(d->sched_utag) - 1);
+ d->sched_utag[sizeof(d->sched_utag) - 1] = '\0';
+ }
+ }
+ DTRACE11(efile_drv_entry, dt_priv->thread_num, dt_priv->tag++,
+ dt_utag, FILE_LSEEK,
+ NULL, NULL, dt_i1, dt_i2, dt_i3, 0, desc->port_str);
+#endif /* USE_VM_PROBES */
+ }
}
return r;
}
@@ -2014,11 +2227,23 @@ file_async_ready(ErlDrvData e, ErlDrvThreadData data)
struct t_data *d = (struct t_data *) data;
char header[5]; /* result code + count */
char resbuf[RESBUFSIZE]; /* Result buffer. */
-
+#ifdef USE_VM_PROBES
+ int sched_i1 = d->sched_i1, sched_i2 = d->sched_i2, command = d->command,
+ result_ok = d->result_ok,
+ posix_errno = d->result_ok ? 0 : d->errInfo.posix_errno;
+ DTRACE_CHARBUF(sched_utag, DTRACE_EFILE_BUFSIZ+1);
+
+ sched_utag[0] = '\0';
+ if (DTRACE_ENABLED(efile_drv_return)) {
+ strncpy(sched_utag, d->sched_utag, DTRACE_EFILE_BUFSIZ);
+ sched_utag[DTRACE_EFILE_BUFSIZ] = '\0';
+ }
+#endif /* USE_VM_PROBES */
TRACE_C('r');
if (try_again(desc, d)) {
+ /* DTRACE TODO: what kind of probe makes sense here? */
return;
}
@@ -2216,6 +2441,9 @@ file_async_ready(ErlDrvData e, ErlDrvThreadData data)
if (d->reply) {
TRACE_C('K');
reply_ok(desc);
+#ifdef USE_VM_PROBES
+ result_ok = 1;
+#endif
}
free_data(data);
break;
@@ -2248,42 +2476,31 @@ file_async_ready(ErlDrvData e, ErlDrvThreadData data)
#ifdef HAVE_SENDFILE
case FILE_SENDFILE:
if (d->result_ok == -1) {
- desc->sendfile_state = not_sending;
if (d->errInfo.posix_errno == ECONNRESET ||
d->errInfo.posix_errno == ENOTCONN ||
d->errInfo.posix_errno == EPIPE)
reply_string_error(desc,"closed");
else
reply_error(desc, &d->errInfo);
- if (USE_THRDS_FOR_SENDFILE) {
- SET_NONBLOCKING(d->c.sendfile.out_fd);
- free_sendfile(data);
- } else {
- driver_select(desc->port, (ErlDrvEvent)(long)d->c.sendfile.out_fd,
- ERL_DRV_USE, 0);
- free_sendfile(data);
- }
- } else if (d->result_ok == 0) {
desc->sendfile_state = not_sending;
+ free_sendfile(data);
+ } else if (d->result_ok == 0) {
reply_Sint64(desc, d->c.sendfile.written);
- if (USE_THRDS_FOR_SENDFILE) {
- SET_NONBLOCKING(d->c.sendfile.out_fd);
- free_sendfile(data);
- } else {
- driver_select(desc->port, (ErlDrvEvent)(long)d->c.sendfile.out_fd, ERL_DRV_USE, 0);
- free_sendfile(data);
- }
+ desc->sendfile_state = not_sending;
+ free_sendfile(data);
} else if (d->result_ok == 1) { // If we are using select to send the rest of the data
desc->sendfile_state = sending;
desc->d = d;
driver_select(desc->port, (ErlDrvEvent)(long)d->c.sendfile.out_fd,
- ERL_DRV_USE|ERL_DRV_WRITE, 1);
+ ERL_DRV_USE_NO_CALLBACK|ERL_DRV_WRITE, 1);
}
break;
#endif
default:
abort();
}
+ DTRACE6(efile_drv_return, sched_i1, sched_i2, sched_utag,
+ command, result_ok, posix_errno);
if (desc->write_buffered != 0 && desc->timer_state == timer_idle) {
desc->timer_state = timer_write;
driver_set_timer(desc->port, desc->write_delay);
@@ -2306,7 +2523,15 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
char* name; /* Points to the filename in buf. */
int command;
struct t_data *d = NULL;
-
+#ifdef USE_VM_PROBES
+ char *dt_utag = NULL;
+ char *dt_s1 = NULL, *dt_s2 = NULL;
+ Sint64 dt_i1 = 0;
+ Sint64 dt_i2 = 0;
+ Sint64 dt_i3 = 0;
+ Sint64 dt_i4 = 0;
+ dt_private *dt_priv = get_dt_private(0);
+#endif /* USE_VM_PROBES */
TRACE_C('o');
@@ -2321,6 +2546,10 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
d = EF_SAFE_ALLOC(sizeof(struct t_data) - 1 + FILENAME_BYTELEN(name) + FILENAME_CHARSIZE);
FILENAME_COPY(d->b, name);
+#ifdef USE_VM_PROBES
+ dt_s1 = d->b;
+ dt_utag = name + FILENAME_BYTELEN(name) + FILENAME_CHARSIZE;
+#endif
d->command = command;
d->invoke = invoke_mkdir;
d->free = free_data;
@@ -2332,6 +2561,10 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
d = EF_SAFE_ALLOC(sizeof(struct t_data) - 1 + FILENAME_BYTELEN(name) + FILENAME_CHARSIZE);
FILENAME_COPY(d->b, name);
+#ifdef USE_VM_PROBES
+ dt_s1 = d->b;
+ dt_utag = name + FILENAME_BYTELEN(name) + FILENAME_CHARSIZE;
+#endif
d->command = command;
d->invoke = invoke_rmdir;
d->free = free_data;
@@ -2343,6 +2576,10 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
d = EF_SAFE_ALLOC(sizeof(struct t_data) - 1 + FILENAME_BYTELEN(name) + FILENAME_CHARSIZE);
FILENAME_COPY(d->b, name);
+#ifdef USE_VM_PROBES
+ dt_s1 = d->b;
+ dt_utag = name + FILENAME_BYTELEN(name) + FILENAME_CHARSIZE;
+#endif
d->command = command;
d->invoke = invoke_delete_file;
d->free = free_data;
@@ -2360,6 +2597,11 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
FILENAME_COPY(d->b, name);
FILENAME_COPY(d->b + namelen, new_name);
+#ifdef USE_VM_PROBES
+ dt_s1 = d->b;
+ dt_s2 = d->b + namelen;
+ dt_utag = buf + namelen + FILENAME_BYTELEN(new_name) + FILENAME_CHARSIZE;
+#endif
d->flags = desc->flags;
d->fd = fd;
d->command = command;
@@ -2373,6 +2615,10 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
d = EF_SAFE_ALLOC(sizeof(struct t_data) - 1 + FILENAME_BYTELEN(name) + FILENAME_CHARSIZE);
FILENAME_COPY(d->b, name);
+#ifdef USE_VM_PROBES
+ dt_s1 = d->b;
+ dt_utag = name + FILENAME_BYTELEN(name) + FILENAME_CHARSIZE;
+#endif
d->command = command;
d->invoke = invoke_chdir;
d->free = free_data;
@@ -2384,6 +2630,9 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
d = EF_SAFE_ALLOC(sizeof(struct t_data) - 1 + RESBUFSIZE + 1);
d->drive = *(uchar*)buf;
+#ifdef USE_VM_PROBES
+ dt_utag = buf + 1;
+#endif
d->command = command;
d->invoke = invoke_pwd;
d->free = free_data;
@@ -2399,6 +2648,10 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
FILENAME_CHARSIZE);
FILENAME_COPY(d->b, name);
+#ifdef USE_VM_PROBES
+ dt_s1 = d->b;
+ dt_utag = name + FILENAME_BYTELEN(name) + FILENAME_CHARSIZE;
+#endif
d->dir_handle = NULL;
d->command = command;
d->invoke = invoke_readdir;
@@ -2423,6 +2676,10 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
dir_handle = NULL;
resbuf[0] = FILE_RESP_LFNAME;
+#ifdef USE_VM_PROBES
+ dt_s1 = name;
+ dt_utag = name + FILENAME_BYTELEN(name) + FILENAME_CHARSIZE;
+#endif
/* Fill the buffer with multiple directory listings before sending it to the
* receiving process. READDIR_CHUNKS is minimum number of files sent to the
* receiver.
@@ -2456,6 +2713,17 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
reply_error(desc, &errInfo);
return;
}
+#ifdef USE_VM_PROBES
+ if (dt_utag != NULL && dt_utag[0] == '\0') {
+ dt_utag = NULL;
+ }
+
+ DTRACE11(efile_drv_entry, dt_priv->thread_num, dt_priv->tag,
+ dt_utag, command, name, dt_s2,
+ dt_i1, dt_i2, dt_i3, dt_i4, desc->port_str);
+ DTRACE6(efile_drv_return, dt_priv->thread_num, dt_priv->tag++,
+ dt_utag, command, 1, 0);
+#endif
TRACE_C('R');
driver_output2(desc->port, resbuf, 1, NULL, 0);
return;
@@ -2468,6 +2736,11 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
d->flags = get_int32((uchar*)buf);
name = buf+4;
FILENAME_COPY(d->b, name);
+#ifdef USE_VM_PROBES
+ dt_i1 = d->flags;
+ dt_s1 = d->b;
+ dt_utag = name + FILENAME_BYTELEN(d->b) + FILENAME_CHARSIZE;
+#endif
d->command = command;
d->invoke = invoke_open;
d->free = free_data;
@@ -2480,6 +2753,10 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
d = EF_SAFE_ALLOC(sizeof(struct t_data));
d->fd = fd;
+#ifdef USE_VM_PROBES
+ dt_utag = name;
+ dt_i1 = fd;
+#endif
d->command = command;
d->invoke = invoke_fdatasync;
d->free = free_data;
@@ -2492,6 +2769,10 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
d = EF_SAFE_ALLOC(sizeof(struct t_data));
d->fd = fd;
+#ifdef USE_VM_PROBES
+ dt_utag = name;
+ dt_i1 = fd;
+#endif
d->command = command;
d->invoke = invoke_fsync;
d->free = free_data;
@@ -2508,6 +2789,14 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
FILENAME_COPY(d->b, name);
d->fd = fd;
+#ifdef USE_VM_PROBES
+ dt_utag = name + FILENAME_BYTELEN(d->b) + FILENAME_CHARSIZE;
+ if (command == FILE_LSTAT) {
+ dt_s1 = d->b;
+ } else {
+ dt_i1 = fd;
+ }
+#endif
d->command = command;
d->invoke = invoke_flstat;
d->free = free_data;
@@ -2521,6 +2810,11 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
d->flags = desc->flags;
d->fd = fd;
+#ifdef USE_VM_PROBES
+ dt_utag = name;
+ dt_i1 = fd;
+ dt_i2 = d->flags;
+#endif
d->command = command;
d->invoke = invoke_truncate;
d->free = free_data;
@@ -2541,6 +2835,13 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
d->info.cTime = (time_t)((Sint64)get_int64(buf + 7 * 4));
FILENAME_COPY(d->b, buf + 9*4);
+#ifdef USE_VM_PROBES
+ dt_i1 = d->info.mode;
+ dt_i2 = d->info.uid;
+ dt_i3 = d->info.gid;
+ dt_s1 = d->b;
+ dt_utag = buf + 9 * 4 + FILENAME_BYTELEN(d->b) + FILENAME_CHARSIZE;
+#endif
d->command = command;
d->invoke = invoke_write_info;
d->free = free_data;
@@ -2550,9 +2851,14 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
case FILE_READLINK:
{
- d = EF_SAFE_ALLOC(sizeof(struct t_data) - 1 + RESBUFSIZE + 1);
-
+ d = EF_SAFE_ALLOC(sizeof(struct t_data) - 1 +
+ MAX(RESBUFSIZE, (FILENAME_BYTELEN(name) +
+ FILENAME_CHARSIZE)) + 1);
FILENAME_COPY(d->b, name);
+#ifdef USE_VM_PROBES
+ dt_s1 = d->b;
+ dt_utag = name + FILENAME_BYTELEN(d->b) + FILENAME_CHARSIZE;
+#endif
d->command = command;
d->invoke = invoke_readlink;
d->free = free_data;
@@ -2562,8 +2868,14 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
case FILE_ALTNAME:
{
- d = EF_SAFE_ALLOC(sizeof(struct t_data) - 1 + RESBUFSIZE + 1);
+ d = EF_SAFE_ALLOC(sizeof(struct t_data) - 1 +
+ MAX(RESBUFSIZE, (FILENAME_BYTELEN(name) +
+ FILENAME_CHARSIZE)) + 1);
FILENAME_COPY(d->b, name);
+#ifdef USE_VM_PROBES
+ dt_s1 = d->b;
+ dt_utag = name + FILENAME_BYTELEN(d->b) + FILENAME_CHARSIZE;
+#endif
d->command = command;
d->invoke = invoke_altname;
d->free = free_data;
@@ -2584,6 +2896,11 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
FILENAME_COPY(d->b, name);
FILENAME_COPY(d->b + namelen, new_name);
+#ifdef USE_VM_PROBES
+ dt_s1 = d->b;
+ dt_s2 = d->b + namelen;
+ dt_utag = buf + namelen + FILENAME_BYTELEN(dt_s2) + FILENAME_CHARSIZE;
+#endif
d->flags = desc->flags;
d->fd = fd;
d->command = command;
@@ -2605,6 +2922,11 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
FILENAME_COPY(d->b, name);
FILENAME_COPY(d->b + namelen, new_name);
+#ifdef USE_VM_PROBES
+ dt_s1 = d->b;
+ dt_s2 = d->b + namelen;
+ dt_utag = buf + namelen + FILENAME_BYTELEN(dt_s2) + FILENAME_CHARSIZE;
+#endif
d->flags = desc->flags;
d->fd = fd;
d->command = command;
@@ -2626,6 +2948,13 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
d->c.fadvise.offset = get_int64((uchar*) buf);
d->c.fadvise.length = get_int64(((uchar*) buf) + sizeof(Sint64));
d->c.fadvise.advise = get_int32(((uchar*) buf) + 2 * sizeof(Sint64));
+#ifdef USE_VM_PROBES
+ dt_i1 = d->fd;
+ dt_i2 = d->c.fadvise.offset;
+ dt_i3 = d->c.fadvise.length;
+ dt_i4 = d->c.fadvise.advise;
+ dt_utag = buf + 3 * sizeof(Sint64);
+#endif
goto done;
}
@@ -2639,6 +2968,22 @@ file_output(ErlDrvData e, char* buf, ErlDrvSizeT count)
done:
if (d) {
+#ifdef USE_VM_PROBES
+ d->sched_i1 = dt_priv->thread_num;
+ d->sched_i2 = dt_priv->tag;
+ d->sched_utag[0] = '\0';
+ if (dt_utag != NULL) {
+ if (dt_utag[0] == '\0') {
+ dt_utag = NULL;
+ } else {
+ strncpy(d->sched_utag, dt_utag, sizeof(d->sched_utag) - 1);
+ d->sched_utag[sizeof(d->sched_utag) - 1] = '\0';
+ }
+ }
+ DTRACE11(efile_drv_entry, dt_priv->thread_num, dt_priv->tag++,
+ dt_utag, command, dt_s1, dt_s2,
+ dt_i1, dt_i2, dt_i3, dt_i4, desc->port_str);
+#endif
cq_enq(desc, d);
}
}
@@ -2652,13 +2997,24 @@ file_flush(ErlDrvData e) {
#ifdef DEBUG
int r;
#endif
+#ifdef USE_VM_PROBES
+ dt_private *dt_priv = get_dt_private(dt_driver_io_worker_base);
+#endif
TRACE_C('f');
+#ifdef HAVE_SENDFILE
+ flush_sendfile(desc, NULL);
+#endif
+
#ifdef DEBUG
r =
#endif
- flush_write(desc, NULL);
+ flush_write(desc, NULL
+#ifdef USE_VM_PROBES
+ , dt_priv, (desc->d == NULL) ? NULL : desc->d->sched_utag
+#endif
+ );
/* Only possible reason for bad return value is ENOMEM, and
* there is nobody to tell...
*/
@@ -2700,6 +3056,9 @@ static void
file_timeout(ErlDrvData e) {
file_descriptor *desc = (file_descriptor *)e;
enum e_timer timer_state = desc->timer_state;
+#ifdef USE_VM_PROBES
+ dt_private *dt_priv = get_dt_private(dt_driver_io_worker_base);
+#endif
TRACE_C('t');
@@ -2717,7 +3076,11 @@ file_timeout(ErlDrvData e) {
#ifdef DEBUG
int r =
#endif
- flush_write(desc, NULL);
+ flush_write(desc, NULL
+#ifdef USE_VM_PROBES
+ , dt_priv, (desc->d == NULL) ? NULL : desc->d->sched_utag
+#endif
+ );
/* Only possible reason for bad return value is ENOMEM, and
* there is nobody to tell...
*/
@@ -2738,6 +3101,14 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
char command;
int p, q;
int err;
+ struct t_data *d = NULL;
+#ifdef USE_VM_PROBES
+ Sint64 dt_i1 = 0, dt_i2 = 0, dt_i3 = 0;
+ Sint64 dt_i4 = 0;
+ char *dt_utag = NULL;
+ char *dt_s1 = NULL;
+ dt_private *dt_priv = get_dt_private(dt_driver_io_worker_base);
+#endif
TRACE_C('v');
@@ -2757,18 +3128,19 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
switch (command) {
case FILE_CLOSE: {
+#ifdef USE_VM_PROBES
+ dt_utag = EV_CHAR_P(ev, p, q);
+#endif
flush_read(desc);
- if (flush_write_check_error(desc, &err) < 0) {
+ if (flush_write_check_error(desc, &err
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ ) < 0) {
reply_posix_error(desc, err);
goto done;
}
- if (ev->size != 1) {
- /* Wrong command length */
- reply_posix_error(desc, EINVAL);
- goto done;
- }
if (desc->fd != FILE_FD_INVALID) {
- struct t_data *d;
if (! (d = EF_ALLOC(sizeof(struct t_data)))) {
reply_posix_error(desc, ENOMEM);
} else {
@@ -2776,6 +3148,10 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
d->reply = !0;
d->fd = desc->fd;
d->flags = desc->flags;
+#ifdef USE_VM_PROBES
+ dt_i1 = d->fd;
+ dt_i2 = d->flags;
+#endif
d->invoke = invoke_close;
d->free = free_data;
d->level = 2;
@@ -2791,8 +3167,21 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
case FILE_READ: {
Uint32 sizeH, sizeL;
size_t size, alloc_size;
- struct t_data *d;
- if (flush_write_check_error(desc, &err) < 0) {
+
+ if (!EV_GET_UINT32(ev, &sizeH, &p, &q)
+ || !EV_GET_UINT32(ev, &sizeL, &p, &q)) {
+ /* Wrong buffer length to contain the read count */
+ reply_posix_error(desc, EINVAL);
+ goto done;
+ }
+#ifdef USE_VM_PROBES
+ dt_utag = EV_CHAR_P(ev, p, q);
+#endif
+ if (flush_write_check_error(desc, &err
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ ) < 0) {
reply_posix_error(desc, err);
goto done;
}
@@ -2800,19 +3189,16 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
if (desc->read_bufsize == 0 && desc->read_binp != NULL && desc->read_size > 0) {
/* We have allocated a buffer for line mode but should not really have a
read-ahead buffer... */
- if (lseek_flush_read(desc, &err) < 0) {
+ if (lseek_flush_read(desc, &err
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ ) < 0) {
reply_posix_error(desc, err);
goto done;
}
}
#endif
- if (ev->size != 1+8
- || !EV_GET_UINT32(ev, &sizeH, &p, &q)
- || !EV_GET_UINT32(ev, &sizeL, &p, &q)) {
- /* Wrong buffer length to contain the read count */
- reply_posix_error(desc, EINVAL);
- goto done;
- }
#if SIZEOF_SIZE_T == 4
if (sizeH != 0) {
reply_posix_error(desc, EINVAL);
@@ -2888,6 +3274,11 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
d->c.read.bin_offset = desc->read_offset + desc->read_size;
d->c.read.bin_size = desc->read_binp->orig_size - d->c.read.bin_offset;
d->c.read.size = size;
+#ifdef USE_VM_PROBES
+ dt_i1 = d->fd;
+ dt_i2 = d->flags;
+ dt_i3 = d->c.read.size;
+#endif
driver_binary_inc_refc(d->c.read.binp);
d->invoke = invoke_read;
d->free = free_read;
@@ -2905,12 +3296,22 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
* allocated binary + dealing with offsets and lengts are done in file_async ready
* for this OP.
*/
- struct t_data *d;
- if (flush_write_check_error(desc, &err) < 0) {
+#ifdef USE_VM_PROBES
+ dt_utag = EV_CHAR_P(ev, p, q);
+#endif
+ if (flush_write_check_error(desc, &err
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ ) < 0) {
reply_posix_error(desc, err);
goto done;
}
- if (ev->size != 1) {
+ if (ev->size != 1
+#ifdef USE_VM_PROBES
+ + FILENAME_BYTELEN(dt_utag) + FILENAME_CHARSIZE
+#endif
+ ) {
/* Wrong command length */
reply_posix_error(desc, EINVAL);
goto done;
@@ -2966,8 +3367,16 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
d->c.read_line.binp = desc->read_binp;
d->c.read_line.read_offset = desc->read_offset;
d->c.read_line.read_size = desc->read_size;
+#ifdef USE_VM_PROBES
+ dt_i1 = d->fd;
+ dt_i2 = d->flags;
+ dt_i3 = d->c.read_line.read_offset;
+#endif
#if !ALWAYS_READ_LINE_AHEAD
d->c.read_line.read_ahead = (desc->read_bufsize > 0);
+#ifdef USE_VM_PROBES
+ dt_i4 = d->c.read_line.read_ahead;
+#endif
#endif
driver_binary_inc_refc(d->c.read.binp);
d->invoke = invoke_read_line;
@@ -2975,10 +3384,22 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
d->level = 1;
cq_enq(desc, d);
} goto done;
- case FILE_WRITE: {
+ case FILE_WRITE: { /* Dtrace: The dtrace user tag is not last in message,
+ but follows the message tag directly.
+ This is handled specially in prim_file.erl */
ErlDrvSizeT skip = 1;
ErlDrvSizeT size = ev->size - skip;
- if (lseek_flush_read(desc, &err) < 0) {
+
+#ifdef USE_VM_PROBES
+ dt_utag = EV_CHAR_P(ev, p, q);
+ skip += FILENAME_BYTELEN(dt_utag) + FILENAME_CHARSIZE;
+ size = ev->size - skip;
+#endif
+ if (lseek_flush_read(desc, &err
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ ) < 0) {
reply_posix_error(desc, err);
goto done;
}
@@ -3005,7 +3426,11 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
driver_set_timer(desc->port, desc->write_delay);
}
} else {
- if (async_write(desc, &err, !0, size) != 0) {
+ if ((d = async_write(desc, &err, !0, size
+#ifdef USE_VM_PROBES
+ , &dt_i1, &dt_i2, &dt_i3
+#endif
+ )) == NULL) {
MUTEX_UNLOCK(desc->q_mtx);
reply_posix_error(desc, err);
goto done;
@@ -3015,24 +3440,49 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
}
} goto done; /* case FILE_WRITE */
- case FILE_PWRITEV: {
+ case FILE_PWRITEV: { /* Dtrace: The dtrace user tag is not last in message,
+ but follows the message tag directly.
+ This is handled specially in prim_file.erl */
Uint32 i, j, n;
size_t total;
- struct t_data *d;
- if (lseek_flush_read(desc, &err) < 0) {
- reply_Uint_posix_error(desc, 0, err);
- goto done;
- }
- if (flush_write_check_error(desc, &err) < 0) {
- reply_Uint_posix_error(desc, 0, err);
- goto done;
+#ifdef USE_VM_PROBES
+ char dt_tmp;
+ int dt_utag_bytes = 1;
+
+ dt_utag = EV_CHAR_P(ev, p, q);
+ /* This will work for UTF-8, but not for UTF-16 - extra reminder here */
+#ifdef FILENAMES_16BIT
+#error 16bit characters in filenames and dtrace in combination is not supported.
+#endif
+ while (EV_GET_CHAR(ev, &dt_tmp, &p, &q) && dt_tmp != '\0') {
+ dt_utag_bytes++;
}
+#endif
if (ev->size < 1+4
+#ifdef USE_VM_PROBES
+ + dt_utag_bytes
+#endif
|| !EV_GET_UINT32(ev, &n, &p, &q)) {
/* Buffer too short to contain even the number of pos/size specs */
reply_Uint_posix_error(desc, 0, EINVAL);
goto done;
}
+ if (lseek_flush_read(desc, &err
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ ) < 0) {
+ reply_Uint_posix_error(desc, 0, err);
+ goto done;
+ }
+ if (flush_write_check_error(desc, &err
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ ) < 0) {
+ reply_Uint_posix_error(desc, 0, err);
+ goto done;
+ }
if (n == 0) {
/* Trivial case - nothing to write */
if (ev->size != 1+4) {
@@ -3042,7 +3492,11 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
}
goto done;
}
- if (ev->size < 1+4+8*(2*n)) {
+ if (ev->size < 1+4+8*(2*n)
+#ifdef USE_VM_PROBES
+ + dt_utag_bytes
+#endif
+ ) {
/* Buffer too short to contain even the pos/size specs */
reply_Uint_posix_error(desc, 0, EINVAL);
goto done;
@@ -3057,6 +3511,10 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
d->reply = !0;
d->fd = desc->fd;
d->flags = desc->flags;
+#ifdef USE_VM_PROBES
+ dt_i1 = d->fd;
+ dt_i2 = d->flags;
+#endif
d->c.pwritev.port = desc->port;
d->c.pwritev.q_mtx = desc->q_mtx;
d->c.pwritev.n = n;
@@ -3094,13 +3552,20 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
}
}
d->c.pwritev.size = total;
+#ifdef USE_VM_PROBES
+ dt_i3 = d->c.pwritev.size;
+#endif
d->c.pwritev.free_size = 0;
if (j == 0) {
/* Trivial case - nothing to write */
EF_FREE(d);
reply_Uint(desc, 0);
} else {
- ErlDrvSizeT skip = 1 + 4 + 8*(2*n);
+ ErlDrvSizeT skip = 1 + 4 + 8 * (2*n)
+#ifdef USE_VM_PROBES
+ + dt_utag_bytes
+#endif
+ ;
if (skip + total != ev->size) {
/* Actual amount of data does not match
* total of all pos/size specs
@@ -3121,27 +3586,55 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
}
} goto done; /* case FILE_PWRITEV: */
- case FILE_PREADV: {
+ case FILE_PREADV: { /* Dtrace: The dtrace user tag is not last in message,
+ but follows the message tag directly.
+ This is handled specially in prim_file.erl */
register void * void_ptr;
Uint32 i, n;
- struct t_data *d;
ErlIOVec *res_ev;
- if (lseek_flush_read(desc, &err) < 0) {
+#ifdef USE_VM_PROBES
+ char dt_tmp;
+ int dt_utag_bytes = 1;
+ /* This will work for UTF-8, but not for UTF-16 - extra reminder here */
+#ifdef FILENAMES_16BIT
+#error 16bit characters in filenames and dtrace in combination is not supported.
+#endif
+ dt_utag = EV_CHAR_P(ev, p, q);
+ while (EV_GET_CHAR(ev, &dt_tmp, &p, &q) && dt_tmp != '\0') {
+ dt_utag_bytes++;
+ }
+#endif
+ if (lseek_flush_read(desc, &err
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ ) < 0) {
reply_posix_error(desc, err);
goto done;
}
- if (flush_write_check_error(desc, &err) < 0) {
+ if (flush_write_check_error(desc, &err
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ ) < 0) {
reply_posix_error(desc, err);
goto done;
}
if (ev->size < 1+8
+#ifdef USE_VM_PROBES
+ + dt_utag_bytes
+#endif
|| !EV_GET_UINT32(ev, &n, &p, &q)
|| !EV_GET_UINT32(ev, &n, &p, &q)) {
/* Buffer too short to contain even the number of pos/size specs */
reply_posix_error(desc, EINVAL);
goto done;
}
- if (ev->size != 1+8+8*(2*n)) {
+ if (ev->size < 1+8+8*(2*n)
+#ifdef USE_VM_PROBES
+ + dt_utag_bytes
+#endif
+ ) {
/* Buffer wrong length to contain the pos/size specs */
reply_posix_error(desc, EINVAL);
goto done;
@@ -3161,6 +3654,10 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
d->reply = !0;
d->fd = desc->fd;
d->flags = desc->flags;
+#ifdef USE_VM_PROBES
+ dt_i1 = d->fd;
+ dt_i2 = d->flags;
+#endif
d->c.preadv.n = n;
d->c.preadv.cnt = 0;
d->c.preadv.size = 0;
@@ -3188,6 +3685,9 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
#else
size = ((size_t)sizeH<<32) | sizeL;
#endif
+#ifdef USE_VM_PROBES
+ dt_i3 += size;
+#endif
if (! (res_ev->binv[i] = driver_alloc_binary(size))) {
reply_posix_error(desc, ENOMEM);
break;
@@ -3234,42 +3734,68 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
} goto done; /* case FILE_PREADV: */
case FILE_LSEEK: {
- Sint64 offset; /* Offset for seek */
+ Sint64 offset; /* Offset for seek */
Uint32 origin; /* Origin of seek. */
- if (lseek_flush_read(desc, &err) < 0) {
- reply_posix_error(desc, err);
+
+ if (ev->size < 1+8+4
+ || !EV_GET_UINT64(ev, &offset, &p, &q)
+ || !EV_GET_UINT32(ev, &origin, &p, &q)) {
+ /* Wrong length of buffer to contain offset and origin */
+ reply_posix_error(desc, EINVAL);
goto done;
}
- if (flush_write_check_error(desc, &err) < 0) {
+#ifdef USE_VM_PROBES
+ dt_utag = EV_CHAR_P(ev, p, q);
+#endif
+ if (lseek_flush_read(desc, &err
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ ) < 0) {
reply_posix_error(desc, err);
goto done;
}
- if (ev->size != 1+8+4
- || !EV_GET_UINT64(ev, &offset, &p, &q)
- || !EV_GET_UINT32(ev, &origin, &p, &q)) {
- /* Wrong length of buffer to contain offset and origin */
- reply_posix_error(desc, EINVAL);
+ if (flush_write_check_error(desc, &err
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ ) < 0) {
+ reply_posix_error(desc, err);
goto done;
}
- if (async_lseek(desc, &err, !0, offset, origin) < 0) {
+ if ((d = async_lseek(desc, &err, !0, offset, origin
+#ifdef USE_VM_PROBES
+ , &dt_i1, &dt_i2, &dt_i3
+#endif
+ )) == NULL) {
reply_posix_error(desc, err);
goto done;
}
} goto done;
case FILE_READ_FILE: {
- struct t_data *d;
char *filename;
if (ev->size < 1+1) {
/* Buffer contains empty name */
reply_posix_error(desc, ENOENT);
goto done;
}
+#ifndef USE_VM_PROBES
+ /* In the dtrace case, the iov has an extra element, the dtrace utag - we will need
+ another test to see that
+ the filename is in a single buffer: */
if (ev->size-1 != ev->iov[q].iov_len-p) {
/* Name not in one single buffer */
reply_posix_error(desc, EINVAL);
goto done;
}
+#else
+ if (((byte *)ev->iov[q].iov_base)[ev->iov[q].iov_len-1] != '\0') {
+ /* Name not in one single buffer */
+ reply_posix_error(desc, EINVAL);
+ goto done;
+ }
+#endif
filename = EV_CHAR_P(ev, p, q);
d = EF_ALLOC(sizeof(struct t_data) -1 + FILENAME_BYTELEN(filename) + FILENAME_CHARSIZE);
if (! d) {
@@ -3280,6 +3806,20 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
d->reply = !0;
/* Copy name */
FILENAME_COPY(d->b, filename);
+#ifdef USE_VM_PROBES
+ {
+ char dt_tmp;
+
+ /* This will work for UTF-8, but not for UTF-16 - extra reminder here */
+#ifdef FILENAMES_16BIT
+#error 16bit characters in filenames and dtrace in combination is not supported.
+#endif
+ while (EV_GET_CHAR(ev, &dt_tmp, &p, &q) && dt_tmp != '\0')
+ ;
+ dt_s1 = d->b;
+ dt_utag = EV_CHAR_P(ev, p, q);
+ }
+#endif
d->c.read_file.binp = NULL;
d->invoke = invoke_read_file;
d->free = free_read_file;
@@ -3299,7 +3839,6 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
char mode;
Sint64 hdr_offset;
Uint32 max_size;
- struct t_data *d;
ErlIOVec *res_ev;
int vsize;
if (! EV_GET_CHAR(ev, &mode, &p, &q)) {
@@ -3311,14 +3850,6 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
reply_posix_error(desc, EINVAL);
goto done;
}
- if (lseek_flush_read(desc, &err) < 0) {
- reply_posix_error(desc, err);
- goto done;
- }
- if (flush_write_check_error(desc, &err) < 0) {
- reply_posix_error(desc, err);
- goto done;
- }
if (ev->size < 1+1+8+4
|| !EV_GET_UINT64(ev, &hdr_offset, &p, &q)
|| !EV_GET_UINT32(ev, &max_size, &p, &q)) {
@@ -3327,6 +3858,25 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
reply_posix_error(desc, EINVAL);
goto done;
}
+#ifdef USE_VM_PROBES
+ dt_utag = EV_CHAR_P(ev, p, q);
+#endif
+ if (lseek_flush_read(desc, &err
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ ) < 0) {
+ reply_posix_error(desc, err);
+ goto done;
+ }
+ if (flush_write_check_error(desc, &err
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ ) < 0) {
+ reply_posix_error(desc, err);
+ goto done;
+ }
/* Create the thread data structure with the contained ErlIOVec
* and corresponding binaries for the response
*/
@@ -3343,6 +3893,12 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
d->flags = desc->flags;
d->c.preadv.offsets[0] = hdr_offset;
d->c.preadv.size = max_size;
+#ifdef USE_VM_PROBES
+ dt_i1 = d->fd;
+ dt_i2 = d->flags;
+ dt_i3 = d->c.preadv.offsets[0];
+ dt_i4 = d->c.preadv.size;
+#endif
res_ev = &d->c.preadv.eiov;
/* XXX possible alignment problems here for weird machines */
res_ev->iov = void_ptr = d + 1;
@@ -3357,16 +3913,24 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
case FILE_SETOPT: {
char opt;
+
if (ev->size < 1+1
|| !EV_GET_CHAR(ev, &opt, &p, &q)) {
/* Buffer too short to contain even the option type */
reply_posix_error(desc, EINVAL);
goto done;
}
+#ifdef USE_VM_PROBES
+ dt_i1 = opt;
+ dt_utag = EV_CHAR_P(ev, p, q);
+#endif
switch (opt) {
case FILE_OPT_DELAYED_WRITE: {
Uint32 sizeH, sizeL, delayH, delayL;
if (ev->size != 1+1+4*sizeof(Uint32)
+#ifdef USE_VM_PROBES
+ + FILENAME_BYTELEN(dt_utag) + FILENAME_CHARSIZE
+#endif
|| !EV_GET_UINT32(ev, &sizeH, &p, &q)
|| !EV_GET_UINT32(ev, &sizeL, &p, &q)
|| !EV_GET_UINT32(ev, &delayH, &p, &q)
@@ -3393,12 +3957,18 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
#else
desc->write_delay = ((unsigned long)delayH << 32) | delayL;
#endif
+#ifdef USE_VM_PROBES
+ dt_i2 = desc->write_delay;
+#endif
TRACE_C('K');
reply_ok(desc);
} goto done;
case FILE_OPT_READ_AHEAD: {
Uint32 sizeH, sizeL;
if (ev->size != 1+1+2*sizeof(Uint32)
+#ifdef USE_VM_PROBES
+ + FILENAME_BYTELEN(dt_utag)+FILENAME_CHARSIZE
+#endif
|| !EV_GET_UINT32(ev, &sizeH, &p, &q)
|| !EV_GET_UINT32(ev, &sizeL, &p, &q)) {
/* Buffer has wrong length to contain the option values */
@@ -3414,6 +3984,9 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
#else
desc->read_bufsize = ((size_t)sizeH << 32) | sizeL;
#endif
+#ifdef USE_VM_PROBES
+ dt_i2 = desc->read_bufsize;
+#endif
TRACE_C('K');
reply_ok(desc);
} goto done;
@@ -3454,11 +4027,13 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
d->fd = desc->fd;
d->command = command;
d->invoke = invoke_sendfile;
- d->free = NULL;
+ d->free = free_sendfile;
d->level = 2;
d->c.sendfile.out_fd = (int) out_fd;
d->c.sendfile.written = 0;
+ d->c.sendfile.port = desc->port;
+ d->c.sendfile.q_mtx = desc->q_mtx;
#if SIZEOF_OFF_T == 4
if (offsetH != 0) {
@@ -3474,6 +4049,19 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
if (USE_THRDS_FOR_SENDFILE) {
SET_BLOCKING(d->c.sendfile.out_fd);
+ } else {
+ /**
+ * Write a place holder to queue in order to force file_flush
+ * to be called before the driver is closed.
+ */
+ char tmp[1] = "";
+ MUTEX_LOCK(d->c.sendfile.q_mtx);
+ if (driver_enq(d->c.sendfile.port, tmp, 1)) {
+ MUTEX_UNLOCK(d->c.sendfile.q_mtx);
+ reply_posix_error(desc, ENOMEM);
+ goto done;
+ }
+ MUTEX_UNLOCK(d->c.sendfile.q_mtx);
}
cq_enq(desc, d);
@@ -3485,11 +4073,19 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
} /* switch(command) */
- if (lseek_flush_read(desc, &err) < 0) {
+ if (lseek_flush_read(desc, &err
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ ) < 0) {
reply_posix_error(desc, err);
goto done;
}
- if (flush_write_check_error(desc, &err) < 0) {
+ if (flush_write_check_error(desc, &err
+#ifdef USE_VM_PROBES
+ , dt_priv, dt_utag
+#endif
+ ) < 0) {
reply_posix_error(desc, err);
goto done;
} else {
@@ -3507,5 +4103,50 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) {
}
done:
+ if (d != NULL) {
+#ifdef USE_VM_PROBES
+ /*
+ * If d == NULL, then either:
+ * 1). There was an error of some sort, or
+ * 2). The command given to us is actually implemented
+ * by file_output() instead.
+ *
+ * Case #1 is probably a TODO item, perhaps?
+ * Case #2 we definitely don't want to activate a probe.
+ */
+ d->sched_i1 = dt_priv->thread_num;
+ d->sched_i2 = dt_priv->tag;
+ d->sched_utag[0] = '\0';
+ if (dt_utag != NULL) {
+ if (dt_utag[0] == '\0') {
+ dt_utag = NULL;
+ } else {
+ strncpy(d->sched_utag, dt_utag, sizeof(d->sched_utag) - 1);
+ d->sched_utag[sizeof(d->sched_utag) - 1] = '\0';
+ }
+ }
+ DTRACE11(efile_drv_entry, dt_priv->thread_num, dt_priv->tag++,
+ dt_utag, command, dt_s1, NULL, dt_i1, dt_i2, dt_i3, dt_i4,
+ desc->port_str);
+#endif
+ }
cq_execute(desc);
}
+
+#ifdef USE_VM_PROBES
+dt_private *
+get_dt_private(int base)
+{
+ dt_private *dt_priv = (dt_private *) pthread_getspecific(dt_driver_key);
+
+ if (dt_priv == NULL) {
+ dt_priv = EF_SAFE_ALLOC(sizeof(dt_private));
+ erts_mtx_lock(&dt_driver_mutex);
+ dt_priv->thread_num = (base + dt_driver_idnum++);
+ erts_mtx_unlock(&dt_driver_mutex);
+ dt_priv->tag = 0;
+ pthread_setspecific(dt_driver_key, dt_priv);
+ }
+ return dt_priv;
+}
+#endif /* USE_VM_PROBES */
diff --git a/erts/emulator/drivers/common/gzio.c b/erts/emulator/drivers/common/gzio.c
index a9303d55bc..ca6d25adb4 100644
--- a/erts/emulator/drivers/common/gzio.c
+++ b/erts/emulator/drivers/common/gzio.c
@@ -21,11 +21,6 @@
#include "erl_driver.h"
#include "sys.h"
-#ifdef VXWORKS
-/* pull in FOPEN from zutil.h instead */
-#undef F_OPEN
-#endif
-
#ifdef __WIN32__
#ifndef HAVE_CONFLICTING_FREAD_DECLARATION
#define HAVE_CONFLICTING_FREAD_DECLARATION
diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c
index 47a99fdbe6..dea910e89f 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2012. 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
@@ -284,27 +284,15 @@ static unsigned long one_value = 1;
#else
-#ifdef VXWORKS
-#include <sockLib.h>
-#include <sys/times.h>
-#include <iosLib.h>
-#include <taskLib.h>
-#include <selectLib.h>
-#include <ioLib.h>
-#else
#include <sys/time.h>
#ifdef NETDB_H_NEEDS_IN_H
#include <netinet/in.h>
#endif
#include <netdb.h>
-#endif
#include <sys/socket.h>
#include <netinet/in.h>
-#ifdef VXWORKS
-#include <rpc/rpctypes.h>
-#endif
#ifdef DEF_INADDR_LOOPBACK_IN_RPC_TYPES_H
#include <rpc/types.h>
#endif
@@ -312,12 +300,10 @@ static unsigned long one_value = 1;
#include <netinet/tcp.h>
#include <arpa/inet.h>
-#if (!defined(VXWORKS))
#include <sys/param.h>
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
-#endif
#ifdef HAVE_SYS_SOCKIO_H
#include <sys/sockio.h>
@@ -331,7 +317,7 @@ static unsigned long one_value = 1;
/* SCTP support -- currently for UNIX platforms only: */
#undef HAVE_SCTP
-#if (!defined(VXWORKS) && !defined(__WIN32__) && defined(HAVE_SCTP_H))
+#if (!defined(__WIN32__) && defined(HAVE_SCTP_H))
#include <netinet/sctp.h>
@@ -478,15 +464,8 @@ static int my_strncasecmp(const char *s1, const char *s2, size_t n)
#define sock_connect(s, addr, len) connect((s), (addr), (len))
#define sock_listen(s, b) listen((s), (b))
#define sock_bind(s, addr, len) bind((s), (addr), (len))
-#ifdef VXWORKS
-#define sock_getopt(s,t,n,v,l) wrap_sockopt(&getsockopt,\
- s,t,n,v,(unsigned int)(l))
-#define sock_setopt(s,t,n,v,l) wrap_sockopt(&setsockopt,\
- s,t,n,v,(unsigned int)(l))
-#else
#define sock_getopt(s,t,n,v,l) getsockopt((s),(t),(n),(v),(l))
#define sock_setopt(s,t,n,v,l) setsockopt((s),(t),(n),(v),(l))
-#endif
#define sock_name(s, addr, len) getsockname((s), (addr), (len))
#define sock_peer(s, addr, len) getpeername((s), (addr), (len))
#define sock_ntohs(x) ntohs((x))
@@ -535,6 +514,12 @@ static int my_strncasecmp(const char *s1, const char *s2, size_t n)
#endif /* __WIN32__ */
+#ifdef HAVE_SOCKLEN_T
+# define SOCKLEN_T socklen_t
+#else
+# define SOCKLEN_T int
+#endif
+
#include "packet_parser.h"
#define get_int24(s) ((((unsigned char*) (s))[0] << 16) | \
@@ -553,6 +538,12 @@ static int my_strncasecmp(const char *s1, const char *s2, size_t n)
# define VALGRIND_MAKE_MEM_DEFINED(ptr,size)
#endif
+/*
+ Magic errno value used locally for return of {error, system_limit}
+ - the emulator definition of SYSTEM_LIMIT is not available here.
+*/
+#define INET_ERRNO_SYSTEM_LIMIT (15 << 8)
+
/*----------------------------------------------------------------------------
** Interface constants.
**
@@ -679,7 +670,7 @@ static int my_strncasecmp(const char *s1, const char *s2, size_t n)
#define INET_LOPT_EXITONCLOSE 26 /* exit port on active close or not ! */
#define INET_LOPT_TCP_HIWTRMRK 27 /* set local high watermark */
#define INET_LOPT_TCP_LOWTRMRK 28 /* set local low watermark */
-#define INET_LOPT_BIT8 29 /* set 8 bit detection */
+ /* 29 unused */
#define INET_LOPT_TCP_SEND_TIMEOUT 30 /* set send timeout */
#define INET_LOPT_TCP_DELAY_SEND 31 /* Delay sends until next poll */
#define INET_LOPT_PACKET_SIZE 32 /* Max packet size */
@@ -714,12 +705,6 @@ static int my_strncasecmp(const char *s1, const char *s2, size_t n)
#define INET_IFOPT_FLAGS 6
#define INET_IFOPT_HWADDR 7
-/* INET_LOPT_BIT8 options */
-#define INET_BIT8_CLEAR 0
-#define INET_BIT8_SET 1
-#define INET_BIT8_ON 2
-#define INET_BIT8_OFF 3
-
/* INET_REQ_GETSTAT enumeration */
#define INET_STAT_RECV_CNT 1
#define INET_STAT_RECV_MAX 2
@@ -915,7 +900,6 @@ typedef struct {
int mode; /* BINARY | LIST
(affect how to interpret hsz) */
int exitf; /* exit port on close or not */
- int bit8f; /* check if data has bit number 7 set */
int deliver; /* Delivery mode, TERM or PORT */
ErlDrvTermData caller; /* recipient of sync reply */
@@ -934,8 +918,6 @@ typedef struct {
int sfamily; /* address family */
enum PacketParseType htype; /* header type (TCP only?) */
unsigned int psize; /* max packet size (TCP only?) */
- int bit8; /* set if bit8f==true and data some data
- seen had the 7th bit set */
inet_address remote; /* remote address for connected sockets */
inet_address peer_addr; /* fake peer address */
inet_address name_addr; /* fake local address */
@@ -1222,6 +1204,27 @@ struct erl_drv_entry inet_driver_entry =
NULL,
};
+#if HAVE_IN6
+# if ! defined(HAVE_IN6ADDR_ANY) || ! HAVE_IN6ADDR_ANY
+# if HAVE_DECL_IN6ADDR_ANY_INIT
+static const struct in6_addr in6addr_any = { { IN6ADDR_ANY_INIT } };
+# else
+static const struct in6_addr in6addr_any =
+ { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
+# endif /* HAVE_IN6ADDR_ANY_INIT */
+# endif /* ! HAVE_DECL_IN6ADDR_ANY */
+
+# if ! defined(HAVE_IN6ADDR_LOOPBACK) || ! HAVE_IN6ADDR_LOOPBACK
+# if HAVE_DECL_IN6ADDR_LOOPBACK_INIT
+static const struct in6_addr in6addr_loopback =
+ { { IN6ADDR_LOOPBACK_INIT } };
+# else
+static const struct in6_addr in6addr_loopback =
+ { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } };
+# endif /* HAVE_IN6ADDR_LOOPBACk_INIT */
+# endif /* ! HAVE_DECL_IN6ADDR_LOOPBACK */
+#endif /* HAVE_IN6 */
+
/* XXX: is this a driver interface function ??? */
void erl_exit(int n, char*, ...);
@@ -1645,6 +1648,17 @@ static struct erl_drv_entry dummy_sctp_driver_entry =
#endif
+/* return lowercase string form of errno value */
+static char *errno_str(int err)
+{
+ switch (err) {
+ case INET_ERRNO_SYSTEM_LIMIT:
+ return "system_limit";
+ default:
+ return erl_errno_id(err);
+ }
+}
+
/* general control reply function */
static ErlDrvSSizeT ctl_reply(int rep, char* buf, ErlDrvSizeT len,
char** rbuf, ErlDrvSizeT rsize)
@@ -1665,13 +1679,9 @@ static ErlDrvSSizeT ctl_reply(int rep, char* buf, ErlDrvSizeT len,
/* general control error reply function */
static ErlDrvSSizeT ctl_error(int err, char** rbuf, ErlDrvSizeT rsize)
{
- char response[256]; /* Response buffer. */
- char* s;
- char* t;
+ char* s = errno_str(err);
- for (s = erl_errno_id(err), t = response; *s; s++, t++)
- *t = tolower(*s);
- return ctl_reply(INET_REP_ERROR, response, t-response, rbuf, rsize);
+ return ctl_reply(INET_REP_ERROR, s, strlen(s), rbuf, rsize);
}
static ErlDrvSSizeT ctl_xerror(char* xerr, char** rbuf, ErlDrvSizeT rsize)
@@ -1683,14 +1693,7 @@ static ErlDrvSSizeT ctl_xerror(char* xerr, char** rbuf, ErlDrvSizeT rsize)
static ErlDrvTermData error_atom(int err)
{
- char errstr[256];
- char* s;
- char* t;
-
- for (s = erl_errno_id(err), t = errstr; *s; s++, t++)
- *t = tolower(*s);
- *t = '\0';
- return driver_mk_atom(errstr);
+ return driver_mk_atom(errno_str(err));
}
@@ -3118,6 +3121,7 @@ static int tcp_message(inet_descriptor* desc, const char* buf, int len)
int i = 0;
DEBUGF(("tcp_message(%ld): len = %d\r\n", (long)desc->port, len));
+ /* XXX fprintf(stderr,"tcp_message send.\r\n"); */
i = LOAD_ATOM(spec, i, am_tcp);
i = LOAD_PORT(spec, i, desc->dport);
@@ -3335,17 +3339,6 @@ static int packet_error_message(udp_descriptor* udesc, int err)
}
-/* scan buffer for bit 7 */
-static void scanbit8(inet_descriptor* desc, const char* buf, int len)
-{
- int c;
-
- if (!desc->bit8f || desc->bit8) return;
- c = 0;
- while(len--) c |= *buf++;
- desc->bit8 = ((c & 0x80) != 0);
-}
-
/*
** active=TRUE:
** (NOTE! distribution MUST use active=TRUE, deliver=PORT)
@@ -3363,8 +3356,6 @@ static int tcp_reply_data(tcp_descriptor* desc, char* buf, int len)
packet_get_body(desc->inet.htype, &body, &bodylen);
- scanbit8(INETP(desc), body, bodylen);
-
if (desc->inet.deliver == INET_DELIVER_PORT) {
code = inet_port_data(INETP(desc), body, bodylen);
}
@@ -3396,8 +3387,6 @@ tcp_reply_binary_data(tcp_descriptor* desc, ErlDrvBinary* bin, int offs, int len
packet_get_body(desc->inet.htype, &body, &bodylen);
offs = body - bin->orig_bytes; /* body offset now */
- scanbit8(INETP(desc), body, bodylen);
-
if (desc->inet.deliver == INET_DELIVER_PORT)
code = inet_port_binary_data(INETP(desc), bin, offs, bodylen);
else if ((code=packet_parse(desc->inet.htype, buf, len, &desc->http_state,
@@ -3423,8 +3412,6 @@ packet_reply_binary_data(inet_descriptor* desc, unsigned int hsz,
{
int code;
- scanbit8(desc, bin->orig_bytes+offs, len);
-
if (desc->active == INET_PASSIVE)
/* "inet" is actually for both UDP and SCTP, as well as TCP! */
return inet_async_binary_data(desc, hsz, bin, offs, len, extra);
@@ -3699,6 +3686,9 @@ static char* inet_set_address(int family, inet_address* dst,
if ((family == AF_INET) && (*len >= 2+4)) {
sys_memzero((char*)dst, sizeof(struct sockaddr_in));
port = get_int16(src);
+#ifndef NO_SA_LEN
+ dst->sai.sin_len = sizeof(struct sockaddr_in);
+#endif
dst->sai.sin_family = family;
dst->sai.sin_port = sock_htons(port);
sys_memcpy(&dst->sai.sin_addr, src+2, 4);
@@ -3709,6 +3699,9 @@ static char* inet_set_address(int family, inet_address* dst,
else if ((family == AF_INET6) && (*len >= 2+16)) {
sys_memzero((char*)dst, sizeof(struct sockaddr_in6));
port = get_int16(src);
+#ifndef NO_SA_LEN
+ dst->sai6.sin6_len = sizeof(struct sockaddr_in6);
+#endif
dst->sai6.sin6_family = family;
dst->sai6.sin6_port = sock_htons(port);
dst->sai6.sin6_flowinfo = 0; /* XXX this may be set as well ?? */
@@ -3719,7 +3712,7 @@ static char* inet_set_address(int family, inet_address* dst,
#endif
return NULL;
}
-#ifdef HAVE_SCTP
+
/*
** Set an inaddr structure, address family comes from source data,
** or from argument if source data specifies constant address.
@@ -3763,6 +3756,9 @@ static char *inet_set_faddress(int family, inet_address* dst,
return NULL;
}
sys_memzero((char*)dst, sizeof(struct sockaddr_in));
+#ifndef NO_SA_LEN
+ dst->sai.sin_len = sizeof(struct sockaddr_in6);
+#endif
dst->sai.sin_family = family;
dst->sai.sin_port = sock_htons(port);
dst->sai.sin_addr.s_addr = addr.s_addr;
@@ -3782,6 +3778,9 @@ static char *inet_set_faddress(int family, inet_address* dst,
return NULL;
}
sys_memzero((char*)dst, sizeof(struct sockaddr_in6));
+#ifndef NO_SA_LEN
+ dst->sai6.sin6_len = sizeof(struct sockaddr_in6);
+#endif
dst->sai6.sin6_family = family;
dst->sai6.sin6_port = sock_htons(port);
dst->sai6.sin6_flowinfo = 0; /* XXX this may be set as well ?? */
@@ -3799,7 +3798,7 @@ static char *inet_set_faddress(int family, inet_address* dst,
}
return inet_set_address(family, dst, src, len);
}
-#endif /* HAVE_SCTP */
+
/* Get a inaddr structure
** src = inaddr structure
@@ -4089,6 +4088,7 @@ static char* buf_to_sockaddr(char* ptr, char* end, struct sockaddr* addr)
addr->sa_family = AF_INET;
return ptr + sizeof(struct in_addr);
}
+#if defined(HAVE_IN6) && defined(AF_INET6)
case INET_AF_INET6: {
struct in6_addr *p = &((struct sockaddr_in6*)addr)->sin6_addr;
buf_check(ptr,end,sizeof(struct in6_addr));
@@ -4096,6 +4096,7 @@ static char* buf_to_sockaddr(char* ptr, char* end, struct sockaddr* addr)
addr->sa_family = AF_INET6;
return ptr + sizeof(struct in6_addr);
}
+#endif
}
error:
return NULL;
@@ -5271,50 +5272,6 @@ static ErlDrvSSizeT inet_ctl_getifaddrs(inet_descriptor* desc_p,
#endif
-
-
-#ifdef VXWORKS
-/*
-** THIS is a terrible creature, a bug in the TCP part
-** of the old VxWorks stack (non SENS) created a race.
-** If (and only if?) a socket got closed from the other
-** end and we tried a set/getsockopt on the TCP level,
-** the task would generate a bus error...
-*/
-static STATUS wrap_sockopt(STATUS (*function)() /* Yep, no parameter
- check */,
- int s, int level, int optname,
- char *optval, unsigned int optlen
- /* optlen is a pointer if function
- is getsockopt... */)
-{
- fd_set rs;
- struct timeval timeout;
- int to_read;
- int ret;
-
- FD_ZERO(&rs);
- FD_SET(s,&rs);
- memset(&timeout,0,sizeof(timeout));
- if (level == IPPROTO_TCP) {
- taskLock();
- if (select(s+1,&rs,NULL,NULL,&timeout)) {
- if (ioctl(s,FIONREAD,(int)&to_read) == ERROR ||
- to_read == 0) { /* End of file, other end closed? */
- sock_errno() = EBADF;
- taskUnlock();
- return ERROR;
- }
- }
- ret = (*function)(s,level,optname,optval,optlen);
- taskUnlock();
- } else {
- ret = (*function)(s,level,optname,optval,optlen);
- }
- return ret;
-}
-#endif
-
/* Per H @ Tail-f: The original code here had problems that possibly
only occur if you abuse it for non-INET sockets, but anyway:
a) If the getsockopt for SO_PRIORITY or IP_TOS failed, the actual
@@ -5340,13 +5297,8 @@ static int setopt_prio_tos_trick
int res;
int res_prio;
int res_tos;
-#ifdef HAVE_SOCKLEN_T
- socklen_t
-#else
- int
-#endif
- tmp_arg_sz_prio = sizeof(tmp_ival_prio),
- tmp_arg_sz_tos = sizeof(tmp_ival_tos);
+ SOCKLEN_T tmp_arg_sz_prio = sizeof(tmp_ival_prio);
+ SOCKLEN_T tmp_arg_sz_tos = sizeof(tmp_ival_tos);
res_prio = sock_getopt(fd, SOL_SOCKET, SO_PRIORITY,
(char *) &tmp_ival_prio, &tmp_arg_sz_prio);
@@ -5418,6 +5370,7 @@ static int inet_set_opts(inet_descriptor* desc, char* ptr, int len)
if (IS_SCTP(desc))
return sctp_set_opts(desc, ptr, len);
#endif
+ /* XXX { int i; for(i=0;i<len;++i) fprintf(stderr,"0x%02X, ", (unsigned) ptr[i]); fprintf(stderr,"\r\n");} */
while(len >= 5) {
opt = *ptr++;
@@ -5489,29 +5442,6 @@ static int inet_set_opts(inet_descriptor* desc, char* ptr, int len)
desc->exitf = ival;
continue;
- case INET_LOPT_BIT8:
- DEBUGF(("inet_set_opts(%ld): s=%d, BIT8=%d\r\n",
- (long)desc->port, desc->s, ival));
- switch(ival) {
- case INET_BIT8_ON:
- desc->bit8f = 1;
- desc->bit8 = 0;
- break;
- case INET_BIT8_OFF:
- desc->bit8f = 0;
- desc->bit8 = 0;
- break;
- case INET_BIT8_CLEAR:
- desc->bit8f = 1;
- desc->bit8 = 0;
- break;
- case INET_BIT8_SET:
- desc->bit8f = 1;
- desc->bit8 = 1;
- break;
- }
- continue;
-
case INET_LOPT_TCP_HIWTRMRK:
if (desc->stype == SOCK_STREAM) {
tcp_descriptor* tdesc = (tcp_descriptor*) desc;
@@ -5593,23 +5523,11 @@ static int inet_set_opts(inet_descriptor* desc, char* ptr, int len)
case INET_OPT_SNDBUF: type = SO_SNDBUF;
DEBUGF(("inet_set_opts(%ld): s=%d, SO_SNDBUF=%d\r\n",
(long)desc->port, desc->s, ival));
- /*
- * Setting buffer sizes in VxWorks gives unexpected results
- * our workaround is to leave it at default.
- */
-#ifdef VXWORKS
- goto skip_os_setopt;
-#else
break;
-#endif
case INET_OPT_RCVBUF: type = SO_RCVBUF;
DEBUGF(("inet_set_opts(%ld): s=%d, SO_RCVBUF=%d\r\n",
(long)desc->port, desc->s, ival));
-#ifdef VXWORKS
- goto skip_os_setopt;
-#else
break;
-#endif
case INET_OPT_LINGER: type = SO_LINGER;
if (len < 4)
return -1;
@@ -5731,9 +5649,6 @@ static int inet_set_opts(inet_descriptor* desc, char* ptr, int len)
}
DEBUGF(("inet_set_opts(%ld): s=%d returned %d\r\n",
(long)desc->port, desc->s, res));
-#ifdef VXWORKS
-skip_os_setopt:
-#endif
if (type == SO_RCVBUF) {
/* make sure we have desc->bufsz >= SO_RCVBUF */
if (ival > desc->bufsz)
@@ -5747,10 +5662,16 @@ skip_os_setopt:
if (desc->active != old_active)
sock_select(desc, (FD_READ|FD_CLOSE), (desc->active>0));
+ /* XXX: UDP sockets could also trigger immediate read here NIY */
if ((desc->stype==SOCK_STREAM) && desc->active) {
if (!old_active || (desc->htype != old_htype)) {
/* passive => active change OR header type change in active mode */
- return 1;
+ /* Return > 1 if only active changed to INET_ONCE -> direct read if
+ header type is unchanged. */
+ /* XXX fprintf(stderr,"desc->htype == %d, old_htype == %d,
+ desc->active == %d, old_active == %d\r\n",(int)desc->htype,
+ (int) old_htype, (int) desc->active, (int) old_active );*/
+ return 1+(desc->htype == old_htype && desc->active == INET_ONCE);
}
return 0;
}
@@ -6388,15 +6309,6 @@ static ErlDrvSSizeT inet_fill_opts(inet_descriptor* desc,
put_int32(desc->exitf, ptr);
continue;
- case INET_LOPT_BIT8:
- *ptr++ = opt;
- if (desc->bit8f) {
- put_int32(desc->bit8, ptr);
- } else {
- put_int32(INET_BIT8_OFF, ptr);
- }
- continue;
-
case INET_LOPT_TCP_HIWTRMRK:
if (desc->stype == SOCK_STREAM) {
*ptr++ = opt;
@@ -7455,8 +7367,6 @@ static ErlDrvData inet_start(ErlDrvPort port, int size, int protocol)
desc->mode = INET_MODE_LIST; /* list mode */
desc->exitf = 1; /* exit port when close on active
socket */
- desc->bit8f = 0;
- desc->bit8 = 0;
desc->deliver = INET_DELIVER_TERM; /* standard term format */
desc->active = INET_PASSIVE; /* start passive */
desc->oph = NULL;
@@ -7584,17 +7494,27 @@ static ErlDrvSSizeT inet_ctl(inet_descriptor* desc, int cmd, char* buf,
case INET_REQ_SETOPTS: { /* set options */
DEBUGF(("inet_ctl(%ld): SETOPTS\r\n", (long)desc->port));
+ /* XXX fprintf(stderr,"inet_ctl(%ld): SETOPTS (len = %d)\r\n", (long)desc->port,(int) len); */
switch(inet_set_opts(desc, buf, len)) {
case -1:
return ctl_error(EINVAL, rbuf, rsize);
case 0:
return ctl_reply(INET_REP_OK, NULL, 0, rbuf, rsize);
- default: /* active/passive change!! */
+ case 1:
/*
* Let's hope that the descriptor really is a tcp_descriptor here.
*/
+ /* fprintf(stderr,"Triggered tcp_deliver by setopt.\r\n"); */
tcp_deliver((tcp_descriptor *) desc, 0);
return ctl_reply(INET_REP_OK, NULL, 0, rbuf, rsize);
+ default:
+ /* fprintf(stderr,"Triggered tcp_recv by setopt.\r\n"); */
+ /*
+ * Same as above, but active changed to once w/o header type
+ * change, so try a read instead of just deliver.
+ */
+ tcp_recv((tcp_descriptor *) desc, 0);
+ return ctl_reply(INET_REP_OK, NULL, 0, rbuf, rsize);
}
}
@@ -7745,7 +7665,7 @@ static ErlDrvSSizeT inet_ctl(inet_descriptor* desc, int cmd, char* buf,
if (desc->state != INET_STATE_OPEN)
return ctl_xerror(EXBADPORT, rbuf, rsize);
- if (inet_set_address(desc->sfamily, &local, buf, &len) == NULL)
+ if (inet_set_faddress(desc->sfamily, &local, buf, &len) == NULL)
return ctl_error(EINVAL, rbuf, rsize);
if (IS_SOCKET_ERROR(sock_bind(desc->s,(struct sockaddr*) &local, len)))
@@ -7754,8 +7674,8 @@ static ErlDrvSSizeT inet_ctl(inet_descriptor* desc, int cmd, char* buf,
desc->state = INET_STATE_BOUND;
if ((port = inet_address_port(&local)) == 0) {
- len = sizeof(local);
- sock_name(desc->s, (struct sockaddr*) &local, (unsigned int*)&len);
+ SOCKLEN_T adrlen = sizeof(local);
+ sock_name(desc->s, &local.sa, &adrlen);
port = inet_address_port(&local);
}
port = sock_ntohs(port);
@@ -7790,8 +7710,6 @@ static ErlDrvSSizeT inet_ctl(inet_descriptor* desc, int cmd, char* buf,
return ctl_reply(INET_REP_OK, NULL, 0, rbuf, rsize);
}
-#ifndef VXWORKS
-
case INET_REQ_GETSERVBYNAME: { /* L1 Name-String L2 Proto-String */
char namebuf[256];
char protobuf[256];
@@ -7842,8 +7760,6 @@ static ErlDrvSSizeT inet_ctl(inet_descriptor* desc, int cmd, char* buf,
return ctl_reply(INET_REP_OK, srv->s_name, len, rbuf, rsize);
}
-#endif /* !VXWORKS */
-
default:
return ctl_xerror(EXBADPORT, rbuf, rsize);
}
@@ -8051,7 +7967,7 @@ static ErlDrvData tcp_inet_start(ErlDrvPort port, char* args)
/* Copy a descriptor, by creating a new port with same settings
* as the descriptor desc.
- * return NULL on error (ENFILE no ports avail)
+ * return NULL on error (SYSTEM_LIMIT no ports avail)
*/
static tcp_descriptor* tcp_inet_copy(tcp_descriptor* desc,SOCKET s,
ErlDrvTermData owner, int* err)
@@ -8074,7 +7990,6 @@ static tcp_descriptor* tcp_inet_copy(tcp_descriptor* desc,SOCKET s,
/* Some flags must be inherited at this point */
copy_desc->inet.mode = desc->inet.mode;
copy_desc->inet.exitf = desc->inet.exitf;
- copy_desc->inet.bit8f = desc->inet.bit8f;
copy_desc->inet.deliver = desc->inet.deliver;
copy_desc->inet.htype = desc->inet.htype;
copy_desc->inet.psize = desc->inet.psize;
@@ -8090,7 +8005,7 @@ static tcp_descriptor* tcp_inet_copy(tcp_descriptor* desc,SOCKET s,
/* The new port will be linked and connected to the original caller */
port = driver_create_port(port, owner, "tcp_inet", (ErlDrvData) copy_desc);
if ((long)port == -1) {
- *err = ENFILE;
+ *err = INET_ERRNO_SYSTEM_LIMIT;
FREE(copy_desc);
return NULL;
}
@@ -9188,6 +9103,7 @@ static int tcp_inet_input(tcp_descriptor* desc, HANDLE event)
#endif
ASSERT(!INETP(desc)->is_ignored);
DEBUGF(("tcp_inet_input(%ld) {s=%d\r\n", port, desc->inet.s));
+ /* XXX fprintf(stderr,"tcp_inet_input(%ld) {s=%d}\r\n",(long) desc->inet.port, desc->inet.s); */
if (desc->inet.state == INET_STATE_ACCEPTING) {
SOCKET s;
unsigned int len;
@@ -9778,7 +9694,6 @@ static udp_descriptor* sctp_inet_copy(udp_descriptor* desc, SOCKET s, int* err)
/* Some flags must be inherited at this point */
copy_desc->inet.mode = desc->inet.mode;
copy_desc->inet.exitf = desc->inet.exitf;
- copy_desc->inet.bit8f = desc->inet.bit8f;
copy_desc->inet.deliver = desc->inet.deliver;
copy_desc->inet.htype = desc->inet.htype;
copy_desc->inet.psize = desc->inet.psize;
@@ -10109,12 +10024,13 @@ static ErlDrvSSizeT packet_inet_ctl(ErlDrvData e, unsigned int cmd, char* buf,
case SCTP_REQ_BINDX:
{ /* Multi-homing bind for SCTP: */
- /* Construct the list of addresses we bind to. The curr limit is
- 256 addrs. Buff structure: Flags(1), ListItem,...:
+ /* Add additional addresses by calling sctp_bindx with one address
+ at a time, since this is what some OSes promise will work.
+ Buff structure: Flags(1), ListItem,...:
*/
- struct sockaddr addrs[256];
+ inet_address addr;
char* curr;
- int add_flag, n, rflag;
+ int add_flag, rflag;
if (!IS_SCTP(desc))
return ctl_xerror(EXBADPORT, rbuf, rsize);
@@ -10123,27 +10039,22 @@ static ErlDrvSSizeT packet_inet_ctl(ErlDrvData e, unsigned int cmd, char* buf,
add_flag = get_int8(curr);
curr++;
- for(n=0; n < 256 && curr < buf+len; n++)
+ /* Make the real flags: */
+ rflag = add_flag ? SCTP_BINDX_ADD_ADDR : SCTP_BINDX_REM_ADDR;
+
+ while (curr < buf+len)
{
- /* List item format: Port(2), IP(4|16) -- compatible with
- "inet_set_address": */
- inet_address tmp;
+ /* List item format: see "inet_set_faddress": */
ErlDrvSizeT alen = buf + len - curr;
- curr = inet_set_address(desc->sfamily, &tmp, curr, &alen);
+ curr = inet_set_faddress(desc->sfamily, &addr, curr, &alen);
if (curr == NULL)
return ctl_error(EINVAL, rbuf, rsize);
- /* Now: we need to squeeze "tmp" into the size of "sockaddr",
- which is smaller than "tmp" for IPv6 (extra IN6 info will
- be cut off): */
- memcpy(addrs + n, &tmp, sizeof(struct sockaddr));
+ /* Invoke the call: */
+ if (p_sctp_bindx(desc->s, (struct sockaddr *)&addr, 1,
+ rflag) < 0)
+ return ctl_error(sock_errno(), rbuf, rsize);
}
- /* Make the real flags: */
- rflag = add_flag ? SCTP_BINDX_ADD_ADDR : SCTP_BINDX_REM_ADDR;
-
- /* Invoke the call: */
- if (p_sctp_bindx(desc->s, addrs, n, rflag) < 0)
- return ctl_error(sock_errno(), rbuf, rsize);
desc->state = INET_STATE_BOUND;
diff --git a/erts/emulator/drivers/common/zlib_drv.c b/erts/emulator/drivers/common/zlib_drv.c
index da4a17db1a..60394b610b 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2012. 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
@@ -64,6 +64,7 @@
static int zlib_init(void);
static ErlDrvData zlib_start(ErlDrvPort port, char* buf);
static void zlib_stop(ErlDrvData e);
+static void zlib_flush(ErlDrvData e);
static ErlDrvSSizeT zlib_ctl(ErlDrvData drv_data, unsigned int command, char *buf,
ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen);
static void zlib_outputv(ErlDrvData drv_data, ErlIOVec *ev);
@@ -82,7 +83,7 @@ ErlDrvEntry zlib_driver_entry = {
NULL, /* timeout */
zlib_outputv,
NULL, /* read_async */
- NULL, /* flush */
+ zlib_flush,
NULL, /* call */
NULL, /* event */
ERL_DRV_EXTENDED_MARKER,
@@ -410,6 +411,13 @@ static void zlib_stop(ErlDrvData e)
driver_free(d);
}
+static void zlib_flush(ErlDrvData drv_data)
+{
+ ZLibData* d = (ZLibData*) drv_data;
+
+ driver_deq(d->port, driver_sizeq(d->port));
+}
+
static ErlDrvSSizeT zlib_ctl(ErlDrvData drv_data, unsigned int command, char *buf,
ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen)
{
diff --git a/erts/emulator/drivers/unix/unix_efile.c b/erts/emulator/drivers/unix/unix_efile.c
index 796843a735..2aa373aa7d 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2012. 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
@@ -45,23 +45,6 @@
#include <fcntl.h>
#endif /* DARWIN */
-#ifdef VXWORKS
-#include <ioLib.h>
-#include <dosFsLib.h>
-#include <nfsLib.h>
-#include <sys/stat.h>
-/*
-** Not nice to include usrLib.h as MANY normal variable names get reported
-** as shadowing globals, like 'i' for example.
-** Instead we declare the only function we use here
-*/
-/*
- * #include <usrLib.h>
- */
-extern STATUS copy(char *, char *);
-#include <errno.h>
-#endif
-
#ifdef SUNOS4
# define getcwd(buf, size) getwd(buf)
#endif
@@ -93,276 +76,27 @@ extern STATUS copy(char *, char *);
#define DIR_MODE 0777
#endif
-#ifdef VXWORKS /* Currently only used on vxworks */
-
-#define EF_ALLOC(S) driver_alloc((S))
-#define EF_REALLOC(P, S) driver_realloc((P), (S))
-#define EF_SAFE_ALLOC(S) ef_safe_alloc((S))
-#define EF_SAFE_REALLOC(P, S) ef_safe_realloc((P), (S))
-#define EF_FREE(P) do { if((P)) driver_free((P)); } while(0)
-
-void erl_exit(int n, char *fmt, ...);
-
-static void *ef_safe_alloc(Uint s)
-{
- void *p = EF_ALLOC(s);
- if (!p) erl_exit(1,
- "unix efile drv: Can't allocate %d bytes of memory\n",
- s);
- return p;
-}
-
-#if 0 /* Currently not used */
-
-static void *ef_safe_realloc(void *op, Uint s)
-{
- void *p = EF_REALLOC(op, s);
- if (!p) erl_exit(1,
- "unix efile drv: Can't reallocate %d bytes of memory\n",
- s);
- return p;
-}
-
-#endif /* #if 0 */
-#endif /* #ifdef VXWORKS */
-
#define IS_DOT_OR_DOTDOT(s) \
(s[0] == '.' && (s[1] == '\0' || (s[1] == '.' && s[2] == '\0')))
-#ifdef VXWORKS
-static int vxworks_to_posix(int vx_errno);
-#endif
-
-/*
-** VxWorks (not) strikes again. Too long RESULTING paths
-** may give the infamous bus error. Have to check ALL
-** filenames and pathnames. No wonder the emulator is slow on
-** these cards...
-*/
-#ifdef VXWORKS
-#define CHECK_PATHLEN(Name, ErrInfo) \
- if (path_size(Name) > PATH_MAX) { \
- errno = ENAMETOOLONG; \
- return check_error(-1, ErrInfo); \
- }
-#else
-#define CHECK_PATHLEN(X,Y) /* Nothing */
-#endif
-
static int check_error(int result, Efile_error* errInfo);
static int
check_error(int result, Efile_error *errInfo)
{
if (result < 0) {
-#ifdef VXWORKS
- errInfo->posix_errno = errInfo->os_errno = vxworks_to_posix(errno);
-#else
errInfo->posix_errno = errInfo->os_errno = errno;
-#endif
return 0;
}
return 1;
}
-#ifdef VXWORKS
-
-/*
- * VxWorks has different error codes for different file systems.
- * We map those to POSIX ones.
- */
-static int
-vxworks_to_posix(int vx_errno)
-{
- DEBUGF(("[vxworks_to_posix] vx_errno: %08x\n", vx_errno));
- switch (vx_errno) {
- /* dosFsLib mapping */
-#ifdef S_dosFsLib_FILE_ALREADY_EXISTS
- case S_dosFsLib_FILE_ALREADY_EXISTS: return EEXIST;
-#else
- case S_dosFsLib_FILE_EXISTS: return EEXIST;
-#endif
-#ifdef S_dosFsLib_BAD_DISK
- case S_dosFsLib_BAD_DISK: return EIO;
-#endif
-#ifdef S_dosFsLib_CANT_CHANGE_ROOT
- case S_dosFsLib_CANT_CHANGE_ROOT: return EINVAL;
-#endif
-#ifdef S_dosFsLib_NO_BLOCK_DEVICE
- case S_dosFsLib_NO_BLOCK_DEVICE: return ENOTBLK;
-#endif
-#ifdef S_dosFsLib_BAD_SEEK
- case S_dosFsLib_BAD_SEEK: return ESPIPE;
-#endif
- case S_dosFsLib_VOLUME_NOT_AVAILABLE: return ENXIO;
- case S_dosFsLib_DISK_FULL: return ENOSPC;
- case S_dosFsLib_FILE_NOT_FOUND: return ENOENT;
- case S_dosFsLib_NO_FREE_FILE_DESCRIPTORS: return ENFILE;
- case S_dosFsLib_INVALID_NUMBER_OF_BYTES: return EINVAL;
- case S_dosFsLib_ILLEGAL_NAME: return EINVAL;
- case S_dosFsLib_CANT_DEL_ROOT: return EACCES;
- case S_dosFsLib_NOT_FILE: return EISDIR;
- case S_dosFsLib_NOT_DIRECTORY: return ENOTDIR;
- case S_dosFsLib_NOT_SAME_VOLUME: return EXDEV;
- case S_dosFsLib_READ_ONLY: return EACCES;
- case S_dosFsLib_ROOT_DIR_FULL: return ENOSPC;
- case S_dosFsLib_DIR_NOT_EMPTY: return EEXIST;
- case S_dosFsLib_NO_LABEL: return ENXIO;
- case S_dosFsLib_INVALID_PARAMETER: return EINVAL;
- case S_dosFsLib_NO_CONTIG_SPACE: return ENOSPC;
- case S_dosFsLib_FD_OBSOLETE: return EBADF;
- case S_dosFsLib_DELETED: return EINVAL;
- case S_dosFsLib_INTERNAL_ERROR: return EIO;
- case S_dosFsLib_WRITE_ONLY: return EACCES;
- /* nfsLib mapping - is needed since Windriver has used */
- /* inconsistent error codes (errno.h/nfsLib.h). */
- case S_nfsLib_NFS_OK: return 0;
- case S_nfsLib_NFSERR_PERM: return EPERM;
- case S_nfsLib_NFSERR_NOENT: return ENOENT;
- case S_nfsLib_NFSERR_IO: return EIO;
- case S_nfsLib_NFSERR_NXIO: return ENXIO;
-#ifdef S_nfsLib_NFSERR_ACCES
- case S_nfsLib_NFSERR_ACCES: return EACCES;
-#else
- case S_nfsLib_NFSERR_ACCESS: return EACCES;
-#endif
- case S_nfsLib_NFSERR_EXIST: return EEXIST;
- case S_nfsLib_NFSERR_NODEV: return ENODEV;
- case S_nfsLib_NFSERR_NOTDIR: return ENOTDIR;
- case S_nfsLib_NFSERR_ISDIR: return EISDIR;
- case S_nfsLib_NFSERR_FBIG: return EFBIG;
- case S_nfsLib_NFSERR_NOSPC: return ENOSPC;
- case S_nfsLib_NFSERR_ROFS: return EROFS;
- case S_nfsLib_NFSERR_NAMETOOLONG: return ENAMETOOLONG;
- case S_nfsLib_NFSERR_NOTEMPTY: return EEXIST;
- case S_nfsLib_NFSERR_DQUOT: return ENOSPC;
- case S_nfsLib_NFSERR_STALE: return EINVAL;
- case S_nfsLib_NFSERR_WFLUSH: return ENXIO;
- /* And sometimes (...) the error codes are from ioLib (as in the */
- /* case of the (for nfsLib) unimplemented rename function) */
- case S_ioLib_DISK_NOT_PRESENT: return EIO;
-#if S_ioLib_DISK_NOT_PRESENT != S_ioLib_NO_DRIVER
- case S_ioLib_NO_DRIVER: return ENXIO;
-#endif
- case S_ioLib_UNKNOWN_REQUEST: return ENOSYS;
- case S_ioLib_DEVICE_TIMEOUT: return EIO;
-#ifdef S_ioLib_UNFORMATED
- /* Added (VxWorks 5.2 -> 5.3.1) */
- #if S_ioLib_UNFORMATED != S_ioLib_DEVICE_TIMEOUT
- case S_ioLib_UNFORMATED: return EIO;
- #endif
-#endif
-#if S_ioLib_DEVICE_TIMEOUT != S_ioLib_DEVICE_ERROR
- case S_ioLib_DEVICE_ERROR: return ENXIO;
-#endif
- case S_ioLib_WRITE_PROTECTED: return EACCES;
- case S_ioLib_NO_FILENAME: return EINVAL;
- case S_ioLib_CANCELLED: return EINTR;
- case S_ioLib_NO_DEVICE_NAME_IN_PATH: return EINVAL;
- case S_ioLib_NAME_TOO_LONG: return ENAMETOOLONG;
-#ifdef S_objLib_OBJ_UNAVAILABLE
- case S_objLib_OBJ_UNAVAILABLE: return ENOENT;
-#endif
-
- /* Temporary workaround for a weird error in passFs
- (VxWorks Simsparc only). File operation fails because of
- ENOENT, but errno is not set. */
-#ifdef SIMSPARCSOLARIS
- case 0: return ENOENT;
-#endif
-
- }
- /* If the error code matches none of the above, assume */
- /* it is a POSIX one already. The upper bits (>=16) are */
- /* cleared since VxWorks uses those bits to indicate in */
- /* what module the error occured. */
- return vx_errno & 0xffff;
-}
-
-static int
-vxworks_enotsup(Efile_error *errInfo)
-{
- errInfo->posix_errno = errInfo->os_errno = ENOTSUP;
- return 0;
-}
-
-static int
-count_path_length(char *pathname, char *pathname2)
-{
- static int stack[PATH_MAX / 2 + 1];
- int sp = 0;
- char *tmp;
- char *cpy = NULL;
- int i;
- int sum;
- for(i = 0;i < 2;++i) {
- if (!i) {
- cpy = EF_SAFE_ALLOC(strlen(pathname)+1);
- strcpy(cpy, pathname);
- } else if (pathname2 != NULL) {
- EF_FREE(cpy);
- cpy = EF_SAFE_ALLOC(strlen(pathname2)+1);
- strcpy(cpy, pathname2);
- } else
- break;
-
- for (tmp = strtok(cpy,"/"); tmp != NULL; tmp = strtok(NULL,"/")) {
- if (!strcmp(tmp,"..") && sp > 0)
- --sp;
- else if (strcmp(tmp,"."))
- stack[sp++] = strlen(tmp);
- }
- }
- if (cpy != NULL)
- EF_FREE(cpy);
- sum = 0;
- for(i = 0;i < sp; ++i)
- sum += stack[i]+1;
- return (sum) ? sum : 1;
-}
-
-static int
-path_size(char *pathname)
-{
- static char currdir[PATH_MAX+2];
- if (*pathname == '/')
- return count_path_length(pathname,NULL);
- ioDefPathGet(currdir);
- strcat(currdir,"/");
- return count_path_length(currdir,pathname);
-}
-
-#endif /* VXWORKS */
-
int
efile_mkdir(Efile_error* errInfo, /* Where to return error codes. */
char* name) /* Name of directory to create. */
{
- CHECK_PATHLEN(name,errInfo);
#ifdef NO_MKDIR_MODE
-#ifdef VXWORKS
- /* This is a VxWorks/nfs workaround for erl_tar to create
- * non-existant directories. (of some reason (...) VxWorks
- * returns, the *non-module-prefixed*, 0xd code when
- * trying to create a directory in a directory that doesn't exist).
- * (see efile_openfile)
- */
- if (mkdir(name) < 0) {
- struct stat sb;
- if (name[0] == '\0') {
- /* Return the correct error code enoent */
- errno = S_nfsLib_NFSERR_NOENT;
- } else if (stat(name, &sb) == OK) {
- errno = S_nfsLib_NFSERR_EXIST;
- } else if((strchr(name, '/') != NULL) && (errno == 0xd)) {
- /* Return the correct error code enoent */
- errno = S_nfsLib_NFSERR_NOENT;
- }
- return check_error(-1, errInfo);
- } else return 1;
-#else
return check_error(mkdir(name), errInfo);
-#endif
#else
return check_error(mkdir(name, DIR_MODE), errInfo);
#endif
@@ -372,16 +106,9 @@ int
efile_rmdir(Efile_error* errInfo, /* Where to return error codes. */
char* name) /* Name of directory to delete. */
{
- CHECK_PATHLEN(name, errInfo);
if (rmdir(name) == 0) {
return 1;
}
-#ifdef VXWORKS
- if (name[0] == '\0') {
- /* Return the correct error code enoent */
- errno = S_nfsLib_NFSERR_NOENT;
- }
-#else
if (errno == ENOTEMPTY) {
errno = EEXIST;
}
@@ -401,7 +128,6 @@ efile_rmdir(Efile_error* errInfo, /* Where to return error codes. */
}
errno = saved_errno;
}
-#endif
return check_error(-1, errInfo);
}
@@ -409,7 +135,6 @@ int
efile_delete_file(Efile_error* errInfo, /* Where to return error codes. */
char* name) /* Name of file to delete. */
{
- CHECK_PATHLEN(name,errInfo);
if (unlink(name) == 0) {
return 1;
}
@@ -457,32 +182,13 @@ efile_rename(Efile_error* errInfo, /* Where to return error codes. */
char* src, /* Original name. */
char* dst) /* New name. */
{
- CHECK_PATHLEN(src,errInfo);
- CHECK_PATHLEN(dst,errInfo);
-#ifdef VXWORKS
-
- /* First check if src == dst, if so, just return. */
- /* VxWorks dos file system destroys the file otherwise, */
- /* VxWorks nfs file system rename doesn't work at all. */
- if(strcmp(src, dst) == 0)
- return 1;
-#endif
if (rename(src, dst) == 0) {
return 1;
}
-#ifdef VXWORKS
- /* nfs for VxWorks doesn't support rename. We try to emulate it */
- /* (by first copying src to dst and then deleting src). */
- if(errno == S_ioLib_UNKNOWN_REQUEST && /* error code returned
- by ioLib (!) */
- copy(src, dst) == OK &&
- unlink(src) == OK)
- return 1;
-#endif
if (errno == ENOTEMPTY) {
errno = EEXIST;
}
-#if defined (sparc) && !defined(VXWORKS)
+#if defined (sparc)
/*
* SunOS 4.1.4 reports overwriting a non-empty directory with a
* directory as EINVAL instead of EEXIST (first rule out the correct
@@ -543,7 +249,6 @@ int
efile_chdir(Efile_error* errInfo, /* Where to return error codes. */
char* name) /* Name of directory to make current. */
{
- CHECK_PATHLEN(name, errInfo);
return check_error(chdir(name), errInfo);
}
@@ -600,8 +305,6 @@ efile_readdir(Efile_error* errInfo, /* Where to return error codes. */
* If this is the first call, we must open the directory.
*/
- CHECK_PATHLEN(name, errInfo);
-
if (*p_dir_handle == NULL) {
dp = opendir(name);
if (dp == NULL)
@@ -641,26 +344,8 @@ efile_openfile(Efile_error* errInfo, /* Where to return error codes. */
struct stat statbuf;
int fd;
int mode; /* Open mode. */
-#ifdef VXWORKS
- char pathbuff[PATH_MAX+2];
- char sbuff[PATH_MAX*2];
- char *totbuff = sbuff;
- int nameneed;
-#endif
-
-
- CHECK_PATHLEN(name, errInfo);
-
-#ifdef VXWORKS
- /* Have to check that it's not a directory. */
- if (stat(name,&statbuf) != ERROR && ISDIR(statbuf)) {
- errno = EISDIR;
- return check_error(-1, errInfo);
- }
-#endif
if (stat(name, &statbuf) >= 0 && !ISREG(statbuf)) {
-#if !defined(VXWORKS) && !defined(OSE)
/*
* For UNIX only, here is some ugly code to allow
* /dev/null to be opened as a file.
@@ -677,12 +362,9 @@ efile_openfile(Efile_error* errInfo, /* Where to return error codes. */
}
}
if (!(dev_null_ino && statbuf.st_ino == dev_null_ino)) {
-#endif
errno = EISDIR;
return check_error(-1, errInfo);
-#if !defined(VXWORKS) && !defined(OSE)
}
-#endif
}
switch (flags & (EFILE_MODE_READ|EFILE_MODE_WRITE)) {
@@ -706,49 +388,14 @@ efile_openfile(Efile_error* errInfo, /* Where to return error codes. */
if (flags & EFILE_MODE_APPEND) {
mode &= ~O_TRUNC;
-#ifndef VXWORKS
- mode |= O_APPEND; /* Dont make VxWorks think things it shouldn't */
-#endif
+ mode |= O_APPEND;
}
if (flags & EFILE_MODE_EXCL) {
mode |= O_EXCL;
}
-#ifdef VXWORKS
- if (*name != '/') {
- /* Make sure it is an absolute pathname, because ftruncate needs it */
- ioDefPathGet(pathbuff);
- strcat(pathbuff,"/");
- nameneed = strlen(pathbuff) + strlen(name) + 1;
- if (nameneed > PATH_MAX*2)
- totbuff = EF_SAFE_ALLOC(nameneed);
- strcpy(totbuff,pathbuff);
- strcat(totbuff,name);
- fd = open(totbuff, mode, FILE_MODE);
- if (totbuff != sbuff)
- EF_FREE(totbuff);
- } else {
- fd = open(name, mode, FILE_MODE);
- }
-#else
fd = open(name, mode, FILE_MODE);
-#endif
-
-#ifdef VXWORKS
-
- /* This is a VxWorks/nfs workaround for erl_tar to create
- * non-existant directories. (of some reason (...) VxWorks
- * returns, the *non-module-prefixed*, 0xd code when
- * trying to write a file in a directory that doesn't exist).
- * (see efile_mkdir)
- */
- if ((fd < 0) && (strchr(name, '/') != NULL) && (errno == 0xd)) {
- /* Return the correct error code enoent */
- errno = S_nfsLib_NFSERR_NOENT;
- return check_error(-1, errInfo);
- }
-#endif
if (!check_error(fd, errInfo))
return 0;
@@ -797,11 +444,7 @@ efile_fsync(Efile_error *errInfo, /* Where to return error codes. */
int fd) /* File descriptor for file to sync. */
{
#ifdef NO_FSYNC
-#ifdef VXWORKS
- return check_error(ioctl(fd, FIOSYNC, 0), errInfo);
-#else
- undefined fsync
-#endif /* VXWORKS */
+ undefined fsync /* XXX: Really? */
#else
#if defined(DARWIN) && defined(F_FULLFSYNC)
return check_error(fcntl(fd, F_FULLFSYNC), errInfo);
@@ -818,21 +461,8 @@ efile_fileinfo(Efile_error* errInfo, Efile_info* pInfo,
struct stat statbuf; /* Information about the file */
int result;
-#ifdef VXWORKS
- if (*name == '\0') {
- errInfo->posix_errno = errInfo->os_errno = ENOENT;
- return 0;
- }
-#endif
-
- CHECK_PATHLEN(name, errInfo);
-
if (info_for_link) {
-#if (defined(VXWORKS))
- result = stat(name, &statbuf);
-#else
result = lstat(name, &statbuf);
-#endif
} else {
result = stat(name, &statbuf);
}
@@ -849,19 +479,9 @@ efile_fileinfo(Efile_error* errInfo, Efile_info* pInfo,
#ifdef NO_ACCESS
/* Just look at read/write access for owner. */
-#ifdef VXWORKS
-
- pInfo->access = FA_NONE;
- if(statbuf.st_mode & S_IRUSR)
- pInfo->access |= FA_READ;
- if(statbuf.st_mode & S_IWUSR)
- pInfo->access |= FA_WRITE;
-
-#else
pInfo->access = ((statbuf.st_mode >> 6) & 07) >> 1;
-#endif /* VXWORKS */
#else
pInfo->access = FA_NONE;
if (access(name, R_OK) == 0)
@@ -902,35 +522,6 @@ efile_write_info(Efile_error *errInfo, Efile_info *pInfo, char *name)
{
struct utimbuf tval;
- CHECK_PATHLEN(name, errInfo);
-
-#ifdef VXWORKS
-
- if (pInfo->mode != -1) {
- int fd;
- struct stat statbuf;
-
- fd = open(name, O_RDONLY, 0);
- if (!check_error(fd, errInfo))
- return 0;
- if (fstat(fd, &statbuf) < 0) {
- close(fd);
- return check_error(-1, errInfo);
- }
- if (pInfo->mode & S_IWUSR) {
- /* clear read only bit */
- statbuf.st_attrib &= ~DOS_ATTR_RDONLY;
- } else {
- /* set read only bit */
- statbuf.st_attrib |= DOS_ATTR_RDONLY;
- }
- /* This should work for dos files but not for nfs ditos, so don't
- * report errors (to avoid problems when running e.g. erl_tar)
- */
- ioctl(fd, FIOATTRIBSET, statbuf.st_attrib);
- close(fd);
- }
-#else
/*
* On some systems chown will always fail for a non-root user unless
* POSIX_CHOWN_RESTRICTED is not set. Others will succeed as long as
@@ -952,20 +543,10 @@ efile_write_info(Efile_error *errInfo, Efile_info *pInfo, char *name)
}
}
-#endif /* !VXWORKS */
-
tval.actime = pInfo->accessTime;
tval.modtime = pInfo->modifyTime;
-#ifdef VXWORKS
- /* VxWorks' utime doesn't work when the file is a nfs mounted
- * one, don't report error if utime fails.
- */
- utime(name, &tval);
- return 1;
-#else
return check_error(utime(name, &tval), errInfo);
-#endif
}
@@ -979,11 +560,6 @@ efile_write(Efile_error* errInfo, /* Where to return error codes. */
{
ssize_t written; /* Bytes written in last operation. */
-#ifdef VXWORKS
- if (flags & EFILE_MODE_APPEND) {
- lseek(fd, 0, SEEK_END); /* Naive append emulation on VXWORKS */
- }
-#endif
while (count > 0) {
if ((written = write(fd, buf, count)) < 0) {
if (errno != EINTR)
@@ -1012,12 +588,6 @@ efile_writev(Efile_error* errInfo, /* Where to return error codes */
ASSERT(iovcnt >= 0);
-#ifdef VXWORKS
- if (flags & EFILE_MODE_APPEND) {
- lseek(fd, 0, SEEK_END); /* Naive append emulation on VXWORKS */
- }
-#endif
-
while (cnt < iovcnt) {
if ((! iov[cnt].iov_base) || (iov[cnt].iov_len <= 0)) {
/* Empty buffer - skip */
@@ -1226,118 +796,6 @@ efile_seek(Efile_error* errInfo, /* Where to return error codes. */
int
efile_truncate_file(Efile_error* errInfo, int *fd, int flags)
{
-#ifdef VXWORKS
- off_t offset;
- char namebuf[PATH_MAX+1];
- char namebuf2[PATH_MAX+10];
- int new;
- int dummy;
- int i;
- int left;
- static char buff[1024];
- struct stat st;
- Efile_error tmperr;
-
- if ((offset = lseek(*fd, 0, 1)) < 0) {
- return check_error((int) offset,errInfo);
- }
- if (ftruncate(*fd, offset) < 0) {
- if (vxworks_to_posix(errno) != EINVAL) {
- return check_error(-1, errInfo);
- }
- /*
- ** Kludge
- */
- if(ioctl(*fd,FIOGETNAME,(int) namebuf) < 0) {
- return check_error(-1, errInfo);
- }
- for(i=0;i<1000;++i) {
- sprintf(namebuf2,"%s%d",namebuf,i);
- CHECK_PATHLEN(namebuf2,errInfo);
- if (stat(namebuf2,&st) < 0) {
- break;
- }
- }
- if (i > 1000) {
- errno = EINVAL;
- return check_error(-1, errInfo);
- }
- if (close(*fd) < 0) {
- return check_error(-1, errInfo);
- }
- if (efile_rename(&tmperr,namebuf,namebuf2) < 0) {
- i = check_error(-1,&tmperr);
- if (!efile_openfile(errInfo,namebuf,flags | EFILE_NO_TRUNCATE,
- fd,&dummy)) {
- *fd = -1;
- } else {
- *errInfo = tmperr;
- }
- return i;
- }
- if ((*fd = open(namebuf2, O_RDONLY, 0)) < 0) {
- i = check_error(-1,errInfo);
- efile_rename(&tmperr,namebuf2,namebuf); /* at least try */
- if (!efile_openfile(errInfo,namebuf,flags | EFILE_NO_TRUNCATE,
- fd,&dummy)) {
- *fd = -1;
- } else {
- lseek(*fd,offset,SEEK_SET);
- }
- return i;
- }
- /* Point of no return... */
-
- if ((new = open(namebuf,O_RDWR | O_CREAT, FILE_MODE)) < 0) {
- close(*fd);
- *fd = -1;
- return 0;
- }
- left = offset;
-
- while (left) {
- if ((i = read(*fd,buff,(left > 1024) ? 1024 : left)) < 0) {
- i = check_error(-1,errInfo);
- close(new);
- close(*fd);
- unlink(namebuf);
- efile_rename(&tmperr,namebuf2,namebuf); /* at least try */
- if (!efile_openfile(errInfo,namebuf,flags | EFILE_NO_TRUNCATE,
- fd,&dummy)) {
- *fd = -1;
- } else {
- lseek(*fd,offset,SEEK_SET);
- }
- return i;
- }
- left -= i;
- if (write(new,buff,i) < 0) {
- i = check_error(-1,errInfo);
- close(new);
- close(*fd);
- unlink(namebuf);
- rename(namebuf2,namebuf); /* at least try */
- if (!efile_openfile(errInfo,namebuf,flags | EFILE_NO_TRUNCATE,
- fd,&dummy)) {
- *fd = -1;
- } else {
- lseek(*fd,offset,SEEK_SET);
- }
- return i;
- }
- }
- close(*fd);
- unlink(namebuf2);
- close(new);
- i = efile_openfile(errInfo,namebuf,flags | EFILE_NO_TRUNCATE,fd,
- &dummy);
- if (i) {
- lseek(*fd,offset,SEEK_SET);
- }
- return i;
- }
- return 1;
-#else
#ifndef NO_FTRUNCATE
off_t offset;
@@ -1347,15 +805,11 @@ efile_truncate_file(Efile_error* errInfo, int *fd, int flags)
#else
return 1;
#endif
-#endif
}
int
efile_readlink(Efile_error* errInfo, char* name, char* buffer, size_t size)
{
-#ifdef VXWORKS
- return vxworks_enotsup(errInfo);
-#else
int len;
ASSERT(size > 0);
len = readlink(name, buffer, size-1);
@@ -1364,7 +818,6 @@ efile_readlink(Efile_error* errInfo, char* name, char* buffer, size_t size)
}
buffer[len] = '\0';
return 1;
-#endif
}
int
@@ -1377,21 +830,13 @@ efile_altname(Efile_error* errInfo, char* name, char* buffer, size_t size)
int
efile_link(Efile_error* errInfo, char* old, char* new)
{
-#ifdef VXWORKS
- return vxworks_enotsup(errInfo);
-#else
return check_error(link(old, new), errInfo);
-#endif
}
int
efile_symlink(Efile_error* errInfo, char* old, char* new)
{
-#ifdef VXWORKS
- return vxworks_enotsup(errInfo);
-#else
return check_error(symlink(old, new), errInfo);
-#endif
}
int
@@ -1426,6 +871,14 @@ efile_fadvise(Efile_error* errInfo, int fd, Sint64 offset,
* you would have to emulate it in linux and on BSD/Darwin some complex
* calculations have to be made when using a non blocking socket to figure
* out how much of the header/file/trailer was sent in each command.
+ *
+ * The semantics of the API is this:
+ * Return value: 1 if all data was sent and the function does not need to
+ * be called again. 0 if an error occures OR if there is more data which
+ * has to be sent (EAGAIN or EINTR will be set appropriately)
+ *
+ * The amount of data written in a call is returned through nbytes.
+ *
*/
int
@@ -1446,8 +899,11 @@ efile_sendfile(Efile_error* errInfo, int in_fd, int out_fd,
*nbytes -= retval;
}
} while (retval == SENDFILE_CHUNK_SIZE);
- *nbytes = written;
- return check_error(retval == -1 ? -1 : 0, errInfo);
+ if (written != 0) {
+ // -1 is not returned by the linux API so we have to simulate it
+ retval = -1;
+ errno = EAGAIN;
+ }
#elif defined(__sun) && defined(__SVR4) && defined(HAVE_SENDFILEV)
ssize_t retval;
size_t len;
@@ -1469,8 +925,6 @@ efile_sendfile(Efile_error* errInfo, int in_fd, int out_fd,
written += len;
}
} while (len == SENDFILE_CHUNK_SIZE);
- *nbytes = written;
- return check_error(retval == -1 ? -1 : 0, errInfo);
#elif defined(DARWIN)
int retval;
off_t len;
@@ -1487,8 +941,6 @@ efile_sendfile(Efile_error* errInfo, int in_fd, int out_fd,
written += len;
}
} while (len == SENDFILE_CHUNK_SIZE);
- *nbytes = written;
- return check_error(retval, errInfo);
#elif defined(__FreeBSD__) || defined(__DragonFly__)
off_t len;
int retval;
@@ -1504,8 +956,8 @@ efile_sendfile(Efile_error* errInfo, int in_fd, int out_fd,
written += len;
}
} while(len == SENDFILE_CHUNK_SIZE);
+#endif
*nbytes = written;
return check_error(retval, errInfo);
-#endif
}
#endif /* HAVE_SENDFILE */
diff --git a/erts/emulator/drivers/win32/registry_drv.c b/erts/emulator/drivers/win32/registry_drv.c
index 1fad34e380..5b200ebd32 100644
--- a/erts/emulator/drivers/win32/registry_drv.c
+++ b/erts/emulator/drivers/win32/registry_drv.c
@@ -344,7 +344,7 @@ fix_value_result(RegPort* rp, LONG result, DWORD type,
#ifdef DEBUG
if (ok != ERROR_SUCCESS) {
char buff[256];
- sprintf(buff,"Failure in registry_drv line %d, error = %d",
+ erts_snprintf(buff, sizeof(buff), "Failure in registry_drv line %d, error = %d",
__LINE__, GetLastError());
MessageBox(NULL, buff, "Internal error", MB_OK);
ASSERT(ok == ERROR_SUCCESS);
diff --git a/erts/emulator/drivers/win32/win_con.c b/erts/emulator/drivers/win32/win_con.c
index 6b45b92cbe..7b9cadd32b 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2012. 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
@@ -569,7 +569,7 @@ FrameWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
return 1;
case WM_SETFOCUS :
CreateCaret(hClientWnd, NULL, cxChar, cyChar);
- SetCaretPos(GetXFromCurrentY(GetDC(hwnd),0,cur_x), (cur_y-iVscrollPos)*cyChar);
+ SetCaretPos(GetXFromCurrentY(GetDC(hClientWnd),iHscrollPos,cur_x), (cur_y-iVscrollPos)*cyChar);
ShowCaret(hClientWnd);
return 0;
case WM_KILLFOCUS:
diff --git a/erts/emulator/drivers/win32/win_efile.c b/erts/emulator/drivers/win32/win_efile.c
index 606fa1d7de..dc7add01f7 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2012. 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
@@ -897,7 +897,8 @@ efile_fileinfo(Efile_error* errInfo, Efile_info* pInfo,
we should be able to find its target */
WCHAR target_name[_MAX_PATH];
if (efile_readlink(errInfo, (char *) name,
- (char *) target_name,256) == 1) {
+ (char *) target_name,
+ _MAX_PATH * sizeof(WCHAR)) == 1) {
FindClose(findhandle);
return efile_fileinfo(errInfo, pInfo,
(char *) target_name, info_for_link);
@@ -1386,7 +1387,7 @@ efile_readlink(Efile_error* errInfo, char* name, char* buffer, size_t size)
HANDLE h = CreateFileW(wname, GENERIC_READ, 0,NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
int len;
if(h != INVALID_HANDLE_VALUE) {
- success = pGetFinalPathNameByHandle(h, wbuffer, size,0);
+ success = pGetFinalPathNameByHandle(h, wbuffer, size / sizeof(WCHAR),0);
/* GetFinalPathNameByHandle prepends path with "\\?\": */
len = wcslen(wbuffer);
wmemmove(wbuffer,wbuffer+4,len-3);
diff --git a/erts/emulator/hipe/hipe_arm.c b/erts/emulator/hipe/hipe_arm.c
index e20a8a7969..3db3ffe9b1 100644
--- a/erts/emulator/hipe/hipe_arm.c
+++ b/erts/emulator/hipe/hipe_arm.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2005-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2012. 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
@@ -181,11 +181,9 @@ void *hipe_alloc_code(Uint nrbytes, Eterm callees, Eterm *trampolines, Process *
curseg.base = base;
curseg.code_pos = base;
curseg.tramp_pos = (unsigned int*)((char*)base + SEGMENT_NRBYTES);
-#if defined(__arm__)
curseg.tramp_pos -= 2;
curseg.tramp_pos[0] = 0xE51FF004; /* ldr pc, [pc,#-4] */
curseg.tramp_pos[1] = (unsigned int)&nbif_callemu;
-#endif
address = try_alloc(nrwords, nrcallees, callees, trampvec);
if (!address) {
@@ -214,11 +212,9 @@ static unsigned int *alloc_stub(Uint nrwords, unsigned int **tramp_callemu)
curseg.base = base;
curseg.code_pos = base;
curseg.tramp_pos = (unsigned int*)((char*)base + SEGMENT_NRBYTES);
-#if defined(__arm__)
curseg.tramp_pos -= 2;
curseg.tramp_pos[0] = 0xE51FF004; /* ldr pc, [pc,#-4] */
curseg.tramp_pos[1] = (unsigned int)&nbif_callemu;
-#endif
address = try_alloc(nrwords, 0, NIL, NULL);
if (!address) {
@@ -269,10 +265,8 @@ int hipe_patch_insn(void *address, Uint32 value, Eterm type)
void *hipe_make_native_stub(void *beamAddress, unsigned int beamArity)
{
unsigned int *code;
-#if defined(__arm__)
unsigned int *tramp_callemu;
int callemu_offset;
-#endif
/*
* Native code calls BEAM via a stub looking as follows:
@@ -288,13 +282,6 @@ void *hipe_make_native_stub(void *beamAddress, unsigned int beamArity)
* (Trampolines are allowed to modify r12, but they don't.)
*/
-#if !defined(__arm__)
- /* verify that 'ba' can reach nbif_callemu */
- if ((unsigned long)&nbif_callemu & ~0x01FFFFFCUL)
- abort();
-#endif
-
-#if defined(__arm__)
code = alloc_stub(4, &tramp_callemu);
callemu_offset = ((int)&nbif_callemu - ((int)&code[2] + 8)) >> 2;
if (!(callemu_offset >= -0x00800000 && callemu_offset <= 0x007FFFFF)) {
@@ -302,11 +289,7 @@ void *hipe_make_native_stub(void *beamAddress, unsigned int beamArity)
if (!(callemu_offset >= -0x00800000 && callemu_offset <= 0x007FFFFF))
abort();
}
-#else
- code = alloc_stub(4, &trampoline);
-#endif
-#if defined(__arm__)
/* mov r0, #beamArity */
code[0] = 0xE3A00000 | (beamArity & 0xFF);
/* ldr r8, [pc,#0] // beamAddress */
@@ -315,16 +298,6 @@ void *hipe_make_native_stub(void *beamAddress, unsigned int beamArity)
code[2] = 0xEA000000 | (callemu_offset & 0x00FFFFFF);
/* .long beamAddress */
code[3] = (unsigned int)beamAddress;
-#else
- /* addi r12,0,beamAddress@l */
- code[0] = 0x39800000 | ((unsigned long)beamAddress & 0xFFFF);
- /* addi r0,0,beamArity */
- code[1] = 0x38000000 | (beamArity & 0x7FFF);
- /* addis r12,r12,beamAddress@ha */
- code[2] = 0x3D8C0000 | at_ha((unsigned long)beamAddress);
- /* ba nbif_callemu */
- code[3] = 0x48000002 | (unsigned long)&nbif_callemu;
-#endif
hipe_flush_icache_range(code, 4*sizeof(int));
@@ -334,60 +307,32 @@ void *hipe_make_native_stub(void *beamAddress, unsigned int beamArity)
static void patch_b(Uint32 *address, Sint32 offset, Uint32 AA)
{
Uint32 oldI = *address;
-#if defined(__arm__)
Uint32 newI = (oldI & 0xFF000000) | (offset & 0x00FFFFFF);
-#else
- Uint32 newI = (oldI & 0xFC000001) | ((offset & 0x00FFFFFF) << 2) | (AA & 2);
-#endif
*address = newI;
hipe_flush_icache_word(address);
}
int hipe_patch_call(void *callAddress, void *destAddress, void *trampoline)
{
-#if !defined(__arm__)
- if ((Uint32)destAddress == ((Uint32)destAddress & 0x01FFFFFC)) {
- /* The destination is in the [0,32MB[ range.
- We can reach it with a ba/bla instruction.
- This is the typical case for BIFs and primops.
- It's also common for trap-to-BEAM stubs (on ppc32). */
- patch_b((Uint32*)callAddress, (Uint32)destAddress >> 2, 2);
+ Sint32 destOffset = ((Sint32)destAddress - ((Sint32)callAddress+8)) >> 2;
+ if (destOffset >= -0x800000 && destOffset <= 0x7FFFFF) {
+ /* The destination is within a [-32MB,+32MB[ range from us.
+ We can reach it with a b/bl instruction.
+ This is typical for nearby Erlang code. */
+ patch_b((Uint32*)callAddress, destOffset, 0);
} else {
-#endif
-#if defined(__arm__)
- Sint32 destOffset = ((Sint32)destAddress - ((Sint32)callAddress+8)) >> 2;
-#else
- Sint32 destOffset = ((Sint32)destAddress - (Sint32)callAddress) >> 2;
-#endif
- if (destOffset >= -0x800000 && destOffset <= 0x7FFFFF) {
- /* The destination is within a [-32MB,+32MB[ range from us.
- We can reach it with a b/bl instruction.
- This is typical for nearby Erlang code. */
- patch_b((Uint32*)callAddress, destOffset, 0);
- } else {
- /* The destination is too distant for b/bl/ba/bla.
- Must do a b/bl to the trampoline. */
-#if defined(__arm__)
- Sint32 trampOffset = ((Sint32)trampoline - ((Sint32)callAddress+8)) >> 2;
-#else
- Sint32 trampOffset = ((Sint32)trampoline - (Sint32)callAddress) >> 2;
-#endif
- if (trampOffset >= -0x800000 && trampOffset <= 0x7FFFFF) {
- /* Update the trampoline's address computation.
- (May be redundant, but we can't tell.) */
-#if defined(__arm__)
- patch_imm32((Uint32*)trampoline+1, (Uint32)destAddress);
-#else
- patch_li((Uint32*)trampoline, (Uint32)destAddress);
-#endif
- /* Update this call site. */
- patch_b((Uint32*)callAddress, trampOffset, 0);
- } else
- return -1;
- }
-#if !defined(__arm__)
+ /* The destination is too distant for b/bl.
+ Must do a b/bl to the trampoline. */
+ Sint32 trampOffset = ((Sint32)trampoline - ((Sint32)callAddress+8)) >> 2;
+ if (trampOffset >= -0x800000 && trampOffset <= 0x7FFFFF) {
+ /* Update the trampoline's address computation.
+ (May be redundant, but we can't tell.) */
+ patch_imm32((Uint32*)trampoline+1, (Uint32)destAddress);
+ /* Update this call site. */
+ patch_b((Uint32*)callAddress, trampOffset, 0);
+ } else
+ return -1;
}
-#endif
return 0;
}
diff --git a/erts/emulator/hipe/hipe_arm_bifs.m4 b/erts/emulator/hipe/hipe_arm_bifs.m4
index e0c6f09796..bd8bc5ab6b 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2012. 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
@@ -27,7 +27,7 @@ include(`hipe/hipe_arm_asm.m4')
.p2align 2
`#if defined(ERTS_ENABLE_LOCK_CHECK) && defined(ERTS_SMP)
-# define CALL_BIF(F) mov r14, #F; str r14, [r0, #P_BIF_CALLEE]; bl hipe_debug_bif_wrapper
+# define CALL_BIF(F) ldr r14, =F; str r14, [r0, #P_BIF_CALLEE]; bl hipe_debug_bif_wrapper
#else
# define CALL_BIF(F) bl F
#endif'
@@ -67,6 +67,7 @@ $1:
RESTORE_CONTEXT_BIF
beq nbif_1_simple_exception
NBIF_RET(1)
+ .ltorg /* needed by LDR in debug version of `CALL_BIF' */
.size $1, .-$1
.type $1, %function
#endif')
@@ -95,6 +96,7 @@ $1:
RESTORE_CONTEXT_BIF
beq nbif_2_simple_exception
NBIF_RET(2)
+ .ltorg
.size $1, .-$1
.type $1, %function
#endif')
@@ -125,6 +127,7 @@ $1:
RESTORE_CONTEXT_BIF
beq nbif_3_simple_exception
NBIF_RET(3)
+ .ltorg
.size $1, .-$1
.type $1, %function
#endif')
@@ -149,6 +152,7 @@ $1:
RESTORE_CONTEXT_BIF
beq nbif_0_simple_exception
NBIF_RET(0)
+ .ltorg
.size $1, .-$1
.type $1, %function
#endif')
@@ -173,7 +177,8 @@ $1:
/* Save caller-save registers and call the C function. */
SAVE_CONTEXT_GC
- bl $2
+ /* ignore empty BIF__ARGS */
+ CALL_BIF($2)
TEST_GOT_MBUF(0)
/* Restore registers. */
@@ -195,7 +200,9 @@ $1:
/* Save caller-save registers and call the C function. */
SAVE_CONTEXT_GC
- bl $2
+ str r1, [r0, #P_ARG0] /* Store BIF__ARGS in def_arg_reg[] */
+ add r1, r0, #P_ARG0
+ CALL_BIF($2)
TEST_GOT_MBUF(1)
/* Restore registers. Check for exception. */
@@ -220,7 +227,10 @@ $1:
/* Save caller-save registers and call the C function. */
SAVE_CONTEXT_GC
- bl $2
+ str r1, [r0, #P_ARG0] /* Store BIF__ARGS in def_arg_reg[] */
+ str r2, [r0, #P_ARG1]
+ add r1, r0, #P_ARG0
+ CALL_BIF($2)
TEST_GOT_MBUF(2)
/* Restore registers. Check for exception. */
diff --git a/erts/emulator/hipe/hipe_bif0.c b/erts/emulator/hipe/hipe_bif0.c
index 28e4382835..1562748f2d 100644
--- a/erts/emulator/hipe/hipe_bif0.c
+++ b/erts/emulator/hipe/hipe_bif0.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2012. 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
@@ -609,8 +609,8 @@ static Uint *hipe_find_emu_address(Eterm mod, Eterm name, unsigned int arity)
Uint *code_base;
int i, n;
- modp = erts_get_module(mod);
- if (modp == NULL || (code_base = modp->code) == NULL)
+ modp = erts_get_module(mod, erts_active_code_ix());
+ if (modp == NULL || (code_base = modp->curr.code) == NULL)
return NULL;
n = code_base[MI_NUM_FUNCTIONS];
for (i = 0; i < n; ++i) {
@@ -648,7 +648,7 @@ static void *hipe_get_emu_address(Eterm m, Eterm f, unsigned int arity, int is_r
/* if not found, stub it via the export entry */
/* no lock needed around erts_export_get_or_make_stub() */
Export *export_entry = erts_export_get_or_make_stub(m, f, arity);
- address = export_entry->address;
+ address = export_entry->addressv[erts_active_code_ix()];
}
return address;
}
@@ -1093,10 +1093,8 @@ BIF_RETTYPE hipe_bifs_make_fun_3(BIF_ALIST_3)
if (is_not_nil(free_vars))
BIF_ERROR(BIF_P, BADARG);
-#ifndef HYBRID /* FIND ME! */
funp->next = MSO(BIF_P).funs;
MSO(BIF_P).funs = funp;
-#endif
BIF_RET(make_fun(funp));
}
@@ -1585,14 +1583,6 @@ BIF_RETTYPE hipe_nonclosure_address(BIF_ALIST_2)
goto badfun;
m = ep->code[0];
f = ep->code[1];
- } else if (hdr == make_arityval(2)) {
- Eterm *tp = tuple_val(BIF_ARG_1);
- m = tp[1];
- f = tp[2];
- if (is_not_atom(m) || is_not_atom(f))
- goto badfun;
- if (!erts_find_export_entry(m, f, BIF_ARG_2))
- goto badfun;
} else
goto badfun;
address = hipe_get_na_nofail(m, f, BIF_ARG_2, 1);
@@ -1757,6 +1747,41 @@ BIF_RETTYPE hipe_bifs_mark_referred_from_1(BIF_ALIST_1) /* get_refs_from */
BIF_RET(NIL);
}
+/* Called by init:restart after unloading all hipe compiled modules
+ * to work around bug causing execution of deallocated beam code.
+ * Can be removed when delete/purge of native modules works better.
+ * Test: Do init:restart in debug compiled vm with hipe compiled kernel.
+ */
+static void hipe_purge_all_refs(void)
+{
+ struct hipe_mfa_info **bucket;
+ unsigned int i, nrbuckets;
+
+ hipe_mfa_info_table_lock();
+
+ bucket = hipe_mfa_info_table.bucket;
+ nrbuckets = 1 << hipe_mfa_info_table.log2size;
+ for (i = 0; i < nrbuckets; ++i) {
+ while (bucket[i] != NULL) {
+ struct hipe_mfa_info* mfa = bucket[i];
+ bucket[i] = mfa->bucket.next;
+
+ while (mfa->refers_to) {
+ struct hipe_mfa_info_list *to = mfa->refers_to;
+ mfa->refers_to = to->next;
+ erts_free(ERTS_ALC_T_HIPE, to);
+ }
+ while (mfa->referred_from) {
+ struct ref* from = mfa->referred_from;
+ mfa->referred_from = from->next;
+ erts_free(ERTS_ALC_T_HIPE, from);
+ }
+ erts_free(ERTS_ALC_T_HIPE, mfa);
+ }
+ }
+ hipe_mfa_info_table_unlock();
+}
+
BIF_RETTYPE hipe_bifs_remove_refs_from_1(BIF_ALIST_1)
{
struct mfa mfa;
@@ -1764,6 +1789,11 @@ BIF_RETTYPE hipe_bifs_remove_refs_from_1(BIF_ALIST_1)
struct hipe_mfa_info_list *refers_to, *tmp_refers_to;
struct ref **prev, *ref;
+ if (BIF_ARG_1 == am_all) {
+ hipe_purge_all_refs();
+ BIF_RET(NIL);
+ }
+
if (!term_to_mfa(BIF_ARG_1, &mfa))
BIF_ERROR(BIF_P, BADARG);
hipe_mfa_info_table_lock();
@@ -1801,6 +1831,7 @@ BIF_RETTYPE hipe_bifs_remove_refs_from_1(BIF_ALIST_1)
BIF_RET(NIL);
}
+
/* redirect_referred_from(CalleeMFA)
* Redirect all pending-redirect refs in CalleeMFA's referred_from.
* Then remove any pending-redirect && pending-remove refs from CalleeMFA's referred_from.
diff --git a/erts/emulator/hipe/hipe_bif1.c b/erts/emulator/hipe/hipe_bif1.c
index 87cdfb8c7a..56767ef04b 100644
--- a/erts/emulator/hipe/hipe_bif1.c
+++ b/erts/emulator/hipe/hipe_bif1.c
@@ -2,7 +2,7 @@
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2012. 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
@@ -449,7 +449,7 @@ BIF_RETTYPE hipe_bifs_gc_info_0(BIF_ALIST_0)
BIF_RETTYPE hipe_bifs_shared_gc_info_0(BIF_ALIST_0)
{
#ifdef __BENCHMARK__
-#if !(defined(BM_COUNTERS) && defined(HYBRID))
+#if !(defined(BM_COUNTERS))
Uint minor_global_gc = 0;
Uint major_global_gc = 0;
#endif
@@ -459,17 +459,9 @@ BIF_RETTYPE hipe_bifs_shared_gc_info_0(BIF_ALIST_0)
#endif
Eterm *hp;
-#if defined(HYBRID)
- Uint tmp_used_heap = (Uint)((BIF_P->htop - BIF_P->heap) +
- (OLD_HTOP(BIF_P) - OLD_HEAP(BIF_P)) +
- MBUF_SIZE(BIF_P));
- Uint tmp_allocated_heap = (Uint)((BIF_P->hend - BIF_P->heap) +
- (OLD_HEND(BIF_P) - OLD_HEAP(BIF_P)) +
- MBUF_SIZE(BIF_P));
-#else
Uint tmp_used_heap = 0;
Uint tmp_allocated_heap = 0;
-#endif
+
hp = HAlloc(BIF_P, 7);
BIF_RET(TUPLE6(hp,
make_small((uint)minor_global_gc),
@@ -486,7 +478,7 @@ BIF_RETTYPE hipe_bifs_shared_gc_info_0(BIF_ALIST_0)
BIF_RETTYPE hipe_bifs_incremental_gc_info_0(BIF_ALIST_0)
{
#ifdef __BENCHMARK__
-#if !(defined(BM_COUNTERS) && defined(INCREMENTAL))
+#if !defined(BM_COUNTERS)
Uint minor_gc_cycles = 0;
Uint major_gc_cycles = 0;
Uint minor_gc_stages = 0;
@@ -512,17 +504,6 @@ BIF_RETTYPE hipe_bifs_gc_info_clear_0(BIF_ALIST_0)
#ifdef BM_COUNTERS
minor_gc = 0;
major_gc = 0;
-#ifdef HYBRID
- minor_global_gc = 0;
- major_global_gc = 0;
- gc_in_copy = 0;
-#ifdef INCREMENTAL
- minor_gc_cycles = 0;
- major_gc_cycles = 0;
- minor_gc_stages = 0;
- major_gc_stages = 0;
-#endif
-#endif
#endif
#ifdef BM_HEAP_SIZES
diff --git a/erts/emulator/hipe/hipe_bif2.c b/erts/emulator/hipe/hipe_bif2.c
index ee97541e15..e09988e2c5 100644
--- a/erts/emulator/hipe/hipe_bif2.c
+++ b/erts/emulator/hipe/hipe_bif2.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2012. 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
@@ -151,22 +151,6 @@ BIF_RETTYPE hipe_bifs_modeswitch_debug_off_0(BIF_ALIST_0)
BIF_RET(am_true);
}
-/* BIFs for handling the message area */
-
-BIF_RETTYPE hipe_bifs_show_message_area_0(BIF_ALIST_0)
-{
-#ifdef HYBRID
-#ifdef DEBUG
- print_message_area();
-#else
- printf("Only available in debug compiled emulator\r\n");
-#endif
- BIF_RET(am_true);
-#else
- BIF_RET(am_false);
-#endif
-}
-
#if defined(ERTS_ENABLE_LOCK_CHECK) && defined(ERTS_SMP)
BIF_RETTYPE hipe_debug_bif_wrapper(BIF_ALIST_1);
@@ -189,3 +173,10 @@ BIF_RETTYPE hipe_debug_bif_wrapper(BIF_ALIST_1)
#endif /* ERTS_ENABLE_LOCK_CHECK && ERTS_SMP */
+
+BIF_RETTYPE hipe_bifs_debug_native_called_2(BIF_ALIST_2)
+{
+ erts_printf("hipe_debug_native_called: %T(%T)\r\n", BIF_ARG_1, BIF_ARG_2);
+ BIF_RET(am_ok);
+}
+
diff --git a/erts/emulator/hipe/hipe_bif2.tab b/erts/emulator/hipe/hipe_bif2.tab
index 51323ce7af..45a395bf57 100644
--- a/erts/emulator/hipe/hipe_bif2.tab
+++ b/erts/emulator/hipe/hipe_bif2.tab
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2011. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -29,4 +29,4 @@ bif hipe_bifs:show_term/1
bif hipe_bifs:in_native/0
bif hipe_bifs:modeswitch_debug_on/0
bif hipe_bifs:modeswitch_debug_off/0
-bif hipe_bifs:show_message_area/0
+bif hipe_bifs:debug_native_called/2
diff --git a/erts/emulator/hipe/hipe_bif_list.m4 b/erts/emulator/hipe/hipe_bif_list.m4
index 942fa0c5cb..d9aa09b79e 100644
--- a/erts/emulator/hipe/hipe_bif_list.m4
+++ b/erts/emulator/hipe/hipe_bif_list.m4
@@ -165,6 +165,7 @@ gc_bif_interface_2(nbif_put_2, put_2)
gc_bif_interface_1(nbif_hipe_bifs_show_nstack_1, hipe_show_nstack_1)
gc_bif_interface_1(nbif_hipe_bifs_show_pcb_1, hipe_bifs_show_pcb_1)
gc_bif_interface_0(nbif_hipe_bifs_nstack_used_size_0, hipe_bifs_nstack_used_size_0)
+gc_bif_interface_2(nbif_hipe_bifs_debug_native_called, hipe_bifs_debug_native_called_2)
/*
* Arithmetic operators called indirectly by the HiPE compiler.
diff --git a/erts/emulator/hipe/hipe_debug.c b/erts/emulator/hipe/hipe_debug.c
index 7ca11f8c6c..37615bf718 100644
--- a/erts/emulator/hipe/hipe_debug.c
+++ b/erts/emulator/hipe/hipe_debug.c
@@ -188,8 +188,6 @@ void hipe_print_pcb(Process *p)
U("old_htop ", old_htop);
U("old_head ", old_heap);
U("min_heap_..", min_heap_size);
- U("status ", status);
- U("rstatus ", rstatus);
U("rcount ", rcount);
U("id ", id);
U("prio ", prio);
diff --git a/erts/emulator/hipe/hipe_gc.c b/erts/emulator/hipe/hipe_gc.c
index e0575c35ff..86c4068072 100644
--- a/erts/emulator/hipe/hipe_gc.c
+++ b/erts/emulator/hipe/hipe_gc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2012. 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
@@ -237,329 +237,3 @@ void gensweep_nstack(Process *p, Eterm **ptr_old_htop, Eterm **ptr_n_htop)
}
abort();
}
-
-#ifdef HYBRID
-
-#ifdef INCREMENTAL
-Eterm *ma_fullsweep_nstack(Process *p, Eterm *n_htop, Eterm *n_hend)
-{
- /* known nstack walk state */
- Eterm *nsp;
- Eterm *nsp_end;
- const struct sdesc *sdesc;
- unsigned int sdesc_size;
- unsigned long ra;
- unsigned int i;
- unsigned int mask;
- /* arch-specific nstack walk state */
- struct nstack_walk_state walk_state;
-
- if (!nstack_walk_init_check(p))
- return n_htop;
-
- nsp = nstack_walk_nsp_begin(p);
- nsp_end = nstack_walk_nsp_end(p);
-
- sdesc = nstack_walk_init_sdesc(p, &walk_state);
-
- for (;;) {
- if (nstack_walk_nsp_reached_end(nsp, nsp_end)) {
- if (nsp == nsp_end)
- return n_htop;
- fprintf(stderr, "%s: passed end of stack\r\n", __FUNCTION__);
- break;
- }
- sdesc_size = nstack_walk_frame_size(sdesc);
- i = 0;
- mask = sdesc->livebits[0];
- for (;;) {
- if (mask & 1) {
- Eterm *nsp_i = nstack_walk_frame_index(nsp, i);
- Eterm val = *nsp_i;
- Eterm *obj_ptr = ptr_val(val);
- switch (primary_tag(val)) {
- case TAG_PRIMARY_LIST:
- COPYMARK_CONS(obj_ptr, n_htop, nsp_i, n_hend);
- break;
- case TAG_PRIMARY_BOXED:
- COPYMARK_BOXED(obj_ptr, n_htop, nsp_i, n_hend);
- break;
- default:
- break;
- }
- }
- if (++i >= sdesc_size)
- break;
- if (i & 31)
- mask >>= 1;
- else
- mask = sdesc->livebits[i >> 5];
- }
- ra = nstack_walk_frame_ra(nsp, sdesc);
- if (ra == (unsigned long)nbif_stack_trap_ra)
- ra = (unsigned long)p->hipe.ngra;
- sdesc = hipe_find_sdesc(ra);
- nsp = nstack_walk_next_frame(nsp, sdesc_size);
- }
- abort();
-}
-
-void ma_gensweep_nstack(Process *p, Eterm **ptr_old_htop, Eterm **ptr_n_htop)
-{
- /* known nstack walk state */
- Eterm *nsp;
- Eterm *nsp_end;
- const struct sdesc *sdesc;
- unsigned int sdesc_size;
- unsigned long ra;
- unsigned int i;
- unsigned int mask;
- /* arch-specific nstack walk state */
- struct nstack_walk_state walk_state;
-
- /* ma_gensweep-specific state */
- Eterm *low_water, *high_water, *surface;
- Eterm *n_htop;
- Eterm *old_htop;
-
- if (!nstack_walk_init_check(p))
- return;
-
- nsp = nstack_walk_nsp_begin(p);
- nsp_end = nstack_walk_nsp_end(p);
-
- low_water = global_heap;
- //high_water = global_high_water;
- surface = global_htop;
-
- old_htop = *ptr_old_htop;
- n_htop = *ptr_n_htop;
-
- sdesc = nstack_walk_init_sdesc(p, &walk_state);
-
- for (;;) {
- if (nstack_walk_nsp_reached_end(nsp, nsp_end)) {
- if (nsp == nsp_end) {
- *ptr_old_htop = old_htop;
- *ptr_n_htop = n_htop;
- return;
- }
- fprintf(stderr, "%s: passed end of stack\r\n", __FUNCTION__);
- break;
- }
- sdesc_size = nstack_walk_frame_size(sdesc);
- i = 0;
- mask = sdesc->livebits[0];
- for (;;) {
- if (mask & 1) {
- Eterm *nsp_i = nstack_walk_frame_index(nsp, i);
- Eterm gval = *nsp_i;
- if (is_boxed(gval)) {
- Eterm *ptr = boxed_val(gval);
- Eterm val = *ptr;
- if (MY_IS_MOVED(val)) {
- *nsp_i = val;
- } else if (ptr_within(ptr, low_water, high_water)) {
- MOVE_BOXED(ptr, val, old_htop, nsp_i);
- } else if (ptr_within(ptr, high_water, surface)) {
- MOVE_BOXED(ptr, val, n_htop, nsp_i);
- }
- } else if (is_list(gval)) {
- Eterm *ptr = list_val(gval);
- Eterm val = *ptr;
- if (is_non_value(val)) {
- *nsp_i = ptr[1];
- } else if (ptr_within(ptr, low_water, high_water)) {
- MOVE_CONS(ptr, val, old_htop, nsp_i);
- } else if (ptr_within(ptr, high_water, surface)) {
- MOVE_CONS(ptr, val, n_htop, nsp_i);
- }
- }
- }
- if (++i >= sdesc_size)
- break;
- if (i & 31)
- mask >>= 1;
- else
- mask = sdesc->livebits[i >> 5];
- }
- ra = nstack_walk_frame_ra(nsp, sdesc);
- if (ra == (unsigned long)nbif_stack_trap_ra)
- ra = (unsigned long)p->hipe.ngra;
- sdesc = hipe_find_sdesc(ra);
- nsp = nstack_walk_next_frame(nsp, sdesc_size);
- }
- abort();
-}
-
-#else /* not INCREMENTAL */
-
-Eterm *ma_fullsweep_nstack(Process *p, Eterm *n_htop)
-{
- /* known nstack walk state */
- Eterm *nsp;
- Eterm *nsp_end;
- const struct sdesc *sdesc;
- unsigned int sdesc_size;
- unsigned long ra;
- unsigned int i;
- unsigned int mask;
- /* arch-specific nstack walk state */
- struct nstack_walk_state walk_state;
-
- /* ma_fullsweep-specific state */
- Eterm *gheap = global_heap;
- Eterm *ghtop = global_htop;
- Eterm *goheap = global_old_heap;
- Eterm *gohtop = global_old_htop;
-
- if (!nstack_walk_init_check(p))
- return n_htop;
-
- nsp = nstack_walk_nsp_begin(p);
- nsp_end = nstack_walk_nsp_end(p);
-
- sdesc = nstack_walk_init_sdesc(p, &walk_state);
-
- for (;;) {
- if (nstack_walk_nsp_reached_end(nsp, nsp_end)) {
- if (nsp == nsp_end)
- return n_htop;
- fprintf(stderr, "%s: passed end of stack\r\n", __FUNCTION__);
- break;
- }
- sdesc_size = nstack_walk_frame_size(sdesc);
- i = 0;
- mask = sdesc->livebits[0];
- for (;;) {
- if (mask & 1) {
- Eterm *nsp_i = nstack_walk_frame_index(nsp, i);
- Eterm gval = *nsp_i;
- if (is_boxed(gval)) {
- Eterm *ptr = boxed_val(gval);
- Eterm val = *ptr;
- if (MY_IS_MOVED(val)) {
- *nsp_i = val;
- } else if (ptr_within(ptr, gheap, ghtop)) {
- MOVE_BOXED(ptr, val, n_htop, nsp_i);
- } else if (ptr_within(ptr, goheap, gohtop)) {
- MOVE_BOXED(ptr, val, n_htop, nsp_i);
- }
- } else if (is_list(gval)) {
- Eterm *ptr = list_val(gval);
- Eterm val = *ptr;
- if (is_non_value(val)) {
- *nsp_i = ptr[1];
- } else if (ptr_within(ptr, gheap, ghtop)) {
- MOVE_CONS(ptr, val, n_htop, nsp_i);
- } else if (ptr_within(ptr, gheap, ghtop)) {
- MOVE_CONS(ptr, val, n_htop, nsp_i);
- }
- }
- }
- if (++i >= sdesc_size)
- break;
- if (i & 31)
- mask >>= 1;
- else
- mask = sdesc->livebits[i >> 5];
- }
- ra = nstack_walk_frame_ra(nsp, sdesc);
- if (ra == (unsigned long)nbif_stack_trap_ra)
- ra = (unsigned long)p->hipe.ngra;
- sdesc = hipe_find_sdesc(ra);
- nsp = nstack_walk_next_frame(nsp, sdesc_size);
- }
- abort();
-}
-
-void ma_gensweep_nstack(Process *p, Eterm **ptr_old_htop, Eterm **ptr_n_htop)
-{
- /* known nstack walk state */
- Eterm *nsp;
- Eterm *nsp_end;
- const struct sdesc *sdesc;
- unsigned int sdesc_size;
- unsigned long ra;
- unsigned int i;
- unsigned int mask;
- /* arch-specific nstack walk state */
- struct nstack_walk_state walk_state;
-
- /* ma_gensweep-specific state */
- Eterm *low_water, *high_water, *surface;
- Eterm *n_htop;
- Eterm *old_htop;
-
- if (!nstack_walk_init_check(p))
- return;
-
- nsp = nstack_walk_nsp_begin(p);
- nsp_end = nstack_walk_nsp_end(p);
-
- low_water = global_heap;
- high_water = global_high_water;
- surface = global_htop;
-
- old_htop = *ptr_old_htop;
- n_htop = *ptr_n_htop;
-
- sdesc = nstack_walk_init_sdesc(p, &walk_state);
-
- for (;;) {
- if (nstack_walk_nsp_reached_end(nsp, nsp_end)) {
- if (nsp == nsp_end) {
- *ptr_old_htop = old_htop;
- *ptr_n_htop = n_htop;
- return;
- }
- fprintf(stderr, "%s: passed end of stack\r\n", __FUNCTION__);
- break;
- }
- sdesc_size = nstack_walk_frame_size(sdesc);
- i = 0;
- mask = sdesc->livebits[0];
- for (;;) {
- if (mask & 1) {
- Eterm *nsp_i = nstack_walk_frame_index(nsp, i);
- Eterm gval = *nsp_i;
- if (is_boxed(gval)) {
- Eterm *ptr = boxed_val(gval);
- Eterm val = *ptr;
- if (MY_IS_MOVED(val)) {
- *nsp_i = val;
- } else if (ptr_within(ptr, low_water, high_water)) {
- MOVE_BOXED(ptr, val, old_htop, nsp_i);
- } else if (ptr_within(ptr, high_water, surface)) {
- MOVE_BOXED(ptr, val, n_htop, nsp_i);
- }
- } else if (is_list(gval)) {
- Eterm *ptr = list_val(gval);
- Eterm val = *ptr;
- if (is_non_value(val)) {
- *nsp_i = ptr[1];
- } else if (ptr_within(ptr, low_water, high_water)) {
- MOVE_CONS(ptr, val, old_htop, nsp_i);
- } else if (ptr_within(ptr, high_water, surface)) {
- MOVE_CONS(ptr, val, n_htop, nsp_i);
- }
- }
- }
- if (++i >= sdesc_size)
- break;
- if (i & 31)
- mask >>= 1;
- else
- mask = sdesc->livebits[i >> 5];
- }
- ra = nstack_walk_frame_ra(nsp, sdesc);
- if (ra == (unsigned long)nbif_stack_trap_ra)
- ra = (unsigned long)p->hipe.ngra;
- sdesc = hipe_find_sdesc(ra);
- nsp = nstack_walk_next_frame(nsp, sdesc_size);
- }
- abort();
-}
-#endif /* INCREMENTAL */
-
-#endif /* HYBRID */
diff --git a/erts/emulator/hipe/hipe_mkliterals.c b/erts/emulator/hipe/hipe_mkliterals.c
index d07d14028c..cbbf1db2e5 100644
--- a/erts/emulator/hipe/hipe_mkliterals.c
+++ b/erts/emulator/hipe/hipe_mkliterals.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2012. 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
@@ -467,15 +467,11 @@ static const struct rts_param {
int value;
} rts_params[] = {
{ 1, "P_OFF_HEAP_FUNS",
-#if !defined(HYBRID)
1, offsetof(struct process, off_heap.first)
-#endif
},
{ 4, "EFT_NEXT",
-#if !defined(HYBRID)
1, offsetof(struct erl_fun_thing, next)
-#endif
},
/* These are always defined, but their values depend on the
diff --git a/erts/emulator/hipe/hipe_mode_switch.c b/erts/emulator/hipe/hipe_mode_switch.c
index 6a3ce5608f..3c782b2f56 100644
--- a/erts/emulator/hipe/hipe_mode_switch.c
+++ b/erts/emulator/hipe/hipe_mode_switch.c
@@ -360,7 +360,8 @@ Process *hipe_mode_switch(Process *p, unsigned cmd, Eterm reg[])
p->flags &= ~F_HIBERNATE_SCHED;
goto do_schedule;
}
- if (p->status == P_WAITING) {
+
+ if (!(erts_smp_atomic32_read_acqb(&p->state) & ERTS_PSFLG_ACTIVE)) {
for (i = 0; i < p->arity; ++i)
p->arg_reg[i] = reg[i];
goto do_schedule;
@@ -451,10 +452,6 @@ Process *hipe_mode_switch(Process *p, unsigned cmd, Eterm reg[])
case HIPE_MODE_SWITCH_RES_SUSPEND: {
p->i = hipe_beam_pc_resume;
p->arity = 0;
- erts_smp_proc_lock(p, ERTS_PROC_LOCK_STATUS);
- if (p->status != P_SUSPENDED)
- erts_add_to_runq(p);
- erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
goto do_schedule;
}
case HIPE_MODE_SWITCH_RES_WAIT:
@@ -470,7 +467,8 @@ Process *hipe_mode_switch(Process *p, unsigned cmd, Eterm reg[])
#endif
p->i = hipe_beam_pc_resume;
p->arity = 0;
- p->status = P_WAITING;
+ erts_smp_atomic32_read_band_relb(&p->state,
+ ~ERTS_PSFLG_ACTIVE);
erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_MSG_RECEIVE);
do_schedule:
{
diff --git a/erts/emulator/hipe/hipe_native_bif.h b/erts/emulator/hipe/hipe_native_bif.h
index 9e3a156fbc..3f460a5a5c 100644
--- a/erts/emulator/hipe/hipe_native_bif.h
+++ b/erts/emulator/hipe/hipe_native_bif.h
@@ -110,6 +110,9 @@ int hipe_bs_put_big_integer(Eterm, Uint, byte*, unsigned, unsigned);
AEXTERN(Eterm,nbif_check_get_msg,(Process*));
Eterm hipe_check_get_msg(Process*);
+AEXTERN(BIF_RETTYPE,nbif_hipe_bifs_debug_native_called,(Process*,Eterm,Eterm));
+BIF_RETTYPE hipe_bifs_debug_native_called_2(BIF_ALIST_2);
+
/*
* SMP-specific stuff
*/
diff --git a/erts/emulator/hipe/hipe_ppc_bifs.m4 b/erts/emulator/hipe/hipe_ppc_bifs.m4
index d09551d10d..7cc2b5c7b6 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2012. 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
@@ -32,12 +32,12 @@ include(`hipe/hipe_ppc_asm.m4')
.text
.p2align 2
-define(TEST_GOT_MBUF,`LOAD r4, P_MBUF(P) # `TEST_GOT_MBUF'
+define(TEST_GOT_MBUF,`LOAD r4, P_MBUF(P) /* `TEST_GOT_MBUF' */
CMPI r4, 0
bne- 3f
2:')
define(HANDLE_GOT_MBUF,`
-3: bl CSYM(nbif_$1_gc_after_bif) # `HANDLE_GOT_MBUF'
+3: bl CSYM(nbif_$1_gc_after_bif) /* `HANDLE_GOT_MBUF' */
b 2b')
@@ -62,7 +62,7 @@ ASYM($1):
/* Save caller-save registers and call the C function. */
SAVE_CONTEXT_BIF
- STORE r4, P_ARG0(r3) # Store BIF__ARGS in def_arg_reg[]
+ STORE r4, P_ARG0(r3) /* Store BIF__ARGS in def_arg_reg[] */
addi r4, r3, P_ARG0
CALL_BIF($2)
TEST_GOT_MBUF
@@ -92,7 +92,7 @@ ASYM($1):
/* Save caller-save registers and call the C function. */
SAVE_CONTEXT_BIF
- STORE r4, P_ARG0(r3) # Store BIF__ARGS in def_arg_reg[]
+ STORE r4, P_ARG0(r3) /* Store BIF__ARGS in def_arg_reg[] */
STORE r5, P_ARG1(r3)
addi r4, r3, P_ARG0
CALL_BIF($2)
@@ -124,7 +124,7 @@ ASYM($1):
/* Save caller-save registers and call the C function. */
SAVE_CONTEXT_BIF
- STORE r4, P_ARG0(r3) # Store BIF__ARGS in def_arg_reg[]
+ STORE r4, P_ARG0(r3) /* Store BIF__ARGS in def_arg_reg[] */
STORE r5, P_ARG1(r3)
STORE r6, P_ARG2(r3)
addi r4, r3, P_ARG0
@@ -214,7 +214,7 @@ ASYM($1):
/* Save caller-save registers and call the C function. */
SAVE_CONTEXT_GC
- STORE r4, P_ARG0(r3) # Store BIF__ARGS in def_arg_reg[]
+ STORE r4, P_ARG0(r3) /* Store BIF__ARGS in def_arg_reg[] */
addi r4, r3, P_ARG0
CALL_BIF($2)
TEST_GOT_MBUF
@@ -244,7 +244,7 @@ ASYM($1):
/* Save caller-save registers and call the C function. */
SAVE_CONTEXT_GC
- STORE r4, P_ARG0(r3) # Store BIF__ARGS in def_arg_reg[]
+ STORE r4, P_ARG0(r3) /* Store BIF__ARGS in def_arg_reg[] */
STORE r5, P_ARG1(r3)
addi r4, r3, P_ARG0
CALL_BIF($2)
diff --git a/erts/emulator/hipe/hipe_primops.h b/erts/emulator/hipe/hipe_primops.h
index 38509c105b..52b4681cfe 100644
--- a/erts/emulator/hipe/hipe_primops.h
+++ b/erts/emulator/hipe/hipe_primops.h
@@ -80,6 +80,7 @@ PRIMOP_LIST(am_fclearerror_error, &nbif_fclearerror_error)
#ifdef NO_FPE_SIGNALS
PRIMOP_LIST(am_emulate_fpe, &nbif_emulate_fpe)
#endif
+PRIMOP_LIST(am_debug_native_called, &nbif_hipe_bifs_debug_native_called)
#if defined(__sparc__)
#include "hipe_sparc_primops.h"
diff --git a/erts/emulator/hipe/hipe_stack.c b/erts/emulator/hipe/hipe_stack.c
index da462a64e1..53c316ba52 100644
--- a/erts/emulator/hipe/hipe_stack.c
+++ b/erts/emulator/hipe/hipe_stack.c
@@ -130,7 +130,7 @@ struct sdesc *hipe_decode_sdesc(Eterm arg)
struct sdesc *sdesc;
if (is_not_tuple(arg) ||
- (tuple_val(arg))[0] != make_arityval(5) ||
+ (tuple_val(arg))[0] != make_arityval(6) ||
term_to_Uint((tuple_val(arg))[1], &ra) == 0 ||
term_to_Uint((tuple_val(arg))[2], &exnra) == 0 ||
is_not_small((tuple_val(arg))[3]) ||
@@ -183,5 +183,13 @@ struct sdesc *hipe_decode_sdesc(Eterm arg)
off = unsigned_val(live[i]);
sdesc->livebits[off / 32] |= (1 << (off & 31));
}
+#ifdef DEBUG
+ {
+ Eterm mfa_tpl = tuple_val(arg)[6];
+ sdesc->dbg_M = tuple_val(mfa_tpl)[1];
+ sdesc->dbg_F = tuple_val(mfa_tpl)[2];
+ sdesc->dbg_A = tuple_val(mfa_tpl)[3];
+ }
+#endif
return sdesc;
}
diff --git a/erts/emulator/hipe/hipe_stack.h b/erts/emulator/hipe/hipe_stack.h
index 4c14b4a519..66f9f04c73 100644
--- a/erts/emulator/hipe/hipe_stack.h
+++ b/erts/emulator/hipe/hipe_stack.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2001-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2012. 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
@@ -35,6 +35,10 @@ struct sdesc {
struct sdesc *next; /* hash collision chain */
} bucket;
unsigned int summary; /* frame size, exn handler presence flag, arity */
+#ifdef DEBUG
+ Eterm dbg_M, dbg_F;
+ unsigned dbg_A;
+#endif
unsigned int livebits[1]; /* size depends on arch & data in summary field */
};
@@ -116,13 +120,4 @@ extern int hipe_fill_stacktrace(Process*, int, Eterm**);
extern Eterm *fullsweep_nstack(Process *p, Eterm *n_htop);
extern void gensweep_nstack(Process *p, Eterm **ptr_old_htop, Eterm **ptr_n_htop);
-#ifdef HYBRID
-#ifdef INCREMENTAL
-extern Eterm *ma_fullsweep_nstack(Process *p, Eterm *n_htop, Eterm *n_hend);
-#else
-extern Eterm *ma_fullsweep_nstack(Process *p, Eterm *n_htop);
-#endif
-extern void ma_gensweep_nstack(Process *p, Eterm **ptr_old_htop, Eterm **ptr_n_htop);
-#endif /* HYBRID */
-
#endif /* HIPE_STACK_H */
diff --git a/erts/emulator/hipe/hipe_x86_gc.h b/erts/emulator/hipe/hipe_x86_gc.h
index e4607ad27d..aa4abb6f59 100644
--- a/erts/emulator/hipe/hipe_x86_gc.h
+++ b/erts/emulator/hipe/hipe_x86_gc.h
@@ -69,6 +69,11 @@ nstack_walk_init_sdesc(const Process *p, struct nstack_walk_state *state)
nstkarity = 0;
state->sdesc0[0].summary = (0 << 9) | (0 << 8) | nstkarity;
state->sdesc0[0].livebits[0] = 0;
+# ifdef DEBUG
+ state->sdesc0[0].dbg_M = 0;
+ state->sdesc0[0].dbg_F = am_init;
+ state->sdesc0[0].dbg_A = 0;
+# endif
/* XXX: this appears to prevent a gcc-4.1.1 bug on x86 */
__asm__ __volatile__("" : : "m"(*state) : "memory");
return &state->sdesc0[0];
diff --git a/erts/emulator/hipe/hipe_x86_glue.h b/erts/emulator/hipe/hipe_x86_glue.h
index b0db93267c..63ad250d60 100644
--- a/erts/emulator/hipe/hipe_x86_glue.h
+++ b/erts/emulator/hipe/hipe_x86_glue.h
@@ -62,6 +62,9 @@ static __inline__ void hipe_arch_glue_init(void)
.sdesc = {
.bucket = { .hvalue = (unsigned long)nbif_return },
.summary = (1<<8),
+ #ifdef DEBUG
+ .dbg_F = am_return,
+ #endif
},
};
hipe_init_sdesc_table(&nbif_return_sdesc.sdesc);
diff --git a/erts/emulator/sys/common/erl_check_io.c b/erts/emulator/sys/common/erl_check_io.c
index 23a4bf1b04..ce014c19c2 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2012. 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
@@ -36,9 +36,9 @@
#include "global.h"
#include "erl_check_io.h"
#include "erl_thr_progress.h"
+#include "dtrace-wrapper.h"
#ifdef ERTS_SYS_CONTINOUS_FD_NUMBERS
-# define ERTS_DRV_EV_STATE_EXTRA_SIZE 128
#else
# include "safe_hash.h"
# define DRV_EV_STATE_HTAB_SIZE 1024
@@ -314,6 +314,7 @@ forget_removed(struct pollset_info* psi)
erts_smp_mtx_unlock(mtx);
if (drv_ptr) {
int was_unmasked = erts_block_fpe();
+ DTRACE1(driver_stop_select, drv_ptr->name);
(*drv_ptr->stop_select) ((ErlDrvEvent) fd, NULL);
erts_unblock_fpe(was_unmasked);
if (drv_ptr->handle) {
@@ -332,7 +333,9 @@ static void
grow_drv_ev_state(int min_ix)
{
int i;
- int new_len = min_ix + 1 + ERTS_DRV_EV_STATE_EXTRA_SIZE;
+ int new_len;
+
+ new_len = ERTS_POLL_EXPORT(erts_poll_get_table_len)(min_ix + 1);
if (new_len > max_fds)
new_len = max_fds;
@@ -496,6 +499,9 @@ ERTS_CIO_EXPORT(driver_select)(ErlDrvPort ix,
ErtsDrvEventState *state;
int wake_poller;
int ret;
+#ifdef USE_VM_PROBES
+ DTRACE_CHARBUF(name, 64);
+#endif
ERTS_SMP_LC_ASSERT(erts_drvport2port(ix)
&& erts_lc_is_port_locked(erts_drvport2port(ix)));
@@ -525,6 +531,10 @@ ERTS_CIO_EXPORT(driver_select)(ErlDrvPort ix,
if (IS_FD_UNKNOWN(state)) {
/* fast track to stop_select callback */
stop_select_fn = erts_drvport2port(ix)->drv_ptr->stop_select;
+#ifdef USE_VM_PROBES
+ strncpy(name, erts_drvport2port(ix)->drv_ptr->name, sizeof(name)-1);
+ name[sizeof(name)-1] = '\0';
+#endif
ret = 0;
goto done_unknown;
}
@@ -661,6 +671,10 @@ ERTS_CIO_EXPORT(driver_select)(ErlDrvPort ix,
/* Safe to close fd now as it is not in pollset
or there was no need to eject fd (kernel poll) */
stop_select_fn = drv_ptr->stop_select;
+#ifdef USE_VM_PROBES
+ strncpy(name, erts_drvport2port(ix)->drv_ptr->name, sizeof(name)-1);
+ name[sizeof(name)-1] = '\0';
+#endif
}
else {
/* Not safe to close fd, postpone stop_select callback. */
@@ -686,6 +700,7 @@ done_unknown:
erts_smp_mtx_unlock(fd_mtx(fd));
if (stop_select_fn) {
int was_unmasked = erts_block_fpe();
+ DTRACE1(driver_stop_select, name);
(*stop_select_fn)(e, NULL);
erts_unblock_fpe(was_unmasked);
}
diff --git a/erts/emulator/sys/common/erl_poll.c b/erts/emulator/sys/common/erl_poll.c
index 3817b1e4d5..a523d67158 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2012. 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
@@ -55,17 +55,12 @@
# ifdef SYS_SELECT_H
# include <sys/select.h>
# endif
-# ifdef VXWORKS
-# include <selectLib.h>
-# endif
#endif
-#ifndef VXWORKS
-# ifdef NO_SYSCONF
-# if ERTS_POLL_USE_SELECT
-# include <sys/param.h>
-# else
-# include <limits.h>
-# endif
+#ifdef NO_SYSCONF
+# if ERTS_POLL_USE_SELECT
+# include <sys/param.h>
+# else
+# include <limits.h>
# endif
#endif
#include "erl_thr_progress.h"
@@ -105,8 +100,8 @@
#define ERTS_POLL_COALESCE_KP_RES (ERTS_POLL_USE_KQUEUE || ERTS_POLL_USE_EPOLL)
-#define FDS_STATUS_EXTRA_FREE_SIZE 128
-#define POLL_FDS_EXTRA_FREE_SIZE 128
+#define ERTS_EV_TABLE_MIN_LENGTH 1024
+#define ERTS_EV_TABLE_EXP_THRESHOLD (2048*1024)
#ifdef ERTS_POLL_NEED_ASYNC_INTERRUPT_SUPPORT
# define ERTS_POLL_ASYNC_INTERRUPT_SUPPORT 1
@@ -563,6 +558,28 @@ free_update_requests_block(ErtsPollSet ps,
* --- Growing poll set structures -------------------------------------------
*/
+int
+ERTS_POLL_EXPORT(erts_poll_get_table_len) (int new_len)
+{
+ if (new_len < ERTS_EV_TABLE_MIN_LENGTH) {
+ new_len = ERTS_EV_TABLE_MIN_LENGTH;
+ } else if (new_len < ERTS_EV_TABLE_EXP_THRESHOLD) {
+ /* find next power of 2 */
+ --new_len;
+ new_len |= new_len >> 1;
+ new_len |= new_len >> 2;
+ new_len |= new_len >> 4;
+ new_len |= new_len >> 8;
+ new_len |= new_len >> 16;
+ ++new_len;
+ } else {
+ /* grow incrementally */
+ new_len += ERTS_EV_TABLE_EXP_THRESHOLD;
+ }
+ return new_len;
+}
+
+
#if ERTS_POLL_USE_KERNEL_POLL
static void
grow_res_events(ErtsPollSet ps, int new_len)
@@ -575,7 +592,7 @@ grow_res_events(ErtsPollSet ps, int new_len)
#elif ERTS_POLL_USE_KQUEUE
struct kevent
#endif
- )*new_len;
+ ) * ERTS_POLL_EXPORT(erts_poll_get_table_len)(new_len);
/* We do not need to save previously stored data */
if (ps->res_events)
erts_free(ERTS_ALC_T_POLL_RES_EVS, ps->res_events);
@@ -589,7 +606,7 @@ static void
grow_poll_fds(ErtsPollSet ps, int min_ix)
{
int i;
- int new_len = min_ix + 1 + POLL_FDS_EXTRA_FREE_SIZE;
+ int new_len = ERTS_POLL_EXPORT(erts_poll_get_table_len)(min_ix + 1);
if (new_len > max_fds)
new_len = max_fds;
ps->poll_fds = (ps->poll_fds_len
@@ -611,7 +628,7 @@ static void
grow_fds_status(ErtsPollSet ps, int min_fd)
{
int i;
- int new_len = min_fd + 1 + FDS_STATUS_EXTRA_FREE_SIZE;
+ int new_len = ERTS_POLL_EXPORT(erts_poll_get_table_len)(min_fd + 1);
ASSERT(min_fd < max_fds);
if (new_len > max_fds)
new_len = max_fds;
@@ -2143,7 +2160,7 @@ ERTS_POLL_EXPORT(erts_poll_wait)(ErtsPollSet ps,
void
ERTS_POLL_EXPORT(erts_poll_interrupt)(ErtsPollSet ps, int set)
{
-#if defined(USE_THREADS)
+#if defined(USE_THREADS) || ERTS_POLL_ASYNC_INTERRUPT_SUPPORT
if (!set)
reset_wakeup_state(ps);
else
@@ -2200,10 +2217,6 @@ ERTS_POLL_EXPORT(erts_poll_max_fds)(void)
* --- Initialization --------------------------------------------------------
*/
-#ifdef VXWORKS
-extern int erts_vxworks_max_files;
-#endif
-
void
ERTS_POLL_EXPORT(erts_poll_init)(void)
{
@@ -2212,9 +2225,7 @@ ERTS_POLL_EXPORT(erts_poll_init)(void)
errno = 0;
-#if defined(VXWORKS)
- max_fds = erts_vxworks_max_files;
-#elif !defined(NO_SYSCONF)
+#if !defined(NO_SYSCONF)
max_fds = sysconf(_SC_OPEN_MAX);
#elif ERTS_POLL_USE_SELECT
max_fds = NOFILE;
diff --git a/erts/emulator/sys/common/erl_poll.h b/erts/emulator/sys/common/erl_poll.h
index 8dde619105..502290e4bb 100644
--- a/erts/emulator/sys/common/erl_poll.h
+++ b/erts/emulator/sys/common/erl_poll.h
@@ -246,4 +246,6 @@ void ERTS_POLL_EXPORT(erts_poll_get_selected_events)(ErtsPollSet,
ErtsPollEvents [],
int);
+int ERTS_POLL_EXPORT(erts_poll_get_table_len)(int);
+
#endif /* #ifndef ERL_POLL_H__ */
diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c
index f94e0f2296..97756e8434 100644
--- a/erts/emulator/sys/unix/sys.c
+++ b/erts/emulator/sys/unix/sys.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -551,7 +551,7 @@ erl_sys_init(void)
size_t bindirsz = sizeof(bindir);
Uint csp_path_sz;
- res = erts_sys_getenv("BINDIR", bindir, &bindirsz);
+ res = erts_sys_getenv_raw("BINDIR", bindir, &bindirsz);
if (res != 0) {
if (res < 0)
erl_exit(-1,
@@ -570,7 +570,7 @@ erl_sys_init(void)
+ 1);
child_setup_prog = erts_alloc(ERTS_ALC_T_CS_PROG_PATH, csp_path_sz);
erts_smp_atomic_add_nob(&sys_misc_mem_sz, csp_path_sz);
- sprintf(child_setup_prog,
+ erts_snprintf(child_setup_prog, csp_path_sz,
"%s%c%s",
bindir,
DIR_SEPARATOR_CHAR,
@@ -708,7 +708,7 @@ prepare_crash_dump(void)
}
envsz = sizeof(env);
- i = erts_sys_getenv("ERL_CRASH_DUMP_NICE", env, &envsz);
+ i = erts_sys_getenv_raw("ERL_CRASH_DUMP_NICE", env, &envsz);
if (i >= 0) {
int nice_val;
nice_val = i != 0 ? 0 : atoi(env);
@@ -719,7 +719,7 @@ prepare_crash_dump(void)
}
envsz = sizeof(env);
- i = erts_sys_getenv("ERL_CRASH_DUMP_SECONDS", env, &envsz);
+ i = erts_sys_getenv_raw("ERL_CRASH_DUMP_SECONDS", env, &envsz);
if (i >= 0) {
unsigned sec;
sec = (unsigned) i != 0 ? 0 : atoi(env);
@@ -1163,6 +1163,8 @@ static int set_driver_data(int port_num,
report_exit_list = report_exit;
}
+ erts_port[port_num].os_pid = pid;
+
if (read_write & DO_READ) {
driver_data[ifd].packet_bytes = packet_bytes;
driver_data[ifd].port_num = port_num;
@@ -1354,9 +1356,9 @@ static ErlDrvData spawn_start(ErlDrvPort port_num, char* name, SysDriverOpts* op
int no_vfork;
size_t no_vfork_sz = sizeof(no_vfork);
- no_vfork = (erts_sys_getenv("ERL_NO_VFORK",
- (char *) &no_vfork,
- &no_vfork_sz) >= 0);
+ no_vfork = (erts_sys_getenv_raw("ERL_NO_VFORK",
+ (char *) &no_vfork,
+ &no_vfork_sz) >= 0);
#endif
switch (opts->read_write) {
@@ -1530,12 +1532,13 @@ static ErlDrvData spawn_start(ErlDrvPort port_num, char* name, SysDriverOpts* op
}
#if !DISABLE_VFORK
}
+#define ENOUGH_BYTES (44)
else { /* Use vfork() */
char **cs_argv= erts_alloc(ERTS_ALC_T_TMP,(CS_ARGV_NO_OF_ARGS + 1)*
sizeof(char *));
- char fd_close_range[44]; /* 44 bytes are enough to */
- char dup2_op[CS_ARGV_NO_OF_DUP2_OPS][44]; /* hold any "%d:%d" string */
- /* on a 64-bit machine. */
+ char fd_close_range[ENOUGH_BYTES]; /* 44 bytes are enough to */
+ char dup2_op[CS_ARGV_NO_OF_DUP2_OPS][ENOUGH_BYTES]; /* hold any "%d:%d" string */
+ /* on a 64-bit machine. */
/* Setup argv[] for the child setup program (implemented in
erl_child_setup.c) */
@@ -1543,23 +1546,23 @@ static ErlDrvData spawn_start(ErlDrvPort port_num, char* name, SysDriverOpts* op
if (opts->use_stdio) {
if (opts->read_write & DO_READ){
/* stdout for process */
- sprintf(&dup2_op[i++][0], "%d:%d", ifd[1], 1);
+ erts_snprintf(&dup2_op[i++][0], ENOUGH_BYTES, "%d:%d", ifd[1], 1);
if(opts->redir_stderr)
/* stderr for process */
- sprintf(&dup2_op[i++][0], "%d:%d", ifd[1], 2);
+ erts_snprintf(&dup2_op[i++][0], ENOUGH_BYTES, "%d:%d", ifd[1], 2);
}
if (opts->read_write & DO_WRITE)
/* stdin for process */
- sprintf(&dup2_op[i++][0], "%d:%d", ofd[0], 0);
+ erts_snprintf(&dup2_op[i++][0], ENOUGH_BYTES, "%d:%d", ofd[0], 0);
} else { /* XXX will fail if ofd[0] == 4 (unlikely..) */
if (opts->read_write & DO_READ)
- sprintf(&dup2_op[i++][0], "%d:%d", ifd[1], 4);
+ erts_snprintf(&dup2_op[i++][0], ENOUGH_BYTES, "%d:%d", ifd[1], 4);
if (opts->read_write & DO_WRITE)
- sprintf(&dup2_op[i++][0], "%d:%d", ofd[0], 3);
+ erts_snprintf(&dup2_op[i++][0], ENOUGH_BYTES, "%d:%d", ofd[0], 3);
}
for (; i < CS_ARGV_NO_OF_DUP2_OPS; i++)
strcpy(&dup2_op[i][0], "-");
- sprintf(fd_close_range, "%d:%d", opts->use_stdio ? 3 : 5, max_files-1);
+ erts_snprintf(fd_close_range, ENOUGH_BYTES, "%d:%d", opts->use_stdio ? 3 : 5, max_files-1);
cs_argv[CS_ARGV_PROGNAME_IX] = child_setup_prog;
cs_argv[CS_ARGV_WD_IX] = opts->wd ? opts->wd : ".";
@@ -1610,6 +1613,7 @@ static ErlDrvData spawn_start(ErlDrvPort port_num, char* name, SysDriverOpts* op
}
erts_free(ERTS_ALC_T_TMP,cs_argv);
}
+#undef ENOUGH_BYTES
#endif
erts_sched_bind_atfork_parent(unbind);
@@ -2353,28 +2357,38 @@ void erts_do_break_handling(void)
** no interpretatione of this should be done by the rest of the
** emulator. The buffer should be at least 21 bytes long.
*/
-void sys_get_pid(char *buffer){
+void sys_get_pid(char *buffer, size_t buffer_size){
pid_t p = getpid();
/* Assume the pid is scalar and can rest in an unsigned long... */
- sprintf(buffer,"%lu",(unsigned long) p);
+ erts_snprintf(buffer, buffer_size, "%lu",(unsigned long) p);
}
int
-erts_sys_putenv(char *buffer, int sep_ix)
+erts_sys_putenv_raw(char *key, char *value) {
+ return erts_sys_putenv(key, value);
+}
+int
+erts_sys_putenv(char *key, char *value)
{
int res;
char *env;
+ Uint need = strlen(key) + strlen(value) + 2;
+
#ifdef HAVE_COPYING_PUTENV
- env = buffer;
+ env = erts_alloc(ERTS_ALC_T_TMP, need);
#else
- Uint sz = strlen(buffer)+1;
- env = erts_alloc(ERTS_ALC_T_PUTENV_STR, sz);
- erts_smp_atomic_add_nob(&sys_misc_mem_sz, sz);
- strcpy(env,buffer);
+ env = erts_alloc(ERTS_ALC_T_PUTENV_STR, need);
+ erts_smp_atomic_add_nob(&sys_misc_mem_sz, need);
#endif
+ strcpy(env,key);
+ strcat(env,"=");
+ strcat(env,value);
erts_smp_rwmtx_rwlock(&environ_rwmtx);
res = putenv(env);
erts_smp_rwmtx_rwunlock(&environ_rwmtx);
+#ifdef HAVE_COPYING_PUTENV
+ erts_free(ERTS_ALC_T_TMP, env);
+#endif
return res;
}
@@ -2401,6 +2415,11 @@ erts_sys_getenv__(char *key, char *value, size_t *size)
}
int
+erts_sys_getenv_raw(char *key, char *value, size_t *size) {
+ return erts_sys_getenv(key, value, size);
+}
+
+int
erts_sys_getenv(char *key, char *value, size_t *size)
{
int res;
@@ -2999,7 +3018,7 @@ erl_sys_args(int* argc, char** argv)
if (erts_use_kernel_poll) {
char no_kp[10];
size_t no_kp_sz = sizeof(no_kp);
- int res = erts_sys_getenv("ERL_NO_KERNEL_POLL", no_kp, &no_kp_sz);
+ int res = erts_sys_getenv_raw("ERL_NO_KERNEL_POLL", no_kp, &no_kp_sz);
if (res > 0
|| (res == 0
&& sys_strcmp("false", no_kp) != 0
diff --git a/erts/emulator/sys/unix/sys_float.c b/erts/emulator/sys/unix/sys_float.c
index 8ec7b31ce0..3fcb4d88dc 100644
--- a/erts/emulator/sys/unix/sys_float.c
+++ b/erts/emulator/sys/unix/sys_float.c
@@ -745,18 +745,18 @@ void erts_sys_unblock_fpe(int unmasked)
*/
int
-sys_double_to_chars(double fp, char *buf)
+sys_double_to_chars(double fp, char *buffer, size_t buffer_size)
{
- char *s = buf;
+ char *s = buffer;
- (void) sprintf(buf, "%.20e", fp);
+ (void) erts_snprintf(buffer, buffer_size, "%.20e", fp);
/* Search upto decimal point */
if (*s == '+' || *s == '-') s++;
while (ISDIGIT(*s)) s++;
if (*s == ',') *s++ = '.'; /* Replace ',' with '.' */
/* Scan to end of string */
while (*s) s++;
- return s-buf; /* i.e strlen(buf) */
+ return s-buffer; /* i.e strlen(buffer) */
}
/* Float conversion */
diff --git a/erts/emulator/sys/vxworks/erl_main.c b/erts/emulator/sys/vxworks/erl_main.c
deleted file mode 100644
index c9b44a635a..0000000000
--- a/erts/emulator/sys/vxworks/erl_main.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 2000-2009. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-#include "sys.h"
-#include "erl_vm.h"
-
-#if defined(__GNUC__)
-/*
- * The generated assembler does the usual trick (relative
- * branch-and-link to next instruction) to get a copy of the
- * instruction ptr. Instead of branching to an explicit zero offset,
- * it branches to the symbol `__eabi' --- which is expected to be
- * undefined and thus zero (if it is defined as non-zero, things will
- * be interesting --- as in the Chinese curse). To shut up the VxWorks
- * linker, we define `__eabi' as zero.
- *
- * This is just a work around. It's really Wind River's GCC's code
- * generator that should be fixed.
- */
-__asm__(".equ __eabi, 0");
-#endif
-
-void
-erl_main(int argc, char **argv)
-{
- erl_start(argc, argv);
-}
diff --git a/erts/emulator/sys/vxworks/erl_vxworks_sys.h b/erts/emulator/sys/vxworks/erl_vxworks_sys.h
deleted file mode 100644
index 3d53238ea6..0000000000
--- a/erts/emulator/sys/vxworks/erl_vxworks_sys.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 1997-2011. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-#ifndef __ERL_VXWORKS_SYS_H__
-#define __ERL_VXWORKS_SYS_H__
-
-/* stdarg.h don't work without this one... */
-#include <vxWorks.h>
-
-#include <stdio.h>
-#include <math.h>
-#include <limits.h>
-#include <stdlib.h>
-#define index StringIndexFunctionThatIDontWantDeclared
-#include <string.h>
-#undef index
-
-
-
-#include <sys/times.h>
-#include <time.h>/* xxxP */
-
-#include <dirent.h>
-#include <sys/stat.h>
-
-/* xxxP from unix_sys.h begin */
-
-/*
- * Make sure that MAXPATHLEN is defined.
- */
-
-#ifndef MAXPATHLEN
-# ifdef PATH_MAX
-# define MAXPATHLEN PATH_MAX
-# else
-# define MAXPATHLEN 2048
-# endif
-#endif
-
-/* xxxP end */
-
-
-/* Unimplemented math functions */
-#define NO_ASINH
-#define NO_ACOSH
-#define NO_ATANH
-#define NO_ERF
-#define NO_ERFC
-
-/* Stuff that is useful for port programs, drivers, etc */
-#ifndef VXWORKS
-#define VXWORKS
-#endif
-
-#define DONT_USE_MAIN
-#define NO_FSYNC
-#define NO_MKDIR_MODE
-#define NO_UMASK
-#define NO_SYMBOLIC_LINKS
-#define NO_DEVICE_FILES
-#define NO_UID
-#define NO_ACCESS
-#define NO_FCNTL
-#define NO_SYSLOG
-#define NO_SYSCONF
-#define NO_PWD /* XXX Means what? */
-#define NO_DAEMON
-/* This chooses ~250 reductions instead of 500 in config.h */
-#if (CPU == CPU32)
-#define SLOW_PROCESSOR
-#endif
-
-/*
- * Even though we does not always have small memories on VxWorks
- * we certainly does not have virtual memory.
- */
-#if !defined(LARGE_MEMORY)
-#define SMALL_MEMORY
-#endif
-
-/*************** Floating point exception handling ***************/
-
-/* There are no known ways to customize the handling of invalid floating
- point operations, such as matherr() or ieee_handler(), in VxWorks 5.1. */
-
-#if (CPU == MC68040 || CPU == CPU32 || CPU == PPC860 || CPU == PPC32 || \
- CPU == PPC603 || CPU == PPC604 || CPU == SIMSPARCSOLARIS)
-
-/* VxWorks 5.1 on Motorola 68040 never generates SIGFPE, but sets the
- result of invalid floating point ops to Inf and NaN - unfortunately
- the way to test for those values is undocumented and hidden in a
- "private" include file... */
-/* Haven't found any better way, as of yet, for ppc860 xxxP*/
-
-#include <private/mathP.h>
-#define NO_FPE_SIGNALS
-#define erts_get_current_fp_exception() NULL
-#define __ERTS_FP_CHECK_INIT(fpexnp) do {} while (0)
-#define __ERTS_FP_ERROR(fpexnp, f, Action) if (isInf(f) || isNan(f)) { Action; } else {}
-#define __ERTS_FP_ERROR_THOROUGH(fpexnp, f, Action) __ERTS_FP_ERROR(fpexnp, f, Action)
-#define __ERTS_SAVE_FP_EXCEPTION(fpexnp)
-#define __ERTS_RESTORE_FP_EXCEPTION(fpexnp)
-
-#define ERTS_FP_CHECK_INIT(p) __ERTS_FP_CHECK_INIT(&(p)->fp_exception)
-#define ERTS_FP_ERROR(p, f, A) __ERTS_FP_ERROR(&(p)->fp_exception, f, A)
-#define ERTS_SAVE_FP_EXCEPTION(p) __ERTS_SAVE_FP_EXCEPTION(&(p)->fp_exception)
-#define ERTS_RESTORE_FP_EXCEPTION(p) __ERTS_RESTORE_FP_EXCEPTION(&(p)->fp_exception)
-#define ERTS_FP_ERROR_THOROUGH(p, f, A) __ERTS_FP_ERROR_THOROUGH(&(p)->fp_exception, f, A)
-
-#define erts_sys_block_fpe() 0
-#define erts_sys_unblock_fpe(x) do{}while(0)
-
-#if (CPU == PPC603)
-/* Need fppLib to change the Floating point registers
- (fix_registers in sys.c)*/
-
-#include <fppLib.h>
-
-#endif /* PPC603 */
-
-#else
-
-Unsupported CPU value !
-
-#endif
-
-typedef void *GETENV_STATE;
-
-#define HAVE_GETHRTIME
-
-extern int erts_clock_rate;
-
-#define SYS_CLK_TCK (erts_clock_rate)
-
-#define SYS_CLOCK_RESOLUTION 1
-
-typedef struct _vxworks_tms {
- clock_t tms_utime;
- clock_t tms_stime;
- clock_t tms_cutime;
- clock_t tms_cstime;
-} SysTimes;
-
-typedef long long SysHrTime;
-
-typedef time_t erts_time_t;
-typedef struct timeval SysTimeval;
-
-extern int sys_init_hrtime(void);
-extern SysHrTime sys_gethrtime(void);
-extern void sys_gettimeofday(SysTimeval *tvp);
-extern clock_t sys_times(SysTimes *t);
-
-#define SIZEOF_SHORT 2
-#define SIZEOF_INT 4
-#define SIZEOF_LONG 4
-#define SIZEOF_VOID_P 4
-#define SIZEOF_SIZE_T 4
-#define SIZEOF_OFF_T 4
-
-/*
- * Temporary buffer *only* used in sys code.
- */
-#define SYS_TMP_BUF_SIZE 65536
-
-/* Need to be able to interrupt erts_poll_wait() from signal handler */
-#define ERTS_POLL_NEED_ASYNC_INTERRUPT_SUPPORT
-
-#endif /* __ERL_VXWORKS_SYS_H__ */
diff --git a/erts/emulator/sys/vxworks/erl_vxworks_sys_ddll.c b/erts/emulator/sys/vxworks/erl_vxworks_sys_ddll.c
deleted file mode 100644
index c56c633b2f..0000000000
--- a/erts/emulator/sys/vxworks/erl_vxworks_sys_ddll.c
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 2006-2009. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-
-/*
- * Interface functions to the dynamic linker using dl* functions.
- * (As far as I know it works on SunOS 4, 5, Linux and FreeBSD. /Seb)
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-#include <vxWorks.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <a_out.h>
-#include <symLib.h>
-#include <loadLib.h>
-#include <unldLib.h>
-#include <moduleLib.h>
-#include <sysSymTbl.h>
-#include "sys.h"
-#include "global.h"
-#include "erl_alloc.h"
-#include "erl_driver.h"
-
-#define EXT_LEN 4
-#define FILE_EXT ".eld"
-#define ALT_FILE_EXT ".o"
-/* ALT_FILE_EXT must not be longer than FILE_EXT */
-#define DRIVER_INIT_SUFFIX "_init"
-
-static MODULE_ID get_mid(char *);
-static FUNCPTR lookup(char *);
-
-typedef enum {
- NoError,
- ModuleNotFound,
- ModuleNotUnloadable,
- UnknownError
-} FakeSytemError;
-
-static char *errcode_tab[] = {
- "No error",
- "Module/file not found",
- "Module cannot be unloaded",
- "Unknown error"
-};
-
-void erl_sys_ddll_init(void) {
- return;
-}
-/*
- * Open a shared object
- */
-int erts_sys_ddll_open2(char *full_name, void **handle, ErtsSysDdllError* err)
-{
- int len;
-
- if (erts_sys_ddll_open_noext(full_name, handle, err) == ERL_DE_NO_ERROR) {
- return ERL_DE_NO_ERROR;
- }
- if ((len = sys_strlen(full_name)) > PATH_MAX-EXT_LEN) {
- return ERL_DE_LOAD_ERROR_NAME_TO_LONG;
- } else {
- static char dlname[PATH_MAX + 1];
-
- sys_strcpy(dlname, full_name);
- sys_strcpy(dlname+len, FILE_EXT);
- if (erts_sys_ddll_open_noext(dlname, handle, err) == ERL_DE_NO_ERROR) {
- return ERL_DE_NO_ERROR;
- }
- sys_strcpy(dlname+len, ALT_FILE_EXT);
- return erts_sys_ddll_open_noext(dlname, handle, err);
- }
-}
-int erts_sys_ddll_open_noext(char *dlname, void **handle, ErtsSysDdllError* err)
-{
- MODULE_ID mid;
-
- if((mid = get_mid(dlname)) == NULL) {
- return ERL_DE_DYNAMIC_ERROR_OFFSET - ((int) ModuleNotFound);
- }
- *handle = (void *) mid;
- return ERL_DE_NO_ERROR;
-}
-
-/*
- * Find a symbol in the shared object
- */
-#define PREALLOC_BUFFER_SIZE 256
-int erts_sys_ddll_sym2(void *handle, char *func_name, void **function, ErtsSysDdllError* err)
-{
- FUNCPTR proc;
- static char statbuf[PREALLOC_BUFFER_SIZE];
- char *buf = statbuf;
- int need;
-
- if ((proc = lookup(func_name)) == NULL) {
- if ((need = strlen(func_name)+2) > PREALLOC_BUFFER_SIZE) {
- buf = erts_alloc(ERTS_ALC_T_DDLL_TMP_BUF,need);
- }
- buf[0] = '_';
- sys_strcpy(buf+1,func_name);
- proc = lookup(buf);
- if (buf != statbuf) {
- erts_free(ERTS_ALC_T_DDLL_TMP_BUF, buf);
- }
- if (proc == NULL) {
- return ERL_DE_LOOKUP_ERROR_NOT_FOUND;
- }
- }
- *function = (void *) proc;
- return ERL_DE_NO_ERROR;
-}
-
-/* XXX:PaN These two will be changed with new driver interface! */
-
-/*
- * Load the driver init function, might appear under different names depending on object arch...
- */
-
-int erts_sys_ddll_load_driver_init(void *handle, void **function)
-{
- MODULE_ID mid = (MODULE_ID) handle;
- char *modname;
- char *cp;
- static char statbuf[PREALLOC_BUFFER_SIZE];
- char *fname = statbuf;
- int len;
- int res;
- void *func;
- int need;
-
- if((modname = moduleNameGet(mid)) == NULL) {
- return ERL_DE_DYNAMIC_ERROR_OFFSET - ((int) ModuleNotFound);
- }
-
- if((cp = strrchr(modname, '.')) == NULL) {
- len = strlen(modname);
- } else {
- len = cp - modname;
- }
-
- need = len + strlen(DRIVER_INIT_SUFFIX) + 1;
- if (need > PREALLOC_BUFFER_SIZE) {
- fname = erts_alloc(ERTS_ALC_T_DDLL_TMP_BUF, need); /* erts_alloc exits on failure */
- }
- sys_strncpy(fname, modname, len);
- fname[len] = '\0';
- sys_strcat(fname, DRIVER_INIT_SUFFIX);
- res = erts_sys_ddll_sym(handle, fname, &func);
- if (fname != statbuf) {
- erts_free(ERTS_ALC_T_DDLL_TMP_BUF, fname);
- }
- if ( res != ERL_DE_NO_ERROR) {
- return res;
- }
- *function = func;
- return ERL_DE_NO_ERROR;
-}
-
-int erts_sys_ddll_load_nif_init(void *handle, void **function, ErtsSysDdllError* err)
-{
- /* NIFs not implemented for vxworks */
- return ERL_DE_ERROR_NO_DDLL_FUNCTIONALITY;
-}
-
-/*
- * Call the driver_init function, whatever it's really called, simple on unix...
-*/
-void *erts_sys_ddll_call_init(void *function) {
- void *(*initfn)(void) = function;
- return (*initfn)();
-}
-void *erts_sys_ddll_call_nif_init(void *function) {
- return erts_sys_ddll_call_init(function);
-}
-
-
-/*
- * Close a chared object
- */
-int erts_sys_ddll_close2(void *handle, ErtsSysDdllError* err)
-{
- MODULE_ID mid = (MODULE_ID) handle;
- if (unld(mid, 0) < 0) {
- return ERL_DE_DYNAMIC_ERROR_OFFSET - ((int) ModuleNotUnloadable);
- }
- return ERL_DE_NO_ERROR;
-}
-
-/*
- * Return string that describes the (current) error
- */
-char *erts_sys_ddll_error(int code)
-{
- int actual_code;
- if (code > ERL_DE_DYNAMIC_ERROR_OFFSET) {
- return "Unspecified error";
- }
- actual_code = -1*(code - ERL_DE_DYNAMIC_ERROR_OFFSET);
- if (actual_code > ((int) UnknownError)) {
- actual_code = UnknownError;
- }
- return errcode_tab[actual_code];
-}
-
-static FUNCPTR lookup(char *sym)
-{
- FUNCPTR entry;
- SYM_TYPE type;
-
- if (symFindByNameAndType(sysSymTbl, sym, (char **)&entry,
- &type, N_EXT | N_TEXT, N_EXT | N_TEXT) != OK) {
- return NULL ;
- }
- return entry;
-}
-
-static MODULE_ID get_mid(char* name)
-{
- int fd;
- MODULE_ID mid = NULL;
-
- if((fd = open(name, O_RDONLY, 0664)) >= 0) {
- mid = loadModule(fd, GLOBAL_SYMBOLS);
- close(fd);
- }
- return mid;
-}
-
-void erts_sys_ddll_free_error(ErtsSysDdllError* err)
-{
- /* NYI */
-}
-
diff --git a/erts/emulator/sys/vxworks/sys.c b/erts/emulator/sys/vxworks/sys.c
deleted file mode 100644
index 739b026fb1..0000000000
--- a/erts/emulator/sys/vxworks/sys.c
+++ /dev/null
@@ -1,2610 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 1997-2011. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-/*
- * system-dependent functions
- *
- */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-#include <vxWorks.h>
-#include <version.h>
-#include <string.h>
-#include <types.h>
-#include <sigLib.h>
-#include <ioLib.h>
-#include <iosLib.h>
-#include <envLib.h>
-#include <fioLib.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <symLib.h>
-#include <sysLib.h>
-#include <sysSymTbl.h>
-#include <loadLib.h>
-#include <taskLib.h>
-#include <taskVarLib.h>
-#include <taskHookLib.h>
-#include <tickLib.h>
-#include <time.h>
-#include <rngLib.h>
-#include <semLib.h>
-#include <selectLib.h>
-#include <sockLib.h>
-#include <a_out.h>
-#include <wdLib.h>
-#include <timers.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <stdarg.h>
-
-
-#ifndef WANT_NONBLOCKING
-#define WANT_NONBLOCKING
-#endif
-
-#include "sys.h"
-#include "erl_alloc.h"
-
-/* don't need global.h, but bif_table.h (included by bif.h) won't compile otherwise */
-#include "global.h"
-#include "bif.h"
-
-#include "erl_sys_driver.h"
-
-#include "elib_stat.h"
-
-#include "reclaim_private.h" /* Some more or less private reclaim facilities */
-
-#ifndef RETSIGTYPE
-#define RETSIGTYPE void
-#endif
-
-EXTERN_FUNCTION(void, erl_start, (int, char**));
-EXTERN_FUNCTION(void, erl_exit, (int n, char*, _DOTS_));
-EXTERN_FUNCTION(void, erl_error, (char*, va_list));
-EXTERN_FUNCTION(int, driver_interrupt, (int, int));
-EXTERN_FUNCTION(void, increment_time, (int));
-EXTERN_FUNCTION(int, erts_next_time, (_VOID_));
-EXTERN_FUNCTION(void, set_reclaim_free_function, (FreeFunction));
-EXTERN_FUNCTION(int, erl_mem_info_get, (MEM_PART_STATS *));
-EXTERN_FUNCTION(void, erl_crash_dump, (char* file, int line, char* fmt, ...));
-
-#define ISREG(st) (((st).st_mode&S_IFMT) == S_IFREG)
-
-/* these are defined in usrLib.c */
-extern int spTaskPriority, spTaskOptions;
-
-/* forward declarations */
-static FUNCTION(FUNCPTR, lookup, (char*));
-static FUNCTION(int, read_fill, (int, char*, int));
-#if (CPU == SPARC)
-static FUNCTION(RETSIGTYPE, fpe_sig_handler, (int)); /*where is this fun? */
-#elif (CPU == PPC603)
-static FUNCTION(void, fix_registers, (void));
-#endif
-static FUNCTION(void, close_pipes, (int*, int*, int));
-static FUNCTION(void, delete_hook, (void));
-static FUNCTION(void, initialize_allocation, (void));
-
-FUNCTION(STATUS, uxPipeDrv, (void));
-FUNCTION(STATUS, pipe, (int*));
-FUNCTION(void, uxPipeShow, (int));
-
-void erl_main(int argc, char **argv);
-void argcall(char *args);
-
-/* Malloc-realted functions called from the VxWorks shell */
-EXTERN_FUNCTION(int, erl_set_memory_block,
- (int, int, int, int, int, int, int, int, int, int));
-EXTERN_FUNCTION(int, erl_memory_show,
- (int, int, int, int, int, int, int, int, int, int));
-
-#define DEFAULT_PORT_STACK_SIZE 100000
-static int port_stack_size;
-
-static int erlang_id = 0; /* Inited at loading, set/reset at each run */
-
-/* interval time reported to emulator */
-static int sys_itime;
-
-/* XXX - This is defined in .../config/all/configAll.h (NUM_FILES),
- and not easily accessible at compile or run time - however,
- in VxWorks 5.1 it is stored in the (undocumented?) maxFiles variable;
- probably shouldn't depend on it, but we try to pick it up... */
-static int max_files = 50; /* default configAll.h */
-
-int erts_vxworks_max_files;
-
-/*
- * used by the break handler (set by signal handler on ctl-c)
- */
-volatile int erts_break_requested;
-
-/********************* General functions ****************************/
-
-/*
- * Reset the terminal to the original settings on exit
- * (nothing to do for WxWorks).
- */
-void sys_tty_reset(int exit_code)
-{
-}
-
-Uint
-erts_sys_misc_mem_sz(void)
-{
- Uint res = erts_check_io_size();
- /* res += FIXME */
- return res;
-}
-
-/*
- * XXX This declaration should not be here.
- */
-void erl_sys_schedule_loop(void);
-
-#ifdef SOFTDEBUG
-static void do_trace(int line, char *file, char *format, ...)
-{
- va_list va;
- int tid = taskIdSelf();
- char buff[512];
-
- va_start(va, format);
- sprintf(buff,"Trace: Task: 0x%08x, %s:%d - ",
- tid, file, line);
- vsprintf(buff + strlen(buff), format, va);
- va_end(va);
- strcat(buff,"\r\n");
- write(2,buff,strlen(buff));
-}
-
-#define TRACE() do_trace(__LINE__, __FILE__,"")
-#define TRACEF(Args...) do_trace(__LINE__,__FILE__, ## Args)
-#endif
-
-void
-erts_sys_pre_init(void)
-{
- if (erlang_id != 0) {
- /* NOTE: This particular case must *not* call erl_exit() */
- erts_fprintf(stderr, "Sorry, erlang is already running (as task %d)\n",
- erlang_id);
- exit(1);
- }
-
- /* This must be done as early as possible... */
- if(!reclaim_init())
- fprintf(stderr, "Warning : reclaim facility should be initiated before "
- "erlang is started!\n");
- erts_vxworks_max_files = max_files = reclaim_max_files();
-
- /* Floating point exceptions */
-#if (CPU == SPARC)
- sys_sigset(SIGFPE, fpe_sig_handler);
-#elif (CPU == PPC603)
- fix_registers();
-#endif
-
- /* register the private delete hook in reclaim */
- save_delete_hook((FUNCPTR)delete_hook, (caddr_t)0);
- erlang_id = taskIdSelf();
-#ifdef DEBUG
- printf("emulator task id = 0x%x\n", erlang_id);
-#endif
-}
-
-void erts_sys_alloc_init(void)
-{
- initialize_allocation();
-}
-
-void
-erl_sys_init(void)
-{
- setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ);
- /* XXX Bug in VxWorks stdio loses fputch()'ed output after the
- setvbuf() but before a *printf(), and possibly worse (malloc
- errors, crash?) - so let's give it a *printf().... */
- fprintf(stdout, "%s","");
-}
-
-void
-erl_sys_args(int* argc, char** argv)
-{
- erts_init_check_io();
- max_files = erts_check_io_max_files();
- ASSERT(max_files <= erts_vxworks_max_files);
-}
-
-void
-erts_sys_schedule_interrupt(int set)
-{
- erts_check_io_interrupt(set);
-}
-
-/*
- * Called from schedule() when it runs out of runnable processes,
- * or when Erlang code has performed INPUT_REDUCTIONS reduction
- * steps. runnable == 0 iff there are no runnable Erlang processes.
- */
-void
-erl_sys_schedule(int runnable)
-{
- erts_check_io(!runnable);
-}
-
-void erts_do_break_handling(void)
-{
- SET_BLOCKING(0);
- /* call the break handling function, reset the flag */
- do_break();
- erts_break_requested = 0;
- SET_NONBLOCKING(0);
-}
-
-/* signal handling */
-RETSIGTYPE (*sys_sigset(sig, func))()
- int sig;
- RETSIGTYPE (*func)();
-{
- struct sigaction act, oact;
-
- sigemptyset(&act.sa_mask);
- act.sa_flags = 0;
- act.sa_handler = func;
- sigaction(sig, &act, &oact);
- return(oact.sa_handler);
-}
-
-void sys_sigblock(int sig)
-{
- sigset_t mask;
-
- sigemptyset(&mask);
- sigaddset(&mask, sig);
- sigprocmask(SIG_BLOCK, &mask, (sigset_t *)NULL);
-}
-
-void sys_sigrelease(int sig)
-{
- sigset_t mask;
-
- sigemptyset(&mask);
- sigaddset(&mask, sig);
- sigprocmask(SIG_UNBLOCK, &mask, (sigset_t *)NULL);
-}
-
-void
-erts_sys_prepare_crash_dump(void)
-{
-
-}
-
-/* register signal handlers XXX - they don't work, need to find out why... */
-/* set up signal handlers for break and quit */
-static void request_break(void)
-{
- /* just set a flag - checked for and handled
- * in main thread (not signal handler).
- * see check_io()
- */
-#ifdef DEBUG
- fprintf(stderr,"break!\n");
-#endif
- erts_break_requested = 1;
- erts_check_io_async_sig_interrupt(1); /* Make sure we don't sleep in erts_poll_wait */
-}
-
-static void do_quit(void)
-{
- halt_0(0);
-}
-
-void erts_set_ignore_break(void) {
-}
-
-void init_break_handler(void)
-{
- sys_sigset(SIGINT, request_break);
- sys_sigset(SIGQUIT, do_quit);
-}
-
-void erts_replace_intr(void) {
-}
-
-int sys_max_files(void)
-{
- return(max_files);
-}
-
-/******************* Routines for time measurement *********************/
-
-int sys_init_time(void)
-{
- erts_clock_rate = sysClkRateGet();
- /*
- ** One could imagine that it would be better returning
- ** a resolution more near the clock rate, like in:
- ** return 1000 / erts_clock_rate;
- ** but tests show that such isn't the case (rounding errors?)
- ** Well, we go for the Unix variant of returning 1
- ** as a constant virtual clock rate.
- */
- return SYS_CLOCK_RESOLUTION;
-}
-
-int erts_clock_rate;
-static volatile int ticks_inuse;
-static volatile unsigned long ticks_collected; /* will wrap */
-static WDOG_ID watchdog_id;
-static ULONG user_time;
-static int this_task_id, sys_itime;
-static SysHrTime hrtime_wrap;
-static unsigned long last_tick_count;
-
-static void tolerant_time_clockint(int count)
-{
- if (watchdog_id != NULL) {
- if (taskIsReady(this_task_id))
- user_time += 1;
- ++count;
- if (!ticks_inuse) {
- ticks_collected += count;
- count = 0;
- }
- wdStart(watchdog_id, 1, (FUNCPTR)tolerant_time_clockint, count);
- }
-}
-
-int sys_init_hrtime(void)
-{
- this_task_id = taskIdSelf(); /* OK, this only works for one single task
- in the system... */
- user_time = 0;
-
- ticks_inuse = 0;
- ticks_collected = 0;
- hrtime_wrap = 0;
- last_tick_count = 0;
-
- sys_itime = 1000 / erts_clock_rate;
- watchdog_id = wdCreate();
- wdStart(watchdog_id, 1, (FUNCPTR) tolerant_time_clockint, 0);
- return 0;
-}
-
-SysHrTime sys_gethrtime(void)
-{
- SysHrTime ticks;
-
- ++ticks_inuse;
- ticks = (SysHrTime) (ticks_collected & 0x7FFFFFFF);
- ticks_inuse = 0;
- if (ticks < (SysHrTime) last_tick_count) {
- hrtime_wrap += 1UL << 31;
- }
- last_tick_count = ticks;
- return (ticks + hrtime_wrap) * ((SysHrTime) (1000000000UL /
- erts_clock_rate));
-}
-
-void sys_gettimeofday(SysTimeval *tvp)
-{
- struct timespec now;
-
- clock_gettime(CLOCK_REALTIME, &now);
- tvp->tv_sec = now.tv_sec;
- tvp->tv_usec = now.tv_nsec / 1000;
-}
-
-clock_t sys_times(SysTimes *t)
-{
- t->tms_stime = t->tms_cutime = t->tms_cstime = 0;
- ++ticks_inuse;
- t->tms_utime = user_time;
- ticks_inuse = 0;
- return tickGet(); /* The best we can do... */
-}
-
-/* This is called when *this task* is deleted */
-static void delete_hook(void)
-{
- if (watchdog_id != NULL) {
- wdDelete(watchdog_id);
- watchdog_id = NULL;
- }
- erlang_id = 0;
- this_task_id = 0;
-}
-
-/************************** OS info *******************************/
-
-/* Used by erlang:info/1. */
-/* (This code was formerly in drv.XXX/XXX_os_drv.c) */
-
-#define MAX_VER_STR 9 /* Number of characters to
- consider in version string */
-
-static FUNCTION(int, get_number, (char** str_ptr));
-
-char os_type[] = "vxworks";
-
-static int
-get_number(char **str_ptr)
-{
- char* s = *str_ptr; /* Pointer to beginning of string. */
- char* dot; /* Pointer to dot in string or NULL. */
-
- if (!isdigit(*s))
- return 0;
- if ((dot = strchr(s, '.')) == NULL) {
- *str_ptr = s+strlen(s);
- return atoi(s);
- } else {
- *dot = '\0';
- *str_ptr = dot+1;
- return atoi(s);
- }
-}
-
-/* namebuf; Where to return the name. */
-/* size; Size of name buffer. */
-void
-os_flavor(char *namebuf, unsigned size)
-{
- strcpy(namebuf, "-");
-}
-
-/* int* pMajor; Pointer to major version. */
-/* int* pMinor; Pointer to minor version. */
-/* int* pBuild; Pointer to build number. */
-void
-os_version(int *pMajor, int *pMinor, int *pBuild)
-{
- char os_ver[MAX_VER_STR+2];
- char* release; /* Pointer to the release string:
- * X.Y or X.Y.Z.
- */
- strncpy(os_ver, vxWorksVersion, MAX_VER_STR);
- release = os_ver;
- *pMajor = get_number(&release);
- *pMinor = get_number(&release);
- *pBuild = get_number(&release);
-}
-
-void init_getenv_state(GETENV_STATE *state)
-{
- *state = NULL;
-}
-
-char *getenv_string(GETENV_STATE *state0)
-{
- return NULL;
-}
-
-void fini_getenv_state(GETENV_STATE *state)
-{
- *state = NULL;
-}
-
-/************************** Port I/O *******************************/
-
-
-/* I. Common stuff */
-
-#define TMP_BUF_MAX (tmp_buf_size - 1024)
-static byte *tmp_buf;
-static Uint tmp_buf_size;
-
-/* II. The spawn/fd/vanilla drivers */
-
-/* This data is shared by these drivers - initialized by spawn_init() */
-static struct driver_data {
- int port_num, ofd, packet_bytes, report_exit;
- int exitcode, exit_reported; /* For returning of exit codes. */
-} *driver_data; /* indexed by fd */
-
-/*
- * Locking only for exitcodes and exit_reported, one global sem for all
- * spawn ports as this is rare.
- */
-static SEM_ID driver_data_sem = NULL;
-/*
- * Also locking when looking up entries in the load table
- */
-static SEM_ID entry_data_sem = NULL;
-
-/* We maintain a linked fifo queue of these structs in order */
-/* to manage unfinnished reads/and writes on differenet fd's */
-
-typedef struct pend {
- char *cpos;
- int fd;
- int remain;
- struct pend *next;
- char buf[1]; /* this is a trick to be able to malloc one chunk */
-} Pend;
-
-static struct fd_data {
- int inport, outport;
- char *buf, *cpos;
- int sz, remain; /* for input on fd */
- Pend* pending; /* pending outputs */
-
-} *fd_data; /* indexed by fd */
-
-
-/* Driver interfaces */
-static ErlDrvData spawn_start(ErlDrvPort port_num, char *name, SysDriverOpts* opts);
-static ErlDrvData fd_start(ErlDrvPort port_num, char *name, SysDriverOpts* opts);
-static ErlDrvData vanilla_start(ErlDrvPort port_num, char *name, SysDriverOpts* opts);
-static int spawn_init(void);
-static void fd_stop(ErlDrvData);
-static void stop(ErlDrvData);
-static void ready_input(ErlDrvData fd, ErlDrvEvent ready_fd);
-static void ready_output(ErlDrvData fd, ErlDrvEvent ready_fd);
-static void output(ErlDrvData fd, char *buf, ErlDrvSizeT len);
-static void stop_select(ErlDrvEvent, void*);
-
-struct erl_drv_entry spawn_driver_entry = {
- spawn_init,
- spawn_start,
- stop,
- output,
- ready_input,
- ready_output,
- "spawn",
- NULL, /* finish */
- NULL, /* handle */
- NULL, /* control */
- NULL, /* timeout */
- NULL, /* outputv */
- NULL, /* ready_async */
- NULL, /* flush */
- NULL, /* call */
- NULL, /* event */
- ERL_DRV_EXTENDED_MARKER,
- ERL_DRV_EXTENDED_MAJOR_VERSION,
- ERL_DRV_EXTENDED_MINOR_VERSION,
- 0, /* ERL_DRV_FLAGs */
- NULL, /* handle2 */
- NULL, /* process_exit */
- stop_select
-
-};
-struct erl_drv_entry fd_driver_entry = {
- NULL,
- fd_start,
- fd_stop,
- output,
- ready_input,
- ready_output,
- "fd",
- NULL, /* finish */
- NULL, /* handle */
- NULL, /* control */
- NULL, /* timeout */
- NULL, /* outputv */
- NULL, /* ready_async */
- NULL, /* flush */
- NULL, /* call */
- NULL, /* event */
- ERL_DRV_EXTENDED_MARKER,
- ERL_DRV_EXTENDED_MAJOR_VERSION,
- ERL_DRV_EXTENDED_MINOR_VERSION,
- 0, /* ERL_DRV_FLAGs */
- NULL, /* handle2 */
- NULL, /* process_exit */
- stop_select
-};
-struct erl_drv_entry vanilla_driver_entry = {
- NULL,
- vanilla_start,
- stop,
- output,
- ready_input,
- ready_output,
- "vanilla",
- NULL, /* finish */
- NULL, /* handle */
- NULL, /* control */
- NULL, /* timeout */
- NULL, /* outputv */
- NULL, /* ready_async */
- NULL, /* flush */
- NULL, /* call */
- NULL, /* event */
- ERL_DRV_EXTENDED_MARKER,
- ERL_DRV_EXTENDED_MAJOR_VERSION,
- ERL_DRV_EXTENDED_MINOR_VERSION,
- 0, /* ERL_DRV_FLAGs */
- NULL, /* handle2 */
- NULL, /* process_exit */
- stop_select
-};
-
-/*
-** Set up enough of the driver_data structure to be able to report exit status.
-** Some things may be initiated again, but that is no real problem.
-*/
-static int pre_set_driver_data(int ifd, int ofd,
- int read_write, int report_exit) {
- if (read_write & DO_READ) {
- driver_data[ifd].report_exit = report_exit;
- driver_data[ifd].exitcode = 0;
- driver_data[ifd].exit_reported = 0;
- if (read_write & DO_WRITE) {
- driver_data[ifd].ofd = ofd;
- if (ifd != ofd) {
- driver_data[ofd] = driver_data[ifd];
- driver_data[ofd].report_exit = 0;
- }
- } else { /* DO_READ only */
- driver_data[ifd].ofd = -1;
- }
- return(ifd);
- } else { /* DO_WRITE only */
- driver_data[ofd].report_exit = 0;
- driver_data[ofd].exitcode = 0;
- driver_data[ofd].exit_reported = 0;
- driver_data[ofd].ofd = ofd;
- return(ofd);
- }
-}
-
-/*
-** Set up the driver_data structure, it may have been initiated
-** partly by the function above, but we dont care.
-*/
-static int set_driver_data(int port_num, int ifd, int ofd,
- int packet_bytes, int read_write,
- int report_exit)
-{
- if (read_write & DO_READ) {
- driver_data[ifd].packet_bytes = packet_bytes;
- driver_data[ifd].port_num = port_num;
- driver_data[ifd].report_exit = report_exit;
- if (read_write & DO_WRITE) {
- driver_data[ifd].ofd = ofd;
- if (ifd != ofd) {
- driver_data[ofd] = driver_data[ifd];
- driver_data[ofd].report_exit = 0;
- }
- } else { /* DO_READ only */
- driver_data[ifd].ofd = -1;
- }
- (void) driver_select(port_num, ifd, ERL_DRV_READ|ERL_DRV_USE, 1);
- return(ifd);
- } else { /* DO_WRITE only */
- driver_data[ofd].packet_bytes = packet_bytes;
- driver_data[ofd].port_num = port_num;
- driver_data[ofd].report_exit = 0;
- driver_data[ofd].ofd = ofd;
- return(ofd);
- }
-}
-
-static int need_new_sems = 1;
-
-static int spawn_init(void)
-{
- char *stackenv;
- int size;
- driver_data = (struct driver_data *)
- erts_alloc(ERTS_ALC_T_DRV_TAB, max_files * sizeof(struct driver_data));
- if (need_new_sems) {
- driver_data_sem = semMCreate
- (SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE);
- entry_data_sem = semMCreate
- (SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE);
- }
- if (driver_data_sem == NULL || entry_data_sem == NULL) {
- erl_exit(1,"Could not allocate driver locking semaphore.");
- }
- need_new_sems = 0;
-
- (void)uxPipeDrv(); /* Install pipe driver */
-
- if ((stackenv = getenv("ERLPORTSTACKSIZE")) != NULL &&
- (size = atoi(stackenv)) > 0)
- port_stack_size = size;
- else
- port_stack_size = DEFAULT_PORT_STACK_SIZE;
- return 0;
-}
-
-/* Argv has to be built vith the save_xxx routines, not with whathever
- sys_xxx2 has in mind... */
-#define argv_alloc save_malloc
-#define argv_realloc save_realloc
-#define argv_free save_free
-/* Build argv, return argc or -1 on failure */
-static int build_argv(char *name, char ***argvp)
-{
- int argvsize = 10, argc = 0;
- char *args, *arglast = NULL, *argp;
- char **argv;
-
-#ifdef DEBUG
- fdprintf(2, "Building argv, %s =>\n", name);
-#endif
- if ((argv = (char **)argv_alloc(argvsize * sizeof(char *))) == NULL)
- return(-1);
- if ((args = argv_alloc(strlen(name) + 1)) == NULL)
- return(-1);
- strcpy(args, name);
- argp = strtok_r(args, " \t", &arglast);
- while (argp != NULL) {
- if (argc + 1 >= argvsize) {
- argvsize += 10;
- argv = (char **)argv_realloc((char *)argv, argvsize*sizeof(char *));
- if (argv == NULL) {
- argv_free(args);
- return(-1);
- }
- }
-#ifdef DEBUG
- fdprintf(2, "%s\n", argp);
-#endif
- argv[argc++] = argp;
- argp = strtok_r((char *)NULL, " \t", &arglast);
- }
- argv[argc] = NULL;
- *argvp = argv;
- return(argc);
-}
-#undef argv_alloc
-#undef argv_realloc
-#undef argv_free
-
-
-/* Lookup and return global text symbol or NULL on failure
- Symbol name is null-terminated and without the leading '_' */
-static FUNCPTR
-lookup(char *sym)
-{
- char buf[256];
- char *symname = buf;
- int len;
- FUNCPTR entry;
- SYM_TYPE type;
-
- len = strlen(sym);
- if (len > 254 && (symname = malloc(len+2)) == NULL)
- return(NULL);
-#if defined _ARCH_PPC || defined SIMSPARCSOLARIS
- /* GCC for PPC and SIMSPARC doesn't add a leading _ to symbols */
- strcpy(symname, sym);
-#else
- sprintf(symname, "_%s", sym);
-#endif
- if (symFindByNameAndType(sysSymTbl, symname, (char **)&entry,
- &type, N_EXT | N_TEXT, N_EXT | N_TEXT) != OK)
- entry = NULL;
- if (symname != buf)
- free(symname);
- return(entry);
-}
-
-/* This function is spawned to build argc, argv, lookup the symbol to call,
- connect and set up file descriptors, and make the actual call.
- N.B. 'name' was allocated by the Erlang task (through plain_malloc) and
- is freed by this port program task.
- Note: 'name' may be a path containing '/'. */
-
-static void call_proc(char *name, int ifd, int ofd, int read_write,
- int redir_stderr, int driver_index,
- int p6, int p7, int p8, int p9)
-{
- int argc;
- char **argv, *bname;
- FUNCPTR entry;
- int ret = -1;
-
- /* Must consume 'name' */
- argc = build_argv(name, &argv);
- plain_free(name);
- /* Find basename of path */
- if ((bname = strrchr(argv[0], '/')) != NULL) {
- bname++;
- } else {
- bname = argv[0];
- }
-#ifdef DEBUG
- fdprintf(2, "Port program name: %s\n", bname);
-#endif
- semTake(entry_data_sem, WAIT_FOREVER);
-
- if (argc > 0) {
- if ((entry = lookup(bname)) == NULL) {
- int fd;
- char *fn;
- /* NOTE: We don't check the return value of loadModule,
- since that was incompatibly changed from 5.0.2b to 5.1,
- but rather do a repeated lookup(). */
- if ((fd = open(argv[0], O_RDONLY)) > 0) {
- (void) loadModule(fd, GLOBAL_SYMBOLS);
- close(fd);
- entry = lookup(bname);
- }
- if (entry == NULL) {
- /* filename == func failed, try func.o */
- if ((fn = malloc(strlen(argv[0]) + 3)) != NULL) { /* ".o\0" */
- strcpy(fn, argv[0]);
- strcat(fn, ".o");
- if ((fd = open(fn, O_RDONLY)) > 0) {
- (void) loadModule(fd, GLOBAL_SYMBOLS);
- close(fd);
- entry = lookup(bname);
- }
- free(fn);
- }
- }
- }
- } else {
- entry = NULL;
- }
- semGive(entry_data_sem);
-
- if (read_write & DO_READ) { /* emulator read */
- save_fd(ofd);
- ioTaskStdSet(0, 1, ofd); /* stdout for process */
- if(redir_stderr)
- ioTaskStdSet(0, 2, ofd);/* stderr for process */
- }
- if (read_write & DO_WRITE) { /* emulator write */
- save_fd(ifd);
- ioTaskStdSet(0, 0, ifd); /* stdin for process */
- }
- if (entry != NULL) {
- ret = (*entry)(argc, argv, (char **)NULL); /* NULL for envp */
- } else {
- fdprintf(2, "Could not exec \"%s\"\n", argv[0]);
- ret = -1;
- }
- if (driver_data[driver_index].report_exit) {
- semTake(driver_data_sem, WAIT_FOREVER);
- driver_data[driver_index].exitcode = ret;
- driver_data[driver_index].exit_reported = 1;
- semGive(driver_data_sem);
- }
- /* We *don't* want to close the pipes here, but let the delete
- hook take care of it - it might want to flush stdout and there'd
- better be an open descriptor to flush to... */
- exit(ret);
-}
-
-static void close_pipes(int ifd[2], int ofd[2], int read_write)
-{
- if (read_write & DO_READ) {
- (void) close(ifd[0]);
- (void) close(ifd[1]);
- }
- if (read_write & DO_WRITE) {
- (void) close(ofd[0]);
- (void) close(ofd[1]);
- }
-}
-
-static void init_fd_data(int fd, int port_unused_argument)
-{
- SET_NONBLOCKING(fd);
- fd_data[fd].pending = NULL;
- fd_data[fd].buf = fd_data[fd].cpos = NULL;
- fd_data[fd].remain = fd_data[fd].sz = 0;
-}
-
-static ErlDrvData spawn_start(ErlDrvPort port_num, char *name,SysDriverOpts* opts)
-{
- int ifd[2], ofd[2], len, nl, id;
- char taskname[11], *progname, *bname;
- char *space_in_command;
- int packet_bytes = opts->packet_bytes;
- int read_write = opts->read_write;
- int use_stdio = opts->use_stdio;
- int redir_stderr = opts->redir_stderr;
- int driver_index;
-
- if (!use_stdio){
- return (ErlDrvData) -3;
- }
-
- /* Create pipes and set the Erlang task as owner of its
- * read and write ends (through save_fd()).
- */
- switch (read_write) {
- case DO_READ:
- if (pipe(ifd) < 0){
- return (ErlDrvData) -2;
- }
- if (ifd[0] >= max_files) {
- close_pipes(ifd, ofd, read_write);
- errno = ENFILE;
- return (ErlDrvData) -2;
- }
- save_fd(ifd[0]);
- break;
- case DO_WRITE:
- if (pipe(ofd) < 0) {
- return (ErlDrvData) -2;
- }
- if (ofd[1] >= max_files) {
- close_pipes(ifd, ofd, read_write);
- errno = ENFILE;
- return (ErlDrvData) -2;
- }
- save_fd(ofd[1]);
- break;
- case DO_READ|DO_WRITE:
- if (pipe(ifd) < 0){
- return (ErlDrvData) -2;
- }
- if (ifd[0] >= max_files || pipe(ofd) < 0) {
- close_pipes(ifd, ofd, DO_READ);
- errno = ENFILE;
- return (ErlDrvData) -2;
- }
- if (ofd[1] >= max_files) {
- close_pipes(ifd, ofd, read_write);
- errno = ENFILE;
- return (ErlDrvData) -2;
- }
- save_fd(ifd[0]);
- save_fd(ofd[1]);
- break;
- default:
- return (ErlDrvData) -1;
- }
-
- /* Allocate space for program name to be freed by the
- * spawned task. We use plain_malloc so that the allocated
- * space is not owned by the Erlang task.
- */
-
- if ((progname = plain_malloc(strlen(name) + 1)) == NULL) {
- close_pipes(ifd, ofd, read_write);
- errno = ENOMEM;
- return (ErlDrvData) -2;
- }
- strcpy(progname, name);
-
- /* Check if name contains a space
- * (e.g "port_test -o/home/gandalf/tornado/wind/target/erlang")
- */
- if ((space_in_command = strrchr(progname, ' ')) != NULL) {
- *space_in_command = '\0';
- }
-
- /* resulting in "port_test" */
- if ((bname = strrchr(progname, '/')) != NULL)
- bname++;
- else
- bname = progname;
-
- /* resulting in "port_test" */
- len = strlen(bname);
- nl = len > 10 ? 10 : len;
- strncpy(taskname, bname, nl);
- taskname[nl] = '\0';
- if (space_in_command != NULL)
- *space_in_command = ' ';
- driver_index = pre_set_driver_data(ifd[0], ofd[1],
- read_write, opts->exit_status);
-
- /* resetting to "port_test -o/home/gandalf/tornado/wind/target/erlang" */
- if ((id = taskSpawn(taskname, spTaskPriority, spTaskOptions,
- port_stack_size, (FUNCPTR)call_proc, (int)progname,
- ofd[0], ifd[1], read_write, redir_stderr, driver_index,
- 0,0,0,0))
- == ERROR) {
- close_pipes(ifd, ofd, read_write);
- plain_free(progname); /* only when spawn fails */
- errno = ENOMEM;
- return (ErlDrvData) -2;
- }
-#ifdef DEBUG
- fdprintf(2, "Spawned %s as %s[0x%x]\n", name, taskname, id);
-#endif
- if (read_write & DO_READ)
- init_fd_data(ifd[0], port_num);
- if (read_write & DO_WRITE)
- init_fd_data(ofd[1], port_num);
- return (ErlDrvData) (set_driver_data(port_num, ifd[0], ofd[1],
- packet_bytes,read_write,
- opts->exit_status));
-}
-
-static ErlDrvData fd_start(ErlDrvPort port_num, char *name, SysDriverOpts* opts)
-{
- if (((opts->read_write & DO_READ) && opts->ifd >= max_files) ||
- ((opts->read_write & DO_WRITE) && opts->ofd >= max_files)) {
- return (ErlDrvData) -1;
- }
-
- if (opts->read_write & DO_READ)
- init_fd_data(opts->ifd, port_num);
- if (opts->read_write & DO_WRITE)
- init_fd_data(opts->ofd, port_num);
- return (ErlDrvData) (set_driver_data(port_num, opts->ifd, opts->ofd,
- opts->packet_bytes, opts->read_write, 0));
-}
-
-static void clear_fd_data(int fd)
-{
-
- if (fd_data[fd].sz > 0)
- erts_free(ERTS_ALC_T_FD_ENTRY_BUF, (void *) fd_data[fd].buf);
- fd_data[fd].buf = NULL;
- fd_data[fd].sz = 0;
- fd_data[fd].remain = 0;
- fd_data[fd].cpos = NULL;
-}
-
-static void nbio_stop_fd(int port_num, int fd)
-{
- Pend *p, *p1;
-
- driver_select(port_num, fd, ERL_DRV_READ|ERL_DRV_WRITE, 0);
- clear_fd_data(fd);
- p = fd_data[fd].pending;
- SET_BLOCKING(fd);
- while (p) {
- p1 = p->next;
- free(p);
- p = p1;
- }
- fd_data[fd].pending = NULL;
-}
-
-static void fd_stop(ErlDrvData drv_data)
-{
- int ofd;
- int fd = (int) drv_data;
-
- nbio_stop_fd(driver_data[fd].port_num, (int)fd);
- ofd = driver_data[fd].ofd;
- if (ofd != fd && ofd != -1)
- nbio_stop_fd(driver_data[fd].port_num, (int)ofd); /* XXX fd = ofd? */
-}
-
-static ErlDrvData
-vanilla_start(ErlDrvPort port_num, char *name, SysDriverOpts* opts)
-{
- int flags, fd;
- struct stat statbuf;
-
- DEBUGF(("vanilla_start, name: %s [r=%1i w=%1i]\n", name,
- opts->read_write & DO_READ,
- opts->read_write & DO_WRITE));
-
- flags = (opts->read_write == DO_READ ? O_RDONLY :
- opts->read_write == DO_WRITE ? O_WRONLY|O_CREAT|O_TRUNC :
- O_RDWR|O_CREAT);
- if ((fd = open(name, flags, 0666)) < 0){
- errno = ENFILE;
- return (ErlDrvData) -2;
- }
- if (fd >= max_files) {
- close(fd);
- errno = ENFILE;
- return (ErlDrvData) -2;
- }
- if (fstat(fd, &statbuf) < 0) {
- close(fd);
- errno = ENFILE;
- return (ErlDrvData) -2;
- }
-
- /* Return error for reading regular files (doesn't work) */
- if (ISREG(statbuf) && ((opts->read_write) & DO_READ)) {
- close(fd);
- return (ErlDrvData) -3;
- }
- init_fd_data(fd, port_num);
- return (ErlDrvData) (set_driver_data(port_num, fd, fd,
- opts->packet_bytes, opts->read_write, 0));
-}
-
-/* Note that driver_data[fd].ifd == fd if the port was opened for reading, */
-/* otherwise (i.e. write only) driver_data[fd].ofd = fd. */
-
-static void stop(ErlDrvData drv_data)
-{
- int port_num, ofd;
- int fd = (int) drv_data;
-
- port_num = driver_data[fd].port_num;
- nbio_stop_fd(port_num, fd);
- driver_select(port_num, fd, ERL_DRV_USE, 0); /* close(fd) */
-
- ofd = driver_data[fd].ofd;
- if (ofd != fd && ofd != -1) {
- nbio_stop_fd(port_num, ofd);
- driver_select(port_num, ofd, ERL_DRV_USE, 0); /* close(fd) */
- }
-}
-
-static int sched_write(int port_num,int fd, char *buf, int len, int pb)
-{
- Pend *p, *p2, *p3;
- int p_bytes = len;
-
- p = (Pend*) erts_alloc_fnf(ERTS_ALC_T_PEND_DATA, pb + len + sizeof(Pend));
- if (!p) {
- driver_failure(port_num, -1);
- return(-1);
- }
-
- switch(pb) {
- case 4: put_int32(len, p->buf); break;
- case 2: put_int16(len, p->buf); break;
- case 1: put_int8(len, p->buf); break;
- case 0: break; /* Handles this case too */
- }
- sys_memcpy(p->buf + pb, buf, len);
- driver_select(port_num, fd, ERL_DRV_WRITE|ERL_DRV_USE, 1);
- p->cpos = p->buf;
- p->fd = fd;
- p->next = NULL;
- p->remain = len + pb;
- p2 = fd_data[fd].pending;
- if (p2 == NULL)
- fd_data[fd].pending = p;
- else {
- p3 = p2->next;
- while(p3) {
- p_bytes += p2->remain;
- p2 = p2->next;
- p3 = p3->next;
- }
- p2->next = p;
- }
- if (p_bytes > (1 << 13)) /* More than 8 k pending */
- set_busy_port(port_num, 1);
- return(0);
-}
-
-/* Fd is the value returned as drv_data by the start func */
-static void output(ErlDrvData drv_data, char *buf, ErlDrvSizeT len)
-{
- int buf_done, port_num, wval, pb, ofd;
- byte lb[4];
- struct iovec iv[2];
- int fd = (int) drv_data;
-
- pb = driver_data[fd].packet_bytes;
- port_num = driver_data[fd].port_num;
-
- if ((ofd = driver_data[fd].ofd) == -1) {
- return;
- }
-
- if (fd_data[ofd].pending) {
- sched_write(port_num, ofd, buf, len, pb);
- return;
- }
-
- if ((pb == 2 && len > 65535) || (pb == 1 && len > 255)) {
- driver_failure_posix(port_num, EINVAL);
- return;
- }
- if (pb == 0) {
- wval = write(ofd, buf, len);
- } else {
- lb[0] = (len >> 24) & 255; /* MSB */
- lb[1] = (len >> 16) & 255;
- lb[2] = (len >> 8) & 255;
- lb[3] = len & 255; /* LSB */
- iv[0].iov_base = (char*) lb + (4 - pb);
- iv[0].iov_len = pb;
- iv[1].iov_base = buf;
- iv[1].iov_len = len;
- wval = writev(ofd, iv, 2);
- }
- if (wval == pb + len ) {
- return;
- }
- if (wval < 0) {
- if ((errno == EINTR) || (errno == ERRNO_BLOCK)) {
- if (pb) {
- sched_write(port_num, ofd, buf ,len, pb);
- } else if (pb == 0) {
- sched_write(port_num, ofd, buf ,len, 0);
- }
- return;
- }
- driver_failure_posix(driver_data[fd].port_num, EINVAL);
- return;
- }
- if (wval < pb) {
- sched_write(port_num, ofd, (lb +4 -pb) + wval, pb-wval, 0);
- sched_write(port_num, ofd, buf ,len, 0);
- return;
- }
-
- /* we now know that wval < (pb + len) */
- buf_done = wval - pb;
- sched_write(port_num, ofd, buf + buf_done, len - buf_done,0);
-}
-
-static void stop_select(ErlDrvEvent fd, void* _)
-{
- close((int)fd);
-}
-
-static int ensure_header(int fd,char *buf,int packet_size, int sofar)
-{
- int res = 0;
- int remaining = packet_size - sofar;
-
- SET_BLOCKING(fd);
- if (read_fill(fd, buf+sofar, remaining) != remaining)
- return -1;
- switch (packet_size) {
- case 1: res = get_int8(buf); break;
- case 2: res = get_int16(buf); break;
- case 4: res = get_int32(buf); break;
- }
- SET_NONBLOCKING(fd);
- return(res);
-}
-
-static int port_inp_failure(int port_num, int ready_fd, int res)
-{
- (void) driver_select(port_num, ready_fd, ERL_DRV_READ|ERL_DRV_WRITE, 0);
- clear_fd_data(ready_fd);
- if (res == 0) {
- if (driver_data[ready_fd].report_exit) {
- int tmpexit = 0;
- int reported;
- /* Lock the driver_data structure */
- semTake(driver_data_sem, WAIT_FOREVER);
- if ((reported = driver_data[ready_fd].exit_reported))
- tmpexit = driver_data[ready_fd].exitcode;
- semGive(driver_data_sem);
- if (reported) {
- erts_fprintf(stderr,"Exitcode %d reported\r\n", tmpexit);
- driver_report_exit(port_num, tmpexit);
- }
- }
- driver_failure_eof(port_num);
- } else {
- driver_failure(port_num, res);
- }
- return 0;
-}
-
-/* fd is the drv_data that is returned from the */
-/* initial start routine */
-/* ready_fd is the descriptor that is ready to read */
-
-static void ready_input(ErlDrvData drv_data, ErlDrvEvent drv_event)
-{
- int port_num, packet_bytes, res;
- Uint h = 0;
- char *buf;
- int fd = (int) drv_data;
- int ready_fd = (int) drv_event;
-
- port_num = driver_data[fd].port_num;
- packet_bytes = driver_data[fd].packet_bytes;
-
- if (packet_bytes == 0) {
- if ((res = read(ready_fd, tmp_buf, tmp_buf_size)) > 0) {
- driver_output(port_num, (char*)tmp_buf, res);
- return;
- }
- port_inp_failure(port_num, ready_fd, res);
- return;
- }
-
- if (fd_data[ready_fd].remain > 0) { /* We try to read the remainder */
- /* space is allocated in buf */
- res = read(ready_fd, fd_data[ready_fd].cpos,
- fd_data[ready_fd].remain);
- if (res < 0) {
- if ((errno == EINTR) || (errno == ERRNO_BLOCK)) {
- ;
- } else {
- port_inp_failure(port_num, ready_fd, res);
- }
- } else if (res == 0) {
- port_inp_failure(port_num, ready_fd, res);
- } else if (res == fd_data[ready_fd].remain) { /* we're done */
- driver_output(port_num, fd_data[ready_fd].buf,
- fd_data[ready_fd].sz);
- clear_fd_data(ready_fd);
- } else { /* if (res < fd_data[ready_fd].remain) */
- fd_data[ready_fd].cpos += res;
- fd_data[ready_fd].remain -= res;
- }
- return;
- }
-
-
- if (fd_data[ready_fd].remain == 0) { /* clean fd */
- /* We make one read attempt and see what happens */
- res = read(ready_fd, tmp_buf, tmp_buf_size);
- if (res < 0) {
- if ((errno == EINTR) || (errno == ERRNO_BLOCK))
- return;
- port_inp_failure(port_num, ready_fd, res);
- return;
- }
- else if (res == 0) { /* eof */
- port_inp_failure(port_num, ready_fd, res);
- return;
- }
- else if (res < packet_bytes) { /* Ugly case... get at least */
- if ((h = ensure_header(ready_fd, tmp_buf, packet_bytes, res))==-1) {
- port_inp_failure(port_num, ready_fd, -1);
- return;
- }
- buf = erts_alloc_fnf(ERTS_ALC_T_FD_ENTRY_BUF, h);
- if (!buf) {
- port_inp_failure(port_num, ready_fd, -1);
- return;
- }
- fd_data[ready_fd].buf = buf;
- fd_data[ready_fd].sz = h;
- fd_data[ready_fd].remain = h;
- fd_data[ready_fd].cpos = buf;
- return;
- }
- else { /* if (res >= packet_bytes) */
- unsigned char* cpos = tmp_buf;
- int bytes_left = res;
- while (1) { /* driver_output as many as possible */
- if (bytes_left == 0) {
- clear_fd_data(ready_fd);
- return;
- }
- if (bytes_left < packet_bytes) { /* Yet an ugly case */
- if((h=ensure_header(ready_fd, cpos,
- packet_bytes, bytes_left))==-1) {
- port_inp_failure(port_num, ready_fd, -1);
- return;
- }
- buf = erts_alloc_fnf(ERTS_ALC_T_FD_ENTRY_BUF, h);
- if (!buf)
- port_inp_failure(port_num, ready_fd, -1);
- fd_data[ready_fd].buf = buf;
- fd_data[ready_fd].sz = h;
- fd_data[ready_fd].remain = h;
- fd_data[ready_fd].cpos = buf;
- return;
- }
- switch (packet_bytes) {
- case 1: h = get_int8(cpos); cpos += 1; break;
- case 2: h = get_int16(cpos); cpos += 2; break;
- case 4: h = get_int32(cpos); cpos += 4; break;
- }
- bytes_left -= packet_bytes;
- /* we've got the header, now check if we've got the data */
- if (h <= (bytes_left)) {
- driver_output(port_num, (char*) cpos, h);
- cpos += h;
- bytes_left -= h;
- continue;
- }
- else { /* The last message we got was split */
- buf = erts_alloc_fnf(ERTS_ALC_T_FD_ENTRY_BUF, h);
- if (!buf) {
- port_inp_failure(port_num, ready_fd, -1);
- }
- sys_memcpy(buf, cpos, bytes_left);
- fd_data[ready_fd].buf = buf;
- fd_data[ready_fd].sz = h;
- fd_data[ready_fd].remain = h - bytes_left;
- fd_data[ready_fd].cpos = buf + bytes_left;
- return;
- }
- }
- return;
- }
- }
- fprintf(stderr, "remain %d \n", fd_data[ready_fd].remain);
- port_inp_failure(port_num, ready_fd, -1);
-}
-
-
-/* fd is the drv_data that is returned from the */
-/* initial start routine */
-/* ready_fd is the descriptor that is ready to read */
-
-static void ready_output(ErlDrvData drv_data, ErlDrvEvent drv_event)
-{
- Pend *p;
- int wval;
-
- int fd = (int) drv_data;
- int ready_fd = (int) drv_event;
-
- while(1) {
- if ((p = fd_data[ready_fd].pending) == NULL) {
- driver_select(driver_data[fd].port_num, ready_fd,
- ERL_DRV_WRITE, 0);
- return;
- }
- wval = write(p->fd, p->cpos, p->remain);
- if (wval == p->remain) {
- fd_data[ready_fd].pending = p->next;
- erts_free(ERTS_ALC_T_PEND_DATA, p);
- if (fd_data[ready_fd].pending == NULL) {
- driver_select(driver_data[fd].port_num, ready_fd,
- ERL_DRV_WRITE, 0);
- set_busy_port(driver_data[fd].port_num, 0);
- return;
- }
- else
- continue;
- }
- else if (wval < 0) {
- if (errno == ERRNO_BLOCK || errno == EINTR)
- return;
- else {
- driver_select(driver_data[fd].port_num, ready_fd,
- ERL_DRV_WRITE, 0);
- driver_failure(driver_data[fd].port_num, -1);
- return;
- }
- }
- else if (wval < p->remain) {
- p->cpos += wval;
- p->remain -= wval;
- return;
- }
- }
-}
-
-/* Fills in the systems representation of the jam/beam process identifier.
-** The Pid is put in STRING representation in the supplied buffer,
-** no interpretatione of this should be done by the rest of the
-** emulator. The buffer should be at least 21 bytes long.
-*/
-void sys_get_pid(char *buffer){
- int p = taskIdSelf(); /* Hmm, may be negative??? requires some GB of
- memory to make the TCB address convert to a
- negative value. */
- sprintf(buffer,"%d", p);
-}
-
-int
-erts_sys_putenv(char *buffer, int sep_ix)
-{
- return putenv(buffer);
-}
-
-int
-erts_sys_getenv(char *key, char *value, size_t *size)
-{
- char *orig_value;
- int res;
- orig_value = getenv(key);
- if (!orig_value)
- res = -1;
- else {
- size_t len = sys_strlen(orig_value);
- if (len >= *size) {
- *size = len + 1;
- res = 1;
- }
- else {
- *size = len;
- sys_memcpy((void *) value, (void *) orig_value, len+1);
- res = 0;
- }
- }
- return res;
-}
-
-int
-erts_sys_getenv__(char *key, char *value, size_t *size)
-{
- return erts_sys_getenv(key, value, size);
-}
-
-void
-sys_init_io(void)
-{
- tmp_buf = (byte *) erts_alloc(ERTS_ALC_T_SYS_TMP_BUF, SYS_TMP_BUF_SIZE);
- tmp_buf_size = SYS_TMP_BUF_SIZE;
- fd_data = (struct fd_data *)
- erts_alloc(ERTS_ALC_T_FD_TAB, max_files * sizeof(struct fd_data));
-}
-
-
-/* Fill buffer, return buffer length, 0 for EOF, < 0 for error. */
-
-static int read_fill(int fd, char *buf, int len)
-{
- int i, got = 0;
- do {
- if ((i = read(fd, buf+got, len-got)) <= 0) {
- return i;
- }
- got += i;
- } while (got < len);
- return (len);
-}
-
-
-/************************** Misc... *******************************/
-
-extern const char pre_loaded_code[];
-extern char* const pre_loaded[];
-
-
-/* Float conversion */
-
-int sys_chars_to_double(char *buf, double *fp)
-{
- char *s = buf;
-
- /* The following check is incorporated from the Vee machine */
-
-#define ISDIGIT(d) ((d) >= '0' && (d) <= '9')
-
- /* Robert says that something like this is what he really wanted:
- *
- * 7 == sscanf(Tbuf, "%[+-]%[0-9].%[0-9]%[eE]%[+-]%[0-9]%s", ....);
- * if (*s2 == 0 || *s3 == 0 || *s4 == 0 || *s6 == 0 || *s7)
- * break;
- */
-
- /* Scan string to check syntax. */
- if (*s == '+' || *s == '-')
- s++;
-
- if (!ISDIGIT(*s)) /* Leading digits. */
- return -1;
- while (ISDIGIT(*s)) s++;
- if (*s++ != '.') /* Decimal part. */
- return -1;
- if (!ISDIGIT(*s))
- return -1;
- while (ISDIGIT(*s)) s++;
- if (*s == 'e' || *s == 'E') {
- /* There is an exponent. */
- s++;
- if (*s == '+' || *s == '-')
- s++;
- if (!ISDIGIT(*s))
- return -1;
- while (ISDIGIT(*s)) s++;
- }
- if (*s) /* That should be it */
- return -1;
-
- if (sscanf(buf, "%lf", fp) != 1)
- return -1;
- return 0;
-}
-
-/*
- ** Convert a double to ascii format 0.dddde[+|-]ddd
- ** return number of characters converted
- */
-
-int sys_double_to_chars(double fp, char *buf)
-{
- (void) sprintf(buf, "%.20e", fp);
- return strlen(buf);
-}
-
-
-/* Floating point exceptions */
-
-#if (CPU == SPARC)
-jmp_buf fpe_jmp;
-
-RETSIGTYPE fpe_sig_handler(int sig)
-{
- longjmp(fpe_jmp, 1);
-}
-
-#elif (CPU == PPC603)
-static void fix_registers(void){
- FP_CONTEXT fpcontext;
- fppSave(&fpcontext);
- fpcontext.fpcsr &= ~(_PPC_FPSCR_INIT);
- fppRestore(&fpcontext);
-}
-#endif
-
-
-/* Return a pointer to a vector of names of preloaded modules */
-
-Preload* sys_preloaded(void)
-{
- return (Preload *) pre_loaded;
-}
-
-/* Return a pointer to preloaded code for module "module" */
-unsigned char* sys_preload_begin(Preload *pp)
-{
- return pp->code;
-}
-
-/* Clean up if allocated */
-void sys_preload_end(Preload *pp)
-{
- /* Nothing */
-}
-
-/* Read a key from console (?) */
-
-int sys_get_key(int fd)
-{
- int c;
- unsigned char rbuf[64];
-
- fflush(stdout); /* Flush query ??? */
-
- if ((c = read(fd,rbuf,64)) <= 0)
- return c;
- return rbuf[0];
-}
-
-
-/* A real printf that does the equivalent of fprintf(stdout, ...) */
-
-/* ARGSUSED */
-static STATUS
-stdio_write(char *buf, int nchars, int fp)
-{
- if (fwrite(buf, sizeof(char), nchars, (FILE *)fp) == 0)
- return(ERROR);
- return(OK);
-}
-
-int real_printf(const char *fmt, ...)
-{
- va_list ap;
- int err;
-
- va_start(ap, fmt);
- err = fioFormatV(fmt, ap, stdio_write, (int)stdout);
- va_end(ap);
- return(err);
-}
-
-
-/*
- * Little function to do argc, argv calls from (e.g.) VxWorks shell
- * The arguments should be in the form of a single ""-enclosed string
- * NOTE: This isn't really part of the emulator, just included here
- * so we can use the handy functions and memory reclamation.
- */
-void argcall(char *args)
-{
- int argc;
- char **argv;
- FUNCPTR entry;
-
- if (args != NULL) {
- if ((argc = build_argv(args, &argv)) > 0) {
- if ((entry = lookup(argv[0])) != NULL)
- (*entry)(argc, argv, (char **)NULL); /* NULL for envp */
- else
- fprintf(stderr, "Couldn't find %s\n", argv[0]);
- } else
- fprintf(stderr, "Failed to build argv!\n");
- } else
- fprintf(stderr, "No argument list!\n");
-}
-
-
-/* That concludes the Erlang stuff - now we just need to implement an OS...
- - Just kidding, but resource reclamation isn't the strength of VxWorks */
-#undef calloc
-#undef free
-#undef cfree
-#undef malloc
-#undef realloc
-#undef open
-#undef creat
-#undef socket
-#undef accept
-#undef close
-#undef fopen
-#undef fdopen
-#undef freopen
-#undef fclose
-
-/********************* Using elib_malloc ****************************/
-/* This gives us yet another level of malloc wrappers. The purpouse */
-/* is to be able to select between different varieties of memory */
-/* allocation without recompiling. */
-/* Maybe the performance is somewhat degraded by this, but */
-/* on the other hand, performance may be much better if the most */
-/* suiting malloc is used (not to mention the much lower */
-/* fragmentation). */
-/* /Patrik N */
-/********************************************************************/
-
-/*
- * I don't want to include the whole elib header, especially
- * as it uses char * for generic pointers. Let's fool ANSI C instead.
- */
-extern void *elib_malloc(size_t);
-extern void *elib_realloc(void *, size_t);
-extern void elib_free(void *);
-extern void elib_init(void *, int);
-extern void elib_force_init(void *, int);
-extern size_t elib_sizeof(void *);
-
-/* Flags */
-#define USING_ELIB_MALLOC 1 /* We are using the elib_malloc */
-#define WARN_MALLOC_MIX 2 /* Warn if plain malloc or save_malloc
- is mixed with sys_free2 or
- sys_realloc2 */
-#define REALLOC_MOVES 4 /* Always move on realloc
- (less fragmentation) */
-#define USER_POOL 8 /* The user supplied the memory
- pool, it was not save_alloced. */
-#define RECLAIM_USER_POOL 16 /* Use the reclaim mechanism in the
- user pool. */
-#define NEW_USER_POOL 32 /* The user pool is newly suppllied,
- any old pool should be discarded */
-
-
-#define ELIB_LOCK \
-if(alloc_flags & USING_ELIB_MALLOC) \
- semTake(elib_malloc_sem, WAIT_FOREVER)
-
-#define ELIB_UNLOCK \
-if(alloc_flags & USING_ELIB_MALLOC) \
- semGive(elib_malloc_sem)
-
-#define USER_RECLAIM() ((alloc_flags & USING_ELIB_MALLOC) && \
- (alloc_flags & USER_POOL) && \
- (alloc_flags & RECLAIM_USER_POOL))
-
-/*
- * Global state
- * The use of function pointers for the malloc/realloc/free functions
- * is actually only useful in the malloc case, we must know what kind of
- * realloc/free we are going to use, so we could call elib_xxx directly.
- * However, as the overhead is small and this construction makes it
- * fairly easy to add another malloc algorithm, the function pointers
- * are used in realloc/free to.
- */
-static MallocFunction actual_alloc = &save_malloc;
-static ReallocFunction actual_realloc = &save_realloc;
-static FreeFunction actual_free = &save_free;
-static int alloc_flags = 0;
-static int alloc_pool_size = 0;
-static void *alloc_pool_ptr = NULL;
-static SEM_ID elib_malloc_sem = NULL;
-
-/*
- * Descide if we should use the save_free instead of elib_free or,
- * in the case of the free used in a delete hook, if we should
- * use plain free instead of elib_free.
- */
-static int use_save_free(void *ptr){
- register int diff = ((char *) ptr) - ((char *) alloc_pool_ptr);
- /*
- * Hmmm... should it be save_free even if diff is exactly 0?
- * The answer is Yes if the whole area is save_alloced and No if not,
- * so reclaim_free_hook is NOT run in the case of one save_alloced area.
- */
- return (!(alloc_flags & USING_ELIB_MALLOC) ||
- (diff < 0 || diff >= alloc_pool_size));
-}
-
-/*
- * A free function used by the task deletion hook for the save_xxx functions.
- * Set with the set_reclaim_free_function function.
- */
-static void reclaim_free_hook(void *ptr){
- if(use_save_free(ptr)){
- free(ptr);
- } else {
- ELIB_LOCK;
- (*actual_free)(ptr);
- ELIB_UNLOCK;
- }
-}
-
-
-/*
- * Initialize, sets the values of pointers based on
- * either nothing (the default) or what's set previously by the
- * erl_set_memory_block function.
- */
-static void initialize_allocation(void){
- set_reclaim_free_function(NULL);
- if(alloc_pool_size == 0){
- actual_alloc = (void *(*)(size_t))&save_malloc;
- actual_realloc = (void *(*)(void *, size_t))&save_realloc;
- actual_free = &save_free;
- alloc_flags &= ~(USING_ELIB_MALLOC | USER_POOL | RECLAIM_USER_POOL);
- } else {
- if(elib_malloc_sem == NULL)
- elib_malloc_sem = semMCreate
- (SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE);
- if(elib_malloc_sem == NULL)
- erl_exit(1,"Could not create mutex semaphore for elib_malloc");
- if(!(alloc_flags & USER_POOL)){
- if((alloc_pool_ptr = save_malloc(alloc_pool_size)) == NULL)
- erl_exit(1,"Erlang set to allocate a %d byte block initially;"
- " not enough memory available.", alloc_pool_size);
- elib_force_init(alloc_pool_ptr, alloc_pool_size);
- } else if(alloc_flags & NEW_USER_POOL){
- elib_force_init(alloc_pool_ptr, alloc_pool_size);
- }
- actual_alloc=&elib_malloc;
- actual_realloc=&elib_realloc;
- actual_free=&elib_free;
- alloc_flags |= USING_ELIB_MALLOC;
- /* We MUST see to that the right free function is used
- otherwise we'll get a very nasty crash! */
- if(USER_RECLAIM())
- set_reclaim_free_function(&reclaim_free_hook);
- }
- alloc_flags &= ~(NEW_USER_POOL); /* It's never new after initialization*/
-}
-
-/* This does not exist on other platforms, we just use it in sys.c
- and the BSD resolver */
-void *sys_calloc2(Uint nelem, Uint elsize){
- void *ptr = erts_alloc_fnf(ERTS_ALC_T_UNDEF, nelem*elsize);
- if(ptr != NULL)
- memset(ptr,0,nelem*elsize);
- return ptr;
-}
-
-/*
- * The malloc wrapper
- */
-void *
-erts_sys_alloc(ErtsAlcType_t type, void *extra, Uint size)
-{
- register void *ret;
- ELIB_LOCK;
- if(USER_RECLAIM())
- ret = save_malloc2((size_t)size,actual_alloc);
- else
- ret = (*actual_alloc)((size_t)size);
- ELIB_UNLOCK;
- return ret;
-}
-
-/*
- * The realloc wrapper, may respond to the "realloc-always-moves" flag
- * if the area is initially allocated with elib_malloc.
- */
-void *
-erts_sys_realloc(ErtsAlcType_t type, void *extra, void *ptr, Uint size)
-{
- register void *ret;
- if(use_save_free(ptr)){
- if((alloc_flags & WARN_MALLOC_MIX) &&
- (alloc_flags & USING_ELIB_MALLOC))
- erts_fprintf(stderr,"Warning, save_malloced data realloced "
- "by sys_realloc2\n");
- return save_realloc(ptr, (size_t) size);
- } else {
- ELIB_LOCK;
- if((alloc_flags & REALLOC_MOVES) &&
- (alloc_flags & USING_ELIB_MALLOC)){
- size_t osz = elib_sizeof(ptr);
- if(USER_RECLAIM())
- ret = save_malloc2((size_t) size, actual_alloc);
- else
- ret = (*actual_alloc)((size_t) size);
- if(ret != NULL){
- memcpy(ret,ptr,(((size_t)size) < osz) ? ((size_t)size) : osz);
- if(USER_RECLAIM())
- save_free2(ptr,actual_free);
- else
- (*actual_free)(ptr);
- }
- } else {
- if(USER_RECLAIM())
- ret = save_realloc2(ptr,(size_t)size,actual_realloc);
- else
- ret = (*actual_realloc)(ptr,(size_t)size);
- }
- ELIB_UNLOCK;
- return ret;
- }
-}
-
-/*
- * Wrapped free().
- */
-void
-erts_sys_free(ErtsAlcType_t type, void *extra, void *ptr)
-{
- if(use_save_free(ptr)){
- /*
- * This might happen when linked in drivers use save_malloc etc
- * directly.
- */
- if((alloc_flags & WARN_MALLOC_MIX) &&
- (alloc_flags & USING_ELIB_MALLOC))
- erts_fprintf(stderr,"Warning, save_malloced data freed by "
- "sys_free2\n");
- save_free(ptr);
- } else {
- ELIB_LOCK;
- if(USER_RECLAIM())
- save_free2(ptr,actual_free);
- else
- (*actual_free)(ptr);
- ELIB_UNLOCK;
- }
-}
-
-/*
- * External interface to be called before erlang is started
- * Parameters:
- * isize: The size of the memory block where erlang should malloc().
- * iptr: (optional) A pointer to a user supplied memory block of
- * size isize.
- * warn_save: Instructs sys_free2 and sys_realloc2 to warn if
- * memory allocation/reallocation/freeing is mixed between
- * pure malloc/save_malloc/sys_alloc2 routines (only
- * warns if elib is actually used in the sys_alloc2 routines).
- * realloc_moves: Always allocate a fresh memory block on reallocation
- * (less fragmentation).
- * reclaim_in_supplied: Use memory reclaim mechanisms inside the user
- * supplied area, this makes one area reusable between
- * starts of erlang and might be nice for drivers etc.
- */
-
-int erl_set_memory_block(int isize, int iptr, int warn_save,
- int realloc_moves, int reclaim_in_supplied, int p5,
- int p6, int p7, int p8, int p9){
- if(erlang_id != 0){
- erts_fprintf(stderr,"Error, cannot set erlang memory block while an "
- "erlang task is running!\n");
- return 1;
- }
- if(isize < 8 * 1024 *1024)
- erts_fprintf(stderr,
- "Warning, the memory pool of %dMb may be to small to "
- "run erlang in!\n", isize / (1024 * 1024));
- alloc_pool_size = (size_t) isize;
- alloc_pool_ptr = (void *) iptr;
- alloc_flags = 0;
- /* USING_ELIB_MALLOC gets set by the initialization routine */
- if((void *)iptr != NULL)
- alloc_flags |= (USER_POOL | NEW_USER_POOL);
- if(realloc_moves)
- alloc_flags |= REALLOC_MOVES;
- if(warn_save)
- alloc_flags |= WARN_MALLOC_MIX;
- if((void *)iptr != NULL && reclaim_in_supplied)
- alloc_flags |= RECLAIM_USER_POOL;
- return 0;
-}
-
-/* External statistics interface */
-int erl_memory_show(int p0, int p1, int p2, int p3, int p4, int p5,
- int p6, int p7, int p8, int p9){
- struct elib_stat statistics;
- if(!(alloc_flags & USING_ELIB_MALLOC) && erlang_id != 0){
- erts_printf("Using plain save_alloc, use memShow instead.\n");
- return 1;
- }
- if(erlang_id == 0 && !((alloc_flags & USER_POOL) &&
- !(alloc_flags & NEW_USER_POOL))){
- erts_printf("Sorry, no allocation statistics until erlang "
- "is started.\n");
- return 1;
- }
- erts_printf("Allocation settings:\n");
- erts_printf("Using elib_malloc with memory pool size of %lu bytes.\n",
- (unsigned long) alloc_pool_size);
- erts_printf("Realloc-always-moves is %s\n",
- (alloc_flags & REALLOC_MOVES) ? "on" : "off");
- erts_printf("Warnings about mixed malloc/free's are %s\n",
- (alloc_flags & WARN_MALLOC_MIX) ? "on" : "off");
- if(alloc_flags & USER_POOL){
- erts_printf("The memory block used by elib is user supplied "
- "at 0x%08x.\n", (unsigned int) alloc_pool_ptr);
- if(alloc_flags & RECLAIM_USER_POOL)
- erts_printf("Allocated memory within the user supplied pool\n"
- " will be automatically reclaimed at task exit.\n");
- } else {
- erts_printf("The memory block used by elib is save_malloc'ed "
- "at 0x%08x.\n", (unsigned int) alloc_pool_ptr);
- }
- erts_printf("Statistics from elib_malloc:\n");
- ELIB_LOCK;
-
- elib_stat(&statistics);
- ELIB_UNLOCK;
- erts_printf("Type Size (bytes) Number of blocks\n");
- erts_printf("============= ============ ================\n");
- erts_printf("Total: %12lu %16lu\n",
- (unsigned long) statistics.mem_total*4,
- (unsigned long) statistics.mem_blocks);
- erts_printf("Allocated: %12lu %16lu\n",
- (unsigned long) statistics.mem_alloc*4,
- (unsigned long) statistics.mem_blocks-statistics.free_blocks);
- erts_printf("Free: %12lu %16lu\n",
- (unsigned long) statistics.mem_free*4,
- (unsigned long) statistics.free_blocks);
- erts_printf("Largest free: %12lu -\n\n",
- (unsigned long) statistics.max_free*4);
- return 0;
-}
-
-
-/*
-** More programmer friendly (as opposed to user friendly ;-) interface
-** to the memory statistics. Resembles the VxWorks memPartInfoGet but
-** does not take a partition id as parameter...
-*/
-int erl_mem_info_get(MEM_PART_STATS *stats){
- struct elib_stat statistics;
- if(!(alloc_flags & USING_ELIB_MALLOC))
- return -1;
- ELIB_LOCK;
- elib_stat(&statistics);
- ELIB_UNLOCK;
- stats->numBytesFree = statistics.mem_free*4;
- stats->numBlocksFree = statistics.free_blocks;
- stats->maxBlockSizeFree = statistics.max_free*4;
- stats->numBytesAlloc = statistics.mem_alloc*4;
- stats->numBlocksAlloc = statistics.mem_blocks-statistics.free_blocks;
- return 0;
-}
-
-/********************* Pipe driver **********************************/
-/*
- * Purpose: Pipe driver with Unix (unnamed) pipe semantics.
- * Author: Peter Hogfeldt ([email protected]) from an outline
- * by Per Hedeland ([email protected]).
- *
- * Note: This driver must *not* use the reclaim facilities, hence it
- * is placed here. (after the #undef's of open,malloc etc)
- *
- * This driver supports select() and non-blocking I/O via
- * ioctl(fd, FIONBIO, val).
- *
- * 1997-03-21 Peter Hogfeldt
- * Added non-blocking I/O.
- *
- */
-
-/*
- * SEMAPHORES
- *
- * Each end of a pipe has two semaphores: semExcl for serialising access to
- * the pipe end, and semBlock for blocking I/O.
- *
- * reader->semBlock is available (full) if and only if the pipe is
- * not empty, or the write end is closed. Otherwise
- * it is unavailable (empty). It is initially
- * unavailable.
- *
- * writer->semBlock is available (full) if and only if the pipe is
- * not full, or if the reader end is closed.
- * Otherwise it is unavailable. It is initially
- * available.
- */
-
-#define UXPIPE_SIZE 4096
-
-/* Forward declaration */
-typedef struct uxPipeDev UXPIPE_DEV;
-
-/*
- * Pipe descriptor (one for each open pipe).
- */
-typedef struct {
- int drvNum;
- UXPIPE_DEV *reader, *writer;
- RING_ID ringId;
-} UXPIPE;
-
-/*
- * Device descriptor (one for each of the read and write
- * ends of an open pipe).
- */
-struct uxPipeDev {
- UXPIPE *pipe;
- int blocking;
- SEL_WAKEUP_LIST wakeupList;
- SEM_ID semExcl;
- SEM_ID semBlock;
-};
-
-int uxPipeDrvNum = 0; /* driver number of pipe driver */
-
-#define PIPE_NAME "/uxpipe" /* only used internally */
-#define PIPE_READ "/r" /* ditto */
-#define PIPE_WRITE "/w" /* ditto */
-
-LOCAL char pipeRead[64], pipeWrite[64];
-LOCAL DEV_HDR devHdr;
-LOCAL UXPIPE *newPipe; /* communicate btwn open()s in pipe() */
-LOCAL SEM_ID pipeSem; /* mutual exclusion in pipe() */
-
-/* forward declarations */
-LOCAL int uxPipeOpen(DEV_HDR *pDv, char *name, int mode);
-LOCAL int uxPipeClose(UXPIPE_DEV *pDev);
-LOCAL int uxPipeRead(UXPIPE_DEV *pDev, char *buffer, int maxbytes);
-LOCAL int uxPipeWrite(UXPIPE_DEV *pDev, char *buffer, int nbytes);
-LOCAL STATUS uxPipeIoctl(FAST UXPIPE_DEV *pDev, FAST int function, int arg);
-
-
-/***************************************************************************
- *
- * uxPipeDrv - install Unix pipe driver
- *
- * This routine initializes the Unix pipe driver. It must be called
- * before any other routine in this driver.
- *
- * RETURNS:
- * OK, or ERROR if I/O system is unable to install driver.
- */
-
-STATUS
-uxPipeDrv(void)
-{
- if (uxPipeDrvNum > 0)
- return (OK); /* driver already installed */
- if ((uxPipeDrvNum = iosDrvInstall((FUNCPTR) NULL, (FUNCPTR) NULL,
- uxPipeOpen, uxPipeClose, uxPipeRead,
- uxPipeWrite, uxPipeIoctl)) == ERROR)
- return (ERROR);
- if (iosDevAdd(&devHdr, PIPE_NAME, uxPipeDrvNum) == ERROR)
- return (ERROR);
- strcpy(pipeRead, PIPE_NAME);
- strcat(pipeRead, PIPE_READ);
- strcpy(pipeWrite, PIPE_NAME);
- strcat(pipeWrite, PIPE_WRITE);
- if ((pipeSem = semMCreate(SEM_Q_PRIORITY | SEM_DELETE_SAFE)) == NULL)
- return (ERROR);
- return (OK);
-}
-
-/***************************************************************************
- *
- * uxPipeOpen - open a pipe
- *
- * RETURNS: Pointer to device descriptor, or ERROR if memory cannot be
- * allocated (errno = ENOMEM), or invalid argument (errno = EINVAL).
- */
-
-/*
- * DEV_HDR *pDv; pointer to device header (dummy)
- * char *name; name of pipe to open ("/r" or "/w")
- * int mode; access mode (O_RDONLY or O_WRONLY)
- */
-LOCAL int
-uxPipeOpen(DEV_HDR *pDv, char *name, int mode)
-{
- UXPIPE_DEV *reader, *writer;
-
- if (mode == O_RDONLY && strcmp(name, PIPE_READ) == 0) {
- /* reader open */
- if ((newPipe = (UXPIPE *) malloc(sizeof(UXPIPE))) != NULL) {
- if ((newPipe->ringId = rngCreate(UXPIPE_SIZE)) != NULL) {
- if ((reader = (UXPIPE_DEV *) malloc(sizeof(UXPIPE_DEV))) != NULL) {
- if ((reader->semExcl = semBCreate(SEM_Q_FIFO, SEM_FULL)) != NULL) {
- if ((reader->semBlock = semBCreate(SEM_Q_FIFO, SEM_EMPTY)) != NULL) {
- reader->pipe = newPipe;
- reader->blocking = 1;
- selWakeupListInit(&reader->wakeupList);
- newPipe->reader = reader;
- newPipe->writer = NULL;
- newPipe->drvNum = uxPipeDrvNum;
- return ((int) reader);
- }
- semDelete(reader->semExcl);
- }
- free(reader);
- }
- rngDelete(newPipe->ringId);
- }
- free(newPipe);
- newPipe = NULL;
- errno = ENOMEM;
- }
- } else if (mode == O_WRONLY && strcmp(name, PIPE_WRITE) == 0) {
- /* writer open */
- if (newPipe != NULL &&
- (writer = (UXPIPE_DEV *) malloc(sizeof(UXPIPE_DEV))) != NULL) {
- if ((writer->semExcl = semBCreate(SEM_Q_FIFO, SEM_FULL)) != NULL) {
- if ((writer->semBlock = semBCreate(SEM_Q_FIFO, SEM_FULL)) != NULL) {
- writer->blocking = 1;
- writer->pipe = newPipe;
- selWakeupListInit(&writer->wakeupList);
- newPipe->writer = writer;
- newPipe = NULL;
- return ((int) writer);
- }
- semDelete(writer->semExcl);
- }
- free(writer);
- }
- if (newPipe != NULL)
- free(newPipe);
- newPipe = NULL;
- errno = ENOMEM;
- } else {
- errno = EINVAL;
- }
- return (ERROR);
-}
-
-/***************************************************************************
- *
- * uxPipeClose - close read or write end of a pipe.
- *
- * RETURNS:
- * OK, or ERROR if device descriptor does not refer to an open read or
- write end of a pipe (errno = EBADF).
- */
-
-LOCAL int
-uxPipeClose(UXPIPE_DEV *pDev)
-{
- UXPIPE *pajp = pDev->pipe;
-
- taskLock();
- if (pDev == pajp->reader) {
- /* Close this end */
- semDelete(pDev->semExcl);
- semDelete(pDev->semBlock);
- free(pDev);
- pajp->reader = NULL;
- /* Inform the other end */
- if (pajp->writer != NULL) {
- selWakeupAll(&pajp->writer->wakeupList, SELWRITE);
- semGive(pajp->writer->semBlock);
- }
- } else if (pDev == pajp->writer) {
- /* Close this end */
- semDelete(pDev->semExcl);
- semDelete(pDev->semBlock);
- free(pDev);
- pajp->writer = NULL;
- /* Inform the other end */
- if (pajp->reader != NULL) {
- selWakeupAll(&pajp->reader->wakeupList, SELREAD);
- semGive(pajp->reader->semBlock);
- }
- } else {
- errno = EBADF;
- taskUnlock();
- return (ERROR);
- }
- if (pajp->reader == NULL && pajp->writer == NULL) {
- rngDelete(pajp->ringId);
- pajp->drvNum = 0;
- free(pajp);
- }
- taskUnlock();
- return (OK);
-}
-/***************************************************************************
- *
- * uxPipeRead - read from a pipe.
- *
- * Reads at most maxbytes bytes from the pipe. Blocks if blocking mode is
- * set and the pipe is empty.
- *
- * RETURNS:
- * number of bytes read, 0 on EOF, or ERROR if device descriptor does
- * not refer to an open read end of a pipe (errno = EBADF), or if
- * non-blocking mode is set and the pipe is empty (errno = EWOULDBLOCK).
- */
-
-LOCAL int
-uxPipeRead(UXPIPE_DEV *pDev, char *buffer, int maxbytes)
-{
- UXPIPE *pajp = pDev->pipe;
- int nbytes = 0;
-
- if (pDev != pajp->reader) {
- errno = EBADF;
- return (ERROR);
- }
- if (maxbytes == 0)
- return (0);
- semTake(pDev->semExcl, WAIT_FOREVER);
- /*
- * Note that semBlock may be full, although there is nothing to read.
- * This happens e.g. after the following sequence of operations: a
- * reader task blocks, a writer task writes two times (the first
- * write unblocks the reader task, the second write makes semBlock
- * full).
- */
- while (nbytes == 0) {
- if (pDev->blocking)
- semTake(pDev->semBlock, WAIT_FOREVER);
- /*
- * Reading and updating of the write end must not be interleaved
- * with a write from another task - hence we lock this task.
- */
- taskLock();
- nbytes = rngBufGet(pajp->ringId, buffer, maxbytes);
- if (nbytes > 0) {
- /* Give own semaphore if bytes remain or if write end is closed */
- if ((!rngIsEmpty(pajp->ringId) || pajp->writer == NULL) &&
- pDev->blocking)
- semGive(pDev->semBlock);
- /* Inform write end */
- if (pajp->writer != NULL) {
- if (pajp->writer->blocking)
- semGive(pajp->writer->semBlock);
- selWakeupAll(&pajp->writer->wakeupList, SELWRITE);
- }
- } else if (pajp->writer == NULL) {
- nbytes = 0; /* EOF */
- /* Give semaphore when write end is closed */
- if (pDev->blocking)
- semGive(pDev->semBlock);
- taskUnlock();
- semGive(pDev->semExcl);
- return (nbytes);
- } else if (!pDev->blocking) {
- taskUnlock();
- semGive(pDev->semExcl);
- errno = EWOULDBLOCK;
- return (ERROR);
- }
- taskUnlock();
- }
- semGive(pDev->semExcl);
- return (nbytes);
-}
-
-/***************************************************************************
- *
- * uxPipeWrite - write to a pipe.
- *
- * Writes nbytes bytes to the pipe. Blocks if blocking mode is set, and if
- * the pipe is full.
- *
- * RETURNS:
- * number of bytes written, or ERROR if the device descriptor does not
- * refer to an open write end of a pipe (errno = EBADF); or if the read end
- * of the pipe is closed (errno = EPIPE); or if non-blocking mode is set
- * and the pipe is full (errno = EWOULDBLOCK).
- *
- */
-
-LOCAL int
-uxPipeWrite(UXPIPE_DEV *pDev, char *buffer, int nbytes)
-{
-
- UXPIPE *pajp = pDev->pipe;
- int sofar = 0, written;
-
- if (pDev != pajp->writer) {
- errno = EBADF;
- return (ERROR);
- }
- if (pajp->reader == NULL) {
- errno = EPIPE;
- return (ERROR);
- }
- if (nbytes == 0)
- return (0);
- semTake(pDev->semExcl, WAIT_FOREVER);
- while (sofar < nbytes) {
- if (pDev->blocking)
- semTake(pDev->semBlock, WAIT_FOREVER);
- if (pajp->reader == NULL) {
- errno = EPIPE;
- semGive(pDev->semBlock);
- semGive(pDev->semExcl);
- return (ERROR);
- }
- /* Writing and updating of the read end must not be interleaved
- * with a read from another task - hence we lock this task.
- */
- taskLock();
- written = rngBufPut(pajp->ringId, buffer + sofar, nbytes - sofar);
- sofar += written;
- /* Inform the read end if we really wrote something */
- if (written > 0 && pajp->reader != NULL) {
- selWakeupAll(&pajp->reader->wakeupList, SELREAD);
- if (pajp->reader->blocking)
- semGive(pajp->reader->semBlock);
- }
- taskUnlock();
- if (!pDev->blocking) {
- if (sofar == 0) {
- errno = EWOULDBLOCK;
- sofar = ERROR;
- }
- break;
- }
- }
- /* Give own semaphore if space remains */
- if (!rngIsFull(pajp->ringId) && pDev->blocking)
- semGive(pDev->semBlock);
- semGive(pDev->semExcl);
- return (sofar);
-}
-
-/***************************************************************************
- *
- * uxPipeIoctl - do device specific I/O control
- *
- * RETURNS:
- * OK or ERROR.
- */
-
-LOCAL STATUS
-uxPipeIoctl(FAST UXPIPE_DEV *pDev, FAST int function, int arg)
-
-{
- UXPIPE *pajp = pDev->pipe;
- int status = OK;
-
- switch (function) {
- case FIONBIO:
- pDev->blocking = (*(int *)arg) ? 0 : 1;
- break;
- case FIOSELECT:
- taskLock();
- selNodeAdd(&pDev->wakeupList, (SEL_WAKEUP_NODE *) arg);
- if (selWakeupType((SEL_WAKEUP_NODE *) arg) == SELREAD &&
- pDev == pajp->reader &&
- (!rngIsEmpty(pajp->ringId) || pajp->writer == NULL))
- selWakeup((SEL_WAKEUP_NODE *) arg);
- if (selWakeupType((SEL_WAKEUP_NODE *) arg) == SELWRITE &&
- pDev == pajp->writer &&
- (!rngIsFull(pajp->ringId) || pajp->reader == NULL))
- selWakeup((SEL_WAKEUP_NODE *) arg);
- taskUnlock();
- break;
- case FIOUNSELECT:
- selNodeDelete(&pDev->wakeupList, (SEL_WAKEUP_NODE *) arg);
- break;
- default:
- status = ERROR;
- break;
- }
- return (status);
-}
-
-/***************************************************************************
- *
- * pipe - create an intertask channel
- *
- * Creates a pipe. fd[0] (fd[1]) is the read (write) file descriptor.
- *
- * RETURNS:
- * OK or ERROR, if the pipe could not be created.
- */
-
-STATUS
-pipe(int fd[2])
-{
- semTake(pipeSem, WAIT_FOREVER);
- if ((fd[0] = open(pipeRead, O_RDONLY, 0)) != ERROR) {
- if ((fd[1] = open(pipeWrite, O_WRONLY, 0)) != ERROR) {
- semGive(pipeSem);
- return (OK);
- }
- (void) close(fd[0]);
- }
- errno &= 0xFFFF;
- if((errno & 0xFFFF) == EINTR) /* Why on earth EINTR??? */
- errno = ENFILE; /* It means we are out of file descriptors...*/
- semGive(pipeSem);
- return (ERROR);
-}
-
-/***************************************************************************
- *
- * uxPipeShow - display pipe information
- *
- * RETURNS:
- * N/A.
- */
-
-void
-uxPipeShow(int fd)
-{
- UXPIPE_DEV *pDev;
- UXPIPE *pajp;
- int drvValue;
-
- if ((drvValue = iosFdValue(fd)) == ERROR) {
- erts_fprintf(stderr, "Error: file descriptor invalid\n");
- return;
- }
- pDev = (UXPIPE_DEV *)drvValue;
- pajp = pDev->pipe;
- if (pajp->drvNum != uxPipeDrvNum) {
- erts_fprintf(stderr, "Error: Not a ux pipe device\n");
- return;
- }
- erts_fprintf(stderr, "Device : 0x%x\n", (int) pDev);
- erts_fprintf(stderr, "Buffer size : %d\n", UXPIPE_SIZE);
- erts_fprintf(stderr, "Bytes in buffer : %d\n\n", rngNBytes(pajp->ringId));
- erts_fprintf(stderr, "READ END\n\n");
- if (pajp->reader != NULL) {
- erts_fprintf(stderr, "Mode : ");
- erts_fprintf(stderr, "%s\n",
- (pajp->reader->blocking) ? "blocking" : "non-blocking");
- }
- erts_fprintf(stderr, "Status : ");
- if (pajp->reader != NULL) {
- erts_fprintf(stderr, "OPEN\n");
- erts_fprintf(stderr, "Wake-up list : %d\n\n",
- selWakeupListLen(&pajp->reader->wakeupList));
- erts_fprintf(stderr, "Exclusion Semaphore\n");
- semShow(pajp->reader->semExcl, 1);
- erts_fprintf(stderr, "Blocking Semaphore\n");
- semShow(pajp->reader->semBlock, 1);
- } else
- erts_fprintf(stderr, "CLOSED\n\n");
- erts_fprintf(stderr, "WRITE END\n\n");
- if (pajp->writer != NULL) {
- erts_fprintf(stderr, "Mode : ");
- erts_fprintf(stderr, "%s\n",
- (pajp->writer->blocking) ? "blocking" : "non-blocking");
- }
- erts_fprintf(stderr, "Status : ");
- if (pajp->writer != NULL) {
- erts_fprintf(stderr, "OPEN\n");
- erts_fprintf(stderr, "Wake-up list : %d\n\n",
- selWakeupListLen(&pajp->writer->wakeupList));
- erts_fprintf(stderr, "Exclusion Semaphore\n");
- semShow(pajp->writer->semExcl, 1);
- erts_fprintf(stderr, "Blocking Semaphore\n");
- semShow(pajp->writer->semBlock, 1);
- } else
- erts_fprintf(stderr, "CLOSED\n\n");
-}
-
-#ifdef DEBUG
-void
-erl_assert_error(char* expr, char* file, int line)
-{
- fflush(stdout);
- fprintf(stderr, "Assertion failed: %s in %s, line %d\n",
- expr, file, line);
- fflush(stderr);
- erl_crash_dump(file, line, "Assertion failed: %s\n", expr);
- abort();
-}
-void
-erl_debug(char* fmt, ...)
-{
- char sbuf[1024]; /* Temporary buffer. */
- va_list va;
-
- va_start(va, fmt);
- vsprintf(sbuf, fmt, va);
- va_end(va);
- fprintf(stderr, "%s\n", sbuf);
-}
-#endif
diff --git a/erts/emulator/sys/win32/erl_win_sys.h b/erts/emulator/sys/win32/erl_win_sys.h
index 03298a6c54..5ce1a61303 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2012. 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
@@ -90,6 +90,11 @@
#define strncasecmp _strnicmp
+#ifndef __GNUC__
+# undef ERTS_I64_LITERAL
+# define ERTS_I64_LITERAL(X) X##i64
+#endif
+
/*
* Practial Windows specific macros.
*/
@@ -171,8 +176,8 @@ extern clock_t sys_times(SysTimes *buffer);
extern char *win_build_environment(char *);
typedef struct {
- char *environment_strings;
- char *next_string;
+ WCHAR *environment_strings;
+ WCHAR *next_string;
} GETENV_STATE;
void erts_sys_env_init(void);
diff --git a/erts/emulator/sys/win32/sys.c b/erts/emulator/sys/win32/sys.c
index b106f0932d..6c69fecbf3 100755
--- a/erts/emulator/sys/win32/sys.c
+++ b/erts/emulator/sys/win32/sys.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -68,9 +68,9 @@ static int async_write_file(struct async_io* aio, LPVOID buf, DWORD numToWrite);
static int get_overlapped_result(struct async_io* aio,
LPDWORD pBytesRead, BOOL wait);
static BOOL create_child_process(char *, HANDLE, HANDLE,
- HANDLE, LPHANDLE, BOOL,
- LPVOID, LPTSTR, unsigned,
- char **, int *);
+ HANDLE, LPHANDLE, LPDWORD, BOOL,
+ LPVOID, LPTSTR, unsigned,
+ char **, int *);
static int create_pipe(LPHANDLE, LPHANDLE, BOOL, BOOL);
static int application_type(const char* originalName, char fullPath[MAX_PATH],
BOOL search_in_path, BOOL handle_quotes,
@@ -420,6 +420,8 @@ typedef struct async_io {
HANDLE ioAllowed; /* The thread will wait for this event
* before starting a new read or write.
*/
+ HANDLE flushEvent; /* Used to signal that a flush should be done. */
+ HANDLE flushReplyEvent; /* Used to signal that a flush has been done. */
DWORD pendingError; /* Used to delay presentating an error to Erlang
* until the check_io function is entered.
*/
@@ -878,6 +880,8 @@ init_async_io(AsyncIo* aio, int use_threads)
aio->ov.Offset = 0L;
aio->ov.OffsetHigh = 0L;
aio->ioAllowed = NULL;
+ aio->flushEvent = NULL;
+ aio->flushReplyEvent = NULL;
aio->pendingError = 0;
aio->bytesTransferred = 0;
#ifdef ERTS_SMP
@@ -890,6 +894,12 @@ init_async_io(AsyncIo* aio, int use_threads)
aio->ioAllowed = CreateAutoEvent(FALSE);
if (aio->ioAllowed == NULL)
return -1;
+ aio->flushEvent = CreateAutoEvent(FALSE);
+ if (aio->flushEvent == NULL)
+ return -1;
+ aio->flushReplyEvent = CreateAutoEvent(FALSE);
+ if (aio->flushReplyEvent == NULL)
+ return -1;
}
return 0;
}
@@ -923,6 +933,14 @@ release_async_io(AsyncIo* aio, ErlDrvPort port_num)
if (aio->ioAllowed != NULL)
CloseHandle(aio->ioAllowed);
aio->ioAllowed = NULL;
+
+ if (aio->flushEvent != NULL)
+ CloseHandle(aio->flushEvent);
+ aio->flushEvent = NULL;
+
+ if (aio->flushReplyEvent != NULL)
+ CloseHandle(aio->flushReplyEvent);
+ aio->flushReplyEvent = NULL;
}
/* ----------------------------------------------------------------------
@@ -1136,6 +1154,7 @@ spawn_start(ErlDrvPort port_num, char* name, SysDriverOpts* opts)
HANDLE hChildStdin = INVALID_HANDLE_VALUE; /* Child's stdin. */
HANDLE hChildStdout = INVALID_HANDLE_VALUE; /* Child's stout. */
HANDLE hChildStderr = INVALID_HANDLE_VALUE; /* Child's sterr. */
+ DWORD pid;
int close_child_stderr = 0;
DriverData* dp; /* Pointer to driver data. */
ErlDrvData retval = ERL_DRV_ERROR_GENERAL; /* Return value. */
@@ -1203,14 +1222,13 @@ spawn_start(ErlDrvPort port_num, char* name, SysDriverOpts* opts)
*/
DEBUGF(("Spawning \"%s\"\n", name));
- envir = win_build_environment(envir); /* Still an ansi environment, could be
- converted to unicode for spawn_executable, but
- that is not done (yet) */
+ envir = win_build_environment(envir); /* Always a unicode environment */
ok = create_child_process(name,
hChildStdin,
hChildStdout,
hChildStderr,
&dp->port_pid,
+ &pid,
opts->hide_window,
(LPVOID) envir,
(LPTSTR) opts->wd,
@@ -1254,6 +1272,9 @@ spawn_start(ErlDrvPort port_num, char* name, SysDriverOpts* opts)
#endif
retval = set_driver_data(dp, hFromChild, hToChild, opts->read_write,
opts->exit_status);
+ if (retval != ERL_DRV_ERROR_GENERAL && retval != ERL_DRV_ERROR_ERRNO)
+ /* We assume that this cannot generate a negative number */
+ erts_port[port_num].os_pid = (SWord) pid;
}
if (retval != ERL_DRV_ERROR_GENERAL && retval != ERL_DRV_ERROR_ERRNO)
@@ -1397,7 +1418,8 @@ create_child_process
HANDLE hStdin, /* The standard input handle for child. */
HANDLE hStdout, /* The standard output handle for child. */
HANDLE hStderr, /* The standard error handle for child. */
- LPHANDLE phPid, /* Pointer to variable to received PID. */
+ LPHANDLE phPid, /* Pointer to variable to received Process handle. */
+ LPDWORD pdwID, /* Pointer to variable to received Process ID */
BOOL hide, /* Hide the window unconditionally. */
LPVOID env, /* Environment for the child */
LPTSTR wd, /* Working dir for the child */
@@ -1479,7 +1501,8 @@ create_child_process
NULL,
NULL,
TRUE,
- createFlags | staticCreateFlags,
+ createFlags | staticCreateFlags |
+ CREATE_UNICODE_ENVIRONMENT,
env,
wd,
&siStartInfo,
@@ -1607,7 +1630,8 @@ create_child_process
NULL,
NULL,
TRUE,
- createFlags | staticCreateFlags,
+ createFlags | staticCreateFlags |
+ CREATE_UNICODE_ENVIRONMENT,
env,
(WCHAR *) wd,
&siStartInfo,
@@ -1629,7 +1653,8 @@ create_child_process
}
CloseHandle(piProcInfo.hThread); /* Necessary to avoid resource leak. */
*phPid = piProcInfo.hProcess;
-
+ *pdwID = piProcInfo.dwProcessId;
+
if (applType == APPL_DOS) {
WaitForSingleObject(hProcess, 50);
}
@@ -2076,16 +2101,26 @@ threaded_writer(LPVOID param)
AsyncIo* aio = (AsyncIo *) param;
HANDLE thread = GetCurrentThread();
char* buf;
- DWORD numToWrite;
+ DWORD numToWrite, handle;
int ok;
+ HANDLE handles[2];
+ handles[0] = aio->ioAllowed;
+ handles[1] = aio->flushEvent;
for (;;) {
- WaitForSingleObject(aio->ioAllowed, INFINITE);
+ handle = WaitForMultipleObjects(2, handles, FALSE, INFINITE);
if (aio->flags & DF_EXIT_THREAD)
break;
+
buf = OV_BUFFER_PTR(aio);
numToWrite = OV_NUM_TO_READ(aio);
aio->pendingError = 0;
+
+ if (handle == (WAIT_OBJECT_0 + 1) && numToWrite == 0) {
+ SetEvent(aio->flushReplyEvent);
+ continue;
+ }
+
ok = WriteFile(aio->fd, buf, numToWrite, &aio->bytesTransferred, NULL);
if (!ok) {
aio->pendingError = GetLastError();
@@ -2120,7 +2155,11 @@ threaded_writer(LPVOID param)
}
}
}
- SetEvent(aio->ov.hEvent);
+ OV_NUM_TO_READ(aio) = 0;
+ if (handle == (WAIT_OBJECT_0 + 1))
+ SetEvent(aio->flushReplyEvent);
+ else
+ SetEvent(aio->ov.hEvent);
if (aio->pendingError != NO_ERROR || aio->bytesTransferred == 0)
break;
if (aio->flags & DF_EXIT_THREAD)
@@ -2186,6 +2225,43 @@ fd_start(ErlDrvPort port_num, char* name, SysDriverOpts* opts)
if ((dp = new_driver_data(port_num, opts->packet_bytes, 2, TRUE)) == NULL)
return ERL_DRV_ERROR_GENERAL;
+ /**
+ * Here is a brief description about how the fd driver works on windows.
+ *
+ * fd_init:
+ * For each in/out fd pair a threaded_reader and threaded_writer thread is
+ * created. Within the DriverData struct each of the threads have an AsyncIO
+ * sctruct associated with it. Within AsyncIO there are two important HANDLEs,
+ * ioAllowed and ov.hEvent. ioAllowed is used to signal the threaded_* threads
+ * should read/write some data, and ov.hEvent is driver_select'ed to be used to
+ * signal that the thread is done reading/writing.
+ *
+ * The reason for the driver being threaded like this is because once the FD is open
+ * on windows, it is not possible to set the it in overlapped mode. So we have to
+ * simulate this using threads.
+ *
+ * output:
+ * When an output occurs the data to be outputted is copied to AsyncIO.ov. Then
+ * the ioAllowed HANDLE is set, ov.hEvent is cleared and the port is marked as busy.
+ * The threaded_writer thread is lying in WaitForMultipleObjects on ioAllowed, and
+ * when signalled it writes all data in AsyncIO.ov and then sets ov.hEvent so that
+ * ready_output gets triggered and (potentially) sends the reply to the port and
+ * marks the port an non-busy.
+ *
+ * input:
+ * The threaded_reader is lying waiting in ReadFile on the in fd and when a new
+ * line is written it sets ov.hEvent that new data is available and then goes
+ * and waits for ioAllowed to be set. ready_input is run when ov.hEvent is set and
+ * delivers the data to the port. Then ioAllowed is signalled again and threaded_reader
+ * goes back to ReadFile.
+ *
+ * shutdown:
+ * In order to guarantee that all io is outputted before the driver is stopped,
+ * fd_stop uses flushEvent and flushReplyEvent to make sure that there is no data
+ * in ov which needs writing before returning from fd_stop.
+ *
+ **/
+
if (!create_file_thread(&dp->in, DO_READ)) {
dp->port_num = PORT_FREE;
return ERL_DRV_ERROR_GENERAL;
@@ -2234,6 +2310,8 @@ static void fd_stop(ErlDrvData d)
(void) driver_select(dp->port_num,
(ErlDrvEvent)dp->out.ov.hEvent,
ERL_DRV_WRITE, 0);
+ SetEvent(dp->out.flushEvent);
+ WaitForSingleObject(dp->out.flushReplyEvent, INFINITE);
}
}
@@ -2757,10 +2835,10 @@ static void stop_select(ErlDrvEvent e, void* _)
** no interpretation of this should be done by the rest of the
** emulator. The buffer should be at least 21 bytes long.
*/
-void sys_get_pid(char *buffer){
+void sys_get_pid(char *buffer, size_t buffer_size){
DWORD p = GetCurrentProcessId();
/* The pid is scalar and is an unsigned long. */
- sprintf(buffer,"%lu",(unsigned long) p);
+ erts_snprintf(buffer, buffer_size, "%lu",(unsigned long) p);
}
void
@@ -3100,7 +3178,8 @@ erl_assert_error(char* expr, char* file, int line)
{
char message[1024];
- sprintf(message, "File %hs, line %d: %hs", file, line, expr);
+ erts_snprintf(message, sizeof(message),
+ "File %hs, line %d: %hs", file, line, expr);
MessageBox(GetActiveWindow(), message, "Assertion failed",
MB_OK | MB_ICONERROR);
#if 0
diff --git a/erts/emulator/sys/win32/sys_env.c b/erts/emulator/sys/win32/sys_env.c
index 064745d418..754f4c6e4c 100644
--- a/erts/emulator/sys/win32/sys_env.c
+++ b/erts/emulator/sys/win32/sys_env.c
@@ -1,271 +1,299 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 2002-2011. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "sys.h"
-#include "erl_sys_driver.h"
-#include "erl_alloc.h"
-
-static char* merge_environment(char *current, char *add);
-static char* arg_to_env(char **arg);
-static char** env_to_arg(char *env);
-static char** find_arg(char **arg, char *str);
-static int compare(const void *a, const void *b);
-
-static erts_smp_rwmtx_t environ_rwmtx;
-
-void
-erts_sys_env_init(void)
-{
- erts_smp_rwmtx_init(&environ_rwmtx, "environ");
-}
-
-int
-erts_sys_putenv(char *key_value, int sep_ix)
-{
- int res;
- char sep = key_value[sep_ix];
- ASSERT(sep == '=');
- key_value[sep_ix] = '\0';
- erts_smp_rwmtx_rwlock(&environ_rwmtx);
- res = (SetEnvironmentVariable((LPCTSTR) key_value,
- (LPCTSTR) &key_value[sep_ix+1]) ? 0 : 1);
- erts_smp_rwmtx_rwunlock(&environ_rwmtx);
- key_value[sep_ix] = sep;
- return res;
-}
-
-int
-erts_sys_getenv__(char *key, char *value, size_t *size)
-{
- size_t req_size = 0;
- int res = 0;
- DWORD new_size;
-
- SetLastError(0);
- new_size = GetEnvironmentVariable((LPCTSTR) key,
- (LPTSTR) value,
- (DWORD) *size);
- res = !new_size && GetLastError() == ERROR_ENVVAR_NOT_FOUND ? -1 : 0;
- if (res < 0)
- return res;
- res = new_size > *size ? 1 : 0;
- *size = new_size;
- return res;
-}
-
-int
-erts_sys_getenv(char *key, char *value, size_t *size)
-{
- int res;
- erts_smp_rwmtx_rlock(&environ_rwmtx);
- res = erts_sys_getenv__(key, value, size);
- erts_smp_rwmtx_runlock(&environ_rwmtx);
- return res;
-}
-
-struct win32_getenv_state {
- char *env;
- char *next;
-};
-
-
-void init_getenv_state(GETENV_STATE *state)
-{
- erts_smp_rwmtx_rlock(&environ_rwmtx);
- state->environment_strings = (char *) GetEnvironmentStrings();
- state->next_string = state->environment_strings;
-}
-
-char *getenv_string(GETENV_STATE *state)
-{
- ERTS_SMP_LC_ASSERT(erts_smp_lc_rwmtx_is_rlocked(&environ_rwmtx));
- if (state->next_string[0] == '\0')
- return NULL;
- else {
- char *res = state->next_string;
- state->next_string += sys_strlen(res) + 1;
- return res;
- }
-}
-
-void fini_getenv_state(GETENV_STATE *state)
-{
- FreeEnvironmentStrings(state->environment_strings);
- state->environment_strings = state->next_string = NULL;
- erts_smp_rwmtx_runlock(&environ_rwmtx);
-}
-
-char*
-win_build_environment(char* new_env)
-{
- if (new_env == NULL) {
- return NULL;
- } else {
- char *tmp, *merged;
-
- erts_smp_rwmtx_rlock(&environ_rwmtx);
- tmp = GetEnvironmentStrings();
- merged = merge_environment(tmp, new_env);
-
- FreeEnvironmentStrings(tmp);
- erts_smp_rwmtx_runlock(&environ_rwmtx);
- return merged;
- }
-}
-
-static char*
-merge_environment(char *old, char *add)
-{
- char **a_arg = env_to_arg(add);
- char **c_arg = env_to_arg(old);
- char *ret;
- int i, j;
-
- for(i = 0; c_arg[i] != NULL; ++i)
- ;
-
- for(j = 0; a_arg[j] != NULL; ++j)
- ;
-
- c_arg = erts_realloc(ERTS_ALC_T_TMP,
- c_arg, (i+j+1) * sizeof(char *));
-
- for(j = 0; a_arg[j] != NULL; ++j){
- char **tmp;
- char *current = a_arg[j];
- char *eq_p = strchr(current,'=');
- int unset = (eq_p!=NULL && eq_p[1]=='\0');
-
- if ((tmp = find_arg(c_arg, current)) != NULL) {
- if (!unset) {
- *tmp = current;
- } else {
- *tmp = c_arg[--i];
- c_arg[i] = NULL;
- }
- } else if (!unset) {
- c_arg[i++] = current;
- c_arg[i] = NULL;
- }
- }
- ret = arg_to_env(c_arg);
- erts_free(ERTS_ALC_T_TMP, c_arg);
- erts_free(ERTS_ALC_T_TMP, a_arg);
- return ret;
-}
-
-static char**
-find_arg(char **arg, char *str)
-{
- char *tmp;
- int len;
-
- if ((tmp = strchr(str, '=')) != NULL) {
- tmp++;
- len = tmp - str;
- while (*arg != NULL){
- if (_strnicmp(*arg, str, len) == 0){
- return arg;
- }
- ++arg;
- }
- }
- return NULL;
-}
-
-static int
-compare(const void *a, const void *b)
-{
- char *s1 = *((char **) a);
- char *s2 = *((char **) b);
- char *e1 = strchr(s1,'=');
- char *e2 = strchr(s2,'=');
- int ret;
- int len;
-
- if(!e1)
- e1 = s1 + strlen(s1);
- if(!e2)
- e2 = s2 + strlen(s2);
-
- if((e1 - s1) > (e2 - s2))
- len = (e2 - s2);
- else
- len = (e1 - s1);
-
- ret = _strnicmp(s1,s2,len);
- if (ret == 0)
- return ((e1 - s1) - (e2 - s2));
- else
- return ret;
-}
-
-static char**
-env_to_arg(char *env)
-{
- char **ret;
- char *tmp;
- int i;
- int num_strings = 0;
-
- for(tmp = env; *tmp != '\0'; tmp += strlen(tmp)+1) {
- ++num_strings;
- }
- ret = erts_alloc(ERTS_ALC_T_TMP, sizeof(char *) * (num_strings + 1));
- i = 0;
- for(tmp = env; *tmp != '\0'; tmp += strlen(tmp)+1){
- ret[i++] = tmp;
- }
- ret[i] = NULL;
- return ret;
-}
-
-static char*
-arg_to_env(char **arg)
-{
- char *block;
- char *ptr;
- int i;
- int totlen = 1; /* extra '\0' */
-
- for(i = 0; arg[i] != NULL; ++i) {
- totlen += strlen(arg[i])+1;
- }
-
- /* sort the environment vector */
- qsort(arg, i, sizeof(char *), &compare);
-
- if (totlen == 1){
- block = erts_alloc(ERTS_ALC_T_ENVIRONMENT, 2);
- block[0] = block[1] = '\0';
- } else {
- block = erts_alloc(ERTS_ALC_T_ENVIRONMENT, totlen);
- ptr = block;
- for(i=0; arg[i] != NULL; ++i){
- strcpy(ptr, arg[i]);
- ptr += strlen(ptr)+1;
- }
- *ptr = '\0';
- }
- return block;
-}
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Ericsson AB 2002-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "sys.h"
+#include "erl_sys_driver.h"
+#include "erl_alloc.h"
+
+static WCHAR *merge_environment(WCHAR *current, WCHAR *add);
+static WCHAR *arg_to_env(WCHAR **arg);
+static WCHAR **env_to_arg(WCHAR *env);
+static WCHAR **find_arg(WCHAR **arg, WCHAR *str);
+static int compare(const void *a, const void *b);
+
+static erts_smp_rwmtx_t environ_rwmtx;
+
+void
+erts_sys_env_init(void)
+{
+ erts_smp_rwmtx_init(&environ_rwmtx, "environ");
+}
+
+int
+erts_sys_putenv_raw(char *key, char *value)
+{
+ int res;
+ erts_smp_rwmtx_rwlock(&environ_rwmtx);
+ res = (SetEnvironmentVariable((LPCTSTR) key,
+ (LPCTSTR) value) ? 0 : 1);
+ erts_smp_rwmtx_rwunlock(&environ_rwmtx);
+ return res;
+}
+
+int
+erts_sys_putenv(char *key, char *value)
+{
+ int res;
+ WCHAR *wkey = (WCHAR *) key;
+ WCHAR *wvalue = (WCHAR *) value;
+ erts_smp_rwmtx_rwlock(&environ_rwmtx);
+ res = (SetEnvironmentVariableW(wkey,
+ wvalue) ? 0 : 1);
+ erts_smp_rwmtx_rwunlock(&environ_rwmtx);
+ return res;
+}
+
+int
+erts_sys_getenv(char *key, char *value, size_t *size)
+{
+ size_t req_size = 0;
+ int res = 0;
+ DWORD new_size;
+ WCHAR *wkey = (WCHAR *) key;
+ WCHAR *wvalue = (WCHAR *) value;
+ DWORD wsize = *size / (sizeof(WCHAR) / sizeof(char));
+
+ SetLastError(0);
+ erts_smp_rwmtx_rlock(&environ_rwmtx);
+ new_size = GetEnvironmentVariableW(wkey,
+ wvalue,
+ (DWORD) wsize);
+ res = !new_size && GetLastError() == ERROR_ENVVAR_NOT_FOUND ? -1 : 0;
+ erts_smp_rwmtx_runlock(&environ_rwmtx);
+ if (res < 0)
+ return res;
+ res = new_size > wsize ? 1 : 0;
+ *size = new_size * (sizeof(WCHAR) / sizeof(char));
+ return res;
+}
+int
+erts_sys_getenv__(char *key, char *value, size_t *size)
+{
+ size_t req_size = 0;
+ int res = 0;
+ DWORD new_size;
+
+ SetLastError(0);
+ new_size = GetEnvironmentVariable((LPCTSTR) key,
+ (LPTSTR) value,
+ (DWORD) *size);
+ res = !new_size && GetLastError() == ERROR_ENVVAR_NOT_FOUND ? -1 : 0;
+ if (res < 0)
+ return res;
+ res = new_size > *size ? 1 : 0;
+ *size = new_size;
+ return res;
+}
+
+int
+erts_sys_getenv_raw(char *key, char *value, size_t *size)
+{
+ int res;
+ erts_smp_rwmtx_rlock(&environ_rwmtx);
+ res = erts_sys_getenv__(key, value, size);
+ erts_smp_rwmtx_runlock(&environ_rwmtx);
+ return res;
+}
+
+void init_getenv_state(GETENV_STATE *state)
+{
+ erts_smp_rwmtx_rlock(&environ_rwmtx);
+ state->environment_strings = GetEnvironmentStringsW();
+ state->next_string = state->environment_strings;
+}
+
+char *getenv_string(GETENV_STATE *state)
+{
+ ERTS_SMP_LC_ASSERT(erts_smp_lc_rwmtx_is_rlocked(&environ_rwmtx));
+ if (state->next_string[0] == L'\0') {
+ return NULL;
+ } else {
+ WCHAR *res = state->next_string;
+ state->next_string += wcslen(res) + 1;
+ return (char *) res;
+ }
+}
+
+void fini_getenv_state(GETENV_STATE *state)
+{
+ FreeEnvironmentStringsW(state->environment_strings);
+ state->environment_strings = state->next_string = NULL;
+ erts_smp_rwmtx_runlock(&environ_rwmtx);
+}
+
+char*
+win_build_environment(char* new_env)
+{
+ if (new_env == NULL) {
+ return NULL;
+ } else {
+ WCHAR *tmp, *merged, *tmp_new;
+
+ tmp_new = (WCHAR *) new_env;
+
+ erts_smp_rwmtx_rlock(&environ_rwmtx);
+ tmp = GetEnvironmentStringsW();
+ merged = merge_environment(tmp, tmp_new);
+
+ FreeEnvironmentStringsW(tmp);
+ erts_smp_rwmtx_runlock(&environ_rwmtx);
+ return (char *) merged;
+ }
+}
+
+static WCHAR *
+merge_environment(WCHAR *old, WCHAR *add)
+{
+ WCHAR **a_arg = env_to_arg(add);
+ WCHAR **c_arg = env_to_arg(old);
+ WCHAR *ret;
+ int i, j;
+
+ for(i = 0; c_arg[i] != NULL; ++i)
+ ;
+
+ for(j = 0; a_arg[j] != NULL; ++j)
+ ;
+
+ c_arg = erts_realloc(ERTS_ALC_T_TMP,
+ c_arg, (i+j+1) * sizeof(WCHAR *));
+
+ for(j = 0; a_arg[j] != NULL; ++j){
+ WCHAR **tmp;
+ WCHAR *current = a_arg[j];
+ WCHAR *eq_p = wcschr(current,L'=');
+ int unset = (eq_p!=NULL && eq_p[1]==L'\0');
+
+ if ((tmp = find_arg(c_arg, current)) != NULL) {
+ if (!unset) {
+ *tmp = current;
+ } else {
+ *tmp = c_arg[--i];
+ c_arg[i] = NULL;
+ }
+ } else if (!unset) {
+ c_arg[i++] = current;
+ c_arg[i] = NULL;
+ }
+ }
+ ret = arg_to_env(c_arg);
+ erts_free(ERTS_ALC_T_TMP, c_arg);
+ erts_free(ERTS_ALC_T_TMP, a_arg);
+ return ret;
+}
+
+static WCHAR**
+find_arg(WCHAR **arg, WCHAR *str)
+{
+ WCHAR *tmp;
+ int len;
+
+ if ((tmp = wcschr(str, L'=')) != NULL) {
+ tmp++;
+ len = tmp - str;
+ while (*arg != NULL){
+ if (_wcsnicmp(*arg, str, len) == 0){
+ return arg;
+ }
+ ++arg;
+ }
+ }
+ return NULL;
+}
+
+static int
+compare(const void *a, const void *b)
+{
+ WCHAR *s1 = *((WCHAR **) a);
+ WCHAR *s2 = *((WCHAR **) b);
+ WCHAR *e1 = wcschr(s1,L'=');
+ WCHAR *e2 = wcschr(s2,L'=');
+ int ret;
+ int len;
+
+ if(!e1)
+ e1 = s1 + wcslen(s1);
+ if(!e2)
+ e2 = s2 + wcslen(s2);
+
+ if((e1 - s1) > (e2 - s2))
+ len = (e2 - s2);
+ else
+ len = (e1 - s1);
+
+ ret = _wcsnicmp(s1,s2,len);
+ if (ret == 0)
+ return ((e1 - s1) - (e2 - s2));
+ else
+ return ret;
+}
+
+static WCHAR**
+env_to_arg(WCHAR *env)
+{
+ WCHAR **ret;
+ WCHAR *tmp;
+ int i;
+ int num_strings = 0;
+
+ for(tmp = env; *tmp != '\0'; tmp += wcslen(tmp)+1) {
+ ++num_strings;
+ }
+ ret = erts_alloc(ERTS_ALC_T_TMP, sizeof(WCHAR *) * (num_strings + 1));
+ i = 0;
+ for(tmp = env; *tmp != '\0'; tmp += wcslen(tmp)+1){
+ ret[i++] = tmp;
+ }
+ ret[i] = NULL;
+ return ret;
+}
+
+static WCHAR *
+arg_to_env(WCHAR **arg)
+{
+ WCHAR *block;
+ WCHAR *ptr;
+ int i;
+ int totlen = 1; /* extra '\0' */
+
+ for(i = 0; arg[i] != NULL; ++i) {
+ totlen += wcslen(arg[i])+1;
+ }
+
+ /* sort the environment vector */
+ qsort(arg, i, sizeof(WCHAR *), &compare);
+
+ if (totlen == 1){
+ block = erts_alloc(ERTS_ALC_T_ENVIRONMENT, 2 * sizeof(WCHAR));
+ block[0] = block[1] = '\0';
+ } else {
+ block = erts_alloc(ERTS_ALC_T_ENVIRONMENT, totlen * sizeof(WCHAR));
+ ptr = block;
+ for(i=0; arg[i] != NULL; ++i){
+ wcscpy(ptr, arg[i]);
+ ptr += wcslen(ptr)+1;
+ }
+ *ptr = '\0';
+ }
+ return block;
+}
diff --git a/erts/emulator/sys/win32/sys_float.c b/erts/emulator/sys/win32/sys_float.c
index 6558ad2d99..09dad89140 100644
--- a/erts/emulator/sys/win32/sys_float.c
+++ b/erts/emulator/sys/win32/sys_float.c
@@ -118,18 +118,18 @@ sys_chars_to_double(char *buf, double *fp)
*/
int
-sys_double_to_chars(double fp, char *buf)
+sys_double_to_chars(double fp, char *buffer, size_t buffer_size)
{
- char *s = buf;
+ char *s = buffer;
- (void) sprintf(buf, "%.20e", fp);
+ (void) erts_snprintf(buffer, buffer_size, "%.20e", fp);
/* Search upto decimal point */
if (*s == '+' || *s == '-') s++;
while (isdigit(*s)) s++;
if (*s == ',') *s++ = '.'; /* Replace ',' with '.' */
/* Scan to end of string */
while (*s) s++;
- return s-buf; /* i.e strlen(buf) */
+ return s-buffer; /* i.e strlen(buffer) */
}
int
diff --git a/erts/emulator/sys/win32/sys_interrupt.c b/erts/emulator/sys/win32/sys_interrupt.c
index 347c31053b..36c43e93da 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2012. 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
@@ -75,11 +75,11 @@ BOOL WINAPI ctrl_handler_ignore_break(DWORD dwCtrlType)
return TRUE;
break;
case CTRL_LOGOFF_EVENT:
+ case CTRL_SHUTDOWN_EVENT:
if (nohup)
return TRUE;
/* else pour through... */
case CTRL_CLOSE_EVENT:
- case CTRL_SHUTDOWN_EVENT:
erl_exit(0, "");
break;
}
@@ -127,11 +127,11 @@ BOOL WINAPI ctrl_handler(DWORD dwCtrlType)
SetEvent(erts_sys_break_event);
break;
case CTRL_LOGOFF_EVENT:
+ case CTRL_SHUTDOWN_EVENT:
if (nohup)
return TRUE;
/* else pour through... */
case CTRL_CLOSE_EVENT:
- case CTRL_SHUTDOWN_EVENT:
erl_exit(0, "");
break;
}
diff --git a/erts/emulator/sys/win32/sys_time.c b/erts/emulator/sys/win32/sys_time.c
index b5123dc45d..2f2dfc8197 100644
--- a/erts/emulator/sys/win32/sys_time.c
+++ b/erts/emulator/sys/win32/sys_time.c
@@ -26,11 +26,7 @@
#include "sys.h"
#include "assert.h"
-#ifdef __GNUC__
-#define LL_LITERAL(X) X##LL
-#else
-#define LL_LITERAL(X) X##i64
-#endif
+#define LL_LITERAL(X) ERTS_I64_LITERAL(X)
/******************* Routines for time measurement *********************/
diff --git a/erts/emulator/test/Makefile b/erts/emulator/test/Makefile
index a3dcbc4cf3..9594ab48b1 100644
--- a/erts/emulator/test/Makefile
+++ b/erts/emulator/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -47,6 +47,7 @@ MODULES= \
busy_port_SUITE \
call_trace_SUITE \
code_SUITE \
+ code_parallel_load_SUITE \
crypto_SUITE \
ddll_SUITE \
decode_packet_SUITE \
@@ -137,10 +138,10 @@ TARGET_FILES = $(MODULES:%=$(EBIN)/%.$(EMULATOR))
EMAKEFILE=Emakefile
-TEST_SPEC_FILES = emulator.spec \
- emulator.spec.win \
- emulator.spec.vxworks \
- emulator.spec.ose
+TEST_SPEC_FILES= emulator.spec \
+ emulator.spec.win \
+ emulator_bench.spec
+
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
@@ -196,13 +197,13 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec:
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) $(EMAKEFILE) $(TEST_SPEC_FILES) \
- $(ERL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) $(NO_OPT_ERL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) $(NATIVE_ERL_FILES) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(ERL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(NO_OPT_ERL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(NATIVE_ERL_FILES) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/erts/emulator/test/bif_SUITE.erl b/erts/emulator/test/bif_SUITE.erl
index c7617d3b90..e2442861c7 100644
--- a/erts/emulator/test/bif_SUITE.erl
+++ b/erts/emulator/test/bif_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -25,18 +25,22 @@
init_per_group/2,end_per_group/2,
init_per_testcase/2,end_per_testcase/2,
display/1, display_huge/0,
- types/1,
+ erl_bif_types/1,guard_bifs_in_erl_bif_types/1,
+ shadow_comments/1,
+ specs/1,improper_bif_stubs/1,auto_imports/1,
t_list_to_existing_atom/1,os_env/1,otp_7526/1,
binary_to_atom/1,binary_to_existing_atom/1,
- atom_to_binary/1,min_max/1]).
+ atom_to_binary/1,min_max/1, erlang_halt/1]).
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [types, t_list_to_existing_atom, os_env, otp_7526,
+ [erl_bif_types, guard_bifs_in_erl_bif_types, shadow_comments,
+ specs, improper_bif_stubs, auto_imports,
+ t_list_to_existing_atom, os_env, otp_7526,
display,
atom_to_binary, binary_to_atom, binary_to_existing_atom,
- min_max].
+ min_max, erlang_halt].
groups() ->
[].
@@ -70,7 +74,7 @@ display(doc) ->
display(Config) when is_list(Config) ->
Pa = filename:dirname(code:which(?MODULE)),
{ok, Node} = test_server:start_node(display_huge_term,peer,
- [{args, "-pa "++Pa}]),
+ [{args, "-pa \""++Pa++"\""}]),
true = rpc:call(Node,?MODULE,display_huge,[]),
test_server:stop_node(Node),
ok.
@@ -86,33 +90,20 @@ deeep(N,Acc) ->
deeep(N) ->
deeep(N,[hello]).
+erl_bif_types(Config) when is_list(Config) ->
+ ensure_erl_bif_types_compiled(),
-types(Config) when is_list(Config) ->
- c:l(erl_bif_types),
- case erlang:function_exported(erl_bif_types, module_info, 0) of
- false ->
- %% Fail cleanly.
- ?line ?t:fail("erl_bif_types not compiled");
- true ->
- types_1()
- end.
-
-types_1() ->
- ?line List0 = erlang:system_info(snifs),
+ List0 = erlang:system_info(snifs),
%% Ignore missing type information for hipe BIFs.
- ?line List = [MFA || {M,_,_}=MFA <- List0, M =/= hipe_bifs],
+ List = [MFA || {M,_,_}=MFA <- List0, M =/= hipe_bifs],
- case [MFA || MFA <- List, not known_types(MFA)] of
- [] ->
- types_2(List);
- BadTypes ->
- io:put_chars("No type information:\n"),
- io:format("~p\n", [lists:sort(BadTypes)]),
- ?line ?t:fail({length(BadTypes),bifs_without_types})
- end.
+ KnownTypes = [MFA || MFA <- List, known_types(MFA)],
+ io:format("There are ~p BIFs with type information in erl_bif_types.",
+ [length(KnownTypes)]),
+ erl_bif_types_2(KnownTypes).
-types_2(List) ->
+erl_bif_types_2(List) ->
BadArity = [MFA || {M,F,A}=MFA <- List,
begin
Types = erl_bif_types:arg_types(M, F, A),
@@ -120,14 +111,14 @@ types_2(List) ->
end],
case BadArity of
[] ->
- types_3(List);
+ erl_bif_types_3(List);
[_|_] ->
io:put_chars("Bifs with bad arity\n"),
io:format("~p\n", [BadArity]),
?line ?t:fail({length(BadArity),bad_arity})
end.
-types_3(List) ->
+erl_bif_types_3(List) ->
BadSmokeTest = [MFA || {M,F,A}=MFA <- List,
begin
try erl_bif_types:type(M, F, A) of
@@ -151,9 +142,220 @@ types_3(List) ->
?line ?t:fail({length(BadSmokeTest),bad_smoke_test})
end.
+guard_bifs_in_erl_bif_types(_Config) ->
+ ensure_erl_bif_types_compiled(),
+
+ List0 = erlang:system_info(snifs),
+ List = [{F,A} || {erlang,F,A} <- List0,
+ erl_internal:guard_bif(F, A)],
+ Not = [FA || {F,A}=FA <- List,
+ not erl_bif_types:is_known(erlang, F, A)],
+ case Not of
+ [] ->
+ ok;
+ [_|_] ->
+ io:put_chars(
+ ["Dialyzer requires that all guard BIFs "
+ "have type information in erl_bif_types.\n\n"
+ "The following guard BIFs have no type information "
+ "in erl_bif_types:\n\n",
+ [io_lib:format(" ~p/~p\n", [F,A]) || {F,A} <- Not]]),
+ ?t:fail()
+ end.
+
+shadow_comments(_Config) ->
+ ensure_erl_bif_types_compiled(),
+
+ List0 = erlang:system_info(snifs),
+ List1 = [MFA || {M,_,_}=MFA <- List0, M =/= hipe_bifs],
+ List = [MFA || MFA <- List1, not is_operator(MFA)],
+ HasTypes = [MFA || {M,F,A}=MFA <- List,
+ erl_bif_types:is_known(M, F, A)],
+ Path = get_code_path(),
+ BifRel = sofs:relation(HasTypes, [{m,f,a}]),
+ BifModules = sofs:to_external(sofs:projection(1, BifRel)),
+ AbstrByModule = [extract_abstract(Mod, Path) || Mod <- BifModules],
+ Specs0 = [extract_specs(Mod, Abstr) ||
+ {Mod,Abstr} <- AbstrByModule],
+ Specs = lists:append(Specs0),
+ SpecFuns0 = [F || {F,_} <- Specs],
+ SpecFuns = sofs:relation(SpecFuns0, [{m,f,a}]),
+ HasTypesAndSpecs = sofs:intersection(BifRel, SpecFuns),
+ Commented0 = lists:append([extract_comments(Mod, Path) ||
+ Mod <- BifModules]),
+ Commented = sofs:relation(Commented0, [{m,f,a}]),
+ {NoComments0,_,NoBifSpecs0} =
+ sofs:symmetric_partition(HasTypesAndSpecs, Commented),
+ NoComments = sofs:to_external(NoComments0),
+ NoBifSpecs = sofs:to_external(NoBifSpecs0),
+
+ case NoComments of
+ [] ->
+ ok;
+ [_|_] ->
+ io:put_chars(
+ ["If a BIF stub has both a spec and has type information in "
+ "erl_bif_types, there *must*\n"
+ "be a comment in the source file to make that immediately "
+ "obvious.\n\nThe following comments are missing:\n\n",
+ [io_lib:format("%% Shadowed by erl_bif_types: ~p:~p/~p\n",
+ [M,F,A]) || {M,F,A} <- NoComments]]),
+ ?t:fail()
+ end,
+
+ case NoBifSpecs of
+ [] ->
+ ok;
+ [_|_] ->
+ io:put_chars(
+ ["The following functions have \"shadowed\" comments "
+ "claiming that there is type information in erl_bif_types,\n"
+ "but actually there is no such type information.\n\n"
+ "Therefore, the following comments should be removed:\n\n",
+ [io_lib:format("%% Shadowed by erl_bif_types: ~p:~p/~p\n",
+ [M,F,A]) || {M,F,A} <- NoBifSpecs]]),
+ ?t:fail()
+ end.
+
+extract_comments(Mod, Path) ->
+ Beam = which(Mod, Path),
+ SrcDir = filename:join(filename:dirname(filename:dirname(Beam)), "src"),
+ Src = filename:join(SrcDir, atom_to_list(Mod) ++ ".erl"),
+ {ok,Bin} = file:read_file(Src),
+ Lines0 = binary:split(Bin, <<"\n">>, [global]),
+ Lines1 = [T || <<"%% Shadowed by erl_bif_types: ",T/binary>> <- Lines0],
+ {ok,ReMFA} = re:compile("([^:]*):([^/]*)/(\\d*)"),
+ Lines = [L || L <- Lines1, re:run(L, ReMFA, [{capture,[]}]) =:= match],
+ [begin
+ {match,[M,F,A]} = re:run(L, ReMFA, [{capture,all_but_first,list}]),
+ {list_to_atom(M),list_to_atom(F),list_to_integer(A)}
+ end || L <- Lines].
+
+ensure_erl_bif_types_compiled() ->
+ c:l(erl_bif_types),
+ case erlang:function_exported(erl_bif_types, module_info, 0) of
+ false ->
+ %% Fail cleanly.
+ ?t:fail("erl_bif_types not compiled");
+ true ->
+ ok
+ end.
+
known_types({M,F,A}) ->
erl_bif_types:is_known(M, F, A).
+specs(_) ->
+ List0 = erlang:system_info(snifs),
+
+ %% Ignore missing type information for hipe BIFs.
+ List1 = [MFA || {M,_,_}=MFA <- List0, M =/= hipe_bifs],
+
+ %% Ignore all operators.
+ List = [MFA || MFA <- List1, not is_operator(MFA)],
+
+ %% Extract specs from the abstract code for all BIFs.
+ Path = get_code_path(),
+ BifRel = sofs:relation(List, [{m,f,a}]),
+ BifModules = sofs:to_external(sofs:projection(1, BifRel)),
+ AbstrByModule = [extract_abstract(Mod, Path) || Mod <- BifModules],
+ Specs0 = [extract_specs(Mod, Abstr) ||
+ {Mod,Abstr} <- AbstrByModule],
+ Specs = lists:append(Specs0),
+ BifSet = sofs:set(List, [function]),
+ SpecRel0 = sofs:relation(Specs, [{function,spec}]),
+ SpecRel = sofs:restriction(SpecRel0, BifSet),
+
+ %% Find BIFs without specs.
+ NoSpecs0 = sofs:difference(BifSet, sofs:domain(SpecRel)),
+ NoSpecs = sofs:to_external(NoSpecs0),
+ case NoSpecs of
+ [] ->
+ ok;
+ [_|_] ->
+ io:put_chars("The following BIFs don't have specs:\n"),
+ [print_mfa(MFA) || MFA <- NoSpecs],
+ ?t:fail()
+ end.
+
+is_operator({erlang,F,A}) ->
+ erl_internal:arith_op(F, A) orelse
+ erl_internal:bool_op(F, A) orelse
+ erl_internal:comp_op(F, A) orelse
+ erl_internal:list_op(F, A) orelse
+ erl_internal:send_op(F, A);
+is_operator(_) -> false.
+
+extract_specs(M, Abstr) ->
+ [{make_mfa(M, Name),Spec} || {attribute,_,spec,{Name,Spec}} <- Abstr].
+
+make_mfa(M, {F,A}) -> {M,F,A};
+make_mfa(M, {M,_,_}=MFA) -> MFA.
+
+improper_bif_stubs(_) ->
+ Bifs0 = erlang:system_info(snifs),
+ Bifs = [MFA || {M,_,_}=MFA <- Bifs0, M =/= hipe_bifs],
+ Path = get_code_path(),
+ BifRel = sofs:relation(Bifs, [{m,f,a}]),
+ BifModules = sofs:to_external(sofs:projection(1, BifRel)),
+ AbstrByModule = [extract_abstract(Mod, Path) || Mod <- BifModules],
+ Funcs0 = [extract_functions(Mod, Abstr) ||
+ {Mod,Abstr} <- AbstrByModule],
+ Funcs = lists:append(Funcs0),
+ BifSet = sofs:set(Bifs, [function]),
+ FuncRel0 = sofs:relation(Funcs, [{function,code}]),
+ FuncRel = sofs:restriction(FuncRel0, BifSet),
+ [check_stub(MFA, Body) || {MFA,Body} <- sofs:to_external(FuncRel)],
+ ok.
+
+auto_imports(_Config) ->
+ Path = get_code_path(),
+ {erlang,Abstr} = extract_abstract(erlang, Path),
+ SpecFuns = [Name || {attribute,_,spec,{Name,_}} <- Abstr],
+ auto_imports(SpecFuns, 0).
+
+auto_imports([{F,A}|T], Errors) ->
+ case erl_internal:bif(F, A) of
+ false ->
+ io:format("~p/~p: not auto-imported, but spec claims it "
+ "is auto-imported", [F,A]),
+ auto_imports(T, Errors+1);
+ true ->
+ auto_imports(T, Errors)
+ end;
+auto_imports([{erlang,F,A}|T], Errors) ->
+ case erl_internal:bif(F, A) of
+ false ->
+ auto_imports(T, Errors);
+ true ->
+ io:format("~p/~p: auto-imported, but "
+ "spec claims it is *not* auto-imported", [F,A]),
+ auto_imports(T, Errors+1)
+ end;
+auto_imports([], 0) ->
+ ok;
+auto_imports([], Errors) ->
+ ?t:fail({Errors,inconsistencies}).
+
+extract_functions(M, Abstr) ->
+ [{{M,F,A},Body} || {function,_,F,A,Body} <- Abstr].
+
+check_stub({erlang,apply,3}, _) ->
+ ok;
+check_stub({_,F,A}, B) ->
+ try
+ [{clause,_,Args,[],Body}] = B,
+ A = length(Args),
+ [{call,_,{remote,_,{atom,_,erlang},{atom,_,nif_error}},[_]}] = Body
+ catch
+ _:_ ->
+ io:put_chars("Invalid body for the following BIF stub:\n"),
+ Func = {function,0,F,A,B},
+ io:put_chars(erl_pp:function(Func)),
+ io:nl(),
+ io:put_chars("The body should be: erlang:nif_error(undef)"),
+ ?t:fail()
+ end.
+
t_list_to_existing_atom(Config) when is_list(Config) ->
?line all = list_to_existing_atom("all"),
?line ?MODULE = list_to_existing_atom(?MODULE_STRING),
@@ -438,7 +640,84 @@ min_max(Config) when is_list(Config) ->
ok.
+
+
+erlang_halt(Config) when is_list(Config) ->
+ try erlang:halt(undefined) of
+ _-> ?t:fail({erlang,halt,{undefined}})
+ catch error:badarg -> ok end,
+ try halt(undefined) of
+ _-> ?t:fail({halt,{undefined}})
+ catch error:badarg -> ok end,
+ try erlang:halt(undefined, []) of
+ _-> ?t:fail({erlang,halt,{undefined,[]}})
+ catch error:badarg -> ok end,
+ try halt(undefined, []) of
+ _-> ?t:fail({halt,{undefined,[]}})
+ catch error:badarg -> ok end,
+ try halt(0, undefined) of
+ _-> ?t:fail({halt,{0,undefined}})
+ catch error:badarg -> ok end,
+ try halt(0, [undefined]) of
+ _-> ?t:fail({halt,{0,[undefined]}})
+ catch error:badarg -> ok end,
+ try halt(0, [{undefined,true}]) of
+ _-> ?t:fail({halt,{0,[{undefined,true}]}})
+ catch error:badarg -> ok end,
+ try halt(0, [{flush,undefined}]) of
+ _-> ?t:fail({halt,{0,[{flush,undefined}]}})
+ catch error:badarg -> ok end,
+ try halt(0, [{flush,true,undefined}]) of
+ _-> ?t:fail({halt,{0,[{flush,true,undefined}]}})
+ catch error:badarg -> ok end,
+ H = hostname(),
+ {ok,N1} = slave:start(H, halt_node1),
+ {badrpc,nodedown} = rpc:call(N1, erlang, halt, []),
+ {ok,N2} = slave:start(H, halt_node2),
+ {badrpc,nodedown} = rpc:call(N2, erlang, halt, [0]),
+ {ok,N3} = slave:start(H, halt_node3),
+ {badrpc,nodedown} = rpc:call(N3, erlang, halt, [0,[]]),
+ ok.
+
+
+
%% Helpers
id(I) -> I.
+%% Get code path, including the path for the erts application.
+get_code_path() ->
+ case code:lib_dir(erts) of
+ {error,bad_name} ->
+ Erts = filename:join([code:root_dir(),"erts","preloaded","ebin"]),
+ [Erts|code:get_path()];
+ _ ->
+ code:get_path()
+ end.
+
+which(Mod, Path) ->
+ which_1(atom_to_list(Mod) ++ ".beam", Path).
+
+which_1(Base, [D|Ds]) ->
+ Path = filename:join(D, Base),
+ case filelib:is_regular(Path) of
+ true -> Path;
+ false -> which_1(Base, Ds)
+ end.
+print_mfa({M,F,A}) ->
+ io:format("~p:~p/~p", [M,F,A]).
+
+extract_abstract(Mod, Path) ->
+ Beam = which(Mod, Path),
+ {ok,{Mod,[{abstract_code,{raw_abstract_v1,Abstr}}]}} =
+ beam_lib:chunks(Beam, [abstract_code]),
+ {Mod,Abstr}.
+
+
+hostname() ->
+ hostname(atom_to_list(node())).
+
+hostname([$@ | Hostname]) ->
+ list_to_atom(Hostname);
+hostname([_C | Cs]) ->
+ hostname(Cs).
diff --git a/erts/emulator/test/binary_SUITE.erl b/erts/emulator/test/binary_SUITE.erl
index d9fc876482..58e0cb4096 100644
--- a/erts/emulator/test/binary_SUITE.erl
+++ b/erts/emulator/test/binary_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -1135,15 +1135,8 @@ sleeper() ->
?line receive after infinity -> ok end.
-gc_test(doc) -> "Test that binaries are garbage collected properly.";
-gc_test(suite) -> [];
+%% Test that binaries are garbage collected properly.
gc_test(Config) when is_list(Config) ->
- case erlang:system_info(heap_type) of
- private -> gc_test_1();
- hybrid -> {skip,"Hybrid heap"}
- end.
-
-gc_test_1() ->
%% Note: This test is only relevant for REFC binaries.
%% Therefore, we take care that all binaries are REFC binaries.
B = list_to_binary(lists:seq(0, ?heap_binary_size)),
diff --git a/erts/emulator/test/bs_construct_SUITE.erl b/erts/emulator/test/bs_construct_SUITE.erl
index 7fdf36711b..8b5c82d968 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -460,7 +460,6 @@ mem_leak(0, _) -> ok;
mem_leak(N, B) ->
?line big_bin(B, <<23>>),
?line {'EXIT',{badarg,_}} = (catch big_bin(B, bad)),
- maybe_gc(),
mem_leak(N-1, B).
big_bin(B1, B2) ->
@@ -473,13 +472,6 @@ big_bin(B1, B2) ->
make_bin(0, Acc) -> Acc;
make_bin(N, Acc) -> make_bin(N-1, <<Acc/binary,Acc/binary>>).
-maybe_gc() ->
- case erlang:system_info(heap_type) of
- shared -> erlang:garbage_collect();
- hybrid -> erlang:garbage_collect();
- private -> ok
- end.
-
-define(COF(Int0),
?line (fun(Int) ->
true = <<Int:32/float>> =:= <<(float(Int)):32/float>>,
diff --git a/erts/emulator/test/call_trace_SUITE.erl b/erts/emulator/test/call_trace_SUITE.erl
index 7030ebed3f..eaecd32f95 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -25,6 +25,7 @@
init_per_testcase/2,end_per_testcase/2,
hipe/1,process_specs/1,basic/1,flags/1,errors/1,pam/1,change_pam/1,
return_trace/1,exception_trace/1,on_load/1,deep_exception/1,
+ upgrade/1,
exception_nocatch/1,bit_syntax/1]).
%% Helper functions.
@@ -46,6 +47,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
Common = [errors, on_load],
NotHipe = [process_specs, basic, flags, pam, change_pam,
+ upgrade,
return_trace, exception_trace, deep_exception,
exception_nocatch, bit_syntax],
Hipe = [hipe],
@@ -76,7 +78,13 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
end_per_testcase(_Func, Config) ->
Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog).
+ ?t:timetrap_cancel(Dog),
+
+ %% Reloading the module will clear all trace patterns, and
+ %% in a debug-compiled emulator run assertions of the counters
+ %% for the number of traced exported functions in this module.
+
+ c:l(?MODULE).
hipe(Config) when is_list(Config) ->
?line 0 = erlang:trace_pattern({?MODULE,worker_foo,1}, true),
@@ -185,8 +193,13 @@ basic() ->
%% Trace some functions...
?line trace_func({lists,'_','_'}, []),
+
+ %% Make sure that tracing the same functions more than once
+ %% does not cause any problems.
+ ?line 3 = trace_func({?MODULE,foo,'_'}, true),
?line 3 = trace_func({?MODULE,foo,'_'}, true),
?line 1 = trace_func({?MODULE,bar,0}, true),
+ ?line 1 = trace_func({?MODULE,bar,0}, true),
?line {traced,global} = trace_info({?MODULE,bar,0}, traced),
?line 1 = trace_func({erlang,list_to_integer,1}, true),
?line {traced,global} = trace_info({erlang,list_to_integer,1}, traced),
@@ -267,6 +280,118 @@ foo() -> foo0.
foo(X) -> X+1.
foo(X, Y) -> X+Y.
+
+%% Note that the semantics that this test case verifies
+%% are not explicitly specified in the docs (what I could find in R15B).
+%% This test case was written to verify that we do not change
+%% any behaviour with the introduction of "block-free" upgrade in R16.
+%% In short: Do not refer to this test case as an authority of how it must work.
+upgrade(doc) ->
+ "Test tracing on module being upgraded";
+upgrade(Config) when is_list(Config) ->
+ V1 = compile_version(my_upgrade_test, 1, Config),
+ V2 = compile_version(my_upgrade_test, 2, Config),
+ start_tracer(),
+ upgrade_do(V1, V2, false),
+ upgrade_do(V1, V2, true).
+
+upgrade_do(V1, V2, TraceLocalVersion) ->
+ {module,my_upgrade_test} = erlang:load_module(my_upgrade_test, V1),
+
+
+ %% Test that trace is cleared after load_module
+
+ trace_func({my_upgrade_test,'_','_'}, [], [global]),
+ case TraceLocalVersion of
+ true -> trace_func({my_upgrade_test,local_version,0}, [], [local]);
+ _ -> ok
+ end,
+ 1 = my_upgrade_test:version(),
+ 1 = my_upgrade_test:do_local(),
+ 1 = my_upgrade_test:do_real_local(),
+ put('F1_exp', my_upgrade_test:make_fun_exp()),
+ put('F1_loc', my_upgrade_test:make_fun_local()),
+ 1 = (get('F1_exp'))(),
+ 1 = (get('F1_loc'))(),
+
+ Self = self(),
+ expect({trace,Self,call,{my_upgrade_test,version,[]}}),
+ expect({trace,Self,call,{my_upgrade_test,do_local,[]}}),
+ expect({trace,Self,call,{my_upgrade_test,do_real_local,[]}}),
+ case TraceLocalVersion of
+ true -> expect({trace,Self,call,{my_upgrade_test,local_version,[]}});
+ _ -> ok
+ end,
+ expect({trace,Self,call,{my_upgrade_test,make_fun_exp,[]}}),
+ expect({trace,Self,call,{my_upgrade_test,make_fun_local,[]}}),
+ expect({trace,Self,call,{my_upgrade_test,version,[]}}), % F1_exp
+ case TraceLocalVersion of
+ true -> expect({trace,Self,call,{my_upgrade_test,local_version,[]}}); % F1_loc
+ _ -> ok
+ end,
+
+ {module,my_upgrade_test} = erlang:load_module(my_upgrade_test, V2),
+ 2 = my_upgrade_test:version(),
+ put('F2_exp', my_upgrade_test:make_fun_exp()),
+ put('F2_loc', my_upgrade_test:make_fun_local()),
+ 2 = (get('F1_exp'))(),
+ 1 = (get('F1_loc'))(),
+ 2 = (get('F2_exp'))(),
+ 2 = (get('F2_loc'))(),
+ expect(),
+
+ put('F1_exp', undefined),
+ put('F1_loc', undefined),
+ erlang:garbage_collect(),
+ erlang:purge_module(my_upgrade_test),
+
+ % Test that trace is cleared after delete_module
+
+ trace_func({my_upgrade_test,'_','_'}, [], [global]),
+ case TraceLocalVersion of
+ true -> trace_func({my_upgrade_test,local_version,0}, [], [local]);
+ _ -> ok
+ end,
+ 2 = my_upgrade_test:version(),
+ 2 = my_upgrade_test:do_local(),
+ 2 = my_upgrade_test:do_real_local(),
+ 2 = (get('F2_exp'))(),
+ 2 = (get('F2_loc'))(),
+
+ expect({trace,Self,call,{my_upgrade_test,version,[]}}),
+ expect({trace,Self,call,{my_upgrade_test,do_local,[]}}),
+ expect({trace,Self,call,{my_upgrade_test,do_real_local,[]}}),
+ case TraceLocalVersion of
+ true -> expect({trace,Self,call,{my_upgrade_test,local_version,[]}});
+ _ -> ok
+ end,
+ expect({trace,Self,call,{my_upgrade_test,version,[]}}), % F2_exp
+ case TraceLocalVersion of
+ true -> expect({trace,Self,call,{my_upgrade_test,local_version,[]}}); % F2_loc
+ _ -> ok
+ end,
+
+ true = erlang:delete_module(my_upgrade_test),
+ {'EXIT',{undef,_}} = (catch my_upgrade_test:version()),
+ {'EXIT',{undef,_}} = (catch ((get('F2_exp'))())),
+ 2 = (get('F2_loc'))(),
+ expect(),
+
+ put('F2_exp', undefined),
+ put('F2_loc', undefined),
+ erlang:garbage_collect(),
+ erlang:purge_module(my_upgrade_test),
+ ok.
+
+compile_version(Module, Version, Config) ->
+ Data = ?config(data_dir, Config),
+ File = filename:join(Data, atom_to_list(Module)),
+ {ok,Module,Bin} = compile:file(File, [{d,'VERSION',Version},
+ binary,report]),
+ Bin.
+
+
+
%% Test flags (arity, timestamp) for call_trace/3.
%% Also, test the '{tracer,Pid}' option.
flags(_Config) ->
@@ -1151,11 +1276,13 @@ trace_info(What, Key) ->
Res.
trace_func(MFA, MatchSpec) ->
- get(tracer) ! {apply,self(),{erlang,trace_pattern,[MFA, MatchSpec]}},
+ trace_func(MFA, MatchSpec, []).
+trace_func(MFA, MatchSpec, Flags) ->
+ get(tracer) ! {apply,self(),{erlang,trace_pattern,[MFA, MatchSpec, Flags]}},
Res = receive
{apply_result,Result} -> Result
end,
- ok = io:format("trace_pattern(~p, ~p) -> ~p", [MFA,MatchSpec,Res]),
+ ok = io:format("trace_pattern(~p, ~p, ~p) -> ~p", [MFA,MatchSpec,Flags,Res]),
Res.
trace_pid(Pid, On, Flags) ->
diff --git a/erts/emulator/test/call_trace_SUITE_data/my_upgrade_test.erl b/erts/emulator/test/call_trace_SUITE_data/my_upgrade_test.erl
new file mode 100644
index 0000000000..11b8a95209
--- /dev/null
+++ b/erts/emulator/test/call_trace_SUITE_data/my_upgrade_test.erl
@@ -0,0 +1,26 @@
+-module(my_upgrade_test).
+
+-export([version/0]).
+-export([do_local/0]).
+-export([do_real_local/0]).
+-export([make_fun_exp/0]).
+-export([make_fun_local/0]).
+
+
+version() ->
+ ?VERSION.
+
+do_local() ->
+ version().
+
+do_real_local() ->
+ local_version().
+
+local_version() ->
+ ?VERSION.
+
+make_fun_exp() ->
+ fun() -> ?MODULE:version() end.
+
+make_fun_local() ->
+ fun() -> local_version() end.
diff --git a/erts/emulator/test/code_SUITE.erl b/erts/emulator/test/code_SUITE.erl
index 25ce94096f..b0408cabe1 100644
--- a/erts/emulator/test/code_SUITE.erl
+++ b/erts/emulator/test/code_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -135,14 +135,7 @@ new_binary_types(Config) when is_list(Config) ->
bit_sized_binary(Bin))),
ok.
-t_check_process_code(doc) -> "Test check_process_code/2.";
t_check_process_code(Config) when is_list(Config) ->
- case erlang:system_info(heap_type) of
- private -> t_check_process_code_1(Config);
- hybrid -> {skip,"Hybrid heap"}
- end.
-
-t_check_process_code_1(Config) ->
?line Priv = ?config(priv_dir, Config),
?line Data = ?config(data_dir, Config),
?line File = filename:join(Data, "my_code_test"),
@@ -247,12 +240,10 @@ gc1() -> ok.
t_check_process_code_ets(doc) ->
"Test check_process_code/2 in combination with a fun obtained from an ets table.";
t_check_process_code_ets(Config) when is_list(Config) ->
- case {test_server:is_native(?MODULE),erlang:system_info(heap_type)} of
- {true,_} ->
- {skipped,"Native code"};
- {_,hybrid} ->
- {skipped,"Hybrid heap"};
- {false,private} ->
+ case test_server:is_native(?MODULE) of
+ true ->
+ {skip,"Native code"};
+ false ->
do_check_process_code_ets(Config)
end.
@@ -397,9 +388,7 @@ module_md5_ok(Code) ->
make_stub(Config) when is_list(Config) ->
- %% No old code to purge if hybrid heap because of skipped test cases,
- %% so we'll need a catch here.
- ?line (catch erlang:purge_module(my_code_test)),
+ catch erlang:purge_module(my_code_test),
?line Data = ?config(data_dir, Config),
?line File = filename:join(Data, "my_code_test"),
@@ -433,9 +422,7 @@ make_stub(Config) when is_list(Config) ->
ok.
make_stub_many_funs(Config) when is_list(Config) ->
- %% No old code to purge if hybrid heap because of skipped test cases,
- %% so we'll need a catch here.
- ?line (catch erlang:purge_module(many_funs)),
+ catch erlang:purge_module(many_funs),
?line Data = ?config(data_dir, Config),
?line File = filename:join(Data, "many_funs"),
diff --git a/erts/emulator/test/code_parallel_load_SUITE.erl b/erts/emulator/test/code_parallel_load_SUITE.erl
new file mode 100644
index 0000000000..aa9e4c96c6
--- /dev/null
+++ b/erts/emulator/test/code_parallel_load_SUITE.erl
@@ -0,0 +1,198 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+%% Author: Björn-Egil Dahlberg
+
+-module(code_parallel_load_SUITE).
+-export([
+ all/0,
+ suite/0,
+ init_per_suite/1,
+ end_per_suite/1,
+ init_per_testcase/2,
+ end_per_testcase/2
+ ]).
+
+-export([
+ multiple_load_check_purge_repeat/1,
+ many_load_distributed_only_once/1
+ ]).
+
+-define(model, code_parallel_load_SUITE_model).
+-define(interval, 50).
+-define(number_of_processes, 160).
+-define(passes, 4).
+
+
+-include_lib("test_server/include/test_server.hrl").
+
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [
+ multiple_load_check_purge_repeat,
+ many_load_distributed_only_once
+ ].
+
+
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(_Config) ->
+ ok.
+
+init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
+ Dog=?t:timetrap(?t:minutes(3)),
+ [{watchdog, Dog}|Config].
+
+end_per_testcase(_Func, Config) ->
+ SConf = ?config(save_config, Config),
+ Pids = proplists:get_value(purge_pids, SConf),
+
+ case check_old_code(?model) of
+ true -> check_and_purge_processes_code(Pids, ?model);
+ _ -> ok
+ end,
+ case erlang:delete_module(?model) of
+ true -> check_and_purge_processes_code(Pids, ?model);
+ _ -> ok
+ end,
+ Dog=?config(watchdog, Config),
+ ?t:timetrap_cancel(Dog).
+
+
+multiple_load_check_purge_repeat(_Conf) ->
+ Ts = [v1,v2,v3,v4,v5,v6],
+
+ %% generate code that receives a token, code switches to new code
+ %% then matches this token against a literal code token
+ %% should be identical
+ %% (smoke test for parallel code loading
+ Codes = [{T, generate(?model, [], [
+ format("check(T) -> receive {_Pid, change, T1} -> "
+ " ~w:check(T1)\n"
+ " after 0 -> T = f(), check(T) end.\n", [?model]),
+ format("f() -> ~w.~n", [T])
+ ])} || T <- Ts],
+
+ Pids = setup_code_changer(Codes),
+ {save_config, [{purge_pids,Pids}]}.
+
+setup_code_changer([{Token,Code}|Cs] = Codes) ->
+ {module, ?model} = erlang:load_module(?model,Code),
+ Pids = setup_checkers(Token,?number_of_processes),
+ code_changer(Cs, Codes, ?interval,Pids,?passes),
+ Pids.
+
+code_changer(_, _, _, Pids, 0) ->
+ [unlink(Pid) || Pid <- Pids],
+ [exit(Pid, die) || Pid <- Pids],
+ io:format("done~n"),
+ ok;
+code_changer([], Codes, T, Pids, Ps) ->
+ code_changer(Codes, Codes, T, Pids, Ps - 1);
+code_changer([{Token,Code}|Cs], Codes, T, Pids, Ps) ->
+ receive after T ->
+ io:format("load code with token ~4w : pass ~4w~n", [Token, Ps]),
+ {module, ?model} = erlang:load_module(?model, Code),
+ % this is second time we call load_module for this module
+ % so it should have old code
+ [Pid ! {self(), change, Token} || Pid <- Pids],
+ % should we wait a moment or just blantantly try to check and purge repeatadly?
+ receive after 1 -> ok end,
+ ok = check_and_purge_processes_code(Pids, ?model),
+ code_changer(Cs, Codes, T, Pids, Ps)
+ end.
+
+
+
+many_load_distributed_only_once(_Conf) ->
+ Ts = [<<"first version">>, <<"second version">>],
+
+ [{Token1,Code1},{Token2, Code2}] = [{T, generate(?model, [], [
+ "check({<<\"second version\">> = V, Pid}) -> V = f(), Pid ! {self(), completed, V}, ok;\n" ++
+ format("check(T) -> receive {Pid, change, T1, B} -> "
+ " Res = erlang:load_module(~w, B), Pid ! {self(), change, Res},\n"
+ " ~w:check({T1, Pid})\n"
+ " after 0 -> T = f(), check(T) end.\n", [?model, ?model]),
+ format("f() -> ~w.~n", [T])
+ ])} || T <- Ts],
+
+
+ {module, ?model} = erlang:load_module(?model, Code1),
+ Pids = setup_checkers(Token1,?number_of_processes),
+
+ receive after 1000 -> ok end, % give 'em some time to spin up
+ [Pid ! {self(), change, Token2, Code2} || Pid <- Pids],
+ Loads = [receive {Pid, change, Res} -> Res end || Pid <- Pids],
+ [receive {Pid, completed, Token2} -> ok end || Pid <- Pids],
+
+ ok = ensure_only_one_load(Loads, 0),
+ {save_config, [{purge_pids,Pids}]}.
+
+ensure_only_one_load([], 1) -> ok;
+ensure_only_one_load([], _) -> too_many_loads;
+ensure_only_one_load([{module, ?model}|Loads], N) ->
+ ensure_only_one_load(Loads, N + 1);
+ensure_only_one_load([{error, not_purged}|Loads], N) ->
+ ensure_only_one_load(Loads, N).
+% no other return values are allowed from load_module
+
+
+%% aux
+
+setup_checkers(_,0) -> [];
+setup_checkers(T,N) -> [spawn_link(fun() -> ?model:check(T) end) | setup_checkers(T, N-1)].
+
+check_and_purge_processes_code(Pids, M) ->
+ check_and_purge_processes_code(Pids, M, []).
+check_and_purge_processes_code([], M, []) ->
+ erlang:purge_module(M),
+ ok;
+check_and_purge_processes_code([], M, Pending) ->
+ io:format("Processes ~w are still executing old code - retrying.~n", [Pending]),
+ check_and_purge_processes_code(Pending, M, []);
+check_and_purge_processes_code([Pid|Pids], M, Pending) ->
+ case erlang:check_process_code(Pid, M) of
+ false ->
+ check_and_purge_processes_code(Pids, M, Pending);
+ true ->
+ check_and_purge_processes_code(Pids, M, [Pid|Pending])
+ end.
+
+
+generate(Module, Attributes, FunStrings) ->
+ FunForms = function_forms(FunStrings),
+ Forms = [
+ {attribute,1,module,Module},
+ {attribute,2,export,[FA || {FA,_} <- FunForms]}
+ ] ++ [{attribute, 3, A, V}|| {A, V} <- Attributes] ++
+ [ Function || {_, Function} <- FunForms],
+ {ok, Module, Bin} = compile:forms(Forms),
+ Bin.
+
+
+function_forms([]) -> [];
+function_forms([S|Ss]) ->
+ {ok, Ts,_} = erl_scan:string(S),
+ {ok, Form} = erl_parse:parse_form(Ts),
+ Fun = element(3, Form),
+ Arity = element(4, Form),
+ [{{Fun,Arity}, Form}|function_forms(Ss)].
+
+format(F,Ts) -> lists:flatten(io_lib:format(F, Ts)).
diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl
index 08308629fe..f3a177faf2 100644
--- a/erts/emulator/test/distribution_SUITE.erl
+++ b/erts/emulator/test/distribution_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -98,19 +98,6 @@ end_per_testcase(Func, Config) when is_atom(Func), is_list(Config) ->
Dog=?config(watchdog, Config),
?t:timetrap_cancel(Dog).
-%%% Don't be too hard on vxworks, the cross server gets nodedown
-%%% cause the card is too busy if we don't sleep a little between pings.
-sleep() ->
- case os:type() of
- vxworks ->
- receive
- after 10 ->
- ok
- end;
- _ ->
- ok
- end.
-
ping(doc) ->
["Tests pinging a node in different ways."];
ping(Config) when is_list(Config) ->
@@ -122,23 +109,21 @@ ping(Config) when is_list(Config) ->
?line Host = hostname(),
?line BadName = list_to_atom("__pucko__@" ++ Host),
?line io:format("Pinging ~s (assumed to not exist)", [BadName]),
- ?line test_server:do_times(Times,
- fun() -> pang = net_adm:ping(BadName),
- sleep()
+ ?line test_server:do_times(Times, fun() -> pang = net_adm:ping(BadName)
end),
%% Pings another node.
?line {ok, OtherNode} = start_node(distribution_SUITE_other),
?line io:format("Pinging ~s (assumed to exist)", [OtherNode]),
- ?line test_server:do_times(Times, fun() -> pong = net_adm:ping(OtherNode),sleep() end),
+ ?line test_server:do_times(Times, fun() -> pong = net_adm:ping(OtherNode) end),
?line stop_node(OtherNode),
%% Pings our own node many times.
?line Node = node(),
?line io:format("Pinging ~s (the same node)", [Node]),
- ?line test_server:do_times(Times, fun() -> pong = net_adm:ping(Node),sleep() end),
+ ?line test_server:do_times(Times, fun() -> pong = net_adm:ping(Node) end),
ok.
@@ -1890,7 +1875,7 @@ start_node(Name, Args, Rel) when is_atom(Name), is_list(Rel) ->
end,
test_server:start_node(Name, slave,
[{args,
- Args++" -setcookie "++Cookie++" -pa "++Pa}
+ Args++" -setcookie "++Cookie++" -pa \""++Pa++"\""}
| RelArg]);
start_node(Config, Args, Rel) when is_list(Config), is_list(Rel) ->
Name = list_to_atom((atom_to_list(?MODULE)
diff --git a/erts/emulator/test/driver_SUITE_data/chkio_drv.c b/erts/emulator/test/driver_SUITE_data/chkio_drv.c
index 40f1ad4fea..faf1040276 100644
--- a/erts/emulator/test/driver_SUITE_data/chkio_drv.c
+++ b/erts/emulator/test/driver_SUITE_data/chkio_drv.c
@@ -17,7 +17,7 @@
*/
#ifndef UNIX
-#if !defined(__WIN32__) && !defined(VXWORKS)
+#if !defined(__WIN32__)
#define UNIX 1
#endif
#endif
diff --git a/erts/emulator/test/driver_SUITE_data/io_ready_exit_drv.c b/erts/emulator/test/driver_SUITE_data/io_ready_exit_drv.c
index e6a3edcd74..1e107309df 100644
--- a/erts/emulator/test/driver_SUITE_data/io_ready_exit_drv.c
+++ b/erts/emulator/test/driver_SUITE_data/io_ready_exit_drv.c
@@ -17,7 +17,7 @@
*/
#ifndef UNIX
-#if !defined(__WIN32__) && !defined(VXWORKS)
+#if !defined(__WIN32__)
#define UNIX 1
#endif
#endif
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 b2cc1e785a..d174771629 100644
--- a/erts/emulator/test/driver_SUITE_data/ioq_exit_drv.c
+++ b/erts/emulator/test/driver_SUITE_data/ioq_exit_drv.c
@@ -29,7 +29,7 @@
*/
#ifndef UNIX
-#if !defined(__WIN32__) && !defined(VXWORKS)
+#if !defined(__WIN32__)
#define UNIX 1
#endif
#endif
diff --git a/erts/emulator/test/driver_SUITE_data/missing_callback_drv.c b/erts/emulator/test/driver_SUITE_data/missing_callback_drv.c
index e7d9a294fa..851f2c745b 100644
--- a/erts/emulator/test/driver_SUITE_data/missing_callback_drv.c
+++ b/erts/emulator/test/driver_SUITE_data/missing_callback_drv.c
@@ -17,7 +17,7 @@
*/
#ifndef UNIX
-#if !defined(__WIN32__) && !defined(VXWORKS)
+#if !defined(__WIN32__)
#define UNIX 1
#endif
#endif
diff --git a/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c b/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c
index 8e203f74ec..0c86a26604 100644
--- a/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c
+++ b/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c
@@ -28,7 +28,7 @@
*/
#ifndef UNIX
-#if !defined(__WIN32__) && !defined(VXWORKS)
+#if !defined(__WIN32__)
#define UNIX 1
#endif
#endif
diff --git a/erts/emulator/test/driver_SUITE_data/timer_drv.c b/erts/emulator/test/driver_SUITE_data/timer_drv.c
index 8c3f203a64..57538e0d57 100644
--- a/erts/emulator/test/driver_SUITE_data/timer_drv.c
+++ b/erts/emulator/test/driver_SUITE_data/timer_drv.c
@@ -1,11 +1,3 @@
-#ifdef VXWORKS
-#include <vxWorks.h>
-#include <taskVarLib.h>
-#include <taskLib.h>
-#include <sysLib.h>
-#include <string.h>
-#include <ioLib.h>
-#endif
#include <stdio.h>
#include "erl_driver.h"
@@ -84,12 +76,8 @@ static void timer_read(ErlDrvData p, char *buf, ErlDrvSizeT len)
driver_output(port, reply, 1);
} else if (buf[0] == DELAY_START_TIMER) {
#ifndef __WIN32__
-#ifdef VXWORKS
- taskDelay(sysClkRateGet());
-#else
sleep(1);
#endif
-#endif
driver_set_timer(port, get_int32(buf + 1));
}
}
diff --git a/erts/emulator/test/emulator.spec b/erts/emulator/test/emulator.spec
index 1ea751cc3b..7a6dd83020 100644
--- a/erts/emulator/test/emulator.spec
+++ b/erts/emulator/test/emulator.spec
@@ -1 +1,2 @@
+{enable_builtin_hooks, false}.
{suites,"../emulator_test",all}.
diff --git a/erts/emulator/test/emulator.spec.vxworks b/erts/emulator/test/emulator.spec.vxworks
deleted file mode 100644
index 55675bdc29..0000000000
--- a/erts/emulator/test/emulator.spec.vxworks
+++ /dev/null
@@ -1,26 +0,0 @@
-{topcase, {dir, "../emulator_test"}}.
-
-% Added since R11
-{skip,{distribution_SUITE,link_to_dead_new_node,"Does not work in distributed test environments"}}.
-{skip,{binary_SUITE,terms_float,"Floats, VxWorks, PPC = Floating points never equal..."}}.
-{skip,{system_info_SUITE,process_count,"Fix-allocs starving VxWorks cards"}}.
-{skip,{monitor_SUITE,mixer,"Fix-allocs starving VxWorks cards"}}.
-
-{skip,{node_container_SUITE,"Too memory consuming..."}}.
-
-{skip,{trace_SUITE,system_monitor_long_gc_1,"Too memory consuming..."}}.
-{skip,{trace_SUITE,system_monitor_long_gc_2,"Too memory consuming..."}}.
-{skip,{trace_SUITE,system_monitor_large_heap_1,"Too memory consuming..."}}.
-{skip,{trace_SUITE,system_monitor_large_heap_2,"Too memory consuming..."}}.
-% End added since R11
-
-{skip, {distribution_SUITE,stop_dist,"Not written to work on VxWorks."}}.
-{skip, {distribution_SUITE,dist_auto_connect_never,
- "Not written to work on VxWorks."}}.
-{skip, {distribution_SUITE,dist_auto_connect_once,
- "Not written to work on VxWorks."}}.
-{skip, {trace_SUITE,system_monitor_long_gc,
- "Too memory consuming for VxWorks cards."}}.
-{skip, {trace_meta_SUITE,stack_grow,
- "Too memory consuming for VxWorks cards."}}.
-{skip, {obsolete_SUITE, "Not on vxworks"}}.
diff --git a/erts/emulator/test/emulator_bench.spec b/erts/emulator/test/emulator_bench.spec
new file mode 100644
index 0000000000..f709d913b7
--- /dev/null
+++ b/erts/emulator/test/emulator_bench.spec
@@ -0,0 +1 @@
+{groups,"../emulator_test",estone_SUITE,[estone_bench]}.
diff --git a/erts/emulator/test/erts_debug_SUITE.erl b/erts/emulator/test/erts_debug_SUITE.erl
index 4dc2fbaae2..87778dd0c2 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -23,13 +23,13 @@
-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,
- flat_size/1,flat_size_big/1,df/1,
+ test_size/1,flat_size_big/1,df/1,
instructions/1]).
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [flat_size, flat_size_big, df, instructions].
+ [test_size, flat_size_big, df, instructions].
groups() ->
[].
@@ -55,16 +55,58 @@ end_per_testcase(_Func, Config) ->
Dog=?config(watchdog, Config),
?t:timetrap_cancel(Dog).
-flat_size(Config) when is_list(Config) ->
- 0 = erts_debug:flat_size([]),
- 0 = erts_debug:flat_size(42),
- 2 = erts_debug:flat_size([a|b]),
- 1 = erts_debug:flat_size({}),
- 2 = erts_debug:flat_size({[]}),
- 3 = erts_debug:flat_size({a,b}),
- 7 = erts_debug:flat_size({a,[b,c]}),
+test_size(Config) when is_list(Config) ->
+ ConsCell1 = id([a|b]),
+ ConsCell2 = id(ConsCell1),
+ ConsCellSz = 2,
+
+ 0 = do_test_size([]),
+ 0 = do_test_size(42),
+ ConsCellSz = do_test_size(ConsCell1),
+ 1 = do_test_size({}),
+ 2 = do_test_size({[]}),
+ 3 = do_test_size({a,b}),
+ 7 = do_test_size({a,[b,c]}),
+
+ %% Test internal consistency of sizes, but without testing
+ %% exact sizes.
+ Const = id(42),
+ AnotherConst = id(7),
+
+ %% Fun environment size = 0 (the smallest fun possible)
+ SimplestFun = fun() -> ok end,
+ FunSz0 = do_test_size(SimplestFun),
+
+ %% Fun environment size = 1
+ FunSz1 = do_test_size(fun() -> Const end),
+ FunSz1 = FunSz0 + 1,
+
+ %% Fun environment size = 2
+ FunSz2 = do_test_size(fun() -> Const+AnotherConst end),
+ FunSz2 = FunSz1 + 1,
+
+ FunSz1 = do_test_size(fun() -> ConsCell1 end) - do_test_size(ConsCell1),
+
+ %% Test shared data structures.
+ do_test_size([ConsCell1|ConsCell1],
+ 3*ConsCellSz,
+ 2*ConsCellSz),
+ do_test_size(fun() -> {ConsCell1,ConsCell2} end,
+ FunSz2 + 2*ConsCellSz,
+ FunSz2 + ConsCellSz),
+ do_test_size({SimplestFun,SimplestFun},
+ 2*FunSz0+do_test_size({a,b}),
+ FunSz0+do_test_size({a,b})),
ok.
+do_test_size(Term) ->
+ Sz = erts_debug:flat_size(Term),
+ Sz = erts_debug:size(Term).
+
+do_test_size(Term, FlatSz, Sz) ->
+ FlatSz = erts_debug:flat_size(Term),
+ Sz = erts_debug:size(Term).
+
flat_size_big(Config) when is_list(Config) ->
%% Build a term whose external size only fits in a big num (on 32-bit CPU).
flat_size_big_1(16#11111111111111117777777777777777888889999, 0, 16#FFFFFFF).
@@ -96,3 +138,6 @@ instructions(Config) when is_list(Config) ->
?line Is = erts_debug:instructions(),
?line _ = [list_to_atom(I) || I <- Is],
ok.
+
+id(I) ->
+ I.
diff --git a/erts/emulator/test/estone_SUITE.erl b/erts/emulator/test/estone_SUITE.erl
index 2417d4bcfe..21834bfa62 100644
--- a/erts/emulator/test/estone_SUITE.erl
+++ b/erts/emulator/test/estone_SUITE.erl
@@ -19,7 +19,7 @@
-module(estone_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,estone/1]).
+ init_per_group/2,end_per_group/2,estone/1,estone_bench/1]).
-export([init_per_testcase/2, end_per_testcase/2]).
%% Internal exports for EStone tests
@@ -46,6 +46,7 @@
-include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct_event.hrl").
%% Test suite defines
-define(default_timeout, ?t:minutes(10)).
@@ -80,7 +81,7 @@ all() ->
[estone].
groups() ->
- [].
+ [{estone_bench, [{repeat,50}],[estone_bench]}].
init_per_suite(Config) ->
Config.
@@ -108,6 +109,17 @@ estone(Config) when is_list(Config) ->
?line {comment,Mhz ++ " MHz, " ++
integer_to_list(Stones) ++ " ESTONES"}.
+estone_bench(Config) ->
+ DataDir = ?config(data_dir,Config),
+ L = ?MODULE:macro(?MODULE:micros(),DataDir),
+ [ct_event:notify(
+ #event{name = benchmark_data,
+ data = [{name,proplists:get_value(title,Mark)},
+ {value,proplists:get_value(estones,Mark)}]})
+ || Mark <- L],
+ L.
+
+
%%
%% Calculate CPU speed
%%
diff --git a/erts/emulator/test/estone_SUITE_data/estone_cat.c b/erts/emulator/test/estone_SUITE_data/estone_cat.c
index 8ed9f8375b..a34bda4384 100644
--- a/erts/emulator/test/estone_SUITE_data/estone_cat.c
+++ b/erts/emulator/test/estone_SUITE_data/estone_cat.c
@@ -12,11 +12,7 @@
#include <fcntl.h>
#include <errno.h>
-#ifdef VXWORKS
-estone_cat(argc, argv)
-#else
main(argc, argv)
-#endif
int argc;
char *argv[];
{
diff --git a/erts/emulator/test/float_SUITE.erl b/erts/emulator/test/float_SUITE.erl
index 8e6923ce9f..4a45afa9e9 100644
--- a/erts/emulator/test/float_SUITE.erl
+++ b/erts/emulator/test/float_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -25,7 +25,7 @@
init_per_group/2,end_per_group/2,
init_per_testcase/2,end_per_testcase/2,
fpe/1,fp_drv/1,fp_drv_thread/1,denormalized/1,match/1,
- bad_float_unpack/1,cmp_zero/1, cmp_integer/1, cmp_bignum/1]).
+ bad_float_unpack/1, write/1, cmp_zero/1, cmp_integer/1, cmp_bignum/1]).
-export([otp_7178/1]).
-export([hidden_inf/1]).
@@ -42,7 +42,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[fpe, fp_drv, fp_drv_thread, otp_7178, denormalized,
- match, bad_float_unpack, {group, comparison}
+ match, bad_float_unpack, write, {group, comparison}
,hidden_inf
].
@@ -190,6 +190,11 @@ bad_float_unpack(Config) when is_list(Config) ->
bad_float_unpack_match(<<F:64/float>>) -> F;
bad_float_unpack_match(<<I:64/integer-signed>>) -> I.
+%% Exposes endianness issues.
+
+write(Config) when is_list(Config) ->
+ "1.0" = io_lib:write(1.0).
+
cmp_zero(_Config) ->
cmp(0.5e-323,0).
diff --git a/erts/emulator/test/fun_SUITE.erl b/erts/emulator/test/fun_SUITE.erl
index 559e540016..ef06845cf2 100644
--- a/erts/emulator/test/fun_SUITE.erl
+++ b/erts/emulator/test/fun_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -539,12 +539,6 @@ bad_md5(Bad) ->
{'EXIT',{badarg,_}} = (catch erlang:md5(Bad)).
refc(Config) when is_list(Config) ->
- case erlang:system_info(heap_type) of
- private -> refc_1();
- hybrid -> {skip,"Hybrid heap"}
- end.
-
-refc_1() ->
?line F1 = fun_factory(2),
?line {refc,2} = erlang:fun_info(F1, refc),
?line F2 = fun_factory(42),
@@ -570,12 +564,6 @@ fun_factory(Const) ->
fun(X) -> X + Const end.
refc_ets(Config) when is_list(Config) ->
- case erlang:system_info(heap_type) of
- private -> refc_ets_1();
- hybrid -> {skip,"Hybrid heap"}
- end.
-
-refc_ets_1() ->
?line F = fun(X) -> X + 33 end,
?line {refc,2} = erlang:fun_info(F, refc),
@@ -622,12 +610,6 @@ refc_ets_bag(F1, Options) ->
ok.
refc_dist(Config) when is_list(Config) ->
- case erlang:system_info(heap_type) of
- private -> refc_dist_1();
- hybrid -> {skip,"Hybrid heap"}
- end.
-
-refc_dist_1() ->
?line {ok,Node} = start_node(fun_SUITE_refc_dist),
?line process_flag(trap_exit, true),
?line Pid = spawn_link(Node,
diff --git a/erts/emulator/test/gc_SUITE.erl b/erts/emulator/test/gc_SUITE.erl
index 771d2c9a7a..19fa433a53 100644
--- a/erts/emulator/test/gc_SUITE.erl
+++ b/erts/emulator/test/gc_SUITE.erl
@@ -54,17 +54,12 @@ grow_heap(doc) -> ["Produce a growing list of elements, ",
"for X calls, then drop one item per call",
"until the list is empty."];
grow_heap(Config) when is_list(Config) ->
- ?line Dog=test_server:timetrap(test_server:minutes(40)),
- ?line ok=grow_heap1(256),
- case os:type() of
- vxworks ->
- stop_here;
- _ ->
- ?line ok=grow_heap1(512),
- ?line ok=grow_heap1(1024),
- ?line ok=grow_heap1(2048)
- end,
- ?line test_server:timetrap_cancel(Dog),
+ Dog = test_server:timetrap(test_server:minutes(40)),
+ ok = grow_heap1(256),
+ ok = grow_heap1(512),
+ ok = grow_heap1(1024),
+ ok = grow_heap1(2048),
+ test_server:timetrap_cancel(Dog),
ok.
grow_heap1(Len) ->
@@ -82,10 +77,10 @@ grow_heap1(List, MaxLen, CurLen, up) ->
grow_heap1([], _MaxLen, _, down) ->
ok;
grow_heap1([_|List], MaxLen, CurLen, down) ->
- ?line {_,_,C}=erlang:now(),
- ?line Num=C rem (length(List))+1,
- ?line Elem=lists:nth(Num, List),
- ?line NewList=lists:delete(Elem, List),
+ {_,_,C} = erlang:now(),
+ Num = C rem (length(List))+1,
+ Elem = lists:nth(Num, List),
+ NewList = lists:delete(Elem, List),
grow_heap1(NewList, MaxLen, CurLen-1, down).
@@ -93,16 +88,11 @@ grow_heap1([_|List], MaxLen, CurLen, down) ->
grow_stack(doc) -> ["Increase and decrease stack size, and ",
"drop off some garbage from time to time."];
grow_stack(Config) when is_list(Config) ->
- ?line Dog=test_server:timetrap(test_server:minutes(80)),
+ Dog = test_server:timetrap(test_server:minutes(80)),
show_heap("before:"),
- case os:type() of
- vxworks ->
- ?line grow_stack1(25, 0);
- _ ->
- ?line grow_stack1(200, 0)
- end,
+ grow_stack1(200, 0),
show_heap("after:"),
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
ok.
grow_stack1(0, _) ->
@@ -123,16 +113,11 @@ grow_stack_heap(doc) -> ["While growing the heap, bounces the size ",
"of the stack, and while reducing the heap",
"bounces the stack usage."];
grow_stack_heap(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {comment, "Takes too long to run on VxWorks/cpu32"};
- _ ->
- ?line Dog=test_server:timetrap(test_server:minutes(40)),
- ?line grow_stack_heap1(16),
- ?line grow_stack_heap1(32),
- ?line test_server:timetrap_cancel(Dog),
- ok
- end.
+ Dog = test_server:timetrap(test_server:minutes(40)),
+ grow_stack_heap1(16),
+ grow_stack_heap1(32),
+ test_server:timetrap_cancel(Dog),
+ ok.
grow_stack_heap1(MaxLen) ->
io:format("~ngrow_stack_heap with ~p items.",[MaxLen]),
@@ -151,10 +136,10 @@ grow_stack_heap1(List, MaxLen, CurLen, up) ->
grow_stack_heap1([], _MaxLen, _, down) -> ok;
grow_stack_heap1([_|List], MaxLen, CurLen, down) ->
grow_stack1(CurLen*2,0),
- ?line {_,_,C}=erlang:now(),
- ?line Num=C rem (length(List))+1,
- ?line Elem=lists:nth(Num, List),
- ?line NewList=lists:delete(Elem, List),
+ {_,_,C}=erlang:now(),
+ Num=C rem (length(List))+1,
+ Elem=lists:nth(Num, List),
+ NewList=lists:delete(Elem, List),
grow_stack_heap1(NewList, MaxLen, CurLen-1, down),
ok.
diff --git a/erts/emulator/test/hibernate_SUITE.erl b/erts/emulator/test/hibernate_SUITE.erl
index 82a0aad189..31938e6c65 100644
--- a/erts/emulator/test/hibernate_SUITE.erl
+++ b/erts/emulator/test/hibernate_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -67,10 +67,7 @@ end_per_testcase(_Func, Config) ->
basic(Config) when is_list(Config) ->
Ref = make_ref(),
Info = {self(),Ref},
- ExpectedHeapSz = case erlang:system_info(heap_type) of
- private -> erts_debug:size([Info]);
- hybrid -> erts_debug:size([a|b])
- end,
+ ExpectedHeapSz = erts_debug:size([Info]),
?line Child = spawn_link(fun() -> basic_hibernator(Info) end),
?line hibernate_wake_up(100, ExpectedHeapSz, Child),
?line Child ! please_quit_now,
@@ -166,10 +163,7 @@ whats_up_calc(A1, A2, A3, A4, A5, A6, A7, A8, A9, Acc) ->
dynamic_call(Config) when is_list(Config) ->
Ref = make_ref(),
Info = {self(),Ref},
- ExpectedHeapSz = case erlang:system_info(heap_type) of
- private -> erts_debug:size([Info]);
- hybrid -> erts_debug:size([a|b])
- end,
+ ExpectedHeapSz = erts_debug:size([Info]),
?line Child = spawn_link(fun() -> ?MODULE:dynamic_call_hibernator(Info, hibernate) end),
?line hibernate_wake_up(100, ExpectedHeapSz, Child),
?line Child ! please_quit_now,
diff --git a/erts/emulator/test/mtx_SUITE_data/Makefile.src b/erts/emulator/test/mtx_SUITE_data/Makefile.src
index b6c843269c..37eb1daa72 100644
--- a/erts/emulator/test/mtx_SUITE_data/Makefile.src
+++ b/erts/emulator/test/mtx_SUITE_data/Makefile.src
@@ -27,4 +27,11 @@ LIBS = @ERTS_LIBS@
all: $(NIF_LIBS)
+mtx_SUITE.c: force_rebuild
+ touch mtx_SUITE.c
+
+force_rebuild:
+ echo "Force rebuild to compensate for emulator type dependencies"
+
+
@SHLIB_RULES@
diff --git a/erts/emulator/test/node_container_SUITE.erl b/erts/emulator/test/node_container_SUITE.erl
index aa83459ef8..3f9b339ed2 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -459,10 +459,6 @@ make_node_garbage(_, _, _, Ps) ->
end,
lists:foreach(fun (P) -> wait_until(fun () -> ProcIsCleanedUp(P) end) end,
Ps),
- ?line case erlang:system_info(heap_type) of
- shared -> ?line garbage_collect();
- _ -> ?line ok
- end,
?line ok.
@@ -605,17 +601,7 @@ node_controller_refc(Config) when is_list(Config) ->
% Get rid of all references to Node
?line exec(P, fun () -> exit(normal) end),
?line wait_until(fun () -> not is_process_alive(P) end),
- ?line case erlang:system_info(heap_type) of
- shared ->
- ?line garbage_collect();
- hybrid ->
- ?line lists:foreach(fun (Proc) -> garbage_collect(Proc) end,
- processes()),
- ?line erlang:garbage_collect_message_area();
- _ ->
- ?line lists:foreach(fun (Proc) -> garbage_collect(Proc) end,
- processes())
- end,
+ lists:foreach(fun (Proc) -> garbage_collect(Proc) end, processes()),
?line false = get_node_references({Node,Creation}),
?line false = get_dist_references(Node),
?line false = lists:member(Node, nodes(known)),
diff --git a/erts/emulator/test/nofrag_SUITE.erl b/erts/emulator/test/nofrag_SUITE.erl
index 6b6ac28e2e..71567ed0cb 100644
--- a/erts/emulator/test/nofrag_SUITE.erl
+++ b/erts/emulator/test/nofrag_SUITE.erl
@@ -26,7 +26,6 @@
init_per_testcase/2,end_per_testcase/2,
error_handler/1,error_handler_apply/1,
error_handler_fixed_apply/1,error_handler_fun/1,
- error_handler_tuple_fun/1,
debug_breakpoint/1]).
%% Exported functions for an error_handler module.
@@ -37,7 +36,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[error_handler, error_handler_apply,
error_handler_fixed_apply, error_handler_fun,
- error_handler_tuple_fun, debug_breakpoint].
+ debug_breakpoint].
groups() ->
[].
@@ -178,29 +177,6 @@ collect_fun(N, Fun) ->
undefined_lambda(foobarblurf, Fun, Args) when is_function(Fun) ->
Args.
-error_handler_tuple_fun(Config) when is_list(Config) ->
- ?line process_flag(error_handler, ?MODULE),
- ?line Term = collect_tuple_fun(1024, {?MODULE,very_undefined_function}),
- ?line Term = binary_to_term(term_to_binary(Term)),
- ?line 1024 = length(Term),
- ?line [[{foo,bar},42.0,[e,f,g]]] = lists:usort(Term),
- ok.
-
-collect_tuple_fun(0, _) ->
- [];
-collect_tuple_fun(N, Fun) ->
- %% The next line calls the error handle function, which is
- %% ?MODULE:undefined_function/3 (it simply returns the list
- %% of args).
- C = Fun({foo,id(bar)}, 42.0, [e,f,id(g)]),
-
- %% The variable C will be saved onto the stack frame; if C
- %% points into a heap fragment the garbage collector will reach
- %% it and the emulator will crash sooner or later (sooner if
- %% the emulator is debug-compiled).
- Res = collect_tuple_fun(N-1, Fun),
- [C|Res].
-
debug_breakpoint(Config) when is_list(Config) ->
?line process_flag(error_handler, ?MODULE),
?line erts_debug:breakpoint({?MODULE,foobar,5}, true),
diff --git a/erts/emulator/test/port_SUITE.erl b/erts/emulator/test/port_SUITE.erl
index 0a1ef5a78f..873601ddd1 100644
--- a/erts/emulator/test/port_SUITE.erl
+++ b/erts/emulator/test/port_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -157,16 +157,16 @@ win_massive(Config) when is_list(Config) ->
end.
do_win_massive() ->
- ?line Dog = test_server:timetrap(test_server:seconds(360)),
- ?line SuiteDir = filename:dirname(code:which(?MODULE)),
- ?line Env = " -env ERL_MAX_PORTS 8192",
- ?line {ok, Node} =
+ Dog = test_server:timetrap(test_server:seconds(360)),
+ SuiteDir = filename:dirname(code:which(?MODULE)),
+ Env = " -env ERL_MAX_PORTS 8192",
+ {ok, Node} =
test_server:start_node(win_massive,
slave,
[{args, " -pa " ++ SuiteDir ++ Env}]),
- ?line ok = rpc:call(Node,?MODULE,win_massive_client,[3000]),
- ?line test_server:stop_node(Node),
- ?line test_server:timetrap_cancel(Dog),
+ ok = rpc:call(Node,?MODULE,win_massive_client,[3000]),
+ test_server:stop_node(Node),
+ test_server:timetrap_cancel(Dog),
ok.
win_massive_client(N) ->
@@ -208,11 +208,11 @@ win_massive_loop(P,N) ->
%% We will send only a small amount of data, to avoid deadlock.
stream_small(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line stream_ping(Config, 512, "", []),
- ?line stream_ping(Config, 1777, "", []),
- ?line stream_ping(Config, 1777, "-s512", []),
- ?line test_server:timetrap_cancel(Dog),
+ Dog = test_server:timetrap(test_server:seconds(10)),
+ stream_ping(Config, 512, "", []),
+ stream_ping(Config, 1777, "", []),
+ stream_ping(Config, 1777, "-s512", []),
+ test_server:timetrap_cancel(Dog),
ok.
%% Send big amounts of data (much bigger than the buffer size in port test).
@@ -220,30 +220,22 @@ stream_small(Config) when is_list(Config) ->
%% non-blocking reads and writes.
stream_big(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(180)),
- case os:type() of
- vxworks ->
- %% Don't stress VxWorks too much
- ?line stream_ping(Config, 43755, "", []),
- ?line stream_ping(Config, 51255, "", []),
- ?line stream_ping(Config, 52345, " -s40000", []);
- _ ->
- ?line stream_ping(Config, 43755, "", []),
- ?line stream_ping(Config, 100000, "", []),
- ?line stream_ping(Config, 77777, " -s40000", [])
- end,
- ?line test_server:timetrap_cancel(Dog),
+ Dog = test_server:timetrap(test_server:seconds(180)),
+ stream_ping(Config, 43755, "", []),
+ stream_ping(Config, 100000, "", []),
+ stream_ping(Config, 77777, " -s40000", []),
+ test_server:timetrap_cancel(Dog),
ok.
%% Sends packet with header size of 1, 2, and 4, with packets of various
%% sizes.
basic_ping(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(120)),
- ?line ping(Config, sizes(1), 1, "", []),
- ?line ping(Config, sizes(2), 2, "", []),
- ?line ping(Config, sizes(4), 4, "", []),
- ?line test_server:timetrap_cancel(Dog),
+ Dog = test_server:timetrap(test_server:seconds(120)),
+ ping(Config, sizes(1), 1, "", []),
+ ping(Config, sizes(2), 2, "", []),
+ ping(Config, sizes(4), 4, "", []),
+ test_server:timetrap_cancel(Dog),
ok.
%% Let the port program insert delays between characters sent back to
@@ -251,30 +243,29 @@ basic_ping(Config) when is_list(Config) ->
%% small chunks rather than all at once.
slow_writes(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(20)),
- ?line ping(Config, [8], 4, "-s1", []),
- ?line ping(Config, [10], 2, "-s2", []),
- ?line test_server:timetrap_cancel(Dog),
+ Dog = test_server:timetrap(test_server:seconds(20)),
+ ping(Config, [8], 4, "-s1", []),
+ ping(Config, [10], 2, "-s2", []),
+ test_server:timetrap_cancel(Dog),
ok.
bad_packet(doc) ->
["Test that we get {'EXIT', Port, einval} if we try to send a bigger "
"packet than the packet header allows."];
bad_packet(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line PortTest = port_test(Config),
- ?line process_flag(trap_exit, true),
+ Dog = test_server:timetrap(test_server:seconds(10)),
+ PortTest = port_test(Config),
+ process_flag(trap_exit, true),
- ?line bad_packet(PortTest, 1, 256),
- ?line bad_packet(PortTest, 1, 257),
- ?line bad_packet(PortTest, 2, 65536),
- ?line bad_packet(PortTest, 2, 65537),
+ bad_packet(PortTest, 1, 256),
+ bad_packet(PortTest, 1, 257),
+ bad_packet(PortTest, 2, 65536),
+ bad_packet(PortTest, 2, 65537),
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
ok.
bad_packet(PortTest, HeaderSize, PacketSize) ->
- %% Intentionally no ?line macros.
P = open_port({spawn, PortTest}, [{packet, HeaderSize}]),
P ! {self(), {command, make_zero_packet(PacketSize)}},
receive
@@ -292,16 +283,16 @@ make_zero_packet(N) ->
%% Test sending bad messages to a port.
bad_port_messages(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line PortTest = port_test(Config),
- ?line process_flag(trap_exit, true),
+ Dog = test_server:timetrap(test_server:seconds(10)),
+ PortTest = port_test(Config),
+ process_flag(trap_exit, true),
- ?line bad_message(PortTest, {a,b}),
- ?line bad_message(PortTest, {a}),
- ?line bad_message(PortTest, {self(),{command,bad_command}}),
- ?line bad_message(PortTest, {self(),{connect,no_pid}}),
+ bad_message(PortTest, {a,b}),
+ bad_message(PortTest, {a}),
+ bad_message(PortTest, {self(),{command,bad_command}}),
+ bad_message(PortTest, {self(),{connect,no_pid}}),
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
ok.
bad_message(PortTest, Message) ->
@@ -319,108 +310,97 @@ bad_message(PortTest, Message) ->
%% Tests the 'binary' option for a port.
t_binary(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(300)),
+ Dog = test_server:timetrap(test_server:seconds(300)),
%% Packet mode.
- ?line ping(Config, sizes(1), 1, "", [binary]),
- ?line ping(Config, sizes(2), 2, "", [binary]),
- ?line ping(Config, sizes(4), 4, "", [binary]),
+ ping(Config, sizes(1), 1, "", [binary]),
+ ping(Config, sizes(2), 2, "", [binary]),
+ ping(Config, sizes(4), 4, "", [binary]),
%% Stream mode.
- case os:type() of
- vxworks ->
- %% don't stress VxWorks too much
- ?line stream_ping(Config, 435, "", [binary]),
- ?line stream_ping(Config, 43755, "", [binary]),
- ?line stream_ping(Config, 50000, "", [binary]);
- _ ->
- ?line stream_ping(Config, 435, "", [binary]),
- ?line stream_ping(Config, 43755, "", [binary]),
- ?line stream_ping(Config, 100000, "", [binary])
- end,
+ stream_ping(Config, 435, "", [binary]),
+ stream_ping(Config, 43755, "", [binary]),
+ stream_ping(Config, 100000, "", [binary]),
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
ok.
name1(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(100)),
- ?line PortTest = port_test(Config),
- ?line Command = lists:concat([PortTest, " "]),
- ?line P = open_port({spawn, Command}, []),
- ?line register(myport, P),
- ?line P = whereis(myport),
+ Dog = test_server:timetrap(test_server:seconds(100)),
+ PortTest = port_test(Config),
+ Command = lists:concat([PortTest, " "]),
+ P = open_port({spawn, Command}, []),
+ register(myport, P),
+ P = whereis(myport),
Text = "hej",
- ?line myport ! {self(), {command, Text}},
- ?line receive
- {P, {data, Text}} ->
- ok
- end,
- ?line myport ! {self(), close},
- ?line receive
- {P, closed} -> ok
- end,
- ?line undefined = whereis(myport),
- ?line test_server:timetrap_cancel(Dog),
+ myport ! {self(), {command, Text}},
+ receive
+ {P, {data, Text}} ->
+ ok
+ end,
+ myport ! {self(), close},
+ receive
+ {P, closed} -> ok
+ end,
+ undefined = whereis(myport),
+ test_server:timetrap_cancel(Dog),
ok.
%% Test that the 'eof' option works.
eof(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(100)),
- ?line PortTest = port_test(Config),
- ?line Command = lists:concat([PortTest, " -h0 -q"]),
- ?line P = open_port({spawn, Command}, [eof]),
- ?line receive
- {P, eof} ->
- ok
- end,
- ?line P ! {self(), close},
- ?line receive
- {P, closed} -> ok
- end,
- ?line test_server:timetrap_cancel(Dog),
+ Dog = test_server:timetrap(test_server:seconds(100)),
+ PortTest = port_test(Config),
+ Command = lists:concat([PortTest, " -h0 -q"]),
+ P = open_port({spawn, Command}, [eof]),
+ receive
+ {P, eof} ->
+ ok
+ end,
+ P ! {self(), close},
+ receive
+ {P, closed} -> ok
+ end,
+ test_server:timetrap_cancel(Dog),
ok.
%% Tests that the 'in' option for a port works.
input_only(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(300)),
- ?line expect_input(Config, [0, 1, 10, 13, 127, 128, 255], 1, "", [in]),
- ?line expect_input(Config, [0, 1, 255, 2048], 2, "", [in]),
- ?line expect_input(Config, [0, 1, 255, 2048], 4, "", [in]),
- ?line expect_input(Config, [0, 1, 10, 13, 127, 128, 255],
- 1, "", [in, binary]),
- ?line test_server:timetrap_cancel(Dog),
+ Dog = test_server:timetrap(test_server:seconds(300)),
+ expect_input(Config, [0, 1, 10, 13, 127, 128, 255], 1, "", [in]),
+ expect_input(Config, [0, 1, 255, 2048], 2, "", [in]),
+ expect_input(Config, [0, 1, 255, 2048], 4, "", [in]),
+ expect_input(Config, [0, 1, 10, 13, 127, 128, 255],
+ 1, "", [in, binary]),
+ test_server:timetrap_cancel(Dog),
ok.
%% Tests that the 'out' option for a port works.
output_only(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(100)),
- ?line Dir = ?config(priv_dir, Config),
- ?line Filename = filename:join(Dir, "output_only_stream"),
- ?line output_and_verify(Config, Filename, "-h0",
- random_packet(35777, "echo")),
- ?line test_server:timetrap_cancel(Dog),
+ Dog = test_server:timetrap(test_server:seconds(100)),
+ Dir = ?config(priv_dir, Config),
+ Filename = filename:join(Dir, "output_only_stream"),
+ output_and_verify(Config, Filename, "-h0",
+ random_packet(35777, "echo")),
+ test_server:timetrap_cancel(Dog),
ok.
output_and_verify(Config, Filename, Options, Data) ->
- ?line PortTest = port_test(Config),
- ?line Command = lists:concat([PortTest, " ",
- Options, " -o", Filename]),
- ?line Port = open_port({spawn, Command}, [out]),
- ?line Port ! {self(), {command, Data}},
- ?line Port ! {self(), close},
- ?line receive
- {Port, closed} -> ok
- end,
- Wait_time = case os:type() of
- vxworks -> 5000;
- _ -> 500
- end,
- ?line test_server:sleep(Wait_time),
- ?line {ok, Written} = file:read_file(Filename),
- ?line Data = binary_to_list(Written),
+ PortTest = port_test(Config),
+ Command = lists:concat([PortTest, " ",
+ Options, " -o", Filename]),
+ Port = open_port({spawn, Command}, [out]),
+ Port ! {self(), {command, Data}},
+ Port ! {self(), close},
+ receive
+ {Port, closed} -> ok
+ end,
+ Wait_time = 500,
+ test_server:sleep(Wait_time),
+ {ok, Written} = file:read_file(Filename),
+ Data = binary_to_list(Written),
ok.
%% Test that receiving several packages written in the same
@@ -430,19 +410,11 @@ output_and_verify(Config, Filename, Options, Data) ->
%% Basic test of receiving multiple packages, written in
%% one operation by the other end.
mul_basic(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(600)),
- case os:type() of
- vxworks ->
- %% don't stress vxworks too much
- ?line expect_input(Config, [0, 1, 255, 10, 13], 1, "", []),
- ?line expect_input(Config, [0, 10, 13, 1600, 8191, 16383], 2, "", []),
- ?line expect_input(Config, [10, 35000], 4, "", []);
- _ ->
- ?line expect_input(Config, [0, 1, 255, 10, 13], 1, "", []),
- ?line expect_input(Config, [0, 10, 13, 1600, 32767, 65535], 2, "", []),
- ?line expect_input(Config, [10, 70000], 4, "", [])
- end,
- ?line test_server:timetrap_cancel(Dog),
+ Dog = test_server:timetrap(test_server:seconds(600)),
+ expect_input(Config, [0, 1, 255, 10, 13], 1, "", []),
+ expect_input(Config, [0, 10, 13, 1600, 32767, 65535], 2, "", []),
+ expect_input(Config, [10, 70000], 4, "", []),
+ test_server:timetrap_cancel(Dog),
ok.
%% Test reading a buffer consisting of several packets, some
@@ -451,9 +423,9 @@ mul_basic(Config) when is_list(Config) ->
%% delays in between.)
mul_slow_writes(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(250)),
- ?line expect_input(Config, [0, 20, 255, 10, 1], 1, "-s64", []),
- ?line test_server:timetrap_cancel(Dog),
+ Dog = test_server:timetrap(test_server:seconds(250)),
+ expect_input(Config, [0, 20, 255, 10, 1], 1, "-s64", []),
+ test_server:timetrap_cancel(Dog),
ok.
%% Runs several port tests in parallell. Each individual test
@@ -461,27 +433,27 @@ mul_slow_writes(Config) when is_list(Config) ->
%% should also finish in about 5 seconds.
parallell(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(300)),
- ?line Testers =
- [fun() -> stream_ping(Config, 1007, "-s100", []) end,
- fun() -> stream_ping(Config, 10007, "-s1000", []) end,
- fun() -> stream_ping(Config, 10007, "-s1000", []) end,
-
- fun() -> expect_input(Config, [21, 22, 23, 24, 25], 1,
- "-s10", [in]) end,
-
- fun() -> ping(Config, [10], 1, "-d", []) end,
- fun() -> ping(Config, [20000], 2, "-d", []) end,
- fun() -> ping(Config, [101], 1, "-s10", []) end,
- fun() -> ping(Config, [1001], 2, "-s100", []) end,
- fun() -> ping(Config, [10001], 4, "-s1000", []) end,
-
- fun() -> ping(Config, [501, 501], 2, "-s100", []) end,
- fun() -> ping(Config, [11, 12, 13, 14, 11], 1, "-s5", []) end],
- ?line process_flag(trap_exit, true),
- ?line Pids = lists:map(fun fun_spawn/1, Testers),
- ?line wait_for(Pids),
- ?line test_server:timetrap_cancel(Dog),
+ Dog = test_server:timetrap(test_server:seconds(300)),
+ Testers = [
+ fun() -> stream_ping(Config, 1007, "-s100", []) end,
+ fun() -> stream_ping(Config, 10007, "-s1000", []) end,
+ fun() -> stream_ping(Config, 10007, "-s1000", []) end,
+
+ fun() -> expect_input(Config, [21, 22, 23, 24, 25], 1,
+ "-s10", [in]) end,
+
+ fun() -> ping(Config, [10], 1, "-d", []) end,
+ fun() -> ping(Config, [20000], 2, "-d", []) end,
+ fun() -> ping(Config, [101], 1, "-s10", []) end,
+ fun() -> ping(Config, [1001], 2, "-s100", []) end,
+ fun() -> ping(Config, [10001], 4, "-s1000", []) end,
+
+ fun() -> ping(Config, [501, 501], 2, "-s100", []) end,
+ fun() -> ping(Config, [11, 12, 13, 14, 11], 1, "-s5", []) end],
+ process_flag(trap_exit, true),
+ Pids = lists:map(fun fun_spawn/1, Testers),
+ wait_for(Pids),
+ test_server:timetrap_cancel(Dog),
ok.
wait_for([]) ->
@@ -500,29 +472,29 @@ wait_for(Pids) ->
dying_port(suite) -> [];
dying_port(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(150)),
- ?line process_flag(trap_exit, true),
+ Dog = test_server:timetrap(test_server:seconds(150)),
+ process_flag(trap_exit, true),
- ?line P1 = make_dying_port(Config),
- ?line P2 = make_dying_port(Config),
- ?line P3 = make_dying_port(Config),
- ?line P4 = make_dying_port(Config),
- ?line P5 = make_dying_port(Config),
+ P1 = make_dying_port(Config),
+ P2 = make_dying_port(Config),
+ P3 = make_dying_port(Config),
+ P4 = make_dying_port(Config),
+ P5 = make_dying_port(Config),
%% This should be big enough to be sure to block in the write.
- ?line Garbage = random_packet(16384),
+ Garbage = random_packet(16384),
- ?line P1 ! {self(), {command, Garbage}},
- ?line P3 ! {self(), {command, Garbage}},
- ?line P5 ! {self(), {command, Garbage}},
+ P1 ! {self(), {command, Garbage}},
+ P3 ! {self(), {command, Garbage}},
+ P5 ! {self(), {command, Garbage}},
- ?line wait_for_port_exit(P1),
- ?line wait_for_port_exit(P2),
- ?line wait_for_port_exit(P3),
- ?line wait_for_port_exit(P4),
- ?line wait_for_port_exit(P5),
+ wait_for_port_exit(P1),
+ wait_for_port_exit(P2),
+ wait_for_port_exit(P3),
+ wait_for_port_exit(P4),
+ wait_for_port_exit(P5),
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
ok.
wait_for_port_exit(Port) ->
@@ -549,9 +521,9 @@ make_dying_port(Config) when is_list(Config) ->
port_program_with_path(suite) -> [];
port_program_with_path(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(100)),
- ?line DataDir = ?config(data_dir, Config),
- ?line PrivDir = ?config(priv_dir, Config),
+ Dog = test_server:timetrap(test_server:seconds(100)),
+ DataDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
%% Create a copy of the port test program in a directory not
%% included in PATH (i.e. in priv_dir), with the name 'my_port_test.exe'.
@@ -560,36 +532,31 @@ port_program_with_path(Config) when is_list(Config) ->
%% (On Unix, there will be a single file created, which will be
%% a copy of the port program.)
- ?line PortTest = os:find_executable("port_test", DataDir),
+ PortTest = os:find_executable("port_test", DataDir),
io:format("os:find_executable(~p, ~p) returned ~p",
["port_test", DataDir, PortTest]),
- ?line {ok, PortTestPgm} = file:read_file(PortTest),
- ?line NewName = filename:join(PrivDir, filename:basename(PortTest)),
- ?line RedHerring = filename:rootname(NewName),
- ?line ok = file:write_file(RedHerring, "I'm just here to confuse.\n"),
- ?line ok = file:write_file(NewName, PortTestPgm),
- ?line ok = file:write_file_info(NewName, #file_info{mode=8#111}),
- ?line PgmWithPathAndNoExt = filename:rootname(NewName),
+ {ok, PortTestPgm} = file:read_file(PortTest),
+ NewName = filename:join(PrivDir, filename:basename(PortTest)),
+ RedHerring = filename:rootname(NewName),
+ ok = file:write_file(RedHerring, "I'm just here to confuse.\n"),
+ ok = file:write_file(NewName, PortTestPgm),
+ ok = file:write_file_info(NewName, #file_info{mode=8#111}),
+ PgmWithPathAndNoExt = filename:rootname(NewName),
%% Open the port using the path to the copied port test program,
%% but without the .exe extension, and verified that it was started.
%%
%% If the bug is present the open_port call will fail with badarg.
- ?line Command = lists:concat([PgmWithPathAndNoExt, " -h2"]),
- %% allow VxWorks time to write file
- case os:type() of
- vxworks -> test_server:sleep(2500);
- _ -> time
+ Command = lists:concat([PgmWithPathAndNoExt, " -h2"]),
+ P = open_port({spawn, Command}, [{packet, 2}]),
+ Message = "echo back to me",
+ P ! {self(), {command, Message}},
+ receive
+ {P, {data, Message}} ->
+ ok
end,
- ?line P = open_port({spawn, Command}, [{packet, 2}]),
- ?line Message = "echo back to me",
- ?line P ! {self(), {command, Message}},
- ?line receive
- {P, {data, Message}} ->
- ok
- end,
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
ok.
@@ -597,56 +564,46 @@ port_program_with_path(Config) when is_list(Config) ->
%% This used to fail on Windows.
open_input_file_port(suite) -> [];
open_input_file_port(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line PrivDir = ?config(priv_dir, Config),
+ Dog = test_server:timetrap(test_server:seconds(10)),
+ PrivDir = ?config(priv_dir, Config),
%% Create a file with the file driver and read it back using
%% open_port/2.
- ?line MyFile1 = filename:join(PrivDir, "my_input_file"),
- ?line FileData1 = "An input file",
- ?line ok = file:write_file(MyFile1, FileData1),
- case os:type() of
- vxworks ->
- %% Can't open input file with vanilla driver on VxWorks
- ?line process_flag(trap_exit, true),
- ?line case catch open_port(MyFile1, [in]) of
- {'EXIT', {badarg, _}} ->
- ok
- end;
- _ ->
- ?line case open_port(MyFile1, [in]) of
- InputPort when is_port(InputPort) ->
- ?line receive
- {InputPort, {data, FileData1}} ->
- ok
- end
- end
+ MyFile1 = filename:join(PrivDir, "my_input_file"),
+ FileData1 = "An input file",
+ ok = file:write_file(MyFile1, FileData1),
+ case open_port(MyFile1, [in]) of
+ InputPort when is_port(InputPort) ->
+ receive
+ {InputPort, {data, FileData1}} ->
+ ok
+ end
end,
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
ok.
%% Tests that files can be written using open_port(Filename, [out]).
open_output_file_port(suite) -> [];
open_output_file_port(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(100)),
- ?line PrivDir = ?config(priv_dir, Config),
+ Dog = test_server:timetrap(test_server:seconds(100)),
+ PrivDir = ?config(priv_dir, Config),
%% Create a file with open_port/2 and read it back with
%% the file driver.
- ?line MyFile2 = filename:join(PrivDir, "my_output_file"),
- ?line FileData2_0 = "A file created ",
- ?line FileData2_1 = "with open_port/2.\n",
- ?line FileData2 = FileData2_0 ++ FileData2_1,
- ?line OutputPort = open_port(MyFile2, [out]),
- ?line OutputPort ! {self(), {command, FileData2_0}},
- ?line OutputPort ! {self(), {command, FileData2_1}},
- ?line OutputPort ! {self(), close},
- ?line {ok, Bin} = file:read_file(MyFile2),
- ?line FileData2 = binary_to_list(Bin),
-
- ?line test_server:timetrap_cancel(Dog),
+ MyFile2 = filename:join(PrivDir, "my_output_file"),
+ FileData2_0 = "A file created ",
+ FileData2_1 = "with open_port/2.\n",
+ FileData2 = FileData2_0 ++ FileData2_1,
+ OutputPort = open_port(MyFile2, [out]),
+ OutputPort ! {self(), {command, FileData2_0}},
+ OutputPort ! {self(), {command, FileData2_1}},
+ OutputPort ! {self(), close},
+ {ok, Bin} = file:read_file(MyFile2),
+ FileData2 = binary_to_list(Bin),
+
+ test_server:timetrap_cancel(Dog),
ok.
%%
@@ -670,17 +627,17 @@ iter_max_ports(Config) when is_list(Config) ->
iter_max_ports_test(Config) ->
- ?line Dog = test_server:timetrap(test_server:minutes(20)),
- ?line PortTest = port_test(Config),
- ?line Command = lists:concat([PortTest, " -h0 -q"]),
- ?line Iters = case os:type() of
+ Dog = test_server:timetrap(test_server:minutes(20)),
+ PortTest = port_test(Config),
+ Command = lists:concat([PortTest, " -h0 -q"]),
+ Iters = case os:type() of
{win32,_} -> 4;
_ -> 10
end,
- ?line L = do_iter_max_ports(Iters, Command),
+ L = do_iter_max_ports(Iters, Command),
io:format("Result: ~p",[L]),
- ?line all_equal(L),
- ?line test_server:timetrap_cancel(Dog),
+ all_equal(L),
+ test_server:timetrap_cancel(Dog),
{comment, "Max ports: " ++ integer_to_list(hd(L))}.
do_iter_max_ports(N, Command) when N > 0 ->
@@ -695,9 +652,9 @@ all_equal([]) -> ok.
max_ports(Command) ->
test_server:sleep(500),
- ?line Ps = open_ports({spawn, Command}, [eof]),
- ?line N = length(Ps),
- ?line close_ports(Ps),
+ Ps = open_ports({spawn, Command}, [eof]),
+ N = length(Ps),
+ close_ports(Ps),
io:format("Got ~p ports\n",[N]),
N.
@@ -727,105 +684,105 @@ open_ports(Name, Settings) ->
enomem ->
[];
Other ->
- ?line test_server:fail({open_ports, Other})
+ test_server:fail({open_ports, Other})
end;
Other ->
- ?line test_server:fail({open_ports, Other})
+ test_server:fail({open_ports, Other})
end.
%% Tests that exit(Port, Term) works (has been known to crash the emulator).
t_exit(suite) -> [];
t_exit(Config) when is_list(Config) ->
- ?line process_flag(trap_exit, true),
- ?line Pid = fun_spawn(fun suicide_port/1, [Config]),
- ?line receive
- {'EXIT', Pid, die} ->
- ok;
- Other ->
- test_server:fail({bad_message, Other})
- end.
+ process_flag(trap_exit, true),
+ Pid = fun_spawn(fun suicide_port/1, [Config]),
+ receive
+ {'EXIT', Pid, die} ->
+ ok;
+ Other ->
+ test_server:fail({bad_message, Other})
+ end.
suicide_port(Config) when is_list(Config) ->
- ?line Port = port_expect(Config, [], 0, "", []),
- ?line exit(Port, die),
- ?line receive after infinity -> ok end.
+ Port = port_expect(Config, [], 0, "", []),
+ exit(Port, die),
+ receive after infinity -> ok end.
tps_16_bytes(doc) -> "";
tps_16_bytes(suite) -> [];
tps_16_bytes(Config) when is_list(Config) ->
- ?line tps(16, Config).
+ tps(16, Config).
tps_1K(doc) -> "";
tps_1K(suite) -> [];
tps_1K(Config) when is_list(Config) ->
- ?line tps(1024, Config).
+ tps(1024, Config).
tps(Size, Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(300)),
- ?line PortTest = port_test(Config),
- ?line Packet = list_to_binary(random_packet(Size, "e")),
- ?line Port = open_port({spawn, PortTest}, [binary, {packet, 2}]),
- ?line Transactions = 10000,
- ?line {Elapsed, ok} = test_server:timecall(?MODULE, tps,
+ Dog = test_server:timetrap(test_server:seconds(300)),
+ PortTest = port_test(Config),
+ Packet = list_to_binary(random_packet(Size, "e")),
+ Port = open_port({spawn, PortTest}, [binary, {packet, 2}]),
+ Transactions = 10000,
+ {Elapsed, ok} = test_server:timecall(?MODULE, tps,
[Port, Packet, Transactions]),
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
{comment, integer_to_list(trunc(Transactions/Elapsed+0.5)) ++ " transactions/s"}.
tps(_Port, _Packet, 0) -> ok;
tps(Port, Packet, N) ->
- ?line port_command(Port, Packet),
- ?line receive
- {Port, {data, Packet}} ->
- ?line tps(Port, Packet, N-1);
- Other ->
- ?line test_server:fail({bad_message, Other})
- end.
+ port_command(Port, Packet),
+ receive
+ {Port, {data, Packet}} ->
+ tps(Port, Packet, N-1);
+ Other ->
+ test_server:fail({bad_message, Other})
+ end.
%% Line I/O test
line(Config) when is_list(Config) ->
- ?line Siz = 110,
- ?line Dog = test_server:timetrap(test_server:seconds(300)),
- ?line Packet1 = random_packet(Siz),
- ?line Packet2 = random_packet(Siz div 2),
+ Siz = 110,
+ Dog = test_server:timetrap(test_server:seconds(300)),
+ Packet1 = random_packet(Siz),
+ Packet2 = random_packet(Siz div 2),
%% Test that packets are split into lines
- ?line port_expect(Config,[{lists:append([Packet1, io_lib:nl(), Packet2,
+ port_expect(Config,[{lists:append([Packet1, io_lib:nl(), Packet2,
io_lib:nl()]),
[{eol, Packet1}, {eol, Packet2}]}],
0, "", [{line,Siz}]),
%% Test the same for binaries
- ?line port_expect(Config,[{lists:append([Packet1, io_lib:nl(), Packet2,
+ port_expect(Config,[{lists:append([Packet1, io_lib:nl(), Packet2,
io_lib:nl()]),
[{eol, Packet1}, {eol, Packet2}]}],
0, "", [{line,Siz},binary]),
%% Test that too long lines get split
- ?line port_expect(Config,[{lists:append([Packet1, io_lib:nl(), Packet1,
+ port_expect(Config,[{lists:append([Packet1, io_lib:nl(), Packet1,
Packet2, io_lib:nl()]),
[{eol, Packet1}, {noeol, Packet1},
{eol, Packet2}]}], 0, "", [{line,Siz}]),
%% Test that last output from closing port program gets received.
- ?line L1 = lists:append([Packet1, io_lib:nl(), Packet2]),
- ?line S1 = lists:flatten(io_lib:format("-l~w", [length(L1)])),
+ L1 = lists:append([Packet1, io_lib:nl(), Packet2]),
+ S1 = lists:flatten(io_lib:format("-l~w", [length(L1)])),
io:format("S1 = ~w, L1 = ~w~n", [S1,L1]),
- ?line port_expect(Config,[{L1,
+ port_expect(Config,[{L1,
[{eol, Packet1}, {noeol, Packet2}, eof]}], 0,
S1, [{line,Siz},eof]),
%% Test that lonely <CR> Don't get treated as newlines
- ?line port_expect(Config,[{lists:append([Packet1, [13], Packet2,
+ port_expect(Config,[{lists:append([Packet1, [13], Packet2,
io_lib:nl()]),
[{noeol, Packet1}, {eol, [13 |Packet2]}]}],
0, "", [{line,Siz}]),
%% Test that packets get built up to lines (delayed output from
%% port program)
- ?line port_expect(Config,[{Packet2,[]},
+ port_expect(Config,[{Packet2,[]},
{lists:append([Packet2, io_lib:nl(),
Packet1, io_lib:nl()]),
[{eol, lists:append(Packet2, Packet2)},
{eol, Packet1}]}], 0, "-d", [{line,Siz}]),
%% Test that we get badarg if trying both packet and line
- ?line bad_argument(Config, [{packet, 5}, {line, 5}]),
- ?line test_server:timetrap_cancel(Dog),
+ bad_argument(Config, [{packet, 5}, {line, 5}]),
+ test_server:timetrap_cancel(Dog),
ok.
%%% Redirection of stderr test
@@ -834,15 +791,15 @@ stderr_to_stdout(suite) ->
stderr_to_stdout(doc) ->
"Test that redirection of standard error to standard output works.";
stderr_to_stdout(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(60)),
+ Dog = test_server:timetrap(test_server:seconds(60)),
%% See that it works
- ?line Packet = random_packet(10),
- ?line port_expect(Config,[{Packet,[Packet]}], 0, "-e -l10",
+ Packet = random_packet(10),
+ port_expect(Config,[{Packet,[Packet]}], 0, "-e -l10",
[stderr_to_stdout]),
- %% ?line stream_ping(Config, 10, "-e", [stderr_to_stdout]),
+ %% stream_ping(Config, 10, "-e", [stderr_to_stdout]),
%% See that it doesn't always happen (will generate garbage on stderr)
- ?line port_expect(Config,[{Packet,[eof]}], 0, "-e -l10", [line,eof]),
- ?line test_server:timetrap_cancel(Dog),
+ port_expect(Config,[{Packet,[eof]}], 0, "-e -l10", [line,eof]),
+ test_server:timetrap_cancel(Dog),
ok.
@@ -862,47 +819,39 @@ env(suite) ->
env(doc) ->
["Test that the 'env' option works"];
env(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {skipped,"Environments not implemented on VxWorks (could be...)"};
- _ ->
- env2(Config)
- end.
-
-env2(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(60)),
- ?line Priv = ?config(priv_dir, Config),
- ?line Temp = filename:join(Priv, "env_fun.bin"),
+ Dog = test_server:timetrap(test_server:seconds(60)),
+ Priv = ?config(priv_dir, Config),
+ Temp = filename:join(Priv, "env_fun.bin"),
PluppVal = "dirty monkey",
- ?line env_slave(Temp, [{"plupp",PluppVal}]),
+ env_slave(Temp, [{"plupp",PluppVal}]),
Long = "LongAndBoringEnvName",
- ?line os:putenv(Long, "nisse"),
-
- ?line env_slave(Temp, [{"plupp",PluppVal},
- {"DIR_PLUPP","###glurfrik"}],
- fun() ->
- PluppVal = os:getenv("plupp"),
- "###glurfrik" = os:getenv("DIR_PLUPP"),
- "nisse" = os:getenv(Long)
- end),
+ os:putenv(Long, "nisse"),
+
+ env_slave(Temp, [{"plupp",PluppVal},
+ {"DIR_PLUPP","###glurfrik"}],
+ fun() ->
+ PluppVal = os:getenv("plupp"),
+ "###glurfrik" = os:getenv("DIR_PLUPP"),
+ "nisse" = os:getenv(Long)
+ end),
-
- ?line env_slave(Temp, [{"must_define_something","some_value"},
- {"certainly_not_existing",false},
- {"ends_with_equal", "value="},
- {Long,false},
- {"glurf","a glorfy string"}]),
+
+ env_slave(Temp, [{"must_define_something","some_value"},
+ {"certainly_not_existing",false},
+ {"ends_with_equal", "value="},
+ {Long,false},
+ {"glurf","a glorfy string"}]),
%% A lot of non existing variables (mingled with existing)
NotExistingList = [{lists:flatten(io_lib:format("V~p_not_existing",[X])),false}
|| X <- lists:seq(1,150)],
ExistingList = [{lists:flatten(io_lib:format("V~p_existing",[X])),"a_value"}
|| X <- lists:seq(1,150)],
- ?line env_slave(Temp, lists:sort(ExistingList ++ NotExistingList)),
+ env_slave(Temp, lists:sort(ExistingList ++ NotExistingList)),
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
ok.
env_slave(File, Env) ->
@@ -946,23 +895,15 @@ env_slave_main([File]) ->
%% 'env' option
%% Test bad environments.
bad_env(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {skipped,"Environments not implemented on VxWorks"};
- _ ->
- bad_env_1()
- end.
-
-bad_env_1() ->
- ?line try_bad_env([abbb]),
- ?line try_bad_env([{"key","value"}|{"another","value"}]),
- ?line try_bad_env([{"key","value","value2"}]),
- ?line try_bad_env([{"key",[a,b,c]}]),
- ?line try_bad_env([{"key",value}]),
- ?line try_bad_env({a,tuple}),
- ?line try_bad_env(42),
- ?line try_bad_env([a|b]),
- ?line try_bad_env(self()),
+ try_bad_env([abbb]),
+ try_bad_env([{"key","value"}|{"another","value"}]),
+ try_bad_env([{"key","value","value2"}]),
+ try_bad_env([{"key",[a,b,c]}]),
+ try_bad_env([{"key",value}]),
+ try_bad_env({a,tuple}),
+ try_bad_env(42),
+ try_bad_env([a|b]),
+ try_bad_env(self()),
ok.
try_bad_env(Env) ->
@@ -979,36 +920,29 @@ cd(suite) ->
cd(doc) ->
["Test that the 'cd' option works"];
cd(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {skipped,"Task specific directories does not exist on VxWorks"};
- _ ->
- cd2(Config)
- end.
-cd2(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(60)),
-
- ?line Program = atom_to_list(lib:progname()),
- ?line DataDir = ?config(data_dir, Config),
- ?line TestDir = filename:join(DataDir, "dir"),
- ?line Cmd = Program ++ " -pz " ++ DataDir ++
- " -noshell -s port_test pwd -s erlang halt",
- ?line _ = open_port({spawn, Cmd},
- [{cd, TestDir},
- {line, 256}]),
- ?line receive
- {_, {data, {eol, String}}} ->
- case filename_equal(String, TestDir) of
- true ->
- ok;
- false ->
- ?line test_server:fail({cd, String})
- end;
- Other2 ->
- ?line test_server:fail({env, Other2})
- end,
+ Dog = test_server:timetrap(test_server:seconds(60)),
+
+ Program = atom_to_list(lib:progname()),
+ DataDir = ?config(data_dir, Config),
+ TestDir = filename:join(DataDir, "dir"),
+ Cmd = Program ++ " -pz " ++ DataDir ++
+ " -noshell -s port_test pwd -s erlang halt",
+ _ = open_port({spawn, Cmd},
+ [{cd, TestDir},
+ {line, 256}]),
+ receive
+ {_, {data, {eol, String}}} ->
+ case filename_equal(String, TestDir) of
+ true ->
+ ok;
+ false ->
+ test_server:fail({cd, String})
+ end;
+ Other2 ->
+ test_server:fail({env, Other2})
+ end,
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
ok.
filename_equal(A, B) ->
@@ -1059,8 +993,8 @@ otp_3906(Config) when is_list(Config) ->
-define(OTP_3906_MAX_CONC_OSP, 50).
otp_3906(Config, OSName) ->
- ?line DataDir = filename:dirname(proplists:get_value(data_dir,Config)),
- ?line {ok, Variables} = file:consult(
+ DataDir = filename:dirname(proplists:get_value(data_dir,Config)),
+ {ok, Variables} = file:consult(
filename:join([DataDir,"..","..",
"test_server","variables"])),
case lists:keysearch('CC', 1, Variables) of
@@ -1105,7 +1039,7 @@ otp_3906(Config, OSName) ->
succeded ->
ok;
_ ->
- ?line test_server:fail(Result)
+ test_server:fail(Result)
end;
_ ->
{skipped, "No C compiler found"}
@@ -1244,17 +1178,17 @@ otp_3906_forker(N, Parent, Ref, Sup, Prog) ->
otp_4389(suite) -> [];
otp_4389(doc) -> [];
otp_4389(Config) when is_list(Config) ->
- case {os:type(),erlang:system_info(heap_type)} of
- {{unix, _},private} ->
- ?line Dog = test_server:timetrap(test_server:seconds(240)),
- ?line TCR = self(),
+ case os:type() of
+ {unix, _} ->
+ Dog = test_server:timetrap(test_server:seconds(240)),
+ TCR = self(),
case get_true_cmd() of
True when is_list(True) ->
- ?line lists:foreach(
+ lists:foreach(
fun (P) ->
- ?line receive
- {P, ok} -> ?line ok;
- {P, Err} -> ?line ?t:fail(Err)
+ receive
+ {P, ok} -> ok;
+ {P, Err} -> ?t:fail(Err)
end
end,
lists:map(
@@ -1283,17 +1217,17 @@ otp_4389(Config) when is_list(Config) ->
end)
end,
lists:duplicate(1000,[]))),
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
{comment,
"This test case doesn't always fail when the bug that "
"it tests for is present (it is most likely to fail on"
" a multi processor machine). If the test case fails it"
" will fail by deadlocking the emulator."};
_ ->
- ?line {skipped, "\"true\" command not found"}
+ {skipped, "\"true\" command not found"}
end;
_ ->
- {skip,"Only run on Unix and private heaps"}
+ {skip,"Only run on Unix"}
end.
get_true_cmd() ->
@@ -1320,11 +1254,11 @@ exit_status(suite) ->
exit_status(doc) ->
["Test that the 'exit_status' option works"];
exit_status(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(60)),
- ?line port_expect(Config,[{"x",
+ Dog = test_server:timetrap(test_server:seconds(60)),
+ port_expect(Config,[{"x",
[{exit_status, 5}]}],
1, "", [exit_status]),
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
ok.
spawn_driver(suite) ->
@@ -1332,36 +1266,36 @@ spawn_driver(suite) ->
spawn_driver(doc) ->
["Test spawning a driver specifically"];
spawn_driver(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line Path = ?config(data_dir, Config),
- ?line ok = load_driver(Path, "echo_drv"),
- ?line Port = erlang:open_port({spawn_driver, "echo_drv"}, []),
- ?line Port ! {self(), {command, "Hello port!"}},
- ?line receive
+ Dog = test_server:timetrap(test_server:seconds(10)),
+ Path = ?config(data_dir, Config),
+ ok = load_driver(Path, "echo_drv"),
+ Port = erlang:open_port({spawn_driver, "echo_drv"}, []),
+ Port ! {self(), {command, "Hello port!"}},
+ receive
{Port, {data, "Hello port!"}} = Msg1 ->
io:format("~p~n", [Msg1]),
ok;
Other ->
test_server:fail({unexpected, Other})
end,
- ?line Port ! {self(), close},
- ?line receive {Port, closed} -> ok end,
+ Port ! {self(), close},
+ receive {Port, closed} -> ok end,
- ?line Port2 = erlang:open_port({spawn_driver, "echo_drv -Hello port?"},
+ Port2 = erlang:open_port({spawn_driver, "echo_drv -Hello port?"},
[]),
- ?line receive
+ receive
{Port2, {data, "Hello port?"}} = Msg2 ->
io:format("~p~n", [Msg2]),
ok;
Other2 ->
test_server:fail({unexpected2, Other2})
end,
- ?line Port2 ! {self(), close},
- ?line receive {Port2, closed} -> ok end,
- ?line {'EXIT',{badarg,_}} = (catch erlang:open_port({spawn_driver, "ls"}, [])),
- ?line {'EXIT',{badarg,_}} = (catch erlang:open_port({spawn_driver, "cmd"}, [])),
- ?line {'EXIT',{badarg,_}} = (catch erlang:open_port({spawn_driver, os:find_executable("erl")}, [])),
- ?line test_server:timetrap_cancel(Dog),
+ Port2 ! {self(), close},
+ receive {Port2, closed} -> ok end,
+ {'EXIT',{badarg,_}} = (catch erlang:open_port({spawn_driver, "ls"}, [])),
+ {'EXIT',{badarg,_}} = (catch erlang:open_port({spawn_driver, "cmd"}, [])),
+ {'EXIT',{badarg,_}} = (catch erlang:open_port({spawn_driver, os:find_executable("erl")}, [])),
+ test_server:timetrap_cancel(Dog),
ok.
spawn_executable(suite) ->
@@ -1369,48 +1303,48 @@ spawn_executable(suite) ->
spawn_executable(doc) ->
["Test spawning an executable specifically"];
spawn_executable(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line DataDir = ?config(data_dir, Config),
- ?line EchoArgs1 = filename:join([DataDir,"echo_args"]),
- ?line ExactFile1 = filename:nativename(os:find_executable(EchoArgs1)),
- ?line [ExactFile1] = run_echo_args(DataDir,[]),
- ?line ["echo_args"] = run_echo_args(DataDir,["echo_args"]),
- ?line ["echo_arguments"] = run_echo_args(DataDir,["echo_arguments"]),
- ?line [ExactFile1,"hello world","dlrow olleh"] =
+ Dog = test_server:timetrap(test_server:seconds(10)),
+ DataDir = ?config(data_dir, Config),
+ EchoArgs1 = filename:join([DataDir,"echo_args"]),
+ ExactFile1 = filename:nativename(os:find_executable(EchoArgs1)),
+ [ExactFile1] = run_echo_args(DataDir,[]),
+ ["echo_args"] = run_echo_args(DataDir,["echo_args"]),
+ ["echo_arguments"] = run_echo_args(DataDir,["echo_arguments"]),
+ [ExactFile1,"hello world","dlrow olleh"] =
run_echo_args(DataDir,[ExactFile1,"hello world","dlrow olleh"]),
- ?line [ExactFile1] = run_echo_args(DataDir,[default]),
- ?line [ExactFile1,"hello world","dlrow olleh"] =
+ [ExactFile1] = run_echo_args(DataDir,[default]),
+ [ExactFile1,"hello world","dlrow olleh"] =
run_echo_args(DataDir,[switch_order,ExactFile1,"hello world",
"dlrow olleh"]),
- ?line [ExactFile1,"hello world","dlrow olleh"] =
+ [ExactFile1,"hello world","dlrow olleh"] =
run_echo_args(DataDir,[default,"hello world","dlrow olleh"]),
- ?line [ExactFile1,"hello world","dlrow olleh"] =
+ [ExactFile1,"hello world","dlrow olleh"] =
run_echo_args_2("\""++ExactFile1++"\" "++"\"hello world\" \"dlrow olleh\""),
- ?line PrivDir = ?config(priv_dir, Config),
- ?line SpaceDir =filename:join([PrivDir,"With Spaces"]),
- ?line file:make_dir(SpaceDir),
- ?line Executable = filename:basename(ExactFile1),
- ?line file:copy(ExactFile1,filename:join([SpaceDir,Executable])),
- ?line ExactFile2 = filename:nativename(filename:join([SpaceDir,Executable])),
- ?line chmodplusx(ExactFile2),
+ PrivDir = ?config(priv_dir, Config),
+ SpaceDir =filename:join([PrivDir,"With Spaces"]),
+ file:make_dir(SpaceDir),
+ Executable = filename:basename(ExactFile1),
+ file:copy(ExactFile1,filename:join([SpaceDir,Executable])),
+ ExactFile2 = filename:nativename(filename:join([SpaceDir,Executable])),
+ chmodplusx(ExactFile2),
io:format("|~s|~n",[ExactFile2]),
- ?line [ExactFile2] = run_echo_args(SpaceDir,[]),
- ?line ["echo_args"] = run_echo_args(SpaceDir,["echo_args"]),
- ?line ["echo_arguments"] = run_echo_args(SpaceDir,["echo_arguments"]),
- ?line [ExactFile2,"hello world","dlrow olleh"] =
+ [ExactFile2] = run_echo_args(SpaceDir,[]),
+ ["echo_args"] = run_echo_args(SpaceDir,["echo_args"]),
+ ["echo_arguments"] = run_echo_args(SpaceDir,["echo_arguments"]),
+ [ExactFile2,"hello world","dlrow olleh"] =
run_echo_args(SpaceDir,[ExactFile2,"hello world","dlrow olleh"]),
- ?line [ExactFile2] = run_echo_args(SpaceDir,[default]),
- ?line [ExactFile2,"hello world","dlrow olleh"] =
+ [ExactFile2] = run_echo_args(SpaceDir,[default]),
+ [ExactFile2,"hello world","dlrow olleh"] =
run_echo_args(SpaceDir,[switch_order,ExactFile2,"hello world",
"dlrow olleh"]),
- ?line [ExactFile2,"hello world","dlrow olleh"] =
+ [ExactFile2,"hello world","dlrow olleh"] =
run_echo_args(SpaceDir,[default,"hello world","dlrow olleh"]),
- ?line [ExactFile2,"hello world","dlrow olleh"] =
+ [ExactFile2,"hello world","dlrow olleh"] =
run_echo_args_2("\""++ExactFile2++"\" "++"\"hello world\" \"dlrow olleh\""),
- ?line ExeExt =
+ ExeExt =
case string:to_lower(lists:last(string:tokens(ExactFile2,"."))) of
"exe" ->
".exe";
@@ -1418,47 +1352,47 @@ spawn_executable(Config) when is_list(Config) ->
""
end,
Executable2 = "spoky name"++ExeExt,
- ?line file:copy(ExactFile1,filename:join([SpaceDir,Executable2])),
- ?line ExactFile3 = filename:nativename(filename:join([SpaceDir,Executable2])),
- ?line chmodplusx(ExactFile3),
- ?line [ExactFile3] = run_echo_args(SpaceDir,Executable2,[]),
- ?line ["echo_args"] = run_echo_args(SpaceDir,Executable2,["echo_args"]),
- ?line ["echo_arguments"] = run_echo_args(SpaceDir,Executable2,["echo_arguments"]),
- ?line [ExactFile3,"hello world","dlrow olleh"] =
+ file:copy(ExactFile1,filename:join([SpaceDir,Executable2])),
+ ExactFile3 = filename:nativename(filename:join([SpaceDir,Executable2])),
+ chmodplusx(ExactFile3),
+ [ExactFile3] = run_echo_args(SpaceDir,Executable2,[]),
+ ["echo_args"] = run_echo_args(SpaceDir,Executable2,["echo_args"]),
+ ["echo_arguments"] = run_echo_args(SpaceDir,Executable2,["echo_arguments"]),
+ [ExactFile3,"hello world","dlrow olleh"] =
run_echo_args(SpaceDir,Executable2,[ExactFile3,"hello world","dlrow olleh"]),
- ?line [ExactFile3] = run_echo_args(SpaceDir,Executable2,[default]),
- ?line [ExactFile3,"hello world","dlrow olleh"] =
+ [ExactFile3] = run_echo_args(SpaceDir,Executable2,[default]),
+ [ExactFile3,"hello world","dlrow olleh"] =
run_echo_args(SpaceDir,Executable2,
[switch_order,ExactFile3,"hello world",
"dlrow olleh"]),
- ?line [ExactFile3,"hello world","dlrow olleh"] =
+ [ExactFile3,"hello world","dlrow olleh"] =
run_echo_args(SpaceDir,Executable2,
[default,"hello world","dlrow olleh"]),
- ?line [ExactFile3,"hello world","dlrow olleh"] =
+ [ExactFile3,"hello world","dlrow olleh"] =
run_echo_args_2("\""++ExactFile3++"\" "++"\"hello world\" \"dlrow olleh\""),
- ?line {'EXIT',{enoent,_}} = (catch run_echo_args(SpaceDir,"fnurflmonfi",
+ {'EXIT',{enoent,_}} = (catch run_echo_args(SpaceDir,"fnurflmonfi",
[default,"hello world",
"dlrow olleh"])),
NonExec = "kronxfrt"++ExeExt,
- ?line file:write_file(filename:join([SpaceDir,NonExec]),
+ file:write_file(filename:join([SpaceDir,NonExec]),
<<"Not an executable">>),
- ?line {'EXIT',{eacces,_}} = (catch run_echo_args(SpaceDir,NonExec,
+ {'EXIT',{eacces,_}} = (catch run_echo_args(SpaceDir,NonExec,
[default,"hello world",
"dlrow olleh"])),
- ?line {'EXIT',{enoent,_}} = (catch open_port({spawn_executable,"cmd"},[])),
- ?line {'EXIT',{enoent,_}} = (catch open_port({spawn_executable,"sh"},[])),
+ {'EXIT',{enoent,_}} = (catch open_port({spawn_executable,"cmd"},[])),
+ {'EXIT',{enoent,_}} = (catch open_port({spawn_executable,"sh"},[])),
case os:type() of
{win32,_} ->
test_bat_file(SpaceDir);
{unix,_} ->
test_sh_file(SpaceDir)
end,
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
ok.
unregister_name(Config) when is_list(Config) ->
- ?line true = register(crash, open_port({spawn, "sleep 100"}, [])),
- ?line true = unregister(crash).
+ true = register(crash, open_port({spawn, "sleep 100"}, [])),
+ true = unregister(crash).
test_bat_file(Dir) ->
FN = "tf.bat",
@@ -1478,16 +1412,16 @@ test_bat_file(Dir) ->
<<"\r\n">>,
<<":done\r\n">>,
<<"\r\n">>],
- ?line file:write_file(Full,list_to_binary(D)),
- ?line EF = filename:basename(FN),
- ?line [DN,"hello","world"] =
+ file:write_file(Full,list_to_binary(D)),
+ EF = filename:basename(FN),
+ [DN,"hello","world"] =
run_echo_args(Dir,FN,
[default,"hello","world"]),
%% The arg0 argumant should be ignored when running batch files
- ?line [DN,"hello","world"] =
+ [DN,"hello","world"] =
run_echo_args(Dir,FN,
["knaskurt","hello","world"]),
- ?line EF = filename:basename(DN),
+ EF = filename:basename(DN),
ok.
test_sh_file(Dir) ->
@@ -1501,20 +1435,20 @@ test_sh_file(Dir) ->
<<" shift\n">>,
<<" i=`expr $i + 1`\n">>,
<<"done\n">>],
- ?line file:write_file(Full,list_to_binary(D)),
- ?line chmodplusx(Full),
- ?line [Full,"hello","world"] =
+ file:write_file(Full,list_to_binary(D)),
+ chmodplusx(Full),
+ [Full,"hello","world"] =
run_echo_args(Dir,FN,
[default,"hello","world"]),
- ?line [Full,"hello","world of spaces"] =
+ [Full,"hello","world of spaces"] =
run_echo_args(Dir,FN,
[default,"hello","world of spaces"]),
- ?line file:write_file(filename:join([Dir,"testfile1"]),<<"testdata1">>),
- ?line file:write_file(filename:join([Dir,"testfile2"]),<<"testdata2">>),
- ?line Pattern = filename:join([Dir,"testfile*"]),
- ?line L = filelib:wildcard(Pattern),
- ?line 2 = length(L),
- ?line [Full,"hello",Pattern] =
+ file:write_file(filename:join([Dir,"testfile1"]),<<"testdata1">>),
+ file:write_file(filename:join([Dir,"testfile2"]),<<"testdata2">>),
+ Pattern = filename:join([Dir,"testfile*"]),
+ L = filelib:wildcard(Pattern),
+ 2 = length(L),
+ [Full,"hello",Pattern] =
run_echo_args(Dir,FN,
[default,"hello",Pattern]),
ok.
@@ -1574,25 +1508,25 @@ mix_up_ports(suite) ->
mix_up_ports(doc) ->
["Test that the emulator does not mix up ports when the port table wraps"];
mix_up_ports(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line Path = ?config(data_dir, Config),
- ?line ok = load_driver(Path, "echo_drv"),
- ?line Port = erlang:open_port({spawn, "echo_drv"}, []),
- ?line Port ! {self(), {command, "Hello port!"}},
- ?line receive
+ Dog = test_server:timetrap(test_server:seconds(10)),
+ Path = ?config(data_dir, Config),
+ ok = load_driver(Path, "echo_drv"),
+ Port = erlang:open_port({spawn, "echo_drv"}, []),
+ Port ! {self(), {command, "Hello port!"}},
+ receive
{Port, {data, "Hello port!"}} = Msg1 ->
io:format("~p~n", [Msg1]),
ok;
Other ->
test_server:fail({unexpected, Other})
end,
- ?line Port ! {self(), close},
- ?line receive {Port, closed} -> ok end,
- ?line loop(start, done,
+ Port ! {self(), close},
+ receive {Port, closed} -> ok end,
+ loop(start, done,
fun(P) ->
- ?line Q =
+ Q =
(catch erlang:open_port({spawn, "echo_drv"}, [])),
-%% ?line io:format("~p ", [Q]),
+%% io:format("~p ", [Q]),
if is_port(Q) ->
Q;
true ->
@@ -1600,14 +1534,14 @@ mix_up_ports(Config) when is_list(Config) ->
done
end
end),
- ?line Port ! {self(), {command, "Hello again port!"}},
- ?line receive
+ Port ! {self(), {command, "Hello again port!"}},
+ receive
Msg2 ->
test_server:fail({unexpected, Msg2})
after 1000 ->
ok
end,
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
ok.
loop(Stop, Stop, Fun) when is_function(Fun) ->
@@ -1622,45 +1556,45 @@ otp_5112(doc) ->
["Test that link to connected process is taken away when port calls",
"driver_exit() also when the port index has wrapped"];
otp_5112(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line Path = ?config(data_dir, Config),
- ?line ok = load_driver(Path, "exit_drv"),
- ?line Port = otp_5112_get_wrapped_port(),
- ?line ?t:format("Max ports: ~p~n",[max_ports()]),
- ?line ?t:format("Port: ~p~n",[Port]),
- ?line {links, Links1} = process_info(self(),links),
- ?line ?t:format("Links1: ~p~n",[Links1]),
- ?line true = lists:member(Port, Links1),
- ?line Port ! {self(), {command, ""}},
- ?line {links, Links2} = process_info(self(),links),
- ?line ?t:format("Links2: ~p~n",[Links2]),
- ?line false = lists:member(Port, Links2), %% This used to fail
- ?line test_server:timetrap_cancel(Dog),
+ Dog = test_server:timetrap(test_server:seconds(10)),
+ Path = ?config(data_dir, Config),
+ ok = load_driver(Path, "exit_drv"),
+ Port = otp_5112_get_wrapped_port(),
+ ?t:format("Max ports: ~p~n",[max_ports()]),
+ ?t:format("Port: ~p~n",[Port]),
+ {links, Links1} = process_info(self(),links),
+ ?t:format("Links1: ~p~n",[Links1]),
+ true = lists:member(Port, Links1),
+ Port ! {self(), {command, ""}},
+ {links, Links2} = process_info(self(),links),
+ ?t:format("Links2: ~p~n",[Links2]),
+ false = lists:member(Port, Links2), %% This used to fail
+ test_server:timetrap_cancel(Dog),
ok.
otp_5112_get_wrapped_port() ->
- ?line P1 = erlang:open_port({spawn, "exit_drv"}, []),
- ?line case port_ix(P1) < max_ports() of
+ P1 = erlang:open_port({spawn, "exit_drv"}, []),
+ case port_ix(P1) < max_ports() of
true ->
- ?line ?t:format("Need to wrap port index (~p)~n", [P1]),
- ?line otp_5112_wrap_port_ix([P1]),
- ?line P2 = erlang:open_port({spawn, "exit_drv"}, []),
- ?line false = port_ix(P2) < max_ports(),
- ?line P2;
+ ?t:format("Need to wrap port index (~p)~n", [P1]),
+ otp_5112_wrap_port_ix([P1]),
+ P2 = erlang:open_port({spawn, "exit_drv"}, []),
+ false = port_ix(P2) < max_ports(),
+ P2;
false ->
- ?line ?t:format("Port index already wrapped (~p)~n", [P1]),
- ?line P1
+ ?t:format("Port index already wrapped (~p)~n", [P1]),
+ P1
end.
otp_5112_wrap_port_ix(Ports) ->
- ?line case (catch erlang:open_port({spawn, "exit_drv"}, [])) of
+ case (catch erlang:open_port({spawn, "exit_drv"}, [])) of
Port when is_port(Port) ->
- ?line otp_5112_wrap_port_ix([Port|Ports]);
+ otp_5112_wrap_port_ix([Port|Ports]);
_ ->
%% Port table now full; empty port table
- ?line lists:foreach(fun (P) -> P ! {self(), close} end,
+ lists:foreach(fun (P) -> P ! {self(), close} end,
Ports),
- ?line ok
+ ok
end.
@@ -1669,106 +1603,105 @@ otp_5119(suite) ->
otp_5119(doc) ->
["Test that port index is not unnecessarily wrapped"];
otp_5119(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line Path = ?config(data_dir, Config),
- ?line ok = load_driver(Path, "exit_drv"),
- ?line PI1 = port_ix(otp_5119_fill_empty_port_tab([])),
- ?line PI2 = port_ix(erlang:open_port({spawn, "exit_drv"}, [])),
- ?line {PortIx1, PortIx2}
- = case PI2 > PI1 of
- true ->
- ?line {PI1, PI2};
- false ->
- ?line {port_ix(otp_5119_fill_empty_port_tab([PI2])),
- port_ix(erlang:open_port({spawn, "exit_drv"}, []))}
- end,
- ?line MaxPorts = max_ports(),
- ?line ?t:format("PortIx1 = ~p ~p~n", [PI1, PortIx1]),
- ?line ?t:format("PortIx2 = ~p ~p~n", [PI2, PortIx2]),
- ?line ?t:format("MaxPorts = ~p~n", [MaxPorts]),
- ?line true = PortIx2 > PortIx1,
- ?line true = PortIx2 =< PortIx1 + MaxPorts,
- ?line test_server:timetrap_cancel(Dog),
- ?line ok.
+ Dog = test_server:timetrap(test_server:seconds(10)),
+ Path = ?config(data_dir, Config),
+ ok = load_driver(Path, "exit_drv"),
+ PI1 = port_ix(otp_5119_fill_empty_port_tab([])),
+ PI2 = port_ix(erlang:open_port({spawn, "exit_drv"}, [])),
+ {PortIx1, PortIx2} = case PI2 > PI1 of
+ true ->
+ {PI1, PI2};
+ false ->
+ {port_ix(otp_5119_fill_empty_port_tab([PI2])),
+ port_ix(erlang:open_port({spawn, "exit_drv"}, []))}
+ end,
+ MaxPorts = max_ports(),
+ ?t:format("PortIx1 = ~p ~p~n", [PI1, PortIx1]),
+ ?t:format("PortIx2 = ~p ~p~n", [PI2, PortIx2]),
+ ?t:format("MaxPorts = ~p~n", [MaxPorts]),
+ true = PortIx2 > PortIx1,
+ true = PortIx2 =< PortIx1 + MaxPorts,
+ test_server:timetrap_cancel(Dog),
+ ok.
otp_5119_fill_empty_port_tab(Ports) ->
- ?line case (catch erlang:open_port({spawn, "exit_drv"}, [])) of
+ case (catch erlang:open_port({spawn, "exit_drv"}, [])) of
Port when is_port(Port) ->
- ?line otp_5119_fill_empty_port_tab([Port|Ports]);
+ otp_5119_fill_empty_port_tab([Port|Ports]);
_ ->
%% Port table now full; empty port table
- ?line lists:foreach(fun (P) -> P ! {self(), close} end,
+ lists:foreach(fun (P) -> P ! {self(), close} end,
Ports),
- ?line [LastPort|_] = Ports,
- ?line LastPort
+ [LastPort|_] = Ports,
+ LastPort
end.
-define(DEF_MAX_PORTS, 1024).
max_ports_env() ->
- ?line case os:getenv("ERL_MAX_PORTS") of
+ case os:getenv("ERL_MAX_PORTS") of
EMP when is_list(EMP) ->
case catch list_to_integer(EMP) of
- Int when is_integer(Int) -> ?line Int;
- _ -> ?line false
+ Int when is_integer(Int) -> Int;
+ _ -> false
end;
- _ -> ?line false
+ _ -> false
end.
max_ports() ->
- ?line PreMaxPorts
+ PreMaxPorts
= case max_ports_env() of
- Env when is_integer(Env) -> ?line Env;
+ Env when is_integer(Env) -> Env;
_ ->
- ?line case os:type() of
+ case os:type() of
{unix, _} ->
- ?line UlimStr = string:strip(os:cmd("ulimit -n")
+ UlimStr = string:strip(os:cmd("ulimit -n")
-- "\n"),
- ?line case catch list_to_integer(UlimStr) of
- Ulim when is_integer(Ulim) -> ?line Ulim;
- _ -> ?line ?DEF_MAX_PORTS
+ case catch list_to_integer(UlimStr) of
+ Ulim when is_integer(Ulim) -> Ulim;
+ _ -> ?DEF_MAX_PORTS
end;
- _ -> ?line ?DEF_MAX_PORTS
+ _ -> ?DEF_MAX_PORTS
end
end,
- ?line case PreMaxPorts > ?DEF_MAX_PORTS of
- true -> ?line PreMaxPorts;
- false -> ?line ?DEF_MAX_PORTS
+ case PreMaxPorts > ?DEF_MAX_PORTS of
+ true -> PreMaxPorts;
+ false -> ?DEF_MAX_PORTS
end.
port_ix(Port) when is_port(Port) ->
- ?line ["#Port",_,PortIxStr] = string:tokens(erlang:port_to_list(Port),
+ ["#Port",_,PortIxStr] = string:tokens(erlang:port_to_list(Port),
"<.>"),
- ?line list_to_integer(PortIxStr).
+ list_to_integer(PortIxStr).
otp_6224(doc) -> ["Check that port command failure doesn't crash the emulator"];
otp_6224(suite) -> [];
otp_6224(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line Path = ?config(data_dir, Config),
- ?line ok = load_driver(Path, "failure_drv"),
- ?line Go = make_ref(),
- ?line Failer = spawn(fun () ->
+ Dog = test_server:timetrap(test_server:seconds(10)),
+ Path = ?config(data_dir, Config),
+ ok = load_driver(Path, "failure_drv"),
+ Go = make_ref(),
+ Failer = spawn(fun () ->
receive Go -> ok end,
- ?line Port = open_port({spawn, "failure_drv"},
+ Port = open_port({spawn, "failure_drv"},
[]),
Port ! {self(), {command, "Fail, please!"}},
otp_6224_loop()
end),
- ?line Mon = erlang:monitor(process, Failer),
- ?line Failer ! Go,
- ?line receive
+ Mon = erlang:monitor(process, Failer),
+ Failer ! Go,
+ receive
{'DOWN', Mon, process, Failer, Reason} ->
- ?line case Reason of
- {driver_failed, _} -> ?line ok;
- driver_failed -> ?line ok;
- _ -> ?line ?t:fail({unexpected_exit_reason,
+ case Reason of
+ {driver_failed, _} -> ok;
+ driver_failed -> ok;
+ _ -> ?t:fail({unexpected_exit_reason,
Reason})
end
end,
- ?line test_server:timetrap_cancel(Dog),
- ?line ok.
+ test_server:timetrap_cancel(Dog),
+ ok.
otp_6224_loop() ->
receive _ -> ok after 0 -> ok end,
@@ -1781,11 +1714,11 @@ otp_6224_loop() ->
exit_status_multi_scheduling_block(doc) -> [];
exit_status_multi_scheduling_block(suite) -> [];
exit_status_multi_scheduling_block(Config) when is_list(Config) ->
- ?line Repeat = 3,
- ?line case ?t:os_type() of
+ Repeat = 3,
+ case ?t:os_type() of
{unix, _} ->
- ?line Dog = ?t:timetrap(test_server:minutes(2*Repeat)),
- ?line SleepSecs = 6,
+ Dog = ?t:timetrap(test_server:minutes(2*Repeat)),
+ SleepSecs = 6,
try
lists:foreach(fun (_) ->
exit_status_msb_test(Config,
@@ -1799,7 +1732,7 @@ exit_status_multi_scheduling_block(Config) when is_list(Config) ->
?t:timetrap_cancel(Dog),
receive after SleepSecs+500 -> ok end
end;
- _ -> ?line {skip, "Not implemented for this OS"}
+ _ -> {skip, "Not implemented for this OS"}
end.
exit_status_msb_test(Config, SleepSecs) when is_list(Config) ->
@@ -1808,22 +1741,22 @@ exit_status_msb_test(Config, SleepSecs) when is_list(Config) ->
%% and we want these port programs to terminate while multi-scheduling
%% is blocked.
%%
- ?line NoSchedsOnln = erlang:system_info(schedulers_online),
- ?line Parent = self(),
- ?line ?t:format("SleepSecs = ~p~n", [SleepSecs]),
- ?line PortProg = "sleep " ++ integer_to_list(SleepSecs),
- ?line Start = now(),
- ?line NoProcs = case NoSchedsOnln of
+ NoSchedsOnln = erlang:system_info(schedulers_online),
+ Parent = self(),
+ ?t:format("SleepSecs = ~p~n", [SleepSecs]),
+ PortProg = "sleep " ++ integer_to_list(SleepSecs),
+ Start = now(),
+ NoProcs = case NoSchedsOnln of
NProcs when NProcs < ?EXIT_STATUS_MSB_MAX_PROCS ->
NProcs;
_ ->
?EXIT_STATUS_MSB_MAX_PROCS
end,
- ?line NoPortsPerProc = case 20*NoProcs of
+ NoPortsPerProc = case 20*NoProcs of
TNPorts when TNPorts < ?EXIT_STATUS_MSB_MAX_PORTS -> 20;
_ -> ?EXIT_STATUS_MSB_MAX_PORTS div NoProcs
end,
- ?line ?t:format("NoProcs = ~p~nNoPortsPerProc = ~p~n",
+ ?t:format("NoProcs = ~p~nNoPortsPerProc = ~p~n",
[NoProcs, NoPortsPerProc]),
ProcFun
= fun () ->
@@ -1873,32 +1806,32 @@ exit_status_msb_test(Config, SleepSecs) when is_list(Config) ->
PrtSIds),
Parent ! {self(), done}
end,
- ?line Procs = lists:map(fun (N) ->
+ Procs = lists:map(fun (N) ->
spawn_opt(ProcFun,
[link,
{scheduler,
(N rem NoSchedsOnln)+1}])
end,
lists:seq(1, NoProcs)),
- ?line SIds = lists:map(fun (P) ->
+ SIds = lists:map(fun (P) ->
receive {P, started, SIds} -> SIds end
end,
Procs),
- ?line StartedTime = timer:now_diff(now(), Start)/1000000,
- ?line ?t:format("StartedTime = ~p~n", [StartedTime]),
- ?line true = StartedTime < SleepSecs,
- ?line erlang:system_flag(multi_scheduling, block),
- ?line lists:foreach(fun (P) -> receive {P, done} -> ok end end, Procs),
- ?line DoneTime = timer:now_diff(now(), Start)/1000000,
- ?line ?t:format("DoneTime = ~p~n", [DoneTime]),
- ?line true = DoneTime > SleepSecs,
- ?line ok = verify_multi_scheduling_blocked(),
- ?line erlang:system_flag(multi_scheduling, unblock),
- ?line case {length(lists:usort(lists:flatten(SIds))), NoSchedsOnln} of
+ StartedTime = timer:now_diff(now(), Start)/1000000,
+ ?t:format("StartedTime = ~p~n", [StartedTime]),
+ true = StartedTime < SleepSecs,
+ erlang:system_flag(multi_scheduling, block),
+ lists:foreach(fun (P) -> receive {P, done} -> ok end end, Procs),
+ DoneTime = timer:now_diff(now(), Start)/1000000,
+ ?t:format("DoneTime = ~p~n", [DoneTime]),
+ true = DoneTime > SleepSecs,
+ ok = verify_multi_scheduling_blocked(),
+ erlang:system_flag(multi_scheduling, unblock),
+ case {length(lists:usort(lists:flatten(SIds))), NoSchedsOnln} of
{N, N} ->
- ?line ok;
+ ok;
{N, M} ->
- ?line ?t:fail("Failed to create ports on all"
+ ?t:fail("Failed to create ports on all"
++ integer_to_list(M) ++ " available"
"schedulers. Only created ports on "
++ integer_to_list(N) ++ " schedulers.")
@@ -1921,18 +1854,18 @@ sid_proc(SIds) ->
end.
verify_multi_scheduling_blocked() ->
- ?line Procs = lists:map(fun (_) ->
+ Procs = lists:map(fun (_) ->
spawn_link(fun () -> sid_proc([]) end)
end,
lists:seq(1, 3*erlang:system_info(schedulers_online))),
- ?line receive after 1000 -> ok end,
- ?line SIds = lists:map(fun (P) ->
+ receive after 1000 -> ok end,
+ SIds = lists:map(fun (P) ->
P ! {self(), want_sids},
receive {P, sids, PSIds} -> PSIds end
end,
Procs),
- ?line 1 = length(lists:usort(lists:flatten(SIds))),
- ?line ok.
+ 1 = length(lists:usort(lists:flatten(SIds))),
+ ok.
%%% Pinging functions.
@@ -1993,30 +1926,30 @@ build_cmd_line(FixedCmdLine, [], Result) ->
port_expect(Config, Actions, HSize, CmdLine, Options0) ->
% io:format("port_expect(~p, ~p, ~p, ~p)",
% [Actions, HSize, CmdLine, Options0]),
- ?line PortTest = port_test(Config),
- ?line Cmd = lists:concat([PortTest, " -h", HSize, " ", CmdLine]),
- ?line PortType =
+ PortTest = port_test(Config),
+ Cmd = lists:concat([PortTest, " -h", HSize, " ", CmdLine]),
+ PortType =
case HSize of
0 -> stream;
_ -> {packet, HSize}
end,
- ?line Options = [PortType|Options0],
- ?line io:format("open_port({spawn, ~p}, ~p)", [Cmd, Options]),
- ?line Port = open_port({spawn, Cmd}, Options),
- ?line port_expect(Port, Actions, Options),
+ Options = [PortType|Options0],
+ io:format("open_port({spawn, ~p}, ~p)", [Cmd, Options]),
+ Port = open_port({spawn, Cmd}, Options),
+ port_expect(Port, Actions, Options),
Port.
port_expect(Port, [{Send, Expects}|Rest], Options) when is_list(Expects) ->
- ?line port_send(Port, Send),
- ?line IsBinaryPort = lists:member(binary, Options),
- ?line Receiver =
+ port_send(Port, Send),
+ IsBinaryPort = lists:member(binary, Options),
+ Receiver =
case {lists:member(stream, Options), line_option(Options)} of
{false, _} -> fun receive_all/2;
{true,false} -> fun stream_receive_all/2;
{_, true} -> fun receive_all/2
end,
- ?line Receiver(Port, maybe_to_binary(Expects, IsBinaryPort)),
- ?line port_expect(Port, Rest, Options);
+ Receiver(Port, maybe_to_binary(Expects, IsBinaryPort)),
+ port_expect(Port, Rest, Options);
port_expect(_, [], _) ->
ok.
@@ -2068,7 +2001,7 @@ receive_all(Port, [Expect|Rest]) ->
_ ->
%%% io:format("Unexpected message: ~s", [format(Other)]),
io:format("Unexpected message: ~w", [Other]),
- ?line test_server:fail(unexpected_message)
+ test_server:fail(unexpected_message)
end
end,
receive_all(Port, Rest);
@@ -2157,15 +2090,8 @@ build_packet(Left, Result, NextChar0) ->
build_packet(Left-1, [NextChar0|Result], NextChar).
sizes() ->
- case os:type() of
- vxworks ->
- % don't stress VxWorks too much
- [10, 13, 64, 127, 128, 255, 256, 1023, 1024,
- 8191, 8192, 16383, 16384];
- _ ->
- [10, 13, 64, 127, 128, 255, 256, 1023, 1024,
- 32767, 32768, 65535, 65536]
- end.
+ [10, 13, 64, 127, 128, 255, 256, 1023, 1024,
+ 32767, 32768, 65535, 65536].
sizes(Header_Size) ->
sizes(Header_Size, sizes(), []).
@@ -2203,18 +2129,18 @@ fun_spawn(Fun, Args) ->
spawn_link(erlang, apply, [Fun, Args]).
port_test(Config) when is_list(Config) ->
- ?line filename:join(?config(data_dir, Config), "port_test").
+ filename:join(?config(data_dir, Config), "port_test").
ports(doc) -> "Test that erlang:ports/0 returns a consistent snapshot of ports";
ports(suite) -> [];
ports(Config) when is_list(Config) ->
- ?line Path = ?config(data_dir, Config),
- ?line ok = load_driver(Path, "exit_drv"),
+ Path = ?config(data_dir, Config),
+ ok = load_driver(Path, "exit_drv"),
receive after 1000 -> ok end, % Wait for other ports to stabilize
- ?line OtherPorts = erlang:ports(),
+ OtherPorts = erlang:ports(),
io:format("Other ports: ~p\n",[OtherPorts]),
MaxPorts = 1024 - length(OtherPorts),
@@ -2222,7 +2148,7 @@ ports(Config) when is_list(Config) ->
ports_snapshots(100, TrafficPid, OtherPorts),
TrafficPid ! {self(),die},
- ?line receive {TrafficPid, dead} -> ok end,
+ receive {TrafficPid, dead} -> ok end,
ok.
ports_snapshots(0, _, _) ->
@@ -2230,12 +2156,12 @@ ports_snapshots(0, _, _) ->
ports_snapshots(Iter, TrafficPid, OtherPorts) ->
TrafficPid ! start,
- ?line receive after 1 -> ok end,
+ receive after 1 -> ok end,
Snapshot = erlang:ports(),
TrafficPid ! {self(), stop},
- ?line receive {TrafficPid, EventList, TrafficPorts} -> ok end,
+ receive {TrafficPid, EventList, TrafficPorts} -> ok end,
%%io:format("Snapshot=~p\n", [Snapshot]),
ports_verify(Snapshot, OtherPorts ++ TrafficPorts, EventList),
@@ -2252,7 +2178,7 @@ ports_traffic_stopped(MaxPorts, {PortList, PortCnt}) ->
%%io:format("Traffic started in ~p\n",[self()]),
ports_traffic_started(MaxPorts, {PortList, PortCnt}, []);
{Pid,die} ->
- ?line lists:foreach(fun(Port)-> erlang:port_close(Port) end,
+ lists:foreach(fun(Port)-> erlang:port_close(Port) end,
PortList),
Pid ! {self(),dead}
end.
@@ -2272,15 +2198,15 @@ ports_traffic_do(MaxPorts, {PortList, PortCnt}, EventList) ->
N = uniform(MaxPorts),
case N > PortCnt of
true -> % Open port
- ?line P = open_port({spawn, "exit_drv"}, []),
+ P = open_port({spawn, "exit_drv"}, []),
%%io:format("Created port ~p\n",[P]),
ports_traffic_started(MaxPorts, {[P|PortList], PortCnt+1},
[{open,P}|EventList]);
false -> % Close port
- ?line P = lists:nth(N, PortList),
+ P = lists:nth(N, PortList),
%%io:format("Close port ~p\n",[P]),
- ?line true = erlang:port_close(P),
+ true = erlang:port_close(P),
ports_traffic_started(MaxPorts, {lists:delete(P,PortList), PortCnt-1},
[{close,P}|EventList])
end.
@@ -2301,7 +2227,7 @@ ports_verify(Ports, PortsAfter, EventList) ->
ports_verify(Ports, [P | PortsAfter], Tail);
[] ->
- ?line test_server:fail("Inconsistent snapshot from erlang:ports()")
+ test_server:fail("Inconsistent snapshot from erlang:ports()")
end
end.
@@ -2318,27 +2244,27 @@ close_deaf_port(doc) -> ["Send data to port program that does not read it, then
"Primary targeting Windows to test threaded_handle_closer in sys.c"];
close_deaf_port(suite) -> [];
close_deaf_port(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(100)),
- ?line DataDir = ?config(data_dir, Config),
- ?line DeadPort = os:find_executable("dead_port", DataDir),
- ?line Port = open_port({spawn,DeadPort++" 60"},[]),
- ?line erlang:port_command(Port,"Hello, can you hear me!?!?"),
- ?line port_close(Port),
+ Dog = test_server:timetrap(test_server:seconds(100)),
+ DataDir = ?config(data_dir, Config),
+ DeadPort = os:find_executable("dead_port", DataDir),
+ Port = open_port({spawn,DeadPort++" 60"},[]),
+ erlang:port_command(Port,"Hello, can you hear me!?!?"),
+ port_close(Port),
Res = close_deaf_port_1(0, DeadPort),
io:format("Waiting for OS procs to terminate...\n"),
receive after 5*1000 -> ok end,
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
Res.
close_deaf_port_1(1000, _) ->
ok;
close_deaf_port_1(N, Cmd) ->
Timeout = integer_to_list(random:uniform(5*1000)),
- ?line try open_port({spawn_executable,Cmd},[{args,[Timeout]}]) of
+ try open_port({spawn_executable,Cmd},[{args,[Timeout]}]) of
Port ->
- ?line erlang:port_command(Port,"Hello, can you hear me!?!?"),
- ?line port_close(Port),
+ erlang:port_command(Port,"Hello, can you hear me!?!?"),
+ port_close(Port),
close_deaf_port_1(N+1, Cmd)
catch
_:eagain ->
diff --git a/erts/emulator/test/port_SUITE_data/dead_port.c b/erts/emulator/test/port_SUITE_data/dead_port.c
index 68e96fbf14..4dd9ee4cc2 100644
--- a/erts/emulator/test/port_SUITE_data/dead_port.c
+++ b/erts/emulator/test/port_SUITE_data/dead_port.c
@@ -17,15 +17,6 @@
* %CopyrightEnd%
*/
-#ifdef VXWORKS
-#include <vxWorks.h>
-#include <taskVarLib.h>
-#include <taskLib.h>
-#include <sysLib.h>
-#include <string.h>
-#include <ioLib.h>
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -37,12 +28,7 @@
#ifndef __WIN32__
#include <unistd.h>
-#ifdef VXWORKS
-#include "reclaim.h"
-#include <sys/times.h>
-#else
#include <sys/time.h>
-#endif
#define O_BINARY 0
#define _setmode(fd, mode)
@@ -53,13 +39,7 @@
#include "winbase.h"
#endif
-
-#ifdef VXWORKS
-#define MAIN(argc, argv) port_test(argc, argv)
-#else
#define MAIN(argc, argv) main(argc, argv)
-#endif
-
extern int errno;
@@ -86,9 +66,6 @@ char *argv[];
static void
delay(unsigned ms)
{
-#ifdef VXWORKS
- taskDelay((sysClkRateGet() * ms) / 1000);
-#else
#ifdef __WIN32__
Sleep(ms);
#else
@@ -98,5 +75,4 @@ delay(unsigned ms)
select(0, NULL, NULL, NULL, &t);
#endif
-#endif
}
diff --git a/erts/emulator/test/port_SUITE_data/port_test.c b/erts/emulator/test/port_SUITE_data/port_test.c
index 7b4e386d87..7abefab2e3 100644
--- a/erts/emulator/test/port_SUITE_data/port_test.c
+++ b/erts/emulator/test/port_SUITE_data/port_test.c
@@ -3,15 +3,6 @@
* Purpose: A port program to be used for testing the open_port bif.
*/
-#ifdef VXWORKS
-#include <vxWorks.h>
-#include <taskVarLib.h>
-#include <taskLib.h>
-#include <sysLib.h>
-#include <string.h>
-#include <ioLib.h>
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -23,12 +14,7 @@
#ifndef __WIN32__
#include <unistd.h>
-#ifdef VXWORKS
-#include "reclaim.h"
-#include <sys/times.h>
-#else
#include <sys/time.h>
-#endif
#define O_BINARY 0
#define _setmode(fd, mode)
@@ -40,22 +26,13 @@
#endif
-#ifdef VXWORKS
-#define REDIR_STDOUT(fd) ioTaskStdSet(0, 1, fd);
-#else
#define REDIR_STDOUT(fd) if (dup2(fd, 1) == -1) { \
fprintf(stderr, "%s: failed to duplicate handle %d to 1: %d\n", \
port_data->progname, fd, errno); \
exit(1); \
}
-#endif
-#ifdef VXWORKS
-#define MAIN(argc, argv) port_test(argc, argv)
-#else
#define MAIN(argc, argv) main(argc, argv)
-#endif
-
extern int errno;
@@ -101,7 +78,6 @@ static void dump(unsigned char* buf, int sz, int max);
static void replace_stdout(char* filename);
static void generate_reply(char* spec);
-#ifndef VXWORKS
#ifndef HAVE_STRERROR
extern int sys_nerr;
#ifndef sys_errlist /* sys_errlist is sometimes defined to
@@ -125,7 +101,6 @@ int err;
return msgstr;
}
#endif
-#endif
MAIN(argc, argv)
@@ -133,12 +108,6 @@ int argc;
char *argv[];
{
int ret;
-#ifdef VXWORKS
- if(taskVarAdd(0, (int *)&port_data) != OK) {
- fprintf(stderr, "Can't do taskVarAdd in port_test\n");
- exit(1);
- }
-#endif
if((port_data = (PORT_TEST_DATA *) malloc(sizeof(PORT_TEST_DATA))) == NULL) {
fprintf(stderr, "Couldn't malloc for port_data");
exit(1);
@@ -511,9 +480,6 @@ dump(buf, sz, max)
static void
delay(unsigned ms)
{
-#ifdef VXWORKS
- taskDelay((sysClkRateGet() * ms) / 1000);
-#else
#ifdef __WIN32__
Sleep(ms);
#else
@@ -523,7 +489,6 @@ delay(unsigned ms)
select(0, NULL, NULL, NULL, &t);
#endif
-#endif
}
/*
diff --git a/erts/emulator/test/port_SUITE_data/reclaim.h b/erts/emulator/test/port_SUITE_data/reclaim.h
deleted file mode 100644
index 1d57dc5b8a..0000000000
--- a/erts/emulator/test/port_SUITE_data/reclaim.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef __RECLAIM_H__
-#define __RECLAIM_H__
-
-
-/* The Erlang release for VxWorks includes a simple mechanism for
- "resource reclamation" at task exit - it allows replacement of the
- functions that open/close "files" and malloc/free memory with versions
- that keep track, to be able to "reclaim" file descriptors and memory
- when a task exits (regardless of *how* it exits).
-
- The interface to this mechanism is made available via this file,
- with the following caveats:
-
- - The interface may change (or perhaps even be removed, though that
- isn't likely until VxWorks itself provides similar functionality)
- in future releases - i.e. you must always use the version of this
- file that comes with the Erlang release you are using.
-
- - Disaster is guaranteed if you use the mechanism incorrectly (see
- below for the correct way), e.g. allocate memory with the "tracking"
- version of malloc() and free it with the "standard" version of free().
-
- - The mechanism (of course) incurs some performance penalty - thus
- for a simple program you may be better off with careful programming,
- making sure that you do whatever close()/free()/etc calls that are
- appropriate at all exit points (though if you need to guard against
- taskDelete() etc, things get messy...).
-
- To use the mechanism, simply program your application normally, i.e.
- use open()/close()/malloc()/free() etc as usual, but #include this
- file before any usage of the relevant functions. NOTE: To avoid the
- "disaster" mentioned above, you *must* #include it in *all* (or none)
- of the files that manipulate a particular file descriptor, allocated
- memory area, etc. Finally, note that you can obviously not load your
- application before the Erlang system when using this interface.
-*/
-
-/* Sorry, no ANSI prototypes yet... */
-extern int save_open(),save_creat(),save_socket(),save_accept(),save_close();
-#define open save_open
-#define creat save_creat
-#define socket save_socket
-#define accept save_accept
-#define close save_close
-extern FILE *save_fopen(), *save_fdopen(), *save_freopen();
-extern int save_fclose();
-#define fopen save_fopen
-#define fdopen save_fdopen
-#define freopen save_freopen
-#define fclose save_fclose
-/* XXX Should do opendir/closedir too... */
-extern char *save_malloc(), *save_calloc(), *save_realloc();
-extern void save_free(), save_cfree();
-#define malloc save_malloc
-#define calloc save_calloc
-#define realloc save_realloc
-#define free save_free
-#define cfree save_cfree
-
-#endif
diff --git a/erts/emulator/test/port_bif_SUITE.erl b/erts/emulator/test/port_bif_SUITE.erl
index d9c82aba0e..f439867e9c 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -24,6 +24,7 @@
init_per_group/2,end_per_group/2, command/1,
command_e_1/1, command_e_2/1, command_e_3/1, command_e_4/1,
port_info1/1, port_info2/1,
+ port_info_os_pid/1,
connect/1, control/1, echo_to_busy/1]).
-export([do_command_e_1/1, do_command_e_2/1, do_command_e_4/1]).
@@ -41,7 +42,7 @@ all() ->
groups() ->
[{command_e, [],
[command_e_1, command_e_2, command_e_3, command_e_4]},
- {port_info, [], [port_info1, port_info2]}].
+ {port_info, [], [port_info1, port_info2, port_info_os_pid]}].
init_per_suite(Config) ->
Config.
@@ -65,15 +66,15 @@ end_per_testcase(_Func, Config) when is_list(Config) ->
test_server:timetrap_cancel(Dog).
command(Config) when is_list(Config) ->
- ?line load_control_drv(Config),
-
- ?line P = open_port({spawn, control_drv}, []),
- ?line do_command(P, "hello"),
- ?line do_command(P, <<"hello">>),
- ?line do_command(P, sub_bin(<<"1234kalle">>)),
- ?line do_command(P, unaligned_sub_bin(<<"blurf">>)),
- ?line do_command(P, ["bl"|unaligned_sub_bin(<<"urf">>)]),
- ?line true = erlang:port_close(P),
+ load_control_drv(Config),
+
+ P = open_port({spawn, control_drv}, []),
+ do_command(P, "hello"),
+ do_command(P, <<"hello">>),
+ do_command(P, sub_bin(<<"1234kalle">>)),
+ do_command(P, unaligned_sub_bin(<<"blurf">>)),
+ do_command(P, ["bl"|unaligned_sub_bin(<<"urf">>)]),
+ true = erlang:port_close(P),
ok.
do_command(P, Data) ->
@@ -94,139 +95,163 @@ do_command(P, Data) ->
%% port_command/2: badarg 1st arg
command_e_1(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line Program = filename:join(DataDir, "port_test"),
+ DataDir = ?config(data_dir, Config),
+ Program = filename:join(DataDir, "port_test"),
process_flag(trap_exit, true),
- ?line _ = spawn_link(?MODULE, do_command_e_1, [Program]),
- ?line receive
- {'EXIT', Pid, {badarg, _}} when is_pid(Pid) ->
- ok;
- Other ->
- ?line test_server:fail(Other)
- after 10000 ->
- ?line test_server:fail(timeout)
- end,
+ _ = spawn_link(?MODULE, do_command_e_1, [Program]),
+ receive
+ {'EXIT', Pid, {badarg, _}} when is_pid(Pid) ->
+ ok;
+ Other ->
+ test_server:fail(Other)
+ after 10000 ->
+ test_server:fail(timeout)
+ end,
ok.
do_command_e_1(Program) ->
- ?line _ = open_port({spawn, Program}, []),
- ?line erlang:port_command(apple, "plock"),
+ _ = open_port({spawn, Program}, []),
+ erlang:port_command(apple, "plock"),
exit(survived).
%% port_command/2: badarg 2nd arg
command_e_2(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line Program = filename:join(DataDir, "port_test"),
+ DataDir = ?config(data_dir, Config),
+ Program = filename:join(DataDir, "port_test"),
process_flag(trap_exit, true),
- ?line _ = spawn_link(?MODULE, do_command_e_2, [Program]),
- ?line receive
- {'EXIT', Pid, {badarg, _}} when is_pid(Pid) ->
- ok;
- Other ->
- ?line test_server:fail(Other)
- after 10000 ->
- ?line test_server:fail(timeout)
- end,
+ _ = spawn_link(?MODULE, do_command_e_2, [Program]),
+ receive
+ {'EXIT', Pid, {badarg, _}} when is_pid(Pid) ->
+ ok;
+ Other ->
+ test_server:fail(Other)
+ after 10000 ->
+ test_server:fail(timeout)
+ end,
ok.
do_command_e_2(Program) ->
- ?line P = open_port({spawn, Program}, []),
- ?line erlang:port_command(P, 1),
+ P = open_port({spawn, Program}, []),
+ erlang:port_command(P, 1),
exit(survived).
%% port_command/2: Posix signals trapped
command_e_3(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line Program = filename:join(DataDir, "port_test"),
+ DataDir = ?config(data_dir, Config),
+ Program = filename:join(DataDir, "port_test"),
process_flag(trap_exit, true),
- ?line P = open_port({spawn, Program}, [{packet, 1}]),
- ?line Data = lists:duplicate(257, $a),
- ?line erlang:port_command(P, Data),
- ?line receive
- {'EXIT', Port, einval} when is_port(Port) ->
- ok;
- Other ->
- test_server:fail(Other)
- after 10000 ->
- test_server:fail(timeout)
- end,
+ P = open_port({spawn, Program}, [{packet, 1}]),
+ Data = lists:duplicate(257, $a),
+ erlang:port_command(P, Data),
+ receive
+ {'EXIT', Port, einval} when is_port(Port) ->
+ ok;
+ Other ->
+ test_server:fail(Other)
+ after 10000 ->
+ test_server:fail(timeout)
+ end,
ok.
%% port_command/2: Posix exit signals not trapped
command_e_4(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line Program = filename:join(DataDir, "port_test"),
+ DataDir = ?config(data_dir, Config),
+ Program = filename:join(DataDir, "port_test"),
process_flag(trap_exit, true),
- ?line _ = spawn_link(?MODULE, do_command_e_4, [Program]),
- ?line receive
- {'EXIT', Pid, {einval, _}} when is_pid(Pid) ->
- ok;
- Other ->
- ?line test_server:fail(Other)
- after 10000 ->
- ?line test_server:fail(timeout)
- end,
+ _ = spawn_link(?MODULE, do_command_e_4, [Program]),
+ receive
+ {'EXIT', Pid, {einval, _}} when is_pid(Pid) ->
+ ok;
+ Other ->
+ test_server:fail(Other)
+ after 10000 ->
+ test_server:fail(timeout)
+ end,
ok.
do_command_e_4(Program) ->
- ?line P = open_port({spawn, Program}, [{packet, 1}]),
- ?line Data = lists:duplicate(257, $a),
- ?line erlang:port_command(P, Data),
+ P = open_port({spawn, Program}, [{packet, 1}]),
+ Data = lists:duplicate(257, $a),
+ erlang:port_command(P, Data),
exit(survived).
%% Tests the port_info/1 BIF
port_info1(Config) when is_list(Config) ->
- ?line load_control_drv(Config),
+ load_control_drv(Config),
Me=self(),
- ?line P = open_port({spawn, control_drv}, []),
- ?line A1 = erlang:port_info(P),
- ?line false = lists:keysearch(registered_name, 1, A1),
- ?line register(myport, P),
- ?line A = erlang:port_info(P),
- ?line {value,{registered_name,myport}}=
- lists:keysearch(registered_name, 1, A),
- ?line {value,{name,"control_drv"}}=lists:keysearch(name, 1, A),
- ?line {value,{links,[Me]}}=lists:keysearch(links, 1, A),
- ?line {value,{id,_IdNum}}=lists:keysearch(id, 1, A),
- ?line {value,{connected,_}}=lists:keysearch(connected, 1, A),
- ?line {value,{input,0}}=lists:keysearch(input, 1, A),
- ?line {value,{output,0}}=lists:keysearch(output, 1, A),
- ?line true=erlang:port_close(P),
+ P = open_port({spawn, control_drv}, []),
+ A1 = erlang:port_info(P),
+ false = lists:keysearch(registered_name, 1, A1),
+ register(myport, P),
+ A = erlang:port_info(P),
+ {value,{registered_name,myport}}= lists:keysearch(registered_name, 1, A),
+ {value,{name,"control_drv"}}=lists:keysearch(name, 1, A),
+ {value,{links,[Me]}}=lists:keysearch(links, 1, A),
+ {value,{id,_IdNum}}=lists:keysearch(id, 1, A),
+ {value,{connected,_}}=lists:keysearch(connected, 1, A),
+ {value,{input,0}}=lists:keysearch(input, 1, A),
+ {value,{output,0}}=lists:keysearch(output, 1, A),
+ {value,{os_pid,undefined}}=lists:keysearch(os_pid, 1, A), % linked-in driver doesn't have a OS pid
+ true=erlang:port_close(P),
ok.
%% Tests erlang:port_info/2"
port_info2(Config) when is_list(Config) ->
- ?line load_control_drv(Config),
+ load_control_drv(Config),
- ?line P = open_port({spawn,control_drv}, [binary]),
- ?line [] = erlang:port_info(P, registered_name),
- ?line register(myport, P),
- ?line {registered_name, myport} = erlang:port_info(P, registered_name),
+ P = open_port({spawn,control_drv}, [binary]),
+ [] = erlang:port_info(P, registered_name),
+ register(myport, P),
+ {registered_name, myport} = erlang:port_info(P, registered_name),
- ?line {name, "control_drv"}=erlang:port_info(P, name),
- ?line {id, _IdNum} = erlang:port_info(P, id),
+ {name, "control_drv"}=erlang:port_info(P, name),
+ {id, _IdNum} = erlang:port_info(P, id),
Me=self(),
- ?line {links, [Me]} = erlang:port_info(P, links),
- ?line {connected, Me} = erlang:port_info(P, connected),
- ?line {input, 0}=erlang:port_info(P, input),
- ?line {output,0}=erlang:port_info(P, output),
-
- ?line erlang:port_control(P, $i, "abc"),
- ?line receive
- {P,{data,<<"abc">>}} -> ok
- end,
- ?line {input,3} = erlang:port_info(P, input),
- ?line {output,0} = erlang:port_info(P, output),
-
- ?line Bin = list_to_binary(lists:duplicate(2047, 42)),
- ?line output_test(P, Bin, 3, 0),
+ {links, [Me]} = erlang:port_info(P, links),
+ {connected, Me} = erlang:port_info(P, connected),
+ {input, 0}=erlang:port_info(P, input),
+ {output,0}=erlang:port_info(P, output),
+ {os_pid, undefined}=erlang:port_info(P, os_pid), % linked-in driver doesn't have a OS pid
+
+ erlang:port_control(P, $i, "abc"),
+ receive
+ {P,{data,<<"abc">>}} -> ok
+ end,
+ {input,3} = erlang:port_info(P, input),
+ {output,0} = erlang:port_info(P, output),
+
+ Bin = list_to_binary(lists:duplicate(2047, 42)),
+ output_test(P, Bin, 3, 0),
- ?line true = erlang:port_close(P),
+ true = erlang:port_close(P),
+ ok.
+
+%% Tests the port_info/1,2 os_pid option BIF
+port_info_os_pid(Config) when is_list(Config) ->
+ case os:type() of
+ {unix,_} ->
+ do_port_info_os_pid();
+ _ ->
+ {skip,"Only on Unix."}
+ end.
+
+do_port_info_os_pid() ->
+ P = open_port({spawn, "echo $$"}, [eof]),
+ A = erlang:port_info(P),
+ {os_pid, InfoOSPid} = erlang:port_info(P, os_pid),
+ EchoPidStr = receive
+ {P, {data, EchoPidStr0}} -> EchoPidStr0
+ after 10000 -> test_server:fail(timeout)
+ end,
+ {ok, [EchoPid], []} = io_lib:fread("~u\n", EchoPidStr),
+ {value,{os_pid, InfoOSPid}}=lists:keysearch(os_pid, 1, A),
+ EchoPid = InfoOSPid,
+ true = erlang:port_close(P),
ok.
output_test(_, _, Input, Output) when Output > 16#1fffffff ->
@@ -237,7 +262,7 @@ output_test(P, Bin, Input0, Output0) ->
{P,{data,Bin}} -> ok;
Other ->
io:format("~p", [Other]),
- ?line ?t:fail()
+ ?t:fail()
end,
Input = Input0 + size(Bin),
Output = Output0 + size(Bin),
@@ -254,109 +279,106 @@ output_test(P, Bin, Input0, Output0) ->
%% Tests the port_connect/2 BIF.
connect(Config) when is_list(Config) ->
- ?line load_control_drv(Config),
+ load_control_drv(Config),
- ?line P = open_port({spawn, control_drv}, []),
+ P = open_port({spawn, control_drv}, []),
register(myport, P),
- ?line true = erlang:port_connect(myport, self()),
+ true = erlang:port_connect(myport, self()),
%% Connect the port to another process.
Data = "hello, world",
Parent = self(),
- ?line Rec =
- fun(Me) -> receive
- {P,{data,Data}} ->
- Parent ! connect_ok,
- Me(Me)
- end
- end,
- ?line RecPid = spawn_link(fun() -> Rec(Rec) end),
- ?line true = erlang:port_connect(P, RecPid),
- ?line unlink(P),
+ Rec = fun(Me) ->
+ receive
+ {P,{data,Data}} ->
+ Parent ! connect_ok,
+ Me(Me)
+ end
+ end,
+ RecPid = spawn_link(fun() -> Rec(Rec) end),
+ true = erlang:port_connect(P, RecPid),
+ unlink(P),
%% Send a command to the port and make sure that the
%% other process receives the echo.
- ?line erlang:port_command(P, Data),
- ?line receive
- connect_ok -> ok
- end,
+ erlang:port_command(P, Data),
+ receive
+ connect_ok -> ok
+ end,
%% Tests some errors.
- ?line {'EXIT',{badarg, _}}=(catch erlang:port_connect(self(), self())),
- ?line {'EXIT',{badarg, _}}=(catch erlang:port_connect(self(), P)),
- ?line {'EXIT',{badarg, _}}=(catch erlang:port_connect(P, P)),
- ?line {'EXIT',{badarg, _}}=(catch erlang:port_connect(P, xxxx)),
- ?line {'EXIT',{badarg, _}}=(catch erlang:port_connect(P, [])),
+ {'EXIT',{badarg, _}}=(catch erlang:port_connect(self(), self())),
+ {'EXIT',{badarg, _}}=(catch erlang:port_connect(self(), P)),
+ {'EXIT',{badarg, _}}=(catch erlang:port_connect(P, P)),
+ {'EXIT',{badarg, _}}=(catch erlang:port_connect(P, xxxx)),
+ {'EXIT',{badarg, _}}=(catch erlang:port_connect(P, [])),
- ?line process_flag(trap_exit, true),
- ?line exit(P, you_should_die),
- ?line receive
- {'EXIT',RecPid,you_should_die} -> ok;
- Other -> ?line ?t:fail({bad_message,Other})
- end,
+ process_flag(trap_exit, true),
+ exit(P, you_should_die),
+ receive
+ {'EXIT',RecPid,you_should_die} -> ok;
+ Other -> ?line ?t:fail({bad_message,Other})
+ end,
%% Done.
ok.
%% Tests port_control/3
control(Config) when is_list(Config) ->
- ?line load_control_drv(Config),
- ?line P = open_port({spawn, control_drv}, []),
+ load_control_drv(Config),
+ P = open_port({spawn, control_drv}, []),
%% Test invalid (out-of-range) arguments.
- ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(self(), 1, [])),
+ {'EXIT', {badarg, _}} = (catch erlang:port_control(self(), 1, [])),
- ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, -1, [])),
- ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, -34887348739733833, [])),
- ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, 16#100000000, [])),
- ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, a, [])),
- ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, 'e', dum)),
- ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, $e, dum)),
- ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, $e, fun(X) -> X end)),
- ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, $e,
- [fun(X) -> X end])),
- ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, $e,
- [1|fun(X) -> X end])),
+ {'EXIT', {badarg, _}} = (catch erlang:port_control(P, -1, [])),
+ {'EXIT', {badarg, _}} = (catch erlang:port_control(P, -34887348739733833, [])),
+ {'EXIT', {badarg, _}} = (catch erlang:port_control(P, 16#100000000, [])),
+ {'EXIT', {badarg, _}} = (catch erlang:port_control(P, a, [])),
+ {'EXIT', {badarg, _}} = (catch erlang:port_control(P, 'e', dum)),
+ {'EXIT', {badarg, _}} = (catch erlang:port_control(P, $e, dum)),
+ {'EXIT', {badarg, _}} = (catch erlang:port_control(P, $e, fun(X) -> X end)),
+ {'EXIT', {badarg, _}} = (catch erlang:port_control(P, $e, [fun(X) -> X end])),
+ {'EXIT', {badarg, _}} = (catch erlang:port_control(P, $e, [1|fun(X) -> X end])),
%% Test errors detected by the driver.
- ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, 177, [])),
- ?line {'EXIT', {badarg, _}} = (catch erlang:port_control(P, 155,
- random_packet(1024))),
+ {'EXIT', {badarg, _}} = (catch erlang:port_control(P, 177, [])),
+ {'EXIT', {badarg, _}} = (catch erlang:port_control(P, 155, random_packet(1024))),
%% Test big op codes.
register(myport, P),
- ?line test_op(myport, 256),
- ?line test_op(P, 256),
- ?line test_op(P, 16#0033A837),
- ?line test_op(P, 16#0ab37938),
- ?line test_op(P, 16#eab37938),
- ?line test_op(P, 16#ffffFFFF),
+ test_op(myport, 256),
+ test_op(P, 256),
+ test_op(P, 16#0033A837),
+ test_op(P, 16#0ab37938),
+ test_op(P, 16#eab37938),
+ test_op(P, 16#ffffFFFF),
%% Test the echo function of the driver.
- ?line echo(P, 0),
- ?line echo(P, 1),
- ?line echo(P, 10),
- ?line echo(P, 13),
- ?line echo(P, 63),
- ?line echo(P, 64),
- ?line echo(P, 65),
- ?line echo(P, 127),
- ?line echo(P, 1023),
- ?line echo(P, 1024),
- ?line echo(P, 11243),
- ?line echo(P, 70000),
+ echo(P, 0),
+ echo(P, 1),
+ echo(P, 10),
+ echo(P, 13),
+ echo(P, 63),
+ echo(P, 64),
+ echo(P, 65),
+ echo(P, 127),
+ echo(P, 1023),
+ echo(P, 1024),
+ echo(P, 11243),
+ echo(P, 70000),
%% Done.
- ?line true=erlang:port_close(myport),
+ true = erlang:port_close(myport),
ok.
test_op(P, Op) ->
@@ -364,23 +386,23 @@ test_op(P, Op) ->
<<Op:32>> = list_to_binary(R).
echo_to_busy(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line load_control_drv(Config),
- ?line P = open_port({spawn, control_drv}, []),
- ?line erlang:port_control(P, $b, [1]), % Set to busy.
+ Dog = test_server:timetrap(test_server:seconds(10)),
+ load_control_drv(Config),
+ P = open_port({spawn, control_drv}, []),
+ erlang:port_control(P, $b, [1]), % Set to busy.
Self = self(),
- ?line Echoer = spawn(fun() -> echoer(P, Self) end),
- ?line receive after 500 -> ok end,
- ?line erlang:port_control(P, $b, [0]), % Set to not busy.
- ?line receive
- {Echoer, done} ->
- ok;
- {Echoer, Other} ->
- test_server:fail(Other);
- Other ->
- test_server:fail({unexpected_message, Other})
- end,
- ?line test_server:timetrap_cancel(Dog),
+ Echoer = spawn(fun() -> echoer(P, Self) end),
+ receive after 500 -> ok end,
+ erlang:port_control(P, $b, [0]), % Set to not busy.
+ receive
+ {Echoer, done} ->
+ ok;
+ {Echoer, Other} ->
+ test_server:fail(Other);
+ Other ->
+ test_server:fail({unexpected_message, Other})
+ end,
+ test_server:timetrap_cancel(Dog),
ok.
echoer(P, ReplyTo) ->
@@ -405,9 +427,9 @@ echo(P, Size) ->
Packet = erlang:port_control(P, $e, [unaligned_sub_bin(Bin)]).
load_control_drv(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line erl_ddll:start(),
- ?line ok = load_driver(DataDir, "control_drv").
+ DataDir = ?config(data_dir, Config),
+ erl_ddll:start(),
+ ok = load_driver(DataDir, "control_drv").
load_driver(Dir, Driver) ->
case erl_ddll:load_driver(Dir, Driver) of
@@ -459,4 +481,3 @@ sub_bin(Bin) when is_binary(Bin) ->
B.
id(I) -> I.
-
diff --git a/erts/emulator/test/port_bif_SUITE_data/port_test.c b/erts/emulator/test/port_bif_SUITE_data/port_test.c
index c6b128df66..28324a56a6 100644
--- a/erts/emulator/test/port_bif_SUITE_data/port_test.c
+++ b/erts/emulator/test/port_bif_SUITE_data/port_test.c
@@ -3,15 +3,6 @@
* Purpose: A port program to be used for testing the open_port bif.
*/
-#ifdef VXWORKS
-#include <vxWorks.h>
-#include <taskVarLib.h>
-#include <taskLib.h>
-#include <sysLib.h>
-#include <string.h>
-#include <ioLib.h>
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -23,12 +14,7 @@
#ifndef __WIN32__
#include <unistd.h>
-#ifdef VXWORKS
-#include "reclaim.h"
-#include <sys/times.h>
-#else
#include <sys/time.h>
-#endif
#define O_BINARY 0
#define _setmode(fd, mode)
@@ -40,22 +26,13 @@
#endif
-#ifdef VXWORKS
-#define REDIR_STDOUT(fd) ioTaskStdSet(0, 1, fd);
-#else
#define REDIR_STDOUT(fd) if (dup2(fd, 1) == -1) { \
fprintf(stderr, "%s: failed to duplicate handle %d to 1: %d\n", \
port_data->progname, fd, errno); \
exit(1); \
}
-#endif
-#ifdef VXWORKS
-#define MAIN(argc, argv) port_test(argc, argv)
-#else
#define MAIN(argc, argv) main(argc, argv)
-#endif
-
extern int errno;
@@ -101,7 +78,6 @@ static void dump(unsigned char* buf, int sz, int max);
static void replace_stdout(char* filename);
static void generate_reply(char* spec);
-#ifndef VXWORKS
#ifndef HAVE_STRERROR
extern int sys_nerr;
#ifndef sys_errlist /* sys_errlist is sometimes defined to
@@ -125,20 +101,13 @@ int err;
return msgstr;
}
#endif
-#endif
-
MAIN(argc, argv)
int argc;
char *argv[];
{
int ret;
-#ifdef VXWORKS
- if(taskVarAdd(0, (int *)&port_data) != OK) {
- fprintf(stderr, "Can't do taskVarAdd in port_test\n");
- exit(1);
- }
-#endif
+
if((port_data = (PORT_TEST_DATA *) malloc(sizeof(PORT_TEST_DATA))) == NULL) {
fprintf(stderr, "Couldn't malloc for port_data");
exit(1);
@@ -508,9 +477,6 @@ dump(buf, sz, max)
static void
delay(unsigned ms)
{
-#ifdef VXWORKS
- taskDelay((sysClkRateGet() * ms) / 1000);
-#else
#ifdef __WIN32__
Sleep(ms);
#else
@@ -520,7 +486,6 @@ delay(unsigned ms)
select(0, NULL, NULL, NULL, &t);
#endif
-#endif
}
/*
diff --git a/erts/emulator/test/port_bif_SUITE_data/reclaim.h b/erts/emulator/test/port_bif_SUITE_data/reclaim.h
deleted file mode 100644
index 1d57dc5b8a..0000000000
--- a/erts/emulator/test/port_bif_SUITE_data/reclaim.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef __RECLAIM_H__
-#define __RECLAIM_H__
-
-
-/* The Erlang release for VxWorks includes a simple mechanism for
- "resource reclamation" at task exit - it allows replacement of the
- functions that open/close "files" and malloc/free memory with versions
- that keep track, to be able to "reclaim" file descriptors and memory
- when a task exits (regardless of *how* it exits).
-
- The interface to this mechanism is made available via this file,
- with the following caveats:
-
- - The interface may change (or perhaps even be removed, though that
- isn't likely until VxWorks itself provides similar functionality)
- in future releases - i.e. you must always use the version of this
- file that comes with the Erlang release you are using.
-
- - Disaster is guaranteed if you use the mechanism incorrectly (see
- below for the correct way), e.g. allocate memory with the "tracking"
- version of malloc() and free it with the "standard" version of free().
-
- - The mechanism (of course) incurs some performance penalty - thus
- for a simple program you may be better off with careful programming,
- making sure that you do whatever close()/free()/etc calls that are
- appropriate at all exit points (though if you need to guard against
- taskDelete() etc, things get messy...).
-
- To use the mechanism, simply program your application normally, i.e.
- use open()/close()/malloc()/free() etc as usual, but #include this
- file before any usage of the relevant functions. NOTE: To avoid the
- "disaster" mentioned above, you *must* #include it in *all* (or none)
- of the files that manipulate a particular file descriptor, allocated
- memory area, etc. Finally, note that you can obviously not load your
- application before the Erlang system when using this interface.
-*/
-
-/* Sorry, no ANSI prototypes yet... */
-extern int save_open(),save_creat(),save_socket(),save_accept(),save_close();
-#define open save_open
-#define creat save_creat
-#define socket save_socket
-#define accept save_accept
-#define close save_close
-extern FILE *save_fopen(), *save_fdopen(), *save_freopen();
-extern int save_fclose();
-#define fopen save_fopen
-#define fdopen save_fdopen
-#define freopen save_freopen
-#define fclose save_fclose
-/* XXX Should do opendir/closedir too... */
-extern char *save_malloc(), *save_calloc(), *save_realloc();
-extern void save_free(), save_cfree();
-#define malloc save_malloc
-#define calloc save_calloc
-#define realloc save_realloc
-#define free save_free
-#define cfree save_cfree
-
-#endif
diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl
index fdc55a4cc5..6509871a7d 100644
--- a/erts/emulator/test/process_SUITE.erl
+++ b/erts/emulator/test/process_SUITE.erl
@@ -280,15 +280,7 @@ kb_128() ->
big_binary()}.
eight_kb() ->
- %%% This is really much more than eight kb, so vxworks platforms
- %%% gets away with 1/8 of the other platforms (due to limited
- %%% memory resources).
- B64 = case os:type() of
- vxworks ->
- ?line lists:seq(1, 8);
- _ ->
- ?line lists:seq(1, 64)
- end,
+ B64 = lists:seq(1, 64),
?line B512 = {<<1>>,B64,<<2,3>>,B64,make_unaligned_sub_binary(<<4,5,6,7,8,9>>),
B64,make_sub_binary([1,2,3,4,5,6]),
B64,make_sub_binary(lists:seq(1, ?heap_binary_size+1)),
diff --git a/erts/emulator/test/statistics_SUITE.erl b/erts/emulator/test/statistics_SUITE.erl
index 0392312a6f..a93dd309c1 100644
--- a/erts/emulator/test/statistics_SUITE.erl
+++ b/erts/emulator/test/statistics_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -29,6 +29,7 @@
runtime_zero_diff/1,
runtime_update/1, runtime_diff/1,
run_queue_one/1,
+ scheduler_wall_time/1,
reductions/1, reductions_big/1, garbage_collection/1, io/1,
badarg/1]).
@@ -51,8 +52,8 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[{group, wall_clock}, {group, runtime}, reductions,
- reductions_big, {group, run_queue}, garbage_collection,
- io, badarg].
+ reductions_big, {group, run_queue}, scheduler_wall_time,
+ garbage_collection, io, badarg].
groups() ->
[{wall_clock, [],
@@ -266,11 +267,10 @@ run_queue_one(Config) when is_list(Config) ->
run_queue_one_test(Config) when is_list(Config) ->
- ?line Hog = spawn_link(?MODULE, hog, [self()]),
+ ?line _Hog = spawn_link(?MODULE, hog, [self()]),
?line receive
- hog_started ->
- Hog ! go
- end,
+ hog_started -> ok
+ end,
?line receive after 100 -> ok end, % Give hog a head start.
?line case statistics(run_queue) of
N when N >= 1 -> ok;
@@ -280,18 +280,88 @@ run_queue_one_test(Config) when is_list(Config) ->
%% CPU-bound process, going at low priority. It will always be ready
%% to run.
-
+
hog(Pid) ->
?line process_flag(priority, low),
?line Pid ! hog_started,
- ?line receive
- go -> hog_iter(0)
+ ?line Mon = erlang:monitor(process, Pid),
+ ?line hog_iter(0, Mon).
+
+hog_iter(N, Mon) when N > 0 ->
+ receive
+ {'DOWN', Mon, _, _, _} -> ok
+ after 0 ->
+ ?line hog_iter(N-1, Mon)
+ end;
+hog_iter(0, Mon) ->
+ ?line hog_iter(10000, Mon).
+
+%%% Tests of statistics(scheduler_wall_time).
+
+scheduler_wall_time(doc) ->
+ "Tests that statistics(scheduler_wall_time) works as intended";
+scheduler_wall_time(Config) when is_list(Config) ->
+ %% Should return undefined if system_flag is not turned on yet
+ undefined = statistics(scheduler_wall_time),
+ %% Turn on statistics
+ false = erlang:system_flag(scheduler_wall_time, true),
+ try
+ Schedulers = erlang:system_info(schedulers_online),
+ %% Let testserver and everyone else finish their work
+ timer:sleep(500),
+ %% Empty load
+ EmptyLoad = get_load(),
+ {false, _} = {lists:any(fun(Load) -> Load > 50 end, EmptyLoad),EmptyLoad},
+ MeMySelfAndI = self(),
+ StartHog = fun() ->
+ Pid = spawn(?MODULE, hog, [self()]),
+ receive hog_started -> MeMySelfAndI ! go end,
+ Pid
+ end,
+ P1 = StartHog(),
+ %% Max on one, the other schedulers empty (hopefully)
+ %% Be generous the process can jump between schedulers
+ %% which is ok and we don't want the test to fail for wrong reasons
+ _L1 = [S1Load|EmptyScheds1] = get_load(),
+ {true,_} = {S1Load > 50,S1Load},
+ {false,_} = {lists:any(fun(Load) -> Load > 50 end, EmptyScheds1),EmptyScheds1},
+ {true,_} = {lists:sum(EmptyScheds1) < 60,EmptyScheds1},
+
+ %% 50% load
+ HalfHogs = [StartHog() || _ <- lists:seq(1, (Schedulers-1) div 2)],
+ HalfLoad = lists:sum(get_load()) div Schedulers,
+ if Schedulers < 2, HalfLoad > 80 -> ok; %% Ok only one scheduler online and one hog
+ %% We want roughly 50% load
+ HalfLoad > 40, HalfLoad < 60 -> ok;
+ true -> exit({halfload, HalfLoad})
+ end,
+
+ %% 100% load
+ LastHogs = [StartHog() || _ <- lists:seq(1, Schedulers div 2)],
+ FullScheds = get_load(),
+ {false,_} = {lists:any(fun(Load) -> Load < 80 end, FullScheds),FullScheds},
+ FullLoad = lists:sum(FullScheds) div Schedulers,
+ if FullLoad > 90 -> ok;
+ true -> exit({fullload, FullLoad})
+ end,
+
+ [exit(Pid, kill) || Pid <- [P1|HalfHogs++LastHogs]],
+ AfterLoad = get_load(),
+ {false,_} = {lists:any(fun(Load) -> Load > 5 end, AfterLoad),AfterLoad},
+ true = erlang:system_flag(scheduler_wall_time, false)
+ after
+ erlang:system_flag(scheduler_wall_time, false)
end.
-hog_iter(N) when N > 0 ->
- ?line hog_iter(N-1);
-hog_iter(0) ->
- ?line hog_iter(10000).
+get_load() ->
+ Start = erlang:statistics(scheduler_wall_time),
+ timer:sleep(500),
+ End = erlang:statistics(scheduler_wall_time),
+ lists:reverse(lists:sort(load_percentage(lists:sort(Start),lists:sort(End)))).
+
+load_percentage([{Id, WN, TN}|Ss], [{Id, WP, TP}|Ps]) ->
+ [100*(WN-WP) div (TN-TP)|load_percentage(Ss, Ps)];
+load_percentage([], []) -> [].
garbage_collection(doc) ->
diff --git a/erts/emulator/test/system_profile_SUITE.erl b/erts/emulator/test/system_profile_SUITE.erl
index 659e43f81d..ba94a371be 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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/timer_bif_SUITE.erl b/erts/emulator/test/timer_bif_SUITE.erl
index 7ff7449ff5..c9533d0748 100644
--- a/erts/emulator/test/timer_bif_SUITE.erl
+++ b/erts/emulator/test/timer_bif_SUITE.erl
@@ -71,38 +71,23 @@ end_per_group(_GroupName, Config) ->
start_timer_1(doc) -> ["Basic start_timer/3 functionality"];
start_timer_1(Config) when is_list(Config) ->
- ?line Ref1 = erlang:start_timer(1000, self(), plopp),
- ?line ok = get(1100, {timeout, Ref1, plopp}),
-
- ?line false = erlang:read_timer(Ref1),
- ?line false = erlang:cancel_timer(Ref1),
- ?line false = erlang:read_timer(Ref1),
-
- ?line Ref2 = erlang:start_timer(1000, self(), plapp),
- ?line Left2 = erlang:cancel_timer(Ref2),
- UpperLimit = case os:type() of
- vxworks ->
- %% The ticks of vxworks have a far lesser granularity
- %% than what is expected in this testcase, in
- %% fact the Left2 variable can get a little more than 1000...
- 1100;
- _ ->
- 1000
- end,
- ?line RetVal = case os:type() of
- vxworks ->
- {comment, "VxWorks behaves slightly unexpected, should be fixed,"};
- _ ->
- ok
- end,
- ?line true = (Left2 > 900) and (Left2 =< UpperLimit),
- ?line empty = get_msg(),
- ?line false = erlang:cancel_timer(Ref2),
-
- ?line Ref3 = erlang:start_timer(1000, self(), plopp),
- ?line no_message = get(900, {timeout, Ref3, plopp}),
-
- RetVal.
+ Ref1 = erlang:start_timer(1000, self(), plopp),
+ ok = get(1100, {timeout, Ref1, plopp}),
+
+ false = erlang:read_timer(Ref1),
+ false = erlang:cancel_timer(Ref1),
+ false = erlang:read_timer(Ref1),
+
+ Ref2 = erlang:start_timer(1000, self(), plapp),
+ Left2 = erlang:cancel_timer(Ref2),
+ UpperLimit = 1000,
+ true = (Left2 > 900) and (Left2 =< UpperLimit),
+ empty = get_msg(),
+ false = erlang:cancel_timer(Ref2),
+
+ Ref3 = erlang:start_timer(1000, self(), plopp),
+ no_message = get(900, {timeout, Ref3, plopp}),
+ ok.
send_after_1(doc) -> ["Basic send_after/3 functionality"];
send_after_1(Config) when is_list(Config) ->
@@ -153,19 +138,11 @@ send_after_2(Config) when is_list(Config) ->
send_after_3(doc) -> ["send_after/3: messages in the right order, worse than send_after_2"];
send_after_3(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {skipped, "VxWorks timer granularity and order is not working good, this is subject to change!"};
- _ ->
- do_send_after_3()
- end.
-
-do_send_after_3() ->
- ?line _ = erlang:send_after(100, self(), b1),
- ?line _ = erlang:send_after(101, self(), b2),
- ?line _ = erlang:send_after(102, self(), b3),
- ?line _ = erlang:send_after(103, self(), last),
- ?line [b1, b2, b3, last] = collect(last),
+ _ = erlang:send_after(100, self(), b1),
+ _ = erlang:send_after(101, self(), b2),
+ _ = erlang:send_after(102, self(), b3),
+ _ = erlang:send_after(103, self(), last),
+ [b1, b2, b3, last] = collect(last),
% This behaviour is not guaranteed:
% ?line _ = erlang:send_after(100, self(), c1),
diff --git a/erts/emulator/test/trace_local_SUITE.erl b/erts/emulator/test/trace_local_SUITE.erl
index 32e2a98e3c..1e0705fabe 100644
--- a/erts/emulator/test/trace_local_SUITE.erl
+++ b/erts/emulator/test/trace_local_SUITE.erl
@@ -70,7 +70,8 @@ config(priv_dir,_) ->
-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, bit_syntax/1,
- return/1, on_and_off/1, stack_grow/1,info/1, delete/1,
+ return/1, on_and_off/1, systematic_on_off/1,
+ stack_grow/1,info/1, delete/1,
exception/1, exception_apply/1,
exception_function/1, exception_apply_function/1,
exception_nocatch/1, exception_nocatch_apply/1,
@@ -80,6 +81,7 @@ config(priv_dir,_) ->
exception_meta_nocatch/1, exception_meta_nocatch_apply/1,
exception_meta_nocatch_function/1,
exception_meta_nocatch_apply_function/1,
+ concurrency/1,
init_per_testcase/2, end_per_testcase/2]).
init_per_testcase(_Case, Config) ->
?line Dog=test_server:timetrap(test_server:minutes(2)),
@@ -89,14 +91,23 @@ end_per_testcase(_Case, Config) ->
shutdown(),
Dog=?config(watchdog, Config),
test_server:timetrap_cancel(Dog),
- ok.
+
+ %% Reloading the module will clear all trace patterns, and
+ %% in a debug-compiled emulator run assertions of the counters
+ %% for the number of functions with breakpoints.
+
+ c:l(?MODULE).
+
+
+
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
case test_server:is_native(trace_local_SUITE) of
true -> [not_run];
false ->
- [basic, bit_syntax, return, on_and_off, stack_grow,
+ [basic, bit_syntax, return, on_and_off, systematic_on_off,
+ stack_grow,
info, delete, exception, exception_apply,
exception_function, exception_apply_function,
exception_nocatch, exception_nocatch_apply,
@@ -106,7 +117,8 @@ all() ->
exception_meta_apply_function, exception_meta_nocatch,
exception_meta_nocatch_apply,
exception_meta_nocatch_function,
- exception_meta_nocatch_apply_function]
+ exception_meta_nocatch_apply_function,
+ concurrency]
end.
groups() ->
@@ -350,7 +362,8 @@ same(A, B) ->
basic_test() ->
?line setup([call]),
- ?line erlang:trace_pattern({?MODULE,'_','_'},[],[local]),
+ NumMatches = erlang:trace_pattern({?MODULE,'_','_'},[],[local]),
+ NumMatches = erlang:trace_pattern({?MODULE,'_','_'},[],[local]),
?line erlang:trace_pattern({?MODULE,slave,'_'},false,[local]),
?line [1,1,1,1] = apply_slave(?MODULE,exported_wrap,[1]),
?line ?CT(?MODULE,exported_wrap,[1]),
@@ -572,7 +585,118 @@ on_and_off_test() ->
end,
?line ?NM,
ok.
-
+
+systematic_on_off(Config) when is_list(Config) ->
+ setup([call]),
+ Local = combinations([local,meta,call_count,call_time]),
+ [systematic_on_off_1(Flags) || Flags <- Local],
+
+ %% Make sure that we don't get any trace messages when trace
+ %% is supposed to be off.
+ receive_no_next(500).
+
+systematic_on_off_1(Local) ->
+ io:format("~p\n", [Local]),
+
+ %% Global off.
+ verify_trace_info(false, []),
+ 1 = erlang:trace_pattern({?MODULE,exported_wrap,1}, true, Local),
+ verify_trace_info(false, Local),
+ 1 = erlang:trace_pattern({?MODULE,exported_wrap,1}, false, [global]),
+ verify_trace_info(false, Local),
+ 1 = erlang:trace_pattern({?MODULE,exported_wrap,1}, false, Local),
+ verify_trace_info(false, []),
+
+ %% Global on.
+ 1 = erlang:trace_pattern({?MODULE,exported_wrap,1}, true, [global]),
+ verify_trace_info(true, []),
+ 1 = erlang:trace_pattern({?MODULE,exported_wrap,1}, false, Local),
+ verify_trace_info(true, []),
+ 1 = erlang:trace_pattern({?MODULE,exported_wrap,1}, false, [global]),
+ verify_trace_info(false, []),
+
+ %% Implicitly turn off global call trace.
+ 1 = erlang:trace_pattern({?MODULE,exported_wrap,1}, true, [global]),
+ verify_trace_info(true, []),
+ 1 = erlang:trace_pattern({?MODULE,exported_wrap,1}, true, Local),
+ verify_trace_info(false, Local),
+
+ %% Implicitly turn off local call trace.
+ 1 = erlang:trace_pattern({?MODULE,exported_wrap,1}, true, [global]),
+ verify_trace_info(true, []),
+
+ %% Turn off global call trace. Everything should be off now.
+ 1 = erlang:trace_pattern({?MODULE,exported_wrap,1}, false, [global]),
+ verify_trace_info(false, []),
+
+ ok.
+
+verify_trace_info(Global, Local) ->
+ case erlang:trace_info({?MODULE,exported_wrap,1}, all) of
+ {all,false} ->
+ false = Global,
+ [] = Local;
+ {all,Ps} ->
+ io:format("~p\n", [Ps]),
+ [verify_trace_info(P, Global, Local) || P <- Ps]
+ end,
+ global_call(Global, Local),
+ local_call(Local),
+ ok.
+
+verify_trace_info({traced,global}, true, []) -> ok;
+verify_trace_info({traced,local}, false, _) -> ok;
+verify_trace_info({match_spec,[]}, _, _) -> ok;
+verify_trace_info({meta_match_spec,[]}, _, _) -> ok;
+verify_trace_info({LocalFlag,Bool}, _, Local) when is_boolean(Bool) ->
+ try
+ Bool = lists:member(LocalFlag, Local)
+ catch
+ error:_ ->
+ io:format("Line ~p: {~p,~p}, false, ~p\n",
+ [?LINE,LocalFlag,Bool,Local]),
+ ?t:fail()
+ end;
+verify_trace_info({meta,Pid}, false, Local) when is_pid(Pid) ->
+ true = lists:member(meta, Local);
+verify_trace_info({call_time,_}, false, Local) ->
+ true = lists:member(call_time, Local);
+verify_trace_info({call_count,_}, false, Local) ->
+ true = lists:member(call_time, Local).
+
+global_call(Global, Local) ->
+ apply_slave(?MODULE, exported_wrap, [global_call]),
+ case Global of
+ false ->
+ recv_local_call(Local, [global_call]);
+ true ->
+ ?CT(?MODULE, exported_wrap, [global_call])
+ end.
+
+local_call(Local) ->
+ lambda_slave(fun() -> exported_wrap(local_call) end),
+ recv_local_call(Local, [local_call]).
+
+recv_local_call(Local, Args) ->
+ case lists:member(local, Local) of
+ false ->
+ ok;
+ true ->
+ ?CT(?MODULE, exported_wrap, Args)
+ end,
+ case lists:member(meta, Local) of
+ false ->
+ ok;
+ true ->
+ ?CTT(?MODULE, exported_wrap, Args)
+ end,
+ ok.
+
+combinations([_]=One) ->
+ [One];
+combinations([H|T]) ->
+ Cs = combinations(T),
+ [[H|C] || C <- Cs] ++ Cs.
stack_grow_test() ->
?line setup([call,return_to]),
@@ -703,16 +827,10 @@ exception_test(Opts) ->
?line ok.
exceptions() ->
- ?line Ref = make_ref(),
- ?line N = case os:type() of
- vxworks ->
- ?line 2000; % Limited memory on themachines, not actually
- % VxWorks' fault /PaN
- _ ->
- ?line 200000
- end,
- ?line LiL = seq(1, N-1, N), % Long Improper List
- ?line LL = seq(1, N, []), % Long List
+ Ref = make_ref(),
+ N = 200000,
+ LiL = seq(1, N-1, N), % Long Improper List
+ LL = seq(1, N, []), % Long List
[{{erlang,exit}, [done]},
{{erlang,error}, [1.0]},
{{erlang,error}, [Ref,[]]},
@@ -813,6 +931,42 @@ clean_location({crash,{Reason,Stk0}}) ->
{crash,{Reason,Stk}};
clean_location(Term) -> Term.
+concurrency(_Config) ->
+ N = erlang:system_info(schedulers),
+
+ %% Spawn 2*N processes that spin in a tight infinite loop,
+ %% and one process that will turn on and off local call
+ %% trace on the infinite_loop/0 function. We expect the
+ %% emulator to crash if there is a memory barrier bug or
+ %% if an aligned word-sized write is not atomic.
+
+ Ps0 = [spawn_monitor(fun() -> infinite_loop() end) ||
+ _ <- lists:seq(1, 2*N)],
+ OnAndOff = fun() -> concurrency_on_and_off() end,
+ Ps1 = [spawn_monitor(OnAndOff)|Ps0],
+ ?t:sleep(1000),
+
+ %% Now spawn off N more processes that turn on off and off
+ %% a local trace pattern.
+ Ps = [spawn_monitor(OnAndOff) || _ <- lists:seq(1, N)] ++ Ps1,
+ ?t:sleep(1000),
+
+ %% Clean up.
+ [exit(Pid, kill) || {Pid,_} <- Ps],
+ [receive
+ {'DOWN',Ref,process,Pid,killed} -> ok
+ end || {Pid,Ref} <- Ps],
+ erlang:trace_pattern({?MODULE,infinite_loop,0}, false, [local]),
+ ok.
+
+concurrency_on_and_off() ->
+ 1 = erlang:trace_pattern({?MODULE,infinite_loop,0}, true, [local]),
+ 1 = erlang:trace_pattern({?MODULE,infinite_loop,0}, false, [local]),
+ concurrency_on_and_off().
+
+infinite_loop() ->
+ infinite_loop().
+
%%% Tracee target functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
diff --git a/erts/emulator/test/trace_port_SUITE.erl b/erts/emulator/test/trace_port_SUITE.erl
index b0ce6f81db..cc2eadafbc 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -472,14 +472,9 @@ default_tracer(Config) when is_list(Config) ->
?line M = N,
ok.
-
%%% Help functions.
-huge_data() ->
- case os:type() of
- vxworks -> huge_data(4711);
- _ -> huge_data(16384)
- end.
+huge_data() -> huge_data(16384).
huge_data(0) -> [];
huge_data(N) when N rem 2 == 0 ->
P = huge_data(N div 2),
diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops
index 58c36c3bdc..8fe2402ca8 100755
--- a/erts/emulator/utils/beam_makeops
+++ b/erts/emulator/utils/beam_makeops
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2011. All Rights Reserved.
+# Copyright Ericsson AB 1998-2012. 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
@@ -28,6 +28,7 @@ my $verbose = 0;
my $hot = 1;
my $num_file_opcodes = 0;
my $wordsize = 32;
+my %defs; # Defines (from command line).
# This is shift counts and mask for the packer.
my $WHOLE_WORD = '';
@@ -96,6 +97,12 @@ my %unnumbered;
my %is_transformed;
#
+# Pre-processor.
+#
+my @if_val;
+my @if_line;
+
+#
# Code transformations.
#
my $te_max_vars = 0; # Max number of variables ever needed.
@@ -223,6 +230,7 @@ while (@ARGV && $ARGV[0] =~ /^-(.*)/) {
($outdir = shift), next if /^outdir/;
($wordsize = shift), next if /^wordsize/;
($verbose = 1), next if /^v/;
+ ($defs{$1} = $2), next if /^D(\w+)=(\w+)/;
die "$0: Bad option: -$_\n";
}
@@ -239,7 +247,43 @@ while (<>) {
}
next if /^\s*$/;
next if /^\#/;
-
+
+ #
+ # Handle %if.
+ #
+ if (/^\%if (\w+)/) {
+ my $name = $1;
+ my $val = $defs{$name};
+ defined $val or error("'$name' is undefined");
+ push @if_val, $val;
+ push @if_line, $.;
+ next;
+ } elsif (/^\%unless (\w+)/) {
+ my $name = $1;
+ my $val = $defs{$name};
+ defined $val or error("'$name' is undefined");
+ push @if_val, !$val;
+ push @if_line, $.;
+ next;
+ } elsif (/^\%else$/) {
+ unless (@if_line) {
+ error("%else without a preceding %if/%unless");
+ }
+ $if_line[$#if_line] = $.;
+ $if_val[$#if_val] = !$if_val[$#if_val];
+ next;
+ } elsif (/^\%endif$/) {
+ unless (@if_line) {
+ error("%endif without a preceding %if/%unless/%else");
+ }
+ pop @if_val;
+ pop @if_line;
+ next;
+ }
+ if (@if_val and not $if_val[$#if_val]) {
+ next;
+ }
+
#
# Handle assignments.
#
@@ -349,7 +393,13 @@ while (<>) {
$unnumbered{$name,$arity} = 1;
}
} continue {
- close(ARGV) if eof(ARGV);
+ if (eof(ARGV)) {
+ close(ARGV);
+ if (@if_line) {
+ error("Unterminated %if/%unless/%else at " .
+ "line $if_line[$#if_line]\n");
+ }
+ }
}
$num_file_opcodes = @gen_opname;
diff --git a/erts/emulator/utils/make_preload b/erts/emulator/utils/make_preload
index 13019d4062..fade9829ca 100755
--- a/erts/emulator/utils/make_preload
+++ b/erts/emulator/utils/make_preload
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -87,6 +87,7 @@ foreach $file (@ARGV) {
my $comment = '';
open(FILE, $file) or error("failed to read $file: $!");
+ binmode(FILE);
$_ = <FILE>;
$_ = beam_strip($_);
close(FILE);
diff --git a/erts/emulator/utils/make_tables b/erts/emulator/utils/make_tables
index 91efb4c023..a841f26d6a 100755
--- a/erts/emulator/utils/make_tables
+++ b/erts/emulator/utils/make_tables
@@ -167,7 +167,6 @@ typedef struct bif_entry {
extern BifEntry bif_table[];
extern Export* bif_export[];
-extern unsigned char erts_bif_trace_flags[];
#define BIF_SIZE $bif_size
@@ -197,7 +196,6 @@ includes("export.h", "sys.h", "erl_vm.h", "erl_process.h", "bif.h",
"erl_bif_table.h", "erl_atom_table.h");
print "\nExport* bif_export[BIF_SIZE];\n";
-print "unsigned char erts_bif_trace_flags[BIF_SIZE];\n\n";
print "BifEntry bif_table[] = {\n";
for ($i = 0; $i < @bif; $i++) {
diff --git a/erts/emulator/valgrind/suppress.patched.3.6.0 b/erts/emulator/valgrind/suppress.patched.3.6.0
index 8cf4cba2c8..62ba032520 100644
--- a/erts/emulator/valgrind/suppress.patched.3.6.0
+++ b/erts/emulator/valgrind/suppress.patched.3.6.0
@@ -57,18 +57,16 @@
fun:putenv
fun:erts_sys_putenv
fun:os_putenv_2
- fun:process_main
+ ...
}
{
-Leak in libc putenv
-Memcheck:Leak
-fun:malloc
-fun:erts_sys_alloc
-...
-fun:erts_alloc
-fun:erts_sys_putenv
-fun:os_putenv_2
-fun:process_main
+ Leak in libc putenv
+ Memcheck:Leak
+ ...
+ fun:erts_alloc
+ fun:erts_sys_putenv
+ fun:os_putenv_2
+ ...
}
{
erronous warning
@@ -348,3 +346,14 @@ fun:erl_start
fun:main
}
+{
+Harmless leak of ErtsThrPrgrData from async threads in exiting emulator
+Memcheck:Leak
+...
+fun:erts_alloc
+fun:erts_thr_progress_register_unmanaged_thread
+fun:async_thread_init
+fun:async_main
+...
+}
+
diff --git a/erts/emulator/valgrind/suppress.standard b/erts/emulator/valgrind/suppress.standard
index 26e34e3757..5a129bfd10 100644
--- a/erts/emulator/valgrind/suppress.standard
+++ b/erts/emulator/valgrind/suppress.standard
@@ -54,18 +54,16 @@
fun:putenv
fun:erts_sys_putenv
fun:os_putenv_2
- fun:process_main
+ ...
}
{
-Leak in libc putenv
-Memcheck:Leak
-fun:malloc
-fun:erts_sys_alloc
-...
-fun:erts_alloc
-fun:erts_sys_putenv
-fun:os_putenv_2
-fun:process_main
+ Leak in libc putenv
+ Memcheck:Leak
+ ...
+ fun:erts_alloc
+ fun:erts_sys_putenv
+ fun:os_putenv_2
+ ...
}
{
erronous warning
@@ -306,3 +304,14 @@ fun:erl_start
fun:main
}
+{
+Harmless leak of ErtsThrPrgrData from async threads in exiting emulator
+Memcheck:Leak
+...
+fun:erts_alloc
+fun:erts_thr_progress_register_unmanaged_thread
+fun:async_thread_init
+fun:async_main
+...
+}
+
diff --git a/erts/epmd/src/Makefile.in b/erts/epmd/src/Makefile.in
index 5767edc346..577fc77c13 100644
--- a/erts/epmd/src/Makefile.in
+++ b/erts/epmd/src/Makefile.in
@@ -139,8 +139,8 @@ $(ERTS_LIB):
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: all
- $(INSTALL_DIR) $(RELEASE_PATH)/erts-$(VSN)/bin
- $(INSTALL_PROGRAM) $(INSTALL_PROGS) $(RELEASE_PATH)/erts-$(VSN)/bin
+ $(INSTALL_DIR) "$(RELEASE_PATH)/erts-$(VSN)/bin"
+ $(INSTALL_PROGRAM) $(INSTALL_PROGS) "$(RELEASE_PATH)/erts-$(VSN)/bin"
release_docs_spec:
diff --git a/erts/epmd/src/epmd.c b/erts/epmd/src/epmd.c
index 2267f9b12b..3577abf6ba 100644
--- a/erts/epmd/src/epmd.c
+++ b/erts/epmd/src/epmd.c
@@ -64,7 +64,7 @@ int epmd_dbg(int level,int port) /* Utility to debug epmd... */
if(port)
{
argv[argc++] = "-port";
- sprintf(ibuff,"%d",port);
+ erts_snprintf(ibuff, sizeof(ibuff), "%d",port);
argv[argc++] = ibuff;
}
argv[argc] = NULL;
diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c
index da575affa1..36565b7438 100644
--- a/erts/epmd/src/epmd_srv.c
+++ b/erts/epmd/src/epmd_srv.c
@@ -23,6 +23,7 @@
#endif
#include "epmd.h" /* Renamed from 'epmd_r4.h' */
#include "epmd_int.h"
+#include "erl_printf.h" /* erts_snprintf */
#ifndef INADDR_NONE
# define INADDR_NONE 0xffffffff
@@ -633,7 +634,7 @@ static void do_request(g, fd, s, buf, bsize)
/* CAREFUL!!! These are parsed by "erl_epmd.erl" so a slight
change in syntax will break < OTP R3A */
- sprintf(wbuf,"name %s at port %d\n",node->symname, node->port);
+ erts_snprintf(wbuf, sizeof(wbuf), "name %s at port %d\n",node->symname, node->port);
len = strlen(wbuf);
if (reply(g, fd, wbuf, len) != len)
{
@@ -669,7 +670,7 @@ static void do_request(g, fd, s, buf, bsize)
/* CAREFUL!!! These are parsed by "erl_epmd.erl" so a slight
change in syntax will break < OTP R3A */
- sprintf(wbuf,"active name <%s> at port %d, fd = %d\n",
+ erts_snprintf(wbuf, sizeof(wbuf), "active name <%s> at port %d, fd = %d\n",
node->symname, node->port, node->fd);
len = strlen(wbuf) + 1;
if (reply(g, fd,wbuf,len) != len)
@@ -686,7 +687,7 @@ static void do_request(g, fd, s, buf, bsize)
/* CAREFUL!!! These are parsed by "erl_epmd.erl" so a slight
change in syntax will break < OTP R3A */
- sprintf(wbuf,"old/unused name <%s>, port = %d, fd = %d \n",
+ erts_snprintf(wbuf, sizeof(wbuf), "old/unused name <%s>, port = %d, fd = %d \n",
node->symname,node->port, node->fd);
len = strlen(wbuf) + 1;
if (reply(g, fd,wbuf,len) != len)
diff --git a/erts/epmd/test/Makefile b/erts/epmd/test/Makefile
index 54688fd90b..45c8be6809 100644
--- a/erts/epmd/test/Makefile
+++ b/erts/epmd/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2010. All Rights Reserved.
+# Copyright Ericsson AB 1998-2012. 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
@@ -71,10 +71,10 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec:
release_tests_spec: opt
- $(INSTALL_DIR) $(RELEPMDDIR)
+ $(INSTALL_DIR) "$(RELEPMDDIR)"
$(INSTALL_DATA) epmd.spec epmd.spec.vxworks $(ERL_FILES) \
- $(EMAKEFILE) $(RELEPMDDIR)
- chmod -R u+w $(RELEPMDDIR)
+ $(EMAKEFILE) "$(RELEPMDDIR)"
+ chmod -R u+w "$(RELEPMDDIR)"
release_docs_spec:
diff --git a/erts/epmd/test/epmd_SUITE.erl b/erts/epmd/test/epmd_SUITE.erl
index 6889ec0b34..fd9969ae2b 100644
--- a/erts/epmd/test/epmd_SUITE.erl
+++ b/erts/epmd/test/epmd_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -931,7 +931,7 @@ epmdrun(Epmd,Args0) ->
O ->
" "++O
end,
- osrun(Epmd ++ Args ++ " " ?EPMDARGS " -port " ++ integer_to_list(?PORT)).
+ osrun("\"" ++ Epmd ++ "\"" ++ Args ++ " " ?EPMDARGS " -port " ++ integer_to_list(?PORT)).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/erts/etc/common/Makefile.in b/erts/etc/common/Makefile.in
index 28c5e5ccad..ea70946346 100644
--- a/erts/etc/common/Makefile.in
+++ b/erts/etc/common/Makefile.in
@@ -33,11 +33,7 @@ else
ifeq ($(TYPE),purify)
PURIFY = purify
TYPEMARKER =
-ifeq ($(findstring ose,$(TARGET)),ose)
-TYPE_FLAGS = -g -XO -DPURIFY
-else
TYPE_FLAGS = -g -O2 -DPURIFY
-endif
else
override TYPE=opt
@@ -64,6 +60,9 @@ LD = @LD@
LIBS = @LIBS@
LDFLAGS = @LDFLAGS@
+# For clock_gettime in heart
+RTLIBS = @LIBRT@
+
ifeq ($(TARGET),win32)
ifeq ($(TYPE),debug)
CFLAGS = $(subst -O2,-g,@CFLAGS@ @DEFS@ $(TYPE_FLAGS) @WFLAGS@ -I$(SYSDIR) \
@@ -77,25 +76,15 @@ EMUDIR = $(ERL_TOP)/erts/emulator/beam
EMUOSDIR = $(ERL_TOP)/erts/emulator/@ERLANG_OSTYPE@
SYSDIR = $(ERL_TOP)/erts/emulator/sys/@ERLANG_OSTYPE@
DRVDIR = $(ERL_TOP)/erts/emulator/drivers/@ERLANG_OSTYPE@
-VXETC = ../vxworks
UXETC = ../unix
OSEETC = ../ose
WINETC = ../win32
-ifeq ($(findstring vxworks,$(TARGET)), vxworks)
-ERLEXEC = erl.exec
-else
-ifeq ($(findstring ose,$(TARGET)), ose)
-ERLEXEC =
-TAR = @TAR@
-else
ifeq ($(TARGET), win32)
ERLEXEC = erlexec.dll
else
ERLEXEC = erlexec
endif
-endif
-endif
# On windows we always need reentrant libraries.
ifeq ($(TARGET),win32)
@@ -110,42 +99,6 @@ ERTS_LIB = $(ERL_TOP)/erts/lib_src/obj/$(TARGET)/$(TYPE)/MADE
# Release directory specification
# ----------------------------------------------------
-ifeq ($(findstring vxworks,$(TARGET)), vxworks)
-INSTALL_EMBEDDED_PROGS = $(BINDIR)/erl_io $(BINDIR)/rdate $(BINDIR)/vxcall
-INSTALL_EMBEDDED_DATA = $(BINDIR)/erl_script.sam $(VXETC)/resolv.conf
-INSTALL_INCLUDES = $(VXETC)/reclaim.h
-INSTALL_TOP = $(VXETC)/README.VxWorks
-INSTALL_MISC =
-INSTALL_SRC = heart.c $(VXETC)/heart_config.h $(VXETC)/heart_config.c \
- $(VXETC)/erl.exec.c $(VXETC)/rdate.c $(VXETC)/vxcall.c \
- $(VXETC)/erl_io.c
-ERLEXECDIR = $(VXETC)
-INSTALL_LIBS = $(OBJDIR)/reclaim.o
-INSTALL_OBJS = $(OBJDIR)/heart.o
-TEXTFILES = $(BINDIR)/erl_script.sam
-ERLSRV_OBJECTS=
-MC_OUTPUTS=
-ENTRY_LDFLAGS=
-ENTRY_OBJ=
-INSTALL_PROGS = \
- $(INET_GETHOST) \
- $(BINDIR)/heart \
- $(BINDIR)/$(ERLEXEC) \
- $(INSTALL_EMBEDDED_PROGS)
-else
-ifeq ($(findstring ose,$(TARGET)), ose)
-INSTALL_TOP = $(OSEETC)/README.OSE
-INSTALL_ERL_OSE = monolith lm erl_utils drivers port_progs host
-INSTALL_SRC =
-INSTALL_LIBS =
-INSTALL_OBJS =
-INSTALL_INCLUDES =
-INSTALL_PROGS =
-ERLSRV_OBJECTS=
-MC_OUTPUTS=
-ENTRY_LDFLAGS=
-ENTRY_OBJ=
-else
ifeq ($(TARGET),win32)
CFLAGS += -I$(EMUOSDIR) -I$(WINETC)
RC=rc.sh
@@ -207,7 +160,7 @@ endif
PORT_ENTRY_POINT=erl_port_entry
ENTRY_LDFLAGS=-entry:$(PORT_ENTRY_POINT)
-else
+else # UNIX (!win32)
ENTRY_LDFLAGS=
ENTRY_OBJ=
ERLSRV_OBJECTS=
@@ -232,8 +185,6 @@ INSTALL_PROGS = \
$(BINDIR)/$(ERLEXEC) \
$(INSTALL_EMBEDDED_PROGS)
endif
-endif
-endif
.PHONY: etc
etc: $(ENTRY_OBJ) $(INSTALL_PROGS) $(INSTALL_LIBS) $(TEXTFILES) $(INSTALL_TOP_BIN)
@@ -396,56 +347,13 @@ endif
# End of windows specific targets.
#---------------------------------------------------------
-ifeq ($(findstring vxworks,$(TARGET)), vxworks)
-$(BINDIR)/heart: $(OBJDIR)/heart.o $(OBJDIR)/heart_config.o
- $(LD) $(LDFLAGS) -o $@ $(OBJDIR)/heart.o $(OBJDIR)/heart_config.o
-
-$(OBJDIR)/heart_config.o: $(VXETC)/heart_config.c
- $(CC) $(CFLAGS) -o $@ -c $(VXETC)/heart_config.c
-
-$(OBJDIR)/reclaim.o: $(VXETC)/reclaim.c
- $(CC) $(CFLAGS) -o $@ -c $(VXETC)/reclaim.c
-
-$(OBJDIR)/heart.o: heart.c
- $(CC) $(CFLAGS) -I$(VXETC) -o $@ -c heart.c
-
-$(BINDIR)/erl_script.sam: $(VXETC)/erl_script.sam.in ../../vsn.mk
- sed -e 's;%VSN%;$(VSN);' \
- $(VXETC)/erl_script.sam.in > $(BINDIR)/erl_script.sam
-else
-
$(BINDIR)/heart@EXEEXT@: $(OBJDIR)/heart.o $(ENTRY_OBJ)
$(LD) $(LDFLAGS) $(ENTRY_LDFLAGS) -o $@ $(OBJDIR)/heart.o \
- $(ENTRY_OBJ) $(WINDSOCK)
+ $(RTLIBS) $(ENTRY_OBJ) $(WINDSOCK)
$(OBJDIR)/heart.o: heart.c $(RC_GENERATED)
$(CC) $(CFLAGS) -o $@ -c heart.c
-endif
-
-
-# VxWorks specific executables and objects ...
-
-$(BINDIR)/erl_io: $(OBJDIR)/erl_io.o
- $(LD) $(LDFLAGS) -o $@ $(OBJDIR)/erl_io.o
-
-$(OBJDIR)/erl_io.o: $(VXETC)/erl_io.c
- $(CC) $(CFLAGS) -o $@ -c $(VXETC)/erl_io.c
-
-$(BINDIR)/rdate: $(OBJDIR)/rdate.o
- $(LD) $(LDFLAGS) -o $@ $(OBJDIR)/rdate.o
-
-$(OBJDIR)/rdate.o: $(VXETC)/rdate.c
- $(CC) $(CFLAGS) -o $@ -c $(VXETC)/rdate.c
-
-$(BINDIR)/vxcall: $(OBJDIR)/vxcall.o
- $(LD) $(LDFLAGS) -o $@ $(OBJDIR)/vxcall.o
-
-$(OBJDIR)/vxcall.o: $(VXETC)/vxcall.c
- $(CC) $(CFLAGS) -o $@ -c $(VXETC)/vxcall.c
-
-
-
#
# Objects & executables
#
@@ -545,48 +453,48 @@ include $(ERL_TOP)/make/otp_release_targets.mk
.PHONY: release_spec
release_spec: etc
ifneq ($(INSTALL_OBJS),)
- $(INSTALL_DIR) $(RELEASE_PATH)/erts-$(VSN)/obj
- $(INSTALL_DATA) $(INSTALL_OBJS) $(RELEASE_PATH)/erts-$(VSN)/obj
+ $(INSTALL_DIR) "$(RELEASE_PATH)/erts-$(VSN)/obj"
+ $(INSTALL_DATA) $(INSTALL_OBJS) "$(RELEASE_PATH)/erts-$(VSN)/obj"
endif
- $(INSTALL_DIR) $(RELEASE_PATH)/erts-$(VSN)/bin
+ $(INSTALL_DIR) "$(RELEASE_PATH)/erts-$(VSN)/bin"
ifneq ($(TARGET), win32)
ifneq ($(findstring vxworks,$(TARGET)), vxworks)
ifneq ($(findstring ose,$(TARGET)), ose)
- $(INSTALL_SCRIPT) erl.src $(RELEASE_PATH)/erts-$(VSN)/bin
+ $(INSTALL_SCRIPT) erl.src "$(RELEASE_PATH)/erts-$(VSN)/bin"
endif
endif
endif
ifneq ($(INSTALL_PROGS),)
- $(INSTALL_PROGRAM) $(INSTALL_PROGS) $(RELEASE_PATH)/erts-$(VSN)/bin
+ $(INSTALL_PROGRAM) $(INSTALL_PROGS) "$(RELEASE_PATH)/erts-$(VSN)/bin"
endif
ifneq ($(INSTALL_TOP),)
- $(INSTALL_SCRIPT) $(INSTALL_TOP) $(RELEASE_PATH)
+ $(INSTALL_SCRIPT) $(INSTALL_TOP) "$(RELEASE_PATH)"
endif
ifneq ($(INSTALL_TOP_BIN),)
- $(INSTALL_PROGRAM) $(INSTALL_TOP_BIN) $(RELEASE_PATH)
+ $(INSTALL_PROGRAM) $(INSTALL_TOP_BIN) "$(RELEASE_PATH)"
endif
ifneq ($(INSTALL_MISC),)
- $(INSTALL_DIR) $(RELEASE_PATH)/misc
- $(INSTALL_SCRIPT) $(INSTALL_MISC) $(RELEASE_PATH)/misc
+ $(INSTALL_DIR) "$(RELEASE_PATH)/misc"
+ $(INSTALL_SCRIPT) $(INSTALL_MISC) "$(RELEASE_PATH)/misc"
endif
ifneq ($(INSTALL_ERL_OSE),)
- $(INSTALL_DIR) $(RELEASE_PATH)/build_erl_ose
+ $(INSTALL_DIR) "$(RELEASE_PATH)/build_erl_ose"
cd $(OSEETC) && $(TAR) erl_ose_$(SYSTEM_VSN).tar $(INSTALL_ERL_OSE)
- cd $(OSEETC) && $(INSTALL_SCRIPT) erl_ose_$(SYSTEM_VSN).tar $(RELEASE_PATH)/build_erl_ose
+ cd $(OSEETC) && $(INSTALL_SCRIPT) erl_ose_$(SYSTEM_VSN).tar "$(RELEASE_PATH)/build_erl_ose"
endif
ifneq ($(INSTALL_SRC),)
- $(INSTALL_DIR) $(RELEASE_PATH)/erts-$(VSN)/src
- $(INSTALL_DATA) $(INSTALL_SRC) $(RELEASE_PATH)/erts-$(VSN)/src
+ $(INSTALL_DIR) "$(RELEASE_PATH)/erts-$(VSN)/src"
+ $(INSTALL_DATA) $(INSTALL_SRC) "$(RELEASE_PATH)/erts-$(VSN)/src"
endif
ifneq ($(INSTALL_EMBEDDED_DATA),)
- $(INSTALL_DATA) $(INSTALL_EMBEDDED_DATA) $(RELEASE_PATH)/erts-$(VSN)/bin
+ $(INSTALL_DATA) $(INSTALL_EMBEDDED_DATA) "$(RELEASE_PATH)/erts-$(VSN)/bin"
endif
ifneq ($(INSTALL_LIBS),)
- $(INSTALL_DATA) $(INSTALL_LIBS) $(RELEASE_PATH)/erts-$(VSN)/bin
+ $(INSTALL_DATA) $(INSTALL_LIBS) "$(RELEASE_PATH)/erts-$(VSN)/bin"
endif
ifneq ($(INSTALL_INCLUDES),)
- $(INSTALL_DIR) $(RELEASE_PATH)/erts-$(VSN)/include
- $(INSTALL_DATA) $(INSTALL_INCLUDES) $(RELEASE_PATH)/erts-$(VSN)/include
+ $(INSTALL_DIR) "$(RELEASE_PATH)/erts-$(VSN)/include"
+ $(INSTALL_DATA) $(INSTALL_INCLUDES) "$(RELEASE_PATH)/erts-$(VSN)/include"
endif
.PHONY: release_docs_spec
diff --git a/erts/etc/common/dialyzer.c b/erts/etc/common/dialyzer.c
index 04e9199ef3..b8a7a2bf03 100644
--- a/erts/etc/common/dialyzer.c
+++ b/erts/etc/common/dialyzer.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2006-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2012. 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
@@ -189,6 +189,18 @@ main(int argc, char** argv)
argc--, argv++;
}
+ if (argc > 2 && strcmp(argv[1], "+P") == 0) {
+ PUSH2("+P", argv[2]);
+ argc--, argv++;
+ argc--, argv++;
+ } else PUSH2("+P", "1000000");
+
+ if (argc > 2 && strcmp(argv[1], "+sbt") == 0) {
+ PUSH2("+sbt", argv[2]);
+ argc--, argv++;
+ argc--, argv++;
+ }
+
PUSH("+B");
PUSH2("-boot", "start_clean");
PUSH3("-run", "dialyzer", "plain_cl");
diff --git a/erts/etc/common/erlc.c b/erts/etc/common/erlc.c
index 23f009ff4d..f63ba3ee64 100644
--- a/erts/etc/common/erlc.c
+++ b/erts/etc/common/erlc.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1997-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2012. 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
@@ -252,13 +252,6 @@ main(int argc, char** argv)
}
}
break;
- case 'h':
- if (strcmp(argv[1], "-hybrid") == 0) {
- UNSHIFT(argv[1]);
- } else {
- usage();
- }
- break;
case 'I':
PUSH2("@i", process_opt(&argc, &argv, 0));
break;
@@ -342,7 +335,7 @@ main(int argc, char** argv)
/* Push the following options:
* o makedep_phony
*/
- buf = strsave("makedep_add_missing");
+ buf = strsave("makedep_phony");
PUSH2("@option", buf);
break;
default:
@@ -649,7 +642,6 @@ usage(void)
{"-d", "turn on debugging of erlc itself"},
{"-Dname", "define name"},
{"-Dname=value", "define name to have value"},
- {"-hybrid", "compile using hybrid-heap emulator"},
{"-help", "shows this help text"},
{"-I path", "where to search for include files"},
{"-M", "generate a rule for make(1) describing the dependencies"},
diff --git a/erts/etc/common/erlexec.c b/erts/etc/common/erlexec.c
index 19b3bb82ef..52add1c1ba 100644
--- a/erts/etc/common/erlexec.c
+++ b/erts/etc/common/erlexec.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -121,9 +121,11 @@ static char *plusM_other_switches[] = {
/* +s arguments with values */
static char *pluss_val_switches[] = {
"bt",
+ "bwt",
"cl",
"ct",
"wt",
+ "ws",
"ss",
NULL
};
@@ -157,20 +159,13 @@ static char *plusz_val_switches[] = {
#endif
#define SMP_SUFFIX ".smp"
-#define HYBRID_SUFFIX ".hybrid"
-
-#ifdef __WIN32__
#define DEBUG_SUFFIX ".debug"
-#define EMU_TYPE_SUFFIX_LENGTH (strlen(HYBRID_SUFFIX)+(strlen(DEBUG_SUFFIX)))
-#else
-/* The length of the longest memory architecture suffix. */
-#define EMU_TYPE_SUFFIX_LENGTH strlen(HYBRID_SUFFIX)
-#endif
+#define EMU_TYPE_SUFFIX_LENGTH strlen(DEBUG_SUFFIX)
+
/*
* Define flags for different memory architectures.
*/
#define EMU_TYPE_SMP 0x0001
-#define EMU_TYPE_HYBRID 0x0002
#ifdef __WIN32__
#define EMU_TYPE_DEBUG 0x0004
@@ -184,7 +179,7 @@ void error(char* format, ...);
* Local functions.
*/
-#if !defined(ERTS_HAVE_SMP_EMU) || !defined(ERTS_HAVE_HYBRID_EMU)
+#if !defined(ERTS_HAVE_SMP_EMU)
static void usage_notsup(const char *switchname);
#endif
static void usage_msg(const char *msg);
@@ -250,7 +245,9 @@ static char* config_script = NULL; /* used by option -start_erl and -config */
static HANDLE this_module_handle;
static int run_werl;
-
+static WCHAR *utf8_to_utf16(unsigned char *bytes);
+static char *utf16_to_utf8(WCHAR *wstr);
+static WCHAR *latin1_to_utf16(char *str);
#endif
/*
@@ -268,8 +265,12 @@ static void
set_env(char *key, char *value)
{
#ifdef __WIN32__
- if (!SetEnvironmentVariable((LPCTSTR) key, (LPCTSTR) value))
+ WCHAR *wkey = latin1_to_utf16(key);
+ WCHAR *wvalue = utf8_to_utf16(value);
+ if (!SetEnvironmentVariableW(wkey, wvalue))
error("SetEnvironmentVariable(\"%s\", \"%s\") failed!", key, value);
+ efree(wkey);
+ efree(wvalue);
#else
size_t size = strlen(key) + 1 + strlen(value) + 1;
char *str = emalloc(size);
@@ -282,25 +283,33 @@ set_env(char *key, char *value)
#endif
}
+
static char *
get_env(char *key)
{
#ifdef __WIN32__
DWORD size = 32;
- char *value = NULL;
+ WCHAR *value = NULL;
+ WCHAR *wkey = latin1_to_utf16(key);
+ char *res;
while (1) {
DWORD nsz;
if (value)
efree(value);
- value = emalloc(size);
+ value = emalloc(size*sizeof(WCHAR));
SetLastError(0);
- nsz = GetEnvironmentVariable((LPCTSTR) key, (LPTSTR) value, size);
+ nsz = GetEnvironmentVariableW(wkey, value, size);
if (nsz == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
efree(value);
+ efree(wkey);
return NULL;
}
- if (nsz <= size)
- return value;
+ if (nsz <= size) {
+ efree(wkey);
+ res = utf16_to_utf8(value);
+ efree(value);
+ return res;
+ }
size = nsz;
}
#else
@@ -367,9 +376,6 @@ add_extra_suffixes(char *prog, int type)
if (type == EMU_TYPE_SMP) {
p = write_str(p, SMP_SUFFIX);
}
- else if (type == EMU_TYPE_HYBRID) {
- p = write_str(p, HYBRID_SUFFIX);
- }
#ifdef __WIN32__
if (dll) {
p = write_str(p, DLL_EXT);
@@ -535,13 +541,6 @@ int main(int argc, char **argv)
emu_type_passed |= EMU_TYPE_DEBUG;
emu_type |= EMU_TYPE_DEBUG;
#endif
- } else if (strcmp(argv[i], "-hybrid") == 0) {
- emu_type_passed |= EMU_TYPE_HYBRID;
-#ifdef ERTS_HAVE_HYBRID_EMU
- emu_type |= EMU_TYPE_HYBRID;
-#else
- usage_notsup("-hybrid");
-#endif
} else if (strcmp(argv[i], "-extra") == 0) {
break;
}
@@ -552,19 +551,6 @@ int main(int argc, char **argv)
erts_cpu_info_destroy(cpuinfo);
cpuinfo = NULL;
- if ((emu_type & EMU_TYPE_HYBRID) && (emu_type & EMU_TYPE_SMP)) {
- /*
- * We have a conflict. Only using explicitly passed arguments
- * may solve it...
- */
- emu_type &= emu_type_passed;
- if ((emu_type & EMU_TYPE_HYBRID) && (emu_type & EMU_TYPE_SMP)) {
- usage_msg("Hybrid heap emulator with SMP support selected. The "
- "combination hybrid heap and SMP support is currently "
- "not supported.");
- }
- }
-
if (malloc_lib) {
if (strcmp(malloc_lib, "libc") != 0)
usage("+MYm");
@@ -1115,9 +1101,6 @@ usage_aux(void)
"]"
#endif
"] "
-#ifdef ERTS_HAVE_HYBRID_EMU
- "[-hybrid] "
-#endif
"[-make] [-man [manopts] MANPAGE] [-x] [-emu_args] "
"[-args_file FILENAME] [+A THREADS] [+a SIZE] [+B[c|d|i]] [+c] "
"[+h HEAP_SIZE_OPTION] [+K BOOLEAN] "
@@ -1135,7 +1118,7 @@ usage(const char *switchname)
usage_aux();
}
-#if !defined(ERTS_HAVE_SMP_EMU) || !defined(ERTS_HAVE_HYBRID_EMU)
+#if !defined(ERTS_HAVE_SMP_EMU)
static void
usage_notsup(const char *switchname)
{
@@ -1176,7 +1159,7 @@ start_epmd(char *epmd)
erts_snprintf(epmd_cmd, sizeof(epmd_cmd), "%s" DIRSEP "epmd", bindir);
arg1 = "-daemon";
#else
- erts_snprintf(epmd_cmd, sizeof(epmd_cmd), "%s" DIRSEP "epmd -daemon", bindir);
+ erts_snprintf(epmd_cmd, sizeof(epmd_cmd), "\"%s" DIRSEP "epmd\" -daemon", bindir);
#endif
}
#ifdef __WIN32__
@@ -2111,4 +2094,147 @@ possibly_quote(char* arg)
return narg;
}
+/*
+ * Unicode helpers to handle environment and command line parameters on
+ * Windows. We internally handle all environment variables in UTF8,
+ * but put and get the environment using the WCHAR (limited UTF16) interface
+ *
+ * These are simplified to only handle Unicode characters that can fit in
+ * Windows simplified UTF16, i.e. characters that fit in 16 bits.
+ */
+
+static int utf8_len(unsigned char first)
+{
+ if ((first & ((unsigned char) 0x80)) == 0) {
+ return 1;
+ } else if ((first & ((unsigned char) 0xE0)) == 0xC0) {
+ return 2;
+ } else if ((first & ((unsigned char) 0xF0)) == 0xE0) {
+ return 3;
+ } else if ((first & ((unsigned char) 0xF8)) == 0xF0) {
+ return 4;
+ }
+ return 1; /* will be a '?' */
+}
+
+static WCHAR *utf8_to_utf16(unsigned char *bytes)
+{
+ unsigned int unipoint;
+ unsigned char *tmp = bytes;
+ WCHAR *target, *res;
+ int num = 0;
+
+ while (*tmp) {
+ num++;
+ tmp += utf8_len(*tmp);
+ }
+ res = target = emalloc((num + 1) * sizeof(WCHAR));
+ while (*bytes) {
+ if (((*bytes) & ((unsigned char) 0x80)) == 0) {
+ unipoint = (Uint) *bytes;
+ ++bytes;
+ } else if (((*bytes) & ((unsigned char) 0xE0)) == 0xC0) {
+ unipoint =
+ (((Uint) ((*bytes) & ((unsigned char) 0x1F))) << 6) |
+ ((Uint) (bytes[1] & ((unsigned char) 0x3F)));
+ bytes += 2;
+ } else if (((*bytes) & ((unsigned char) 0xF0)) == 0xE0) {
+ unipoint =
+ (((Uint) ((*bytes) & ((unsigned char) 0xF))) << 12) |
+ (((Uint) (bytes[1] & ((unsigned char) 0x3F))) << 6) |
+ ((Uint) (bytes[2] & ((unsigned char) 0x3F)));
+ if (unipoint > 0xFFFF) {
+ unipoint = (unsigned int) '?';
+ }
+ bytes +=3;
+ } else if (((*bytes) & ((unsigned char) 0xF8)) == 0xF0) {
+ unipoint = (unsigned int) '?'; /* Cannot put in a wchar */
+ bytes += 4;
+ } else {
+ unipoint = (unsigned int) '?';
+ }
+ *target++ = (WCHAR) unipoint;
+ }
+ *target = L'\0';
+ return res;
+}
+
+static int put_utf8(WCHAR ch, unsigned char *target, int sz, int *pos)
+{
+ Uint x = (Uint) ch;
+ if (x < 0x80) {
+ if (*pos >= sz) {
+ return -1;
+ }
+ target[(*pos)++] = (unsigned char) x;
+ }
+ else if (x < 0x800) {
+ if (((*pos) + 1) >= sz) {
+ return -1;
+ }
+ target[(*pos)++] = (((unsigned char) (x >> 6)) |
+ ((unsigned char) 0xC0));
+ target[(*pos)++] = (((unsigned char) (x & 0x3F)) |
+ ((unsigned char) 0x80));
+ } else {
+ if ((x >= 0xD800 && x <= 0xDFFF) ||
+ (x == 0xFFFE) ||
+ (x == 0xFFFF)) { /* Invalid unicode range */
+ return -1;
+ }
+ if (((*pos) + 2) >= sz) {
+ return -1;
+ }
+
+ target[(*pos)++] = (((unsigned char) (x >> 12)) |
+ ((unsigned char) 0xE0));
+ target[(*pos)++] = ((((unsigned char) (x >> 6)) & 0x3F) |
+ ((unsigned char) 0x80));
+ target[(*pos)++] = (((unsigned char) (x & 0x3F)) |
+ ((unsigned char) 0x80));
+ }
+ return 0;
+}
+
+static int need_bytes_for_utf8(WCHAR x)
+{
+ if (x < 0x80)
+ return 1;
+ else if (x < 0x800)
+ return 2;
+ else
+ return 3;
+}
+
+static WCHAR *latin1_to_utf16(char *str)
+{
+ int len = strlen(str);
+ int i;
+ WCHAR *wstr = emalloc((len+1) * sizeof(WCHAR));
+ for(i=0;i<len;++i)
+ wstr[i] = (WCHAR) str[i];
+ wstr[len] = L'\0';
+ return wstr;
+}
+
+static char *utf16_to_utf8(WCHAR *wstr)
+{
+ int len = wcslen(wstr);
+ char *result;
+ int i,pos;
+ int reslen = 0;
+ for(i=0;i<len;++i) {
+ reslen += need_bytes_for_utf8(wstr[i]);
+ }
+ result = emalloc(reslen+1);
+ pos = 0;
+ for(i=0;i<len;++i) {
+ if (put_utf8((int) wstr[i], result, reslen, &pos) < 0) {
+ break;
+ }
+ }
+ result[pos] = '\0';
+ return result;
+}
+
#endif
diff --git a/erts/etc/common/escript.c b/erts/etc/common/escript.c
index 6ed79c91e3..9e80ec6656 100644
--- a/erts/etc/common/escript.c
+++ b/erts/etc/common/escript.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2007-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2007-2012. 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
@@ -377,7 +377,8 @@ main(int argc, char** argv)
last_opt = argv;
#ifdef __WIN32__
- if (_stricmp(basename, "escript.exe") == 0) {
+ if ( (_stricmp(basename, "escript.exe") == 0)
+ ||(_stricmp(basename, "escript") == 0)) {
#else
if (strcmp(basename, "escript") == 0) {
#endif
diff --git a/erts/etc/common/heart.c b/erts/etc/common/heart.c
index fae4d870cc..7b78cc489d 100644
--- a/erts/etc/common/heart.c
+++ b/erts/etc/common/heart.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -66,8 +66,7 @@
* input and output file descriptors (0 and 1). These descriptors
* (and the standard error descriptor 2) must NOT be closed
* explicitely by this program at termination (in UNIX it is
- * taken care of by the operating system itself; in VxWorks
- * it is taken care of by the spawn driver part of the Emulator).
+ * taken care of by the operating system itself).
*
* END OF FILE
*
@@ -75,12 +74,6 @@
* that there is no process at the other end of the connection
* having the connection open for writing (end-of-file).
*
- * HARDWARE WATCHDOG
- *
- * When used with VxWorks(with CPU40), the hardware
- * watchdog is enabled, making sure that the system reboots
- * even if the heart port program malfunctions or the system
- * is completely overloaded.
*/
#ifdef HAVE_CONFIG_H
@@ -93,18 +86,12 @@
#include <fcntl.h>
#include <process.h>
#endif
-#ifdef VXWORKS
-#include "sys.h"
-#endif
/*
* Implement time correction using times() call even on Linuxes
* that can simulate gethrtime with clock_gettime, no use implementing
* a phony gethrtime in this file as the time questions are so infrequent.
*/
-#if defined(CORRET_USING_TIMES) || defined(GETHRTIME_WITH_CLOCK_GETTIME)
-# define HEART_CORRECT_USING_TIMES 1
-#endif
#include <stdio.h>
#include <stddef.h>
@@ -116,25 +103,13 @@
#include <time.h>
#include <errno.h>
-#ifdef VXWORKS
-# include <vxWorks.h>
-# include <ioLib.h>
-# include <selectLib.h>
-# include <netinet/in.h>
-# include <rebootLib.h>
-# include <sysLib.h>
-# include <taskLib.h>
-# include <wdLib.h>
-# include <taskHookLib.h>
-# include <selectLib.h>
-#endif
-#if !defined(__WIN32__) && !defined(VXWORKS)
+#if !defined(__WIN32__)
# include <sys/types.h>
# include <netinet/in.h>
# include <sys/time.h>
# include <unistd.h>
# include <signal.h>
-# if defined(HEART_CORRECT_USING_TIMES)
+# if defined(CORRECT_USING_TIMES)
# include <sys/times.h>
# include <limits.h>
# endif
@@ -447,7 +422,8 @@ message_loop(erlin_fd, erlout_fd)
*/
timestamp(&now);
if (now > last_received + heart_beat_timeout) {
- print_error("heart-beat time-out.");
+ print_error("heart-beat time-out, no activity for %lu seconds",
+ (unsigned long) (now - last_received));
return R_TIMEOUT;
}
/*
@@ -550,8 +526,7 @@ kill_old_erlang(void){
CloseHandle(erlh);
}
}
-#elif !defined(VXWORKS)
-/* Unix eh? */
+#else
static void
kill_old_erlang(void){
pid_t pid;
@@ -570,7 +545,7 @@ kill_old_erlang(void){
}
}
}
-#endif /* Not on VxWorks */
+#endif
#ifdef __WIN32__
void win_system(char *command)
@@ -653,7 +628,7 @@ do_terminate(reason)
case R_ERROR:
case R_CLOSED:
default:
-#if defined(__WIN32__) /* Not VxWorks */
+#if defined(__WIN32__)
{
if(!cmd[0]) {
char *command = get_env(HEART_COMMAND_ENV);
@@ -1026,60 +1001,30 @@ time_t timestamp(time_t *res)
return r;
}
-#elif defined(VXWORKS)
-
-static WDOG_ID watchdog_id;
-static volatile unsigned elapsed;
-static WIND_TCB *this_task;
-/* A simple variable is enough to lock the time update, as the
- watchdog is run at interrupt level and never preempted. */
-static volatile int lock_time;
-
-static void my_delete_hook(WIND_TCB *tcb)
-{
- if (tcb == this_task) {
- wdDelete(watchdog_id);
- watchdog_id = NULL;
- taskDeleteHookDelete((FUNCPTR) &my_delete_hook);
- }
-}
+#elif defined(HAVE_GETHRTIME) || defined(GETHRTIME_WITH_CLOCK_GETTIME)
-static void my_wd_routine(int count)
-{
- if (watchdog_id != NULL) {
- ++count;
- if (!lock_time) {
- elapsed += count;
- count = 0;
- }
- wdStart(watchdog_id, sysClkRateGet(),
- (FUNCPTR) &my_wd_routine, count);
- }
-}
+#if defined(GETHRTIME_WITH_CLOCK_GETTIME)
+typedef long long SysHrTime;
-void init_timestamp(void)
-{
- lock_time = 0;
- elapsed = 0;
- watchdog_id = wdCreate();
- this_task = (WIND_TCB *) taskIdSelf();
- taskDeleteHookAdd((FUNCPTR) &my_delete_hook);
- wdStart(watchdog_id, sysClkRateGet(),
- (FUNCPTR) &my_wd_routine, 0);
-}
+SysHrTime sys_gethrtime(void);
-time_t timestamp(time_t *res)
+SysHrTime sys_gethrtime(void)
{
- time_t r;
- ++lock_time;
- r = (time_t) elapsed;
- --lock_time;
- if (res != NULL)
- *res = r;
- return r;
+ struct timespec ts;
+ long long result;
+ if (clock_gettime(CLOCK_MONOTONIC,&ts) != 0) {
+ print_error("Fatal, could not get clock_monotonic value, terminating! "
+ "errno = %d\n", errno);
+ exit(1);
+ }
+ result = ((long long) ts.tv_sec) * 1000000000LL +
+ ((long long) ts.tv_nsec);
+ return (SysHrTime) result;
}
-
-#elif defined(HAVE_GETHRTIME)
+#else
+typedef hrtime_t SysHrTime;
+#define sys_gethrtime() gethrtime()
+#endif
void init_timestamp(void)
{
@@ -1087,14 +1032,14 @@ void init_timestamp(void)
time_t timestamp(time_t *res)
{
- hrtime_t ht = gethrtime();
+ SysHrTime ht = sys_gethrtime();
time_t r = (time_t) (ht / 1000000000);
if (res != NULL)
*res = r;
return r;
}
-#elif defined(HEART_CORRECT_USING_TIMES)
+#elif defined(CORRECT_USING_TIMES)
# ifdef NO_SYSCONF
# include <sys/param.h>
diff --git a/erts/etc/common/inet_gethost.c b/erts/etc/common/inet_gethost.c
index d25d2910b4..b9a0e6bde3 100644
--- a/erts/etc/common/inet_gethost.c
+++ b/erts/etc/common/inet_gethost.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2012. 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
@@ -2522,7 +2522,7 @@ static char *format_address(int siz, AddrByte *addr)
*buff='\0';
if (siz <= 4) {
while(siz--) {
- sprintf(tmp,"%d",(int) *addr++);
+ erts_snprintf(tmp, sizeof(tmp), "%d",(int) *addr++);
strcat(buff,tmp);
if(siz) {
strcat(buff,".");
@@ -2531,7 +2531,7 @@ static char *format_address(int siz, AddrByte *addr)
return buff;
}
while(siz--) {
- sprintf(tmp,"%02x",(int) *addr++);
+ erts_snprintf(tmp, sizeof(tmp), "%02x",(int) *addr++);
strcat(buff,tmp);
if(siz) {
strcat(buff,":");
@@ -2548,9 +2548,9 @@ static void debugf(char *format, ...)
va_start(ap,format);
#ifdef WIN32
- sprintf(buff,"%s[%d] (DEBUG):",program_name,(int) GetCurrentThreadId());
+ erts_snprintf(buff, sizeof(buff), "%s[%d] (DEBUG):",program_name,(int) GetCurrentThreadId());
#else
- sprintf(buff,"%s[%d] (DEBUG):",program_name,(int) getpid());
+ erts_snprintf(buff, sizeof(buff), "%s[%d] (DEBUG):",program_name,(int) getpid());
#endif
ptr = buff + strlen(buff);
erts_vsnprintf(ptr,sizeof(buff)-strlen(buff)-2,format,ap);
@@ -2574,7 +2574,7 @@ static void warning(char *format, ...)
va_list ap;
va_start(ap,format);
- sprintf(buff,"%s[%d]: WARNING:",program_name, (int) getpid());
+ erts_snprintf(buff, sizeof(buff), "%s[%d]: WARNING:",program_name, (int) getpid());
ptr = buff + strlen(buff);
erts_vsnprintf(ptr,sizeof(buff)-strlen(buff)-2,format,ap);
strcat(ptr,"\r\n");
@@ -2597,7 +2597,7 @@ static void fatal(char *format, ...)
va_list ap;
va_start(ap,format);
- sprintf(buff,"%s[%d]: FATAL ERROR:",program_name, (int) getpid());
+ erts_snprintf(buff, sizeof(buff), "%s[%d]: FATAL ERROR:",program_name, (int) getpid());
ptr = buff + strlen(buff);
erts_vsnprintf(ptr,sizeof(buff)-strlen(buff)-2,format,ap);
strcat(ptr,"\r\n");
diff --git a/erts/etc/unix/Install.src b/erts/etc/unix/Install.src
index 8f40c43874..2dcd070a6d 100644
--- a/erts/etc/unix/Install.src
+++ b/erts/etc/unix/Install.src
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2010. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -66,12 +66,12 @@ then
exit 1
fi
-if [ ! -d $ERL_ROOT/bin ]
+if [ ! -d "$ERL_ROOT/bin" ]
then
- mkdir $ERL_ROOT/bin
+ mkdir "$ERL_ROOT/bin"
fi
-cd $ERL_ROOT/erts-%I_VSN%/bin
+cd "$ERL_ROOT/erts-%I_VSN%/bin"
sed -e "s;%FINAL_ROOTDIR%;$TARGET_ERL_ROOT;" erl.src > erl
chmod 755 erl
@@ -79,18 +79,18 @@ chmod 755 erl
#
# Create start file for embedded system use,
#
-(cd $ERL_ROOT/erts-%I_VSN%/bin;
+(cd "$ERL_ROOT/erts-%I_VSN%/bin";
sed -e "s;%FINAL_ROOTDIR%;$TARGET_ERL_ROOT;" start.src > start;
chmod 755 start)
-cd $ERL_ROOT/bin
+cd "$ERL_ROOT/bin"
-cp -p $ERL_ROOT/erts-%I_VSN%/bin/erl .
-cp -p $ERL_ROOT/erts-%I_VSN%/bin/erlc .
-cp -p $ERL_ROOT/erts-%I_VSN%/bin/dialyzer .
-cp -p $ERL_ROOT/erts-%I_VSN%/bin/typer .
-cp -p $ERL_ROOT/erts-%I_VSN%/bin/ct_run .
-cp -p $ERL_ROOT/erts-%I_VSN%/bin/escript .
+cp -p "$ERL_ROOT/erts-%I_VSN%/bin/erl" .
+cp -p "$ERL_ROOT/erts-%I_VSN%/bin/erlc" .
+cp -p "$ERL_ROOT/erts-%I_VSN%/bin/dialyzer" .
+cp -p "$ERL_ROOT/erts-%I_VSN%/bin/typer" .
+cp -p "$ERL_ROOT/erts-%I_VSN%/bin/ct_run" .
+cp -p "$ERL_ROOT/erts-%I_VSN%/bin/escript" .
# Remove in R16B
ln -s ct_run run_test
@@ -107,15 +107,15 @@ fi
ln -s ../erts-%I_VSN%/bin/epmd epmd
-cp -p $ERL_ROOT/erts-%I_VSN%/bin/run_erl .
-cp -p $ERL_ROOT/erts-%I_VSN%/bin/to_erl .
-cp -p $ERL_ROOT/erts-%I_VSN%/bin/start .
-sed -e "s;%EMU%;%EMULATOR%%EMULATOR_NUMBER%;" $ERL_ROOT/erts-%I_VSN%/bin/start_erl.src > start_erl
+cp -p "$ERL_ROOT/erts-%I_VSN%/bin/run_erl" .
+cp -p "$ERL_ROOT/erts-%I_VSN%/bin/to_erl" .
+cp -p "$ERL_ROOT/erts-%I_VSN%/bin/start" .
+sed -e "s;%EMU%;%EMULATOR%%EMULATOR_NUMBER%;" "$ERL_ROOT/erts-%I_VSN%/bin/start_erl.src" > start_erl
chmod 755 start_erl
echo ""
-echo %I_VSN% %I_SYSTEM_VSN% > $ERL_ROOT/releases/start_erl.data
-sed -e "s;%ERL_ROOT%;$TARGET_ERL_ROOT;" $ERL_ROOT/releases/RELEASES.src > $ERL_ROOT/releases/RELEASES
+echo %I_VSN% %I_SYSTEM_VSN% > "$ERL_ROOT/releases/start_erl.data"
+sed -e "s;%ERL_ROOT%;$TARGET_ERL_ROOT;" "$ERL_ROOT/releases/RELEASES.src" > "$ERL_ROOT/releases/RELEASES"
if [ "$start_option" = "query" ]
then
@@ -147,10 +147,10 @@ cp -p ../releases/%I_SYSTEM_VSN%/$Name.script start.script
# Fixing the man pages
#
-if [ -d $ERL_ROOT/man ]
+if [ -d "$ERL_ROOT/man" ]
then
- cd $ERL_ROOT
- ./misc/format_man_pages $ERL_ROOT
+ cd "$ERL_ROOT"
+ ./misc/format_man_pages "$ERL_ROOT"
fi
exit 0
diff --git a/erts/etc/unix/cerl.src b/erts/etc/unix/cerl.src
index 0b2d6512ea..e0d7404de7 100644
--- a/erts/etc/unix/cerl.src
+++ b/erts/etc/unix/cerl.src
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2011. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -227,7 +227,7 @@ done
PATH=$BINDIR:$ROOTDIR/bin:$PATH
EXEC=$BINDIR/erlexec
-PROGNAME="$PROGNAME $cargs"
+PROGNAME="$PROGNAME$cargs"
EMU="$EMU$TYPE"
EMU_NAME=`$EXEC -emu_name_exit $eeargs`
@@ -302,7 +302,7 @@ else
# Set annotation level for gdb in emacs 22 and higher.
emacs_major=`$EMACS --version | head -1 | sed 's,^[^0-9]*\([0-9]*\).*,\1,g'`
if [ '!' -z "$emacs_major" -a $emacs_major -gt 21 ]; then
- GDBARGS="--annotate=3 "
+ GDBARGS="--annotate=1 "
fi
gdbcmd="$gdbcmd $GDBBP \
(insert-string \"source $ROOTDIR/erts/etc/unix/etp-commands\") \
diff --git a/erts/etc/unix/erl.src.src b/erts/etc/unix/erl.src.src
index 50603f12f4..ce5d2b5def 100644
--- a/erts/etc/unix/erl.src.src
+++ b/erts/etc/unix/erl.src.src
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -17,7 +17,7 @@
#
# %CopyrightEnd%
#
-ROOTDIR=%FINAL_ROOTDIR%
+ROOTDIR="%FINAL_ROOTDIR%"
BINDIR=$ROOTDIR/erts-%VSN%/bin
EMU=%EMULATOR%%EMULATOR_NUMBER%
PROGNAME=`echo $0 | sed 's/.*\///'`
@@ -25,4 +25,4 @@ export EMU
export ROOTDIR
export BINDIR
export PROGNAME
-exec $BINDIR/erlexec ${1+"$@"}
+exec "$BINDIR/erlexec" ${1+"$@"}
diff --git a/erts/etc/unix/etp-commands b/erts/etc/unix/etp-commands
index 6a01e0b7e0..d98505c0ff 100644
--- a/erts/etc/unix/etp-commands
+++ b/erts/etc/unix/etp-commands
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2009. All Rights Reserved.
+# Copyright Ericsson AB 2005-2012. 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
@@ -1022,16 +1022,17 @@ define etp-cp-1
# Non-reentrant
#
set $etp_cp = (Eterm)($arg0)
- set $etp_cp_low = modules
- set $etp_cp_high = $etp_cp_low + num_loaded_modules
- set $etp_cp_mid = mid_module
+ set $etp_ranges = &r[(int)the_active_code_index]
+ set $etp_cp_low = $etp_ranges->modules
+ set $etp_cp_high = $etp_cp_low + $etp_ranges->n
+ set $etp_cp_mid = (Range*)$etp_ranges->mid
set $etp_cp_p = 0
#
while $etp_cp_low < $etp_cp_high
if $etp_cp < $etp_cp_mid->start
set $etp_cp_high = $etp_cp_mid
else
- if $etp_cp > $etp_cp_mid->end
+ if $etp_cp > (BeamInstr*)$etp_cp_mid->end
set $etp_cp_low = $etp_cp_mid + 1
else
set $etp_cp_p = $etp_cp_low = $etp_cp_high = $etp_cp_mid
@@ -1263,7 +1264,684 @@ document etpf-stackdump
%---------------------------------------------------------------------------
end
+define etp-pix2proc
+# Args: Eterm
+#
+ set $proc = (Process *) *((UWord *) &erts_proc.tab[((int) $arg0)])
+ printf "(Process *) %p\n", $proc
+end
+
+define etp-pid2proc-1
+# Args: Eterm
+#
+ set $pix = (int) ($arg0 >> 4)
+
+ if (erts_proc.pix_cl_mask != 0)
+ set $proc = (Process *) *((UWord *) &erts_proc.tab[(((($pix) & erts_proc.pix_cl_mask) << erts_proc.pix_cl_shift) + ((($pix) >> erts_proc.pix_cli_shift) & erts_proc.pix_cli_mask))])
+ else
+ set $proc =(Process *) *((UWord *) &erts_proc.tab[((($pix) % erts_proc.max) % erts_proc.tab_cache_lines + (($pix) % erts_proc.max) / erts_proc.tab_cache_lines)])
+ end
+end
+
+define etp-pid2proc
+# Args: Eterm
+#
+ etp-pid2proc-1 $arg0
+ printf "(Process *) %p\n", $proc
+end
+
+define etp-proc-state-int
+# Args: int
+#
+ if ($arg0 & 0xfffff000)
+ printf "GARBAGE | "
+ end
+ if ($arg0 & 0x800)
+ printf "trapping-exit | "
+ end
+ if ($arg0 & 0x400)
+ printf "bound | "
+ end
+ if ($arg0 & 0x200)
+ printf "garbage-collecting | "
+ end
+ if ($arg0 & 0x100)
+ printf "suspended | "
+ end
+ if ($arg0 & 0x80)
+ printf "running | "
+ end
+ if ($arg0 & 0x40)
+ printf "in-run-queue | "
+ end
+ if ($arg0 & 0x20)
+ printf "active | "
+ end
+ if ($arg0 & 0x10)
+ printf "pending-exit | "
+ end
+ if ($arg0 & 0x8)
+ printf "exiting | "
+ end
+ if ($arg0 & 0x4)
+ printf "free | "
+ end
+ if ($arg0 & 0x3) == 0
+ printf "prio-max\n"
+ else
+ if ($arg0 & 0x3) == 1
+ printf "prio-high\n"
+ else
+ if ($arg0 & 0x3) == 2
+ printf "prio-normal\n"
+ else
+ printf "prio-low\n"
+ end
+ end
+ end
+end
+
+document etp-proc-state-int
+%---------------------------------------------------------------------------
+% etp-proc-state-int int
+%
+% Print state of process state value
+%---------------------------------------------------------------------------
+end
+
+define etp-proc-state
+# Args: Process*
+#
+ set $state_int = *(((Uint32 *) &(((Process *) $arg0)->state)))
+ etp-proc-state-int $state_int
+end
+
+document etp-proc-state
+%---------------------------------------------------------------------------
+% etp-proc-state Process*
+%
+% Print state of process
+%---------------------------------------------------------------------------
+end
+
+define etp-process-info
+# Args: Process*
+#
+ printf " Pid: "
+ etp-1 $arg0->id
+ printf "\n State: "
+ etp-proc-state $arg0
+ if ($arg0->reg)
+ printf " Registered name: "
+ etp-1 $arg0->reg->name
+ printf "\n"
+ end
+ if ($arg0->current)
+ printf " Current function: "
+ etp-1 $arg0->current[0]
+ printf ":"
+ etp-1 $arg0->current[1]
+ printf "/%d\n", $arg0->current[2]
+ end
+ if ($arg0->cp)
+ printf " CP: "
+ etp-cp-1 $arg0->cp
+ printf "\n"
+ end
+ if ($arg0->i)
+ printf " I: "
+ etp-cp-1 $arg0->i
+ printf "\n"
+ end
+ printf " Heap size: %ld\n", $arg0->heap_sz
+ if ($arg0->old_heap)
+ printf " Old-heap size: %ld\n", $arg0->old_hend - $arg0->old_heap
+ end
+ printf " Mbuf size: %ld\n", $arg0->mbuf_sz
+ if (etp_smp_compiled)
+ printf " Msgq len: %ld (inner=%ld, outer=%ld)\n", ($arg0->msg.len + $arg0->u.alive.msg_inq.len), $arg0->msg.len, $arg0->u.alive.msg_inq.len
+ else
+ printf " Msgq len: %d\n", $arg0->msg.len
+ end
+ printf " Parent: "
+ etp-1 $arg0->parent
+ printf "\n Pointer: (Process *) %p\n", $arg0
+end
+
+document etp-process-info
+%---------------------------------------------------------------------------
+% etp-process-info Process*
+%
+% Print info about process
+%---------------------------------------------------------------------------
+end
+
+define etp-processes
+ if (!erts_initialized)
+ printf "No processes, since system isn't initialized!\n"
+ else
+ set $proc_ix = 0
+ while $proc_ix < erts_proc.max
+ set $proc = (Process *) *((UWord *) &erts_proc.tab[$proc_ix])
+ if ($proc != (Process *) 0)
+ printf "---\n"
+ printf " Pix: %d\n", $proc_ix
+ etp-process-info $proc
+ end
+ set $proc_ix++
+ end
+ printf "---\n",
+ end
+end
+
+document etp-processes
+%---------------------------------------------------------------------------
+% etp-processes
+%
+% Print misc info about all processes
+%---------------------------------------------------------------------------
+end
+
+
+define etp-port-status-int
+# Args: int
+#
+ if ($arg0 & 0x1)
+ printf " connected"
+ end
+ if ($arg0 & 0x2)
+ printf " exiting"
+ end
+ if ($arg0 & 0x4)
+ printf " distribution"
+ end
+ if ($arg0 & 0x8)
+ printf " binary-io"
+ end
+ if ($arg0 & 0x10)
+ printf " soft-eof"
+ end
+ if ($arg0 & 0x20)
+ printf " port-busy"
+ end
+ if ($arg0 & 0x40)
+ printf " closing"
+ end
+ if ($arg0 & 0x80)
+ printf " send-closed"
+ end
+ if ($arg0 & 0x100)
+ printf " linebuf-io"
+ end
+ if ($arg0 & 0x200)
+ printf " immortal"
+ end
+ if ($arg0 & 0x400)
+ printf " free"
+ end
+ if ($arg0 & 0x800)
+ printf " free-scheduled"
+ end
+ if ($arg0 & 0x1000)
+ printf " initializing"
+ end
+ if ($arg0 & 0x2000)
+ printf " port-specific-lock"
+ end
+ if ($arg0 & 0x4000)
+ printf " invalid"
+ end
+ if (etp_debug_compiled)
+ if ($arg0 & 0x7fff8000)
+ printf " GARBAGE"
+ end
+ else
+ if ($arg0 & 0xffff8000)
+ printf " GARBAGE"
+ end
+ end
+ printf "\n"
+end
+
+document etp-port-status-int
+%---------------------------------------------------------------------------
+% etp-proc-state-int int
+%
+% Print port status
+%---------------------------------------------------------------------------
+end
+
+
+define etp-port-status
+# Args: Port*
+#
+ set $status_int = *(((Uint32 *) &(((Port *) $arg0)->status)))
+ etp-port-status-int $status_int
+end
+
+document etp-port-status
+%---------------------------------------------------------------------------
+% etp-proc-state-int Port *
+%
+% Print port status
+%---------------------------------------------------------------------------
+end
+
+define etp-port-info
+# Args: Port*
+#
+ printf " Port: "
+ etp-1 $arg0->id
+ printf "\n Name: %s\n", $arg0->name
+ printf " Status:"
+ etp-port-status $arg0
+ if ($arg0->reg)
+ printf " Registered name: "
+ etp-1 $arg0->reg->name
+ printf "\n"
+ end
+ printf " Connected: "
+ etp-1 $arg0->connected
+ printf "\n Pointer: (Port *) %p\n", $arg0
+end
+
+document etp-port-info
+%---------------------------------------------------------------------------
+% etp-port-info Port*
+%
+% Print info about port
+%---------------------------------------------------------------------------
+end
+
+
+define etp-ports
+ if (!erts_initialized)
+ printf "No ports, since system isn't initialized!\n"
+ else
+ set $port_ix = 0
+ while $port_ix < erts_max_ports
+ set $port = &erts_port[$port_ix]
+ if ($port->status & 0x400) == 0
+ # I.e, not free
+ printf "---\n"
+ printf " Pix: %d\n", $port_ix
+ etp-port-info $port
+ end
+ set $port_ix++
+ end
+ printf "---\n",
+ end
+end
+
+document etp-ports
+%---------------------------------------------------------------------------
+% etp-ports
+%
+% Print misc info about all ports
+%---------------------------------------------------------------------------
+end
+
+define etp-rq-flags-int
+# Args: int
+#
+ if ($arg0 & 0x1f)
+ printf " Queue Mask:"
+ if ($arg0 & 0x1)
+ printf " max"
+ end
+ if ($arg0 & 0x2)
+ printf " high"
+ end
+ if ($arg0 & 0x4)
+ printf " normal"
+ end
+ if ($arg0 & 0x8)
+ printf " low"
+ end
+ if ($arg0 & 0x10)
+ printf " ports"
+ end
+ printf "\n"
+ end
+
+ if ($arg0 & 0x3fe0)
+ printf " Emigrate Mask:"
+ if ($arg0 & 0x20)
+ printf " max"
+ end
+ if ($arg0 & 0x40)
+ printf " high"
+ end
+ if ($arg0 & 0x80)
+ printf " normal"
+ end
+ if ($arg0 & 0x100)
+ printf " low"
+ end
+ if ($arg0 & 0x200)
+ printf " ports"
+ end
+ printf "\n"
+ end
+
+ if ($arg0 & 0x7fc00)
+ printf " Immigrate Mask:"
+ if ($arg0 & 0x400)
+ printf " max"
+ end
+ if ($arg0 & 0x800)
+ printf " high"
+ end
+ if ($arg0 & 0x1000)
+ printf " normal"
+ end
+ if ($arg0 & 0x2000)
+ printf " low"
+ end
+ if ($arg0 & 0x4000)
+ printf " ports"
+ end
+ printf "\n"
+ end
+
+ if ($arg0 & 0xf8000)
+ printf " Evaquate Mask:"
+ if ($arg0 & 0x8000)
+ printf " max"
+ end
+ if ($arg0 & 0x10000)
+ printf " high"
+ end
+ if ($arg0 & 0x20000)
+ printf " normal"
+ end
+ if ($arg0 & 0x40000)
+ printf " low"
+ end
+ if ($arg0 & 0x80000)
+ printf " ports"
+ end
+ printf "\n"
+ end
+
+ if ($arg0 & ~0xfffff)
+ printf " Misc Flags:"
+ if ($arg0 & 0x100000)
+ printf " out-of-work"
+ end
+ if ($arg0 & 0x200000)
+ printf " halftime-out-of-work"
+ end
+ if ($arg0 & 0x400000)
+ printf " suspended"
+ end
+ if ($arg0 & 0x800000)
+ printf " check-cpu-bind"
+ end
+ if ($arg0 & 0x1000000)
+ printf " inactive"
+ end
+ if ($arg0 & 0x2000000)
+ printf " non-empty"
+ end
+ if ($arg0 & 0x4000000)
+ printf " protected"
+ end
+ if ($arg0 & ~0x7ffffff)
+ printf " GARBAGE(0x%x)", ($arg0 & ~0x3ffffff)
+ end
+ printf "\n"
+ end
+end
+
+document etp-rq-flags-int
+%---------------------------------------------------------------------------
+% etp-rq-flags-int
+%
+% Print run queue flags
+%---------------------------------------------------------------------------
+end
+
+define etp-ssi-flags
+# Args: int
+#
+ if ($arg0 & 0x1)
+ printf " sleeping"
+ end
+ if ($arg0 & 0x2)
+ printf " poll"
+ end
+ if ($arg0 & 0x4)
+ printf " tse"
+ end
+ if ($arg0 & 0x8)
+ printf " waiting"
+ end
+ if ($arg0 & 0x10)
+ printf " suspended"
+ end
+ printf "\n"
+end
+
+document etp-ssi-flags
+%---------------------------------------------------------------------------
+% etp-ssi-flags
+% Arg int
+%
+% Print aux work flags
+%---------------------------------------------------------------------------
+end
+
+define etp-aux-work-flags
+# Args: int
+#
+ if ($arg0 & 0x1)
+ printf " delayed-dealloc"
+ end
+ if ($arg0 & 0x2)
+ printf " delayed-dealloc-thr-prgr"
+ end
+ if ($arg0 & 0x4)
+ printf " fix-alloc-dealloc"
+ end
+ if ($arg0 & 0x8)
+ printf " fix-alloc-lower-lim"
+ end
+ if ($arg0 & 0x10)
+ printf " async-ready"
+ end
+ if ($arg0 & 0x20)
+ printf " async-ready-clean"
+ end
+ if ($arg0 & 0x40)
+ printf " misc-work-thr-prgr"
+ end
+ if ($arg0 & 0x80)
+ printf " misc-work"
+ end
+ if ($arg0 & 0x100)
+ printf " check-children"
+ end
+ if ($arg0 & 0x200)
+ printf " set-tmo"
+ end
+ if ($arg0 & 0x400)
+ printf " mseg-cached-check"
+ end
+ if ($arg0 & ~0x7ff)
+ printf " GARBAGE"
+ end
+ printf "\n"
+end
+
+document etp-aux-work-flags
+%---------------------------------------------------------------------------
+% etp-aux-work-flags
+% Arg int
+%
+% Print aux work flags
+%---------------------------------------------------------------------------
+end
+
+define etp-schedulers
+ if (!erts_initialized)
+ printf "No schedulers, since system isn't initialized!\n"
+ else
+ set $sched_ix = 0
+ while $sched_ix < erts_no_schedulers
+ printf "--- Scheduler %d ---\n", $sched_ix+1
+ printf " IX: %d\n", $sched_ix
+ if (erts_aligned_scheduler_data[$sched_ix].esd.cpu_id < 0)
+ printf " CPU Binding: unbound\n"
+ else
+ printf " CPU Binding: %d\n", erts_aligned_scheduler_data[$sched_ix].esd.cpu_id
+ end
+ printf " Aux work Flags:"
+ set $aux_work_flags = *((Uint32 *) &erts_aligned_scheduler_data[$sched_ix].esd.ssi->aux_work)
+ etp-aux-work-flags $aux_work_flags
+ printf " Sleep Info Flags:"
+ set $ssi_flags = *((Uint32 *) &erts_aligned_scheduler_data[$sched_ix].esd.ssi->flags)
+ etp-ssi-flags $ssi_flags
+ printf " Pointer: (ErtsSchedulerData *) %p\n", &erts_aligned_scheduler_data[$sched_ix].esd
+ printf " - Run Queue -\n"
+ if (etp_smp_compiled)
+ set $runq = erts_aligned_scheduler_data[$sched_ix].esd.run_queue
+ else
+ set $runq = &erts_aligned_run_queues[0].runq
+ end
+ printf " Length: total=%d", *((Uint32 *) &($runq->len))
+ printf ", max=%d", *((Uint32 *) &($runq->procs.prio_info[0].len))
+ printf ", high=%d", *((Uint32 *) &($runq->procs.prio_info[1].len))
+ printf ", normal=%d", *((Uint32 *) &($runq->procs.prio_info[2].len))
+ printf ", low=%d", *((Uint32 *) &($runq->procs.prio_info[3].len))
+ printf ", port=%d\n", *((Uint32 *) &($runq->ports.info.len))
+ if ($runq->misc.start)
+ printf " Misc Jobs: yes\n"
+ else
+ printf " Misc Jobs: no\n"
+ end
+ set $rq_flags = *((Uint32 *) &($runq->flags))
+ etp-rq-flags-int $rq_flags
+ printf " Pointer: (ErtsRunQueue *) %p\n", $runq
+
+ set $sched_ix++
+ end
+ printf "-------------------\n",
+ end
+end
+
+document etp-schedulers
+%---------------------------------------------------------------------------
+% etp-schedulers
+%
+% Print misc info about all schedulers
+%---------------------------------------------------------------------------
+end
+
+define etp-migration-info
+ set $minfo = (ErtsMigrationPaths *) *((UWord *) &erts_migration_paths)
+ set $rq_ix = 0
+ while $rq_ix < erts_no_run_queues
+ if ($minfo->mpath[$rq_ix])
+ printf "---\n"
+ printf "Run Queue Ix: %d\n", $rq_ix
+ etp-rq-flags-int $minfo->mpath[$rq_ix].flags
+ end
+ set $rq_ix++
+ end
+end
+
+document etp-migration-info
+%---------------------------------------------------------------------------
+% etp-migration-info
+%
+% Print migration information
+%---------------------------------------------------------------------------
+end
+
+define etp-system-info
+ printf "--------------- System Information ---------------\n"
+ printf "OTP release: %s\n", etp_otp_release
+ printf "ERTS version: %s\n", etp_erts_version
+ printf "Compile date: %s\n", etp_compile_date
+ printf "Arch: %s\n", etp_arch
+ printf "Word size: %d-bit\n", etp_arch_bits
+ printf "Halfword: "
+ if (etp_halfword)
+ printf "yes\n"
+ else
+ printf "no\n"
+ end
+ printf "HiPE support: "
+ if (etp_hipe)
+ printf "yes\n"
+ else
+ printf "no\n"
+ end
+ if (etp_smp_compiled)
+ printf "SMP support: yes\n"
+ else
+ printf "SMP support: no\n"
+ end
+ printf "Thread support: "
+ if (etp_thread_compiled)
+ printf "yes\n"
+ else
+ printf "no\n"
+ end
+ printf "Kernel poll: "
+ if (etp_kernel_poll_support)
+ if (!erts_initialized)
+ printf "Supported\n"
+ else
+ if (erts_use_kernel_poll)
+ printf "Supported and used\n"
+ else
+ printf "Supported but not used\n"
+ end
+ end
+ else
+ printf "No support\n"
+ end
+ printf "Debug compiled: "
+ if (etp_debug_compiled)
+ printf "yes\n"
+ else
+ printf "no\n"
+ end
+ printf "Lock checking: "
+ if (etp_lock_check)
+ printf "yes\n"
+ else
+ printf "no\n"
+ end
+ printf "Lock counting: "
+ if (etp_lock_count)
+ printf "yes\n"
+ else
+ printf "no\n"
+ end
+
+ if (!erts_initialized)
+ printf "System not initialized\n"
+ else
+ printf "Node name: "
+ etp-1 erts_this_node->sysname
+ printf "\n"
+ printf "Number of schedulers: %d\n", erts_no_schedulers
+ printf "Number of async-threads: %d\n", erts_async_max_threads
+ end
+ printf "--------------------------------------------------\n"
+end
+
+document etp-system-info
+%---------------------------------------------------------------------------
+% etp-system-info
+%
+% Print general information about the system
+%---------------------------------------------------------------------------
+end
define etp-dictdump
# Args: ProcDict*
@@ -1407,69 +2085,6 @@ document etpf-offheapdump
%---------------------------------------------------------------------------
end
-define etp-print-procs
-# Args: Eterm
-#
-# Non-reentrant
-#
- etp-print-procs-1
-end
-
-define etp-print-procs-1
-# Args: Eterm*
-#
-# Non-reentrant
-#
- set $etp_print_procs_q = erts_max_processes / 10
- set $etp_print_procs_r = erts_max_processes % 10
- set $etp_print_procs_t = 10
- set $etp_print_procs_m = $etp_print_procs_q
- if $etp_print_procs_r > 0
- set $etp_print_procs_m++
- set $etp_print_procs_r--
- end
- set $etp_print_procs_i = 0
- set $etp_print_procs_found = 0
- while $etp_print_procs_i < erts_max_processes
- if process_tab[$etp_print_procs_i]
- printf "%d: ", $etp_print_procs_i
- etp-1 process_tab[$etp_print_procs_i]->id
- printf " "
- etp-1 ((Eterm)(process_tab[$etp_print_procs_i]->i))
- printf " heap=%d/%d(%d)", process_tab[$etp_print_procs_i]->htop - process_tab[$etp_print_procs_i]->heap, \
- process_tab[$etp_print_procs_i]->hend - process_tab[$etp_print_procs_i]->heap, \
- process_tab[$etp_print_procs_i]->hend - process_tab[$etp_print_procs_i]->stop
- printf " old=%d/%d ", process_tab[$etp_print_procs_i]->old_htop - process_tab[$etp_print_procs_i]->old_heap, \
- process_tab[$etp_print_procs_i]->old_hend - process_tab[$etp_print_procs_i]->old_heap
- printf " mbuf_sz=%d ", process_tab[$etp_print_procs_i]->mbuf_sz
- printf " min=%d ", process_tab[$etp_print_procs_i]->min_heap_size
- printf " flags=%x ", process_tab[$etp_print_procs_i]->flags
- printf " msgs=%d ", process_tab[$etp_print_procs_i]->msg.len
- printf "\n"
- end
- set $etp_print_procs_i++
- if $etp_print_procs_i > $etp_print_procs_m
- printf "%% %d%%...\n", $etp_print_procs_t
- set $etp_print_procs_t += 10
- set $etp_print_procs_m += $etp_print_procs_q
- if $etp_print_procs_r > 0
- set $etp_print_procs_m++
- set $etp_print_procs_r--
- end
- end
- end
- printf "%% 100%%.\n"
-end
-
-document etp-print-procs
-%---------------------------------------------------------------------------
-% etp-print-procs Eterm
-%
-% Print some information about ALL processes.
-%---------------------------------------------------------------------------
-end
-
-
define etp-search-heaps
# Args: Eterm
#
@@ -1498,20 +2113,21 @@ define etp-search-heaps-1
end
set $etp_search_heaps_i = 0
set $etp_search_heaps_found = 0
- while $etp_search_heaps_i < erts_max_processes
- if process_tab[$etp_search_heaps_i]
- if (process_tab[$etp_search_heaps_i]->heap <= ($arg0)) && \
- (($arg0) < process_tab[$etp_search_heaps_i]->hend)
+ while $etp_search_heaps_i < erts_proc.max
+ set $proc = (Process *) *((UWord *) &erts_proc.tab[$proc_ix])
+ if $proc
+ if ($proc->heap <= ($arg0)) && \
+ (($arg0) < $proc->hend)
printf "process_tab[%d]->heap+%d\n", $etp_search_heaps_i, \
- ($arg0)-process_tab[$etp_search_heaps_i]->heap
+ ($arg0)-$proc->heap
end
- if (process_tab[$etp_search_heaps_i]->old_heap <= ($arg0)) && \
- (($arg0) <= process_tab[$etp_search_heaps_i]->old_hend)
+ if ($proc->old_heap <= ($arg0)) && \
+ (($arg0) <= $proc->old_hend)
printf "process_tab[%d]->old_heap+%d\n", $etp_search_heaps_i, \
- ($arg0)-process_tab[$etp_search_heaps_i]->old_heap
+ ($arg0)-$proc->old_heap
end
set $etp_search_heaps_cnt = 0
- set $etp_search_heaps_p = process_tab[$etp_search_heaps_i]->mbuf
+ set $etp_search_heaps_p = $proc->mbuf
while $etp_search_heaps_p && ($etp_search_heaps_cnt < $etp_max_depth)
set $etp_search_heaps_cnt++
if (&($etp_search_heaps_p->mem) <= ($arg0)) && \
@@ -1523,7 +2139,7 @@ define etp-search-heaps-1
set $etp_search_heaps_p = $etp_search_heaps_p->next
end
if $etp_search_heaps_p
- printf "process_tab[%d] %% Too many HeapFragments\n", \
+ printf "Process ix=%d %% Too many HeapFragments\n", \
$etp_search_heaps_i
end
end
@@ -1883,6 +2499,28 @@ document etp-ets-tables
%---------------------------------------------------------------------------
end
+define etp-ets-obj
+# Args: DbTerm*
+#
+ set $etp_ets_obj_i = 1
+ while $etp_ets_obj_i <= (($arg0)->tpl[0] >> 6)
+ if $etp_ets_obj_i == 1
+ printf "{"
+ else
+ printf ", "
+ end
+ set $etp_ets_elem = ($arg0)->tpl[$etp_ets_obj_i]
+ if ($etp_ets_elem & 3) == 0
+ printf "<compressed>"
+ else
+ etp-1 $etp_ets_elem 0
+ end
+ set $etp_ets_obj_i++
+ end
+ printf "}"
+end
+
+
define etp-ets-tabledump
# Args: int tableindex
#
@@ -1896,10 +2534,10 @@ define etp-ets-tabledump
if $etp_ets_tabledump_t->common.status & 0x130
# Hash table
set $etp_ets_tabledump_h = $etp_ets_tabledump_t->hash
- printf "%% nitems=%d\n", $etp_ets_tabledump_t->common.nitems
- while $etp_ets_tabledump_i < $etp_ets_tabledump_h->nactive
- set $etp_ets_tabledump_l = $etp_ets_tabledump_h->seg \
- [$etp_ets_tabledump_i>>8][$etp_ets_tabledump_i&0xFF]
+ printf "%% nitems=%d\n", (long) $etp_ets_tabledump_t->common.nitems
+ while $etp_ets_tabledump_i < (long) $etp_ets_tabledump_h->nactive
+ set $etp_ets_tabledump_seg = ((struct segment**)$etp_ets_tabledump_h->segtab)[$etp_ets_tabledump_i>>8]
+ set $etp_ets_tabledump_l = $etp_ets_tabledump_seg->buckets[$etp_ets_tabledump_i&0xFF]
if $etp_ets_tabledump_l
printf "%% Slot %d:\n", $etp_ets_tabledump_i
while $etp_ets_tabledump_l
@@ -1909,7 +2547,7 @@ define etp-ets-tabledump
printf "["
end
set $etp_ets_tabledump_n++
- etp-1 ((Eterm)($etp_ets_tabledump_l->dbterm.tpl)|0x2) 0
+ etp-ets-obj &($etp_ets_tabledump_l->dbterm)
if $etp_ets_tabledump_l->hvalue == ((unsigned long)-1)
printf "% *\n"
else
@@ -2048,7 +2686,7 @@ document etp-init
%---------------------------------------------------------------------------
end
-
etp-init
help etp-init
etp-show
+etp-system-info
diff --git a/erts/etc/unix/run_erl.c b/erts/etc/unix/run_erl.c
index 8db8e09bee..910be3dce8 100644
--- a/erts/etc/unix/run_erl.c
+++ b/erts/etc/unix/run_erl.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -126,7 +126,7 @@
/* prototypes */
static void usage(char *);
static int create_fifo(char *name, int perm);
-static int open_pty_master(char **name);
+static int open_pty_master(char **name, int *sfd);
static int open_pty_slave(char *name);
static void pass_on(pid_t);
static void exec_shell(char **);
@@ -150,6 +150,10 @@ static int write_all(int fd, const char* buf, int len);
static int extract_ctrl_seq(char* buf, int len);
static void set_window_size(unsigned col, unsigned row);
+static ssize_t sf_write(int fd, const void *buffer, size_t len);
+static ssize_t sf_read(int fd, void *buffer, size_t len);
+static int sf_open(const char *path, int flags, mode_t mode);
+static int sf_close(int fd);
#ifdef DEBUG
static void show_terminal_settings(struct termios *t);
@@ -216,7 +220,7 @@ static char* outbuf_in;
int main(int argc, char **argv)
{
int childpid;
- int sfd;
+ int sfd = -1;
int fd;
char *p, *ptyslave=NULL;
int i = 1;
@@ -338,9 +342,9 @@ int main(int argc, char **argv)
strn_cat(fifo2, sizeof(fifo2), ".w");
/* Check that nobody is running run_erl already */
- if ((fd = open (fifo2, O_WRONLY|DONT_BLOCK_PLEASE, 0)) >= 0) {
+ if ((fd = sf_open(fifo2, O_WRONLY|DONT_BLOCK_PLEASE, 0)) >= 0) {
/* Open as client succeeded -- run_erl is already running! */
- close(fd);
+ sf_close(fd);
if (calculated_pipename) {
++highest_pipe_num;
strn_catf(pipename, sizeof(pipename), "%s.%d",
@@ -361,7 +365,7 @@ int main(int argc, char **argv)
* Open master pseudo-terminal
*/
- if ((mfd = open_pty_master(&ptyslave)) < 0) {
+ if ((mfd = open_pty_master(&ptyslave, &sfd)) < 0) {
ERRNO_ERR0(LOG_ERR,"Could not open pty master");
exit(1);
}
@@ -376,7 +380,7 @@ int main(int argc, char **argv)
}
if (childpid == 0) {
/* Child */
- close(mfd);
+ sf_close(mfd);
/* disassociate from control terminal */
#ifdef USE_SETPGRP_NOARGS /* SysV */
setpgrp();
@@ -386,15 +390,30 @@ int main(int argc, char **argv)
setsid();
#endif
/* Open the slave pty */
- if ((sfd = open_pty_slave(ptyslave)) < 0) {
- ERRNO_ERR1(LOG_ERR,"Could not open pty slave '%s'", ptyslave);
- exit(1);
+ if (sfd < 0) {
+ /* not allocated by open_pty_master */
+ if ((sfd = open_pty_slave(ptyslave)) < 0) {
+ ERRNO_ERR1(LOG_ERR,"Could not open pty slave '%s'", ptyslave);
+ exit(1);
+ }
+ /* But sfd may be one of the stdio fd's now, and we should be unmodern and not use dup2... */
+ /* easiest to dup it up... */
+ while (sfd < 3) {
+ sfd = dup(sfd);
+ }
}
- /* But sfd may be one of the stdio fd's now, and we should be unmodern and not use dup2... */
- /* easiest to dup it up... */
- while (sfd < 3) {
- sfd = dup(sfd);
+#if defined(HAVE_OPENPTY) && defined(TIOCSCTTY)
+ else {
+ /* sfd is from open_pty_master
+ * openpty -> fork -> login_tty (forkpty)
+ *
+ * It would be preferable to implement a portable
+ * forkpty instead of open_pty_master / open_pty_slave
+ */
+ /* login_tty(sfd); <- FAIL */
+ ioctl(sfd, TIOCSCTTY, (char *)NULL);
}
+#endif
#ifndef NO_SYSLOG
/* Before fiddling with file descriptors we make sure syslog is turned off
@@ -407,14 +426,14 @@ int main(int argc, char **argv)
#endif
/* Close stdio */
- close(0);
- close(1);
- close(2);
+ sf_close(0);
+ sf_close(1);
+ sf_close(2);
if (dup(sfd) != 0 || dup(sfd) != 1 || dup(sfd) != 2) {
status("Cannot dup\n");
}
- close(sfd);
+ sf_close(sfd);
exec_shell(argv+off_argv); /* exec_shell expects argv[2] to be */
/* the command name, so we have to */
/* adjust. */
@@ -466,7 +485,7 @@ static void pass_on(pid_t childpid)
* We can't open the writing side because nobody is reading and
* we'd either hang or get an error.
*/
- if ((rfd = open(fifo2, O_RDONLY|DONT_BLOCK_PLEASE, 0)) < 0) {
+ if ((rfd = sf_open(fifo2, O_RDONLY|DONT_BLOCK_PLEASE, 0)) < 0) {
ERRNO_ERR1(LOG_ERR,"Could not open FIFO '%s' for reading.", fifo2);
exit(1);
}
@@ -559,7 +578,7 @@ static void pass_on(pid_t childpid)
char* buf = outbuf_first();
len = outbuf_size();
- written = write(wfd, buf, len);
+ written = sf_write(wfd, buf, len);
if (written < 0 && errno == EAGAIN) {
/*
* Nothing was written - this is really strange because
@@ -570,7 +589,7 @@ static void pass_on(pid_t childpid)
* A write error. Assume that to_erl has terminated.
*/
clear_outbuf();
- close(wfd);
+ sf_close(wfd);
wfd = 0;
} else {
/* Delete the written part (or all) from the buffer. */
@@ -585,10 +604,10 @@ static void pass_on(pid_t childpid)
#ifdef DEBUG
status("Pty master read; ");
#endif
- if ((len = read(mfd, buf, BUFSIZ)) <= 0) {
- close(rfd);
- if(wfd) close(wfd);
- close(mfd);
+ if ((len = sf_read(mfd, buf, BUFSIZ)) <= 0) {
+ sf_close(rfd);
+ if(wfd) sf_close(wfd);
+ sf_close(mfd);
unlink(fifo1);
unlink(fifo2);
if (len < 0) {
@@ -619,10 +638,10 @@ static void pass_on(pid_t childpid)
#ifdef DEBUG
status("FIFO read; ");
#endif
- if ((len = read(rfd, buf, BUFSIZ)) < 0) {
- close(rfd);
- if(wfd) close(wfd);
- close(mfd);
+ if ((len = sf_read(rfd, buf, BUFSIZ)) < 0) {
+ sf_close(rfd);
+ if(wfd) sf_close(wfd);
+ sf_close(mfd);
unlink(fifo1);
unlink(fifo2);
ERRNO_ERR0(LOG_ERR,"Error in reading from FIFO.");
@@ -631,8 +650,8 @@ static void pass_on(pid_t childpid)
if(!len) {
/* to_erl closed its end of the pipe */
- close(rfd);
- rfd = open(fifo2, O_RDONLY|DONT_BLOCK_PLEASE, 0);
+ sf_close(rfd);
+ rfd = sf_open(fifo2, O_RDONLY|DONT_BLOCK_PLEASE, 0);
if (rfd < 0) {
ERRNO_ERR1(LOG_ERR,"Could not open FIFO '%s' for reading.", fifo2);
exit(1);
@@ -645,11 +664,11 @@ static void pass_on(pid_t childpid)
* from to_erl, to_erl should already be reading this pipe - open
* should succeed. But in case of error, we just ignore it.
*/
- if ((wfd = open(fifo1, O_WRONLY|DONT_BLOCK_PLEASE, 0)) < 0) {
+ if ((wfd = sf_open(fifo1, O_WRONLY|DONT_BLOCK_PLEASE, 0)) < 0) {
status("Client expected on FIFO %s, but can't open (len=%d)\n",
fifo1, len);
- close(rfd);
- rfd = open(fifo2, O_RDONLY|DONT_BLOCK_PLEASE, 0);
+ sf_close(rfd);
+ rfd = sf_open(fifo2, O_RDONLY|DONT_BLOCK_PLEASE, 0);
if (rfd < 0) {
ERRNO_ERR1(LOG_ERR,"Could not open FIFO '%s' for reading.", fifo2);
exit(1);
@@ -683,9 +702,9 @@ static void pass_on(pid_t childpid)
}
else if (len>0 && write_all(mfd, buf, len) != len) {
ERRNO_ERR0(LOG_ERR,"Error in writing to terminal.");
- close(rfd);
- if(wfd) close(wfd);
- close(mfd);
+ sf_close(rfd);
+ if(wfd) sf_close(wfd);
+ sf_close(mfd);
exit(1);
}
}
@@ -797,7 +816,7 @@ static int open_log(int log_num, int flags)
/* Create or continue on the current log file */
sn_printf(buf, sizeof(buf), "%s/%s%d", log_dir, LOG_STUBNAME, log_num);
- if((lfd = open(buf, flags, LOG_PERM))<0){
+ if((lfd = sf_open(buf, flags, LOG_PERM))<0){
ERRNO_ERR1(LOG_ERR,"Can't open log file '%s'.", buf);
exit(1);
}
@@ -841,7 +860,7 @@ static void write_to_log(int* lfd, int* log_num, char* buf, int len)
size = lseek(*lfd,0,SEEK_END);
if(size+len > log_maxsize) {
- close(*lfd);
+ sf_close(*lfd);
*log_num = next_log(*log_num);
*lfd = open_log(*log_num, O_RDWR|O_CREAT|O_TRUNC|O_SYNC);
}
@@ -872,7 +891,7 @@ static int create_fifo(char *name, int perm)
* Find a master device, open and return fd and slave device name.
*/
-static int open_pty_master(char **ptyslave)
+static int open_pty_master(char **ptyslave, int *sfdp)
{
int mfd;
@@ -882,7 +901,9 @@ static int open_pty_master(char **ptyslave)
# ifdef HAVE_WORKING_POSIX_OPENPT
if ((mfd = posix_openpt(O_RDWR)) >= 0) {
# elif defined(__sun) && defined(__SVR4)
- if ((mfd = open("/dev/ptmx", O_RDWR)) >= 0) {
+ mfd = sf_open("/dev/ptmx", O_RDWR, 0);
+
+ if (mfd >= 0) {
# endif
if ((*ptyslave = ptsname(mfd)) != NULL &&
grantpt(mfd) == 0 &&
@@ -890,12 +911,12 @@ static int open_pty_master(char **ptyslave)
return mfd;
}
- close(mfd);
+ sf_close(mfd);
}
/* fallback to openpty if it exist */
#endif
-#ifdef HAVE_OPENPTY
+#if defined(HAVE_OPENPTY)
# ifdef PATH_MAX
# define SLAVE_SIZE PATH_MAX
# else
@@ -903,11 +924,8 @@ static int open_pty_master(char **ptyslave)
# endif
{
static char slave[SLAVE_SIZE];
- int sfd;
# undef SLAVE_SIZE
-
- if (openpty(&mfd, &sfd, slave, NULL, NULL) == 0) {
- close(sfd);
+ if (openpty(&mfd, sfdp, slave, NULL, NULL) == 0) {
*ptyslave = slave;
return mfd;
}
@@ -939,7 +957,8 @@ static int open_pty_master(char **ptyslave)
for (minor = minorchars; *minor; minor++) {
ptyname[10] = *minor;
- if ((mfd = open(ptyname, O_RDWR, 0)) >= 0) {
+
+ if ((mfd = sf_open(ptyname, O_RDWR, 0)) >= 0) {
ptyname[9] = 's';
*ptyslave = ptyname;
return mfd;
@@ -957,7 +976,7 @@ static int open_pty_master(char **ptyslave)
ptyname[13] = *major;
for (minor = minorchars; *minor; minor++) {
ptyname[14] = *minor;
- if ((mfd = open(ptyname, O_RDWR, 0)) >= 0) {
+ if ((mfd = sf_open(ptyname, O_RDWR, 0)) >= 0) {
ttyname[12] = *major;
ttyname[13] = *minor;
*ptyslave = ttyname;
@@ -976,7 +995,7 @@ static int open_pty_master(char **ptyslave)
ptyname[8] = *major;
for (minor = minorchars; *minor; minor++) {
ptyname[9] = *minor;
- if ((mfd = open(ptyname, O_RDWR, 0)) >= 0) {
+ if ((mfd = sf_open(ptyname, O_RDWR, 0)) >= 0) {
ptyname[5] = 't';
*ptyslave = ptyname;
return mfd;
@@ -993,7 +1012,7 @@ static int open_pty_slave(char *name)
int sfd;
struct termios tty_rmode;
- if ((sfd = open(name, O_RDWR, 0)) < 0) {
+ if ((sfd = sf_open(name, O_RDWR, 0)) < 0) {
return -1;
}
@@ -1120,7 +1139,7 @@ static void daemon_init(void)
would be backward incompatible */
for (i = 0; i < maxfd; ++i ) {
- close(i);
+ sf_close(i);
}
OPEN_SYSLOG();
@@ -1246,7 +1265,7 @@ static int write_all(int fd, const char* buf, int len)
int left = len;
int written;
for (;;) {
- written = write(fd,buf,left);
+ written = sf_write(fd,buf,left);
if (written == left) {
return len;
}
@@ -1258,6 +1277,36 @@ static int write_all(int fd, const char* buf, int len)
}
}
+static ssize_t sf_read(int fd, void *buffer, size_t len) {
+ ssize_t n = 0;
+
+ do { n = read(fd, buffer, len); } while (n < 0 && errno == EINTR);
+
+ return n;
+}
+
+static ssize_t sf_write(int fd, const void *buffer, size_t len) {
+ ssize_t n = 0;
+
+ do { n = write(fd, buffer, len); } while (n < 0 && errno == EINTR);
+
+ return n;
+}
+
+static int sf_open(const char *path, int type, mode_t mode) {
+ int fd = 0;
+
+ do { fd = open(path, type, mode); } while(fd < 0 && errno == EINTR);
+
+ return fd;
+}
+static int sf_close(int fd) {
+ int res = 0;
+
+ do { res = close(fd); } while(fd < 0 && errno == EINTR);
+
+ return res;
+}
/* Extract any control sequences that are ment only for run_erl
* and should not be forwarded to the pty.
*/
diff --git a/erts/etc/unix/to_erl.c b/erts/etc/unix/to_erl.c
index 67274e67ed..754b349338 100644
--- a/erts/etc/unix/to_erl.c
+++ b/erts/etc/unix/to_erl.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1996-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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/etc/vxworks/README.VxWorks b/erts/etc/vxworks/README.VxWorks
deleted file mode 100644
index 299e35b513..0000000000
--- a/erts/etc/vxworks/README.VxWorks
+++ /dev/null
@@ -1,350 +0,0 @@
-
- %CopyrightBegin%
-
- Copyright Ericsson AB 1997-2009. All Rights Reserved.
-
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
-
- %CopyrightEnd%
-
------------------------------------------------------------------------
-README, Erlang/OTP R11B for VxWorks on PPC860 and PPC603
------------------------------------------------------------------------
-20060515 -- Patrik Nyblom, [email protected]
-
-R11B is a libraries only release for VxWorks. Only the libraries of
-erl_interface (ei+erl_inteface) and ic are expected to be used. Still
-the whole erlang system is distributed, although no support will be
-given for anything else but the libraries. The information in this
-file still applies to the full erlang distribution and parts of it are
-therefore somewhat irrelevant to commercial users.
-
-
-Included OTP applications
--------------------------
-
-appmon
-asn1
-compiler
-cosEvent
-cosNotification
-cosTime
-cosTransaction
-debugger
-erl_interface
-erts
-eva [1]
-ic
-inets [2]
-jinterface
-kernel
-mesh
-mnemosyne
-mnesia [1]
-mnesia_session
-orber
-os_mon
-pman
-runtime_tools
-sasl
-snmp
-stdlib
-tools
-tv
-
-[1] Only ram_copies work, The VxWorks filesystems are not
- reliable enough for disk_copies to be fully supported.
-[2] CGI scripts do not work on VxWorks.
-
-Omitted applications
---------------------
-
-crypto
-emacs
-etk
-gs
-odbc
-parsetools
-toolbar
-ssl
-megaco
-webtools
-
-As `crypto' and `ssl' provides cryptographic functionality to `inets'
-and `snmp', the latter applications will not handle cryptography on
-VxWorks.
-
-Graphical interfaces
---------------------
-
-For applications using graphical interfaces, only the backend part works.
-
-Compilers
----------
-
-All compilers are expected to be run on a cross host. The VxWorks
-systems memory capabilities are too restricting to allow native
-compiling. The expected host system is a Sun Solaris machine, although
-Erlang compilation may be done on most platforms.
-
-Supported boards and configuration (only libraries supported)
-----------------------------------
-The following boards and configurations are supported:
-
-* Force PowerCore 603 with Force pcore603 BSP and VxWorks 3.5.1 (no
- SENS or SENS 1.1 + SPR23938) and a minimum of 32 Mb memory.
-
-* Force Powercore 750 with Force pcore750 BSP and VxWorks 3.5.1 (no
- SENS or SENS 1.1 + SPR23938) and a minimum of 32 Mb memory.
-
-* PSS Core PPC860 processors, only erl_interface (too small main memory).
-
-Most PowerPC boards with FPU are expected to work, but will need to be
-tested by OTP to be fully supported.
-
-The PPC603 build has been compiled with Wind River's `-mlongcall'
-flag (SPR25893) to support arbitrary function calls across more
-than 32 MB of memory.
-
-The PPC860 (PowerQuicc) has no FPU and requires a separate build.
-
-For Erlang to run, the Wind kernel has to be configured with a minimum
-of these variables defined in config.h (or by the Tornado
-configuration tool):
-
- INCLUDE_ANSI_ALL
- INCLUDE_ENV_VARS
- INCLUDE_EXC_HANDLING
- INCLUDE_EXC_TASK
- INCLUDE_FLOATING_POINT
- INCLUDE_FORMATTED_IO
- INCLUDE_IO_SYSTEM
- INCLUDE_LOADER
- INCLUDE_NETWORK
- INCLUDE_NET_INIT
- INCLUDE_NET_SHOW
- INCLUDE_NET_SYM_TBL or INCLUDE_STANDALONE_SYM_TBL
- INCLUDE_PIPES
- INCLUDE_POSIX_FTRUNC
- INCLUDE_RLOGIN or INCLUDE_TELNET (for pty's only)
- INCLUDE_SELECT
- INCLUDE_SEM_BINARY
- INCLUDE_SEM_COUNTING
- INCLUDE_SEM_MUTEX
- INCLUDE_SHELL (*)
- INCLUDE_SHOW_ROUTINES
- INCLUDE_SIGNALS
- INCLUDE_STARTUP_SCRIPT (*)
- INCLUDE_STDIO
- INCLUDE_SYM_TBL
- INCLUDE_TASK_HOOKS
- INCLUDE_TASK_VARS
- INCLUDE_TTY_DEV
- INCLUDE_UNLOADER
- INCLUDE_NFS or INCLUDE_RAMDRV or INCLUDE_DOSFS (i.e. a file system,
- possibly read-only) (**)
-
-(*) Needed for the example startup script, not actually needed in production if
- erlang is set up by a c routine called from usrConfig.c.
-(**) INCLUDE_NFS usually requires the NFS_USER_ID and NFS_GROUP_ID variables
- to be set in config.h
-
-As an erlang system may open a lot of files, it is recommended to raise the
-default NUM_FILES variable to something like 256 in config.h like this:
- #ifdef NUM_FILES
- #undef NUM_FILES
- #endif
- #define NUM_FILES 256
-
-The SENS stack *has* to be of version 1.1 or higher, 1.0 is *not*
-supported and will not work reliably. Upgrades as well as the patch
-for SPR23938 can be found at www.wrs.com (i.e. WindSurf). Also, the
-following constants in $WIND_BASE/target/h/netBufLib.h has to be
-raised to a value of at least four times the default:
-
- NUM_NET_MBLKS
- NUM_64
- NUM_128
- NUM_256
- NUM_512
- NUM_1024
- NUM_2048
-
- NUM_SYS_64
- NUM_SYS_128
- NUM_SYS_256
- NUM_SYS_512
-
-Use the show routines mbufShow and netStackSysPoolShow to verify that
-these pools are not exhausted.
-
-Installation
-------------
-
-To install Erlang on a VxWorks card, the following knowledge is
-expected:
-
-* VxWorks installation and configuration.
-
-* Network (TCP/IP) configuration.
-
-* Erlang basic operation and configuration.
-
-There is no specific install script for erlang on the VxWorks
-platform. There is however an example VxWorks startup file named
-erts-5.0.1/bin/erl_script.sam under the root of an unpacked
-release. There may of course be other things to do in the start
-script, like using the rdate program in the erlang distribution to get
-a correct date and set the TIMEZONE variable.
-
-Please consult the "Embedded System" documentation for further
-information on installation.
-
-Known Bugs and problems
------------------------
-
-We have found the VxWorks/NFS client file system to be unreliable.
-Important file operations like rename, ftruncate, cd and unlink
-doesn't always work as expected. Therefore more complex file using
-parts of OTP, like DETS and disk based mnesia tables cannot be used
-reliably with NFS. Lowering the NFS cache size (global variable
-nfsCacheSize) to 512 gives a more reliable NFS client, but to disk
-base the mnesia tables over NFS is still not a good idea, especially
-as disk based mnesia tables are not supported on VxWorks. Another
-problem with VxWorks file systems is that the error codes they produce
-are not consistent. We have worked around this problem by mapping the
-codes to POSIX ones, by doing this we make the VxWorks Erlang platform
-behave similarly to the UNIX and Windows implementations.
-
-The rename and ftruncate operations over NFS are emulated using
-copying of files. This is mainly for our own test suites and it is not
-recommended to use file:rename and/or file:ftruncate on NFS file
-systems in production.
-
-Floating point operations is somewhat faulty. For instance, testing
-floating point numbers for equality should be done with care. This is
-actually not a bug, IEEE specifies no equality among floating point
-numbers.
-
-Memory handling
----------------
-
-Please read the erl_set_memory_block(3) manual page in the ERTS
-documentation for information concerning memory handling in the erlang
-emulator. Also please observe that reclaim.o has to be loaded and
-reclaim_init() called before any other erlang routines are loaded and
-started. If one wish to use the resource reclamation routines in other
-programs, refer to the header file in `erts-5.0.1/include/reclaim.h'.
-Including that file in your C source makes malloc/realloc/free and
-open/fopen/socket/close etc be redefined to routines that makes the
-memory and files be free'd/closed when the task exits. Still,
-reclaim_init() *has* to be called before any program that uses this is
-started.
-
-Using heart
------------
-
-The default behavior of the heart object file that is part of the
-distribution is that it reboots the target when the Erlang process
-hasn't given it a heart beat in 60 seconds. The normal heart beat rate
-is one beat per five seconds. This makes an effective "software
-watchdog" but there is really no substitute for the real thing --- a
-hardware watchdog. If you want to add a hardware watchdog to the
-system please contact us for directions. If you want to disable the
-reboot you may set the environment variable HEART_DONT_REBOOT (see the
-example erlang start script, erl). Please note that if you DO want the
-card to reboot you mustn't define HEART_DONT_REBOOT at all. E.g. to
-disable heart reboot you may include the following line in the start
-script (as is indeed the case with the example start script).
-
- putenv "HEART_DONT_REBOOT=1"
-
-A few words on writing port program and dynamically loaded drivers for VxWorks
-------------------------------------------------------------------------------
-
-VxWorks has one name-space for all symbols. This makes it harder to
-write C programs whose global symbols doesn't interfere with each
-other. It is a good rule to avoid all globally visible symbols that
-are not absolutely necessary. Due to these facts we use the following
-naming rules that are crucial to follow. (there are more issues
-involved but the issues described here is a good beginning).
-
-Port programs must have a function with the same name as the object
-file. E.g. if you have an object file named `port_test.o' it must
-contain a globally visible function named `port_test'. This is the
-function that will be called when you output data from Erlang to the
-port. (The object file, in this example, should be named
-`port_test.o', but `port_test' will also do).
-
-Also, in an embedded system, it is recommended to load the port
-program into the system before the port program is used. This is to
-avoid the real time degradation dynamical linking in runtime would
-introduce. Use VxWorks command ld < "port_prg" to accomplish this.
-
-Dynamically linked drivers must have a function with the same name as
-the object file with the added suffix `_init'. We recommend the use of
-the macro DRIVER_INIT in `driver.h'. E.g. if you have an object file
-named `echo_drv.eld' it must contain a globally visible function
-`echo_drv_init'. (The object file, in this example, should be named
-`echo_drv.eld' (`eld' is short for Erlang Loadable Driver), but
-`echo_drv.o' and `echo_drv' will both also do). It is also very
-important to initialize all unused function pointer in the
-`driver_entry' struct to NULL (see example below).
-
-Example of dynamically linked driver
-------------------------------------
-
-#include <stdio.h>
-#include "driver.h"
-
-static int erlang_port;
-static long echo_start();
-static int echo_stop(), echo_read();
-
-static struct driver_entry echo_driver_entry = {
- null_func,
- echo_start,
- echo_stop,
- echo_read,
- null_func,
- null_func,
- "echo_drv",
- null_func
-};
-
-int DRIVER_INIT(echo_drv)(void *handle)
-{
- erlang_port = -1;
-
- echo_driver_entry.handle = handle;
- return (int) &echo_driver_entry;
-}
-
-static long echo_start(long port,char *buf)
-{
- if (erlang_port != -1) {
- return -1;
- }
-
- erlang_port = port;
- return port;
-}
-
-static int echo_read(long port, char *buf, int count)
-{
- return driver_output(erlang_port, buf, count);
-}
-
-static int echo_stop()
-{
- return erlang_port = -1;
-}
diff --git a/erts/etc/vxworks/erl.exec.c b/erts/etc/vxworks/erl.exec.c
deleted file mode 100644
index 6b45ebaa39..0000000000
--- a/erts/etc/vxworks/erl.exec.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-/*
- A simpified version of the 'erl.exec' "startup script".
- Called (e.g. from VxWorks shell) with all arguments in a
- single string, e.g.: erl "-name thisnode -s mymod myfunc".
- These arguments are handled as in 'erl.exec':
- -name
- -sname
- -noshell
- -noinput
- anything else is just passed on to the emulator. Note that there
- is no automatic start of epmd, that -oldshell is implicit, and
- that you need to set current directory appropriately if you want
- auto-load of port programs
-*/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifndef DEFAULT_HOMEDIR /* used if environment HOME isn't set */
-#define DEFAULT_HOMEDIR "/"
-#endif
-
-#define ARGLEN 2048 /* Total length of args passed to erl_main */
-#define ARGMAX 64 /* Max no of "extra" args */
-
-static char *erl_cmd = "erl_main -n ";
-
-static toomuch()
-{
- fprintf(stderr, "erl: Too many arguments\n");
- return(-1);
-}
-
-static toolittle(arg)
-char *arg;
-{
- fprintf(stderr, "erl.exec: Missing argument for %s\n", arg);
- return(-1);
-}
-
-erl_exec(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)
-int arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10;
-{
- char *shell = "-oldshell ", *noshell = "",
- *home, *rootdir, *bindir, *progname;
- char cmd[ARGLEN], eargs[ARGLEN], iargs[ARGLEN];
- char *args[ARGMAX], *arglast = NULL, *argp;
- int nargs = 0, len, i;
-
- if ((rootdir = getenv("ROOTDIR")) == NULL ||
- (bindir = getenv("BINDIR")) == NULL ||
- (progname = getenv("PROGNAME")) == NULL) {
- fprintf(stderr, "erl.exec: ROOTDIR, BINDIR, and PROGNAME must be set.");
- return -1;
- }
- eargs[0] = '\0';
- iargs[0] = '\0';
- if ((home = getenv("HOME")) == NULL)
- home = DEFAULT_HOMEDIR;
- argp = strtok_r((char *)arg1, " \t", &arglast);
- while (argp != NULL) {
- if (strcmp(argp, "-name") == 0) {
- if ((argp = strtok_r((char *)NULL, " \t", &arglast)) == NULL)
- return(toolittle("-name"));
- strcat(iargs, "-name ");
- strcat(iargs, argp);
- strcat(iargs, " ");
- } else if (strcmp(argp, "-sname") == 0) {
- if ((argp = strtok_r((char *)NULL, " \t", &arglast)) == NULL)
- return(toolittle("-sname"));
- strcat(iargs, "-sname ");
- strcat(iargs, argp);
- strcat(iargs, " ");
- } else if (strcmp(argp, "-noshell") == 0) {
- strcat(iargs, "-noshell -noinp_shell ");
- } else if (strcmp(argp, "-noinput") == 0) {
- strcat(iargs, "-noshell -noinput ");
- } else {
- if (nargs > ARGMAX - 1)
- return(toomuch());
- args[nargs++] = argp;
- }
- argp = strtok_r((char *)NULL, " \t", &arglast);
- }
- strcpy(cmd, erl_cmd);
- strcat(cmd, eargs);
- strcat(cmd, " -- -root ");
- strcat(cmd, rootdir);
- strcat(cmd, " -progname ");
- strcat(cmd, progname);
- strcat(cmd, " -- ");
- strcat(cmd, "-home ");
- strcat(cmd, home);
- strcat(cmd, " ");
- strcat(cmd, iargs);
-
- len = strlen(cmd);
- for (i = 0; i < nargs; i++) {
- if (len + strlen(args[i]) + 2 >= ARGLEN)
- return(toomuch());
- cmd[len++] = ' ';
- strcpy(&cmd[len], args[i]);
- len += strlen(args[i]);
- }
- argcall(cmd);
-}
-
diff --git a/erts/etc/vxworks/erl_io.c b/erts/etc/vxworks/erl_io.c
deleted file mode 100644
index 0032b77079..0000000000
--- a/erts/etc/vxworks/erl_io.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-/* Some stuff to let the Erlang and VxWorks shells coexist peacefully.
- Basically, run Erlang as a spawned task with input redirected to
- the slave side of a pseudo-tty, and connect explicitly to the master
- side of the pseudo-tty to send input to Erlang when desired. */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-#include <stdio.h>
-#include <ioLib.h>
-#include <taskLib.h>
-#include <ptyDrv.h>
-
-extern int spTaskPriority, spTaskOptions;
-
-#define TBUFSIZ 512
-
-#define DEFAULT_STACK_SIZE 100000
-
-static int slavefd = -1, masterfd = -1;
-static run_erl();
-
-/* Frontend to the Erlang startup function - callable from VxWorks shell
- or script. 'arg' is actually a string passed to the real startup. */
-start_erl(arg)
-int arg;
-{
- int stacksize;
- char *stackenv;
-
- /* create and open the pty - we want the master side to be open
- all the time, since closing it probably generates EOF on the
- slave side */
- (void)ptyDevCreate("/pty/erlang.", TBUFSIZ, TBUFSIZ);
- if (slavefd != -1)
- (void)close(slavefd);
- slavefd = open("/pty/erlang.S", O_RDONLY, 0);
- if (masterfd != -1)
- (void)close(masterfd);
- masterfd = open("/pty/erlang.M", O_WRONLY, 0);
-
- /* flush any old leftover garbage */
- (void) ioctl(masterfd, FIOFLUSH, 0);
- if ((stackenv = getenv("ERLSTACKSIZE")) == NULL)
- stacksize = DEFAULT_STACK_SIZE;
- else
- stacksize = atoi(stackenv);
- /* spawn Erlang, via stub below */
- return(taskSpawn("erlang", spTaskPriority, spTaskOptions, stacksize,
- run_erl, arg, 0,0,0,0,0,0,0,0,0));
-}
-
-/* Little stub that runs in the spawned task - we need this to redirect
- stdin reliably (redirections aren't "inherited" in VxWorks) */
-static
-run_erl(arg)
-int arg;
-{
- ioTaskStdSet(0, 0, slavefd); /* redirect stdin to slave side of pty */
-
- /* We don't want to redirect stdout/err since no one will be reading
- from the master side (to_erl - and the open()s above - could be
- made bidirectional, but still the master side would only be read
- when to_erl was running), and output can eventually fill the pty
- buffer and cause the Erlang system to block. Not redirecting
- stdout/err will have the effect that output from Erlang, e.g. the
- shell prompt, will appear on console/rlogin/whatever even when
- to_erl isn't running, which may be confusing - can't win 'em all... */
-
- erl_exec(arg, 0,0,0,0,0,0,0,0); /* call the real startup */
-}
-
-/* Function callable from VxWorks shell to talk to Erlang - stop talking
- and return to VxWorks shell through ^D (EOF) */
-to_erl()
-{
- char buf[TBUFSIZ];
- int cc;
-
- if (masterfd == -1) { /* sanity check */
- fprintf(stderr, "Must start_erl first!\n");
- return(-1);
- }
- while ((cc = read(0, buf, TBUFSIZ)) > 0) /* just pass everything through */
- if (write(masterfd, buf, cc) != cc) {
- fprintf(stderr, "Write to Erlang failed!\n");
- return(-1);
- }
- return(cc);
-}
diff --git a/erts/etc/vxworks/erl_script.sam.in b/erts/etc/vxworks/erl_script.sam.in
deleted file mode 100644
index 81c2b0128d..0000000000
--- a/erts/etc/vxworks/erl_script.sam.in
+++ /dev/null
@@ -1,100 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
-#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
-#
-# %CopyrightEnd%
-#
-#
-# erl_script.sam
-# Sample VxWorks script to start Erlang
-#
-# Note! This is not a complete or ready to use VxWorks startup script,
-# rather an example of what You should add to Your existing startupscript
-# to execute the erlang emulator at boot.
-#
-# When writing Your own script to start erlang, the paths to
-# the binaries have to be changed to reflect your system.
-#
-# The ROOTDIR variable should not point to a ftp or rcp filesystem unless
-# the erlang machine is run in embedded mode. Loading of modules
-# is far to slow if the erlang binaries are not placed on a real filesystem
-# like NFS or any type of local filesystem.
-#
-
-#
-# Load modules
-#
-
-#
-# First load and initiate the reclaim facility
-#
-ld </home/tornado/erlvxworks/erts-%VSN%/bin/reclaim.o
-reclaim_init()
-
-#
-# Now load the runtime system
-#
-ld </home/tornado/erlvxworks/erts-%VSN%/bin/jam
-ld </home/tornado/erlvxworks/erts-%VSN%/bin/erl.exec
-ld </home/tornado/erlvxworks/erts-%VSN%/bin/erl_io
-ld </home/tornado/erlvxworks/erts-%VSN%/bin/vxcall
-ld </home/tornado/erlvxworks/erts-%VSN%/bin/heart
-ld </home/tornado/erlvxworks/erts-%VSN%/bin/epmd
-
-#
-# Stack sizes
-#
-putenv "ERLSTACKSIZE=100000"
-putenv "ERLPORTSTACKSIZE=100000"
-
-#
-# Activate Round robin scheduling
-#
-kernelTimeSlice 1
-
-#
-# Distribution
-# The VxWorks machines host name
-sethostname "sb001", 5
-# Erlangs internal resolver
-putenv "ERLRESCONF=/home/tornado/erlvxworks/erts-%VSN%/bin/resolv.conf"
-
-#
-# Start epmd (for distribution)
-#
-start_epmd "-daemon"
-
-#
-# Misc environment variables
-#
-putenv "ROOTDIR=/home/tornado/erlvxworks"
-putenv "BINDIR=/home/tornado/erlvxworks/erts-%VSN%/bin"
-putenv "PROGNAME=erl"
-putenv "HOME=/home/tornado/erlvxworks"
-
-#
-# Set heart no reboot mode (to make heart reboot -
-# don't define HEART_DONT_REBOOT at all)
-#
-putenv "HEART_DONT_REBOOT=1"
-
-# To get fullsweep garbage collection on systems with
-# very limited memory, set ERL_FULLSWEEP_AFTER to "0":
-# putenv "ERL_FULLSWEEP_AFTER=0"
-
-#
-# Start Erlang/OTP
-#
-start_erl "-oldshell -heart -sname vxnode -setcookie switch -boot start_sasl"
diff --git a/erts/etc/vxworks/heart_config.c b/erts/etc/vxworks/heart_config.c
deleted file mode 100644
index 7e60e61fbb..0000000000
--- a/erts/etc/vxworks/heart_config.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-/*
- * A basic heart configure module for VxWorks.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-#include <vxWorks.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <rebootLib.h>
-#include <sysLib.h>
-
-/* wd_init is executed to initialize a watchdog (if one is used). */
-int wd_init(timeout, prio)
- int timeout, prio;
-{
-
-}
-
-/* wd_reset should be called every 5th second from heart */
-void wd_reset()
-{
-
-}
-
-/* This routine is called when erlang has closed */
-void heart_reboot()
-{
- if (getenv("HEART_DONT_REBOOT") != NULL) {
- fprintf(stderr, "heart_config: HEART_DONT_REBOOT set, no reboot ...\n");
- } else {
- fprintf(stderr, "heart_config: rebooting ...\n");
- taskDelay(sysClkRateGet() * 5);
- reboot(BOOT_CLEAR);
- }
-}
-
-
-
-
diff --git a/erts/etc/vxworks/heart_config.h b/erts/etc/vxworks/heart_config.h
deleted file mode 100644
index 5ffaaa8c3f..0000000000
--- a/erts/etc/vxworks/heart_config.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-/*
- * This is heart's watchdog interface for VxWorks.
- */
-
-#ifndef _HW_WATCHDOG_H
-#define _HW_WATCHDOG_H
-
-extern void wd_init(int timeout, int prio); /* wd_init initializes the
- watchdog, if one is used. */
-extern void wd_reset(void); /* wd_reset is used by heart to kick
- the watchdog, if one is used. */
-extern void heart_reboot(void); /* reboot is called if heart discovers
- that the Erlang task has stopped sending
- heart beats. It can log system status
- and should reboot VxWorks. */
-
-#endif
diff --git a/erts/etc/vxworks/rdate.c b/erts/etc/vxworks/rdate.c
deleted file mode 100644
index 3e8cc644d0..0000000000
--- a/erts/etc/vxworks/rdate.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vxWorks.h>
-#include <timers.h>
-#ifdef NETDB
-#include <netdb.h>
-#endif
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-/*
- rdate("host") - Set the time from "host".
-*/
-
-/* No getservbyname() available... */
-#define TIME_PORT 37
-
-rdate(host)
-char *host;
-{
- u_long haddr;
-#ifdef NETDB
- struct hostent *hp;
-#endif
- struct sockaddr_in saddr;
- int sock;
- u_long net_time;
- struct timespec t;
-
- if ((haddr = inet_addr(host)) == ERROR) {
-#ifdef NETDB
- if ((hp = gethostbyname(host)) == NULL) {
-#else
- if ((haddr = hostGetByName(host)) == ERROR) {
-#endif
- printf("Host not found.\n");
- return(-1);
- }
-#ifdef NETDB
- memcpy(&haddr, hp->h_addr, sizeof(haddr));
-#endif
- }
- memset(&saddr, 0, sizeof(saddr));
- saddr.sin_family = AF_INET;
- memcpy(&saddr.sin_addr, &haddr, sizeof(haddr));
- saddr.sin_port = htons(TIME_PORT);
- if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
- perror("socket");
- return(-1);
- }
- if (connect(sock, (struct sockaddr *)&saddr, sizeof(saddr)) < 0) {
- perror("connect");
- close(sock);
- return(-1);
- }
- if (read(sock, &net_time, 4) != 4) {
- perror("read");
- close(sock);
- return(-1);
- }
- t.tv_sec = ntohl(net_time);
- t.tv_sec -= 2208988800; /* seconds 1900-01-01 -- 1970-01-01 */
- t.tv_nsec = 0;
- clock_settime(CLOCK_REALTIME, &t);
- close(sock);
- return(0);
-}
diff --git a/erts/etc/vxworks/reclaim.c b/erts/etc/vxworks/reclaim.c
deleted file mode 100644
index d8676b3750..0000000000
--- a/erts/etc/vxworks/reclaim.c
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vxWorks.h>
-#include <version.h>
-#include <string.h>
-#include <types.h>
-#include <sigLib.h>
-#include <ioLib.h>
-#include <iosLib.h>
-#include <fioLib.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <symLib.h>
-#include <sysLib.h>
-#include <sysSymTbl.h>
-#include <loadLib.h>
-#include <taskLib.h>
-#include <taskVarLib.h>
-#include <taskHookLib.h>
-#include <tickLib.h>
-#include <time.h>
-#include <rngLib.h>
-#include <semLib.h>
-#include <selectLib.h>
-#include <sockLib.h>
-#include <a_out.h>
-#include <wdLib.h>
-#include <timers.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <stdarg.h>
-
-#include <stdio.h>
-#include <math.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-
-#define RECLAIM_NO_ALIAS /* No #defines for open/malloc/fopen etc */
-#include "reclaim.h"
-#include "reclaim_private.h"
-
-#undef open
-#undef creat
-#undef socket
-#undef accept
-#undef close
-#undef fopen
-#undef fdopen
-#undef freopen
-#undef fclose
-/* XXX Should do opendir/closedir too... */
-#undef malloc
-#undef calloc
-#undef realloc
-#undef free
-#undef cfree
-
-#ifdef _ARCH_PPC
-#define MAX_FILES_SYM_NAME "maxFiles"
-#else
-#define MAX_FILES_SYM_NAME "_maxFiles"
-#endif
-
-
-/*
- * Use another free() function upon task deletion?
- * Note! When changing free function, the new free function will have to
- * be able to cope with ALL previously used malloced areas, that is
- * it has to be able to find out how things are malloced
- * to free them in the right way!
- */
-static FreeFunction reclaim_free_function = NULL;
-
-/* delete hook handling (see below) */
-static int hook_added = 0; /* Initated at first reclaim_init, an extra
- non MT-safe check that we only get
- initialized once */
-
-/* Forward... */
-static void save_reclaim(WIND_TCB *tcbp);
-
-struct mall_data {
- struct mall_data *next;
- char *self;
-};
-
-struct task_data {
- FUNCPTR version; /* To recognize when we have reloaded */
- int max_files; /* It may change... */
- struct fd_set open_fds;
- struct mall_data *mall_data;
- FUNCPTR delete_hook;
- caddr_t hook_data;
- FILE *open_fps[1]; /* Will be max_files long */
-} *task_data = NULL;
-
-static int max_files = 50; /* default configAll.h */
-
-int reclaim_max_files(void)
-{
- return max_files;
-}
-
-#ifdef DEBUG
-#define check_hook() \
-((task_data != NULL || \
- fdprintf(2,"check_hook() TID = 0x%08x, Called from line %d\n", \
- (unsigned int)taskIdSelf(),\
- __LINE__)) && \
-(task_data != NULL || \
- (taskVarAdd(0, (int *)&task_data) == OK && \
- (task_data = (struct task_data *)\
- calloc(1, sizeof(struct task_data) + max_files*sizeof(FILE *))) != NULL && \
- (task_data->version = (FUNCPTR)save_reclaim) != NULL && \
- (task_data->max_files = max_files) != 0 && \
- fdprintf(2,"taskVar Added for 0x%08x\n",(unsigned int)taskIdSelf()))))
-#else
-#define check_hook() \
-(task_data != NULL || \
- (taskVarAdd(0, (int *)&task_data) == OK && \
- (task_data = (struct task_data *)\
- calloc(1, sizeof(struct task_data) + max_files*sizeof(FILE *))) != NULL && \
- (task_data->version = (FUNCPTR)save_reclaim) != NULL && \
- (task_data->max_files = max_files) != 0))
-#endif
-
-/*
- * Global initialization of the reclaim data structures, mainly
- * the max_files variable. This HAS to be called by some task before
- * the first task that utilizes this exit's, preferrably before any
- * task makes the first use of this library.
- */
-STATUS reclaim_init(void)
-{
- int *mp;
- SYM_TYPE type;
- struct task_data *tdp;
- int i;
-
- if (!hook_added) {
- /* race condition */
- ++hook_added;
- /* Try to find the maxFiles value */
- if (symFindByNameAndType(sysSymTbl, MAX_FILES_SYM_NAME, (char **)&mp,
- &type,
- N_EXT | N_BSS, N_EXT | N_BSS) == OK ||
- symFindByNameAndType(sysSymTbl, MAX_FILES_SYM_NAME, (char **)&mp,
- &type,
- N_EXT | N_DATA, N_EXT | N_DATA) == OK) {
-
-#ifdef DEBUG
- fdprintf(2, "Found maxFiles=%d\n", *mp);
-#endif
- if (*mp <= FD_SETSIZE)
- max_files = *mp;
- else
- max_files = FD_SETSIZE;
- }
- if (task_data != NULL && task_data->max_files != max_files) {
- /* fix our own iff we have one */
- if ((tdp = (struct task_data *)
- realloc(task_data, sizeof(struct task_data) +
- max_files*sizeof(FILE *))) != NULL) {
- task_data = tdp;
- for (i = task_data->max_files; i < max_files; i++)
- task_data->open_fps[i] = NULL;
- task_data->max_files = max_files;
- }
- }
- /* Make sure taskVariables are deleted AFTER our hook is run. */
- taskVarInit();
- if(taskDeleteHookAdd((FUNCPTR)save_reclaim) != OK) {
- fprintf(stderr,
- "Panic: taskDeleteHook cannot be added for reclaim.\n");
- return ERROR;
- }
- return OK;
- } else
- return ERROR;
-}
-
-/* N.B.!! We do *not* execute in the context of the dying task here,
- but rather that of tExcTask - we do get a pointer to the task's
- TCB though - this pointer is in fact also the task's ID. */
-static void save_reclaim(WIND_TCB *tcbp)
-{
- int i, var, oldfd;
- struct task_data *tdp;
- struct mall_data *mdp, *mdnextp;
-
- if ((var = taskVarGet((int)tcbp, (int *)&task_data)) != ERROR &&
- var != 0) {
- tdp = (struct task_data *)var;
- if (tdp->version == (FUNCPTR)save_reclaim) { /* Only handle our own */
-#ifdef DEBUG
- fdprintf(2, "Reclaiming for task id 0x%x:\nFiles: ", (int)tcbp);
-#endif
- /* Ugh! VxWorks doesn't even flush stdout/err - we need to
- get at those (which are task-private of course, i.e. we
- can't just do fflush(stdout) here) - we could be really
- pedantic and try to redefine stdout/err (which "are"
- function calls) too, snarfing the values when they are
- used - but besides the overhead this is problematic since
- they are actually #defines already... We'll peek in the
- TCB instead (no documentation of course). And of course,
- we must also meddle with the *file descriptor* indirections,
- or we'll just flush out on tExcTask's descriptors... */
- for (i = 1; i <= 2; i++) {
- if (tcbp->taskStdFp[i] != NULL) {
-#ifdef DEBUG
- fdprintf(2, "fflush(%s) ", i == 1 ? "stdout" : "stderr");
-#endif
- oldfd = ioTaskStdGet(0, i);
- ioTaskStdSet(0, i, tcbp->taskStd[i]);
- fflush(tcbp->taskStdFp[i]);
- ioTaskStdSet(0, i, oldfd);
- }
- }
- for (i = 3; i < tdp->max_files; i++) {
- if (FD_ISSET(i, &tdp->open_fds)) {
-#ifdef DEBUG
- fdprintf(2, "close(%d) ", i);
-#endif
- (void) close(i);
- }
- if (tdp->open_fps[i] != NULL) {
-#ifdef DEBUG
- fdprintf(2, "fclose(%0x%x) ", (int)tdp->open_fps[i]);
-#endif
- (void) fclose(tdp->open_fps[i]);
- }
- }
- i = 0;
- mdp = tdp->mall_data;
- while (mdp != NULL) {
- mdnextp = mdp->next;
- if(reclaim_free_function != NULL)
- (*reclaim_free_function)(mdp->self);
- else
- free(mdp->self);
- i++;
- mdp = mdnextp;
- }
-#ifdef DEBUG
- fdprintf(2, "\nFreeing memory: total %d mallocs\n", i);
-#endif
-
- if (tdp->delete_hook != NULL) {
-#ifdef DEBUG
- fdprintf(2, "Calling delete hook at 0x%08x\n", tdp->delete_hook);
-#endif
- (*tdp->delete_hook)(tdp->hook_data);
-#ifdef DEBUG
- fdprintf(2, "Called delete hook at 0x%08x\n", tdp->delete_hook);
-#endif
- }
-#ifdef DEBUG
- fdprintf(2, "Freeing own mem at 0x%08x\n", tdp);
-#endif
- (void) free((char *)tdp);
-#ifdef DEBUG
- fdprintf(2, "Freed own mem at 0x%08x, done (0x%08x)\n**********\n", tdp,
- taskIdSelf());
- checkStack(0);
-#endif
- }
- }
-#ifdef DEBUG
- else
- fdprintf(2, "No task data found for id 0x%x, var = %d\n", (int)tcbp, var);
-#endif
-}
-
-/*
- * This sets another free function to be used by the task deletion hook.
- * The free function HAS to be able to free ANY type of dynamically allocated
- * memory that can be in the task data list of allocated memory, that is
- * also memory that's allocated before the free function was set.
- * A "user-supplied" free function is GLOBAL to the system!!!
- * A race condition is present, a task delete hook may be running when this
- * function is called, that may not be especially funny...
- */
-void set_reclaim_free_function(FreeFunction f){
- reclaim_free_function = f;
-}
-
-void save_delete_hook(FUNCPTR func, caddr_t parm)
-{
- if (check_hook()) {
- task_data->delete_hook = func;
- task_data->hook_data = parm;
- }
-}
-
-/*
- * plain_malloc is only used by spawn_start; plain_free by call_proc;
- * save_fd is used by both.
- */
-void *plain_malloc(size_t size){
- return(malloc(size));
-}
-
-void *plain_realloc(void *ptr, size_t size){
- return(realloc(ptr, size));
-}
-
-void plain_free(void *ptr){
- free(ptr);
-}
-
-void save_fd(int fd){
- if (fd >= 0 && check_hook() && fd < task_data->max_files)
- FD_SET(fd, &task_data->open_fds);
-}
-
-int save_open(char *path, int flags, /*mode_t mode*/ ...){
- int fd;
- mode_t mode = 0;
- if(flags & O_CREAT){
- va_list pvar;
- va_start(pvar,flags);
-#ifdef __GNUC__
-#warning save_open() gives three known alignment warnings.
-#endif
- mode = va_arg(pvar, mode_t);
- va_end(pvar);
- }
- if ((fd = open(path, flags, mode)) >= 0 && check_hook())
- FD_SET(fd, &task_data->open_fds);
- return(fd);
-}
-
-int save_creat(char *path, int mode){
- int fd;
- if ((fd = creat(path, mode)) >= 0 && check_hook())
- FD_SET(fd, &task_data->open_fds);
- return(fd);
-}
-
-int save_socket(int domain, int type, int protocol){
- int fd;
- if ((fd = socket(domain, type, protocol)) >= 0 && check_hook())
- FD_SET(fd, &task_data->open_fds);
- return(fd);
-}
-
-int save_accept(int s, struct sockaddr *addr, int *addrlen){
- int fd;
- if ((fd = accept(s, addr, addrlen)) >= 0 && check_hook())
- FD_SET(fd, &task_data->open_fds);
- return(fd);
-}
-
-int save_close(int fd){
- if (fd >= 0 && fd <= FD_SETSIZE && check_hook())
- FD_CLR(fd, &task_data->open_fds);
- return(close(fd));
-}
-
-/* The dealing with FILE *'s below isn't strictly correct, we assume
- that one never has several pointing to the same fd - in the unlikely
- event that one does, all but the last one opened is forgotten */
-FILE *save_fopen(const char *filename, char *type){
- FILE *fp;
-
- if ((fp = fopen(filename, type)) != NULL &&
- check_hook() && fileno(fp) < task_data->max_files)
- task_data->open_fps[fileno(fp)] = fp;
- return(fp);
-}
-
-FILE *save_fdopen(int fd, char *type){
- FILE *fp;
-
- if ((fp = fdopen(fd, type)) != NULL &&
- check_hook() && fileno(fp) < task_data->max_files) {
- task_data->open_fps[fileno(fp)] = fp;
- FD_CLR(fd, &task_data->open_fds);
- }
- return(fp);
-}
-
-FILE *save_freopen(char *filename, char *type, FILE *stream){
- FILE *fp;
-
- if (check_hook()) {
- if(fileno(stream) < task_data->max_files &&
- task_data->open_fps[fileno(stream)] == stream)
- task_data->open_fps[fileno(stream)] = NULL;
- if ((fp = freopen(filename, type, stream)) != NULL &&
- fileno(fp) < task_data->max_files)
- task_data->open_fps[fileno(fp)] = fp;
- } else
- fp = freopen(filename, type, stream);
- return(fp);
-}
-
-int save_fclose(FILE *stream){
- if (check_hook() && fileno(stream) < task_data->max_files &&
- task_data->open_fps[fileno(stream)] == stream)
- task_data->open_fps[fileno(stream)] = NULL;
- return(fclose(stream));
-}
-
-/* We link all malloc'ed segments by adding a couple of pointers
- at the *end* - that way we can return the address malloc gave
- (need to make sure we align those pointers) */
-
-/*
- #define MALL_MARGIN 32
- #define save_mall_size(size) save_mall_size1((size) + 2 * MALL_MARGIN)
- #define save_mall_size1(size) \
- (((size) + sizeof(char *) - 1) & (unsigned long)(-sizeof(char*)))
-
- #define save_mall_enq(ptr, mdp) save_mall_enq1((ptr), (mdp) - MALL_MARGIN)
- #define save_mall_enq1(ptr, mdp) \
- (((struct mall_data *)(mdp))->self = (ptr), \
- ((struct mall_data *)(mdp))->next = task_data->mall_data, \
- task_data->mall_data = (struct mall_data *)(mdp))
-*/
-#define save_mall_size(size) \
-(((size) + sizeof(char *) - 1) & (unsigned long)(-sizeof(char*)))
-#define save_mall_enq(ptr, mdp) \
-(((struct mall_data *)(mdp))->self = (ptr), \
- ((struct mall_data *)(mdp))->next = task_data->mall_data, \
- task_data->mall_data = (struct mall_data *)(mdp))
-
-
-#define save_mall_deq(ptr) { \
- struct mall_data *mdp = task_data->mall_data, \
- **prevnext = &task_data->mall_data; \
- while (mdp != NULL && mdp->self != (ptr)) { \
- prevnext = &mdp->next; \
- mdp = mdp->next; \
- } \
- if (mdp != NULL) *prevnext = mdp->next; \
-}
-
-void *save_malloc2(size_t size, MallocFunction mf){
- unsigned msize = save_mall_size(size);
- char *ptr;
-
- if ((ptr = (*mf)(msize + sizeof(struct mall_data))) != NULL &&
- check_hook())
- save_mall_enq((void *) ptr, (void *) (ptr + msize));
- return((void *) ptr);
-}
-
-void *save_malloc(size_t size){
- return save_malloc2(size, &malloc);
-}
-
-void *save_calloc2(size_t nelem, size_t elsize, CallocFunction cf){
- unsigned msize = save_mall_size(nelem * elsize);
- char *ptr;
-
- if ((ptr = (*cf)(1, msize + sizeof(struct mall_data))) != NULL &&
- check_hook())
- save_mall_enq((void *) ptr, (void *) (ptr + msize));
- return((void *) ptr);
-}
-
-void *save_calloc(size_t nelem, size_t elsize){
- return save_calloc2(nelem,elsize,&calloc);
-}
-
-void *save_realloc2(void *optr, size_t size, ReallocFunction rf){
- unsigned msize = save_mall_size(size);
- char *ptr;
-
- /* First we must dequeue the old save block, after that
- we try to realloc, if that succeeds we enqueue the new
- block, if it fails we have to enqueue the old one anew
- so we must deduce the size of that old block first. */
-
- struct mall_data *mdp0 = task_data->mall_data,
- **prevnext0 = &task_data->mall_data;
- while (mdp0 != NULL && mdp0->self != (((char *) optr))) {
- prevnext0 = &mdp0->next;
- mdp0 = mdp0->next;
- }
- /* mdp0 == NULL (can) mean that the block that is realloced
- have been malloced with an (for example) ordinary malloc
- (that is not a save_malloc). This is handled like: no dequeing
- is done of that block, the new block is enqueued */
- if (mdp0 != NULL)
- save_mall_deq(((char *) optr));
-
- if ((ptr = (*rf)(optr, msize + sizeof(struct mall_data))) != NULL &&
- check_hook())
- save_mall_enq((void *) ptr, (void *) (ptr + msize));
- else if (mdp0 != NULL)
- /* re-enqueue the old block that has just been dequeued */
- save_mall_enq(((char *) optr), mdp0);
-
- return((void *) ptr);
-}
-
-void *save_realloc(void *optr, size_t size){
- return save_realloc2(optr,size,&realloc);
-}
-
-void save_free2(void *ptr, FreeFunction ff)
-{
- if (check_hook())
- save_mall_deq(((char *) ptr));
- (*ff)(ptr);
-}
-
-void save_free(void *ptr){
- save_free2(ptr,&free);
-}
-
-void save_cfree2(void *ptr, CfreeFunction cf)
-{
- if (check_hook())
- save_mall_deq(((char *)ptr));
- (*cf)(ptr);
-}
-
-void save_cfree(void *ptr){
- save_cfree2(ptr,&cfree);
-}
-
diff --git a/erts/etc/vxworks/reclaim.h b/erts/etc/vxworks/reclaim.h
deleted file mode 100644
index ca9aa8f6be..0000000000
--- a/erts/etc/vxworks/reclaim.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-#ifndef _RECLAIM_H
-#define _RECLAIM_H
-
-
-/* The Erlang release for VxWorks includes a simple mechanism for
- "resource reclamation" at task exit - it allows replacement of the
- functions that open/close "files" and malloc/free memory with versions
- that keep track, to be able to "reclaim" file descriptors and memory
- when a task exits (regardless of *how* it exits).
-
- The interface to this mechanism is made available via this file,
- with the following caveats:
-
- - The interface may change (or perhaps even be removed, though that
- isn't likely until VxWorks itself provides similar functionality)
- in future releases - i.e. you must always use the version of this
- file that comes with the Erlang release you are using.
-
- - Disaster is guaranteed if you use the mechanism incorrectly (see
- below for the correct way), e.g. allocate memory with the "tracking"
- version of malloc() and free it with the "standard" version of free().
-
- - The mechanism (of course) incurs some performance penalty - thus
- for a simple program you may be better off with careful programming,
- making sure that you do whatever close()/free()/etc calls that are
- appropriate at all exit points (though if you need to guard against
- taskDelete() etc, things get messy...).
-
- To use the mechanism, simply program your application normally, i.e.
- use open()/close()/malloc()/free() etc as usual, but #include this
- file before any usage of the relevant functions. NOTE: To avoid the
- "disaster" mentioned above, you *must* #include it in *all* (or none)
- of the files that manipulate a particular file descriptor, allocated
- memory area, etc.
-
- Before any task that uses this utility is loaded (which includes the
- erlang emulator), the reclaim.o object file has to be loaded and
- the function reclaim_init() has to be called. reclaim_init should be called
- only _ONCE_ in a systems lifetime and has only a primitive guard
- against multiple calls (i.e. a global variable is checked). Therefore
- the initialization should occur either in the start script of the system
- or (even better) in the usrInit() part of system initialization. The
- object file itself should be loaded only once, so linking it with the
- kernel is a good idea, linking with each application is an extremely bad
- dito. Make really sure that it's loaded _before_ any application that
- uses it if You want to load it in the startup script.
-
- If You dont want to have #define's for the posix/stdio names
- of the file/memory operations (i.e. no #define malloc save_malloc etc),
- #define RECLAIM_NO_ALIAS in Your source before reclaim.h is included.
-*/
-
-#include <vxWorks.h> /* STATUS, size_t */
-#include <sockLib.h> /* struct sockaddr */
-#include <memLib.h>
-#include <stdio.h> /* FILE */
-
-#if defined(__STDC__)
-#define _RECLAIM_DECL_FUN(RetType, FunName, ParamList) \
-extern RetType FunName ParamList
-#define _RECLAIM_VOID_PTR void *
-#define _RECLAIM_VOID_PARAM void
-#define _RECLAIM_VOID_RETURN void
-#elif defined(__cplusplus)
-#define _RECLAIM_DECL_FUN(RetType, FunName, ParamList) \
-extern "C" RetType FunName ParamList
-#define _RECLAIM_VOID_PTR void *
-#define _RECLAIM_VOID_PARAM
-#define _RECLAIM_VOID_RETURN void
-#else
-#define _RECLAIM_DECL_FUN(RetType, FunName, Ignore) extern RetType FunName()
-#define DECLARE_FUNCTION_TYPE(RetType, Type, PList) typedef RetType (* Type)()
-#define _RECLAIM_VOID_PTR char *
-#define _RECLAIM_VOID_PARAM
-#define _RECLAIM_VOID_RETURN
-#endif /* __STDC__ / __cplusplus */
-
-/* Initialize the facility, on a per system basis. */
-_RECLAIM_DECL_FUN(STATUS, reclaim_init, (_RECLAIM_VOID_PARAM));
-
-/* File descriptor operations */
-_RECLAIM_DECL_FUN(int,save_open,(char *, int, ...));
-_RECLAIM_DECL_FUN(int,save_creat,(char *, int));
-_RECLAIM_DECL_FUN(int,save_socket,(int, int, int));
-_RECLAIM_DECL_FUN(int,save_accept,(int, struct sockaddr *, int *));
-_RECLAIM_DECL_FUN(int,save_close,(int));
-/* Interface to add an fd to what's reclaimed even though it's not open with
- one of the above functions */
-_RECLAIM_DECL_FUN(_RECLAIM_VOID_RETURN, save_fd, (int fd));
-#ifndef RECLAIM_NO_ALIAS
-#define open save_open
-#define creat save_creat
-#define socket save_socket
-#define accept save_accept
-#define close save_close
-#endif
-/* Stdio file operations */
-_RECLAIM_DECL_FUN(FILE *, save_fopen, (const char *, char *));
-_RECLAIM_DECL_FUN(FILE *, save_fdopen, (int, char *));
-_RECLAIM_DECL_FUN(FILE *, save_freopen, (char *, char *, FILE *));
-_RECLAIM_DECL_FUN(int, save_fclose, (FILE *));
-/* XXX Should do opendir/closedir too... */
-#ifndef RECLAIM_NO_ALIAS
-#define fopen save_fopen
-#define fdopen save_fdopen
-#define freopen save_freopen
-#define fclose save_fclose
-#endif
-/* Memory allocation */
-_RECLAIM_DECL_FUN(_RECLAIM_VOID_PTR, save_malloc, (size_t));
-_RECLAIM_DECL_FUN(_RECLAIM_VOID_PTR, save_calloc, (size_t, size_t));
-_RECLAIM_DECL_FUN(_RECLAIM_VOID_PTR, save_realloc,
- (_RECLAIM_VOID_PTR, size_t));
-_RECLAIM_DECL_FUN(void, save_free, (_RECLAIM_VOID_PTR));
-_RECLAIM_DECL_FUN(void, save_cfree, (_RECLAIM_VOID_PTR));
-#ifndef RECLAIM_NO_ALIAS
-#define malloc save_malloc
-#define calloc save_calloc
-#define realloc save_realloc
-#define free save_free
-#define cfree save_cfree
-#endif
-/* Generic interfaces to malloc etc... */
-_RECLAIM_DECL_FUN(_RECLAIM_VOID_PTR, plain_malloc, (size_t));
-_RECLAIM_DECL_FUN(_RECLAIM_VOID_PTR, plain_realloc,
- (_RECLAIM_VOID_PTR, size_t));
-_RECLAIM_DECL_FUN(void, plain_free, (_RECLAIM_VOID_PTR));
-#endif /* _RECLAIM_H */
-
-
-
-
diff --git a/erts/etc/vxworks/reclaim_private.h b/erts/etc/vxworks/reclaim_private.h
deleted file mode 100644
index 4ed935bee2..0000000000
--- a/erts/etc/vxworks/reclaim_private.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-#ifndef _RECLAIM_PRIVATE_H
-#define _RECLAIM_PRIVATE_H
-/*
- * Private header for the reclaim facility, also included in the emulator.
- */
-
-#include "reclaim.h"
-
-/* Typedefs for ANSI memory allocation function pointers */
-typedef void *(*MallocFunction)(size_t);
-typedef void *(*ReallocFunction)(void *, size_t);
-typedef void *(*CallocFunction)(size_t, size_t);
-typedef void (*FreeFunction)(void *);
-typedef STATUS (*CfreeFunction)(char *);
-
-/* Functions for internal use and use by the emulator */
-extern int reclaim_max_files(void);
-extern void set_reclaim_free_function(FreeFunction f);
-extern void save_delete_hook(FUNCPTR func, caddr_t parm);
-extern void *save_malloc2(size_t size, MallocFunction mf);
-extern void *save_calloc2(size_t nelem, size_t elsize, CallocFunction cf);
-extern void *save_realloc2(void *optr, size_t size, ReallocFunction rf);
-extern void save_free2(void *ptr, FreeFunction ff);
-extern void save_cfree2(void *ptr, CfreeFunction ff);
-
-#endif /* _RECLAIM_PRIVATE_H */
diff --git a/erts/etc/vxworks/resolv.conf b/erts/etc/vxworks/resolv.conf
deleted file mode 100644
index 85c89d64c4..0000000000
--- a/erts/etc/vxworks/resolv.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-domain du.uab.ericsson.se
-nameserver 134.138.176.16
-nameserver 136.225.254.224
-nameserver 134.138.128.25
-search du.uab.ericsson.se uab.ericsson.se ericsson.se
-lookup bind file
diff --git a/erts/etc/vxworks/vxcall.c b/erts/etc/vxworks/vxcall.c
deleted file mode 100644
index 3362d05fc5..0000000000
--- a/erts/etc/vxworks/vxcall.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vxWorks.h>
-#include <symLib.h>
-#include <sysSymTbl.h>
-#include <a_out.h>
-
-extern char *malloc();
-static STATUS lookup();
-
-/*
- Little utility to convert from Unix' argv,argv calling conventions to
- VxWorks' arg0,arg1,arg2,...
- Will do limited argument parsing - no parenthesis around nor commas
- between the args, which may be "-enclosed strings (without \ escapes),
- '-enclosed characters (also no \ escapes), integers, or symbols.
-*/
-
-int vxcall(argc, argv)
-int argc;
-char **argv;
-{
- int vxarg[10]; /* Max 10 args can be passed */
- FUNCPTR entry;
- SYM_TYPE type;
- int i, l;
-
-#ifdef DEBUG
- fdprintf(2, "vxcall:");
- for (i = 1; i < argc; i++)
- fdprintf(2, " %s", argv[i]);
- fdprintf(2, "\n");
-#endif
- if (lookup(argv[1], N_EXT | N_TEXT, (char **)&entry) != OK)
- return(ERROR);
- /* Do limited "C" parsing of the args */
- for (i = 0; i < 10; i++) {
- if (i < argc - 2) {
- switch (argv[i+2][0]) {
- case '"':
- l = strlen(argv[i+2]) - 1;
- if (argv[i+2][l] != '"')
- return(ERROR);
- /* just strip the quotes - should do \escapes within... */
- vxarg[i] = (int)&argv[i+2][1];
- argv[i+2][l] = '\0';
- break;
- case '\'':
- if (argv[i+2][2] != '\'')
- return(ERROR);
- vxarg[i] = argv[i+2][1]; /* should do \escapes... */
- break;
- case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- vxarg[i] = atoi(argv[i+2]); /* should do octal, hex, float.. */
- break;
- default:
- if (lookup(argv[i+2], 0, (char **)&vxarg[i]) != OK)
- return(ERROR);
- }
- } else
- vxarg[i] = 0;
- }
-#ifdef DEBUG
- fdprintf(2, "calling 0x%x(0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x)\n",
- entry, vxarg[0], vxarg[1], vxarg[2], vxarg[3], vxarg[4],
- vxarg[5], vxarg[6], vxarg[7], vxarg[8], vxarg[9]);
-#endif
- return((*entry)(vxarg[0], vxarg[1], vxarg[2], vxarg[3], vxarg[4],
- vxarg[5], vxarg[6], vxarg[7], vxarg[8], vxarg[9]));
-}
-
-/* Entry point for unix:cmd in post-4.1 erlang - uses "sh -c 'cmd...'" */
-int sh(argc, argv)
-int argc;
-char **argv;
-{
- int ll = strlen(argv[argc-1]) - 1;
-
-#ifdef DEBUG
- int i;
- fdprintf(2, "sh:");
- for (i = 1; i < argc; i++)
- fdprintf(2, " %s", argv[i]);
- fdprintf(2, "\n");
-#endif
- if (strcmp(argv[1], "-c") != 0 ||
- argv[2][0] != '\'' || argv[argc-1][ll] != '\'')
- return(ERROR);
- argv[argc-1][ll] = '\0'; /* delete trailing ' */
- argv[2]++; /* skip leading ' (*after* the above!) */
- return(vxcall(argc-1, argv+1));
-}
-
-/* Lookup symbol; get address for text symbols, value (assuming int)
- otherwise; return OK or ERROR on failure
- Symbol name is null-terminated and without the leading '_' */
-STATUS
-lookup(sym, stype, value)
-char *sym, **value;
-int stype;
-{
- char buf[256];
- char *symname = buf;
- int len, ret;
- SYM_TYPE type;
-
- len = strlen(sym);
- if (len > 254 && (symname = malloc(len+2)) == NULL)
- return(ERROR);
-#if defined _ARCH_PPC || defined SIMSPARCSOLARIS
- /* GCC for PPC or SIMSPARC doesn't add a leading _ to symbols */
- strcpy(symname, sym);
-#else
- sprintf(symname, "_%s", sym);
-#endif
- ret = (stype != 0) ?
- symFindByNameAndType(sysSymTbl, symname, value, &type, stype, stype) :
- symFindByName(sysSymTbl, symname, value, &type);
- if (symname != buf)
- free(symname);
- if (ret == OK && (type & N_TEXT) == 0) /* get value */
- *value = (char *)*((int *)*value);
- return(ret);
-}
diff --git a/erts/etc/vxworks/wd_example.c b/erts/etc/vxworks/wd_example.c
deleted file mode 100644
index 0e3a6a1cb2..0000000000
--- a/erts/etc/vxworks/wd_example.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * %CopyrightBegin%
- *
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
- *
- * The contents of this file are subject to the Erlang Public License,
- * Version 1.1, (the "License"); you may not use this file except in
- * compliance with the License. You should have received a copy of the
- * Erlang Public License along with this software. If not, it can be
- * retrieved online at http://www.erlang.org/.
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * %CopyrightEnd%
- */
-/*
- * File: frc5te_wd.c
- * Purpose: Watchdog NMI handling for FORCE 5TE
- *
- * Description:
- * The watchdog handler routines are system specific. A program that
- * wants to utilize a hardware watchdog should call wd_init and test
- * the return value. If wd_init returns true (!0); there is a hardware
- * watchdog, and that watchdog has been activated. If no watchdog exists,
- * wd_init returns false (0).
- *
- * To keep the watchdog happy, call wd_reset at least every X seconds,
- * where X is the number of seconds specified in the call to wd_init.
- *
- * The watchdog can be disarmed by setting the variable wd_disarmed to 1,
- * and armed again by setting the same variable to 0. Watchdog status
- * information can be retrieved using the function wd_status.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-#include <frc5e.h>
-#include <logLib.h>
-#include <taskLib.h>
-#include <sysLib.h>
-#include <stdio.h>
-#include "hw_watchdog.h"
-
-/* prototypes */
-extern sysNMIConnect();
-#ifdef __STDC__
-void wd_keeper(int);
-void wd_nmi_int(UINT8);
-void wd_status(void);
-#else
-void wd_keeper();
-void wd_nmi_int();
-void wd_status();
-#endif
-
-#define WD_NMI_MIN_DELAY 0.830 /* Min time before watchdog NMI (in seconds) */
-#define WD_RESET_FREQUENCY (WD_NMI_MIN_DELAY / 2) /* how often the timer is reset */
-
-#define WD_KEEPER_STACK_SIZE 10000
-
-/* global variables */
-extern int spTaskOptions;
-static volatile int wd_count_startval; /* start value set by wd_init */
-static volatile int wd_count; /* counter for wd_keeper */
-volatile int wd_disarmed = 0; /* debug feature */
-
-/* wd_init is executed to initialize the watchdog. It spawns the task */
-/* wd_keeper and returns true (non-zero) if a hardware watchdog exists, */
-/* or returns false (zero) otherwise. */
-int wd_init(timeout, prio)
- int timeout, prio;
-{
- taskSpawn("wd_keeper", prio, spTaskOptions, WD_KEEPER_STACK_SIZE,
- (FUNCPTR)wd_keeper, timeout,0,0,0,0,0,0,0,0,0);
- return !0; /* watchdog exists */
-}
-
-
-/* wd_reset is called as an alive-signal from the supervisor process. */
-/* If there is no call to this function within a certain time, the */
-/* watchdog will reboot the system. */
-void wd_reset()
-{
- wd_count = wd_count_startval;
-}
-
-
-/* wd_keeper runs as a separate task and resets the watchdog timer */
-/* before an NMI is generated. This task uses the counter wd_count to */
-/* decide if it should exit or keep resetting the timer. */
-/* Note! This task must run with higher priority than the application! */
-void wd_keeper(timeout)
- int timeout;
-{
- int wd_delay = sysClkRateGet() * WD_RESET_FREQUENCY;
- wd_count_startval = (int)(timeout / WD_RESET_FREQUENCY);
- wd_count = wd_count_startval;
-
- /* Connect and enable level 15 interrupts */
- sysNMIConnect((VOIDFUNCPTR) wd_nmi_int, WD_NMI, WD_NMI);
- *(char *)FRC5CE_GEN_PURPOSE2_REG |= FRC5CE_NMI_ENABLE;
-
- while ((wd_count > 0) || wd_disarmed) {
- *(char *)FRC5CE_VME_A32MAP_REG |= FRC5CE_WATCHDOG_ENABLE;
- taskDelay(wd_delay);
- if (!wd_disarmed) wd_count--;
- else wd_count = wd_count_startval;
- }
- logMsg("Watchdog keeper exits. No alive signal from application in %d seconds.\n",wd_count_startval * WD_RESET_FREQUENCY,0,0,0,0,0);
-}
-
-
-/* wd_nmi_int is the function connected to the watchdog interrupt. */
-/* It will report the failure to reset the watchdog timer. */
-void wd_nmi_int(type)
- UINT8 type;
-{
- switch(type) {
- case WD_NMI:
- logMsg("Watchdog interrupt! System will reboot.\n",0,0,0,0,0,0);
- break;
- default:
- logMsg("Bad type (%d) in call to watchdog interrupt handler.\n",type,0,0,0,0,0);
- break;
- }
-}
-
-
-/* wd_status displays the current value of the counter. */
-void wd_status()
-{
- fprintf(stderr, "Watchdog is %sarmed.\n", wd_disarmed ? "dis" : "");
- fprintf(stderr, "Counter value: %d\n", wd_count);
- fprintf(stderr, "Start value is: %d (%d seconds)\n",
- wd_count_startval, (int)(wd_count_startval * WD_RESET_FREQUENCY));
-}
diff --git a/erts/etc/win32/Makefile b/erts/etc/win32/Makefile
index 400e5c5bba..cc9021da70 100644
--- a/erts/etc/win32/Makefile
+++ b/erts/etc/win32/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -59,14 +59,14 @@ opt debug all clean depend:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec:
- $(INSTALL_DIR) $(RELSYSDIR)/bin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(ROOTSYSDIR)/usr/include
- $(INSTALL_DIR) $(ROOTSYSDIR)/usr/lib
- $(INSTALL_DIR) $(ROOTSYSDIR)/usr/lib/icons
- $(INSTALL_PROGRAM) $(INSTALL_PROGS) $(RELSYSDIR)/bin
- $(INSTALL_DATA) $(INSTALL_SRC) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(INSTALL_ICONS) $(ROOTSYSDIR)/usr/lib/icons
+ $(INSTALL_DIR) "$(RELSYSDIR)/bin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(ROOTSYSDIR)/usr/include"
+ $(INSTALL_DIR) "$(ROOTSYSDIR)/usr/lib"
+ $(INSTALL_DIR) "$(ROOTSYSDIR)/usr/lib/icons"
+ $(INSTALL_PROGRAM) $(INSTALL_PROGS) "$(RELSYSDIR)/bin"
+ $(INSTALL_DATA) $(INSTALL_SRC) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(INSTALL_ICONS) "$(ROOTSYSDIR)/usr/lib/icons"
release_docs release_docs_spec docs:
diff --git a/erts/etc/win32/erlsrv/erlsrv_service.c b/erts/etc/win32/erlsrv/erlsrv_service.c
index 242e2905a9..58738ee445 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2012. 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
@@ -104,11 +104,10 @@ static VOID WINAPI handler(DWORD control){
log_debug(buffer);
switch(control){
case SERVICE_CONTROL_STOP:
+ case SERVICE_CONTROL_SHUTDOWN:
set_stop_pending(30000,1);
SetEvent(eventStop);
return;
- case SERVICE_CONTROL_SHUTDOWN:
- return;
default:
reset_current();
break;
diff --git a/erts/etc/win32/nsis/Makefile b/erts/etc/win32/nsis/Makefile
index 6a93c5153d..f377a68c69 100644
--- a/erts/etc/win32/nsis/Makefile
+++ b/erts/etc/win32/nsis/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2011. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -44,14 +44,14 @@ TARGET_DIR = $(RELEASE_PATH)
ifeq ($(MSYSTEM),MINGW32)
MAKENSISFLAGS = //V2
- WTESTROOT=$(shell (msys2win_path.sh $(RELEASE_PATH)))
- WTARGET_DIR=$(shell (msys2win_path.sh $(TARGET_DIR)))
+ WTESTROOT=$(shell (msys2win_path.sh "$(RELEASE_PATH)"))
+ WTARGET_DIR=$(shell (msys2win_path.sh "$(TARGET_DIR)"))
else
MAKENSISFLAGS = /V2
- WTESTROOT=$(shell (cygpath -d $(RELEASE_PATH) 2>/dev/null || cygpath -w $(RELEASE_PATH)))
- WTARGET_DIR=$(shell (cygpath -d $(TARGET_DIR) 2>/dev/null || cygpath -d $(TARGET_DIR)))
+ WTESTROOT=$(shell (cygpath -d "$(RELEASE_PATH)" 2>/dev/null || cygpath -w "$(RELEASE_PATH)"))
+ WTARGET_DIR=$(shell (cygpath -d "$(TARGET_DIR)" 2>/dev/null || cygpath -d "$(TARGET_DIR)"))
endif
@@ -74,7 +74,7 @@ release_spec:
echo '!define ERTS_VERSION "$(VSN)"' >> $(VERSION_HEADER);\
echo '!define TESTROOT "$(WTESTROOT)"' >> $(VERSION_HEADER);\
echo '!define OUTFILEDIR "$(WTARGET_DIR)"' >> $(VERSION_HEADER);\
- if [ -f $(RELEASE_PATH)/docs/doc/index.html ];\
+ if [ -f "$(RELEASE_PATH)/docs/doc/index.html" ];\
then\
echo '!define HAVE_DOCS 1' >> $(VERSION_HEADER); \
fi;\
@@ -91,13 +91,13 @@ release_spec:
fi;\
if [ '!' -z "$(REDIST_FILE)" -a '!' -z "$(REDIST_DLL_VERSION)" ];\
then \
- cp $(REDIST_FILE) $(RELEASE_PATH)/$(REDIST_TARGET);\
+ cp $(REDIST_FILE) "$(RELEASE_PATH)/$(REDIST_TARGET);"\
echo '!define HAVE_REDIST_FILE 1' >> $(VERSION_HEADER); \
echo '!define REDIST_DLL_VERSION "$(REDIST_DLL_VERSION)"' >> $(VERSION_HEADER);\
echo '!define REDIST_DLL_NAME "$(REDIST_DLL_NAME)"' >> $(VERSION_HEADER);\
echo '!define REDIST_EXECUTABLE "$(REDIST_TARGET)"' >> $(VERSION_HEADER);\
fi;\
- if [ -f $(RELEASE_PATH)/docs/doc/index.html ];\
+ if [ -f "$(RELEASE_PATH)/docs/doc/index.html" ];\
then \
echo '!define HAVE_DOCS 1' >> $(VERSION_HEADER); \
fi;\
diff --git a/erts/etc/win32/nsis/erlang20.nsi b/erts/etc/win32/nsis/erlang20.nsi
index fb0eff3867..c5ada9e3b3 100644
--- a/erts/etc/win32/nsis/erlang20.nsi
+++ b/erts/etc/win32/nsis/erlang20.nsi
@@ -4,6 +4,25 @@
; Original example written by Joost Verburg
; Modified for Erlang by Patrik
+;
+; %CopyrightBegin%
+;
+; Copyright Ericsson AB 2012. All Rights Reserved.
+;
+; The contents of this file are subject to the Erlang Public License,
+; Version 1.1, (the "License"); you may not use this file except in
+; compliance with the License. You should have received a copy of the
+; Erlang Public License along with this software. If not, it can be
+; retrieved online at http://www.erlang.org/.
+;
+; Software distributed under the License is distributed on an "AS IS"
+; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+; the License for the specific language governing rights and limitations
+; under the License.
+;
+; %CopyrightEnd%
+;
+
; Verbosity does not come naturally with MUI, have to set it back now and then.
!verbose 1
!define MUI_MANUALVERBOSE 1
@@ -109,8 +128,11 @@ Section "Microsoft redistributable libraries." SecMSRedist
; Set back verbosity...
!verbose 1
-; Run the setup program
- ExecWait '"$INSTDIR\${REDIST_EXECUTABLE}"'
+; Run the setup program
+ IfSilent +3
+ ExecWait '"$INSTDIR\${REDIST_EXECUTABLE}"'
+ Goto +2
+ ExecWait '"$INSTDIR\${REDIST_EXECUTABLE}" /q'
!verbose 1
SectionEnd ; MSRedist
@@ -317,24 +339,32 @@ Function DllVersionGoodEnough
FunctionEnd
Function .onInit
- SectionGetFlags 0 $MYTEMP
- ;MessageBox MB_YESNO "Found $SYSDIR\${REDIST_DLL_NAME}" IDYES FoundLbl
- IfFileExists $SYSDIR\${REDIST_DLL_NAME} MaybeFoundInSystemLbl
- SearchSxsLbl:
- FindFirst $0 $1 $WINDIR\WinSxS\x86*
+ Var /GLOBAL archprefix
+ Var /GLOBAL sysnativedir
+ SectionGetFlags 0 $MYTEMP
+ StrCmpS ${WINTYPE} "win64" +1 +4
+ StrCpy $archprefix "amd64"
+ StrCpy $sysnativedir "$WINDIR\sysnative"
+ Goto +3
+ StrCpy $archprefix "x86"
+ StrCpy $sysnativedir $SYSDIR
+ ;MessageBox MB_YESNO "Found $sysnativedir\${REDIST_DLL_NAME}" IDYES FoundLbl
+ IfFileExists $sysnativedir\${REDIST_DLL_NAME} MaybeFoundInSystemLbl
+ SearchSxSLbl:
+ FindFirst $0 $1 $WINDIR\WinSxS\$archprefix*
LoopLbl:
StrCmp $1 "" NotFoundLbl
- IfFileExists $WINDIR\WinSxS\$1\${REDIST_DLL_NAME} MaybeFoundInSxsLbl
+ IfFileExists $WINDIR\WinSxS\$1\${REDIST_DLL_NAME} MaybeFoundInSxSLbl
FindNext $0 $1
Goto LoopLbl
- MaybeFoundInSxsLbl:
+ MaybeFoundInSxSLbl:
GetDllVersion $WINDIR\WinSxS\$1\${REDIST_DLL_NAME} $R0 $R1
Call DllVersionGoodEnough
FindNext $0 $1
IntCmp 2 $R0 LoopLbl
Goto FoundLbl
MaybeFoundInSystemLbl:
- GetDllVersion $SYSDIR\${REDIST_DLL_NAME} $R0 $R1
+ GetDllVersion $sysnativedir\${REDIST_DLL_NAME} $R0 $R1
Call DllVersionGoodEnough
IntCmp 2 $R0 SearchSxSLbl
FoundLbl:
diff --git a/erts/etc/win32/port_entry.c b/erts/etc/win32/port_entry.c
index 49b5ad2f34..30b54035e0 100644
--- a/erts/etc/win32/port_entry.c
+++ b/erts/etc/win32/port_entry.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2012. 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
@@ -45,6 +45,8 @@ extern void mainCRTStartup(void);
BOOL WINAPI erl_port_default_handler(DWORD ctrl){
if(ctrl == CTRL_LOGOFF_EVENT)
return TRUE;
+ if(ctrl == CTRL_SHUTDOWN_EVENT)
+ return TRUE;
return FALSE;
}
diff --git a/erts/etc/win32/start_erl.c b/erts/etc/win32/start_erl.c
index 28c8e55bd3..facf79e5ff 100644
--- a/erts/etc/win32/start_erl.c
+++ b/erts/etc/win32/start_erl.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 1998-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1998-2012. 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
@@ -585,6 +585,9 @@ BOOL WINAPI LogoffHandlerRoutine( DWORD dwCtrlType )
if(dwCtrlType == CTRL_LOGOFF_EVENT) {
return TRUE;
}
+ if(dwCtrlType == CTRL_SHUTDOWN_EVENT) {
+ return TRUE;
+ }
return FALSE;
}
diff --git a/erts/include/internal/ethr_atomics.h b/erts/include/internal/ethr_atomics.h
index 0f3c26f1df..612894b8c1 100644
--- a/erts/include/internal/ethr_atomics.h
+++ b/erts/include/internal/ethr_atomics.h
@@ -10,7 +10,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2011. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2012. 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
@@ -64,12 +64,31 @@
* Appart from a function implementing the atomic operation
* with unspecified memory barrier semantics, there are
* functions implementing each operation with the following
- * memory barrier semantics:
- * - rb (read barrier)
- * - wb (write barrier)
- * - acqb (acquire barrier)
- * - relb (release barrier)
- * - mb (full memory barrier)
+ * implied memory barrier semantics:
+ * - mb - Full memory barrier. Orders both loads, and
+ * stores before, and after the atomic operation.
+ * No load or store is allowed to be reordered
+ * over the atomic operation.
+ * - relb - Release barrier. Orders both loads, and
+ * stores appearing *before* the atomic
+ * operation. These are not allowed to be
+ * reordered over the atomic operation.
+ * - acqb - Acquire barrier. Orders both loads, and stores
+ * appearing *after* the atomic operation. These
+ * are not allowed to be reordered over the
+ * atomic operation.
+ * - wb - Write barrier. Orders *only* stores. These are
+ * not allowed to be reordered over the barrier.
+ * Store in atomic operation is ordered *after*
+ * the barrier.
+ * - rb - Read barrier. Orders *only* loads. These are
+ * not allowed to be reordered over the barrier.
+ * Load in atomic operation is ordered *before*
+ * the barrier.
+ * - ddrb - Data dependency read barrier. Orders *only*
+ * loads according to data dependency across the
+ * barrier. Load in atomic operation is ordered
+ * before the barrier.
*
* We implement all of these operation/barrier
* combinations, regardless of whether they are useful
@@ -535,24 +554,28 @@ char **ethr_native_su_dw_atomic_ops(void);
#ifdef ETHR_NEED_DW_ATMC_PROTOTYPES__
ethr_sint_t *ethr_dw_atomic_addr(ethr_dw_atomic_t *var);
int ethr_dw_atomic_cmpxchg(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val);
+int ethr_dw_atomic_cmpxchg_ddrb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val);
int ethr_dw_atomic_cmpxchg_rb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val);
int ethr_dw_atomic_cmpxchg_wb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val);
int ethr_dw_atomic_cmpxchg_acqb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val);
int ethr_dw_atomic_cmpxchg_relb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val);
int ethr_dw_atomic_cmpxchg_mb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val);
void ethr_dw_atomic_set(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
+void ethr_dw_atomic_set_ddrb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ethr_dw_atomic_set_rb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ethr_dw_atomic_set_wb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ethr_dw_atomic_set_acqb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ethr_dw_atomic_set_relb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ethr_dw_atomic_set_mb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ethr_dw_atomic_read(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
+void ethr_dw_atomic_read_ddrb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ethr_dw_atomic_read_rb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ethr_dw_atomic_read_wb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ethr_dw_atomic_read_acqb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ethr_dw_atomic_read_relb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ethr_dw_atomic_read_mb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ethr_dw_atomic_init(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
+void ethr_dw_atomic_init_ddrb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ethr_dw_atomic_init_rb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ethr_dw_atomic_init_wb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ethr_dw_atomic_init_acqb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
@@ -561,24 +584,28 @@ void ethr_dw_atomic_init_mb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
#if defined(ETHR_RTCHK_USE_NATIVE_DW_ATOMIC_IMPL__)
ethr_sint_t *ETHR_DW_ATOMIC_FUNC__(addr)(ethr_dw_atomic_t *var);
int ETHR_DW_ATOMIC_FUNC__(cmpxchg)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val);
+int ETHR_DW_ATOMIC_FUNC__(cmpxchg_ddrb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val);
int ETHR_DW_ATOMIC_FUNC__(cmpxchg_rb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val);
int ETHR_DW_ATOMIC_FUNC__(cmpxchg_wb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val);
int ETHR_DW_ATOMIC_FUNC__(cmpxchg_acqb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val);
int ETHR_DW_ATOMIC_FUNC__(cmpxchg_relb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val);
int ETHR_DW_ATOMIC_FUNC__(cmpxchg_mb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val);
void ETHR_DW_ATOMIC_FUNC__(set)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
+void ETHR_DW_ATOMIC_FUNC__(set_ddrb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ETHR_DW_ATOMIC_FUNC__(set_rb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ETHR_DW_ATOMIC_FUNC__(set_wb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ETHR_DW_ATOMIC_FUNC__(set_acqb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ETHR_DW_ATOMIC_FUNC__(set_relb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ETHR_DW_ATOMIC_FUNC__(set_mb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ETHR_DW_ATOMIC_FUNC__(read)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
+void ETHR_DW_ATOMIC_FUNC__(read_ddrb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ETHR_DW_ATOMIC_FUNC__(read_rb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ETHR_DW_ATOMIC_FUNC__(read_wb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ETHR_DW_ATOMIC_FUNC__(read_acqb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ETHR_DW_ATOMIC_FUNC__(read_relb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ETHR_DW_ATOMIC_FUNC__(read_mb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ETHR_DW_ATOMIC_FUNC__(init)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
+void ETHR_DW_ATOMIC_FUNC__(init_ddrb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ETHR_DW_ATOMIC_FUNC__(init_rb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ETHR_DW_ATOMIC_FUNC__(init_wb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
void ETHR_DW_ATOMIC_FUNC__(init_acqb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val);
@@ -1491,6 +1518,15 @@ static ETHR_INLINE int ETHR_DW_ATMC_FUNC__(cmpxchg_mb)(ethr_dw_atomic_t *var, et
return res;
}
+static ETHR_INLINE int ETHR_DW_ATMC_FUNC__(cmpxchg_ddrb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_DW_ATMC_FUNC__(cmpxchg)(var, val, old_val);
+#else
+ return ETHR_DW_ATMC_FUNC__(cmpxchg_rb)(var, val, old_val);
+#endif
+}
+
/* --- set() --- */
@@ -1981,6 +2017,15 @@ static ETHR_INLINE void ETHR_DW_ATMC_FUNC__(set_mb)(ethr_dw_atomic_t *var, ethr_
}
+static ETHR_INLINE void ETHR_DW_ATMC_FUNC__(set_ddrb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ETHR_DW_ATMC_FUNC__(set)(var, val);
+#else
+ ETHR_DW_ATMC_FUNC__(set_rb)(var, val);
+#endif
+}
+
/* --- read() --- */
@@ -2309,6 +2354,15 @@ static ETHR_INLINE void ETHR_DW_ATMC_FUNC__(read_mb)(ethr_dw_atomic_t *var, ethr
}
+static ETHR_INLINE void ETHR_DW_ATMC_FUNC__(read_ddrb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ETHR_DW_ATMC_FUNC__(read)(var, val);
+#else
+ ETHR_DW_ATMC_FUNC__(read_rb)(var, val);
+#endif
+}
+
/* --- init() --- */
@@ -2607,6 +2661,15 @@ static ETHR_INLINE void ETHR_DW_ATMC_FUNC__(init_mb)(ethr_dw_atomic_t *var, ethr
}
+static ETHR_INLINE void ETHR_DW_ATMC_FUNC__(init_ddrb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ETHR_DW_ATMC_FUNC__(init)(var, val);
+#else
+ ETHR_DW_ATMC_FUNC__(init_rb)(var, val);
+#endif
+}
+
#endif /* ETHR_DW_ATMC_INLINE__ */
@@ -2616,78 +2679,91 @@ static ETHR_INLINE void ETHR_DW_ATMC_FUNC__(init_mb)(ethr_dw_atomic_t *var, ethr
#ifdef ETHR_NEED_ATMC_PROTOTYPES__
ethr_sint_t *ethr_atomic_addr(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_cmpxchg(ethr_atomic_t *var, ethr_sint_t val, ethr_sint_t old_val);
+ethr_sint_t ethr_atomic_cmpxchg_ddrb(ethr_atomic_t *var, ethr_sint_t val, ethr_sint_t old_val);
ethr_sint_t ethr_atomic_cmpxchg_rb(ethr_atomic_t *var, ethr_sint_t val, ethr_sint_t old_val);
ethr_sint_t ethr_atomic_cmpxchg_wb(ethr_atomic_t *var, ethr_sint_t val, ethr_sint_t old_val);
ethr_sint_t ethr_atomic_cmpxchg_acqb(ethr_atomic_t *var, ethr_sint_t val, ethr_sint_t old_val);
ethr_sint_t ethr_atomic_cmpxchg_relb(ethr_atomic_t *var, ethr_sint_t val, ethr_sint_t old_val);
ethr_sint_t ethr_atomic_cmpxchg_mb(ethr_atomic_t *var, ethr_sint_t val, ethr_sint_t old_val);
ethr_sint_t ethr_atomic_xchg(ethr_atomic_t *var, ethr_sint_t val);
+ethr_sint_t ethr_atomic_xchg_ddrb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_xchg_rb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_xchg_wb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_xchg_acqb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_xchg_relb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_xchg_mb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_set(ethr_atomic_t *var, ethr_sint_t val);
+void ethr_atomic_set_ddrb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_set_rb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_set_wb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_set_acqb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_set_relb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_set_mb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_init(ethr_atomic_t *var, ethr_sint_t val);
+void ethr_atomic_init_ddrb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_init_rb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_init_wb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_init_acqb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_init_relb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_init_mb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_add_read(ethr_atomic_t *var, ethr_sint_t val);
+ethr_sint_t ethr_atomic_add_read_ddrb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_add_read_rb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_add_read_wb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_add_read_acqb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_add_read_relb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_add_read_mb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_read(ethr_atomic_t *var);
+ethr_sint_t ethr_atomic_read_ddrb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_read_rb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_read_wb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_read_acqb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_read_relb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_read_mb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_inc_read(ethr_atomic_t *var);
+ethr_sint_t ethr_atomic_inc_read_ddrb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_inc_read_rb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_inc_read_wb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_inc_read_acqb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_inc_read_relb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_inc_read_mb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_dec_read(ethr_atomic_t *var);
+ethr_sint_t ethr_atomic_dec_read_ddrb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_dec_read_rb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_dec_read_wb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_dec_read_acqb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_dec_read_relb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_dec_read_mb(ethr_atomic_t *var);
void ethr_atomic_add(ethr_atomic_t *var, ethr_sint_t val);
+void ethr_atomic_add_ddrb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_add_rb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_add_wb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_add_acqb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_add_relb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_add_mb(ethr_atomic_t *var, ethr_sint_t val);
void ethr_atomic_inc(ethr_atomic_t *var);
+void ethr_atomic_inc_ddrb(ethr_atomic_t *var);
void ethr_atomic_inc_rb(ethr_atomic_t *var);
void ethr_atomic_inc_wb(ethr_atomic_t *var);
void ethr_atomic_inc_acqb(ethr_atomic_t *var);
void ethr_atomic_inc_relb(ethr_atomic_t *var);
void ethr_atomic_inc_mb(ethr_atomic_t *var);
void ethr_atomic_dec(ethr_atomic_t *var);
+void ethr_atomic_dec_ddrb(ethr_atomic_t *var);
void ethr_atomic_dec_rb(ethr_atomic_t *var);
void ethr_atomic_dec_wb(ethr_atomic_t *var);
void ethr_atomic_dec_acqb(ethr_atomic_t *var);
void ethr_atomic_dec_relb(ethr_atomic_t *var);
void ethr_atomic_dec_mb(ethr_atomic_t *var);
ethr_sint_t ethr_atomic_read_band(ethr_atomic_t *var, ethr_sint_t val);
+ethr_sint_t ethr_atomic_read_band_ddrb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_read_band_rb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_read_band_wb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_read_band_acqb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_read_band_relb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_read_band_mb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_read_bor(ethr_atomic_t *var, ethr_sint_t val);
+ethr_sint_t ethr_atomic_read_bor_ddrb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_read_bor_rb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_read_bor_wb(ethr_atomic_t *var, ethr_sint_t val);
ethr_sint_t ethr_atomic_read_bor_acqb(ethr_atomic_t *var, ethr_sint_t val);
@@ -3551,6 +3627,15 @@ static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(cmpxchg_mb)(ethr_atomic_t *var,
return res;
}
+static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(cmpxchg_ddrb)(ethr_atomic_t *var, ethr_sint_t val, ethr_sint_t old_val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC_FUNC__(cmpxchg)(var, val, old_val);
+#else
+ return ETHR_ATMC_FUNC__(cmpxchg_rb)(var, val, old_val);
+#endif
+}
+
/* --- xchg() --- */
@@ -3801,6 +3886,15 @@ static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(xchg_mb)(ethr_atomic_t *var, eth
return res;
}
+static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(xchg_ddrb)(ethr_atomic_t *var, ethr_sint_t val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC_FUNC__(xchg)(var, val);
+#else
+ return ETHR_ATMC_FUNC__(xchg_rb)(var, val);
+#endif
+}
+
/* --- set() --- */
@@ -3943,6 +4037,15 @@ static ETHR_INLINE void ETHR_ATMC_FUNC__(set_mb)(ethr_atomic_t *var, ethr_sint_t
#endif
}
+static ETHR_INLINE void ETHR_ATMC_FUNC__(set_ddrb)(ethr_atomic_t *var, ethr_sint_t val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ETHR_ATMC_FUNC__(set)(var, val);
+#else
+ ETHR_ATMC_FUNC__(set_rb)(var, val);
+#endif
+}
+
/* --- init() --- */
@@ -4085,6 +4188,15 @@ static ETHR_INLINE void ETHR_ATMC_FUNC__(init_mb)(ethr_atomic_t *var, ethr_sint_
#endif
}
+static ETHR_INLINE void ETHR_ATMC_FUNC__(init_ddrb)(ethr_atomic_t *var, ethr_sint_t val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ETHR_ATMC_FUNC__(init)(var, val);
+#else
+ ETHR_ATMC_FUNC__(init_rb)(var, val);
+#endif
+}
+
/* --- add_read() --- */
@@ -4335,6 +4447,15 @@ static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(add_read_mb)(ethr_atomic_t *var,
return res;
}
+static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(add_read_ddrb)(ethr_atomic_t *var, ethr_sint_t val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC_FUNC__(add_read)(var, val);
+#else
+ return ETHR_ATMC_FUNC__(add_read_rb)(var, val);
+#endif
+}
+
/* --- read() --- */
@@ -4489,6 +4610,15 @@ static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(read_mb)(ethr_atomic_t *var)
return res;
}
+static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(read_ddrb)(ethr_atomic_t *var)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC_FUNC__(read)(var);
+#else
+ return ETHR_ATMC_FUNC__(read_rb)(var);
+#endif
+}
+
/* --- inc_read() --- */
@@ -4643,6 +4773,15 @@ static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(inc_read_mb)(ethr_atomic_t *var)
return res;
}
+static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(inc_read_ddrb)(ethr_atomic_t *var)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC_FUNC__(inc_read)(var);
+#else
+ return ETHR_ATMC_FUNC__(inc_read_rb)(var);
+#endif
+}
+
/* --- dec_read() --- */
@@ -4797,6 +4936,15 @@ static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(dec_read_mb)(ethr_atomic_t *var)
return res;
}
+static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(dec_read_ddrb)(ethr_atomic_t *var)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC_FUNC__(dec_read)(var);
+#else
+ return ETHR_ATMC_FUNC__(dec_read_rb)(var);
+#endif
+}
+
/* --- add() --- */
@@ -4939,6 +5087,15 @@ static ETHR_INLINE void ETHR_ATMC_FUNC__(add_mb)(ethr_atomic_t *var, ethr_sint_t
#endif
}
+static ETHR_INLINE void ETHR_ATMC_FUNC__(add_ddrb)(ethr_atomic_t *var, ethr_sint_t val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ETHR_ATMC_FUNC__(add)(var, val);
+#else
+ ETHR_ATMC_FUNC__(add_rb)(var, val);
+#endif
+}
+
/* --- inc() --- */
@@ -5081,6 +5238,15 @@ static ETHR_INLINE void ETHR_ATMC_FUNC__(inc_mb)(ethr_atomic_t *var)
#endif
}
+static ETHR_INLINE void ETHR_ATMC_FUNC__(inc_ddrb)(ethr_atomic_t *var)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ETHR_ATMC_FUNC__(inc)(var);
+#else
+ ETHR_ATMC_FUNC__(inc_rb)(var);
+#endif
+}
+
/* --- dec() --- */
@@ -5223,6 +5389,15 @@ static ETHR_INLINE void ETHR_ATMC_FUNC__(dec_mb)(ethr_atomic_t *var)
#endif
}
+static ETHR_INLINE void ETHR_ATMC_FUNC__(dec_ddrb)(ethr_atomic_t *var)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ETHR_ATMC_FUNC__(dec)(var);
+#else
+ ETHR_ATMC_FUNC__(dec_rb)(var);
+#endif
+}
+
/* --- read_band() --- */
@@ -5473,6 +5648,15 @@ static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(read_band_mb)(ethr_atomic_t *var
return res;
}
+static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(read_band_ddrb)(ethr_atomic_t *var, ethr_sint_t val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC_FUNC__(read_band)(var, val);
+#else
+ return ETHR_ATMC_FUNC__(read_band_rb)(var, val);
+#endif
+}
+
/* --- read_bor() --- */
@@ -5723,6 +5907,15 @@ static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(read_bor_mb)(ethr_atomic_t *var,
return res;
}
+static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(read_bor_ddrb)(ethr_atomic_t *var, ethr_sint_t val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC_FUNC__(read_bor)(var, val);
+#else
+ return ETHR_ATMC_FUNC__(read_bor_rb)(var, val);
+#endif
+}
+
#endif /* ETHR_ATMC_INLINE__ */
@@ -5732,78 +5925,91 @@ static ETHR_INLINE ethr_sint_t ETHR_ATMC_FUNC__(read_bor_mb)(ethr_atomic_t *var,
#ifdef ETHR_NEED_ATMC32_PROTOTYPES__
ethr_sint32_t *ethr_atomic32_addr(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_cmpxchg(ethr_atomic32_t *var, ethr_sint32_t val, ethr_sint32_t old_val);
+ethr_sint32_t ethr_atomic32_cmpxchg_ddrb(ethr_atomic32_t *var, ethr_sint32_t val, ethr_sint32_t old_val);
ethr_sint32_t ethr_atomic32_cmpxchg_rb(ethr_atomic32_t *var, ethr_sint32_t val, ethr_sint32_t old_val);
ethr_sint32_t ethr_atomic32_cmpxchg_wb(ethr_atomic32_t *var, ethr_sint32_t val, ethr_sint32_t old_val);
ethr_sint32_t ethr_atomic32_cmpxchg_acqb(ethr_atomic32_t *var, ethr_sint32_t val, ethr_sint32_t old_val);
ethr_sint32_t ethr_atomic32_cmpxchg_relb(ethr_atomic32_t *var, ethr_sint32_t val, ethr_sint32_t old_val);
ethr_sint32_t ethr_atomic32_cmpxchg_mb(ethr_atomic32_t *var, ethr_sint32_t val, ethr_sint32_t old_val);
ethr_sint32_t ethr_atomic32_xchg(ethr_atomic32_t *var, ethr_sint32_t val);
+ethr_sint32_t ethr_atomic32_xchg_ddrb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_xchg_rb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_xchg_wb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_xchg_acqb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_xchg_relb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_xchg_mb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_set(ethr_atomic32_t *var, ethr_sint32_t val);
+void ethr_atomic32_set_ddrb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_set_rb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_set_wb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_set_acqb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_set_relb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_set_mb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_init(ethr_atomic32_t *var, ethr_sint32_t val);
+void ethr_atomic32_init_ddrb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_init_rb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_init_wb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_init_acqb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_init_relb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_init_mb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_add_read(ethr_atomic32_t *var, ethr_sint32_t val);
+ethr_sint32_t ethr_atomic32_add_read_ddrb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_add_read_rb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_add_read_wb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_add_read_acqb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_add_read_relb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_add_read_mb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_read(ethr_atomic32_t *var);
+ethr_sint32_t ethr_atomic32_read_ddrb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_read_rb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_read_wb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_read_acqb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_read_relb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_read_mb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_inc_read(ethr_atomic32_t *var);
+ethr_sint32_t ethr_atomic32_inc_read_ddrb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_inc_read_rb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_inc_read_wb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_inc_read_acqb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_inc_read_relb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_inc_read_mb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_dec_read(ethr_atomic32_t *var);
+ethr_sint32_t ethr_atomic32_dec_read_ddrb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_dec_read_rb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_dec_read_wb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_dec_read_acqb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_dec_read_relb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_dec_read_mb(ethr_atomic32_t *var);
void ethr_atomic32_add(ethr_atomic32_t *var, ethr_sint32_t val);
+void ethr_atomic32_add_ddrb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_add_rb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_add_wb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_add_acqb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_add_relb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_add_mb(ethr_atomic32_t *var, ethr_sint32_t val);
void ethr_atomic32_inc(ethr_atomic32_t *var);
+void ethr_atomic32_inc_ddrb(ethr_atomic32_t *var);
void ethr_atomic32_inc_rb(ethr_atomic32_t *var);
void ethr_atomic32_inc_wb(ethr_atomic32_t *var);
void ethr_atomic32_inc_acqb(ethr_atomic32_t *var);
void ethr_atomic32_inc_relb(ethr_atomic32_t *var);
void ethr_atomic32_inc_mb(ethr_atomic32_t *var);
void ethr_atomic32_dec(ethr_atomic32_t *var);
+void ethr_atomic32_dec_ddrb(ethr_atomic32_t *var);
void ethr_atomic32_dec_rb(ethr_atomic32_t *var);
void ethr_atomic32_dec_wb(ethr_atomic32_t *var);
void ethr_atomic32_dec_acqb(ethr_atomic32_t *var);
void ethr_atomic32_dec_relb(ethr_atomic32_t *var);
void ethr_atomic32_dec_mb(ethr_atomic32_t *var);
ethr_sint32_t ethr_atomic32_read_band(ethr_atomic32_t *var, ethr_sint32_t val);
+ethr_sint32_t ethr_atomic32_read_band_ddrb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_read_band_rb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_read_band_wb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_read_band_acqb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_read_band_relb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_read_band_mb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_read_bor(ethr_atomic32_t *var, ethr_sint32_t val);
+ethr_sint32_t ethr_atomic32_read_bor_ddrb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_read_bor_rb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_read_bor_wb(ethr_atomic32_t *var, ethr_sint32_t val);
ethr_sint32_t ethr_atomic32_read_bor_acqb(ethr_atomic32_t *var, ethr_sint32_t val);
@@ -6667,6 +6873,15 @@ static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(cmpxchg_mb)(ethr_atomic32_t
return res;
}
+static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(cmpxchg_ddrb)(ethr_atomic32_t *var, ethr_sint32_t val, ethr_sint32_t old_val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC32_FUNC__(cmpxchg)(var, val, old_val);
+#else
+ return ETHR_ATMC32_FUNC__(cmpxchg_rb)(var, val, old_val);
+#endif
+}
+
/* --- xchg() --- */
@@ -6917,6 +7132,15 @@ static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(xchg_mb)(ethr_atomic32_t *va
return res;
}
+static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(xchg_ddrb)(ethr_atomic32_t *var, ethr_sint32_t val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC32_FUNC__(xchg)(var, val);
+#else
+ return ETHR_ATMC32_FUNC__(xchg_rb)(var, val);
+#endif
+}
+
/* --- set() --- */
@@ -7059,6 +7283,15 @@ static ETHR_INLINE void ETHR_ATMC32_FUNC__(set_mb)(ethr_atomic32_t *var, ethr_si
#endif
}
+static ETHR_INLINE void ETHR_ATMC32_FUNC__(set_ddrb)(ethr_atomic32_t *var, ethr_sint32_t val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ETHR_ATMC32_FUNC__(set)(var, val);
+#else
+ ETHR_ATMC32_FUNC__(set_rb)(var, val);
+#endif
+}
+
/* --- init() --- */
@@ -7201,6 +7434,15 @@ static ETHR_INLINE void ETHR_ATMC32_FUNC__(init_mb)(ethr_atomic32_t *var, ethr_s
#endif
}
+static ETHR_INLINE void ETHR_ATMC32_FUNC__(init_ddrb)(ethr_atomic32_t *var, ethr_sint32_t val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ETHR_ATMC32_FUNC__(init)(var, val);
+#else
+ ETHR_ATMC32_FUNC__(init_rb)(var, val);
+#endif
+}
+
/* --- add_read() --- */
@@ -7451,6 +7693,15 @@ static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(add_read_mb)(ethr_atomic32_t
return res;
}
+static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(add_read_ddrb)(ethr_atomic32_t *var, ethr_sint32_t val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC32_FUNC__(add_read)(var, val);
+#else
+ return ETHR_ATMC32_FUNC__(add_read_rb)(var, val);
+#endif
+}
+
/* --- read() --- */
@@ -7605,6 +7856,15 @@ static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(read_mb)(ethr_atomic32_t *va
return res;
}
+static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(read_ddrb)(ethr_atomic32_t *var)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC32_FUNC__(read)(var);
+#else
+ return ETHR_ATMC32_FUNC__(read_rb)(var);
+#endif
+}
+
/* --- inc_read() --- */
@@ -7759,6 +8019,15 @@ static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(inc_read_mb)(ethr_atomic32_t
return res;
}
+static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(inc_read_ddrb)(ethr_atomic32_t *var)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC32_FUNC__(inc_read)(var);
+#else
+ return ETHR_ATMC32_FUNC__(inc_read_rb)(var);
+#endif
+}
+
/* --- dec_read() --- */
@@ -7913,6 +8182,15 @@ static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(dec_read_mb)(ethr_atomic32_t
return res;
}
+static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(dec_read_ddrb)(ethr_atomic32_t *var)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC32_FUNC__(dec_read)(var);
+#else
+ return ETHR_ATMC32_FUNC__(dec_read_rb)(var);
+#endif
+}
+
/* --- add() --- */
@@ -8055,6 +8333,15 @@ static ETHR_INLINE void ETHR_ATMC32_FUNC__(add_mb)(ethr_atomic32_t *var, ethr_si
#endif
}
+static ETHR_INLINE void ETHR_ATMC32_FUNC__(add_ddrb)(ethr_atomic32_t *var, ethr_sint32_t val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ETHR_ATMC32_FUNC__(add)(var, val);
+#else
+ ETHR_ATMC32_FUNC__(add_rb)(var, val);
+#endif
+}
+
/* --- inc() --- */
@@ -8197,6 +8484,15 @@ static ETHR_INLINE void ETHR_ATMC32_FUNC__(inc_mb)(ethr_atomic32_t *var)
#endif
}
+static ETHR_INLINE void ETHR_ATMC32_FUNC__(inc_ddrb)(ethr_atomic32_t *var)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ETHR_ATMC32_FUNC__(inc)(var);
+#else
+ ETHR_ATMC32_FUNC__(inc_rb)(var);
+#endif
+}
+
/* --- dec() --- */
@@ -8339,6 +8635,15 @@ static ETHR_INLINE void ETHR_ATMC32_FUNC__(dec_mb)(ethr_atomic32_t *var)
#endif
}
+static ETHR_INLINE void ETHR_ATMC32_FUNC__(dec_ddrb)(ethr_atomic32_t *var)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ETHR_ATMC32_FUNC__(dec)(var);
+#else
+ ETHR_ATMC32_FUNC__(dec_rb)(var);
+#endif
+}
+
/* --- read_band() --- */
@@ -8589,6 +8894,15 @@ static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(read_band_mb)(ethr_atomic32_
return res;
}
+static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(read_band_ddrb)(ethr_atomic32_t *var, ethr_sint32_t val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC32_FUNC__(read_band)(var, val);
+#else
+ return ETHR_ATMC32_FUNC__(read_band_rb)(var, val);
+#endif
+}
+
/* --- read_bor() --- */
@@ -8839,6 +9153,15 @@ static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(read_bor_mb)(ethr_atomic32_t
return res;
}
+static ETHR_INLINE ethr_sint32_t ETHR_ATMC32_FUNC__(read_bor_ddrb)(ethr_atomic32_t *var, ethr_sint32_t val)
+{
+#ifdef ETHR_ORDERED_READ_DEPEND
+ return ETHR_ATMC32_FUNC__(read_bor)(var, val);
+#else
+ return ETHR_ATMC32_FUNC__(read_bor_rb)(var, val);
+#endif
+}
+
#endif /* ETHR_ATMC32_INLINE__ */
#endif /* ETHR_ATOMICS_H__ */
diff --git a/erts/include/internal/ethread.h b/erts/include/internal/ethread.h
index 142c26c0ca..e1885c627a 100644
--- a/erts/include/internal/ethread.h
+++ b/erts/include/internal/ethread.h
@@ -355,10 +355,8 @@ extern ethr_runtime_t ethr_runtime__;
# include "sparc64/ethread.h"
# endif
# endif
-#if 0
# include "gcc/ethread.h"
# include "libatomic_ops/ethread.h"
-#endif
# endif
# elif defined(ETHR_HAVE_LIBATOMIC_OPS)
# include "libatomic_ops/ethread.h"
diff --git a/erts/lib_src/Makefile.in b/erts/lib_src/Makefile.in
index ea80e74100..aed889eaef 100644
--- a/erts/lib_src/Makefile.in
+++ b/erts/lib_src/Makefile.in
@@ -473,31 +473,31 @@ INTERNAL_RELEASE_LIBS= \
.PHONY: release_spec
release_spec: all
ifneq ($(strip $(RELEASE_INCLUDES)),)
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELEASE_PATH)/usr/include
- $(INSTALL_DATA) $(RELEASE_INCLUDES) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(RELEASE_INCLUDES) $(RELEASE_PATH)/usr/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/usr/include"
+ $(INSTALL_DATA) $(RELEASE_INCLUDES) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(RELEASE_INCLUDES) "$(RELEASE_PATH)/usr/include"
endif
ifneq ($(strip $(INTERNAL_RELEASE_INCLUDES)),)
- $(INSTALL_DIR) $(RELSYSDIR)/include/internal
- $(INSTALL_DATA) $(INTERNAL_RELEASE_INCLUDES) $(RELSYSDIR)/include/internal
+ $(INSTALL_DIR) "$(RELSYSDIR)/include/internal"
+ $(INSTALL_DATA) $(INTERNAL_RELEASE_INCLUDES) "$(RELSYSDIR)/include/internal"
endif
ifneq ($(strip $(INTERNAL_X_RELEASE_INCLUDE_DIRS)),)
for xdir in $(INTERNAL_X_RELEASE_INCLUDE_DIRS); do \
- $(INSTALL_DIR) $(RELSYSDIR)/include/internal/$$xdir; \
+ $(INSTALL_DIR) "$(RELSYSDIR)/include/internal/$$xdir"; \
$(INSTALL_DATA) $(ERTS_INCL_INT)/$$xdir/*.h \
- $(RELSYSDIR)/include/internal/$$xdir; \
+ "$(RELSYSDIR)/include/internal/$$xdir"; \
done
endif
ifneq ($(strip $(RELEASE_LIBS)),)
- $(INSTALL_DIR) $(RELSYSDIR)/lib
- $(INSTALL_DIR) $(RELEASE_PATH)/usr/lib
- $(INSTALL_DATA) $(RELEASE_LIBS) $(RELSYSDIR)/lib
- $(INSTALL_DATA) $(RELEASE_LIBS) $(RELEASE_PATH)/usr/lib
+ $(INSTALL_DIR) "$(RELSYSDIR)/lib"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/usr/lib"
+ $(INSTALL_DATA) $(RELEASE_LIBS) "$(RELSYSDIR)/lib"
+ $(INSTALL_DATA) $(RELEASE_LIBS) "$(RELEASE_PATH)/usr/lib"
endif
ifneq ($(strip $(INTERNAL_RELEASE_LIBS)),)
- $(INSTALL_DIR) $(RELSYSDIR)/lib/internal
- $(INSTALL_DATA) $(INTERNAL_RELEASE_LIBS) $(RELSYSDIR)/lib/internal
+ $(INSTALL_DIR) "$(RELSYSDIR)/lib/internal"
+ $(INSTALL_DATA) $(INTERNAL_RELEASE_LIBS) "$(RELSYSDIR)/lib/internal"
endif
.PHONY: docs
diff --git a/erts/lib_src/common/erl_misc_utils.c b/erts/lib_src/common/erl_misc_utils.c
index 5e94ff19db..3b123063fa 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2006-2012. 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
@@ -727,7 +727,7 @@ adjust_processor_nodes(erts_cpu_info_t *cpuinfo, int no_nodes)
prev = NULL;
this = &cpuinfo->topology[0];
- last = &cpuinfo->topology[cpuinfo->configured-1];
+ last = &cpuinfo->topology[cpuinfo->topology_size-1];
while (1) {
if (processor == this->processor) {
if (node != this->node)
@@ -834,8 +834,8 @@ read_topology(erts_cpu_info_t *cpuinfo)
ix = -1;
if (realpath(ERTS_SYS_NODE_PATH, npath)) {
- got_nodes = 1;
ndir = opendir(npath);
+ got_nodes = (ndir != NULL);
}
do {
@@ -939,7 +939,7 @@ read_topology(erts_cpu_info_t *cpuinfo)
if (res > 1) {
prev = this++;
- last = &cpuinfo->topology[cpuinfo->configured-1];
+ last = &cpuinfo->topology[cpuinfo->topology_size-1];
while (1) {
this->thread = ((this->node == prev->node
@@ -1094,7 +1094,7 @@ read_topology(erts_cpu_info_t *cpuinfo)
if (res > 1) {
prev = this++;
- last = &cpuinfo->topology[cpuinfo->configured-1];
+ last = &cpuinfo->topology[cpuinfo->topology_size-1];
while (1) {
this->thread = ((this->node == prev->node
diff --git a/erts/lib_src/common/erl_printf.c b/erts/lib_src/common/erl_printf.c
index 108a8bb531..2c177ee5ac 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2012. 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
@@ -173,6 +173,7 @@ typedef struct {
static int
write_sn(void *vwsnap, char* buf, size_t len)
{
+ int rv = 0;
write_sn_arg_t *wsnap = (write_sn_arg_t *) vwsnap;
ASSERT(wsnap);
ASSERT(len > 0);
@@ -180,12 +181,13 @@ write_sn(void *vwsnap, char* buf, size_t len)
size_t sz = len;
if (sz >= wsnap->len)
sz = wsnap->len;
+ rv = (int)sz;
memcpy((void *) wsnap->buf, (void *) buf, sz);
wsnap->buf += sz;
wsnap->len -= sz;
return sz;
}
- return 0;
+ return rv;
}
static int
diff --git a/erts/lib_src/common/erl_printf_format.c b/erts/lib_src/common/erl_printf_format.c
index 473791dce4..fd25cce7ed 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2012. 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
@@ -457,6 +457,15 @@ static int fmt_double(fmtfn_t fn,void*arg,double val,
return res;
}
+/* strnlen doesn't exist everywhere */
+static size_t my_strnlen(const char *s, size_t maxlen)
+{
+ size_t i = 0;
+ while (i < maxlen && s[i] != '\0')
+ i++;
+ return i;
+}
+
int erts_printf_format(fmtfn_t fn, void* arg, char* fmt, va_list ap)
{
char* ptr0 = fmt;
@@ -771,9 +780,7 @@ int erts_printf_format(fmtfn_t fn, void* arg, char* fmt, va_list ap)
case FMTC_s: {
char* str = va_arg(ap,char*);
- int len = strlen(str);
- if (precision >= 0 && precision < len)
- len = precision;
+ int len = (precision >= 0) ? my_strnlen(str,precision) : strlen(str);
if (width > 0 && !(fmt & FMTF_adj)) {
if (width > len)
BLANKS(fn, arg, width - len, count);
diff --git a/erts/lib_src/common/ethr_atomics.c b/erts/lib_src/common/ethr_atomics.c
index 5796bdc22e..c52166a7ec 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. All Rights Reserved.
+ * Copyright Ericsson AB 2011-2012. 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
@@ -64,12 +64,31 @@
* Appart from a function implementing the atomic operation
* with unspecified memory barrier semantics, there are
* functions implementing each operation with the following
- * memory barrier semantics:
- * - rb (read barrier)
- * - wb (write barrier)
- * - acqb (acquire barrier)
- * - relb (release barrier)
- * - mb (full memory barrier)
+ * implied memory barrier semantics:
+ * - mb - Full memory barrier. Orders both loads, and
+ * stores before, and after the atomic operation.
+ * No load or store is allowed to be reordered
+ * over the atomic operation.
+ * - relb - Release barrier. Orders both loads, and
+ * stores appearing *before* the atomic
+ * operation. These are not allowed to be
+ * reordered over the atomic operation.
+ * - acqb - Acquire barrier. Orders both loads, and stores
+ * appearing *after* the atomic operation. These
+ * are not allowed to be reordered over the
+ * atomic operation.
+ * - wb - Write barrier. Orders *only* stores. These are
+ * not allowed to be reordered over the barrier.
+ * Store in atomic operation is ordered *after*
+ * the barrier.
+ * - rb - Read barrier. Orders *only* loads. These are
+ * not allowed to be reordered over the barrier.
+ * Load in atomic operation is ordered *before*
+ * the barrier.
+ * - ddrb - Data dependency read barrier. Orders *only*
+ * loads according to data dependency across the
+ * barrier. Load in atomic operation is ordered
+ * before the barrier.
*
* We implement all of these operation/barrier
* combinations, regardless of whether they are useful
@@ -542,6 +561,17 @@ int ethr_dw_atomic_cmpxchg(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_s
}
#endif
+int ethr_dw_atomic_cmpxchg_ddrb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val)
+{
+#if defined(ETHR_HAVE_DOUBLE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ return ethr_dw_atomic_cmpxchg_ddrb__(var, val, old_val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_dw_atomic_cmpxchg(var, val, old_val);
+#else
+ return ethr_dw_atomic_cmpxchg_rb(var, val, old_val);
+#endif
+}
+
int ETHR_DW_ATOMIC_FUNC__(cmpxchg_rb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val, ethr_dw_sint_t *old_val)
{
int res;
@@ -756,6 +786,17 @@ void ethr_dw_atomic_set(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
}
#endif
+void ethr_dw_atomic_set_ddrb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
+{
+#if defined(ETHR_HAVE_DOUBLE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ ethr_dw_atomic_set_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ ethr_dw_atomic_set(var, val);
+#else
+ ethr_dw_atomic_set_rb(var, val);
+#endif
+}
+
void ETHR_DW_ATOMIC_FUNC__(set_rb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
{
ETHR_ASSERT(!ethr_not_inited__);
@@ -910,6 +951,17 @@ void ethr_dw_atomic_read(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
}
#endif
+void ethr_dw_atomic_read_ddrb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
+{
+#if defined(ETHR_HAVE_DOUBLE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ ethr_dw_atomic_read_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ ethr_dw_atomic_read(var, val);
+#else
+ ethr_dw_atomic_read_rb(var, val);
+#endif
+}
+
void ETHR_DW_ATOMIC_FUNC__(read_rb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
{
ETHR_ASSERT(!ethr_not_inited__);
@@ -1061,6 +1113,17 @@ void ethr_dw_atomic_init(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
}
#endif
+void ethr_dw_atomic_init_ddrb(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
+{
+#if defined(ETHR_HAVE_DOUBLE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ ethr_dw_atomic_init_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ ethr_dw_atomic_init(var, val);
+#else
+ ethr_dw_atomic_init_rb(var, val);
+#endif
+}
+
void ETHR_DW_ATOMIC_FUNC__(init_rb)(ethr_dw_atomic_t *var, ethr_dw_sint_t *val)
{
ETHR_ASSERT(var);
@@ -1221,6 +1284,17 @@ ethr_sint_t ethr_atomic_cmpxchg(ethr_atomic_t *var, ethr_sint_t val, ethr_sint_t
return res;
}
+ethr_sint_t ethr_atomic_cmpxchg_ddrb(ethr_atomic_t *var, ethr_sint_t val, ethr_sint_t old_val)
+{
+#if defined(ETHR_HAVE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ return ethr_atomic_cmpxchg_ddrb__(var, val, old_val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic_cmpxchg(var, val, old_val);
+#else
+ return ethr_atomic_cmpxchg_rb(var, val, old_val);
+#endif
+}
+
ethr_sint_t ethr_atomic_cmpxchg_rb(ethr_atomic_t *var, ethr_sint_t val, ethr_sint_t old_val)
{
ethr_sint_t res;
@@ -1332,6 +1406,17 @@ ethr_sint_t ethr_atomic_xchg(ethr_atomic_t *var, ethr_sint_t val)
return res;
}
+ethr_sint_t ethr_atomic_xchg_ddrb(ethr_atomic_t *var, ethr_sint_t val)
+{
+#if defined(ETHR_HAVE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ return ethr_atomic_xchg_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic_xchg(var, val);
+#else
+ return ethr_atomic_xchg_rb(var, val);
+#endif
+}
+
ethr_sint_t ethr_atomic_xchg_rb(ethr_atomic_t *var, ethr_sint_t val)
{
ethr_sint_t res;
@@ -1437,6 +1522,17 @@ void ethr_atomic_set(ethr_atomic_t *var, ethr_sint_t val)
}
+void ethr_atomic_set_ddrb(ethr_atomic_t *var, ethr_sint_t val)
+{
+#if defined(ETHR_HAVE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ ethr_atomic_set_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ ethr_atomic_set(var, val);
+#else
+ ethr_atomic_set_rb(var, val);
+#endif
+}
+
void ethr_atomic_set_rb(ethr_atomic_t *var, ethr_sint_t val)
{
ETHR_ASSERT(!ethr_not_inited__);
@@ -1536,6 +1632,17 @@ void ethr_atomic_init(ethr_atomic_t *var, ethr_sint_t val)
}
+void ethr_atomic_init_ddrb(ethr_atomic_t *var, ethr_sint_t val)
+{
+#if defined(ETHR_HAVE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ ethr_atomic_init_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ ethr_atomic_init(var, val);
+#else
+ ethr_atomic_init_rb(var, val);
+#endif
+}
+
void ethr_atomic_init_rb(ethr_atomic_t *var, ethr_sint_t val)
{
ETHR_ASSERT(var);
@@ -1632,6 +1739,17 @@ ethr_sint_t ethr_atomic_add_read(ethr_atomic_t *var, ethr_sint_t val)
return res;
}
+ethr_sint_t ethr_atomic_add_read_ddrb(ethr_atomic_t *var, ethr_sint_t val)
+{
+#if defined(ETHR_HAVE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ return ethr_atomic_add_read_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic_add_read(var, val);
+#else
+ return ethr_atomic_add_read_rb(var, val);
+#endif
+}
+
ethr_sint_t ethr_atomic_add_read_rb(ethr_atomic_t *var, ethr_sint_t val)
{
ethr_sint_t res;
@@ -1738,6 +1856,17 @@ ethr_sint_t ethr_atomic_read(ethr_atomic_t *var)
return res;
}
+ethr_sint_t ethr_atomic_read_ddrb(ethr_atomic_t *var)
+{
+#if defined(ETHR_HAVE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ return ethr_atomic_read_ddrb__(var);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic_read(var);
+#else
+ return ethr_atomic_read_rb(var);
+#endif
+}
+
ethr_sint_t ethr_atomic_read_rb(ethr_atomic_t *var)
{
ethr_sint_t res;
@@ -1843,6 +1972,17 @@ ethr_sint_t ethr_atomic_inc_read(ethr_atomic_t *var)
return res;
}
+ethr_sint_t ethr_atomic_inc_read_ddrb(ethr_atomic_t *var)
+{
+#if defined(ETHR_HAVE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ return ethr_atomic_inc_read_ddrb__(var);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic_inc_read(var);
+#else
+ return ethr_atomic_inc_read_rb(var);
+#endif
+}
+
ethr_sint_t ethr_atomic_inc_read_rb(ethr_atomic_t *var)
{
ethr_sint_t res;
@@ -1949,6 +2089,17 @@ ethr_sint_t ethr_atomic_dec_read(ethr_atomic_t *var)
return res;
}
+ethr_sint_t ethr_atomic_dec_read_ddrb(ethr_atomic_t *var)
+{
+#if defined(ETHR_HAVE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ return ethr_atomic_dec_read_ddrb__(var);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic_dec_read(var);
+#else
+ return ethr_atomic_dec_read_rb(var);
+#endif
+}
+
ethr_sint_t ethr_atomic_dec_read_rb(ethr_atomic_t *var)
{
ethr_sint_t res;
@@ -2054,6 +2205,17 @@ void ethr_atomic_add(ethr_atomic_t *var, ethr_sint_t val)
}
+void ethr_atomic_add_ddrb(ethr_atomic_t *var, ethr_sint_t val)
+{
+#if defined(ETHR_HAVE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ ethr_atomic_add_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ ethr_atomic_add(var, val);
+#else
+ ethr_atomic_add_rb(var, val);
+#endif
+}
+
void ethr_atomic_add_rb(ethr_atomic_t *var, ethr_sint_t val)
{
ETHR_ASSERT(!ethr_not_inited__);
@@ -2154,6 +2316,17 @@ void ethr_atomic_inc(ethr_atomic_t *var)
}
+void ethr_atomic_inc_ddrb(ethr_atomic_t *var)
+{
+#if defined(ETHR_HAVE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ ethr_atomic_inc_ddrb__(var);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ ethr_atomic_inc(var);
+#else
+ ethr_atomic_inc_rb(var);
+#endif
+}
+
void ethr_atomic_inc_rb(ethr_atomic_t *var)
{
ETHR_ASSERT(!ethr_not_inited__);
@@ -2254,6 +2427,17 @@ void ethr_atomic_dec(ethr_atomic_t *var)
}
+void ethr_atomic_dec_ddrb(ethr_atomic_t *var)
+{
+#if defined(ETHR_HAVE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ ethr_atomic_dec_ddrb__(var);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ ethr_atomic_dec(var);
+#else
+ ethr_atomic_dec_rb(var);
+#endif
+}
+
void ethr_atomic_dec_rb(ethr_atomic_t *var)
{
ETHR_ASSERT(!ethr_not_inited__);
@@ -2355,6 +2539,17 @@ ethr_sint_t ethr_atomic_read_band(ethr_atomic_t *var, ethr_sint_t val)
return res;
}
+ethr_sint_t ethr_atomic_read_band_ddrb(ethr_atomic_t *var, ethr_sint_t val)
+{
+#if defined(ETHR_HAVE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ return ethr_atomic_read_band_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic_read_band(var, val);
+#else
+ return ethr_atomic_read_band_rb(var, val);
+#endif
+}
+
ethr_sint_t ethr_atomic_read_band_rb(ethr_atomic_t *var, ethr_sint_t val)
{
ethr_sint_t res;
@@ -2461,6 +2656,17 @@ ethr_sint_t ethr_atomic_read_bor(ethr_atomic_t *var, ethr_sint_t val)
return res;
}
+ethr_sint_t ethr_atomic_read_bor_ddrb(ethr_atomic_t *var, ethr_sint_t val)
+{
+#if defined(ETHR_HAVE_WORD_SZ_NATIVE_ATOMIC_OPS)
+ return ethr_atomic_read_bor_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic_read_bor(var, val);
+#else
+ return ethr_atomic_read_bor_rb(var, val);
+#endif
+}
+
ethr_sint_t ethr_atomic_read_bor_rb(ethr_atomic_t *var, ethr_sint_t val)
{
ethr_sint_t res;
@@ -2587,6 +2793,17 @@ ethr_sint32_t ethr_atomic32_cmpxchg(ethr_atomic32_t *var, ethr_sint32_t val, eth
return res;
}
+ethr_sint32_t ethr_atomic32_cmpxchg_ddrb(ethr_atomic32_t *var, ethr_sint32_t val, ethr_sint32_t old_val)
+{
+#if defined(ETHR_HAVE_32BIT_NATIVE_ATOMIC_OPS)
+ return ethr_atomic32_cmpxchg_ddrb__(var, val, old_val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic32_cmpxchg(var, val, old_val);
+#else
+ return ethr_atomic32_cmpxchg_rb(var, val, old_val);
+#endif
+}
+
ethr_sint32_t ethr_atomic32_cmpxchg_rb(ethr_atomic32_t *var, ethr_sint32_t val, ethr_sint32_t old_val)
{
ethr_sint32_t res;
@@ -2675,6 +2892,17 @@ ethr_sint32_t ethr_atomic32_xchg(ethr_atomic32_t *var, ethr_sint32_t val)
return res;
}
+ethr_sint32_t ethr_atomic32_xchg_ddrb(ethr_atomic32_t *var, ethr_sint32_t val)
+{
+#if defined(ETHR_HAVE_32BIT_NATIVE_ATOMIC_OPS)
+ return ethr_atomic32_xchg_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic32_xchg(var, val);
+#else
+ return ethr_atomic32_xchg_rb(var, val);
+#endif
+}
+
ethr_sint32_t ethr_atomic32_xchg_rb(ethr_atomic32_t *var, ethr_sint32_t val)
{
ethr_sint32_t res;
@@ -2762,6 +2990,17 @@ void ethr_atomic32_set(ethr_atomic32_t *var, ethr_sint32_t val)
}
+void ethr_atomic32_set_ddrb(ethr_atomic32_t *var, ethr_sint32_t val)
+{
+#if defined(ETHR_HAVE_32BIT_NATIVE_ATOMIC_OPS)
+ ethr_atomic32_set_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ ethr_atomic32_set(var, val);
+#else
+ ethr_atomic32_set_rb(var, val);
+#endif
+}
+
void ethr_atomic32_set_rb(ethr_atomic32_t *var, ethr_sint32_t val)
{
ETHR_ASSERT(!ethr_not_inited__);
@@ -2843,6 +3082,17 @@ void ethr_atomic32_init(ethr_atomic32_t *var, ethr_sint32_t val)
}
+void ethr_atomic32_init_ddrb(ethr_atomic32_t *var, ethr_sint32_t val)
+{
+#if defined(ETHR_HAVE_32BIT_NATIVE_ATOMIC_OPS)
+ ethr_atomic32_init_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ ethr_atomic32_init(var, val);
+#else
+ ethr_atomic32_init_rb(var, val);
+#endif
+}
+
void ethr_atomic32_init_rb(ethr_atomic32_t *var, ethr_sint32_t val)
{
ETHR_ASSERT(var);
@@ -2921,6 +3171,17 @@ ethr_sint32_t ethr_atomic32_add_read(ethr_atomic32_t *var, ethr_sint32_t val)
return res;
}
+ethr_sint32_t ethr_atomic32_add_read_ddrb(ethr_atomic32_t *var, ethr_sint32_t val)
+{
+#if defined(ETHR_HAVE_32BIT_NATIVE_ATOMIC_OPS)
+ return ethr_atomic32_add_read_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic32_add_read(var, val);
+#else
+ return ethr_atomic32_add_read_rb(var, val);
+#endif
+}
+
ethr_sint32_t ethr_atomic32_add_read_rb(ethr_atomic32_t *var, ethr_sint32_t val)
{
ethr_sint32_t res;
@@ -3009,6 +3270,17 @@ ethr_sint32_t ethr_atomic32_read(ethr_atomic32_t *var)
return res;
}
+ethr_sint32_t ethr_atomic32_read_ddrb(ethr_atomic32_t *var)
+{
+#if defined(ETHR_HAVE_32BIT_NATIVE_ATOMIC_OPS)
+ return ethr_atomic32_read_ddrb__(var);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic32_read(var);
+#else
+ return ethr_atomic32_read_rb(var);
+#endif
+}
+
ethr_sint32_t ethr_atomic32_read_rb(ethr_atomic32_t *var)
{
ethr_sint32_t res;
@@ -3097,6 +3369,17 @@ ethr_sint32_t ethr_atomic32_inc_read(ethr_atomic32_t *var)
return res;
}
+ethr_sint32_t ethr_atomic32_inc_read_ddrb(ethr_atomic32_t *var)
+{
+#if defined(ETHR_HAVE_32BIT_NATIVE_ATOMIC_OPS)
+ return ethr_atomic32_inc_read_ddrb__(var);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic32_inc_read(var);
+#else
+ return ethr_atomic32_inc_read_rb(var);
+#endif
+}
+
ethr_sint32_t ethr_atomic32_inc_read_rb(ethr_atomic32_t *var)
{
ethr_sint32_t res;
@@ -3185,6 +3468,17 @@ ethr_sint32_t ethr_atomic32_dec_read(ethr_atomic32_t *var)
return res;
}
+ethr_sint32_t ethr_atomic32_dec_read_ddrb(ethr_atomic32_t *var)
+{
+#if defined(ETHR_HAVE_32BIT_NATIVE_ATOMIC_OPS)
+ return ethr_atomic32_dec_read_ddrb__(var);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic32_dec_read(var);
+#else
+ return ethr_atomic32_dec_read_rb(var);
+#endif
+}
+
ethr_sint32_t ethr_atomic32_dec_read_rb(ethr_atomic32_t *var)
{
ethr_sint32_t res;
@@ -3272,6 +3566,17 @@ void ethr_atomic32_add(ethr_atomic32_t *var, ethr_sint32_t val)
}
+void ethr_atomic32_add_ddrb(ethr_atomic32_t *var, ethr_sint32_t val)
+{
+#if defined(ETHR_HAVE_32BIT_NATIVE_ATOMIC_OPS)
+ ethr_atomic32_add_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ ethr_atomic32_add(var, val);
+#else
+ ethr_atomic32_add_rb(var, val);
+#endif
+}
+
void ethr_atomic32_add_rb(ethr_atomic32_t *var, ethr_sint32_t val)
{
ETHR_ASSERT(!ethr_not_inited__);
@@ -3354,6 +3659,17 @@ void ethr_atomic32_inc(ethr_atomic32_t *var)
}
+void ethr_atomic32_inc_ddrb(ethr_atomic32_t *var)
+{
+#if defined(ETHR_HAVE_32BIT_NATIVE_ATOMIC_OPS)
+ ethr_atomic32_inc_ddrb__(var);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ ethr_atomic32_inc(var);
+#else
+ ethr_atomic32_inc_rb(var);
+#endif
+}
+
void ethr_atomic32_inc_rb(ethr_atomic32_t *var)
{
ETHR_ASSERT(!ethr_not_inited__);
@@ -3436,6 +3752,17 @@ void ethr_atomic32_dec(ethr_atomic32_t *var)
}
+void ethr_atomic32_dec_ddrb(ethr_atomic32_t *var)
+{
+#if defined(ETHR_HAVE_32BIT_NATIVE_ATOMIC_OPS)
+ ethr_atomic32_dec_ddrb__(var);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ ethr_atomic32_dec(var);
+#else
+ ethr_atomic32_dec_rb(var);
+#endif
+}
+
void ethr_atomic32_dec_rb(ethr_atomic32_t *var)
{
ETHR_ASSERT(!ethr_not_inited__);
@@ -3519,6 +3846,17 @@ ethr_sint32_t ethr_atomic32_read_band(ethr_atomic32_t *var, ethr_sint32_t val)
return res;
}
+ethr_sint32_t ethr_atomic32_read_band_ddrb(ethr_atomic32_t *var, ethr_sint32_t val)
+{
+#if defined(ETHR_HAVE_32BIT_NATIVE_ATOMIC_OPS)
+ return ethr_atomic32_read_band_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic32_read_band(var, val);
+#else
+ return ethr_atomic32_read_band_rb(var, val);
+#endif
+}
+
ethr_sint32_t ethr_atomic32_read_band_rb(ethr_atomic32_t *var, ethr_sint32_t val)
{
ethr_sint32_t res;
@@ -3607,6 +3945,17 @@ ethr_sint32_t ethr_atomic32_read_bor(ethr_atomic32_t *var, ethr_sint32_t val)
return res;
}
+ethr_sint32_t ethr_atomic32_read_bor_ddrb(ethr_atomic32_t *var, ethr_sint32_t val)
+{
+#if defined(ETHR_HAVE_32BIT_NATIVE_ATOMIC_OPS)
+ return ethr_atomic32_read_bor_ddrb__(var, val);
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ return ethr_atomic32_read_bor(var, val);
+#else
+ return ethr_atomic32_read_bor_rb(var, val);
+#endif
+}
+
ethr_sint32_t ethr_atomic32_read_bor_rb(ethr_atomic32_t *var, ethr_sint32_t val)
{
ethr_sint32_t res;
diff --git a/erts/lib_src/common/ethr_aux.c b/erts/lib_src/common/ethr_aux.c
index 521640317e..f4ff08d368 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2012. 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
@@ -40,7 +40,7 @@
#include <unistd.h>
#endif
-#define ERTS_TS_EV_ALLOC_DEFAULT_POOL_SIZE 100
+#define ERTS_TS_EV_ALLOC_DEFAULT_POOL_SIZE 4000
#define ERTS_TS_EV_ALLOC_POOL_SIZE 25
erts_cpu_info_t *ethr_cpu_info__;
diff --git a/erts/lib_src/utils/make_atomics_api b/erts/lib_src/utils/make_atomics_api
index f4e71c7618..74736c5a2d 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. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -50,7 +50,9 @@
-define(DW_RTCHK_MACRO, "ETHR_RTCHK_USE_NATIVE_DW_ATOMIC_IMPL__").
%% Barrier versions we implement
--define(BARRIERS, [none, rb, wb, acqb, relb, mb]).
+-define(BARRIERS, [none, ddrb, rb, wb, acqb, relb, mb]).
+-define(NON_NATIVE_BARRIERS, [ddrb]).
+-define(NATIVE_BARRIERS, (?BARRIERS -- ?NON_NATIVE_BARRIERS)).
-define(ATOMIC_SIZES, ["dword", "word", "32"]).
@@ -381,7 +383,6 @@ do_func_header(#atomic_context{dw = true,
cmpxchg, Inline, Func) ->
[Inline, "int ", Func, "(", AtomicT, " *", Arg1, ", ", AintT, " *", Arg2, ", ", AintT, " *", Arg3, ")"].
-
xbarriers(_Op, none, _NB) ->
{"", ""};
@@ -455,7 +456,7 @@ try_barrier_order_first(mb) ->
try_barrier_order(B) ->
First = try_barrier_order_first(B),
- First ++ (?BARRIERS -- First).
+ First ++ (?NATIVE_BARRIERS -- First).
native_barrier_op(#atomic_context{'NATMC' = NATMC} = AC, If, ExtraDecl, Op, B, NB, TypeCasts) ->
NOpStr = opstr(native(Op)),
@@ -571,12 +572,12 @@ do_cmpxchg_fallback_define(#atomic_context{'NATMC' = NATMC,
NoneTryBarrierOrder = try_barrier_order(none),
%% First a sanity check
["
-#if (", NotDefCMPXCHG(hd(?BARRIERS)) ,
+#if (", NotDefCMPXCHG(hd(?NATIVE_BARRIERS)) ,
lists:map(fun (B) ->
[" \\
&& ", NotDefCMPXCHG(B)]
end,
- tl(?BARRIERS)), ")
+ tl(?NATIVE_BARRIERS)), ")
# error \"No native cmpxchg() op available\"
#endif
@@ -744,7 +745,7 @@ translate_have_defs(#atomic_context{dw = DW, 'NATMC' = NATMC}) ->
]
end]
end,
- ?BARRIERS)
+ ?NATIVE_BARRIERS)
end,
case DW of
true -> ?DW_ATOMIC_OPS;
@@ -801,6 +802,69 @@ rtchk_fallback_call(Return, #atomic_context{dw = DW,
false -> [RetVar, " ="]
end, [?DW_FUNC_MACRO, "(", opstr(Op), op_barrier_ext(B), ")"], Arg1, Arg2, Arg3, "").
+non_native_barrier(B) ->
+ lists:member(B, ?NON_NATIVE_BARRIERS).
+
+non_native_barrier_impl(AC, inline_implementation = Type, Op, B) ->
+ ["
+", func_header(AC, Type, false, Op, B), "
+{",
+ case B of
+ ddrb ->
+ ["
+#ifdef ETHR_ORDERED_READ_DEPEND
+ ", func_call(AC, Type, Op, none, true), "
+#else
+ ", func_call(AC, Type, Op, rb, true), "
+#endif
+"
+ ]
+ end,
+ "}
+"
+ ];
+non_native_barrier_impl(#atomic_context{have_native_atomic_ops = HaveNative} = AC,
+ implementation = Type,
+ Op,
+ B) ->
+ ["
+", func_header(AC, Type, false, Op, B), "
+{",
+ case B of
+ ddrb ->
+ ["
+#if defined(", HaveNative, ")
+ ", func_call(AC, Type, Op, B, true), "
+#elif defined(ETHR_ORDERED_READ_DEPEND)
+ ", func_call(AC, symbol_implementation, Op, none, true), "
+#else
+ ", func_call(AC, symbol_implementation, Op, rb, true), "
+#endif
+"
+ ]
+ end,
+ "}
+"
+ ].
+
+func_call(#atomic_context{'ATMC' = ATMC} = AC, inline_implementation, Op, B, RetStatement) ->
+ func_call(AC, Op, ["ETHR_", ATMC, "_FUNC__(", opstr(Op), op_barrier_ext(B), ")"], RetStatement);
+func_call(#atomic_context{atomic = Atomic} = AC, implementation, Op, B, RetStatement) ->
+ func_call(AC, Op, [Atomic, "_", opstr(Op), op_barrier_ext(B), "__"], RetStatement);
+func_call(#atomic_context{atomic = Atomic} = AC, symbol_implementation, Op, B, RetStatement) ->
+ func_call(AC, Op, [Atomic, "_", opstr(Op), op_barrier_ext(B)], RetStatement).
+
+func_call(#atomic_context{dw = DW, arg1 = Arg1, arg2 = Arg2, arg3 = Arg3} = AC, Op, Func, true) ->
+ op_call(Op, DW, case is_return_op(AC, Op) of
+ true -> "return";
+ false -> ""
+ end, Func, Arg1, Arg2, Arg3, "");
+func_call(#atomic_context{dw = DW, arg1 = Arg1, arg2 = Arg2, arg3 = Arg3, ret_var = RetVar} = AC, Op, Func, false) ->
+ op_call(Op, DW, case is_return_op(AC, Op) of
+ true -> [RetVar, " = "];
+ false -> ""
+ end, Func, Arg1, Arg2, Arg3, "").
+
make_implementations(#atomic_context{dw = DW,
ret_type = RetType,
ret_var = RetVar,
@@ -858,73 +922,78 @@ make_implementations(#atomic_context{dw = DW,
",
lists:map(fun (B) ->
- TryBarriers = try_barrier_order(B),
- ["
+ case non_native_barrier(B) of
+ true ->
+ non_native_barrier_impl(AC, inline_implementation, Op, B);
+ false ->
+ TryBarriers = try_barrier_order(B),
+ ["
", func_header(AC, inline_implementation, false, Op, B), "
{
",
- case is_return_op(AC, Op) of
- true ->
- [" ", RetType, " ", RetVar, ";\n"];
- _ -> ""
- end,
- case DW of
- true ->
- [RtchkBegin,
- "\n",
- su_dw_native_barrier_op(AC, "#if", Op, B, hd(TryBarriers)),
- lists:map(fun (NB) ->
- su_dw_native_barrier_op(AC, "#elif", Op, B, NB)
- end,
- tl(TryBarriers)),
- lists:map(fun (NB) ->
- dw_native_barrier_op(AC, "#elif", "", Op, B, NB)
- end,
- TryBarriers),
- case simple_fallback(AC, Op, B) of
- "" ->
- %% No simple fallback available;
- %% use cmpxchg() fallbacks...
- [cmpxchg_fallbacks(AC#atomic_context{'NATMC' = ["SU_", NATMC]}, true, Op, B),
- cmpxchg_fallbacks(AC, false, Op, B),
- "#else
+ case is_return_op(AC, Op) of
+ true ->
+ [" ", RetType, " ", RetVar, ";\n"];
+ _ -> ""
+ end,
+ case DW of
+ true ->
+ [RtchkBegin,
+ "\n",
+ su_dw_native_barrier_op(AC, "#if", Op, B, hd(TryBarriers)),
+ lists:map(fun (NB) ->
+ su_dw_native_barrier_op(AC, "#elif", Op, B, NB)
+ end,
+ tl(TryBarriers)),
+ lists:map(fun (NB) ->
+ dw_native_barrier_op(AC, "#elif", "", Op, B, NB)
+ end,
+ TryBarriers),
+ case simple_fallback(AC, Op, B) of
+ "" ->
+ %% No simple fallback available;
+ %% use cmpxchg() fallbacks...
+ [cmpxchg_fallbacks(AC#atomic_context{'NATMC' = ["SU_", NATMC]}, true, Op, B),
+ cmpxchg_fallbacks(AC, false, Op, B),
+ "#else
#error \"Missing implementation of ", Atomic, "_", opstr(Op), op_barrier_ext(B), "()!\"
#endif
"
- ];
- SimpleFallback ->
- ["#else\n", SimpleFallback, "#endif\n"]
- end,
- RtchkEnd(false, Op, B), "\n"];
- false ->
- [native_barrier_op(AC, "#if", "", Op, B, hd(TryBarriers), true),
- lists:map(fun (NB) ->
- native_barrier_op(AC, "#elif", "", Op, B, NB, true)
- end,
- tl(TryBarriers)),
- case simple_fallback(AC, Op, B) of
- "" ->
- %% No simple fallback available;
- %% use cmpxchg() fallbacks...
- [cmpxchg_fallbacks(AC, false, Op, B),
- "#else
+ ];
+ SimpleFallback ->
+ ["#else\n", SimpleFallback, "#endif\n"]
+ end,
+ RtchkEnd(false, Op, B), "\n"];
+ false ->
+ [native_barrier_op(AC, "#if", "", Op, B, hd(TryBarriers), true),
+ lists:map(fun (NB) ->
+ native_barrier_op(AC, "#elif", "", Op, B, NB, true)
+ end,
+ tl(TryBarriers)),
+ case simple_fallback(AC, Op, B) of
+ "" ->
+ %% No simple fallback available;
+ %% use cmpxchg() fallbacks...
+ [cmpxchg_fallbacks(AC, false, Op, B),
+ "#else
#error \"Missing implementation of ", Atomic, "_", opstr(Op), op_barrier_ext(B), "()!\"
#endif
"
- ];
- SimpleFallback ->
- ["#else\n", SimpleFallback, "#endif\n"]
- end]
- end,
- case is_return_op(AC, Op) of
- true ->
- [" return ", RetVar, ";\n"];
- false ->
- ""
- end,
- "}\n"]
+ ];
+ SimpleFallback ->
+ ["#else\n", SimpleFallback, "#endif\n"]
+ end]
+ end,
+ case is_return_op(AC, Op) of
+ true ->
+ [" return ", RetVar, ";\n"];
+ false ->
+ ""
+ end,
+ "}\n"]
+ end
end,
- ?BARRIERS)]
+ ?NATIVE_BARRIERS ++ ?NON_NATIVE_BARRIERS)] %% non-native needs to be after native...
end,
case DW of
true -> ?DW_ATOMIC_OPS;
@@ -1159,33 +1228,38 @@ int ethr_have_native_dw_atomic(void)
",
lists:map(fun (B) ->
- ["\n",
- func_header(AC, implementation,
- case DW of
- true -> ?DW_FUNC_MACRO;
- false -> false
- end, Op, B),
- "\n{\n",
- case is_return_op(AC, Op) of
- true -> [" ", RetType, " ", RetVar, ";\n"];
- false -> ""
- end,
- case Op of
- init -> "";
- _ -> [" ETHR_ASSERT(!ethr_not_inited__);\n"]
- end,
- [" ETHR_ASSERT(", Arg1, ");\n"],
- make_native_impl_op(AC, Op, B),
- make_amc_fallback_op(AC#atomic_context{arg1 = FallbackVar}, Op, B),
- make_locked_fallback_op(AC#atomic_context{arg1 = FallbackVar}, Op, B),
- case is_return_op(AC, Op) of
- true -> [" return ", RetVar, ";"
- ];
- false ->
- ""
- end,
- "\n}\n",
- make_symbol_to_fallback_impl(AC, Op, B)]
+ Macro = case DW of
+ true -> ?DW_FUNC_MACRO;
+ false -> false
+ end,
+ case non_native_barrier(B) of
+ true ->
+ non_native_barrier_impl(AC, implementation, Op, B);
+ false ->
+ ["\n",
+ func_header(AC, implementation, Macro, Op, B),
+ "\n{\n",
+ case is_return_op(AC, Op) of
+ true -> [" ", RetType, " ", RetVar, ";\n"];
+ false -> ""
+ end,
+ case Op of
+ init -> "";
+ _ -> [" ETHR_ASSERT(!ethr_not_inited__);\n"]
+ end,
+ [" ETHR_ASSERT(", Arg1, ");\n"],
+ make_native_impl_op(AC, Op, B),
+ make_amc_fallback_op(AC#atomic_context{arg1 = FallbackVar}, Op, B),
+ make_locked_fallback_op(AC#atomic_context{arg1 = FallbackVar}, Op, B),
+ case is_return_op(AC, Op) of
+ true -> [" return ", RetVar, ";"
+ ];
+ false ->
+ ""
+ end,
+ "\n}\n",
+ make_symbol_to_fallback_impl(AC, Op, B)]
+ end
end,
?BARRIERS)]
end,
@@ -1233,7 +1307,7 @@ static char *native_", DW, "atomic", Bits, "_ops[] = {",
#endif"
]
end,
- ?BARRIERS)
+ ?NATIVE_BARRIERS)
end,
case NBits of
"dw" -> ?DW_ATOMIC_OPS;
@@ -1390,25 +1464,51 @@ comments() ->
* Appart from a function implementing the atomic operation
* with unspecified memory barrier semantics, there are
* functions implementing each operation with the following
- * memory barrier semantics:
-",
+ * implied memory barrier semantics:",
lists:map(fun (none) ->
"";
- (rb) ->
- [" * - rb (read barrier)\n"];
- (wb) ->
- [" * - wb (write barrier)\n"];
+ (mb) ->
+ ["
+ * - mb - Full memory barrier. Orders both loads, and
+ * stores before, and after the atomic operation.
+ * No load or store is allowed to be reordered
+ * over the atomic operation."];
(acqb) ->
- [" * - acqb (acquire barrier)\n"];
+ ["
+ * - acqb - Acquire barrier. Orders both loads, and stores
+ * appearing *after* the atomic operation. These
+ * are not allowed to be reordered over the
+ * atomic operation."];
(relb) ->
- [" * - relb (release barrier)\n"];
- (mb) ->
- [" * - mb (full memory barrier)\n"];
+ ["
+ * - relb - Release barrier. Orders both loads, and
+ * stores appearing *before* the atomic
+ * operation. These are not allowed to be
+ * reordered over the atomic operation."];
+ (rb) ->
+ ["
+ * - rb - Read barrier. Orders *only* loads. These are
+ * not allowed to be reordered over the barrier.
+ * Load in atomic operation is ordered *before*
+ * the barrier. "];
+ (ddrb) ->
+ ["
+ * - ddrb - Data dependency read barrier. Orders *only*
+ * loads according to data dependency across the
+ * barrier. Load in atomic operation is ordered
+ * before the barrier."];
+ (wb) ->
+ ["
+ * - wb - Write barrier. Orders *only* stores. These are
+ * not allowed to be reordered over the barrier.
+ * Store in atomic operation is ordered *after*
+ * the barrier."];
(B) ->
[" * - ", a2l(B), "\n"]
end,
- ?BARRIERS),
- " *
+ lists:reverse(?BARRIERS)),
+ "
+ *
* We implement all of these operation/barrier
* combinations, regardless of whether they are useful
* or not (some of them are useless).
diff --git a/erts/ntbuild.erl b/erts/ntbuild.erl
deleted file mode 100644
index e48be58c17..0000000000
--- a/erts/ntbuild.erl
+++ /dev/null
@@ -1,332 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%% To be used from makefiles on the unix side executing things on the NT-side
--module(ntbuild).
-
--export([nmake/1, omake/1, waitnode/1, restart/1,
- setdir/1, run_tests/1, run_command/1]).
--export([serv_nmake/2, serv_omake/2, serv_restart/0, serv_run_tests/2,
- serv_run_command/1]).
-
-waitnode([NtNode]) ->
- % First, wait for node to disappear.
- case wait_disappear(NtNode, 0) of
- ok ->
- case wait_appear(NtNode, 0) of
- ok ->
- halt(0);
- fail ->
- halt(1)
- end;
- fail ->
- halt(1)
- end.
-
-% Wait for nt node to appear within 5 minutes.
-wait_appear(_NtNode, 300) ->
- fail;
-wait_appear(NtNode, N) ->
- receive after 1000 -> ok end,
- case nt_node_alive(NtNode, quiet) of
- no ->
- wait_appear(NtNode, N+1);
- yes ->
- ok
- end.
-
-
-
-% Waits for nt node to disappear within 3 minutes.
-wait_disappear(NtNode, 300) ->
- fail;
-wait_disappear(NtNode, N) ->
- receive after 1000 -> ok end,
- case nt_node_alive(NtNode, quiet) of
- yes ->
- wait_disappear(NtNode, N+1);
- no ->
- ok
- end.
-
-restart([NtNode]) ->
- case nt_node_alive(NtNode) of
- yes ->
- case rpc:call(NtNode, ntbuild, serv_restart, []) of
- ok ->
- io:format("halt(0)~n"),
- halt();
- Error ->
- io:format("halt(1)~n"),
- halt(1)
- end;
- no ->
- halt(1)
- end.
-
-
-setdir([NtNode, Dir0]) ->
- Dir = atom_to_list(Dir0),
- case nt_node_alive(NtNode) of
- yes ->
- case rpc:call(NtNode, file, set_cwd, [Dir]) of
- ok ->
- io:format("halt(0)~n"),
- halt();
- Error ->
- io:format("halt(1) (Error: ~p) (~p not found) ~n", [Error, Dir]),
- halt(1)
- end;
- no ->
- halt(1)
- end.
-
-run_tests([NtNode, Vsn0, Logdir]) ->
- Vsn = atom_to_list(Vsn0),
- case nt_node_alive(NtNode) of
- yes ->
- case rpc:call(NtNode, ntbuild, serv_run_tests, [Vsn, Logdir]) of
- ok ->
- io:format("halt(0)~n"),
- halt();
- Error ->
- io:format("RPC To Windows Node Failed: ~p~n", [Error]),
- io:format("halt(1)~n"),
- halt(1)
- end;
- no ->
- halt(1)
- end.
-
-run_command([NtNode, Cmd]) ->
- case nt_node_alive(NtNode) of
- yes ->
- case rpc:call(NtNode, ntbuild, serv_run_command, [Cmd]) of
- ok ->
- io:format("halt(0)~n"),
- halt();
- Error ->
- io:format("RPC To Windows Node Failed: ~p~n", [Error]),
- io:format("halt(1)~n"),
- halt(1)
- end;
- no ->
- halt(1)
- end.
-
-nmake([NtNode, Path, Options]) ->
-% io:format("nmake2(~w,~w)~n",[Path, Options]),
- Dir=atom_to_list(Path),
- Opt=atom_to_list(Options),
- case nt_node_alive(NtNode) of
- yes ->
- case rpc:call(NtNode, ntbuild, serv_nmake, [Dir, Opt]) of
- ok ->
- io:format("halt(0)~n"),
- halt();
- Error ->
- io:format("Error: ~n", [Error]),
- halt(1)
- end;
- no ->
- halt(1)
- end.
-
-omake([NtNode, Path, Options]) ->
- Dir=atom_to_list(Path),
- Opt=atom_to_list(Options),
- case nt_node_alive(NtNode) of
- yes ->
- case rpc:call(NtNode, ntbuild, serv_omake, [Dir, Opt]) of
- ok ->
- io:format("halt(0)~n"),
- halt();
- Error ->
- io:format("RPC To Windows Node Failed: ~p~n", [Error]),
- io:format("~p ~p~n", [Dir, Opt]),
- io:format("halt(1)~n"),
- halt(1)
- end;
- no ->
- halt(1)
- end.
-
-
-
-
-
-nt_node_alive(NtNode) ->
- case net:ping(NtNode) of
- pong ->
- yes;
- pang ->
- io:format("The NT node (~p) is not up. ~n",[NtNode]),
- no
- end.
-
-nt_node_alive(NtNode, quiet) ->
- case net:ping(NtNode) of
- pong ->
- yes;
- pang ->
- no
- end.
-
-
-
-%%%
-%%% The 'serv_' functions. Theese are the routines run on the WinNT node.
-%%%
-
-%%-----------------------
-%% serv_run_tests()
-%% Runs the tests.
-serv_run_tests(Vsn, Logdir) ->
- {ok, Cwd}=file:get_cwd(),
- io:format("serv_run_tests ~p ~p ~n", [Vsn, Logdir]),
- Cmd0= "set central_log_dir=" ++ Logdir,
- Erl = "C:/progra~1/erl"++Vsn++"/bin/erl",
- Cmd1 = Erl++" -sname a -setcookie a -noshell -noinput -s ts install -s ts run -s ts save -s erlang halt",
-%% Dir = "C:/temp/test_suite/test_server",
- Cmd= Cmd0 ++ "/r/n" ++ Cmd1,
- Dir = "C:/temp/test_server/p7a/test_server",
- file:set_cwd(Dir),
- Res=run_make_bat(Dir, Cmd),
- file:set_cwd(Cwd),
- Res.
-
-%%-----------------------
-%% serv_run_command()
-%% Runs a command.
-serv_run_command(Cmd) ->
- {ok, Cwd}=file:get_cwd(),
- Res=run_make_bat("", Cmd),
- file:set_cwd(Cwd),
- Res.
-
-%%-----------------------
-%% serv_restart()
-%% Reboots the NT machine.
-serv_restart() ->
- Exe="\\erts\\install_nt\\reboot.exe",
- open_port({spawn, Exe}, [stream, eof, in]),
- ok.
-
-
-%%-----------------------
-%% serv_nmake(Path, Options)
-%% Runs `nmake' in the given directory.
-%% Result: ok | error
-serv_nmake(Path, Options) ->
- {ok, Cwd}=file:get_cwd(),
- Command="nmake -e -f Makefile.win32 " ++ Options ++ " 2>&1",
- Res=run_make_bat(Path, Command),
- file:set_cwd(Cwd),
- Res.
-
-%%-----------------------
-%% serv_omake(Path, Options)
-%% Runs `omake' in the given directory.
-%% Result: ok | error
-serv_omake(Path, Options) ->
- {ok, Cwd}=file:get_cwd(),
- Command="omake -W -E -EN -f Makefile.win32 " ++ Options ++ " 2>&1",
- Res=run_make_bat(Path, Command),
- file:set_cwd(Cwd),
- Res.
-
-
-read_output(Port, SoFar) ->
-% io:format("(read_output)~n"),
- case get_data_from_port(Port) of
- eof ->
- io:format("*** eof ***~n"),
- io:format("Never reached a real message"),
- halt(1);
- {ok, Data} ->
- case print_line([SoFar|Data]) of
- {ok, Rest} ->
- read_output(Port, Rest);
- {done, Res} ->
- Res
- end
- end.
-
-print_line(Data) ->
- print_line(Data, []).
-
-print_line([], Acc) ->
- {ok, lists:reverse(Acc)};
-print_line([$*,$o,$k,$*|Rest], _Acc) ->
- io:format("*ok*~n"),
- {done, ok};
-print_line([$*,$e,$r,$r,$o,$r|Rest], _Acc) ->
- io:format("*error*~n"),
- {done, error};
-print_line([$\r,$\n|Rest], Acc) ->
- io:format("~s~n", [lists:reverse(Acc)]),
- print_line(Rest, []);
-print_line([Chr|Rest], Acc) ->
- print_line(Rest, [Chr|Acc]).
-
-get_data_from_port(Port) ->
- receive
- {Port, {data, Bytes}} ->
- {ok, Bytes};
- {Port, eof} ->
- unlink(Port),
- exit(Port, die),
- eof;
- Other ->
- io:format("Strange message received: ~p~n", [Other]),
- get_data_from_port(Port)
- end.
-
-
-run_make_bat(Dir, Make) ->
- {Name, Exe, Script}=create_make_script(Dir, Make),
- io:format("Exe:~p Cwd:~p Script:~p ~n",[Exe, Dir, Script]),
- case file:write_file(Name, Script) of
- ok ->
- case catch open_port({spawn, Exe}, [stderr_to_stdout, stream, hide,
- eof, in]) of
- Port when port(Port) ->
- read_output(Port, []);
- Other ->
- io:format("Error, open_port failed: ~p~n", [Other]),
- {open_port, Other, Exe}
- end;
- Error ->
- {write_file, Error, Name}
- end.
-
-create_make_script(Dir, Make) when atom(Make) ->
- create_make_script(Dir, atom_to_list(Make));
-create_make_script(Dir, Make) ->
- {"run_make_bs.bat",
- "run_make_bs 2>&1",
- ["@echo off\r\n",
- "@cd ", Dir, "\r\n",
- Make++"\r\n",
- "if errorlevel 1 echo *run_make_bs error*\r\n",
- "if not errorlevel 1 echo *ok*\r\n"]}.
-
-
-
-
-
diff --git a/erts/preloaded/ebin/erl_prim_loader.beam b/erts/preloaded/ebin/erl_prim_loader.beam
index df1831f340..e46795e2b1 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/erlang.beam b/erts/preloaded/ebin/erlang.beam
index 9e369d5348..66b7a011d6 100644
--- a/erts/preloaded/ebin/erlang.beam
+++ b/erts/preloaded/ebin/erlang.beam
Binary files differ
diff --git a/erts/preloaded/ebin/init.beam b/erts/preloaded/ebin/init.beam
index cc170b86b2..1a250932da 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 45a409738c..2fa007f683 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_file.beam b/erts/preloaded/ebin/prim_file.beam
index 87e80aae9b..19cf856754 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 f382236af7..5409cf2dfc 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 411fc8d524..55697cfe11 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 bf88a51502..d2f30fd9cd 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 145638802f..5bcc2eb6e4 100644
--- a/erts/preloaded/src/Makefile
+++ b/erts/preloaded/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2010. All Rights Reserved.
+# Copyright Ericsson AB 2008-2012. 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
@@ -68,10 +68,10 @@ copy:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec:
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(STATIC_TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(STATIC_TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/erts/preloaded/src/erl_prim_loader.erl b/erts/preloaded/src/erl_prim_loader.erl
index 14a7a2bf20..d36fdeba3f 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -49,7 +49,7 @@
prim_read_file_info/2, prim_get_cwd/2]).
%% Used by escript and code
--export([set_primary_archive/3, release_archives/0]).
+-export([set_primary_archive/4, release_archives/0]).
-include_lib("kernel/include/file.hrl").
@@ -222,15 +222,16 @@ get_cwd(Drive) ->
check_file_result(get_cwd, Drive, request({get_cwd,[Drive]})).
-spec set_primary_archive(File :: string() | 'undefined',
- ArchiveBin :: binary() | 'undefined',
- FileInfo :: #file_info{} | 'undefined')
+ ArchiveBin :: binary() | 'undefined',
+ FileInfo :: #file_info{} | 'undefined',
+ ParserFun :: fun())
-> {ok, [string()]} | {error,_}.
-set_primary_archive(undefined, undefined, undefined) ->
- request({set_primary_archive, undefined, undefined, undefined});
-set_primary_archive(File, ArchiveBin, FileInfo)
+set_primary_archive(undefined, undefined, undefined, ParserFun) ->
+ request({set_primary_archive, undefined, undefined, undefined, ParserFun});
+set_primary_archive(File, ArchiveBin, FileInfo, ParserFun)
when is_list(File), is_binary(ArchiveBin), is_record(FileInfo, file_info) ->
- request({set_primary_archive, File, ArchiveBin, FileInfo}).
+ request({set_primary_archive, File, ArchiveBin, FileInfo, ParserFun}).
-spec release_archives() -> 'ok' | {'error', _}.
@@ -318,8 +319,11 @@ loop(State, Parent, Paths) ->
{get_cwd,[_]=Args} ->
{Res,State1} = handle_get_cwd(State, Args),
{Res,State1,Paths};
- {set_primary_archive,File,Bin,FileInfo} ->
- {Res,State1} = handle_set_primary_archive(State, File, Bin, FileInfo),
+ {set_primary_archive,File,ArchiveBin,FileInfo,ParserFun} ->
+ {Res,State1} =
+ handle_set_primary_archive(State, File,
+ ArchiveBin, FileInfo,
+ ParserFun),
{Res,State1,Paths};
release_archives ->
{Res,State1} = handle_release_archives(State),
@@ -359,8 +363,8 @@ handle_get_file(State = #state{loader = efile}, Paths, File) ->
handle_get_file(State = #state{loader = inet}, Paths, File) ->
?SAFE2(inet_get_file_from_port(State, File, Paths), State).
-handle_set_primary_archive(State= #state{loader = efile}, File, Bin, FileInfo) ->
- ?SAFE2(efile_set_primary_archive(State, File, Bin, FileInfo), State).
+handle_set_primary_archive(State= #state{loader = efile}, File, ArchiveBin, FileInfo, ParserFun) ->
+ ?SAFE2(efile_set_primary_archive(State, File, ArchiveBin, FileInfo, ParserFun), State).
handle_release_archives(State= #state{loader = efile}) ->
?SAFE2(efile_release_archives(State), State).
@@ -484,8 +488,10 @@ efile_get_file_from_port3(State, File, [P | Paths]) ->
efile_get_file_from_port3(State, _File, []) ->
{{error,enoent},State}.
-efile_set_primary_archive(#state{prim_state = PS} = State, File, Bin, FileInfo) ->
- {Res, PS2} = prim_set_primary_archive(PS, File, Bin, FileInfo),
+efile_set_primary_archive(#state{prim_state = PS} = State, File,
+ ArchiveBin, FileInfo, ParserFun) ->
+ {Res, PS2} = prim_set_primary_archive(PS, File, ArchiveBin,
+ FileInfo, ParserFun),
{Res,State#state{prim_state = PS2}}.
efile_release_archives(#state{prim_state = PS} = State) ->
@@ -791,7 +797,7 @@ prim_release_archives(PS) ->
prim_do_release_archives(PS, [{ArchiveFile, DictVal} | KeyVals], Acc) ->
Res =
case DictVal of
- {primary, _PrimZip, _FI} ->
+ {primary, _PrimZip, _FI, _ParserFun} ->
ok; % Keep primary archive
{Cache, _FI} ->
debug(PS, {release, cache, ArchiveFile}),
@@ -809,7 +815,7 @@ prim_do_release_archives(PS, [], []) ->
prim_do_release_archives(PS, [], Errors) ->
{{error, Errors}, PS#prim_state{primary_archive = undefined}}.
-prim_set_primary_archive(PS, undefined, undefined, undefined) ->
+prim_set_primary_archive(PS, undefined, undefined, undefined, _ParserFun) ->
debug(PS, {set_primary_archive, clean}),
case PS#prim_state.primary_archive of
undefined ->
@@ -817,48 +823,40 @@ prim_set_primary_archive(PS, undefined, undefined, undefined) ->
debug(PS, {return, Res}),
{Res, PS};
ArchiveFile ->
- {primary, PrimZip, _FI} = erase(ArchiveFile),
+ {primary, PrimZip, _FI, _ParserFun2} = erase(ArchiveFile),
ok = prim_zip:close(PrimZip),
PS2 = PS#prim_state{primary_archive = undefined},
Res = {ok, []},
debug(PS2, {return, Res}),
{Res, PS2}
end;
-prim_set_primary_archive(PS, ArchiveFile, ArchiveBin, #file_info{} = FileInfo)
- when is_list(ArchiveFile), is_binary(ArchiveBin) ->
+
+prim_set_primary_archive(PS, ArchiveFile0, ArchiveBin,
+ #file_info{} = FileInfo, ParserFun)
+ when is_list(ArchiveFile0), is_binary(ArchiveBin) ->
%% Try the archive file
- debug(PS, {set_primary_archive, ArchiveFile, byte_size(ArchiveBin)}),
+ debug(PS, {set_primary_archive, ArchiveFile0, byte_size(ArchiveBin)}),
+ ArchiveFile = real_path(absname(ArchiveFile0)),
{Res3, PS3} =
case PS#prim_state.primary_archive of
undefined ->
- Fun =
- fun({Funny, _GI, _GB}, A) ->
- case Funny of
- ["", "nibe", RevApp] -> % Reverse ebin
- %% Collect ebin directories in archive
- Ebin = reverse(RevApp) ++ "/ebin",
- {true, [Ebin | A]};
- _ ->
- {true, A}
- end
- end,
- Ebins0 = [ArchiveFile],
- case open_archive({ArchiveFile, ArchiveBin}, FileInfo, Ebins0, Fun) of
- {ok, PrimZip, {RevEbins, FI, _}} ->
- Ebins = reverse(RevEbins),
+ case load_prim_archive(ArchiveFile, ArchiveBin, FileInfo) of
+ {ok, PrimZip, FI, Ebins} ->
debug(PS, {set_primary_archive, Ebins}),
- put(ArchiveFile, {primary, PrimZip, FI}),
- {{ok, Ebins}, PS#prim_state{primary_archive = ArchiveFile}};
+ put(ArchiveFile, {primary, PrimZip, FI, ParserFun}),
+ {{ok, Ebins},
+ PS#prim_state{primary_archive = ArchiveFile}};
Error ->
debug(PS, {set_primary_archive, Error}),
{Error, PS}
end;
OldArchiveFile ->
debug(PS, {set_primary_archive, clean}),
- {primary, PrimZip, _FI} = erase(OldArchiveFile),
+ {primary, PrimZip, _FI, _ParserFun} = erase(OldArchiveFile),
ok = prim_zip:close(PrimZip),
PS2 = PS#prim_state{primary_archive = undefined},
- prim_set_primary_archive(PS2, ArchiveFile, ArchiveBin, FileInfo)
+ prim_set_primary_archive(PS2, ArchiveFile, ArchiveBin,
+ FileInfo, ParserFun)
end,
debug(PS3, {return, Res3}),
{Res3, PS3}.
@@ -873,11 +871,11 @@ prim_get_file(PS, File) ->
{Res, PS};
{archive, ArchiveFile, FileInArchive} ->
debug(PS, {archive_get_file, ArchiveFile, FileInArchive}),
- FunnyFile = funny_split(FileInArchive, $/),
+ FileComponents = path_split(FileInArchive),
Fun =
- fun({Funny, _GetInfo, GetBin}, Acc) ->
+ fun({Components, _GetInfo, GetBin}, Acc) ->
if
- Funny =:= FunnyFile ->
+ Components =:= FileComponents ->
{false, {ok, GetBin()}};
true ->
{true, Acc}
@@ -900,11 +898,11 @@ prim_list_dir(PS, Dir) ->
{Res, PS};
{archive, ArchiveFile, FileInArchive} ->
debug(PS, {archive_list_dir, ArchiveFile, FileInArchive}),
- FunnyDir = funny_split(FileInArchive, $/),
+ DirComponents = path_split(FileInArchive),
Fun =
- fun({Funny, _GetInfo, _GetBin}, {Status, Names} = Acc) ->
- case Funny of
- [RevName | FD] when FD =:= FunnyDir ->
+ fun({Components, _GetInfo, _GetBin}, {Status, Names} = Acc) ->
+ case Components of
+ [RevName | DC] when DC =:= DirComponents ->
case RevName of
"" ->
%% The listed directory
@@ -914,16 +912,16 @@ prim_list_dir(PS, Dir) ->
Name = reverse(RevName),
{true, {Status, [Name | Names]}}
end;
- ["", RevName | FD] when FD =:= FunnyDir ->
+ ["", RevName | DC] when DC =:= DirComponents ->
%% Directory
Name = reverse(RevName),
{true, {Status, [Name | Names]}};
- [RevName] when FunnyDir =:= [""] ->
- %% Top file
+ [RevName] when DirComponents =:= [""] ->
+ %% File in top directory
Name = reverse(RevName),
{true, {ok, [Name | Names]}};
- ["", RevName] when FunnyDir =:= [""] ->
- %% Top file
+ ["", RevName] when DirComponents =:= [""] ->
+ %% Directory in top directory
Name = reverse(RevName),
{true, {ok, [Name | Names]}};
_ ->
@@ -962,15 +960,14 @@ prim_read_file_info(PS, File) ->
end;
{archive, ArchiveFile, FileInArchive} ->
debug(PS, {archive_read_file_info, File}),
- FunnyFile = funny_split(FileInArchive, $/),
+ FileComponents = path_split(FileInArchive),
Fun =
- fun({Funny, GetInfo, _GetBin}, Acc) ->
- case Funny of
- [H | T] when H =:= "",
- T =:= FunnyFile ->
+ fun({Components, GetInfo, _GetBin}, Acc) ->
+ case Components of
+ ["" | F] when F =:= FileComponents ->
%% Directory
{false, {ok, GetInfo()}};
- F when F =:= FunnyFile ->
+ F when F =:= FileComponents ->
%% Plain file
{false, {ok, GetInfo()}};
_ ->
@@ -1011,7 +1008,7 @@ apply_archive(PS, Fun, Acc, Archive) ->
%% put(Archive, {Error, FI}),
{Error, PS}
end;
- {primary, PrimZip, FI} ->
+ {primary, PrimZip, FI, ParserFun} ->
case prim_file:read_file_info(Archive) of
{ok, FI2}
when FI#file_info.mtime =:= FI2#file_info.mtime ->
@@ -1022,6 +1019,16 @@ apply_archive(PS, Fun, Acc, Archive) ->
debug(PS, {primary, Error}),
{Error, PS}
end;
+ {ok, FI2} ->
+ ok = clear_cache(Archive, {ok, PrimZip}),
+ case load_prim_archive(Archive, FI2, ParserFun) of
+ {ok, PrimZip2, FI3, _Ebins} ->
+ debug(PS, {cache, {update, Archive}}),
+ put(Archive, {primary, PrimZip2, FI3, ParserFun});
+ Error2 ->
+ debug(PS, {cache, {clear, Error2}})
+ end,
+ apply_archive(PS, Fun, Acc, Archive);
Error ->
debug(PS, {cache, {clear, Error}}),
clear_cache(Archive, {ok, PrimZip}),
@@ -1063,50 +1070,69 @@ open_archive(Archive, Acc, Fun) ->
{error, Reason}
end.
+%% Open the given archive and iterate through all files with an own
+%% wrapper fun in order to identify each file as a component list as
+%% returned from path_split/1.
+%%
+%% In the archive (zip) file, directory elements might or might not be
+%% present. To ensure consistency, a directory element is added if it
+%% does not already exist (ensure_virtual_dirs/6). NOTE that there will
+%% be no such directory element for the top directory of the archive.
open_archive(Archive, FileInfo, Acc, Fun) ->
FakeFI = FileInfo#file_info{type = directory},
Wrapper =
- fun({N, GI, GB}, {A, I, FunnyDirs}) -> % Full iteration at open
- Funny = funny_split(N, $/),
- FunnyDirs2 =
- case Funny of
- ["" | FunnyDir] ->
- [FunnyDir | FunnyDirs];
+ fun({N, GI, GB}, {A, I, Dirs}) ->
+ Components = path_split(N),
+ Dirs2 =
+ case Components of
+ ["" | Dir] ->
+ %% This is a directory
+ [Dir | Dirs];
_ ->
- FunnyDirs
+ %% This is a regular file
+ Dirs
end,
- {Includes, FunnyDirs3, A2} =
- ensure_virtual_dirs(Funny, Fun, FakeFI, [{true, Funny}], FunnyDirs2, A),
- {_Continue, A3} = Fun({Funny, GI, GB}, A2),
- {true, Includes, {A3, I, FunnyDirs3}}
+ {Includes, Dirs3, A2} =
+ ensure_virtual_dirs(Components, Fun, FakeFI,
+ [{true, Components}], Dirs2, A),
+ {_Continue, A3} = Fun({Components, GI, GB}, A2),
+ {true, Includes, {A3, I, Dirs3}}
end,
prim_zip:open(Wrapper, {Acc, FakeFI, []}, Archive).
-ensure_virtual_dirs(Funny, Fun, FakeFI, Includes, FunnyDirs, Acc) ->
- case Funny of
- [_ | FunnyDir] ->
- case lists:member(FunnyDir, FunnyDirs) of % BIF
+ensure_virtual_dirs(Components, Fun, FakeFI, Includes, Dirs, Acc) ->
+ case Components of
+ [_] ->
+ %% Don't add virtual dir for top directory
+ {Includes, Dirs, Acc};
+ [_ | Dir] ->
+ case lists:member(Dir, Dirs) of % BIF
false ->
+ %% The directory does not yet exist - add it
GetInfo = fun() -> FakeFI end,
GetBin = fun() -> <<>> end,
- VirtualDir = ["" | FunnyDir],
+ VirtualDir = ["" | Dir],
Includes2 = [{true, VirtualDir, GetInfo, GetBin} | Includes],
- FunnyDirs2 = [FunnyDir | FunnyDirs],
- {I, F, Acc2} = ensure_virtual_dirs(FunnyDir, Fun, FakeFI, Includes2, FunnyDirs2, Acc),
+ Dirs2 = [Dir | Dirs],
+
+ %% Recursively ensure dir elements on all levels
+ {I, F, Acc2} = ensure_virtual_dirs(Dir, Fun, FakeFI,
+ Includes2, Dirs2, Acc),
+
{_Continue, Acc3} = Fun({VirtualDir, GetInfo, GetBin}, Acc2),
{I, F, Acc3};
true ->
- {reverse(Includes), FunnyDirs, Acc}
- end;
- [] ->
- {reverse(Includes), FunnyDirs, Acc}
+ %% The directory element does already exist
+ %% Recursivly ensure dir elements on all levels
+ ensure_virtual_dirs(Dir,Fun,FakeFI,Includes,Dirs,Acc)
+ end
end.
foldl_archive(PrimZip, Acc, Fun) ->
Wrapper =
- fun({Funny, GI, GB}, A) ->
+ fun({Components, GI, GB}, A) ->
%% Allow partial iteration at foldl
- {Continue, A2} = Fun({Funny, GI, GB}, A),
+ {Continue, A2} = Fun({Components, GI, GB}, A),
{Continue, true, A2}
end,
prim_zip:foldl(Wrapper, Acc, PrimZip).
@@ -1202,17 +1228,32 @@ reverse([A, B]) ->
reverse([A, B | L]) ->
lists:reverse(L, [B, A]). % BIF
-%% Returns all lists in reverse order
-funny_split(List, Sep) ->
- funny_split(List, Sep, [], []).
-
-funny_split([Sep | Tail], Sep, Path, Paths) ->
- funny_split(Tail, Sep, [], [Path | Paths]);
-funny_split([Head | Tail], Sep, Path, Paths) ->
- funny_split(Tail, Sep, [Head | Path], Paths);
-funny_split([], _Sep, Path, Paths) ->
+%% Returns a reversed list of path components, each component itself a
+%% reversed list (string), e.g.
+%% /path/to/file -> ["elif","ot","htap",""]
+%% /path/to/dir/ -> ["","rid","ot","htap",""]
+%% Note the "" marking leading and trailing / (slash).
+path_split(List) ->
+ path_split(List, [], []).
+
+path_split([$/ | Tail], Path, Paths) ->
+ path_split(Tail, [], [Path | Paths]);
+path_split([Head | Tail], Path, Paths) ->
+ path_split(Tail, [Head | Path], Paths);
+path_split([], Path, Paths) ->
[Path | Paths].
+%% The opposite of path_split/1
+path_join(Paths) ->
+ path_join(Paths,[]).
+
+path_join([""],Acc) ->
+ Acc;
+path_join([Path],Acc) ->
+ reverse(Path) ++ Acc;
+path_join([Path|Paths],Acc) ->
+ path_join(Paths,"/" ++ reverse(Path) ++ Acc).
+
name_split(ArchiveFile, File0) ->
File = absname(File0),
do_name_split(ArchiveFile, File).
@@ -1235,26 +1276,22 @@ do_name_split(undefined, File) ->
%% False match. Assume plain file
{file, File}
end;
-do_name_split(ArchiveFile0, File) ->
+do_name_split(ArchiveFile, File) ->
%% Look first in primary archive
- ArchiveFile = absname(ArchiveFile0),
- case string_match(File, ArchiveFile, []) of
+ case string_match(real_path(File), ArchiveFile, []) of
no_match ->
%% Archive or plain file
do_name_split(undefined, File);
{match, _RevPrimArchiveFile, FileInArchive} ->
%% Primary archive
- case FileInArchive of
- [$/ | FileInArchive2] ->
- {archive, ArchiveFile, FileInArchive2};
- _ ->
- {archive, ArchiveFile, FileInArchive}
- end
+ {archive, ArchiveFile, FileInArchive}
end.
string_match([Char | File], [Char | Archive], RevTop) ->
string_match(File, Archive, [Char | RevTop]);
-string_match(File, [], RevTop) ->
+string_match([] = File, [], RevTop) ->
+ {match, RevTop, File};
+string_match([$/ | File], [], RevTop) ->
{match, RevTop, File};
string_match(_File, _Archive, _RevTop) ->
no_match.
@@ -1314,14 +1351,14 @@ absname(Name) ->
case prim_file:get_cwd() of
{ok, Cwd} ->
Cwd ++ "/" ++ Name2;
- {error, _} ->
+ {error, _} ->
Name2
end;
volumerelative ->
case prim_file:get_cwd() of
{ok, Cwd} ->
absname_vr(Name2, Cwd);
- {error, _} ->
+ {error, _} ->
Name2
end
end.
@@ -1348,14 +1385,7 @@ pathtype(Name) when is_list(Name) ->
{unix, _} ->
unix_pathtype(Name);
{win32, _} ->
- win32_pathtype(Name);
- {vxworks, _} ->
- case vxworks_first(Name) of
- {device, _Rest, _Dev} ->
- absolute;
- _ ->
- relative
- end
+ win32_pathtype(Name)
end.
unix_pathtype(Name) ->
@@ -1380,58 +1410,18 @@ win32_pathtype(Name) ->
win32_pathtype([Char | List++Rest]);
[$/, $/|_] ->
absolute;
- [$\\, $/|_] ->
- absolute;
- [$/, $\\|_] ->
- absolute;
- [$\\, $\\|_] ->
- absolute;
[$/|_] ->
volumerelative;
- [$\\|_] ->
- volumerelative;
[C1, C2, List | Rest] when is_list(List) ->
- pathtype([C1, C2|List ++ Rest]);
+ win32_pathtype([C1, C2|List ++ Rest]);
[_Letter, $:, $/|_] ->
absolute;
- [_Letter, $:, $\\|_] ->
- absolute;
[_Letter, $:|_] ->
volumerelative;
_ ->
relative
end.
-vxworks_first(Name) ->
- case Name of
- [] ->
- {not_device, [], []};
- [$/ | T] ->
- vxworks_first2(device, T, [$/]);
- [$\\ | T] ->
- vxworks_first2(device, T, [$/]);
- [H | T] when is_list(H) ->
- vxworks_first(H ++ T);
- [H | T] ->
- vxworks_first2(not_device, T, [H])
- end.
-
-vxworks_first2(Devicep, Name, FirstComp) ->
- case Name of
- [] ->
- {Devicep, [], FirstComp};
- [$/ |T ] ->
- {Devicep, [$/ | T], FirstComp};
- [$\\ | T] ->
- {Devicep, [$/ | T], FirstComp};
- [$: | T]->
- {device, T, [$: | FirstComp]};
- [H | T] when is_list(H) ->
- vxworks_first2(Devicep, H ++ T, FirstComp);
- [H | T] ->
- vxworks_first2(Devicep, T, [H | FirstComp])
- end.
-
normalize(Name, Acc) ->
case Name of
[List | Rest] when is_list(List) ->
@@ -1445,3 +1435,70 @@ normalize(Name, Acc) ->
[] ->
reverse(Acc)
end.
+
+%% Remove .. and . from the path, e.g.
+%% /path/./to/this/../file -> /path/to/file
+%% This includes resolving symlinks.
+%%
+%% This is done to ensure that paths are totally normalized before
+%% comparing to find out if a file is inside the primary archive or
+%% not.
+real_path(Name) ->
+ real_path(Name,reverse(path_split(Name)),[],[]).
+
+real_path(_Name,[],Acc,_Links) ->
+ path_join(Acc);
+real_path(Name,["."|Paths],Acc,Links) ->
+ real_path(Name,Paths,Acc,Links);
+real_path(Name,[".."|Paths],[""]=Acc,Links) ->
+ %% /.. -> / (can't get higher than root)
+ real_path(Name,Paths,Acc,Links);
+real_path(Name,[".."|Paths],[Prev|Acc],Links) when Prev=/=".." ->
+ real_path(Name,Paths,Acc,Links);
+real_path(Name,[Path|Paths],Acc,Links) ->
+ This = [Path|Acc],
+ ThisFile = path_join(This),
+ case lists:member(ThisFile,Links) of
+ true -> % circular!!
+ Name;
+ false ->
+ case prim_file:read_link(ThisFile) of
+ {ok,Link} ->
+ case reverse(path_split(Link)) of
+ [""|_] = LinkPaths ->
+ real_path(Name,LinkPaths++Paths,[],[ThisFile|Links]);
+ LinkPaths ->
+ real_path(Name,LinkPaths++Paths,Acc,[ThisFile|Links])
+ end;
+ _ ->
+ real_path(Name,Paths,This,Links)
+ end
+ end.
+
+load_prim_archive(ArchiveFile, ArchiveBin, #file_info{}=FileInfo) ->
+ Fun = fun({Components, _GI, _GB}, A) ->
+ case Components of
+ ["", "nibe", RevApp] -> % Reverse ebin
+ %% Collect ebin directories in archive
+ Ebin = lists:reverse(RevApp, "/ebin"),
+ {true, [Ebin | A]};
+ _ ->
+ {true, A}
+ end
+ end,
+ Ebins0 = [ArchiveFile],
+ case open_archive({ArchiveFile, ArchiveBin}, FileInfo,
+ Ebins0, Fun) of
+ {ok, PrimZip, {RevEbins, FI, _}} ->
+ Ebins = reverse(RevEbins),
+ {ok, PrimZip, FI, Ebins};
+ Error ->
+ Error
+ end;
+load_prim_archive(ArchiveFile, FileInfo, ParserFun) ->
+ case ParserFun(ArchiveFile) of
+ {ok, ArchiveBin} ->
+ load_prim_archive(ArchiveFile, ArchiveBin, FileInfo);
+ Error ->
+ Error
+ end.
diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl
index 4affc9bffe..646acf5798 100644
--- a/erts/preloaded/src/erlang.erl
+++ b/erts/preloaded/src/erlang.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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,11 +43,12 @@
-export([memory/0, memory/1]).
-export([alloc_info/1, alloc_sizes/1]).
+-export([gather_sched_wall_time_result/1,
+ await_sched_wall_time_modifications/2]).
+
-deprecated([hash/2]).
-% Get rid of autoimports of spawn to avoid clashes with ourselves.
--compile({no_auto_import,[spawn/1]}).
--compile({no_auto_import,[spawn/4]}).
+%% Get rid of autoimports of spawn to avoid clashes with ourselves.
-compile({no_auto_import,[spawn_link/1]}).
-compile({no_auto_import,[spawn_link/4]}).
-compile({no_auto_import,[spawn_opt/2]}).
@@ -56,10 +57,2123 @@
-export_type([timestamp/0]).
+-type ext_binary() :: binary().
-type timestamp() :: {MegaSecs :: non_neg_integer(),
Secs :: non_neg_integer(),
MicroSecs :: non_neg_integer()}.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Native code BIF stubs and their types
+%% (BIF's actually implemented in this module goes last in the file)
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Exports for all native code stubs
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+-export([adler32/1, adler32/2, adler32_combine/3, append_element/2]).
+-export([atom_to_binary/2, atom_to_list/1, binary_part/2, binary_part/3]).
+-export([binary_to_atom/2, binary_to_existing_atom/2, binary_to_list/1]).
+-export([binary_to_list/3, binary_to_term/1, binary_to_term/2]).
+-export([bit_size/1, bitsize/1, bitstr_to_list/1, bitstring_to_list/1]).
+-export([bump_reductions/1, byte_size/1, call_on_load_function/1]).
+-export([cancel_timer/1, check_old_code/1, check_process_code/2, crc32/1]).
+-export([crc32/2, crc32_combine/3, date/0, decode_packet/3]).
+-export([delete_module/1, demonitor/1, demonitor/2, display/1]).
+-export([display_nl/0, display_string/1, dist_exit/3, erase/0, erase/1]).
+-export([error/1, error/2, exit/1, exit/2, external_size/1]).
+-export([external_size/2, finish_after_on_load/2, finish_loading/1, float/1]).
+-export([float_to_list/1, fun_info/2, fun_to_list/1, function_exported/3]).
+-export([garbage_collect/0, garbage_collect/1]).
+-export([garbage_collect_message_area/0, get/0, get/1, get_keys/1]).
+-export([get_module_info/1, get_stacktrace/0, group_leader/0]).
+-export([group_leader/2, halt/0, halt/1, halt/2, hash/2, hibernate/3]).
+-export([integer_to_list/1, iolist_size/1, iolist_to_binary/1]).
+-export([is_alive/0, is_builtin/3, is_process_alive/1, length/1, link/1]).
+-export([list_to_atom/1, list_to_binary/1, list_to_bitstr/1]).
+-export([list_to_bitstring/1, list_to_existing_atom/1, list_to_float/1]).
+-export([list_to_integer/1, list_to_pid/1, list_to_tuple/1, loaded/0]).
+-export([localtime/0, make_ref/0, match_spec_test/3, md5/1, md5_final/1]).
+-export([md5_init/0, md5_update/2, module_loaded/1, monitor/2]).
+-export([monitor_node/2, monitor_node/3, nif_error/1, nif_error/2
+]).
+-export([node/0, node/1, now/0, phash/2, phash2/1, phash2/2]).
+-export([pid_to_list/1, port_close/1, port_command/2, port_command/3]).
+-export([port_connect/2, port_control/3, port_get_data/1]).
+-export([port_set_data/2, port_to_list/1, ports/0]).
+-export([posixtime_to_universaltime/1, pre_loaded/0, prepare_loading/2]).
+-export([process_display/2]).
+-export([process_flag/3, process_info/1, processes/0, purge_module/1]).
+-export([put/2, raise/3, read_timer/1, ref_to_list/1, register/2]).
+-export([registered/0, resume_process/1, round/1, self/0, send_after/3]).
+-export([seq_trace/2, seq_trace_print/1, seq_trace_print/2, setnode/2]).
+-export([setnode/3, size/1, spawn/3, spawn_link/3, split_binary/2]).
+-export([start_timer/3, suspend_process/2, system_monitor/0]).
+-export([system_monitor/1, system_monitor/2, system_profile/0]).
+-export([system_profile/2, throw/1, time/0, trace/3, trace_delivered/1]).
+-export([trace_info/2, trunc/1, tuple_size/1, universaltime/0]).
+-export([universaltime_to_posixtime/1, unlink/1, unregister/1, whereis/1]).
+
+-export([abs/1, append/2, element/2, get_module_info/2, hd/1,
+ is_atom/1, is_binary/1, is_bitstring/1, is_boolean/1,
+ is_float/1, is_function/1, is_function/2, is_integer/1,
+ is_list/1, is_number/1, is_pid/1, is_port/1, is_record/2,
+ is_record/3, is_reference/1, is_tuple/1, load_module/2,
+ load_nif/2, localtime_to_universaltime/2, make_fun/3,
+ make_tuple/2, make_tuple/3, nodes/1, open_port/2,
+ port_call/2, port_call/3, port_info/1, port_info/2, process_flag/2,
+ process_info/2, send/2, send/3, seq_trace_info/1,
+ setelement/3, spawn_opt/1,
+ statistics/1, subtract/2, system_flag/2,
+ term_to_binary/1, term_to_binary/2, tl/1, trace_pattern/2,
+ trace_pattern/3, tuple_to_list/1, system_info/1,
+ universaltime_to_localtime/1]).
+-export([dt_get_tag/0, dt_get_tag_data/0, dt_prepend_vm_tag_data/1, dt_append_vm_tag_data/1,
+ dt_put_tag/1, dt_restore_tag/1, dt_spread_tag/1]).
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Simple native code BIFs
+%%% These are here for the types/specs, the real implementation is in the C code.
+%%% The first chunk is originally auto-generated from
+%%% $ERL_TOP/lib/hipe/cerl/erl_bif_types.erl as released in R15B.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%% types
+
+-type fun_info_item() ::
+ arity |
+ env |
+ index |
+ name |
+ module |
+ new_index |
+ new_uniq |
+ pid |
+ type |
+ uniq.
+
+-type seq_trace_info() ::
+ 'send' |
+ 'receive' |
+ 'print' |
+ 'timestamp' |
+ 'label' |
+ 'serial'.
+
+-type seq_trace_info_returns() ::
+ { seq_trace_info(), non_neg_integer() |
+ boolean() |
+ { non_neg_integer(), non_neg_integer() } } |
+ [].
+
+-type system_profile_option() ::
+ 'exclusive' |
+ 'runnable_ports' |
+ 'runnable_procs' |
+ 'scheduler'.
+
+-type system_monitor_option() ::
+ 'busy_port' |
+ 'busy_dist_port' |
+ {'long_gc', non_neg_integer()} |
+ {'large_heap', non_neg_integer()}.
+
+
+-type raise_stacktrace() ::
+ [{module(), atom(), arity() | [term()]} |
+ {function(), [term()]}] |
+ [{module(), atom(), arity() | [term()], [{atom(),term()}]} |
+ {function(), [term()], [{atom(),term()}]}].
+
+-type bitstring_list() ::
+ maybe_improper_list(byte() | bitstring() | bitstring_list(), bitstring() | []).
+
+-type trace_flag() ::
+ all |
+ send |
+ 'receive' |
+ procs |
+ call |
+ silent |
+ return_to |
+ running |
+ exiting |
+ garbage_collection |
+ timestamp |
+ cpu_timestamp |
+ arity |
+ set_on_spawn |
+ set_on_first_spawn |
+ set_on_link |
+ set_on_first_link |
+ {tracer, pid() | port()}.
+
+-type trace_info_item_result() ::
+ {traced, global | local | false | undefined} |
+ {match_spec, trace_match_spec() | false | undefined} |
+ {meta, pid() | port() | false | undefined | []} |
+ {meta_match_spec, trace_match_spec() | false | undefined} |
+ {call_count, non_neg_integer() | boolean() | undefined} |
+ {call_time, [{pid(), non_neg_integer(),
+ non_neg_integer(), non_neg_integer()}] | boolean() | undefined}.
+
+-type trace_info_flag() ::
+ send |
+ 'receive' |
+ set_on_spawn |
+ call |
+ return_to |
+ procs |
+ set_on_first_spawn |
+ set_on_link |
+ running |
+ garbage_collection |
+ timestamp |
+ arity.
+
+-type trace_info_return() ::
+ undefined |
+ {flags, [trace_info_flag()]} |
+ {tracer, pid() | port() | []} |
+ trace_info_item_result() |
+ {all, [ trace_info_item_result() ] | false | undefined}.
+
+%% Specs and stubs
+%% adler32/1
+-spec erlang:adler32(Data) -> non_neg_integer() when
+ Data :: iodata().
+adler32(_Data) ->
+ erlang:nif_error(undefined).
+
+%% adler32/2
+-spec erlang:adler32(OldAdler, Data) -> non_neg_integer() when
+ OldAdler :: non_neg_integer(),
+ Data :: iodata().
+adler32(_OldAdler, _Data) ->
+ erlang:nif_error(undefined).
+
+%% adler32_combine/3
+-spec erlang:adler32_combine(FirstAdler, SecondAdler, SecondSize) -> non_neg_integer() when
+ FirstAdler :: non_neg_integer(),
+ SecondAdler :: non_neg_integer(),
+ SecondSize :: non_neg_integer().
+adler32_combine(_FirstAdler, _SecondAdler, _SecondSize) ->
+ erlang:nif_error(undefined).
+
+%% append_element/2
+-spec erlang:append_element(Tuple1, Term) -> Tuple2 when
+ Tuple1 :: tuple(),
+ Tuple2 :: tuple(),
+ Term :: term().
+append_element(_Tuple1, _Term) ->
+ erlang:nif_error(undefined).
+
+%% atom_to_binary/2
+-spec atom_to_binary(Atom, Encoding) -> binary() when
+ Atom :: atom(),
+ Encoding :: latin1 | unicode | utf8.
+atom_to_binary(_Atom, _Encoding) ->
+ erlang:nif_error(undefined).
+
+%% atom_to_list/1
+-spec atom_to_list(Atom) -> string() when
+ Atom :: atom().
+atom_to_list(_Atom) ->
+ erlang:nif_error(undefined).
+
+%% binary_part/2
+%% Shadowed by erl_bif_types: erlang:binary_part/2
+-spec binary_part(Subject, PosLen) -> binary() when
+ Subject :: binary(),
+ PosLen :: {Start :: non_neg_integer(), Length :: integer()}.
+binary_part(_Subject, _PosLen) ->
+ erlang:nif_error(undefined).
+
+%% binary_part/3
+%% Shadowed by erl_bif_types: erlang:binary_part/3
+-spec binary_part(Subject, Start, Length) -> binary() when
+ Subject :: binary(),
+ Start :: non_neg_integer(),
+ Length :: integer().
+binary_part(_Subject, _Start, _Length) ->
+ erlang:nif_error(undefined).
+
+%% binary_to_atom/2
+-spec binary_to_atom(Binary, Encoding) -> atom() when
+ Binary :: binary(),
+ Encoding :: latin1 | unicode | utf8.
+binary_to_atom(_Binary, _Encoding) ->
+ erlang:nif_error(undefined).
+
+%% binary_to_existing_atom/2
+-spec binary_to_existing_atom(Binary, Encoding) -> atom() when
+ Binary :: binary(),
+ Encoding :: latin1 | unicode | utf8.
+binary_to_existing_atom(_Binary, _Encoding) ->
+ erlang:nif_error(undefined).
+
+%% binary_to_list/1
+-spec binary_to_list(Binary) -> [byte()] when
+ Binary :: binary().
+binary_to_list(_Binary) ->
+ erlang:nif_error(undefined).
+
+%% binary_to_list/3
+-spec binary_to_list(Binary, Start, Stop) -> [byte()] when
+ Binary :: binary(),
+ Start :: pos_integer(),
+ Stop :: pos_integer().
+binary_to_list(_Binary, _Start, _Stop) ->
+ erlang:nif_error(undefined).
+
+%% binary_to_term/1
+-spec binary_to_term(Binary) -> term() when
+ Binary :: ext_binary().
+binary_to_term(_Binary) ->
+ erlang:nif_error(undefined).
+
+%% binary_to_term/2
+-spec binary_to_term(Binary, Opts) -> term() when
+ Binary :: ext_binary(),
+ Opts :: [safe].
+binary_to_term(_Binary, _Opts) ->
+ erlang:nif_error(undefined).
+
+%% bit_size/1
+%% Shadowed by erl_bif_types: erlang:bit_size/1
+-spec bit_size(Bitstring) -> non_neg_integer() when
+ Bitstring :: bitstring().
+bit_size(_Bitstring) ->
+ erlang:nif_error(undefined).
+
+%% bitsize/1
+-spec bitsize(P1) -> non_neg_integer() when
+ P1 :: bitstring().
+bitsize(_P1) ->
+ erlang:nif_error(undefined).
+
+%% bitstr_to_list/1
+-spec erlang:bitstr_to_list(P1) -> [byte() | bitstring()] when
+ P1 :: bitstring().
+bitstr_to_list(_P1) ->
+ erlang:nif_error(undefined).
+
+%% bitstring_to_list/1
+-spec bitstring_to_list(Bitstring) -> [byte() | bitstring()] when
+ Bitstring :: bitstring().
+bitstring_to_list(_Bitstring) ->
+ erlang:nif_error(undefined).
+
+%% bump_reductions/1
+-spec erlang:bump_reductions(Reductions) -> true when
+ Reductions :: pos_integer().
+bump_reductions(_Reductions) ->
+ erlang:nif_error(undefined).
+
+%% byte_size/1
+%% Shadowed by erl_bif_types: erlang:byte_size/1
+-spec byte_size(Bitstring) -> non_neg_integer() when
+ Bitstring :: bitstring().
+byte_size(_Bitstring) ->
+ erlang:nif_error(undefined).
+
+%% call_on_load_function/1
+-spec erlang:call_on_load_function(P1) -> term() when
+ P1 :: atom().
+call_on_load_function(_P1) ->
+ erlang:nif_error(undefined).
+
+%% cancel_timer/1
+-spec erlang:cancel_timer(TimerRef) -> Time | false when
+ TimerRef :: reference(),
+ Time :: non_neg_integer().
+cancel_timer(_TimerRef) ->
+ erlang:nif_error(undefined).
+
+%% check_old_code/1
+-spec check_old_code(Module) -> boolean() when
+ Module :: module().
+check_old_code(_Module) ->
+ erlang:nif_error(undefined).
+
+%% check_process_code/2
+-spec check_process_code(Pid, Module) -> boolean() when
+ Pid :: pid(),
+ Module :: module().
+check_process_code(_Pid, _Module) ->
+ erlang:nif_error(undefined).
+
+%% crc32/1
+-spec erlang:crc32(Data) -> non_neg_integer() when
+ Data :: iodata().
+crc32(_Data) ->
+ erlang:nif_error(undefined).
+
+%% crc32/2
+-spec erlang:crc32(OldCrc, Data) -> non_neg_integer() when
+ OldCrc :: non_neg_integer(),
+ Data :: iodata().
+crc32(_OldCrc, _Data) ->
+ erlang:nif_error(undefined).
+
+%% crc32_combine/3
+-spec erlang:crc32_combine(FirstCrc, SecondCrc, SecondSize) -> non_neg_integer() when
+ FirstCrc :: non_neg_integer(),
+ SecondCrc :: non_neg_integer(),
+ SecondSize :: non_neg_integer().
+crc32_combine(_FirstCrc, _SecondCrc, _SecondSize) ->
+ erlang:nif_error(undefined).
+
+%% date/0
+-spec date() -> Date when
+ Date :: calendar:date().
+date() ->
+ erlang:nif_error(undefined).
+
+%% decode_packet/3
+-spec erlang:decode_packet(Type, Bin, Options) ->
+ {ok, Packet, Rest} |
+ {more, Length} |
+ {error, Reason} when
+ Type :: 'raw' | 0 | 1 | 2 | 4 | 'asn1' | 'cdr' | 'sunrm' | 'fcgi'
+ | 'tpkt' | 'line' | 'http' | 'http_bin' | 'httph' | 'httph_bin',
+ Bin :: binary(),
+ Options :: [Opt],
+ Opt :: {packet_size, non_neg_integer()}
+ | {line_length, non_neg_integer()},
+ Packet :: binary() | HttpPacket,
+ Rest :: binary(),
+ Length :: non_neg_integer() | undefined,
+ Reason :: term(),
+ HttpPacket :: HttpRequest
+ | HttpResponse
+ | HttpHeader
+ | 'http_eoh'
+ | HttpError,
+ HttpRequest :: {'http_request', HttpMethod, HttpUri, HttpVersion},
+ HttpResponse :: {'http_response', HttpVersion, integer(), HttpString},
+ HttpHeader :: {'http_header',
+ integer(),
+ HttpField,
+ Reserved :: term(),
+ Value :: HttpString},
+ HttpError :: {'http_error', HttpString},
+ HttpMethod :: 'OPTIONS' | 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE'
+ | 'TRACE' | HttpString,
+ HttpUri :: '*'
+ | { 'absoluteURI',
+ 'http' | 'https',
+ Host :: HttpString,
+ Port :: inet:port_number() | 'undefined',
+ Path :: HttpString}
+ | {'scheme', Scheme :: HttpString, HttpString}
+ | {'abs_path', HttpString}
+ | HttpString,
+ HttpVersion :: {Major :: non_neg_integer(), Minor :: non_neg_integer()},
+ HttpField :: 'Cache-Control'
+ | 'Connection'
+ | 'Date'
+ | 'Pragma'
+ | 'Transfer-Encoding'
+ | 'Upgrade'
+ | 'Via'
+ | 'Accept'
+ | 'Accept-Charset'
+ | 'Accept-Encoding'
+ | 'Accept-Language'
+ | 'Authorization'
+ | 'From'
+ | 'Host'
+ | 'If-Modified-Since'
+ | 'If-Match'
+ | 'If-None-Match'
+ | 'If-Range'
+ | 'If-Unmodified-Since'
+ | 'Max-Forwards'
+ | 'Proxy-Authorization'
+ | 'Range'
+ | 'Referer'
+ | 'User-Agent'
+ | 'Age'
+ | 'Location'
+ | 'Proxy-Authenticate'
+ | 'Public'
+ | 'Retry-After'
+ | 'Server'
+ | 'Vary'
+ | 'Warning'
+ |'Www-Authenticate'
+ | 'Allow'
+ | 'Content-Base'
+ | 'Content-Encoding'
+ | 'Content-Language'
+ | 'Content-Length'
+ | 'Content-Location'
+ | 'Content-Md5'
+ | 'Content-Range'
+ | 'Content-Type'
+ | 'Etag'
+ | 'Expires'
+ | 'Last-Modified'
+ | 'Accept-Ranges'
+ | 'Set-Cookie'
+ | 'Set-Cookie2'
+ | 'X-Forwarded-For'
+ | 'Cookie'
+ | 'Keep-Alive'
+ | 'Proxy-Connection'
+ | HttpString,
+ HttpString :: string() | binary().
+decode_packet(_Type, _Bin, _Options) ->
+ erlang:nif_error(undefined).
+
+%% delete_module/1
+-spec delete_module(Module) -> true | undefined when
+ Module :: module().
+delete_module(_Module) ->
+ erlang:nif_error(undefined).
+
+%% demonitor/1
+-spec demonitor(MonitorRef) -> true when
+ MonitorRef :: reference().
+demonitor(_MonitorRef) ->
+ erlang:nif_error(undefined).
+
+%% demonitor/2
+-spec demonitor(MonitorRef, OptionList) -> boolean() when
+ MonitorRef :: reference(),
+ OptionList :: [Option],
+ Option :: flush | info.
+demonitor(_MonitorRef, _OptionList) ->
+ erlang:nif_error(undefined).
+
+%% display/1
+-spec erlang:display(Term) -> true when
+ Term :: term().
+display(_Term) ->
+ erlang:nif_error(undefined).
+
+%% display_nl/0
+-spec erlang:display_nl() -> true.
+display_nl() ->
+ erlang:nif_error(undefined).
+
+%% display_string/1
+-spec erlang:display_string(P1) -> true when
+ P1 :: string().
+display_string(_P1) ->
+ erlang:nif_error(undefined).
+
+%% dist_exit/3
+-spec erlang:dist_exit(P1, P2, P3) -> true when
+ P1 :: pid(),
+ P2 :: kill | noconnection | normal,
+ P3 :: pid() | port().
+dist_exit(_P1, _P2, _P3) ->
+ erlang:nif_error(undefined).
+
+%% dt_append_vm_tag_data/1
+-spec erlang:dt_append_vm_tag_data(IoData) -> IoDataRet when
+ IoData :: iodata(),
+ IoDataRet :: iodata().
+dt_append_vm_tag_data(_IoData) ->
+ erlang:nif_error(undefined).
+
+%% dt_get_tag/0
+-spec erlang:dt_get_tag() -> binary() | undefined.
+dt_get_tag() ->
+ erlang:nif_error(undefined).
+
+%% dt_get_tag_data/0
+-spec erlang:dt_get_tag_data() -> binary() | undefined.
+dt_get_tag_data() ->
+ erlang:nif_error(undefined).
+
+%% dt_prepend_vm_tag_data/1
+-spec erlang:dt_prepend_vm_tag_data(IoData) -> IoDataRet when
+ IoData :: iodata(),
+ IoDataRet :: iodata().
+dt_prepend_vm_tag_data(_IoData) ->
+ erlang:nif_error(undefined).
+
+%% dt_put_tag/1
+-spec erlang:dt_put_tag(IoData) -> binary() | undefined when
+ IoData :: iodata().
+dt_put_tag(_IoData) ->
+ erlang:nif_error(undefined).
+
+%% dt_restore_tag/1
+-spec erlang:dt_restore_tag(TagData) -> true when
+ TagData :: term().
+dt_restore_tag(_TagData) ->
+ erlang:nif_error(undefined).
+
+%% dt_spread_tag/1
+-spec erlang:dt_spread_tag(boolean()) -> TagData when
+ TagData :: term().
+dt_spread_tag(_Bool) ->
+ erlang:nif_error(undefined).
+
+%% erase/0
+-spec erase() -> [{Key, Val}] when
+ Key :: term(),
+ Val :: term().
+erase() ->
+ erlang:nif_error(undefined).
+
+%% erase/1
+-spec erase(Key) -> Val | undefined when
+ Key :: term(),
+ Val :: term().
+erase(_Key) ->
+ erlang:nif_error(undefined).
+
+%% error/1
+%% Shadowed by erl_bif_types: erlang:error/1
+-spec error(Reason) -> no_return() when
+ Reason :: term().
+error(_Reason) ->
+ erlang:nif_error(undefined).
+
+%% error/2
+%% Shadowed by erl_bif_types: erlang:error/2
+-spec error(Reason, Args) -> no_return() when
+ Reason :: term(),
+ Args :: [term()].
+error(_Reason, _Args) ->
+ erlang:nif_error(undefined).
+
+%% exit/1
+%% Shadowed by erl_bif_types: erlang:exit/1
+-spec exit(Reason) -> no_return() when
+ Reason :: term().
+exit(_Reason) ->
+ erlang:nif_error(undefined).
+
+%% exit/2
+-spec exit(Pid, Reason) -> true when
+ Pid :: pid() | port(),
+ Reason :: term().
+exit(_Pid, _Reason) ->
+ erlang:nif_error(undefined).
+
+%% external_size/1
+-spec erlang:external_size(Term) -> non_neg_integer() when
+ Term :: term().
+external_size(_Term) ->
+ erlang:nif_error(undefined).
+
+%% external_size/2
+-spec erlang:external_size(Term, Options) -> non_neg_integer() when
+ Term :: term(),
+ Options :: [{minor_version, Version :: non_neg_integer()}].
+external_size(_Term, _Options) ->
+ erlang:nif_error(undefined).
+
+%% finish_loading/2
+-spec erlang:finish_loading(PreparedCodeBinaries) -> ok | Error when
+ PreparedCodeBinaries :: [PreparedCodeBinary],
+ PreparedCodeBinary :: binary(),
+ ModuleList :: [module()],
+ Error :: {not_purged,ModuleList} | {on_load,ModuleList}.
+finish_loading(_List) ->
+ erlang:nif_error(undefined).
+
+%% finish_after_on_load/2
+-spec erlang:finish_after_on_load(P1, P2) -> true when
+ P1 :: atom(),
+ P2 :: boolean().
+finish_after_on_load(_P1, _P2) ->
+ erlang:nif_error(undefined).
+
+%% float/1
+%% Shadowed by erl_bif_types: erlang:float/1
+-spec float(Number) -> float() when
+ Number :: number().
+float(_Number) ->
+ erlang:nif_error(undefined).
+
+%% float_to_list/1
+-spec float_to_list(Float) -> string() when
+ Float :: float().
+float_to_list(_Float) ->
+ erlang:nif_error(undefined).
+
+%% fun_info/2
+-spec erlang:fun_info(Fun, Item) -> {Item, Info} when
+ Fun :: function(),
+ Item :: fun_info_item(),
+ Info :: term().
+fun_info(_Fun, _Item) ->
+ erlang:nif_error(undefined).
+
+%% fun_to_list/1
+-spec erlang:fun_to_list(Fun) -> string() when
+ Fun :: function().
+fun_to_list(_Fun) ->
+ erlang:nif_error(undefined).
+
+%% function_exported/3
+-spec erlang:function_exported(Module, Function, Arity) -> boolean() when
+ Module :: module(),
+ Function :: atom(),
+ Arity :: arity().
+function_exported(_Module, _Function, _Arity) ->
+ erlang:nif_error(undefined).
+
+%% garbage_collect/0
+-spec garbage_collect() -> true.
+garbage_collect() ->
+ erlang:nif_error(undefined).
+
+%% garbage_collect/1
+-spec garbage_collect(Pid) -> boolean() when
+ Pid :: pid().
+garbage_collect(_Pid) ->
+ erlang:nif_error(undefined).
+
+%% garbage_collect_message_area/0
+-spec erlang:garbage_collect_message_area() -> boolean().
+garbage_collect_message_area() ->
+ erlang:nif_error(undefined).
+
+%% get/0
+-spec get() -> [{Key, Val}] when
+ Key :: term(),
+ Val :: term().
+get() ->
+ erlang:nif_error(undefined).
+
+%% get/1
+-spec get(Key) -> Val | undefined when
+ Key :: term(),
+ Val :: term().
+get(_Key) ->
+ erlang:nif_error(undefined).
+
+%% get_keys/1
+-spec get_keys(Val) -> [Key] when
+ Val :: term(),
+ Key :: term().
+get_keys(_Val) ->
+ erlang:nif_error(undefined).
+
+%% get_module_info/1
+-spec erlang:get_module_info(P1) -> [{atom(), [{atom(), term()}]}] when
+ P1 :: atom().
+get_module_info(_P1) ->
+ erlang:nif_error(undefined).
+
+%% get_stacktrace/0
+-spec erlang:get_stacktrace() -> [stack_item()].
+get_stacktrace() ->
+ erlang:nif_error(undefined).
+
+%% group_leader/0
+-spec group_leader() -> pid().
+group_leader() ->
+ erlang:nif_error(undefined).
+
+%% group_leader/2
+-spec group_leader(GroupLeader, Pid) -> true when
+ GroupLeader :: pid(),
+ Pid :: pid().
+group_leader(_GroupLeader, _Pid) ->
+ erlang:nif_error(undefined).
+
+%% halt/0
+%% Shadowed by erl_bif_types: erlang:halt/0
+-spec halt() -> no_return().
+halt() ->
+ erlang:nif_error(undefined).
+
+%% halt/1
+%% Shadowed by erl_bif_types: erlang:halt/1
+-spec halt(Status) -> no_return() when
+ Status :: non_neg_integer() | 'abort' | string().
+halt(_Status) ->
+ erlang:nif_error(undefined).
+
+%% halt/2
+%% Shadowed by erl_bif_types: erlang:halt/2
+-spec halt(Status, Options) -> no_return() when
+ Status :: non_neg_integer() | 'abort' | string(),
+ Options :: [Option],
+ Option :: {flush, boolean()}.
+halt(_Status, _Options) ->
+ erlang:nif_error(undefined).
+
+%% hash/2
+-spec erlang:hash(Term, Range) -> pos_integer() when
+ Term :: term(),
+ Range :: pos_integer().
+hash(_Term, _Range) ->
+ erlang:nif_error(undefined).
+
+%% hibernate/3
+-spec erlang:hibernate(Module, Function, Args) -> no_return() when
+ Module :: module(),
+ Function :: atom(),
+ Args :: [term()].
+hibernate(_Module, _Function, _Args) ->
+ erlang:nif_error(undefined).
+
+%% integer_to_list/1
+-spec integer_to_list(Integer) -> string() when
+ Integer :: integer().
+integer_to_list(_Integer) ->
+ erlang:nif_error(undefined).
+
+%% iolist_size/1
+-spec iolist_size(Item) -> non_neg_integer() when
+ Item :: iolist() | binary().
+iolist_size(_Item) ->
+ erlang:nif_error(undefined).
+
+%% iolist_to_binary/1
+-spec iolist_to_binary(IoListOrBinary) -> binary() when
+ IoListOrBinary :: iolist() | binary().
+iolist_to_binary(_IoListOrBinary) ->
+ erlang:nif_error(undefined).
+
+%% is_alive/0
+-spec is_alive() -> boolean().
+is_alive() ->
+ erlang:nif_error(undefined).
+
+%% is_builtin/3
+-spec erlang:is_builtin(Module, Function, Arity) -> boolean() when
+ Module :: module(),
+ Function :: atom(),
+ Arity :: arity().
+is_builtin(_Module, _Function, _Arity) ->
+ erlang:nif_error(undefined).
+
+%% is_process_alive/1
+-spec is_process_alive(Pid) -> boolean() when
+ Pid :: pid().
+is_process_alive(_Pid) ->
+ erlang:nif_error(undefined).
+
+%% length/1
+%% Shadowed by erl_bif_types: erlang:length/1
+-spec length(List) -> non_neg_integer() when
+ List :: [term()].
+length(_List) ->
+ erlang:nif_error(undefined).
+
+%% link/1
+-spec link(PidOrPort) -> true when
+ PidOrPort :: pid() | port().
+link(_PidOrPort) ->
+ erlang:nif_error(undefined).
+
+%% list_to_atom/1
+-spec list_to_atom(String) -> atom() when
+ String :: string().
+list_to_atom(_String) ->
+ erlang:nif_error(undefined).
+
+%% list_to_binary/1
+-spec list_to_binary(IoList) -> binary() when
+ IoList :: iolist().
+list_to_binary(_IoList) ->
+ erlang:nif_error(undefined).
+
+%% list_to_bitstr/1
+-spec erlang:list_to_bitstr(P1) -> bitstring() when
+ P1 :: bitstring_list().
+list_to_bitstr(_P1) ->
+ erlang:nif_error(undefined).
+
+%% list_to_bitstring/1
+-spec list_to_bitstring(BitstringList) -> bitstring() when
+ BitstringList :: bitstring_list().
+list_to_bitstring(_BitstringList) ->
+ erlang:nif_error(undefined).
+
+%% list_to_existing_atom/1
+-spec list_to_existing_atom(String) -> atom() when
+ String :: string().
+list_to_existing_atom(_String) ->
+ erlang:nif_error(undefined).
+
+%% list_to_float/1
+-spec list_to_float(String) -> float() when
+ String :: string().
+list_to_float(_String) ->
+ erlang:nif_error(undefined).
+
+%% list_to_integer/1
+-spec list_to_integer(String) -> integer() when
+ String :: string().
+list_to_integer(_String) ->
+ erlang:nif_error(undefined).
+
+%% list_to_pid/1
+-spec list_to_pid(String) -> pid() when
+ String :: string().
+list_to_pid(_String) ->
+ erlang:nif_error(undefined).
+
+%% list_to_tuple/1
+-spec list_to_tuple(List) -> tuple() when
+ List :: [term()].
+list_to_tuple(_List) ->
+ erlang:nif_error(undefined).
+
+%% loaded/0
+-spec erlang:loaded() -> [Module] when
+ Module :: module().
+loaded() ->
+ erlang:nif_error(undefined).
+
+%% localtime/0
+-spec erlang:localtime() -> DateTime when
+ DateTime :: calendar:datetime().
+localtime() ->
+ erlang:nif_error(undefined).
+
+%% make_ref/0
+-spec make_ref() -> reference().
+make_ref() ->
+ 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,
+ TestResult :: {ok, term(), [return_trace], [ {error | warning, string()} ]} | {error, [ {error | warning, string()} ]}.
+match_spec_test(_P1, _P2, _P3) ->
+ erlang:nif_error(undefined).
+
+%% md5/1
+-spec erlang:md5(Data) -> Digest when
+ Data :: iodata(),
+ Digest :: binary().
+md5(_Data) ->
+ erlang:nif_error(undefined).
+
+%% md5_final/1
+-spec erlang:md5_final(Context) -> Digest when
+ Context :: binary(),
+ Digest :: binary().
+md5_final(_Context) ->
+ erlang:nif_error(undefined).
+
+%% md5_init/0
+-spec erlang:md5_init() -> Context when
+ Context :: binary().
+md5_init() ->
+ erlang:nif_error(undefined).
+
+%% md5_update/2
+-spec erlang:md5_update(Context, Data) -> NewContext when
+ Context :: binary(),
+ Data :: iodata(),
+ NewContext :: binary().
+md5_update(_Context, _Data) ->
+ erlang:nif_error(undefined).
+
+%% module_loaded/1
+-spec module_loaded(Module) -> boolean() when
+ Module :: module().
+module_loaded(_Module) ->
+ erlang:nif_error(undefined).
+
+%% monitor/2
+-spec monitor(Type, Item) -> MonitorRef when
+ Type :: process,
+ Item :: pid() | Module | {Module, Node},
+ Module :: module(),
+ Node :: node(),
+ MonitorRef :: reference().
+monitor(_Type, _Item) ->
+ erlang:nif_error(undefined).
+
+%% monitor_node/2
+-spec monitor_node(Node, Flag) -> true when
+ Node :: node(),
+ Flag :: boolean().
+monitor_node(_Node, _Flag) ->
+ erlang:nif_error(undefined).
+
+%% monitor_node/3
+-spec erlang:monitor_node(Node, Flag, Options) -> true when
+ Node :: node(),
+ Flag :: boolean(),
+ Options :: [Option],
+ Option :: allow_passive_connect.
+monitor_node(_Node, _Flag, _Options) ->
+ erlang:nif_error(undefined).
+
+%% nif_error/1
+%% Shadowed by erl_bif_types: erlang:nif_error/1
+-spec erlang:nif_error(Reason) -> no_return() when
+ Reason :: term().
+nif_error(_Reason) ->
+ erlang:nif_error(undefined).
+
+%% nif_error/2
+%% Shadowed by erl_bif_types: erlang:nif_error/2
+-spec erlang:nif_error(Reason, Args) -> no_return() when
+ Reason :: term(),
+ Args :: [term()].
+nif_error(_Reason, _Args) ->
+ erlang:nif_error(undefined).
+
+%% node/0
+%% Shadowed by erl_bif_types: erlang:node/0
+-spec node() -> Node when
+ Node :: node().
+node() ->
+ erlang:nif_error(undefined).
+
+%% node/1
+%% Shadowed by erl_bif_types: erlang:node/1
+-spec node(Arg) -> Node when
+ Arg :: pid() | port() | reference(),
+ Node :: node().
+node(_Arg) ->
+ erlang:nif_error(undefined).
+
+%% now/0
+-spec now() -> Timestamp when
+ Timestamp :: timestamp().
+now() ->
+ erlang:nif_error(undefined).
+
+%% phash/2
+-spec erlang:phash(Term, Range) -> Hash when
+ Term :: term(),
+ Range :: pos_integer(),
+ Hash :: pos_integer().
+phash(_Term, _Range) ->
+ erlang:nif_error(undefined).
+
+%% phash2/1
+-spec erlang:phash2(Term) -> Hash when
+ Term :: term(),
+ Hash :: non_neg_integer().
+phash2(_Term) ->
+ erlang:nif_error(undefined).
+
+%% phash2/2
+-spec erlang:phash2(Term, Range) -> Hash when
+ Term :: term(),
+ Range :: pos_integer(),
+ Hash :: non_neg_integer().
+phash2(_Term, _Range) ->
+ erlang:nif_error(undefined).
+
+%% pid_to_list/1
+-spec pid_to_list(Pid) -> string() when
+ Pid :: pid().
+pid_to_list(_Pid) ->
+ erlang:nif_error(undefined).
+
+%% port_close/1
+-spec port_close(Port) -> true when
+ Port :: port() | atom().
+port_close(_Port) ->
+ erlang:nif_error(undefined).
+
+%% port_command/2
+-spec port_command(Port, Data) -> true when
+ Port :: port() | atom(),
+ Data :: iodata().
+port_command(_Port, _Data) ->
+ erlang:nif_error(undefined).
+
+%% port_command/3
+-spec port_command(Port, Data, OptionList) -> boolean() when
+ Port :: port() | atom(),
+ Data :: iodata(),
+ OptionList :: [Option],
+ Option :: force | nosuspend.
+port_command(_Port, _Data, _OptionList) ->
+ erlang:nif_error(undefined).
+
+%% port_connect/2
+-spec port_connect(Port, Pid) -> true when
+ Port :: port() | atom(),
+ Pid :: pid().
+port_connect(_Port, _Pid) ->
+ erlang:nif_error(undefined).
+
+%% port_control/3
+-spec port_control(Port, Operation, Data) -> Res when
+ Port :: port() | atom(),
+ Operation :: integer(),
+ Data :: iodata(),
+ Res :: string() | binary().
+port_control(_Port, _Operation, _Data) ->
+ erlang:nif_error(undefined).
+
+%% port_get_data/1
+-spec erlang:port_get_data(P1) -> term() when
+ P1 :: port() | atom().
+port_get_data(_P1) ->
+ erlang:nif_error(undefined).
+
+%% port_set_data/2
+-spec erlang:port_set_data(P1, P2) -> true when
+ P1 :: port() | atom(),
+ P2 :: term().
+port_set_data(_P1, _P2) ->
+ erlang:nif_error(undefined).
+
+%% port_to_list/1
+-spec erlang:port_to_list(Port) -> string() when
+ Port :: port().
+port_to_list(_Port) ->
+ erlang:nif_error(undefined).
+
+%% ports/0
+-spec erlang:ports() -> [port()].
+ports() ->
+ erlang:nif_error(undefined).
+
+%% posixtime_to_universaltime/1
+-spec erlang:posixtime_to_universaltime(P1) -> {calendar:date(), calendar:time()} when
+ P1 :: integer().
+posixtime_to_universaltime(_P1) ->
+ erlang:nif_error(undefined).
+
+%% prepare_loading/2
+-spec erlang:prepare_loading(Module, Code) -> PreparedCode | {error, Reason} when
+ Module :: module(),
+ Code :: binary(),
+ PreparedCode :: binary(),
+ Reason :: bad_file.
+prepare_loading(_Module, _Code) ->
+ erlang:nif_error(undefined).
+
+%% pre_loaded/0
+-spec pre_loaded() -> [module()].
+pre_loaded() ->
+ erlang:nif_error(undefined).
+
+%% process_display/2
+-spec erlang:process_display(Pid, Type) -> true when
+ Pid :: pid(),
+ Type :: backtrace.
+process_display(_Pid, _Type) ->
+ erlang:nif_error(undefined).
+
+%% process_flag/3
+-spec process_flag(Pid, Flag, Value) -> OldValue when
+ Pid :: pid(),
+ Flag :: save_calls,
+ Value :: non_neg_integer(),
+ OldValue :: non_neg_integer().
+process_flag(_Pid, _Flag, _Value) ->
+ erlang:nif_error(undefined).
+
+%% process_info/1
+-spec process_info(Pid) -> Info when
+ Pid :: pid(),
+ Info :: [InfoTuple] | undefined,
+ InfoTuple :: process_info_result_item().
+process_info(_Pid) ->
+ erlang:nif_error(undefined).
+
+%% processes/0
+-spec processes() -> [pid()].
+processes() ->
+ erlang:nif_error(undefined).
+
+%% purge_module/1
+-spec purge_module(Module) -> true when
+ Module :: atom().
+purge_module(_Module) ->
+ erlang:nif_error(undefined).
+
+%% put/2
+-spec put(Key, Val) -> term() when
+ Key :: term(),
+ Val :: term().
+put(_Key, _Val) ->
+ erlang:nif_error(undefined).
+
+%% raise/3
+-spec erlang:raise(Class, Reason, Stacktrace) -> no_return() when
+ Class :: error | exit | throw,
+ Reason :: term(),
+ Stacktrace :: raise_stacktrace().
+raise(_Class, _Reason, _Stacktrace) ->
+ erlang:nif_error(undefined).
+
+%% read_timer/1
+-spec erlang:read_timer(TimerRef) -> non_neg_integer() | false when
+ TimerRef :: reference().
+read_timer(_TimerRef) ->
+ erlang:nif_error(undefined).
+
+%% ref_to_list/1
+-spec erlang:ref_to_list(Ref) -> string() when
+ Ref :: reference().
+ref_to_list(_Ref) ->
+ erlang:nif_error(undefined).
+
+%% register/2
+-spec register(RegName, PidOrPort) -> true when
+ RegName :: atom(),
+ PidOrPort :: port() | pid().
+register(_RegName, _PidOrPort) ->
+ erlang:nif_error(undefined).
+
+%% registered/0
+-spec registered() -> [RegName] when
+ RegName :: atom().
+registered() ->
+ erlang:nif_error(undefined).
+
+%% resume_process/1
+-spec erlang:resume_process(Suspendee) -> true when
+ Suspendee :: pid().
+resume_process(_Suspendee) ->
+ erlang:nif_error(undefined).
+
+%% round/1
+%% Shadowed by erl_bif_types: erlang:round/1
+-spec round(Number) -> integer() when
+ Number :: number().
+round(_Number) ->
+ erlang:nif_error(undefined).
+
+%% self/0
+%% Shadowed by erl_bif_types: erlang:self/0
+-spec self() -> pid().
+self() ->
+ erlang:nif_error(undefined).
+
+%% send_after/3
+-spec erlang:send_after(Time, Dest, Msg) -> TimerRef when
+ Time :: non_neg_integer(),
+ Dest :: pid() | atom(),
+ Msg :: term(),
+ TimerRef :: reference().
+send_after(_Time, _Dest, _Msg) ->
+ erlang:nif_error(undefined).
+
+%% seq_trace/2
+-spec erlang:seq_trace(P1, P2) -> seq_trace_info_returns() | {term(), term(), term(), term(), term()} when
+ P1 :: atom(),
+ P2 :: boolean() | {integer(), integer()} | integer() | [].
+seq_trace(_P1, _P2) ->
+ erlang:nif_error(undefined).
+
+%% seq_trace_print/1
+-spec erlang:seq_trace_print(P1) -> boolean() when
+ P1 :: term().
+seq_trace_print(_P1) ->
+ erlang:nif_error(undefined).
+
+%% seq_trace_print/2
+-spec erlang:seq_trace_print(P1, P2) -> boolean() when
+ P1 :: atom() | integer(),
+ P2 :: term().
+seq_trace_print(_P1, _P2) ->
+ erlang:nif_error(undefined).
+
+%% setnode/2
+-spec erlang:setnode(P1, P2) -> true when
+ P1 :: atom(),
+ P2 :: integer().
+setnode(_P1, _P2) ->
+ erlang:nif_error(undefined).
+
+%% setnode/3
+-spec erlang:setnode(P1, P2, P3) -> true when
+ P1 :: atom(),
+ P2 :: port(),
+ P3 :: {term(), term(), term(), term()}.
+setnode(_P1, _P2, _P3) ->
+ erlang:nif_error(undefined).
+
+%% size/1
+%% Shadowed by erl_bif_types: erlang:size/1
+-spec size(Item) -> non_neg_integer() when
+ Item :: tuple() | binary().
+size(_Item) ->
+ erlang:nif_error(undefined).
+
+%% spawn/3
+-spec spawn(Module, Function, Args) -> pid() when
+ Module :: module(),
+ Function :: atom(),
+ Args :: [term()].
+spawn(_Module, _Function, _Args) ->
+ erlang:nif_error(undefined).
+
+%% spawn_link/3
+-spec spawn_link(Module, Function, Args) -> pid() when
+ Module :: module(),
+ Function :: atom(),
+ Args :: [term()].
+spawn_link(_Module, _Function, _Args) ->
+ erlang:nif_error(undefined).
+
+%% split_binary/2
+-spec split_binary(Bin, Pos) -> {binary(), binary()} when
+ Bin :: binary(),
+ Pos :: non_neg_integer().
+split_binary(_Bin, _Pos) ->
+ erlang:nif_error(undefined).
+
+%% start_timer/3
+-spec erlang:start_timer(Time, Dest, Msg) -> TimerRef when
+ Time :: non_neg_integer(),
+ Dest :: pid() | atom(),
+ Msg :: term(),
+ TimerRef :: reference().
+start_timer(_Time, _Dest, _Msg) ->
+ erlang:nif_error(undefined).
+
+%% suspend_process/2
+-spec erlang:suspend_process(Suspendee, OptList) -> boolean() when
+ Suspendee :: pid(),
+ OptList :: [Opt],
+ Opt :: unless_suspending | asynchronous.
+suspend_process(_Suspendee, _OptList) ->
+ erlang:nif_error(undefined).
+
+%% system_monitor/0
+-spec erlang:system_monitor() -> MonSettings when
+ MonSettings :: undefined | { MonitorPid, Options },
+ MonitorPid :: pid(),
+ Options :: [ system_monitor_option() ].
+system_monitor() ->
+ erlang:nif_error(undefined).
+
+%% system_monitor/1
+-spec erlang:system_monitor(Arg) -> MonSettings when
+ Arg :: undefined | { MonitorPid, Options },
+ MonSettings :: undefined | { MonitorPid, Options },
+ MonitorPid :: pid(),
+ Options :: [ system_monitor_option() ].
+system_monitor(_Arg) ->
+ erlang:nif_error(undefined).
+
+%% system_monitor/2
+-spec erlang:system_monitor(MonitorPid, Options) -> MonSettings when
+ MonitorPid :: pid(),
+ Options :: [ system_monitor_option() ],
+ MonSettings :: undefined | { OldMonitorPid, OldOptions },
+ OldMonitorPid :: pid(),
+ OldOptions :: [ system_monitor_option() ].
+system_monitor(_MonitorPid, _Options) ->
+ erlang:nif_error(undefined).
+
+%% system_profile/0
+-spec erlang:system_profile() -> ProfilerSettings when
+ ProfilerSettings :: undefined | { ProfilerPid, Options},
+ ProfilerPid :: pid() | port(),
+ Options :: [ system_profile_option() ].
+system_profile() ->
+ erlang:nif_error(undefined).
+
+%% system_profile/2
+-spec erlang:system_profile(ProfilerPid, Options) -> ProfilerSettings when
+ ProfilerPid :: pid() | port() | undefined,
+ Options :: [ system_profile_option() ],
+ ProfilerSettings :: undefined | { pid() | port(), [ system_profile_option() ]}.
+system_profile(_ProfilerPid, _Options) ->
+ erlang:nif_error(undefined).
+
+%% throw/1
+%% Shadowed by erl_bif_types: erlang:throw/1
+-spec throw(Any) -> no_return() when
+ Any :: term().
+throw(_Any) ->
+ erlang:nif_error(undefined).
+
+%% time/0
+-spec time() -> Time when
+ Time :: calendar:time().
+time() ->
+ erlang:nif_error(undefined).
+
+%% trace/3
+-spec erlang:trace(PidSpec, How, FlagList) -> integer() when
+ PidSpec :: pid() | existing | new | all,
+ How :: boolean(),
+ FlagList :: [trace_flag()].
+trace(_PidSpec, _How, _FlagList) ->
+ erlang:nif_error(undefined).
+
+%% trace_delivered/1
+-spec erlang:trace_delivered(Tracee) -> Ref when
+ Tracee :: pid() | all,
+ Ref :: reference().
+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,
+ Module :: module(),
+ Function :: atom(),
+ Arity :: arity(),
+ Item :: flags | tracer | traced | match_spec | meta | meta_match_spec | call_count | call_time | all,
+ Res :: trace_info_return().
+trace_info(_PidOrFunc, _Item) ->
+ erlang:nif_error(undefined).
+
+%% trunc/1
+%% Shadowed by erl_bif_types: erlang:trunc/1
+-spec trunc(Number) -> integer() when
+ Number :: number().
+trunc(_Number) ->
+ erlang:nif_error(undefined).
+
+%% tuple_size/1
+%% Shadowed by erl_bif_types: erlang:tuple_size/1
+-spec tuple_size(Tuple) -> non_neg_integer() when
+ Tuple :: tuple().
+tuple_size(_Tuple) ->
+ erlang:nif_error(undefined).
+
+%% universaltime/0
+-spec erlang:universaltime() -> DateTime when
+ DateTime :: calendar:datetime().
+universaltime() ->
+ erlang:nif_error(undefined).
+
+%% universaltime_to_posixtime/1
+-spec erlang:universaltime_to_posixtime(P1) -> integer() when
+ P1 :: {calendar:date(), calendar:time()}.
+universaltime_to_posixtime(_P1) ->
+ erlang:nif_error(undefined).
+
+%% unlink/1
+-spec unlink(Id) -> true when
+ Id :: pid() | port().
+unlink(_Id) ->
+ erlang:nif_error(undefined).
+
+%% unregister/1
+-spec unregister(RegName) -> true when
+ RegName :: atom().
+unregister(_RegName) ->
+ erlang:nif_error(undefined).
+
+%% whereis/1
+-spec whereis(RegName) -> pid() | port() | undefined when
+ RegName :: atom().
+whereis(_RegName) ->
+ erlang:nif_error(undefined).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% More complicated native code BIFs
+%%% These are here for the types/specs, the real implementation is in the C code.
+%%% This chunk is handwritten, i.e. contains more complicated specs.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% types and specs
+
+%% Shadowed by erl_bif_types: erlang:abs/1
+-spec abs(Float) -> float() when
+ Float :: float();
+ (Int) -> non_neg_integer() when
+ Int :: integer().
+abs(_Number) ->
+ erlang:nif_error(undefined).
+
+%% Not documented
+%% Shadowed by erl_bif_types: erlang:append/2
+-spec erlang:append(List,Tail) -> maybe_improper_list() when
+ List :: [term()],
+ Tail :: term().
+append(_List,_Tail) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:element/2
+-spec element(N, Tuple) -> term() when
+ N :: pos_integer(),
+ Tuple :: tuple().
+element(_N, _Tuple) ->
+ erlang:nif_error(undefined).
+
+%% Not documented
+-spec erlang:get_module_info(Module, Item) -> ModuleInfo when
+ Module :: atom(),
+ Item :: module | imports | exports | functions | attributes | compile | native_addresses,
+ ModuleInfo :: atom() | [] | [{atom(), arity()}] | [{atom(), term()}] | [{atom(), arity(), integer()}].
+get_module_info(_Module, _Item) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:hd/1
+-spec hd(List) -> term() when
+ List :: [term(), ...].
+hd(_List) ->
+ erlang:nif_error(undefined).
+
+%% erlang:info/1 no longer exists!
+
+%% Shadowed by erl_bif_types: erlang:is_atom/1
+-spec is_atom(Term) -> boolean() when
+ Term :: term().
+is_atom(_Term) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:is_binary/1
+-spec is_binary(Term) -> boolean() when
+ Term :: term().
+is_binary(_Term) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:is_bitstring/1
+-spec is_bitstring(Term) -> boolean() when
+ Term :: term().
+is_bitstring(_Term) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:is_boolean/1
+-spec is_boolean(Term) -> boolean() when
+ Term :: term().
+is_boolean(_Term) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:is_float/1
+-spec is_float(Term) -> boolean() when
+ Term :: term().
+is_float(_Term) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:is_function/1
+-spec is_function(Term) -> boolean() when
+ Term :: term().
+is_function(_Term) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:is_function/2
+-spec is_function(Term, Arity) -> boolean() when
+ Term :: term(),
+ Arity :: arity().
+is_function(_Term, _Arity) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:is_integer/1
+-spec is_integer(Term) -> boolean() when
+ Term :: term().
+is_integer(_Term) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:is_list/1
+-spec is_list(Term) -> boolean() when
+ Term :: term().
+is_list(_Term) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:is_number/1
+-spec is_number(Term) -> boolean() when
+ Term :: term().
+is_number(_Term) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:is_pid/1
+-spec is_pid(Term) -> boolean() when
+ Term :: term().
+is_pid(_Term) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:is_port/1
+-spec is_port(Term) -> boolean() when
+ Term :: term().
+is_port(_Term) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:is_record/2
+-spec is_record(Term,RecordTag) -> boolean() when
+ Term :: term(),
+ RecordTag :: atom().
+is_record(_Term,_RecordTag) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:is_record/3
+-spec is_record(Term,RecordTag,Size) -> boolean() when
+ Term :: term(),
+ RecordTag :: atom(),
+ Size :: non_neg_integer().
+is_record(_Term,_RecordTag,_Size) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:is_reference/1
+-spec is_reference(Term) -> boolean() when
+ Term :: term().
+is_reference(_Term) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:is_tuple/1
+-spec is_tuple(Term) -> boolean() when
+ Term :: term().
+is_tuple(_Term) ->
+ erlang:nif_error(undefined).
+
+-spec load_module(Module, Binary) -> {module, Module} | {error, Reason} when
+ Module :: module(),
+ Binary :: binary(),
+ Reason :: badfile | not_purged | on_load.
+load_module(Mod, Code) ->
+ case erlang:prepare_loading(Mod, Code) of
+ {error,_}=Error ->
+ Error;
+ Bin when erlang:is_binary(Bin) ->
+ case erlang:finish_loading([Bin]) of
+ ok ->
+ {module,Mod};
+ {Error,[Mod]} ->
+ {error,Error}
+ end
+ end.
+
+-spec erlang:load_nif(Path, LoadInfo) -> ok | Error when
+ Path :: string(),
+ LoadInfo :: term(),
+ Error :: {error, {Reason, Text :: string()}},
+ Reason :: load_failed | bad_lib | load | reload | upgrade | old_code.
+load_nif(_Path, _LoadInfo) ->
+ erlang:nif_error(undefined).
+
+-spec erlang:localtime_to_universaltime(Localtime, IsDst) -> Universaltime when
+ Localtime :: calendar:datetime(),
+ Universaltime :: calendar:datetime(),
+ IsDst :: true | false | undefined.
+localtime_to_universaltime(_Localtime, _IsDst) ->
+ erlang:nif_error(undefined).
+
+%% CHECK! Why the strange very thorough specification of the error
+%% condition with disallowed arity in erl_bif_types?
+%% Not documented
+-spec erlang:make_fun(Module, Function, Arity) -> function() when
+ Module :: atom(),
+ Function :: atom(),
+ Arity :: arity().
+make_fun(_Module,_Function, _Arity) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:make_tuple/2
+-spec erlang:make_tuple(Arity, InitialValue) -> tuple() when
+ Arity :: arity(),
+ InitialValue :: term().
+make_tuple(_Arity,_InitialValue) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:make_tuple/3
+-spec erlang:make_tuple(Arity, DefaultValue, InitList) -> tuple() when
+ Arity :: arity(),
+ DefaultValue :: term(),
+ InitList :: [{Position :: pos_integer(), term()}].
+make_tuple(_Arity,_DefaultValue,_InitList) ->
+ erlang:nif_error(undefined).
+
+-spec nodes(Arg) -> Nodes when
+ Arg :: NodeType | [NodeType],
+ NodeType :: visible | hidden | connected | this | known,
+ Nodes :: [node()].
+nodes(_Arg) ->
+ erlang:nif_error(undefined).
+
+-spec open_port(PortName, PortSettings) -> port() when
+ PortName :: {spawn, Command :: string()} |
+ {spawn_driver, Command :: [byte()]} |
+ {spawn_executable, FileName :: file:name() } |
+ {fd, In :: non_neg_integer(), Out :: non_neg_integer()},
+ PortSettings :: [Opt],
+ Opt :: {packet, N :: 1 | 2 | 4}
+ | stream
+ | {line, L :: non_neg_integer()}
+ | {cd, Dir :: string()}
+ | {env, Env :: [{Name :: string(), Val :: string() | false}]}
+ | {args, [string() | binary()]}
+ | {arg0, string() | binary()}
+ | exit_status
+ | use_stdio
+ | nouse_stdio
+ | stderr_to_stdout
+ | in
+ | out
+ | binary
+ | eof.
+open_port(_PortName,_PortSettings) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:port_call/2
+-spec erlang:port_call(Port, Data) -> term() when
+ Port :: port() | atom(),
+ Data :: term().
+port_call(_Port, _Data) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:port_call/3
+-spec erlang:port_call(Port, Operation, Data) -> term() when
+ Port :: port() | atom(),
+ Operation :: integer(),
+ Data :: term().
+port_call(_Port, _Operation, _Data) ->
+ erlang:nif_error(undefined).
+
+-type port_info_item() ::
+ registered_name |
+ id |
+ connected |
+ links |
+ name |
+ input |
+ output |
+ os_pid.
+
+-type port_info_result_item() ::
+ {registered_name, RegName :: atom()} |
+ {id, Index :: non_neg_integer()} |
+ {connected, Pid :: pid()} |
+ {links, Pids :: [pid()]} |
+ {name, String :: string()} |
+ {input, Bytes :: non_neg_integer()} |
+ {output, Bytes :: non_neg_integer()} |
+ {os_pid, OsPid :: non_neg_integer() | 'undefined'}.
+
+%% Shadowed by erl_bif_types: erlang:port_info/1
+-spec erlang:port_info(Port) -> Result when
+ Port :: port() | atom(),
+ Result :: [port_info_result_item()] | undefined.
+port_info(_Result) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:port_info/2
+-spec erlang:port_info(Port, Item) -> Result when
+ Port :: port() | atom(),
+ Item :: port_info_item(),
+ Result :: port_info_result_item() | undefined.
+port_info(_Result, _Item) ->
+ erlang:nif_error(undefined).
+
+-type priority_level() ::
+ low | normal | high | max.
+
+-spec process_flag(trap_exit, Boolean) -> OldBoolean when
+ Boolean :: boolean(),
+ OldBoolean :: boolean();
+ (error_handler, Module) -> OldModule when
+ Module :: atom(),
+ OldModule :: atom();
+ (min_heap_size, MinHeapSize) -> OldMinHeapSize when
+ MinHeapSize :: non_neg_integer(),
+ OldMinHeapSize :: non_neg_integer();
+ (min_bin_vheap_size, MinBinVHeapSize) -> OldMinBinVHeapSize when
+ MinBinVHeapSize :: non_neg_integer(),
+ OldMinBinVHeapSize :: non_neg_integer();
+ (priority, Level) -> OldLevel when
+ Level :: priority_level(),
+ OldLevel :: priority_level();
+ (save_calls, N) -> OldN when
+ N :: 0..10000,
+ OldN :: 0..10000;
+ (sensitive, Boolean) -> OldBoolean when
+ Boolean :: boolean(),
+ OldBoolean :: boolean();
+ %% Deliberately not documented.
+ ({monitor_nodes, term()}, term()) -> term();
+ (monitor_nodes, term()) -> term().
+
+process_flag(_Flag, _Value) ->
+ erlang:nif_error(undefined).
+
+-type process_info_item() ::
+ backtrace |
+ binary |
+ catchlevel |
+ current_function |
+ current_location |
+ current_stacktrace |
+ dictionary |
+ error_handler |
+ garbage_collection |
+ group_leader |
+ heap_size |
+ initial_call |
+ links |
+ last_calls |
+ memory |
+ message_que_len |
+ messages |
+ min_heap_size |
+ min_bin_vheap_size |
+ monitored_by |
+ monitors |
+ priority |
+ reductions |
+ registered_name |
+ sequential_trace_token |
+ stack_size |
+ status |
+ suspending |
+ total_heap_size |
+ trace |
+ trap_exit.
+
+-type process_info_result_item() ::
+ {backtrace, Bin :: binary()} |
+ {binary, BinInfo :: [{non_neg_integer(),
+ non_neg_integer(),
+ non_neg_integer()}]} |
+ {catchlevel, CatchLevel :: non_neg_integer()} |
+ {current_function,
+ {Module :: module(), Function :: atom(), Arity :: arity()}} |
+ {current_location,
+ {Module :: module(), Function :: atom(), Arity :: arity(),
+ Location :: [{file, Filename :: string()} | % not a stack_item()!
+ {line, Line :: pos_integer()}]}} |
+ {current_stacktrace, Stack :: [stack_item()]} |
+ {dictionary, Dictionary :: [{Key :: term(), Value :: term()}]} |
+ {error_handler, Module :: module()} |
+ {garbage_collection, GCInfo :: [{atom(),non_neg_integer()}]} |
+ {group_leader, GroupLeader :: pid()} |
+ {heap_size, Size :: non_neg_integer()} |
+ {initial_call, mfa()} |
+ {links, Pids :: [pid()]} |
+ {last_calls, false | (Calls :: [mfa()])} |
+ {memory, Size :: non_neg_integer()} |
+ {message_que_len, MessageQueueLen :: non_neg_integer()} |
+ {messages, MessageQueue :: [term()]} |
+ {min_heap_size, MinHeapSize :: non_neg_integer()} |
+ {min_bin_vheap_size, MinBinVHeapSize :: non_neg_integer()} |
+ {monitored_by, Pids :: [pid()]} |
+ {monitors,
+ Monitors :: [{process, Pid :: pid() |
+ {RegName :: atom(), Node :: node()}}]} |
+ {priority, Level :: priority_level()} |
+ {reductions, Number :: non_neg_integer()} |
+ {registered_name, Atom :: atom()} |
+ {sequential_trace_token, [] | (SequentialTraceToken :: term())} |
+ {stack_size, Size :: non_neg_integer()} |
+ {status, Status :: exiting | garbage_collecting | waiting | running | runnable | suspended} |
+ {suspending,
+ SuspendeeList :: [{Suspendee :: pid(),
+ ActiveSuspendCount :: non_neg_integer(),
+ OutstandingSuspendCount ::non_neg_integer()}]} |
+ {total_heap_size, Size :: non_neg_integer()} |
+ {trace, InternalTraceFlags :: non_neg_integer()} |
+ {trap_exit, Boolean :: boolean()}.
+
+-type stack_item() ::
+ {Module :: module(),
+ Function :: atom(),
+ Arity :: arity() | (Args :: [term()]),
+ Location :: [{file, Filename :: string()} |
+ {line, Line :: pos_integer()}]}.
+
+-spec process_info(Pid, Item) ->
+ InfoTuple | [] | undefined when
+ Pid :: pid(),
+ Item :: process_info_item(),
+ InfoTuple :: process_info_result_item();
+ (Pid, ItemList) -> InfoTupleList | [] | undefined when
+ Pid :: pid(),
+ ItemList :: [Item],
+ Item :: process_info_item(),
+ InfoTupleList :: [InfoTuple],
+ InfoTuple :: process_info_result_item().
+process_info(_Pid,_ItemSpec) ->
+ erlang:nif_error(undefined).
+
+-spec erlang:send(Dest, Msg) -> Msg when
+ Dest :: dst(),
+ Msg :: term().
+send(_Dest,_Msg) ->
+ erlang:nif_error(undefined).
+
+-spec erlang:send(Dest, Msg, Options) -> Res when
+ Dest :: dst(),
+ Msg :: term(),
+ Options :: [nosuspend | noconnect],
+ Res :: ok | nosuspend | noconnect.
+send(_Dest,_Msg,_Options) ->
+ erlang:nif_error(undefined).
+
+%% Not documented
+-spec erlang:seq_trace_info(send) -> {send, boolean()};
+ ('receive') -> {'receive', boolean()};
+ (print) -> {print, boolean()};
+ (timestamp) -> {timestamp, boolean()};
+ (label) -> [] | {label, non_neg_integer()};
+ (serial) -> [] | {serial, {non_neg_integer(), non_neg_integer()}}.
+seq_trace_info(_What) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:setelement/3
+-spec setelement(Index, Tuple1, Value) -> Tuple2 when
+ Index :: pos_integer(),
+ Tuple1 :: tuple(),
+ Tuple2 :: tuple(),
+ Value :: term().
+setelement(_Index, _Tuple1, _Value) ->
+ erlang:nif_error(undefined).
+
+-spec erlang:spawn_opt({Module, Function, Args, Options}) -> pid() | {pid(), reference()} when
+ Module :: module(),
+ Function :: atom(),
+ Args :: [term()],
+ Options :: [Option],
+ Option :: link | monitor | {priority, Level}
+ | {fullsweep_after, Number :: non_neg_integer()}
+ | {min_heap_size, Size :: non_neg_integer()}
+ | {min_bin_vheap_size, VSize :: non_neg_integer()},
+ Level :: low | normal | high.
+spawn_opt(_Tuple) ->
+ erlang:nif_error(undefined).
+
+-spec statistics(context_switches) -> {ContextSwitches,0} when
+ ContextSwitches :: non_neg_integer();
+ (exact_reductions) -> {Total_Exact_Reductions,
+ Exact_Reductions_Since_Last_Call} when
+ Total_Exact_Reductions :: non_neg_integer(),
+ Exact_Reductions_Since_Last_Call :: non_neg_integer();
+ (garbage_collection) -> {Number_of_GCs, Words_Reclaimed, 0} when
+ Number_of_GCs :: non_neg_integer(),
+ Words_Reclaimed :: non_neg_integer();
+ (io) -> {{input, Input}, {output, Output}} when
+ Input :: non_neg_integer(),
+ Output :: non_neg_integer();
+ (reductions) -> {Total_Reductions,
+ Reductions_Since_Last_Call} when
+ Total_Reductions :: non_neg_integer(),
+ Reductions_Since_Last_Call :: non_neg_integer();
+ (run_queue) -> non_neg_integer();
+ (runtime) -> {Total_Run_Time, Time_Since_Last_Call} when
+ Total_Run_Time :: non_neg_integer(),
+ Time_Since_Last_Call :: non_neg_integer();
+ (scheduler_wall_time) -> [{SchedulerId, ActiveTime, TotalTime}] | undefined when
+ SchedulerId :: pos_integer(),
+ ActiveTime :: non_neg_integer(),
+ TotalTime :: non_neg_integer();
+ (wall_clock) -> {Total_Wallclock_Time,
+ Wallclock_Time_Since_Last_Call} when
+ Total_Wallclock_Time :: non_neg_integer(),
+ Wallclock_Time_Since_Last_Call :: non_neg_integer().
+statistics(_Item) ->
+ erlang:nif_error(undefined).
+
+%% Not documented
+%% Shadowed by erl_bif_types: erlang:subtract/2
+-spec erlang:subtract([term()], [term()]) -> [term()].
+subtract(_,_) ->
+ erlang:nif_error(undefined).
+
+-type scheduler_bind_type() ::
+ 'no_node_processor_spread' |
+ 'no_node_thread_spread' |
+ 'no_spread' |
+ 'processor_spread' |
+ 'spread' |
+ 'thread_spread' |
+ 'thread_no_node_processor_spread' |
+ 'unbound'.
+
+-spec erlang:system_flag(backtrace_depth, Depth) -> OldDepth when
+ Depth :: non_neg_integer(),
+ OldDepth :: non_neg_integer();
+ (cpu_topology, CpuTopology) -> OldCpuTopology when
+ CpuTopology :: cpu_topology(),
+ OldCpuTopology :: cpu_topology();
+ (fullsweep_after, Number) -> OldNumber when
+ Number :: non_neg_integer(),
+ OldNumber :: non_neg_integer();
+ (min_heap_size, MinHeapSize) -> OldMinHeapSize when
+ MinHeapSize :: non_neg_integer(),
+ OldMinHeapSize :: non_neg_integer();
+ (min_bin_vheap_size, MinBinVHeapSize) ->
+ OldMinBinVHeapSize when
+ MinBinVHeapSize :: non_neg_integer(),
+ OldMinBinVHeapSize :: non_neg_integer();
+ (multi_scheduling, BlockState) -> OldBlockState when
+ BlockState :: block | unblock,
+ OldBlockState :: block | unblock | enabled;
+ (scheduler_bind_type, How) -> OldBindType when
+ How :: scheduler_bind_type() | default_bind,
+ OldBindType :: scheduler_bind_type();
+ (scheduler_wall_time, Boolean) -> OldBoolean when
+ Boolean :: boolean(),
+ OldBoolean :: boolean();
+ (schedulers_online, SchedulersOnline) ->
+ OldSchedulersOnline when
+ SchedulersOnline :: pos_integer(),
+ OldSchedulersOnline :: pos_integer();
+ (trace_control_word, TCW) -> OldTCW when
+ TCW :: non_neg_integer(),
+ OldTCW :: non_neg_integer();
+ %% These are deliberately not documented
+ (internal_cpu_topology, term()) -> term();
+ (sequential_tracer, pid() | port() | false) -> pid() | port() | false;
+ (1,0) -> true.
+
+system_flag(_Flag, _Value) ->
+ erlang:nif_error(undefined).
+
+-spec term_to_binary(Term) -> ext_binary() when
+ Term :: term().
+term_to_binary(_Term) ->
+ erlang:nif_error(undefined).
+
+-spec term_to_binary(Term, Options) -> ext_binary() when
+ Term :: term(),
+ Options :: [compressed |
+ {compressed, Level :: 0..9} |
+ {minor_version, Version :: 0..1} ].
+term_to_binary(_Term, _Options) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:tl/1
+-spec tl(List) -> term() when
+ List :: [term(), ...].
+tl(_List) ->
+ erlang:nif_error(undefined).
+
+-type trace_pattern_mfa() ::
+ {atom(),atom(),arity() | '_'} | on_load.
+-type trace_match_spec() ::
+ [{[term()] | '_' ,[term()],[term()]}].
+
+-spec erlang:trace_pattern(MFA, MatchSpec) -> non_neg_integer() when
+ MFA :: trace_pattern_mfa(),
+ MatchSpec :: (MatchSpecList :: trace_match_spec())
+ | boolean()
+ | restart
+ | pause.
+trace_pattern(_MFA, _MatchSpec) ->
+ erlang:nif_error(undefined).
+
+-type trace_pattern_flag() ::
+ global | local |
+ meta | {meta, Pid :: pid()} |
+ call_count |
+ call_time.
+
+-spec erlang:trace_pattern(MFA, MatchSpec, FlagList) -> non_neg_integer() when
+ MFA :: trace_pattern_mfa(),
+ MatchSpec :: (MatchSpecList :: trace_match_spec())
+ | boolean()
+ | restart
+ | pause,
+ FlagList :: [ trace_pattern_flag() ].
+trace_pattern(_MFA, _MatchSpec, _FlagList) ->
+ erlang:nif_error(undefined).
+
+%% Shadowed by erl_bif_types: erlang:tuple_to_list/1
+-spec tuple_to_list(Tuple) -> [term()] when
+ Tuple :: tuple().
+tuple_to_list(_Tuple) ->
+ erlang:nif_error(undefined).
+
+-type cpu_topology() ::
+ [LevelEntry :: level_entry()] | undefined.
+-type level_entry() ::
+ {LevelTag :: level_tag(), SubLevel :: sub_level()}
+ | {LevelTag :: level_tag(),
+ InfoList :: info_list(),
+ SubLevel :: sub_level()}.
+-type level_tag() :: core | node | processor | thread.
+-type sub_level() :: [LevelEntry :: level_entry()]
+ | (LogicalCpuId :: {logical, non_neg_integer()}).
+-type info_list() :: [].
+
+%% Note: changing the ordering number of a clause will change the docs!
+%% Shadowed by erl_bif_types: erlang:system_info/1
+-spec erlang:system_info
+ (allocated_areas) -> [ tuple() ];
+ (allocator) ->
+ {Allocator, Version, Features, Settings} when
+ Allocator :: undefined | glibc,
+ Version :: [non_neg_integer()],
+ Features :: [atom()],
+ Settings :: [{Subsystem :: atom(),
+ [{Parameter :: atom(),
+ Value :: term()}]}];
+ (alloc_util_allocators) -> [Alloc] when
+ Alloc :: atom();
+ ({allocator, Alloc}) -> [_] when %% More or less anything
+ Alloc :: atom();
+ ({allocator_sizes, Alloc}) -> [_] when %% More or less anything
+ Alloc :: atom();
+ (build_type) -> opt | debug | purify | quantify | purecov |
+ gcov | valgrind | gprof | lcnt;
+ (c_compiler_used) -> {atom(), term()};
+ (check_io) -> [_];
+ (compat_rel) -> integer();
+ (cpu_topology) -> CpuTopology when
+ CpuTopology :: cpu_topology();
+ ({cpu_topology, defined | detected | used}) -> CpuTopology when
+ CpuTopology :: cpu_topology();
+ (creation) -> integer();
+ (debug_compiled) -> boolean();
+ (dist) -> binary();
+ (dist_ctrl) -> {Node :: node(),
+ ControllingEntity :: port() | pid()};
+ (driver_version) -> string();
+ (dynamic_trace) -> none | dtrace | systemtap;
+ (dynamic_trace_probes) -> boolean();
+ (elib_malloc) -> false;
+ (dist_buf_busy_limit) -> non_neg_integer();
+ (fullsweep_after) -> {fullsweep_after, non_neg_integer()};
+ (garbage_collection) -> [{atom(), integer()}];
+ (heap_sizes) -> [non_neg_integer()];
+ (heap_type) -> private;
+ (info) -> binary();
+ (kernel_poll) -> boolean();
+ (loaded) -> binary();
+ (logical_processors |
+ logical_processors_available |
+ logical_processors_online) -> unknown | pos_integer();
+ (machine) -> string();
+ (min_heap_size) -> {min_heap_size, MinHeapSize :: pos_integer()};
+ (min_bin_vheap_size) -> {min_bin_vheap_size,
+ MinBinVHeapSize :: pos_integer()};
+ (modified_timing_level) -> integer() | undefined;
+ (multi_scheduling) -> disabled | blocked | enabled;
+ (multi_scheduling_blockers) -> [PID :: pid()];
+ (otp_release) -> string();
+ (process_count) -> pos_integer();
+ (process_limit) -> pos_integer();
+ (procs) -> binary();
+ (scheduler_bind_type) -> spread |
+ processor_spread |
+ thread_spread |
+ thread_no_node_processor_spread |
+ no_node_processor_spread |
+ no_node_thread_spread |
+ no_spread |
+ unbound;
+ (scheduler_bindings) -> tuple();
+ (scheduler_id) -> SchedulerId :: pos_integer();
+ (schedulers | schedulers_online) -> pos_integer();
+ (smp_support) -> boolean();
+ (system_version) -> string();
+ (system_architecture) -> string();
+ (threads) -> boolean();
+ (thread_pool_size) -> non_neg_integer();
+ (trace_control_word) -> non_neg_integer();
+ (update_cpu_info) -> changed | unchanged;
+ (version) -> string();
+ (wordsize | {wordsize, internal} | {wordsize, external}) -> 4 | 8.
+system_info(_Item) ->
+ erlang:nif_error(undefined).
+
+-spec erlang:universaltime_to_localtime(Universaltime) -> Localtime when
+ Localtime :: calendar:datetime(),
+ Universaltime :: calendar:datetime().
+universaltime_to_localtime(_Universaltime) ->
+ erlang:nif_error(undefined).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% End of native code BIFs
+%%% Actual Erlang implementation of some BIF's follow
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
%%--------------------------------------------------------------------------
-spec apply(Fun, Args) -> term() when
@@ -68,6 +2182,7 @@
apply(Fun, Args) ->
erlang:apply(Fun, Args).
+%% Shadowed by erl_bif_types: erlang:apply/3
-spec apply(Module, Function, Args) -> term() when
Module :: module(),
Function :: atom(),
@@ -79,42 +2194,42 @@ apply(Mod, Name, Args) ->
-spec spawn(Fun) -> pid() when
Fun :: function().
-spawn(F) when is_function(F) ->
- spawn(erlang, apply, [F, []]);
-spawn({M,F}=MF) when is_atom(M), is_atom(F) ->
- spawn(erlang, apply, [MF, []]);
+spawn(F) when erlang:is_function(F) ->
+ erlang:spawn(erlang, apply, [F, []]);
+spawn({M,F}=MF) when erlang:is_atom(M), erlang:is_atom(F) ->
+ erlang:spawn(erlang, apply, [MF, []]);
spawn(F) ->
erlang:error(badarg, [F]).
-spec spawn(Node, Fun) -> pid() when
Node :: node(),
Fun :: function().
-spawn(N, F) when N =:= node() ->
- spawn(F);
-spawn(N, F) when is_function(F) ->
- spawn(N, erlang, apply, [F, []]);
-spawn(N, {M,F}=MF) when is_atom(M), is_atom(F) ->
- spawn(N, erlang, apply, [MF, []]);
+spawn(N, F) when N =:= erlang:node() ->
+ erlang:spawn(F);
+spawn(N, F) when erlang:is_function(F) ->
+ erlang:spawn(N, erlang, apply, [F, []]);
+spawn(N, {M,F}=MF) when erlang:is_atom(M), erlang:is_atom(F) ->
+ erlang:spawn(N, erlang, apply, [MF, []]);
spawn(N, F) ->
erlang:error(badarg, [N, F]).
-spec spawn_link(Fun) -> pid() when
Fun :: function().
-spawn_link(F) when is_function(F) ->
- spawn_link(erlang, apply, [F, []]);
-spawn_link({M,F}=MF) when is_atom(M), is_atom(F) ->
- spawn_link(erlang, apply, [MF, []]);
+spawn_link(F) when erlang:is_function(F) ->
+ erlang:spawn_link(erlang, apply, [F, []]);
+spawn_link({M,F}=MF) when erlang:is_atom(M), erlang:is_atom(F) ->
+ erlang:spawn_link(erlang, apply, [MF, []]);
spawn_link(F) ->
erlang:error(badarg, [F]).
-spec spawn_link(Node, Fun) -> pid() when
Node :: node(),
Fun :: function().
-spawn_link(N, F) when N =:= node() ->
+spawn_link(N, F) when N =:= erlang:node() ->
spawn_link(F);
-spawn_link(N, F) when is_function(F) ->
+spawn_link(N, F) when erlang:is_function(F) ->
spawn_link(N, erlang, apply, [F, []]);
-spawn_link(N, {M,F}=MF) when is_atom(M), is_atom(F) ->
+spawn_link(N, {M,F}=MF) when erlang:is_atom(M), erlang:is_atom(F) ->
spawn_link(N, erlang, apply, [MF, []]);
spawn_link(N, F) ->
erlang:error(badarg, [N, F]).
@@ -123,7 +2238,7 @@ spawn_link(N, F) ->
-spec spawn_monitor(Fun) -> {pid(), reference()} when
Fun :: function().
-spawn_monitor(F) when is_function(F, 0) ->
+spawn_monitor(F) when erlang:is_function(F, 0) ->
erlang:spawn_opt({erlang,apply,[F,[]],[monitor]});
spawn_monitor(F) ->
erlang:error(badarg, [F]).
@@ -132,7 +2247,9 @@ spawn_monitor(F) ->
Module :: module(),
Function :: atom(),
Args :: [term()].
-spawn_monitor(M, F, A) when is_atom(M), is_atom(F), is_list(A) ->
+spawn_monitor(M, F, A) when erlang:is_atom(M),
+ erlang:is_atom(F),
+ erlang:is_list(A) ->
erlang:spawn_opt({M,F,A,[monitor]});
spawn_monitor(M, F, A) ->
erlang:error(badarg, [M,F,A]).
@@ -145,9 +2262,9 @@ spawn_monitor(M, F, A) ->
| {min_heap_size, Size :: non_neg_integer()}
| {min_bin_vheap_size, VSize :: non_neg_integer()},
Level :: low | normal | high.
-spawn_opt(F, O) when is_function(F) ->
+spawn_opt(F, O) when erlang:is_function(F) ->
spawn_opt(erlang, apply, [F, []], O);
-spawn_opt({M,F}=MF, O) when is_atom(M), is_atom(F) ->
+spawn_opt({M,F}=MF, O) when erlang:is_atom(M), erlang:is_atom(F) ->
spawn_opt(erlang, apply, [MF, []], O);
spawn_opt({M,F,A}, O) -> % For (undocumented) backward compatibility
spawn_opt(M, F, A, O);
@@ -163,11 +2280,11 @@ spawn_opt(F, O) ->
| {min_heap_size, Size :: non_neg_integer()}
| {min_bin_vheap_size, VSize :: non_neg_integer()},
Level :: low | normal | high.
-spawn_opt(N, F, O) when N =:= node() ->
+spawn_opt(N, F, O) when N =:= erlang:node() ->
spawn_opt(F, O);
-spawn_opt(N, F, O) when is_function(F) ->
+spawn_opt(N, F, O) when erlang:is_function(F) ->
spawn_opt(N, erlang, apply, [F, []], O);
-spawn_opt(N, {M,F}=MF, O) when is_atom(M), is_atom(F) ->
+spawn_opt(N, {M,F}=MF, O) when erlang:is_atom(M), erlang:is_atom(F) ->
spawn_opt(N, erlang, apply, [MF, []], O);
spawn_opt(N, F, O) ->
erlang:error(badarg, [N, F, O]).
@@ -179,9 +2296,14 @@ spawn_opt(N, F, O) ->
Module :: module(),
Function :: atom(),
Args :: [term()].
-spawn(N,M,F,A) when N =:= node(), is_atom(M), is_atom(F), is_list(A) ->
- spawn(M,F,A);
-spawn(N,M,F,A) when is_atom(N), is_atom(M), is_atom(F) ->
+spawn(N,M,F,A) when N =:= erlang:node(),
+ erlang:is_atom(M),
+ erlang:is_atom(F),
+ erlang:is_list(A) ->
+ erlang:spawn(M,F,A);
+spawn(N,M,F,A) when erlang:is_atom(N),
+ erlang:is_atom(M),
+ erlang:is_atom(F) ->
case is_well_formed_list(A) of
true ->
ok;
@@ -189,9 +2311,9 @@ spawn(N,M,F,A) when is_atom(N), is_atom(M), is_atom(F) ->
erlang:error(badarg, [N, M, F, A])
end,
case catch gen_server:call({net_kernel,N},
- {spawn,M,F,A,group_leader()},
+ {spawn,M,F,A,erlang:group_leader()},
infinity) of
- Pid when is_pid(Pid) ->
+ Pid when erlang:is_pid(Pid) ->
Pid;
Error ->
case remote_spawn_error(Error, {no_link, N, M, F, A, []}) of
@@ -209,9 +2331,14 @@ spawn(N,M,F,A) ->
Module :: module(),
Function :: atom(),
Args :: [term()].
-spawn_link(N,M,F,A) when N =:= node(), is_atom(M), is_atom(F), is_list(A) ->
- spawn_link(M,F,A);
-spawn_link(N,M,F,A) when is_atom(N), is_atom(M), is_atom(F) ->
+spawn_link(N,M,F,A) when N =:= erlang:node(),
+ erlang:is_atom(M),
+ erlang:is_atom(F),
+ erlang:is_list(A) ->
+ erlang:spawn_link(M,F,A);
+spawn_link(N,M,F,A) when erlang:is_atom(N),
+ erlang:is_atom(M),
+ erlang:is_atom(F) ->
case is_well_formed_list(A) of
true ->
ok;
@@ -219,9 +2346,9 @@ spawn_link(N,M,F,A) when is_atom(N), is_atom(M), is_atom(F) ->
erlang:error(badarg, [N, M, F, A])
end,
case catch gen_server:call({net_kernel,N},
- {spawn_link,M,F,A,group_leader()},
+ {spawn_link,M,F,A,erlang:group_leader()},
infinity) of
- Pid when is_pid(Pid) ->
+ Pid when erlang:is_pid(Pid) ->
Pid;
Error ->
case remote_spawn_error(Error, {link, N, M, F, A, []}) of
@@ -265,11 +2392,13 @@ spawn_opt(M, F, A, Opts) ->
| {min_heap_size, Size :: non_neg_integer()}
| {min_bin_vheap_size, VSize :: non_neg_integer()},
Level :: low | normal | high.
-spawn_opt(N, M, F, A, O) when N =:= node(),
- is_atom(M), is_atom(F), is_list(A),
- is_list(O) ->
+spawn_opt(N, M, F, A, O) when N =:= erlang:node(),
+ erlang:is_atom(M), erlang:is_atom(F),
+ erlang:is_list(A), erlang:is_list(O) ->
spawn_opt(M, F, A, O);
-spawn_opt(N, M, F, A, O) when is_atom(N), is_atom(M), is_atom(F) ->
+spawn_opt(N, M, F, A, O) when erlang:is_atom(N),
+ erlang:is_atom(M),
+ erlang:is_atom(F) ->
case {is_well_formed_list(A), is_well_formed_list(O)} of
{true, true} ->
ok;
@@ -288,9 +2417,9 @@ spawn_opt(N, M, F, A, O) when is_atom(N), is_atom(M), is_atom(F) ->
{no_link,[]},
O),
case catch gen_server:call({net_kernel,N},
- {spawn_opt,M,F,A,NO,L,group_leader()},
+ {spawn_opt,M,F,A,NO,L,erlang:group_leader()},
infinity) of
- Pid when is_pid(Pid) ->
+ Pid when erlang:is_pid(Pid) ->
Pid;
Error ->
case remote_spawn_error(Error, {L, N, M, F, A, NO}) of
@@ -328,11 +2457,11 @@ is_well_formed_list(_) ->
crasher(Node,Mod,Fun,Args,[],Reason) ->
error_logger:warning_msg("** Can not start ~w:~w,~w on ~w **~n",
[Mod,Fun,Args,Node]),
- exit(Reason);
+ erlang:exit(Reason);
crasher(Node,Mod,Fun,Args,Opts,Reason) ->
error_logger:warning_msg("** Can not start ~w:~w,~w (~w) on ~w **~n",
[Mod,Fun,Args,Opts,Node]),
- exit(Reason).
+ erlang:exit(Reason).
-spec erlang:yield() -> 'true'.
yield() ->
@@ -353,7 +2482,7 @@ disconnect_node(Node) ->
Item :: arity | env | index | name
| module | new_index | new_uniq | pid | type | uniq,
Info :: term().
-fun_info(Fun) when is_function(Fun) ->
+fun_info(Fun) when erlang:is_function(Fun) ->
Keys = [type,env,arity,name,uniq,index,new_uniq,new_index,module,pid],
fun_info_1(Keys, Fun, []).
@@ -385,11 +2514,9 @@ send_nosuspend(Pid, Msg, Opts) ->
_ -> false
end.
--spec erlang:localtime_to_universaltime({Date1, Time1}) -> {Date2, Time2} when
- Date1 :: calendar:date(),
- Date2 :: calendar:date(),
- Time1 :: calendar:time(),
- Time2 :: calendar:time().
+-spec erlang:localtime_to_universaltime(Localtime) -> Universaltime when
+ Localtime :: calendar:datetime(),
+ Universaltime :: calendar:datetime().
localtime_to_universaltime(Localtime) ->
erlang:localtime_to_universaltime(Localtime, undefined).
@@ -409,25 +2536,25 @@ suspend_process(P) ->
%% reactivate the command.
%%
--spec dlink(pid() | port()) -> 'true'.
+-spec erlang:dlink(pid() | port()) -> 'true'.
dlink(Pid) ->
- case net_kernel:connect(node(Pid)) of
- true -> link(Pid);
- false -> erlang:dist_exit(self(), noconnection, Pid), true
+ case net_kernel:connect(erlang:node(Pid)) of
+ true -> erlang:link(Pid);
+ false -> erlang:dist_exit(erlang:self(), noconnection, Pid), true
end.
%% Can this ever happen?
--spec dunlink(identifier()) -> 'true'.
+-spec erlang:dunlink(identifier()) -> 'true'.
dunlink(Pid) ->
- case net_kernel:connect(node(Pid)) of
- true -> unlink(Pid);
+ case net_kernel:connect(erlang:node(Pid)) of
+ true -> erlang:unlink(Pid);
false -> true
end.
dmonitor_node(Node, Flag, []) ->
case net_kernel:connect(Node) of
true -> erlang:monitor_node(Node, Flag, []);
- false -> self() ! {nodedown, Node}, true
+ false -> erlang:self() ! {nodedown, Node}, true
end;
dmonitor_node(Node, Flag, Opts) ->
@@ -435,31 +2562,31 @@ dmonitor_node(Node, Flag, Opts) ->
true ->
case net_kernel:passive_cnct(Node) of
true -> erlang:monitor_node(Node, Flag, Opts);
- false -> self() ! {nodedown, Node}, true
+ false -> erlang:self() ! {nodedown, Node}, true
end;
_ ->
dmonitor_node(Node,Flag,[])
end.
dgroup_leader(Leader, Pid) ->
- case net_kernel:connect(node(Pid)) of
- true -> group_leader(Leader, Pid);
+ case net_kernel:connect(erlang:node(Pid)) of
+ true -> erlang:group_leader(Leader, Pid);
false -> true %% bad arg ?
end.
dexit(Pid, Reason) ->
- case net_kernel:connect(node(Pid)) of
- true -> exit(Pid, Reason);
+ case net_kernel:connect(erlang:node(Pid)) of
+ true -> erlang:exit(Pid, Reason);
false -> true
end.
-dsend(Pid, Msg) when is_pid(Pid) ->
- case net_kernel:connect(node(Pid)) of
+dsend(Pid, Msg) when erlang:is_pid(Pid) ->
+ case net_kernel:connect(erlang:node(Pid)) of
true -> erlang:send(Pid, Msg);
false -> Msg
end;
-dsend(Port, Msg) when is_port(Port) ->
- case net_kernel:connect(node(Port)) of
+dsend(Port, Msg) when erlang:is_port(Port) ->
+ case net_kernel:connect(erlang:node(Port)) of
true -> erlang:send(Port, Msg);
false -> Msg
end;
@@ -470,13 +2597,13 @@ dsend({Name, Node}, Msg) ->
ignored -> Msg % Not distributed.
end.
-dsend(Pid, Msg, Opts) when is_pid(Pid) ->
- case net_kernel:connect(node(Pid)) of
+dsend(Pid, Msg, Opts) when erlang:is_pid(Pid) ->
+ case net_kernel:connect(erlang:node(Pid)) of
true -> erlang:send(Pid, Msg, Opts);
false -> ok
end;
-dsend(Port, Msg, Opts) when is_port(Port) ->
- case net_kernel:connect(node(Port)) of
+dsend(Port, Msg, Opts) when erlang:is_port(Port) ->
+ case net_kernel:connect(erlang:node(Port)) of
true -> erlang:send(Port, Msg, Opts);
false -> ok
end;
@@ -487,21 +2614,23 @@ dsend({Name, Node}, Msg, Opts) ->
ignored -> ok % Not distributed.
end.
--spec dmonitor_p('process', pid() | {atom(),atom()}) -> reference().
+-spec erlang:dmonitor_p('process', pid() | {atom(),atom()}) -> reference().
dmonitor_p(process, ProcSpec) ->
%% ProcSpec = pid() | {atom(),atom()}
%% ProcSpec CANNOT be an atom because a locally registered process
%% is never handled here.
Node = case ProcSpec of
- {S,N} when is_atom(S), is_atom(N), N =/= node() -> N;
- _ when is_pid(ProcSpec) -> node(ProcSpec)
+ {S,N} when erlang:is_atom(S),
+ erlang:is_atom(N),
+ N =/= erlang:node() -> N;
+ _ when erlang:is_pid(ProcSpec) -> erlang:node(ProcSpec)
end,
case net_kernel:connect(Node) of
true ->
erlang:monitor(process, ProcSpec);
false ->
- Ref = make_ref(),
- self() ! {'DOWN', Ref, process, ProcSpec, noconnection},
+ Ref = erlang:make_ref(),
+ erlang:self() ! {'DOWN', Ref, process, ProcSpec, noconnection},
Ref
end.
@@ -509,7 +2638,7 @@ dmonitor_p(process, ProcSpec) ->
%% Trap function used when modified timing has been enabled.
%%
--spec delay_trap(Result, timeout()) -> Result.
+-spec erlang:delay_trap(Result, timeout()) -> Result.
delay_trap(Result, 0) -> erlang:yield(), Result;
delay_trap(Result, Timeout) -> receive after Timeout -> Result end.
@@ -523,12 +2652,12 @@ delay_trap(Result, Timeout) -> receive after Timeout -> Result end.
-spec erlang:set_cookie(Node, Cookie) -> true when
Node :: node(),
Cookie :: atom().
-set_cookie(Node, C) when Node =/= nonode@nohost, is_atom(Node) ->
- case is_atom(C) of
+set_cookie(Node, C) when Node =/= nonode@nohost, erlang:is_atom(Node) ->
+ case erlang:is_atom(C) of
true ->
auth:set_cookie(Node, C);
false ->
- error(badarg)
+ erlang:error(badarg)
end.
-spec erlang:get_cookie() -> Cookie | nocookie when
@@ -542,7 +2671,8 @@ get_cookie() ->
integer_to_list(I, 10) ->
erlang:integer_to_list(I);
integer_to_list(I, Base)
- when is_integer(I), is_integer(Base), Base >= 2, Base =< 1+$Z-$A+10 ->
+ when erlang:is_integer(I), erlang:is_integer(Base),
+ Base >= 2, Base =< 1+$Z-$A+10 ->
if I < 0 ->
[$-|integer_to_list(-I, Base, [])];
true ->
@@ -572,9 +2702,10 @@ integer_to_list(I0, Base, R0) ->
list_to_integer(L, 10) ->
erlang:list_to_integer(L);
list_to_integer(L, Base)
- when is_list(L), is_integer(Base), Base >= 2, Base =< 1+$Z-$A+10 ->
+ when erlang:is_list(L), erlang:is_integer(Base),
+ Base >= 2, Base =< 1+$Z-$A+10 ->
case list_to_integer_sign(L, Base) of
- I when is_integer(I) ->
+ I when erlang:is_integer(I) ->
I;
Fault ->
erlang:error(Fault, [L,Base])
@@ -584,7 +2715,7 @@ list_to_integer(L, Base) ->
list_to_integer_sign([$-|[_|_]=L], Base) ->
case list_to_integer(L, Base, 0) of
- I when is_integer(I) ->
+ I when erlang:is_integer(I) ->
-I;
I ->
I
@@ -597,13 +2728,13 @@ list_to_integer_sign(_, _) ->
badarg.
list_to_integer([D|L], Base, I)
- when is_integer(D), D >= $0, D =< $9, D < Base+$0 ->
+ when erlang:is_integer(D), D >= $0, D =< $9, D < Base+$0 ->
list_to_integer(L, Base, I*Base + D-$0);
list_to_integer([D|L], Base, I)
- when is_integer(D), D >= $A, D < Base+$A-10 ->
+ when erlang:is_integer(D), D >= $A, D < Base+$A-10 ->
list_to_integer(L, Base, I*Base + D-$A+10);
list_to_integer([D|L], Base, I)
- when is_integer(D), D >= $a, D < Base+$a-10 ->
+ when erlang:is_integer(D), D >= $a, D < Base+$a-10 ->
list_to_integer(L, Base, I*Base + D-$a+10);
list_to_integer([], _, I) ->
I;
@@ -615,7 +2746,8 @@ list_to_integer(_, _, _) ->
%% erlang:demonitor(Ref, [flush]) traps to
%% erlang:flush_monitor_message(Ref, Res) when
%% it needs to flush a monitor message.
-flush_monitor_message(Ref, Res) when is_reference(Ref), is_atom(Res) ->
+flush_monitor_message(Ref, Res) when erlang:is_reference(Ref),
+ erlang:is_atom(Res) ->
receive {_, Ref, _, _, _} -> ok after 0 -> ok end,
Res.
@@ -641,7 +2773,7 @@ set_cpu_topology(CpuTopology) ->
cput_e2i_clvl({logical, _}, _PLvl) ->
#cpu.logical;
cput_e2i_clvl([E | _], PLvl) ->
- case element(1, E) of
+ case erlang:element(1, E) of
node -> case PLvl of
0 -> #cpu.node;
#cpu.processor -> #cpu.processor_node
@@ -710,7 +2842,7 @@ cput_e2i({thread, TL}, Nid, PId, #cpu{thread = T0} = CPU, PLvl, #cpu.thread,
cput_e2i(TL, Nid, PId, CPU#cpu{thread = T0+1}, #cpu.thread, Lvl, Res);
cput_e2i({logical, ID}, _Nid, PId, #cpu{processor=P, core=C, thread=T} = CPU,
PLvl, #cpu.logical, Res)
- when PLvl < #cpu.logical, is_integer(ID), 0 =< ID, ID < 65536 ->
+ when PLvl < #cpu.logical, erlang:is_integer(ID), 0 =< ID, ID < 65536 ->
[CPU#cpu{processor = case P of -1 -> PId+1; _ -> P end,
core = case C of -1 -> 0; _ -> C end,
thread = case T of -1 -> 0; _ -> T end,
@@ -735,9 +2867,9 @@ cput_i2e([], _Frst, _Lvl, _TM) ->
cput_i2e([#cpu{logical = LID}| _], _Frst, Lvl, _TM) when Lvl == #cpu.logical ->
{logical, LID};
cput_i2e([#cpu{} = I | Is], Frst, Lvl, TM) ->
- cput_i2e(element(Lvl, I), Frst, Is, [I], Lvl, TM).
+ cput_i2e(erlang:element(Lvl, I), Frst, Is, [I], Lvl, TM).
-cput_i2e(V, Frst, [I | Is], SameV, Lvl, TM) when V =:= element(Lvl, I) ->
+cput_i2e(V, Frst, [I | Is], SameV, Lvl, TM) when V =:= erlang:element(Lvl, I) ->
cput_i2e(V, Frst, Is, [I | SameV], Lvl, TM);
cput_i2e(-1, true, [], SameV, Lvl, TM) ->
cput_i2e(rvrs(SameV), true, Lvl+1, TM);
@@ -751,10 +2883,10 @@ cput_i2e(_V, _Frst, Is, SameV, Lvl, TM) ->
[{cput_i2e_tag(Lvl, TM), cput_i2e(rvrs(SameV), true, Lvl+1, TM)}
| cput_i2e(Is, false, Lvl, TM)].
-cput_i2e_tag_map() -> list_to_tuple([cpu | record_info(fields, cpu)]).
+cput_i2e_tag_map() -> erlang:list_to_tuple([cpu | record_info(fields, cpu)]).
cput_i2e_tag(Lvl, TM) ->
- case element(Lvl, TM) of processor_node -> node; Other -> Other end.
+ case erlang:element(Lvl, TM) of processor_node -> node; Other -> Other end.
rvrs([_] = L) -> L;
rvrs(Xs) -> rvrs(Xs, []).
@@ -773,7 +2905,7 @@ rvrs([X|Xs],Ys) -> rvrs(Xs, [X|Ys]).
%% functions in bif.c. Do not make
%% any changes to it without reading
%% the comment about them in bif.c!
--spec await_proc_exit(dst(), 'apply' | 'data' | 'reason', term()) -> term().
+-spec erlang:await_proc_exit(dst(), 'apply' | 'data' | 'reason', term()) -> term().
await_proc_exit(Proc, Op, Data) ->
Mon = erlang:monitor(process, Proc),
receive
@@ -811,7 +2943,9 @@ max(A, _) -> A.
%% erts_memory() in $ERL_TOP/erts/emulator/beam/erl_alloc.c
%%
--type memory_type() :: 'total' | 'processes' | 'processes_used' | 'system' | 'atom' | 'atom_used' | 'binary' | 'code' | 'ets' | 'low' | 'maximum'.
+-type memory_type() :: 'total' | 'processes' | 'processes_used' | 'system'
+ | 'atom' | 'atom_used' | 'binary' | 'code' | 'ets'
+ | 'low' | 'maximum'.
-define(CARRIER_ALLOCS, [mseg_alloc, sbmbc_alloc, sbmbc_low_alloc]).
-define(LOW_ALLOCS, [sbmbc_low_alloc, ll_low_alloc, std_low_alloc]).
@@ -830,7 +2964,9 @@ max(A, _) -> A.
low = 0,
maximum = 0}).
--spec memory() -> [{memory_type(), non_neg_integer()}].
+-spec erlang:memory() -> [{Type, Size}] when
+ Type :: memory_type(),
+ Size :: non_neg_integer().
memory() ->
case aa_mem_data(au_mem_data(?ALL_NEEDED_ALLOCS)) of
notsup ->
@@ -855,8 +2991,9 @@ memory() ->
{ets, Mem#memory.ets} | Tail]
end.
--spec memory(memory_type()|[memory_type()]) -> non_neg_integer() | [{memory_type(), non_neg_integer()}].
-memory(Type) when is_atom(Type) ->
+-spec erlang:memory(Type :: memory_type()) -> non_neg_integer();
+ (TypeList :: [memory_type()]) -> [{memory_type(), non_neg_integer()}].
+memory(Type) when erlang:is_atom(Type) ->
{AA, ALCU, ChkSup, BadArgZero} = need_mem_info(Type),
case get_mem_data(ChkSup, ALCU, AA) of
notsup ->
@@ -868,7 +3005,7 @@ memory(Type) when is_atom(Type) ->
_ -> Value
end
end;
-memory(Types) when is_list(Types) ->
+memory(Types) when erlang:is_list(Types) ->
{AA, ALCU, ChkSup, BadArgZeroList} = need_mem_info_list(Types),
case get_mem_data(ChkSup, ALCU, AA) of
notsup ->
@@ -1076,7 +3213,7 @@ au_mem_data(EMD, []) ->
EMD.
au_mem_data(Allocs) ->
- Ref = make_ref(),
+ Ref = erlang:make_ref(),
erlang:system_info({allocator_sizes, Ref, Allocs}),
receive_emd(Ref).
@@ -1162,11 +3299,11 @@ alloc_info(Allocs) ->
alloc_sizes(Allocs) ->
get_alloc_info(allocator_sizes, Allocs).
-get_alloc_info(Type, AAtom) when is_atom(AAtom) ->
+get_alloc_info(Type, AAtom) when erlang:is_atom(AAtom) ->
[{AAtom, Result}] = get_alloc_info(Type, [AAtom]),
Result;
-get_alloc_info(Type, AList) when is_list(AList) ->
- Ref = make_ref(),
+get_alloc_info(Type, AList) when erlang:is_list(AList) ->
+ Ref = erlang:make_ref(),
erlang:system_info({Type, Ref, AList}),
receive_allocator(Ref,
erlang:system_info(schedulers),
@@ -1202,3 +3339,34 @@ receive_allocator(Ref, N, Acc) ->
{Ref, _, InfoList} ->
receive_allocator(Ref, N-1, insert_info(InfoList, Acc))
end.
+
+-spec erlang:await_sched_wall_time_modifications(Ref, Result) -> boolean() when
+ Ref :: reference(),
+ Result :: boolean().
+
+await_sched_wall_time_modifications(Ref, Result) ->
+ sched_wall_time(Ref, erlang:system_info(schedulers)),
+ Result.
+
+-spec erlang:gather_sched_wall_time_result(Ref) -> [{pos_integer(),
+ non_neg_integer(),
+ non_neg_integer()}] when
+ Ref :: reference().
+
+gather_sched_wall_time_result(Ref) when erlang:is_reference(Ref) ->
+ sched_wall_time(Ref, erlang:system_info(schedulers), []).
+
+sched_wall_time(_Ref, 0) ->
+ ok;
+sched_wall_time(Ref, N) ->
+ receive Ref -> sched_wall_time(Ref, N-1) end.
+
+sched_wall_time(_Ref, 0, Acc) ->
+ Acc;
+sched_wall_time(Ref, N, undefined) ->
+ receive {Ref, _} -> sched_wall_time(Ref, N-1, undefined) end;
+sched_wall_time(Ref, N, Acc) ->
+ receive
+ {Ref, undefined} -> sched_wall_time(Ref, N-1, undefined);
+ {Ref, SWT} -> sched_wall_time(Ref, N-1, [SWT|Acc])
+ end.
diff --git a/erts/preloaded/src/init.erl b/erts/preloaded/src/init.erl
index c9c434dea0..1d1087c7f2 100644
--- a/erts/preloaded/src/init.erl
+++ b/erts/preloaded/src/init.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -635,8 +635,16 @@ do_unload([M|Mods]) ->
catch erlang:purge_module(M),
do_unload(Mods);
do_unload([]) ->
+ purge_all_hipe_refs(),
ok.
+purge_all_hipe_refs() ->
+ case erlang:system_info(hipe_architecture) of
+ undefined -> ok;
+ _ -> hipe_bifs:remove_refs_from(all)
+ end.
+
+
sub([H|T],L) -> sub(T,del(H,L));
sub([],L) -> L.
@@ -1252,7 +1260,11 @@ get_arguments([]) ->
[].
to_strings([H|T]) when is_atom(H) -> [atom_to_list(H)|to_strings(T)];
-to_strings([H|T]) when is_binary(H) -> [binary_to_list(H)|to_strings(T)];
+to_strings([H|T]) when is_binary(H) -> [try
+ unicode:characters_to_list(H,file:native_name_encoding())
+ catch
+ _:_ -> binary_to_list(H)
+ end|to_strings(T)];
to_strings([]) -> [].
get_argument(Arg,Flags) ->
diff --git a/erts/preloaded/src/prim_file.erl b/erts/preloaded/src/prim_file.erl
index 36cbe329e8..eafab1bae4 100644
--- a/erts/preloaded/src/prim_file.erl
+++ b/erts/preloaded/src/prim_file.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2012. 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
@@ -147,6 +147,32 @@
-define(POSIX_FADV_NOREUSE, 5).
+%%% BIFs
+
+-export([internal_name2native/1,
+ internal_native2name/1,
+ internal_normalize_utf8/1]).
+
+-type unicode_string() :: [unicode:unicode_char()].
+-type prim_file_name() :: unicode_string() | unicode:unicode_binary().
+
+-spec internal_name2native(prim_file_name()) -> binary().
+
+internal_name2native(_) ->
+ erlang:nif_error(undefined).
+
+-spec internal_native2name(binary()) -> prim_file_name().
+
+internal_native2name(_) ->
+ erlang:nif_error(undefined).
+
+-spec internal_normalize_utf8(unicode:unicode_binary()) -> unicode_string().
+
+internal_normalize_utf8(_) ->
+ erlang:nif_error(undefined).
+
+%%% End of BIFs
+
%%%-----------------------------------------------------------------
%%% Functions operating on a file through a handle. ?FD_DRV.
%%%
@@ -268,7 +294,7 @@ advise(#file_descriptor{module = ?MODULE, data = {Port, _}},
%% Returns {error, Reason} | ok.
write(#file_descriptor{module = ?MODULE, data = {Port, _}}, Bytes) ->
- case drv_command(Port, [?FILE_WRITE,Bytes]) of
+ case drv_command_nt(Port, [?FILE_WRITE,erlang:dt_prepend_vm_tag_data(Bytes)],undefined) of
{ok, _Size} ->
ok;
Error ->
@@ -283,8 +309,8 @@ pwrite(#file_descriptor{module = ?MODULE, data = {Port, _}}, L)
pwrite_int(_, [], 0, [], []) ->
ok;
pwrite_int(Port, [], N, Spec, Data) ->
- Header = list_to_binary([<<?FILE_PWRITEV, N:32>> | reverse(Spec)]),
- case drv_command_raw(Port, [Header | reverse(Data)]) of
+ Header = list_to_binary([?FILE_PWRITEV, erlang:dt_prepend_vm_tag_data(<<N:32>>) | reverse(Spec)]),
+ case drv_command_nt(Port, [Header | reverse(Data)], undefined) of
{ok, _Size} ->
ok;
Error ->
@@ -402,7 +428,7 @@ pread(#file_descriptor{module = ?MODULE, data = {Port, _}}, L)
pread_int(_, [], 0, []) ->
{ok, []};
pread_int(Port, [], N, Spec) ->
- drv_command(Port, [<<?FILE_PREADV, 0:32, N:32>> | reverse(Spec)]);
+ drv_command_nt(Port, [?FILE_PREADV, erlang:dt_prepend_vm_tag_data(<<0:32, N:32>>) | reverse(Spec)],undefined);
pread_int(Port, [{Offs, Size} | T], N, Spec)
when is_integer(Offs), is_integer(Size), 0 =< Size ->
if
@@ -423,9 +449,9 @@ pread(#file_descriptor{module = ?MODULE, data = {Port, _}}, Offs, Size)
if
-(?LARGEFILESIZE) =< Offs, Offs < ?LARGEFILESIZE,
Size < ?LARGEFILESIZE ->
- case drv_command(Port,
- <<?FILE_PREADV, 0:32, 1:32,
- Offs:64/signed, Size:64>>) of
+ case drv_command_nt(Port,
+ [?FILE_PREADV, erlang:dt_prepend_vm_tag_data(<<0:32, 1:32,
+ Offs:64/signed, Size:64>>)], undefined) of
{ok, [eof]} ->
eof;
{ok, [Data]} ->
@@ -453,7 +479,7 @@ position(#file_descriptor{module = ?MODULE, data = {Port, _}}, At) ->
{error, Reason}
end.
-%% Returns {error, Reaseon} | ok.
+%% Returns {error, Reason} | ok.
truncate(#file_descriptor{module = ?MODULE, data = {Port, _}}) ->
drv_command(Port, <<?FILE_TRUNCATE>>).
@@ -648,25 +674,7 @@ set_cwd(Dir) ->
set_cwd(Port, Dir) when is_port(Port) ->
set_cwd_int(Port, Dir).
-set_cwd_int(Port, Dir0) ->
- Dir =
- (catch
- case os:type() of
- vxworks ->
- %% chdir on vxworks doesn't support
- %% relative paths
- %% must call get_cwd from here and use
- %% absname/2, since
- %% absname/1 uses file:get_cwd ...
- case get_cwd_int(Port, 0) of
- {ok, AbsPath} ->
- filename:absname(Dir0, AbsPath);
- _Badcwd ->
- Dir0
- end;
- _Else ->
- Dir0
- end),
+set_cwd_int(Port, Dir) ->
%% Dir is now either a string or an EXIT tuple.
%% An EXIT tuple will fail in the following catch.
drv_command(Port, [?FILE_CHDIR, pathname(Dir)]).
@@ -923,12 +931,17 @@ drv_open(Driver, Portopts) ->
%% Closes a port in a safe way. Returns ok.
drv_close(Port) ->
- try erlang:port_close(Port) catch error:_ -> ok end,
- receive %% Ugly workaround in case the caller==owner traps exits
- {'EXIT', Port, _Reason} ->
- ok
- after 0 ->
- ok
+ Save = erlang:dt_spread_tag(false),
+ try
+ try erlang:port_close(Port) catch error:_ -> ok end,
+ receive %% Ugly workaround in case the caller==owner traps exits
+ {'EXIT', Port, _Reason} ->
+ ok
+ after 0 ->
+ ok
+ end
+ after
+ erlang:dt_restore_tag(Save)
end.
@@ -938,9 +951,6 @@ drv_close(Port) ->
%% then closed after the result has been received.
%% Returns {ok, Result} or {error, Reason}.
-drv_command_raw(Port, Command) ->
- drv_command(Port, Command, false, undefined).
-
drv_command(Port, Command) ->
drv_command(Port, Command, undefined).
@@ -956,7 +966,8 @@ drv_command(Port, Command, R) ->
end.
drv_command(Port, Command, Validated, R) when is_port(Port) ->
- try erlang:port_command(Port, Command) of
+ Save = erlang:dt_spread_tag(false),
+ try erlang:port_command(Port, erlang:dt_append_vm_tag_data(Command)) of
true ->
drv_get_response(Port, R)
catch
@@ -975,6 +986,8 @@ drv_command(Port, Command, Validated, R) when is_port(Port) ->
end;
error:Reason ->
{error, Reason}
+ after
+ erlang:dt_restore_tag(Save)
end;
drv_command({Driver, Portopts}, Command, Validated, R) ->
case drv_open(Driver, Portopts) of
@@ -985,6 +998,25 @@ drv_command({Driver, Portopts}, Command, Validated, R) ->
Error ->
Error
end.
+drv_command_nt(Port, Command, R) when is_port(Port) ->
+ Save = erlang:dt_spread_tag(false),
+ try erlang:port_command(Port, Command) of
+ true ->
+ drv_get_response(Port, R)
+ catch
+ error:badarg ->
+ try erlang:iolist_size(Command) of
+ _ -> % Valid
+ {error, einval}
+ catch
+ error:_ ->
+ {error, badarg}
+ end;
+ error:Reason ->
+ {error, Reason}
+ after
+ erlang:dt_restore_tag(Save)
+ end.
diff --git a/erts/preloaded/src/prim_inet.erl b/erts/preloaded/src/prim_inet.erl
index 0cedd284db..b639b1efdd 100644
--- a/erts/preloaded/src/prim_inet.erl
+++ b/erts/preloaded/src/prim_inet.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2012. 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
@@ -83,8 +83,10 @@ open(Protocol, Family, Type, Req, Data) ->
end
catch
%% The only (?) way to get here is to try to open
- %% the sctp driver when it does not exist
- error:badarg -> {error,eprotonosupport}
+ %% the sctp driver when it does not exist (badarg)
+ error:badarg -> {error, eprotonosupport};
+ %% system_limit if out of port slots
+ error:system_limit -> {error, system_limit}
end.
enc_family(inet) -> ?INET_AF_INET;
@@ -182,7 +184,7 @@ close_pend_loop(S, N) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bind(S,IP,Port) when is_port(S), is_integer(Port), Port >= 0, Port =< 65535 ->
- case ctl_cmd(S,?INET_REQ_BIND,[?int16(Port),ip_to_bytes(IP)]) of
+ case ctl_cmd(S,?INET_REQ_BIND,enc_value(set, addr, {IP,Port})) of
{ok, [P1,P0]} -> {ok, ?u16(P1, P0)};
{error,_}=Error -> Error
end;
@@ -204,10 +206,10 @@ bindx(S, AddFlag, Addrs) ->
case getprotocol(S) of
sctp ->
%% Really multi-homed "bindx". Stringified args:
- %% [AddFlag, (Port, IP)+]:
+ %% [AddFlag, (AddrBytes see enc_value_2(addr,X))+]:
Args =
[?int8(AddFlag)|
- [[?int16(Port)|ip_to_bytes(IP)] ||
+ [enc_value(set, addr, {IP,Port}) ||
{IP, Port} <- Addrs]],
case ctl_cmd(S, ?SCTP_REQ_BINDX, Args) of
{ok,_} -> {ok, S};
@@ -1069,7 +1071,6 @@ enc_opt(deliver) -> ?INET_LOPT_DELIVER;
enc_opt(exit_on_close) -> ?INET_LOPT_EXITONCLOSE;
enc_opt(high_watermark) -> ?INET_LOPT_TCP_HIWTRMRK;
enc_opt(low_watermark) -> ?INET_LOPT_TCP_LOWTRMRK;
-enc_opt(bit8) -> ?INET_LOPT_BIT8;
enc_opt(send_timeout) -> ?INET_LOPT_TCP_SEND_TIMEOUT;
enc_opt(send_timeout_close) -> ?INET_LOPT_TCP_SEND_TIMEOUT_CLOSE;
enc_opt(delay_send) -> ?INET_LOPT_TCP_DELAY_SEND;
@@ -1123,7 +1124,6 @@ dec_opt(?INET_LOPT_DELIVER) -> deliver;
dec_opt(?INET_LOPT_EXITONCLOSE) -> exit_on_close;
dec_opt(?INET_LOPT_TCP_HIWTRMRK) -> high_watermark;
dec_opt(?INET_LOPT_TCP_LOWTRMRK) -> low_watermark;
-dec_opt(?INET_LOPT_BIT8) -> bit8;
dec_opt(?INET_LOPT_TCP_SEND_TIMEOUT) -> send_timeout;
dec_opt(?INET_LOPT_TCP_SEND_TIMEOUT_CLOSE) -> send_timeout_close;
dec_opt(?INET_LOPT_TCP_DELAY_SEND) -> delay_send;
@@ -1218,11 +1218,6 @@ type_opt_1(deliver) ->
type_opt_1(exit_on_close) -> bool;
type_opt_1(low_watermark) -> int;
type_opt_1(high_watermark) -> int;
-type_opt_1(bit8) ->
- {enum,[{clear, ?INET_BIT8_CLEAR},
- {set, ?INET_BIT8_SET},
- {on, ?INET_BIT8_ON},
- {off, ?INET_BIT8_OFF}]};
type_opt_1(send_timeout) -> time;
type_opt_1(send_timeout_close) -> bool;
type_opt_1(delay_send) -> bool;
diff --git a/erts/preloaded/src/zlib.erl b/erts/preloaded/src/zlib.erl
index 210532edac..1faae1c1f4 100644
--- a/erts/preloaded/src/zlib.erl
+++ b/erts/preloaded/src/zlib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -349,10 +349,14 @@ getQSize(Z) ->
Compressed :: binary().
compress(Data) ->
Z = open(),
- deflateInit(Z, default),
- Bs = deflate(Z, Data, finish),
- deflateEnd(Z),
- close(Z),
+ Bs = try
+ deflateInit(Z, default),
+ B = deflate(Z, Data, finish),
+ deflateEnd(Z),
+ B
+ after
+ close(Z)
+ end,
iolist_to_binary(Bs).
-spec uncompress(Data) -> Decompressed when
@@ -364,10 +368,14 @@ uncompress(Data) ->
if
Size >= 8 ->
Z = open(),
- inflateInit(Z),
- Bs = inflate(Z, Data),
- inflateEnd(Z),
- close(Z),
+ Bs = try
+ inflateInit(Z),
+ B = inflate(Z, Data),
+ inflateEnd(Z),
+ B
+ after
+ close(Z)
+ end,
iolist_to_binary(Bs);
true ->
erlang:error(data_error)
@@ -383,10 +391,14 @@ uncompress(Data) ->
Compressed :: binary().
zip(Data) ->
Z = open(),
- deflateInit(Z, default, deflated, -?MAX_WBITS, 8, default),
- Bs = deflate(Z, Data, finish),
- deflateEnd(Z),
- close(Z),
+ Bs = try
+ deflateInit(Z, default, deflated, -?MAX_WBITS, 8, default),
+ B = deflate(Z, Data, finish),
+ deflateEnd(Z),
+ B
+ after
+ close(Z)
+ end,
iolist_to_binary(Bs).
-spec unzip(Data) -> Decompressed when
@@ -394,10 +406,14 @@ zip(Data) ->
Decompressed :: binary().
unzip(Data) ->
Z = open(),
- inflateInit(Z, -?MAX_WBITS),
- Bs = inflate(Z, Data),
- inflateEnd(Z),
- close(Z),
+ Bs = try
+ inflateInit(Z, -?MAX_WBITS),
+ B = inflate(Z, Data),
+ inflateEnd(Z),
+ B
+ after
+ close(Z)
+ end,
iolist_to_binary(Bs).
-spec gzip(Data) -> Compressed when
@@ -405,10 +421,14 @@ unzip(Data) ->
Compressed :: binary().
gzip(Data) ->
Z = open(),
- deflateInit(Z, default, deflated, 16+?MAX_WBITS, 8, default),
- Bs = deflate(Z, Data, finish),
- deflateEnd(Z),
- close(Z),
+ Bs = try
+ deflateInit(Z, default, deflated, 16+?MAX_WBITS, 8, default),
+ B = deflate(Z, Data, finish),
+ deflateEnd(Z),
+ B
+ after
+ close(Z)
+ end,
iolist_to_binary(Bs).
-spec gunzip(Data) -> Decompressed when
@@ -416,10 +436,14 @@ gzip(Data) ->
Decompressed :: binary().
gunzip(Data) ->
Z = open(),
- inflateInit(Z, 16+?MAX_WBITS),
- Bs = inflate(Z, Data),
- inflateEnd(Z),
- close(Z),
+ Bs = try
+ inflateInit(Z, 16+?MAX_WBITS),
+ B = inflate(Z, Data),
+ inflateEnd(Z),
+ B
+ after
+ close(Z)
+ end,
iolist_to_binary(Bs).
-spec collect(zstream()) -> iolist().
diff --git a/erts/start_scripts/Makefile b/erts/start_scripts/Makefile
index d8e39062e3..608679b016 100644
--- a/erts/start_scripts/Makefile
+++ b/erts/start_scripts/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -163,14 +163,14 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: script
- $(INSTALL_DIR) $(RELEASE_PATH)/releases/$(SYSTEM_VSN)
+ $(INSTALL_DIR) "$(RELEASE_PATH)/releases/$(SYSTEM_VSN)"
ifneq ($(findstring win32,$(TARGET)),win32)
- $(INSTALL_DATA) RELEASES.src $(RELEASE_PATH)/releases
+ $(INSTALL_DATA) RELEASES.src "$(RELEASE_PATH)/releases"
endif
$(INSTALL_DATA) $(INSTALL_SCRIPTS) $(REL_SCRIPTS) \
- $(RELEASE_PATH)/releases/$(SYSTEM_VSN)
- $(INSTALL_DATA) start_clean.script $(RELEASE_PATH)/releases/$(SYSTEM_VSN)/start.script
- $(INSTALL_DATA) start_clean.boot $(RELEASE_PATH)/releases/$(SYSTEM_VSN)/start.boot
+ "$(RELEASE_PATH)/releases/$(SYSTEM_VSN)"
+ $(INSTALL_DATA) start_clean.script "$(RELEASE_PATH)/releases/$(SYSTEM_VSN)/start.script"
+ $(INSTALL_DATA) start_clean.boot "$(RELEASE_PATH)/releases/$(SYSTEM_VSN)/start.boot"
release_docs_spec:
diff --git a/erts/test/Makefile b/erts/test/Makefile
index 68be3f2178..6b409e2f1b 100644
--- a/erts/test/Makefile
+++ b/erts/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2010. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -28,7 +28,6 @@ EBIN = .
# ----------------------------------------------------
MODULES= \
- autoimport_SUITE \
erlc_SUITE \
install_SUITE \
nt_SUITE \
@@ -39,14 +38,11 @@ MODULES= \
erlexec_SUITE \
z_SUITE
-ERL_XML = $(ERL_TOP)/erts/doc/src/erlang.xml
-ERL_XML_TARGET = autoimport_SUITE_data/erlang.xml
-
ERL_FILES= $(MODULES:%=%.erl)
TARGET_FILES = $(MODULES:%=$(EBIN)/%.$(EMULATOR))
-EXTRA_FILES = install_SUITE_data/install_bin $(ERL_XML_TARGET)
+EXTRA_FILES = install_SUITE_data/install_bin
# ----------------------------------------------------
# Release directory specification
@@ -68,10 +64,6 @@ install_SUITE_data/install_bin: ../../make/install_bin
rm -f $@
cp -p $< $@
-$(ERL_XML_TARGET): $(ERL_XML)
- rm -f $@
- cp -p $< $@
-
clean:
rm -f $(TARGET_FILES) $(EXTRA_FILES)
rm -f core *~
@@ -86,10 +78,10 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec:
release_tests_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) system.spec system.dynspec system.spec.vxworks \
- $(ERL_FILES) $(TARGET_FILES) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- tar cf - *_SUITE_data utils | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) system.spec system.dynspec \
+ $(ERL_FILES) $(TARGET_FILES) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ tar cf - *_SUITE_data utils | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/erts/test/autoimport_SUITE.erl b/erts/test/autoimport_SUITE.erl
deleted file mode 100644
index 71ed5204b1..0000000000
--- a/erts/test/autoimport_SUITE.erl
+++ /dev/null
@@ -1,196 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%%% Purpose: Test erlang.xml re autoimports
--module(autoimport_SUITE).
-
--include_lib("test_server/include/test_server.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,
- autoimports/1]).
--define(TEST_TIMEOUT, ?t:seconds(180)).
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
-
-all() ->
- [autoimports].
-
-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].
-
-end_per_testcase(_Func, Config) ->
- Dog = ?config(watchdog, Config),
- catch test_server:timetrap_cancel(Dog),
- ok.
-
-
-autoimports(suite) ->
- [];
-autoimports(doc) ->
- ["Check that erlang.xml documents autoimports correctly"];
-autoimports(Config) when is_list(Config) ->
- ?line XML = filename:join([?config(data_dir,Config),"erlang.xml"]),
- ?line case xml(XML) of
- [] ->
- ok;
- List ->
- lists:foreach(fun({[],F,A}) ->
- io:format("erlang:~s/~p is wrongly "
- "documented as ~s/~p~n",
- [F,A,F,A]);
- ({"erlang",F,A}) ->
- io:format("~s/~p is wrongly "
- "documented as "
- "erlang:~s/~p~n",
- [F,A,F,A])
- end,List),
- ?t:fail({wrong_autoimports,List})
- end.
-
-%%
-%% Ugly chunk of code to heuristically analyze the erlang.xml
-%% documentation file. Don't view this as an example...
-%%
-
-xml(XMLFile) ->
- {ok,File} = file:open(XMLFile,[read]),
- xskip_to_funcs(file:read_line(File),File),
- DocData = xloop(file:read_line(File),File),
- true = DocData =/= [],
- file:close(File),
- analyze(DocData).
-
-%% Skip lines up to and including the <funcs> tag.
-xskip_to_funcs({ok,Line},File) ->
- case re:run(Line,"\\<funcs\\>",[{capture,none}]) of
- nomatch ->
- xskip_to_funcs(file:read_line(File),File);
- match ->
- ok
- end.
-
-xloop({ok,Line},File) ->
- case re:run(Line,"\\<name\\>",[{capture,none}]) of
- nomatch ->
- xloop(file:read_line(File),File);
- match ->
- X = re:replace(Line,"\\).*",")",[{return,list}]),
- Y = re:replace(X,".*\\>","",[{return,list}]),
- Mod = get_module(Y),
- Rest1 = fstrip(Mod++":",Y),
- Func = get_function(Rest1),
- Rest2 = fstrip(Func++"(", Rest1),
- Argc = count_args(Rest2,1,0,false),
- [{Mod,Func,Argc} |
- xloop(file:read_line(File),File)]
- end;
-xloop(_,_) ->
- [].
-
-analyze([{[],Func,Arity}|T]) ->
- case erl_internal:bif(list_to_atom(Func),Arity) of
- true ->
- analyze(T);
- false ->
- [{[],Func,Arity} |
- analyze(T)]
- end;
-analyze([{"erlang",Func,Arity}|T]) ->
- case erl_internal:bif(list_to_atom(Func),Arity) of
- true ->
- [{"erlang",Func,Arity}|analyze(T)];
- false ->
- analyze(T)
- end;
-analyze([_|T]) ->
- analyze(T);
-analyze([]) ->
- [].
-
-
-count_args([],_,N,false) ->
- N;
-count_args([],_,N,true) ->
- N+1;
-count_args(_,0,N,true) ->
- N+1;
-count_args(_,0,N,false) ->
- N;
-count_args([Par|T],Level,N,Got) when (Par =:= 40) or
- (Par =:= 123) or (Par =:= 91) ->
- count_args(T,Level+1,N,(Level =:= 1) or Got);
-count_args([41|T],1,N,true) ->
- count_args(T,0,N+1,false);
-count_args([Par|T],Level,N, Got) when (Par =:= 41) or
- (Par =:= 125) or (Par =:= 93) ->
- count_args(T,Level-1,N,Got);
-count_args([$,|T],1,N,true) ->
- count_args(T,1,N+1,false);
-count_args([$ |T],A,B,C) ->
- count_args(T,A,B,C);
-count_args([_|T],1,N,_) ->
- count_args(T,1,N,true);
-count_args([_|T],A,B,C) ->
- count_args(T,A,B,C).
-
-fstrip([],X) ->
- X;
-fstrip(_,[]) ->
- [];
-fstrip([H|T1],[H|T2]) ->
- fstrip(T1,T2);
-fstrip(_,L) ->
- L.
-
-get_module(X) ->
- get_module(X,[]).
-get_module([],_) ->
- [];
-get_module([$:|_],Acc) ->
- lists:reverse(Acc);
-get_module([40|_],_) -> %(
- [];
-get_module([H|T],Acc) ->
- get_module(T,[H|Acc]).
-
-get_function(X) ->
- get_function(X,[]).
-get_function([],_) ->
- [];
-get_function([40|_],Acc) -> %(
- lists:reverse(Acc);
-get_function([H|T],Acc) ->
- get_function(T,[H|Acc]).
diff --git a/erts/test/erl_print_SUITE.erl b/erts/test/erl_print_SUITE.erl
index adc353bd51..a49d8f069f 100644
--- a/erts/test/erl_print_SUITE.erl
+++ b/erts/test/erl_print_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -34,7 +34,7 @@
-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, fin_per_testcase/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]).
@@ -247,7 +247,7 @@ init_per_testcase(Case, Config) ->
Dog = ?t:timetrap(?DEFAULT_TIMEOUT),
[{testcase, Case}, {watchdog, Dog} |Config].
-fin_per_testcase(_Case, Config) ->
+end_per_testcase(_Case, Config) ->
Dog = ?config(watchdog, Config),
?t:timetrap_cancel(Dog),
ok.
diff --git a/erts/test/erl_print_SUITE_data/Makefile.src b/erts/test/erl_print_SUITE_data/Makefile.src
index dec5650416..3d58669c18 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-2011. All Rights Reserved.
+# Copyright Ericsson AB 2005-2012. 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
@@ -20,23 +20,35 @@
include @erts_lib_include_internal_generated@@[email protected]
CC = @CC@
-CFLAGS = @ERTS_CFLAGS@
-LIBS = @ERTS_LIBS@
+CFLAGST = @ERTS_CFLAGS@
+LIBST = @ERTS_LIBS@
+CFLAGSF = @CFLAGS@
+LIBSF = @LIBS@
+CP=cp
+CHMOD=chmod
-EPTF_CFLAGS = -Wall $(CFLAGS) @DEFS@ -I@erts_lib_include_internal@ -I@erts_lib_include_internal_generated@
-EPTF_LIBS = $(LIBS) -L@erts_lib_internal_path@ -lerts_internal@type_marker@
+COMMON_CFLAGS = -Wall @DEFS@ -I@erts_lib_include_internal@ -I@erts_lib_include_internal_generated@
-EPTT_CFLAGS = -DTHREAD_SAFE $(ETHR_DEFS) $(EPTF_CFLAGS)
-EPTT_LIBS = -L@erts_lib_internal_path@ -lerts_internal_r@type_marker@ $(ETHR_LIBS) $(LIBS)
+EPTF_CFLAGS = $(CFLAGSF) $(COMMON_CFLAGS)
+EPTF_LIBS = -L@erts_lib_internal_path@ -lerts_internal@type_marker@ $(LIBSF)
+
+EPTT_CFLAGS = -DTHREAD_SAFE $(ETHR_DEFS) $(CFLAGST) $(COMMON_CFLAGS)
+EPTT_LIBS = -L@erts_lib_internal_path@ -lerts_internal_r@type_marker@ $(ETHR_LIBS) $(LIBST)
GCC = .@DS@gccifier -CC"$(CC)"
-PROGS = erl_print_tests.@emu_threads@@exe@
+PROGS = erl_print_tests.true@exe@ erl_print_tests.false@exe@
all: $(PROGS)
+@IFEQ@ (@cross@, yes)
+gccifier@exe@:
+ $(CP) ..@DS@utils@[email protected] gccifier@exe@
+ $(CHMOD) a+x gccifier@exe@
+@ELSE@
gccifier@exe@: ..@DS@utils@[email protected]
- $(CC) $(CFLAGS) -o gccifier@exe@ ..@DS@utils@[email protected] $(LIBS)
+ $(CC) $(CFLAGST) -o gccifier@exe@ ..@DS@utils@[email protected] $(LIBST)
+@ENDIF@
erl_print_tests.false@exe@: gccifier@exe@ erl_print_tests.c
$(GCC) $(EPTF_CFLAGS) -o erl_print_tests.false@exe@ erl_print_tests.c $(EPTF_LIBS)
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 28ce78f4e1..acb213cd3a 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-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2005-2012. 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
@@ -44,8 +44,8 @@
#endif
#ifdef __WIN32__
-#define signed_long_long LONGLONG
-#define unsigned_long_long ULONGLONG
+#define signed_long_long __int64
+#define unsigned_long_long unsigned __int64
#else
#define signed_long_long signed long long
#define unsigned_long_long unsigned long long
diff --git a/erts/test/erlc_SUITE.erl b/erts/test/erlc_SUITE.erl
index 6c0d662126..ab774dbc4f 100644
--- a/erts/test/erlc_SUITE.erl
+++ b/erts/test/erlc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -253,7 +253,7 @@ erlc() ->
false ->
test_server:fail("Can't find erlc");
Erlc ->
- Erlc
+ "\"" ++ Erlc ++ "\""
end.
%% Runs a command.
diff --git a/erts/test/erlexec_SUITE_data/Makefile.src b/erts/test/erlexec_SUITE_data/Makefile.src
index b751547b8f..2a8decaa4b 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-2009. All Rights Reserved.
+# Copyright Ericsson AB 2008-2012. 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
@@ -20,6 +20,8 @@
CC = @CC@
CFLAGS = @ERTS_CFLAGS@
LIBS = @ERTS_LIBS@
+CP=cp
+CHMOD=chmod
ERLX_T_CFLAGS = -Wall $(ERLX_DEFS) $(CFLAGS) @DEFS@
@@ -29,8 +31,14 @@ PROGS = erlexec_tests@exe@
all: $(PROGS)
+@IFEQ@ (@cross@, yes)
+gccifier@exe@:
+ $(CP) ..@DS@utils@[email protected] gccifier@exe@
+ $(CHMOD) a+x gccifier@exe@
+@ELSE@
gccifier@exe@: ..@DS@utils@[email protected]
$(CC) $(CFLAGS) -o gccifier@exe@ ..@DS@utils@[email protected] $(LIBS)
+@ENDIF@
erlexec_tests@exe@: gccifier@exe@ erlexec_tests.c
$(GCC) $(ERLX_T_CFLAGS) -o erlexec_tests@exe@ erlexec_tests.c
diff --git a/erts/test/ethread_SUITE.erl b/erts/test/ethread_SUITE.erl
index 5bb5aed3ed..24075286a8 100644
--- a/erts/test/ethread_SUITE.erl
+++ b/erts/test/ethread_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -33,7 +33,7 @@
-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, fin_per_testcase/2]).
+ init_per_testcase/2, end_per_testcase/2]).
-export([create_join_thread/1,
equal_tids/1,
@@ -246,11 +246,18 @@ dw_atomic_massage(Config) ->
%%
%%
-init_per_testcase(_Case, Config) ->
- Dog = ?t:timetrap(?DEFAULT_TIMEOUT),
- [{watchdog, Dog}|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.
-fin_per_testcase(_Case, Config) ->
+end_per_testcase(_Case, Config) ->
Dog = ?config(watchdog, Config),
?t:timetrap_cancel(Dog),
ok.
diff --git a/erts/test/ethread_SUITE_data/Makefile.src b/erts/test/ethread_SUITE_data/Makefile.src
index 132b23344c..bad133c467 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-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -23,6 +23,8 @@ include @erts_lib_include_internal_generated@@DS@erts_internal.mk
CC = @CC@
CFLAGS = @ERTS_CFLAGS@
LIBS = @ERTS_LIBS@
+CP=cp
+CHMOD=chmod
ETHR_T_CFLAGS = -Wall $(ETHR_DEFS) $(CFLAGS) @DEFS@ -I@erts_lib_include_internal@ -I@erts_lib_include_internal_generated@
ETHR_T_LIBS = $(LIBS) -L@erts_lib_internal_path@ $(ETHR_LIBS) $(ERTS_INTERNAL_X_LIBS)
@@ -33,8 +35,14 @@ PROGS = ethread_tests@exe@
all: $(PROGS)
+@IFEQ@ (@cross@, yes)
+gccifier@exe@:
+ $(CP) ..@DS@utils@[email protected] gccifier@exe@
+ $(CHMOD) a+x gccifier@exe@
+@ELSE@
gccifier@exe@: ..@DS@utils@[email protected]
$(CC) $(CFLAGS) -o gccifier@exe@ ..@DS@utils@[email protected] $(LIBS)
+@ENDIF@
ethread_tests@exe@: gccifier@exe@ ethread_tests.c
$(GCC) $(ETHR_T_CFLAGS) -o ethread_tests@exe@ ethread_tests.c -lerts_internal_r $(ETHR_T_LIBS)
diff --git a/erts/test/install_SUITE.erl b/erts/test/install_SUITE.erl
index 214031a6fe..f1d8dc2587 100644
--- a/erts/test/install_SUITE.erl
+++ b/erts/test/install_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -452,7 +452,7 @@ bin_dirname_fail(Config) when is_list(Config) ->
?line Be = Bs,
?line EBs = "/opt/lib/erlang/otp/bin",
?line EBe = EBs,
- ?line CMDPRFX = "PATH="++?config(data_dir,Config)++":"++os:getenv("PATH"),
+ ?line CMDPRFX = "PATH=\""++?config(data_dir,Config)++":"++os:getenv("PATH")++"\"",
ChkRes = fun (Res, #inst{test_prefix = TP,
destdir = D,
extra_prefix = EP,
@@ -485,7 +485,7 @@ bin_no_use_dirname_fail(Config) when is_list(Config) ->
?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"),
+ ?line CMDPRFX = "PATH=\""++?config(data_dir,Config)++":"++os:getenv("PATH")++"\"",
ChkRes = fun (Res, #inst{test_prefix = TP,
destdir = D,
extra_prefix = EP,
diff --git a/erts/test/otp_SUITE.erl b/erts/test/otp_SUITE.erl
index 79cd91221f..b7ceb0a3fd 100644
--- a/erts/test/otp_SUITE.erl
+++ b/erts/test/otp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2012. 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
@@ -84,12 +84,14 @@ undefined_functions(Config) when is_list(Config) ->
"ExcludedFrom = ~p:_/_,"
"Undef - Undef | ExcludedFrom",
[UndefS,ExcludeFrom]),
- ?line {ok,Undef0} = xref:q(Server, lists:flatten(Q)),
- ?line Undef1 = hipe_filter(Undef0),
- ?line Undef2 = ssl_crypto_filter(Undef1),
- ?line Undef3 = edoc_filter(Undef2),
- ?line Undef = eunit_filter(Undef3),
- ?line Undef = megaco_filter(Undef),
+ {ok,Undef0} = xref:q(Server, lists:flatten(Q)),
+ Undef1 = hipe_filter(Undef0),
+ Undef2 = ssl_crypto_filter(Undef1),
+ Undef3 = edoc_filter(Undef2),
+ Undef4 = eunit_filter(Undef3),
+ Undef5 = dialyzer_filter(Undef4),
+ Undef6 = wx_filter(Undef5),
+ Undef = gs_filter(Undef6),
case Undef of
[] -> ok;
@@ -97,9 +99,11 @@ undefined_functions(Config) when is_list(Config) ->
Fd = open_log(Config, "undefined_functions"),
foreach(fun ({MFA1,MFA2}) ->
io:format("~s calls undefined ~s",
- [format_mfa(MFA1),format_mfa(MFA2)]),
+ [format_mfa(Server, MFA1),
+ format_mfa(MFA2)]),
io:format(Fd, "~s ~s\n",
- [format_mfa(MFA1),format_mfa(MFA2)])
+ [format_mfa(Server, MFA1),
+ format_mfa(MFA2)])
end, Undef),
close_log(Fd),
?line ?t:fail({length(Undef),undefined_functions_in_otp})
@@ -151,6 +155,9 @@ ssl_crypto_filter(Undef) ->
{{error,bad_name},{error,bad_name}} ->
filter(fun({_,{ssl,_,_}}) -> false;
({_,{crypto,_,_}}) -> false;
+ ({_,{ssh,_,_}}) -> false;
+ ({_,{ssh_connection,_,_}}) -> false;
+ ({_,{ssh_sftp,_,_}}) -> false;
(_) -> true
end, Undef);
{_,_} -> Undef
@@ -168,34 +175,44 @@ eunit_filter(Undef) ->
(_) -> true
end, Undef).
-megaco_filter(Undef) ->
- %% Intentional calls to undefined functions.
- filter(fun({{megaco_compact_text_encoder,encode_action_reply,3},
- {megaco_compact_text_encoder_v3,encode_action_reply,2}}) -> false;
- ({{megaco_compact_text_encoder,encode_action_request,3},
- {megaco_compact_text_encoder_v3,encode_action_request,2}}) -> false;
- ({{megaco_compact_text_encoder,encode_action_requests,3},
- {megaco_compact_text_encoder_v3,encode_action_requests,2}}) -> false;
- ({{megaco_compact_text_encoder,encode_command_request,3},
- {megaco_compact_text_encoder_v3,encode_command_request,2}}) -> false;
- ({{megaco_compact_text_encoder,encode_message,3},
- {megaco_compact_text_encoder_v3,encode_message,2}}) -> false;
- ({{megaco_compact_text_encoder,encode_transaction,3},
- {megaco_compact_text_encoder_v3,encode_transaction,2}}) -> false;
- ({{megaco_pretty_text_encoder,encode_action_reply,3},
- {megaco_pretty_text_encoder_v3,encode_action_reply,2}}) -> false;
- ({{megaco_pretty_text_encoder,encode_action_request,3},
- {megaco_pretty_text_encoder_v3,encode_action_request,2}}) -> false;
- ({{megaco_pretty_text_encoder,encode_action_requests,3},
- {megaco_pretty_text_encoder_v3,encode_action_requests,2}}) -> false;
- ({{megaco_pretty_text_encoder,encode_command_request,3},
- {megaco_pretty_text_encoder_v3,encode_command_request,2}}) -> false;
- ({{megaco_pretty_text_encoder,encode_message,3},
- {megaco_pretty_text_encoder_v3,encode_message,2}}) -> false;
- ({{megaco_pretty_text_encoder,encode_transaction,3},
- {megaco_pretty_text_encoder_v3,encode_transaction,2}}) -> false;
- (_) -> true
- end, Undef).
+dialyzer_filter(Undef) ->
+ case code:lib_dir(dialyzer) of
+ {error,bad_name} ->
+ 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 code:lib_dir(wx) of
+ {error,bad_name} ->
+ 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;
+ ({_,{tool_utils,_,_}}) -> false;
+ (_) -> true
+ end, Undef);
+ _ -> Undef
+ end.
deprecated_not_in_obsolete(Config) when is_list(Config) ->
?line Server = ?config(xref_server, Config),
@@ -212,9 +229,9 @@ deprecated_not_in_obsolete(Config) when is_list(Config) ->
_ ->
io:put_chars("The following functions have -deprecated() attributes,\n"
"but are not listed in otp_internal:obsolete/3.\n"),
- ?line print_mfas(group_leader(), L),
+ print_mfas(group_leader(), Server, L),
Fd = open_log(Config, "deprecated_not_obsolete"),
- print_mfas(Fd, L),
+ print_mfas(Fd, Server, L),
close_log(Fd),
?line ?t:fail({length(L),deprecated_but_not_obsolete})
end.
@@ -236,9 +253,9 @@ obsolete_but_not_deprecated(Config) when is_list(Config) ->
io:put_chars("The following functions are listed "
"in otp_internal:obsolete/3,\n"
"but don't have -deprecated() attributes.\n"),
- ?line print_mfas(group_leader(), L),
+ print_mfas(group_leader(), Server, L),
Fd = open_log(Config, "obsolete_not_deprecated"),
- print_mfas(Fd, L),
+ print_mfas(Fd, Server, L),
close_log(Fd),
?line ?t:fail({length(L),obsolete_but_not_deprecated})
end.
@@ -307,15 +324,22 @@ strong_components(Config) when is_list(Config) ->
%%% Common help functions.
%%%
-
-print_mfas(Fd, [MFA|T]) ->
- io:format(Fd, "~s\n", [format_mfa(MFA)]),
- print_mfas(Fd, T);
-print_mfas(_, []) -> ok.
+print_mfas(Fd, Server, MFAs) ->
+ [io:format(Fd, "~s\n", [format_mfa(Server, MFA)]) || MFA <- MFAs],
+ ok.
format_mfa({M,F,A}) ->
lists:flatten(io_lib:format("~s:~s/~p", [M,F,A])).
+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,
+ AppPrefix ++ MFAString.
+
open_log(Config, Name) ->
PrivDir = ?config(priv_dir, Config),
RunDir = filename:dirname(filename:dirname(PrivDir)),
diff --git a/erts/test/run_erl_SUITE.erl b/erts/test/run_erl_SUITE.erl
index 6350dc47dd..de05e6f206 100644
--- a/erts/test/run_erl_SUITE.erl
+++ b/erts/test/run_erl_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -250,7 +250,7 @@ defunct_2(Config, Perl) ->
?line ok = file:make_dir(LogDir),
?line Pipe = LogDir ++ "/",
?line RunErl = os:find_executable(run_erl),
- ?line Cmd = Perl ++ " " ++ RunErlTest ++ " " ++ RunErl ++ " " ++
+ ?line Cmd = Perl ++ " " ++ RunErlTest ++ " \"" ++ RunErl ++ "\" " ++
Defuncter ++ " " ++ Pipe ++ " " ++ LogDir,
?line io:format("~p", [Cmd]),
?line Res = os:cmd(Cmd),
diff --git a/erts/test/system.spec.vxworks b/erts/test/system.spec.vxworks
deleted file mode 100644
index 378adf56ac..0000000000
--- a/erts/test/system.spec.vxworks
+++ /dev/null
@@ -1,2 +0,0 @@
-{topcase, {dir, "../system_test"}}.
-{skip,{erlc_SUITE, "Not on VxWorks, erlc is a HOST tool."}}
diff --git a/erts/test/utils/gccifier.c b/erts/test/utils/gccifier.c
index 64de764260..7e4ffc7281 100644
--- a/erts/test/utils/gccifier.c
+++ b/erts/test/utils/gccifier.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2004-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2012. 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
@@ -73,17 +73,23 @@ save_arg(args_t *args, char *arg1, ...)
args->vec = (char **) (args->no
? realloc((void *) args->vec,
(sizeof(char *)
- *(args->no + ARGS_INCR + 1)))
+ *(args->no + ARGS_INCR + 2)))
: malloc((sizeof(char *)
- *(args->no + ARGS_INCR + 1))));
+ *(args->no + ARGS_INCR + 2))));
if (!args->vec)
enomem();
args->no += ARGS_INCR;
}
+ if (carg == arg1) {
+ args->vec[args->ix++] = "\"";
+ args->chars++;
+ }
args->vec[args->ix++] = carg;
args->chars += strlen(carg);
carg = va_arg(argp, char *);
}
+ args->vec[args->ix++] = "\"";
+ args->chars++;
args->vec[args->ix++] = " ";
args->chars++;
va_end(argp);
@@ -231,6 +237,9 @@ main(int argc, char *argv[])
CHECK_FIRST_LINK_ARG;
save_arg(&link_args, "-libpath:", arg, NULL);
}
+ else if (strcmp("-link",arg) == 0) {
+ CHECK_FIRST_LINK_ARG;
+ }
#endif /* #ifdef __WIN32__ */
else if (is_prefix("-l", &arg)) {
CHECK_FIRST_LINK_ARG;
diff --git a/erts/test/utils/gccifier.sh b/erts/test/utils/gccifier.sh
new file mode 100755
index 0000000000..978aecf424
--- /dev/null
+++ b/erts/test/utils/gccifier.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 2005-2012. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+#
+
+CC=`echo "$1" | sed -e "s/-CC//"`
+shift
+echo "->"
+echo "$CC $*"
+$CC $*
+echo ""
diff --git a/erts/test/z_SUITE.erl b/erts/test/z_SUITE.erl
index 28da923497..78968ed405 100644
--- a/erts/test/z_SUITE.erl
+++ b/erts/test/z_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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/vsn.mk b/erts/vsn.mk
index bbf77b1a68..a420781e9f 100644
--- a/erts/vsn.mk
+++ b/erts/vsn.mk
@@ -17,8 +17,8 @@
# %CopyrightEnd%
#
-VSN = 5.9.1
-SYSTEM_VSN = R15B01
+VSN = 5.10
+SYSTEM_VSN = R16B
# Port number 4365 in 4.2
# Port number 4366 in 4.3
diff --git a/lib/.gitignore b/lib/.gitignore
index 56b1ed2b84..4125111ebd 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -7,6 +7,7 @@
/common_test/doc/src/ct_rpc.xml
/common_test/doc/src/ct_snmp.xml
/common_test/doc/src/ct_ssh.xml
+/common_test/doc/src/ct_netconfc.xml
/common_test/doc/src/ct_telnet.xml
/common_test/doc/src/unix_telnet.xml
diff --git a/lib/Makefile b/lib/Makefile
index 402e73722a..64b17a3cca 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -19,53 +19,21 @@
include $(ERL_TOP)/make/target.mk
include $(ERL_TOP)/make/$(TARGET)/otp.mk
-#
-# Macros
-#
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
- ERTS_SUB_DIRECTORIES = stdlib sasl kernel compiler
- OTHER_SUB_DIRECTORIES = \
- snmp otp_mibs appmon erl_interface os_mon tools runtime_tools
- ifdef BUILD_ALL
- OTHER_SUB_DIRECTORIES += mnesia jinterface ic asn1 debugger \
- inets mnesia_session diameter orber pman tv observer \
- cosTransactions cosEvent cosTime cosNotification cosProperty
- cosFileTransfer cosEventDomain
- endif
-else
-#
-# unix and win32
-# --------------
-#
- ERTS_SUB_DIRECTORIES = stdlib sasl kernel compiler
- OTHER_SUB_DIRECTORIES = tools test_server common_test runtime_tools
- ifdef BUILD_ALL
- ifeq ($(findstring win32,$(TARGET)),win32) # BUILD_ALL on win32
- OTHER_SUB_DIRECTORIES += \
- snmp otp_mibs appmon erl_interface asn1 jinterface gs wx inets ic \
- mnesia crypto orber os_mon parsetools syntax_tools pman \
- public_key ssl toolbar tv observer debugger reltool odbc \
- diameter \
- cosTransactions cosEvent cosTime cosNotification cosProperty \
- cosFileTransfer cosEventDomain et megaco webtool \
- xmerl edoc eunit ssh inviso typer erl_docgen \
- common_test percept dialyzer
-# dialyzer
- OTHER_SUB_DIRECTORIES += hipe
- else # BUILD_ALL on unix
- OTHER_SUB_DIRECTORIES += \
- snmp otp_mibs appmon erl_interface asn1 jinterface wx debugger reltool gs inets \
+ERTS_SUB_DIRECTORIES = stdlib sasl kernel compiler
+OTHER_SUB_DIRECTORIES = tools test_server common_test runtime_tools
+ifdef BUILD_ALL
+ OTHER_SUB_DIRECTORIES += \
+ snmp otp_mibs appmon erl_interface asn1 jinterface \
+ wx debugger reltool gs inets \
ic mnesia crypto orber os_mon parsetools syntax_tools \
pman public_key ssl toolbar tv observer odbc \
diameter \
cosTransactions cosEvent cosTime cosNotification \
cosProperty cosFileTransfer cosEventDomain et megaco webtool \
- xmerl edoc eunit ssh inviso typer erl_docgen \
- common_test percept dialyzer
-# dialyzer
- OTHER_SUB_DIRECTORIES += hipe $(TSP_APP)
- endif
- endif
+ xmerl edoc eunit ssh typer erl_docgen \
+ percept eldap dialyzer hipe
+ EXTRA_FILE := $(wildcard EXTRA-APPLICATIONS)
+ EXTRA_APPLICATIONS := $(if $(EXTRA_FILE),$(shell cat $(EXTRA_FILE)))
endif
ifdef BOOTSTRAP
@@ -78,7 +46,9 @@ else
ifdef TERTIARY_BOOTSTRAP
SUB_DIRECTORIES = snmp sasl jinterface ic syntax_tools wx
else # Not bootstrap build
- SUB_DIRECTORIES = $(ERTS_SUB_DIRECTORIES) $(OTHER_SUB_DIRECTORIES)
+ SUB_DIRECTORIES = $(ERTS_SUB_DIRECTORIES) \
+ $(OTHER_SUB_DIRECTORIES) \
+ $(EXTRA_APPLICATIONS)
endif
endif
endif
diff --git a/lib/appmon/doc/src/Makefile b/lib/appmon/doc/src/Makefile
index 743f123c06..7c93abe6d8 100644
--- a/lib/appmon/doc/src/Makefile
+++ b/lib/appmon/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2010. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -107,14 +107,14 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/appmon/doc/src/appmon.xml b/lib/appmon/doc/src/appmon.xml
index ae6147a387..6e04f8503f 100644
--- a/lib/appmon/doc/src/appmon.xml
+++ b/lib/appmon/doc/src/appmon.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -32,6 +32,12 @@
<module>appmon</module>
<modulesummary>A graphical node and application process tree viewer.</modulesummary>
<description>
+ <warning>
+ <p>
+ The Appmon application has been superseded by the Observer application.
+ Appmon will be removed in R16.
+ </p>
+ </warning>
<p>The application monitor Appmon is a graphical utility used to
supervise applications executing either locally or on remote nodes.
The process tree of an application can furthermore be monitored.</p>
diff --git a/lib/appmon/doc/src/appmon_chapter.xml b/lib/appmon/doc/src/appmon_chapter.xml
index 0dab23b549..7ce22caaad 100644
--- a/lib/appmon/doc/src/appmon_chapter.xml
+++ b/lib/appmon/doc/src/appmon_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2010</year>
+ <year>2000</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -31,6 +31,12 @@
<section>
<title>Introduction</title>
+ <warning>
+ <p>
+ The Appmon application has been superseded by the Observer application.
+ Appmon will be removed in R16.
+ </p>
+ </warning>
<p>The application monitor Appmon is a graphical node and application viewer. The tool shows an overview of all applications on all known nodes, and it is possible to view the process tree for an application running on any of the nodes.</p>
<note>
<p>If the Appmon code is not available at a node, for example an
diff --git a/lib/appmon/doc/src/notes.xml b/lib/appmon/doc/src/notes.xml
index c469880abd..04b2b0d8ba 100644
--- a/lib/appmon/doc/src/notes.xml
+++ b/lib/appmon/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2010</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,6 +30,26 @@
</header>
<p>This document describes the changes made to the Appmon application.</p>
+<section><title>Appmon 2.1.14.1</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>The GS applications is now deprecated and will be
+ removed in the R16 release. The following GS-based
+ applications have been superseded by the Observer
+ application and will removed in R16: Appmon, Pman,
+ Tv.</p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>
+ Own Id: OTP-9907</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Appmon 2.1.14</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/appmon/priv/Makefile b/lib/appmon/priv/Makefile
index 9af4fbd228..356fe9b842 100644
--- a/lib/appmon/priv/Makefile
+++ b/lib/appmon/priv/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -57,8 +57,8 @@ clean:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DATA) $(HELP_FILES) $(TOOLBAR_FILES) $(RELSYSDIR)/priv
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) $(HELP_FILES) $(TOOLBAR_FILES) "$(RELSYSDIR)/priv"
release_docs_spec:
diff --git a/lib/appmon/src/Makefile b/lib/appmon/src/Makefile
index 43f4f085b8..06e61b7cc8 100644
--- a/lib/appmon/src/Makefile
+++ b/lib/appmon/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -92,10 +92,10 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/appmon/src/appmon.erl b/lib/appmon/src/appmon.erl
index 2b982cddf0..ba98a24400 100644
--- a/lib/appmon/src/appmon.erl
+++ b/lib/appmon/src/appmon.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -17,6 +17,11 @@
%% %CopyrightEnd%
-module(appmon).
-behaviour(gen_server).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,1}}]).
%%%---------------------------------------------------------------------
%%% Appmon main module.
diff --git a/lib/appmon/src/appmon_a.erl b/lib/appmon/src/appmon_a.erl
index b0b5847343..6838a7a275 100644
--- a/lib/appmon/src/appmon_a.erl
+++ b/lib/appmon/src/appmon_a.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -17,6 +17,11 @@
%% %CopyrightEnd%
%%
-module(appmon_a).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,1}}]).
%%----------------------------------------------------------------------
%%
diff --git a/lib/appmon/src/appmon_lb.erl b/lib/appmon/src/appmon_lb.erl
index 4e433f37c5..3ab6ce58e6 100644
--- a/lib/appmon/src/appmon_lb.erl
+++ b/lib/appmon/src/appmon_lb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -29,6 +29,13 @@
%%% then pressing the load button, its application window is started.
-module(appmon_lb).
+-compile([{nowarn_deprecated_function,{gs,button,3}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,listbox,3}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
-export ([
start/1,
diff --git a/lib/appmon/src/appmon_txt.erl b/lib/appmon/src/appmon_txt.erl
index 4e1785c53f..056265af90 100644
--- a/lib/appmon/src/appmon_txt.erl
+++ b/lib/appmon/src/appmon_txt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -22,6 +22,11 @@
%%------------------------------------------------------------
-module(appmon_txt).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,1}}]).
-export([start/0, start/1, print/1, fprint/1]).
%% gen_server stuff
diff --git a/lib/appmon/vsn.mk b/lib/appmon/vsn.mk
index 047f1eadc1..0654468b42 100644
--- a/lib/appmon/vsn.mk
+++ b/lib/appmon/vsn.mk
@@ -1 +1 @@
-APPMON_VSN = 2.1.14
+APPMON_VSN = 2.1.14.1
diff --git a/lib/asn1/c_src/Makefile b/lib/asn1/c_src/Makefile
index 8c06be56f8..dc926947af 100644
--- a/lib/asn1/c_src/Makefile
+++ b/lib/asn1/c_src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2012. 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
@@ -66,13 +66,8 @@ NIF_SHARED_OBJ_FILE = $(LIBDIR)/asn1_erl_nif.dll
CLIB_FLAGS =
LN=cp
else
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
-NIF_SHARED_OBJ_FILE = $(LIBDIR)/asn1_erl_nif.eld
-CLIB_FLAGS =
-else
NIF_SHARED_OBJ_FILE = $(LIBDIR)/asn1_erl_nif.so
CLIB_FLAGS = -lc
-endif
LN= ln -s
endif
@@ -110,10 +105,10 @@ $(NIF_SHARED_OBJ_FILE): $(NIF_OBJ_FILES)
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/lib
- $(INSTALL_PROGRAM) $(NIF_SHARED_OBJ_FILE) $(RELSYSDIR)/priv/lib
- $(INSTALL_DIR) $(RELSYSDIR)/c_src
- $(INSTALL_DATA) *.c $(RELSYSDIR)/c_src
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/lib"
+ $(INSTALL_PROGRAM) $(NIF_SHARED_OBJ_FILE) "$(RELSYSDIR)/priv/lib"
+ $(INSTALL_DIR) "$(RELSYSDIR)/c_src"
+ $(INSTALL_DATA) *.c "$(RELSYSDIR)/c_src"
release_docs_spec:
diff --git a/lib/asn1/c_src/asn1_erl_nif.c b/lib/asn1/c_src/asn1_erl_nif.c
index accd368af1..dbff14f9b3 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2002-2012. 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
@@ -1197,7 +1197,7 @@ static ERL_NIF_TERM encode_per_complete(ErlNifEnv* env, int argc,
ErlNifBinary out_binary;
int complete_len;
if (!enif_inspect_iolist_as_binary(env, argv[0], &in_binary))
- return enif_make_atom(env, "badarg");
+ return enif_make_badarg(env);
if (!enif_alloc_binary(in_binary.size, &out_binary))
return enif_make_atom(env, "alloc_binary_failed");
diff --git a/lib/asn1/doc/src/Makefile b/lib/asn1/doc/src/Makefile
index 20bd00a3b8..3b3e1bd8f9 100644
--- a/lib/asn1/doc/src/Makefile
+++ b/lib/asn1/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -119,13 +119,13 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/asn1/doc/src/asn1ct.xml b/lib/asn1/doc/src/asn1ct.xml
index 0b9ec3df7f..3be58cbc8e 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>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -44,15 +44,15 @@
</description>
<funcs>
<func>
- <name>compile(Asn1module) -> ok | {error,Reason}</name>
- <name>compile(Asn1module , Options) -> ok | {error,Reason}</name>
+ <name>compile(Asn1module) -> ok | {error, Reason}</name>
+ <name>compile(Asn1module, Options) -> ok | {error, Reason}</name>
<fsummary>Compile an ASN.1 module and generate encode/decode functions according to the encoding rules BER or PER.</fsummary>
<type>
<v>Asn1module = atom() | string()</v>
<v>Options = [Option| OldOption]</v>
- <v>Option = ber_bin | per_bin | uper_bin | der | compact_bit_string |
- noobj | {n2n,EnumTypeName} |{outdir,Dir} | {i,IncludeDir} | optimize |
- nif | asn1config | undec_rest | {inline,OutputName} | inline |
+ <v>Option = ber_bin | per_bin | uper_bin | der | compact_bit_string |
+ noobj | {n2n, EnumTypeName} |{outdir, Dir} | {i, IncludeDir} | optimize |
+ nif | asn1config | undec_rest | {inline, OutputName} | inline |
{macro_name_prefix, Prefix} | {record_name_prefix, Prefix} | verbose | warnings_as_errors</v>
<v>OldOption = ber | per</v>
<v>Reason = term()</v>
@@ -158,7 +158,7 @@ File3.asn </pre>
of the BIT STRING type in Erlang. The notation:
</p>
<pre>
-BitString = {Unused,Binary},
+BitString = {Unused, Binary},
Unused = integer(),
Binary = binary()
</pre>
@@ -172,7 +172,7 @@ Binary = binary()
</seealso>.
</p>
</item>
- <tag><c>{n2n,EnumTypeName}</c></tag>
+ <tag><c>{n2n, EnumTypeName}</c></tag>
<item>
<p>
Tells the compiler to generate functions for conversion between
@@ -190,17 +190,17 @@ Binary = binary()
<c>.erl</c> file. If this option is omitted the generated Erlang module
will be compiled.</p>
</item>
- <tag><c>{i,IncludeDir}</c></tag>
+ <tag><c>{i, IncludeDir}</c></tag>
<item>
<p>Adds <c>IncludeDir</c> to the search-path for
<c>.asn1db</c> and asn1 source files. The compiler tries
to open a <c>.asn1db</c> file when a module imports
definitions from another ASN.1 module. If no
<c>.asn1db</c> file is found the asn1 source file is
- parsed. Several <c>{i,IncludeDir}</c> can be given.
+ parsed. Several <c>{i, IncludeDir}</c> can be given.
</p>
</item>
- <tag><c>{outdir,Dir}</c></tag>
+ <tag><c>{outdir, Dir}</c></tag>
<item>
<p>Specifies the directory <c>Dir</c> where all generated files
shall be placed. If omitted the files are placed in the
@@ -251,11 +251,11 @@ Binary = binary()
also have some following bytes. Now it is possible to get
those following bytes returned together with the decoded
value. If an asn1 spec is compiled with this option a tuple
- <c>{ok,Value,Rest}</c> is returned. <c>Rest</c> may be a
+ <c>{ok, Value, Rest}</c> is returned. <c>Rest</c> may be a
list or a binary. Earlier versions of the compiler ignored
those following bytes.</p>
</item>
- <tag><c>{inline,OutputName}</c></tag>
+ <tag><c>{inline, OutputName}</c></tag>
<item>
<p>Compiling with this option gives one output module
containing all asn1 run-time functionality. The asn1 specs
@@ -267,7 +267,7 @@ Binary = binary()
by the <c>igor</c> module of <c>syntax_tools</c>. By default
the functions generated from the first asn1 spec in the
<c>.set.asn</c> are exported, unless a
- <c>{export,[atom()]}</c> or <c>{export_all,true}</c> option
+ <c>{export, [atom()]}</c> or <c>{export_all, true}</c> option
are provided. The list of atoms are names of chosen asn1
specs from the <c>.set.asn</c> file. </p>
<p>When used together with <c>nif</c> for <c>ber_bin</c>, the
@@ -278,7 +278,7 @@ Binary = binary()
<tag><c>inline</c></tag>
<item>
<p>It is also possible to use the sole argument <c>inline</c>.
- It is as <c>{inline,OutputName}</c>, but the output file gets the
+ It is as <c>{inline, OutputName}</c>, but the output file gets the
default name of the source <c>.set.asn</c> file.</p>
</item>
<tag><c>{macro_name_prefix, Prefix}</c></tag>
@@ -322,7 +322,7 @@ Binary = binary()
</desc>
</func>
<func>
- <name>encode(Module,Type,Value)-> {ok,Bytes} | {error,Reason}</name>
+ <name>encode(Module, Type, Value)-> {ok, Bytes} | {error, Reason}</name>
<fsummary>Encode an ASN.1 value.</fsummary>
<type>
<v>Module = Type = atom()</v>
@@ -337,13 +337,13 @@ Binary = binary()
encode function only performs rudimentary tests that the input
<c>Value</c>
is a correct instance of <c>Type</c>. The length of strings is for example
- not always checked. Returns <c>{ok,Bytes}</c> if successful or
- <c>{error,Reason}</c> if an error occurred.
+ not always checked. Returns <c>{ok, Bytes}</c> if successful or
+ <c>{error, Reason}</c> if an error occurred.
</p>
</desc>
</func>
<func>
- <name>decode(Module,Type,Bytes) -> {ok,Value}|{error,Reason}</name>
+ <name>decode(Module, Type, Bytes) -> {ok, Value} | {error, Reason}</name>
<fsummary>Decode from Bytes into an ASN.1 value.</fsummary>
<type>
<v>Module = Type = atom()</v>
@@ -352,11 +352,11 @@ Binary = binary()
</type>
<desc>
<p>Decodes <c>Type</c> from <c>Module</c> from the list of bytes
- <c>Bytes</c>. Returns <c>{ok,Value}</c> if successful.</p>
+ <c>Bytes</c>. Returns <c>{ok, Value}</c> if successful.</p>
</desc>
</func>
<func>
- <name>value(Module ,Type) -> {ok,Value} | {error,Reason}</name>
+ <name>value(Module, Type) -> {ok, Value} | {error, Reason}</name>
<fsummary>Create an ASN.1 value for test purposes.</fsummary>
<type>
<v>Module = Type = atom()</v>
@@ -371,26 +371,48 @@ Binary = binary()
</desc>
</func>
<func>
- <name>test(Module) -> ok | {error,Reason}</name>
- <name>test(Module,Type) -> ok | {error,Reason}</name>
- <name>test(Module,Type,Value) -> ok | {error,Reason}</name>
- <fsummary>Perform a test of encode and decode for types in an ASN.1 module.</fsummary>
+ <name>test(Module) -> ok | {error, Reason}</name>
+ <name>test(Module, Type | Options) -> ok | {error, Reason}</name>
+ <name>test(Module, Type, Value | Options) -> ok | {error, Reason}</name>
+ <fsummary>Perform a test of encode and decode for types in an ASN.1 module.</fsummary>
+ <type>
+ <v>Module = Type = atom()</v>
+ <v>Value = term()</v>
+ <v>Options = [{i, IncludeDir}]</v>
+ <v>Reason = term()</v>
+ </type>
<desc>
- <p>Performs a test of encode and decode of all types in <c>Module</c>.
+ <p>Performs a test of encode and decode of types in <c>Module</c>.
The generated functions are called by this function.
This function is useful during test to secure that the generated
- encode and decode functions and the general runtime support work
- as expected. <br></br>
-<c>test/1</c> iterates over all types in <c>Module</c>. <br></br>
-<c>test/2</c> tests type <c>Type</c> with a random value. <br></br>
-<c><![CDATA[test/3 tests type <c>Type]]></c> with <c>Value</c>. <br></br>
+ encode and decode functions and the general runtime support work
+ as expected.</p>
+
+ <list type="bulleted">
+ <item>
+ <p><c>test/1</c> iterates over all types in <c>Module</c>.</p>
+ </item>
+ <item>
+ <p><c>test/2</c> tests type <c>Type</c> with a random value.</p>
+ </item>
+ <item>
+ <p><c>test/3</c> tests type <c>Type</c> with <c>Value</c>.</p>
+ </item>
+ </list>
- Schematically the following happens for each type in the module.</p>
- <p></p>
+ <p>Schematically the following happens for each type in the module:
<code type="none">
-{ok,Value} = asn1ct:value(Module,Type),
-{ok,Bytes} = asn1ct:encode(Module,Type,Value),
-{ok,Value} = asn1ct:decode(Module,Type,Bytes). </code>
+{ok, Value} = asn1ct:value(Module, Type),
+{ok, Bytes} = asn1ct:encode(Module, Type, Value),
+{ok, Value} = asn1ct:decode(Module, Type, Bytes).</code></p>
+
+ <p>The <c>test</c> functions utilizes the <c>*.asn1db</c> files
+ for all included modules. If they are located in a different
+ directory than the current working directory, use the include
+ option to add paths. This is only needed when automatically
+ generating values. For static values using <c>Value</c> no
+ options are needed.</p>
+
</desc>
</func>
</funcs>
diff --git a/lib/asn1/doc/src/notes.xml b/lib/asn1/doc/src/notes.xml
index 9b6c482c0a..5ca86130a1 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -31,6 +31,101 @@
<p>This document describes the changes made to the asn1 application.</p>
+<section><title>Asn1 1.8</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Encoding and decoding of integer ranges can now be done
+ with an upper bound larger than the previous limit of
+ 16^10. The new upper bound in per encoding and decodings
+ for constrained whole numbers is 2^2040 (close to 16^508)</p>
+ <p>
+ Own Id: OTP-10128</p>
+ </item>
+ <item>
+ <p>
+ Per encoding/decoding now works correctly for single
+ value subtyping of an integer type where a subtype is a
+ predefined value. Previously a predefined value could
+ cause a non-valid range-check in the generated Erlang
+ code for per encoding/decoding due to a bug in the
+ constraint checking.</p>
+ <p>
+ Own Id: OTP-10139</p>
+ </item>
+ <item>
+ <p>
+ Fix typo error in selected decode function (Thanks to
+ Artem Teslenko)</p>
+ <p>
+ Own Id: OTP-10152</p>
+ </item>
+ <item>
+ <p>
+ Better error indication when detecting unexpected tags
+ during decoding of BER encoded data.</p>
+ <p>
+ Own Id: OTP-10186</p>
+ </item>
+ <item>
+ <p>
+ asn1rt_check: Fix transform_to_EXTERNAL1990 for binary
+ input (Thanks to Harald Welte)</p>
+ <p>
+ Own Id: OTP-10233</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Add support for multiple ExtensionAdditionGroups</p>
+ <p>
+ Own Id: OTP-10058</p>
+ </item>
+ <item>
+ <p>
+ Add support for extensible enumeration types in n2n
+ generated functions.</p>
+ <p>
+ Own Id: OTP-10144</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Asn1 1.7</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Some ASN.1 INTEGER type and SEQUENCE constructor variants
+ previously not handled by the ASN.1 compiler are now
+ correctly handled</p>
+ <p>
+ Own Id: OTP-9688</p>
+ </item>
+ <item>
+ <p>
+ An INTEGER with a value constraint where unions are used
+ e.g. X1 ::= INTEGER (1..4 | 6 | 8 | 10 | 20) is not
+ handled correctly. For PER the value is encoded in wrong
+ number of bits.</p>
+ <p>
+ Own Id: OTP-9946</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Asn1 1.6.19</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/asn1/src/Makefile b/lib/asn1/src/Makefile
index 3a59773d93..4bd49aa93b 100644
--- a/lib/asn1/src/Makefile
+++ b/lib/asn1/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -58,7 +58,8 @@ CT_MODULES= \
asn1ct_gen_ber_bin_v2 \
asn1ct_value \
asn1ct_tok \
- asn1ct_parser2
+ asn1ct_parser2 \
+ asn1ct_table
RT_MODULES= \
asn1rt \
@@ -152,16 +153,16 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
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_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(APP_SRC) $(APPUP_SRC) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/examples
- $(INSTALL_DATA) $(EXAMPLES) $(RELSYSDIR)/examples
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(APP_SRC) $(APPUP_SRC) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples"
+ $(INSTALL_DATA) $(EXAMPLES) "$(RELSYSDIR)/examples"
# there are no include files to be used by the user
-#$(INSTALL_DIR) $(RELSYSDIR)/include
-#$(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
+#$(INSTALL_DIR) "$(RELSYSDIR)/include"
+#$(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/asn1/src/asn1_db.erl b/lib/asn1/src/asn1_db.erl
index f680b3d064..843fc66c9c 100644
--- a/lib/asn1/src/asn1_db.erl
+++ b/lib/asn1/src/asn1_db.erl
@@ -1,167 +1,154 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
%%
-module(asn1_db).
-%-compile(export_all).
--export([dbnew/1,dbsave/2,dbload/1,dbput/3,dbget/2,dbget_all/1]).
--export([dbget_all_mod/1,dbstop/0,dbclear/0,dberase_module/1,dbstart/1,stop_server/1]).
-%% internal exports
--export([dbloop0/1,dbloop/2]).
-%% Db stuff
-dbstart(Includes) ->
- start_server(asn1db, asn1_db, dbloop0, [Includes]).
+-export([dbstart/1,dbnew/1,dbsave/2,dbload/1,dbput/3,dbget/2,dbget_all/1]).
+-export([dbget_all_mod/1,dbclear/0,dberase_module/1,dbstop/0]).
-dbloop0(Includes) ->
- dbloop(Includes, ets:new(asn1, [set,named_table])).
-
-opentab(Tab,Mod,[]) ->
- opentab(Tab,Mod,["."]);
-opentab(Tab,Mod,Includes) ->
- Base = lists:concat([Mod,".asn1db"]),
- opentab2(Tab,Base,Mod,Includes,ok).
+-record(state, {parent, monitor, includes, table}).
-opentab2(_Tab,_Base,_Mod,[],Error) ->
- Error;
-opentab2(Tab,Base,Mod,[Ih|It],_Error) ->
- File = filename:join(Ih,Base),
- case ets:file2tab(File) of
- {ok,Modtab} ->
- ets:insert(Tab,{Mod, Modtab}),
- {ok,Modtab};
- NewErr ->
- opentab2(Tab,Base,Mod,It,NewErr)
+%% Interface
+dbstart(Includes) ->
+ Parent = self(),
+ case get(?MODULE) of
+ undefined ->
+ put(?MODULE, spawn_link(fun() -> init(Parent, Includes) end)),
+ true;
+ _Pid ->
+ req({new_includes, Includes})
end.
-
-dbloop(Includes, Tab) ->
- receive
- {From,{set, Mod, K2, V}} ->
- [{_,Modtab}] = ets:lookup(Tab,Mod),
- ets:insert(Modtab,{K2, V}),
- From ! {asn1db, ok},
- dbloop(Includes, Tab);
- {From, {get, Mod, K2}} ->
- Result = case ets:lookup(Tab,Mod) of
- [] ->
- opentab(Tab,Mod,Includes);
- [{_,Modtab}] -> {ok,Modtab}
- end,
- case Result of
- {ok,Newtab} ->
- From ! {asn1db, lookup(Newtab, K2)};
- _Error ->
- From ! {asn1db, undefined}
- end,
- dbloop(Includes, Tab);
- {From, {all_mod, Mod}} ->
- [{_,Modtab}] = ets:lookup(Tab,Mod),
- From ! {asn1db, ets:tab2list(Modtab)},
- dbloop(Includes, Tab);
- {From, {delete_mod, Mod}} ->
- [{_,Modtab}] = ets:lookup(Tab,Mod),
- ets:delete(Modtab),
- ets:delete(Tab,Mod),
- From ! {asn1db, ok},
- dbloop(Includes, Tab);
- {From, {save, OutFile,Mod}} ->
- [{_,Mtab}] = ets:lookup(Tab,Mod),
- From ! {asn1db, ets:tab2file(Mtab,OutFile)},
- dbloop(Includes,Tab);
- {From, {load, Mod}} ->
- Result = case ets:lookup(Tab,Mod) of
- [] ->
- opentab(Tab,Mod,Includes);
- [{_,Modtab}] -> {ok,Modtab}
- end,
- From ! {asn1db,Result},
- dbloop(Includes,Tab);
- {From, {new, Mod}} ->
- case ets:lookup(Tab,Mod) of
- [{_,Modtab}] ->
- ets:delete(Modtab);
- _ ->
- true
- end,
- Tabname = list_to_atom(lists:concat(["asn1_",Mod])),
- ets:new(Tabname, [set,named_table]),
- ets:insert(Tab,{Mod,Tabname}),
- From ! {asn1db, ok},
- dbloop(Includes,Tab);
- {From, stop} ->
- From ! {asn1db, ok}; %% nothing to store
- {From, clear} ->
- ModTabList = [Mt||{_,Mt} <- ets:tab2list(Tab)],
- lists:foreach(fun(T) -> ets:delete(T) end,ModTabList),
- ets:delete(Tab),
- From ! {asn1db, cleared},
- dbloop(Includes, ets:new(asn1, [set]));
- {From,{new_includes,[NewIncludes]}} ->
- From ! {asn1db,done},
- dbloop(NewIncludes,Tab)
+dbnew(Module) -> req({new, Module}).
+dbsave(OutFile, Module) -> req({save, OutFile, Module}).
+dbload(Module) -> req({load, Module}).
+dbput(Module, K, V) -> req({set, Module, K, V}).
+dbget(Module, K) -> req({get, Module, K}).
+dbget_all(K) -> req({get_all, K}).
+dbget_all_mod(Mod) -> req({all_mod, Mod}).
+dbclear() -> req(clear).
+dberase_module({module,M}) -> req({delete_mod, M}).
+dbstop() -> Resp = req(stop), erase(?MODULE), Resp.
+
+%% Internal functions
+req(Request) ->
+ DbPid = get(?MODULE),
+ Ref = erlang:monitor(process,DbPid),
+ get(?MODULE) ! {{Ref, self()}, Request},
+ receive
+ {{Ref,?MODULE}, Reply} ->
+ erlang:demonitor(Ref,[flush]),
+ Reply;
+ {'DOWN',Ref,_,_,Info} ->
+ exit({db_error,Info})
end.
+reply({Ref,From}, Response) ->
+ From ! {{Ref,?MODULE}, Response}.
-%%all(Tab, K) ->
-%% pickup(K, ets:match(Tab, {{K, '$1'}, '$2'})).
-%%pickup(K, []) -> [];
-%%pickup(K, [[V1,V2] |T]) ->
-%% [{{K,V1},V2} | pickup(K, T)].
+init(Parent, Includes) ->
+ MRef = erlang:monitor(process, Parent),
+ loop(#state{parent = Parent, monitor = MRef, includes = Includes,
+ table = ets:new(?MODULE, [])}).
-lookup(Tab, K) ->
- case ets:lookup(Tab, K) of
- [] -> undefined;
- [{K,V}] -> V
+loop(#state{parent = Parent, monitor = MRef, table = Table,
+ includes = Includes} = State) ->
+ receive
+ {From, {set, Mod, K2, V}} ->
+ [{_, Modtab}] = ets:lookup(Table, Mod),
+ ets:insert(Modtab, {K2, V}),
+ reply(From, ok),
+ loop(State);
+ {From, {get, Mod, K2}} ->
+ Result = case ets:lookup(Table, Mod) of
+ [] -> opentab(Table, Mod, Includes);
+ [{_, Modtab}] -> {ok, Modtab}
+ end,
+ case Result of
+ {ok, Newtab} -> reply(From, lookup(Newtab, K2));
+ _Error -> reply(From, undefined)
+ end,
+ loop(State);
+ {From, {all_mod, Mod}} ->
+ [{_, Modtab}] = ets:lookup(Table, Mod),
+ reply(From, ets:tab2list(Modtab)),
+ loop(State);
+ {From, {delete_mod, Mod}} ->
+ [{_, Modtab}] = ets:lookup(Table, Mod),
+ ets:delete(Modtab),
+ ets:delete(Table, Mod),
+ reply(From, ok),
+ loop(State);
+ {From, {save, OutFile, Mod}} ->
+ [{_,Mtab}] = ets:lookup(Table, Mod),
+ reply(From, ets:tab2file(Mtab, OutFile)),
+ loop(State);
+ {From, {load, Mod}} ->
+ Result = case ets:lookup(Table, Mod) of
+ [] -> opentab(Table, Mod, Includes);
+ [{_, Modtab}] -> {ok, Modtab}
+ end,
+ reply(From, Result),
+ loop(State);
+ {From, {new, Mod}} ->
+ case ets:lookup(Table, Mod) of
+ [{_, Modtab}] -> ets:delete(Modtab);
+ _ -> true
+ end,
+ ModTableId = ets:new(list_to_atom(lists:concat(["asn1_",Mod])), []),
+ ets:insert(Table, {Mod, ModTableId}),
+ reply(From, ok),
+ loop(State);
+ {From, clear} ->
+ [ets:delete(Mt) || {_, Mt} <- ets:tab2list(Table)],
+ ets:delete(Table),
+ reply(From, cleared),
+ loop(State#state{table = ets:new(asn1, [set])});
+ {From, {new_includes, NewIncludes}} ->
+ reply(From, true),
+ loop(State#state{includes = NewIncludes});
+ {From, stop} ->
+ reply(From, stopped); %% Nothing to store
+ {'DOWN', MRef, process, Parent, Reason} ->
+ exit(Reason)
end.
+opentab(Tab, Mod, []) ->
+ opentab(Tab, Mod, ["."]);
+opentab(Tab, Mod, Includes) ->
+ Base = lists:concat([Mod, ".asn1db"]),
+ opentab2(Tab, Base, Mod, Includes, ok).
-dbnew(Module) -> req({new,Module}).
-dbsave(OutFile,Module) -> req({save,OutFile,Module}).
-dbload(Module) -> req({load,Module}).
-
-dbput(Module,K,V) -> req({set, Module, K, V}).
-dbget(Module,K) -> req({get, Module, K}).
-dbget_all(K) -> req({get_all, K}).
-dbget_all_mod(Mod) -> req({all_mod,Mod}).
-dbstop() -> stop_server(asn1db).
-dbclear() -> req(clear).
-dberase_module({module,M})->
- req({delete_mod, M}).
-
-req(R) ->
- asn1db ! {self(), R},
- receive {asn1db, Reply} -> Reply end.
-
-stop_server(Name) ->
- stop_server(Name, whereis(Name)).
-stop_server(_, undefined) -> stopped;
-stop_server(Name, _Pid) ->
- Name ! {self(), stop},
- receive {Name, _} -> stopped end.
-
-
-start_server(Name,Mod,Fun,Args) ->
- case whereis(Name) of
- undefined ->
- register(Name, spawn(Mod,Fun, Args));
- _Pid ->
- req({new_includes,Args})
+opentab2(_Tab, _Base, _Mod, [], Error) ->
+ Error;
+opentab2(Tab, Base, Mod, [Ih|It], _Error) ->
+ File = filename:join(Ih, Base),
+ case ets:file2tab(File) of
+ {ok, Modtab} ->
+ ets:insert(Tab, {Mod, Modtab}),
+ {ok, Modtab};
+ NewErr ->
+ opentab2(Tab, Base, Mod, It, NewErr)
end.
-
+lookup(Tab, K) ->
+ case ets:lookup(Tab, K) of
+ [] -> undefined;
+ [{K,V}] -> V
+ end.
diff --git a/lib/asn1/src/asn1ct.erl b/lib/asn1/src/asn1ct.erl
index 85bb5b2f28..8e971a1c76 100644
--- a/lib/asn1/src/asn1ct.erl
+++ b/lib/asn1/src/asn1ct.erl
@@ -1,7 +1,8 @@
+%% vim: tabstop=8:shiftwidth=4
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -24,13 +25,13 @@
%%-compile(export_all).
%% Public exports
-export([compile/1, compile/2]).
--export([start/0, start/1, stop/0]).
+-export([start/0, start/1]).
-export([encode/2, encode/3, decode/3]).
--export([test/1, test/2, test/3, value/2]).
+-export([test/1, test/2, test/3, value/2, value/3]).
%% Application internal exports
-export([compile_asn/3,compile_asn1/3,compile_py/3,compile/3,
- value/1,vsn/0,
- create_ets_table/2,get_name_of_def/1,get_pos_of_def/1]).
+ vsn/0,
+ get_name_of_def/1,get_pos_of_def/1]).
-export([read_config_data/1,get_gen_state_field/1,get_gen_state/0,
partial_inc_dec_toptype/1,save_gen_state/1,update_gen_state/2,
get_tobe_refed_func/1,reset_gen_state/0,is_function_generated/1,
@@ -93,25 +94,24 @@ compile(File,Options) when is_list(Options) ->
end,
Options1 = optimize_ber_bin(Options),
Options2 = includes(File,Options1),
- Includes=[I||{i,I}<-Options2],
- case (catch input_file_type(File,Includes)) of
- {single_file,SuffixedFile} -> %% "e.g. "/tmp/File.asn"
- (catch compile1(SuffixedFile,Options2));
- {multiple_files_file,SetBase,FileName} ->
- FileList = get_file_list(FileName,Includes),
-%% io:format("FileList: ~p~n",[FileList]),
- case FileList of
- L when is_list(L) ->
- (catch compile_set(SetBase,FileList,Options2));
- Err ->
- Err
- end;
- Err = {input_file_error,_Reason} ->
- {error,Err};
- Err2 -> Err2
+ Includes = strip_includes(Options2),
+ in_process(fun() -> compile_proc(File, Includes, Options2) end).
+
+compile_proc(File, Includes, Options) ->
+ case input_file_type(File, Includes) of
+ {single_file, SuffixedFile} -> %% "e.g. "/tmp/File.asn"
+ compile1(SuffixedFile, Options);
+ {multiple_files_file, SetBase, FileName} ->
+ case get_file_list(FileName, Includes) of
+ FileList when is_list(FileList) ->
+ compile_set(SetBase, FileList, Options);
+ Err ->
+ Err
+ end;
+ Err = {input_file_error, _Reason} ->
+ {error, Err}
end.
-
compile1(File,Options) when is_list(Options) ->
verbose("Erlang ASN.1 version ~p compiling ~p ~n",[?vsn,File],Options),
verbose("Compiler Options: ~p~n",[Options],Options),
@@ -121,13 +121,13 @@ compile1(File,Options) when is_list(Options) ->
DbFile = outfile(Base,"asn1db",Options),
Includes = [I || {i,I} <- Options],
EncodingRule = get_rule(Options),
- create_ets_table(asn1_functab,[named_table]),
+ asn1ct_table:new(asn1_functab),
Continue1 = scan(File,Options),
Continue2 = parse(Continue1,File,Options),
Continue3 = check(Continue2,File,OutFile,Includes,EncodingRule,
DbFile,Options,[]),
Continue4 = generate(Continue3,OutFile,EncodingRule,Options),
- delete_tables([asn1_functab]),
+ asn1ct_table:delete(asn1_functab),
Ret = compile_erl(Continue4,OutFile,Options),
case inline(is_inline(Options),
inline_output(Options,filename:rootname(File)),
@@ -189,7 +189,7 @@ compile_set(SetBase,Files,Options)
DbFile = outfile(SetBase,"asn1db",Options),
Includes = [I || {i,I} <- Options],
EncodingRule = get_rule(Options),
- create_ets_table(asn1_functab,[named_table]),
+ asn1ct_table:new(asn1_functab),
ScanRes = scan_set(Files,Options),
ParseRes = parse_set(ScanRes,Options),
Result =
@@ -214,7 +214,7 @@ compile_set(SetBase,Files,Options)
{error,{'unexpected error in scan/parse phase',
lists:map(fun(X)->element(3,X) end,Other)}}
end,
- delete_tables([asn1_functab]),
+ asn1ct_table:delete(asn1_functab),
Result.
check_set(ParseRes,SetBase,OutFile,Includes,EncRule,DbFile,
@@ -226,7 +226,7 @@ check_set(ParseRes,SetBase,OutFile,Includes,EncRule,DbFile,
Options,InputModules),
Continue2 = generate(Continue1,OutFile,EncRule,Options),
- delete_tables([renamed_defs,original_imports,automatic_tags]),
+ asn1ct_table:delete([renamed_defs, original_imports, automatic_tags]),
Ret = compile_erl(Continue2,OutFile,Options),
case inline(is_inline(Options),
@@ -247,12 +247,11 @@ check_set(ParseRes,SetBase,OutFile,Includes,EncRule,DbFile,
merge_modules(ParseRes,CommonName) ->
ModuleList = lists:map(fun(X)->element(2,X) end,ParseRes),
NewModuleList = remove_name_collisions(ModuleList),
- case ets:info(renamed_defs,size) of
- 0 -> ets:delete(renamed_defs);
- _ -> ok
+ case asn1ct_table:size(renamed_defs) of
+ 0 -> asn1ct_table:delete(renamed_defs);
+ _ -> ok
end,
save_imports(NewModuleList),
-% io:format("~p~n~p~n~p~n~n",[ets:lookup(original_imports,'M1'),ets:lookup(original_imports,'M2'),ets:tab2list(original_imports)]),
TypeOrVal = lists:append(lists:map(fun(X)->X#module.typeorval end,
NewModuleList)),
InputMNameList = lists:map(fun(X)->X#module.name end,
@@ -272,7 +271,7 @@ merge_modules(ParseRes,CommonName) ->
%% causes an exit if duplicate definition names exist in a module
remove_name_collisions(Modules) ->
- create_ets_table(renamed_defs,[named_table]),
+ asn1ct_table:new(renamed_defs),
%% Name duplicates in the same module is not allowed.
lists:foreach(fun exit_if_nameduplicate/1,Modules),
%% Then remove duplicates in different modules and return the
@@ -304,7 +303,8 @@ remove_name_collisions2(ModName,[T|Ts],Ms,Acc) ->
%% rename T
NewT = set_name_of_def(ModName,Name,T), %rename def
warn_renamed_def(ModName,get_name_of_def(NewT),Name),
- ets:insert(renamed_defs,{get_name_of_def(NewT),Name,ModName}),
+ asn1ct_table:insert(renamed_defs,
+ {get_name_of_def(NewT), Name, ModName}),
remove_name_collisions2(ModName,Ts,NewMs,[NewT|Acc]);
{NewMs,?dupl_equaldefs} -> % name duplicates, but identical defs
%% keep name of T
@@ -328,8 +328,8 @@ discover_dupl_in_mods(Name,Def,[M=#module{name=N,typeorval=TorV}|Ms],
%% rename def
NewT=set_name_of_def(N,Name,T),
warn_renamed_def(N,get_name_of_def(NewT),Name),
- ets:insert(renamed_defs,{get_name_of_def(NewT),
- Name,N}),
+ asn1ct_table:insert(renamed_defs,
+ {get_name_of_def(NewT), Name, N}),
{NewT,?dupl_uniquedefs bor RenamedOrDupl};
{Name,equal} ->
%% delete def
@@ -484,8 +484,9 @@ save_imports(ModuleList)->
[] ->
ok;
ImportsList2 ->
- create_ets_table(original_imports,[named_table]),
- lists:foreach(fun(X) -> ets:insert(original_imports,X) end,ImportsList2)
+ asn1ct_table:new(original_imports),
+ lists:foreach(fun(X) -> asn1ct_table:insert(original_imports, X) end,
+ ImportsList2)
end.
@@ -561,7 +562,7 @@ check_tagdefault(ModList) ->
case have_same_tagdefault(ModList) of
{true,TagDefault} -> TagDefault;
{false,TagDefault} ->
- create_ets_table(automatic_tags,[named_table]),
+ asn1ct_table:new(automatic_tags),
save_automatic_tagged_types(ModList),
TagDefault
end.
@@ -588,7 +589,7 @@ save_automatic_tagged_types([#module{tagdefault='AUTOMATIC',
typeorval=TorV}|Ms]) ->
Fun =
fun(T) ->
- ets:insert(automatic_tags,{get_name_of_def(T)})
+ asn1ct_table:insert(automatic_tags, {get_name_of_def(T)})
end,
lists:foreach(Fun,TorV),
save_automatic_tagged_types(Ms);
@@ -815,7 +816,9 @@ check({true,M},File,OutFile,Includes,EncodingRule,DbFile,Options,InputMods) ->
asn1_db:dbsave(DbFile,M#module.name),
verbose("--~p--~n",[{generated,DbFile}],Options),
{true,{M,NewM,GenTypeOrVal}}
- end
+ end;
+ ErrorList = {error,_} ->
+ {false,ErrorList}
end;
check({false,M},_,_,_,_,_,_,_) ->
{false,M}.
@@ -827,22 +830,14 @@ generate({true,{M,_Module,GenTOrV}},OutFile,EncodingRule,Options) ->
_ -> ok
end,
put(encoding_options,Options),
- create_ets_table(check_functions,[named_table]),
+ asn1ct_table:new(check_functions),
%% create decoding function names and taglists for partial decode
- %% For the time being leave errors unnoticed !!!!!!!!!
-% io:format("Options: ~p~n",[Options]),
- case catch specialized_decode_prepare(EncodingRule,M,GenTOrV,Options) of
- {error, enoent} -> ok;
- {error, Reason} -> warning("Error in configuration "
- "file: ~n~p~n",[Reason],Options,
- "Error in configuration file");
- {'EXIT',Reason} -> warning("Internal error when "
- "analyzing configuration "
- "file: ~n~p~n",[Reason],Options,
- "Internal error when "
- "analyzing configuration");
- _ -> ok
+ case (catch specialized_decode_prepare(EncodingRule,M,GenTOrV,Options)) of
+ {error, Reason} -> warning("Error in configuration file: ~n~p~n",
+ [Reason], Options,
+ "Error in configuration file");
+ _ -> ok
end,
Result =
@@ -859,7 +854,7 @@ generate({true,{M,_Module,GenTOrV}},OutFile,EncodingRule,Options) ->
erase(encoding_options),
erase(tlv_format), % used in ber_bin, optimize
erase(class_default_type),% used in ber_bin, optimize
- ets:delete(check_functions),
+ asn1ct_table:delete(check_functions),
case Result of
{error,_} ->
{false,Result};
@@ -1181,17 +1176,28 @@ optimize_ber_bin(Options) ->
end.
includes(File,Options) ->
- Dir = filename:dirname(File),
- Options2 =
- case lists:member({i,"."},Options) of
- false -> Options ++ [{i,"."}];
- _ -> Options
- end,
- case lists:member({i,Dir}, Options2) of
- false -> Options2 ++ [{i,Dir}];
- _ -> Options2
+ Options2 = include_append(".", Options),
+ Options3 = include_append(filename:dirname(File), Options2),
+ case proplists:get_value(outdir, Options) of
+ undefined -> Options3;
+ OutDir -> include_prepend(OutDir, Options3)
end.
+include_append(Dir, Options) ->
+ option_add({i, Dir}, Options, fun(Opts) -> Opts ++ [{i, Dir}] end).
+
+include_prepend(Dir, Options) ->
+ option_add({i, Dir}, Options, fun(Opts) -> [{i, Dir}|Opts] end).
+
+option_add(Option, Options, Fun) ->
+ case lists:member(Option, Options) of
+ true -> Options;
+ false -> Fun(Options)
+ end.
+
+strip_includes(Includes) ->
+ [I || {i, I} <- Includes].
+
is_inline(Options) ->
case lists:member(inline,Options) of
true -> true;
@@ -1221,10 +1227,7 @@ compile_py(File,OutFile,Options) ->
compile(lists:concat([File,".py"]),OutFile,Options).
compile(File, _OutFile, Options) ->
- case catch compile(File, make_erl_options(Options)) of
- Exit = {'EXIT',_Reason} ->
- error("~p~n~s~n",[Exit,"error"],Options),
- error;
+ case compile(File, make_erl_options(Options)) of
{error,_Reason} ->
%% case occurs due to error in asn1ct_parser2,asn1ct_check
%% io:format("~p~n",[_Reason]),
@@ -1237,10 +1240,7 @@ compile(File, _OutFile, Options) ->
ok;
ScanRes when is_list(ScanRes) ->
io:format("~p~n",[ScanRes]),
- ok;
- Unknown ->
- error("~p~n~s~n",[Unknown,"error"],Options),
- error
+ ok
end.
%% Converts generic compiler options to specific options.
@@ -1339,17 +1339,6 @@ start() ->
start(Includes) when is_list(Includes) ->
asn1_db:dbstart(Includes).
-stop() ->
- save(),
- asn1_db:stop_server(ns),
- asn1_db:stop_server(rand),
- stopped.
-
-save() ->
- asn1_db:dbstop().
-
-%%clear() ->
-%% asn1_db:dbclear().
encode(Module,Term) ->
asn1rt:encode(Module,Term).
@@ -1365,94 +1354,116 @@ decode(Module,Type,Bytes) ->
asn1rt:decode(Module,Type,Bytes).
-test(Module) ->
- start(),
- M = asn1_db:dbget(Module,'MODULE'),
- {Types,_Values,_Ptypes,_Classes,_Objects,_ObjectSets} = M#module.typeorval,
- test_each(Module,Types).
-
-test_each(Module,[Type | Rest]) ->
- case test(Module,Type) of
- {ok,_Result} ->
- test_each(Module,Rest);
- Error ->
- Error
+test(Module) -> test_module(Module, []).
+
+test(Module, [] = Options) -> test_module(Module, Options);
+test(Module, [{i, _}|_] = Options) -> test_module(Module, Options);
+test(Module, Type) -> test_type(Module, Type, []).
+
+test(Module, Type, [] = Options) -> test_type(Module, Type, Options);
+test(Module, Type, [{i, _}|_] = Options) -> test_type(Module, Type, Options);
+test(Module, Type, Value) -> test_value(Module, Type, Value).
+
+test_module(Module, Includes) ->
+ in_process(fun() ->
+ start(strip_includes(Includes)),
+ case check(Module, Includes) of
+ {ok, NewTypes} -> test_each(Module, NewTypes);
+ Error -> Error
+ end
+ end).
+
+test_each(Module, [Type|Rest]) ->
+ case test_type(Module, Type) of
+ {ok, _Result} -> test_each(Module, Rest);
+ Error -> Error
end;
test_each(_,[]) ->
ok.
-test(Module,Type) ->
- io:format("~p:~p~n",[Module,Type]),
- case (catch value(Module,Type)) of
- {ok,Val} ->
- %% io:format("asn1ct:test/2: ~w~n",[Val]),
- test(Module,Type,Val);
- {'EXIT',Reason} ->
- {error,{asn1,{value,Reason}}}
+test_type(Module, Type, Includes) ->
+ in_process(fun() ->
+ start(strip_includes(Includes)),
+ case check(Module, Includes) of
+ {ok, _NewTypes} -> test_type(Module, Type);
+ Error -> Error
+ end
+ end).
+
+test_type(Module, Type) ->
+ case get_value(Module, Type) of
+ {ok, Val} -> test_value(Module, Type, Val);
+ {error, Reason} -> {error, {asn1, {value, Reason}}}
end.
+test_value(Module, Type, Value) ->
+ in_process(fun() ->
+ case catch encode(Module, Type, Value) of
+ {ok, Bytes} ->
+ M = to_atom(Module),
+ NewBytes = prepare_bytes(M:encoding_rule(), Bytes),
+ case decode(Module, Type, NewBytes) of
+ {ok, Value} ->
+ {ok, {Module, Type, Value}};
+ {ok, Res} ->
+ {error, {asn1,
+ {encode_decode_mismatch,
+ {{Module, Type, Value}, Res}}}};
+ Error ->
+ {error, {asn1,
+ {{decode,
+ {Module, Type, Value}, Error}}}}
+ end;
+ Error ->
+ {error, {asn1,
+ {encode, {{Module, Type, Value}, Error}}}}
+ end
+ end).
+
+value(Module, Type) -> value(Module, Type, []).
+
+value(Module, Type, Includes) ->
+ in_process(fun() ->
+ start(strip_includes(Includes)),
+ case check(Module, Includes) of
+ {ok, _NewTypes} -> get_value(Module, Type);
+ Error -> Error
+ end
+ end).
+
+get_value(Module, Type) ->
+ case asn1ct_value:from_type(Module, Type) of
+ {error, Reason} -> {error, Reason};
+ Result -> {ok, Result}
+ end.
-test(Module,Type,Value) ->
- case catch encode(Module,Type,Value) of
- {ok,Bytes} ->
- %% io:format("test 1: ~p~n",[{Bytes}]),
- M = if
- is_list(Module) ->
- list_to_atom(Module);
- true ->
- Module
- end,
- NewBytes =
- case M:encoding_rule() of
- ber ->
- lists:flatten(Bytes);
- ber_bin when is_binary(Bytes) ->
- Bytes;
- ber_bin ->
- list_to_binary(Bytes);
- ber_bin_v2 when is_binary(Bytes) ->
- Bytes;
- ber_bin_v2 ->
- list_to_binary(Bytes);
- per ->
- lists:flatten(Bytes);
- per_bin when is_binary(Bytes) ->
- Bytes;
- per_bin ->
- list_to_binary(Bytes);
- uper_bin ->
- Bytes
- end,
- case decode(Module,Type,NewBytes) of
- {ok,Value} ->
- {ok,{Module,Type,Value}};
- {ok,Res} ->
- {error,{asn1,{encode_decode_mismatch,
- {{Module,Type,Value},Res}}}};
- Error ->
- {error,{asn1,{{decode,
- {Module,Type,Value},Error}}}}
- end;
- Error ->
- {error,{asn1,{encode,{{Module,Type,Value},Error}}}}
+check(Module, Includes) ->
+ case asn1_db:dbget(Module,'MODULE') of
+ undefined ->
+ {error, {file_not_found, lists:concat([Module, ".asn1db"])}};
+ M ->
+ TypeOrVal = M#module.typeorval,
+ State = #state{mname = M#module.name,
+ module = M#module{typeorval=[]},
+ options = Includes},
+ case asn1ct_check:check(State, TypeOrVal) of
+ {ok, {NewTypes, _, _, _, _, _}, _} -> {ok, NewTypes};
+ {error, Reason} -> {error, Reason}
+ end
end.
-value(Module) ->
- start(),
- M = asn1_db:dbget(Module,'MODULE'),
- {Types,_Values,_Ptypes,_Classes,_Objects,_ObjectSets} = M#module.typeorval,
- lists:map(fun(A) ->value(Module,A) end,Types).
+to_atom(Term) when is_list(Term) -> list_to_atom(Term);
+to_atom(Term) when is_atom(Term) -> Term.
-value(Module,Type) ->
- start(),
- case catch asn1ct_value:get_type(Module,Type,no) of
- {error,Reason} ->
- {error,Reason};
- {'EXIT',Reason} ->
- {error,Reason};
- Result ->
- {ok,Result}
- end.
+prepare_bytes(ber, Bytes) -> lists:flatten(Bytes);
+prepare_bytes(ber_bin, Bytes) when is_binary(Bytes) -> Bytes;
+prepare_bytes(ber_bin, Bytes) -> list_to_binary(Bytes);
+prepare_bytes(ber_bin_v2, Bytes) when is_binary(Bytes) -> Bytes;
+prepare_bytes(ber_bin_v2, Bytes) -> list_to_binary(Bytes);
+prepare_bytes(per, Bytes) -> lists:flatten(Bytes);
+prepare_bytes(per_bin, Bytes) when is_binary(Bytes) -> Bytes;
+prepare_bytes(per_bin, Bytes) -> list_to_binary(Bytes);
+prepare_bytes(uper_bin, Bytes) -> Bytes.
vsn() ->
?vsn.
@@ -1484,38 +1495,6 @@ print_listing([],_) ->
ok.
-%% functions to administer ets tables
-
-%% Always creates a new table
-create_ets_table(Name,Options) when is_atom(Name) ->
- case ets:info(Name) of
- undefined ->
- ets:new(Name,Options);
- _ ->
- ets:delete(Name),
- ets:new(Name,Options)
- end.
-
-%% Creates a new ets table only if no table exists
-create_if_no_table(Name,Options) ->
- case ets:info(Name) of
- undefined ->
- %% create a new table
- create_ets_table(Name,Options);
- _ -> ok
- end.
-
-
-delete_tables([Table|Ts]) ->
- case ets:info(Table) of
- undefined -> ok;
- _ -> ets:delete(Table)
- end,
- delete_tables(Ts);
-delete_tables([]) ->
- ok.
-
-
specialized_decode_prepare(Erule,M,TsAndVs,Options) ->
case lists:member(asn1config,Options) of
true ->
@@ -1534,26 +1513,26 @@ partial_decode_prepare(ber_bin_v2,M,TsAndVs,Options) when is_tuple(TsAndVs) ->
_ -> M#module.name
end,
%% io:format("ModName: ~p~nM#module.name: ~p~n~n",[ModName,M#module.name]),
- CfgList = read_config_file(ModName),
- SelectedDecode = get_config_info(CfgList,selective_decode),
- ExclusiveDecode = get_config_info(CfgList,exclusive_decode),
- CommandList =
- create_partial_decode_gen_info(M#module.name,SelectedDecode),
- %% To convert CommandList to a proper list for the driver change
- %% the list:[[choosen,Tag1],skip,[skip_optional,Tag2]] to L =
- %% [5,2,Tag1,0,1,Tag2] where 5 is the length, and call
- %% port_control(asn1_driver_port,3,[L| Bin])
- save_config(partial_decode,CommandList),
- save_gen_state(selective_decode,SelectedDecode),
-% io:format("selective_decode: CommandList:~n~p~nSelectedDecode:~n~p~n",
-% [CommandList,SelectedDecode]),
- CommandList2 =
- create_partial_inc_decode_gen_info(M#module.name,ExclusiveDecode),
-% io:format("partial_incomplete_decode = ~p~n",[CommandList2]),
- Part_inc_tlv_tags = tlv_tags(CommandList2),
-% io:format("partial_incomplete_decode: tlv_tags = ~p~n",[Part_inc_tlv_tags]),
- save_config(partial_incomplete_decode,Part_inc_tlv_tags),
- save_gen_state(exclusive_decode,ExclusiveDecode,Part_inc_tlv_tags);
+ case read_config_file(ModName) of
+ no_config_file ->
+ ok;
+ CfgList ->
+ SelectedDecode = get_config_info(CfgList,selective_decode),
+ ExclusiveDecode = get_config_info(CfgList,exclusive_decode),
+ CommandList = create_partial_decode_gen_info(M#module.name,
+ SelectedDecode),
+ %% To convert CommandList to a proper list for the driver change
+ %% the list:[[choosen,Tag1],skip,[skip_optional,Tag2]] to L =
+ %% [5,2,Tag1,0,1,Tag2] where 5 is the length, and call
+ %% port_control(asn1_driver_port,3,[L| Bin])
+ save_config(partial_decode,CommandList),
+ save_gen_state(selective_decode,SelectedDecode),
+ CommandList2 = create_partial_inc_decode_gen_info(M#module.name,
+ ExclusiveDecode),
+ Part_inc_tlv_tags = tlv_tags(CommandList2),
+ save_config(partial_incomplete_decode,Part_inc_tlv_tags),
+ save_gen_state(exclusive_decode,ExclusiveDecode,Part_inc_tlv_tags)
+ end;
partial_decode_prepare(_,_,_,_) ->
ok.
@@ -2032,7 +2011,7 @@ read_config_file(ModuleName) ->
read_config_file1(ModuleName,[]) ->
case filename:extension(ModuleName) of
".asn1config" ->
- throw({error,enoent});
+ no_config_file;
_ ->
read_config_file(lists:concat([ModuleName,".asn1config"]))
end;
@@ -2061,14 +2040,14 @@ get_config_info(CfgList,InfoType) ->
%% Before saving anything check if a table exists
%% The record gen_state is saved with the key {asn1_config,gen_state}
save_config(Key,Info) ->
- create_if_no_table(asn1_general,[named_table]),
- ets:insert(asn1_general,{{asn1_config,Key},Info}).
+ asn1ct_table:new_reuse(asn1_general),
+ asn1ct_table:insert(asn1_general, {{asn1_config, Key}, Info}).
read_config_data(Key) ->
- case ets:info(asn1_general) of
- undefined -> undefined;
- _ ->
- case ets:lookup(asn1_general,{asn1_config,Key}) of
+ case asn1ct_table:exists(asn1_general) of
+ false -> undefined;
+ true ->
+ case asn1ct_table:lookup(asn1_general,{asn1_config,Key}) of
[{_,Data}] -> Data;
Err -> % Err is [] when nothing was saved in the ets table
%% io:format("strange data from config file ~w~n",[Err]),
@@ -2595,3 +2574,21 @@ is_werr(S) when is_record(S, state) ->
is_werr(S#state.options);
is_werr(O) ->
lists:member(warnings_as_errors, O).
+
+
+in_process(Fun) ->
+ Parent = self(),
+ Pid = spawn_link(fun() -> process(Parent, Fun) end),
+ receive
+ {Pid, Result} -> Result;
+ {Pid, Class, Reason, Stack} ->
+ ST = try throw(x) catch throw:x -> erlang:get_stacktrace() end,
+ erlang:raise(Class, Reason, Stack ++ ST)
+ end.
+
+process(Parent, Fun) ->
+ try
+ Parent ! {self(), Fun()}
+ catch Class:Reason ->
+ Parent ! {self(), Class, Reason, erlang:get_stacktrace()}
+ end.
diff --git a/lib/asn1/src/asn1ct_check.erl b/lib/asn1/src/asn1ct_check.erl
index e318477234..59e82b7a57 100644
--- a/lib/asn1/src/asn1ct_check.erl
+++ b/lib/asn1/src/asn1ct_check.erl
@@ -1,7 +1,8 @@
+%% vim: tabstop=8:shiftwidth=4
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -94,8 +95,8 @@ check(S,{Types,Values,ParameterizedTypes,Classes,Objects,ObjectSets}) ->
_Perror = checkp(S,ParameterizedTypes,[]), % must do this before the templates are used
%% table to save instances of parameterized objects,object sets
- asn1ct:create_ets_table(parameterized_objects,[named_table]),
- asn1ct:create_ets_table(inlined_objects,[named_table]),
+ asn1ct_table:new(parameterized_objects),
+ asn1ct_table:new(inlined_objects),
Terror = checkt(S,Types,[]),
@@ -144,17 +145,17 @@ check(S,{Types,Values,ParameterizedTypes,Classes,Objects,ObjectSets}) ->
NewObjectSets,
[],[],[]),
?dbg("checko finished with errors:~n~p~n~n",[Oerror]),
- InlinedObjTuples = ets:tab2list(inlined_objects),
+ InlinedObjTuples = asn1ct_table:to_list(inlined_objects),
InlinedObjects = lists:map(Element2,InlinedObjTuples),
- ets:delete(inlined_objects),
- ParameterizedElems = ets:tab2list(parameterized_objects),
+ asn1ct_table:delete(inlined_objects),
+ ParameterizedElems = asn1ct_table:to_list(parameterized_objects),
ParObjectSets = lists:filter(fun({_OSName,objectset,_}) -> true;
(_)-> false end,ParameterizedElems),
ParObjectSetNames = lists:map(Element1,ParObjectSets),
ParTypes = lists:filter(fun({_TypeName,type,_}) -> true;
(_) -> false end, ParameterizedElems),
ParTypesNames = lists:map(Element1,ParTypes),
- ets:delete(parameterized_objects),
+ asn1ct_table:delete(parameterized_objects),
put(asn1_reference,undefined),
Exporterror = check_exports(S,S#state.module),
@@ -4176,7 +4177,7 @@ check_constraint(S,{'SizeConstraint',Lb}) ->
check_constraint(S,{'SingleValue', L}) when is_list(L) ->
F = fun(A) -> resolv_value(S,A) end,
- {'SingleValue',lists:map(F,L)};
+ {'SingleValue',lists:sort(lists:map(F,L))};
check_constraint(S,{'SingleValue', V}) when is_integer(V) ->
Val = resolv_value(S,V),
@@ -4398,22 +4399,22 @@ constraint_union(_S,C) ->
constraint_union1(S,[A={'ValueRange',_},union,B={'ValueRange',_}|Rest],Acc) ->
AunionB = constraint_union_vr([A,B]),
- constraint_union1(S,Rest,AunionB++Acc);
+ constraint_union1(S,Rest,Acc ++ AunionB);
constraint_union1(S,[A={'SingleValue',_},union,B={'SingleValue',_}|Rest],Acc) ->
AunionB = constraint_union_sv(S,[A,B]),
- constraint_union1(S,Rest,AunionB++Acc);
+ constraint_union1(S,Rest,Acc ++ AunionB);
constraint_union1(S,[A={'SingleValue',_},union,B={'ValueRange',_}|Rest],Acc) ->
AunionB = union_sv_vr(S,A,B),
- constraint_union1(S,Rest,AunionB++Acc);
+ constraint_union1(S,Rest,Acc ++ AunionB);
constraint_union1(S,[A={'ValueRange',_},union,B={'SingleValue',_}|Rest],Acc) ->
AunionB = union_sv_vr(S,B,A),
- constraint_union1(S,Rest,AunionB++Acc);
+ constraint_union1(S,Rest,Acc ++ AunionB);
constraint_union1(S,[union|Rest],Acc) -> %skip when unsupported constraints
constraint_union1(S,Rest,Acc);
constraint_union1(S,[A|Rest],Acc) ->
constraint_union1(S,Rest,[A|Acc]);
constraint_union1(_S,[],Acc) ->
- lists:reverse(Acc).
+ Acc.
constraint_union_sv(_S,SV) ->
Values=lists:map(fun({_,V})->V end,SV),
@@ -4466,63 +4467,33 @@ constraint_union_vr([{_,{_,Ub2}}|Rest],A=[{_,{_,Ub1}}|_Acc]) when Ub2=<Ub1->
constraint_union_vr([VR|Rest],Acc) ->
constraint_union_vr(Rest,[VR|Acc]).
-union_sv_vr(_S,C1={'SingleValue',SV},C2={'ValueRange',VR={Lb,Ub}})
+union_sv_vr(_S,{'SingleValue',SV},VR)
when is_integer(SV) ->
- case is_int_in_vr(SV,C2) of
- true -> [C2];
- _ ->
- case VR of
- {'MIN',Ub} when SV==Ub+1 -> [{'ValueRange',{'MIN',SV}}];
- {Lb,'MAX'} when SV==Lb-1 -> [{'ValueRange',{SV,'MAX'}}];
- {Lb,Ub} when SV==Ub+1 -> [{'ValueRange',{Lb,SV}}];
- {Lb,Ub} when SV==Lb-1 -> [{'ValueRange',{SV,Ub}}];
- _ ->
- [C1,C2]
- end
- end;
-union_sv_vr(_S,C1={'SingleValue',SV},C2={'ValueRange',{_Lb,_Ub}})
+ union_sv_vr(_S,{'SingleValue',[SV]},VR);
+union_sv_vr(_S,{'SingleValue',SV},{'ValueRange',{VLb,VUb}})
when is_list(SV) ->
- case lists:filter(fun(X)->is_int_in_vr(X,C2) end,SV) of
- [] -> [C2];
- L ->
- case expand_vr(L,C2) of
- {[],C3} -> [C3];
- {L,C2} -> [C1,C2];
- {[Val],C3} -> [{'SingleValue',Val},C3];
- {L2,C3} -> [{'SingleValue',L2},C3]
- end
- end.
-
-expand_vr(L,VR={_,{Lb,Ub}}) ->
- case lower_Lb(L,Lb) of
- false ->
- case higher_Ub(L,Ub) of
- false ->
- {L,VR};
- {L1,UbNew} ->
- expand_vr(L1,{'ValueRange',{Lb,UbNew}})
- end;
- {L1,LbNew} ->
- expand_vr(L1,{'ValueRange',{LbNew,Ub}})
- end.
-
-lower_Lb(_,'MIN') ->
- false;
-lower_Lb(L,Lb) ->
- remove_val_from_list(Lb - 1,L).
-
-higher_Ub(_,'MAX') ->
- false;
-higher_Ub(L,Ub) ->
- remove_val_from_list(Ub + 1,L).
+ L = lists:sort(SV++[VLb,VUb]),
+ {Lb,L1} = case lists:member('MIN',L) of
+ true -> {'MIN',L--['MIN']}; % remove 'MIN' so it does not disturb
+ false -> {hd(L),tl(L)}
+ end,
+ Ub = case lists:member('MAX',L1) of
+ true -> 'MAX';
+ false -> lists:last(L1)
+ end,
+ case SV of
+ [H] -> H;
+ _ -> SV
+ end,
+ %% for now we through away the Singlevalues so that they don't disturb
+ %% in the code generating phase (the effective Valuerange is already
+ %% calculated. If we want to keep the Singlevalues as well for
+ %% use in code gen phases we need to introduce a new representation
+ %% like {'ValueRange',{Lb,Ub},[ListOfRanges|AntiValues|Singlevalues]
+ %% These could be used to generate guards which allows only the specific
+ %% values , not the full range
+ [{'ValueRange',{Lb,Ub}}].
-remove_val_from_list(Val,List) ->
- case lists:member(Val,List) of
- true ->
- {lists:delete(Val,List),Val};
- false ->
- false
- end.
%% get_constraints/2
%% Arguments are a list of constraints, which has the format {key,value},
@@ -4923,12 +4894,7 @@ get_referenced(S,Emod,Ename,Pos) ->
%% May be an imported entity in module Emod or Emod may not exist
case asn1_db:dbget(Emod,'MODULE') of
undefined ->
- case parse_and_save(S,Emod) of
- ok ->
- get_referenced(S,Emod,Ename,Pos);
- _ ->
- throw({error,{asn1,{module_not_found,Emod}}})
- end;
+ throw({error,{asn1,{module_not_found,Emod}}});
_ ->
NewS = update_state(S,Emod),
get_imported(NewS,Ename,Emod,Pos)
@@ -4970,13 +4936,7 @@ get_imported(S,Name,Module,Pos) ->
parse_and_save(S,Imodule),
case asn1_db:dbget(Imodule,'MODULE') of
undefined ->
- case parse_and_save(S,Imodule) of
- ok ->
- %% check with cover
- get_referenced(S,Module,Name,Pos);
- _ ->
- throw({error,{asn1,{module_not_found,Imodule}}})
- end;
+ throw({error,{asn1,{module_not_found,Imodule}}});
Im when is_record(Im,module) ->
case is_exported(Im,Name) of
false ->
@@ -5116,16 +5076,16 @@ renamed_reference(S,#'Externaltypereference'{type=Name,module=Module}) ->
renamed_reference(S,Name,Module) ->
%% first check if there is a renamed type in this module
%% second check if any type was imported with this name
- case ets:info(renamed_defs) of
- undefined -> undefined;
- _ ->
- case ets:match(renamed_defs,{'$1',Name,Module}) of
+ case asn1ct_table:exists(renamed_defs) of
+ false -> undefined;
+ true ->
+ case asn1ct_table:match(renamed_defs, {'$1',Name,Module}) of
[] ->
- case ets:info(original_imports) of
- undefined ->
+ case asn1ct_table:exists(original_imports) of
+ false ->
undefined;
- _ ->
- case ets:match(original_imports,{Module,'$1'}) of
+ true ->
+ case asn1ct_table:match(original_imports, {Module,'$1'}) of
[] ->
undefined;
[[ImportsList]] ->
@@ -5253,6 +5213,9 @@ check_int(S,[{'NamedNumber',Id,Num}|T],Acc) when is_integer(Num) ->
check_int(S,[{'NamedNumber',Id,{identifier,_,Name}}|T],Acc) ->
Val = dbget_ex(S,S#state.mname,Name),
check_int(S,[{'NamedNumber',Id,Val#valuedef.value}|T],Acc);
+check_int(S,[{'NamedNumber',Id,{'Externalvaluereference',_,Mod,Name}}|T],Acc) ->
+ Val = dbget_ex(S,Mod,Name),
+ check_int(S,[{'NamedNumber',Id,Val#valuedef.value}|T],Acc);
check_int(_S,[],Acc) ->
lists:keysort(2,Acc).
@@ -6002,17 +5965,12 @@ tag_nums_root2([],Ext,Root2) ->
[0,Ext,Root2].
is_automatic_tagged_in_multi_file(Name) ->
- case ets:info(automatic_tags) of
- undefined ->
+ case asn1ct_table:exists(automatic_tags) of
+ false ->
%% this case when not multifile compilation
false;
- _ ->
-% case ets:member(automatic_tags,Name) of
- case ets:lookup(automatic_tags,Name) of
-% true ->
-% true;
-% _ ->
-% false
+ true ->
+ case asn1ct_table:lookup(automatic_tags, Name) of
[] -> false;
_ -> true
end
@@ -6033,17 +5991,25 @@ generate_automatic_tags1([H|T],[TagNo|TagNos]) when is_record(H,'ComponentType')
type={default,'IMPLICIT'},
form= 0 }]}, % PRIMITIVE
[H#'ComponentType'{typespec=NewTs}|generate_automatic_tags1(T,[TagNo+1|TagNos])];
-generate_automatic_tags1([ExtMark|T],[_TagNo|TagNos]) -> % EXTENSIONMARK
+generate_automatic_tags1([ExtMark = #'EXTENSIONMARK'{}|T],[_TagNo|TagNos]) ->
[ExtMark | generate_automatic_tags1(T,TagNos)];
+generate_automatic_tags1([H|T],TagList) -> % ExtensionAdditionGroup etc are just ignored
+ [H | generate_automatic_tags1(T,TagList)];
generate_automatic_tags1([],_) ->
[].
-any_manual_tag([#'ComponentType'{typespec=#type{tag=[]}}|Rest]) ->
- any_manual_tag(Rest);
-any_manual_tag([#'EXTENSIONMARK'{}|Rest]) ->
- any_manual_tag(Rest);
-any_manual_tag([_|_Rest]) ->
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Returns true if there is at least one ComponentType with a manually
+%% specified tag. No manual tag is indicated by typespec=#type{tag=[]}
+%% so we check if we find a tag =/= [] and return true in that case
+%% all other things in the componentlist like (EXTENSIONMARK,
+%% ExtensionAdditionGroup,...) except ComponentType is simply
+%% ignored/skipped
+any_manual_tag([#'ComponentType'{typespec=#type{tag=Tag}}|_Rest])
+ when Tag =/= []->
true;
+any_manual_tag([_|Rest]) ->
+ any_manual_tag(Rest);
any_manual_tag([]) ->
false.
diff --git a/lib/asn1/src/asn1ct_constructed_per.erl b/lib/asn1/src/asn1ct_constructed_per.erl
index e07680f10b..8de41a4dd4 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -100,20 +100,26 @@ gen_encode_constructed(Erule,Typename,D) when is_record(D,type) ->
case Ext of
{ext,_,NumExt} when NumExt > 0 ->
case extgroup_pos_and_length(CompList) of
- {extgrouppos,ExtGroupPos,ExtGroupLen} ->
- Elements = make_elements(ExtGroupPos+1,
- "Val1",lists:seq(1,ExtGroupLen)),
- emit([
- {next,val}," = case [X || X <- [",Elements,
- "],X =/= asn1_NOVALUE] of",nl,
- "[] -> ",{curr,val},";",nl,
- "_ -> setelement(",{asis,ExtGroupPos+1},",",
- {curr,val},",",
- "{extaddgroup,", Elements,"})",nl,
- "end,",nl]),
- asn1ct_name:new(val);
- _ -> % no extensionAdditionGroup
- ok
+ {extgrouppos,[]} -> % no extenstionAdditionGroup
+ ok;
+ {extgrouppos,ExtGroupPosLenList} ->
+ ExtGroupFun =
+ fun({ExtActualGroupPos,ExtGroupVirtualPos,ExtGroupLen}) ->
+ Elements =
+ make_elements(ExtGroupVirtualPos+1,
+ "Val1",
+ lists:seq(1,ExtGroupLen)),
+ emit([
+ {next,val}," = case [X || X <- [",Elements,
+ "],X =/= asn1_NOVALUE] of",nl,
+ "[] -> ",{curr,val},";",nl,
+ "_ -> setelement(",{asis,ExtActualGroupPos+1},",",
+ {curr,val},",",
+ "{extaddgroup,", Elements,"})",nl,
+ "end,",nl]),
+ asn1ct_name:new(val)
+ end,
+ lists:foreach(ExtGroupFun,ExtGroupPosLenList)
end,
asn1ct_name:new(tmpval),
emit(["Extensions = ?RT_PER:fixextensions(",{asis,Ext},",",
@@ -279,9 +285,9 @@ gen_decode_constructed(Erules,Typename,D) when is_record(D,type) ->
{false,false,false}
end
end,
- NewCompList = wrap_compList(CompList),
+%% NewCompList = wrap_compList(CompList),
{AccTerm,AccBytes} =
- gen_dec_components_call(Erules,Typename,NewCompList,MaybeComma2,DecObjInf,Ext,length(Optionals)),
+ gen_dec_components_call(Erules,Typename,CompList,MaybeComma2,DecObjInf,Ext,length(Optionals)),
case asn1ct_name:all(term) of
[] -> emit(MaybeComma2); % no components at all
_ -> emit({com,nl})
@@ -689,24 +695,28 @@ ext_length([],_,Acc) ->
Acc.
extgroup_pos_and_length(CompList) when is_list(CompList) ->
- noextgroup;
+ {extgrouppos,[]};
extgroup_pos_and_length({RootList,ExtList}) ->
- extgrouppos(ExtList,length(RootList)+1);
-extgroup_pos_and_length({Rl1,Ext,_Rl2}) ->
- extgrouppos(Ext,length(Rl1)+1).
-
-extgrouppos([{'ExtensionAdditionGroup',_Num}|T],Pos) ->
- extgrouppos(T,Pos,0);
-extgrouppos([_|T],Pos) ->
- extgrouppos(T,Pos+1);
-extgrouppos([],_) ->
- noextgroup.
-
-extgrouppos(['ExtensionAdditionGroupEnd'|_T],Pos,Len) ->
- {extgrouppos,Pos,Len};
-extgrouppos([_|T],Pos,Len) ->
- extgrouppos(T,Pos,Len+1).
-
+ ActualPos = length(RootList) +1,
+ %% position to get and deliver data in the record to the user
+ VirtualPos = ActualPos,
+ %% position to encode/decode the extaddgroup as an opentype sequence
+ extgrouppos(ExtList,ActualPos,VirtualPos,[]);
+extgroup_pos_and_length({RootList,ExtList,_Rl2}) ->
+ extgroup_pos_and_length({RootList,ExtList}).
+
+extgrouppos([{'ExtensionAdditionGroup',_Num}|T],ActualPos,VirtualPos,Acc) ->
+ extgrouppos(T,ActualPos,VirtualPos,0,Acc);
+extgrouppos([_|T],ActualPos,VirtualPos,Acc) ->
+ extgrouppos(T,ActualPos+1,VirtualPos+1,Acc);
+extgrouppos([],_,_,Acc) ->
+ {extgrouppos,lists:reverse(Acc)}.
+
+extgrouppos(['ExtensionAdditionGroupEnd'|T],ActualPos,VirtualPos,Len,Acc) ->
+ extgrouppos(T,ActualPos+1,VirtualPos+Len,[{ActualPos,VirtualPos,Len}|Acc]);
+extgrouppos([_|T],ActualPos,VirtualPos,Len,Acc) ->
+ extgrouppos(T,ActualPos,VirtualPos,Len+1,Acc).
+
gen_dec_extension_value(_) ->
@@ -817,19 +827,21 @@ add_textual_order1(Cs,NumIn) ->
end,
NumIn,Cs).
-gen_enc_components_call(Erule,TopType,{Root1,ExtList,Root2},MaybeComma,DynamicEnc,Ext) ->
- gen_enc_components_call(Erule,TopType,{Root1++Root2,ExtList},MaybeComma,DynamicEnc,Ext);
-gen_enc_components_call(Erule,TopType,{CompList,ExtList},MaybeComma,DynamicEnc,Ext) ->
+gen_enc_components_call(Erule,TopType,{Root,ExtList},MaybeComma,DynamicEnc,Ext) ->
+ gen_enc_components_call(Erule,TopType,{Root,ExtList,[]},MaybeComma,DynamicEnc,Ext);
+gen_enc_components_call(Erule,TopType,CL={Root,ExtList,Root2},MaybeComma,DynamicEnc,Ext) ->
%% The type has extensionmarker
- Rpos = gen_enc_components_call1(Erule,TopType,CompList,1,MaybeComma,DynamicEnc,noext),
+ Rpos = gen_enc_components_call1(Erule,TopType,Root++Root2,1,MaybeComma,DynamicEnc,noext),
case Ext of
{ext,_,ExtNum} when ExtNum > 0 ->
emit([nl,
",Extensions",nl]);
+
_ -> true
end,
%handle extensions
- NewExtList = wrap_extensionAdditionGroups(ExtList),
+ {extgrouppos,ExtGroupPosLen} = extgroup_pos_and_length(CL),
+ NewExtList = wrap_extensionAdditionGroups(ExtList,ExtGroupPosLen),
gen_enc_components_call1(Erule,TopType,NewExtList,Rpos,MaybeComma,DynamicEnc,Ext);
gen_enc_components_call(Erule,TopType, CompList, MaybeComma, DynamicEnc, Ext) ->
%% The type has no extensionmarker
@@ -938,7 +950,7 @@ gen_enc_line(Erule,TopType,Cname,Type,Element, _Pos,DynamicEnc,Ext) ->
Atype =
case Type of
#type{def=#'ObjectClassFieldType'{type=InnerType}} ->
- InnerType;
+ InnerType;
_ ->
asn1ct_gen:get_inner(Type#type.def)
end,
@@ -948,6 +960,7 @@ gen_enc_line(Erule,TopType,Cname,Type,Element, _Pos,DynamicEnc,Ext) ->
emit(["?RT_PER:encode_open_type(dummy,?RT_PER:complete("]);
_ -> true
end,
+
case Atype of
{typefield,_} ->
case DynamicEnc of
@@ -1023,20 +1036,22 @@ gen_enc_line(Erule,TopType,Cname,Type,Element, _Pos,DynamicEnc,Ext) ->
emit("))");
_ -> true
end.
-gen_dec_components_call(Erule,TopType,{Root1,ExtList,Root2},MaybeComma,DecInfObj,Ext,NumberOfOptionals) ->
- gen_dec_components_call(Erule,TopType,{Root1++Root2,ExtList},MaybeComma,DecInfObj,Ext,NumberOfOptionals);
-gen_dec_components_call(Erule,TopType,{CompList,ExtList},MaybeComma,
+gen_dec_components_call(Erule,TopType,{Root,ExtList},MaybeComma,
DecInfObj,Ext,NumberOfOptionals) ->
+ gen_dec_components_call(Erule,TopType,{Root,ExtList,[]},MaybeComma,DecInfObj,Ext,NumberOfOptionals);
+gen_dec_components_call(Erule,TopType,CL={Root1,ExtList,Root2},MaybeComma,DecInfObj,Ext,NumberOfOptionals) ->
%% The type has extensionmarker
- OptTable = create_optionality_table(CompList),
+
+ OptTable = create_optionality_table(Root1++Root2),
{Rpos,AccTerm,AccBytes} =
- gen_dec_components_call1(Erule,TopType, CompList, 1, OptTable,
+ gen_dec_components_call1(Erule,TopType, Root1++Root2, 1, OptTable,
MaybeComma,DecInfObj,noext,[],[],
NumberOfOptionals),
emit([",",nl,"{Extensions,",{next,bytes},"} = "]),
emit(["?RT_PER:getextension(Ext,",{curr,bytes},"),",nl]),
asn1ct_name:new(bytes),
- NewExtList = wrap_extensionAdditionGroups(ExtList),
+ {extgrouppos,ExtGroupPosLen} = extgroup_pos_and_length(CL),
+ NewExtList = wrap_extensionAdditionGroups(ExtList,ExtGroupPosLen),
{_Epos,AccTermE,AccBytesE} =
gen_dec_components_call1(Erule,TopType,NewExtList,Rpos, OptTable,
"",DecInfObj,Ext,[],[],NumberOfOptionals),
@@ -1233,8 +1248,7 @@ gen_dec_line(Erule,TopType,Cname,Type,Pos,DecInfObj,Ext,Prop) ->
"} = ?RT_PER:decode_open_type(",{curr,bytes},
", []),",nl]),
emit([indent(2),"case (catch ObjFun(",
- {asis,Name},
- ",",{curr,tmpterm},",telltype,",
+ {asis,Name},",",{curr,tmpterm},",telltype,",
{asis,RestFieldNames},")) of", nl]),
emit([indent(4),"{'EXIT',",{curr,reason},"} ->",nl]),
emit([indent(6),"exit({'Type not ",
@@ -1596,42 +1610,44 @@ flat_complist({Rl1,El,Rl2}) -> Rl1 ++ El ++ Rl2;
flat_complist({Rl,El}) -> Rl ++ El;
flat_complist(CompList) -> CompList.
-wrap_compList({Root1,Ext,Root2}) ->
- {Root1,wrap_extensionAdditionGroups(Ext),Root2};
-wrap_compList({Root1,Ext}) ->
- {Root1,wrap_extensionAdditionGroups(Ext)};
-wrap_compList(CompList) ->
- CompList.
+%%wrap_compList({Root1,Ext,Root2}) ->
+%% {Root1,wrap_extensionAdditionGroups(Ext),Root2};
+%%wrap_compList({Root1,Ext}) ->
+%% {Root1,wrap_extensionAdditionGroups(Ext)};
+%%wrap_compList(CompList) ->
+%% CompList.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Will convert all componentTypes following 'ExtensionAdditionGroup'
%% up to the matching 'ExtensionAdditionGroupEnd' into one componentType
%% of type SEQUENCE with the componentTypes as components
%%
-wrap_extensionAdditionGroups(ExtCompList) ->
- wrap_extensionAdditionGroups(ExtCompList,[],0).
+wrap_extensionAdditionGroups(ExtCompList,ExtGroupPosLen) ->
+ wrap_extensionAdditionGroups(ExtCompList,ExtGroupPosLen,[],0,0).
-wrap_extensionAdditionGroups([{'ExtensionAdditionGroup',_Number}|Rest],Acc,0) ->
- {ExtGroupCompList=
- [#'ComponentType'{textual_order=TextPos}|_],
- ['ExtensionAdditionGroupEnd'|Rest2]} =
+wrap_extensionAdditionGroups([{'ExtensionAdditionGroup',_Number}|Rest],
+ [{ActualPos,_,_}|ExtGroupPosLenRest],Acc,_ExtAddGroupDiff,ExtGroupNum) ->
+ {ExtGroupCompList,['ExtensionAdditionGroupEnd'|Rest2]} =
lists:splitwith(fun(#'ComponentType'{}) -> true;
(_) -> false
end,
Rest),
- wrap_extensionAdditionGroups(Rest2,
+ wrap_extensionAdditionGroups(Rest2,ExtGroupPosLenRest,
[#'ComponentType'{
- name='ExtAddGroup', % FIXME: handles ony one ExtAddGroup
- typespec=#type{def=#'SEQUENCE'{
- extaddgroup=1,% FIXME: handles only one
+ name=list_to_atom("ExtAddGroup"++
+ integer_to_list(ExtGroupNum+1)),
+ typespec=#type{def=#'SEQUENCE'{
+ extaddgroup=ExtGroupNum+1,
components=ExtGroupCompList}},
- textual_order = TextPos,
- prop='OPTIONAL'}|Acc],length(ExtGroupCompList)-1);
-wrap_extensionAdditionGroups([H=#'ComponentType'{textual_order=Tord}|T],Acc,ExtAddGroupDiff) when is_integer(Tord) ->
- wrap_extensionAdditionGroups(T,[H#'ComponentType'{
- textual_order=Tord - ExtAddGroupDiff}|Acc],ExtAddGroupDiff);
-wrap_extensionAdditionGroups([H|T],Acc,ExtAddGroupDiff) ->
- wrap_extensionAdditionGroups(T,[H|Acc],ExtAddGroupDiff);
-wrap_extensionAdditionGroups([],Acc,_) ->
+ textual_order = ActualPos,
+ prop='OPTIONAL'}|Acc],length(ExtGroupCompList)-1,
+ ExtGroupNum+1);
+wrap_extensionAdditionGroups([H=#'ComponentType'{textual_order=Tord}|T],
+ ExtAddGrpLenPos,Acc,ExtAddGroupDiff,ExtGroupNum) when is_integer(Tord) ->
+ wrap_extensionAdditionGroups(T,ExtAddGrpLenPos,[H#'ComponentType'{
+ textual_order=Tord - ExtAddGroupDiff}|Acc],ExtAddGroupDiff,ExtGroupNum);
+wrap_extensionAdditionGroups([H|T],ExtAddGrpLenPos,Acc,ExtAddGroupDiff,ExtGroupNum) ->
+ wrap_extensionAdditionGroups(T,ExtAddGrpLenPos,[H|Acc],ExtAddGroupDiff,ExtGroupNum);
+wrap_extensionAdditionGroups([],_,Acc,_,_) ->
lists:reverse(Acc).
diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl
index 0f8833f716..64a3555f62 100644
--- a/lib/asn1/src/asn1ct_gen.erl
+++ b/lib/asn1/src/asn1ct_gen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -129,28 +129,39 @@ pgen_types(Rtmod,Erules,N2nConvEnums,Module,[H|T]) ->
end,
pgen_types(Rtmod,Erules,N2nConvEnums,Module,T).
+%% Enumerated type with extension marker
pgen_n2nconversion(_Erules,#typedef{name=TypeName,typespec=#type{def={'ENUMERATED',{NN1,NN2}}}}) ->
NN = NN1 ++ NN2,
- pgen_name2numfunc(TypeName,NN),
- pgen_num2namefunc(TypeName,NN);
+ pgen_name2numfunc(TypeName,NN, extension_marker),
+ pgen_num2namefunc(TypeName,NN, extension_marker);
+%% Without extension marker
+pgen_n2nconversion(_Erules,#typedef{name=TypeName,typespec=#type{def={'ENUMERATED',NN}}}) ->
+ pgen_name2numfunc(TypeName,NN, no_extension_marker),
+ pgen_num2namefunc(TypeName,NN, no_extension_marker);
pgen_n2nconversion(_Erules,_) ->
true.
-pgen_name2numfunc(_TypeName,[]) ->
+pgen_name2numfunc(_TypeName,[], _) ->
true;
-pgen_name2numfunc(TypeName,[{Atom,Number}]) ->
+pgen_name2numfunc(TypeName,[{Atom,Number}], extension_marker) ->
+ emit(["name2num_",TypeName,"(",{asis,Atom},") ->",Number,";",nl]),
+ emit(["name2num_",TypeName,"({asn1_enum, Num}) -> Num.",nl,nl]);
+pgen_name2numfunc(TypeName,[{Atom,Number}], _) ->
emit(["name2num_",TypeName,"(",{asis,Atom},") ->",Number,".",nl,nl]);
-pgen_name2numfunc(TypeName,[{Atom,Number}|NNRest]) ->
+pgen_name2numfunc(TypeName,[{Atom,Number}|NNRest], EM) ->
emit(["name2num_",TypeName,"(",{asis,Atom},") ->",Number,";",nl]),
- pgen_name2numfunc(TypeName,NNRest).
+ pgen_name2numfunc(TypeName,NNRest, EM).
-pgen_num2namefunc(_TypeName,[]) ->
+pgen_num2namefunc(_TypeName,[], _) ->
true;
-pgen_num2namefunc(TypeName,[{Atom,Number}]) ->
+pgen_num2namefunc(TypeName,[{Atom,Number}], extension_marker) ->
+ emit(["num2name_",TypeName,"(",Number,") ->",{asis,Atom},";",nl]),
+ emit(["num2name_",TypeName,"(ExtensionNum) -> {asn1_enum, ExtensionNum}.",nl,nl]);
+pgen_num2namefunc(TypeName,[{Atom,Number}], _) ->
emit(["num2name_",TypeName,"(",Number,") ->",{asis,Atom},".",nl,nl]);
-pgen_num2namefunc(TypeName,[{Atom,Number}|NNRest]) ->
+pgen_num2namefunc(TypeName,[{Atom,Number}|NNRest], EM) ->
emit(["num2name_",TypeName,"(",Number,") ->",{asis,Atom},";",nl]),
- pgen_num2namefunc(TypeName,NNRest).
+ pgen_num2namefunc(TypeName,NNRest, EM).
pgen_objects(_,_,_,[]) ->
true;
@@ -169,7 +180,7 @@ pgen_objectsets(Rtmod,Erules,Module,[H|T]) ->
pgen_objectsets(Rtmod,Erules,Module,T).
pgen_check_defaultval(Erules,Module) ->
- CheckObjects = ets:tab2list(check_functions),
+ CheckObjects = asn1ct_table:to_list(check_functions),
case get(asndebug) of
true ->
FileName = lists:concat([Module,".table"]),
@@ -1598,7 +1609,7 @@ gen_check_call(TopType,Cname,Type,InnerType,WhatKind,DefaultValue,Element) ->
NameList = [Cname|TopType],
Name = list2name(NameList ++ [check]),
emit({"'",Name,"'(",DefaultValue,", ",Element,")"}),
- ets:insert(check_functions,{Name,Type}),
+ asn1ct_table:insert(check_functions, {Name, Type}),
%% Must look for check functions in InnerType,
%% that may be referenced or internal defined
%% constructed types not used elsewhere.
@@ -1744,10 +1755,9 @@ lookahead_reference(#'Externaltypereference'{module=M,type=T}) ->
end.
insert_once(Table,Object) ->
- _Info = ets:info(Table),
- case ets:lookup(Table,element(1,Object)) of
+ case asn1ct_table:lookup(Table, element(1, Object)) of
[] ->
- ets:insert(Table,Object); %returns true
+ asn1ct_table:insert(Table, Object); %returns true
_ -> false
end.
diff --git a/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl b/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl
index 365bb84d52..3ccfca3784 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -419,7 +419,7 @@ gen_decode_selected(Erules,Type,FuncName) ->
" {Tlv,_} = ?RT_BER:decode(Bin2",asn1ct_gen:nif_parameter(),"),",nl]),
emit("{ok,"),
gen_decode_selected_type(Erules,Type),
- emit(["};",nl," Err -> exit({error,{selctive_decode,Err}})",nl,
+ emit(["};",nl," Err -> exit({error,{selective_decode,Err}})",nl,
" end.",nl]).
gen_decode_selected_type(_Erules,TypeDef) ->
@@ -1834,7 +1834,7 @@ mk_object_val(Val, Ack, Len) ->
mk_object_val(Val bsr 7, [((Val band 127) bor 128) | Ack], Len + 1).
add_func(F={_Func,_Arity}) ->
- ets:insert(asn1_functab,{F}).
+ asn1ct_table:insert(asn1_functab, {F}).
%% For BER the ExtensionAdditionGroup notation has no impact on the encoding/decoding
%% and therefore we only filter away the ExtensionAdditionGroup start and end markers
diff --git a/lib/asn1/src/asn1ct_gen_per.erl b/lib/asn1/src/asn1ct_gen_per.erl
index b90a0adf81..bd5b81991d 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -321,19 +321,13 @@ effective_constr(_,[]) ->
[];
effective_constr('SingleValue',List) ->
SVList = lists:flatten(lists:map(fun(X)->element(2,X)end,List)),
- % sort and remove duplicates
- SortedSVList = lists:sort(SVList),
- RemoveDup = fun([],_) ->[];
- ([H],_) -> [H];
- ([H,H|T],F) -> F([H|T],F);
- ([H|T],F) -> [H|F(T,F)]
- end,
-
- case RemoveDup(SortedSVList,RemoveDup) of
+ %% Sort and remove duplicates before generating SingleValue or ValueRange
+ %% In case of ValueRange, also check for 'MIN and 'MAX'
+ case lists:usort(SVList) of
[N] ->
[{'SingleValue',N}];
- L when is_list(L) ->
- [{'ValueRange',{hd(L),lists:last(L)}}]
+ L when is_list(L) ->
+ [{'ValueRange',{least_Lb(L),greatest_Ub(L)}}]
end;
effective_constr('ValueRange',List) ->
LBs = lists:map(fun({_,{Lb,_}})-> Lb end,List),
@@ -358,6 +352,10 @@ greatest_common_range2({_,Int},VR={_Lb,_Ub}) when is_integer(Int) ->
greatest_common_range2({_,L},{Lb,Ub}) when is_list(L) ->
Min = least_Lb([Lb|L]),
Max = greatest_Ub([Ub|L]),
+ [{'ValueRange',{Min,Max}}];
+greatest_common_range2({Lb1,Ub1},{Lb2,Ub2}) ->
+ Min = least_Lb([Lb1,Lb2]),
+ Max = greatest_Ub([Ub1,Ub2]),
[{'ValueRange',{Min,Max}}].
mk_vr([{Type,I}]) when is_atom(Type), is_integer(I) ->
@@ -1401,19 +1399,21 @@ get_object_field(Name,ObjectFields) ->
%% have been specified within a SEQUENCE, therefore we construct a fake sequence type here
%% so that we can generate code for it
extaddgroup2sequence(ExtList) ->
- extaddgroup2sequence(ExtList,[]).
+ extaddgroup2sequence(ExtList,0,[]).
-extaddgroup2sequence([{'ExtensionAdditionGroup',Number0}|T],Acc) ->
+extaddgroup2sequence([{'ExtensionAdditionGroup',Number0}|T],ExtNum,Acc) ->
Number = case Number0 of undefined -> 1; _ -> Number0 end,
{ExtGroupComps,['ExtensionAdditionGroupEnd'|T2]} =
lists:splitwith(fun(Elem) -> is_record(Elem,'ComponentType') end,T),
- extaddgroup2sequence(T2,[#'ComponentType'{
- name='ExtAddGroup',
- typespec=#type{def=#'SEQUENCE'{
- extaddgroup=Number,
- components=ExtGroupComps}},
- prop='OPTIONAL'}|Acc]);
-extaddgroup2sequence([C|T],Acc) ->
- extaddgroup2sequence(T,[C|Acc]);
-extaddgroup2sequence([],Acc) ->
+ extaddgroup2sequence(T2,ExtNum+1,
+ [#'ComponentType'{
+ name=list_to_atom("ExtAddGroup"++
+ integer_to_list(ExtNum+1)),
+ typespec=#type{def=#'SEQUENCE'{
+ extaddgroup=Number,
+ components=ExtGroupComps}},
+ prop='OPTIONAL'}|Acc]);
+extaddgroup2sequence([C|T],ExtNum,Acc) ->
+ extaddgroup2sequence(T,ExtNum,[C|Acc]);
+extaddgroup2sequence([],_,Acc) ->
lists:reverse(Acc).
diff --git a/lib/asn1/src/asn1ct_gen_per_rt2ct.erl b/lib/asn1/src/asn1ct_gen_per_rt2ct.erl
index 1a0a0e211d..16eec92847 100644
--- a/lib/asn1/src/asn1ct_gen_per_rt2ct.erl
+++ b/lib/asn1/src/asn1ct_gen_per_rt2ct.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -670,18 +670,13 @@ effective_constr(_,[]) ->
[];
effective_constr('SingleValue',List) ->
SVList = lists:flatten(lists:map(fun(X)->element(2,X)end,List)),
- % sort and remove duplicates
- RemoveDup = fun([],_) ->[];
- ([H],_) -> [H];
- ([H,H|T],F) -> F([H|T],F);
- ([H|T],F) -> [H|F(T,F)]
- end,
-
- case RemoveDup(SVList,RemoveDup) of
+ %% Sort and remove duplicates before generating SingleValue or ValueRange
+ %% In case of ValueRange, also check for 'MIN and 'MAX'
+ case lists:usort(SVList) of
[N] ->
[{'SingleValue',N}];
- L when is_list(L) ->
- [{'ValueRange',{hd(L),lists:last(L)}}]
+ L when is_list(L) ->
+ [{'ValueRange',{least_Lb(L),greatest_Ub(L)}}]
end;
effective_constr('ValueRange',List) ->
LBs = lists:map(fun({_,{Lb,_}})-> Lb end,List),
@@ -704,6 +699,10 @@ greatest_common_range([{_,Int}],VR=[{_,{_Lb,_Ub}}]) when is_integer(Int) ->
greatest_common_range([{_,L}],[{_,{Lb,Ub}}]) when is_list(L) ->
Min = least_Lb([Lb|L]),
Max = greatest_Ub([Ub|L]),
+ [{'ValueRange',{Min,Max}}];
+greatest_common_range([{_,{Lb1,Ub1}}],[{_,{Lb2,Ub2}}]) ->
+ Min = least_Lb([Lb1,Lb2]),
+ Max = greatest_Ub([Ub1,Ub2]),
[{'ValueRange',{Min,Max}}].
@@ -1804,19 +1803,21 @@ dec_enumerated_cases([],_,_) ->
%% have been specified within a SEQUENCE, therefore we construct a fake sequence type here
%% so that we can generate code for it
extaddgroup2sequence(ExtList) ->
- extaddgroup2sequence(ExtList,[]).
+ extaddgroup2sequence(ExtList,0,[]).
-extaddgroup2sequence([{'ExtensionAdditionGroup',Number0}|T],Acc) ->
+extaddgroup2sequence([{'ExtensionAdditionGroup',Number0}|T],ExtNum,Acc) ->
Number = case Number0 of undefined -> 1; _ -> Number0 end,
{ExtGroupComps,['ExtensionAdditionGroupEnd'|T2]} =
lists:splitwith(fun(Elem) -> is_record(Elem,'ComponentType') end,T),
- extaddgroup2sequence(T2,[#'ComponentType'{
- name='ExtAddGroup',
- typespec=#type{def=#'SEQUENCE'{
- extaddgroup=Number,
- components=ExtGroupComps}},
- prop='OPTIONAL'}|Acc]);
-extaddgroup2sequence([C|T],Acc) ->
- extaddgroup2sequence(T,[C|Acc]);
-extaddgroup2sequence([],Acc) ->
+ extaddgroup2sequence(T2,ExtNum+1,
+ [#'ComponentType'{
+ name=list_to_atom("ExtAddGroup"++
+ integer_to_list(ExtNum+1)),
+ typespec=#type{def=#'SEQUENCE'{
+ extaddgroup=Number,
+ components=ExtGroupComps}},
+ prop='OPTIONAL'}|Acc]);
+extaddgroup2sequence([C|T],ExtNum,Acc) ->
+ extaddgroup2sequence(T,ExtNum,[C|Acc]);
+extaddgroup2sequence([],_,Acc) ->
lists:reverse(Acc).
diff --git a/lib/asn1/src/asn1ct_name.erl b/lib/asn1/src/asn1ct_name.erl
index a6aa4255cc..3ab6f7b0ed 100644
--- a/lib/asn1/src/asn1ct_name.erl
+++ b/lib/asn1/src/asn1ct_name.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -20,8 +20,7 @@
-module(asn1ct_name).
%%-compile(export_all).
--export([name_server_loop/1,
- start/0,
+-export([start/0,
stop/0,
push/1,
pop/1,
@@ -35,38 +34,50 @@
new/1]).
start() ->
- start_server(asn1_ns, asn1ct_name,name_server_loop,[[]]).
+ Parent = self(),
+ case get(?MODULE) of
+ undefined ->
+ put(?MODULE, spawn_link(fun() ->
+ Ref = monitor(process, Parent),
+ name_server_loop({Ref,Parent},[])
+ end)),
+ ok;
+ _Pid ->
+ already_started
+ end.
-stop() -> stop_server(asn1_ns).
+stop() ->
+ req(stop),
+ erase(?MODULE).
-name_server_loop(Vars) ->
+name_server_loop({Ref, Parent} = Monitor,Vars) ->
%% io:format("name -- ~w~n",[Vars]),
receive
{From,{current,Variable}} ->
- From ! {asn1_ns,get_curr(Vars,Variable)},
- name_server_loop(Vars);
+ From ! {?MODULE,get_curr(Vars,Variable)},
+ name_server_loop(Monitor,Vars);
{From,{pop,Variable}} ->
- From ! {asn1_ns,done},
- name_server_loop(pop_var(Vars,Variable));
+ From ! {?MODULE,done},
+ name_server_loop(Monitor,pop_var(Vars,Variable));
{From,{push,Variable}} ->
- From ! {asn1_ns,done},
- name_server_loop(push_var(Vars,Variable));
+ From ! {?MODULE,done},
+ name_server_loop(Monitor,push_var(Vars,Variable));
{From,{delete,Variable}} ->
- From ! {asn1_ns,done},
- name_server_loop(delete_var(Vars,Variable));
+ From ! {?MODULE,done},
+ name_server_loop(Monitor,delete_var(Vars,Variable));
{From,{new,Variable}} ->
- From ! {asn1_ns,done},
- name_server_loop(new_var(Vars,Variable));
+ From ! {?MODULE,done},
+ name_server_loop(Monitor,new_var(Vars,Variable));
{From,{prev,Variable}} ->
- From ! {asn1_ns,get_prev(Vars,Variable)},
- name_server_loop(Vars);
+ From ! {?MODULE,get_prev(Vars,Variable)},
+ name_server_loop(Monitor,Vars);
{From,{next,Variable}} ->
- From ! {asn1_ns,get_next(Vars,Variable)},
- name_server_loop(Vars);
+ From ! {?MODULE,get_next(Vars,Variable)},
+ name_server_loop(Monitor,Vars);
+ {'DOWN', Ref, process, Parent, Reason} ->
+ exit(Reason);
{From,stop} ->
- unregister(asn1_ns),
- From ! {asn1_ns,stopped},
- exit(normal)
+ From ! {?MODULE,stopped}
end.
active(V) ->
@@ -76,12 +87,16 @@ active(V) ->
end.
req(Req) ->
- asn1_ns ! {self(), Req},
- receive {asn1_ns, Reply} -> Reply end.
+ get(?MODULE) ! {self(), Req},
+ receive
+ {?MODULE, Reply} -> Reply
+ after 5000 ->
+ exit(name_server_timeout)
+ end.
pop(V) -> req({pop,V}).
push(V) -> req({push,V}).
-clear() -> req(stop), start().
+clear() -> stop(), start().
curr(V) -> req({current,V}).
new(V) -> req({new,V}).
delete(V) -> req({delete,V}).
@@ -209,25 +224,3 @@ get_next(Vars,Variable) ->
_ ->
none
end.
-
-
-stop_server(Name) ->
- stop_server(Name, whereis(Name)).
-stop_server(_Name, undefined) -> stopped;
-stop_server(Name, _Pid) ->
- Name ! {self(), stop},
- receive {Name, _} -> stopped end.
-
-
-start_server(Name,Mod,Fun,Args) ->
- case whereis(Name) of
- undefined ->
- case catch register(Name, spawn(Mod,Fun, Args)) of
- {'EXIT',{badarg,_}} ->
- start_server(Name,Mod,Fun,Args);
- _ ->
- ok
- end;
- _Pid ->
- already_started
- end.
diff --git a/lib/asn1/src/asn1ct_parser2.erl b/lib/asn1/src/asn1ct_parser2.erl
index 224a535e87..7301f49085 100644
--- a/lib/asn1/src/asn1ct_parser2.erl
+++ b/lib/asn1/src/asn1ct_parser2.erl
@@ -1,7 +1,8 @@
+%% vim: tabstop=8:shiftwidth=4
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2012. 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
@@ -81,14 +82,15 @@ parse_ModuleDefinition([{typereference,L1,ModuleIdentifier}|Rest0]) ->
case Rest3 of
[{'::=',_L7}, {'BEGIN',_L8}|Rest4] ->
{Exports, Rest5} = parse_Exports(Rest4),
- {Imports, Rest6} = parse_Imports(Rest5),
+ {{imports, Imports}, Rest6} = parse_Imports(Rest5),
+ put({get(asn1_module), imports}, Imports),
{#module{ pos = L1,
name = ModuleIdentifier,
defid = [], % fix this
tagdefault = TagDefault,
extensiondefault = ExtensionDefault,
exports = Exports,
- imports = Imports},Rest6};
+ imports = {imports, Imports}}, Rest6};
_ -> throw({asn1_error,{get_line(hd(Rest3)),get(asn1_module),
[got,get_token(hd(Rest3)),expected,"::= BEGIN"]}})
end;
@@ -717,12 +719,12 @@ parse_DefinedType(Tokens=[{typereference,L1,TypeName},
{'EXIT',_Reason} ->
Rest2 = [T2,T3|Rest],
{#type{def = #'Externaltypereference'{pos=L1,
- module=get(asn1_module),
+ module=resolve_module(TypeName),
type=TypeName}},Rest2};
{asn1_error,_} ->
Rest2 = [T2,T3|Rest],
{#type{def = #'Externaltypereference'{pos=L1,
- module=get(asn1_module),
+ module=resolve_module(TypeName),
type=TypeName}},Rest2};
Result ->
Result
@@ -735,7 +737,7 @@ parse_DefinedType([{typereference,L1,Module},{'.',_},{typereference,_,TypeName}|
parse_DefinedType([{typereference,L1,TypeName}|Rest]) ->
case is_pre_defined_class(TypeName) of
false ->
- {#type{def = #'Externaltypereference'{pos=L1,module=get(asn1_module),
+ {#type{def = #'Externaltypereference'{pos=L1,module=resolve_module(TypeName),
type=TypeName}},Rest};
_ ->
throw({asn1_error,
@@ -758,6 +760,23 @@ parse_SelectionType(Tokens) ->
[got,get_token(hd(Tokens)),expected,'identifier <']}}).
+resolve_module(Type) ->
+ Current = get(asn1_module),
+ Imports = get({Current, imports}),
+ resolve_module(Type, Current, Imports).
+
+resolve_module(_Type, Current, undefined) ->
+ Current;
+resolve_module(Type, Current, Imports) ->
+ case [Mod || #'SymbolsFromModule'{symbols = S, module = Mod} <- Imports,
+ #'Externaltypereference'{type = T} <- S,
+ Type == T] of
+ [#'Externaltypereference'{type = Mod}|_] -> Mod;
+ %% This allows the same symbol to be imported several times
+ %% which ought to be checked elsewhere and flagged as an error
+ [] -> Current
+ end.
+
%% --------------------------
@@ -1539,7 +1558,7 @@ parse_DefinedObjectSet([{typereference,L1,ModuleName},{'.',_},
{{objectset,L1,#'Externaltypereference'{pos=L2,module=ModuleName,
type=ObjSetName}},Rest};
parse_DefinedObjectSet([{typereference,L1,ObjSetName}|Rest]) ->
- {{objectset,L1,#'Externaltypereference'{pos=L1,module=get(asn1_module),
+ {{objectset,L1,#'Externaltypereference'{pos=L1,module=resolve_module(ObjSetName),
type=ObjSetName}},Rest};
parse_DefinedObjectSet(Tokens) ->
throw({asn1_error,{get_line(hd(Tokens)),get(asn1_module),
@@ -3203,17 +3222,17 @@ prioritize_error(ErrList) ->
tref2Exttref(#typereference{pos=Pos,val=Name}) ->
#'Externaltypereference'{pos=Pos,
- module=get(asn1_module),
+ module=resolve_module(Name),
type=Name}.
tref2Exttref(Pos,Name) ->
#'Externaltypereference'{pos=Pos,
- module=get(asn1_module),
+ module=resolve_module(Name),
type=Name}.
identifier2Extvalueref(#identifier{pos=Pos,val=Name}) ->
#'Externalvaluereference'{pos=Pos,
- module=get(asn1_module),
+ module=resolve_module(Name),
value=Name}.
%% lookahead_assignment/1 checks that the next sequence of tokens
diff --git a/lib/asn1/src/asn1ct_table.erl b/lib/asn1/src/asn1ct_table.erl
new file mode 100644
index 0000000000..a5eb6d0413
--- /dev/null
+++ b/lib/asn1/src/asn1ct_table.erl
@@ -0,0 +1,76 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+%%
+-module(asn1ct_table).
+
+%% Table abstraction module for ASN.1 compiler
+
+-export([new/1]).
+-export([new/2]).
+-export([new_reuse/1]).
+-export([new_reuse/2]).
+-export([exists/1]).
+-export([size/1]).
+-export([insert/2]).
+-export([lookup/2]).
+-export([match/2]).
+-export([to_list/1]).
+-export([delete/1]). % TODO: Remove (since we run in a separate process)
+
+
+%% Always creates a new table
+new(Table) -> new(Table, []).
+new(Table, Options) ->
+ TableId = case get(Table) of
+ undefined ->
+ ets:new(Table, Options);
+ _ ->
+ delete(Table),
+ ets:new(Table, Options)
+ end,
+ put(Table, TableId).
+
+%% Only create it if it doesn't exist yet
+new_reuse(Table) -> new_reuse(Table, []).
+new_reuse(Table, Options) ->
+ not exists(Table) andalso new(Table, Options).
+
+exists(Table) -> get(Table) =/= undefined.
+
+size(Table) -> ets:info(get(Table), size).
+
+insert(Table, Tuple) -> ets:insert(get(Table), Tuple).
+
+lookup(Table, Key) -> ets:lookup(get(Table), Key).
+
+match(Table, MatchSpec) -> ets:match(get(Table), MatchSpec).
+
+to_list(Table) -> ets:tab2list(get(Table)).
+
+delete(Tables) when is_list(Tables) ->
+ [delete(T) || T <- Tables],
+ true;
+delete(Table) when is_atom(Table) ->
+ case get(Table) of
+ undefined ->
+ true;
+ TableId ->
+ ets:delete(TableId),
+ erase(Table)
+ end.
diff --git a/lib/asn1/src/asn1ct_value.erl b/lib/asn1/src/asn1ct_value.erl
index d099376b1b..9013baef92 100644
--- a/lib/asn1/src/asn1ct_value.erl
+++ b/lib/asn1/src/asn1ct_value.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -25,58 +25,58 @@
-include("asn1_records.hrl").
%-compile(export_all).
--export([get_type/3]).
--export([i_random/1]).
-
+-export([from_type/2]).
%% Generate examples of values ******************************
%%****************************************x
-get_type(M,Typename,Tellname) ->
+from_type(M,Typename) ->
case asn1_db:dbget(M,Typename) of
undefined ->
- {asn1_error,{not_found,{M,Typename}}};
+ {error,{not_found,{M,Typename}}};
Tdef when is_record(Tdef,typedef) ->
Type = Tdef#typedef.typespec,
- get_type(M,[Typename],Type,Tellname);
+ from_type(M,[Typename],Type);
+ Vdef when is_record(Vdef,valuedef) ->
+ from_value(Vdef);
Err ->
- {asn1_error,{other,Err}}
+ {error,{other,Err}}
end.
-get_type(M,Typename,Type,Tellname) when is_record(Type,type) ->
+from_type(M,Typename,Type) when is_record(Type,type) ->
InnerType = get_inner(Type#type.def),
case asn1ct_gen:type(InnerType) of
#'Externaltypereference'{module=Emod,type=Etype} ->
- get_type(Emod,Etype,Tellname);
+ from_type(Emod,Etype);
{_,user} ->
- case Tellname of
- yes -> {Typename,get_type(M,InnerType,no)};
- no -> get_type(M,InnerType,no)
- end;
+ from_type(M,InnerType);
{notype,_} ->
true;
{primitive,bif} ->
- get_type_prim(Type,get_encoding_rule(M));
+ from_type_prim(Type,get_encoding_rule(M));
'ASN1_OPEN_TYPE' ->
case Type#type.constraint of
[#'Externaltypereference'{type=TrefConstraint}] ->
- get_type(M,TrefConstraint,no);
+ from_type(M,TrefConstraint);
_ ->
ERule = get_encoding_rule(M),
open_type_value(ERule)
end;
{constructed,bif} when Typename == ['EXTERNAL'] ->
- Val=get_type_constructed(M,Typename,InnerType,Type),
+ Val=from_type_constructed(M,Typename,InnerType,Type),
asn1rt_check:transform_to_EXTERNAL1994(Val);
{constructed,bif} ->
- get_type_constructed(M,Typename,InnerType,Type)
+ from_type_constructed(M,Typename,InnerType,Type)
end;
-get_type(M,Typename,#'ComponentType'{name = Name,typespec = Type},_) ->
- get_type(M,[Name|Typename],Type,no);
-get_type(_,_,_,_) -> % 'EXTENSIONMARK'
+from_type(M,Typename,#'ComponentType'{name = Name,typespec = Type}) ->
+ from_type(M,[Name|Typename],Type);
+from_type(_,_,_) -> % 'EXTENSIONMARK'
undefined.
+from_value(#valuedef{type = #type{def = 'INTEGER'}, value = Val}) ->
+ Val.
+
get_inner(A) when is_atom(A) -> A;
get_inner(Ext) when is_record(Ext,'Externaltypereference') -> Ext;
get_inner({typereference,_Pos,Name}) -> Name;
@@ -93,7 +93,7 @@ get_inner(T) when is_tuple(T) ->
-get_type_constructed(M,Typename,InnerType,D) when is_record(D,type) ->
+from_type_constructed(M,Typename,InnerType,D) when is_record(D,type) ->
case InnerType of
'SET' ->
get_sequence(M,Typename,D);
@@ -132,7 +132,7 @@ get_components(M,Typename,{Root,Ext}) ->
%% Should enhance this *** HERE *** with proper handling of extensions
get_components(M,Typename,[H|T]) ->
- [get_type(M,Typename,H,no)|
+ [from_type(M,Typename,H)|
get_components(M,Typename,T)];
get_components(_,_,[]) ->
[].
@@ -145,10 +145,10 @@ get_choice(M,Typename,Type) ->
{CompList,ExtList} -> % Should be enhanced to handle extensions too
CList = CompList ++ ExtList,
C = lists:nth(random(length(CList)),CList),
- {C#'ComponentType'.name,get_type(M,Typename,C,no)};
+ {C#'ComponentType'.name,from_type(M,Typename,C)};
CompList when is_list(CompList) ->
C = lists:nth(random(length(CompList)),CompList),
- {C#'ComponentType'.name,get_type(M,Typename,C,no)}
+ {C#'ComponentType'.name,from_type(M,Typename,C)}
end.
get_sequence_of(M,Typename,Type,TypeSuffix) ->
@@ -157,14 +157,14 @@ get_sequence_of(M,Typename,Type,TypeSuffix) ->
C = Type#type.constraint,
S = size_random(C),
NewTypeName = [TypeSuffix|Typename],
- gen_list(M,NewTypeName,Oftype,no,S).
+ gen_list(M,NewTypeName,Oftype,S).
-gen_list(_,_,_,_,0) ->
+gen_list(_,_,_,0) ->
[];
-gen_list(M,Typename,Oftype,Tellname,N) ->
- [get_type(M,Typename,Oftype,no)|gen_list(M,Typename,Oftype,Tellname,N-1)].
+gen_list(M,Typename,Oftype,N) ->
+ [from_type(M,Typename,Oftype)|gen_list(M,Typename,Oftype,N-1)].
-get_type_prim(D,Erule) ->
+from_type_prim(D,Erule) ->
C = D#type.constraint,
case D#type.def of
'INTEGER' ->
@@ -198,6 +198,7 @@ get_type_prim(D,Erule) ->
NN = [X||{X,_} <- NNew],
case NN of
[] ->
+ io:format(user, "Enum = ~p~n", [Enum]),
asn1_EMPTY;
_ ->
case C of
@@ -412,14 +413,20 @@ adjust_list1(Len,Orig,[Oh|Ot],Acc) ->
adjust_list1(Len-1,Orig,Ot,[Oh|Acc]).
-get_constraint(C,Key) ->
- case lists:keysearch(Key,1,C) of
- false ->
- no;
- {value,{_,V}} ->
- V
+get_constraint(C, Key) ->
+ case lists:keyfind(Key, 1, C) of
+ false -> no;
+ {'ValueRange', {Lb, Ub}} -> {check_external(Lb), check_external(Ub)};
+ {'SizeConstraint', N} -> N;
+ {Key, Value} -> Value
end.
+check_external(ExtRef) when is_record(ExtRef, 'Externalvaluereference') ->
+ #'Externalvaluereference'{module = Emod, value = Evalue} = ExtRef,
+ from_type(Emod, Evalue);
+check_external(Value) ->
+ Value.
+
get_encoding_rule(M) ->
Mod =
if is_list(M) ->
diff --git a/lib/asn1/src/asn1rt_ber_bin_v2.erl b/lib/asn1/src/asn1rt_ber_bin_v2.erl
index 17e66f77c9..9ff5017c68 100644
--- a/lib/asn1/src/asn1rt_ber_bin_v2.erl
+++ b/lib/asn1/src/asn1rt_ber_bin_v2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -610,8 +610,8 @@ match_tags(Vlist = [{T,_V}|_], [T]) ->
Vlist;
match_tags(Tlv, []) ->
Tlv;
-match_tags({Tag,_V},[T|_Tt]) ->
- {error,{asn1,{wrong_tag,{Tag,T}}}}.
+match_tags(Tlv = {Tag,_V},[T|_Tt]) ->
+ exit({error,{asn1,{wrong_tag,{{expected,T},{got,Tag,Tlv}}}}}).
cindex(Ix,Val,Cname) ->
diff --git a/lib/asn1/src/asn1rt_check.erl b/lib/asn1/src/asn1rt_check.erl
index d9856901b8..35b993fc71 100644
--- a/lib/asn1/src/asn1rt_check.erl
+++ b/lib/asn1/src/asn1rt_check.erl
@@ -311,7 +311,8 @@ transform_to_EXTERNAL1990([Data_val_desc,Data_value],Acc)
when is_binary(Data_value)->
list_to_tuple(lists:reverse([{'single-ASN1-type',Data_value},
Data_val_desc|Acc]));
-transform_to_EXTERNAL1990([Data_value],Acc) when is_list(Data_value)->
+transform_to_EXTERNAL1990([Data_value],Acc)
+ when is_list(Data_value); is_binary(Data_value) ->
list_to_tuple(lists:reverse([{'octet-aligned',Data_value}|Acc])).
diff --git a/lib/asn1/src/asn1rt_per_bin.erl b/lib/asn1/src/asn1rt_per_bin.erl
index a124c7553d..5772f09bf4 100644
--- a/lib/asn1/src/asn1rt_per_bin.erl
+++ b/lib/asn1/src/asn1rt_per_bin.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -18,7 +18,6 @@
%%
%%
-module(asn1rt_per_bin).
-
%% encoding / decoding of PER aligned
-include("asn1_records.hrl").
@@ -57,7 +56,7 @@
encode_NumericString/2, decode_NumericString/2,
encode_ObjectDescriptor/2, decode_ObjectDescriptor/1
]).
--export([complete_bytes/1, getbits/2, getoctets/2]).
+-export([complete_bytes/1, getbits/2, getoctets/2, minimum_bits/1]).
-define('16K',16384).
-define('32K',32768).
@@ -695,21 +694,28 @@ encode_constrained_number({Lb,Ub},Val) when Val >= Lb, Ub >= Val ->
{octets,[Val2]};
Range =< 65536 ->
{octets,<<Val2:16>>};
- Range =< 16#1000000 ->
- Octs = eint_positive(Val2),
- [{bits,2,length(Octs)-1},{octets,Octs}];
- Range =< 16#100000000 ->
- Octs = eint_positive(Val2),
- [{bits,2,length(Octs)-1},{octets,Octs}];
- Range =< 16#10000000000 ->
- Octs = eint_positive(Val2),
- [{bits,3,length(Octs)-1},{octets,Octs}];
+ Range =< (1 bsl (255*8)) ->
+ Octs = binary:encode_unsigned(Val2),
+ RangeOcts = binary:encode_unsigned(Range - 1),
+ OctsLen = erlang:byte_size(Octs),
+ RangeOctsLen = erlang:byte_size(RangeOcts),
+ LengthBitsNeeded = minimum_bits(RangeOctsLen - 1),
+ [{bits, LengthBitsNeeded, OctsLen - 1}, {octets, Octs}];
true ->
exit({not_supported,{integer_range,Range}})
end;
encode_constrained_number(Range,Val) ->
exit({error,{asn1,{integer_range,Range,value,Val}}}).
+%% For some reason the minimum bits needed in the length field in encoding of
+%% constrained whole numbers must always be atleast 2?
+minimum_bits(N) when N < 4 -> 2;
+minimum_bits(N) when N < 8 -> 3;
+minimum_bits(N) when N < 16 -> 4;
+minimum_bits(N) when N < 32 -> 5;
+minimum_bits(N) when N < 64 -> 6;
+minimum_bits(N) when N < 128 -> 7;
+minimum_bits(_N) -> 8.
decode_constrained_number(Buffer,{Lb,Ub}) ->
Range = Ub - Lb + 1,
@@ -738,18 +744,12 @@ decode_constrained_number(Buffer,{Lb,Ub}) ->
getoctets(Buffer,1);
Range =< 65536 ->
getoctets(Buffer,2);
- Range =< 16#1000000 ->
- {Len,Bytes2} = decode_length(Buffer,{1,3}),
- {Octs,Bytes3} = getoctets_as_list(Bytes2,Len),
- {dec_pos_integer(Octs),Bytes3};
- Range =< 16#100000000 ->
- {Len,Bytes2} = decode_length(Buffer,{1,4}),
- {Octs,Bytes3} = getoctets_as_list(Bytes2,Len),
- {dec_pos_integer(Octs),Bytes3};
- Range =< 16#10000000000 ->
- {Len,Bytes2} = decode_length(Buffer,{1,5}),
- {Octs,Bytes3} = getoctets_as_list(Bytes2,Len),
- {dec_pos_integer(Octs),Bytes3};
+ Range =< (1 bsl (255*8)) ->
+ OList = binary:bin_to_list(binary:encode_unsigned(Range - 1)),
+ RangeOctLen = length(OList),
+ {Len, Bytes} = decode_length(Buffer, {1, RangeOctLen}),
+ {Octs, RestBytes} = getoctets_as_list(Bytes, Len),
+ {binary:decode_unsigned(binary:list_to_bin(Octs)), RestBytes};
true ->
exit({not_supported,{integer_range,Range}})
end,
@@ -803,8 +803,6 @@ decode_unconstrained_number(Bytes) ->
{Ints,Bytes3} = getoctets_as_list(Bytes2,Len),
{dec_integer(Ints),Bytes3}.
-dec_pos_integer(Ints) ->
- decpint(Ints, 8 * (length(Ints) - 1)).
dec_integer(Ints) when hd(Ints) band 255 =< 127 -> %% Positive number
decpint(Ints, 8 * (length(Ints) - 1));
dec_integer(Ints) -> %% Negative
diff --git a/lib/asn1/src/asn1rt_per_bin_rt2ct.erl b/lib/asn1/src/asn1rt_per_bin_rt2ct.erl
index 750b59aba6..1df757a47f 100644
--- a/lib/asn1/src/asn1rt_per_bin_rt2ct.erl
+++ b/lib/asn1/src/asn1rt_per_bin_rt2ct.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -18,7 +18,6 @@
%%
%%
-module(asn1rt_per_bin_rt2ct).
-
%% encoding / decoding of PER aligned
-include("asn1_records.hrl").
@@ -605,19 +604,13 @@ encode_constrained_number({Lb,Ub},Val) when Val >= Lb, Ub >= Val ->
Range =< 65536 ->
% Size = {octets,<<Val2:16>>};
[20,2,<<Val2:16>>];
- Range =< 16#1000000 ->
- Octs = eint_positive(Val2),
-% [{bits,2,length(Octs)-1},{octets,Octs}];
- Len = length(Octs),
- [10,2,Len-1,20,Len,Octs];
- Range =< 16#100000000 ->
- Octs = eint_positive(Val2),
- Len = length(Octs),
- [10,2,Len-1,20,Len,Octs];
- Range =< 16#10000000000 ->
- Octs = eint_positive(Val2),
- Len = length(Octs),
- [10,3,Len-1,20,Len,Octs];
+ Range =< (1 bsl (255*8)) ->
+ Octs = binary:encode_unsigned(Val2),
+ RangeOcts = binary:encode_unsigned(Range - 1),
+ OctsLen = erlang:byte_size(Octs),
+ RangeOctsLen = erlang:byte_size(RangeOcts),
+ LengthBitsNeeded = asn1rt_per_bin:minimum_bits(RangeOctsLen - 1),
+ [10,LengthBitsNeeded,OctsLen-1,20,OctsLen,Octs];
true ->
exit({not_supported,{integer_range,Range}})
end;
@@ -661,18 +654,12 @@ decode_constrained_number(Buffer,{Lb,_Ub},Range) ->
getoctets(Buffer,1);
Range =< 65536 ->
getoctets(Buffer,2);
- Range =< 16#1000000 ->
- {Len,Bytes2} = decode_length(Buffer,{1,3}),
- {Octs,Bytes3} = getoctets_as_bin(Bytes2,Len),
- {dec_pos_integer(Octs),Bytes3};
- Range =< 16#100000000 ->
- {Len,Bytes2} = decode_length(Buffer,{1,4}),
- {Octs,Bytes3} = getoctets_as_bin(Bytes2,Len),
- {dec_pos_integer(Octs),Bytes3};
- Range =< 16#10000000000 ->
- {Len,Bytes2} = decode_length(Buffer,{1,5}),
- {Octs,Bytes3} = getoctets_as_bin(Bytes2,Len),
- {dec_pos_integer(Octs),Bytes3};
+ Range =< (1 bsl (255*8)) ->
+ OList = binary:bin_to_list(binary:encode_unsigned(Range - 1)),
+ RangeOctLen = length(OList),
+ {Len, Bytes} = decode_length(Buffer, {1, RangeOctLen}),
+ {Octs, RestBytes} = getoctets_as_bin(Bytes, Len),
+ {binary:decode_unsigned(Octs), RestBytes};
true ->
exit({not_supported,{integer_range,Range}})
end,
@@ -736,17 +723,12 @@ decode_unconstrained_number(Bytes) ->
{Ints,Bytes3} = getoctets_as_bin(Bytes2,Len),
{dec_integer(Ints),Bytes3}.
-
-dec_pos_integer(Ints) ->
- decpint(Ints).
dec_integer(Bin = <<0:1,_:7,_/binary>>) ->
decpint(Bin);
dec_integer(<<_:1,B:7,BitStr/bitstring>>) ->
Size = bit_size(BitStr),
<<I:Size>> = BitStr,
(-128 + B) bsl bit_size(BitStr) bor I.
-
-
decpint(Bin) ->
Size = bit_size(Bin),
diff --git a/lib/asn1/test/Makefile b/lib/asn1/test/Makefile
index 7ecd544d4b..6e6374baf1 100644
--- a/lib/asn1/test/Makefile
+++ b/lib/asn1/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -28,11 +28,10 @@ MODULES= \
h323test \
choice_extension \
ber_decode_error \
- testExternal \
testPrim \
- testPrimStrings \
+ testPrimStrings \
testCompactBitString \
- testPrimExternal \
+ testPrimExternal \
testChoPrim \
testChoExtension \
testChoExternal \
@@ -86,15 +85,12 @@ MODULES= \
testMergeCompile \
testDeepTConstr \
testTimer \
- testRANAP \
testMegaco \
- testMvrasn6 \
testSeqSetDefaultVal \
testParamBasic \
testContextSwitchingTypes \
testTypeValueNotation \
testOpenTypeImplicitTag \
- testROSE \
testINSTANCE_OF \
test_partial_incomplete_decode \
testDER \
@@ -108,7 +104,6 @@ MODULES= \
test_inline \
testTcapsystem \
testNBAPsystem \
- test_bad_values \
test_compile_options \
testDoubleEllipses \
test_modified_x420 \
@@ -118,16 +113,9 @@ MODULES= \
asn1_app_test \
asn1_appup_test \
asn1_wrapper \
- asn1_SUITE \
- asn1_bin_SUITE \
- asn1_bin_v2_SUITE
+ asn1_SUITE
SUITE= asn1_SUITE.erl
-SUITE_BIN= asn1_bin_SUITE.erl
-SUITE_BIN_V2= asn1_bin_v2_SUITE.erl
-SUITE_SRC= asn1_SUITE.erl.src
-SUITE_BIN_SRC= asn1_bin_SUITE.erl.src
-SUITE_BIN_V2_SRC= asn1_bin_SUITE.erl.src
ERL_FILES= $(MODULES:%=%.erl)
@@ -156,30 +144,10 @@ $(EMAKEFILE): $(ERL_FILES) $(HRL_FILES)
tests debug opt: $(SUITE) $(SUITE_BIN) $(SUITE_BIN_V2) $(EMAKEFILE)
clean:
- rm -f $(SUITE) $(SUITE_BIN) $(SUITE_BIN_V2)
rm -f core
docs:
-#-----------------------------------------------------
-# Special Targets
-#-----------------------------------------------------
-$(SUITE): $(SUITE_SRC)
- sed -e 's;%BIN%;;' -e 's;%PER%;per;' -e 's;%BER%;ber;' $< > $@
- cat asn1_common_SUITE.erl.src >> $@
- cat asn1_particular_SUITE.erl.src >> $@
-
-
-$(SUITE_BIN): $(SUITE_SRC)
- sed -e 's;%BIN%;bin_;' -e 's;%PER%;per_bin;' -e 's;%BER%;ber_bin;' $< > $@
- echo "common() -> []." >> $@
- cat asn1_bin_particular_SUITE.erl.src >> $@
-
-$(SUITE_BIN_V2): $(SUITE_SRC)
- sed -e 's;%BIN%;bin_v2_;' -e 's;%PER%;per_bin;' -e 's;%BER%;ber_bin_v2;' $< > $@
- echo "common() -> []." >> $@
- cat asn1_bin_v2_particular_SUITE.erl.src >> $@
-
# ----------------------------------------------------
# Release Target
# ----------------------------------------------------
@@ -188,17 +156,13 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELSYSDIR)/asn1_SUITE_data
- $(INSTALL_DIR) $(RELSYSDIR)/asn1_bin_SUITE_data
- $(INSTALL_DIR) $(RELSYSDIR)/asn1_bin_v2_SUITE_data
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) asn1.spec asn1.cover $(INSTALL_PROGS) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- cd asn1_SUITE_data; tar cfh $(RELSYSDIR)/asn1_SUITE_data.tar *
- cd $(RELSYSDIR)/asn1_SUITE_data; tar xf $(RELSYSDIR)/asn1_SUITE_data.tar
- cd $(RELSYSDIR)/asn1_bin_SUITE_data; tar xf $(RELSYSDIR)/asn1_SUITE_data.tar
- cd $(RELSYSDIR)/asn1_bin_v2_SUITE_data; tar xf $(RELSYSDIR)/asn1_SUITE_data.tar
- rm $(RELSYSDIR)/asn1_SUITE_data.tar
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELSYSDIR)/asn1_SUITE_data"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) asn1.spec asn1.cover $(INSTALL_PROGS) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ cd asn1_SUITE_data; tar cfh "$(RELSYSDIR)/asn1_SUITE_data.tar" *
+ cd "$(RELSYSDIR)/asn1_SUITE_data"; tar xf "$(RELSYSDIR)/asn1_SUITE_data.tar"
+ rm "$(RELSYSDIR)/asn1_SUITE_data.tar"
release_docs_spec:
diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl
new file mode 100644
index 0000000000..b0c37d79e7
--- /dev/null
+++ b/lib/asn1/test/asn1_SUITE.erl
@@ -0,0 +1,1533 @@
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+%% Purpose: Test suite for the ASN.1 application
+
+-module(asn1_SUITE).
+
+-define(only_per(Func),
+ if Rule == per orelse Rule == per_bin -> Func;
+ true -> ok
+ end).
+-define(only_ber(Func),
+ if Rule == ber orelse Rule == ber_bin orelse Rule == ber_bin_v2 -> Func;
+ true -> ok
+ end).
+-define(only_uper(Func),
+ case Rule of
+ uper_bin -> Func;
+ _ -> ok
+ end).
+-define(only_per_nif(Func),
+ case {Rule, lists:member(optimize, Opts)} of
+ {per_bin, true} -> Func;
+ _ -> ok
+ end).
+-define(only_ber_nif(Func),
+ case {Rule, lists:member(nif, Opts)} of
+ {ber_bin_v2, true} -> Func;
+ _ -> ok
+ end).
+
+-compile(export_all).
+
+-include_lib("test_server/include/test_server.hrl").
+
+%%------------------------------------------------------------------------------
+%% Suite definition
+%%------------------------------------------------------------------------------
+
+suite() -> [{ct_hooks, [ts_install_cth]}].
+
+all() ->
+ [{group, parallel},
+ {group, app_test},
+ {group, appup_test},
+
+ % TODO: Investigate parallel running of these:
+ testComment,
+ testName2Number,
+ ticket_7407,
+ ticket7904,
+
+ {group, performance}].
+
+groups() ->
+ [{compile, parallel([]),
+ [c_syntax,
+ c_string,
+ c_implicit_before_choice]},
+
+ {ber, parallel([]),
+ [ber_choiceinseq,
+ % Uses 'SOpttest'
+ {group, [], [ber_optional,
+ ber_optional_keyed_list]}]},
+
+ {app_test, [], [{asn1_app_test, all}]},
+
+ {appup_test, [], [{asn1_appup_test, all}]},
+
+ {parallel, parallel([]),
+ [{group, compile},
+ {group, ber},
+ % Uses 'P-Record', 'Constraints', 'MEDIA-GATEWAY-CONTROL'...
+ {group, [], [parse,
+ test_driver_load,
+ test_undecoded_rest,
+ test_inline,
+ specialized_decodes,
+ special_decode_performance,
+ testMegaco,
+ testConstraints,
+ testCompactBitString]},
+ default,
+ % Uses 'Def', 'MULTIMEDIA-SYSTEM-CONTROL', 'H323-MESSAGES', 'Prim',
+ % 'Real'
+ {group, [], [testPrim,
+ rtUI,
+ testPrimStrings,
+ testInvokeMod,
+ per,
+ ber_other,
+ h323test,
+ per_GeneralString]},
+ testChoPrim,
+ testChoExtension,
+ testChoOptional,
+ testChoOptionalImplicitTag,
+ testChoRecursive,
+ testChoTypeRefCho,
+ testChoTypeRefPrim,
+ testChoTypeRefSeq,
+ testChoTypeRefSet,
+ testDef,
+ testOpt,
+ testSeqDefault,
+ % Uses 'External'
+ {group, [], [testChoExternal,
+ testPrimExternal,
+ testSeqExtension,
+ testSeqExternal,
+ testSeqOfExternal,
+ testSeqOfTag,
+ testSeqTag,
+ testSetExtension,
+ testSetExternal,
+ testSetOfExternal,
+ testSetOfTag,
+ testSetTag]},
+ testSeqOptional,
+ testSeqPrim,
+ testSeqTypeRefCho,
+ % Uses 'SeqTypeRefPrim'
+ {group, [], [testSeqTypeRefPrim,
+ testTypeValueNotation]},
+ testSeqTypeRefSeq,
+ testSeqTypeRefSet,
+ % Uses 'SeqOf'
+ {group, [], [testSeqOf,
+ testSeqOfIndefinite]}, % Uses 'Mvrasn*'
+ testSeqOfCho,
+ testSetDefault,
+ testExtensionAdditionGroup,
+ testSetOptional,
+ testSetPrim,
+ testSetTypeRefCho,
+ testSetTypeRefPrim,
+ testSetTypeRefSeq,
+ testSetTypeRefSet,
+ testSetOf,
+ testSetOfCho,
+ testEnumExt,
+ value_test,
+ value_bad_enum_test,
+ testSeq2738,
+ % Uses 'Constructed'
+ {group, [], [constructed,
+ ber_decode_error]},
+ % Uses 'SeqSetIndefinite'
+ {group, [], [testSeqIndefinite,
+ testSetIndefinite]},
+ testChoiceIndefinite,
+ per_open_type,
+ testInfObjectClass,
+ testParameterizedInfObj,
+ testMergeCompile,
+ testobj,
+ testDeepTConstr,
+ testExport,
+ testImport,
+ % Uses 'ParamBasic'
+ {group, [], [testParamBasic,
+ testDER]},
+ testMvrasn6,
+ testContextSwitchingTypes,
+ testOpenTypeImplicitTag,
+ duplicate_tags,
+ testROSE,
+ testINSTANCE_OF,
+ testTCAP,
+ test_ParamTypeInfObj,
+ test_WS_ParamClass,
+ test_Defed_ObjectIdentifier,
+ testSelectionType,
+ testSSLspecs,
+ testNortel,
+ % Uses 'PKCS7'
+ {group, [], [test_modified_x420,
+ testX420]},
+ testTcapsystem,
+ testNBAPsystem,
+ test_compile_options,
+ testDoubleEllipses,
+ test_x691,
+ ticket_6143,
+ testExtensionAdditionGroup,
+ test_OTP_9688]},
+
+ {performance, [],
+ [testTimer_ber,
+ testTimer_ber_bin,
+ testTimer_ber_bin_opt,
+ testTimer_ber_bin_opt_driver,
+ testTimer_per,
+ testTimer_per_bin,
+ testTimer_per_bin_opt,
+ testTimer_uper_bin,
+ smp]}].
+
+parallel(Options) ->
+ case erlang:system_info(smp_support) andalso
+ erlang:system_info(schedulers) > 1 of
+ true -> [parallel|Options];
+ false -> Options
+ end.
+
+%%------------------------------------------------------------------------------
+%% Init/end
+%%------------------------------------------------------------------------------
+
+init_per_suite(Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ true = code:add_patha(PrivDir),
+ Config.
+
+end_per_suite(_Config) ->
+ ok.
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+init_per_testcase(Func, Config) ->
+ CaseDir = filename:join([?config(priv_dir, Config), ?MODULE, Func]),
+ ok = filelib:ensure_dir(filename:join([CaseDir, dummy_file])),
+ true = code:add_patha(CaseDir),
+
+ Dog = case Func of
+ testX420 -> test_server:timetrap({minutes, 90});
+ _ -> test_server:timetrap({minutes, 60})
+ end,
+ [{case_dir, CaseDir}, {watchdog, Dog}|Config].
+
+end_per_testcase(_Func, Config) ->
+ code:del_path(?config(case_dir, Config)),
+ test_server:timetrap_cancel(?config(watchdog, Config)).
+
+%%------------------------------------------------------------------------------
+%% Test runners
+%%------------------------------------------------------------------------------
+
+test(Config, TestF) ->
+ test(Config, TestF, [per,
+ per_bin,
+ {per_bin, [optimize]},
+ uper_bin,
+ ber,
+ ber_bin,
+ ber_bin_v2,
+ % TODO: {ber_bin_v2, [optimize, nif]} ?
+ {ber_bin_v2, [nif]}]).
+
+test(Config, TestF, Rules) ->
+ Fun = fun(C, R, O) ->
+ M = element(2, erlang:fun_info(TestF, module)),
+ F = element(2, erlang:fun_info(TestF, name)),
+ io:format("Running ~p:~p with ~p...~n", [M, F, {R, O}]),
+ try
+ TestF(C, R, O)
+ catch
+ Class:Reason ->
+ NewReason = {Reason, [{rule, R}, {options, O}]},
+ erlang:raise(Class, NewReason,
+ erlang:get_stacktrace())
+ end
+ end,
+ Result = [run_case(Config, Fun, rule(Rule), opts(Rule)) || Rule <- Rules],
+ case lists:usort(Result) of
+ [true|_Skips] -> true; % At least one test ran
+ Skips -> {skip, [R || {skip, R} <- Skips]} % All skipped
+ end.
+
+rule(A) when is_atom(A) -> A;
+rule({A, _Opts} ) -> A.
+
+opts(Rule) when is_atom(Rule) -> [];
+opts({_Rule, Opts}) -> Opts.
+
+run_case(Config, Fun, Rule, Opts) ->
+ CaseDir = ?config(case_dir, Config),
+ Dir = filename:join([CaseDir, join(Rule, Opts)]),
+ ok = filelib:ensure_dir(filename:join([Dir, dummy_file])),
+ replace_path(CaseDir, Dir),
+ NewConfig = lists:keyreplace(case_dir, 1, Config, {case_dir, Dir}),
+
+ % Run the actual test function
+ Result = Fun(NewConfig, Rule, Opts),
+
+ replace_path(Dir, CaseDir),
+ case Result of
+ {skip, _Reason} -> Result;
+ _ -> true
+ end.
+
+replace_path(PathA, PathB) ->
+ true = code:del_path(PathA),
+ true = code:add_patha(PathB).
+
+join(Rule, Opts) ->
+ string:join([atom_to_list(Rule)|lists:map(fun atom_to_list/1, Opts)], "_").
+
+case_dir([], _Dir) ->
+ exit(no_case_dir);
+case_dir([{case_dir, _}|Config], Dir) ->
+ [{case_dir, Dir}|Config];
+case_dir([C|Config], Opt) ->
+ [C|case_dir(Config, Opt)].
+
+%%------------------------------------------------------------------------------
+%% Test cases
+%%------------------------------------------------------------------------------
+
+testPrim(Config) -> test(Config, fun testPrim/3).
+testPrim(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["Prim", "Real"], Config, [Rule|Opts]),
+ testPrim:bool(Rule),
+ testPrim:int(Rule),
+ testPrim:enum(Rule),
+ testPrim:obj_id(Rule),
+ testPrim:rel_oid(Rule),
+ testPrim:null(Rule),
+ testPrim:real(Rule).
+
+testCompactBitString(Config) -> test(Config, fun testCompactBitString/3).
+testCompactBitString(Config, Rule, Opts) ->
+ asn1_test_lib:compile("PrimStrings", Config,
+ [Rule, compact_bit_string|Opts]),
+ testCompactBitString:compact_bit_string(Rule),
+ ?only_uper(testCompactBitString:bit_string_unnamed(Rule)),
+ ?only_per(testCompactBitString:bit_string_unnamed(Rule)),
+ ?only_per_nif(testCompactBitString:ticket_7734(Rule)),
+ ?only_per_nif(asn1_test_lib:compile("Constraints", Config,
+ [Rule, compact_bit_string|Opts])),
+ ?only_per_nif(testCompactBitString:otp_4869(Rule)).
+
+testPrimStrings(Config) -> test(Config, fun testPrimStrings/3).
+testPrimStrings(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["PrimStrings", "BitStr"], Config, [Rule|Opts]),
+ testPrimStrings_cases(Rule),
+ ?only_ber(testPrimStrings:more_strings(Rule)).
+
+testPrimStrings_cases(Rule) ->
+ testPrimStrings:bit_string(Rule),
+ testPrimStrings:bit_string_unnamed(Rule),
+ testPrimStrings:octet_string(Rule),
+ testPrimStrings:numeric_string(Rule),
+ testPrimStrings:other_strings(Rule),
+ testPrimStrings:universal_string(Rule),
+ testPrimStrings:bmp_string(Rule),
+ testPrimStrings:times(Rule),
+ testPrimStrings:utf8_string(Rule).
+
+testPrimExternal(Config) -> test(Config, fun testPrimExternal/3).
+testPrimExternal(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["External", "PrimExternal"], Config,
+ [Rule|Opts]),
+ testPrimExternal:external(Rule),
+ ?only_ber_nif(asn1_test_lib:compile_all(["PrimStrings", "BitStr"], Config,
+ [Rule|Opts])),
+ ?only_ber_nif(testPrimStrings_cases(Rule)),
+ ?only_ber_nif(testPrimStrings:more_strings(Rule)).
+
+testChoPrim(Config) -> test(Config, fun testChoPrim/3).
+testChoPrim(Config, Rule, Opts) ->
+ asn1_test_lib:compile("ChoPrim", Config, [Rule|Opts]),
+ testChoPrim:bool(Rule),
+ testChoPrim:int(Rule).
+
+testChoExtension(Config) -> test(Config, fun testChoExtension/3).
+testChoExtension(Config, Rule, Opts) ->
+ asn1_test_lib:compile("ChoExtension", Config, [Rule|Opts]),
+ testChoExtension:extension(Rule).
+
+testChoExternal(Config) -> test(Config, fun testChoExternal/3).
+testChoExternal(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["External", "ChoExternal"], Config, [Rule|Opts]),
+ testChoExternal:external(Rule).
+
+testChoOptional(Config) -> test(Config, fun testChoOptional/3).
+testChoOptional(Config, Rule, Opts) ->
+ asn1_test_lib:compile("ChoOptional", Config, [Rule|Opts]),
+ testChoOptional:optional(Rule).
+
+testChoOptionalImplicitTag(Config) ->
+ test(Config, fun testChoOptionalImplicitTag/3,
+ [ber, ber_bin, ber_bin_v2]).
+testChoOptionalImplicitTag(Config, Rule, Opts) ->
+ %% Only meaningful for ber & co
+ asn1_test_lib:compile("ChoOptionalImplicitTag", Config, [Rule|Opts]),
+ testChoOptionalImplicitTag:optional(Rule).
+
+testChoRecursive(Config) -> test(Config, fun testChoRecursive/3).
+testChoRecursive(Config, Rule, Opts) ->
+ asn1_test_lib:compile("ChoRecursive", Config, [Rule|Opts]),
+ testChoRecursive:recursive(Rule).
+
+testChoTypeRefCho(Config) -> test(Config, fun testChoTypeRefCho/3).
+testChoTypeRefCho(Config, Rule, Opts) ->
+ asn1_test_lib:compile("ChoTypeRefCho", Config, [Rule|Opts]),
+ testChoTypeRefCho:choice(Rule).
+
+testChoTypeRefPrim(Config) -> test(Config, fun testChoTypeRefPrim/3).
+testChoTypeRefPrim(Config, Rule, Opts) ->
+ asn1_test_lib:compile("ChoTypeRefPrim", Config, [Rule|Opts]),
+ testChoTypeRefPrim:prim(Rule).
+
+testChoTypeRefSeq(Config) -> test(Config, fun testChoTypeRefSeq/3).
+testChoTypeRefSeq(Config, Rule, Opts) ->
+ asn1_test_lib:compile("ChoTypeRefSeq", Config, [Rule|Opts]),
+ testChoTypeRefSeq:seq(Rule).
+
+testChoTypeRefSet(Config) -> test(Config, fun testChoTypeRefSet/3).
+testChoTypeRefSet(Config, Rule, Opts) ->
+ asn1_test_lib:compile("ChoTypeRefSet", Config, [Rule|Opts]),
+ testChoTypeRefSet:set(Rule).
+
+testDef(Config) -> test(Config, fun testDef/3).
+testDef(Config, Rule, Opts) ->
+ asn1_test_lib:compile("Def", Config, [Rule|Opts]),
+ testDef:main(Rule).
+
+testOpt(Config) -> test(Config, fun testOpt/3).
+testOpt(Config, Rule, Opts) ->
+ asn1_test_lib:compile("Opt", Config, [Rule|Opts]),
+ testOpt:main(Rule).
+
+testEnumExt(Config) -> test(Config, fun testEnumExt/3).
+testEnumExt(Config, Rule, Opts) ->
+ asn1_test_lib:compile("EnumExt", Config, [Rule|Opts]),
+ testEnumExt:main(Rule).
+
+%% Test of OTP-2523 ENUMERATED with extensionmark.
+testSeqDefault(Config) -> test(Config, fun testSeqDefault/3).
+testSeqDefault(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SeqDefault", Config, [Rule|Opts]),
+ testSeqDefault:main(Rule).
+
+testSeqExtension(Config) -> test(Config, fun testSeqExtension/3).
+testSeqExtension(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["External", "SeqExtension"], Config,
+ [Rule|Opts]),
+ testSeqExtension:main(Rule).
+
+testSeqExternal(Config) -> test(Config, fun testSeqExternal/3).
+testSeqExternal(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["External", "SeqExternal"], Config, [Rule|Opts]),
+ testSeqExternal:main(Rule).
+
+testSeqOptional(Config) -> test(Config, fun testSeqOptional/3).
+testSeqOptional(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SeqOptional", Config, [Rule|Opts]),
+ testSeqOptional:main(Rule).
+
+testSeqPrim(Config) -> test(Config, fun testSeqPrim/3).
+testSeqPrim(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SeqPrim", Config, [Rule|Opts]),
+ testSeqPrim:main(Rule).
+
+%% Test of OTP-2738 Detect corrupt optional component.
+testSeq2738(Config) -> test(Config, fun testSeq2738/3).
+testSeq2738(Config, Rule, Opts) ->
+ asn1_test_lib:compile("Seq2738", Config, [Rule|Opts]),
+ testSeq2738:main(Rule).
+
+testSeqTag(Config) -> test(Config, fun testSeqTag/3).
+testSeqTag(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["External", "SeqTag"], Config, [Rule|Opts]),
+ testSeqTag:main(Rule).
+
+testSeqTypeRefCho(Config) -> test(Config, fun testSeqTypeRefCho/3).
+testSeqTypeRefCho(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SeqTypeRefCho", Config, [Rule|Opts]),
+ testSeqTypeRefCho:main(Rule).
+
+testSeqTypeRefPrim(Config) -> test(Config, fun testSeqTypeRefPrim/3).
+testSeqTypeRefPrim(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SeqTypeRefPrim", Config, [Rule|Opts]),
+ testSeqTypeRefPrim:main(Rule).
+
+testSeqTypeRefSeq(Config) -> test(Config, fun testSeqTypeRefSeq/3).
+testSeqTypeRefSeq(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SeqTypeRefSeq", Config, [Rule|Opts]),
+ testSeqTypeRefSeq:main(Rule).
+
+testSeqTypeRefSet(Config) -> test(Config, fun testSeqTypeRefSet/3).
+testSeqTypeRefSet(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SeqTypeRefSet", Config, [Rule|Opts]),
+ testSeqTypeRefSet:main(Rule).
+
+testSeqOf(Config) -> test(Config, fun testSeqOf/3).
+testSeqOf(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["SeqOf", "SeqOfEnum", "XSeqOf"], Config,
+ [Rule|Opts]),
+ testSeqOf:main(Rule).
+
+testSeqOfCho(Config) -> test(Config, fun testSeqOfCho/3).
+testSeqOfCho(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SeqOfCho", Config, [Rule|Opts]),
+ testSeqOfCho:main(Rule).
+
+testSeqOfIndefinite(Config) ->
+ test(Config, fun testSeqOfIndefinite/3,
+ [ber, ber_bin, ber_bin_v2, {ber_bin_v2, [nif]}]).
+testSeqOfIndefinite(Config, Rule, Opts) ->
+ Files = ["Mvrasn-Constants-1", "Mvrasn-DataTypes-1", "Mvrasn-21-4",
+ "Mvrasn-20-4", "Mvrasn-19-4", "Mvrasn-18-4", "Mvrasn-17-4",
+ "Mvrasn-15-4", "Mvrasn-14-4", "Mvrasn-11-4", "SeqOf"],
+ asn1_test_lib:compile_all(Files, Config, [Rule|Opts]),
+ testSeqOfIndefinite:main().
+
+testSeqOfExternal(Config) -> test(Config, fun testSeqOfExternal/3).
+testSeqOfExternal(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["External", "SeqOfExternal"], Config,
+ [Rule|Opts]),
+ testSeqOfExternal:main(Rule).
+
+testSeqOfTag(Config) -> test(Config, fun testSeqOfTag/3).
+testSeqOfTag(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["External", "SeqOfTag"], Config, [Rule|Opts]),
+ testSeqOfTag:main(Rule).
+
+testSetDefault(Config) -> test(Config, fun testSetDefault/3).
+testSetDefault(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SetDefault", Config, [Rule|Opts]),
+ testSetDefault:main(Rule).
+
+testParamBasic(Config) -> test(Config, fun testParamBasic/3).
+testParamBasic(Config, Rule, Opts) ->
+ asn1_test_lib:compile("ParamBasic", Config, [Rule|Opts]),
+ testParamBasic:main(Rule).
+
+testSetExtension(Config) -> test(Config, fun testSetExtension/3).
+testSetExtension(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["External", "SetExtension"], Config,
+ [Rule|Opts]),
+ testSetExtension:main(Rule).
+
+testSetExternal(Config) -> test(Config, fun testSetExternal/3).
+testSetExternal(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["External", "SetExternal"], Config, [Rule|Opts]),
+ testSetExternal:main(Rule).
+
+testSetOptional(Config) -> test(Config, fun testSetOptional/3).
+testSetOptional(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SetOptional", Config, [Rule|Opts]),
+ testSetOptional:ticket_7533(Rule),
+ testSetOptional:main(Rule).
+
+testSetPrim(Config) -> test(Config, fun testSetPrim/3).
+testSetPrim(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SetPrim", Config, [Rule|Opts]),
+ testSetPrim:main(Rule).
+
+testSetTag(Config) -> test(Config, fun testSetTag/3).
+testSetTag(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["External", "SetTag"], Config, [Rule|Opts]),
+ testSetTag:main(Rule).
+
+testSetTypeRefCho(Config) -> test(Config, fun testSetTypeRefCho/3).
+testSetTypeRefCho(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SetTypeRefCho", Config, [Rule|Opts]),
+ testSetTypeRefCho:main(Rule).
+
+testSetTypeRefPrim(Config) -> test(Config, fun testSetTypeRefPrim/3).
+testSetTypeRefPrim(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SetTypeRefPrim", Config, [Rule|Opts]),
+ testSetTypeRefPrim:main(Rule).
+
+testSetTypeRefSeq(Config) -> test(Config, fun testSetTypeRefSeq/3).
+testSetTypeRefSeq(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SetTypeRefSeq", Config, [Rule|Opts]),
+ testSetTypeRefSeq:main(Rule).
+
+testSetTypeRefSet(Config) -> test(Config, fun testSetTypeRefSet/3).
+testSetTypeRefSet(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SetTypeRefSet", Config, [Rule|Opts]),
+ testSetTypeRefSet:main(Rule).
+
+testSetOf(Config) -> test(Config, fun testSetOf/3).
+testSetOf(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SetOf", Config, [Rule|Opts]),
+ testSetOf:main(Rule).
+
+testSetOfCho(Config) -> test(Config, fun testSetOfCho/3).
+testSetOfCho(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SetOfCho", Config, [Rule|Opts]),
+ testSetOfCho:main(Rule).
+
+testSetOfExternal(Config) -> test(Config, fun testSetOfExternal/3).
+testSetOfExternal(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["External", "SetOfExternal"], Config,
+ [Rule|Opts]),
+ testSetOfExternal:main(Rule).
+
+testSetOfTag(Config) -> test(Config, fun testSetOfTag/3).
+testSetOfTag(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["External", "SetOfTag"], Config, [Rule|Opts]),
+ testSetOfTag:main(Rule).
+
+c_syntax(Config) ->
+ DataDir = ?config(data_dir, Config),
+ [{error, _} = asn1ct:compile(filename:join(DataDir, F))
+ || F <-["Syntax",
+ "BadTypeEnding",
+ "BadValueAssignment1",
+ "BadValueAssignment2",
+ "BadValueSet",
+ "ChoiceBadExtension",
+ "EnumerationBadExtension",
+ "Example",
+ "Export1",
+ "MissingEnd",
+ "SequenceBadComma",
+ "SequenceBadComponentName",
+ "SequenceBadComponentType",
+ "SeqBadComma"]].
+
+c_string(Config) ->
+ test(Config, fun c_string/3, [per, per_bin, ber, ber_bin, ber_bin_v2]).
+c_string(Config, Rule, Opts) ->
+ asn1_test_lib:compile("String", Config, [Rule|Opts]).
+
+c_implicit_before_choice(Config) ->
+ test(Config, fun c_implicit_before_choice/3,
+ [ber, ber_bin, ber_bin_v2]).
+c_implicit_before_choice(Config, Rule, Opts) ->
+ DataDir = ?config(data_dir, Config),
+ CaseDir = ?config(case_dir, Config),
+ {error, _R2} = asn1ct:compile(filename:join(DataDir, "CCSNARG3"),
+ [Rule, {outdir, CaseDir}|Opts]).
+
+parse(Config) ->
+ [asn1_test_lib:compile(M, Config, [abs]) || M <- test_modules()].
+
+per(Config) ->
+ test(Config, fun per/3, [per, per_bin, {per_bin, [optimize]}]).
+per(Config, Rule, Opts) ->
+ [module_test(M, Config, Rule, Opts) || M <- per_modules()].
+
+ber_other(Config) ->
+ test(Config, fun ber_other/3, [ber, ber_bin, ber_bin_v2]).
+ber_other(Config, Rule, Opts) ->
+ [module_test(M, Config, Rule, Opts) || M <- ber_modules()].
+
+
+module_test(M, Config, Rule, Opts) ->
+ asn1_test_lib:compile(M, Config, [Rule|Opts]),
+ case asn1ct:test(list_to_atom(M), [{i, ?config(case_dir, Config)}]) of
+ ok -> ok;
+ Error ->
+ erlang:error({test_failed, M, Opts, Error})
+ end.
+
+
+ber_choiceinseq(Config) ->
+ test(Config, fun ber_choiceinseq/3, [ber, ber_bin, ber_bin_v2]).
+ber_choiceinseq(Config, Rule, Opts) ->
+ asn1_test_lib:compile("ChoiceInSeq", Config, [Rule|Opts]).
+
+ber_optional(Config) ->
+ test(Config, fun ber_optional/3, [ber, ber_bin, ber_bin_v2]).
+ber_optional(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SOpttest", Config, [Rule|Opts]),
+ V = {'S', {'A', 10, asn1_NOVALUE, asn1_NOVALUE},
+ {'B', asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE},
+ {'C', asn1_NOVALUE, 111, asn1_NOVALUE}},
+ {ok, B} = asn1_wrapper:encode('SOpttest', 'S', V),
+ Bytes = lists:flatten(B),
+ V2 = asn1_wrapper:decode('SOpttest', 'S', Bytes),
+ V = element(2, V2).
+
+ber_optional_keyed_list(Config) ->
+ test(Config, fun ber_optional_keyed_list/3, [ber, ber_bin]).
+ber_optional_keyed_list(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SOpttest", Config, [Rule, keyed_list|Opts]),
+ Vrecord = {'S', {'A', 10, asn1_NOVALUE, asn1_NOVALUE},
+ {'B', asn1_NOVALUE, asn1_NOVALUE, asn1_NOVALUE},
+ {'C', asn1_NOVALUE, 111, asn1_NOVALUE}},
+ V = [{a, [{scriptKey, 10}]},
+ {b, []},
+ {c, [{callingPartysCategory, 111}]}],
+ {ok, B} = asn1_wrapper:encode('SOpttest', 'S', V),
+ Bytes = lists:flatten(B),
+ V2 = asn1_wrapper:decode('SOpttest', 'S', Bytes),
+ Vrecord = element(2, V2).
+
+%% records used by test-case default
+-record('Def1', {bool0,
+ bool1 = asn1_DEFAULT,
+ bool2 = asn1_DEFAULT,
+ bool3 = asn1_DEFAULT}).
+
+default(Config) -> test(Config, fun default/3).
+default(Config, Rule, Opts) ->
+ asn1_test_lib:compile("Def", Config, [Rule|Opts]),
+ {ok, Bytes1} = asn1_wrapper:encode('Def', 'Def1', #'Def1'{bool0 = true}),
+ {ok, {'Def1', true, false, false, false}} =
+ asn1_wrapper:decode('Def', 'Def1', lists:flatten(Bytes1)),
+
+ {ok, Bytes2} = asn1_wrapper:encode('Def', 'Def1', #'Def1'{bool0 = true,
+ bool2 = false}),
+ {ok, {'Def1', true, false, false, false}} =
+ asn1_wrapper:decode('Def', 'Def1', lists:flatten(Bytes2)).
+
+value_test(Config) -> test(Config, fun value_test/3).
+value_test(Config, Rule, Opts) ->
+ asn1_test_lib:compile("ObjIdValues", Config, [Rule|Opts]),
+ {ok, _} = asn1ct:test('ObjIdValues', 'ObjIdType',
+ 'ObjIdValues':'mobileDomainId'()).
+
+value_bad_enum_test(Config) ->
+ case ?MODULE of
+ asn1_SUITE ->
+ {error, _} = asn1ct:compile(?config(data_dir, Config)
+ ++ "BadEnumValue1",
+ [{outdir, ?config(case_dir, Config)}]);
+ _ -> {skip, "Runs in asn1_SUITE only"}
+ end.
+
+constructed(Config) ->
+ test(Config, fun constructed/3, [ber, ber_bin, ber_bin_v2]).
+constructed(Config, Rule, Opts) ->
+ asn1_test_lib:compile("Constructed", Config, [Rule|Opts]),
+ {ok, B} = asn1_wrapper:encode('Constructed', 'S', {'S', false}),
+ [40, 3, 1, 1, 0] = lists:flatten(B),
+ {ok, B1} = asn1_wrapper:encode('Constructed', 'S2', {'S2', false}),
+ [40, 5, 48, 3, 1, 1, 0] = lists:flatten(B1),
+ {ok, B2} = asn1_wrapper:encode('Constructed', 'I', 10),
+ [136, 1, 10] = lists:flatten(B2).
+
+ber_decode_error(Config) ->
+ test(Config, fun ber_decode_error/3, [ber, ber_bin, ber_bin_v2]).
+ber_decode_error(Config, Rule, Opts) ->
+ asn1_test_lib:compile("Constructed", Config, [Rule|Opts]),
+ ber_decode_error:run(Opts).
+
+h323test(Config) -> test(Config, fun h323test/3).
+h323test(Config, Rule, Opts) ->
+ Files = ["H235-SECURITY-MESSAGES", "H323-MESSAGES",
+ "MULTIMEDIA-SYSTEM-CONTROL"],
+ asn1_test_lib:compile_all(Files, Config, [Rule|Opts]),
+ h323test:run(Rule).
+
+per_GeneralString(Config) ->
+ test(Config, fun per_GeneralString/3, [per, per_bin]).
+per_GeneralString(Config, Rule, Opts) ->
+ asn1_test_lib:compile("MULTIMEDIA-SYSTEM-CONTROL", Config, [Rule|Opts]),
+ UI = [109, 64, 1, 57],
+ {ok, _V} = asn1_wrapper:decode('MULTIMEDIA-SYSTEM-CONTROL',
+ 'MultimediaSystemControlMessage', UI).
+
+per_open_type(Config) -> test(Config, fun per_open_type/3, [per, per_bin]).
+per_open_type(Config, Rule, Opts) ->
+ asn1_test_lib:compile("OpenType", Config, [Rule|Opts]),
+ {ok, _} = asn1ct:test('OpenType', 'Ot', {'Stype', 10, true}).
+
+testConstraints(Config) -> test(Config, fun testConstraints/3).
+testConstraints(Config, Rule, Opts) ->
+ asn1_test_lib:compile("Constraints", Config, [Rule|Opts]),
+ asn1_test_lib:compile("LargeConstraints", Config, [Rule|Opts]),
+ testConstraints:int_constraints(Rule).
+
+
+testSeqIndefinite(Config) ->
+ test(Config, fun testSeqIndefinite/3, [ber, ber_bin, ber_bin_v2,
+ {ber_bin_v2, [nif]}]).
+testSeqIndefinite(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SeqSetIndefinite", Config, [Rule|Opts]),
+ testSeqIndefinite:main(Rule).
+
+
+testSetIndefinite(Config) ->
+ test(Config, fun testSetIndefinite/3, [ber, ber_bin, ber_bin_v2,
+ {ber_bin_v2, [nif]}]).
+testSetIndefinite(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SeqSetIndefinite", Config, [Rule|Opts]),
+ testSetIndefinite:main(Rule).
+
+
+testChoiceIndefinite(Config) ->
+ test(Config, fun testChoiceIndefinite/3, [ber, ber_bin, ber_bin_v2,
+ {ber_bin_v2, [nif]}]).
+testChoiceIndefinite(Config, Rule, Opts) ->
+ asn1_test_lib:compile("ChoiceIndef", Config, [Rule|Opts]),
+ testChoiceIndefinite:main(Rule).
+
+testInfObjectClass(Config) -> test(Config, fun testInfObjectClass/3).
+testInfObjectClass(Config, Rule, Opts) ->
+ Files = ["ErrorClass", "InfClass"],
+ InfObjFiles = ["RANAPextract1", "InfObj", "MAP-ExtensionDataTypes",
+ "Objects", "INAPv2extract"],
+ RANAPFiles = ["RANAP-CommonDataTypes", "RANAP-Constants",
+ "RANAP-Containers", "RANAP-IEs", "RANAP-PDU-Contents",
+ "RANAP-PDU-Descriptions"],
+ asn1_test_lib:compile_all(Files ++ InfObjFiles ++ RANAPFiles, Config,
+ [Rule|Opts]),
+ testInfObjectClass:main(Rule),
+ testInfObj:main(Rule).
+
+testParameterizedInfObj(Config) ->
+ test(Config, fun testParameterizedInfObj/3).
+testParameterizedInfObj(Config, Rule, Opts) ->
+ asn1_test_lib:compile("Param", Config, [Rule|Opts]),
+ testParameterizedInfObj:main(Rule).
+
+testMergeCompile(Config) -> test(Config, fun testMergeCompile/3).
+testMergeCompile(Config, Rule, Opts) ->
+ Files = ["MS.set.asn", "RANAPSET.set.asn1", "Mvrasn4.set.asn",
+ "Mvrasn6.set.asn"],
+ asn1_test_lib:compile_all(Files, Config, [Rule|Opts]),
+ testMergeCompile:main(Rule),
+ testMergeCompile:mvrasn(Rule).
+
+testobj(Config) -> test(Config, fun testobj/3).
+testobj(Config, Rule, Opts) ->
+ asn1_test_lib:compile("RANAP", Config, [Rule|Opts]),
+ asn1_test_lib:compile_erlang("testobj", Config, []),
+ ok = testobj:run(),
+ ok = testParameterizedInfObj:ranap(Rule).
+
+testDeepTConstr(Config) -> test(Config, fun testDeepTConstr/3).
+testDeepTConstr(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["TConstrChoice", "TConstr"], Config,
+ [Rule|Opts]),
+ testDeepTConstr:main(Rule).
+
+testInvokeMod(Config) -> test(Config, fun testInvokeMod/3).
+testInvokeMod(Config, Rule, Opts) ->
+ asn1_test_lib:compile("PrimStrings", Config, [Rule|Opts]),
+ {ok, _Result2} = 'PrimStrings':encode('Bs1', [1, 0, 1, 0]).
+
+testExport(Config) ->
+ case ?MODULE of
+ asn1_SUITE ->
+ {error, {asn1, _Reason}} =
+ asn1ct:compile(filename:join(?config(data_dir, Config),
+ "IllegalExport"),
+ [{outdir, ?config(case_dir, Config)}]);
+ _ ->
+ {skip, "Runs in asn1_SUITE only"}
+ end.
+
+testImport(Config) ->
+ test(Config, fun testImport/3, [ber, ber_bin, ber_bin_v2]).
+testImport(Config, Rule, Opts) ->
+ {error, _} = asn1ct:compile(filename:join(?config(data_dir, Config),
+ "ImportsFrom"),
+ [Rule, {outdir, ?config(priv_dir, Config)}
+ |Opts]).
+
+testMegaco(Config) -> test(Config, fun testMegaco/3).
+testMegaco(Config, Rule, Opts) ->
+ {ok, Module1, Module2} = testMegaco:compile(Config, Rule, Opts),
+ ok = testMegaco:main(Module1, Config),
+ ok = testMegaco:main(Module2, Config).
+
+testMvrasn6(Config) -> test(Config, fun testMvrasn6/3).
+testMvrasn6(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["Mvrasn-21-4", "Mvrasn-20-6", "Mvrasn-19-6",
+ "Mvrasn-15-6", "Mvrasn-18-6", "Mvrasn-14-6",
+ "Mvrasn-11-6"], Config, [Rule|Opts]).
+
+testContextSwitchingTypes(Config) ->
+ test(Config, fun testContextSwitchingTypes/3).
+testContextSwitchingTypes(Config, Rule, Opts) ->
+ asn1_test_lib:compile("ContextSwitchingTypes", Config, [Rule|Opts]),
+ testContextSwitchingTypes:test(Config).
+
+testTypeValueNotation(Config) -> test(Config, fun testTypeValueNotation/3).
+testTypeValueNotation(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["SeqTypeRefPrim", "ValueTest"], Config,
+ [Rule|Opts]),
+ testTypeValueNotation:main(Rule, Opts).
+
+testOpenTypeImplicitTag(Config) ->
+ test(Config, fun testOpenTypeImplicitTag/3).
+testOpenTypeImplicitTag(Config, Rule, Opts) ->
+ asn1_test_lib:compile("OpenTypeImplicitTag", Config, [Rule|Opts]),
+ testOpenTypeImplicitTag:main(Rule).
+
+duplicate_tags(Config) ->
+ case ?MODULE of
+ asn1_SUITE ->
+ DataDir = ?config(data_dir, Config),
+ CaseDir = ?config(case_dir, Config),
+ {error, {asn1, [{error, {type, _, _, 'SeqOpt1Imp', {asn1, {duplicates_of_the_tags, _}}}}]}} =
+ asn1ct:compile(filename:join(DataDir, "SeqOptional2"),
+ [abs, {outdir, CaseDir}]);
+ _ ->
+ {skip, "Runs in asn1_SUITE only"}
+ end.
+
+rtUI(Config) -> test(Config, fun rtUI/3, [per, per_bin, ber,
+ ber_bin, ber_bin_v2]).
+rtUI(Config, Rule, Opts) ->
+ asn1_test_lib:compile("Prim", Config, [Rule|Opts]),
+ {ok, _} = asn1rt:info('Prim').
+
+testROSE(Config) -> test(Config, fun testROSE/3).
+testROSE(Config, Rule, Opts) ->
+ asn1_test_lib:compile("Remote-Operations-Merged.set.asn1", Config,
+ [Rule|Opts]).
+
+testINSTANCE_OF(Config) -> test(Config, fun testINSTANCE_OF/3).
+testINSTANCE_OF(Config, Rule, Opts) ->
+ asn1_test_lib:compile("INSTANCEOF.asn1", Config, [Rule|Opts]),
+ testINSTANCE_OF:main(Rule).
+
+testTCAP(Config) ->
+ test(Config, fun testTCAP/3,
+ [ber, ber_bin, ber_bin_v2, {ber_bin_v2, [nif]}]).
+testTCAP(Config, Rule, Opts) ->
+ testTCAP:compile(Config, [Rule|Opts]),
+ testTCAP:test(Rule, Config),
+ case Rule of
+ ber_bin_v2 -> testTCAP:compile_asn1config(Config, [Rule, asn1config]),
+ testTCAP:test_asn1config();
+ _ -> ok
+ end.
+
+testDER(Config) ->
+ test(Config, fun testDER/3, [ber, ber_bin, ber_bin_v2]).
+testDER(Config, Rule, Opts) ->
+ asn1_test_lib:compile("DERSpec", Config, [Rule, der|Opts]),
+ testDER:test(),
+ asn1_test_lib:compile("ParamBasic", Config, [Rule, der|Opts]),
+ testParamBasic:main(der),
+ asn1_test_lib:compile("Default", Config, [Rule, der|Opts]),
+ testSeqSetDefaultVal:main(Rule).
+
+specialized_decodes(Config) ->
+ test(Config, fun specialized_decodes/3, [ber_bin_v2]).
+specialized_decodes(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["PartialDecSeq.asn",
+ "PartialDecSeq2.asn",
+ "PartialDecSeq3.asn",
+ "PartialDecMyHTTP.asn",
+ "MEDIA-GATEWAY-CONTROL.asn",
+ "P-Record"],
+ Config, [Rule, optimize, asn1config|Opts]),
+ test_partial_incomplete_decode:test(Config),
+ test_selective_decode:test().
+
+special_decode_performance(Config) ->
+ test(Config, fun special_decode_performance/3,
+ [{ber_bin, [optimize]}, {ber_bin_v2, [optimize, nif]}]).
+special_decode_performance(Config, Rule, Opts) ->
+ Files = ["MEDIA-GATEWAY-CONTROL", "PartialDecSeq"],
+ asn1_test_lib:compile_all(Files, Config, [Rule, asn1config|Opts]),
+ test_special_decode_performance:go(all).
+
+
+test_driver_load(Config) ->
+ test(Config, fun test_driver_load/3, [{per_bin, [optimize]}]).
+test_driver_load(Config, Rule, Opts) ->
+ asn1_test_lib:compile("P-Record", Config, [Rule|Opts]),
+ test_driver_load:test(5).
+
+test_ParamTypeInfObj(Config) ->
+ asn1_test_lib:compile("IN-CS-1-Datatypes", Config, [ber_bin]).
+
+test_WS_ParamClass(Config) ->
+ asn1_test_lib:compile("InformationFramework", Config, [ber_bin]).
+
+test_Defed_ObjectIdentifier(Config) ->
+ asn1_test_lib:compile("UsefulDefinitions", Config, [ber_bin]).
+
+testSelectionType(Config) -> test(Config, fun testSelectionType/3).
+testSelectionType(Config, Rule, Opts) ->
+ asn1_test_lib:compile("SelectionType", Config, [Rule|Opts]),
+ {ok, _} = testSelectionTypes:test().
+
+testSSLspecs(Config) ->
+ test(Config, fun testSSLspecs/3, [ber, ber_bin, ber_bin_v2, {ber_bin_v2, [optimize]}]).
+testSSLspecs(Config, Rule, Opts) ->
+ ok = testSSLspecs:compile(Config,
+ [Rule, compact_bit_string, der|Opts]),
+ testSSLspecs:run(Rule),
+
+ case code:which(asn1ct) of
+ cover_compiled ->
+ ok;
+ _ ->
+ ok = testSSLspecs:compile_inline(Config, Rule),
+ ok = testSSLspecs:run_inline(Rule)
+ end.
+
+testNortel(Config) -> test(Config, fun testNortel/3).
+testNortel(Config, Rule, Opts) ->
+ asn1_test_lib:compile("Nortel", Config, [Rule|Opts]).
+
+test_undecoded_rest(Config) -> test(Config, fun test_undecoded_rest/3).
+test_undecoded_rest(Config, Rule, Opts) ->
+ asn1_test_lib:compile("P-Record", Config, [Rule|Opts]),
+ ok = test_undecoded_rest:test([], Config),
+ asn1_test_lib:compile("P-Record", Config, [Rule,undec_rest|Opts]),
+ case Rule of
+ ber_bin_v2 -> ok;
+ _ -> test_undecoded_rest:test(undec_rest, Config)
+ end.
+
+test_inline(Config) ->
+ test(Config, fun test_inline/3, [ber, ber_bin, ber_bin_v2]).
+test_inline(Config, Rule, Opts) ->
+ case code:which(asn1ct) of
+ cover_compiled ->
+ {skip, "Not runnable when cover compiled"};
+ _ ->
+ test_inline:compile(Config, Opts),
+ test_inline:main(Config, Rule),
+ test_inline:inline1(Config, Rule, Opts),
+ test_inline:performance2()
+ end.
+
+testTcapsystem(Config) ->
+ test(Config, fun testTcapsystem/3, [ber, ber_bin, ber_bin_v2]).
+testTcapsystem(Config, Rule, Opts) ->
+ testTcapsystem:compile(Config, [Rule|Opts]).
+
+testNBAPsystem(Config) -> test(Config, fun testNBAPsystem/3,
+ [per, per_bin, {per_bin, [optimize]}]).
+testNBAPsystem(Config, Rule, Opts) ->
+ testNBAPsystem:compile(Config, [Rule|Opts]),
+ testNBAPsystem:test(Rule, Config).
+
+test_compile_options(Config) ->
+ case code:which(asn1ct) of
+ cover_compiled ->
+ {skip, "Not runnable when cover compiled"};
+ _ ->
+ ok = test_compile_options:wrong_path(Config),
+ ok = test_compile_options:path(Config),
+ ok = test_compile_options:noobj(Config),
+ ok = test_compile_options:record_name_prefix(Config),
+ ok = test_compile_options:verbose(Config),
+ ok = test_compile_options:warnings_as_errors(Config)
+ end.
+
+testDoubleEllipses(Config) -> test(Config, fun testDoubleEllipses/3).
+testDoubleEllipses(Config, Rule, Opts) ->
+ asn1_test_lib:compile("DoubleEllipses", Config, [Rule|Opts]),
+ testDoubleEllipses:main(Rule).
+
+test_modified_x420(Config) ->
+ Files = [filename:join(modified_x420, F) || F <- ["PKCS7",
+ "InformationFramework",
+ "AuthenticationFramework"]],
+ asn1_test_lib:compile_all(Files, Config, [der]),
+ test_modified_x420:test_io(Config).
+
+testX420(Config) ->
+ test(Config, fun testX420/3, [ber, ber_bin, ber_bin_v2]).
+testX420(Config, Rule, Opts) ->
+ testX420:compile(Rule, [der|Opts], Config),
+ ok = testX420:ticket7759(Rule, Config),
+ testX420:compile(Rule, Opts, Config).
+
+test_x691(Config) ->
+ test(Config, fun test_x691/3,
+ [per, per_bin, uper_bin, {per_bin, [optimize]}]).
+test_x691(Config, Rule, Opts) ->
+ Files = ["P-RecordA1", "P-RecordA2", "P-RecordA3"],
+ asn1_test_lib:compile_all(Files, Config, [Rule|Opts]),
+ test_x691:cases(Rule, case Rule of
+ uper_bin -> unaligned;
+ _ -> aligned
+ end),
+ asn1_test_lib:ticket_7708(Config, []),
+ asn1_test_lib:ticket_7763(Config).
+
+ticket_6143(Config) ->
+ ok = test_compile_options:ticket_6143(Config).
+
+testExtensionAdditionGroup(Config) ->
+ %% FIXME problems with automatic tags [ber_bin], [ber_bin, optimize]
+ test(Config, fun testExtensionAdditionGroup/3,
+ [per_bin, {per_bin, [optimize]}, uper_bin]).
+testExtensionAdditionGroup(Config, Rule, Opts) ->
+ asn1_test_lib:compile("Extension-Addition-Group", Config, [Rule|Opts]),
+ asn1_test_lib:compile_erlang("extensionAdditionGroup", Config,
+ [debug_info]),
+ extensionAdditionGroup:run([Rule|Opts]),
+ extensionAdditionGroup:run2([Rule|Opts]),
+ asn1_test_lib:compile("EUTRA-RRC-Definitions", Config, [Rule, {record_name_prefix, "RRC-"}|Opts]),
+ extensionAdditionGroup:run3([Rule|Opts]).
+
+% parse_modules() ->
+% ["ImportsFrom"].
+
+per_modules() ->
+ [X || X <- test_modules()].
+
+ber_modules() ->
+ [X || X <- test_modules(),
+ X =/= "CommonDataTypes",
+ X =/= "DS-EquipmentUser-CommonFunctionOrig-TransmissionPath",
+ X =/= "H323-MESSAGES",
+ X =/= "H235-SECURITY-MESSAGES",
+ X =/= "MULTIMEDIA-SYSTEM-CONTROL"].
+
+test_modules() ->
+ ["BitStr",
+ "CAP",
+ "CommonDataTypes",
+ "Constraints",
+ "ContextSwitchingTypes",
+ "DS-EquipmentUser-CommonFunctionOrig-TransmissionPath",
+ "Enum",
+ "From",
+ "H235-SECURITY-MESSAGES",
+ "H323-MESSAGES",
+ "Import",
+ "Int",
+ "MAP-commonDataTypes",
+ "Null",
+ "Octetstr",
+ "One",
+ "P-Record",
+ "P",
+ "Person",
+ "PrimStrings",
+ "Real",
+ "XSeq",
+ "XSeqOf",
+ "XSet",
+ "XSetOf",
+ "String",
+ "SwCDR",
+ "Time",
+ "SeqSetLib", % must be compiled before Seq and Set
+ "Seq",
+ "Set",
+ "SetOf",
+ "SeqOf",
+ "Prim",
+ "Cho",
+ "Def",
+ "Opt",
+ "ELDAPv3",
+ "LDAP"].
+
+test_OTP_9688(Config) ->
+ PrivDir = ?config(case_dir, Config),
+ Data = "
+OTP-9688 DEFINITIONS ::= BEGIN
+
+ foo INTEGER ::= 1
+ bar INTEGER ::= 42
+
+ Baz ::= INTEGER {x-y-z1(foo), x-y-z2(bar)}
+ Qux ::= SEQUENCE {flerpInfo SEQUENCE {x INTEGER (-10 | -9 | (0..4))} OPTIONAL}
+
+END
+",
+ File = filename:join(PrivDir, "OTP-9688.asn1"),
+ ok = file:write_file(File, Data),
+ %% Does it compile with changes to asn1ct_check and asn1ct_gen_per_rt2ct?
+ %% (see ticket)
+ ok = asn1ct:compile(File, [{outdir, PrivDir}]).
+
+
+timer_compile(Config, Rule, Opts) ->
+ asn1_test_lib:compile_all(["H235-SECURITY-MESSAGES", "H323-MESSAGES"],
+ Config, [Rule|Opts]).
+
+testTimer_ber(suite) -> [];
+testTimer_ber(Config) ->
+ timer_compile(Config,ber,[]),
+ testTimer:go(Config,ber).
+
+testTimer_ber_bin(suite) -> [];
+testTimer_ber_bin(Config) ->
+ timer_compile(Config,ber_bin,[]),
+ testTimer:go(Config,ber_bin).
+
+testTimer_ber_bin_opt(suite) -> [];
+testTimer_ber_bin_opt(Config) ->
+ timer_compile(Config,ber_bin,[optimize]),
+ testTimer:go(Config,ber_bin).
+
+testTimer_ber_bin_opt_driver(suite) -> [];
+testTimer_ber_bin_opt_driver(Config) ->
+ timer_compile(Config,ber_bin,[optimize,driver]),
+ testTimer:go(Config,ber_bin).
+
+testTimer_per(suite) -> [];
+testTimer_per(Config) ->
+ timer_compile(Config,per,[]),
+ testTimer:go(Config,per).
+
+testTimer_per_bin(suite) -> [];
+testTimer_per_bin(Config) ->
+ timer_compile(Config,per_bin,[]),
+ testTimer:go(Config,per_bin).
+
+testTimer_per_bin_opt(suite) -> [];
+testTimer_per_bin_opt(Config) ->
+ timer_compile(Config,per_bin,[optimize]),
+ testTimer:go(Config,per_bin).
+
+
+testTimer_uper_bin(suite) -> [];
+testTimer_uper_bin(Config) ->
+ timer_compile(Config,uper_bin,[]),
+ {comment,_} = testTimer:go(Config,uper_bin).
+
+%% Test of multiple-line comment, OTP-8043
+testComment(suite) -> [];
+testComment(Config) ->
+ asn1_test_lib:compile("Comment", Config, []),
+ {ok,Enc} = asn1_wrapper:encode('Comment','Seq',{'Seq',12,true}),
+ {ok,{'Seq',12,true}} = asn1_wrapper:decode('Comment','Seq',Enc),
+ ok.
+
+testName2Number(suite) -> [];
+testName2Number(Config) ->
+ N2NOptions = [{n2n,Type} || Type <- ['CauseMisc', 'CauseProtocol',
+ 'CauseRadioNetwork',
+ 'CauseTransport','CauseNas']],
+ asn1_test_lib:compile("S1AP-IEs", Config, N2NOptions),
+
+ 0 = 'S1AP-IEs':name2num_CauseMisc('control-processing-overload'),
+ 'unknown-PLMN' = 'S1AP-IEs':num2name_CauseMisc(5),
+
+ %% OTP-10144
+ %% Test that n2n option generates name2num and num2name functions supporting
+ %% values not within the extension root if the enumeration type has an
+ %% extension marker.
+ N2NOptionsExt = [{n2n, 'NoExt'}, {n2n, 'Ext'}, {n2n, 'Ext2'}],
+ asn1_test_lib:compile("EnumN2N", Config, N2NOptionsExt),
+ %% Previously, name2num and num2name was not generated if the type didn't
+ %% have an extension marker:
+ 0 = 'EnumN2N':name2num_NoExt('blue'),
+ 2 = 'EnumN2N':name2num_NoExt('green'),
+ blue = 'EnumN2N':num2name_NoExt(0),
+ green = 'EnumN2N':num2name_NoExt(2),
+
+ %% Test enumeration extension:
+ 7 = 'EnumN2N':name2num_Ext2('orange'),
+ orange = 'EnumN2N':num2name_Ext2(7),
+ %% 7 is not defined in Ext, only in Ext2.
+ {asn1_enum, 7} = 'EnumN2N':num2name_Ext(7),
+ 7 = 'EnumN2N':name2num_Ext({asn1_enum, 7}),
+ 42 = 'EnumN2N':name2num_Ext2({asn1_enum, 42}),
+ ok.
+
+ticket_7407(Config) ->
+ asn1_test_lib:compile("EUTRA-extract-7407", Config, [uper_bin]),
+ asn1_test_lib:ticket_7407_code(true),
+
+ asn1_test_lib:compile("EUTRA-extract-7407", Config,
+ [uper_bin, no_final_padding]),
+ asn1_test_lib:ticket_7407_code(false).
+
+smp(suite) -> [];
+smp(Config) ->
+ case erlang:system_info(smp_support) of
+ true ->
+ NumOfProcs = erlang:system_info(schedulers),
+ io:format("smp starting ~p workers\n",[NumOfProcs]),
+
+ Msg = {initiatingMessage, testNBAPsystem:cell_setup_req_msg()},
+ ok = testNBAPsystem:compile(Config, [per_bin, optimize]),
+
+ enc_dec(NumOfProcs,Msg,2),
+
+ N = 10000,
+
+ {Time1,ok} = timer:tc(?MODULE,enc_dec,[NumOfProcs,Msg, N]),
+ {Time1S,ok} = timer:tc(?MODULE,enc_dec,[1, Msg, NumOfProcs * N]),
+
+ ok = testNBAPsystem:compile(Config, [ber_bin, optimize, nif]),
+ {Time3,ok} = timer:tc(?MODULE,enc_dec,[NumOfProcs,Msg, N]),
+
+ {Time3S,ok} = timer:tc(?MODULE,enc_dec,[1, Msg, NumOfProcs * N]),
+
+ {comment,lists:flatten(
+ io_lib:format(
+ "Encode/decode time parallell with ~p cores: ~p [microsecs]~n"
+ "Encode/decode time sequential: ~p [microsecs]",
+ [NumOfProcs,Time1+Time3,Time1S+Time3S]))};
+ false ->
+ {skipped,"No smp support"}
+ end.
+
+per_performance(Config) ->
+ PrivDir = proplists:get_value(priv_dir, Config),
+ NifDir = filename:join(PrivDir,"nif"),
+ ErlDir = filename:join(PrivDir,"erl"),
+ file:make_dir(NifDir),file:make_dir(ErlDir),
+
+ Msg = {initiatingMessage, testNBAPsystem:cell_setup_req_msg()},
+ ok = testNBAPsystem:compile([{priv_dir,NifDir}|Config],
+ [per_bin, optimize]),
+ ok = testNBAPsystem:compile([{priv_dir,ErlDir}|Config],
+ [per_bin]),
+
+ Modules = ['NBAP-CommonDataTypes',
+ 'NBAP-Constants',
+ 'NBAP-Containers',
+ 'NBAP-IEs',
+ 'NBAP-PDU-Contents',
+ 'NBAP-PDU-Discriptions'],
+
+
+ PreNif = fun() ->
+ code:add_patha(NifDir),
+ lists:foreach(fun(M) ->
+ code:purge(M),
+ code:load_file(M)
+ end,Modules)
+ end,
+
+ PreErl = fun() ->
+ code:add_patha(ErlDir),
+ lists:foreach(fun(M) ->
+ code:purge(M),
+ code:load_file(M)
+ end,Modules)
+ end,
+
+ Func = fun() ->
+ element(1,timer:tc(
+ asn1_wrapper,encode,['NBAP-PDU-Discriptions',
+ 'NBAP-PDU',
+ Msg]))
+ end,
+
+ nif_vs_erlang_performance({{{PreNif,Func},{PreErl,Func}},100000,32}).
+
+ber_performance(Config) ->
+
+ Msg = {initiatingMessage, testNBAPsystem:cell_setup_req_msg()},
+ ok = testNBAPsystem:compile(Config, [ber_bin, optimize, nif]),
+
+
+ BerFun = fun() ->
+ {ok,B} = asn1_wrapper:encode('NBAP-PDU-Discriptions',
+ 'NBAP-PDU', Msg),
+ asn1_wrapper:decode(
+ 'NBAP-PDU-Discriptions',
+ 'NBAP-PDU',
+ B)
+ end,
+ nif_vs_erlang_performance({BerFun,100000,32}).
+
+cert_pem_performance(Config) when is_list(Config) ->
+ cert_pem_performance({100000, 32});
+cert_pem_performance({N,S}) ->
+ nif_vs_erlang_performance({fun pem_performance:cert_pem/0,N,S}).
+
+dsa_pem_performance(Config) when is_list(Config) ->
+ dsa_pem_performance({100000, 32});
+dsa_pem_performance({N,S}) ->
+ nif_vs_erlang_performance({fun pem_performance:dsa_pem/0,N,S}).
+
+
+nif_vs_erlang_performance({{TC1,TC2},N,Sched}) ->
+ random:seed({123,456,789}),
+ io:format("Running a ~p sample with ~p max procs...~n~n",[N,Sched]),
+
+ {True,False} = exec(TC1,TC2,Sched,N+1),
+
+ io:format("~ndone!~n"),
+
+ io:format("~n"),TStats = print_stats(strip(True,N div 20)),
+ io:format("~n"),FStats = print_stats(strip(False,N div 20)),
+ Str = io_lib:format("~nNifs are ~.3f% faster than erlang!~n",
+ [(element(2,FStats) - element(2,TStats)) /
+ element(2,FStats) * 100]),
+ io:format(Str),
+ {comment, lists:flatten(Str)};
+nif_vs_erlang_performance({T,N,Sched}) ->
+ PTC1 = fun() ->
+ application:set_env(asn1, nif_loadable, true)
+ end,
+ PTC2 = fun() ->
+ application:set_env(asn1, nif_loadable, false)
+ end,
+ TC = fun() ->
+ element(1,timer:tc(T))
+ end,
+ nif_vs_erlang_performance({{{PTC1,TC},{PTC2,TC}},N,Sched}).
+
+
+print_stats(Data) ->
+ Length = length(Data),
+ Mean = lists:sum(Data) / Length,
+ Variance = lists:foldl(fun(N,Acc) -> math:pow(N - Mean, 2)+Acc end, 0, Data),
+ StdDev = math:sqrt(Variance / Length),
+ Median = lists:nth(round(Length/2),Data),
+ Min = lists:min(Data),
+ Max = lists:max(Data),
+ if Length < 20 ->
+ io:format("Data: ~w~n",[Data]);
+ true ->
+ ok
+ end,
+ io:format("Length: ~p~nMean: ~p~nStdDev: ~p~nMedian: ~p~nMin: ~p~nMax: ~p~n",
+ [Length,Mean,StdDev,Median,Min,Max]),
+ {Length,Mean,StdDev,Median,Min,Max}.
+
+collect(Acc) ->
+ receive
+ {Tag,Val} ->
+ Prev = proplists:get_value(Tag,Acc,[]),
+ collect(lists:keystore(Tag,1,Acc,{Tag,[Val|Prev]}))
+ after 100 ->
+ Acc
+ end.
+
+exec(One,Two,Max,N) ->
+ exec(One,Two,Max,N,{[],[]}).
+exec(_,_,_,1,{D1,D2}) ->
+ {lists:flatten(D1),lists:flatten(D2)};
+exec({PreOne,One} = O,{PreTwo,Two} = T,MaxProcs, N, {D1,D2}) ->
+ Num = random:uniform(round(N/2)),
+ if Num rem 3 == 0 ->
+ timer:sleep(Num rem 1000);
+ true ->
+ ok
+ end,
+ Procs = random:uniform(MaxProcs),
+ io:format("\tBatch: ~p items in ~p processes, ~p left~n",[Num,Procs,N-Num]),
+ if Num rem 2 == 1 ->
+ erlang:garbage_collect(),
+ PreOne(),
+ MoreOne = pexec(One, Num, Procs, []),
+ erlang:garbage_collect(),
+ PreTwo(),
+ MoreTwo = pexec(Two, Num, Procs, []);
+ true ->
+ erlang:garbage_collect(),
+ PreTwo(),
+ MoreTwo = pexec(Two, Num, Procs, []),
+ erlang:garbage_collect(),
+ PreOne(),
+ MoreOne = pexec(One, Num, Procs, [])
+ end,
+ exec(O,T,MaxProcs,N-Num,{[MoreOne|D1],
+ [MoreTwo|D2]}).
+
+pexec(_Fun, _, 0, []) ->
+ [];
+pexec(Fun, _, 0, [{Ref,Pid}|Rest]) ->
+ receive
+ {data,D} ->
+ [D|pexec(Fun,0,0,[{Ref,Pid}|Rest])];
+ {'DOWN', Ref, process, Pid, normal} ->
+ pexec(Fun, 0,0,Rest)
+ end;
+pexec(Fun, 0, 1, AccProcs) ->
+ pexec(Fun, 0, 0, AccProcs);
+pexec(Fun, N, 1, AccProcs) ->
+ [Fun()|pexec(Fun, N - 1, 1, AccProcs)];
+pexec(Fun, N, Procs, AccProcs) ->
+ S = self(),
+ Pid = spawn(fun() ->
+ S ! {data,pexec(Fun,N,1,[])}
+ end),
+ Ref = erlang:monitor(process, Pid),
+ pexec(Fun, N, Procs - 1, [{Ref,Pid}|AccProcs]).
+
+strip(Data,Num) ->
+ {_,R} = lists:split(Num,lists:sort(Data)),
+ element(2,lists:split(Num,lists:reverse(R))).
+
+faster(A,B) ->
+ (B - A)/B * 100.
+
+enc_dec(1, Msg, N) ->
+ worker_loop(N, Msg);
+enc_dec(NumOfProcs,Msg, N) ->
+ pforeach(fun(_) ->
+ worker_loop(N, Msg)
+ end, [I || I <- lists:seq(1,NumOfProcs)]).
+
+worker_loop(0, _Msg) ->
+ ok;
+worker_loop(N, Msg) ->
+ {ok,B}=asn1_wrapper:encode('NBAP-PDU-Discriptions',
+ 'NBAP-PDU',
+ Msg),
+ {ok,_Msg}=asn1_wrapper:decode('NBAP-PDU-Discriptions',
+ 'NBAP-PDU',
+ B),
+ worker_loop(N - 1, Msg).
+
+
+pforeach(Fun, List) ->
+ pforeach(Fun, List, []).
+pforeach(Fun, [], [{Pid,Ref}|Pids]) ->
+ receive
+ {'DOWN', Ref, process, Pid, normal} ->
+ pforeach(Fun, [], Pids)
+ end;
+pforeach(Fun, [H|T], Pids) ->
+ Pid = spawn(fun() -> Fun(H) end),
+ Ref = erlang:monitor(process, Pid),
+ pforeach(Fun, T, [{Pid, Ref}|Pids]);
+pforeach(_Fun,[],[]) ->
+ ok.
+
+-record('InitiatingMessage',{procedureCode,criticality,value}).
+-record('Iu-ReleaseCommand',{first,second}).
+
+ticket7904(Config) ->
+ asn1_test_lib:compile("RANAPextract1", Config, [per_bin, optimize]),
+
+ Val1 = #'InitiatingMessage'{procedureCode=1,
+ criticality=ignore,
+ value=#'Iu-ReleaseCommand'{
+ first=13,
+ second=true}},
+
+ {ok,_} = 'RANAPextract1':encode('InitiatingMessage', Val1),
+ {ok,_} = 'RANAPextract1':encode('InitiatingMessage', Val1).
diff --git a/lib/asn1/test/asn1_SUITE.erl.src b/lib/asn1/test/asn1_SUITE.erl.src
deleted file mode 100644
index 124ee2d2bb..0000000000
--- a/lib/asn1/test/asn1_SUITE.erl.src
+++ /dev/null
@@ -1,2372 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%%
-%%% Purpose : Test suite for the ASN.1 application
-
--module(asn1_%BIN%SUITE).
--define(PER,'%PER%').
--define(BER,'%BER%').
--define(ber_driver(Erule,Func),
- case Erule of
- ber_bin_v2 ->
- Func;
- _ -> ok
- end).
--define(per_optimize(Erule),
- case Erule of
- ber_bin_v2 ->[optimize];
- _ -> []
- end).
--define(per_bit_opt(FuncCall),
- case ?BER of
- ber_bin_v2 -> FuncCall;
-% _ -> {skip,"only for bit optimized per_bin"}
- _ -> ok
- end).
--define(uper_bin(FuncCall),
- case ?PER of
- per -> FuncCall;
- _ -> ok
- end).
-
--compile(export_all).
-%%-export([Function/Arity, ...]).
-
--include_lib("test_server/include/test_server.hrl").
-
-%% records used by test-case default
--record('Def1',{
-bool0, bool1 = asn1_DEFAULT, bool2 = asn1_DEFAULT, bool3 = asn1_DEFAULT}).
-
-%-record('Def2',{
-%bool10, bool11 = asn1_DEFAULT, bool12 = asn1_DEFAULT, bool13}).
-
-%-record('Def3',{
-%bool30 = asn1_DEFAULT, bool31 = asn1_DEFAULT, bool32 = asn1_DEFAULT, bool33 = asn1_DEFAULT}).
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
-
-all() -> [{group,compile},parse,default_per,default_ber,default_per_opt,per,
- {group,ber},testPrim,
- testPrimStrings, testPrimExternal, testChoPrim,
- testChoExtension, testChoExternal, testChoOptional,
- testChoOptionalImplicitTag, testChoRecursive,
- testChoTypeRefCho, testChoTypeRefPrim, testChoTypeRefSeq,
- testChoTypeRefSet, testDef, testOpt, testSeqDefault,
- testSeqExtension, testSeqExternal, testSeqOptional,
- testSeqPrim, testSeqTag, testSeqTypeRefCho,
- testSeqTypeRefPrim, testSeqTypeRefSeq, testSeqTypeRefSet,
- testSeqOf, testSeqOfIndefinite, testSeqOfCho,
- testSeqOfExternal, testSetDefault, testSetExtension,
- testExtensionAdditionGroup,
- testSetExternal, testSeqOfTag, testSetOptional, testSetPrim,
- testSetTag, testSetTypeRefCho, testSetTypeRefPrim,
- testSetTypeRefSeq, testSetTypeRefSet, testSetOf, testSetOfCho,
- testSetOfExternal, testSetOfTag, testEnumExt, value_test,
- testSeq2738, constructed, ber_decode_error,
- h323test, testSeqIndefinite, testSetIndefinite,
- testChoiceIndefinite,
- per_GeneralString, per_open_type, testInfObjectClass,
- testParameterizedInfObj, testMergeCompile, testobj,
- testDeepTConstr, testConstraints,
- testInvokeMod, testExport, testImport, testCompactBitString,
- testMegaco, testParamBasic, testMvrasn6,
- testContextSwitchingTypes, testTypeValueNotation,
- testOpenTypeImplicitTag,duplicate_tags,rtUI,testROSE,
- testINSTANCE_OF,testTCAP,testDER,specialized_decodes,
- special_decode_performance,test_driver_load,
- test_ParamTypeInfObj, test_WS_ParamClass,
- test_Defed_ObjectIdentifier, testSelectionType,
- testSSLspecs, testNortel,test_undecoded_rest,
- test_inline, testTcapsystem, testNBAPsystem,
- test_compile_options,testDoubleEllipses, test_modified_x420,
- testX420, test_x691,ticket_6143, testExtensionAdditionGroup
- ] ++ common() ++ particular().
-
-groups() ->
- [
- {compile, [],
- [c_syntax, c_string_per, c_string_ber,
- c_implicit_before_choice]},
- {ber, [],
- [ber_choiceinseq, ber_optional, ber_optional_keyed_list,
- ber_other]},
- {app_test, [], [{asn1_app_test, all}]},
- {appup_test, [], [{asn1_appup_test, all}]}
- ].
-
-init_per_suite(Config) ->
- io:format("code:lib_dir(asn1) = ~p~n",[code:lib_dir(asn1)]),
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
-%all(suite) -> [test_inline,testNBAPsystem,test_compile_options,ticket_6143].
-
-
-init_per_testcase(Func,Config) ->
- %%?line test_server:format("Func: ~p~n",[Func]),
- ?line {ok, _} = file:read_file_info(filename:join([?config(priv_dir,Config)])),
- ?line code:add_patha(?config(priv_dir,Config)),
- Dog=
- case Func of
- testX420 ->
- test_server:timetrap({minutes,60}); % 60 minutes
- _ ->
- test_server:timetrap({minutes,30}) % 60 minutes
- end,
-%% Dog=test_server:timetrap(1800000), % 30 minutes
- [{watchdog, Dog}|Config].
-
-end_per_testcase(_Func,Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
-
-
-testPrim(suite) -> [];
-testPrim(Config) ->
- ?line testPrim:compile(Config,?BER,[]),
- ?line testPrim_cases(?BER),
- ?line ?ber_driver(?BER,testPrim:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testPrim_cases(?BER)),
- ?line testPrim:compile(Config,?PER,[]),
- ?line testPrim_cases(?PER),
- ?line ?per_bit_opt(testPrim:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testPrim_cases(?PER)),
- ?line ?uper_bin(testPrim:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testPrim_cases(uper_bin)),
- ?line testPrim:compile(Config,?PER,[optimize]),
- ?line testPrim_cases(?PER).
-
-testPrim_cases(Rules) ->
- ?line testPrim:bool(Rules),
- ?line testPrim:int(Rules),
- ?line testPrim:enum(Rules),
- ?line testPrim:obj_id(Rules),
- ?line testPrim:rel_oid(Rules),
- ?line testPrim:null(Rules),
- ?line testPrim:real(Rules).
-
-
-testCompactBitString(suite) -> [];
-testCompactBitString(Config) ->
-
- ?line testCompactBitString:compile(Config,?BER,[compact_bit_string]),
- ?line testCompactBitString:compact_bit_string(?BER),
-
- ?line ?ber_driver(?BER,testCompactBitString:compile(Config,?BER,[compact_bit_string,driver])),
- ?line ?ber_driver(?BER,testCompactBitString:compact_bit_string(?BER)),
-
- ?line testCompactBitString:compile(Config,?PER,[compact_bit_string]),
- ?line testCompactBitString:compact_bit_string(?PER),
- ?line testCompactBitString:bit_string_unnamed(?PER),
-
- ?line ?per_bit_opt(testCompactBitString:compile(Config,?PER,
- [compact_bit_string,optimize])),
- ?line ?per_bit_opt(testCompactBitString:compact_bit_string(?PER)),
- ?line ?per_bit_opt(testCompactBitString:bit_string_unnamed(?PER)),
- ?line ?per_bit_opt(testCompactBitString:ticket_7734(?PER)),
-
- ?line ?uper_bin(testCompactBitString:compile(Config,uper_bin,
- [compact_bit_string])),
- ?line ?uper_bin(testCompactBitString:compact_bit_string(uper_bin)),
- ?line ?uper_bin(testCompactBitString:bit_string_unnamed(uper_bin)),
-
- ?line testCompactBitString:compile(Config,?PER,[optimize,compact_bit_string]),
- ?line testCompactBitString:compact_bit_string(?PER),
- ?line testCompactBitString:bit_string_unnamed(?PER),
-
- ?line testCompactBitString:otp_4869(?PER).
-
-
-testPrimStrings(suite) -> [];
-testPrimStrings(Config) ->
-
- ?line testPrimStrings:compile(Config,?BER,[]),
- ?line testPrimStrings_cases(?BER),
- ?line testPrimStrings:more_strings(?BER), %% these are not implemented in per yet
- ?line ?ber_driver(?BER,testPrimStrings:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testPrimStrings_cases(?BER)),
- ?line ?ber_driver(?BER,testPrimStrings:more_strings(?BER)),
-
- ?line testPrimStrings:compile(Config,?PER,[]),
- ?line testPrimStrings_cases(?PER),
-
- ?line ?per_bit_opt(testPrimStrings:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testPrimStrings_cases(?PER)),
-
- ?line ?uper_bin(testPrimStrings:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testPrimStrings_cases(uper_bin)),
-
- ?line testPrimStrings:compile(Config,?PER,[optimize]),
- ?line testPrimStrings_cases(?PER).
-
-testPrimStrings_cases(Rules) ->
- ?line testPrimStrings:bit_string(Rules),
- ?line testPrimStrings:bit_string_unnamed(Rules),
- ?line testPrimStrings:octet_string(Rules),
- ?line testPrimStrings:numeric_string(Rules),
- ?line testPrimStrings:other_strings(Rules),
- ?line testPrimStrings:universal_string(Rules),
- ?line testPrimStrings:bmp_string(Rules),
- ?line testPrimStrings:times(Rules),
- ?line testPrimStrings:utf8_string(Rules).
-
-
-
-testPrimExternal(suite) -> [];
-testPrimExternal(Config) ->
-
- ?line testExternal:compile(Config,?BER,[]),
- ?line testPrimExternal:compile(Config,?BER,[]),
- ?line testPrimExternal_cases(?BER),
-
- ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testPrimExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testPrimExternal_cases(?BER)),
-
- ?line testExternal:compile(Config,?PER,[]),
- ?line testPrimExternal:compile(Config,?PER,[]),
- ?line testPrimExternal_cases(?PER),
-
- ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testPrimExternal:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testPrimExternal_cases(?PER)),
-
- ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testPrimExternal:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testPrimExternal_cases(uper_bin)),
-
- ?line testExternal:compile(Config,?PER,[optimize]),
- ?line testPrimExternal:compile(Config,?PER,[optimize]),
- ?line testPrimExternal_cases(?PER).
-
-testPrimExternal_cases(Rules) ->
- ?line testPrimExternal:external(Rules).
-
-
-
-
-testChoPrim(suite) -> [];
-testChoPrim(Config) ->
-
- ?line testChoPrim:compile(Config,?BER,[]),
- ?line testChoPrim_cases(?BER),
-
- ?line ?ber_driver(?BER,testChoPrim:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testChoPrim_cases(?BER)),
-
- ?line testChoPrim:compile(Config,?PER,[]),
- ?line testChoPrim_cases(?PER),
-
- ?line ?per_bit_opt(testChoPrim:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testChoPrim_cases(?PER)),
-
- ?line ?uper_bin(testChoPrim:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testChoPrim_cases(uper_bin)),
-
- ?line testChoPrim:compile(Config,?PER,[optimize]),
- ?line testChoPrim_cases(?PER).
-
-testChoPrim_cases(Rules) ->
- ?line testChoPrim:bool(Rules),
- ?line testChoPrim:int(Rules).
-
-
-
-testChoExtension(suite) -> [];
-testChoExtension(Config) ->
-
- ?line testChoExtension:compile(Config,?BER,[]),
- ?line testChoExtension_cases(?BER),
-
- ?line ?ber_driver(?BER,testChoExtension:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testChoExtension_cases(?BER)),
-
- ?line testChoExtension:compile(Config,?PER,[]),
- ?line testChoExtension_cases(?PER),
-
- ?line ?per_bit_opt(testChoExtension:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testChoExtension_cases(?PER)),
-
- ?line ?uper_bin(testChoExtension:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testChoExtension_cases(uper_bin)),
-
- ?line testChoExtension:compile(Config,?PER,[optimize]),
- ?line testChoExtension_cases(?PER).
-
-testChoExtension_cases(Rules) ->
- ?line testChoExtension:extension(Rules).
-
-
-
-testChoExternal(suite) -> [];
-testChoExternal(Config) ->
-
- ?line testExternal:compile(Config,?BER,[]),
- ?line testChoExternal:compile(Config,?BER,[]),
- ?line testChoExternal_cases(?BER),
-
- ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testChoExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testChoExternal_cases(?BER)),
-
- ?line testExternal:compile(Config,?PER,[]),
- ?line testChoExternal:compile(Config,?PER,[]),
- ?line testChoExternal_cases(?PER),
-
- ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testChoExternal:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testChoExternal_cases(?PER)),
-
- ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testChoExternal:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testChoExternal_cases(uper_bin)),
-
- ?line testExternal:compile(Config,?PER,[optimize]),
- ?line testChoExternal:compile(Config,?PER,[optimize]),
- ?line testChoExternal_cases(?PER).
-
-
-testChoExternal_cases(Rules) ->
- ?line testChoExternal:external(Rules).
-
-
-
-testChoOptional(suite) -> [];
-testChoOptional(Config) ->
-
- ?line testChoOptional:compile(Config,?BER,[]),
- ?line testChoOptional_cases(?BER),
-
- ?line ?ber_driver(?BER,testChoOptional:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testChoOptional_cases(?BER)),
-
- ?line testChoOptional:compile(Config,?PER,[]),
- ?line testChoOptional_cases(?PER),
-
- ?line ?per_bit_opt(testChoOptional:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testChoOptional_cases(?PER)),
-
- ?line ?uper_bin(testChoOptional:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testChoOptional_cases(uper_bin)),
-
- ?line testChoOptional:compile(Config,?PER,[optimize]),
- ?line testChoOptional_cases(?PER).
-
-testChoOptional_cases(Rules) ->
- ?line testChoOptional:optional(Rules).
-
-testChoOptionalImplicitTag(suite) -> [];
-testChoOptionalImplicitTag(Config) ->
- %% Only meaningful for ?BER
- ?line testChoOptionalImplicitTag:compile(Config,?BER),
- ?line testChoOptionalImplicitTag:optional(?BER).
-
-
-testChoRecursive(suite) -> [];
-testChoRecursive(Config) ->
-
- ?line testChoRecursive:compile(Config,?BER,[]),
- ?line testChoRecursive_cases(?BER),
-
- ?line ?ber_driver(?BER,testChoRecursive:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testChoRecursive_cases(?BER)),
-
- ?line testChoRecursive:compile(Config,?PER,[]),
- ?line testChoRecursive_cases(?PER),
-
- ?line ?per_bit_opt(testChoRecursive:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testChoRecursive_cases(?PER)),
-
- ?line ?uper_bin(testChoRecursive:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testChoRecursive_cases(uper_bin)),
-
- ?line testChoRecursive:compile(Config,?PER,[optimize]),
- ?line testChoRecursive_cases(?PER).
-
-testChoRecursive_cases(Rules) ->
- ?line testChoRecursive:recursive(Rules).
-
-
-
-testChoTypeRefCho(suite) -> [];
-testChoTypeRefCho(Config) ->
-
- ?line testChoTypeRefCho:compile(Config,?BER,[]),
- ?line testChoTypeRefCho_cases(?BER),
-
- ?line ?ber_driver(?BER,testChoTypeRefCho:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testChoTypeRefCho_cases(?BER)),
-
- ?line testChoTypeRefCho:compile(Config,?PER,[]),
- ?line testChoTypeRefCho_cases(?PER),
-
- ?line ?per_bit_opt(testChoTypeRefCho:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testChoTypeRefCho_cases(?PER)),
-
- ?line ?uper_bin(testChoTypeRefCho:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testChoTypeRefCho_cases(uper_bin)),
-
- ?line testChoTypeRefCho:compile(Config,?PER,[optimize]),
- ?line testChoTypeRefCho_cases(?PER).
-
-testChoTypeRefCho_cases(Rules) ->
- ?line testChoTypeRefCho:choice(Rules).
-
-
-
-testChoTypeRefPrim(suite) -> [];
-testChoTypeRefPrim(Config) ->
-
- ?line testChoTypeRefPrim:compile(Config,?BER,[]),
- ?line testChoTypeRefPrim_cases(?BER),
-
- ?line ?ber_driver(?BER,testChoTypeRefPrim:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testChoTypeRefPrim_cases(?BER)),
-
- ?line testChoTypeRefPrim:compile(Config,?PER,[]),
- ?line testChoTypeRefPrim_cases(?PER),
-
- ?line ?per_bit_opt(testChoTypeRefPrim:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testChoTypeRefPrim_cases(?PER)),
-
- ?line ?uper_bin(testChoTypeRefPrim:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testChoTypeRefPrim_cases(uper_bin)),
-
- ?line testChoTypeRefPrim:compile(Config,?PER,[optimize]),
- ?line testChoTypeRefPrim_cases(?PER).
-
-testChoTypeRefPrim_cases(Rules) ->
- ?line testChoTypeRefPrim:prim(Rules).
-
-
-
-testChoTypeRefSeq(suite) -> [];
-testChoTypeRefSeq(Config) ->
-
- ?line testChoTypeRefSeq:compile(Config,?BER,[]),
- ?line testChoTypeRefSeq_cases(?BER),
-
- ?line ?ber_driver(?BER,testChoTypeRefSeq:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testChoTypeRefSeq_cases(?BER)),
-
- ?line testChoTypeRefSeq:compile(Config,?PER,[]),
- ?line testChoTypeRefSeq_cases(?PER),
-
- ?line ?per_bit_opt(testChoTypeRefSeq:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testChoTypeRefSeq_cases(?PER)),
-
- ?line ?uper_bin(testChoTypeRefSeq:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testChoTypeRefSeq_cases(uper_bin)),
-
- ?line testChoTypeRefSeq:compile(Config,?PER,[optimize]),
- ?line testChoTypeRefSeq_cases(?PER).
-
-testChoTypeRefSeq_cases(Rules) ->
- ?line testChoTypeRefSeq:seq(Rules).
-
-
-
-testChoTypeRefSet(suite) -> [];
-testChoTypeRefSet(Config) ->
-
- ?line testChoTypeRefSet:compile(Config,?BER,[]),
- ?line testChoTypeRefSet_cases(?BER),
-
- ?line ?ber_driver(?BER,testChoTypeRefSet:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testChoTypeRefSet_cases(?BER)),
-
- ?line testChoTypeRefSet:compile(Config,?PER,[]),
- ?line testChoTypeRefSet_cases(?PER),
-
- ?line ?per_bit_opt(testChoTypeRefSet:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testChoTypeRefSet_cases(?PER)),
-
- ?line ?uper_bin(testChoTypeRefSet:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testChoTypeRefSet_cases(uper_bin)),
-
- ?line testChoTypeRefSet:compile(Config,?PER,[optimize]),
- ?line testChoTypeRefSet_cases(?PER).
-
-testChoTypeRefSet_cases(Rules) ->
- ?line testChoTypeRefSet:set(Rules).
-
-
-
-testDef(suite) -> [];
-testDef(Config) ->
-
- ?line testDef:compile(Config,?BER,[]),
- ?line testDef_cases(?BER),
-
- ?line ?ber_driver(?BER,testDef:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testDef_cases(?BER)),
-
- ?line testDef:compile(Config,?PER,[]),
- ?line testDef_cases(?PER),
-
- ?line ?per_bit_opt(testDef:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testDef_cases(?PER)),
-
- ?line ?uper_bin(testDef:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testDef_cases(uper_bin)),
-
- ?line testDef:compile(Config,?PER,[optimize]),
- ?line testDef_cases(?PER).
-
-testDef_cases(Rules) ->
- ?line testDef:main(Rules).
-
-
-
-testOpt(suite) -> [];
-testOpt(Config) ->
-
- ?line testOpt:compile(Config,?BER),
- ?line testOpt_cases(?BER),
-
- ?line testOpt:compile(Config,?PER),
- ?line testOpt_cases(?PER).
-
-testOpt_cases(Rules) ->
- ?line testOpt:main(Rules).
-
-
-testEnumExt(suite) -> [];
-testEnumExt(Config) ->
-
- ?line testEnumExt:compile(Config,?BER,[]),
- ?line testEnumExt:main(?BER),
-
- ?line ?ber_driver(?BER,testEnumExt:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testEnumExt:main(?BER)),
-
- ?line testEnumExt:compile(Config,?PER,[]),
- ?line testEnumExt:main(?PER),
-
- ?line ?per_bit_opt(testEnumExt:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testEnumExt:main(?PER)),
-
- ?line ?uper_bin(testEnumExt:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testEnumExt:main(uper_bin)),
-
- ?line testEnumExt:compile(Config,?PER,[optimize]),
- ?line testEnumExt:main(?PER).
-
-testSeqDefault(doc) -> ["Test of OTP-2523 ENUMERATED with extensionmark."];
-testSeqDefault(suite) -> [];
-testSeqDefault(Config) ->
-
- ?line testSeqDefault:compile(Config,?BER,[]),
- ?line testSeqDefault_cases(?BER),
-
- ?line ?ber_driver(?BER,testSeqDefault:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqDefault_cases(?BER)),
-
- ?line testSeqDefault:compile(Config,?PER,[]),
- ?line testSeqDefault_cases(?PER),
-
- ?line ?per_bit_opt(testSeqDefault:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeqDefault_cases(?PER)),
-
- ?line ?uper_bin(testSeqDefault:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeqDefault_cases(uper_bin)),
-
- ?line testSeqDefault:compile(Config,?PER,[optimize]),
- ?line testSeqDefault_cases(?PER).
-
-testSeqDefault_cases(Rules) ->
- ?line testSeqDefault:main(Rules).
-
-
-
-testSeqExtension(suite) -> [];
-testSeqExtension(Config) ->
-
- ?line testExternal:compile(Config,?BER,[]),
- ?line testSeqExtension:compile(Config,?BER,[]),
- ?line testSeqExtension_cases(?BER),
-
- ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqExtension:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqExtension_cases(?BER)).
-
-testSeqExtension_cases(Rules) ->
- ?line testSeqExtension:main(Rules).
-
-
-
-testSeqExternal(suite) -> [];
-testSeqExternal(Config) ->
-
- ?line testExternal:compile(Config,?BER,[]),
- ?line testSeqExternal:compile(Config,?BER,[]),
- ?line testSeqExternal_cases(?BER),
-
- ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqExternal_cases(?BER)).
-
-testSeqExternal_cases(Rules) ->
- ?line testSeqExternal:main(Rules).
-
-
-testSeqOptional(suite) -> [];
-testSeqOptional(Config) ->
-
- ?line testSeqOptional:compile(Config,?BER,[]),
- ?line testSeqOptional_cases(?BER),
-
- ?line ?ber_driver(?BER,testSeqOptional:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqOptional_cases(?BER)),
-
- ?line testSeqOptional:compile(Config,?PER,[]),
- ?line testSeqOptional_cases(?PER),
-
- ?line ?per_bit_opt(testSeqOptional:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeqOptional_cases(?PER)),
-
- ?line ?uper_bin(testSeqOptional:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeqOptional_cases(uper_bin)),
-
- ?line testSeqOptional:compile(Config,?PER,[optimize]),
- ?line testSeqOptional_cases(?PER).
-
-testSeqOptional_cases(Rules) ->
- ?line testSeqOptional:main(Rules).
-
-
-
-testSeqPrim(suite) -> [];
-testSeqPrim(Config) ->
-
- ?line testSeqPrim:compile(Config,?BER,[]),
- ?line testSeqPrim_cases(?BER),
-
- ?line ?ber_driver(?BER,testSeqPrim:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqPrim_cases(?BER)),
-
- ?line testSeqPrim:compile(Config,?PER,[]),
- ?line testSeqPrim_cases(?PER),
-
- ?line ?per_bit_opt(testSeqPrim:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeqPrim_cases(?PER)),
-
- ?line ?uper_bin(testSeqPrim:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeqPrim_cases(uper_bin)),
-
- ?line testSeqPrim:compile(Config,?PER,[optimize]),
- ?line testSeqPrim_cases(?PER).
-
-testSeqPrim_cases(Rules) ->
- ?line testSeqPrim:main(Rules).
-
-
-testSeq2738(doc) -> ["Test of OTP-2738 Detect corrupt optional component."];
-testSeq2738(suite) -> [];
-testSeq2738(Config) ->
-
- ?line testSeq2738:compile(Config,?BER,[]),
- ?line testSeq2738_cases(?BER),
-
- ?line ?ber_driver(?BER,testSeq2738:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeq2738_cases(?BER)),
-
- ?line testSeq2738:compile(Config,?PER,[]),
- ?line testSeq2738_cases(?PER),
-
- ?line ?per_bit_opt(testSeq2738:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeq2738_cases(?PER)),
-
- ?line ?uper_bin(testSeq2738:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeq2738_cases(uper_bin)),
-
- ?line testSeq2738:compile(Config,?PER,[optimize]),
- ?line testSeq2738_cases(?PER).
-
-testSeq2738_cases(Rules) ->
- ?line testSeq2738:main(Rules).
-
-
-testSeqTag(suite) -> [];
-testSeqTag(Config) ->
-
- ?line testExternal:compile(Config,?BER,[]),
- ?line testSeqTag:compile(Config,?BER,[]),
- ?line testSeqTag_cases(?BER),
-
- ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqTag:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqTag_cases(?BER)),
-
- ?line testExternal:compile(Config,?PER,[]),
- ?line testSeqTag:compile(Config,?PER,[]),
- ?line testSeqTag_cases(?PER),
-
- ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeqTag:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeqTag_cases(?PER)),
-
- ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeqTag:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeqTag_cases(uper_bin)),
-
- ?line testExternal:compile(Config,?PER,[optimize]),
- ?line testSeqTag:compile(Config,?PER,[optimize]),
- ?line testSeqTag_cases(?PER).
-
-testSeqTag_cases(Rules) ->
- ?line testSeqTag:main(Rules).
-
-
-
-
-testSeqTypeRefCho(suite) -> [];
-testSeqTypeRefCho(Config) ->
-
- ?line testSeqTypeRefCho:compile(Config,?BER,[]),
- ?line testSeqTypeRefCho_cases(?BER),
-
- ?line ?ber_driver(?BER,testSeqTypeRefCho:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqTypeRefCho_cases(?BER)),
-
- ?line testSeqTypeRefCho:compile(Config,?PER,[]),
- ?line testSeqTypeRefCho_cases(?PER),
-
- ?line ?per_bit_opt(testSeqTypeRefCho:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeqTypeRefCho_cases(?PER)),
-
- ?line ?uper_bin(testSeqTypeRefCho:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeqTypeRefCho_cases(uper_bin)),
-
- ?line testSeqTypeRefCho:compile(Config,?PER,[optimize]),
- ?line testSeqTypeRefCho_cases(?PER).
-
-testSeqTypeRefCho_cases(Rules) ->
- ?line testSeqTypeRefCho:main(Rules).
-
-
-
-testSeqTypeRefPrim(suite) -> [];
-testSeqTypeRefPrim(Config) ->
-
- ?line testSeqTypeRefPrim:compile(Config,?BER,[]),
- ?line testSeqTypeRefPrim_cases(?BER),
-
- ?line ?ber_driver(?BER,testSeqTypeRefPrim:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqTypeRefPrim_cases(?BER)),
-
- ?line testSeqTypeRefPrim:compile(Config,?PER,[]),
- ?line testSeqTypeRefPrim_cases(?PER),
-
- ?line ?per_bit_opt(testSeqTypeRefPrim:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeqTypeRefPrim_cases(?PER)),
-
- ?line ?uper_bin(testSeqTypeRefPrim:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeqTypeRefPrim_cases(uper_bin)),
-
- ?line testSeqTypeRefPrim:compile(Config,?PER,[optimize]),
- ?line testSeqTypeRefPrim_cases(?PER).
-
-testSeqTypeRefPrim_cases(Rules) ->
- ?line testSeqTypeRefPrim:main(Rules).
-
-
-
-testSeqTypeRefSeq(suite) -> [];
-testSeqTypeRefSeq(Config) ->
-
- ?line testSeqTypeRefSeq:compile(Config,?BER,[]),
- ?line testSeqTypeRefSeq_cases(?BER),
-
- ?line ?ber_driver(?BER,testSeqTypeRefSeq:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqTypeRefSeq_cases(?BER)),
-
- ?line testSeqTypeRefSeq:compile(Config,?PER,[]),
- ?line testSeqTypeRefSeq_cases(?PER),
-
- ?line ?per_bit_opt(testSeqTypeRefSeq:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeqTypeRefSeq_cases(?PER)),
-
- ?line ?uper_bin(testSeqTypeRefSeq:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeqTypeRefSeq_cases(uper_bin)),
-
- ?line testSeqTypeRefSeq:compile(Config,?PER,[optimize]),
- ?line testSeqTypeRefSeq_cases(?PER).
-
-testSeqTypeRefSeq_cases(Rules) ->
- ?line testSeqTypeRefSeq:main(Rules).
-
-
-
-testSeqTypeRefSet(suite) -> [];
-testSeqTypeRefSet(Config) ->
-
- ?line testSeqTypeRefSet:compile(Config,?BER,[]),
- ?line testSeqTypeRefSet_cases(?BER),
-
- ?line ?ber_driver(?BER,testSeqTypeRefSet:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqTypeRefSet_cases(?BER)),
-
- ?line testSeqTypeRefSet:compile(Config,?PER,[]),
- ?line testSeqTypeRefSet_cases(?PER),
-
- ?line ?per_bit_opt(testSeqTypeRefSet:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeqTypeRefSet_cases(?PER)),
-
- ?line ?uper_bin(testSeqTypeRefSet:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeqTypeRefSet_cases(uper_bin)),
-
- ?line testSeqTypeRefSet:compile(Config,?PER,[optimize]),
- ?line testSeqTypeRefSet_cases(?PER).
-
-testSeqTypeRefSet_cases(Rules) ->
- ?line testSeqTypeRefSet:main(Rules).
-
-
-
-
-testSeqOf(suite) -> [];
-testSeqOf(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testSeqOf:compile(Config,?BER,[]),
- ?line testSeqOf_cases(?BER),
-
- ?line ?ber_driver(?BER,testSeqOf:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqOf_cases(?BER)),
-
- ?line testSeqOf:compile(Config,?PER,[]),
- ?line testSeqOf_cases(?PER),
-
- ?line ?per_bit_opt(testSeqOf:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeqOf_cases(?PER)),
-
- ?line ?uper_bin(testSeqOf:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeqOf_cases(uper_bin)),
-
- ?line testSeqOf:compile(Config,?PER,[optimize]),
- ?line testSeqOf_cases(?PER).
-
-testSeqOf_cases(Rules) ->
- ?line testSeqOf:main(Rules).
-
-
-
-
-testSeqOfCho(suite) -> [];
-testSeqOfCho(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testSeqOfCho:compile(Config,?BER,[]),
- ?line testSeqOfCho_cases(?BER),
-
- ?line ?ber_driver(?BER,testSeqOfCho:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqOfCho_cases(?BER)),
-
- ?line testSeqOfCho:compile(Config,?PER,[]),
- ?line testSeqOfCho_cases(?PER),
-
- ?line ?per_bit_opt(testSeqOfCho:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeqOfCho_cases(?PER)),
-
- ?line ?uper_bin(testSeqOfCho:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeqOfCho_cases(uper_bin)),
-
- ?line testSeqOfCho:compile(Config,?PER,[optimize]),
- ?line testSeqOfCho_cases(?PER).
-
-testSeqOfIndefinite(suite) -> [];
-testSeqOfIndefinite(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testSeqOfIndefinite:compile(Config,?BER,[]),
- ?line testSeqOfIndefinite:main(),
-
- ?line ?ber_driver(?BER,testSeqOfIndefinite:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqOfIndefinite:main()).
-
-testSeqOfCho_cases(Rules) ->
- ?line testSeqOfCho:main(Rules).
-
-
-testSeqOfExternal(suite) -> [];
-testSeqOfExternal(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testExternal:compile(Config,?BER,[]),
- ?line testSeqOfExternal:compile(Config,?BER,[]),
- ?line testSeqOfExternal_cases(?BER),
-
- ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqOfExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqOfExternal_cases(?BER)),
-
- ?line testExternal:compile(Config,?PER,[]),
- ?line testSeqOfExternal:compile(Config,?PER,[]),
- ?line testSeqOfExternal_cases(?PER),
-
- ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeqOfExternal:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeqOfExternal_cases(?PER)),
-
- ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeqOfExternal:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeqOfExternal_cases(uper_bin)),
-
- ?line testExternal:compile(Config,?PER,[optimize]),
- ?line testSeqOfExternal:compile(Config,?PER,[optimize]),
- ?line testSeqOfExternal_cases(?PER).
-
-testSeqOfExternal_cases(Rules) ->
- ?line testSeqOfExternal:main(Rules).
-
-
-
-testSeqOfTag(suite) -> [];
-testSeqOfTag(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testExternal:compile(Config,?BER,[]),
- ?line testSeqOfTag:compile(Config,?BER,[]),
- ?line testSeqOfTag_cases(?BER),
-
- ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqOfTag:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqOfTag_cases(?BER)),
-
- ?line testExternal:compile(Config,?PER,[]),
- ?line testSeqOfTag:compile(Config,?PER,[]),
- ?line testSeqOfTag_cases(?PER),
-
- ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeqOfTag:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSeqOfTag_cases(?PER)),
-
- ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeqOfTag:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSeqOfTag_cases(uper_bin)),
-
- ?line testExternal:compile(Config,?PER,[optimize]),
- ?line testSeqOfTag:compile(Config,?PER,[optimize]),
- ?line testSeqOfTag_cases(?PER).
-
-testSeqOfTag_cases(Rules) ->
- ?line testSeqOfTag:main(Rules).
-
-
-
-
-testSetDefault(suite) -> [];
-testSetDefault(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testSetDefault:compile(Config,?BER,[]),
- ?line testSetDefault_cases(?BER),
-
- ?line ?ber_driver(?BER,testSetDefault:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetDefault_cases(?BER)),
-
- ?line testSetDefault:compile(Config,?PER,[]),
- ?line testSetDefault_cases(?PER),
-
- ?line ?per_bit_opt(testSetDefault:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSetDefault_cases(?PER)),
-
- ?line ?uper_bin(testSetDefault:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSetDefault_cases(uper_bin)),
-
- ?line testSetDefault:compile(Config,?PER,[optimize]),
- ?line testSetDefault_cases(?PER).
-
-testSetDefault_cases(Rules) ->
- ?line testSetDefault:main(Rules).
-
-
-testParamBasic(suite) -> [];
-testParamBasic(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testParamBasic:compile(Config,?BER,[]),
- ?line testParamBasic_cases(?BER),
-
- ?line ?ber_driver(?BER,testParamBasic:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testParamBasic_cases(?BER)),
-
- ?line testParamBasic:compile(Config,?PER,[]),
- ?line testParamBasic_cases(?PER),
-
- ?line ?per_bit_opt(testParamBasic:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testParamBasic_cases(?PER)),
-
- ?line ?uper_bin(testParamBasic:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testParamBasic_cases(uper_bin)),
-
- ?line testParamBasic:compile(Config,?PER,[optimize]),
- ?line testParamBasic_cases(?PER).
-
-
-testParamBasic_cases(Rules) ->
- ?line testParamBasic:main(Rules).
-
-testSetExtension(suite) -> [];
-testSetExtension(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testExternal:compile(Config,?BER,[]),
- ?line testSetExtension:compile(Config,?BER,[]),
- ?line testSetExtension_cases(?BER),
-
- ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetExtension:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetExtension_cases(?BER)).
-
-testSetExtension_cases(Rules) ->
- ?line testSetExtension:main(Rules).
-
-
-testSetExternal(suite) -> [];
-testSetExternal(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testExternal:compile(Config,?BER,[]),
- ?line testSetExternal:compile(Config,?BER,[]),
- ?line testSetExternal_cases(?BER),
-
- ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetExternal_cases(?BER)).
-
-testSetExternal_cases(Rules) ->
- ?line testSetExternal:main(Rules).
-
-
-testSetOptional(suite) -> [];
-testSetOptional(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testSetOptional:compile(Config,?BER,[]),
- ?line testSetOptional_cases(?BER),
-
- ?line ?ber_driver(?BER,testSetOptional:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetOptional_cases(?BER)),
-
- ?line testSetOptional:compile(Config,?PER,[]),
- ?line testSetOptional_cases(?PER),
-
- ?line ?per_bit_opt(testSetOptional:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSetOptional_cases(?PER)),
-
- ?line ?uper_bin(testSetOptional:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSetOptional_cases(uper_bin)),
-
- ?line testSetOptional:compile(Config,?PER,[optimize]),
- ?line testSetOptional_cases(?PER).
-
-testSetOptional_cases(Rules) ->
- ?line ok = testSetOptional:ticket_7533(Rules),
- ?line ok = testSetOptional:main(Rules).
-
-
-
-
-testSetPrim(suite) -> [];
-testSetPrim(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testSetPrim:compile(Config,?BER,[]),
- ?line testSetPrim_cases(?BER),
-
- ?line ?ber_driver(?BER,testSetPrim:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetPrim_cases(?BER)),
-
- ?line testSetPrim:compile(Config,?PER,[]),
- ?line testSetPrim_cases(?PER),
-
- ?line ?per_bit_opt(testSetPrim:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSetPrim_cases(?PER)),
-
- ?line ?uper_bin(testSetPrim:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSetPrim_cases(uper_bin)),
-
- ?line testSetPrim:compile(Config,?PER,[optimize]),
- ?line testSetPrim_cases(?PER).
-
-testSetPrim_cases(Rules) ->
- ?line testSetPrim:main(Rules).
-
-
-
-testSetTag(suite) -> [];
-testSetTag(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testExternal:compile(Config,?BER,[]),
- ?line testSetTag:compile(Config,?BER,[]),
- ?line testSetTag_cases(?BER),
-
- ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetTag:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetTag_cases(?BER)),
-
- ?line testExternal:compile(Config,?PER,[]),
- ?line testSetTag:compile(Config,?PER,[]),
- ?line testSetTag_cases(?PER),
-
- ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSetTag:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSetTag_cases(?PER)),
-
- ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSetTag:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSetTag_cases(uper_bin)),
-
- ?line testExternal:compile(Config,?PER,[optimize]),
- ?line testSetTag:compile(Config,?PER,[optimize]),
- ?line testSetTag_cases(?PER).
-
-testSetTag_cases(Rules) ->
- ?line testSetTag:main(Rules).
-
-
-
-testSetTypeRefCho(suite) -> [];
-testSetTypeRefCho(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testSetTypeRefCho:compile(Config,?BER,[]),
- ?line testSetTypeRefCho_cases(?BER),
-
- ?line ?ber_driver(?BER,testSetTypeRefCho:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetTypeRefCho_cases(?BER)),
-
- ?line testSetTypeRefCho:compile(Config,?PER,[]),
- ?line testSetTypeRefCho_cases(?PER),
-
- ?line ?per_bit_opt(testSetTypeRefCho:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSetTypeRefCho_cases(?PER)),
-
- ?line ?uper_bin(testSetTypeRefCho:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSetTypeRefCho_cases(uper_bin)),
-
- ?line testSetTypeRefCho:compile(Config,?PER,[optimize]),
- ?line testSetTypeRefCho_cases(?PER).
-
-testSetTypeRefCho_cases(Rules) ->
- ?line testSetTypeRefCho:main(Rules).
-
-
-
-testSetTypeRefPrim(suite) -> [];
-testSetTypeRefPrim(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testSetTypeRefPrim:compile(Config,?BER,[]),
- ?line testSetTypeRefPrim_cases(?BER),
-
- ?line ?ber_driver(?BER,testSetTypeRefPrim:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetTypeRefPrim_cases(?BER)),
-
- ?line testSetTypeRefPrim:compile(Config,?PER,[]),
- ?line testSetTypeRefPrim_cases(?PER),
-
- ?line ?per_bit_opt(testSetTypeRefPrim:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSetTypeRefPrim_cases(?PER)),
-
- ?line ?uper_bin(testSetTypeRefPrim:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSetTypeRefPrim_cases(uper_bin)),
-
- ?line testSetTypeRefPrim:compile(Config,?PER,[optimize]),
- ?line testSetTypeRefPrim_cases(?PER).
-
-testSetTypeRefPrim_cases(Rules) ->
- ?line testSetTypeRefPrim:main(Rules).
-
-
-
-testSetTypeRefSeq(suite) -> [];
-testSetTypeRefSeq(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testSetTypeRefSeq:compile(Config,?BER,[]),
- ?line testSetTypeRefSeq_cases(?BER),
-
- ?line ?ber_driver(?BER,testSetTypeRefSeq:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetTypeRefSeq_cases(?BER)),
-
- ?line testSetTypeRefSeq:compile(Config,?PER,[]),
- ?line testSetTypeRefSeq_cases(?PER),
-
- ?line ?per_bit_opt(testSetTypeRefSeq:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSetTypeRefSeq_cases(?PER)),
-
- ?line ?uper_bin(testSetTypeRefSeq:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSetTypeRefSeq_cases(uper_bin)),
-
- ?line testSetTypeRefSeq:compile(Config,?PER,[optimize]),
- ?line testSetTypeRefSeq_cases(?PER).
-
-testSetTypeRefSeq_cases(Rules) ->
- ?line testSetTypeRefSeq:main(Rules).
-
-
-
-testSetTypeRefSet(suite) -> [];
-testSetTypeRefSet(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testSetTypeRefSet:compile(Config,?BER,[]),
- ?line testSetTypeRefSet_cases(?BER),
-
- ?line ?ber_driver(?BER,testSetTypeRefSet:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetTypeRefSet_cases(?BER)),
-
- ?line testSetTypeRefSet:compile(Config,?PER,[]),
- ?line testSetTypeRefSet_cases(?PER),
-
- ?line ?per_bit_opt(testSetTypeRefSet:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSetTypeRefSet_cases(?PER)),
-
- ?line ?uper_bin(testSetTypeRefSet:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSetTypeRefSet_cases(uper_bin)),
-
- ?line testSetTypeRefSet:compile(Config,?PER,[optimize]),
- ?line testSetTypeRefSet_cases(?PER).
-
-testSetTypeRefSet_cases(Rules) ->
- ?line testSetTypeRefSet:main(Rules).
-
-
-
-testSetOf(suite) -> [];
-testSetOf(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testSetOf:compile(Config,?BER,[]),
- ?line testSetOf_cases(?BER),
-
- ?line ?ber_driver(?BER,testSetOf:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetOf_cases(?BER)),
-
- ?line testSetOf:compile(Config,?PER,[]),
- ?line testSetOf_cases(?PER),
-
- ?line ?per_bit_opt(testSetOf:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSetOf_cases(?PER)),
-
- ?line ?uper_bin(testSetOf:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSetOf_cases(uper_bin)),
-
- ?line testSetOf:compile(Config,?PER,[optimize]),
- ?line testSetOf_cases(?PER).
-
-testSetOf_cases(Rules) ->
- ?line testSetOf:main(Rules).
-
-
-
-testSetOfCho(suite) -> [];
-testSetOfCho(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testSetOfCho:compile(Config,?BER,[]),
- ?line testSetOfCho_cases(?BER),
-
- ?line ?ber_driver(?BER,testSetOfCho:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetOfCho_cases(?BER)),
-
- ?line testSetOfCho:compile(Config,?PER,[]),
- ?line testSetOfCho_cases(?PER),
-
- ?line ?per_bit_opt(testSetOfCho:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSetOfCho_cases(?PER)),
-
- ?line ?uper_bin(testSetOfCho:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSetOfCho_cases(uper_bin)),
-
- ?line testSetOfCho:compile(Config,?PER,[optimize]),
- ?line testSetOfCho_cases(?PER).
-
-testSetOfCho_cases(Rules) ->
- ?line testSetOfCho:main(Rules).
-
-
-testSetOfExternal(suite) -> [];
-testSetOfExternal(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testExternal:compile(Config,?BER,[]),
- ?line testSetOfExternal:compile(Config,?BER,[]),
- ?line testSetOfExternal_cases(?BER),
-
- ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetOfExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetOfExternal_cases(?BER)),
-
- ?line testExternal:compile(Config,?PER,[]),
- ?line testSetOfExternal:compile(Config,?PER,[]),
- ?line testSetOfExternal_cases(?PER),
-
- ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSetOfExternal:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSetOfExternal_cases(?PER)),
-
- ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSetOfExternal:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSetOfExternal_cases(uper_bin)),
-
- ?line testExternal:compile(Config,?PER,[optimize]),
- ?line testSetOfExternal:compile(Config,?PER,[optimize]),
- ?line testSetOfExternal_cases(?PER).
-
-testSetOfExternal_cases(Rules) ->
- ?line testSetOfExternal:main(Rules).
-
-
-
-
-testSetOfTag(suite) -> [];
-testSetOfTag(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testExternal:compile(Config,?BER,[]),
- ?line testSetOfTag:compile(Config,?BER,[]),
- ?line testSetOfTag_cases(?BER),
-
- ?line ?ber_driver(?BER,testExternal:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetOfTag:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetOfTag_cases(?BER)),
-
- ?line testExternal:compile(Config,?PER,[]),
- ?line testSetOfTag:compile(Config,?PER,[]),
- ?line testSetOfTag_cases(?PER),
-
- ?line ?per_bit_opt(testExternal:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSetOfTag:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testSetOfTag_cases(?PER)),
-
- ?line ?uper_bin(testExternal:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSetOfTag:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testSetOfTag_cases(uper_bin)),
-
- ?line testExternal:compile(Config,?PER,[optimize]),
- ?line testSetOfTag:compile(Config,?PER,[optimize]),
- ?line testSetOfTag_cases(?PER).
-
-testSetOfTag_cases(Rules) ->
- ?line testSetOfTag:main(Rules).
-
-
-sequence(suite) -> [{sequence,all}].
-
-c_syntax(suite) -> [];
-c_syntax(Config) ->
- ?line DataDir% ?line testExternal:compile(Config,?PER),
-% ?line testPrimExternal:compile(Config,?PER),
-% ?line testPrimExternal_cases(?PER).
- = ?config(data_dir,Config),
- ?line _TempDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line {error,_R1} = asn1ct:compile(filename:join(DataDir,"Syntax")),
- ?line {error,_R2} = asn1ct:compile(filename:join(DataDir,"BadTypeEnding")),
- ?line {error,_R3} = asn1ct:compile(filename:join(DataDir,
- "BadValueAssignment1")),
- ?line {error,_R4} = asn1ct:compile(filename:join(DataDir,
- "BadValueAssignment2")),
- ?line {error,_R5} = asn1ct:compile(filename:join(DataDir,
- "BadValueSet")),
- ?line {error,_R6} = asn1ct:compile(filename:join(DataDir,
- "ChoiceBadExtension")),
- ?line {error,_R7} = asn1ct:compile(filename:join(DataDir,
- "EnumerationBadExtension")),
- ?line {error,_R8} = asn1ct:compile(filename:join(DataDir,
- "Example")),
- ?line {error,_R9} = asn1ct:compile(filename:join(DataDir,
- "Export1")),
- ?line {error,_R10} = asn1ct:compile(filename:join(DataDir,
- "MissingEnd")),
- ?line {error,_R11} = asn1ct:compile(filename:join(DataDir,
- "SequenceBadComma")),
- ?line {error,_R12} = asn1ct:compile(filename:join(DataDir,
- "SequenceBadComponentName")),
- ?line {error,_R13} = asn1ct:compile(filename:join(DataDir,
- "SequenceBadComponentType")),
- ?line {error,_R14} = asn1ct:compile(filename:join(DataDir,
- "SeqBadComma")).
-
-
-c_string_per(suite) -> [];
-c_string_per(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line TempDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?PER,{outdir,TempDir}]).
-
-c_string_ber(suite) -> [];
-c_string_ber(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line TempDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(filename:join(DataDir,"String"),[?BER,{outdir,TempDir}]).
-
-
-c_implicit_before_choice(suite) -> [];
-c_implicit_before_choice(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line TempDir = ?config(priv_dir,Config),
- ?line {error,_R2} = asn1ct:compile(filename:join(DataDir,"CCSNARG3"),[?BER,{outdir,TempDir}]).
-
-parse(suite) -> [];
-parse(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- M1 = test_modules(),
-% M2 = parse_modules(),
- ?line ok = parse1(M1,DataDir,OutDir).
-
-parse1([M|T],DataDir,OutDir) ->
- ?line ok = asn1ct:compile(DataDir ++ M,[abs,{outdir,OutDir}]),
- parse1(T,DataDir,OutDir);
-parse1([],_,_) ->
- ok.
-
-per(suite) -> [];
-per(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = per1(per_modules(),DataDir,OutDir),
- ?line ?per_bit_opt(per1_bit_opt(per_modules(),DataDir,OutDir)),
- ?line ok = per1_opt(per_modules(),DataDir,OutDir).
-
-
-per1([M|T],DataDir,OutDir) ->
- ?line ok = asn1ct:compile(DataDir ++ M,[?PER,{outdir,OutDir}]),
- ?line ok = asn1ct:test(list_to_atom(M)),
- per1(T,DataDir,OutDir);
-per1([],_,_) ->
- ok.
-
-per1_bit_opt([M|T],DataDir,OutDir) ->
- ?line ok = asn1ct:compile(DataDir ++ M,[?PER,optimize,{outdir,OutDir}]),
- ?line ok = asn1ct:test(list_to_atom(M)),
- per1_bit_opt(T,DataDir,OutDir);
-per1_bit_opt([],_,_) ->
- ok.
-
-per1_opt([M|T],DataDir,OutDir) ->
- ?line ok = asn1ct:compile(DataDir ++ M,[?PER,optimized,{outdir,OutDir}]),
- ?line ok = asn1ct:test(list_to_atom(M)),
- per1_opt(T,DataDir,OutDir);
-per1_opt([],_,_) ->
- ok.
-
-ber_choiceinseq(suite) ->[];
-ber_choiceinseq(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(filename:join(DataDir,"ChoiceInSeq"),[?BER,{outdir,OutDir}]).
-
-ber_optional(suite) ->[];
-ber_optional(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(filename:join(DataDir,"SOpttest"),[?BER,{outdir,OutDir}]),
- ?line V = {'S',{'A',10,asn1_NOVALUE,asn1_NOVALUE},
- {'B',asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE},
- {'C',asn1_NOVALUE,111,asn1_NOVALUE}},
- ?line {ok,B} = asn1_wrapper:encode('SOpttest','S',V),
- ?line Bytes = lists:flatten(B),
- ?line V2 = asn1_wrapper:decode('SOpttest','S',Bytes),
- ?line ok = eq(V,element(2,V2)).
-
-ber_optional_keyed_list(suite) ->[];
-ber_optional_keyed_list(Config) ->
- case ?BER of
- ber_bin_v2 -> ok;
- _ ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(filename:join(DataDir,"SOpttest"),
- [?BER,keyed_list,{outdir,OutDir}]),
- ?line Vrecord = {'S',{'A',10,asn1_NOVALUE,asn1_NOVALUE},
- {'B',asn1_NOVALUE,asn1_NOVALUE,asn1_NOVALUE},
- {'C',asn1_NOVALUE,111,asn1_NOVALUE}},
- ?line V = [ {a,[{scriptKey,10}]},
- {b,[]},
- {c,[{callingPartysCategory,111}]} ],
- ?line {ok,B} = asn1_wrapper:encode('SOpttest','S',V),
- ?line Bytes = lists:flatten(B),
- ?line V2 = asn1_wrapper:decode('SOpttest','S',Bytes),
- ?line ok = eq(Vrecord,element(2,V2))
- end.
-
-
-eq(V,V) ->
- ok.
-
-
-ber_other(suite) ->[];
-ber_other(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = ber1(ber_modules(),DataDir,OutDir).
-
-
-ber1([M|T],DataDir,OutDir) ->
- ?line ok = asn1ct:compile(DataDir ++ M,[?BER,{outdir,OutDir}]),
- ?line ok = asn1ct:test(list_to_atom(M)),
- ber1(T,DataDir,OutDir);
-ber1([],_,_) ->
- ok.
-
-default_per(suite) ->[];
-default_per(Config) ->
- default1(?PER,Config,[]).
-
-default_per_opt(suite) -> [];
-default_per_opt(Config) ->
- ?per_bit_opt(default1(?PER,Config,[optimize])),
- default1(?PER,Config,[optimize]).
-
-default_ber(suite) ->[];
-default_ber(Config) ->
- default1(?BER,Config,[]).
-
-default1(Rule,Config,Options) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "Def",[Rule,{outdir,OutDir}]++Options),
- ?line {ok,Bytes1} = asn1_wrapper:encode('Def','Def1',#'Def1'{bool0 = true,
- bool1 = true,
- bool2 = true,
- bool3 = true}),
- ?line {ok,{'Def1',true,true,true,true}} = asn1_wrapper:decode('Def','Def1',lists:flatten(Bytes1)),
-
- ?line {ok,Bytes2} = asn1_wrapper:encode('Def','Def1',#'Def1'{bool0 = true}),
- ?line {ok,{'Def1',true,false,false,false}} = asn1_wrapper:decode('Def','Def1',lists:flatten(Bytes2)),
-
- ?line {ok,Bytes3} = asn1_wrapper:encode('Def','Def1',#'Def1'{bool0 = true,bool2=false}),
- ?line {ok,{'Def1',true,false,false,false}} = asn1_wrapper:decode('Def','Def1',lists:flatten(Bytes3)).
-
-
-value_test(suite) ->[];
-value_test(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ObjIdValues",[?BER,{outdir,OutDir}]),
- ?line {ok,_} = asn1_wrapper:encode('ObjIdValues','ObjIdType','ObjIdValues':'mobileDomainId'()),
- ?line ok = asn1ct:compile(DataDir ++ "ObjIdValues",[?PER,{outdir,OutDir}]),
- ?line {ok,_} = asn1_wrapper:encode('ObjIdValues','ObjIdType','ObjIdValues':'mobileDomainId'()),
- ?line ok = test_bad_values:tests(Config),
- ok.
-
-
-constructed(suite) ->
- [];
-constructed(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "Constructed",[?BER,{outdir,OutDir}]),
- ?line {ok,B} = asn1_wrapper:encode('Constructed','S',{'S',false}),
- ?line [40,3,1,1,0] = lists:flatten(B),
- ?line {ok,B1} = asn1_wrapper:encode('Constructed','S2',{'S2',false}),
- ?line [40,5,48,3,1,1,0] = lists:flatten(B1),
- ?line {ok,B2} = asn1_wrapper:encode('Constructed','I',10),
- ?line [136,1,10] = lists:flatten(B2),
- ok.
-
-ber_decode_error(suite) -> [];
-ber_decode_error(Config) ->
- ?line ok = ber_decode_error:compile(Config,?BER,[]),
- ?line ok = ber_decode_error:run([]),
-
- ?line ok = ?ber_driver(?BER,ber_decode_error:compile(Config,?BER,[driver])),
- ?line ok = ?ber_driver(?BER,ber_decode_error:run([driver])),
- ok.
-
-h323test(suite) ->
- [];
-h323test(Config) ->
- ?line ok = h323test:compile(Config,?PER,[]),
- ?line ok = h323test:run(?PER),
- ?line ?per_bit_opt(h323test:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(h323test:run(?PER)),
- ?line ?uper_bin(h323test:compile(Config,uper_bin,[])),
- ?line ?uper_bin(h323test:run(uper_bin)),
- ?line ok = h323test:compile(Config,?PER,[optimize]),
- ?line ok = h323test:run(?PER),
- ok.
-
-per_GeneralString(suite) ->
- [];
-per_GeneralString(Config) ->
- case erlang:module_loaded('MULTIMEDIA-SYSTEM-CONTROL') of
- true ->
- ok;
- false ->
- h323test:compile(Config,?PER,[])
- end,
- UI = [109,64,1,57],
- ?line {ok,_V} = asn1_wrapper:decode('MULTIMEDIA-SYSTEM-CONTROL',
- 'MultimediaSystemControlMessage',UI).
-
-per_open_type(suite) ->
- [];
-per_open_type(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line ok = asn1ct:compile(DataDir ++ "OpenType",[?PER,{outdir,OutDir}]),
- Stype = {'Stype',10,true},
- ?line {ok,Bytes} = asn1_wrapper:encode('OpenType','Ot',Stype),
- ?line {ok,Stype} = asn1_wrapper:decode('OpenType','Ot',Bytes),
-
- ?line ?per_bit_opt(ok = asn1ct:compile(DataDir ++ "OpenType",
- [?PER,optimize,{outdir,OutDir}])),
- ?line ?per_bit_opt({ok,Bytes}=asn1_wrapper:encode('OpenType','Ot',Stype)),
- ?line ?per_bit_opt({ok,Stype}=asn1_wrapper:decode('OpenType','Ot',Bytes)),
-
- ?line ?uper_bin(ok = asn1ct:compile(DataDir ++ "OpenType",
- [uper_bin,{outdir,OutDir}])),
- ?line ?uper_bin({ok,Bytes}=asn1_wrapper:encode('OpenType','Ot',Stype)),
- ?line ?uper_bin({ok,Stype}=asn1_wrapper:decode('OpenType','Ot',Bytes)),
-
- ?line ok = asn1ct:compile(DataDir ++ "OpenType",
- [?PER,optimize,{outdir,OutDir}]),
- ?line {ok,Bytes} = asn1_wrapper:encode('OpenType','Ot',Stype),
- ?line {ok,Stype} = asn1_wrapper:decode('OpenType','Ot',Bytes).
-
-testConstraints(suite) ->
- [];
-testConstraints(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testConstraints:compile(Config,?BER,[]),
- ?line testConstraints:int_constraints(?BER),
-
- ?line ?ber_driver(?BER,testConstraints:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testConstraints:int_constraints(?BER)),
-
- ?line testConstraints:compile(Config,?PER,[]),
- ?line testConstraints:int_constraints(?PER),
- ?line testConstraints:refed_NNL_name(?PER),
-
- ?line ?per_bit_opt(testConstraints:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testConstraints:int_constraints(?PER)),
- ?line ?per_bit_opt(testConstraints:refed_NNL_name(?PER)),
-
- ?line ?uper_bin(testConstraints:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testConstraints:int_constraints(uper_bin)),
- ?line ?uper_bin(testConstraints:refed_NNL_name(uper_bin)),
-
- ?line testConstraints:compile(Config,?PER,[optimize]),
- ?line testConstraints:int_constraints(?PER),
- ?line testConstraints:refed_NNL_name(?PER).
-
-testSeqIndefinite(suite) -> [];
-testSeqIndefinite(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testSeqIndefinite:compile(Config,?BER,[]),
- ?line testSeqIndefinite:main(?BER),
-
- ?line ?ber_driver(?BER,testSeqIndefinite:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSeqIndefinite:main(?BER)).
-
-testSetIndefinite(suite) -> [];
-testSetIndefinite(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testSetIndefinite:compile(Config,?BER,[]),
- ?line testSetIndefinite:main(?BER),
-
- ?line ?ber_driver(?BER,testSetIndefinite:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testSetIndefinite:main(?BER)).
-
-testChoiceIndefinite(suite) -> [];
-testChoiceIndefinite(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testChoiceIndefinite:compile(Config,?BER,[]),
- ?line testChoiceIndefinite:main(?BER),
-
- ?line ?ber_driver(?BER,testChoiceIndefinite:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testChoiceIndefinite:main(?BER)).
-
-testInfObjectClass(suite) ->
- [];
-testInfObjectClass(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testInfObjectClass:compile(Config,?PER,[]),
- ?line testInfObjectClass:main(?PER),
- ?line testInfObj:compile(Config,?PER,[]),
- ?line testInfObj:main(?PER),
-
- ?line ?per_bit_opt(testInfObjectClass:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testInfObjectClass:main(?PER)),
- ?line ?per_bit_opt(testInfObj:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testInfObj:main(?PER)),
-
- ?line ?uper_bin(testInfObjectClass:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testInfObjectClass:main(uper_bin)),
- ?line ?uper_bin(testInfObj:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testInfObj:main(uper_bin)),
-
- ?line testInfObjectClass:compile(Config,?PER,[optimize]),
- ?line testInfObjectClass:main(?PER),
- ?line testInfObj:compile(Config,?PER,[optimize]),
- ?line testInfObj:main(?PER),
-
- ?line testInfObjectClass:compile(Config,?BER,[]),
- ?line testInfObjectClass:main(?BER),
- ?line testInfObj:compile(Config,?BER,[]),
- ?line testInfObj:main(?BER),
-
- ?line ?ber_driver(?BER,testInfObjectClass:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testInfObjectClass:main(?BER)),
- ?line ?ber_driver(?BER,testInfObj:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testInfObj:main(?BER)),
-
- ?line testInfObj:compile_RANAPfiles(Config,?PER,[]),
-
- ?line ?per_bit_opt(testInfObj:compile_RANAPfiles(Config,?PER,[optimize])),
-
- ?line ?uper_bin(testInfObj:compile_RANAPfiles(Config,uper_bin,[])),
-
- ?line testInfObj:compile_RANAPfiles(Config,?PER,[optimize]),
-
- ?line testInfObj:compile_RANAPfiles(Config,?BER,[]).
-
-testParameterizedInfObj(suite) ->
- [];
-testParameterizedInfObj(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testParameterizedInfObj:compile(Config,?PER,[]),
- ?line testParameterizedInfObj:main(?PER),
-
- ?line ?per_bit_opt(testParameterizedInfObj:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testParameterizedInfObj:main(?PER)),
-
- ?line ?uper_bin(testParameterizedInfObj:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testParameterizedInfObj:main(uper_bin)),
-
- ?line testParameterizedInfObj:compile(Config,?PER,[optimize]),
- ?line testParameterizedInfObj:main(?PER),
-
- ?line testParameterizedInfObj:compile(Config,?BER,[]),
- ?line testParameterizedInfObj:main(?BER),
-
- ?line ?ber_driver(?BER,testParameterizedInfObj:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testParameterizedInfObj:main(?BER)).
-
-testMergeCompile(suite) ->
- [];
-testMergeCompile(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testMergeCompile:compile(Config,?PER,[]),
- ?line testMergeCompile:main(?PER),
- ?line testMergeCompile:mvrasn(?PER),
-
- ?line ?per_bit_opt(testMergeCompile:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testMergeCompile:main(?PER)),
- ?line ?per_bit_opt(testMergeCompile:mvrasn(?PER)),
-
- ?line ?uper_bin(testMergeCompile:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testMergeCompile:main(uper_bin)),
- ?line ?uper_bin(testMergeCompile:mvrasn(uper_bin)),
-
- ?line testMergeCompile:compile(Config,?BER,[]),
- ?line testMergeCompile:main(?BER),
- ?line testMergeCompile:mvrasn(?BER),
-
- ?line ?ber_driver(?BER,testMergeCompile:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testMergeCompile:main(?BER)),
- ?line ?ber_driver(?BER,testMergeCompile:mvrasn(?BER)).
-
-testobj(suite) ->
- [];
-testobj(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = testRANAP:compile(Config,?PER,[]),
- ?line ok = testRANAP:testobj(?PER),
- ?line ok = testParameterizedInfObj:ranap(?PER),
-
- ?line ?per_bit_opt(ok = testRANAP:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(ok = testRANAP:testobj(?PER)),
- ?line ?per_bit_opt(ok = testParameterizedInfObj:ranap(?PER)),
-
- ?line ?uper_bin(ok = testRANAP:compile(Config,uper_bin,[])),
- ?line ?uper_bin(ok = testRANAP:testobj(uper_bin)),
- ?line ?uper_bin(ok = testParameterizedInfObj:ranap(uper_bin)),
-
- ?line ok = testRANAP:compile(Config,?PER,[optimize]),
- ?line ok = testRANAP:testobj(?PER),
- ?line ok = testParameterizedInfObj:ranap(?PER),
-
- ?line ok = testRANAP:compile(Config,?BER,[]),
- ?line ok = testRANAP:testobj(?BER),
- ?line ok = testParameterizedInfObj:ranap(?BER),
-
- ?line ?ber_driver(?BER,testRANAP:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testRANAP:testobj(?BER)),
- ?line ?ber_driver(?BER,testParameterizedInfObj:ranap(?BER)).
-
-
-testDeepTConstr(suite) ->
- [];
-testDeepTConstr(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testDeepTConstr:compile(Config,?PER,[]),
- ?line testDeepTConstr:main(?PER),
-
- ?line ?per_bit_opt(testDeepTConstr:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testDeepTConstr:main(?PER)),
-
- ?line ?uper_bin(testDeepTConstr:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testDeepTConstr:main(uper_bin)),
-
- ?line testDeepTConstr:compile(Config,?PER,[optimize]),
- ?line testDeepTConstr:main(?PER),
-
- ?line testDeepTConstr:compile(Config,?BER,[]),
- ?line testDeepTConstr:main(?BER),
-
- ?line ?ber_driver(?BER,testDeepTConstr:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testDeepTConstr:main(?BER)).
-
-testInvokeMod(suite) ->
- [];
-testInvokeMod(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(filename:join(DataDir,"PrimStrings"),[{outdir,OutDir}]),
- ?line {ok,_Result1} = 'PrimStrings':encode('Bs1',[1,0,1,0]),
- ?line ok = asn1ct:compile(filename:join(DataDir,"PrimStrings"),[?PER,{outdir,OutDir}]),
- ?line {ok,_Result2} = 'PrimStrings':encode('Bs1',[1,0,1,0]).
-
-testExport(suite) ->
- [];
-testExport(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line {error,{asn1,_Reason}} = asn1ct:compile(filename:join(DataDir,"IllegalExport"),[{outdir,OutDir}]).
-
-testImport(suite) ->
- [];
-testImport(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line _OutDir = ?config(priv_dir,Config),
- ?line {error,_} = asn1ct:compile(filename:join(DataDir,"ImportsFrom"),[?BER]),
- ok.
-
-testMegaco(suite) ->
- [];
-testMegaco(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
- io:format("Config: ~p~n",[Config]),
- ?line {ok,ModuleName1,ModuleName2} = testMegaco:compile(Config,?BER,[]),
- ?line ok = testMegaco:main(ModuleName1,Config),
- ?line ok = testMegaco:main(ModuleName2,Config),
-
- case ?BER of
- ber_bin_v2 ->
- ?line {ok,ModuleName3,ModuleName4} = testMegaco:compile(Config,?BER,[driver]),
- ?line ok = testMegaco:main(ModuleName3,Config),
- ?line ok = testMegaco:main(ModuleName4,Config);
- _-> ok
- end,
-
- ?line {ok,ModuleName5,ModuleName6} = testMegaco:compile(Config,?PER,[]),
- ?line ok = testMegaco:main(ModuleName5,Config),
- ?line ok = testMegaco:main(ModuleName6,Config),
-
- ?line ?per_bit_opt({ok,ModuleName5,ModuleName6} = testMegaco:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(ok = testMegaco:main(ModuleName5,Config)),
- ?line ?per_bit_opt(ok = testMegaco:main(ModuleName6,Config)),
-
- ?line ?uper_bin({ok,ModuleName5,ModuleName6} = testMegaco:compile(Config,uper_bin,[])),
- ?line ?uper_bin(ok = testMegaco:main(ModuleName5,Config)),
- ?line ?uper_bin(ok = testMegaco:main(ModuleName6,Config)),
-
- ?line {ok,ModuleName7,ModuleName8} = testMegaco:compile(Config,?PER,[optimize]),
- ?line ok = testMegaco:main(ModuleName7,Config),
- ?line ok = testMegaco:main(ModuleName8,Config).
-
-
-testMvrasn6(suite) -> [];
-testMvrasn6(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testMvrasn6:compile(Config,?BER),
- ?line testMvrasn6:main().
-
-testContextSwitchingTypes(suite) -> [];
-testContextSwitchingTypes(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testContextSwitchingTypes:compile(Config,?BER,[]),
- ?line testContextSwitchingTypes:test(),
-
- ?line ?ber_driver(?BER,testContextSwitchingTypes:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testContextSwitchingTypes:test()),
-
- ?line testContextSwitchingTypes:compile(Config,?PER,[]),
- ?line testContextSwitchingTypes:test(),
-
- ?line ?per_bit_opt(testContextSwitchingTypes:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testContextSwitchingTypes:test()),
-
- ?line ?uper_bin(testContextSwitchingTypes:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testContextSwitchingTypes:test()),
-
- ?line testContextSwitchingTypes:compile(Config,?PER,[optimize]),
- ?line testContextSwitchingTypes:test().
-
-testTypeValueNotation(suite) -> [];
-testTypeValueNotation(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- case ?BER of
- Ber when Ber == ber; Ber == ber_bin ->
- ?line testTypeValueNotation:compile(Config,?BER,[]),
- ?line testTypeValueNotation:main(?BER,dummy);
- _ ->
- ok
- end,
-
- ?line ?ber_driver(?BER,testTypeValueNotation:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testTypeValueNotation:main(?BER,optimize)),
-
- case ?BER of
- Ber2 when Ber2 == ber; Ber2 == ber_bin ->
- ?line testTypeValueNotation:compile(Config,?PER,[]),
- ?line testTypeValueNotation:main(?PER,dummy);
- _ ->
- ok
- end,
-
- ?line ?per_bit_opt(testTypeValueNotation:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testTypeValueNotation:main(?PER,optimize)),
-
- ?line ?uper_bin(testTypeValueNotation:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testTypeValueNotation:main(uper_bin,optimize)),
- case ?BER of
- Ber3 when Ber3 == ber; Ber3 == ber_bin ->
- ?line testTypeValueNotation:compile(Config,?PER,[optimize]),
- ?line testTypeValueNotation:main(?PER,optimize);
- _ ->
- ok
- end.
-
-testOpenTypeImplicitTag(suite) -> [];
-testOpenTypeImplicitTag(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testOpenTypeImplicitTag:compile(Config,?BER,[]),
- ?line testOpenTypeImplicitTag:main(?BER),
-
- ?line ?ber_driver(?BER,testOpenTypeImplicitTag:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testOpenTypeImplicitTag:main(?BER)),
-
- ?line testOpenTypeImplicitTag:compile(Config,?PER,[]),
- ?line testOpenTypeImplicitTag:main(?PER),
-
- ?line ?per_bit_opt(testOpenTypeImplicitTag:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testOpenTypeImplicitTag:main(?PER)),
-
- ?line ?uper_bin(testOpenTypeImplicitTag:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testOpenTypeImplicitTag:main(uper_bin)),
-
- ?line testOpenTypeImplicitTag:compile(Config,?PER,[optimize]),
- ?line testOpenTypeImplicitTag:main(?PER).
-
-duplicate_tags(suite) -> [];
-duplicate_tags(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- {error,{asn1,[{error,{type,_,_,'SeqOpt1Imp',{asn1,{duplicates_of_the_tags,_}}}}]}} =
- asn1ct:compile(filename:join(DataDir,"SeqOptional2"),[abs]),
- ok.
-
-rtUI(suite) -> [];
-rtUI(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line ok = asn1ct:compile(filename:join(DataDir,"Prim"),[?BER]),
- ?line {ok,_} = asn1rt:info('Prim'),
-
- ?line ok = asn1ct:compile(filename:join(DataDir,"Prim"),[?PER]),
- ?line {ok,_} = asn1rt:info('Prim').
-
-testROSE(suite) -> [];
-testROSE(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testROSE:compile(Config,?BER,[]),
-
- ?line testROSE:compile(Config,?PER,[]),
- ?line ?per_bit_opt(testROSE:compile(Config,?PER,[optimize])),
- ?line ?uper_bin(testROSE:compile(Config,uper_bin,[])),
- ?line testROSE:compile(Config,?PER,[optimize]).
-
-testINSTANCE_OF(suite) -> [];
-testINSTANCE_OF(Config) ->
- ?line testINSTANCE_OF:compile(Config,?BER,[]),
- ?line testINSTANCE_OF:main(?BER),
-
- ?line ?ber_driver(?BER,testINSTANCE_OF:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testINSTANCE_OF:main(?BER)),
-
- ?line testINSTANCE_OF:compile(Config,?PER,[]),
- ?line testINSTANCE_OF:main(?PER),
-
- ?line ?per_bit_opt(testINSTANCE_OF:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testINSTANCE_OF:main(?PER)),
-
- ?line ?uper_bin(testINSTANCE_OF:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testINSTANCE_OF:main(uper_bin)),
-
- ?line testINSTANCE_OF:compile(Config,?PER,[optimize]),
- ?line testINSTANCE_OF:main(?PER).
-
-testTCAP(suite) -> [];
-testTCAP(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testTCAP:compile(Config,?BER,[]),
- ?line testTCAP:test(?BER,Config),
-
- ?line ?ber_driver(?BER,testTCAP:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testTCAP:test(?BER,Config)),
-
- ?line ?ber_driver(?BER,testTCAP:compile_asn1config(Config,?BER,[asn1config])),
- ?line ?ber_driver(?BER,testTCAP:test_asn1config()).
-
-testDER(suite) ->[];
-testDER(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line testDER:compile(Config,?BER,[]),
- ?line testDER:test(),
-
- ?line ?ber_driver(?BER,testDER:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testDER:test()),
-
- ?line testParamBasic:compile_der(Config,?BER),
- ?line testParamBasic_cases(der),
-
-
- ?line testSeqSetDefaultVal:compile(Config,?BER),
- ?line testSeqSetDefaultVal_cases(?BER).
-
-testSeqSetDefaultVal_cases(?BER) ->
- ?line testSeqSetDefaultVal:main(?BER).
-
-
-specialized_decodes(suite) -> [];
-specialized_decodes(Config) ->
- ?line test_partial_incomplete_decode:compile(Config,?BER,[optimize]),
- ?line test_partial_incomplete_decode:test(?BER,Config),
- ?line test_selective_decode:test(?BER,Config).
-
-special_decode_performance(suite) ->[];
-special_decode_performance(Config) ->
- ?line ?ber_driver(?BER,test_special_decode_performance:compile(Config,?BER)),
- ?line ?ber_driver(?BER,test_special_decode_performance:go(all)).
-
-
-test_driver_load(suite) -> [];
-test_driver_load(Config) ->
- ?line test_driver_load:compile(Config,?PER),
- ?line test_driver_load:test(?PER,5).
-
-test_ParamTypeInfObj(suite) -> [];
-test_ParamTypeInfObj(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line ok = asn1ct:compile(filename:join(DataDir,"IN-CS-1-Datatypes"),[ber_bin]).
-
-test_WS_ParamClass(suite) -> [];
-test_WS_ParamClass(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line ok = asn1ct:compile(filename:join(DataDir,"InformationFramework"),
- [ber_bin]).
-
-test_Defed_ObjectIdentifier(suite) -> [];
-test_Defed_ObjectIdentifier(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line ok = asn1ct:compile(filename:join(DataDir,"UsefulDefinitions"),
- [ber_bin]).
-
-testSelectionType(suite) -> [];
-testSelectionType(Config) ->
-
- ?line ok = testSelectionTypes:compile(Config,?BER,[]),
- ?line {ok,_} = testSelectionTypes:test(),
-
- ?line ok = testSelectionTypes:compile(Config,?PER,[]),
- ?line {ok,_} = testSelectionTypes:test().
-
-testSSLspecs(suite) -> [];
-testSSLspecs(Config) ->
-
- ?line ok = testSSLspecs:compile(Config,?BER,
- [optimize,compact_bit_string,der]),
- ?line testSSLspecs:run(?BER),
-
- case code:which(asn1ct) of
- cover_compiled ->
- ok;
- _ ->
- ?line ok = testSSLspecs:compile_inline(Config,?BER),
- ?line ok = testSSLspecs:run_inline(?BER)
- end.
-
-testNortel(suite) -> [];
-testNortel(Config) ->
- ?line DataDir = ?config(data_dir,Config),
-
- ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"),[?BER]),
- ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"),
- [?BER,optimize]),
- ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"),
- [?BER,optimize,driver]),
- ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"),[?PER]),
- ?line ?per_bit_opt(ok = asn1ct:compile(filename:join(DataDir,"Nortel"),
- [?PER,optimize])),
- ?line ?uper_bin(ok = asn1ct:compile(filename:join(DataDir,"Nortel"),[uper_bin])),
- ?line ok = asn1ct:compile(filename:join(DataDir,"Nortel"),
- [?PER,optimize]).
-test_undecoded_rest(suite) -> [];
-test_undecoded_rest(Config) ->
-
- ?line ok = test_undecoded_rest:compile(Config,?BER,[]),
- ?line ok = test_undecoded_rest:test([]),
-
- ?line ok = test_undecoded_rest:compile(Config,?BER,[undec_rest]),
- ?line ok = test_undecoded_rest:test(undec_rest),
-
- ?line ok = test_undecoded_rest:compile(Config,?PER,[]),
- ?line ok = test_undecoded_rest:test([]),
-
- ?line ?per_bit_opt(ok = test_undecoded_rest:compile(Config,?PER,[optimize,undec_rest])),
- ?line ?per_bit_opt(ok = test_undecoded_rest:test(undec_rest)),
-
- ?line ?uper_bin(ok = test_undecoded_rest:compile(Config,uper_bin,[undec_rest])),
- ?line ?uper_bin(ok = test_undecoded_rest:test(undec_rest)),
-
- ?line ok = test_undecoded_rest:compile(Config,?PER,[undec_rest]),
- ?line ok = test_undecoded_rest:test(undec_rest).
-
-test_inline(suite) -> [];
-test_inline(Config) ->
- case code:which(asn1ct) of
- cover_compiled ->
- {skip,"Not runnable when cover compiled"};
- _ ->
- ?line ok=test_inline:compile(Config,?BER,[]),
- ?line test_inline:main(?BER),
- ?line test_inline:inline1(Config,?BER,[]),
- ?line test_inline:performance2()
- end.
-
-%test_inline_prf(suite) -> [];
-%test_inline_prf(Config) ->
-% ?line test_inline:performance(Config).
-
-testTcapsystem(suite) -> [];
-testTcapsystem(Config) ->
- ?line ok=testTcapsystem:compile(Config,?BER,[]).
-
-testNBAPsystem(suite) -> [];
-testNBAPsystem(Config) ->
- ?line ok=testNBAPsystem:compile(Config,?PER,?per_optimize(?BER)),
- ?line ok=testNBAPsystem:test(?PER,Config).
-
-test_compile_options(suite) -> [];
-test_compile_options(Config) ->
- case code:which(asn1ct) of
- cover_compiled ->
- {skip,"Not runnable when cover compiled"};
- _ ->
- ?line ok = test_compile_options:wrong_path(Config),
- ?line ok = test_compile_options:path(Config),
- ?line ok = test_compile_options:noobj(Config),
- ?line ok = test_compile_options:record_name_prefix(Config),
- ?line ok = test_compile_options:verbose(Config),
- ?line ok = test_compile_options:warnings_as_errors(Config)
- end.
-
-testDoubleEllipses(suite) -> [];
-testDoubleEllipses(Config) ->
- ?line testDoubleEllipses:compile(Config,?BER,[]),
- ?line testDoubleEllipses:main(?BER),
- ?line ?ber_driver(?BER,testDoubleEllipses:compile(Config,?BER,[driver])),
- ?line ?ber_driver(?BER,testDoubleEllipses:main(?BER)),
- ?line ?per_bit_opt(testDoubleEllipses:compile(Config,?PER,[optimize])),
- ?line ?per_bit_opt(testDoubleEllipses:main(?PER)),
- ?line ?uper_bin(testDoubleEllipses:compile(Config,uper_bin,[])),
- ?line ?uper_bin(testDoubleEllipses:main(uper_bin)),
- ?line testDoubleEllipses:compile(Config,?PER,?per_optimize(?BER)),
- ?line testDoubleEllipses:main(?PER).
-
-test_modified_x420(suite) -> [];
-test_modified_x420(Config) ->
- ?line test_modified_x420:compile(Config),
- ?line test_modified_x420:test_io(Config).
-
-testX420(suite) -> [];
-testX420(Config) ->
- ?line testX420:compile(?BER,[der],Config),
- ?line ok = testX420:ticket7759(?BER,Config),
- ?line testX420:compile(?PER,[],Config).
-
-test_x691(suite) -> [];
-test_x691(Config) ->
- case ?PER of
- per ->
- ?line ok = test_x691:compile(Config,uper_bin,[]),
- ?line true = test_x691:cases(uper_bin,unaligned),
- ?line ok = test_x691:compile(Config,?PER,[]),
- ?line true = test_x691:cases(?PER,aligned),
-%% ?line ok = asn1_test_lib:ticket_7678(Config,[]),
- ?line ok = asn1_test_lib:ticket_7708(Config,[]),
- ?line ok = asn1_test_lib:ticket_7763(Config);
- _ ->
- ?line ok = test_x691:compile(Config,?PER,?per_optimize(?BER)),
- ?line true = test_x691:cases(?PER,aligned)
- end.
-%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[]),
-%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[compact_bit_string]),
-%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[optimize]),
-%% ?line ok = asn1_test_lib:ticket_7876(Config,?PER,[optimize,compact_bit_string]).
-
-
-ticket_6143(suite) -> [];
-ticket_6143(Config) ->
- ?line ok = test_compile_options:ticket_6143(Config).
-
-testExtensionAdditionGroup(suite) -> [];
-testExtensionAdditionGroup(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line PrivDir = ?config(priv_dir,Config),
- ?line Path = code:get_path(),
- ?line code:add_patha(PrivDir),
- DoIt = fun(Erule) ->
- ?line ok = asn1ct:compile(filename:join(DataDir,"Extension-Addition-Group"),Erule ++ [{outdir,PrivDir}]),
- ?line {ok,_M} = compile:file(filename:join(DataDir,"extensionAdditionGroup"),[{i,PrivDir},{outdir,PrivDir},debug_info]),
- ?line ok = extensionAdditionGroup:run(Erule),
- ?line ok = extensionAdditionGroup:run2(Erule),
- ?line ok = asn1ct:compile(filename:join(DataDir,"EUTRA-RRC-Definitions"),Erule ++ [{record_name_prefix,"RRC-"},{outdir,PrivDir}]),
- ?line ok = extensionAdditionGroup:run3(Erule)
- end,
- ?line [DoIt(Rule)|| Rule <- [[per_bin],[per_bin,optimize],[uper_bin]]],
- %% FIXME problems with automatic tags [ber_bin],[ber_bin,optimize]
- ?line code:set_path(Path).
-
-
-
-% parse_modules() ->
-% ["ImportsFrom"].
-
-per_modules() ->
- [X || X <- test_modules()].
-ber_modules() ->
- [X || X <- test_modules(),
- X =/= "CommonDataTypes",
- X =/= "DS-EquipmentUser-CommonFunctionOrig-TransmissionPath",
- X =/= "H323-MESSAGES",
- X =/= "H235-SECURITY-MESSAGES",
- X =/= "MULTIMEDIA-SYSTEM-CONTROL"].
-test_modules() ->
- _Modules = [
- "BitStr",
- "CAP",
- "CommonDataTypes",
- "Constraints",
- "ContextSwitchingTypes",
- "DS-EquipmentUser-CommonFunctionOrig-TransmissionPath",
- "Enum",
- "From",
- "H235-SECURITY-MESSAGES",
- "H323-MESSAGES",
- %%"MULTIMEDIA-SYSTEM-CONTROL", recursive type , problem for asn1ct:value
- "Import",
- "Int",
- "MAP-commonDataTypes",
-% ambigous tags "MAP-insertSubscriberData-def",
- "Null",
- "Octetstr",
- "One",
- "P-Record",
- "P",
-% "PDUs",
- "Person",
- "PrimStrings",
- "Real",
- "XSeq",
- "XSeqOf",
- "XSet",
- "XSetOf",
- "String",
- "SwCDR",
-% "Syntax",
- "Time"
-% ANY "Tst",
-% "Two",
-% errors that should be detected "UndefType"
-] ++
- [
- "SeqSetLib", % must be compiled before Seq and Set
- "Seq",
- "Set",
- "SetOf",
- "SeqOf",
- "Prim",
- "Cho",
- "Def",
- "Opt",
- "ELDAPv3",
- "LDAP"
- ].
-
-
diff --git a/lib/asn1/test/asn1_SUITE_data/Constraints.py b/lib/asn1/test/asn1_SUITE_data/Constraints.py
index b18c29bd89..87243121f7 100644
--- a/lib/asn1/test/asn1_SUITE_data/Constraints.py
+++ b/lib/asn1/test/asn1_SUITE_data/Constraints.py
@@ -4,9 +4,14 @@ BEGIN
-- Single Value
SingleValue ::= INTEGER (1)
SingleValue2 ::= INTEGER (1..20)
+predefined INTEGER ::= 1
+SingleValue3 ::= INTEGER (predefined | 5 | 10)
Range2to19 ::= INTEGER (1<..<20)
Range10to20 ::= INTEGER (10..20)
ContainedSubtype ::= INTEGER (INCLUDES Range10to20)
+-- Some ranges for additional constrained number testing.
+LongLong ::= INTEGER (0..18446744073709551615)
+Range256to65536 ::= INTEGER (256..65536)
FixedSize ::= OCTET STRING (SIZE(10))
FixedSize2 ::= OCTET STRING (SIZE(10|20))
VariableSize ::= OCTET STRING (SIZE(1..10))
@@ -51,6 +56,7 @@ Thing ::= INTEGER {fred (0),fred2 (1),fred3 (2)}
AnotherThing ::= Thing (fred | fred2)
I ::= INTEGER (0|15..269) -- OTP-5457
+X1 ::= INTEGER (1..4 | 8 | 10 | 20) -- OTP-9946
-- OTP-5511
diff --git a/lib/asn1/test/asn1_SUITE_data/EnumN2N.asn1 b/lib/asn1/test/asn1_SUITE_data/EnumN2N.asn1
new file mode 100644
index 0000000000..a724f2f3f5
--- /dev/null
+++ b/lib/asn1/test/asn1_SUITE_data/EnumN2N.asn1
@@ -0,0 +1,25 @@
+EnumN2N DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+
+NoExt ::= ENUMERATED {
+ blue(0),
+ red(1),
+ green(2)
+}
+
+Ext ::= ENUMERATED {
+ blue(0),
+ red(1),
+ green(2),
+ ...
+}
+
+Ext2 ::= ENUMERATED {
+ blue(0),
+ red(1),
+ green(2),
+ ...,
+ orange(7)
+}
+
+END
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 fc244c30a2..55124f9449 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-2010. All Rights Reserved.
+-- Copyright Ericsson AB 2001-2012. 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
@@ -79,4 +79,22 @@ Ax3 ::= SEQUENCE {
}
-- { a 253, b TRUE, s {sa 17, sb TRUE, sextaddgroup 11}}
+
+-- This is to test the case with more than one ExtensionAdditionGroup
+-- which did not work before
+
+AS-Config ::= SEQUENCE {
+ a INTEGER,
+ b BOOLEAN,
+ c OCTET STRING,
+ ...,
+ [[ sourceSystemInformationBlockType1Ext OCTET STRING OPTIONAL,
+ sourceOtherConfig-r9 INTEGER
+ ]],
+ [[ sourceSCellConfigList-r10 OCTET STRING OPTIONAL
+ ]]
+}
+
+
+
END
diff --git a/lib/asn1/test/asn1_SUITE_data/LargeConstraints.py b/lib/asn1/test/asn1_SUITE_data/LargeConstraints.py
new file mode 100644
index 0000000000..68c7616b62
--- /dev/null
+++ b/lib/asn1/test/asn1_SUITE_data/LargeConstraints.py
@@ -0,0 +1,9 @@
+LargeConstraints DEFINITIONS ::=
+BEGIN
+
+-- Maximum number that can be encoded as a constrained whole number: 1 bsl (255*8)
+-- The number of octets needed to represent a number cannot be more than 255
+-- As the length field is encoded as a 8-bit bitfield.
+RangeMax ::= INTEGER (1..126238304966058622268417487065116999845484776053576109500509161826268184136202698801551568013761380717534054534851164138648904527931605160527688095259563605939964364716019515983399209962459578542172100149937763938581219604072733422507180056009672540900709554109516816573779593326332288314873251559077853068444977864803391962580800682760017849589281937637993445539366428356761821065267423102149447628375691862210717202025241630303118559188678304314076943801692528246980959705901641444238894928620825482303431806955690226308773426829503900930529395181208739591967195841536053143145775307050594328881077553168201547776)
+
+END
diff --git a/lib/asn1/test/asn1_app_test.erl b/lib/asn1/test/asn1_app_test.erl
index c3797f08b2..2c31c3259d 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -138,7 +138,7 @@ check_asn1ct_modules(Extra) ->
asn1ct_name,asn1ct_constructed_per,asn1ct_constructed_ber,
asn1ct_gen_ber,asn1ct_constructed_ber_bin_v2,
asn1ct_gen_ber_bin_v2,asn1ct_value,
- asn1ct_tok,asn1ct_parser2],
+ asn1ct_tok,asn1ct_parser2,asn1ct_table],
case Extra -- ASN1CTMods of
[] ->
ok;
diff --git a/lib/asn1/test/asn1_bin_particular_SUITE.erl.src b/lib/asn1/test/asn1_bin_particular_SUITE.erl.src
deleted file mode 100644
index 0e153238ad..0000000000
--- a/lib/asn1/test/asn1_bin_particular_SUITE.erl.src
+++ /dev/null
@@ -1,2 +0,0 @@
-
-particular() -> [].
diff --git a/lib/asn1/test/asn1_common_SUITE.erl.src b/lib/asn1/test/asn1_common_SUITE.erl.src
deleted file mode 100644
index 12512606d8..0000000000
--- a/lib/asn1/test/asn1_common_SUITE.erl.src
+++ /dev/null
@@ -1,95 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%%
-
-common() -> [{group,app_test}, {group,appup_test},testTimer_ber,testTimer_ber_bin,
- testTimer_ber_bin_opt, testTimer_ber_bin_opt_driver, testTimer_per,
- testTimer_per_bin, testTimer_per_bin_opt, testTimer_uper_bin,
- testComment,testName2Number].
-
-
-testTimer_ber(suite) -> [];
-testTimer_ber(Config) ->
- ?line testTimer:compile(Config,ber,[]),
- ?line testTimer:go(Config,ber).
-
-testTimer_ber_bin(suite) -> [];
-testTimer_ber_bin(Config) ->
- ?line testTimer:compile(Config,ber_bin,[]),
- ?line testTimer:go(Config,ber_bin).
-
-testTimer_ber_bin_opt(suite) -> [];
-testTimer_ber_bin_opt(Config) ->
- ?line testTimer:compile(Config,ber_bin,[optimize]),
- ?line testTimer:go(Config,ber_bin).
-
-testTimer_ber_bin_opt_driver(suite) -> [];
-testTimer_ber_bin_opt_driver(Config) ->
- ?line testTimer:compile(Config,ber_bin,[optimize,driver]),
- ?line testTimer:go(Config,ber_bin).
-
-testTimer_per(suite) -> [];
-testTimer_per(Config) ->
- ?line testTimer:compile(Config,per,[]),
- ?line testTimer:go(Config,per).
-
-testTimer_per_bin(suite) -> [];
-testTimer_per_bin(Config) ->
- ?line testTimer:compile(Config,per_bin,[]),
- ?line testTimer:go(Config,per_bin).
-
-testTimer_per_bin_opt(suite) -> [];
-testTimer_per_bin_opt(Config) ->
- ?line testTimer:compile(Config,per_bin,[optimize]),
- ?line testTimer:go(Config,per_bin).
-
-
-testTimer_uper_bin(suite) -> [];
-testTimer_uper_bin(Config) ->
- ?line ok=testTimer:compile(Config,uper_bin,[]),
- ?line {comment,_} = testTimer:go(Config,uper_bin).
-
-%% Test of multiple-line comment, OTP-8043
-testComment(suite) -> [];
-testComment(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
-
- ?line ok = asn1ct:compile(DataDir ++ "Comment",[{outdir,OutDir}]),
-
- ?line {ok,Enc} = asn1_wrapper:encode('Comment','Seq',{'Seq',12,true}),
- ?line {ok,{'Seq',12,true}} = asn1_wrapper:decode('Comment','Seq',Enc),
- ok.
-
-testName2Number(suite) -> [];
-testName2Number(Config) ->
- DataDir = ?config(data_dir,Config),
- OutDir = ?config(priv_dir,Config),
- N2NOptions = [{n2n,Type}|| Type <-
- ['CauseMisc','CauseProtocol',
- %% 'CauseNetwork',
- 'CauseRadioNetwork',
- 'CauseTransport','CauseNas']],
- ?line ok = asn1ct:compile(DataDir ++ "S1AP-IEs",[{outdir,OutDir}]++N2NOptions),
- ?line true = code:add_patha(OutDir),
-
- ?line 0 = 'S1AP-IEs':name2num_CauseMisc('control-processing-overload'),
- ?line 'unknown-PLMN' = 'S1AP-IEs':num2name_CauseMisc(5),
- ok.
-
diff --git a/lib/asn1/test/asn1_particular_SUITE.erl.src b/lib/asn1/test/asn1_particular_SUITE.erl.src
deleted file mode 100644
index df76de914d..0000000000
--- a/lib/asn1/test/asn1_particular_SUITE.erl.src
+++ /dev/null
@@ -1,10 +0,0 @@
-
-particular() -> [ticket_7407].
-
-ticket_7407(suite) -> [];
-ticket_7407(Config) ->
- ?line ok = asn1_test_lib:ticket_7407_compile(Config,[]),
- ?line ok = asn1_test_lib:ticket_7407_code(true),
-
- ?line ok = asn1_test_lib:ticket_7407_compile(Config,[no_final_padding]),
- ?line ok = asn1_test_lib:ticket_7407_code(false). \ No newline at end of file
diff --git a/lib/asn1/test/asn1_test_lib.erl b/lib/asn1/test/asn1_test_lib.erl
index 26cbdeb940..96c04a9436 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -19,11 +19,67 @@
%%
-module(asn1_test_lib).
+-export([compile/3]).
+-export([compile_all/3]).
+-export([compile_erlang/3]).
+
-export([ticket_7407_compile/2,ticket_7407_code/1, ticket_7678/2,
- ticket_7708/2, ticket_7763/1, ticket_7876/3]).
+ ticket_7708/2, ticket_7763/1, ticket_7876/3]).
-include_lib("test_server/include/test_server.hrl").
+compile(File, Config, Options) -> compile_all([File], Config, Options).
+
+compile_all(Files, Config, Options) ->
+ DataDir = ?config(data_dir, Config),
+ CaseDir = ?config(case_dir, Config),
+ [compile_file(filename:join(DataDir, F), [{outdir, CaseDir}|Options])
+ || F <- Files],
+ ok.
+
+compile_file(File, Options) ->
+ try
+ ok = asn1ct:compile(File, Options),
+ case should_load(File, Options) of
+ false ->
+ ok;
+ {module, Module} ->
+ code:purge(Module),
+ true = code:soft_purge(Module),
+ {module, Module} = code:load_file(Module)
+ end
+ catch
+ Class:Reason ->
+ erlang:error({compile_failed, {File, Options}, {Class, Reason}})
+ end.
+
+compile_erlang(Mod, Config, Options) ->
+ DataDir = ?config(data_dir, Config),
+ CaseDir = ?config(case_dir, Config),
+ M = list_to_atom(Mod),
+ {ok, M} = compile:file(filename:join(DataDir, Mod),
+ [{i, CaseDir}, {outdir, CaseDir}|Options]).
+
+should_load(File, Options) ->
+ should_load(File, lists:member(abs, Options),
+ proplists:lookup(inline, Options)).
+
+should_load(_File, true, _Inline) ->
+ false;
+should_load(_File, _Abs, {inline, Module}) when Module /= true ->
+ {module, Module};
+should_load(File, _Abs, _Inline) ->
+ {module, list_to_atom(strip_extension(filename:basename(File)))}.
+
+strip_extension(File) ->
+ strip_extension(File, filename:extension(File)).
+
+strip_extension(File, "") ->
+ File;
+strip_extension(File, Ext) when Ext == ".asn"; Ext == ".set"; Ext == ".asn1"->
+ strip_extension(filename:rootname(File));
+strip_extension(File, _Ext) ->
+ File.
ticket_7407_compile(Config,Option) ->
diff --git a/lib/asn1/test/ber_decode_error.erl b/lib/asn1/test/ber_decode_error.erl
index a566e0b07f..ff6e386a88 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -19,19 +19,10 @@
%%
-module(ber_decode_error).
--export([run/1, compile/3]).
+-export([run/1]).
-include_lib("test_server/include/test_server.hrl").
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "Constructed",
- [Rules,{outdir,OutDir}]++Options).
-
-
run([]) ->
?line {ok,B} = asn1_wrapper:encode('Constructed','S3',{'S3',17}),
?line [T,L|V] = lists:flatten(B),
diff --git a/lib/asn1/test/h323test.erl b/lib/asn1/test/h323test.erl
index 5545dd45b9..b7a7d6e4df 100644
--- a/lib/asn1/test/h323test.erl
+++ b/lib/asn1/test/h323test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -19,58 +19,20 @@
%%
-module(h323test).
--compile(export_all).
--export([compile/3,run/1]).
+-export([run/1]).
-include_lib("test_server/include/test_server.hrl").
-compile(Config,Rules,Options) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "H235-SECURITY-MESSAGES",[Rules,{outdir,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++ "H323-MESSAGES",[Rules,{outdir,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++ "MULTIMEDIA-SYSTEM-CONTROL",[Rules,{outdir,OutDir}]++Options).
-
-run(per_bin) ->
- run();
-run(per) ->
- run();
-run(_Rules) ->
- ok.
+run(per_bin) -> run();
+run(per) -> run();
+run(_Rules) -> ok.
run() ->
- ?line alerting(),
- ?line connect(),
+ alerting(),
+ connect(),
ok.
-arq() ->
- _AdmissionRequest = "27900007086000340036003300320038003700370101805337010180533600AC1F38C60693000D000445367AE75C5740120300AC1F38C6415004E0200100110000D7D22EA88D511C0200AC1F38C6C0580100".
-
-
-t0() ->
- Setup = "00B8060008914A0001010180533622C000000000074572696373736F6E0356302E3100010180533700AC1F38C206B80045367AE75C5740120300AC1F38C6415000411C110000D7D22EA88D511C0200AC1F3806C0583802150000080E1403001E80800A04000100AC1F38C661A820400000060401004E1403001E80801114000100AC1F38C72EE000AC1F38C72EE00100010063AA34AB"
-,
- ByteList = hexstr2bytes(Setup),
- asn1_wrapper:decode('H323-MESSAGES','H323-UU-PDU',ByteList).
-
-t1() ->
- AdmissionRequest = "27900007086000340036003300320038003700370101805337010180533600AC1F38C60693000D000445367AE75C5740120300AC1F38C6415004E0200100110000D7D22EA88D511C0200AC1F38C6C0580100",
- ByteList = hexstr2bytes(AdmissionRequest),
- asn1_wrapper:decode('H323-MESSAGES','RasMessage',ByteList).
-
-t2() ->
- Cs = "080200040504038090A56C059132303033700591323030347E00930500B8060008914A0001010180533622C000000000074572696373736F6E0356302E3100010180533700AC1F38C206B80045367AE75C5740120300AC1F38C6415000411C110000D7D22EA88D511C0200AC1F3806C0583802150000080E1403001E80800A04000100AC1F38C661A820400000060401004E1403001E80801114000100AC1F38C72EE000AC1F38C72EE00100010063AA34AB",
- ByteList = hexstr2bytes(Cs),
- asn1_wrapper:decode('H323-MESSAGES','H323-UU-PDU',ByteList).
-
-t3() ->
- Cs = "10b8060008914a0002044003004d0067006f006e018085cc22c0b500534c164d6963726f736f6674ae204e65744d656574696e67ae0003332e3000000101808c990088e1293a06b8001689edc5bf23d3118c2d00c04f4b1cd0000c07000a00000204dc40b500534c3c0200000028000000000000001b0000008138427484ccd211b4e300a0c90d0660100000001289edc5bf23d3118c2d00c04f4b1cd00000000000000000a615d9ee",
- ByteList = hexstr2bytes(Cs),
- asn1_wrapper:decode('H323-MESSAGES','H323-UU-PDU',ByteList).
-
dec_alerting() ->
Cs = "0380060008914a0002020120110000000000000000000000000000000000",
- _Slask="E83AE983",
ByteList = hexstr2bytes(Cs),
asn1_wrapper:decode('H323-MESSAGES','H323-UserInformation',ByteList).
@@ -78,95 +40,31 @@ enc_alerting(V) ->
asn1_wrapper:encode('H323-MESSAGES','H323-UserInformation',V).
alerting() ->
- ?line {ok,V} = dec_alerting(),
- ?line {ok,B} = enc_alerting(V),
- ?line ByteList = lists:flatten(B),
- ?line {ok,V} = asn1_wrapper:decode('H323-MESSAGES','H323-UserInformation',ByteList).
+ {ok,V} = dec_alerting(),
+ {ok,B} = enc_alerting(V),
+ ByteList = lists:flatten(B),
+ {ok,V} = asn1_wrapper:decode('H323-MESSAGES','H323-UserInformation',ByteList).
dec_connect() ->
Cs = "02c0060008914a00020088e1293a04a322c0b500534c164d6963726f736f6674ae204e65744d656474696e67ae0003332e3000001689edc5bf23d3118c2d00c04f4b1cd00900110000000000000000000000000000000000",
- _Slask="2f530a3f",
ByteList = hexstr2bytes(Cs),
asn1_wrapper:decode('H323-MESSAGES','H323-UserInformation',ByteList).
-
+
enc_connect(V) ->
asn1_wrapper:encode('H323-MESSAGES','H323-UserInformation',V).
connect() ->
- ?line {ok,V} = dec_connect(),
- ?line {ok,B} = enc_connect(V),
- ?line ByteList = lists:flatten(B),
- ?line {ok,V} = asn1_wrapper:decode('H323-MESSAGES','H323-UserInformation',ByteList).
+ {ok,V} = dec_connect(),
+ {ok,B} = enc_connect(V),
+ ByteList = lists:flatten(B),
+ {ok,V} = asn1_wrapper:decode('H323-MESSAGES','H323-UserInformation',ByteList).
-dec_h245_TCS() ->
- Cs ="02700106000881750003"
- "800d00003c000100000100000100000e"
- "807fff04b5428080010180000e483060"
- "0100800c96a88000002020b500534c48"
- "020000000000f4010000f40101000400"
- "0000000002000100401f000000100000"
- "000104002000f4010700000100000002"
- "00ff00000000c0004000f0000000cc01"
- "30ff880118ff00008000012040b38000"
- "0220c0b38000032020b500534c280200"
- "00000000a0000000a000040010000000"
- "000070000100401f0000580200000c00"
- "1000000000008000042020b500534c28"
- "020000000000a0000000a00004001000"
- "0000000071000100401f00003a070000"
- "25001000000000008000052020b50053"
- "4c280200000000008000000080000500"
- "14000000000072000100401f00000809"
- "000025001000000000008000062020b5"
- "00534c28020000000000800000008000"
- "050014000000000073000100401f0000"
- "7f0a00002b0010000000000080000722"
- "000b40000909a00120390c000a099001"
- "20390c000b09880120390c000c08a220"
- "3940000d089220390004800602070007"
- "00060004000500020001000000030000"
- "0a00000e800702070007000600040005"
- "000200010000000300000900000e8008"
- "02070007000600040005000200010000"
- "000300000c00000e8009020700070006"
- "00040005000200010000000300000b00"
- "000e800a020700070006000400050002"
- "00010000000300000d00000e0300000b"
- "01003280299d93369631bc",
- ByteList = hexstr2bytes(Cs),
- asn1_wrapper:decode('MULTIMEDIA-SYSTEM-CONTROL',
- 'MultimediaSystemControlMessage',ByteList).
-
- hexstr2bytes([D1,D2|T]) ->
+hexstr2bytes([D1,D2|T]) ->
[dig2num(D1)*16+dig2num(D2)|hexstr2bytes(T)];
hexstr2bytes([]) ->
[].
-dig2num(D) when D >= $0, D =< $9 ->
- D - $0;
-dig2num(D) when D >= $a, D =< $f ->
- 10 + D - $a;
-dig2num(D) when D >= $A, D =< $F ->
- 10 + D - $A.
-
-bytes2hexstr(Bytes) ->
- bytes2hexstr(Bytes,[]).
-
-bytes2hexstr([B|Bytes],Acc) ->
- D1 = num2dig(B bsr 4),
- D2 = num2dig(B band 15),
- bytes2hexstr(Bytes,[D2,D1|Acc]);
-bytes2hexstr([],Acc) ->
- lists:reverse(Acc).
-
-num2dig(Num) when Num =< 9 ->
- $0 + Num;
-num2dig(Num) ->
- $a + Num - 10.
-
-
-
-
-
-
+dig2num(D) when D >= $0, D =< $9 -> D - $0;
+dig2num(D) when D >= $a, D =< $f -> 10 + D - $a;
+dig2num(D) when D >= $A, D =< $F -> 10 + D - $A.
diff --git a/lib/asn1/test/asn1_bin_v2_particular_SUITE.erl.src b/lib/asn1/test/pem_performance.erl
index 4c3c8c7808..87b8cbd61d 100644
--- a/lib/asn1/test/asn1_bin_v2_particular_SUITE.erl.src
+++ b/lib/asn1/test/pem_performance.erl
@@ -1,276 +1,22 @@
-
-particular() -> [smp, ticket7904].
-
-
-smp(suite) -> [];
-smp(Config) ->
- case erlang:system_info(smp_support) of
- true ->
- NumOfProcs = erlang:system_info(schedulers),
- io:format("smp starting ~p workers\n",[NumOfProcs]),
-
- ?line Msg = {initiatingMessage, testNBAPsystem:cell_setup_req_msg()},
- ?line ok = testNBAPsystem:compile(Config,per_bin,[optimize]),
-
- enc_dec(NumOfProcs,Msg,2),
-
- N = 10000,
-
- ?line {Time1,ok} = timer:tc(?MODULE,enc_dec,[NumOfProcs,Msg, N]),
- ?line {Time1S,ok} = timer:tc(?MODULE,enc_dec,[1, Msg, NumOfProcs * N]),
-
- ?line ok = testNBAPsystem:compile(Config,ber_bin,[optimize,nif]),
- ?line {Time3,ok} = timer:tc(?MODULE,enc_dec,[NumOfProcs,Msg, N]),
-
- ?line {Time3S,ok} = timer:tc(?MODULE,enc_dec,[1, Msg, NumOfProcs * N]),
-
- {comment,lists:flatten(
- io_lib:format(
- "Encode/decode time parallell with ~p cores: ~p [microsecs]~n"
- "Encode/decode time sequential: ~p [microsecs]",
- [NumOfProcs,Time1+Time3,Time1S+Time3S]))};
- false ->
- {skipped,"No smp support"}
- end.
-
-per_performance(Config) ->
- PrivDir = proplists:get_value(priv_dir, Config),
- NifDir = filename:join(PrivDir,"nif"),
- ErlDir = filename:join(PrivDir,"erl"),
- file:make_dir(NifDir),file:make_dir(ErlDir),
-
- ?line Msg = {initiatingMessage, testNBAPsystem:cell_setup_req_msg()},
- ?line ok = testNBAPsystem:compile([{priv_dir,NifDir}|Config],per_bin,
- [optimize]),
- ?line ok = testNBAPsystem:compile([{priv_dir,ErlDir}|Config],per_bin,
- []),
-
- Modules = ['NBAP-CommonDataTypes',
- 'NBAP-Constants',
- 'NBAP-Containers',
- 'NBAP-IEs',
- 'NBAP-PDU-Contents',
- 'NBAP-PDU-Discriptions'],
-
-
- PreNif = fun() ->
- code:add_patha(NifDir),
- lists:foreach(fun(M) ->
- code:purge(M),
- code:load_file(M)
- end,Modules)
- end,
-
- PreErl = fun() ->
- code:add_patha(ErlDir),
- lists:foreach(fun(M) ->
- code:purge(M),
- code:load_file(M)
- end,Modules)
- end,
-
- Func = fun() ->
- element(1,timer:tc(
- asn1_wrapper,encode,['NBAP-PDU-Discriptions',
- 'NBAP-PDU',
- Msg]))
- end,
-
- nif_vs_erlang_performance({{{PreNif,Func},{PreErl,Func}},100000,32}).
-
-ber_performance(Config) ->
-
- ?line Msg = {initiatingMessage, testNBAPsystem:cell_setup_req_msg()},
- ?line ok = testNBAPsystem:compile(Config,ber_bin,[optimize,nif]),
-
-
- BerFun = fun() ->
- {ok,B} = asn1_wrapper:encode('NBAP-PDU-Discriptions',
- 'NBAP-PDU', Msg),
- asn1_wrapper:decode(
- 'NBAP-PDU-Discriptions',
- 'NBAP-PDU',
- B)
- end,
- nif_vs_erlang_performance({BerFun,100000,32}).
-
-cert_pem_performance(Config) when is_list(Config) ->
- cert_pem_performance({100000, 32});
-cert_pem_performance({N,S}) ->
- nif_vs_erlang_performance({fun cert_pem/0,N,S}).
-
-dsa_pem_performance(Config) when is_list(Config) ->
- cert_pem_performance({100000, 32});
-dsa_pem_performance({N,S}) ->
- nif_vs_erlang_performance({fun dsa_pem/0,N,S}).
-
-
-nif_vs_erlang_performance({{TC1,TC2},N,Sched}) ->
- random:seed({123,456,789}),
- io:format("Running a ~p sample with ~p max procs...~n~n",[N,Sched]),
-
- {True,False} = exec(TC1,TC2,Sched,N+1),
-
- io:format("~ndone!~n"),
-
- io:format("~n"),TStats = print_stats(strip(True,N div 20)),
- io:format("~n"),FStats = print_stats(strip(False,N div 20)),
- Str = io_lib:format("~nNifs are ~.3f% faster than erlang!~n",
- [(element(2,FStats) - element(2,TStats)) /
- element(2,FStats) * 100]),
- io:format(Str),
- {comment, lists:flatten(Str)};
-nif_vs_erlang_performance({T,N,Sched}) ->
- PTC1 = fun() ->
- application:set_env(asn1, nif_loadable, true)
- end,
- PTC2 = fun() ->
- application:set_env(asn1, nif_loadable, false)
- end,
- TC = fun() ->
- element(1,timer:tc(T))
- end,
- nif_vs_erlang_performance({{{PTC1,TC},{PTC2,TC}},N,Sched}).
-
-
-print_stats(Data) ->
- Length = length(Data),
- Mean = lists:sum(Data) / Length,
- Variance = lists:foldl(fun(N,Acc) -> math:pow(N - Mean, 2)+Acc end, 0, Data),
- StdDev = math:sqrt(Variance / Length),
- Median = lists:nth(round(Length/2),Data),
- Min = lists:min(Data),
- Max = lists:max(Data),
- if Length < 20 ->
- io:format("Data: ~w~n",[Data]);
- true ->
- ok
- end,
- io:format("Length: ~p~nMean: ~p~nStdDev: ~p~nMedian: ~p~nMin: ~p~nMax: ~p~n",
- [Length,Mean,StdDev,Median,Min,Max]),
- {Length,Mean,StdDev,Median,Min,Max}.
-
-collect(Acc) ->
- receive
- {Tag,Val} ->
- Prev = proplists:get_value(Tag,Acc,[]),
- collect(lists:keystore(Tag,1,Acc,{Tag,[Val|Prev]}))
- after 100 ->
- Acc
- end.
-
-exec(One,Two,Max,N) ->
- exec(One,Two,Max,N,{[],[]}).
-exec(_,_,_,1,{D1,D2}) ->
- {lists:flatten(D1),lists:flatten(D2)};
-exec({PreOne,One} = O,{PreTwo,Two} = T,MaxProcs, N, {D1,D2}) ->
- Num = random:uniform(round(N/2)),
- if Num rem 3 == 0 ->
- timer:sleep(Num rem 1000);
- true ->
- ok
- end,
- Procs = random:uniform(MaxProcs),
- io:format("\tBatch: ~p items in ~p processes, ~p left~n",[Num,Procs,N-Num]),
- if Num rem 2 == 1 ->
- erlang:garbage_collect(),
- PreOne(),
- MoreOne = pexec(One, Num, Procs, []),
- erlang:garbage_collect(),
- PreTwo(),
- MoreTwo = pexec(Two, Num, Procs, []);
- true ->
- erlang:garbage_collect(),
- PreTwo(),
- MoreTwo = pexec(Two, Num, Procs, []),
- erlang:garbage_collect(),
- PreOne(),
- MoreOne = pexec(One, Num, Procs, [])
- end,
- exec(O,T,MaxProcs,N-Num,{[MoreOne|D1],
- [MoreTwo|D2]}).
-
-pexec(_Fun, _, 0, []) ->
- [];
-pexec(Fun, _, 0, [{Ref,Pid}|Rest]) ->
- receive
- {data,D} ->
- [D|pexec(Fun,0,0,[{Ref,Pid}|Rest])];
- {'DOWN', Ref, process, Pid, normal} ->
- pexec(Fun, 0,0,Rest)
- end;
-pexec(Fun, 0, 1, AccProcs) ->
- pexec(Fun, 0, 0, AccProcs);
-pexec(Fun, N, 1, AccProcs) ->
- [Fun()|pexec(Fun, N - 1, 1, AccProcs)];
-pexec(Fun, N, Procs, AccProcs) ->
- S = self(),
- Pid = spawn(fun() ->
- S ! {data,pexec(Fun,N,1,[])}
- end),
- Ref = erlang:monitor(process, Pid),
- pexec(Fun, N, Procs - 1, [{Ref,Pid}|AccProcs]).
-
-strip(Data,Num) ->
- {_,R} = lists:split(Num,lists:sort(Data)),
- element(2,lists:split(Num,lists:reverse(R))).
-
-faster(A,B) ->
- (B - A)/B * 100.
-
-enc_dec(1, Msg, N) ->
- worker_loop(N, Msg);
-enc_dec(NumOfProcs,Msg, N) ->
- pforeach(fun(_) ->
- worker_loop(N, Msg)
- end, [I || I <- lists:seq(1,NumOfProcs)]).
-
-worker_loop(0, _Msg) ->
- ok;
-worker_loop(N, Msg) ->
- ?line {ok,B}=asn1_wrapper:encode('NBAP-PDU-Discriptions',
- 'NBAP-PDU',
- Msg),
- ?line {ok,_Msg}=asn1_wrapper:decode('NBAP-PDU-Discriptions',
- 'NBAP-PDU',
- B),
- worker_loop(N - 1, Msg).
-
-
-pforeach(Fun, List) ->
- pforeach(Fun, List, []).
-pforeach(Fun, [], [{Pid,Ref}|Pids]) ->
- receive
- {'DOWN', Ref, process, Pid, normal} ->
- pforeach(Fun, [], Pids)
- end;
-pforeach(Fun, [H|T], Pids) ->
- Pid = spawn(fun() -> Fun(H) end),
- Ref = erlang:monitor(process, Pid),
- pforeach(Fun, T, [{Pid, Ref}|Pids]);
-pforeach(_Fun,[],[]) ->
- ok.
-
--record('InitiatingMessage',{procedureCode,criticality,value}).
--record('Iu-ReleaseCommand',{first,second}).
-
-ticket7904(suite) -> [];
-ticket7904(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
-
- ?line ok = asn1ct:compile(DataDir ++
- "RANAPextract1",[per_bin,optimize,{outdir,OutDir}]),
-
- Val1 = #'InitiatingMessage'{procedureCode=1,
- criticality=ignore,
- value=#'Iu-ReleaseCommand'{
- first=13,
- second=true}},
-
- ?line {ok,_} = 'RANAPextract1':encode('InitiatingMessage', Val1),
- asn1rt:unload_driver(),
- ?line {ok,_} = 'RANAPextract1':encode('InitiatingMessage', Val1).
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+
+-module([cert_pem/0]).
+-module([dsa_pem/0]).
cert_pem() ->
'OTP-PUB-KEY':decode('Certificate',<<48,130,3,184,48,130,3,33,160,3,2,1,2,2,1,1,48,13,6,9,42,134,72,134,247,13,1,1,5,5,0,48,129,131,49,14,48,12,6,3,85,4,3,19,5,111,116,112,67,65,49,19,48,17,6,3,85,4,11,19,10,69,114,108,97,110,103,32,79,84,80,49,20,48,18,6,3,85,4,10,19,11,69,114,105,99,115,115,111,110,32,65,66,49,11,48,9,6,3,85,4,6,19,2,83,69,49,18,48,16,6,3,85,4,7,19,9,83,116,111,99,107,104,111,108,109,49,37,48,35,6,9,42,134,72,134,247,13,1,9,1,22,22,112,101,116,101,114,64,101,114,105,120,46,101,114,105,99,115,115,111,110,46,115,101,48,30,23,13,48,56,48,49,48,57,48,56,50,57,51,48,90,23,13,49,55,49,49,49,55,48,56,50,57,51,48,90,48,129,132,49,15,48,13,6,3,85,4,3,19,6,99,108,105,101,110,116,49,19,48,17,6,3,85,4,11,19,10,69,114,108,97,110,103,32,79,84,80,49,20,48,18,6,3,85,4,10,19,11,69,114,105,99,115,115,111,110,32,65,66,49,11,48,9,6,3,85,4,6,19,2,83,69,49,18,48,16,6,3,85,4,7,19,9,83,116,111,99,107,104,111,108,109,49,37,48,35,6,9,42,134,72,134,247,13,1,9,1,22,22,112,101,116,101,114,64,101,114,105,120,46,101,114,105,99,115,115,111,110,46,115,101,48,129,159,48,13,6,9,42,134,72,134,247,13,1,1,1,5,0,3,129,141,0,48,129,137,2,129,129,0,245,56,68,254,220,239,193,190,63,221,182,60,67,77,121,163,214,136,137,183,139,8,166,30,100,27,45,17,126,58,15,173,151,218,75,224,148,14,22,164,10,100,186,183,104,175,197,97,96,182,146,150,106,129,140,100,194,106,90,62,133,233,155,46,155,33,101,220,83,193,182,232,240,99,253,249,114,8,159,172,143,77,179,132,229,205,29,110,185,233,224,52,25,149,249,100,80,229,199,125,23,106,146,233,159,26,13,8,161,206,221,43,240,149,42,45,194,190,85,6,235,152,220,219,160,32,144,67,2,3,1,0,1,163,130,1,55,48,130,1,51,48,9,6,3,85,29,19,4,2,48,0,48,11,6,3,85,29,15,4,4,3,2,5,224,48,29,6,3,85,29,14,4,22,4,20,26,59,44,5,72,211,158,214,23,34,30,241,125,27,123,115,93,163,231,120,48,129,179,6,3,85,29,35,4,129,171,48,129,168,128,20,6,171,128,52,58,164,184,118,178,189,157,46,40,229,109,145,222,125,1,155,161,129,140,164,129,137,48,129,134,49,17,48,15,6,3,85,4,3,19,8,101,114,108,97,110,103,67,65,49,19,48,17,6,3,85,4,11,19,10,69,114,108,97,110,103,32,79,84,80,49,20,48,18,6,3,85,4,10,19,11,69,114,105,99,115,115,111,110,32,65,66,49,18,48,16,6,3,85,4,7,19,9,83,116,111,99,107,104,111,108,109,49,11,48,9,6,3,85,4,6,19,2,83,69,49,37,48,35,6,9,42,134,72,134,247,13,1,9,1,22,22,112,101,116,101,114,64,101,114,105,120,46,101,114,105,99,115,115,111,110,46,115,101,130,1,1,48,33,6,3,85,29,17,4,26,48,24,129,22,112,101,116,101,114,64,101,114,105,120,46,101,114,105,99,115,115,111,110,46,115,101,48,33,6,3,85,29,18,4,26,48,24,129,22,112,101,116,101,114,64,101,114,105,120,46,101,114,105,99,115,115,111,110,46,115,101,48,13,6,9,42,134,72,134,247,13,1,1,5,5,0,3,129,129,0,93,11,112,227,121,15,121,179,247,135,110,216,17,197,84,18,149,166,147,142,190,178,0,209,190,0,142,233,144,100,194,205,220,182,73,204,108,42,95,23,48,63,4,120,239,42,194,25,184,35,117,107,96,229,18,45,76,122,125,40,171,210,132,50,146,178,160,55,17,35,255,208,114,30,47,55,185,154,155,165,204,180,14,143,20,234,6,234,201,225,72,235,5,87,61,255,250,23,217,1,144,246,98,221,223,102,49,168,177,13,70,241,26,27,254,251,217,14,244,18,242,197,151,50,186,214,15,42>>).
@@ -288,4 +34,4 @@ dsa_pem() ->
{1,2,840,10040,4,1},
<<48,130,1,31,2,129,129,0,183,179,230,217,37,99,144,157,21,228,204,162,207,61,246,144,58,139,139,184,184,43,108,206,0,115,173,208,100,233,201,121,21,90,179,119,53,140,25,52,34,202,121,211,164,107,43,56,68,162,159,51,244,232,138,126,164,109,121,89,237,142,57,28,32,188,44,67,253,111,121,104,40,141,211,255,140,118,37,234,150,201,155,160,16,17,51,59,26,249,41,129,16,211,119,128,95,254,182,235,132,0,92,206,93,77,106,217,201,132,203,4,75,201,246,204,216,162,1,84,79,211,10,21,152,195,103,145,2,21,0,213,30,184,86,247,16,247,69,192,241,35,138,84,57,140,3,71,65,206,233,2,129,129,0,148,179,24,63,74,91,128,25,96,29,5,78,223,246,175,0,121,86,54,178,42,231,98,241,147,180,157,60,149,160,50,243,227,76,175,89,234,203,252,242,76,108,9,204,157,182,59,206,227,127,99,215,42,156,194,78,116,25,7,62,243,169,45,5,101,179,247,127,199,144,135,103,23,42,154,125,231,248,154,101,175,155,101,42,232,41,80,41,47,128,208,11,31,106,63,12,202,207,135,80,200,136,250,171,31,118,52,91,200,138,112,111,179,23,214,123,21,118,194,179,0,185,217,52,197,182,236,13>>},
{0,
- <<2,129,128,124,66,0,111,121,139,142,209,95,136,95,237,177,150,248,252,49,135,117,100,155,232,138,244,132,89,40,5,70,125,202,96,78,239,76,37,125,149,82,64,107,54,227,73,25,180,227,41,0,234,73,47,80,242,242,129,250,61,68,62,39,38,156,193,146,40,241,247,106,215,223,202,194,110,130,62,186,90,18,28,196,174,99,47,193,61,130,100,150,25,248,115,164,231,153,99,46,69,66,139,33,187,51,49,35,219,234,29,44,172,166,247,42,16,177,187,9,162,81,243,33,26,100,46,78,57,203,135>>}}).
+ <<2,129,128,124,66,0,111,121,139,142,209,95,136,95,237,177,150,248,252,49,135,117,100,155,232,138,244,132,89,40,5,70,125,202,96,78,239,76,37,125,149,82,64,107,54,227,73,25,180,227,41,0,234,73,47,80,242,242,129,250,61,68,62,39,38,156,193,146,40,241,247,106,215,223,202,194,110,130,62,186,90,18,28,196,174,99,47,193,61,130,100,150,25,248,115,164,231,153,99,46,69,66,139,33,187,51,49,35,219,234,29,44,172,166,247,42,16,177,187,9,162,81,243,33,26,100,46,78,57,203,135>>}}).
diff --git a/lib/asn1/test/testChoExtension.erl b/lib/asn1/test/testChoExtension.erl
index 5e149ed247..b75cfb6831 100644
--- a/lib/asn1/test/testChoExtension.erl
+++ b/lib/asn1/test/testChoExtension.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,21 +19,11 @@
%%
-module(testChoExtension).
--export([compile/3]).
-export([extension/1]).
-include_lib("test_server/include/test_server.hrl").
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ChoExtension",[Rules,{outdir,OutDir}] ++ Options).
-
-
-
extension(_Rules) ->
?line {ok,Bytes1} = asn1_wrapper:encode('ChoExtension','ChoExt1',{'ChoExt1',{bool,true}}),
diff --git a/lib/asn1/test/testChoExternal.erl b/lib/asn1/test/testChoExternal.erl
index b6586b616b..b2d171f9c7 100644
--- a/lib/asn1/test/testChoExternal.erl
+++ b/lib/asn1/test/testChoExternal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -28,12 +28,12 @@
-compile(Config,Rules,Optimize) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ChoExternal",[Rules,{outdir,OutDir}]++Optimize).
+compile(Config, Rules, Optimize) ->
+ DataDir = ?config(data_dir, Config),
+ CaseDir = ?config(case_dir, Config),
+ true = code:add_patha(CaseDir),
+ ok = asn1ct:compile(DataDir ++ "ChoExternal",
+ [Rules, {outdir, CaseDir}] ++ Optimize).
diff --git a/lib/asn1/test/testChoOptional.erl b/lib/asn1/test/testChoOptional.erl
index 61a1955d28..cbb8134e51 100644
--- a/lib/asn1/test/testChoOptional.erl
+++ b/lib/asn1/test/testChoOptional.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,29 +19,16 @@
%%
-module(testChoOptional).
-
--export([compile/3]).
-export([optional/1]).
%-include("ChoOptional.hrl").
-include_lib("test_server/include/test_server.hrl").
-include("External.hrl").
-
-record('Seq1',{bool, int = asn1_NOVALUE, cho = asn1_NOVALUE}).
-record('Seq2',{int = asn1_NOVALUE, cho = asn1_NOVALUE, bool}).
-record('Seq3',{cho = asn1_NOVALUE, int = asn1_NOVALUE, bool}).
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ChoOptional",[Rules,{outdir,OutDir}]++Options).
-
-
-
optional(_Rules) ->
?line {ok,Bytes11} = asn1_wrapper:encode('ChoOptional','Seq1',#'Seq1'{bool = true}),
diff --git a/lib/asn1/test/testChoOptionalImplicitTag.erl b/lib/asn1/test/testChoOptionalImplicitTag.erl
index e28353cb5a..efe335cabd 100644
--- a/lib/asn1/test/testChoOptionalImplicitTag.erl
+++ b/lib/asn1/test/testChoOptionalImplicitTag.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -20,28 +20,16 @@
-module(testChoOptionalImplicitTag).
--export([compile/2]).
-export([optional/1]).
%-include("ChoOptional.hrl").
-include_lib("test_server/include/test_server.hrl").
-include("External.hrl").
-
-record('Seq1',{bool, int = asn1_NOVALUE, cho = asn1_NOVALUE}).
-record('Seq2',{int = asn1_NOVALUE, cho = asn1_NOVALUE, bool}).
-record('Seq3',{cho = asn1_NOVALUE, int = asn1_NOVALUE, bool}).
-
-compile(Config,Rules) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ChoOptionalImplicitTag",[Rules,{outdir,OutDir}]).
-
-
-
optional(_Rules) ->
?line {ok,Bytes11} = asn1_wrapper:encode('ChoOptionalImplicitTag','Seq1',#'Seq1'{bool = true}),
diff --git a/lib/asn1/test/testChoPrim.erl b/lib/asn1/test/testChoPrim.erl
index f037db1c5d..936a38f76c 100644
--- a/lib/asn1/test/testChoPrim.erl
+++ b/lib/asn1/test/testChoPrim.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,22 +19,11 @@
%%
-module(testChoPrim).
--export([compile/3]).
-export([bool/1]).
-export([int/1]).
-include_lib("test_server/include/test_server.hrl").
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ChoPrim",[Rules,{outdir,OutDir}]++Options).
-
-
-
bool(Rules) ->
?line {ok,Bytes11} = asn1_wrapper:encode('ChoPrim','ChoCon',{bool0,true}),
diff --git a/lib/asn1/test/testChoRecursive.erl b/lib/asn1/test/testChoRecursive.erl
index 36e23e2e03..22be26cbce 100644
--- a/lib/asn1/test/testChoRecursive.erl
+++ b/lib/asn1/test/testChoRecursive.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -20,7 +20,6 @@
-module(testChoRecursive).
--export([compile/3]).
-export([recursive/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -28,16 +27,6 @@
-record('ChoRec_something',{a, b, c}).
-record('ChoRec2_something',{a, b, c}).
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ChoRecursive",[Rules,{outdir,OutDir}]++Options).
-
-
-
recursive(_Rules) ->
?line {ok,Bytes11} = asn1_wrapper:encode('ChoRecursive','ChoRec',{'ChoRec',{something,
diff --git a/lib/asn1/test/testChoTypeRefCho.erl b/lib/asn1/test/testChoTypeRefCho.erl
index f381d9078d..9bd732f462 100644
--- a/lib/asn1/test/testChoTypeRefCho.erl
+++ b/lib/asn1/test/testChoTypeRefCho.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,22 +19,10 @@
%%
-module(testChoTypeRefCho).
--export([compile/3]).
-export([choice/1]).
-include_lib("test_server/include/test_server.hrl").
-
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ChoTypeRefCho",[Rules,{outdir,OutDir}]++Options).
-
-
-
choice(_Rules) ->
?line {ok,Bytes11} = asn1_wrapper:encode('ChoTypeRefCho','ChoTRcho',{choCho,{choInt,88}}),
diff --git a/lib/asn1/test/testChoTypeRefPrim.erl b/lib/asn1/test/testChoTypeRefPrim.erl
index 8fb9ed9f02..edef6192fe 100644
--- a/lib/asn1/test/testChoTypeRefPrim.erl
+++ b/lib/asn1/test/testChoTypeRefPrim.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,22 +19,10 @@
%%
-module(testChoTypeRefPrim).
--export([compile/3]).
-export([prim/1]).
-include_lib("test_server/include/test_server.hrl").
-
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ChoTypeRefPrim",[Rules,{outdir,OutDir}]++Options).
-
-
-
prim(_Rules) ->
?line {ok,Bytes11} = asn1_wrapper:encode('ChoTypeRefPrim','ChoTR',{bool,true}),
diff --git a/lib/asn1/test/testChoTypeRefSeq.erl b/lib/asn1/test/testChoTypeRefSeq.erl
index 45d6209e79..bf2b66c73e 100644
--- a/lib/asn1/test/testChoTypeRefSeq.erl
+++ b/lib/asn1/test/testChoTypeRefSeq.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testChoTypeRefSeq).
--export([compile/3]).
-export([seq/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -28,16 +27,6 @@
-record('ChoSeqImp',{seqInt, seqOs}).
-record('ChoSeqExp',{seqInt, seqOs}).
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ChoTypeRefSeq",[Rules,{outdir,OutDir}]++Options).
-
-
-
seq(_Rules) ->
?line {ok,Bytes1} =
diff --git a/lib/asn1/test/testChoTypeRefSet.erl b/lib/asn1/test/testChoTypeRefSet.erl
index 9869549d7a..8a3e8bdbb0 100644
--- a/lib/asn1/test/testChoTypeRefSet.erl
+++ b/lib/asn1/test/testChoTypeRefSet.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testChoTypeRefSet).
--export([compile/3]).
-export([set/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -28,16 +27,6 @@
-record('ChoSetImp',{setInt, setOs}).
-record('ChoSetExp',{setInt, setOs}).
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ChoTypeRefSet",[Rules,{outdir,OutDir}]++Options).
-
-
-
set(_Rules) ->
?line {ok,Bytes1} =
diff --git a/lib/asn1/test/testChoiceIndefinite.erl b/lib/asn1/test/testChoiceIndefinite.erl
index e5f3ee51c8..630efcf27a 100644
--- a/lib/asn1/test/testChoiceIndefinite.erl
+++ b/lib/asn1/test/testChoiceIndefinite.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -19,20 +19,10 @@
%%
-module(testChoiceIndefinite).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ChoiceIndef",
- [Rules,{outdir,OutDir}]++Options).
-
main(per_bin) -> ok;
main(per) -> ok;
main(ber_bin_v2) ->
@@ -50,6 +40,3 @@ main(ber) ->
?line {ok,V} = asn1_wrapper:decode('ChoiceIndef','Seq',B),
?line {ok,V} = asn1_wrapper:decode('ChoiceIndef','Seq',Bi),
ok.
-
-
-
diff --git a/lib/asn1/test/testCompactBitString.erl b/lib/asn1/test/testCompactBitString.erl
index cd5586602b..9563a31bf3 100644
--- a/lib/asn1/test/testCompactBitString.erl
+++ b/lib/asn1/test/testCompactBitString.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -19,29 +19,11 @@
%%
-module(testCompactBitString).
--export([compile/3]).
-export([compact_bit_string/1, bit_string_unnamed/1,otp_4869/1,
ticket_7734/1]).
-include_lib("test_server/include/test_server.hrl").
-
-compile(Config,Rules,Option) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "PrimStrings",
- [Rules,{outdir,OutDir}]++Option),
- case Rules of
- per_bin ->
- ?line ok = asn1ct:compile(DataDir ++ "Constraints",
- [Rules,{outdir,OutDir}]++Option);
- _ -> ok
- end.
-
-
-
compact_bit_string(Rules) ->
%%==========================================================
diff --git a/lib/asn1/test/testConstraints.erl b/lib/asn1/test/testConstraints.erl
index dcbc04f8d8..543c106e8a 100644
--- a/lib/asn1/test/testConstraints.erl
+++ b/lib/asn1/test/testConstraints.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -19,24 +19,11 @@
%%
-module(testConstraints).
--export([compile/3]).
-export([int_constraints/1,refed_NNL_name/1]).
-include_lib("test_server/include/test_server.hrl").
-
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "Constraints",[Rules,{outdir,OutDir}]++Options).
-
-
-
-
int_constraints(Rules) ->
%%==========================================================
@@ -65,8 +52,6 @@ int_constraints(Rules) ->
?line {error,_Reason2} =
asn1_wrapper:encode('Constraints','SingleValue',1000)
end,
-
-
%%==========================================================
%% SingleValue2 ::= INTEGER (1..20)
@@ -99,7 +84,21 @@ int_constraints(Rules) ->
asn1_wrapper:encode('Constraints','SingleValue',1000)
end,
+ %%==========================================================
+ %% SingleValue3 ::= INTEGER (Predefined | 5 | 10)
+ %% Testcase for OTP-10139. A single value subtyping of an integer type
+ %% where one value is predefined.
+ %%==========================================================
+ ?line {ok,BytesSV3} = asn1_wrapper:encode('Constraints','SingleValue3',1),
+ ?line {ok,1} = asn1_wrapper:decode('Constraints','SingleValue3',
+ lists:flatten(BytesSV3)),
+ ?line {ok,BytesSV3_2} = asn1_wrapper:encode('Constraints','SingleValue3',5),
+ ?line {ok,5} = asn1_wrapper:decode('Constraints','SingleValue3',
+ lists:flatten(BytesSV3_2)),
+ ?line {ok,BytesSV3_3} = asn1_wrapper:encode('Constraints','SingleValue3',10),
+ ?line {ok,10} = asn1_wrapper:decode('Constraints','SingleValue3',
+ lists:flatten(BytesSV3_3)),
%%==========================================================
%% Range2to19 ::= INTEGER (1<..<20)
@@ -129,7 +128,65 @@ int_constraints(Rules) ->
?line {error,_Reason6} =
asn1_wrapper:encode('Constraints','Range2to19',20)
end,
+
+ %%==========================================================
+ %% Tests for Range above 16^4 up to maximum supported by asn1 assuming the
+ %% octet length field is encoded on max 8 bits
+ %%==========================================================
+ LastNumWithoutLengthEncoding = 65536,
+ ?line {ok,BytesFoo} = asn1_wrapper:encode('Constraints','Range256to65536',
+ LastNumWithoutLengthEncoding),
+ ?line {ok,LastNumWithoutLengthEncoding} =
+ asn1_wrapper:decode('Constraints','Range256to65536',lists:flatten(BytesFoo)),
+
+ FirstNumWithLengthEncoding = 65537,
+ ?line {ok,BytesBar} = asn1_wrapper:encode('LargeConstraints','RangeMax',
+ FirstNumWithLengthEncoding),
+ ?line {ok,FirstNumWithLengthEncoding} =
+ asn1_wrapper:decode('LargeConstraints','RangeMax',lists:flatten(BytesBar)),
+
+ FirstNumOver16_6 = 16777217,
+ ?line {ok, BytesBaz} =
+ asn1_wrapper:encode('LargeConstraints','RangeMax', FirstNumOver16_6),
+ ?line {ok, FirstNumOver16_6} =
+ asn1_wrapper:decode('LargeConstraints','RangeMax',lists:flatten(BytesBaz)),
+ FirstNumOver16_8 = 4294967297,
+ ?line {ok, BytesQux} =
+ asn1_wrapper:encode('LargeConstraints','RangeMax', FirstNumOver16_8),
+ ?line {ok, FirstNumOver16_8} =
+ asn1_wrapper:decode('LargeConstraints','RangeMax',lists:flatten(BytesQux)),
+
+ FirstNumOver16_10 = 1099511627776,
+ ?line {ok, BytesBur} =
+ asn1_wrapper:encode('LargeConstraints','RangeMax', FirstNumOver16_10),
+ ?line {ok, FirstNumOver16_10} =
+ asn1_wrapper:decode('LargeConstraints','RangeMax',lists:flatten(BytesBur)),
+
+ FirstNumOver16_10 = 1099511627776,
+ ?line {ok, BytesBur} =
+ asn1_wrapper:encode('LargeConstraints','RangeMax', FirstNumOver16_10),
+ ?line {ok, FirstNumOver16_10} =
+ asn1_wrapper:decode('LargeConstraints','RangeMax',lists:flatten(BytesBur)),
+
+ HalfMax = 1 bsl (128*8),
+ ?line {ok, BytesHalfMax} =
+ asn1_wrapper:encode('LargeConstraints','RangeMax', HalfMax),
+ ?line {ok, HalfMax} =
+ asn1_wrapper:decode('LargeConstraints','RangeMax',lists:flatten(BytesHalfMax)),
+
+ Max = 1 bsl (255*8),
+ ?line {ok, BytesMax} =
+ asn1_wrapper:encode('LargeConstraints','RangeMax', Max),
+ ?line {ok, Max} =
+ asn1_wrapper:decode('LargeConstraints','RangeMax',lists:flatten(BytesMax)),
+
+ %% Random number within longlong range
+ LongLong = 12672809400538808320,
+ ?line {ok, BytesLongLong} =
+ asn1_wrapper:encode('Constraints','LongLong', LongLong),
+ ?line {ok, LongLong} =
+ asn1_wrapper:decode('Constraints','LongLong',lists:flatten(BytesLongLong)),
%%==========================================================
%% Constraint Combinations (Duboisson p. 285)
@@ -140,17 +197,26 @@ int_constraints(Rules) ->
?line {ok,0} = asn1_wrapper:decode('Constraints','I',Bytes12),
?line {ok,Bytes13} = asn1_wrapper:encode('Constraints','I',20),
?line {ok,20} = asn1_wrapper:decode('Constraints','I',Bytes13),
-
+
+ %%==========================================================
+ %% Constraint Combinations (Duboisson p. 285)
+ %% X1 ::= INTEGER (1..4|8|10|20)
+ %%==========================================================
+
+ ?line {ok,Bytes14} = asn1_wrapper:encode('Constraints','X1',1),
+ ?line {ok,1} = asn1_wrapper:decode('Constraints','X1',Bytes14),
+ ?line {ok,Bytes15} = asn1_wrapper:encode('Constraints','X1',20),
+ ?line {ok,20} = asn1_wrapper:decode('Constraints','X1',Bytes15),
%%==========================================================
%% SIZE Constraint (Duboisson p. 268)
%% T ::= IA5String (SIZE (1|2, ..., SIZE (1|2|3)))
%% T2 ::= IA5String (SIZE (1|2, ..., 3))
%%==========================================================
- ?line {ok,Bytes14} = asn1_wrapper:encode('Constraints','T',"IA"),
- ?line {ok,"IA"} = asn1_wrapper:decode('Constraints','T',Bytes14),
- ?line {ok,Bytes15} = asn1_wrapper:encode('Constraints','T2',"IA"),
- ?line {ok,"IA"} = asn1_wrapper:decode('Constraints','T2',Bytes15).
+ ?line {ok,Bytes16} = asn1_wrapper:encode('Constraints','T',"IA"),
+ ?line {ok,"IA"} = asn1_wrapper:decode('Constraints','T',Bytes16),
+ ?line {ok,Bytes17} = asn1_wrapper:encode('Constraints','T2',"IA"),
+ ?line {ok,"IA"} = asn1_wrapper:decode('Constraints','T2',Bytes17).
refed_NNL_name(_Erule) ->
diff --git a/lib/asn1/test/testContextSwitchingTypes.erl b/lib/asn1/test/testContextSwitchingTypes.erl
index 7d05e5c352..4f67942922 100644
--- a/lib/asn1/test/testContextSwitchingTypes.erl
+++ b/lib/asn1/test/testContextSwitchingTypes.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -19,29 +19,19 @@
%%
-module(testContextSwitchingTypes).
--export([compile/3]).
--export([test/0]).
+-export([test/1]).
-include_lib("test_server/include/test_server.hrl").
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ContextSwitchingTypes",
- [Rules,{outdir,OutDir}]++Options).
-
-
-test() ->
+test(Config) ->
?line ValT = 'ContextSwitchingTypes':'val1-T'(),
?line {ok,Bytes1} =
asn1_wrapper:encode('ContextSwitchingTypes','T',ValT),
?line {ok,Result1} =
asn1_wrapper:decode('ContextSwitchingTypes','T',Bytes1),
?line ok = check_EXTERNAL(Result1),
- ?line {ok,ValT2} = asn1ct:value('ContextSwitchingTypes','T'),
+ ?line {ok,ValT2} = asn1ct:value('ContextSwitchingTypes','T',
+ [{i, ?config(case_dir, Config)}]),
?line {ok,Bytes1_2} =
asn1_wrapper:encode('ContextSwitchingTypes','T',ValT2),
?line {ok,Result1_2} =
diff --git a/lib/asn1/test/testDER.erl b/lib/asn1/test/testDER.erl
index 630f7ecc14..395116bd34 100644
--- a/lib/asn1/test/testDER.erl
+++ b/lib/asn1/test/testDER.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -19,19 +19,10 @@
%%
-module(testDER).
--export([compile/3]).
-export([test/0]).
-include_lib("test_server/include/test_server.hrl").
-
-compile(Config,Rule,Options) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "DERSpec",
- [Rule,der,{outdir,OutDir}]++Options).
-
test() ->
Val = {'Set',12,{version,214},true},
?line {ok,Bin}=asn1_wrapper:encode('DERSpec','Set',Val),
diff --git a/lib/asn1/test/testDeepTConstr.erl b/lib/asn1/test/testDeepTConstr.erl
index 53d2b3040e..aa3afbb58f 100644
--- a/lib/asn1/test/testDeepTConstr.erl
+++ b/lib/asn1/test/testDeepTConstr.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -21,23 +21,10 @@
-module(testDeepTConstr).
--export([compile/3,main/1]).
+-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(DataDir ++
- "TConstrChoice",[Rules,{outdir,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++
- "TConstr",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Erule) ->
Val1 = {'FilterItem',
{substrings,
diff --git a/lib/asn1/test/testDef.erl b/lib/asn1/test/testDef.erl
index 7942a358be..48f0015008 100644
--- a/lib/asn1/test/testDef.erl
+++ b/lib/asn1/test/testDef.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testDef).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -37,16 +36,6 @@
bool32 = asn1_DEFAULT,
bool33 = asn1_DEFAULT}).
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "Def",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes11} = asn1_wrapper:encode('Def','Def1',#'Def1'{bool0 = true,
diff --git a/lib/asn1/test/testDoubleEllipses.erl b/lib/asn1/test/testDoubleEllipses.erl
index 20be4ea215..9030a99ce2 100644
--- a/lib/asn1/test/testDoubleEllipses.erl
+++ b/lib/asn1/test/testDoubleEllipses.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testDoubleEllipses).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -34,17 +33,6 @@
-record('SetAlt',{a,d,b,e,c,f,g}).
-record('SetAltV2',{a,d,b,e,h,i,c,f,g}).
-
-
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "DoubleEllipses",[Rules,{outdir,OutDir}]++Options).
-
-
main(_Rules) ->
%% SEQUENCE
?line {ok,Bytes} =
diff --git a/lib/asn1/test/testEnumExt.erl b/lib/asn1/test/testEnumExt.erl
index 4ea0f3b8a1..c97116413a 100644
--- a/lib/asn1/test/testEnumExt.erl
+++ b/lib/asn1/test/testEnumExt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -19,19 +19,10 @@
%%
-module(testEnumExt).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "EnumExt",[Rules,{outdir,OutDir}]++Options).
-
-
main(Rules) when Rules == per; Rules == per_bin; Rules == uper_bin ->
io:format("main(~p)~n",[Rules]),
B32=[32],B64=[64],
diff --git a/lib/asn1/test/testINSTANCE_OF.erl b/lib/asn1/test/testINSTANCE_OF.erl
index 6ae656da44..5986a00ec5 100644
--- a/lib/asn1/test/testINSTANCE_OF.erl
+++ b/lib/asn1/test/testINSTANCE_OF.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -19,21 +19,10 @@
%%
-module(testINSTANCE_OF).
--export([compile/3,main/1]).
+-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
-
-compile(Config,Rules,Opt) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(DataDir ++ "INSTANCEOF.asn1",
- [Rules,{outdir,OutDir}]++Opt).
-
-
main(Erule) ->
?line {ok,Integer} = asn1_wrapper:encode('INSTANCEOF','Int',3),
diff --git a/lib/asn1/test/testInfObj.erl b/lib/asn1/test/testInfObj.erl
index 9d73be9f23..03e70c730a 100644
--- a/lib/asn1/test/testInfObj.erl
+++ b/lib/asn1/test/testInfObj.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -20,7 +20,7 @@
-module(testInfObj).
--export([compile/3,main/1,compile_RANAPfiles/3]).
+-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -28,42 +28,6 @@
-record('InitiatingMessage2',{procedureCode,criticality,value}).
-record('Iu-ReleaseCommand',{first,second}).
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(DataDir ++
- "RANAPextract1",[Rules,{outdir,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++ "InfObj",[Rules,{outdir,OutDir}]++Options),
- %% test case for OTP-4792 optional open type
- ?line ok = asn1ct:compile(DataDir ++ "MAP-ExtensionDataTypes",[Rules,{outdir,OutDir}]++Options),
- %% OTP-6707
- ?line ok = asn1ct:compile(DataDir ++ "Objects",[Rules,{outdir,OutDir}]++Options),
- %% OTP-6717
- ?line ok = asn1ct:compile(DataDir ++ "INAPv2extract",[Rules,{outdir,OutDir}]++Options).
-
-
-compile_RANAPfiles(Config,Rules,Options) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(DataDir ++ "RANAP-CommonDataTypes",
- [Rules,{outdir,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++ "RANAP-Constants",
- [Rules,{outdir,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++ "RANAP-Containers",
- [Rules,{outdir,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++ "RANAP-IEs",
- [Rules,{outdir,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++ "RANAP-PDU-Contents",
- [Rules,{outdir,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++ "RANAP-PDU-Descriptions",
- [Rules,{outdir,OutDir}]++Options).
-
-
main(_Erule) ->
Val1 = #'InitiatingMessage'{procedureCode=1,
criticality=ignore,
diff --git a/lib/asn1/test/testInfObjectClass.erl b/lib/asn1/test/testInfObjectClass.erl
index 07ebb7dbd0..e639066246 100644
--- a/lib/asn1/test/testInfObjectClass.erl
+++ b/lib/asn1/test/testInfObjectClass.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -21,22 +21,10 @@
-module(testInfObjectClass).
--export([compile/3,main/1]).
+-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
-
-
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ErrorClass",[Rules,{outdir,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++ "InfClass",[Rules,{outdir,OutDir}]++Options).
-
-
main(Rule) ->
%% this test is added for OTP-4591, to test that elements in decoded
%% value has terms in right order.
diff --git a/lib/asn1/test/testMegaco.erl b/lib/asn1/test/testMegaco.erl
index ca2b1062d1..f4edcebb7e 100644
--- a/lib/asn1/test/testMegaco.erl
+++ b/lib/asn1/test/testMegaco.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -108,24 +108,17 @@ compile(_Config,ber,[optimize]) ->
compile(_Config,per,[optimize]) ->
{ok,no_module,no_module};
compile(Config,Erule,Options) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(DataDir ++
- "MEDIA-GATEWAY-CONTROL.asn",
- [Erule,{outdir,OutDir}]++Options),
-
- ?line ok = asn1ct:compile(DataDir ++
- "OLD-MEDIA-GATEWAY-CONTROL.asn",
- [Erule,{outdir,OutDir}]++Options),
+ asn1_test_lib:compile("MEDIA-GATEWAY-CONTROL.asn", Config, [Erule|Options]),
+ asn1_test_lib:compile("OLD-MEDIA-GATEWAY-CONTROL.asn", Config, [Erule|Options]),
{ok,'OLD-MEDIA-GATEWAY-CONTROL','MEDIA-GATEWAY-CONTROL'}.
main(no_module,_) -> ok;
-main('OLD-MEDIA-GATEWAY-CONTROL',_) ->
+main('OLD-MEDIA-GATEWAY-CONTROL',Config) ->
% Msg = msg11(),
- {ok,Msg} = asn1ct:value('OLD-MEDIA-GATEWAY-CONTROL','MegacoMessage'),
+ CaseDir = ?config(case_dir, Config),
+ {ok,Msg} = asn1ct:value('OLD-MEDIA-GATEWAY-CONTROL','MegacoMessage',
+ [{i, CaseDir}]),
?line {ok,Bytes} = asn1_wrapper:encode('OLD-MEDIA-GATEWAY-CONTROL',
'MegacoMessage',Msg),
?line {ok,Msg} = asn1_wrapper:decode('OLD-MEDIA-GATEWAY-CONTROL',
@@ -176,7 +169,7 @@ request(Mid, TransId, ContextId, CmdReq) when is_list(CmdReq) ->
msg11() ->
TimeStamp = #'TimeNotation'{date = "19990729",
- time = "22010001"},
+ time = "22012001"},
Parm = #'EventParameter'{eventParameterName = "ds",
value = "916135551212"},
diff --git a/lib/asn1/test/testMergeCompile.erl b/lib/asn1/test/testMergeCompile.erl
index 733cbc0eef..31aa3518f6 100644
--- a/lib/asn1/test/testMergeCompile.erl
+++ b/lib/asn1/test/testMergeCompile.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -20,31 +20,13 @@
-module(testMergeCompile).
--export([compile/3,main/1,mvrasn/1]).
+-export([main/1,mvrasn/1]).
-include_lib("test_server/include/test_server.hrl").
-record('InitiatingMessage',{procedureCode,criticality,value}).
-record('Iu-ReleaseCommand',{protocolIEs,protocolExtensions}).
-compile(Config,Erule,Options) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(DataDir ++
- "MS.set.asn",[Erule,{outdir,OutDir}]++Options),
-
- ?line ok = asn1ct:compile(DataDir ++
- "RANAPSET.set.asn1",[Erule,{outdir,OutDir}]++Options),
-
- ?line ok = asn1ct:compile(filename:join([DataDir,"Mvrasn4.set.asn"]),
- [Erule,{outdir,OutDir}]++Options),
-
- ?line ok = asn1ct:compile(filename:join([DataDir,"Mvrasn6.set.asn"]),
- [Erule,{outdir,OutDir}]++Options).
-
-
main(Erule) ->
%% test of module MS.set.asn that tests OTP-4492: different tagdefault in
%% modules and types with same name in modules
diff --git a/lib/asn1/test/testMvrasn6.erl b/lib/asn1/test/testMvrasn6.erl
deleted file mode 100644
index eaa667e6d7..0000000000
--- a/lib/asn1/test/testMvrasn6.erl
+++ /dev/null
@@ -1,44 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%%
--module(testMvrasn6).
-
--export([compile/2]).
--export([main/0]).
-
--include_lib("test_server/include/test_server.hrl").
-
-compile(Config,Rules) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line Options = [Rules,{outdir,OutDir}],
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-21-4",Options),
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-20-6",Options),
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-19-6",Options),
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-15-6",Options),
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-18-6",Options),
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-14-6",Options),
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-11-6",Options).
-
-
-main() ->
- ok.
-
diff --git a/lib/asn1/test/testNBAPsystem.erl b/lib/asn1/test/testNBAPsystem.erl
index 1269f94060..4e8381e51e 100644
--- a/lib/asn1/test/testNBAPsystem.erl
+++ b/lib/asn1/test/testNBAPsystem.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -19,7 +19,7 @@
%%
-module(testNBAPsystem).
--export([compile/3,test/2,cell_setup_req_msg/0]).
+-export([compile/2,test/2,cell_setup_req_msg/0]).
-include_lib("test_server/include/test_server.hrl").
@@ -78,19 +78,15 @@ powerRaiseLimit, dLPowerAveragingWindowSize, 'iE-Extensions' = asn1_NOVALUE}).
id, criticality, extensionValue}).
-compile(Config,Rules,Opt) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line DataDir2 = filename:join([DataDir,nbapsystem]),
-
- ?line ok = asn1ct:compile(filename:join([DataDir2,"NBAP-CommonDataTypes.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"NBAP-IEs.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"NBAP-PDU-Contents.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"NBAP-PDU-Discriptions.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"NBAP-Constants.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"NBAP-Containers.asn"]),[Rules,{outdir,OutDir}]++Opt).
+compile(Config, Options) ->
+ [asn1_test_lib:compile(filename:join([nbapsystem, M]), Config, Options)
+ || M <- ["NBAP-CommonDataTypes.asn",
+ "NBAP-IEs.asn",
+ "NBAP-PDU-Contents.asn",
+ "NBAP-PDU-Discriptions.asn",
+ "NBAP-Constants.asn",
+ "NBAP-Containers.asn"]],
+ ok.
test(_Erule,Config) ->
@@ -291,13 +287,7 @@ protocolIEs_051107() ->
criticality = ignore,
extensionValue = 'hsdpa-non-capable'}.
-
-
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-compare(V,V) ->
+compare(V,V) ->
ok;
compare(V,L) when is_list(L) ->
compare(V,list_to_binary(L));
@@ -306,52 +296,7 @@ compare(_,_) ->
check_record_names(Msg,Config) ->
DataDir = ?config(data_dir,Config),
- OutDir = ?config(priv_dir,Config),
- io:format("check_record_names: compiling ~p~ninclude directory: ~p~n",
- [filename:join([DataDir,"test_records"]),OutDir]),
- ?line {ok,test_records} = compile:file(filename:join([DataDir,"test_records"]),
- [{i,OutDir}]),
- io:format("check_record_names: calling test_records:'check_record_names_OTP-5812'/1~n",[]),
- ?line ok = test_records:'check_record_names_OTP-5812'(Msg).
-
-% check_record_names({initiatingMessage,
-% #'InitiatingMessage'{procedureID = ProcedureID,
-% criticality = _Criticality,
-% messageDiscriminator = _MessageDisc,
-% transactionID = _TransactionID,
-% value = Value}}) ->
-
-% ?line ok = check_record_ProcedureID(ProcedureID),
-% ?line 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);
-% check_record_Value(_) -> false.
-
-% check_record_ProtocolIEs(#'ProtocolIE-Field'{value =IndicationType}) ->
-% ?line ok = check_record_NFResourceStatusInd(IndicationType);
-% check_record_ProtocolIEs(_) -> false.
-
-% check_record_NFResourceStatusInd({'no-Failure',#'No-Failure-ResourceStatusInd'{'local-Cell-InformationList'=[LCI]}}) ->
-% ?line ok = check_record_LCInfoResourceStatusInd(LCI);
-% check_record_NFResourceStatusInd(_) -> 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).
-
-% check_record_CCCCL(#'CommonChannelsCapacityConsumptionLaw_SEQOF'{}) ->
-% ok;
-% check_record_CCCCL(_) -> false.
-
-% check_record_DCCCL(#'DedicatedChannelsCapacityConsumptionLaw_SEQOF'{}) ->
-% ok;
-% check_record_DCCCL(_) -> false.
-% check_record_LCIRE(#'ProtocolExtensionField'{}) ->
-% ok;
-% check_record_LCIRE(_) -> false.
+ CaseDir = ?config(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 8662744ed3..a37d8004ef 100644
--- a/lib/asn1/test/testOpenTypeImplicitTag.erl
+++ b/lib/asn1/test/testOpenTypeImplicitTag.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -19,21 +19,10 @@
%%
-module(testOpenTypeImplicitTag).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "OpenTypeImplicitTag",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes1} =
diff --git a/lib/asn1/test/testParamBasic.erl b/lib/asn1/test/testParamBasic.erl
index 4ba0029b54..b5780195b8 100644
--- a/lib/asn1/test/testParamBasic.erl
+++ b/lib/asn1/test/testParamBasic.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -19,8 +19,6 @@
%%
-module(testParamBasic).
--export([compile/3]).
--export([compile_der/2]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -30,22 +28,6 @@
-record('T21',{number, string}).
-record('T22',{number, string}).
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ParamBasic",
- [Rules,{outdir,OutDir}]++Options).
-
-compile_der(Config,Rules) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "ParamBasic",
- [der,Rules,{outdir,OutDir}]).
-
main(Rules) ->
?line {ok,Bytes11} =
diff --git a/lib/asn1/test/testParameterizedInfObj.erl b/lib/asn1/test/testParameterizedInfObj.erl
index b95d627d58..68faf08a61 100644
--- a/lib/asn1/test/testParameterizedInfObj.erl
+++ b/lib/asn1/test/testParameterizedInfObj.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -20,7 +20,7 @@
-module(testParameterizedInfObj).
--export([compile/3,main/1,ranap/1]).
+-export([main/1,ranap/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -31,16 +31,6 @@
-record('Iu-ReleaseCommand',{protocolIEs,protocolExtensions}).
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(DataDir ++ "Param",[Rules,{outdir,OutDir}]++Options).
-% ?line ok = asn1ct:compile(DataDir ++ "RANAP-CommonDataTypes",[Rules,{outdir,OutDir}]++Options).
-
-
main(Erule) ->
PERVal = #'AllocationOrRetentionPriority'
{priorityLevel = true,
diff --git a/lib/asn1/test/testPrim.erl b/lib/asn1/test/testPrim.erl
index 39c1e4d1d8..0d4427ba69 100644
--- a/lib/asn1/test/testPrim.erl
+++ b/lib/asn1/test/testPrim.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testPrim).
--export([compile/3]).
-export([bool/1]).
-export([int/1]).
-export([enum/1]).
@@ -30,18 +29,6 @@
-include_lib("test_server/include/test_server.hrl").
-
-
-compile(Config,Rules,Opt) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "Prim",
- [Rules,{outdir,OutDir}] ++ Opt),
- ?line ok = asn1ct:compile(DataDir ++ "Real",
- [Rules,{outdir,OutDir}] ++ Opt).
-
bool(Rules) ->
%%==========================================================
diff --git a/lib/asn1/test/testPrimExternal.erl b/lib/asn1/test/testPrimExternal.erl
index 23633177eb..65c3c3a31a 100644
--- a/lib/asn1/test/testPrimExternal.erl
+++ b/lib/asn1/test/testPrimExternal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,21 +19,10 @@
%%
-module(testPrimExternal).
--export([compile/3]).
-export([external/1]).
-include_lib("test_server/include/test_server.hrl").
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "PrimExternal",[Rules,{outdir,OutDir}]++Options).
-
-
-
external(_Rules) ->
diff --git a/lib/asn1/test/testPrimStrings.erl b/lib/asn1/test/testPrimStrings.erl
index 33652d6554..b1c5172b95 100644
--- a/lib/asn1/test/testPrimStrings.erl
+++ b/lib/asn1/test/testPrimStrings.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testPrimStrings).
--export([compile/3]).
-export([bit_string/1]).
-export([bit_string_unnamed/1]).
-export([octet_string/1]).
@@ -33,22 +32,6 @@
-include_lib("test_server/include/test_server.hrl").
-
-compile(Config,Rules,Option) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "PrimStrings",
- [Rules,{outdir,OutDir}]++Option),
- ?line {ok,IO} = file:open(test_config,write),
- io:format(IO,"~p.~n",[Config]),
- file:close(IO),
- ?line ok = asn1ct:compile(DataDir ++ "BitStr",
- [Rules, {outdir,OutDir}]++Option).
-
-
-
bit_string(Rules) ->
%%==========================================================
diff --git a/lib/asn1/test/testRANAP.erl b/lib/asn1/test/testRANAP.erl
deleted file mode 100644
index 52a58d850b..0000000000
--- a/lib/asn1/test/testRANAP.erl
+++ /dev/null
@@ -1,52 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%%
-
--module(testRANAP).
-
--export([compile/3,testobj/1]).
-
--include_lib("test_server/include/test_server.hrl").
-
-
-compile(Config,Erule,Options) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(filename:join(DataDir,"RANAP"),[Erule,{outdir,OutDir}]++Options),
- ?line {ok,testobj} = compile:file(filename:join(DataDir,"testobj"),[{i,OutDir},{outdir,OutDir}]++Options),
- ok.
-
-testobj(_Erule) ->
- ?line ok = testobj:run_com_id(),
- ?line ok = testobj:run_dir_tsf_2cn(),
- ?line ok = testobj:run_dir_tsf_2rnc(),
- ?line ok = testobj:run_init_ue(),
- ?line ok = testobj:run_iu_rel_cmd(),
- ?line ok = testobj:run_iu_rel_cmp(),
- ?line ok = testobj:run_rab_ass_rsp_delete(),
- ?line ok = testobj:run_rab_ass_rsp_setup(),
- ?line ok = testobj:run_rab_create(),
- ?line ok = testobj:run_rab_rel(),
- ?line ok = testobj:run_reset(),
- ?line ok = testobj:run_reset_res(),
- ?line ok = testobj:run_sm_cmd(),
- ?line ok = testobj:run_sm_cmp(),
- ?line ok = testobj:run_sm_rej().
diff --git a/lib/asn1/test/testSSLspecs.erl b/lib/asn1/test/testSSLspecs.erl
index 10623af51e..51ef134e5f 100644
--- a/lib/asn1/test/testSSLspecs.erl
+++ b/lib/asn1/test/testSSLspecs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -20,58 +20,37 @@
-module(testSSLspecs).
--export([compile/3,run/1,compile_inline/2,run_inline/1]).
+-export([compile/2,run/1,compile_inline/2,run_inline/1]).
-include_lib("test_server/include/test_server.hrl").
+compile(Config, Options) ->
+ DataDir = ?config(data_dir, Config),
+ CaseDir = ?config(case_dir, Config),
+ NewOptions = [{i, DataDir}, {i, CaseDir}|Options],
-compile(Config,Rules,Options) ->
+ asn1_test_lib:compile_all(["SSL-PKIX", "PKIXAttributeCertificate"],
+ Config, NewOptions),
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(DataDir ++
- "SSL-PKIX",[Rules,{outdir,OutDir},{i,DataDir},
- {i,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++ "PKIXAttributeCertificate",
- [Rules,{outdir,OutDir},{i,DataDir},
- {i,OutDir}]++Options),
%% test case for OTP-4792 optional open type
- ?line ok = asn1ct:compile(DataDir ++ "PKIX1Algorithms88",
- [Rules,{outdir,OutDir},{i,DataDir},
- {i,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++ "PKIX1Explicit88",
- [Rules,{outdir,OutDir},{i,DataDir},
- {i,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++ "PKIX1Implicit88",
- [Rules,{outdir,OutDir},{i,DataDir},
- {i,OutDir}]++Options),
+ asn1_test_lib:compile_all(["PKIX1Algorithms88", "PKIX1Explicit88",
+ "PKIX1Implicit88"],
+ Config, NewOptions),
+
%% OTP-6698, OTP-6702
- ?line ok = remove_db_files(OutDir),
- ?line ok = asn1ct:compile(DataDir ++ "PKIX1Explicit93",
- [Rules,{outdir,OutDir},{i,DataDir},
- {i,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++ "PKIX1Implicit93",
- [Rules,{outdir,OutDir},{i,DataDir},
- {i,OutDir}]++Options).
-
-compile_inline(Config,Rule) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- case Rule of
- BER when BER==ber_bin;BER==ber_bin_v2 ->
- Options = [der,compact_bit_string,optimize,
- asn1config,inline],
- ?line ok = remove_db_file_inline(OutDir),
- ?line ok = asn1ct:compile(DataDir ++ "OTP-PKIX.set.asn",
- [Rule,{outdir,OutDir},{i,DataDir},
- {i,OutDir}]++Options);
- _ ->
- ok
- end.
+ ok = remove_db_files(CaseDir),
+ asn1_test_lib:compile_all(["PKIX1Explicit93", "PKIX1Implicit93"],
+ Config, NewOptions).
+
+compile_inline(Config, Rule) when Rule == ber_bin; Rule == ber_bin_v2 ->
+ DataDir = ?config(data_dir, Config),
+ CaseDir = ?config(case_dir, Config),
+ Options = [{i, CaseDir}, {i, DataDir}, Rule,
+ der, compact_bit_string, optimize, asn1config, inline],
+ ok = remove_db_file_inline(CaseDir),
+ asn1_test_lib:compile("OTP-PKIX.set.asn", Config, Options);
+compile_inline(_Config, _Rule) ->
+ ok.
remove_db_files(Dir) ->
?line ok = remove_db_file(Dir ++ "PKIX1Explicit93.asn1db"),
diff --git a/lib/asn1/test/testSelectionTypes.erl b/lib/asn1/test/testSelectionTypes.erl
index 893c31622f..6d1641388f 100644
--- a/lib/asn1/test/testSelectionTypes.erl
+++ b/lib/asn1/test/testSelectionTypes.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -19,19 +19,10 @@
%%
-module(testSelectionTypes).
--export([compile/3]).
-export([test/0]).
-include_lib("test_server/include/test_server.hrl").
-
-compile(Config,Rule,Options) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SelectionType",
- [Rule,{outdir,OutDir}]++Options).
-
test() ->
Val = ["PrintableString","PrintableString","PrintableString"],
?line {ok,Bin}=asn1_wrapper:encode('SelectionType','MendeleyevTable',Val),
diff --git a/lib/asn1/test/testSeq2738.erl b/lib/asn1/test/testSeq2738.erl
index 9cf9c8fcb4..cddfe4b311 100644
--- a/lib/asn1/test/testSeq2738.erl
+++ b/lib/asn1/test/testSeq2738.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSeq2738).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -32,14 +31,6 @@
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "Seq2738",[Rules,{outdir,OutDir}]++Options).
-
-
main(_Rules) ->
?line {ok,Bytes} =
diff --git a/lib/asn1/test/testSeqDefault.erl b/lib/asn1/test/testSeqDefault.erl
index edf07cf1c1..a772b749bd 100644
--- a/lib/asn1/test/testSeqDefault.erl
+++ b/lib/asn1/test/testSeqDefault.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -20,7 +20,6 @@
-module(testSeqDefault).
-include("External.hrl").
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -37,15 +36,6 @@
-record('SeqIn',{boolIn, intIn}).
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SeqDefault",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes11} =
diff --git a/lib/asn1/test/testSeqExtension.erl b/lib/asn1/test/testSeqExtension.erl
index 538e2c250b..7c77ab87e9 100644
--- a/lib/asn1/test/testSeqExtension.erl
+++ b/lib/asn1/test/testSeqExtension.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -20,7 +20,6 @@
-module(testSeqExtension).
-include("External.hrl").
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -31,16 +30,6 @@
-record('SeqExt4',{bool, int}).
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SeqExtension",
- [Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes11} =
diff --git a/lib/asn1/test/testSeqIndefinite.erl b/lib/asn1/test/testSeqIndefinite.erl
index 9285d7b368..25742474bb 100644
--- a/lib/asn1/test/testSeqIndefinite.erl
+++ b/lib/asn1/test/testSeqIndefinite.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -19,20 +19,11 @@
%%
-module(testSeqIndefinite).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SeqSetIndefinite",
- [Rules,{outdir,OutDir}]++Options).
-
main(per_bin) -> ok;
main(per) -> ok;
main(ber_bin_v2) ->
diff --git a/lib/asn1/test/testSeqOf.erl b/lib/asn1/test/testSeqOf.erl
index 961e2d89d9..0c0bbc3e66 100644
--- a/lib/asn1/test/testSeqOf.erl
+++ b/lib/asn1/test/testSeqOf.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSeqOf).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -35,18 +34,6 @@
-record('SeqEmp',{seq1}).
-record('Empty',{}).
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SeqOf",[Rules,{outdir,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++ "SeqOfEnum",[Rules,{outdir,OutDir}]++Options),
- ?line ok = asn1ct:compile(DataDir ++ "XSeqOf",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(Rules) ->
?line {ok,Bytes11} =
diff --git a/lib/asn1/test/testSeqOfCho.erl b/lib/asn1/test/testSeqOfCho.erl
index 05bd45580f..5b83c8bf21 100644
--- a/lib/asn1/test/testSeqOfCho.erl
+++ b/lib/asn1/test/testSeqOfCho.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSeqOfCho).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -31,17 +30,6 @@
-record('SeqOfChoEmbDef_SEQOF',{bool1, int1, seq1 = asn1_DEFAULT}).
-record('SeqOfChoEmbOpt_SEQOF',{bool1, int1, seq1 = asn1_NOVALUE}).
-
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SeqOfCho",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes11} =
diff --git a/lib/asn1/test/testSeqOfIndefinite.erl b/lib/asn1/test/testSeqOfIndefinite.erl
index 0221581cf1..01ef36e0b4 100644
--- a/lib/asn1/test/testSeqOfIndefinite.erl
+++ b/lib/asn1/test/testSeqOfIndefinite.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -19,42 +19,10 @@
%%
-module(testSeqOfIndefinite).
--export([compile/3]).
-export([main/0]).
-include_lib("test_server/include/test_server.hrl").
-%-record('Seq1',{bool1, int1, seq1 = asn1_DEFAULT}).
-%-record('Seq2',{seq2 = asn1_DEFAULT, bool2, int2}).
-%-record('Seq3',{bool3, seq3 = asn1_DEFAULT, int3}).
-%-record('Seq4',{seq41 = asn1_DEFAULT, seq42 = asn1_DEFAULT, seq43 = asn1_DEFAULT}).
-%-record('SeqIn',{boolIn, intIn}).
-%-record('SeqCho',{bool1, int1, seq1 = asn1_DEFAULT}).
-%-record('SeqChoInline',{bool1, int1, seq1 = asn1_DEFAULT}).
-%-record('SeqChoOfInline_SEQOF',{bool1, int1, seq1 = asn1_DEFAULT}).
-%-record('SeqEmp',{seq1}).
-%-record('Empty',{}).
-
-
-
-compile(Config,Rules,Opts) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line Options = [Rules,{outdir,OutDir}]++Opts,
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-Constants-1",Options),
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-DataTypes-1",Options),
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-21-4",Options),
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-20-4",Options),
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-19-4",Options),
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-18-4",Options),
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-17-4",Options),
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-15-4",Options),
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-14-4",Options),
- ?line ok = asn1ct:compile(DataDir ++ "Mvrasn-11-4",Options),
- ?line ok = asn1ct:compile(DataDir ++ "SeqOf",Options).
-
main() ->
?line ok = test(isd),
?line ok = test(isd2),
diff --git a/lib/asn1/test/testSeqOfTag.erl b/lib/asn1/test/testSeqOfTag.erl
index 4f56ab717b..2359df0c59 100644
--- a/lib/asn1/test/testSeqOfTag.erl
+++ b/lib/asn1/test/testSeqOfTag.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,8 +19,6 @@
%%
-module(testSeqOfTag).
-
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -45,17 +43,6 @@
-record('Imp',{os, bool}).
-record('Exp',{os, bool}).
-
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SeqOfTag",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes11} =
diff --git a/lib/asn1/test/testSeqOptional.erl b/lib/asn1/test/testSeqOptional.erl
index 0125c9fb3e..8013f3c685 100644
--- a/lib/asn1/test/testSeqOptional.erl
+++ b/lib/asn1/test/testSeqOptional.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -20,7 +20,6 @@
-module(testSeqOptional).
-include("External.hrl").
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -37,16 +36,6 @@
-record('SeqIn',{boolIn, intIn}).
-record('SeqChoOpt',{int, cho = asn1_NOVALUE}).
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SeqOptional",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes11} =
diff --git a/lib/asn1/test/testSeqPrim.erl b/lib/asn1/test/testSeqPrim.erl
index ec48d1b779..c2451a7cd1 100644
--- a/lib/asn1/test/testSeqPrim.erl
+++ b/lib/asn1/test/testSeqPrim.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSeqPrim).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -27,15 +26,6 @@
-record('Seq',{bool, boolCon, boolPri, boolApp, boolExpCon, boolExpPri, boolExpApp}).
-record('Empty',{}).
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SeqPrim",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
diff --git a/lib/asn1/test/testSeqSetDefaultVal.erl b/lib/asn1/test/testSeqSetDefaultVal.erl
index 5a1a443ebc..ab484db5f2 100644
--- a/lib/asn1/test/testSeqSetDefaultVal.erl
+++ b/lib/asn1/test/testSeqSetDefaultVal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -20,7 +20,6 @@
-module(testSeqSetDefaultVal).
-include("External.hrl").
--export([compile/2]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -95,14 +94,6 @@
-record('S4_b',{ba = asn1_DEFAULT,
bb = asn1_DEFAULT}).
-
-compile(Config,Rules) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "Default",
- [Rules,der,{outdir,OutDir}]).
-
main(_Rules) ->
?line {ok,[48,0]} =
diff --git a/lib/asn1/test/testSeqTag.erl b/lib/asn1/test/testSeqTag.erl
index 60d3629840..9fdaae35dd 100644
--- a/lib/asn1/test/testSeqTag.erl
+++ b/lib/asn1/test/testSeqTag.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSeqTag).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -35,16 +34,6 @@
-record('Imp',{os, bool}).
-record('Exp',{os, bool}).
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SeqTag",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
diff --git a/lib/asn1/test/testSeqTypeRefCho.erl b/lib/asn1/test/testSeqTypeRefCho.erl
index 9262fd1bfd..4b9eac7034 100644
--- a/lib/asn1/test/testSeqTypeRefCho.erl
+++ b/lib/asn1/test/testSeqTypeRefCho.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSeqTypeRefCho).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -27,16 +26,6 @@
-record('SeqTRcho',{seqCho, seqChoE, 'seqCho-E', 'seqChoE-E'}).
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SeqTypeRefCho",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
diff --git a/lib/asn1/test/testSeqTypeRefSeq.erl b/lib/asn1/test/testSeqTypeRefSeq.erl
index 51b0f13c57..57ec6c19b1 100644
--- a/lib/asn1/test/testSeqTypeRefSeq.erl
+++ b/lib/asn1/test/testSeqTypeRefSeq.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSeqTypeRefSeq).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -46,15 +45,6 @@
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SeqTypeRefSeq",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
diff --git a/lib/asn1/test/testSeqTypeRefSet.erl b/lib/asn1/test/testSeqTypeRefSet.erl
index a704ce3403..c06a0e7a2b 100644
--- a/lib/asn1/test/testSeqTypeRefSet.erl
+++ b/lib/asn1/test/testSeqTypeRefSet.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSeqTypeRefSet).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -31,15 +30,6 @@
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SeqTypeRefSet",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes41} =
diff --git a/lib/asn1/test/testSetDefault.erl b/lib/asn1/test/testSetDefault.erl
index e36894327c..8aa205e0f0 100644
--- a/lib/asn1/test/testSetDefault.erl
+++ b/lib/asn1/test/testSetDefault.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSetDefault).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -30,16 +29,6 @@
-record('SetIn',{boolIn, intIn}).
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SetDefault",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes11} =
diff --git a/lib/asn1/test/testSetExternal.erl b/lib/asn1/test/testSetExternal.erl
index 41f32dcd90..30cddcacfb 100644
--- a/lib/asn1/test/testSetExternal.erl
+++ b/lib/asn1/test/testSetExternal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -20,7 +20,6 @@
-module(testSetExternal).
-include("External.hrl").
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -33,17 +32,6 @@
%-record('Imp',{os, bool}).
%-record('Exp',{os, bool}).
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SetExternal",
- [Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes11} =
diff --git a/lib/asn1/test/testSetIndefinite.erl b/lib/asn1/test/testSetIndefinite.erl
index bf8b242860..d8e2b6a9cf 100644
--- a/lib/asn1/test/testSetIndefinite.erl
+++ b/lib/asn1/test/testSetIndefinite.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -19,20 +19,11 @@
%%
-module(testSetIndefinite).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SeqSetIndefinite",
- [Rules,{outdir,OutDir}]++Options).
-
main(per_bin) -> ok;
main(per) -> ok;
main(ber_bin_v2) ->
diff --git a/lib/asn1/test/testSetOf.erl b/lib/asn1/test/testSetOf.erl
index 0769b9a344..08723fb468 100644
--- a/lib/asn1/test/testSetOf.erl
+++ b/lib/asn1/test/testSetOf.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSetOf).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -37,15 +36,6 @@
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SetOf",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes11} =
diff --git a/lib/asn1/test/testSetOfCho.erl b/lib/asn1/test/testSetOfCho.erl
index 474742fbdb..c89bf9596e 100644
--- a/lib/asn1/test/testSetOfCho.erl
+++ b/lib/asn1/test/testSetOfCho.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSetOfCho).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -33,15 +32,6 @@
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SetOfCho",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes11} =
diff --git a/lib/asn1/test/testSetOfExternal.erl b/lib/asn1/test/testSetOfExternal.erl
index 9e2b01c698..6b280a2595 100644
--- a/lib/asn1/test/testSetOfExternal.erl
+++ b/lib/asn1/test/testSetOfExternal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -20,7 +20,6 @@
-module(testSetOfExternal).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -32,15 +31,6 @@
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SetOfExternal",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes11} =
diff --git a/lib/asn1/test/testSetOfTag.erl b/lib/asn1/test/testSetOfTag.erl
index c101306d7a..2c7a2f5473 100644
--- a/lib/asn1/test/testSetOfTag.erl
+++ b/lib/asn1/test/testSetOfTag.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -20,7 +20,6 @@
-module(testSetOfTag).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -47,15 +46,6 @@
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SetOfTag",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes11} =
diff --git a/lib/asn1/test/testSetOptional.erl b/lib/asn1/test/testSetOptional.erl
index 035fa70424..4692941524 100644
--- a/lib/asn1/test/testSetOptional.erl
+++ b/lib/asn1/test/testSetOptional.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -20,7 +20,6 @@
-module(testSetOptional).
-include("External.hrl").
--export([compile/3]).
-export([main/1]).
-export([ticket_7533/1,decoder/4]).
-include_lib("test_server/include/test_server.hrl").
@@ -36,16 +35,6 @@
-record('SetOpt3Exp',{bool3 = asn1_NOVALUE, set3 = asn1_NOVALUE, int3 = asn1_NOVALUE}).
-record('SetIn',{boolIn, intIn}).
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SetOptional",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes11} =
@@ -204,9 +193,8 @@ ticket_7533(Ber) when Ber == ber; Ber == ber_bin ->
io:format("Decode result: ~p~n",[Result]),
ok
after 10000 ->
- exit(Pid,normal),
io:format("Decode timeout~n",[]),
- error
+ exit(Pid,normal)
end;
ticket_7533(_) ->
ok.
diff --git a/lib/asn1/test/testSetPrim.erl b/lib/asn1/test/testSetPrim.erl
index e093c918e3..3234b65135 100644
--- a/lib/asn1/test/testSetPrim.erl
+++ b/lib/asn1/test/testSetPrim.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSetPrim).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -27,15 +26,6 @@
-record('Set',{bool, boolCon, boolPri, boolApp, boolExpCon, boolExpPri, boolExpApp}).
-record('Empty',{}).
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SetPrim",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
diff --git a/lib/asn1/test/testSetTag.erl b/lib/asn1/test/testSetTag.erl
index 8df3e36815..8b9364d603 100644
--- a/lib/asn1/test/testSetTag.erl
+++ b/lib/asn1/test/testSetTag.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSetTag).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -35,16 +34,6 @@
-record('Imp',{os, bool}).
-record('Exp',{os, bool}).
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SetTag",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
diff --git a/lib/asn1/test/testSetTypeRefCho.erl b/lib/asn1/test/testSetTypeRefCho.erl
index 1f68a8fbc4..a0989926c7 100644
--- a/lib/asn1/test/testSetTypeRefCho.erl
+++ b/lib/asn1/test/testSetTypeRefCho.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSetTypeRefCho).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -28,15 +27,6 @@
-record('SetTRcho',{setCho, setChoE, 'setCho-E', 'setChoE-E'}).
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SetTypeRefCho",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
diff --git a/lib/asn1/test/testSetTypeRefPrim.erl b/lib/asn1/test/testSetTypeRefPrim.erl
index e6cec260e5..9c7fbd803e 100644
--- a/lib/asn1/test/testSetTypeRefPrim.erl
+++ b/lib/asn1/test/testSetTypeRefPrim.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSetTypeRefPrim).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -27,15 +26,6 @@
-record('SetTR',{octStr, octStrI, octStrE, 'octStr-I', 'octStrI-I', 'octStrE-I', 'octStr-E', 'octStrI-E', 'octStrE-E'}).
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SetTypeRefPrim",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
diff --git a/lib/asn1/test/testSetTypeRefSeq.erl b/lib/asn1/test/testSetTypeRefSeq.erl
index 0c1c9400bf..a3ef4b188d 100644
--- a/lib/asn1/test/testSetTypeRefSeq.erl
+++ b/lib/asn1/test/testSetTypeRefSeq.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSetTypeRefSeq).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -31,15 +30,6 @@
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SetTypeRefSeq",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
?line {ok,Bytes41} =
diff --git a/lib/asn1/test/testSetTypeRefSet.erl b/lib/asn1/test/testSetTypeRefSet.erl
index 6544e77458..ce77316ef8 100644
--- a/lib/asn1/test/testSetTypeRefSet.erl
+++ b/lib/asn1/test/testSetTypeRefSet.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,7 +19,6 @@
%%
-module(testSetTypeRefSet).
--export([compile/3]).
-export([main/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -46,15 +45,6 @@
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SetTypeRefSet",[Rules,{outdir,OutDir}]++Options).
-
-
-
main(_Rules) ->
diff --git a/lib/asn1/test/testTCAP.erl b/lib/asn1/test/testTCAP.erl
index 5e29938a16..878ce7c070 100644
--- a/lib/asn1/test/testTCAP.erl
+++ b/lib/asn1/test/testTCAP.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -19,33 +19,23 @@
%%
-module(testTCAP).
--export([compile/3,test/2,compile_asn1config/3,test_asn1config/0]).
+-export([compile/2,test/2,compile_asn1config/2,test_asn1config/0]).
-include_lib("test_server/include/test_server.hrl").
+compile(Config, Options) ->
+ Files = ["Remote-Operations-Information-Objects",
+ "TCAPMessages",
+ "TCAPMessages-simple",
+ "TCAPPackage"],
+ asn1_test_lib:compile_all(Files, Config, Options),
+ asn1_test_lib:compile_erlang("TCAPPackage_msg", Config, []).
-
-compile(Config,Rules,Opt) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(DataDir ++ "Remote-Operations-Information-Objects",[Rules,{outdir,OutDir}]++Opt),
-% ?line ok = asn1ct:compile(DataDir ++ "Remote-Operations-Generic-ROS-PDUs",[Rules,{outdir,OutDir}]++Opt),
-% ?line ok = asn1ct:compile(DataDir ++ "Remote-Operations-Useful-Definitions",[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(DataDir ++ "TCAPMessages",[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(DataDir ++ "TCAPMessages-simple",[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(DataDir ++ "TCAPPackage",[Rules,{outdir,OutDir}]++Opt),
- ?line compile:file(filename:join([DataDir,"TCAPPackage_msg"]),[{i,OutDir},{outdir,OutDir}]).
-
-compile_asn1config(Config,Rules,Opt) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(DataDir ++ "TCAPPackage",
- [Rules,{outdir,OutDir},{i,DataDir}]++Opt).
+compile_asn1config(Config, Options) ->
+ Files = ["Remote-Operations-Information-Objects",
+ "TCAPPackage"],
+ asn1_test_lib:compile_all(Files, Config, Options),
+ asn1_test_lib:compile_erlang("TCAPPackage_msg", Config, []).
test(Erule,_Config) when Erule==ber;Erule==ber_bin;Erule==ber_bin_v2 ->
% ?line OutDir = ?config(priv_dir,Config),
diff --git a/lib/asn1/test/testTcapsystem.erl b/lib/asn1/test/testTcapsystem.erl
index 2f13c11cd4..4979a385b2 100644
--- a/lib/asn1/test/testTcapsystem.erl
+++ b/lib/asn1/test/testTcapsystem.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -19,54 +19,46 @@
%%
-module(testTcapsystem).
--export([compile/3]).
+-export([compile/2]).
-include_lib("test_server/include/test_server.hrl").
-
-
-compile(Config,Rules,Opt) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line DataDir2 = filename:join([DataDir,tcapsystem]),
-
- ?line ok = asn1ct:compile(filename:join([DataDir2,"DialoguePDUs.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-ApplicationContexts.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-BS-Code.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-CallHandlingOperations.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-CH-DataTypes.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-CommonDataTypes.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-DialogueInformation.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-ER-DataTypes.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-Errors.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-ExtensionDataTypes.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-GR-DataTypes.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-Group-Call-Operations.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-LCS-DataTypes.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-LocationServiceOperations.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-MobileServiceOperations.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-MS-DataTypes.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-OM-DataTypes.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-OperationAndMaintenanceOperations.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-Protocol.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-SecureTransportOperations.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-ShortMessageServiceOperations.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-SM-DataTypes.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-SS-Code.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-SS-DataTypes.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-ST-DataTypes.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-SupplementaryServiceOperations.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MAP-TS-Code.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"MobileDomainDefinitions.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"Remote-Operations-Generic-ROS-PDUs.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"Remote-Operations-Information-Objects.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"Remote-Operations-Useful-Definitions.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"TCAP-Examples.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"TCAPMessages.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"TCAP-Tools.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"TC-Notation-Extensions.asn"]),[Rules,{outdir,OutDir}]++Opt),
- ?line ok = asn1ct:compile(filename:join([DataDir2,"UnidialoguePDUs.asn"]),[Rules,{outdir,OutDir}]++Opt).
-
-
+compile(Config, Options) ->
+ [asn1_test_lib:compile(filename:join([tcapsystem, M]), Config, Options)
+ || M <- ["DialoguePDUs.asn",
+ "MAP-ApplicationContexts.asn",
+ "MAP-BS-Code.asn",
+ "MAP-CallHandlingOperations.asn",
+ "MAP-CH-DataTypes.asn",
+ "MAP-CommonDataTypes.asn",
+ "MAP-DialogueInformation.asn",
+ "MAP-ER-DataTypes.asn",
+ "MAP-Errors.asn",
+ "MAP-ExtensionDataTypes.asn",
+ "MAP-GR-DataTypes.asn",
+ "MAP-Group-Call-Operations.asn",
+ "MAP-LCS-DataTypes.asn",
+ "MAP-LocationServiceOperations.asn",
+ "MAP-MobileServiceOperations.asn",
+ "MAP-MS-DataTypes.asn",
+ "MAP-OM-DataTypes.asn",
+ "MAP-OperationAndMaintenanceOperations.asn",
+ "MAP-Protocol.asn",
+ "MAP-SecureTransportOperations.asn",
+ "MAP-ShortMessageServiceOperations.asn",
+ "MAP-SM-DataTypes.asn",
+ "MAP-SS-Code.asn",
+ "MAP-SS-DataTypes.asn",
+ "MAP-ST-DataTypes.asn",
+ "MAP-SupplementaryServiceOperations.asn",
+ "MAP-TS-Code.asn",
+ "MobileDomainDefinitions.asn",
+ "Remote-Operations-Generic-ROS-PDUs.asn",
+ "Remote-Operations-Information-Objects.asn",
+ "Remote-Operations-Useful-Definitions.asn",
+ "TCAP-Examples.asn",
+ "TCAPMessages.asn",
+ "TCAP-Tools.asn",
+ "TC-Notation-Extensions.asn",
+ "UnidialoguePDUs.asn"]],
+ ok.
diff --git a/lib/asn1/test/testTimer.erl b/lib/asn1/test/testTimer.erl
index 74002e16e9..2d3b777558 100644
--- a/lib/asn1/test/testTimer.erl
+++ b/lib/asn1/test/testTimer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -26,12 +26,6 @@
-define(times, 5000).
-compile(Config,Enc,Options) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ok = asn1ct:compile(DataDir++"H235-SECURITY-MESSAGES",[Enc,{outdir,OutDir}]++Options),
- ok = asn1ct:compile(DataDir++"H323-MESSAGES",[Enc,{outdir,OutDir}]++Options).
-
val() ->
_Value = {'H323-UserInformation',{'H323-UU-PDU',
{callProceeding,
diff --git a/lib/asn1/test/testTypeValueNotation.erl b/lib/asn1/test/testTypeValueNotation.erl
index f0699370e0..cd5223ef23 100644
--- a/lib/asn1/test/testTypeValueNotation.erl
+++ b/lib/asn1/test/testTypeValueNotation.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -19,60 +19,43 @@
%%
-module(testTypeValueNotation).
--export([compile/3]).
-export([main/2]).
-include_lib("test_server/include/test_server.hrl").
--record('Seq',{octstr, int, bool, enum, bitstr, null, oid, vstr}).
-
-
-compile(Config,Rules,Options) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "SeqTypeRefPrim",
- [Rules,{outdir,OutDir}]++Options),
- %% OTP-6695
- ?line ok = asn1ct:compile(DataDir ++ "ValueTest",
- [Rules,{outdir,OutDir}]++Options).
-
-
-main(Rules,Option) ->
-
- io:format("testTypeValueNotation:main/2 with arguments:~nRules: ~w, Option: ~w~n",[Rules,Option]),
- Value1 = #'Seq'{octstr = [1,2,3,4],
- int = 12,
- bool = true,
- enum = a,
- bitstr = [1,0,1,0],
- null = 'NULL',
- oid = {1,2,55},
- vstr = "Hello World"},
- Value2 = #'Seq'{octstr = {'OctStr',[1,2,3,4]},
- int = {'Int',12},
- bool = {'Bool',true},
- enum = {'Enum',a},
- bitstr = {'BitStr',[1,0,1,0]},
- null = {'Null','NULL'},
- oid = {'OId',{1,2,55}},
- vstr = {'VStr',"Hello World"}},
- case Option of
- optimize when Rules == per_bin; Rules == ber_bin ; Rules == uper_bin; Rules == ber_bin_v2 ->
- ?line {ok,Bytes} =
- asn1_wrapper:encode('SeqTypeRefPrim','Seq',Value1),
- ?line {error,_Reason} =
- asn1_wrapper:encode('SeqTypeRefPrim','Seq',Value2),
- ?line {ok,Value1} =
- asn1_wrapper:decode('SeqTypeRefPrim','Seq',Bytes);
- _ ->
- ?line {ok,Bytes} =
- asn1_wrapper:encode('SeqTypeRefPrim','Seq',Value1),
- ?line {ok,Bytes} =
- asn1_wrapper:encode('SeqTypeRefPrim','Seq',Value2),
- ?line {ok,Value1} =
- asn1_wrapper:decode('SeqTypeRefPrim','Seq',Bytes)
- end,
-
- ok.
+-record('Seq', {octstr, int, bool, enum, bitstr, null, oid, vstr}).
+
+main(Rule, Option) ->
+ Value1 = #'Seq'{octstr = [1, 2, 3, 4],
+ int = 12,
+ bool = true,
+ enum = a,
+ bitstr = [1, 0, 1, 0],
+ null = 'NULL',
+ oid = {1, 2, 55},
+ vstr = "Hello World"},
+ Value2 = #'Seq'{octstr = {'OctStr', [1, 2, 3, 4]},
+ int = {'Int', 12},
+ bool = {'Bool', true},
+ enum = {'Enum', a},
+ bitstr = {'BitStr', [1, 0, 1, 0]},
+ null = {'Null', 'NULL'},
+ oid = {'OId', {1, 2, 55}},
+ vstr = {'VStr', "Hello World"}},
+ main(Rule, Option, Value1, Value2).
+
+%% Value2 will fail for ber_bin_v2, per_bin with nifs (optimize) and uper_bin
+main(ber_bin_v2, _, Value1, Value2) -> encode_fail(Value1, Value2);
+main(per_bin, [optimize], Value1, Value2) -> encode_fail(Value1, Value2);
+main(uper_bin, [], Value1, Value2) -> encode_fail(Value1, Value2);
+main(_, _, Value1, Value2) -> encode_normal(Value1, Value2).
+
+encode_normal(Value1, Value2) ->
+ {ok, Bytes} = asn1_wrapper:encode('SeqTypeRefPrim', 'Seq', Value1),
+ {ok, Bytes} = asn1_wrapper:encode('SeqTypeRefPrim', 'Seq', Value2),
+ {ok, Value1} = asn1_wrapper:decode('SeqTypeRefPrim', 'Seq', Bytes).
+
+encode_fail(Value1, Value2) ->
+ {ok, Bytes} = asn1_wrapper:encode('SeqTypeRefPrim', 'Seq', Value1),
+ {error, _Reason} = asn1_wrapper:encode('SeqTypeRefPrim', 'Seq', Value2),
+ {ok, Value1} = asn1_wrapper:decode('SeqTypeRefPrim', 'Seq', Bytes).
diff --git a/lib/asn1/test/testX420.erl b/lib/asn1/test/testX420.erl
index 1d18e76c48..abdbbfe536 100644
--- a/lib/asn1/test/testX420.erl
+++ b/lib/asn1/test/testX420.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -26,32 +26,21 @@
-include_lib("test_server/include/test_server.hrl").
-compile(Erule,Options,Config) ->
-
+compile(Erule, Options, Config) ->
Specs = specs(),
- ?line 99 = length(Specs),
- ?line ok = compile_loop(Erule,Specs,Options,Config).
-
-
+ 99 = length(Specs),
+ ok = compile_loop(Erule,Specs,Options,Config).
-compile_loop(_Erule,[],_Options,_Config) ->
+compile_loop(_Erule, [], _Options, _Config) ->
ok;
-compile_loop(Erule,[Spec|Specs],Options,Config)
- when Erule == ber; Erule == ber_bin; Erule == ber_bin_v2;
- Erule == per ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
-
- case asn1ct:compile(DataDir ++ "/x420/" ++ Spec,[Erule,{outdir,OutDir},
- {i,OutDir}]++Options) of
- ok ->
- compile_loop(Erule,Specs,Options,Config);
- Error ->
- Error
- end;
-compile_loop(_Erule,_Specs,_Options,_Config) ->
- ok.%%{skip,io_lib:format("Not tested for ~p",[Erule])}.
+compile_loop(Erule, [Spec|Specs], Options, Config)
+ when Erule == ber; Erule == ber_bin; Erule == ber_bin_v2; Erule == per ->
+ CaseDir = ?config(case_dir, Config),
+ asn1_test_lib:compile(filename:join([x420, Spec]), Config,
+ [Erule, {i, CaseDir}]),
+ compile_loop(Erule, Specs, Options, Config);
+compile_loop(_Erule, _Specs, _Options, _Config) ->
+ ok.
specs() ->
@@ -91,7 +80,7 @@ specs() ->
"Protected-Part-Descriptors", "ProtocolObjectIdentifiers",
"Raster-Gr-Coding-Attributes", "Raster-Gr-Presentation-Attributes",
"Raster-Gr-Profile-Attributes", "Reliable-Transfer-APDU",
- "Remote-Operations-Abstract-Syntaxes",
+ "Remote-Operations-Abstract-Syntaxes",
"Remote-Operations-Generic-ROS-PDUs",
"Remote-Operations-Information-Objects-extensions",
"Remote-Operations-Information-Objects",
diff --git a/lib/asn1/test/test_bad_values.erl b/lib/asn1/test/test_bad_values.erl
deleted file mode 100644
index d379a509ab..0000000000
--- a/lib/asn1/test/test_bad_values.erl
+++ /dev/null
@@ -1,29 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%%
--module(test_bad_values).
-
--export([tests/1]).
--include_lib("test_server/include/test_server.hrl").
-
-tests(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line {error,_R} = asn1ct:compile(DataDir ++ "BadEnumValue1",[{outdir,OutDir}]),
- ok.
diff --git a/lib/asn1/test/test_compile_options.erl b/lib/asn1/test/test_compile_options.erl
index a622d5bfd2..4e732308d8 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -40,10 +40,7 @@ wrong_path(Config) ->
comp(Parent,Config) ->
DataDir = ?config(data_dir,Config),
OutDir = ?config(priv_dir,Config),
- %%?line true = code:add_patha(?config(priv_dir,Config)),
- io:format("DataDir: ~p~n",[DataDir]),
?line Err=asn1ct:compile(DataDir++"NoImport",[{i,OutDir},{i,filename:join([DataDir,"subdir"])},{outdir,OutDir}]),
- io:format("compiling process terminated with value: ~p~n",[Err]),
Parent!Err.
%% OTP-5701
@@ -67,13 +64,7 @@ path(Config) ->
file:set_cwd(CWD),
ok.
-ticket_6143(Config) ->
- DataDir = ?config(data_dir,Config),
- OutDir = ?config(priv_dir,Config),
- io:format("DataDir: ~p~n",[DataDir]),
-
- ?line ok=asn1ct:compile(filename:join([DataDir,"AA1"]),[{i,DataDir},{outdir,OutDir}]),
- ok.
+ticket_6143(Config) -> asn1_test_lib:compile("AA1", Config, []).
noobj(Config) ->
DataDir = ?config(data_dir,Config),
diff --git a/lib/asn1/test/test_driver_load.erl b/lib/asn1/test/test_driver_load.erl
index 965f2473e9..e0e6602046 100644
--- a/lib/asn1/test/test_driver_load.erl
+++ b/lib/asn1/test/test_driver_load.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -19,29 +19,16 @@
%%
-module(test_driver_load).
--export([compile/2,test/2,encode/0]).
+-export([test/1,encode/0]).
-include_lib("test_server/include/test_server.hrl").
-test(per_bin,0) ->
+test(0) ->
ok;
-test(per_bin,N) ->
+test(N) ->
spawn(?MODULE,encode,[]),
- test(per_bin,N-1);
-test(_,_) ->
- ok.
-
-compile(Config,per_bin) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(DataDir ++ "P-Record",
- [per_bin,optimize,{outdir,OutDir}]);
-compile(_,Erule) ->
- {skip,lists:concat(["not implemented for version: ",Erule])}.
-
+ test(N-1).
encode() ->
?line Msg = msg(),
diff --git a/lib/asn1/test/test_inline.erl b/lib/asn1/test/test_inline.erl
index b7ec0d8921..62625572e3 100644
--- a/lib/asn1/test/test_inline.erl
+++ b/lib/asn1/test/test_inline.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -19,7 +19,7 @@
%%
-module(test_inline).
--export([compile/3,main/1,inline1/3,performance/1,performance2/0]).
+-export([compile/2,main/2,inline1/3,performance/1,performance2/0]).
-export([mvrasn_inlined_encdec/2,mvrasn_encdec/2,
mi_encdec/2,m_encdec/2]).
@@ -27,52 +27,38 @@
-define(times, 5000).
-define(times2, 50000).
-compile(Config,_Rules,Opt) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line true = code:add_patha(DataDir),
-
- ?line ok=asn1ct:compile(DataDir++"Mvrasn.set.asn",[{inline,mvrasn_inlined},{outdir,OutDir}]++Opt),
- ?line ok=asn1ct:compile(DataDir++"Mvrasn-11-6.asn",[{outdir,OutDir}]++Opt),
+compile(Config, Options) ->
+ CaseDir = ?config(case_dir, Config),
+ asn1_test_lib:compile("Mvrasn.set.asn", Config, [{inline, mvrasn_inlined}|Options]),
+ asn1_test_lib:compile("Mod.set.asn", Config, [{inline, m}|Options]),
+ ok = remove_inlined_files(CaseDir, [filename:join([CaseDir, X])||X<-["m.erl", "m.beam"]]),
+ asn1_test_lib:compile("Mod.set.asn", Config, [inline|Options]),
+ ok = remove_inlined_files(CaseDir, []).
- ?line ok=asn1ct:compile(DataDir++"Mod.set.asn",[{inline,m},{outdir,OutDir}]++Opt),
- ?line ok=remove_inlined_files(OutDir,[filename:join([OutDir,X])||X<-["m.erl","m.beam"]]),
- ?line ok=asn1ct:compile(DataDir++"Mod.set.asn",[inline,{outdir,OutDir}]++Opt),
- ?line ok=remove_inlined_files(OutDir,[]).
-
-inline1(Config,Rule,Opt) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
-
- ?line ok=asn1ct:compile(DataDir++"P-Record",
- [{inline,'inlined_P_Record'},
- {outdir,OutDir}]++Opt),
- ?line test_inline1(),
-
- ?line ok=remove_inlined_files2(OutDir,ber_bin_v2),
+inline1(Config, Rule, Opt) ->
+ CaseDir = ?config(case_dir, Config),
+
+ asn1_test_lib:compile("P-Record", Config, [{inline, 'inlined_P_Record'}|Opt]),
+ test_inline1(),
+
+ ok=remove_inlined_files2(CaseDir, ber_bin_v2),
case Rule of
- ber_bin_v2 ->
- ?line ok=asn1ct:compile(DataDir++"P-Record",
- [inline,asn1config,ber_bin,optimize,
- {outdir,OutDir}]++Opt),
- ?line test_inline2(Rule,'P-Record'),
- ?line remove_inlined_files3(OutDir,Rule),
- io:format("compiling ~p~nwith ~p~n",
- [DataDir ++ "p_record.set.asn",
- [inline,asn1config,ber_bin,optimize,{outdir,OutDir}]++Opt]),
- ?line ok = asn1ct:compile(DataDir ++ "p_record.set.asn",
- [inline,asn1config,ber_bin,optimize,
- {outdir,OutDir}]++Opt),
- ?line test_inline2(Rule,'p_record'),
- ?line remove_inlined_files4(OutDir,Rule);
- _ ->
- ok
+ ber_bin_v2 ->
+ asn1_test_lib:compile("P-Record", Config,
+ [ber_bin, inline, asn1config, optimize|Opt]),
+ test_inline2(Rule, 'P-Record'),
+ remove_inlined_files3(CaseDir, Rule),
+ asn1_test_lib:compile("p_record.set.asn", Config,
+ [ber_bin, inline, asn1config, optimize|Opt]),
+ test_inline2(Rule, 'p_record'),
+ remove_inlined_files4(CaseDir, Rule);
+ _ ->
+ ok
end.
-main(_Erule) ->
- ?line Val = val(),
+main(Config, _Erule) ->
+ Val = val(Config),
?line {ok,Bytes}=asn1_wrapper:encode(mvrasn_inlined,'InsertSubscriberDataArg',Val),
?line {ok,_Val2}=asn1_wrapper:decode(mvrasn_inlined,'InsertSubscriberDataArg',Bytes).
@@ -94,14 +80,13 @@ test_inline2(ber_bin_v2,Mod) ->
test_inline2(_,_) ->
ok.
-val() ->
- ?line {ok,Val} = asn1ct:value('Mvrasn-11-6','InsertSubscriberDataArg'),
+val(Config) ->
+ {ok,Val} = asn1ct:value('Mvrasn','InsertSubscriberDataArg',
+ [{i, ?config(case_dir, Config)}]),
Val.
performance(Config) ->
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line true = code:add_patha(?config(data_dir,Config)),
- ?line Val = val(),
+ Val = val(Config),
%% warm up
timer:tc(?MODULE,mvrasn_inlined_encdec,[2,Val]),
%% performance test
diff --git a/lib/asn1/test/test_modified_x420.erl b/lib/asn1/test/test_modified_x420.erl
index 4e96db070b..2e9dfeee87 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -20,18 +20,10 @@
-module(test_modified_x420).
%-compile(export_all).
--export([compile/1, test_io/1]).
+-export([test_io/1]).
-include_lib("test_server/include/test_server.hrl").
-compile(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
-
- ok = asn1ct:compile(filename:join([DataDir,modified_x420,"PKCS7"]),[der,{outdir,OutDir}]),
- ok = asn1ct:compile(filename:join([DataDir,modified_x420,"InformationFramework"]),[der,{outdir,OutDir}]),
- ok = asn1ct:compile(filename:join([DataDir,modified_x420,"AuthenticationFramework"]),[der,{outdir,OutDir}]).
-
test_io(Config) ->
io:format("~p~n~n", [catch test(Config)]).
diff --git a/lib/asn1/test/test_partial_incomplete_decode.erl b/lib/asn1/test/test_partial_incomplete_decode.erl
index a2e0a96bd8..df56c27115 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -19,40 +19,11 @@
%%
-module(test_partial_incomplete_decode).
--export([compile/3,test/2]).
+-export([test/1]).
-include_lib("test_server/include/test_server.hrl").
-
-
-compile(Config,Rule,Opt) when Rule == ber_bin_v2 ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(DataDir ++ "PartialDecSeq.asn",
- [Rule,{outdir,OutDir},{i,DataDir},
- asn1config]++Opt),
- ?line ok = asn1ct:compile(DataDir ++ "PartialDecSeq2.asn",
- [Rule,{outdir,OutDir},{i,DataDir},
- asn1config]++Opt),
- ?line ok = asn1ct:compile(DataDir ++ "PartialDecSeq3.asn",
- [Rule,{outdir,OutDir},{i,DataDir},
- asn1config]++Opt),
- ?line ok = asn1ct:compile(DataDir ++ "PartialDecMyHTTP.asn",
- [Rule,{outdir,OutDir},{i,DataDir},
- asn1config]++Opt),
- ?line ok = asn1ct:compile(DataDir ++ "MEDIA-GATEWAY-CONTROL.asn",
- [Rule,{outdir,OutDir},{i,DataDir},
- asn1config]++Opt),
- ?line ok = asn1ct:compile(DataDir ++ "P-Record",
- [Rule,{outdir,OutDir},{i,DataDir},
- asn1config]++Opt);
-compile(_,Rule,_) ->
- {skip,lists:concat(["not implemented yet for version: ",Rule])}.
-
-test(ber_bin_v2,Config) ->
+test(Config) ->
FMsg = msg('F'),
?line {ok,Bytes} = asn1_wrapper:encode('PartialDecSeq','F',FMsg),
?line {ok,_} = asn1_wrapper:decode('PartialDecSeq','F',Bytes),
@@ -110,9 +81,7 @@ test(ber_bin_v2,Config) ->
%% test of MEDIA-GATEWAY-CONTROL
test_megaco(Config),
- ok;
-test(Erule,_) ->
- {skip,lists:concat(["not implemented yet for version: ",Erule])}.
+ ok.
test_megaco(Config) ->
?line DataDir = ?config(data_dir,Config),
diff --git a/lib/asn1/test/test_selective_decode.erl b/lib/asn1/test/test_selective_decode.erl
index e1e101b622..bb348611da 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -19,12 +19,12 @@
%%
-module(test_selective_decode).
--export([test/2]).
+-export([test/0]).
-include_lib("test_server/include/test_server.hrl").
-test(ber_bin_v2,_Config) ->
+test() ->
FMsg = msg('F'),
?line {ok,Bytes} = asn1_wrapper:encode('PartialDecSeq','F',FMsg),
?line {ok,3} =
@@ -48,10 +48,7 @@ test(ber_bin_v2,_Config) ->
?line {ok,Bytes4} = asn1_wrapper:encode('P-Record','PersonnelRecord',
PRecMsg),
?line {ok,_} = 'P-Record':sel_dec(list_to_binary(Bytes4)),
-
- ok;
-test(Erule,_) ->
- {skip,lists:concat(["not implemented yet for version: ",Erule])}.
+ ok.
diff --git a/lib/asn1/test/test_special_decode_performance.erl b/lib/asn1/test/test_special_decode_performance.erl
index 60a95a3675..4ac0ff2b27 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -19,25 +19,10 @@
%%
-module(test_special_decode_performance).
--export([compile/2,go/1,loop2/4,loop1/5]).
+-export([go/1,loop2/4,loop1/5]).
-include_lib("test_server/include/test_server.hrl").
-
-compile(Config,Rule) when Rule==ber_bin_v2 ->
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line asn1ct:compile(DataDir++"MEDIA-GATEWAY-CONTROL",
- [ber_bin,optimize,asn1config,{outdir,OutDir},
- {i,DataDir}]),
- ?line asn1ct:compile(DataDir++"PartialDecSeq",
- [ber_bin,optimize,asn1config,{outdir,OutDir},
- {i,DataDir}]);
-compile(_,Rule) ->
- {skip,lists:concat(["not implemented yet for version: ",Rule])}.
-
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'),
diff --git a/lib/asn1/test/test_undecoded_rest.erl b/lib/asn1/test/test_undecoded_rest.erl
index 647fe2bb1c..36fd26ed59 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -19,47 +19,35 @@
%%
-module(test_undecoded_rest).
--export([compile/3,test/1]).
+-export([test/2]).
-include_lib("test_server/include/test_server.hrl").
%% testing OTP-5104
-compile(Config,Rules,Opt) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
-
- ?line ok = asn1ct:compile(DataDir ++ "P-Record",[Rules,{outdir,OutDir}]++Opt).
-
-
-test(Opt) ->
- ?line {ok,Msg} = asn1ct:value('P-Record','PersonnelRecord'),
- ?line {ok,Bytes} = asn1_wrapper:encode('P-Record','PersonnelRecord',Msg),
- Bytes2 =
- fun(B) when is_list(B) ->
- B ++ [55,55,55];
- (B) when is_binary(B) ->
- iolist_to_binary([B,<<55,55,55>>])
- end (Bytes),
-
+test(Opt, Config) ->
+ {ok, Msg} = asn1ct:value('P-Record', 'PersonnelRecord',
+ [{i, ?config(case_dir, Config)}]),
+ {ok, Bytes} = asn1_wrapper:encode('P-Record', 'PersonnelRecord', Msg),
+ Bytes2 = if is_list(Bytes) ->
+ Bytes ++ [55, 55, 55];
+ is_binary(Bytes) ->
+ iolist_to_binary([Bytes, <<55, 55, 55>>])
+ end,
case Opt of
- undec_rest ->
- ?line {ok,Msg,R}=asn1_wrapper:decode('P-Record','PersonnelRecord',
- Bytes2),
- ?line case R of
- <<55,55,55>> ->ok;
- [55,55,55] -> ok;
- BStr when is_bitstring(BStr) ->
- PadLen = (8 - (bit_size(BStr) rem 8)) rem 8,
- case <<0:PadLen,BStr/bitstring>> of
- <<0,55,55,55>> -> ok
- end
- end;
- _ ->
- ?line {ok,Msg} = asn1_wrapper:decode('P-Record','PersonnelRecord',
- Bytes2)
+ undec_rest ->
+ {ok, Msg, R} = asn1_wrapper:decode('P-Record', 'PersonnelRecord',
+ Bytes2),
+ case R of
+ <<55, 55, 55>> -> ok;
+ [55, 55, 55] -> ok;
+ BStr when is_bitstring(BStr) ->
+ PadLen = (8 - (bit_size(BStr) rem 8)) rem 8,
+ <<0, 55, 55, 55>> = <<0:PadLen, BStr/bitstring>>
+ end;
+ _ ->
+ {ok, Msg} = asn1_wrapper:decode('P-Record', 'PersonnelRecord',
+ Bytes2)
end,
ok.
diff --git a/lib/asn1/test/test_x691.erl b/lib/asn1/test/test_x691.erl
index bc8a3495d8..dcfa211d80 100644
--- a/lib/asn1/test/test_x691.erl
+++ b/lib/asn1/test/test_x691.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -19,25 +19,10 @@
%%
-module(test_x691).
--export([compile/3]).
-export([cases/2]).
-include_lib("test_server/include/test_server.hrl").
-
-compile(Config,Rules,Option) ->
-
- ?line DataDir = ?config(data_dir,Config),
- ?line OutDir = ?config(priv_dir,Config),
- ?line true = code:add_patha(?config(priv_dir,Config)),
- ?line ok = asn1ct:compile(DataDir ++ "P-RecordA1",
- [Rules, {outdir,OutDir}]++Option),
- ?line ok = asn1ct:compile(DataDir ++ "P-RecordA2",
- [Rules, {outdir,OutDir}]++Option),
- ?line ok = asn1ct:compile(DataDir ++ "P-RecordA3",
- [Rules, {outdir,OutDir}]++Option).
-
-
cases(Erule,Variant) ->
MsgA1 = a1(),
?line {ok,B1} = asn1_wrapper:encode('P-RecordA1','PersonnelRecord',MsgA1),
diff --git a/lib/asn1/vsn.mk b/lib/asn1/vsn.mk
index ae92fcb11b..81288496e9 100644
--- a/lib/asn1/vsn.mk
+++ b/lib/asn1/vsn.mk
@@ -1,2 +1,2 @@
-#next version number to use is 1.6.15 | 1.7 | 2.0
-ASN1_VSN = 1.6.19
+#next version number to use is 2.0
+ASN1_VSN = 1.8
diff --git a/lib/common_test/doc/src/Makefile b/lib/common_test/doc/src/Makefile
index d9651f13b0..99161ce68a 100644
--- a/lib/common_test/doc/src/Makefile
+++ b/lib/common_test/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2011. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -46,7 +46,8 @@ CT_MODULES = \
ct_rpc \
ct_snmp \
unix_telnet \
- ct_slave
+ ct_slave \
+ ct_netconfc
CT_XML_FILES = $(CT_MODULES:=.xml)
@@ -123,7 +124,7 @@ $(HTMLDIR)/%.gif: %.gif
docs: pdf html man
-$(CT_XML_FILES):
+$(CT_XML_FILES): %.xml: ../../src/%.erl
escript $(DOCGEN)/priv/bin/xml_from_edoc.escript -preprocess true -i $(XMERL_DIR)/include \
-i ../../../test_server/include -i ../../include \
-i ../../../../erts/lib/kernel/include -i ../../../../lib/kernel/include \
@@ -158,18 +159,18 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man1
- $(INSTALL_DATA) $(MAN1DIR)/* $(RELEASE_PATH)/man/man1
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man6
- $(INSTALL_DATA) $(MAN6DIR)/* $(RELEASE_PATH)/man/man6
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man1"
+ $(INSTALL_DATA) $(MAN1DIR)/* "$(RELEASE_PATH)/man/man1"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man6"
+ $(INSTALL_DATA) $(MAN6DIR)/* "$(RELEASE_PATH)/man/man6"
release_spec:
diff --git a/lib/common_test/doc/src/basics_chapter.xml b/lib/common_test/doc/src/basics_chapter.xml
index 20141d2561..ff6ea6c557 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>2009</year>
+ <year>2003</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -141,8 +141,9 @@
individual test case.
</p>
<p>
- The test suite module must conform to a callback interface specified
- by the CT test server. See the
+ The test suite module must conform to a
+ <seealso marker="common_test">callback interface</seealso>
+ specified by the CT test server. See the
<seealso marker="write_test_chapter#intro">Writing Test Suites</seealso> chapter
for more information.
</p>
diff --git a/lib/common_test/doc/src/common_test_app.xml b/lib/common_test/doc/src/common_test_app.xml
index c7f6c7ce5c..b6d4a633cb 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>2011</year>
+ <year>2003</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -99,11 +99,11 @@
be executed by Common Test. A test case is represented by an atom,
the name of the test case function. A test case group is
represented by a <c>group</c> tuple, where <c>GroupName</c>,
- an atom, is the name of the group (defined in <c>groups/0</c>).
+ an atom, is the name of the group (defined in <c><seealso marker="#Module:groups-0">groups/0</seealso></c>).
Execution properties for groups may also be specified, both
for a top level group and for any of its sub-groups.
Group execution properties specified here, will override
- properties in the group definition (see <c>groups/0</c>).
+ properties in the group definition (see <c><seealso marker="#Module:groups-0">groups/0</seealso></c>).
(With value <c>default</c>, the group definition properties
will be used).</p>
@@ -162,7 +162,7 @@
<v> Func = atom()</v>
<v> Args = list()</v>
<v> Fun = fun()</v>
- <v> Required = Key | {Key,SubKeys}</v>
+ <v> Required = Key | {Key,SubKeys} | {Key,SubKey} | {Key,SubKey,SubKeys}</v>
<v> Key = atom()</v>
<v> SubKeys = SubKey | [SubKey]</v>
<v> SubKey = atom()</v>
@@ -184,12 +184,16 @@
test cases in the suite).</p>
<p>The <c>timetrap</c> tag sets the maximum time each
- test case is allowed to execute (including <c>init_per_testcase/2</c>
- and <c>end_per_testcase/2</c>). If the timetrap time is
+ test case is allowed to execute (including <c><seealso marker="#Module:init_per_testcase-2">init_per_testcase/2</seealso></c>
+ and <c><seealso marker="#Module:end_per_testcase-2">end_per_testcase/2</seealso></c>). If the timetrap time is
exceeded, the test case fails with reason
- <c>timetrap_timeout</c>. If a <c>TimeFunc</c> function is specified,
- it will be called initially and must return a value on
- <c>TimeVal</c> format.</p>
+ <c>timetrap_timeout</c>. A <c>TimeFunc</c> function can be used to
+ set a new timetrap by returning a <c>TimeVal</c>. It may also be
+ used to trigger a timetrap timeout by, at some point, returning a
+ value other than a <c>TimeVal</c>. (See the
+ <seealso marker="write_test_chapter#timetraps">User's Guide</seealso>
+ for details).
+ </p>
<p>The <c>require</c> tag specifies configuration variables
that are required by test cases (and/or configuration functions)
@@ -197,11 +201,11 @@
in any of the configuration files, all test cases are skipped. For more
information about the 'require' functionality, see the
reference manual for the function
- <c>ct:require/[1,2]</c>.</p>
+ <c><seealso marker="ct#require-1">ct:require/1/2</seealso></c>.</p>
<p>With <c>userdata</c>, it is possible for the user to
specify arbitrary test suite related information which can be
- read by calling <c>ct:userdata/2</c>.</p>
+ read by calling <c><seealso marker="ct#userdata-2">ct:userdata/2</seealso></c>.</p>
<p>The <c>ct_hooks</c> tag specifies which
<seealso marker="ct_hooks_chapter">Common Test Hooks</seealso>
@@ -260,7 +264,7 @@
<p>This function is called as the last test case in the
suite. It is meant to be used for cleaning up after
- <c>init_per_suite/1</c>.
+ <c><seealso marker="#Module:init_per_suite-1">init_per_suite/1</seealso></c>.
For information on <c>save_config</c>, please see
<seealso marker="dependencies_chapter#save_config">Dependencies
between Test Cases and Suites</seealso> in the User's Guide.</p>
@@ -285,7 +289,7 @@
<v> Func = atom()</v>
<v> Args = list()</v>
<v> Fun = fun()</v>
- <v> Required = Key | {Key,SubKeys}</v>
+ <v> Required = Key | {Key,SubKeys} | {Key,Subkey} | {Key,Subkey,SubKeys}</v>
<v> Key = atom()</v>
<v> SubKeys = SubKey | [SubKey]</v>
<v> SubKey = atom()</v>
@@ -305,17 +309,21 @@
<p>This is the test case group info function. It is supposed to
return a list of tagged tuples that specify various properties
related to the execution of a test case group (i.e. its test cases
- and sub-groups). Properties set by <c>groups/1</c> override
+ and sub-groups). Properties set by
+ <c><seealso marker="#Module:group-1">group/1</seealso></c> override
properties with the same key that have been previously set by
- <c>suite/0</c>.</p>
+ <c><seealso marker="#Module:suite-0">suite/0</seealso></c>.</p>
<p>The <c>timetrap</c> tag sets the maximum time each
- test case is allowed to execute (including <c>init_per_testcase/2</c>
- and <c>end_per_testcase/2</c>). If the timetrap time is
+ test case is allowed to execute (including <c><seealso marker="#Module:init_per_testcase-2">init_per_testcase/2</seealso></c>
+ and <c><seealso marker="#Module:end_per_testcase-2">end_per_testcase/2</seealso></c>). If the timetrap time is
exceeded, the test case fails with reason
- <c>timetrap_timeout</c>. If a <c>TimeFunc</c> function is specified,
- it will be called initially and must return a value on
- <c>TimeVal</c> format.</p>
+ <c>timetrap_timeout</c>. A <c>TimeFunc</c> function can be used to
+ set a new timetrap by returning a <c>TimeVal</c>. It may also be
+ used to trigger a timetrap timeout by, at some point, returning a
+ value other than a <c>TimeVal</c>. (See the
+ <seealso marker="write_test_chapter#timetraps">User's Guide</seealso>
+ for details).</p>
<p>The <c>require</c> tag specifies configuration variables
that are required by test cases (and/or configuration functions)
@@ -323,11 +331,11 @@
in any of the configuration files, all test cases in this group are skipped.
For more information about the 'require' functionality, see the
reference manual for the function
- <c>ct:require/[1,2]</c>.</p>
+ <c><seealso marker="ct#require-1">ct:require/1/2</seealso></c>.</p>
<p>With <c>userdata</c>, it is possible for the user to
specify arbitrary test case group related information which can be
- read by calling <c>ct:userdata/2</c>.</p>
+ read by calling <c><seealso marker="ct#userdata-2">ct:userdata/2</seealso></c>.</p>
<p>The <c>ct_hooks</c> tag specifies which
<seealso marker="ct_hooks_chapter">Common Test Hooks</seealso>
@@ -360,7 +368,7 @@
test case group. It typically contains initializations which are
common for all test cases and sub-groups in the group, and which
shall only be performed once. <c>GroupName</c> is the name of the
- group, as specified in the group definition (see <c>groups/0</c>). The
+ group, as specified in the group definition (see <c><seealso marker="#Module:groups-0">groups/0</seealso></c>). The
<c>Config</c> parameter is the configuration data which can be modified
here. The return value of this function is given as <c>Config</c>
to all test cases and sub-groups in the group. If <c>{skip,Reason}</c>
@@ -389,10 +397,10 @@
<p> OPTIONAL </p>
<p>This function is called after the execution of a test case group is finished.
- It is meant to be used for cleaning up after <c>init_per_group/2</c>.
+ It is meant to be used for cleaning up after <c><seealso marker="#Module:init_per_group-2">init_per_group/2</seealso></c>.
By means of <c>{return_group_result,Status}</c>, it is possible to return a
status value for a nested sub-group. The status can be retrieved in
- <c>end_per_group/2</c> for the group on the level above. The status will also
+ <c><seealso marker="#Module:end_per_group-2">end_per_group/2</seealso></c> for the group on the level above. The status will also
be used by Common Test for deciding if execution of a group should proceed in
case the property <c>sequence</c> or <c>repeat_until_*</c> is set.</p>
@@ -443,7 +451,7 @@
<p> OPTIONAL </p>
<p> This function is called after each test case, and can be used
- to clean up after <c>init_per_testcase/2</c> and the test case.
+ to clean up after <c><seealso marker="#Module:init_per_testcase-2">init_per_testcase/2</seealso></c> and the test case.
Any return value (besides <c>{fail,Reason}</c> and <c>{save_config,SaveConfig}</c>)
is ignored. By returning <c>{fail,Reason}</c>, <c>TestCase</c> will be marked as
failed (even though it was actually successful in the sense that it returned
@@ -469,7 +477,7 @@
<v> Func = atom()</v>
<v> Args = list()</v>
<v> Fun = fun()</v>
- <v> Required = Key | {Key,SubKeys}</v>
+ <v> Required = Key | {Key,SubKeys} | {Key,Subkey} | {Key,Subkey,SubKeys}</v>
<v> Key = atom()</v>
<v> SubKeys = SubKey | [SubKey]</v>
<v> SubKey = atom()</v>
@@ -485,18 +493,21 @@
<p>This is the test case info function. It is supposed to
return a list of tagged tuples that specify various properties
related to the execution of this particular test case.
- Properties set by <c>Testcase/0</c> override
+ Properties set by <c><seealso marker="#Module:Testcase-0">Testcase/0</seealso></c> override
properties that have been previously set for the test case
- by <c>group/1</c> or <c>suite/0</c>.</p>
+ by <c><seealso marker="#Module:group-1">group/1</seealso></c> or <c><seealso marker="#Module:suite-0">suite/0</seealso></c>.</p>
<p>The <c>timetrap</c> tag sets the maximum time the
test case is allowed to execute. If the timetrap time is
exceeded, the test case fails with reason
- <c>timetrap_timeout</c>. <c>init_per_testcase/2</c>
- and <c>end_per_testcase/2</c> are included in the
- timetrap time. If a <c>TimeFunc</c> function is specified,
- it will be called before the test case (or <c>init_per_testcase/2</c>)
- and must return a value on <c>TimeVal</c> format.</p>
+ <c>timetrap_timeout</c>. <c><seealso marker="#Module:init_per_testcase-2">init_per_testcase/2</seealso></c>
+ and <c><seealso marker="#Module:end_per_testcase-2">end_per_testcase/2</seealso></c> are included in the
+ timetrap time. A <c>TimeFunc</c> function can be used to
+ set a new timetrap by returning a <c>TimeVal</c>. It may also be
+ used to trigger a timetrap timeout by, at some point, returning a
+ value other than a <c>TimeVal</c>. (See the
+ <seealso marker="write_test_chapter#timetraps">User's Guide</seealso>
+ for details).</p>
<p>The <c>require</c> tag specifies configuration variables
that are required by the test case (and/or <c>init/end_per_testcase/2</c>).
@@ -504,15 +515,15 @@
configuration files, the test case is skipped. For more
information about the 'require' functionality, see the
reference manual for the function
- <c>ct:require/[1,2]</c>.</p>
+ <c><seealso marker="ct#require-1">ct:require/1/2</seealso></c>.</p>
<p>If <c>timetrap</c> and/or <c>require</c> is not set, the
- default values specified by <c>suite/0</c> (or
- <c>group/1</c>) will be used.</p>
+ default values specified by <c><seealso marker="#Module:suite-0">suite/0</seealso></c> (or
+ <c><seealso marker="#Module:group-1">group/1</seealso></c>) will be used.</p>
<p>With <c>userdata</c>, it is possible for the user to
specify arbitrary test case related information which can be
- read by calling <c>ct:userdata/3</c>.</p>
+ read by calling <c><seealso marker="ct#userdata-3">ct:userdata/3</seealso></c>.</p>
<p>Other tuples than the ones defined will simply be ignored.</p>
@@ -540,7 +551,7 @@
<p>This is the implementation of a test case. Here you must
call the functions you want to test, and do whatever you
need to check the result. If something fails, make sure the
- function causes a runtime error, or call <c>ct:fail/1/2</c>
+ function causes a runtime error, or call <c><seealso marker="ct#fail-1">ct:fail/1/2</seealso></c>
(which also causes the test case process to terminate).</p>
<p>Elements from the <c>Config</c> list can e.g. be read
diff --git a/lib/common_test/doc/src/config_file_chapter.xml b/lib/common_test/doc/src/config_file_chapter.xml
index 6a860bb58b..d90adf8d7b 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,6 +29,8 @@
<file>config_file_chapter.xml</file>
</header>
+ <marker id="top"></marker>
+
<section>
<title>General</title>
@@ -78,7 +80,7 @@
test is skipped (unless a default value has been specified, see the
<seealso marker="write_test_chapter#info_function">test case info
function</seealso> chapter for details). There is also a function
- <c>ct:require/[1,2]</c> which can be called from a test case
+ <c><seealso marker="ct#require-1">ct:require/1/2</seealso></c> which can be called from a test case
in order to check if a specific variable is available. The return
value from this function must be checked explicitly and appropriate
action be taken depending on the result (e.g. to skip the test case
@@ -88,7 +90,7 @@
info-list should look like this:
<c>{require,CfgVarName}</c> or <c>{require,AliasName,CfgVarName}</c>.
The arguments <c>AliasName</c> and <c>CfgVarName</c> are the same as the
- arguments to <c>ct:require/[1,2]</c> which are described in the
+ arguments to <c><seealso marker="ct#require-1">ct:require/1/2</seealso></c> which are described in the
reference manual for <seealso marker="ct">ct</seealso>.
<c>AliasName</c> becomes an alias for the configuration variable,
and can be used as reference to the configuration data value.
@@ -101,7 +103,8 @@
(or test case) and improve readability.</item>
</list>
<p>To read the value of a config variable, use the function
- <c>get_config/[1,2,3]</c> which is also described in the reference
+ <c><seealso marker="ct#get_config-1">get_config/1/2/3</seealso></c>
+ which is also described in the reference
manual for <seealso marker="ct">ct</seealso>.</p>
<p>Example:</p>
<pre>
@@ -118,7 +121,7 @@
<section>
<title>Using configuration variables defined in multiple files</title>
<p>If a configuration variable is defined in multiple files and you
- want to access all possible values, you may use the <c>ct:get_config/3</c>
+ want to access all possible values, you may use the <c><seealso marker="ct#get_config-3">ct:get_config/3</seealso></c>
function and specify <c>all</c> in the options list. The values will then
be returned in a list and the order of the elements corresponds to the order
that the config files were specified at startup. Please see
@@ -130,7 +133,7 @@
<marker id="encrypted_config_files"></marker>
<p>It is possible to encrypt configuration files containing sensitive data
if these files must be stored in open and shared directories.</p>
- <p>Call <c>ct:encrypt_config_file/[2,3]</c> to have Common Test encrypt a
+ <p>Call <c><seealso marker="ct#encrypt_config_file-2">ct:encrypt_config_file/2/3</seealso></c> to have Common Test encrypt a
specified file using the DES3 function in the OTP <c>crypto</c> application.
The encrypted file can then be used as a regular configuration file,
in combination with other encrypted files or normal text files. The key
@@ -139,7 +142,7 @@
<c>decrypt_file</c> flag/option, or a key file in a predefined location.</p>
<p>Common Test also provides decryption functions,
- <c>ct:decrypt_config_file/[2,3]</c>, for recreating the original text
+ <c><seealso marker="ct#decrypt_config_file-2">ct:decrypt_config_file/2/3</seealso></c>, for recreating the original text
files.</p>
<p>Please see the <seealso marker="ct">ct</seealso> reference manual for
@@ -149,8 +152,8 @@
<section>
<title>Opening connections by using configuration data</title>
<p>There are two different methods for opening a connection
- by means of the support functions in e.g. <c>ct_ssh</c>, <c>ct_ftp</c>,
- and <c>ct_telnet</c>:</p>
+ by means of the support functions in e.g. <c><seealso marker="ct_ssh">ct_ssh</seealso></c>, <c><seealso marker="ct_ftp">ct_ftp</seealso></c>,
+ and <c><seealso marker="ct_telnet">ct_telnet</seealso></c>:</p>
<list>
<item>Using a configuration target name (an alias) as reference.</item>
<item>Using the configuration variable as reference.</item>
@@ -295,7 +298,7 @@
<pre>
[{ftp_host, [{ftp, "targethost"}, {username, "tester"}, {password, "letmein"}]},
- {lm_directory, "/test/loadmodules"}]</pre>
+ {lm_directory, "/test/loadmodules"}]</pre>
</section>
diff --git a/lib/common_test/doc/src/cover_chapter.xml b/lib/common_test/doc/src/cover_chapter.xml
index b7162cb542..803a71de07 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>2011</year>
+ <year>2006</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -100,7 +100,7 @@
<p><c>$ ct_run -dir $TESTOBJS/db -cover $TESTOBJS/db/config/db.coverspec</c></p>
<p>You may also pass the cover specification file name in a
- call to <c>ct:run_test/1</c>, by adding a <c>{cover,CoverSpec}</c>
+ call to <c><seealso marker="ct#run_test-1">ct:run_test/1</seealso></c>, by adding a <c>{cover,CoverSpec}</c>
tuple to the <c>Opts</c> argument. Also, you can of course
enable code coverage in your test specifications (read
more in the chapter about
diff --git a/lib/common_test/doc/src/ct_hooks.xml b/lib/common_test/doc/src/ct_hooks.xml
index b98c04a850..b3e713c77f 100644
--- a/lib/common_test/doc/src/ct_hooks.xml
+++ b/lib/common_test/doc/src/ct_hooks.xml
@@ -5,7 +5,7 @@
<erlref>
<header>
<copyright>
- <year>2010</year><year>2011</year>
+ <year>2010</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -111,11 +111,12 @@
</func>
<func>
- <name>Module:pre_init_per_suite(SuiteName, Config, CTHState) -&gt;
+ <name>Module:pre_init_per_suite(SuiteName, InitData, CTHState) -&gt;
Result</name>
<fsummary>Called before init_per_suite</fsummary>
<type>
<v>SuiteName = atom()</v>
+ <v>InitData = Config | SkipOrFail</v>
<v>Config = NewConfig = [{Key,Value}]</v>
<v>CTHState = NewCTHState = term()</v>
<v>Result = {Return, NewCTHState}</v>
@@ -140,7 +141,8 @@
<p><c>SuiteName</c> is the name of the suite to be run.</p>
- <p><c>Config</c> is the original config list of the test suite.</p>
+ <p><c>InitData</c> is the original config list of the test suite, or
+ a <c>SkipOrFail</c> tuple if a previous CTH has returned this.</p>
<p><c>CTHState</c> is the current internal state of the CTH.</p>
@@ -212,11 +214,12 @@
</func>
<func>
- <name>Module:pre_init_per_group(GroupName, Config, CTHState) -&gt;
+ <name>Module:pre_init_per_group(GroupName, InitData, CTHState) -&gt;
Result</name>
<fsummary>Called before init_per_group</fsummary>
<type>
<v>GroupName = atom()</v>
+ <v>InitData = Config | SkipOrFail</v>
<v>Config = NewConfig = [{Key,Value}]</v>
<v>CTHState = NewCTHState = term()</v>
<v>Result = {NewConfig | SkipOrFail, NewCTHState}</v>
@@ -269,11 +272,12 @@
</func>
<func>
- <name>Module:pre_init_per_testcase(TestcaseName, Config, CTHState) -&gt;
+ <name>Module:pre_init_per_testcase(TestcaseName, InitData, CTHState) -&gt;
Result</name>
<fsummary>Called before init_per_testcase</fsummary>
<type>
<v>TestcaseName = atom()</v>
+ <v>InitData = Config | SkipOrFail</v>
<v>Config = NewConfig = [{Key,Value}]</v>
<v>CTHState = NewCTHState = term()</v>
<v>Result = {NewConfig | SkipOrFail, NewCTHState}</v>
@@ -330,11 +334,12 @@
</func>
<func>
- <name>Module:pre_end_per_group(GroupName, Config, CTHState) -&gt;
+ <name>Module:pre_end_per_group(GroupName, EndData, CTHState) -&gt;
Result</name>
<fsummary>Called before end_per_group</fsummary>
<type>
<v>GroupName = atom()</v>
+ <v>EndData = Config | SkipOrFail</v>
<v>Config = NewConfig = [{Key,Value}]</v>
<v>CTHState = NewCTHState = term()</v>
<v>Result = {NewConfig | SkipOrFail, NewCTHState}</v>
@@ -387,11 +392,12 @@
</func>
<func>
- <name>Module:pre_end_per_suite(SuiteName, Config, CTHState) -&gt;
+ <name>Module:pre_end_per_suite(SuiteName, EndData, CTHState) -&gt;
Result</name>
<fsummary>Called before end_per_suite</fsummary>
<type>
<v>SuiteName = atom()</v>
+ <v>EndData = Config | SkipOrFail</v>
<v>Config = NewConfig = [{Key,Value}]</v>
<v>CTHState = NewCTHState = term()</v>
<v>Result = {NewConfig | SkipOrFail, NewCTHState}</v>
diff --git a/lib/common_test/doc/src/ct_hooks_chapter.xml b/lib/common_test/doc/src/ct_hooks_chapter.xml
index 8505ee8469..86237f5fc1 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>2011</year>
+ <year>2011</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -189,6 +189,22 @@
it.</p>
</section>
+ <section>
+ <title>External configuration data and Logging</title>
+ <p>It's possible in the CTH to read configuration data values
+ by calling <c><seealso marker="ct#get_config-1">ct:get_config/1/2/3</seealso></c> (as explained in the
+ <seealso marker="config_file_chapter#require_config_data">
+ External configuration data</seealso>
+ chapter). The config variables in question must, as always, first have been
+ <c>required</c> by means of a suite-, group-, or test case info function,
+ or the <c><seealso marker="ct#require-1">ct:require/1/2</seealso></c> function. Note that the latter can also be used
+ in CT hook functions.</p>
+ <p>The CT hook functions may call any of the logging functions available
+ in the <c>ct</c> interface to print information to the log files, or to
+ add comments in the suite overview page.
+ </p>
+ </section>
+
</section>
<marker id="manipulating"/>
@@ -201,11 +217,13 @@
functions for a CTH follow a common interface, this interface is
described below.</p>
- <p>It is only possible to hook into test function which exists in the test
- suite. So in order for a CTH to hook in before
- <seealso marker="common_test#Module:init_per_suite-1">init_per_suite</seealso>,
- the <seealso marker="common_test#Module:init_per_suite-1">init_per_suite</seealso>
- function must exist in the test suite.</p>
+ <p>Common Test will always call all available hook functions, even pre- and post
+ hooks for configuration functions that are not implemented in the suite.
+ For example, <c>pre_init_per_suite(x_SUITE, ...)</c> and
+ <c>post_init_per_suite(x_SUITE, ...)</c> will be called for test suite
+ <c>x_SUITE</c>, even if it doesn't export <c>init_per_suite/1</c>. This feature
+ makes it possible to use hooks as configuration fallbacks, or even
+ completely replace all configuration functions with hook functions.</p>
<marker id="pre"/>
<section>
@@ -234,6 +252,13 @@
{ok, Handle} -&gt;
{[{db_handle, Handle} | Config], CTHState#state{ handle = Handle }}
end.</code>
+ <note>If using multiple CTHs, the first part of the return tuple will be
+ used as input for the next CTH. So in the case above the next CTH might
+ get <c>{fail,Reason}</c> as the second parameter. If you have many CTHs
+ which interact, it might be a good idea to not let each CTH return
+ <c>fail</c> or <c>skip</c>. Instead return that an action should be taken
+ through the <c>Config</c> list and implement a CTH which at the end takes
+ the correct action. </note>
</section>
@@ -429,6 +454,16 @@ terminate(State) ->
<seealso marker="sasl:sasl_app">SASL</seealso> events report
using the normal SASL mechanisms. </cell>
</row>
+ <row>
+ <cell>cth_surefire</cell>
+ <cell>no</cell>
+ <cell>Captures all test results and outputs them as surefire XML into
+ a file. The file which is created is by default called junit_report.xml.
+ The name can be by setting the path option for this hook. e.g.
+ <code>-ct_hooks cth_surefire [{path,"/tmp/report.xml"}]</code>
+ Surefire XML can forinstance be used by Jenkins to display test
+ results.</cell>
+ </row>
</table>
</section>
diff --git a/lib/common_test/doc/src/ct_master_chapter.xml b/lib/common_test/doc/src/ct_master_chapter.xml
index f4f0ecad62..9e848e99bb 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>2010</year>
+ <year>2006</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -124,7 +124,8 @@
<p><c>NodeRef = NodeAlias | node() | master</c></p>
<p>A <c>NodeAlias</c> (<c>atom()</c>) is used in a test specification as a
- reference to a node name (so the actual node name only needs to be declared once).
+ reference to a node name (so the actual node name only needs to be declared once,
+ which can of course also be achieved using constants).
The alias is declared with a <c>node</c> term:</p>
<p><c>{node, NodeAlias, NodeName}</c></p>
@@ -141,30 +142,32 @@
CT Master:</p>
<pre>
- {node, node1, ct_node@host_x}.
- {node, node2, ct_node@host_y}.
-
- {logdir, master, "/home/test/master_logs"}.
- {logdir, "/home/test/logs"}.
+ {define, 'Top', "/home/test"}.
+ {define, 'T1', "'Top'/t1"}.
+ {define, 'T2', "'Top'/t2"}.
+ {define, 'T3', "'Top'/t3"}.
+ {define, 'CfgFile', "config.cfg"}.
+ {define, 'Node', ct_node}.
+
+ {node, node1, 'Node@host_x'}.
+ {node, node2, 'Node@host_y'}.
+
+ {logdir, master, "'Top'/master_logs"}.
+ {logdir, "'Top'/logs"}.
- {config, node1, "/home/test/t1/cfg/config.cfg"}.
- {config, node2, "/home/test/t2/cfg/config.cfg"}.
- {config, "/home/test/t3/cfg/config.cfg"}.
+ {config, node1, "'T1'/'CfgFile'"}.
+ {config, node2, "'T2'/'CfgFile'"}.
+ {config, "'T3'/'CfgFile'"}.
- {alias, t1, "/home/test/t1"}.
- {alias, t2, "/home/test/t2"}.
- {alias, t3, "/home/test/t3"}.
+ {suites, node1, 'T1', all}.
+ {skip_suites, node1, 'T1', [t1B_SUITE,t1D_SUITE], "Not implemented"}.
+ {skip_cases, node1, 'T1', t1A_SUITE, [test3,test4], "Irrelevant"}.
+ {skip_cases, node1, 'T1', t1C_SUITE, [test1], "Ignore"}.
- {suites, node1, t1, all}.
- {skip_suites, node1, t1, [t1B_SUITE,t1D_SUITE], "Not implemented"}.
- {skip_cases, node1, t1, t1A_SUITE, [test3,test4], "Irrelevant"}.
- {skip_cases, node1, t1, t1C_SUITE, [test1], "Ignore"}.
+ {suites, node2, 'T2', [t2B_SUITE,t2C_SUITE]}.
+ {cases, node2, 'T2', t2A_SUITE, [test4,test1,test7]}.
- {suites, node2, t2, [t2B_SUITE,t2C_SUITE]}.
- {cases, node2, t2, t2A_SUITE, [test4,test1,test7]}.
-
- {skip_suites, t3, all, "Not implemented"}.
- </pre>
+ {skip_suites, 'T3', all, "Not implemented"}.</pre>
<p>This example specifies the same tests as the original example. But
now if started with a call to <c>ct_master:run(TestSpecName)</c>, the
@@ -190,10 +193,6 @@
name as the Common Test node in question (typically <c>ct@somehost</c> if started
with the <c>ct_run</c> program), will be performed. Tests without explicit
node association will always be performed too of course!</p>
-
- <note><p>It is recommended that absolute paths are used for log directories,
- config files and test directory aliases in the test specifications so that
- current working directory settings are not important.</p></note>
</section>
<section>
diff --git a/lib/common_test/doc/src/ct_run.xml b/lib/common_test/doc/src/ct_run.xml
index b01ab3667d..9cc5495af7 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>2011</year>
+ <year>2007</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -36,6 +36,8 @@
OS command line.
</comsummary>
+ <marker id="top"></marker>
+
<description>
<p>The <c>ct_run</c> program is automatically installed with Erlang/OTP
and Common Test (please see the Installation chapter in the Common
@@ -46,7 +48,7 @@
particular mode.</p>
<p>There is an interface function that corresponds to this program,
- called <c>ct:run_test/1</c>, for starting Common Test from the Erlang
+ called <c><seealso marker="ct#run_test-1">ct:run_test/1</seealso></c>, for starting Common Test from the Erlang
shell (or an Erlang program). Please see the <c>ct</c> man page for
details.</p>
@@ -72,6 +74,10 @@
following <c>-erl_args</c> on the command line. These directories are added
to the code path normally (i.e. on specified form)</p>
+ <p>Exit status is set before the program ends. Value <c>0</c> indicates a successful
+ test result, <c>1</c> indicates one or more failed or auto-skipped test cases, and
+ <c>2</c> indicates test execution failure.</p>
+
<p>If <c>ct_run</c> is called with option:</p>
<pre>-help</pre>
<p>it prints all valid start flags to stdout.</p>
@@ -88,11 +94,13 @@
[-step [config | keep_inactive]]
[-config ConfigFile1 ConfigFile2 .. ConfigFileN]
[-userconfig CallbackModule1 ConfigString1 and CallbackModule2
- ConfigString2 and .. and CallbackModuleN ConfigStringN]
+ ConfigString2 and .. CallbackModuleN ConfigStringN]
[-decrypt_key Key] | [-decrypt_file KeyFile]
[-label Label]
[-logdir LogDir]
[-logopts LogOpts]
+ [-verbosity GenVLevel | [Category1 VLevel1 and
+ Category2 VLevel2 and .. CategoryN VLevelN]]
[-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]
[-stylesheet CSSFile]
[-cover CoverCfgFile]
@@ -103,10 +111,15 @@
[-no_auto_compile]
[-muliply_timetraps Multiplier]
[-scale_timetraps]
+ [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]
[-repeat N [-force_stop]] |
[-duration HHMMSS [-force_stop]] |
[-until [YYMoMoDD]HHMMSS [-force_stop]]
- [-basic_html]</pre>
+ [-basic_html]
+ [-ct_hooks CTHModule1 CTHOpts1 and CTHModule2 CTHOpts2 and ..
+ CTHModuleN CTHOptsN]
+ [-exit_status ignore_config]
+ </pre>
</section>
<section>
<title>Run tests using test specification</title>
@@ -119,6 +132,8 @@
[-label Label]
[-logdir LogDir]
[-logopts LogOpts]
+ [-verbosity GenVLevel | [Category1 VLevel1 and
+ Category2 VLevel2 and .. CategoryN VLevelN]]
[-allow_user_terms]
[-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]
[-stylesheet CSSFile]
@@ -130,10 +145,15 @@
[-no_auto_compile]
[-muliply_timetraps Multiplier]
[-scale_timetraps]
+ [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]
[-repeat N [-force_stop]] |
[-duration HHMMSS [-force_stop]] |
[-until [YYMoMoDD]HHMMSS [-force_stop]]
- [-basic_html]</pre>
+ [-basic_html]
+ [-ct_hooks CTHModule1 CTHOpts1 and CTHModule2 CTHOpts2 and ..
+ CTHModuleN CTHOptsN]
+ [-exit_status ignore_config]
+ </pre>
</section>
<section>
<title>Run tests in web based GUI</title>
@@ -145,11 +165,14 @@
[-userconfig CallbackModule1 ConfigString1 and CallbackModule2
ConfigString2 and .. and CallbackModuleN ConfigStringN]
[-logopts LogOpts]
+ [-verbosity GenVLevel | [Category1 VLevel1 and
+ Category2 VLevel2 and .. CategoryN VLevelN]]
[-decrypt_key Key] | [-decrypt_file KeyFile]
[-include InclDir1 InclDir2 .. InclDirN]
[-no_auto_compile]
[-muliply_timetraps Multiplier]
[-scale_timetraps]
+ [-create_priv_dir auto_per_run | auto_per_tc | manual_per_tc]
[-basic_html]</pre>
</section>
<section>
diff --git a/lib/common_test/doc/src/event_handler_chapter.xml b/lib/common_test/doc/src/event_handler_chapter.xml
index a5886b9687..10a9b52d39 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>2011</year>
+ <year>2006</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -64,7 +64,7 @@
<marker id="usage"></marker>
<title>Usage</title>
<p>Event handlers may be installed by means of an <c>event_handler</c>
- start flag (<c>ct_run</c>) or option (<c>ct:run_test/1</c>), where the
+ start flag (<c>ct_run</c>) or option (<c><seealso marker="ct#run_test-1">ct:run_test/1</seealso></c>), where the
argument specifies the names of one or more event handler modules.
Example:</p>
<p><c>$ ct_run -suite test/my_SUITE -event_handler handlers/my_evh1
@@ -78,7 +78,7 @@
example).</p>
<p>An event_handler tuple in the argument <c>Opts</c> has the following
- definition (see also <c>ct:run_test/1</c> in the reference manual):</p>
+ definition (see also <c><seealso marker="ct#run_test-1">ct:run_test/1</seealso></c> in the reference manual):</p>
<pre>
{event_handler,EventHandlers}
@@ -205,7 +205,7 @@
{error,{RunTimeError,StackTrace}} |
{timetrap_timeout,integer()} |
{failed,{Suite,end_per_testcase,FailInfo}}</c>, reason for failure.</p>
- <p><c>RequireInfo = {not_available,atom()}</c>, why require has failed.</p>
+ <p><c>RequireInfo = {not_available,atom() | tuple()}</c>, why require has failed.</p>
<p><c>FailInfo = {timetrap_timeout,integer()} |
{RunTimeError,StackTrace} |
UserTerm</c>,
@@ -233,7 +233,7 @@
reason for auto skipping <c>Func</c>.</p>
<p><c>FailReason = {Suite,ConfigFunc,FailInfo}} |
{Suite,FailedCaseInSequence}</c>, reason for failure.</p>
- <p><c>RequireInfo = {not_available,atom()}</c>, why require has failed.</p>
+ <p><c>RequireInfo = {not_available,atom() | tuple()}</c>, why require has failed.</p>
<p><c>ConfigFunc = init_per_suite | init_per_group</c></p>
<p><c>FailInfo = {timetrap_timeout,integer()} |
{RunTimeError,StackTrace} |
@@ -308,7 +308,7 @@
manager can look like.</p>
<note><p>To ensure that printouts to standard out (or printouts made with
- <c>ct:log/2/3</c> or <c>ct:pal/2/3</c>) get written to the test case log
+ <c><seealso marker="ct#log-2">ct:log/2/3</seealso></c> or <c><seealso marker="ct:pal-2">ct:pal/2/3</seealso></c>) get written to the test case log
file, and not to the Common Test framework log, you can syncronize
with the Common Test server by matching on the <c>tc_start</c> and <c>tc_done</c>
events. In the period between these events, all IO gets directed to the
diff --git a/lib/common_test/doc/src/example_chapter.xml b/lib/common_test/doc/src/example_chapter.xml
index f269dba2cd..2333f92989 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>2010</year>
+ <year>2003</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -28,7 +28,8 @@
<rev></rev>
<file>example_chapter.xml</file>
</header>
-
+
+ <marker id="top"></marker>
<section>
<title>Test suite example</title>
diff --git a/lib/common_test/doc/src/getting_started_chapter.xml b/lib/common_test/doc/src/getting_started_chapter.xml
index 7de0912036..3cf04bb1a2 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>2010</year>
+ <year>2007</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -90,7 +90,7 @@
<p>As you can understand from the illustration above, Common Test requires
that a test case generates a runtime error to indicate failure (e.g.
by causing a bad match error or by calling <c>exit/1</c>, preferrably
- through the <c>ct:fail/1/2</c> help function). A succesful execution is
+ through the <c><seealso marker="ct#fail-1">ct:fail/1,2</seealso></c> help function). A succesful execution is
indicated by means of a normal return from the test case function.
</p>
</section>
@@ -98,7 +98,8 @@
<section>
<title>A simple test suite</title>
<p>As you've seen in the basics chapter, the test suite module implements
- callback functions (mandatory or optional) for various purposes, e.g:
+ <seealso marker="common_test">callback functions</seealso>
+ (mandatory or optional) for various purposes, e.g:
<list>
<item>Init/end configuration function for the test suite</item>
<item>Init/end configuration function for a test case</item>
@@ -197,7 +198,7 @@
<pre>
1> ct:run_test([{suite, "check_log_SUITE"}]).</pre>
<p>
- The result from running our test is printed in log files on HTML format
+ The result from running our test is printed in log files in HTML format
(stored in unique log directories on different level). This illustration
shows the log file structure:
</p>
@@ -213,11 +214,56 @@
<section>
<title>What happens next?</title>
- <p>
- You will find detailed information about the basics introduced here in this
- chapter in the following chapters in the User's Guide, as well as
- presentations of many more useful features. Have fun!
- </p>
+
+ <p>Well, you might already be asking yourself questions such as:</p>
+
+ <list>
+ <item>"How and where can I specify variable data for my tests that mustn't
+ be hard-coded in the test suites (such as host names, addresses,
+ user login data, etc)?" The
+ <seealso marker="config_file_chapter#top">External Configuration Data</seealso>
+ chapter will give you that information.
+ </item>
+ <item>"Is there a way to declare a number of different tests and run them
+ in one session without having to write my own scripts? And can such
+ declarations be used for regression testing?" The
+ <seealso marker="run_test_chapter#test_specifications">Test Specifications</seealso>
+ chapter answers these questions.
+ </item>
+ <item>"Can test cases and/or test runs be automatically repeated?" Learn more about
+ <seealso marker="write_test_chapter#test_case_groups">Test Case Groups</seealso>
+ and also read about start flags/options in the
+ <seealso marker="run_test_chapter#ct_run">Running Tests</seealso> chapter and
+ the Reference Manual.
+ </item>
+ <item>"Will Common Test execute my test cases in sequence or in parallel?" The
+ <seealso marker="write_test_chapter#test_case_groups">Test Case Groups</seealso>
+ section in the Running Tests chapter will give you the answer.
+ </item>
+ <item>"What's the syntax for timetraps (mentioned above), and how do I set them?"
+ This is explained in the
+ <seealso marker="write_test_chapter#timetraps">Timetrap Timeouts</seealso>
+ part of the Writing Test Suites chapter.
+ </item>
+ <item>"What functions are available for logging and printing?" Check the
+ <seealso marker="write_test_chapter#logging">Logging</seealso>
+ section in the Writing Test Suites chapter.
+ </item>
+ <item>"I need data files for my tests. Where do I store them preferrably?"
+ You should read about
+ <seealso marker="write_test_chapter#data_priv_dir">Data and Private
+ Directories</seealso> for information about this.
+ </item>
+ <item>"May I start with a test suite example, please?"
+ <seealso marker="example_chapter#top">Sure!</seealso>
+ </item>
+ </list>
+ <p>You will probably want to get started on your own first test suites now, while
+ at the same time digging deeper into the Common Test User's Guide and Reference Manual.
+ You will find that there's lots more to learn about the things that have been introduced
+ in this chapter. You will of course also be presented many more useful features, such as the
+ ones listed above. Have fun!
+ </p>
</section>
</chapter>
diff --git a/lib/common_test/doc/src/notes.xml b/lib/common_test/doc/src/notes.xml
index da0b6b2d65..abe8cb2041 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -32,6 +32,538 @@
<file>notes.xml</file>
</header>
+<section><title>Common_Test 1.6.2.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ The interactive mode (ct_run -shell) would not start
+ properly. This error has been fixed.</p>
+ <p>
+ Own Id: OTP-10414</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Common_Test 1.6.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ If a CT hook function caused a crash, this could in some
+ situations cause Common Test to terminate due to an
+ illegal IO operation. This error has been corrected.</p>
+ <p>
+ Own Id: OTP-10050 Aux Id: seq12039 </p>
+ </item>
+ <item>
+ <p>
+ The Common Test documentation states that timetraps are
+ never active during execution of CT hook functions. This
+ was only true for post hook functions, not for pre hook
+ functions. The code for CT hooks has been modified to
+ behave according to the documentation.</p>
+ <p>
+ Own Id: OTP-10069</p>
+ </item>
+ <item>
+ <p>
+ If a CT hook function would call the exit/1 or throw/1
+ BIF (possibly indirectly, e.g. as a result of a timeout
+ in gen_server:call/3), Common Test would hang. This
+ problem has been fixed.</p>
+ <p>
+ Own Id: OTP-10072 Aux Id: seq12053 </p>
+ </item>
+ <item>
+ <p>
+ The documentation has been updated with information about
+ how to deal with chaining of hooks which return
+ fail/skip.</p>
+ <p>
+ Own Id: OTP-10077 Aux Id: seq12048 </p>
+ </item>
+ <item>
+ <p>
+ When ct_hooks called the id/1 functions of multiple
+ hooks, it would reverse the order of the hooks and call
+ the proceeding init/2 calls in the wrong order. This has
+ been fixed.</p>
+ <p>
+ Own Id: OTP-10135</p>
+ </item>
+ <item>
+ <p>
+ The surefire hook now correctly handles autoskipped
+ initialization and test functions.</p>
+ <p>
+ Own Id: OTP-10158</p>
+ </item>
+ <item>
+ <p>
+ The ct:get_status/0 function failed to report status if a
+ parallel test case group was running at the time of the
+ call. This has been fixed and the return value for the
+ function has been updated. Please see the ct reference
+ manual for details.</p>
+ <p>
+ Own Id: OTP-10172</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ The support for "silent connections" has been updated to
+ include ssh. Also, a silent_connections term has been
+ added to the set of test specification terms.</p>
+ <p>
+ Own Id: OTP-9625 Aux Id: seq11918 </p>
+ </item>
+ <item>
+ <p>
+ It is now possible to specify an arbitrarily large tuple
+ as the requires config data when using require and
+ ct:get_config. See the ct:get_config and ct:require
+ reference manual pages for details about which keys are
+ allowed.</p>
+ <p>
+ This change introduces a backwards incompatability in the
+ <c>ct:require/2</c> interface. Previously when doing
+ <c>ct:require(a_name,{key,subkey})</c>, a_name would be
+ associated with key. This has been changed to that
+ <c>a_name</c> is associated with <c>subkey</c>. This
+ change also effects using <c>require</c> in an
+ suite/group/testcase info function.</p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>
+ Own Id: OTP-9626 Aux Id: seq11920 </p>
+ </item>
+ <item>
+ <p>
+ The ct_run program now sets the OS process exit status
+ before it ends. Value 0 indicates a successful test
+ result, 1 indicates one or more failed or auto-skipped
+ test cases, and 2 indicates test execution failure.</p>
+ <p>
+ Own Id: OTP-9865 Aux Id: OTP-10087 </p>
+ </item>
+ <item>
+ <p>
+ It is now possible to sort the HTML tables by clicking on
+ the header elements. In order to reset a sorted table,
+ the browser window should simply be refreshed. This
+ feature requires that the browser supports javascript,
+ and has javascript execution enabled. If the 'ct_run
+ -basic_html' flag is used, no javascript code is included
+ in the generated HTML code.</p>
+ <p>
+ Own Id: OTP-9896 Aux Id: seq12034, OTP-9835 </p>
+ </item>
+ <item>
+ <p>
+ A netconf client, ct_netconfc, is added to common_test.
+ It supports basic netconf functionality over SSH. In
+ order to allow testing of both success and failure cases,
+ it is intentionally written to allow non-standard
+ behavior.</p>
+ <p>
+ Own Id: OTP-10025</p>
+ </item>
+ <item>
+ <p>
+ The test specification term {define,Constant,Value} has
+ been introduced, which makes it possible to replace
+ constant names (atom()) with values (term()) in arbitrary
+ test specification terms. The 'define' makes the (now
+ deprecated) 'alias' term obsolete. More details,
+ including examples, can be found in the Test
+ Specifications chapter in the Common Test User's Guide.</p>
+ <p>
+ Own Id: OTP-10049</p>
+ </item>
+ <item>
+ <p>
+ Verbosity levels for log printouts has been added. This
+ makes it possible to specify preferred verbosity for
+ different categories of log printouts, as well as general
+ printouts (such as standard IO), to allow control over
+ which strings get printed and which get ignored. New
+ versions of the Common Test logging functions, ct:log,
+ ct:pal and ct:print, have been introduced, with a new
+ Importance argument added. The Importance value is
+ compared to the verbosity level at runtime. More
+ information can be found in the chapter about Logging in
+ the Common Test User's Guide.</p>
+ <p>
+ Own Id: OTP-10067 Aux Id: seq12050 </p>
+ </item>
+ <item>
+ <p>
+ The return values of ct:run_test/1 and ct:run_testspec/1
+ have been changed from an uninformative 'ok' (independent
+ of the test outcome) to a value,
+ {Ok,Failed,{UserSkipped,AutoSkipped}} (all integers),
+ that presents the final test case result, or a value,
+ {error,Reason}, that informs about fatal test execution
+ failure. See details in the reference manual for ct.</p>
+ <p>
+ Own Id: OTP-10087 Aux Id: OTP-9865 </p>
+ </item>
+ <item>
+ <p>
+ The test specification syntax has been updated with new
+ and missing terms, such as 'define', 'verbosity',
+ 'auto_compile', 'stylesheet', 'silent_connections',
+ 'basic_html' and 'release_shell'. See the Test
+ Specification chapter in the Common Test User's Guide for
+ details.</p>
+ <p>
+ Own Id: OTP-10089 Aux Id: OTP-10049 </p>
+ </item>
+ <item>
+ <p>
+ It is now possible to pause execution of a test case, by
+ calling the ct:break/1/2 function. Execution is resumed
+ with a call to ct:continue/0/1. Break/continue also works
+ for test cases executing in parallel. See the ct
+ reference manual for details.</p>
+ <p>
+ Own Id: OTP-10127</p>
+ </item>
+ <item>
+ <p>
+ It is now possible to send user defined events from a
+ testcase which will be picked up by the installed event
+ handler.</p>
+ <p>
+ Own Id: OTP-10157</p>
+ </item>
+ <item>
+ <p>
+ A new start option, release_shell, for ct:run_test/1, has
+ been added, which makes Common Test release the shell
+ process after the test suite compilation phase is
+ finished. For details, see the Running Tests chapter in
+ the User's Guide.</p>
+ <p>
+ Own Id: OTP-10248 Aux Id: OTP-10127 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Common_Test 1.6.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Common Test adds the test suite directories to the code
+ path before executing the tests. These directories should
+ also be removed from the code path at the end of the test
+ run, which, prior to this fix, was not performed.</p>
+ <p>
+ Own Id: OTP-9595</p>
+ </item>
+ <item>
+ <p>
+ An entry is now created in the index.html file (i.e. the
+ overview file for the test run) for each repeated test
+ during a test run. This was previously not the case. Note
+ that in the top level (logdir) index file, however, only
+ the last test result is listed. For example, given the
+ test spec:
+ [{merge_tests,false},{dirs,"test1"},{dirs,"test1"}]. In
+ the index file for the test run (under
+ Logdir/ct_run.Node.Date.Time), both tests are listed. In
+ the top level index file (under Logdir), only the last
+ test is listed (one has to find the previous results
+ through the all_runs.html file).</p>
+ <p>
+ Own Id: OTP-9634 Aux Id: seq11924 </p>
+ </item>
+ <item>
+ <p>
+ After a test case timeout or abortion, the
+ end_per_testcase function executes on a new dedicated
+ process. The group leader for this process should be set
+ to the IO server for the test case, which was not done
+ properly. The result of this error was that no warnings
+ about end_per_testcase failing or timing out were ever
+ printed in the test case log. Also, help functions such
+ as e.g. test_server:stop_node/1, attempting to
+ synchronize with the IO server, would hang. The fault has
+ been corrected.</p>
+ <p>
+ Own Id: OTP-9666</p>
+ </item>
+ <item>
+ <p>
+ The ct:get_status/0 function would cause the calling
+ process to receive 'DOWN' messages if no tests were
+ running at the time of the call. This bug has been fixed.</p>
+ <p>
+ Own Id: OTP-9830 Aux Id: seq11975 </p>
+ </item>
+ <item>
+ <p>
+ A deadlock situation could occur if Common Test is
+ forwarding error_handler printouts to Test Server at the
+ same time a new test case is starting. This error has
+ been fixed.</p>
+ <p>
+ Own Id: OTP-9894</p>
+ </item>
+ <item>
+ <p>
+ A link to the ct_run program is now created, as expected,
+ in the installation bin directory (default
+ /usr/local/bin) during 'make install'.</p>
+ <p>
+ Own Id: OTP-9898</p>
+ </item>
+ <item>
+ <p>
+ Using the repeat, duration or until option with
+ ct:run_test/1, would cause an infinite loop. This has
+ been fixed.</p>
+ <p>
+ Own Id: OTP-9899</p>
+ </item>
+ <item>
+ <p>
+ Two or more test cases executing in parallel and printing
+ to screen at the same time with ct:pal/2/3 or
+ ct:print/2/3 could write into each other's "slots" and
+ create a mess of mixed strings. In order to avoid this,
+ only a single IO message is now ever sent per printout
+ call.</p>
+ <p>
+ Own Id: OTP-9900 Aux Id: OTP-9904 </p>
+ </item>
+ <item>
+ <p>
+ When a test case was killed because of a timetrap
+ timeout, the current location (suite, case and line) was
+ not printed correctly in the log files. This has been
+ corrected.</p>
+ <p>
+ Own Id: OTP-9930 Aux Id: seq12002 </p>
+ </item>
+ <item>
+ <p>
+ The wrong exit location was printed in the log file when
+ ct:fail/1 or ct_fail/2 was called.</p>
+ <p>
+ Own Id: OTP-9933 Aux Id: seq12002 </p>
+ </item>
+ <item>
+ <p>
+ Test Server and Common Test would add new error handlers
+ with each test run and fail to remove previously added
+ ones. In the case of Test Server, this would only happen
+ if SASL was not running on the test node. This has been
+ fixed.</p>
+ <p>
+ Own Id: OTP-9941 Aux Id: seq12009 </p>
+ </item>
+ <item>
+ <p>
+ If a test case process was terminated due to an exit
+ signal from a linked process, Test Server failed to
+ report the correct name of the suite and case to the
+ framework. This has been corrected.</p>
+ <p>
+ Own Id: OTP-9958 Aux Id: OTP-9855 </p>
+ </item>
+ <item>
+ <p>
+ When starting a test with ct_run and adding a directory
+ to the code path using -pa or -pz (preceding -erl_args),
+ Common Test would delete any existing directory in the
+ code path with the same base name (see
+ filename:basename/1) as the directory being added. This
+ has been fixed.</p>
+ <p>
+ Own Id: OTP-9964</p>
+ </item>
+ <item>
+ <p>
+ If passing two or more directories with the same base
+ name (see filename:basename/1) to Common Test with ct_run
+ -pa, only one of the directories would actually be added.</p>
+ <p>
+ Own Id: OTP-9975 Aux Id: seq12019 </p>
+ </item>
+ <item>
+ <p>
+ Configuration data required by the group info function
+ was deleted before the call to post_end_per_group, which
+ made it impossible for the hook function to read and use
+ the data in question. This has been fixed.</p>
+ <p>
+ Own Id: OTP-9989</p>
+ </item>
+ <item>
+ <p>
+ Disabling built-in hooks in a test specification was
+ ignored, this has now been fixed.</p>
+ <p>
+ Own Id: OTP-10009</p>
+ </item>
+ <item>
+ <p>
+ Various typographical errors corrected in documentation
+ for common_test, driver, erl_driver and windows
+ installation instructions. (Thanks to Tuncer Ayaz)</p>
+ <p>
+ Own Id: OTP-10037</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ A new optional feature has been introduced that enables
+ Common Test to generate priv_dir directory names that are
+ unique for each test case or config function. The name of
+ the option/flag is 'create_priv_dir' and it can be set to
+ value 'auto_per_run' (which is the default, existing,
+ behaviour), or 'auto_per_tc' or 'manual_per_tc'. If
+ 'auto_per_tc' is used, Test Server creates a dedicated
+ priv_dir automatically for each test case (which can be
+ very expensive in case of many and/or repeated cases). If
+ 'manual_per_tc' is used, the user needs to create the
+ priv_dir explicitly by calling the new function
+ ct:make_priv_dir/0.</p>
+ <p>
+ Own Id: OTP-9659 Aux Id: seq11930 </p>
+ </item>
+ <item>
+ <p>
+ A column for test case group name has been added to the
+ suite overview HTML log file.</p>
+ <p>
+ Own Id: OTP-9730 Aux Id: seq11952 </p>
+ </item>
+ <item>
+ <p>
+ It is now possible to use the post_end_per_testcase CT
+ hook function to print a comment for a test case in the
+ overview log file, even if the test case gets killed by a
+ timetrap or unknown exit signal, or if the
+ end_per_testcase function times out.</p>
+ <p>
+ Own Id: OTP-9855 Aux Id: seq11979 </p>
+ </item>
+ <item>
+ <p>
+ The pre- and post CT hook functions are now always called
+ for all configuration functions, even for configuration
+ functions that are not implemented in the test suite.</p>
+ <p>
+ Own Id: OTP-9880 Aux Id: seq11993 </p>
+ </item>
+ <item>
+ <p>
+ Common Test will now print error information (with a time
+ stamp) in the test case log file immediately when a test
+ case fails. This makes it easier to see when, in time,
+ the fault actually occured, and aid the job of locating
+ relevant trace and debug printouts in the log.</p>
+ <p>
+ Own Id: OTP-9904 Aux Id: seq11985, OTP-9900 </p>
+ </item>
+ <item>
+ <p>
+ Test Server has been modified to check the SASL
+ errlog_type parameter when receiving an error logger
+ event, so that it doesn't print reports of type that the
+ user has disabled.</p>
+ <p>
+ Own Id: OTP-9955 Aux Id: seq12013 </p>
+ </item>
+ <item>
+ <p>
+ The test specification term 'skip_groups' was implemented
+ in Common Test v1.6. It was never documented however,
+ which has now been attended to. Please see the Test
+ Specifications chapter in the User's Guide for
+ information.</p>
+ <p>
+ Own Id: OTP-9972</p>
+ </item>
+ <item>
+ <p>
+ The Common Test Master has been updated to use a CSS
+ style sheet for the html log files.</p>
+ <p>
+ Own Id: OTP-9973</p>
+ </item>
+ <item>
+ <p>
+ If the init_per_group/2 and end_per_group/2 functions are
+ not implemented in the test suite, Common Test calls it's
+ own local init- and end functions - previously named
+ ct_init_per_group/2 and ct_end_per_group/2 - when a group
+ is executed. These functions have been renamed
+ init_per_group/2 and end_per_group/2 respectively. Note
+ that this may affect any user event handler identifying
+ events by the old names.</p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>
+ Own Id: OTP-9986 Aux Id: OTP-9992 </p>
+ </item>
+ <item>
+ <p>
+ By specifying a user defined function ({M,F,A} or fun) as
+ timetrap value, either by means of an info function or by
+ calling ct:timetrap/1, it is now possible to set a
+ timetrap that will be triggered when the user function
+ returns.</p>
+ <p>
+ Own Id: OTP-9988 Aux Id: OTP-9501, seq11894 </p>
+ </item>
+ <item>
+ <p>
+ If the optional configuration functions init_per_suite/1
+ and end_per_suite/1 are not implemented in the test
+ suite, local Common Test versions of these functions are
+ called instead, and will be displayed in the overview log
+ file. Any printouts made by the pre- or
+ post_init_per_suite and pre- or post_end_per_suite hook
+ functions are saved in the log files for these functions.</p>
+ <p>
+ Own Id: OTP-9992</p>
+ </item>
+ <item>
+ <p>
+ A hook has been added to common test which outputs
+ surefire XML for usage together with CI tools such as
+ Jenkins. To enable the hook pass '-ct_hooks cth_surefire'
+ to ct_run. See the CTH documentation for more details.</p>
+ <p>
+ Own Id: OTP-9995</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Common_Test 1.6</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/common_test/doc/src/ref_man.xml b/lib/common_test/doc/src/ref_man.xml
index a9fdef7359..6fede88434 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>2011</year>
+ <year>2003</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -71,6 +71,7 @@
<xi:include href="ct_cover.xml"/>
<xi:include href="ct_ftp.xml"/>
<xi:include href="ct_ssh.xml"/>
+ <xi:include href="ct_netconfc.xml"/>
<xi:include href="ct_rpc.xml"/>
<xi:include href="ct_snmp.xml"/>
<xi:include href="ct_telnet.xml"/>
diff --git a/lib/common_test/doc/src/run_test_chapter.xml b/lib/common_test/doc/src/run_test_chapter.xml
index 848f278fa6..ea62df27cc 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>2011</year>
+ <year>2003</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -178,6 +178,8 @@
<item><c><![CDATA[-basic_html]]></c>, switches off html enhancements that might not be compatible with older browsers.</item>
<item><c><![CDATA[-logopts <opts>]]></c>, makes it possible to modify aspects of the logging behaviour, see
<seealso marker="run_test_chapter#logopts">Log options</seealso> below.</item>
+ <item><c><![CDATA[-verbosity <levels>]]></c>, sets <seealso marker="write_test_chapter#logging">verbosity levels
+ for printouts</seealso>.</item>
</list>
<note><p>Directories passed to Common Test may have either relative or absolute paths.</p></note>
@@ -196,60 +198,73 @@
the current working directory of the Erlang Runtime System during the test run!</p>
</note>
- <p>For more information about the <c>ct_run</c> program, see the
- <seealso marker="install_chapter#general">Installation</seealso> chapter.
- </p>
- </section>
-
- <section>
- <title>Running tests from the Web based GUI</title>
-
- <p>The web based GUI, VTS, is started with the <c>ct_run</c>
- program. From the GUI you can load config files, and select
- directories, suites and cases to run. You can also state the
- config files, directories, suites and cases on the command line
- when starting the web based GUI.
- </p>
-
+ <p>The <c>ct_run</c> program sets the exit status before shutting down. The following values
+ are defined:</p>
<list>
- <item><c>ct_run -vts</c></item>
- <item><c><![CDATA[ct_run -vts -config <configfilename>]]></c></item>
- <item><c><![CDATA[ct_run -vts -config <configfilename> -suite <suitewithfullpath>
- -case <casename>]]></c></item>
+ <item><c>0</c> indicates a successful testrun, i.e. one without failed or auto-skipped test cases.</item>
+ <item><c>1</c> indicates that one or more test cases have failed, or have been auto-skipped.</item>
+ <item><c>2</c> indicates that the test execution has failed because of e.g. compilation errors, an
+ illegal return value from an info function, etc.</item>
</list>
+ <p>If auto-skipped test cases should not affect the exit status, you may change the default
+ behaviour using start flag:</p>
+ <pre>-exit_status ignore_config</pre>
- <p>From the GUI you can run tests and view the result and the logs.
+ <p>For more information about the <c>ct_run</c> program, see the
+ <seealso marker="ct_run#top">Reference Manual</seealso> and the
+ <seealso marker="install_chapter#general">Installation</seealso> chapter.
</p>
-
- <p>Note that <c>ct_run -vts</c> will try to open the Common Test start
- page in an existing web browser window or start the browser if it is
- not running. Which browser should be started may be specified with
- the browser start command option:</p>
- <p><c><![CDATA[ct_run -vts -browser <browser_start_cmd>]]></c></p>
- <p>Example:</p>
- <p><c><![CDATA[$ ct_run -vts -browser 'firefox&']]></c></p>
- <p>Note that the browser must run as a separate OS process or VTS will hang!</p>
- <p>If no specific browser start command is specified, Firefox will
- be the default browser on Unix platforms and Internet Explorer on Windows.
- If Common Test fails to start a browser automatically, or <c>'none'</c> is
- specified as the value for -browser (i.e. <c>-browser none</c>), start your
- favourite browser manually and type in the URL that Common Test
- displays in the shell.</p>
</section>
-
+
<section>
<title>Running tests from the Erlang shell or from an Erlang program</title>
<p>Common Test provides an Erlang API for running tests. The main (and most
flexible) function for specifying and executing tests is called
- <c>ct:run_test/1</c>. This function takes the same start parameters as
- the <c>ct_run</c> program described above, only the flags are instead
+ <c><seealso marker="ct#run_test-1">ct:run_test/1</seealso></c>.
+ This function takes the same start parameters as
+ the <c><seealso marker="run_test_chapter#ct_run">ct_run</seealso></c>
+ program described above, only the flags are instead
given as options in a list of key-value tuples. E.g. a test specified
with <c>ct_run</c> like:</p>
+
<p><c>$ ct_run -suite ./my_SUITE -logdir ./results</c></p>
- <p>is with <c>ct:run_test/1</c> specified as:</p>
+ <p>is with <c><seealso marker="ct#run_test-1">ct:run_test/1</seealso></c> specified as:</p>
<p><c>1> ct:run_test([{suite,"./my_SUITE"},{logdir,"./results"}]).</c></p>
- <p>For detailed documentation, please see the <c>ct</c> manual page.</p>
+
+ <p>The function returns the test result, represented by the tuple:
+ <c>{Ok,Failed,{UserSkipped,AutoSkipped}}</c>, where each element is an
+ integer. If test execution fails, the function returns the tuple:
+ <c>{error,Reason}</c>, where the term <c>Reason</c> explains the
+ failure.</p>
+
+ <section>
+ <title>Releasing the Erlang shell</title>
+ <p>During execution of tests, started with
+ <c><seealso marker="ct#run_test-1">ct:run_test/1</seealso></c>,
+ the Erlang shell process, controlling stdin, will remain the top
+ level process of the Common Test system of processes. The result
+ is that the Erlang shell is not available for interaction during
+ the test run. If this is not desirable, maybe because the shell is needed
+ for debugging purposes or for interaction with the SUT during test
+ execution, you may set the <c>release_shell</c> start option to
+ <c>true</c> (in the call to <c>ct:run_test/1</c> or by
+ using the corresponding test specification term, see below). This will
+ make Common Test release the shell immediately after the test suite
+ compilation stage. To accomplish this, a test runner process
+ is spawned to take control of the test execution, and the effect is that
+ <c>ct:run_test/1</c> returns the pid of this process rather than the
+ test result - which instead is printed to tty at the end of the test run.</p>
+ <note><p>Note that in order to use the
+ <c><seealso marker="ct#break-1">ct:break/1/2</seealso></c> and
+ <c><seealso marker="ct#continue-0">ct:continue/0/1</seealso></c> functions,
+ <c>release_shell</c> <em>must</em> be set to <c>true</c>.</p></note>
+ </section>
+
+ <p>For detailed documentation about
+ <c><seealso marker="ct#run_test-1">ct:run_test/1</seealso></c>,
+ please see the
+ <c><seealso marker="ct#run_test-1">ct</seealso></c> manual page.</p>
</section>
<section>
@@ -266,9 +281,9 @@
for trying out various operations during test suite development.</p>
<p>To invoke the interactive shell mode, you can start an Erlang shell
- manually and call <c>ct:install/1</c> to install any configuration
+ manually and call <c><seealso marker="ct#install-1">ct:install/1</seealso></c> to install any configuration
data you might need (use <c>[]</c> as argument otherwise), then
- call <c>ct:start_interactive/0</c> to start Common Test. If you use
+ call <c><seealso marker="ct#start_interactive-0">ct:start_interactive/0</seealso></c> to start Common Test. If you use
the <c>ct_run</c> program, you may start the Erlang shell and Common Test
in the same go by using the <c>-shell</c> and, optionally, the <c>-config</c>
and/or <c>-userconfig</c> flag. Examples:
@@ -287,7 +302,8 @@
<p>If any functions using "required config data" (e.g. ct_telnet or
ct_ftp functions) are to be called from the erlang shell, config
- data must first be required with <c>ct:require/[1,2]</c>. This is
+ data must first be required with <c><seealso marker="ct#require-1">
+ ct:require/1/2</seealso></c>. This is
equivalent to a <c>require</c> statement in the <seealso
marker="write_test_chapter#suite">Test Suite Info
Function</seealso> or in the <seealso
@@ -314,11 +330,11 @@
is not supported.</p>
<p>If you wish to exit the interactive mode (e.g. to start an
- automated test run with <c>ct:run_test/1</c>), call the function
- <c>ct:stop_interactive/0</c>. This shuts down the
+ automated test run with <c><seealso marker="ct#run_test-1">ct:run_test/1</seealso></c>), call the function
+ <c><seealso marker="ct#stop_interactive-0">ct:stop_interactive/0</seealso></c>. This shuts down the
running <c>ct</c> application. Associations between
configuration names and data created with <c>require</c> are
- consequently deleted. <c>ct:start_interactive/0</c> will get you
+ consequently deleted. <c><seealso marker="ct#start_interactive-0">ct:start_interactive/0</seealso></c> will get you
back into interactive mode, but the previous state is not restored.</p>
</section>
@@ -326,7 +342,7 @@
<title>Step by step execution of test cases with the Erlang Debugger</title>
<p>By means of <c>ct_run -step [opts]</c>, or by passing the
- <c>{step,Opts}</c> option to <c>ct:run_test/1</c>, it is possible
+ <c>{step,Opts}</c> option to <c><seealso marker="ct#run_test-1">ct:run_test/1</seealso></c>, it is possible
to get the Erlang Debugger started automatically and use its
graphical interface to investigate the state of the current test
case and to execute it step by step and/or set execution breakpoints.</p>
@@ -352,31 +368,34 @@
<marker id="test_specifications"></marker>
<section>
- <title>Using test specifications</title>
+ <title>Test Specifications</title>
<p>The most flexible way to specify what to test, is to use a so
called test specification. A test specification is a sequence of
- Erlang terms. The terms may be declared in a text file or passed
- to the test server at runtime as a list
- (see <c>run_testspec/1</c> in the manual page
- for <c>ct</c>). There are two general types of terms:
- configuration terms and test specification terms.</p>
+ Erlang terms. The terms are normally declared in a text file (see
+ <c><seealso marker="ct#run_test-1">ct:run_test/1</seealso></c>), but
+ may also be passed to Common Test on the form of a list (see
+ <c><seealso marker="ct#run_testspec-1">ct:run_testspec/1</seealso></c>).
+ There are two general types of terms: configuration terms and test
+ specification terms.</p>
<p>With configuration terms it is possible to e.g. label the test
run (similar to <c>ct_run -label</c>), evaluate arbitrary expressions
- before starting a test, import configuration
- data (similar to
- <c>ct_run -config/-userconfig</c>), specify HTML log directories (similar
- to
- <c>ct_run -logdir</c>), give aliases to test nodes and test
- directories (to make a specification easier to read and
- maintain), enable code coverage analysis (see
- the <seealso marker="cover_chapter#cover">Code Coverage
- Analysis</seealso> chapter) and specify event_handler plugins
- (see the <seealso marker="event_handler_chapter#event_handling">
- Event Handling</seealso> chapter). There is also a term for
- specifying include directories that should be passed on to the
- compiler when automatic compilation is performed (similar
- to <c>ct_run -include</c>, see above).</p>
+ before starting the test, import configuration data (similar to
+ <c>ct_run -config/-userconfig</c>), specify the top level HTML log
+ directory (similar to <c>ct_run -logdir</c>), enable code coverage
+ analysis (similar to <c>ct_run -cover</c>), install Common Test Hooks
+ (similar to <c>ct_run -ch_hooks</c>), install event_handler plugins
+ (similar to <c>ct_run -event_handler</c>), specify include directories
+ that should be passed to the compiler for automatic compilation
+ (similar to <c>ct_run -include</c>), disable the auto compilation
+ feature (similar to <c>ct_run -no_auto_compile</c>), set verbosity
+ levels (similar to <c>ct_run -verbosity</c>), and more.</p>
+ <p>Configuration terms can be combined with <c>ct_run</c> start flags,
+ or <c>ct:run_test/1</c> options. The result will for some flags/options
+ and terms be that the values are merged (e.g. configuration files,
+ include directories, verbosity levels, silent connections), and for
+ others that the start flags/options override the test specification
+ terms (e.g. log directory, label, style sheet, auto compilation).</p>
<p>With test specification terms it is possible to state exactly
which tests should run and in which order. A test term specifies
either one or more suites, one or more test case groups, or one
@@ -391,11 +410,12 @@
S, is a test of all cases in S. However, if a term specifying
test case X and Y in S is merged with a term specifying case Z
in S, the result is a test of X, Y and Z in S. To disable this
- behaviour, it is possible in test specification to set the
- <c>merge_tests</c> term to <c>false</c>.</p>
+ behaviour, i.e. to instead perform each test sequentially in a "script-like"
+ manner, the term <c>merge_tests</c> can be set to <c>false</c> in
+ the test specification.</p>
<p>A test term can also specify one or more test suites, groups,
or test cases to be skipped. Skipped suites, groups and cases
- are not executed and show up in the HTML test log files as
+ are not executed and show up in the HTML log files as
SKIPPED.</p>
<p>When a test case group is specified, the resulting test
executes the
@@ -425,15 +445,30 @@
<p>Below is the test specification syntax. Test specifications can
be used to run tests both in a single test host environment and
in a distributed Common Test environment (Large Scale
- Testing). The node parameters in the init term are only
+ Testing). The node parameters in the <c>init</c> term are only
relevant in the latter (see the
<seealso marker="ct_master_chapter#test_specifications">Large
- Scale Testing</seealso> chapter for information). For details on
- the event_handler term, see the
+ Scale Testing</seealso> chapter for information). For more information
+ about the various terms, please see the corresponding sections in the
+ User's Guide, such as e.g. the
+ <seealso marker="run_test_chapter#ct_run"><c>ct_run</c>
+ program</seealso> for an overview of available start flags
+ (since most flags have a corresponding configuration term), and
+ more detailed explanation of e.g.
+ <seealso marker="write_test_chapter#logging">Logging</seealso>
+ (for the <c>verbosity</c>, <c>stylesheet</c> and <c>basic_html</c> terms),
+ <seealso marker="config_file_chapter#top">External Configuration Data</seealso>
+ (for the <c>config</c> and <c>userconfig</c> terms),
<seealso marker="event_handler_chapter#event_handling">Event
- Handling</seealso> chapter.</p>
+ Handling</seealso> (for the <c>event_handler</c> term),
+ <seealso marker="ct_hooks_chapter#installing">Common Test Hooks</seealso>
+ (for the <c>ct_hooks</c> term), etc.</p>
<p>Config terms:</p>
<pre>
+ {merge_tests, Bool}.
+
+ {define, Constant, Value}.
+
{node, NodeAlias, Node}.
{init, InitOptions}.
@@ -442,6 +477,15 @@
{label, Label}.
{label, NodeRefs, Label}.
+ {verbosity, VerbosityLevels}.
+ {verbosity, NodeRefs, VerbosityLevels}.
+
+ {stylesheet, CSSFile}.
+ {stylesheet, NodeRefs, CSSFile}.
+
+ {silent_connections, ConnTypes}.
+ {silent_connections, NodeRefs, ConnTypes}.
+
{multiply_timetraps, N}.
{multiply_timetraps, NodeRefs, N}.
@@ -454,18 +498,25 @@
{include, IncludeDirs}.
{include, NodeRefs, IncludeDirs}.
+ {auto_compile, Bool},
+ {auto_compile, NodeRefs, Bool},
+
{config, ConfigFiles}.
+ {config, ConfigDir, ConfigBaseNames}.
{config, NodeRefs, ConfigFiles}.
+ {config, NodeRefs, ConfigDir, ConfigBaseNames}.
{userconfig, {CallbackModule, ConfigStrings}}.
{userconfig, NodeRefs, {CallbackModule, ConfigStrings}}.
- {alias, DirAlias, Dir}.
-
- {merge_tests, Bool}.
-
{logdir, LogDir}.
{logdir, NodeRefs, LogDir}.
+
+ {logopts, LogOpts}.
+ {logopts, NodeRefs, LogOpts}.
+
+ {create_priv_dir, PrivDirOption}.
+ {create_priv_dir, NodeRefs, PrivDirOption}.
{event_handler, EventHandlers}.
{event_handler, NodeRefs, EventHandlers}.
@@ -476,78 +527,176 @@
{ct_hooks, NodeRefs, CTHModules}.
{enable_builtin_hooks, Bool}.
- </pre>
+
+ {basic_html, Bool}.
+ {basic_html, NodeRefs, Bool}.
+
+ {release_shell, Bool}.</pre>
+
<p>Test terms:</p>
<pre>
- {suites, DirRef, Suites}.
- {suites, NodeRefs, DirRef, Suites}.
+ {suites, Dir, Suites}.
+ {suites, NodeRefs, Dir, Suites}.
- {groups, DirRef, Suite, Groups}.
- {groups, NodeRefsDirRef, Suite, Groups}.
+ {groups, Dir, Suite, Groups}.
+ {groups, NodeRefs, Dir, Suite, Groups}.
+
+ {groups, Dir, Suite, GroupSpec, {cases,Cases}}.
+ {groups, NodeRefs, Dir, Suite, GroupSpec, {cases,Cases}}.
- {groups, DirRef, Suite, GroupSpec, {cases,Cases}}.
- {groups, NodeRefsDirRef, Suite, GroupSpec, {cases,Cases}}.
+ {cases, Dir, Suite, Cases}.
+ {cases, NodeRefs, Dir, Suite, Cases}.
- {cases, DirRef, Suite, Cases}.
- {cases, NodeRefs, DirRef, Suite, Cases}.
+ {skip_suites, Dir, Suites, Comment}.
+ {skip_suites, NodeRefs, Dir, Suites, Comment}.
- {skip_suites, DirRef, Suites, Comment}.
- {skip_suites, NodeRefs, DirRef, Suites, Comment}.
+ {skip_groups, Dir, Suite, GroupNames, Comment}.
+ {skip_groups, NodeRefs, Dir, Suite, GroupNames, Comment}.
- {skip_cases, DirRef, Suite, Cases, Comment}.
- {skip_cases, NodeRefs, DirRef, Suite, Cases, Comment}.
- </pre>
+ {skip_cases, Dir, Suite, Cases, Comment}.
+ {skip_cases, NodeRefs, Dir, Suite, Cases, Comment}.</pre>
+
<p>Types:</p>
<pre>
- NodeAlias = atom()
- InitOptions = term()
- Node = node()
- NodeRef = NodeAlias | Node | master
- NodeRefs = all_nodes | [NodeRef] | NodeRef
- N = integer()
- Bool = true | false
- CoverSpecFile = string()
- IncludeDirs = string() | [string()]
- ConfigFiles = string() | [string()]
- DirAlias = atom()
- Dir = string()
- LogDir = string()
- EventHandlers = atom() | [atom()]
- InitArgs = [term()]
- CTHModules = [CTHModule | {CTHModule, CTHInitArgs} | {CTHModule, CTHInitArgs, CTHPriority}]
- CTHModule = atom()
- CTHInitArgs = term()
- DirRef = DirAlias | Dir
- Suites = atom() | [atom()] | all
- Suite = atom()
- Groups = GroupSpec | [GroupSpec] | all
- GroupSpec = Group | {Group,Properties} | {Group,Properties,GroupSpec}
- Group = atom()
- Cases = atom() | [atom()] | all
- Comment = string() | ""
- </pre>
- <p>Example:</p>
+ Bool = true | false
+ Constant = atom()
+ Value = term()
+ NodeAlias = atom()
+ Node = node()
+ NodeRef = NodeAlias | Node | master
+ NodeRefs = all_nodes | [NodeRef] | NodeRef
+ InitOptions = term()
+ Label = atom() | string()
+ VerbosityLevels = integer() | [{Category,integer()}]
+ Category = atom()
+ CSSFile = string()
+ ConnTypes = all | [atom()]
+ N = integer()
+ CoverSpecFile = string()
+ IncludeDirs = string() | [string()]
+ ConfigFiles = string() | [string()]
+ ConfigDir = string()
+ ConfigBaseNames = string() | [string()]
+ CallbackModule = atom()
+ ConfigStrings = string() | [string()]
+ LogDir = string()
+ LogOpts = [term()]
+ PrivDirOption = auto_per_run | auto_per_tc | manual_per_tc
+ EventHandlers = atom() | [atom()]
+ InitArgs = [term()]
+ CTHModules = [CTHModule | {CTHModule, CTHInitArgs} | {CTHModule, CTHInitArgs, CTHPriority}]
+ CTHModule = atom()
+ CTHInitArgs = term()
+ Dir = string()
+ Suites = atom() | [atom()] | all
+ Suite = atom()
+ Groups = GroupSpec | [GroupSpec] | all
+ GroupSpec = GroupName | {GroupName,Properties} | {GroupName,Properties,GroupSpec}
+ GroupName = atom()
+ GroupNames = GroupName | [GroupName]
+ Cases = atom() | [atom()] | all
+ Comment = string() | ""</pre>
+
+ <p>The difference between the <c>config</c> terms above, is that with
+ <c>ConfigDir</c>, <c>ConfigBaseNames</c> is a list of base names,
+ i.e. without directory paths. <c>ConfigFiles</c> must be full names,
+ including paths. E.g, these two terms have the same meaning:</p>
+ <pre>
+ {config, ["/home/testuser/tests/config/nodeA.cfg",
+ "/home/testuser/tests/config/nodeB.cfg"]}.
+
+ {config, "/home/testuser/tests/config", ["nodeA.cfg","nodeB.cfg"]}.</pre>
+
+ <note><p>Any relative paths specified in the test specification, will be
+ relative to the directory which contains the test specification file, if
+ <c>ct_run -spec TestSpecFile ...</c> or
+ <c>ct:run:test([{spec,TestSpecFile},...])</c>
+ executes the test. The path will be relative to the top level log directory, if
+ <c>ct:run:testspec(TestSpec)</c> executes the test.</p></note>
+
+ <p>The <c>define</c> term introduces a constant, which is used to
+ replace the name <c>Constant</c> with <c>Value</c>, wherever it's found in
+ the test specification. This replacement happens during an initial iteration
+ through the test specification. Constants may be used anywhere in the test
+ specification, e.g. in arbitrary lists and tuples, and even in strings
+ and inside the value part of other constant definitions! A constant can
+ also be part of a node name, but that is the only place where a constant
+ can be part of an atom.</p>
+
+ <note><p>For the sake of readability, the name of the constant must always
+ begin with an upper case letter, or a <c>$</c>, <c>?</c>, or <c>_</c>.
+ This also means that it must always be single quoted (obviously, since
+ the constant name is actually an atom, not text).</p></note>
+
+ <p>The main benefit of constants is that they can be used to reduce the size
+ (and avoid repetition) of long strings, such as file paths. Compare these
+ terms:</p>
+
<pre>
- {logdir, "/home/test/logs"}.
+ %% 1a. no constant
+ {config, "/home/testuser/tests/config", ["nodeA.cfg","nodeB.cfg"]}.
+ {suites, "/home/testuser/tests/suites", all}.
- {config, "/home/test/t1/cfg/config.cfg"}.
- {config, "/home/test/t2/cfg/config.cfg"}.
- {config, "/home/test/t3/cfg/config.cfg"}.
+ %% 1b. with constant
+ {define, 'TESTDIR', "/home/testuser/tests"}.
+ {config, "'TESTDIR'/config", ["nodeA.cfg","nodeB.cfg"]}.
+ {suites, "'TESTDIR'/suites", all}.
+
+ %% 2a. no constants
+ {config, [testnode@host1, testnode@host2], "../config", ["nodeA.cfg","nodeB.cfg"]}.
+ {suites, [testnode@host1, testnode@host2], "../suites", [x_SUITE, y_SUITE]}.
+
+ %% 2b. with constants
+ {define, 'NODE', testnode}.
+ {define, 'NODES', ['NODE'@host1, 'NODE'@host2]}.
+ {config, 'NODES', "../config", ["nodeA.cfg","nodeB.cfg"]}.
+ {suites, 'NODES', "../suites", [x_SUITE, y_SUITE]}.</pre>
+
+ <p>Constants make the test specification term <c>alias</c>, in previous
+ versions of Common Test, redundant. This term has been deprecated but will
+ remain supported in upcoming Common Test releases. Replacing <c>alias</c>
+ terms with <c>define</c> is strongly recommended though! Here's an example
+ of such a replacement:</p>
+
+ <pre>
+ %% using the old alias term
+ {config, "/home/testuser/tests/config/nodeA.cfg"}.
+ {alias, suite_dir, "/home/testuser/tests/suites"}.
+ {groups, suite_dir, x_SUITE, group1}.
+
+ %% replacing with constants
+ {define, 'TestDir', "/home/testuser/tests"}.
+ {define, 'CfgDir', "'TestDir'/config"}.
+ {define, 'SuiteDir', "'TestDir'/suites"}.
+ {config, 'CfgDir', "nodeA.cfg"}.
+ {groups, 'SuiteDir', x_SUITE, group1}.</pre>
+
+ <p>Actually, constants could well replace the <c>node</c> term too, but
+ this still has declarative value, mainly when used in combination
+ with <c>NodeRefs == all_nodes</c> (see types above).</p>
+
+ <p>Here follows a simple test specification example:</p>
+ <pre>
+ {define, 'Top', "/home/test"}.
+ {define, 'T1', "'Top'/t1"}.
+ {define, 'T2', "'Top'/t2"}.
+ {define, 'T3', "'Top'/t3"}.
+ {define, 'CfgFile', "config.cfg"}.
+
+ {logdir, "'Top'/logs"}.
- {alias, t1, "/home/test/t1"}.
- {alias, t2, "/home/test/t2"}.
- {alias, t3, "/home/test/t3"}.
+ {config, ["'T1'/'CfgFile'", "'T2'/'CfgFile'", "'T3'/'CfgFile'"]}.
- {suites, t1, all}.
- {skip_suites, t1, [t1B_SUITE,t1D_SUITE], "Not implemented"}.
- {skip_cases, t1, t1A_SUITE, [test3,test4], "Irrelevant"}.
- {skip_cases, t1, t1C_SUITE, [test1], "Ignore"}.
+ {suites, 'T1', all}.
+ {skip_suites, 'T1', [t1B_SUITE,t1D_SUITE], "Not implemented"}.
+ {skip_cases, 'T1', t1A_SUITE, [test3,test4], "Irrelevant"}.
+ {skip_cases, 'T1', t1C_SUITE, [test1], "Ignore"}.
- {suites, t2, [t2B_SUITE,t2C_SUITE]}.
- {cases, t2, t2A_SUITE, [test4,test1,test7]}.
+ {suites, 'T2', [t2B_SUITE,t2C_SUITE]}.
+ {cases, 'T2', t2A_SUITE, [test4,test1,test7]}.
- {skip_suites, t3, all, "Not implemented"}.
- </pre>
+ {skip_suites, 'T3', all, "Not implemented"}.</pre>
+
<p>The example specifies the following:</p>
<list>
<item>The specified logdir directory will be used for storing
@@ -555,8 +704,6 @@
date and time).</item>
<item>The variables in the specified test system config files will be
imported for the test.</item>
- <item>Aliases are given for three test system directories. The suites in
- this example are stored in "/home/test/tX/test".</item>
<item>The first test to run includes all suites for system t1. Excluded from
the test are however the t1B and t1D suites. Also test cases test3 and
test4 in t1A as well as the test1 case in t1C are excluded from
@@ -567,9 +714,9 @@
<item>Lastly, all suites for systems t3 are to be completely skipped and this
should be explicitly noted in the log files.</item>
</list>
- <p>It is possible to specify initialization options for nodes defined in the
- test specification. Currently, there are options to start the node and/or to
- evaluate any function on the node.
+ <p>With the <c>init</c> term it's possible to specify initialization options
+ for nodes defined in the test specification. Currently, there are options
+ to start the node and/or to evaluate any function on the node.
See the <seealso marker="ct_master_chapter#ct_slave">Automatic startup of
the test target nodes</seealso> chapter for details.</p>
<p>It is possible for the user to provide a test specification that
@@ -578,11 +725,49 @@
<c>ct_run</c>. This forces Common Test to ignore unrecognizable terms.
Note that in this mode, Common Test is not able to check the specification
for errors as efficiently as if the scanner runs in default mode.
- If <c>ct:run_test/1</c> is used for starting the tests, the relaxed scanner
+ If <c><seealso marker="ct#run_test-1">ct:run_test/1</seealso></c> is used for starting the tests, the relaxed scanner
mode is enabled by means of the tuple: <c>{allow_user_terms,true}</c></p>
</section>
+
+ <section>
+ <title>Running tests from the Web based GUI</title>
+
+ <p>The web based GUI, VTS, is started with the
+ <c><seealso marker="run_test_chapter#ct_run">ct_run</seealso></c>
+ program. From the GUI you can load config files, and select
+ directories, suites and cases to run. You can also state the
+ config files, directories, suites and cases on the command line
+ when starting the web based GUI.
+ </p>
+
+ <list>
+ <item><c>ct_run -vts</c></item>
+ <item><c><![CDATA[ct_run -vts -config <configfilename>]]></c></item>
+ <item><c><![CDATA[ct_run -vts -config <configfilename> -suite <suitewithfullpath>
+ -case <casename>]]></c></item>
+ </list>
+
+ <p>From the GUI you can run tests and view the result and the logs.
+ </p>
+
+ <p>Note that <c>ct_run -vts</c> will try to open the Common Test start
+ page in an existing web browser window or start the browser if it is
+ not running. Which browser should be started may be specified with
+ the browser start command option:</p>
+ <p><c><![CDATA[ct_run -vts -browser <browser_start_cmd>]]></c></p>
+ <p>Example:</p>
+ <p><c><![CDATA[$ ct_run -vts -browser 'firefox&']]></c></p>
+ <p>Note that the browser must run as a separate OS process or VTS will hang!</p>
+ <p>If no specific browser start command is specified, Firefox will
+ be the default browser on Unix platforms and Internet Explorer on Windows.
+ If Common Test fails to start a browser automatically, or <c>'none'</c> is
+ specified as the value for -browser (i.e. <c>-browser none</c>), start your
+ favourite browser manually and type in the URL that Common Test
+ displays in the shell.</p>
+ </section>
<section>
+ <marker id="log_files"></marker>
<title>Log files</title>
<p>As the execution of the test suites proceed, events are logged in
@@ -710,17 +895,30 @@
<p>instead of each <c>x</c> printed on a new line, which is the default behaviour.</p>
</section>
+ <section>
+ <marker id="table_sorting"></marker>
+ <title>Sorting HTML table columns</title>
+ <p>By clicking the name in the column header of any table (e.g. "Ok", "Case", "Time", etc),
+ the table rows are sorted in whatever order makes sense for the type of value (e.g.
+ numerical for "Ok" or "Time", and alphabetical for "Case"). The sorting is performed
+ by means of JavaScript code, automatically inserted into the HTML log files. Common Test
+ uses the <url href="http://jquery.com">jQuery</url> library and the
+ <url href="http://tablesorter.com">tablesorter</url> plugin, with customized sorting
+ functions, for this implementation.</p>
+ </section>
</section>
<section>
<marker id="html_stylesheet"></marker>
<title>HTML Style Sheets</title>
- <p>Common Test uses a CSS file to control the look of the HTML
- files generated during test runs. If, for some reason, the
- log files are not displayed correctly in the HTML browser of your
- choice, or you prefer the "pre Common Test v1.6 look"
- of the log files (i.e. not using CSS), use the start flag/option
- <c>basic_html</c> to revert to the old style.</p>
+ <p>Common Test uses an HTML Style Sheet (CSS file) to control the look of
+ the HTML log files generated during test runs. If, for some reason, the
+ log files are not displayed correctly in the browser of your
+ choice, or you prefer a more primitive ("pre Common Test v1.6") look
+ of the logs, use the start flag/option:</p>
+ <pre>basic_html</pre>
+ <p>This disables the use of Style Sheets, as well as JavaScripts (see
+ table sorting above).</p>
<p>Common Test includes an <em>optional</em> feature to allow
user HTML style sheets for customizing printouts. The
@@ -873,75 +1071,82 @@
<section>
<marker id="silent_connections"></marker>
<title>Silent Connections</title>
- <p>The protocol handling processes in Common Test, implemented by ct_telnet, ct_ftp etc,
- do verbose printing to the test case logs. This can be switched off by means
- of the <c>-silent_connections</c> flag:</p>
+ <p>The protocol handling processes in Common Test, implemented by ct_telnet,
+ ct_ssh, ct_ftp etc, do verbose printing to the test case logs. This can be switched off
+ by means of the <c>-silent_connections</c> flag:</p>
<pre>
ct_run -silent_connections [conn_types]
</pre>
- <p>where <c>conn_types</c> specifies <c>telnet, ftp, rpc</c> and/or <c>snmp</c>.</p>
+ <p>where <c>conn_types</c> specifies <c>ssh, telnet, ftp, rpc</c> and/or <c>snmp</c>.</p>
<p>Example:</p>
<pre>
- ct_run ... -silent_connections telnet ftp</pre>
- <p>switches off logging for telnet and ftp connections.</p>
+ ct_run ... -silent_connections ssh telnet</pre>
+ <p>switches off logging for ssh and telnet connections.</p>
<pre>
ct_run ... -silent_connections</pre>
<p>switches off logging for all connection types.</p>
- <p>Basic and important information such as opening and closing a connection,
- fatal communication error and reconnection attempts will always be printed even
- if logging has been suppressed for the connection type in question. However, operations
- such as sending and receiving data may be performed silently.</p>
+ <p>Fatal communication error and reconnection attempts will always be printed even
+ if logging has been suppressed for the connection type in question. However, operations
+ such as sending and receiving data will be performed silently.</p>
<p>It is possible to also specify <c>silent_connections</c> in a test suite. This is
accomplished by returning a tuple, <c>{silent_connections,ConnTypes}</c>, in the
<c>suite/0</c> or test case info list. If <c>ConnTypes</c> is a list of atoms
- (<c>telnet, ftp, rpc</c> and/or <c>snmp</c>), output for any corresponding connections
+ (<c>ssh, telnet, ftp, rpc</c> and/or <c>snmp</c>), output for any corresponding connections
will be suppressed. Full logging is per default enabled for any connection of type not
specified in <c>ConnTypes</c>. Hence, if <c>ConnTypes</c> is the empty list, logging
is enabled for all connections.</p>
- <p>The <c>silent_connections</c> setting returned from a test case info function overrides,
- for the test case in question, any setting made with <c>suite/0</c> (which is the setting
- used for all cases in the suite). Example:</p>
+ <p>Example:</p>
<pre>
-module(my_SUITE).
+
+ suite() -> [..., {silent_connections,[telnet,ssh]}, ...].
+
...
- suite() -> [..., {silent_connections,[telnet,ftp]}, ...].
- ...
+
my_testcase1() ->
- [{silent_connections,[ftp]}].
+ [{silent_connections,[ssh]}].
+
my_testcase1(_) ->
- ...
+ ...
+
my_testcase2(_) ->
- ...
+ ...
</pre>
<p>In this example, <c>suite/0</c> tells Common Test to suppress
- printouts from telnet and ftp connections. This is valid for
+ printouts from telnet and ssh connections. This is valid for
all test cases. However, <c>my_testcase1/0</c> specifies that
- for this test case, only ftp should be silent. The result is
+ for this test case, only ssh should be silent. The result is
that <c>my_testcase1</c> will get telnet info (if any) printed
- in the log, but not ftp info. <c>my_testcase2</c> will get no
+ in the log, but not ssh info. <c>my_testcase2</c> will get no
info from either connection printed.</p>
- <p>The <c>-silent_connections</c> tag (or
- <c>silent_connections</c> tagged tuple in the call to
- <c>ct:run_test/1</c>) overrides any settings in the test
- suite.</p>
+ <p><c>silent_connections</c> may also be specified with a term
+ in a test specification
+ (see <seealso marker="run_test_chapter#test_specifications">Test
+ Specifications</seealso>). Connections provided with the
+ <c>silent_connections</c> start flag/option, will be merged with
+ any connections listed in the test specification.</p>
+
+ <p>The <c>silent_connections</c> start flag/option and test
+ specification term, overrides any settings made by the info functions
+ inside the test suite.</p>
- <p>Note that in the current Common Test version, the
+ <note><p>Note that in the current Common Test version, the
<c>silent_connections</c> feature only works for telnet
- connections. Support for other connection types will be added
- in future Common Test versions.</p>
+ and ssh connections! Support for other connection types will be added
+ in future Common Test versions.</p></note>
</section>
</chapter>
diff --git a/lib/common_test/doc/src/write_test_chapter.xml b/lib/common_test/doc/src/write_test_chapter.xml
index c0ec26ddcc..248d7de8b6 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>2011</year>
+ <year>2003</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,7 +29,6 @@
<file>write_test_chapter.xml</file>
</header>
-
<section>
<marker id="intro"></marker>
<title>Support for test suite authors</title>
@@ -48,7 +47,7 @@
module for details about these functions.</p>
<p>The CT application also includes other modules named
- <c><![CDATA[ct_<something>]]></c> that
+ <c><![CDATA[ct_<component>]]></c> that
provide various support, mainly simplified use of communication
protocols such as rpc, snmp, ftp, telnet, etc.</p>
@@ -63,7 +62,8 @@
function in CT will not be able to locate it (at least not per default).
</p>
- <p>The <c>ct.hrl</c> header file must be included in all test suite files.
+ <p>It is also recommended that the <c>ct.hrl</c> header file is included
+ in all test suite modules.
</p>
<p>Each test suite module must export the function <c>all/0</c>
@@ -71,6 +71,12 @@
to be executed in that module.
</p>
+ <p>The callback functions that the test suite should implement, and
+ which will be described in more detail below, are
+ all listed in the <seealso marker="common_test">common_test
+ reference manual page</seealso>.
+ </p>
+
</section>
<section>
@@ -113,6 +119,14 @@
suite will be skipped automatically (so called <em>auto skipped</em>),
including <c>end_per_suite</c>.
</p>
+
+ <p>Note that if <c>init_per_suite</c> and <c>end_per_suite</c> do not exist
+ in the suite, Common Test calls dummy functions (with the same names)
+ instead, so that output generated by hook functions may be saved to the log
+ files for these dummies
+ (see the <seealso marker="ct_hooks_chapter#manipulating">Common Test Hooks</seealso>
+ chapter for more information).
+ </p>
</section>
<marker id="per_testcase"/>
@@ -159,7 +173,7 @@
</p>
<p>The <c>end_per_testcase/2</c> function is called even after a
- test case terminates due to a call to <c>ct:abort_current_testcase/1</c>,
+ test case terminates due to a call to <c><seealso marker="ct#abort_current_testcase-1">ct:abort_current_testcase/1</seealso></c>,
or after a timetrap timeout. However, <c>end_per_testcase</c>
will then execute on a different process than the test case
function, and in this situation, <c>end_per_testcase</c> will
@@ -229,7 +243,8 @@
<note><p>The test case function argument <c>Config</c> should not be
confused with the information that can be retrieved from
- configuration files (using ct:get_config/[1,2]). The Config argument
+ configuration files (using <c><seealso marker="ct#get_config-1">
+ ct:get_config/1/2</seealso></c>). The Config argument
should be used for runtime configuration of the test suite and the
test cases, while configuration files should typically contain data
related to the SUT. These two types of configuration data are handled
@@ -288,7 +303,7 @@
<item>
<p>
Use this to specify arbitrary data related to the testcase. This
- data can be retrieved at any time using the <c>ct:userdata/3</c>
+ data can be retrieved at any time using the <c><seealso marker="ct#userdata-3">ct:userdata/3</seealso></c>
utility function.
</p>
</item>
@@ -324,7 +339,8 @@
<pre>
testcase2() ->
- [{require, unix_telnet, {unix, [telnet, username, password]}},
+ [{require, unix_telnet, unix},
+ {require, {unix, [telnet, username, password]}},
{default_config, unix, [{telnet, "my_telnet_host"},
{username, "aladdin"},
{password, "sesame"}]}}].</pre>
@@ -332,7 +348,8 @@
</taglist>
<p>See the <seealso marker="config_file_chapter#require_config_data">Config files</seealso>
- chapter and the <c>ct:require/[1,2]</c> function in the
+ chapter and the <c><seealso marker="ct#require-1">
+ ct:require/1/2</seealso></c> function in the
<seealso marker="ct">ct</seealso> reference manual for more information about
<c>require</c>.</p>
@@ -513,8 +530,7 @@
execution is immediately stopped and the rest of the cases skipped.</p>
<p>Before execution of a group begins, the configuration function
- <c>init_per_group(GroupName, Config)</c> is called (the function is
- mandatory if one or more test case groups are defined). The list of tuples
+ <c>init_per_group(GroupName, Config)</c> is called. The list of tuples
returned from this function is passed to the test cases in the usual
manner by means of the <c>Config</c> argument. <c>init_per_group/2</c>
is meant to be used for initializations common for the test cases in the
@@ -522,6 +538,14 @@
<c>end_per_group(GroupName, Config</c> function is called. This function
is meant to be used for cleaning up after <c>init_per_group/2</c>.</p>
+ <p>Whenever a group is executed, if <c>init_per_group</c> and
+ <c>end_per_group</c> do not exist in the suite, Common Test calls
+ dummy functions (with the same names) instead. Output generated by
+ hook functions will be saved to the log files for these dummies
+ (see the <seealso marker="ct_hooks_chapter#manipulating">Common Test
+ Hooks</seealso> chapter for more information).
+ </p>
+
<note><p><c>init_per_testcase/2</c> and <c>end_per_testcase/2</c>
are always called for each individual test case, no matter if the case
belongs to a group or not.</p></note>
@@ -611,6 +635,25 @@
</section>
<section>
+ <title>Parallel test cases and IO</title>
+ <p>A parallel test case has a private IO server as its group leader.
+ (Please see the Erlang Run-Time System Application documentation for
+ a description of the group leader concept). The
+ central IO server process that handles the output from regular test
+ cases and configuration functions, does not respond to IO messages
+ during execution of parallel groups. This is important to understand
+ in order to avoid certain traps, like this one:</p>
+ <p>If a process, <c>P</c>, is spawned during execution of e.g.
+ <c>init_per_suite/1</c>, it will inherit the group leader of the
+ <c>init_per_suite</c> process. This group leader is the central IO server
+ process mentioned above. If, at a later time, <em>during parallel test case
+ execution</em>, some event triggers process <c>P</c> to call
+ <c>io:format/1/2</c>, that call will never return (since the group leader
+ is in a non-responsive state) and cause <c>P</c> to hang.
+ </p>
+ </section>
+
+ <section>
<title>Repeated groups</title>
<marker id="repeated_groups"></marker>
<p>A test case group may be repeated a certain number of times
@@ -745,7 +788,7 @@
<marker id="data_priv_dir"></marker>
<title>Data and Private Directories</title>
- <p>The data directory (<c>data_dir</c>) is the directory where the
+ <p>The data directory, <c>data_dir</c>, is the directory where the
test module has its own files needed for the testing. The name
of the <c>data_dir</c> is the the name of the test suite followed
by <c>"_data"</c>. For example,
@@ -769,12 +812,39 @@
</p>
-->
<p>
- The <c>priv_dir</c> is the test suite's private directory. This
- directory should be used when a test case needs to write to
- files. The name of the private directory is generated by the test
- server, which also creates the directory.
+ <c>priv_dir</c> is the private directory for the test cases.
+ This directory may be used whenever a test case (or configuration function)
+ needs to write something to file. The name of the private directory is
+ generated by Common Test, which also creates the directory.
</p>
-
+ <p>By default, Common Test creates one central private directory
+ per test run that all test cases share. This may not always be suitable,
+ especially if the same test cases are executed multiple times during
+ a test run (e.g. if they belong to a test case group with repeat
+ property), and there's a risk that files in the private directory get
+ overwritten. Under these circumstances, it's possible to configure
+ Common Test to create one dedicated private directory per
+ test case and execution instead. This is accomplished by means of
+ the flag/option: <c>create_priv_dir</c> (to be used with the
+ <c>ct_run</c> program, the <c><seealso marker="ct#run_test-1">ct:run_test/1</seealso></c> function, or
+ as test specification term). There are three possible values
+ for this option:
+ <list>
+ <item><c>auto_per_run</c></item>
+ <item><c>auto_per_tc</c></item>
+ <item><c>manual_per_tc</c></item>
+ </list>
+ The first value indicates the default priv_dir behaviour, i.e.
+ one private directory created per test run. The two latter
+ values tell Common Test to generate a unique test directory name
+ per test case and execution. If the auto version is used, <em>all</em>
+ private directories will be created automatically. This can obviously
+ become very inefficient for test runs with many test cases and/or
+ repetitions. Therefore, in case the manual version is instead used, the
+ test case must tell Common Test to create priv_dir when it needs it.
+ It does this by calling the function <c><seealso marker="ct#make_priv_dir-0">ct:make_priv_dir/0</seealso></c>.
+ </p>
+
<note><p>You should not depend on current working directory for
reading and writing data files since this is not portable. All
scratch files are to be written in the <c>priv_dir</c> and all
@@ -805,37 +875,159 @@
<marker id="timetraps"></marker>
<title>Timetrap timeouts</title>
<p>The default time limit for a test case is 30 minutes, unless a
- <c>timetrap</c> is specified either by the suite info function
- or a test case info function. The timetrap timeout value defined
- in <c>suite/0</c> is the value that will be used for each test case
- in the suite (as well as for the configuration functions
- <c>init_per_suite/1</c> and <c>end_per_suite</c>). A timetrap timeout
- value set with the test case info function will override the value set
- by <c>suite/0</c>, but only for that particular test case.</p>
- <p>It is also possible to set/reset a timetrap during test case (or
- configuration function) execution. This is done by calling
- <c>ct:timetrap/1</c>. This function will cancel the current timetrap
- and start a new one.</p>
+ <c>timetrap</c> is specified either by the suite-, group-,
+ or test case info function. The timetrap timeout value defined by
+ <c>suite/0</c> is the value that will be used for each test case
+ in the suite (as well as for the configuration functions
+ <c>init_per_suite/1</c>, <c>end_per_suite/1</c>, <c>init_per_group/2</c>,
+ and <c>end_per_group/2</c>). A timetrap value defined by
+ <c>group(GroupName)</c> overrides one defined by <c>suite()</c>
+ and will be used for each test case in group <c>GroupName</c>, and any
+ of its sub-groups. If a timetrap value is defined by <c>group/1</c>
+ for a sub-group, it overrides that of its higher level groups. Timetrap
+ values set by individual test cases (by means of the test case info
+ function) override both group- and suite- level timetraps.</p>
+
+ <p>It is also possible to dynamically set/reset a timetrap during the
+ excution of a test case, or configuration function. This is done by calling
+ <c><seealso marker="ct#timetrap-1">ct:timetrap/1</seealso></c>. This function cancels the current timetrap
+ and starts a new one (that stays active until timeout, or end of the
+ current function).</p>
+
<p>Timetrap values can be extended with a multiplier value specified at
- startup with the <c>multiply_timetraps</c> option. It is also possible
- to let Test Server decide to scale up timetrap timeout values
- automatically, e.g. if tools such as cover or trace are running during
- the test. This feature is disabled by default and can be enabled with
- the <c>scale_timetraps</c> start option.</p>
+ startup with the <c>multiply_timetraps</c> option. It is also possible
+ to let the test server decide to scale up timetrap timeout values
+ automatically, e.g. if tools such as cover or trace are running during
+ the test. This feature is disabled by default and can be enabled with
+ the <c>scale_timetraps</c> start option.</p>
+
<p>If a test case needs to suspend itself for a time that also gets
- multipled by <c>multiply_timetraps</c>, and possibly scaled up if
- <c>scale_timetraps</c> is enabled, the function <c>ct:sleep/1</c>
- may be called.</p>
- <p>A function (<c>fun</c> or <c>MFA</c>) may be specified as timetrap value
- in the suite- and test case info function, e.g:</p>
- <p><c>{timetrap,{test_utils,get_timetrap_value,[?MODULE,system_start]}}</c></p>
- <p>The function will be called initially by Common Test (before execution
- of the suite or the test case) and must return a time value such as an
- integer (millisec), or a <c>{SecMinOrHourTag,Time}</c> tuple. More
- information can be found in the <c>common_test</c> reference manual.</p>
+ multipled by <c>multiply_timetraps</c> (and possibly also scaled up if
+ <c>scale_timetraps</c> is enabled), the function <c><seealso marker="ct#sleep-1">ct:sleep/1</seealso></c>
+ may be used (instead of e.g. <c>timer:sleep/1</c>).</p>
+
+ <p>A function (<c>fun/0</c> or <c>MFA</c>) may be specified as
+ timetrap value in the suite-, group- and test case info function, as
+ well as argument to the <c><seealso marker="ct#timetrap-1">ct:timetrap/1</seealso></c> function. Examples:</p>
+
+ <p><c>{timetrap,{my_test_utils,timetrap,[?MODULE,system_start]}}</c></p>
+ <p><c>ct:timetrap(fun() -> my_timetrap(TestCaseName, Config) end)</c></p>
+
+ <p>The user timetrap function may be used for two things:</p>
+ <list>
+ <item>To act as a timetrap - the timeout is triggered when the
+ function returns.</item>
+ <item>To return a timetrap time value (other than a function).</item>
+ </list>
+ <p>Before execution of the timetrap function (which is performed
+ on a parallel, dedicated timetrap process), Common Test cancels
+ any previously set timer for the test case or configuration function.
+ When the timetrap function returns, the timeout is triggered, <em>unless</em>
+ the return value is a valid timetrap time, such as an integer,
+ or a <c>{SecMinOrHourTag,Time}</c> tuple (see the
+ <seealso marker="common_test">common_test reference manual</seealso> for
+ details). If a time value is returned, a new timetrap is started
+ to generate a timeout after the specified time.</p>
+
+ <p>The user timetrap function may of course return a time value after a delay,
+ and if so, the effective timetrap time is the delay time <em>plus</em> the
+ returned time.</p>
</section>
<section>
+ <marker id="logging"></marker>
+ <title>Logging - categories and verbosity levels</title>
+ <p>Common Test provides three main functions for printing strings:</p>
+ <list>
+ <item><c>ct:log(Category, Importance, Format, Args)</c></item>
+ <item><c>ct:print(Category, Importance, Format, Args)</c></item>
+ <item><c>ct:pal(Category, Importance, Format, Args)</c></item>
+ </list>
+ <p>The <c>log/1/2/3/4</c> function will print a string to the test case
+ log file. The <c>print/1/2/3/4</c> function will print the string to screen,
+ and the <c>pal/1/2/3/4</c> function will print the same string both to file and
+ screen. (The functions are documented in the <c>ct</c> reference manual).</p>
+
+ <p>The optional <c>Category</c> argument may be used to categorize the
+ log printout, and categories can be used for two things:</p>
+ <list>
+ <item>To compare the importance of the printout to a specific
+ verbosity level, and</item>
+ <item>to format the printout according to a user specific HTML
+ Style Sheet (CSS).</item>
+ </list>
+
+ <p>The <c>Importance</c> argument specifies a level of importance
+ which, compared to a verbosity level (general and/or set per category),
+ determines if the printout should be visible or not. <c>Importance</c>
+ is an arbitrary integer in the range 0..99. Pre-defined constants
+ exist in the <c>ct.hrl</c> header file. The default importance level,
+ <c>?STD_IMPORTANCE</c> (used if the <c>Importance</c> argument is not
+ provided), is 50. This is also the importance used for standard IO, e.g.
+ from printouts made with <c>io:format/2</c>, <c>io:put_chars/1</c>, etc.</p>
+
+ <p><c>Importance</c> is compared to a verbosity level set by means of the
+ <c>verbosity</c> start flag/option. The verbosity level can be set per
+ category and/or generally. The default verbosity level, <c>?STD_VERBOSITY</c>,
+ is 50, i.e. all standard IO gets printed. If a lower verbosity level is set,
+ standard IO printouts will be ignored. Common Test performs the following test:</p>
+ <pre>Importance >= (100-VerbosityLevel)</pre>
+ <p>This also means that verbosity level 0 effectively turns all logging off
+ (with the exception of printouts made by Common Test itself).</p>
+
+ <p>The general verbosity level is not associated with any particular
+ category. This level sets the threshold for the standard IO printouts,
+ uncategorized <c>ct:log/print/pal</c> printouts, as well as
+ printouts for categories with undefined verbosity level.</p>
+
+ <p>Example:</p>
+ <pre>
+
+ Some printouts during test case execution:
+
+ io:format("1. Standard IO, importance = ~w~n", [?STD_IMPORTANCE]),
+ ct:log("2. Uncategorized, importance = ~w", [?STD_IMPORTANCE]),
+ ct:log(info, "3. Categorized info, importance = ~w", [?STD_IMPORTANCE]]),
+ ct:log(info, ?LOW_IMPORTANCE, "4. Categorized info, importance = ~w", [?LOW_IMPORTANCE]),
+ ct:log(error, "5. Categorized error, importance = ~w", [?HI_IMPORTANCE]),
+ ct:log(error, ?HI_IMPORTANCE, "6. Categorized error, importance = ~w", [?MAX_IMPORTANCE]),
+
+ If starting the test without specifying any verbosity levels:
+
+ $ ct_run ...
+
+ the following gets printed:
+
+ 1. Standard IO, importance = 50
+ 2. Uncategorized, importance = 50
+ 3. Categorized info, importance = 50
+ 5. Categorized error, importance = 75
+ 6. Categorized error, importance = 99
+
+ If starting the test with:
+
+ $ ct_run -verbosity 1 and info 75
+
+ the following gets printed:
+
+ 3. Categorized info, importance = 50
+ 4. Categorized info, importance = 25
+ 6. Categorized error, importance = 99
+ </pre>
+
+ <p>How categories can be mapped to CSS tags is documented in the
+ <seealso marker="run_test_chapter#html_stylesheet">Running Tests</seealso>
+ chapter.</p>
+
+ <p>The <c>Format</c> and <c>Args</c> arguments in <c>ct:log/print/pal</c> are
+ always passed on to the <c>io:format/3</c> function in <c>stdlib</c>
+ (please see the <c>io</c> manual page for details).</p>
+
+ <p>For more information about log files, please see the
+ <seealso marker="run_test_chapter#log_files">Running Tests</seealso> chapter.</p>
+ </section>
+
+ <section>
<title>Illegal dependencies</title>
<p>Even though it is highly efficient to write test suites with
@@ -845,7 +1037,6 @@
Erlang/OTP test suites.</p>
<list>
-
<item>Depending on current directory, and writing there:<br></br>
<p>This is a common error in test suites. It is assumed that
@@ -857,19 +1048,10 @@
</p>
</item>
- <item>Depending on the Clearcase (file version control system)
- paths and files:<br></br>
-
- <p>The test suites are stored in Clearcase but are not
- (necessarily) run within this environment. The directory
- structure may vary from test run to test run.
- </p>
- </item>
-
<item>Depending on execution order:<br></br>
- <p>During development of test suites, no assumption should be made
- (preferrably) about the execution order of the test cases or suites.
+ <p>During development of test suites, no assumption should preferrably
+ be made about the execution order of the test cases or suites.
E.g. a test case should not assume that a server it depends on,
has already been started by a previous test case. There are
several reasons for this:
diff --git a/lib/common_test/include/ct.hrl b/lib/common_test/include/ct.hrl
index 5a77108e1a..bde2709ad1 100644
--- a/lib/common_test/include/ct.hrl
+++ b/lib/common_test/include/ct.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -19,3 +19,16 @@
-include_lib("test_server/include/test_server.hrl").
+%% the log level is used as argument to any CT logging function
+-define(MIN_IMPORTANCE, 0 ).
+-define(LOW_IMPORTANCE, 25).
+-define(STD_IMPORTANCE, 50).
+-define(HI_IMPORTANCE, 75).
+-define(MAX_IMPORTANCE, 99).
+
+%% verbosity thresholds to filter out logging printouts
+-define(MIN_VERBOSITY, 0 ). %% turn logging off
+-define(LOW_VERBOSITY, 25 ).
+-define(STD_VERBOSITY, 50 ).
+-define(HI_VERBOSITY, 75 ).
+-define(MAX_VERBOSITY, 100).
diff --git a/lib/common_test/priv/Makefile.in b/lib/common_test/priv/Makefile.in
index d9033f6ef1..4372ab124e 100644
--- a/lib/common_test/priv/Makefile.in
+++ b/lib/common_test/priv/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2011. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -60,6 +60,7 @@ FILES = vts.tool
SCRIPTS =
IMAGES = tile1.jpg
CSS = ct_default.css
+JS = jquery-latest.js jquery.tablesorter.min.js
#
# Rules
@@ -85,12 +86,12 @@ include $(ERL_TOP)/make/otp_release_targets.mk
ifeq ($(XNIX),true)
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DATA) $(FILES) $(IMAGES) $(CSS) $(RELSYSDIR)/priv
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) $(FILES) $(IMAGES) $(CSS) $(JS) "$(RELSYSDIR)/priv"
else
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DATA) $(FILES) $(IMAGES) $(CSS) $(RELSYSDIR)/priv
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) $(FILES) $(IMAGES) $(CSS) $(JS) "$(RELSYSDIR)/priv"
endif
release_docs_spec:
@@ -107,6 +108,7 @@ else
FILES = vts.tool
IMAGES = tile1.jpg
CSS = ct_default.css
+JS = jquery-latest.js jquery.tablesorter.min.js
#
# Rules
@@ -125,8 +127,8 @@ clean:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DATA) $(FILES) $(IMAGES) $(CSS) $(RELSYSDIR)/priv
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) $(FILES) $(IMAGES) $(CSS) $(JS) "$(RELSYSDIR)/priv"
release_docs_spec:
diff --git a/lib/common_test/priv/ct_default.css b/lib/common_test/priv/ct_default.css
index 75f8d5db8a..1188f8f676 100644
--- a/lib/common_test/priv/ct_default.css
+++ b/lib/common_test/priv/ct_default.css
@@ -81,13 +81,21 @@ div.copyright {
color: #000000;
}
-div.ct_internal {
+div.ct_internal {
background: lightgrey; color: black;
font-family: "Monaco", "Andale Mono", "Consolas", monospace;
font-size: .95em;
margin: .2em 0 0 0;
}
+div.ct_error_notify {
+ background: #CC0000;
+ color: #FFFFFF;
+ font-family: "Monaco", "Andale Mono", "Consolas", monospace;
+ font-size: 1.05em;
+ margin: .2em 0 0 0;
+}
+
div.default {
background: lightgreen; color: black;
font-family: "Monaco", "Andale Mono", "Consolas", monospace;
@@ -128,7 +136,18 @@ th {
}
thead th {
- background: #2C5755; text-align: center;
+ background: #3F3F3F; color: #fff;
+ font-family: arial, sans-serif; font-size: 120%;
+ letter-spacing: -0.5px;
+ font-weight: bold; text-align: center;
+ padding-right: .5em; vertical-align: top;
+ text-decoration: underline;
+}
+
+tfoot td {
+ font-family: arial, sans-serif; font-size: 110%;
+ letter-spacing: -0.5px;
+ font-weight: bold;
}
.odd td {
@@ -159,10 +178,6 @@ th a, td a:active {
color: #85ABD5;
}
-tfoot th, tfoot td {
- background: #3F3F3F; color: #fff;
-}
-
th + td {
padding-left: .5em;
}
diff --git a/lib/common_test/priv/jquery-latest.js b/lib/common_test/priv/jquery-latest.js
new file mode 100644
index 0000000000..ac7e7009dc
--- /dev/null
+++ b/lib/common_test/priv/jquery-latest.js
@@ -0,0 +1,154 @@
+/*!
+ * jQuery JavaScript Library v1.4.2
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Sat Feb 13 22:33:48 2010 -0500
+ */
+(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
+e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
+j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
+"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
+true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
+Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
+(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
+a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
+"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
+function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
+c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
+L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
+"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
+a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
+d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
+a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
+!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
+true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
+parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
+false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
+s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
+applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
+else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
+a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
+w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
+cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
+i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
+" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
+this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
+e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
+c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
+a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
+function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
+k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
+C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
+null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
+e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
+f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
+if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
+d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
+"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
+a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
+isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
+{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
+if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
+e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
+"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
+d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
+!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
+toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
+u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
+function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
+if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
+t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
+g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
+for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
+1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
+relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
+l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
+h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
+CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
+g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
+text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
+setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
+h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
+m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
+"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
+h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
+!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
+h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
+q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
+if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
+(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
+function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
+gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
+c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
+{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
+"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
+d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
+a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
+1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
+a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
+c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
+wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
+prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
+this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
+return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
+""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
+this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
+u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
+1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
+return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
+""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
+c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
+c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
+function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
+Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
+"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
+a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
+a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
+"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
+serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
+function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
+global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
+e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
+"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
+false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
+false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
+c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
+d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
+g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
+1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
+"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
+if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
+this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
+"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
+animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
+j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
+this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
+"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
+c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
+this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
+this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
+e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
+c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
+function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
+this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
+k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
+f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
+a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
+c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
+d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
+f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
+"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
+e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
diff --git a/lib/common_test/priv/jquery.tablesorter.min.js b/lib/common_test/priv/jquery.tablesorter.min.js
new file mode 100644
index 0000000000..b8605df1e7
--- /dev/null
+++ b/lib/common_test/priv/jquery.tablesorter.min.js
@@ -0,0 +1,4 @@
+
+(function($){$.extend({tablesorter:new
+function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}if(table.tBodies.length==0)return;var rows=table.tBodies[0].rows;if(rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter);}else if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter);}if(!p){p=detectParserForColumn(table,rows,-1,i);}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n";}list.push(p);}}if(table.config.debug){log(parsersDebug);}return list;};function detectParserForColumn(table,rows,rowIndex,cellIndex){var l=parsers.length,node=false,nodeValue=false,keepLooking=true;while(nodeValue==''&&keepLooking){rowIndex++;if(rows[rowIndex]){node=getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex);nodeValue=trimAndGetNodeText(table.config,node);if(table.config.debug){log('Checking if value was empty on row:'+rowIndex);}}else{keepLooking=false;}}for(var i=1;i<l;i++){if(parsers[i].is(nodeValue,table,node)){return parsers[i];}}return parsers[0];}function getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex){return rows[rowIndex].cells[cellIndex];}function trimAndGetNodeText(config,node){return $.trim(getElementText(config,node));}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i];}}return false;}function buildCache(table){if(table.config.debug){var cacheTime=new Date();}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=$(table.tBodies[0].rows[i]),cols=[];if(c.hasClass(table.config.cssChildRow)){cache.row[cache.row.length-1]=cache.row[cache.row.length-1].add(c);continue;}cache.row.push(c);for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c[0].cells[j]),table,c[0].cells[j]));}cols.push(cache.normalized.length);cache.normalized.push(cols);cols=null;};if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime);}return cache;};function getElementText(config,node){var text="";if(!node)return"";if(!config.supportsTextContent)config.supportsTextContent=node.textContent||false;if(config.textExtraction=="simple"){if(config.supportsTextContent){text=node.textContent;}else{if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){text=node.childNodes[0].innerHTML;}else{text=node.innerHTML;}}}else{if(typeof(config.textExtraction)=="function"){text=config.textExtraction(node);}else{text=$(node).text();}}return text;}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){var pos=n[i][checkCell];rows.push(r[pos]);if(!table.config.appender){var l=r[pos].length;for(var j=0;j<l;j++){tableBody[0].appendChild(r[pos][j]);}}}if(table.config.appender){table.config.appender(table,rows);}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime);}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd");},0);};function buildHeaders(table){if(table.config.debug){var time=new Date();}var meta=($.metadata)?true:false;var header_index=computeTableHeaderCellIndexes(table);$tableHeaders=$(table.config.selectorHeaders,table).each(function(index){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(table.config.sortInitialOrder);this.count=this.order;if(checkHeaderMetadata(this)||checkHeaderOptions(table,index))this.sortDisabled=true;if(checkHeaderOptionsSortingLocked(table,index))this.order=this.lockedOrder=checkHeaderOptionsSortingLocked(table,index);if(!this.sortDisabled){var $th=$(this).addClass(table.config.cssHeader);if(table.config.onRenderHeader)table.config.onRenderHeader.apply($th);}table.config.headerList[index]=this;});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders);}return $tableHeaders;};function computeTableHeaderCellIndexes(t){var matrix=[];var lookup={};var thead=t.getElementsByTagName('THEAD')[0];var trs=thead.getElementsByTagName('TR');for(var i=0;i<trs.length;i++){var cells=trs[i].cells;for(var j=0;j<cells.length;j++){var c=cells[j];var rowIndex=c.parentNode.rowIndex;var cellId=rowIndex+"-"+c.cellIndex;var rowSpan=c.rowSpan||1;var colSpan=c.colSpan||1
+var firstAvailCol;if(typeof(matrix[rowIndex])=="undefined"){matrix[rowIndex]=[];}for(var k=0;k<matrix[rowIndex].length+1;k++){if(typeof(matrix[rowIndex][k])=="undefined"){firstAvailCol=k;break;}}lookup[cellId]=firstAvailCol;for(var k=rowIndex;k<rowIndex+rowSpan;k++){if(typeof(matrix[k])=="undefined"){matrix[k]=[];}var matrixrow=matrix[k];for(var l=firstAvailCol;l<firstAvailCol+colSpan;l++){matrixrow[l]="x";}}}}return lookup;}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function checkHeaderOptionsSortingLocked(table,i){if((table.config.headers[i])&&(table.config.headers[i].lockedOrder))return table.config.headers[i].lockedOrder;return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table);}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i];}}};function formatSortingOrder(v){if(typeof(v)!="Number"){return(v.toLowerCase()=="desc")?1:0;}else{return(v==1)?1:0;}}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true;}}return false;}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this);}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]]);}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$('<colgroup>');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('<col>').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++;}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date();}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(table.config.parsers[c].type=="text")?((order==0)?makeSortFunction("text","asc",c):makeSortFunction("text","desc",c)):((order==0)?makeSortFunction("numeric","asc",c):makeSortFunction("numeric","desc",c));var e="e"+i;dynamicExp+="var "+e+" = "+s;dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { ";}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; ";}dynamicExp+="return 0; ";dynamicExp+="}; ";if(table.config.debug){benchmark("Evaling expression:"+dynamicExp,new Date());}eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime);}return cache;};function makeSortFunction(type,direction,index){var a="a["+index+"]",b="b["+index+"]";if(type=='text'&&direction=='asc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+a+" < "+b+") ? -1 : 1 )));";}else if(type=='text'&&direction=='desc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+b+" < "+a+") ? -1 : 1 )));";}else if(type=='numeric'&&direction=='asc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+a+" - "+b+"));";}else if(type=='numeric'&&direction=='desc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+b+" - "+a+"));";}};function makeSortText(i){return"((a["+i+"] < b["+i+"]) ? -1 : ((a["+i+"] > b["+i+"]) ? 1 : 0));";};function makeSortTextDesc(i){return"((b["+i+"] < a["+i+"]) ? -1 : ((b["+i+"] > a["+i+"]) ? 1 : 0));";};function makeSortNumeric(i){return"a["+i+"]-b["+i+"];";};function makeSortNumericDesc(i){return"b["+i+"]-a["+i+"];";};function sortText(a,b){if(table.config.sortLocaleCompare)return a.localeCompare(b);return((a<b)?-1:((a>b)?1:0));};function sortTextDesc(a,b){if(table.config.sortLocaleCompare)return b.localeCompare(a);return((b<a)?-1:((b>a)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){$this.trigger("sortStart");var $cell=$(this);var i=this.column;this.order=this.count++%2;if(this.lockedOrder)this.order=this.lockedOrder;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j]);}}}config.sortList.push([i,this.order]);}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2;}}}else{config.sortList.push([i,this.order]);}};setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache));},1);return false;}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false;}});$this.bind("update",function(){var me=this;setTimeout(function(){me.config.parsers=buildParserCache(me,$headers);cache=buildCache(me);},1);}).bind("updateCell",function(e,cell){var config=this.config;var pos=[(cell.parentNode.rowIndex-1),cell.cellIndex];cache.normalized[pos[0]][pos[1]]=config.parsers[pos[1]].format(getElementText(config,cell),cell);}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache));}).bind("appendCache",function(){appendToTable(this,cache);}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this);}).bind("applyWidgets",function(){applyWidget(this);});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist;}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false;}}if(a){parsers.push(parser);};};this.addWidget=function(widget){widgets.push(widget);};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i;};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i;};this.isDigit=function(s,config){return/^[-+]?\d*$/.test($.trim(s.replace(/[,.']/g,'')));};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild)this.removeChild(this.firstChild);}empty.apply(table.tBodies[0]);}else{table.tBodies[0].innerHTML="";}};}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true;},format:function(s){return $.trim(s.toLocaleLowerCase());},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c);},format:function(s){return $.tablesorter.formatFloat(s);},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$€?.]/.test(s);},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[£$€]/g),""));},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item;}else{r+=item;}}return $.tablesorter.formatFloat(r);},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s);},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0");},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s));},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2");}else if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");}else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");}return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime());},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false;},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(cell).metadata()[p];},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date();}var $tr,row=-1,odd;$("tr:visible",table.tBodies[0]).each(function(i){$tr=$(this);if(!$tr.hasClass(table.config.cssChildRow))row++;odd=(row%2==0);$tr.removeClass(table.config.widgetZebra.css[odd?0:1]).addClass(table.config.widgetZebra.css[odd?1:0])});if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time);}}});})(jQuery); \ No newline at end of file
diff --git a/lib/common_test/src/Makefile b/lib/common_test/src/Makefile
index 125aa828fb..f7dce195d7 100644
--- a/lib/common_test/src/Makefile
+++ b/lib/common_test/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2011. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -69,14 +69,19 @@ MODULES= \
ct_slave \
ct_hooks\
ct_hooks_lock\
- cth_log_redirect
+ cth_log_redirect\
+ cth_surefire \
+ ct_netconfc \
+ ct_conn_log_h \
+ cth_conn_log
TARGET_MODULES= $(MODULES:%=$(EBIN)/%)
BEAM_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR))
ERL_FILES= $(MODULES:=.erl)
HRL_FILES = \
- ct_util.hrl
+ ct_util.hrl \
+ ct_netconfc.hrl
EXTERNAL_HRL_FILES = \
../include/ct.hrl \
../include/ct_event.hrl
@@ -132,12 +137,12 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(EXTERNAL_HRL_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(EXTERNAL_HRL_FILES) "$(RELSYSDIR)/include"
release_tests_spec: opt
$(INSTALL_DIR) $(RELEASE_PATH)/common_test_test
diff --git a/lib/common_test/src/common_test.app.src b/lib/common_test/src/common_test.app.src
index 7fba484b18..18c1dec784 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -25,12 +25,16 @@
ct_framework,
ct_ftp,
ct_gen_conn,
+ ct_hooks,
+ ct_hooks_lock,
ct_logs,
ct_make,
ct_master,
ct_master_event,
ct_master_logs,
ct_master_status,
+ ct_netconfc,
+ ct_conn_log_h,
ct_repeat,
ct_rpc,
ct_run,
@@ -45,7 +49,10 @@
ct_config,
ct_config_plain,
ct_config_xml,
- ct_slave
+ ct_slave,
+ cth_log_redirect,
+ cth_conn_log,
+ cth_surefire
]},
{registered, [ct_logs,
ct_util_server,
diff --git a/lib/common_test/src/ct.erl b/lib/common_test/src/ct.erl
index e0e82283c4..5014309c0f 100644
--- a/lib/common_test/src/ct.erl
+++ b/lib/common_test/src/ct.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -25,24 +25,24 @@
%%%
%%% <p><strong>Test Suite Support Macros</strong></p>
%%%
-%%% <p>The <code>config</code> macro is defined in <code>ct.hrl</code>. This
+%%% <p>The <c>config</c> macro is defined in <c>ct.hrl</c>. This
%%% macro should be used to retrieve information from the
-%%% <code>Config</code> variable sent to all test cases. It is used with two
+%%% <c>Config</c> variable sent to all test cases. It is used with two
%%% arguments, where the first is the name of the configuration
-%%% variable you wish to retrieve, and the second is the <code>Config</code>
+%%% variable you wish to retrieve, and the second is the <c>Config</c>
%%% variable supplied to the test case.</p>
%%%
%%% <p>Possible configuration variables include:</p>
%%% <ul>
-%%% <li><code>data_dir</code> - Data file directory.</li>
-%%% <li><code>priv_dir</code> - Scratch file directory.</li>
-%%% <li>Whatever added by <code>init_per_suite/1</code> or
-%%% <code>init_per_testcase/2</code> in the test suite.</li>
+%%% <li><c>data_dir</c> - Data file directory.</li>
+%%% <li><c>priv_dir</c> - Scratch file directory.</li>
+%%% <li>Whatever added by <c>init_per_suite/1</c> or
+%%% <c>init_per_testcase/2</c> in the test suite.</li>
%%% </ul>
%%% @type var_name() = atom(). A variable name which is specified when
-%%% <code>ct:require/2</code> is called,
-%%% e.g. <code>ct:require(mynodename,{node,[telnet]})</code>
+%%% <c>ct:require/2</c> is called,
+%%% e.g. <c>ct:require(mynodename,{node,[telnet]})</c>
%%%
%%% @type target_name() = var_name(). The name of a target.
%%%
@@ -51,6 +51,8 @@
-module(ct).
+-include("ct.hrl").
+
%% Command line user interface for running tests
-export([install/1, run/1, run/2, run/3,
run_test/1, run_testspec/1, step/3, step/4,
@@ -60,13 +62,15 @@
-export([require/1, require/2,
get_config/1, get_config/2, get_config/3,
reload_config/1,
- log/1, log/2, log/3,
- print/1, print/2, print/3,
- pal/1, pal/2, pal/3,
+ log/1, log/2, log/3, log/4,
+ print/1, print/2, print/3, print/4,
+ pal/1, pal/2, pal/3, pal/4,
capture_start/0, capture_stop/0, capture_get/0, capture_get/1,
- fail/1, fail/2, comment/1, comment/2,
+ fail/1, fail/2, comment/1, comment/2, make_priv_dir/0,
testcases/2, userdata/2, userdata/3,
- timetrap/1, get_timetrap_info/0, sleep/1]).
+ timetrap/1, get_timetrap_info/0, sleep/1,
+ notify/2, sync_notify/2,
+ break/1, break/2, continue/0, continue/1]).
%% New API for manipulating with config handlers
-export([add_config/2, remove_config/2]).
@@ -95,10 +99,10 @@
%%% <p>Run this function once before first test.</p>
%%%
%%% <p>Example:<br/>
-%%% <code>install([{config,["config_node.ctc","config_user.ctc"]}])</code>.</p>
+%%% <c>install([{config,["config_node.ctc","config_user.ctc"]}])</c>.</p>
%%%
%%% <p>Note that this function is automatically run by the
-%%% <code>ct_run</code> program.</p>
+%%% <c>ct_run</c> program.</p>
install(Opts) ->
ct_run:install(Opts).
@@ -111,10 +115,10 @@ install(Opts) ->
%%%
%%% @doc Run the given test case(s).
%%%
-%%% <p>Requires that <code>ct:install/1</code> has been run first.</p>
+%%% <p>Requires that <c>ct:install/1</c> has been run first.</p>
%%%
%%% <p>Suites (*_SUITE.erl) files must be stored in
-%%% <code>TestDir</code> or <code>TestDir/test</code>. All suites
+%%% <c>TestDir</c> or <c>TestDir/test</c>. All suites
%%% will be compiled when test is run.</p>
run(TestDir,Suite,Cases) ->
ct_run:run(TestDir,Suite,Cases).
@@ -146,11 +150,14 @@ run(TestDirs) ->
%%% {silent_connections,Conns} | {stylesheet,CSSFile} |
%%% {cover,CoverSpecFile} | {step,StepOpts} |
%%% {event_handler,EventHandlers} | {include,InclDirs} |
-%%% {auto_compile,Bool} | {multiply_timetraps,M} | {scale_timetraps,Bool} |
+%%% {auto_compile,Bool} | {create_priv_dir,CreatePrivDir} |
+%%% {multiply_timetraps,M} | {scale_timetraps,Bool} |
%%% {repeat,N} | {duration,DurTime} | {until,StopTime} |
%%% {force_stop,Bool} | {decrypt,DecryptKeyOrFile} |
-%%% {refresh_logs,LogDir} | {logopts,LogOpts} | {basic_html,Bool} |
-%%% {ct_hooks, CTHs} | {enable_builtin_hooks,Bool}
+%%% {refresh_logs,LogDir} | {logopts,LogOpts} |
+%%% {verbosity,VLevels} | {basic_html,Bool} |
+%%% {ct_hooks, CTHs} | {enable_builtin_hooks,Bool} |
+%%% {release_shell,Bool}
%%% TestDirs = [string()] | string()
%%% Suites = [string()] | [atom()] | string() | atom()
%%% Cases = [atom()] | atom()
@@ -171,6 +178,7 @@ run(TestDirs) ->
%%% EH = atom() | {atom(),InitArgs} | {[atom()],InitArgs}
%%% InitArgs = [term()]
%%% InclDirs = [string()] | string()
+%%% CreatePrivDir = auto_per_run | auto_per_tc | manual_per_tc
%%% M = integer()
%%% N = integer()
%%% DurTime = string(HHMMSS)
@@ -180,26 +188,45 @@ run(TestDirs) ->
%%% DecryptFile = string()
%%% LogOpts = [LogOpt]
%%% LogOpt = no_nl | no_src
+%%% VLevels = VLevel | [{Category,VLevel}]
+%%% VLevel = integer()
+%%% Category = atom()
%%% CTHs = [CTHModule | {CTHModule, CTHInitArgs}]
%%% CTHModule = atom()
%%% CTHInitArgs = term()
-%%% Result = [TestResult] | {error,Reason}
-%%% @doc Run tests as specified by the combination of options in <code>Opts</code>.
+%%% Result = {Ok,Failed,{UserSkipped,AutoSkipped}} | TestRunnerPid | {error,Reason}
+%%% Ok = integer()
+%%% Failed = integer()
+%%% UserSkipped = integer()
+%%% AutoSkipped = integer()
+%%% TestRunnerPid = pid()
+%%% Reason = term()
+%%% @doc <p>Run tests as specified by the combination of options in <c>Opts</c>.
%%% The options are the same as those used with the
-%%% <seealso marker="ct_run#ct_run"><code>ct_run</code></seealso> program.
-%%% Note that here a <code>TestDir</code> can be used to point out the path to
-%%% a <code>Suite</code>. Note also that the option <code>testcase</code>
-%%% corresponds to the <code>-case</code> option in the <code>ct_run</code>
-%%% program. Configuration files specified in <code>Opts</code> will be
-%%% installed automatically at startup.
+%%% <seealso marker="ct_run#ct_run"><c>ct_run</c></seealso> program.
+%%% Note that here a <c>TestDir</c> can be used to point out the path to
+%%% a <c>Suite</c>. Note also that the option <c>testcase</c>
+%%% corresponds to the <c>-case</c> option in the <c>ct_run</c>
+%%% program. Configuration files specified in <c>Opts</c> will be
+%%% installed automatically at startup.</p>
+%%% <p><c>TestRunnerPid</c> is returned if <c>release_shell == true</c>
+%%% (see <c>break/1</c> for details).</p>
+%%% <p><c>Reason</c> indicates what type of error has been encountered.</p>
run_test(Opts) ->
ct_run:run_test(Opts).
%%%-----------------------------------------------------------------
%%% @spec run_testspec(TestSpec) -> Result
%%% TestSpec = [term()]
-%%% @doc Run test specified by <code>TestSpec</code>. The terms are
+%%% Result = {Ok,Failed,{UserSkipped,AutoSkipped}} | {error,Reason}
+%%% Ok = integer()
+%%% Failed = integer()
+%%% UserSkipped = integer()
+%%% AutoSkipped = integer()
+%%% Reason = term()
+%%% @doc Run test specified by <c>TestSpec</c>. The terms are
%%% the same as those used in test specification files.
+%%% <p><c>Reason</c> indicates what type of error has been encountered.</p>
run_testspec(TestSpec) ->
ct_run:run_testspec(TestSpec).
@@ -219,8 +246,8 @@ step(TestDir,Suite,Case) ->
%%% Opt = config | keep_inactive
%%%
%%% @doc Step through a test case with the debugger. If the
-%%% <code>config</code> option has been given, breakpoints will
-%%% be set also on the configuration functions in <code>Suite</code>.
+%%% <c>config</c> option has been given, breakpoints will
+%%% be set also on the configuration functions in <c>Suite</c>.
%%% @see run/3
step(TestDir,Suite,Case,Opts) ->
ct_run:step(TestDir,Suite,Case,Opts).
@@ -232,22 +259,23 @@ step(TestDir,Suite,Case,Opts) ->
%%%
%%% <p>From this mode all test case support functions can be executed
%%% directly from the erlang shell. The interactive mode can also be
-%%% started from the OS command line with <code>ct_run -shell
-%%% [-config File...]</code>.</p>
+%%% started from the OS command line with <c>ct_run -shell
+%%% [-config File...]</c>.</p>
%%%
%%% <p>If any functions using "required config data" (e.g. telnet or
%%% ftp functions) are to be called from the erlang shell, config data
-%%% must first be required with <code>ct:require/2</code>.</p>
+%%% must first be required with <c>ct:require/2</c>.</p>
%%%
%%% <p>Example:<br/>
-%%% <code>&gt; ct:require(unix_telnet, unix).</code><br/>
-%%% <code>ok</code><br/>
-%%% <code>&gt; ct_telnet:open(unix_telnet).</code><br/>
-%%% <code>{ok,&lt;0.105.0&gt;}</code><br/>
-%%% <code>&gt; ct_telnet:cmd(unix_telnet, "ls .").</code><br/>
-%%% <code>{ok,["ls","file1 ...",...]}</code></p>
+%%% <c>&gt; ct:require(unix_telnet, unix).</c><br/>
+%%% <c>ok</c><br/>
+%%% <c>&gt; ct_telnet:open(unix_telnet).</c><br/>
+%%% <c>{ok,&lt;0.105.0&gt;}</c><br/>
+%%% <c>&gt; ct_telnet:cmd(unix_telnet, "ls .").</c><br/>
+%%% <c>{ok,["ls","file1 ...",...]}</c></p>
start_interactive() ->
- ct_util:start(interactive).
+ ct_util:start(interactive),
+ ok.
%%%-----------------------------------------------------------------
%%% @spec stop_interactive() -> ok
@@ -255,7 +283,8 @@ start_interactive() ->
%%% @doc Exit the interactive mode.
%%% @see start_interactive/0
stop_interactive() ->
- ct_util:stop(normal).
+ ct_util:stop(normal),
+ ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% MISC INTERFACE
@@ -263,27 +292,34 @@ stop_interactive() ->
%%%-----------------------------------------------------------------
%%% @spec require(Required) -> ok | {error,Reason}
-%%% Required = Key | {Key,SubKeys}
+%%% Required = Key | {Key,SubKeys} | {Key,SubKey,SubKeys}
%%% Key = atom()
%%% SubKeys = SubKey | [SubKey]
%%% SubKey = atom()
%%%
-%%% @doc Check if the required configuration is available.
+%%% @doc Check if the required configuration is available. It is possible
+%%% to specify arbitrarily deep tuples as <c>Required</c>. Note that it is
+%%% only the last element of the tuple which can be a list of <c>SubKey</c>s.
%%%
-%%% <p>Example: require the variable <code>myvar</code>:<br/>
-%%% <code>ok = ct:require(myvar)</code></p>
+%%% <p>Example 1: require the variable <c>myvar</c>:</p>
+%%% <pre>ok = ct:require(myvar).</pre>
%%%
%%% <p>In this case the config file must at least contain:</p>
-%%% <pre>
-%%% {myvar,Value}.</pre>
+%%% <pre>{myvar,Value}.</pre>
%%%
-%%% <p>Example: require the variable <code>myvar</code> with
-%%% subvariable <code>sub1</code>:<br/>
-%%% <code>ok = ct:require({myvar,sub1})</code></p>
+%%% <p>Example 2: require the key <c>myvar</c> with
+%%% subkeys <c>sub1</c> and <c>sub2</c>:</p>
+%%% <pre>ok = ct:require({myvar,[sub1,sub2]}).</pre>
%%%
%%% <p>In this case the config file must at least contain:</p>
-%%% <pre>
-%%% {myvar,[{sub1,Value}]}.</pre>
+%%% <pre>{myvar,[{sub1,Value},{sub2,Value}]}.</pre>
+%%%
+%%% <p>Example 3: require the key <c>myvar</c> with
+%%% subkey <c>sub1</c> with <c>subsub1</c>:</p>
+%%% <pre>ok = ct:require({myvar,sub1,sub2}).</pre>
+%%%
+%%% <p>In this case the config file must at least contain:</p>
+%%% <pre>{myvar,[{sub1,[{sub2,Value}]}]}.</pre>
%%%
%%% @see require/2
%%% @see get_config/1
@@ -295,30 +331,36 @@ require(Required) ->
%%%-----------------------------------------------------------------
%%% @spec require(Name,Required) -> ok | {error,Reason}
%%% Name = atom()
-%%% Required = Key | {Key,SubKeys}
+%%% Required = Key | {Key,SubKey} | {Key,SubKey,SubKey}
+%%% SubKey = Key
%%% Key = atom()
-%%% SubKeys = SubKey | [SubKey]
-%%% SubKey = atom()
%%%
%%% @doc Check if the required configuration is available, and give it
-%%% a name.
+%%% a name. The semantics for <c>Required</c> is the same as in
+%%% <c>required/1</c> except that it is not possible to specify a list
+%%% of <c>SubKey</c>s.
%%%
-%%% <p>If the requested data is available, the main entry will be
-%%% associated with <code>Name</code> so that the value of the element
-%%% can be read with <code>get_config/1,2</code> provided
-%%% <code>Name</code> instead of the <code>Key</code>.</p>
+%%% <p>If the requested data is available, the sub entry will be
+%%% associated with <c>Name</c> so that the value of the element
+%%% can be read with <c>get_config/1,2</c> provided
+%%% <c>Name</c> instead of the whole <c>Required</c> term.</p>
%%%
%%% <p>Example: Require one node with a telnet connection and an
-%%% ftp connection. Name the node <code>a</code>:<br/> <code>ok =
-%%% ct:require(a,{node,[telnet,ftp]}).</code><br/> All references
-%%% to this node may then use the node name. E.g. you can fetch a
-%%% file over ftp like this:<br/>
-%%% <code>ok = ct:ftp_get(a,RemoteFile,LocalFile).</code></p>
+%%% ftp connection. Name the node <c>a</c>:
+%%% <pre>ok = ct:require(a,{machine,node}).</pre>
+%%% All references to this node may then use the node name.
+%%% E.g. you can fetch a file over ftp like this:</p>
+%%% <pre>ok = ct:ftp_get(a,RemoteFile,LocalFile).</pre>
%%%
%%% <p>For this to work, the config file must at least contain:</p>
-%%% <pre>
-%%% {node,[{telnet,IpAddr},
-%%% {ftp,IpAddr}]}.</pre>
+%%% <pre>{machine,[{node,[{telnet,IpAddr},{ftp,IpAddr}]}]}.</pre>
+%%%
+%%% <note><p>The behaviour of this function changed radically in common_test
+%%% 1.6.2. In order too keep some backwards compatability it is still possible
+%%% to do: <br/><c>ct:require(a,{node,[telnet,ftp]}).</c><br/>
+%%% This will associate the name <c>a</c> with the top level <c>node</c> entry.
+%%% For this to work, the config file must at least contain:<br/>
+%%% <c>{node,[{telnet,IpAddr},{ftp,IpAddr}]}.</c></p></note>
%%%
%%% @see require/1
%%% @see get_config/1
@@ -341,7 +383,7 @@ get_config(Required,Default) ->
%%%-----------------------------------------------------------------
%%% @spec get_config(Required,Default,Opts) -> ValueOrElement
-%%% Required = KeyOrName | {KeyOrName,SubKey}
+%%% Required = KeyOrName | {KeyOrName,SubKey} | {KeyOrName,SubKey,SubKey}
%%% KeyOrName = atom()
%%% SubKey = atom()
%%% Default = term()
@@ -353,43 +395,41 @@ get_config(Required,Default) ->
%%%
%%% <p>This function returns the matching value(s) or config element(s),
%%% given a config variable key or its associated name
-%%% (if one has been specified with <code>require/2</code> or a
+%%% (if one has been specified with <c>require/2</c> or a
%%% require statement).</p>
%%%
%%% <p>Example, given the following config file:</p>
%%% <pre>
%%% {unix,[{telnet,IpAddr},
-%%% {username,Username},
-%%% {password,Password}]}.</pre>
-%%% <p><code>get_config(unix,Default) ->
+%%% {user,[{username,Username},
+%%% {password,Password}]}]}.</pre>
+%%% <p><c>ct:get_config(unix,Default) ->
%%% [{telnet,IpAddr},
-%%% {username,Username},
-%%% {password,Password}]</code><br/>
-%%% <code>get_config({unix,telnet},Default) -> IpAddr</code><br/>
-%%% <code>get_config({unix,ftp},Default) -> Default</code><br/>
-%%% <code>get_config(unknownkey,Default) -> Default</code></p>
+%%% {user, [{username,Username},
+%%% {password,Password}]}]</c><br/>
+%%% <c>ct:get_config({unix,telnet},Default) -> IpAddr</c><br/>
+%%% <c>ct:get_config({unix,user,username},Default) -> Username</c><br/>
+%%% <c>ct:get_config({unix,ftp},Default) -> Default</c><br/>
+%%% <c>ct:get_config(unknownkey,Default) -> Default</c></p>
%%%
%%% <p>If a config variable key has been associated with a name (by
-%%% means of <code>require/2</code> or a require statement), the name
+%%% means of <c>require/2</c> or a require statement), the name
%%% may be used instead of the key to read the value:</p>
%%%
-%%% <p><code>require(myhost,unix) -> ok</code><br/>
-%%% <code>get_config(myhost,Default) ->
-%%% [{telnet,IpAddr},
-%%% {username,Username},
-%%% {password,Password}]</code></p>
+%%% <p><c>ct:require(myuser,{unix,user}) -> ok.</c><br/>
+%%% <c>ct:get_config(myuser,Default) ->
+%%% [{username,Username},
+%%% {password,Password}]</c></p>
%%%
%%% <p>If a config variable is defined in multiple files and you want to
-%%% access all possible values, use the <code>all</code> option. The
+%%% access all possible values, use the <c>all</c> option. The
%%% values will be returned in a list and the order of the elements
%%% corresponds to the order that the config files were specified at
%%% startup.</p>
%%%
%%% <p>If you want config elements (key-value tuples) returned as result
-%%% instead of values, use the <code>element</code> option.
-%%% The returned elements will then be on the form <code>{KeyOrName,Value}</code>,
-%%% or (in case a subkey has been specified)
-%%% <code>{{KeyOrName,SubKey},Value}</code></p>
+%%% instead of values, use the <c>element</c> option.
+%%% The returned elements will then be on the form <c>{Required,Value}</c></p>
%%%
%%% @see get_config/1
%%% @see get_config/2
@@ -400,7 +440,7 @@ get_config(Required,Default,Opts) ->
%%%-----------------------------------------------------------------
%%% @spec reload_config(Required) -> ValueOrElement
-%%% Required = KeyOrName | {KeyOrName,SubKey}
+%%% Required = KeyOrName | {KeyOrName,SubKey} | {KeyOrName,SubKey,SubKey}
%%% KeyOrName = atom()
%%% SubKey = atom()
%%% ValueOrElement = term()
@@ -419,25 +459,41 @@ reload_config(Required)->
%%%-----------------------------------------------------------------
%%% @spec log(Format) -> ok
-%%% @equiv log(default,Format,[])
+%%% @equiv log(default,50,Format,[])
log(Format) ->
- log(default,Format,[]).
+ log(default,?STD_IMPORTANCE,Format,[]).
%%%-----------------------------------------------------------------
%%% @spec log(X1,X2) -> ok
-%%% X1 = Category | Format
+%%% X1 = Category | Importance | Format
%%% X2 = Format | Args
-%%% @equiv log(Category,Format,Args)
+%%% @equiv log(Category,Importance,Format,Args)
log(X1,X2) ->
- {Category,Format,Args} =
- if is_atom(X1) -> {X1,X2,[]};
- is_list(X1) -> {default,X1,X2}
+ {Category,Importance,Format,Args} =
+ if is_atom(X1) -> {X1,?STD_IMPORTANCE,X2,[]};
+ is_integer(X1) -> {default,X1,X2,[]};
+ is_list(X1) -> {default,?STD_IMPORTANCE,X1,X2}
+ end,
+ log(Category,Importance,Format,Args).
+
+%%%-----------------------------------------------------------------
+%%% @spec log(X1,X2,X3) -> ok
+%%% X1 = Category | Importance
+%%% X2 = Importance | Format
+%%% X3 = Format | Args
+%%% @equiv log(Category,Importance,Format,Args)
+log(X1,X2,X3) ->
+ {Category,Importance,Format,Args} =
+ if is_atom(X1), is_integer(X2) -> {X1,X2,X3,[]};
+ is_atom(X1), is_list(X2) -> {X1,?STD_IMPORTANCE,X2,X3};
+ is_integer(X1) -> {default,X1,X2,X3}
end,
- log(Category,Format,Args).
+ log(Category,Importance,Format,Args).
%%%-----------------------------------------------------------------
-%%% @spec log(Category,Format,Args) -> ok
+%%% @spec log(Category,Importance,Format,Args) -> ok
%%% Category = atom()
+%%% Importance = integer()
%%% Format = string()
%%% Args = list()
%%%
@@ -446,30 +502,52 @@ log(X1,X2) ->
%%% <p>This function is meant for printing a string directly from a
%%% test case to the test case log file.</p>
%%%
-%%% <p>Default <code>Category</code> is <code>default</code> and
-%%% default <code>Args</code> is <code>[]</code>.</p>
-log(Category,Format,Args) ->
- ct_logs:tc_log(Category,Format,Args).
+%%% <p>Default <c>Category</c> is <c>default</c>,
+%%% default <c>Importance</c> is <c>?STD_IMPORTANCE</c>,
+%%% and default value for <c>Args</c> is <c>[]</c>.</p>
+%%% <p>Please see the User's Guide for details on <c>Category</c>
+%%% and <c>Importance</c>.</p>
+log(Category,Importance,Format,Args) ->
+ ct_logs:tc_log(Category,Importance,Format,Args).
%%%-----------------------------------------------------------------
%%% @spec print(Format) -> ok
-%%% @equiv print(default,Format,[])
+%%% @equiv print(default,50,Format,[])
print(Format) ->
- print(default,Format,[]).
+ print(default,?STD_IMPORTANCE,Format,[]).
%%%-----------------------------------------------------------------
-%%% @equiv print(Category,Format,Args)
+%%% @spec print(X1,X2) -> ok
+%%% X1 = Category | Importance | Format
+%%% X2 = Format | Args
+%%% @equiv print(Category,Importance,Format,Args)
print(X1,X2) ->
- {Category,Format,Args} =
- if is_atom(X1) -> {X1,X2,[]};
- is_list(X1) -> {default,X1,X2}
+ {Category,Importance,Format,Args} =
+ if is_atom(X1) -> {X1,?STD_IMPORTANCE,X2,[]};
+ is_integer(X1) -> {default,X1,X2,[]};
+ is_list(X1) -> {default,?STD_IMPORTANCE,X1,X2}
end,
- print(Category,Format,Args).
+ print(Category,Importance,Format,Args).
%%%-----------------------------------------------------------------
-%%% @spec print(Category,Format,Args) -> ok
+%%% @spec print(X1,X2,X3) -> ok
+%%% X1 = Category | Importance
+%%% X2 = Importance | Format
+%%% X3 = Format | Args
+%%% @equiv print(Category,Importance,Format,Args)
+print(X1,X2,X3) ->
+ {Category,Importance,Format,Args} =
+ if is_atom(X1), is_integer(X2) -> {X1,X2,X3,[]};
+ is_atom(X1), is_list(X2) -> {X1,?STD_IMPORTANCE,X2,X3};
+ is_integer(X1) -> {default,X1,X2,X3}
+ end,
+ print(Category,Importance,Format,Args).
+
+%%%-----------------------------------------------------------------
+%%% @spec print(Category,Importance,Format,Args) -> ok
%%% Category = atom()
+%%% Importance = integer()
%%% Format = string()
%%% Args = list()
%%%
@@ -478,33 +556,52 @@ print(X1,X2) ->
%%% <p>This function is meant for printing a string from a test case
%%% to the console.</p>
%%%
-%%% <p>Default <code>Category</code> is <code>default</code> and
-%%% default <code>Args</code> is <code>[]</code>.</p>
-print(Category,Format,Args) ->
- ct_logs:tc_print(Category,Format,Args).
+%%% <p>Default <c>Category</c> is <c>default</c>,
+%%% default <c>Importance</c> is <c>?STD_IMPORTANCE</c>,
+%%% and default value for <c>Args</c> is <c>[]</c>.</p>
+%%% <p>Please see the User's Guide for details on <c>Category</c>
+%%% and <c>Importance</c>.</p>
+print(Category,Importance,Format,Args) ->
+ ct_logs:tc_print(Category,Importance,Format,Args).
%%%-----------------------------------------------------------------
%%% @spec pal(Format) -> ok
-%%% @equiv pal(default,Format,[])
+%%% @equiv pal(default,50,Format,[])
pal(Format) ->
- pal(default,Format,[]).
+ pal(default,?STD_IMPORTANCE,Format,[]).
%%%-----------------------------------------------------------------
%%% @spec pal(X1,X2) -> ok
-%%% X1 = Category | Format
+%%% X1 = Category | Importance | Format
%%% X2 = Format | Args
-%%% @equiv pal(Category,Format,Args)
+%%% @equiv pal(Category,Importance,Format,Args)
pal(X1,X2) ->
- {Category,Format,Args} =
- if is_atom(X1) -> {X1,X2,[]};
- is_list(X1) -> {default,X1,X2}
+ {Category,Importance,Format,Args} =
+ if is_atom(X1) -> {X1,?STD_IMPORTANCE,X2,[]};
+ is_integer(X1) -> {default,X1,X2,[]};
+ is_list(X1) -> {default,?STD_IMPORTANCE,X1,X2}
+ end,
+ pal(Category,Importance,Format,Args).
+
+%%%-----------------------------------------------------------------
+%%% @spec pal(X1,X2,X3) -> ok
+%%% X1 = Category | Importance
+%%% X2 = Importance | Format
+%%% X3 = Format | Args
+%%% @equiv pal(Category,Importance,Format,Args)
+pal(X1,X2,X3) ->
+ {Category,Importance,Format,Args} =
+ if is_atom(X1), is_integer(X2) -> {X1,X2,X3,[]};
+ is_atom(X1), is_list(X2) -> {X1,?STD_IMPORTANCE,X2,X3};
+ is_integer(X1) -> {default,X1,X2,X3}
end,
- pal(Category,Format,Args).
+ pal(Category,Importance,Format,Args).
%%%-----------------------------------------------------------------
-%%% @spec pal(Category,Format,Args) -> ok
+%%% @spec pal(Category,Importance,Format,Args) -> ok
%%% Category = atom()
+%%% Importance = integer()
%%% Format = string()
%%% Args = list()
%%%
@@ -513,10 +610,13 @@ pal(X1,X2) ->
%%% <p>This function is meant for printing a string from a test case,
%%% both to the test case log file and to the console.</p>
%%%
-%%% <p>Default <code>Category</code> is <code>default</code> and
-%%% default <code>Args</code> is <code>[]</code>.</p>
-pal(Category,Format,Args) ->
- ct_logs:tc_pal(Category,Format,Args).
+%%% <p>Default <c>Category</c> is <c>default</c>,
+%%% default <c>Importance</c> is <c>?STD_IMPORTANCE</c>,
+%%% and default value for <c>Args</c> is <c>[]</c>.</p>
+%%% <p>Please see the User's Guide for details on <c>Category</c>
+%%% and <c>Importance</c>.</p>
+pal(Category,Importance,Format,Args) ->
+ ct_logs:tc_pal(Category,Importance,Format,Args).
%%%-----------------------------------------------------------------
%%% @spec capture_start() -> ok
@@ -533,7 +633,7 @@ capture_start() ->
%%% @spec capture_stop() -> ok
%%%
%%% @doc Stop capturing text strings (a session started with
-%%% <code>capture_start/0</code>).
+%%% <c>capture_start/0</c>).
%%%
%%% @see capture_start/0
%%% @see capture_get/1
@@ -556,9 +656,9 @@ capture_get() ->
%%%
%%% @doc Return and purge the list of text strings buffered
%%% during the latest session of capturing printouts to stdout.
-%%% With <code>ExclCategories</code> it's possible to specify
-%%% log categories that should be ignored in <code>ListOfStrings</code>.
-%%% If <code>ExclCategories = []</code>, no filtering takes place.
+%%% With <c>ExclCategories</c> it's possible to specify
+%%% log categories that should be ignored in <c>ListOfStrings</c>.
+%%% If <c>ExclCategories = []</c>, no filtering takes place.
%%%
%%% @see capture_start/0
%%% @see capture_stop/0
@@ -583,10 +683,18 @@ capture_get([]) ->
%%% Reason = term()
%%%
%%% @doc Terminate a test case with the given error
-%%% <code>Reason</code>.
+%%% <c>Reason</c>.
fail(Reason) ->
- exit({test_case_failed,Reason}).
-
+ try
+ exit({test_case_failed,Reason})
+ catch
+ Class:R ->
+ case erlang:get_stacktrace() of
+ [{?MODULE,fail,1,_}|Stk] -> ok;
+ Stk -> ok
+ end,
+ erlang:raise(Class, R, Stk)
+ end.
%%%-----------------------------------------------------------------
%%% @spec fail(Format, Args) -> void()
@@ -595,26 +703,34 @@ fail(Reason) ->
%%%
%%% @doc Terminate a test case with an error message specified
%%% by a format string and a list of values (used as arguments to
-%%% <code>io_lib:format/2</code>).
+%%% <c>io_lib:format/2</c>).
fail(Format, Args) ->
try io_lib:format(Format, Args) of
Str ->
- exit({test_case_failed,lists:flatten(Str)})
+ try
+ exit({test_case_failed,lists:flatten(Str)})
+ catch
+ Class:R ->
+ case erlang:get_stacktrace() of
+ [{?MODULE,fail,2,_}|Stk] -> ok;
+ Stk -> ok
+ end,
+ erlang:raise(Class, R, Stk)
+ end
catch
_:BadArgs ->
exit({BadArgs,{?MODULE,fail,[Format,Args]}})
end.
-
%%%-----------------------------------------------------------------
%%% @spec comment(Comment) -> void()
%%% Comment = term()
%%%
-%%% @doc Print the given <code>Comment</code> in the comment field in
+%%% @doc Print the given <c>Comment</c> in the comment field in
%%% the table on the test suite result page.
%%%
%%% <p>If called several times, only the last comment is printed.
-%%% The test case return value <code>{comment,Comment}</code>
+%%% The test case return value <c>{comment,Comment}</c>
%%% overwrites the string set by this function.</p>
comment(Comment) when is_list(Comment) ->
Formatted =
@@ -637,10 +753,10 @@ comment(Comment) ->
%%% @doc Print the formatted string in the comment field in
%%% the table on the test suite result page.
%%%
-%%% <p>The <code>Format</code> and <code>Args</code> arguments are
-%%% used in call to <code>io_lib:format/2</code> in order to create
-%%% the comment string. The behaviour of <code>comment/2</code> is
-%%% otherwise the same as the <code>comment/1</code> function (see
+%%% <p>The <c>Format</c> and <c>Args</c> arguments are
+%%% used in call to <c>io_lib:format/2</c> in order to create
+%%% the comment string. The behaviour of <c>comment/2</c> is
+%%% otherwise the same as the <c>comment/1</c> function (see
%%% above for details).</p>
comment(Format, Args) when is_list(Format), is_list(Args) ->
Formatted =
@@ -657,6 +773,15 @@ send_html_comment(Comment) ->
ct_util:set_testdata({comment,Html}),
test_server:comment(Html).
+%%%-----------------------------------------------------------------
+%%% @spec make_priv_dir() -> ok | {error,Reason}
+%%% Reason = term()
+%%% @doc If the test has been started with the create_priv_dir
+%%% option set to manual_per_tc, in order for the test case to use
+%%% the private directory, it must first create it by calling
+%%% this function.
+make_priv_dir() ->
+ test_server:make_priv_dir().
%%%-----------------------------------------------------------------
%%% @spec get_target_name(Handle) -> {ok,TargetName} | {error,Reason}
@@ -676,11 +801,11 @@ get_target_name(Handle) ->
%%% @doc Parse the printout from an SQL table and return a list of tuples.
%%%
%%% <p>The printout to parse would typically be the result of a
-%%% <code>select</code> command in SQL. The returned
-%%% <code>Table</code> is a list of tuples, where each tuple is a row
+%%% <c>select</c> command in SQL. The returned
+%%% <c>Table</c> is a list of tuples, where each tuple is a row
%%% in the table.</p>
%%%
-%%% <p><code>Heading</code> is a tuple of strings representing the
+%%% <p><c>Heading</c> is a tuple of strings representing the
%%% headings of each column in the table.</p>
parse_table(Data) ->
ct_util:parse_table(Data).
@@ -752,8 +877,8 @@ make_and_load(Dir, Suite) ->
%%% SuiteUserData = [term()]
%%% Reason = term()
%%%
-%%% @doc Returns any data specified with the tag <code>userdata</code>
-%%% in the list of tuples returned from <code>Suite:suite/0</code>.
+%%% @doc Returns any data specified with the tag <c>userdata</c>
+%%% in the list of tuples returned from <c>Suite:suite/0</c>.
userdata(TestDir, Suite) ->
case make_and_load(TestDir, Suite) of
E = {error,_} ->
@@ -788,9 +913,9 @@ get_userdata(_BadTerm, Spec) ->
%%% TCUserData = [term()]
%%% Reason = term()
%%%
-%%% @doc Returns any data specified with the tag <code>userdata</code>
-%%% in the list of tuples returned from <code>Suite:group(GroupName)</code>
-%%% or <code>Suite:Case()</code>.
+%%% @doc Returns any data specified with the tag <c>userdata</c>
+%%% in the list of tuples returned from <c>Suite:group(GroupName)</c>
+%%% or <c>Suite:Case()</c>.
userdata(TestDir, Suite, {group,GroupName}) ->
case make_and_load(TestDir, Suite) of
E = {error,_} ->
@@ -813,8 +938,9 @@ userdata(TestDir, Suite, Case) when is_atom(Case) ->
%%%-----------------------------------------------------------------
%%% @spec get_status() -> TestStatus | {error,Reason} | no_tests_running
%%% TestStatus = [StatusElem]
-%%% StatusElem = {current,{Suite,TestCase}} | {successful,Successful} |
+%%% StatusElem = {current,TestCaseInfo} | {successful,Successful} |
%%% {failed,Failed} | {skipped,Skipped} | {total,Total}
+%%% TestCaseInfo = {Suite,TestCase} | [{Suite,TestCase}]
%%% Suite = atom()
%%% TestCase = atom()
%%% Successful = integer()
@@ -826,7 +952,8 @@ userdata(TestDir, Suite, Case) when is_atom(Case) ->
%%% Reason = term()
%%%
%%% @doc Returns status of ongoing test. The returned list contains info about
-%%% which test case is currently executing, as well as counters for
+%%% which test case is currently executing (a list of cases when a
+%%% parallel test case group is executing), as well as counters for
%%% successful, failed, skipped, and total test cases so far.
get_status() ->
case get_testdata(curr_tc) of
@@ -845,10 +972,16 @@ get_status() ->
get_testdata(Key) ->
case catch ct_util:get_testdata(Key) of
+ {error,ct_util_server_not_running} ->
+ no_tests_running;
Error = {error,_Reason} ->
Error;
{'EXIT',_Reason} ->
no_tests_running;
+ undefined ->
+ {error,no_testdata};
+ [CurrTC] when Key == curr_tc ->
+ {ok,CurrTC};
Data ->
{ok,Data}
end.
@@ -862,7 +995,7 @@ get_testdata(Key) ->
%%% executing. The function is therefore only safe to call from a function which
%%% has been called (or synchronously invoked) by the test case.</p>
%%%
-%%% <p><code>Reason</code>, the reason for aborting the test case, is printed
+%%% <p><c>Reason</c>, the reason for aborting the test case, is printed
%%% in the test case log.</p>
abort_current_testcase(Reason) ->
test_server_ctrl:abort_current_testcase(Reason).
@@ -875,13 +1008,13 @@ abort_current_testcase(Reason) ->
%%% Reason = term()
%%%
%%% @doc <p>This function encrypts the source config file with DES3 and
-%%% saves the result in file <code>EncryptFileName</code>. The key,
+%%% saves the result in file <c>EncryptFileName</c>. The key,
%%% a string, must be available in a text file named
-%%% <code>.ct_config.crypt</code> in the current directory, or the
+%%% <c>.ct_config.crypt</c> in the current directory, or the
%%% home directory of the user (it is searched for in that order).</p>
%%% <p>See the Common Test User's Guide for information about using
%%% encrypted config files when running tests.</p>
-%%% <p>See the <code>crypto</code> application for details on DES3
+%%% <p>See the <c>crypto</c> application for details on DES3
%%% encryption/decryption.</p>
encrypt_config_file(SrcFileName, EncryptFileName) ->
ct_config:encrypt_config_file(SrcFileName, EncryptFileName).
@@ -895,13 +1028,13 @@ encrypt_config_file(SrcFileName, EncryptFileName) ->
%%% Reason = term()
%%%
%%% @doc <p>This function encrypts the source config file with DES3 and
-%%% saves the result in the target file <code>EncryptFileName</code>.
+%%% saves the result in the target file <c>EncryptFileName</c>.
%%% The encryption key to use is either the value in
-%%% <code>{key,Key}</code> or the value stored in the file specified
-%%% by <code>{file,File}</code>.</p>
+%%% <c>{key,Key}</c> or the value stored in the file specified
+%%% by <c>{file,File}</c>.</p>
%%% <p>See the Common Test User's Guide for information about using
%%% encrypted config files when running tests.</p>
-%%% <p>See the <code>crypto</code> application for details on DES3
+%%% <p>See the <c>crypto</c> application for details on DES3
%%% encryption/decryption.</p>
encrypt_config_file(SrcFileName, EncryptFileName, KeyOrFile) ->
ct_config:encrypt_config_file(SrcFileName, EncryptFileName, KeyOrFile).
@@ -913,11 +1046,11 @@ encrypt_config_file(SrcFileName, EncryptFileName, KeyOrFile) ->
%%% TargetFileName = string()
%%% Reason = term()
%%%
-%%% @doc <p>This function decrypts <code>EncryptFileName</code>, previously
-%%% generated with <code>encrypt_config_file/2/3</code>. The original
+%%% @doc <p>This function decrypts <c>EncryptFileName</c>, previously
+%%% generated with <c>encrypt_config_file/2/3</c>. The original
%%% file contents is saved in the target file. The encryption key, a
%%% string, must be available in a text file named
-%%% <code>.ct_config.crypt</code> in the current directory, or the
+%%% <c>.ct_config.crypt</c> in the current directory, or the
%%% home directory of the user (it is searched for in that order).</p>
decrypt_config_file(EncryptFileName, TargetFileName) ->
ct_config:decrypt_config_file(EncryptFileName, TargetFileName).
@@ -930,8 +1063,8 @@ decrypt_config_file(EncryptFileName, TargetFileName) ->
%%% KeyOrFile = {key,string()} | {file,string()}
%%% Reason = term()
%%%
-%%% @doc <p>This function decrypts <code>EncryptFileName</code>, previously
-%%% generated with <code>encrypt_config_file/2/3</code>. The original
+%%% @doc <p>This function decrypts <c>EncryptFileName</c>, previously
+%%% generated with <c>encrypt_config_file/2/3</c>. The original
%%% file contents is saved in the target file. The key must have the
%%% the same value as that used for encryption.</p>
decrypt_config_file(EncryptFileName, TargetFileName, KeyOrFile) ->
@@ -948,7 +1081,7 @@ decrypt_config_file(EncryptFileName, TargetFileName, KeyOrFile) ->
%%% given callback module and configuration string. Callback module
%%% should be either loaded or present in the code part. Loaded
%%% configuration variables can later be removed using
-%%% <code>remove_config/2</code> function.</p>
+%%% <c>remove_config/2</c> function.</p>
add_config(Callback, Config)->
ct_config:add_config(Callback, Config).
@@ -966,13 +1099,21 @@ remove_config(Callback, Config) ->
%%%-----------------------------------------------------------------
%%% @spec timetrap(Time) -> ok
-%%% Time = {hours,Hours} | {minutes,Mins} | {seconds,Secs} | Millisecs | infinity
+%%% Time = {hours,Hours} | {minutes,Mins} | {seconds,Secs} | Millisecs | infinity | Func
%%% Hours = integer()
%%% Mins = integer()
%%% Secs = integer()
%%% Millisecs = integer() | float()
-%%%
-%%% @doc <p>Use this function to set a new timetrap for the running test case.</p>
+%%% Func = {M,F,A} | fun()
+%%% M = atom()
+%%% F = atom()
+%%% A = list()
+%%%
+%%% @doc <p>Use this function to set a new timetrap for the running test case.
+%%% If the argument is <c>Func</c>, the timetrap will be triggered
+%%% when this function returns. <c>Func</c> may also return a new
+%%% <c>Time</c> value, which in that case will be the value for the
+%%% new timetrap.</p>
timetrap(Time) ->
test_server:timetrap_cancel(),
test_server:timetrap(Time).
@@ -1010,3 +1151,131 @@ sleep({seconds,Ss}) ->
sleep(trunc(Ss * 1000));
sleep(Time) ->
test_server:adjusted_sleep(Time).
+
+%%%-----------------------------------------------------------------
+%%% @spec notify(Name,Data) -> ok
+%%% Name = atom()
+%%% Data = term()
+%%%
+%%% @doc <p>Sends a asynchronous notification of type <c>Name</c> with
+%%% <c>Data</c>to the common_test event manager. This can later be
+%%% caught by any installed event manager. </p>
+%%% @see //stdlib/gen_event
+notify(Name,Data) ->
+ ct_event:notify(Name, Data).
+
+%%%-----------------------------------------------------------------
+%%% @spec sync_notify(Name,Data) -> ok
+%%% Name = atom()
+%%% Data = term()
+%%%
+%%% @doc <p>Sends a synchronous notification of type <c>Name</c> with
+%%% <c>Data</c>to the common_test event manager. This can later be
+%%% caught by any installed event manager. </p>
+%%% @see //stdlib/gen_event
+sync_notify(Name,Data) ->
+ ct_event:sync_notify(Name, Data).
+
+%%%-----------------------------------------------------------------
+%%% @spec break(Comment) -> ok | {error,Reason}
+%%% Comment = string()
+%%% Reason = {multiple_cases_running,TestCases} |
+%%% 'enable break with release_shell option'
+%%% TestCases = [atom()]
+%%%
+%%% @doc <p>This function will cancel any active timetrap and pause the
+%%% execution of the current test case until the user calls the
+%%% <c>continue/0</c> function. It gives the user the opportunity
+%%% to interact with the erlang node running the tests, e.g. for
+%%% debugging purposes or for manually executing a part of the
+%%% test case. If a parallel group is executing, <c>break/2</c>
+%%% should be called instead.</p>
+%%% <p>A cancelled timetrap will not be automatically
+%%% reactivated after the break, but must be started exlicitly with
+%%% <c>ct:timetrap/1</c></p>
+%%% <p>In order for the break/continue functionality to work,
+%%% Common Test must release the shell process controlling stdin.
+%%% This is done by setting the <c>release_shell</c> start option
+%%% to <c>true</c>. See the User's Guide for more information.</p>
+
+break(Comment) ->
+ case {ct_util:get_testdata(starter),
+ ct_util:get_testdata(release_shell)} of
+ {ct,ReleaseSh} when ReleaseSh /= true ->
+ Warning = "ct:break/1 can only be used if release_shell == true.\n",
+ ct_logs:log("Warning!", Warning, []),
+ io:format(user, "Warning! " ++ Warning, []),
+ {error,'enable break with release_shell option'};
+ _ ->
+ case get_testdata(curr_tc) of
+ {ok,{_,_TestCase}} ->
+ test_server:break(?MODULE, Comment);
+ {ok,Cases} when is_list(Cases) ->
+ {error,{'multiple cases running',
+ [TC || {_,TC} <- Cases]}};
+ Error = {error,_} ->
+ Error;
+ Error ->
+ {error,Error}
+ end
+ end.
+
+%%%-----------------------------------------------------------------
+%%% @spec break(TestCase, Comment) -> ok | {error,Reason}
+%%% TestCase = atom()
+%%% Comment = string()
+%%% Reason = 'test case not running' |
+%%% 'enable break with release_shell option'
+%%%
+%%% @doc <p>This function works the same way as <c>break/1</c>,
+%%% only the <c>TestCase</c> argument makes it possible to
+%%% pause a test case executing in a parallel group. The
+%%% <c>continue/1</c> function should be used to resume
+%%% execution of <c>TestCase</c>.</p>
+%%% <p>See <c>break/1</c> for more details.</p>
+break(TestCase, Comment) ->
+ case {ct_util:get_testdata(starter),
+ ct_util:get_testdata(release_shell)} of
+ {ct,ReleaseSh} when ReleaseSh /= true ->
+ Warning = "ct:break/2 can only be used if release_shell == true.\n",
+ ct_logs:log("Warning!", Warning, []),
+ io:format(user, "Warning! " ++ Warning, []),
+ {error,'enable break with release_shell option'};
+ _ ->
+ case get_testdata(curr_tc) of
+ {ok,Cases} when is_list(Cases) ->
+ case lists:keymember(TestCase, 2, Cases) of
+ true ->
+ test_server:break(?MODULE, TestCase, Comment);
+ false ->
+ {error,'test case not running'}
+ end;
+ {ok,{_,TestCase}} ->
+ test_server:break(?MODULE, TestCase, Comment);
+ Error = {error,_} ->
+ Error;
+ Error ->
+ {error,Error}
+ end
+ end.
+
+%%%-----------------------------------------------------------------
+%%% @spec continue() -> ok
+%%%
+%%% @doc <p>This function must be called in order to continue after a
+%%% test case (not executing in a parallel group) has called
+%%% <c>break/1</c>.</p>
+continue() ->
+ test_server:continue().
+
+%%%-----------------------------------------------------------------
+%%% @spec continue(TestCase) -> ok
+%%% TestCase = atom()
+%%%
+%%% @doc <p>This function must be called in order to continue after a
+%%% test case has called <c>break/2</c>. If the paused test case,
+%%% <c>TestCase</c>, executes in a parallel group, this
+%%% function - rather than <c>continue/0</c> - must be used
+%%% in order to let the test case proceed.</p>
+continue(TestCase) ->
+ test_server:continue(TestCase).
diff --git a/lib/common_test/src/ct_config.erl b/lib/common_test/src/ct_config.erl
index 9277af5bc1..30bf5925c0 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -122,8 +122,8 @@ return({To,Ref},Result) ->
loop(StartDir) ->
receive
- {{require,Name,Tag,SubTags},From} ->
- Result = do_require(Name,Tag,SubTags),
+ {{require,Name,Key},From} ->
+ Result = do_require(Name,Key),
return(From,Result),
loop(StartDir);
{{set_default_config,{Config,Scope}},From} ->
@@ -168,16 +168,19 @@ reload_config(KeyOrName) ->
call({reload_config, KeyOrName}).
process_default_configs(Opts) ->
- case lists:keysearch(config, 1, Opts) of
- {value,{_,Files=[File|_]}} when is_list(File) ->
- Files;
- {value,{_,File=[C|_]}} when is_integer(C) ->
- [File];
- {value,{_,[]}} ->
- [];
- false ->
- []
- end.
+ lists:flatmap(fun({config,[_|_] = FileOrFiles}) ->
+ case {io_lib:printable_list(FileOrFiles),
+ io_lib:printable_list(hd(FileOrFiles))} of
+ {true,true} ->
+ FileOrFiles;
+ {true,false} ->
+ [FileOrFiles];
+ _ ->
+ []
+ end;
+ (_) ->
+ []
+ end,Opts).
process_user_configs(Opts, Acc) ->
case lists:keytake(userconfig, 1, Opts) of
@@ -319,75 +322,58 @@ get_config(KeyOrName,Default) ->
get_config(KeyOrName,Default,[]).
get_config(KeyOrName,Default,Opts) when is_atom(KeyOrName) ->
- case lookup_config(KeyOrName) of
- [] ->
- Default;
- [{_Ref,Val}|_] = Vals ->
- case {lists:member(all,Opts),lists:member(element,Opts)} of
- {true,true} ->
- [{KeyOrName,V} || {_R,V} <- lists:sort(Vals)];
- {true,false} ->
- [V || {_R,V} <- lists:sort(Vals)];
- {false,true} ->
- {KeyOrName,Val};
- {false,false} ->
- Val
- end
+ case get_config({KeyOrName}, Default, Opts) of
+ %% If only an atom is given, then we need to unwrap the
+ %% key if it is returned
+ {{KeyOrName}, Val} ->
+ {KeyOrName, Val};
+ [{{KeyOrName}, _Val}|_] = Res ->
+ [{K, Val} || {{K},Val} <- Res, K == KeyOrName];
+ Else ->
+ Else
end;
-get_config({KeyOrName,SubKey},Default,Opts) ->
- case lookup_config(KeyOrName) of
+%% This useage of get_config is only used by internal ct functions
+%% and may change at any time
+get_config({DeepKey,SubKey}, Default, Opts) when is_tuple(DeepKey) ->
+ get_config(erlang:append_element(DeepKey, SubKey), Default, Opts);
+get_config(KeyOrName,Default,Opts) when is_tuple(KeyOrName) ->
+ case lookup_config(element(1,KeyOrName)) of
[] ->
- Default;
+ format_value([Default],KeyOrName,Opts);
Vals ->
- Vals1 = case [Val || {_Ref,Val} <- lists:sort(Vals)] of
- Result=[L|_] when is_list(L) ->
- case L of
- [{_,_}|_] ->
- Result;
- _ ->
- []
- end;
- _ ->
- []
- end,
- case get_subconfig([SubKey],Vals1,[],Opts) of
- {ok,[{_,SubVal}|_]=SubVals} ->
- case {lists:member(all,Opts),lists:member(element,Opts)} of
- {true,true} ->
- [{{KeyOrName,SubKey},Val} || {_,Val} <- SubVals];
- {true,false} ->
- [Val || {_SubKey,Val} <- SubVals];
- {false,true} ->
- {{KeyOrName,SubKey},SubVal};
- {false,false} ->
- SubVal
- end;
- _ ->
- Default
- end
+ NewVals =
+ lists:map(
+ fun({Val}) ->
+ get_config(tl(tuple_to_list(KeyOrName)),
+ Val,Default,Opts)
+ end,Vals),
+ format_value(NewVals,KeyOrName,Opts)
end.
-get_subconfig(SubKeys,Values) ->
- get_subconfig(SubKeys,Values,[],[]).
-
-get_subconfig(SubKeys,[Value|Rest],Mapped,Opts) ->
- case do_get_config(SubKeys,Value,[]) of
- {ok,SubMapped} ->
- case lists:member(all,Opts) of
- true ->
- get_subconfig(SubKeys,Rest,Mapped++SubMapped,Opts);
- false ->
- {ok,SubMapped}
- end;
- _Error ->
- get_subconfig(SubKeys,Rest,Mapped,Opts)
+get_config([],Vals,_Default,_Opts) ->
+ Vals;
+get_config([[]],Vals,Default,Opts) ->
+ get_config([],Vals,Default,Opts);
+%% This case is used by {require,{unix,[port,host]}} functionality
+get_config([SubKeys], Vals, Default, _Opts) when is_list(SubKeys) ->
+ case do_get_config(SubKeys, Vals, []) of
+ {ok, SubVals} ->
+ [SubVal || {_,SubVal} <- SubVals];
+
+ _ ->
+ Default
end;
-get_subconfig(SubKeys,[],[],_) ->
- {error,{not_available,SubKeys}};
-get_subconfig(_SubKeys,[],Mapped,_) ->
- {ok,Mapped}.
+get_config([Key|Rest], Vals, Default, Opts) ->
+ case do_get_config([Key], Vals, []) of
+ {ok, [{Key,NewVals}]} ->
+ get_config(Rest, NewVals, Default, Opts);
+ _ ->
+ Default
+ end.
+do_get_config([Key|_], Available, _Mapped) when not is_list(Available) ->
+ {error,{not_available,Key}};
do_get_config([Key|Required],Available,Mapped) ->
case lists:keysearch(Key,1,Available) of
{value,{Key,Value}} ->
@@ -403,8 +389,7 @@ do_get_config([],_Available,Mapped) ->
get_all_config() ->
ets:select(?attr_table,[{#ct_conf{name='$1',key='$2',value='$3',
default='$4',_='_'},
- [],
- [{{'$1','$2','$3','$4'}}]}]).
+ [],[{{'$1','$2','$3','$4'}}]}]).
lookup_config(KeyOrName) ->
case lookup_name(KeyOrName) of
@@ -415,13 +400,23 @@ lookup_config(KeyOrName) ->
end.
lookup_name(Name) ->
- ets:select(?attr_table,[{#ct_conf{ref='$1',value='$2',name=Name,_='_'},
- [],
- [{{'$1','$2'}}]}]).
+ ets:select(?attr_table,[{#ct_conf{value='$1',name=Name,_='_'},
+ [],[{{'$1'}}]}]).
lookup_key(Key) ->
- ets:select(?attr_table,[{#ct_conf{key=Key,ref='$1',value='$2',name='_UNDEF',_='_'},
- [],
- [{{'$1','$2'}}]}]).
+ ets:select(?attr_table,[{#ct_conf{key=Key,value='$1',name='_UNDEF',_='_'},
+ [],[{{'$1'}}]}]).
+
+format_value([SubVal|_] = SubVals, KeyOrName, Opts) ->
+ case {lists:member(all,Opts),lists:member(element,Opts)} of
+ {true,true} ->
+ [{KeyOrName,Val} || Val <- SubVals];
+ {true,false} ->
+ [Val || Val <- SubVals];
+ {false,true} ->
+ {KeyOrName,SubVal};
+ {false,false} ->
+ SubVal
+ end.
lookup_handler_for_config({Key, _Subkey}) ->
lookup_handler_for_config(Key);
@@ -475,65 +470,78 @@ release_allocated([H|T]) ->
release_allocated([]) ->
ok.
-allocate(Name,Key,SubKeys) ->
- case ets:match_object(?attr_table,#ct_conf{key=Key,name='_UNDEF',_='_'}) of
- [] ->
+allocate(Name,Key) ->
+ Ref = make_ref(),
+ case get_config(Key,Ref,[all,element]) of
+ [{_,Ref}] ->
{error,{not_available,Key}};
- Available ->
- case allocate_subconfig(Name,SubKeys,Available,false) of
- ok ->
- ok;
- Error ->
- Error
- end
+ Configs ->
+ associate(Name,Key,Configs),
+ ok
end.
-allocate_subconfig(Name,SubKeys,[C=#ct_conf{value=Value}|Rest],Found) ->
- case do_get_config(SubKeys,Value,[]) of
- {ok,_SubMapped} ->
- ets:insert(?attr_table,C#ct_conf{name=Name}),
- allocate_subconfig(Name,SubKeys,Rest,true);
- _Error ->
- allocate_subconfig(Name,SubKeys,Rest,Found)
- end;
-allocate_subconfig(_Name,_SubKeys,[],true) ->
+
+associate('_UNDEF',_Key,_Configs) ->
ok;
-allocate_subconfig(_Name,SubKeys,[],false) ->
- {error,{not_available,SubKeys}}.
+associate(Name,{Key,SubKeys},Configs) when is_atom(Key), is_list(SubKeys) ->
+ associate_int(Name,Configs,"true");
+associate(Name,_Key,Configs) ->
+ associate_int(Name,Configs,os:getenv("COMMON_TEST_ALIAS_TOP")).
+
+associate_int(Name,Configs,"true") ->
+ lists:map(fun({K,_Config}) ->
+ Cs = ets:match_object(
+ ?attr_table,
+ #ct_conf{key=element(1,K),
+ name='_UNDEF',_='_'}),
+ [ets:insert(?attr_table,C#ct_conf{name=Name})
+ || C <- Cs]
+ end,Configs);
+associate_int(Name,Configs,_) ->
+ lists:map(fun({K,Config}) ->
+ Key = if is_tuple(K) -> element(1,K);
+ is_atom(K) -> K
+ end,
+
+ Cs = ets:match_object(
+ ?attr_table,
+ #ct_conf{key=Key,
+ name='_UNDEF',_='_'}),
+ [ets:insert(?attr_table,C#ct_conf{name=Name,
+ value=Config})
+ || C <- Cs]
+ end,Configs).
+
+
delete_config(Default) ->
ets:match_delete(?attr_table,#ct_conf{default=Default,_='_'}),
ok.
-require(Key) when is_atom(Key) ->
- require({Key,[]});
-require({Key,SubKeys}) when is_atom(Key) ->
- allocate('_UNDEF',Key,to_list(SubKeys));
+require(Key) when is_atom(Key); is_tuple(Key) ->
+ allocate('_UNDEF',Key);
require(Key) ->
{error,{invalid,Key}}.
-require(Name,Key) when is_atom(Key) ->
- require(Name,{Key,[]});
-require(Name,{Key,SubKeys}) when is_atom(Name), is_atom(Key) ->
- call({require,Name,Key,to_list(SubKeys)});
+require(Name,Key) when is_atom(Name),is_atom(Key) orelse is_tuple(Key) ->
+ call({require,Name,Key});
require(Name,Keys) ->
{error,{invalid,{Name,Keys}}}.
-to_list(X) when is_list(X) -> X;
-to_list(X) -> [X].
-
-do_require(Name,Key,SubKeys) when is_list(SubKeys) ->
+do_require(Name,Key) ->
case get_key_from_name(Name) of
{error,_} ->
- allocate(Name,Key,SubKeys);
+ allocate(Name,Key);
{ok,Key} ->
%% already allocated - check that it has all required subkeys
- Vals = [Val || {_Ref,Val} <- lookup_name(Name)],
- case get_subconfig(SubKeys,Vals) of
- {ok,_SubMapped} ->
- ok;
- Error ->
- Error
+ R = make_ref(),
+ case get_config(Key,R,[]) of
+ R ->
+ {error,{not_available,Key}};
+ {error,_} = Error ->
+ Error;
+ _Error ->
+ ok
end;
{ok,OtherKey} ->
{error,{name_in_use,Name,OtherKey}}
@@ -760,13 +768,13 @@ check_config_files(Configs) ->
end,
lists:keysearch(error, 1, lists:flatten(lists:map(ConfigChecker, Configs))).
-prepare_user_configs([ConfigString|UserConfigs], Acc, new) ->
+prepare_user_configs([CallbackMod|UserConfigs], Acc, new) ->
prepare_user_configs(UserConfigs,
- [{list_to_atom(ConfigString), []}|Acc],
+ [{list_to_atom(CallbackMod),[]}|Acc],
cur);
prepare_user_configs(["and"|UserConfigs], Acc, _) ->
prepare_user_configs(UserConfigs, Acc, new);
-prepare_user_configs([ConfigString|UserConfigs], [{LastMod, LastList}|Acc], cur) ->
+prepare_user_configs([ConfigString|UserConfigs], [{LastMod,LastList}|Acc], cur) ->
prepare_user_configs(UserConfigs,
[{LastMod, [ConfigString|LastList]}|Acc],
cur);
diff --git a/lib/common_test/src/ct_conn_log_h.erl b/lib/common_test/src/ct_conn_log_h.erl
new file mode 100644
index 0000000000..bf27238121
--- /dev/null
+++ b/lib/common_test/src/ct_conn_log_h.erl
@@ -0,0 +1,230 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(ct_conn_log_h).
+
+%%%
+%%% A handler that can be connected to the error_logger event
+%%% handler. Writes all ct connection events. See comments in
+%%% cth_conn_log for more information.
+%%%
+
+-include("ct_util.hrl").
+
+-export([init/1,
+ handle_event/2, handle_call/2, handle_info/2,
+ terminate/2]).
+
+-record(state, {group_leader,logs=[]}).
+
+-define(WIDTH,80).
+
+%%%-----------------------------------------------------------------
+%%% Callbacks
+init({GL,Logs}) ->
+ open_files(Logs,#state{group_leader=GL}).
+
+open_files([{ConnMod,{LogType,Logs}}|T],State) ->
+ case do_open_files(Logs,[]) of
+ {ok,Fds} ->
+ open_files(T,State#state{logs=[{ConnMod,{LogType,Fds}} |
+ State#state.logs]});
+ Error ->
+ Error
+ end;
+open_files([],State) ->
+ {ok,State}.
+
+
+do_open_files([{Tag,File}|Logs],Acc) ->
+ case file:open(File, [write]) of
+ {ok,Fd} ->
+ do_open_files(Logs,[{Tag,Fd}|Acc]);
+ {error,Reason} ->
+ {error,{could_not_open_log,File,Reason}}
+ end;
+do_open_files([],Acc) ->
+ {ok,lists:reverse(Acc)}.
+
+handle_event({_Type, GL, _Msg}, State) when node(GL) /= node() ->
+ {ok, State};
+handle_event({_Type,_GL,{Pid,{ct_connection,Action,ConnName},Report}},State) ->
+ Info = conn_info(Pid,#conn_log{name=ConnName,action=Action}),
+ write_report(now(),Info,Report,State),
+ {ok, State};
+handle_event({_Type,_GL,{Pid,Info=#conn_log{},Report}},State) ->
+ write_report(now(),conn_info(Pid,Info),Report,State),
+ {ok, State};
+handle_event({error_report,_,{Pid,_,[{ct_connection,ConnName}|R]}},State) ->
+ %% Error reports from connection
+ write_error(now(),conn_info(Pid,#conn_log{name=ConnName}),R,State),
+ {ok, State};
+handle_event(_, State) ->
+ {ok, State}.
+
+handle_info(_, State) ->
+ {ok, State}.
+
+handle_call(_Query, State) ->
+ {ok, {error, bad_query}, State}.
+
+terminate(_,#state{logs=Logs}) ->
+ [file:close(Fd) || {_,{_,Fds}} <- Logs, {_,Fd} <- Fds],
+ ok.
+
+
+%%%-----------------------------------------------------------------
+%%% Writing reports
+write_report(Time,#conn_log{module=ConnMod}=Info,Data,State) ->
+ {LogType,Fd} = get_log(Info,State),
+ io:format(Fd,"~n~s~s~s",[format_head(ConnMod,LogType,Time),
+ format_title(LogType,Info),
+ format_data(ConnMod,LogType,Data)]).
+
+write_error(Time,#conn_log{module=ConnMod}=Info,Report,State) ->
+ case get_log(Info,State) of
+ {html,_} ->
+ %% The error will anyway be written in the html log by the
+ %% sasl error handler, so don't write it again.
+ ok;
+ {LogType,Fd} ->
+ io:format(Fd,"~n~s~s~s",[format_head(ConnMod,LogType,Time," ERROR"),
+ format_title(LogType,Info),
+ format_error(LogType,Report)])
+ end.
+
+get_log(Info,State) ->
+ case proplists:get_value(Info#conn_log.module,State#state.logs) of
+ {html,_} ->
+ {html,State#state.group_leader};
+ {LogType,Fds} ->
+ {LogType,get_fd(Info,Fds)};
+ undefined ->
+ {html,State#state.group_leader}
+ end.
+
+get_fd(#conn_log{name=undefined},Fds) ->
+ proplists:get_value(default,Fds);
+get_fd(#conn_log{name=ConnName},Fds) ->
+ case proplists:get_value(ConnName,Fds) of
+ undefined ->
+ proplists:get_value(default,Fds);
+ Fd ->
+ Fd
+ end.
+
+%%%-----------------------------------------------------------------
+%%% Formatting
+format_head(ConnMod,LogType,Time) ->
+ format_head(ConnMod,LogType,Time,"").
+
+format_head(ConnMod,raw,Time,Text) ->
+ io_lib:format("~n~p, ~p~s, ",[now_to_time(Time),ConnMod,Text]);
+format_head(ConnMod,_,Time,Text) ->
+ Head = pad_char_end(?WIDTH,pretty_head(now_to_time(Time),ConnMod,Text),$=),
+ io_lib:format("~n~s",[Head]).
+
+format_title(raw,#conn_log{client=Client}=Info) ->
+ io_lib:format("Client ~p ~s ~s",[Client,actionstr(Info),serverstr(Info)]);
+format_title(_,Info) ->
+ Title = pad_char_end(?WIDTH,pretty_title(Info),$=),
+ io_lib:format("~n~s", [Title]).
+
+format_data(_,_,NoData) when NoData == ""; NoData == <<>> ->
+ "";
+format_data(ConnMod,LogType,Data) ->
+ ConnMod:format_data(LogType,Data).
+
+format_error(raw,Report) ->
+ io_lib:format("~n~p~n",[Report]);
+format_error(pretty,Report) ->
+ [io_lib:format("~n ~p: ~p",[K,V]) || {K,V} <- Report].
+
+
+
+
+%%%-----------------------------------------------------------------
+%%% Helpers
+conn_info(LoggingProc, #conn_log{client=undefined} = ConnInfo) ->
+ conn_info(ConnInfo#conn_log{client=LoggingProc});
+conn_info(_, ConnInfo) ->
+ conn_info(ConnInfo).
+
+conn_info(#conn_log{client=Client, module=undefined} = ConnInfo) ->
+ case ets:lookup(ct_connections,Client) of
+ [#conn{address=Address,callback=Callback}] ->
+ ConnInfo#conn_log{address=Address,module=Callback};
+ [] ->
+ ConnInfo
+ end;
+conn_info(ConnInfo) ->
+ ConnInfo.
+
+
+now_to_time({_,_,MicroS}=Now) ->
+ {calendar:now_to_local_time(Now),MicroS}.
+
+pretty_head({{{Y,Mo,D},{H,Mi,S}},MicroS},ConnMod,Text0) ->
+ Text = string:to_upper(atom_to_list(ConnMod) ++ Text0),
+ io_lib:format("= ~s ==== ~s-~s-~p::~s:~s:~s,~s ",
+ [Text,t(D),month(Mo),Y,t(H),t(Mi),t(S),
+ micro2milli(MicroS)]).
+
+pretty_title(#conn_log{client=Client}=Info) ->
+ io_lib:format("= Client ~p ~s Server ~s ",
+ [Client,actionstr(Info),serverstr(Info)]).
+
+actionstr(#conn_log{action=send}) -> "----->";
+actionstr(#conn_log{action=recv}) -> "<-----";
+actionstr(#conn_log{action=open}) -> "opened session to";
+actionstr(#conn_log{action=close}) -> "closed session to";
+actionstr(_) -> "<---->".
+
+serverstr(#conn_log{name=undefined,address=Address}) ->
+ io_lib:format("~p",[Address]);
+serverstr(#conn_log{name=Alias,address=Address}) ->
+ io_lib:format("~p(~p)",[Alias,Address]).
+
+month(1) -> "Jan";
+month(2) -> "Feb";
+month(3) -> "Mar";
+month(4) -> "Apr";
+month(5) -> "May";
+month(6) -> "Jun";
+month(7) -> "Jul";
+month(8) -> "Aug";
+month(9) -> "Sep";
+month(10) -> "Oct";
+month(11) -> "Nov";
+month(12) -> "Dec".
+
+micro2milli(X) ->
+ pad0(3,integer_to_list(X div 1000)).
+
+t(X) ->
+ pad0(2,integer_to_list(X)).
+
+pad0(N,Str) ->
+ M = length(Str),
+ lists:duplicate(N-M,$0) ++ Str.
+
+pad_char_end(N,Str,Char) ->
+ case length(lists:flatten(Str)) of
+ M when M<N -> Str ++ lists:duplicate(N-M,Char);
+ _ -> Str
+ end.
diff --git a/lib/common_test/src/ct_event.erl b/lib/common_test/src/ct_event.erl
index 3e79898ad1..49e0635d79 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -31,7 +31,7 @@
%% API
-export([start_link/0, add_handler/0, add_handler/1, stop/0]).
--export([notify/1, sync_notify/1]).
+-export([notify/1, notify/2, sync_notify/1,sync_notify/2]).
-export([is_alive/0]).
%% gen_event callbacks
@@ -90,6 +90,13 @@ notify(Event) ->
end.
%%--------------------------------------------------------------------
+%% Function: notify(Name,Data) -> ok
+%% Description: Asynchronous notification to event manager.
+%%--------------------------------------------------------------------
+notify(Name, Data) ->
+ notify(#event{ name = Name, data = Data}).
+
+%%--------------------------------------------------------------------
%% Function: sync_notify(Event) -> ok
%% Description: Synchronous notification to event manager.
%%--------------------------------------------------------------------
@@ -102,6 +109,13 @@ sync_notify(Event) ->
end.
%%--------------------------------------------------------------------
+%% Function: sync_notify(Name,Data) -> ok
+%% Description: Synchronous notification to event manager.
+%%--------------------------------------------------------------------
+sync_notify(Name,Data) ->
+ sync_notify(#event{ name = Name, data = Data}).
+
+%%--------------------------------------------------------------------
%% Function: is_alive() -> true | false
%% Description: Check if Event Manager is alive.
%%--------------------------------------------------------------------
diff --git a/lib/common_test/src/ct_framework.erl b/lib/common_test/src/ct_framework.erl
index c24a7c238b..bec3368869 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -27,9 +27,10 @@
-export([init_tc/3, end_tc/3, end_tc/4, get_suite/2, get_all_cases/1]).
-export([report/2, warn/1, error_notification/4]).
--export([get_logopts/0, format_comment/1, get_html_wrapper/3]).
+-export([get_logopts/0, format_comment/1, get_html_wrapper/4]).
--export([error_in_suite/1, ct_init_per_group/2, ct_end_per_group/2]).
+-export([error_in_suite/1, init_per_suite/1, end_per_suite/1,
+ init_per_group/2, end_per_group/2]).
-export([make_all_conf/3, make_conf/5]).
@@ -54,6 +55,7 @@
init_tc(Mod,Func,Config) ->
%% in case Mod == ct_framework, lookup the suite name
Suite = get_suite_name(Mod, Config),
+
%% check if previous testcase was interpreted and has left
%% a "dead" trace window behind - if so, kill it
case ct_util:get_testdata(interpret) of
@@ -63,50 +65,43 @@ init_tc(Mod,Func,Config) ->
_ ->
ok
end,
- %% check if we need to add defaults explicitly because
- %% there's no init_per_suite exported from Mod
- {InitFailed,DoInit} =
- case ct_util:get_testdata(curr_tc) of
- {Suite,{suite0_failed,_}=Failure} ->
- {Failure,false};
- {?MODULE,_} -> % should not really happen
- {false,false};
- {Suite,_} -> % Func is not 1st case in suite
- {false,false};
- _ when Func == init_per_suite -> % defaults will be added anyway
- {false,false};
- _ -> % first case in suite
- {false,true}
- end,
- case InitFailed of
- false ->
- ct_util:set_testdata({curr_tc,{Suite,Func}}),
+
+ case ct_util:get_testdata(curr_tc) of
+ {Suite,{suite0_failed,{require,Reason}}} ->
+ {skip,{require_failed_in_suite0,Reason}};
+ {Suite,{suite0_failed,_}=Failure} ->
+ {skip,Failure};
+ _ ->
+ ct_util:update_testdata(curr_tc,
+ fun(undefined) ->
+ [{Suite,Func}];
+ (Running) ->
+ [{Suite,Func}|Running]
+ end, [create]),
case ct_util:read_suite_data({seq,Suite,Func}) of
undefined ->
- init_tc1(Mod,Func,Config,DoInit);
+ init_tc1(Mod,Suite,Func,Config);
Seq when is_atom(Seq) ->
case ct_util:read_suite_data({seq,Suite,Seq}) of
[Func|TCs] -> % this is the 1st case in Seq
- %% make sure no cases in this seq are marked as failed
- %% from an earlier execution in the same suite
+ %% make sure no cases in this seq are
+ %% marked as failed from an earlier execution
+ %% in the same suite
lists:foreach(
fun(TC) ->
- ct_util:save_suite_data({seq,Suite,TC},Seq)
+ ct_util:save_suite_data({seq,Suite,TC},
+ Seq)
end, TCs);
_ ->
ok
end,
- init_tc1(Mod,Func,Config,DoInit);
+ init_tc1(Mod,Suite,Func,Config);
{failed,Seq,BadFunc} ->
{skip,{sequence_failed,Seq,BadFunc}}
- end;
- {_,{require,Reason}} ->
- {skip,{require_failed_in_suite0,Reason}};
- _ ->
- {skip,InitFailed}
+ end
end.
-init_tc1(?MODULE,error_in_suite,[Config0],_) when is_list(Config0) ->
+init_tc1(?MODULE,_,error_in_suite,[Config0]) when is_list(Config0) ->
ct_logs:init_tc(false),
ct_event:notify(#event{name=tc_start,
node=node(),
@@ -117,14 +112,16 @@ init_tc1(?MODULE,error_in_suite,[Config0],_) when is_list(Config0) ->
Reason ->
{skip,Reason}
end;
-init_tc1(Mod,Func,[Config0],DoInit) when is_list(Config0) ->
+
+init_tc1(Mod,Suite,Func,[Config0]) when is_list(Config0) ->
Config1 =
case ct_util:read_suite_data(last_saved_config) of
- {{Mod,LastFunc},SavedConfig} -> % last testcase
+ {{Suite,LastFunc},SavedConfig} -> % last testcase
[{saved_config,{LastFunc,SavedConfig}} |
lists:keydelete(saved_config,1,Config0)];
- {{LastSuite,InitOrEnd},SavedConfig} when InitOrEnd == init_per_suite ;
- InitOrEnd == end_per_suite ->
+ {{LastSuite,InitOrEnd},
+ SavedConfig} when InitOrEnd == init_per_suite ;
+ InitOrEnd == end_per_suite ->
%% last suite
[{saved_config,{LastSuite,SavedConfig}} |
lists:keydelete(saved_config,1,Config0)];
@@ -133,13 +130,14 @@ init_tc1(Mod,Func,[Config0],DoInit) when is_list(Config0) ->
end,
ct_util:delete_suite_data(last_saved_config),
Config = lists:keydelete(watchdog,1,Config1),
- if Func /= init_per_suite, DoInit /= true ->
- ok;
- true ->
+
+ if Func == init_per_suite ->
%% delete all default values used in previous suite
ct_config:delete_default_config(suite),
%% release all name -> key bindings (once per suite)
- ct_config:release_allocated()
+ ct_config:release_allocated();
+ Func /= init_per_suite ->
+ ok
end,
GroupPath = ?val(tc_group_path, Config, []),
@@ -154,9 +152,7 @@ init_tc1(Mod,Func,[Config0],DoInit) when is_list(Config0) ->
true ->
ct_config:delete_default_config(testcase)
end,
- %% in case Mod == ct_framework, lookup the suite name
- Suite = get_suite_name(Mod, Config),
- case add_defaults(Mod,Func,AllGroups,DoInit) of
+ case add_defaults(Mod,Func,AllGroups) of
Error = {suite0_failed,_} ->
ct_logs:init_tc(false),
ct_event:notify(#event{name=tc_start,
@@ -166,35 +162,25 @@ init_tc1(Mod,Func,[Config0],DoInit) when is_list(Config0) ->
{error,Error};
{SuiteInfo,MergeResult} ->
case MergeResult of
- {error,Reason} when DoInit == false ->
+ {error,Reason} ->
ct_logs:init_tc(false),
ct_event:notify(#event{name=tc_start,
node=node(),
data={Mod,FuncSpec}}),
{skip,Reason};
_ ->
- init_tc2(Mod,Func,SuiteInfo,MergeResult,
- Config,DoInit)
+ init_tc2(Mod,Suite,Func,SuiteInfo,MergeResult,Config)
end
end;
-init_tc1(_Mod,_Func,Args,_DoInit) ->
- {ok,Args}.
-init_tc2(Mod,Func,SuiteInfo,MergeResult,Config,DoInit) ->
- %% if first testcase fails when there's no init_per_suite
- %% we must do suite/0 configurations before skipping test
- MergedInfo =
- case MergeResult of
- {error,_} when DoInit == true ->
- SuiteInfo;
- _ ->
- MergeResult
- end,
+init_tc1(_Mod,_Suite,_Func,Args) ->
+ {ok,Args}.
+init_tc2(Mod,Suite,Func,SuiteInfo,MergeResult,Config) ->
%% timetrap must be handled before require
- MergedInfo1 = timetrap_first(MergedInfo, [], []),
+ MergedInfo = timetrap_first(MergeResult, [], []),
%% tell logger to use specified style sheet
- case lists:keysearch(stylesheet,1,MergedInfo++Config) of
+ case lists:keysearch(stylesheet,1,MergeResult++Config) of
{value,{stylesheet,SSFile}} ->
ct_logs:set_stylesheet(Func,add_data_dir(SSFile,Config));
_ ->
@@ -209,7 +195,7 @@ init_tc2(Mod,Func,SuiteInfo,MergeResult,Config,DoInit) ->
%% list of {Type,Bool} tuples, e.g. {telnet,true}),
case ct_util:get_overridden_silenced_connections() of
undefined ->
- case lists:keysearch(silent_connections,1,MergedInfo++Config) of
+ case lists:keysearch(silent_connections,1,MergeResult++Config) of
{value,{silent_connections,Conns}} ->
ct_util:silence_connections(Conns);
_ ->
@@ -218,61 +204,67 @@ init_tc2(Mod,Func,SuiteInfo,MergeResult,Config,DoInit) ->
Conns ->
ct_util:silence_connections(Conns)
end,
- if Func /= init_per_suite, DoInit /= true ->
- ct_logs:init_tc(false);
- true ->
- ct_logs:init_tc(true)
- end,
+ ct_logs:init_tc(Func == init_per_suite),
FuncSpec = group_or_func(Func,Config),
ct_event:notify(#event{name=tc_start,
node=node(),
data={Mod,FuncSpec}}),
- case catch configure(MergedInfo1,MergedInfo1,SuiteInfo,
- {FuncSpec,DoInit},Config) of
+ case catch configure(MergedInfo,MergedInfo,SuiteInfo,
+ FuncSpec,[],Config) of
{suite0_failed,Reason} ->
- ct_util:set_testdata({curr_tc,{Mod,{suite0_failed,{require,Reason}}}}),
+ ct_util:set_testdata({curr_tc,{Mod,{suite0_failed,
+ {require,Reason}}}}),
{skip,{require_failed_in_suite0,Reason}};
{error,Reason} ->
{auto_skip,{require_failed,Reason}};
{'EXIT',Reason} ->
{auto_skip,Reason};
- {ok,FinalConfig} ->
- case MergeResult of
- {error,Reason} ->
- %% suite0 configure finished now, report that
- %% first test case actually failed
- {skip,Reason};
- _ ->
- case get('$test_server_framework_test') of
- undefined ->
- ct_suite_init(Mod, FuncSpec, FinalConfig);
- Fun ->
- case Fun(init_tc, FinalConfig) of
- NewConfig when is_list(NewConfig) ->
- {ok,NewConfig};
- Else ->
- Else
- end
+ {ok,PostInitHook,Config1} ->
+ case get('$test_server_framework_test') of
+ undefined ->
+ ct_suite_init(Suite, FuncSpec, PostInitHook, Config1);
+ Fun ->
+ PostInitHookResult = do_post_init_hook(PostInitHook,
+ Config1),
+ case Fun(init_tc, [PostInitHookResult ++ Config1]) of
+ NewConfig when is_list(NewConfig) ->
+ {ok,NewConfig};
+ Else ->
+ Else
end
end
end.
-ct_suite_init(Mod, Func, [Config]) when is_list(Config) ->
- case ct_hooks:init_tc( Mod, Func, Config) of
+ct_suite_init(Suite, Func, PostInitHook, Config) when is_list(Config) ->
+ case ct_hooks:init_tc(Suite, Func, Config) of
NewConfig when is_list(NewConfig) ->
- {ok, [NewConfig]};
+ PostInitHookResult = do_post_init_hook(PostInitHook, NewConfig),
+ {ok, [PostInitHookResult ++ NewConfig]};
Else ->
Else
end.
-add_defaults(Mod,Func, GroupPath, DoInit) ->
+do_post_init_hook(PostInitHook, Config) ->
+ lists:flatmap(fun({Tag,Fun}) ->
+ case lists:keysearch(Tag,1,Config) of
+ {value,_} ->
+ [];
+ false ->
+ case Fun() of
+ {error,_} -> [];
+ Result -> [{Tag,Result}]
+ end
+ end
+ end, PostInitHook).
+
+add_defaults(Mod,Func, GroupPath) ->
Suite = get_suite_name(Mod, GroupPath),
case (catch Suite:suite()) of
{'EXIT',{undef,_}} ->
SuiteInfo = merge_with_suite_defaults(Suite,[]),
SuiteInfoNoCTH = [I || I <- SuiteInfo, element(1,I) =/= ct_hooks],
- case add_defaults1(Mod,Func, GroupPath, SuiteInfoNoCTH, DoInit) of
+ case add_defaults1(Mod,Func, GroupPath, SuiteInfoNoCTH) of
Error = {error,_} -> {SuiteInfo,Error};
MergedInfo -> {SuiteInfo,MergedInfo}
end;
@@ -292,7 +284,7 @@ add_defaults(Mod,Func, GroupPath, DoInit) ->
SuiteInfoNoCTH = [I || I <- SuiteInfo1,
element(1,I) =/= ct_hooks],
case add_defaults1(Mod,Func, GroupPath,
- SuiteInfoNoCTH, DoInit) of
+ SuiteInfoNoCTH) of
Error = {error,_} -> {SuiteInfo1,Error};
MergedInfo -> {SuiteInfo1,MergedInfo}
end;
@@ -313,7 +305,7 @@ add_defaults(Mod,Func, GroupPath, DoInit) ->
{suite0_failed,bad_return_value}
end.
-add_defaults1(Mod,Func, GroupPath, SuiteInfo, DoInit) ->
+add_defaults1(Mod,Func, GroupPath, SuiteInfo) ->
Suite = get_suite_name(Mod, GroupPath),
%% GroupPathInfo (for subgroup on level X) =
%% [LevelXGroupInfo, LevelX-1GroupInfo, ..., TopLevelGroupInfo]
@@ -325,8 +317,7 @@ add_defaults1(Mod,Func, GroupPath, SuiteInfo, DoInit) ->
_ -> []
end
end, GroupPath),
- Args = if Func == init_per_group; Func == ct_init_per_group;
- Func == end_per_group; Func == ct_end_per_group ->
+ Args = if Func == init_per_group ; Func == end_per_group ->
[?val(name, hd(GroupPath))];
true ->
[]
@@ -347,7 +338,7 @@ add_defaults1(Mod,Func, GroupPath, SuiteInfo, DoInit) ->
(default_config == element(1,SDDef)))],
case check_for_clashes(TestCaseInfo, GroupPathInfo, SuiteReqs) of
[] ->
- add_defaults2(Mod,Func, TCAndGroupInfo,SuiteInfo,SuiteReqs, DoInit);
+ add_defaults2(Mod,Func, TCAndGroupInfo,SuiteInfo,SuiteReqs);
Clashes ->
{error,{config_name_already_in_use,Clashes}}
end.
@@ -372,16 +363,12 @@ get_suite_name(Mod, _) ->
Mod.
%% Check that alias names are not already in use
-check_for_clashes(TCInfo, GrPathInfo, SuiteInfo) ->
- {CurrGrInfo,SearchIn} = case GrPathInfo of
- [] -> {[],[SuiteInfo]};
- [Curr|Path] -> {Curr,[SuiteInfo|Path]}
- end,
+check_for_clashes(TCInfo, [CurrGrInfo|Path], SuiteInfo) ->
ReqNames = fun(Info) -> [element(2,R) || R <- Info,
size(R) == 3,
require == element(1,R)]
end,
- ExistingNames = lists:flatten([ReqNames(L) || L <- SearchIn]),
+ ExistingNames = lists:flatten([ReqNames(L) || L <- [SuiteInfo|Path]]),
CurrGrReqNs = ReqNames(CurrGrInfo),
GrClashes = [Name || Name <- CurrGrReqNs,
true == lists:member(Name, ExistingNames)],
@@ -421,34 +408,25 @@ keysmember([Key,Pos|Next], List) ->
keysmember([], _) -> true.
-add_defaults2(Mod,init_per_suite, IPSInfo, SuiteInfo,SuiteReqs, false) ->
- add_defaults2(Mod,init_per_suite, IPSInfo, SuiteInfo,SuiteReqs, true);
+add_defaults2(_Mod,init_per_suite, IPSInfo, SuiteInfo,SuiteReqs) ->
+ Info = lists:flatten([IPSInfo, SuiteReqs]),
+ lists:flatten([Info,remove_info_in_prev(Info, [SuiteInfo])]);
-add_defaults2(_Mod,IPG, IPGAndGroupInfo, SuiteInfo,SuiteReqs, DoInit) when
- IPG == init_per_group ; IPG == ct_init_per_group ->
- %% If DoInit == true, we have to process the suite() list, otherwise
- %% it has already been handled (see clause for init_per_suite)
- case DoInit of
- true ->
- %% note: we know for sure this is a top level group
- Info = lists:flatten([IPGAndGroupInfo, SuiteReqs]),
- Info ++ remove_info_in_prev(Info, [SuiteInfo]);
- false ->
- SuiteInfo1 =
- remove_info_in_prev(lists:flatten([IPGAndGroupInfo,
- SuiteReqs]), [SuiteInfo]),
- %% don't require terms in prev groups (already processed)
- case IPGAndGroupInfo of
- [IPGInfo] ->
- lists:flatten([IPGInfo,SuiteInfo1]);
- [IPGInfo | [CurrGroupInfo | PrevGroupInfo]] ->
- PrevGroupInfo1 = delete_require_terms(PrevGroupInfo),
- lists:flatten([IPGInfo,CurrGroupInfo,PrevGroupInfo1,
- SuiteInfo1])
- end
+add_defaults2(_Mod,init_per_group, IPGAndGroupInfo, SuiteInfo,SuiteReqs) ->
+ SuiteInfo1 =
+ remove_info_in_prev(lists:flatten([IPGAndGroupInfo,
+ SuiteReqs]), [SuiteInfo]),
+ %% don't require terms in prev groups (already processed)
+ case IPGAndGroupInfo of
+ [IPGInfo] ->
+ lists:flatten([IPGInfo,SuiteInfo1]);
+ [IPGInfo | [CurrGroupInfo | PrevGroupInfo]] ->
+ PrevGroupInfo1 = delete_require_terms(PrevGroupInfo),
+ lists:flatten([IPGInfo,CurrGroupInfo,PrevGroupInfo1,
+ SuiteInfo1])
end;
-add_defaults2(_Mod,_Func, TCAndGroupInfo, SuiteInfo,SuiteReqs, false) ->
+add_defaults2(_Mod,_Func, TCAndGroupInfo, SuiteInfo,SuiteReqs) ->
%% Include require elements from test case info and current group,
%% but not from previous groups or suite/0 (since we've already required
%% those vars). Let test case info elements override group and suite
@@ -463,14 +441,7 @@ add_defaults2(_Mod,_Func, TCAndGroupInfo, SuiteInfo,SuiteReqs, false) ->
PrevGroupInfo1 = delete_require_terms(PrevGroupInfo),
lists:flatten([TCInfo,CurrGroupInfo,PrevGroupInfo1,
SuiteInfo1])
- end;
-
-add_defaults2(_Mod,_Func, TCInfo, SuiteInfo,SuiteReqs, true) ->
- %% Here we have to process the suite info list also (no call to
- %% init_per_suite before this first test case). This TC can't belong
- %% to a group, or the clause for (ct_)init_per_group would've caught this.
- Info = lists:flatten([TCInfo, SuiteReqs]),
- lists:flatten([Info,remove_info_in_prev(Info, [SuiteInfo])]).
+ end.
delete_require_terms([Info | Prev]) ->
Info1 = [T || T <- Info,
@@ -506,15 +477,16 @@ timetrap_first([],Info,[]) ->
timetrap_first([],Info,Found) ->
?rev(Found) ++ ?rev(Info).
-configure([{require,Required}|Rest],Info,SuiteInfo,Scope,Config) ->
+configure([{require,Required}|Rest],
+ Info,SuiteInfo,Scope,PostInitHook,Config) ->
case ct:require(Required) of
ok ->
- configure(Rest,Info,SuiteInfo,Scope,Config);
+ configure(Rest,Info,SuiteInfo,Scope,PostInitHook,Config);
Error = {error,Reason} ->
case required_default('_UNDEF',Required,Info,
SuiteInfo,Scope) of
ok ->
- configure(Rest,Info,SuiteInfo,Scope,Config);
+ configure(Rest,Info,SuiteInfo,Scope,PostInitHook,Config);
_ ->
case lists:keymember(Required,2,SuiteInfo) of
true ->
@@ -524,14 +496,15 @@ configure([{require,Required}|Rest],Info,SuiteInfo,Scope,Config) ->
end
end
end;
-configure([{require,Name,Required}|Rest],Info,SuiteInfo,Scope,Config) ->
+configure([{require,Name,Required}|Rest],
+ Info,SuiteInfo,Scope,PostInitHook,Config) ->
case ct:require(Name,Required) of
ok ->
- configure(Rest,Info,SuiteInfo,Scope,Config);
+ configure(Rest,Info,SuiteInfo,Scope,PostInitHook,Config);
Error = {error,Reason} ->
case required_default(Name,Required,Info,SuiteInfo,Scope) of
ok ->
- configure(Rest,Info,SuiteInfo,Scope,Config);
+ configure(Rest,Info,SuiteInfo,Scope,PostInitHook,Config);
_ ->
case lists:keymember(Name,2,SuiteInfo) of
true ->
@@ -541,35 +514,33 @@ configure([{require,Name,Required}|Rest],Info,SuiteInfo,Scope,Config) ->
end
end
end;
-configure([{timetrap,off}|Rest],Info,SuiteInfo,Scope,Config) ->
- configure(Rest,Info,SuiteInfo,Scope,Config);
-configure([{timetrap,Time}|Rest],Info,SuiteInfo,Scope,Config) ->
- Dog = test_server:timetrap(Time),
- configure(Rest,Info,SuiteInfo,Scope,[{watchdog,Dog}|Config]);
-configure([{ct_hooks, Hook} | Rest], Info, SuiteInfo, Scope, Config) ->
- configure(Rest, Info, SuiteInfo, Scope, [{ct_hooks, Hook} | Config]);
-configure([_|Rest],Info,SuiteInfo,Scope,Config) ->
- configure(Rest,Info,SuiteInfo,Scope,Config);
-configure([],_,_,_,Config) ->
- {ok,[Config]}.
+configure([{timetrap,off}|Rest],Info,SuiteInfo,Scope,PostInitHook,Config) ->
+ configure(Rest,Info,SuiteInfo,Scope,PostInitHook,Config);
+configure([{timetrap,Time}|Rest],Info,SuiteInfo,Scope,PostInitHook,Config) ->
+ PostInitHook1 =
+ [{watchdog,fun() -> case test_server:get_timetrap_info() of
+ undefined ->
+ test_server:timetrap(Time);
+ _ ->
+ {error,already_set}
+ end
+ end} | PostInitHook],
+ configure(Rest,Info,SuiteInfo,Scope,PostInitHook1,Config);
+configure([{ct_hooks,Hook}|Rest],Info,SuiteInfo,Scope,PostInitHook,Config) ->
+ configure(Rest,Info,SuiteInfo,Scope,PostInitHook,[{ct_hooks,Hook}|Config]);
+configure([_|Rest],Info,SuiteInfo,Scope,PostInitHook,Config) ->
+ configure(Rest,Info,SuiteInfo,Scope,PostInitHook,Config);
+configure([],_,_,_,PostInitHook,Config) ->
+ {ok,PostInitHook,Config}.
%% the require element in Info may come from suite/0 and
%% should be scoped 'suite', or come from the group info
%% function and be scoped 'group', or come from the testcase
%% info function and then be scoped 'testcase'
-required_default(Name,Key,Info,SuiteInfo,{FuncSpec,true}) ->
- case try_set_default(Name,Key,SuiteInfo,suite) of
- ok ->
- ok;
- _ ->
- required_default(Name,Key,Info,[],{FuncSpec,false})
- end;
-required_default(Name,Key,Info,_,{init_per_suite,_}) ->
+required_default(Name,Key,Info,_,init_per_suite) ->
try_set_default(Name,Key,Info,suite);
-required_default(Name,Key,Info,_,{{init_per_group,GrName,_},_}) ->
- try_set_default(Name,Key,Info,{group,GrName});
-required_default(Name,Key,Info,_,{{ct_init_per_group,GrName,_},_}) ->
+required_default(Name,Key,Info,_,{init_per_group,GrName,_}) ->
try_set_default(Name,Key,Info,{group,GrName});
required_default(Name,Key,Info,_,_FuncSpec) ->
try_set_default(Name,Key,Info,testcase).
@@ -621,10 +592,11 @@ end_tc(Mod,Func,{Result,[Args]}, Return) ->
end_tc(Mod,Func,self(),Result,Args,Return).
end_tc(Mod,Func,TCPid,Result,Args,Return) ->
- case lists:keysearch(watchdog,1,Args) of
- {value,{watchdog,Dog}} -> test_server:timetrap_cancel(Dog);
- false -> ok
- end,
+ %% in case Mod == ct_framework, lookup the suite name
+ Suite = get_suite_name(Mod, Args),
+
+ test_server:timetrap_cancel(),
+
%% save the testcase process pid so that it can be used
%% to look up the attached trace window later
case ct_util:get_testdata(interpret) of
@@ -636,61 +608,78 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) ->
end,
ct_util:delete_testdata(comment),
ct_util:delete_suite_data(last_saved_config),
- FuncSpec =
- case group_or_func(Func,Args) of
- {_,GroupName,_Props} = Group ->
- if Func == end_per_group; Func == ct_end_per_group ->
- ct_config:delete_default_config({group,GroupName});
- true -> ok
- end,
- case lists:keysearch(save_config,1,Args) of
- {value,{save_config,SaveConfig}} ->
- ct_util:save_suite_data(
- last_saved_config,
- {Mod,{group,GroupName}},
- SaveConfig),
- Group;
- false ->
- Group
- end;
- _ ->
- case lists:keysearch(save_config,1,Args) of
- {value,{save_config,SaveConfig}} ->
- ct_util:save_suite_data(last_saved_config,
- {Mod,Func},SaveConfig),
- Func;
- false ->
- Func
- end
- end,
- ct_util:reset_silent_connections(),
+
+ FuncSpec = case group_or_func(Func,Args) of
+ {_,_GroupName,_} = Group -> Group;
+ _ -> Func
+ end,
case get('$test_server_framework_test') of
undefined ->
{FinalResult,FinalNotify} =
case ct_hooks:end_tc(
- Mod, FuncSpec, Args, Result, Return) of
+ Suite, FuncSpec, Args, Result, Return) of
'$ct_no_change' ->
{ok,Result};
FinalResult1 ->
{FinalResult1,FinalResult1}
end,
- % send sync notification so that event handlers may print
- % in the log file before it gets closed
+ %% send sync notification so that event handlers may print
+ %% in the log file before it gets closed
ct_event:sync_notify(#event{name=tc_done,
node=node(),
data={Mod,FuncSpec,
tag_cth(FinalNotify)}});
Fun ->
- % send sync notification so that event handlers may print
- % in the log file before it gets closed
+ %% send sync notification so that event handlers may print
+ %% in the log file before it gets closed
ct_event:sync_notify(#event{name=tc_done,
node=node(),
data={Mod,FuncSpec,tag(Result)}}),
FinalResult = Fun(end_tc, Return)
+ end,
+
+ case FuncSpec of
+ {_,GroupName,_Props} ->
+ if Func == end_per_group ->
+ ct_config:delete_default_config({group,GroupName});
+ true -> ok
+ end,
+ case lists:keysearch(save_config,1,Args) of
+ {value,{save_config,SaveConfig}} ->
+ ct_util:save_suite_data(last_saved_config,
+ {Suite,{group,GroupName}},
+ SaveConfig);
+ false ->
+ ok
+ end;
+ _ ->
+ case lists:keysearch(save_config,1,Args) of
+ {value,{save_config,SaveConfig}} ->
+ ct_util:save_suite_data(last_saved_config,
+ {Suite,Func},SaveConfig);
+ false ->
+ ok
+ end
end,
-
+ ct_util:reset_silent_connections(),
+
+ %% reset the curr_tc state, or delete this TC from the list of
+ %% executing cases (if in a parallel group)
+ ClearCurrTC = fun(Running = [_,_|_]) ->
+ lists:keydelete(Func,2,Running);
+ ({_,{suite0_failed,_}}) ->
+ undefined;
+ ([{_,CurrTC}]) when CurrTC == Func ->
+ undefined;
+ (undefined) ->
+ undefined;
+ (Unexpected) ->
+ exit({error,{reset_curr_tc,{Mod,Func},Unexpected}})
+ end,
+ ct_util:update_testdata(curr_tc,ClearCurrTC),
+
case FinalResult of
{skip,{sequence_failed,_,_}} ->
%% ct_logs:init_tc is never called for a skipped test case
@@ -706,7 +695,7 @@ end_tc(Mod,Func,TCPid,Result,Args,Return) ->
end,
case Func of
end_per_suite ->
- ct_util:match_delete_suite_data({seq,Mod,'_'});
+ ct_util:match_delete_suite_data({seq,Suite,'_'});
_ ->
ok
end,
@@ -806,31 +795,36 @@ error_notification(Mod,Func,_Args,{Error,Loc}) ->
end
end,
- io:format(user, "~n- - - - - - - - - - - - - - - - "
- "- - - - - - - - - -~n", []),
+ PrintErr = fun(ErrFormat, ErrArgs) ->
+ Div = "~n- - - - - - - - - - - - - - - - "
+ "- - - - - - - - - -~n",
+ io:format(user, lists:concat([Div,ErrFormat,Div,"~n"]),
+ ErrArgs),
+ ct_logs:tc_log(ct_error_notify, "CT Error Notification",
+ ErrFormat, ErrArgs)
+ end,
case Loc of
- %% we don't use the line parse transform as we compile this
- %% module so location will be on form {M,F}
[{?MODULE,error_in_suite}] ->
- io:format(user, "Error in suite detected: ~s", [ErrStr]);
+ PrintErr("Error in suite detected: ~s", [ErrStr]);
- R when R == unknown; R == undefined ->
- io:format(user, "Error detected: ~s", [ErrStr]);
+ R when R == unknown; R == undefined ->
+ PrintErr("Error detected: ~s", [ErrStr]);
%% if a function specified by all/0 does not exist, we
%% pick up undef here
- [{LastMod,LastFunc}] ->
- io:format(user, "~w:~w could not be executed~n",
- [LastMod,LastFunc]),
- io:format(user, "Reason: ~s", [ErrStr]);
+ [{LastMod,LastFunc}|_] when ErrStr == "undef" ->
+ PrintErr("~w:~w could not be executed~nReason: ~s",
+ [LastMod,LastFunc,ErrStr]);
+
+ [{LastMod,LastFunc}|_] ->
+ PrintErr("~w:~w failed~nReason: ~s", [LastMod,LastFunc,ErrStr]);
[{LastMod,LastFunc,LastLine}|_] ->
%% print error to console, we are only
%% interested in the last executed expression
- io:format(user, "~w:~w failed on line ~w~n",
- [LastMod,LastFunc,LastLine]),
- io:format(user, "Reason: ~s", [ErrStr]),
-
+ PrintErr("~w:~w failed on line ~w~nReason: ~s",
+ [LastMod,LastFunc,LastLine,ErrStr]),
+
case ct_util:read_suite_data({seq,Mod,Func}) of
undefined ->
ok;
@@ -839,8 +833,6 @@ error_notification(Mod,Func,_Args,{Error,Loc}) ->
mark_as_failed(Seq,Mod,Func,SeqTCs)
end
end,
- io:format(user, "~n- - - - - - - - - - - - - - - - "
- "- - - - - - - - - -~n~n", []),
ok.
%% cases in seq that have already run
@@ -861,9 +853,7 @@ mark_as_failed1(_,_,_,[]) ->
ok.
group_or_func(Func, Config) when Func == init_per_group;
- Func == end_per_group;
- Func == ct_init_per_group;
- Func == ct_end_per_group ->
+ Func == end_per_group ->
case ?val(tc_group_properties, Config) of
undefined ->
{Func,unknown,[]};
@@ -1206,8 +1196,8 @@ make_conf(Mod, Name, Props, TestSpec) ->
"end_per_group/2 missing for group "
"~p in ~p, using default.",
[Name,Mod]),
- {{?MODULE,ct_init_per_group},
- {?MODULE,ct_end_per_group},
+ {{?MODULE,init_per_group},
+ {?MODULE,end_per_group},
[{suite,Mod}]}
end,
{conf,[{name,Name}|Props++ExtraProps],InitConf,TestSpec,EndConf}.
@@ -1467,22 +1457,31 @@ error_in_suite(Config) ->
Reason = test_server:lookup_config(error,Config),
exit(Reason).
+%% if init_per_suite and end_per_suite are missing in the suite,
+%% these will be called instead (without any trace of them in the
+%% log files), only so that it's possible to call hook functions
+%% for configuration
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(_Config) ->
+ ok.
+
%% if the group config functions are missing in the suite,
%% use these instead
-ct_init_per_group(GroupName, Config) ->
+init_per_group(GroupName, Config) ->
ct:comment(io_lib:format("start of ~p", [GroupName])),
ct_logs:log("TEST INFO", "init_per_group/2 for ~w missing "
"in suite, using default.",
[GroupName]),
Config.
-ct_end_per_group(GroupName, _) ->
+end_per_group(GroupName, _) ->
ct:comment(io_lib:format("end of ~p", [GroupName])),
ct_logs:log("TEST INFO", "end_per_group/2 for ~w missing "
"in suite, using default.",
[GroupName]),
ok.
-
%%%-----------------------------------------------------------------
%%% @spec report(What,Data) -> ok
@@ -1530,6 +1529,12 @@ report(What,Data) ->
end;
tests_done ->
ok;
+ severe_error ->
+ ct_event:sync_notify(#event{name=What,
+ node=node(),
+ data=Data}),
+ ct_util:set_testdata({What,Data}),
+ ok;
tc_start ->
%% Data = {{Suite,Func},LogFileName}
ct_event:sync_notify(#event{name=tc_logfile,
@@ -1559,10 +1564,6 @@ report(What,Data) ->
ok;
{end_per_group,_} ->
ok;
- {ct_init_per_group,_} ->
- ok;
- {ct_end_per_group,_} ->
- ok;
{_,ok} ->
add_to_stats(ok);
{_,{skipped,{failed,{_,init_per_testcase,_}}}} ->
@@ -1599,8 +1600,7 @@ report(What,Data) ->
data=Data}),
ct_hooks:on_tc_skip(What, Data),
if Case /= end_per_suite,
- Case /= end_per_group,
- Case /= ct_end_per_group ->
+ Case /= end_per_group ->
add_to_stats(auto_skipped);
true ->
ok
@@ -1686,5 +1686,5 @@ format_comment(Comment) ->
%%%-----------------------------------------------------------------
%%% @spec get_html_wrapper(TestName, PrintLabel, Cwd) -> Header
-get_html_wrapper(TestName, PrintLabel, Cwd) ->
- ct_logs:get_ts_html_wrapper(TestName, PrintLabel, Cwd).
+get_html_wrapper(TestName, PrintLabel, Cwd, TableCols) ->
+ ct_logs:get_ts_html_wrapper(TestName, PrintLabel, Cwd, TableCols).
diff --git a/lib/common_test/src/ct_ftp.erl b/lib/common_test/src/ct_ftp.erl
index 5db73066a3..8790393b36 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -66,6 +66,7 @@
%%% {unix,[{ftp,IpAddr},
%%% {username,Username},
%%% {password,Password}]}.</pre>
+%%% @see ct:require/2
put(KeyOrName,LocalFile,RemoteFile) ->
Fun = fun(Ftp) -> send(Ftp,LocalFile,RemoteFile) end,
open_and_do(KeyOrName,Fun).
@@ -85,6 +86,7 @@ put(KeyOrName,LocalFile,RemoteFile) ->
%%%
%%% <p>The config file must be as for put/3.</p>
%%% @see put/3
+%%% @see ct:require/2
get(KeyOrName,RemoteFile,LocalFile) ->
Fun = fun(Ftp) -> recv(Ftp,RemoteFile,LocalFile) end,
open_and_do(KeyOrName,Fun).
@@ -105,6 +107,10 @@ get(KeyOrName,RemoteFile,LocalFile) ->
%%% simply use <code>Key</code>, the configuration variable name, to
%%% specify the target. Note that a connection that has no associated target
%%% name can only be closed with the handle value.</p>
+%%%
+%%% <p>See <c>ct:require/2</c> for how to create a new <c>Name</c></p>
+%%%
+%%% @see ct:require/2
open(KeyOrName) ->
case ct_util:get_key_from_name(KeyOrName) of
{ok,node} ->
diff --git a/lib/common_test/src/ct_gen_conn.erl b/lib/common_test/src/ct_gen_conn.erl
index 5aab4dd2dd..1f01d84601 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -27,7 +27,7 @@
-compile(export_all).
-export([start/4, stop/1]).
--export([call/2, do_within_time/2]).
+-export([call/2, call/3, return/2, do_within_time/2]).
-ifdef(debug).
-define(dbg,true).
@@ -39,17 +39,24 @@
name,
address,
init_data,
+ reconnect = true,
+ forward = false,
+ use_existing = true,
+ old = false,
conn_pid,
cb_state,
ct_util_server}).
%%%-----------------------------------------------------------------
-%%% @spec start(Name,Address,InitData,CallbackMod) ->
+%%% @spec start(Address,InitData,CallbackMod,Opts) ->
%%% {ok,Handle} | {error,Reason}
%%% Name = term()
%%% CallbackMod = atom()
%%% InitData = term()
%%% Address = term()
+%%% Opts = [Opt]
+%%% Opt = {name,Name} | {use_existing_connection,boolean()} |
+%%% {reconnect,boolean()} | {forward_messages,boolean()}
%%%
%%% @doc Open a connection and start the generic connection owner process.
%%%
@@ -60,50 +67,67 @@
%%% <code>InitData</code> and returna
%%% <code>{ok,ConnectionPid,State}</code> or
%%% <code>{error,Reason}</code>.</p>
+%%%
+%%% If no name is given, the <code>Name</code> argument in init/3 will
+%%% have the value <code>undefined</code>.
+%%%
+%%% The callback modules must also export
+%%% ```
+%%% handle_msg(Msg,From,State) -> {reply,Reply,State} |
+%%% {noreply,State} |
+%%% {stop,Reply,State}
+%%% terminate(ConnectionPid,State) -> term()
+%%% close(Handle) -> term()
+%%% '''
+%%%
+%%% The <code>close/1</code> callback function is actually a callback
+%%% for ct_util, for closing registered connections when
+%%% ct_util_server is terminated. <code>Handle</code> is the Pid of
+%%% the ct_gen_conn process.
+%%%
+%%% If option <code>reconnect</code> is <code>true</code>, then the
+%%% callback must also export
+%%% ```
+%%% reconnect(Address,State) -> {ok,ConnectionPid,State}
+%%% '''
+%%%
+%%% If option <code>forward_messages</code> is <ocde>true</code>, then
+%%% the callback must also export
+%%% ```
+%%% handle_msg(Msg,State) -> {noreply,State} | {stop,State}
+%%% '''
+%%%
+%%% An old interface still exists. This is used by ct_telnet, ct_ftp
+%%% and ct_ssh. The start function then has an explicit
+%%% <code>Name</code> argument, and no <code>Opts</code> argument. The
+%%% callback must export:
+%%%
+%%% ```
+%%% init(Name,Address,InitData) -> {ok,ConnectionPid,State}
+%%% handle_msg(Msg,State) -> {Reply,State}
+%%% reconnect(Address,State) -> {ok,ConnectionPid,State}
+%%% terminate(ConnectionPid,State) -> term()
+%%% close(Handle) -> term()
+%%% '''
+%%%
+start(Address,InitData,CallbackMod,Opts) when is_list(Opts) ->
+ do_start(Address,InitData,CallbackMod,Opts);
start(Name,Address,InitData,CallbackMod) ->
- case ct_util:does_connection_exist(Name,Address,CallbackMod) of
- {ok,Pid} ->
- log("ct_gen_conn:start","Using existing connection!\n",[]),
- {ok,Pid};
- false ->
- Self = self(),
- Pid = spawn(fun() ->
- init_gen(Self, #gen_opts{callback=CallbackMod,
- name=Name,
- address=Address,
- init_data=InitData})
- end),
- MRef = erlang:monitor(process,Pid),
- receive
- {connected,Pid} ->
- erlang:demonitor(MRef, [flush]),
- ct_util:register_connection(Name,Address,CallbackMod,Pid),
- {ok,Pid};
- {Error,Pid} ->
- receive {'DOWN',MRef,process,_,_} -> ok end,
- Error;
- {'DOWN',MRef,process,_,Reason} ->
- log("ct_gen_conn:start",
- "Connection process died: ~p\n",
- [Reason]),
- {error,{connection_process_died,Reason}}
- end
- end.
-
+ do_start(Address,InitData,CallbackMod,[{name,Name},{old,true}]).
%%%-----------------------------------------------------------------
%%% @spec stop(Handle) -> ok
%%% Handle = handle()
%%%
-%%% @doc Close the telnet connection and stop the process managing it.
+%%% @doc Close the connection and stop the process managing it.
stop(Pid) ->
- call(Pid,stop).
+ call(Pid,stop,5000).
%%%-----------------------------------------------------------------
%%% @spec log(Heading,Format,Args) -> ok
%%%
%%% @doc Log activities on the current connection (tool-internal use only).
-%%% @see ct_logs:log/3
+%%% @see ct_logs:log/3
log(Heading,Format,Args) ->
log(log,[Heading,Format,Args]).
@@ -111,7 +135,7 @@ log(Heading,Format,Args) ->
%%% @spec start_log(Heading) -> ok
%%%
%%% @doc Log activities on the current connection (tool-internal use only).
-%%% @see ct_logs:start_log/1
+%%% @see ct_logs:start_log/1
start_log(Heading) ->
log(start_log,[Heading]).
@@ -119,7 +143,7 @@ start_log(Heading) ->
%%% @spec cont_log(Format,Args) -> ok
%%%
%%% @doc Log activities on the current connection (tool-internal use only).
-%%% @see ct_logs:cont_log/2
+%%% @see ct_logs:cont_log/2
cont_log(Format,Args) ->
log(cont_log,[Format,Args]).
@@ -127,7 +151,7 @@ cont_log(Format,Args) ->
%%% @spec end_log() -> ok
%%%
%%% @doc Log activities on the current connection (tool-internal use only).
-%%% @see ct_logs:end_log/0
+%%% @see ct_logs:end_log/0
end_log() ->
log(end_log,[]).
@@ -148,10 +172,10 @@ do_within_time(Fun,Timeout) ->
Silent = get(silent),
TmpPid = spawn_link(fun() -> put(silent,Silent),
R = Fun(),
- Self ! {self(),R}
+ Self ! {self(),R}
end),
ConnPid = get(conn_pid),
- receive
+ receive
{TmpPid,Result} ->
Result;
{'EXIT',ConnPid,_Reason}=M ->
@@ -159,7 +183,7 @@ do_within_time(Fun,Timeout) ->
exit(TmpPid,kill),
self() ! M,
{error,connection_closed}
- after
+ after
Timeout ->
exit(TmpPid,kill),
receive
@@ -176,12 +200,66 @@ do_within_time(Fun,Timeout) ->
%%%=================================================================
%%% Internal functions
-call(Pid,Msg) ->
+do_start(Address,InitData,CallbackMod,Opts0) ->
+ Opts = check_opts(Opts0,#gen_opts{callback=CallbackMod,
+ address=Address,
+ init_data=InitData}),
+ case ct_util:does_connection_exist(Opts#gen_opts.name,
+ Address,CallbackMod) of
+ {ok,Pid} when Opts#gen_opts.use_existing ->
+ log("ct_gen_conn:start","Using existing connection!\n",[]),
+ {ok,Pid};
+ {ok,Pid} when not Opts#gen_opts.use_existing ->
+ {error,{connection_exists,Pid}};
+ false ->
+ do_start(Opts)
+ end.
+
+do_start(Opts) ->
+ Self = self(),
+ Pid = spawn(fun() -> init_gen(Self, Opts) end),
+ MRef = erlang:monitor(process,Pid),
+ receive
+ {connected,Pid} ->
+ erlang:demonitor(MRef, [flush]),
+ ct_util:register_connection(Opts#gen_opts.name, Opts#gen_opts.address,
+ Opts#gen_opts.callback, Pid),
+ {ok,Pid};
+ {Error,Pid} ->
+ receive {'DOWN',MRef,process,_,_} -> ok end,
+ Error;
+ {'DOWN',MRef,process,_,Reason} ->
+ log("ct_gen_conn:start",
+ "Connection process died: ~p\n",
+ [Reason]),
+ {error,{connection_process_died,Reason}}
+ end.
+
+check_opts(Opts0) ->
+ check_opts(Opts0,#gen_opts{}).
+
+check_opts([{name,Name}|T],Opts) ->
+ check_opts(T,Opts#gen_opts{name=Name});
+check_opts([{reconnect,Bool}|T],Opts) ->
+ check_opts(T,Opts#gen_opts{reconnect=Bool});
+check_opts([{forward_messages,Bool}|T],Opts) ->
+ check_opts(T,Opts#gen_opts{forward=Bool});
+check_opts([{use_existing_connection,Bool}|T],Opts) ->
+ check_opts(T,Opts#gen_opts{use_existing=Bool});
+check_opts([{old,Bool}|T],Opts) ->
+ check_opts(T,Opts#gen_opts{old=Bool});
+check_opts([],Opts) ->
+ Opts.
+
+call(Pid, Msg) ->
+ call(Pid, Msg, infinity).
+
+call(Pid, Msg, Timeout) ->
MRef = erlang:monitor(process,Pid),
Ref = make_ref(),
Pid ! {Msg,{self(),Ref}},
receive
- {Ref, Result} ->
+ {Ref, Result} ->
erlang:demonitor(MRef, [flush]),
case Result of
{retry,_Data} ->
@@ -189,8 +267,15 @@ call(Pid,Msg) ->
Other ->
Other
end;
- {'DOWN',MRef,process,_,Reason} ->
+ {'DOWN',MRef,process,_,Reason} ->
{error,{process_down,Pid,Reason}}
+ after Timeout ->
+ erlang:demonitor(MRef, [flush]),
+ log("ct_gen_conn",
+ "Connection process ~p not responding. Killing now!",
+ [Pid]),
+ exit(Pid, kill),
+ {error,{process_down,Pid,forced_termination}}
end.
return({To,Ref},Result) ->
@@ -198,36 +283,47 @@ return({To,Ref},Result) ->
init_gen(Parent,Opts) ->
process_flag(trap_exit,true),
- CtUtilServer = whereis(ct_util_server),
- link(CtUtilServer),
put(silent,false),
- case catch (Opts#gen_opts.callback):init(Opts#gen_opts.name,
- Opts#gen_opts.address,
- Opts#gen_opts.init_data) of
+ try (Opts#gen_opts.callback):init(Opts#gen_opts.name,
+ Opts#gen_opts.address,
+ Opts#gen_opts.init_data) of
{ok,ConnPid,State} when is_pid(ConnPid) ->
link(ConnPid),
put(conn_pid,ConnPid),
+ CtUtilServer = whereis(ct_util_server),
+ link(CtUtilServer),
Parent ! {connected,self()},
loop(Opts#gen_opts{conn_pid=ConnPid,
cb_state=State,
ct_util_server=CtUtilServer});
{error,Reason} ->
Parent ! {{error,Reason},self()}
+ catch
+ throw:{error,Reason} ->
+ Parent ! {{error,Reason},self()}
end.
loop(Opts) ->
receive
{'EXIT',Pid,Reason} when Pid==Opts#gen_opts.conn_pid ->
- log("Connection down!\nOpening new!","Reason: ~p\nAddress: ~p\n",
- [Reason,Opts#gen_opts.address]),
- case reconnect(Opts) of
- {ok, NewPid, NewState} ->
- link(NewPid),
- put(conn_pid,NewPid),
- loop(Opts#gen_opts{conn_pid=NewPid,cb_state=NewState});
- Error ->
+ case Opts#gen_opts.reconnect of
+ true ->
+ log("Connection down!\nOpening new!",
+ "Reason: ~p\nAddress: ~p\n",
+ [Reason,Opts#gen_opts.address]),
+ case reconnect(Opts) of
+ {ok, NewPid, NewState} ->
+ link(NewPid),
+ put(conn_pid,NewPid),
+ loop(Opts#gen_opts{conn_pid=NewPid,cb_state=NewState});
+ Error ->
+ ct_util:unregister_connection(self()),
+ log("Reconnect failed. Giving up!","Reason: ~p\n",
+ [Error])
+ end;
+ false ->
ct_util:unregister_connection(self()),
- log("Reconnect failed. Giving up!","Reason: ~p\n",[Error])
+ log("Connection closed!","Reason: ~p\n",[Reason])
end;
{'EXIT',Pid,Reason} ->
case Opts#gen_opts.ct_util_server of
@@ -252,24 +348,40 @@ loop(Opts) ->
loop(Opts);
{{retry,{_Error,_Name,_CPid,Msg}}, From} ->
log("Rerunning command","Connection reestablished. Rerunning command...",[]),
- {Return,NewState} =
+ {Return,NewState} =
(Opts#gen_opts.callback):handle_msg(Msg,Opts#gen_opts.cb_state),
return(From, Return),
- loop(Opts#gen_opts{cb_state=NewState});
- {Msg,From={Pid,_Ref}} when is_pid(Pid) ->
- {Return,NewState} =
+ loop(Opts#gen_opts{cb_state=NewState});
+ {Msg,From={Pid,_Ref}} when is_pid(Pid), Opts#gen_opts.old==true ->
+ {Return,NewState} =
(Opts#gen_opts.callback):handle_msg(Msg,Opts#gen_opts.cb_state),
return(From, Return),
- loop(Opts#gen_opts{cb_state=NewState})
+ loop(Opts#gen_opts{cb_state=NewState});
+ {Msg,From={Pid,_Ref}} when is_pid(Pid) ->
+ case (Opts#gen_opts.callback):handle_msg(Msg,From,
+ Opts#gen_opts.cb_state) of
+ {reply,Reply,NewState} ->
+ return(From,Reply),
+ loop(Opts#gen_opts{cb_state=NewState});
+ {noreply,NewState} ->
+ loop(Opts#gen_opts{cb_state=NewState});
+ {stop,Reply,NewState} ->
+ ct_util:unregister_connection(self()),
+ (Opts#gen_opts.callback):terminate(Opts#gen_opts.conn_pid,
+ NewState),
+ return(From,Reply)
+ end;
+ Msg when Opts#gen_opts.forward==true ->
+ case (Opts#gen_opts.callback):handle_msg(Msg,Opts#gen_opts.cb_state) of
+ {noreply,NewState} ->
+ loop(Opts#gen_opts{cb_state=NewState});
+ {stop,NewState} ->
+ ct_util:unregister_connection(self()),
+ (Opts#gen_opts.callback):terminate(Opts#gen_opts.conn_pid,
+ NewState)
+ end
end.
-nozero({ok,S}) when is_list(S) ->
- {ok,[C || C <- S,
- C=/=0,
- C=/=13]};
-nozero(M) ->
- M.
-
reconnect(Opts) ->
(Opts#gen_opts.callback):reconnect(Opts#gen_opts.address,
Opts#gen_opts.cb_state).
@@ -277,10 +389,8 @@ reconnect(Opts) ->
log(Func,Args) ->
case get(silent) of
- true when not ?dbg->
+ true when not ?dbg->
ok;
_ ->
apply(ct_logs,Func,Args)
end.
-
-
diff --git a/lib/common_test/src/ct_hooks.erl b/lib/common_test/src/ct_hooks.erl
index c42adbbdd9..1bcc63738e 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -48,7 +48,7 @@
%% @doc Called before any suites are started
-spec init(State :: term()) -> ok |
- {error, Reason :: term()}.
+ {fail, Reason :: term()}.
init(Opts) ->
call(get_new_hooks(Opts, undefined) ++ get_builtin_hooks(Opts),
ok, init, []).
@@ -70,8 +70,7 @@ terminate(Hooks) ->
{skip, Reason :: term()} |
{auto_skip, Reason :: term()} |
{fail, Reason :: term()}.
-init_tc(ct_framework, _Func, Args) ->
- Args;
+
init_tc(Mod, init_per_suite, Config) ->
Info = try proplists:get_value(ct_hooks, Mod:suite(),[]) of
List when is_list(List) ->
@@ -104,27 +103,21 @@ init_tc(_Mod, TC, Config) ->
{auto_skip, Reason :: term()} |
{fail, Reason :: term()} |
ok | '$ct_no_change'.
-end_tc(ct_framework, _Func, _Args, Result, _Return) ->
- Result;
end_tc(Mod, init_per_suite, Config, _Result, Return) ->
call(fun call_generic/3, Return, [post_init_per_suite, Mod, Config],
'$ct_no_change');
-
end_tc(Mod, end_per_suite, Config, Result, _Return) ->
call(fun call_generic/3, Result, [post_end_per_suite, Mod, Config],
'$ct_no_change');
-
end_tc(_Mod, {init_per_group, GroupName, _}, Config, _Result, Return) ->
call(fun call_generic/3, Return, [post_init_per_group, GroupName, Config],
'$ct_no_change');
-
end_tc(Mod, {end_per_group, GroupName, Opts}, Config, Result, _Return) ->
Res = call(fun call_generic/3, Result,
[post_end_per_group, GroupName, Config], '$ct_no_change'),
maybe_stop_locker(Mod, GroupName,Opts),
Res;
-
end_tc(_Mod, TC, Config, Result, _Return) ->
call(fun call_generic/3, Result, [post_end_per_testcase, TC, Config],
'$ct_no_change').
@@ -199,12 +192,12 @@ call([{Hook, call_id, NextFun} | Rest], Config, Meta, Hooks) ->
case lists:keyfind(NewId, #ct_hook_config.id, Hooks) of
false when NextFun =:= undefined ->
{Hooks ++ [NewHook],
- [{NewId, call_init} | Rest]};
+ Rest ++ [{NewId, call_init}]};
ExistingHook when is_tuple(ExistingHook) ->
{Hooks, Rest};
_ ->
{Hooks ++ [NewHook],
- [{NewId, call_init}, {NewId,NextFun} | Rest]}
+ Rest ++ [{NewId, call_init}, {NewId,NextFun}]}
end,
call(resort(NewRest,NewHooks,Meta), Config, Meta, NewHooks)
catch Error:Reason ->
@@ -360,11 +353,10 @@ pos(Id,[_|Rest],Num) ->
pos(Id,Rest,Num+1).
-
catch_apply(M,F,A, Default) ->
try
apply(M,F,A)
- catch error:Reason ->
+ catch _:Reason ->
case erlang:get_stacktrace() of
%% Return the default if it was the CTH module which did not have the function.
[{M,F,A,_}|_] when Reason == undef ->
diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl
index 19ad7b26d8..0b7a8bb075 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -28,22 +28,25 @@
-module(ct_logs).
--export([init/1,close/2,init_tc/1,end_tc/1]).
--export([get_log_dir/0,get_log_dir/1]).
--export([log/3,start_log/1,cont_log/2,end_log/0]).
--export([set_stylesheet/2,clear_stylesheet/1]).
--export([add_external_logs/1,add_link/3]).
+-export([init/2, close/2, init_tc/1, end_tc/1]).
+-export([get_log_dir/0, get_log_dir/1]).
+-export([log/3, start_log/1, cont_log/2, end_log/0]).
+-export([set_stylesheet/2, clear_stylesheet/1]).
+-export([add_external_logs/1, add_link/3]).
-export([make_last_run_index/0]).
-export([make_all_suites_index/1,make_all_runs_index/1]).
--export([get_ts_html_wrapper/3]).
+-export([get_ts_html_wrapper/4]).
+-export([xhtml/2, locate_priv_file/1, make_relative/1]).
+-export([insert_javascript/1]).
%% Logging stuff directly from testcase
--export([tc_log/3,tc_print/3,tc_pal/3,ct_log/3,
- basic_html/0]).
+-export([tc_log/3, tc_log/4, tc_log_async/3, tc_print/3, tc_print/4,
+ tc_pal/3, tc_pal/4, ct_log/3, basic_html/0]).
%% Simulate logger process for use without ct environment running
-export([simulate/0]).
+-include("ct.hrl").
-include("ct_event.hrl").
-include("ct_util.hrl").
-include_lib("kernel/include/file.hrl").
@@ -55,7 +58,6 @@
-define(all_runs_name, "all_runs.html").
-define(index_name, "index.html").
-define(totals_name, "totals.info").
--define(css_default, "ct_default.css").
-define(table_color1,"#ADD8E6").
-define(table_color2,"#E4F0FE").
@@ -78,9 +80,9 @@
%%% started. A new directory named ct_run.&lt;timestamp&gt; is created
%%% and all logs are stored under this directory.</p>
%%%
-init(Mode) ->
+init(Mode, Verbosity) ->
Self = self(),
- Pid = spawn_link(fun() -> logger(Self,Mode) end),
+ Pid = spawn_link(fun() -> logger(Self, Mode, Verbosity) end),
MRef = erlang:monitor(process,Pid),
receive
{started,Pid,Result} ->
@@ -239,7 +241,7 @@ end_tc(TCPid) ->
%%% activity it is. <code>Format</code> and <code>Args</code> is the
%%% data to log (as in <code>io:format(Format,Args)</code>).</p>
log(Heading,Format,Args) ->
- cast({log,self(),group_leader(),
+ cast({log,sync,self(),group_leader(),ct_internal,?MAX_IMPORTANCE,
[{int_header(),[log_timestamp(now()),Heading]},
{Format,Args},
{int_footer(),[]}]}),
@@ -261,7 +263,7 @@ log(Heading,Format,Args) ->
%%% @see cont_log/2
%%% @see end_log/0
start_log(Heading) ->
- cast({log,self(),group_leader(),
+ cast({log,sync,self(),group_leader(),ct_internal,?MAX_IMPORTANCE,
[{int_header(),[log_timestamp(now()),Heading]}]}),
ok.
@@ -276,7 +278,8 @@ cont_log([],[]) ->
ok;
cont_log(Format,Args) ->
maybe_log_timestamp(),
- cast({log,self(),group_leader(),[{Format,Args}]}),
+ cast({log,sync,self(),group_leader(),ct_internal,?MAX_IMPORTANCE,
+ [{Format,Args}]}),
ok.
%%%-----------------------------------------------------------------
@@ -287,7 +290,8 @@ cont_log(Format,Args) ->
%%% @see start_log/1
%%% @see cont_log/2
end_log() ->
- cast({log,self(),group_leader(),[{int_footer(), []}]}),
+ cast({log,sync,self(),group_leader(),ct_internal,?MAX_IMPORTANCE,
+ [{int_footer(), []}]}),
ok.
@@ -320,10 +324,16 @@ add_link(Heading,File,Type) ->
[filename:join("log_private",File),Type,File]).
-
%%%-----------------------------------------------------------------
%%% @spec tc_log(Category,Format,Args) -> ok
+%%% @equiv tc_log(Category,?STD_IMPORTANCE,Format,Args)
+tc_log(Category,Format,Args) ->
+ tc_log(Category,?STD_IMPORTANCE,Format,Args).
+
+%%%-----------------------------------------------------------------
+%%% @spec tc_log(Category,Importance,Format,Args) -> ok
%%% Category = atom()
+%%% Importance = integer()
%%% Format = string()
%%% Args = list()
%%%
@@ -332,41 +342,96 @@ add_link(Heading,File,Type) ->
%%% <p>This function is called by <code>ct</code> when logging
%%% stuff directly from a testcase (i.e. not from within the CT
%%% framework).</p>
-tc_log(Category,Format,Args) ->
- cast({log,self(),group_leader(),[{div_header(Category),[]},
- {Format,Args},
- {div_footer(),[]}]}),
+tc_log(Category,Importance,Format,Args) ->
+ tc_log(Category,Importance,"User",Format,Args).
+
+tc_log(Category,Importance,Printer,Format,Args) ->
+ cast({log,sync,self(),group_leader(),Category,Importance,
+ [{div_header(Category,Printer),[]},
+ {Format,Args},
+ {div_footer(),[]}]}),
ok.
%%%-----------------------------------------------------------------
-%%% @spec tc_print(Category,Format,Args) -> ok
+%%% @spec tc_log_async(Category,Format,Args) -> ok
+%%% @equiv tc_log_async(Category,?STD_IMPORTANCE,Format,Args)
+tc_log_async(Category,Format,Args) ->
+ tc_log_async(Category,?STD_IMPORTANCE,Format,Args).
+
+%%%-----------------------------------------------------------------
+%%% @spec tc_log_async(Category,Importance,Format,Args) -> ok
+%%% Category = atom()
+%%% Importance = integer()
+%%% Format = string()
+%%% Args = list()
+%%%
+%%% @doc Internal use only.
+%%%
+%%% <p>This function is used to perform asynchronous printouts
+%%% towards the test server IO handler. This is necessary in order
+%%% to avoid deadlocks when e.g. the hook that handles SASL printouts
+%%% prints to the test case log file at the same time test server
+%%% asks ct_logs for an html wrapper.</p>
+tc_log_async(Category,Importance,Format,Args) ->
+ cast({log,async,self(),group_leader(),Category,Importance,
+ [{div_header(Category),[]},
+ {Format,Args},
+ {div_footer(),[]}]}),
+ ok.
+%%%-----------------------------------------------------------------
+%%% @spec tc_print(Category,Format,Args)
+%%% @equiv tc_print(Category,?STD_IMPORTANCE,Format,Args)
+tc_print(Category,Format,Args) ->
+ tc_print(Category,?STD_IMPORTANCE,Format,Args).
+
+%%%-----------------------------------------------------------------
+%%% @spec tc_print(Category,Importance,Format,Args) -> ok
%%% Category = atom()
+%%% Importance = integer()
%%% Format = string()
%%% Args = list()
%%%
%%% @doc Console printout from a testcase.
%%%
%%% <p>This function is called by <code>ct</code> when printing
-%%% stuff a testcase on the user console.</p>
-tc_print(Category,Format,Args) ->
- print_heading(Category),
- io:format(user,Format,Args),
- io:format(user,"\n\n",[]),
- ok.
+%%% stuff from a testcase on the user console.</p>
+tc_print(Category,Importance,Format,Args) ->
+ VLvl = case ct_util:get_testdata({verbosity,Category}) of
+ undefined ->
+ ct_util:get_testdata({verbosity,'$unspecified'});
+ {error,bad_invocation} ->
+ ?MAX_VERBOSITY;
+ Val ->
+ Val
+ end,
+ if Importance >= (100-VLvl) ->
+ Head = get_heading(Category),
+ io:format(user, lists:concat([Head,Format,"\n\n"]), Args),
+ ok;
+ true ->
+ ok
+ end.
-print_heading(default) ->
- io:format(user,
- "----------------------------------------------------\n~s\n",
- [log_timestamp(now())]);
-print_heading(Category) ->
- io:format(user,
- "----------------------------------------------------\n~s ~w\n",
- [log_timestamp(now()),Category]).
+get_heading(default) ->
+ io_lib:format("\n-----------------------------"
+ "-----------------------\n~s\n",
+ [log_timestamp(now())]);
+get_heading(Category) ->
+ io_lib:format("\n-----------------------------"
+ "-----------------------\n~s ~w\n",
+ [log_timestamp(now()),Category]).
%%%-----------------------------------------------------------------
%%% @spec tc_pal(Category,Format,Args) -> ok
+%%% @equiv tc_pal(Category,?STD_IMPORTANCE,Format,Args) -> ok
+tc_pal(Category,Format,Args) ->
+ tc_pal(Category,?STD_IMPORTANCE,Format,Args).
+
+%%%-----------------------------------------------------------------
+%%% @spec tc_pal(Category,Importance,Format,Args) -> ok
%%% Category = atom()
+%%% Importance = integer()
%%% Format = string()
%%% Args = list()
%%%
@@ -375,16 +440,17 @@ print_heading(Category) ->
%%% <p>This function is called by <code>ct</code> when logging
%%% stuff directly from a testcase. The info is written both in the
%%% log and on the console.</p>
-tc_pal(Category,Format,Args) ->
- tc_print(Category,Format,Args),
- cast({log,self(),group_leader(),[{div_header(Category),[]},
- {Format,Args},
- {div_footer(),[]}]}),
+tc_pal(Category,Importance,Format,Args) ->
+ tc_print(Category,Importance,Format,Args),
+ cast({log,sync,self(),group_leader(),Category,Importance,
+ [{div_header(Category),[]},
+ {Format,Args},
+ {div_footer(),[]}]}),
ok.
%%%-----------------------------------------------------------------
-%%% @spec tc_pal(Category,Format,Args) -> ok
+%%% @spec ct_pal(Category,Format,Args) -> ok
%%% Category = atom()
%%% Format = string()
%%% Args = list()
@@ -408,8 +474,10 @@ int_footer() ->
"</div>".
div_header(Class) ->
- "<div class=\"" ++ atom_to_list(Class) ++ "\"><b>*** User " ++
- log_timestamp(now()) ++ " ***</b>".
+ div_header(Class,"User").
+div_header(Class,Printer) ->
+ "<div class=\"" ++ atom_to_list(Class) ++ "\"><b>*** " ++ Printer ++
+ " " ++ log_timestamp(now()) ++ " ***</b>".
div_footer() ->
"</div>".
@@ -420,7 +488,7 @@ maybe_log_timestamp() ->
{MS,S,_} ->
ok;
_ ->
- cast({log,self(),group_leader(),
+ cast({log,sync,self(),group_leader(),ct_internal,?MAX_IMPORTANCE,
[{"<i>~s</i>",[log_timestamp({MS,S,US})]}]})
end.
@@ -441,9 +509,10 @@ log_timestamp({MS,S,US}) ->
orig_GL,
ct_log_fd,
tc_groupleaders,
- stylesheet}).
+ stylesheet,
+ async_print_jobs}).
-logger(Parent,Mode) ->
+logger(Parent, Mode, Verbosity) ->
register(?MODULE,self()),
%%! Below is a temporary workaround for the limitation of
@@ -476,26 +545,27 @@ logger(Parent,Mode) ->
%% dir) so logs are independent of Common Test installation
{ok,Cwd} = file:get_cwd(),
CTPath = code:lib_dir(common_test),
- CSSFileSrc = filename:join(filename:join(CTPath, "priv"),
- ?css_default),
- CSSFileDestTop = filename:join(Cwd, ?css_default),
- CSSFileDestRun = filename:join(AbsDir, ?css_default),
- case file:copy(CSSFileSrc, CSSFileDestTop) of
- {error,Reason0} ->
+ PrivFiles = [?css_default,?jquery_script,?tablesorter_script],
+ PrivFilesSrc = [filename:join(filename:join(CTPath, "priv"), F) ||
+ F <- PrivFiles],
+ PrivFilesDestTop = [filename:join(Cwd, F) || F <- PrivFiles],
+ PrivFilesDestRun = [filename:join(AbsDir, F) || F <- PrivFiles],
+ case copy_priv_files(PrivFilesSrc, PrivFilesDestTop) of
+ {error,Src1,Dest1,Reason1} ->
io:format(user, "ERROR! "++
- "CSS file ~p could not be copied to ~p. "++
- "Reason: ~p~n",
- [CSSFileSrc,CSSFileDestTop,Reason0]),
- exit({css_file_error,CSSFileDestTop});
- _ ->
- case file:copy(CSSFileSrc, CSSFileDestRun) of
- {error,Reason1} ->
+ "Priv file ~p could not be copied to ~p. "++
+ "Reason: ~p~n",
+ [Src1,Dest1,Reason1]),
+ exit({priv_file_error,Dest1});
+ ok ->
+ case copy_priv_files(PrivFilesSrc, PrivFilesDestRun) of
+ {error,Src2,Dest2,Reason2} ->
io:format(user, "ERROR! "++
- "CSS file ~p could not be copied to ~p. "++
- "Reason: ~p~n",
- [CSSFileSrc,CSSFileDestRun,Reason1]),
- exit({css_file_error,CSSFileDestRun});
- _ ->
+ "Priv file ~p could not be copied to ~p. "++
+ "Reason: ~p~n",
+ [Src2,Dest2,Reason2]),
+ exit({priv_file_error,Dest2});
+ ok ->
ok
end
end
@@ -515,57 +585,83 @@ logger(Parent,Mode) ->
[log_timestamp(now()),"Common Test Logger started"]),
Parent ! {started,self(),{Time,filename:absname("")}},
set_evmgr_gl(CtLogFd),
+
+ %% save verbosity levels in dictionary for fast lookups
+ io:format(CtLogFd, "\nVERBOSITY LEVELS:\n", []),
+ case proplists:get_value('$unspecified', Verbosity) of
+ undefined -> ok;
+ GenLvl -> io:format(CtLogFd, "~-25s~3w~n",
+ ["general level",GenLvl])
+ end,
+ [begin put({verbosity,Cat},VLvl),
+ if Cat == '$unspecified' ->
+ ok;
+ true ->
+ io:format(CtLogFd, "~-25w~3w~n", [Cat,VLvl])
+ end
+ end || {Cat,VLvl} <- Verbosity],
+ io:nl(CtLogFd),
+
logger_loop(#logger_state{parent=Parent,
log_dir=AbsDir,
start_time=Time,
orig_GL=group_leader(),
ct_log_fd=CtLogFd,
- tc_groupleaders=[]}).
+ tc_groupleaders=[],
+ async_print_jobs=[]}).
+
+copy_priv_files([SrcF | SrcFs], [DestF | DestFs]) ->
+ case file:copy(SrcF, DestF) of
+ {error,Reason} ->
+ {error,SrcF,DestF,Reason};
+ _ ->
+ copy_priv_files(SrcFs, DestFs)
+ end;
+copy_priv_files([], []) ->
+ ok.
logger_loop(State) ->
receive
- {log,Pid,GL,List} ->
- case get_groupleader(Pid,GL,State) of
- {tc_log,TCGL,TCGLs} ->
- case erlang:is_process_alive(TCGL) of
- true ->
- %% we have to build one io-list of all strings
- %% before printing, or other io printouts (made in
- %% parallel) may get printed between this header
- %% and footer
- Fun =
- fun({Str,Args},IoList) ->
- case catch io_lib:format(Str,Args) of
- {'EXIT',_Reason} ->
- Fd = State#logger_state.ct_log_fd,
- io:format(Fd,
- "Logging fails! "
- "Str: ~p, Args: ~p~n",
- [Str,Args]),
- %% stop the testcase, we need
- %% to see the fault
- exit(Pid,{log_printout_error,Str,Args}),
- [];
- IoStr when IoList == [] ->
- [IoStr];
- IoStr ->
- [IoList,"\n",IoStr]
- end
- end,
- io:format(TCGL,"~s",[lists:foldl(Fun,[],List)]),
- logger_loop(State#logger_state{tc_groupleaders=TCGLs});
- false ->
- %% Group leader is dead, so write to the CtLog instead
- Fd = State#logger_state.ct_log_fd,
- [begin io:format(Fd,Str,Args),io:nl(Fd) end ||
+ {log,SyncOrAsync,Pid,GL,Category,Importance,List} ->
+ VLvl = case Category of
+ ct_internal ->
+ ?MAX_VERBOSITY;
+ _ ->
+ case get({verbosity,Category}) of
+ undefined -> get({verbosity,'$unspecified'});
+ Val -> Val
+ end
+ end,
+ if Importance >= (100-VLvl) ->
+ 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,
+ TCGL, List, State),
+ logger_loop(State1#logger_state{
+ tc_groupleaders = TCGLs});
+ false ->
+ %% Group leader is dead, so write to the
+ %% CtLog instead
+ Fd = State#logger_state.ct_log_fd,
+ [begin io:format(Fd,Str,Args),
+ io:nl(Fd) end || {Str,Args} <- List],
+ logger_loop(State)
+ end;
+ {ct_log,Fd,TCGLs} ->
+ [begin io:format(Fd,Str,Args),io:nl(Fd) end ||
{Str,Args} <- List],
- logger_loop(State)
+ logger_loop(State#logger_state{
+ tc_groupleaders = TCGLs})
end;
- {ct_log,Fd,TCGLs} ->
- [begin io:format(Fd,Str,Args),io:nl(Fd) end || {Str,Args} <- List],
- logger_loop(State#logger_state{tc_groupleaders=TCGLs})
- end;
+ true ->
+ logger_loop(State)
+ end;
{{init_tc,TCPid,GL,RefreshLog},From} ->
+ %% 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),
set_evmgr_gl(GL),
TCGLs = add_tc_gl(TCPid,GL,State),
@@ -575,11 +671,12 @@ logger_loop(State) ->
make_last_run_index(State#logger_state.start_time)
end,
return(From,ok),
- logger_loop(State#logger_state{tc_groupleaders=TCGLs});
+ logger_loop(State#logger_state{tc_groupleaders = TCGLs});
{{end_tc,TCPid},From} ->
set_evmgr_gl(State#logger_state.ct_log_fd),
return(From,ok),
- logger_loop(State#logger_state{tc_groupleaders=rm_tc_gl(TCPid,State)});
+ logger_loop(State#logger_state{tc_groupleaders =
+ rm_tc_gl(TCPid,State)});
{{get_log_dir,true},From} ->
return(From,{ok,State#logger_state.log_dir}),
logger_loop(State);
@@ -590,21 +687,35 @@ logger_loop(State) ->
make_last_run_index(State#logger_state.start_time),
return(From,filename:basename(State#logger_state.log_dir)),
logger_loop(State);
- {set_stylesheet,_,SSFile} when State#logger_state.stylesheet == SSFile ->
+ {set_stylesheet,_,SSFile} when State#logger_state.stylesheet ==
+ SSFile ->
logger_loop(State);
{set_stylesheet,TC,SSFile} ->
Fd = State#logger_state.ct_log_fd,
- io:format(Fd, "~p loading external style sheet: ~s~n", [TC,SSFile]),
- logger_loop(State#logger_state{stylesheet=SSFile});
+ io:format(Fd, "~p loading external style sheet: ~s~n",
+ [TC,SSFile]),
+ logger_loop(State#logger_state{stylesheet = SSFile});
{clear_stylesheet,_} when State#logger_state.stylesheet == undefined ->
logger_loop(State);
{clear_stylesheet,_} ->
- logger_loop(State#logger_state{stylesheet=undefined});
+ logger_loop(State#logger_state{stylesheet = undefined});
{ct_log, List} ->
Fd = State#logger_state.ct_log_fd,
[begin io:format(Fd,Str,Args),io:nl(Fd) end ||
{Str,Args} <- List],
logger_loop(State);
+ {'DOWN',Ref,_,_Pid,_} ->
+ %% there might be print jobs executing in parallel with ct_logs
+ %% and whenever one is finished (indicated by 'DOWN'), the
+ %% next job should be spawned
+ case lists:delete(Ref, State#logger_state.async_print_jobs) of
+ [] ->
+ logger_loop(State#logger_state{async_print_jobs = []});
+ Jobs ->
+ [Next|JobsRev] = lists:reverse(Jobs),
+ Jobs1 = [print_next(Next)|lists:reverse(JobsRev)],
+ logger_loop(State#logger_state{async_print_jobs = Jobs1})
+ end;
stop ->
io:format(State#logger_state.ct_log_fd,
int_header()++int_footer(),
@@ -613,6 +724,60 @@ logger_loop(State) ->
ok
end.
+create_io_fun(FromPid, State) ->
+ %% we have to build one io-list of all strings
+ %% before printing, or other io printouts (made in
+ %% parallel) may get printed between this header
+ %% and footer
+ Fd = State#logger_state.ct_log_fd,
+ fun({Str,Args}, IoList) ->
+ case catch io_lib:format(Str,Args) of
+ {'EXIT',_Reason} ->
+ io:format(Fd, "Logging fails! Str: ~p, Args: ~p~n",
+ [Str,Args]),
+ %% stop the testcase, we need to see the fault
+ exit(FromPid, {log_printout_error,Str,Args}),
+ [];
+ IoStr when IoList == [] ->
+ [IoStr];
+ IoStr ->
+ [IoList,"\n",IoStr]
+ end
+ end.
+
+print_to_log(sync, FromPid, TCGL, List, State) ->
+ IoFun = create_io_fun(FromPid, State),
+ %% in some situations (exceptions), the printout is made from the
+ %% test server IO process and there's no valid group leader to send to
+ IoProc = if FromPid /= TCGL -> TCGL;
+ true -> State#logger_state.ct_log_fd
+ end,
+ io:format(IoProc, "~s", [lists:foldl(IoFun, [], List)]),
+ State;
+
+print_to_log(async, FromPid, TCGL, List, State) ->
+ IoFun = create_io_fun(FromPid, State),
+ %% in some situations (exceptions), the printout is made from the
+ %% test server IO process and there's no valid group leader to send to
+ IoProc = if FromPid /= TCGL -> TCGL;
+ true -> State#logger_state.ct_log_fd
+ end,
+ Printer = fun() ->
+ test_server:permit_io(IoProc, self()),
+ io:format(IoProc, "~s", [lists:foldl(IoFun, [], List)])
+ end,
+ case State#logger_state.async_print_jobs of
+ [] ->
+ {_Pid,Ref} = spawn_monitor(Printer),
+ State#logger_state{async_print_jobs = [Ref]};
+ Queue ->
+ State#logger_state{async_print_jobs = [Printer|Queue]}
+ end.
+
+print_next(PrintFun) ->
+ {_Pid,Ref} = spawn_monitor(PrintFun),
+ Ref.
+
%% #logger_state.tc_groupleaders == [{Pid,{Type,GLPid}},...]
%% Type = tc | io
%%
@@ -704,7 +869,7 @@ set_evmgr_gl(GL) ->
open_ctlog() ->
{ok,Fd} = file:open(?ct_log_name,[write]),
- io:format(Fd, header("Common Test Framework Log"), []),
+ io:format(Fd, header("Common Test Framework Log", {[],[1,2],[]}), []),
case file:consult(ct_run:variables_file_name("../")) of
{ok,Vars} ->
io:format(Fd, config_table(Vars), []);
@@ -855,33 +1020,48 @@ insert_dir(D,[D1|Ds]) ->
insert_dir(D,[]) ->
[D].
-make_last_run_index([Name|Rest], Result, TotSucc, TotFail, UserSkip, AutoSkip,
- TotNotBuilt, Missing) ->
- case last_test(Name) of
+make_last_run_index([Name|Rest], Result, TotSucc, TotFail,
+ UserSkip, AutoSkip, TotNotBuilt, Missing) ->
+ case get_run_dirs(Name) of
false ->
%% Silently skip.
- make_last_run_index(Rest, Result, TotSucc, TotFail, UserSkip, AutoSkip,
- TotNotBuilt, Missing);
- LastLogDir ->
+ make_last_run_index(Rest, Result, TotSucc, TotFail,
+ UserSkip, AutoSkip, TotNotBuilt, Missing);
+ LogDirs ->
SuiteName = filename:rootname(filename:basename(Name)),
- case make_one_index_entry(SuiteName, LastLogDir, "-", false, Missing) of
- {Result1,Succ,Fail,USkip,ASkip,NotBuilt} ->
- %% for backwards compatibility
- AutoSkip1 = case catch AutoSkip+ASkip of
- {'EXIT',_} -> undefined;
- Res -> Res
- end,
- make_last_run_index(Rest, [Result|Result1], TotSucc+Succ,
- TotFail+Fail, UserSkip+USkip, AutoSkip1,
- TotNotBuilt+NotBuilt, Missing);
- error ->
- make_last_run_index(Rest, Result, TotSucc, TotFail, UserSkip, AutoSkip,
- TotNotBuilt, Missing)
- end
+ {Result1,TotSucc1,TotFail1,UserSkip1,AutoSkip1,TotNotBuilt1} =
+ make_last_run_index1(SuiteName, LogDirs, Result,
+ TotSucc, TotFail,
+ UserSkip, AutoSkip,
+ TotNotBuilt, Missing),
+ make_last_run_index(Rest, Result1, TotSucc1, TotFail1,
+ UserSkip1, AutoSkip1,
+ TotNotBuilt1, Missing)
end;
+
make_last_run_index([], Result, TotSucc, TotFail, UserSkip, AutoSkip, TotNotBuilt, _) ->
{ok, [Result|total_row(TotSucc, TotFail, UserSkip, AutoSkip, TotNotBuilt, false)],
{TotSucc,TotFail,UserSkip,AutoSkip,TotNotBuilt}}.
+
+make_last_run_index1(SuiteName, [LogDir | LogDirs], Result, TotSucc, TotFail,
+ UserSkip, AutoSkip, TotNotBuilt, Missing) ->
+ case make_one_index_entry(SuiteName, LogDir, "-", false, Missing) of
+ {Result1,Succ,Fail,USkip,ASkip,NotBuilt} ->
+ %% for backwards compatibility
+ AutoSkip1 = case catch AutoSkip+ASkip of
+ {'EXIT',_} -> undefined;
+ Res -> Res
+ end,
+ make_last_run_index1(SuiteName, LogDirs, [Result|Result1], TotSucc+Succ,
+ TotFail+Fail, UserSkip+USkip, AutoSkip1,
+ TotNotBuilt+NotBuilt, Missing);
+ error ->
+ make_last_run_index1(SuiteName, LogDirs, Result, TotSucc, TotFail,
+ UserSkip, AutoSkip, TotNotBuilt, Missing)
+ end;
+make_last_run_index1(_, [], Result, TotSucc, TotFail,
+ UserSkip, AutoSkip, TotNotBuilt, _) ->
+ {Result,TotSucc,TotFail,UserSkip,AutoSkip,TotNotBuilt}.
make_one_index_entry(SuiteName, LogDir, Label, All, Missing) ->
case count_cases(LogDir) of
@@ -999,14 +1179,14 @@ total_row(Success, Fail, UserSkip, AutoSkip, NotBuilt, All) ->
integer_to_list(UserSkip),integer_to_list(AutoSkip)}
end,
[xhtml("<tr valign=top>\n",
- ["<tr class=\"",odd_or_even(),"\">\n"]),
+ ["</tbody>\n<tfoot>\n<tr class=\"",odd_or_even(),"\">\n"]),
"<td><b>Total</b></td>\n", Label, TimestampCell,
"<td align=right><b>",integer_to_list(Success),"<b></td>\n",
"<td align=right><b>",integer_to_list(Fail),"<b></td>\n",
"<td align=right>",integer_to_list(AllSkip),
" (",UserSkipStr,"/",AutoSkipStr,")</td>\n",
"<td align=right><b>",integer_to_list(NotBuilt),"<b></td>\n",
- AllInfo, "</tr>\n"].
+ AllInfo, "</tr>\n</tfoot>\n"].
not_built(_BaseName,_LogDir,_All,[]) ->
0;
@@ -1063,10 +1243,12 @@ index_header(Label, StartTime) ->
Head =
case Label of
undefined ->
- header("Test Results", format_time(StartTime));
+ header("Test Results", format_time(StartTime),
+ {[],[1],[2,3,4,5]});
_ ->
header("Test Results for '" ++ Label ++ "'",
- format_time(StartTime))
+ format_time(StartTime),
+ {[],[1],[2,3,4,5]})
end,
[Head |
["<center>\n",
@@ -1078,15 +1260,17 @@ index_header(Label, StartTime) ->
"\">COMMON TEST FRAMEWORK LOG</a>\n</div>"]),
xhtml("<br>\n", "<br /><br /><br />\n"),
xhtml(["<table border=\"3\" cellpadding=\"5\" "
- "bgcolor=\"",?table_color3,"\">\n"], "<table>\n"),
+ "bgcolor=\"",?table_color3,"\">\n"],
+ ["<table id=\"",?sortable_table_name,"\">\n",
+ "<thead>\n<tr>\n"]),
"<th><b>Test Name</b></th>\n",
xhtml(["<th><font color=\"",?table_color3,"\">_</font>Ok"
"<font color=\"",?table_color3,"\">_</font></th>\n"],
"<th>Ok</th>\n"),
"<th>Failed</th>\n",
"<th>Skipped", xhtml("<br>", "<br />"), "(User/Auto)</th>\n"
- "<th>Missing", xhtml("<br>", "<br />"), "Suites</th>\n"
- "\n"]].
+ "<th>Missing", xhtml("<br>", "<br />"), "Suites</th>\n",
+ xhtml("", "</tr>\n</thead>\n<tbody>\n")]].
all_suites_index_header() ->
{ok,Cwd} = file:get_cwd(),
@@ -1099,12 +1283,14 @@ all_suites_index_header(IndexDir) ->
AllRunsLink = xhtml(["<a href=\"",?all_runs_name,"\">",AllRuns,"</a>\n"],
["<div id=\"button_holder\" class=\"btn\">\n"
"<a href=\"",?all_runs_name,"\">",AllRuns,"</a>\n</div>"]),
- [header("Test Results") |
+ [header("Test Results", {[3],[1,2,8,9,10],[4,5,6,7]}) |
["<center>\n",
AllRunsLink,
xhtml("<br><br>\n", "<br /><br />\n"),
xhtml(["<table border=\"3\" cellpadding=\"5\" "
- "bgcolor=\"",?table_color2,"\">\n"], "<table>\n"),
+ "bgcolor=\"",?table_color2,"\">\n"],
+ ["<table id=\"",?sortable_table_name,"\">\n",
+ "<thead>\n<tr>\n"]),
"<th>Test Name</th>\n",
"<th>Label</th>\n",
"<th>Test Run Started</th>\n",
@@ -1117,7 +1303,7 @@ all_suites_index_header(IndexDir) ->
"<th>Node</th>\n",
"<th>CT Log</th>\n",
"<th>Old Runs</th>\n",
- "\n"]].
+ xhtml("", "</tr>\n</thead>\n<tbody>\n")]].
all_runs_header() ->
{ok,Cwd} = file:get_cwd(),
@@ -1129,10 +1315,12 @@ all_runs_header() ->
"<a href=\"",?index_name,
"\">TEST INDEX PAGE</a>\n</div>"]),
xhtml("<br>\n", "<br /><br />\n")],
- [header(Title) |
+ [header(Title, {[1],[2,3,5],[4,6,7,8,9,10]}) |
["<center>\n", IxLink,
xhtml(["<table border=\"3\" cellpadding=\"5\" "
- "bgcolor=\"",?table_color1,"\">\n"], "<table>\n"),
+ "bgcolor=\"",?table_color1,"\">\n"],
+ ["<table id=\"",?sortable_table_name,"\">\n",
+ "<thead>\n<tr>\n"]),
"<th><b>History</b></th>\n"
"<th><b>Node</b></th>\n"
"<th><b>Label</b></th>\n"
@@ -1144,45 +1332,65 @@ all_runs_header() ->
"<th>Ok</th>\n"),
"<th>Failed</th>\n"
"<th>Skipped<br>(User/Auto)</th>\n"
- "<th>Missing<br>Suites</th>\n"
- "\n"]].
+ "<th>Missing<br>Suites</th>\n",
+ xhtml("", "</tr>\n</thead>\n<tbody>\n")]].
-header(Title) ->
- header1(Title, "").
-header(Title, SubTitle) ->
- header1(Title, SubTitle).
+header(Title, TableCols) ->
+ header1(Title, "", TableCols).
+header(Title, SubTitle, TableCols) ->
+ header1(Title, SubTitle, TableCols).
-header1(Title, SubTitle) ->
+header1(Title, SubTitle, TableCols) ->
SubTitleHTML = if SubTitle =/= "" ->
["<center>\n",
"<h3>" ++ SubTitle ++ "</h3>\n",
xhtml("</center>\n<br>\n", "</center>\n<br />\n")];
- true -> xhtml("<br>\n", "<br />\n")
+ true -> xhtml("<br>", "<br />")
end,
CSSFile = xhtml(fun() -> "" end,
- fun() -> make_relative(locate_default_css_file()) end),
+ fun() -> make_relative(locate_priv_file(?css_default)) end),
+ JQueryFile =
+ xhtml(fun() -> "" end,
+ fun() -> make_relative(locate_priv_file(?jquery_script)) end),
+ TableSorterFile =
+ xhtml(fun() -> "" end,
+ fun() -> make_relative(locate_priv_file(?tablesorter_script)) end),
[xhtml(["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n",
"<html>\n"],
["<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n",
"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n",
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"]),
- "<!-- autogenerated by '"++atom_to_list(?MODULE)++"' -->\n",
- "<head>\n",
- "<title>" ++ Title ++ " " ++ SubTitle ++ "</title>\n",
- "<meta http-equiv=\"cache-control\" content=\"no-cache\">\n",
- xhtml("",
- ["<link rel=\"stylesheet\" href=\"",CSSFile,"\" type=\"text/css\">"]),
- "</head>\n",
- body_tag(),
- "<center>\n",
- "<h1>" ++ Title ++ "</h1>\n",
- "</center>\n",
- SubTitleHTML,"\n"].
+ "<!-- autogenerated by '"++atom_to_list(?MODULE)++"' -->\n",
+ "<head>\n",
+ "<title>" ++ Title ++ " " ++ SubTitle ++ "</title>\n",
+ "<meta http-equiv=\"cache-control\" content=\"no-cache\">\n",
+ xhtml("",
+ ["<link rel=\"stylesheet\" href=\"",CSSFile,"\" type=\"text/css\">\n"]),
+ xhtml("",
+ ["<script type=\"text/javascript\" src=\"",JQueryFile,
+ "\"></script>\n"]),
+ xhtml("",
+ ["<script type=\"text/javascript\" src=\"",TableSorterFile,
+ "\"></script>\n"]),
+ xhtml(fun() -> "" end,
+ fun() -> insert_javascript({tablesorter,?sortable_table_name,
+ TableCols})
+ end),
+ "</head>\n",
+ body_tag(),
+ "<center>\n",
+ "<h1>" ++ Title ++ "</h1>\n",
+ "</center>\n",
+ SubTitleHTML,"\n"].
index_footer() ->
["</table>\n"
"</center>\n" | footer()].
+all_runs_index_footer() ->
+ ["</tbody>\n</table>\n"
+ "</center>\n" | footer()].
+
footer() ->
["<center>\n",
xhtml("<br><br>\n<hr>\n", "<br /><br />\n"),
@@ -1194,7 +1402,8 @@ footer() ->
xhtml("<br>\n", "<br />\n"),
xhtml("</font></p>\n", "</div>\n"),
"</center>\n"
- "</body>\n"].
+ "</body>\n"
+ "</html>\n"].
body_tag() ->
@@ -1210,7 +1419,7 @@ current_time() ->
format_time({{Y, Mon, D}, {H, Min, S}}) ->
Weekday = weekday(calendar:day_of_the_week(Y, Mon, D)),
- lists:flatten(io_lib:format("~s ~s ~p ~w ~2.2.0w:~2.2.0w:~2.2.0w",
+ lists:flatten(io_lib:format("~s ~s ~2.2.0w ~w ~2.2.0w:~2.2.0w:~2.2.0w",
[Weekday, month(Mon), D, Y, H, Min, S])).
weekday(1) -> "Mon";
@@ -1336,8 +1545,12 @@ config_table_header() ->
[
xhtml(["<h2>Configuration</h2>\n"
"<table border=\"3\" cellpadding=\"5\" bgcolor=\"",?table_color1,"\"\n"],
- "<h4>CONFIGURATION</h4>\n<table>\n"),
- "<tr><th>Key</th><th>Value</th></tr>\n"].
+ ["<h4>CONFIGURATION</h4>\n",
+ "<table id=\"",?sortable_table_name,"\">\n",
+ "<thead>\n"]),
+ "<tr><th>Key</th><th>Value</th></tr>\n",
+ xhtml("", "</thead>\n<tbody>\n")
+ ].
config_table1([{Key,Value}|Vars]) ->
[xhtml(["<tr><td>", atom_to_list(Key), "</td>\n",
@@ -1347,7 +1560,7 @@ config_table1([{Key,Value}|Vars]) ->
"<td>", io_lib:format("~p",[Value]), "</td>\n</tr>\n"]) |
config_table1(Vars)];
config_table1([]) ->
- ["</table>\n"].
+ ["</tbody>\n</table>\n"].
make_all_runs_index(When) ->
@@ -1361,7 +1574,8 @@ make_all_runs_index(When) ->
DirsSorted = (catch sort_all_runs(Dirs)),
Header = all_runs_header(),
Index = [runentry(Dir) || Dir <- DirsSorted],
- Result = file:write_file(AbsName,Header++Index++index_footer()),
+ Result = file:write_file(AbsName,Header++Index++
+ all_runs_index_footer()),
if When == start -> ok;
true -> io:put_chars("done\n")
end,
@@ -1633,8 +1847,8 @@ make_all_suites_index(NewTestData = {_TestName,DirName}) ->
sort_logdirs([Dir|Dirs],Groups) ->
TestName = filename:rootname(filename:basename(Dir)),
case filelib:wildcard(filename:join(Dir,"run.*")) of
- [RunDir] ->
- Groups1 = insert_test(TestName,{filename:basename(RunDir),RunDir},Groups),
+ RunDirs = [_|_] ->
+ Groups1 = sort_logdirs1(TestName,RunDirs,Groups),
sort_logdirs(Dirs,Groups1);
_ -> % ignore missing run directory
sort_logdirs(Dirs,Groups)
@@ -1642,6 +1856,12 @@ sort_logdirs([Dir|Dirs],Groups) ->
sort_logdirs([],Groups) ->
lists:keysort(1,sort_each_group(Groups)).
+sort_logdirs1(TestName,[RunDir|RunDirs],Groups) ->
+ Groups1 = insert_test(TestName,{filename:basename(RunDir),RunDir},Groups),
+ sort_logdirs1(TestName,RunDirs,Groups1);
+sort_logdirs1(_,[],Groups) ->
+ Groups.
+
insert_test(Test,IxDir,[{Test,IxDirs}|Groups]) ->
[{Test,[IxDir|IxDirs]}|Groups];
insert_test(Test,IxDir,[]) ->
@@ -1894,7 +2114,7 @@ simulate() ->
simulate_logger_loop() ->
receive
- {log,_,_,List} ->
+ {log,_,_,_,_,_,List} ->
S = [[io_lib:format(Str,Args),io_lib:nl()] || {Str,Args} <- List],
io:format("~s",[S]),
simulate_logger_loop();
@@ -1933,21 +2153,17 @@ notify_and_unlock_file(File) ->
end.
%%%-----------------------------------------------------------------
-%%% @spec last_test(Dir) -> string() | false
+%%% @spec get_run_dirs(Dir) -> [string()] | false
%%%
%%% @doc
%%%
-last_test(Dir) ->
- last_test(filelib:wildcard(filename:join(Dir, "run.[1-2]*")), false).
-
-last_test([Run|Rest], false) ->
- last_test(Rest, Run);
-last_test([Run|Rest], Latest) when Run > Latest ->
- last_test(Rest, Run);
-last_test([_|Rest], Latest) ->
- last_test(Rest, Latest);
-last_test([], Latest) ->
- Latest.
+get_run_dirs(Dir) ->
+ case filelib:wildcard(filename:join(Dir, "run.[1-2]*")) of
+ [] ->
+ false;
+ RunDirs ->
+ lists:sort(RunDirs)
+ end.
%%%-----------------------------------------------------------------
%%% @spec xhtml(HTML, XHTML) -> HTML | XHTML
@@ -1995,34 +2211,34 @@ basic_html() ->
end.
%%%-----------------------------------------------------------------
-%%% @spec locate_default_css_file() -> CSSFile
+%%% @spec locate_priv_file(FileName) -> PrivFile
%%%
%%% @doc
%%%
-locate_default_css_file() ->
+locate_priv_file(FileName) ->
{ok,CWD} = file:get_cwd(),
- CSSFileInCwd = filename:join(CWD, ?css_default),
- case filelib:is_file(CSSFileInCwd) of
+ PrivFileInCwd = filename:join(CWD, FileName),
+ case filelib:is_file(PrivFileInCwd) of
true ->
- CSSFileInCwd;
+ PrivFileInCwd;
false ->
- CSSResultFile =
+ PrivResultFile =
case {whereis(?MODULE),self()} of
{Self,Self} ->
%% executed on the ct_logs process
- filename:join(get(ct_run_dir), ?css_default);
+ filename:join(get(ct_run_dir), FileName);
_ ->
%% executed on other process than ct_logs
{ok,RunDir} = get_log_dir(true),
- filename:join(RunDir, ?css_default)
+ filename:join(RunDir, FileName)
end,
- case filelib:is_file(CSSResultFile) of
+ case filelib:is_file(PrivResultFile) of
true ->
- CSSResultFile;
+ PrivResultFile;
false ->
%% last resort, try use css file in CT installation
CTPath = code:lib_dir(common_test),
- filename:join(filename:join(CTPath, "priv"), ?css_default)
+ filename:join(filename:join(CTPath, "priv"), FileName)
end
end.
@@ -2061,7 +2277,7 @@ make_relative1(DirTs, CwdTs) ->
%%%
%%% @doc
%%%
-get_ts_html_wrapper(TestName, PrintLabel, Cwd) ->
+get_ts_html_wrapper(TestName, PrintLabel, Cwd, TableCols) ->
TestName1 = if is_list(TestName) ->
lists:flatten(TestName);
true ->
@@ -2121,17 +2337,36 @@ get_ts_html_wrapper(TestName, PrintLabel, Cwd) ->
"Open Telecom Platform</a><br />\n",
"Updated: <!date>", current_time(), "<!/date>",
"<br />\n</div>\n"],
- CSSFile = xhtml(fun() -> "" end,
- fun() -> make_relative(locate_default_css_file(), Cwd) end),
+ CSSFile =
+ xhtml(fun() -> "" end,
+ fun() -> make_relative(locate_priv_file(?css_default),
+ Cwd)
+ end),
+ JQueryFile =
+ xhtml(fun() -> "" end,
+ fun() -> make_relative(locate_priv_file(?jquery_script),
+ Cwd)
+ end),
+ TableSorterFile =
+ xhtml(fun() -> "" end,
+ fun() -> make_relative(locate_priv_file(?tablesorter_script),
+ Cwd)
+ end),
+ TableSorterScript =
+ xhtml(fun() -> "" end,
+ fun() -> insert_javascript({tablesorter,
+ ?sortable_table_name,
+ TableCols}) end),
{xhtml,
["<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n",
"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n",
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n",
"<head>\n<title>", TestName1, "</title>\n",
"<meta http-equiv=\"cache-control\" content=\"no-cache\">\n",
- "<link rel=\"stylesheet\" href=\"", CSSFile, "\" type=\"text/css\">",
- "</head>\n","<body>\n",
- LabelStr, "\n"],
+ "<link rel=\"stylesheet\" href=\"", CSSFile, "\" type=\"text/css\">\n",
+ "<script type=\"text/javascript\" src=\"", JQueryFile, "\"></script>\n",
+ "<script type=\"text/javascript\" src=\"", TableSorterFile, "\"></script>\n"] ++
+ TableSorterScript ++ ["</head>\n","<body>\n", LabelStr, "\n"],
["<center>\n<br /><hr /><p>\n",
"<a href=\"", AllRuns,
"\">Test run history\n</a> | ",
@@ -2139,3 +2374,89 @@ get_ts_html_wrapper(TestName, PrintLabel, Cwd) ->
"\">Top level test index\n</a>\n</p>\n",
Copyright,"</center>\n</body>\n</html>\n"]}
end.
+
+insert_javascript({tablesorter,_TableName,undefined}) ->
+ [];
+
+insert_javascript({tablesorter,TableName,
+ {DateCols,TextCols,ValCols}}) ->
+ Headers =
+ lists:flatten(
+ lists:sort(
+ lists:flatmap(fun({Sorter,Cols}) ->
+ [lists:flatten(
+ io_lib:format(" ~w: "
+ "{ sorter: '~s' },\n",
+ [Col-1,Sorter])) || Col<-Cols]
+ end, [{"CTDateSorter",DateCols},
+ {"CTTextSorter",TextCols},
+ {"CTValSorter",ValCols}]))),
+ Headers1 = string:substr(Headers, 1, length(Headers)-2),
+
+ ["<script type=\"text/javascript\">\n",
+ "// Parser for date format, e.g: Wed Jul 4 2012 11:24:15\n",
+ "var monthNames = {};\n",
+ "monthNames[\"Jan\"] = \"01\"; monthNames[\"Feb\"] = \"02\";\n",
+ "monthNames[\"Mar\"] = \"03\"; monthNames[\"Apr\"] = \"04\";\n",
+ "monthNames[\"May\"] = \"05\"; monthNames[\"Jun\"] = \"06\";\n",
+ "monthNames[\"Jul\"] = \"07\"; monthNames[\"Aug\"] = \"08\";\n",
+ "monthNames[\"Sep\"] = \"09\"; monthNames[\"Oct\"] = \"10\";\n",
+ "monthNames[\"Nov\"] = \"11\"; monthNames[\"Dec\"] = \"12\";\n",
+ "$.tablesorter.addParser({\n",
+ " id: 'CTDateSorter',\n",
+ " is: function(s) {\n",
+ " return false; },\n",
+ " format: function(s) {\n",
+ %% place empty cells, "-" and "?" at the bottom
+ " if (s.length < 2) return 999999999;\n",
+ " else {\n",
+ %% match out each date element
+ " var date = s.match(/(\\w{3})\\s(\\w{3})\\s(\\d{2})\\s(\\d{4})\\s(\\d{2}):(\\d{2}):(\\d{2})/);\n",
+ " var y = date[4]; var mo = monthNames[date[2]]; var d = String(date[3]);\n",
+ " var h = String(date[5]); var mi = String(date[6]); var sec = String(date[7]);\n",
+ " return (parseInt('' + y + mo + d + h + mi + sec)); }},\n",
+ " type: 'numeric' });\n",
+
+ "// Parser for general text format\n",
+ "$.tablesorter.addParser({\n",
+ " id: 'CTTextSorter',\n",
+ " is: function(s) {\n",
+ " return false; },\n",
+ " format: function(s) {\n",
+ %% place empty cells, "?" and "-" at the bottom
+ " if (s.length < 1) return 'zzzzzzzz';\n",
+ " else if (s == \"?\") return 'zzzzzzz';\n",
+ " else if (s == \"-\") return 'zzzzzz';\n",
+ " else if (s == \"FAILED\") return 'A';\n",
+ " else if (s == \"SKIPPED\") return 'B';\n",
+ " else if (s == \"OK\") return 'C';\n",
+ " else return '' + s; },\n",
+ " type: 'text' });\n",
+
+ "// Parser for numerical values\n",
+ "$.tablesorter.addParser({\n",
+ " id: 'CTValSorter',\n",
+ " is: function(s) {\n",
+ " return false; },\n",
+ " format: function(s) {\n"
+ %% place empty cells and "?" at the bottom
+ " if (s.length < 1) return '-2';\n",
+ " else if (s == \"?\") return '-1';\n",
+ %% look for skip value, eg "3 (2/1)"
+ " else if ((s.search(/(\\d{1,})\\s/)) >= 0) {\n",
+ " var num = s.match(/(\\d{1,})\\s/);\n",
+ %% return only the total skip value for sorting
+ " return (parseInt('' + num[1])); }\n",
+ " else if ((s.search(/(\\d{1,})\\.(\\d{3})s/)) >= 0) {\n",
+ " var num = s.match(/(\\d{1,})\\.(\\d{3})/);\n",
+ " if (num[1] == \"0\") return (parseInt('' + num[2]));\n",
+ " else return (parseInt('' + num[1] + num[2])); }\n",
+ " else return '' + s; },\n",
+ " type: 'numeric' });\n",
+
+ "$(document).ready(function() {\n",
+ " $(\"#",TableName,"\").tablesorter({\n",
+ " headers: { \n", Headers1, "\n }\n });\n",
+ " $(\"#",TableName,"\").trigger(\"update\");\n",
+ " $(\"#",TableName,"\").trigger(\"appendCache\");\n",
+ "});\n</script>\n"].
diff --git a/lib/common_test/src/ct_master.erl b/lib/common_test/src/ct_master.erl
index 2ea2ba106a..99bec3ea09 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -25,6 +25,7 @@
-export([run/1,run/3,run/4]).
-export([run_on_node/2,run_on_node/3]).
-export([run_test/1,run_test/2]).
+-export([basic_html/1]).
-export([abort/0,abort/1,progress/0]).
@@ -277,7 +278,17 @@ abort(Node) when is_atom(Node) ->
progress() ->
call(progress).
-
+%%%-----------------------------------------------------------------
+%%% @spec basic_html(Bool) -> ok
+%%% Bool = true | false
+%%%
+%%% @doc If set to true, the ct_master logs will be written on a
+%%% primitive html format, not using the Common Test CSS style
+%%% sheet.
+basic_html(Bool) ->
+ application:set_env(common_test_master, basic_html, Bool),
+ ok.
+
%%%-----------------------------------------------------------------
%%% MASTER, runs on central controlling node.
%%%-----------------------------------------------------------------
@@ -685,8 +696,9 @@ status(MasterPid,Event) ->
log(To,Heading,Str,Args) ->
if To == all ; To == tty ->
- Str1 = ["=== ",Heading," ===\n",io_lib:format(Str,Args),"\n"],
- io:format(Str1,[]);
+ Chars = ["=== ",Heading," ===\n",
+ io_lib:format(Str,Args),"\n"],
+ io:put_chars(Chars);
true ->
ok
end,
diff --git a/lib/common_test/src/ct_master_logs.erl b/lib/common_test/src/ct_master_logs.erl
index 244faace06..d76288feef 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -23,7 +23,10 @@
%%% node.</p>
-module(ct_master_logs).
--export([start/2, make_all_runs_index/0, log/3, nodedir/2, stop/0]).
+-export([start/2, make_all_runs_index/0, log/3, nodedir/2,
+ stop/0]).
+
+-include("ct_util.hrl").
-record(state, {log_fd, start_time, logdir, rundir,
nodedir_ix_fd, nodes, nodedirs=[]}).
@@ -87,6 +90,41 @@ init(Parent,LogDir,Nodes) ->
RunDirAbs = filename:join(LogDir,RunDir),
file:make_dir(RunDirAbs),
write_details_file(RunDirAbs,{node(),Nodes}),
+
+ case basic_html() of
+ true ->
+ put(basic_html, true);
+ BasicHtml ->
+ put(basic_html, BasicHtml),
+ %% copy priv files to log dir (both top dir and test run
+ %% dir) so logs are independent of Common Test installation
+ CTPath = code:lib_dir(common_test),
+ PrivFiles = [?css_default,?jquery_script,?tablesorter_script],
+ PrivFilesSrc = [filename:join(filename:join(CTPath, "priv"), F) ||
+ F <- PrivFiles],
+ PrivFilesDestTop = [filename:join(LogDir, F) || F <- PrivFiles],
+ PrivFilesDestRun = [filename:join(RunDirAbs, F) || F <- PrivFiles],
+ case copy_priv_files(PrivFilesSrc, PrivFilesDestTop) of
+ {error,Src1,Dest1,Reason1} ->
+ io:format(user, "ERROR! "++
+ "Priv file ~p could not be copied to ~p. "++
+ "Reason: ~p~n",
+ [Src1,Dest1,Reason1]),
+ exit({priv_file_error,Dest1});
+ ok ->
+ case copy_priv_files(PrivFilesSrc, PrivFilesDestRun) of
+ {error,Src2,Dest2,Reason2} ->
+ io:format(user, "ERROR! "++
+ "Priv file ~p could not be copied to ~p. "++
+ "Reason: ~p~n",
+ [Src2,Dest2,Reason2]),
+ exit({priv_file_error,Dest2});
+ ok ->
+ ok
+ end
+ end
+ end,
+
make_all_runs_index(LogDir),
CtLogFd = open_ct_master_log(RunDirAbs),
NodeStr =
@@ -96,7 +134,7 @@ init(Parent,LogDir,Nodes) ->
io:format(CtLogFd,int_header(),[log_timestamp(now()),"Test Nodes\n"]),
io:format(CtLogFd,"~s\n",[NodeStr]),
- io:format(CtLogFd,int_footer()++"\n",[]),
+ io:put_chars(CtLogFd,[int_footer(),"\n"]),
NodeDirIxFd = open_nodedir_index(RunDirAbs,Time),
Parent ! {started,self(),{Time,RunDirAbs}},
@@ -110,6 +148,16 @@ init(Parent,LogDir,Nodes) ->
{N,""}
end,Nodes)}).
+copy_priv_files([SrcF | SrcFs], [DestF | DestFs]) ->
+ case file:copy(SrcF, DestF) of
+ {error,Reason} ->
+ {error,SrcF,DestF,Reason};
+ _ ->
+ copy_priv_files(SrcFs, DestFs)
+ end;
+copy_priv_files([], []) ->
+ ok.
+
loop(State) ->
receive
{log,_From,List} ->
@@ -154,23 +202,21 @@ loop(State) ->
open_ct_master_log(Dir) ->
FullName = filename:join(Dir,?ct_master_log_name),
{ok,Fd} = file:open(FullName,[write]),
- io:format(Fd,header("Common Test Master Log"),[]),
+ io:put_chars(Fd,header("Common Test Master Log", {[],[1,2],[]})),
%% maybe add config info here later
- io:format(Fd, config_table([]), []),
- io:format(Fd,
- "<style>\n"
- "div.ct_internal { background:lightgrey; color:black }\n"
- "div.default { background:lightgreen; color:black }\n"
- "</style>\n",
- []),
- io:format(Fd,
- "<br><h2>Progress Log</h2>\n"
- "<pre>\n",[]),
+ io:put_chars(config_table([])),
+ io:put_chars(Fd,
+ "<style>\n"
+ "div.ct_internal { background:lightgrey; color:black }\n"
+ "div.default { background:lightgreen; color:black }\n"
+ "</style>\n"),
+ io:put_chars(Fd,
+ xhtml("<br><h2>Progress Log</h2>\n<pre>\n",
+ "<br /><h2>Progress Log</h2>\n<pre>\n")),
Fd.
close_ct_master_log(Fd) ->
- io:format(Fd,"</pre>",[]),
- io:format(Fd,footer(),[]),
+ io:put_chars(Fd,["</pre>",footer()]),
file:close(Fd).
config_table(Vars) ->
@@ -178,20 +224,15 @@ config_table(Vars) ->
config_table_header() ->
["<h2>Configuration</h2>\n",
- "<table border=\"3\" cellpadding=\"5\" bgcolor=\"",?table_color,
- "\"\n",
- "<tr><th>Key</th><th>Value</th></tr>\n"].
-
-%%
-%% keep for possible later use
-%%
-%%config_table1([{Key,Value}|Vars]) ->
-%% ["<tr><td>", atom_to_list(Key), "</td>\n",
-%% "<td><pre>",io_lib:format("~p",[Value]),"</pre></td></tr>\n" |
-%% config_table1(Vars)];
+ xhtml(["<table border=\"3\" cellpadding=\"5\" "
+ "bgcolor=\"",?table_color,"\"\n"],
+ ["<table id=\"",?sortable_table_name,"\">\n",
+ "<thead>\n"]),
+ "<tr><th>Key</th><th>Value</th></tr>\n",
+ xhtml("", "</thead>\n<tbody>\n")].
config_table1([]) ->
- ["</table>\n"].
+ ["</tbody>\n</table>\n"].
int_header() ->
"<div class=\"ct_internal\"><b>*** CT MASTER ~s *** ~s</b>".
@@ -204,31 +245,33 @@ int_footer() ->
open_nodedir_index(Dir,StartTime) ->
FullName = filename:join(Dir,?nodedir_index_name),
{ok,Fd} = file:open(FullName,[write]),
- io:format(Fd,nodedir_index_header(StartTime),[]),
+ io:put_chars(Fd,nodedir_index_header(StartTime)),
Fd.
print_nodedir(Node,RunDir,Fd) ->
Index = filename:join(RunDir,"index.html"),
- io:format(Fd,
- ["<TR>\n"
- "<TD ALIGN=center>",atom_to_list(Node),"</TD>\n",
- "<TD ALIGN=left><A HREF=\"",Index,"\">",Index,"</A></TD>\n",
- "</TR>\n"],[]),
+ io:put_chars(Fd,
+ ["<tr>\n"
+ "<td align=center>",atom_to_list(Node),"</td>\n",
+ "<td align=left><a href=\"",Index,"\">",Index,"</a></td>\n",
+ "</tr>\n"]),
ok.
close_nodedir_index(Fd) ->
- io:format(Fd,index_footer(),[]),
+ io:put_chars(Fd,index_footer()),
file:close(Fd).
nodedir_index_header(StartTime) ->
- [header("Log Files " ++ format_time(StartTime)) |
- ["<CENTER>\n",
- "<P><A HREF=\"",?ct_master_log_name,"\">Common Test Master Log</A></P>",
- "<TABLE border=\"3\" cellpadding=\"5\" ",
- "BGCOLOR=\"",?table_color,"\">\n",
- "<th><B>Node</B></th>\n",
- "<th><B>Log</B></th>\n",
- "\n"]].
+ [header("Log Files " ++ format_time(StartTime), {[],[1,2],[]}) |
+ ["<center>\n",
+ "<p><a href=\"",?ct_master_log_name,"\">Common Test Master Log</a></p>",
+ xhtml(["<table border=\"3\" cellpadding=\"5\" "
+ "bgcolor=\"",?table_color,"\">\n"],
+ ["<table id=\"",?sortable_table_name,"\">\n",
+ "<thead>\n<tr>\n"]),
+ "<th><b>Node</b></th>\n",
+ "<th><b>Log</b></th>\n",
+ xhtml("", "</tr>\n</thead>\n<tbody>\n")]].
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% All Run Index functions %%%
@@ -279,21 +322,23 @@ runentry(Dir) ->
{"unknown",""}
end,
Index = filename:join(Dir,?nodedir_index_name),
- ["<TR>\n"
- "<TD ALIGN=center><A HREF=\"",Index,"\">",timestamp(Dir),"</A></TD>\n",
- "<TD ALIGN=center>",MasterStr,"</TD>\n",
- "<TD ALIGN=center>",NodesStr,"</TD>\n",
- "</TR>\n"].
+ ["<tr>\n"
+ "<td align=center><a href=\"",Index,"\">",timestamp(Dir),"</a></td>\n",
+ "<td align=center>",MasterStr,"</td>\n",
+ "<td align=center>",NodesStr,"</td>\n",
+ "</tr>\n"].
all_runs_header() ->
- [header("Master Test Runs") |
- ["<CENTER>\n",
- "<TABLE border=\"3\" cellpadding=\"5\" "
- "BGCOLOR=\"",?table_color,"\">\n"
- "<th><B>History</B></th>\n"
- "<th><B>Master Host</B></th>\n"
- "<th><B>Test Nodes</B></th>\n"
- "\n"]].
+ [header("Master Test Runs", {[1],[2,3],[]}) |
+ ["<center>\n",
+ xhtml(["<table border=\"3\" cellpadding=\"5\" "
+ "bgcolor=\"",?table_color,"\">\n"],
+ ["<table id=\"",?sortable_table_name,"\">\n",
+ "<thead>\n<tr>\n"]),
+ "<th><b>History</b></th>\n"
+ "<th><b>Master Host</b></th>\n"
+ "<th><b>Test Nodes</b></th>\n",
+ xhtml("", "</tr></thead>\n<tbody>\n")]].
timestamp(Dir) ->
[S,Min,H,D,M,Y|_] = lists:reverse(string:tokens(Dir,".-_")),
@@ -317,52 +362,71 @@ read_details_file(Dir) ->
%%% Internal functions
%%%--------------------------------------------------------------------
-header(Title) ->
- ["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n"
- "<!-- autogenerated by '"++atom_to_list(?MODULE)++"'. -->\n"
- "<HTML>\n",
- "<HEAD>\n",
-
- "<TITLE>" ++ Title ++ "</TITLE>\n",
- "<META HTTP-EQUIV=\"CACHE-CONTROL\" CONTENT=\"NO-CACHE\">\n",
-
- "</HEAD>\n",
-
+header(Title, TableCols) ->
+ CSSFile = xhtml(fun() -> "" end,
+ fun() -> make_relative(locate_priv_file(?css_default)) end),
+ JQueryFile =
+ xhtml(fun() -> "" end,
+ fun() -> make_relative(locate_priv_file(?jquery_script)) end),
+ TableSorterFile =
+ xhtml(fun() -> "" end,
+ fun() -> make_relative(locate_priv_file(?tablesorter_script)) end),
+
+ [xhtml(["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n",
+ "<html>\n"],
+ ["<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n",
+ "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n",
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"]),
+ "<!-- autogenerated by '"++atom_to_list(?MODULE)++"' -->\n",
+ "<head>\n",
+ "<title>" ++ Title ++ "</title>\n",
+ "<meta http-equiv=\"cache-control\" content=\"no-cache\">\n",
+ xhtml("",
+ ["<link rel=\"stylesheet\" href=\"",CSSFile,"\" type=\"text/css\">"]),
+ xhtml("",
+ ["<script type=\"text/javascript\" src=\"",JQueryFile,
+ "\"></script>\n"]),
+ xhtml("",
+ ["<script type=\"text/javascript\" src=\"",TableSorterFile,
+ "\"></script>\n"]),
+ xhtml(fun() -> "" end,
+ fun() -> ct_logs:insert_javascript({tablesorter,
+ ?sortable_table_name,
+ TableCols}) end),
+ "</head>\n",
body_tag(),
-
- "<!-- ---- DOCUMENT TITLE ---- -->\n",
-
- "<CENTER>\n",
- "<H1>" ++ Title ++ "</H1>\n",
- "</CENTER>\n",
-
- "<!-- ---- CONTENT ---- -->\n"].
+ "<center>\n",
+ "<h1>" ++ Title ++ "</h1>\n",
+ "</center>\n"].
index_footer() ->
- ["</TABLE>\n"
- "</CENTER>\n" | footer()].
+ ["</tbody>\n</table>\n"
+ "</center>\n" | footer()].
footer() ->
- ["<P><CENTER>\n"
- "<HR>\n"
- "<P><FONT SIZE=-1>\n"
+ ["<center>\n",
+ xhtml("<br><hr>\n", "<br />\n"),
+ xhtml("<p><font size=\"-1\">\n", "<div class=\"copyright\">"),
"Copyright &copy; ", year(),
- " <A HREF=\"http://erlang.ericsson.se\">Open Telecom Platform</A><BR>\n"
- "Updated: <!date>", current_time(), "<!/date><BR>\n"
- "</FONT>\n"
- "</CENTER>\n"
+ " <a href=\"http://www.erlang.org\">Open Telecom Platform</a>",
+ xhtml("<br>\n", "<br />\n"),
+ "Updated: <!date>", current_time(), "<!/date>",
+ xhtml("<br>\n", "<br />\n"),
+ xhtml("</font></p>\n", "</div>\n"),
+ "</center>\n"
"</body>\n"].
body_tag() ->
- "<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\""
- "vlink=\"#800080\" alink=\"#FF0000\">\n".
+ xhtml("<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" "
+ "vlink=\"#800080\" alink=\"#FF0000\">\n",
+ "<body>\n").
current_time() ->
format_time(calendar:local_time()).
format_time({{Y, Mon, D}, {H, Min, S}}) ->
Weekday = weekday(calendar:day_of_the_week(Y, Mon, D)),
- lists:flatten(io_lib:format("~s ~s ~p ~w ~2.2.0w:~2.2.0w:~2.2.0w",
+ lists:flatten(io_lib:format("~s ~s ~2.2.0w ~w ~2.2.0w:~2.2.0w:~2.2.0w",
[Weekday, month(Mon), D, Y, H, Min, S])).
weekday(1) -> "Mon";
@@ -404,6 +468,23 @@ log_timestamp(Now) ->
lists:flatten(io_lib:format("~2.2.0w:~2.2.0w:~2.2.0w",
[H,M,S])).
+basic_html() ->
+ case application:get_env(common_test_master, basic_html) of
+ {ok,true} ->
+ true;
+ _ ->
+ false
+ end.
+
+xhtml(HTML, XHTML) ->
+ ct_logs:xhtml(HTML, XHTML).
+
+locate_priv_file(File) ->
+ ct_logs:locate_priv_file(File).
+
+make_relative(Dir) ->
+ ct_logs:make_relative(Dir).
+
force_write_file(Name,Contents) ->
force_delete(Name),
file:write_file(Name,Contents).
@@ -452,3 +533,4 @@ cast(Msg) ->
_Pid ->
?MODULE ! Msg
end.
+
diff --git a/lib/common_test/src/ct_netconfc.erl b/lib/common_test/src/ct_netconfc.erl
new file mode 100644
index 0000000000..52fe9599ce
--- /dev/null
+++ b/lib/common_test/src/ct_netconfc.erl
@@ -0,0 +1,1835 @@
+%%----------------------------------------------------------------------
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+%%----------------------------------------------------------------------
+%% File: ct_netconfc.erl
+%%
+%% Description:
+%% This file contains the Netconf client interface
+%%
+%% @author Support
+%%
+%% @doc Netconf client module.
+%%
+%% <p>The Netconf client is compliant with RFC4741 and RFC4742.</p>
+%%
+%% <p> For each server to test against, the following entry can be
+%% added to a configuration file:</p>
+%%
+%% <p>`{server_id(),options()}.'</p>
+%%
+%% <p> The `server_id()' or an associated `target_name()' (see
+%% {@link ct}) shall then be used in calls to {@link open/2}.</p>
+%%
+%% <p>If no configuration exists for a server, a session can still be
+%% opened by calling {@link open/2} with all necessary options given
+%% in the call. The first argument to {@link open/2} can then be any
+%% atom.</p>
+%%
+%% == Logging ==
+%%
+%% The netconf server uses the `error_logger' for logging of netconf
+%% traffic. A special purpose error handler is implemented in
+%% `ct_conn_log_h'. To use this error handler, add the `cth_conn_log'
+%% hook in your test suite, e.g.
+%%
+%% ```
+%% suite() ->
+%% [{ct_hooks, [{cth_conn_log, [{conn_mod(),hook_options()}]}]}].
+%%'''
+%%
+%% The `conn_mod()' is the name of the common_test module implementing
+%% the connection protocol, e.g. `ct_netconfc'.
+%%
+%% The hook option `log_type' specifies the type of logging:
+%%
+%% <dl>
+%% <dt>`raw'</dt>
+%% <dd>The sent and received netconf data is logged to a separate
+%% text file as is without any formatting. A link to the file is
+%% added to the test case HTML log.</dd>
+%%
+%% <dt>`pretty'</dt>
+%% <dd>The sent and received netconf data is logged to a separate
+%% text file with XML data nicely indented. A link to the file is
+%% added to the test case HTML log.</dd>
+%%
+%% <dt>`html (default)'</dt>
+%% <dd>The sent and received netconf traffic is pretty printed
+%% directly in the test case HTML log.</dd>
+%%
+%% <dt>`silent'</dt>
+%% <dd>Netconf traffic is not logged.</dd>
+%% </dl>
+%%
+%% By default, all netconf traffic is logged in one single log
+%% file. However, it is possible to have different connections logged
+%% in separate files. To do this, use the hook option `hosts' and
+%% list the names of the servers/connections that will be used in the
+%% suite. Note that the connections must be named for this to work,
+%% i.e. they must be opened with {@link open/2}.
+%%
+%% The `hosts' option has no effect if `log_type' is set to `html' or
+%% `silent'.
+%%
+%% The hook options can also be specified in a configuration file with
+%% the configuration variable `ct_conn_log':
+%%
+%% ```
+%% {ct_conn_log,[{conn_mod(),hook_options()}]}.
+%% '''
+%%
+%% For example:
+%%
+%% ```
+%% {ct_conn_log,[{ct_netconfc,[{log_type,pretty},
+%% {hosts,[key_or_name()]}]}]}
+%% '''
+%%
+%% <b>Note</b> that hook options specified in a configuration file
+%% will overwrite the hardcoded hook options in the test suite.
+%%
+%% === Logging example 1 ===
+%%
+%% The following `ct_hooks' statement will cause pretty printing of
+%% netconf traffic to separate logs for the connections named
+%% `nc_server1' and `nc_server2'. Any other connections will be logged
+%% to default netconf log.
+%%
+%% ```
+%% suite() ->
+%% [{ct_hooks, [{cth_conn_log, [{ct_netconfc,[{log_type,pretty}},
+%% {hosts,[nc_server1,nc_server2]}]}
+%% ]}]}].
+%%'''
+%%
+%% Connections must be opened like this:
+%%
+%% ```
+%% open(nc_server1,[...]),
+%% open(nc_server2,[...]).
+%% '''
+%%
+%% === Logging example 2 ===
+%%
+%% The following configuration file will cause raw logging of all
+%% netconf traffic into one single text file.
+%%
+%% ```
+%% {ct_conn_log,[{ct_netconfc,[{log_type,raw}]}]}.
+%% '''
+%%
+%% The `ct_hooks' statement must look like this:
+%%
+%% ```
+%% suite() ->
+%% [{ct_hooks, [{cth_conn_log, []}]}].
+%% '''
+%%
+%% The same `ct_hooks' statement without the configuration file would
+%% cause HTML logging of all netconf connections into the test case
+%% HTML log.
+%%
+%% == Notifications ==
+%%
+%% The netconf client is also compliant with RFC5277 NETCONF Event
+%% Notifications, which defines a mechanism for an asynchronous
+%% message notification delivery service for the netconf protocol.
+%%
+%% Specific functions to support this are {@link
+%% create_subscription/6} and {@link get_event_streams/3}. (The
+%% functions also exist with other arities.)
+%%
+%% @end
+%%----------------------------------------------------------------------
+-module(ct_netconfc).
+
+-include("ct_netconfc.hrl").
+-include("ct_util.hrl").
+-include_lib("xmerl/include/xmerl.hrl").
+
+%%----------------------------------------------------------------------
+%% External exports
+%%----------------------------------------------------------------------
+-export([open/1,
+ open/2,
+ only_open/1,
+ only_open/2,
+ hello/1,
+ hello/2,
+ close_session/1,
+ close_session/2,
+ kill_session/2,
+ kill_session/3,
+ send/2,
+ send/3,
+ send_rpc/2,
+ send_rpc/3,
+ lock/2,
+ lock/3,
+ unlock/2,
+ unlock/3,
+ get/2,
+ get/3,
+ get_config/3,
+ get_config/4,
+ edit_config/3,
+ edit_config/4,
+ delete_config/2,
+ delete_config/3,
+ copy_config/3,
+ copy_config/4,
+ action/2,
+ action/3,
+ create_subscription/1,
+ create_subscription/2,
+ create_subscription/3,
+ create_subscription/4,
+ create_subscription/5,
+ create_subscription/6,
+ get_event_streams/2,
+ get_event_streams/3,
+ get_capabilities/1,
+ get_capabilities/2,
+ get_session_id/1,
+ get_session_id/2]).
+
+%%----------------------------------------------------------------------
+%% Exported types
+%%----------------------------------------------------------------------
+-export_type([hook_options/0,
+ conn_mod/0,
+ log_type/0,
+ key_or_name/0,
+ notification/0]).
+
+%%----------------------------------------------------------------------
+%% Internal exports
+%%----------------------------------------------------------------------
+%% ct_gen_conn callbacks
+-export([init/3,
+ handle_msg/3,
+ handle_msg/2,
+ terminate/2,
+ close/1]).
+
+%% ct_conn_log callback
+-export([format_data/2]).
+
+%%----------------------------------------------------------------------
+%% Internal defines
+%%----------------------------------------------------------------------
+-define(APPLICATION,?MODULE).
+-define(VALID_SSH_OPTS,[user, password, user_dir]).
+-define(DEFAULT_STREAM,"NETCONF").
+
+-define(error(ConnName,Report),
+ error_logger:error_report([{ct_connection,ConnName},
+ {client,self()},
+ {module,?MODULE},
+ {line,?LINE} |
+ Report])).
+
+-define(is_timeout(T), (is_integer(T) orelse T==infinity)).
+-define(is_filter(F),
+ (is_atom(F) orelse (is_tuple(F) andalso is_atom(element(1,F))))).
+-define(is_string(S), (is_list(S) andalso is_integer(hd(S)))).
+
+%%----------------------------------------------------------------------
+%% Records
+%%----------------------------------------------------------------------
+%% Client state
+-record(state, {host,
+ port,
+ connection, % #connection
+ capabilities,
+ session_id,
+ msg_id = 1,
+ hello_status,
+ buff = <<>>,
+ pending = [], % [#pending]
+ event_receiver}).% pid
+
+%% Run-time client options.
+-record(options, {ssh = [], % Options for the ssh application
+ host,
+ port = ?DEFAULT_PORT,
+ timeout = ?DEFAULT_TIMEOUT,
+ name}).
+
+%% Connection reference
+-record(connection, {reference, % {CM,Ch}
+ host,
+ port,
+ name}).
+
+%% Pending replies from server
+-record(pending, {tref, % timer ref (returned from timer:xxx)
+ ref, % pending ref
+ msg_id,
+ op,
+ caller}).% pid which sent the request
+
+%%----------------------------------------------------------------------
+%% Type declarations
+%%----------------------------------------------------------------------
+-type client() :: handle() | server_id() | target_name().
+-type handle() :: term().
+%% An opaque reference for a connection (netconf session). See {@link
+%% ct} for more information.
+
+-type server_id() :: atom().
+%% A `ServerId' which exists in a configuration file.
+-type target_name() :: atom().
+%% A name which is associated to a `server_id()' via a
+%% `require' statement or a call to {@link ct:require/2} in the
+%% test suite.
+-type key_or_name() :: server_id() | target_name().
+
+-type options() :: [option()].
+%% Options used for setting up ssh connection to a netconf server.
+
+-type option() :: {ssh,host()} | {port,inet:port_number()} | {user,string()} |
+ {password,string()} | {user_dir,string()} |
+ {timeout,timeout()}.
+-type host() :: inet:host_name() | inet:ip_address().
+
+-type notification() :: {notification, xml_attributes(), notification_content()}.
+-type notification_content() :: [event_time()|simple_xml()].
+-type event_time() :: {eventTime,xml_attributes(),[xs_datetime()]}.
+
+-type stream_name() :: string().
+-type streams() :: [{stream_name(),[stream_data()]}].
+-type stream_data() :: {description,string()} |
+ {replaySupport,string()} |
+ {replayLogCreationTime,string()} |
+ {replayLogAgedTime,string()}.
+%% See XML Schema for Event Notifications found in RFC5277 for further
+%% detail about the data format for the string values.
+
+-type hook_options() :: [hook_option()].
+%% Options that can be given to `cth_conn_log' in the `ct_hook' statement.
+-type hook_option() :: {log_type,log_type()} |
+ {hosts,[key_or_name()]}.
+-type log_type() :: raw | pretty | html | silent.
+%-type error_handler() :: module().
+-type conn_mod() :: ct_netconfc.
+
+-type error_reason() :: term().
+
+-type simple_xml() :: {xml_tag(), xml_attributes(), xml_content()} |
+ {xml_tag(), xml_content()} |
+ xml_tag().
+%% <p>This type is further described in the documentation for the
+%% <tt>Xmerl</tt> application.</p>
+-type xml_tag() :: atom().
+-type xml_attributes() :: [{xml_attribute_tag(),xml_attribute_value()}].
+-type xml_attribute_tag() :: atom().
+-type xml_attribute_value() :: string().
+-type xml_content() :: [simple_xml() | iolist()].
+-type xpath() :: {xpath,string()}.
+
+-type netconf_db() :: running | startup | candidate.
+-type xs_datetime() :: string().
+%% This date and time identifyer has the same format as the XML type
+%% dateTime and compliant to RFC3339. The format is
+%% ```[-]CCYY-MM-DDThh:mm:ss[.s][Z|(+|-)hh:mm]'''
+
+%%----------------------------------------------------------------------
+%% External interface functions
+%%----------------------------------------------------------------------
+
+%%----------------------------------------------------------------------
+-spec open(Options) -> Result when
+ Options :: options(),
+ Result :: {ok,handle()} | {error,error_reason()}.
+%% @doc Open a netconf session and exchange `hello' messages.
+%%
+%% If the server options are specified in a configuration file, or if
+%% a named client is needed for logging purposes (see {@section
+%% Logging}) use {@link open/2} instead.
+%%
+%% The opaque `handler()' reference which is returned from this
+%% function is required as client identifier when calling any other
+%% function in this module.
+%%
+%% The `timeout' option (milli seconds) is used when setting up
+%% the ssh connection and when waiting for the hello message from the
+%% server. It is not used for any other purposes during the lifetime
+%% of the connection.
+%%
+%% @end
+%%----------------------------------------------------------------------
+open(Options) ->
+ open(Options,#options{},[],true).
+
+%%----------------------------------------------------------------------
+-spec open(KeyOrName, ExtraOptions) -> Result when
+ KeyOrName :: key_or_name(),
+ ExtraOptions :: options(),
+ Result :: {ok,handle()} | {error,error_reason()}.
+%% @doc Open a named netconf session and exchange `hello' messages.
+%%
+%% If `KeyOrName' is a configured `server_id()' or a
+%% `target_name()' associated with such an ID, then the options
+%% for this server will be fetched from the configuration file.
+%
+%% The `ExtraOptions' argument will be added to the options found in
+%% the configuration file. If the same options are given, the values
+%% from the configuration file will overwrite `ExtraOptions'.
+%%
+%% If the server is not specified in a configuration file, use {@link
+%% open/1} instead.
+%%
+%% The opaque `handle()' reference which is returned from this
+%% function can be used as client identifier when calling any other
+%% function in this module. However, if `KeyOrName' is a
+%% `target_name()', i.e. if the server is named via a call to
+%% `ct:require/2' or a `require' statement in the test
+%% suite, then this name may be used instead of the `handle()'.
+%%
+%% The `timeout' option (milli seconds) is used when setting up
+%% the ssh connection and when waiting for the hello message from the
+%% server. It is not used for any other purposes during the lifetime
+%% of the connection.
+%%
+%% @see ct:require/2
+%% @end
+%%----------------------------------------------------------------------
+open(KeyOrName, ExtraOpts) ->
+ open(KeyOrName, ExtraOpts, true).
+
+open(KeyOrName, ExtraOpts, Hello) ->
+ SortedExtra = lists:keysort(1,ExtraOpts),
+ SortedConfig = lists:keysort(1,ct:get_config(KeyOrName,[])),
+ AllOpts = lists:ukeymerge(1,SortedConfig,SortedExtra),
+ open(AllOpts,#options{name=KeyOrName},[{name,KeyOrName}],Hello).
+
+open(OptList,InitOptRec,NameOpt,Hello) ->
+ case check_options(OptList,undefined,undefined,InitOptRec) of
+ {Host,Port,Options} ->
+ case ct_gen_conn:start({Host,Port},Options,?MODULE,
+ NameOpt ++ [{reconnect,false},
+ {use_existing_connection,false},
+ {forward_messages,true}]) of
+ {ok,Client} when Hello==true ->
+ case hello(Client,Options#options.timeout) of
+ ok ->
+ {ok,Client};
+ Error ->
+ Error
+ end;
+ Other ->
+ Other
+ end;
+ Error ->
+ Error
+ end.
+
+
+%%----------------------------------------------------------------------
+-spec only_open(Options) -> Result when
+ Options :: options(),
+ Result :: {ok,handle()} | {error,error_reason()}.
+%% @doc Open a netconf session, but don't send `hello'.
+%%
+%% As {@link open/1} but does not send a `hello' message.
+%%
+%% @end
+%%----------------------------------------------------------------------
+only_open(Options) ->
+ open(Options,#options{},[],false).
+
+%%----------------------------------------------------------------------
+-spec only_open(KeyOrName,ExtraOptions) -> Result when
+ KeyOrName :: key_or_name(),
+ ExtraOptions :: options(),
+ Result :: {ok,handle()} | {error,error_reason()}.
+%% @doc Open a name netconf session, but don't send `hello'.
+%%
+%% As {@link open/2} but does not send a `hello' message.
+%%
+%% @end
+%%----------------------------------------------------------------------
+only_open(KeyOrName, ExtraOpts) ->
+ open(KeyOrName, ExtraOpts, false).
+
+%%----------------------------------------------------------------------
+%% @spec hello(Client) -> Result
+%% @equiv hello(Client, infinity)
+hello(Client) ->
+ hello(Client,?DEFAULT_TIMEOUT).
+
+%%----------------------------------------------------------------------
+-spec hello(Client,Timeout) -> Result when
+ Client :: handle(),
+ Timeout :: timeout(),
+ Result :: ok | {error,error_reason()}.
+%% @doc Exchange `hello' messages with the server.
+%%
+%% Sends a `hello' message to the server and waits for the return.
+%%
+%% @end
+%%----------------------------------------------------------------------
+hello(Client,Timeout) ->
+ call(Client, {hello, Timeout}).
+
+%%----------------------------------------------------------------------
+%% @spec get_session_id(Client) -> Result
+%% @equiv get_session_id(Client, infinity)
+get_session_id(Client) ->
+ get_session_id(Client, ?DEFAULT_TIMEOUT).
+
+%%----------------------------------------------------------------------
+-spec get_session_id(Client, Timeout) -> Result when
+ Client :: client(),
+ Timeout :: timeout(),
+ Result :: pos_integer() | {error,error_reason()}.
+%% @doc Returns the session id associated with the given client.
+%%
+%% @end
+%%----------------------------------------------------------------------
+get_session_id(Client, Timeout) ->
+ call(Client, get_session_id, Timeout).
+
+%%----------------------------------------------------------------------
+%% @spec get_capabilities(Client) -> Result
+%% @equiv get_capabilities(Client, infinity)
+get_capabilities(Client) ->
+ get_capabilities(Client, ?DEFAULT_TIMEOUT).
+
+%%----------------------------------------------------------------------
+-spec get_capabilities(Client, Timeout) -> Result when
+ Client :: client(),
+ Timeout :: timeout(),
+ Result :: [string()] | {error,error_reason()}.
+%% @doc Returns the server side capabilities
+%%
+%% The following capability identifiers, defined in RFC 4741, can be returned:
+%%
+%% <ul>
+%% <li>`"urn:ietf:params:netconf:base:1.0"'</li>
+%% <li>`"urn:ietf:params:netconf:capability:writable-running:1.0"'</li>
+%% <li>`"urn:ietf:params:netconf:capability:candidate:1.0"'</li>
+%% <li>`"urn:ietf:params:netconf:capability:confirmed-commit:1.0"'</li>
+%% <li>`"urn:ietf:params:netconf:capability:rollback-on-error:1.0"'</li>
+%% <li>`"urn:ietf:params:netconf:capability:startup:1.0"'</li>
+%% <li>`"urn:ietf:params:netconf:capability:url:1.0"'</li>
+%% <li>`"urn:ietf:params:netconf:capability:xpath:1.0"'</li>
+%% </ul>
+%%
+%% Note, additional identifiers may exist, e.g. server side namespace.
+%%
+%% @end
+%%----------------------------------------------------------------------
+get_capabilities(Client, Timeout) ->
+ call(Client, get_capabilities, Timeout).
+
+%% @private
+send(Client, SimpleXml) ->
+ send(Client, SimpleXml, ?DEFAULT_TIMEOUT).
+%% @private
+send(Client, SimpleXml, Timeout) ->
+ call(Client,{send, Timeout, SimpleXml}).
+
+%% @private
+send_rpc(Client, SimpleXml) ->
+ send_rpc(Client, SimpleXml, ?DEFAULT_TIMEOUT).
+%% @private
+send_rpc(Client, SimpleXml, Timeout) ->
+ call(Client,{send_rpc, SimpleXml, Timeout}).
+
+
+
+%%----------------------------------------------------------------------
+%% @spec lock(Client, Target) -> Result
+%% @equiv lock(Client, Target, infinity)
+lock(Client, Target) ->
+ lock(Client, Target,?DEFAULT_TIMEOUT).
+
+%%----------------------------------------------------------------------
+-spec lock(Client, Target, Timeout) -> Result when
+ Client :: client(),
+ Target :: netconf_db(),
+ Timeout :: timeout(),
+ Result :: ok | {error,error_reason()}.
+%% @doc Unlock configuration target.
+%%
+%% Which target parameters that can be used depends on if
+%% `:candidate' and/or `:startup' are supported by the
+%% server. If successfull, the configuration system of the device is
+%% not available to other clients (Netconf, CORBA, SNMP etc). Locks
+%% are intended to be short-lived.
+%%
+%% The operations {@link kill_session/2} or {@link kill_session/3} can
+%% be used to force the release of a lock owned by another Netconf
+%% session. How this is achieved by the server side is implementation
+%% specific.
+%%
+%% @end
+%%----------------------------------------------------------------------
+lock(Client, Target, Timeout) ->
+ call(Client,{send_rpc_op,lock,[Target],Timeout}).
+
+%%----------------------------------------------------------------------
+%% @spec unlock(Client, Target) -> Result
+%% @equiv unlock(Client, Target, infinity)
+unlock(Client, Target) ->
+ unlock(Client, Target,?DEFAULT_TIMEOUT).
+
+%%----------------------------------------------------------------------
+-spec unlock(Client, Target, Timeout) -> Result when
+ Client :: client(),
+ Target :: netconf_db(),
+ Timeout :: timeout(),
+ Result :: ok | {error,error_reason()}.
+%% @doc Unlock configuration target.
+%%
+%% If the client earlier has aquired a lock, via {@link lock/2} or
+%% {@link lock/3}, this operation release the associated lock. To be
+%% able to access another target than `running', the server must
+%% support `:candidate' and/or `:startup'.
+%%
+%% @end
+%%----------------------------------------------------------------------
+unlock(Client, Target, Timeout) ->
+ call(Client, {send_rpc_op, unlock, [Target], Timeout}).
+
+%%----------------------------------------------------------------------
+%% @spec get(Client, Filter) -> Result
+%% @equiv get(Client, Filter, infinity)
+get(Client, Filter) ->
+ get(Client, Filter, ?DEFAULT_TIMEOUT).
+
+%%----------------------------------------------------------------------
+-spec get(Client, Filter, Timeout) -> Result when
+ Client :: client(),
+ Filter :: simple_xml() | xpath(),
+ Timeout :: timeout(),
+ Result :: {ok,simple_xml()} | {error,error_reason()}.
+%% @doc Get data.
+%%
+%% This operation returns both configuration and state data from the
+%% server.
+%%
+%% Filter type `xpath' can only be used if the server supports
+%% `:xpath'.
+%%
+%% @end
+%%----------------------------------------------------------------------
+get(Client, Filter, Timeout) ->
+ call(Client,{send_rpc_op, get, [Filter], Timeout}).
+
+%%----------------------------------------------------------------------
+%% @spec get_config(Client, Source, Filter) -> Result
+%% @equiv get_config(Client, Source, Filter, infinity)
+get_config(Client, Source, Filter) ->
+ get_config(Client, Source, Filter, ?DEFAULT_TIMEOUT).
+
+%%----------------------------------------------------------------------
+-spec get_config(Client, Source, Filter, Timeout) -> Result when
+ Client :: client(),
+ Source :: netconf_db(),
+ Filter :: simple_xml() | xpath(),
+ Timeout :: timeout(),
+ Result :: {ok,simple_xml()} | {error,error_reason()}.
+%% @doc Get configuration data.
+%%
+%% To be able to access another source than `running', the server
+%% must advertise `:candidate' and/or `:startup'.
+%%
+%% Filter type `xpath' can only be used if the server supports
+%% `:xpath'.
+%%
+%%
+%% @end
+%%----------------------------------------------------------------------
+get_config(Client, Source, Filter, Timeout) ->
+ call(Client, {send_rpc_op, get_config, [Source, Filter], Timeout}).
+
+%%----------------------------------------------------------------------
+%% @spec edit_config(Client, Target, Config) -> Result
+%% @equiv edit_config(Client, Target, Config, infinity)
+edit_config(Client, Target, Config) ->
+ edit_config(Client, Target, Config, ?DEFAULT_TIMEOUT).
+
+%%----------------------------------------------------------------------
+-spec edit_config(Client, Target, Config, Timeout) -> Result when
+ Client :: client(),
+ Target :: netconf_db(),
+ Config :: simple_xml(),
+ Timeout :: timeout(),
+ Result :: ok | {error,error_reason()}.
+%% @doc Edit configuration data.
+%%
+%% Per default only the running target is available, unless the server
+%% include `:candidate' or `:startup' in its list of
+%% capabilities.
+%%
+%% @end
+%%----------------------------------------------------------------------
+edit_config(Client, Target, Config, Timeout) ->
+ call(Client, {send_rpc_op, edit_config, [Target,Config], Timeout}).
+
+
+%%----------------------------------------------------------------------
+%% @spec delete_config(Client, Target) -> Result
+%% @equiv delete_config(Client, Target, infinity)
+delete_config(Client, Target) ->
+ delete_config(Client, Target, ?DEFAULT_TIMEOUT).
+
+%%----------------------------------------------------------------------
+-spec delete_config(Client, Target, Timeout) -> Result when
+ Client :: client(),
+ Target :: startup | candidate,
+ Timeout :: timeout(),
+ Result :: ok | {error,error_reason()}.
+%% @doc Delete configuration data.
+%%
+%% The running configuration cannot be deleted and `:candidate'
+%% or `:startup' must be advertised by the server.
+%%
+%% @end
+%%----------------------------------------------------------------------
+delete_config(Client, Target, Timeout) when Target == startup;
+ Target == candidate ->
+ call(Client,{send_rpc_op, delete_config, [Target], Timeout}).
+
+%%----------------------------------------------------------------------
+%% @spec copy_config(Client, Source, Target) -> Result
+%% @equiv copy_config(Client, Source, Target, infinity)
+copy_config(Client, Source, Target) ->
+ copy_config(Client, Source, Target, ?DEFAULT_TIMEOUT).
+
+%%----------------------------------------------------------------------
+-spec copy_config(Client, Target, Source, Timeout) -> Result when
+ Client :: client(),
+ Target :: netconf_db(),
+ Source :: netconf_db(),
+ Timeout :: timeout(),
+ Result :: ok | {error,error_reason()}.
+%% @doc Copy configuration data.
+%%
+%% Which source and target options that can be issued depends on the
+%% capabilities supported by the server. I.e. `:candidate' and/or
+%% `:startup' are required.
+%%
+%% @end
+%%----------------------------------------------------------------------
+copy_config(Client, Target, Source, Timeout) ->
+ call(Client,{send_rpc_op, copy_config, [Target, Source], Timeout}).
+
+%%----------------------------------------------------------------------
+%% @spec action(Client, Action) -> Result
+%% @equiv action(Client, Action, infinity)
+action(Client,Action) ->
+ action(Client,Action,?DEFAULT_TIMEOUT).
+
+%%----------------------------------------------------------------------
+-spec action(Client, Action, Timeout) -> Result when
+ Client :: client(),
+ Action :: simple_xml(),
+ Timeout :: timeout(),
+ Result :: {ok,simple_xml()} | {error,error_reason()}.
+%% @doc Execute an action.
+%%
+%% @end
+%%----------------------------------------------------------------------
+action(Client,Action,Timeout) ->
+ call(Client,{send_rpc_op, action, [Action], Timeout}).
+
+%%----------------------------------------------------------------------
+create_subscription(Client) ->
+ create_subscription(Client,?DEFAULT_STREAM,?DEFAULT_TIMEOUT).
+
+create_subscription(Client,Timeout)
+ when ?is_timeout(Timeout) ->
+ create_subscription(Client,?DEFAULT_STREAM,Timeout);
+create_subscription(Client,Stream)
+ when is_list(Stream) ->
+ create_subscription(Client,Stream,?DEFAULT_TIMEOUT);
+create_subscription(Client,Filter)
+ when ?is_filter(Filter) ->
+ create_subscription(Client,?DEFAULT_STREAM,Filter,
+ ?DEFAULT_TIMEOUT).
+
+create_subscription(Client,Stream,Timeout)
+ when is_list(Stream) andalso
+ ?is_timeout(Timeout) ->
+ call(Client,{send_rpc_op,{create_subscription,self()},
+ [Stream,undefined,undefined,undefined],
+ Timeout});
+create_subscription(Client,StartTime,StopTime)
+ when is_list(StartTime) andalso
+ is_list(StopTime) ->
+ create_subscription(Client,?DEFAULT_STREAM,StartTime,StopTime,
+ ?DEFAULT_TIMEOUT);
+create_subscription(Client,Filter,Timeout)
+ when ?is_filter(Filter) andalso
+ ?is_timeout(Timeout) ->
+ create_subscription(Client,?DEFAULT_STREAM,Filter,Timeout);
+create_subscription(Client,Stream,Filter)
+ when is_list(Stream) andalso
+ ?is_filter(Filter) ->
+ create_subscription(Client,Stream,Filter,?DEFAULT_TIMEOUT).
+
+create_subscription(Client,StartTime,StopTime,Timeout)
+ when is_list(StartTime) andalso
+ is_list(StopTime) andalso
+ ?is_timeout(Timeout) ->
+ create_subscription(Client,?DEFAULT_STREAM,StartTime,StopTime,Timeout);
+create_subscription(Client,Stream,StartTime,StopTime)
+ when is_list(Stream) andalso
+ is_list(StartTime) andalso
+ is_list(StopTime) ->
+ create_subscription(Client,Stream,StartTime,StopTime,?DEFAULT_TIMEOUT);
+create_subscription(Client,Filter,StartTime,StopTime)
+ when ?is_filter(Filter) andalso
+ is_list(StartTime) andalso
+ is_list(StopTime) ->
+ create_subscription(Client,?DEFAULT_STREAM,Filter,
+ StartTime,StopTime,?DEFAULT_TIMEOUT);
+create_subscription(Client,Stream,Filter,Timeout)
+ when is_list(Stream) andalso
+ ?is_filter(Filter) andalso
+ ?is_timeout(Timeout) ->
+ call(Client,{send_rpc_op,{create_subscription,self()},
+ [Stream,Filter,undefined,undefined],
+ Timeout}).
+
+create_subscription(Client,Stream,StartTime,StopTime,Timeout)
+ when is_list(Stream) andalso
+ is_list(StartTime) andalso
+ is_list(StopTime) andalso
+ ?is_timeout(Timeout) ->
+ call(Client,{send_rpc_op,{create_subscription,self()},
+ [Stream,undefined,StartTime,StopTime],
+ Timeout});
+create_subscription(Client,Stream,Filter,StartTime,StopTime)
+ when is_list(Stream) andalso
+ ?is_filter(Filter) andalso
+ is_list(StartTime) andalso
+ is_list(StopTime) ->
+ create_subscription(Client,Stream,Filter,StartTime,StopTime,?DEFAULT_TIMEOUT).
+
+%%----------------------------------------------------------------------
+-spec create_subscription(Client, Stream, Filter,StartTime, StopTime, Timeout) ->
+ Result when
+ Client :: client(),
+ Stream :: stream_name(),
+ Filter :: simple_xml(),
+ StartTime :: xs_datetime(),
+ StopTime :: xs_datetime(),
+ Timeout :: timeout(),
+ Result :: ok | {error,error_reason()}.
+%% @doc Create a subscription for event notifications.
+%%
+%% This function sets up a subscription for netconf event
+%% notifications of the given stream type, matching the given
+%% filter. The calling process will receive notifications as messages
+%% of type `notification()'.
+%%
+%% <dl>
+%% <dt>Stream:</dt>
+%% <dd> An optional parameter that indicates which stream of events
+%% is of interest. If not present, events in the default NETCONF
+%% stream will be sent.</dd>
+%%
+%% <dt>Filter:</dt>
+%% <dd>An optional parameter that indicates which subset of all
+%% possible events is of interest. The format of this parameter is
+%% the same as that of the filter parameter in the NETCONF protocol
+%% operations. If not present, all events not precluded by other
+%% parameters will be sent. See section 3.6 for more information on
+%% filters.</dd>
+%%
+%% <dt>StartTime:</dt>
+%% <dd>An optional parameter used to trigger the replay feature and
+%% indicate that the replay should start at the time specified. If
+%% `StartTime' is not present, this is not a replay subscription.
+%% It is not valid to specify start times that are later than the
+%% current time. If the `StartTime' specified is earlier than the
+%% log can support, the replay will begin with the earliest
+%% available notification. This parameter is of type dateTime and
+%% compliant to [RFC3339]. Implementations must support time
+%% zones.</dd>
+%%
+%% <dt>StopTime:</dt>
+%% <dd>An optional parameter used with the optional replay feature
+%% to indicate the newest notifications of interest. If `StopTime'
+%% is not present, the notifications will continue until the
+%% subscription is terminated. Must be used with and be later than
+%% `StartTime'. Values of `StopTime' in the future are valid. This
+%% parameter is of type dateTime and compliant to [RFC3339].
+%% Implementations must support time zones.</dd>
+%% </dl>
+%%
+%% See RFC5277 for further details about the event notification
+%% mechanism.
+%%
+%% @end
+%%----------------------------------------------------------------------
+create_subscription(Client,Stream,Filter,StartTime,StopTime,Timeout) ->
+ call(Client,{send_rpc_op,{create_subscription, self()},
+ [Stream,Filter,StartTime,StopTime],
+ Timeout}).
+
+%%----------------------------------------------------------------------
+%% @spec get_event_streams(Client, Timeout) -> Result
+%% @equiv get_event_streams(Client, [], Timeout)
+get_event_streams(Client,Timeout) when is_integer(Timeout); Timeout==infinity ->
+ get_event_streams(Client,[],Timeout);
+
+%%----------------------------------------------------------------------
+%% @spec get_event_streams(Client, Streams) -> Result
+%% @equiv get_event_streams(Client, Streams, infinity)
+get_event_streams(Client,Streams) when is_list(Streams) ->
+ get_event_streams(Client,Streams,?DEFAULT_TIMEOUT).
+
+%%----------------------------------------------------------------------
+-spec get_event_streams(Client, Streams, Timeout)
+ -> Result when
+ Client :: client(),
+ Streams :: [stream_name()],
+ Timeout :: timeout(),
+ Result :: {ok,streams()} | {error,error_reason()}.
+%% @doc Send a request to get the given event streams.
+%%
+%% `Streams' is a list of stream names. The following filter will
+%% be sent to the netconf server in a `get' request:
+%%
+%% ```
+%% <netconf xmlns="urn:ietf:params:xml:ns:netmod:notification">
+%% <streams>
+%% <stream>
+%% <name>StreamName1</name>
+%% </stream>
+%% <stream>
+%% <name>StreamName2</name>
+%% </stream>
+%% ...
+%% </streams>
+%% </netconf>
+%% '''
+%%
+%% If `Streams' is an empty list, ALL streams will be requested
+%% by sending the following filter:
+%%
+%% ```
+%% <netconf xmlns="urn:ietf:params:xml:ns:netmod:notification">
+%% <streams/>
+%% </netconf>
+%% '''
+%%
+%% If more complex filtering is needed, a use {@link get/2} or {@link
+%% get/3} and specify the exact filter according to XML Schema for
+%% Event Notifications found in RFC5277.
+%%
+%% @end
+%%----------------------------------------------------------------------
+get_event_streams(Client,Streams,Timeout) ->
+ call(Client,{get_event_streams,Streams,Timeout}).
+
+
+%%----------------------------------------------------------------------
+%% @spec close_session(Client) -> Result
+%% @equiv close_session(Client, infinity)
+close_session(Client) ->
+ close_session(Client, ?DEFAULT_TIMEOUT).
+
+%%----------------------------------------------------------------------
+-spec close_session(Client, Timeout) -> Result when
+ Client :: client(),
+ Timeout :: timeout(),
+ Result :: ok | {error,error_reason()}.
+%% @doc Request graceful termination of the session associated with the client.
+%%
+%% When a netconf server receives a `close-session' request, it
+%% will gracefully close the session. The server will release any
+%% locks and resources associated with the session and gracefully
+%% close any associated connections. Any NETCONF requests received
+%% after a `close-session' request will be ignored.
+%%
+%% @end
+%%----------------------------------------------------------------------
+close_session(Client, Timeout) ->
+ call(Client,{send_rpc_op, close_session, [], Timeout}).
+
+
+%%----------------------------------------------------------------------
+%% @spec kill_session(Client, SessionId) -> Result
+%% @equiv kill_session(Client, SessionId, infinity)
+kill_session(Client, SessionId) ->
+ kill_session(Client, SessionId, ?DEFAULT_TIMEOUT).
+
+%%----------------------------------------------------------------------
+-spec kill_session(Client, SessionId, Timeout) -> Result when
+ Client :: client(),
+ SessionId :: pos_integer(),
+ Timeout :: timeout(),
+ Result :: ok | {error,error_reason()}.
+%% @doc Force termination of the session associated with the supplied
+%% session id.
+%%
+%% The server side shall abort any operations currently in process,
+%% release any locks and resources associated with the session, and
+%% close any associated connections.
+%%
+%% Only if the server is in the confirmed commit phase, the
+%% configuration will be restored to its state before entering the
+%% confirmed commit phase. Otherwise, no configuration roll back will
+%% be performed.
+%%
+%% If the given `SessionId' is equal to the current session id,
+%% an error will be returned.
+%%
+%% @end
+%% ----------------------------------------------------------------------
+kill_session(Client, SessionId, Timeout) ->
+ call(Client,{send_rpc_op, kill_session, [SessionId], Timeout}).
+
+
+%%----------------------------------------------------------------------
+%% Callback functions
+%%----------------------------------------------------------------------
+
+%% @private
+init(_KeyOrName,{_Host,_Port},Options) ->
+ case ssh_open(Options) of
+ {ok, Connection} ->
+ log(Connection,open),
+ {ConnPid,_} = Connection#connection.reference,
+ {ok, ConnPid, #state{connection = Connection}};
+ {error,Reason}->
+ {error,Reason}
+ end.
+
+%% @private
+terminate(_, #state{connection=Connection}) ->
+ ssh_close(Connection),
+ log(Connection,close),
+ ok.
+
+%% @private
+handle_msg({hello,Timeout}, From,
+ #state{connection=Connection,hello_status=HelloStatus} = State) ->
+ case do_send(Connection, client_hello()) of
+ ok ->
+ case HelloStatus of
+ undefined ->
+ {Ref,TRef} = set_request_timer(Timeout),
+ {noreply, State#state{hello_status=#pending{tref=TRef,
+ ref=Ref,
+ caller=From}}};
+ received ->
+ {reply, ok, State#state{hello_status=done}};
+ {error,Reason} ->
+ {stop, {error,Reason}, State}
+ end;
+ Error ->
+ {stop, Error, State}
+ end;
+handle_msg(_, _From, #state{session_id=undefined} = State) ->
+ %% Hello is not yet excanged - this shall never happen
+ {reply,{error,waiting_for_hello},State};
+handle_msg(get_capabilities, _From, #state{capabilities = Caps} = State) ->
+ {reply, Caps, State};
+handle_msg(get_session_id, _From, #state{session_id = Id} = State) ->
+ {reply, Id, State};
+handle_msg({send, Timeout, SimpleXml}, From,
+ #state{connection=Connection,pending=Pending} = State) ->
+ case do_send(Connection, SimpleXml) of
+ ok ->
+ {Ref,TRef} = set_request_timer(Timeout),
+ {noreply, State#state{pending=[#pending{tref=TRef,
+ ref=Ref,
+ caller=From} | Pending]}};
+ Error ->
+ {reply, Error, State}
+ end;
+handle_msg({send_rpc, SimpleXml, Timeout}, From, State) ->
+ do_send_rpc(undefined, SimpleXml, Timeout, From, State);
+handle_msg({send_rpc_op, Op, Data, Timeout}, From, State) ->
+ SimpleXml = encode_rpc_operation(Op,Data),
+ do_send_rpc(Op, SimpleXml, Timeout, From, State);
+handle_msg({get_event_streams=Op,Streams,Timeout}, From, State) ->
+ Filter = {netconf,?NETMOD_NOTIF_NAMESPACE_ATTR,
+ [{streams,[{stream,[{name,[Name]}]} || Name <- Streams]}]},
+ SimpleXml = encode_rpc_operation(get,[Filter]),
+ do_send_rpc(Op, SimpleXml, Timeout, From, State).
+
+handle_msg({ssh_cm, _CM, {data, _Ch, _Type, Data}}, State) ->
+ handle_data(Data, State);
+handle_msg({ssh_cm, _CM, _SshCloseMsg}, State) ->
+ %% _SshCloseMsg can probably be one of
+ %% {eof,Ch}
+ %% {exit_status,Ch,Status}
+ %% {exit_signal,Ch,ExitSignal,ErrorMsg,LanguageString}
+ %% {signal,Ch,Signal}
+
+ %% This might e.g. happen if the server terminates the connection,
+ %% as in kill-session (or if ssh:close is called from somewhere
+ %% unexpected).
+
+ %%! Log this??
+ %%! Currently the log will say that the client closed the
+ %%! connection - due to terminate/2
+
+ {stop, State};
+handle_msg({Ref,timeout},
+ #state{hello_status=#pending{ref=Ref,caller=Caller}} = State) ->
+ ct_gen_conn:return(Caller,{error,{hello_session_failed,timeout}}),
+ {stop,State#state{hello_status={error,timeout}}};
+handle_msg({Ref,timeout},#state{pending=Pending} = State) ->
+ {value,#pending{caller=Caller},Pending1} =
+ lists:keytake(Ref,#pending.ref,Pending),
+ ct_gen_conn:return(Caller,{error,timeout}),
+ {noreply,State#state{pending=Pending1}}.
+
+%% @private
+%% Called by ct_util_server to close registered connections before terminate.
+close(Client) ->
+ case get_handle(Client) of
+ {ok,Pid} ->
+ case ct_gen_conn:stop(Pid) of
+ {error,{process_down,Pid,noproc}} ->
+ {error,already_closed};
+ Result ->
+ Result
+ end;
+ Error ->
+ Error
+ end.
+
+
+%%----------------------------------------------------------------------
+%% Internal functions
+%%----------------------------------------------------------------------
+call(Client, Msg) ->
+ call(Client, Msg, infinity).
+call(Client, Msg, Timeout) ->
+ case get_handle(Client) of
+ {ok,Pid} ->
+ case ct_gen_conn:call(Pid,Msg,Timeout) of
+ {error,{process_down,Client,noproc}} ->
+ {error,no_such_client};
+ {error,{process_down,Client,normal}} ->
+ {error,closed};
+ {error,{process_down,Client,Reason}} ->
+ {error,{closed,Reason}};
+ Other ->
+ Other
+ end;
+ Error ->
+ Error
+ end.
+
+get_handle(Client) when is_pid(Client) ->
+ {ok,Client};
+get_handle(Client) ->
+ case ct_util:get_connections(Client, ?MODULE) of
+ {ok,[{Pid,_}]} ->
+ {ok,Pid};
+ {ok,[]} ->
+ {error,{no_connection_found,Client}};
+ {ok,Conns} ->
+ {error,{multiple_connections_found,Client,Conns}};
+ Error ->
+ Error
+ end.
+
+check_options([], undefined, _Port, _Options) ->
+ {error, no_host_address};
+check_options([], _Host, undefined, _Options) ->
+ {error, no_port};
+check_options([], Host, Port, Options) ->
+ {Host,Port,Options};
+check_options([{ssh, Host}|T], _, Port, #options{} = Options) ->
+ check_options(T, Host, Port, Options#options{host=Host});
+check_options([{port,Port}|T], Host, _, #options{} = Options) ->
+ check_options(T, Host, Port, Options#options{port=Port});
+check_options([{timeout, Timeout}|T], Host, Port, Options)
+ when is_integer(Timeout); Timeout==infinity ->
+ check_options(T, Host, Port, Options#options{timeout = Timeout});
+check_options([{X,_}=Opt|T], Host, Port, #options{ssh=SshOpts}=Options) ->
+ case lists:member(X,?VALID_SSH_OPTS) of
+ true ->
+ check_options(T, Host, Port, Options#options{ssh=[Opt|SshOpts]});
+ false ->
+ {error, {invalid_option, Opt}}
+ end.
+
+%%%-----------------------------------------------------------------
+set_request_timer(infinity) ->
+ {undefined,undefined};
+set_request_timer(T) ->
+ Ref = make_ref(),
+ {ok,TRef} = timer:send_after(T,{Ref,timeout}),
+ {Ref,TRef}.
+
+
+%%%-----------------------------------------------------------------
+client_hello() ->
+ {hello, ?NETCONF_NAMESPACE_ATTR,
+ [{capabilities,
+ [{capability,[?NETCONF_BASE_CAP++?NETCONF_BASE_CAP_VSN]}]}]}.
+
+%%%-----------------------------------------------------------------
+
+encode_rpc_operation(Lock,[Target]) when Lock==lock; Lock==unlock ->
+ {Lock,[{target,[Target]}]};
+encode_rpc_operation(get,[Filter]) ->
+ {get,filter(Filter)};
+encode_rpc_operation(get_config,[Source,Filter]) ->
+ {'get-config',[{source,[Source]}] ++ filter(Filter)};
+encode_rpc_operation(edit_config,[Target,Config]) ->
+ {'edit-config',[{target,[Target]},{config,[Config]}]};
+encode_rpc_operation(delete_config,[Target]) ->
+ {'delete-config',[{target,[Target]}]};
+encode_rpc_operation(copy_config,[Target,Source]) ->
+ {'copy-config',[{target,[Target]},{source,[Source]}]};
+encode_rpc_operation(action,[Action]) ->
+ {action,?ACTION_NAMESPACE_ATTR,[{data,[Action]}]};
+encode_rpc_operation(kill_session,[SessionId]) ->
+ {'kill-session',[{'session-id',[integer_to_list(SessionId)]}]};
+encode_rpc_operation(close_session,[]) ->
+ 'close-session';
+encode_rpc_operation({create_subscription,_},
+ [Stream,Filter,StartTime,StopTime]) ->
+ {'create-subscription',?NETCONF_NOTIF_NAMESPACE_ATTR,
+ [{stream,[Stream]}] ++
+ filter(Filter) ++
+ maybe_element(startTime,StartTime) ++
+ maybe_element(stopTime,StopTime)}.
+
+filter(undefined) ->
+ [];
+filter({xpath,Filter}) when ?is_string(Filter) ->
+ [{filter,[{type,"xpath"},{select, Filter}],[]}];
+filter(Filter) ->
+ [{filter,[{type,"subtree"}],[Filter]}].
+
+maybe_element(_,undefined) ->
+ [];
+maybe_element(Tag,Value) ->
+ [{Tag,[Value]}].
+
+%%%-----------------------------------------------------------------
+%%% Send XML data to server
+do_send_rpc(PendingOp,SimpleXml,Timeout,Caller,
+ #state{connection=Connection,msg_id=MsgId,pending=Pending} = State) ->
+ case do_send_rpc(Connection, MsgId, SimpleXml) of
+ ok ->
+ {Ref,TRef} = set_request_timer(Timeout),
+ {noreply, State#state{msg_id=MsgId+1,
+ pending=[#pending{tref=TRef,
+ ref=Ref,
+ msg_id=MsgId,
+ op=PendingOp,
+ caller=Caller} | Pending]}};
+ Error ->
+ {reply, Error, State#state{msg_id=MsgId+1}}
+ end.
+
+do_send_rpc(Connection, MsgId, SimpleXml) ->
+ do_send(Connection,
+ {rpc,
+ [{'message-id',MsgId} | ?NETCONF_NAMESPACE_ATTR],
+ [SimpleXml]}).
+
+do_send(Connection, SimpleXml) ->
+ Xml=to_xml_doc(SimpleXml),
+ log(Connection,send,Xml),
+ ssh_send(Connection, Xml).
+
+to_xml_doc(Simple) ->
+ Prolog = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
+ Xml = list_to_binary(xmerl:export_simple([Simple],
+ xmerl_xml,
+ [#xmlAttribute{name=prolog,
+ value=Prolog}])),
+ <<Xml/binary,?END_TAG/binary>>.
+
+%%%-----------------------------------------------------------------
+%%% Parse and handle received XML data
+handle_data(NewData,#state{connection=Connection,buff=Buff} = State) ->
+ log(Connection,recv,NewData),
+ Data = <<Buff/binary,NewData/binary>>,
+ case xmerl_sax_parser:stream(<<>>,
+ [{continuation_fun,fun sax_cont/1},
+ {continuation_state,{Data,Connection,false}},
+ {event_fun,fun sax_event/3},
+ {event_state,[]}]) of
+ {ok, Simple, Rest} ->
+ decode(Simple,State#state{buff=Rest});
+ {fatal_error,_Loc,Reason,_EndTags,_EventState} ->
+ ?error(Connection#connection.name,[{parse_error,Reason},
+ {data,Data}]),
+ case Reason of
+ {could_not_fetch_data,Msg} ->
+ handle_msg(Msg,State#state{buff = <<>>});
+ _Other ->
+ Pending1 =
+ case State#state.pending of
+ [] ->
+ [];
+ Pending ->
+ %% Assuming the first request gets the
+ %% first answer
+ P=#pending{tref=TRef,caller=Caller} =
+ lists:last(Pending),
+ timer:cancel(TRef),
+ Reason1 = {failed_to_parse_received_data,Reason},
+ ct_gen_conn:return(Caller,{error,Reason1}),
+ lists:delete(P,Pending)
+ end,
+ {noreply,State#state{pending=Pending1,buff = <<>>}}
+ end
+ end.
+
+%%%-----------------------------------------------------------------
+%%% Parsing of XML data
+%% Contiuation function for the sax parser
+sax_cont(done) ->
+ {<<>>,done};
+sax_cont({Data,Connection,false}) ->
+ case binary:split(Data,[?END_TAG],[]) of
+ [All] ->
+ %% No end tag found. Remove what could be a part
+ %% of an end tag from the data and save for next
+ %% iteration
+ SafeSize = size(All)-5,
+ <<New:SafeSize/binary,Save:5/binary>> = All,
+ {New,{Save,Connection,true}};
+ [_Msg,_Rest]=Msgs ->
+ %% We have at least one full message. Any excess data will
+ %% be returned from xmerl_sax_parser:stream/2 in the Rest
+ %% parameter.
+ {list_to_binary(Msgs),done}
+ end;
+sax_cont({Data,Connection,true}) ->
+ case ssh_receive_data() of
+ {ok,Bin} ->
+ log(Connection,recv,Bin),
+ sax_cont({<<Data/binary,Bin/binary>>,Connection,false});
+ {error,Reason} ->
+ throw({could_not_fetch_data,Reason})
+ end.
+
+
+
+%% Event function for the sax parser. It builds a simple XML structure.
+%% Care is taken to keep namespace attributes and prefixes as in the original XML.
+sax_event(Event,_Loc,State) ->
+ sax_event(Event,State).
+
+sax_event({startPrefixMapping, Prefix, Uri},Acc) ->
+ %% startPrefixMapping will always come immediately before the
+ %% startElement where the namespace is defined.
+ [{xmlns,{Prefix,Uri}}|Acc];
+sax_event({startElement,_Uri,_Name,QN,Attrs},Acc) ->
+ %% Pick out any namespace attributes inserted due to a
+ %% startPrefixMapping event.The rest of Acc will then be only
+ %% elements.
+ {NsAttrs,NewAcc} = split_attrs_and_elements(Acc,[]),
+ Tag = qn_to_tag(QN),
+ [{Tag,NsAttrs ++ parse_attrs(Attrs),[]}|NewAcc];
+sax_event({endElement,_Uri,_Name,_QN},[{Name,Attrs,Cont},{Parent,PA,PC}|Acc]) ->
+ [{Parent,PA,[{Name,Attrs,lists:reverse(Cont)}|PC]}|Acc];
+sax_event(endDocument,[{Tag,Attrs,Cont}]) ->
+ {Tag,Attrs,lists:reverse(Cont)};
+sax_event({characters,String},[{Name,Attrs,Cont}|Acc]) ->
+ [{Name,Attrs,[String|Cont]}|Acc];
+sax_event(_Event,State) ->
+ State.
+
+split_attrs_and_elements([{xmlns,{Prefix,Uri}}|Rest],Attrs) ->
+ split_attrs_and_elements(Rest,[{xmlnstag(Prefix),Uri}|Attrs]);
+split_attrs_and_elements(Elements,Attrs) ->
+ {Attrs,Elements}.
+
+xmlnstag([]) ->
+ xmlns;
+xmlnstag(Prefix) ->
+ list_to_atom("xmlns:"++Prefix).
+
+qn_to_tag({[],Name}) ->
+ list_to_atom(Name);
+qn_to_tag({Prefix,Name}) ->
+ list_to_atom(Prefix ++ ":" ++ Name).
+
+parse_attrs([{_Uri, [], Name, Value}|Attrs]) ->
+ [{list_to_atom(Name),Value}|parse_attrs(Attrs)];
+parse_attrs([{_Uri, Prefix, Name, Value}|Attrs]) ->
+ [{list_to_atom(Prefix ++ ":" ++ Name),Value}|parse_attrs(Attrs)];
+parse_attrs([]) ->
+ [].
+
+
+%%%-----------------------------------------------------------------
+%%% Decoding of parsed XML data
+decode({Tag,Attrs,_}=E, #state{connection=Connection,pending=Pending}=State) ->
+ ConnName = Connection#connection.name,
+ case get_local_name_atom(Tag) of
+ 'rpc-reply' ->
+ case get_msg_id(Attrs) of
+ undefined ->
+ case Pending of
+ [#pending{msg_id=MsgId}] ->
+ ?error(ConnName,[{warning,rpc_reply_missing_msg_id},
+ {assuming,MsgId}]),
+ decode_rpc_reply(MsgId,E,State);
+ _ ->
+ ?error(ConnName,[{error,rpc_reply_missing_msg_id}]),
+ {noreply,State}
+ end;
+ MsgId ->
+ decode_rpc_reply(MsgId,E,State)
+ end;
+ hello ->
+ case State#state.hello_status of
+ undefined ->
+ case decode_hello(E) of
+ {ok,SessionId,Capabilities} ->
+ {noreply,State#state{session_id = SessionId,
+ capabilities = Capabilities,
+ hello_status = received}};
+ {error,Reason} ->
+ {noreply,State#state{hello_status = {error,Reason}}}
+ end;
+ #pending{tref=TRef,caller=Caller} ->
+ timer:cancel(TRef),
+ case decode_hello(E) of
+ {ok,SessionId,Capabilities} ->
+ ct_gen_conn:return(Caller,ok),
+ {noreply,State#state{session_id = SessionId,
+ capabilities = Capabilities,
+ hello_status = done}};
+ {error,Reason} ->
+ ct_gen_conn:return(Caller,{error,Reason}),
+ {stop,State#state{hello_status={error,Reason}}}
+ end;
+ Other ->
+ ?error(ConnName,[{got_unexpected_hello,E},
+ {hello_status,Other}]),
+ {noreply,State}
+ end;
+ notification ->
+ EventReceiver = State#state.event_receiver,
+ EventReceiver ! E,
+ {noreply,State};
+ Other ->
+ %% Result of send/2, when not sending an rpc request - or
+ %% if netconf server sends noise. Can handle this only if
+ %% there is just one pending that matches (i.e. has
+ %% undefined msg_id and op)
+ case [P || P = #pending{msg_id=undefined,op=undefined} <- Pending] of
+ [#pending{tref=TRef,
+ caller=Caller}] ->
+ timer:cancel(TRef),
+ ct_gen_conn:return(Caller,E),
+ {noreply,State#state{pending=[]}};
+ _ ->
+ ?error(ConnName,[{got_unexpected_msg,Other},
+ {expecting,Pending}]),
+ {noreply,State}
+ end
+
+ end.
+
+get_msg_id(Attrs) ->
+ case lists:keyfind('message-id',1,Attrs) of
+ {_,Str} ->
+ list_to_integer(Str);
+ false ->
+ undefined
+ end.
+
+decode_rpc_reply(MsgId,{_,Attrs,Content0}=E,#state{pending=Pending} = State) ->
+ case lists:keytake(MsgId,#pending.msg_id,Pending) of
+ {value, #pending{tref=TRef,op=Op,caller=Caller}, Pending1} ->
+ timer:cancel(TRef),
+ Content = forward_xmlns_attr(Attrs,Content0),
+ {CallerReply,{ServerReply,State2}} =
+ do_decode_rpc_reply(Op,Content,State#state{pending=Pending1}),
+ ct_gen_conn:return(Caller,CallerReply),
+ {ServerReply,State2};
+ false ->
+ %% Result of send/2, when receiving a correct
+ %% rpc-reply. Can handle this only if there is just one
+ %% pending that matches (i.e. has undefined msg_id and op)
+ case [P || P = #pending{msg_id=undefined,op=undefined} <- Pending] of
+ [#pending{tref=TRef,
+ msg_id=undefined,
+ op=undefined,
+ caller=Caller}] ->
+ timer:cancel(TRef),
+ ct_gen_conn:return(Caller,E),
+ {noreply,State#state{pending=[]}};
+ _ ->
+ ConnName = (State#state.connection)#connection.name,
+ ?error(ConnName,[{got_unexpected_msg_id,MsgId},
+ {expecting,Pending}]),
+ {noreply,State}
+ end
+ end.
+
+do_decode_rpc_reply(Op,Result,State)
+ when Op==lock; Op==unlock; Op==edit_config; Op==delete_config;
+ Op==copy_config; Op==kill_session ->
+ {decode_ok(Result),{noreply,State}};
+do_decode_rpc_reply(Op,Result,State)
+ when Op==get; Op==get_config; Op==action ->
+ {decode_data(Result),{noreply,State}};
+do_decode_rpc_reply(close_session,Result,State) ->
+ case decode_ok(Result) of
+ ok -> {ok,{stop,State}};
+ Other -> {Other,{noreply,State}}
+ end;
+do_decode_rpc_reply({create_subscription,Caller},Result,State) ->
+ case decode_ok(Result) of
+ ok ->
+ {ok,{noreply,State#state{event_receiver=Caller}}};
+ Other ->
+ {Other,{noreply,State}}
+ end;
+do_decode_rpc_reply(get_event_streams,Result,State) ->
+ {decode_streams(decode_data(Result)),{noreply,State}};
+do_decode_rpc_reply(undefined,Result,State) ->
+ {Result,{noreply,State}}.
+
+
+
+decode_ok([{Tag,Attrs,Content}]) ->
+ case get_local_name_atom(Tag) of
+ ok ->
+ ok;
+ 'rpc-error' ->
+ {error,forward_xmlns_attr(Attrs,Content)};
+ _Other ->
+ {error,{unexpected_rpc_reply,[{Tag,Attrs,Content}]}}
+ end;
+decode_ok(Other) ->
+ {error,{unexpected_rpc_reply,Other}}.
+
+decode_data([{Tag,Attrs,Content}]) ->
+ case get_local_name_atom(Tag) of
+ data ->
+ %% Since content of data has nothing from the netconf
+ %% namespace, we remove the parent's xmlns attribute here
+ %% - just to make the result cleaner
+ {ok,forward_xmlns_attr(remove_xmlnsattr_for_tag(Tag,Attrs),Content)};
+ 'rpc-error' ->
+ {error,forward_xmlns_attr(Attrs,Content)};
+ _Other ->
+ {error,{unexpected_rpc_reply,[{Tag,Attrs,Content}]}}
+ end;
+decode_data(Other) ->
+ {error,{unexpected_rpc_reply,Other}}.
+
+get_qualified_name(Tag) ->
+ case string:tokens(atom_to_list(Tag),":") of
+ [TagStr] -> {[],TagStr};
+ [PrefixStr,TagStr] -> {PrefixStr,TagStr}
+ end.
+
+get_local_name_atom(Tag) ->
+ {_,TagStr} = get_qualified_name(Tag),
+ list_to_atom(TagStr).
+
+
+%% Remove the xmlns attr that points to the tag. I.e. if the tag has a
+%% prefix, remove {'xmlns:prefix',_}, else remove default {xmlns,_}.
+remove_xmlnsattr_for_tag(Tag,Attrs) ->
+ {Prefix,_TagStr} = get_qualified_name(Tag),
+ XmlnsTag = xmlnstag(Prefix),
+ case lists:keytake(XmlnsTag,1,Attrs) of
+ {value,_,NoNsAttrs} ->
+ NoNsAttrs;
+ false ->
+ Attrs
+ end.
+
+%% Take all xmlns attributes from the parent's attribute list and
+%% forward into all childrens' attribute lists. But do not overwrite
+%% any.
+forward_xmlns_attr(ParentAttrs,Children) ->
+ do_forward_xmlns_attr(get_all_xmlns_attrs(ParentAttrs,[]),Children).
+
+do_forward_xmlns_attr(XmlnsAttrs,[{ChT,ChA,ChC}|Children]) ->
+ ChA1 = add_xmlns_attrs(XmlnsAttrs,ChA),
+ [{ChT,ChA1,ChC} | do_forward_xmlns_attr(XmlnsAttrs,Children)];
+do_forward_xmlns_attr(_XmlnsAttrs,[]) ->
+ [].
+
+add_xmlns_attrs([{Key,_}=A|XmlnsAttrs],ChA) ->
+ case lists:keymember(Key,1,ChA) of
+ true ->
+ add_xmlns_attrs(XmlnsAttrs,ChA);
+ false ->
+ add_xmlns_attrs(XmlnsAttrs,[A|ChA])
+ end;
+add_xmlns_attrs([],ChA) ->
+ ChA.
+
+get_all_xmlns_attrs([{xmlns,_}=Default|Attrs],XmlnsAttrs) ->
+ get_all_xmlns_attrs(Attrs,[Default|XmlnsAttrs]);
+get_all_xmlns_attrs([{Key,_}=Attr|Attrs],XmlnsAttrs) ->
+ case atom_to_list(Key) of
+ "xmlns:"++_Prefix ->
+ get_all_xmlns_attrs(Attrs,[Attr|XmlnsAttrs]);
+ _ ->
+ get_all_xmlns_attrs(Attrs,XmlnsAttrs)
+ end;
+get_all_xmlns_attrs([],XmlnsAttrs) ->
+ XmlnsAttrs.
+
+
+%% Decode server hello to pick out session id and capabilities
+decode_hello({hello,_Attrs,Hello}) ->
+ case lists:keyfind('session-id',1,Hello) of
+ {'session-id',_,[SessionId]} ->
+ case lists:keyfind(capabilities,1,Hello) of
+ {capabilities,_,Capabilities} ->
+ case decode_caps(Capabilities,[],false) of
+ {ok,Caps} ->
+ {ok,list_to_integer(SessionId),Caps};
+ Error ->
+ Error
+ end;
+ false ->
+ {error,{incorrect_hello,capabilities_not_found}}
+ end;
+ false ->
+ {error,{incorrect_hello,no_session_id_found}}
+ end.
+
+decode_caps([{capability,[],[?NETCONF_BASE_CAP++Vsn=Cap]} |Caps], Acc, _) ->
+ case Vsn of
+ ?NETCONF_BASE_CAP_VSN ->
+ decode_caps(Caps, [Cap|Acc], true);
+ _ ->
+ {error,{incompatible_base_capability_vsn,Vsn}}
+ end;
+decode_caps([{capability,[],[Cap]}|Caps],Acc,Base) ->
+ decode_caps(Caps,[Cap|Acc],Base);
+decode_caps([H|_T],_,_) ->
+ {error,{unexpected_capability_element,H}};
+decode_caps([],_,false) ->
+ {error,{incorrect_hello,no_base_capability_found}};
+decode_caps([],Acc,true) ->
+ {ok,lists:reverse(Acc)}.
+
+
+%% Return a list of {Name,Data}, where data is a {Tag,Value} list for each stream
+decode_streams({error,Reason}) ->
+ {error,Reason};
+decode_streams({ok,[{netconf,_,Streams}]}) ->
+ {ok,decode_streams(Streams)};
+decode_streams([{streams,_,Streams}]) ->
+ decode_streams(Streams);
+decode_streams([{stream,_,Stream} | Streams]) ->
+ {name,_,[Name]} = lists:keyfind(name,1,Stream),
+ [{Name,[{Tag,Value} || {Tag,_,[Value]} <- Stream, Tag /= name]}
+ | decode_streams(Streams)];
+decode_streams([]) ->
+ [].
+
+
+%%%-----------------------------------------------------------------
+%%% Logging
+
+log(Connection,Action) ->
+ log(Connection,Action,<<>>).
+log(#connection{host=Host,port=Port,name=Name},Action,Data) ->
+ error_logger:info_report(#conn_log{client=self(),
+ address={Host,Port},
+ name=Name,
+ action=Action,
+ module=?MODULE},
+ Data).
+
+
+%% Log callback - called from the error handler process
+format_data(raw,Data) ->
+ io_lib:format("~n~s~n",[hide_password(Data)]);
+format_data(pretty,Data) ->
+ io_lib:format("~n~s~n",[indent(Data)]);
+format_data(html,Data) ->
+ io_lib:format("~n~s~n",[html_format(Data)]).
+
+%%%-----------------------------------------------------------------
+%%% Hide password elements from XML data
+hide_password(Bin) ->
+ re:replace(Bin,<<"(<password[^>]*>)[^<]*(</password>)">>,<<"\\1*****\\2">>,
+ [global,{return,binary}]).
+
+%%%-----------------------------------------------------------------
+%%% HTML formatting
+html_format(Bin) ->
+ binary:replace(indent(Bin),<<"<">>,<<"&lt;">>,[global]).
+
+%%%-----------------------------------------------------------------
+%%% Indentation of XML code
+indent(Bin) ->
+ String = normalize(hide_password(Bin)),
+ IndentedString =
+ case erase(part_of_line) of
+ undefined ->
+ indent1(String,[]);
+ Part ->
+ indent1(lists:reverse(Part)++String,erase(indent))
+ end,
+ list_to_binary(IndentedString).
+
+%% Normalizes the XML document by removing all space and newline
+%% between two XML tags.
+%% Returns a list, no matter if the input was a list or a binary.
+normalize(Str) ->
+ re:replace(Str,<<">[ \r\n\t]+<">>,<<"><">>,[global,{return,list}]).
+
+
+indent1("<?"++Rest1,Indent1) ->
+ %% Prolog
+ {Line,Rest2,Indent2} = indent_line(Rest1,Indent1,[$?,$<]),
+ Line++indent1(Rest2,Indent2);
+indent1("</"++Rest1,Indent1) ->
+ %% Stop tag
+ {Line,Rest2,Indent2} = indent_line1(Rest1,Indent1,[$/,$<]),
+ "\n"++Line++indent1(Rest2,Indent2);
+indent1("<"++Rest1,Indent1) ->
+ %% Start- or empty tag
+ put(tag,get_tag(Rest1)),
+ {Line,Rest2,Indent2} = indent_line(Rest1,Indent1,[$<]),
+ "\n"++Line++indent1(Rest2,Indent2);
+indent1([H|T],Indent) ->
+ [H|indent1(T,Indent)];
+indent1([],_Indent) ->
+ [].
+
+indent_line("?>"++Rest,Indent,Line) ->
+ %% Prolog
+ {lists:reverse(Line)++"?>",Rest,Indent};
+indent_line("/></"++Rest,Indent,Line) ->
+ %% Empty tag, and stop of parent tag -> one step out in indentation
+ {Indent++lists:reverse(Line)++"/>","</"++Rest,Indent--" "};
+indent_line("/>"++Rest,Indent,Line) ->
+ %% Empty tag, then probably next tag -> keep indentation
+ {Indent++lists:reverse(Line)++"/>",Rest,Indent};
+indent_line("></"++Rest,Indent,Line) ->
+ LastTag = erase(tag),
+ case get_tag(Rest) of
+ LastTag ->
+ %% Start and stop tag, but no content
+ indent_line1(Rest,Indent,[$/,$<,$>|Line]);
+ _ ->
+ %% Stop tag completed, and then stop tag of parent -> one step out
+ {Indent++lists:reverse(Line)++">","</"++Rest,Indent--" "}
+ end;
+indent_line("><"++Rest,Indent,Line) ->
+ %% Stop tag completed, and new tag comming -> keep indentation
+ {Indent++lists:reverse(Line)++">","<"++Rest," "++Indent};
+indent_line("</"++Rest,Indent,Line) ->
+ %% Stop tag starting -> search for end of this tag
+ indent_line1(Rest,Indent,[$/,$<|Line]);
+indent_line([H|T],Indent,Line) ->
+ indent_line(T,Indent,[H|Line]);
+indent_line([],Indent,Line) ->
+ %% The line is not complete - will be continued later
+ put(part_of_line,Line),
+ put(indent,Indent),
+ {[],[],Indent}.
+
+indent_line1("></"++Rest,Indent,Line) ->
+ %% Stop tag completed, and then stop tag of parent -> one step out
+ {Indent++lists:reverse(Line)++">","</"++Rest,Indent--" "};
+indent_line1(">"++Rest,Indent,Line) ->
+ %% Stop tag completed -> keep indentation
+ {Indent++lists:reverse(Line)++">",Rest,Indent};
+indent_line1([H|T],Indent,Line) ->
+ indent_line1(T,Indent,[H|Line]);
+indent_line1([],Indent,Line) ->
+ %% The line is not complete - will be continued later
+ put(part_of_line,Line),
+ put(indent,Indent),
+ {[],[],Indent}.
+
+get_tag("/>"++_) ->
+ [];
+get_tag(">"++_) ->
+ [];
+get_tag([H|T]) ->
+ [H|get_tag(T)];
+get_tag([]) ->
+ %% The line is not complete - will be continued later.
+ [].
+
+
+%%%-----------------------------------------------------------------
+%%% SSH stuff
+ssh_receive_data() ->
+ receive
+ {ssh_cm, _CM, {data, _Ch, _Type, Data}} ->
+ {ok, Data};
+ {ssh_cm, _CM, {Closed, _Ch}} = X when Closed == closed; Closed == eof ->
+ {error,X};
+ {_Ref,timeout} = X ->
+ {error,X}
+ end.
+
+ssh_open(#options{host=Host,timeout=Timeout,port=Port,ssh=SshOpts,name=Name}) ->
+ case ssh:connect(Host, Port,
+ [{user_interaction,false},
+ {silently_accept_hosts, true}|SshOpts]) of
+ {ok,CM} ->
+ case ssh_connection:session_channel(CM, Timeout) of
+ {ok,Ch} ->
+ case ssh_connection:subsystem(CM, Ch, "netconf", Timeout) of
+ success ->
+ {ok, #connection{reference = {CM,Ch},
+ host = Host,
+ port = Port,
+ name = Name}};
+ failure ->
+ ssh:close(CM),
+ {error,{ssh,could_not_execute_netconf_subsystem}}
+ end;
+ {error, Reason} ->
+ ssh:close(CM),
+ {error,{ssh,could_not_open_channel,Reason}};
+ Other ->
+ %% Bug in ssh?? got {closed,0} here once...
+ {error,{ssh,unexpected_from_session_channel,Other}}
+ end;
+ {error,Reason} ->
+ {error,{ssh,could_not_connect_to_server,Reason}}
+ end.
+
+ssh_send(#connection{reference = {CM,Ch}}, Data) ->
+ case ssh_connection:send(CM, Ch, Data) of
+ ok -> ok;
+ {error,Reason} -> {error,{ssh,failed_to_send_data,Reason}}
+ end.
+
+ssh_close(#connection{reference = {CM,_Ch}}) ->
+ ssh:close(CM).
+
+
+%%----------------------------------------------------------------------
+%% END OF MODULE
+%%----------------------------------------------------------------------
diff --git a/lib/common_test/src/ct_netconfc.hrl b/lib/common_test/src/ct_netconfc.hrl
new file mode 100644
index 0000000000..295a61a98b
--- /dev/null
+++ b/lib/common_test/src/ct_netconfc.hrl
@@ -0,0 +1,58 @@
+%%--------------------------------------------------------------------
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+%%----------------------------------------------------------------------
+%% File: ct_netconfc.hrl
+%%
+%% Description:
+%% This file defines constant values and records used by the
+%% netconf client ct_netconfc.
+%%
+%% @author Support
+%% @doc Netconf Client Interface.
+%% @end
+%%----------------------------------------------------------------------
+%%----------------------------------------------------------------------
+
+
+%% Default port number (RFC 4742/IANA).
+-define(DEFAULT_PORT, 830).
+
+%% Default timeout to wait for netconf server to reply to a request
+-define(DEFAULT_TIMEOUT, infinity). %% msec
+
+%% Namespaces
+-define(NETCONF_NAMESPACE_ATTR,[{xmlns,?NETCONF_NAMESPACE}]).
+-define(ACTION_NAMESPACE_ATTR,[{xmlns,?ACTION_NAMESPACE}]).
+-define(NETCONF_NOTIF_NAMESPACE_ATTR,[{xmlns,?NETCONF_NOTIF_NAMESPACE}]).
+-define(NETMOD_NOTIF_NAMESPACE_ATTR,[{xmlns,?NETMOD_NOTIF_NAMESPACE}]).
+
+-define(NETCONF_NAMESPACE,"urn:ietf:params:xml:ns:netconf:base:1.0").
+-define(ACTION_NAMESPACE,"urn:com:ericsson:ecim:1.0").
+-define(NETCONF_NOTIF_NAMESPACE,
+ "urn:ietf:params:xml:ns:netconf:notification:1.0").
+-define(NETMOD_NOTIF_NAMESPACE,"urn:ietf:params:xml:ns:netmod:notification").
+
+%% Capabilities
+-define(NETCONF_BASE_CAP,"urn:ietf:params:netconf:base:").
+-define(NETCONF_BASE_CAP_VSN,"1.0").
+
+%% Misc
+-define(END_TAG,<<"]]>]]>">>).
+
+-define(FORMAT(_F, _A), lists:flatten(io_lib:format(_F, _A))).
diff --git a/lib/common_test/src/ct_repeat.erl b/lib/common_test/src/ct_repeat.erl
index be3c485b75..a47309c6ee 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -41,72 +41,86 @@ loop_test(If,Args) when is_list(Args) ->
case get_loop_info(Args) of
no_loop ->
false;
- {error,E} ->
+ E = {error,_} ->
io:format("Common Test error: ~p\n\n",[E]),
file:set_cwd(Cwd),
E;
{repeat,N} ->
io:format("\nCommon Test: Will repeat tests ~w times.\n\n",[N]),
Args1 = [{loop_info,[{repeat,1,N}]} | Args],
- loop(If,repeat,0,N,undefined,Args1,undefined),
- file:set_cwd(Cwd);
+ Result = loop(If,repeat,0,N,undefined,Args1,undefined,[]),
+ file:set_cwd(Cwd),
+ Result;
{stop_time,StopTime} ->
- case remaining_time(StopTime) of
- 0 ->
- io:format("\nCommon Test: No time left to run tests.\n\n",[]),
- ok;
- Secs ->
- io:format("\nCommon Test: Will repeat tests for ~s.\n\n",
- [ts(Secs)]),
- TPid =
- case lists:keymember(force_stop,1,Args) of
- true ->
- CtrlPid = self(),
- spawn(fun() -> stop_after(CtrlPid,Secs) end);
- false ->
- undefined
- end,
- Args1 = [{loop_info,[{stop_time,Secs,StopTime,1}]} | Args],
- loop(If,stop_time,0,Secs,StopTime,Args1,TPid)
- end,
- file:set_cwd(Cwd)
+ Result =
+ case remaining_time(StopTime) of
+ 0 ->
+ io:format("\nCommon Test: "
+ "No time left to run tests.\n\n",[]),
+ {error,not_enough_time};
+ Secs ->
+ io:format("\nCommon Test: "
+ "Will repeat tests for ~s.\n\n",[ts(Secs)]),
+ TPid =
+ case lists:keymember(force_stop,1,Args) of
+ true ->
+ CtrlPid = self(),
+ spawn(fun() -> stop_after(CtrlPid,Secs) end);
+ false ->
+ undefined
+ end,
+ Args1 = [{loop_info,[{stop_time,Secs,StopTime,1}]} | Args],
+ loop(If,stop_time,0,Secs,StopTime,Args1,TPid,[])
+ end,
+ file:set_cwd(Cwd),
+ Result
end.
-loop(_,repeat,N,N,_,_Args,_) ->
- ok;
+loop(_,repeat,N,N,_,_Args,_,AccResult) ->
+ lists:reverse(AccResult);
-loop(If,Type,N,Data0,Data1,Args,TPid) ->
+loop(If,Type,N,Data0,Data1,Args,TPid,AccResult) ->
Pid = spawn_tester(If,self(),Args),
receive
{'EXIT',Pid,Reason} ->
- io:format("Test run crashed! This could be an internal error "
- "- please report!\n\n"
- "~p\n\n",[Reason]),
- cancel(TPid),
- {error,Reason};
+ case Reason of
+ {user_error,What} ->
+ io:format("\nTest run failed!\nReason: ~p\n\n\n", [What]),
+ cancel(TPid),
+ {error,What};
+ _ ->
+ io:format("Test run crashed! This could be an internal error "
+ "- please report!\n\n"
+ "~p\n\n\n",[Reason]),
+ cancel(TPid),
+ {error,Reason}
+ end;
{Pid,{error,Reason}} ->
- io:format("\nTest run failed!\nReason: ~p\n\n",[Reason]),
+ io:format("\nTest run failed!\nReason: ~p\n\n\n",[Reason]),
cancel(TPid),
{error,Reason};
{Pid,Result} ->
if Type == repeat ->
- io:format("\nTest run ~w(~w) complete.\n\n",[N+1,Data0]),
+ io:format("\nTest run ~w(~w) complete.\n\n\n",[N+1,Data0]),
lists:keydelete(loop_info,1,Args),
Args1 = [{loop_info,[{repeat,N+2,Data0}]} | Args],
- loop(If,repeat,N+1,Data0,Data1,Args1,TPid);
+ loop(If,repeat,N+1,Data0,Data1,Args1,TPid,[Result|AccResult]);
Type == stop_time ->
case remaining_time(Data1) of
0 ->
- io:format("\nTest time (~s) has run out.\n\n",[ts(Data0)]),
+ io:format("\nTest time (~s) has run out.\n\n\n",
+ [ts(Data0)]),
cancel(TPid),
- Result;
+ lists:reverse([Result|AccResult]);
Secs ->
io:format("\n~s of test time remaining, "
- "starting run #~w...\n\n",[ts(Secs),N+2]),
+ "starting run #~w...\n\n\n",
+ [ts(Secs),N+2]),
lists:keydelete(loop_info,1,Args),
ST = {stop_time,Data0,Data1,N+2},
Args1 = [{loop_info,[ST]} | Args],
- loop(If,stop_time,N+1,Data0,Data1,Args1,TPid)
+ loop(If,stop_time,N+1,Data0,Data1,Args1,TPid,
+ [Result|AccResult])
end
end
end.
@@ -116,7 +130,7 @@ spawn_tester(script,Ctrl,Args) ->
spawn_tester(func,Ctrl,Opts) ->
Tester = fun() ->
- case catch ct_run:run_test1(Opts) of
+ case catch ct_run:run_test2(Opts) of
{'EXIT',Reason} ->
exit(Reason);
Result ->
diff --git a/lib/common_test/src/ct_run.erl b/lib/common_test/src/ct_run.erl
index 05b10bca32..4a6a3cdcac 100644
--- a/lib/common_test/src/ct_run.erl
+++ b/lib/common_test/src/ct_run.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -37,14 +37,22 @@
%% Misc internal functions
--export([variables_file_name/1,script_start1/2,run_test1/1]).
+-export([variables_file_name/1,script_start1/2,run_test2/1]).
+-include("ct.hrl").
-include("ct_event.hrl").
-include("ct_util.hrl").
-define(abs(Name), filename:absname(Name)).
-define(testdir(Name, Suite), ct_util:get_testdir(Name, Suite)).
+-define(EXIT_STATUS_TEST_SUCCESSFUL, 0).
+-define(EXIT_STATUS_TEST_CASE_FAILED, 1).
+-define(EXIT_STATUS_TEST_RUN_FAILED, 2).
+
+-define(default_verbosity, [{default,?MAX_VERBOSITY},
+ {'$unspecified',?MAX_VERBOSITY}]).
+
-record(opts, {label,
profile,
vts,
@@ -54,17 +62,22 @@
step,
logdir,
logopts = [],
+ basic_html,
+ verbosity = [],
config = [],
event_handlers = [],
ct_hooks = [],
- enable_builtin_hooks = true,
+ enable_builtin_hooks,
include = [],
- silent_connections,
+ auto_compile,
+ silent_connections = [],
stylesheet,
multiply_timetraps = 1,
scale_timetraps = false,
+ create_priv_dir,
testspecs = [],
- tests}).
+ tests,
+ starter}).
%%%-----------------------------------------------------------------
%%% @spec script_start() -> void()
@@ -101,7 +114,8 @@ script_start() ->
end, Flags)
end,
%% used for purpose of testing the run_test interface
- io:format(user, "~n-------------------- START ARGS --------------------~n", []),
+ io:format(user, "~n-------------------- START ARGS "
+ "--------------------~n", []),
io:format(user, "--- Init args:~n~p~n", [FlagFilter(Init)]),
io:format(user, "--- CT args:~n~p~n", [FlagFilter(CtArgs)]),
EnvArgs = opts2args(EnvStartOpts),
@@ -109,7 +123,8 @@ script_start() ->
[EnvStartOpts,EnvArgs]),
Merged = merge_arguments(CtArgs ++ EnvArgs),
io:format(user, "--- Merged args:~n~p~n", [FlagFilter(Merged)]),
- io:format(user, "----------------------------------------------------~n~n", []),
+ io:format(user, "-----------------------------------"
+ "-----------------~n~n", []),
Merged;
_ ->
merge_arguments(CtArgs)
@@ -121,46 +136,107 @@ script_start() ->
script_start(Args) ->
Tracing = start_trace(Args),
- Res =
- case ct_repeat:loop_test(script, Args) of
- false ->
- {ok,Cwd} = file:get_cwd(),
- CTVsn =
- case filename:basename(code:lib_dir(common_test)) of
- CTBase when is_list(CTBase) ->
- case string:tokens(CTBase, "-") of
- ["common_test",Vsn] -> " v"++Vsn;
- _ -> ""
- end
- end,
- io:format("~nCommon Test~s starting (cwd is ~s)~n~n", [CTVsn,Cwd]),
- Self = self(),
- Pid = spawn_link(fun() -> script_start1(Self, Args) end),
- receive
- {'EXIT',Pid,Reason} ->
- case Reason of
- {user_error,What} ->
- io:format("\nTest run failed!\nReason: ~p\n\n", [What]),
- {error,What};
- _ ->
- io:format("Test run crashed! This could be an internal error "
- "- please report!\n\n"
- "~p\n\n", [Reason]),
- {error,Reason}
- end;
- {Pid,{error,Reason}} ->
- io:format("\nTest run failed! Reason:\n~p\n\n",[Reason]),
- {error,Reason};
- {Pid,Result} ->
- Result
- end;
- Result ->
- Result
- end,
+ case ct_repeat:loop_test(script, Args) of
+ false ->
+ {ok,Cwd} = file:get_cwd(),
+ CTVsn =
+ case filename:basename(code:lib_dir(common_test)) of
+ CTBase when is_list(CTBase) ->
+ case string:tokens(CTBase, "-") of
+ ["common_test",Vsn] -> " v"++Vsn;
+ _ -> ""
+ end
+ end,
+ io:format("~nCommon Test~s starting (cwd is ~s)~n~n",
+ [CTVsn,Cwd]),
+ Self = self(),
+ Pid = spawn_link(fun() -> script_start1(Self, Args) end),
+ receive
+ {'EXIT',Pid,Reason} ->
+ case Reason of
+ {user_error,What} ->
+ io:format("\nTest run failed!\nReason: ~p\n\n\n",
+ [What]),
+ finish(Tracing, ?EXIT_STATUS_TEST_RUN_FAILED, Args);
+ _ ->
+ io:format("Test run crashed! "
+ "This could be an internal error "
+ "- please report!\n\n"
+ "~p\n\n\n", [Reason]),
+ finish(Tracing, ?EXIT_STATUS_TEST_RUN_FAILED, Args)
+ end;
+ {Pid,{error,Reason}} ->
+ io:format("\nTest run failed! Reason:\n~p\n\n\n",[Reason]),
+ finish(Tracing, ?EXIT_STATUS_TEST_RUN_FAILED, Args);
+ {Pid,Result} ->
+ io:nl(),
+ finish(Tracing, analyze_test_result(Result, Args), Args)
+ end;
+ {error,_LoopReason} ->
+ finish(Tracing, ?EXIT_STATUS_TEST_RUN_FAILED, Args);
+ Result ->
+ io:nl(),
+ finish(Tracing, analyze_test_result(Result, Args), Args)
+ end.
+
+%% analyze the result of one test run, or many (in case of looped test)
+analyze_test_result(ok, _) ->
+ ?EXIT_STATUS_TEST_SUCCESSFUL;
+analyze_test_result({error,_Reason}, _) ->
+ ?EXIT_STATUS_TEST_RUN_FAILED;
+analyze_test_result({_Ok,Failed,{_UserSkipped,AutoSkipped}}, Args) ->
+ if Failed > 0 ->
+ ?EXIT_STATUS_TEST_CASE_FAILED;
+ true ->
+ case AutoSkipped of
+ 0 ->
+ ?EXIT_STATUS_TEST_SUCCESSFUL;
+ _ ->
+ case get_start_opt(exit_status,
+ fun([ExitOpt]) -> ExitOpt end,
+ Args) of
+ undefined ->
+ ?EXIT_STATUS_TEST_CASE_FAILED;
+ "ignore_config" ->
+ ?EXIT_STATUS_TEST_SUCCESSFUL
+ end
+ end
+ end;
+analyze_test_result([Result|Rs], Args) ->
+ case analyze_test_result(Result, Args) of
+ ?EXIT_STATUS_TEST_SUCCESSFUL ->
+ analyze_test_result(Rs, Args);
+ Other ->
+ Other
+ end;
+analyze_test_result([], _) ->
+ ?EXIT_STATUS_TEST_SUCCESSFUL;
+analyze_test_result(interactive_mode, _) ->
+ interactive_mode;
+analyze_test_result(Unknown, _) ->
+ io:format("\nTest run failed! Reason:\n~p\n\n\n",[Unknown]),
+ ?EXIT_STATUS_TEST_RUN_FAILED.
+
+finish(Tracing, ExitStatus, Args) ->
stop_trace(Tracing),
timer:sleep(1000),
- io:nl(),
- Res.
+ if ExitStatus == interactive_mode ->
+ interactive_mode;
+ true ->
+ %% it's possible to tell CT to finish execution with a call
+ %% to a different function than the normal halt/1 BIF
+ %% (meant to be used mainly for reading the CT exit status)
+ case get_start_opt(halt_with,
+ fun([HaltMod,HaltFunc]) ->
+ {list_to_atom(HaltMod),
+ list_to_atom(HaltFunc)} end,
+ Args) of
+ undefined ->
+ halt(ExitStatus);
+ {M,F} ->
+ apply(M, F, [ExitStatus])
+ end
+ end.
script_start1(Parent, Args) ->
%% read general start flags
@@ -172,18 +248,23 @@ script_start1(Parent, Args) ->
LogDir = get_start_opt(logdir, fun([LogD]) -> LogD end, Args),
LogOpts = get_start_opt(logopts, fun(Os) -> [list_to_atom(O) || O <- Os] end,
[], Args),
+ Verbosity = verbosity_args2opts(Args),
MultTT = get_start_opt(multiply_timetraps,
fun([MT]) -> list_to_integer(MT) end, 1, Args),
ScaleTT = get_start_opt(scale_timetraps,
fun([CT]) -> list_to_atom(CT);
([]) -> true
end, false, Args),
+ CreatePrivDir = get_start_opt(create_priv_dir,
+ fun([PD]) -> list_to_atom(PD);
+ ([]) -> auto_per_tc
+ end, Args),
EvHandlers = event_handler_args2opts(Args),
CTHooks = ct_hooks_args2opts(Args),
EnableBuiltinHooks = get_start_opt(enable_builtin_hooks,
fun([CT]) -> list_to_atom(CT);
- ([]) -> true
- end, true, Args),
+ ([]) -> undefined
+ end, undefined, Args),
%% check flags and set corresponding application env variables
@@ -201,7 +282,7 @@ script_start1(Parent, Args) ->
end
end,
%% no_auto_compile + include
- IncludeDirs =
+ {AutoCompile,IncludeDirs} =
case proplists:get_value(no_auto_compile, Args) of
undefined ->
application:set_env(common_test, auto_compile, true),
@@ -217,45 +298,52 @@ script_start1(Parent, Args) ->
case os:getenv("CT_INCLUDE_PATH") of
false ->
application:set_env(common_test, include, InclDirs),
- InclDirs;
+ {undefined,InclDirs};
CtInclPath ->
AllInclDirs =
string:tokens(CtInclPath,[$:,$ ,$,]) ++ InclDirs,
application:set_env(common_test, include, AllInclDirs),
- AllInclDirs
+ {undefined,AllInclDirs}
end;
_ ->
application:set_env(common_test, auto_compile, false),
- []
+ {false,[]}
end,
%% silent connections
SilentConns =
get_start_opt(silent_connections,
- fun(["all"]) -> [];
+ fun(["all"]) -> [all];
(Conns) -> [list_to_atom(Conn) || Conn <- Conns]
- end, Args),
+ end, [], Args),
%% stylesheet
Stylesheet = get_start_opt(stylesheet,
fun([SS]) -> ?abs(SS) end, Args),
%% basic_html - used by ct_logs
- case proplists:get_value(basic_html, Args) of
- undefined ->
- application:set_env(common_test, basic_html, false);
- _ ->
- application:set_env(common_test, basic_html, true)
- end,
+ BasicHtml = case proplists:get_value(basic_html, Args) of
+ undefined ->
+ application:set_env(common_test, basic_html, false),
+ undefined;
+ _ ->
+ application:set_env(common_test, basic_html, true),
+ true
+ end,
StartOpts = #opts{label = Label, profile = Profile,
vts = Vts, shell = Shell, cover = Cover,
logdir = LogDir, logopts = LogOpts,
+ basic_html = BasicHtml,
+ verbosity = Verbosity,
event_handlers = EvHandlers,
ct_hooks = CTHooks,
enable_builtin_hooks = EnableBuiltinHooks,
+ auto_compile = AutoCompile,
include = IncludeDirs,
silent_connections = SilentConns,
stylesheet = Stylesheet,
multiply_timetraps = MultTT,
- scale_timetraps = ScaleTT},
+ scale_timetraps = ScaleTT,
+ create_priv_dir = CreatePrivDir,
+ starter = script},
%% check if log files should be refreshed or go on to run tests...
Result = run_or_refresh(StartOpts, Args),
@@ -319,15 +407,30 @@ script_start2(StartOpts = #opts{vts = undefined,
AllLogOpts = merge_vals([StartOpts#opts.logopts,
SpecStartOpts#opts.logopts]),
+ AllVerbosity =
+ merge_keyvals([StartOpts#opts.verbosity,
+ SpecStartOpts#opts.verbosity]),
+ AllSilentConns =
+ merge_vals([StartOpts#opts.silent_connections,
+ SpecStartOpts#opts.silent_connections]),
+ Cover =
+ choose_val(StartOpts#opts.cover,
+ SpecStartOpts#opts.cover),
+ MultTT =
+ choose_val(StartOpts#opts.multiply_timetraps,
+ SpecStartOpts#opts.multiply_timetraps),
+ ScaleTT =
+ choose_val(StartOpts#opts.scale_timetraps,
+ SpecStartOpts#opts.scale_timetraps),
+
+ CreatePrivDir =
+ choose_val(StartOpts#opts.create_priv_dir,
+ SpecStartOpts#opts.create_priv_dir),
+
+ AllEvHs =
+ merge_vals([StartOpts#opts.event_handlers,
+ SpecStartOpts#opts.event_handlers]),
- Cover = choose_val(StartOpts#opts.cover,
- SpecStartOpts#opts.cover),
- MultTT = choose_val(StartOpts#opts.multiply_timetraps,
- SpecStartOpts#opts.multiply_timetraps),
- ScaleTT = choose_val(StartOpts#opts.scale_timetraps,
- SpecStartOpts#opts.scale_timetraps),
- AllEvHs = merge_vals([StartOpts#opts.event_handlers,
- SpecStartOpts#opts.event_handlers]),
AllCTHooks = merge_vals(
[StartOpts#opts.ct_hooks,
SpecStartOpts#opts.ct_hooks]),
@@ -337,9 +440,36 @@ script_start2(StartOpts = #opts{vts = undefined,
StartOpts#opts.enable_builtin_hooks,
SpecStartOpts#opts.enable_builtin_hooks),
+ Stylesheet =
+ choose_val(StartOpts#opts.stylesheet,
+ SpecStartOpts#opts.stylesheet),
+
AllInclude = merge_vals([StartOpts#opts.include,
SpecStartOpts#opts.include]),
application:set_env(common_test, include, AllInclude),
+
+ AutoCompile =
+ case choose_val(StartOpts#opts.auto_compile,
+ SpecStartOpts#opts.auto_compile) of
+ undefined ->
+ true;
+ ACBool ->
+ application:set_env(common_test,
+ auto_compile,
+ ACBool),
+ ACBool
+ end,
+
+ BasicHtml =
+ case choose_val(StartOpts#opts.basic_html,
+ SpecStartOpts#opts.basic_html) of
+ undefined ->
+ false;
+ BHBool ->
+ application:set_env(common_test, basic_html,
+ BHBool),
+ BHBool
+ end,
{TS,StartOpts#opts{label = Label,
profile = Profile,
@@ -347,14 +477,20 @@ script_start2(StartOpts = #opts{vts = undefined,
cover = Cover,
logdir = LogDir,
logopts = AllLogOpts,
+ basic_html = BasicHtml,
+ verbosity = AllVerbosity,
+ silent_connections = AllSilentConns,
config = SpecStartOpts#opts.config,
event_handlers = AllEvHs,
ct_hooks = AllCTHooks,
enable_builtin_hooks =
EnableBuiltinHooks,
+ stylesheet = Stylesheet,
+ auto_compile = AutoCompile,
include = AllInclude,
multiply_timetraps = MultTT,
- scale_timetraps = ScaleTT}}
+ scale_timetraps = ScaleTT,
+ create_priv_dir = CreatePrivDir}}
end;
_ ->
{undefined,StartOpts}
@@ -503,8 +639,10 @@ script_start4(#opts{label = Label, profile = Profile,
event_handlers = EvHandlers,
ct_hooks = CTHooks,
logopts = LogOpts,
+ verbosity = Verbosity,
enable_builtin_hooks = EnableBuiltinHooks,
logdir = LogDir, testspecs = Specs}, _Args) ->
+
%% label - used by ct_logs
application:set_env(common_test, test_label, Label),
@@ -520,11 +658,12 @@ script_start4(#opts{label = Label, profile = Profile,
{ct_hooks, CTHooks},
{enable_builtin_hooks,EnableBuiltinHooks}]) of
ok ->
- ct_util:start(interactive, LogDir),
+ ct_util:start(interactive, LogDir,
+ add_verbosity_defaults(Verbosity)),
ct_util:set_testdata({logopts, LogOpts}),
log_ts_names(Specs),
io:nl(),
- ok;
+ interactive_mode;
Error ->
Error
end;
@@ -537,7 +676,7 @@ script_start4(#opts{vts = true, cover = Cover}, _) ->
%% Add support later (maybe).
io:format("\nCan't run cover in vts mode.\n\n", [])
end,
- erlang:halt();
+ {error,no_cover_in_vts_mode};
script_start4(#opts{shell = true, cover = Cover}, _) ->
case Cover of
@@ -546,7 +685,8 @@ script_start4(#opts{shell = true, cover = Cover}, _) ->
_ ->
%% Add support later (maybe).
io:format("\nCan't run cover in interactive mode.\n\n", [])
- end;
+ end,
+ {error,no_cover_in_interactive_mode};
script_start4(Opts = #opts{tests = Tests}, Args) ->
do_run(Tests, [], Opts, Args).
@@ -563,10 +703,12 @@ script_usage() ->
"\n\t[-dir TestDir1 TestDir2 .. TestDirN] |"
"\n\t[-suite Suite [-case Case]]"
"\n\t[-logopts LogOpt1 LogOpt2 .. LogOptN]"
+ "\n\t[-verbosity GenVLvl | [CategoryVLvl1 .. CategoryVLvlN]]"
"\n\t[-include InclDir1 InclDir2 .. InclDirN]"
"\n\t[-no_auto_compile]"
"\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"),
io:format("Run tests from command line:\n\n"
"\tct_run [-dir TestDir1 TestDir2 .. TestDirN] |"
@@ -576,16 +718,18 @@ script_usage() ->
"\n\t[-userconfig CallbackModule ConfigFile1 .. ConfigFileN]"
"\n\t[-decrypt_key Key] | [-decrypt_file KeyFile]"
"\n\t[-logdir LogDir]"
+ "\n\t[-logopts LogOpt1 LogOpt2 .. LogOptN]"
+ "\n\t[-verbosity GenVLvl | [CategoryVLvl1 .. CategoryVLvlN]]"
"\n\t[-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]"
- "\n\t[-stylesheet CSSFile]"
+ "\n\t[-stylesheet CSSFile]"
"\n\t[-cover CoverCfgFile]"
"\n\t[-event_handler EvHandler1 EvHandler2 .. EvHandlerN]"
- "\n\t[-logopts LogOpt1 LogOpt2 .. LogOptN]"
"\n\t[-ct_hooks CTHook1 CTHook2 .. CTHookN]"
"\n\t[-include InclDir1 InclDir2 .. InclDirN]"
"\n\t[-no_auto_compile]"
"\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\t[-repeat N [-force_stop]] |"
"\n\t[-duration HHMMSS [-force_stop]] |"
@@ -595,17 +739,19 @@ script_usage() ->
"\n\t[-config ConfigFile1 ConfigFile2 .. ConfigFileN]"
"\n\t[-decrypt_key Key] | [-decrypt_file KeyFile]"
"\n\t[-logdir LogDir]"
+ "\n\t[-logopts LogOpt1 LogOpt2 .. LogOptN]"
+ "\n\t[-verbosity GenVLvl | [CategoryVLvl1 .. CategoryVLvlN]]"
"\n\t[-allow_user_terms]"
"\n\t[-silent_connections [ConnType1 ConnType2 .. ConnTypeN]]"
"\n\t[-stylesheet CSSFile]"
"\n\t[-cover CoverCfgFile]"
"\n\t[-event_handler EvHandler1 EvHandler2 .. EvHandlerN]"
- "\n\t[-logopts LogOpt1 LogOpt2 .. LogOptN]"
"\n\t[-ct_hooks CTHook1 CTHook2 .. CTHookN]"
"\n\t[-include InclDir1 InclDir2 .. InclDirN]"
"\n\t[-no_auto_compile]"
"\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\t[-repeat N [-force_stop]] |"
"\n\t[-duration HHMMSS [-force_stop]] |"
@@ -683,7 +829,7 @@ run_test(StartOpts) when is_list(StartOpts) ->
Ref = monitor(process, CTPid),
receive
{'DOWN',Ref,process,CTPid,{user_error,Error}} ->
- Error;
+ {error,Error};
{'DOWN',Ref,process,CTPid,Other} ->
Other
end.
@@ -720,8 +866,10 @@ run_test2(StartOpts) ->
(Lbl) when is_atom(Lbl) -> atom_to_list(Lbl)
end, StartOpts),
%% profile
- Profile = get_start_opt(profile, fun(Prof) when is_list(Prof) -> Prof;
- (Prof) when is_atom(Prof) -> atom_to_list(Prof)
+ Profile = get_start_opt(profile, fun(Prof) when is_list(Prof) ->
+ Prof;
+ (Prof) when is_atom(Prof) ->
+ atom_to_list(Prof)
end, StartOpts),
%% logdir
LogDir = get_start_opt(logdir, fun(LD) when is_list(LD) -> LD end,
@@ -729,6 +877,19 @@ run_test2(StartOpts) ->
%% logopts
LogOpts = get_start_opt(logopts, value, [], StartOpts),
+ %% verbosity
+ Verbosity =
+ get_start_opt(verbosity,
+ fun(VLvls) when is_list(VLvls) ->
+ lists:map(fun(VLvl = {_Cat,_Lvl}) ->
+ VLvl;
+ (Lvl) ->
+ {'$unspecified',Lvl}
+ end, VLvls);
+ (VLvl) when is_integer(VLvl) ->
+ [{'$unspecified',VLvl}]
+ end, [], StartOpts),
+
%% config & userconfig
CfgFiles = ct_config:get_config_file_list(StartOpts),
@@ -763,13 +924,13 @@ run_test2(StartOpts) ->
fun(EBH) when EBH == true;
EBH == false ->
EBH
- end, true, StartOpts),
+ end, undefined, StartOpts),
%% silent connections
SilentConns = get_start_opt(silent_connections,
- fun(all) -> [];
+ fun(all) -> [all];
(Conns) -> Conns
- end, StartOpts),
+ end, [], StartOpts),
%% stylesheet
Stylesheet = get_start_opt(stylesheet,
fun(SS) -> ?abs(SS) end,
@@ -782,8 +943,11 @@ run_test2(StartOpts) ->
MultiplyTT = get_start_opt(multiply_timetraps, value, 1, StartOpts),
ScaleTT = get_start_opt(scale_timetraps, value, false, StartOpts),
+ %% create unique priv dir names
+ CreatePrivDir = get_start_opt(create_priv_dir, value, StartOpts),
+
%% auto compile & include files
- Include =
+ {AutoCompile,Include} =
case proplists:get_value(auto_compile, StartOpts) of
undefined ->
application:set_env(common_test, auto_compile, true),
@@ -799,16 +963,16 @@ run_test2(StartOpts) ->
case os:getenv("CT_INCLUDE_PATH") of
false ->
application:set_env(common_test, include, InclDirs),
- InclDirs;
+ {undefined,InclDirs};
CtInclPath ->
InclDirs1 = string:tokens(CtInclPath, [$:,$ ,$,]),
AllInclDirs = InclDirs1++InclDirs,
application:set_env(common_test, include, AllInclDirs),
- AllInclDirs
+ {undefined,AllInclDirs}
end;
ACBool ->
application:set_env(common_test, auto_compile, ACBool),
- []
+ {ACBool,[]}
end,
%% decrypt config file
@@ -822,11 +986,14 @@ run_test2(StartOpts) ->
end,
%% basic html - used by ct_logs
- case proplists:get_value(basic_html, StartOpts) of
- undefined ->
- application:set_env(common_test, basic_html, false);
- BasicHtmlBool ->
- application:set_env(common_test, basic_html, BasicHtmlBool)
+ BasicHtml =
+ case proplists:get_value(basic_html, StartOpts) of
+ undefined ->
+ application:set_env(common_test, basic_html, false),
+ undefined;
+ BasicHtmlBool ->
+ application:set_env(common_test, basic_html, BasicHtmlBool),
+ BasicHtmlBool
end,
%% stepped execution
@@ -834,15 +1001,20 @@ run_test2(StartOpts) ->
Opts = #opts{label = Label, profile = Profile,
cover = Cover, step = Step, logdir = LogDir,
- logopts = LogOpts, config = CfgFiles,
+ logopts = LogOpts, basic_html = BasicHtml,
+ config = CfgFiles,
+ verbosity = Verbosity,
event_handlers = EvHandlers,
ct_hooks = CTHooks,
enable_builtin_hooks = EnableBuiltinHooks,
+ auto_compile = AutoCompile,
include = Include,
silent_connections = SilentConns,
stylesheet = Stylesheet,
multiply_timetraps = MultiplyTT,
- scale_timetraps = ScaleTT},
+ scale_timetraps = ScaleTT,
+ create_priv_dir = CreatePrivDir,
+ starter = ct},
%% test specification
case proplists:get_value(spec, StartOpts) of
@@ -871,7 +1043,7 @@ run_spec_file(Relaxed,
log_ts_names(AbsSpecs),
case catch ct_testspec:collect_tests_from_file(AbsSpecs, Relaxed) of
{Error,CTReason} when Error == error ; Error == 'EXIT' ->
- exit(CTReason);
+ exit({error,CTReason});
TS ->
SpecOpts = get_data_for_node(TS, node()),
Label = choose_val(Opts#opts.label,
@@ -882,6 +1054,12 @@ run_spec_file(Relaxed,
SpecOpts#opts.logdir),
AllLogOpts = merge_vals([Opts#opts.logopts,
SpecOpts#opts.logopts]),
+ Stylesheet = choose_val(Opts#opts.stylesheet,
+ SpecOpts#opts.stylesheet),
+ AllVerbosity = merge_keyvals([Opts#opts.verbosity,
+ SpecOpts#opts.verbosity]),
+ AllSilentConns = merge_vals([Opts#opts.silent_connections,
+ SpecOpts#opts.silent_connections]),
AllConfig = merge_vals([CfgFiles, SpecOpts#opts.config]),
Cover = choose_val(Opts#opts.cover,
SpecOpts#opts.cover),
@@ -889,29 +1067,56 @@ run_spec_file(Relaxed,
SpecOpts#opts.multiply_timetraps),
ScaleTT = choose_val(Opts#opts.scale_timetraps,
SpecOpts#opts.scale_timetraps),
+ CreatePrivDir = choose_val(Opts#opts.create_priv_dir,
+ SpecOpts#opts.create_priv_dir),
AllEvHs = merge_vals([Opts#opts.event_handlers,
SpecOpts#opts.event_handlers]),
AllInclude = merge_vals([Opts#opts.include,
SpecOpts#opts.include]),
-
AllCTHooks = merge_vals([Opts#opts.ct_hooks,
- SpecOpts#opts.ct_hooks]),
+ SpecOpts#opts.ct_hooks]),
EnableBuiltinHooks = choose_val(Opts#opts.enable_builtin_hooks,
SpecOpts#opts.enable_builtin_hooks),
application:set_env(common_test, include, AllInclude),
+ AutoCompile = case choose_val(Opts#opts.auto_compile,
+ SpecOpts#opts.auto_compile) of
+ undefined ->
+ true;
+ ACBool ->
+ application:set_env(common_test, auto_compile,
+ ACBool),
+ ACBool
+ end,
+
+ BasicHtml = case choose_val(Opts#opts.basic_html,
+ SpecOpts#opts.basic_html) of
+ undefined ->
+ false;
+ BHBool ->
+ application:set_env(common_test, basic_html,
+ BHBool),
+ BHBool
+ end,
+
Opts1 = Opts#opts{label = Label,
profile = Profile,
cover = Cover,
logdir = which(logdir, LogDir),
logopts = AllLogOpts,
+ stylesheet = Stylesheet,
+ basic_html = BasicHtml,
+ verbosity = AllVerbosity,
+ silent_connections = AllSilentConns,
config = AllConfig,
event_handlers = AllEvHs,
+ auto_compile = AutoCompile,
include = AllInclude,
testspecs = AbsSpecs,
multiply_timetraps = MultTT,
scale_timetraps = ScaleTT,
+ create_priv_dir = CreatePrivDir,
ct_hooks = AllCTHooks,
enable_builtin_hooks = EnableBuiltinHooks
},
@@ -922,20 +1127,20 @@ run_spec_file(Relaxed,
{Run,Skip} = ct_testspec:prepare_tests(TS, node()),
reformat_result(catch do_run(Run, Skip, Opts1, StartOpts));
{error,GCFReason} ->
- exit(GCFReason)
+ exit({error,GCFReason})
end
end.
run_prepared(Run, Skip, Opts = #opts{logdir = LogDir,
- config = CfgFiles },
+ config = CfgFiles},
StartOpts) ->
LogDir1 = which(logdir, LogDir),
case check_and_install_configfiles(CfgFiles, LogDir1, Opts) of
ok ->
reformat_result(catch do_run(Run, Skip, Opts#opts{logdir = LogDir1},
StartOpts));
- {error,Reason} ->
- exit(Reason)
+ {error,_Reason} = Error ->
+ exit(Error)
end.
check_config_file(Callback, File)->
@@ -943,7 +1148,7 @@ check_config_file(Callback, File)->
false ->
case code:load_file(Callback) of
{module,_} -> ok;
- {error,Why} -> exit({cant_load_callback_module,Why})
+ {error,Why} -> exit({error,{cant_load_callback_module,Why}})
end;
_ ->
ok
@@ -954,16 +1159,17 @@ check_config_file(Callback, File)->
{ok,{config,_}}->
File;
{error,{wrong_config,Message}}->
- exit({wrong_config,{Callback,Message}});
+ exit({error,{wrong_config,{Callback,Message}}});
{error,{nofile,File}}->
- exit({no_such_file,?abs(File)})
+ exit({error,{no_such_file,?abs(File)}})
end.
run_dir(Opts = #opts{logdir = LogDir,
config = CfgFiles,
event_handlers = EvHandlers,
ct_hooks = CTHook,
- enable_builtin_hooks = EnableBuiltinHooks }, StartOpts) ->
+ enable_builtin_hooks = EnableBuiltinHooks},
+ StartOpts) ->
LogDir1 = which(logdir, LogDir),
Opts1 = Opts#opts{logdir = LogDir1},
AbsCfgFiles =
@@ -976,7 +1182,8 @@ run_dir(Opts = #opts{logdir = LogDir,
{module,Callback}->
ok;
{error,_}->
- exit({no_such_module,Callback})
+ exit({error,{no_such_module,
+ Callback}})
end
end,
{Callback,
@@ -989,7 +1196,7 @@ run_dir(Opts = #opts{logdir = LogDir,
{ct_hooks, CTHook},
{enable_builtin_hooks,EnableBuiltinHooks}], LogDir1) of
ok -> ok;
- {error,IReason} -> exit(IReason)
+ {error,_IReason} = IError -> exit(IError)
end,
case {proplists:get_value(dir, StartOpts),
proplists:get_value(suite, StartOpts),
@@ -1031,7 +1238,7 @@ run_dir(Opts = #opts{logdir = LogDir,
[], Opts1, StartOpts));
{undefined,[Hd,_|_],_GsAndCs} when not is_integer(Hd) ->
- exit(multiple_suites_and_cases);
+ exit({error,multiple_suites_and_cases});
{undefined,Suite=[Hd|Tl],GsAndCs} when is_integer(Hd) ;
(is_list(Hd) and (Tl == [])) ;
@@ -1041,10 +1248,10 @@ run_dir(Opts = #opts{logdir = LogDir,
[], Opts1, StartOpts));
{[Hd,_|_],_Suites,[]} when is_list(Hd) ; not is_integer(Hd) ->
- exit(multiple_dirs_and_suites);
+ exit({error,multiple_dirs_and_suites});
{undefined,undefined,GsAndCs} when GsAndCs /= [] ->
- exit(incorrect_start_options);
+ exit({error,incorrect_start_options});
{Dir,Suite,GsAndCs} when is_integer(hd(Dir)) ;
(is_atom(Dir) and (Dir /= undefined)) ;
@@ -1053,7 +1260,7 @@ run_dir(Opts = #opts{logdir = LogDir,
Dir1 = if is_atom(Dir) -> atom_to_list(Dir);
true -> Dir end,
if Suite == undefined ->
- exit(incorrect_start_options);
+ exit({error,incorrect_start_options});
is_integer(hd(Suite)) ;
(is_atom(Suite) and (Suite /= undefined)) ;
@@ -1072,7 +1279,7 @@ run_dir(Opts = #opts{logdir = LogDir,
is_list(Suite) -> % multiple suites
case [suite_to_test(Dir1, S) || S <- Suite] of
[_,_|_] when GsAndCs /= [] ->
- exit(multiple_suites_and_cases);
+ exit({error,multiple_suites_and_cases});
[{Dir2,Mod}] when GsAndCs /= [] ->
reformat_result(catch do_run(tests(Dir2, Mod, GsAndCs),
[], Opts1, StartOpts));
@@ -1083,10 +1290,10 @@ run_dir(Opts = #opts{logdir = LogDir,
end;
{undefined,undefined,[]} ->
- exit(no_test_specified);
+ exit({error,no_test_specified});
{Dir,Suite,GsAndCs} ->
- exit({incorrect_start_options,{Dir,Suite,GsAndCs}})
+ exit({error,{incorrect_start_options,{Dir,Suite,GsAndCs}}})
end.
%%%-----------------------------------------------------------------
@@ -1131,7 +1338,7 @@ run_testspec2(File) when is_list(File), is_integer(hd(File)) ->
run_testspec2(TestSpec) ->
case catch ct_testspec:collect_tests_from_list(TestSpec, false) of
{E,CTReason} when E == error ; E == 'EXIT' ->
- exit(CTReason);
+ exit({error,CTReason});
TS ->
Opts = get_data_for_node(TS, node()),
@@ -1153,8 +1360,8 @@ run_testspec2(TestSpec) ->
include = AllInclude},
{Run,Skip} = ct_testspec:prepare_tests(TS, node()),
reformat_result(catch do_run(Run, Skip, Opts1, []));
- {error,GCFReason} ->
- exit(GCFReason)
+ {error,_GCFReason} = GCFError ->
+ exit(GCFError)
end
end.
@@ -1162,15 +1369,21 @@ get_data_for_node(#testspec{label = Labels,
profile = Profiles,
logdir = LogDirs,
logopts = LogOptsList,
+ basic_html = BHs,
+ stylesheet = SSs,
+ verbosity = VLvls,
+ silent_connections = SilentConnsList,
cover = CoverFs,
config = Cfgs,
userconfig = UsrCfgs,
event_handler = EvHs,
ct_hooks = CTHooks,
enable_builtin_hooks = EnableBuiltinHooks,
+ auto_compile = ACs,
include = Incl,
multiply_timetraps = MTs,
- scale_timetraps = STs}, Node) ->
+ scale_timetraps = STs,
+ create_priv_dir = PDs}, Node) ->
Label = proplists:get_value(Node, Labels),
Profile = proplists:get_value(Node, Profiles),
LogDir = case proplists:get_value(Node, LogDirs) of
@@ -1181,26 +1394,44 @@ get_data_for_node(#testspec{label = Labels,
undefined -> [];
LOs -> LOs
end,
+ BasicHtml = proplists:get_value(Node, BHs),
+ Stylesheet = proplists:get_value(Node, SSs),
+ Verbosity = case proplists:get_value(Node, VLvls) of
+ undefined -> [];
+ Lvls -> Lvls
+ end,
+ SilentConns = case proplists:get_value(Node, SilentConnsList) of
+ undefined -> [];
+ SCs -> SCs
+ end,
Cover = proplists:get_value(Node, CoverFs),
MT = proplists:get_value(Node, MTs),
ST = proplists:get_value(Node, STs),
+ CreatePrivDir = proplists:get_value(Node, PDs),
ConfigFiles = [{?ct_config_txt,F} || {N,F} <- Cfgs, N==Node] ++
[CBF || {N,CBF} <- UsrCfgs, N==Node],
EvHandlers = [{H,A} || {N,H,A} <- EvHs, N==Node],
FiltCTHooks = [Hook || {N,Hook} <- CTHooks, N==Node],
+ AutoCompile = proplists:get_value(Node, ACs),
Include = [I || {N,I} <- Incl, N==Node],
#opts{label = Label,
profile = Profile,
logdir = LogDir,
logopts = LogOpts,
+ basic_html = BasicHtml,
+ stylesheet = Stylesheet,
+ verbosity = Verbosity,
+ silent_connections = SilentConns,
cover = Cover,
config = ConfigFiles,
event_handlers = EvHandlers,
ct_hooks = FiltCTHooks,
enable_builtin_hooks = EnableBuiltinHooks,
+ auto_compile = AutoCompile,
include = Include,
multiply_timetraps = MT,
- scale_timetraps = ST}.
+ scale_timetraps = ST,
+ create_priv_dir = CreatePrivDir}.
refresh_logs(LogDir) ->
{ok,Cwd} = file:get_cwd(),
@@ -1238,6 +1469,14 @@ choose_val(V0, _V1) ->
merge_vals(Vs) ->
lists:append(Vs).
+merge_keyvals(Vs) ->
+ make_unique(lists:append(Vs)).
+
+make_unique([Elem={Key,_} | Elems]) ->
+ [Elem | make_unique(proplists:delete(Key, Elems))];
+make_unique([]) ->
+ [].
+
listify([C|_]=Str) when is_integer(C) -> [Str];
listify(L) when is_list(L) -> L;
listify(E) -> [E].
@@ -1347,7 +1586,8 @@ do_run(Tests, Misc, LogDir, LogOpts) when is_list(Misc),
do_run(Tests, [], Opts1#opts{logdir = LogDir}, []);
do_run(Tests, Skip, Opts, Args) when is_record(Opts, opts) ->
- #opts{label = Label, profile = Profile, cover = Cover} = Opts,
+ #opts{label = Label, profile = Profile, cover = Cover,
+ verbosity = VLvls} = Opts,
%% label - used by ct_logs
TestLabel =
if Label == undefined -> undefined;
@@ -1368,7 +1608,7 @@ do_run(Tests, Skip, Opts, Args) when is_record(Opts, opts) ->
case code:which(test_server) of
non_existing ->
- exit({error,no_path_to_test_server});
+ {error,no_path_to_test_server};
_ ->
Opts1 = if Cover == undefined ->
Opts;
@@ -1384,81 +1624,136 @@ do_run(Tests, Skip, Opts, Args) when is_record(Opts, opts) ->
%% which framework it runs under.
case os:getenv("TEST_SERVER_FRAMEWORK") of
false ->
- os:putenv("TEST_SERVER_FRAMEWORK", "ct_framework");
+ os:putenv("TEST_SERVER_FRAMEWORK", "ct_framework"),
+ os:putenv("TEST_SERVER_FRAMEWORK_NAME", "common_test");
"ct_framework" ->
ok;
Other ->
- erlang:display(list_to_atom("Note: TEST_SERVER_FRAMEWORK = " ++ Other))
+ erlang:display(
+ list_to_atom(
+ "Note: TEST_SERVER_FRAMEWORK = " ++ Other))
end,
- case ct_util:start(Opts#opts.logdir) of
+ Verbosity = add_verbosity_defaults(VLvls),
+ case ct_util:start(Opts#opts.logdir, Verbosity) of
{error,interactive_mode} ->
io:format("CT is started in interactive mode. "
- "To exit this mode, run ct:stop_interactive().\n"
+ "To exit this mode, "
+ "run ct:stop_interactive().\n"
"To enter the interactive mode again, "
"run ct:start_interactive()\n\n",[]),
{error,interactive_mode};
_Pid ->
- %% save stylesheet info
- ct_util:set_testdata({stylesheet,Opts#opts.stylesheet}),
- %% save logopts
- ct_util:set_testdata({logopts,Opts#opts.logopts}),
- %% enable silent connections
- case Opts#opts.silent_connections of
- [] ->
- Conns = ct_util:override_silence_all_connections(),
- ct_logs:log("Silent connections", "~p", [Conns]);
- Conns when is_list(Conns) ->
- ct_util:override_silence_connections(Conns),
- ct_logs:log("Silent connections", "~p", [Conns]);
- _ ->
- ok
- end,
- log_ts_names(Opts1#opts.testspecs),
- TestSuites = suite_tuples(Tests),
-
- {_TestSuites1,SuiteMakeErrors,AllMakeErrors} =
- case application:get_env(common_test, auto_compile) of
- {ok,false} ->
- {TestSuites1,SuitesNotFound} =
- verify_suites(TestSuites),
- {TestSuites1,SuitesNotFound,SuitesNotFound};
- _ ->
- {SuiteErrs,HelpErrs} = auto_compile(TestSuites),
- {TestSuites,SuiteErrs,SuiteErrs++HelpErrs}
- end,
+ ct_util:set_testdata({starter,Opts#opts.starter}),
+ compile_and_run(Tests, Skip,
+ Opts1#opts{verbosity=Verbosity}, Args)
+ end
+ end.
- case continue(AllMakeErrors) of
- true ->
- SavedErrors = save_make_errors(SuiteMakeErrors),
- ct_repeat:log_loop_info(Args),
+compile_and_run(Tests, Skip, Opts, Args) ->
+ %% save stylesheet info
+ ct_util:set_testdata({stylesheet,Opts#opts.stylesheet}),
+ %% save logopts
+ ct_util:set_testdata({logopts,Opts#opts.logopts}),
+ %% enable silent connections
+ case Opts#opts.silent_connections of
+ [] ->
+ ok;
+ Conns ->
+ case lists:member(all, Conns) of
+ true ->
+ Conns1 = ct_util:override_silence_all_connections(),
+ ct_logs:log("Silent connections", "~p", [Conns1]);
+ false ->
+ ct_util:override_silence_connections(Conns),
+ ct_logs:log("Silent connections", "~p", [Conns])
+ end
+ end,
+ log_ts_names(Opts#opts.testspecs),
+ TestSuites = suite_tuples(Tests),
+
+ {_TestSuites1,SuiteMakeErrors,AllMakeErrors} =
+ case application:get_env(common_test, auto_compile) of
+ {ok,false} ->
+ {TestSuites1,SuitesNotFound} =
+ verify_suites(TestSuites),
+ {TestSuites1,SuitesNotFound,SuitesNotFound};
+ _ ->
+ {SuiteErrs,HelpErrs} = auto_compile(TestSuites),
+ {TestSuites,SuiteErrs,SuiteErrs++HelpErrs}
+ end,
+
+ case continue(AllMakeErrors) of
+ true ->
+ SavedErrors = save_make_errors(SuiteMakeErrors),
+ ct_repeat:log_loop_info(Args),
+
+ {Tests1,Skip1} = final_tests(Tests,Skip,SavedErrors),
+
+ ReleaseSh = proplists:get_value(release_shell, Args),
+ ct_util:set_testdata({release_shell,ReleaseSh}),
+ possibly_spawn(ReleaseSh == true, Tests1, Skip1, Opts);
+ false ->
+ io:nl(),
+ ct_util:stop(clean),
+ BadMods =
+ lists:foldr(
+ fun({{_,_},Ms}, Acc) ->
+ Ms ++ lists:foldl(
+ fun(M, Acc1) ->
+ lists:delete(M, Acc1)
+ end, Acc, Ms)
+ end, [], AllMakeErrors),
+ {error,{make_failed,BadMods}}
+ end.
- {Tests1,Skip1} = final_tests(Tests,Skip,SavedErrors),
+%% keep the shell as the top controlling process
+possibly_spawn(false, Tests, Skip, Opts) ->
+ TestResult = (catch do_run_test(Tests, Skip, Opts)),
+ case TestResult of
+ {EType,_} = Error when EType == user_error;
+ EType == error ->
+ ct_util:stop(clean),
+ exit(Error);
+ _ ->
+ ct_util:stop(normal),
+ TestResult
+ end;
- R = (catch do_run_test(Tests1, Skip1, Opts1)),
- case R of
- {EType,_} = Error when EType == user_error ;
+%% we must return control to the shell now, so we spawn
+%% a test supervisor process to keep an eye on the test run
+possibly_spawn(true, Tests, Skip, Opts) ->
+ CTUtilSrv = whereis(ct_util_server),
+ Supervisor =
+ fun() ->
+ process_flag(trap_exit, true),
+ link(CTUtilSrv),
+ TestRun =
+ fun() ->
+ TestResult = (catch do_run_test(Tests, Skip, Opts)),
+ case TestResult of
+ {EType,_} = Error when EType == user_error;
EType == error ->
ct_util:stop(clean),
exit(Error);
_ ->
ct_util:stop(normal),
- R
- end;
- false ->
- io:nl(),
- ct_util:stop(clean),
- BadMods =
- lists:foldr(
- fun({{_,_},Ms}, Acc) ->
- Ms ++ lists:foldl(
- fun(M, Acc1) ->
- lists:delete(M, Acc1)
- end, Acc, Ms)
- end, [], AllMakeErrors),
- {error,{make_failed,BadMods}}
- end
- end
- end.
+ exit({ok,TestResult})
+ end
+ end,
+ TestRunPid = spawn_link(TestRun),
+ receive
+ {'EXIT',TestRunPid,{ok,TestResult}} ->
+ io:format(user, "~nCommon Test returned ~p~n~n",
+ [TestResult]);
+ {'EXIT',TestRunPid,Error} ->
+ exit(Error)
+ end
+ end,
+ unlink(CTUtilSrv),
+ SupPid = spawn(Supervisor),
+ io:format(user, "~nTest control handed over to process ~p~n~n",
+ [SupPid]),
+ SupPid.
%% attempt to compile the modules specified in TestSuites
auto_compile(TestSuites) ->
@@ -1474,11 +1769,13 @@ auto_compile(TestSuites) ->
end,
SuiteMakeErrors =
lists:flatmap(fun({TestDir,Suite} = TS) ->
- case run_make(suites, TestDir, Suite, UserInclude) of
+ case run_make(suites, TestDir,
+ Suite, UserInclude) of
{error,{make_failed,Bad}} ->
[{TS,Bad}];
{error,_} ->
- [{TS,[filename:join(TestDir,"*_SUITE")]}];
+ [{TS,[filename:join(TestDir,
+ "*_SUITE")]}];
_ ->
[]
end
@@ -1517,23 +1814,29 @@ verify_suites(TestSuites) ->
{[DS|Found],NotFound};
true ->
Beam = filename:join(TestDir,
- atom_to_list(Suite)++".beam"),
+ atom_to_list(Suite)++
+ ".beam"),
case filelib:is_regular(Beam) of
true ->
{[DS|Found],NotFound};
false ->
case code:is_loaded(Suite) of
{file,SuiteFile} ->
- %% test suite is already loaded and
- %% since auto_compile == false,
+ %% test suite is already
+ %% loaded and since
+ %% auto_compile == false,
%% let's assume the user has
- %% loaded the beam file explicitly
- ActualDir = filename:dirname(SuiteFile),
- {[{ActualDir,Suite}|Found],NotFound};
+ %% loaded the beam file
+ %% explicitly
+ ActualDir =
+ filename:dirname(SuiteFile),
+ {[{ActualDir,Suite}|Found],
+ NotFound};
false ->
Name =
filename:join(TestDir,
- atom_to_list(Suite)),
+ atom_to_list(
+ Suite)),
io:format(user,
"Suite ~w not found"
"in directory ~s~n",
@@ -1551,7 +1854,8 @@ verify_suites(TestSuites) ->
ActualDir = filename:dirname(SuiteFile),
{[{ActualDir,Suite}|Found],NotFound};
false ->
- io:format(user, "Directory ~s is invalid~n", [Dir]),
+ io:format(user, "Directory ~s is "
+ "invalid~n", [Dir]),
Name = filename:join(Dir, atom_to_list(Suite)),
{Found,[{DS,[Name]}|NotFound]}
end
@@ -1565,7 +1869,8 @@ save_make_errors([]) ->
save_make_errors(Errors) ->
Suites = get_bad_suites(Errors,[]),
ct_logs:log("MAKE RESULTS",
- "Error compiling or locating the following suites: ~n~p",[Suites]),
+ "Error compiling or locating the "
+ "following suites: ~n~p",[Suites]),
%% save the info for logger
file:write_file(?missing_suites_info,term_to_binary(Errors)),
Errors.
@@ -1586,8 +1891,9 @@ step(TestDir, Suite, Case) ->
%%%-----------------------------------------------------------------
%%% @hidden
%%% @equiv ct:step/4
-step(TestDir, Suite, Case, Opts) when is_list(TestDir), is_atom(Suite), is_atom(Case),
- Suite =/= all, Case =/= all ->
+step(TestDir, Suite, Case, Opts) when is_list(TestDir),
+ is_atom(Suite), is_atom(Case),
+ Suite =/= all, Case =/= all ->
do_run([{TestDir,Suite,Case}], [{step,Opts}]).
@@ -1705,9 +2011,11 @@ continue(_MakeErrors) ->
case set_group_leader_same_as_shell() of
true ->
S = self(),
- io:format("Failed to compile or locate one or more test suites\n"
+ io:format("Failed to compile or locate one "
+ "or more test suites\n"
"Press \'c\' to continue or \'a\' to abort.\n"
- "Will continue in 15 seconds if no answer is given!\n"),
+ "Will continue in 15 seconds if no "
+ "answer is given!\n"),
Pid = spawn(fun() ->
case io:get_line('(c/a) ') of
"c\n" ->
@@ -1739,32 +2047,39 @@ set_group_leader_same_as_shell() ->
end
end,
case [P || P <- processes(), GS2or3(P),
- true == lists:keymember(shell,1,element(2,process_info(P,dictionary)))] of
+ true == lists:keymember(shell,1,
+ element(2,process_info(P,dictionary)))] of
[GL|_] ->
group_leader(GL, self());
[] ->
false
end.
-check_and_add([{TestDir0,M,_} | Tests], Added) ->
+check_and_add([{TestDir0,M,_} | Tests], Added, PA) ->
case locate_test_dir(TestDir0, M) of
{ok,TestDir} ->
case lists:member(TestDir, Added) of
true ->
- check_and_add(Tests, Added);
+ check_and_add(Tests, Added, PA);
false ->
- true = code:add_patha(TestDir),
- check_and_add(Tests, [TestDir|Added])
+ case lists:member(rm_trailing_slash(TestDir),
+ code:get_path()) of
+ false ->
+ true = code:add_patha(TestDir),
+ check_and_add(Tests, [TestDir|Added], [TestDir|PA]);
+ true ->
+ check_and_add(Tests, [TestDir|Added], PA)
+ end
end;
{error,_} ->
{error,{invalid_directory,TestDir0}}
end;
-check_and_add([], _) ->
- ok.
+check_and_add([], _, PA) ->
+ {ok,PA}.
do_run_test(Tests, Skip, Opts) ->
- case check_and_add(Tests, []) of
- ok ->
+ case check_and_add(Tests, [], []) of
+ {ok,AddedToPath} ->
ct_util:set_testdata({stats,{0,0,{0,0}}}),
ct_util:set_testdata({cover,undefined}),
test_server_ctrl:start_link(local),
@@ -1779,12 +2094,14 @@ do_run_test(Tests, Skip, Opts) ->
incl_mods = CovIncl,
cross = CovCross,
src = _CovSrc}} ->
- ct_logs:log("COVER INFO","Using cover specification file: ~s~n"
+ ct_logs:log("COVER INFO",
+ "Using cover specification file: ~s~n"
"App: ~w~n"
"Cross cover: ~w~n"
"Including ~w modules~n"
"Excluding ~w modules",
- [CovFile,CovApp,CovCross,length(CovIncl),length(CovExcl)]),
+ [CovFile,CovApp,CovCross,
+ length(CovIncl),length(CovExcl)]),
%% cover export file will be used for export and import
%% between tests so make sure it doesn't exist initially
@@ -1792,7 +2109,8 @@ do_run_test(Tests, Skip, Opts) ->
true ->
DelResult = file:delete(CovExport),
ct_logs:log("COVER INFO",
- "Warning! Export file ~s already exists. "
+ "Warning! "
+ "Export file ~s already exists. "
"Deleting with result: ~p",
[CovExport,DelResult]);
false ->
@@ -1808,7 +2126,8 @@ do_run_test(Tests, Skip, Opts) ->
%% start cover on specified nodes
if (CovNodes /= []) and (CovNodes /= undefined) ->
ct_logs:log("COVER INFO",
- "Nodes included in cover session: ~w",
+ "Nodes included in cover "
+ "session: ~w",
[CovNodes]),
cover:start(CovNodes);
true ->
@@ -1833,15 +2152,27 @@ do_run_test(Tests, Skip, Opts) ->
ct_logs:log("TEST INFO","~w test(s), ~w suite(s)",
[NoOfTests,NoOfSuites]);
true ->
- io:format("~nTEST INFO: ~w test(s), ~w case(s) in ~w suite(s)~n~n",
+ io:format("~nTEST INFO: ~w test(s), ~w case(s) "
+ "in ~w suite(s)~n~n",
[NoOfTests,NoOfCases,NoOfSuites]),
- ct_logs:log("TEST INFO","~w test(s), ~w case(s) in ~w suite(s)",
+ ct_logs:log("TEST INFO","~w test(s), ~w case(s) "
+ "in ~w suite(s)",
[NoOfTests,NoOfCases,NoOfSuites])
end,
-
+ %% if the verbosity level is set lower than ?STD_IMPORTANCE, tell
+ %% test_server to ignore stdout printouts to the test case log file
+ case proplists:get_value(default, Opts#opts.verbosity) of
+ VLvl when is_integer(VLvl), (?STD_IMPORTANCE < (100-VLvl)) ->
+ test_server_ctrl:reject_io_reqs(true);
+ _Lower ->
+ ok
+ end,
test_server_ctrl:multiply_timetraps(Opts#opts.multiply_timetraps),
test_server_ctrl:scale_timetraps(Opts#opts.scale_timetraps),
+ test_server_ctrl:create_priv_dir(choose_val(
+ Opts#opts.create_priv_dir,
+ auto_per_run)),
ct_event:notify(#event{name=start_info,
node=node(),
data={NoOfTests,NoOfSuites,NoOfCases}}),
@@ -1858,9 +2189,26 @@ do_run_test(Tests, Skip, Opts) ->
end,
lists:foreach(fun(Suite) ->
maybe_cleanup_interpret(Suite, Opts#opts.step)
- end, CleanUp);
+ end, CleanUp),
+ [code:del_path(Dir) || Dir <- AddedToPath],
+
+ %% If a severe error has occurred in the test_server,
+ %% we will generate an exception here.
+ case ct_util:get_testdata(severe_error) of
+ undefined -> ok;
+ SevereError ->
+ ct_logs:log("SEVERE ERROR", "~p\n", [SevereError]),
+ exit(SevereError)
+ end,
+
+ case ct_util:get_testdata(stats) of
+ Stats = {_Ok,_Failed,{_UserSkipped,_AutoSkipped}} ->
+ Stats;
+ _ ->
+ {error,test_result_unknown}
+ end;
Error ->
- Error
+ exit(Error)
end.
delete_dups([S | Suites]) ->
@@ -2289,7 +2637,7 @@ ct_hooks_args2opts(Args) ->
Acc
end,[],Args).
-ct_hooks_args2opts([CTH,Arg,Prio,"and"| Rest],Acc) ->
+ct_hooks_args2opts([CTH,Arg,Prio,"and"| Rest],Acc) when Arg /= "and" ->
ct_hooks_args2opts(Rest,[{list_to_atom(CTH),
parse_cth_args(Arg),
parse_cth_args(Prio)}|Acc]);
@@ -2317,7 +2665,6 @@ parse_cth_args(String) ->
String
end.
-
event_handler_args2opts(Args) ->
case proplists:get_value(event_handler, Args) of
undefined ->
@@ -2340,6 +2687,42 @@ event_handler_init_args2opts([EH, Arg]) ->
event_handler_init_args2opts([]) ->
[].
+verbosity_args2opts(Args) ->
+ case proplists:get_value(verbosity, Args) of
+ undefined ->
+ [];
+ VArgs ->
+ GetVLvls =
+ fun("and", {new,SoFar}) when is_list(SoFar) ->
+ {new,SoFar};
+ ("and", {Lvl,SoFar}) when is_list(SoFar) ->
+ {new,[{'$unspecified',list_to_integer(Lvl)} | SoFar]};
+ (CatOrLvl, {new,SoFar}) when is_list(SoFar) ->
+ {CatOrLvl,SoFar};
+ (Lvl, {Cat,SoFar}) ->
+ {new,[{list_to_atom(Cat),list_to_integer(Lvl)} | SoFar]}
+ end,
+ case lists:foldl(GetVLvls, {new,[]}, VArgs) of
+ {new,Parsed} ->
+ Parsed;
+ {Lvl,Parsed} ->
+ [{'$unspecified',list_to_integer(Lvl)} | Parsed]
+ end
+ end.
+
+add_verbosity_defaults(VLvls) ->
+ case {proplists:get_value('$unspecified', VLvls),
+ proplists:get_value(default, VLvls)} of
+ {undefined,undefined} ->
+ ?default_verbosity ++ VLvls;
+ {Lvl,undefined} ->
+ [{default,Lvl} | VLvls];
+ {undefined,_Lvl} ->
+ [{'$unspecified',?MAX_VERBOSITY} | VLvls];
+ _ ->
+ VLvls
+ end.
+
%% This function reads pa and pz arguments, converts dirs from relative
%% to absolute, and re-inserts them in the code path. The order of the
%% dirs in the code path remain the same. Note however that since this
@@ -2347,31 +2730,38 @@ event_handler_init_args2opts([]) ->
%% relative dirs "post run_test erl_args" is not kept!
rel_to_abs(CtArgs) ->
{PA,PZ} = get_pa_pz(CtArgs, [], []),
- io:format(user, "~n", []),
[begin
- code:del_path(filename:basename(D)),
- Abs = filename:absname(D),
- code:add_pathz(Abs),
- if D /= Abs ->
+ Dir = rm_trailing_slash(D),
+ Abs = make_abs(Dir),
+ if Dir /= Abs ->
+ code:del_path(Dir),
+ code:del_path(Abs),
io:format(user, "Converting ~p to ~p and re-inserting "
"with add_pathz/1~n",
- [D, Abs]);
+ [Dir, Abs]);
true ->
- ok
- end
+ code:del_path(Dir)
+ end,
+ code:add_pathz(Abs)
end || D <- PZ],
[begin
- code:del_path(filename:basename(D)),
- Abs = filename:absname(D),
- code:add_patha(Abs),
- if D /= Abs ->
+ Dir = rm_trailing_slash(D),
+ Abs = make_abs(Dir),
+ if Dir /= Abs ->
+ code:del_path(Dir),
+ code:del_path(Abs),
io:format(user, "Converting ~p to ~p and re-inserting "
"with add_patha/1~n",
- [D, Abs]);
- true ->ok
- end
+ [Dir, Abs]);
+ true ->
+ code:del_path(Dir)
+ end,
+ code:add_patha(Abs)
end || D <- PA],
- io:format(user, "~n", []).
+ io:format(user, "~n", []).
+
+rm_trailing_slash(Dir) ->
+ filename:join(filename:split(Dir)).
get_pa_pz([{pa,Dirs} | Args], PA, PZ) ->
get_pa_pz(Args, PA ++ Dirs, PZ);
@@ -2382,11 +2772,30 @@ get_pa_pz([_ | Args], PA, PZ) ->
get_pa_pz([], PA, PZ) ->
{PA,PZ}.
+make_abs(RelDir) ->
+ Tokens = filename:split(filename:absname(RelDir)),
+ filename:join(lists:reverse(make_abs1(Tokens, []))).
+
+make_abs1([".."|Dirs], [_Dir|Path]) ->
+ make_abs1(Dirs, Path);
+make_abs1(["."|Dirs], Path) ->
+ make_abs1(Dirs, Path);
+make_abs1([Dir|Dirs], Path) ->
+ make_abs1(Dirs, [Dir|Path]);
+make_abs1([], Path) ->
+ Path.
+
%% This function translates ct:run_test/1 start options
%% to ct_run start arguments (on the init arguments format) -
%% this is useful mainly for testing the ct_run start functions.
opts2args(EnvStartOpts) ->
- lists:flatmap(fun({config,CfgFiles}) ->
+ lists:flatmap(fun({exit_status,ExitStatusOpt}) when is_atom(ExitStatusOpt) ->
+ [{exit_status,[atom_to_list(ExitStatusOpt)]}];
+ ({halt_with,{HaltM,HaltF}}) ->
+ [{halt_with,[atom_to_list(HaltM),atom_to_list(HaltF)]}];
+ ({interactive_mode,true}) ->
+ [{shell,[]}];
+ ({config,CfgFiles}) ->
[{ct_config,[CfgFiles]}];
({userconfig,{CBM,CfgStr=[X|_]}}) when is_integer(X) ->
[{userconfig,[atom_to_list(CBM),CfgStr]}];
@@ -2394,10 +2803,14 @@ opts2args(EnvStartOpts) ->
[{userconfig,[atom_to_list(CBM) | CfgStrs]}];
({userconfig,UserCfg}) when is_list(UserCfg) ->
Strs =
- lists:map(fun({CBM,CfgStr=[X|_]}) when is_integer(X) ->
- [atom_to_list(CBM),CfgStr,"and"];
- ({CBM,CfgStrs}) when is_list(CfgStrs) ->
- [atom_to_list(CBM) | CfgStrs] ++ ["and"]
+ lists:map(fun({CBM,CfgStr=[X|_]})
+ when is_integer(X) ->
+ [atom_to_list(CBM),
+ CfgStr,"and"];
+ ({CBM,CfgStrs})
+ when is_list(CfgStrs) ->
+ [atom_to_list(CBM) | CfgStrs] ++
+ ["and"]
end, UserCfg),
[_LastAnd|StrsR] = lists:reverse(lists:flatten(Strs)),
[{userconfig,lists:reverse(StrsR)}];
@@ -2419,6 +2832,10 @@ opts2args(EnvStartOpts) ->
[{scale_timetraps,[]}];
({scale_timetraps,false}) ->
[];
+ ({create_priv_dir,auto_per_run}) ->
+ [];
+ ({create_priv_dir,PD}) when is_atom(PD) ->
+ [{create_priv_dir,[atom_to_list(PD)]}];
({force_stop,true}) ->
[{force_stop,[]}];
({force_stop,false}) ->
@@ -2428,7 +2845,7 @@ opts2args(EnvStartOpts) ->
({decrypt,{file,File}}) ->
[{ct_decrypt_file,[File]}];
({basic_html,true}) ->
- ({basic_html,[]});
+ [{basic_html,[]}];
({basic_html,false}) ->
[];
({event_handler,EH}) when is_atom(EH) ->
@@ -2441,12 +2858,32 @@ opts2args(EnvStartOpts) ->
({event_handler,{EHs,Arg}}) when is_list(EHs) ->
ArgStr = lists:flatten(io_lib:format("~p", [Arg])),
Strs = lists:map(fun(EH) ->
- [atom_to_list(EH),ArgStr,"and"]
+ [atom_to_list(EH),
+ ArgStr,"and"]
end, EHs),
[_LastAnd|StrsR] = lists:reverse(lists:flatten(Strs)),
[{event_handler_init,lists:reverse(StrsR)}];
({logopts,LOs}) when is_list(LOs) ->
[{logopts,[atom_to_list(LO) || LO <- LOs]}];
+ ({verbosity,?default_verbosity}) ->
+ [];
+ ({verbosity,VLvl}) when is_integer(VLvl) ->
+ [{verbosity,[integer_to_list(VLvl)]}];
+ ({verbosity,VLvls}) when is_list(VLvls) ->
+ VLvlArgs =
+ lists:flatmap(fun({'$unspecified',Lvl}) ->
+ [integer_to_list(Lvl),
+ "and"];
+ ({Cat,Lvl}) ->
+ [atom_to_list(Cat),
+ integer_to_list(Lvl),
+ "and"];
+ (Lvl) ->
+ [integer_to_list(Lvl),
+ "and"]
+ end, VLvls),
+ [_LastAnd|VLvlArgsR] = lists:reverse(VLvlArgs),
+ [{verbosity,lists:reverse(VLvlArgsR)}];
({ct_hooks,[]}) ->
[];
({ct_hooks,CTHs}) when is_list(CTHs) ->
diff --git a/lib/common_test/src/ct_snmp.erl b/lib/common_test/src/ct_snmp.erl
index 8fe63e8ed1..71038bd4f4 100644
--- a/lib/common_test/src/ct_snmp.erl
+++ b/lib/common_test/src/ct_snmp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -39,7 +39,7 @@
%%% %%% Manager config
%%% [{start_manager, boolean()} % Optional - default is true
%%% {users, [{user_name(), [call_back_module(), user_data()]}]}, %% Optional
-%%% {usm_users, [{usm_user_name(), usm_config()}]},%% Optional - snmp v3 only
+%%% {usm_users, [{usm_user_name(), [usm_config()]}]},%% Optional - snmp v3 only
%%% % managed_agents is optional
%%% {managed_agents,[{agent_name(), [user_name(), agent_ip(), agent_port(), [agent_config()]]}]},
%%% {max_msg_size, integer()}, % Optional - default is 484
@@ -130,7 +130,7 @@
%%% @type agent_config() = {Item, Value}
%%% @type user_name() = atom()
%%% @type usm_user_name() = string()
-%%% @type usm_config() = string()
+%%% @type usm_config() = {Item, Value}
%%% @type call_back_module() = atom()
%%% @type user_data() = term()
%%% @type oids() = [oid()]
@@ -157,8 +157,9 @@
%%% API
-export([start/2, start/3, stop/1, get_values/3, get_next_values/3, set_values/4,
set_info/1, register_users/2, register_agents/2, register_usm_users/2,
- unregister_users/1, unregister_agents/1, update_usm_users/2,
- load_mibs/1]).
+ unregister_users/1, unregister_users/2, unregister_agents/1,
+ unregister_agents/2, unregister_usm_users/1, unregister_usm_users/2,
+ load_mibs/1, unload_mibs/1]).
%% Manager values
-define(CT_SNMP_LOG_FILE, "ct_snmp_set.log").
@@ -250,10 +251,8 @@ stop(Config) ->
%%%
%%% @doc Issues a synchronous snmp get request.
get_values(Agent, Oids, MgrAgentConfName) ->
- [Uid, AgentIp, AgentUdpPort | _] =
- agent_conf(Agent, MgrAgentConfName),
- {ok, SnmpReply, _} =
- snmpm:g(Uid, AgentIp, AgentUdpPort, Oids),
+ [Uid | _] = agent_conf(Agent, MgrAgentConfName),
+ {ok, SnmpReply, _} = snmpm:sync_get2(Uid, target_name(Agent), Oids),
SnmpReply.
%%% @spec get_next_values(Agent, Oids, MgrAgentConfName) -> SnmpReply
@@ -265,10 +264,8 @@ get_values(Agent, Oids, MgrAgentConfName) ->
%%%
%%% @doc Issues a synchronous snmp get next request.
get_next_values(Agent, Oids, MgrAgentConfName) ->
- [Uid, AgentIp, AgentUdpPort | _] =
- agent_conf(Agent, MgrAgentConfName),
- {ok, SnmpReply, _} =
- snmpm:gn(Uid, AgentIp, AgentUdpPort, Oids),
+ [Uid | _] = agent_conf(Agent, MgrAgentConfName),
+ {ok, SnmpReply, _} = snmpm:sync_get_next2(Uid, target_name(Agent), Oids),
SnmpReply.
%%% @spec set_values(Agent, VarsAndVals, MgrAgentConfName, Config) -> SnmpReply
@@ -282,13 +279,11 @@ get_next_values(Agent, Oids, MgrAgentConfName) ->
%%% @doc Issues a synchronous snmp set request.
set_values(Agent, VarsAndVals, MgrAgentConfName, Config) ->
PrivDir = ?config(priv_dir, Config),
- [Uid, AgentIp, AgentUdpPort | _] =
- agent_conf(Agent, MgrAgentConfName),
+ [Uid | _] = agent_conf(Agent, MgrAgentConfName),
Oids = lists:map(fun({Oid, _, _}) -> Oid end, VarsAndVals),
- {ok, SnmpGetReply, _} =
- snmpm:g(Uid, AgentIp, AgentUdpPort, Oids),
- {ok, SnmpSetReply, _} =
- snmpm:s(Uid, AgentIp, AgentUdpPort, VarsAndVals),
+ TargetName = target_name(Agent),
+ {ok, SnmpGetReply, _} = snmpm:sync_get2(Uid, TargetName, Oids),
+ {ok, SnmpSetReply, _} = snmpm:sync_set2(Uid, TargetName, VarsAndVals),
case SnmpSetReply of
{noError, 0, _} when PrivDir /= false ->
log(PrivDir, Agent, SnmpGetReply, VarsAndVals);
@@ -328,12 +323,23 @@ set_info(Config) ->
%%% Reason = term()
%%%
%%% @doc Register the manager entity (=user) responsible for specific agent(s).
-%%% Corresponds to making an entry in users.conf
+%%% Corresponds to making an entry in users.conf.
+%%%
+%%% This function will try to register the given users, without
+%%% checking if any of them already exist. In order to change an
+%%% already registered user, the user must first be unregistered.
register_users(MgrAgentConfName, Users) ->
- {snmp, SnmpVals} = ct:get_config(MgrAgentConfName),
- NewSnmpVals = lists:keyreplace(users, 1, SnmpVals, {users, Users}),
- ct_config:update_config(MgrAgentConfName, {snmp, NewSnmpVals}),
- setup_users(Users).
+ case setup_users(Users) of
+ ok ->
+ SnmpVals = ct:get_config(MgrAgentConfName),
+ OldUsers = ct:get_config({MgrAgentConfName,users},[]),
+ NewSnmpVals = lists:keystore(users, 1, SnmpVals,
+ {users, Users ++ OldUsers}),
+ ct_config:update_config(MgrAgentConfName, NewSnmpVals),
+ ok;
+ Error ->
+ Error
+ end.
%%% @spec register_agents(MgrAgentConfName, ManagedAgents) -> ok | {error, Reason}
%%%
@@ -343,12 +349,24 @@ register_users(MgrAgentConfName, Users) ->
%%%
%%% @doc Explicitly instruct the manager to handle this agent.
%%% Corresponds to making an entry in agents.conf
+%%%
+%%% This function will try to register the given managed agents,
+%%% without checking if any of them already exist. In order to change
+%%% an already registered managed agent, the agent must first be
+%%% unregistered.
register_agents(MgrAgentConfName, ManagedAgents) ->
- {snmp, SnmpVals} = ct:get_config(MgrAgentConfName),
- NewSnmpVals = lists:keyreplace(managed_agents, 1, SnmpVals,
- {managed_agents, ManagedAgents}),
- ct_config:update_config(MgrAgentConfName, {snmp, NewSnmpVals}),
- setup_managed_agents(ManagedAgents).
+ case setup_managed_agents(MgrAgentConfName,ManagedAgents) of
+ ok ->
+ SnmpVals = ct:get_config(MgrAgentConfName),
+ OldAgents = ct:get_config({MgrAgentConfName,managed_agents},[]),
+ NewSnmpVals = lists:keystore(managed_agents, 1, SnmpVals,
+ {managed_agents,
+ ManagedAgents ++ OldAgents}),
+ ct_config:update_config(MgrAgentConfName, NewSnmpVals),
+ ok;
+ Error ->
+ Error
+ end.
%%% @spec register_usm_users(MgrAgentConfName, UsmUsers) -> ok | {error, Reason}
%%%
@@ -358,60 +376,115 @@ register_agents(MgrAgentConfName, ManagedAgents) ->
%%%
%%% @doc Explicitly instruct the manager to handle this USM user.
%%% Corresponds to making an entry in usm.conf
+%%%
+%%% This function will try to register the given users, without
+%%% checking if any of them already exist. In order to change an
+%%% already registered user, the user must first be unregistered.
register_usm_users(MgrAgentConfName, UsmUsers) ->
- {snmp, SnmpVals} = ct:get_config(MgrAgentConfName),
- NewSnmpVals = lists:keyreplace(users, 1, SnmpVals, {usm_users, UsmUsers}),
- ct_config:update_config(MgrAgentConfName, {snmp, NewSnmpVals}),
EngineID = ct:get_config({MgrAgentConfName, engine_id}, ?ENGINE_ID),
- setup_usm_users(UsmUsers, EngineID).
+ case setup_usm_users(UsmUsers, EngineID) of
+ ok ->
+ SnmpVals = ct:get_config(MgrAgentConfName),
+ OldUsmUsers = ct:get_config({MgrAgentConfName,usm_users},[]),
+ NewSnmpVals = lists:keystore(usm_users, 1, SnmpVals,
+ {usm_users, UsmUsers ++ OldUsmUsers}),
+ ct_config:update_config(MgrAgentConfName, NewSnmpVals),
+ ok;
+ Error ->
+ Error
+ end.
-%%% @spec unregister_users(MgrAgentConfName) -> ok | {error, Reason}
+%%% @spec unregister_users(MgrAgentConfName) -> ok
%%%
%%% MgrAgentConfName = atom()
%%% Reason = term()
%%%
-%%% @doc Removes information added when calling register_users/2.
+%%% @doc Unregister all users.
unregister_users(MgrAgentConfName) ->
- Users = lists:map(fun({UserName, _}) -> UserName end,
- ct:get_config({MgrAgentConfName, users})),
- {snmp, SnmpVals} = ct:get_config(MgrAgentConfName),
- NewSnmpVals = lists:keyreplace(users, 1, SnmpVals, {users, []}),
- ct_config:update_config(MgrAgentConfName, {snmp, NewSnmpVals}),
- takedown_users(Users).
+ Users = [Id || {Id,_} <- ct:get_config({MgrAgentConfName, users},[])],
+ unregister_users(MgrAgentConfName,Users).
-%%% @spec unregister_agents(MgrAgentConfName) -> ok | {error, Reason}
+%%% @spec unregister_users(MgrAgentConfName,Users) -> ok
%%%
%%% MgrAgentConfName = atom()
+%%% Users = [user_name()]
%%% Reason = term()
%%%
-%%% @doc Removes information added when calling register_agents/2.
+%%% @doc Unregister the given users.
+unregister_users(MgrAgentConfName,Users) ->
+ takedown_users(Users),
+ SnmpVals = ct:get_config(MgrAgentConfName),
+ AllUsers = ct:get_config({MgrAgentConfName, users},[]),
+ RemainingUsers = lists:filter(fun({Id,_}) ->
+ not lists:member(Id,Users)
+ end,
+ AllUsers),
+ NewSnmpVals = lists:keyreplace(users, 1, SnmpVals, {users,RemainingUsers}),
+ ct_config:update_config(MgrAgentConfName, NewSnmpVals),
+ ok.
+
+%%% @spec unregister_agents(MgrAgentConfName) -> ok
+%%%
+%%% MgrAgentConfName = atom()
+%%% Reason = term()
+%%%
+%%% @doc Unregister all managed agents.
unregister_agents(MgrAgentConfName) ->
- ManagedAgents = lists:map(fun({_, [Uid, AgentIP, AgentPort, _]}) ->
- {Uid, AgentIP, AgentPort}
- end,
- ct:get_config({MgrAgentConfName, managed_agents})),
- {snmp, SnmpVals} = ct:get_config(MgrAgentConfName),
- NewSnmpVals = lists:keyreplace(managed_agents, 1, SnmpVals,
- {managed_agents, []}),
- ct_config:update_config(MgrAgentConfName, {snmp, NewSnmpVals}),
- takedown_managed_agents(ManagedAgents).
+ ManagedAgents = [AgentName ||
+ {AgentName, _} <-
+ ct:get_config({MgrAgentConfName,managed_agents},[])],
+ unregister_agents(MgrAgentConfName,ManagedAgents).
+%%% @spec unregister_agents(MgrAgentConfName,ManagedAgents) -> ok
+%%%
+%%% MgrAgentConfName = atom()
+%%% ManagedAgents = [agent_name()]
+%%% Reason = term()
+%%%
+%%% @doc Unregister the given managed agents.
+unregister_agents(MgrAgentConfName,ManagedAgents) ->
+ takedown_managed_agents(MgrAgentConfName, ManagedAgents),
+ SnmpVals = ct:get_config(MgrAgentConfName),
+ AllAgents = ct:get_config({MgrAgentConfName,managed_agents},[]),
+ RemainingAgents = lists:filter(fun({Name,_}) ->
+ not lists:member(Name,ManagedAgents)
+ end,
+ AllAgents),
+ NewSnmpVals = lists:keyreplace(managed_agents, 1, SnmpVals,
+ {managed_agents,RemainingAgents}),
+ ct_config:update_config(MgrAgentConfName, NewSnmpVals),
+ ok.
-%%% @spec update_usm_users(MgrAgentConfName, UsmUsers) -> ok | {error, Reason}
+%%% @spec unregister_usm_users(MgrAgentConfName) -> ok
%%%
%%% MgrAgentConfName = atom()
-%%% UsmUsers = usm_users()
%%% Reason = term()
%%%
-%%% @doc Alters information added when calling register_usm_users/2.
-update_usm_users(MgrAgentConfName, UsmUsers) ->
-
- {snmp, SnmpVals} = ct:get_config(MgrAgentConfName),
- NewSnmpVals = lists:keyreplace(usm_users, 1, SnmpVals,
- {usm_users, UsmUsers}),
- ct_config:update_config(MgrAgentConfName, {snmp, NewSnmpVals}),
+%%% @doc Unregister all usm users.
+unregister_usm_users(MgrAgentConfName) ->
+ UsmUsers = [Id || {Id,_} <- ct:get_config({MgrAgentConfName, usm_users},[])],
+ unregister_usm_users(MgrAgentConfName,UsmUsers).
+
+%%% @spec unregister_usm_users(MgrAgentConfName,UsmUsers) -> ok
+%%%
+%%% MgrAgentConfName = atom()
+%%% UsmUsers = [usm_user_name()]
+%%% Reason = term()
+%%%
+%%% @doc Unregister the given usm users.
+unregister_usm_users(MgrAgentConfName,UsmUsers) ->
EngineID = ct:get_config({MgrAgentConfName, engine_id}, ?ENGINE_ID),
- do_update_usm_users(UsmUsers, EngineID).
+ takedown_usm_users(UsmUsers,EngineID),
+ SnmpVals = ct:get_config(MgrAgentConfName),
+ AllUsmUsers = ct:get_config({MgrAgentConfName, usm_users},[]),
+ RemainingUsmUsers = lists:filter(fun({Id,_}) ->
+ not lists:member(Id,UsmUsers)
+ end,
+ AllUsmUsers),
+ NewSnmpVals = lists:keyreplace(usm_users, 1, SnmpVals,
+ {usm_users,RemainingUsmUsers}),
+ ct_config:update_config(MgrAgentConfName, NewSnmpVals),
+ ok.
%%% @spec load_mibs(Mibs) -> ok | {error, Reason}
%%%
@@ -423,6 +496,15 @@ update_usm_users(MgrAgentConfName, UsmUsers) ->
load_mibs(Mibs) ->
snmpa:load_mibs(snmp_master_agent, Mibs).
+%%% @spec unload_mibs(Mibs) -> ok | {error, Reason}
+%%%
+%%% Mibs = [MibName]
+%%% MibName = string()
+%%% Reason = term()
+%%%
+%%% @doc Unload the mibs from the agent 'snmp_master_agent'.
+unload_mibs(Mibs) ->
+ snmpa:unload_mibs(snmp_master_agent, Mibs).
%%%========================================================================
%%% Internal functions
@@ -486,9 +568,8 @@ setup_agent(true, AgentConfName, SnmpConfName,
file:make_dir(DbDir),
snmp_config:write_agent_snmp_files(ConfDir, Vsns, ManagerIP, TrapUdp,
AgentIP, AgentUdp, SysName,
- atom_to_list(NotifType),
- SecType, Passwd, AgentEngineID,
- AgentMaxMsgSize),
+ NotifType, SecType, Passwd,
+ AgentEngineID, AgentMaxMsgSize),
override_default_configuration(Config, AgentConfName),
@@ -497,7 +578,8 @@ setup_agent(true, AgentConfName, SnmpConfName,
{verbosity, trace}]},
{agent_type, master},
{agent_verbosity, trace},
- {net_if, [{verbosity, trace}]}],
+ {net_if, [{verbosity, trace}]},
+ {versions, Vsns}],
ct:get_config({SnmpConfName,agent})),
application:set_env(snmp, agent, SnmpEnv).
%%%---------------------------------------------------------------------------
@@ -535,65 +617,61 @@ manager_register(true, MgrAgentConfName) ->
setup_usm_users(UsmUsers, EngineID),
setup_users(Users),
- setup_managed_agents(Agents).
+ setup_managed_agents(MgrAgentConfName,Agents).
%%%---------------------------------------------------------------------------
setup_users(Users) ->
- lists:foreach(fun({Id, [Module, Data]}) ->
- snmpm:register_user(Id, Module, Data)
- end, Users).
+ while_ok(fun({Id, [Module, Data]}) ->
+ snmpm:register_user(Id, Module, Data)
+ end, Users).
%%%---------------------------------------------------------------------------
-setup_managed_agents([]) ->
- ok;
-
-setup_managed_agents([{_, [Uid, AgentIp, AgentUdpPort, AgentConf]} |
- Rest]) ->
- NewAgentIp = case AgentIp of
- IpTuple when is_tuple(IpTuple) ->
- IpTuple;
- HostName when is_list(HostName) ->
- {ok,Hostent} = inet:gethostbyname(HostName),
- [IpTuple|_] = Hostent#hostent.h_addr_list,
- IpTuple
- end,
- ok = snmpm:register_agent(Uid, NewAgentIp, AgentUdpPort),
- lists:foreach(fun({Item, Val}) ->
- snmpm:update_agent_info(Uid, NewAgentIp,
- AgentUdpPort, Item, Val)
- end, AgentConf),
- setup_managed_agents(Rest).
+setup_managed_agents(AgentConfName,Agents) ->
+ Fun =
+ fun({AgentName, [Uid, AgentIp, AgentUdpPort, AgentConf0]}) ->
+ NewAgentIp = case AgentIp of
+ IpTuple when is_tuple(IpTuple) ->
+ IpTuple;
+ HostName when is_list(HostName) ->
+ {ok,Hostent} = inet:gethostbyname(HostName),
+ [IpTuple|_] = Hostent#hostent.h_addr_list,
+ IpTuple
+ end,
+ AgentConf =
+ case lists:keymember(engine_id,1,AgentConf0) of
+ true ->
+ AgentConf0;
+ false ->
+ DefaultEngineID =
+ ct:get_config({AgentConfName,agent_engine_id},
+ ?AGENT_ENGINE_ID),
+ [{engine_id,DefaultEngineID}|AgentConf0]
+ end,
+ snmpm:register_agent(Uid, target_name(AgentName),
+ [{address,NewAgentIp},{port,AgentUdpPort} |
+ AgentConf])
+ end,
+ while_ok(Fun,Agents).
%%%---------------------------------------------------------------------------
setup_usm_users(UsmUsers, EngineID)->
- lists:foreach(fun({UsmUser, Conf}) ->
- snmpm:register_usm_user(EngineID, UsmUser, Conf)
- end, UsmUsers).
+ while_ok(fun({UsmUser, Conf}) ->
+ snmpm:register_usm_user(EngineID, UsmUser, Conf)
+ end, UsmUsers).
%%%---------------------------------------------------------------------------
takedown_users(Users) ->
- lists:foreach(fun({Id}) ->
+ lists:foreach(fun(Id) ->
snmpm:unregister_user(Id)
end, Users).
%%%---------------------------------------------------------------------------
-takedown_managed_agents([{Uid, AgentIp, AgentUdpPort} |
- Rest]) ->
- NewAgentIp = case AgentIp of
- IpTuple when is_tuple(IpTuple) ->
- IpTuple;
- HostName when is_list(HostName) ->
- {ok,Hostent} = inet:gethostbyname(HostName),
- [IpTuple|_] = Hostent#hostent.h_addr_list,
- IpTuple
- end,
- ok = snmpm:unregister_agent(Uid, NewAgentIp, AgentUdpPort),
- takedown_managed_agents(Rest);
-
-takedown_managed_agents([]) ->
- ok.
+takedown_managed_agents(MgrAgentConfName,ManagedAgents) ->
+ lists:foreach(fun(AgentName) ->
+ [Uid | _] = agent_conf(AgentName, MgrAgentConfName),
+ snmpm:unregister_agent(Uid, target_name(AgentName))
+ end, ManagedAgents).
%%%---------------------------------------------------------------------------
-do_update_usm_users(UsmUsers, EngineID) ->
- lists:foreach(fun({UsmUser, {Item, Val}}) ->
- snmpm:update_usm_user_info(EngineID, UsmUser,
- Item, Val)
- end, UsmUsers).
+takedown_usm_users(UsmUsers, EngineID) ->
+ lists:foreach(fun(Id) ->
+ snmpm:unregister_usm_user(EngineID, Id)
+ end, UsmUsers).
%%%---------------------------------------------------------------------------
log(PrivDir, Agent, {_, _, Varbinds}, NewVarsAndVals) ->
@@ -657,7 +735,7 @@ override_contexts(Config, {data_dir_file, File}) ->
override_contexts(Config, ContextInfo);
override_contexts(Config, Contexts) ->
- Dir = ?config(priv_dir, Config),
+ Dir = filename:join(?config(priv_dir, Config),"conf"),
File = filename:join(Dir,"context.conf"),
file:delete(File),
snmp_config:write_agent_context_config(Dir, "", Contexts).
@@ -673,7 +751,7 @@ override_sysinfo(Config, {data_dir_file, File}) ->
override_sysinfo(Config, SysInfo);
override_sysinfo(Config, SysInfo) ->
- Dir = ?config(priv_dir, Config),
+ Dir = filename:join(?config(priv_dir, Config),"conf"),
File = filename:join(Dir,"standard.conf"),
file:delete(File),
snmp_config:write_agent_standard_config(Dir, "", SysInfo).
@@ -688,7 +766,7 @@ override_target_address(Config, {data_dir_file, File}) ->
override_target_address(Config, TargetAddressConf);
override_target_address(Config, TargetAddressConf) ->
- Dir = ?config(priv_dir, Config),
+ Dir = filename:join(?config(priv_dir, Config),"conf"),
File = filename:join(Dir,"target_addr.conf"),
file:delete(File),
snmp_config:write_agent_target_addr_config(Dir, "", TargetAddressConf).
@@ -704,7 +782,7 @@ override_target_params(Config, {data_dir_file, File}) ->
override_target_params(Config, TargetParamsConf);
override_target_params(Config, TargetParamsConf) ->
- Dir = ?config(priv_dir, Config),
+ Dir = filename:join(?config(priv_dir, Config),"conf"),
File = filename:join(Dir,"target_params.conf"),
file:delete(File),
snmp_config:write_agent_target_params_config(Dir, "", TargetParamsConf).
@@ -719,7 +797,7 @@ override_notify(Config, {data_dir_file, File}) ->
override_notify(Config, NotifyConf);
override_notify(Config, NotifyConf) ->
- Dir = ?config(priv_dir, Config),
+ Dir = filename:join(?config(priv_dir, Config),"conf"),
File = filename:join(Dir,"notify.conf"),
file:delete(File),
snmp_config:write_agent_notify_config(Dir, "", NotifyConf).
@@ -734,7 +812,7 @@ override_usm(Config, {data_dir_file, File}) ->
override_usm(Config, UsmConf);
override_usm(Config, UsmConf) ->
- Dir = ?config(priv_dir, Config),
+ Dir = filename:join(?config(priv_dir, Config),"conf"),
File = filename:join(Dir,"usm.conf"),
file:delete(File),
snmp_config:write_agent_usm_config(Dir, "", UsmConf).
@@ -749,7 +827,7 @@ override_community(Config, {data_dir_file, File}) ->
override_community(Config, CommunityConf);
override_community(Config, CommunityConf) ->
- Dir = ?config(priv_dir, Config),
+ Dir = filename:join(?config(priv_dir, Config),"conf"),
File = filename:join(Dir,"community.conf"),
file:delete(File),
snmp_config:write_agent_community_config(Dir, "", CommunityConf).
@@ -765,7 +843,20 @@ override_vacm(Config, {data_dir_file, File}) ->
override_vacm(Config, VacmConf);
override_vacm(Config, VacmConf) ->
- Dir = ?config(priv_dir, Config),
- File = filename:join(Dir,"vacm.conf"),
+ Dir = filename:join(?config(priv_dir, Config),"conf"),
+ File = filename:join(Dir,"vacm.conf"),
file:delete(File),
snmp_config:write_agent_vacm_config(Dir, "", VacmConf).
+
+%%%---------------------------------------------------------------------------
+
+target_name(Agent) ->
+ atom_to_list(Agent).
+
+while_ok(Fun,[H|T]) ->
+ case Fun(H) of
+ ok -> while_ok(Fun,T);
+ Error -> Error
+ end;
+while_ok(_Fun,[]) ->
+ ok.
diff --git a/lib/common_test/src/ct_ssh.erl b/lib/common_test/src/ct_ssh.erl
index aebb28bc42..c6ea27b10e 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -133,10 +133,11 @@ connect(KeyOrName, ExtraOpts) when is_list(ExtraOpts) ->
%%% is used to identify the connection, this name may
%%% be used as connection reference for subsequent calls.
%%% It's only possible to have one open connection at a time
-%%% associated with <code>Name</code>. If <code>Key</code> is
+%%% associated with <code>Name</code>. If <code>Key</code> is
%%% used, the returned handle must be used for subsequent calls
%%% (multiple connections may be opened using the config
-%%% data specified by <code>Key</code>).</p>
+%%% data specified by <code>Key</code>). See <c>ct:require/2</c>
+%%% for how to create a new <c>Name</c></p>
%%%
%%% <p><code>ConnType</code> will always override the type
%%% specified in the address tuple in the configuration data (and
@@ -152,6 +153,8 @@ connect(KeyOrName, ExtraOpts) when is_list(ExtraOpts) ->
%%% The extra options will override any existing options with the
%%% same key in the config data. For details on valid SSH
%%% options, see the documentation for the OTP ssh application.</p>
+%%%
+%%% @see ct:require/2
connect(KeyOrName, ConnType, ExtraOpts) ->
case ct:get_config(KeyOrName) of
undefined ->
@@ -182,19 +185,22 @@ connect(KeyOrName, ConnType, ExtraOpts) ->
undefined ->
{ssh,undefined,AllOpts};
SFTPAddr ->
- log(heading(connect,KeyOrName),
- "Note: Opening ssh connection to sftp host.\n",
+ try_log(heading(connect,KeyOrName),
+ "Note: Opening ssh connection "
+ "to sftp host.\n",
[]),
{ssh,SFTPAddr,
- [{ssh,SFTPAddr}|proplists:delete(sftp, AllOpts)]}
+ [{ssh,SFTPAddr} |
+ proplists:delete(sftp, AllOpts)]}
end;
undefined when ConnType == sftp ->
case proplists:get_value(ssh, AllOpts) of
undefined ->
{sftp,undefined,AllOpts};
SSHAddr ->
- log(heading(connect,KeyOrName),
- "Note: Opening sftp connection to ssh host.\n",
+ try_log(heading(connect,KeyOrName),
+ "Note: Opening sftp connection "
+ "to ssh host.\n",
[]),
{sftp,SSHAddr,
[{sftp,SSHAddr}|proplists:delete(ssh, AllOpts)]}
@@ -209,15 +215,15 @@ connect(KeyOrName, ConnType, ExtraOpts) ->
[{not_available,{KeyOrName,ConnType1}}]),
{error,{not_available,{KeyOrName,ConnType1}}};
{_,undefined} ->
- log(heading(connect,KeyOrName),
- "Opening ~w connection to ~p:22\n",
- [ConnType1,Addr]),
+ try_log(heading(connect,KeyOrName),
+ "Opening ~w connection to ~p:22\n",
+ [ConnType1,Addr]),
ct_gen_conn:start(KeyOrName, {ConnType1,Addr,22},
AllOpts1, ?MODULE);
{_,Port} ->
- log(heading(connect,KeyOrName),
- "Opening ~w connection to ~p:~w\n",
- [ConnType1,Addr,Port]),
+ try_log(heading(connect,KeyOrName),
+ "Opening ~w connection to ~p:~w\n",
+ [ConnType1,Addr,Port]),
ct_gen_conn:start(KeyOrName, {ConnType1,Addr,Port},
AllOpts1, ?MODULE)
end
@@ -232,7 +238,7 @@ connect(KeyOrName, ConnType, ExtraOpts) ->
disconnect(SSH) ->
case get_handle(SSH) of
{ok,Pid} ->
- log(heading(disconnect,SSH), "Handle: ~p", [Pid]),
+ try_log(heading(disconnect,SSH), "Handle: ~p", [Pid], 5000),
case ct_gen_conn:stop(Pid) of
{error,{process_down,Pid,noproc}} ->
{error,already_closed};
@@ -968,8 +974,9 @@ init(KeyOrName, {ConnType,Addr,Port}, AllOpts) ->
Error;
Ok ->
SSHRef = element(2, Ok),
- log(heading(init,KeyOrName),
- "Opened ~w connection:\nHost: ~p (~p)\nUser: ~p\nPassword: ~p\n",
+ try_log(heading(init,KeyOrName),
+ "Opened ~w connection:\n"
+ "Host: ~p (~p)\nUser: ~p\nPassword: ~p\n",
[ConnType,Addr,Port,User,lists:duplicate(length(Password),$*)]),
{ok,SSHRef,#state{ssh_ref=SSHRef, conn_type=ConnType,
target=KeyOrName}}
@@ -978,25 +985,26 @@ init(KeyOrName, {ConnType,Addr,Port}, AllOpts) ->
%% @hidden
handle_msg(sftp_connect, State) ->
#state{ssh_ref=SSHRef, target=Target} = State,
- log(heading(sftp_connect,Target), "SSH Ref: ~p", [SSHRef]),
+ try_log(heading(sftp_connect,Target), "SSH Ref: ~p", [SSHRef]),
{ssh_sftp:start_channel(SSHRef),State};
handle_msg({session_open,TO}, State) ->
#state{ssh_ref=SSHRef, target=Target} = State,
- log(heading(session_open,Target), "SSH Ref: ~p, Timeout: ~p", [SSHRef,TO]),
+ try_log(heading(session_open,Target), "SSH Ref: ~p, Timeout: ~p",
+ [SSHRef,TO]),
{ssh_connection:session_channel(SSHRef, TO),State};
handle_msg({session_close,Chn}, State) ->
#state{ssh_ref=SSHRef, target=Target} = State,
- log(heading(session_close,Target), "SSH Ref: ~p, Chn: ~p", [SSHRef,Chn]),
+ try_log(heading(session_close,Target), "SSH Ref: ~p, Chn: ~p", [SSHRef,Chn]),
{ssh_connection:close(SSHRef, Chn),State};
handle_msg({exec,Chn,Command,TO}, State) ->
#state{ssh_ref=SSHRef, target=Target} = State,
Chn1 =
if Chn == undefined ->
- log(heading(exec,Target),
- "Opening channel for exec, SSH Ref: ~p", [SSHRef]),
+ try_log(heading(exec,Target),
+ "Opening channel for exec, SSH Ref: ~p", [SSHRef]),
case ssh_connection:session_channel(SSHRef, TO) of
{ok,C} -> C;
CErr -> CErr
@@ -1009,9 +1017,9 @@ handle_msg({exec,Chn,Command,TO}, State) ->
log(heading(exec,Target), "Opening channel failed: ~p", [ChnError]),
{ChnError,State};
_ ->
- log(heading(exec,Target),
- "SSH Ref: ~p, Chn: ~p, Command: ~p, Timeout: ~p",
- [SSHRef,Chn1,Command,TO]),
+ try_log(heading(exec,Target),
+ "SSH Ref: ~p, Chn: ~p, Command: ~p, Timeout: ~p",
+ [SSHRef,Chn1,Command,TO]),
case ssh_connection:exec(SSHRef, Chn1, Command, TO) of
success ->
Result = do_recv_response(SSHRef, Chn1, [], close, TO),
@@ -1024,24 +1032,24 @@ handle_msg({exec,Chn,Command,TO}, State) ->
handle_msg({receive_response,Chn,End,TO}, State) ->
#state{ssh_ref=SSHRef, target=Target} = State,
- log(heading(receive_response,Target),
- "SSH Ref: ~p, Chn: ~p, Timeout: ~p", [SSHRef,Chn,TO]),
+ try_log(heading(receive_response,Target),
+ "SSH Ref: ~p, Chn: ~p, Timeout: ~p", [SSHRef,Chn,TO]),
Result = do_recv_response(SSHRef, Chn, [], End, TO),
{Result,State};
handle_msg({send,Chn,Type,Data,TO}, State) ->
#state{ssh_ref=SSHRef, target=Target} = State,
- log(heading(send,Target),
- "SSH Ref: ~p, Chn: ~p, Type: ~p, Timeout: ~p~n"
- "Data: ~p", [SSHRef,Chn,Type,TO,Data]),
+ try_log(heading(send,Target),
+ "SSH Ref: ~p, Chn: ~p, Type: ~p, Timeout: ~p~n"
+ "Data: ~p", [SSHRef,Chn,Type,TO,Data]),
Result = ssh_connection:send(SSHRef, Chn, Type, Data, TO),
{Result,State};
handle_msg({send_and_receive,Chn,Type,Data,End,TO}, State) ->
#state{ssh_ref=SSHRef, target=Target} = State,
- log(heading(send_and_receive,Target),
- "SSH Ref: ~p, Chn: ~p, Type: ~p, Timeout: ~p~n"
- "Data: ~p", [SSHRef,Chn,Type,TO,Data]),
+ try_log(heading(send_and_receive,Target),
+ "SSH Ref: ~p, Chn: ~p, Type: ~p, Timeout: ~p~n"
+ "Data: ~p", [SSHRef,Chn,Type,TO,Data]),
case ssh_connection:send(SSHRef, Chn, Type, Data, TO) of
ok ->
Result = do_recv_response(SSHRef, Chn, [], End, TO),
@@ -1052,137 +1060,162 @@ handle_msg({send_and_receive,Chn,Type,Data,End,TO}, State) ->
handle_msg({subsystem,Chn,Subsystem,TO}, State) ->
#state{ssh_ref=SSHRef, target=Target} = State,
- log(heading(subsystem,Target),
- "SSH Ref: ~p, Chn: ~p, Subsys: ~p, Timeout: ~p",
- [SSHRef,Chn,Subsystem,TO]),
+ try_log(heading(subsystem,Target),
+ "SSH Ref: ~p, Chn: ~p, Subsys: ~p, Timeout: ~p",
+ [SSHRef,Chn,Subsystem,TO]),
Result = ssh_connection:subsystem(SSHRef, Chn, Subsystem, TO),
{Result,State};
%% --- SFTP Commands ---
handle_msg({read_file,Srv,File}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:read_file(ref(Srv,SSHRef), File),S};
handle_msg({write_file,Srv,File,Iolist}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:write_file(ref(Srv,SSHRef), File, Iolist),S};
handle_msg({list_dir,Srv,Path}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:list_dir(ref(Srv,SSHRef), Path),S};
handle_msg({open,Srv,File,Mode}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:open(ref(Srv,SSHRef), File, Mode),S};
handle_msg({opendir,Srv,Path}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:opendir(ref(Srv,SSHRef), Path),S};
handle_msg({close,Srv,Handle}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:close(ref(Srv,SSHRef), Handle),S};
handle_msg({read,Srv,Handle,Len}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:read(ref(Srv,SSHRef), Handle, Len),S};
handle_msg({pread,Srv,Handle,Position,Length}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:pread(ref(Srv,SSHRef),Handle,Position,Length),S};
handle_msg({aread,Srv,Handle,Len}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:aread(ref(Srv,SSHRef), Handle, Len),S};
handle_msg({apread,Srv,Handle,Position,Length}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:apread(ref(Srv,SSHRef), Handle, Position, Length),S};
handle_msg({write,Srv,Handle,Data}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:write(ref(Srv,SSHRef), Handle, Data),S};
handle_msg({pwrite,Srv,Handle,Position,Data}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:pwrite(ref(Srv,SSHRef), Handle, Position, Data),S};
handle_msg({awrite,Srv,Handle,Data}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:awrite(ref(Srv,SSHRef), Handle, Data),S};
handle_msg({apwrite,Srv,Handle,Position,Data}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:apwrite(ref(Srv,SSHRef), Handle, Position, Data),S};
handle_msg({position,Srv,Handle,Location}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:position(ref(Srv,SSHRef), Handle, Location),S};
handle_msg({read_file_info,Srv,Name}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:read_file_info(ref(Srv,SSHRef), Name),S};
handle_msg({get_file_info,Srv,Handle}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:get_file_info(ref(Srv,SSHRef), Handle),S};
handle_msg({read_link_info,Srv,Name}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:read_link_info(ref(Srv,SSHRef), Name),S};
handle_msg({write_file_info,Srv,Name,Info}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:write_file_info(ref(Srv,SSHRef), Name, Info),S};
handle_msg({read_link,Srv,Name}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:read_link(ref(Srv,SSHRef), Name),S};
handle_msg({make_symlink,Srv,Name,Target}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:make_symlink(ref(Srv,SSHRef), Name, Target),S};
handle_msg({rename,Srv,OldName,NewName}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:rename(ref(Srv,SSHRef), OldName, NewName),S};
handle_msg({delete,Srv,Name}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:delete(ref(Srv,SSHRef), Name),S};
handle_msg({make_dir,Srv,Name}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:make_dir(ref(Srv,SSHRef), Name),S};
handle_msg({del_dir,Srv,Name}=Cmd, S=#state{ssh_ref=SSHRef}) ->
- log(heading(sftp,S#state.target),
- "SSH Ref: ~p, Server: ~p~nCmd: ~p", [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
+ try_log(heading(sftp,S#state.target),
+ "SSH Ref: ~p, Server: ~p~nCmd: ~p",
+ [SSHRef,ref(Srv,SSHRef),mod(Cmd)]),
{ssh_sftp:del_dir(ref(Srv,SSHRef), Name),S}.
%% @hidden
@@ -1197,12 +1230,12 @@ close(SSHRef) ->
terminate(SSHRef, State) ->
case State#state.conn_type of
ssh ->
- log(heading(disconnect_ssh,State#state.target),
- "SSH Ref: ~p",[SSHRef]),
+ try_log(heading(disconnect_ssh,State#state.target),
+ "SSH Ref: ~p",[SSHRef], 5000),
ssh:close(SSHRef);
sftp ->
- log(heading(disconnect_sftp,State#state.target),
- "SFTP Ref: ~p",[SSHRef]),
+ try_log(heading(disconnect_sftp,State#state.target),
+ "SFTP Ref: ~p",[SSHRef], 5000),
ssh_sftp:stop_channel(SSHRef)
end.
@@ -1217,7 +1250,7 @@ do_recv_response(SSH, Chn, Data, End, Timeout) ->
{ssh_cm, SSH, {open,Chn,RemoteChn,{session}}} ->
debug("RECVD open"),
{ok,{open,Chn,RemoteChn,{session}}};
-
+
{ssh_cm, SSH, {closed,Chn}} ->
ssh_connection:close(SSH, Chn),
debug("CLSD~n~p ~p", [SSH,Chn]),
@@ -1245,38 +1278,38 @@ do_recv_response(SSH, Chn, Data, End, Timeout) ->
{ssh_cm, SSH, {exit_signal,Chn,Signal,Err,_Lang}} ->
debug("RECVD exit_signal~n~p ~p~n~p ~p", [SSH,Chn,Signal,Err]),
do_recv_response(SSH, Chn, Data, End, Timeout);
-%% {ok,{exit_signal,Chn,Signal,Err,_Lang}};
+ %% {ok,{exit_signal,Chn,Signal,Err,_Lang}};
{ssh_cm, SSH, {exit_status,Chn,Status}} ->
debug("RECVD exit_status~n~p ~p~n~p", [SSH,Chn,Status]),
do_recv_response(SSH, Chn, Data, End, Timeout);
-%% {ok,{exit_status,Chn,_Status}};
+ %% {ok,{exit_status,Chn,_Status}};
-%% --- INTERACTIVE MESSAGES - NOT HANDLED ---
-%%
-%% {ssh_cm, SSH, {subsystem,Chn,WantReply,Name}} ->
-%% debug("RECVD SUBS WNTRPLY~n~p ~p~n~p~n~p",
-%% [SSH,Chn,WantReply]),
-%% ssh_connection:reply_request(SSH, WantReply, success, Chn),
-%% do_recv_response(SSH, Chn, Data, End, Timeout);
-
-%% {ssh_cm, SSH, {shell,WantReply}} ->
-%% debug("RECVD SHELL WNTRPLY~n~p ~p~n~p~n~p",
-%% [SSH,Chn,WantReply]),
-%% ssh_connection:reply_request(SSH, WantReply, success, Chn),
-%% do_recv_response(SSH,Chn,Data,End,Timeout);
-
-%% {ssh_cm, SSH, {pty,Chn,WantReply,Pty}} ->
-%% debug("RECVD PTY WNTRPLY~n~p ~p~n~p~n~p",
-%% [SSH,Chn,WantReply,Pty]),
-%% ssh_connection:reply_request(SSH, WantReply, success, Chn),
-%% do_recv_response(SSH, Chn, Data, End, Timeout);
-
-%% {ssh_cm, SSH, WCh={window_change,_Chn,_Width,_Height,_PixWidth,_PixHeight}} ->
-%% debug("RECVD WINCH"),
-%% {ok,WCh};
-
+ %% --- INTERACTIVE MESSAGES - NOT HANDLED ---
+ %%
+ %% {ssh_cm, SSH, {subsystem,Chn,WantReply,Name}} ->
+ %% debug("RECVD SUBS WNTRPLY~n~p ~p~n~p~n~p",
+ %% [SSH,Chn,WantReply]),
+ %% ssh_connection:reply_request(SSH, WantReply, success, Chn),
+ %% do_recv_response(SSH, Chn, Data, End, Timeout);
+
+ %% {ssh_cm, SSH, {shell,WantReply}} ->
+ %% debug("RECVD SHELL WNTRPLY~n~p ~p~n~p~n~p",
+ %% [SSH,Chn,WantReply]),
+ %% ssh_connection:reply_request(SSH, WantReply, success, Chn),
+ %% do_recv_response(SSH,Chn,Data,End,Timeout);
+
+ %% {ssh_cm, SSH, {pty,Chn,WantReply,Pty}} ->
+ %% debug("RECVD PTY WNTRPLY~n~p ~p~n~p~n~p",
+ %% [SSH,Chn,WantReply,Pty]),
+ %% ssh_connection:reply_request(SSH, WantReply, success, Chn),
+ %% do_recv_response(SSH, Chn, Data, End, Timeout);
+
+ %% {ssh_cm, SSH, WCh={window_change,_Chn,_Width,_Height,_PixWidth,_PixHeight}} ->
+ %% debug("RECVD WINCH"),
+ %% {ok,WCh};
+
Other ->
debug("UNEXPECTED MESSAGE~n~p ~p~n~p", [SSH,Chn,Other]),
do_recv_response(SSH, Chn, Data, End, Timeout)
@@ -1307,9 +1340,12 @@ get_handle(SSH) ->
%%%-----------------------------------------------------------------
%%%
call(SSH, Msg) ->
+ call(SSH, Msg, infinity).
+
+call(SSH, Msg, Timeout) ->
case get_handle(SSH) of
{ok,Pid} ->
- ct_gen_conn:call(Pid, Msg);
+ ct_gen_conn:call(Pid, Msg, Timeout);
Error ->
Error
end.
@@ -1318,13 +1354,13 @@ call(SSH, Msg) ->
%%%
ref(sftp, SSHRef) -> SSHRef;
ref(Server, _) -> Server.
-
+
%%%-----------------------------------------------------------------
%%%
mod(Cmd) ->
[Op,_Server|Args] = tuple_to_list(Cmd),
list_to_tuple([Op|Args]).
-
+
%%%-----------------------------------------------------------------
%%%
heading(Function, Ref) ->
@@ -1335,6 +1371,20 @@ heading(Function, Ref) ->
log(Heading, Str, Args) ->
ct_gen_conn:log(Heading, Str, Args).
+%%%-----------------------------------------------------------------
+%%%
+try_log(Heading, Str, Args) ->
+ try_log(Heading, Str, Args, infinity).
+
+try_log(Heading, Str, Args, Timeout) ->
+ case ct_util:is_silenced(ssh, Timeout) of
+ true ->
+ ok;
+ false ->
+ ct_gen_conn:log(Heading, Str, Args);
+ _Error ->
+ ok
+ end.
%%%-----------------------------------------------------------------
%%%
@@ -1342,5 +1392,5 @@ debug(Str) ->
debug(Str, []).
debug(_Str, _Args) ->
-%% io:format("~n--- ct_ssh debug ---~n" ++ _Str ++ "~n", _Args),
+ %% io:format("~n--- ct_ssh debug ---~n" ++ _Str ++ "~n", _Args),
ok.
diff --git a/lib/common_test/src/ct_telnet.erl b/lib/common_test/src/ct_telnet.erl
index f4a551e3ff..b13c050e32 100644
--- a/lib/common_test/src/ct_telnet.erl
+++ b/lib/common_test/src/ct_telnet.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -155,6 +155,8 @@ open(KeyOrName,ConnType,TargetMod) ->
%%% <p><code>TargetMod</code> is a module which exports the functions
%%% <code>connect(Ip,Port,KeepAlive,Extra)</code> and <code>get_prompt_regexp()</code>
%%% for the given <code>TargetType</code> (e.g. <code>unix_telnet</code>).</p>
+%%%
+%%% @see ct:require/2
open(KeyOrName,ConnType,TargetMod,Extra) ->
case ct:get_config({KeyOrName,ConnType}) of
undefined ->
diff --git a/lib/common_test/src/ct_testspec.erl b/lib/common_test/src/ct_testspec.erl
index b68cbd3aa1..a8b67d0329 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -29,6 +29,8 @@
-include("ct_util.hrl").
+-define(testspec_fields, record_info(fields, testspec)).
+
%%%------------------------------------------------------------------
%%% NOTE:
%%% Multiple testspecs may be used as input with the result that
@@ -46,7 +48,8 @@
%%% Version 1 - extract and return all tests and skips for Node
%%% (incl all_nodes)
%%%-------------------------------------------------------------------
-prepare_tests(TestSpec,Node) when is_record(TestSpec,testspec), is_atom(Node) ->
+prepare_tests(TestSpec,Node) when is_record(TestSpec,testspec),
+ is_atom(Node) ->
case lists:keysearch(Node,1,prepare_tests(TestSpec)) of
{value,{Node,Run,Skip}} ->
{Run,Skip};
@@ -249,22 +252,23 @@ collect_tests_from_file1([Spec|Specs],TestSpec,Relaxed) ->
SpecDir = filename:dirname(filename:absname(Spec)),
case file:consult(Spec) of
{ok,Terms} ->
- TestSpec1 = collect_tests(Terms,
- TestSpec#testspec{spec_dir=SpecDir},
- Relaxed),
- collect_tests_from_file1(Specs,TestSpec1,Relaxed);
+ case collect_tests(Terms,
+ TestSpec#testspec{spec_dir=SpecDir},
+ Relaxed) of
+ TS = #testspec{tests=Tests, logdir=LogDirs} when Specs == [] ->
+ LogDirs1 = lists:delete(".",LogDirs) ++ ["."],
+ TS#testspec{tests=lists:flatten(Tests), logdir=LogDirs1};
+ TS = #testspec{alias = As, nodes = Ns} ->
+ TS1 = TS#testspec{alias = lists:reverse(As),
+ nodes = lists:reverse(Ns)},
+ collect_tests_from_file1(Specs,TS1,Relaxed)
+ end;
{error,Reason} ->
ReasonStr =
lists:flatten(io_lib:format("~s",
[file:format_error(Reason)])),
throw({error,{Spec,ReasonStr}})
- end;
-collect_tests_from_file1([],TS=#testspec{config=Cfgs,event_handler=EvHs,
- include=Incl,tests=Tests},_) ->
- TS#testspec{config=lists:reverse(Cfgs),
- event_handler=lists:reverse(EvHs),
- include=lists:reverse(Incl),
- tests=lists:flatten(Tests)}.
+ end.
collect_tests_from_list(Terms,Relaxed) ->
collect_tests_from_list(Terms,[node()],Relaxed).
@@ -278,30 +282,163 @@ collect_tests_from_list(Terms,Nodes,Relaxed) when is_list(Nodes) ->
E = {error,_} ->
E;
TS ->
- #testspec{config=Cfgs,event_handler=EvHs,include=Incl,tests=Tests} = TS,
- TS#testspec{config=lists:reverse(Cfgs),
- event_handler=lists:reverse(EvHs),
- include=lists:reverse(Incl),
- tests=lists:flatten(Tests)}
+ #testspec{tests=Tests, logdir=LogDirs} = TS,
+ LogDirs1 = lists:delete(".",LogDirs) ++ ["."],
+ TS#testspec{tests=lists:flatten(Tests), logdir=LogDirs1}
end.
collect_tests(Terms,TestSpec,Relaxed) ->
put(relaxed,Relaxed),
- TestSpec1 = get_global(Terms,TestSpec),
- TestSpec2 = get_all_nodes(Terms,TestSpec1),
- {Terms2, TestSpec3} = filter_init_terms(Terms, [], TestSpec2),
+ Terms1 = replace_names(Terms),
+ TestSpec1 = get_global(Terms1,TestSpec),
+ TestSpec2 = get_all_nodes(Terms1,TestSpec1),
+ {Terms2, TestSpec3} = filter_init_terms(Terms1, [], TestSpec2),
add_tests(Terms2,TestSpec3).
-get_global([{merge_tests, Bool} | Ts], Spec) ->
- get_global(Ts,Spec#testspec{ merge_tests = Bool });
+%% replace names (atoms) in the testspec matching those in 'define' terms by
+%% searching recursively through tuples and lists
+replace_names(Terms) ->
+ Defs =
+ lists:flatmap(fun(Def={define,Name,_Replacement}) ->
+ %% check that name follows convention
+ if not is_atom(Name) ->
+ throw({illegal_name_in_testspec,Name});
+ true ->
+ [First|_] = atom_to_list(Name),
+ if ((First == $?) or (First == $$)
+ or (First == $_)
+ or ((First >= $A)
+ and (First =< $Z))) ->
+ [Def];
+ true ->
+ throw({illegal_name_in_testspec,
+ Name})
+ end
+ end;
+ (_) -> []
+ end, Terms),
+ DefProps = replace_names_in_defs(Defs,[]),
+ replace_names(Terms,[],DefProps).
+
+replace_names_in_defs([Def|Left],ModDefs) ->
+ [{define,Name,Replacement}] = replace_names([Def],[],ModDefs),
+ replace_names_in_defs(Left,[{Name,Replacement}|ModDefs]);
+replace_names_in_defs([],ModDefs) ->
+ ModDefs.
+
+replace_names([Term|Ts],Modified,Defs) when is_tuple(Term) ->
+ [TypeTag|Data] = tuple_to_list(Term),
+ Term1 = list_to_tuple([TypeTag|replace_names_in_elems(Data,[],Defs)]),
+ replace_names(Ts,[Term1|Modified],Defs);
+replace_names([Term|Ts],Modified,Defs) when is_atom(Term) ->
+ case proplists:get_value(Term,Defs) of
+ undefined ->
+ replace_names(Ts,[Term|Modified],Defs);
+ Replacement ->
+ replace_names(Ts,[Replacement|Modified],Defs)
+ end;
+replace_names([Term=[Ch|_]|Ts],Modified,Defs) when is_integer(Ch) ->
+ %% Term *could* be a string, attempt to search through it
+ Term1 = replace_names_in_string(Term,Defs),
+ replace_names(Ts,[Term1|Modified],Defs);
+replace_names([Term|Ts],Modified,Defs) ->
+ replace_names(Ts,[Term|Modified],Defs);
+replace_names([],Modified,_Defs) ->
+ lists:reverse(Modified).
+
+replace_names_in_elems([Elem|Es],Modified,Defs) when is_tuple(Elem) ->
+ Elem1 = list_to_tuple(replace_names_in_elems(tuple_to_list(Elem),[],Defs)),
+ replace_names_in_elems(Es,[Elem1|Modified],Defs);
+replace_names_in_elems([Elem|Es],Modified,Defs) when is_atom(Elem) ->
+ case proplists:get_value(Elem,Defs) of
+ undefined ->
+ %% if Term is a node name, check it for replacements as well
+ Elem1 = replace_names_in_node(Elem,Defs),
+ replace_names_in_elems(Es,[Elem1|Modified],Defs);
+ Replacement ->
+ replace_names_in_elems(Es,[Replacement|Modified],Defs)
+ end;
+replace_names_in_elems([Elem=[Ch|_]|Es],Modified,Defs) when is_integer(Ch) ->
+ %% Term *could* be a string, attempt to search through it
+ case replace_names_in_string(Elem,Defs) of
+ Elem ->
+ List = replace_names_in_elems(Elem,[],Defs),
+ replace_names_in_elems(Es,[List|Modified],Defs);
+ Elem1 ->
+ replace_names_in_elems(Es,[Elem1|Modified],Defs)
+ end;
+replace_names_in_elems([Elem|Es],Modified,Defs) when is_list(Elem) ->
+ List = replace_names_in_elems(Elem,[],Defs),
+ replace_names_in_elems(Es,[List|Modified],Defs);
+replace_names_in_elems([Elem|Es],Modified,Defs) ->
+ replace_names_in_elems(Es,[Elem|Modified],Defs);
+replace_names_in_elems([],Modified,_Defs) ->
+ lists:reverse(Modified).
+
+replace_names_in_string(Term,Defs=[{Name,Replacement=[Ch|_]}|Ds])
+ when is_integer(Ch) ->
+ try re:replace(Term,[$'|atom_to_list(Name)]++"'",
+ Replacement,[{return,list}]) of
+ Term -> % no match, proceed
+ replace_names_in_string(Term,Ds);
+ Term1 ->
+ replace_names_in_string(Term1,Defs)
+ catch
+ _:_ -> Term % Term is not a string
+ end;
+replace_names_in_string(Term,[_|Ds]) ->
+ replace_names_in_string(Term,Ds);
+replace_names_in_string(Term,[]) ->
+ Term.
+
+replace_names_in_node(Node,Defs) ->
+ String = atom_to_list(Node),
+ case lists:member($@,String) of
+ true ->
+ list_to_atom(replace_names_in_node1(String,Defs));
+ false ->
+ Node
+ end.
+
+replace_names_in_node1(NodeStr,Defs=[{Name,Replacement}|Ds]) ->
+ ReplStr = case Replacement of
+ [Ch|_] when is_integer(Ch) -> Replacement;
+ _ when is_atom(Replacement) -> atom_to_list(Replacement);
+ _ -> false
+ end,
+ if ReplStr == false ->
+ replace_names_in_node1(NodeStr,Ds);
+ true ->
+ case re:replace(NodeStr,atom_to_list(Name),
+ ReplStr,[{return,list}]) of
+ NodeStr -> % no match, proceed
+ replace_names_in_node1(NodeStr,Ds);
+ NodeStr1 ->
+ replace_names_in_node1(NodeStr1,Defs)
+ end
+ end;
+replace_names_in_node1(NodeStr,[]) ->
+ NodeStr.
+
+
+%% global terms that will be used for analysing all other terms in the spec
+get_global([{merge_tests,Bool} | Ts], Spec) ->
+ get_global(Ts,Spec#testspec{merge_tests=Bool});
+
+%% the 'define' term replaces the 'alias' and 'node' terms, but we need to keep
+%% the latter two for backwards compatibility...
get_global([{alias,Ref,Dir}|Ts],Spec=#testspec{alias=Refs}) ->
get_global(Ts,Spec#testspec{alias=[{Ref,get_absdir(Dir,Spec)}|Refs]});
get_global([{node,Ref,Node}|Ts],Spec=#testspec{nodes=Refs}) ->
- get_global(Ts,Spec#testspec{nodes=[{Ref,Node}|lists:keydelete(Node,2,Refs)]});
-get_global([_|Ts],Spec) -> get_global(Ts,Spec);
-get_global([],Spec) -> Spec.
+ get_global(Ts,Spec#testspec{nodes=[{Ref,Node} |
+ lists:keydelete(Node,2,Refs)]});
+
+get_global([_|Ts],Spec) ->
+ get_global(Ts,Spec);
+get_global([],Spec=#testspec{nodes=Ns, alias=As}) ->
+ Spec#testspec{nodes=lists:reverse(Ns), alias=lists:reverse(As)}.
-get_absfile(Callback, FullName,#testspec{spec_dir=SpecDir}) ->
+get_absfile(Callback,FullName,#testspec{spec_dir=SpecDir}) ->
% we need to temporary switch to new cwd here, because
% otherwise config files cannot be found
{ok, OldWd} = file:get_cwd(),
@@ -329,29 +466,45 @@ get_absfile(FullName,#testspec{spec_dir=SpecDir}) ->
get_absdir(Dir,#testspec{spec_dir=SpecDir}) ->
get_absname(Dir,SpecDir).
-get_absname(TestDir,SpecDir) ->
- AbsName = filename:absname(TestDir,SpecDir),
- TestDirName = filename:basename(AbsName),
- Path = filename:dirname(AbsName),
- TopDir = filename:basename(Path),
- Path1 =
- case TopDir of
- "." ->
- [_|Rev] = lists:reverse(filename:split(Path)),
- filename:join(lists:reverse(Rev));
- ".." ->
- [_,_|Rev] = lists:reverse(filename:split(Path)),
- filename:join(lists:reverse(Rev));
- _ ->
- Path
- end,
- filename:join(Path1,TestDirName).
+get_absname(Dir,SpecDir) ->
+ AbsName = filename:absname(Dir,SpecDir),
+ shorten_path(AbsName,SpecDir).
+
+shorten_path(Path,SpecDir) ->
+ case shorten_split_path(filename:split(Path),[]) of
+ [] ->
+ [Root|_] = filename:split(SpecDir),
+ Root;
+ Short ->
+ filename:join(Short)
+ end.
+
+shorten_split_path([".."|Path],SoFar) ->
+ shorten_split_path(Path,tl(SoFar));
+shorten_split_path(["."|Path],SoFar) ->
+ shorten_split_path(Path,SoFar);
+shorten_split_path([Dir|Path],SoFar) ->
+ shorten_split_path(Path,[Dir|SoFar]);
+shorten_split_path([],SoFar) ->
+ lists:reverse(SoFar).
%% go through all tests and register all nodes found
get_all_nodes([{suites,Nodes,_,_}|Ts],Spec) when is_list(Nodes) ->
get_all_nodes(Ts,save_nodes(Nodes,Spec));
get_all_nodes([{suites,Node,_,_}|Ts],Spec) ->
get_all_nodes(Ts,save_nodes([Node],Spec));
+get_all_nodes([{groups,[Char|_],_,_,_}|Ts],Spec) when is_integer(Char) ->
+ get_all_nodes(Ts,Spec);
+get_all_nodes([{groups,Nodes,_,_,_}|Ts],Spec) when is_list(Nodes) ->
+ get_all_nodes(Ts,save_nodes(Nodes,Spec));
+get_all_nodes([{groups,Nodes,_,_,_,_}|Ts],Spec) when is_list(Nodes) ->
+ get_all_nodes(Ts,save_nodes(Nodes,Spec));
+get_all_nodes([{groups,_,_,_,{cases,_}}|Ts],Spec) ->
+ get_all_nodes(Ts,Spec);
+get_all_nodes([{groups,Node,_,_,_}|Ts],Spec) ->
+ get_all_nodes(Ts,save_nodes([Node],Spec));
+get_all_nodes([{groups,Node,_,_,_,_}|Ts],Spec) ->
+ get_all_nodes(Ts,save_nodes([Node],Spec));
get_all_nodes([{cases,Nodes,_,_,_}|Ts],Spec) when is_list(Nodes) ->
get_all_nodes(Ts,save_nodes(Nodes,Spec));
get_all_nodes([{cases,Node,_,_,_}|Ts],Spec) ->
@@ -360,74 +513,93 @@ get_all_nodes([{skip_suites,Nodes,_,_,_}|Ts],Spec) when is_list(Nodes) ->
get_all_nodes(Ts,save_nodes(Nodes,Spec));
get_all_nodes([{skip_suites,Node,_,_,_}|Ts],Spec) ->
get_all_nodes(Ts,save_nodes([Node],Spec));
+get_all_nodes([{skip_groups,[Char|_],_,_,_,_}|Ts],Spec) when is_integer(Char) ->
+ get_all_nodes(Ts,Spec);
+get_all_nodes([{skip_groups,Nodes,_,_,_,_}|Ts],Spec) when is_list(Nodes) ->
+ get_all_nodes(Ts,save_nodes(Nodes,Spec));
+get_all_nodes([{skip_groups,Node,_,_,_,_}|Ts],Spec) ->
+ get_all_nodes(Ts,save_nodes([Node],Spec));
+get_all_nodes([{skip_groups,Nodes,_,_,_,_,_}|Ts],Spec) when is_list(Nodes) ->
+ get_all_nodes(Ts,save_nodes(Nodes,Spec));
+get_all_nodes([{skip_groups,Node,_,_,_,_,_}|Ts],Spec) ->
+ get_all_nodes(Ts,save_nodes([Node],Spec));
get_all_nodes([{skip_cases,Nodes,_,_,_,_}|Ts],Spec) when is_list(Nodes) ->
get_all_nodes(Ts,save_nodes(Nodes,Spec));
get_all_nodes([{skip_cases,Node,_,_,_,_}|Ts],Spec) ->
get_all_nodes(Ts,save_nodes([Node],Spec));
-get_all_nodes([_|Ts],Spec) ->
+get_all_nodes([_Other|Ts],Spec) ->
get_all_nodes(Ts,Spec);
get_all_nodes([],Spec) ->
Spec.
-filter_init_terms([{init, InitOptions}|Ts], NewTerms, Spec)->
- filter_init_terms([{init, list_nodes(Spec), InitOptions}|Ts], NewTerms, Spec);
-filter_init_terms([{init, NodeRef, InitOptions}|Ts], NewTerms, Spec)
- when is_atom(NodeRef)->
- filter_init_terms([{init, [NodeRef], InitOptions}|Ts], NewTerms, Spec);
-filter_init_terms([{init, NodeRefs, InitOption}|Ts], NewTerms, Spec) when is_tuple(InitOption) ->
- filter_init_terms([{init, NodeRefs, [InitOption]}|Ts], NewTerms, Spec);
-filter_init_terms([{init, [NodeRef|NodeRefs], InitOptions}|Ts], NewTerms, Spec=#testspec{init=InitData})->
- NodeStartOptions = case lists:keyfind(node_start, 1, InitOptions) of
- {node_start, NSOptions}->
- case lists:keyfind(callback_module, 1, NSOptions) of
- {callback_module, _Callback}->
- NSOptions;
- false->
- [{callback_module, ct_slave}|NSOptions]
- end;
- false->
- []
- end,
- EvalTerms = case lists:keyfind(eval, 1, InitOptions) of
- {eval, MFA} when is_tuple(MFA)->
- [MFA];
- {eval, MFAs} when is_list(MFAs)->
- MFAs;
- false->
- []
- end,
+filter_init_terms([{init,InitOptions}|Ts],NewTerms,Spec) ->
+ filter_init_terms([{init,list_nodes(Spec),InitOptions}|Ts],
+ NewTerms,Spec);
+filter_init_terms([{init,all_nodes,InitOptions}|Ts],NewTerms,Spec) ->
+ filter_init_terms([{init,list_nodes(Spec),InitOptions}|Ts],
+ NewTerms,Spec);
+filter_init_terms([{init,NodeRef,InitOptions}|Ts],
+ NewTerms,Spec) when is_atom(NodeRef) ->
+ filter_init_terms([{init,[NodeRef],InitOptions}|Ts],NewTerms,Spec);
+filter_init_terms([{init,NodeRefs,InitOption}|Ts],
+ NewTerms,Spec) when is_tuple(InitOption) ->
+ filter_init_terms([{init,NodeRefs,[InitOption]}|Ts],NewTerms,Spec);
+filter_init_terms([{init,[NodeRef|NodeRefs],InitOptions}|Ts],
+ NewTerms,Spec=#testspec{init=InitData}) ->
+ NodeStartOptions =
+ case lists:keyfind(node_start,1,InitOptions) of
+ {node_start,NSOptions}->
+ case lists:keyfind(callback_module,1,NSOptions) of
+ {callback_module,_Callback}->
+ NSOptions;
+ false->
+ [{callback_module,ct_slave}|NSOptions]
+ end;
+ false->
+ []
+ end,
+ EvalTerms = case lists:keyfind(eval,1,InitOptions) of
+ {eval,MFA} when is_tuple(MFA) ->
+ [MFA];
+ {eval,MFAs} when is_list(MFAs) ->
+ MFAs;
+ false->
+ []
+ end,
Node = ref2node(NodeRef,Spec#testspec.nodes),
- InitData2 = add_option({node_start, NodeStartOptions}, Node, InitData, true),
- InitData3 = add_option({eval, EvalTerms}, Node, InitData2, false),
- filter_init_terms([{init, NodeRefs, InitOptions}|Ts], NewTerms, Spec#testspec{init=InitData3});
-filter_init_terms([{init, [], _}|Ts], NewTerms, Spec)->
- filter_init_terms(Ts, NewTerms, Spec);
-filter_init_terms([Term|Ts], NewTerms, Spec)->
- filter_init_terms(Ts, [Term|NewTerms], Spec);
-filter_init_terms([], NewTerms, Spec)->
- {lists:reverse(NewTerms), Spec}.
-
-add_option({Key, Value}, Node, List, WarnIfExists) when is_list(Value)->
- OldOptions = case lists:keyfind(Node, 1, List) of
- {Node, Options}->
+ InitData2 = add_option({node_start,NodeStartOptions},Node,InitData,true),
+ InitData3 = add_option({eval,EvalTerms},Node,InitData2,false),
+ filter_init_terms([{init,NodeRefs,InitOptions}|Ts],
+ NewTerms,Spec#testspec{init=InitData3});
+filter_init_terms([{init,[],_}|Ts],NewTerms,Spec) ->
+ filter_init_terms(Ts,NewTerms,Spec);
+filter_init_terms([Term|Ts],NewTerms,Spec) ->
+ filter_init_terms(Ts,[Term|NewTerms],Spec);
+filter_init_terms([],NewTerms,Spec) ->
+ {lists:reverse(NewTerms),Spec}.
+
+add_option({Key,Value},Node,List,WarnIfExists) when is_list(Value) ->
+ OldOptions = case lists:keyfind(Node,1,List) of
+ {Node,Options}->
Options;
false->
[]
end,
- NewOption = case lists:keyfind(Key, 1, OldOptions) of
- {Key, OldOption} when WarnIfExists, OldOption/=[]->
- io:format("There is an option ~w=~w already defined for node ~p, skipping new ~w~n",
- [Key, OldOption, Node, Value]),
+ NewOption = case lists:keyfind(Key,1,OldOptions) of
+ {Key,OldOption} when WarnIfExists,OldOption/=[]->
+ io:format("There is an option ~w=~w already "
+ "defined for node ~p, skipping new ~w~n",
+ [Key,OldOption,Node,Value]),
OldOption;
- {Key, OldOption}->
+ {Key,OldOption}->
OldOption ++ Value;
false->
Value
end,
- lists:keystore(Node, 1, List,
- {Node, lists:keystore(Key, 1, OldOptions, {Key, NewOption})});
-add_option({Key, Value}, Node, List, WarnIfExists)->
- add_option({Key, [Value]}, Node, List, WarnIfExists).
+ lists:keystore(Node,1,List,
+ {Node,lists:keystore(Key,1,OldOptions,{Key,NewOption})});
+add_option({Key,Value},Node,List,WarnIfExists) ->
+ add_option({Key,[Value]},Node,List,WarnIfExists).
save_nodes(Nodes,Spec=#testspec{nodes=NodeRefs}) ->
NodeRefs1 =
@@ -446,252 +618,18 @@ save_nodes(Nodes,Spec=#testspec{nodes=NodeRefs}) ->
end
end
end,NodeRefs,Nodes),
- Spec#testspec{nodes=NodeRefs1}.
+ Spec#testspec{nodes=NodeRefs1}.
list_nodes(#testspec{nodes=NodeRefs}) ->
lists:map(fun({_Ref,Node}) -> Node end, NodeRefs).
-
-%% ---------------------------------------------------------
-%% / \
-%% | When adding tests, remember to update valid_terms/0 also! |
-%% \ /
-%% ---------------------------------------------------------
-
-
-%% Associate a "global" logdir with all nodes
-%% except those with specific logdir, e.g:
-%% ["/tmp/logdir",{ct1@finwe,"/tmp/logdir2"}]
-%% means all nodes should write to /tmp/logdir
-%% except ct1@finwe that should use /tmp/logdir2.
-
-%% --- logdir ---
-add_tests([{logdir,all_nodes,Dir}|Ts],Spec) ->
- Dirs = Spec#testspec.logdir,
- Tests = [{logdir,N,get_absdir(Dir,Spec)} ||
- N <- list_nodes(Spec),
- lists:keymember(ref2node(N,Spec#testspec.nodes),
- 1,Dirs) == false],
- add_tests(Tests++Ts,Spec);
-add_tests([{logdir,Nodes,Dir}|Ts],Spec) when is_list(Nodes) ->
- Ts1 = separate(Nodes,logdir,[Dir],Ts,Spec#testspec.nodes),
- add_tests(Ts1,Spec);
-add_tests([{logdir,Node,Dir}|Ts],Spec) ->
- Dirs = Spec#testspec.logdir,
- Dirs1 = [{ref2node(Node,Spec#testspec.nodes),get_absdir(Dir,Spec)} |
- lists:keydelete(ref2node(Node,Spec#testspec.nodes),1,Dirs)],
- add_tests(Ts,Spec#testspec{logdir=Dirs1});
-add_tests([{logdir,Dir}|Ts],Spec) ->
- add_tests([{logdir,all_nodes,Dir}|Ts],Spec);
-
-%% --- logopts ---
-add_tests([{logopts,all_nodes,Opts}|Ts],Spec) ->
- LogOpts = Spec#testspec.logopts,
- Tests = [{logopts,N,Opts} ||
- N <- list_nodes(Spec),
- lists:keymember(ref2node(N,Spec#testspec.nodes),1,
- LogOpts) == false],
- add_tests(Tests++Ts,Spec);
-add_tests([{logopts,Nodes,Opts}|Ts],Spec) when is_list(Nodes) ->
- Ts1 = separate(Nodes,logopts,[Opts],Ts,Spec#testspec.nodes),
- add_tests(Ts1,Spec);
-add_tests([{logopts,Node,Opts}|Ts],Spec) ->
- LogOpts = Spec#testspec.logopts,
- LogOpts1 = [{ref2node(Node,Spec#testspec.nodes),Opts} |
- lists:keydelete(ref2node(Node,Spec#testspec.nodes),
- 1,LogOpts)],
- add_tests(Ts,Spec#testspec{logopts=LogOpts1});
-add_tests([{logopts,Opts}|Ts],Spec) ->
- add_tests([{logopts,all_nodes,Opts}|Ts],Spec);
-
-%% --- label ---
-add_tests([{label,all_nodes,Lbl}|Ts],Spec) ->
- Labels = Spec#testspec.label,
- Tests = [{label,N,Lbl} || N <- list_nodes(Spec),
- lists:keymember(ref2node(N,Spec#testspec.nodes),
- 1,Labels) == false],
- add_tests(Tests++Ts,Spec);
-add_tests([{label,Nodes,Lbl}|Ts],Spec) when is_list(Nodes) ->
- Ts1 = separate(Nodes,label,[Lbl],Ts,Spec#testspec.nodes),
- add_tests(Ts1,Spec);
-add_tests([{label,Node,Lbl}|Ts],Spec) ->
- Labels = Spec#testspec.label,
- Labels1 = [{ref2node(Node,Spec#testspec.nodes),Lbl} |
- lists:keydelete(ref2node(Node,Spec#testspec.nodes),1,Labels)],
- add_tests(Ts,Spec#testspec{label=Labels1});
-add_tests([{label,Lbl}|Ts],Spec) ->
- add_tests([{label,all_nodes,Lbl}|Ts],Spec);
-
-%% --- cover ---
-add_tests([{cover,all_nodes,File}|Ts],Spec) ->
- Tests = lists:map(fun(N) -> {cover,N,File} end, list_nodes(Spec)),
- add_tests(Tests++Ts,Spec);
-add_tests([{cover,Nodes,File}|Ts],Spec) when is_list(Nodes) ->
- Ts1 = separate(Nodes,cover,[File],Ts,Spec#testspec.nodes),
- add_tests(Ts1,Spec);
-add_tests([{cover,Node,File}|Ts],Spec) ->
- CoverFs = Spec#testspec.cover,
- CoverFs1 = [{ref2node(Node,Spec#testspec.nodes),get_absfile(File,Spec)} |
- lists:keydelete(ref2node(Node,Spec#testspec.nodes),1,CoverFs)],
- add_tests(Ts,Spec#testspec{cover=CoverFs1});
-add_tests([{cover,File}|Ts],Spec) ->
- add_tests([{cover,all_nodes,File}|Ts],Spec);
-
-%% --- multiply_timetraps ---
-add_tests([{multiply_timetraps,all_nodes,MT}|Ts],Spec) ->
- Tests = lists:map(fun(N) -> {multiply_timetraps,N,MT} end, list_nodes(Spec)),
- add_tests(Tests++Ts,Spec);
-add_tests([{multiply_timetraps,Nodes,MT}|Ts],Spec) when is_list(Nodes) ->
- Ts1 = separate(Nodes,multiply_timetraps,[MT],Ts,Spec#testspec.nodes),
- add_tests(Ts1,Spec);
-add_tests([{multiply_timetraps,Node,MT}|Ts],Spec) ->
- MTs = Spec#testspec.multiply_timetraps,
- MTs1 = [{ref2node(Node,Spec#testspec.nodes),MT} |
- lists:keydelete(ref2node(Node,Spec#testspec.nodes),1,MTs)],
- add_tests(Ts,Spec#testspec{multiply_timetraps=MTs1});
-add_tests([{multiply_timetraps,MT}|Ts],Spec) ->
- add_tests([{multiply_timetraps,all_nodes,MT}|Ts],Spec);
-
-%% --- scale_timetraps ---
-add_tests([{scale_timetraps,all_nodes,ST}|Ts],Spec) ->
- Tests = lists:map(fun(N) -> {scale_timetraps,N,ST} end, list_nodes(Spec)),
- add_tests(Tests++Ts,Spec);
-add_tests([{scale_timetraps,Nodes,ST}|Ts],Spec) when is_list(Nodes) ->
- Ts1 = separate(Nodes,scale_timetraps,[ST],Ts,Spec#testspec.nodes),
- add_tests(Ts1,Spec);
-add_tests([{scale_timetraps,Node,ST}|Ts],Spec) ->
- STs = Spec#testspec.scale_timetraps,
- STs1 = [{ref2node(Node,Spec#testspec.nodes),ST} |
- lists:keydelete(ref2node(Node,Spec#testspec.nodes),1,STs)],
- add_tests(Ts,Spec#testspec{scale_timetraps=STs1});
-add_tests([{scale_timetraps,ST}|Ts],Spec) ->
- add_tests([{scale_timetraps,all_nodes,ST}|Ts],Spec);
-
-%% --- config ---
-add_tests([{config,all_nodes,Files}|Ts],Spec) ->
- Tests = lists:map(fun(N) -> {config,N,Files} end, list_nodes(Spec)),
- add_tests(Tests++Ts,Spec);
-add_tests([{config,Nodes,Files}|Ts],Spec) when is_list(Nodes) ->
- Ts1 = separate(Nodes,config,[Files],Ts,Spec#testspec.nodes),
- add_tests(Ts1,Spec);
-add_tests([{config,Node,[F|Fs]}|Ts],Spec) when is_list(F) ->
- Cfgs = Spec#testspec.config,
- Node1 = ref2node(Node,Spec#testspec.nodes),
- add_tests([{config,Node,Fs}|Ts],
- Spec#testspec{config=[{Node1,get_absfile(F,Spec)}|Cfgs]});
-add_tests([{config,_Node,[]}|Ts],Spec) ->
- add_tests(Ts,Spec);
-add_tests([{config,Node,F}|Ts],Spec) ->
- add_tests([{config,Node,[F]}|Ts],Spec);
-add_tests([{config,Files}|Ts],Spec) ->
- add_tests([{config,all_nodes,Files}|Ts],Spec);
-
-
-%% --- userconfig ---
-add_tests([{userconfig,all_nodes,CBF}|Ts],Spec) ->
- Tests = lists:map(fun(N) -> {userconfig,N,CBF} end, list_nodes(Spec)),
- add_tests(Tests++Ts,Spec);
-add_tests([{userconfig,Nodes,CBF}|Ts],Spec) when is_list(Nodes) ->
- Ts1 = separate(Nodes,userconfig,[CBF],Ts,Spec#testspec.nodes),
- add_tests(Ts1,Spec);
-add_tests([{userconfig,Node,[{Callback, Config}|CBF]}|Ts],Spec) ->
- Cfgs = Spec#testspec.userconfig,
- Node1 = ref2node(Node,Spec#testspec.nodes),
- add_tests([{userconfig,Node,CBF}|Ts],
- Spec#testspec{userconfig=[{Node1,{Callback,
- get_absfile(Callback, Config ,Spec)}}|Cfgs]});
-add_tests([{userconfig,_Node,[]}|Ts],Spec) ->
- add_tests(Ts,Spec);
-add_tests([{userconfig,Node,CBF}|Ts],Spec) ->
- add_tests([{userconfig,Node,[CBF]}|Ts],Spec);
-add_tests([{userconfig,CBF}|Ts],Spec) ->
- add_tests([{userconfig,all_nodes,CBF}|Ts],Spec);
-
-%% --- event_handler ---
-add_tests([{event_handler,all_nodes,Hs}|Ts],Spec) ->
- Tests = lists:map(fun(N) -> {event_handler,N,Hs,[]} end, list_nodes(Spec)),
- add_tests(Tests++Ts,Spec);
-add_tests([{event_handler,all_nodes,Hs,Args}|Ts],Spec) when is_list(Args) ->
- Tests = lists:map(fun(N) -> {event_handler,N,Hs,Args} end, list_nodes(Spec)),
- add_tests(Tests++Ts,Spec);
-add_tests([{event_handler,Hs}|Ts],Spec) ->
- add_tests([{event_handler,all_nodes,Hs,[]}|Ts],Spec);
-add_tests([{event_handler,HsOrNodes,HsOrArgs}|Ts],Spec) ->
- case is_noderef(HsOrNodes,Spec#testspec.nodes) of
- true -> % HsOrNodes == Nodes, HsOrArgs == Hs
- case {HsOrNodes,HsOrArgs} of
- {Nodes,Hs} when is_list(Nodes) ->
- Ts1 = separate(Nodes,event_handler,[Hs,[]],Ts,
- Spec#testspec.nodes),
- add_tests(Ts1,Spec);
- {_Node,[]} ->
- add_tests(Ts,Spec);
- {Node,HOrHs} ->
- EvHs = Spec#testspec.event_handler,
- Node1 = ref2node(Node,Spec#testspec.nodes),
- case HOrHs of
- [H|Hs] when is_atom(H) ->
- add_tests([{event_handler,Node,Hs}|Ts],
- Spec#testspec{event_handler=[{Node1,H,[]}|EvHs]});
- H when is_atom(H) ->
- add_tests(Ts,Spec#testspec{event_handler=[{Node1,H,[]}|EvHs]})
- end
- end;
- false -> % HsOrNodes == Hs, HsOrArgs == Args
- add_tests([{event_handler,all_nodes,HsOrNodes,HsOrArgs}|Ts],Spec)
- end;
-add_tests([{event_handler,Nodes,Hs,Args}|Ts],Spec) when is_list(Nodes) ->
- Ts1 = separate(Nodes,event_handler,[Hs,Args],Ts,Spec#testspec.nodes),
- add_tests(Ts1,Spec);
-add_tests([{event_handler,Node,[H|Hs],Args}|Ts],Spec) when is_atom(H) ->
- EvHs = Spec#testspec.event_handler,
- Node1 = ref2node(Node,Spec#testspec.nodes),
- add_tests([{event_handler,Node,Hs,Args}|Ts],
- Spec#testspec{event_handler=[{Node1,H,Args}|EvHs]});
-add_tests([{event_handler,_Node,[],_Args}|Ts],Spec) ->
- add_tests(Ts,Spec);
-add_tests([{event_handler,Node,H,Args}|Ts],Spec) when is_atom(H) ->
- EvHs = Spec#testspec.event_handler,
- Node1 = ref2node(Node,Spec#testspec.nodes),
- add_tests(Ts,Spec#testspec{event_handler=[{Node1,H,Args}|EvHs]});
-
-%% --- ct_hooks --
-add_tests([{ct_hooks, all_nodes, Hooks} | Ts], Spec) ->
- Tests = [{ct_hooks,N,Hooks} || N <- list_nodes(Spec)],
- add_tests(Tests ++ Ts, Spec);
-add_tests([{ct_hooks, Node, [Hook|Hooks]}|Ts], Spec) ->
- SuiteCbs = Spec#testspec.ct_hooks,
- Node1 = ref2node(Node,Spec#testspec.nodes),
- add_tests([{ct_hooks, Node, Hooks} | Ts],
- Spec#testspec{ct_hooks = [{Node1,Hook} | SuiteCbs]});
-add_tests([{ct_hooks, _Node, []}|Ts], Spec) ->
- add_tests(Ts, Spec);
-add_tests([{ct_hooks, Hooks}|Ts], Spec) ->
- add_tests([{ct_hooks, all_nodes, Hooks}|Ts], Spec);
-
-%% -- enable_builtin_hooks --
-add_tests([{enable_builtin_hooks,Bool}|Ts],Spec) ->
- add_tests(Ts, Spec#testspec{ enable_builtin_hooks = Bool });
-
-%% --- include ---
-add_tests([{include,all_nodes,InclDirs}|Ts],Spec) ->
- Tests = lists:map(fun(N) -> {include,N,InclDirs} end, list_nodes(Spec)),
- add_tests(Tests++Ts,Spec);
-add_tests([{include,Nodes,InclDirs}|Ts],Spec) when is_list(Nodes) ->
- Ts1 = separate(Nodes,include,[InclDirs],Ts,Spec#testspec.nodes),
- add_tests(Ts1,Spec);
-add_tests([{include,Node,[D|Ds]}|Ts],Spec) when is_list(D) ->
- Dirs = Spec#testspec.include,
- Node1 = ref2node(Node,Spec#testspec.nodes),
- add_tests([{include,Node,Ds}|Ts],
- Spec#testspec{include=[{Node1,get_absdir(D,Spec)}|Dirs]});
-add_tests([{include,_Node,[]}|Ts],Spec) ->
- add_tests(Ts,Spec);
-add_tests([{include,Node,D}|Ts],Spec) ->
- add_tests([{include,Node,[D]}|Ts],Spec);
-add_tests([{include,InclDirs}|Ts],Spec) ->
- add_tests([{include,all_nodes,InclDirs}|Ts],Spec);
+%% -----------------------------------------------------
+%% / \
+%% | When adding test/config terms, remember to update |
+%% | valid_terms/0 also! |
+%% \ /
+%% -----------------------------------------------------
%% --- suites ---
add_tests([{suites,all_nodes,Dir,Ss}|Ts],Spec) ->
@@ -704,7 +642,7 @@ add_tests([{suites,Nodes,Dir,Ss}|Ts],Spec) when is_list(Nodes) ->
add_tests([{suites,Node,Dir,Ss}|Ts],Spec) ->
Tests = Spec#testspec.tests,
Tests1 = insert_suites(ref2node(Node,Spec#testspec.nodes),
- ref2dir(Dir,Spec#testspec.alias),
+ ref2dir(Dir,Spec),
Ss,Tests, Spec#testspec.merge_tests),
add_tests(Ts,Spec#testspec{tests=Tests1});
@@ -724,20 +662,22 @@ add_tests([{groups,Dir,Suite,Gs,{cases,TCs}}|Ts],Spec) ->
add_tests([{groups,Nodes,Dir,Suite,Gs}|Ts],Spec) when is_list(Nodes) ->
Ts1 = separate(Nodes,groups,[Dir,Suite,Gs],Ts,Spec#testspec.nodes),
add_tests(Ts1,Spec);
-add_tests([{groups,Nodes,Dir,Suite,Gs,{cases,TCs}}|Ts],Spec) when is_list(Nodes) ->
- Ts1 = separate(Nodes,groups,[Dir,Suite,Gs,{cases,TCs}],Ts,Spec#testspec.nodes),
+add_tests([{groups,Nodes,Dir,Suite,Gs,{cases,TCs}}|Ts],
+ Spec) when is_list(Nodes) ->
+ Ts1 = separate(Nodes,groups,[Dir,Suite,Gs,{cases,TCs}],Ts,
+ Spec#testspec.nodes),
add_tests(Ts1,Spec);
add_tests([{groups,Node,Dir,Suite,Gs}|Ts],Spec) ->
Tests = Spec#testspec.tests,
Tests1 = insert_groups(ref2node(Node,Spec#testspec.nodes),
- ref2dir(Dir,Spec#testspec.alias),
+ ref2dir(Dir,Spec),
Suite,Gs,all,Tests,
Spec#testspec.merge_tests),
add_tests(Ts,Spec#testspec{tests=Tests1});
add_tests([{groups,Node,Dir,Suite,Gs,{cases,TCs}}|Ts],Spec) ->
Tests = Spec#testspec.tests,
Tests1 = insert_groups(ref2node(Node,Spec#testspec.nodes),
- ref2dir(Dir,Spec#testspec.alias),
+ ref2dir(Dir,Spec),
Suite,Gs,TCs,Tests,
Spec#testspec.merge_tests),
add_tests(Ts,Spec#testspec{tests=Tests1});
@@ -753,7 +693,7 @@ add_tests([{cases,Nodes,Dir,Suite,Cs}|Ts],Spec) when is_list(Nodes) ->
add_tests([{cases,Node,Dir,Suite,Cs}|Ts],Spec) ->
Tests = Spec#testspec.tests,
Tests1 = insert_cases(ref2node(Node,Spec#testspec.nodes),
- ref2dir(Dir,Spec#testspec.alias),
+ ref2dir(Dir,Spec),
Suite,Cs,Tests, Spec#testspec.merge_tests),
add_tests(Ts,Spec#testspec{tests=Tests1});
@@ -768,7 +708,7 @@ add_tests([{skip_suites,Nodes,Dir,Ss,Cmt}|Ts],Spec) when is_list(Nodes) ->
add_tests([{skip_suites,Node,Dir,Ss,Cmt}|Ts],Spec) ->
Tests = Spec#testspec.tests,
Tests1 = skip_suites(ref2node(Node,Spec#testspec.nodes),
- ref2dir(Dir,Spec#testspec.alias),
+ ref2dir(Dir,Spec),
Ss,Cmt,Tests,
Spec#testspec.merge_tests),
add_tests(Ts,Spec#testspec{tests=Tests1});
@@ -777,7 +717,8 @@ add_tests([{skip_suites,Node,Dir,Ss,Cmt}|Ts],Spec) ->
add_tests([{skip_groups,all_nodes,Dir,Suite,Gs,Cmt}|Ts],Spec) ->
add_tests([{skip_groups,list_nodes(Spec),Dir,Suite,Gs,Cmt}|Ts],Spec);
add_tests([{skip_groups,all_nodes,Dir,Suite,Gs,{cases,TCs},Cmt}|Ts],Spec) ->
- add_tests([{skip_groups,list_nodes(Spec),Dir,Suite,Gs,{cases,TCs},Cmt}|Ts],Spec);
+ add_tests([{skip_groups,list_nodes(Spec),Dir,Suite,Gs,{cases,TCs},Cmt}|Ts],
+ Spec);
add_tests([{skip_groups,Dir,Suite,Gs,Cmt}|Ts],Spec) ->
add_tests([{skip_groups,all_nodes,Dir,Suite,Gs,Cmt}|Ts],Spec);
add_tests([{skip_groups,Dir,Suite,Gs,{cases,TCs},Cmt}|Ts],Spec) ->
@@ -785,20 +726,22 @@ add_tests([{skip_groups,Dir,Suite,Gs,{cases,TCs},Cmt}|Ts],Spec) ->
add_tests([{skip_groups,Nodes,Dir,Suite,Gs,Cmt}|Ts],Spec) when is_list(Nodes) ->
Ts1 = separate(Nodes,skip_groups,[Dir,Suite,Gs,Cmt],Ts,Spec#testspec.nodes),
add_tests(Ts1,Spec);
-add_tests([{skip_groups,Nodes,Dir,Suite,Gs,{cases,TCs},Cmt}|Ts],Spec) when is_list(Nodes) ->
- Ts1 = separate(Nodes,skip_groups,[Dir,Suite,Gs,{cases,TCs},Cmt],Ts,Spec#testspec.nodes),
+add_tests([{skip_groups,Nodes,Dir,Suite,Gs,{cases,TCs},Cmt}|Ts],
+ Spec) when is_list(Nodes) ->
+ Ts1 = separate(Nodes,skip_groups,[Dir,Suite,Gs,{cases,TCs},Cmt],Ts,
+ Spec#testspec.nodes),
add_tests(Ts1,Spec);
add_tests([{skip_groups,Node,Dir,Suite,Gs,Cmt}|Ts],Spec) ->
Tests = Spec#testspec.tests,
Tests1 = skip_groups(ref2node(Node,Spec#testspec.nodes),
- ref2dir(Dir,Spec#testspec.alias),
+ ref2dir(Dir,Spec),
Suite,Gs,all,Cmt,Tests,
Spec#testspec.merge_tests),
add_tests(Ts,Spec#testspec{tests=Tests1});
add_tests([{skip_groups,Node,Dir,Suite,Gs,{cases,TCs},Cmt}|Ts],Spec) ->
Tests = Spec#testspec.tests,
Tests1 = skip_groups(ref2node(Node,Spec#testspec.nodes),
- ref2dir(Dir,Spec#testspec.alias),
+ ref2dir(Dir,Spec),
Suite,Gs,TCs,Cmt,Tests,
Spec#testspec.merge_tests),
add_tests(Ts,Spec#testspec{tests=Tests1});
@@ -814,45 +757,101 @@ add_tests([{skip_cases,Nodes,Dir,Suite,Cs,Cmt}|Ts],Spec) when is_list(Nodes) ->
add_tests([{skip_cases,Node,Dir,Suite,Cs,Cmt}|Ts],Spec) ->
Tests = Spec#testspec.tests,
Tests1 = skip_cases(ref2node(Node,Spec#testspec.nodes),
- ref2dir(Dir,Spec#testspec.alias),
+ ref2dir(Dir,Spec),
Suite,Cs,Cmt,Tests,Spec#testspec.merge_tests),
add_tests(Ts,Spec#testspec{tests=Tests1});
+%% --- various configuration terms ---
+add_tests([{config,Nodes,CfgDir,Files}|Ts],Spec) when is_list(Nodes);
+ Nodes == all_nodes ->
+ add_tests([{config,Nodes,{CfgDir,Files}}|Ts],Spec);
+add_tests([{config,Node,CfgDir,FileOrFiles}|Ts],Spec) ->
+ add_tests([{config,Node,{CfgDir,FileOrFiles}}|Ts],Spec);
+add_tests([{config,CfgDir=[Ch|_],Files}|Ts],Spec) when is_integer(Ch) ->
+ add_tests([{config,all_nodes,{CfgDir,Files}}|Ts],Spec);
+
+add_tests([{event_handler,Nodes,Hs,Args}|Ts],Spec) when is_list(Nodes);
+ Nodes == all_nodes ->
+ add_tests([{event_handler,Nodes,{Hs,Args}}|Ts],Spec);
+add_tests([{event_handler,Node,HOrHs,Args}|Ts],Spec) ->
+ add_tests([{event_handler,Node,{HOrHs,Args}}|Ts],Spec);
+
+add_tests([{enable_builtin_hooks,Bool}|Ts],Spec) ->
+ add_tests(Ts, Spec#testspec{enable_builtin_hooks = Bool});
+
+add_tests([{release_shell,Bool}|Ts],Spec) ->
+ add_tests(Ts, Spec#testspec{release_shell = Bool});
+
%% --- handled/errors ---
+add_tests([{define,_,_}|Ts],Spec) -> % handled
+ add_tests(Ts,Spec);
+
add_tests([{alias,_,_}|Ts],Spec) -> % handled
add_tests(Ts,Spec);
add_tests([{node,_,_}|Ts],Spec) -> % handled
add_tests(Ts,Spec);
-add_tests([{merge_tests, _} | Ts], Spec) -> % handled
+add_tests([{merge_tests, _} | Ts], Spec) -> % handled
add_tests(Ts,Spec);
-%% check if it's a CT term that has bad format or if the user seems to
-%% have added something of his/her own, which we'll let pass if relaxed
-%% mode is enabled.
-add_tests([Other|Ts],Spec) when is_tuple(Other) ->
- [Name|_] = tuple_to_list(Other),
- case lists:keymember(Name,1,valid_terms()) of
- true -> % halt
- throw({error,{bad_term_in_spec,Other}});
- false -> % ignore
- case get(relaxed) of
- true ->
- %% warn if name resembles a CT term
- case resembles_ct_term(Name,size(Other)) of
- true ->
- io:format("~nSuspicious term, please check:~n"
- "~p~n", [Other]);
- false ->
- ok
- end,
- add_tests(Ts,Spec);
- false ->
- throw({error,{undefined_term_in_spec,Other}})
- end
+%% --------------------------------------------------
+%% / \
+%% | General add_tests/2 clauses below will work for |
+%% | most test spec configuration terms |
+%% \ /
+%% --------------------------------------------------
+
+%% create one test entry per known node and reinsert
+add_tests([Term={Tag,all_nodes,Data}|Ts],Spec) ->
+ case check_term(Term) of
+ valid ->
+ Tests = [{Tag,Node,Data} || Node <- list_nodes(Spec),
+ should_be_added(Tag,Node,Data,Spec)],
+ add_tests(Tests++Ts,Spec);
+ invalid -> % ignore term
+ add_tests(Ts,Spec)
end;
-
+%% create one test entry per node in Nodes and reinsert
+add_tests([{Tag,[],Data}|Ts],Spec) ->
+ add_tests([{Tag,all_nodes,Data}|Ts],Spec);
+add_tests([{Tag,String=[Ch|_],Data}|Ts],Spec) when is_integer(Ch) ->
+ add_tests([{Tag,all_nodes,{String,Data}}|Ts],Spec);
+add_tests([{Tag,NodesOrOther,Data}|Ts],Spec) when is_list(NodesOrOther) ->
+ case lists:all(fun(Test) -> is_node(Test,Spec#testspec.nodes)
+ end, NodesOrOther) of
+ true ->
+ Ts1 = separate(NodesOrOther,Tag,[Data],Ts,Spec#testspec.nodes),
+ add_tests(Ts1,Spec);
+ false ->
+ add_tests([{Tag,all_nodes,{NodesOrOther,Data}}|Ts],Spec)
+ end;
+%% update data for testspec term of type Tag
+add_tests([Term={Tag,NodeOrOther,Data}|Ts],Spec) ->
+ case is_node(NodeOrOther,Spec#testspec.nodes) of
+ true ->
+ case check_term(Term) of
+ valid ->
+ Node = ref2node(NodeOrOther,Spec#testspec.nodes),
+ NodeIxData =
+ update_recorded(Tag,Node,Spec) ++
+ handle_data(Tag,Node,Data,Spec),
+ add_tests(Ts,mod_field(Spec,Tag,NodeIxData));
+ invalid -> % ignore term
+ add_tests(Ts,Spec)
+ end;
+ false ->
+ add_tests([{Tag,all_nodes,{NodeOrOther,Data}}|Ts],Spec)
+ end;
+%% this test should be added for all known nodes
+add_tests([Term={Tag,Data}|Ts],Spec) ->
+ case check_term(Term) of
+ valid ->
+ add_tests([{Tag,all_nodes,Data}|Ts],Spec);
+ invalid ->
+ add_tests(Ts,Spec)
+ end;
+%% some other data than a tuple
add_tests([Other|Ts],Spec) ->
case get(relaxed) of
true ->
@@ -864,6 +863,118 @@ add_tests([Other|Ts],Spec) ->
add_tests([],Spec) -> % done
Spec.
+%% check if it's a CT term that has bad format or if the user seems to
+%% have added something of his/her own, which we'll let pass if relaxed
+%% mode is enabled.
+check_term(Term) ->
+ Size = size(Term),
+ [Name|_] = tuple_to_list(Term),
+ Valid = valid_terms(),
+ case lists:member({Name,Size},Valid) of
+ true ->
+ valid;
+ false ->
+ case lists:keymember(Name,1,Valid) of
+ true -> % halt
+ throw({error,{bad_term_in_spec,Term}});
+ false -> % ignore
+ case get(relaxed) of
+ true ->
+ %% warn if name resembles a CT term
+ case resembles_ct_term(Name,size(Term)) of
+ true ->
+ io:format("~nSuspicious term, "
+ "please check:~n"
+ "~p~n", [Term]),
+ invalid;
+ false ->
+ invalid
+ end;
+ false ->
+ throw({error,{undefined_term_in_spec,Term}})
+ end
+ end
+ end.
+
+%% specific data handling before saving in testspec record, e.g.
+%% converting relative paths to absolute for directories and files
+%% (introduce a clause *only* if the data value needs processing)
+handle_data(logdir,Node,Dir,Spec) ->
+ [{Node,ref2dir(Dir,Spec)}];
+handle_data(cover,Node,File,Spec) ->
+ [{Node,get_absfile(File,Spec)}];
+handle_data(include,Node,Dirs=[D|_],Spec) when is_list(D) ->
+ [{Node,ref2dir(Dir,Spec)} || Dir <- Dirs];
+handle_data(include,Node,Dir=[Ch|_],Spec) when is_integer(Ch) ->
+ handle_data(include,Node,[Dir],Spec);
+handle_data(config,Node,File=[Ch|_],Spec) when is_integer(Ch) ->
+ handle_data(config,Node,[File],Spec);
+handle_data(config,Node,{CfgDir,File=[Ch|_]},Spec) when is_integer(Ch) ->
+ handle_data(config,Node,{CfgDir,[File]},Spec);
+handle_data(config,Node,Files=[F|_],Spec) when is_list(F) ->
+ [{Node,get_absfile(File,Spec)} || File <- Files];
+handle_data(config,Node,{CfgDir,Files=[F|_]},Spec) when is_list(F) ->
+ [{Node,filename:join(ref2dir(CfgDir,Spec),File)} || File <- Files];
+handle_data(userconfig,Node,CBs,Spec) when is_list(CBs) ->
+ [{Node,{Callback,get_absfile(Callback,Config,Spec)}} ||
+ {Callback,Config} <- CBs];
+handle_data(userconfig,Node,CB,Spec) when is_tuple(CB) ->
+ handle_data(userconfig,Node,[CB],Spec);
+handle_data(event_handler,Node,H,Spec) when is_atom(H) ->
+ handle_data(event_handler,Node,{[H],[]},Spec);
+handle_data(event_handler,Node,{H,Args},Spec) when is_atom(H) ->
+ handle_data(event_handler,Node,{[H],Args},Spec);
+handle_data(event_handler,Node,Hs,_Spec) when is_list(Hs) ->
+ [{Node,EvH,[]} || EvH <- Hs];
+handle_data(event_handler,Node,{Hs,Args},_Spec) when is_list(Hs) ->
+ [{Node,EvH,Args} || EvH <- Hs];
+handle_data(ct_hooks,Node,Hooks,_Spec) when is_list(Hooks) ->
+ [{Node,Hook} || Hook <- Hooks ];
+handle_data(ct_hooks,Node,Hook,_Spec) ->
+ [{Node,Hook}];
+handle_data(stylesheet,Node,CSSFile,Spec) ->
+ [{Node,get_absfile(CSSFile,Spec)}];
+handle_data(verbosity,Node,VLvls,_Spec) when is_integer(VLvls) ->
+ [{Node,[{'$unspecified',VLvls}]}];
+handle_data(verbosity,Node,VLvls,_Spec) when is_list(VLvls) ->
+ VLvls1 = lists:map(fun(VLvl = {_Cat,_Lvl}) -> VLvl;
+ (Lvl) -> {'$unspecified',Lvl} end, VLvls),
+ [{Node,VLvls1}];
+handle_data(silent_connections,Node,all,_Spec) ->
+ [{Node,[all]}];
+handle_data(silent_connections,Node,Conn,_Spec) when is_atom(Conn) ->
+ [{Node,[Conn]}];
+handle_data(silent_connections,Node,Conns,_Spec) ->
+ [{Node,Conns}];
+handle_data(_Tag,Node,Data,_Spec) ->
+ [{Node,Data}].
+
+%% check if duplicates should be saved or not
+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 == stylesheet;
+ Tag == verbosity; Tag == silent_connections ->
+ lists:keymember(ref2node(Node,Spec#testspec.nodes),1,
+ read_field(Spec,Tag)) == false;
+ %% for terms *with* possible duplicates
+ true ->
+ true
+ end.
+
+%% check if previous elements for Node should be deleted
+update_recorded(Tag,Node,Spec) ->
+ if Tag == config; Tag == userconfig; Tag == event_handler;
+ Tag == ct_hooks; Tag == include ->
+ read_field(Spec,Tag);
+ true ->
+ %% delete previous value for Tag
+ lists:keydelete(Node,1,read_field(Spec,Tag))
+ end.
+
+%% create one test term per node
separate(Nodes,Tag,Data,Tests,Refs) ->
Separated = separate(Nodes,Tag,Data,Refs),
Separated ++ Tests.
@@ -871,7 +982,25 @@ separate([N|Ns],Tag,Data,Refs) ->
[list_to_tuple([Tag,ref2node(N,Refs)|Data])|separate(Ns,Tag,Data,Refs)];
separate([],_,_,_) ->
[].
-
+
+%% read the value for FieldName in record Rec#testspec
+read_field(Rec, FieldName) ->
+ catch lists:foldl(fun(F, Pos) when F == FieldName ->
+ throw(element(Pos, Rec));
+ (_,Pos) ->
+ Pos+1
+ end,2,?testspec_fields).
+
+%% modify the value for FieldName in record Rec#testspec
+mod_field(Rec, FieldName, NewVal) ->
+ [_testspec|RecList] = tuple_to_list(Rec),
+ RecList1 =
+ (catch lists:foldl(fun(F, {Prev,[_OldVal|Rest]}) when F == FieldName ->
+ throw(lists:reverse(Prev) ++ [NewVal|Rest]);
+ (_,{Prev,[Field|Rest]}) ->
+ {[Field|Prev],Rest}
+ end,{[],RecList},?testspec_fields)),
+ list_to_tuple([testspec|RecList1]).
%% Representation:
%% {{Node,Dir},[{Suite1,[GrOrCase11,GrOrCase12,...]},
@@ -1079,33 +1208,40 @@ ref2node(all_nodes,_Refs) ->
ref2node(master,_Refs) ->
master;
ref2node(RefOrNode,Refs) ->
- case string:chr(atom_to_list(RefOrNode),$@) of
- 0 -> % a ref
+ case lists:member($@,atom_to_list(RefOrNode)) of
+ false -> % a ref
case lists:keysearch(RefOrNode,1,Refs) of
{value,{RefOrNode,Node}} ->
Node;
false ->
throw({error,{noderef_missing,RefOrNode}})
end;
- _ -> % a node
+ true -> % a node
RefOrNode
end.
-ref2dir(Ref,Refs) when is_atom(Ref) ->
+ref2dir(Ref,Spec) ->
+ ref2dir(Ref,Spec#testspec.alias,Spec).
+
+ref2dir(Ref,Refs,Spec) when is_atom(Ref) ->
case lists:keysearch(Ref,1,Refs) of
{value,{Ref,Dir}} ->
- Dir;
+ get_absdir(Dir,Spec);
false ->
throw({error,{alias_missing,Ref}})
end;
-ref2dir(Dir,_) when is_list(Dir) ->
- Dir.
-
-is_noderef(What,Nodes) when is_atom(What) ->
- is_noderef([What],Nodes);
-is_noderef([master|_],_Nodes) ->
+ref2dir(Dir,_,Spec) when is_list(Dir) ->
+ get_absdir(Dir,Spec);
+ref2dir(What,_,_) ->
+ throw({error,{invalid_directory_name,What}}).
+
+is_node(What,Nodes) when is_atom(What) ->
+ is_node([What],Nodes);
+is_node([master|_],_Nodes) ->
true;
-is_noderef([What|_],Nodes) ->
+is_node(What={N,H},Nodes) when is_atom(N), is_atom(H) ->
+ is_node([What],Nodes);
+is_node([What|_],Nodes) ->
case lists:keymember(What,1,Nodes) or
lists:keymember(What,2,Nodes) of
true ->
@@ -1113,24 +1249,32 @@ is_noderef([What|_],Nodes) ->
false ->
false
end;
-is_noderef([],_) ->
+is_node([],_) ->
false.
valid_terms() ->
[
+ {define,3},
{node,3},
{cover,2},
{cover,3},
{config,2},
{config,3},
+ {config,4},
{userconfig,2},
{userconfig,3},
{alias,3},
- {merge_tests,1},
+ {merge_tests,2},
{logdir,2},
{logdir,3},
{logopts,2},
{logopts,3},
+ {basic_html,2},
+ {basic_html,3},
+ {verbosity,2},
+ {verbosity,3},
+ {silent_connections,2},
+ {silent_connections,3},
{label,2},
{label,3},
{event_handler,2},
@@ -1138,13 +1282,18 @@ valid_terms() ->
{event_handler,4},
{ct_hooks,2},
{ct_hooks,3},
- {enable_builtin_hooks,1},
+ {enable_builtin_hooks,2},
+ {release_shell,2},
{multiply_timetraps,2},
{multiply_timetraps,3},
{scale_timetraps,2},
{scale_timetraps,3},
{include,2},
{include,3},
+ {auto_compile,2},
+ {auto_compile,3},
+ {stylesheet,2},
+ {stylesheet,3},
{suites,3},
{suites,4},
{groups,4},
@@ -1158,7 +1307,9 @@ valid_terms() ->
{skip_groups,6},
{skip_groups,7},
{skip_cases,5},
- {skip_cases,6}
+ {skip_cases,6},
+ {create_priv_dir,2},
+ {create_priv_dir,3}
].
%% this function "guesses" if the user has misspelled a term name
diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl
index 3b6ad6f98d..cf891ed043 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -25,7 +25,8 @@
%%%
-module(ct_util).
--export([start/0,start/1,start/2,stop/1,update_last_run_index/0]).
+-export([start/0,start/1,start/2,start/3,
+ stop/1,update_last_run_index/0]).
-export([register_connection/4,unregister_connection/1,
does_connection_exist/3,get_key_from_name/1]).
@@ -36,14 +37,15 @@
save_suite_data_async/3, save_suite_data_async/2,
read_suite_data/1,
delete_suite_data/0, delete_suite_data/1, match_delete_suite_data/1,
- delete_testdata/0, delete_testdata/1, set_testdata/1, get_testdata/1,
- set_testdata_async/1, update_testdata/2]).
+ delete_testdata/0, delete_testdata/1,
+ set_testdata/1, get_testdata/1, get_testdata/2,
+ set_testdata_async/1, update_testdata/2, update_testdata/3]).
-export([override_silence_all_connections/0, override_silence_connections/1,
get_overridden_silenced_connections/0,
delete_overridden_silenced_connections/0,
- silence_all_connections/0, silence_connections/1, is_silenced/1,
- reset_silent_connections/0]).
+ silence_all_connections/0, silence_connections/1,
+ is_silenced/1, is_silenced/2, reset_silent_connections/0]).
-export([get_mode/0, create_table/3, read_opts/0]).
@@ -64,9 +66,13 @@
-export([get_profile_data/0, get_profile_data/1,
get_profile_data/2, open_url/3]).
+-include("ct.hrl").
-include("ct_event.hrl").
-include("ct_util.hrl").
+-define(default_verbosity, [{default,?MAX_VERBOSITY},
+ {'$unspecified',?MAX_VERBOSITY}]).
+
-record(suite_data, {key,name,value}).
%%%-----------------------------------------------------------------
@@ -85,18 +91,21 @@
%%%
%%% @see ct
start() ->
- start(normal,".").
+ start(normal, ".", ?default_verbosity).
start(LogDir) when is_list(LogDir) ->
- start(normal,LogDir);
+ start(normal, LogDir, ?default_verbosity);
start(Mode) ->
- start(Mode,".").
+ start(Mode, ".", ?default_verbosity).
+
+start(LogDir, Verbosity) when is_list(LogDir) ->
+ start(normal, LogDir, Verbosity).
-start(Mode,LogDir) ->
+start(Mode, LogDir, Verbosity) ->
case whereis(ct_util_server) of
undefined ->
S = self(),
- Pid = spawn_link(fun() -> do_start(S,Mode,LogDir) end),
+ Pid = spawn_link(fun() -> do_start(S, Mode, LogDir, Verbosity) end),
receive
{Pid,started} -> Pid;
{Pid,Error} -> exit(Error);
@@ -113,7 +122,7 @@ start(Mode,LogDir) ->
end
end.
-do_start(Parent,Mode,LogDir) ->
+do_start(Parent, Mode, LogDir, Verbosity) ->
process_flag(trap_exit,true),
register(ct_util_server,self()),
create_table(?conn_table,#conn.handle),
@@ -173,7 +182,7 @@ do_start(Parent,Mode,LogDir) ->
false ->
ok
end,
- {StartTime,TestLogDir} = ct_logs:init(Mode),
+ {StartTime,TestLogDir} = ct_logs:init(Mode, Verbosity),
ct_event:notify(#event{name=test_start,
node=node(),
@@ -193,7 +202,7 @@ do_start(Parent,Mode,LogDir) ->
self() ! {{stop,{self(),{user_error,CTHReason}}},
{Parent,make_ref()}}
end,
- loop(Mode,[],StartDir).
+ loop(Mode, [{{verbosity,Cat},Lvl} || {Cat,Lvl} <- Verbosity], StartDir).
create_table(TableName,KeyPos) ->
create_table(TableName,set,KeyPos).
@@ -243,7 +252,10 @@ delete_testdata(Key) ->
call({delete_testdata, Key}).
update_testdata(Key, Fun) ->
- call({update_testdata, Key, Fun}).
+ update_testdata(Key, Fun, []).
+
+update_testdata(Key, Fun, Opts) ->
+ call({update_testdata, Key, Fun, Opts}).
set_testdata(TestData) ->
call({set_testdata, TestData}).
@@ -254,6 +266,9 @@ set_testdata_async(TestData) ->
get_testdata(Key) ->
call({get_testdata, Key}).
+get_testdata(Key, Timeout) ->
+ call({get_testdata, Key}, Timeout).
+
set_cwd(Dir) ->
call({set_cwd,Dir}).
@@ -321,7 +336,7 @@ loop(Mode,TestData,StartDir) ->
return(From,undefined)
end,
loop(From,TestData,StartDir);
- {{update_testdata,Key,Fun},From} ->
+ {{update_testdata,Key,Fun,Opts},From} ->
TestData1 =
case lists:keysearch(Key,1,TestData) of
{value,{Key,Val}} ->
@@ -329,8 +344,15 @@ loop(Mode,TestData,StartDir) ->
return(From,NewVal),
[{Key,NewVal}|lists:keydelete(Key,1,TestData)];
_ ->
- return(From,undefined),
- TestData
+ case lists:member(create,Opts) of
+ true ->
+ InitVal = Fun(undefined),
+ return(From,InitVal),
+ [{Key,InitVal}|TestData];
+ false ->
+ return(From,undefined),
+ TestData
+ end
end,
loop(From,TestData1,StartDir);
{{set_cwd,Dir},From} ->
@@ -369,14 +391,25 @@ loop(Mode,TestData,StartDir) ->
{'EXIT',_Pid,normal} ->
loop(Mode,TestData,StartDir);
{'EXIT',Pid,Reason} ->
- %% Let process crash in case of error, this shouldn't happen!
- io:format("\n\nct_util_server got EXIT from ~p: ~p\n\n",
- [Pid,Reason]),
- file:set_cwd(StartDir),
- exit(Reason)
+ case ets:lookup(?conn_table,Pid) of
+ [#conn{address=A,callback=CB}] ->
+ %% A connection crashed - remove the connection but don't die
+ ct_logs:tc_log_async(ct_error_notify,
+ "Connection process died: "
+ "Pid: ~p, Address: ~p, Callback: ~p\n"
+ "Reason: ~p\n\n",
+ [Pid,A,CB,Reason]),
+ catch CB:close(Pid),
+ loop(Mode,TestData,StartDir);
+ _ ->
+ %% Let process crash in case of error, this shouldn't happen!
+ io:format("\n\nct_util_server got EXIT from ~p: ~p\n\n",
+ [Pid,Reason]),
+ file:set_cwd(StartDir),
+ exit(Reason)
+ end
end.
-
close_connections([#conn{handle=Handle,callback=CB}|Conns]) ->
CB:close(Handle),
close_connections(Conns);
@@ -508,7 +541,7 @@ close_connections() ->
%%%
%%% @doc
override_silence_all_connections() ->
- Protocols = [telnet,ftp,rpc,snmp],
+ Protocols = [telnet,ftp,rpc,snmp,ssh],
override_silence_connections(Protocols),
Protocols.
@@ -545,7 +578,10 @@ silence_connections(Conns) when is_list(Conns) ->
set_testdata({silent_connections,Conns1}).
is_silenced(Conn) ->
- case get_testdata(silent_connections) of
+ is_silenced(Conn, infinity).
+
+is_silenced(Conn, Timeout) ->
+ case get_testdata(silent_connections, Timeout) of
Conns when is_list(Conns) ->
case lists:keysearch(Conn,1,Conns) of
{value,{Conn,true}} ->
@@ -553,6 +589,8 @@ is_silenced(Conn) ->
_ ->
false
end;
+ Error = {error,_} ->
+ Error;
_ ->
false
end.
@@ -827,15 +865,29 @@ get_profile_data(Profile, Key, StartDir) ->
%%%-----------------------------------------------------------------
%%% Internal functions
call(Msg) ->
- MRef = erlang:monitor(process,whereis(ct_util_server)),
- Ref = make_ref(),
- ct_util_server ! {Msg,{self(),Ref}},
- receive
- {Ref, Result} ->
- erlang:demonitor(MRef, [flush]),
- Result;
- {'DOWN',MRef,process,_,Reason} ->
- {error,{ct_util_server_down,Reason}}
+ call(Msg, infinity).
+
+call(Msg, Timeout) ->
+ case {self(),whereis(ct_util_server)} of
+ {_,undefined} ->
+ {error,ct_util_server_not_running};
+ {Pid,Pid} ->
+ %% the caller is ct_util_server, which must
+ %% be a mistake
+ {error,bad_invocation};
+ {Self,Pid} ->
+ MRef = erlang:monitor(process, Pid),
+ Ref = make_ref(),
+ ct_util_server ! {Msg,{Self,Ref}},
+ receive
+ {Ref, Result} ->
+ erlang:demonitor(MRef, [flush]),
+ Result;
+ {'DOWN',MRef,process,_,Reason} ->
+ {error,{ct_util_server_down,Reason}}
+ after
+ Timeout -> {error,timeout}
+ end
end.
return({To,Ref},Result) ->
diff --git a/lib/common_test/src/ct_util.hrl b/lib/common_test/src/ct_util.hrl
index bde832811a..196b5e46d0 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -34,18 +34,25 @@
profile=[],
logdir=["."],
logopts=[],
+ basic_html=[],
+ verbosity=[],
+ silent_connections=[],
cover=[],
config=[],
userconfig=[],
event_handler=[],
ct_hooks=[],
enable_builtin_hooks=true,
+ release_shell=false,
include=[],
+ auto_compile=[],
+ stylesheet=[],
multiply_timetraps=[],
scale_timetraps=[],
+ create_priv_dir=[],
alias=[],
tests=[],
- merge_tests = true }).
+ merge_tests=true}).
-record(cover, {app=none,
level=details,
@@ -63,3 +70,11 @@
-define(ct_config_txt, ct_config_plain).
-define(ct_profile_file, ".common_test").
+
+-define(css_default, "ct_default.css").
+-define(sortable_table_name, "SortableTable").
+-define(jquery_script, "jquery-latest.js").
+-define(tablesorter_script, "jquery.tablesorter.min.js").
+
+%% Logging information for error handler
+-record(conn_log, {client, name, address, action, module}).
diff --git a/lib/common_test/src/cth_conn_log.erl b/lib/common_test/src/cth_conn_log.erl
new file mode 100644
index 0000000000..3af89db3a5
--- /dev/null
+++ b/lib/common_test/src/cth_conn_log.erl
@@ -0,0 +1,124 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+%%----------------------------------------------------------------------
+%% CT hook for logging of connections.
+%%
+%% HookOptions can be hardcoded in the test suite:
+%%
+%% suite() ->
+%% [{ct_hooks, [{cth_conn_log,
+%% [{ct_netconfc:conn_mod(),ct_netconfc:hook_options()}]}]}].
+%%
+%% or specified in a configuration file:
+%%
+%% {ct_conn_log,[{ct_netconfc:conn_mod(),ct_netconfc:hook_options()}]}.
+%%
+%% The conn_mod() is the common test module implementing the protocol,
+%% e.g. ct_netconfc, ct_telnet, etc. This module must log by calling
+%%
+%% error_logger:info_report(ConnLogInfo,Data).
+%% ConnLogInfo = #conn_log{} | {ct_connection,Action,ConnName}
+%% Action = open | close | send | recv | term()
+%% ConnName = atom() - The 'KeyOrName' argument used when opening the connection
+%%
+%% ct_conn_log_h will print to html log or separate file (depending on
+%% log_type() option). conn_mod() must implement and export
+%%
+%% format_data(log_type(), Data).
+%%
+%% If logging to separate file, ct_conn_log_h will also log error
+%% reports which are witten like this:
+%%
+%% error_logger:error_report([{ct_connection,ConnName} | Report]).
+%%
+%%----------------------------------------------------------------------
+-module(cth_conn_log).
+
+-include_lib("common_test/include/ct.hrl").
+
+-export([init/2,
+ pre_init_per_testcase/3,
+ post_end_per_testcase/4]).
+
+-spec init(Id, HookOpts) -> Result when
+ Id :: term(),
+ HookOpts :: ct:hook_options(),
+ Result :: {ok,[{ct_netconfc:conn_mod(),
+ {ct_netconfc:log_type(),[ct_netconfc:key_or_name()]}}]}.
+init(_Id, HookOpts) ->
+ ConfOpts = ct:get_config(ct_conn_log,[]),
+ {ok,merge_log_info(ConfOpts,HookOpts)}.
+
+merge_log_info([{Mod,ConfOpts}|ConfList],HookList) ->
+ {Opts,HookList1} =
+ case lists:keytake(Mod,1,HookList) of
+ false ->
+ {ConfOpts,HookList};
+ {value,{_,HookOpts},HL1} ->
+ {ConfOpts ++ HookOpts, HL1} % ConfOpts overwrites HookOpts!
+ end,
+ [{Mod,get_log_opts(Opts)} | merge_log_info(ConfList,HookList1)];
+merge_log_info([],HookList) ->
+ [{Mod,get_log_opts(Opts)} || {Mod,Opts} <- HookList].
+
+get_log_opts(Opts) ->
+ LogType = proplists:get_value(log_type,Opts,html),
+ Hosts = proplists:get_value(hosts,Opts,[]),
+ {LogType,Hosts}.
+
+
+pre_init_per_testcase(TestCase,Config,CthState) ->
+ Logs =
+ lists:map(
+ fun({ConnMod,{LogType,Hosts}}) ->
+ case LogType of
+ LogType when LogType==raw; LogType==pretty ->
+ Dir = ?config(priv_dir,Config),
+ TCStr = atom_to_list(TestCase),
+ ConnModStr = atom_to_list(ConnMod),
+ DefLogName = TCStr ++ "-" ++ ConnModStr ++ ".txt",
+ DefLog = filename:join(Dir,DefLogName),
+ Ls = [{Host,
+ filename:join(Dir,TCStr ++ "-"++
+ atom_to_list(Host) ++ "-" ++
+ ConnModStr ++
+ ".txt")}
+ || Host <- Hosts]
+ ++[{default,DefLog}],
+ Str =
+ "<table borders=1>"
+ "<b>" ++ ConnModStr ++ " logs:</b>\n" ++
+ [io_lib:format(
+ "<tr><td>~p</td><td><a href=~p>~s</a></td></tr>",
+ [S,L,filename:basename(L)])
+ || {S,L} <- Ls] ++
+ "</table>",
+ io:format(Str,[]),
+ {ConnMod,{LogType,Ls}};
+ _ ->
+ {ConnMod,{LogType,[]}}
+ end
+ end,
+ CthState),
+ error_logger:add_report_handler(ct_conn_log_h,{group_leader(),Logs}),
+ {Config,CthState}.
+
+post_end_per_testcase(_TestCase,_Config,Return,CthState) ->
+ error_logger:delete_report_handler(ct_conn_log_h),
+ {Return,CthState}.
diff --git a/lib/common_test/src/cth_log_redirect.erl b/lib/common_test/src/cth_log_redirect.erl
index 14663b7738..77f57c6195 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. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -31,22 +31,22 @@
%% Event handler Callbacks
-export([init/1,
handle_event/2, handle_call/2, handle_info/2,
- terminate/2]).
+ terminate/1]).
id(_Opts) ->
?MODULE.
init(?MODULE, _Opts) ->
error_logger:add_report_handler(?MODULE),
- tc_log.
+ tc_log_async.
-post_init_per_group(Group, Config, Result, tc_log) ->
+post_init_per_group(Group, Config, Result, tc_log_async) ->
case lists:member(parallel,proplists:get_value(
tc_group_properties,Config,[])) of
true ->
{Result, {set_log_func(ct_log),Group}};
false ->
- {Result, tc_log}
+ {Result, tc_log_async}
end;
post_init_per_group(_Group, _Config, Result, State) ->
{Result, State}.
@@ -58,14 +58,14 @@ post_end_per_testcase(_TC, _Config, Result, State) ->
{Result, State}.
pre_end_per_group(Group, Config, {ct_log, Group}) ->
- {Config, set_log_func(tc_log)};
+ {Config, set_log_func(tc_log_async)};
pre_end_per_group(_Group, Config, State) ->
{Config, State}.
%% Copied and modified from sasl_report_tty_h.erl
init(_Type) ->
- {ok, tc_log}.
+ {ok, tc_log_async}.
handle_event({_Type, GL, _Msg}, State) when node(GL) /= node() ->
{ok, State};
@@ -101,7 +101,8 @@ handle_call({set_logfunc,NewLogFunc},_) ->
{ok, NewLogFunc, NewLogFunc};
handle_call(_Query, _State) -> {error, bad_query}.
-terminate(_Reason, _Type) ->
+terminate(_State) ->
+ error_logger:delete_report_handler(?MODULE),
[].
tag_event(Event) ->
diff --git a/lib/common_test/src/cth_surefire.erl b/lib/common_test/src/cth_surefire.erl
new file mode 100644
index 0000000000..76b0f0b5ea
--- /dev/null
+++ b/lib/common_test/src/cth_surefire.erl
@@ -0,0 +1,219 @@
+%%% @doc Common Test Framework functions handling test specifications.
+%%%
+%%% <p>This module creates a junit report of the test run if plugged in
+%%% as a suite_callback.</p>
+
+-module(cth_surefire).
+
+%% Suite Callbacks
+-export([id/1, init/2]).
+
+-export([pre_init_per_suite/3]).
+-export([post_init_per_suite/4]).
+-export([pre_end_per_suite/3]).
+-export([post_end_per_suite/4]).
+
+-export([pre_init_per_group/3]).
+-export([post_init_per_group/4]).
+-export([pre_end_per_group/3]).
+-export([post_end_per_group/4]).
+
+-export([pre_init_per_testcase/3]).
+-export([post_end_per_testcase/4]).
+
+-export([on_tc_fail/3]).
+-export([on_tc_skip/3]).
+
+-export([terminate/1]).
+
+-record(state, { filepath, axis, properties, package, hostname,
+ curr_suite, curr_suite_ts, curr_group = [], curr_tc,
+ curr_log_dir, timer, tc_log,
+ test_cases = [],
+ test_suites = [] }).
+
+-record(testcase, { log, group, classname, name, time, failure, timestamp }).
+-record(testsuite, { errors, failures, hostname, name, tests,
+ time, timestamp, id, package,
+ properties, testcases }).
+
+id(Opts) ->
+ filename:absname(proplists:get_value(path, Opts, "junit_report.xml")).
+
+init(Path, Opts) ->
+ {ok, Host} = inet:gethostname(),
+ #state{ filepath = Path,
+ hostname = proplists:get_value(hostname,Opts,Host),
+ package = proplists:get_value(package,Opts),
+ axis = proplists:get_value(axis,Opts,[]),
+ properties = proplists:get_value(properties,Opts,[]),
+ timer = now() }.
+
+pre_init_per_suite(Suite,Config,#state{ test_cases = [] } = State) ->
+ {Config, init_tc(State#state{ curr_suite = Suite, curr_suite_ts = now() },
+ Config) };
+pre_init_per_suite(Suite,Config,State) ->
+ %% Have to close the previous suite
+ pre_init_per_suite(Suite,Config,close_suite(State)).
+
+post_init_per_suite(_Suite,Config, Result, State) ->
+ {Result, end_tc(init_per_suite,Config,Result,State)}.
+
+pre_end_per_suite(_Suite,Config,State) -> {Config, init_tc(State, Config)}.
+
+post_end_per_suite(_Suite,Config,Result,State) ->
+ {Result, end_tc(end_per_suite,Config,Result,State)}.
+
+pre_init_per_group(Group,Config,State) ->
+ {Config, init_tc(State#state{ curr_group = [Group|State#state.curr_group]},
+ Config)}.
+
+post_init_per_group(_Group,Config,Result,State) ->
+ {Result, end_tc(init_per_group,Config,Result,State)}.
+
+pre_end_per_group(_Group,Config,State) -> {Config, init_tc(State, Config)}.
+
+post_end_per_group(_Group,Config,Result,State) ->
+ NewState = end_tc(end_per_group, Config, Result, State),
+ {Result, NewState#state{ curr_group = tl(NewState#state.curr_group)}}.
+
+pre_init_per_testcase(_TC,Config,State) -> {Config, init_tc(State, Config)}.
+
+post_end_per_testcase(TC,Config,Result,State) ->
+ {Result, end_tc(TC,Config, Result,State)}.
+
+on_tc_fail(_TC, _Res, State = #state{test_cases = []}) ->
+ State;
+on_tc_fail(_TC, Res, State) ->
+ TCs = State#state.test_cases,
+ TC = hd(TCs),
+ NewTC = TC#testcase{
+ failure =
+ {fail,lists:flatten(io_lib:format("~p",[Res]))} },
+ State#state{ test_cases = [NewTC | tl(TCs)]}.
+
+on_tc_skip(Tc,{Type,_Reason} = Res, State) when Type == tc_auto_skip ->
+ do_tc_skip(Res, end_tc(Tc,[],Res,init_tc(State,[])));
+on_tc_skip(_Tc, _Res, State = #state{test_cases = []}) ->
+ State;
+on_tc_skip(_Tc, Res, State) ->
+ do_tc_skip(Res, State).
+
+do_tc_skip(Res, State) ->
+ TCs = State#state.test_cases,
+ TC = hd(TCs),
+ NewTC = TC#testcase{
+ failure =
+ {skipped,lists:flatten(io_lib:format("~p",[Res]))} },
+ State#state{ test_cases = [NewTC | tl(TCs)]}.
+
+init_tc(State, Config) when is_list(Config) == false ->
+ State#state{ timer = now(), tc_log = "" };
+init_tc(State, Config) ->
+ State#state{ timer = now(),
+ tc_log = proplists:get_value(tc_logfile, Config, [])}.
+
+end_tc(Func, Config, Res, State) when is_atom(Func) ->
+ end_tc(atom_to_list(Func), Config, Res, State);
+end_tc(Name, _Config, _Res, State = #state{ curr_suite = Suite,
+ curr_group = Groups,
+ timer = TS, tc_log = Log } ) ->
+ ClassName = atom_to_list(Suite),
+ PGroup = string:join([ atom_to_list(Group)||
+ Group <- lists:reverse(Groups)],"."),
+ TimeTakes = io_lib:format("~f",[timer:now_diff(now(),TS) / 1000000]),
+ State#state{ test_cases = [#testcase{ log = Log,
+ timestamp = now_to_string(TS),
+ classname = ClassName,
+ group = PGroup,
+ name = Name,
+ time = TimeTakes,
+ failure = passed }| State#state.test_cases]}.
+close_suite(#state{ test_cases = [] } = State) ->
+ State;
+close_suite(#state{ test_cases = TCs } = State) ->
+ Total = length(TCs),
+ Succ = length(lists:filter(fun(#testcase{ failure = F }) ->
+ F == passed
+ end,TCs)),
+ Fail = Total - Succ,
+ TimeTaken = timer:now_diff(now(),State#state.curr_suite_ts) / 1000000,
+ Suite = #testsuite{ name = atom_to_list(State#state.curr_suite),
+ package = State#state.package,
+ time = io_lib:format("~f",[TimeTaken]),
+ timestamp = now_to_string(State#state.curr_suite_ts),
+ errors = Fail, tests = Total,
+ testcases = lists:reverse(TCs) },
+ State#state{ test_cases = [],
+ test_suites = [Suite | State#state.test_suites]}.
+
+terminate(State = #state{ test_cases = [] }) ->
+ {ok,D} = file:open(State#state.filepath,[write,{encoding,utf8}]),
+ io:format(D, "<?xml version=\"1.0\" encoding= \"UTF-8\" ?>", []),
+ io:format(D, to_xml(State), []),
+ catch file:sync(D),
+ catch file:close(D);
+terminate(State) ->
+ %% Have to close the last suite
+ terminate(close_suite(State)).
+
+
+
+to_xml(#testcase{ group = Group, classname = CL, log = L, name = N, time = T, timestamp = TS, failure = F}) ->
+ ["<testcase ",
+ [["group=\"",Group,"\""]||Group /= ""]," "
+ "name=\"",N,"\" "
+ "time=\"",T,"\" "
+ "timestamp=\"",TS,"\" "
+ "log=\"",L,"\">",
+ case F of
+ passed ->
+ [];
+ {skipped,Reason} ->
+ ["<skipped type=\"skip\" message=\"Test ",N," in ",CL,
+ " skipped!\">", sanitize(Reason),"</skipped>"];
+ {fail,Reason} ->
+ ["<failure message=\"Test ",N," in ",CL," failed!\" type=\"crash\">",
+ sanitize(Reason),"</failure>"]
+ end,"</testcase>"];
+to_xml(#testsuite{ package = P, hostname = H, errors = E, time = Time,
+ timestamp = TS, tests = T, name = N, testcases = Cases }) ->
+ ["<testsuite ",
+ [["package=\"",P,"\" "]||P /= undefined],
+ [["hostname=\"",P,"\" "]||H /= undefined],
+ [["name=\"",N,"\" "]||N /= undefined],
+ [["time=\"",Time,"\" "]||Time /= undefined],
+ [["timestamp=\"",TS,"\" "]||TS /= undefined],
+ "errors=\"",integer_to_list(E),"\" "
+ "tests=\"",integer_to_list(T),"\">",
+ [to_xml(Case) || Case <- Cases],
+ "</testsuite>"];
+to_xml(#state{ test_suites = TestSuites, axis = Axis, properties = Props }) ->
+ ["<testsuites>",properties_to_xml(Axis,Props),
+ [to_xml(TestSuite) || TestSuite <- TestSuites],"</testsuites>"].
+
+properties_to_xml(Axis,Props) ->
+ ["<properties>",
+ [["<property name=\"",Name,"\" axis=\"yes\" value=\"",Value,"\" />"] || {Name,Value} <- Axis],
+ [["<property name=\"",Name,"\" value=\"",Value,"\" />"] || {Name,Value} <- Props],
+ "</properties>"
+ ].
+
+sanitize([$>|T]) ->
+ "&gt;" ++ sanitize(T);
+sanitize([$<|T]) ->
+ "&lt;" ++ sanitize(T);
+sanitize([$"|T]) ->
+ "&quot;" ++ sanitize(T);
+sanitize([$'|T]) ->
+ "&apos;" ++ sanitize(T);
+sanitize([$&|T]) ->
+ "&amp;" ++ sanitize(T);
+sanitize([H|T]) ->
+ [H|sanitize(T)];
+sanitize([]) ->
+ [].
+
+now_to_string(Now) ->
+ {{YY,MM,DD},{HH,Mi,SS}} = calendar:now_to_local_time(Now),
+ io_lib:format("~p-~2..0B-~2..0BT~2..0B:~2..0B:~2..0B",[YY,MM,DD,HH,Mi,SS]).
diff --git a/lib/common_test/src/vts.erl b/lib/common_test/src/vts.erl
index cc8a932887..b340c6fdd1 100644
--- a/lib/common_test/src/vts.erl
+++ b/lib/common_test/src/vts.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -766,10 +766,6 @@ report1(tc_done,{_Suite,init_per_group,_},State) ->
State;
report1(tc_done,{_Suite,end_per_group,_},State) ->
State;
-report1(tc_done,{_Suite,ct_init_per_group,_},State) ->
- State;
-report1(tc_done,{_Suite,ct_end_per_group,_},State) ->
- State;
report1(tc_done,{_Suite,_Case,ok},State) ->
State#state{ok=State#state.ok+1};
report1(tc_done,{_Suite,_Case,{failed,_Reason}},State) ->
diff --git a/lib/common_test/test/Makefile b/lib/common_test/test/Makefile
index 284612b8f7..7691920993 100644
--- a/lib/common_test/test/Makefile
+++ b/lib/common_test/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2011. All Rights Reserved.
+# Copyright Ericsson AB 2008-2012. 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
@@ -29,6 +29,7 @@ MODULES= \
ct_test_support_eh \
ct_userconfig_callback \
ct_smoke_test_SUITE \
+ ct_priv_dir_SUITE \
ct_event_handler_SUITE \
ct_config_info_SUITE \
ct_groups_test_1_SUITE \
@@ -38,13 +39,21 @@ MODULES= \
ct_sequence_1_SUITE \
ct_repeat_1_SUITE \
ct_testspec_1_SUITE \
+ ct_testspec_2_SUITE \
ct_skip_SUITE \
ct_error_SUITE \
ct_test_server_if_1_SUITE \
ct_config_SUITE \
ct_master_SUITE \
ct_misc_1_SUITE \
- ct_hooks_SUITE
+ ct_hooks_SUITE \
+ ct_netconfc_SUITE \
+ ct_basic_html_SUITE \
+ ct_auto_compile_SUITE \
+ ct_verbosity_SUITE \
+ ct_shell_SUITE \
+ ct_system_error_SUITE \
+ ct_snmp_SUITE
ERL_FILES= $(MODULES:%=%.erl)
@@ -96,10 +105,10 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec:
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(ERL_FILES) $(COVERFILE) $(RELSYSDIR)
- $(INSTALL_DATA) common_test.spec $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(ERL_FILES) $(COVERFILE) "$(RELSYSDIR)"
+ $(INSTALL_DATA) common_test.spec "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/common_test/test/common_test.spec b/lib/common_test/test/common_test.spec
index 8755b08117..8bec66d6f2 100644
--- a/lib/common_test/test/common_test.spec
+++ b/lib/common_test/test/common_test.spec
@@ -1 +1 @@
-{suites,"../common_test_test",all}. \ No newline at end of file
+{suites,"../common_test_test",all}.
diff --git a/lib/common_test/test/ct_auto_compile_SUITE.erl b/lib/common_test/test/ct_auto_compile_SUITE.erl
new file mode 100644
index 0000000000..cc546ed30d
--- /dev/null
+++ b/lib/common_test/test/ct_auto_compile_SUITE.erl
@@ -0,0 +1,187 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%%-------------------------------------------------------------------
+%%% File: ct_auto_compile_SUITE
+%%%
+%%% Description:
+%%%
+%%%
+%%% The suites used for the test are located in the data directory.
+%%%-------------------------------------------------------------------
+-module(ct_auto_compile_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+-define(eh, ct_test_support_eh).
+
+%%--------------------------------------------------------------------
+%% TEST SERVER CALLBACK FUNCTIONS
+%%--------------------------------------------------------------------
+
+%%--------------------------------------------------------------------
+%% Description: Since Common Test starts another Test Server
+%% instance, the tests need to be performed on a separate node (or
+%% there will be clashes with logging processes etc).
+%%--------------------------------------------------------------------
+init_per_suite(Config) ->
+ Config1 = ct_test_support:init_per_suite(Config),
+ Config1.
+
+end_per_suite(Config) ->
+ ct_test_support:end_per_suite(Config).
+
+init_per_testcase(TestCase, Config) ->
+ ct_test_support:init_per_testcase(TestCase, Config).
+
+end_per_testcase(TestCase, Config) ->
+ ct_test_support:end_per_testcase(TestCase, Config).
+
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [ac_flag, ac_spec].
+
+groups() ->
+ [].
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+
+
+%%--------------------------------------------------------------------
+%% TEST CASES
+%%--------------------------------------------------------------------
+
+%%%-----------------------------------------------------------------
+%%%
+ac_flag(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
+ file:copy(filename:join(DataDir, "bad_SUITE.erl"),
+ filename:join(PrivDir, "bad_SUITE.erl")),
+ Suite = filename:join(DataDir, "dummy_SUITE"),
+ compile:file(Suite, [{outdir,PrivDir}]),
+ {Opts,ERPid} = setup([{dir,PrivDir},
+ {auto_compile,false},
+ {label,"ac_flag"}],
+ Config),
+
+ ok = ct_test_support:run(Opts, Config),
+ Events = ct_test_support:get_events(ERPid, Config),
+
+ ct_test_support:log_events(ac_flag,
+ reformat(Events, ?eh),
+ PrivDir,
+ Opts),
+
+ TestEvents = events_to_check(ac_flag),
+ ok = ct_test_support:verify_events(TestEvents, Events, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+ac_spec(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
+ file:copy(filename:join(DataDir, "bad_SUITE.erl"),
+ filename:join(PrivDir, "bad_SUITE.erl")),
+ TestSpec = [{label,ac_spec},
+ {auto_compile,false},
+ {suites,PrivDir,all}],
+ FileName = filename:join(?config(priv_dir, Config),"ac_spec.spec"),
+ {ok,Dev} = file:open(FileName, [write]),
+ [io:format(Dev, "~p.~n", [Term]) || Term <- TestSpec],
+ file:close(Dev),
+
+ {Opts,ERPid} = setup([{spec,FileName}], Config),
+ ok = ct_test_support:run(Opts, Config),
+ Events = ct_test_support:get_events(ERPid, Config),
+
+ ct_test_support:log_events(ac_spec,
+ reformat(Events, ?eh),
+ PrivDir,
+ Opts),
+
+ TestEvents = events_to_check(ac_spec),
+ ok = ct_test_support:verify_events(TestEvents, Events, Config).
+
+
+%%%-----------------------------------------------------------------
+%%% HELP FUNCTIONS
+%%%-----------------------------------------------------------------
+
+setup(Test, Config) ->
+ Opts0 = ct_test_support:get_opts(Config),
+ Level = ?config(trace_level, Config),
+ EvHArgs = [{cbm,ct_test_support},{trace_level,Level}],
+ Opts = Opts0 ++ [{event_handler,{?eh,EvHArgs}}|Test],
+ ERPid = ct_test_support:start_event_receiver(Config),
+ {Opts,ERPid}.
+
+reformat(Events, EH) ->
+ ct_test_support:reformat(Events, EH).
+ %reformat(Events, _EH) ->
+ % Events.
+
+%%%-----------------------------------------------------------------
+%%% TEST EVENTS
+%%%-----------------------------------------------------------------
+events_to_check(Test) ->
+ %% 2 tests (ct:run_test + script_start) is default
+ events_to_check(Test, 2).
+
+events_to_check(_, 0) ->
+ [];
+events_to_check(Test, N) ->
+ test_events(Test) ++ events_to_check(Test, N-1).
+
+test_events(ac_flag) ->
+ [
+ {ct_test_support_eh,start_logging,{'DEF','RUNDIR'}},
+ {ct_test_support_eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {ct_test_support_eh,start_info,{1,1,3}},
+ {ct_test_support_eh,tc_start,{dummy_SUITE,init_per_suite}},
+ {ct_test_support_eh,tc_done,{dummy_SUITE,init_per_suite,ok}},
+ {ct_test_support_eh,test_stats,{1,1,{1,0}}},
+ {ct_test_support_eh,tc_start,{dummy_SUITE,end_per_suite}},
+ {ct_test_support_eh,tc_done,{dummy_SUITE,end_per_suite,ok}},
+ {ct_test_support_eh,test_done,{'DEF','STOP_TIME'}},
+ {ct_test_support_eh,stop_logging,[]}
+ ];
+
+test_events(ac_spec) ->
+ [
+ {ct_test_support_eh,start_logging,{'DEF','RUNDIR'}},
+ {ct_test_support_eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {ct_test_support_eh,start_info,{1,1,3}},
+ {ct_test_support_eh,tc_start,{dummy_SUITE,init_per_suite}},
+ {ct_test_support_eh,tc_done,{dummy_SUITE,init_per_suite,ok}},
+ {ct_test_support_eh,test_stats,{1,1,{1,0}}},
+ {ct_test_support_eh,tc_start,{dummy_SUITE,end_per_suite}},
+ {ct_test_support_eh,tc_done,{dummy_SUITE,end_per_suite,ok}},
+ {ct_test_support_eh,test_done,{'DEF','STOP_TIME'}},
+ {ct_test_support_eh,stop_logging,[]}
+ ].
diff --git a/erts/test/autoimport_SUITE_data/dummy.txt b/lib/common_test/test/ct_auto_compile_SUITE_data/bad_SUITE.erl
index 972643e527..b270c28849 100644
--- a/erts/test/autoimport_SUITE_data/dummy.txt
+++ b/lib/common_test/test/ct_auto_compile_SUITE_data/bad_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -15,5 +15,9 @@
%% under the License.
%%
%% %CopyrightEnd%
-%%
-%% Purpouse: Dummy
+
+-module(bad_SUITE).
+
+-compile(export_all).
+
+bad_bad_suite
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
new file mode 100644
index 0000000000..0bb2e388c7
--- /dev/null
+++ b/lib/common_test/test/ct_auto_compile_SUITE_data/dummy_SUITE.erl
@@ -0,0 +1,130 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+
+-module(dummy_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+
+%%--------------------------------------------------------------------
+%% @spec suite() -> Info
+%% Info = [tuple()]
+%% @end
+%%--------------------------------------------------------------------
+suite() ->
+ [{timetrap,{seconds,30}}].
+
+%%--------------------------------------------------------------------
+%% @spec init_per_suite(Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+init_per_suite(Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% @spec end_per_suite(Config0) -> void() | {save_config,Config1}
+%% Config0 = Config1 = [tuple()]
+%% @end
+%%--------------------------------------------------------------------
+end_per_suite(_Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% @spec init_per_group(GroupName, Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% GroupName = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+init_per_group(_GroupName, Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% @spec end_per_group(GroupName, Config0) ->
+%% void() | {save_config,Config1}
+%% GroupName = atom()
+%% Config0 = Config1 = [tuple()]
+%% @end
+%%--------------------------------------------------------------------
+end_per_group(_GroupName, _Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% @spec init_per_testcase(TestCase, Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% TestCase = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+init_per_testcase(_TestCase, Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% @spec end_per_testcase(TestCase, Config0) ->
+%% void() | {save_config,Config1} | {fail,Reason}
+%% TestCase = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+end_per_testcase(_TestCase, _Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% @spec groups() -> [Group]
+%% Group = {GroupName,Properties,GroupsAndTestCases}
+%% GroupName = atom()
+%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
+%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]
+%% TestCase = atom()
+%% Shuffle = shuffle | {shuffle,{integer(),integer(),integer()}}
+%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
+%% repeat_until_any_ok | repeat_until_any_fail
+%% N = integer() | forever
+%% @end
+%%--------------------------------------------------------------------
+groups() ->
+ [].
+
+%%--------------------------------------------------------------------
+%% @spec all() -> GroupsAndTestCases | {skip,Reason}
+%% GroupsAndTestCases = [{group,GroupName} | TestCase]
+%% GroupName = atom()
+%% TestCase = atom()
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+all() ->
+ [ok,fail,skip].
+
+
+ok(_Config) ->
+ ok.
+
+fail(Config) ->
+ tuple_to_list(Config),
+ ok.
+
+skip(_Config) ->
+ {skip,"should be skipped"}.
diff --git a/lib/common_test/test/ct_basic_html_SUITE.erl b/lib/common_test/test/ct_basic_html_SUITE.erl
new file mode 100644
index 0000000000..a5f2e6197e
--- /dev/null
+++ b/lib/common_test/test/ct_basic_html_SUITE.erl
@@ -0,0 +1,180 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%%-------------------------------------------------------------------
+%%% File: ct_basic_html_SUITE
+%%%
+%%% Description:
+%%%
+%%%
+%%% The suites used for the test are located in the data directory.
+%%%-------------------------------------------------------------------
+-module(ct_basic_html_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+-define(eh, ct_test_support_eh).
+
+%%--------------------------------------------------------------------
+%% TEST SERVER CALLBACK FUNCTIONS
+%%--------------------------------------------------------------------
+
+%%--------------------------------------------------------------------
+%% Description: Since Common Test starts another Test Server
+%% instance, the tests need to be performed on a separate node (or
+%% there will be clashes with logging processes etc).
+%%--------------------------------------------------------------------
+init_per_suite(Config) ->
+ Config1 = ct_test_support:init_per_suite(Config),
+ Config1.
+
+end_per_suite(Config) ->
+ ct_test_support:end_per_suite(Config).
+
+init_per_testcase(TestCase, Config) ->
+ ct_test_support:init_per_testcase(TestCase, Config).
+
+end_per_testcase(TestCase, Config) ->
+ ct_test_support:end_per_testcase(TestCase, Config).
+
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [basic_flag, basic_spec].
+
+groups() ->
+ [].
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+
+
+%%--------------------------------------------------------------------
+%% TEST CASES
+%%--------------------------------------------------------------------
+
+%%%-----------------------------------------------------------------
+%%%
+basic_flag(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Suites = [filename:join(DataDir, "babbling_SUITE")],
+ {Opts,ERPid} = setup([{suite,Suites},
+ {basic_html,true},
+ {label,"basic_flag"}],
+ Config),
+
+ ok = ct_test_support:run(Opts, Config),
+ Events = ct_test_support:get_events(ERPid, Config),
+
+ ct_test_support:log_events(basic_flag,
+ reformat(Events, ?eh),
+ ?config(priv_dir, Config),
+ Opts),
+
+ TestEvents = events_to_check(basic_flag),
+ ok = ct_test_support:verify_events(TestEvents, Events, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+basic_spec(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ TestSpec = [{label,basic_spec},
+ {basic_html,true},
+ {suites,DataDir,babbling_SUITE}],
+ FileName = filename:join(?config(priv_dir, Config),"basic_spec.spec"),
+ {ok,Dev} = file:open(FileName, [write]),
+ [io:format(Dev, "~p.~n", [Term]) || Term <- TestSpec],
+ file:close(Dev),
+
+ {Opts,ERPid} = setup([{spec,FileName}], Config),
+ ok = ct_test_support:run(Opts, Config),
+ Events = ct_test_support:get_events(ERPid, Config),
+
+ ct_test_support:log_events(basic_spec,
+ reformat(Events, ?eh),
+ ?config(priv_dir, Config),
+ Opts),
+
+ TestEvents = events_to_check(basic_spec),
+ ok = ct_test_support:verify_events(TestEvents, Events, Config).
+
+
+%%%-----------------------------------------------------------------
+%%% HELP FUNCTIONS
+%%%-----------------------------------------------------------------
+
+setup(Test, Config) ->
+ Opts0 = ct_test_support:get_opts(Config),
+ Level = ?config(trace_level, Config),
+ EvHArgs = [{cbm,ct_test_support},{trace_level,Level}],
+ Opts = Opts0 ++ [{event_handler,{?eh,EvHArgs}}|Test],
+ ERPid = ct_test_support:start_event_receiver(Config),
+ {Opts,ERPid}.
+
+reformat(Events, EH) ->
+ ct_test_support:reformat(Events, EH).
+ %reformat(Events, _EH) ->
+ % Events.
+
+%%%-----------------------------------------------------------------
+%%% TEST EVENTS
+%%%-----------------------------------------------------------------
+events_to_check(Test) ->
+ %% 2 tests (ct:run_test + script_start) is default
+ events_to_check(Test, 2).
+
+events_to_check(_, 0) ->
+ [];
+events_to_check(Test, N) ->
+ test_events(Test) ++ events_to_check(Test, N-1).
+
+test_events(basic_flag) ->
+ [
+ {ct_test_support_eh,start_logging,{'DEF','RUNDIR'}},
+ {ct_test_support_eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {ct_test_support_eh,start_info,{1,1,3}},
+ {ct_test_support_eh,tc_start,{babbling_SUITE,init_per_suite}},
+ {ct_test_support_eh,tc_done,{babbling_SUITE,init_per_suite,ok}},
+ {ct_test_support_eh,test_stats,{1,1,{1,0}}},
+ {ct_test_support_eh,tc_start,{babbling_SUITE,end_per_suite}},
+ {ct_test_support_eh,tc_done,{babbling_SUITE,end_per_suite,ok}},
+ {ct_test_support_eh,test_done,{'DEF','STOP_TIME'}},
+ {ct_test_support_eh,stop_logging,[]}
+ ];
+
+test_events(basic_spec) ->
+ [
+ {ct_test_support_eh,start_logging,{'DEF','RUNDIR'}},
+ {ct_test_support_eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {ct_test_support_eh,start_info,{1,1,3}},
+ {ct_test_support_eh,tc_start,{babbling_SUITE,init_per_suite}},
+ {ct_test_support_eh,tc_done,{babbling_SUITE,init_per_suite,ok}},
+ {ct_test_support_eh,test_stats,{1,1,{1,0}}},
+ {ct_test_support_eh,tc_start,{babbling_SUITE,end_per_suite}},
+ {ct_test_support_eh,tc_done,{babbling_SUITE,end_per_suite,ok}},
+ {ct_test_support_eh,test_done,{'DEF','STOP_TIME'}},
+ {ct_test_support_eh,stop_logging,[]}
+ ].
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
new file mode 100644
index 0000000000..7a3ccf30e0
--- /dev/null
+++ b/lib/common_test/test/ct_basic_html_SUITE_data/babbling_SUITE.erl
@@ -0,0 +1,130 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+
+-module(babbling_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+
+%%--------------------------------------------------------------------
+%% @spec suite() -> Info
+%% Info = [tuple()]
+%% @end
+%%--------------------------------------------------------------------
+suite() ->
+ [{timetrap,{seconds,30}}].
+
+%%--------------------------------------------------------------------
+%% @spec init_per_suite(Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+init_per_suite(Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% @spec end_per_suite(Config0) -> void() | {save_config,Config1}
+%% Config0 = Config1 = [tuple()]
+%% @end
+%%--------------------------------------------------------------------
+end_per_suite(_Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% @spec init_per_group(GroupName, Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% GroupName = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+init_per_group(_GroupName, Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% @spec end_per_group(GroupName, Config0) ->
+%% void() | {save_config,Config1}
+%% GroupName = atom()
+%% Config0 = Config1 = [tuple()]
+%% @end
+%%--------------------------------------------------------------------
+end_per_group(_GroupName, _Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% @spec init_per_testcase(TestCase, Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% TestCase = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+init_per_testcase(_TestCase, Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% @spec end_per_testcase(TestCase, Config0) ->
+%% void() | {save_config,Config1} | {fail,Reason}
+%% TestCase = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+end_per_testcase(_TestCase, _Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% @spec groups() -> [Group]
+%% Group = {GroupName,Properties,GroupsAndTestCases}
+%% GroupName = atom()
+%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
+%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]
+%% TestCase = atom()
+%% Shuffle = shuffle | {shuffle,{integer(),integer(),integer()}}
+%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
+%% repeat_until_any_ok | repeat_until_any_fail
+%% N = integer() | forever
+%% @end
+%%--------------------------------------------------------------------
+groups() ->
+ [].
+
+%%--------------------------------------------------------------------
+%% @spec all() -> GroupsAndTestCases | {skip,Reason}
+%% GroupsAndTestCases = [{group,GroupName} | TestCase]
+%% GroupName = atom()
+%% TestCase = atom()
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+all() ->
+ [ok,fail,skip].
+
+
+ok(_Config) ->
+ ok.
+
+fail(Config) ->
+ tuple_to_list(Config),
+ ok.
+
+skip(_Config) ->
+ {skip,"should be skipped"}.
diff --git a/lib/common_test/test/ct_config_SUITE.erl b/lib/common_test/test/ct_config_SUITE.erl
index 18218bee47..0b1abae757 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -88,7 +88,8 @@ require(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
run_test(config_static_SUITE,
Config,
- {config, filename:join(DataDir, "config/config.txt")},
+ [{config, filename:join(DataDir, "config/shadow.txt")},
+ {config, filename:join(DataDir, "config/config.txt")}],
["config_static_SUITE"]).
install_config(Config) when is_list(Config) ->
@@ -106,7 +107,8 @@ userconfig_static(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
run_test(config_static_SUITE,
Config,
- {userconfig, {ct_config_xml, filename:join(DataDir, "config/config.xml")}},
+ [{userconfig, {ct_config_xml, filename:join(DataDir, "config/config.xml")}},
+ {config, filename:join(DataDir, "config/shadow.txt")}],
["config_static_SUITE"]).
userconfig_dynamic(Config) when is_list(Config) ->
@@ -121,7 +123,8 @@ testspec_legacy(Config) when is_list(Config) ->
make_spec(DataDir, ConfigDir,
"spec_legacy.spec",
[config_static_SUITE],
- [{config, filename:join(DataDir, "config/config.txt")}]),
+ [{config, filename:join(DataDir, "config/shadow.txt")},
+ {config, filename:join(DataDir, "config/config.txt")}]),
run_test(config_static_SUITE,
Config,
{spec, filename:join(ConfigDir, "spec_legacy.spec")},
@@ -134,7 +137,8 @@ testspec_static(Config) when is_list(Config) ->
make_spec(DataDir, ConfigDir,
"spec_static.spec",
[config_static_SUITE],
- [{userconfig, {ct_config_xml, filename:join(DataDir, "config/config.xml")}}]),
+ [{userconfig, {ct_config_xml, filename:join(DataDir, "config/config.xml")}},
+ {config, filename:join(DataDir, "config/shadow.txt")}]),
run_test(config_static_SUITE,
Config,
{spec, filename:join(ConfigDir, "spec_static.spec")},
@@ -179,13 +183,15 @@ run_test(Name, Config, CTConfig, SuiteNames)->
ExpEvents = events_to_check(Name),
ok = ct_test_support:verify_events(ExpEvents, TestEvents, Config).
-setup_env(Test, Config, CTConfig) ->
+setup_env(Test, Config, CTConfig) when is_list(CTConfig) ->
Opts0 = ct_test_support:get_opts(Config),
Level = ?config(trace_level, Config),
EvHArgs = [{cbm,ct_test_support},{trace_level,Level}],
- Opts = Opts0 ++ [Test,{event_handler,{?eh,EvHArgs}}, CTConfig],
+ Opts = Opts0 ++ [Test,{event_handler,{?eh,EvHArgs}} | CTConfig],
ERPid = ct_test_support:start_event_receiver(Config),
- {Opts,ERPid}.
+ {Opts,ERPid};
+setup_env(Test, Config, CTConfig) ->
+ setup_env(Test, Config, [CTConfig]).
reformat_events(Events, EH) ->
ct_test_support:reformat(Events, EH).
@@ -202,40 +208,49 @@ events_to_check(_, 0) ->
events_to_check(Test, N) ->
expected_events(Test) ++ events_to_check(Test, N-1).
+-define(ok(Name,Suite,Stat),{?eh,tc_start,{Suite,Name}},
+ {?eh,tc_done,{Suite,Name,ok}},
+ {?eh,test_stats,Stat}).
+-define(nok(Name,Suite,Reason,Stat),{?eh,tc_start,{Suite,Name}},
+ {?eh,tc_done,{Suite,Name,Reason}},
+ {?eh,test_stats,Stat}).
+
+-define(sok(Name,Stat),?ok(Name,config_static_SUITE,Stat)).
+-define(snok(Name,Reason,Stat),?nok(Name,config_static_SUITE,Reason,Stat)).
+
+-define(dok(Name,Stat),?ok(Name,config_dynamic_SUITE,Stat)).
+-define(dnok(Name,Reason,Stat),?nok(Name,config_dynamic_SUITE,Reason,Stat)).
+
expected_events(config_static_SUITE)->
[
{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,start_info,{1,1,8}},
+ {?eh,start_info,{1,1,'_'}},
{?eh,tc_start,{config_static_SUITE,init_per_suite}},
{?eh,tc_done,{config_static_SUITE,init_per_suite,ok}},
- {?eh,tc_start,{config_static_SUITE,test_get_config_simple}},
- {?eh,tc_done,{config_static_SUITE,test_get_config_simple,ok}},
- {?eh,test_stats,{1,0,{0,0}}},
- {?eh,tc_start,{config_static_SUITE,test_get_config_nested}},
- {?eh,tc_done,{config_static_SUITE,test_get_config_nested,ok}},
- {?eh,test_stats,{2,0,{0,0}}},
- {?eh,tc_start,{config_static_SUITE,test_default_suitewide}},
- {?eh,tc_done,{config_static_SUITE,test_default_suitewide,ok}},
- {?eh,test_stats,{3,0,{0,0}}},
- {?eh,tc_start,{config_static_SUITE,test_config_name_already_in_use1}},
- {?eh,tc_done,
- {config_static_SUITE,test_config_name_already_in_use1,{skipped,{config_name_already_in_use,[x1]}}}},
- {?eh,test_stats,{3,0,{1,0}}},
- {?eh,tc_start,{config_static_SUITE,test_default_tclocal}},
- {?eh,tc_done,{config_static_SUITE,test_default_tclocal,ok}},
- {?eh,test_stats,{4,0,{1,0}}},
- {?eh,tc_start,{config_static_SUITE,test_config_name_already_in_use2}},
- {?eh,tc_done,
- {config_static_SUITE,test_config_name_already_in_use2,
- {skipped,{config_name_already_in_use,[alias,x1]}}}},
- {?eh,test_stats,{4,0,{2,0}}},
- {?eh,tc_start,{config_static_SUITE,test_alias_tclocal}},
- {?eh,tc_done,{config_static_SUITE,test_alias_tclocal,ok}},
- {?eh,test_stats,{5,0,{2,0}}},
- {?eh,tc_start,{config_static_SUITE,test_get_config_undefined}},
- {?eh,tc_done,{config_static_SUITE,test_get_config_undefined,ok}},
- {?eh,test_stats,{6,0,{2,0}}},
+ ?sok(test_get_config_simple,{1,0,{0,0}}),
+ ?sok(test_get_config_nested,{2,0,{0,0}}),
+ ?sok(test_get_config_deep_nested,{3,0,{0,0}}),
+ ?sok(test_default_suitewide,{4,0,{0,0}}),
+ ?snok(test_config_name_already_in_use1,
+ {skipped,{config_name_already_in_use,[x1]}},{4,0,{1,0}}),
+ ?sok(test_default_tclocal,{5,0,{1,0}}),
+ ?snok(test_config_name_already_in_use2,
+ {skipped,{config_name_already_in_use,[alias,x1]}},{5,0,{2,0}}),
+ ?sok(test_alias_tclocal,{6,0,{2,0}}),
+ ?sok(test_get_config_undefined,{7,0,{2,0}}),
+ ?sok(test_require_subvals,{8,0,{2,0}}),
+ ?snok(test_require_subvals2,
+ {skipped,{require_failed,
+ {not_available,{gen_cfg,[a,b,c,d]}}}},{8,0,{2,1}}),
+ ?sok(test_require_deep_config,{9,0,{2,1}}),
+ ?sok(test_shadow_all,{10,0,{2,1}}),
+ ?sok(test_element,{11,0,{2,1}}),
+ ?sok(test_shadow_all_element,{12,0,{2,1}}),
+ ?sok(test_internal_deep,{13,0,{2,1}}),
+ ?sok(test_alias_tclocal_nested,{14,0,{2,1}}),
+ ?sok(test_alias_tclocal_nested_backward_compat,{15,0,{2,1}}),
+ ?sok(test_alias_tclocal_nested_backward_compat_subvals,{16,0,{2,1}}),
{?eh,tc_start,{config_static_SUITE,end_per_suite}},
{?eh,tc_done,{config_static_SUITE,end_per_suite,ok}},
{?eh,test_done,{'DEF','STOP_TIME'}},
@@ -246,29 +261,14 @@ expected_events(config_dynamic_SUITE)->
[
{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,start_info,{1,1,5}},
+ {?eh,start_info,{1,1,'_'}},
{?eh,tc_start,{config_dynamic_SUITE,init_per_suite}},
{?eh,tc_done,{config_dynamic_SUITE,init_per_suite,ok}},
- {?eh,tc_start,{config_dynamic_SUITE,test_get_known_variable}},
- {?eh,tc_done,
- {config_dynamic_SUITE,test_get_known_variable,ok}},
- {?eh,test_stats,{1,0,{0,0}}},
- {?eh,tc_start,{config_dynamic_SUITE,test_localtime_update}},
- {?eh,tc_done,{config_dynamic_SUITE,test_localtime_update,ok}},
- {?eh,test_stats,{2,0,{0,0}}},
- {?eh,tc_start,{config_dynamic_SUITE,test_server_pid}},
- {?eh,tc_done,{config_dynamic_SUITE,test_server_pid,ok}},
- {?eh,test_stats,{3,0,{0,0}}},
- {?eh,tc_start,
- {config_dynamic_SUITE,test_disappearable_variable}},
- {?eh,tc_done,
- {config_dynamic_SUITE,test_disappearable_variable,ok}},
- {?eh,test_stats,{4,0,{0,0}}},
- {?eh,tc_start,
- {config_dynamic_SUITE,test_disappearable_variable_alias}},
- {?eh,tc_done,
- {config_dynamic_SUITE,test_disappearable_variable_alias,ok}},
- {?eh,test_stats,{5,0,{0,0}}},
+ ?dok(test_get_known_variable,{1,0,{0,0}}),
+ ?dok(test_localtime_update,{2,0,{0,0}}),
+ ?dok(test_server_pid,{3,0,{0,0}}),
+ ?dok(test_disappearable_variable,{4,0,{0,0}}),
+ ?dok(test_disappearable_variable_alias,{5,0,{0,0}}),
{?eh,tc_start,{config_dynamic_SUITE,end_per_suite}},
{?eh,tc_done,{config_dynamic_SUITE,end_per_suite,ok}},
{?eh,test_done,{'DEF','STOP_TIME'}},
diff --git a/lib/common_test/test/ct_config_SUITE_data/config/config.txt b/lib/common_test/test/ct_config_SUITE_data/config/config.txt
index fcbffcd7f3..e4bcc5ba6b 100644
--- a/lib/common_test/test/ct_config_SUITE_data/config/config.txt
+++ b/lib/common_test/test/ct_config_SUITE_data/config/config.txt
@@ -2,7 +2,8 @@
{gen_cfg,
[
{a,a_value},
- {b,b_value}
+ {b,b_value},
+ {c,[{d,d_value}]}
]}.
{gen_cfg2,
[
diff --git a/lib/common_test/test/ct_config_SUITE_data/config/config.xml b/lib/common_test/test/ct_config_SUITE_data/config/config.xml
index 0a3e5f2e31..8eeff1482f 100644
--- a/lib/common_test/test/ct_config_SUITE_data/config/config.xml
+++ b/lib/common_test/test/ct_config_SUITE_data/config/config.xml
@@ -3,6 +3,7 @@
<gen_cfg>
<a>a_value</a>
<b>b_value</b>
+ <c><d>d_value</d></c>
</gen_cfg>
<gen_cfg2>
<c>"Hello, world!"</c>
diff --git a/lib/common_test/test/ct_config_SUITE_data/config/shadow.txt b/lib/common_test/test/ct_config_SUITE_data/config/shadow.txt
new file mode 100644
index 0000000000..865bf9255a
--- /dev/null
+++ b/lib/common_test/test/ct_config_SUITE_data/config/shadow.txt
@@ -0,0 +1,12 @@
+{x, suite}.
+{gen_cfg3,
+ [
+ {l,
+ [
+ {m,
+ [
+ {n, "n"},
+ {o, 'o'}
+ ]}
+ ]}
+ ]}.
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 8751a2e8f3..2e1ad651e8 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. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -46,7 +46,7 @@ suite() ->
{require, gen_cfg3},
{require, alias, gen_cfg},
%% x1 default value
- {x1, {x,suite}}
+ {default_config, x1, {x,suite}}
].
init_per_suite(Config) ->
@@ -55,14 +55,24 @@ init_per_suite(Config) ->
end_per_suite(_) ->
ok.
-all() -> [test_get_config_simple, test_get_config_nested, test_default_suitewide,
+all() -> [test_get_config_simple, test_get_config_nested,
+ test_get_config_deep_nested, test_default_suitewide,
test_config_name_already_in_use1, test_default_tclocal,
test_config_name_already_in_use2, test_alias_tclocal,
- test_get_config_undefined].
-
-init_per_testcase(_, Config) ->
+ test_get_config_undefined,
+ test_require_subvals,test_require_subvals2,test_require_deep_config,
+ test_shadow_all,test_element,test_shadow_all_element,
+ test_internal_deep, test_alias_tclocal_nested,
+ test_alias_tclocal_nested_backward_compat,
+ test_alias_tclocal_nested_backward_compat_subvals
+].
+
+init_per_testcase(_,Config) ->
Config.
+end_per_testcase(test_alias_tclocal_nested_backward_compat, _) ->
+ os:putenv("COMMON_TEST_ALIAS_TOP",""),
+ ok;
end_per_testcase(_, _) ->
ok.
@@ -76,6 +86,11 @@ test_get_config_nested(_)->
a_value = ct:get_config({gen_cfg, a}),
ok.
+%% test getting a deep nested value
+test_get_config_deep_nested(_)->
+ d_value = ct:get_config({gen_cfg, c, d}),
+ ok.
+
%% test suite-wide default value
test_default_suitewide(_)->
suite = ct:get_config(x1),
@@ -112,12 +127,73 @@ test_config_name_already_in_use2(_) ->
%% test aliases
test_alias_tclocal() ->
[{require,newalias,gen_cfg}].
-test_alias_tclocal(_) ->
- A = [{a,a_value},{b,b_value}] = ct:get_config(newalias),
+test_alias_tclocal(C) when is_list(C) ->
+ test_alias_tclocal(newalias);
+test_alias_tclocal(Alias) when is_atom(Alias) ->
+ A = [{a,a_value},{b,b_value},{c,[{d,d_value}]}] = ct:get_config(Alias),
A = ct:get_config(gen_cfg),
+ B = b_value = ct:get_config({Alias,b}),
+ B = ct:get_config({gen_cfg,b}),
+ ok.
+
+%% test nested aliases
+test_alias_tclocal_nested() ->
+ [{require,newalias2,{gen_cfg,c}}].
+test_alias_tclocal_nested(_) ->
+ A = [{d,d_value}] = ct:get_config(newalias2),
+ A = ct:get_config({gen_cfg,c}),
+ B = d_value = ct:get_config({newalias2,d}),
+ B = ct:get_config({gen_cfg,c,d}),
ok.
+%% test nested aliases backward compat option
+test_alias_tclocal_nested_backward_compat() ->
+ os:putenv("COMMON_TEST_ALIAS_TOP","true"),
+ [{require,newalias3,{gen_cfg,c}}].
+test_alias_tclocal_nested_backward_compat(_) ->
+ test_alias_tclocal(newalias3).
+
+%% test nested aliases backward compat option
+test_alias_tclocal_nested_backward_compat_subvals() ->
+ [{require,newalias4,{gen_cfg,[c]}}].
+test_alias_tclocal_nested_backward_compat_subvals(_) ->
+ test_alias_tclocal(newalias4).
+
%% test for getting undefined variables
test_get_config_undefined(_) ->
undefined = ct:get_config(y1),
ok.
+
+test_require_subvals() ->
+ [{require, {gen_cfg,[a,b,c]}}].
+test_require_subvals(_) ->
+ ok.
+
+test_require_subvals2() ->
+ [{require, {gen_cfg,[a,b,c,d]}}].
+test_require_subvals2(_) ->
+ ct:fail("Test should've been skipped, you shouldn't see this!"),
+ ok.
+
+test_require_deep_config() ->
+ [{require, {gen_cfg3, m, n}}].
+test_require_deep_config(_) ->
+ ok.
+
+
+test_shadow_all(_) ->
+ ["n","N"] = ct:get_config({gen_cfg3,l, m, n}, [], [all]).
+
+test_element(_) ->
+ {{gen_cfg3,l, m, n},"n"} = ct:get_config({gen_cfg3,l, m, n}, [], [element]).
+
+test_shadow_all_element(_) ->
+ [{{gen_cfg3,l, m, n},"n"},{{gen_cfg3,l, m, n},"N"}] =
+ ct:get_config({gen_cfg3,l, m, n}, [], [all,element]).
+
+%% The tests below are needed to verify that things like ct:telnet can use
+%% nested configs
+test_internal_deep(_) ->
+ "n" = ct:get_config({{gen_cfg3,l,m},n}),
+ a_value = ct:get_config({{gen_cfg},a}),
+ undefined = ct:get_config({{gen_cfg3,l,m},p}).
diff --git a/lib/common_test/test/ct_error_SUITE.erl b/lib/common_test/test/ct_error_SUITE.erl
index 2b3157ff3b..338e76264e 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -61,7 +61,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[cfg_error, lib_error, no_compile, timetrap_end_conf,
timetrap_normal, timetrap_extended, timetrap_parallel,
- timetrap_fun].
+ timetrap_fun, misc_errors].
groups() ->
[].
@@ -249,6 +249,24 @@ timetrap_fun(Config) when is_list(Config) ->
TestEvents = events_to_check(timetrap_fun),
ok = ct_test_support:verify_events(TestEvents, Events, Config).
+%%%-----------------------------------------------------------------
+%%%
+misc_errors(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Join = fun(D, S) -> filename:join(D, "error/test/"++S) end,
+ Suites = [Join(DataDir, "misc_error_1_SUITE")],
+ {Opts,ERPid} = setup([{suite,Suites}], Config),
+ ok = ct_test_support:run(Opts, Config),
+ Events = ct_test_support:get_events(ERPid, Config),
+
+ ct_test_support:log_events(misc_errors,
+ reformat(Events, ?eh),
+ ?config(priv_dir, Config),
+ Opts),
+
+ TestEvents = events_to_check(misc_errors),
+ ok = ct_test_support:verify_events(TestEvents, Events, Config).
+
%%%-----------------------------------------------------------------
%%% HELP FUNCTIONS
@@ -682,7 +700,7 @@ test_events(timetrap_end_conf) ->
[
{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
- {?eh,start_info,{1,1,6}},
+ {?eh,start_info,{1,1,9}},
{?eh,tc_start,{timetrap_1_SUITE,init_per_suite}},
{?eh,tc_done,{timetrap_1_SUITE,init_per_suite,ok}},
{?eh,tc_start,{timetrap_1_SUITE,tc1}},
@@ -709,6 +727,18 @@ test_events(timetrap_end_conf) ->
{?eh,tc_done,
{timetrap_1_SUITE,tc6,{failed,{testcase_aborted,testing_end_conf}}}},
{?eh,test_stats,{0,6,{0,0}}},
+ {?eh,tc_start,{timetrap_1_SUITE,tc7}},
+ {?eh,tc_done,
+ {timetrap_1_SUITE,tc7,{failed,{timetrap_timeout,1000}}}},
+ {?eh,test_stats,{0,7,{0,0}}},
+ {?eh,tc_start,{timetrap_1_SUITE,tc8}},
+ {?eh,tc_done,
+ {timetrap_1_SUITE,tc8,{failed,{timetrap_timeout,1000}}}},
+ {?eh,test_stats,{0,8,{0,0}}},
+ {?eh,tc_start,{timetrap_1_SUITE,tc9}},
+ {?eh,tc_done,
+ {timetrap_1_SUITE,tc9,{failed,{timetrap_timeout,1000}}}},
+ {?eh,test_stats,{0,9,{0,0}}},
{?eh,tc_start,{timetrap_1_SUITE,end_per_suite}},
{?eh,tc_done,{timetrap_1_SUITE,end_per_suite,ok}},
{?eh,test_done,{'DEF','STOP_TIME'}},
@@ -818,78 +848,161 @@ test_events(timetrap_parallel) ->
test_events(timetrap_fun) ->
[
{?eh,start_logging,{'DEF','RUNDIR'}},
- {?eh,start_info,{4,4,17}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,start_info,{4,4,24}},
+ {?eh,tc_start,{timetrap_4_SUITE,init_per_suite}},
{?eh,tc_done,{timetrap_4_SUITE,init_per_suite,ok}},
{?eh,tc_start,{timetrap_4_SUITE,tc0}},
- {?eh,tc_done,
- {timetrap_4_SUITE,tc0,{failed,{timetrap_timeout,1000}}}},
+ {?eh,tc_done,{timetrap_4_SUITE,tc0,
+ {failed,{timetrap_timeout,{'$approx',1000}}}}},
+ {?eh,test_stats,{0,1,{0,0}}},
{?eh,tc_start,{timetrap_4_SUITE,tc1}},
- {?eh,tc_done,
- {timetrap_4_SUITE,tc1,{failed,{timetrap_timeout,2000}}}},
+ {?eh,tc_done,{timetrap_4_SUITE,tc1,
+ {failed,{timetrap_timeout,{'$approx',2000}}}}},
+ {?eh,test_stats,{0,2,{0,0}}},
{?eh,tc_start,{timetrap_4_SUITE,tc2}},
- {?eh,tc_done,
- {timetrap_4_SUITE,tc2,{failed,{timetrap_timeout,500}}}},
+ {?eh,tc_done,{timetrap_4_SUITE,tc2,
+ {failed,{timetrap_timeout,{'$approx',500}}}}},
+ {?eh,test_stats,{0,3,{0,0}}},
{?eh,tc_start,{timetrap_4_SUITE,tc3}},
- {?eh,tc_done,
- {timetrap_4_SUITE,tc3,{failed,{timetrap_timeout,1000}}}},
+ {?eh,tc_done,{timetrap_4_SUITE,tc3,
+ {failed,{timetrap_timeout,{'$approx',1000}}}}},
{?eh,test_stats,{0,4,{0,0}}},
+ {?eh,tc_start,{timetrap_4_SUITE,end_per_suite}},
{?eh,tc_done,{timetrap_4_SUITE,end_per_suite,ok}},
+ {?eh,tc_start,{timetrap_5_SUITE,init_per_suite}},
{?eh,tc_done,{timetrap_5_SUITE,init_per_suite,ok}},
{?eh,tc_start,{timetrap_5_SUITE,tc0}},
- {?eh,tc_done,
- {timetrap_5_SUITE,tc0,{failed,{timetrap_timeout,1000}}}},
+ {?eh,tc_done,{timetrap_5_SUITE,tc0,
+ {failed,{timetrap_timeout,{'$approx',1000}}}}},
{?eh,test_stats,{0,5,{0,0}}},
{?eh,tc_start,{timetrap_5_SUITE,tc1}},
- {?eh,tc_done,
- {timetrap_5_SUITE,tc1,{skipped,{timetrap_error,kaboom}}}},
+ {?eh,tc_done,{timetrap_5_SUITE,tc1,{user_timetrap_error,
+ {kaboom,'_'}}}},
+ {?eh,test_stats,{0,6,{0,0}}},
{?eh,tc_start,{timetrap_5_SUITE,tc2}},
- {?eh,tc_done,
- {timetrap_5_SUITE,tc2,{skipped,{timetrap_error,kaboom}}}},
+ {?eh,tc_done,{timetrap_5_SUITE,tc2,{user_timetrap_error,
+ {kaboom,'_'}}}},
+ {?eh,test_stats,{0,7,{0,0}}},
{?eh,tc_start,{timetrap_5_SUITE,tc3}},
- {?eh,tc_done,
- {timetrap_5_SUITE,tc3,
- {skipped,{invalid_time_format,{timetrap_utils,timetrap_val,[5000]}}}}},
+ {?eh,tc_done,{timetrap_5_SUITE,tc3,
+ {failed,{timetrap_timeout,{'$approx',2000}}}}},
+ {?eh,test_stats,{0,8,{0,0}}},
{?eh,tc_start,{timetrap_5_SUITE,tc4}},
- {?eh,tc_done,
- {timetrap_5_SUITE,tc4,{skipped,{invalid_time_format,'_'}}}},
- {?eh,test_stats,{0,5,{0,4}}},
+ {?eh,tc_done,{timetrap_5_SUITE,tc4,
+ {failed,{timetrap_timeout,{'$approx',500}}}}},
+ {?eh,test_stats,{0,9,{0,0}}},
{?eh,tc_start,{timetrap_5_SUITE,tc5}},
- {?eh,tc_done,
- {timetrap_5_SUITE,tc5,{failed,{timetrap_timeout,1000}}}},
+ {?eh,tc_done,{timetrap_5_SUITE,tc5,
+ {failed,{timetrap_timeout,{'$approx',1000}}}}},
+ {?eh,test_stats,{0,10,{0,0}}},
{?eh,tc_start,{timetrap_5_SUITE,tc6}},
- {?eh,tc_done,
- {timetrap_5_SUITE,tc6,{failed,{timetrap_timeout,1000}}}},
+ {?eh,tc_done,{timetrap_5_SUITE,tc6,
+ {failed,{timetrap_timeout,{'$approx',41000}}}}},
+ {?eh,test_stats,{0,11,{0,0}}},
{?eh,tc_start,{timetrap_5_SUITE,tc7}},
- {?eh,tc_done,
- {timetrap_5_SUITE,tc7,{failed,{timetrap_timeout,1000}}}},
- {?eh,test_stats,{0,8,{0,4}}},
+ {?eh,tc_done,{timetrap_5_SUITE,tc7,
+ {failed,{timetrap_timeout,{'$approx',3000}}}}},
+ {?eh,test_stats,{0,12,{0,0}}},
+ {?eh,tc_start,{timetrap_5_SUITE,tc8}},
+ {?eh,tc_done,{timetrap_5_SUITE,tc8,
+ {failed,{timetrap_timeout,{'$approx',7000}}}}},
+ {?eh,test_stats,{0,13,{0,0}}},
+ {?eh,tc_start,{timetrap_5_SUITE,tc9}},
+ {?eh,tc_done,{timetrap_5_SUITE,tc9,
+ {failed,{timetrap_timeout,{'$approx',2000}}}}},
+ {?eh,test_stats,{0,14,{0,0}}},
+ {?eh,tc_start,{timetrap_5_SUITE,tc10}},
+ {?eh,tc_done,{timetrap_5_SUITE,tc10,
+ {failed,{timetrap_timeout,{'$approx',1500}}}}},
+ {?eh,test_stats,{0,15,{0,0}}},
+ {?eh,tc_start,{timetrap_5_SUITE,tc11}},
+ {?eh,tc_done,{timetrap_5_SUITE,tc11,
+ {failed,{timetrap_timeout,{'$approx',1500}}}}},
+ {?eh,test_stats,{0,16,{0,0}}},
+ {?eh,tc_start,{timetrap_5_SUITE,tc12}},
+ {?eh,tc_done,{timetrap_5_SUITE,tc12,
+ {failed,{timetrap_timeout,{'$approx',1000}}}}},
+ {?eh,test_stats,{0,17,{0,0}}},
+ {?eh,tc_start,{timetrap_5_SUITE,tc13}},
+ {?eh,tc_done,{timetrap_5_SUITE,tc13,
+ {failed,{timetrap_timeout,{'$approx',500}}}}},
+ {?eh,test_stats,{0,18,{0,0}}},
+ {?eh,tc_start,{timetrap_5_SUITE,tc14}},
+ {?eh,tc_done,{timetrap_5_SUITE,tc14,
+ {failed,{timetrap_timeout,{'$approx',1000}}}}},
+ {?eh,test_stats,{0,19,{0,0}}},
+ {?eh,tc_start,{timetrap_5_SUITE,end_per_suite}},
{?eh,tc_done,{timetrap_5_SUITE,end_per_suite,ok}},
{?eh,tc_start,{timetrap_6_SUITE,init_per_suite}},
- {?eh,tc_done,
- {timetrap_6_SUITE,init_per_suite,{skipped,{timetrap_error,kaboom}}}},
- {?eh,tc_auto_skip,
- {timetrap_6_SUITE,tc0,{timetrap_error,kaboom}}},
- {?eh,test_stats,{0,8,{0,5}}},
- {?eh,tc_auto_skip,
- {timetrap_6_SUITE,end_per_suite,{timetrap_error,kaboom}}},
-
+ {?eh,tc_done,{timetrap_6_SUITE,init_per_suite,{user_timetrap_error,
+ {kaboom,'_'}}}},
+ {?eh,tc_auto_skip,{timetrap_6_SUITE,tc0,
+ {failed,{timetrap_6_SUITE,init_per_suite,
+ {user_timetrap_error,{kaboom,'_'}}}}}},
+ {?eh,test_stats,{0,19,{0,1}}},
+ {?eh,tc_auto_skip,{timetrap_6_SUITE,end_per_suite,
+ {failed,{timetrap_6_SUITE,init_per_suite,
+ {user_timetrap_error,{kaboom,'_'}}}}}},
+
+ {?eh,tc_start,{timetrap_7_SUITE,init_per_suite}},
{?eh,tc_done,{timetrap_7_SUITE,init_per_suite,ok}},
{?eh,tc_start,{timetrap_7_SUITE,tc0}},
- {?eh,tc_done,
- {timetrap_7_SUITE,tc0,{failed,{timetrap_timeout,1000}}}},
+ {?eh,tc_done,{timetrap_7_SUITE,tc0,
+ {failed,{timetrap_timeout,{'$approx',7000}}}}},
+ {?eh,test_stats,{0,20,{0,1}}},
{?eh,tc_start,{timetrap_7_SUITE,tc1}},
- {?eh,tc_done,
- {timetrap_7_SUITE,tc1,{failed,{timetrap_timeout,2000}}}},
+ {?eh,tc_done,{timetrap_7_SUITE,tc1,
+ {failed,{timetrap_timeout,{'$approx',2000}}}}},
+ {?eh,test_stats,{0,21,{0,1}}},
{?eh,tc_start,{timetrap_7_SUITE,tc2}},
- {?eh,tc_done,
- {timetrap_7_SUITE,tc2,{failed,{timetrap_timeout,500}}}},
+ {?eh,tc_done,{timetrap_7_SUITE,tc2,
+ {failed,{timetrap_timeout,{'$approx',500}}}}},
+ {?eh,test_stats,{0,22,{0,1}}},
{?eh,tc_start,{timetrap_7_SUITE,tc3}},
- {?eh,tc_done,
- {timetrap_7_SUITE,tc3,{failed,{timetrap_timeout,1000}}}},
- {?eh,test_stats,{0,12,{0,5}}},
+ {?eh,tc_done,{timetrap_7_SUITE,tc3,
+ {failed,{timetrap_timeout,{'$approx',7000}}}}},
+ {?eh,test_stats,{0,23,{0,1}}},
+ {?eh,tc_start,{timetrap_7_SUITE,end_per_suite}},
{?eh,tc_done,{timetrap_7_SUITE,end_per_suite,ok}},
{?eh,test_done,{'DEF','STOP_TIME'}},
{?eh,stop_logging,[]}
+ ];
+
+test_events(misc_errors) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,start_info,{1,1,7}},
+ {?eh,tc_start,{misc_error_1_SUITE,ct_fail_1}},
+ {?eh,tc_done,{misc_error_1_SUITE,ct_fail_1,
+ {failed,{error,{test_case_failed,{error,this_is_expected}}}}}},
+ {?eh,test_stats,{0,1,{0,0}}},
+ {?eh,tc_start,{misc_error_1_SUITE,ct_fail_2}},
+ {?eh,tc_done,{misc_error_1_SUITE,ct_fail_2,
+ {failed,{error,{test_case_failed,"this_is_expected"}}}}},
+ {?eh,test_stats,{0,2,{0,0}}},
+ {?eh,tc_start,{misc_error_1_SUITE,ct_fail_3}},
+ {?eh,tc_done,{misc_error_1_SUITE,ct_fail_3,
+ {failed,{error,{test_case_failed,this_is_expected}}}}},
+ {?eh,test_stats,{0,3,{0,0}}},
+ {?eh,tc_start,{misc_error_1_SUITE,ts_fail_1}},
+ {?eh,tc_done,{misc_error_1_SUITE,ts_fail_1,
+ {failed,{error,{suite_failed,this_is_expected}}}}},
+ {?eh,test_stats,{0,4,{0,0}}},
+ {?eh,tc_start,{misc_error_1_SUITE,ts_fail_2}},
+ {?eh,tc_done,{misc_error_1_SUITE,ts_fail_2,
+ {failed,{error,{suite_failed,this_is_expected}}}}},
+ {?eh,test_stats,{0,5,{0,0}}},
+ {?eh,tc_start,{misc_error_1_SUITE,killed_by_signal_1}},
+ {?eh,tc_done,{misc_error_1_SUITE,killed_by_signal_1,i_die_now}},
+ {?eh,test_stats,{0,6,{0,0}}},
+ {?eh,tc_start,{misc_error_1_SUITE,killed_by_signal_2}},
+ {?eh,tc_done,{misc_error_1_SUITE,killed_by_signal_2,
+ {failed,testcase_aborted_or_killed}}},
+ {?eh,test_stats,{0,7,{0,0}}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
].
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
new file mode 100644
index 0000000000..99c3ed05ec
--- /dev/null
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/misc_error_1_SUITE.erl
@@ -0,0 +1,154 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(misc_error_1_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+
+%%--------------------------------------------------------------------
+%% Function: suite() -> Info
+%% Info = [tuple()]
+%%--------------------------------------------------------------------
+suite() ->
+ [{timetrap,{seconds,3}}].
+
+%%--------------------------------------------------------------------
+%% Function: init_per_suite(Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%%--------------------------------------------------------------------
+init_per_suite(Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% Function: end_per_suite(Config0) -> void() | {save_config,Config1}
+%% Config0 = Config1 = [tuple()]
+%%--------------------------------------------------------------------
+end_per_suite(_Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% Function: init_per_group(GroupName, Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% GroupName = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%%--------------------------------------------------------------------
+init_per_group(_GroupName, Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% Function: end_per_group(GroupName, Config0) ->
+%% void() | {save_config,Config1}
+%% GroupName = atom()
+%% Config0 = Config1 = [tuple()]
+%%--------------------------------------------------------------------
+end_per_group(_GroupName, _Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% Function: init_per_testcase(TestCase, Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% TestCase = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%%--------------------------------------------------------------------
+init_per_testcase(_TestCase, Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% Function: end_per_testcase(TestCase, Config0) ->
+%% void() | {save_config,Config1}
+%% TestCase = atom()
+%% Config0 = Config1 = [tuple()]
+%%--------------------------------------------------------------------
+end_per_testcase(_TestCase, _Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% Function: groups() -> [Group]
+%% Group = {GroupName,Properties,GroupsAndTestCases}
+%% GroupName = atom()
+%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
+%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]
+%% TestCase = atom()
+%% Shuffle = shuffle | {shuffle,{integer(),integer(),integer()}}
+%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
+%% repeat_until_any_ok | repeat_until_any_fail
+%% N = integer() | forever
+%%--------------------------------------------------------------------
+groups() ->
+ [].
+
+%%--------------------------------------------------------------------
+%% Function: all() -> GroupsAndTestCases | {skip,Reason}
+%% GroupsAndTestCases = [{group,GroupName} | TestCase]
+%% GroupName = atom()
+%% TestCase = atom()
+%% Reason = term()
+%%--------------------------------------------------------------------
+all() ->
+ [ct_fail_1, ct_fail_2, ct_fail_3, ts_fail_1, ts_fail_2,
+ killed_by_signal_1, killed_by_signal_2].
+
+ct_fail_1(_) ->
+ ct:fail({error,this_is_expected}),
+ exit(this_should_not_be_seen),
+ ok.
+
+ct_fail_2(_) ->
+ ct:fail("~w", [this_is_expected]),
+ exit(this_should_not_be_seen),
+ ok.
+
+ct_fail_3(_) ->
+ fail_me(fun() -> ct:fail(this_is_expected) end),
+ exit(this_should_not_be_seen),
+ ok.
+
+ts_fail_1(_) ->
+ test_server:fail(this_is_expected),
+ exit(this_should_not_be_seen),
+ ok.
+
+ts_fail_2(_) ->
+ fail_me(fun() -> test_server:fail(this_is_expected) end),
+ exit(this_should_not_be_seen),
+ ok.
+
+fail_me(Fun) ->
+ Fun(),
+ ok.
+
+killed_by_signal_1(_) ->
+ spawn_link(fun() -> ct:sleep(100),
+ exit(i_die_now)
+ end),
+ ct:sleep(1000),
+ exit(this_should_not_be_seen).
+
+killed_by_signal_2(_) ->
+ TCPid = self(),
+ spawn_link(fun() -> ct:sleep(100),
+ exit(TCPid, kill)
+ end),
+ ct:sleep(1000),
+ exit(this_should_not_be_seen).
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 cb3109349b..a98382965f 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. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -83,23 +83,11 @@ init_per_testcase(TC, Config) ->
ets:insert(?MODULE, {last_case,fail}),
init_per_testcase1(TC, Config).
-init_per_testcase1(tc1, Config) ->
- [{tc,tc1}|Config];
-
-init_per_testcase1(tc2, Config) ->
- [{tc,tc2}|Config];
-
-init_per_testcase1(tc3, Config) ->
- [{tc,tc3}|Config];
-
init_per_testcase1(tc4, Config) ->
[{tc,tc4},{default_timeout,5000}|Config];
-init_per_testcase1(tc5, Config) ->
- [{tc,tc5}|Config];
-
-init_per_testcase1(tc6, Config) ->
- [{tc,tc6}|Config].
+init_per_testcase1(TC, Config) ->
+ [{tc,TC}|Config].
%%--------------------------------------------------------------------
%% Function: end_per_testcase(TestCase, Config0) ->
@@ -145,7 +133,28 @@ end_per_testcase1(tc5, Config) ->
end_per_testcase1(tc6, Config) ->
ct:pal("end_per_testcase(tc6): ~p", [Config]),
tc6 = ?config(tc, Config),
- exit(end_per_tc_fail_after_abort).
+ exit(end_per_tc_fail_after_abort);
+
+end_per_testcase1(tc7, Config) ->
+ ct:pal("end_per_testcase(tc7): ~p", [Config]),
+ tc7 = ?config(tc, Config),
+ {failed,timetrap_timeout} = ?config(tc_status, Config),
+ ok;
+
+end_per_testcase1(tc8, Config) ->
+ ct:pal("end_per_testcase(tc8): ~p", [Config]),
+ tc8 = ?config(tc, Config),
+ {failed,timetrap_timeout} = ?config(tc_status, Config),
+ ok;
+
+end_per_testcase1(tc9, Config) ->
+ ct:pal("end_per_testcase(tc9): ~p", [Config]),
+ tc9 = ?config(tc, Config),
+ %% check that it's possible to send and receive synchronously
+ %% with the group leader process for end_per_testcase
+ test_server:stop_node(dummy@somehost),
+ ok.
+
%%--------------------------------------------------------------------
%% Function: groups() -> [Group]
@@ -170,25 +179,46 @@ groups() ->
%% Reason = term()
%%--------------------------------------------------------------------
all() ->
- [tc1, tc2, tc3, tc4, tc5, tc6].
+ [tc1, tc2, tc3, tc4, tc5, tc6, tc7, tc8, tc9].
tc1(_) ->
- timer:sleep(2000).
+ timer:sleep(2000),
+ ok.
tc2(_) ->
timer:sleep(2000).
tc3(_) ->
spawn(ct, abort_current_testcase, [testing_end_conf]),
- timer:sleep(2000).
+ timer:sleep(2000),
+ ok.
tc4(_) ->
spawn(ct, abort_current_testcase, [testing_end_conf]),
- timer:sleep(2000).
+ timer:sleep(2000),
+ ok.
tc5(_) ->
- timer:sleep(2000).
+ timer:sleep(2000),
+ ok.
tc6(_) ->
spawn(ct, abort_current_testcase, [testing_end_conf]),
timer:sleep(2000).
+
+tc7(_) ->
+ sleep(2000),
+ ok.
+
+tc8(_) ->
+ timetrap_helper:sleep(2000),
+ ok.
+
+tc9(_) ->
+ sleep(2000),
+ ok.
+
+%%%-----------------------------------------------------------------
+sleep(T) ->
+ timer:sleep(T),
+ ok.
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 c5d4b5062e..5b931c351f 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -108,7 +108,8 @@ groups() ->
%% Reason = term()
%%--------------------------------------------------------------------
all() ->
- [tc0,tc1,tc2,tc3,tc4,tc5,tc6,tc7].
+ [tc0,tc1,tc2,tc3,tc4,tc5,tc6,tc7,tc8,tc9,
+ tc10,tc11,tc12,tc13,tc14].
tc0(_) ->
ct:comment(io_lib:format("TO after ~w sec", [?TO])),
@@ -126,30 +127,89 @@ tc2(_) ->
exit(this_should_not_execute).
tc3() ->
- [{timetrap,{timetrap_utils,timetrap_err_mfa,[]}}].
-tc3(_) ->
- exit(this_should_not_execute).
+ [{timetrap,{timetrap_utils,timetrap_val,[{seconds,2}]}}].
+tc3(_) ->
+ ct:comment("TO after ~2 sec"),
+ ct:sleep({seconds,10}),
+ ok.
tc4() ->
- [{timetrap,fun() -> timetrap_utils:timetrap_err_fun() end}].
-tc4(_) ->
- exit(this_should_not_execute).
+ [{timetrap,fun() -> 500 end}].
+tc4(_) ->
+ ct:comment("TO after 500 ms"),
+ ct:sleep({seconds,10}),
+ ok.
tc5() ->
+ [{timetrap,{timetrap_utils,timetrap_timeout,[1000,ok]}}].
+tc5(_) ->
+ ct:comment("TO after ~1 sec"),
+ ct:sleep({seconds,10}),
+ ok.
+
+tc6() ->
[{timetrap,{timetrap_utils,timetrap_timeout,[{seconds,40},
{seconds,1}]}}].
-tc5(_) ->
+tc6(_) ->
ct:comment("TO after 40+1 sec"),
ct:sleep({seconds,42}),
ok.
-tc6() ->
+tc7() ->
+ [{timetrap,{timetrap_utils,timetrap_timeout,[1000,2000]}}].
+tc7(_) ->
+ ct:comment("TO after ~3 sec"),
+ ct:sleep({seconds,10}),
+ ok.
+
+tc8() ->
[{timetrap,fun() -> ct:sleep(6000), 1000 end}].
-tc6(_) ->
+tc8(_) ->
ct:comment("TO after 6+1 sec"),
- ct:sleep({seconds,10}).
+ ct:sleep({seconds,10}),
+ ok.
-tc7(_) ->
+tc9() ->
+ [{timetrap,{timetrap_utils,timetrap_timeout,
+ [500,fun() -> {seconds,2} end]}}].
+tc9(_) ->
+ ct:comment("TO after ~2 sec (2.5 sec in reality)"),
+ ct:sleep({seconds,10}),
+ ok.
+
+tc10() ->
+ [{timetrap,500}].
+tc10(_) ->
+ ct:timetrap({timetrap_utils,timetrap_val,[1500]}),
+ ct:comment("TO after ~1.5 sec"),
+ ct:sleep({seconds,10}),
+ ok.
+
+tc11() ->
+ [{timetrap,2000}].
+tc11(_) ->
+ ct:timetrap(fun() -> 1500 end),
+ ct:comment("TO after ~1.5 sec"),
+ ct:sleep({seconds,10}),
+ ok.
+
+tc12() ->
+ [{timetrap,500}].
+tc12(_) ->
+ ct:timetrap({timetrap_utils,timetrap_timeout,[1000,ok]}),
+ ct:comment("TO after ~1 sec"),
+ ct:sleep({seconds,10}),
+ ok.
+
+tc13() ->
+ [{timetrap,2000}].
+tc13(_) ->
+ ct:timetrap(fun() -> ct:sleep(500), ok end),
+ ct:comment("TO after ~500 ms"),
+ ct:sleep({seconds,10}),
+ ok.
+
+tc14(_) ->
ct:comment(io_lib:format("TO after ~w sec", [?TO])),
ct:sleep({seconds,5}),
ok.
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 b25b7770a7..922d49c086 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -114,7 +114,7 @@ all() ->
tc0(_) ->
ct:comment(io_lib:format("TO after ~w+~w sec", [?HANG,?TO])),
- ct:sleep({seconds,5}),
+ ct:sleep({seconds,10}),
ok.
tc1() ->
@@ -133,5 +133,5 @@ tc2(_) ->
tc3(_) ->
ct:comment(io_lib:format("TO after ~w+~w sec", [?HANG,?TO])),
- ct:sleep({seconds,5}),
+ ct:sleep({seconds,10}),
ok.
diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_helper.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_helper.erl
new file mode 100644
index 0000000000..1389acca11
--- /dev/null
+++ b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_helper.erl
@@ -0,0 +1,7 @@
+-module(timetrap_helper).
+
+-export([sleep/1]).
+
+sleep(T) ->
+ timer:sleep(T),
+ ok.
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 fcde6cd701..413ea342a8 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -20,24 +20,15 @@
-module(timetrap_utils).
-export([timetrap_val/1,
- timetrap_err_fun/0,
- timetrap_err_mfa/0,
timetrap_exit/1,
timetrap_timeout/2]).
timetrap_val(Val) ->
Val.
-timetrap_err_fun() ->
- fun() -> 5000 end.
-
-timetrap_err_mfa() ->
- {?MODULE,timetrap_val,[5000]}.
-
timetrap_exit(Reason) ->
exit(Reason).
timetrap_timeout(Sleep, Val) ->
ct:sleep(Sleep),
Val.
-
diff --git a/lib/common_test/test/ct_group_info_SUITE.erl b/lib/common_test/test/ct_group_info_SUITE.erl
index 2da8219196..c56fa952e8 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -440,72 +440,72 @@ test_events(timetrap_all_no_ipg) ->
{?eh,tc_done,{group_timetrap_3_SUITE,t1,{failed,{timetrap_timeout,1000}}}},
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g1,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g1,[{suite,group_timetrap_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g1,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g1,[{suite,group_timetrap_3_SUITE}]},ok}},
{?eh,tc_done,{group_timetrap_3_SUITE,t11,{failed,{timetrap_timeout,500}}}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g1,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g1,[{suite,group_timetrap_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g1,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g1,[{suite,group_timetrap_3_SUITE}]},ok}}],
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g2,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g2,[{suite,group_timetrap_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g2,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g2,[{suite,group_timetrap_3_SUITE}]},ok}},
{?eh,tc_done,{group_timetrap_3_SUITE,t21,{failed,{timetrap_timeout,1500}}}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g2,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g2,[{suite,group_timetrap_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g2,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g2,[{suite,group_timetrap_3_SUITE}]},ok}}],
{?eh,tc_done,{group_timetrap_3_SUITE,t2,{failed,{timetrap_timeout,1000}}}},
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g3,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g3,[{suite,group_timetrap_3_SUITE}]},ok}},
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g4,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g4,[{suite,group_timetrap_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g3,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g3,[{suite,group_timetrap_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g4,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g4,[{suite,group_timetrap_3_SUITE}]},ok}},
{?eh,tc_done,{group_timetrap_3_SUITE,t41,{failed,{timetrap_timeout,250}}}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g4,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g4,[{suite,group_timetrap_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g4,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g4,[{suite,group_timetrap_3_SUITE}]},ok}}],
{?eh,tc_done,{group_timetrap_3_SUITE,t31,{failed,{timetrap_timeout,500}}}},
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g5,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g5,[{suite,group_timetrap_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g5,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g5,[{suite,group_timetrap_3_SUITE}]},ok}},
{?eh,tc_done,{group_timetrap_3_SUITE,t51,{failed,{timetrap_timeout,1500}}}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g5,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g5,[{suite,group_timetrap_3_SUITE}]},ok}}],
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g3,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g3,[{suite,group_timetrap_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g5,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g5,[{suite,group_timetrap_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g3,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g3,[{suite,group_timetrap_3_SUITE}]},ok}}],
{?eh,tc_done,{group_timetrap_3_SUITE,t3,{failed,{timetrap_timeout,250}}}},
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g6,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g6,[{suite,group_timetrap_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g6,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g6,[{suite,group_timetrap_3_SUITE}]},ok}},
{?eh,tc_done,{group_timetrap_3_SUITE,t61,{failed,{timetrap_timeout,500}}}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g6,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g6,[{suite,group_timetrap_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g6,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g6,[{suite,group_timetrap_3_SUITE}]},ok}}],
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g7,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g7,[{suite,group_timetrap_3_SUITE}]},ok}},
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g8,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g8,[{suite,group_timetrap_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g7,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g7,[{suite,group_timetrap_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g8,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g8,[{suite,group_timetrap_3_SUITE}]},ok}},
{?eh,tc_done,{group_timetrap_3_SUITE,t81,{failed,{timetrap_timeout,750}}}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g8,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g8,[{suite,group_timetrap_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g8,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g8,[{suite,group_timetrap_3_SUITE}]},ok}}],
{?eh,tc_done,{group_timetrap_3_SUITE,t71,{failed,{timetrap_timeout,500}}}},
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g9,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g9,[{suite,group_timetrap_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g9,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g9,[{suite,group_timetrap_3_SUITE}]},ok}},
{?eh,tc_done,{group_timetrap_3_SUITE,t91,{failed,{timetrap_timeout,250}}}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g9,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g9,[{suite,group_timetrap_3_SUITE}]},ok}}],
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g7,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g7,[{suite,group_timetrap_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g9,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g9,[{suite,group_timetrap_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g7,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g7,[{suite,group_timetrap_3_SUITE}]},ok}}],
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g10,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g10,[{suite,group_timetrap_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g10,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g10,[{suite,group_timetrap_3_SUITE}]},ok}},
{?eh,tc_done,{group_timetrap_3_SUITE,t101,{failed,{timetrap_timeout,1000}}}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g10,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g10,[{suite,group_timetrap_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g10,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g10,[{suite,group_timetrap_3_SUITE}]},ok}}],
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g11,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g11,[{suite,group_timetrap_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g11,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g11,[{suite,group_timetrap_3_SUITE}]},ok}},
{?eh,tc_done,{group_timetrap_3_SUITE,t111,{failed,{timetrap_timeout,1000}}}},
{?eh,test_stats,{0,14,{0,0}}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g11,[{suite,group_timetrap_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g11,[{suite,group_timetrap_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g11,[{suite,group_timetrap_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g11,[{suite,group_timetrap_3_SUITE}]},ok}}],
{?eh,test_done,{'DEF','STOP_TIME'}},
{?eh,stop_logging,[]}
@@ -779,78 +779,78 @@ test_events(require_no_ipg) ->
{?eh,start_info,{1,1,13}},
{?eh,tc_done,{group_require_3_SUITE,t1,ok}},
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g1,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g1,[{suite,group_require_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g1,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g1,[{suite,group_require_3_SUITE}]},ok}},
{?eh,tc_done,{group_require_3_SUITE,t11,ok}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g1,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g1,[{suite,group_require_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g1,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g1,[{suite,group_require_3_SUITE}]},ok}}],
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g2,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g2,[{suite,group_require_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g2,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g2,[{suite,group_require_3_SUITE}]},ok}},
{?eh,tc_done,{group_require_3_SUITE,t21,ok}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g2,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g2,[{suite,group_require_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g2,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g2,[{suite,group_require_3_SUITE}]},ok}}],
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g3,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g3,[{suite,group_require_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g3,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g3,[{suite,group_require_3_SUITE}]},ok}},
{?eh,tc_done,{group_require_3_SUITE,t31,ok}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g3,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g3,[{suite,group_require_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g3,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g3,[{suite,group_require_3_SUITE}]},ok}}],
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g4,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g4,[{suite,group_require_3_SUITE}]},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g4,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g4,[{suite,group_require_3_SUITE}]},
{skipped,{require_failed,{name_in_use,common2_alias,common2}}}}},
{?eh,tc_auto_skip,{group_require_3_SUITE,t41,
{require_failed,{name_in_use,common2_alias,common2}}}},
{?eh,test_stats,{4,0,{0,1}}},
- {?eh,tc_auto_skip,{ct_framework,ct_end_per_group,
+ {?eh,tc_auto_skip,{ct_framework,end_per_group,
{require_failed,{name_in_use,common2_alias,common2}}}}],
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g5,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g5,[{suite,group_require_3_SUITE}]},ok}},
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g6,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g6,[{suite,group_require_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g5,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g5,[{suite,group_require_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g6,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g6,[{suite,group_require_3_SUITE}]},ok}},
{?eh,tc_done,{group_require_3_SUITE,t61,ok}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g6,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g6,[{suite,group_require_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g6,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g6,[{suite,group_require_3_SUITE}]},ok}}],
{?eh,tc_done,{group_require_3_SUITE,t51,ok}},
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g7,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g7,[{suite,group_require_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g7,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g7,[{suite,group_require_3_SUITE}]},ok}},
{?eh,tc_done,{group_require_3_SUITE,t71,ok}},
{?eh,tc_done,{group_require_3_SUITE,t72,ok}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g7,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g7,[{suite,group_require_3_SUITE}]},ok}}],
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g5,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g5,[{suite,group_require_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g7,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g7,[{suite,group_require_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g5,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g5,[{suite,group_require_3_SUITE}]},ok}}],
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g8,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g8,[{suite,group_require_3_SUITE}]},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g8,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g8,[{suite,group_require_3_SUITE}]},
{skipped,{require_failed,{not_available,non_existing}}}}},
{?eh,tc_auto_skip,{group_require_3_SUITE,t81,
{require_failed,{not_available,non_existing}}}},
{?eh,test_stats,{8,0,{0,2}}},
- {?eh,tc_auto_skip,{ct_framework,ct_end_per_group,
+ {?eh,tc_auto_skip,{ct_framework,end_per_group,
{require_failed,{not_available,non_existing}}}}],
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g9,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g9,[{suite,group_require_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g9,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g9,[{suite,group_require_3_SUITE}]},ok}},
{?eh,tc_done,{group_require_3_SUITE,t91,
{skipped,{require_failed,{not_available,non_existing}}}}},
{?eh,test_stats,{8,0,{0,3}}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g9,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g9,[{suite,group_require_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g9,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g9,[{suite,group_require_3_SUITE}]},ok}}],
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g10,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g10,[{suite,group_require_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g10,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g10,[{suite,group_require_3_SUITE}]},ok}},
{?eh,tc_done,{group_require_3_SUITE,t101,ok}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g10,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g10,[{suite,group_require_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g10,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g10,[{suite,group_require_3_SUITE}]},ok}}],
- [{?eh,tc_start,{ct_framework,{ct_init_per_group,g11,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,g11,[{suite,group_require_3_SUITE}]},ok}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,g11,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,g11,[{suite,group_require_3_SUITE}]},ok}},
{?eh,tc_done,{group_require_3_SUITE,t111,ok}},
{?eh,test_stats,{10,0,{0,3}}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,g11,[{suite,group_require_3_SUITE}]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,g11,[{suite,group_require_3_SUITE}]},ok}}],
+ {?eh,tc_start,{ct_framework,{end_per_group,g11,[{suite,group_require_3_SUITE}]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,g11,[{suite,group_require_3_SUITE}]},ok}}],
{?eh,test_done,{'DEF','STOP_TIME'}},
{?eh,stop_logging,[]}
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 2392b0b850..1b2ad12e2f 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -171,16 +171,16 @@ test_events(missing_conf) ->
{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
{?eh,start_info,{1,1,2}},
- {?eh,tc_start,{ct_framework,{ct_init_per_group,group1,[]}}},
- {?eh,tc_done,{ct_framework,{ct_init_per_group,group1,[]},ok}},
+ {?eh,tc_start,{ct_framework,{init_per_group,group1,[]}}},
+ {?eh,tc_done,{ct_framework,{init_per_group,group1,[]},ok}},
{?eh,tc_start,{missing_conf_SUITE,tc1}},
{?eh,tc_done,{missing_conf_SUITE,tc1,ok}},
{?eh,test_stats,{1,0,{0,0}}},
{?eh,tc_start,{missing_conf_SUITE,tc2}},
{?eh,tc_done,{missing_conf_SUITE,tc2,ok}},
{?eh,test_stats,{2,0,{0,0}}},
- {?eh,tc_start,{ct_framework,{ct_end_per_group,group1,[]}}},
- {?eh,tc_done,{ct_framework,{ct_end_per_group,group1,[]},ok}},
+ {?eh,tc_start,{ct_framework,{end_per_group,group1,[]}}},
+ {?eh,tc_done,{ct_framework,{end_per_group,group1,[]},ok}},
{?eh,test_done,{'DEF','STOP_TIME'}},
{?eh,stop_logging,[]}
];
diff --git a/lib/common_test/test/ct_hooks_SUITE.erl b/lib/common_test/test/ct_hooks_SUITE.erl
index 2c519f08b5..405df1e978 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -83,10 +83,10 @@ all(suite) ->
fail_post_suite_cth, skip_pre_suite_cth,
skip_post_suite_cth, recover_post_suite_cth, update_config_cth,
state_update_cth, options_cth, same_id_cth,
- fail_n_skip_with_minimal_cth, prio_cth
+ fail_n_skip_with_minimal_cth, prio_cth, no_config,
+ data_dir
]
- )
- .
+ ).
%%--------------------------------------------------------------------
@@ -214,6 +214,16 @@ prio_cth(Config) when is_list(Config) ->
[{empty_cth,[1000],1000},{empty_cth,[900],900},
{prio_cth,[1100,100],100},{prio_cth,[1100]}],Config).
+no_config(Config) when is_list(Config) ->
+ do_test(no_config, "ct_no_config_SUITE.erl",
+ [verify_config_cth],Config).
+
+data_dir(Config) when is_list(Config) ->
+ do_test(data_dir, "ct_data_dir_SUITE.erl",
+ [verify_data_dir_cth],Config).
+
+
+
%%%-----------------------------------------------------------------
%%% HELP FUNCTIONS
%%%-----------------------------------------------------------------
@@ -1078,6 +1088,105 @@ test_events(prio_cth) ->
{?eh,test_done,{'DEF','STOP_TIME'}},
{?eh,stop_logging,[]}];
+test_events(no_config) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,cth,{empty_cth,init,[verify_config_cth,[]]}},
+ {?eh,start_info,{1,1,2}},
+ {?eh,tc_start,{ct_framework,init_per_suite}},
+ {?eh,cth,{empty_cth,pre_init_per_suite,
+ [ct_no_config_SUITE,'$proplist',[]]}},
+ {?eh,cth,{empty_cth,post_init_per_suite,
+ [ct_no_config_SUITE,'$proplist','$proplist',[]]}},
+ {?eh,tc_done,{ct_framework,init_per_suite,ok}},
+ {?eh,tc_start,{ct_no_config_SUITE,test_case_1}},
+ {?eh,cth,{empty_cth,pre_init_per_testcase,
+ [test_case_1,'$proplist',[]]}},
+ {?eh,cth,{empty_cth,post_end_per_testcase,
+ [test_case_1,'$proplist',ok,[]]}},
+ {?eh,tc_done,{ct_no_config_SUITE,test_case_1,ok}},
+ {?eh,test_stats,{1,0,{0,0}}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,test_group,'$proplist'}}},
+ {?eh,cth,{empty_cth,pre_init_per_group,
+ [test_group,'$proplist',[]]}},
+ {?eh,cth,{empty_cth,post_init_per_group,
+ [test_group,'$proplist','$proplist',[]]}},
+ {?eh,tc_done,{ct_framework,
+ {init_per_group,test_group,'$proplist'},ok}},
+ {?eh,tc_start,{ct_no_config_SUITE,test_case_2}},
+ {?eh,cth,{empty_cth,pre_init_per_testcase,
+ [test_case_2,'$proplist',[]]}},
+ {?eh,cth,{empty_cth,post_end_per_testcase,
+ [test_case_2,'$proplist',ok,[]]}},
+ {?eh,tc_done,{ct_no_config_SUITE,test_case_2,ok}},
+ {?eh,test_stats,{2,0,{0,0}}},
+ {?eh,tc_start,{ct_framework,{end_per_group,test_group,'$proplist'}}},
+ {?eh,cth,{empty_cth,pre_end_per_group,
+ [test_group,'$proplist',[]]}},
+ {?eh,cth,{empty_cth,post_end_per_group,
+ [test_group,'$proplist',ok,[]]}},
+ {?eh,tc_done,{ct_framework,{end_per_group,test_group,'$proplist'},ok}}],
+ {?eh,tc_start,{ct_framework,end_per_suite}},
+ {?eh,cth,{empty_cth,pre_end_per_suite,
+ [ct_no_config_SUITE,'$proplist',[]]}},
+ {?eh,cth,{empty_cth,post_end_per_suite,
+ [ct_no_config_SUITE,'$proplist',ok,[]]}},
+ {?eh,tc_done,{ct_framework,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,cth,{empty_cth,terminate,[[]]}},
+ {?eh,stop_logging,[]}
+ ];
+
+test_events(data_dir) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,cth,{empty_cth,init,[verify_data_dir_cth,[]]}},
+ {?eh,start_info,{1,1,2}},
+ {?eh,tc_start,{ct_framework,init_per_suite}},
+ {?eh,cth,{empty_cth,pre_init_per_suite,
+ [ct_data_dir_SUITE,'$proplist',[{data_dir_name,"ct_data_dir_SUITE_data"}]]}},
+ {?eh,cth,{empty_cth,post_init_per_suite,
+ [ct_data_dir_SUITE,'$proplist','$proplist',[{data_dir_name,"ct_data_dir_SUITE_data"}]]}},
+ {?eh,tc_done,{ct_framework,init_per_suite,ok}},
+ {?eh,tc_start,{ct_data_dir_SUITE,test_case_1}},
+ {?eh,cth,{empty_cth,pre_init_per_testcase,
+ [test_case_1,'$proplist',[{data_dir_name,"ct_data_dir_SUITE_data"}]]}},
+ {?eh,cth,{empty_cth,post_end_per_testcase,
+ [test_case_1,'$proplist',ok,[{data_dir_name,"ct_data_dir_SUITE_data"}]]}},
+ {?eh,tc_done,{ct_data_dir_SUITE,test_case_1,ok}},
+ {?eh,test_stats,{1,0,{0,0}}},
+ [{?eh,tc_start,{ct_framework,{init_per_group,test_group,'$proplist'}}},
+ {?eh,cth,{empty_cth,pre_init_per_group,
+ [test_group,'$proplist',[{data_dir_name,"ct_data_dir_SUITE_data"}]]}},
+ {?eh,cth,{empty_cth,post_init_per_group,
+ [test_group,'$proplist','$proplist',[{data_dir_name,"ct_data_dir_SUITE_data"}]]}},
+ {?eh,tc_done,{ct_framework,
+ {init_per_group,test_group,'$proplist'},ok}},
+ {?eh,tc_start,{ct_data_dir_SUITE,test_case_2}},
+ {?eh,cth,{empty_cth,pre_init_per_testcase,
+ [test_case_2,'$proplist',[{data_dir_name,"ct_data_dir_SUITE_data"}]]}},
+ {?eh,cth,{empty_cth,post_end_per_testcase,
+ [test_case_2,'$proplist',ok,[{data_dir_name,"ct_data_dir_SUITE_data"}]]}},
+ {?eh,tc_done,{ct_data_dir_SUITE,test_case_2,ok}},
+ {?eh,test_stats,{2,0,{0,0}}},
+ {?eh,tc_start,{ct_framework,{end_per_group,test_group,'$proplist'}}},
+ {?eh,cth,{empty_cth,pre_end_per_group,
+ [test_group,'$proplist',[{data_dir_name,"ct_data_dir_SUITE_data"}]]}},
+ {?eh,cth,{empty_cth,post_end_per_group,
+ [test_group,'$proplist',ok,[{data_dir_name,"ct_data_dir_SUITE_data"}]]}},
+ {?eh,tc_done,{ct_framework,{end_per_group,test_group,'$proplist'},ok}}],
+ {?eh,tc_start,{ct_framework,end_per_suite}},
+ {?eh,cth,{empty_cth,pre_end_per_suite,
+ [ct_data_dir_SUITE,'$proplist',[{data_dir_name,"ct_data_dir_SUITE_data"}]]}},
+ {?eh,cth,{empty_cth,post_end_per_suite,
+ [ct_data_dir_SUITE,'$proplist',ok,[{data_dir_name,"ct_data_dir_SUITE_data"}]]}},
+ {?eh,tc_done,{ct_framework,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ];
+
test_events(ok) ->
ok.
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
new file mode 100644
index 0000000000..66074c20c0
--- /dev/null
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_data_dir_SUITE.erl
@@ -0,0 +1,67 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(ct_data_dir_SUITE).
+
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+
+-include("ct.hrl").
+
+-define(data_dir_name, atom_to_list(?MODULE)++"_data").
+
+suite() ->
+ [{timetrap, {seconds,1}},
+ {ct_hooks, [verify_data_dir_cth]}].
+
+all() ->
+ [test_case_1, {group,test_group}].
+
+groups() ->
+ [{test_group,[],[test_case_2]}].
+
+init_per_testcase(_, Config) ->
+ check_dirs(Config),
+ Config.
+
+end_per_testcase(_, Config) ->
+ check_dirs(Config),
+ ok.
+
+test_case_1(Config) ->
+ check_dirs(Config),
+ ok.
+
+test_case_2(Config) ->
+ check_dirs(Config),
+ ok.
+
+check_dirs(Config) ->
+ %% check priv_dir
+ PrivDir = proplists:get_value(priv_dir, Config),
+ "log_private" = filename:basename(PrivDir),
+ {ok,_} = file:list_dir(PrivDir),
+
+ %% check data_dir
+ DataDir = proplists:get_value(data_dir, Config),
+ DataDirName = ?data_dir_name,
+ DataDirName = filename:basename(DataDir),
+ ok.
+
+
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
new file mode 100644
index 0000000000..fb8c420b8e
--- /dev/null
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_no_config_SUITE.erl
@@ -0,0 +1,64 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(ct_no_config_SUITE).
+
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+
+-include("ct.hrl").
+
+%%% This suite is used to verify 2 things:
+%%%
+%%% 1) All hook pre/post functions get called, even if no init/end
+%%% config functions exist in the suite (new from ver 1.6.1, R15B01).
+%%%
+%%% 2) The hook functions can read Config list elements, as well as
+%%% required config variables, even if no init/end config
+%%% functions exist.
+
+suite() ->
+ [{timetrap, {seconds,1}},
+ {ct_hooks, [verify_config_cth]},
+ {require,suite_cfg},
+ {default_config,suite_cfg,?MODULE}].
+
+group(test_group) ->
+ [{require,group_cfg},
+ {default_config,group_cfg,test_group}].
+
+test_case_1() ->
+ [{require,test_case_1_cfg},
+ {default_config,test_case_1_cfg,test_case_1}].
+
+test_case_2() ->
+ [{require,test_case_2_cfg},
+ {default_config,test_case_2_cfg,test_case_2}].
+
+all() ->
+ [test_case_1, {group,test_group}].
+
+groups() ->
+ [{test_group,[],[test_case_2]}].
+
+test_case_1(Config) ->
+ ok.
+
+test_case_2(Config) ->
+ ok.
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 7befcfa57c..9ee2a90896 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,277 +1,277 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-%%% @doc Common Test Example Suite Callback module.
-%%%
-%%% <p>This module gives an example of a common test CTH (Common Test Hook).
-%%% There are many ways to add a CTH to a test run, you can do it either in
-%%% the command line using -ct_hook, in a test spec using
-%%% {ct_hook,M} or in the suite it self by returning ct_hook
-%%% from either suite/0, init_per_suite/1, init_per_group/2 and
-%%% init_per_testcase/2. The scope of the CTH is determined by where is it
-%%% started. If it is started in the command line or test spec then it will
-%%% be stopped at the end of all tests. If it is started in init_per_suite,
-%%% it will be stopped after end_per_suite and so on. See terminate
-%%% documentation for a table describing the scoping machanics.
-%%%
-%%% All of callbacks except init/1 in a CTH are optional.</p>
-
--module(empty_cth).
-
-%% CT Hooks
--export([id/1]).
--export([init/2]).
-
--export([pre_init_per_suite/3]).
--export([post_init_per_suite/4]).
--export([pre_end_per_suite/3]).
--export([post_end_per_suite/4]).
-
--export([pre_init_per_group/3]).
--export([post_init_per_group/4]).
--export([pre_end_per_group/3]).
--export([post_end_per_group/4]).
-
--export([pre_init_per_testcase/3]).
--export([post_end_per_testcase/4]).
-
--export([on_tc_fail/3]).
--export([on_tc_skip/3]).
-
--export([terminate/1]).
-
--include_lib("common_test/src/ct_util.hrl").
--include_lib("common_test/include/ct_event.hrl").
-
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%% @doc Common Test Example Suite Callback module.
+%%%
+%%% <p>This module gives an example of a common test CTH (Common Test Hook).
+%%% There are many ways to add a CTH to a test run, you can do it either in
+%%% the command line using -ct_hook, in a test spec using
+%%% {ct_hook,M} or in the suite it self by returning ct_hook
+%%% from either suite/0, init_per_suite/1, init_per_group/2 and
+%%% init_per_testcase/2. The scope of the CTH is determined by where is it
+%%% started. If it is started in the command line or test spec then it will
+%%% be stopped at the end of all tests. If it is started in init_per_suite,
+%%% it will be stopped after end_per_suite and so on. See terminate
+%%% documentation for a table describing the scoping machanics.
+%%%
+%%% All of callbacks except init/1 in a CTH are optional.</p>
+
+-module(empty_cth).
+
+%% CT Hooks
+-export([id/1]).
+-export([init/2]).
+
+-export([pre_init_per_suite/3]).
+-export([post_init_per_suite/4]).
+-export([pre_end_per_suite/3]).
+-export([post_end_per_suite/4]).
+
+-export([pre_init_per_group/3]).
+-export([post_init_per_group/4]).
+-export([pre_end_per_group/3]).
+-export([post_end_per_group/4]).
+
+-export([pre_init_per_testcase/3]).
+-export([post_end_per_testcase/4]).
+
+-export([on_tc_fail/3]).
+-export([on_tc_skip/3]).
+
+-export([terminate/1]).
+
+-include_lib("common_test/src/ct_util.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
-type config() :: proplists:proplist().
--type reason() :: term().
--type skip_or_fail() :: {skip, reason()} |
- {auto_skip, reason()} |
- {fail, reason()} |
- {'EXIT',reason()}.
-
--record(state, { id = ?MODULE :: term()}).
-
-%% @doc Always called before any other callback function. Use this to initiate
-%% any common state. It should return an state for this CTH.
+-type reason() :: term().
+-type skip_or_fail() :: {skip, reason()} |
+ {auto_skip, reason()} |
+ {fail, reason()} |
+ {'EXIT',reason()}.
+
+-record(state, { id = ?MODULE :: term()}).
+
+%% @doc Always called before any other callback function. Use this to initiate
+%% any common state. It should return an state for this CTH.
-spec init(Id :: term(), Opts :: proplists:proplist()) ->
- {ok, State :: #state{}}.
-init(Id, Opts) ->
- gen_event:notify(?CT_EVMGR_REF, #event{ name = cth, node = node(),
- data = {?MODULE, init, [Id, Opts]}}),
- {ok,Opts}.
-
-%% @doc The ID is used to uniquly identify an CTH instance, if two CTH's
-%% return the same ID the seconds CTH is ignored. This function should NOT
-%% have any side effects as it might be called multiple times by common test.
+ {ok, State :: #state{}}.
+init(Id, Opts) ->
+ gen_event:notify(?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, init, [Id, Opts]}}),
+ {ok,Opts}.
+
+%% @doc The ID is used to uniquly identify an CTH instance, if two CTH's
+%% return the same ID the seconds CTH is ignored. This function should NOT
+%% have any side effects as it might be called multiple times by common test.
-spec id(Opts :: proplists:proplist()) ->
- Id :: term().
-id(Opts) ->
- gen_event:notify(?CT_EVMGR_REF, #event{ name = cth, node = node(),
- data = {?MODULE, id, [Opts]}}),
- now().
-
-%% @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
-%% specification, suite/0 function etc).
-%% You can change the config in the this function.
--spec pre_init_per_suite(Suite :: atom(),
- Config :: config(),
- State :: #state{}) ->
- {config() | skip_or_fail(), NewState :: #state{}}.
-pre_init_per_suite(Suite,Config,State) ->
- gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = cth, node = node(),
- data = {?MODULE, pre_init_per_suite,
- [Suite,Config,State]}}),
- {Config, State}.
-
-%% @doc Called after init_per_suite.
-%% you can change the return value in this function.
--spec post_init_per_suite(Suite :: atom(),
- Config :: config(),
- Return :: config() | skip_or_fail(),
- State :: #state{}) ->
- {config() | skip_or_fail(), NewState :: #state{}}.
-post_init_per_suite(Suite,Config,Return,State) ->
- gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = cth, node = node(),
- data = {?MODULE, post_init_per_suite,
- [Suite,Config,Return,State]}}),
- {Return, State}.
-
-%% @doc Called before end_per_suite. The config/state can be changed here,
-%% though it will only affect the *end_per_suite function.
--spec pre_end_per_suite(Suite :: atom(),
- Config :: config() | skip_or_fail(),
- State :: #state{}) ->
- {ok | skip_or_fail(), NewState :: #state{}}.
-pre_end_per_suite(Suite,Config,State) ->
- gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = cth, node = node(),
- data = {?MODULE, pre_end_per_suite,
- [Suite,Config,State]}}),
- {Config, State}.
-
-%% @doc Called after end_per_suite. Note that the config cannot be
-%% changed here, only the status of the suite.
--spec post_end_per_suite(Suite :: atom(),
- Config :: config(),
- Return :: term(),
- State :: #state{}) ->
- {ok | skip_or_fail(), NewState :: #state{}}.
-post_end_per_suite(Suite,Config,Return,State) ->
- gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = cth, node = node(),
- data = {?MODULE, post_end_per_suite,
- [Suite,Config,Return,State]}}),
- {Return, State}.
-
-%% @doc Called before each init_per_group.
-%% You can change the config in this function.
--spec pre_init_per_group(Group :: atom(),
- Config :: config(),
- State :: #state{}) ->
- {config() | skip_or_fail(), NewState :: #state{}}.
-pre_init_per_group(Group,Config,State) ->
- gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = cth, node = node(),
- data = {?MODULE, pre_init_per_group,
- [Group,Config,State]}}),
- {Config, State}.
-
-%% @doc Called after each init_per_group.
-%% You can change the return value in this function.
--spec post_init_per_group(Group :: atom(),
- Config :: config(),
- Return :: config() | skip_or_fail(),
- State :: #state{}) ->
- {config() | skip_or_fail(), NewState :: #state{}}.
-post_init_per_group(Group,Config,Return,State) ->
- gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = cth, node = node(),
- data = {?MODULE, post_init_per_group,
- [Group,Config,Return,State]}}),
- {Return, State}.
-
-%% @doc Called after each end_per_group. The config/state can be changed here,
-%% though it will only affect the *end_per_group functions.
--spec pre_end_per_group(Group :: atom(),
- Config :: config() | skip_or_fail(),
- State :: #state{}) ->
- {ok | skip_or_fail(), NewState :: #state{}}.
-pre_end_per_group(Group,Config,State) ->
- gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = cth, node = node(),
- data = {?MODULE, pre_end_per_group,
- [Group,Config,State]}}),
- {Config, State}.
-
-%% @doc Called after each end_per_group. Note that the config cannot be
-%% changed here, only the status of the group.
--spec post_end_per_group(Group :: atom(),
- Config :: config(),
- Return :: term(),
- State :: #state{}) ->
- {ok | skip_or_fail(), NewState :: #state{}}.
-post_end_per_group(Group,Config,Return,State) ->
- gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = cth, node = node(),
- data = {?MODULE, post_end_per_group,
- [Group,Config,Return,State]}}),
- {Return, State}.
-
-%% @doc Called before each test case.
-%% You can change the config in this function.
--spec pre_init_per_testcase(TC :: atom(),
- Config :: config(),
- State :: #state{}) ->
- {config() | skip_or_fail(), NewState :: #state{}}.
-pre_init_per_testcase(TC,Config,State) ->
- gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = cth, node = node(),
- data = {?MODULE, pre_init_per_testcase,
- [TC,Config,State]}}),
- {Config, State}.
-
-%% @doc Called after each test case. Note that the config cannot be
-%% changed here, only the status of the test case.
--spec post_end_per_testcase(TC :: atom(),
- Config :: config(),
- Return :: term(),
- State :: #state{}) ->
- {ok | skip_or_fail(), NewState :: #state{}}.
-post_end_per_testcase(TC,Config,Return,State) ->
- gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = cth, node = node(),
- data = {?MODULE, post_end_per_testcase,
- [TC,Config,Return,State]}}),
- {Return, State}.
-
-%% @doc Called after post_init_per_suite, post_end_per_suite, post_init_per_group,
-%% post_end_per_group and post_end_per_tc if the suite, group or test case failed.
-%% This function should be used for extra cleanup which might be needed.
-%% It is not possible to modify the config or the status of the test run.
--spec on_tc_fail(TC :: init_per_suite | end_per_suite |
- init_per_group | end_per_group | atom(),
- Reason :: term(), State :: #state{}) ->
- NewState :: #state{}.
-on_tc_fail(TC, Reason, State) ->
- gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = cth, node = node(),
- data = {?MODULE, on_tc_fail,
- [TC,Reason,State]}}),
- State.
-
-%% @doc Called when a test case is skipped by either user action
-%% or due to an init function failing. Test case can be
-%% end_per_suite, init_per_group, end_per_group and the actual test cases.
--spec on_tc_skip(TC :: end_per_suite |
- init_per_group | end_per_group | atom(),
- {tc_auto_skip, {failed, {Mod :: atom(), Function :: atom(), Reason :: term()}}} |
- {tc_user_skip, {skipped, Reason :: term()}},
- State :: #state{}) ->
- NewState :: #state{}.
-on_tc_skip(TC, Reason, State) ->
- gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = cth, node = node(),
- data = {?MODULE, on_tc_skip,
- [TC,Reason,State]}}),
- State.
-
-%% @doc Called when the scope of the CTH is done, this depends on
-%% when the CTH was specified. This translation table describes when this
-%% function is called.
-%%
-%% | Started in | terminate called |
-%% |---------------------|-------------------------|
-%% | command_line | after all tests are run |
-%% | test spec | after all tests are run |
-%% | suite/0 | after SUITE is done |
-%% | init_per_suite/1 | after SUITE is done |
-%% | init_per_group/2 | after group is done |
-%% |-----------------------------------------------|
-%%
--spec terminate(State :: #state{}) ->
- term().
-terminate(State) ->
- gen_event:notify(
- ?CT_EVMGR_REF, #event{ name = cth, node = node(),
- data = {?MODULE, terminate, [State]}}),
- ok.
+ Id :: term().
+id(Opts) ->
+ gen_event:notify(?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, id, [Opts]}}),
+ now().
+
+%% @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
+%% specification, suite/0 function etc).
+%% You can change the config in the this function.
+-spec pre_init_per_suite(Suite :: atom(),
+ Config :: config(),
+ State :: #state{}) ->
+ {config() | skip_or_fail(), NewState :: #state{}}.
+pre_init_per_suite(Suite,Config,State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, pre_init_per_suite,
+ [Suite,Config,State]}}),
+ {Config, State}.
+
+%% @doc Called after init_per_suite.
+%% you can change the return value in this function.
+-spec post_init_per_suite(Suite :: atom(),
+ Config :: config(),
+ Return :: config() | skip_or_fail(),
+ State :: #state{}) ->
+ {config() | skip_or_fail(), NewState :: #state{}}.
+post_init_per_suite(Suite,Config,Return,State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, post_init_per_suite,
+ [Suite,Config,Return,State]}}),
+ {Return, State}.
+
+%% @doc Called before end_per_suite. The config/state can be changed here,
+%% though it will only affect the *end_per_suite function.
+-spec pre_end_per_suite(Suite :: atom(),
+ Config :: config() | skip_or_fail(),
+ State :: #state{}) ->
+ {ok | skip_or_fail(), NewState :: #state{}}.
+pre_end_per_suite(Suite,Config,State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, pre_end_per_suite,
+ [Suite,Config,State]}}),
+ {Config, State}.
+
+%% @doc Called after end_per_suite. Note that the config cannot be
+%% changed here, only the status of the suite.
+-spec post_end_per_suite(Suite :: atom(),
+ Config :: config(),
+ Return :: term(),
+ State :: #state{}) ->
+ {ok | skip_or_fail(), NewState :: #state{}}.
+post_end_per_suite(Suite,Config,Return,State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, post_end_per_suite,
+ [Suite,Config,Return,State]}}),
+ {Return, State}.
+
+%% @doc Called before each init_per_group.
+%% You can change the config in this function.
+-spec pre_init_per_group(Group :: atom(),
+ Config :: config(),
+ State :: #state{}) ->
+ {config() | skip_or_fail(), NewState :: #state{}}.
+pre_init_per_group(Group,Config,State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, pre_init_per_group,
+ [Group,Config,State]}}),
+ {Config, State}.
+
+%% @doc Called after each init_per_group.
+%% You can change the return value in this function.
+-spec post_init_per_group(Group :: atom(),
+ Config :: config(),
+ Return :: config() | skip_or_fail(),
+ State :: #state{}) ->
+ {config() | skip_or_fail(), NewState :: #state{}}.
+post_init_per_group(Group,Config,Return,State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, post_init_per_group,
+ [Group,Config,Return,State]}}),
+ {Return, State}.
+
+%% @doc Called after each end_per_group. The config/state can be changed here,
+%% though it will only affect the *end_per_group functions.
+-spec pre_end_per_group(Group :: atom(),
+ Config :: config() | skip_or_fail(),
+ State :: #state{}) ->
+ {ok | skip_or_fail(), NewState :: #state{}}.
+pre_end_per_group(Group,Config,State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, pre_end_per_group,
+ [Group,Config,State]}}),
+ {Config, State}.
+
+%% @doc Called after each end_per_group. Note that the config cannot be
+%% changed here, only the status of the group.
+-spec post_end_per_group(Group :: atom(),
+ Config :: config(),
+ Return :: term(),
+ State :: #state{}) ->
+ {ok | skip_or_fail(), NewState :: #state{}}.
+post_end_per_group(Group,Config,Return,State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, post_end_per_group,
+ [Group,Config,Return,State]}}),
+ {Return, State}.
+
+%% @doc Called before each test case.
+%% You can change the config in this function.
+-spec pre_init_per_testcase(TC :: atom(),
+ Config :: config(),
+ State :: #state{}) ->
+ {config() | skip_or_fail(), NewState :: #state{}}.
+pre_init_per_testcase(TC,Config,State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, pre_init_per_testcase,
+ [TC,Config,State]}}),
+ {Config, State}.
+
+%% @doc Called after each test case. Note that the config cannot be
+%% changed here, only the status of the test case.
+-spec post_end_per_testcase(TC :: atom(),
+ Config :: config(),
+ Return :: term(),
+ State :: #state{}) ->
+ {ok | skip_or_fail(), NewState :: #state{}}.
+post_end_per_testcase(TC,Config,Return,State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, post_end_per_testcase,
+ [TC,Config,Return,State]}}),
+ {Return, State}.
+
+%% @doc Called after post_init_per_suite, post_end_per_suite, post_init_per_group,
+%% post_end_per_group and post_end_per_tc if the suite, group or test case failed.
+%% This function should be used for extra cleanup which might be needed.
+%% It is not possible to modify the config or the status of the test run.
+-spec on_tc_fail(TC :: init_per_suite | end_per_suite |
+ init_per_group | end_per_group | atom(),
+ Reason :: term(), State :: #state{}) ->
+ NewState :: #state{}.
+on_tc_fail(TC, Reason, State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, on_tc_fail,
+ [TC,Reason,State]}}),
+ State.
+
+%% @doc Called when a test case is skipped by either user action
+%% or due to an init function failing. Test case can be
+%% end_per_suite, init_per_group, end_per_group and the actual test cases.
+-spec on_tc_skip(TC :: end_per_suite |
+ init_per_group | end_per_group | atom(),
+ {tc_auto_skip, {failed, {Mod :: atom(), Function :: atom(), Reason :: term()}}} |
+ {tc_user_skip, {skipped, Reason :: term()}},
+ State :: #state{}) ->
+ NewState :: #state{}.
+on_tc_skip(TC, Reason, State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, on_tc_skip,
+ [TC,Reason,State]}}),
+ State.
+
+%% @doc Called when the scope of the CTH is done, this depends on
+%% when the CTH was specified. This translation table describes when this
+%% function is called.
+%%
+%% | Started in | terminate called |
+%% |---------------------|-------------------------|
+%% | command_line | after all tests are run |
+%% | test spec | after all tests are run |
+%% | suite/0 | after SUITE is done |
+%% | init_per_suite/1 | after SUITE is done |
+%% | init_per_group/2 | after group is done |
+%% |-----------------------------------------------|
+%%
+-spec terminate(State :: #state{}) ->
+ term().
+terminate(State) ->
+ gen_event:notify(
+ ?CT_EVMGR_REF, #event{ name = cth, node = node(),
+ data = {?MODULE, terminate, [State]}}),
+ ok.
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
new file mode 100644
index 0000000000..f6de69f321
--- /dev/null
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_config_cth.erl
@@ -0,0 +1,130 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(verify_config_cth).
+
+-include_lib("common_test/src/ct_util.hrl").
+
+%% CT Hooks
+-compile(export_all).
+
+-define(val(K, L), proplists:get_value(K, L)).
+
+id(Opts) ->
+ ?MODULE.
+
+init(Id, Opts) ->
+ {ok, State} = empty_cth:init(Id, Opts),
+ {ok, State}.
+
+pre_init_per_suite(Suite, Config, State) ->
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ empty_cth:pre_init_per_suite(Suite,
+ [{pre_init_per_suite,true} | Config],
+ State).
+
+post_init_per_suite(Suite,Config,Return,State) ->
+ true = ?val(pre_init_per_suite, Return),
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ empty_cth:post_init_per_suite(Suite,
+ Config,
+ [{post_init_per_suite,true} | Return],
+ State).
+
+pre_end_per_suite(Suite,Config,State) ->
+ true = ?val(post_init_per_suite, Config),
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ empty_cth:pre_end_per_suite(Suite,
+ [{pre_end_per_suite,true} | Config],
+ State).
+
+post_end_per_suite(Suite,Config,Return,State) ->
+ true = ?val(pre_end_per_suite, Config),
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
+
+pre_init_per_group(Group,Config,State) ->
+ true = ?val(post_init_per_suite, Config),
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ test_group = ct:get_config(group_cfg),
+ empty_cth:pre_init_per_group(Group,
+ [{pre_init_per_group,true} | Config],
+ State).
+
+post_init_per_group(Group,Config,Return,State) ->
+ true = ?val(pre_init_per_group, Return),
+ test_group = ct:get_config(group_cfg),
+ empty_cth:post_init_per_group(Group,
+ Config,
+ [{post_init_per_group,true} | Return],
+ State).
+
+pre_end_per_group(Group,Config,State) ->
+ true = ?val(post_init_per_group, Config),
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ test_group = ct:get_config(group_cfg),
+ empty_cth:pre_end_per_group(Group,
+ [{pre_end_per_group,true} | Config],
+ State).
+
+post_end_per_group(Group,Config,Return,State) ->
+ true = ?val(pre_end_per_group, Config),
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ test_group = ct:get_config(group_cfg),
+ empty_cth:post_end_per_group(Group,Config,Return,State).
+
+pre_init_per_testcase(TC,Config,State) ->
+ true = ?val(post_init_per_suite, Config),
+ case ?val(name, ?val(tc_group_properties, Config)) of
+ undefined ->
+ ok;
+ _ ->
+ true = ?val(post_init_per_group, Config),
+ test_group = ct:get_config(group_cfg)
+ end,
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ CfgKey = list_to_atom(atom_to_list(TC) ++ "_cfg"),
+ TC = ct:get_config(CfgKey),
+ empty_cth:pre_init_per_testcase(TC,
+ [{pre_init_per_testcase,true} | Config],
+ State).
+
+post_end_per_testcase(TC,Config,Return,State) ->
+ true = ?val(post_init_per_suite, Config),
+ true = ?val(pre_init_per_testcase, Config),
+ case ?val(name, ?val(tc_group_properties, Config)) of
+ undefined ->
+ ok;
+ _ ->
+ true = ?val(post_init_per_group, Config),
+ test_group = ct:get_config(group_cfg)
+ end,
+ ct_no_config_SUITE = ct:get_config(suite_cfg),
+ CfgKey = list_to_atom(atom_to_list(TC) ++ "_cfg"),
+ TC = ct:get_config(CfgKey),
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
+
+on_tc_fail(TC, Reason, State) ->
+ empty_cth:on_tc_fail(TC,Reason,State).
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+ empty_cth:terminate(State).
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
new file mode 100644
index 0000000000..279a04b9a9
--- /dev/null
+++ b/lib/common_test/test/ct_hooks_SUITE_data/cth/tests/verify_data_dir_cth.erl
@@ -0,0 +1,95 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(verify_data_dir_cth).
+
+-include_lib("common_test/src/ct_util.hrl").
+
+%% CT Hooks
+-compile(export_all).
+
+-define(val(K, L), proplists:get_value(K, L)).
+
+check_dirs(State,Config) ->
+ DataDirName = ?val(data_dir_name, State),
+ %% check priv_dir
+ PrivDir = proplists:get_value(priv_dir, Config),
+ "log_private" = filename:basename(PrivDir),
+ {ok,_} = file:list_dir(PrivDir),
+
+ %% check data_dir
+ DataDir = proplists:get_value(data_dir, Config),
+ DataDirName = filename:basename(DataDir),
+ ok.
+
+id(_Opts) ->
+ ?MODULE.
+
+init(Id, _Opts) ->
+ {ok, _State} = empty_cth:init(Id, []),
+ {ok, [{data_dir_name,"ct_data_dir_SUITE_data"}]}.
+
+pre_init_per_suite(Suite,Config,State) ->
+ check_dirs(State,Config),
+ empty_cth:pre_init_per_suite(Suite,Config,State).
+
+post_init_per_suite(Suite,Config,Return,State) ->
+ check_dirs(State,Return),
+ empty_cth:post_init_per_suite(Suite,Config,Return,State).
+
+pre_end_per_suite(Suite,Config,State) ->
+ check_dirs(State,Config),
+ empty_cth:pre_end_per_suite(Suite,Config,State).
+
+post_end_per_suite(Suite,Config,Return,State) ->
+ check_dirs(State,Config),
+ empty_cth:post_end_per_suite(Suite,Config,Return,State).
+
+pre_init_per_group(Group,Config,State) ->
+ check_dirs(State,Config),
+ empty_cth:pre_init_per_group(Group,Config,State).
+
+post_init_per_group(Group,Config,Return,State) ->
+ check_dirs(State,Return),
+ empty_cth:post_init_per_group(Group,Config,Return,State).
+
+pre_end_per_group(Group,Config,State) ->
+ check_dirs(State,Config),
+ empty_cth:pre_end_per_group(Group,Config,State).
+
+post_end_per_group(Group,Config,Return,State) ->
+ check_dirs(State,Config),
+ empty_cth:post_end_per_group(Group,Config,Return,State).
+
+pre_init_per_testcase(TC,Config,State) ->
+ check_dirs(State,Config),
+ empty_cth:pre_init_per_testcase(TC,Config,State).
+
+post_end_per_testcase(TC,Config,Return,State) ->
+ check_dirs(State,Config),
+ empty_cth:post_end_per_testcase(TC,Config,Return,State).
+
+on_tc_fail(TC, Reason, State) ->
+ empty_cth:on_tc_fail(TC,Reason,State).
+
+on_tc_skip(TC, Reason, State) ->
+ empty_cth:on_tc_skip(TC,Reason,State).
+
+terminate(State) ->
+ empty_cth:terminate(State).
diff --git a/lib/common_test/test/ct_master_SUITE.erl b/lib/common_test/test/ct_master_SUITE.erl
index 1471cc1e0c..27243a0067 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -98,7 +98,7 @@ end_per_group(_GroupName, Config) ->
%%--------------------------------------------------------------------
%% TEST CASES
%%--------------------------------------------------------------------
-ct_master_test(Config) when is_list(Config)->
+ct_master_test(Config) when is_list(Config) ->
NodeNames = proplists:get_value(node_names, Config),
DataDir = ?config(data_dir, Config),
PrivDir = ?config(priv_dir, Config),
@@ -106,19 +106,14 @@ ct_master_test(Config) when is_list(Config)->
FileName = filename:join(PrivDir, "ct_master_spec.spec"),
Suites = [master_SUITE],
TSFile = make_spec(DataDir, FileName, NodeNames, Suites, Config),
+
ERPid = ct_test_support:start_event_receiver(Config),
- spawn(ct@ancalagon,
- fun() ->
- dbg:tracer(),dbg:p(all,c),
- dbg:tpl(erlang, spawn_link, 4,x),
- receive ok -> ok end
- end),
- [{TSFile, ok}] = run_test(ct_master_test, FileName, Config),
+ [{TSFile,ok}] = run_test(ct_master_test, FileName, Config),
Events = ct_test_support:get_events(ERPid, Config),
- ct_test_support:log_events(groups_suite_1,
+ ct_test_support:log_events(ct_master_test,
reformat(Events, ?eh),
PrivDir, []),
@@ -134,48 +129,59 @@ ct_master_test(Config) when is_list(Config)->
%%%-----------------------------------------------------------------
%%% HELP FUNCTIONS
%%%-----------------------------------------------------------------
-make_spec(DataDir, FileName, NodeNames, Suites, Config)->
- {ok, HostName} = inet:gethostname(),
+make_spec(DataDir, FileName, NodeNames, Suites, Config) ->
+ {ok,HostName} = inet:gethostname(),
- N = lists:map(fun(NodeName)->
+ N = lists:map(fun(NodeName) ->
{node, NodeName, list_to_atom(atom_to_list(NodeName)++"@"++HostName)}
end,
NodeNames),
- C = lists:map(fun(NodeName)->
- Rnd = random:uniform(2),
- if Rnd == 1->
- {config, NodeName, filename:join(DataDir, "master/config.txt")};
- true->
- {userconfig, NodeName, {ct_config_xml, filename:join(DataDir, "master/config.xml")}}
- end
- end,
- NodeNames),
-
- NS = lists:map(fun(NodeName)->
- {init, NodeName, [
- {node_start, [{startup_functions, []}, {monitor_master, true}]},
- {eval, {erlang, nodes, []}}
- ]
- }
- end,
- NodeNames),
-
+ C = lists:map(
+ fun(NodeName) ->
+ Rnd = random:uniform(2),
+ if Rnd == 1->
+ {config,NodeName,filename:join(DataDir,
+ "master/config.txt")};
+ true ->
+ {userconfig,NodeName,
+ {ct_config_xml,filename:join(DataDir,
+ "master/config.xml")}}
+ end
+ end,
+ NodeNames),
+
+ CM = [{config,master,filename:join(DataDir,"master/config.txt")}],
+
+ NS = lists:map(
+ fun(NodeName) ->
+ {init,NodeName,[
+ {node_start,[{startup_functions,[]},
+ {monitor_master,true}]},
+ {eval,{erlang,nodes,[]}}
+ ]
+ }
+ end,
+ NodeNames),
+
S = [{suites, NodeNames, filename:join(DataDir, "master"), Suites}],
-
+
PrivDir = ?config(priv_dir, Config),
- LD = lists:map(fun(NodeName)->
- {logdir, NodeName, get_log_dir(os:type(),PrivDir, NodeName)}
- end,
- NodeNames) ++ [{logdir, master, PrivDir}],
+
+ LD = lists:map(
+ fun(NodeName) ->
+ {logdir,NodeName,get_log_dir(os:type(),PrivDir, NodeName)}
+ end,
+ NodeNames) ++ [{logdir,master,PrivDir}],
+
EvHArgs = [{cbm,ct_test_support},{trace_level,?config(trace_level,Config)}],
EH = [{event_handler,master,[?eh],EvHArgs}],
-
+
Include = [{include,filename:join([DataDir,"master/include"])}],
+
+ ct_test_support:write_testspec(N++Include++EH++C++CM++S++LD++NS, FileName).
- ct_test_support:write_testspec(N++Include++EH++C++S++LD++NS, FileName).
-
-get_log_dir({win32,_}, _PrivDir, NodeName)->
+get_log_dir({win32,_}, _PrivDir, NodeName) ->
case filelib:is_dir(?TEMP_DIR) of
false ->
file:make_dir(?TEMP_DIR);
@@ -188,8 +194,15 @@ get_log_dir(_,PrivDir,NodeName) ->
file:make_dir(LogDir),
LogDir.
-run_test(_Name, FileName, Config)->
- [{FileName, ok}] = ct_test_support:run(ct_master, run, [FileName], Config).
+run_test(_Name, FileName, Config) ->
+ %% run the test twice, using different html versions
+ [{FileName,ok}] = ct_test_support:run({ct_master,run,[FileName]},
+ [{ct_master,basic_html,[true]}],
+ Config),
+ timer:sleep(5000),
+ [{FileName,ok}] = ct_test_support:run({ct_master,run,[FileName]},
+ [{ct_master,basic_html,[false]}],
+ Config).
reformat(Events, EH) ->
ct_test_support:reformat(Events, EH).
@@ -220,5 +233,5 @@ add_host(NodeName) ->
{ok, HostName} = inet:gethostname(),
list_to_atom(atom_to_list(NodeName)++"@"++HostName).
-expected_events(_)->
+expected_events(_) ->
[].
diff --git a/lib/common_test/test/ct_misc_1_SUITE.erl b/lib/common_test/test/ct_misc_1_SUITE.erl
index cb17af9ab5..9ff4e6a65f 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -106,7 +106,7 @@ beam_me_up(Config) when is_list(Config) ->
{Opts,ERPid} = setup([{suite,Suites},{auto_compile,false}], Config),
- ok = ct_test_support:run(ct, run_test, [Opts], Config),
+ {_Ok,_Fail,_Skip} = ct_test_support:run(ct, run_test, [Opts], Config),
Events = ct_test_support:get_events(ERPid, Config),
ct_test_support:log_events(beam_me_up,
diff --git a/lib/common_test/test/ct_netconfc_SUITE.erl b/lib/common_test/test/ct_netconfc_SUITE.erl
new file mode 100644
index 0000000000..e6e8d5b09c
--- /dev/null
+++ b/lib/common_test/test/ct_netconfc_SUITE.erl
@@ -0,0 +1,124 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%%-------------------------------------------------------------------
+%%% File: ct_netconfc_SUITE
+%%%
+%%% Description:
+%%% Test ct_netconfc module
+%%%
+%%%-------------------------------------------------------------------
+-module(ct_netconfc_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+-define(eh, ct_test_support_eh).
+
+%%--------------------------------------------------------------------
+%% TEST SERVER CALLBACK FUNCTIONS
+%%--------------------------------------------------------------------
+
+%%--------------------------------------------------------------------
+%% Description: Since Common Test starts another Test Server
+%% instance, the tests need to be performed on a separate node (or
+%% there will be clashes with logging processes etc).
+%%--------------------------------------------------------------------
+init_per_suite(Config) ->
+ Config1 = ct_test_support:init_per_suite(Config),
+ Config1.
+
+end_per_suite(Config) ->
+ ct_test_support:end_per_suite(Config).
+
+init_per_testcase(TestCase, Config) ->
+ ct_test_support:init_per_testcase(TestCase, Config).
+
+end_per_testcase(TestCase, Config) ->
+ ct_test_support:end_per_testcase(TestCase, Config).
+
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [
+ default
+ ].
+
+%%--------------------------------------------------------------------
+%% TEST CASES
+%%--------------------------------------------------------------------
+
+%%%-----------------------------------------------------------------
+%%%
+default(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Suite = filename:join(DataDir, "netconfc1_SUITE"),
+ CfgFile = filename:join(DataDir, "netconfc1.cfg"),
+ {Opts,ERPid} = setup([{suite,Suite},{config,CfgFile},
+ {label,default}], Config),
+
+ ok = execute(default, Opts, ERPid, Config).
+
+
+%%%-----------------------------------------------------------------
+%%% HELP FUNCTIONS
+%%%-----------------------------------------------------------------
+
+setup(Test, Config) ->
+ Opts0 = ct_test_support:get_opts(Config),
+ Level = ?config(trace_level, Config),
+ EvHArgs = [{cbm,ct_test_support},{trace_level,Level}],
+ Opts = Opts0 ++ [{event_handler,{?eh,EvHArgs}}|Test],
+ ERPid = ct_test_support:start_event_receiver(Config),
+ {Opts,ERPid}.
+
+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),
+ Opts),
+
+ TestEvents = events_to_check(Name,Config),
+ ct_test_support:verify_events(TestEvents, Events, Config).
+
+reformat(Events, EH) ->
+ ct_test_support:reformat(Events, EH).
+
+%%%-----------------------------------------------------------------
+%%% TEST EVENTS
+%%%-----------------------------------------------------------------
+events_to_check(Test,Config) ->
+ {module,_} = code:load_abs(filename:join(?config(data_dir,Config),
+ netconfc1_SUITE)),
+ TCs = netconfc1_SUITE:all(),
+ code:purge(netconfc1_SUITE),
+ code:delete(netconfc1_SUITE),
+
+ OneTest =
+ [{?eh,start_logging,{'DEF','RUNDIR'}}] ++
+ [{?eh,tc_done,{netconfc1_SUITE,TC,ok}} || TC <- TCs] ++
+ [{?eh,stop_logging,[]}],
+
+ %% 2 tests (ct:run_test + script_start) is default
+ OneTest ++ OneTest.
diff --git a/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1.cfg b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1.cfg
new file mode 100644
index 0000000000..b431301df6
--- /dev/null
+++ b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1.cfg
@@ -0,0 +1,6 @@
+%% -*- erlang -*-
+{netconf1,[{ssh,"127.0.0.1"},
+ {port,2060},
+ {user,"xxx"},
+ {password,"xxx"}]}.
+{ct_conn_log,[{ct_netconfc,[{log_type,pretty}]}]}. %overrides args to cth_conn_log
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
new file mode 100644
index 0000000000..d337158bce
--- /dev/null
+++ b/lib/common_test/test/ct_netconfc_SUITE_data/netconfc1_SUITE.erl
@@ -0,0 +1,1132 @@
+%%--------------------------------------------------------------------
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+%%----------------------------------------------------------------------
+%% File: ct_netconfc_SUITE.erl
+%%
+%% Description:
+%% This file contains the test cases for the ct_netconfc API.
+%%
+%% @author Support
+%% @doc Netconf Client Interface.
+%% @end
+%%----------------------------------------------------------------------
+%%----------------------------------------------------------------------
+-module(netconfc1_SUITE).
+-include_lib("common_test/include/ct.hrl").
+-include_lib("common_test/src/ct_netconfc.hrl").
+-include_lib("public_key/include/public_key.hrl").
+
+-compile(export_all).
+
+%% Default timetrap timeout (set in init_per_testcase).
+-define(default_timeout, ?t:minutes(1)).
+
+-define(NS,ns).
+-define(LOCALHOST, "127.0.0.1").
+-define(SSH_PORT, 2060).
+
+-define(DEFAULT_SSH_OPTS,[{ssh,?LOCALHOST},
+ {port,?SSH_PORT},
+ {user,"xxx"},
+ {password,"xxx"}]).
+-define(DEFAULT_SSH_OPTS(Dir), ?DEFAULT_SSH_OPTS++[{user_dir,Dir}]).
+
+-define(ok,ok).
+
+suite() ->
+ [{ct_hooks, [{cth_conn_log,
+ [{ct_netconfc,[{log_type,html}, %will be overwritten by config
+ {hosts,[my_named_connection,netconf1]}]
+ }]
+ }]
+ }].
+
+all() ->
+ case os:find_executable("ssh") of
+ false ->
+ {skip, "SSH not installed on host"};
+ _ ->
+ [hello,
+ hello_from_server_first,
+ hello_named,
+ hello_configured,
+ hello_configured_extraopts,
+ hello_required,
+ hello_required_exists,
+ hello_global_pwd,
+ hello_no_session_id,
+ hello_incomp_base_vsn,
+ hello_no_base_cap,
+ hello_no_caps,
+ no_server_hello,
+ no_client_hello,
+ get_session_id,
+ get_capabilities,
+ faulty_user,
+ faulty_passwd,
+ faulty_port,
+ no_host,
+ no_port,
+ invalid_opt,
+ get,
+ get_xpath,
+ get_config,
+ get_config_xpath,
+ edit_config,
+ copy_config,
+ delete_config,
+ lock,
+ unlock,
+ kill_session,
+ get_no_such_client,
+ action,
+ send_any_rpc,
+ send_any,
+ hide_password,
+ not_proper_xml,
+ prefixed_namespace,
+ receive_chunked_data,
+ timeout_receive_chunked_data,
+ close_while_waiting_for_chunked_data,
+ connection_crash,
+ get_event_streams,
+ create_subscription,
+ receive_event
+ ]
+ end.
+
+
+groups() ->
+ [].
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+init_per_testcase(_Case, Config) ->
+ ets:delete_all_objects(ns_tab),
+ Dog = test_server:timetrap(?default_timeout),
+ [{watchdog, Dog}|Config].
+
+end_per_testcase(_Case, Config) ->
+ Dog=?config(watchdog, Config),
+ test_server:timetrap_cancel(Dog),
+ ok.
+
+init_per_suite(Config) ->
+ case catch {crypto:start(), ssh:start()} of
+ {ok, ok} ->
+ {ok, _} = get_id_keys(Config),
+ make_dsa_files(Config),
+ Server = ?NS:start(?config(data_dir,Config)),
+ [{server,Server}|Config];
+ _ ->
+ {skip, "Crypto and/or SSH could not be started!"}
+ end.
+
+end_per_suite(Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ ?NS:stop(?config(server,Config)),
+ ssh:stop(),
+ crypto:stop(),
+ remove_id_keys(PrivDir),
+ Config.
+
+hello(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+hello_from_server_first(Config) ->
+ DataDir = ?config(data_dir,Config),
+ ?NS:hello(1),
+ {ok,Client} = ct_netconfc:only_open(?DEFAULT_SSH_OPTS(DataDir)),
+ ct:sleep(500),
+ ?NS:expect(hello),
+ ?ok = ct_netconfc:hello(Client),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+hello_named(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(any_name,DataDir),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+hello_configured() ->
+ [{require, netconf1}].
+hello_configured(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_configured_success(netconf1,DataDir),
+ ?NS:expect_do_reply('close-session',close,ok),
+ {error, {no_such_name,netconf1}} = ct_netconfc:close_session(netconf1),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+hello_configured_extraopts() ->
+ [{require, netconf1}].
+hello_configured_extraopts(Config) ->
+ DataDir = ?config(data_dir,Config),
+ %% Test that the cofiguration overwrites the ExtraOpts parameter
+ %% to ct_netconfc:open/2.
+ {ok,Client} = open_configured_success(netconf1,DataDir,[{password,"faulty"}]),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+hello_required() ->
+ [{require, my_named_connection, netconf1}].
+hello_required(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,_Client} = open_configured_success(my_named_connection,DataDir),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(my_named_connection),
+ ok.
+
+hello_required_exists() ->
+ [{require, my_named_connection, netconf1}].
+hello_required_exists(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,_Client1} = open_configured_success(my_named_connection,DataDir),
+
+ %% Check that same name can not be used twice
+ {error,{connection_exists,_Client1}} =
+ ct_netconfc:open(my_named_connection,[{user_dir,DataDir}]),
+
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(my_named_connection),
+ timer:sleep(500),
+
+ %% Then check that it can be used again after the first is closed
+ {ok,_Client2} = open_configured_success(my_named_connection,DataDir),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(my_named_connection),
+ ok.
+
+hello_global_pwd(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir,[{user,"any-user"},
+ {password,"global-xxx"}]),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+hello_no_session_id(Config) ->
+ DataDir = ?config(data_dir,Config),
+ ?NS:hello(no_session_id),
+ ?NS:expect(no_session_id,hello),
+ {error,{incorrect_hello,no_session_id_found}} = open(DataDir),
+ ok.
+
+hello_incomp_base_vsn(Config) ->
+ DataDir = ?config(data_dir,Config),
+ ?NS:hello(1,{base,"1.1"}),
+ ?NS:expect(hello),
+ {error,{incompatible_base_capability_vsn,"1.1"}} = open(DataDir),
+ ok.
+
+hello_no_base_cap(Config) ->
+ DataDir = ?config(data_dir,Config),
+ ?NS:hello(1,no_base),
+ ?NS:expect(hello),
+ {error,{incorrect_hello,no_base_capability_found}} = open(DataDir),
+ ok.
+
+hello_no_caps(Config) ->
+ DataDir = ?config(data_dir,Config),
+ ?NS:hello(1,no_caps),
+ ?NS:expect(hello),
+ {error,{incorrect_hello,capabilities_not_found}} = open(DataDir),
+ ok.
+
+no_server_hello(Config) ->
+ DataDir = ?config(data_dir,Config),
+ ?NS:expect(undefined,hello),
+ {error,{hello_session_failed,timeout}} = open(DataDir,[{timeout,2000}]),
+ ok.
+
+no_client_hello(Config) ->
+ DataDir = ?config(data_dir,Config),
+ ?NS:hello(1),
+ {ok,Client} = ct_netconfc:only_open(?DEFAULT_SSH_OPTS(DataDir)),
+
+ %% Allow server hello to arrive
+ ct:sleep(500),
+
+ %% Tell server to receive a get request and then die without
+ %% replying since no hello has been received. (is this correct
+ %% behavoiur??)
+ ?NS:expect_do(get,close),
+ {error,closed} = ct_netconfc:get(Client,whatever),
+ ok.
+
+get_session_id(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+
+ 1 = ct_netconfc:get_session_id(Client),
+
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+get_capabilities(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+
+ Caps = ct_netconfc:get_capabilities(Client),
+ BaseCap = ?NETCONF_BASE_CAP ++ ?NETCONF_BASE_CAP_VSN,
+ [BaseCap,"urn:ietf:params:netconf:capability:writable-running:1.0" |_] = Caps,
+
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+faulty_user(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {error,{ssh,could_not_connect_to_server,
+ "Unable to connect using the available authentication methods"}} =
+ open(DataDir,[{user,"yyy"}]),
+ ok.
+
+faulty_passwd(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {error,{ssh,could_not_connect_to_server,
+ "Unable to connect using the available authentication methods"}} =
+ open(DataDir,[{password,"yyy"}]),
+ ok.
+
+faulty_port(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {error,{ssh,could_not_connect_to_server,econnrefused}} =
+ open(DataDir,[{port,2062}]),
+ ok.
+
+no_host(Config) ->
+ DataDir = ?config(data_dir,Config),
+ Opts = lists:keydelete(ssh,1,?DEFAULT_SSH_OPTS(DataDir)),
+ {error,no_host_address} = ct_netconfc:open(Opts),
+ ok.
+
+no_port(Config) ->
+ DataDir = ?config(data_dir,Config),
+ Opts = lists:keydelete(port,1,?DEFAULT_SSH_OPTS(DataDir)),
+ {error,no_port} = ct_netconfc:open(Opts),
+ ok.
+
+invalid_opt(Config) ->
+ DataDir = ?config(data_dir,Config),
+ Opts1 = ?DEFAULT_SSH_OPTS(DataDir) ++ [{timeout,invalidvalue}],
+ {error,{invalid_option,{timeout,invalidvalue}}} = ct_netconfc:open(Opts1),
+ Opts2 = ?DEFAULT_SSH_OPTS(DataDir) ++ [{some_other_opt,true}],
+ {error,{invalid_option,{some_other_opt,true}}} = ct_netconfc:open(Opts2),
+ ok.
+
+get(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ Data = [{server,[{xmlns,"myns"}],[{name,[],["myserver"]}]}],
+ ?NS:expect_reply('get',{data,Data}),
+ {ok,Data} = ct_netconfc:get(Client,{server,[{xmlns,"myns"}],[]}),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+get_xpath(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ Data = [{server,[{xmlns,"myns"}],[{name,[],["myserver"]}]}],
+ ?NS:expect_reply({'get',xpath},{data,Data}),
+ {ok,Data} = ct_netconfc:get(Client,{xpath,"/server"}),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+get_config(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ Data = [{server,[{xmlns,"myns"}],[{name,[],["myserver"]}]}],
+ ?NS:expect_reply('get-config',{data,Data}),
+ {ok,Data} = ct_netconfc:get_config(Client,running,
+ {server,[{xmlns,"myns"}],[]}),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+get_config_xpath(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ Data = [{server,[{xmlns,"myns"}],[{name,[],["myserver"]}]}],
+ ?NS:expect_reply({'get-config',xpath},{data,Data}),
+ {ok,Data} = ct_netconfc:get_config(Client,running,{xpath,"/server"}),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+edit_config(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ ?NS:expect_reply('edit-config',ok),
+ ?ok = ct_netconfc:edit_config(Client,running,
+ {server,[{xmlns,"myns"}],
+ [{name,["myserver"]}]}),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+copy_config(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ ?NS:expect_reply('copy-config',ok),
+ ?ok = ct_netconfc:copy_config(Client,startup,running),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+delete_config(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ ?NS:expect_reply('delete-config',ok),
+ ?ok = ct_netconfc:delete_config(Client,startup),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+lock(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ ?NS:expect_reply('lock',ok),
+ ?ok = ct_netconfc:lock(Client,running),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+unlock(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ ?NS:expect_reply('unlock',ok),
+ ?ok = ct_netconfc:unlock(Client,running),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+kill_session(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+
+ ?NS:hello(2),
+ ?NS:expect(2,hello),
+ {ok,_OtherClient} = open(DataDir),
+
+ ?NS:expect_do_reply('kill-session',{kill,2},ok),
+ ?ok = ct_netconfc:kill_session(Client,2),
+
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+
+ ok.
+
+get_no_such_client(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ case ct_netconfc:get(Client,{server,[{xmlns,"myns"}],[]}) of
+ {error,no_such_client} ->
+ ok;
+ {error,closed} ->
+ %% Means that the Client process was not terminated before the call.
+ %% Give it one more go.
+ {error,no_such_client} =
+ ct_netconfc:get(Client,{server,[{xmlns,"myns"}],[]})
+ end,
+ ok.
+
+action(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ Data = [{myactionreturn,[{xmlns,"myns"}],["value"]}],
+ ?NS:expect_reply(action,{data,Data}),
+ {ok,Data} = ct_netconfc:action(Client,{myaction,[{xmlns,"myns"}],[]}),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+send_any_rpc(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ Data = [{server,[{xmlns,"myns"}],[{name,[],["myserver"]}]}],
+ GetConf = {'get-config',
+ [{source,["running"]},
+ {filter,[{type,"subtree"}],
+ [{server,[{xmlns,"myns"}],[]}]}]},
+ ?NS:expect_reply('get-config',{data,Data}),
+ [{data,?NETCONF_NAMESPACE_ATTR,Data}] = ct_netconfc:send_rpc(Client,GetConf),
+
+ EditConf = {'edit-config',
+ [{target,["running"]},
+ {config,[{server,[{xmlns,"myns"}],
+ [{name,["myserver"]}]}]}]},
+ ?NS:expect_reply('edit-config',ok),
+ [{ok,?NETCONF_NAMESPACE_ATTR,[]}] = ct_netconfc:send_rpc(Client,EditConf),
+
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+send_any(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+
+ %% Correct get-config rpc
+ Data = [{server,[{xmlns,"myns"}],[{name,[],["myserver"]}]}],
+ RpcAttr1 = ?NETCONF_NAMESPACE_ATTR ++ [{'message-id',"1"}],
+ RpcGetConf = {rpc,RpcAttr1,
+ [{'get-config',
+ [{source,["running"]},
+ {filter,[{type,"subtree"}],
+ [{server,[{xmlns,"myns"}],[]}]}]}]},
+ ?NS:expect_reply('get-config',{data,Data}),
+ {'rpc-reply',RpcAttr1,[{data,_,Data}]} = ct_netconfc:send(Client,RpcGetConf),
+
+ %% Correct edit-config rpc
+ RpcAttr2 = ?NETCONF_NAMESPACE_ATTR ++ [{'message-id',"2"}],
+ RpcEditConf = {rpc,RpcAttr2,
+ [{'edit-config',
+ [{target,["running"]},
+ {config,[{server,[{xmlns,"myns"}],
+ [{name,["myserver"]}]}]}]}]},
+ ?NS:expect_reply('edit-config',ok),
+ {'rpc-reply',RpcAttr2,[{ok,_,[]}]} = ct_netconfc:send(Client,RpcEditConf),
+
+ %% Send any data
+ ?NS:expect_reply(any,{ok,[],[]}),
+ {ok,_,[]} = ct_netconfc:send(Client,{any,[],[]}),
+
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+hide_password(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ Password = "my_very_secret_password",
+ Data = [{passwords,[{xmlns,"myns"}],
+ [{password,[{xmlns,"pwdns"}],[Password]},
+ {password,[],[Password]}]}],
+ ?NS:expect_reply('get',{data,Data}),
+ ct:capture_start(), % in case of html logging
+ {ok,Data} = ct_netconfc:get(Client,{passwords,[{xmlns,"myns"}],[]}),
+ ct:capture_stop(),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+
+ Log = filename:join(?config(priv_dir,Config),"hide_password-netconf.txt"),
+
+ Text =
+ case file:read_file(Log) of
+ {ok,Bin} ->
+ Bin;
+ _NoLog ->
+ %% Assume html logging
+ list_to_binary(ct:capture_get())
+ end,
+
+ nomatch = binary:match(Text,list_to_binary(Password)),
+
+ ok.
+
+not_proper_xml(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ NS = list_to_binary(?NETCONF_NAMESPACE),
+ NotProper = <<"<rpc-reply message-id=\"1\" xmlns=\"",
+ NS/binary,"\"><data></rpc-reply>">>,
+ ?NS:expect_reply('get',NotProper),
+ {error,{failed_to_parse_received_data,_}} =
+ ct_netconfc:get(Client,{server,[{xmlns,"myns"}],[]}),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+prefixed_namespace(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ NS = list_to_binary(?NETCONF_NAMESPACE),
+
+ %% Test that data element can be properly decoded and that
+ %% prefixed namespace attributes (exepct the netconf namespace)
+ %% are forwarded to the content of the data element - i.e. that
+ %% the xmlns:my is forwarded from the rpc-reply element to the
+ %% server element below.
+ Data = <<"<nc:rpc-reply message-id=\"1\" xmlns:nc=\"",
+ NS/binary,"\" xmlns:my=\"myns\"><nc:data><my:server>",
+ "<my:name my:lang=\"en\">myserver</my:name></my:server>"
+ "</nc:data></nc:rpc-reply>">>,
+ ?NS:expect_reply('get',Data),
+ {ok,[{'my:server',[{'xmlns:my',"myns"}],
+ [{'my:name',[{'my:lang',"en"}],["myserver"]}]}]} =
+ ct_netconfc:get(Client,{server,[{xmlns,"myns"}],[]}),
+
+ Ok = <<"<nc:rpc-reply message-id=\"2\" xmlns:nc=\"",
+ NS/binary,"\"><nc:ok/></nc:rpc-reply>">>,
+ ?NS:expect_reply('edit-config',Ok),
+ ?ok = ct_netconfc:edit_config(Client,running,
+ {server,[{xmlns,"myns"}],
+ [{name,["myserver"]}]}),
+
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+%% Test that the client can parse data which is received in chunks,
+%% i.e. when the complete rpc-reply is not contained in one single ssh
+%% data message.
+receive_chunked_data(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+
+ %% Construct the data to return from netconf server
+ Data = [{servers,[{xmlns,"myns"}],
+ [{server,[],[{name,[],["server0"]}]},
+ {server,[],[{name,[],["server1"]}]},
+ {server,[],[{name,[],["server2"]}]},
+ {server,[],[{name,[],["server3"]}]},
+ {server,[],[{name,[],["server4"]}]},
+ {server,[],[{name,[],["server5"]}]},
+ {server,[],[{name,[],["server6"]}]},
+ {server,[],[{name,[],["server7"]}]},
+ {server,[],[{name,[],["server8"]}]},
+ {server,[],[{name,[],["server9"]}]}]
+ }],
+ Rpc = {'rpc-reply',?NETCONF_NAMESPACE_ATTR ++ [{'message-id',"1"}],
+ [{data,Data}]},
+ Xml = list_to_binary(xmerl:export_simple_element(Rpc,xmerl_xml)),
+ Netconf =
+ <<"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
+ Xml/binary,"\n",?END_TAG/binary>>,
+
+ %% Split the data in some chunks
+ PartLength = size(Netconf) div 3,
+ <<Part1:PartLength/binary,Part2:PartLength/binary,Part3:PartLength/binary,
+ Part4/binary>> = Netconf,
+
+ %% Spawn a process which will wait a bit for the client to send
+ %% the request (below), then order the server to the chunks of the
+ %% rpc-reply one by one.
+ spawn(fun() -> timer:sleep(500),?NS:hupp(send,Part1),
+ timer:sleep(100),?NS:hupp(send,Part2),
+ timer:sleep(100),?NS:hupp(send,Part3),
+ timer:sleep(100),?NS:hupp(send,Part4)
+ end),
+
+ %% Order server to expect a get - then the process above will make
+ %% sure the rpc-reply is sent.
+ ?NS:expect('get'),
+ {ok,Data} = ct_netconfc:get(Client,{server,[{xmlns,"myns"}],[]}),
+
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+%% Same as receive_chunked_data, but timeout waiting for last part.
+timeout_receive_chunked_data(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+
+ %% Construct the data to return from netconf server
+ Data = [{servers,[{xmlns,"myns"}],
+ [{server,[],[{name,[],["server0"]}]},
+ {server,[],[{name,[],["server1"]}]},
+ {server,[],[{name,[],["server2"]}]},
+ {server,[],[{name,[],["server3"]}]},
+ {server,[],[{name,[],["server4"]}]},
+ {server,[],[{name,[],["server5"]}]},
+ {server,[],[{name,[],["server6"]}]},
+ {server,[],[{name,[],["server7"]}]},
+ {server,[],[{name,[],["server8"]}]},
+ {server,[],[{name,[],["server9"]}]}]
+ }],
+ Rpc = {'rpc-reply',?NETCONF_NAMESPACE_ATTR ++ [{'message-id',"1"}],
+ [{data,Data}]},
+ Xml = list_to_binary(xmerl:export_simple_element(Rpc,xmerl_xml)),
+ Netconf =
+ <<"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
+ Xml/binary,"\n",?END_TAG/binary>>,
+
+ %% Split the data in some chunks
+ PartLength = size(Netconf) div 3,
+ <<Part1:PartLength/binary,Part2:PartLength/binary,_Part3:PartLength/binary,
+ _Part4/binary>> = Netconf,
+
+ %% Spawn a process which will wait a bit for the client to send
+ %% the request (below), then order the server to the chunks of the
+ %% rpc-reply one by one.
+ spawn(fun() -> timer:sleep(500),?NS:hupp(send,Part1),
+ timer:sleep(100),?NS:hupp(send,Part2)
+ end),
+
+ %% 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 timeout.
+ ?NS:expect('get'),
+ {error,timeout} = ct_netconfc:get(Client,{server,[{xmlns,"myns"}],[]},2000),
+
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+%% Same as receive_chunked_data, but timeout waiting for last part.
+close_while_waiting_for_chunked_data(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+
+ %% Construct the data to return from netconf server
+ Data = [{servers,[{xmlns,"myns"}],
+ [{server,[],[{name,[],["server0"]}]},
+ {server,[],[{name,[],["server1"]}]},
+ {server,[],[{name,[],["server2"]}]},
+ {server,[],[{name,[],["server3"]}]},
+ {server,[],[{name,[],["server4"]}]},
+ {server,[],[{name,[],["server5"]}]},
+ {server,[],[{name,[],["server6"]}]},
+ {server,[],[{name,[],["server7"]}]},
+ {server,[],[{name,[],["server8"]}]},
+ {server,[],[{name,[],["server9"]}]}]
+ }],
+ Rpc = {'rpc-reply',?NETCONF_NAMESPACE_ATTR ++ [{'message-id',"1"}],
+ [{data,Data}]},
+ Xml = list_to_binary(xmerl:export_simple_element(Rpc,xmerl_xml)),
+ Netconf =
+ <<"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
+ Xml/binary,"\n",?END_TAG/binary>>,
+
+ %% Split the data in some chunks
+ PartLength = size(Netconf) div 3,
+ <<Part1:PartLength/binary,Part2:PartLength/binary,_Part3:PartLength/binary,
+ _Part4/binary>> = Netconf,
+
+ %% Spawn a process which will wait a bit for the client to send
+ %% the request (below), then order the server to the chunks of the
+ %% rpc-reply one by one.
+ spawn(fun() -> timer:sleep(500),?NS:hupp(send,Part1),
+ timer:sleep(100),?NS:hupp(send,Part2),
+ timer:sleep(100),?NS:hupp(kill)
+ end),
+
+ %% 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),
+ ok.
+
+connection_crash(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+
+ %% Test that if the test survives killing the connection
+ %% process. Earlier this caused ct_util_server to terminate, and
+ %% this aborting the complete test run.
+ spawn(fun() -> timer:sleep(500),exit(Client,kill) end),
+ ?NS:expect(get),
+ {error,{closed,killed}}=ct_netconfc:get(Client,{server,[{xmlns,"myns"}],[]}),
+ ok.
+
+get_event_streams(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ StreamNames = ["NETCONF","stream1","stream2"],
+ Streams = [{N,[{description,"descr of " ++ N}]} || N <- StreamNames],
+ StreamsXml = [{stream,[{name,[N]}|[{Tag,[Value]} || {Tag,Value} <- Data]]}
+ || {N,Data} <- Streams],
+ ReplyData = [{netconf,?NETMOD_NOTIF_NAMESPACE_ATTR,[{streams,StreamsXml}]}],
+ ?NS:expect_reply('get',{data,ReplyData}),
+ {ok,Streams} = ct_netconfc:get_event_streams(Client,StreamNames),
+
+ ?NS:expect_reply('get',{data,ReplyData}),
+ {ok,Streams} = ct_netconfc:get_event_streams(Client,StreamNames,5000),
+
+ ?NS:expect('get'),
+ {error,timeout} = ct_netconfc:get_event_streams(Client,100),
+
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+ ok.
+
+create_subscription(Config) ->
+ DataDir = ?config(data_dir,Config),
+
+ %% All defaults
+ {ok,Client1} = open_success(DataDir),
+ ?NS:expect_reply({'create-subscription',[stream]},ok),
+ ?ok = ct_netconfc:create_subscription(Client1),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client1),
+
+ %% All defaults with timeout
+ {ok,Client1a} = open_success(DataDir),
+ ?NS:expect_reply({'create-subscription',[stream]},ok),
+ ?ok = ct_netconfc:create_subscription(Client1a,5000),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client1a),
+
+ %% All defaults timing out
+ {ok,Client1b} = open_success(DataDir),
+ ?NS:expect({'create-subscription',[stream]}),
+ {error,timeout} = ct_netconfc:create_subscription(Client1b,100),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client1b),
+
+ %% Stream
+ {ok,Client2} = open_success(DataDir),
+ ?NS:expect_reply({'create-subscription',[stream]},ok),
+ Stream = "some_stream",
+ ?ok = ct_netconfc:create_subscription(Client2,Stream),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client2),
+
+ %% Filter
+ {ok,Client3} = open_success(DataDir),
+ ?NS:expect_reply({'create-subscription',[stream,filter]},ok),
+ Filter = {notification,?NETMOD_NOTIF_NAMESPACE_ATTR,
+ [eventTime]},
+ ?ok = ct_netconfc:create_subscription(Client3,Filter),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client3),
+
+ %% Filter with timeout
+ {ok,Client3a} = open_success(DataDir),
+ ?NS:expect_reply({'create-subscription',[stream,filter]},ok),
+ ?ok = ct_netconfc:create_subscription(Client3a,Filter,5000),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client3a),
+
+ %% Filter timing out
+ {ok,Client3b} = open_success(DataDir),
+ ?NS:expect({'create-subscription',[stream,filter]}),
+ {error,timeout}=ct_netconfc:create_subscription(Client3b,Filter,100),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client3b),
+
+ %% Stream and filter
+ {ok,Client4} = open_success(DataDir),
+ ?NS:expect_reply({'create-subscription',[stream,filter]},ok),
+ ?ok = ct_netconfc:create_subscription(Client4,Stream,Filter),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client4),
+
+ %% Start/stop time
+ {ok,Client5} = open_success(DataDir),
+ ?NS:expect_reply({'create-subscription',[stream,startTime,stopTime]},ok),
+ StartTime = xs_datetime({D,{H,M,S}}= calendar:local_time()),
+ StopTime = xs_datetime({D,{H+2,M,S}}),
+ ?ok = ct_netconfc:create_subscription(Client5,StartTime,StopTime),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client5),
+
+ %% Start/stop time with timeout
+ {ok,Client5a} = open_success(DataDir),
+ ?NS:expect_reply({'create-subscription',[stream,startTime,stopTime]},ok),
+ ?ok = ct_netconfc:create_subscription(Client5a,StartTime,StopTime,5000),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client5a),
+
+ %% Start/stop time timing out
+ {ok,Client5b} = open_success(DataDir),
+ ?NS:expect({'create-subscription',[stream,startTime,stopTime]}),
+ {error,timeout} =
+ ct_netconfc:create_subscription(Client5b,StartTime,StopTime,100),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client5b),
+
+ %% Stream and start/stop time
+ {ok,Client6} = open_success(DataDir),
+ ?NS:expect_reply({'create-subscription',[stream,startTime,stopTime]},ok),
+ ?ok = ct_netconfc:create_subscription(Client6,Stream,StartTime,StopTime),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client6),
+
+ %% Filter and start/stop time
+ {ok,Client7} = open_success(DataDir),
+ ?NS:expect_reply({'create-subscription',[stream,filter,startTime,stopTime]},
+ ok),
+ ?ok = ct_netconfc:create_subscription(Client7,Filter,
+ StartTime,StopTime),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client7),
+
+ %% Stream, filter and start/stop time
+ {ok,Client8} = open_success(DataDir),
+ ?NS:expect_reply({'create-subscription',[stream,filter,startTime,stopTime]},
+ ok),
+ ?ok = ct_netconfc:create_subscription(Client8,Stream,Filter,
+ StartTime,StopTime),
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client8),
+
+ ok.
+
+receive_event(Config) ->
+ DataDir = ?config(data_dir,Config),
+ {ok,Client} = open_success(DataDir),
+ ?NS:expect_reply({'create-subscription',[stream]},ok),
+ ?ok = ct_netconfc:create_subscription(Client),
+
+ ?NS:hupp(send_event),
+
+ receive
+ %% Matching ?NS:make_msg(event)
+ {notification,?NETCONF_NOTIF_NAMESPACE_ATTR,
+ [{eventTime,[],[_Time]},
+ {event,[{xmlns,"http://my.namespaces.com/event"}],
+ [{severity,_,_},
+ {description,_,_}]}]} ->
+ ok;
+ Other ->
+ ct:fail({got_unexpected_while_waiting_for_event, Other})
+ after 3000 ->
+ ct:fail(timeout_waiting_for_event)
+ end,
+
+ ?NS:expect_do_reply('close-session',close,ok),
+ ?ok = ct_netconfc:close_session(Client),
+
+ ok.
+
+%%%-----------------------------------------------------------------
+
+break(_Config) ->
+ test_server:break("break test case").
+
+br() ->
+ test_server:break("").
+
+%%%-----------------------------------------------------------------
+%% Open a netconf session which is not specified in a config file
+open_success(Dir) ->
+ open_success(Dir,[]).
+
+%% Open a netconf session which is not specified in a config file, and
+%% give som extra options in addition to the test defaults.
+open_success(Dir,ExtraOpts) when is_list(Dir), is_list(ExtraOpts) ->
+ ?NS:hello(1), % tell server to send hello with session id 1
+ ?NS:expect(hello), % tell server to expect a hello message from client
+ open(Dir,ExtraOpts);
+
+%% Open a named netconf session which is not specified in a config file
+open_success(KeyOrName,Dir) when is_atom(KeyOrName), is_list(Dir) ->
+ ?NS:hello(1),
+ ?NS:expect(hello),
+ ct_netconfc:open(KeyOrName,?DEFAULT_SSH_OPTS(Dir)).
+
+open(Dir) ->
+ open(Dir,[]).
+open(Dir,ExtraOpts) ->
+ Opts = lists:ukeymerge(1,lists:keysort(1,ExtraOpts),
+ lists:keysort(1,?DEFAULT_SSH_OPTS(Dir))),
+ ct_netconfc:open(Opts).
+
+%%%-----------------------------------------------------------------
+%%% Open a netconf session which is specified in a config file
+%%% KeyOrName is the config key (server_id()) or name given in a
+%%% require statement (target_name()).
+open_configured_success(KeyOrName,Dir) when is_atom(KeyOrName) ->
+ open_configured_success(KeyOrName,Dir,[]).
+open_configured_success(KeyOrName,Dir,ExtraOpts) when is_atom(KeyOrName) ->
+ ?NS:hello(1),
+ ?NS:expect(hello),
+ ct_netconfc:open(KeyOrName,[{user_dir,Dir}|ExtraOpts]).
+
+%%%-----------------------------------------------------------------
+%%% Convert erlang datetime to the simplest variant of XML dateTime
+xs_datetime({{Y,M,D},{H,Mi,S}}) ->
+ lists:flatten(
+ io_lib:format("~p-~s-~sT~s:~s:~s",[Y,pad(M),pad(D),pad(H),pad(Mi),pad(S)])).
+
+pad(I) when I<10 ->
+ "0"++integer_to_list(I);
+pad(I) ->
+ integer_to_list(I).
+
+
+%%%-----------------------------------------------------------------
+%%% BEGIN SSH key management
+%% copy private keys to given dir from ~/.ssh
+get_id_keys(Config) ->
+ DstDir = ?config(priv_dir, Config),
+ SrcDir = filename:join(os:getenv("HOME"), ".ssh"),
+ RsaOk = copyfile(SrcDir, DstDir, "id_rsa"),
+ DsaOk = copyfile(SrcDir, DstDir, "id_dsa"),
+ case {RsaOk, DsaOk} of
+ {{ok, _}, {ok, _}} -> {ok, both};
+ {{ok, _}, _} -> {ok, rsa};
+ {_, {ok, _}} -> {ok, dsa};
+ {Error, _} -> Error
+ end.
+
+%% Remove later on. Use make_dsa_files instead.
+remove_id_keys(Config) ->
+ Dir = ?config(priv_dir, Config),
+ file:delete(filename:join(Dir, "id_rsa")),
+ file:delete(filename:join(Dir, "id_dsa")).
+
+
+make_dsa_files(Config) ->
+ make_dsa_files(Config, rfc4716_public_key).
+make_dsa_files(Config, Type) ->
+ {DSA, EncodedKey} = gen_dsa(128, 20),
+ PKey = DSA#'DSAPrivateKey'.y,
+ P = DSA#'DSAPrivateKey'.p,
+ Q = DSA#'DSAPrivateKey'.q,
+ G = DSA#'DSAPrivateKey'.g,
+ Dss = #'Dss-Parms'{p=P, q=Q, g=G},
+ {ok, Hostname} = inet:gethostname(),
+ {ok, {A, B, C, D}} = inet:getaddr(Hostname, inet),
+ IP = lists:concat([A, ".", B, ".", C, ".", D]),
+ Attributes = [], % Could be [{comment,"user@" ++ Hostname}],
+ HostNames = [{hostnames,[IP, IP]}],
+ PublicKey = [{{PKey, Dss}, Attributes}],
+ KnownHosts = [{{PKey, Dss}, HostNames}],
+
+ KnownHostsEnc = public_key:ssh_encode(KnownHosts, known_hosts),
+ KnownHosts = public_key:ssh_decode(KnownHostsEnc, known_hosts),
+
+ PublicKeyEnc = public_key:ssh_encode(PublicKey, Type),
+
+ SystemTmpDir = ?config(data_dir, Config),
+ filelib:ensure_dir(SystemTmpDir),
+ file:make_dir(SystemTmpDir),
+
+ DSAFile = filename:join(SystemTmpDir, "ssh_host_dsa_key.pub"),
+ file:delete(DSAFile),
+
+ DSAPrivateFile = filename:join(SystemTmpDir, "ssh_host_dsa_key"),
+ file:delete(DSAPrivateFile),
+
+ KHFile = filename:join(SystemTmpDir, "known_hosts"),
+ file:delete(KHFile),
+
+ PemBin = public_key:pem_encode([EncodedKey]),
+
+ file:write_file(DSAFile, PublicKeyEnc),
+ file:write_file(KHFile, KnownHostsEnc),
+ file:write_file(DSAPrivateFile, PemBin),
+ ok.
+
+%%--------------------------------------------------------------------
+%% Creates a dsa key (OBS: for testing only)
+%% the sizes are in bytes
+%% gen_dsa(::integer()) -> {::atom(), ::binary(), ::opaque()}
+%%--------------------------------------------------------------------
+gen_dsa(LSize,NSize) when is_integer(LSize), is_integer(NSize) ->
+ Key = gen_dsa2(LSize, NSize),
+ {Key, encode_key(Key)}.
+
+encode_key(Key = #'RSAPrivateKey'{}) ->
+ {ok, Der} = 'OTP-PUB-KEY':encode('RSAPrivateKey', Key),
+ {'RSAPrivateKey', list_to_binary(Der), not_encrypted};
+encode_key(Key = #'DSAPrivateKey'{}) ->
+ {ok, Der} = 'OTP-PUB-KEY':encode('DSAPrivateKey', Key),
+ {'DSAPrivateKey', list_to_binary(Der), not_encrypted}.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% DSA key generation (OBS: for testing only)
+%% See http://en.wikipedia.org/wiki/Digital_Signature_Algorithm
+%% and the fips_186-3.pdf
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+gen_dsa2(LSize, NSize) ->
+ Q = prime(NSize), %% Choose N-bit prime Q
+ X0 = prime(LSize),
+ P0 = prime((LSize div 2) +1),
+
+ %% Choose L-bit prime modulus P such that p-1 is a multiple of q.
+ case dsa_search(X0 div (2*Q*P0), P0, Q, 1000) of
+ error ->
+ gen_dsa2(LSize, NSize);
+ P ->
+ G = crypto:mod_exp(2, (P-1) div Q, P), % Choose G a number whose multiplicative order modulo p is q.
+ %% such that This may be done by setting g = h^(p-1)/q mod p, commonly h=2 is used.
+
+ X = prime(20), %% Choose x by some random method, where 0 < x < q.
+ Y = crypto:mod_exp(G, X, P), %% Calculate y = g^x mod p.
+
+ #'DSAPrivateKey'{version=0, p=P, q=Q, g=G, y=Y, x=X}
+ end.
+
+%% See fips_186-3.pdf
+dsa_search(T, P0, Q, Iter) when Iter > 0 ->
+ P = 2*T*Q*P0 + 1,
+ case is_prime(crypto:mpint(P), 50) of
+ true -> P;
+ false -> dsa_search(T+1, P0, Q, Iter-1)
+ end;
+dsa_search(_,_,_,_) ->
+ error.
+
+
+%%%%%%% Crypto Math %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+prime(ByteSize) ->
+ Rand = odd_rand(ByteSize),
+ crypto:erlint(prime_odd(Rand, 0)).
+
+prime_odd(Rand, N) ->
+ case is_prime(Rand, 50) of
+ true ->
+ Rand;
+ false ->
+ NotPrime = crypto:erlint(Rand),
+ prime_odd(crypto:mpint(NotPrime+2), N+1)
+ end.
+
+%% see http://en.wikipedia.org/wiki/Fermat_primality_test
+is_prime(_, 0) -> true;
+is_prime(Candidate, Test) ->
+ CoPrime = odd_rand(<<0,0,0,4, 10000:32>>, Candidate),
+ case crypto:mod_exp(CoPrime, Candidate, Candidate) of
+ CoPrime -> is_prime(Candidate, Test-1);
+ _ -> false
+ end.
+
+odd_rand(Size) ->
+ Min = 1 bsl (Size*8-1),
+ Max = (1 bsl (Size*8))-1,
+ odd_rand(crypto:mpint(Min), crypto:mpint(Max)).
+
+odd_rand(Min,Max) ->
+ Rand = <<Sz:32, _/binary>> = crypto:rand_uniform(Min,Max),
+ BitSkip = (Sz+4)*8-1,
+ case Rand of
+ Odd = <<_:BitSkip, 1:1>> -> Odd;
+ Even = <<_:BitSkip, 0:1>> ->
+ crypto:mpint(crypto:erlint(Even)+1)
+ end.
+
+copyfile(SrcDir, DstDir, Fn) ->
+ file:copy(filename:join(SrcDir, Fn),
+ filename:join(DstDir, Fn)).
+
+%%% END SSH key management
+%%%-----------------------------------------------------------------
diff --git a/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl b/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl
new file mode 100644
index 0000000000..2427f37f52
--- /dev/null
+++ b/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl
@@ -0,0 +1,555 @@
+%%--------------------------------------------------------------------
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+%%----------------------------------------------------------------------
+%% A netconf server used for testing of netconfc
+-module(ns).
+
+%-compile(export_all).
+-include_lib("common_test/src/ct_netconfc.hrl").
+
+
+%%%-----------------------------------------------------------------
+%%% API
+-export([start/1,
+ stop/1,
+ hello/1,
+ hello/2,
+ expect/1,
+ expect/2,
+ expect_reply/2,
+ expect_reply/3,
+ expect_do/2,
+ expect_do/3,
+ expect_do_reply/3,
+ expect_do_reply/4,
+ hupp/1,
+ hupp/2]).
+
+%%%-----------------------------------------------------------------
+%%% ssh_channel callbacks
+-export([init/1,
+ terminate/2,
+ handle_ssh_msg/2,
+ handle_msg/2]).
+
+%%%-----------------------------------------------------------------
+%% Server specifications
+-define(SERVER_DATA_NAMESPACE, "ClientTest").
+-define(CAPABILITIES,?CAPABILITIES_VSN("1.0")).
+-define(CAPABILITIES_VSN(Vsn),
+ [
+ ?NETCONF_BASE_CAP ++ Vsn,
+ "urn:ietf:params:netconf:capability:writable-running:1.0",
+ "urn:ietf:params:netconf:capability:candidate:1.0",
+ "urn:ietf:params:netconf:capability:confirmed-commit:1.0",
+ "urn:ietf:params:netconf:capability:rollback-on-error:1.0",
+ "urn:ietf:params:netconf:capability:startup:1.0",
+ "urn:ietf:params:netconf:capability:url:1.0",
+ "urn:ietf:params:netconf:capability:xpath:1.0",
+ "urn:ietf:params:netconf:capability:notification:1.0",
+ "urn:ietf:params:netconf:capability:interleave:1.0",
+ ?ACTION_NAMESPACE,
+ ?SERVER_DATA_NAMESPACE
+ ]).
+-define(SSH_PORT, 2060).
+-define(ssh_config(Dir),[{port, ?SSH_PORT},
+ {interface, {127,0,0,1}},
+ {system_dir, Dir},
+ {user_dir, Dir},
+ {user_passwords, [{"xxx","xxx"}]},
+ {password, "global-xxx"}]).
+
+%% Some help for debugging
+%-define(dbg(F,A),io:format(F,A)).
+-define(dbg(F,A),ok).
+-define(dbg_event(Event,Expect),
+ ?dbg("Event: ~p~nExpected: ~p~n",[Event,Expect])).
+
+%% State
+-record(session, {cb,
+ connection,
+ buffer = <<>>,
+ session_id}).
+
+
+%%%-----------------------------------------------------------------
+%%% API
+
+%% Start the netconf server and use the given directory as system_dir
+%% and user_dir
+start(Dir) ->
+ spawn(fun() -> init_server(Dir) end).
+
+%% Stop the netconf server
+stop(Pid) ->
+ Pid ! {stop,self()},
+ receive stopped -> ok end.
+
+%% Set the session id for the hello message.
+%% If this is not called prior to starting the session, no hello
+%% message will be sent.
+%% 'Stuff' indicates some special handling to e.g. provoke error cases
+hello(SessionId) ->
+ hello(SessionId,undefined).
+hello(SessionId,Stuff) ->
+ insert(hello,{SessionId,Stuff}).
+
+%% Tell server to expect the given message without doing any further
+%% actions. To be called directly before sending a request.
+expect(Expect) ->
+ expect_do_reply(Expect,undefined,undefined).
+expect(SessionId,Expect) ->
+ expect_do_reply(SessionId,Expect,undefined,undefined).
+
+%% Tell server to expect the given message and reply with the give
+%% reply. To be called directly before sending a request.
+expect_reply(Expect,Reply) ->
+ expect_do_reply(Expect,undefined,Reply).
+expect_reply(SessionId,Expect,Reply) ->
+ expect_do_reply(SessionId,Expect,undefined,Reply).
+
+%% Tell server to expect the given message and perform an action. To
+%% be called directly before sending a request.
+expect_do(Expect,Do) ->
+ expect_do_reply(Expect,Do,undefined).
+expect_do(SessionId,Expect,Do) ->
+ expect_do_reply(SessionId,Expect,Do,undefined).
+
+%% Tell server to expect the given message, perform an action and
+%% reply with the given reply. To be called directly before sending a
+%% request.
+expect_do_reply(Expect,Do,Reply) ->
+ add_expect(1,{Expect,Do,Reply}).
+expect_do_reply(SessionId,Expect,Do,Reply) ->
+ add_expect(SessionId,{Expect,Do,Reply}).
+
+%% Hupp the server - i.e. tell it to do something -
+%% e.g. hupp(send_event) will cause send_event(State) to be called on
+%% the session channel process.
+hupp(send_event) ->
+ hupp(send,[make_msg(event)]);
+hupp(kill) ->
+ hupp(1,fun hupp_kill/1,[]).
+
+hupp(send,Data) ->
+ hupp(1,fun hupp_send/2,[Data]).
+
+hupp(SessionId,Fun,Args) when is_function(Fun) ->
+ [{_,Pid}] = lookup({channel_process,SessionId}),
+ Pid ! {hupp,Fun,Args}.
+
+%%%-----------------------------------------------------------------
+%%% Main loop of the netconf server
+init_server(Dir) ->
+ register(main_ns_proc,self()),
+ ets:new(ns_tab,[set,named_table,public]),
+ Config = ?ssh_config(Dir),
+ {_,Host} = lists:keyfind(interface, 1, Config),
+ {_,Port} = lists:keyfind(port, 1, Config),
+ Opts = lists:filter(fun({Key,_}) ->
+ lists:member(Key,[system_dir,
+ password,
+ user_passwords,
+ pwdfun])
+ end,
+ Config),
+ {ok, Daemon} =
+ ssh:daemon(Host, Port,
+ [{subsystems,[{"netconf",{?MODULE,[]}}]}
+ |Opts]),
+ loop(Daemon).
+
+loop(Daemon) ->
+ receive
+ {stop,From} ->
+ ssh:stop_daemon(Daemon),
+ From ! stopped;
+ {table_trans,Fun,Args,From} ->
+ %% Simple transaction mechanism for ets table
+ R = apply(Fun,Args),
+ From ! {table_trans_done,R},
+ loop(Daemon)
+ end.
+
+%%----------------------------------------------------------------------
+%% Behaviour callback functions (ssh_channel)
+%%----------------------------------------------------------------------
+init([]) ->
+ {ok, undefined}.
+
+terminate(_Reason, _State) ->
+ ok.
+
+handle_ssh_msg({ssh_cm,CM,{data, Ch, _Type = 0, Data}}, State) ->
+ %% io:format("~p~n",[{self(),Data,CM,Ch,State}]),
+ data_for_channel(CM, Ch, Data, State);
+handle_ssh_msg({ssh_cm,CM,{closed, Ch}}, State) ->
+ %% erlang:display({self(),closed,CM,Ch,State}),
+ stop_channel(CM, Ch, State);
+handle_ssh_msg({ssh_cm,CM,{eof, Ch}}, State) ->
+ %% erlang:display({self(),eof,CM,Ch,State}),
+ data_for_channel(CM,Ch, <<>>, State).
+
+
+handle_msg({'EXIT', _Pid, _Reason}, State) ->
+ {ok, State};
+handle_msg({ssh_channel_up,Ch,CM},undefined) ->
+ %% erlang:display({self(),up,CM,Ch}),
+ ConnRef = {CM,Ch},
+ SessionId = maybe_hello(ConnRef),
+ insert({channel_process,SessionId},self()), % used to hupp the server
+ {ok, #session{connection = ConnRef,
+ session_id = SessionId}};
+handle_msg({hupp,Fun,Args},State) ->
+ {ok,apply(Fun,Args ++ [State])}.
+
+data_for_channel(CM, Ch, Data, State) ->
+ try data(Data, State) of
+ {ok, NewState} ->
+ case erase(stop) of
+ true ->
+ stop_channel(CM, Ch, NewState);
+ _ ->
+ {ok, NewState}
+ end
+ catch
+ Class:Reason ->
+ Stacktrace = erlang:get_stacktrace(),
+ error_logger:error_report([{?MODULE, data_for_channel},
+ {request, Data},
+ {buffer, State#session.buffer},
+ {reason, {Class, Reason}},
+ {stacktrace, Stacktrace}]),
+ stop_channel(CM, Ch, State)
+ end.
+
+data(Data, State = #session{connection = ConnRef,
+ buffer = Buffer,
+ session_id = SessionId}) ->
+ AllData = <<Buffer/binary,Data/binary>>,
+ case find_endtag(AllData) of
+ {ok,Msgs,Rest} ->
+ [check_expected(SessionId,ConnRef,Msg) || Msg <- Msgs],
+ {ok,State#session{buffer=Rest}};
+ need_more ->
+ {ok,State#session{buffer=AllData}}
+ end.
+
+stop_channel(CM, Ch, State) ->
+ ssh:close(CM),
+ {stop, Ch, State}.
+
+
+%%%-----------------------------------------------------------------
+%%% Functions to trigg via hupp/1:
+
+%% Send data spontaneously - e.g. an event
+hupp_send(Data,State = #session{connection = ConnRef}) ->
+ send(ConnRef,Data),
+ State.
+hupp_kill(State = #session{connection = ConnRef}) ->
+ kill(ConnRef),
+ State.
+
+%%%-----------------------------------------------------------------
+%%% Internal functions
+
+
+%%% Send ssh data to the client
+send({CM,Ch},Data) ->
+ ssh_connection:send(CM, Ch, Data).
+
+%%% Kill ssh connection
+kill({CM,_Ch}) ->
+ ssh:close(CM).
+
+add_expect(SessionId,Add) ->
+ table_trans(fun do_add_expect/2,[SessionId,Add]).
+
+table_trans(Fun,Args) ->
+ S = self(),
+ case whereis(main_ns_proc) of
+ S ->
+ apply(Fun,Args);
+ Pid ->
+ Pid ! {table_trans,Fun,Args,self()},
+ receive
+ {table_trans_done,Result} ->
+ Result
+ after 5000 ->
+ exit(table_trans_timeout)
+ end
+ end.
+
+do_add_expect(SessionId,Add) ->
+ case lookup({expect,SessionId}) of
+ [] ->
+ insert({expect,SessionId},[Add]);
+ [{_,First}] ->
+ insert({expect,SessionId},First ++ [Add])
+ end,
+ ok.
+
+do_get_expect(SessionId) ->
+ case lookup({expect,SessionId}) of
+ [{_,[{Expect,Do,Reply}|Rest]}] ->
+ insert({expect,SessionId},Rest),
+ {Expect,Do,Reply};
+ _ ->
+ error
+ end.
+
+insert(Key,Value) ->
+ ets:insert(ns_tab,{Key,Value}).
+lookup(Key) ->
+ ets:lookup(ns_tab,Key).
+
+maybe_hello(ConnRef) ->
+ case lookup(hello) of
+ [{hello,{SessionId,Stuff}}] ->
+ %% erlang:display({SessionId,Stuff}),
+ ets:delete(ns_tab,hello),
+ insert({session,SessionId},ConnRef),
+ reply(ConnRef,{hello,SessionId,Stuff}),
+ SessionId;
+ [] ->
+ undefined
+ end.
+
+find_endtag(Data) ->
+ case binary:split(Data,[?END_TAG],[global]) of
+ [Data] ->
+ need_more;
+ Msgs ->
+ {ok,lists:sublist(Msgs,length(Msgs)-1),lists:last(Msgs)}
+ end.
+
+check_expected(SessionId,ConnRef,Msg) ->
+ %% io:format("~p~n",[{check_expected,SessionId,Msg}]),
+ case table_trans(fun do_get_expect/1,[SessionId]) of
+ {Expect,Do,Reply} ->
+ %% erlang:display({got,io_lib:format("~s",[Msg])}),
+ %% erlang:display({expected,Expect}),
+ match(Msg,Expect),
+ do(ConnRef, Do),
+ reply(ConnRef,Reply);
+ error ->
+ timer:sleep(1000),
+ exit({error,{got_unexpected,SessionId,Msg,ets:tab2list(ns_tab)}})
+ end.
+
+match(Msg,Expect) ->
+ ?dbg("Match: ~p~n",[Msg]),
+ {ok,ok,<<>>} = xmerl_sax_parser:stream(Msg,[{event_fun,fun event/3},
+ {event_state,Expect}]).
+
+event(Event,_Loc,Expect) ->
+ ?dbg_event(Event,Expect),
+ event(Event,Expect).
+
+event(startDocument,Expect) -> match(Expect);
+event({startElement,_,Name,_,Attrs},[{se,Name}|Match]) ->
+ msg_id(Name,Attrs),
+ Match;
+event({startElement,_,Name,_,Attrs},[ignore,{se,Name}|Match]) ->
+ msg_id(Name,Attrs),
+ Match;
+event({startElement,_,Name,_,Attrs},[{se,Name,As}|Match]) ->
+ msg_id(Name,Attrs),
+ match_attrs(Name,As,Attrs),
+ Match;
+event({startElement,_,Name,_,Attrs},[ignore,{se,Name,As}|Match]) ->
+ msg_id(Name,Attrs),
+ match_attrs(Name,As,Attrs),
+ Match;
+event({startPrefixMapping,_,Ns},[{ns,Ns}|Match]) -> Match;
+event({startPrefixMapping,_,Ns},[ignore,{ns,Ns}|Match]) -> Match;
+event({endPrefixMapping,_},Match) -> Match;
+event({endElement,_,Name,_},[{ee,Name}|Match]) -> Match;
+event({endElement,_,Name,_},[ignore,{ee,Name}|Match]) -> Match;
+event(endDocument,Match) when Match==[]; Match==[ignore] -> ok;
+event(_,[ignore|_]=Match) -> Match;
+event(Event,Match) -> throw({nomatch,{Event,Match}}).
+
+msg_id("rpc",Attrs) ->
+ case lists:keyfind("message-id",3,Attrs) of
+ {_,_,_,Str} -> put(msg_id,Str);
+ false -> erase(msg_id)
+ end;
+msg_id(_,_) ->
+ ok.
+
+match_attrs(Name,[{Key,Value}|As],Attrs) ->
+ case lists:keyfind(atom_to_list(Key),3,Attrs) of
+ {_,_,_,Value} -> match_attrs(Name,As,Attrs);
+ false -> throw({missing_attr,Key,Name,Attrs});
+ _ -> throw({faulty_attr_value,Key,Name,Attrs})
+ end;
+match_attrs(_,[],_) ->
+ ok.
+
+do(ConnRef, close) ->
+ ets:match_delete(ns_tab,{{session,'_'},ConnRef}),
+ put(stop,true);
+do(_ConnRef, {kill,SessionId}) ->
+ case lookup({session,SessionId}) of
+ [{_,Owner}] ->
+ ets:delete(ns_tab,{session,SessionId}),
+ kill(Owner);
+ _ ->
+ exit({no_session_to_kill,SessionId})
+ end;
+do(_, undefined) ->
+ ok.
+
+reply(_,undefined) ->
+ ?dbg("no reply~n",[]),
+ ok;
+reply(ConnRef,Reply) ->
+ ?dbg("Reply: ~p~n",[Reply]),
+ send(ConnRef, make_msg(Reply)).
+
+from_simple(Simple) ->
+ list_to_binary(xmerl:export_simple_element(Simple,xmerl_xml)).
+
+xml(Content) ->
+ <<"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
+ Content/binary,"\n",?END_TAG/binary>>.
+
+rpc_reply(Content) when is_binary(Content) ->
+ MsgId = case erase(msg_id) of
+ undefined -> <<>>;
+ Id -> list_to_binary([" message-id=\"",Id,"\""])
+ end,
+ <<"<rpc-reply xmlns=\"",?NETCONF_NAMESPACE,"\"",MsgId/binary,">\n",
+ Content/binary,"\n</rpc-reply>">>;
+rpc_reply(Content) ->
+ rpc_reply(list_to_binary(Content)).
+
+session_id(no_session_id) ->
+ <<>>;
+session_id(SessionId0) ->
+ SessionId = list_to_binary(integer_to_list(SessionId0)),
+ <<"<session-id>",SessionId/binary,"</session-id>\n">>.
+
+capabilities(undefined) ->
+ CapsXml = list_to_binary([["<capability>",C,"</capability>\n"]
+ || C <- ?CAPABILITIES]),
+ <<"<capabilities>\n",CapsXml/binary,"</capabilities>\n">>;
+capabilities({base,Vsn}) ->
+ CapsXml = list_to_binary([["<capability>",C,"</capability>\n"]
+ || C <- ?CAPABILITIES_VSN(Vsn)]),
+ <<"<capabilities>\n",CapsXml/binary,"</capabilities>\n">>;
+capabilities(no_base) ->
+ [_|Caps] = ?CAPABILITIES,
+ CapsXml = list_to_binary([["<capability>",C,"</capability>\n"] || C <- Caps]),
+ <<"<capabilities>\n",CapsXml/binary,"</capabilities>\n">>;
+capabilities(no_caps) ->
+ <<>>.
+
+%%%-----------------------------------------------------------------
+%%% Match received netconf message from the client. Add a new clause
+%%% for each new message to recognize. The clause argument shall match
+%%% the Expect argument in expect/1, expect_reply/2 or
+%%% expect_do_reply/3.
+%%%
+%%% match(term()) -> [Match].
+%%% Match = ignore | {se,Name} | {se,Name,Attrs} | {ee,Name} | {ns,Namespace}
+%%% Name = string()
+%%% Attrs = [{atom(),string()}]
+%%% Namespace = string()
+%%%
+%%% 'se' means start element, 'ee' means end element - i.e. to match
+%%% an XML element you need one 'se' entry and one 'ee' entry with the
+%%% same name in the match list.
+match(hello) ->
+ [ignore,{se,"hello"},ignore,{ee,"hello"},ignore];
+match('close-session') ->
+ [ignore,{se,"rpc"},{se,"close-session"},
+ {ee,"close-session"},{ee,"rpc"},ignore];
+match('edit-config') ->
+ [ignore,{se,"rpc"},{se,"edit-config"},{se,"target"},ignore,{ee,"target"},
+ {se,"config"},ignore,{ee,"config"},{ee,"edit-config"},{ee,"rpc"},ignore];
+match('get') ->
+ match({get,subtree});
+match({'get',FilterType}) ->
+ [ignore,{se,"rpc"},{se,"get"},{se,"filter",[{type,atom_to_list(FilterType)}]},
+ ignore,{ee,"filter"},{ee,"get"},{ee,"rpc"},ignore];
+match('get-config') ->
+ match({'get-config',subtree});
+match({'get-config',FilterType}) ->
+ [ignore,{se,"rpc"},{se,"get-config"},{se,"source"},ignore,{ee,"source"},
+ {se,"filter",[{type,atom_to_list(FilterType)}]},ignore,{ee,"filter"},
+ {ee,"get-config"},{ee,"rpc"},ignore];
+match('copy-config') ->
+ [ignore,{se,"rpc"},{se,"copy-config"},{se,"target"},ignore,{ee,"target"},
+ {se,"source"},ignore,{ee,"source"},{ee,"copy-config"},{ee,"rpc"},ignore];
+match('delete-config') ->
+ [ignore,{se,"rpc"},{se,"delete-config"},{se,"target"},ignore,{ee,"target"},
+ {ee,"delete-config"},{ee,"rpc"},ignore];
+match('lock') ->
+ [ignore,{se,"rpc"},{se,"lock"},{se,"target"},ignore,{ee,"target"},
+ {ee,"lock"},{ee,"rpc"},ignore];
+match('unlock') ->
+ [ignore,{se,"rpc"},{se,"unlock"},{se,"target"},ignore,{ee,"target"},
+ {ee,"unlock"},{ee,"rpc"},ignore];
+match('kill-session') ->
+ [ignore,{se,"rpc"},{se,"kill-session"},{se,"session-id"},ignore,
+ {ee,"session-id"},{ee,"kill-session"},{ee,"rpc"},ignore];
+match(action) ->
+ [ignore,{se,"rpc"},{ns,?ACTION_NAMESPACE},{se,"action"},{se,"data"},ignore,
+ {ee,"data"},{ee,"action"},{ee,"rpc"},ignore];
+match({'create-subscription',Content}) ->
+ [ignore,{se,"rpc"},{ns,?NETCONF_NOTIF_NAMESPACE},
+ {se,"create-subscription"}] ++
+ lists:flatmap(fun(X) ->
+ [{se,atom_to_list(X)},ignore,{ee,atom_to_list(X)}]
+ end, Content) ++
+ [{ee,"create-subscription"},{ee,"rpc"},ignore];
+match(any) ->
+ [ignore].
+
+
+
+%%%-----------------------------------------------------------------
+%%% Make message to send to the client.
+%%% Add a new clause for each new message that shall be sent. The
+%%% clause shall match the Reply argument in expect_reply/2 or
+%%% expect_do_reply/3.
+make_msg({hello,SessionId,Stuff}) ->
+ SessionIdXml = session_id(SessionId),
+ CapsXml = capabilities(Stuff),
+ xml(<<"<hello xmlns=\"",?NETCONF_NAMESPACE,"\">\n",CapsXml/binary,
+ SessionIdXml/binary,"</hello>">>);
+make_msg(ok) ->
+ xml(rpc_reply("<ok/>"));
+make_msg({data,Data}) ->
+ xml(rpc_reply(from_simple({data,Data})));
+make_msg(event) ->
+ xml(<<"<notification xmlns=\"",?NETCONF_NOTIF_NAMESPACE,"\">"
+ "<eventTime>2012-06-14T14:50:54+02:00</eventTime>"
+ "<event xmlns=\"http://my.namespaces.com/event\">"
+ "<severity>major</severity>"
+ "<description>Something terrible happened</description>"
+ "</event>"
+ "</notification>">>);
+make_msg(Xml) when is_binary(Xml) ->
+ xml(Xml);
+make_msg(Simple) when is_tuple(Simple) ->
+ xml(from_simple(Simple)).
diff --git a/lib/common_test/test/ct_priv_dir_SUITE.erl b/lib/common_test/test/ct_priv_dir_SUITE.erl
new file mode 100644
index 0000000000..426b2d9a55
--- /dev/null
+++ b/lib/common_test/test/ct_priv_dir_SUITE.erl
@@ -0,0 +1,277 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%%-------------------------------------------------------------------
+%%% File: ct_priv_dir_SUITE
+%%%
+%%% Description:
+%%% Test that it works to use the create_priv_dir option.
+%%%
+%%%-------------------------------------------------------------------
+-module(ct_priv_dir_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+-define(eh, ct_test_support_eh).
+
+%%--------------------------------------------------------------------
+%% TEST SERVER CALLBACK FUNCTIONS
+%%--------------------------------------------------------------------
+
+%%--------------------------------------------------------------------
+%% Description: Since Common Test starts another Test Server
+%% instance, the tests need to be performed on a separate node (or
+%% there will be clashes with logging processes etc).
+%%--------------------------------------------------------------------
+init_per_suite(Config) ->
+ Config1 = ct_test_support:init_per_suite(Config),
+ Config1.
+
+end_per_suite(Config) ->
+ ct_test_support:end_per_suite(Config).
+
+init_per_testcase(TestCase, Config) ->
+ ct_test_support:init_per_testcase(TestCase, Config).
+
+end_per_testcase(TestCase, Config) ->
+ ct_test_support:end_per_testcase(TestCase, Config).
+
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [
+ default,
+ auto_per_run,
+ auto_per_tc,
+ manual_per_tc,
+ spec_default,
+ spec_auto_per_run,
+ spec_auto_per_run,
+ spec_manual_per_tc
+ ].
+
+%%--------------------------------------------------------------------
+%% TEST CASES
+%%--------------------------------------------------------------------
+
+%%%-----------------------------------------------------------------
+%%%
+default(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Suite = filename:join(DataDir, "priv_dir_SUITE"),
+ {Opts,ERPid} = setup([{suite,Suite},{testcase,default},
+ {label,default}], Config),
+ ok = execute(default, Opts, ERPid, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+auto_per_run(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Suite = filename:join(DataDir, "priv_dir_SUITE"),
+ {Opts,ERPid} = setup([{suite,Suite},{testcase,default},
+ {label,auto_per_run},
+ {create_priv_dir,auto_per_run}], Config),
+ ok = execute(auto_per_run, Opts, ERPid, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+auto_per_tc(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Suite = filename:join(DataDir, "priv_dir_SUITE"),
+ {Opts,ERPid} = setup([{suite,Suite},{testcase,auto_per_tc},
+ {label,auto_per_tc},
+ {create_priv_dir,auto_per_tc}], Config),
+ ok = execute(auto_per_tc, Opts, ERPid, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+manual_per_tc(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Suite = filename:join(DataDir, "priv_dir_SUITE"),
+ {Opts,ERPid} = setup([{suite,Suite},{testcase,manual_per_tc},
+ {label,manual_per_tc},
+ {create_priv_dir,manual_per_tc}], Config),
+ ok = execute(manual_per_tc, Opts, ERPid, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+spec_default(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Spec = filename:join(DataDir, "default.spec"),
+ {Opts,ERPid} = setup([{spec,Spec},
+ {label,spec_default}], Config),
+ ok = execute(spec_default, Opts, ERPid, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+spec_auto_per_run(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Spec = filename:join(DataDir, "auto_per_run.spec"),
+ {Opts,ERPid} = setup([{spec,Spec},
+ {label,spec_auto_per_run}], Config),
+ ok = execute(spec_auto_per_run, Opts, ERPid, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+spec_auto_per_tc(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Spec = filename:join(DataDir, "auto_per_tc.spec"),
+ {Opts,ERPid} = setup([{spec,Spec},
+ {label,spec_auto_per_tc}], Config),
+ ok = execute(spec_auto_per_tc, Opts, ERPid, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+spec_manual_per_tc(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Spec = filename:join(DataDir, "manual_per_tc.spec"),
+ {Opts,ERPid} = setup([{spec,Spec},
+ {label,spec_manual_per_tc}], Config),
+ ok = execute(spec_manual_per_tc, Opts, ERPid, Config).
+
+
+%%%-----------------------------------------------------------------
+%%% HELP FUNCTIONS
+%%%-----------------------------------------------------------------
+
+setup(Test, Config) ->
+ Opts0 = ct_test_support:get_opts(Config),
+ Level = ?config(trace_level, Config),
+ EvHArgs = [{cbm,ct_test_support},{trace_level,Level}],
+ Opts = Opts0 ++ [{event_handler,{?eh,EvHArgs}}|Test],
+ ERPid = ct_test_support:start_event_receiver(Config),
+ {Opts,ERPid}.
+
+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),
+ Opts),
+
+ TestEvents = events_to_check(Name),
+ ct_test_support:verify_events(TestEvents, Events, Config).
+
+reformat(Events, EH) ->
+ ct_test_support:reformat(Events, EH).
+
+%%%-----------------------------------------------------------------
+%%% TEST EVENTS
+%%%-----------------------------------------------------------------
+events_to_check(Test) ->
+ %% 2 tests (ct:run_test + script_start) is default
+ events_to_check(Test, 2).
+
+events_to_check(_, 0) ->
+ [];
+events_to_check(Test, N) ->
+ test_events(Test) ++ events_to_check(Test, N-1).
+
+
+test_events(DEF) when DEF == default ; DEF == auto_per_run ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,start_info,{1,1,1}},
+ {?eh,tc_start,{priv_dir_SUITE,init_per_suite}},
+ {?eh,tc_done,{priv_dir_SUITE,init_per_suite,ok}},
+ {?eh,tc_start,{priv_dir_SUITE,default}},
+ {?eh,tc_done,{priv_dir_SUITE,default,ok}},
+ {?eh,test_stats,{1,0,{0,0}}},
+ {?eh,tc_start,{priv_dir_SUITE,end_per_suite}},
+ {?eh,tc_done,{priv_dir_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}];
+
+test_events(auto_per_tc) ->
+ [{?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,start_info,{1,1,1}},
+ {?eh,tc_start,{priv_dir_SUITE,init_per_suite}},
+ {?eh,tc_done,{priv_dir_SUITE,init_per_suite,ok}},
+ {?eh,tc_start,{priv_dir_SUITE,auto_per_tc}},
+ {?eh,tc_done,{priv_dir_SUITE,auto_per_tc,ok}},
+ {?eh,test_stats,{1,0,{0,0}}},
+ {?eh,tc_start,{priv_dir_SUITE,end_per_suite}},
+ {?eh,tc_done,{priv_dir_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}];
+
+test_events(manual_per_tc) ->
+ [{?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,start_info,{1,1,1}},
+ {?eh,tc_start,{priv_dir_SUITE,init_per_suite}},
+ {?eh,tc_done,{priv_dir_SUITE,init_per_suite,ok}},
+ {?eh,tc_start,{priv_dir_SUITE,manual_per_tc}},
+ {?eh,tc_done,{priv_dir_SUITE,manual_per_tc,ok}},
+ {?eh,test_stats,{1,0,{0,0}}},
+ {?eh,tc_start,{priv_dir_SUITE,end_per_suite}},
+ {?eh,tc_done,{priv_dir_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}];
+
+test_events(SPECDEF) when SPECDEF == spec_default ;
+ SPECDEF == spec_auto_per_run ->
+ [{?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,start_info,{1,1,1}},
+ {?eh,tc_start,{priv_dir_SUITE,init_per_suite}},
+ {?eh,tc_done,{priv_dir_SUITE,init_per_suite,ok}},
+ {?eh,tc_start,{priv_dir_SUITE,default}},
+ {?eh,tc_done,{priv_dir_SUITE,default,ok}},
+ {?eh,test_stats,{1,0,{0,0}}},
+ {?eh,tc_start,{priv_dir_SUITE,end_per_suite}},
+ {?eh,tc_done,{priv_dir_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}];
+
+test_events(spec_auto_per_tc) ->
+ [{?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,start_info,{1,1,1}},
+ {?eh,tc_start,{priv_dir_SUITE,init_per_suite}},
+ {?eh,tc_done,{priv_dir_SUITE,init_per_suite,ok}},
+ {?eh,tc_start,{priv_dir_SUITE,auto_per_tc}},
+ {?eh,tc_done,{priv_dir_SUITE,auto_per_tc,ok}},
+ {?eh,test_stats,{1,0,{0,0}}},
+ {?eh,tc_start,{priv_dir_SUITE,end_per_suite}},
+ {?eh,tc_done,{priv_dir_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}];
+
+test_events(spec_manual_per_tc) ->
+ [{?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,start_info,{1,1,1}},
+ {?eh,tc_start,{priv_dir_SUITE,init_per_suite}},
+ {?eh,tc_done,{priv_dir_SUITE,init_per_suite,ok}},
+ {?eh,tc_start,{priv_dir_SUITE,manual_per_tc}},
+ {?eh,tc_done,{priv_dir_SUITE,manual_per_tc,ok}},
+ {?eh,test_stats,{1,0,{0,0}}},
+ {?eh,tc_start,{priv_dir_SUITE,end_per_suite}},
+ {?eh,tc_done,{priv_dir_SUITE,end_per_suite,ok}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}].
+
diff --git a/lib/common_test/test/ct_priv_dir_SUITE_data/auto_per_run.spec b/lib/common_test/test/ct_priv_dir_SUITE_data/auto_per_run.spec
new file mode 100644
index 0000000000..4dde0ed1f4
--- /dev/null
+++ b/lib/common_test/test/ct_priv_dir_SUITE_data/auto_per_run.spec
@@ -0,0 +1,5 @@
+{create_priv_dir, auto_per_run}.
+
+{alias, curr, "./"}.
+
+{cases, curr, priv_dir_SUITE, default}. \ No newline at end of file
diff --git a/lib/common_test/test/ct_priv_dir_SUITE_data/auto_per_tc.spec b/lib/common_test/test/ct_priv_dir_SUITE_data/auto_per_tc.spec
new file mode 100644
index 0000000000..c265500865
--- /dev/null
+++ b/lib/common_test/test/ct_priv_dir_SUITE_data/auto_per_tc.spec
@@ -0,0 +1,5 @@
+{create_priv_dir, auto_per_tc}.
+
+{alias, curr, "./"}.
+
+{cases, curr, priv_dir_SUITE, auto_per_tc}. \ No newline at end of file
diff --git a/lib/common_test/test/ct_priv_dir_SUITE_data/default.spec b/lib/common_test/test/ct_priv_dir_SUITE_data/default.spec
new file mode 100644
index 0000000000..2f053e792f
--- /dev/null
+++ b/lib/common_test/test/ct_priv_dir_SUITE_data/default.spec
@@ -0,0 +1,3 @@
+{alias, curr, "./"}.
+
+{cases, curr, priv_dir_SUITE, default}. \ No newline at end of file
diff --git a/lib/common_test/test/ct_priv_dir_SUITE_data/manual_per_tc.spec b/lib/common_test/test/ct_priv_dir_SUITE_data/manual_per_tc.spec
new file mode 100644
index 0000000000..4f98734d5f
--- /dev/null
+++ b/lib/common_test/test/ct_priv_dir_SUITE_data/manual_per_tc.spec
@@ -0,0 +1,5 @@
+{create_priv_dir, manual_per_tc}.
+
+{alias, curr, "./"}.
+
+{cases, curr, priv_dir_SUITE, manual_per_tc}. \ No newline at end of file
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
new file mode 100644
index 0000000000..7704a29768
--- /dev/null
+++ b/lib/common_test/test/ct_priv_dir_SUITE_data/priv_dir_SUITE.erl
@@ -0,0 +1,137 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(priv_dir_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+
+%%--------------------------------------------------------------------
+%% @spec suite() -> Info
+%% Info = [tuple()]
+%% @end
+%%--------------------------------------------------------------------
+suite() ->
+ [{timetrap,{seconds,30}}].
+
+%%--------------------------------------------------------------------
+%% @spec init_per_suite(Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+init_per_suite(Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% @spec end_per_suite(Config0) -> void() | {save_config,Config1}
+%% Config0 = Config1 = [tuple()]
+%% @end
+%%--------------------------------------------------------------------
+end_per_suite(_Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% @spec init_per_group(GroupName, Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% GroupName = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+init_per_group(_GroupName, Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% @spec end_per_group(GroupName, Config0) ->
+%% void() | {save_config,Config1}
+%% GroupName = atom()
+%% Config0 = Config1 = [tuple()]
+%% @end
+%%--------------------------------------------------------------------
+end_per_group(_GroupName, _Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% @spec init_per_testcase(TestCase, Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% TestCase = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+init_per_testcase(_TestCase, Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% @spec end_per_testcase(TestCase, Config0) ->
+%% void() | {save_config,Config1} | {fail,Reason}
+%% TestCase = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+end_per_testcase(_TestCase, _Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% @spec groups() -> [Group]
+%% Group = {GroupName,Properties,GroupsAndTestCases}
+%% GroupName = atom()
+%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
+%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]
+%% TestCase = atom()
+%% Shuffle = shuffle | {shuffle,{integer(),integer(),integer()}}
+%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
+%% repeat_until_any_ok | repeat_until_any_fail
+%% N = integer() | forever
+%% @end
+%%--------------------------------------------------------------------
+groups() ->
+ [].
+
+%%--------------------------------------------------------------------
+%% @spec all() -> GroupsAndTestCases | {skip,Reason}
+%% GroupsAndTestCases = [{group,GroupName} | TestCase]
+%% GroupName = atom()
+%% TestCase = atom()
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+all() ->
+ [].
+
+default(Config) ->
+ PrivDir = proplists:get_value(priv_dir, Config),
+ "log_private" = filename:basename(PrivDir),
+ {ok,_} = file:list_dir(PrivDir).
+
+auto_per_tc(Config) ->
+ PrivDir = proplists:get_value(priv_dir, Config),
+ ["log_private",_] = string:tokens(filename:basename(PrivDir), "."),
+ {ok,_} = file:list_dir(PrivDir).
+
+manual_per_tc(Config) ->
+ PrivDir = proplists:get_value(priv_dir, Config),
+ ["log_private",_] = string:tokens(filename:basename(PrivDir), "."),
+ {error,_} = file:list_dir(PrivDir),
+ ok = ct:make_priv_dir(),
+ {ok,_} = file:list_dir(PrivDir).
+
diff --git a/lib/common_test/test/ct_shell_SUITE.erl b/lib/common_test/test/ct_shell_SUITE.erl
new file mode 100644
index 0000000000..4b8c43d800
--- /dev/null
+++ b/lib/common_test/test/ct_shell_SUITE.erl
@@ -0,0 +1,133 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%%-------------------------------------------------------------------
+%%% File: ct_shell_SUITE
+%%%
+%%% Description:
+%%% Test that the interactive mode starts properly
+%%%
+%%% The suites used for the test are located in the data directory.
+%%%-------------------------------------------------------------------
+-module(ct_shell_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+-define(eh, ct_test_support_eh).
+
+%%--------------------------------------------------------------------
+%% TEST SERVER CALLBACK FUNCTIONS
+%%--------------------------------------------------------------------
+
+init_per_suite(Config) ->
+ Config1 = ct_test_support:init_per_suite(Config),
+ Config1.
+
+end_per_suite(Config) ->
+ ct_test_support:end_per_suite(Config).
+
+init_per_testcase(TestCase, Config) ->
+ ct_test_support:init_per_testcase(TestCase, Config).
+
+end_per_testcase(TestCase, Config) ->
+ ct_test_support:end_per_testcase(TestCase, Config).
+
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [start_interactive].
+
+%%--------------------------------------------------------------------
+%% TEST CASES
+%%--------------------------------------------------------------------
+
+%%%-----------------------------------------------------------------
+%%%
+start_interactive(Config) ->
+ DataDir = ?config(data_dir, Config),
+ CfgFile = filename:join(DataDir, "cfgdata"),
+
+ {Opts,ERPid} = setup([{interactive_mode,true},{config,CfgFile}],
+ Config),
+ CTNode = proplists:get_value(ct_node, Config),
+ Level = proplists:get_value(trace_level, Config),
+ test_server:format(Level, "Saving start opts on ~p: ~p~n",
+ [CTNode, Opts]),
+ rpc:call(CTNode, application, set_env,
+ [common_test, run_test_start_opts, Opts]),
+ test_server:format(Level, "Calling ct_run:script_start() on ~p~n",
+ [CTNode]),
+
+ interactive_mode = rpc:call(CTNode, ct_run, script_start, []),
+
+ ok = rpc:call(CTNode, ct, require, [key1]),
+ value1 = rpc:call(CTNode, ct, get_config, [key1]),
+ ok = rpc:call(CTNode, ct, require, [x,key2]),
+ value2 = rpc:call(CTNode, ct, get_config, [x]),
+
+ ok = rpc:call(CTNode, ct, stop_interactive, []),
+
+ case rpc:call(CTNode, erlang, whereis, [ct_util_server]) of
+ undefined ->
+ ok;
+ _ ->
+ test_server:format(Level,
+ "ct_util_server not stopped on ~p yet, waiting 5 s...~n",
+ [CTNode]),
+ timer:sleep(5000),
+ undefined = rpc:call(CTNode, erlang, whereis, [ct_util_server])
+ end,
+ Events = ct_test_support:get_events(ERPid, Config),
+
+ ct_test_support:log_events(start_interactive,
+ reformat(Events, ?eh),
+ ?config(priv_dir, Config),
+ Opts),
+ TestEvents = test_events(start_interactive),
+ ok = ct_test_support:verify_events(TestEvents, Events, Config).
+
+%%%-----------------------------------------------------------------
+%%% HELP FUNCTIONS
+%%%-----------------------------------------------------------------
+
+setup(Test, Config) ->
+ Opts0 = ct_test_support:get_opts(Config),
+ Level = ?config(trace_level, Config),
+ EvHArgs = [{cbm,ct_test_support},{trace_level,Level}],
+ Opts = Opts0 ++ [{event_handler,{?eh,EvHArgs}}|Test],
+ ERPid = ct_test_support:start_event_receiver(Config),
+ {Opts,ERPid}.
+
+reformat(Events, EH) ->
+ ct_test_support:reformat(Events, EH).
+
+%%%-----------------------------------------------------------------
+%%% TEST EVENTS
+%%%-----------------------------------------------------------------
+
+test_events(start_interactive) ->
+ [
+ {?eh,start_logging,{'DEF','RUNDIR'}},
+ {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}},
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ].
diff --git a/lib/common_test/test/ct_shell_SUITE_data/cfgdata b/lib/common_test/test/ct_shell_SUITE_data/cfgdata
new file mode 100644
index 0000000000..23a40ad21a
--- /dev/null
+++ b/lib/common_test/test/ct_shell_SUITE_data/cfgdata
@@ -0,0 +1,2 @@
+{key1,value1}.
+{key2,value2}.
diff --git a/lib/common_test/test/ct_snmp_SUITE.erl b/lib/common_test/test/ct_snmp_SUITE.erl
new file mode 100644
index 0000000000..f8b4543770
--- /dev/null
+++ b/lib/common_test/test/ct_snmp_SUITE.erl
@@ -0,0 +1,141 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%%-------------------------------------------------------------------
+%%% File: ct_snmp_SUITE
+%%%
+%%% Description:
+%%% Test ct_snmp module
+%%%
+%%%-------------------------------------------------------------------
+-module(ct_snmp_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+-define(eh, ct_test_support_eh).
+
+%%--------------------------------------------------------------------
+%% TEST SERVER CALLBACK FUNCTIONS
+%%--------------------------------------------------------------------
+
+%%--------------------------------------------------------------------
+%% Description: Since Common Test starts another Test Server
+%% instance, the tests need to be performed on a separate node (or
+%% there will be clashes with logging processes etc).
+%%--------------------------------------------------------------------
+init_per_suite(Config) ->
+ Config1 = ct_test_support:init_per_suite(Config),
+ Config1.
+
+end_per_suite(Config) ->
+ ct_test_support:end_per_suite(Config).
+
+init_per_testcase(TestCase, Config) ->
+ ct_test_support:init_per_testcase(TestCase, Config).
+
+end_per_testcase(TestCase, Config) ->
+ ct_test_support:end_per_testcase(TestCase, Config).
+
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [
+ default
+ ].
+
+%%--------------------------------------------------------------------
+%% TEST CASES
+%%--------------------------------------------------------------------
+
+%%%-----------------------------------------------------------------
+%%%
+default(Config) when is_list(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Suite = filename:join(DataDir, "snmp_SUITE"),
+ CfgFile = filename:join(DataDir, "snmp.cfg"),
+ {Opts,ERPid} = setup([{suite,Suite},{config,CfgFile},
+ {label,default}], Config),
+
+ ok = execute(default, Opts, ERPid, Config).
+
+
+%%%-----------------------------------------------------------------
+%%% HELP FUNCTIONS
+%%%-----------------------------------------------------------------
+
+setup(Test, Config) ->
+ Opts0 = ct_test_support:get_opts(Config),
+ Level = ?config(trace_level, Config),
+ EvHArgs = [{cbm,ct_test_support},{trace_level,Level}],
+ Opts = Opts0 ++ [{event_handler,{?eh,EvHArgs}}|Test],
+ ERPid = ct_test_support:start_event_receiver(Config),
+ {Opts,ERPid}.
+
+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),
+ Opts),
+
+ TestEvents = events_to_check(Name,Config),
+ ct_test_support:verify_events(TestEvents, Events, Config).
+
+reformat(Events, EH) ->
+ ct_test_support:reformat(Events, EH).
+
+%%%-----------------------------------------------------------------
+%%% TEST EVENTS
+%%%-----------------------------------------------------------------
+events_to_check(_TestName,Config) ->
+ {module,_} = code:load_abs(filename:join(?config(data_dir,Config),
+ snmp_SUITE)),
+ TCs = get_tcs(),
+ code:purge(snmp_SUITE),
+ code:delete(snmp_SUITE),
+
+ OneTest =
+ [{?eh,start_logging,{'DEF','RUNDIR'}}] ++
+ [{?eh,tc_done,{snmp_SUITE,TC,ok}} || TC <- TCs] ++
+ [{?eh,stop_logging,[]}],
+
+ %% 2 tests (ct:run_test + script_start) is default
+ OneTest ++ OneTest.
+
+
+get_tcs() ->
+ All = snmp_SUITE:all(),
+ Groups =
+ try snmp_SUITE:groups()
+ catch error:undef -> []
+ end,
+ flatten_tcs(All,Groups).
+
+flatten_tcs([H|T],Groups) when is_atom(H) ->
+ [H|flatten_tcs(T,Groups)];
+flatten_tcs([{group,Group}|T],Groups) ->
+ TCs = proplists:get_value(Group,Groups),
+ flatten_tcs(TCs ++ T,Groups);
+flatten_tcs([],_) ->
+ [].
diff --git a/lib/common_test/test/ct_snmp_SUITE_data/snmp.cfg b/lib/common_test/test/ct_snmp_SUITE_data/snmp.cfg
new file mode 100644
index 0000000000..895e097de6
--- /dev/null
+++ b/lib/common_test/test/ct_snmp_SUITE_data/snmp.cfg
@@ -0,0 +1,44 @@
+%% -*- erlang -*-
+{snmp1, [{start_agent,true},
+ {users,[{user_name,[snmpm_user_default,[]]}]},
+ {managed_agents,[{agent_name, [user_name, {127,0,0,1}, 4000,
+ [{engine_id,"ct_snmp-test-engine"},
+ {version,v2}]]}]},
+ {engine_id,"ct_snmp-test-engine"},
+ {agent_vsns,[v2]}
+ ]}.
+{snmp2, [{start_agent,true},
+ {engine_id,"ct_snmp-test-engine"}
+ ]}.
+{snmp3, [{start_agent,true},
+ {engine_id,"ct_snmp-test-engine"},
+ {agent_vsns,[v1,v2,v3]},
+ {agent_contexts,{data_dir_file,"context.conf"}},
+ {agent_usm,{data_dir_file,"usm.conf"}},
+ {agent_community,{data_dir_file,"community.conf"}},
+ {agent_notify_def,{data_dir_file,"notify.conf"}},
+ {agent_sysinfo,{data_dir_file,"standard.conf"}},
+ {agent_target_address_def,{data_dir_file,"target_addr.conf"}},
+ {agent_target_param_def,{data_dir_file,"target_params.conf"}},
+ {agent_vacm,{data_dir_file,"vacm.conf"}}]}.
+{snmp_app1,[{manager, [{config, [{verbosity, silence}]},
+ {server,[{verbosity,silence}]},
+ {net_if,[{verbosity,silence}]},
+ {versions,[v2]}
+ ]},
+ {agent, [{config, [{verbosity, silence}]},
+ {net_if,[{verbosity,silence}]},
+ {mib_server,[{verbosity,silence}]},
+ {local_db,[{verbosity,silence}]},
+ {agent_verbosity,silence}
+ ]}]}.
+{snmp_app2,[{manager, [{config, [{verbosity, silence}]},
+ {server,[{verbosity,silence}]},
+ {net_if,[{verbosity,silence}]}
+ ]},
+ {agent, [{config, [{verbosity, silence}]},
+ {net_if,[{verbosity,silence}]},
+ {mib_server,[{verbosity,silence}]},
+ {local_db,[{verbosity,silence}]},
+ {agent_verbosity,silence}
+ ]}]}.
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
new file mode 100644
index 0000000000..16b2b5690c
--- /dev/null
+++ b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE.erl
@@ -0,0 +1,395 @@
+%%--------------------------------------------------------------------
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+%%----------------------------------------------------------------------
+%% File: ct_snmp_SUITE.erl
+%%
+%% Description:
+%% This file contains the test cases for the ct_snmp API.
+%%
+%% @author Support
+%% @doc Test of SNMP support in common_test
+%% @end
+%%----------------------------------------------------------------------
+%%----------------------------------------------------------------------
+-module(snmp_SUITE).
+-include_lib("common_test/include/ct.hrl").
+-include_lib("snmp/include/STANDARD-MIB.hrl").
+-include_lib("snmp/include/SNMP-USER-BASED-SM-MIB.hrl").
+-include_lib("snmp/include/snmp_types.hrl").
+
+-compile(export_all).
+
+%% Default timetrap timeout (set in init_per_testcase).
+-define(default_timeout, ?t:minutes(1)).
+
+-define(AGENT_UDP, 4000).
+
+suite() ->
+ [
+ {require, snmp1, snmp1},
+ {require, snmp_app1, snmp_app1},
+ {require, snmp2, snmp2},
+ {require, snmp_app2, snmp_app2},
+ {require, snmp3, snmp3}
+ ].
+
+all() ->
+ [start_stop,
+ {group,get_set},
+ {group,register},
+ {group,override},
+ set_info].
+
+
+groups() ->
+ [{get_set,[get_values,
+ get_next_values,
+ set_values,
+ load_mibs]},
+ {register,[register_users,
+ register_users_fail,
+ register_agents,
+ register_agents_fail,
+ register_usm_users,
+ register_usm_users_fail]},
+ {override,[override_usm,
+ override_standard,
+ override_context,
+ override_community,
+ override_notify,
+ override_target_addr,
+ override_target_params,
+ override_vacm]}].
+
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(Config) ->
+ Config.
+
+init_per_group(get_set, Config) ->
+ ok = ct_snmp:start(Config,snmp1,snmp_app1),
+ Config;
+init_per_group(register, Config) ->
+ ok = ct_snmp:start(Config,snmp2,snmp_app2),
+ Config;
+init_per_group(_, Config) ->
+ ok = ct_snmp:start(Config,snmp3,snmp_app2),
+ Config.
+
+end_per_group(_Group, Config) ->
+ catch ct_snmp:stop(Config),
+ Config.
+
+init_per_testcase(_Case, Config) ->
+ Dog = test_server:timetrap(?default_timeout),
+ [{watchdog, Dog}|Config].
+
+end_per_testcase(Case, Config) ->
+ try apply(?MODULE,Case,[cleanup,Config])
+ catch error:undef -> ok
+ end,
+ Dog=?config(watchdog, Config),
+ test_server:timetrap_cancel(Dog),
+ ok.
+
+%%%-----------------------------------------------------------------
+%%% Test cases
+break(_Config) ->
+ test_server:break(""),
+ ok.
+
+start_stop(Config) ->
+ ok = ct_snmp:start(Config,snmp1,snmp_app1),
+ timer:sleep(1000),
+ {snmp,_,_} = lists:keyfind(snmp,1,application:which_applications()),
+ [_|_] = filelib:wildcard("*/*.conf",?config(priv_dir,Config)),
+
+ ok = ct_snmp:stop(Config),
+ timer:sleep(1000),
+ false = lists:keyfind(snmp,1,application:which_applications()),
+ [] = filelib:wildcard("*/*.conf",?config(priv_dir,Config)),
+ ok.
+
+get_values(_Config) ->
+ Oids1 = [?sysDescr_instance, ?sysName_instance],
+ {noError,_,V1} = ct_snmp:get_values(agent_name,Oids1,snmp1),
+ [#varbind{oid=?sysDescr_instance,value="Erlang SNMP agent"},
+ #varbind{oid=?sysName_instance,value="ct_test"}] = V1,
+ ok.
+
+get_next_values(_Config) ->
+ Oids2 = [?system],
+ {noError,_,V2} = ct_snmp:get_next_values(agent_name,Oids2,snmp1),
+ [#varbind{oid=?sysDescr_instance,value="Erlang SNMP agent"}] = V2,
+ ok.
+
+set_values(Config) ->
+ Oid3 = ?sysName_instance,
+ NewName = "ct_test changed by " ++ atom_to_list(?MODULE),
+ VarsAndVals = [{Oid3,s,NewName}],
+ {noError,_,_} =
+ ct_snmp:set_values(agent_name,VarsAndVals,snmp1,Config),
+
+ Oids4 = [?sysName_instance],
+ {noError,_,V4} = ct_snmp:get_values(agent_name,Oids4,snmp1),
+ [#varbind{oid=?sysName_instance,value=NewName}] = V4,
+
+ ok.
+
+load_mibs(_Config) ->
+ [{'SNMPv2-MIB',_}=SnmpV2Mib] = snmpa:which_mibs(),
+ Mib = filename:join([code:priv_dir(snmp),"mibs","SNMP-USER-BASED-SM-MIB"]),
+ ok = ct_snmp:load_mibs([Mib]),
+ TwoMibs = [_,_] = snmpa:which_mibs(),
+ [{'SNMP-USER-BASED-SM-MIB',_}] = lists:delete(SnmpV2Mib,TwoMibs),
+ ok = ct_snmp:unload_mibs([Mib]),
+ [{'SNMPv2-MIB',_}] = snmpa:which_mibs(),
+ ok.
+
+
+register_users(_Config) ->
+ [] = snmpm:which_users(),
+ ok = ct_snmp:register_users(snmp2,[{reg_user1,[snmpm_user_default,[]]}]),
+ [_] = snmpm:which_users(),
+ [_] = ct:get_config({snmp2,users}),
+ ok = ct_snmp:register_users(snmp2,[{reg_user2,[snmpm_user_default,[]]}]),
+ [_,_] = snmpm:which_users(),
+ [_,_] = ct:get_config({snmp2,users}),
+ ok = ct_snmp:register_users(snmp2,[{reg_user3,[snmpm_user_default,[]]}]),
+ [_,_,_] = snmpm:which_users(),
+ [_,_,_] = ct:get_config({snmp2,users}),
+ ok = ct_snmp:unregister_users(snmp2,[reg_user3]),
+ [_,_] = snmpm:which_users(),
+ [_,_] = ct:get_config({snmp2,users}),
+ ok = ct_snmp:unregister_users(snmp2),
+ [] = snmpm:which_users(),
+ [] = ct:get_config({snmp2,users}),
+ ok.
+register_users(cleanup,_Config) ->
+ ct_snmp:unregister_users(snmp2).
+
+register_users_fail(_Config) ->
+ [] = snmpm:which_users(),
+ {error,_} = ct_snmp:register_users(snmp2,[{reg_user3,[unknown_module,[]]}]),
+ [] = snmpm:which_users(),
+ ok.
+register_users_fail(cleanup,_Config) ->
+ ct_snmp:unregister_users(snmp2).
+
+register_agents(_Config) ->
+ {ok, HostName} = inet:gethostname(),
+ {ok, Addr} = inet:getaddr(HostName, inet),
+
+ [] = snmpm:which_agents(),
+ ok = ct_snmp:register_users(snmp2,[{reg_user1,[snmpm_user_default,[]]}]),
+ ok = ct_snmp:register_agents(snmp2,[{reg_agent1,
+ [reg_user1,Addr,?AGENT_UDP,[]]}]),
+ [_] = snmpm:which_agents(),
+ [_] = ct:get_config({snmp2,managed_agents}),
+ ok = ct_snmp:register_agents(snmp2,[{reg_agent2,
+ [reg_user1,Addr,?AGENT_UDP,[]]}]),
+ [_,_] = snmpm:which_agents(),
+ [_,_] = ct:get_config({snmp2,managed_agents}),
+
+ ok = ct_snmp:register_agents(snmp2,[{reg_agent3,
+ [reg_user1,Addr,?AGENT_UDP,[]]}]),
+ [_,_,_] = snmpm:which_agents(),
+ [_,_,_] = ct:get_config({snmp2,managed_agents}),
+
+ ok = ct_snmp:unregister_agents(snmp2,[reg_agent3]),
+ [_,_] = snmpm:which_agents(),
+ [_,_] = ct:get_config({snmp2,managed_agents}),
+
+ ok = ct_snmp:unregister_agents(snmp2),
+ ok = ct_snmp:unregister_users(snmp2),
+ [] = snmpm:which_agents(),
+ [] = ct:get_config({snmp2,managed_agents}),
+ ok.
+register_agents(cleanup,_Config) ->
+ ct_snmp:unregister_agents(snmp2),
+ ct_snmp:unregister_users(snmp2).
+
+register_agents_fail(_Config) ->
+ {ok, HostName} = inet:gethostname(),
+ {ok, Addr} = inet:getaddr(HostName, inet),
+
+ [] = snmpm:which_agents(),
+ {error,_}
+ = ct_snmp:register_agents(snmp2,[{reg_agent3,
+ [unknown_user,Addr,?AGENT_UDP,[]]}]),
+ [] = snmpm:which_agents(),
+ ok.
+register_agents_fail(cleanup,_Config) ->
+ ct_snmp:unregister_agents(snmp2).
+
+register_usm_users(_Config) ->
+ [] = snmpm:which_usm_users(),
+ ok = ct_snmp:register_usm_users(snmp2,[{"reg_usm_user1",[]}]),
+ [_] = snmpm:which_usm_users(),
+ [_] = ct:get_config({snmp2,usm_users}),
+ ok = ct_snmp:register_usm_users(snmp2,[{"reg_usm_user2",[]}]),
+ [_,_] = snmpm:which_usm_users(),
+ [_,_] = ct:get_config({snmp2,usm_users}),
+ ok = ct_snmp:register_usm_users(snmp2,[{"reg_usm_user3",[]}]),
+ [_,_,_] = snmpm:which_usm_users(),
+ [_,_,_] = ct:get_config({snmp2,usm_users}),
+ ok = ct_snmp:unregister_usm_users(snmp2,["reg_usm_user3"]),
+ [_,_] = snmpm:which_usm_users(),
+ [_,_] = ct:get_config({snmp2,usm_users}),
+ ok = ct_snmp:unregister_usm_users(snmp2),
+ [] = snmpm:which_usm_users(),
+ [] = ct:get_config({snmp2,usm_users}),
+ ok.
+register_usm_users(cleanup,_Config) ->
+ ct_snmp:unregister_usm_users(snmp2).
+
+register_usm_users_fail(_Config) ->
+ [] = snmpm:which_usm_users(),
+ {error,_}
+ = ct_snmp:register_usm_users(snmp2,[{"reg_usm_user3",
+ [{sec_name,invalid_data_type}]}]),
+ [] = snmpm:which_usm_users(),
+ ok.
+register_usm_users_fail(cleanup,_Config) ->
+ ct_snmp:unregister_usm_users(snmp2).
+
+%% Test that functionality for overriding default configuration file
+%% works - i.e. that the files are written and that the configuration
+%% is actually used.
+%%
+%% Note that the config files used in this test case do not
+%% necessarily make up a reasonable configuration for the snmp
+%% application...
+override_usm(Config) ->
+ DataDir = ?config(data_dir,Config),
+ PrivDir = ?config(priv_dir,Config),
+ ConfDir = filename:join(PrivDir,"conf"),
+
+ Mib = filename:join([code:priv_dir(snmp),"mibs","SNMP-USER-BASED-SM-MIB"]),
+ ok = ct_snmp:load_mibs([Mib]),
+
+ %% Check that usm.conf is overwritten
+ {ok,MyUsm} = snmpa_conf:read_usm_config(DataDir),
+ {ok,UsedUsm} = snmpa_conf:read_usm_config(ConfDir),
+ true = (MyUsm == UsedUsm),
+
+ %% Check that the usm user is actually configured...
+ [{Index,"secname"}] =
+ snmp_user_based_sm_mib:usmUserTable(get_next,?usmUserEntry,[3]),
+ true = lists:suffix("usm_user_name",Index),
+ ok.
+
+override_standard(Config) ->
+ DataDir = ?config(data_dir,Config),
+ PrivDir = ?config(priv_dir,Config),
+ ConfDir = filename:join(PrivDir,"conf"),
+
+ %% Check that standard.conf is overwritten
+ {ok,MyStandard} = snmpa_conf:read_standard_config(DataDir),
+ {ok,UsedStandard} = snmpa_conf:read_standard_config(ConfDir),
+ true = (MyStandard == UsedStandard),
+
+ %% Check that the values from standard.conf is actually configured...
+ {value,"name for override test"} = snmp_standard_mib:sysName(get),
+ {value,"agent for ct_snmp override test"} = snmp_standard_mib:sysDescr(get),
+ ok.
+
+override_context(Config) ->
+ DataDir = ?config(data_dir,Config),
+ PrivDir = ?config(priv_dir,Config),
+ ConfDir = filename:join(PrivDir,"conf"),
+
+ %% Check that context.conf is overwritten
+ {ok,MyContext} = snmpa_conf:read_context_config(DataDir),
+ {ok,UsedContext} = snmpa_conf:read_context_config(ConfDir),
+ true = (MyContext == UsedContext),
+ ok.
+
+override_community(Config) ->
+ DataDir = ?config(data_dir,Config),
+ PrivDir = ?config(priv_dir,Config),
+ ConfDir = filename:join(PrivDir,"conf"),
+
+ %% Check that community.conf is overwritten
+ {ok,MyCommunity} = snmpa_conf:read_community_config(DataDir),
+ {ok,UsedCommunity} = snmpa_conf:read_community_config(ConfDir),
+ true = (MyCommunity == UsedCommunity),
+ ok.
+
+override_notify(Config) ->
+ DataDir = ?config(data_dir,Config),
+ PrivDir = ?config(priv_dir,Config),
+ ConfDir = filename:join(PrivDir,"conf"),
+
+ %% Check that notify.conf is overwritten
+ {ok,MyNotify} = snmpa_conf:read_notify_config(DataDir),
+ {ok,UsedNotify} = snmpa_conf:read_notify_config(ConfDir),
+ true = (MyNotify == UsedNotify),
+ ok.
+
+override_target_addr(Config) ->
+ DataDir = ?config(data_dir,Config),
+ PrivDir = ?config(priv_dir,Config),
+ ConfDir = filename:join(PrivDir,"conf"),
+
+ %% Check that target_addr.conf is overwritten
+ {ok,MyTargetAddr} = snmpa_conf:read_target_addr_config(DataDir),
+ {ok,UsedTargetAddr} = snmpa_conf:read_target_addr_config(ConfDir),
+ true = (MyTargetAddr == UsedTargetAddr),
+ ok.
+
+override_target_params(Config) ->
+ DataDir = ?config(data_dir,Config),
+ PrivDir = ?config(priv_dir,Config),
+ ConfDir = filename:join(PrivDir,"conf"),
+
+ %% Check that target_params.conf is overwritten
+ {ok,MyTargetParams} = snmpa_conf:read_target_params_config(DataDir),
+ {ok,UsedTargetParams} = snmpa_conf:read_target_params_config(ConfDir),
+ true = (MyTargetParams == UsedTargetParams),
+ ok.
+
+override_vacm(Config) ->
+ DataDir = ?config(data_dir,Config),
+ PrivDir = ?config(priv_dir,Config),
+ ConfDir = filename:join(PrivDir,"conf"),
+
+ %% Check that vacm.conf is overwritten
+ {ok,MyVacm} = snmpa_conf:read_vacm_config(DataDir),
+ {ok,UsedVacm} = snmpa_conf:read_vacm_config(ConfDir),
+ true = (MyVacm == UsedVacm),
+ ok.
+
+
+
+
+%% NOTE!! This test must always be executed last in the suite, and
+%% should match all set requests performed in the suite. I.e. if you
+%% add a set request, you must add an entry in the return value of
+%% ct_snmp:set_info/1 below.
+set_info(Config) ->
+ %% From test case set_values/1:
+ Oid1 = ?sysName_instance,
+ NewValue1 = "ct_test changed by " ++ atom_to_list(?MODULE),
+
+ %% The test...
+ [{_AgentName,_,[{Oid1,_,NewValue1}]}]
+ = ct_snmp:set_info(Config),
+ ok.
diff --git a/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/community.conf b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/community.conf
new file mode 100644
index 0000000000..5a64df6605
--- /dev/null
+++ b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/community.conf
@@ -0,0 +1 @@
+{"public", "public", "initial", "", ""}.
diff --git a/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/context.conf b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/context.conf
new file mode 100644
index 0000000000..feed5e1d11
--- /dev/null
+++ b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/context.conf
@@ -0,0 +1 @@
+"testcontext".
diff --git a/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/notify.conf b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/notify.conf
new file mode 100644
index 0000000000..367ba3aa4b
--- /dev/null
+++ b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/notify.conf
@@ -0,0 +1 @@
+{"standard inform", "std_inform", inform}.
diff --git a/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/standard.conf b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/standard.conf
new file mode 100644
index 0000000000..79908fb355
--- /dev/null
+++ b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/standard.conf
@@ -0,0 +1,7 @@
+{sysDescr, "agent for ct_snmp override test"}.
+{sysObjectID, [1,2,3]}.
+{sysContact, "[email protected]"}.
+{sysLocation, "erlang"}.
+{sysServices, 72}.
+{snmpEnableAuthenTraps, enabled}.
+{sysName, "name for override test"}.
diff --git a/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/target_addr.conf b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/target_addr.conf
new file mode 100644
index 0000000000..d02672a074
--- /dev/null
+++ b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/target_addr.conf
@@ -0,0 +1,2 @@
+{"target1", snmpUDPDomain, [147,214,122,73], 5000, 1500, 3, "std_trap", "target_v3", "", [], 2048}.
+{"target2", snmpUDPDomain, [147,214,122,73], 5000, 1500, 3, "std_inform", "target_v3", "", [], 2048}.
diff --git a/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/target_params.conf b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/target_params.conf
new file mode 100644
index 0000000000..5a9a619422
--- /dev/null
+++ b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/target_params.conf
@@ -0,0 +1 @@
+{"target_v3", v3, usm, "initial", noAuthNoPriv}.
diff --git a/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/usm.conf b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/usm.conf
new file mode 100644
index 0000000000..d6e245914e
--- /dev/null
+++ b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/usm.conf
@@ -0,0 +1 @@
+{"ct_snmp-test-engine","usm_user_name","secname",zeroDotZero,usmNoAuthProtocol,"","",usmNoPrivProtocol,"","","","",""}.
diff --git a/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/vacm.conf b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/vacm.conf
new file mode 100644
index 0000000000..158fe02e3b
--- /dev/null
+++ b/lib/common_test/test/ct_snmp_SUITE_data/snmp_SUITE_data/vacm.conf
@@ -0,0 +1,6 @@
+{vacmSecurityToGroup, usm, "initial", "initial"}.
+{vacmAccess, "initial", "", any, noAuthNoPriv, exact, "restricted", "", "restricted"}.
+{vacmAccess, "initial", "", usm, authNoPriv, exact, "internet", "internet", "internet"}.
+{vacmAccess, "initial", "", usm, authPriv, exact, "internet", "internet", "internet"}.
+{vacmViewTreeFamily, "restricted", [1,3,6,1], included, null}.
+{vacmViewTreeFamily, "internet", [1,3,6,1], included, null}.
diff --git a/lib/common_test/test/ct_system_error_SUITE.erl b/lib/common_test/test/ct_system_error_SUITE.erl
new file mode 100644
index 0000000000..f00f470c33
--- /dev/null
+++ b/lib/common_test/test/ct_system_error_SUITE.erl
@@ -0,0 +1,132 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%%-------------------------------------------------------------------
+%%% File: ct_system_error_SUITE
+%%%
+%%% Description:
+%%%
+%%% Test that severe system errors (such as failure to write logs) are
+%%% noticed and handled.
+%%%-------------------------------------------------------------------
+-module(ct_system_error_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+-define(eh, ct_test_support_eh).
+
+%%--------------------------------------------------------------------
+%% TEST SERVER CALLBACK FUNCTIONS
+%%--------------------------------------------------------------------
+
+%%--------------------------------------------------------------------
+%% Description: Since Common Test starts another Test Server
+%% instance, the tests need to be performed on a separate node (or
+%% there will be clashes with logging processes etc).
+%%--------------------------------------------------------------------
+init_per_suite(Config) ->
+ Config1 = ct_test_support:init_per_suite(Config),
+ Config1.
+
+end_per_suite(Config) ->
+ ct_test_support:end_per_suite(Config).
+
+init_per_testcase(TestCase, Config) ->
+ ct_test_support:init_per_testcase(TestCase, Config).
+
+end_per_testcase(TestCase, Config) ->
+ ct_test_support:end_per_testcase(TestCase, Config).
+
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [
+ test_server_failing_logs
+ ].
+
+%%--------------------------------------------------------------------
+%% TEST CASES
+%%--------------------------------------------------------------------
+
+%%%-----------------------------------------------------------------
+%%%
+test_server_failing_logs(Config) ->
+ TC = test_server_failing_logs,
+ DataDir = ?config(data_dir, Config),
+ Suite = filename:join(DataDir, "a_SUITE"),
+ {Opts,ERPid} = setup([{suite,Suite},{label,TC}], Config),
+ crash_test_server(Config),
+ {error,{cannot_create_log_dir,__}} = ct_test_support:run(Opts, Config),
+ Events = ct_test_support:get_events(ERPid, Config),
+ ct_test_support:log_events(TC,
+ reformat(Events, ?eh),
+ ?config(priv_dir, Config),
+ Opts),
+
+ TestEvents = events_to_check(TC),
+ ok = ct_test_support:verify_events(TestEvents, Events, Config).
+
+crash_test_server(Config) ->
+ DataDir = ?config(data_dir, Config),
+ Root = ?config(priv_dir, Config),
+ [$@|Host] = lists:dropwhile(fun(C) ->
+ C =/= $@
+ end, atom_to_list(node())),
+ Format = filename:join(Root,
+ "ct_run.ct@" ++ Host ++
+ ".~4..0w-~2..0w-~2..0w_"
+ "~2..0w.~2..0w.~2..0w"),
+ [C2,C1|_] = lists:reverse(filename:split(DataDir)),
+ LogDir = C1 ++ "." ++ C2 ++ ".a_SUITE.logs",
+ T = calendar:datetime_to_gregorian_seconds(calendar:local_time()),
+ [begin
+ {{Y,Mon,D},{H,Min,S}} =
+ calendar:gregorian_seconds_to_datetime(T+Offset),
+ Dir0 = io_lib:format(Format, [Y,Mon,D,H,Min,S]),
+ Dir = lists:flatten(Dir0),
+ file:make_dir(Dir),
+ File = filename:join(Dir, LogDir),
+ file:write_file(File, "anything goes\n")
+ end || Offset <- lists:seq(0, 20)],
+ ok.
+
+%%%-----------------------------------------------------------------
+%%% HELP FUNCTIONS
+%%%-----------------------------------------------------------------
+
+setup(Test, Config) ->
+ Opts0 = ct_test_support:get_opts(Config),
+ Level = ?config(trace_level, Config),
+ EvHArgs = [{cbm,ct_test_support},{trace_level,Level}],
+ Opts = Opts0 ++ [{event_handler,{?eh,EvHArgs}}|Test],
+ ERPid = ct_test_support:start_event_receiver(Config),
+ {Opts,ERPid}.
+
+reformat(Events, EH) ->
+ ct_test_support:reformat(Events, EH).
+
+%%%-----------------------------------------------------------------
+%%% TEST EVENTS
+%%%-----------------------------------------------------------------
+
+events_to_check(_Test) ->
+ [{?eh,severe_error,{cannot_create_log_dir,{'_','_'}}}].
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
new file mode 100644
index 0000000000..c6e3ddfd5d
--- /dev/null
+++ b/lib/common_test/test/ct_system_error_SUITE_data/a_SUITE.erl
@@ -0,0 +1,122 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(a_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+
+%%--------------------------------------------------------------------
+%% @spec suite() -> Info
+%% Info = [tuple()]
+%% @end
+%%--------------------------------------------------------------------
+suite() ->
+ [{timetrap,{seconds,10}}].
+
+%%--------------------------------------------------------------------
+%% @spec init_per_suite(Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+init_per_suite(Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% @spec end_per_suite(Config0) -> void() | {save_config,Config1}
+%% Config0 = Config1 = [tuple()]
+%% @end
+%%--------------------------------------------------------------------
+end_per_suite(_Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% @spec init_per_group(GroupName, Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% GroupName = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+init_per_group(_GroupName, Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% @spec end_per_group(GroupName, Config0) ->
+%% void() | {save_config,Config1}
+%% GroupName = atom()
+%% Config0 = Config1 = [tuple()]
+%% @end
+%%--------------------------------------------------------------------
+end_per_group(_GroupName, _Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% @spec init_per_testcase(TestCase, Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% TestCase = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+init_per_testcase(_TestCase, Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% @spec end_per_testcase(TestCase, Config0) ->
+%% void() | {save_config,Config1} | {fail,Reason}
+%% TestCase = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+end_per_testcase(_TestCase, _Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% @spec groups() -> [Group]
+%% Group = {GroupName,Properties,GroupsAndTestCases}
+%% GroupName = atom()
+%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
+%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]
+%% TestCase = atom()
+%% Shuffle = shuffle | {shuffle,{integer(),integer(),integer()}}
+%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
+%% repeat_until_any_ok | repeat_until_any_fail
+%% N = integer() | forever
+%% @end
+%%--------------------------------------------------------------------
+groups() ->
+ [].
+
+%%--------------------------------------------------------------------
+%% @spec all() -> GroupsAndTestCases | {skip,Reason}
+%% GroupsAndTestCases = [{group,GroupName} | TestCase]
+%% GroupName = atom()
+%% TestCase = atom()
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+all() ->
+ [tc1].
+
+tc1(_C) ->
+ ok.
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 efc0309781..8e4852369d 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -242,25 +242,28 @@ test_events(ts_if_1) ->
{?eh,tc_auto_skip,{ts_if_5_SUITE,end_per_suite,
{require_failed_in_suite0,{not_available,undef_variable}}}},
- {?eh,tc_start,{ts_if_6_SUITE,tc1}},
- {?eh,tc_done,{ts_if_6_SUITE,tc1,{failed,{error,{suite0_failed,{exited,suite0_byebye}}}}}},
- {?eh,test_stats,{3,5,{6,8}}},
+ {?eh,tc_start,{ct_framework,init_per_suite}},
+ {?eh,tc_done,{ct_framework,init_per_suite,
+ {failed,{error,{suite0_failed,{exited,suite0_byebye}}}}}},
+ {?eh,tc_auto_skip,{ts_if_6_SUITE,tc1,
+ {failed,{error,{suite0_failed,{exited,suite0_byebye}}}}}},
+ {?eh,test_stats,{3,5,{5,9}}},
{?eh,tc_start,{ts_if_7_SUITE,tc1}},
{?eh,tc_done,{ts_if_7_SUITE,tc1,ok}},
- {?eh,test_stats,{4,5,{6,8}}},
+ {?eh,test_stats,{4,5,{5,9}}},
{?eh,tc_start,{ts_if_8_SUITE,tc1}},
{?eh,tc_done,{ts_if_8_SUITE,tc1,{failed,{error,failed_on_purpose}}}},
- {?eh,test_stats,{4,6,{6,8}}},
+ {?eh,test_stats,{4,6,{5,9}}},
{?eh,tc_user_skip,{skipped_by_spec_1_SUITE,all,"should be skipped"}},
- {?eh,test_stats,{4,6,{7,8}}},
+ {?eh,test_stats,{4,6,{6,9}}},
{?eh,tc_start,{skipped_by_spec_2_SUITE,init_per_suite}},
{?eh,tc_done,{skipped_by_spec_2_SUITE,init_per_suite,ok}},
{?eh,tc_user_skip,{skipped_by_spec_2_SUITE,tc1,"should be skipped"}},
- {?eh,test_stats,{4,6,{8,8}}},
+ {?eh,test_stats,{4,6,{7,9}}},
{?eh,tc_start,{skipped_by_spec_2_SUITE,end_per_suite}},
{?eh,tc_done,{skipped_by_spec_2_SUITE,end_per_suite,ok}},
diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl
index 6df02d12b7..80cca4a1cc 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,12 +29,14 @@
-export([init_per_suite/1, init_per_suite/2, end_per_suite/1,
init_per_testcase/2, end_per_testcase/2,
write_testspec/2, write_testspec/3,
- run/2, run/4, get_opts/1, wait_for_ct_stop/1]).
+ run/2, run/3, run/4, get_opts/1, wait_for_ct_stop/1]).
-export([handle_event/2, start_event_receiver/1, get_events/2,
verify_events/3, reformat/2, log_events/4,
join_abs_dirs/2]).
+-export([ct_test_halt/1]).
+
-include_lib("kernel/include/file.hrl").
%%%-----------------------------------------------------------------
@@ -223,14 +225,15 @@ get_opts(Config) ->
%%%-----------------------------------------------------------------
%%%
-run(Opts, Config) ->
+run(Opts, Config) when is_list(Opts) ->
CTNode = proplists:get_value(ct_node, Config),
Level = proplists:get_value(trace_level, Config),
%% use ct interface
test_server:format(Level, "~n[RUN #1] Calling ct:run_test(~p) on ~p~n",
[Opts, CTNode]),
- Result1 = rpc:call(CTNode, ct, run_test, [Opts]),
-
+ CtRunTestResult = rpc:call(CTNode, ct, run_test, [Opts]),
+ test_server:format(Level, "~n[RUN #1] Got return value ~p~n",
+ [CtRunTestResult]),
case rpc:call(CTNode, erlang, whereis, [ct_util_server]) of
undefined ->
ok;
@@ -242,26 +245,59 @@ run(Opts, Config) ->
undefined = rpc:call(CTNode, erlang, whereis, [ct_util_server])
end,
%% use run_test interface (simulated)
- test_server:format(Level, "Saving start opts on ~p: ~p~n", [CTNode,Opts]),
- rpc:call(CTNode, application, set_env, [common_test, run_test_start_opts, Opts]),
- test_server:format(Level, "[RUN #2] Calling ct_run:script_start() on ~p~n", [CTNode]),
- Result2 = rpc:call(CTNode, ct_run, script_start, []),
- case {Result1,Result2} of
- {ok,ok} ->
+ Opts1 = [{halt_with,{?MODULE,ct_test_halt}} | Opts],
+ test_server:format(Level, "Saving start opts on ~p: ~p~n",
+ [CTNode, Opts1]),
+ rpc:call(CTNode, application, set_env,
+ [common_test, run_test_start_opts, Opts1]),
+ test_server:format(Level, "[RUN #2] Calling ct_run:script_start() on ~p~n",
+ [CTNode]),
+ ExitStatus = rpc:call(CTNode, ct_run, script_start, []),
+ test_server:format(Level, "[RUN #2] Got exit status value ~p~n",
+ [ExitStatus]),
+ case {CtRunTestResult,ExitStatus} of
+ {{_Ok,Failed,{_UserSkipped,_AutoSkipped}},1} when Failed > 0 ->
ok;
- {E,_} when E =/= ok ->
- E;
- {_,E} when E =/= ok ->
- E
+ {{_Ok,0,{_UserSkipped,AutoSkipped}},ExitStatus} when AutoSkipped > 0 ->
+ case proplists:get_value(exit_status, Opts1) of
+ ignore_config when ExitStatus == 1 ->
+ {error,{wrong_exit_status,ExitStatus}};
+ _ ->
+ ok
+ end;
+ {{error,_}=Error,ExitStatus} ->
+ if ExitStatus /= 2 ->
+ {error,{wrong_exit_status,ExitStatus}};
+ ExitStatus == 2 ->
+ Error
+ end;
+ {{_Ok,0,{_UserSkipped,_AutoSkipped}},0} ->
+ ok;
+ Unexpected ->
+ {error,{unexpected_return_value,Unexpected}}
end.
run(M, F, A, Config) ->
+ run({M,F,A}, [], Config).
+
+run({M,F,A}, InitCalls, Config) ->
CTNode = proplists:get_value(ct_node, Config),
Level = proplists:get_value(trace_level, Config),
- test_server:format(Level, "~nCalling ~w:~w(~p) on ~p~n",
+ lists:foreach(
+ fun({IM,IF,IA}) ->
+ test_server:format(Level, "~nInit call ~w:~w(~p) on ~p...~n",
+ [IM, IF, IA, CTNode]),
+ Result = rpc:call(CTNode, IM, IF, IA),
+ test_server:format(Level, "~n...with result: ~p~n", [Result])
+ end, InitCalls),
+ test_server:format(Level, "~nStarting test with ~w:~w(~p) on ~p~n",
[M, F, A, CTNode]),
rpc:call(CTNode, M, F, A).
+%% this is the last function that ct_run:script_start() calls, so the
+%% return value here is what rpc:call/4 above returns
+ct_test_halt(ExitStatus) ->
+ ExitStatus.
%%%-----------------------------------------------------------------
%%% wait_for_ct_stop/1
@@ -1001,6 +1037,12 @@ result_match({SkipOrFail,{ErrorInd,{Why,'_'}}},
result_match({SkipOrFail,{ErrorInd,{EMod,EFunc,{Why,'_'}}}},
{SkipOrFail,{ErrorInd,{EMod,EFunc,{Why,_Stack}}}}) ->
true;
+result_match({failed,{timetrap_timeout,{'$approx',Num}}},
+ {failed,{timetrap_timeout,Value}}) ->
+ if Value >= trunc(Num-0.02*Num),
+ Value =< trunc(Num+0.02*Num) -> true;
+ true -> false
+ end;
result_match(Result, Result) ->
true;
result_match(_, _) ->
diff --git a/lib/common_test/test/ct_testspec_1_SUITE.erl b/lib/common_test/test/ct_testspec_1_SUITE.erl
index b6dcf63fdf..6a4a4acd80 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -58,7 +58,7 @@ end_per_testcase(TestCase, Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}].
-all() ->
+all() ->
[all_suites, skip_all_suites, suite, skip_suite,
all_testcases, skip_all_testcases, testcase,
skip_testcase, all_groups, skip_all_groups, group,
@@ -67,23 +67,23 @@ all() ->
skip_group_testcase, topgroup, subgroup, skip_subgroup,
subgroup_all_testcases, skip_subgroup_all_testcases,
subgroup_testcase, skip_subgroup_testcase,
- sub_skipped_by_top, testcase_in_multiple_groups,
- order_of_tests_in_multiple_dirs_no_merge_tests,
- order_of_tests_in_multiple_suites_no_merge_tests,
- order_of_suites_in_multiple_dirs_no_merge_tests,
- order_of_groups_in_multiple_dirs_no_merge_tests,
- order_of_groups_in_multiple_suites_no_merge_tests,
- order_of_tests_in_multiple_dirs,
- order_of_tests_in_multiple_suites,
- order_of_suites_in_multiple_dirs,
- order_of_groups_in_multiple_dirs,
- order_of_groups_in_multiple_suites,
- order_of_tests_in_multiple_suites_with_skip_no_merge_tests,
- order_of_tests_in_multiple_suites_with_skip,
+ sub_skipped_by_top, testcase_many_groups,
+ order_of_tests_many_dirs_no_merge_tests,
+ order_of_tests_many_suites_no_merge_tests,
+ order_of_suites_many_dirs_no_merge_tests,
+ order_of_groups_many_dirs_no_merge_tests,
+ order_of_groups_many_suites_no_merge_tests,
+ order_of_tests_many_dirs,
+ order_of_tests_many_suites,
+ order_of_suites_many_dirs,
+ order_of_groups_many_dirs,
+ order_of_groups_many_suites,
+ order_of_tests_many_suites_with_skip_no_merge_tests,
+ order_of_tests_many_suites_with_skip,
all_plus_one_tc_no_merge_tests,
all_plus_one_tc].
-groups() ->
+groups() ->
[].
init_per_group(_GroupName, Config) ->
@@ -373,19 +373,19 @@ sub_skipped_by_top(Config) when is_list(Config) ->
%%%-----------------------------------------------------------------
%%%
-testcase_in_multiple_groups(Config) when is_list(Config) ->
+testcase_many_groups(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
TestDir = filename:join(DataDir, "groups_1"),
TestSpec = [{cases,TestDir,groups_12_SUITE,[testcase_1a,testcase_1b]},
{skip_cases,TestDir,groups_12_SUITE,[testcase_1b],"SKIPPED!"}],
- setup_and_execute(testcase_in_multiple_groups, TestSpec, Config).
+ setup_and_execute(testcase_many_groups, TestSpec, Config).
%%%-----------------------------------------------------------------
%%%
-order_of_tests_in_multiple_dirs_no_merge_tests(Config) when is_list(Config) ->
+order_of_tests_many_dirs_no_merge_tests(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
TestDir1 = filename:join(DataDir, "groups_1"),
@@ -395,13 +395,13 @@ order_of_tests_in_multiple_dirs_no_merge_tests(Config) when is_list(Config) ->
{cases,TestDir2,groups_22_SUITE,[testcase_1]},
{cases,TestDir1,groups_12_SUITE,[testcase_1b]}],
- setup_and_execute(order_of_tests_in_multiple_dirs_no_merge_tests,
+ setup_and_execute(order_of_tests_many_dirs_no_merge_tests,
TestSpec, Config).
%%%-----------------------------------------------------------------
%%%
-order_of_tests_in_multiple_suites_no_merge_tests(Config) when is_list(Config) ->
+order_of_tests_many_suites_no_merge_tests(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
TestDir1 = filename:join(DataDir, "groups_1"),
@@ -410,13 +410,13 @@ order_of_tests_in_multiple_suites_no_merge_tests(Config) when is_list(Config) ->
{cases,TestDir1,groups_11_SUITE,[testcase_1]},
{cases,TestDir1,groups_12_SUITE,[testcase_1b]}],
- setup_and_execute(order_of_tests_in_multiple_suites_no_merge_tests,
+ setup_and_execute(order_of_tests_many_suites_no_merge_tests,
TestSpec, Config).
%%%-----------------------------------------------------------------
%%%
-order_of_suites_in_multiple_dirs_no_merge_tests(Config) when is_list(Config) ->
+order_of_suites_many_dirs_no_merge_tests(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
TestDir1 = filename:join(DataDir, "groups_1"),
@@ -426,13 +426,13 @@ order_of_suites_in_multiple_dirs_no_merge_tests(Config) when is_list(Config) ->
{suites,TestDir2,groups_22_SUITE},
{suites,TestDir1,groups_11_SUITE}],
- setup_and_execute(order_of_suites_in_multiple_dirs_no_merge_tests,
+ setup_and_execute(order_of_suites_many_dirs_no_merge_tests,
TestSpec, Config).
%%%-----------------------------------------------------------------
%%%
-order_of_groups_in_multiple_dirs_no_merge_tests(Config) when is_list(Config) ->
+order_of_groups_many_dirs_no_merge_tests(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
TestDir1 = filename:join(DataDir, "groups_1"),
@@ -442,13 +442,13 @@ order_of_groups_in_multiple_dirs_no_merge_tests(Config) when is_list(Config) ->
{groups,TestDir2,groups_22_SUITE,test_group_1a},
{groups,TestDir1,groups_12_SUITE,test_group_1b}],
- setup_and_execute(order_of_groups_in_multiple_dirs_no_merge_tests,
+ setup_and_execute(order_of_groups_many_dirs_no_merge_tests,
TestSpec, Config).
%%%-----------------------------------------------------------------
%%%
-order_of_groups_in_multiple_suites_no_merge_tests(Config)
+order_of_groups_many_suites_no_merge_tests(Config)
when is_list(Config) ->
DataDir = ?config(data_dir, Config),
@@ -458,13 +458,13 @@ order_of_groups_in_multiple_suites_no_merge_tests(Config)
{groups,TestDir1,groups_11_SUITE,test_group_1a},
{groups,TestDir1,groups_12_SUITE,test_group_1b}],
- setup_and_execute(order_of_groups_in_multiple_suites_no_merge_tests,
+ setup_and_execute(order_of_groups_many_suites_no_merge_tests,
TestSpec, Config).
%%%-----------------------------------------------------------------
%%%
-order_of_tests_in_multiple_suites_with_skip_no_merge_tests(Config)
+order_of_tests_many_suites_with_skip_no_merge_tests(Config)
when is_list(Config) ->
DataDir = ?config(data_dir, Config),
@@ -477,14 +477,14 @@ order_of_tests_in_multiple_suites_with_skip_no_merge_tests(Config)
{skip_cases,TestDir1,groups_12_SUITE,[testcase_1b],"Skip it"}],
setup_and_execute(
- order_of_tests_in_multiple_suites_with_skip_no_merge_tests,
+ order_of_tests_many_suites_with_skip_no_merge_tests,
TestSpec, Config).
%%%-----------------------------------------------------------------
%%%
-order_of_tests_in_multiple_dirs(Config) when is_list(Config) ->
+order_of_tests_many_dirs(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
TestDir1 = filename:join(DataDir, "groups_1"),
@@ -493,13 +493,13 @@ order_of_tests_in_multiple_dirs(Config) when is_list(Config) ->
{cases,TestDir2,groups_22_SUITE,[testcase_1]},
{cases,TestDir1,groups_12_SUITE,[testcase_1b]}],
- setup_and_execute(order_of_tests_in_multiple_dirs,
+ setup_and_execute(order_of_tests_many_dirs,
TestSpec, Config).
%%%-----------------------------------------------------------------
%%%
-order_of_tests_in_multiple_suites(Config) when is_list(Config) ->
+order_of_tests_many_suites(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
TestDir1 = filename:join(DataDir, "groups_1"),
@@ -507,13 +507,13 @@ order_of_tests_in_multiple_suites(Config) when is_list(Config) ->
{cases,TestDir1,groups_11_SUITE,[testcase_1]},
{cases,TestDir1,groups_12_SUITE,[testcase_1b]}],
- setup_and_execute(order_of_tests_in_multiple_suites,
+ setup_and_execute(order_of_tests_many_suites,
TestSpec, Config).
%%%-----------------------------------------------------------------
%%%
-order_of_suites_in_multiple_dirs(Config) when is_list(Config) ->
+order_of_suites_many_dirs(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
TestDir1 = filename:join(DataDir, "groups_1"),
@@ -522,13 +522,13 @@ order_of_suites_in_multiple_dirs(Config) when is_list(Config) ->
{suites,TestDir2,groups_22_SUITE},
{suites,TestDir1,groups_11_SUITE}],
- setup_and_execute(order_of_suites_in_multiple_dirs,
+ setup_and_execute(order_of_suites_many_dirs,
TestSpec, Config).
%%%-----------------------------------------------------------------
%%%
-order_of_groups_in_multiple_dirs(Config) when is_list(Config) ->
+order_of_groups_many_dirs(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
TestDir1 = filename:join(DataDir, "groups_1"),
@@ -537,13 +537,13 @@ order_of_groups_in_multiple_dirs(Config) when is_list(Config) ->
{groups,TestDir2,groups_22_SUITE,test_group_1a},
{groups,TestDir1,groups_12_SUITE,test_group_1b}],
- setup_and_execute(order_of_groups_in_multiple_dirs,
+ setup_and_execute(order_of_groups_many_dirs,
TestSpec, Config).
%%%-----------------------------------------------------------------
%%%
-order_of_groups_in_multiple_suites(Config) when is_list(Config) ->
+order_of_groups_many_suites(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
TestDir1 = filename:join(DataDir, "groups_1"),
@@ -551,13 +551,13 @@ order_of_groups_in_multiple_suites(Config) when is_list(Config) ->
{groups,TestDir1,groups_11_SUITE,test_group_1a},
{groups,TestDir1,groups_12_SUITE,test_group_1b}],
- setup_and_execute(order_of_groups_in_multiple_suites,
+ setup_and_execute(order_of_groups_many_suites,
TestSpec, Config).
%%%-----------------------------------------------------------------
%%%
-order_of_tests_in_multiple_suites_with_skip(Config) when is_list(Config) ->
+order_of_tests_many_suites_with_skip(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
TestDir1 = filename:join(DataDir, "groups_1"),
@@ -567,7 +567,7 @@ order_of_tests_in_multiple_suites_with_skip(Config) when is_list(Config) ->
{cases,TestDir1,groups_11_SUITE,[testcase_2]},
{skip_cases,TestDir1,groups_12_SUITE,[testcase_1b],"Skip it!"}],
- setup_and_execute(order_of_tests_in_multiple_suites_with_skip,
+ setup_and_execute(order_of_tests_many_suites_with_skip,
TestSpec, Config).
%%%-----------------------------------------------------------------
@@ -621,7 +621,9 @@ setup_and_execute(TCName, TestSpec, Config) ->
ok = ct_test_support:run(Opts, Config),
TestSpec1 = [{logdir,proplists:get_value(logdir,Opts)},
{label,proplists:get_value(label,TestTerms)} | TestSpec],
- ok = ct_test_support:run(ct, run_testspec, [TestSpec1], Config),
+ {_Ok,_Failed,{_USkipped,_ASkipped}} =
+ ct_test_support:run(ct, run_testspec, [TestSpec1], Config),
+
Events = ct_test_support:get_events(ERPid, Config),
ct_test_support:log_events(TCName,
@@ -1202,10 +1204,10 @@ test_events(sub_skipped_by_top) ->
{negative,{?eh,tc_start,'_'},{?eh,stop_logging,'_'}}
];
-test_events(testcase_in_multiple_groups) ->
+test_events(testcase_many_groups) ->
[];
-test_events(order_of_tests_in_multiple_dirs_no_merge_tests) ->
+test_events(order_of_tests_many_dirs_no_merge_tests) ->
[{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,tc_start,{groups_12_SUITE,testcase_1a}},
{?eh,tc_done, {groups_12_SUITE,testcase_1a,
@@ -1217,7 +1219,7 @@ test_events(order_of_tests_in_multiple_dirs_no_merge_tests) ->
{failed,{error,{test_case_failed,no_group_data}}}}},
{?eh,stop_logging,[]}
];
-test_events(order_of_tests_in_multiple_suites_no_merge_tests) ->
+test_events(order_of_tests_many_suites_no_merge_tests) ->
[{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,tc_start,{groups_12_SUITE,testcase_1a}},
{?eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}},
@@ -1227,7 +1229,7 @@ test_events(order_of_tests_in_multiple_suites_no_merge_tests) ->
{?eh,tc_done,{groups_12_SUITE,testcase_1b,'_'}},
{?eh,stop_logging,[]}
];
-test_events(order_of_suites_in_multiple_dirs_no_merge_tests) ->
+test_events(order_of_suites_many_dirs_no_merge_tests) ->
[{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,tc_start,{groups_12_SUITE,init_per_suite}},
{?eh,tc_done,{groups_12_SUITE,init_per_suite,'_'}},
@@ -1242,7 +1244,7 @@ test_events(order_of_suites_in_multiple_dirs_no_merge_tests) ->
{?eh,tc_start,{groups_11_SUITE,end_per_suite}},
{?eh,tc_done,{groups_11_SUITE,end_per_suite,'_'}},
{?eh,stop_logging,[]}];
-test_events(order_of_groups_in_multiple_dirs_no_merge_tests) ->
+test_events(order_of_groups_many_dirs_no_merge_tests) ->
[{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,tc_start, {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}},
@@ -1255,7 +1257,7 @@ test_events(order_of_groups_in_multiple_dirs_no_merge_tests) ->
{?eh,tc_done, {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}},
{?eh,stop_logging,[]}];
-test_events(order_of_groups_in_multiple_suites_no_merge_tests) ->
+test_events(order_of_groups_many_suites_no_merge_tests) ->
[{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,tc_start, {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}},
@@ -1268,7 +1270,7 @@ test_events(order_of_groups_in_multiple_suites_no_merge_tests) ->
{?eh,tc_done, {groups_12_SUITE,{end_per_group,test_group_1b,'_'},'_'}},
{?eh,stop_logging,[]}];
-test_events(order_of_tests_in_multiple_suites_with_skip_no_merge_tests) ->
+test_events(order_of_tests_many_suites_with_skip_no_merge_tests) ->
[{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,tc_start,{groups_12_SUITE,testcase_1a}},
{?eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}},
@@ -1280,7 +1282,7 @@ test_events(order_of_tests_in_multiple_suites_with_skip_no_merge_tests) ->
{?eh,stop_logging,[]}
];
-test_events(order_of_tests_in_multiple_dirs) ->
+test_events(order_of_tests_many_dirs) ->
[{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,tc_start,{groups_12_SUITE,testcase_1a}},
{?eh,tc_done,
@@ -1294,7 +1296,7 @@ test_events(order_of_tests_in_multiple_dirs) ->
{?eh,tc_done,{groups_22_SUITE,testcase_1,ok}},
{?eh,stop_logging,[]}
];
-test_events(order_of_tests_in_multiple_suites) ->
+test_events(order_of_tests_many_suites) ->
[{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,tc_start,{groups_12_SUITE,testcase_1a}},
{?eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}},
@@ -1306,7 +1308,7 @@ test_events(order_of_tests_in_multiple_suites) ->
{?eh,tc_done,{groups_11_SUITE,testcase_1,ok}},
{?eh,stop_logging,[]}
];
-test_events(order_of_suites_in_multiple_dirs) ->
+test_events(order_of_suites_many_dirs) ->
[{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,tc_start,{groups_12_SUITE,init_per_suite}},
{?eh,tc_done,{groups_12_SUITE,init_per_suite,'_'}},
@@ -1323,7 +1325,7 @@ test_events(order_of_suites_in_multiple_dirs) ->
{?eh,tc_start,{groups_22_SUITE,end_per_suite}},
{?eh,tc_done,{groups_22_SUITE,end_per_suite,'_'}},
{?eh,stop_logging,[]}];
-test_events(order_of_groups_in_multiple_dirs) ->
+test_events(order_of_groups_many_dirs) ->
[{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,tc_start, {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}},
@@ -1336,7 +1338,7 @@ test_events(order_of_groups_in_multiple_dirs) ->
{?eh,tc_done, {groups_22_SUITE,{end_per_group,test_group_1a,'_'},'_'}},
{?eh,stop_logging,[]}];
-test_events(order_of_groups_in_multiple_suites) ->
+test_events(order_of_groups_many_suites) ->
[{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,tc_start, {groups_12_SUITE,{init_per_group,test_group_1a,'_'}}},
@@ -1350,7 +1352,7 @@ test_events(order_of_groups_in_multiple_suites) ->
{?eh,stop_logging,[]}];
-test_events(order_of_tests_in_multiple_suites_with_skip) ->
+test_events(order_of_tests_many_suites_with_skip) ->
[{?eh,start_logging,{'DEF','RUNDIR'}},
{?eh,tc_start,{groups_12_SUITE,testcase_1a}},
{?eh,tc_done,{groups_12_SUITE,testcase_1a,'_'}},
diff --git a/lib/common_test/test/ct_testspec_2_SUITE.erl b/lib/common_test/test/ct_testspec_2_SUITE.erl
new file mode 100644
index 0000000000..9d2dc84ad3
--- /dev/null
+++ b/lib/common_test/test/ct_testspec_2_SUITE.erl
@@ -0,0 +1,759 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%%-------------------------------------------------------------------
+%%% File: ct_testspec_2_SUITE
+%%%
+%%% Description:
+%%% Test test specifications
+%%%
+%%% The suites used for the test are located in the data directory.
+%%%-------------------------------------------------------------------
+-module(ct_testspec_2_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+-include_lib("common_test/src/ct_util.hrl").
+
+%%--------------------------------------------------------------------
+%% TEST SERVER CALLBACK FUNCTIONS
+%%--------------------------------------------------------------------
+
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(_Config) ->
+ ok.
+
+init_per_testcase(_TestCase, Config) ->
+ Config.
+
+end_per_testcase(_TestCase, _Config) ->
+ ok.
+
+%% suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [basic_compatible_no_nodes,
+ basic_compatible_nodes,
+ unknown_terms,
+ no_merging,
+ multiple_specs,
+ misc_config_terms,
+ define_names_1].
+
+
+%%--------------------------------------------------------------------
+%% VALID TEST SPEC TERMS (R15B02):
+%%
+%% {node,3}
+%% {cover,2}
+%% {cover,3}
+%% {config,2}
+%% {config,3}
+%% {config,4}
+%% {userconfig,2}
+%% {userconfig,3}
+%% {alias,3}
+%% {merge_tests,2}
+%% {logdir,2}
+%% {logdir,3}
+%% {logopts,2}
+%% {logopts,3}
+%% {basic_html,2}
+%% {basic_html,3}
+%% {verbosity,2}
+%% {verbosity,3}
+%% {silent_connections,2}
+%% {silent_connections,3}
+%% {label,2}
+%% {label,3}
+%% {event_handler,2}
+%% {event_handler,3}
+%% {event_handler,4}
+%% {ct_hooks,2}
+%% {ct_hooks,3}
+%% {enable_builtin_hooks,2}
+%% {release_shell,2}
+%% {multiply_timetraps,2}
+%% {multiply_timetraps,3}
+%% {scale_timetraps,2}
+%% {scale_timetraps,3}
+%% {include,2}
+%% {include,3}
+%% {auto_compile,2}
+%% {auto_compile,3}
+%% {stylesheet,2}
+%% {stylesheet,3}
+%% {suites,3}
+%% {suites,4}
+%% {groups,4}
+%% {groups,5}
+%% {groups,6}
+%% {cases,4}
+%% {cases,5}
+%% {skip_suites,4}
+%% {skip_suites,5}
+%% {skip_groups,5}
+%% {skip_groups,6}
+%% {skip_groups,7}
+%% {skip_cases,5}
+%% {skip_cases,6}
+%% {create_priv_dir,2}
+%%
+%%--------------------------------------------------------------------
+
+%%--------------------------------------------------------------------
+%% TEST CASES
+%%--------------------------------------------------------------------
+
+%%%-----------------------------------------------------------------
+%%%
+basic_compatible_no_nodes(_Config) ->
+
+ AliasDir1 = "../tests/to1",
+ AliasDir2 = "../tests/to2",
+ CfgDir1 = "../cfgs/to1/x.cfg",
+ CfgDir2 = ["../cfgs/to2/x.cfg","../cfgs/to2/y.cfg"],
+ LogDir = "../logs",
+ IncludeDir1 = "../../include",
+ IncludeDir2 = ["../tests/to1/include","../tests/to2/include"],
+
+ Spec =
+ [
+ {label,"basic_compatible_no_nodes"},
+ {alias,to1,AliasDir1},
+ {alias,to2,AliasDir2},
+ {config,CfgDir1},
+ {config,CfgDir2},
+ {userconfig,{?MODULE,"cfg_str1"}},
+ {userconfig,{?MODULE,"cfg_str2"}},
+ {logdir,LogDir},
+ {logopts,[no_nl]},
+ {event_handler,evh1,[1]},
+ {event_handler,[evh2,evh3],[[2,3]]},
+ {ct_hooks,[{cth_mod1,[]}]},
+ {ct_hooks,[{cth_mod2,[]}]},
+ {multiply_timetraps,2},
+ {include,IncludeDir1},
+ {include,IncludeDir2},
+ {suites,to1,[x_SUITE]},
+ {groups,to1,y_SUITE,[g1,g2]},
+ {cases,to1,y_SUITE,[tc1,tc2]},
+ {skip_suites,to1,z_SUITE,"skipped"},
+ {suites,to2,[x_SUITE,y_SUITE]},
+ {skip_groups,to2,x_SUITE,[g1,g2],"skipped"},
+ {skip_cases,to2,y_SUITE,[tc1,tc2],"skipped"}
+ ],
+
+ {ok,SpecDir} = file:get_cwd(),
+
+ ListResult = ct_testspec:collect_tests_from_list(Spec, false),
+ ct:pal("TESTSPEC RECORD FROM LIST:~n~p~n", [rec2proplist(ListResult)]),
+ SpecFile = ct_test_support:write_testspec(Spec,SpecDir,
+ "basic_compatible_no_nodes.spec"),
+ FileResult = ct_testspec:collect_tests_from_file([SpecFile], false),
+ ct:pal("TESTSPEC RECORD FROM FILE:~n~p~n", [rec2proplist(FileResult)]),
+
+ Node = node(),
+ LogDirV = get_absdir(filename:join(SpecDir,"../logs")),
+ Alias1V = get_absdir(filename:join(SpecDir,AliasDir1)),
+ Alias2V = get_absdir(filename:join(SpecDir,AliasDir2)),
+ CFGs = [{Node,get_absdir(filename:join(SpecDir,CfgDir))} ||
+ CfgDir <- [CfgDir1 | CfgDir2]],
+ Incls = [{Node,get_absdir(filename:join(SpecDir,IncludeDir))} ||
+ IncludeDir <- [IncludeDir1 | IncludeDir2]],
+
+ Verify = #testspec{spec_dir = SpecDir,
+ nodes = [{undefined,Node}],
+ init = [],
+ label = [{Node,"basic_compatible_no_nodes"}],
+ logdir = [{Node,LogDirV},"."],
+ logopts = [{Node,[no_nl]}],
+ basic_html = [],
+ cover = [],
+ config = CFGs,
+ userconfig = [{Node,{?MODULE,"cfg_str1"}},
+ {Node,{?MODULE,"cfg_str2"}}],
+ event_handler = [{Node,evh1,[1]},
+ {Node,evh2,[[2,3]]},
+ {Node,evh3,[[2,3]]}],
+ ct_hooks = [{Node,{cth_mod1,[]}},
+ {Node,{cth_mod2,[]}}],
+ enable_builtin_hooks = true,
+ release_shell = false,
+ include = Incls,
+ auto_compile = [],
+ stylesheet = [],
+ multiply_timetraps = [{Node,2}],
+ scale_timetraps = [],
+ create_priv_dir = [],
+ alias = [{to1,Alias1V},{to2,Alias2V}],
+ tests = [{{Node,Alias1V},
+ [{x_SUITE,[all]},
+ {y_SUITE,[{g1,all},{g2,all},tc1,tc2]},
+ {z_SUITE,[{all,{skip,"skipped"}}]}]},
+ {{Node,Alias2V},
+ [{x_SUITE,[all,
+ {{g1,all},{skip,"skipped"}},
+ {{g2,all},{skip,"skipped"}}]},
+ {y_SUITE,[all,
+ {tc1,{skip,"skipped"}},
+ {tc2,{skip,"skipped"}}]}]}],
+ merge_tests = true},
+
+ verify_result(Verify,ListResult,FileResult).
+
+%%%-----------------------------------------------------------------
+%%%
+basic_compatible_nodes(_Config) ->
+
+ Node1 = node1@host1,
+ Node2 = node2@host2,
+ TODir1 = "../tests/to1",
+ TODir2 = "../tests/to2",
+ CfgDir1 = "../cfgs/to1/x.cfg",
+ CfgDir2 = ["../cfgs/to2/x.cfg","../cfgs/to2/y.cfg"],
+ LogDir = "../logs",
+ MasterLogDir = "../master_logs",
+ IncludeDir1 = "../../include",
+ IncludeDir2 = ["../tests/to1/include","../tests/to2/include"],
+
+ Spec =
+ [
+ {node,n1,Node1},
+ {node,n2,Node2},
+ {init,[n1],[{node_start,[{callback_module,cbm}]}]},
+ {init,n2,[{node_start,[]}]},
+ {init,all_nodes,{eval,{mod,func,[]}}},
+ {label,"basic_compatible_nodes"},
+ {label,n1,basic_compatible_nodes_1},
+ {config,n1,CfgDir1},
+ {config,n2,CfgDir2},
+ {userconfig,{?MODULE,"cfg_str1"}},
+ {userconfig,{?MODULE,"cfg_str2"}},
+ {logdir,all_nodes,LogDir},
+ {logdir,master,MasterLogDir},
+ {logopts,node2@host2,[no_nl]},
+ {event_handler,master,evh1,[1]},
+ {event_handler,[n1,n2],[evh2,evh3],[[2,3]]},
+ {ct_hooks,all_nodes,[{cth_mod1,[]}]},
+ {ct_hooks,[{cth_mod2,[]}]},
+ {multiply_timetraps,node1@host1,2},
+ {include,n1,IncludeDir1},
+ {include,[n1,n2],IncludeDir2},
+ {suites,n1,TODir1,[x_SUITE]},
+ {groups,n1,TODir1,y_SUITE,[g1,g2]},
+ {cases,n1,TODir1,y_SUITE,[tc1,tc2]},
+ {skip_suites,n1,TODir1,z_SUITE,"skipped"},
+ {suites,n2,TODir2,[x_SUITE,y_SUITE]},
+ {skip_groups,n2,TODir2,x_SUITE,[g1,g2],"skipped"},
+ {skip_cases,n2,TODir2,y_SUITE,[tc1,tc2],"skipped"}
+ ],
+
+ {ok,SpecDir} = file:get_cwd(),
+
+ ListResult = ct_testspec:collect_tests_from_list(Spec, false),
+ ct:pal("TESTSPEC RECORD FROM LIST:~n~p~n", [rec2proplist(ListResult)]),
+ SpecFile = ct_test_support:write_testspec(Spec,SpecDir,
+ "basic_compatible_nodes.spec"),
+ FileResult = ct_testspec:collect_tests_from_file([SpecFile], false),
+ ct:pal("TESTSPEC RECORD FROM FILE:~n~p~n", [rec2proplist(FileResult)]),
+
+ Node = node(),
+ LogDirV = get_absdir(filename:join(SpecDir,"../logs")),
+ MasterLogDirV = get_absdir(filename:join(SpecDir,"../master_logs")),
+ TO1V = get_absdir(filename:join(SpecDir,TODir1)),
+ TO2V = get_absdir(filename:join(SpecDir,TODir2)),
+ CFGs = [{Node1,get_absdir(filename:join(SpecDir,CfgDir1))} |
+ [{Node2,get_absdir(filename:join(SpecDir,CfgDir))} || CfgDir <- CfgDir2]],
+ Incls = [{Node1,get_absdir(filename:join(SpecDir,IncludeDir1))} |
+ [{Node1,get_absdir(filename:join(SpecDir,IncludeDir))} ||
+ IncludeDir <- IncludeDir2] ++
+ [{Node2,get_absdir(filename:join(SpecDir,IncludeDir))} ||
+ IncludeDir <- IncludeDir2]],
+
+ Verify = #testspec{spec_dir = SpecDir,
+ nodes = [{undefined,Node},{n1,Node1},{n2,Node2}],
+ init = [{Node1,[{node_start,[{callback_module,cbm}]},
+ {eval,[{mod,func,[]}]}]},
+ {Node2,[{node_start,[{callback_module,ct_slave}]},
+ {eval,[{mod,func,[]}]}]},
+ {Node,[{node_start,[]},
+ {eval,[{mod,func,[]}]}]}],
+ label = [{Node,"basic_compatible_nodes"},
+ {Node2,"basic_compatible_nodes"},
+ {Node1,basic_compatible_nodes_1}],
+ logdir = [{Node,LogDirV},{Node1,LogDirV},{Node2,LogDirV},
+ {master,MasterLogDirV},"."],
+ logopts = [{Node2,[no_nl]}],
+ basic_html = [],
+ cover = [],
+ config = CFGs,
+ userconfig = [{Node,{?MODULE,"cfg_str1"}},
+ {Node1,{?MODULE,"cfg_str1"}},
+ {Node2,{?MODULE,"cfg_str1"}},
+ {Node,{?MODULE,"cfg_str2"}},
+ {Node1,{?MODULE,"cfg_str2"}},
+ {Node2,{?MODULE,"cfg_str2"}}],
+ event_handler = [{master,evh1,[1]},
+ {Node1,evh2,[[2,3]]},
+ {Node1,evh3,[[2,3]]},
+ {Node2,evh2,[[2,3]]},
+ {Node2,evh3,[[2,3]]}],
+ ct_hooks = [{Node,{cth_mod1,[]}},
+ {Node1,{cth_mod1,[]}},
+ {Node2,{cth_mod1,[]}},
+ {Node,{cth_mod2,[]}},
+ {Node1,{cth_mod2,[]}},
+ {Node2,{cth_mod2,[]}}],
+ enable_builtin_hooks = true,
+ release_shell = false,
+ include = Incls,
+ auto_compile = [],
+ stylesheet = [],
+ multiply_timetraps = [{Node1,2}],
+ scale_timetraps = [],
+ create_priv_dir = [],
+ tests = [{{Node1,TO1V},
+ [{x_SUITE,[all]},
+ {y_SUITE,[{g1,all},{g2,all},tc1,tc2]},
+ {z_SUITE,[{all,{skip,"skipped"}}]}]},
+ {{Node2,TO2V},
+ [{x_SUITE,[all,
+ {{g1,all},{skip,"skipped"}},
+ {{g2,all},{skip,"skipped"}}]},
+ {y_SUITE,[all,
+ {tc1,{skip,"skipped"}},
+ {tc2,{skip,"skipped"}}]}]}],
+ merge_tests = true},
+
+ verify_result(Verify,ListResult,FileResult).
+
+%%%-----------------------------------------------------------------
+%%%
+unknown_terms(Config) ->
+ PrivDir = ?config(priv_dir, Config),
+
+ Spec1 = [{suites,PrivDir,all},
+ {userdata,"I've got news for you"}],
+ {error,{undefined_term_in_spec,{userdata,_}}} =
+ (catch ct_testspec:collect_tests_from_list(Spec1, false)),
+ true = is_record(ct_testspec:collect_tests_from_list(Spec1, true),
+ testspec),
+
+ Spec2 = [{logdir,{logdir,PrivDir}}],
+ {error,{invalid_directory_name,_}} =
+ (catch ct_testspec:collect_tests_from_list(Spec2, false)),
+
+ Spec3 = [{suite,PrivDir,all}],
+ {error,{undefined_term_in_spec,{suite,_,_}}} =
+ (catch ct_testspec:collect_tests_from_list(Spec3, false)),
+ true = is_record(ct_testspec:collect_tests_from_list(Spec3, true), testspec),
+
+ Spec4 = [{suites,PrivDir,all},
+ {skip_suites,PrivDir,x_SUITE}],
+ {error,{bad_term_in_spec,{skip_suites,_,_}}} =
+ (catch ct_testspec:collect_tests_from_list(Spec4, false)),
+ {error,{bad_term_in_spec,{skip_suites,_,_}}} =
+ (catch ct_testspec:collect_tests_from_list(Spec4, true)),
+
+ Spec5 = [{configs,all_nodes,PrivDir}],
+ {error,{undefined_term_in_spec,{configs,_,_}}} =
+ (catch ct_testspec:collect_tests_from_list(Spec5, false)),
+ true = is_record(ct_testspec:collect_tests_from_list(Spec5, true), testspec),
+
+ ok.
+
+%%%-----------------------------------------------------------------
+%%%
+no_merging(_Config) ->
+ Node1 = node1@host1,
+ Node2 = node2@host2,
+ TODir1 = "../tests/to1",
+ TODir2 = "../tests/to2",
+ Spec =
+ [
+ {merge_tests,false},
+ {node,n1,Node1},
+ {node,n2,Node2},
+ {suites,n1,TODir1,[x_SUITE]},
+ {groups,n1,TODir1,y_SUITE,[g1,g2]},
+ {cases,n1,TODir1,y_SUITE,[tc1,tc2]},
+ {skip_suites,n1,TODir1,z_SUITE,"skipped"},
+ {suites,n2,TODir2,[x_SUITE,y_SUITE]},
+ {skip_groups,n2,TODir2,x_SUITE,[g1,g2],"skipped"},
+ {skip_cases,n2,TODir2,y_SUITE,[tc1,tc2],"skipped"}
+ ],
+
+ {ok,SpecDir} = file:get_cwd(),
+
+ ListResult = ct_testspec:collect_tests_from_list(Spec, false),
+ ct:pal("TESTSPEC RECORD FROM LIST:~n~p~n", [rec2proplist(ListResult)]),
+ SpecFile = ct_test_support:write_testspec(Spec,SpecDir,
+ "no_merging.spec"),
+ FileResult = ct_testspec:collect_tests_from_file([SpecFile], false),
+ ct:pal("TESTSPEC RECORD FROM FILE:~n~p~n", [rec2proplist(FileResult)]),
+
+ Node = node(),
+ TO1V = get_absdir(filename:join(SpecDir,TODir1)),
+ TO2V = get_absdir(filename:join(SpecDir,TODir2)),
+
+ Verify = #testspec{merge_tests = false,
+ spec_dir = SpecDir,
+ nodes = [{undefined,Node},{n1,Node1},{n2,Node2}],
+ tests = [{{Node1,TO1V},
+ [{x_SUITE,[all]}]},
+ {{Node1,TO1V},
+ [{y_SUITE,[{g1,all},{g2,all}]}]},
+ {{Node1,TO1V},
+ [{y_SUITE,[tc1,tc2]}]},
+ {{Node1,TO1V},
+ [{z_SUITE,[{all,{skip,"skipped"}}]}]},
+ {{Node2,TO2V},
+ [{x_SUITE,[all]}]},
+ {{Node2,TO2V},
+ [{y_SUITE,[all]}]},
+ {{Node2,TO2V},
+ [{x_SUITE,[{{g1,all},{skip,"skipped"}},
+ {{g2,all},{skip,"skipped"}}]}]},
+ {{Node2,TO2V},
+ [{y_SUITE,[{tc1,{skip,"skipped"}},
+ {tc2,{skip,"skipped"}}]}]}]},
+
+ verify_result(Verify,ListResult,FileResult).
+
+%%%-----------------------------------------------------------------
+%%%
+multiple_specs(_Config) ->
+ Node1 = node1@host1,
+ Node2 = node2@host2,
+ TODir1 = "../tests/to1",
+ TODir2 = "../tests/to2",
+ CfgDir1 = "../cfgs/to1/x.cfg",
+ CfgDir2 = ["../cfgs/to2/x.cfg","../cfgs/to2/y.cfg"],
+ LogDir = "../logs",
+ Spec1 =
+ [
+ {node,n1,Node1},
+ {node,n2,Node2},
+ {alias,to1,TODir1},
+ {alias,to2,TODir2},
+ {label,"multiple_specs1"},
+ {config,n1,CfgDir1},
+ {config,n2,CfgDir2},
+ {logdir,all_nodes,LogDir}
+ ],
+ Spec2 =
+ [
+ {merge_tests,false},
+ {label,"multiple_specs2"},
+ {suites,n1,TODir1,[x_SUITE]},
+ {groups,n1,TODir1,y_SUITE,[g1,g2]},
+ {cases,n1,TODir1,y_SUITE,[tc1,tc2]},
+ {skip_suites,n1,TODir1,z_SUITE,"skipped"},
+ {suites,n2,TODir2,[x_SUITE,y_SUITE]},
+ {skip_groups,n2,TODir2,x_SUITE,[g1,g2],"skipped"},
+ {skip_cases,n2,TODir2,y_SUITE,[tc1,tc2],"skipped"}
+ ],
+
+ {ok,SpecDir} = file:get_cwd(),
+ SpecFile1 = ct_test_support:write_testspec(Spec1,SpecDir,
+ "multiple_specs.1.spec"),
+ SpecFile2 = ct_test_support:write_testspec(Spec2,SpecDir,
+ "multiple_specs.2.spec"),
+ FileResult = ct_testspec:collect_tests_from_file([SpecFile1,SpecFile2],
+ false),
+ ct:pal("TESTSPEC RECORD FROM FILE:~n~p~n", [rec2proplist(FileResult)]),
+
+ Node = node(),
+ TO1V = get_absdir(filename:join(SpecDir,TODir1)),
+ TO2V = get_absdir(filename:join(SpecDir,TODir2)),
+ CFGs = [{Node1,get_absdir(filename:join(SpecDir,CfgDir1))} |
+ [{Node2,get_absdir(filename:join(SpecDir,CfgDir))} || CfgDir <- CfgDir2]],
+ LogDirV = get_absdir(filename:join(SpecDir,"../logs")),
+
+ Verify = #testspec{merge_tests = false,
+ spec_dir = SpecDir,
+ nodes = [{undefined,Node},{n1,Node1},{n2,Node2}],
+ alias = [{to1,TO1V},{to2,TO2V}],
+ label = [{Node,"multiple_specs1"},
+ {Node1,"multiple_specs1"},
+ {Node2,"multiple_specs1"}],
+ logdir = [{Node,LogDirV},{Node1,LogDirV},{Node2,LogDirV},"."],
+ config = CFGs,
+ tests = [{{Node1,TO1V},
+ [{x_SUITE,[all]}]},
+ {{Node1,TO1V},
+ [{y_SUITE,[{g1,all},{g2,all}]}]},
+ {{Node1,TO1V},
+ [{y_SUITE,[tc1,tc2]}]},
+ {{Node1,TO1V},
+ [{z_SUITE,[{all,{skip,"skipped"}}]}]},
+ {{Node2,TO2V},
+ [{x_SUITE,[all]}]},
+ {{Node2,TO2V},
+ [{y_SUITE,[all]}]},
+ {{Node2,TO2V},
+ [{x_SUITE,[{{g1,all},{skip,"skipped"}},
+ {{g2,all},{skip,"skipped"}}]}]},
+ {{Node2,TO2V},
+ [{y_SUITE,[{tc1,{skip,"skipped"}},
+ {tc2,{skip,"skipped"}}]}]}]},
+
+ verify_result(Verify,FileResult,FileResult).
+
+%%%-----------------------------------------------------------------
+%%%
+misc_config_terms(_Config) ->
+ CfgDir = "../cfgs/to1",
+
+ Spec =
+ [{node,x,n1@h1},{node,y,n2@h2},
+
+ {config,CfgDir,"a.cfg"},
+ {config,n1@h1,CfgDir,"b.cfg"},
+ {config,all_nodes,CfgDir,"c.cfg"},
+ {config,all_nodes,filename:join(CfgDir,"d.cfg")},
+
+ {basic_html,true},
+ {basic_html,n1@h1,false},
+ {basic_html,n2@h2,true},
+
+ {silent_connections,n1@h1,all},
+ {silent_connections,n2@h2,[ssh]},
+
+ {enable_builtin_hooks,false},
+
+ {release_shell,true},
+
+ {auto_compile,false},
+ {auto_compile,n1@h1,true},
+ {auto_compile,n2@h2,false},
+
+ {stylesheet,"../css"},
+ {stylesheet,n1@h1,"./n1/css"},
+ {stylesheet,n2@h2,"./n2/css"},
+
+ {create_priv_dir,[auto_per_tc]},
+ {create_priv_dir,n1@h1,[manual_per_tc]},
+ {create_priv_dir,n2@h2,[auto_per_run]}
+ ],
+
+ {ok,SpecDir} = file:get_cwd(),
+
+ ListResult = ct_testspec:collect_tests_from_list(Spec, false),
+ ct:pal("TESTSPEC RECORD FROM LIST:~n~p~n", [rec2proplist(ListResult)]),
+ SpecFile = ct_test_support:write_testspec(Spec,SpecDir,
+ "misc_config_terms.spec"),
+ FileResult = ct_testspec:collect_tests_from_file([SpecFile], false),
+ ct:pal("TESTSPEC RECORD FROM FILE:~n~p~n", [rec2proplist(FileResult)]),
+
+ Node = node(),
+ CfgA = get_absdir(filename:join(filename:join(SpecDir,CfgDir), "a.cfg")),
+ CfgB = get_absdir(filename:join(filename:join(SpecDir,CfgDir), "b.cfg")),
+ CfgC = get_absdir(filename:join(filename:join(SpecDir,CfgDir), "c.cfg")),
+ CfgD = get_absdir(filename:join(filename:join(SpecDir,CfgDir), "d.cfg")),
+ CSS = get_absdir(filename:join(SpecDir,"../css")),
+ CSS1 = get_absdir(filename:join(SpecDir,"./n1/css")),
+ CSS2 = get_absdir(filename:join(SpecDir,"./n2/css")),
+
+ Verify = #testspec{spec_dir = SpecDir,
+ nodes = [{undefined,Node},{x,n1@h1},{y,n2@h2}],
+ basic_html = [{Node,true},{n1@h1,false},{n2@h2,true}],
+ silent_connections = [{n1@h1,[all]},{n2@h2,[ssh]}],
+ config = [{Node,CfgA},
+ {n1@h1,CfgA},
+ {n2@h2,CfgA},
+ {n1@h1,CfgB},
+ {Node,CfgC},
+ {n1@h1,CfgC},
+ {n2@h2,CfgC},
+ {Node,CfgD},
+ {n1@h1,CfgD},
+ {n2@h2,CfgD}],
+ enable_builtin_hooks = false,
+ release_shell = true,
+ auto_compile = [{Node,false},
+ {n1@h1,true},
+ {n2@h2,false}],
+ stylesheet = [{Node,CSS},
+ {n1@h1,CSS1},
+ {n2@h2,CSS2}],
+ create_priv_dir = [{Node,[auto_per_tc]},
+ {n1@h1,[manual_per_tc]},
+ {n2@h2,[auto_per_run]}]
+ },
+
+ verify_result(Verify,ListResult,FileResult).
+
+%%%-----------------------------------------------------------------
+%%%
+define_names_1(_Config) ->
+ Spec =
+ [
+ {define,'HOST','eniac'},
+ {define,'NODE1',testnode1},
+ {define,'NODE2',testnode2},
+ {define,'NODES',['NODE1@HOST',
+ 'NODE2@HOST']},
+ {define,'TOPDIR',".."},
+ {define,'TO1',"to1"},
+ {define,'TO2',"to2"},
+ {define,'LOGDIR',"'TOPDIR'/logdir"},
+ {define,'LOGDIR1',"'TOPDIR'/logdir1"},
+ {define,'LOGDIR2',"'TOPDIR'/logdir2"},
+ {define,'CFGDIR',"'TOPDIR'/cfgs"},
+ {define,'CFGFILES',["cfgX","cfgY"]},
+ {define,'TESTDIR',"'TOPDIR'/test"},
+ {define,'TO1DIR',"'TESTDIR'/'TO1'"},
+ {define,'TO2DIR',"'TESTDIR'/'TO2'"},
+ {define,'EXSUITE',ex_SUITE},
+ {define,'EXGRS',[g1,g2]},
+
+ {logdir,'LOGDIR'},
+ {logdir,'NODE1@HOST','LOGDIR1'},
+ {logdir,'NODE2@HOST','LOGDIR2'},
+
+ {config,["a.cfg","b.cfg"]},
+ {config,'NODES',"./'CFGDIR'/c.cfg"},
+ {config,'CFGDIR',["d.cfg","e.cfg"]},
+ {config,'NODE2@HOST','CFGDIR','CFGFILES'},
+
+ {suites,'NODE1@HOST','TO1DIR',all},
+ {suites,'NODES','TO2DIR',all},
+
+ {groups,'TO1DIR','EXSUITE','EXGRS'}
+ ],
+
+ {ok,SpecDir} = file:get_cwd(),
+
+ ListResult = ct_testspec:collect_tests_from_list(Spec, false),
+ ct:pal("TESTSPEC RECORD FROM LIST:~n~p~n", [rec2proplist(ListResult)]),
+ SpecFile = ct_test_support:write_testspec(Spec,SpecDir,
+ "define_names_1.spec"),
+ FileResult = ct_testspec:collect_tests_from_file([SpecFile], false),
+ ct:pal("TESTSPEC RECORD FROM FILE:~n~p~n", [rec2proplist(FileResult)]),
+
+ N = node(),
+ N1 = testnode1@eniac,
+ N2 = testnode2@eniac,
+ Join = fun(Dir) -> shorten_path(filename:join(SpecDir,Dir),SpecDir) end,
+
+ Verify = #testspec{spec_dir = SpecDir,
+ nodes = [{undefined,N2},
+ {undefined,N1},
+ {undefined,N}],
+ config = [{N2,Join("a.cfg")},{N2,Join("b.cfg")},
+ {N1,Join("a.cfg")},{N1,Join("b.cfg")},
+ {N,Join("a.cfg")},{N,Join("b.cfg")},
+ {N1,Join("../cfgs/c.cfg")},{N2,Join("../cfgs/c.cfg")},
+ {N2,Join("../cfgs/d.cfg")},{N2,Join("../cfgs/e.cfg")},
+ {N1,Join("../cfgs/d.cfg")},{N1,Join("../cfgs/e.cfg")},
+ {N,Join("../cfgs/d.cfg")},{N,Join("../cfgs/e.cfg")},
+ {N2,Join("../cfgs/cfgX")},{N2,Join("../cfgs/cfgY")}],
+ logdir = [{N,Join("../logdir")},
+ {N1,Join("../logdir1")},
+ {N2,Join("../logdir2")},
+ "."],
+ tests = [{{N1,Join("../test/to1")},[{all,[all]}]},
+ {{N1,Join("../test/to2")},[{all,[all]}]},
+ {{N2,Join("../test/to2")},[{all,[all]}]},
+ {{N2,Join("../test/to1")},
+ [{ex_SUITE,[{g1,all},{g2,all}]}]},
+ {{N,Join("../test/to1")},
+ [{ex_SUITE,[{g1,all},{g2,all}]}]}]
+ },
+ verify_result(Verify,ListResult,FileResult).
+
+
+%%%-----------------------------------------------------------------
+%%% HELP FUNCTIONS
+%%%-----------------------------------------------------------------
+
+verify_result(Verify,ListResult,FileResult) ->
+ {_,TSLTuples} = rec2proplist(ListResult),
+ {_,TSFTuples} = rec2proplist(FileResult),
+ {_,VTuples} = rec2proplist(Verify),
+ VResult =
+ (catch lists:foldl(fun({Tag,Val},{[{Tag,Val}|TSL],[{Tag,Val}|TSF]}) ->
+ {TSL,TSF};
+ ({Tag,Val},{[{_Tag,TSLVal}|_TSL],[{Tag,Val}|_TSF]}) ->
+ exit({ts_list_mismatch,Tag,Val,TSLVal});
+ ({Tag,Val},{[{Tag,Val}|_TSL],[{_Tag,TSFVal}|_TSF]}) ->
+ exit({ts_file_mismatch,Tag,Val,TSFVal});
+ ({Tag,Val},{_,[{_Tag,TSFVal}|_TSF]}) ->
+ exit({ts_mismatch,Tag,Val,TSFVal})
+ end, {TSLTuples,TSFTuples}, VTuples)),
+ case VResult of
+ {'EXIT',Reason} ->
+ ct:fail(Reason);
+ _ ->
+ ok
+ end,
+ ok.
+
+
+check_parameter(S="cfg_str1") ->
+ {ok,{config,S}};
+check_parameter(S="cfg_str2") ->
+ {ok,{config,S}}.
+read_config(S) ->
+ {ok,[{cfg,S}]}.
+
+rec2proplist(E={error,_What}) ->
+ exit({invalid_testspec_record,E});
+rec2proplist(Rec) ->
+ [RecName|RecList] = tuple_to_list(Rec),
+ FieldNames =
+ if RecName == testspec ->
+ record_info(fields, testspec);
+ true ->
+ undefined
+ end,
+ {RecName,combine_names_and_vals(FieldNames,RecList)}.
+
+combine_names_and_vals([FN|FNs], [V|Vs]) ->
+ [{FN,V} | combine_names_and_vals(FNs, Vs)];
+combine_names_and_vals([], []) ->
+ [];
+combine_names_and_vals(_, _) ->
+ [].
+
+get_absdir(Dir) ->
+ shorten_path(filename:absname(Dir),Dir).
+
+shorten_path(Path,SpecDir) ->
+ case shorten_split_path(filename:split(Path),[]) of
+ [] ->
+ [Root|_] = filename:split(SpecDir),
+ Root;
+ Short ->
+ filename:join(Short)
+ end.
+
+shorten_split_path([".."|Path],SoFar) ->
+ shorten_split_path(Path,tl(SoFar));
+shorten_split_path(["."|Path],SoFar) ->
+ shorten_split_path(Path,SoFar);
+shorten_split_path([Dir|Path],SoFar) ->
+ shorten_split_path(Path,[Dir|SoFar]);
+shorten_split_path([],SoFar) ->
+ lists:reverse(SoFar).
diff --git a/lib/common_test/test/ct_verbosity_SUITE.erl b/lib/common_test/test/ct_verbosity_SUITE.erl
new file mode 100644
index 0000000000..349319de94
--- /dev/null
+++ b/lib/common_test/test/ct_verbosity_SUITE.erl
@@ -0,0 +1,244 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%%-------------------------------------------------------------------
+%%% File: ct_verbosity_SUITE
+%%%
+%%% Description:
+%%% Test that verbosity levels vs the importance parameter works as
+%%% expected.
+%%%
+%%%-------------------------------------------------------------------
+-module(ct_verbosity_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+-include_lib("common_test/include/ct_event.hrl").
+
+-define(eh, ct_test_support_eh).
+
+%%--------------------------------------------------------------------
+%% TEST SERVER CALLBACK FUNCTIONS
+%%--------------------------------------------------------------------
+
+%%--------------------------------------------------------------------
+%% Description: Since Common Test starts another Test Server
+%% instance, the tests need to be performed on a separate node (or
+%% there will be clashes with logging processes etc).
+%%--------------------------------------------------------------------
+init_per_suite(Config) ->
+ Config1 = ct_test_support:init_per_suite(Config),
+ Config1.
+
+end_per_suite(Config) ->
+ ct_test_support:end_per_suite(Config).
+
+init_per_testcase(TestCase, Config) ->
+ ct_test_support:init_per_testcase(TestCase, Config).
+
+end_per_testcase(TestCase, Config) ->
+ ct_test_support:end_per_testcase(TestCase, Config).
+
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [
+ no_levels,
+ general_level_low,
+ general_level_std,
+ general_level_hi,
+ change_default,
+ combine_categories,
+ testspec_only,
+ merge_with_testspec
+ ].
+
+%%--------------------------------------------------------------------
+%% TEST CASES
+%%--------------------------------------------------------------------
+
+%%%-----------------------------------------------------------------
+%%%
+no_levels(Config) ->
+ TC = no_levels,
+ DataDir = ?config(data_dir, Config),
+ Suite = filename:join(DataDir, "io_test_SUITE"),
+ {Opts,ERPid} = setup([{suite,Suite},{label,TC}], Config),
+ ok = execute(TC, Opts, ERPid, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+general_level_low(Config) ->
+ TC = general_level_low,
+ DataDir = ?config(data_dir, Config),
+ Suite = filename:join(DataDir, "io_test_SUITE"),
+ {Opts,ERPid} = setup([{suite,Suite},{label,TC},
+ {verbosity,0}], Config),
+ ok = execute(TC, Opts, ERPid, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+general_level_std(Config) ->
+ TC = general_level_std,
+ DataDir = ?config(data_dir, Config),
+ Suite = filename:join(DataDir, "io_test_SUITE"),
+ {Opts,ERPid} = setup([{suite,Suite},{label,TC},
+ {verbosity,50}], Config),
+ ok = execute(TC, Opts, ERPid, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+general_level_hi(Config) ->
+ TC = general_level_high,
+ DataDir = ?config(data_dir, Config),
+ Suite = filename:join(DataDir, "io_test_SUITE"),
+ {Opts,ERPid} = setup([{suite,Suite},{label,TC},
+ {verbosity,100}], Config),
+ ok = execute(TC, Opts, ERPid, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+change_default(Config) ->
+ TC = change_default,
+ DataDir = ?config(data_dir, Config),
+ Suite = filename:join(DataDir, "io_test_SUITE"),
+ {Opts,ERPid} = setup([{suite,Suite},{label,TC},
+ {verbosity,[{default,49}]}], Config),
+ ok = execute(TC, Opts, ERPid, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+combine_categories(Config) ->
+ TC = combine_categories,
+ DataDir = ?config(data_dir, Config),
+ Suite = filename:join(DataDir, "io_test_SUITE"),
+ {Opts,ERPid} = setup([{suite,Suite},{label,TC},
+ {verbosity,[{error,?HI_VERBOSITY},
+ {default,?LOW_VERBOSITY}]}], Config),
+ ok = execute(TC, Opts, ERPid, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+testspec_only(Config) ->
+ TC = testspec_only,
+ DataDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
+
+ TestSpec = [{verbosity,[{default,1},{error,75},100]},
+ {suites,DataDir,[io_test_SUITE]},
+ {label,TC}],
+
+ TestSpecName = ct_test_support:write_testspec(TestSpec, PrivDir,
+ "verbosity_1_spec"),
+ {Opts,ERPid} = setup([{spec,TestSpecName}], Config),
+
+ ok = execute(TC, Opts, ERPid, Config).
+
+%%%-----------------------------------------------------------------
+%%%
+merge_with_testspec(Config) ->
+ TC = merge_with_testspec,
+ DataDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
+
+ TestSpec = [{verbosity,[{default,100},{error,100}]},
+ {suites,DataDir,[io_test_SUITE]},
+ {label,TC}],
+
+ TestSpecName = ct_test_support:write_testspec(TestSpec, PrivDir,
+ "verbosity_2_spec"),
+
+ %% below should override verbosity categories in testspec
+ {Opts,ERPid} = setup([{spec,TestSpecName},
+ {verbosity,[{default,0},0]}],
+ Config),
+
+ ok = execute(TC, Opts, ERPid, Config).
+
+%%%-----------------------------------------------------------------
+%%% HELP FUNCTIONS
+%%%-----------------------------------------------------------------
+
+setup(Test, Config) ->
+ Opts0 = ct_test_support:get_opts(Config),
+ Level = ?config(trace_level, Config),
+ EvHArgs = [{cbm,ct_test_support},{trace_level,Level}],
+ Opts = Opts0 ++ [{event_handler,{?eh,EvHArgs}}|Test],
+ ERPid = ct_test_support:start_event_receiver(Config),
+ {Opts,ERPid}.
+
+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),
+ Opts),
+
+ TestEvents = events_to_check(Name),
+ ct_test_support:verify_events(TestEvents, Events, Config).
+
+reformat(Events, EH) ->
+ ct_test_support:reformat(Events, EH).
+
+%%%-----------------------------------------------------------------
+%%% TEST EVENTS
+%%%-----------------------------------------------------------------
+events_to_check(Test) ->
+ %% 2 tests (ct:run_test + script_start) is default
+ events_to_check(Test, 2).
+
+events_to_check(_, 0) ->
+ [];
+events_to_check(Test, N) ->
+ test_events(Test) ++ events_to_check(Test, N-1).
+
+
+test_events(_) ->
+ [
+ {?eh,tc_done,{io_test_SUITE,tc1,ok}},
+ {?eh,tc_done,{io_test_SUITE,tc2,ok}},
+ {?eh,tc_done,{io_test_SUITE,tc3,ok}},
+
+ {parallel,
+ [
+ {?eh,tc_start,{io_test_SUITE,tc1}},
+ {?eh,tc_start,{io_test_SUITE,tc2}},
+ {?eh,tc_start,{io_test_SUITE,tc3}},
+ {?eh,tc_done,{io_test_SUITE,tc1,ok}},
+ {?eh,tc_done,{io_test_SUITE,tc2,ok}},
+ {?eh,tc_done,{io_test_SUITE,tc3,ok}},
+ {parallel,
+ [
+ {?eh,tc_start,{io_test_SUITE,tc1}},
+ {?eh,tc_start,{io_test_SUITE,tc2}},
+ {?eh,tc_start,{io_test_SUITE,tc3}},
+ {?eh,tc_done,{io_test_SUITE,tc1,ok}},
+ {?eh,tc_done,{io_test_SUITE,tc2,ok}},
+ {?eh,tc_done,{io_test_SUITE,tc3,ok}},
+ {?eh,test_stats,{9,0,{0,0}}}
+ ]}
+ ]},
+
+ {?eh,test_done,{'DEF','STOP_TIME'}},
+ {?eh,stop_logging,[]}
+ ].
+
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
new file mode 100644
index 0000000000..946e1c1989
--- /dev/null
+++ b/lib/common_test/test/ct_verbosity_SUITE_data/io_test_SUITE.erl
@@ -0,0 +1,156 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(io_test_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+
+%%--------------------------------------------------------------------
+%% @spec suite() -> Info
+%% Info = [tuple()]
+%% @end
+%%--------------------------------------------------------------------
+suite() ->
+ [{timetrap,{seconds,10}}].
+
+%%--------------------------------------------------------------------
+%% @spec init_per_suite(Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+init_per_suite(Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% @spec end_per_suite(Config0) -> void() | {save_config,Config1}
+%% Config0 = Config1 = [tuple()]
+%% @end
+%%--------------------------------------------------------------------
+end_per_suite(_Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% @spec init_per_group(GroupName, Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% GroupName = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+init_per_group(_GroupName, Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% @spec end_per_group(GroupName, Config0) ->
+%% void() | {save_config,Config1}
+%% GroupName = atom()
+%% Config0 = Config1 = [tuple()]
+%% @end
+%%--------------------------------------------------------------------
+end_per_group(_GroupName, _Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% @spec init_per_testcase(TestCase, Config0) ->
+%% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+%% TestCase = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+init_per_testcase(_TestCase, Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+%% @spec end_per_testcase(TestCase, Config0) ->
+%% void() | {save_config,Config1} | {fail,Reason}
+%% TestCase = atom()
+%% Config0 = Config1 = [tuple()]
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+end_per_testcase(_TestCase, _Config) ->
+ ok.
+
+%%--------------------------------------------------------------------
+%% @spec groups() -> [Group]
+%% Group = {GroupName,Properties,GroupsAndTestCases}
+%% GroupName = atom()
+%% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
+%% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]
+%% TestCase = atom()
+%% Shuffle = shuffle | {shuffle,{integer(),integer(),integer()}}
+%% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
+%% repeat_until_any_ok | repeat_until_any_fail
+%% N = integer() | forever
+%% @end
+%%--------------------------------------------------------------------
+groups() ->
+ [{g1, [parallel], [tc1,tc2,tc3,{group,g2}]},
+ {g2, [parallel], [tc1,tc2,tc3]}].
+
+%%--------------------------------------------------------------------
+%% @spec all() -> GroupsAndTestCases | {skip,Reason}
+%% GroupsAndTestCases = [{group,GroupName} | TestCase]
+%% GroupName = atom()
+%% TestCase = atom()
+%% Reason = term()
+%% @end
+%%--------------------------------------------------------------------
+all() ->
+ [tc1,tc2,tc3,{group,g1}].
+
+tc1(_C) ->
+ io:format("This is an io:format(~p)~n", [[]]),
+ ct:log("ct:log(default)", []),
+ ct:log(?STD_IMPORTANCE, "ct:log(default,~p)", [?STD_IMPORTANCE]),
+ ct:log(error, "ct:log(error)", []),
+ ct:log(error, ?STD_IMPORTANCE, "ct:log(error,~p)", [?STD_IMPORTANCE]),
+ ct:log(1, "ct:log(default,~p)", [1]),
+ ct:log(error, 1, "ct:log(error,~p)", [1]),
+ ct:log(99, "ct:log(default,~p)", [99]),
+ ct:log(error, 99, "ct:log(error,~p)", [99]),
+ ok.
+
+tc2(_C) ->
+ io:format("This is an io:format(~p)~n", [[]]),
+ ct:pal("ct:pal(default)", []),
+ ct:pal(?STD_IMPORTANCE, "ct:pal(default,~p)", [?STD_IMPORTANCE]),
+ ct:pal(error, "ct:pal(error)", []),
+ ct:pal(error, ?STD_IMPORTANCE, "ct:pal(error,~p)", [?STD_IMPORTANCE]),
+ ct:pal(1, "ct:pal(default,~p)", [1]),
+ ct:pal(error, 1, "ct:pal(error,~p)", [1]),
+ ct:pal(99, "ct:pal(default,~p)", [99]),
+ ct:pal(error, 99, "ct:pal(error,~p)", [99]),
+ ok.
+
+tc3(_C) ->
+ io:format("This is an io:format(~p)~n", [[]]),
+ ct:print("ct:print(default)", []),
+ ct:print(?STD_IMPORTANCE, "ct:print(default,~p)", [?STD_IMPORTANCE]),
+ ct:print(error, "ct:print(error)", []),
+ ct:print(error, ?STD_IMPORTANCE, "ct:print(error,~p)", [?STD_IMPORTANCE]),
+ ct:print(1, "ct:print(default,~p)", [1]),
+ ct:print(error, 1, "ct:print(error,~p)", [1]),
+ ct:print(99, "ct:print(default,~p)", [99]),
+ ct:print(error, 99, "ct:print(error,~p)", [99]),
+ ok.
diff --git a/lib/common_test/vsn.mk b/lib/common_test/vsn.mk
index 2f43c1bc17..5c9fdfc47e 100644
--- a/lib/common_test/vsn.mk
+++ b/lib/common_test/vsn.mk
@@ -1 +1 @@
-COMMON_TEST_VSN = 1.6
+COMMON_TEST_VSN = 1.6.2.1
diff --git a/lib/compiler/doc/src/Makefile b/lib/compiler/doc/src/Makefile
index ee41a7074f..13a73a5d31 100644
--- a/lib/compiler/doc/src/Makefile
+++ b/lib/compiler/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -99,14 +99,14 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml
index 522c1dc411..27d750f929 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>2011</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -294,6 +294,12 @@ module.beam: module.erl \
describing what it is doing.</p>
</item>
+ <tag><c>{source,FileName}</c></tag>
+ <item>
+ <p>Sets the value of the source, as returned by
+ <c>module_info(compile)</c>.</p>
+ </item>
+
<tag><c>{outdir,Dir}</c></tag>
<item>
<p>Sets a new directory for the object code. The current
@@ -310,7 +316,7 @@ module.beam: module.erl \
<item>
<p>Add <c>Dir</c> to the list of directories to be searched
when including a file. When encountering an
- <c>-include</c> or <c>-include_dir</c> directive,
+ <c>-include</c> or <c>-include_lib</c> directive,
the compiler searches for header files in the following
directories:</p>
<list type="ordered">
@@ -333,7 +339,8 @@ module.beam: module.erl \
<tag><c>{d,Macro,Value}</c></tag>
<item>
<p>Defines a macro <c>Macro</c> to have the value
- <c>Value</c>. The default is <c>true</c>).</p>
+ <c>Value</c>. <c>Macro</c> is of type atom, and <c>Value</c> can be any term.
+ The default <c>Value</c> is <c>true</c>.</p>
</item>
<tag><c>{parse_transform,Module}</c></tag>
diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml
index 3f53a71764..6d51074d4a 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -31,6 +31,151 @@
<p>This document describes the changes made to the Compiler
application.</p>
+<section><title>Compiler 4.8.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Modules with very many functions would compile very
+ slowly.</p>
+ <p>
+ Own Id: OTP-10123</p>
+ </item>
+ <item>
+ <p>
+ <c>compile:forms/2</c> will now use a
+ {source,SourceFilePath} to set the source returned by
+ <c>module_info(compile)</c> (Thanks to Jos� Valim)</p>
+ <p>
+ Own Id: OTP-10150</p>
+ </item>
+ <item>
+ <p>
+ A process which had enabled trap_exit would receive EXIT
+ messages after calling the compiler. (Thanks to Jeremy
+ Heater.)</p>
+ <p>
+ Own Id: OTP-10171</p>
+ </item>
+ <item>
+ <p>
+ Fix messages ordering with column numbers</p>
+ <p>
+ Own Id: OTP-10183</p>
+ </item>
+ <item>
+ <p>
+ sys_pre_expand: Fix BASE never being set</p>
+ <p>
+ Commit a612e99fb5aaa934fe5a8591db0f083d7fa0b20a turned
+ module attributes from 2-tuples to 3-tuples but forgot to
+ update get_base/1, breaking BASE for parametric modules.</p>
+ <p>
+ Own Id: OTP-10184</p>
+ </item>
+ <item>
+ <p>
+ The compiler will now issue a warning if literal tuple
+ funs are used. For example, {erlang,is_tuple}(X) will now
+ generate a warning.</p>
+ <p>
+ Own Id: OTP-10185</p>
+ </item>
+ <item>
+ <p>
+ The compiler will now warn for illegal sizes for segments
+ in binary construction. For example,
+ &lt;&lt;X:(2.5)&gt;&gt; will now cause the compiler to
+ issue a warning.</p>
+ <p>
+ Own Id: OTP-10197</p>
+ </item>
+ <item>
+ <p>
+ Fix the erlc -MP flag</p>
+ <p>
+ Because of a copy-and-paste error in erlc.c, the -MP flag
+ had the same effect as -MG. As a workaround, you had to
+ pass +makedep_phony to enable the MP option. This patch
+ makes -MP work as intended.</p>
+ <p>
+ Own Id: OTP-10211</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Compiler 4.8.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ In rare circumstance, the compiler could crash when
+ compiling a case statement. (Thanks to Hakan Mattsson.)</p>
+ <p>
+ Own Id: OTP-9842</p>
+ </item>
+ <item>
+ <p>Calling a guard test (such as is_list/1) from the
+ top-level in a guard, would cause a compiler crash if
+ there was a local definition with the same name.
+ Corrected to reject the program with an error
+ message.</p>
+ <p>
+ Own Id: OTP-9866</p>
+ </item>
+ <item>
+ <p>Using <c>get/1</c> in a <c>try</c> block could in some
+ cases cause an internal compiler error. (Thanks to Eric
+ Merritt.)</p>
+ <p>
+ Own Id: OTP-9867</p>
+ </item>
+ <item>
+ <p>
+ An unexported on_load function would not get run if the
+ module was compiled with the <c>inline</c> option.
+ (Thanks to Yiannis Tsiouris.)</p>
+ <p>
+ Own Id: OTP-9910</p>
+ </item>
+ <item>
+ <p>
+ Fixed a discrepancy in compile_info</p>
+ <p>
+ The BEAM disassembler used the atom 'none' to signify the
+ absence of a compile_info chunk in a .beam file. This
+ clashed with the type declaration of the compile_info
+ field of a #beam_file{} record as containing a list. Now
+ [] signifies the absence of this chunk. This simplifies
+ the code and avoids a dialyzer warning.</p>
+ <p>
+ Own Id: OTP-9917</p>
+ </item>
+ <item>
+ <p>
+ Fix typo in `compile' doc: unmatched parenthesis (Thanks
+ to Ricardo Catalinas Jim�nez)</p>
+ <p>
+ Own Id: OTP-9919</p>
+ </item>
+ <item>
+ <p>In a <c>try</c>...<c>catch</c> statement that always
+ returned <c>false</c>, the compiler would remove calls to
+ BIFs that could not cause an exception (such as
+ <c>put/2</c>). Example of such code: <c>try put(K, V),
+ false catch _:_ -&gt; false end.</c></p>
+ <p>
+ Own Id: OTP-9982</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Compiler 4.8</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/compiler/src/Makefile b/lib/compiler/src/Makefile
index 3415517fff..958d3501c7 100644
--- a/lib/compiler/src/Makefile
+++ b/lib/compiler/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -163,11 +163,11 @@ $(EBIN)/cerl_inline.beam: $(ESRC)/cerl_inline.erl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
$(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(EXTRA_FILES) \
- $(YRL_FILE) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(INSTALL_FILES) $(RELSYSDIR)/ebin
+ $(YRL_FILE) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(INSTALL_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/compiler/src/beam_disasm.erl b/lib/compiler/src/beam_disasm.erl
index 7103d2390f..62bdc74cc8 100644
--- a/lib/compiler/src/beam_disasm.erl
+++ b/lib/compiler/src/beam_disasm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2012. 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
@@ -182,10 +182,14 @@ process_chunks(F) ->
Literals = beam_disasm_literals(LiteralBin),
Code = beam_disasm_code(CodeBin, Atoms, mk_imports(ImportsList),
StrBin, Lambdas, Literals, Module),
- Attributes = optional_chunk(F, attributes),
+ Attributes =
+ case optional_chunk(F, attributes) of
+ none -> [];
+ Atts when is_list(Atts) -> Atts
+ end,
CompInfo =
case optional_chunk(F, "CInf") of
- none -> none;
+ none -> [];
CompInfoBin when is_binary(CompInfoBin) ->
binary_to_term(CompInfoBin)
end,
@@ -198,7 +202,7 @@ process_chunks(F) ->
end.
%%-----------------------------------------------------------------------
-%% Retrieve an optional chunk or none if the chunk doesn't exist.
+%% Retrieve an optional chunk or return 'none' if the chunk doesn't exist.
%%-----------------------------------------------------------------------
optional_chunk(F, ChunkTag) ->
diff --git a/lib/compiler/src/beam_type.erl b/lib/compiler/src/beam_type.erl
index 6f0ffb5b25..7392f99fb6 100644
--- a/lib/compiler/src/beam_type.erl
+++ b/lib/compiler/src/beam_type.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -29,10 +29,17 @@ module({Mod,Exp,Attr,Fs0,Lc}, _Opts) ->
{ok,{Mod,Exp,Attr,Fs,Lc}}.
function({function,Name,Arity,CLabel,Asm0}) ->
- Asm1 = beam_utils:live_opt(Asm0),
- Asm2 = opt(Asm1, [], tdb_new()),
- Asm = beam_utils:delete_live_annos(Asm2),
- {function,Name,Arity,CLabel,Asm}.
+ try
+ Asm1 = beam_utils:live_opt(Asm0),
+ Asm2 = opt(Asm1, [], tdb_new()),
+ Asm = beam_utils:delete_live_annos(Asm2),
+ {function,Name,Arity,CLabel,Asm}
+ catch
+ Class:Error ->
+ Stack = erlang:get_stacktrace(),
+ io:fwrite("Function: ~w/~w\n", [Name,Arity]),
+ erlang:raise(Class, Error, Stack)
+ end.
%% opt([Instruction], Accumulator, TypeDb) -> {[Instruction'],TypeDb'}
%% Keep track of type information; try to simplify.
diff --git a/lib/compiler/src/beam_utils.erl b/lib/compiler/src/beam_utils.erl
index 116ede0bc9..194f089ba1 100644
--- a/lib/compiler/src/beam_utils.erl
+++ b/lib/compiler/src/beam_utils.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -741,6 +741,9 @@ live_opt([{badmatch,Src}=I|Is], _, D, Acc) ->
live_opt([{case_end,Src}=I|Is], _, D, Acc) ->
Regs = x_live([Src], 0),
live_opt(Is, Regs, D, [I|Acc]);
+live_opt([{try_case_end,Src}=I|Is], _, D, Acc) ->
+ Regs = x_live([Src], 0),
+ live_opt(Is, Regs, D, [I|Acc]);
live_opt([if_end=I|Is], _, D, Acc) ->
Regs = 0,
live_opt(Is, Regs, D, [I|Acc]);
@@ -802,8 +805,6 @@ live_opt([{deallocate,_}=I|Is], Regs, D, Acc) ->
live_opt(Is, Regs, D, [I|Acc]);
live_opt([{kill,_}=I|Is], Regs, D, Acc) ->
live_opt(Is, Regs, D, [I|Acc]);
-live_opt([{try_case_end,_}=I|Is], Regs, D, Acc) ->
- live_opt(Is, Regs, D, [I|Acc]);
live_opt([{try_end,_}=I|Is], Regs, D, Acc) ->
live_opt(Is, Regs, D, [I|Acc]);
live_opt([{loop_rec_end,_}=I|Is], Regs, D, Acc) ->
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl
index a52e7bb761..29758b8fb4 100644
--- a/lib/compiler/src/beam_validator.erl
+++ b/lib/compiler/src/beam_validator.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -783,15 +783,27 @@ valfun_4({bs_utf16_size,{f,Fail},A,Dst}, Vst) ->
valfun_4({bs_bits_to_bytes,{f,Fail},Src,Dst}, Vst) ->
assert_term(Src, Vst),
set_type_reg({integer,[]}, Dst, branch_state(Fail, Vst));
-valfun_4({bs_init2,{f,Fail},_,Heap,Live,_,Dst}, Vst0) ->
+valfun_4({bs_init2,{f,Fail},Sz,Heap,Live,_,Dst}, Vst0) ->
verify_live(Live, Vst0),
+ if
+ is_integer(Sz) ->
+ ok;
+ true ->
+ assert_term(Sz, Vst0)
+ end,
Vst1 = heap_alloc(Heap, Vst0),
Vst2 = branch_state(Fail, Vst1),
Vst3 = prune_x_regs(Live, Vst2),
Vst = bs_zero_bits(Vst3),
set_type_reg(binary, Dst, Vst);
-valfun_4({bs_init_bits,{f,Fail},_,Heap,Live,_,Dst}, Vst0) ->
+valfun_4({bs_init_bits,{f,Fail},Sz,Heap,Live,_,Dst}, Vst0) ->
verify_live(Live, Vst0),
+ if
+ is_integer(Sz) ->
+ ok;
+ true ->
+ assert_term(Sz, Vst0)
+ end,
Vst1 = heap_alloc(Heap, Vst0),
Vst2 = branch_state(Fail, Vst1),
Vst3 = prune_x_regs(Live, Vst2),
diff --git a/lib/compiler/src/cerl_inline.erl b/lib/compiler/src/cerl_inline.erl
index c15103999f..2e7554c1ff 100644
--- a/lib/compiler/src/cerl_inline.erl
+++ b/lib/compiler/src/cerl_inline.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -1262,8 +1262,9 @@ i_receive_1(E, Cs, T, B, S) ->
i_module(E, Ctxt, Ren, Env, S) ->
%% Cf. `i_letrec'. Note that we pass a dummy constant value for the
%% "body" parameter.
+ Exps = i_module_exports(E),
{Es, _, Xs1, S1} = i_letrec(module_defs(E), void(),
- module_exports(E), Ctxt, Ren, Env, S),
+ Exps, Ctxt, Ren, Env, S),
%% Sanity check:
case Es of
[] ->
@@ -1276,6 +1277,27 @@ i_module(E, Ctxt, Ren, Env, S) ->
E1 = update_c_module(E, module_name(E), Xs1, module_attrs(E), Es),
{E1, count_size(weight(module), S1)}.
+i_module_exports(E) ->
+ %% If a function is named in an `on_load' attribute, we will
+ %% pretend that it is exported to ensure that it will not be removed.
+ Exps = module_exports(E),
+ Attrs = module_attrs(E),
+ case i_module_on_load(Attrs) of
+ none ->
+ Exps;
+ [{_,_}=FA] ->
+ ordsets:add_element(c_var(FA), Exps)
+ end.
+
+i_module_on_load([{Key,Val}|T]) ->
+ case concrete(Key) of
+ on_load ->
+ concrete(Val);
+ _ ->
+ i_module_on_load(T)
+ end;
+i_module_on_load([]) -> none.
+
%% Binary-syntax expressions are too complicated to do anything
%% interesting with here - that is beyond the scope of this program;
%% also, their construction could have side effects, so even in effect
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index 9b505ad15c..0a368df5d6 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -146,10 +146,17 @@ env_default_opts() ->
do_compile(Input, Opts0) ->
Opts = expand_opts(Opts0),
- Self = self(),
- Serv = spawn_link(fun() -> internal(Self, Input, Opts) end),
+ {Pid,Ref} =
+ spawn_monitor(fun() ->
+ exit(try
+ internal(Input, Opts)
+ catch
+ error:Reason ->
+ {error,Reason}
+ end)
+ end),
receive
- {Serv,Rep} -> Rep
+ {'DOWN',Ref,process,Pid,Rep} -> Rep
end.
expand_opts(Opts0) ->
@@ -242,15 +249,12 @@ format_error({module_name,Mod,Filename}) ->
errors=[],
warnings=[]}).
-internal(Master, Input, Opts) ->
- Master ! {self(), try internal(Input, Opts)
- catch error:Reason -> {error, Reason}
- end}.
-
-internal({forms,Forms}, Opts) ->
- {_,Ps} = passes(forms, Opts),
- internal_comp(Ps, "", "", #compile{code=Forms,options=Opts,
- mod_options=Opts});
+internal({forms,Forms}, Opts0) ->
+ {_,Ps} = passes(forms, Opts0),
+ Source = proplists:get_value(source, Opts0, ""),
+ Opts1 = proplists:delete(source, Opts0),
+ Compile = #compile{code=Forms,options=Opts1,mod_options=Opts1},
+ internal_comp(Ps, Source, "", Compile);
internal({file,File}, Opts) ->
{Ext,Ps} = passes(file, Opts),
Compile = #compile{options=Opts,mod_options=Opts},
diff --git a/lib/compiler/src/sys_core_fold.erl b/lib/compiler/src/sys_core_fold.erl
index 5b155398dc..18fba7962b 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -150,14 +150,26 @@ guard(Expr, Sub) ->
opt_guard_try(#c_seq{arg=Arg,body=Body0}=Seq) ->
Body = opt_guard_try(Body0),
case {Arg,Body} of
- {#c_call{},#c_literal{val=false}} ->
- %% We have sequence consisting of a call (evaluted
- %% for a possible exception only), followed by 'false'.
- %% Since the sequence is inside a try block that will
+ {#c_call{module=#c_literal{val=Mod},
+ name=#c_literal{val=Name},
+ args=Args},#c_literal{val=false}} ->
+ %% We have sequence consisting of a call (evaluated
+ %% for a possible exception and/or side effect only),
+ %% followed by 'false'.
+ %% Since the sequence is inside a try block that will
%% default to 'false' if any exception occurs, not
%% evalutating the call will not change the behaviour
- %% of the guard.
- Body;
+ %% provided that the call has no side effects.
+ case erl_bifs:is_pure(Mod, Name, length(Args)) of
+ false ->
+ %% Not a pure BIF (meaning that this is not
+ %% a guard and that we must keep the call).
+ Seq#c_seq{body=Body};
+ true ->
+ %% The BIF has no side effects, so it can
+ %% be safely removed.
+ Body
+ end;
{_,_} ->
Seq#c_seq{body=Body}
end;
@@ -1747,36 +1759,26 @@ opt_bool_clauses([_|_], _, _) ->
%% end. NewVar ->
%% erlang:error(badarg)
%% end.
-%%
-%% We add the extra match-all clause at the end only if Expr is
-%% not guaranteed to evaluate to a boolean.
opt_bool_not(#c_case{arg=Arg,clauses=Cs0}=Case0) ->
case Arg of
#c_call{anno=Anno,module=#c_literal{val=erlang},
name=#c_literal{val='not'},
args=[Expr]} ->
- Cs = opt_bool_not(Anno, Expr, Cs0),
+ Cs = [opt_bool_not_invert(C) || C <- Cs0] ++
+ [#c_clause{anno=[compiler_generated],
+ pats=[#c_var{name=cor_variable}],
+ guard=#c_literal{val=true},
+ body=#c_call{anno=Anno,
+ module=#c_literal{val=erlang},
+ name=#c_literal{val=error},
+ args=[#c_literal{val=badarg}]}}],
Case = Case0#c_case{arg=Expr,clauses=Cs},
opt_bool_not(Case);
_ ->
opt_bool_case_redundant(Case0)
end.
-opt_bool_not(Anno, Expr, Cs) ->
- Tail = case is_bool_expr(Expr) of
- false ->
- [#c_clause{anno=[compiler_generated],
- pats=[#c_var{name=cor_variable}],
- guard=#c_literal{val=true},
- body=#c_call{anno=Anno,
- module=#c_literal{val=erlang},
- name=#c_literal{val=error},
- args=[#c_literal{val=badarg}]}}];
- true -> []
- end,
- [opt_bool_not_invert(C) || C <- Cs] ++ Tail.
-
opt_bool_not_invert(#c_clause{pats=[#c_literal{val=Bool}]}=C) ->
C#c_clause{pats=[#c_literal{val=not Bool}]}.
@@ -2065,32 +2067,7 @@ opt_case_in_let_2(V, Arg0,
(_) -> false end, Es), %Only variables in tuple
false = core_lib:is_var_used(V, B), %Built tuple must not be used.
Arg1 = tuple_to_values(Arg0, length(Es)), %Might fail.
- #c_let{vars=Es,arg=Arg1,body=B};
-opt_case_in_let_2(_, Arg, Cs) ->
- %% simplify_bool_case(Case0) -> Case
- %% Remove unecessary cases like
- %%
- %% case BoolExpr of
- %% true -> true;
- %% false -> false;
- %% ....
- %% end
- %%
- %% where BoolExpr is an expression that can only return true
- %% or false (or throw an exception).
-
- true = is_bool_case(Cs) andalso is_bool_expr(Arg),
- Arg.
-
-is_bool_case([A,B|_]) ->
- (is_bool_clause(true, A) andalso is_bool_clause(false, B))
- orelse (is_bool_clause(false, A) andalso is_bool_clause(true, B)).
-
-is_bool_clause(Bool, #c_clause{pats=[#c_literal{val=Bool}],
- guard=#c_literal{val=true},
- body=#c_literal{val=Bool}}) ->
- true;
-is_bool_clause(_, _) -> false.
+ #c_let{vars=Es,arg=Arg1,body=B}.
%% is_simple_case_arg(Expr) -> true|false
%% Determine whether the Expr is simple enough to be worth
@@ -2612,14 +2589,14 @@ bsm_maybe_ctx_to_binary(V, B) ->
body=B}
end.
-previous_ctx_to_binary(V, #c_seq{arg=#c_primop{name=Name,args=As}}) ->
- case {Name,As} of
- {#c_literal{val=bs_context_to_binary},[#c_var{name=V}]} ->
+previous_ctx_to_binary(V, Core) ->
+ case Core of
+ #c_seq{arg=#c_primop{name=#c_literal{val=bs_context_to_binary},
+ args=[#c_var{name=V}]}} ->
true;
- {_,_} ->
+ _ ->
false
- end;
-previous_ctx_to_binary(_, _) -> false.
+ end.
%% bsm_leftmost(Cs) -> none | ArgumentNumber
%% Find the leftmost argument that does binary matching. Return
@@ -2764,22 +2741,20 @@ add_bin_opt_info(Core, Term) ->
end.
add_warning(Core, Term) ->
- Anno = core_lib:get_anno(Core),
- case lists:member(compiler_generated, Anno) of
- true -> ok;
+ case is_compiler_generated(Core) of
+ true ->
+ ok;
false ->
- case get_line(Anno) of
- Line when Line >= 0 -> %Must be positive.
- File = get_file(Anno),
- Key = {?MODULE,warnings},
- case get(Key) of
- [{File,[{Line,?MODULE,Term}]}|_] ->
- ok; %We already have
+ Anno = core_lib:get_anno(Core),
+ Line = get_line(Anno),
+ File = get_file(Anno),
+ Key = {?MODULE,warnings},
+ case get(Key) of
+ [{File,[{Line,?MODULE,Term}]}|_] ->
+ ok; %We already have
%an identical warning.
- Ws ->
- put(Key, [{File,[{Line,?MODULE,Term}]}|Ws])
- end;
- _ -> ok %Compiler-generated code.
+ Ws ->
+ put(Key, [{File,[{Line,?MODULE,Term}]}|Ws])
end
end.
@@ -2793,14 +2768,7 @@ get_file([]) -> "no_file". % should not happen
is_compiler_generated(Core) ->
Anno = core_lib:get_anno(Core),
- case lists:member(compiler_generated, Anno) of
- true -> true;
- false ->
- case get_line(Anno) of
- Line when Line >= 0 -> false;
- _ -> true
- end
- end.
+ member(compiler_generated, Anno).
get_warnings() ->
ordsets:from_list((erase({?MODULE,warnings}))).
diff --git a/lib/compiler/src/sys_pre_expand.erl b/lib/compiler/src/sys_pre_expand.erl
index ba9cde1de0..e55fb2a037 100644
--- a/lib/compiler/src/sys_pre_expand.erl
+++ b/lib/compiler/src/sys_pre_expand.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -42,7 +42,7 @@
compile=[], %Compile flags
attributes=[], %Attributes
callbacks=[], %Callbacks
- defined=[], %Defined functions
+ defined, %Defined functions (gb_set)
vcount=0, %Variable counter
func=[], %Current function
arity=[], %Arity for current function
@@ -83,7 +83,7 @@ module(Fs0, Opts0) ->
{Efs,St2} = expand_pmod(Tfs, St1),
%% Get the correct list of exported functions.
Exports = case member(export_all, St2#expand.compile) of
- true -> St2#expand.defined;
+ true -> gb_sets:to_list(St2#expand.defined);
false -> St2#expand.exports
end,
%% Generate all functions from stored info.
@@ -106,10 +106,11 @@ expand_pmod(Fs0, St0) ->
true ->
Ps0
end,
+ Def = gb_sets:to_list(St0#expand.defined),
{Fs1,Xs,Ds} = sys_expand_pmod:forms(Fs0, Ps,
St0#expand.exports,
- St0#expand.defined),
- St1 = St0#expand{exports=Xs, defined=Ds},
+ Def),
+ St1 = St0#expand{exports=Xs,defined=gb_sets:from_list(Ds)},
{Fs2,St2} = add_instance(Ps, Fs1, St1),
{Fs3,St3} = ensure_new(Base, Ps0, Fs2, St2),
{Fs3,St3#expand{attributes = [{abstract, 0, [true]}
@@ -118,7 +119,7 @@ expand_pmod(Fs0, St0) ->
get_base(As) ->
case lists:keyfind(extends, 1, As) of
- {extends,[Base]} when is_atom(Base) ->
+ {extends,_,[Base]} when is_atom(Base) ->
Base;
_ ->
[]
@@ -159,7 +160,7 @@ add_func(Name, Args, Body, Fs, St) ->
F = {function,0,Name,A,[{clause,0,Args,[],Body}]},
NA = {Name,A},
{[F|Fs],St#expand{exports=add_element(NA, St#expand.exports),
- defined=add_element(NA, St#expand.defined)}}.
+ defined=gb_sets:add_element(NA, St#expand.defined)}}.
%% define_function(Form, State) -> State.
%% Add function to defined if form is a function.
@@ -168,7 +169,7 @@ define_functions(Forms, #expand{defined=Predef}=St) ->
Fs = foldl(fun({function,_,N,A,_Cs}, Acc) -> [{N,A}|Acc];
(_, Acc) -> Acc
end, Predef, Forms),
- St#expand{defined=ordsets:from_list(Fs)}.
+ St#expand{defined=gb_sets:from_list(Fs)}.
module_attrs(#expand{attributes=Attributes}=St) ->
Attrs = [{attribute,Line,Name,Val} || {Name,Line,Val} <- Attributes],
@@ -187,7 +188,7 @@ module_predef_func_beh_info(#expand{callbacks=Callbacks,defined=Defined,
PreDef=[{behaviour_info,1}],
PreExp=PreDef,
{[gen_beh_info(Callbacks)],
- St#expand{defined=union(from_list(PreDef), Defined),
+ St#expand{defined=gb_sets:union(gb_sets:from_list(PreDef), Defined),
exports=union(from_list(PreExp), Exports)}}.
gen_beh_info(Callbacks) ->
@@ -215,7 +216,8 @@ module_predef_funcs_mod_info(St) ->
[{clause,0,[{var,0,'X'}],[],
[{call,0,{remote,0,{atom,0,erlang},{atom,0,get_module_info}},
[{atom,0,St#expand.module},{var,0,'X'}]}]}]}],
- St#expand{defined=union(from_list(PreDef), St#expand.defined),
+ St#expand{defined=gb_sets:union(gb_sets:from_list(PreDef),
+ St#expand.defined),
exports=union(from_list(PreExp), St#expand.exports)}}.
%% forms(Forms, State) ->
@@ -452,9 +454,6 @@ expr({call,Line,{remote,Lr,M,F},As0}, St0) ->
M1 = expand_package(M, St0),
{[M2,F1|As1],St1} = expr_list([M1,F|As0], St0),
{{call,Line,{remote,Lr,M2,F1},As1},St1};
-expr({call,Line,{tuple,_,[{atom,_,_}=M,{atom,_,_}=F]},As}, St) ->
- %% Rewrite {Mod,Function}(Args...) to Mod:Function(Args...).
- expr({call,Line,{remote,Line,M,F},As}, St);
expr({call,Line,F,As0}, St0) ->
{[Fun1|As1],St1} = expr_list([F|As0], St0),
{{call,Line,Fun1,As1},St1};
@@ -721,4 +720,4 @@ imported(F, A, St) ->
end.
defined(F, A, St) ->
- ordsets:is_element({F,A}, St#expand.defined).
+ gb_sets:is_element({F,A}, St#expand.defined).
diff --git a/lib/compiler/src/v3_codegen.erl b/lib/compiler/src/v3_codegen.erl
index 6623485609..be15495672 100644
--- a/lib/compiler/src/v3_codegen.erl
+++ b/lib/compiler/src/v3_codegen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -1423,20 +1423,7 @@ set_cg([{var,R}], Con, Le, Vdb, Bef, St) ->
Other ->
[{move,Other,Ret}]
end,
- {Ais,clear_dead(Int, Le#l.i, Vdb),St};
-set_cg([], {binary,Segs}, Le, Vdb, Bef, St) ->
- Fail = {f,St#cg.bfail},
- Target = find_scratch_reg(Bef#sr.reg),
- Temp = find_scratch_reg(put_reg(Target, Bef#sr.reg)),
- PutCode = cg_bin_put(Segs, Fail, Bef),
- MaxRegs = max_reg(Bef#sr.reg),
- Code = cg_binary(PutCode, Target, Temp, Fail, MaxRegs, Le#l.a),
- Aft = clear_dead(Bef, Le#l.i, Vdb),
- {Code,Aft,St};
-set_cg([], _, Le, Vdb, Bef, St) ->
- %% This should have been stripped by compiler, just cleanup.
- {[],clear_dead(Bef, Le#l.i, Vdb), St}.
-
+ {Ais,clear_dead(Int, Le#l.i, Vdb),St}.
%%%
%%% Code generation for constructing binaries.
@@ -2067,7 +2054,7 @@ line_1(_, 0) ->
%% Missing line number or line number 0.
{line,[]};
line_1(Name, Line) ->
- {line,[{location,Name,abs(Line)}]}.
+ {line,[{location,Name,Line}]}.
find_loc([Line|T], File, _) when is_integer(Line) ->
find_loc(T, File, Line);
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl
index 6885405ae0..01042cc56f 100644
--- a/lib/compiler/src/v3_core.erl
+++ b/lib/compiler/src/v3_core.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -823,6 +823,13 @@ bitstr({bin_element,_,E0,Size0,[Type,{unit,Unit}|Flags]}, St0) ->
{_,_} ->
throw(bad_binary)
end,
+ case Size1 of
+ #c_var{} -> ok;
+ #c_literal{val=Sz} when is_integer(Sz), Sz >= 0 -> ok;
+ #c_literal{val=undefined} -> ok;
+ #c_literal{val=all} -> ok;
+ _ -> throw(bad_binary)
+ end,
{#c_bitstr{val=E1,size=Size1,
unit=#c_literal{val=Unit},
type=#c_literal{val=Type},
@@ -2085,7 +2092,12 @@ bitstr_vars(Segs, Vs) ->
lineno_anno(L, St) ->
{line, Line} = erl_parse:get_attribute(L, line),
- [Line] ++ St#core.file.
+ if
+ Line < 0 ->
+ [-Line] ++ St#core.file ++ [compiler_generated];
+ true ->
+ [Line] ++ St#core.file
+ end.
get_ianno(Ce) ->
case get_anno(Ce) of
diff --git a/lib/compiler/src/v3_kernel.erl b/lib/compiler/src/v3_kernel.erl
index f2eaa37617..b184987625 100644
--- a/lib/compiler/src/v3_kernel.erl
+++ b/lib/compiler/src/v3_kernel.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -88,8 +88,6 @@
-include("core_parse.hrl").
-include("v3_kernel.hrl").
--define(EXPENSIVE_BINARY_LIMIT, 256).
-
%% These are not defined in v3_kernel.hrl.
get_kanno(Kthing) -> element(2, Kthing).
set_kanno(Kthing, Anno) -> setelement(2, Kthing, Anno).
@@ -120,7 +118,6 @@ copy_anno(Kdst, Ksrc) ->
funs=[], %Fun functions
free=[], %Free variables
ws=[] :: [warning()], %Warnings.
- lit, %Constant pool for literals.
guard_refc=0}). %> 0 means in guard
-spec module(cerl:c_module(), [compile:option()]) ->
@@ -129,7 +126,7 @@ copy_anno(Kdst, Ksrc) ->
module(#c_module{anno=A,name=M,exports=Es,attrs=As,defs=Fs}, _Options) ->
Kas = attributes(As),
Kes = map(fun (#c_var{name={_,_}=Fname}) -> Fname end, Es),
- St0 = #kern{lit=dict:new()},
+ St0 = #kern{},
{Kfs,St} = mapfoldl(fun function/2, St0, Fs),
{ok,#k_mdef{anno=A,name=M#c_literal.val,exports=Kes,attributes=Kas,
body=Kfs ++ St#kern.funs},lists:sort(St#kern.ws)}.
@@ -250,26 +247,20 @@ expr(#c_var{anno=A,name={_Name,Arity}}=Fname, Sub, St) ->
expr(Fun, Sub, St);
expr(#c_var{anno=A,name=V}, Sub, St) ->
{#k_var{anno=A,name=get_vsub(V, Sub)},[],St};
-expr(#c_literal{}=Lit, Sub, St) ->
- Core = handle_literal(Lit),
- expr(Core, Sub, St);
-expr(#k_literal{val=Val0}=Klit, _Sub, #kern{lit=Literals0}=St) ->
- %% Share identical literals to save some space and time during compilation.
- case dict:find(Val0, Literals0) of
- {ok,Val} ->
- {Klit#k_literal{val=Val},[],St};
- error ->
- Literals = dict:store(Val0, Val0, Literals0),
- {Klit,[],St#kern{lit=Literals}}
- end;
-expr(#k_nil{}=V, _Sub, St) ->
- {V,[],St};
-expr(#k_int{}=V, _Sub, St) ->
- {V,[],St};
-expr(#k_float{}=V, _Sub, St) ->
- {V,[],St};
-expr(#k_atom{}=V, _Sub, St) ->
- {V,[],St};
+expr(#c_literal{anno=A,val=V}, _Sub, St) ->
+ Klit = case V of
+ [] ->
+ #k_nil{anno=A};
+ V when is_integer(V) ->
+ #k_int{anno=A,val=V};
+ V when is_float(V) ->
+ #k_float{anno=A,val=V};
+ V when is_atom(V) ->
+ #k_atom{anno=A,val=V};
+ _ ->
+ #k_literal{anno=A,val=V}
+ end,
+ {Klit,[],St};
expr(#c_cons{anno=A,hd=Ch,tl=Ct}, Sub, St0) ->
%% Do cons in two steps, first the expressions left to right, then
%% any remaining literals right to left.
@@ -287,11 +278,12 @@ expr(#c_binary{anno=A,segments=Cv}, Sub, St0) ->
{#k_binary{anno=A,segs=Kv},Ep,St1}
catch
throw:bad_element_size ->
+ St1 = add_warning(get_line(A), bad_segment_size, A, St0),
Erl = #c_literal{val=erlang},
Name = #c_literal{val=error},
Args = [#c_literal{val=badarg}],
Error = #c_call{anno=A,module=Erl,name=Name,args=Args},
- expr(Error, Sub, St0)
+ expr(Error, Sub, St1)
end;
expr(#c_fun{anno=A,vars=Cvs,body=Cb}, Sub0, #kern{ff=OldFF,func=Func}=St0) ->
FA = case OldFF of
@@ -610,7 +602,6 @@ is_atomic(#k_int{}) -> true;
is_atomic(#k_float{}) -> true;
is_atomic(#k_atom{}) -> true;
%%is_atomic(#k_char{}) -> true; %No characters
-%%is_atomic(#k_string{}) -> true;
is_atomic(#k_nil{}) -> true;
is_atomic(#k_var{}) -> true;
is_atomic(_) -> false.
@@ -919,9 +910,8 @@ match_guard_1([#iclause{anno=A,osub=Osub,guard=G,body=B}|Cs0], Def0, St0) ->
true ->
%% The true clause body becomes the default.
{Kb,Pb,St1} = body(B, Osub, St0),
- Line = get_line(A),
- St2 = maybe_add_warning(Cs0, Line, St1),
- St = maybe_add_warning(Def0, Line, St2),
+ St2 = maybe_add_warning(Cs0, A, St1),
+ St = maybe_add_warning(Def0, A, St2),
{[],pre_seq(Pb, Kb),St};
false ->
{Kg,St1} = guard(G, Osub, St0),
@@ -932,15 +922,18 @@ match_guard_1([#iclause{anno=A,osub=Osub,guard=G,body=B}|Cs0], Def0, St0) ->
end;
match_guard_1([], Def, St) -> {[],Def,St}.
-maybe_add_warning([C|_], Line, St) ->
- maybe_add_warning(C, Line, St);
-maybe_add_warning([], _Line, St) -> St;
-maybe_add_warning(fail, _Line, St) -> St;
-maybe_add_warning(Ke, MatchLine, St) ->
- case get_kanno(Ke) of
- [compiler_generated|_] -> St;
- Anno ->
+maybe_add_warning([C|_], MatchAnno, St) ->
+ maybe_add_warning(C, MatchAnno, St);
+maybe_add_warning([], _MatchAnno, St) -> St;
+maybe_add_warning(fail, _MatchAnno, St) -> St;
+maybe_add_warning(Ke, MatchAnno, St) ->
+ case is_compiler_generated(Ke) of
+ true ->
+ St;
+ false ->
+ Anno = get_kanno(Ke),
Line = get_line(Anno),
+ MatchLine = get_line(MatchAnno),
Warn = case MatchLine of
none -> nomatch_shadow;
_ -> {nomatch_shadow,MatchLine}
@@ -1122,7 +1115,6 @@ select_bin_int([#iclause{pats=[#k_bin_seg{anno=A,type=integer,
end,
select_assert_match_possible(Bits, Val, Fl),
P = #k_bin_int{anno=A,size=Sz,unit=U,flags=Fl,val=Val,next=N},
- select_assert_match_possible(Bits, Val, Fl),
case member(native, Fl) of
true -> throw(not_possible);
false -> ok
@@ -1264,8 +1256,6 @@ match_clause([U|Us], [C|_]=Cs0, Def, St0) ->
sub_size_var(#k_bin_seg{size=#k_var{name=Name}=Kvar}=BinSeg, [#iclause{isub=Sub}|_]) ->
BinSeg#k_bin_seg{size=Kvar#k_var{name=get_vsub(Name, Sub)}};
-sub_size_var(#k_bin_int{size=#k_var{name=Name}=Kvar}=BinSeg, [#iclause{isub=Sub}|_]) ->
- BinSeg#k_bin_int{size=Kvar#k_var{name=get_vsub(Name, Sub)}};
sub_size_var(K, _) -> K.
get_con([C|_]) -> arg_arg(clause_arg(C)). %Get the constructor
@@ -1383,7 +1373,6 @@ arg_con(Arg) ->
#k_tuple{} -> k_tuple;
#k_binary{} -> k_binary;
#k_bin_end{} -> k_bin_end;
- #k_bin_int{} -> k_bin_int;
#k_bin_seg{} -> k_bin_seg;
#k_var{} -> k_var
end.
@@ -1394,15 +1383,9 @@ arg_val(Arg) ->
#k_int{val=I} -> I;
#k_float{val=F} -> F;
#k_atom{val=A} -> A;
- #k_nil{} -> 0;
- #k_cons{} -> 2;
#k_tuple{es=Es} -> length(Es);
#k_bin_seg{size=S,unit=U,type=T,flags=Fs} ->
- {set_kanno(S, []),U,T,Fs};
- #k_bin_int{} ->
- 0;
- #k_bin_end{} -> 0;
- #k_binary{} -> 0
+ {set_kanno(S, []),U,T,Fs}
end.
%% ubody_used_vars(Expr, State) -> [UsedVar]
@@ -1432,14 +1415,12 @@ ubody(#ivalues{anno=A,args=As}, return, St) ->
{#k_return{anno=#k{us=Au,ns=[],a=A},args=As},Au,St};
ubody(#ivalues{anno=A,args=As}, {break,_Vbs}, St) ->
Au = lit_list_vars(As),
- if St#kern.guard_refc > 0 ->
+ case is_in_guard(St) of
+ true ->
{#k_guard_break{anno=#k{us=Au,ns=[],a=A},args=As},Au,St};
- true ->
+ false ->
{#k_break{anno=#k{us=Au,ns=[],a=A},args=As},Au,St}
end;
-ubody(#ivalues{anno=A,args=As}, {guard_break,_Vbs}, St) ->
- Au = lit_list_vars(As),
- {#k_guard_break{anno=#k{us=Au,ns=[],a=A},args=As},Au,St};
ubody(E, return, St0) ->
%% Enterable expressions need no trailing return.
case is_enter_expr(E) of
@@ -1456,12 +1437,7 @@ ubody(E, {break,_Rs} = Break, St0) ->
false ->
{Ea,Pa,St1} = force_atomic(E, St0),
ubody(pre_seq(Pa, #ivalues{args=[Ea]}), Break, St1)
- end;
-ubody(E, {guard_break,_Rs} = GuardBreak, St0) ->
- %%ok = io:fwrite("ubody ~w:~p~n", [?LINE,{E,Br}]),
- %% Exiting expressions need no trailing break.
- {Ea,Pa,St1} = force_atomic(E, St0),
- ubody(pre_seq(Pa, #ivalues{args=[Ea]}), GuardBreak, St1).
+ end.
iletrec_funs(#iletrec{defs=Fs}, St0) ->
%% Use union of all free variables.
@@ -1513,64 +1489,21 @@ is_enter_expr(#k_receive{}) -> true;
is_enter_expr(#k_receive_next{}) -> true;
is_enter_expr(_) -> false.
-%% uguard(Expr, State) -> {Expr,[UsedVar],State}.
-%% Tag the guard sequence with its used variables.
-
-uguard(#k_try{anno=A,arg=B0,vars=[#k_var{name=X}],body=#k_var{name=X},
- handler=#k_atom{val=false}}=Try, St0) ->
- {B1,Bu,St1} = uguard(B0, St0),
- {Try#k_try{anno=#k{us=Bu,ns=[],a=A},arg=B1},Bu,St1};
-uguard(T, St) ->
- %%ok = io:fwrite("~w: ~p~n", [?LINE,T]),
- uguard_test(T, St).
-
-%% uguard_test(Expr, State) -> {Test,[UsedVar],State}.
-%% At this stage tests are just expressions which don't return any
-%% values.
-
-uguard_test(T, St) -> uguard_expr(T, [], St).
+%% uexpr(Expr, Break, State) -> {Expr,[UsedVar],State}.
+%% Tag an expression with its used variables.
+%% Break = return | {break,[RetVar]}.
-uguard_expr(#iset{anno=A,vars=Vs,arg=E0,body=B0}, Rs, St0) ->
- Ns = lit_list_vars(Vs),
- {E1,Eu,St1} = uguard_expr(E0, Vs, St0),
- {B1,Bu,St2} = uguard_expr(B0, Rs, St1),
- Used = union(Eu, subtract(Bu, Ns)),
- {#k_seq{anno=#k{us=Used,ns=Ns,a=A},arg=E1,body=B1},Used,St2};
-uguard_expr(#k_try{anno=A,arg=B0,vars=[#k_var{name=X}],body=#k_var{name=X},
- handler=#k_atom{val=false}}=Try, Rs, St0) ->
- {B1,Bu,St1} = uguard_expr(B0, Rs, St0),
- {Try#k_try{anno=#k{us=Bu,ns=lit_list_vars(Rs),a=A},arg=B1,ret=Rs},
- Bu,St1};
-uguard_expr(#k_test{anno=A,op=Op,args=As}=Test, Rs, St) ->
+uexpr(#k_test{anno=A,op=Op,args=As}=Test, {break,Rs}, St) ->
[] = Rs, %Sanity check
Used = union(op_vars(Op), lit_list_vars(As)),
{Test#k_test{anno=#k{us=Used,ns=lit_list_vars(Rs),a=A}},
Used,St};
-uguard_expr(#k_bif{anno=A,op=Op,args=As}=Bif, Rs, St) ->
- Used = union(op_vars(Op), lit_list_vars(As)),
- {Bif#k_bif{anno=#k{us=Used,ns=lit_list_vars(Rs),a=A},ret=Rs},
- Used,St};
-uguard_expr(#ivalues{anno=A,args=As}, Rs, St) ->
- Sets = foldr2(fun (V, Arg, Rhs) ->
- #iset{anno=A,vars=[V],arg=Arg,body=Rhs}
- end, #k_atom{val=true}, Rs, As),
- uguard_expr(Sets, [], St);
-uguard_expr(#k_match{anno=A,vars=Vs,body=B0}, Rs, St0) ->
- %% Experimental support for andalso/orelse in guards.
- Br = {guard_break,Rs},
- {B1,Bu,St1} = umatch(B0, Br, St0),
- {#k_guard_match{anno=#k{us=Bu,ns=lit_list_vars(Rs),a=A},
- vars=Vs,body=B1,ret=Rs},Bu,St1};
-uguard_expr(Lit, Rs, St) ->
- %% Transform literals to puts here.
- Used = lit_vars(Lit),
- {#k_put{anno=#k{us=Used,ns=lit_list_vars(Rs),a=get_kanno(Lit)},
- arg=Lit,ret=Rs},Used,St}.
-
-%% uexpr(Expr, Break, State) -> {Expr,[UsedVar],State}.
-%% Tag an expression with its used variables.
-%% Break = return | {break,[RetVar]}.
-
+uexpr(#iset{anno=A,vars=Vs,arg=E0,body=B0}, {break,_}=Br, St0) ->
+ Ns = lit_list_vars(Vs),
+ {E1,Eu,St1} = uexpr(E0, {break,Vs}, St0),
+ {B1,Bu,St2} = uexpr(B0, Br, St1),
+ Used = union(Eu, subtract(Bu, Ns)),
+ {#k_seq{anno=#k{us=Used,ns=Ns,a=A},arg=E1,body=B1},Used,St2};
uexpr(#k_call{anno=A,op=#k_local{name=F,arity=Ar}=Op,args=As0}=Call, Br, St) ->
Free = get_free(F, Ar, St),
As1 = As0 ++ Free, %Add free variables LAST!
@@ -1602,10 +1535,11 @@ uexpr(#k_match{anno=A,vars=Vs0,body=B0}, Br, St0) ->
Vs = handle_reuse_annos(Vs0, St0),
Rs = break_rets(Br),
{B1,Bu,St1} = umatch(B0, Br, St0),
- if St0#kern.guard_refc > 0 ->
+ case is_in_guard(St1) of
+ true ->
{#k_guard_match{anno=#k{us=Bu,ns=lit_list_vars(Rs),a=A},
vars=Vs,body=B1,ret=Rs},Bu,St1};
- true ->
+ false ->
{#k_match{anno=#k{us=Bu,ns=lit_list_vars(Rs),a=A},
vars=Vs,body=B1,ret=Rs},Bu,St1}
end;
@@ -1622,24 +1556,27 @@ uexpr(#k_receive_accept{anno=A}, _, St) ->
{#k_receive_accept{anno=#k{us=[],ns=[],a=A}},[],St};
uexpr(#k_receive_next{anno=A}, _, St) ->
{#k_receive_next{anno=#k{us=[],ns=[],a=A}},[],St};
-uexpr(#k_try{anno=A,arg=A0,vars=Vs,body=B0,evars=Evs,handler=H0},
- {break,Rs0}, St0) ->
- {Avs,St1} = new_vars(length(Vs), St0), %Need dummy names here
- {A1,Au,St2} = ubody(A0, {break,Avs}, St1), %Must break to clean up here!
- {B1,Bu,St3} = ubody(B0, {break,Rs0}, St2),
- {H1,Hu,St4} = ubody(H0, {break,Rs0}, St3),
- %% Guarantee ONE return variable.
- NumNew = if
- Rs0 =:= [] -> 1;
- true -> 0
- end,
- {Ns,St5} = new_vars(NumNew, St4),
- Rs1 = Rs0 ++ Ns,
- Used = union([Au,subtract(Bu, lit_list_vars(Vs)),
- subtract(Hu, lit_list_vars(Evs))]),
- {#k_try{anno=#k{us=Used,ns=lit_list_vars(Rs1),a=A},
- arg=A1,vars=Vs,body=B1,evars=Evs,handler=H1,ret=Rs1},
- Used,St5};
+uexpr(#k_try{anno=A,arg=A0,vars=Vs,body=B0,evars=Evs,handler=H0}=Try,
+ {break,Rs0}=Br, St0) ->
+ case is_in_guard(St0) of
+ true ->
+ {[#k_var{name=X}],#k_var{name=X}} = {Vs,B0}, %Assertion.
+ #k_atom{val=false} = H0, %Assertion.
+ {A1,Bu,St1} = uexpr(A0, Br, St0),
+ {Try#k_try{anno=#k{us=Bu,ns=lit_list_vars(Rs0),a=A},
+ arg=A1,ret=Rs0},Bu,St1};
+ false ->
+ {Avs,St1} = new_vars(length(Vs), St0),
+ {A1,Au,St2} = ubody(A0, {break,Avs}, St1),
+ {B1,Bu,St3} = ubody(B0, Br, St2),
+ {H1,Hu,St4} = ubody(H0, Br, St3),
+ {Rs1,St5} = ensure_return_vars(Rs0, St4),
+ Used = union([Au,subtract(Bu, lit_list_vars(Vs)),
+ subtract(Hu, lit_list_vars(Evs))]),
+ {#k_try{anno=#k{us=Used,ns=lit_list_vars(Rs1),a=A},
+ arg=A1,vars=Vs,body=B1,evars=Evs,handler=H1,ret=Rs1},
+ Used,St5}
+ end;
uexpr(#k_try{anno=A,arg=A0,vars=Vs,body=B0,evars=Evs,handler=H0},
return, St0) ->
{Avs,St1} = new_vars(length(Vs), St0), %Need dummy names here
@@ -1685,12 +1622,13 @@ uexpr(#ifun{anno=A,vars=Vs,body=B0}, {break,Rs}, St0) ->
#k_int{val=Index},#k_int{val=Uniq}|Fvs],
ret=Rs},
Free,add_local_function(Fun, St)};
-uexpr(Lit, {break,Rs}, St) ->
+uexpr(Lit, {break,Rs0}, St0) ->
%% Transform literals to puts here.
%%ok = io:fwrite("uexpr ~w:~p~n", [?LINE,Lit]),
Used = lit_vars(Lit),
+ {Rs,St1} = ensure_return_vars(Rs0, St0),
{#k_put{anno=#k{us=Used,ns=lit_list_vars(Rs),a=get_kanno(Lit)},
- arg=Lit,ret=Rs},Used,St}.
+ arg=Lit,ret=Rs},Used,St1}.
add_local_function(_, #kern{funs=ignore}=St) -> St;
add_local_function(F, #kern{funs=Funs}=St) -> St#kern{funs=[F|Funs]}.
@@ -1747,6 +1685,11 @@ bif_returns(#k_internal{name=N,arity=Ar}, Rs, St0) ->
{Ns,St1} = new_vars(bif_vals(N, Ar) - length(Rs), St0),
{Rs ++ Ns,St1}.
+%% ensure_return_vars([Ret], State) -> {[Ret],State}.
+
+ensure_return_vars([], St) -> new_vars(1, St);
+ensure_return_vars([_]=Rs, St) -> {Rs,St}.
+
%% umatch(Match, Break, State) -> {Match,[UsedVar],State}.
%% Tag a match expression with its used variables.
@@ -1779,7 +1722,8 @@ umatch(#k_guard{anno=A,clauses=Gs0}, Br, St0) ->
{#k_guard{anno=#k{us=Gus,ns=[],a=A},clauses=Gs1},Gus,St1};
umatch(#k_guard_clause{anno=A,guard=G0,body=B0}, Br, St0) ->
%%ok = io:fwrite("~w: ~p~n", [?LINE,G0]),
- {G1,Gu,St1} = uguard(G0, St0#kern{guard_refc=St0#kern.guard_refc+1}),
+ {G1,Gu,St1} = uexpr(G0, {break,[]},
+ St0#kern{guard_refc=St0#kern.guard_refc+1}),
%%ok = io:fwrite("~w: ~p~n", [?LINE,G1]),
{B1,Bu,St2} = umatch(B0, Br, St1#kern{guard_refc=St1#kern.guard_refc-1}),
Used = union(Gu, Bu),
@@ -1827,7 +1771,6 @@ lit_list_vars(Ps) ->
pat_vars(#k_var{name=N}) -> {[],[N]};
%%pat_vars(#k_char{}) -> {[],[]};
-%%pat_vars(#k_string{}) -> {[],[]};
pat_vars(#k_literal{}) -> {[],[]};
pat_vars(#k_int{}) -> {[],[]};
pat_vars(#k_float{}) -> {[],[]};
@@ -1854,34 +1797,6 @@ pat_list_vars(Ps) ->
{union(Used0, Used),union(New0, New)} end,
{[],[]}, Ps).
-%% handle_literal(Literal, Anno) -> Kernel
-%% Examine the literal. Complex (heap-based) literals such as lists,
-%% tuples, and binaries should be kept as literals and put into the constant pool.
-%%
-%% (If necessary, this function could be extended to go through the literal
-%% and convert huge binary literals to bit syntax expressions. We don't do that
-%% because v3_core does not produce huge binary literals, and the optimizations in
-%% sys_core_fold don't do much optimizations of binaries. IF THAT CHANGE IS MADE,
-%% ALSO CHANGE sys_core_dsetel.)
-
-handle_literal(#c_literal{anno=A,val=V}) ->
- case V of
- [_|_] ->
- #k_literal{anno=A,val=V};
- [] ->
- #k_nil{anno=A};
- V when is_tuple(V) ->
- #k_literal{anno=A,val=V};
- V when is_bitstring(V) ->
- #k_literal{anno=A,val=V};
- V when is_integer(V) ->
- #k_int{anno=A,val=V};
- V when is_float(V) ->
- #k_float{anno=A,val=V};
- V when is_atom(V) ->
- #k_atom{anno=A,val=V}
- end.
-
make_list(Es) ->
foldr(fun(E, Acc) ->
#c_cons{hd=E,tl=Acc}
@@ -1893,6 +1808,11 @@ integers(N, M) when N =< M ->
[N|integers(N + 1, M)];
integers(_, _) -> [].
+%% is_in_guard(State) -> true|false.
+
+is_in_guard(#kern{guard_refc=Refc}) ->
+ Refc > 0.
+
%%%
%%% Handling of errors and warnings.
%%%
@@ -1908,12 +1828,17 @@ format_error({nomatch_shadow,Line}) ->
format_error(nomatch_shadow) ->
"this clause cannot match because a previous clause always matches";
format_error(bad_call) ->
- "invalid module and/or function name; this call will always fail".
+ "invalid module and/or function name; this call will always fail";
+format_error(bad_segment_size) ->
+ "binary construction will fail because of a type mismatch".
add_warning(none, Term, Anno, #kern{ws=Ws}=St) ->
File = get_file(Anno),
St#kern{ws=[{File,[{?MODULE,Term}]}|Ws]};
-add_warning(Line, Term, Anno, #kern{ws=Ws}=St) when Line >= 0 ->
+add_warning(Line, Term, Anno, #kern{ws=Ws}=St) ->
File = get_file(Anno),
- St#kern{ws=[{File,[{Line,?MODULE,Term}]}|Ws]};
-add_warning(_, _, _, St) -> St.
+ St#kern{ws=[{File,[{Line,?MODULE,Term}]}|Ws]}.
+
+is_compiler_generated(Ke) ->
+ Anno = get_kanno(Ke),
+ member(compiler_generated, Anno).
diff --git a/lib/compiler/src/v3_kernel.hrl b/lib/compiler/src/v3_kernel.hrl
index 37f2fdcf7e..fb8baf398b 100644
--- a/lib/compiler/src/v3_kernel.hrl
+++ b/lib/compiler/src/v3_kernel.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -35,7 +35,6 @@
-record(k_int, {anno=[],val}).
-record(k_float, {anno=[],val}).
-record(k_atom, {anno=[],val}).
--record(k_string, {anno=[],val}).
-record(k_nil, {anno=[]}).
-record(k_tuple, {anno=[],es}).
diff --git a/lib/compiler/src/v3_life.erl b/lib/compiler/src/v3_life.erl
index 93f8034230..2cc3493570 100644
--- a/lib/compiler/src/v3_life.erl
+++ b/lib/compiler/src/v3_life.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -112,53 +112,14 @@ guard(#k_try{anno=A,arg=Ts,vars=[#k_var{name=X}],body=#k_var{name=X},
%% Lock variables that are alive before try and used afterwards.
%% Don't lock variables that are only used inside the try expression.
Pdb0 = vdb_sub(I, I+1, Vdb),
- {T,MaxI,Pdb1} = guard_body(Ts, I+1, Pdb0),
+ {T,MaxI,Pdb1} = body(Ts, I+1, Pdb0),
Pdb2 = use_vars(A#k.ns, MaxI+1, Pdb1), %Save "return" values
- #l{ke={protected,T,var_list(Rs)},i=I,a=A#k.a,vdb=Pdb2};
-guard(#k_seq{}=G, I, Vdb0) ->
- {Es,_,Vdb1} = guard_body(G, I, Vdb0),
- #l{ke={block,Es},i=I,vdb=Vdb1,a=[]};
-guard(G, I, Vdb) -> guard_expr(G, I, Vdb).
-
-%% guard_body(Kbody, I, Vdb) -> {[Expr],MaxI,Vdb}.
-
-guard_body(#k_seq{arg=Ke,body=Kb}, I, Vdb0) ->
- A = get_kanno(Ke),
- Vdb1 = use_vars(A#k.us, I, new_vars(A#k.ns, I, Vdb0)),
- {Es,MaxI,Vdb2} = guard_body(Kb, I+1, Vdb1),
- E = guard_expr(Ke, I, Vdb2),
- {[E|Es],MaxI,Vdb2};
-guard_body(Ke, I, Vdb0) ->
- A = get_kanno(Ke),
- Vdb1 = use_vars(A#k.us, I, new_vars(A#k.ns, I, Vdb0)),
- E = guard_expr(Ke, I, Vdb1),
- {[E],I,Vdb1}.
-
-%% guard_expr(Call, I, Vdb) -> Expr
-
-guard_expr(#k_test{anno=A,op=Op,args=As}, I, _Vdb) ->
- #l{ke={test,test_op(Op),atomic_list(As)},i=I,a=A#k.a};
-guard_expr(#k_bif{anno=A,op=Op,args=As,ret=Rs}, I, _Vdb) ->
- Name = bif_op(Op),
- Ar = length(As),
- case is_gc_bif(Name, Ar) of
- false ->
- #l{ke={bif,Name,atomic_list(As),var_list(Rs)},i=I,a=A#k.a};
- true ->
- #l{ke={gc_bif,Name,atomic_list(As),var_list(Rs)},i=I,a=A#k.a}
- end;
-guard_expr(#k_put{anno=A,arg=Arg,ret=Rs}, I, _Vdb) ->
- #l{ke={set,var_list(Rs),literal(Arg, [])},i=I,a=A#k.a};
-guard_expr(#k_guard_match{anno=A,body=Kb,ret=Rs}, I, Vdb) ->
- %% Support for andalso/orelse in guards.
- %% Work out imported variables which need to be locked.
- Mdb = vdb_sub(I, I+1, Vdb),
- M = match(Kb, A#k.us, I+1, [], Mdb),
- #l{ke={guard_match,M,var_list(Rs)},i=I,vdb=use_vars(A#k.us, I+1, Mdb),a=A#k.a};
-guard_expr(G, I, Vdb) -> guard(G, I, Vdb).
+ #l{ke={protected,T,var_list(Rs)},i=I,a=A#k.a,vdb=Pdb2}.
%% expr(Kexpr, I, Vdb) -> Expr.
+expr(#k_test{anno=A,op=Op,args=As}, I, _Vdb) ->
+ #l{ke={test,test_op(Op),atomic_list(As)},i=I,a=A#k.a};
expr(#k_call{anno=A,op=Op,args=As,ret=Rs}, I, _Vdb) ->
#l{ke={call,call_op(Op),atomic_list(As),var_list(Rs)},i=I,a=A#k.a};
expr(#k_enter{anno=A,op=Op,args=As}, I, _Vdb) ->
@@ -176,25 +137,11 @@ expr(#k_guard_match{anno=A,body=Kb,ret=Rs}, I, Vdb) ->
Mdb = vdb_sub(I, I+1, Vdb),
M = match(Kb, A#k.us, I+1, [], Mdb),
#l{ke={guard_match,M,var_list(Rs)},i=I,vdb=use_vars(A#k.us, I+1, Mdb),a=A#k.a};
-expr(#k_try{anno=A,arg=Ka,vars=Vs,body=Kb,evars=Evs,handler=Kh,ret=Rs}, I, Vdb) ->
- %% Lock variables that are alive before the catch and used afterwards.
- %% Don't lock variables that are only used inside the try.
- Tdb0 = vdb_sub(I, I+1, Vdb),
- %% This is the tricky bit. Lock variables in Arg that are used in
- %% the body and handler. Add try tag 'variable'.
- Ab = get_kanno(Kb),
- Ah = get_kanno(Kh),
- Tdb1 = use_vars(Ab#k.us, I+3, use_vars(Ah#k.us, I+3, Tdb0)),
- Tdb2 = vdb_sub(I, I+2, Tdb1),
- Vnames = fun (Kvar) -> Kvar#k_var.name end, %Get the variable names
- {Aes,_,Adb} = body(Ka, I+2, add_var({catch_tag,I+1}, I+1, locked, Tdb2)),
- {Bes,_,Bdb} = body(Kb, I+4, new_vars(map(Vnames, Vs), I+3, Tdb2)),
- {Hes,_,Hdb} = body(Kh, I+4, new_vars(map(Vnames, Evs), I+3, Tdb2)),
- #l{ke={'try',#l{ke={block,Aes},i=I+1,vdb=Adb,a=[]},
- var_list(Vs),#l{ke={block,Bes},i=I+3,vdb=Bdb,a=[]},
- var_list(Evs),#l{ke={block,Hes},i=I+3,vdb=Hdb,a=[]},
- var_list(Rs)},
- i=I,vdb=Tdb1,a=A#k.a};
+expr(#k_try{}=Try, I, Vdb) ->
+ case is_in_guard() of
+ false -> body_try(Try, I, Vdb);
+ true -> guard(Try, I, Vdb)
+ end;
expr(#k_try_enter{anno=A,arg=Ka,vars=Vs,body=Kb,evars=Evs,handler=Kh}, I, Vdb) ->
%% Lock variables that are alive before the catch and used afterwards.
%% Don't lock variables that are only used inside the try.
@@ -243,6 +190,27 @@ expr(#k_guard_break{anno=A,args=As}, I, Vdb) ->
expr(#k_return{anno=A,args=As}, I, _Vdb) ->
#l{ke={return,atomic_list(As)},i=I,a=A#k.a}.
+body_try(#k_try{anno=A,arg=Ka,vars=Vs,body=Kb,evars=Evs,handler=Kh,ret=Rs},
+ I, Vdb) ->
+ %% Lock variables that are alive before the catch and used afterwards.
+ %% Don't lock variables that are only used inside the try.
+ Tdb0 = vdb_sub(I, I+1, Vdb),
+ %% This is the tricky bit. Lock variables in Arg that are used in
+ %% the body and handler. Add try tag 'variable'.
+ Ab = get_kanno(Kb),
+ Ah = get_kanno(Kh),
+ Tdb1 = use_vars(Ab#k.us, I+3, use_vars(Ah#k.us, I+3, Tdb0)),
+ Tdb2 = vdb_sub(I, I+2, Tdb1),
+ Vnames = fun (Kvar) -> Kvar#k_var.name end, %Get the variable names
+ {Aes,_,Adb} = body(Ka, I+2, add_var({catch_tag,I+1}, I+1, locked, Tdb2)),
+ {Bes,_,Bdb} = body(Kb, I+4, new_vars(map(Vnames, Vs), I+3, Tdb2)),
+ {Hes,_,Hdb} = body(Kh, I+4, new_vars(map(Vnames, Evs), I+3, Tdb2)),
+ #l{ke={'try',#l{ke={block,Aes},i=I+1,vdb=Adb,a=[]},
+ var_list(Vs),#l{ke={block,Bes},i=I+3,vdb=Bdb,a=[]},
+ var_list(Evs),#l{ke={block,Hes},i=I+3,vdb=Hdb,a=[]},
+ var_list(Rs)},
+ i=I,vdb=Tdb1,a=A#k.a}.
+
%% call_op(Op) -> Op.
%% bif_op(Op) -> Op.
%% test_op(Op) -> Op.
@@ -373,7 +341,6 @@ atomic(#k_int{val=I}) -> {integer,I};
atomic(#k_float{val=F}) -> {float,F};
atomic(#k_atom{val=N}) -> {atom,N};
%%atomic(#k_char{val=C}) -> {char,C};
-%%atomic(#k_string{val=S}) -> {string,S};
atomic(#k_nil{}) -> nil.
atomic_list(Ks) -> [atomic(K) || K <- Ks].
@@ -535,3 +502,7 @@ vdb_sub(Min, Max, Vdb) ->
true -> Vd
end || {V,F,L}=Vd <- Vdb, F < Min, L >= Min ].
+%% is_in_guard() -> true|false.
+
+is_in_guard() ->
+ get(guard_refc) > 0.
diff --git a/lib/compiler/test/Makefile b/lib/compiler/test/Makefile
index e13ad4ae90..e047166ade 100644
--- a/lib/compiler/test/Makefile
+++ b/lib/compiler/test/Makefile
@@ -154,12 +154,12 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) compiler.spec compiler.cover \
- $(EMAKEFILE) $(ERL_FILES) $(CORE_FILES) $(RELSYSDIR)
+ $(EMAKEFILE) $(ERL_FILES) $(CORE_FILES) "$(RELSYSDIR)"
$(INSTALL_DATA) $(NO_OPT_ERL_FILES) $(POST_OPT_ERL_FILES) \
- $(INLINE_ERL_FILES) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INLINE_ERL_FILES) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/compiler/test/beam_disasm_SUITE.erl b/lib/compiler/test/beam_disasm_SUITE.erl
index 44574ae64a..62afc80ca6 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. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -60,6 +60,6 @@ stripped(Config) when is_list(Config) ->
?line true = is_list(Attr),
?line true = is_list(CompileInfo),
?line {ok, {tmp, _}} = beam_lib:strip(BeamName),
- ?line {beam_file, tmp, _, none, none, [_|_]} =
+ ?line {beam_file, tmp, _, [], [], [_|_]} =
beam_disasm:file(BeamName),
ok.
diff --git a/lib/compiler/test/bs_construct_SUITE.erl b/lib/compiler/test/bs_construct_SUITE.erl
index 31c7890f26..9ab76449c7 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -468,6 +468,10 @@ opt(Config) when is_list(Config) ->
?line {'EXIT',_} = (catch <<<<23,56,0,2>>:64/float>>),
?line {'EXIT',_} = (catch <<<<23,56,0,2:7>>/binary>>),
+ %% Test constant propagation - there should be a warning.
+ BadSz = 2.5,
+ {'EXIT',_} = (catch <<<<N,56,0,2>>:BadSz/binary>>),
+
case id(false) of
true -> ?line opt_dont_call_me();
false -> ok
diff --git a/lib/compiler/test/compilation_SUITE.erl b/lib/compiler/test/compilation_SUITE.erl
index 664582a3a8..fed7bec7d4 100644
--- a/lib/compiler/test/compilation_SUITE.erl
+++ b/lib/compiler/test/compilation_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -159,6 +159,7 @@ split({int, N}, <<N:16,B:N/binary,T/binary>>) ->
?comp(convopts).
?comp(otp_7202).
?comp(on_load).
+?comp(on_load_inline).
beam_compiler_7(doc) ->
"Code snippet submitted from Ulf Wiger which fails in R3 Beam.";
diff --git a/lib/compiler/test/compilation_SUITE_data/on_load_inline.erl b/lib/compiler/test/compilation_SUITE_data/on_load_inline.erl
new file mode 100644
index 0000000000..322843b61e
--- /dev/null
+++ b/lib/compiler/test/compilation_SUITE_data/on_load_inline.erl
@@ -0,0 +1,23 @@
+-module(on_load_inline).
+-export([?MODULE/0]).
+-on_load(on_load/0).
+-compile(inline).
+
+?MODULE() ->
+ [{pid,Pid}] = ets:lookup(on_load_executed, pid),
+ exit(Pid, kill),
+ ok.
+
+on_load() ->
+ Parent = self(),
+ spawn(fun() ->
+ T = ets:new(on_load_executed, [named_table]),
+ ets:insert(T, {pid,self()}),
+ Parent ! done,
+ receive
+ wait_forever -> ok
+ end
+ end),
+ receive
+ done -> ok
+ end.
diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl
index 640849f2ec..2cd75944f4 100644
--- a/lib/compiler/test/compile_SUITE.erl
+++ b/lib/compiler/test/compile_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -25,7 +25,7 @@
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
app_test/1,
- file_1/1, module_mismatch/1, big_file/1, outdir/1,
+ file_1/1, forms_2/1, module_mismatch/1, big_file/1, outdir/1,
binary/1, makedep/1, cond_and_ifdef/1, listings/1, listings_big/1,
other_output/1, package_forms/1, encrypted_abstr/1,
bad_record_use1/1, bad_record_use2/1, strict_record/1,
@@ -42,7 +42,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
test_lib:recompile(?MODULE),
- [app_test, file_1, module_mismatch, big_file, outdir,
+ [app_test, file_1, forms_2, module_mismatch, big_file, outdir,
binary, makedep, cond_and_ifdef, listings, listings_big,
other_output, package_forms, encrypted_abstr,
{group, bad_record_use}, strict_record,
@@ -76,6 +76,9 @@ app_test(Config) when is_list(Config) ->
file_1(Config) when is_list(Config) ->
?line Dog = test_server:timetrap(test_server:minutes(5)),
+
+ process_flag(trap_exit, true),
+
?line {Simple, Target} = files(Config, "file_1"),
?line {ok, Cwd} = file:get_cwd(),
?line ok = file:set_cwd(filename:dirname(Target)),
@@ -102,9 +105,37 @@ file_1(Config) when is_list(Config) ->
%% Cleanup.
?line ok = file:delete(Target),
?line ok = file:del_dir(filename:dirname(Target)),
+
+ %% There should not be any messages in the messages.
+ receive
+ Any ->
+ ?t:fail({unexpected,Any})
+ after 10 ->
+ ok
+ end,
+
?line test_server:timetrap_cancel(Dog),
ok.
+forms_2(Config) when is_list(Config) ->
+ Src = "/foo/bar",
+ AbsSrc = filename:absname(Src),
+ {ok,simple,Binary} = compile:forms([{attribute,1,module,simple}],
+ [binary,{source,Src}]),
+ code:load_binary(simple, Src, Binary),
+ Info = simple:module_info(compile),
+
+ %% Test that the proper source is returned.
+ AbsSrc = proplists:get_value(source, Info),
+
+ %% Ensure that the options are not polluted with 'source'.
+ [] = proplists:get_value(options, Info),
+
+ %% Cleanup.
+ true = code:delete(simple),
+ false = code:purge(simple),
+ ok.
+
module_mismatch(Config) when is_list(Config) ->
?line DataDir = ?config(data_dir, Config),
?line File = filename:join(DataDir, "wrong_module_name.erl"),
@@ -211,6 +242,12 @@ makedep(Config) when is_list(Config) ->
[makedep,{makedep_output,Target}|IncludeOptions]),
?line {ok,Mf6} = file:read_file(Target),
?line BasicMf2 = makedep_canonicalize_result(Mf6, DataDir),
+ %% Rule with creating phony target.
+ ?line PhonyMfName = SimpleRootname ++ "-phony.mk",
+ ?line {ok,PhonyMf} = file:read_file(PhonyMfName),
+ ?line {ok,_,Mf7} = compile:file(Simple,
+ [binary,makedep,makedep_phony|IncludeOptions]),
+ ?line PhonyMf = makedep_canonicalize_result(Mf7, DataDir),
?line ok = file:delete(Target),
?line ok = file:del_dir(filename:dirname(Target)),
diff --git a/lib/compiler/test/compile_SUITE_data/simple-phony.mk b/lib/compiler/test/compile_SUITE_data/simple-phony.mk
new file mode 100644
index 0000000000..c84bcedd2a
--- /dev/null
+++ b/lib/compiler/test/compile_SUITE_data/simple-phony.mk
@@ -0,0 +1,3 @@
+simple.beam: $(srcdir)/simple.erl $(srcdir)/include/simple.hrl
+
+$(srcdir)/include/simple.hrl:
diff --git a/lib/compiler/test/core_SUITE.erl b/lib/compiler/test/core_SUITE.erl
index 874e02803d..06185bfc34 100644
--- a/lib/compiler/test/core_SUITE.erl
+++ b/lib/compiler/test/core_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -22,7 +22,7 @@
init_per_group/2,end_per_group/2,
init_per_testcase/2,end_per_testcase/2,
dehydrated_itracer/1,nested_tries/1,
- make_effect_seq/1,eval_is_boolean/1,
+ seq_in_guard/1,make_effect_seq/1,eval_is_boolean/1,
unsafe_case/1,nomatch_shadow/1,reversed_annos/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -43,7 +43,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
test_lib:recompile(?MODULE),
- [dehydrated_itracer,nested_tries,make_effect_seq,
+ [dehydrated_itracer,nested_tries,seq_in_guard,make_effect_seq,
eval_is_boolean,unsafe_case,nomatch_shadow,reversed_annos].
groups() ->
@@ -64,6 +64,7 @@ end_per_group(_GroupName, Config) ->
?comp(dehydrated_itracer).
?comp(nested_tries).
+?comp(seq_in_guard).
?comp(make_effect_seq).
?comp(eval_is_boolean).
?comp(unsafe_case).
diff --git a/lib/compiler/test/core_SUITE_data/seq_in_guard.core b/lib/compiler/test/core_SUITE_data/seq_in_guard.core
new file mode 100644
index 0000000000..44686a7187
--- /dev/null
+++ b/lib/compiler/test/core_SUITE_data/seq_in_guard.core
@@ -0,0 +1,66 @@
+module 'seq_in_guard' ['seq_in_guard'/0,
+ 't'/1]
+ attributes []
+'seq_in_guard'/0 =
+ %% Line 4
+ fun () ->
+ case <> of
+ <> when 'true' ->
+ let <_cor0> =
+ catch
+ %% Line 5
+ apply 't'/1
+ ({})
+ in %% Line 5
+ case _cor0 of
+ <{'EXIT',{'function_clause',_cor4}}> when 'true' ->
+ let <_cor2> =
+ catch
+ %% Line 6
+ apply 't'/1
+ ('atom')
+ in %% Line 6
+ case _cor2 of
+ <{'EXIT',{'function_clause',_cor5}}> when 'true' ->
+ %% Line 7
+ apply 't'/1
+ ({'a','b'})
+ ( <_cor3> when 'true' ->
+ primop 'match_fail'
+ ({'badmatch',_cor3})
+ -| ['compiler_generated'] )
+ end
+ ( <_cor1> when 'true' ->
+ primop 'match_fail'
+ ({'badmatch',_cor1})
+ -| ['compiler_generated'] )
+ end
+ ( <> when 'true' ->
+ ( primop 'match_fail'
+ ({'function_clause'})
+ -| [{'function_name',{'seq_in_guard',0}}] )
+ -| ['compiler_generated'] )
+ end
+'t'/1 =
+ %% Line 9
+ fun (_cor0) ->
+ case _cor0 of
+ <X>
+ when try
+ do
+ call 'erlang':'element'
+ (2, X)
+ 'true'
+ of <Try> ->
+ Try
+ catch <T,R> ->
+ 'false' ->
+ %% Line 10
+ 'ok'
+ ( <_cor3> when 'true' ->
+ ( primop 'match_fail'
+ ({'function_clause',_cor3})
+ -| [{'function_name',{'t',1}}] )
+ -| ['compiler_generated'] )
+ end
+end
diff --git a/lib/compiler/test/core_fold_SUITE.erl b/lib/compiler/test/core_fold_SUITE.erl
index fb5ec88c9f..54bd52947e 100644
--- a/lib/compiler/test/core_fold_SUITE.erl
+++ b/lib/compiler/test/core_fold_SUITE.erl
@@ -21,7 +21,7 @@
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
t_element/1,setelement/1,t_length/1,append/1,t_apply/1,bifs/1,
- eq/1,nested_call_in_case/1,coverage/1]).
+ eq/1,nested_call_in_case/1,guard_try_catch/1,coverage/1]).
-export([foo/0,foo/1,foo/2,foo/3]).
@@ -32,7 +32,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
test_lib:recompile(?MODULE),
[t_element, setelement, t_length, append, t_apply, bifs,
- eq, nested_call_in_case, coverage].
+ eq, nested_call_in_case, guard_try_catch, coverage].
groups() ->
[].
@@ -207,6 +207,23 @@ nested_call_in_case(Config) when is_list(Config) ->
?line {'EXIT',_} = (catch Mod:a(not_a_list, 42)),
ok.
+guard_try_catch(_Config) ->
+ false = do_guard_try_catch(key, value),
+ value = get(key),
+ ok.
+
+do_guard_try_catch(K, V) ->
+ %% This try...catch block looks like a guard.
+ %% Make sure that it is not optimized like a guard
+ %% (the put/2 call must not be optimized away).
+ try
+ put(K, V),
+ false
+ catch
+ _:_ ->
+ false
+ end.
+
coverage(Config) when is_list(Config) ->
?line {'EXIT',{{case_clause,{a,b,c}},_}} =
(catch cover_will_match_list_type({a,b,c})),
diff --git a/lib/compiler/test/error_SUITE.erl b/lib/compiler/test/error_SUITE.erl
index eb5e50818e..fb51e013ce 100644
--- a/lib/compiler/test/error_SUITE.erl
+++ b/lib/compiler/test/error_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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/lib/compiler/test/guard_SUITE_data/guard_SUITE_tuple_size.S b/lib/compiler/test/guard_SUITE_data/guard_SUITE_tuple_size.S
index c0bf04ed8f..cffb792920 100644
--- a/lib/compiler/test/guard_SUITE_data/guard_SUITE_tuple_size.S
+++ b/lib/compiler/test/guard_SUITE_data/guard_SUITE_tuple_size.S
@@ -19,10 +19,10 @@
{get_tuple_element,{x,0},1,{x,2}}.
{get_tuple_element,{x,0},2,{x,3}}.
{get_tuple_element,{x,0},3,{x,4}}.
- {gc_bif,'+',{f,0},5,[{x,1},{x,2}],{x,0}}.
- {gc_bif,'+',{f,0},5,[{x,0},{x,3}],{x,0}}.
- {gc_bif,'+',{f,0},5,[{x,0},{x,4}],{x,0}}.
- {gc_bif,'+',{f,0},5,[{x,0},{x,5}],{x,0}}.
+ {gc_bif,'+',{f,0},6,[{x,1},{x,2}],{x,0}}.
+ {gc_bif,'+',{f,0},6,[{x,0},{x,3}],{x,0}}.
+ {gc_bif,'+',{f,0},6,[{x,0},{x,4}],{x,0}}.
+ {gc_bif,'+',{f,0},6,[{x,0},{x,5}],{x,0}}.
return.
{label,3}.
{badmatch,{x,0}}.
diff --git a/lib/compiler/test/misc_SUITE.erl b/lib/compiler/test/misc_SUITE.erl
index 5e13a93c52..0376c7ef3e 100644
--- a/lib/compiler/test/misc_SUITE.erl
+++ b/lib/compiler/test/misc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -190,6 +190,15 @@ silly_coverage(Config) when is_list(Config) ->
{label,2}|non_proper_list]}],99},
?line expect_error(fun() -> beam_block:module(BlockInput, []) end),
+ %% beam_type
+ TypeInput = {?MODULE,[{foo,0}],[],
+ [{function,foo,0,2,
+ [{label,1},
+ {line,loc},
+ {func_info,{atom,?MODULE},{atom,foo},0},
+ {label,2}|non_proper_list]}],99},
+ expect_error(fun() -> beam_type:module(TypeInput, []) end),
+
%% beam_except
ExceptInput = {?MODULE,[{foo,0}],[],
[{function,foo,0,2,
diff --git a/lib/compiler/test/trycatch_SUITE.erl b/lib/compiler/test/trycatch_SUITE.erl
index 09a23724fe..29119c0f5d 100644
--- a/lib/compiler/test/trycatch_SUITE.erl
+++ b/lib/compiler/test/trycatch_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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/lib/compiler/vsn.mk b/lib/compiler/vsn.mk
index 416c2f08bb..b77c82309f 100644
--- a/lib/compiler/vsn.mk
+++ b/lib/compiler/vsn.mk
@@ -1 +1 @@
-COMPILER_VSN = 4.8
+COMPILER_VSN = 4.8.2
diff --git a/lib/cosEvent/doc/src/Makefile b/lib/cosEvent/doc/src/Makefile
index 6a9b4201d7..1b867852e4 100644
--- a/lib/cosEvent/doc/src/Makefile
+++ b/lib/cosEvent/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -137,13 +137,13 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/cosEvent/src/Makefile b/lib/cosEvent/src/Makefile
index f8e751f218..7787fad786 100644
--- a/lib/cosEvent/src/Makefile
+++ b/lib/cosEvent/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -197,14 +197,14 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) ../info $(RELSYSDIR)
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(GEN_ERL_FILES) $(IDL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(GEN_HRL_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) ../info "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(GEN_ERL_FILES) $(IDL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(GEN_HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/cosEvent/test/Makefile b/lib/cosEvent/test/Makefile
index c3f07c156f..c5afcdb7e4 100644
--- a/lib/cosEvent/test/Makefile
+++ b/lib/cosEvent/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -141,11 +141,11 @@ release_spec:
release_docs_spec:
release_tests_spec: tests
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) \
- $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELSYSDIR)/$(IDLOUTDIR)
+ $(COVER_FILE) $(ERL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(SUITE_TARGET_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELSYSDIR)/$(IDLOUTDIR)"
$(INSTALL_DATA) $(GEN_TARGET_FILES) $(GEN_FILES) \
- $(RELSYSDIR)/$(IDLOUTDIR)
+ "$(RELSYSDIR)/$(IDLOUTDIR)"
diff --git a/lib/cosEventDomain/doc/src/Makefile b/lib/cosEventDomain/doc/src/Makefile
index cd159c623c..f820ee5dc0 100644
--- a/lib/cosEventDomain/doc/src/Makefile
+++ b/lib/cosEventDomain/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2011. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -131,13 +131,13 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/cosEventDomain/src/Makefile b/lib/cosEventDomain/src/Makefile
index 409cac47f1..213d433c72 100644
--- a/lib/cosEventDomain/src/Makefile
+++ b/lib/cosEventDomain/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2011. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -166,14 +166,14 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) ../info $(RELSYSDIR)
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(GEN_ERL_FILES) $(IDL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(EXTERNAL_GEN_HRL_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) ../info "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(GEN_ERL_FILES) $(IDL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(EXTERNAL_GEN_HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/cosEventDomain/test/Makefile b/lib/cosEventDomain/test/Makefile
index 160c8565e8..5b59cca401 100644
--- a/lib/cosEventDomain/test/Makefile
+++ b/lib/cosEventDomain/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2011. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -98,8 +98,8 @@ release_spec:
release_docs_spec:
release_tests_spec: tests
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) $(TEST_SPEC_FILE) \
- $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR)
+ $(COVER_FILE) $(ERL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(SUITE_TARGET_FILES) "$(RELSYSDIR)"
diff --git a/lib/cosFileTransfer/doc/src/Makefile b/lib/cosFileTransfer/doc/src/Makefile
index d9c68987e4..d1c6616f94 100644
--- a/lib/cosFileTransfer/doc/src/Makefile
+++ b/lib/cosFileTransfer/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2011. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -134,13 +134,13 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/cosFileTransfer/src/Makefile b/lib/cosFileTransfer/src/Makefile
index 1d51304f6b..d552349ede 100644
--- a/lib/cosFileTransfer/src/Makefile
+++ b/lib/cosFileTransfer/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2011. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -176,12 +176,12 @@ $(TARGET_FILES): IDL-GENERATED
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_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(GEN_FILES) $(IDL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(GEN_ERL_FILES) $(IDL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(GEN_HRL_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(GEN_FILES) $(IDL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(GEN_ERL_FILES) $(IDL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(GEN_HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/cosFileTransfer/test/Makefile b/lib/cosFileTransfer/test/Makefile
index b46fb35356..35f6cc1ac2 100644
--- a/lib/cosFileTransfer/test/Makefile
+++ b/lib/cosFileTransfer/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2011. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -126,8 +126,8 @@ release_spec:
release_docs_spec:
release_tests_spec: tests
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) \
- $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
+ $(COVER_FILE) $(ERL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(SUITE_TARGET_FILES) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
diff --git a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl
index 79a234bd28..18a591a7af 100644
--- a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl
+++ b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl
@@ -292,13 +292,8 @@ fts_ftp_file_api(Config) ->
fts_ftp_file_ssl_api(doc) -> ["CosFileTransfer FTP FileTransferSession API tests.", ""];
fts_ftp_file_ssl_api(suite) -> [];
fts_ftp_file_ssl_api(Config) ->
- case os:type() of
- vxworks ->
- {skipped, "No SSL-support for VxWorks."};
- _ ->
- ?line {ok, Node} = create_node("ftp_file_api_ssl", {4005, 1}, ssl),
- file_helper(Config, 'FTP', ?TEST_DIR, Node, 4005, "ftp_file_api_ssl", ssl)
- end.
+ ?line {ok, Node} = create_node("ftp_file_api_ssl", {4005, 1}, ssl),
+ file_helper(Config, 'FTP', ?TEST_DIR, Node, 4005, "ftp_file_api_ssl", ssl).
fts_native_file_api(doc) -> ["CosFileTransfer NATIVE FileTransferSession API tests.", ""];
fts_native_file_api(suite) -> [];
@@ -311,15 +306,10 @@ fts_native_file_api(Config) ->
fts_native_file_ssl_api(doc) -> ["CosFileTransfer NATIVE FileTransferSession API tests.", ""];
fts_native_file_ssl_api(suite) -> [];
fts_native_file_ssl_api(Config) ->
- case os:type() of
- vxworks ->
- {skipped, "No SSL-support for VxWorks."};
- _ ->
- ?line {ok, Node} = create_node("native_file_ssl_api", {4007, 1}, ssl),
- {ok, Pwd} = file:get_cwd(),
- file_helper(Config,{'NATIVE', 'cosFileTransferNATIVE_file'},filename:split(Pwd),
- Node, 4007, "native_file_ssl_api", ssl)
- end.
+ ?line {ok, Node} = create_node("native_file_ssl_api", {4007, 1}, ssl),
+ {ok, Pwd} = file:get_cwd(),
+ file_helper(Config,{'NATIVE', 'cosFileTransferNATIVE_file'},filename:split(Pwd),
+ Node, 4007, "native_file_ssl_api", ssl).
@@ -817,23 +807,13 @@ create_node(Name, Port, Retries, Type, Args, Options) ->
end.
starter(Host, Name, Args) ->
- case os:type() of
- vxworks ->
- test_server:start_node(Name, slave, [{args,Args}]);
- _ ->
- slave:start(Host, Name, Args)
- end.
+ slave:start(Host, Name, Args).
slave_sup() ->
process_flag(trap_exit, true),
receive
{'EXIT', _, _} ->
- case os:type() of
- vxworks ->
- erlang:halt();
- _ ->
- ignore
- end
+ ignore
end.
@@ -850,12 +830,7 @@ destroy_node(Node, Type) ->
stopper(Node, Type) ->
catch stop_orber_remote(Node, Type),
- case os:type() of
- vxworks ->
- test_server:stop_node(Node);
- _ ->
- slave:stop(Node)
- end.
+ slave:stop(Node).
-endif.
%%------------------------------------------------------------
diff --git a/lib/cosNotification/doc/src/Makefile b/lib/cosNotification/doc/src/Makefile
index 5caee09ec5..800d633909 100644
--- a/lib/cosNotification/doc/src/Makefile
+++ b/lib/cosNotification/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2011. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -159,13 +159,13 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/cosNotification/src/Makefile b/lib/cosNotification/src/Makefile
index 92225c6cfd..decf598bbf 100644
--- a/lib/cosNotification/src/Makefile
+++ b/lib/cosNotification/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -367,12 +367,12 @@ $(GEN_YECC_ERL_FILES) $(GEN_YECC_HRL_FILES): cosNotification_Grammar.yrl
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_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(GEN_FILES) $(IDL_FILES) $(YECC_FILES) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(IDL_FILES) $(YECC_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(GEN_HRL_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(GEN_FILES) $(IDL_FILES) $(YECC_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(IDL_FILES) $(YECC_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(GEN_HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/cosNotification/test/Makefile b/lib/cosNotification/test/Makefile
index f509370430..8c18ae7956 100644
--- a/lib/cosNotification/test/Makefile
+++ b/lib/cosNotification/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -128,6 +128,7 @@ ERL_COMPILE_FLAGS += \
$(ERL_IDL_FLAGS) \
-pa $(ERL_TOP)/lib/orber/include \
-pa $(ERL_TOP)/internal_tools/test_server/ebin \
+ -pa $(ERL_TOP)/lib/cosEvent/ebin \
-pa $(ERL_TOP)/lib/cosNotification/ebin \
-pa $(ERL_TOP)/lib/cosNotification/test/idl_output \
-pa $(ERL_TOP)/lib/cosTime/ebin \
@@ -182,11 +183,11 @@ release_spec:
release_docs_spec:
release_tests_spec: tests
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) \
- $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELSYSDIR)/$(IDLOUTDIR)
+ $(COVER_FILE) $(ERL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELSYSDIR)/$(IDLOUTDIR)"
$(INSTALL_DATA) $(GEN_TARGET_FILES) $(GEN_FILES) \
- $(RELSYSDIR)/$(IDLOUTDIR)
- $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR)
+ "$(RELSYSDIR)/$(IDLOUTDIR)"
+ $(INSTALL_DATA) $(SUITE_TARGET_FILES) "$(RELSYSDIR)"
diff --git a/lib/cosProperty/doc/src/Makefile b/lib/cosProperty/doc/src/Makefile
index 50f2e06f6c..1624479808 100644
--- a/lib/cosProperty/doc/src/Makefile
+++ b/lib/cosProperty/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2011. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -136,13 +136,13 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/cosProperty/src/Makefile b/lib/cosProperty/src/Makefile
index 8060421b4e..54d1b6021c 100644
--- a/lib/cosProperty/src/Makefile
+++ b/lib/cosProperty/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2011. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -176,12 +176,12 @@ $(TARGET_FILES): IDL-GENERATED
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_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(GEN_FILES) $(IDL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(GEN_ERL_FILES) $(IDL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(GEN_HRL_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(GEN_FILES) $(IDL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(GEN_ERL_FILES) $(IDL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(GEN_HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/cosProperty/test/Makefile b/lib/cosProperty/test/Makefile
index f6e0d0dbba..ba634c77cf 100644
--- a/lib/cosProperty/test/Makefile
+++ b/lib/cosProperty/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2011. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -120,11 +120,11 @@ release_spec:
release_docs_spec:
release_tests_spec: tests
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) \
- $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR)
-# $(INSTALL_DIR) $(RELSYSDIR)/$(IDLOUTDIR)
+ $(COVER_FILE) $(ERL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(SUITE_TARGET_FILES) "$(RELSYSDIR)"
+# $(INSTALL_DIR) "$(RELSYSDIR)/$(IDLOUTDIR)"
# $(INSTALL_DATA) $(GEN_TARGET_FILES) $(GEN_FILES) \
-# $(RELSYSDIR)/$(IDLOUTDIR)
+# "$(RELSYSDIR)/$(IDLOUTDIR)"
diff --git a/lib/cosTime/doc/src/Makefile b/lib/cosTime/doc/src/Makefile
index 4e97b07cf4..2ed55a3bfa 100644
--- a/lib/cosTime/doc/src/Makefile
+++ b/lib/cosTime/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2011. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -130,13 +130,13 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/cosTime/src/Makefile b/lib/cosTime/src/Makefile
index 18c25ca8f1..e8536a3f0a 100644
--- a/lib/cosTime/src/Makefile
+++ b/lib/cosTime/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2011. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -195,12 +195,12 @@ $(TARGET_FILES): IDL-GENERATED
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_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(GEN_FILES) $(IDL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(GEN_ERL_FILES) $(IDL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(GEN_HRL_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(GEN_FILES) $(IDL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(GEN_ERL_FILES) $(IDL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(GEN_HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/cosTime/test/Makefile b/lib/cosTime/test/Makefile
index a07b27eecb..89d5a4a38e 100644
--- a/lib/cosTime/test/Makefile
+++ b/lib/cosTime/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2011. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -126,11 +126,11 @@ release_spec:
release_docs_spec:
release_tests_spec: tests
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) \
- $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR)
-# $(INSTALL_DIR) $(RELSYSDIR)/$(IDLOUTDIR)
+ $(COVER_FILE) $(ERL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(SUITE_TARGET_FILES) "$(RELSYSDIR)"
+# $(INSTALL_DIR) "$(RELSYSDIR)/$(IDLOUTDIR)"
# $(INSTALL_DATA) $(GEN_TARGET_FILES) $(GEN_FILES) \
-# $(RELSYSDIR)/$(IDLOUTDIR)
+# "$(RELSYSDIR)/$(IDLOUTDIR)"
diff --git a/lib/cosTransactions/doc/src/Makefile b/lib/cosTransactions/doc/src/Makefile
index 4341ec04a3..7247c0dec7 100644
--- a/lib/cosTransactions/doc/src/Makefile
+++ b/lib/cosTransactions/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -134,13 +134,13 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/cosTransactions/examples/Makefile b/lib/cosTransactions/examples/Makefile
index 24cd12202a..348f506e2e 100644
--- a/lib/cosTransactions/examples/Makefile
+++ b/lib/cosTransactions/examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -149,9 +149,9 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/examples
- $(INSTALL_DATA) $(ERL_FILES) $(JAVA_FILES) $(IDL_FILES) $(RELSYSDIR)/examples
- $(INSTALL_DATA) $(INETRC_EXAMPLE) $(RELSYSDIR)/examples
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples"
+ $(INSTALL_DATA) $(ERL_FILES) $(JAVA_FILES) $(IDL_FILES) "$(RELSYSDIR)/examples"
+ $(INSTALL_DATA) $(INETRC_EXAMPLE) "$(RELSYSDIR)/examples"
@tar cf - java_output | (cd $(RELSYSDIR); tar xf -)
release_docs_spec:
diff --git a/lib/cosTransactions/src/Makefile b/lib/cosTransactions/src/Makefile
index 3c799ca0ca..1d935c4d1d 100644
--- a/lib/cosTransactions/src/Makefile
+++ b/lib/cosTransactions/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -170,11 +170,11 @@ $(TARGET_FILES): IDL-GENERATED
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_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(GEN_ERL_FILES) $(IDL_FILE) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(EXTERNAL_GEN_HRL_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(GEN_ERL_FILES) $(IDL_FILE) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(EXTERNAL_GEN_HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/cosTransactions/test/Makefile b/lib/cosTransactions/test/Makefile
index 0bc8c007da..53ff93ba16 100644
--- a/lib/cosTransactions/test/Makefile
+++ b/lib/cosTransactions/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -142,11 +142,11 @@ release_spec:
release_docs_spec:
release_tests_spec: tests
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) \
- $(COVER_FILE) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELSYSDIR)/$(IDLOUTDIR)
+ $(COVER_FILE) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(SUITE_TARGET_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELSYSDIR)/$(IDLOUTDIR)"
$(INSTALL_DATA) $(GEN_TARGET_FILES) $(GEN_FILES) \
- $(RELSYSDIR)/$(IDLOUTDIR)
+ "$(RELSYSDIR)/$(IDLOUTDIR)"
diff --git a/lib/crypto/c_src/Makefile.in b/lib/crypto/c_src/Makefile.in
index 285537643e..ffd556ca1a 100644
--- a/lib/crypto/c_src/Makefile.in
+++ b/lib/crypto/c_src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -85,7 +85,7 @@ DYNAMIC_CRYPTO_LIB=@SSL_DYNAMIC_ONLY@
ifeq ($(DYNAMIC_CRYPTO_LIB),yes)
SSL_DED_LD_RUNTIME_LIBRARY_PATH = @SSL_DED_LD_RUNTIME_LIBRARY_PATH@
-CRYPTO_LINK_LIB=$(SSL_DED_LD_RUNTIME_LIBRARY_PATH) -L$(SSL_LIBDIR) -l$(SSL_CRYPTO_LIBNAME) -l$(SSL_SSL_LIBNAME)
+CRYPTO_LINK_LIB=$(SSL_DED_LD_RUNTIME_LIBRARY_PATH) -L$(SSL_LIBDIR) -l$(SSL_CRYPTO_LIBNAME)
else
SSL_DED_LD_RUNTIME_LIBRARY_PATH=
CRYPTO_LINK_LIB=$(SSL_LIBDIR)/lib$(SSL_CRYPTO_LIBNAME).a
@@ -133,11 +133,11 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/obj
- $(INSTALL_DIR) $(RELSYSDIR)/priv/lib
- $(INSTALL_DATA) $(NIF_MAKEFILE) $(RELSYSDIR)/priv/obj
- $(INSTALL_PROGRAM) $(OBJS) $(RELSYSDIR)/priv/obj
- $(INSTALL_PROGRAM) $(NIF_LIB) $(RELSYSDIR)/priv/lib
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/obj"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/lib"
+ $(INSTALL_DATA) $(NIF_MAKEFILE) "$(RELSYSDIR)/priv/obj"
+ $(INSTALL_PROGRAM) $(OBJS) "$(RELSYSDIR)/priv/obj"
+ $(INSTALL_PROGRAM) $(NIF_LIB) "$(RELSYSDIR)/priv/lib"
release_docs_spec:
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index 4dc62421d2..91ab244620 100644
--- a/lib/crypto/c_src/crypto.c
+++ b/lib/crypto/c_src/crypto.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2010-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2010-2012. 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
@@ -53,6 +53,10 @@
#include <openssl/evp.h>
#include <openssl/hmac.h>
+#if OPENSSL_VERSION_NUMBER >= 0x00908000L && !defined(OPENSSL_NO_SHA224) && defined(NID_sha224)\
+ && !defined(OPENSSL_NO_SHA256) /* disabled like this in my sha.h (?) */
+# define HAVE_SHA224
+#endif
#if OPENSSL_VERSION_NUMBER >= 0x00908000L && !defined(OPENSSL_NO_SHA256) && defined(NID_sha256)
# define HAVE_SHA256
#endif
@@ -135,10 +139,18 @@ static ERL_NIF_TERM sha(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM sha_init(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM sha_update(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM sha_final(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM sha224_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM sha224_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM sha224_update_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM sha224_final_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM sha256_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM sha256_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM sha256_update_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM sha256_final_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM sha384_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM sha384_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM sha384_update_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM sha384_final_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM sha512_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM sha512_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM sha512_update_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
@@ -149,6 +161,10 @@ static ERL_NIF_TERM md4_update(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv
static ERL_NIF_TERM md4_final(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM md5_mac_n(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM sha_mac_n(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM sha224_mac_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM sha256_mac_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM sha384_mac_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM sha512_mac_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM hmac_init(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM hmac_update(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM hmac_final(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
@@ -201,12 +217,33 @@ static void dyn_destroy_function(struct CRYPTO_dynlock_value *ptr,
#endif /* OPENSSL_THREADS */
/* helpers */
+static void init_digest_types(ErlNifEnv* env);
static void hmac_md5(unsigned char *key, int klen,
unsigned char *dbuf, int dlen,
unsigned char *hmacbuf);
static void hmac_sha1(unsigned char *key, int klen,
unsigned char *dbuf, int dlen,
unsigned char *hmacbuf);
+#ifdef HAVE_SHA224
+static void hmac_sha224(unsigned char *key, int klen,
+ unsigned char *dbuf, int dlen,
+ unsigned char *hmacbuf);
+#endif
+#ifdef HAVE_SHA256
+static void hmac_sha256(unsigned char *key, int klen,
+ unsigned char *dbuf, int dlen,
+ unsigned char *hmacbuf);
+#endif
+#ifdef HAVE_SHA384
+static void hmac_sha384(unsigned char *key, int klen,
+ unsigned char *dbuf, int dlen,
+ unsigned char *hmacbuf);
+#endif
+#ifdef HAVE_SHA512
+static void hmac_sha512(unsigned char *key, int klen,
+ unsigned char *dbuf, int dlen,
+ unsigned char *hmacbuf);
+#endif
static int library_refc = 0; /* number of users of this dynamic library */
@@ -220,10 +257,18 @@ static ErlNifFunc nif_funcs[] = {
{"sha_init", 0, sha_init},
{"sha_update", 2, sha_update},
{"sha_final", 1, sha_final},
+ {"sha224_nif", 1, sha224_nif},
+ {"sha224_init_nif", 0, sha224_init_nif},
+ {"sha224_update_nif", 2, sha224_update_nif},
+ {"sha224_final_nif", 1, sha224_final_nif},
{"sha256_nif", 1, sha256_nif},
{"sha256_init_nif", 0, sha256_init_nif},
{"sha256_update_nif", 2, sha256_update_nif},
{"sha256_final_nif", 1, sha256_final_nif},
+ {"sha384_nif", 1, sha384_nif},
+ {"sha384_init_nif", 0, sha384_init_nif},
+ {"sha384_update_nif", 2, sha384_update_nif},
+ {"sha384_final_nif", 1, sha384_final_nif},
{"sha512_nif", 1, sha512_nif},
{"sha512_init_nif", 0, sha512_init_nif},
{"sha512_update_nif", 2, sha512_update_nif},
@@ -234,6 +279,10 @@ static ErlNifFunc nif_funcs[] = {
{"md4_final", 1, md4_final},
{"md5_mac_n", 3, md5_mac_n},
{"sha_mac_n", 3, sha_mac_n},
+ {"sha224_mac_nif", 3, sha224_mac_nif},
+ {"sha256_mac_nif", 3, sha256_mac_nif},
+ {"sha384_mac_nif", 3, sha384_mac_nif},
+ {"sha512_mac_nif", 3, sha512_mac_nif},
{"hmac_init", 2, hmac_init},
{"hmac_update", 2, hmac_update},
{"hmac_final", 1, hmac_final},
@@ -287,10 +336,12 @@ ERL_NIF_INIT(crypto,nif_funcs,load,reload,upgrade,unload)
#define SHA_CTX_LEN (sizeof(SHA_CTX))
#define SHA_LEN 20
#define SHA_LEN_96 12
+#define SHA224_LEN (224/8)
#define SHA256_LEN (256/8)
#define SHA384_LEN (384/8)
#define SHA512_LEN (512/8)
#define HMAC_INT_LEN 64
+#define HMAC_INT2_LEN 128
#define HMAC_IPAD 0x36
#define HMAC_OPAD 0x5c
@@ -300,6 +351,7 @@ static ErlNifRWLock** lock_vec = NULL; /* Static locks used by openssl */
static ERL_NIF_TERM atom_true;
static ERL_NIF_TERM atom_false;
static ERL_NIF_TERM atom_sha;
+static ERL_NIF_TERM atom_sha224;
static ERL_NIF_TERM atom_sha256;
static ERL_NIF_TERM atom_sha384;
static ERL_NIF_TERM atom_sha512;
@@ -320,6 +372,7 @@ static ERL_NIF_TERM atom_check_failed;
static ERL_NIF_TERM atom_unknown;
static ERL_NIF_TERM atom_none;
static ERL_NIF_TERM atom_notsup;
+static ERL_NIF_TERM atom_digest;
static int is_ok_load_info(ErlNifEnv* env, ERL_NIF_TERM load_info)
@@ -374,6 +427,7 @@ static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info)
atom_true = enif_make_atom(env,"true");
atom_false = enif_make_atom(env,"false");
atom_sha = enif_make_atom(env,"sha");
+ atom_sha224 = enif_make_atom(env,"sha224");
atom_sha256 = enif_make_atom(env,"sha256");
atom_sha384 = enif_make_atom(env,"sha384");
atom_sha512 = enif_make_atom(env,"sha512");
@@ -393,6 +447,9 @@ static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info)
atom_unknown = enif_make_atom(env,"unknown");
atom_none = enif_make_atom(env,"none");
atom_notsup = enif_make_atom(env,"notsup");
+ atom_digest = enif_make_atom(env,"digest");
+
+ init_digest_types(env);
*priv_data = NULL;
library_refc++;
@@ -557,6 +614,67 @@ static ERL_NIF_TERM sha_final(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[
return ret;
}
+static ERL_NIF_TERM sha224_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* (Data) */
+#ifdef HAVE_SHA224
+ ErlNifBinary ibin;
+ ERL_NIF_TERM ret;
+
+ if (!enif_inspect_iolist_as_binary(env, argv[0], &ibin)) {
+ return enif_make_badarg(env);
+ }
+ SHA224((unsigned char *) ibin.data, ibin.size,
+ enif_make_new_binary(env,SHA224_LEN, &ret));
+ return ret;
+#else
+ return atom_notsup;
+#endif
+}
+static ERL_NIF_TERM sha224_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* () */
+#ifdef HAVE_SHA224
+ ERL_NIF_TERM ret;
+ SHA224_Init((SHA256_CTX *) enif_make_new_binary(env, sizeof(SHA256_CTX), &ret));
+ return ret;
+#else
+ return atom_notsup;
+#endif
+}
+static ERL_NIF_TERM sha224_update_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* (Context, Data) */
+#ifdef HAVE_SHA224
+ SHA256_CTX* new_ctx;
+ ErlNifBinary ctx_bin, data_bin;
+ ERL_NIF_TERM ret;
+ if (!enif_inspect_binary(env, argv[0], &ctx_bin) || ctx_bin.size != sizeof(SHA256_CTX)
+ || !enif_inspect_iolist_as_binary(env, argv[1], &data_bin)) {
+ return enif_make_badarg(env);
+ }
+ new_ctx = (SHA256_CTX*) enif_make_new_binary(env,sizeof(SHA256_CTX), &ret);
+ memcpy(new_ctx, ctx_bin.data, sizeof(SHA256_CTX));
+ SHA224_Update(new_ctx, data_bin.data, data_bin.size);
+ return ret;
+#else
+ return atom_notsup;
+#endif
+}
+static ERL_NIF_TERM sha224_final_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* (Context) */
+#ifdef HAVE_SHA224
+ ErlNifBinary ctx_bin;
+ SHA256_CTX ctx_clone;
+ ERL_NIF_TERM ret;
+ if (!enif_inspect_binary(env, argv[0], &ctx_bin) || ctx_bin.size != sizeof(SHA256_CTX)) {
+ return enif_make_badarg(env);
+ }
+ memcpy(&ctx_clone, ctx_bin.data, sizeof(SHA256_CTX)); /* writable */
+ SHA224_Final(enif_make_new_binary(env, SHA224_LEN, &ret), &ctx_clone);
+ return ret;
+#else
+ return atom_notsup;
+#endif
+}
+
static ERL_NIF_TERM sha256_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{/* (Data) */
#ifdef HAVE_SHA256
@@ -618,6 +736,67 @@ static ERL_NIF_TERM sha256_final_nif(ErlNifEnv* env, int argc, const ERL_NIF_TER
#endif
}
+static ERL_NIF_TERM sha384_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* (Data) */
+#ifdef HAVE_SHA384
+ ErlNifBinary ibin;
+ ERL_NIF_TERM ret;
+
+ if (!enif_inspect_iolist_as_binary(env, argv[0], &ibin)) {
+ return enif_make_badarg(env);
+ }
+ SHA384((unsigned char *) ibin.data, ibin.size,
+ enif_make_new_binary(env,SHA384_LEN, &ret));
+ return ret;
+#else
+ return atom_notsup;
+#endif
+}
+static ERL_NIF_TERM sha384_init_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* () */
+#ifdef HAVE_SHA384
+ ERL_NIF_TERM ret;
+ SHA384_Init((SHA512_CTX *) enif_make_new_binary(env, sizeof(SHA512_CTX), &ret));
+ return ret;
+#else
+ return atom_notsup;
+#endif
+}
+static ERL_NIF_TERM sha384_update_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* (Context, Data) */
+#ifdef HAVE_SHA384
+ SHA512_CTX* new_ctx;
+ ErlNifBinary ctx_bin, data_bin;
+ ERL_NIF_TERM ret;
+ if (!enif_inspect_binary(env, argv[0], &ctx_bin) || ctx_bin.size != sizeof(SHA512_CTX)
+ || !enif_inspect_iolist_as_binary(env, argv[1], &data_bin)) {
+ return enif_make_badarg(env);
+ }
+ new_ctx = (SHA512_CTX*) enif_make_new_binary(env,sizeof(SHA512_CTX), &ret);
+ memcpy(new_ctx, ctx_bin.data, sizeof(SHA512_CTX));
+ SHA384_Update(new_ctx, data_bin.data, data_bin.size);
+ return ret;
+#else
+ return atom_notsup;
+#endif
+}
+static ERL_NIF_TERM sha384_final_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* (Context) */
+#ifdef HAVE_SHA384
+ ErlNifBinary ctx_bin;
+ SHA512_CTX ctx_clone;
+ ERL_NIF_TERM ret;
+ if (!enif_inspect_binary(env, argv[0], &ctx_bin) || ctx_bin.size != sizeof(SHA512_CTX)) {
+ return enif_make_badarg(env);
+ }
+ memcpy(&ctx_clone, ctx_bin.data, sizeof(SHA512_CTX)); /* writable */
+ SHA384_Final(enif_make_new_binary(env, SHA384_LEN, &ret), &ctx_clone);
+ return ret;
+#else
+ return atom_notsup;
+#endif
+}
+
static ERL_NIF_TERM sha512_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{/* (Data) */
#ifdef HAVE_SHA512
@@ -760,6 +939,95 @@ static ERL_NIF_TERM sha_mac_n(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[
return ret;
}
+static ERL_NIF_TERM sha224_mac_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* (Key, Data, MacSize) */
+#ifdef HAVE_SHA224
+ unsigned char hmacbuf[SHA224_DIGEST_LENGTH];
+ ErlNifBinary key, data;
+ unsigned mac_sz;
+ ERL_NIF_TERM ret;
+
+ if (!enif_inspect_iolist_as_binary(env, argv[0], &key)
+ || !enif_inspect_iolist_as_binary(env, argv[1], &data)
+ || !enif_get_uint(env,argv[2],&mac_sz) || mac_sz > SHA224_DIGEST_LENGTH) {
+ return enif_make_badarg(env);
+ }
+ hmac_sha224(key.data, key.size, data.data, data.size, hmacbuf);
+ memcpy(enif_make_new_binary(env, mac_sz, &ret),
+ hmacbuf, mac_sz);
+ return ret;
+#else
+ return atom_notsup;
+#endif
+}
+
+static ERL_NIF_TERM sha256_mac_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* (Key, Data, MacSize) */
+#ifdef HAVE_SHA256
+ unsigned char hmacbuf[SHA256_DIGEST_LENGTH];
+ ErlNifBinary key, data;
+ unsigned mac_sz;
+ ERL_NIF_TERM ret;
+
+ if (!enif_inspect_iolist_as_binary(env, argv[0], &key)
+ || !enif_inspect_iolist_as_binary(env, argv[1], &data)
+ || !enif_get_uint(env,argv[2],&mac_sz) || mac_sz > SHA256_DIGEST_LENGTH) {
+ return enif_make_badarg(env);
+ }
+ hmac_sha256(key.data, key.size, data.data, data.size, hmacbuf);
+ memcpy(enif_make_new_binary(env, mac_sz, &ret),
+ hmacbuf, mac_sz);
+ return ret;
+#else
+ return atom_notsup;
+#endif
+}
+
+static ERL_NIF_TERM sha384_mac_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* (Key, Data, MacSize) */
+#ifdef HAVE_SHA384
+ unsigned char hmacbuf[SHA384_DIGEST_LENGTH];
+ ErlNifBinary key, data;
+ unsigned mac_sz;
+ ERL_NIF_TERM ret;
+
+ if (!enif_inspect_iolist_as_binary(env, argv[0], &key)
+ || !enif_inspect_iolist_as_binary(env, argv[1], &data)
+ || !enif_get_uint(env,argv[2],&mac_sz) || mac_sz > SHA384_DIGEST_LENGTH) {
+ return enif_make_badarg(env);
+ }
+ hmac_sha384(key.data, key.size, data.data, data.size, hmacbuf);
+ memcpy(enif_make_new_binary(env, mac_sz, &ret),
+ hmacbuf, mac_sz);
+ return ret;
+#else
+ return atom_notsup;
+#endif
+}
+
+
+static ERL_NIF_TERM sha512_mac_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* (Key, Data, MacSize) */
+#ifdef HAVE_SHA512
+ unsigned char hmacbuf[SHA512_DIGEST_LENGTH];
+ ErlNifBinary key, data;
+ unsigned mac_sz;
+ ERL_NIF_TERM ret;
+
+ if (!enif_inspect_iolist_as_binary(env, argv[0], &key)
+ || !enif_inspect_iolist_as_binary(env, argv[1], &data)
+ || !enif_get_uint(env,argv[2],&mac_sz) || mac_sz > SHA512_DIGEST_LENGTH) {
+ return enif_make_badarg(env);
+ }
+ hmac_sha512(key.data, key.size, data.data, data.size, hmacbuf);
+ memcpy(enif_make_new_binary(env, mac_sz, &ret),
+ hmacbuf, mac_sz);
+ return ret;
+#else
+ return atom_notsup;
+#endif
+}
+
static ERL_NIF_TERM hmac_init(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{/* (Type, Key) */
ErlNifBinary key;
@@ -768,6 +1036,18 @@ static ERL_NIF_TERM hmac_init(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[
const EVP_MD *md;
if (argv[0] == atom_sha) md = EVP_sha1();
+#ifdef HAVE_SHA224
+ else if (argv[0] == atom_sha224) md = EVP_sha224();
+#endif
+#ifdef HAVE_SHA256
+ else if (argv[0] == atom_sha256) md = EVP_sha256();
+#endif
+#ifdef HAVE_SHA384
+ else if (argv[0] == atom_sha384) md = EVP_sha384();
+#endif
+#ifdef HAVE_SHA512
+ else if (argv[0] == atom_sha512) md = EVP_sha512();
+#endif
else if (argv[0] == atom_md5) md = EVP_md5();
else if (argv[0] == atom_ripemd160) md = EVP_ripemd160();
else goto badarg;
@@ -954,8 +1234,7 @@ static ERL_NIF_TERM aes_cfb_128_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TE
if (!enif_inspect_iolist_as_binary(env, argv[0], &key) || key.size != 16
|| !enif_inspect_binary(env, argv[1], &ivec) || ivec.size != 16
- || !enif_inspect_iolist_as_binary(env, argv[2], &text)
- || text.size % 16 != 0) {
+ || !enif_inspect_iolist_as_binary(env, argv[2], &text)) {
return enif_make_badarg(env);
}
@@ -1208,14 +1487,43 @@ static int inspect_mpint(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifBinary* bin)
}
static ERL_NIF_TERM dss_verify(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
-{/* (DigestType,Data,Signature,Key=[P, Q, G, Y]) */
+{/* (DigestType|none, Data|{digest,Digest}, Signature,Key=[P, Q, G, Y]) */
ErlNifBinary data_bin, sign_bin;
BIGNUM *dsa_p = NULL, *dsa_q = NULL, *dsa_g = NULL, *dsa_y = NULL;
unsigned char hmacbuf[SHA_DIGEST_LENGTH];
+ unsigned char* digest;
ERL_NIF_TERM head, tail;
+ const ERL_NIF_TERM* tpl_terms;
+ int tpl_arity;
DSA *dsa;
int i;
+ if (argv[0] == atom_sha) {
+ if (enif_get_tuple(env, argv[1], &tpl_arity, &tpl_terms)) {
+ if (tpl_arity != 2 || tpl_terms[0] != atom_digest
+ || !enif_inspect_binary(env, tpl_terms[1], &data_bin)
+ || data_bin.size != SHA_DIGEST_LENGTH) {
+
+ return enif_make_badarg(env);
+ }
+ digest = data_bin.data;
+ }
+ else {
+ if (!inspect_mpint(env, argv[1], &data_bin)) {
+ return enif_make_badarg(env);
+ }
+ SHA1(data_bin.data+4, data_bin.size-4, hmacbuf);
+ digest = hmacbuf;
+ }
+ }
+ else if (argv[0] == atom_none && enif_inspect_binary(env, argv[1], &data_bin)
+ && data_bin.size == SHA_DIGEST_LENGTH) {
+ digest = data_bin.data;
+ }
+ else {
+ return enif_make_badarg(env);
+ }
+
if (!inspect_mpint(env, argv[2], &sign_bin)
|| !enif_get_list_cell(env, argv[3], &head, &tail)
|| !get_bn_from_mpint(env, head, &dsa_p)
@@ -1226,23 +1534,13 @@ static ERL_NIF_TERM dss_verify(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv
|| !enif_get_list_cell(env, tail, &head, &tail)
|| !get_bn_from_mpint(env, head, &dsa_y)
|| !enif_is_empty_list(env,tail)) {
- badarg:
+
if (dsa_p) BN_free(dsa_p);
if (dsa_q) BN_free(dsa_q);
if (dsa_g) BN_free(dsa_g);
if (dsa_y) BN_free(dsa_y);
return enif_make_badarg(env);
}
- if (argv[0] == atom_sha && inspect_mpint(env, argv[1], &data_bin)) {
- SHA1(data_bin.data+4, data_bin.size-4, hmacbuf);
- }
- else if (argv[0] == atom_none && enif_inspect_binary(env, argv[1], &data_bin)
- && data_bin.size == SHA_DIGEST_LENGTH) {
- memcpy(hmacbuf, data_bin.data, SHA_DIGEST_LENGTH);
- }
- else {
- goto badarg;
- }
dsa = DSA_new();
dsa->p = dsa_p;
@@ -1250,23 +1548,134 @@ static ERL_NIF_TERM dss_verify(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv
dsa->g = dsa_g;
dsa->priv_key = NULL;
dsa->pub_key = dsa_y;
- i = DSA_verify(0, hmacbuf, SHA_DIGEST_LENGTH,
+ i = DSA_verify(0, digest, SHA_DIGEST_LENGTH,
sign_bin.data+4, sign_bin.size-4, dsa);
DSA_free(dsa);
return(i > 0) ? atom_true : atom_false;
}
+
+static void md5_digest(unsigned char* in, unsigned int in_len, unsigned char* out)
+{
+ MD5(in, in_len, out);
+}
+static void sha1_digest(unsigned char* in, unsigned int in_len, unsigned char* out)
+{
+ SHA1(in, in_len, out);
+}
+#ifdef HAVE_SHA224
+static void sha224_digest(unsigned char* in, unsigned int in_len, unsigned char* out)
+{
+ SHA224(in, in_len, out);
+}
+#endif
+#ifdef HAVE_SHA256
+static void sha256_digest(unsigned char* in, unsigned int in_len, unsigned char* out)
+{
+ SHA256(in, in_len, out);
+}
+#endif
+#ifdef HAVE_SHA384
+static void sha384_digest(unsigned char* in, unsigned int in_len, unsigned char* out)
+{
+ SHA384(in, in_len, out);
+}
+#endif
+#ifdef HAVE_SHA512
+static void sha512_digest(unsigned char* in, unsigned int in_len, unsigned char* out)
+{
+ SHA512(in, in_len, out);
+}
+#endif
+
+struct digest_type_t {
+ const char* type_str;
+ unsigned len; /* 0 if notsup */
+ int NID_type;
+ void (*funcp)(unsigned char* in, unsigned int in_len, unsigned char* out);
+ ERL_NIF_TERM type_atom;
+};
+
+struct digest_type_t digest_types[] =
+{
+ {"md5", MD5_DIGEST_LENGTH, NID_md5, md5_digest},
+ {"sha", SHA_DIGEST_LENGTH, NID_sha1, sha1_digest},
+ {"sha224",
+#ifdef HAVE_SHA224
+ SHA224_LEN, NID_sha224, sha224_digest
+#else
+ 0
+#endif
+ },
+ {"sha256",
+#ifdef HAVE_SHA256
+ SHA256_LEN, NID_sha256, sha256_digest
+#else
+ 0
+#endif
+ },
+ {"sha384",
+#ifdef HAVE_SHA384
+ SHA384_LEN, NID_sha384, sha384_digest
+#else
+ 0
+#endif
+ },
+ {"sha512",
+#ifdef HAVE_SHA512
+ SHA512_LEN, NID_sha512, sha512_digest
+#else
+ 0
+#endif
+ },
+ {NULL}
+};
+
+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);
+ }
+
+}
+
+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) {
+ return p;
+ }
+ }
+ return NULL;
+}
+
static ERL_NIF_TERM rsa_verify_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
-{/* (Type, Data, Signature, Key=[E,N]) */
+{/* (Type, Data|{digest,Digest}, Signature, Key=[E,N]) */
ErlNifBinary data_bin, sign_bin;
unsigned char hmacbuf[SHA512_LEN];
ERL_NIF_TERM head, tail, ret;
int i;
- RSA* rsa = RSA_new();
+ RSA* rsa;
const ERL_NIF_TERM type = argv[0];
+ const ERL_NIF_TERM* tpl_terms;
+ int tpl_arity;
+ struct digest_type_t* digp = NULL;
+ unsigned char* digest = NULL;
+
+ digp = get_digest_type(type);
+ if (!digp) {
+ return enif_make_badarg(env);
+ }
+ if (!digp->len) {
+ return atom_notsup;
+ }
- if (!inspect_mpint(env, argv[1], &data_bin)
- || !inspect_mpint(env, argv[2], &sign_bin)
+ rsa = RSA_new();
+
+ if (!inspect_mpint(env, argv[2], &sign_bin)
|| !enif_get_list_cell(env, argv[3], &head, &tail)
|| !get_bn_from_mpint(env, head, &rsa->e)
|| !enif_get_list_cell(env, tail, &head, &tail)
@@ -1274,59 +1683,38 @@ static ERL_NIF_TERM rsa_verify_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM
|| !enif_is_empty_list(env, tail)) {
ret = enif_make_badarg(env);
+ goto done;
}
- else {
- if (type == atom_sha) {
- SHA1(data_bin.data+4, data_bin.size-4, hmacbuf);
- i = RSA_verify(NID_sha1, hmacbuf, SHA_DIGEST_LENGTH,
- sign_bin.data+4, sign_bin.size-4, rsa);
- }
- else if (type == atom_sha256) {
- #ifdef HAVE_SHA256
- SHA256(data_bin.data+4, data_bin.size-4, hmacbuf);
- i = RSA_verify(NID_sha256, hmacbuf, SHA256_LEN,
- sign_bin.data+4, sign_bin.size-4, rsa);
- #else
- ret = atom_notsup;
- goto done;
- #endif
- }
- else if (type == atom_sha384) {
- #ifdef HAVE_SHA384
- SHA384(data_bin.data+4, data_bin.size-4, hmacbuf);
- i = RSA_verify(NID_sha384, hmacbuf, SHA384_LEN,
- sign_bin.data+4, sign_bin.size-4, rsa);
- #else
- ret = atom_notsup;
- goto done;
- #endif
- }
- else if (type == atom_sha512) {
- #ifdef HAVE_SHA512
- SHA512(data_bin.data+4, data_bin.size-4, hmacbuf);
- i = RSA_verify(NID_sha512, hmacbuf, SHA512_LEN,
- sign_bin.data+4, sign_bin.size-4, rsa);
- #else
- ret = atom_notsup;
- goto done;
- #endif
- }
- else if (type == atom_md5) {
- MD5(data_bin.data+4, data_bin.size-4, hmacbuf);
- i = RSA_verify(NID_md5, hmacbuf, MD5_DIGEST_LENGTH,
- sign_bin.data+4, sign_bin.size-4, rsa);
- }
- else {
+ if (enif_get_tuple(env, argv[1], &tpl_arity, &tpl_terms)) {
+ if (tpl_arity != 2 || tpl_terms[0] != atom_digest
+ || !enif_inspect_binary(env, tpl_terms[1], &data_bin)
+ || data_bin.size != digp->len) {
+
ret = enif_make_badarg(env);
goto done;
}
- ret = (i==1 ? atom_true : atom_false);
- }
+ digest = data_bin.data;
+ }
+ else if (inspect_mpint(env, argv[1], &data_bin)) {
+ digest = hmacbuf;
+ digp->funcp(data_bin.data+4, data_bin.size-4, digest);
+ }
+ else {
+ ret = enif_make_badarg(env);
+ goto done;
+ }
+
+ i = RSA_verify(digp->NID_type, digest, digp->len,
+ sign_bin.data+4, sign_bin.size-4, rsa);
+
+ ret = (i==1 ? atom_true : atom_false);
+
done:
RSA_free(rsa);
return ret;
}
+
static ERL_NIF_TERM aes_cbc_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{/* (Key, IVec, Data, IsEncrypt) */
ErlNifBinary key_bin, ivec_bin, data_bin;
@@ -1456,48 +1844,88 @@ static ERL_NIF_TERM rc2_cbc_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM a
return ret;
}
-static ERL_NIF_TERM rsa_sign_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
-{/* (Type,Data,Key=[E,N,D]) */
- ErlNifBinary data_bin, ret_bin;
+static int get_rsa_private_key(ErlNifEnv* env, ERL_NIF_TERM key, RSA *rsa)
+{
+ /* key=[E,N,D]|[E,N,D,P1,P2,E1,E2,C] */
ERL_NIF_TERM head, tail;
- unsigned char hmacbuf[SHA_DIGEST_LENGTH];
- unsigned rsa_s_len;
- RSA *rsa = RSA_new();
- int i, is_sha;
- if (argv[0] == atom_sha) is_sha = 1;
- else if (argv[0] == atom_md5) is_sha = 0;
- else goto badarg;
-
- if (!inspect_mpint(env,argv[1],&data_bin)
- || !enif_get_list_cell(env, argv[2], &head, &tail)
+ if (!enif_get_list_cell(env, key, &head, &tail)
|| !get_bn_from_mpint(env, head, &rsa->e)
|| !enif_get_list_cell(env, tail, &head, &tail)
|| !get_bn_from_mpint(env, head, &rsa->n)
|| !enif_get_list_cell(env, tail, &head, &tail)
|| !get_bn_from_mpint(env, head, &rsa->d)
- || !enif_is_empty_list(env,tail)) {
- badarg:
- RSA_free(rsa);
+ || (!enif_is_empty_list(env, tail) &&
+ (!enif_get_list_cell(env, tail, &head, &tail)
+ || !get_bn_from_mpint(env, head, &rsa->p)
+ || !enif_get_list_cell(env, tail, &head, &tail)
+ || !get_bn_from_mpint(env, head, &rsa->q)
+ || !enif_get_list_cell(env, tail, &head, &tail)
+ || !get_bn_from_mpint(env, head, &rsa->dmp1)
+ || !enif_get_list_cell(env, tail, &head, &tail)
+ || !get_bn_from_mpint(env, head, &rsa->dmq1)
+ || !enif_get_list_cell(env, tail, &head, &tail)
+ || !get_bn_from_mpint(env, head, &rsa->iqmp)
+ || !enif_is_empty_list(env, tail)))) {
+ return 0;
+ }
+ return 1;
+}
+
+static ERL_NIF_TERM rsa_sign_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* (Type, Data|{digest,Digest}, Key=[E,N,D]|[E,N,D,P1,P2,E1,E2,C]) */
+ ErlNifBinary data_bin, ret_bin;
+ unsigned char hmacbuf[SHA512_LEN];
+ unsigned rsa_s_len;
+ RSA* rsa;
+ int i;
+ const ERL_NIF_TERM* tpl_terms;
+ int tpl_arity;
+ struct digest_type_t *digp;
+ unsigned char* digest;
+
+ digp = get_digest_type(argv[0]);
+ if (!digp) {
return enif_make_badarg(env);
}
- enif_alloc_binary(RSA_size(rsa), &ret_bin);
- if (is_sha) {
- SHA1(data_bin.data+4, data_bin.size-4, hmacbuf);
- ERL_VALGRIND_ASSERT_MEM_DEFINED(hmacbuf, SHA_DIGEST_LENGTH);
- i = RSA_sign(NID_sha1, hmacbuf, SHA_DIGEST_LENGTH,
- ret_bin.data, &rsa_s_len, rsa);
+ if (!digp->len) {
+ return atom_notsup;
+ }
+
+ if (enif_get_tuple(env, argv[1], &tpl_arity, &tpl_terms)) {
+ if (tpl_arity != 2 || tpl_terms[0] != atom_digest
+ || !enif_inspect_binary(env, tpl_terms[1], &data_bin)
+ || data_bin.size != digp->len) {
+
+ return enif_make_badarg(env);
+ }
+ digest = data_bin.data;
}
else {
- MD5(data_bin.data+4, data_bin.size-4, hmacbuf);
- ERL_VALGRIND_ASSERT_MEM_DEFINED(hmacbuf, MD5_DIGEST_LENGTH);
- i = RSA_sign(NID_md5, hmacbuf,MD5_DIGEST_LENGTH,
- ret_bin.data, &rsa_s_len, rsa);
+ if (!inspect_mpint(env,argv[1],&data_bin)) {
+ return enif_make_badarg(env);
+ }
+ digest = hmacbuf;
+ digp->funcp(data_bin.data+4, data_bin.size-4, digest);
}
+
+ rsa = RSA_new();
+ if (!get_rsa_private_key(env, argv[2], rsa)) {
+ RSA_free(rsa);
+ return enif_make_badarg(env);
+ }
+
+
+ enif_alloc_binary(RSA_size(rsa), &ret_bin);
+
+ ERL_VALGRIND_ASSERT_MEM_DEFINED(digest, digp->len);
+ i = RSA_sign(digp->NID_type, digest, digp->len,
+ ret_bin.data, &rsa_s_len, rsa);
+
RSA_free(rsa);
if (i) {
ERL_VALGRIND_MAKE_MEM_DEFINED(ret_bin.data, rsa_s_len);
- if (rsa_s_len != data_bin.size) {
+ if (rsa_s_len != ret_bin.size) {
enif_realloc_binary(&ret_bin, rsa_s_len);
ERL_VALGRIND_ASSERT_MEM_DEFINED(ret_bin.data, rsa_s_len);
}
@@ -1509,15 +1937,49 @@ static ERL_NIF_TERM rsa_sign_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM ar
}
}
+
static ERL_NIF_TERM dss_sign_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
-{/* (DigesType, Data, Key=[P,Q,G,PrivKey]) */
+{/* (DigesType|none, Data|{digest,Digest}, Key=[P,Q,G,PrivKey]) */
ErlNifBinary data_bin, ret_bin;
ERL_NIF_TERM head, tail;
unsigned char hmacbuf[SHA_DIGEST_LENGTH];
unsigned int dsa_s_len;
- DSA* dsa = DSA_new();
+ const ERL_NIF_TERM* tpl_terms;
+ int tpl_arity;
+ unsigned char* digest = NULL;
+ DSA* dsa;
int i;
+ if (argv[0] == atom_sha) {
+ if (enif_get_tuple(env, argv[1], &tpl_arity, &tpl_terms)) {
+ if (tpl_arity != 2 || tpl_terms[0] != atom_digest
+ || !enif_inspect_binary(env, tpl_terms[1], &data_bin)
+ || data_bin.size != SHA_DIGEST_LENGTH) {
+
+ return enif_make_badarg(env);
+ }
+ digest = data_bin.data;
+ }
+ else {
+ if (!inspect_mpint(env,argv[1],&data_bin)) {
+ return enif_make_badarg(env);
+ }
+ SHA1(data_bin.data+4, data_bin.size-4, hmacbuf);
+ digest = hmacbuf;
+ }
+ }
+ else if (argv[0] == atom_none
+ && enif_inspect_binary(env,argv[1],&data_bin)
+ && data_bin.size == SHA_DIGEST_LENGTH) {
+
+ digest = data_bin.data;
+ }
+ else {
+ return enif_make_badarg(env);
+ }
+
+ dsa = DSA_new();
+
dsa->pub_key = NULL;
if (!enif_get_list_cell(env, argv[2], &head, &tail)
|| !get_bn_from_mpint(env, head, &dsa->p)
@@ -1528,23 +1990,12 @@ static ERL_NIF_TERM dss_sign_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM ar
|| !enif_get_list_cell(env, tail, &head, &tail)
|| !get_bn_from_mpint(env, head, &dsa->priv_key)
|| !enif_is_empty_list(env,tail)) {
- goto badarg;
- }
- if (argv[0] == atom_sha && inspect_mpint(env, argv[1], &data_bin)) {
- SHA1(data_bin.data+4, data_bin.size-4, hmacbuf);
- }
- else if (argv[0] == atom_none && enif_inspect_binary(env,argv[1],&data_bin)
- && data_bin.size == SHA_DIGEST_LENGTH) {
- memcpy(hmacbuf, data_bin.data, SHA_DIGEST_LENGTH);
- }
- else {
- badarg:
DSA_free(dsa);
return enif_make_badarg(env);
}
enif_alloc_binary(DSA_size(dsa), &ret_bin);
- i = DSA_sign(NID_sha1, hmacbuf, SHA_DIGEST_LENGTH,
+ i = DSA_sign(NID_sha1, digest, SHA_DIGEST_LENGTH,
ret_bin.data, &dsa_s_len, dsa);
DSA_free(dsa);
if (i) {
@@ -1558,6 +2009,7 @@ static ERL_NIF_TERM dss_sign_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM ar
}
}
+
static int rsa_pad(ERL_NIF_TERM term, int* padding)
{
if (term == atom_rsa_pkcs1_padding) {
@@ -1623,20 +2075,13 @@ static ERL_NIF_TERM rsa_public_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TER
}
static ERL_NIF_TERM rsa_private_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
-{/* (Data, PublKey=[E,N,D], Padding, IsEncrypt) */
+{/* (Data, Key=[E,N,D]|[E,N,D,P1,P2,E1,E2,C], Padding, IsEncrypt) */
ErlNifBinary data_bin, ret_bin;
- ERL_NIF_TERM head, tail;
int padding, i;
RSA* rsa = RSA_new();
if (!enif_inspect_binary(env, argv[0], &data_bin)
- || !enif_get_list_cell(env, argv[1], &head, &tail)
- || !get_bn_from_mpint(env, head, &rsa->e)
- || !enif_get_list_cell(env, tail, &head, &tail)
- || !get_bn_from_mpint(env, head, &rsa->n)
- || !enif_get_list_cell(env, tail, &head, &tail)
- || !get_bn_from_mpint(env, head, &rsa->d)
- || !enif_is_empty_list(env,tail)
+ || !get_rsa_private_key(env, argv[1], rsa)
|| !rsa_pad(argv[2], &padding)) {
RSA_free(rsa);
@@ -2026,3 +2471,166 @@ static void hmac_sha1(unsigned char *key, int klen,
SHA1_Final((unsigned char *) hmacbuf, &ctx);
}
+#ifdef HAVE_SHA224
+static void hmac_sha224(unsigned char *key, int klen,
+ unsigned char *dbuf, int dlen,
+ unsigned char *hmacbuf)
+{
+ SHA256_CTX ctx;
+ char ipad[HMAC_INT_LEN];
+ char opad[HMAC_INT_LEN];
+ unsigned char nkey[SHA224_DIGEST_LENGTH];
+ int i;
+
+ /* Change key if longer than 64 bytes */
+ if (klen > HMAC_INT_LEN) {
+ SHA224(key, klen, nkey);
+ key = nkey;
+ klen = SHA224_DIGEST_LENGTH;
+ }
+
+ memset(ipad, '\0', sizeof(ipad));
+ memset(opad, '\0', sizeof(opad));
+ memcpy(ipad, key, klen);
+ memcpy(opad, key, klen);
+
+ for (i = 0; i < HMAC_INT_LEN; i++) {
+ ipad[i] ^= HMAC_IPAD;
+ opad[i] ^= HMAC_OPAD;
+ }
+
+ /* inner SHA */
+ SHA224_Init(&ctx);
+ SHA224_Update(&ctx, ipad, HMAC_INT_LEN);
+ SHA224_Update(&ctx, dbuf, dlen);
+ SHA224_Final((unsigned char *) hmacbuf, &ctx);
+ /* outer SHA */
+ SHA224_Init(&ctx);
+ SHA224_Update(&ctx, opad, HMAC_INT_LEN);
+ SHA224_Update(&ctx, hmacbuf, SHA224_DIGEST_LENGTH);
+ SHA224_Final((unsigned char *) hmacbuf, &ctx);
+}
+#endif
+
+#ifdef HAVE_SHA256
+static void hmac_sha256(unsigned char *key, int klen,
+ unsigned char *dbuf, int dlen,
+ unsigned char *hmacbuf)
+{
+ SHA256_CTX ctx;
+ char ipad[HMAC_INT_LEN];
+ char opad[HMAC_INT_LEN];
+ unsigned char nkey[SHA256_DIGEST_LENGTH];
+ int i;
+
+ /* Change key if longer than 64 bytes */
+ if (klen > HMAC_INT_LEN) {
+ SHA256(key, klen, nkey);
+ key = nkey;
+ klen = SHA256_DIGEST_LENGTH;
+ }
+
+ memset(ipad, '\0', sizeof(ipad));
+ memset(opad, '\0', sizeof(opad));
+ memcpy(ipad, key, klen);
+ memcpy(opad, key, klen);
+
+ for (i = 0; i < HMAC_INT_LEN; i++) {
+ ipad[i] ^= HMAC_IPAD;
+ opad[i] ^= HMAC_OPAD;
+ }
+
+ /* inner SHA */
+ SHA256_Init(&ctx);
+ SHA256_Update(&ctx, ipad, HMAC_INT_LEN);
+ SHA256_Update(&ctx, dbuf, dlen);
+ SHA256_Final((unsigned char *) hmacbuf, &ctx);
+ /* outer SHA */
+ SHA256_Init(&ctx);
+ SHA256_Update(&ctx, opad, HMAC_INT_LEN);
+ SHA256_Update(&ctx, hmacbuf, SHA256_DIGEST_LENGTH);
+ SHA256_Final((unsigned char *) hmacbuf, &ctx);
+}
+#endif
+
+#ifdef HAVE_SHA384
+static void hmac_sha384(unsigned char *key, int klen,
+ unsigned char *dbuf, int dlen,
+ unsigned char *hmacbuf)
+{
+ SHA512_CTX ctx;
+ char ipad[HMAC_INT2_LEN];
+ char opad[HMAC_INT2_LEN];
+ unsigned char nkey[SHA384_DIGEST_LENGTH];
+ int i;
+
+ /* Change key if longer than 64 bytes */
+ if (klen > HMAC_INT2_LEN) {
+ SHA384(key, klen, nkey);
+ key = nkey;
+ klen = SHA384_DIGEST_LENGTH;
+ }
+
+ memset(ipad, '\0', sizeof(ipad));
+ memset(opad, '\0', sizeof(opad));
+ memcpy(ipad, key, klen);
+ memcpy(opad, key, klen);
+
+ for (i = 0; i < HMAC_INT2_LEN; i++) {
+ ipad[i] ^= HMAC_IPAD;
+ opad[i] ^= HMAC_OPAD;
+ }
+
+ /* inner SHA */
+ SHA384_Init(&ctx);
+ SHA384_Update(&ctx, ipad, HMAC_INT2_LEN);
+ SHA384_Update(&ctx, dbuf, dlen);
+ SHA384_Final((unsigned char *) hmacbuf, &ctx);
+ /* outer SHA */
+ SHA384_Init(&ctx);
+ SHA384_Update(&ctx, opad, HMAC_INT2_LEN);
+ SHA384_Update(&ctx, hmacbuf, SHA384_DIGEST_LENGTH);
+ SHA384_Final((unsigned char *) hmacbuf, &ctx);
+}
+#endif
+
+#ifdef HAVE_SHA512
+static void hmac_sha512(unsigned char *key, int klen,
+ unsigned char *dbuf, int dlen,
+ unsigned char *hmacbuf)
+{
+ SHA512_CTX ctx;
+ char ipad[HMAC_INT2_LEN];
+ char opad[HMAC_INT2_LEN];
+ unsigned char nkey[SHA512_DIGEST_LENGTH];
+ int i;
+
+ /* Change key if longer than 64 bytes */
+ if (klen > HMAC_INT2_LEN) {
+ SHA512(key, klen, nkey);
+ key = nkey;
+ klen = SHA512_DIGEST_LENGTH;
+ }
+
+ memset(ipad, '\0', sizeof(ipad));
+ memset(opad, '\0', sizeof(opad));
+ memcpy(ipad, key, klen);
+ memcpy(opad, key, klen);
+
+ for (i = 0; i < HMAC_INT2_LEN; i++) {
+ ipad[i] ^= HMAC_IPAD;
+ opad[i] ^= HMAC_OPAD;
+ }
+
+ /* inner SHA */
+ SHA512_Init(&ctx);
+ SHA512_Update(&ctx, ipad, HMAC_INT2_LEN);
+ SHA512_Update(&ctx, dbuf, dlen);
+ SHA512_Final((unsigned char *) hmacbuf, &ctx);
+ /* outer SHA */
+ SHA512_Init(&ctx);
+ SHA512_Update(&ctx, opad, HMAC_INT2_LEN);
+ SHA512_Update(&ctx, hmacbuf, SHA512_DIGEST_LENGTH);
+ SHA512_Final((unsigned char *) hmacbuf, &ctx);
+}
+#endif
diff --git a/lib/crypto/doc/src/Makefile b/lib/crypto/doc/src/Makefile
index 03aaba939b..00ae70fb4a 100644
--- a/lib/crypto/doc/src/Makefile
+++ b/lib/crypto/doc/src/Makefile
@@ -100,16 +100,16 @@ clean clean_docs clean_tex:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man6
- $(INSTALL_DATA) $(MAN6DIR)/* $(RELEASE_PATH)/man/man6
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man6"
+ $(INSTALL_DATA) $(MAN6DIR)/* "$(RELEASE_PATH)/man/man6"
release_spec:
diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml
index 8cb893cd1c..4dcd6fc4ea 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>2011</year>
+ <year>1999</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -256,6 +256,57 @@ Mpint() = <![CDATA[<<ByteLen:32/integer-big, Bytes:ByteLen/binary>>]]>
</desc>
</func>
<func>
+ <name>hash(Type, Data) -> Digest</name>
+ <fsummary></fsummary>
+ <type>
+ <v>Type = md4 | md5 | sha | sha224 | sha256 | sha384 | sha512</v>
+ <v>Data = iodata()</v>
+ <v>Digest = binary()</v>
+ </type>
+ <desc>
+ <p>Computes a message digest of type <c>Type</c> from <c>Data</c>.</p>
+ </desc>
+ </func>
+ <func>
+ <name>hash_init(Type) -> Context</name>
+ <fsummary></fsummary>
+ <type>
+ <v>Type = md4 | md5 | sha | sha224 | sha256 | sha384 | sha512</v>
+ </type>
+ <desc>
+ <p>Initializes the context for streaming hash operations. <c>Type</c> determines
+ which digest to use. The returned context should be used as argument
+ to <seealso marker="#hash_update/2">hash_update</seealso>.</p>
+ </desc>
+ </func>
+ <func>
+ <name>hash_update(Context, Data) -> NewContext</name>
+ <fsummary></fsummary>
+ <type>
+ <v>Data = iodata()</v>
+ </type>
+ <desc>
+ <p>Updates the digest represented by <c>Context</c> using the given <c>Data</c>. <c>Context</c>
+ must have been generated using <seealso marker="#hash_init/1">hash_init</seealso>
+ or a previous call to this function. <c>Data</c> can be any length. <c>NewContext</c>
+ must be passed into the next call to <c>hash_update</c>
+ or <seealso marker="#hash_final/1">hash_final</seealso>.</p>
+ </desc>
+ </func>
+ <func>
+ <name>hash_final(Context) -> Digest</name>
+ <fsummary></fsummary>
+ <type>
+ <v>Digest = binary()</v>
+ </type>
+ <desc>
+ <p>Finalizes the hash operation referenced by <c>Context</c> returned
+ from a previous call to <seealso marker="#hash_update/2">hash_update</seealso>.
+ The size of <c>Digest</c> is determined by the type of hash
+ function used to generate it.</p>
+ </desc>
+ </func>
+ <func>
<name>md5_mac(Key, Data) -> Mac</name>
<fsummary>Compute an <c>MD5 MAC</c>message authentification code</fsummary>
<type>
@@ -643,16 +694,14 @@ Mpint() = <![CDATA[<<ByteLen:32/integer-big, Bytes:ByteLen/binary>>]]>
<func>
<name>aes_cfb_128_encrypt(Key, IVec, Text) -> Cipher</name>
- <name>aes_cbc_128_encrypt(Key, IVec, Text) -> Cipher</name>
- <fsummary>Encrypt <c>Text</c>according to AES in Cipher Feedback mode or Cipher Block Chaining mode</fsummary>
+ <fsummary>Encrypt <c>Text</c>according to AES in Cipher Feedback mode</fsummary>
<type>
<v>Key = Text = iolist() | binary()</v>
<v>IVec = Cipher = binary()</v>
</type>
<desc>
<p>Encrypts <c>Text</c> according to AES in Cipher Feedback
- mode (CFB) or Cipher Block Chaining mode (CBC). <c>Text</c>
- must be a multiple of 128 bits (16 bytes). <c>Key</c> is the
+ mode (CFB). <c>Key</c> is the
AES key, and <c>IVec</c> is an arbitrary initializing vector.
The lengths of <c>Key</c> and <c>IVec</c> must be 128 bits
(16 bytes).</p>
@@ -660,15 +709,45 @@ Mpint() = <![CDATA[<<ByteLen:32/integer-big, Bytes:ByteLen/binary>>]]>
</func>
<func>
<name>aes_cfb_128_decrypt(Key, IVec, Cipher) -> Text</name>
+ <fsummary>Decrypt <c>Cipher</c>according to AES in Cipher Feedback mode</fsummary>
+ <type>
+ <v>Key = Cipher = iolist() | binary()</v>
+ <v>IVec = Text = binary()</v>
+ </type>
+ <desc>
+ <p>Decrypts <c>Cipher</c> according to AES in Cipher Feedback Mode (CFB).
+ <c>Key</c> is the AES key, and <c>IVec</c> is an arbitrary
+ initializing vector. <c>Key</c> and <c>IVec</c> must have
+ the same values as those used when encrypting. The lengths of
+ <c>Key</c> and <c>IVec</c> must be 128 bits (16 bytes).</p>
+ </desc>
+ </func>
+ <func>
+ <name>aes_cbc_128_encrypt(Key, IVec, Text) -> Cipher</name>
+ <fsummary>Encrypt <c>Text</c>according to AES in Cipher Block Chaining mode</fsummary>
+ <type>
+ <v>Key = Text = iolist() | binary()</v>
+ <v>IVec = Cipher = binary()</v>
+ </type>
+ <desc>
+ <p>Encrypts <c>Text</c> according to AES in Cipher Block Chaining
+ mode (CBC). <c>Text</c>
+ must be a multiple of 128 bits (16 bytes). <c>Key</c> is the
+ AES key, and <c>IVec</c> is an arbitrary initializing vector.
+ The lengths of <c>Key</c> and <c>IVec</c> must be 128 bits
+ (16 bytes).</p>
+ </desc>
+ </func>
+ <func>
<name>aes_cbc_128_decrypt(Key, IVec, Cipher) -> Text</name>
- <fsummary>Decrypt <c>Cipher</c>according to AES in Cipher Feedback mode or Cipher Block Chaining mode</fsummary>
+ <fsummary>Decrypt <c>Cipher</c>according to AES in Cipher Block Chaining mode</fsummary>
<type>
<v>Key = Cipher = iolist() | binary()</v>
<v>IVec = Text = binary()</v>
</type>
<desc>
- <p>Decrypts <c>Cipher</c> according to Cipher Feedback Mode (CFB)
- or Cipher Block Chaining mode (CBC).
+ <p>Decrypts <c>Cipher</c> according to AES in Cipher Block
+ Chaining mode (CBC).
<c>Key</c> is the AES key, and <c>IVec</c> is an arbitrary
initializing vector. <c>Key</c> and <c>IVec</c> must have
the same values as those used when encrypting. <c>Cipher</c>
@@ -865,46 +944,56 @@ Mpint() = <![CDATA[<<ByteLen:32/integer-big, Bytes:ByteLen/binary>>]]>
</func>
<func>
- <name>rsa_sign(Data, Key) -> Signature</name>
- <name>rsa_sign(DigestType, Data, Key) -> Signature</name>
+ <name>rsa_sign(DataOrDigest, Key) -> Signature</name>
+ <name>rsa_sign(DigestType, DataOrDigest, Key) -> Signature</name>
<fsummary>Sign the data using rsa with the given key.</fsummary>
<type>
+ <v>DataOrDigest = Data | {digest,Digest}</v>
<v>Data = Mpint</v>
- <v>Key = [E, N, D]</v>
+ <v>Digest = binary()</v>
+ <v>Key = [E, N, D] | [E, N, D, P1, P2, E1, E2, C]</v>
<v>E, N, D = Mpint</v>
<d>Where <c>E</c> is the public exponent, <c>N</c> is public modulus and
<c>D</c> is the private exponent.</d>
- <v>DigestType = md5 | sha</v>
+ <v>P1, P2, E1, E2, C = Mpint</v>
+ <d>The longer key format contains redundant information that will make
+ the calculation faster. <c>P1,P2</c> are first and second prime factors.
+ <c>E1,E2</c> are first and second exponents. <c>C</c> is the CRT coefficient.
+ Terminology is taken from RFC 3447.</d>
+ <v>DigestType = md5 | sha | sha224 | sha256 | sha384 | sha512</v>
<d>The default <c>DigestType</c> is sha.</d>
<v>Mpint = binary()</v>
<v>Signature = binary()</v>
</type>
<desc>
- <p>Calculates a <c>DigestType</c> digest of the <c>Data</c>
- and creates a RSA signature with the private key <c>Key</c>
- of the digest.</p>
+ <p>Creates a RSA signature with the private key <c>Key</c>
+ of a digest. The digest is either calculated as a
+ <c>DigestType</c> digest of <c>Data</c> or a precalculated
+ binary <c>Digest</c>.</p>
</desc>
</func>
<func>
- <name>rsa_verify(Data, Signature, Key) -> Verified</name>
- <name>rsa_verify(DigestType, Data, Signature, Key) -> Verified </name>
+ <name>rsa_verify(DataOrDigest, Signature, Key) -> Verified</name>
+ <name>rsa_verify(DigestType, DataOrDigest, Signature, Key) -> Verified </name>
<fsummary>Verify the digest and signature using rsa with given public key.</fsummary>
<type>
<v>Verified = boolean()</v>
+ <v>DataOrDigest = Data | {digest|Digest}</v>
<v>Data, Signature = Mpint</v>
+ <v>Digest = binary()</v>
<v>Key = [E, N]</v>
<v>E, N = Mpint</v>
<d>Where <c>E</c> is the public exponent and <c>N</c> is public modulus.</d>
- <v>DigestType = md5 | sha | sha256 | sha384 | sha512</v>
- <d> The default <c>DigestType</c> is sha.</d>
+ <v>DigestType = md5 | sha | sha224 | sha256 | sha384 | sha512</v>
+ <d>The default <c>DigestType</c> is sha.</d>
<v>Mpint = binary()</v>
</type>
<desc>
- <p>Calculates a <c>DigestType</c> digest of the <c>Data</c>
- and verifies that the digest matches the RSA signature using the
+ <p>Verifies that a digest matches the RSA signature using the
signer's public key <c>Key</c>.
- </p>
+ The digest is either calculated as a <c>DigestType</c>
+ digest of <c>Data</c> or a precalculated binary <c>Digest</c>.</p>
<p>May throw exception <c>notsup</c> in case the chosen <c>DigestType</c>
is not supported by the underlying OpenSSL implementation.</p>
</desc>
@@ -943,10 +1032,15 @@ Mpint() = <![CDATA[<<ByteLen:32/integer-big, Bytes:ByteLen/binary>>]]>
<fsummary>Decrypts ChipherText using the private Key.</fsummary>
<type>
<v>ChipherText = binary()</v>
- <v>PrivateKey = [E, N, D]</v>
+ <v>PrivateKey = [E, N, D] | [E, N, D, P1, P2, E1, E2, C]</v>
<v>E, N, D = Mpint</v>
<d>Where <c>E</c> is the public exponent, <c>N</c> is public modulus and
<c>D</c> is the private exponent.</d>
+ <v>P1, P2, E1, E2, C = Mpint</v>
+ <d>The longer key format contains redundant information that will make
+ the calculation faster. <c>P1,P2</c> are first and second prime factors.
+ <c>E1,E2</c> are first and second exponents. <c>C</c> is the CRT coefficient.
+ Terminology is taken from RFC 3447.</d>
<v>Padding = rsa_pkcs1_padding | rsa_pkcs1_oaep_padding | rsa_no_padding</v>
<v>PlainText = binary()</v>
</type>
@@ -965,10 +1059,15 @@ Mpint() = <![CDATA[<<ByteLen:32/integer-big, Bytes:ByteLen/binary>>]]>
<fsummary>Encrypts Msg using the private Key.</fsummary>
<type>
<v>PlainText = binary()</v>
- <v>PrivateKey = [E, N, D]</v>
- <v>E, N, D = Mpint</v>
+ <v>PrivateKey = [E, N, D] | [E, N, D, P1, P2, E1, E2, C]</v>
+ <v>E, N, D = Mpint</v>
<d>Where <c>E</c> is the public exponent, <c>N</c> is public modulus and
<c>D</c> is the private exponent.</d>
+ <v>P1, P2, E1, E2, C = Mpint</v>
+ <d>The longer key format contains redundant information that will make
+ the calculation faster. <c>P1,P2</c> are first and second prime factors.
+ <c>E1,E2</c> are first and second exponents. <c>C</c> is the CRT coefficient.
+ Terminology is taken from RFC 3447.</d>
<v>Padding = rsa_pkcs1_padding | rsa_no_padding</v>
<v>ChipherText = binary()</v>
</type>
@@ -1007,45 +1106,52 @@ Mpint() = <![CDATA[<<ByteLen:32/integer-big, Bytes:ByteLen/binary>>]]>
</func>
<func>
- <name>dss_sign(Data, Key) -> Signature</name>
- <name>dss_sign(DigestType, Data, Key) -> Signature</name>
+ <name>dss_sign(DataOrDigest, Key) -> Signature</name>
+ <name>dss_sign(DigestType, DataOrDigest, Key) -> Signature</name>
<fsummary>Sign the data using dsa with given private key.</fsummary>
<type>
- <v>DigestType = sha | none (default is sha)</v>
- <v>Data = Mpint | ShaDigest</v>
+ <v>DigestType = sha</v>
+ <v>DataOrDigest = Mpint | {digest,Digest}</v>
<v>Key = [P, Q, G, X]</v>
<v>P, Q, G, X = Mpint</v>
<d> Where <c>P</c>, <c>Q</c> and <c>G</c> are the dss
parameters and <c>X</c> is the private key.</d>
- <v>ShaDigest = binary() with length 20 bytes</v>
+ <v>Digest = binary() with length 20 bytes</v>
<v>Signature = binary()</v>
</type>
<desc>
- <p>Creates a DSS signature with the private key <c>Key</c> of a digest.
- If <c>DigestType</c> is 'sha', the digest is calculated as SHA1 of <c>Data</c>.
- If <c>DigestType</c> is 'none', <c>Data</c> is the precalculated SHA1 digest.</p>
+ <p>Creates a DSS signature with the private key <c>Key</c> of
+ a digest. The digest is either calculated as a SHA1
+ digest of <c>Data</c> or a precalculated binary <c>Digest</c>.</p>
+ <p>A deprecated feature is having <c>DigestType = 'none'</c>
+ in which case <c>DataOrDigest</c> is a precalculated SHA1
+ digest.</p>
</desc>
</func>
<func>
- <name>dss_verify(Data, Signature, Key) -> Verified</name>
- <name>dss_verify(DigestType, Data, Signature, Key) -> Verified</name>
+ <name>dss_verify(DataOrDigest, Signature, Key) -> Verified</name>
+ <name>dss_verify(DigestType, DataOrDigest, Signature, Key) -> Verified</name>
<fsummary>Verify the data and signature using dsa with given public key.</fsummary>
<type>
<v>Verified = boolean()</v>
- <v>DigestType = sha | none</v>
+ <v>DigestType = sha</v>
+ <v>DataOrDigest = Mpint | {digest,Digest}</v>
<v>Data = Mpint | ShaDigest</v>
<v>Signature = Mpint</v>
<v>Key = [P, Q, G, Y]</v>
<v>P, Q, G, Y = Mpint</v>
<d> Where <c>P</c>, <c>Q</c> and <c>G</c> are the dss
parameters and <c>Y</c> is the public key.</d>
- <v>ShaDigest = binary() with length 20 bytes</v>
+ <v>Digest = binary() with length 20 bytes</v>
</type>
<desc>
- <p>Verifies that a digest matches the DSS signature using the public key <c>Key</c>.
- If <c>DigestType</c> is 'sha', the digest is calculated as SHA1 of <c>Data</c>.
- If <c>DigestType</c> is 'none', <c>Data</c> is the precalculated SHA1 digest.</p>
+ <p>Verifies that a digest matches the DSS signature using the
+ public key <c>Key</c>. The digest is either calculated as a SHA1
+ digest of <c>Data</c> or is a precalculated binary <c>Digest</c>.</p>
+ <p>A deprecated feature is having <c>DigestType = 'none'</c>
+ in which case <c>DataOrDigest</c> is a precalculated SHA1
+ digest binary.</p>
</desc>
</func>
diff --git a/lib/crypto/doc/src/notes.xml b/lib/crypto/doc/src/notes.xml
index 3a44550ae2..a9f8dd84af 100644
--- a/lib/crypto/doc/src/notes.xml
+++ b/lib/crypto/doc/src/notes.xml
@@ -30,6 +30,53 @@
</header>
<p>This document describes the changes made to the Crypto application.</p>
+<section><title>Crypto 2.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Remove unnecessary dependency to libssl from crypto NIF
+ library. This dependency was introduced by accident in
+ R14B04.</p>
+ <p>
+ Own Id: OTP-10064</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Add crypto and public_key support for the hash functions
+ SHA224, SHA256, SHA384 and SHA512 and also hmac and
+ rsa_sign/verify support using these hash functions.
+ Thanks to Andreas Schultz for making a prototype.</p>
+ <p>
+ Own Id: OTP-9908</p>
+ </item>
+ <item>
+ <p>
+ Optimize RSA private key handling in <c>crypto</c> and
+ <c>public_key</c>.</p>
+ <p>
+ Own Id: OTP-10065</p>
+ </item>
+ <item>
+ <p>
+ Make <c>crypto:aes_cfb_128_encrypt</c> and
+ <c>crypto:aes_cfb_128_decrypt</c> handle data and cipher
+ with arbitrary length. (Thanks to Stefan Zegenhagen)</p>
+ <p>
+ Own Id: OTP-10136</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Crypto 2.1</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/crypto/src/Makefile b/lib/crypto/src/Makefile
index 0e886ce8bf..910e89363c 100644
--- a/lib/crypto/src/Makefile
+++ b/lib/crypto/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2010. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -83,11 +83,11 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) \
- $(APPUP_TARGET) $(RELSYSDIR)/ebin
+ $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl
index d7aac27825..0089e79a4f 100644
--- a/lib/crypto/src/crypto.erl
+++ b/lib/crypto/src/crypto.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -22,12 +22,19 @@
-module(crypto).
-export([start/0, stop/0, info/0, info_lib/0, version/0]).
+-export([hash/2, hash_init/1, hash_update/2, hash_final/1]).
-export([md4/1, md4_init/0, md4_update/2, md4_final/1]).
-export([md5/1, md5_init/0, md5_update/2, md5_final/1]).
-export([sha/1, sha_init/0, sha_update/2, sha_final/1]).
+-export([sha224/1, sha224_init/0, sha224_update/2, sha224_final/1]).
-export([sha256/1, sha256_init/0, sha256_update/2, sha256_final/1]).
+-export([sha384/1, sha384_init/0, sha384_update/2, sha384_final/1]).
-export([sha512/1, sha512_init/0, sha512_update/2, sha512_final/1]).
-export([md5_mac/2, md5_mac_96/2, sha_mac/2, sha_mac/3, sha_mac_96/2]).
+-export([sha224_mac/2, sha224_mac/3]).
+-export([sha256_mac/2, sha256_mac/3]).
+-export([sha384_mac/2, sha384_mac/3]).
+-export([sha512_mac/2, sha512_mac/3]).
-export([hmac_init/2, hmac_update/2, hmac_final/1, hmac_final_n/2]).
-export([des_cbc_encrypt/3, des_cbc_decrypt/3, des_cbc_ivec/1]).
-export([des_ecb_encrypt/2, des_ecb_decrypt/2]).
@@ -64,10 +71,13 @@
-define(FUNC_LIST, [md4, md4_init, md4_update, md4_final,
md5, md5_init, md5_update, md5_final,
sha, sha_init, sha_update, sha_final,
- sha256, sha256_init, sha256_update, sha256_final,
- sha512, sha512_init, sha512_update, sha512_final,
+ sha224, sha224_init, sha224_update, sha224_final,
+ sha256, sha256_init, sha256_update, sha256_final,
+ sha384, sha384_init, sha384_update, sha384_final,
+ sha512, sha512_init, sha512_update, sha512_final,
md5_mac, md5_mac_96,
sha_mac, sha_mac_96,
+ sha224_mac, sha256_mac, sha384_mac, sha512_mac,
sha_mac_init, sha_mac_update, sha_mac_final,
des_cbc_encrypt, des_cbc_decrypt,
des_cfb_encrypt, des_cfb_decrypt,
@@ -95,8 +105,9 @@
aes_ctr_stream_init, aes_ctr_stream_encrypt, aes_ctr_stream_decrypt,
info_lib]).
--type rsa_digest_type() :: 'md5' | 'sha' | 'sha256' | 'sha384' | 'sha512'.
+-type rsa_digest_type() :: 'md5' | 'sha' | 'sha224' | 'sha256' | 'sha384' | 'sha512'.
-type dss_digest_type() :: 'none' | 'sha'.
+-type data_or_digest() :: binary() | {digest, binary()}.
-type crypto_integer() :: binary() | integer().
-define(nif_stub,nif_stub_error(?LINE)).
@@ -171,7 +182,7 @@ info_lib() -> ?nif_stub.
%% (no version): Driver implementation
%% 2.0 : NIF implementation, requires OTP R14
version() -> ?CRYPTO_VSN.
-
+
%% Below Key and Data are binaries or IO-lists. IVec is a binary.
%% Output is always a binary. Context is a binary.
@@ -179,6 +190,45 @@ version() -> ?CRYPTO_VSN.
%% MESSAGE DIGESTS
%%
+-spec hash(_, iodata()) -> binary().
+hash(md5, Data) -> md5(Data);
+hash(md4, Data) -> md4(Data);
+hash(sha, Data) -> sha(Data);
+hash(sha224, Data) -> sha224(Data);
+hash(sha256, Data) -> sha256(Data);
+hash(sha384, Data) -> sha384(Data);
+hash(sha512, Data) -> sha512(Data).
+
+-spec hash_init('md5'|'md4'|'sha'|'sha224'|'sha256'|'sha384'|'sha512') -> any().
+
+hash_init(md5) -> {md5, md5_init()};
+hash_init(md4) -> {md4, md4_init()};
+hash_init(sha) -> {sha, sha_init()};
+hash_init(sha224) -> {sha224, sha224_init()};
+hash_init(sha256) -> {sha256, sha256_init()};
+hash_init(sha384) -> {sha384, sha384_init()};
+hash_init(sha512) -> {sha512, sha512_init()}.
+
+-spec hash_update(_, iodata()) -> any().
+
+hash_update({md5,Context}, Data) -> {md5, md5_update(Context,Data)};
+hash_update({md4,Context}, Data) -> {md4, md4_update(Context,Data)};
+hash_update({sha,Context}, Data) -> {sha, sha_update(Context,Data)};
+hash_update({sha224,Context}, Data) -> {sha224, sha224_update(Context,Data)};
+hash_update({sha256,Context}, Data) -> {sha256, sha256_update(Context,Data)};
+hash_update({sha384,Context}, Data) -> {sha384, sha384_update(Context,Data)};
+hash_update({sha512,Context}, Data) -> {sha512, sha512_update(Context,Data)}.
+
+-spec hash_final(_) -> binary().
+
+hash_final({md5,Context}) -> md5_final(Context);
+hash_final({md4,Context}) -> md4_final(Context);
+hash_final({sha,Context}) -> sha_final(Context);
+hash_final({sha224,Context}) -> sha224_final(Context);
+hash_final({sha256,Context}) -> sha256_final(Context);
+hash_final({sha384,Context}) -> sha384_final(Context);
+hash_final({sha512,Context}) -> sha512_final(Context).
+
%%
%% MD5
%%
@@ -220,6 +270,40 @@ sha_update(_Context, _Data) -> ?nif_stub.
sha_final(_Context) -> ?nif_stub.
%
+%% SHA224
+%%
+-spec sha224(iodata()) -> binary().
+-spec sha224_init() -> binary().
+-spec sha224_update(binary(), iodata()) -> binary().
+-spec sha224_final(binary()) -> binary().
+
+sha224(Data) ->
+ case sha224_nif(Data) of
+ notsup -> erlang:error(notsup);
+ Bin -> Bin
+ end.
+sha224_init() ->
+ case sha224_init_nif() of
+ notsup -> erlang:error(notsup);
+ Bin -> Bin
+ end.
+sha224_update(Context, Data) ->
+ case sha224_update_nif(Context, Data) of
+ notsup -> erlang:error(notsup);
+ Bin -> Bin
+ end.
+sha224_final(Context) ->
+ case sha224_final_nif(Context) of
+ notsup -> erlang:error(notsup);
+ Bin -> Bin
+ end.
+
+sha224_nif(_Data) -> ?nif_stub.
+sha224_init_nif() -> ?nif_stub.
+sha224_update_nif(_Context, _Data) -> ?nif_stub.
+sha224_final_nif(_Context) -> ?nif_stub.
+
+%
%% SHA256
%%
-spec sha256(iodata()) -> binary().
@@ -254,6 +338,40 @@ sha256_update_nif(_Context, _Data) -> ?nif_stub.
sha256_final_nif(_Context) -> ?nif_stub.
%
+%% SHA384
+%%
+-spec sha384(iodata()) -> binary().
+-spec sha384_init() -> binary().
+-spec sha384_update(binary(), iodata()) -> binary().
+-spec sha384_final(binary()) -> binary().
+
+sha384(Data) ->
+ case sha384_nif(Data) of
+ notsup -> erlang:error(notsup);
+ Bin -> Bin
+ end.
+sha384_init() ->
+ case sha384_init_nif() of
+ notsup -> erlang:error(notsup);
+ Bin -> Bin
+ end.
+sha384_update(Context, Data) ->
+ case sha384_update_nif(Context, Data) of
+ notsup -> erlang:error(notsup);
+ Bin -> Bin
+ end.
+sha384_final(Context) ->
+ case sha384_final_nif(Context) of
+ notsup -> erlang:error(notsup);
+ Bin -> Bin
+ end.
+
+sha384_nif(_Data) -> ?nif_stub.
+sha384_init_nif() -> ?nif_stub.
+sha384_update_nif(_Context, _Data) -> ?nif_stub.
+sha384_final_nif(_Context) -> ?nif_stub.
+
+%
%% SHA512
%%
-spec sha512(iodata()) -> binary().
@@ -336,6 +454,70 @@ sha_mac_96(Key, Data) ->
sha_mac_n(_Key,_Data,_MacSz) -> ?nif_stub.
%%
+%% SHA224_MAC
+%%
+-spec sha224_mac(iodata(), iodata()) -> binary().
+
+sha224_mac(Key, Data) ->
+ sha224_mac(Key, Data, 224 div 8).
+
+sha224_mac(Key, Data, Size) ->
+ case sha224_mac_nif(Key, Data, Size) of
+ notsup -> erlang:error(notsup);
+ Bin -> Bin
+ end.
+
+sha224_mac_nif(_Key,_Data,_MacSz) -> ?nif_stub.
+
+%%
+%% SHA256_MAC
+%%
+-spec sha256_mac(iodata(), iodata()) -> binary().
+
+sha256_mac(Key, Data) ->
+ sha256_mac(Key, Data, 256 div 8).
+
+sha256_mac(Key, Data, Size) ->
+ case sha256_mac_nif(Key, Data, Size) of
+ notsup -> erlang:error(notsup);
+ Bin -> Bin
+ end.
+
+sha256_mac_nif(_Key,_Data,_MacSz) -> ?nif_stub.
+
+%%
+%% SHA384_MAC
+%%
+-spec sha384_mac(iodata(), iodata()) -> binary().
+
+sha384_mac(Key, Data) ->
+ sha384_mac(Key, Data, 384 div 8).
+
+sha384_mac(Key, Data, Size) ->
+ case sha384_mac_nif(Key, Data, Size) of
+ notsup -> erlang:error(notsup);
+ Bin -> Bin
+ end.
+
+sha384_mac_nif(_Key,_Data,_MacSz) -> ?nif_stub.
+
+%%
+%% SHA512_MAC
+%%
+-spec sha512_mac(iodata(), iodata()) -> binary().
+
+sha512_mac(Key, Data) ->
+ sha512_mac(Key, Data, 512 div 8).
+
+sha512_mac(Key, Data, MacSz) ->
+ case sha512_mac_nif(Key, Data, MacSz) of
+ notsup -> erlang:error(notsup);
+ Bin -> Bin
+ end.
+
+sha512_mac_nif(_Key,_Data,_MacSz) -> ?nif_stub.
+
+%%
%% CRYPTO FUNCTIONS
%%
@@ -576,10 +758,10 @@ mod_exp_nif(_Base,_Exp,_Mod) -> ?nif_stub.
%%
%% DSS, RSA - verify
%%
--spec dss_verify(binary(), binary(), [binary()]) -> boolean().
--spec dss_verify(dss_digest_type(), binary(), binary(), [binary()]) -> boolean().
--spec rsa_verify(binary(), binary(), [binary()]) -> boolean().
--spec rsa_verify(rsa_digest_type(), binary(), binary(), [binary()]) ->
+-spec dss_verify(data_or_digest(), binary(), [binary()]) -> boolean().
+-spec dss_verify(dss_digest_type(), data_or_digest(), binary(), [binary()]) -> boolean().
+-spec rsa_verify(data_or_digest(), binary(), [binary()]) -> boolean().
+-spec rsa_verify(rsa_digest_type(), data_or_digest(), binary(), [binary()]) ->
boolean().
%% Key = [P,Q,G,Y] P,Q,G=DSSParams Y=PublicKey
@@ -590,8 +772,8 @@ dss_verify(_Type,_Data,_Signature,_Key) -> ?nif_stub.
% Key = [E,N] E=PublicExponent N=PublicModulus
rsa_verify(Data,Signature,Key) ->
rsa_verify_nif(sha, Data,Signature,Key).
-rsa_verify(Type, Data, Signature, Key) ->
- case rsa_verify_nif(Type, Data, Signature, Key) of
+rsa_verify(Type, DataOrDigest, Signature, Key) ->
+ case rsa_verify_nif(Type, DataOrDigest, Signature, Key) of
notsup -> erlang:error(notsup);
Bool -> Bool
end.
@@ -603,27 +785,27 @@ rsa_verify_nif(_Type, _Data, _Signature, _Key) -> ?nif_stub.
%% DSS, RSA - sign
%%
%% Key = [P,Q,G,X] P,Q,G=DSSParams X=PrivateKey
--spec dss_sign(binary(), [binary()]) -> binary().
--spec dss_sign(dss_digest_type(), binary(), [binary()]) -> binary().
--spec rsa_sign(binary(), [binary()]) -> binary().
--spec rsa_sign(rsa_digest_type(), binary(), [binary()]) -> binary().
-
-dss_sign(Data,Key) ->
- dss_sign(sha,Data,Key).
-dss_sign(Type, Data, Key) ->
- case dss_sign_nif(Type,Data,Key) of
- error -> erlang:error(badkey, [Data, Key]);
+-spec dss_sign(data_or_digest(), [binary()]) -> binary().
+-spec dss_sign(dss_digest_type(), data_or_digest(), [binary()]) -> binary().
+-spec rsa_sign(data_or_digest(), [binary()]) -> binary().
+-spec rsa_sign(rsa_digest_type(), data_or_digest(), [binary()]) -> binary().
+
+dss_sign(DataOrDigest,Key) ->
+ dss_sign(sha,DataOrDigest,Key).
+dss_sign(Type, DataOrDigest, Key) ->
+ case dss_sign_nif(Type,DataOrDigest,Key) of
+ error -> erlang:error(badkey, [DataOrDigest, Key]);
Sign -> Sign
end.
dss_sign_nif(_Type,_Data,_Key) -> ?nif_stub.
%% Key = [E,N,D] E=PublicExponent N=PublicModulus D=PrivateExponent
-rsa_sign(Data,Key) ->
- rsa_sign(sha, Data, Key).
-rsa_sign(Type, Data, Key) ->
- case rsa_sign_nif(Type,Data,Key) of
- error -> erlang:error(badkey, [Type,Data,Key]);
+rsa_sign(DataOrDigest,Key) ->
+ rsa_sign(sha, DataOrDigest, Key).
+rsa_sign(Type, DataOrDigest, Key) ->
+ case rsa_sign_nif(Type,DataOrDigest,Key) of
+ error -> erlang:error(badkey, [Type,DataOrDigest,Key]);
Sign -> Sign
end.
diff --git a/lib/crypto/test/Makefile b/lib/crypto/test/Makefile
index 3150bd472d..ec8136b455 100644
--- a/lib/crypto/test/Makefile
+++ b/lib/crypto/test/Makefile
@@ -75,9 +75,9 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec:
release_tests_spec: $(TEST_TARGET)
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) crypto.spec crypto.cover $(RELTEST_FILES) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) crypto.spec crypto.cover $(RELTEST_FILES) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
release_docs_spec:
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl
index 627c966dfb..7ac693f371 100644
--- a/lib/crypto/test/crypto_SUITE.erl
+++ b/lib/crypto/test/crypto_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -33,9 +33,12 @@
sha_update/1,
hmac_update_sha/1,
hmac_update_sha_n/1,
+ hmac_update_sha256/1,
+ hmac_update_sha512/1,
hmac_update_md5/1,
hmac_update_md5_io/1,
hmac_update_md5_n/1,
+ hmac_rfc4231/1,
sha256/1,
sha256_update/1,
sha512/1,
@@ -61,7 +64,9 @@
rsa_verify_test/1,
dsa_verify_test/1,
rsa_sign_test/1,
+ rsa_sign_hash_test/1,
dsa_sign_test/1,
+ dsa_sign_hash_test/1,
rsa_encrypt_decrypt/1,
dh/1,
exor_test/1,
@@ -82,13 +87,15 @@ groups() ->
{rest, [],
[md5, md5_update, md4, md4_update, md5_mac,
md5_mac_io, sha, sha_update,
- hmac_update_sha, hmac_update_sha_n, hmac_update_md5_n,
- hmac_update_md5_io, hmac_update_md5,
+ hmac_update_sha, hmac_update_sha_n, hmac_update_sha256, hmac_update_sha512,
+ hmac_update_md5_n, hmac_update_md5_io, hmac_update_md5,
+ hmac_rfc4231,
des_cbc, aes_cfb, aes_cbc,
aes_cbc_iter, aes_ctr, aes_ctr_stream, des_cbc_iter, des_ecb,
rand_uniform_test, strong_rand_test,
rsa_verify_test, dsa_verify_test, rsa_sign_test,
- dsa_sign_test, rsa_encrypt_decrypt, dh, exor_test,
+ rsa_sign_hash_test, dsa_sign_test, dsa_sign_hash_test,
+ rsa_encrypt_decrypt, dh, exor_test,
rc4_test, rc4_stream_test, mod_exp_test, blowfish_cfb64,
smp]}].
@@ -335,6 +342,60 @@ hmac_update_sha(Config) when is_list(Config) ->
?line Mac = crypto:hmac_final(Ctx3),
?line Exp = crypto:sha_mac(Key, lists:flatten([Data, Data2])),
?line m(Exp, Mac).
+
+hmac_update_sha256(doc) ->
+ ["Generate an SHA256 HMAC using hmac_init, hmac_update, and hmac_final. "
+ "Expected values for examples are generated using crypto:sha256_mac." ];
+hmac_update_sha256(suite) ->
+ [];
+hmac_update_sha256(Config) when is_list(Config) ->
+ case openssl_version() of
+ V when V < 16#908000 ->
+ {skipped,"OpenSSL version too old"};
+ _ ->
+ hmac_update_sha256_do()
+ end.
+
+hmac_update_sha256_do() ->
+ ?line Key = hexstr2bin("00010203101112132021222330313233"
+ "04050607141516172425262734353637"
+ "08090a0b18191a1b28292a2b38393a3b"
+ "0c0d0e0f1c1d1e1f2c2d2e2f3c3d3e3f"),
+ ?line Data = "Sampl",
+ ?line Data2 = "e #1",
+ ?line Ctx = crypto:hmac_init(sha256, Key),
+ ?line Ctx2 = crypto:hmac_update(Ctx, Data),
+ ?line Ctx3 = crypto:hmac_update(Ctx2, Data2),
+ ?line Mac = crypto:hmac_final(Ctx3),
+ ?line Exp = crypto:sha256_mac(Key, lists:flatten([Data, Data2])),
+ ?line m(Exp, Mac).
+
+hmac_update_sha512(doc) ->
+ ["Generate an SHA512 HMAC using hmac_init, hmac_update, and hmac_final. "
+ "Expected values for examples are generated using crypto:sha512_mac." ];
+hmac_update_sha512(suite) ->
+ [];
+hmac_update_sha512(Config) when is_list(Config) ->
+ case openssl_version() of
+ V when V < 16#908000 ->
+ {skipped,"OpenSSL version too old"};
+ _ ->
+ hmac_update_sha512_do()
+ end.
+
+hmac_update_sha512_do() ->
+ ?line Key = hexstr2bin("00010203101112132021222330313233"
+ "04050607141516172425262734353637"
+ "08090a0b18191a1b28292a2b38393a3b"
+ "0c0d0e0f1c1d1e1f2c2d2e2f3c3d3e3f"),
+ ?line Data = "Sampl",
+ ?line Data2 = "e #1",
+ ?line Ctx = crypto:hmac_init(sha512, Key),
+ ?line Ctx2 = crypto:hmac_update(Ctx, Data),
+ ?line Ctx3 = crypto:hmac_update(Ctx2, Data2),
+ ?line Mac = crypto:hmac_final(Ctx3),
+ ?line Exp = crypto:sha512_mac(Key, lists:flatten([Data, Data2])),
+ ?line m(Exp, Mac).
hmac_update_md5(doc) ->
["Generate an MD5 HMAC using hmac_init, hmac_update, and hmac_final. "
@@ -354,7 +415,280 @@ hmac_update_md5(Config) when is_list(Config) ->
?line Mac2 = crypto:hmac_final(CtxD),
?line Exp2 = crypto:md5_mac(Key2, lists:flatten([Long1, Long2, Long3])),
?line m(Exp2, Mac2).
+
+hmac_rfc4231(doc) ->
+ ["Generate an HMAC using crypto:shaXXX_mac and hmac_init, hmac_update, and hmac_final. "
+ "Testvectors are take from RFC4231." ];
+hmac_rfc4231(suite) ->
+ [];
+hmac_rfc4231(Config) when is_list(Config) ->
+ case openssl_version() of
+ V when V < 16#908000 ->
+ {skipped,"OpenSSL version too old"};
+ _ ->
+ hmac_rfc4231_do()
+ end.
+
+hmac_rfc4231_do() ->
+ %% Test Case 1
+ Case1Key = binary:copy(<<16#0b>>, 20),
+ Case1Data = <<"Hi There">>,
+ Case1Exp224 = hexstr2bin("896fb1128abbdf196832107cd49df33f"
+ "47b4b1169912ba4f53684b22"),
+ Case1Exp256 = hexstr2bin("b0344c61d8db38535ca8afceaf0bf12b"
+ "881dc200c9833da726e9376c2e32cff7"),
+ Case1Exp384 = hexstr2bin("afd03944d84895626b0825f4ab46907f"
+ "15f9dadbe4101ec682aa034c7cebc59c"
+ "faea9ea9076ede7f4af152e8b2fa9cb6"),
+ Case1Exp512 = hexstr2bin("87aa7cdea5ef619d4ff0b4241a1d6cb0"
+ "2379f4e2ce4ec2787ad0b30545e17cde"
+ "daa833b7d6b8a702038b274eaea3f4e4"
+ "be9d914eeb61f1702e696c203a126854"),
+
+ ?line Case1Ctx224 = crypto:hmac_init(sha224, Case1Key),
+ ?line Case1Ctx224_2 = crypto:hmac_update(Case1Ctx224, Case1Data),
+ ?line Case1Mac224_1 = crypto:hmac_final(Case1Ctx224_2),
+ ?line Case1Mac224_2 = crypto:sha224_mac(Case1Key, Case1Data),
+ ?line m(Case1Exp224, Case1Mac224_1),
+ ?line m(Case1Exp224, Case1Mac224_2),
+
+ ?line Case1Ctx256 = crypto:hmac_init(sha256, Case1Key),
+ ?line Case1Ctx256_2 = crypto:hmac_update(Case1Ctx256, Case1Data),
+ ?line Case1Mac256_1 = crypto:hmac_final(Case1Ctx256_2),
+ ?line Case1Mac256_2 = crypto:sha256_mac(Case1Key, Case1Data),
+ ?line m(Case1Exp256, Case1Mac256_1),
+ ?line m(Case1Exp256, Case1Mac256_2),
+
+ ?line Case1Ctx384 = crypto:hmac_init(sha384, Case1Key),
+ ?line Case1Ctx384_2 = crypto:hmac_update(Case1Ctx384, Case1Data),
+ ?line Case1Mac384_1 = crypto:hmac_final(Case1Ctx384_2),
+ ?line Case1Mac384_2 = crypto:sha384_mac(Case1Key, Case1Data),
+ ?line m(Case1Exp384, Case1Mac384_1),
+ ?line m(Case1Exp384, Case1Mac384_2),
+
+ ?line Case1Ctx512 = crypto:hmac_init(sha512, Case1Key),
+ ?line Case1Ctx512_2 = crypto:hmac_update(Case1Ctx512, Case1Data),
+ ?line Case1Mac512_1 = crypto:hmac_final(Case1Ctx512_2),
+ ?line Case1Mac512_2 = crypto:sha512_mac(Case1Key, Case1Data),
+ ?line m(Case1Exp512, Case1Mac512_1),
+ ?line m(Case1Exp512, Case1Mac512_2),
+
+ %% Test Case 2
+ Case2Key = <<"Jefe">>,
+ Case2Data = <<"what do ya want for nothing?">>,
+ Case2Exp224 = hexstr2bin("a30e01098bc6dbbf45690f3a7e9e6d0f"
+ "8bbea2a39e6148008fd05e44"),
+ Case2Exp256 = hexstr2bin("5bdcc146bf60754e6a042426089575c7"
+ "5a003f089d2739839dec58b964ec3843"),
+ Case2Exp384 = hexstr2bin("af45d2e376484031617f78d2b58a6b1b"
+ "9c7ef464f5a01b47e42ec3736322445e"
+ "8e2240ca5e69e2c78b3239ecfab21649"),
+ Case2Exp512 = hexstr2bin("164b7a7bfcf819e2e395fbe73b56e0a3"
+ "87bd64222e831fd610270cd7ea250554"
+ "9758bf75c05a994a6d034f65f8f0e6fd"
+ "caeab1a34d4a6b4b636e070a38bce737"),
+
+ ?line Case2Ctx224 = crypto:hmac_init(sha224, Case2Key),
+ ?line Case2Ctx224_2 = crypto:hmac_update(Case2Ctx224, Case2Data),
+ ?line Case2Mac224_1 = crypto:hmac_final(Case2Ctx224_2),
+ ?line Case2Mac224_2 = crypto:sha224_mac(Case2Key, Case2Data),
+ ?line m(Case2Exp224, Case2Mac224_1),
+ ?line m(Case2Exp224, Case2Mac224_2),
+
+ ?line Case2Ctx256 = crypto:hmac_init(sha256, Case2Key),
+ ?line Case2Ctx256_2 = crypto:hmac_update(Case2Ctx256, Case2Data),
+ ?line Case2Mac256_1 = crypto:hmac_final(Case2Ctx256_2),
+ ?line Case2Mac256_2 = crypto:sha256_mac(Case2Key, Case2Data),
+ ?line m(Case2Exp256, Case2Mac256_1),
+ ?line m(Case2Exp256, Case2Mac256_2),
+
+ ?line Case2Ctx384 = crypto:hmac_init(sha384, Case2Key),
+ ?line Case2Ctx384_2 = crypto:hmac_update(Case2Ctx384, Case2Data),
+ ?line Case2Mac384_1 = crypto:hmac_final(Case2Ctx384_2),
+ ?line Case2Mac384_2 = crypto:sha384_mac(Case2Key, Case2Data),
+ ?line m(Case2Exp384, Case2Mac384_1),
+ ?line m(Case2Exp384, Case2Mac384_2),
+
+ ?line Case2Ctx512 = crypto:hmac_init(sha512, Case2Key),
+ ?line Case2Ctx512_2 = crypto:hmac_update(Case2Ctx512, Case2Data),
+ ?line Case2Mac512_1 = crypto:hmac_final(Case2Ctx512_2),
+ ?line Case2Mac512_2 = crypto:sha512_mac(Case2Key, Case2Data),
+ ?line m(Case2Exp512, Case2Mac512_1),
+ ?line m(Case2Exp512, Case2Mac512_2),
+
+ %% Test Case 3
+ Case3Key = binary:copy(<<16#aa>>, 20),
+ Case3Data = binary:copy(<<16#dd>>, 50),
+ Case3Exp224 = hexstr2bin("7fb3cb3588c6c1f6ffa9694d7d6ad264"
+ "9365b0c1f65d69d1ec8333ea"),
+ Case3Exp256 = hexstr2bin("773ea91e36800e46854db8ebd09181a7"
+ "2959098b3ef8c122d9635514ced565fe"),
+ Case3Exp384 = hexstr2bin("88062608d3e6ad8a0aa2ace014c8a86f"
+ "0aa635d947ac9febe83ef4e55966144b"
+ "2a5ab39dc13814b94e3ab6e101a34f27"),
+ Case3Exp512 = hexstr2bin("fa73b0089d56a284efb0f0756c890be9"
+ "b1b5dbdd8ee81a3655f83e33b2279d39"
+ "bf3e848279a722c806b485a47e67c807"
+ "b946a337bee8942674278859e13292fb"),
+
+ ?line Case3Ctx224 = crypto:hmac_init(sha224, Case3Key),
+ ?line Case3Ctx224_2 = crypto:hmac_update(Case3Ctx224, Case3Data),
+ ?line Case3Mac224_1 = crypto:hmac_final(Case3Ctx224_2),
+ ?line Case3Mac224_2 = crypto:sha224_mac(Case3Key, Case3Data),
+ ?line m(Case3Exp224, Case3Mac224_1),
+ ?line m(Case3Exp224, Case3Mac224_2),
+
+ ?line Case3Ctx256 = crypto:hmac_init(sha256, Case3Key),
+ ?line Case3Ctx256_2 = crypto:hmac_update(Case3Ctx256, Case3Data),
+ ?line Case3Mac256_1 = crypto:hmac_final(Case3Ctx256_2),
+ ?line Case3Mac256_2 = crypto:sha256_mac(Case3Key, Case3Data),
+ ?line m(Case3Exp256, Case3Mac256_1),
+ ?line m(Case3Exp256, Case3Mac256_2),
+
+ ?line Case3Ctx384 = crypto:hmac_init(sha384, Case3Key),
+ ?line Case3Ctx384_2 = crypto:hmac_update(Case3Ctx384, Case3Data),
+ ?line Case3Mac384_1 = crypto:hmac_final(Case3Ctx384_2),
+ ?line Case3Mac384_2 = crypto:sha384_mac(Case3Key, Case3Data),
+ ?line m(Case3Exp384, Case3Mac384_1),
+ ?line m(Case3Exp384, Case3Mac384_2),
+
+ ?line Case3Ctx512 = crypto:hmac_init(sha512, Case3Key),
+ ?line Case3Ctx512_2 = crypto:hmac_update(Case3Ctx512, Case3Data),
+ ?line Case3Mac512_1 = crypto:hmac_final(Case3Ctx512_2),
+ ?line Case3Mac512_2 = crypto:sha512_mac(Case3Key, Case3Data),
+ ?line m(Case3Exp512, Case3Mac512_1),
+ ?line m(Case3Exp512, Case3Mac512_2),
+
+ %% Test Case 4
+ Case4Key = list_to_binary(lists:seq(1, 16#19)),
+ Case4Data = binary:copy(<<16#cd>>, 50),
+ Case4Exp224 = hexstr2bin("6c11506874013cac6a2abc1bb382627c"
+ "ec6a90d86efc012de7afec5a"),
+ Case4Exp256 = hexstr2bin("82558a389a443c0ea4cc819899f2083a"
+ "85f0faa3e578f8077a2e3ff46729665b"),
+ Case4Exp384 = hexstr2bin("3e8a69b7783c25851933ab6290af6ca7"
+ "7a9981480850009cc5577c6e1f573b4e"
+ "6801dd23c4a7d679ccf8a386c674cffb"),
+ Case4Exp512 = hexstr2bin("b0ba465637458c6990e5a8c5f61d4af7"
+ "e576d97ff94b872de76f8050361ee3db"
+ "a91ca5c11aa25eb4d679275cc5788063"
+ "a5f19741120c4f2de2adebeb10a298dd"),
+
+ ?line Case4Ctx224 = crypto:hmac_init(sha224, Case4Key),
+ ?line Case4Ctx224_2 = crypto:hmac_update(Case4Ctx224, Case4Data),
+ ?line Case4Mac224_1 = crypto:hmac_final(Case4Ctx224_2),
+ ?line Case4Mac224_2 = crypto:sha224_mac(Case4Key, Case4Data),
+ ?line m(Case4Exp224, Case4Mac224_1),
+ ?line m(Case4Exp224, Case4Mac224_2),
+
+ ?line Case4Ctx256 = crypto:hmac_init(sha256, Case4Key),
+ ?line Case4Ctx256_2 = crypto:hmac_update(Case4Ctx256, Case4Data),
+ ?line Case4Mac256_1 = crypto:hmac_final(Case4Ctx256_2),
+ ?line Case4Mac256_2 = crypto:sha256_mac(Case4Key, Case4Data),
+ ?line m(Case4Exp256, Case4Mac256_1),
+ ?line m(Case4Exp256, Case4Mac256_2),
+
+ ?line Case4Ctx384 = crypto:hmac_init(sha384, Case4Key),
+ ?line Case4Ctx384_2 = crypto:hmac_update(Case4Ctx384, Case4Data),
+ ?line Case4Mac384_1 = crypto:hmac_final(Case4Ctx384_2),
+ ?line Case4Mac384_2 = crypto:sha384_mac(Case4Key, Case4Data),
+ ?line m(Case4Exp384, Case4Mac384_1),
+ ?line m(Case4Exp384, Case4Mac384_2),
+
+ ?line Case4Ctx512 = crypto:hmac_init(sha512, Case4Key),
+ ?line Case4Ctx512_2 = crypto:hmac_update(Case4Ctx512, Case4Data),
+ ?line Case4Mac512_1 = crypto:hmac_final(Case4Ctx512_2),
+ ?line Case4Mac512_2 = crypto:sha512_mac(Case4Key, Case4Data),
+ ?line m(Case4Exp512, Case4Mac512_1),
+ ?line m(Case4Exp512, Case4Mac512_2),
+
+ %% Test Case 6
+ Case6Key = binary:copy(<<16#aa>>, 131),
+ Case6Data = <<"Test Using Larger Than Block-Size Key - Hash Key First">>,
+ Case6Exp224 = hexstr2bin("95e9a0db962095adaebe9b2d6f0dbce2"
+ "d499f112f2d2b7273fa6870e"),
+ Case6Exp256 = hexstr2bin("60e431591ee0b67f0d8a26aacbf5b77f"
+ "8e0bc6213728c5140546040f0ee37f54"),
+ Case6Exp384 = hexstr2bin("4ece084485813e9088d2c63a041bc5b4"
+ "4f9ef1012a2b588f3cd11f05033ac4c6"
+ "0c2ef6ab4030fe8296248df163f44952"),
+ Case6Exp512 = hexstr2bin("80b24263c7c1a3ebb71493c1dd7be8b4"
+ "9b46d1f41b4aeec1121b013783f8f352"
+ "6b56d037e05f2598bd0fd2215d6a1e52"
+ "95e64f73f63f0aec8b915a985d786598"),
+
+ ?line Case6Ctx224 = crypto:hmac_init(sha224, Case6Key),
+ ?line Case6Ctx224_2 = crypto:hmac_update(Case6Ctx224, Case6Data),
+ ?line Case6Mac224_1 = crypto:hmac_final(Case6Ctx224_2),
+ ?line Case6Mac224_2 = crypto:sha224_mac(Case6Key, Case6Data),
+ ?line m(Case6Exp224, Case6Mac224_1),
+ ?line m(Case6Exp224, Case6Mac224_2),
+
+ ?line Case6Ctx256 = crypto:hmac_init(sha256, Case6Key),
+ ?line Case6Ctx256_2 = crypto:hmac_update(Case6Ctx256, Case6Data),
+ ?line Case6Mac256_1 = crypto:hmac_final(Case6Ctx256_2),
+ ?line Case6Mac256_2 = crypto:sha256_mac(Case6Key, Case6Data),
+ ?line m(Case6Exp256, Case6Mac256_1),
+ ?line m(Case6Exp256, Case6Mac256_2),
+
+ ?line Case6Ctx384 = crypto:hmac_init(sha384, Case6Key),
+ ?line Case6Ctx384_2 = crypto:hmac_update(Case6Ctx384, Case6Data),
+ ?line Case6Mac384_1 = crypto:hmac_final(Case6Ctx384_2),
+ ?line Case6Mac384_2 = crypto:sha384_mac(Case6Key, Case6Data),
+ ?line m(Case6Exp384, Case6Mac384_1),
+ ?line m(Case6Exp384, Case6Mac384_2),
+
+ ?line Case6Ctx512 = crypto:hmac_init(sha512, Case6Key),
+ ?line Case6Ctx512_2 = crypto:hmac_update(Case6Ctx512, Case6Data),
+ ?line Case6Mac512_1 = crypto:hmac_final(Case6Ctx512_2),
+ ?line Case6Mac512_2 = crypto:sha512_mac(Case6Key, Case6Data),
+ ?line m(Case6Exp512, Case6Mac512_1),
+ ?line m(Case6Exp512, Case6Mac512_2),
+ %% Test Case 7
+ Case7Key = binary:copy(<<16#aa>>, 131),
+ Case7Data = <<"This is a test using a larger than block-size key and a larger t",
+ "han block-size data. The key needs to be hashed before being use",
+ "d by the HMAC algorithm.">>,
+ Case7Exp224 = hexstr2bin("3a854166ac5d9f023f54d517d0b39dbd"
+ "946770db9c2b95c9f6f565d1"),
+ Case7Exp256 = hexstr2bin("9b09ffa71b942fcb27635fbcd5b0e944"
+ "bfdc63644f0713938a7f51535c3a35e2"),
+ Case7Exp384 = hexstr2bin("6617178e941f020d351e2f254e8fd32c"
+ "602420feb0b8fb9adccebb82461e99c5"
+ "a678cc31e799176d3860e6110c46523e"),
+ Case7Exp512 = hexstr2bin("e37b6a775dc87dbaa4dfa9f96e5e3ffd"
+ "debd71f8867289865df5a32d20cdc944"
+ "b6022cac3c4982b10d5eeb55c3e4de15"
+ "134676fb6de0446065c97440fa8c6a58"),
+
+ ?line Case7Ctx224 = crypto:hmac_init(sha224, Case7Key),
+ ?line Case7Ctx224_2 = crypto:hmac_update(Case7Ctx224, Case7Data),
+ ?line Case7Mac224_1 = crypto:hmac_final(Case7Ctx224_2),
+ ?line Case7Mac224_2 = crypto:sha224_mac(Case7Key, Case7Data),
+ ?line m(Case7Exp224, Case7Mac224_1),
+ ?line m(Case7Exp224, Case7Mac224_2),
+
+ ?line Case7Ctx256 = crypto:hmac_init(sha256, Case7Key),
+ ?line Case7Ctx256_2 = crypto:hmac_update(Case7Ctx256, Case7Data),
+ ?line Case7Mac256_1 = crypto:hmac_final(Case7Ctx256_2),
+ ?line Case7Mac256_2 = crypto:sha256_mac(Case7Key, Case7Data),
+ ?line m(Case7Exp256, Case7Mac256_1),
+ ?line m(Case7Exp256, Case7Mac256_2),
+
+ ?line Case7Ctx384 = crypto:hmac_init(sha384, Case7Key),
+ ?line Case7Ctx384_2 = crypto:hmac_update(Case7Ctx384, Case7Data),
+ ?line Case7Mac384_1 = crypto:hmac_final(Case7Ctx384_2),
+ ?line Case7Mac384_2 = crypto:sha384_mac(Case7Key, Case7Data),
+ ?line m(Case7Exp384, Case7Mac384_1),
+ ?line m(Case7Exp384, Case7Mac384_2),
+
+ ?line Case7Ctx512 = crypto:hmac_init(sha512, Case7Key),
+ ?line Case7Ctx512_2 = crypto:hmac_update(Case7Ctx512, Case7Data),
+ ?line Case7Mac512_1 = crypto:hmac_final(Case7Ctx512_2),
+ ?line Case7Mac512_2 = crypto:sha512_mac(Case7Key, Case7Data),
+ ?line m(Case7Exp512, Case7Mac512_1),
+ ?line m(Case7Exp512, Case7Mac512_2).
hmac_update_md5_io(doc) ->
["Generate an MD5 HMAC using hmac_init, hmac_update, and hmac_final. "
@@ -717,10 +1051,19 @@ aes_cfb(Config) when is_list(Config) ->
?line Key = hexstr2bin("2b7e151628aed2a6abf7158809cf4f3c"),
?line IVec = hexstr2bin("000102030405060708090a0b0c0d0e0f"),
?line Plain = hexstr2bin("6bc1bee22e409f96e93d7e117393172a"),
- ?line Cipher = crypto:aes_cfb_128_encrypt(Key, IVec, Plain),
- ?line m(Cipher, hexstr2bin("3b3fd92eb72dad20333449f8e83cfb4a")),
- ?line m(Plain,
- crypto:aes_cfb_128_decrypt(Key, IVec, Cipher)).
+ ?line Cipher = hexstr2bin("3b3fd92eb72dad20333449f8e83cfb4a"),
+
+ %% Try all prefixes of plain and cipher.
+ aes_cfb_do(byte_size(Plain), Plain, Cipher, Key, IVec).
+
+aes_cfb_do(N, Plain, Cipher, Key, IVec) when N >= 0 ->
+ <<P:N/binary, _/binary>> = Plain,
+ <<C:N/binary, _/binary>> = Cipher,
+ ?line C = crypto:aes_cfb_128_encrypt(Key, IVec, P),
+ ?line P = crypto:aes_cfb_128_decrypt(Key, IVec, C),
+ aes_cfb_do(N-1, Plain, Cipher, Key, IVec);
+aes_cfb_do(_, _, _, _, _) -> ok.
+
%%
%%
@@ -1207,6 +1550,33 @@ rsa_sign_test(Config) when is_list(Config) ->
ok.
+rsa_sign_hash_test(doc) ->
+ "rsa_sign_hash testing";
+rsa_sign_hash_test(suite) ->
+ [];
+rsa_sign_hash_test(Config) when is_list(Config) ->
+ PubEx = 65537,
+ PrivEx = 7531712708607620783801185371644749935066152052780368689827275932079815492940396744378735701395659435842364793962992309884847527234216715366607660219930945,
+ Mod = 7919488123861148172698919999061127847747888703039837999377650217570191053151807772962118671509138346758471459464133273114654252861270845708312601272799123,
+ Msg = <<"7896345786348756234 Hejsan Svejsan, erlang crypto debugger"
+ "09812312908312378623487263487623412039812 huagasd">>,
+
+ PrivKey = [crypto:mpint(PubEx), crypto:mpint(Mod), crypto:mpint(PrivEx)],
+ PubKey = [crypto:mpint(PubEx), crypto:mpint(Mod)],
+ MD5 = crypto:md5(sized_binary(Msg)),
+ SHA = crypto:sha(sized_binary(Msg)),
+ ?line Sig1 = crypto:rsa_sign(sha, {digest,SHA}, PrivKey),
+ ?line m(crypto:rsa_verify(sha, {digest,SHA}, sized_binary(Sig1),PubKey), true),
+
+ ?line Sig2 = crypto:rsa_sign(md5, {digest,MD5}, PrivKey),
+ ?line m(crypto:rsa_verify(md5, {digest,MD5}, sized_binary(Sig2),PubKey), true),
+
+ ?line m(Sig1 =:= Sig2, false),
+ ?line m(crypto:rsa_verify(md5, {digest,MD5}, sized_binary(Sig1),PubKey), false),
+ ?line m(crypto:rsa_verify(sha, {digest,SHA}, sized_binary(Sig2),PubKey), false),
+
+ ok.
+
dsa_sign_test(doc) ->
"dsa_sign testing";
dsa_sign_test(suite) ->
@@ -1237,6 +1607,37 @@ dsa_sign_test(Config) when is_list(Config) ->
ok.
+dsa_sign_hash_test(doc) ->
+ "dsa_sign_hash testing";
+dsa_sign_hash_test(suite) ->
+ [];
+dsa_sign_hash_test(Config) when is_list(Config) ->
+ Msg = <<"7896345786348756234 Hejsan Svejsan, erlang crypto debugger"
+ "09812312908312378623487263487623412039812 huagasd">>,
+ SHA = crypto:sha(sized_binary(Msg)),
+
+ PubKey = _Y = 25854665488880835237281628794585130313500176551981812527054397586638455298000483144002221850980183404910190346416063318160497344811383498859129095184158800144312512447497510551471331451396405348497845813002058423110442376886564659959543650802132345311573634832461635601376738282831340827591903548964194832978,
+ PrivKey = _X = 441502407453038284293378221372000880210588566361,
+ ParamP = 109799869232806890760655301608454668257695818999841877165019612946154359052535682480084145133201304812979481136659521529774182959764860329095546511521488413513097576425638476458000255392402120367876345280670101492199681798674053929238558140260669578407351853803102625390950534052428162468100618240968893110797,
+ ParamQ = 1349199015905534965792122312016505075413456283393,
+ ParamG = 18320614775012672475365915366944922415598782131828709277168615511695849821411624805195787607930033958243224786899641459701930253094446221381818858674389863050420226114787005820357372837321561754462061849169568607689530279303056075793886577588606958623645901271866346406773590024901668622321064384483571751669,
+
+ Params = [crypto:mpint(ParamP), crypto:mpint(ParamQ), crypto:mpint(ParamG)],
+ ?line Sig1 = crypto:dss_sign(sha, {digest,SHA}, Params ++ [crypto:mpint(PrivKey)]),
+
+ ?line m(crypto:dss_verify(none, SHA, sized_binary(Sig1),
+ Params ++ [crypto:mpint(PubKey)]), true),
+
+ ?line m(crypto:dss_verify(sized_binary(one_bit_wrong(Msg)), sized_binary(Sig1),
+ Params ++ [crypto:mpint(PubKey)]), false),
+
+ ?line m(crypto:dss_verify(sized_binary(Msg), sized_binary(one_bit_wrong(Sig1)),
+ Params ++ [crypto:mpint(PubKey)]), false),
+
+ %%?line Bad = crypto:dss_sign(sized_binary(Msg), [Params, crypto:mpint(PubKey)]),
+
+ ok.
+
rsa_encrypt_decrypt(doc) ->
["Test rsa_public_encrypt and rsa_private_decrypt functions."];
@@ -1421,7 +1822,9 @@ worker_loop(N, Config) ->
Funcs = { md5, md5_update, md5_mac, md5_mac_io, sha, sha_update, des_cbc,
aes_cfb, aes_cbc, des_cbc_iter, rand_uniform_test, strong_rand_test,
rsa_verify_test, exor_test, rc4_test, rc4_stream_test, mod_exp_test,
- hmac_update_md5, hmac_update_sha, aes_ctr_stream },
+ hmac_update_md5, hmac_update_sha, hmac_update_sha256, hmac_update_sha512,
+ hmac_rfc4231,
+ aes_ctr_stream },
F = element(random:uniform(size(Funcs)),Funcs),
%%io:format("worker ~p calling ~p\n",[self(),F]),
@@ -1548,3 +1951,11 @@ my_dss_sign(Data,Key) ->
?line S3 = crypto:dss_sign(none, crypto:sha(Raw), Key),
[S1,S2,S3].
+openssl_version() ->
+ case crypto:info_lib() of
+ [{<<"OpenSSL">>,LibVer,_}] when is_integer(LibVer) ->
+ LibVer;
+ _ ->
+ undefined
+ end.
+
diff --git a/lib/crypto/vsn.mk b/lib/crypto/vsn.mk
index 7e82e47d38..ccfb1fd66e 100644
--- a/lib/crypto/vsn.mk
+++ b/lib/crypto/vsn.mk
@@ -1 +1 @@
-CRYPTO_VSN = 2.1
+CRYPTO_VSN = 2.2
diff --git a/lib/debugger/doc/src/Makefile b/lib/debugger/doc/src/Makefile
index 1c0bbaf9d2..ba62e41f6b 100644
--- a/lib/debugger/doc/src/Makefile
+++ b/lib/debugger/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -110,12 +110,12 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
- (/bin/cp -rf $(HTMLDIR) $(RELSYSDIR)/doc)
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
+ (/bin/cp -rf $(HTMLDIR) "$(RELSYSDIR)/doc")
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/debugger/doc/src/notes.xml b/lib/debugger/doc/src/notes.xml
index 4d8bd8ebe4..66638a59f6 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -32,6 +32,22 @@
<p>This document describes the changes made to the Debugger
application.</p>
+<section><title>Debugger 3.2.8</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fixed disappearing breakpoints bug, reported by Ricardo
+ Catalinas Jim�nez.</p>
+ <p>
+ Own Id: OTP-9950</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Debugger 3.2.7</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/debugger/priv/Makefile b/lib/debugger/priv/Makefile
index 1036a5666b..cc19aceaf6 100644
--- a/lib/debugger/priv/Makefile
+++ b/lib/debugger/priv/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -54,8 +54,8 @@ clean:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DATA) $(TOOLBAR_FILES) $(RELSYSDIR)/priv
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) $(TOOLBAR_FILES) "$(RELSYSDIR)/priv"
release_docs_spec:
diff --git a/lib/debugger/src/Makefile b/lib/debugger/src/Makefile
index be9a2d13cb..e8b350c0c7 100644
--- a/lib/debugger/src/Makefile
+++ b/lib/debugger/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -129,9 +129,9 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) $(TOOLBOX_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(TARGET_TOOLBOX_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) $(TOOLBOX_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) $(TARGET_TOOLBOX_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/debugger/src/dbg_iserver.erl b/lib/debugger/src/dbg_iserver.erl
index 1bb73a43b9..31a856545f 100644
--- a/lib/debugger/src/dbg_iserver.erl
+++ b/lib/debugger/src/dbg_iserver.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -188,10 +188,7 @@ handle_call({new_break, Point, Options}, _From, State) ->
handle_call(all_breaks, _From, State) ->
{reply, State#state.breaks, State};
handle_call({all_breaks, Mod}, _From, State) ->
- Reply = lists:filter(fun({{M,_L}, _Options}) ->
- M =/= Mod
- end,
- State#state.breaks),
+ Reply = [Break || Break = {{M, _},_} <- State#state.breaks, M =:= Mod],
{reply, Reply, State};
%% From Meta process
diff --git a/lib/debugger/src/dbg_ui_break_win.erl b/lib/debugger/src/dbg_ui_break_win.erl
index abbec158b0..11d810ccab 100644
--- a/lib/debugger/src/dbg_ui_break_win.erl
+++ b/lib/debugger/src/dbg_ui_break_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -17,6 +17,18 @@
%% %CopyrightEnd%
%%
-module(dbg_ui_break_win).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,entry,2}},
+ {nowarn_deprecated_function,{gs,frame,2}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,listbox,2}},
+ {nowarn_deprecated_function,{gs,menu,2}},
+ {nowarn_deprecated_function,{gs,menuitem,2}},
+ {nowarn_deprecated_function,{gs,radiobutton,2}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
%% External exports
-export([create_win/5,
diff --git a/lib/debugger/src/dbg_ui_edit_win.erl b/lib/debugger/src/dbg_ui_edit_win.erl
index 9b0441b44c..2e9a685b57 100644
--- a/lib/debugger/src/dbg_ui_edit_win.erl
+++ b/lib/debugger/src/dbg_ui_edit_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -17,6 +17,12 @@
%% %CopyrightEnd%
%%
-module(dbg_ui_edit_win).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,entry,2}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
%% External exports
-export([create_win/5, get_window/1,
diff --git a/lib/debugger/src/dbg_ui_filedialog_win.erl b/lib/debugger/src/dbg_ui_filedialog_win.erl
index 1eced1104d..52dc2012f3 100644
--- a/lib/debugger/src/dbg_ui_filedialog_win.erl
+++ b/lib/debugger/src/dbg_ui_filedialog_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -18,6 +18,13 @@
%%
-module(dbg_ui_filedialog_win).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,entry,3}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,listbox,3}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
%% External exports
-export([create_win/6, create_win/7, get_window/1,
diff --git a/lib/debugger/src/dbg_ui_mon_win.erl b/lib/debugger/src/dbg_ui_mon_win.erl
index 52e8f433ba..8655c7697a 100644
--- a/lib/debugger/src/dbg_ui_mon_win.erl
+++ b/lib/debugger/src/dbg_ui_mon_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -17,6 +17,19 @@
%% %CopyrightEnd%
%%
-module(dbg_ui_mon_win).
+-compile([{nowarn_deprecated_function,{gs,checkbutton,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,frame,2}},
+ {nowarn_deprecated_function,{gs,grid,2}},
+ {nowarn_deprecated_function,{gs,gridline,2}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,listbox,2}},
+ {nowarn_deprecated_function,{gs,menu,2}},
+ {nowarn_deprecated_function,{gs,menubar,2}},
+ {nowarn_deprecated_function,{gs,menuitem,2}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
%% External exports
-export([init/0]).
diff --git a/lib/debugger/src/dbg_ui_trace_win.erl b/lib/debugger/src/dbg_ui_trace_win.erl
index 82d4199630..1b439cbf18 100644
--- a/lib/debugger/src/dbg_ui_trace_win.erl
+++ b/lib/debugger/src/dbg_ui_trace_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -17,6 +17,25 @@
%% %CopyrightEnd%
%%
-module(dbg_ui_trace_win).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,button,3}},
+ {nowarn_deprecated_function,{gs,checkbutton,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,4}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,editor,2}},
+ {nowarn_deprecated_function,{gs,editor,3}},
+ {nowarn_deprecated_function,{gs,entry,2}},
+ {nowarn_deprecated_function,{gs,entry,3}},
+ {nowarn_deprecated_function,{gs,frame,3}},
+ {nowarn_deprecated_function,{gs,grid,3}},
+ {nowarn_deprecated_function,{gs,gridline,2}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,label,3}},
+ {nowarn_deprecated_function,{gs,menubar,2}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,window,2}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
%% External exports
-export([init/0]).
diff --git a/lib/debugger/src/dbg_ui_win.erl b/lib/debugger/src/dbg_ui_win.erl
index 9bed6a1ec5..1c7a80a1c4 100644
--- a/lib/debugger/src/dbg_ui_win.erl
+++ b/lib/debugger/src/dbg_ui_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -17,6 +17,15 @@
%% %CopyrightEnd%
%%
-module(dbg_ui_win).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,menu,2}},
+ {nowarn_deprecated_function,{gs,menu,3}},
+ {nowarn_deprecated_function,{gs,menubutton,2}},
+ {nowarn_deprecated_function,{gs,menuitem,2}},
+ {nowarn_deprecated_function,{gs,menuitem,3}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,1}}]).
%% External exports
-export([init/0,
diff --git a/lib/debugger/src/dbg_ui_winman.erl b/lib/debugger/src/dbg_ui_winman.erl
index c7aac0df23..b5433a202b 100644
--- a/lib/debugger/src/dbg_ui_winman.erl
+++ b/lib/debugger/src/dbg_ui_winman.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -18,6 +18,11 @@
%%
-module(dbg_ui_winman).
-behaviour(gen_server).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,menu,3}},
+ {nowarn_deprecated_function,{gs,menubutton,3}},
+ {nowarn_deprecated_function,{gs,menuitem,3}}]).
%% External exports
-export([start/0]).
diff --git a/lib/debugger/src/dbg_wx_trace_win.erl b/lib/debugger/src/dbg_wx_trace_win.erl
index 79cf87ae62..68e8e0b844 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -19,6 +19,7 @@
%%
-module(dbg_wx_trace_win).
+-compile([{nowarn_deprecated_function,{gs,config,2}}]).
%% External exports
-export([init/0, stop/1]).
diff --git a/lib/debugger/test/Makefile b/lib/debugger/test/Makefile
index 3dfbed31ff..5aa290c61b 100644
--- a/lib/debugger/test/Makefile
+++ b/lib/debugger/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2011. All Rights Reserved.
+# Copyright Ericsson AB 1998-2012. 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
@@ -98,10 +98,10 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(EMAKEFILE) $(ERL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) debugger.spec debugger.cover $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(EMAKEFILE) $(ERL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) debugger.spec debugger.cover "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/debugger/test/bs_construct_SUITE.erl b/lib/debugger/test/bs_construct_SUITE.erl
index fa7b40ff1e..e0bda7eac8 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2012. 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
@@ -477,7 +477,6 @@ mem_leak(0, _) -> ok;
mem_leak(N, B) ->
?line big_bin(B, <<23>>),
?line {'EXIT',{badarg,_}} = (catch big_bin(B, bad)),
- maybe_gc(),
mem_leak(N-1, B).
big_bin(B1, B2) ->
@@ -490,13 +489,6 @@ big_bin(B1, B2) ->
make_bin(0, Acc) -> Acc;
make_bin(N, Acc) -> make_bin(N-1, <<Acc/binary,Acc/binary>>).
-maybe_gc() ->
- case erlang:system_info(heap_type) of
- shared -> erlang:garbage_collect();
- hybrid -> erlang:garbage_collect();
- private -> ok
- end.
-
-define(COF(Int0),
?line (fun(Int) ->
true = <<Int:32/float>> =:= <<(float(Int)):32/float>>,
diff --git a/lib/debugger/test/bs_match_misc_SUITE.erl b/lib/debugger/test/bs_match_misc_SUITE.erl
index ec3746d76a..6b66c45448 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2012. 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/lib/debugger/test/erl_eval_SUITE.erl b/lib/debugger/test/erl_eval_SUITE.erl
index a92251e1af..c675f704b4 100644
--- a/lib/debugger/test/erl_eval_SUITE.erl
+++ b/lib/debugger/test/erl_eval_SUITE.erl
@@ -216,13 +216,13 @@ guard_4(doc) ->
guard_4(suite) ->
[];
guard_4(Config) when is_list(Config) ->
- ?line check(fun() -> if {erlang,'+'}(3,a) -> true ; true -> false end end,
- "if {erlang,'+'}(3,a) -> true ; true -> false end.",
- false),
- ?line check(fun() -> if {erlang,is_integer}(3) -> true ; true -> false end
- end,
- "if {erlang,is_integer}(3) -> true ; true -> false end.",
- true),
+ check(fun() -> if erlang:'+'(3,a) -> true ; true -> false end end,
+ "if erlang:'+'(3,a) -> true ; true -> false end.",
+ false),
+ check(fun() -> if erlang:is_integer(3) -> true ; true -> false end
+ 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]),
@@ -230,11 +230,11 @@ guard_4(Config) when is_list(Config) ->
end,
"if is_atom(is_integer(a)) -> true ; true -> false end.",
true),
- ?line 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),
+ 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),
@@ -1060,11 +1060,6 @@ do_funs(LFH, EFH) ->
concat(["begin F1 = fun(F,N) -> apply(", M,
",count_down,[F, N]) end, F1(F1,1000) end."]),
0, ['F1'], LFH, EFH),
- ?line 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() -> F = fun(F,N) when N > 0 -> apply(F,[F,N-1]);
(_F,0) -> ok end,
F(F, 1000)
@@ -1096,11 +1091,6 @@ do_funs(LFH, EFH) ->
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) -> {erlang,'+'}(X,2) end,
- true = 3 == F(1) end,
- "begin F = fun(X) -> {erlang,'+'}(X,2) end,"
- " true = 3 == F(1) end.", true, ['F'],
- LFH, EFH),
?line check(fun() -> F = fun(X) -> byte_size(X) end,
?MODULE:do_apply(F,<<"hej">>) end,
concat(["begin F = fun(X) -> size(X) end,",
diff --git a/lib/debugger/test/int_break_SUITE.erl b/lib/debugger/test/int_break_SUITE.erl
index 159678a1f9..7bb0fc2018 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -76,6 +76,9 @@ basic(Config) when list(Config) ->
?line S3 = [xxx,y] = ordsets1:add_element(y, S2),
?line ok = i:ib(ordsets1, union, 2),
?line [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.";
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 c9ac6931e2..0d7883f067 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
@@ -76,12 +76,6 @@ apply_test(Fun) ->
[a,b,d] = ?MODULE:Func(same([a,b,c,d]), same([c])),
[d,e] = apply(Mod, Func, [same([d,e,f]), same([f])]),
[3] = apply(?MODULE, Func, [same([3,4]),same([4])]),
-
- %% This is obsolete, but it should work anyway.
- HomeMadeFun = {?MODULE,my_subtract},
- [a] = HomeMadeFun(same([a,x,c]), same([x,c])),
- [x] = apply(HomeMadeFun, [[x,y],[y,z]]),
-
ok.
number(X) -> {number,X}.
diff --git a/lib/debugger/vsn.mk b/lib/debugger/vsn.mk
index 01ff0eb9a8..5b572f5f20 100644
--- a/lib/debugger/vsn.mk
+++ b/lib/debugger/vsn.mk
@@ -1 +1 @@
-DEBUGGER_VSN = 3.2.7
+DEBUGGER_VSN = 3.2.8
diff --git a/lib/dialyzer/doc/src/Makefile b/lib/dialyzer/doc/src/Makefile
index 45b0ffa5ff..a827281cc5 100644
--- a/lib/dialyzer/doc/src/Makefile
+++ b/lib/dialyzer/doc/src/Makefile
@@ -100,13 +100,13 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml
index f100865b56..0c1556308c 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>2011</year>
+ <year>2006</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -31,6 +31,79 @@
<p>This document describes the changes made to the Dialyzer
application.</p>
+<section><title>Dialyzer 2.5.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p> Correct handling of type names in contracts. Fix
+ crash related to contract checking. Do not rewrite
+ unchanged PLT. </p>
+ <p>
+ Own Id: OTP-10083</p>
+ </item>
+ <item>
+ <p>
+ Stop a forgotten server process</p>
+ <p>
+ Dialyzer forgot to stop a server process before finishing
+ its analysis. This is a concurrency error detected by
+ Concuerror. Changes to fix warnings identified by running
+ dialyzer -Wunmatched_returns. Thanks to Kostis Sagonas.</p>
+ <p>
+ Own Id: OTP-10231</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p> Bug fixes and improvements of
+ <c>dialyzer_typesig</c>. </p>
+ <p>
+ Own Id: OTP-10082</p>
+ </item>
+ <item>
+ <p>
+ Add parallel dialyzer support</p>
+ <p>
+ Own Id: OTP-10103</p>
+ </item>
+ <item>
+ <p> An alternative implementation of the solver in
+ <c>dialyzer_typesig</c> has been introduced. It is faster
+ than the original implementation. </p>
+ <p>
+ Own Id: OTP-10110</p>
+ </item>
+ <item>
+ <p> Bugs in <c>erl_types:t_inf()</c> (HiPE) and in
+ <c>dialyzer_dataflow</c> (Dialyzer) have been fixed. </p>
+ <p>
+ Own Id: OTP-10191</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Dialyzer 2.5.1</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p> Handle <c>nowarn_unused_function</c> the same way as
+ the compiler does. </p>
+ <p>
+ Own Id: OTP-9833</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Dialyzer 2.5</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/dialyzer/src/Makefile b/lib/dialyzer/src/Makefile
index 810f86dc21..63cc1c98f1 100644
--- a/lib/dialyzer/src/Makefile
+++ b/lib/dialyzer/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2010. All Rights Reserved.
+# Copyright Ericsson AB 2006-2012. 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
@@ -63,7 +63,10 @@ MODULES = \
dialyzer_plt \
dialyzer_races \
dialyzer_succ_typings \
+ dialyzer_timing \
dialyzer_typesig \
+ dialyzer_coordinator \
+ dialyzer_worker \
dialyzer_utils
HRL_FILES= dialyzer.hrl dialyzer_gui_wx.hrl
@@ -86,7 +89,7 @@ APPUP_TARGET= $(EBIN)/$(APPUP_FILE)
ifeq ($(NATIVE_LIBS_ENABLED),yes)
ERL_COMPILE_FLAGS += +native
endif
-ERL_COMPILE_FLAGS += +warn_exported_vars +warn_unused_import +warn_untyped_record +warn_missing_spec
+ERL_COMPILE_FLAGS += +warn_exported_vars +warn_unused_import +warn_untyped_record +warn_missing_spec +warnings_as_errors
# ----------------------------------------------------
# Targets
@@ -152,10 +155,10 @@ $(EBIN)/dialyzer_utils.beam: dialyzer.hrl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
$(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(EXTRA_FILES) \
- $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(INSTALL_FILES) $(RELSYSDIR)/ebin
+ "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(INSTALL_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/dialyzer/src/dialyzer.erl b/lib/dialyzer/src/dialyzer.erl
index 3e3c12405f..63c51e219a 100644
--- a/lib/dialyzer/src/dialyzer.erl
+++ b/lib/dialyzer/src/dialyzer.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -162,14 +162,17 @@ run(Opts) ->
{error, Msg} ->
throw({dialyzer_error, Msg});
OptsRecord ->
- case cl_check_init(OptsRecord) of
- {ok, ?RET_NOTHING_SUSPICIOUS} ->
- case dialyzer_cl:start(OptsRecord) of
- {?RET_DISCREPANCIES, Warnings} -> Warnings;
- {?RET_NOTHING_SUSPICIOUS, []} -> []
- end;
- {error, ErrorMsg1} ->
- throw({dialyzer_error, ErrorMsg1})
+ case OptsRecord#options.check_plt of
+ true ->
+ case cl_check_init(OptsRecord) of
+ {ok, ?RET_NOTHING_SUSPICIOUS} -> ok;
+ {error, ErrorMsg1} -> throw({dialyzer_error, ErrorMsg1})
+ end;
+ false -> ok
+ end,
+ case dialyzer_cl:start(OptsRecord) of
+ {?RET_DISCREPANCIES, Warnings} -> Warnings;
+ {?RET_NOTHING_SUSPICIOUS, []} -> []
end
catch
throw:{dialyzer_error, ErrorMsg} ->
@@ -380,8 +383,6 @@ message_to_string({pattern_match_cov, [Pat, Type]}) ->
message_to_string({unmatched_return, [Type]}) ->
io_lib:format("Expression produces a value of type ~s,"
" but this value is unmatched\n", [Type]);
-message_to_string({unused_fun, []}) ->
- io_lib:format("Function will never be called\n", []);
message_to_string({unused_fun, [F, A]}) ->
io_lib:format("Function ~w/~w will never be called\n", [F, A]);
%%----- Warnings for specs and contracts -------------------
diff --git a/lib/dialyzer/src/dialyzer.hrl b/lib/dialyzer/src/dialyzer.hrl
index 5e089d1773..105a174e31 100644
--- a/lib/dialyzer/src/dialyzer.hrl
+++ b/lib/dialyzer/src/dialyzer.hrl
@@ -2,7 +2,7 @@
%%%
%%% %CopyrightBegin%
%%%
-%%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%%% Copyright Ericsson AB 2006-2012. 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
@@ -110,6 +110,8 @@
-type label() :: non_neg_integer().
-type rep_mode() :: 'quiet' | 'normal' | 'verbose'.
-type start_from() :: 'byte_code' | 'src_code'.
+-type mfa_or_funlbl() :: label() | mfa().
+-type solver() :: 'v1' | 'v2'.
%%--------------------------------------------------------------------
%% Record declarations used by various files
@@ -126,11 +128,15 @@
use_contracts = true :: boolean(),
race_detection = false :: boolean(),
behaviours_chk = false :: boolean(),
- callgraph_file = "" :: file:filename()}).
+ timing = false :: boolean() | 'debug',
+ timing_server :: dialyzer_timing:timing_server(),
+ callgraph_file = "" :: file:filename(),
+ solvers :: [solver()]}).
-record(options, {files = [] :: [file:filename()],
files_rec = [] :: [file:filename()],
analysis_type = succ_typings :: anal_type1(),
+ timing = false :: boolean() | 'debug',
defines = [] :: [dial_define()],
from = byte_code :: start_from(),
get_warnings = maybe :: boolean() | 'maybe',
@@ -145,10 +151,20 @@
output_format = formatted :: format(),
filename_opt = basename :: fopt(),
callgraph_file = "" :: file:filename(),
- check_plt = true :: boolean()}).
+ check_plt = true :: boolean(),
+ solvers = [] :: [solver()]}).
-record(contract, {contracts = [] :: [contract_pair()],
args = [] :: [erl_types:erl_type()],
forms = [] :: [{_, _}]}).
%%--------------------------------------------------------------------
+
+-define(timing(Server, Msg, Var, Expr),
+ begin
+ dialyzer_timing:start_stamp(Server, Msg),
+ Var = Expr,
+ dialyzer_timing:end_stamp(Server),
+ Var
+ end).
+-define(timing(Server, Msg, Expr),?timing(Server, Msg, _T, Expr)).
diff --git a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
index 458f3a4c81..86618a4915 100644
--- a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
+++ b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
@@ -2,7 +2,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -30,6 +30,15 @@
-export([start/3]).
+-export([compile_init_result/0,
+ add_to_result/4,
+ start_compilation/2,
+ continue_compilation/2]).
+
+-export_type([compile_init_data/0,
+ one_file_result/0,
+ compile_result/0]).
+
-include("dialyzer.hrl").
-record(analysis_state,
@@ -43,7 +52,9 @@
parent :: pid(),
plt :: dialyzer_plt:plt(),
start_from = byte_code :: start_from(),
- use_contracts = true :: boolean()
+ use_contracts = true :: boolean(),
+ timing_server :: dialyzer_timing:timing_server(),
+ solvers :: [solver()]
}).
-record(server_state, {parent :: pid(), legal_warnings :: [dial_warn_tag()]}).
@@ -55,12 +66,15 @@
-spec start(pid(), [dial_warn_tag()], #analysis{}) -> 'ok'.
start(Parent, LegalWarnings, Analysis) ->
+ TimingServer = dialyzer_timing:init(Analysis#analysis.timing),
RacesOn = ordsets:is_element(?WARN_RACE_CONDITION, LegalWarnings),
- Analysis0 = Analysis#analysis{race_detection = RacesOn},
+ Analysis0 =
+ Analysis#analysis{race_detection = RacesOn, timing_server = TimingServer},
Analysis1 = expand_files(Analysis0),
Analysis2 = run_analysis(Analysis1),
State = #server_state{parent = Parent, legal_warnings = LegalWarnings},
- loop(State, Analysis2, none).
+ loop(State, Analysis2, none),
+ dialyzer_timing:stop(TimingServer).
run_analysis(Analysis) ->
Self = self(),
@@ -122,7 +136,9 @@ analysis_start(Parent, Analysis) ->
plt = Plt,
parent = Parent,
start_from = Analysis#analysis.start_from,
- use_contracts = Analysis#analysis.use_contracts
+ use_contracts = Analysis#analysis.use_contracts,
+ timing_server = Analysis#analysis.timing_server,
+ solvers = Analysis#analysis.solvers
},
Files = ordsets:from_list(Analysis#analysis.files),
{Callgraph, NoWarn, TmpCServer0} = compile_and_store(Files, State),
@@ -146,7 +162,8 @@ analysis_start(Parent, Analysis) ->
dialyzer_codeserver:insert_temp_exported_types(MergedExpTypes,
TmpCServer1),
TmpCServer3 = dialyzer_utils:process_record_remote_types(TmpCServer2),
- dialyzer_contracts:process_contract_remote_types(TmpCServer3)
+ ?timing(State#analysis_state.timing_server, "remote",
+ dialyzer_contracts:process_contract_remote_types(TmpCServer3))
catch
throw:{error, _ErrorMsg} = Error -> exit(Error)
end,
@@ -167,80 +184,75 @@ analysis_start(Parent, Analysis) ->
false -> Callgraph
end,
State3 = analyze_callgraph(NewCallgraph, State2#analysis_state{plt = Plt1}),
+ dialyzer_callgraph:dispose_race_server(NewCallgraph),
rcv_and_send_ext_types(Parent),
NonExports = sets:subtract(sets:from_list(AllNodes), Exports),
NonExportsList = sets:to_list(NonExports),
- Plt3 = dialyzer_plt:delete_list(State3#analysis_state.plt, NonExportsList),
- Plt4 = dialyzer_plt:delete_contract_list(Plt3, NonExportsList),
+ Plt2 = dialyzer_plt:delete_list(State3#analysis_state.plt, NonExportsList),
send_codeserver_plt(Parent, CServer, State3#analysis_state.plt),
- send_analysis_done(Parent, Plt4, State3#analysis_state.doc_plt).
+ send_analysis_done(Parent, Plt2, State3#analysis_state.doc_plt).
-analyze_callgraph(Callgraph, State) ->
- Codeserver = State#analysis_state.codeserver,
+analyze_callgraph(Callgraph, #analysis_state{codeserver = Codeserver,
+ doc_plt = DocPlt,
+ timing_server = TimingServer,
+ parent = Parent,
+ solvers = Solvers} = State) ->
Plt = dialyzer_plt:insert_callbacks(State#analysis_state.plt, Codeserver),
- Parent = State#analysis_state.parent,
- case State#analysis_state.analysis_type of
- plt_build ->
- Callgraph1 = dialyzer_callgraph:finalize(Callgraph),
- NewPlt = dialyzer_succ_typings:analyze_callgraph(Callgraph1, Plt,
- Codeserver, Parent),
- dialyzer_callgraph:delete(Callgraph1),
- State#analysis_state{plt = NewPlt};
- succ_typings ->
- NoWarn = State#analysis_state.no_warn_unused,
- DocPlt = State#analysis_state.doc_plt,
- Callgraph1 = dialyzer_callgraph:finalize(Callgraph),
- {Warnings, NewPlt, NewDocPlt} =
- dialyzer_succ_typings:get_warnings(Callgraph1, Plt, DocPlt,
- Codeserver, NoWarn, Parent),
- dialyzer_callgraph:delete(Callgraph1),
- send_warnings(State#analysis_state.parent, Warnings),
- State#analysis_state{plt = NewPlt, doc_plt = NewDocPlt}
- end.
+ {NewPlt, NewDocPlt} =
+ case State#analysis_state.analysis_type of
+ plt_build ->
+ NewPlt0 =
+ dialyzer_succ_typings:analyze_callgraph(Callgraph, Plt, Codeserver,
+ TimingServer, Solvers, Parent),
+ {NewPlt0, DocPlt};
+ succ_typings ->
+ NoWarn = State#analysis_state.no_warn_unused,
+ {Warnings, NewPlt0, NewDocPlt0} =
+ dialyzer_succ_typings:get_warnings(Callgraph, Plt, DocPlt, Codeserver,
+ NoWarn, TimingServer, Solvers, Parent),
+ send_warnings(State#analysis_state.parent, Warnings),
+ {NewPlt0, NewDocPlt0}
+ end,
+ dialyzer_callgraph:delete(Callgraph),
+ State#analysis_state{plt = NewPlt, doc_plt = NewDocPlt}.
%%--------------------------------------------------------------------
%% Build the callgraph and fill the codeserver.
%%--------------------------------------------------------------------
+-record(compile_init,{
+ callgraph :: dialyzer_callgraph:callgraph(),
+ codeserver :: dialyzer_codeserver:codeserver(),
+ defines = [] :: [dial_define()],
+ include_dirs = [] :: [file:filename()],
+ start_from = byte_code :: start_from(),
+ use_contracts = true :: boolean()
+ }).
+
+make_compile_init(#analysis_state{codeserver = Codeserver,
+ defines = Defs,
+ include_dirs = Dirs,
+ use_contracts = UseContracts,
+ start_from = StartFrom}, Callgraph) ->
+ #compile_init{callgraph = Callgraph,
+ codeserver = Codeserver,
+ defines = [{d, Macro, Val} || {Macro, Val} <- Defs],
+ include_dirs = [{i, D} || D <- Dirs],
+ use_contracts = UseContracts,
+ start_from = StartFrom}.
+
compile_and_store(Files, #analysis_state{codeserver = CServer,
- defines = Defs,
- include_dirs = Dirs,
- parent = Parent,
- use_contracts = UseContracts,
- start_from = StartFrom
- } = State) ->
+ timing_server = Timing,
+ parent = Parent} = State) ->
send_log(Parent, "Reading files and computing callgraph... "),
{T1, _} = statistics(runtime),
- Includes = [{i, D} || D <- Dirs],
- Defines = [{d, Macro, Val} || {Macro, Val} <- Defs],
Callgraph = dialyzer_callgraph:new(),
- Fun = case StartFrom of
- src_code ->
- fun(File, {TmpCG, TmpCServer, TmpFailed, TmpNoWarn, TmpMods}) ->
- case compile_src(File, Includes, Defines, TmpCG,
- TmpCServer, UseContracts) of
- {error, Reason} ->
- {TmpCG, TmpCServer, [{File, Reason}|TmpFailed], TmpNoWarn,
- TmpMods};
- {ok, NewCG, NoWarn, NewCServer, Mod} ->
- {NewCG, NewCServer, TmpFailed, NoWarn++TmpNoWarn,
- [Mod|TmpMods]}
- end
- end;
- byte_code ->
- fun(File, {TmpCG, TmpCServer, TmpFailed, TmpNoWarn, TmpMods}) ->
- case compile_byte(File, TmpCG, TmpCServer, UseContracts) of
- {error, Reason} ->
- {TmpCG, TmpCServer, [{File, Reason}|TmpFailed], TmpNoWarn,
- TmpMods};
- {ok, NewCG, NoWarn, NewCServer, Mod} ->
- {NewCG, NewCServer, TmpFailed, NoWarn++TmpNoWarn,
- [Mod|TmpMods]}
- end
- end
- end,
- {NewCallgraph1, NewCServer, Failed, NoWarn, Modules} =
- lists:foldl(Fun, {Callgraph, CServer, [], [], []}, Files),
+ CompileInit = make_compile_init(State, Callgraph),
+ {{Failed, NoWarn, Modules}, NextLabel} =
+ ?timing(Timing, "compile", _C1,
+ dialyzer_coordinator:parallel_job(compile, Files,
+ CompileInit, Timing)),
+ CServer2 = dialyzer_codeserver:set_next_core_label(NextLabel, CServer),
case Failed =:= [] of
true ->
NewFiles = lists:zip(lists:reverse(Modules), Files),
@@ -256,11 +268,56 @@ compile_and_store(Files, #analysis_state{codeserver = CServer,
{T2, _} = statistics(runtime),
Msg1 = io_lib:format("done in ~.2f secs\nRemoving edges... ", [(T2-T1)/1000]),
send_log(Parent, Msg1),
- NewCallgraph2 = cleanup_callgraph(State, NewCServer, NewCallgraph1, Modules),
+ Callgraph =
+ ?timing(Timing, "clean", _C2,
+ cleanup_callgraph(State, CServer2, Callgraph, Modules)),
{T3, _} = statistics(runtime),
Msg2 = io_lib:format("done in ~.2f secs\n", [(T3-T2)/1000]),
send_log(Parent, Msg2),
- {NewCallgraph2, sets:from_list(NoWarn), NewCServer}.
+ {Callgraph, sets:from_list(NoWarn), CServer2}.
+
+-type compile_init_data() :: #compile_init{}.
+-type error_reason() :: string().
+-type compile_result() :: {[{file:filename(), error_reason()}], [mfa()],
+ [module()]}. %%opaque
+-type one_file_result() :: {error, error_reason()} |
+ {ok, [dialyzer_callgraph:callgraph_edge()],
+ [mfa_or_funlbl()], [mfa()], module()}. %%opaque
+-type compile_mid_data() :: {module(), cerl:cerl(), [mfa()],
+ dialyzer_callgraph:callgraph(),
+ dialyzer_codeserver:codeserver()}.
+
+-spec compile_init_result() -> compile_result().
+
+compile_init_result() -> {[], [], []}.
+
+-spec add_to_result(file:filename(), one_file_result(), compile_result(),
+ compile_init_data()) -> compile_result().
+
+add_to_result(File, NewData, {Failed, NoWarn, Mods}, InitData) ->
+ case NewData of
+ {error, Reason} ->
+ {[{File, Reason}|Failed], NoWarn, Mods};
+ {ok, V, E, NewNoWarn, Mod} ->
+ Callgraph = InitData#compile_init.callgraph,
+ dialyzer_callgraph:add_edges(E, V, Callgraph),
+ {Failed, NewNoWarn ++ NoWarn, [Mod|Mods]}
+ end.
+
+-spec start_compilation(file:filename(), compile_init_data()) ->
+ {error, error_reason()} |{ok, integer(), compile_mid_data()}.
+
+start_compilation(File,
+ #compile_init{callgraph = Callgraph, codeserver = Codeserver,
+ defines = Defines, include_dirs = IncludeD,
+ use_contracts = UseContracts,
+ start_from = StartFrom}) ->
+ case StartFrom of
+ src_code ->
+ compile_src(File, IncludeD, Defines, Callgraph, Codeserver, UseContracts);
+ byte_code ->
+ compile_byte(File, Callgraph, Codeserver, UseContracts)
+ end.
cleanup_callgraph(#analysis_state{plt = InitPlt, parent = Parent,
codeserver = CodeServer
@@ -269,23 +326,16 @@ cleanup_callgraph(#analysis_state{plt = InitPlt, parent = Parent,
ModuleDeps = dialyzer_callgraph:module_deps(Callgraph),
send_mod_deps(Parent, ModuleDeps),
{Callgraph1, ExtCalls} = dialyzer_callgraph:remove_external(Callgraph),
- RelevantAPICalls =
- dialyzer_behaviours:get_behaviour_apis([gen_server]),
- BehaviourAPICalls = [Call || {_From, To} = Call <- ExtCalls,
- lists:member(To, RelevantAPICalls)],
- Callgraph2 =
- dialyzer_callgraph:put_behaviour_api_calls(BehaviourAPICalls,
- Callgraph1),
ExtCalls1 = [Call || Call = {_From, To} <- ExtCalls,
not dialyzer_plt:contains_mfa(InitPlt, To)],
{BadCalls1, RealExtCalls} =
if ExtCalls1 =:= [] -> {[], []};
true ->
ModuleSet = sets:from_list(Modules),
- lists:partition(fun({_From, {M, _F, _A}}) ->
- sets:is_element(M, ModuleSet) orelse
- dialyzer_plt:contains_module(InitPlt, M)
- end, ExtCalls1)
+ PltModuleSet = dialyzer_plt:all_modules(InitPlt),
+ AllModules = sets:union(ModuleSet, PltModuleSet),
+ Pred = fun({_From, {M, _F, _A}}) -> sets:is_element(M, AllModules) end,
+ lists:partition(Pred, ExtCalls1)
end,
NonLocalCalls = dialyzer_callgraph:non_local_calls(Callgraph1),
BadCalls2 = [Call || Call = {_From, To} <- NonLocalCalls,
@@ -298,7 +348,7 @@ cleanup_callgraph(#analysis_state{plt = InitPlt, parent = Parent,
true ->
send_ext_calls(Parent, lists:usort([To || {_From, To} <- RealExtCalls]))
end,
- Callgraph2.
+ Callgraph1.
compile_src(File, Includes, Defines, Callgraph, CServer, UseContracts) ->
DefaultIncludes = default_includes(filename:dirname(File)),
@@ -349,14 +399,18 @@ compile_common(File, AbstrCode, CompOpts, Callgraph, CServer, UseContracts) ->
store_core(Mod, Core, NoWarn, Callgraph, CServer) ->
Exp = get_exports_from_core(Core),
- OldExpTypes = dialyzer_codeserver:get_temp_exported_types(CServer),
- NewExpTypes = get_exported_types_from_core(Core),
- MergedExpTypes = sets:union(NewExpTypes, OldExpTypes),
- CServer1 = dialyzer_codeserver:insert_exports(Exp, CServer),
- CServer2 = dialyzer_codeserver:insert_temp_exported_types(MergedExpTypes,
- CServer1),
- {LabeledCore, CServer3} = label_core(Core, CServer2),
- store_code_and_build_callgraph(Mod, LabeledCore, Callgraph, CServer3, NoWarn).
+ ExpTypes = get_exported_types_from_core(Core),
+ CServer = dialyzer_codeserver:insert_exports(Exp, CServer),
+ CServer = dialyzer_codeserver:insert_temp_exported_types(ExpTypes, CServer),
+ CoreTree = cerl:from_records(Core),
+ {ok, cerl_trees:size(CoreTree), {Mod, CoreTree, NoWarn, Callgraph, CServer}}.
+
+-spec continue_compilation(integer(), compile_mid_data()) -> one_file_result().
+
+continue_compilation(NextLabel, {Mod, CoreTree, NoWarn, Callgraph, CServer}) ->
+ {LabeledTree, _NewNextLabel} = cerl_trees:label(CoreTree, NextLabel),
+ LabeledCore = cerl:to_records(LabeledTree),
+ store_code_and_build_callgraph(Mod, LabeledCore, Callgraph, NoWarn, CServer).
abs_get_nowarn(Abs, M) ->
Opts = lists:flatten([C || {attribute, _, compile, C} <- Abs]),
@@ -366,9 +420,11 @@ abs_get_nowarn(Abs, M) ->
false ->
[{M, F, A} || {function, _, F, A, _} <- Abs]; % all functions
true ->
- [{M, F, A} ||
- {nowarn_unused_function, FAs} <- Opts,
- {F, A} <- lists:flatten([FAs])]
+ OnLoad =
+ lists:flatten([{M, F, A} || {attribute, _, on_load, {F, A}} <- Abs]),
+ OnLoad ++ [{M, F, A} ||
+ {nowarn_unused_function, FAs} <- Opts,
+ {F, A} <- lists:flatten([FAs])]
end.
get_exported_types_from_core(Core) ->
@@ -387,18 +443,11 @@ get_exports_from_core(Core) ->
M = cerl:atom_val(cerl:module_name(Tree)),
[{M, F, A} || {F, A} <- Exports2].
-label_core(Core, CServer) ->
- NextLabel = dialyzer_codeserver:get_next_core_label(CServer),
+store_code_and_build_callgraph(Mod, Core, Callgraph, NoWarn, CServer) ->
CoreTree = cerl:from_records(Core),
- {LabeledTree, NewNextLabel} = cerl_trees:label(CoreTree, NextLabel),
- {cerl:to_records(LabeledTree),
- dialyzer_codeserver:set_next_core_label(NewNextLabel, CServer)}.
-
-store_code_and_build_callgraph(Mod, Core, Callgraph, CServer, NoWarn) ->
- CoreTree = cerl:from_records(Core),
- NewCallgraph = dialyzer_callgraph:scan_core_tree(CoreTree, Callgraph),
- CServer2 = dialyzer_codeserver:insert(Mod, CoreTree, CServer),
- {ok, NewCallgraph, NoWarn, CServer2, Mod}.
+ {Vertices, Edges} = dialyzer_callgraph:scan_core_tree(CoreTree, Callgraph),
+ CServer = dialyzer_codeserver:insert(Mod, CoreTree, CServer),
+ {ok, Vertices, Edges, NoWarn, Mod}.
%%--------------------------------------------------------------------
%% Utilities
@@ -462,9 +511,12 @@ default_includes(Dir) ->
rcv_and_send_ext_types(Parent) ->
Self = self(),
Self ! {Self, done},
- ExtTypes = rcv_ext_types(Self, []),
- Parent ! {Self, ext_types, ExtTypes},
- ok.
+ case rcv_ext_types(Self, []) of
+ [] -> ok;
+ ExtTypes ->
+ Parent ! {Self, ext_types, ExtTypes},
+ ok
+ end.
rcv_ext_types(Self, ExtTypes) ->
receive
diff --git a/lib/dialyzer/src/dialyzer_behaviours.erl b/lib/dialyzer/src/dialyzer_behaviours.erl
index e89c08df7d..36aef2a37f 100644
--- a/lib/dialyzer/src/dialyzer_behaviours.erl
+++ b/lib/dialyzer/src/dialyzer_behaviours.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -30,11 +30,9 @@
-module(dialyzer_behaviours).
--export([check_callbacks/4, get_behaviour_apis/1,
- translate_behaviour_api_call/5, translatable_behaviours/1,
- translate_callgraph/3]).
+-export([check_callbacks/5]).
--export_type([behaviour/0, behaviour_api_dict/0]).
+-export_type([behaviour/0]).
%%--------------------------------------------------------------------
@@ -47,15 +45,16 @@
-record(state, {plt :: dialyzer_plt:plt(),
codeserver :: dialyzer_codeserver:codeserver(),
filename :: file:filename(),
- behlines :: [{behaviour(), non_neg_integer()}]}).
+ behlines :: [{behaviour(), non_neg_integer()}],
+ records :: dict()}).
%%--------------------------------------------------------------------
--spec check_callbacks(module(), [{cerl:cerl(), cerl:cerl()}],
+-spec check_callbacks(module(), [{cerl:cerl(), cerl:cerl()}], dict(),
dialyzer_plt:plt(),
dialyzer_codeserver:codeserver()) -> [dial_warning()].
-check_callbacks(Module, Attrs, Plt, Codeserver) ->
+check_callbacks(Module, Attrs, Records, Plt, Codeserver) ->
{Behaviours, BehLines} = get_behaviours(Attrs),
case Behaviours of
[] -> [];
@@ -64,7 +63,7 @@ check_callbacks(Module, Attrs, Plt, Codeserver) ->
{_Var,Code} = dialyzer_codeserver:lookup_mfa_code(MFA, Codeserver),
File = get_file(cerl:get_ann(Code)),
State = #state{plt = Plt, filename = File, behlines = BehLines,
- codeserver = Codeserver},
+ codeserver = Codeserver, records = Records},
Warnings = get_warnings(Module, Behaviours, State),
[add_tag_file_line(Module, W, State) || W <- Warnings]
end.
@@ -72,9 +71,11 @@ check_callbacks(Module, Attrs, Plt, Codeserver) ->
%%--------------------------------------------------------------------
get_behaviours(Attrs) ->
- BehaviourListsAndLine = [{cerl:concrete(L2), hd(cerl:get_ann(L2))} ||
- {L1, L2} <- Attrs, cerl:is_literal(L1),
- cerl:is_literal(L2), cerl:concrete(L1) =:= 'behaviour'],
+ BehaviourListsAndLine =
+ [{cerl:concrete(L2), hd(cerl:get_ann(L2))} ||
+ {L1, L2} <- Attrs, cerl:is_literal(L1),
+ cerl:is_literal(L2), cerl:concrete(L1) =:= 'behaviour' orelse
+ cerl:concrete(L1) =:= 'behavior'],
Behaviours = lists:append([Behs || {Behs,_} <- BehaviourListsAndLine]),
BehLines = [{B,L} || {L1,L} <- BehaviourListsAndLine, B <- L1],
{Behaviours, BehLines}.
@@ -90,24 +91,21 @@ get_warnings(Module, [Behaviour|Rest], State, Acc) ->
check_behaviour(Module, Behaviour, #state{plt = Plt} = State, Acc) ->
case dialyzer_plt:lookup_callbacks(Plt, Behaviour) of
- [] -> [{callback_info_missing, [Behaviour]}|Acc];
- Callbacks -> check_all_callbacks(Module, Behaviour, Callbacks, State, Acc)
+ none -> [{callback_info_missing, [Behaviour]}|Acc];
+ {value, Callbacks} ->
+ check_all_callbacks(Module, Behaviour, Callbacks, State, Acc)
end.
check_all_callbacks(_Module, _Behaviour, [], _State, Acc) ->
Acc;
check_all_callbacks(Module, Behaviour, [Cb|Rest],
- #state{plt = Plt, codeserver = Codeserver} = State, Acc) ->
+ #state{plt = Plt, codeserver = Codeserver,
+ records = Records} = State, Acc) ->
{{Behaviour, Function, Arity},
{{_BehFile, _BehLine}, Callback}} = Cb,
CbMFA = {Module, Function, Arity},
CbReturnType = dialyzer_contracts:get_contract_return(Callback),
CbArgTypes = dialyzer_contracts:get_contract_args(Callback),
- Records =
- case dict:find(Module, dialyzer_codeserver:get_records(Codeserver)) of
- {ok, V} -> V;
- error -> dict:new()
- end,
Acc0 = Acc,
Acc1 =
case dialyzer_plt:lookup(Plt, CbMFA) of
@@ -224,103 +222,3 @@ get_line([]) -> -1.
get_file([{file, File}|_]) -> File;
get_file([_|Tail]) -> get_file(Tail).
-
-%%-----------------------------------------------------------------------------
-
--spec translatable_behaviours(cerl:c_module()) -> behaviour_api_dict().
-
-translatable_behaviours(Tree) ->
- Attrs = cerl:module_attrs(Tree),
- {Behaviours, _BehLines} = get_behaviours(Attrs),
- [{B, Calls} || B <- Behaviours, (Calls = behaviour_api_calls(B)) =/= []].
-
--spec get_behaviour_apis([behaviour()]) -> [mfa()].
-
-get_behaviour_apis(Behaviours) ->
- get_behaviour_apis(Behaviours, []).
-
--spec translate_behaviour_api_call(dialyzer_races:mfa_or_funlbl(),
- [erl_types:erl_type()],
- [dialyzer_races:core_vars()],
- module(),
- behaviour_api_dict()) ->
- {dialyzer_races:mfa_or_funlbl(),
- [erl_types:erl_type()],
- [dialyzer_races:core_vars()]}
- | 'plain_call'.
-
-translate_behaviour_api_call(_Fun, _ArgTypes, _Args, _Module, []) ->
- plain_call;
-translate_behaviour_api_call({Module, Fun, Arity}, ArgTypes, Args,
- CallbackModule, BehApiInfo) ->
- case lists:keyfind(Module, 1, BehApiInfo) of
- false -> plain_call;
- {Module, Calls} ->
- case lists:keyfind({Fun, Arity}, 1, Calls) of
- false -> plain_call;
- {{Fun, Arity}, {CFun, CArity, COrder}} ->
- {{CallbackModule, CFun, CArity},
- [nth_or_0(N, ArgTypes, erl_types:t_any()) || N <-COrder],
- [nth_or_0(N, Args, bypassed) || N <-COrder]}
- end
- end;
-translate_behaviour_api_call(_Fun, _ArgTypes, _Args, _Module, _BehApiInfo) ->
- plain_call.
-
--spec translate_callgraph(behaviour_api_dict(), atom(),
- dialyzer_callgraph:callgraph()) ->
- dialyzer_callgraph:callgraph().
-
-translate_callgraph([{Behaviour,_}|Behaviours], Module, Callgraph) ->
- UsedCalls = [Call || {_From, {M, _F, _A}} = Call <-
- dialyzer_callgraph:get_behaviour_api_calls(Callgraph),
- M =:= Behaviour],
- Calls = [{{Behaviour, API, Arity}, Callback} ||
- {{API, Arity}, Callback} <- behaviour_api_calls(Behaviour)],
- DirectCalls = [{From, {Module, Fun, Arity}} ||
- {From, To} <- UsedCalls,{API, {Fun, Arity, _Ord}} <- Calls,
- To =:= API],
- NewCallgraph = dialyzer_callgraph:add_edges(DirectCalls, Callgraph),
- translate_callgraph(Behaviours, Module, NewCallgraph);
-translate_callgraph([], _Module, Callgraph) ->
- Callgraph.
-
-get_behaviour_apis([], Acc) ->
- Acc;
-get_behaviour_apis([Behaviour | Rest], Acc) ->
- MFAs = [{Behaviour, Fun, Arity} ||
- {{Fun, Arity}, _} <- behaviour_api_calls(Behaviour)],
- get_behaviour_apis(Rest, MFAs ++ Acc).
-
-%------------------------------------------------------------------------------
-
-nth_or_0(0, _List, Zero) ->
- Zero;
-nth_or_0(N, List, _Zero) ->
- lists:nth(N, List).
-
-%------------------------------------------------------------------------------
-
--type behaviour_api_dict()::[{behaviour(), behaviour_api_info()}].
--type behaviour_api_info()::[{original_fun(), replacement_fun()}].
--type original_fun()::{atom(), arity()}.
--type replacement_fun()::{atom(), arity(), arg_list()}.
--type arg_list()::[byte()].
-
--spec behaviour_api_calls(behaviour()) -> behaviour_api_info().
-
-behaviour_api_calls(gen_server) ->
- [{{start_link, 3}, {init, 1, [2]}},
- {{start_link, 4}, {init, 1, [3]}},
- {{start, 3}, {init, 1, [2]}},
- {{start, 4}, {init, 1, [3]}},
- {{call, 2}, {handle_call, 3, [2, 0, 0]}},
- {{call, 3}, {handle_call, 3, [2, 0, 0]}},
- {{multi_call, 2}, {handle_call, 3, [2, 0, 0]}},
- {{multi_call, 3}, {handle_call, 3, [3, 0, 0]}},
- {{multi_call, 4}, {handle_call, 3, [3, 0, 0]}},
- {{cast, 2}, {handle_cast, 2, [2, 0]}},
- {{abcast, 2}, {handle_cast, 2, [2, 0]}},
- {{abcast, 3}, {handle_cast, 2, [3, 0]}}];
-behaviour_api_calls(_Other) ->
- [].
diff --git a/lib/dialyzer/src/dialyzer_callgraph.erl b/lib/dialyzer/src/dialyzer_callgraph.erl
index d3de5aaf45..64e0ee88af 100644
--- a/lib/dialyzer/src/dialyzer_callgraph.erl
+++ b/lib/dialyzer/src/dialyzer_callgraph.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -28,6 +28,7 @@
-module(dialyzer_callgraph).
-export([add_edges/2,
+ add_edges/3,
all_nodes/1,
delete/1,
finalize/1,
@@ -43,12 +44,15 @@
%% module_postorder/1,
module_postorder_from_funs/2,
new/0,
+ get_depends_on/2,
+ get_required_by/2,
in_neighbours/2,
renew_race_info/4,
+ renew_race_code/2,
+ renew_race_public_tables/2,
reset_from_funs/2,
scan_core_tree/2,
strip_module_deps/2,
- take_scc/1,
remove_external/1,
to_dot/2,
to_ps/3]).
@@ -57,15 +61,14 @@
get_race_code/1, get_race_detection/1, race_code_new/1,
put_digraph/2, put_race_code/2, put_race_detection/2,
put_named_tables/2, put_public_tables/2, put_behaviour_api_calls/2,
- get_behaviour_api_calls/1]).
+ get_behaviour_api_calls/1, dispose_race_server/1, duplicate/1]).
--export_type([callgraph/0]).
+-export_type([callgraph/0, mfa_or_funlbl/0, callgraph_edge/0]).
-include("dialyzer.hrl").
%%----------------------------------------------------------------------
--type mfa_or_funlbl() :: label() | mfa().
-type scc() :: [mfa_or_funlbl()].
-type mfa_calls() :: [{mfa_or_funlbl(), mfa_or_funlbl()}].
@@ -78,9 +81,6 @@
%% digraph - A digraph representing the callgraph.
%% Nodes are represented as MFAs or labels.
%% esc - A set of all escaping functions as reported by dialyzer_dep.
-%% postorder - A list of strongly connected components of the callgraph
-%% sorted in a topological bottom-up order.
-%% This is produced by calling finalize/1.
%% name_map - A mapping from label to MFA.
%% rev_name_map - A reverse mapping of the name_map.
%% rec_var_map - A dict mapping from letrec bound labels to function names.
@@ -91,29 +91,42 @@
%%-----------------------------------------------------------------------------
-record(callgraph, {digraph = digraph:new() :: digraph(),
- esc = sets:new() :: set(),
- name_map = dict:new() :: dict(),
- rev_name_map = dict:new() :: dict(),
- postorder = [] :: [scc()],
- rec_var_map = dict:new() :: dict(),
- self_rec = sets:new() :: set(),
- calls = dict:new() :: dict(),
- race_code = dict:new() :: dict(),
- public_tables = [] :: [label()],
- named_tables = [] :: [string()],
+ active_digraph :: active_digraph(),
+ esc :: ets:tid(),
+ name_map :: ets:tid(),
+ rev_name_map :: ets:tid(),
+ rec_var_map :: ets:tid(),
+ self_rec :: ets:tid(),
+ calls :: ets:tid(),
race_detection = false :: boolean(),
- beh_api_calls = [] :: [{mfa(), mfa()}]}).
+ race_data_server = new_race_data_server() :: pid()}).
+
+-record(race_data_state, {race_code = dict:new() :: dict(),
+ public_tables = [] :: [label()],
+ named_tables = [] :: [string()],
+ beh_api_calls = [] :: [{mfa(), mfa()}]}).
%% Exported Types
-type callgraph() :: #callgraph{}.
+-type active_digraph() :: {'d', digraph()} | {'e', ets:tid(), ets:tid()}.
+
%%----------------------------------------------------------------------
-spec new() -> callgraph().
new() ->
- #callgraph{}.
+ [ETSEsc, ETSNameMap, ETSRevNameMap, ETSRecVarMap, ETSSelfRec, ETSCalls] =
+ [ets:new(N,[public, {read_concurrency, true}]) ||
+ N <- [callgraph_esc, callgraph_name_map, callgraph_rev_name_map,
+ callgraph_rec_var_map, callgraph_self_rec, callgraph_calls]],
+ #callgraph{esc = ETSEsc,
+ name_map = ETSNameMap,
+ rev_name_map = ETSRevNameMap,
+ rec_var_map = ETSRecVarMap,
+ self_rec = ETSSelfRec,
+ calls = ETSCalls}.
-spec delete(callgraph()) -> 'true'.
@@ -129,32 +142,32 @@ all_nodes(#callgraph{digraph = DG}) ->
lookup_rec_var(Label, #callgraph{rec_var_map = RecVarMap})
when is_integer(Label) ->
- dict:find(Label, RecVarMap).
+ ets_lookup_dict(Label, RecVarMap).
-spec lookup_call_site(label(), callgraph()) -> 'error' | {'ok', [_]}. % XXX: refine
lookup_call_site(Label, #callgraph{calls = Calls})
when is_integer(Label) ->
- dict:find(Label, Calls).
+ ets_lookup_dict(Label, Calls).
-spec lookup_name(label(), callgraph()) -> 'error' | {'ok', mfa()}.
lookup_name(Label, #callgraph{name_map = NameMap})
when is_integer(Label) ->
- dict:find(Label, NameMap).
+ ets_lookup_dict(Label, NameMap).
-spec lookup_label(mfa_or_funlbl(), callgraph()) -> 'error' | {'ok', integer()}.
lookup_label({_,_,_} = MFA, #callgraph{rev_name_map = RevNameMap}) ->
- dict:find(MFA, RevNameMap);
+ ets_lookup_dict(MFA, RevNameMap);
lookup_label(Label, #callgraph{}) when is_integer(Label) ->
{ok, Label}.
-spec in_neighbours(mfa_or_funlbl(), callgraph()) -> 'none' | [mfa_or_funlbl(),...].
-in_neighbours(Label, #callgraph{digraph = Digraph, name_map = NameMap})
+in_neighbours(Label, #callgraph{digraph = Digraph} = CG)
when is_integer(Label) ->
- Name = case dict:find(Label, NameMap) of
+ Name = case lookup_name(Label, CG) of
{ok, Val} -> Val;
error -> Label
end,
@@ -165,39 +178,32 @@ in_neighbours({_, _, _} = MFA, #callgraph{digraph = Digraph}) ->
-spec is_self_rec(mfa_or_funlbl(), callgraph()) -> boolean().
is_self_rec(MfaOrLabel, #callgraph{self_rec = SelfRecs}) ->
- sets:is_element(MfaOrLabel, SelfRecs).
+ ets_lookup_set(MfaOrLabel, SelfRecs).
-spec is_escaping(label(), callgraph()) -> boolean().
is_escaping(Label, #callgraph{esc = Esc}) when is_integer(Label) ->
- sets:is_element(Label, Esc).
+ ets_lookup_set(Label, Esc).
-type callgraph_edge() :: {mfa_or_funlbl(),mfa_or_funlbl()}.
--spec add_edges([callgraph_edge()], callgraph()) -> callgraph().
+-spec add_edges([callgraph_edge()], callgraph()) -> ok.
-add_edges([], CG) ->
- CG;
-add_edges(Edges, #callgraph{digraph = Callgraph} = CG) ->
- CG#callgraph{digraph = digraph_add_edges(Edges, Callgraph)}.
+add_edges([], _CG) ->
+ ok;
+add_edges(Edges, #callgraph{digraph = Digraph}) ->
+ digraph_add_edges(Edges, Digraph).
--spec add_edges([callgraph_edge()], [mfa_or_funlbl()], callgraph()) -> callgraph().
+-spec add_edges([callgraph_edge()], [mfa_or_funlbl()], callgraph()) -> ok.
add_edges(Edges, MFAs, #callgraph{digraph = DG} = CG) ->
- DG1 = digraph_confirm_vertices(MFAs, DG),
- add_edges(Edges, CG#callgraph{digraph = DG1}).
-
--spec take_scc(callgraph()) -> 'none' | {'ok', scc(), callgraph()}.
-
-take_scc(#callgraph{postorder = [SCC|SCCs]} = CG) ->
- {ok, SCC, CG#callgraph{postorder = SCCs}};
-take_scc(#callgraph{postorder = []}) ->
- none.
+ digraph_confirm_vertices(MFAs, DG),
+ add_edges(Edges, CG).
-spec remove_external(callgraph()) -> {callgraph(), [tuple()]}.
remove_external(#callgraph{digraph = DG} = CG) ->
- {NewDG, External} = digraph_remove_external(DG),
- {CG#callgraph{digraph = NewDG}, External}.
+ {DG, External} = digraph_remove_external(DG),
+ {CG, External}.
-spec non_local_calls(callgraph()) -> mfa_calls().
@@ -221,13 +227,25 @@ find_non_local_calls([{Label1, Label2}|Left], Set) when is_integer(Label1),
find_non_local_calls([], Set) ->
sets:to_list(Set).
--spec renew_race_info(callgraph(), dict(), [label()], [string()]) ->
- callgraph().
+-spec get_depends_on(scc() | module(), callgraph()) -> [scc()].
+
+get_depends_on(SCC, #callgraph{active_digraph = {'e', Out, _In}}) ->
+ case ets_lookup_dict(SCC, Out) of
+ {ok, Value} -> Value;
+ error -> []
+ end;
+get_depends_on(SCC, #callgraph{active_digraph = {'d', DG}}) ->
+ digraph:out_neighbours(DG, SCC).
+
+-spec get_required_by(scc() | module(), callgraph()) -> [scc()].
-renew_race_info(CG, RaceCode, PublicTables, NamedTables) ->
- CG#callgraph{race_code = RaceCode,
- public_tables = PublicTables,
- named_tables = NamedTables}.
+get_required_by(SCC, #callgraph{active_digraph = {'e', _Out, In}}) ->
+ case ets_lookup_dict(SCC, In) of
+ {ok, Value} -> Value;
+ error -> []
+ end;
+get_required_by(SCC, #callgraph{active_digraph = {'d', DG}}) ->
+ digraph:in_neighbours(DG, SCC).
%%----------------------------------------------------------------------
%% Handling of modules & SCCs
@@ -238,33 +256,38 @@ renew_race_info(CG, RaceCode, PublicTables, NamedTables) ->
modules(#callgraph{digraph = DG}) ->
ordsets:from_list([M || {M,_F,_A} <- digraph_vertices(DG)]).
--spec module_postorder(callgraph()) -> [[module()]].
+-spec module_postorder(callgraph()) -> {[module()], {'d', digraph()}}.
module_postorder(#callgraph{digraph = DG}) ->
- Edges = digraph_edges(DG),
- Nodes = ordsets:from_list([M || {M,_F,_A} <- digraph_vertices(DG)]),
- MDG = digraph:new(),
- MDG1 = digraph_confirm_vertices(Nodes, MDG),
- MDG2 = create_module_digraph(Edges, MDG1),
- MDG3 = digraph_utils:condensation(MDG2),
- PostOrder = digraph_utils:postorder(MDG3),
- PostOrder1 = sort_sccs_internally(PostOrder, MDG2),
- digraph:delete(MDG2),
- digraph_delete(MDG3),
- PostOrder1.
+ Edges = lists:foldl(fun edge_fold/2, sets:new(), digraph_edges(DG)),
+ Nodes = sets:from_list([M || {M,_F,_A} <- digraph_vertices(DG)]),
+ MDG = digraph:new([acyclic]),
+ digraph_confirm_vertices(sets:to_list(Nodes), MDG),
+ Foreach = fun({M1,M2}) -> digraph:add_edge(MDG, M1, M2) end,
+ lists:foreach(Foreach, sets:to_list(Edges)),
+ {digraph_utils:topsort(MDG), {'d', MDG}}.
+
+edge_fold({{M1,_,_},{M2,_,_}}, Set) ->
+ case M1 =/= M2 of
+ true -> sets:add_element({M1,M2},Set);
+ false -> Set
+ end;
+edge_fold(_, Set) -> Set.
+
%% The module deps of a module are modules that depend on the module
-spec module_deps(callgraph()) -> dict().
module_deps(#callgraph{digraph = DG}) ->
- Edges = digraph_edges(DG),
- Nodes = ordsets:from_list([M || {M,_F,_A} <- digraph_vertices(DG)]),
+ Edges = lists:foldl(fun edge_fold/2, sets:new(), digraph_edges(DG)),
+ Nodes = sets:from_list([M || {M,_F,_A} <- digraph_vertices(DG)]),
MDG = digraph:new(),
- MDG1 = digraph_confirm_vertices(Nodes, MDG),
- MDG2 = create_module_digraph(Edges, MDG1),
- Deps = [{N, ordsets:from_list(digraph:in_neighbours(MDG2, N))}
- || N <- Nodes],
- digraph_delete(MDG2),
+ digraph_confirm_vertices(sets:to_list(Nodes), MDG),
+ Foreach = fun({M1,M2}) -> digraph:add_edge(MDG, M1, M2) end,
+ lists:foreach(Foreach, sets:to_list(Edges)),
+ Deps = [{N, ordsets:from_list(digraph:in_neighbours(MDG, N))}
+ || N <- sets:to_list(Nodes)],
+ digraph_delete(MDG),
dict:from_list(Deps).
-spec strip_module_deps(dict(), set()) -> dict().
@@ -276,52 +299,42 @@ strip_module_deps(ModDeps, StripSet) ->
FilterFun2 = fun(_Key, ValSet) -> ValSet =/= [] end,
dict:filter(FilterFun2, ModDeps1).
-sort_sccs_internally(PO, MDG) ->
- sort_sccs_internally(PO, MDG, []).
-
-sort_sccs_internally([SCC|SCCs], MDG, Acc) ->
- case SCC of
- [_, _, _ | _] -> % length(SCC) >= 3
- TmpDG = digraph_utils:subgraph(MDG, SCC),
- NewSCC = digraph_utils:postorder(TmpDG),
- digraph_delete(TmpDG),
- sort_sccs_internally(SCCs, MDG, [NewSCC|Acc]);
- _ ->
- sort_sccs_internally(SCCs, MDG, [SCC|Acc])
- end;
-sort_sccs_internally([], _MDG, Acc) ->
- lists:reverse(Acc).
-
-create_module_digraph([{{M, _, _}, {M, _, _}}|Left], MDG) ->
- create_module_digraph(Left, MDG);
-create_module_digraph([{{M1, _, _}, {M2, _, _}}|Left], MDG) ->
- create_module_digraph(Left, digraph_add_edge(M1, M2, MDG));
-create_module_digraph([{_, _}|Left], MDG) ->
- create_module_digraph(Left, MDG);
-create_module_digraph([], MDG) ->
- MDG.
-
--spec finalize(callgraph()) -> callgraph().
+-spec finalize(callgraph()) -> {[scc()], callgraph()}.
finalize(#callgraph{digraph = DG} = CG) ->
- CG#callgraph{postorder = digraph_finalize(DG)}.
+ {ActiveDG, Postorder} = condensation(DG),
+ {Postorder, CG#callgraph{active_digraph = ActiveDG}}.
--spec reset_from_funs([mfa_or_funlbl()], callgraph()) -> callgraph().
+-spec reset_from_funs([mfa_or_funlbl()], callgraph()) -> {[scc()], callgraph()}.
-reset_from_funs(Funs, #callgraph{digraph = DG} = CG) ->
+reset_from_funs(Funs, #callgraph{digraph = DG, active_digraph = ADG} = CG) ->
+ active_digraph_delete(ADG),
SubGraph = digraph_reaching_subgraph(Funs, DG),
- Postorder = digraph_finalize(SubGraph),
+ {NewActiveDG, Postorder} = condensation(SubGraph),
digraph_delete(SubGraph),
- CG#callgraph{postorder = Postorder}.
+ {Postorder, CG#callgraph{active_digraph = NewActiveDG}}.
--spec module_postorder_from_funs([mfa_or_funlbl()], callgraph()) -> [[module()]].
+-spec module_postorder_from_funs([mfa_or_funlbl()], callgraph()) ->
+ {[module()], callgraph()}.
-module_postorder_from_funs(Funs, #callgraph{digraph = DG} = CG) ->
+module_postorder_from_funs(Funs, #callgraph{digraph = DG,
+ active_digraph = ADG} = CG) ->
+ active_digraph_delete(ADG),
SubGraph = digraph_reaching_subgraph(Funs, DG),
- PO = module_postorder(CG#callgraph{digraph = SubGraph}),
+ {PO, Active} = module_postorder(CG#callgraph{digraph = SubGraph}),
digraph_delete(SubGraph),
- PO.
-
+ {PO, CG#callgraph{active_digraph = Active}}.
+
+ets_lookup_dict(Key, Table) ->
+ try ets:lookup_element(Table, Key, 2) of
+ Val -> {ok, Val}
+ catch
+ _:_ -> error
+ end.
+
+ets_lookup_set(Key, Table) ->
+ ets:lookup(Table, Key) =/= [].
+
%%----------------------------------------------------------------------
%% Core code
%%----------------------------------------------------------------------
@@ -330,36 +343,37 @@ module_postorder_from_funs(Funs, #callgraph{digraph = DG} = CG) ->
%% The set of labels in the tree must be disjoint from the set of
%% labels already occuring in the callgraph.
--spec scan_core_tree(cerl:c_module(), callgraph()) -> callgraph().
+-spec scan_core_tree(cerl:c_module(), callgraph()) ->
+ {[mfa_or_funlbl()], [callgraph_edge()]}.
-scan_core_tree(Tree, #callgraph{calls = OldCalls,
- esc = OldEsc,
- name_map = OldNameMap,
- rec_var_map = OldRecVarMap,
- rev_name_map = OldRevNameMap,
- self_rec = OldSelfRec} = CG) ->
+scan_core_tree(Tree, #callgraph{calls = ETSCalls,
+ esc = ETSEsc,
+ name_map = ETSNameMap,
+ rec_var_map = ETSRecVarMap,
+ rev_name_map = ETSRevNameMap,
+ self_rec = ETSSelfRec}) ->
%% Build name map and recursion variable maps.
- {NewNameMap, NewRevNameMap, NewRecVarMap} =
- build_maps(Tree, OldRecVarMap, OldNameMap, OldRevNameMap),
-
+ build_maps(Tree, ETSRecVarMap, ETSNameMap, ETSRevNameMap),
+
%% First find the module-local dependencies.
{Deps0, EscapingFuns, Calls} = dialyzer_dep:analyze(Tree),
- NewCalls = dict:merge(fun(_Key, Val, Val) -> Val end, OldCalls, Calls),
- NewEsc = sets:union(sets:from_list(EscapingFuns), OldEsc),
+ true = ets:insert(ETSCalls, dict:to_list(Calls)),
+ true = ets:insert(ETSEsc, [{E} || E <- EscapingFuns]),
+
LabelEdges = get_edges_from_deps(Deps0),
%% Find the self recursive functions. Named functions get both the
%% key and their name for convenience.
SelfRecs0 = lists:foldl(fun({Key, Key}, Acc) ->
- case dict:find(Key, NewNameMap) of
+ case ets_lookup_dict(Key, ETSNameMap) of
error -> [Key|Acc];
{ok, Name} -> [Key, Name|Acc]
end;
(_, Acc) -> Acc
end, [], LabelEdges),
- SelfRecs = sets:union(sets:from_list(SelfRecs0), OldSelfRec),
+ true = ets:insert(ETSSelfRec, [{S} || S <- SelfRecs0]),
- NamedEdges1 = name_edges(LabelEdges, NewNameMap),
+ NamedEdges1 = name_edges(LabelEdges, ETSNameMap),
%% We need to scan for inter-module calls since these are not tracked
%% by dialyzer_dep. Note that the caller is always recorded as the
@@ -378,27 +392,25 @@ scan_core_tree(Tree, #callgraph{calls = OldCalls,
NewNamedEdges1 =
[E || {From, To} = E <- NamedEdges1, From =/= top, To =/= top],
NamedEdges3 = NewNamedEdges1 ++ NewNamedEdges2,
- CG1 = add_edges(NamedEdges3, Names3, CG),
- CG1#callgraph{calls = NewCalls,
- esc = NewEsc,
- name_map = NewNameMap,
- rec_var_map = NewRecVarMap,
- rev_name_map = NewRevNameMap,
- self_rec = SelfRecs}.
-
-build_maps(Tree, RecVarMap, NameMap, RevNameMap) ->
+ {Names3, NamedEdges3}.
+
+build_maps(Tree, ETSRecVarMap, ETSNameMap, ETSRevNameMap) ->
%% We only care about the named (top level) functions. The anonymous
%% functions will be analysed together with their parents.
Defs = cerl:module_defs(Tree),
Mod = cerl:atom_val(cerl:module_name(Tree)),
- lists:foldl(fun({Var, Function}, {AccNameMap, AccRevNameMap, AccRecVarMap}) ->
- FunName = cerl:fname_id(Var),
- Arity = cerl:fname_arity(Var),
- MFA = {Mod, FunName, Arity},
- {dict:store(get_label(Function), MFA, AccNameMap),
- dict:store(MFA, get_label(Function), AccRevNameMap),
- dict:store(get_label(Var), MFA, AccRecVarMap)}
- end, {NameMap, RevNameMap, RecVarMap}, Defs).
+ Fun =
+ fun({Var, Function}) ->
+ FunName = cerl:fname_id(Var),
+ Arity = cerl:fname_arity(Var),
+ MFA = {Mod, FunName, Arity},
+ FunLabel = get_label(Function),
+ VarLabel = get_label(Var),
+ true = ets:insert(ETSNameMap, {FunLabel, MFA}),
+ true = ets:insert(ETSRevNameMap, {MFA, FunLabel}),
+ true = ets:insert(ETSRecVarMap, {VarLabel, MFA})
+ end,
+ lists:foreach(Fun, Defs).
get_edges_from_deps(Deps) ->
%% Convert the dependencies as produced by dialyzer_dep to a list of
@@ -411,22 +423,22 @@ get_edges_from_deps(Deps) ->
end, [], Deps),
lists:flatten(Edges).
-name_edges(Edges, NameMap) ->
+name_edges(Edges, ETSNameMap) ->
%% If a label is present in the name map it is renamed. Otherwise
%% keep the label as the identity.
MapFun = fun(X) ->
- case dict:find(X, NameMap) of
+ case ets_lookup_dict(X, ETSNameMap) of
error -> X;
{ok, MFA} -> MFA
end
end,
- name_edges(Edges, MapFun, NameMap, []).
+ name_edges(Edges, MapFun, []).
-name_edges([{From, To}|Left], MapFun, NameMap, Acc) ->
+name_edges([{From, To}|Left], MapFun, Acc) ->
NewFrom = MapFun(From),
NewTo = MapFun(To),
- name_edges(Left, MapFun, NameMap, [{NewFrom, NewTo}|Acc]);
-name_edges([], _MapFun, _NameMap, Acc) ->
+ name_edges(Left, MapFun, [{NewFrom, NewTo}|Acc]);
+name_edges([], _MapFun, Acc) ->
Acc.
scan_core_funs(Tree) ->
@@ -478,9 +490,10 @@ get_label(T) ->
%%----------------------------------------------------------------------
digraph_add_edges([{From, To}|Left], DG) ->
- digraph_add_edges(Left, digraph_add_edge(From, To, DG));
-digraph_add_edges([], DG) ->
- DG.
+ digraph_add_edge(From, To, DG),
+ digraph_add_edges(Left, DG);
+digraph_add_edges([], _DG) ->
+ ok.
digraph_add_edge(From, To, DG) ->
case digraph:vertex(DG, From) of
@@ -492,13 +505,13 @@ digraph_add_edge(From, To, DG) ->
{To, _} -> ok
end,
digraph:add_edge(DG, {From, To}, From, To, []),
- DG.
+ ok.
digraph_confirm_vertices([MFA|Left], DG) ->
digraph:add_vertex(DG, MFA, confirmed),
digraph_confirm_vertices(Left, DG);
-digraph_confirm_vertices([], DG) ->
- DG.
+digraph_confirm_vertices([], _DG) ->
+ ok.
digraph_remove_external(DG) ->
Vertices = digraph:vertices(DG),
@@ -522,6 +535,12 @@ remove_unconfirmed([], DG, Unconfirmed) ->
digraph_delete(DG) ->
digraph:delete(DG).
+active_digraph_delete({'d', DG}) ->
+ digraph:delete(DG);
+active_digraph_delete({'e', Out, In}) ->
+ ets:delete(Out),
+ ets:delete(In).
+
digraph_edges(DG) ->
digraph:edges(DG).
@@ -534,75 +553,6 @@ digraph_in_neighbours(V, DG) ->
List -> List
end.
-%% Pick all the independent nodes (leaves) from one module. Then try
-%% to stay within the module until no more independent nodes can be
-%% chosen. Then pick a new module and so on.
-%%
-%% Note that an SCC that ranges over more than one module is
-%% considered to belong to all modules to make sure that we do not
-%% lose any nodes.
-
-digraph_postorder(Digraph) ->
- %% Remove all self-edges for SCCs.
- Edges = [digraph:edge(Digraph, E) || E <- digraph:edges(Digraph)],
- SelfEdges = [E || {E, V, V, _} <- Edges],
- true = digraph:del_edges(Digraph, SelfEdges),
- %% Determine the first module outside of the loop.
- Leaves = digraph_leaves(Digraph),
- case Leaves =:= [] of
- true -> [];
- false ->
- {Module, Taken} = take_sccs_from_fresh_module(Leaves),
- true = digraph:del_vertices(Digraph, Taken),
- digraph_postorder(Digraph, Module, [Taken])
- end.
-
-digraph_postorder(Digraph, LastModule, Acc) ->
- Leaves = digraph_leaves(Digraph),
- case Leaves =:= [] of
- true -> lists:append(lists:reverse(Acc));
- false ->
- case [SCC || SCC <- Leaves, scc_belongs_to_module(SCC, LastModule)] of
- [] ->
- {NewModule, NewTaken} = take_sccs_from_fresh_module(Leaves),
- true = digraph:del_vertices(Digraph, NewTaken),
- digraph_postorder(Digraph, NewModule, [NewTaken|Acc]);
- NewTaken ->
- true = digraph:del_vertices(Digraph, NewTaken),
- digraph_postorder(Digraph, LastModule, [NewTaken|Acc])
- end
- end.
-
-digraph_leaves(Digraph) ->
- [V || V <- digraph:vertices(Digraph), digraph:out_degree(Digraph, V) =:= 0].
-
-take_sccs_from_fresh_module(Leaves) ->
- NewModule = find_module(hd(Leaves)),
- {NewModule,
- [SCC || SCC <- Leaves, scc_belongs_to_module(SCC, NewModule)]}.
-
--spec scc_belongs_to_module(scc(), module()) -> boolean().
-
-scc_belongs_to_module([Label|Left], Module) when is_integer(Label) ->
- scc_belongs_to_module(Left, Module);
-scc_belongs_to_module([{M, _, _}|Left], Module) ->
- if M =:= Module -> true;
- true -> scc_belongs_to_module(Left, Module)
- end;
-scc_belongs_to_module([], _Module) ->
- false.
-
--spec find_module(scc()) -> module().
-
-find_module([{M, _, _}|_]) -> M;
-find_module([Label|Left]) when is_integer(Label) -> find_module(Left).
-
-digraph_finalize(DG) ->
- DG1 = digraph_utils:condensation(DG),
- Postorder = digraph_postorder(DG1),
- digraph:delete(DG1),
- Postorder.
-
digraph_reaching_subgraph(Funs, DG) ->
Vertices = digraph_utils:reaching(Funs, DG),
digraph_utils:subgraph(DG, Vertices).
@@ -611,20 +561,71 @@ digraph_reaching_subgraph(Funs, DG) ->
%% Races
%%----------------------------------------------------------------------
+-spec renew_race_info(callgraph(), dict(), [label()], [string()]) ->
+ callgraph().
+
+renew_race_info(#callgraph{race_data_server = RaceDataServer} = CG,
+ RaceCode, PublicTables, NamedTables) ->
+ ok = race_data_server_cast(
+ {renew_race_info, {RaceCode, PublicTables, NamedTables}},
+ RaceDataServer),
+ CG.
+
+renew_race_info({RaceCode, PublicTables, NamedTables},
+ #race_data_state{} = State) ->
+ State#race_data_state{race_code = RaceCode,
+ public_tables = PublicTables,
+ named_tables = NamedTables}.
+
+-spec renew_race_code(dialyzer_races:races(), callgraph()) -> callgraph().
+
+renew_race_code(Races, #callgraph{race_data_server = RaceDataServer} = CG) ->
+ Fun = dialyzer_races:get_curr_fun(Races),
+ FunArgs = dialyzer_races:get_curr_fun_args(Races),
+ Code = lists:reverse(dialyzer_races:get_race_list(Races)),
+ ok = race_data_server_cast(
+ {renew_race_code, {Fun, FunArgs, Code}},
+ RaceDataServer),
+ CG.
+
+renew_race_code_handler({Fun, FunArgs, Code},
+ #race_data_state{race_code = RaceCode} = State) ->
+ State#race_data_state{race_code = dict:store(Fun, [FunArgs, Code], RaceCode)}.
+
+-spec renew_race_public_tables(label(), callgraph()) -> callgraph().
+
+renew_race_public_tables(VarLabel,
+ #callgraph{race_data_server = RaceDataServer} = CG) ->
+ ok =
+ race_data_server_cast({renew_race_public_tables, VarLabel}, RaceDataServer),
+ CG.
+
+renew_race_public_tables_handler(VarLabel,
+ #race_data_state{public_tables = PT}
+ = State) ->
+ State#race_data_state{public_tables = ordsets:add_element(VarLabel, PT)}.
+
-spec cleanup(callgraph()) -> callgraph().
-cleanup(#callgraph{digraph = Digraph,
- name_map = NameMap,
- rev_name_map = RevNameMap,
- public_tables = PublicTables,
- named_tables = NamedTables,
- race_code = RaceCode}) ->
+cleanup(#callgraph{digraph = Digraph,
+ name_map = NameMap,
+ rev_name_map = RevNameMap,
+ race_data_server = RaceDataServer}) ->
#callgraph{digraph = Digraph,
- name_map = NameMap,
- rev_name_map = RevNameMap,
- public_tables = PublicTables,
- named_tables = NamedTables,
- race_code = RaceCode}.
+ name_map = NameMap,
+ rev_name_map = RevNameMap,
+ race_data_server = race_data_server_call(dup, RaceDataServer)}.
+
+-spec duplicate(callgraph()) -> callgraph().
+
+duplicate(#callgraph{race_data_server = RaceDataServer} = Callgraph) ->
+ Callgraph#callgraph{
+ race_data_server = race_data_server_call(dup, RaceDataServer)}.
+
+-spec dispose_race_server(callgraph()) -> ok.
+
+dispose_race_server(#callgraph{race_data_server = RaceDataServer}) ->
+ race_data_server_cast(stop, RaceDataServer).
-spec get_digraph(callgraph()) -> digraph().
@@ -633,28 +634,34 @@ get_digraph(#callgraph{digraph = Digraph}) ->
-spec get_named_tables(callgraph()) -> [string()].
-get_named_tables(#callgraph{named_tables = NamedTables}) ->
- NamedTables.
+get_named_tables(#callgraph{race_data_server = RaceDataServer}) ->
+ race_data_server_call(get_named_tables, RaceDataServer).
-spec get_public_tables(callgraph()) -> [label()].
-get_public_tables(#callgraph{public_tables = PT}) ->
- PT.
+get_public_tables(#callgraph{race_data_server = RaceDataServer}) ->
+ race_data_server_call(get_public_tables, RaceDataServer).
-spec get_race_code(callgraph()) -> dict().
-get_race_code(#callgraph{race_code = RaceCode}) ->
- RaceCode.
+get_race_code(#callgraph{race_data_server = RaceDataServer}) ->
+ race_data_server_call(get_race_code, RaceDataServer).
-spec get_race_detection(callgraph()) -> boolean().
get_race_detection(#callgraph{race_detection = RD}) ->
RD.
+-spec get_behaviour_api_calls(callgraph()) -> [{mfa(), mfa()}].
+
+get_behaviour_api_calls(#callgraph{race_data_server = RaceDataServer}) ->
+ race_data_server_call(get_behaviour_api_calls, RaceDataServer).
+
-spec race_code_new(callgraph()) -> callgraph().
-race_code_new(Callgraph) ->
- Callgraph#callgraph{race_code = dict:new()}.
+race_code_new(#callgraph{race_data_server = RaceDataServer} = CG) ->
+ ok = race_data_server_cast(race_code_new, RaceDataServer),
+ CG.
-spec put_digraph(digraph(), callgraph()) -> callgraph().
@@ -663,8 +670,9 @@ put_digraph(Digraph, Callgraph) ->
-spec put_race_code(dict(), callgraph()) -> callgraph().
-put_race_code(RaceCode, Callgraph) ->
- Callgraph#callgraph{race_code = RaceCode}.
+put_race_code(RaceCode, #callgraph{race_data_server = RaceDataServer} = CG) ->
+ ok = race_data_server_cast({put_race_code, RaceCode}, RaceDataServer),
+ CG.
-spec put_race_detection(boolean(), callgraph()) -> callgraph().
@@ -673,13 +681,79 @@ put_race_detection(RaceDetection, Callgraph) ->
-spec put_named_tables([string()], callgraph()) -> callgraph().
-put_named_tables(NamedTables, Callgraph) ->
- Callgraph#callgraph{named_tables = NamedTables}.
+put_named_tables(NamedTables,
+ #callgraph{race_data_server = RaceDataServer} = CG) ->
+ ok = race_data_server_cast({put_named_tables, NamedTables}, RaceDataServer),
+ CG.
-spec put_public_tables([label()], callgraph()) -> callgraph().
-put_public_tables(PublicTables, Callgraph) ->
- Callgraph#callgraph{public_tables = PublicTables}.
+put_public_tables(PublicTables,
+ #callgraph{race_data_server = RaceDataServer} = CG) ->
+ ok = race_data_server_cast({put_public_tables, PublicTables}, RaceDataServer),
+ CG.
+
+-spec put_behaviour_api_calls([{mfa(), mfa()}], callgraph()) -> callgraph().
+
+put_behaviour_api_calls(Calls,
+ #callgraph{race_data_server = RaceDataServer} = CG) ->
+ ok = race_data_server_cast({put_behaviour_api_calls, Calls}, RaceDataServer),
+ CG.
+
+
+new_race_data_server() ->
+ spawn_link(fun() -> race_data_server_loop(#race_data_state{}) end).
+
+race_data_server_loop(State) ->
+ receive
+ {call, From, Ref, Query} ->
+ Reply = race_data_server_handle_call(Query, State),
+ From ! {Ref, Reply},
+ race_data_server_loop(State);
+ {cast, stop} ->
+ ok;
+ {cast, Message} ->
+ NewState = race_data_server_handle_cast(Message, State),
+ race_data_server_loop(NewState)
+ end.
+
+race_data_server_call(Query, Server) ->
+ Ref = make_ref(),
+ Server ! {call, self(), Ref, Query},
+ receive
+ {Ref, Reply} -> Reply
+ end.
+
+race_data_server_cast(Message, Server) ->
+ Server ! {cast, Message},
+ ok.
+
+race_data_server_handle_cast(race_code_new, State) ->
+ State#race_data_state{race_code = dict:new()};
+race_data_server_handle_cast({Tag, Data}, State) ->
+ case Tag of
+ renew_race_info -> renew_race_info(Data, State);
+ renew_race_code -> renew_race_code_handler(Data, State);
+ renew_race_public_tables -> renew_race_public_tables_handler(Data, State);
+ put_race_code -> State#race_data_state{race_code = Data};
+ put_public_tables -> State#race_data_state{public_tables = Data};
+ put_named_tables -> State#race_data_state{named_tables = Data};
+ put_behaviour_api_calls -> State#race_data_state{beh_api_calls = Data}
+ end.
+
+race_data_server_handle_call(Query,
+ #race_data_state{race_code = RaceCode,
+ public_tables = PublicTables,
+ named_tables = NamedTables,
+ beh_api_calls = BehApiCalls}
+ = State) ->
+ case Query of
+ dup -> spawn_link(fun() -> race_data_server_loop(State) end);
+ get_race_code -> RaceCode;
+ get_public_tables -> PublicTables;
+ get_named_tables -> NamedTables;
+ get_behaviour_api_calls -> BehApiCalls
+ end.
%%=============================================================================
%% Utilities for 'dot'
@@ -695,7 +769,7 @@ to_dot(#callgraph{digraph = DG, esc = Esc} = CG, File) ->
end
end,
Escaping = [{Fun(L), {color, red}}
- || L <- sets:to_list(Esc), L =/= external],
+ || L <- [E || {E} <- ets:tab2list(Esc)], L =/= external],
Vertices = digraph_edges(DG),
hipe_dot:translate_list(Vertices, File, "CG", Escaping).
@@ -708,14 +782,41 @@ to_ps(#callgraph{} = CG, File, Args) ->
_ = os:cmd(Command),
ok.
-%-------------------------------------------------------------------------------
-
--spec put_behaviour_api_calls([{mfa(), mfa()}], callgraph()) -> callgraph().
-
-put_behaviour_api_calls(Calls, Callgraph) ->
- Callgraph#callgraph{beh_api_calls = Calls}.
-
--spec get_behaviour_api_calls(callgraph()) -> [{mfa(), mfa()}].
-
-get_behaviour_api_calls(Callgraph) ->
- Callgraph#callgraph.beh_api_calls.
+condensation(G) ->
+ SCs = digraph_utils:strong_components(G),
+ V2I = ets:new(condensation_v2i, []),
+ I2C = ets:new(condensation_i2c, []),
+ I2I = ets:new(condensation_i2i, [bag]),
+ CFun =
+ fun(SC, N) ->
+ lists:foreach(fun(V) -> true = ets:insert(V2I, {V,N}) end, SC),
+ true = ets:insert(I2C, {N, SC}),
+ N + 1
+ end,
+ lists:foldl(CFun, 1, SCs),
+ Fun1 =
+ fun({V1, V2}) ->
+ I1 = ets:lookup_element(V2I, V1, 2),
+ I2 = ets:lookup_element(V2I, V2, 2),
+ case I1 =:= I2 of
+ true -> true;
+ false -> ets:insert(I2I, {I1, I2})
+ end
+ end,
+ lists:foreach(Fun1, digraph:edges(G)),
+ Fun3 =
+ fun({I1, I2}, {Out, In}) ->
+ SC1 = ets:lookup_element(I2C, I1, 2),
+ SC2 = ets:lookup_element(I2C, I2, 2),
+ {dict:append(SC1, SC2, Out), dict:append(SC2, SC1, In)}
+ end,
+ {OutDict, InDict} = ets:foldl(Fun3, {dict:new(), dict:new()}, I2I),
+ [OutETS, InETS] =
+ [ets:new(Name,[{read_concurrency, true}]) ||
+ Name <- [callgraph_deps_out, callgraph_deps_in]],
+ ets:insert(OutETS, dict:to_list(OutDict)),
+ ets:insert(InETS, dict:to_list(InDict)),
+ ets:delete(V2I),
+ ets:delete(I2C),
+ ets:delete(I2I),
+ {{'e', OutETS, InETS}, SCs}.
diff --git a/lib/dialyzer/src/dialyzer_cl.erl b/lib/dialyzer/src/dialyzer_cl.erl
index 04a0db890f..6732d96b98 100644
--- a/lib/dialyzer/src/dialyzer_cl.erl
+++ b/lib/dialyzer/src/dialyzer_cl.erl
@@ -2,7 +2,7 @@
%%-------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -188,6 +188,7 @@ plt_common(#options{init_plts = [InitPlt]} = Opts, RemoveFiles, AddFiles) ->
ok ->
case Opts#options.output_plt of
none -> ok;
+ InitPlt -> ok;
OutPlt ->
{ok, Binary} = file:read_file(InitPlt),
ok = file:write_file(OutPlt, Binary)
@@ -393,10 +394,12 @@ do_analysis(Files, Options, Plt, PltInfo) ->
defines = Options#options.defines,
include_dirs = Options#options.include_dirs,
files = Files,
- start_from = Options#options.from,
+ start_from = Options#options.from,
+ timing = Options#options.timing,
plt = Plt,
use_contracts = Options#options.use_contracts,
- callgraph_file = Options#options.callgraph_file},
+ callgraph_file = Options#options.callgraph_file,
+ solvers = Options#options.solvers},
State3 = start_analysis(State2, InitAnalysis),
{T1, _} = statistics(wall_clock),
Return = cl_loop(State3),
diff --git a/lib/dialyzer/src/dialyzer_cl_parse.erl b/lib/dialyzer/src/dialyzer_cl_parse.erl
index ff8fc39a5e..2ea3d3af5a 100644
--- a/lib/dialyzer/src/dialyzer_cl_parse.erl
+++ b/lib/dialyzer/src/dialyzer_cl_parse.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -164,6 +164,13 @@ cl(["--src"|T]) ->
cl(["--no_spec"|T]) ->
put(dialyzer_options_use_contracts, false),
cl(T);
+cl(["--statistics"|T]) ->
+ put(dialyzer_timing, true),
+ cl(T);
+cl(["--resources"|T]) ->
+ put(dialyzer_options_report_mode, quiet),
+ put(dialyzer_timing, debug),
+ cl(T);
cl(["-v"|_]) ->
io:format("Dialyzer version "++?VSN++"\n"),
erlang:halt(?RET_NOTHING_SUSPICIOUS);
@@ -191,6 +198,9 @@ cl(["--gui"|T]) ->
cl(["--wx"|T]) ->
put(dialyzer_options_mode, {gui, wx}),
cl(T);
+cl(["--solver",Solver|T]) -> % not documented
+ append_var(dialyzer_solvers, [list_to_atom(Solver)]),
+ cl(T);
cl([H|_] = L) ->
case filelib:is_file(H) orelse filelib:is_dir(H) of
true ->
@@ -250,6 +260,8 @@ init() ->
put(dialyzer_output_format, formatted),
put(dialyzer_filename_opt, basename),
put(dialyzer_options_check_plt, DefaultOpts#options.check_plt),
+ put(dialyzer_timing, DefaultOpts#options.timing),
+ put(dialyzer_solvers, DefaultOpts#options.solvers),
ok.
append_defines([Def, Val]) ->
@@ -290,6 +302,7 @@ cl_options() ->
{filename_opt, get(dialyzer_filename_opt)},
{analysis_type, get(dialyzer_options_analysis_type)},
{get_warnings, get(dialyzer_options_get_warnings)},
+ {timing, get(dialyzer_timing)},
{callgraph_file, get(dialyzer_callgraph_file)}
|common_options()].
@@ -302,7 +315,8 @@ common_options() ->
{report_mode, get(dialyzer_options_report_mode)},
{use_spec, get(dialyzer_options_use_contracts)},
{warnings, get(dialyzer_warnings)},
- {check_plt, get(dialyzer_options_check_plt)}].
+ {check_plt, get(dialyzer_options_check_plt)},
+ {solvers, get(dialyzer_solvers)}].
%%-----------------------------------------------------------------------
@@ -351,7 +365,7 @@ help_message() ->
[--apps applications] [-o outfile]
[--build_plt] [--add_to_plt] [--remove_from_plt]
[--check_plt] [--no_check_plt] [--plt_info] [--get_warnings]
- [--no_native] [--fullpath]
+ [--no_native] [--fullpath] [--statistics]
Options:
files_or_dirs (for backwards compatibility also as: -c files_or_dirs)
Use Dialyzer from the command line to detect defects in the
@@ -418,6 +432,9 @@ Options:
Make Dialyzer a bit more quiet.
--verbose
Make Dialyzer a bit more verbose.
+ --statistics
+ Prints information about the progress of execution (analysis phases,
+ time spent in each and size of the relative input).
--build_plt
The analysis starts from an empty plt and creates a new one from the
files specified with -c and -r. Only works for beam files.
diff --git a/lib/dialyzer/src/dialyzer_codeserver.erl b/lib/dialyzer/src/dialyzer_codeserver.erl
index 13ca65e4dd..9989118671 100644
--- a/lib/dialyzer/src/dialyzer_codeserver.erl
+++ b/lib/dialyzer/src/dialyzer_codeserver.erl
@@ -52,9 +52,7 @@
new/0,
set_next_core_label/2,
set_temp_records/2,
- store_records/3,
store_temp_records/3,
- store_contracts/3,
store_temp_contracts/4]).
-export_type([codeserver/0]).
@@ -63,85 +61,159 @@
%%--------------------------------------------------------------------
--record(codeserver, {table_pid :: pid(),
- exported_types = sets:new() :: set(), % set(mfa())
- temp_exported_types = sets:new() :: set(), % set(mfa())
- exports = sets:new() :: set(), % set(mfa())
- next_core_label = 0 :: label(),
- records = dict:new() :: dict(),
- temp_records = dict:new() :: dict(),
- contracts = dict:new() :: dict(),
- callbacks = dict:new() :: dict(),
- temp_contracts = dict:new() :: dict(),
- temp_callbacks = dict:new() :: dict()
+-type dict_ets() :: ets:tid().
+-type set_ets() :: ets:tid().
+
+-record(codeserver, {next_core_label = 0 :: label(),
+ code :: dict_ets(),
+ exported_types :: set_ets(), % set(mfa())
+ records :: dict_ets(),
+ contracts :: dict_ets(),
+ callbacks :: dict_ets(),
+ exports :: 'clean' | set_ets(), % set(mfa())
+ temp_exported_types :: 'clean' | set_ets(), % set(mfa())
+ temp_records :: 'clean' | dict_ets(),
+ temp_contracts :: 'clean' | dict_ets(),
+ temp_callbacks :: 'clean' | dict_ets()
}).
-opaque codeserver() :: #codeserver{}.
%%--------------------------------------------------------------------
+ets_dict_find(Key, Table) ->
+ try ets:lookup_element(Table, Key, 2) of
+ Val -> {ok, Val}
+ catch
+ _:_ -> error
+ end.
+
+ets_dict_store(Key, Element, Table) ->
+ true = ets:insert(Table, {Key, Element}),
+ Table.
+
+ets_dict_store_dict(Dict, Table) ->
+ true = ets:insert(Table, dict:to_list(Dict)).
+
+ets_dict_to_dict(Table) ->
+ Fold = fun({Key,Value}, Dict) -> dict:store(Key, Value, Dict) end,
+ ets:foldl(Fold, dict:new(), Table).
+
+ets_set_is_element(Key, Table) ->
+ case ets:lookup(Table, Key) of
+ [] -> false;
+ _ -> true
+ end.
+
+ets_set_insert_set(Set, Table) ->
+ ets_set_insert_list(sets:to_list(Set), Table).
+
+ets_set_insert_list(List, Table) ->
+ true = ets:insert(Table, [{E} || E <- List]).
+
+ets_set_to_set(Table) ->
+ Fold = fun({E}, Set) -> sets:add_element(E, Set) end,
+ ets:foldl(Fold, sets:new(), Table).
+
+ets_read_concurrent_table(Name) ->
+ ets:new(Name,[{read_concurrency, true}]).
+
+%%--------------------------------------------------------------------
+
-spec new() -> codeserver().
new() ->
- #codeserver{table_pid = table__new()}.
+ CodeOptions = [compressed, public, {read_concurrency, true}],
+ Code = ets:new(dialyzer_codeserver_code, CodeOptions),
+ TempOptions = [public, {write_concurrency, true}],
+ [Exports, TempExportedTypes, TempRecords, TempContracts, TempCallbacks] =
+ [ets:new(Name, TempOptions) ||
+ Name <-
+ [dialyzer_codeserver_exports, dialyzer_codeserver_temp_exported_types,
+ dialyzer_codeserver_temp_records, dialyzer_codeserver_temp_contracts,
+ dialyzer_codeserver_temp_callbacks]],
+ #codeserver{code = Code,
+ exports = Exports,
+ temp_exported_types = TempExportedTypes,
+ temp_records = TempRecords,
+ temp_contracts = TempContracts,
+ temp_callbacks = TempCallbacks}.
-spec delete(codeserver()) -> 'ok'.
-delete(#codeserver{table_pid = TablePid}) ->
- table__delete(TablePid).
+delete(#codeserver{code = Code, exported_types = ExportedTypes,
+ records = Records, contracts = Contracts,
+ callbacks = Callbacks}) ->
+ lists:foreach(fun ets:delete/1,
+ [Code, ExportedTypes, Records, Contracts, Callbacks]).
-spec insert(atom(), cerl:c_module(), codeserver()) -> codeserver().
insert(Mod, ModCode, CS) ->
- NewTablePid = table__insert(CS#codeserver.table_pid, Mod, ModCode),
- CS#codeserver{table_pid = NewTablePid}.
+ Name = cerl:module_name(ModCode),
+ Exports = cerl:module_exports(ModCode),
+ Attrs = cerl:module_attrs(ModCode),
+ Defs = cerl:module_defs(ModCode),
+ As = cerl:get_ann(ModCode),
+ Funs =
+ [{{Mod, cerl:fname_id(Var), cerl:fname_arity(Var)},
+ Val} || Val = {Var, _Fun} <- Defs],
+ Keys = [Key || {Key, _Value} <- Funs],
+ ModEntry = {Mod, {Name, Exports, Attrs, Keys, As}},
+ true = ets:insert(CS#codeserver.code, [ModEntry|Funs]),
+ CS.
+
+-spec get_temp_exported_types(codeserver()) -> set().
+
+get_temp_exported_types(#codeserver{temp_exported_types = TempExpTypes}) ->
+ ets_set_to_set(TempExpTypes).
-spec insert_temp_exported_types(set(), codeserver()) -> codeserver().
insert_temp_exported_types(Set, CS) ->
- CS#codeserver{temp_exported_types = Set}.
+ TempExportedTypes = CS#codeserver.temp_exported_types,
+ true = ets_set_insert_set(Set, TempExportedTypes),
+ CS.
-spec insert_exports([mfa()], codeserver()) -> codeserver().
insert_exports(List, #codeserver{exports = Exports} = CS) ->
- Set = sets:from_list(List),
- NewExports = sets:union(Exports, Set),
- CS#codeserver{exports = NewExports}.
+ true = ets_set_insert_list(List, Exports),
+ CS.
-spec is_exported(mfa(), codeserver()) -> boolean().
is_exported(MFA, #codeserver{exports = Exports}) ->
- sets:is_element(MFA, Exports).
+ ets_set_is_element(MFA, Exports).
-spec get_exported_types(codeserver()) -> set(). % set(mfa())
get_exported_types(#codeserver{exported_types = ExpTypes}) ->
- ExpTypes.
-
--spec get_temp_exported_types(codeserver()) -> set().
-
-get_temp_exported_types(#codeserver{temp_exported_types = TempExpTypes}) ->
- TempExpTypes.
+ ets_set_to_set(ExpTypes).
-spec get_exports(codeserver()) -> set(). % set(mfa())
get_exports(#codeserver{exports = Exports}) ->
- Exports.
+ ets_set_to_set(Exports).
-spec finalize_exported_types(set(), codeserver()) -> codeserver().
finalize_exported_types(Set, CS) ->
- CS#codeserver{exported_types = Set, temp_exported_types = sets:new()}.
+ ExportedTypes = ets_read_concurrent_table(dialyzer_codeserver_exported_types),
+ true = ets_set_insert_set(Set, ExportedTypes),
+ TempExpTypes = CS#codeserver.temp_exported_types,
+ true = ets:delete(TempExpTypes),
+ CS#codeserver{exported_types = ExportedTypes, temp_exported_types = clean}.
-spec lookup_mod_code(atom(), codeserver()) -> cerl:c_module().
lookup_mod_code(Mod, CS) when is_atom(Mod) ->
- table__lookup(CS#codeserver.table_pid, Mod).
+ table__lookup(CS#codeserver.code, Mod).
-spec lookup_mfa_code(mfa(), codeserver()) -> {cerl:c_var(), cerl:c_fun()}.
lookup_mfa_code({_M, _F, _A} = MFA, CS) ->
- table__lookup(CS#codeserver.table_pid, MFA).
+ table__lookup(CS#codeserver.code, MFA).
-spec get_next_core_label(codeserver()) -> label().
@@ -153,20 +225,10 @@ get_next_core_label(#codeserver{next_core_label = NCL}) ->
set_next_core_label(NCL, CS) ->
CS#codeserver{next_core_label = NCL}.
--spec store_records(atom(), dict(), codeserver()) -> codeserver().
-
-store_records(Mod, Dict, #codeserver{records = RecDict} = CS)
- when is_atom(Mod) ->
- case dict:size(Dict) =:= 0 of
- true -> CS;
- false -> CS#codeserver{records = dict:store(Mod, Dict, RecDict)}
- end.
-
-spec lookup_mod_records(atom(), codeserver()) -> dict().
-lookup_mod_records(Mod, #codeserver{records = RecDict})
- when is_atom(Mod) ->
- case dict:find(Mod, RecDict) of
+lookup_mod_records(Mod, #codeserver{records = RecDict}) when is_atom(Mod) ->
+ case ets_dict_find(Mod, RecDict) of
error -> dict:new();
{ok, Dict} -> Dict
end.
@@ -174,7 +236,7 @@ lookup_mod_records(Mod, #codeserver{records = RecDict})
-spec get_records(codeserver()) -> dict().
get_records(#codeserver{records = RecDict}) ->
- RecDict.
+ ets_dict_to_dict(RecDict).
-spec store_temp_records(atom(), dict(), codeserver()) -> codeserver().
@@ -182,59 +244,58 @@ store_temp_records(Mod, Dict, #codeserver{temp_records = TempRecDict} = CS)
when is_atom(Mod) ->
case dict:size(Dict) =:= 0 of
true -> CS;
- false -> CS#codeserver{temp_records = dict:store(Mod, Dict, TempRecDict)}
+ false -> CS#codeserver{temp_records = ets_dict_store(Mod, Dict, TempRecDict)}
end.
-spec get_temp_records(codeserver()) -> dict().
get_temp_records(#codeserver{temp_records = TempRecDict}) ->
- TempRecDict.
+ ets_dict_to_dict(TempRecDict).
-spec set_temp_records(dict(), codeserver()) -> codeserver().
set_temp_records(Dict, CS) ->
- CS#codeserver{temp_records = Dict}.
+ true = ets:delete(CS#codeserver.temp_records),
+ TempRecords = ets:new(dialyzer_codeserver_temp_records,[]),
+ true = ets_dict_store_dict(Dict, TempRecords),
+ CS#codeserver{temp_records = TempRecords}.
-spec finalize_records(dict(), codeserver()) -> codeserver().
finalize_records(Dict, CS) ->
- CS#codeserver{records = Dict, temp_records = dict:new()}.
-
--spec store_contracts(atom(), dict(), codeserver()) -> codeserver().
-
-store_contracts(Mod, Dict, #codeserver{contracts = C} = CS) when is_atom(Mod) ->
- case dict:size(Dict) =:= 0 of
- true -> CS;
- false -> CS#codeserver{contracts = dict:store(Mod, Dict, C)}
- end.
+ true = ets:delete(CS#codeserver.temp_records),
+ Records = ets_read_concurrent_table(dialyzer_codeserver_records),
+ true = ets_dict_store_dict(Dict, Records),
+ CS#codeserver{records = Records, temp_records = clean}.
-spec lookup_mod_contracts(atom(), codeserver()) -> dict().
lookup_mod_contracts(Mod, #codeserver{contracts = ContDict})
when is_atom(Mod) ->
- case dict:find(Mod, ContDict) of
+ case ets_dict_find(Mod, ContDict) of
error -> dict:new();
- {ok, Dict} -> Dict
+ {ok, Keys} ->
+ dict:from_list([get_contract_pair(Key, ContDict)|| Key <- Keys])
end.
+get_contract_pair(Key, ContDict) ->
+ {Key, ets:lookup_element(ContDict, Key, 2)}.
+
-spec lookup_mfa_contract(mfa(), codeserver()) ->
'error' | {'ok', dialyzer_contracts:file_contract()}.
-lookup_mfa_contract({M,_F,_A} = MFA, #codeserver{contracts = ContDict}) ->
- case dict:find(M, ContDict) of
- error -> error;
- {ok, Dict} -> dict:find(MFA, Dict)
- end.
+lookup_mfa_contract(MFA, #codeserver{contracts = ContDict}) ->
+ ets_dict_find(MFA, ContDict).
-spec get_contracts(codeserver()) -> dict().
get_contracts(#codeserver{contracts = ContDict}) ->
- ContDict.
+ ets_dict_to_dict(ContDict).
--spec get_callbacks(codeserver()) -> dict().
+-spec get_callbacks(codeserver()) -> list().
get_callbacks(#codeserver{callbacks = CallbDict}) ->
- CallbDict.
+ ets:tab2list(CallbDict).
-spec store_temp_contracts(atom(), dict(), dict(), codeserver()) ->
codeserver().
@@ -246,86 +307,44 @@ store_temp_contracts(Mod, SpecDict, CallbackDict,
CS1 =
case dict:size(SpecDict) =:= 0 of
true -> CS;
- false -> CS#codeserver{temp_contracts = dict:store(Mod, SpecDict, Cn)}
+ false ->
+ CS#codeserver{temp_contracts = ets_dict_store(Mod, SpecDict, Cn)}
end,
case dict:size(CallbackDict) =:= 0 of
true -> CS1;
- false -> CS1#codeserver{temp_callbacks = dict:store(Mod, CallbackDict, Cb)}
+ false ->
+ CS1#codeserver{temp_callbacks = ets_dict_store(Mod, CallbackDict, Cb)}
end.
-spec get_temp_contracts(codeserver()) -> {dict(), dict()}.
get_temp_contracts(#codeserver{temp_contracts = TempContDict,
temp_callbacks = TempCallDict}) ->
- {TempContDict, TempCallDict}.
+ {ets_dict_to_dict(TempContDict), ets_dict_to_dict(TempCallDict)}.
-spec finalize_contracts(dict(), dict(), codeserver()) -> codeserver().
-finalize_contracts(CnDict, CbDict, CS) ->
- CS#codeserver{contracts = CnDict,
- callbacks = CbDict,
- temp_contracts = dict:new(),
- temp_callbacks = dict:new()
- }.
-
-table__new() ->
- spawn_link(fun() -> table__loop(none, dict:new()) end).
-
-table__delete(TablePid) ->
- TablePid ! stop,
- ok.
-
-table__lookup(TablePid, Key) ->
- TablePid ! {self(), lookup, Key},
- receive
- {TablePid, Key, Ans} -> Ans
- end.
-
-table__insert(TablePid, Key, Val) ->
- TablePid ! {insert, [{Key, term_to_binary(Val, [compressed])}]},
- TablePid.
-
-table__loop(Cached, Map) ->
- receive
- stop -> ok;
- {Pid, lookup, {M, F, A} = MFA} ->
- {NewCached, Ans} =
- case Cached of
- {M, Tree} ->
- [Val] = [VarFun || {Var, _Fun} = VarFun <- cerl:module_defs(Tree),
- cerl:fname_id(Var) =:= F,
- cerl:fname_arity(Var) =:= A],
- {Cached, Val};
- _ ->
- Tree = fetch_and_expand(M, Map),
- [Val] = [VarFun || {Var, _Fun} = VarFun <- cerl:module_defs(Tree),
- cerl:fname_id(Var) =:= F,
- cerl:fname_arity(Var) =:= A],
- {{M, Tree}, Val}
- end,
- Pid ! {self(), MFA, Ans},
- table__loop(NewCached, Map);
- {Pid, lookup, Mod} when is_atom(Mod) ->
- Ans = case Cached of
- {Mod, Tree} -> Tree;
- _ -> fetch_and_expand(Mod, Map)
- end,
- Pid ! {self(), Mod, Ans},
- table__loop({Mod, Ans}, Map);
- {insert, List} ->
- NewMap = lists:foldl(fun({Key, Val}, AccMap) ->
- dict:store(Key, Val, AccMap)
- end, Map, List),
- table__loop(Cached, NewMap)
- end.
-
-fetch_and_expand(Mod, Map) ->
- try
- Bin = dict:fetch(Mod, Map),
- binary_to_term(Bin)
- catch
- _:_ ->
- S = atom_to_list(Mod),
- Msg = "found no module named '" ++ S ++ "' in the analyzed files",
- exit({error, Msg})
- end.
+finalize_contracts(SpecDict, CallbackDict, CS) ->
+ Contracts = ets_read_concurrent_table(dialyzer_codeserver_contracts),
+ Callbacks = ets_read_concurrent_table(dialyzer_codeserver_callbacks),
+ Contracts = dict:fold(fun decompose_spec_dict/3, Contracts, SpecDict),
+ Callbacks = dict:fold(fun decompose_cb_dict/3, Callbacks, CallbackDict),
+ CS#codeserver{contracts = Contracts, callbacks = Callbacks,
+ temp_contracts = clean, temp_callbacks = clean}.
+
+decompose_spec_dict(Mod, Dict, Table) ->
+ Keys = dict:fetch_keys(Dict),
+ true = ets:insert(Table, dict:to_list(Dict)),
+ true = ets:insert(Table, {Mod, Keys}),
+ Table.
+
+decompose_cb_dict(_Mod, Dict, Table) ->
+ true = ets:insert(Table, dict:to_list(Dict)),
+ Table.
+
+table__lookup(TablePid, M) when is_atom(M) ->
+ {Name, Exports, Attrs, Keys, As} = ets:lookup_element(TablePid, M, 2),
+ Defs = [table__lookup(TablePid, Key) || Key <- Keys],
+ cerl:ann_c_module(As, Name, Exports, Attrs, Defs);
+table__lookup(TablePid, MFA) ->
+ ets:lookup_element(TablePid, MFA, 2).
diff --git a/lib/dialyzer/src/dialyzer_contracts.erl b/lib/dialyzer/src/dialyzer_contracts.erl
index 2b78b736ab..0b932d5a1f 100644
--- a/lib/dialyzer/src/dialyzer_contracts.erl
+++ b/lib/dialyzer/src/dialyzer_contracts.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -344,7 +344,7 @@ insert_constraints([{subtype, Type1, Type2}|Left], Dict) ->
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\n", [])})
+ "must be a type variable: ~p\n", [Type1])})
end;
insert_constraints([], Dict) -> Dict.
@@ -385,9 +385,8 @@ contract_from_form([{type, _L1, bounded_fun,
RecDict, FileLine, TypeAcc, FormAcc) ->
TypeFun =
fun(ExpTypes, AllRecords) ->
- Constr1 = [constraint_from_form(C, RecDict, ExpTypes, AllRecords)
- || C <- Constr],
- VarDict = insert_constraints(Constr1, dict:new()),
+ {Constr1, VarDict} =
+ process_constraints(Constr, RecDict, ExpTypes, AllRecords),
Type = erl_types:t_from_form(Form, RecDict, VarDict),
NewType = erl_types:t_solve_remote(Type, ExpTypes, AllRecords),
{NewType, Constr1}
@@ -398,18 +397,66 @@ contract_from_form([{type, _L1, bounded_fun,
contract_from_form([], _RecDict, _FileLine, TypeAcc, FormAcc) ->
{lists:reverse(TypeAcc), lists:reverse(FormAcc)}.
-constraint_from_form({type, _, constraint, [{atom, _, is_subtype},
- [Type1, Type2]]}, RecDict,
- ExpTypes, AllRecords) ->
- T1 = erl_types:t_from_form(Type1, RecDict),
- T2 = erl_types:t_from_form(Type2, RecDict),
- T3 = erl_types:t_solve_remote(T1, ExpTypes, AllRecords),
- T4 = erl_types:t_solve_remote(T2, ExpTypes, AllRecords),
- {subtype, T3, T4};
-constraint_from_form({type, _, constraint, [{atom,_,Name}, List]}, _RecDict,
- _ExpTypes, _AllRecords) ->
- N = length(List),
- throw({error, io_lib:format("Unsupported type guard ~w/~w\n", [Name, N])}).
+process_constraints(Constrs, RecDict, ExpTypes, AllRecords) ->
+ Init = initialize_constraints(Constrs, RecDict, ExpTypes, AllRecords),
+ constraints_fixpoint(Init, RecDict, ExpTypes, AllRecords).
+
+initialize_constraints(Constrs, RecDict, ExpTypes, AllRecords) ->
+ initialize_constraints(Constrs, RecDict, ExpTypes, AllRecords, []).
+
+initialize_constraints([], _RecDict, _ExpTypes, _AllRecords, Acc) ->
+ Acc;
+initialize_constraints([Constr|Rest], RecDict, ExpTypes, AllRecords, Acc) ->
+ case Constr of
+ {type, _, constraint, [{atom, _, is_subtype}, [Type1, Type2]]} ->
+ T1 = final_form(Type1, RecDict, ExpTypes, AllRecords, dict:new()),
+ Entry = {T1, Type2},
+ initialize_constraints(Rest, RecDict, ExpTypes, AllRecords, [Entry|Acc]);
+ {type, _, constraint, [{atom,_,Name}, List]} ->
+ N = length(List),
+ throw({error,
+ io_lib:format("Unsupported type guard ~w/~w\n", [Name, N])})
+ end.
+
+constraints_fixpoint(Constrs, RecDict, ExpTypes, AllRecords) ->
+ VarDict =
+ constraints_to_dict(Constrs, RecDict, ExpTypes, AllRecords, dict:new()),
+ constraints_fixpoint(VarDict, Constrs, RecDict, ExpTypes, AllRecords).
+
+constraints_fixpoint(OldVarDict, Constrs, RecDict, ExpTypes, AllRecords) ->
+ NewVarDict =
+ constraints_to_dict(Constrs, RecDict, ExpTypes, AllRecords, OldVarDict),
+ case NewVarDict of
+ OldVarDict ->
+ DictFold =
+ fun(Key, Value, Acc) ->
+ [{subtype, erl_types:t_var(Key), Value}|Acc]
+ end,
+ FinalConstrs = dict:fold(DictFold, [], NewVarDict),
+ {FinalConstrs, NewVarDict};
+ _Other ->
+ constraints_fixpoint(NewVarDict, Constrs, RecDict, ExpTypes, AllRecords)
+ end.
+
+-define(TYPE_LIMIT, 4).
+
+final_form(Form, RecDict, ExpTypes, AllRecords, VarDict) ->
+ T1 = erl_types:t_from_form(Form, RecDict, VarDict),
+ T2 = erl_types:t_solve_remote(T1, ExpTypes, AllRecords),
+ erl_types:t_limit(T2, ?TYPE_LIMIT).
+
+constraints_to_dict(Constrs, RecDict, ExpTypes, AllRecords, VarDict) ->
+ Subtypes =
+ constraints_to_subs(Constrs, RecDict, ExpTypes, AllRecords, VarDict, []),
+ insert_constraints(Subtypes, dict:new()).
+
+constraints_to_subs([], _RecDict, _ExpTypes, _AllRecords, _VarDict, Acc) ->
+ Acc;
+constraints_to_subs([C|Rest], RecDict, ExpTypes, AllRecords, VarDict, Acc) ->
+ {T1, Form2} = C,
+ T2 = final_form(Form2, RecDict, ExpTypes, AllRecords, VarDict),
+ NewAcc = [{subtype, T1, T2}|Acc],
+ constraints_to_subs(Rest, RecDict, ExpTypes, AllRecords, VarDict, NewAcc).
%% Gets the most general domain of a list of domains of all
%% the overloaded contracts
diff --git a/lib/dialyzer/src/dialyzer_coordinator.erl b/lib/dialyzer/src/dialyzer_coordinator.erl
new file mode 100644
index 0000000000..c3b7ce29af
--- /dev/null
+++ b/lib/dialyzer/src/dialyzer_coordinator.erl
@@ -0,0 +1,251 @@
+%% -*- erlang-indent-level: 2 -*-
+%%-----------------------------------------------------------------------
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%%-------------------------------------------------------------------
+%%% File : dialyzer_coordinator.erl
+%%% Authors : Stavros Aronis <[email protected]>
+%%%-------------------------------------------------------------------
+
+-module(dialyzer_coordinator).
+
+%%% Export for dialyzer main process
+-export([parallel_job/4]).
+
+%%% Exports for all possible workers
+-export([wait_activation/0, job_done/3]).
+
+%%% Exports for the typesig and dataflow analysis workers
+-export([sccs_to_pids/2, request_activation/1]).
+
+%%% Exports for the compilation workers
+-export([get_next_label/2]).
+
+-export_type([coordinator/0, mode/0, init_data/0, result/0]).
+
+%%--------------------------------------------------------------------
+
+-type collector() :: pid().
+-type regulator() :: pid().
+-type scc_to_pid() :: ets:tid() | 'unused'.
+
+-type coordinator() :: {collector(), regulator(), scc_to_pid()}. %%opaque
+-type timing() :: dialyzer_timing:timing_server().
+
+-type scc() :: [mfa_or_funlbl()].
+-type mode() :: 'typesig' | 'dataflow' | 'compile' | 'warnings'.
+
+-type compile_jobs() :: [file:filename()].
+-type typesig_jobs() :: [scc()].
+-type dataflow_jobs() :: [module()].
+-type warnings_jobs() :: [module()].
+
+-type compile_init_data() :: dialyzer_analysis_callgraph:compile_init_data().
+-type typesig_init_data() :: dialyzer_succ_typings:typesig_init_data().
+-type dataflow_init_data() :: dialyzer_succ_typings:dataflow_init_data().
+-type warnings_init_data() :: dialyzer_succ_typings:warnings_init_data().
+
+-type compile_result() :: dialyzer_analysis_callgraph:compile_result().
+-type typesig_result() :: [mfa_or_funlbl()].
+-type dataflow_result() :: [mfa_or_funlbl()].
+-type warnings_result() :: [dial_warning()].
+
+-type init_data() :: compile_init_data() | typesig_init_data() |
+ dataflow_init_data() | warnings_init_data().
+
+-type result() :: compile_result() | typesig_result() |
+ dataflow_result() | warnings_result().
+
+-type job() :: scc() | module() | file:filename().
+-type job_result() :: dialyzer_analysis_callgraph:one_file_result() |
+ typesig_result() | dataflow_result() | warnings_result().
+
+-record(state, {mode :: mode(),
+ active = 0 :: integer(),
+ result :: result(),
+ next_label = 0 :: integer(),
+ init_data :: init_data(),
+ regulator :: regulator(),
+ scc_to_pid :: scc_to_pid()
+ }).
+
+-include("dialyzer.hrl").
+
+%%--------------------------------------------------------------------
+
+-spec parallel_job('compile', compile_jobs(), compile_init_data(), timing()) ->
+ {compile_result(), integer()};
+ ('typesig', typesig_jobs(), typesig_init_data(), timing()) ->
+ typesig_result();
+ ('dataflow', dataflow_jobs(), dataflow_init_data(),
+ timing()) -> dataflow_result();
+ ('warnings', warnings_jobs(), warnings_init_data(),
+ timing()) -> warnings_result().
+
+parallel_job(Mode, Jobs, InitData, Timing) ->
+ State = spawn_jobs(Mode, Jobs, InitData, Timing),
+ collect_result(State).
+
+spawn_jobs(Mode, Jobs, InitData, Timing) ->
+ Collector = self(),
+ Regulator = spawn_regulator(),
+ TypesigOrDataflow = (Mode =:= 'typesig') orelse (Mode =:= 'dataflow'),
+ SCCtoPID =
+ case TypesigOrDataflow of
+ true -> ets:new(scc_to_pid, [{read_concurrency, true}]);
+ false -> unused
+ end,
+ Coordinator = {Collector, Regulator, SCCtoPID},
+ Fold =
+ fun(Job, Count) ->
+ Pid = dialyzer_worker:launch(Mode, Job, InitData, Coordinator),
+ case TypesigOrDataflow of
+ true -> true = ets:insert(SCCtoPID, {Job, Pid}), ok;
+ false -> request_activation(Regulator, Pid)
+ end,
+ Count + 1
+ end,
+ JobCount = lists:foldl(Fold, 0, Jobs),
+ Unit =
+ case Mode of
+ 'typesig' -> "SCCs";
+ _ -> "modules"
+ end,
+ dialyzer_timing:send_size_info(Timing, JobCount, Unit),
+ InitResult =
+ case Mode of
+ 'compile' -> dialyzer_analysis_callgraph:compile_init_result();
+ _ -> []
+ end,
+ #state{mode = Mode, active = JobCount, result = InitResult, next_label = 0,
+ init_data = InitData, regulator = Regulator, scc_to_pid = SCCtoPID}.
+
+collect_result(#state{mode = Mode, active = Active, result = Result,
+ next_label = NextLabel, init_data = InitData,
+ regulator = Regulator, scc_to_pid = SCCtoPID} = State) ->
+ receive
+ {next_label_request, Estimation, Pid} ->
+ Pid ! {next_label_reply, NextLabel},
+ collect_result(State#state{next_label = NextLabel + Estimation});
+ {done, Job, Data} ->
+ NewResult = update_result(Mode, InitData, Job, Data, Result),
+ case Active of
+ 1 ->
+ kill_regulator(Regulator),
+ case Mode of
+ 'compile' ->
+ {NewResult, NextLabel};
+ X when X =:= 'typesig'; X =:= 'dataflow' ->
+ ets:delete(SCCtoPID),
+ NewResult;
+ 'warnings' ->
+ NewResult
+ end;
+ N ->
+ collect_result(State#state{result = NewResult, active = N - 1})
+ end
+ end.
+
+update_result(Mode, InitData, Job, Data, Result) ->
+ case Mode of
+ 'compile' ->
+ dialyzer_analysis_callgraph:add_to_result(Job, Data, Result,
+ InitData);
+ X when X =:= 'typesig'; X =:= 'dataflow' ->
+ dialyzer_succ_typings:lookup_names(Data, InitData) ++ Result;
+ 'warnings' ->
+ Data ++ Result
+ end.
+
+-spec sccs_to_pids([scc() | module()], coordinator()) ->
+ {[dialyzer_worker:worker()], [scc() | module()]}.
+
+sccs_to_pids(SCCs, {_Collector, _Regulator, SCCtoPID}) ->
+ Fold =
+ fun(SCC, {Pids, Unknown}) ->
+ try ets:lookup_element(SCCtoPID, SCC, 2) of
+ Result -> {[Result|Pids], Unknown}
+ catch
+ _:_ -> {Pids, [SCC|Unknown]}
+ end
+ end,
+ lists:foldl(Fold, {[], []}, SCCs).
+
+-spec job_done(job(), job_result(), coordinator()) -> ok.
+
+job_done(Job, Result, {Collector, Regulator, _SCCtoPID}) ->
+ Regulator ! done,
+ Collector ! {done, Job, Result},
+ ok.
+
+-spec get_next_label(integer(), coordinator()) -> integer().
+
+get_next_label(EstimatedSize, {Collector, _Regulator, _SCCtoPID}) ->
+ Collector ! {next_label_request, EstimatedSize, self()},
+ receive
+ {next_label_reply, NextLabel} -> NextLabel
+ end.
+
+-spec wait_activation() -> ok.
+
+wait_activation() ->
+ receive activate -> ok end.
+
+activate_pid(Pid) ->
+ Pid ! activate.
+
+-spec request_activation(coordinator()) -> ok.
+
+request_activation({_Collector, Regulator, _SCCtoPID}) ->
+ Regulator ! {req, self()},
+ wait_activation().
+
+request_activation(Regulator, Pid) ->
+ Regulator ! {req, Pid},
+ ok.
+
+spawn_regulator() ->
+ InitTickets = dialyzer_utils:parallelism(),
+ spawn_link(fun() -> regulator_loop(InitTickets, queue:new()) end).
+
+regulator_loop(Tickets, Queue) ->
+ receive
+ {req, Pid} ->
+ case Tickets of
+ 0 ->
+ regulator_loop(0, queue:in(Pid, Queue));
+ N ->
+ activate_pid(Pid),
+ regulator_loop(N-1, Queue)
+ end;
+ done ->
+ {Waiting, NewQueue} = queue:out(Queue),
+ NewTickets =
+ case Waiting of
+ empty -> Tickets + 1;
+ {value, Pid} ->
+ activate_pid(Pid),
+ Tickets
+ end,
+ regulator_loop(NewTickets, NewQueue);
+ stop -> ok
+ end.
+
+kill_regulator(Regulator) ->
+ Regulator ! stop.
diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl
index 6008dba080..6956850f1a 100644
--- a/lib/dialyzer/src/dialyzer_dataflow.erl
+++ b/lib/dialyzer/src/dialyzer_dataflow.erl
@@ -2,7 +2,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -32,13 +32,11 @@
%% Data structure interfaces.
-export([state__add_warning/2, state__cleanup/1,
+ state__duplicate/1, dispose_state/1,
state__get_callgraph/1, state__get_races/1,
state__get_records/1, state__put_callgraph/2,
state__put_races/2, state__records_only/1]).
-%% Debug and test interfaces.
--export([get_top_level_signatures/2, pp/1]).
-
-export_type([state/0]).
-include("dialyzer.hrl").
@@ -68,7 +66,6 @@
%%-define(DEBUG, true).
%%-define(DEBUG_PP, true).
%%-define(DEBUG_TIME, true).
-%%-define(DOT, true).
-ifdef(DEBUG).
-import(erl_types, [t_to_string/1]).
@@ -77,9 +74,6 @@
-define(debug(S_, L_), ok).
-endif.
-%%-define(debug1(S_, L_), io:format(S_, L_)).
-%%-define(debug1(S_, L_), ok).
-
%%--------------------------------------------------------------------
-define(no_arg, no_arg).
@@ -97,9 +91,8 @@
warning_mode = false :: boolean(),
warnings = [] :: [dial_warning()],
work :: {[_], [_], set()},
- module :: module(),
- behaviour_api_dict = [] ::
- dialyzer_behaviours:behaviour_api_dict()}).
+ module :: module()
+ }).
-record(map, {dict = dict:new() :: dict(),
subst = dict:new() :: dict(),
@@ -115,7 +108,7 @@
-spec get_warnings(cerl:c_module(), dialyzer_plt:plt(),
dialyzer_callgraph:callgraph(), dict(), set()) ->
- {[dial_warning()], dict(), dict(), [label()], [string()]}.
+ {[dial_warning()], dict()}.
get_warnings(Tree, Plt, Callgraph, Records, NoWarnUnused) ->
State1 = analyze_module(Tree, Plt, Callgraph, Records, true),
@@ -123,145 +116,14 @@ get_warnings(Tree, Plt, Callgraph, Records, NoWarnUnused) ->
State3 =
state__renew_warnings(state__get_warnings(State2, NoWarnUnused), State2),
State4 = state__get_race_warnings(State3),
- Callgraph1 = State2#state.callgraph,
- {State4#state.warnings, state__all_fun_types(State4),
- dialyzer_callgraph:get_race_code(Callgraph1),
- dialyzer_callgraph:get_public_tables(Callgraph1),
- dialyzer_callgraph:get_named_tables(Callgraph1)}.
+ {State4#state.warnings, state__all_fun_types(State4)}.
-spec get_fun_types(cerl:c_module(), dialyzer_plt:plt(),
- dialyzer_callgraph:callgraph(), dict()) ->
- {dict(), dict(), [label()], [string()]}.
+ dialyzer_callgraph:callgraph(), dict()) -> dict().
get_fun_types(Tree, Plt, Callgraph, Records) ->
State = analyze_module(Tree, Plt, Callgraph, Records, false),
- Callgraph1 = State#state.callgraph,
- {state__all_fun_types(State),
- dialyzer_callgraph:get_race_code(Callgraph1),
- dialyzer_callgraph:get_public_tables(Callgraph1),
- dialyzer_callgraph:get_named_tables(Callgraph1)}.
-
-%%--------------------------------------------------------------------
-
--spec pp(file:filename()) -> 'ok'.
-
-pp(File) ->
- {ok, Code} = dialyzer_utils:get_core_from_src(File, [no_copt]),
- Plt = get_def_plt(),
- AnnTree = annotate_module(Code, Plt),
- io:put_chars(cerl_prettypr:format(AnnTree, [{hook, cerl_typean:pp_hook()}])),
- io:nl().
-
-%%--------------------------------------------------------------------
-%% This is used in the testsuite.
-
--spec get_top_level_signatures(cerl:c_module(), dict()) ->
- [{{atom(), arity()}, erl_types:erl_type()}].
-
-get_top_level_signatures(Code, Records) ->
- {Tree, _} = cerl_trees:label(cerl:from_records(Code)),
- Callgraph0 = dialyzer_callgraph:new(),
- Callgraph1 = dialyzer_callgraph:scan_core_tree(Tree, Callgraph0),
- {Callgraph2, _} = dialyzer_callgraph:remove_external(Callgraph1),
- Callgraph = dialyzer_callgraph:finalize(Callgraph2),
- to_dot(Callgraph),
- Plt = get_def_plt(),
- FunTypes = get_fun_types(Tree, Plt, Callgraph, Records),
- FunTypes1 = lists:foldl(fun({V, F}, Acc) ->
- Label = get_label(F),
- case dict:find(Label, Acc) of
- error ->
- Arity = cerl:fname_arity(V),
- Type = t_fun(lists:duplicate(Arity,
- t_none()),
- t_none()),
- dict:store(Label, Type, Acc);
- {ok, _} -> Acc
- end
- end, FunTypes, cerl:module_defs(Tree)),
- dialyzer_callgraph:delete(Callgraph),
- Sigs = [{{cerl:fname_id(V), cerl:fname_arity(V)},
- dict:fetch(get_label(F), FunTypes1)}
- || {V, F} <- cerl:module_defs(Tree)],
- ordsets:from_list(Sigs).
-
-get_def_plt() ->
- try
- dialyzer_plt:from_file(dialyzer_plt:get_default_plt())
- catch
- throw:{dialyzer_error, _} -> dialyzer_plt:new()
- end.
-
-%%% ===========================================================================
-%%%
-%%% Annotate all top level funs.
-%%%
-%%% ===========================================================================
-
-annotate_module(Code, Plt) ->
- {Tree, _} = cerl_trees:label(cerl:from_records(Code)),
- Callgraph0 = dialyzer_callgraph:new(),
- Callgraph1 = dialyzer_callgraph:scan_core_tree(Tree, Callgraph0),
- {Callgraph2, _} = dialyzer_callgraph:remove_external(Callgraph1),
- Callgraph = dialyzer_callgraph:finalize(Callgraph2),
- State = analyze_module(Tree, Plt, Callgraph),
- Res = annotate(Tree, State),
- dialyzer_callgraph:delete(Callgraph),
- Res.
-
-annotate(Tree, State) ->
- case cerl:subtrees(Tree) of
- [] -> set_type(Tree, State);
- List ->
- NewSubTrees = [[annotate(Subtree, State) || Subtree <- Group]
- || Group <- List],
- NewTree = cerl:update_tree(Tree, NewSubTrees),
- set_type(NewTree, State)
- end.
-
-set_type(Tree, State) ->
- case cerl:type(Tree) of
- 'fun' ->
- Type = state__fun_type(Tree, State),
- case t_is_any(Type) of
- true ->
- cerl:set_ann(Tree, delete_ann(typesig, cerl:get_ann(Tree)));
- false ->
- cerl:set_ann(Tree, append_ann(typesig, Type, cerl:get_ann(Tree)))
- end;
- apply ->
- case state__find_apply_return(Tree, State) of
- unknown -> Tree;
- ReturnType ->
- case t_is_any(ReturnType) of
- true ->
- cerl:set_ann(Tree, delete_ann(type, cerl:get_ann(Tree)));
- false ->
- cerl:set_ann(Tree, append_ann(type, ReturnType,
- cerl:get_ann(Tree)))
- end
- end;
- _ ->
- Tree
- end.
-
-append_ann(Tag, Val, [X | Xs]) ->
- if tuple_size(X) >= 1, element(1, X) =:= Tag ->
- append_ann(Tag, Val, Xs);
- true ->
- [X | append_ann(Tag, Val, Xs)]
- end;
-append_ann(Tag, Val, []) ->
- [{Tag, Val}].
-
-delete_ann(Tag, [X | Xs]) ->
- if tuple_size(X) >= 1, element(1, X) =:= Tag ->
- delete_ann(Tag, Xs);
- true ->
- [X | delete_ann(Tag, Xs)]
- end;
-delete_ann(_, []) ->
- [].
+ state__all_fun_types(State).
%%% ===========================================================================
%%%
@@ -269,86 +131,51 @@ delete_ann(_, []) ->
%%%
%%% ===========================================================================
-analyze_module(Tree, Plt, Callgraph) ->
- analyze_module(Tree, Plt, Callgraph, dict:new(), false).
-
analyze_module(Tree, Plt, Callgraph, Records, GetWarnings) ->
debug_pp(Tree, false),
Module = cerl:atom_val(cerl:module_name(Tree)),
- RaceDetection = dialyzer_callgraph:get_race_detection(Callgraph),
- BehaviourTranslations =
- case RaceDetection of
- true -> dialyzer_behaviours:translatable_behaviours(Tree);
- false -> []
- end,
TopFun = cerl:ann_c_fun([{label, top}], [], Tree),
- State = state__new(dialyzer_callgraph:race_code_new(Callgraph),
- TopFun, Plt, Module, Records, BehaviourTranslations),
+ State = state__new(Callgraph, TopFun, Plt, Module, Records),
State1 = state__race_analysis(not GetWarnings, State),
State2 = analyze_loop(State1),
- RaceCode = dialyzer_callgraph:get_race_code(Callgraph),
- Callgraph1 = State2#state.callgraph,
- RaceCode1 = dialyzer_callgraph:get_race_code(Callgraph1),
case GetWarnings of
true ->
State3 = state__set_warning_mode(State2),
State4 = analyze_loop(State3),
- State5 = state__restore_race_code(RaceCode, State4),
-
- %% EXPERIMENTAL: Turn all behaviour API calls into calls to the
- %% respective callback module's functions.
-
- case BehaviourTranslations of
- [] -> dialyzer_races:race(State5);
- Behaviours ->
- Callgraph2 = State5#state.callgraph,
- Digraph = dialyzer_callgraph:get_digraph(Callgraph2),
- TranslatedCallgraph =
- dialyzer_behaviours:translate_callgraph(Behaviours, Module,
- Callgraph2),
- St =
- dialyzer_races:race(State5#state{callgraph = TranslatedCallgraph}),
- Callgraph3 = dialyzer_callgraph:put_digraph(Digraph,
- St#state.callgraph),
- St#state{callgraph = Callgraph3}
- end;
+ dialyzer_races:race(State4);
false ->
- state__restore_race_code(
- dict:merge(fun (_K, V1, _V2) -> V1 end,
- RaceCode, RaceCode1), State2)
+ State2
end.
-analyze_loop(#state{callgraph = Callgraph, races = Races} = State) ->
+analyze_loop(State) ->
case state__get_work(State) of
- none -> state__clean_not_called(State);
- {Fun, NewState} ->
- ArgTypes = state__get_args(Fun, NewState),
- case any_none(ArgTypes) of
+ none -> State;
+ {Fun, NewState1} ->
+ {ArgTypes, IsCalled} = state__get_args_and_status(Fun, NewState1),
+ case not IsCalled of
true ->
- ?debug("Not handling1 ~w: ~s\n",
+ ?debug("Not handling (not called) ~w: ~s\n",
[state__lookup_name(get_label(Fun), State),
t_to_string(t_product(ArgTypes))]),
- analyze_loop(NewState);
+ analyze_loop(NewState1);
false ->
- case state__fun_env(Fun, NewState) of
+ case state__fun_env(Fun, NewState1) of
none ->
- ?debug("Not handling2 ~w: ~s\n",
+ ?debug("Not handling (no env) ~w: ~s\n",
[state__lookup_name(get_label(Fun), State),
t_to_string(t_product(ArgTypes))]),
- analyze_loop(NewState);
+ analyze_loop(NewState1);
Map ->
?debug("Handling fun ~p: ~s\n",
[state__lookup_name(get_label(Fun), State),
- t_to_string(state__fun_type(Fun, NewState))]),
- NewState1 = state__mark_fun_as_handled(NewState, Fun),
+ t_to_string(state__fun_type(Fun, NewState1))]),
Vars = cerl:fun_vars(Fun),
Map1 = enter_type_lists(Vars, ArgTypes, Map),
Body = cerl:fun_body(Fun),
FunLabel = get_label(Fun),
- RaceDetection = dialyzer_callgraph:get_race_detection(Callgraph),
- RaceAnalysis = dialyzer_races:get_race_analysis(Races),
+ IsRaceAnalysisEnabled = is_race_analysis_enabled(State),
NewState3 =
- case RaceDetection andalso RaceAnalysis of
+ case IsRaceAnalysisEnabled of
true ->
NewState2 = state__renew_curr_fun(
state__lookup_name(FunLabel, NewState1), FunLabel,
@@ -362,17 +189,8 @@ analyze_loop(#state{callgraph = Callgraph, races = Races} = State) ->
[state__lookup_name(get_label(Fun), State),
t_to_string(t_fun(ArgTypes, BodyType))]),
NewState5 =
- case RaceDetection andalso RaceAnalysis of
- true ->
- Races1 = NewState4#state.races,
- Code = lists:reverse(dialyzer_races:get_race_list(Races1)),
- Callgraph1 =
- renew_code(dialyzer_races:get_curr_fun(Races1),
- dialyzer_races:get_curr_fun_args(Races1),
- Code,
- state__warning_mode(NewState4),
- NewState4#state.callgraph),
- NewState4#state{callgraph = Callgraph1};
+ case IsRaceAnalysisEnabled of
+ true -> renew_race_code(NewState4);
false -> NewState4
end,
NewState6 =
@@ -587,9 +405,7 @@ handle_apply_or_call([{local, external}|Left], Args, ArgTypes, Map, Tree, State,
ArgTypes, t_any());
handle_apply_or_call([{TypeOfApply, {Fun, Sig, Contr, LocalRet}}|Left],
Args, ArgTypes, Map, Tree,
- #state{callgraph = Callgraph, races = Races,
- opaques = Opaques} = State,
- AccArgTypes, AccRet) ->
+ #state{opaques = Opaques} = State, AccArgTypes, AccRet) ->
Any = t_any(),
AnyArgs = [Any || _ <- Args],
GenSig = {AnyArgs, fun(_) -> t_any() end},
@@ -685,27 +501,13 @@ handle_apply_or_call([{TypeOfApply, {Fun, Sig, Contr, LocalRet}}|Left],
?debug("ContrRet: ~s\n", [erl_types:t_to_string(CRange(TmpArgTypes))]),
?debug("SigRet: ~s\n", [erl_types:t_to_string(SigRange)]),
State1 =
- case dialyzer_callgraph:get_race_detection(Callgraph) andalso
- dialyzer_races:get_race_analysis(Races) of
+ case is_race_analysis_enabled(State) of
true ->
Ann = cerl:get_ann(Tree),
File = get_file(Ann),
Line = abs(get_line(Ann)),
-
- %% EXPERIMENTAL: Turn a behaviour's API call into a call to the
- %% respective callback module's function.
-
- Module = State#state.module,
- BehApiDict = State#state.behaviour_api_dict,
- {RealFun, RealArgTypes, RealArgs} =
- case dialyzer_behaviours:translate_behaviour_api_call(Fun, ArgTypes,
- Args, Module,
- BehApiDict) of
- plain_call -> {Fun, ArgTypes, Args};
- BehaviourAPI -> BehaviourAPI
- end,
- dialyzer_races:store_race_call(RealFun, RealArgTypes, RealArgs,
- {File, Line}, State);
+ dialyzer_races:store_race_call(Fun, ArgTypes, Args,
+ {File, Line}, State);
false -> State
end,
FailedConj = any_none([RetWithoutLocal|NewArgTypes]),
@@ -766,7 +568,13 @@ handle_apply_or_call([{TypeOfApply, {Fun, Sig, Contr, LocalRet}}|Left],
true -> AccArgTypes;
false -> [t_sup(X, Y) || {X, Y} <- lists:zip(NewArgTypes, AccArgTypes)]
end,
- NewAccRet = t_sup(AccRet, t_inf(RetWithoutLocal, LocalRet, opaque)),
+ TotalRet =
+ case t_is_none(LocalRet) andalso t_is_unit(RetWithoutLocal) of
+ true -> RetWithoutLocal;
+ false -> t_inf(RetWithoutLocal, LocalRet, opaque)
+ end,
+ NewAccRet = t_sup(AccRet, TotalRet),
+ ?debug("NewAccRet: ~s\n", [t_to_string(NewAccRet)]),
handle_apply_or_call(Left, Args, ArgTypes, Map, Tree,
State3, NewAccArgTypes, NewAccRet);
handle_apply_or_call([], Args, _ArgTypes, Map, _Tree, State,
@@ -1046,20 +854,17 @@ handle_call(Tree, Map, State) ->
%%----------------------------------------
-handle_case(Tree, Map, #state{callgraph = Callgraph} = State) ->
+handle_case(Tree, Map, State) ->
Arg = cerl:case_arg(Tree),
Clauses = filter_match_fail(cerl:case_clauses(Tree)),
{State1, Map1, ArgType} = SMA = traverse(Arg, Map, State),
case t_is_none_or_unit(ArgType) of
true -> SMA;
false ->
- Races = State1#state.races,
State2 =
- case dialyzer_callgraph:get_race_detection(Callgraph) andalso
- dialyzer_races:get_race_analysis(Races) of
+ case is_race_analysis_enabled(State) of
true ->
- RaceList = dialyzer_races:get_race_list(Races),
- RaceListSize = dialyzer_races:get_race_list_size(Races),
+ {RaceList, RaceListSize} = get_race_list_and_size(State1),
state__renew_race_list([beg_case|RaceList],
RaceListSize + 1, State1);
false -> State1
@@ -1093,9 +898,8 @@ handle_cons(Tree, Map, State) ->
%%----------------------------------------
-handle_let(Tree, Map, #state{callgraph = Callgraph, races = Races} = State) ->
- RaceAnalysis = dialyzer_races:get_race_analysis(Races),
- RaceDetection = dialyzer_callgraph:get_race_detection(Callgraph),
+handle_let(Tree, Map, State) ->
+ IsRaceAnalysisEnabled = is_race_analysis_enabled(State),
Arg = cerl:let_arg(Tree),
Vars = cerl:let_vars(Tree),
{Map0, State0} =
@@ -1103,10 +907,9 @@ handle_let(Tree, Map, #state{callgraph = Callgraph, races = Races} = State) ->
true ->
[Var] = Vars,
{enter_subst(Var, Arg, Map),
- case RaceDetection andalso RaceAnalysis of
+ case IsRaceAnalysisEnabled of
true ->
- RaceList = dialyzer_races:get_race_list(Races),
- RaceListSize = dialyzer_races:get_race_list_size(Races),
+ {RaceList, RaceListSize} = get_race_list_and_size(State),
state__renew_race_list(
[dialyzer_races:let_tag_new(Var, Arg)|RaceList],
RaceListSize + 1, State);
@@ -1116,9 +919,8 @@ handle_let(Tree, Map, #state{callgraph = Callgraph, races = Races} = State) ->
end,
Body = cerl:let_body(Tree),
{State1, Map1, ArgTypes} = SMA = traverse(Arg, Map0, State0),
- Callgraph1 = State1#state.callgraph,
- Callgraph2 =
- case RaceDetection andalso RaceAnalysis andalso cerl:is_c_call(Arg) of
+ State2 =
+ case IsRaceAnalysisEnabled andalso cerl:is_c_call(Arg) of
true ->
Mod = cerl:call_module(Arg),
Name = cerl:call_name(Arg),
@@ -1126,16 +928,11 @@ handle_let(Tree, Map, #state{callgraph = Callgraph, races = Races} = State) ->
cerl:concrete(Mod) =:= ets andalso
cerl:is_literal(Name) andalso
cerl:concrete(Name) =:= new of
- true ->
- NewTable = dialyzer_races:get_new_table(State1#state.races),
- renew_public_tables(Vars, NewTable,
- state__warning_mode(State1),
- Callgraph1);
- false -> Callgraph1
+ true -> renew_race_public_tables(Vars, State1);
+ false -> State1
end;
- false -> Callgraph1
+ false -> State1
end,
- State2 = State1#state{callgraph = Callgraph2},
case t_is_none_or_unit(ArgTypes) of
true -> SMA;
false ->
@@ -1166,16 +963,13 @@ handle_module(Tree, Map, State) ->
%%----------------------------------------
-handle_receive(Tree, Map,
- #state{callgraph = Callgraph, races = Races} = State) ->
+handle_receive(Tree, Map, State) ->
Clauses = filter_match_fail(cerl:receive_clauses(Tree)),
Timeout = cerl:receive_timeout(Tree),
State1 =
- case dialyzer_callgraph:get_race_detection(Callgraph) andalso
- dialyzer_races:get_race_analysis(Races) of
+ case is_race_analysis_enabled(State) of
true ->
- RaceList = dialyzer_races:get_race_list(Races),
- RaceListSize = dialyzer_races:get_race_list_size(Races),
+ {RaceList, RaceListSize} = get_race_list_and_size(State),
state__renew_race_list([beg_case|RaceList],
RaceListSize + 1, State);
false -> State
@@ -1298,16 +1092,13 @@ handle_tuple(Tree, Map, State) ->
%%----------------------------------------
%% Clauses
%%
-handle_clauses([C|Left], Arg, ArgType, OrigArgType,
- #state{callgraph = Callgraph, races = Races} = State,
- CaseTypes, MapIn, Acc, ClauseAcc) ->
- RaceDetection = dialyzer_callgraph:get_race_detection(Callgraph),
- RaceAnalysis = dialyzer_races:get_race_analysis(Races),
+handle_clauses([C|Left], Arg, ArgType, OrigArgType, State, CaseTypes, MapIn,
+ Acc, ClauseAcc) ->
+ IsRaceAnalysisEnabled = is_race_analysis_enabled(State),
State1 =
- case RaceDetection andalso RaceAnalysis of
+ case IsRaceAnalysisEnabled of
true ->
- RaceList = dialyzer_races:get_race_list(Races),
- RaceListSize = dialyzer_races:get_race_list_size(Races),
+ {RaceList, RaceListSize} = get_race_list_and_size(State),
state__renew_race_list(
[dialyzer_races:beg_clause_new(Arg, cerl:clause_pats(C),
cerl:clause_guard(C))|
@@ -1318,11 +1109,9 @@ handle_clauses([C|Left], Arg, ArgType, OrigArgType,
{State2, ClauseMap, BodyType, NewArgType} =
do_clause(C, Arg, ArgType, OrigArgType, MapIn, State1),
{NewClauseAcc, State3} =
- case RaceDetection andalso RaceAnalysis of
+ case IsRaceAnalysisEnabled of
true ->
- Races1 = State2#state.races,
- RaceList1 = dialyzer_races:get_race_list(Races1),
- RaceListSize1 = dialyzer_races:get_race_list_size(Races1),
+ {RaceList1, RaceListSize1} = get_race_list_and_size(State2),
EndClause = dialyzer_races:end_clause_new(Arg, cerl:clause_pats(C),
cerl:clause_guard(C)),
{[EndClause|ClauseAcc],
@@ -1337,30 +1126,25 @@ handle_clauses([C|Left], Arg, ArgType, OrigArgType,
end,
handle_clauses(Left, Arg, NewArgType, OrigArgType, State3,
NewCaseTypes, MapIn, NewAcc, NewClauseAcc);
-handle_clauses([], _Arg, _ArgType, _OrigArgType,
- #state{callgraph = Callgraph, races = Races} = State,
- CaseTypes, _MapIn, Acc, ClauseAcc) ->
+handle_clauses([], _Arg, _ArgType, _OrigArgType, State, CaseTypes, _MapIn, Acc,
+ ClauseAcc) ->
State1 =
- case dialyzer_callgraph:get_race_detection(Callgraph) andalso
- dialyzer_races:get_race_analysis(Races) of
+ case is_race_analysis_enabled(State) of
true ->
+ {RaceList, RaceListSize} = get_race_list_and_size(State),
state__renew_race_list(
- [dialyzer_races:end_case_new(ClauseAcc)|
- dialyzer_races:get_race_list(Races)],
- dialyzer_races:get_race_list_size(Races) + 1, State);
+ [dialyzer_races:end_case_new(ClauseAcc)|RaceList],
+ RaceListSize + 1, State);
false -> State
end,
{lists:reverse(Acc), State1, t_sup(CaseTypes)}.
-do_clause(C, Arg, ArgType0, OrigArgType, Map,
- #state{callgraph = Callgraph, races = Races} = State) ->
+do_clause(C, Arg, ArgType0, OrigArgType, Map, State) ->
Pats = cerl:clause_pats(C),
Guard = cerl:clause_guard(C),
Body = cerl:clause_body(C),
- RaceDetection = dialyzer_callgraph:get_race_detection(Callgraph),
- RaceAnalysis = dialyzer_races:get_race_analysis(Races),
State1 =
- case RaceDetection andalso RaceAnalysis of
+ case is_race_analysis_enabled(State) of
true ->
state__renew_fun_args(Pats, State);
false -> State
@@ -2647,14 +2431,18 @@ join_maps(Maps, MapOut) ->
Keys = ordsets:from_list(dict:fetch_keys(Dict) ++ dict:fetch_keys(Subst)),
join_maps(Keys, Maps, MapOut).
-join_maps([Key|Left], Maps, MapOut) ->
+join_maps(Keys, Maps, MapOut) ->
+ KTs = join_maps_collect(Keys, Maps, MapOut),
+ lists:foldl(fun({K, T}, M) -> enter_type(K, T, M) end, MapOut, KTs).
+
+join_maps_collect([Key|Left], Maps, MapOut) ->
Type = join_maps_one_key(Maps, Key, t_none()),
case t_is_equal(lookup_type(Key, MapOut), Type) of
- true -> join_maps(Left, Maps, MapOut);
- false -> join_maps(Left, Maps, enter_type(Key, Type, MapOut))
+ true -> join_maps_collect(Left, Maps, MapOut);
+ false -> [{Key, Type} | join_maps_collect(Left, Maps, MapOut)]
end;
-join_maps([], _Maps, MapOut) ->
- MapOut.
+join_maps_collect([], _Maps, _MapOut) ->
+ [].
join_maps_one_key([Map|Left], Key, AccType) ->
case t_is_any(AccType) of
@@ -2886,43 +2674,33 @@ determine_mode(Type, Opaques) ->
%%%
%%% ===========================================================================
-state__new(Callgraph, Tree, Plt, Module, Records, BehaviourTranslations) ->
+state__new(Callgraph, Tree, Plt, Module, Records) ->
Opaques = erl_types:module_builtin_opaques(Module) ++
erl_types:t_opaque_from_records(Records),
TreeMap = build_tree_map(Tree),
Funs = dict:fetch_keys(TreeMap),
FunTab = init_fun_tab(Funs, dict:new(), TreeMap, Callgraph, Plt, Opaques),
- Work = init_work([get_label(Tree)]),
- Env = dict:store(top, map__new(), dict:new()),
+ ExportedFuns =
+ [Fun || Fun <- Funs--[top], dialyzer_callgraph:is_escaping(Fun, Callgraph)],
+ Work = init_work(ExportedFuns),
+ Env = lists:foldl(fun(Fun, Env) -> dict:store(Fun, map__new(), Env) end,
+ dict:new(), Funs),
#state{callgraph = Callgraph, envs = Env, fun_tab = FunTab, opaques = Opaques,
plt = Plt, races = dialyzer_races:new(), records = Records,
warning_mode = false, warnings = [], work = Work, tree_map = TreeMap,
- module = Module, behaviour_api_dict = BehaviourTranslations}.
-
-state__mark_fun_as_handled(#state{fun_tab = FunTab} = State, Fun0) ->
- Fun = get_label(Fun0),
- case dict:find(Fun, FunTab) of
- {ok, {not_handled, Entry}} ->
- State#state{fun_tab = dict:store(Fun, Entry, FunTab)};
- {ok, {_, _}} ->
- State
- end.
+ module = Module}.
state__warning_mode(#state{warning_mode = WM}) ->
WM.
state__set_warning_mode(#state{tree_map = TreeMap, fun_tab = FunTab,
races = Races} = State) ->
- ?debug("Starting warning pass\n", []),
+ ?debug("==========\nStarting warning pass\n==========\n", []),
Funs = dict:fetch_keys(TreeMap),
State#state{work = init_work([top|Funs--[top]]),
fun_tab = FunTab, warning_mode = true,
races = dialyzer_races:put_race_analysis(true, Races)}.
-state__restore_race_code(RaceCode, #state{callgraph = Callgraph} = State) ->
- State#state{callgraph = dialyzer_callgraph:put_race_code(RaceCode,
- Callgraph)}.
-
state__race_analysis(Analysis, #state{races = Races} = State) ->
State#state{races = dialyzer_races:put_race_analysis(Analysis, Races)}.
@@ -2985,13 +2763,13 @@ state__get_warnings(#state{tree_map = TreeMap, fun_tab = FunTab,
{NotCalled, Ret} =
case dict:fetch(get_label(Fun), FunTab) of
{not_handled, {_Args0, Ret0}} -> {true, Ret0};
- {Args0, Ret0} -> {any_none(Args0), Ret0}
+ {_Args0, Ret0} -> {false, Ret0}
end,
case NotCalled of
true ->
{Warn, Msg} =
case dialyzer_callgraph:lookup_name(FunLbl, Callgraph) of
- error -> {true, {unused_fun, []}};
+ error -> {false, {}};
{ok, {_M, F, A} = MFA} ->
{not sets:is_element(MFA, NoWarnUnused),
{unused_fun, [F, A]}}
@@ -3079,11 +2857,11 @@ state__lookup_record(Tag, Arity, #state{records = Records}) ->
error
end.
-state__get_args(Tree, #state{fun_tab = FunTab}) ->
+state__get_args_and_status(Tree, #state{fun_tab = FunTab}) ->
Fun = get_label(Tree),
case dict:find(Fun, FunTab) of
- {ok, {not_handled, {ArgTypes, _}}} -> ArgTypes;
- {ok, {ArgTypes, _}} -> ArgTypes
+ {ok, {not_handled, {ArgTypes, _}}} -> {ArgTypes, false};
+ {ok, {ArgTypes, _}} -> {ArgTypes, true}
end.
build_tree_map(Tree) ->
@@ -3099,7 +2877,7 @@ build_tree_map(Tree) ->
cerl_trees:fold(Fun, dict:new(), Tree).
init_fun_tab([top|Left], Dict, TreeMap, Callgraph, Plt, Opaques) ->
- NewDict = dict:store(top, {not_handled, {[], t_none()}}, Dict),
+ NewDict = dict:store(top, {[], t_none()}, Dict),
init_fun_tab(Left, NewDict, TreeMap, Callgraph, Plt, Opaques);
init_fun_tab([Fun|Left], Dict, TreeMap, Callgraph, Plt, Opaques) ->
Arity = cerl:fun_arity(dict:fetch(Fun, TreeMap)),
@@ -3115,11 +2893,12 @@ init_fun_tab([Fun|Left], Dict, TreeMap, Callgraph, Plt, Opaques) ->
false -> {Args, t_unit()}
end
end;
- false -> {lists:duplicate(Arity, t_none()), t_unit()}
+ false -> {not_handled, {lists:duplicate(Arity, t_none()), t_unit()}}
end,
- NewDict = dict:store(Fun, {not_handled, FunEntry}, Dict),
+ NewDict = dict:store(Fun, FunEntry, Dict),
init_fun_tab(Left, NewDict, TreeMap, Callgraph, Plt, Opaques);
init_fun_tab([], Dict, _TreeMap, _Callgraph, _Plt, _Opaques) ->
+ ?debug("DICT:~p\n",[dict:to_list(Dict)]),
Dict.
state__update_fun_env(Tree, Map, #state{envs = Envs} = State) ->
@@ -3141,7 +2920,8 @@ state__clean_not_called(#state{fun_tab = FunTab} = State) ->
end, FunTab),
State#state{fun_tab = NewFunTab}.
-state__all_fun_types(#state{fun_tab = FunTab}) ->
+state__all_fun_types(State) ->
+ #state{fun_tab = FunTab} = state__clean_not_called(State),
Tab1 = dict:erase(top, FunTab),
dict:map(fun(_Fun, {Args, Ret}) -> t_fun(Args, Ret)end, Tab1).
@@ -3150,7 +2930,9 @@ state__fun_type(Fun, #state{fun_tab = FunTab}) ->
if is_integer(Fun) -> Fun;
true -> get_label(Fun)
end,
- case dict:find(Label, FunTab) of
+ Entry = dict:find(Label, FunTab),
+ ?debug("FunType ~p:~p\n",[Label, Entry]),
+ case Entry of
{ok, {not_handled, {A, R}}} ->
t_fun(A, R);
{ok, {A, R}} ->
@@ -3258,23 +3040,9 @@ state__fun_info(Fun, #state{callgraph = CG, fun_tab = FunTab, plt = PLT}) ->
{not_handled, {_Args, Ret}} -> Ret;
{_Args, Ret} -> Ret
end,
+ ?debug("LocalRet: ~s\n", [t_to_string(LocalRet)]),
{Fun, Sig, Contract, LocalRet}.
-state__find_apply_return(Tree, #state{callgraph = Callgraph} = State) ->
- Apply = get_label(Tree),
- case dialyzer_callgraph:lookup_call_site(Apply, Callgraph) of
- error ->
- unknown;
- {ok, List} ->
- case lists:member(external, List) of
- true -> t_any();
- false ->
- FunTypes = [state__fun_type(F, State) || F <- List],
- Returns = [t_fun_range(F) || F <- FunTypes],
- t_sup(Returns)
- end
- end.
-
forward_args(Fun, ArgTypes, #state{work = Work, fun_tab = FunTab} = State) ->
{OldArgTypes, OldOut, Fixpoint} =
case dict:find(Fun, FunTab) of
@@ -3305,6 +3073,16 @@ state__cleanup(#state{callgraph = Callgraph,
races = dialyzer_races:cleanup(Races),
records = Records}.
+-spec state__duplicate(state()) -> state().
+
+state__duplicate(#state{callgraph = Callgraph} = State) ->
+ State#state{callgraph = dialyzer_callgraph:duplicate(Callgraph)}.
+
+-spec dispose_state(state()) -> ok.
+
+dispose_state(#state{callgraph = Callgraph}) ->
+ dialyzer_callgraph:dispose_race_server(Callgraph).
+
-spec state__get_callgraph(state()) -> dialyzer_callgraph:callgraph().
state__get_callgraph(#state{callgraph = Callgraph}) ->
@@ -3342,26 +3120,36 @@ state__records_only(#state{records = Records}) ->
%%%
%%% ===========================================================================
-renew_code(Fun, FunArgs, Code, WarningMode, Callgraph) ->
+is_race_analysis_enabled(#state{races = Races, callgraph = Callgraph}) ->
+ RaceDetection = dialyzer_callgraph:get_race_detection(Callgraph),
+ RaceAnalysis = dialyzer_races:get_race_analysis(Races),
+ RaceDetection andalso RaceAnalysis.
+
+get_race_list_and_size(#state{races = Races}) ->
+ dialyzer_races:get_race_list_and_size(Races).
+
+renew_race_code(#state{races = Races, callgraph = Callgraph,
+ warning_mode = WarningMode} = State) ->
case WarningMode of
- true -> Callgraph;
+ true -> State;
false ->
- RaceCode = dialyzer_callgraph:get_race_code(Callgraph),
- dialyzer_callgraph:put_race_code(
- dict:store(Fun, [FunArgs, Code], RaceCode), Callgraph)
+ NewCallgraph = dialyzer_callgraph:renew_race_code(Races, Callgraph),
+ State#state{callgraph = NewCallgraph}
end.
-renew_public_tables([Var], Table, WarningMode, Callgraph) ->
+renew_race_public_tables([Var], #state{races = Races, callgraph = Callgraph,
+ warning_mode = WarningMode} = State) ->
case WarningMode of
- true -> Callgraph;
+ true -> State;
false ->
+ Table = dialyzer_races:get_new_table(Races),
case Table of
- no_t -> Callgraph;
- _Other ->
- VarLabel = get_label(Var),
- PTables = dialyzer_callgraph:get_public_tables(Callgraph),
- dialyzer_callgraph:put_public_tables(
- lists:usort([VarLabel|PTables]), Callgraph)
+ no_t -> State;
+ _Other ->
+ VarLabel = get_label(Var),
+ NewCallgraph =
+ dialyzer_callgraph:renew_race_public_tables(VarLabel, Callgraph),
+ State#state{callgraph = NewCallgraph}
end
end.
@@ -3688,17 +3476,3 @@ strip_annotations(Tree) ->
debug_pp(_Tree, _UseHook) ->
ok.
-endif.
-
-%%----------------------------------------------------------------------------
-
--spec to_dot(dialyzer_callgraph:callgraph()) -> 'ok'.
-
--ifdef(DOT).
-to_dot(CG) ->
- dialyzer_callgraph:to_dot(CG).
--else.
-to_dot(_CG) ->
- ok.
--endif.
-
-%%----------------------------------------------------------------------------
diff --git a/lib/dialyzer/src/dialyzer_gui.erl b/lib/dialyzer/src/dialyzer_gui.erl
index ccd80a4835..ac9844c22c 100644
--- a/lib/dialyzer/src/dialyzer_gui.erl
+++ b/lib/dialyzer/src/dialyzer_gui.erl
@@ -2,7 +2,7 @@
%%------------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -28,6 +28,23 @@
%%%-----------------------------------------------------------------------
-module(dialyzer_gui).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,editor,2}},
+ {nowarn_deprecated_function,{gs,entry,2}},
+ {nowarn_deprecated_function,{gs,frame,2}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,listbox,2}},
+ {nowarn_deprecated_function,{gs,menu,2}},
+ {nowarn_deprecated_function,{gs,menubar,2}},
+ {nowarn_deprecated_function,{gs,menubutton,2}},
+ {nowarn_deprecated_function,{gs,menuitem,2}},
+ {nowarn_deprecated_function,{gs,radiobutton,2}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,stop,0}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
-export([start/1]).
@@ -494,6 +511,16 @@ gui_loop(#gui_state{add_all = AddAll, add_file = AddFile, add_rec = AddRec,
[ExtCalls]),
free_editor(State, "Analysis done", Msg),
gui_loop(State);
+ {BackendPid, ext_types, ExtTypes} ->
+ Map = fun({M,F,A}) -> io_lib:format("~p:~p/~p",[M,F,A]) end,
+ ExtTypeString = string:join(lists:map(Map, ExtTypes), "\n"),
+ Msg = io_lib:format("The following remote types are being used "
+ "but information about them is not available.\n"
+ "The analysis might get more precise by including "
+ "the modules containing these types and making sure "
+ "that they are exported:\n~s\n", [ExtTypeString]),
+ free_editor(State, "Analysis done", Msg),
+ gui_loop(State);
{BackendPid, log, LogMsg} ->
update_editor(Log, LogMsg),
gui_loop(State);
diff --git a/lib/dialyzer/src/dialyzer_gui_wx.erl b/lib/dialyzer/src/dialyzer_gui_wx.erl
index e711c15ea7..c6f7c56227 100644
--- a/lib/dialyzer/src/dialyzer_gui_wx.erl
+++ b/lib/dialyzer/src/dialyzer_gui_wx.erl
@@ -2,7 +2,7 @@
%%------------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -40,39 +40,38 @@
%%------------------------------------------------------------------------
--type wx_object() :: any(). %% XXX: should be imported from wx
-
--record(menu, {file :: wx_object(),
- warnings :: wx_object(),
- plt :: wx_object(),
- options :: wx_object(),
- help :: wx_object()}).
-
--record(gui_state, {add :: wx_object(),
- add_dir :: wx_object(),
- add_rec :: wx_object(),
- chosen_box :: wx_object(),
+-record(menu, {file :: wx:wx_object(),
+ warnings :: wx:wx_object(),
+ plt :: wx:wx_object(),
+ options :: wx:wx_object(),
+ help :: wx:wx_object()}).
+-type menu() :: #menu{}.
+
+-record(gui_state, {add :: wx:wx_object(),
+ add_dir :: wx:wx_object(),
+ add_rec :: wx:wx_object(),
+ chosen_box :: wx:wx_object(),
analysis_pid :: pid(),
- del_file :: wx_object(),
+ del_file :: wx:wx_object(),
doc_plt :: dialyzer_plt:plt(),
- clear_chosen :: wx_object(),
- clear_log :: wx_object(),
- explain_warn :: wx_object(),
- clear_warn :: wx_object(),
+ clear_chosen :: wx:wx_object(),
+ clear_log :: wx:wx_object(),
+ explain_warn :: wx:wx_object(),
+ clear_warn :: wx:wx_object(),
init_plt :: dialyzer_plt:plt(),
- dir_entry :: wx_object(),
- file_box :: wx_object(),
+ dir_entry :: wx:wx_object(),
+ file_box :: wx:wx_object(),
files_to_analyze :: ordset(string()),
- gui :: wx_object(),
- log :: wx_object(),
- menu :: #menu{},
- mode :: wx_object(),
+ gui :: wx:wx_object(),
+ log :: wx:wx_object(),
+ menu :: menu(),
+ mode :: wx:wx_object(),
options :: #options{},
- run :: wx_object(),
- stop :: wx_object(),
- frame :: wx_object(),
- warnings_box :: wx_object(),
- explanation_box :: wx_object(),
+ run :: wx:wx_object(),
+ stop :: wx:wx_object(),
+ frame :: wx:wx_object(),
+ warnings_box :: wx:wx_object(),
+ explanation_box :: wx:wx_object(),
wantedWarnings :: list(),
rawWarnings :: list(),
backend_pid :: pid(),
@@ -193,48 +192,50 @@ create_window(Wx, #options{init_plts = InitPltFiles} = DialyzerOptions) ->
RunButtons = wxBoxSizer:new(?wxHORIZONTAL),
Buttons = wxFlexGridSizer:new(3),
- wxSizer:add(ChooseButtons, DeleteButton, ?BorderOpt),
- wxSizer:add(ChooseButtons, DeleteAllButton, ?BorderOpt),
- wxSizer:add(ChooseItem, Lab1, Center),
- wxSizer:add(ChooseItem, ChosenBox, Opts),
- wxSizer:add(ChooseItem, ChooseButtons, ?BorderOpt),
- wxSizer:add(FileTypeItem, OptionsLabel),
- wxSizer:add(FileTypeItem, FileType, [{border, 5}, {flag, ?wxALL}]),
- wxSizer:add(LogItem, LogLabel, Center),
- wxSizer:add(LogItem, LogBox, Opts3),
- wxSizer:add(LogItem, ClearLogButton, ?BorderOpt),
- wxSizer:add(FileItem, FileLabel),
- wxSizer:add(FileItem, FilePicker),
- wxSizer:add(DirItem, DirLabel),
- wxSizer:add(DirItem, DirPicker),
- wxSizer:add(AddDirButtons, AddDirButton, ?BorderOpt),
- wxSizer:add(AddDirButtons, AddRecButton, ?BorderOpt),
- wxSizer:add(FileDirItem, FileItem),
- wxSizer:add(FileDirItem, AddButton, ?BorderOpt),
- wxSizer:add(FileDirItem, DirItem, ?BorderOpt),
- wxSizer:add(FileDirItem, AddDirButtons, ?BorderOpt),
- wxSizer:add(WarnButtons, ExplainWarnButton, ?BorderOpt),
- wxSizer:add(WarnButtons, ClearWarningsButton, ?BorderOpt),
- wxSizer:add(RunButtons, RunButton, ?BorderOpt),
- wxSizer:add(RunButtons, StopButton, ?BorderOpt),
- wxSizer:add(Buttons, WarnButtons),
- wxSizer:add(Buttons, wxStaticText:new(Frame, ?LABEL7, ""), [{flag, ?wxEXPAND}]),
- wxSizer:add(Buttons, RunButtons),
- wxFlexGridSizer:addGrowableCol(Buttons, 1),
- wxSizer:add(WarningsItem, WarningsLabel, Center),
- wxSizer:add(WarningsItem, WarningsBox, Opts3),
- wxSizer:add(WarningsItem, Buttons, [{flag, ?wxEXPAND bor ?wxALL},?Border]),
-
- wxSizer:add(Left, ChooseItem, Opts),
- wxSizer:add(Left, FileDirItem, [{proportion, 1}, {border, 60}, {flag, ?wxTOP}]),
- wxSizer:add(RightUp, FileTypeItem, ?BorderOpt),
- wxSizer:add(RightUp, LogItem, Opts3),
- wxSizer:add(Right, RightUp, Opts3),
- wxSizer:add(Right, WarningsItem, Opts3),
- wxSizer:add(Top, Left, Opts),
- wxSizer:add(Top, Right, Opts3),
-
- wxSizer:add(All, Top, Opts),
+ _ = wxSizer:add(ChooseButtons, DeleteButton, ?BorderOpt),
+ _ = wxSizer:add(ChooseButtons, DeleteAllButton, ?BorderOpt),
+ _ = wxSizer:add(ChooseItem, Lab1, Center),
+ _ = wxSizer:add(ChooseItem, ChosenBox, Opts),
+ _ = wxSizer:add(ChooseItem, ChooseButtons, ?BorderOpt),
+ _ = wxSizer:add(FileTypeItem, OptionsLabel),
+ _ = wxSizer:add(FileTypeItem, FileType, [{border, 5}, {flag, ?wxALL}]),
+ _ = wxSizer:add(LogItem, LogLabel, Center),
+ _ = wxSizer:add(LogItem, LogBox, Opts3),
+ _ = wxSizer:add(LogItem, ClearLogButton, ?BorderOpt),
+ _ = wxSizer:add(FileItem, FileLabel),
+ _ = wxSizer:add(FileItem, FilePicker),
+ _ = wxSizer:add(DirItem, DirLabel),
+ _ = wxSizer:add(DirItem, DirPicker),
+ _ = wxSizer:add(AddDirButtons, AddDirButton, ?BorderOpt),
+ _ = wxSizer:add(AddDirButtons, AddRecButton, ?BorderOpt),
+ _ = wxSizer:add(FileDirItem, FileItem),
+ _ = wxSizer:add(FileDirItem, AddButton, ?BorderOpt),
+ _ = wxSizer:add(FileDirItem, DirItem, ?BorderOpt),
+ _ = wxSizer:add(FileDirItem, AddDirButtons, ?BorderOpt),
+ _ = wxSizer:add(WarnButtons, ExplainWarnButton, ?BorderOpt),
+ _ = wxSizer:add(WarnButtons, ClearWarningsButton, ?BorderOpt),
+ _ = wxSizer:add(RunButtons, RunButton, ?BorderOpt),
+ _ = wxSizer:add(RunButtons, StopButton, ?BorderOpt),
+ _ = wxSizer:add(Buttons, WarnButtons),
+ _ = wxSizer:add(Buttons, wxStaticText:new(Frame, ?LABEL7, ""),
+ [{flag, ?wxEXPAND}]),
+ _ = wxSizer:add(Buttons, RunButtons),
+ _ = wxFlexGridSizer:addGrowableCol(Buttons, 1),
+ _ = wxSizer:add(WarningsItem, WarningsLabel, Center),
+ _ = wxSizer:add(WarningsItem, WarningsBox, Opts3),
+ _ = wxSizer:add(WarningsItem, Buttons,
+ [{flag, ?wxEXPAND bor ?wxALL}, ?Border]),
+ _ = wxSizer:add(Left, ChooseItem, Opts),
+ _ = wxSizer:add(Left, FileDirItem,
+ [{proportion, 1}, {border, 60}, {flag, ?wxTOP}]),
+ _ = wxSizer:add(RightUp, FileTypeItem, ?BorderOpt),
+ _ = wxSizer:add(RightUp, LogItem, Opts3),
+ _ = wxSizer:add(Right, RightUp, Opts3),
+ _ = wxSizer:add(Right, WarningsItem, Opts3),
+ _ = wxSizer:add(Top, Left, Opts),
+ _ = wxSizer:add(Top, Right, Opts3),
+
+ _ = wxSizer:add(All, Top, Opts),
wxWindow:setSizer(Frame, All),
wxWindow:setSizeHints(Frame, {1150,600}),
wxWindow:show(Frame),
@@ -295,91 +296,67 @@ create_window(Wx, #options{init_plts = InitPltFiles} = DialyzerOptions) ->
createFileMenu() ->
FileMenu = wxMenu:new(),
- wxMenu:append(FileMenu, wxMenuItem:new([{id, ?menuID_FILE_SAVE_WARNINGS},
- {text, "Save &Warnings"}])),
- wxMenu:append(FileMenu, wxMenuItem:new([{id, ?menuID_FILE_SAVE_LOG},
- {text, "Save &Log"}])),
- wxMenu:append(FileMenu, wxMenuItem:new([{id, ?menuID_FILE_QUIT},
- {text, "E&xit\tAlt-X"}])),
+ _ = wxMenu:append(FileMenu, wxMenuItem:new([{id, ?menuID_FILE_SAVE_WARNINGS},
+ {text, "Save &Warnings"}])),
+ _ = wxMenu:append(FileMenu, wxMenuItem:new([{id, ?menuID_FILE_SAVE_LOG},
+ {text, "Save &Log"}])),
+ _ = wxMenu:append(FileMenu, wxMenuItem:new([{id, ?menuID_FILE_QUIT},
+ {text, "E&xit\tAlt-X"}])),
FileMenu.
createWarningsMenu() ->
WarningsMenu = wxMenu:new(),
- wxMenu:appendCheckItem(WarningsMenu,
- ?menuID_WARN_MATCH_FAILURES,
- "Match failures"),
- wxMenu:check(WarningsMenu, ?menuID_WARN_MATCH_FAILURES, true),
- wxMenu:appendCheckItem(WarningsMenu,
- ?menuID_WARN_FAIL_FUN_CALLS,
- "Failing function calls"),
- wxMenu:check(WarningsMenu, ?menuID_WARN_FAIL_FUN_CALLS, true),
- wxMenu:appendCheckItem(WarningsMenu,
- ?menuID_WARN_BAD_FUN,
- "Bad fun applications"),
- wxMenu:check(WarningsMenu, ?menuID_WARN_BAD_FUN, true),
- wxMenu:appendCheckItem(WarningsMenu,
- ?menuID_WARN_OPAQUE,
- "Opaqueness violations"),
- wxMenu:check(WarningsMenu, ?menuID_WARN_OPAQUE, true),
- wxMenu:appendCheckItem(WarningsMenu,
- ?menuID_WARN_LIST_CONSTR,
- "Improper list constructions"),
- wxMenu:check(WarningsMenu, ?menuID_WARN_LIST_CONSTR, true),
- wxMenu:appendCheckItem(WarningsMenu,
- ?menuID_WARN_UNUSED_FUN,
- "Unused functions"),
- wxMenu:check(WarningsMenu, ?menuID_WARN_UNUSED_FUN, true),
- wxMenu:appendCheckItem(WarningsMenu,
- ?menuID_WARN_ERROR_HANDLING_FUN,
- "Error handling functions"),
- wxMenu:appendCheckItem(WarningsMenu,
- ?menuID_WARN_NO_RETURN_FUN,
- "Functions of no return"),
- wxMenu:check(WarningsMenu, ?menuID_WARN_NO_RETURN_FUN, true),
- wxMenu:appendCheckItem(WarningsMenu,
- ?menuID_WARN_UNEXPORTED_FUN,
- "Call to unexported function"),
- wxMenu:check(WarningsMenu, ?menuID_WARN_UNEXPORTED_FUN, true),
- wxMenu:appendCheckItem(WarningsMenu,
- ?menuID_WARN_RACE_CONDITIONS,
- "Possible race conditions"),
- wxMenu:appendCheckItem(WarningsMenu,
- ?menuID_WARN_WRONG_CONTRACTS,
- "Wrong contracts"),
- wxMenu:check(WarningsMenu, ?menuID_WARN_WRONG_CONTRACTS, true),
- wxMenu:appendCheckItem(WarningsMenu,
- ?menuID_WARN_CONTRACT_SYNTAX,
- "Wrong contract syntax"),
- wxMenu:check(WarningsMenu, ?menuID_WARN_CONTRACT_SYNTAX, true),
+ addCheckedItem(WarningsMenu, ?menuID_WARN_MATCH_FAILURES, "Match failures"),
+ addCheckedItem(WarningsMenu, ?menuID_WARN_FAIL_FUN_CALLS,
+ "Failing function calls"),
+ addCheckedItem(WarningsMenu, ?menuID_WARN_BAD_FUN, "Bad fun applications"),
+ addCheckedItem(WarningsMenu, ?menuID_WARN_OPAQUE, "Opaqueness violations"),
+ addCheckedItem(WarningsMenu, ?menuID_WARN_LIST_CONSTR,
+ "Improper list constructions"),
+ addCheckedItem(WarningsMenu, ?menuID_WARN_UNUSED_FUN, "Unused functions"),
+ _ = wxMenu:appendCheckItem(WarningsMenu, ?menuID_WARN_ERROR_HANDLING_FUN,
+ "Error handling functions"),
+ addCheckedItem(WarningsMenu, ?menuID_WARN_NO_RETURN_FUN,
+ "Functions of no return"),
+ addCheckedItem(WarningsMenu, ?menuID_WARN_UNEXPORTED_FUN,
+ "Call to unexported function"),
+ _ = wxMenu:appendCheckItem(WarningsMenu, ?menuID_WARN_RACE_CONDITIONS,
+ "Possible race conditions"),
+ addCheckedItem(WarningsMenu, ?menuID_WARN_WRONG_CONTRACTS, "Wrong contracts"),
+ addCheckedItem(WarningsMenu, ?menuID_WARN_CONTRACT_SYNTAX,
+ "Wrong contract syntax"),
WarningsMenu.
+addCheckedItem(Menu, ItemId, Str) ->
+ _ = wxMenu:appendCheckItem(Menu, ItemId, Str),
+ wxMenu:check(Menu, ItemId, true).
+
createPltMenu() ->
PltMenu = wxMenu:new(),
- wxMenu:appendCheckItem(PltMenu,
- ?menuID_PLT_INIT_EMPTY,
- "Init with empty PLT"),
- wxMenu:append(PltMenu, wxMenuItem:new([{id, ?menuID_PLT_SHOW_CONTENTS},
- {text, "Show contents"}])),
- wxMenu:append(PltMenu, wxMenuItem:new([{id, ?menuID_PLT_SEARCH_CONTENTS},
- {text, "Search contents"}])),
+ _ = wxMenu:appendCheckItem(PltMenu, ?menuID_PLT_INIT_EMPTY,
+ "Init with empty PLT"),
+ _ = wxMenu:append(PltMenu, wxMenuItem:new([{id, ?menuID_PLT_SHOW_CONTENTS},
+ {text, "Show contents"}])),
+ _ = wxMenu:append(PltMenu, wxMenuItem:new([{id, ?menuID_PLT_SEARCH_CONTENTS},
+ {text, "Search contents"}])),
PltMenu.
createOptionsMenu() ->
OptsMenu = wxMenu:new(),
- wxMenu:append(OptsMenu, wxMenuItem:new([{id, ?menuID_OPTIONS_MACRO},
- {text, "Manage Macro Definitions"}])),
- wxMenu:append(OptsMenu, wxMenuItem:new([{id, ?menuID_OPTIONS_INCLUDE_DIR},
- {text, "Manage Include Directories"}])),
+ _ = wxMenu:append(OptsMenu, wxMenuItem:new([{id, ?menuID_OPTIONS_MACRO},
+ {text, "Manage Macro Definitions"}])),
+ _ = wxMenu:append(OptsMenu, wxMenuItem:new([{id, ?menuID_OPTIONS_INCLUDE_DIR},
+ {text, "Manage Include Directories"}])),
OptsMenu.
createHelpMenu() ->
HelpMenu = wxMenu:new(),
- wxMenu:append(HelpMenu, wxMenuItem:new([{id, ?menuID_HELP_MANUAL},
- {text, "Manual"}])),
- wxMenu:append(HelpMenu, wxMenuItem:new([{id, ?menuID_HELP_WARNING_OPTIONS},
- {text, "Warning Options"}])),
- wxMenu:append(HelpMenu, wxMenuItem:new([{id, ?menuID_HELP_ABOUT},
- {text, "About"}])),
+ _ = wxMenu:append(HelpMenu, wxMenuItem:new([{id, ?menuID_HELP_MANUAL},
+ {text, "Manual"}])),
+ _ = wxMenu:append(HelpMenu, wxMenuItem:new([{id, ?menuID_HELP_WARNING_OPTIONS},
+ {text, "Warning Options"}])),
+ _ = wxMenu:append(HelpMenu, wxMenuItem:new([{id, ?menuID_HELP_ABOUT},
+ {text, "About"}])),
HelpMenu.
%% ----------------------------------------------------------------
@@ -503,6 +480,16 @@ gui_loop(#gui_state{backend_pid = BackendPid, doc_plt = DocPlt,
[ExtCalls]),
free_editor(State,"Analysis Done", Msg),
gui_loop(State);
+ {BackendPid, ext_types, ExtTypes} ->
+ Map = fun({M,F,A}) -> io_lib:format("~p:~p/~p",[M,F,A]) end,
+ ExtTypeString = string:join(lists:map(Map, ExtTypes), "\n"),
+ Msg = io_lib:format("The following remote types are being used "
+ "but information about them is not available.\n"
+ "The analysis might get more precise by including "
+ "the modules containing these types and making sure "
+ "that they are exported:\n~s\n", [ExtTypeString]),
+ free_editor(State, "Analysis done", Msg),
+ gui_loop(State);
{BackendPid, log, LogMsg} ->
update_editor(Log, LogMsg),
gui_loop(State);
@@ -574,20 +561,20 @@ search_doc_plt(#gui_state{gui = Wx} = State) ->
ArLayout = wxBoxSizer:new(?wxVERTICAL),
Buttons = wxBoxSizer:new(?wxHORIZONTAL),
- wxSizer:add(ModLayout, ModLabel, ?BorderOpt),
- wxSizer:add(ModLayout,ModText, ?BorderOpt),
- wxSizer:add(FunLayout, FunLabel, ?BorderOpt),
- wxSizer:add(FunLayout,FunText, ?BorderOpt),
- wxSizer:add(ArLayout, ArLabel, ?BorderOpt),
- wxSizer:add(ArLayout,ArText, ?BorderOpt),
- wxSizer:add(Buttons, SearchButton, ?BorderOpt),
- wxSizer:add(Buttons,Cancel, ?BorderOpt),
-
- wxSizer:add(Top, ModLayout),
- wxSizer:add(Top, FunLayout),
- wxSizer:add(Top, ArLayout),
- wxSizer:add(Layout, Top,[{flag, ?wxALIGN_CENTER}]),
- wxSizer:add(Layout, Buttons,[{flag, ?wxALIGN_CENTER bor ?wxBOTTOM}]),
+ _ = wxSizer:add(ModLayout, ModLabel, ?BorderOpt),
+ _ = wxSizer:add(ModLayout, ModText, ?BorderOpt),
+ _ = wxSizer:add(FunLayout, FunLabel, ?BorderOpt),
+ _ = wxSizer:add(FunLayout,FunText, ?BorderOpt),
+ _ = wxSizer:add(ArLayout, ArLabel, ?BorderOpt),
+ _ = wxSizer:add(ArLayout,ArText, ?BorderOpt),
+ _ = wxSizer:add(Buttons, SearchButton, ?BorderOpt),
+ _ = wxSizer:add(Buttons,Cancel, ?BorderOpt),
+
+ _ = wxSizer:add(Top, ModLayout),
+ _ = wxSizer:add(Top, FunLayout),
+ _ = wxSizer:add(Top, ArLayout),
+ _ = wxSizer:add(Layout, Top,[{flag, ?wxALIGN_CENTER}]),
+ _ = wxSizer:add(Layout, Buttons,[{flag, ?wxALIGN_CENTER bor ?wxBOTTOM}]),
wxFrame:connect(Dialog, close_window),
wxWindow:setSizer(Dialog, Layout),
wxFrame:show(Dialog),
@@ -645,14 +632,15 @@ error_sms(State, Message) ->
output_sms(State, ?DIALYZER_ERROR_TITLE, Message, error).
output_sms(#gui_state{frame = Frame}, Title, Message, Type) ->
- case Type of
- error ->
- MessageWin = wxMessageDialog:new(Frame,Message,[{caption, Title},{style, ?wxOK bor ?wxICON_ERROR}]);
- info ->
- MessageWin = wxMessageDialog:new(Frame,Message,[{caption, Title},{style, ?wxOK bor ?wxICON_INFORMATION}])
- end,
+ Style = case Type of
+ error -> ?wxOK bor ?wxICON_ERROR;
+ info -> ?wxOK bor ?wxICON_INFORMATION
+ end,
+ Options = [{caption, Title}, {style, Style}],
+ MessageWin = wxMessageDialog:new(Frame, Message, Options),
wxWindow:setSizeHints(MessageWin, {350,100}),
- wxDialog:showModal(MessageWin).
+ wxDialog:showModal(MessageWin),
+ ok.
free_editor(#gui_state{gui = Wx, frame = Frame}, Title, Contents0) ->
Contents = lists:flatten(Contents0),
@@ -676,8 +664,9 @@ free_editor(#gui_state{gui = Wx, frame = Frame}, Title, Contents0) ->
wxButton:connect(Ok, command_button_clicked),
Layout = wxBoxSizer:new(?wxVERTICAL),
- wxSizer:add(Layout, Editor, ?BorderOpt),
- wxSizer:add(Layout, Ok, [{flag, ?wxALIGN_CENTER bor ?wxBOTTOM bor ?wxALL}, ?Border]),
+ _ = wxSizer:add(Layout, Editor, ?BorderOpt),
+ Flag = ?wxALIGN_CENTER bor ?wxBOTTOM bor ?wxALL,
+ _ = wxSizer:add(Layout, Ok, [{flag, Flag}, ?Border]),
wxWindow:setSizer(Win, Layout),
wxWindow:show(Win),
show_info_loop(Frame, Win).
@@ -687,7 +676,7 @@ show_info_loop(Frame, Win) ->
#wx{id = ?Message_Ok, event = #wxCommand{type = command_button_clicked}} ->
wxWindow:destroy(Win);
#wx{id = ?Message, event = #wxClose{type = close_window}} ->
- wxWindow:destroy(Win);
+ wxWindow:destroy(Win);
#wx{event = #wxClose{type = close_window}} ->
wxWindow:destroy(Frame)
end.
@@ -814,7 +803,7 @@ build_analysis_record(#gui_state{mode = Mode, menu = Menu, options = Options,
1 -> src_code
end,
InitPlt =
- case wxMenu:isChecked(Menu#menu.plt,?menuID_PLT_INIT_EMPTY) of
+ case wxMenu:isChecked(Menu#menu.plt, ?menuID_PLT_INIT_EMPTY) of
true -> dialyzer_plt:new();
false -> InitPlt0
end,
@@ -912,13 +901,14 @@ save_file(#gui_state{frame = Frame, warnings_box = WBox, log = Log} = State, Typ
{message, Message},
{style,?wxFD_SAVE bor ?wxFD_OVERWRITE_PROMPT}]),
case wxFileDialog:showModal(FileDialog) of
- ?wxID_OK -> Path = wxFileDialog:getPath(FileDialog),
- case wxTextCtrl:saveFile(Box,[{file,Path}]) of
- true -> ok;
- false -> error_sms(State,"Could not write to file:\n" ++ Path)
- end;
+ ?wxID_OK ->
+ Path = wxFileDialog:getPath(FileDialog),
+ case wxTextCtrl:saveFile(Box,[{file,Path}]) of
+ true -> ok;
+ false -> error_sms(State, "Could not write to file:\n" ++ Path)
+ end;
?wxID_CANCEL -> wxWindow:destroy(FileDialog);
- _ -> error_sms(State,"Could not write to file:\n")
+ _ -> error_sms(State, "Could not write to file:\n")
end
end.
@@ -952,16 +942,16 @@ include_dialog(#gui_state{gui = Wx, frame = Frame, options = Options}) ->
Buttons = wxBoxSizer:new(?wxHORIZONTAL),
Buttons1 = wxBoxSizer:new(?wxHORIZONTAL),
- wxSizer:add(Layout, DirLabel, [{flag, ?wxALIGN_CENTER_HORIZONTAL}]),
- wxSizer:add(Layout, DirPicker, [{flag, ?wxALIGN_CENTER_HORIZONTAL}]),
- wxSizer:add(Layout,AddButton, [{flag, ?wxALIGN_CENTER_HORIZONTAL bor ?wxALL}, ?Border]),
- wxSizer:add(Layout,Box, [{flag, ?wxALIGN_CENTER_HORIZONTAL bor ?wxALL}, ?Border]),
- wxSizer:add(Buttons, DeleteButton, ?BorderOpt),
- wxSizer:add(Buttons, DeleteAllButton, ?BorderOpt),
- wxSizer:add(Layout,Buttons, [{flag, ?wxALIGN_CENTER_HORIZONTAL}]),
- wxSizer:add(Buttons1, Ok, ?BorderOpt),
- wxSizer:add(Buttons1,Cancel, ?BorderOpt),
- wxSizer:add(Layout,Buttons1,[{flag, ?wxALIGN_RIGHT bor ?wxBOTTOM}]),
+ _ = wxSizer:add(Layout, DirLabel, [{flag, ?wxALIGN_CENTER_HORIZONTAL}]),
+ _ = wxSizer:add(Layout, DirPicker, [{flag, ?wxALIGN_CENTER_HORIZONTAL}]),
+ _ = wxSizer:add(Layout,AddButton, [{flag, ?wxALIGN_CENTER_HORIZONTAL bor ?wxALL}, ?Border]),
+ _ = wxSizer:add(Layout,Box, [{flag, ?wxALIGN_CENTER_HORIZONTAL bor ?wxALL}, ?Border]),
+ _ = wxSizer:add(Buttons, DeleteButton, ?BorderOpt),
+ _ = wxSizer:add(Buttons, DeleteAllButton, ?BorderOpt),
+ _ = wxSizer:add(Layout,Buttons, [{flag, ?wxALIGN_CENTER_HORIZONTAL}]),
+ _ = wxSizer:add(Buttons1, Ok, ?BorderOpt),
+ _ = wxSizer:add(Buttons1,Cancel, ?BorderOpt),
+ _ = wxSizer:add(Layout,Buttons1,[{flag, ?wxALIGN_RIGHT bor ?wxBOTTOM}]),
wxFrame:connect(Dialog, close_window),
wxWindow:setSizer(Dialog, Layout),
@@ -1049,21 +1039,21 @@ macro_dialog(#gui_state{gui = Wx, frame = Frame, options = Options}) ->
Buttons = wxBoxSizer:new(?wxHORIZONTAL),
Buttons1 = wxBoxSizer:new(?wxHORIZONTAL),
- wxSizer:add(MacroItem, MacroLabel, ?BorderOpt),
- wxSizer:add(MacroItem, MacroText, ?BorderOpt),
- wxSizer:add(TermItem, TermLabel, ?BorderOpt),
- wxSizer:add(TermItem, TermText, ?BorderOpt),
- wxSizer:add(Item, MacroItem),
- wxSizer:add(Item, TermItem),
- wxSizer:add(Layout, Item, [{flag, ?wxALIGN_CENTER_HORIZONTAL}]),
- wxSizer:add(Layout, AddButton, [{flag, ?wxALIGN_CENTER_HORIZONTAL bor ?wxALL}, ?Border]),
- wxSizer:add(Layout, Box, [{flag, ?wxALIGN_CENTER_HORIZONTAL bor ?wxALL}, ?Border]),
- wxSizer:add(Buttons, DeleteButton, ?BorderOpt),
- wxSizer:add(Buttons, DeleteAllButton, ?BorderOpt),
- wxSizer:add(Layout, Buttons, [{flag, ?wxALIGN_CENTER_HORIZONTAL}]),
- wxSizer:add(Buttons1, Ok, ?BorderOpt),
- wxSizer:add(Buttons1, Cancel, ?BorderOpt),
- wxSizer:add(Layout, Buttons1, [{flag, ?wxALIGN_RIGHT bor ?wxBOTTOM}]),
+ _ = wxSizer:add(MacroItem, MacroLabel, ?BorderOpt),
+ _ = wxSizer:add(MacroItem, MacroText, ?BorderOpt),
+ _ = wxSizer:add(TermItem, TermLabel, ?BorderOpt),
+ _ = wxSizer:add(TermItem, TermText, ?BorderOpt),
+ _ = wxSizer:add(Item, MacroItem),
+ _ = wxSizer:add(Item, TermItem),
+ _ = wxSizer:add(Layout, Item, [{flag, ?wxALIGN_CENTER_HORIZONTAL}]),
+ _ = wxSizer:add(Layout, AddButton, [{flag, ?wxALIGN_CENTER_HORIZONTAL bor ?wxALL}, ?Border]),
+ _ = wxSizer:add(Layout, Box, [{flag, ?wxALIGN_CENTER_HORIZONTAL bor ?wxALL}, ?Border]),
+ _ = wxSizer:add(Buttons, DeleteButton, ?BorderOpt),
+ _ = wxSizer:add(Buttons, DeleteAllButton, ?BorderOpt),
+ _ = wxSizer:add(Layout, Buttons, [{flag, ?wxALIGN_CENTER_HORIZONTAL}]),
+ _ = wxSizer:add(Buttons1, Ok, ?BorderOpt),
+ _ = wxSizer:add(Buttons1, Cancel, ?BorderOpt),
+ _ = wxSizer:add(Layout, Buttons1, [{flag, ?wxALIGN_RIGHT bor ?wxBOTTOM}]),
wxFrame:connect(Dialog, close_window),
wxWindow:setSizer(Dialog, Layout),
@@ -1207,13 +1197,14 @@ show_explanation(#gui_state{gui = Wx} = State, Explanation) ->
wxButton:connect(Ok, command_button_clicked),
Layout = wxBoxSizer:new(?wxVERTICAL),
Buttons = wxBoxSizer:new(?wxHORIZONTAL),
- wxSizer:add(Buttons, ExplButton, ?BorderOpt),
- wxSizer:add(Buttons, Ok, ?BorderOpt),
- wxSizer:add(Layout, Editor,[{flag, ?wxALIGN_CENTER_HORIZONTAL bor ?wxALL}, ?Border]),
- wxSizer:add(Layout, Buttons,[{flag, ?wxALIGN_CENTER_HORIZONTAL}]),
+ _ = wxSizer:add(Buttons, ExplButton, ?BorderOpt),
+ _ = wxSizer:add(Buttons, Ok, ?BorderOpt),
+ _ = wxSizer:add(Layout, Editor, [{flag, ?wxALIGN_CENTER_HORIZONTAL bor ?wxALL}, ?Border]),
+ _ = wxSizer:add(Layout, Buttons,[{flag, ?wxALIGN_CENTER_HORIZONTAL}]),
wxWindow:setSizer(Win, Layout),
wxWindow:show(Win),
- show_explanation_loop(State#gui_state{explanation_box = Editor}, Win, Explanation)
+ NewState = State#gui_state{explanation_box = Editor},
+ show_explanation_loop(NewState, Win, Explanation)
end.
show_explanation_loop(#gui_state{frame = Frame, expl_pid = ExplPid} = State, Win, Explanation) ->
diff --git a/lib/dialyzer/src/dialyzer_options.erl b/lib/dialyzer/src/dialyzer_options.erl
index 866650a0b2..06672e595f 100644
--- a/lib/dialyzer/src/dialyzer_options.erl
+++ b/lib/dialyzer/src/dialyzer_options.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -194,6 +194,11 @@ build_options([{OptionName, Value} = Term|Rest], Options) ->
callgraph_file ->
assert_filename(Value),
build_options(Rest, Options#options{callgraph_file = Value});
+ timing ->
+ build_options(Rest, Options#options{timing = Value});
+ solvers ->
+ assert_solvers(Value),
+ build_options(Rest, Options#options{solvers = Value});
_ ->
bad_option("Unknown dialyzer command line option", Term)
end;
@@ -255,6 +260,15 @@ is_plt_mode(plt_remove) -> true;
is_plt_mode(plt_check) -> true;
is_plt_mode(succ_typings) -> false.
+assert_solvers([]) ->
+ ok;
+assert_solvers([v1|Terms]) ->
+ assert_solvers(Terms);
+assert_solvers([v2|Terms]) ->
+ assert_solvers(Terms);
+assert_solvers([Term|_]) ->
+ bad_option("Illegal value for solver", Term).
+
-spec build_warnings([atom()], [dial_warning()]) -> [dial_warning()].
build_warnings([Opt|Opts], Warnings) ->
diff --git a/lib/dialyzer/src/dialyzer_plt.erl b/lib/dialyzer/src/dialyzer_plt.erl
index 206c43e4e2..5f64099210 100644
--- a/lib/dialyzer/src/dialyzer_plt.erl
+++ b/lib/dialyzer/src/dialyzer_plt.erl
@@ -2,7 +2,7 @@
%%----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -31,8 +31,7 @@
-export([check_plt/3,
compute_md5_from_files/1,
contains_mfa/2,
- contains_module/2,
- delete_contract_list/2,
+ all_modules/1,
delete_list/2,
delete_module/2,
included_files/1,
@@ -56,7 +55,10 @@
plt_and_info_from_file/1,
get_specs/1,
get_specs/4,
- to_file/4]).
+ to_file/4,
+ get_mini_plt/1,
+ restore_full_plt/2
+ ]).
%% Debug utilities
-export([pp_non_returning/0, pp_mod/1]).
@@ -83,7 +85,13 @@
contracts = table_new() :: dict(),
callbacks = table_new() :: dict(),
exported_types = sets:new() :: set()}).
--opaque plt() :: #plt{}.
+
+-record(mini_plt, {info :: ets:tid(),
+ contracts :: ets:tid(),
+ callbacks :: ets:tid()
+ }).
+
+-opaque plt() :: #plt{} | #mini_plt{}.
-include("dialyzer.hrl").
@@ -133,65 +141,48 @@ delete_list(#plt{info = Info, types = Types,
-spec insert_contract_list(plt(), dialyzer_contracts:plt_contracts()) -> plt().
-insert_contract_list(#plt{contracts = Contracts} = PLT, List) ->
- PLT#plt{contracts = table_insert_list(Contracts, List)}.
+insert_contract_list(#mini_plt{contracts = Contracts} = PLT, List) ->
+ true = ets:insert(Contracts, List),
+ PLT.
-spec insert_callbacks(plt(), dialyzer_codeserver:codeserver()) -> plt().
insert_callbacks(#plt{callbacks = Callbacks} = Plt, Codeserver) ->
- FunPreferNew = fun(_Key, _Val1, Val2) -> Val2 end,
- FunDictMerger =
- fun(_Key, Value, AccIn) -> dict:merge(FunPreferNew, Value, AccIn) end,
- MergedCallbacks = dict:fold(FunDictMerger, dict:new(),
- dialyzer_codeserver:get_callbacks(Codeserver)),
- List = dict:to_list(MergedCallbacks),
+ List = dialyzer_codeserver:get_callbacks(Codeserver),
Plt#plt{callbacks = table_insert_list(Callbacks, List)}.
-spec lookup_contract(plt(), mfa_patt()) -> 'none' | {'value', #contract{}}.
-lookup_contract(#plt{contracts = Contracts},
+lookup_contract(#mini_plt{contracts = ETSContracts},
{M, F, _} = MFA) when is_atom(M), is_atom(F) ->
- table_lookup(Contracts, MFA).
-
--spec lookup_callbacks(plt(), module()) -> [{mfa(),
- {{Filename::string(),
- Line::pos_integer()},
- #contract{}}}].
-
-lookup_callbacks(#plt{callbacks = Callbacks}, Mod) when is_atom(Mod) ->
- FunModFilter =
- fun({M, _F, _A}, _Val) -> M =:= Mod;
- ( _Key, _Val) -> false
- end,
- ModCallbacks = dict:filter(FunModFilter, Callbacks),
- dict:to_list(ModCallbacks).
-
--spec delete_contract_list(plt(), [mfa()]) -> plt().
+ ets_table_lookup(ETSContracts, MFA).
-delete_contract_list(#plt{contracts = Contracts,
- callbacks = Callbacks} = PLT, List) ->
- PLT#plt{contracts = table_delete_list(Contracts, List),
- callbacks = table_delete_list(Callbacks, List)}.
+-spec lookup_callbacks(plt(), module()) ->
+ 'none' | {'value', [{mfa(), {{Filename::string(),
+ Line::pos_integer()},
+ #contract{}}}]}.
-%% -spec insert(plt(), mfa() | integer(), {_, _}) -> plt().
-%%
-%% insert(#plt{info = Info} = PLT, Id, Types) ->
-%% PLT#plt{info = table_insert(Info, Id, Types)}.
+lookup_callbacks(#mini_plt{callbacks = ETSCallbacks}, Mod) when is_atom(Mod) ->
+ ets_table_lookup(ETSCallbacks, Mod).
-type ret_args_types() :: {erl_types:erl_type(), [erl_types:erl_type()]}.
-spec insert_list(plt(), [{mfa() | integer(), ret_args_types()}]) -> plt().
-insert_list(#plt{info = Info} = PLT, List) ->
- PLT#plt{info = table_insert_list(Info, List)}.
+insert_list(#mini_plt{info = Info} = PLT, List) ->
+ true = ets:insert(Info, List),
+ PLT.
-spec lookup(plt(), integer() | mfa_patt()) ->
'none' | {'value', ret_args_types()}.
-lookup(#plt{info = Info}, {M, F, _} = MFA) when is_atom(M), is_atom(F) ->
- table_lookup(Info, MFA);
-lookup(#plt{info = Info}, Label) when is_integer(Label) ->
- table_lookup(Info, Label).
+lookup(Plt, {M, F, _} = MFA) when is_atom(M), is_atom(F) ->
+ lookup_1(Plt, MFA);
+lookup(Plt, Label) when is_integer(Label) ->
+ lookup_1(Plt, Label).
+
+lookup_1(#mini_plt{info = Info}, MFAorLabel) ->
+ ets_table_lookup(Info, MFAorLabel).
-spec insert_types(plt(), dict()) -> plt().
@@ -220,10 +211,10 @@ get_exported_types(#plt{exported_types = ExpTypes}) ->
lookup_module(#plt{info = Info}, M) when is_atom(M) ->
table_lookup_module(Info, M).
--spec contains_module(plt(), atom()) -> boolean().
+-spec all_modules(plt()) -> set().
-contains_module(#plt{info = Info, contracts = Cs}, M) when is_atom(M) ->
- table_contains_module(Info, M) orelse table_contains_module(Cs, M).
+all_modules(#plt{info = Info, contracts = Cs}) ->
+ sets:union(table_all_modules(Info), table_all_modules(Cs)).
-spec contains_mfa(plt(), mfa()) -> boolean().
@@ -518,6 +509,34 @@ init_md5_list_1([], DiffList, Acc) ->
init_md5_list_1(Md5List, [], Acc) ->
{ok, lists:reverse(Acc, Md5List)}.
+-spec get_mini_plt(plt()) -> plt().
+
+get_mini_plt(#plt{info = Info, contracts = Contracts, callbacks = Callbacks}) ->
+ [ETSInfo, ETSContracts, ETSCallbacks] =
+ [ets:new(Name, [public]) || Name <- [plt_info, plt_contracts, plt_callbacks]],
+ CallbackList = dict:to_list(Callbacks),
+ CallbacksByModule =
+ [{M, [Cb || {{M1,_,_},_} = Cb <- CallbackList, M1 =:= M]} ||
+ M <- lists:usort([M || {{M,_,_},_} <- CallbackList])],
+ [true, true] =
+ [ets:insert(ETS, dict:to_list(Data)) ||
+ {ETS, Data} <- [{ETSInfo, Info}, {ETSContracts, Contracts}]],
+ true = ets:insert(ETSCallbacks, CallbacksByModule),
+ #mini_plt{info = ETSInfo, contracts = ETSContracts, callbacks = ETSCallbacks};
+get_mini_plt(undefined) ->
+ undefined.
+
+-spec restore_full_plt(plt(), plt()) -> plt().
+
+restore_full_plt(#mini_plt{info = ETSInfo, contracts = ETSContracts}, Plt) ->
+ Info = dict:from_list(ets:tab2list(ETSInfo)),
+ Contracts = dict:from_list(ets:tab2list(ETSContracts)),
+ ets:delete(ETSContracts),
+ ets:delete(ETSInfo),
+ Plt#plt{info = Info, contracts = Contracts};
+restore_full_plt(undefined, undefined) ->
+ undefined.
+
%%---------------------------------------------------------------------------
%% Edoc
@@ -610,6 +629,13 @@ table_lookup(Plt, Obj) ->
{ok, Val} -> {value, Val}
end.
+ets_table_lookup(Plt, Obj) ->
+ try ets:lookup_element(Plt, Obj, 2) of
+ Val -> {value, Val}
+ catch
+ _:_ -> none
+ end.
+
table_lookup_module(Plt, Mod) ->
List = dict:fold(fun(Key, Val, Acc) ->
case Key of
@@ -623,10 +649,12 @@ table_lookup_module(Plt, Mod) ->
false -> {value, List}
end.
-table_contains_module(Plt, Mod) ->
- dict:fold(fun({M, _F, _A}, _Val, _Acc) when M =:= Mod -> true;
- (_, _, Acc) -> Acc
- end, false, Plt).
+table_all_modules(Plt) ->
+ Fold =
+ fun({M, _F, _A}, _Val, Acc) -> sets:add_element(M, Acc);
+ (_, _, Acc) -> Acc
+ end,
+ dict:fold(Fold, sets:new(), Plt).
table_merge([H|T]) ->
table_merge(T, H).
diff --git a/lib/dialyzer/src/dialyzer_races.erl b/lib/dialyzer/src/dialyzer_races.erl
index ee9d5e88a3..2aa8343bce 100644
--- a/lib/dialyzer/src/dialyzer_races.erl
+++ b/lib/dialyzer/src/dialyzer_races.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -36,10 +36,11 @@
-export([beg_clause_new/3, cleanup/1, end_case_new/1, end_clause_new/3,
get_curr_fun/1, get_curr_fun_args/1, get_new_table/1,
get_race_analysis/1, get_race_list/1, get_race_list_size/1,
+ get_race_list_and_size/1,
let_tag_new/2, new/0, put_curr_fun/3, put_fun_args/2,
put_race_analysis/2, put_race_list/3]).
--export_type([races/0, mfa_or_funlbl/0, core_vars/0]).
+-export_type([races/0, core_vars/0]).
-include("dialyzer.hrl").
@@ -66,8 +67,6 @@
%%%
%%% ===========================================================================
--type mfa_or_funlbl() :: label() | mfa().
-
-type label_type() :: label() | [label()] | {label()} | ?no_label.
-type args() :: [label_type() | [string()]].
-type core_vars() :: cerl:cerl() | ?no_arg | ?bypassed.
@@ -94,7 +93,7 @@
guard :: cerl:cerl()}).
-record(end_case, {clauses :: [#end_clause{}]}).
-record(curr_fun, {status :: 'in' | 'out',
- mfa :: mfa_or_funlbl(),
+ mfa :: dialyzer_callgraph:mfa_or_funlbl(),
label :: label(),
def_vars :: [core_vars()],
arg_types :: [erl_types:erl_type()],
@@ -107,8 +106,8 @@
state :: _, %% XXX: recursive
file_line :: file_line(),
var_map :: dict()}).
--record(fun_call, {caller :: mfa_or_funlbl(),
- callee :: mfa_or_funlbl(),
+-record(fun_call, {caller :: dialyzer_callgraph:mfa_or_funlbl(),
+ callee :: dialyzer_callgraph:mfa_or_funlbl(),
arg_types :: [erl_types:erl_type()],
vars :: [core_vars()]}).
-record(let_tag, {var :: var_to_map1(),
@@ -130,10 +129,10 @@
vars :: [core_vars()],
file_line :: file_line(),
index :: non_neg_integer(),
- fun_mfa :: mfa_or_funlbl(),
+ fun_mfa :: dialyzer_callgraph:mfa_or_funlbl(),
fun_label :: label()}).
--record(races, {curr_fun :: mfa_or_funlbl(),
+-record(races, {curr_fun :: dialyzer_callgraph:mfa_or_funlbl(),
curr_fun_label :: label(),
curr_fun_args = 'empty' :: core_args(),
new_table = 'no_t' :: table(),
@@ -158,7 +157,8 @@
%%%
%%% ===========================================================================
--spec store_race_call(mfa_or_funlbl(), [erl_types:erl_type()], [core_vars()],
+-spec store_race_call(dialyzer_callgraph:mfa_or_funlbl(),
+ [erl_types:erl_type()], [core_vars()],
file_line(), dialyzer_dataflow:state()) ->
dialyzer_dataflow:state().
@@ -347,6 +347,7 @@ fixup_race_list(RaceWarnTag, WarnVarArgs, State) ->
DepList2 =
fixup_race_list_helper(NewParents, Calls, CurrFun, WarnVarArgs,
RaceWarnTag, NewState),
+ dialyzer_dataflow:dispose_state(CleanState),
lists:usort(cleanup_dep_calls(DepList1 ++ DepList2)).
fixup_race_list_helper(Parents, Calls, CurrFun, WarnVarArgs, RaceWarnTag,
@@ -381,13 +382,15 @@ fixup_race_forward_pullout(CurrFun, CurrFunLabel, Calls, Code, RaceList,
InitFun, WarnVarArgs, RaceWarnTag, RaceVarMap,
FunDefVars, FunCallVars, FunArgTypes, NestingLevel,
State) ->
+ TState = dialyzer_dataflow:state__duplicate(State),
{DepList, NewCurrFun, NewCurrFunLabel, NewCalls,
NewCode, NewRaceList, NewRaceVarMap, NewFunDefVars,
NewFunCallVars, NewFunArgTypes, NewNestingLevel} =
fixup_race_forward(CurrFun, CurrFunLabel, Calls, Code, RaceList,
InitFun, WarnVarArgs, RaceWarnTag, RaceVarMap,
FunDefVars, FunCallVars, FunArgTypes, NestingLevel,
- cleanup_race_code(State)),
+ cleanup_race_code(TState)),
+ dialyzer_dataflow:dispose_state(TState),
case NewCode of
[] -> DepList;
[#fun_call{caller = NewCurrFun, callee = Call, arg_types = FunTypes,
@@ -1755,7 +1758,10 @@ compare_var_list(Var, VarList, RaceVarMap) ->
ets_list_args(MaybeList) ->
case is_list(MaybeList) of
- true -> [ets_tuple_args(T) || T <- MaybeList];
+ true ->
+ try [ets_tuple_args(T) || T <- MaybeList]
+ catch _:_ -> [?no_label]
+ end;
false -> [ets_tuple_args(MaybeList)]
end.
@@ -2405,7 +2411,7 @@ end_case_new(Clauses) ->
end_clause_new(Arg, Pats, Guard) ->
#end_clause{arg = Arg, pats = Pats, guard = Guard}.
--spec get_curr_fun(races()) -> mfa_or_funlbl().
+-spec get_curr_fun(races()) -> dialyzer_callgraph:mfa_or_funlbl().
get_curr_fun(#races{curr_fun = CurrFun}) ->
CurrFun.
@@ -2435,6 +2441,12 @@ get_race_list(#races{race_list = RaceList}) ->
get_race_list_size(#races{race_list_size = RaceListSize}) ->
RaceListSize.
+-spec get_race_list_and_size(races()) -> {code(), non_neg_integer()}.
+
+get_race_list_and_size(#races{race_list = RaceList,
+ race_list_size = RaceListSize}) ->
+ {RaceList, RaceListSize}.
+
-spec let_tag_new(var_to_map1(), var_to_map1()) -> #let_tag{}.
let_tag_new(Var, Arg) ->
@@ -2444,7 +2456,7 @@ let_tag_new(Var, Arg) ->
new() -> #races{}.
--spec put_curr_fun(mfa_or_funlbl(), label(), races()) ->
+-spec put_curr_fun(dialyzer_callgraph:mfa_or_funlbl(), label(), races()) ->
races().
put_curr_fun(CurrFun, CurrFunLabel, Races) ->
diff --git a/lib/dialyzer/src/dialyzer_succ_typings.erl b/lib/dialyzer/src/dialyzer_succ_typings.erl
index 4d86bb34a7..84379642bf 100644
--- a/lib/dialyzer/src/dialyzer_succ_typings.erl
+++ b/lib/dialyzer/src/dialyzer_succ_typings.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -28,15 +28,22 @@
-module(dialyzer_succ_typings).
-export([analyze_callgraph/3,
- analyze_callgraph/4,
- get_warnings/6]).
+ analyze_callgraph/6,
+ get_warnings/8
+ ]).
-%% These are only intended as debug functions.
--export([doit/1,
- get_top_level_signatures/3]).
+-export([
+ find_succ_types_for_scc/2,
+ refine_one_module/2,
+ find_required_by/2,
+ find_depends_on/2,
+ collect_warnings/2,
+ lookup_names/2
+ ]).
+
+-export_type([typesig_init_data/0, dataflow_init_data/0, warnings_init_data/0]).
%%-define(DEBUG, true).
-%%-define(DEBUG_PP, true).
-ifdef(DEBUG).
-define(debug(X__, Y__), io:format(X__, Y__)).
@@ -54,11 +61,21 @@
%% State record -- local to this module
-type parent() :: 'none' | pid().
+-type typesig_init_data() :: term().
+-type dataflow_init_data() :: term().
+-type warnings_init_data() :: term().
+
+-type fixpoint_init_data() :: typesig_init_data() | dataflow_init_data().
+
+-type scc() :: [mfa_or_funlbl()] | [module()].
+
-record(st, {callgraph :: dialyzer_callgraph:callgraph(),
codeserver :: dialyzer_codeserver:codeserver(),
no_warn_unused :: set(),
parent = none :: parent(),
+ timing_server :: dialyzer_timing:timing_server(),
+ solvers :: [solver()],
plt :: dialyzer_plt:plt()}).
%%--------------------------------------------------------------------
@@ -68,60 +85,90 @@
dialyzer_plt:plt().
analyze_callgraph(Callgraph, Plt, Codeserver) ->
- analyze_callgraph(Callgraph, Plt, Codeserver, none).
+ analyze_callgraph(Callgraph, Plt, Codeserver, none, [], none).
-spec analyze_callgraph(dialyzer_callgraph:callgraph(), dialyzer_plt:plt(),
- dialyzer_codeserver:codeserver(), parent()) ->
+ dialyzer_codeserver:codeserver(),
+ dialyzer_timing:timing_server(),
+ [solver()], parent()) ->
dialyzer_plt:plt().
-analyze_callgraph(Callgraph, Plt, Codeserver, Parent) ->
- State = #st{callgraph = Callgraph, plt = Plt,
- codeserver = Codeserver, parent = Parent},
- NewState = get_refined_success_typings(State),
- NewState#st.plt.
+analyze_callgraph(Callgraph, Plt, Codeserver, TimingServer, Solvers, Parent) ->
+ NewState =
+ init_state_and_get_success_typings(Callgraph, Plt, Codeserver,
+ TimingServer, Solvers, Parent),
+ dialyzer_plt:restore_full_plt(NewState#st.plt, Plt).
%%--------------------------------------------------------------------
-get_refined_success_typings(State) ->
- case find_succ_typings(State) of
+init_state_and_get_success_typings(Callgraph, Plt, Codeserver,
+ TimingServer, Solvers, Parent) ->
+ {SCCs, Callgraph1} =
+ ?timing(TimingServer, "order", dialyzer_callgraph:finalize(Callgraph)),
+ State = #st{callgraph = Callgraph1, plt = dialyzer_plt:get_mini_plt(Plt),
+ codeserver = Codeserver, parent = Parent,
+ timing_server = TimingServer, solvers = Solvers},
+ get_refined_success_typings(SCCs, State).
+
+get_refined_success_typings(SCCs, #st{callgraph = Callgraph,
+ timing_server = TimingServer} = State) ->
+ case find_succ_typings(SCCs, State) of
{fixpoint, State1} -> State1;
{not_fixpoint, NotFixpoint1, State1} ->
- Callgraph = State1#st.callgraph,
- NotFixpoint2 = [lookup_name(F, Callgraph) || F <- NotFixpoint1],
- ModulePostorder =
- dialyzer_callgraph:module_postorder_from_funs(NotFixpoint2, Callgraph),
- case refine_succ_typings(ModulePostorder, State1) of
+ {ModulePostorder, ModCallgraph} =
+ ?timing(
+ TimingServer, "order", _C1,
+ dialyzer_callgraph:module_postorder_from_funs(NotFixpoint1,
+ Callgraph)),
+ ModState = State1#st{callgraph = ModCallgraph},
+ case refine_succ_typings(ModulePostorder, ModState) of
{fixpoint, State2} ->
State2;
- {not_fixpoint, NotFixpoint3, State2} ->
- Callgraph1 = State2#st.callgraph,
+ {not_fixpoint, NotFixpoint2, State2} ->
%% Need to reset the callgraph.
- NotFixpoint4 = [lookup_name(F, Callgraph1) || F <- NotFixpoint3],
- Callgraph2 = dialyzer_callgraph:reset_from_funs(NotFixpoint4,
- Callgraph1),
- get_refined_success_typings(State2#st{callgraph = Callgraph2})
+ {NewSCCs, Callgraph2} =
+ ?timing(TimingServer, "order", _C2,
+ dialyzer_callgraph:reset_from_funs(NotFixpoint2,
+ ModCallgraph)),
+ NewState = State2#st{callgraph = Callgraph2},
+ get_refined_success_typings(NewSCCs, NewState)
end
end.
-type doc_plt() :: 'undefined' | dialyzer_plt:plt().
-spec get_warnings(dialyzer_callgraph:callgraph(), dialyzer_plt:plt(),
doc_plt(), dialyzer_codeserver:codeserver(), set(),
- pid()) ->
+ dialyzer_timing:timing_server(), [solver()], pid()) ->
{[dial_warning()], dialyzer_plt:plt(), doc_plt()}.
-get_warnings(Callgraph, Plt, DocPlt, Codeserver, NoWarnUnused, Parent) ->
- InitState = #st{callgraph = Callgraph, codeserver = Codeserver,
- no_warn_unused = NoWarnUnused, parent = Parent, plt = Plt},
- NewState = get_refined_success_typings(InitState),
+get_warnings(Callgraph, Plt, DocPlt, Codeserver,
+ NoWarnUnused, TimingServer, Solvers, Parent) ->
+ InitState =
+ init_state_and_get_success_typings(Callgraph, Plt, Codeserver,
+ TimingServer, Solvers, Parent),
+ NewState = InitState#st{no_warn_unused = NoWarnUnused},
Mods = dialyzer_callgraph:modules(NewState#st.callgraph),
- CWarns = dialyzer_contracts:get_invalid_contract_warnings(Mods, Codeserver,
- NewState#st.plt),
- get_warnings_from_modules(Mods, NewState, DocPlt, CWarns).
-
-get_warnings_from_modules([M|Ms], State, DocPlt, Acc) when is_atom(M) ->
- send_log(State#st.parent, io_lib:format("Getting warnings for ~w\n", [M])),
+ MiniPlt = NewState#st.plt,
+ CWarns =
+ dialyzer_contracts:get_invalid_contract_warnings(Mods, Codeserver, MiniPlt),
+ MiniDocPlt = dialyzer_plt:get_mini_plt(DocPlt),
+ ModWarns =
+ ?timing(TimingServer, "warning",
+ get_warnings_from_modules(Mods, NewState, MiniDocPlt)),
+ {postprocess_warnings(CWarns ++ ModWarns, Codeserver),
+ dialyzer_plt:restore_full_plt(MiniPlt, Plt),
+ dialyzer_plt:restore_full_plt(MiniDocPlt, DocPlt)}.
+
+get_warnings_from_modules(Mods, State, DocPlt) ->
#st{callgraph = Callgraph, codeserver = Codeserver,
- no_warn_unused = NoWarnUnused, plt = Plt} = State,
+ no_warn_unused = NoWarnUnused, plt = Plt,
+ timing_server = TimingServer} = State,
+ Init = {Codeserver, Callgraph, NoWarnUnused, Plt, DocPlt},
+ dialyzer_coordinator:parallel_job(warnings, Mods, Init, TimingServer).
+
+-spec collect_warnings(module(), warnings_init_data()) -> [dial_warning()].
+
+collect_warnings(M, {Codeserver, Callgraph, NoWarnUnused, Plt, DocPlt}) ->
ModCode = dialyzer_codeserver:lookup_mod_code(M, Codeserver),
Records = dialyzer_codeserver:lookup_mod_records(M, Codeserver),
Contracts = dialyzer_codeserver:lookup_mod_contracts(M, Codeserver),
@@ -129,28 +176,27 @@ get_warnings_from_modules([M|Ms], State, DocPlt, Acc) when is_atom(M) ->
%% Check if there are contracts for functions that do not exist
Warnings1 =
dialyzer_contracts:contracts_without_fun(Contracts, AllFuns, Callgraph),
- {RawWarnings2, FunTypes, RaceCode, PublicTables, NamedTables} =
- dialyzer_dataflow:get_warnings(ModCode, Plt, Callgraph, Records, NoWarnUnused),
- {NewAcc, Warnings2} = postprocess_dataflow_warns(RawWarnings2, State, Acc),
+ {Warnings2, FunTypes} =
+ dialyzer_dataflow:get_warnings(ModCode, Plt, Callgraph,
+ Records, NoWarnUnused),
Attrs = cerl:module_attrs(ModCode),
- Warnings3 = dialyzer_behaviours:check_callbacks(M, Attrs, Plt, Codeserver),
- NewDocPlt = insert_into_doc_plt(FunTypes, Callgraph, DocPlt),
- NewCallgraph =
- dialyzer_callgraph:renew_race_info(Callgraph, RaceCode, PublicTables,
- NamedTables),
- State1 = st__renew_state_calls(NewCallgraph, State),
- get_warnings_from_modules(Ms, State1, NewDocPlt,
- [Warnings1, Warnings2, Warnings3|NewAcc]);
-get_warnings_from_modules([], #st{plt = Plt}, DocPlt, Acc) ->
- {lists:flatten(Acc), Plt, DocPlt}.
-
-postprocess_dataflow_warns(RawWarnings, State, WarnAcc) ->
- postprocess_dataflow_warns(RawWarnings, State, WarnAcc, []).
-
-postprocess_dataflow_warns([], _State, WAcc, Acc) ->
- {WAcc, lists:reverse(Acc)};
+ Warnings3 =
+ dialyzer_behaviours:check_callbacks(M, Attrs, Records, Plt, Codeserver),
+ DocPlt = insert_into_doc_plt(FunTypes, Callgraph, DocPlt),
+ lists:flatten([Warnings1, Warnings2, Warnings3]).
+
+postprocess_warnings(RawWarnings, Codeserver) ->
+ Pred =
+ fun({?WARN_CONTRACT_RANGE, _, _}) -> true;
+ (_) -> false
+ end,
+ {CRWarns, NonCRWarns} = lists:partition(Pred, RawWarnings),
+ postprocess_dataflow_warns(CRWarns, Codeserver, NonCRWarns, []).
+
+postprocess_dataflow_warns([], _Callgraph, WAcc, Acc) ->
+ lists:reverse(Acc, WAcc);
postprocess_dataflow_warns([{?WARN_CONTRACT_RANGE, {CallF, CallL}, Msg}|Rest],
- #st{codeserver = Codeserver} = State, WAcc, Acc) ->
+ Codeserver, WAcc, Acc) ->
{contract_range, [Contract, M, F, A, ArgStrings, CRet]} = Msg,
case dialyzer_codeserver:lookup_mfa_contract({M,F,A}, Codeserver) of
{ok, {{ContrF, _ContrL} = FileLine, _C}} ->
@@ -163,87 +209,66 @@ postprocess_dataflow_warns([{?WARN_CONTRACT_RANGE, {CallF, CallL}, Msg}|Rest],
(_) -> true
end,
FilterWAcc = lists:filter(Filter, WAcc),
- postprocess_dataflow_warns(Rest, State, FilterWAcc, [W|Acc]);
+ postprocess_dataflow_warns(Rest, Codeserver, FilterWAcc, [W|Acc]);
false ->
- postprocess_dataflow_warns(Rest, State, WAcc, Acc)
+ postprocess_dataflow_warns(Rest, Codeserver, WAcc, Acc)
end;
error ->
%% The contract is not in a module that is currently under analysis.
%% We display the warning in the file/line of the call.
NewMsg = {contract_range, [Contract, M, F, ArgStrings, CallL, CRet]},
W = {?WARN_CONTRACT_RANGE, {CallF, CallL}, NewMsg},
- postprocess_dataflow_warns(Rest, State, WAcc, [W|Acc])
- end;
-postprocess_dataflow_warns([W|Rest], State, Wacc, Acc) ->
- postprocess_dataflow_warns(Rest, State, Wacc, [W|Acc]).
+ postprocess_dataflow_warns(Rest, Codeserver, WAcc, [W|Acc])
+ end.
-refine_succ_typings(ModulePostorder, State) ->
- ?debug("Module postorder: ~p\n", [ModulePostorder]),
- refine_succ_typings(ModulePostorder, State, []).
-
-refine_succ_typings([SCC|SCCs], State, Fixpoint) ->
- Msg = io_lib:format("Dataflow of one SCC: ~w\n", [SCC]),
- send_log(State#st.parent, Msg),
- ?debug("~s\n", [Msg]),
- {NewState, FixpointFromScc} =
- case SCC of
- [M] -> refine_one_module(M, State);
- [_|_] -> refine_one_scc(SCC, State)
- end,
- NewFixpoint = ordsets:union(Fixpoint, FixpointFromScc),
- refine_succ_typings(SCCs, NewState, NewFixpoint);
-refine_succ_typings([], State, Fixpoint) ->
- case Fixpoint =:= [] of
+refine_succ_typings(Modules, #st{codeserver = Codeserver,
+ callgraph = Callgraph,
+ plt = Plt,
+ timing_server = Timing,
+ solvers = Solvers} = State) ->
+ ?debug("Module postorder: ~p\n", [Modules]),
+ Init = {Codeserver, Callgraph, Plt, Solvers},
+ NotFixpoint =
+ ?timing(Timing, "refine",
+ dialyzer_coordinator:parallel_job(dataflow, Modules, Init, Timing)),
+ ?debug("==================== Dataflow done ====================\n\n", []),
+ case NotFixpoint =:= [] of
true -> {fixpoint, State};
- false -> {not_fixpoint, Fixpoint, State}
+ false -> {not_fixpoint, NotFixpoint, State}
end.
--spec refine_one_module(module(), #st{}) -> {#st{}, [label()]}. % ordset
+-spec find_depends_on(scc() | module(), fixpoint_init_data()) -> [scc()].
-refine_one_module(M, State) ->
- #st{callgraph = Callgraph, codeserver = CodeServer, plt = PLT} = State,
+find_depends_on(SCC, {_Codeserver, Callgraph, _Plt, _Solvers}) ->
+ dialyzer_callgraph:get_depends_on(SCC, Callgraph).
+
+-spec find_required_by(scc() | module(), fixpoint_init_data()) -> [scc()].
+
+find_required_by(SCC, {_Codeserver, Callgraph, _Plt, _Solvers}) ->
+ dialyzer_callgraph:get_required_by(SCC, Callgraph).
+
+-spec lookup_names([label()], fixpoint_init_data()) -> [mfa_or_funlbl()].
+
+lookup_names(Labels, {_Codeserver, Callgraph, _Plt, _Solvers}) ->
+ [lookup_name(F, Callgraph) || F <- Labels].
+
+-spec refine_one_module(module(), dataflow_init_data()) -> [label()]. % ordset
+
+refine_one_module(M, {CodeServer, Callgraph, Plt, _Solvers}) ->
ModCode = dialyzer_codeserver:lookup_mod_code(M, CodeServer),
AllFuns = collect_fun_info([ModCode]),
- FunTypes = get_fun_types_from_plt(AllFuns, State),
Records = dialyzer_codeserver:lookup_mod_records(M, CodeServer),
- {NewFunTypes, RaceCode, PublicTables, NamedTables} =
- dialyzer_dataflow:get_fun_types(ModCode, PLT, Callgraph, Records),
- NewCallgraph =
- dialyzer_callgraph:renew_race_info(Callgraph, RaceCode, PublicTables,
- NamedTables),
+ FunTypes = get_fun_types_from_plt(AllFuns, Callgraph, Plt),
+ NewFunTypes =
+ dialyzer_dataflow:get_fun_types(ModCode, Plt, Callgraph, Records),
case reached_fixpoint(FunTypes, NewFunTypes) of
- true ->
- State1 = st__renew_state_calls(NewCallgraph, State),
- {State1, ordsets:new()};
+ true -> [];
{false, NotFixpoint} ->
?debug("Not fixpoint\n", []),
- NewState = insert_into_plt(dict:from_list(NotFixpoint), State),
- NewState1 = st__renew_state_calls(NewCallgraph, NewState),
- {NewState1, ordsets:from_list([FunLbl || {FunLbl,_Type} <- NotFixpoint])}
+ Plt = insert_into_plt(dict:from_list(NotFixpoint), Callgraph, Plt),
+ [FunLbl || {FunLbl,_Type} <- NotFixpoint]
end.
-st__renew_state_calls(Callgraph, State) ->
- State#st{callgraph = Callgraph}.
-
-refine_one_scc(SCC, State) ->
- refine_one_scc(SCC, State, []).
-
-refine_one_scc(SCC, State, AccFixpoint) ->
- {NewState, FixpointFromScc} = refine_mods_in_scc(SCC, State, []),
- case FixpointFromScc =:= [] of
- true -> {NewState, AccFixpoint};
- false ->
- NewAccFixpoint = ordsets:union(AccFixpoint, FixpointFromScc),
- refine_one_scc(SCC, NewState, NewAccFixpoint)
- end.
-
-refine_mods_in_scc([Mod|Mods], State, Fixpoint) ->
- {NewState, FixpointFromModule} = refine_one_module(Mod, State),
- NewFixpoint = ordsets:union(FixpointFromModule, Fixpoint),
- refine_mods_in_scc(Mods, NewState, NewFixpoint);
-refine_mods_in_scc([], State, Fixpoint) ->
- {State, Fixpoint}.
-
reached_fixpoint(OldTypes, NewTypes) ->
reached_fixpoint(OldTypes, NewTypes, false).
@@ -299,29 +324,22 @@ compare_types_1([], [], _Strict, NotFixpoint) ->
false -> {false, NotFixpoint}
end.
-find_succ_typings(State) ->
- find_succ_typings(State, []).
-
-find_succ_typings(#st{callgraph = Callgraph, parent = Parent} = State,
- NotFixpoint) ->
- case dialyzer_callgraph:take_scc(Callgraph) of
- {ok, SCC, NewCallgraph} ->
- Msg = io_lib:format("Typesig analysis for SCC: ~w\n", [format_scc(SCC)]),
- ?debug("~s", [Msg]),
- send_log(Parent, Msg),
- {NewState, NewNotFixpoint1} =
- analyze_scc(SCC, State#st{callgraph = NewCallgraph}),
- NewNotFixpoint2 = ordsets:union(NewNotFixpoint1, NotFixpoint),
- find_succ_typings(NewState, NewNotFixpoint2);
- none ->
- ?debug("==================== Typesig done ====================\n\n", []),
- case NotFixpoint =:= [] of
- true -> {fixpoint, State};
- false -> {not_fixpoint, NotFixpoint, State}
- end
+find_succ_typings(SCCs, #st{codeserver = Codeserver, callgraph = Callgraph,
+ plt = Plt, timing_server = Timing,
+ solvers = Solvers} = State) ->
+ Init = {Codeserver, Callgraph, Plt, Solvers},
+ NotFixpoint =
+ ?timing(Timing, "typesig",
+ dialyzer_coordinator:parallel_job(typesig, SCCs, Init, Timing)),
+ ?debug("==================== Typesig done ====================\n\n", []),
+ case NotFixpoint =:= [] of
+ true -> {fixpoint, State};
+ false -> {not_fixpoint, NotFixpoint, State}
end.
-analyze_scc(SCC, #st{codeserver = Codeserver} = State) ->
+-spec find_succ_types_for_scc(scc(), typesig_init_data()) -> [mfa_or_funlbl()].
+
+find_succ_types_for_scc(SCC, {Codeserver, Callgraph, Plt, Solvers}) ->
SCC_Info = [{MFA,
dialyzer_codeserver:lookup_mfa_code(MFA, Codeserver),
dialyzer_codeserver:lookup_mod_records(M, Codeserver)}
@@ -330,30 +348,18 @@ analyze_scc(SCC, #st{codeserver = Codeserver} = State) ->
|| {_, _, _} = MFA <- SCC],
Contracts2 = [{MFA, Contract} || {MFA, {ok, Contract}} <- Contracts1],
Contracts3 = orddict:from_list(Contracts2),
- {SuccTypes, PltContracts, NotFixpoint} =
- find_succ_types_for_scc(SCC_Info, Contracts3, State),
- State1 = insert_into_plt(SuccTypes, State),
- ContrPlt = dialyzer_plt:insert_contract_list(State1#st.plt, PltContracts),
- {State1#st{plt = ContrPlt}, NotFixpoint}.
-
-find_succ_types_for_scc(SCC_Info, Contracts,
- #st{codeserver = Codeserver,
- callgraph = Callgraph, plt = Plt} = State) ->
- %% Assume that the PLT contains the current propagated types
+ Label = dialyzer_codeserver:get_next_core_label(Codeserver),
AllFuns = collect_fun_info([Fun || {_MFA, {_Var, Fun}, _Rec} <- SCC_Info]),
- PropTypes = get_fun_types_from_plt(AllFuns, State),
- MFAs = [MFA || {MFA, {_Var, _Fun}, _Rec} <- SCC_Info],
- NextLabel = dialyzer_codeserver:get_next_core_label(Codeserver),
- Plt1 = dialyzer_plt:delete_contract_list(Plt, MFAs),
- FunTypes = dialyzer_typesig:analyze_scc(SCC_Info, NextLabel,
- Callgraph, Plt1, PropTypes),
+ PropTypes = get_fun_types_from_plt(AllFuns, Callgraph, Plt),
+ %% Assume that the PLT contains the current propagated types
+ FunTypes = dialyzer_typesig:analyze_scc(SCC_Info, Label, Callgraph,
+ Plt, PropTypes, Solvers),
AllFunSet = sets:from_list([X || {X, _} <- AllFuns]),
- FilteredFunTypes = dict:filter(fun(X, _) ->
- sets:is_element(X, AllFunSet)
- end, FunTypes),
+ FilteredFunTypes =
+ dict:filter(fun(X, _) -> sets:is_element(X, AllFunSet) end, FunTypes),
%% Check contracts
- PltContracts = dialyzer_contracts:check_contracts(Contracts, Callgraph,
- FilteredFunTypes),
+ PltContracts =
+ dialyzer_contracts:check_contracts(Contracts3, Callgraph, FilteredFunTypes),
ContractFixpoint =
lists:all(fun({MFA, _C}) ->
%% Check the non-deleted PLT
@@ -362,23 +368,23 @@ find_succ_types_for_scc(SCC_Info, Contracts,
{value, _} -> true
end
end, PltContracts),
+ Plt = insert_into_plt(FilteredFunTypes, Callgraph, Plt),
+ Plt = dialyzer_plt:insert_contract_list(Plt, PltContracts),
case (ContractFixpoint andalso
reached_fixpoint_strict(PropTypes, FilteredFunTypes)) of
- true ->
- {FilteredFunTypes, PltContracts, []};
+ true -> [];
false ->
?debug("Not fixpoint for: ~w\n", [AllFuns]),
- {FilteredFunTypes, PltContracts,
- ordsets:from_list([Fun || {Fun, _Arity} <- AllFuns])}
+ [Fun || {Fun, _Arity} <- AllFuns]
end.
-get_fun_types_from_plt(FunList, State) ->
- get_fun_types_from_plt(FunList, State, dict:new()).
+get_fun_types_from_plt(FunList, Callgraph, Plt) ->
+ get_fun_types_from_plt(FunList, Callgraph, Plt, dict:new()).
-get_fun_types_from_plt([{FunLabel, Arity}|Left], State, Map) ->
- Type = lookup_fun_type(FunLabel, Arity, State),
- get_fun_types_from_plt(Left, State, dict:store(FunLabel, Type, Map));
-get_fun_types_from_plt([], _State, Map) ->
+get_fun_types_from_plt([{FunLabel, Arity}|Left], Callgraph, Plt, Map) ->
+ Type = lookup_fun_type(FunLabel, Arity, Callgraph, Plt),
+ get_fun_types_from_plt(Left, Callgraph, Plt, dict:store(FunLabel, Type, Map));
+get_fun_types_from_plt([], _Callgraph, _Plt, Map) ->
Map.
collect_fun_info(Trees) ->
@@ -396,7 +402,7 @@ collect_fun_info([Tree|Trees], List) ->
collect_fun_info([], List) ->
List.
-lookup_fun_type(Label, Arity, #st{callgraph = Callgraph, plt = Plt}) ->
+lookup_fun_type(Label, Arity, Callgraph, Plt) ->
ID = lookup_name(Label, Callgraph),
case dialyzer_plt:lookup(Plt, ID) of
none -> erl_types:t_fun(Arity, erl_types:t_any());
@@ -409,10 +415,10 @@ insert_into_doc_plt(FunTypes, Callgraph, DocPlt) ->
SuccTypes = format_succ_types(FunTypes, Callgraph),
dialyzer_plt:insert_list(DocPlt, SuccTypes).
-insert_into_plt(SuccTypes0, #st{callgraph = Callgraph, plt = Plt} = State) ->
+insert_into_plt(SuccTypes0, Callgraph, Plt) ->
SuccTypes = format_succ_types(SuccTypes0, Callgraph),
debug_pp_succ_typings(SuccTypes),
- State#st{plt = dialyzer_plt:insert_list(Plt, SuccTypes)}.
+ dialyzer_plt:insert_list(Plt, SuccTypes).
format_succ_types(SuccTypes, Callgraph) ->
format_succ_types(dict:to_list(SuccTypes), Callgraph, []).
@@ -447,131 +453,3 @@ lookup_name(F, CG) ->
error -> F;
{ok, Name} -> Name
end.
-
-send_log(none, _Msg) ->
- ok;
-send_log(Parent, Msg) ->
- Parent ! {self(), log, lists:flatten(Msg)},
- ok.
-
-format_scc(SCC) ->
- [MFA || {_M, _F, _A} = MFA <- SCC].
-
-%% ============================================================================
-%%
-%% Debug interface.
-%%
-%% ============================================================================
-
--spec doit(atom() | file:filename()) -> 'ok'.
-
-doit(Module) ->
- {ok, AbstrCode} = dialyzer_utils:get_abstract_code_from_src(Module),
- {ok, Code} = dialyzer_utils:get_core_from_abstract_code(AbstrCode),
- {ok, Records} = dialyzer_utils:get_record_and_type_info(AbstrCode),
- %% contract typing info in dictionary format
- {ok, Contracts, _Callbacks} =
- dialyzer_utils:get_spec_info(cerl:concrete(cerl:module_name(Code)),
- AbstrCode, Records),
- Sigs0 = get_top_level_signatures(Code, Records, Contracts),
- M = if is_atom(Module) ->
- list_to_atom(filename:basename(atom_to_list(Module)));
- is_list(Module) ->
- list_to_atom(filename:basename(Module))
- end,
- Sigs1 = [{{M, F, A}, Type} || {{F, A}, Type} <- Sigs0],
- Sigs = ordsets:from_list(Sigs1),
- io:format("==================== Final result ====================\n\n", []),
- pp_signatures(Sigs, Records),
- ok.
-
--spec get_top_level_signatures(cerl:c_module(), dict(), dict()) ->
- [{{atom(), arity()}, erl_types:erl_type()}].
-
-get_top_level_signatures(Code, Records, Contracts) ->
- Tree = cerl:from_records(Code),
- {LabeledTree, NextLabel} = cerl_trees:label(Tree),
- Plt = get_def_plt(),
- ModuleName = cerl:atom_val(cerl:module_name(LabeledTree)),
- Plt1 = dialyzer_plt:delete_module(Plt, ModuleName),
- Plt2 = analyze_module(LabeledTree, NextLabel, Plt1, Records, Contracts),
- M = cerl:concrete(cerl:module_name(Tree)),
- Functions = [{M, cerl:fname_id(V), cerl:fname_arity(V)}
- || {V, _F} <- cerl:module_defs(LabeledTree)],
- %% First contracts check
- AllContracts = dict:fetch_keys(Contracts),
- ErrorContracts = AllContracts -- Functions,
- lists:foreach(fun(C) ->
- io:format("Contract for non-existing function: ~w\n",[C])
- end, ErrorContracts),
- Types = [{MFA, dialyzer_plt:lookup(Plt2, MFA)} || MFA <- Functions],
- Sigs = [{{F, A}, erl_types:t_fun(ArgT, RetT)}
- || {{_M, F, A}, {value, {RetT, ArgT}}} <- Types],
- ordsets:from_list(Sigs).
-
-get_def_plt() ->
- try
- dialyzer_plt:from_file(dialyzer_plt:get_default_plt())
- catch
- error:no_such_file -> dialyzer_plt:new();
- throw:{dialyzer_error, _} -> dialyzer_plt:new()
- end.
-
-pp_signatures([{{_, module_info, 0}, _}|Left], Records) ->
- pp_signatures(Left, Records);
-pp_signatures([{{_, module_info, 1}, _}|Left], Records) ->
- pp_signatures(Left, Records);
-pp_signatures([{{M, F, _A}, Type}|Left], Records) ->
- TypeString =
- case cerl:is_literal(Type) of
-%% Commented out so that dialyzer does not complain
-%% false ->
-%% "fun(" ++ String = erl_types:t_to_string(Type, Records),
-%% string:substr(String, 1, length(String)-1);
- true ->
- io_lib:format("~w", [cerl:concrete(Type)])
- end,
- io:format("~w:~w~s\n", [M, F, TypeString]),
- pp_signatures(Left, Records);
-pp_signatures([], _Records) ->
- ok.
-
--ifdef(DEBUG_PP).
-debug_pp(Tree, _Map) ->
- Tree1 = strip_annotations(Tree),
- io:put_chars(cerl_prettypr:format(Tree1)),
- io:nl().
-
-strip_annotations(Tree) ->
- cerl_trees:map(fun(T) ->
- case cerl:is_literal(T) orelse cerl:is_c_values(T) of
- true -> cerl:set_ann(T, []);
- false ->
- Label = cerl_trees:get_label(T),
- cerl:set_ann(T, [{'label', Label}])
- end
- end, Tree).
--else.
-debug_pp(_Tree, _Map) ->
- ok.
--endif. % DEBUG_PP
-
-%%
-%% Analysis of a single module
-%%
-analyze_module(LabeledTree, NextLbl, Plt, Records, Contracts) ->
- debug_pp(LabeledTree, dict:new()),
- CallGraph1 = dialyzer_callgraph:new(),
- CallGraph2 = dialyzer_callgraph:scan_core_tree(LabeledTree, CallGraph1),
- {CallGraph3, _Ext} = dialyzer_callgraph:remove_external(CallGraph2),
- CallGraph4 = dialyzer_callgraph:finalize(CallGraph3),
- CodeServer1 = dialyzer_codeserver:new(),
- Mod = cerl:concrete(cerl:module_name(LabeledTree)),
- CodeServer2 = dialyzer_codeserver:insert(Mod, LabeledTree, CodeServer1),
- CodeServer3 = dialyzer_codeserver:set_next_core_label(NextLbl, CodeServer2),
- CodeServer4 = dialyzer_codeserver:store_records(Mod, Records, CodeServer3),
- CodeServer5 = dialyzer_codeserver:store_contracts(Mod, Contracts, CodeServer4),
- Res = analyze_callgraph(CallGraph4, Plt, CodeServer5),
- dialyzer_callgraph:delete(CallGraph4),
- dialyzer_codeserver:delete(CodeServer5),
- Res.
diff --git a/lib/dialyzer/src/dialyzer_timing.erl b/lib/dialyzer/src/dialyzer_timing.erl
new file mode 100644
index 0000000000..b1a4bdc07c
--- /dev/null
+++ b/lib/dialyzer/src/dialyzer_timing.erl
@@ -0,0 +1,133 @@
+%% -*- erlang-indent-level: 2 -*-
+%%-------------------------------------------------------------------
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%%-------------------------------------------------------------------
+%%% File : dialyzer_timing.erl
+%%% Authors : Stavros Aronis <[email protected]>
+%%% Description : Timing reports for Dialyzer
+%%%-------------------------------------------------------------------
+
+-module(dialyzer_timing).
+
+-export([init/1, start_stamp/2, send_size_info/3, end_stamp/1, stop/1]).
+
+-export_type([timing_server/0]).
+
+-type timing_server() :: pid() | 'none'.
+
+-spec init(boolean() | 'debug') -> timing_server().
+
+init(Active) ->
+ case Active of
+ true ->
+ io:format("\n"),
+ spawn_link(fun() -> loop(now(), 0, "") end);
+ debug ->
+ io:format("\n"),
+ spawn_link(fun() -> debug_loop("") end);
+ false -> none
+ end.
+
+loop(LastNow, Size, Unit) ->
+ receive
+ {stamp, Msg, Now} ->
+ io:format(" ~-10s (+~4.2fs):", [Msg, diff(Now, LastNow)]),
+ loop(Now, 0, "");
+ {stamp, Now} ->
+ SizeStr =
+ case Size of
+ 0 -> "";
+ _ ->
+ Data = io_lib:format("~p ~s",[Size, Unit]),
+ io_lib:format(" (~12s)",[Data])
+ end,
+ io:format("~7.2fs~s\n", [diff(Now, LastNow), SizeStr]),
+ loop(Now, 0, "");
+ {size, NewSize, NewUnit} ->
+ loop(LastNow, NewSize, NewUnit);
+ {Pid, stop, Now} ->
+ io:format(" ~-9s (+~5.2fs)\n", ["",diff(Now, LastNow)]),
+ Pid ! ok;
+ {Pid, stop} ->
+ Pid ! ok
+ end.
+
+debug_loop(Phase) ->
+ receive
+ Message ->
+ {Runtime,_} = statistics(wall_clock),
+ Procs = erlang:system_info(process_count),
+ ProcMem = erlang:memory(total),
+ Status = io_lib:format("~12w ~6w ~20w", [Runtime, Procs, ProcMem]),
+ case Message of
+ {stamp, Msg, _Now} ->
+ io:format("~s ~s_start\n", [Status, Msg]),
+ debug_loop(Msg);
+ {stamp, _Now} ->
+ io:format("~s ~s_stop\n", [Status, Phase]),
+ debug_loop("");
+ {Pid, stop, _Now} ->
+ Pid ! ok;
+ {Pid, stop} ->
+ Pid ! ok;
+ _ ->
+ debug_loop(Phase)
+ end
+ after
+ 50 ->
+ {Runtime,_} = statistics(wall_clock),
+ Procs = erlang:system_info(process_count),
+ ProcMem = erlang:memory(total),
+ Status = io_lib:format("~12w ~6w ~20w", [Runtime, Procs, ProcMem]),
+ io:format("~s\n", [Status]),
+ debug_loop(Phase)
+ end.
+
+
+-spec start_stamp(timing_server(), string()) -> ok.
+
+start_stamp(none, _) -> ok;
+start_stamp(Pid, Msg) ->
+ Pid ! {stamp, Msg, now()},
+ ok.
+
+-spec end_stamp(timing_server()) -> ok.
+
+end_stamp(none) -> ok;
+end_stamp(Pid) ->
+ Pid ! {stamp, now()},
+ ok.
+
+-spec send_size_info(timing_server(), integer(), string()) -> ok.
+
+send_size_info(none, _, _) -> ok;
+send_size_info(Pid, Size, Unit) ->
+ Pid ! {size, Size, Unit},
+ ok.
+
+-spec stop(timing_server()) -> ok.
+
+stop(none) -> ok;
+stop(Pid) ->
+ Pid ! {self(), stop, now()},
+ receive ok -> ok end.
+
+diff(T2, T1) ->
+ timer:now_diff(T2,T1) / 1000000.
diff --git a/lib/dialyzer/src/dialyzer_typesig.erl b/lib/dialyzer/src/dialyzer_typesig.erl
index 4268814859..0df003a035 100644
--- a/lib/dialyzer/src/dialyzer_typesig.erl
+++ b/lib/dialyzer/src/dialyzer_typesig.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -28,7 +28,7 @@
-module(dialyzer_typesig).
--export([analyze_scc/5]).
+-export([analyze_scc/6]).
-export([get_safe_underapprox/2]).
-import(erl_types,
@@ -78,6 +78,8 @@
-record(constraint_list, {type :: 'conj' | 'disj',
list :: [constr()],
deps :: [dep()],
+ masks :: [{dep(),[non_neg_integer()]}] |
+ {'d',dict()},
id :: {'list', dep()}}).
-type constraint_list() :: #constraint_list{}.
@@ -91,22 +93,27 @@
-type typesig_scc() :: [{mfa(), {cerl:c_var(), cerl:c_fun()}, dict()}].
-type typesig_funmap() :: [{type_var(), type_var()}]. %% Orddict
--record(state, {callgraph :: dialyzer_callgraph:callgraph(),
- cs = [] :: [constr()],
- cmap = dict:new() :: dict(),
- fun_map = [] :: typesig_funmap(),
- fun_arities = dict:new() :: dict(),
- in_match = false :: boolean(),
- in_guard = false :: boolean(),
- module :: module(),
- name_map = dict:new() :: dict(),
- next_label :: label(),
- non_self_recs = [] :: [label()],
- plt :: dialyzer_plt:plt(),
- prop_types = dict:new() :: dict(),
- records = dict:new() :: dict(),
- opaques = [] :: [erl_types:erl_type()],
- scc = [] :: [type_var()]}).
+-type dict_or_ets() :: {'d', dict()} | {'e', ets:tid()}.
+
+-record(state, {callgraph :: dialyzer_callgraph:callgraph(),
+ cs = [] :: [constr()],
+ cmap = {'d', dict:new()} :: dict_or_ets(),
+ fun_map = [] :: typesig_funmap(),
+ fun_arities = dict:new() :: dict(),
+ in_match = false :: boolean(),
+ in_guard = false :: boolean(),
+ module :: module(),
+ name_map = dict:new() :: dict(),
+ next_label = 0 :: label(),
+ self_rec :: erl_types:erl_type(),
+ plt :: dialyzer_plt:plt(),
+ prop_types = {'d', dict:new()} :: dict_or_ets(),
+ records = dict:new() :: dict(),
+ opaques = [] :: [erl_types:erl_type()],
+ scc = [] :: [type_var()],
+ mfas :: [tuple()],
+ solvers = [] :: [solver()]
+ }).
%%-----------------------------------------------------------------------------
@@ -117,8 +124,10 @@
%%-define(DEBUG_CONSTRAINTS, true).
-ifdef(DEBUG).
-define(DEBUG_NAME_MAP, true).
+-define(DEBUG_LOOP_DETECTION, true).
-endif.
%%-define(DEBUG_NAME_MAP, true).
+%%-define(DEBUG_LOOP_DETECTION, true).
-ifdef(DEBUG).
-define(debug(__String, __Args), io:format(__String, __Args)).
@@ -137,7 +146,7 @@
%%-----------------------------------------------------------------------------
%% Analysis of strongly connected components.
%%
-%% analyze_scc(SCC, NextLabel, CallGraph, PLT, PropTypes) -> FunTypes
+%% analyze_scc(SCC, NextLabel, CallGraph, PLT, PropTypes, Solvers) -> FunTypes
%%
%% SCC - [{MFA, Def, Records}]
%% where Def = {Var, Fun} as in the Core Erlang module definitions.
@@ -150,15 +159,17 @@
%% about functions that can be called by this SCC.
%% PropTypes - A dictionary.
%% FunTypes - A dictionary.
+%% Solvers - User specified solvers.
%%-----------------------------------------------------------------------------
-spec analyze_scc(typesig_scc(), label(),
dialyzer_callgraph:callgraph(),
- dialyzer_plt:plt(), dict()) -> dict().
+ dialyzer_plt:plt(), dict(), [solver()]) -> dict().
-analyze_scc(SCC, NextLabel, CallGraph, Plt, PropTypes) ->
+analyze_scc(SCC, NextLabel, CallGraph, Plt, PropTypes, Solvers0) ->
+ Solvers = solvers(Solvers0),
assert_format_of_scc(SCC),
- State1 = new_state(SCC, NextLabel, CallGraph, Plt, PropTypes),
+ State1 = new_state(SCC, NextLabel, CallGraph, Plt, PropTypes, Solvers),
DefSet = add_def_list([Var || {_MFA, {Var, _Fun}, _Rec} <- SCC], sets:new()),
State2 = traverse_scc(SCC, DefSet, State1),
State3 = state__finalize(State2),
@@ -172,6 +183,9 @@ assert_format_of_scc([{_MFA, {_Var, _Fun}, _Records}|Left]) ->
assert_format_of_scc([]) ->
ok.
+solvers([]) -> [v2];
+solvers(Solvers) -> Solvers.
+
%% ============================================================================
%%
%% Gets the constraints by traversing the code.
@@ -448,7 +462,8 @@ traverse(Tree, DefinedVars, State) ->
%% Check if a record is constructed.
_ ->
Arity = length(Fields),
- case state__lookup_record(State2, cerl:atom_val(Tag), Arity) of
+ Records = State2#state.records,
+ case lookup_record(Records, cerl:atom_val(Tag), Arity) of
error -> {State2, TupleType};
{ok, RecType} ->
State3 = state__store_conj(TupleType, sub, RecType, State2),
@@ -646,8 +661,14 @@ get_plt_constr(MFA, Dst, ArgVars, State) ->
PltRes = dialyzer_plt:lookup(Plt, MFA),
Opaques = State#state.opaques,
Module = State#state.module,
+ SCCMFAs = State#state.mfas,
{FunModule, _, _} = MFA,
- case dialyzer_plt:lookup_contract(Plt, MFA) of
+ Contract =
+ case lists:member(MFA, SCCMFAs) of
+ true -> none;
+ false -> dialyzer_plt:lookup_contract(Plt, MFA)
+ end,
+ case Contract of
none ->
case PltRes of
none -> State;
@@ -1246,6 +1267,8 @@ get_bif_constr({erlang, is_record, 2}, Dst, [Var, Tag] = Args, _State) ->
mk_constraint(Var, sub, ArgV)]);
get_bif_constr({erlang, is_record, 3}, Dst, [Var, Tag, Arity] = Args, State) ->
%% TODO: Revise this to make it precise for Tag and Arity.
+ Records = State#state.records,
+ AllOpaques = State#state.opaques,
ArgFun =
fun(Map) ->
case t_is_atom(true, lookup_type(Dst, Map)) of
@@ -1262,10 +1285,8 @@ get_bif_constr({erlang, is_record, 3}, Dst, [Var, Tag, Arity] = Args, State) ->
GenRecord = t_tuple([TagType|AnyElems]),
case t_atom_vals(TagType) of
[TagVal] ->
- case state__lookup_record(State, TagVal,
- ArityVal - 1) of
+ case lookup_record(Records, TagVal, ArityVal - 1) of
{ok, Type} ->
- AllOpaques = State#state.opaques,
case t_opaque_match_record(Type, AllOpaques) of
[Opaque] -> Opaque;
_ -> Type
@@ -1287,7 +1308,7 @@ get_bif_constr({erlang, is_record, 3}, Dst, [Var, Tag, Arity] = Args, State) ->
DstFun = fun(Map) ->
[TmpVar, TmpTag, TmpArity] = TmpArgTypes = lookup_type_list(Args, Map),
TmpArgTypes2 =
- case lists:member(TmpVar, State#state.opaques) of
+ case lists:member(TmpVar, AllOpaques) of
true ->
case t_is_integer(TmpArity) of
true ->
@@ -1297,7 +1318,8 @@ get_bif_constr({erlang, is_record, 3}, Dst, [Var, Tag, Arity] = Args, State) ->
true ->
case t_atom_vals(TmpTag) of
[TmpTagVal] ->
- case state__lookup_record(State, TmpTagVal, TmpArityVal - 1) of
+ case lookup_record(Records, TmpTagVal,
+ TmpArityVal - 1) of
{ok, TmpType} ->
case t_is_none(t_inf(TmpType, TmpVar, opaque)) of
true -> TmpArgTypes;
@@ -1526,9 +1548,10 @@ get_bif_constr({erlang, element, 2} = _BIF, Dst, Args,
case t_is_none(GenType) of
true -> ?debug("Bif: ~w failed\n", [_BIF]), throw(error);
false ->
+ Opaques = State#state.opaques,
Fun = fun(Map) ->
[I, T] = ATs = lookup_type_list(Args, Map),
- ATs2 = case lists:member(T, State#state.opaques) of
+ ATs2 = case lists:member(T, Opaques) of
true -> [I, erl_types:t_opaque_structure(T)];
false -> ATs
end,
@@ -1546,7 +1569,7 @@ get_bif_constr({erlang, element, 2} = _BIF, Dst, Args,
end;
get_bif_constr({M, F, A} = _BIF, Dst, Args, State) ->
GenType = erl_bif_types:type(M, F, A),
- Opaques = State#state.opaques,
+ Opaques = State#state.opaques,
case t_is_none(GenType) of
true -> ?debug("Bif: ~w failed\n", [_BIF]), throw(error);
false ->
@@ -1612,11 +1635,12 @@ get_bif_test_constr(Dst, Arg, Type, State) ->
end
end,
ArgV = ?mk_fun_var(ArgFun, [Dst]),
+ Opaques = State#state.opaques,
DstFun = fun(Map) ->
ArgType = lookup_type(Arg, Map),
case t_is_none(t_inf(ArgType, Type)) of
true ->
- case lists:member(ArgType, State#state.opaques) of
+ case lists:member(ArgType, Opaques) of
true ->
OpaqueStruct = erl_types:t_opaque_structure(ArgType),
case t_is_none(t_inf(OpaqueStruct, Type)) of
@@ -1649,18 +1673,23 @@ get_bif_test_constr(Dst, Arg, Type, State) ->
solve([Fun], State) ->
?debug("============ Analyzing Fun: ~w ===========\n",
[debug_lookup_name(Fun)]),
- solve_fun(Fun, dict:new(), State);
+ solve_fun(Fun, map_new(), State);
solve([_|_] = SCC, State) ->
?debug("============ Analyzing SCC: ~w ===========\n",
[[debug_lookup_name(F) || F <- SCC]]),
- solve_scc(SCC, dict:new(), State, false).
+ {Parallel, NewState} =
+ case parallel_split(SCC) of
+ false -> {false, State};
+ SplitSCC -> {SplitSCC, minimize_state(State)}
+ end,
+ solve_scc(SCC, Parallel, map_new(), NewState, false).
solve_fun(Fun, FunMap, State) ->
Cs = state__get_cs(Fun, State),
Deps = get_deps(Cs),
Ref = mk_constraint_ref(Fun, Deps),
%% Note that functions are always considered to succeed.
- {ok, _MapDict, NewMap} = solve_ref_or_list(Ref, FunMap, dict:new(), State),
+ NewMap = solve(Fun, Ref, FunMap, State),
NewType = lookup_type(Fun, NewMap),
NewFunMap1 = case state__get_rec_var(Fun, State) of
error -> FunMap;
@@ -1668,21 +1697,23 @@ solve_fun(Fun, FunMap, State) ->
end,
enter_type(Fun, NewType, NewFunMap1).
-solve_scc(SCC, Map, State, TryingUnit) ->
- State1 = state__mark_as_non_self_rec(SCC, State),
+solve_scc(SCC, Parallel, Map, State, TryingUnit) ->
Vars0 = [{Fun, state__get_rec_var(Fun, State)} || Fun <- SCC],
Vars = [Var || {_, {ok, Var}} <- Vars0],
Funs = [Fun || {Fun, {ok, _}} <- Vars0],
Types = unsafe_lookup_type_list(Funs, Map),
RecTypes = [t_limit(Type, ?TYPE_LIMIT) || Type <- Types],
CleanMap = lists:foldl(fun(Fun, AccFunMap) ->
- dict:erase(t_var_name(Fun), AccFunMap)
+ erase_type(t_var_name(Fun), AccFunMap)
end, Map, SCC),
Map1 = enter_type_lists(Vars, RecTypes, CleanMap),
?debug("Checking SCC: ~w\n", [[debug_lookup_name(F) || F <- SCC]]),
- SolveFun = fun(X, Y) -> scc_fold_fun(X, Y, State1) end,
- Map2 = lists:foldl(SolveFun, Map1, 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
true ->
?debug("SCC ~w reached fixpoint\n", [SCC]),
@@ -1696,20 +1727,134 @@ solve_scc(SCC, 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, Map3, State, true);
+ solve_scc(SCC, Parallel, Map3, State, 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, Map2, State, TryingUnit)
+ 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},
+ opaques = Opaques,
+ solvers = Solvers
+ }) ->
+ ETSCMap = ets:new(cmap,[{read_concurrency, true}]),
+ ETSPropTypes = ets:new(prop_types,[{read_concurrency, true}]),
+ 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},
+ opaques = Opaques,
+ solvers = Solvers
+ }.
+
+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
end.
+receive_scc_result() ->
+ receive
+ {scc_fun, Res} -> Res
+ end.
+
+send_scc_result(Parent, Res) ->
+ Parent ! {scc_fun, Res}.
+
+%%------------------------------------------------------------------------------
+
scc_fold_fun(F, FunMap, State) ->
Deps = get_deps(state__get_cs(F, State)),
Cs = mk_constraint_ref(F, Deps),
%% Note that functions are always considered to succeed.
- {ok, _NewMapDict, Map} = solve_ref_or_list(Cs, FunMap, dict:new(), State),
+ Map = solve(F, Cs, FunMap, State),
NewType0 = unsafe_lookup_type(F, Map),
NewType = t_limit(NewType0, ?TYPE_LIMIT),
NewFunMap = case state__get_rec_var(F, State) of
@@ -1722,15 +1867,440 @@ scc_fold_fun(F, FunMap, State) ->
format_type(NewType)]),
NewFunMap.
+solve(Fun, Cs, FunMap, State) ->
+ Solvers = State#state.solvers,
+ R = [solver(S, solve_fun(S, Fun, Cs, FunMap, State)) || S <- Solvers],
+ check_solutions(R, Fun, no_solver, no_map).
+
+solver(Solver, SolveFun) ->
+ ?debug("Start solver ~w\n", [Solver]),
+ try timer:tc(SolveFun) of
+ {Time, {ok, Map}} ->
+ ?debug("End solver ~w (~w microsecs)\n", [Solver, Time]),
+ {Solver, Map, Time};
+ {_, _R} ->
+ ?debug("Solver ~w returned unexpected result:\n ~P\n",
+ [Solver, _R, 60]),
+ throw(error)
+ catch E:R ->
+ io:format("Solver ~w failed: ~w:~p\n ~p\n",
+ [Solver, E, R, erlang:get_stacktrace()]),
+ throw(error)
+ end.
+
+solve_fun(v1, _Fun, Cs, FunMap, State) ->
+ fun() ->
+ {ok, _MapDict, NewMap} = solve_ref_or_list(Cs, FunMap, dict:new(), State),
+ {ok, NewMap}
+ end;
+solve_fun(v2, Fun, _Cs, FunMap, State) ->
+ fun() -> v2_solve_ref(Fun, FunMap, State) end.
+
+check_solutions([], _Fun, _S, Map) ->
+ Map;
+check_solutions([{S1,Map1,_Time1}|Maps], Fun, S, Map) ->
+ ?debug("Solver ~w needed ~w microsecs\n", [S1, _Time1]),
+ case Map =:= no_map orelse sane_maps(Map, Map1, [Fun], S, S1) of
+ true ->
+ check_solutions(Maps, Fun, S1, Map1);
+ false ->
+ ?debug("Constraint solvers do not agree on ~w\n", [Fun]),
+ pp_map(atom_to_list(S), Map),
+ pp_map(atom_to_list(S1), Map1),
+ io:format("A bug was found. Please report it, and use the option "
+ "`--solver v1' until the bug has been fixed.\n"),
+ throw(error)
+ end.
+
+sane_maps(Map1, Map2, Keys, _S1, _S2) ->
+ lists:all(fun(Key) ->
+ V1 = unsafe_lookup_type(Key, Map1),
+ V2 = unsafe_lookup_type(Key, Map2),
+ case t_is_equal(V1, V2) of
+ true -> true;
+ false ->
+ ?debug("Constraint solvers do not agree on ~w\n", [Key]),
+ ?debug("~w: ~s\n",
+ [_S1, format_type(unsafe_lookup_type(Key, Map1))]),
+ ?debug("~w: ~s\n",
+ [_S2, format_type(unsafe_lookup_type(Key, Map2))]),
+ false
+ end
+ end, Keys).
+
+%% Solver v2
+
+-record(v2_state, {constr_data = dict:new() :: dict(),
+ state :: #state{}}).
+
+v2_solve_ref(Fun, Map, State) ->
+ V2State = #v2_state{state = State},
+ {ok, NewMap, _, _} = v2_solve_reference(Fun, Map, V2State),
+ {ok, NewMap}.
+
+v2_solve(#constraint{}=C, Map, V2State) ->
+ State = V2State#v2_state.state,
+ case solve_one_c(C, Map, State#state.opaques) of
+ error ->
+ report_failed_constraint(C, Map),
+ {error, V2State};
+ {ok, {NewMap, U}} ->
+ {ok, NewMap, V2State, U}
+ end;
+v2_solve(#constraint_list{type = disj}=C, Map, V2State) ->
+ v2_solve_disjunct(C, Map, V2State);
+v2_solve(#constraint_list{type = conj}=C, Map, V2State) ->
+ v2_solve_conjunct(C, Map, V2State);
+v2_solve(#constraint_ref{id = Id}, Map, V2State) ->
+ v2_solve_reference(Id, Map, V2State).
+
+v2_solve_reference(Id, Map, V2State0) ->
+ ?debug("Checking ref to fun: ~w\n", [debug_lookup_name(Id)]),
+ pp_map("Map", Map),
+ pp_constr_data("solve_ref", V2State0),
+ Map1 = restore_local_map(V2State0, Id, Map),
+ State = V2State0#v2_state.state,
+ Cs = state__get_cs(Id, State),
+ Res =
+ case state__is_self_rec(Id, State) of
+ true -> v2_solve_self_recursive(Cs, Map1, Id, t_none(), V2State0);
+ false -> v2_solve(Cs, Map1, V2State0)
+ end,
+ {FunType, V2State} =
+ case Res of
+ {error, V2State1} ->
+ ?debug("Error solving for function ~p\n", [debug_lookup_name(Id)]),
+ Arity = state__fun_arity(Id, State),
+ FunType0 =
+ case state__prop_domain(t_var_name(Id), State) of
+ error -> t_fun(Arity, t_none());
+ {ok, Dom} -> t_fun(Dom, t_none())
+ end,
+ {FunType0, V2State1};
+ {ok, NewMap, V2State1, U} ->
+ ?debug("Done solving fun: ~p\n", [debug_lookup_name(Id)]),
+ FunType0 = lookup_type(Id, NewMap),
+ V2State2 = save_local_map(V2State1, Id, U, NewMap),
+ {FunType0, V2State2}
+ end,
+ ?debug("ref Id=~w Assigned ~s\n", [Id, format_type(FunType)]),
+ {NewMap1, U1} = enter_var_type(Id, FunType, Map),
+ {NewMap2, U2} =
+ case state__get_rec_var(Id, State) of
+ {ok, Var} -> enter_var_type(Var, FunType, NewMap1);
+ error -> {NewMap1, []}
+ end,
+ {ok, NewMap2, V2State, lists:umerge(U1, U2)}.
+
+v2_solve_self_recursive(Cs, Map, Id, RecType0, V2State0) ->
+ ?debug("Solving self recursive ~w\n", [debug_lookup_name(Id)]),
+ State = V2State0#v2_state.state,
+ {ok, RecVar} = state__get_rec_var(Id, State),
+ ?debug("OldRecType ~s\n", [format_type(RecType0)]),
+ RecType = t_limit(RecType0, ?TYPE_LIMIT),
+ {Map1, U0} = enter_var_type(RecVar, RecType, Map),
+ V2State1 = save_updated_vars1(V2State0, Cs, U0), % Probably not necessary
+ case v2_solve(Cs, Map1, V2State1) of
+ {error, _V2State}=Error ->
+ case t_is_none(RecType0) of
+ true ->
+ %% Try again and assume that this is a non-terminating function.
+ Arity = state__fun_arity(Id, State),
+ NewRecType = t_fun(lists:duplicate(Arity, t_any()), t_unit()),
+ v2_solve_self_recursive(Cs, Map, Id, NewRecType, V2State0);
+ false ->
+ Error
+ end;
+ {ok, NewMap, V2State, U} ->
+ pp_map("recursive finished", NewMap),
+ NewRecType = unsafe_lookup_type(Id, NewMap),
+ case t_is_equal(NewRecType, RecType0) of
+ true ->
+ {NewMap2, U1} = enter_var_type(RecVar, NewRecType, NewMap),
+ {ok, NewMap2, V2State, lists:umerge(U, U1)};
+ false ->
+ v2_solve_self_recursive(Cs, Map, Id, NewRecType, V2State0)
+ end
+ end.
+
+enter_var_type(Var, Type, Map0) ->
+ {Map, Vs} = enter_type2(Var, Type, Map0),
+ {Map, [t_var_name(V) || V <- Vs]}.
+
+v2_solve_disjunct(Disj, Map, V2State0) ->
+ #constraint_list{type = disj, id = _Id, list = Cs, masks = Masks} = Disj,
+ ?debug("disjunct Id=~w~n", [_Id]),
+ pp_map("Map", Map),
+ pp_constr_data("disjunct", V2State0),
+ case get_flags(V2State0, Disj) of
+ {V2State1, failed_list} -> {error, V2State1}; % cannot happen
+ {V2State1, Flags} when Flags =/= [] ->
+ {ok, V2State, Eval, UL, MapL0, Uneval, Failed} =
+ v2_solve_disj(Flags, Cs, 1, Map, V2State1, [], [], [], [], false),
+ ?debug("disj ending _Id=~w Eval=~w, |Uneval|=~w |UL|=~w~n",
+ [_Id, Eval, length(Uneval), length(UL)]),
+ if Eval =:= [], Uneval =:= [] ->
+ {error, failed_list(Disj, V2State0)};
+ true ->
+ {Is0, UnIds} = lists:unzip(Uneval),
+ MapL = [restore_local_map(V2State, Id, Map) ||
+ Id <- UnIds] ++ MapL0,
+ %% If some branch has just failed every variable of the
+ %% non-failed branches need to be checked, not just the
+ %% updated ones.
+ U0 = case Failed of
+ false -> lists:umerge(UL);
+ true -> constrained_keys(MapL)
+ end,
+ if U0 =:= [] -> {ok, Map, V2State, []};
+ true ->
+ NotFailed = lists:umerge(Is0, Eval),
+ U1 = [V || V <- U0,
+ var_occurs_everywhere(V, Masks, NotFailed)],
+ NewMap = join_maps(U1, MapL, Map),
+ pp_map("NewMap", NewMap),
+ U = updated_vars_only(U1, Map, NewMap),
+ ?debug("disjunct finished _Id=~w\n", [_Id]),
+ {ok, NewMap, V2State, U}
+ end
+ end
+ end.
+
+var_occurs_everywhere(V, Masks, NotFailed) ->
+ ordsets:is_subset(NotFailed, get_mask(V, Masks)).
+
+v2_solve_disj([I|Is], [C|Cs], I, Map0, V2State0, UL, MapL, Eval, Uneval,
+ Failed0) ->
+ Id = C#constraint_list.id,
+ Map1 = restore_local_map(V2State0, Id, Map0),
+ case v2_solve(C, Map1, V2State0) of
+ {error, V2State} ->
+ ?debug("disj error I=~w~n", [I]),
+ Failed = Failed0 orelse not is_failed_list(C, V2State0),
+ v2_solve_disj(Is, Cs, I+1, Map0, V2State, UL, MapL, Eval, Uneval, Failed);
+ {ok, Map, V2State1, U} ->
+ ?debug("disj I=~w U=~w~n", [I, U]),
+ V2State = save_local_map(V2State1, Id, U, Map),
+ pp_map("DMap", Map),
+ v2_solve_disj(Is, Cs, I+1, Map0, V2State, [U|UL], [Map|MapL],
+ [I|Eval], Uneval, Failed0)
+ end;
+v2_solve_disj([], [], _I, _Map, V2State, UL, MapL, Eval, Uneval, Failed) ->
+ {ok, V2State, lists:reverse(Eval), UL, MapL, lists:reverse(Uneval), Failed};
+v2_solve_disj(Is, [C|Cs], I, Map, V2State, UL, MapL, Eval, Uneval0, Failed) ->
+ Uneval = [{I,C#constraint_list.id} ||
+ not is_failed_list(C, V2State)] ++ Uneval0,
+ 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],
+ Part1 =
+ case dict: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)}.
+
+restore_local_map(#v2_state{constr_data = ConData}, Id, Map0) ->
+ case dict:find(Id, ConData) of
+ error -> Map0;
+ {ok, failed} -> Map0;
+ {ok, {[],_}} -> Map0;
+ {ok, {Part0,U}} ->
+ Part = [{K,V} || {K,V} <- 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("Map0", Map0),
+ Map = lists:foldl(fun({K,V}, D) -> dict:store(K, V, D)end, Map0, Part),
+ pp_map("Map", Map),
+ Map
+ end.
+
+v2_solve_conjunct(Conj, Map, V2State0) ->
+ #constraint_list{type = conj, list = Cs} = Conj,
+ ?debug("conjunct Id=~w~n", [Conj#constraint_list.id]),
+ IsFlat = case Cs of [#constraint{}|_] -> true; _ -> false end,
+ case get_flags(V2State0, Conj) of
+ {V2State, failed_list} -> {error, V2State};
+ {V2State, Flags} ->
+ v2_solve_conj(Flags, Cs, 1, Map, Conj, IsFlat, V2State, [], [], [],
+ Map, Flags)
+ end.
+
+%% LastMap and LastFlags are used for loop detection.
+v2_solve_conj([I|Is], [Cs|Tail], I, Map0, Conj, IsFlat, V2State0,
+ UL, NewFs0, VarsUp, LastMap, LastFlags) ->
+ ?debug("conj Id=~w I=~w~n", [Conj#constraint_list.id, I]),
+ true = IsFlat =:= is_record(Cs, constraint),
+ pp_constr_data("conj", V2State0),
+ case v2_solve(Cs, Map0, V2State0) of
+ {error, V2State1} -> {error, failed_list(Conj, V2State1)};
+ {ok, Map, V2State1, []} ->
+ v2_solve_conj(Is, Tail, I+1, Map, Conj, IsFlat, V2State1,
+ UL, NewFs0, VarsUp, LastMap, LastFlags);
+ {ok, Map, V2State1, U} when IsFlat -> % optimization
+ %% It is ensured by enumerate_constraints() that every
+ %% #constraint{} has a conjunct as parent, and that such a
+ %% parent has nothing but #constraint{}:s as children, a fact
+ %% which is used here to simplify the flag calculation.
+ Mask = lists:umerge([get_mask(V, Conj#constraint_list.masks) || V <- U]),
+ {Is1, NewF} = add_mask_to_flags(Is, Mask, I, []),
+ NewFs = [NewF|NewFs0],
+ v2_solve_conj(Is1, Tail, I+1, Map, Conj, IsFlat, V2State1,
+ [U|UL], NewFs, VarsUp, LastMap, LastFlags);
+ {ok, Map, V2State1, U} ->
+ #constraint_list{masks = Masks, list = AllCs} = Conj,
+ M = lists:keydelete(I, 1, vars_per_child(U, Masks)),
+ {V2State2, NewF0} = save_updated_vars_list(AllCs, M, V2State1),
+ {NewF, F} = lists:splitwith(fun(J) -> J < I end, NewF0),
+ Is1 = lists:umerge(Is, F),
+ NewFs = [NewF|NewFs0],
+ v2_solve_conj(Is1, Tail, I+1, Map, Conj, IsFlat, V2State2,
+ [U|UL], NewFs, VarsUp, LastMap, LastFlags)
+ end;
+v2_solve_conj([], _Cs, _I, Map, Conj, IsFlat, V2State, UL, NewFs, VarsUp,
+ LastMap, LastFlags) ->
+ U = lists:umerge(UL),
+ case lists:umerge(NewFs) of
+ [] ->
+ ?debug("conjunct finished Id=~w\n", [Conj#constraint_list.id]),
+ {ok, Map, V2State, lists:umerge([U|VarsUp])};
+ NewFlags when NewFlags =:= LastFlags, Map =:= LastMap ->
+ %% A loop was detected! The cause is some bug, possibly in erl_types.
+ %% The evaluation continues, but the results can be wrong.
+ report_detected_loop(Conj),
+ {ok, Map, V2State, lists:umerge([U|VarsUp])};
+ NewFlags ->
+ #constraint_list{type = conj, list = Cs} = Conj,
+ v2_solve_conj(NewFlags, Cs, 1, Map, Conj, IsFlat, V2State,
+ [], [], [U|VarsUp], Map, NewFlags)
+ end;
+v2_solve_conj(Is, [_|Tail], I, Map, Conj, IsFlat, V2State, UL, NewFs, VarsUp,
+ LastMap, LastFlags) ->
+ v2_solve_conj(Is, Tail, I+1, Map, Conj, IsFlat, V2State, UL, NewFs, VarsUp,
+ LastMap, LastFlags).
+
+-ifdef(DEBUG_LOOP_DETECTION).
+report_detected_loop(Conj) ->
+ io:format("A loop was detected in ~w\n", [Conj#constraint_list.id]).
+-else.
+report_detected_loop(_) ->
+ ok.
+-endif.
+
+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)}.
+
+get_mask(V, {d, Masks}) ->
+ case dict: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
+ error ->
+ ?debug("get_flags Id=~w Flags=all ~w\n", [Id, length(Cs)]),
+ V2State = V2State0#v2_state{constr_data = dict:store(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)},
+ save_updated_vars_list(Cs, vars_per_child(U, Masks), V2State)
+ end.
+
+vars_per_child(U, Masks) ->
+ family([{I, V} || V <- lists:usort(U), I <- get_mask(V, Masks)]).
+
+save_updated_vars_list(Cs, IU, V2State) ->
+ save_updated_vars_list1(Cs, IU, V2State, 1, []).
+
+save_updated_vars_list1([C|Cs], [{I,U}|IU], V2State0, I, Is) ->
+ V2State = save_updated_vars(C, U, V2State0),
+ save_updated_vars_list1(Cs, IU, V2State, I+1, [I|Is]);
+save_updated_vars_list1([], [], V2State, _I, Is) ->
+ {V2State, lists:reverse(Is)};
+save_updated_vars_list1([_|Cs], IU, V2State, I, Is) ->
+ save_updated_vars_list1(Cs, IU, V2State, I+1, Is).
+
+save_updated_vars(#constraint{}, _, V2State) ->
+ V2State;
+save_updated_vars(#constraint_list{}=C, U, V2State0) ->
+ save_updated_vars1(V2State0, C, U);
+save_updated_vars(#constraint_ref{id = Id}, U, V2State) ->
+ Cs = state__get_cs(Id, V2State#v2_state.state),
+ save_updated_vars(Cs, 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
+ 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)}
+ end.
+
+-ifdef(DEBUG).
+pp_constr_data(_Tag, #v2_state{constr_data = D}) ->
+ io:format("Constr data at ~p\n", [_Tag]),
+ _ = [begin
+ case _PartU of
+ {_Part, _U} ->
+ io:format("Id: ~w Vars: ~w\n", [_Id, _U]),
+ [pp_map("Part", dict:from_list(_Part)) || _Part =/= []];
+ failed ->
+ io:format("Id: ~w failed list\n", [_Id])
+ end
+ end ||
+ {_Id, _PartU} <- lists:keysort(1, dict:to_list(D))],
+ ok.
+
+-else.
+pp_constr_data(_Tag, _V2State) ->
+ ok.
+-endif.
+
+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)}.
+
+is_failed_list(#constraint_list{id = Id}, #v2_state{constr_data = D}) ->
+ dict: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
- error -> {dict:new(), false};
+ error -> {map_new(), false};
{ok, M} -> {M, true}
end,
?debug("Checking ref to fun: ~w\n", [debug_lookup_name(Id)]),
+ %% Note: mk_constraint_ref() has already removed Id from Deps. The
+ %% reason for doing it there is that it makes it easy for
+ %% calculate_masks() to make the corresponding adjustment for
+ %% version v2.
CheckDeps = ordsets:del_element(t_var_name(Id), Deps),
+ true = CheckDeps =:= Deps,
case Check andalso maps_are_equal(OldLocalMap, Map, CheckDeps) of
true ->
?debug("Equal\n", []),
@@ -1743,49 +2313,50 @@ solve_ref_or_list(#constraint_ref{id = Id, deps = Deps},
true -> solve_self_recursive(Cs, Map, MapDict, Id, t_none(), State);
false -> solve_ref_or_list(Cs, Map, MapDict, State)
end,
- case Res of
- {error, NewMapDict} ->
- ?debug("Error solving for function ~p\n", [debug_lookup_name(Id)]),
- Arity = state__fun_arity(Id, State),
- FunType =
- case state__prop_domain(t_var_name(Id), State) of
- error -> t_fun(Arity, t_none());
- {ok, Dom} -> t_fun(Dom, t_none())
- end,
- NewMap1 = enter_type(Id, FunType, Map),
- NewMap2 =
- case state__get_rec_var(Id, State) of
- {ok, Var} -> enter_type(Var, FunType, NewMap1);
- error -> NewMap1
- end,
- {ok, dict:store(Id, NewMap2, NewMapDict), NewMap2};
- {ok, NewMapDict, NewMap} ->
- ?debug("Done solving fun: ~p\n", [debug_lookup_name(Id)]),
- FunType = lookup_type(Id, NewMap),
- NewMap1 = enter_type(Id, FunType, Map),
- NewMap2 =
- case state__get_rec_var(Id, State) of
- {ok, Var} -> enter_type(Var, FunType, NewMap1);
- error -> NewMap1
- end,
- {ok, dict:store(Id, NewMap2, NewMapDict), NewMap2}
- end
+ {NewMapDict, FunType} =
+ case Res of
+ {error, NewMapDict0} ->
+ ?debug("Error solving for function ~p\n", [debug_lookup_name(Id)]),
+ Arity = state__fun_arity(Id, State),
+ FunType0 =
+ case state__prop_domain(t_var_name(Id), State) of
+ error -> t_fun(Arity, t_none());
+ {ok, Dom} -> t_fun(Dom, t_none())
+ end,
+ {NewMapDict0, FunType0};
+ {ok, NewMapDict0, NewMap} ->
+ ?debug("Done solving fun: ~p\n", [debug_lookup_name(Id)]),
+ FunType0 = lookup_type(Id, NewMap),
+ {NewMapDict0, FunType0}
+ end,
+ ?debug(" Id=~w Assigned ~s\n", [Id, format_type(FunType)]),
+ NewMap1 = enter_type(Id, FunType, Map),
+ NewMap2 =
+ case state__get_rec_var(Id, State) of
+ {ok, Var} -> enter_type(Var, FunType, NewMap1);
+ error -> NewMap1
+ end,
+ {ok, dict:store(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
- error -> {dict:new(), false};
+ error -> {map_new(), false};
{ok, M} -> {M, true}
end,
?debug("Checking ref to list: ~w\n", [Id]),
- case Check andalso maps_are_equal(OldLocalMap, Map, Deps) of
+ if
+ OldLocalMap =:= error -> {error, MapDict};
true ->
- ?debug("~w equal ~w\n", [Type, Id]),
- {ok, MapDict, Map};
- false ->
- ?debug("~w not equal: ~w. Solving\n", [Type, Id]),
- solve_clist(Cs, Type, Id, Deps, MapDict, Map, State)
+ case Check andalso maps_are_equal(OldLocalMap, Map, Deps) of
+ true ->
+ ?debug("~w equal ~w\n", [Type, Id]),
+ {ok, MapDict, Map};
+ false ->
+ ?debug("~w not equal: ~w. Solving\n", [Type, Id]),
+ solve_clist(Cs, Type, Id, Deps, MapDict, Map, State)
+ end
end.
solve_self_recursive(Cs, Map, MapDict, Id, RecType0, State) ->
@@ -1793,8 +2364,8 @@ solve_self_recursive(Cs, Map, MapDict, Id, RecType0, State) ->
{ok, RecVar} = state__get_rec_var(Id, State),
?debug("OldRecType ~s\n", [format_type(RecType0)]),
RecType = t_limit(RecType0, ?TYPE_LIMIT),
- Map1 = enter_type(RecVar, RecType, dict:erase(t_var_name(Id), Map)),
- ?debug("\tMap in: ~p\n",[[{X, format_type(Y)}||{X, Y}<-dict:to_list(Map1)]]),
+ Map1 = enter_type(RecVar, RecType, erase_type(t_var_name(Id), Map)),
+ pp_map("Map1", Map1),
case solve_ref_or_list(Cs, Map1, MapDict, State) of
{error, _} = Error ->
case t_is_none(RecType0) of
@@ -1807,8 +2378,7 @@ solve_self_recursive(Cs, Map, MapDict, Id, RecType0, State) ->
Error
end;
{ok, NewMapDict, NewMap} ->
- ?debug("\tMap: ~p\n",
- [[{X, format_type(Y)} || {X, Y} <- dict:to_list(NewMap)]]),
+ pp_map("NewMap", NewMap),
NewRecType = unsafe_lookup_type(Id, NewMap),
case t_is_equal(NewRecType, RecType0) of
true ->
@@ -1820,7 +2390,8 @@ 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, _} = Error -> Error;
+ {error, NewMapDict} ->
+ {error, dict:store(Id, error, NewMapDict)};
{ok, NewMapDict, NewMap} = Ret ->
case Cs of
[_] ->
@@ -1842,7 +2413,7 @@ solve_clist(Cs, disj, Id, _Deps, MapDict, Map, State) ->
end,
{Maps, NewMapDict} = lists:mapfoldl(Fun, MapDict, Cs),
case [X || {ok, X} <- Maps] of
- [] -> {error, NewMapDict};
+ [] -> {error, dict:store(Id, error, NewMapDict)};
MapList ->
NewMap = join_maps(MapList),
{ok, dict:store(Id, NewMap, NewMapDict), NewMap}
@@ -1861,14 +2432,9 @@ solve_cs([#constraint_list{} = C|Tail], Map, MapDict, State) ->
solve_cs([#constraint{} = C|Tail], Map, MapDict, State) ->
case solve_one_c(C, Map, State#state.opaques) of
error ->
- ?debug("+++++++++++\nFailed: ~s :: ~s ~w ~s :: ~s\n+++++++++++\n",
- [format_type(C#constraint.lhs),
- format_type(lookup_type(C#constraint.lhs, Map)),
- C#constraint.op,
- format_type(C#constraint.rhs),
- format_type(lookup_type(C#constraint.rhs, Map))]),
+ report_failed_constraint(C, Map),
{error, MapDict};
- {ok, NewMap} ->
+ {ok, {NewMap, _U}} ->
solve_cs(Tail, NewMap, MapDict, State)
end;
solve_cs([], Map, MapDict, _State) ->
@@ -1889,7 +2455,11 @@ solve_one_c(#constraint{lhs = Lhs, rhs = Rhs, op = Op}, Map, Opaques) ->
eq ->
case solve_subtype(Lhs, Inf, Map, Opaques) of
error -> error;
- {ok, Map1} -> solve_subtype(Rhs, Inf, Map1, Opaques)
+ {ok, {Map1, U1}} ->
+ case solve_subtype(Rhs, Inf, Map1, Opaques) of
+ error -> error;
+ {ok, {Map2, U2}} -> {ok, {Map2, lists:umerge(U1, U2)}}
+ end
end
end
end.
@@ -1912,18 +2482,34 @@ solve_subtype(Type, Inf, Map, Opaques) ->
end.
%% end.
+report_failed_constraint(_C, _Map) ->
+ ?debug("+++++++++++\nFailed: ~s :: ~s ~w ~s :: ~s\n+++++++++++\n",
+ [format_type(_C#constraint.lhs),
+ format_type(lookup_type(_C#constraint.lhs, _Map)),
+ _C#constraint.op,
+ format_type(_C#constraint.rhs),
+ format_type(lookup_type(_C#constraint.rhs, _Map))]).
+
%% ============================================================================
%%
%% Maps and types.
%%
%% ============================================================================
+map_new() ->
+ dict:new().
+
+join_maps([Map]) ->
+ Map;
join_maps(Maps) ->
- Keys = lists:foldl(fun(TmpMap, AccKeys) ->
- [Key || Key <- AccKeys, dict:is_key(Key, TmpMap)]
- end,
- dict:fetch_keys(hd(Maps)), tl(Maps)),
- join_maps(Keys, Maps, dict:new()).
+ Keys = constrained_keys(Maps),
+ join_maps(Keys, Maps, map_new()).
+
+constrained_keys(Maps) ->
+ lists:foldl(fun(TmpMap, AccKeys) ->
+ [Key || Key <- AccKeys, dict:is_key(Key, TmpMap)]
+ end,
+ dict:fetch_keys(hd(Maps)), tl(Maps)).
join_maps([Key|Left], Maps = [Map|MapsLeft], AccMap) ->
NewType = join_one_key(Key, MapsLeft, lookup_type(Key, Map)),
@@ -1986,13 +2572,13 @@ enter_type(Key, Val, Map) when is_integer(Key) ->
?debug("Entering ~s :: ~s\n", [format_type(t_var(Key)), format_type(Val)]),
case t_is_any(Val) of
true ->
- dict:erase(Key, Map);
+ erase_type(Key, Map);
false ->
LimitedVal = t_limit(Val, ?INTERNAL_TYPE_LIMIT),
case dict:find(Key, Map) of
{ok, LimitedVal} -> Map;
- {ok, _} -> dict:store(Key, LimitedVal, Map);
- error -> dict:store(Key, LimitedVal, Map)
+ {ok, _} -> map_store(Key, LimitedVal, Map);
+ error -> map_store(Key, LimitedVal, Map)
end
end;
enter_type(Key, Val, Map) ->
@@ -2000,13 +2586,13 @@ enter_type(Key, Val, Map) ->
KeyName = t_var_name(Key),
case t_is_any(Val) of
true ->
- dict:erase(KeyName, Map);
+ erase_type(KeyName, Map);
false ->
LimitedVal = t_limit(Val, ?INTERNAL_TYPE_LIMIT),
case dict:find(KeyName, Map) of
{ok, LimitedVal} -> Map;
- {ok, _} -> dict:store(KeyName, LimitedVal, Map);
- error -> dict:store(KeyName, LimitedVal, Map)
+ {ok, _} -> map_store(KeyName, LimitedVal, Map);
+ error -> map_store(KeyName, LimitedVal, Map)
end
end.
@@ -2016,11 +2602,25 @@ enter_type_lists([Key|KeyTail], [Val|ValTail], Map) ->
enter_type_lists([], [], Map) ->
Map.
-enter_type_list([{Key, Val}|Tail], Map) ->
+enter_type_list(KeyVals, Map) ->
+ enter_type_list(KeyVals, Map, []).
+
+enter_type_list([{Key, Val}|Tail], Map, U0) ->
+ {Map1,U1} = enter_type2(Key, Val, Map),
+ enter_type_list(Tail, Map1, U1++U0);
+enter_type_list([], Map, U) ->
+ {Map, ordsets:from_list(U)}.
+
+enter_type2(Key, Val, Map) ->
Map1 = enter_type(Key, Val, Map),
- enter_type_list(Tail, Map1);
-enter_type_list([], Map) ->
- Map.
+ {Map1, [Key || not is_same(Key, Map, Map1)]}.
+
+map_store(Key, Val, Map) ->
+ ?debug("Storing ~w :: ~s\n", [Key, format_type(Val)]),
+ dict:store(Key, Val, Map).
+
+erase_type(Key, Map) ->
+ dict:erase(Key, Map).
lookup_type_list(List, Map) ->
[lookup_type(X, Map) || X <- List].
@@ -2071,17 +2671,41 @@ mk_var_no_lit(Var) ->
mk_var_no_lit_list(List) ->
[mk_var_no_lit(X) || X <- List].
+updated_vars_only(U, OldMap, NewMap) ->
+ [V || V <- U, not is_same(V, OldMap, NewMap)].
+
+is_same(Key, Map1, Map2) ->
+ t_is_equal(lookup_type(Key, Map1), lookup_type(Key, Map2)).
+
+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))]]).
+
%% ============================================================================
%%
%% The State.
%%
%% ============================================================================
-new_state(SCC0, NextLabel, CallGraph, Plt, PropTypes) ->
- NameMap = dict:from_list([{MFA, Var} || {MFA, {Var, _Fun}, _Rec} <- SCC0]),
+new_state(SCC0, NextLabel, CallGraph, Plt, PropTypes, Solvers) ->
+ List = [{MFA, Var} || {MFA, {Var, _Fun}, _Rec} <- SCC0],
+ NameMap = dict:from_list(List),
+ MFAs = [MFA || {MFA, _Var} <- List],
SCC = [mk_var(Fun) || {_MFA, {_Var, Fun}, _Rec} <- SCC0],
+ SelfRec =
+ case SCC of
+ [OneF] ->
+ Label = t_var_name(OneF),
+ case dialyzer_callgraph:is_self_rec(Label, CallGraph) of
+ true -> OneF;
+ false -> false
+ end;
+ _Many -> false
+ end,
#state{callgraph = CallGraph, name_map = NameMap, next_label = NextLabel,
- prop_types = PropTypes, plt = Plt, scc = ordsets:from_list(SCC)}.
+ prop_types = {d, PropTypes}, plt = Plt, scc = ordsets:from_list(SCC),
+ mfas = MFAs, self_rec = SelfRec, solvers = Solvers}.
state__set_rec_dict(State, RecDict) ->
State#state{records = RecDict}.
@@ -2091,15 +2715,6 @@ state__set_opaques(#state{records = RecDict} = State, {M, _F, _A}) ->
erl_types:module_builtin_opaques(M) ++ t_opaque_from_records(RecDict),
State#state{opaques = Opaques, module = M}.
-state__lookup_record(#state{records = Records}, Tag, Arity) ->
- case erl_types:lookup_record(Tag, Arity, Records) of
- {ok, Fields} ->
- {ok, t_tuple([t_from_term(Tag)|
- [FieldType || {_FieldName, FieldType} <- Fields]])};
- error ->
- error
- end.
-
state__set_in_match(State, Bool) ->
State#state{in_match = Bool}.
@@ -2189,14 +2804,21 @@ state__plt(#state{plt = PLT}) ->
state__new_constraint_context(State) ->
State#state{cs = []}.
-state__prop_domain(FunLabel, #state{prop_types = PropTypes}) ->
+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}}) ->
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 = PropTypes} = State) ->
+state__add_prop_constrs(Tree, #state{prop_types = {d, PropTypes}} = State) ->
Label = cerl_trees:get_label(Tree),
case dict:find(Label, PropTypes) of
error -> State;
@@ -2259,23 +2881,17 @@ 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 = Dict} = State) ->
+state__store_constrs(Id, Cs, #state{cmap = {d, Dict}} = State) ->
NewDict = dict:store(Id, Cs, Dict),
- State#state{cmap = NewDict}.
+ State#state{cmap = {d, NewDict}}.
-state__get_cs(Var, #state{cmap = Dict}) ->
+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).
-%% The functions here will not be treated as self recursive.
-%% These functions will need to be handled as such manually.
-state__mark_as_non_self_rec(SCC, #state{non_self_recs = NS} = State) ->
- State#state{non_self_recs = ordsets:union(NS, ordsets:from_list(SCC))}.
-
-state__is_self_rec(Fun, #state{callgraph = CallGraph, non_self_recs = NS}) ->
- case ordsets:is_element(Fun, NS) of
- true -> false;
- false -> dialyzer_callgraph:is_self_rec(t_var_name(Fun), CallGraph)
- end.
+state__is_self_rec(Fun, #state{self_rec = SelfRec}) ->
+ Fun =:= SelfRec.
state__store_funs(Vars0, Funs0, #state{fun_map = Map} = State) ->
debug_make_name_map(Vars0, Funs0),
@@ -2312,7 +2928,7 @@ mk_constraint(Lhs, Op, Rhs) ->
case Deps =:= [] of
true ->
%% This constraint is constant. Solve it immediately.
- case solve_one_c(C, dict:new(), []) of
+ case solve_one_c(C, map_new(), []) of
error -> throw(error);
_ ->
%% This is always true, keep it anyway for logistic reasons
@@ -2335,8 +2951,9 @@ constraint_opnd_is_any(Type) -> t_is_any(Type).
-ifdef(DEBUG).
--spec mk_fun_var(fun((_) -> erl_types:erl_type()), [erl_types:erl_type()],
- integer()) -> #fun_var{}.
+-spec mk_fun_var(integer(),
+ fun((_) -> erl_types:erl_type()),
+ [erl_types:erl_type()]) -> #fun_var{}.
mk_fun_var(Line, Fun, Types) ->
Deps = [t_var_name(Var) || Var <- t_collect_vars(t_product(Types))],
@@ -2384,7 +3001,9 @@ mk_constraints([], _Op, []) ->
[].
mk_constraint_ref(Id, Deps) ->
- #constraint_ref{id = Id, deps = Deps}.
+ %% See also solve_ref_or_list(), #constraint_ref{}.
+ Ds = ordsets:del_element(t_var_name(Id), Deps),
+ #constraint_ref{id = Id, deps = Ds}.
mk_constraint_list(Type, List) ->
List1 = ordsets:from_list(lift_lists(Type, List)),
@@ -2521,19 +3140,21 @@ enumerate_constraints([#constraint_ref{id = Id} = C|Tail], N, Acc, State) ->
enumerate_constraints([#constraint_list{type = conj, list = List} = C|Tail],
N, Acc, State) ->
%% Separate the flat constraints from the deep ones to make a
- %% separate fixpoint interation over the flat ones for speed.
- {Flat, Deep} = lists:splitwith(fun(#constraint{}) -> true;
+ %% separate fixpoint iteration over the flat ones for speed.
+ {Flat, Deep} = lists:partition(fun(#constraint{}) -> true;
(#constraint_list{}) -> false;
(#constraint_ref{}) -> false
end, List),
{NewFlat, N1, State1} = enumerate_constraints(Flat, N, [], State),
{NewDeep, N2, State2} = enumerate_constraints(Deep, N1, [], State1),
{NewList, N3} =
- case shorter_than_two(NewFlat) orelse (NewDeep =:= []) of
- true -> {NewFlat ++ NewDeep, N2};
- false ->
- {NewCLists, TmpN} = group_constraints_in_components(NewFlat, N2),
- {NewCLists ++ NewDeep, TmpN}
+ if
+ NewFlat =:= [] -> {NewDeep, N2};
+ NewDeep =:= [] -> {NewFlat, N2};
+ true ->
+ TmpCList = mk_conj_constraint_list(NewFlat),
+ {[TmpCList#constraint_list{id = {list, N2}}| NewDeep],
+ N2 + 1}
end,
NewAcc = [C#constraint_list{list = NewList, id = {list, N3}}|Acc],
enumerate_constraints(Tail, N3+1, NewAcc, State2);
@@ -2547,42 +3168,6 @@ enumerate_constraints([#constraint{} = C|Tail], N, Acc, State) ->
enumerate_constraints([], N, Acc, State) ->
{lists:reverse(Acc), N, State}.
-shorter_than_two([]) -> true;
-shorter_than_two([_]) -> true;
-shorter_than_two([_|_]) -> false.
-
-group_constraints_in_components(Cs, N) ->
- DepList = [Deps || #constraint{deps = Deps} <- Cs],
- case find_dep_components(DepList, []) of
- [_] -> {Cs, N};
- [_|_] = Components ->
- ConstrComp = [[C || #constraint{deps = D} = C <- Cs,
- ordsets:is_subset(D, Comp)]
- || Comp <- Components],
- lists:mapfoldl(fun(CComp, TmpN) ->
- TmpCList = mk_conj_constraint_list(CComp),
- {TmpCList#constraint_list{id = {list, TmpN}},
- TmpN + 1}
- end, N, ConstrComp)
- end.
-
-find_dep_components([Set|Left], AccComponents) ->
- {Component, Ungrouped} = find_dep_components(Left, Set, []),
- case Component =:= Set of
- true -> find_dep_components(Ungrouped, [Component|AccComponents]);
- false -> find_dep_components([Component|Ungrouped], AccComponents)
- end;
-find_dep_components([], AccComponents) ->
- AccComponents.
-
-find_dep_components([Set|Left], AccSet, Ungrouped) ->
- case ordsets:intersection(Set, AccSet) of
- [] -> find_dep_components(Left, AccSet, [Set|Ungrouped]);
- [_|_] -> find_dep_components(Left, ordsets:union(Set, AccSet), Ungrouped)
- end;
-find_dep_components([], AccSet, Ungrouped) ->
- {AccSet, Ungrouped}.
-
%% Put the fun ref constraints last in any conjunction since we need
%% to separate the environment from the interior of the function.
order_fun_constraints(State) ->
@@ -2613,7 +3198,9 @@ order_fun_constraints([#constraint_list{list = List, type = Type} = C|Tail],
end,
lists:mapfoldl(FoldFun, State, List)
end,
- NewAcc = [update_constraint_list(C, NewList)|Acc],
+ C1 = update_constraint_list(C, NewList),
+ Masks = calculate_masks(NewList, 1, []),
+ NewAcc = [update_masks(C1, Masks)|Acc],
order_fun_constraints(Tail, Funs, NewAcc, NewState);
order_fun_constraints([#constraint{} = C|Tail], Funs, Acc, State) ->
order_fun_constraints(Tail, Funs, [C|Acc], State);
@@ -2621,6 +3208,22 @@ order_fun_constraints([], Funs, Acc, State) ->
NewState = order_fun_constraints(Funs, State),
{lists:reverse(Acc)++Funs, NewState}.
+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.
+
%% ============================================================================
%%
%% Utilities.
@@ -2689,6 +3292,18 @@ find_constraint(Tuple, [#constraint_list{list = List}|Cs]) ->
find_constraint(Tuple, [_|Cs]) ->
find_constraint(Tuple, Cs).
+lookup_record(Records, Tag, Arity) ->
+ case erl_types:lookup_record(Tag, Arity, Records) of
+ {ok, Fields} ->
+ {ok, t_tuple([t_from_term(Tag)|
+ [FieldType || {_FieldName, FieldType} <- Fields]])};
+ error ->
+ error
+ end.
+
+family(L) ->
+ sofs:to_external(sofs:rel2fam(sofs:relation(L))).
+
%% ============================================================================
%%
%% Pretty printer and debug facilities.
@@ -2703,13 +3318,24 @@ find_constraint(Tuple, [_|Cs]) ->
-ifdef(DEBUG).
format_type(#fun_var{deps = Deps, origin = Origin}) ->
- io_lib:format("Fun@L~p(~s)",
- [Origin, lists:flatten([format_type(t_var(X))||X<-Deps])]);
+ L = [format_type(t_var(X)) || X <- Deps],
+ io_lib:format("Fun@L~p(~s)", [Origin, join_chars(L, ",")]);
format_type(Type) ->
case cerl:is_literal(Type) of
true -> io_lib:format("~w", [cerl:concrete(Type)]);
false -> erl_types:t_to_string(Type)
end.
+
+join_chars([], _Sep) ->
+ [];
+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
+ error -> Var;
+ {ok, Name} -> Name
+ end.
-endif.
-ifdef(DEBUG_NAME_MAP).
@@ -2728,12 +3354,6 @@ debug_make_name_map([Var|VarLeft], [Fun|FunLeft], Map) ->
debug_make_name_map([], [], Map) ->
Map.
-debug_lookup_name(Var) ->
- case dict:find(t_var_name(Var), get(dialyzer_typesig_map)) of
- error -> Var;
- {ok, Name} -> Name
- end.
-
-else.
debug_make_name_map(_Vars, _Funs) ->
ok.
@@ -2744,51 +3364,55 @@ pp_constrs_scc(SCC, State) ->
[pp_constrs(Fun, state__get_cs(Fun, State), State) || Fun <- SCC].
pp_constrs(Fun, Cs, State) ->
- io:format("Constraints for fun: ~w\n", [debug_lookup_name(Fun)]),
+ io:format("Constraints for fun: ~w", [debug_lookup_name(Fun)]),
MaxDepth = pp_constraints(Cs, State),
io:format("Depth: ~w\n", [MaxDepth]).
pp_constraints(Cs, State) ->
- Res = pp_constraints([Cs], none, 0, 0, State),
+ Res = pp_constraints([Cs], 0, 0, State),
io:nl(),
Res.
-pp_constraints([List|Tail], Separator, Level, MaxDepth,
- State) when is_list(List) ->
- pp_constraints(List++Tail, Separator, Level, MaxDepth, State);
-pp_constraints([#constraint_ref{id = Id}|Left], Separator,
- Level, MaxDepth, State) ->
+pp_constraints([List|Tail], Level, MaxDepth, State) when is_list(List) ->
+ pp_constraints(List++Tail, Level, MaxDepth, State);
+pp_constraints([#constraint_ref{id = Id}|Left], Level, MaxDepth, State) ->
Cs = state__get_cs(Id, State),
+ pp_indent(Level),
io:format("%Ref ~w%", [t_var_name(Id)]),
- pp_constraints([Cs|Left], Separator, Level, MaxDepth, State);
-pp_constraints([#constraint{lhs = Lhs, op = Op, rhs = Rhs}], _Separator,
- Level, MaxDepth, _State) ->
- io:format("~s ~w ~s", [format_type(Lhs), Op, format_type(Rhs)]),
+ pp_constraints([Cs|Left], Level, MaxDepth, State);
+pp_constraints([#constraint{}=C], Level, MaxDepth, _State) ->
+ pp_op(C, Level),
erlang:max(Level, MaxDepth);
-pp_constraints([#constraint{lhs = Lhs, op = Op, rhs = Rhs}|Tail], Separator,
- Level, MaxDepth, State) ->
- io:format("~s ~w ~s ~s ", [format_type(Lhs), Op, format_type(Rhs),Separator]),
- pp_constraints(Tail, Separator, Level, MaxDepth, State);
+pp_constraints([#constraint{}=C|Tail], Level, MaxDepth, State) ->
+ pp_op(C, Level),
+ pp_constraints(Tail, Level, MaxDepth, State);
pp_constraints([#constraint_list{type = Type, list = List, id = Id}],
- _Separator, Level, MaxDepth, State) ->
- io:format("%List ~w(", [Id]),
- NewSeparator = case Type of
- conj -> "*";
- disj -> "+"
- end,
- NewMaxDepth = pp_constraints(List, NewSeparator, Level + 1, MaxDepth, State),
+ Level, MaxDepth, State) ->
+ pp_indent(Level),
+ case Type of
+ conj -> io:format("Conj ~w (", [Id]);
+ disj -> io:format("Disj ~w (", [Id])
+ end,
+ NewMaxDepth = pp_constraints(List, Level + 1, MaxDepth, State),
io:format(")", []),
NewMaxDepth;
pp_constraints([#constraint_list{type = Type, list = List, id = Id}|Tail],
- Separator, Level, MaxDepth, State) ->
- io:format("List ~w(", [Id]),
- NewSeparator = case Type of
- conj -> "*";
- disj -> "+"
- end,
- NewMaxDepth = pp_constraints(List, NewSeparator, Level+1, MaxDepth, State),
- io:format(") ~s\n~s ", [Separator, Separator]),
- pp_constraints(Tail, Separator, Level, NewMaxDepth, State).
+ Level, MaxDepth, State) ->
+ pp_indent(Level),
+ case Type of
+ conj -> io:format("Conj ~w (", [Id]);
+ disj -> io:format("Disj ~w (", [Id])
+ end,
+ NewMaxDepth = pp_constraints(List, Level+1, MaxDepth, State),
+ io:format(")", []),
+ pp_constraints(Tail, Level, NewMaxDepth, State).
+
+pp_op(#constraint{lhs = Lhs, op = Op, rhs = Rhs}, Level) ->
+ pp_indent(Level),
+ io:format("~s ~w ~s", [format_type(Lhs), Op, format_type(Rhs)]).
+
+pp_indent(Level) ->
+ io:format("\n~*s", [Level*2, ""]).
-else.
pp_constrs_scc(_SCC, _State) ->
ok.
diff --git a/lib/dialyzer/src/dialyzer_utils.erl b/lib/dialyzer/src/dialyzer_utils.erl
index 2a248fb028..8046b48838 100644
--- a/lib/dialyzer/src/dialyzer_utils.erl
+++ b/lib/dialyzer/src/dialyzer_utils.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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,8 @@
pp_hook/0,
process_record_remote_types/1,
sets_filter/2,
- src_compiler_opts/0
+ src_compiler_opts/0,
+ parallelism/0
]).
-include("dialyzer.hrl").
@@ -536,3 +537,12 @@ pp_unit(Unit, Ctxt, Cont) ->
pp_atom(Atom) ->
String = atom_to_list(cerl:atom_val(Atom)),
prettypr:text(String).
+
+%%------------------------------------------------------------------------------
+
+-spec parallelism() -> integer().
+
+parallelism() ->
+ CPUs = erlang:system_info(logical_processors_available),
+ Schedulers = erlang:system_info(schedulers),
+ min(CPUs, Schedulers).
diff --git a/lib/dialyzer/src/dialyzer_worker.erl b/lib/dialyzer/src/dialyzer_worker.erl
new file mode 100644
index 0000000000..1338997899
--- /dev/null
+++ b/lib/dialyzer/src/dialyzer_worker.erl
@@ -0,0 +1,189 @@
+%% -*- erlang-indent-level: 2 -*-
+%%-----------------------------------------------------------------------
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2006-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(dialyzer_worker).
+
+-export([launch/4, sequential/4]).
+
+-export_type([worker/0]).
+
+-type worker() :: pid(). %%opaque
+
+-type mode() :: dialyzer_coordinator:mode().
+-type coordinator() :: dialyzer_coordinator:coordinator().
+-type init_data() :: dialyzer_coordinator:init_data().
+-type result() :: dialyzer_coordinator:result().
+
+-record(state, {
+ mode :: mode(),
+ job :: mfa_or_funlbl() | file:filename(),
+ coordinator :: coordinator(),
+ init_data :: init_data(),
+ depends_on = [] :: list()
+ }).
+
+-include("dialyzer.hrl").
+
+%% -define(DEBUG, true).
+
+-ifdef(DEBUG).
+-define(debug(X__, Y__), io:format(X__, Y__)).
+-else.
+-define(debug(X__, Y__), ok).
+-endif.
+
+%%--------------------------------------------------------------------
+
+-spec launch(mode(), [mfa_or_funlbl()], init_data(), coordinator()) -> worker().
+
+launch(Mode, Job, InitData, Coordinator) ->
+ State = #state{mode = Mode,
+ job = Job,
+ init_data = InitData,
+ coordinator = Coordinator},
+ InitState =
+ case Mode of
+ X when X =:= 'typesig'; X =:= 'dataflow' -> initializing;
+ X when X =:= 'compile'; X =:= 'warnings' -> running
+ end,
+ spawn_link(fun() -> loop(InitState, State) end).
+
+%%--------------------------------------------------------------------
+
+loop(updating, State) ->
+ ?debug("Update: ~p\n",[State#state.job]),
+ NextStatus =
+ case waits_more_success_typings(State) of
+ true -> waiting;
+ false -> running
+ end,
+ loop(NextStatus, State);
+loop(initializing, #state{job = SCC, init_data = InitData} = State) ->
+ DependsOn = dialyzer_succ_typings:find_depends_on(SCC, InitData),
+ ?debug("Deps ~p: ~p\n",[State#state.job, DependsOn]),
+ loop(updating, State#state{depends_on = DependsOn});
+loop(waiting, State) ->
+ ?debug("Wait: ~p\n",[State#state.job]),
+ NewState = wait_for_success_typings(State),
+ loop(updating, NewState);
+loop(running, #state{mode = 'compile'} = State) ->
+ dialyzer_coordinator:wait_activation(),
+ ?debug("Compile: ~s\n",[State#state.job]),
+ Result =
+ case start_compilation(State) of
+ {ok, EstimatedSize, Data} ->
+ Label = ask_coordinator_for_label(EstimatedSize, State),
+ continue_compilation(Label, Data);
+ {error, _Reason} = Error ->
+ Error
+ end,
+ report_to_coordinator(Result, State);
+loop(running, #state{mode = 'warnings'} = State) ->
+ dialyzer_coordinator:wait_activation(),
+ ?debug("Warning: ~s\n",[State#state.job]),
+ Result = collect_warnings(State),
+ report_to_coordinator(Result, State);
+loop(running, #state{mode = Mode} = State) when
+ Mode =:= 'typesig'; Mode =:= 'dataflow' ->
+ request_activation(State),
+ ?debug("Run: ~p\n",[State#state.job]),
+ NotFixpoint = do_work(State),
+ ok = broadcast_done(State),
+ report_to_coordinator(NotFixpoint, State).
+
+waits_more_success_typings(#state{depends_on = Depends}) ->
+ Depends =/= [].
+
+broadcast_done(#state{job = SCC, init_data = InitData,
+ coordinator = Coordinator}) ->
+ RequiredBy = dialyzer_succ_typings:find_required_by(SCC, InitData),
+ {Callers, Unknown} =
+ dialyzer_coordinator:sccs_to_pids(RequiredBy, Coordinator),
+ send_done(Callers, SCC),
+ continue_broadcast_done(Unknown, SCC, Coordinator).
+
+send_done(Callers, SCC) ->
+ ?debug("Sending ~p: ~p\n",[SCC, Callers]),
+ SendSTFun = fun(PID) -> PID ! {done, SCC} end,
+ lists:foreach(SendSTFun, Callers).
+
+continue_broadcast_done([], _SCC, _Coordinator) -> ok;
+continue_broadcast_done(Rest, SCC, Coordinator) ->
+ %% This time limit should be greater than the time required
+ %% by the coordinator to spawn all processes.
+ timer:sleep(500),
+ {Callers, Unknown} = dialyzer_coordinator:sccs_to_pids(Rest, Coordinator),
+ send_done(Callers, SCC),
+ continue_broadcast_done(Unknown, SCC, Coordinator).
+
+wait_for_success_typings(#state{depends_on = DependsOn} = State) ->
+ receive
+ {done, SCC} ->
+ ?debug("GOT ~p: ~p\n",[State#state.job, SCC]),
+ State#state{depends_on = DependsOn -- [SCC]}
+ after
+ 5000 ->
+ ?debug("Still Waiting ~p: ~p\n",[State#state.job, DependsOn]),
+ State
+ end.
+
+request_activation(#state{coordinator = Coordinator}) ->
+ dialyzer_coordinator:request_activation(Coordinator).
+
+do_work(#state{mode = Mode, job = Job, init_data = InitData}) ->
+ case Mode of
+ typesig -> dialyzer_succ_typings:find_succ_types_for_scc(Job, InitData);
+ dataflow -> dialyzer_succ_typings:refine_one_module(Job, InitData)
+ end.
+
+report_to_coordinator(Result, #state{job = Job, coordinator = Coordinator}) ->
+ ?debug("Done: ~p\n",[Job]),
+ dialyzer_coordinator:job_done(Job, Result, Coordinator).
+
+start_compilation(#state{job = Job, init_data = InitData}) ->
+ dialyzer_analysis_callgraph:start_compilation(Job, InitData).
+
+ask_coordinator_for_label(EstimatedSize, #state{coordinator = Coordinator}) ->
+ dialyzer_coordinator:get_next_label(EstimatedSize, Coordinator).
+
+continue_compilation(Label, Data) ->
+ dialyzer_analysis_callgraph:continue_compilation(Label, Data).
+
+collect_warnings(#state{job = Job, init_data = InitData}) ->
+ dialyzer_succ_typings:collect_warnings(Job, InitData).
+
+%%------------------------------------------------------------------------------
+
+-type extra() :: label() | 'unused'.
+
+-spec sequential(mode(), [mfa_or_funlbl()], init_data(), extra()) -> result().
+
+sequential('compile', Job, InitData, Extra) ->
+ case dialyzer_analysis_callgraph:start_compilation(Job, InitData) of
+ {ok, EstimatedSize, Data} ->
+ {EstimatedSize, continue_compilation(Extra, Data)};
+ {error, _Reason} = Error -> {0, Error}
+ end;
+sequential('typesig', Job, InitData, _Extra) ->
+ dialyzer_succ_typings:find_succ_types_for_scc(Job, InitData);
+sequential('dataflow', Job, InitData, _Extra) ->
+ dialyzer_succ_typings:refine_one_module(Job, InitData);
+sequential('warnings', Job, InitData, _Extra) ->
+ dialyzer_succ_typings:collect_warnings(Job, InitData).
diff --git a/lib/dialyzer/test/Makefile b/lib/dialyzer/test/Makefile
index 47deb17f1d..9f8a3f1194 100644
--- a/lib/dialyzer/test/Makefile
+++ b/lib/dialyzer/test/Makefile
@@ -25,10 +25,10 @@ RELSYSDIR = $(RELEASE_PATH)/dialyzer_test
include $(ERL_TOP)/make/otp_release_targets.mk
release_tests_spec:
- $(INSTALL_DIR) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- $(INSTALL_DATA) $(AUXILIARY_FILES) $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
- cd $(RELSYSDIR);\
- erl -make;\
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(AUXILIARY_FILES) "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
+ cd "$(RELSYSDIR)";\
+ erlc dialyzer_common.erl file_utils.erl;\
erl -noshell -run dialyzer_common create_all_suites -s erlang halt
diff --git a/lib/dialyzer/test/behaviour_SUITE_data/results/sample_behaviour b/lib/dialyzer/test/behaviour_SUITE_data/results/sample_behaviour
index a38e662ccf..8cecabccaa 100644
--- a/lib/dialyzer/test/behaviour_SUITE_data/results/sample_behaviour
+++ b/lib/dialyzer/test/behaviour_SUITE_data/results/sample_behaviour
@@ -1,9 +1,9 @@
-sample_callback_wrong.erl:15: The inferred return type of sample_callback_2/0 (42) has nothing in common with atom(), which is the expected return type for the callback of sample_behaviour behaviour
-sample_callback_wrong.erl:16: The inferred return type of sample_callback_3/0 ('fair') has nothing in common with 'fail' | {'ok',1..255}, which is the expected return type for the callback of sample_behaviour behaviour
-sample_callback_wrong.erl:17: The inferred return type of sample_callback_4/1 ('fail') has nothing in common with 'ok', which is the expected return type for the callback of sample_behaviour behaviour
-sample_callback_wrong.erl:19: The inferred return type of sample_callback_5/1 (string()) has nothing in common with 'fail' | 'ok', which is the expected return type for the callback of sample_behaviour behaviour
-sample_callback_wrong.erl:19: The inferred type for the 1st argument of sample_callback_5/1 (atom()) is not a supertype of 1..255, which is expected type for this argument in the callback of the sample_behaviour behaviour
-sample_callback_wrong.erl:21: The inferred return type of sample_callback_6/3 ({'okk',number()}) has nothing in common with 'fail' | {'ok',1..255}, which is the expected return type for the callback of sample_behaviour behaviour
-sample_callback_wrong.erl:21: The inferred type for the 3rd argument of sample_callback_6/3 (atom()) is not a supertype of string(), which is expected type for this argument in the callback of the sample_behaviour behaviour
-sample_callback_wrong.erl:3: Undefined callback function sample_callback_1/0 (behaviour 'sample_behaviour')
+sample_callback_wrong.erl:16: The inferred return type of sample_callback_2/0 (42) has nothing in common with atom(), which is the expected return type for the callback of sample_behaviour behaviour
+sample_callback_wrong.erl:17: The inferred return type of sample_callback_3/0 ('fair') has nothing in common with 'fail' | {'ok',1..255}, which is the expected return type for the callback of sample_behaviour behaviour
+sample_callback_wrong.erl:18: The inferred return type of sample_callback_4/1 ('fail') has nothing in common with 'ok', which is the expected return type for the callback of sample_behaviour behaviour
+sample_callback_wrong.erl:20: The inferred return type of sample_callback_5/1 (string()) has nothing in common with 'fail' | 'ok', which is the expected return type for the callback of sample_behaviour behaviour
+sample_callback_wrong.erl:20: The inferred type for the 1st argument of sample_callback_5/1 (atom()) is not a supertype of 1..255, which is expected type for this argument in the callback of the sample_behaviour behaviour
+sample_callback_wrong.erl:22: The inferred return type of sample_callback_6/3 ({'okk',number()}) has nothing in common with 'fail' | {'ok',1..255}, which is the expected return type for the callback of sample_behaviour behaviour
+sample_callback_wrong.erl:22: The inferred type for the 3rd argument of sample_callback_6/3 (atom()) is not a supertype of string(), which is expected type for this argument in the callback of the sample_behaviour behaviour
+sample_callback_wrong.erl:4: Undefined callback function sample_callback_1/0 (behaviour 'sample_behaviour')
diff --git a/lib/dialyzer/test/behaviour_SUITE_data/src/custom_sup.erl b/lib/dialyzer/test/behaviour_SUITE_data/src/custom_sup.erl
new file mode 100644
index 0000000000..8ec84d798f
--- /dev/null
+++ b/lib/dialyzer/test/behaviour_SUITE_data/src/custom_sup.erl
@@ -0,0 +1,37 @@
+%%% Dialyzer was giving a warning with this input because of a bug in the
+%%% substitution of remote types in specs. Remote types in the first element of
+%%% a tuple would not update the tuple's tag set and we could end up with a
+%%% non-normalized representation.
+%%%
+%%% Reported by Damian Dobroczyński on 29/02/2012
+
+-module(custom_sup).
+
+-behavior(supervisor).
+
+-export([init/1]).
+
+-spec init(atom()) ->
+ {ok, {{supervisor:strategy(), non_neg_integer(), non_neg_integer()},
+ [supervisor:child_spec()]}} | ignore.
+
+init(StorageName) ->
+ Strategy = {one_for_all, 100, 1},
+ %% get application-wide storage parameters
+ case application:get_env(storage) of
+ undefined ->
+ ignore;
+ {ok, Storage} ->
+ BackendId = proplists:get_value(backend, Storage),
+ BackendArgs = proplists:get_value(args, Storage),
+ if
+ (BackendId =:= undefined) orelse (BackendArgs =:= undefined) ->
+ ignore;
+ true ->
+ {ok, {Strategy,
+ [{id1, {a_module, start_link, []},
+ permanent, 5000, worker, [a_module]},
+ {id2, {another_module, start_link, []},
+ permanent, 5000, worker, [another_module]}]}}
+ end
+ end.
diff --git a/lib/dialyzer/test/behaviour_SUITE_data/src/sample_behaviour/sample_callback_wrong.erl b/lib/dialyzer/test/behaviour_SUITE_data/src/sample_behaviour/sample_callback_wrong.erl
index 02a063fab7..430494c48c 100644
--- a/lib/dialyzer/test/behaviour_SUITE_data/src/sample_behaviour/sample_callback_wrong.erl
+++ b/lib/dialyzer/test/behaviour_SUITE_data/src/sample_behaviour/sample_callback_wrong.erl
@@ -1,6 +1,7 @@
-module(sample_callback_wrong).
--behaviour(sample_behaviour).
+%% This attribute uses the american spelling of 'behaviour'.
+-behavior(sample_behaviour).
-export([
% sample_callback_1/0,
diff --git a/lib/dialyzer/test/dialyzer_common.erl b/lib/dialyzer/test/dialyzer_common.erl
index 51766a4604..d2b1026c06 100644
--- a/lib/dialyzer/test/dialyzer_common.erl
+++ b/lib/dialyzer/test/dialyzer_common.erl
@@ -216,10 +216,13 @@ get_suites(Dir) ->
end.
suffix(String, Suffix) ->
- Index = string:rstr(String, Suffix),
- case string:substr(String, Index) =:= Suffix of
- true -> {yes, string:sub_string(String,1,Index-1)};
- false -> no
+ case string:rstr(String, Suffix) of
+ 0 -> no;
+ Index ->
+ case string:substr(String, Index) =:= Suffix of
+ true -> {yes, string:sub_string(String,1,Index-1)};
+ false -> no
+ end
end.
-spec create_suite(string()) -> 'ok'.
diff --git a/lib/dialyzer/test/opaque_SUITE_data/results/multiple_wrong_opaques b/lib/dialyzer/test/opaque_SUITE_data/results/multiple_wrong_opaques
new file mode 100644
index 0000000000..18ece8820c
--- /dev/null
+++ b/lib/dialyzer/test/opaque_SUITE_data/results/multiple_wrong_opaques
@@ -0,0 +1,2 @@
+
+multiple_wrong_opaques.erl:5: Invalid type specification for function multiple_wrong_opaques:weird/1. The success typing is ('gazonk') -> 42
diff --git a/lib/dialyzer/test/opaque_SUITE_data/results/queue b/lib/dialyzer/test/opaque_SUITE_data/results/queue
index 59ce33f098..c3f04ea64d 100644
--- a/lib/dialyzer/test/opaque_SUITE_data/results/queue
+++ b/lib/dialyzer/test/opaque_SUITE_data/results/queue
@@ -5,6 +5,7 @@ queue_use.erl:27: The attempt to match a term of type queue() against the patter
queue_use.erl:33: Attempt to test for equality between a term of type {[42,...],[]} and a term of opaque type queue()
queue_use.erl:36: The attempt to match a term of type queue() against the pattern {F, _R} breaks the opaqueness of the term
queue_use.erl:40: The call queue:out({[42,...],[]}) does not have an opaque term of type queue() as 1st argument
+queue_use.erl:48: The call queue_use:add_unique(42,#db{p::[],q::queue()}) contains an opaque term as 2nd argument when terms of different types are expected in these positions
queue_use.erl:51: The call queue_use:is_in_queue(E::42,DB::#db{p::[],q::queue()}) contains an opaque term as 2nd argument when terms of different types are expected in these positions
queue_use.erl:56: The attempt to match a term of type #db{p::[],q::queue()} against the pattern {'db', _, {L1, L2}} breaks the opaqueness of queue()
queue_use.erl:62: The call queue_use:tuple_queue({42,'gazonk'}) does not have a term of type {_,queue()} (with opaque subterms) as 1st argument
diff --git a/lib/dialyzer/test/opaque_SUITE_data/src/multiple_wrong_opaques.erl b/lib/dialyzer/test/opaque_SUITE_data/src/multiple_wrong_opaques.erl
new file mode 100644
index 0000000000..9e695cec1d
--- /dev/null
+++ b/lib/dialyzer/test/opaque_SUITE_data/src/multiple_wrong_opaques.erl
@@ -0,0 +1,8 @@
+-module(multiple_wrong_opaques).
+
+-export([weird/1]).
+
+-spec weird(dict() | gb_tree()) -> 42.
+
+weird(gazonk) -> 42.
+
diff --git a/lib/dialyzer/test/options1_SUITE_data/results/compiler b/lib/dialyzer/test/options1_SUITE_data/results/compiler
index e82087ae86..6399e3e36b 100644
--- a/lib/dialyzer/test/options1_SUITE_data/results/compiler
+++ b/lib/dialyzer/test/options1_SUITE_data/results/compiler
@@ -20,6 +20,7 @@ cerl_inline.erl:2333: The pattern 'true' can never match the type 'false'
cerl_inline.erl:2355: The pattern 'true' can never match the type 'false'
cerl_inline.erl:238: The pattern 'true' can never match the type 'false'
cerl_inline.erl:2436: Function filename/1 will never be called
+cerl_inline.erl:244: Function counter_stats/0 will never be called
cerl_inline.erl:2700: The pattern 'true' can never match the type 'false'
cerl_inline.erl:2730: The pattern <{F, L, D}, Vs> can never match the type <[1..255,...],[any()]>
cerl_inline.erl:2738: The pattern <{F, L, D}, Vs> can never match the type <[1..255,...],[any()]>
diff --git a/lib/dialyzer/test/r9c_SUITE_data/results/asn1 b/lib/dialyzer/test/r9c_SUITE_data/results/asn1
index 292275dd6e..c11105b76d 100644
--- a/lib/dialyzer/test/r9c_SUITE_data/results/asn1
+++ b/lib/dialyzer/test/r9c_SUITE_data/results/asn1
@@ -68,7 +68,6 @@ asn1rt_check.erl:100: The variable _ can never match since previous clauses comp
asn1rt_check.erl:85: The variable _ can never match since previous clauses completely covered the type [any()]
asn1rt_driver_handler.erl:32: The pattern 'already_done' can never match the type {'error',_}
asn1rt_per.erl:1065: The pattern {'BMPString', {'octets', Ol}} can never match the type {_,[{'bits',1 | 2 | 4 | 8 | 16 | 32,_}]}
-asn1rt_per.erl:1066: Function will never be called
asn1rt_per.erl:1231: The call erlang:'not'('implemented') will never return since it differs in the 1st argument from the success typing arguments: (boolean())
asn1rt_per.erl:1233: The call erlang:'not'('implemented') will never return since it differs in the 1st argument from the success typing arguments: (boolean())
asn1rt_per.erl:1235: The call erlang:'not'('implemented') will never return since it differs in the 1st argument from the success typing arguments: (boolean())
@@ -76,7 +75,6 @@ asn1rt_per.erl:1237: The call erlang:'not'('implemented') will never return sinc
asn1rt_per.erl:989: The pattern <_C, 'true', _Val> can never match the type <_,'false',_>
asn1rt_per_bin.erl:1361: The pattern <_, 'true', _> can never match the type <_,'false',_>
asn1rt_per_bin.erl:1436: The pattern {'BMPString', {'octets', Ol}} can never match the type {'BMPString' | 'IA5String' | 'NumericString' | 'PrintableString' | 'UniversalString' | 'VisibleString',[{'bits',1 | 2 | 4 | 8 | 16 | 32,_}]}
-asn1rt_per_bin.erl:1437: Function will never be called
asn1rt_per_bin.erl:161: The call asn1rt_per_bin:getbit({0,maybe_improper_list()}) will never return since it differs in the 1st argument from the success typing arguments: (<<_:8,_:_*8>> | {non_neg_integer(),<<_:1,_:_*1>>})
asn1rt_per_bin.erl:1812: The pattern {Name, Val} can never match since previous clauses completely covered the type any()
asn1rt_per_bin.erl:2106: Cons will produce an improper list since its 2nd argument is binary()
@@ -94,7 +92,6 @@ asn1rt_per_bin.erl:487: The variable _ can never match since previous clauses co
asn1rt_per_bin.erl:498: The variable _ can never match since previous clauses completely covered the type integer()
asn1rt_per_bin_rt2ct.erl:152: The call asn1rt_per_bin_rt2ct:getbit({0,maybe_improper_list()}) will never return since it differs in the 1st argument from the success typing arguments: (<<_:8,_:_*8>> | {non_neg_integer(),<<_:1,_:_*1>>})
asn1rt_per_bin_rt2ct.erl:1533: The pattern {'BMPString', {'octets', Ol}} can never match the type {_,[[any(),...]]}
-asn1rt_per_bin_rt2ct.erl:1534: Function will never be called
asn1rt_per_bin_rt2ct.erl:1875: The pattern {Name, Val} can never match since previous clauses completely covered the type any()
asn1rt_per_bin_rt2ct.erl:443: The variable _ can never match since previous clauses completely covered the type integer()
asn1rt_per_bin_rt2ct.erl:464: The variable _ can never match since previous clauses completely covered the type integer()
@@ -103,4 +100,3 @@ asn1rt_per_bin_rt2ct.erl:484: The variable _ can never match since previous clau
asn1rt_per_bin_rt2ct.erl:495: The variable _ can never match since previous clauses completely covered the type integer()
asn1rt_per_v1.erl:1209: The pattern <_, 'true', _> can never match the type <_,'false',_>
asn1rt_per_v1.erl:1290: The pattern {'BMPString', {'octets', Ol}} can never match the type {'BMPString' | 'IA5String' | 'NumericString' | 'PrintableString' | 'UniversalString' | 'VisibleString',[{'bits',1 | 2 | 4 | 8 | 16 | 32,_}]}
-asn1rt_per_v1.erl:1291: Function will never be called
diff --git a/lib/dialyzer/test/r9c_SUITE_data/results/inets b/lib/dialyzer/test/r9c_SUITE_data/results/inets
index 24cb39e52b..d789d8d246 100644
--- a/lib/dialyzer/test/r9c_SUITE_data/results/inets
+++ b/lib/dialyzer/test/r9c_SUITE_data/results/inets
@@ -8,6 +8,7 @@ http_lib.erl:424: The variable _ can never match since previous clauses complete
http_lib.erl:438: The variable _ can never match since previous clauses completely covered the type any()
http_lib.erl:99: Function getHeaderValue/2 will never be called
httpc_handler.erl:660: Function exit_session_ok/2 has no local return
+httpc_handler.erl:676: Function format_time/0 will never be called
httpc_manager.erl:145: The pattern {ErrorReply, State2} can never match the type {{'ok',number()},number(),#state{reqid::number()}}
httpc_manager.erl:160: The pattern {ErrorReply, State2} can never match the type {{'ok',number()},number(),#state{reqid::number()}}
httpc_manager.erl:478: The pattern {'error', Reason} can never match the type 'ok' | {number(),#session{clientclose::boolean(),pipeline::[],quelength::1}}
@@ -30,11 +31,11 @@ httpd_sup.erl:92: The variable Else can never match since previous clauses compl
mod_auth.erl:559: The pattern {'error', Reason} can never match the type {_,integer(),maybe_improper_list(),_}
mod_auth_dets.erl:120: The call lists:foreach(fun((_) -> 'true' | {'error','no_such_group' | 'no_such_group_member'}),{'ok',[any()]}) will never return since it differs in the 2nd argument from the success typing arguments: (fun((_) -> any()),[any()])
mod_auth_plain.erl:100: The variable _ can never match since previous clauses completely covered the type {'ok',[any()]}
-mod_auth_plain.erl:159: The variable _ can never match since previous clauses completely covered the type [any()]
-mod_auth_plain.erl:83: The variable O can never match since previous clauses completely covered the type [any()]
+mod_auth_plain.erl:159: The variable _ can never match since previous clauses completely covered the type [[any()]]
+mod_auth_plain.erl:83: The variable O can never match since previous clauses completely covered the type [[any()]]
mod_cgi.erl:372: The pattern {'http_response', NewAccResponse} can never match the type 'ok'
mod_dir.erl:101: The call lists:flatten(nonempty_improper_list(atom() | [any()] | char(),atom())) will never return since it differs in the 1st argument from the success typing arguments: ([any()])
-mod_dir.erl:72: The pattern {'error', Reason} can never match the type {'ok',[[[any()] | char()],...]}
+mod_dir.erl:72: The pattern {'error', Reason} can never match the type {'ok',[[[any()] | non_neg_integer()],...]}
mod_get.erl:135: The pattern <{'enfile', _}, _Info, Path> can never match the type <atom(),#mod{},atom() | binary() | [atom() | [any()] | char()]>
mod_head.erl:80: The pattern <{'enfile', _}, _Info, Path> can never match the type <atom(),#mod{},atom() | binary() | [atom() | [any()] | char()]>
mod_htaccess.erl:460: The pattern {'error', BadData} can never match the type {'ok',_}
@@ -46,9 +47,9 @@ mod_include.erl:692: The pattern <{'read', Reason}, Info, Path> can never match
mod_include.erl:706: The pattern <{'enfile', _}, _Info, Path> can never match the type <atom(),#mod{},atom() | binary() | [atom() | [any()] | char()]>
mod_include.erl:716: Function read_error/3 will never be called
mod_include.erl:719: Function read_error/4 will never be called
-mod_security_server.erl:386: The variable O can never match since previous clauses completely covered the type [any()]
-mod_security_server.erl:433: The variable Other can never match since previous clauses completely covered the type [any()]
-mod_security_server.erl:585: The variable _ can never match since previous clauses completely covered the type [any()]
-mod_security_server.erl:608: The variable _ can never match since previous clauses completely covered the type [any()]
-mod_security_server.erl:641: The variable _ can never match since previous clauses completely covered the type [any()]
+mod_security_server.erl:386: The variable O can never match since previous clauses completely covered the type [tuple()]
+mod_security_server.erl:433: The variable Other can never match since previous clauses completely covered the type [tuple()]
+mod_security_server.erl:585: The variable _ can never match since previous clauses completely covered the type [tuple()]
+mod_security_server.erl:608: The variable _ can never match since previous clauses completely covered the type [tuple()]
+mod_security_server.erl:641: The variable _ can never match since previous clauses completely covered the type [tuple()]
uri.erl:146: The pattern {'error', Error} can never match since previous clauses completely covered the type {_,{[],[]}}
diff --git a/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args10 b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args10
new file mode 100644
index 0000000000..c3c9b12bdd
--- /dev/null
+++ b/lib/dialyzer/test/race_SUITE_data/results/ets_insert_args10
@@ -0,0 +1,2 @@
+
+ets_insert_args10.erl:9: The call ets:insert(T::'foo',[{'counter',number()},...]) might have an unintended effect due to a possible race condition caused by its combination with the ets:lookup(T::'foo','counter') call in ets_insert_args10.erl on line 8
diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args10.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args10.erl
new file mode 100644
index 0000000000..c897a34af0
--- /dev/null
+++ b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_args10.erl
@@ -0,0 +1,19 @@
+%% This tests the presence of possible races due to an ets:lookup/ets:insert
+%% combination. It takes into account the argument types of the calls.
+
+-module(ets_insert_args10).
+-export([start/0]).
+
+start() ->
+ F = fun(T) -> [{_, N}] = ets:lookup(T, counter),
+ ets:insert(T, [{counter, N+1}])
+ end,
+ io:format("Created ~w\n", [ets:new(foo, [named_table, public])]),
+ A = {counter, 0},
+ B = [],
+ ets:insert(foo, [A|B]),
+ io:format("Inserted ~w\n", [{counter, 0}]),
+ F(foo),
+ io:format("Update complete\n", []),
+ ObjectList = ets:lookup(foo, counter),
+ io:format("Counter: ~w\n", [ObjectList]).
diff --git a/lib/dialyzer/test/small_SUITE_data/results/cerl_hipeify b/lib/dialyzer/test/small_SUITE_data/results/cerl_hipeify
index 87bf6f309f..06dc0d63ee 100644
--- a/lib/dialyzer/test/small_SUITE_data/results/cerl_hipeify
+++ b/lib/dialyzer/test/small_SUITE_data/results/cerl_hipeify
@@ -1,4 +1,4 @@
cerl_hipeify.erl:370: Function will never be called
-cerl_hipeify.erl:370: Guard test fun((none()) -> none()) =:= F::{_,_,_} | {_,_,_,_} | {_,_,_,_,_} | {_,_,_,_,_,_} | {_,_,_,_,_,_,_} can never succeed
+cerl_hipeify.erl:370: Guard test fun((none()) -> no_return()) =:= F::{_,_,_} | {_,_,_,_} | {_,_,_,_,_} | {_,_,_,_,_,_} | {_,_,_,_,_,_,_} can never succeed
cerl_hipeify.erl:641: Function env__new_function_name/2 will never be called
diff --git a/lib/dialyzer/test/small_SUITE_data/results/contracts_with_subtypes b/lib/dialyzer/test/small_SUITE_data/results/contracts_with_subtypes
new file mode 100644
index 0000000000..4850f3ff0c
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/results/contracts_with_subtypes
@@ -0,0 +1,31 @@
+
+contracts_with_subtypes.erl:106: The call contracts_with_subtypes:rec_arg({'a','b'}) breaks the contract (Arg) -> 'ok' when is_subtype(Arg,{'a',A} | {'b',B}), is_subtype(A,'a' | {'b',B}), is_subtype(B,'b' | {'a',A})
+contracts_with_subtypes.erl:107: The call contracts_with_subtypes:rec_arg({'b','a'}) breaks the contract (Arg) -> 'ok' when is_subtype(Arg,{'a',A} | {'b',B}), is_subtype(A,'a' | {'b',B}), is_subtype(B,'b' | {'a',A})
+contracts_with_subtypes.erl:108: The call contracts_with_subtypes:rec_arg({'a',{'b','a'}}) breaks the contract (Arg) -> 'ok' when is_subtype(Arg,{'a',A} | {'b',B}), is_subtype(A,'a' | {'b',B}), is_subtype(B,'b' | {'a',A})
+contracts_with_subtypes.erl:109: The call contracts_with_subtypes:rec_arg({'b',{'a','b'}}) breaks the contract (Arg) -> 'ok' when is_subtype(Arg,{'a',A} | {'b',B}), is_subtype(A,'a' | {'b',B}), is_subtype(B,'b' | {'a',A})
+contracts_with_subtypes.erl:110: The call contracts_with_subtypes:rec_arg({'a',{'b',{'a','b'}}}) breaks the contract (Arg) -> 'ok' when is_subtype(Arg,{'a',A} | {'b',B}), is_subtype(A,'a' | {'b',B}), is_subtype(B,'b' | {'a',A})
+contracts_with_subtypes.erl:111: The call contracts_with_subtypes:rec_arg({'b',{'a',{'b','a'}}}) breaks the contract (Arg) -> 'ok' when is_subtype(Arg,{'a',A} | {'b',B}), is_subtype(A,'a' | {'b',B}), is_subtype(B,'b' | {'a',A})
+contracts_with_subtypes.erl:142: The pattern 1 can never match the type binary() | string()
+contracts_with_subtypes.erl:145: The pattern 'alpha' can never match the type {'ok',_} | {'ok',_,binary() | string()}
+contracts_with_subtypes.erl:147: The pattern 42 can never match the type {'ok',_} | {'ok',_,binary() | string()}
+contracts_with_subtypes.erl:163: The pattern 'alpha' can never match the type {'ok',X}
+contracts_with_subtypes.erl:165: The pattern 42 can never match the type {'ok',X}
+contracts_with_subtypes.erl:183: The pattern 'alpha' can never match the type {'ok',X}
+contracts_with_subtypes.erl:185: The pattern 42 can never match the type {'ok',X}
+contracts_with_subtypes.erl:202: The pattern 1 can never match the type binary() | string()
+contracts_with_subtypes.erl:205: The pattern {'ok', _} can never match the type {'ok',X,binary() | string()}
+contracts_with_subtypes.erl:206: The pattern 'alpha' can never match the type {'ok',X,binary() | string()}
+contracts_with_subtypes.erl:207: The pattern {'ok', 42} can never match the type {'ok',X,binary() | string()}
+contracts_with_subtypes.erl:208: The pattern 42 can never match the type {'ok',X,binary() | string()}
+contracts_with_subtypes.erl:234: Function flat_ets_new_t/0 has no local return
+contracts_with_subtypes.erl:235: The call contracts_with_subtypes:flat_ets_new(12,[]) breaks the contract (Name,Options) -> atom() when is_subtype(Name,atom()), is_subtype(Options,[Option]), is_subtype(Option,'set' | 'ordered_set' | 'bag' | 'duplicate_bag' | 'public' | 'protected' | 'private' | 'named_table' | {'keypos',integer()} | {'heir',pid(),term()} | {'heir','none'} | {'write_concurrency',boolean()} | {'read_concurrency',boolean()} | 'compressed')
+contracts_with_subtypes.erl:23: Invalid type specification for function contracts_with_subtypes:extract2/0. The success typing is () -> 'something'
+contracts_with_subtypes.erl:261: Function factored_ets_new_t/0 has no local return
+contracts_with_subtypes.erl:262: The call contracts_with_subtypes:factored_ets_new(12,[]) breaks the contract (Name,Options) -> atom() when is_subtype(Name,atom()), is_subtype(Options,[Option]), is_subtype(Option,Type | Access | 'named_table' | {'keypos',Pos} | {'heir',Pid::pid(),HeirData} | {'heir','none'} | Tweaks), is_subtype(Type,type()), is_subtype(Access,access()), is_subtype(Tweaks,{'write_concurrency',boolean()} | {'read_concurrency',boolean()} | 'compressed'), is_subtype(Pos,pos_integer()), is_subtype(HeirData,term())
+contracts_with_subtypes.erl:77: The call contracts_with_subtypes:foo1(5) breaks the contract (Arg1) -> Res when is_subtype(Arg1,atom()), is_subtype(Res,atom())
+contracts_with_subtypes.erl:78: The call contracts_with_subtypes:foo2(5) breaks the contract (Arg1) -> Res when is_subtype(Arg1,Arg2), is_subtype(Arg2,atom()), is_subtype(Res,atom())
+contracts_with_subtypes.erl:79: The call contracts_with_subtypes:foo3(5) breaks the contract (Arg1) -> Res when is_subtype(Arg2,atom()), is_subtype(Arg1,Arg2), is_subtype(Res,atom())
+contracts_with_subtypes.erl:7: Invalid type specification for function contracts_with_subtypes:extract/0. The success typing is () -> 'something'
+contracts_with_subtypes.erl:80: The call contracts_with_subtypes:foo4(5) breaks the contract (Type) -> Type when is_subtype(Type,atom())
+contracts_with_subtypes.erl:81: The call contracts_with_subtypes:foo5(5) breaks the contract (Type::atom()) -> Type::atom()
+contracts_with_subtypes.erl:82: The call contracts_with_subtypes:foo6(5) breaks the contract (Type) -> Type when is_subtype(Type,atom())
diff --git a/lib/dialyzer/test/small_SUITE_data/results/fun_ref_match b/lib/dialyzer/test/small_SUITE_data/results/fun_ref_match
index 60b34530b4..e69de29bb2 100644
--- a/lib/dialyzer/test/small_SUITE_data/results/fun_ref_match
+++ b/lib/dialyzer/test/small_SUITE_data/results/fun_ref_match
@@ -1,2 +0,0 @@
-
-fun_ref_match.erl:14: Function will never be called
diff --git a/lib/dialyzer/test/small_SUITE_data/results/inf_loop2 b/lib/dialyzer/test/small_SUITE_data/results/inf_loop2
index 7e9972ad98..142e4b2c37 100644
--- a/lib/dialyzer/test/small_SUITE_data/results/inf_loop2
+++ b/lib/dialyzer/test/small_SUITE_data/results/inf_loop2
@@ -1,4 +1,4 @@
inf_loop2.erl:18: Function test/0 has no local return
inf_loop2.erl:19: The call lists:reverse('gazonk') will never return since it differs in the 1st argument from the success typing arguments: ([any()])
-inf_loop2.erl:22: Function loop/0 has no local return
+inf_loop2.erl:22: Function loop/0 will never be called
diff --git a/lib/dialyzer/test/small_SUITE_data/results/no_local_return b/lib/dialyzer/test/small_SUITE_data/results/no_local_return
new file mode 100644
index 0000000000..6ca1ed51d8
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/results/no_local_return
@@ -0,0 +1,3 @@
+
+no_local_return.erl:11: Function bar/1 will never be called
+no_local_return.erl:8: Function foo/0 will never be called
diff --git a/lib/dialyzer/test/small_SUITE_data/results/port_info_test b/lib/dialyzer/test/small_SUITE_data/results/port_info_test
index 9ee863f9eb..863a3d61df 100644
--- a/lib/dialyzer/test/small_SUITE_data/results/port_info_test
+++ b/lib/dialyzer/test/small_SUITE_data/results/port_info_test
@@ -3,4 +3,5 @@ port_info_test.erl:10: The pattern {'connected', 42} can never match the type 'u
port_info_test.erl:14: The pattern {'registered_name', "42"} can never match the type 'undefined' | {'registered_name',atom()}
port_info_test.erl:19: The pattern {'output', 42} can never match the type 'undefined' | {'connected',pid()}
port_info_test.erl:24: Guard test 'links' =:= Atom::'connected' can never succeed
-port_info_test.erl:28: The pattern {'gazonk', _} can never match the type 'undefined' | {'connected' | 'id' | 'input' | 'links' | 'name' | 'output' | 'registered_name',atom() | pid() | [pid() | char()] | integer()}
+port_info_test.erl:28: The pattern {'gazonk', _} can never match the type 'undefined' | {'connected' | 'id' | 'input' | 'links' | 'name' | 'os_pid' | 'output' | 'registered_name',atom() | pid() | [pid() | char()] | integer()}
+port_info_test.erl:32: The pattern {'os_pid', "42"} can never match the type 'undefined' | {'os_pid','undefined' | non_neg_integer()}
diff --git a/lib/dialyzer/test/small_SUITE_data/src/collapse_lists/a.erl b/lib/dialyzer/test/small_SUITE_data/src/collapse_lists/a.erl
new file mode 100644
index 0000000000..7efe870b0d
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/src/collapse_lists/a.erl
@@ -0,0 +1,9 @@
+-module(a).
+-export([g/1]).
+
+-export_type([a/0, t/0]).
+-type a() :: integer().
+-type t() :: a() | maybe_improper_list(t(), t()).
+
+-spec g(t()) -> t().
+g(X) -> X.
diff --git a/lib/dialyzer/test/small_SUITE_data/src/collapse_lists/b.erl b/lib/dialyzer/test/small_SUITE_data/src/collapse_lists/b.erl
new file mode 100644
index 0000000000..b08bc5e66c
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/src/collapse_lists/b.erl
@@ -0,0 +1,5 @@
+-module(b).
+-export([f/1]).
+
+-spec f(a:t()) -> a:t().
+f(X) -> a:g(X).
diff --git a/lib/dialyzer/test/small_SUITE_data/src/contracts_with_subtypes.erl b/lib/dialyzer/test/small_SUITE_data/src/contracts_with_subtypes.erl
new file mode 100644
index 0000000000..d72138d509
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/src/contracts_with_subtypes.erl
@@ -0,0 +1,267 @@
+-module(contracts_with_subtypes).
+
+-compile(export_all).
+
+%===============================================================================
+
+-spec extract() -> 'ok'.
+
+extract() ->
+ case dz_extract() of
+ {ok, Val} -> Val;
+ error -> exit(boom)
+ end.
+
+-spec dz_extract() -> RetValue when
+ FileList :: something,
+ RetValue :: {ok, FileList} | error.
+
+dz_extract() -> get(foo).
+
+%-------------------------------------------------------------------------------
+
+-spec extract2() -> 'ok'.
+
+extract2() ->
+ case dz_extract2() of
+ {ok, Val} -> Val;
+ error -> exit(boom)
+ end.
+
+-spec dz_extract2() -> RetValue when
+ RetValue :: {ok, FileList} | error,
+ FileList :: something.
+
+dz_extract2() -> get(foo).
+
+%===============================================================================
+
+-spec foo1(Arg1) -> Res when
+ Arg1 :: atom(),
+ Res :: atom().
+
+foo1(X) -> X.
+
+-spec foo2(Arg1) -> Res when
+ Arg1 :: Arg2,
+ Arg2 :: atom(),
+ Res :: atom().
+
+foo2(X) -> X.
+
+-spec foo3(Arg1) -> Res when
+ Arg2 :: atom(),
+ Arg1 :: Arg2,
+ Res :: atom().
+
+foo3(X) -> X.
+
+-spec foo4(Type) -> Type when is_subtype(Type, atom()).
+
+foo4(X) -> X.
+
+-spec foo5(Type :: atom()) -> Type :: atom().
+
+foo5(X) -> X.
+
+-spec foo6(Type) -> Type when Type :: atom().
+
+foo6(X) -> X.
+
+-spec foo7(Type) -> Type.
+
+foo7(X) -> X.
+
+%-------------------------------------------------------------------------------
+
+bar(1) -> foo1(5);
+bar(2) -> foo2(5);
+bar(3) -> foo3(5);
+bar(4) -> foo4(5);
+bar(5) -> foo5(5);
+bar(6) -> foo6(5);
+bar(7) -> foo7(5).
+
+wrong_foo6() ->
+ b = foo6(a).
+
+%===============================================================================
+
+-spec rec_arg(Arg) -> ok when
+ Arg :: {a, A} | {b, B},
+ A :: a | {b, B},
+ B :: b | {a, A}.
+
+rec_arg(X) -> get(X).
+
+c(aa) -> rec_arg({a, a});
+c(bb) -> rec_arg({b, b});
+c(abb) -> rec_arg({a, {b, b}});
+c(baa) -> rec_arg({b, {a, a}});
+c(abaa) -> rec_arg({a, {b, {a, a}}});
+c(babb) -> rec_arg({b, {a, {b, b}}});
+c(ababb) -> rec_arg({a, {b, {a, {b, b}}}});
+c(babaa) -> rec_arg({b, {a, {b, {a, a}}}}).
+
+w(ab) -> rec_arg({a, b});
+w(ba) -> rec_arg({b, a});
+w(aba) -> rec_arg({a, {b, a}});
+w(bab) -> rec_arg({b, {a, b}});
+w(abab) -> rec_arg({a, {b, {a, b}}});
+w(baba) -> rec_arg({b, {a, {b, a}}});
+w(ababa) -> rec_arg({a, {b, {a, {b, a}}}});
+w(babab) -> rec_arg({b, {a, {b, {a, b}}}}).
+
+%===============================================================================
+
+-type dublo(X) :: {X, X}.
+
+-type weird(X,Y) :: {X, Y, X, X}.
+
+-spec forfun(dublo(Var)) -> ok when Var :: atom().
+
+forfun(_) -> ok.
+
+-spec forfun2(weird(Var, Var)) -> ok when Var :: atom().
+
+forfun2(_) -> ok.
+
+%===============================================================================
+
+-spec shallow(X) -> {ok, X} | {ok, X, file:filename()} | err1 | err2.
+
+shallow(X) -> get(X).
+
+st(X) when is_atom(X) ->
+ case shallow(X) of
+ err1 -> ok;
+ err2 -> ok;
+ {ok, X} -> ok;
+ {ok, X, Res} ->
+ case Res of
+ 1 -> bad;
+ _Other -> ok
+ end;
+ alpha -> bad;
+ {ok, 42} -> bad;
+ 42 -> bad
+ end.
+
+%-------------------------------------------------------------------------------
+
+-spec deep(X) -> Ret when
+ Ret :: {ok, X} | Err,
+ Err :: err1 | err2.
+
+deep(X) -> get(X).
+
+dt(X) when is_atom(X) ->
+ case deep(X) of
+ err1 -> ok;
+ err2 -> ok;
+ {ok, X} -> ok;
+ alpha -> bad;
+ {ok, 42} -> bad;
+ 42 -> bad
+ end.
+
+%-------------------------------------------------------------------------------
+
+-type local_errors() :: err1 | err2.
+
+-spec deep2(X) -> Ret when
+ Ret :: {ok, X} | Err,
+ Err :: local_errors().
+
+deep2(X) -> get(X).
+
+dt2(X) when is_atom(X) ->
+ case deep2(X) of
+ err1 -> ok;
+ err2 -> ok;
+ {ok, X} -> ok;
+ alpha -> bad;
+ {ok, 42} -> bad;
+ 42 -> bad
+ end.
+
+%-------------------------------------------------------------------------------
+
+-spec deep3(X) -> Ret when
+ Ret :: {ok, X, file:filename()} | Err,
+ Err :: local_errors().
+
+deep3(X) -> get(X).
+
+dt3(X) when is_atom(X) ->
+ case deep3(X) of
+ err1 -> ok;
+ err2 -> ok;
+ {ok, X, Res} ->
+ case Res of
+ 1 -> bad;
+ _Other -> ok
+ end;
+ {ok, X} -> bad;
+ alpha -> bad;
+ {ok, 42} -> bad;
+ 42 -> bad
+ end.
+
+%===============================================================================
+
+-spec flat_ets_new(Name, Options) -> atom() when
+ Name :: atom(),
+ Options :: [Option],
+ Option :: set
+ | ordered_set
+ | bag
+ | duplicate_bag
+ | public
+ | protected
+ | private
+ | named_table
+ | {keypos, integer()}
+ | {heir, pid(), term()}
+ | {heir, none}
+ | {write_concurrency, boolean()}
+ | {read_concurrency, boolean()}
+ | compressed.
+
+flat_ets_new(Name, Options) ->
+ get({Name, Options}).
+
+flat_ets_new_t() ->
+ flat_ets_new(12,[]),
+ flat_ets_new({a,b},[]),
+ flat_ets_new(name,[foo]),
+ flat_ets_new(name,{bag}),
+ flat_ets_new(name,bag),
+ ok.
+
+-type access() :: public | protected | private.
+-type type() :: set | ordered_set | bag | duplicate_bag.
+
+-spec factored_ets_new(Name, Options) -> atom() when
+ Name :: atom(),
+ Options :: [Option],
+ Option :: Type | Access | named_table | {keypos,Pos}
+ | {heir, Pid :: pid(), HeirData} | {heir, none} | Tweaks,
+ Type :: type(),
+ Access :: access(),
+ Tweaks :: {write_concurrency, boolean()}
+ | {read_concurrency, boolean()}
+ | compressed,
+ Pos :: pos_integer(),
+ HeirData :: term().
+
+factored_ets_new(Name, Options) ->
+ get({Name, Options}).
+
+factored_ets_new_t() ->
+ factored_ets_new(12,[]),
+ factored_ets_new({a,b},[]),
+ factored_ets_new(name,[foo]),
+ factored_ets_new(name,{bag}),
+ factored_ets_new(name,bag),
+ ok.
diff --git a/lib/dialyzer/test/small_SUITE_data/src/deep_lc.erl b/lib/dialyzer/test/small_SUITE_data/src/deep_lc.erl
new file mode 100644
index 0000000000..d9ca0817d9
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/src/deep_lc.erl
@@ -0,0 +1,14 @@
+-module(deep_lc).
+
+-export([t/0]).
+
+%% This is compile/test/lc_SUITE:deeply_nested/1
+%%
+%% Used to be _very_ slow. Unknown how slow, but more than 15 hours.
+
+t() ->
+ [[X1,X2,X3,X4,X5,X6,X7(),X8,X9,X10,X11,X12,X13,X14,X15,X16,X17,X18(),X19,X20] ||
+ X1 <- [99],X2 <- [98],X3 <- [97],X4 <- [96],X5 <- [42],X6 <- [17],
+ X7 <- [fun() -> X5*X5 end],X8 <- [12],X9 <- [11],X10 <- [10],
+ X11 <- [9],X12 <- [8],X13 <- [7],X14 <- [6],X15 <- [5],
+ X16 <- [4],X17 <- [3],X18 <- [fun() -> X16+X17 end],X19 <- [2],X20 <- [1]].
diff --git a/lib/dialyzer/test/small_SUITE_data/src/maybe_servers.erl b/lib/dialyzer/test/small_SUITE_data/src/maybe_servers.erl
new file mode 100644
index 0000000000..237f43b1a6
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/src/maybe_servers.erl
@@ -0,0 +1,31 @@
+-module(maybe_servers).
+
+-export([maybe_server/2, mirror_maybe_server/2]).
+
+maybe_server(O, I) ->
+ case O of
+ no ->
+ maybe_loop(fun(_) -> fin end, I);
+ yes ->
+ maybe_loop(fun(X) -> {ok, X} end, I)
+ end.
+
+maybe_loop(F, X)->
+ case F(X) of
+ {ok, Y} -> maybe_loop(F, Y);
+ fin -> exit(n)
+ end.
+
+mirror_maybe_loop(F, X)->
+ case F(X) of
+ {ok, Y} -> mirror_maybe_loop(F, Y);
+ fin -> exit(n)
+ end.
+
+mirror_maybe_server(O, I) ->
+ case O of
+ no ->
+ mirror_maybe_loop(fun(_) -> fin end, I);
+ yes ->
+ mirror_maybe_loop(fun(X) -> {ok, X} end, I)
+ end.
diff --git a/lib/dialyzer/test/small_SUITE_data/src/no_local_return.erl b/lib/dialyzer/test/small_SUITE_data/src/no_local_return.erl
new file mode 100644
index 0000000000..4e1a0b015a
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/src/no_local_return.erl
@@ -0,0 +1,12 @@
+-module(no_local_return).
+
+%% NOTE: No function is exported. Dialyzer produced a bogus
+%% 'Function foo/0 has no local return' warning
+%% when in fact typer was finding correct return values for both
+%% these functions.
+
+foo() ->
+ bar(42).
+
+bar(X) ->
+ lists:duplicate(X, gazonk).
diff --git a/lib/dialyzer/test/small_SUITE_data/src/on_load.erl b/lib/dialyzer/test/small_SUITE_data/src/on_load.erl
new file mode 100644
index 0000000000..16533a9caa
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/src/on_load.erl
@@ -0,0 +1,11 @@
+%%% This is to ensure that "on_load" functions are never reported as unused.
+
+-module(on_load).
+
+-export([foo/0]).
+
+-on_load(bar/0).
+
+foo() -> ok.
+
+bar() -> ok.
diff --git a/lib/dialyzer/test/small_SUITE_data/src/port_info_test.erl b/lib/dialyzer/test/small_SUITE_data/src/port_info_test.erl
index 2ee9a3a6e2..07f22256c9 100644
--- a/lib/dialyzer/test/small_SUITE_data/src/port_info_test.erl
+++ b/lib/dialyzer/test/small_SUITE_data/src/port_info_test.erl
@@ -3,7 +3,7 @@
%% and the quality of the warnings that Dialyzer spits out
%%
-module(port_info_test).
--export([t1/1, t2/1, t3/1, t4/1, t5/2, buggy/1]).
+-export([t1/1, t2/1, t3/1, t4/1, t5/2, t6/1, buggy/1]).
%% The following errors are correctly caught, but the messages are a bit weird
t1(X) when is_port(X) ->
@@ -28,6 +28,10 @@ t5(X, Atom) when is_port(X) ->
{gazonk, _} = erlang:port_info(X, Atom);
t5(_, _) -> ok.
+t6(X) when is_port(X) ->
+ {os_pid, "42"} = erlang:port_info(X, os_pid);
+t6(_) -> ok.
+
%% The type system is not strong enough to catch the following errors
buggy(X) when is_atom(X) ->
{links, X} = erlang:port_info(foo, X).
diff --git a/lib/dialyzer/test/small_SUITE_data/src/remote_tuple_set.erl b/lib/dialyzer/test/small_SUITE_data/src/remote_tuple_set.erl
new file mode 100644
index 0000000000..6c440ed04c
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/src/remote_tuple_set.erl
@@ -0,0 +1,8 @@
+-module(remote_tuple_set).
+
+-export([parse_cidr/0]).
+
+-spec parse_cidr() -> {inet:address_family(),1,2} | {error}.
+
+parse_cidr() ->
+ {inet,1,2}.
diff --git a/lib/dialyzer/test/user_SUITE_data/results/wsp_pdu b/lib/dialyzer/test/user_SUITE_data/results/wsp_pdu
index a47b1f1f2c..d1f8f4caf2 100644
--- a/lib/dialyzer/test/user_SUITE_data/results/wsp_pdu
+++ b/lib/dialyzer/test/user_SUITE_data/results/wsp_pdu
@@ -6,7 +6,7 @@ wsp_pdu.erl:2403: The call wsp_pdu:d_date(Data1::binary()) will never return sin
wsp_pdu.erl:2406: Guard test is_integer(Sec::{[byte()] | byte() | {'long',binary()} | {'short',binary()},binary()}) can never succeed
wsp_pdu.erl:2408: The pattern {'short', Data2} can never match the type {[byte()] | byte() | {'long',binary()} | {'short',binary()},binary()}
wsp_pdu.erl:2755: Function parse_push_flag/1 has no local return
-wsp_pdu.erl:2756: The call erlang:integer_to_list(Value::[any()]) will never return since it differs in the 1st argument from the success typing arguments: (integer())
+wsp_pdu.erl:2756: The call erlang:integer_to_list(Value::[any()]) breaks the contract (Integer) -> string() when is_subtype(Integer,integer())
wsp_pdu.erl:2875: The call wsp_pdu:d_text_string(Data::byte()) will never return since it differs in the 1st argument from the success typing arguments: (binary())
wsp_pdu.erl:2976: The call wsp_pdu:d_q_value(QData::byte()) will never return since it differs in the 1st argument from the success typing arguments: (<<_:8,_:_*8>>)
wsp_pdu.erl:3336: The call wsp_pdu:encode_typed_field(Ver::any(),'Q-value',ParamValue::any()) will never return since it differs in the 2nd argument from the success typing arguments: (any(),'Constrained-encoding' | 'Date-value' | 'No-value' | 'Short-integer' | 'Text-string' | 'Text-value' | 'Well-known-charset',any())
diff --git a/lib/dialyzer/vsn.mk b/lib/dialyzer/vsn.mk
index 622e51b859..64d05156b1 100644
--- a/lib/dialyzer/vsn.mk
+++ b/lib/dialyzer/vsn.mk
@@ -1 +1 @@
-DIALYZER_VSN = 2.5
+DIALYZER_VSN = 2.5.2
diff --git a/lib/diameter/autoconf/configure.vxworks b/lib/diameter/autoconf/configure.vxworks
deleted file mode 100755
index 33aa497680..0000000000
--- a/lib/diameter/autoconf/configure.vxworks
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/bin/sh
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
-#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
-#
-# %CopyrightEnd%
-#
-# Author:
-# Patrik Winroth
-#
-
-
-# vxworks_ppc860 vxworks_ppc603 vxworks_ppc603_longcall vxworks_cpu32 vxworks_sparc
-# vxworks_ppc750 vxworks_simso
-
-case $# in
-1) host=$1 ;;
-*) echo "usage: configure.vxworks host-configuration"; exit 1 ;;
-esac
-
-case $1 in
-vxworks_cpu32) ;;
-vxworks_ppc750) ;;
-vxworks_ppc860) ;;
-vxworks_ppc603) ;;
-vxworks_ppc603_nolongcall) ;;
-vxworks_sparc) ;;
-vxworks_simso) ;;
-vxworks_simlinux) ;;
-vxworks_ppc32) ;;
-*) echo "usage: configure.vxworks TARGET";
- echo "where TARGET is one of vxworks_cpu32, vxworks_ppc750, vxworks_ppc860, vxworks_ppc603, vxworks_ppc603_nolongcall, vxworks_sparc, vxworks_simso, vxworks_simlinux, vxworks_ppc32"; exit 1;;
-esac
-
-if [ "x$ERL_TOP" = x ]; then
- echo "You need to set ERL_TOP!"
- exit 1
-fi
-
-
-target=$host
-
-# Find out the HOST and WIND_BASE environment
-HOST_TYPE=${HOST_TYPE:=sun4-solaris2}
-case $1 in
-vxworks_ppc750) VXTOP=Tornado2.2 ;;
-vxworks_simso) VXTOP=WindRiver ;;
-vxworks_simlinux) VXTOP=WindRiver ;;
-vxworks_ppc32) VXTOP=WindRiver ;;
-*) VXTOP=wind ;;
-esac
-
-WIND_BASE=${WIND_BASE:=`ypmatch tornado passwd | awk -F: '{print $6}'`/$VXTOP}
-
-# These are created by autoconf.
-MKDIRS="${ERL_TOP}/lib/os_mon/priv/bin/$target
- ${ERL_TOP}/lib/os_mon/priv/obj/$target
- ${ERL_TOP}/lib/orber/priv/obj/$target
- ${ERL_TOP}/lib/orber/priv/bin/$target
- ${ERL_TOP}/lib/ic/priv/lib/$target
- ${ERL_TOP}/lib/ic/priv/obj/$target
- ${ERL_TOP}/lib/asn1/priv/lib/$target
- ${ERL_TOP}/lib/asn1/priv/obj/$target
- ${ERL_TOP}/lib/erl_interface/obj/$target
- ${ERL_TOP}/lib/erl_interface/obj.debug/$target
- ${ERL_TOP}/lib/erl_interface/bin/$target
- ${ERL_TOP}/lib/runtime_tools/priv/lib/$target
- ${ERL_TOP}/lib/runtime_tools/priv/obj/$target
- ${ERL_TOP}/erts/obj/$target
- ${ERL_TOP}/erts/obj.debug/$target
- ${ERL_TOP}/bin/$target"
-
-for dir in $MKDIRS; do
- test ! -d "$dir" && mkdir -p "$dir"
-done
-
-#
-# Create Makefiles for vxWorks.
-#
-my_root=${ERL_TOP}/erts/emulator
-emu_test=$my_root/test
-beam=$my_root/beam
-erts_lib_src=${ERL_TOP}/erts/lib_src
-erts_incl=${ERL_TOP}/erts/include
-erts_incl_intrnl=${ERL_TOP}/erts/include/internal
-etcdir=${ERL_TOP}/erts/etc/common
-erlint_dir=${ERL_TOP}/lib/erl_interface/src
-epmd_dir=${ERL_TOP}/erts/epmd/src
-os_mon_dir=${ERL_TOP}/lib/os_mon/c_src
-orber_dir=${ERL_TOP}/lib/orber/c_src
-ic_dir=${ERL_TOP}/lib/ic/c_src
-asn1_dir=${ERL_TOP}/lib/asn1/c_src
-internal_tools_dir=${ERL_TOP}
-libdir=${ERL_TOP}/lib
-tsdir=$libdir/test_server/src
-zlibdir=${ERL_TOP}/erts/emulator/zlib
-runtime_tools_dir=${ERL_TOP}/lib/runtime_tools/c_src
-tools_dir=${ERL_TOP}/lib/tools/c_src
-
-CONFIG_FILES="${ERL_TOP}/erts/emulator/$host/Makefile
- $erts_lib_src/$host/Makefile
- $erts_incl/$host/erl_int_sizes_config.h
- $erts_incl_intrnl/$host/ethread.mk
- $erts_incl_intrnl/$host/ethread_header_config.h
- $etcdir/$host/Makefile
- $erlint_dir/$host/Makefile
- $erlint_dir/$host/eidefs.mk
- $epmd_dir/$host/Makefile
- $internal_tools_dir/make/$host/otp.mk
- $os_mon_dir/$host/Makefile
- $zlibdir/$host/Makefile
- $ic_dir/$host/Makefile
- $asn1_dir/$host/Makefile
- $runtime_tools_dir/$host/Makefile
- $tools_dir/$host/Makefile
- $orber_dir/$host/Makefile"
-
-for file in $CONFIG_FILES; do
- new_name=`echo $file|sed "s%/$host/%/$target/%"`
- dir=`echo $new_name|sed 's%/[^/][^/]*$%%'`
- if test "$dir" != "$new_name" && test "$dir" != .; then
- test ! -d "$dir" && mkdir "$dir"
- fi
-
- sole_name=`echo $file|sed "s%.*$target/%%"`
- in_file=`echo $dir|sed "s%/[^/][^/]*$%/$sole_name.in%"`
- echo "creating $new_name"
- sed -f vxworks/sed.$target -f vxworks/sed.general \
- -e "s,@HOST_TYPE@,$HOST_TYPE,g" \
- -e "s,@WIND_BASE@,$WIND_BASE,g" \
- -e "s,@TARGET@,$target,g" \
- $in_file > $new_name
-done
-
-
diff --git a/lib/diameter/autoconf/vxworks/sed.general b/lib/diameter/autoconf/vxworks/sed.general
deleted file mode 100644
index 77b306aa0a..0000000000
--- a/lib/diameter/autoconf/vxworks/sed.general
+++ /dev/null
@@ -1,125 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
-#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
-#
-# %CopyrightEnd%
-#
-# Author: Patrik Winroth
-#
-# This sed program file is intended to be used when creating Makefiles
-# for vxworks from the generic Makefile.in that is found in a number
-# of directories (see configure.vxworks).
-#
-# This is the general part that is common for all architectures.
-#
-
-# Size of data types.
-s|^#undef SIZEOF_CHAR|#define SIZEOF_CHAR 1|
-s|^#undef SIZEOF_SHORT|#define SIZEOF_SHORT 2|
-s|^#undef SIZEOF_INT|#define SIZEOF_INT 4|
-s|^#undef SIZEOF_LONG_LONG|#define SIZEOF_LONG_LONG 8|
-s|^#undef SIZEOF_LONG$|#define SIZEOF_LONG 4|
-
-# General stuff.
-s|@erts_rootdir@|/clearcase/otp/erts|
-
-s|@LIBOBJS@|$(OBJDIR)/elib_malloc.o|
-s|@DLOAD_LIB@||
-s|@LDFLAGS@||
-# FIXME: A bit strange to clear out remaining DED_*
-s|@DED_LDFLAGS@||
-s|@DED_CFLAGS@||
-s|@STATIC_CFLAGS@||
-s|@GCCLIB@|libgcc.a|
-s|@DEFS@||
-s|@DEXPORT@||
-s|@DCFLAGS@||
-s|@THR_DEFS@||
-s|@THR_LIBS@||
-s|@THR_LIB_NAME@||
-s|@THR_X_LIBS@||
-s|@ETHR_X_LIBS@||
-s|@ETHR_LIBS@||
-s|@ETHR_LIB_NAME@||
-s|@ETHR_DEFS@||
-s|@ETHR_THR_LIB_BASE@||
-s|@EMU_THR_DEFS@||
-s|@EMU_THR_LIBS@||
-s|@EMU_THR_LIB_NAME@|ethread|
-s|@ERTS_ENABLE_KERNEL_POLL@|no|
-s|@cc_root@|/clearcase/otp/|
-# Define VxWorks even though cross-compiling.
-s|@HCFLAGS@|-DVXWORKS|
-s|@HCLIBS@||
-s|@ENABLE_ALLOC_TYPE_VARS@||
-s|@TERMCAP_LIB@||
-s|@ERTS_BUILD_SMP_EMU@|no|
-s|@ERTS_BUILD_HYBRID_EMU@|no|
-s|@HAVE_VALGRIND@|no|
-s|@EXEEXT@||
-s|@WITH_SCTP@||
-
-# HiPE
-s|@HIPE_ENABLED@||
-s|@PERFCTR_PATH@||
-s|@USE_PERFCTR@||
-
-# m4
-s|@OPSYS@|noopsys|
-
-# Conditional inclusion of applications
-s|@HIPE_APP@||
-s|@SSL_APP@|ssl|
-s|@CRYPTO_APP@|crypto|
-s|@SSH_APP@|ssh|
-
-# The target tools prefix, prepended to all cc,ld,as etc commands
-s|@TTPREFIX@|GCC_EXEC_PREFIX=@WIND_BASE@/host/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/host/@HOST_TYPE@/bin/|
-
-# Install programs etc
-s|@PERL@|perl|
-s|@INSTALL@|/usr/ucb/install -c|
-s|@INSTALL_PROGRAM@|${INSTALL}|
-s|@INSTALL_SCRIPT@|${INSTALL}|
-s|@INSTALL_DATA@|${INSTALL} -m 644|
-s|@INSTALL_DIR@|$(INSTALL) -d|
-s|@RM@|/bin/rm|
-s|@MKDIR@|/bin/mkdir|
-s|@ERLANG_OSTYPE@|vxworks|
-s|@vxworks_reclaim@|reclaim.h|
-s|@os_mon_programs@||
-s|@erlexec@|erl.exec|
-s|@EMU_LIBOBJS@||
-
-# General CFLAGS
-s|@GENERAL_CFLAGS@|-DHAVE_LOCALTIME_R -DHAVE_GMTIME_R -DENABLE_ELIB_MALLOC -DELIB_HEAP_USER -DELIB_SORTED_BLOCKS -DWORDS_BIGENDIAN -DELIB_DONT_INITIALIZE -DSIZEOF_CHAR=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DSIZEOF_LONG_LONG=8 -DSIZEOF_VOID_P=4 -DERTS_USE_PORT_TASKS=1|g
-s|@WFLAGS@||
-
-# Thread flags for eidefs.mk (erl_interface)
-s|@EI_THREADS@|false|
-
-# Make java code compile although we don't test it on VxWorks (no license)
-s|@JAVAC@|javac|
-
-# What is this anyway?
-# Disable it and see what breaks.
-#s|@ded_soname@||
-
-# Only variable substituted directly
-s|$(LDFLAGS)|-r -d|
-s|@LIBRT@||
-# XXX What is EFFLAGS? Not used in the emulator Makefile.in anyway.
-s|$(EFLAGS)|-DENABLE_ELIB_MALLOC -DELIB_HEAP_USER -DELIB_SORTED_BLOCKS|
-
diff --git a/lib/diameter/autoconf/vxworks/sed.vxworks_cpu32 b/lib/diameter/autoconf/vxworks/sed.vxworks_cpu32
deleted file mode 100644
index 5a1590e786..0000000000
--- a/lib/diameter/autoconf/vxworks/sed.vxworks_cpu32
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
-#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
-#
-# %CopyrightEnd%
-#
-# Author: Patrik Winroth
-#
-# This sed program file is intended to be used when creating Makefiles for vxworks
-# from the generic Makefile.in that is found in a number of directories (see configure.vxworks)
-#
-#
-#
-s|@host@|vxworks_cpu32|
-s|@system_type@|vxworks_cpu32|
-s|@CC@|@TTPREFIX@cc68k|
-s|@HCC@|gcc|
-s|@LD@|@TTPREFIX@ld68k|
-s|@LIBS@||
-s|@DED_LD@|@TTPREFIX@ld68k|
-s|@DED_CFLAGS@|@CFLAGS@|
-s|@DEBUG_FLAGS@|-g|
-s|@GCCLIB_PATH@|@WIND_BASE@/host/@HOST_TYPE@/lib/gcc-lib/m68k-wrs-vxworks/cygnus-2.7.2-960126/m68000/msoft-float/libgcc.a|
-s|@RANLIB@|@TTPREFIX@ranlib68k|
-s|@AR@|@TTPREFIX@ar68k|
-s|@STRIP@|@TTPREFIX@strip68k|
-s|@SYMPREFIX@|_|
-s|@GCCLIBFLAGS@|-L@WIND_BASE@/host/@HOST_TYPE@/lib/gcc-lib/m68k-wrs-vxworks/cygnus-2.7.2-960126/m68000/msoft-float -lgcc|
-
-s|@LIB_CFLAGS@|@CFLAGS@|
-
-s|@CFLAGS@|@GENERAL_CFLAGS@ -DCPU=CPU32 -mnobitfield -DWANT_NONBLOCKING -DHAVE_MEMMOVE -DVXWORKS -I@WIND_BASE@/target/h -fno-builtin -nostdinc -fvolatile -msoft-float|
-#s|@LIB_CFLAGS@|@GENERAL_CFLAGS@ -DCPU=CPU32 -mnobitfield -DWANT_NONBLOCKING -DHAVE_MEMMOVE -DVXWORKS -I@WIND_BASE@/target/h -fno-builtin -nostdinc -fvolatile -msoft-float|
diff --git a/lib/diameter/autoconf/vxworks/sed.vxworks_ppc32 b/lib/diameter/autoconf/vxworks/sed.vxworks_ppc32
deleted file mode 100644
index 9104b24ed3..0000000000
--- a/lib/diameter/autoconf/vxworks/sed.vxworks_ppc32
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2006-2011. All Rights Reserved.
-#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
-#
-# %CopyrightEnd%
-#
-# Author: Peter Andersson
-#
-# This sed program file is intended to be used when creating Makefiles for vxworks
-# from the generic Makefile.in that is found in a number of directories (see configure.vxworks)
-#
-#
-#
-s|@host@|vxworks_ppc32|
-s|@system_type@|vxworks_ppc32|
-s|@ARCH@|ppc32|
-s|@CC@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/ccppc -mlongcall|
-s|@HCC@|gcc|
-s|@LD@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/ldppc|
-s|@STRIP@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/workbench-2.3/@HOST_TYPE@/bin/stripppc|
-s|@SYMPREFIX@||
-s|@LIBS@||
-s|@GCCLIBFLAGS@|-L@WIND_BASE@/vxworks-6.3/target/lib/ppc/PPC32/common -lgcc|
-s|@DED_LD@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/ldppc|
-s|@DED_CFLAGS@|@CFLAGS@|
-s|@DEBUG_CFLAGS@|@CFLAGS@|
-# generate dwarf debug code on PPC ..
-s|@DEBUG_FLAGS@|-gdwarf|
-# remove -g option
-s|TYPE_FLAGS = -g |TYPE_FLAGS = |
-s|@GCCLIB_PATH@|@WIND_BASE@/vxworks-6.3/target/lib/ppc/PPC32/common/libgcc.a|
-s|@RANLIB@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/ranlibppc|
-s|@AR@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/arppc|
-# -Dasm(X)= is for beam
-
-s|@LIB_CFLAGS@|@CFLAGS@|
-
-s|@CFLAGS@|@GENERAL_CFLAGS@ -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -DWANT_NONBLOCKING -DHAVE_SENS -DHAVE_MEMMOVE -DVXWORKS -I@WIND_BASE@/vxworks-6.3/target/h -I@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc/powerpc-wrs-vxworks/3.4.4/include -I@WIND_BASE@/vxworks-6.3/target/h/wrn/coreip -mstrict-align -fvolatile -fno-builtin |
-
-#s|@LIB_CFLAGS@|@GENERAL_CFLAGS@ -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -DWANT_NONBLOCKING -DHAVE_SENS -DHAVE_MEMMOVE -DVXWORKS -I@WIND_BASE@/vxworks-6.3/target/h/wrn/coreip -I@WIND_BASE@/vxworks-6.3/target/h -mstrict-align -fvolatile -fno-builtin |
diff --git a/lib/diameter/autoconf/vxworks/sed.vxworks_ppc603 b/lib/diameter/autoconf/vxworks/sed.vxworks_ppc603
deleted file mode 100644
index e1dd7c5afd..0000000000
--- a/lib/diameter/autoconf/vxworks/sed.vxworks_ppc603
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2000-2011. All Rights Reserved.
-#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
-#
-# %CopyrightEnd%
-#
-# Author: Patrik Winroth
-#
-# This sed program file is intended to be used when creating Makefiles for vxworks
-# from the generic Makefile.in that is found in a number of directories (see configure.vxworks)
-#
-#
-#
-s|@host@|vxworks_ppc603|
-s|@system_type@|vxworks_ppc603|
-s|@ARCH@|ppc603|
-s|@CC@|@TTPREFIX@ccppc -mlongcall|
-s|@HCC@|gcc|
-s|@LD@|@TTPREFIX@ldppc|
-s|@STRIP@|@TTPREFIX@stripppc|
-s|@SYMPREFIX@||
-s|@LIBS@||
-s|@GCCLIBFLAGS@|-L@WIND_BASE@/host/@HOST_TYPE@/lib/gcc-lib/powerpc-wrs-vxworks/cygnus-2.7.2-960126 -lgcc|
-s|@DED_LD@|@TTPREFIX@ldppc|
-s|@DED_CFLAGS@|@CFLAGS@|
-s|@DEBUG_CFLAGS@|@CFLAGS@|
-# generate dwarf debug code on PPC ..
-s|@DEBUG_FLAGS@|-gdwarf|
-# remove -g option
-s|TYPE_FLAGS = -g |TYPE_FLAGS = |
-s|@GCCLIB_PATH@|@WIND_BASE@/host/@HOST_TYPE@/lib/gcc-lib/powerpc-wrs-vxworks/cygnus-2.7.2-960126/libgcc.a|
-s|@RANLIB@|@TTPREFIX@ranlibppc|
-s|@AR@|@TTPREFIX@arppc|
-# -Dasm(X)= is for beam
-
-s|@LIB_CFLAGS@|@CFLAGS@|
-
-s|@CFLAGS@|@GENERAL_CFLAGS@ -DCPU=PPC603 -DWANT_NONBLOCKING -DHAVE_MEMMOVE -DVXWORKS -I@WIND_BASE@/target/h -mstrict-align -fvolatile -fno-builtin -fno-for-scope -D_GNU_TOOL|
-#s|@LIB_CFLAGS@|@GENERAL_CFLAGS@ -DCPU=PPC603 -DWANT_NONBLOCKING -DHAVE_MEMMOVE -DVXWORKS -I@WIND_BASE@/target/h -mstrict-align -fvolatile -fno-builtin -fno-for-scope -D_GNU_TOOL|
diff --git a/lib/diameter/autoconf/vxworks/sed.vxworks_ppc603_nolongcall b/lib/diameter/autoconf/vxworks/sed.vxworks_ppc603_nolongcall
deleted file mode 100644
index 5d7673d323..0000000000
--- a/lib/diameter/autoconf/vxworks/sed.vxworks_ppc603_nolongcall
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
-#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
-#
-# %CopyrightEnd%
-#
-# Author: Patrik Winroth
-#
-# This sed program file is intended to be used when creating Makefiles for vxworks
-# from the generic Makefile.in that is found in a number of directories (see configure.vxworks)
-#
-#
-#
-s|@host@|vxworks_ppc603|
-s|@system_type@|vxworks_ppc603|
-s|@ARCH@|ppc603|
-s|@CC@|@TTPREFIX@ccppc|
-s|@HCC@|gcc|
-s|@LD@|@TTPREFIX@ldppc|
-s|@STRIP@|@TTPREFIX@stripppc|
-s|@SYMPREFIX@||
-s|@LIBS@||
-s|@GCCLIBFLAGS@|-L@WIND_BASE@/host/@HOST_TYPE@/lib/gcc-lib/powerpc-wrs-vxworks/cygnus-2.7.2-960126 -lgcc|
-s|@DED_LD@|@TTPREFIX@ldppc|
-s|@DED_CFLAGS@|@CFLAGS@|
-# generate dwarf debug code on PPC ..
-s|@DEBUG_FLAGS@|-gdwarf|
-# remove -g option
-s|TYPE_FLAGS = -g |TYPE_FLAGS = |
-s|@GCCLIB_PATH@|@WIND_BASE@/host/@HOST_TYPE@/lib/gcc-lib/powerpc-wrs-vxworks/cygnus-2.7.2-960126/libgcc.a|
-s|@RANLIB@|@TTPREFIX@ranlibppc|
-s|@AR@|@TTPREFIX@arppc|
-# -Dasm(X)= is for beam
-
-s|@LIB_CFLAGS@|@CFLAGS@|
-
-s|@CFLAGS@|@GENERAL_CFLAGS@ -DCPU=PPC603 -DWANT_NONBLOCKING -DHAVE_MEMMOVE -DVXWORKS -I@WIND_BASE@/target/h -mstrict-align -fvolatile -fno-builtin -fno-for-scope -D_GNU_TOOL|
-#s|@LIB_CFLAGS@|@GENERAL_CFLAGS@ -DCPU=PPC603 -DWANT_NONBLOCKING -DHAVE_MEMMOVE -DVXWORKS -I@WIND_BASE@/target/h -mstrict-align -fvolatile -fno-builtin -fno-for-scope -D_GNU_TOOL|
-
diff --git a/lib/diameter/autoconf/vxworks/sed.vxworks_ppc860 b/lib/diameter/autoconf/vxworks/sed.vxworks_ppc860
deleted file mode 100644
index 7a3c32df5b..0000000000
--- a/lib/diameter/autoconf/vxworks/sed.vxworks_ppc860
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
-#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
-#
-# %CopyrightEnd%
-#
-# Author: Patrik Winroth
-#
-# This sed program file is intended to be used when creating Makefiles for vxworks
-# from the generic Makefile.in that is found in a number of directories (see configure.vxworks)
-#
-#
-#
-s|@host@|vxworks_ppc860|
-s|@system_type@|vxworks_ppc860|
-s|@ARCH@|ppc860|
-s|@CC@|@TTPREFIX@ccppc -mlongcall|
-s|@HCC@|gcc|
-s|@LD@|@TTPREFIX@ldppc|
-s|@STRIP@|@TTPREFIX@stripppc|
-s|@SYMPREFIX@||
-s|@LIBS@||
-s|@GCCLIBFLAGS@|-L@WIND_BASE@/host/@HOST_TYPE@/lib/gcc-lib/powerpc-wrs-vxworks/cygnus-2.7.2-960126/soft-float -lgcc|
-s|@DED_LD@|@TTPREFIX@ldppc|
-s|@DED_CFLAGS@|@CFLAGS@|
-s|@DEBUG_CFLAGS@|@CFLAGS@|
-# generate dwarf debug code on PPC ..
-s|@DEBUG_FLAGS@|-gdwarf|
-# remove -g option (go for dwarf)
-s|TYPE_FLAGS = -g |TYPE_FLAGS = |
-s|@GCCLIB_PATH@|@WIND_BASE@/host/@HOST_TYPE@/lib/gcc-lib/powerpc-wrs-vxworks/cygnus-2.7.2-960126/soft-float/libgcc.a|
-s|@RANLIB@|@TTPREFIX@ranlibppc|
-s|@AR@|@TTPREFIX@arppc|
-
-s|@LIB_CFLAGS@|@CFLAGS@|
-
-s|@CFLAGS@|@GENERAL_CFLAGS@ -DCPU=PPC860 -DWANT_NONBLOCKING -DHAVE_MEMMOVE -DVXWORKS -I@WIND_BASE@/target/h -mcpu=860 -fvolatile -fno-builtin -fno-for-scope -msoft-float -D_GNU_TOOL -nostdinc|
-#s|@LIB_CFLAGS@|@GENERAL_CFLAGS@ -DCPU=PPC860 -DWANT_NONBLOCKING -DHAVE_MEMMOVE -DVXWORKS -I@WIND_BASE@/target/h -mcpu=powerpc -fvolatile -fno-builtin -fno-for-scope -msoft-float -D_GNU_TOOL -nostdinc|
diff --git a/lib/diameter/autoconf/vxworks/sed.vxworks_simlinux b/lib/diameter/autoconf/vxworks/sed.vxworks_simlinux
deleted file mode 100644
index 56eae6507c..0000000000
--- a/lib/diameter/autoconf/vxworks/sed.vxworks_simlinux
+++ /dev/null
@@ -1,59 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2008-2011. All Rights Reserved.
-#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
-#
-# %CopyrightEnd%
-#
-# Author: Peter Andersson
-#
-# This sed program file is intended to be used when creating Makefiles for vxworks
-# from the generic Makefile.in that is found in a number of directories (see configure.vxworks)
-#
-#
-#
-s|@host@|vxworks_simlinux|
-s|@system_type@|vxworks_simlinux|
-s|@ARCH@|simlinux|
-
-s|@CC@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/ccpentium|
-
-s|@HCC@|gcc|
-
-s|@LD@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/ldpentium|
-
-#s|@STRIP@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/strip|
-s|@STRIP@||
-
-s|@SYMPREFIX@||
-s|@LIBS@||
-s|@GCCLIBFLAGS@|-L@WIND_BASE@/vxworks-6.3/target/lib/simlinux/SIMLINUX/common -lgcc|
-
-s|@DED_LD@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/ldpentium|
-
-s|@DED_CFLAGS@|@CFLAGS@|
-s|@DEBUG_CFLAGS@|@CFLAGS@|
-# remove -g option
-s|TYPE_FLAGS = -g |TYPE_FLAGS = |
-s|@GCCLIB_PATH@|@WIND_BASE@/vxworks-6.3/target/lib/simlinux/SIMLINUX/common/libgcc.a|
-
-s|@RANLIB@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/ranlibpentium|
-
-s|@AR@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/arpentium|
-
-# -Dasm(X)= is for beam
-s|@LIB_CFLAGS@|@CFLAGS@|
-
-s|@CFLAGS@|@GENERAL_CFLAGS@ -DCPU=SIMLINUX -DTOOL_FAMILY=gnu -DTOOL=gnu -DWANT_NONBLOCKING -DHAVE_SENS -DHAVE_MEMMOVE -DVXWORKS -DDEBUG -I@WIND_BASE@/vxworks-6.3/target/h -I@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc/i586-wrs-vxworks/3.4.4/include -I@WIND_BASE@/vxworks-6.3/target/h/wrn/coreip -fvolatile -fno-builtin |
-#s|@LIB_CFLAGS@|@GENERAL_CFLAGS@ -DCPU=SIMLINUX -DTOOL_FAMILY=gnu -DTOOL=gnu -DWANT_NONBLOCKING -DHAVE_SENS -DHAVE_MEMMOVE -DVXWORKS -DDEBUG -I@WIND_BASE@/vxworks-6.3/target/h -I@WIND_BASE@/vxworks-6.3/target/h/wrn/coreip -mstrict-align -fvolatile -fno-builtin |
diff --git a/lib/diameter/autoconf/vxworks/sed.vxworks_simso b/lib/diameter/autoconf/vxworks/sed.vxworks_simso
deleted file mode 100644
index 6b845d31de..0000000000
--- a/lib/diameter/autoconf/vxworks/sed.vxworks_simso
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2005-2011. All Rights Reserved.
-#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
-#
-# %CopyrightEnd%
-#
-# Author: Peter Andersson
-#
-# This sed program file is intended to be used when creating Makefiles for vxworks
-# from the generic Makefile.in that is found in a number of directories (see configure.vxworks)
-#
-#
-#
-s|@host@|vxworks_simso|
-s|@system_type@|vxworks_simso|
-s|@ARCH@|simso|
-
-# Tornado2.2: s|@CC@|@TTPREFIX@ccsimso|
-s|@CC@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/ccsparc|
-
-s|@HCC@|gcc|
-
-# Tornado2.2: s|@LD@|@TTPREFIX@ldsimso|
-s|@LD@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/ldsparc|
-
-# Tornado2.2: s|@STRIP@|@TTPREFIX@stripsimso|
-s|@STRIP@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/stripsparc|
-
-s|@SYMPREFIX@||
-s|@LIBS@||
-s|@GCCLIBFLAGS@|-L@WIND_BASE@/vxworks-6.3/target/lib/simso/SIMSPARCSOLARIS/common -lgcc|
-
-# Tornado2.2: s|@DED_LD@|@TTPREFIX@ldsimso|
-s|@DED_LD@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/ldsparc|
-
-s|@DED_CFLAGS@|@CFLAGS@|
-s|@DEBUG_CFLAGS@|@CFLAGS@|
-# remove -g option
-s|TYPE_FLAGS = -g |TYPE_FLAGS = |
-s|@GCCLIB_PATH@|@WIND_BASE@/vxworks-6.3/target/lib/simso/SIMSPARCSOLARIS/common/libgcc.a|
-
-# Tornado2.2: s|@RANLIB@|@TTPREFIX@ranlibsimso|
-s|@RANLIB@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/ranlibsparc|
-
-# Tornado2.2: s|@AR@|arsimso|
-s|@AR@|GCC_EXEC_PREFIX=@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc-lib/ @WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/bin/arsparc|
-
-# -Dasm(X)= is for beam
-s|@LIB_CFLAGS@|@CFLAGS@|
-
-s|@CFLAGS@|@GENERAL_CFLAGS@ -DCPU=SIMSPARCSOLARIS -DTOOL_FAMILY=gnu -DTOOL=gnu -DWANT_NONBLOCKING -DHAVE_SENS -DHAVE_MEMMOVE -DVXWORKS -DDEBUG -I@WIND_BASE@/vxworks-6.3/target/h -I@WIND_BASE@/gnu/3.4.4-vxworks-6.3/@HOST_TYPE@/lib/gcc/sparc-wrs-vxworks/3.4.4/include -I@WIND_BASE@/vxworks-6.3/target/h/wrn/coreip -fvolatile -fno-builtin |
-#s|@LIB_CFLAGS@|@GENERAL_CFLAGS@ -DCPU=SIMSPARCSOLARIS -DTOOL_FAMILY=gnu -DTOOL=gnu -DWANT_NONBLOCKING -DHAVE_SENS -DHAVE_MEMMOVE -DVXWORKS -DDEBUG -I@WIND_BASE@/vxworks-6.3/target/h -I@WIND_BASE@/vxworks-6.3/target/h/wrn/coreip -mstrict-align -fvolatile -fno-builtin |
diff --git a/lib/diameter/autoconf/vxworks/sed.vxworks_sparc b/lib/diameter/autoconf/vxworks/sed.vxworks_sparc
deleted file mode 100644
index 6f637d8746..0000000000
--- a/lib/diameter/autoconf/vxworks/sed.vxworks_sparc
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
-#
-# The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved online at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
-#
-# %CopyrightEnd%
-#
-# Author: Patrik Winroth
-#
-# This sed program file is intended to be used when creating Makefiles for vxworks
-# from the generic Makefile.in that is found in a number of directories (see configure.vxworks)
-#
-
-# ccsparc -O2 doesn't work when compiling "rundir"/gc.c - signal 11 is generated when trying
-# therefore it is compiled with -O1 instead, which works - get a new ccsparc !
-s/\$(COMPILE\.emu) -o \$@ -c gc\.c/$(CC) @CFLAGS@ @DEFS@ -O1 $(BEAM_MODE) -I$(SYSDIR) -I$(EMUDIR) -I. $(CPPFLAGS) -c -o $@ -c gc.c/
-s/@host@/vxworks_sparc/
-s/@system_type@/vxworks_sparc/
-s/@CC@/\/home\/gandalf\/bsproj\/tools\/vw-gnu\/solaris.sparc\/bin\/ccsparc/
-s/@HCC@/gcc/
-s/@LD@/\/home\/gandalf\/bsproj\/tools\/vw-gnu\/solaris.sparc\/bin\/ldsparc/
-s/@DEBUG_FLAGS@/-g/
-s/@GCCLIB_PATH@/\/home\/gandalf\/bsproj\/tools\/vw-gnu\/solaris.sparc\/lib\/gcc-lib\/sparc-wrs-vxworks\/cygnus-2.2.3.1\/libgcc.a/
-s/@RANLIB@/ranlibsparc/
-s/@AR@/arsparc/
-s/@CFLAGS@/-I\/home\/gandalf\/bsproj\/BS.2\/UOS\/vw\/5.2\/h -DWANT_NONBLOCKING -DHAVE_MEMMOVE -DCPU=SPARC -DVXWORKS -fno-builtin -nostdinc/
-
diff --git a/lib/diameter/doc/src/Makefile b/lib/diameter/doc/src/Makefile
index bc3e649e6b..59ca660797 100644
--- a/lib/diameter/doc/src/Makefile
+++ b/lib/diameter/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2011. All Rights Reserved.
+# Copyright Ericsson AB 2010-2012. 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
@@ -162,18 +162,18 @@ include $(DIAMETER_TOP)/make/release_targets.mk
endif
release_docs_spec: $(LOCAL)docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man1
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man4
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(HTMLDIR)/*.* $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DATA) $(MAN1_FILES) $(RELEASE_PATH)/man/man1
- $(INSTALL_DATA) $(MAN3_FILES) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN4_FILES) $(RELEASE_PATH)/man/man4
- [ -z "$(LOCAL)" ] || cp -r $(HTMLDIR)/js $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man1"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man4"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(HTMLDIR)/*.* "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(MAN1_FILES) "$(RELEASE_PATH)/man/man1"
+ $(INSTALL_DATA) $(MAN3_FILES) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN4_FILES) "$(RELEASE_PATH)/man/man4"
+ [ -z "$(LOCAL)" ] || cp -r $(HTMLDIR)/js "$(RELSYSDIR)/doc/html"
echo $(LOCAL)
release_spec:
diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml
index 93e2603c10..b8652a7482 100644
--- a/lib/diameter/doc/src/diameter.xml
+++ b/lib/diameter/doc/src/diameter.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
-<year>2011</year>
+<year>2011</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -43,13 +43,13 @@ under the License.
<description>
<p>
-This module provides the interface with which a user
-creates a service that sends and receives messages using the
+This module provides the interface with which a user can
+implement a Diameter node that sends and receives messages using the
Diameter protocol as defined in RFC 3588.</p>
<p>
Basic usage consists of creating a representation of a
-locally implemented Diameter peer and its capabilities with <seealso
+locally implemented Diameter node and its capabilities with <seealso
marker="#start_service">start_service/2</seealso>, adding transport
capability using <seealso
marker="#add_transport">add_transport/2</seealso> and sending Diameter
@@ -61,17 +61,15 @@ marker="diameter_app">diameter_app(3)</seealso> callback modules as
specified in the service configuration.</p>
<p>
-Beware the difference between <em>diameter application</em> and
-<em>Diameter application</em>.
+Beware the difference between <em>diameter</em> (not capitalised) and
+<em>Diameter</em> (capitalised).
The former refers to the Erlang application named diameter whose main
-api is defined here, the latter to an application of the Diameter
-protocol in the sense of RFC 3588.
-More generally, capitalized Diameter refers to the RFC
-and diameter to this implementation.</p>
+api is defined here, the latter to Diameter protocol in the sense of
+RFC 3588.</p>
<p>
-The diameter application must be started before calling functions in
-this module.</p>
+The diameter application must be started before calling most functions
+in this module.</p>
</description>
@@ -84,13 +82,15 @@ this module.</p>
<tag><c>Address()</c></tag>
<tag><c>DiameterIdentity()</c></tag>
+<tag><c>Grouped()</c></tag>
+<tag><c>OctetString()</c></tag>
<tag><c>Time()</c></tag>
<tag><c>Unsigned32()</c></tag>
<tag><c>UTF8String()</c></tag>
<item>
<p>
Types corresponding to RFC 3588 AVP Data Formats.
-Defined in <seealso marker="diameter_dict">diameter_dict(4)</seealso>.</p>
+Defined in <seealso marker="diameter_dict#DATA_TYPES">diameter_dict(4)</seealso>.</p>
<marker id="application_alias"/>
</item>
@@ -99,10 +99,9 @@ Defined in <seealso marker="diameter_dict">diameter_dict(4)</seealso>.</p>
<item>
<p>
A name identifying a Diameter application in
-service configuration passed to <seealso
-marker="#start_service">start_service/2</seealso> and passed to
-<seealso marker="#call">call/4</seealso> when sending requests
-belonging to the application.</p>
+service configuration.
+Passed to <seealso marker="#call">call/4</seealso> when sending requests
+defined by the application.</p>
<marker id="application_module"/>
</item>
@@ -120,19 +119,14 @@ ExtraArgs = list()
A module implementing the callback interface defined in <seealso
marker="diameter_app">diameter_app(3)</seealso>, along with any
extra arguments to be appended to those documented for the interface.
-Any extra arguments are appended to the documented list of arguments for
-each function.
-Note that additional arguments specific to an outgoing request be
+Note that extra arguments specific to an outgoing request can be
specified to <seealso marker="#call">call/4</seealso>, in which case
-the call-specific arguments are appended to any specified with the
-callback module.</p>
+those are are appended to any module-specific extra arguments.</p>
<p>
Specifying a <c>#diameter_callback{}</c> record allows individual
functions to be configured in place of the usual <seealso
-marker="diameter_app">diameter_app(3)</seealso> callbacks, with
-default implementations provided by module <c>diameter_callback</c>
-unless otherwise specified.
+marker="diameter_app">diameter_app(3)</seealso> callbacks.
See that module for details.</p>
<marker id="application_opt"/>
@@ -142,18 +136,18 @@ See that module for details.</p>
<item>
<p>
-Options defining a Diameter application as configured in an
-<c>application</c> option passed to
-<seealso marker="#start_service">start_service/2</seealso>.</p>
+Options defining a Diameter application.
+Has one the following types.</p>
<taglist>
-<tag><c>{alias, application_alias()}</c></tag>
+<tag><c>{alias, <seealso marker="#application_alias">application_alias()</seealso>}</c></tag>
<item>
<p>
An unique identifier for the application in the scope of the
service.
-Optional, defaults to the value of the <c>dictionary</c> option.</p>
+Defaults to the value of the <c>dictionary</c> option if
+unspecified.</p>
</item>
<tag><c>{dictionary, atom()}</c></tag>
@@ -166,23 +160,23 @@ documented in <seealso
marker="diameter_dict">diameter_dict(4)</seealso>.</p>
</item>
-<tag><c>{module, application_module()}</c></tag>
+<tag><c>{module, <seealso marker="#application_module">application_module()</seealso>}</c></tag>
<item>
<p>
-A callback module with which messages of the Diameter application are
+The callback module with which messages of the Diameter application are
handled.
See <seealso marker="diameter_app">diameter_app(3)</seealso> for
-information on the required interface and semantics.</p>
+the required interface and semantics.</p>
</item>
<tag><c>{state, term()}</c></tag>
<item>
<p>
The initial callback state.
-Defaults to the value of the <c>alias</c> option if unspecified.
-The prevailing state is passed to certain
+The prevailing state is passed to some
<seealso marker="diameter_app">diameter_app(3)</seealso>
-callbacks, which can then return a new state.</p>
+callbacks, which can then return a new state.
+Defaults to the value of the <c>alias</c> option if unspecified.</p>
</item>
<tag><c>{call_mutates_state, true|false}</c></tag>
@@ -190,19 +184,18 @@ callbacks, which can then return a new state.</p>
<p>
Specifies whether or not the <seealso
marker="diameter_app#pick_peer">pick_peer/4</seealso>
-application callback (following from a call to
-<seealso marker="#call">call/4</seealso>)
-can modifiy state,
+application callback can modify the application state,
Defaults to <c>false</c> if unspecified.</p>
+<note>
<p>
-Note that <seealso
-marker="diameter_app#pick_peer">pick_peer</seealso> callbacks are
-serialized when these are allowed to modify state, which is a
+<seealso marker="diameter_app#pick_peer">pick_peer</seealso> callbacks
+are serialized when these are allowed to modify state, which is a
potential performance bottleneck.
A simple Diameter client may suffer no ill effects from using mutable
-state but a server or agent that responds to incoming request but
-sending its own requests should probably avoid it.</p>
+state but a server or agent that responds to incoming request should
+probably avoid it.</p>
+</note>
</item>
<tag><c>{answer_errors, callback|report|discard}</c></tag>
@@ -213,9 +206,9 @@ decode errors are handled.
If <c>callback</c> then errors result in a <seealso
marker="diameter_app#handle_answer">handle_answer/4</seealso>
callback in the same fashion as for <seealso
-marker="diameter_app#handle_request">handle_request/3</seealso>, in the
-<c>errors</c> field of the <c>diameter_packet</c> record passed into
-the callback.
+marker="diameter_app#handle_request">handle_request/3</seealso>, with
+errors communicated in the <c>errors</c> field of the
+<c>#diameter_packet{}</c> record passed to the callback.
If <c>report</c> then an answer containing errors is discarded
without a callback and a warning report is written to the log.
If <c>discard</c> then an answer containing errors is silently
@@ -239,7 +232,8 @@ Defaults to <c>report</c> if unspecified.</p>
<p>
Options available to <seealso marker="#call">call/4</seealso> when
-sending an outgoing Diameter request.</p>
+sending an outgoing Diameter request.
+Has one of the following types.</p>
<taglist>
@@ -248,12 +242,12 @@ sending an outgoing Diameter request.</p>
<p>
Extra arguments to append to callbacks to the callback
module in question.
-These are appended to any extra arguments configured with the callback
+These are appended to any extra arguments configured on the callback
itself.
Multiple options append to the argument list.</p>
</item>
-<tag><c>{filter, peer_filter()}</c></tag>
+<tag><c>{filter, <seealso marker="#peer_filter">peer_filter()</seealso>}</c></tag>
<item>
<p>
A filter to apply to the list of available peers before passing them to
@@ -264,7 +258,7 @@ corresponding list of filters.
Defaults to <c>none</c>.</p>
</item>
-<tag><c>{timeout, Unsigned32()}</c></tag>
+<tag><c>{timeout, <seealso marker="diameter_dict#DATA_TYPES">Unsigned32()</seealso>}</c></tag>
<item>
<p>
The number of milliseconds after which the request should
@@ -298,121 +292,55 @@ to fail.</p>
<item>
<p>
-AVP values used in outgoing CER/CEA messages during capabilities exchange.
-Can be configured both on a service and a transport, the latter taking
-precedence over the former.</p>
+AVP values sent in outgoing CER or CEA messages during capabilities
+exchange.
+Can be configured both on a service and a transport, values specified
+on the latter taking precedence over any specified on the former.
+Has one of the following types.</p>
<taglist>
-<tag><c>{'Origin-Host', DiameterIdentity()}</c></tag>
-<item>
-<p>
-Value of the Origin-Host AVP in outgoing messages.</p>
-</item>
-
-<tag><c>{'Origin-Realm', DiameterIdentity()}</c></tag>
-<item>
-<p>
-Value of the Origin-Realm AVP in outgoing messages.</p>
-</item>
-
-<tag><c>{'Host-IP-Address', [Address()]}</c></tag>
-<item>
-<p>
-Values of Host-IP-Address AVPs.
-Optional.</p>
-
-<p>
-The list of addresses is available to the start function of a
-transport module, which either uses them as is or returns a new list
-(typically as configured as <c>transport_config()</c> on the
-transport module in question) in order for the correct list of
-addresses to be sent in capabilities exchange messages.</p>
-</item>
-
-<tag><c>{'Vendor-Id', Unsigned32()}</c></tag>
-<item>
-<p>
-Value of the Vendor-Id AVP sent in an outgoing capabilities
-exchange message.</p>
-</item>
-
-<tag><c>{'Product-Name', UTF8String()}</c></tag>
+<tag><c>{'Origin-Host', <seealso marker="diameter_dict#DATA_TYPES">DiameterIdentity()</seealso>}</c></tag>
+<tag><c>{'Origin-Realm', <seealso marker="diameter_dict#DATA_TYPES">DiameterIdentity()</seealso>}</c></tag>
+<tag><c>{'Host-IP-Address', [<seealso marker="diameter_dict#DATA_TYPES">Address()</seealso>]}</c></tag>
<item>
<p>
-Value of the Product-Name AVP sent in an outgoing capabilities
-exchange message.</p>
+An address list is available to the start function of a
+<seealso marker="diameter_transport">transport module</seealso>, which
+can return a new list for use in the subsequent CER or CEA.
+Host-IP-Address need not be specified if the transport start function
+returns an address list.</p>
</item>
-<tag><c>{'Origin-State-Id', Unsigned32()}</c></tag>
+<tag><c>{'Vendor-Id', <seealso marker="diameter_dict#DATA_TYPES">Unsigned32()</seealso>}</c></tag>
+<tag><c>{'Product-Name', <seealso marker="diameter_dict#DATA_TYPES">UTF8String()</seealso>}</c></tag>
+<tag><c>{'Origin-State-Id', <seealso marker="diameter_dict#DATA_TYPES">Unsigned32()</seealso>}</c></tag>
<item>
<p>
-Value of Origin-State-Id to be included in outgoing messages sent by
-diameter itself.
-In particular, the AVP will be included in CER/CEA and DWR/DWA messages.
-Optional.</p>
-
-<p>
+Origin-State-Id is optional but will be included in outgoing messages
+sent by diameter itself: CER/CEA, DWR/DWA and DPR/DPA.
Setting a value of <c>0</c> (zero) is equivalent to not setting a
value as documented in RFC 3588.
The function <seealso
marker="#origin_state_id">origin_state_id/0</seealso>
-can be used as to retrieve a value that is set when the diameter
+can be used as to retrieve a value that is computed when the diameter
application is started.</p>
</item>
-<tag><c>{'Supported-Vendor-Id', [Unsigned32()]}</c></tag>
-<item>
-<p>
-Values of Supported-Vendor-Id AVPs sent in an outgoing
-capabilities exchange message.
-Optional, defaults to the empty list.</p>
-</item>
-
-<tag><c>{'Auth-Application-Id', [Unsigned32()]}</c></tag>
+<tag><c>{'Supported-Vendor-Id', [<seealso marker="diameter_dict#DATA_TYPES">Unsigned32()</seealso>]}</c></tag>
+<tag><c>{'Auth-Application-Id', [<seealso marker="diameter_dict#DATA_TYPES">Unsigned32()</seealso>]}</c></tag>
+<tag><c>{'Inband-Security-Id', [<seealso marker="diameter_dict#DATA_TYPES">Unsigned32()</seealso>]}</c></tag>
<item>
<p>
-Values of Auth-Application-Id AVPs sent in an outgoing
-capabilities exchange message.
-Optional, defaults to the empty list.</p>
-</item>
-
-<tag><c>{'Inband-Security-Id', [Unsigned32()]}</c></tag>
-<item>
-<p>
-Values of Inband-Security-Id AVPs sent in an outgoing
-capabilities exchange message.
-Optional, defaults to the empty list, which is equivalent to a
-list containing only 0 (= NO_INBAND_SECURITY).</p>
-
-<p>
+Inband-Security-Id defaults to the empty list, which is equivalent to a
+list containing only 0 (= NO_INBAND_SECURITY).
If 1 (= TLS) is specified then TLS is selected if the CER/CEA received
from the peer offers it.</p>
</item>
-<tag><c>{'Acct-Application-Id', [Unsigned32()]}</c></tag>
-<item>
-<p>
-Values of Acct-Application-Id AVPs sent in an outgoing
-capabilities exchange message.
-Optional, defaults to the empty list.</p>
-</item>
-
-<tag><c>{'Vendor-Specific-Application-Id', [Grouped()]}</c></tag>
-<item>
-<p>
-Values of Vendor-Specific-Application-Id AVPs sent in
-an outgoing capabilities exchange message.
-Optional, defaults to the empty list.</p>
-</item>
-
-<tag><c>{'Firmware-Revision', Unsigned32()}</c></tag>
-<item>
-<p>
-Value of the Firmware-Revision AVP sent in an outgoing capabilities
-exchange message.
-Optional.</p>
-</item>
+<tag><c>{'Acct-Application-Id', [<seealso marker="diameter_dict#DATA_TYPES">Unsigned32()</seealso>]}</c></tag>
+<tag><c>{'Vendor-Specific-Application-Id', [<seealso marker="diameter_dict#DATA_TYPES">Grouped()</seealso>]}</c></tag>
+<tag><c>{'Firmware-Revision', <seealso marker="diameter_dict#DATA_TYPES">Unsigned32()</seealso>}</c></tag>
</taglist>
@@ -441,14 +369,17 @@ eval(F) ->
</code>
<p>
-Applying an evaluable() <c>E</c> to an argument list <c>A</c>
+Applying an <c><seealso marker="#evaluable">evaluable()</seealso></c>
+<c>E</c> to an argument list <c>A</c>
is meant in the sense of <c>eval([E|A])</c>.</p>
+<warning>
<p>
-Beware of using local funs (that is, fun expressions not of the
-form <c>fun Module:Name/Arity</c>) in situations in which the fun is
-not short-lived and code is to be upgraded at runtime since any
-processes retaining such a fun will have a reference to old code.</p>
+Beware of using fun expressions of the form <c>fun Name/Arity</c> (not
+fun Mod:Name/Arity) in situations in which the fun is not short-lived
+and code is to be upgraded at runtime since any processes retaining
+such a fun will have a reference to old code.</p>
+</warning>
<marker id="peer_filter"/>
</item>
@@ -490,63 +421,76 @@ or any peer if the request does not contain
a <c>Destination-Realm</c> AVP.</p>
</item>
-<tag><c>{host, any|DiameterIdentity()}</c></tag>
+<tag><c>{host, any|<seealso marker="diameter_dict#DATA_TYPES">DiameterIdentity()</seealso>}</c></tag>
<item>
<p>
Matches only those peers whose <c>Origin-Host</c> has the
specified value, or all peers if the atom <c>any</c>.</p>
</item>
-<tag><c>{realm, any|DiameterIdentity()</c></tag>
+<tag><c>{realm, any|<seealso marker="diameter_dict#DATA_TYPES">DiameterIdentity()</seealso></c></tag>
<item>
<p>
Matches only those peers whose <c>Origin-Realm</c> has the
-value, or all peers if the atom <c>any</c>.</p>
+specified value, or all peers if the atom <c>any</c>.</p>
</item>
-<tag><c>{eval, evaluable()}</c></tag>
+<tag><c>{eval, <seealso marker="#evaluable">evaluable()</seealso>}</c></tag>
<item>
<p>
-Matches only those peers for which the specified evaluable() returns
+Matches only those peers for which the specified <c><seealso
+marker="#evaluable">evaluable()</seealso></c> returns
<c>true</c> on the connection's <c>diameter_caps</c> record.
Any other return value or exception is equivalent to <c>false</c>.</p>
</item>
-<tag><c>{neg, peer_filter()}</c></tag>
+<tag><c>{neg, <seealso marker="#peer_filter">peer_filter()</seealso>}</c></tag>
<item>
<p>
Matches only those peers not matched by the specified filter.</p>
</item>
-<tag><c>{all, [peer_filter()]}</c></tag>
+<tag><c>{all, [<seealso marker="#peer_filter">peer_filter()</seealso>]}</c></tag>
<item>
<p>
-Matches only those peers matched by each filter of the specified list.</p>
+Matches only those peers matched by each filter in the specified list.</p>
</item>
-<tag><c>{any, [peer_filter()]}</c></tag>
+<tag><c>{any, [<seealso marker="#peer_filter">peer_filter()</seealso>]}</c></tag>
<item>
<p>
-Matches only those peers matched by at least one filter of the
+Matches only those peers matched by at least one filter in the
specified list.</p>
</item>
</taglist>
<p>
-Note that the <c>host</c> and <c>realm</c> filters examine the
+An invalid filter is equivalent to <c>{any,[]}</c>, a filter
+that matches no peer.</p>
+
+<note>
+<p>
+The <c>host</c> and <c>realm</c> filters examine the
outgoing request as passed to <seealso marker="#call">call/4</seealso>,
-assuming that this is a record- or list-valued message() as documented
-in <seealso marker="diameter_app">diameter_app(3)</seealso>, and that
-the message contains at most one of each AVP.
-If this is not the case then the <c>{host|realm, DiameterIdentity()}</c>
+assuming that this is a record- or list-valued <c><seealso
+marker="diameter_app#message">diameter_app:message()</seealso></c>,
+and that the message contains at most one of each AVP.
+If this is not the case then the <c>{host|realm, <seealso
+marker="diameter_dict#DATA_TYPES">DiameterIdentity()</seealso>}</c>
filters must be used to achieve the desired result.
-Note also that an empty host/realm (which should not be typical)
-is equivalent to an unspecified one for the purposes of filtering.</p>
+An empty <c><seealso
+marker="diameter_dict#DATA_TYPES">DiameterIdentity()</seealso></c>
+(which should not be typical)
+matches all hosts/realms for the purposes of filtering.</p>
+</note>
+<warning>
<p>
-An invalid filter is equivalent to <c>{any, []}</c>, a filter
-that matches no peer.</p>
+A <c>host</c> filter is not typically desirable when setting
+Destination-Host since it will remove peer agents from the
+candidates list.</p>
+</warning>
<marker id="service_event"/>
</item>
@@ -554,12 +498,12 @@ that matches no peer.</p>
<tag><c>service_event() = #diameter_event{}</c></tag>
<item>
<p>
-Event message sent to processes that have subscribed using <seealso
-marker="#subscribe">subscribe/1</seealso>.</p>
+An event message sent to processes that have subscribed to these using
+<seealso marker="#subscribe">subscribe/1</seealso>.</p>
<p>
-The <c>info</c> field of the event record can be one of the
-following.</p>
+The <c>info</c> field of the event record can have one of the
+following types.</p>
<taglist>
@@ -568,27 +512,27 @@ following.</p>
<tag><c>{down, Ref, Peer, Config}</c></tag>
<item>
<code>
-Ref = transport_ref()
-Peer = diameter_app:peer()
-Config = {connect|listen, [transport_opt()]}
+Ref = <seealso marker="#transport_ref">transport_ref()</seealso>
+Peer = <seealso marker="diameter_app#peer">diameter_app:peer()</seealso>
+Config = {connect|listen, [<seealso marker="#transport_opt">transport_opt()</seealso>]}
Pkt = #diameter_packet{}
</code>
<p>
The RFC 3539 watchdog state machine has
-transitioned into (<c>up</c>) or out of (<c>down</c>) the open
+transitioned into (<c>up</c>) or out of (<c>down</c>) the OKAY
state.
-If a <c>diameter_packet</c> record is present in an <c>up</c> tuple
-then there has been an exchange of capabilities exchange messages and
-the record contains the received CER or CEA, otherwise the
-connection has reestablished without the loss or transport
+If a <c>#diameter_packet{}</c> record is present in an <c>up</c> event
+then there has been a capabilties exchange on a newly established
+transport connection and the record contains the received CER or CEA.
+Otherwise a connection has reestablished without the loss or
connectivity.</p>
<p>
-Note that a single up/down event for a given peer corresponds to
-as many <seealso marker="diameter_app#peer_up">peer_up/peer_down</seealso>
-callbacks as there are Diameter applications shared by the peer,
-as determined during capablilities exchange.
+Note that a single <c>up</c>/<c>down</c> event for a given peer
+corresponds to one <seealso marker="diameter_app#peer_up">peer_up/peer_down</seealso>
+callback for each of the Diameter applications negotiated during
+capablilities exchange.
That is, the event communicates connectivity with the
peer as a whole while the callbacks communicate connectivity with
respect to individual Diameter applications.</p>
@@ -597,26 +541,28 @@ respect to individual Diameter applications.</p>
<tag><c>{reconnect, Ref, Opts}</c></tag>
<item>
<code>
-Ref = transport_ref()
-Opts = [transport_opt()]
+Ref = <seealso marker="#transport_ref">transport_ref()</seealso>
+Opts = [<seealso marker="#transport_opt">transport_opt()</seealso>]
</code>
<p>
A connecting transport is attempting to establish/reestablish a
-transport connection with a peer following <c>reconnect_timer</c> or
-<c>watchdog_timer</c> expiry.</p>
+transport connection with a peer following <seealso
+marker="#reconnect_timer">reconnect_timer</seealso> or
+<seealso marker="#watchdog_timer">watchdog_timer</seealso>
+expiry.</p>
</item>
<tag><c>{closed, Ref, Reason, Config}</c></tag>
<item>
<code>
-Ref = transport_ref()
-Config = {connect|listen, [transport_opt()]}
+Ref = <seealso marker="#transport_ref">transport_ref()</seealso>
+Config = {connect|listen, [<seealso marker="#transport_opt">transport_opt()</seealso>]}
</code>
<p>
-Capabilities exchange has failed. <c>Reason</c> can be one of
-the following.</p>
+Capabilities exchange has failed.
+<c>Reason</c> can have one of the following types.</p>
<taglist>
@@ -627,17 +573,17 @@ Result = ResultCode | {capabilities_cb, CB, ResultCode|discard}
Caps = #diameter_caps{}
Pkt = #diameter_packet{}
ResultCode = integer()
-CB = evaluable()
+CB = <seealso marker="#evaluable">evaluable()</seealso>
</code>
<p>
An incoming CER has been answered with the indicated result code or
discarded.
-The capabilities record contains pairs of values for the the local
-node and remote peer.
-The packet record contains the CER in question.
+<c>Caps</c> contains pairs of values for the the local node and remote
+peer.
+<c>Pkt</c> contains the CER in question.
In the case of rejection by a capabilities callback, the tuple
-indicates the rejecting callback.</p>
+contains the rejecting callback.</p>
</item>
<tag><c>{'CER', Caps, {ResultCode, Pkt}}</c></tag>
@@ -651,9 +597,8 @@ Pkt = #diameter_packet{}
<p>
An incoming CER contained errors and has been answered with the
indicated result code.
-The capabilities record contains only values for the the local
-node.
-The packet record contains the CER in question.</p>
+<c>Caps</c> contains only values for the the local node.
+<c>Pkt</c> contains the CER in question.</p>
</item>
<tag><c>{'CEA', Result, Caps, Pkt}</c></tag>
@@ -669,11 +614,11 @@ ResultCode = integer()
An incoming CEA has been rejected for the indicated reason.
An integer-valued <c>Result</c> indicates the result code sent
by the peer.
-The capabilities record contains pairs of values for the the local
-node and remote peer.
-The packet record contains the CEA in question.
+<c>Caps</c> contains pairs of values for the the local node and remote
+peer.
+<c>Pkt</c> contains the CEA in question.
In the case of rejection by a capabilities callback, the tuple
-indicates the rejecting callback.</p>
+contains the rejecting callback.</p>
</item>
<tag><c>{'CEA', Caps, Pkt}</c></tag>
@@ -684,14 +629,27 @@ Pkt = #diameter_packet{}
</code>
<p>
-An incoming CER contained errors and has been rejected.
-The capabilities record contains only values for the the local node.
-The packet record contains the CEA in question.</p>
+An incoming CEA contained errors and has been rejected.
+<c>Caps</c> contains only values for the the local node.
+<c>Pkt</c> contains the CEA in question.</p>
</item>
</taglist>
</item>
+<tag><c>{watchdog, Ref, PeerRef, {From, To}, Config}</c></tag>
+<item>
+<code>
+Ref = <seealso marker="#transport_ref">transport_ref()</seealso>
+PeerRef = <seealso marker="diameter_app#peer_ref">diameter_app:peer_ref()</seealso>
+From, To = initial | okay | suspect | down | reopen
+Config = {connect|listen, [transport_opt()]}
+</code>
+
+<p>
+An RFC 3539 watchdog state machine has changed state.</p>
+</item>
+
</taglist>
<p>
@@ -708,8 +666,8 @@ The name of a service as passed to <seealso
marker="#start_service">start_service/2</seealso> and with which the
service is identified.
There can be at most one service with a given name on a given node.
-Note that <c>erlang:make_ref/0</c> can be used to generate a service name
-that is somewhat unique.</p>
+Note that <seealso marker="erts:erlang#make_ref-0">erlang:make_ref/0</seealso>
+can be used to generate a service name that is somewhat unique.</p>
<marker id="service_opt"/>
</item>
@@ -717,29 +675,28 @@ that is somewhat unique.</p>
<tag><c>service_opt()</c></tag>
<item>
<p>
-Options accepted by <seealso
+An option passed to <seealso
marker="#start_service">start_service/2</seealso>.
-Can be any <c>capability()</c> tuple as
+Can be any <c><seealso marker="#capability">capability()</seealso></c> as
well as the following.</p>
<taglist>
-<tag><c>{application, [application_opt()]}</c></tag>
+<tag><c>{application, [<seealso marker="#application_opt">application_opt()</seealso>]}</c></tag>
<item>
<p>
Defines a Diameter application supported by the service.</p>
<p>
-A service must define one application for each Diameter application it
-intends to support.
-For an outgoing Diameter request, the application is specified by
-passing the desired application's <c>application_alias()</c> to
-<seealso marker="#call">call/4</seealso>, while for an
+A service must configure one <c>application</c> for each Diameter
+application it intends to support.
+For an outgoing Diameter request, the relevant <c><seealso
+marker="#application_alias">application_alias()</seealso></c> is
+passed to <seealso marker="#call">call/4</seealso>, while for an
incoming request the application identifier in the message
-header determines the application (and callback module), the
-application identifier being specified in the <seealso
-marker="diameter_dict">dictionary</seealso> file defining the
-application.</p>
+header determines the application, the identifier being specified in
+the application's <seealso marker="diameter_dict">dictionary</seealso>
+file.</p>
</item>
</taglist>
@@ -750,8 +707,9 @@ application.</p>
<tag><c>transport_opt()</c></tag>
<item>
<p>
-Options accepted by <seealso
-marker="#add_transport">add_transport/2</seealso>.</p>
+An option passed to <seealso
+marker="#add_transport">add_transport/2</seealso>.
+Has one of the following types.</p>
<taglist>
<tag><c>{transport_module, atom()}</c></tag>
@@ -762,53 +720,77 @@ marker="diameter_transport">diameter_transport(3)</seealso>.
Defaults to <c>diameter_tcp</c> if unspecified.</p>
<p>
-The interface required of a transport module is documented in <seealso
-marker="diameter_transport">diameter_transport(3)</seealso>.</p>
+Multiple <c>transport_module</c> and <c>transport_config</c>
+options are allowed.
+The order of these is significant in this case (and only in this case),
+a <c>transport_module</c> being paired with the first
+<c>transport_config</c> following it in the options list, or the
+default value for trailing modules.
+Transport starts will be attempted with each of the
+modules in order until one establishes a connection within the
+corresponding timeout (see below) or all fail.</p>
</item>
<tag><c>{transport_config, term()}</c></tag>
+<tag><c>{transport_config, term(), <seealso marker="diameter_dict#DATA_TYPES">Unsigned32()</seealso>}</c></tag>
<item>
<p>
A term passed as the third argument to the <seealso
marker="diameter_transport#start">start/3</seealso> function of
the relevant <c>transport_module</c> in order to start a transport process.
Defaults to the empty list if unspecified.</p>
+
+<p>
+The 3-tuple form additionally specifies an interval, in milliseconds,
+after which a started transport process should be terminated if it has
+not yet established a connection.
+For example, the following options on a connecting transport
+request a connection with one peer over SCTP or another
+(typically the same) over TCP.</p>
+
+<code>
+{transport_module, diameter_sctp}
+{transport_config, SctpOpts, 5000}
+{transport_module, diameter_tcp}
+{transport_config, TcpOpts}
+</code>
+
+<p>
+To listen on both SCTP and TCP, define one transport for each.</p>
</item>
-<tag><c>{applications, [application_alias()]}</c></tag>
+<tag><c>{applications, [<seealso marker="#application_alias">application_alias()</seealso>]}</c></tag>
<item>
<p>
-The list of Diameter applications to which usage of the transport
-should be restricted.
-Defaults to all applications configured on the service
-in question.</p>
+The list of Diameter applications to which the transport should be
+restricted.
+Defaults to all applications configured on the service in question.
+Applications not configured on the service in question are ignored.</p>
</item>
-<tag><c>{capabilities, [capability()]}</c></tag>
+<tag><c>{capabilities, [<seealso marker="#capability">capability()</seealso>]}</c></tag>
<item>
<p>
AVP's used to construct outgoing CER/CEA messages.
-Any AVP specified takes precedence over a corresponding value specified
-for the service in question.</p>
+Values take precedence over any specified on the service in
+question.</p>
<p>
Specifying a capability as a transport option
-may be particularly appropriate for Inband-Security-Id in case
+may be particularly appropriate for Inband-Security-Id, in case
TLS is desired over TCP as implemented by
-<seealso marker="diameter_tcp">diameter_tcp(3)</seealso> but
-not over SCTP as implemented by
-<seealso marker="diameter_sctp">diameter_sctp(3)</seealso>.</p>
+<seealso marker="diameter_tcp">diameter_tcp(3)</seealso>.</p>
</item>
-<tag><c>{capabilities_cb, evaluable()}</c></tag>
+<tag><c>{capabilities_cb, <seealso marker="#evaluable">evaluable()</seealso>}</c></tag>
<item>
<p>
A callback invoked upon reception of CER/CEA during capabilities
exchange in order to ask whether or not the connection should
be accepted.
-Applied to the transport reference (as returned by <seealso
-marker="#add_transport">add_transport/2</seealso>) and
-<c>diameter_caps</c> record of the connection.
+Applied to the relevant <c><seealso
+marker="#transport_ref">transport_ref()</seealso></c> and the
+<c>#diameter_caps{}</c> record of the connection.
Returning <c>ok</c> accepts the connection.
Returning <c>integer()</c> causes an incoming
CER to be answered with the specified Result-Code.
@@ -823,12 +805,14 @@ code causes the transport connection to be broken.</p>
Multiple <c>capabilities_cb</c> options can be specified, in which
case the corresponding callbacks are applied until either all return
<c>ok</c> or one does not.</p>
+
+<marker id="watchdog_timer"/>
</item>
<tag><c>{watchdog_timer, TwInit}</c></tag>
<item>
<code>
-TwInit = Unsigned32()
+TwInit = <seealso marker="diameter_dict#DATA_TYPES">Unsigned32()</seealso>
| {M,F,A}
</code>
@@ -844,17 +828,19 @@ the callback.</p>
<p>
An integer value must be at least 6000 as required by RFC 3539.
Defaults to 30000 if unspecified.</p>
+
+<marker id="reconnect_timer"/>
</item>
<tag><c>{reconnect_timer, Tc}</c></tag>
<item>
<code>
-Tc = Unsigned32()
+Tc = <seealso marker="diameter_dict#DATA_TYPES">Unsigned32()</seealso>
</code>
<p>
For a connecting transport, the RFC 3588 Tc timer, in milliseconds.
-Note that this timer determines the frequency with which the transport
+Note that this timer determines the frequency with which a transport
will attempt to establish a connection with its peer only <em>before</em>
an initial connection is established: once there is an initial
connection it's watchdog_timer that determines the frequency of
@@ -867,12 +853,13 @@ regarded as an initial connection rather than a reestablishment,
causing the RFC 3539 state machine to pass to state OPEN rather than
REOPEN.
Note that these semantics are not goverened by the RFC and
-that a listening transport's reconnect_timer should be greater than its
-peers's Tc plus jitter.</p>
+that a listening transport's <c>reconnect_timer</c> should be greater
+than its peer's Tw plus jitter.</p>
<p>
Defaults to 30000 for a connecting transport and 60000 for a listening
transport.</p>
+
</item>
</taglist>
@@ -884,6 +871,15 @@ marker="#service_info">service_info/2</seealso> and can be referred to
in predicate functions passed to <seealso
marker="#remove_transport">remove_transport/2</seealso>.</p>
+<marker id="transport_ref"/>
+</item>
+
+<tag><c>transport_ref() = reference()</c></tag>
+<item>
+<p>
+An reference returned by <seealso
+marker="#add_transport">add_transport/2</seealso> that
+identifies the configuration.</p>
</item>
</taglist>
@@ -896,13 +892,13 @@ marker="#remove_transport">remove_transport/2</seealso>.</p>
<!-- ===================================================================== -->
<func>
-<name>add_transport(SvcName, {connect|listen, Options})
+<name>add_transport(SvcName, {connect|listen, [Opt]})
-> {ok, Ref} | {error, Reason}</name>
<fsummary>Add transport capability to a service.</fsummary>
<type>
-<v>SvcName = service_name()</v>
-<v>Options = [transport_opt()]</v>
-<v>Ref = ref()</v>
+<v>SvcName = <seealso marker="#service_name">service_name()</seealso></v>
+<v>Opt = <seealso marker="#transport_opt">transport_opt()</seealso></v>
+<v>Ref = <seealso marker="#transport_ref">transport_ref()</seealso></v>
<v>Reason = term()</v>
</type>
<desc>
@@ -910,8 +906,8 @@ marker="#remove_transport">remove_transport/2</seealso>.</p>
Add transport capability to a service.</p>
<p>
-The service will start a transport process(es) in order to establish a
-connection with the peer, either by connecting to the peer
+The service will start transport processes as required in order to
+establish a connection with the peer, either by connecting to the peer
(<c>connect</c>) or by accepting incoming connection requests
(<c>listen</c>).
A connecting transport establishes transport connections with at most
@@ -926,16 +922,20 @@ marker="diameter_app#peer_up">peer_up/3</seealso> callback
after which the caller can exchange Diameter messages with the peer over
the transport.
In addition to CER/CEA, the service takes responsibility for the
-handling of DWR/DWA and required by RFC 3539 as well as for DPR/DPA.</p>
+handling of DWR/DWA and required by RFC 3539, as well as for DPR/DPA.</p>
<p>
The returned reference uniquely identifies the transport within the
scope of the service.
Note that the function returns before a transport connection has been
-established.
+established.</p>
+
+<note>
+<p>
It is not an error to add a transport to a service that has not yet
been configured: a service can be started after configuring
-transports.</p>
+its transports.</p>
+</note>
<marker id="call"/>
</desc>
@@ -944,48 +944,47 @@ transports.</p>
<!-- ===================================================================== -->
<func>
-<name>call(SvcName, App, Request, Options) -> ok | Answer | {error, Reason}</name>
+<name>call(SvcName, App, Request, [Opt]) -> Answer | ok | {error, Reason}</name>
<fsummary>Send a Diameter request message.</fsummary>
<type>
-<v>SvcName = service_name()</v>
-<v>App = application_alias()</v>
-<v>Request = diameter_app:message() | term()</v>
+<v>SvcName = <seealso marker="#service_name">service_name()</seealso></v>
+<v>App = <seealso marker="#application_alias">application_alias()</seealso></v>
+<v>Request = <seealso marker="diameter_app#message">diameter_app:message()</seealso></v>
<v>Answer = term()</v>
-<v>Options = [call_opt()]</v>
+<v>Opt = <seealso marker="#call_opt">call_opt()</seealso></v>
</type>
<desc>
<p>
-Send a Diameter request message and possibly return the answer or error.</p>
+Send a Diameter request message.</p>
<p>
-<c>App</c> identifies the Diameter application in which the request is
+<c>App</c> specifies the Diameter application in which the request is
defined and callbacks to the corresponding callback module
will follow as described below and in <seealso
marker="diameter_app">diameter_app(3)</seealso>.
-Unless the <c>detach</c> option has been specified to cause an earlier
-return, the call returns either when an answer message is received
-from the peer or an error occurs.
-In the case of an answer, the return value is as returned by a
+Unless the <c>detach</c> option is specified, the call returns either
+when an answer message is received from the peer or an error occurs.
+In the answer case, the return value is as returned by a
<seealso
marker="diameter_app#handle_answer">handle_answer/4</seealso>
callback.
-In the case of an error, whether or not the error is returned directly
+In the error case, whether or not the error is returned directly
by diameter or from a <seealso
marker="diameter_app#handle_error">handle_error/4</seealso>
callback depends on whether or not the outgoing request is
-successfully encoded for transmission from the peer, the cases being
+successfully encoded for transmission to the peer, the cases being
documented below.</p>
<p>
If there are no suitable peers, or if
<seealso marker="diameter_app#pick_peer">pick_peer/4</seealso>
-rejects them by returning 'false', then <c>{error, no_connection}</c>
+rejects them by returning <c>false</c>, then <c>{error,no_connection}</c>
is returned.
Otherwise <seealso marker="diameter_app#pick_peer">pick_peer/4</seealso>
is followed by a
<seealso
marker="diameter_app#prepare_request">prepare_request/3</seealso>
-callback, the message is encoded and sent.</p>
+callback, the message is encoded and then sent.</p>
<p>
There are several error cases which may prevent an
@@ -998,7 +997,7 @@ callback:</p>
<item>
<p>
If the initial encode of the outgoing request
-fails, then the request process fails and <c>{error, encode}</c>
+fails, then the request process fails and <c>{error,encode}</c>
is returned.</p>
</item>
@@ -1015,7 +1014,7 @@ callback takes place with <c>Reason = timeout</c>.</p>
If the request is successfully encoded and sent but the service in
question is stopped before an answer is received then a
<seealso marker="diameter_app#handle_error">handle_error/4</seealso>
-callback takes place <c>Reason = cancel</c>.</p>
+callback takes place with <c>Reason = cancel</c>.</p>
</item>
<item>
@@ -1042,7 +1041,7 @@ callback.</p>
<p>
If an encode error takes place during
retransmission then the request process fails and
-<c>{error, failure}</c> is returned.</p>
+<c>{error,failure}</c> is returned.</p>
</item>
<item>
@@ -1050,7 +1049,7 @@ retransmission then the request process fails and
If an application callback made in processing the request fails
(pick_peer, prepare_request, prepare_retransmit,
handle_answer or handle_error) then either
-<c>{error, encode}</c> or <c>{error, failure}</c>
+<c>{error,encode}</c> or <c>{error,failure}</c>
is returned depending on whether or not there has been an
attempt to send the request over the transport.</p>
</item>
@@ -1058,9 +1057,9 @@ attempt to send the request over the transport.</p>
</list>
<p>
-Note that <c>{error, encode}</c> is the only return value which
+Note that <c>{error,encode}</c> is the only return value which
guarantees that the request has <em>not</em> been sent over the
-transport.</p>
+transport connection.</p>
<marker id="origin_state_id"/>
</desc>
@@ -1069,7 +1068,7 @@ transport.</p>
<!-- ===================================================================== -->
<func>
-<name>origin_state_id() -> Unsigned32()</name>
+<name>origin_state_id() -> <seealso marker="diameter_dict#DATA_TYPES">Unsigned32()</seealso></name>
<fsummary>Returns a reasonable Origin-State-Id.</fsummary>
<desc>
<p>
@@ -1078,7 +1077,7 @@ outgoing messages.</p>
<p>
The value returned is the number of seconds since 19680120T031408Z,
-the first value that can be encoded as a Diameter Time(),
+the first value that can be encoded as a Diameter <c><seealso marker="diameter_dict#DATA_TYPES">Time()</seealso></c>,
at the time the diameter application was started.</p>
<marker id="remove_transport"/>
@@ -1091,11 +1090,11 @@ at the time the diameter application was started.</p>
<name>remove_transport(SvcName, Pred) -> ok</name>
<fsummary>Remove previously added transports.</fsummary>
<type>
-<v>SvcName = service_name()</v>
-<v>Pred = Fun | MFA | ref() | list() | true | false</v>
+<v>SvcName = <seealso marker="#service_name">service_name()</seealso></v>
+<v>Pred = Fun | MFA | <seealso marker="#transport_ref">transport_ref()</seealso> | list() | true | false</v>
<v></v>
-<v>Fun = fun((reference(), connect|listen, list()) -> boolean())</v>
-<v>&nbsp;&nbsp;&nbsp; | fun((reference(), list()) -> boolean())</v>
+<v>Fun = fun((<seealso marker="#transport_ref">transport_ref()</seealso>, connect|listen, list()) -> boolean())</v>
+<v>&nbsp;&nbsp;&nbsp; | fun((<seealso marker="#transport_ref">transport_ref()</seealso>, list()) -> boolean())</v>
<v>&nbsp;&nbsp;&nbsp; | fun((list()) -> boolean())</v>
<v>MFA = {atom(), atom(), list()}</v>
</type>
@@ -1109,23 +1108,23 @@ An arity-3-valued <c>Pred</c> removes all transports for which
<c>Pred(Ref, Type, Opts)</c> returns <c>true</c>, where <c>Type</c> and
<c>Opts</c> are as passed to <seealso
marker="#add_transport">add_transport/2</seealso> and <c>Ref</c> is
-as returned by the corresponding call.
+as returned by it.
The remaining forms are equivalent to an arity-3 fun as follows.</p>
<code>
-Pred = fun(reference(), list()): fun(Ref, _, Opts) -> Pred(Ref, Opts) end
-Pred = fun(list()): fun(_, _, Opts) -> Pred(Opts) end
-Pred = reference(): fun(Ref, _, _) -> Pred == Ref end
-Pred = list(): fun(_, _, Opts) -> [] == Pred -- Opts end
-Pred = true: fun(_, _, _) -> true end
-Pred = false: fun(_, _, _) -> false end
+Pred = fun(transport_ref(), list()): fun(Ref, _, Opts) -> Pred(Ref, Opts) end
+Pred = fun(list()): fun(_, _, Opts) -> Pred(Opts) end
+Pred = transport_ref(): fun(Ref, _, _) -> Pred == Ref end
+Pred = list(): fun(_, _, Opts) -> [] == Pred -- Opts end
+Pred = true: fun(_, _, _) -> true end
+Pred = false: fun(_, _, _) -> false end
Pred = {M,F,A}: fun(Ref, Type, Opts) -> apply(M, F, [Ref, Type, Opts | A]) end
</code>
<p>
Removing a transport causes all associated transport connections to
be broken.
-A base application DPR message with
+A DPR message with
Disconnect-Cause <c>DO_NOT_WANT_TO_TALK_TO_YOU</c> will be sent
to each connected peer before disassociating the transport configuration
from the service and terminating the transport upon reception of
@@ -1140,15 +1139,293 @@ DPA or timeout.</p>
<!-- ===================================================================== -->
<func>
-<name>service_info(SvcName, Item) -> Value</name>
-<fsummary>Return specific information about a started service.</fsummary>
+<name>service_info(SvcName, Info) -> term()</name>
+<fsummary>Return information about a started service.</fsummary>
<type>
-<v>SvcName = service_name()</v>
-<v>Value = term()</v>
+<v>SvcName = <seealso marker="#service_name">service_name()</seealso></v>
+<v>Info = Item | [Info]</v>
+<v>Item = atom()</v>
</type>
<desc>
<p>
-Return information about a started service.</p>
+Return information about a started service.
+<c>Item</c> can be one of the following.</p>
+
+<taglist>
+
+<tag><c>'Origin-Host'</c></tag>
+<tag><c>'Origin-Realm'</c></tag>
+<tag><c>'Vendor-Id'</c></tag>
+<tag><c>'Product-Name'</c></tag>
+<tag><c>'Origin-State-Id'</c></tag>
+<tag><c>'Host-IP-Address'</c></tag>
+<tag><c>'Supported-Vendor'</c></tag>
+<tag><c>'Auth-Application-Id'</c></tag>
+<tag><c>'Inband-Security-Id'</c></tag>
+<tag><c>'Acct-Application-Id'</c></tag>
+<tag><c>'Vendor-Specific-Application-Id'</c></tag>
+<tag><c>'Firmware-Revision'</c></tag>
+<item>
+<p>
+Return a capability value as configured with <seealso
+marker="#start_service">start_service/2</seealso>.</p>
+</item>
+
+<tag><c>applications</c></tag>
+<item>
+<p>
+Return the list of applications as configured with <seealso
+marker="#start_service">start_service/2</seealso>.
+</p>
+</item>
+
+<tag><c>capabilities</c></tag>
+<item>
+<p>
+Return a tagged list of all capabilities values as configured with
+<seealso
+marker="#start_service">start_service/2</seealso>.</p>
+</item>
+
+<tag><c>transport</c></tag>
+<item>
+<p>
+Return a list containing one entry for each of the service's transport
+as configured with <seealso
+marker="#add_transport">add_transport/2</seealso>.
+Each entry is a tagged list containing both configuration and
+information about established peer connections.
+An example return value with for a client service with Origin-Host
+"client.example.com" configured with a single transport connected to
+"server.example.com" might look as follows.</p>
+
+<code>
+[[{ref,#Ref&lt;0.0.0.93>},
+ {type,connect},
+ {options,[{transport_module,diameter_tcp},
+ {transport_config,[{ip,{127,0,0,1}},
+ {raddr,{127,0,0,1}},
+ {rport,3868},
+ {reuseaddr,true}]}]},
+ {watchdog,{&lt;0.66.0>,{1346,171491,996448},okay}},
+ {peer,{&lt;0.67.0>,{1346,171491,999906}}},
+ {apps,[{0,common}]},
+ {caps,[{origin_host,{"client.example.com","server.example.com"}},
+ {origin_realm,{"example.com","example.com"}},
+ {host_ip_address,{[{127,0,0,1}],[{127,0,0,1}]}},
+ {vendor_id,{0,193}},
+ {product_name,{"Client","Server"}},
+ {origin_state_id,{[],[]}},
+ {supported_vendor_id,{[],[]}},
+ {auth_application_id,{[0],[0]}},
+ {inband_security_id,{[],[0]}},
+ {acct_application_id,{[],[]}},
+ {vendor_specific_application_id,{[],[]}},
+ {firmware_revision,{[],[]}},
+ {avp,{[],[]}}]},
+ {port,[{owner,&lt;0.69.0>},
+ {module,diameter_tcp},
+ {socket,{{127,0,0,1},48758}},
+ {peer,{{127,0,0,1},3868}},
+ {statistics,[{recv_oct,656},
+ {recv_cnt,6},
+ {recv_max,148},
+ {recv_avg,109},
+ {recv_dvi,19},
+ {send_oct,836},
+ {send_cnt,6},
+ {send_max,184},
+ {send_avg,139},
+ {send_pend,0}]}]},
+ {statistics,[{{{0,258,0},recv},3},
+ {{{0,258,1},send},3},
+ {{{0,257,0},recv},1},
+ {{{0,257,1},send},1},
+ {{{0,258,0},recv,{'Result-Code',2001}},3},
+ {{{0,280,1},recv},2},
+ {{{0,280,0},send},2}]}]]
+</code>
+
+<p>
+Here <c>ref</c> is a <c><seealso
+marker="#transport_ref">transport_ref()</seealso></c> and <c>options</c>
+the corresponding <c><seealso
+marker="#transport_opt">transport_opt()</seealso></c> list passed to <seealso
+marker="#add_transport">add_transport/2</seealso>.
+The <c>watchdog</c> entry shows the state of a connection's RFC 3539 watchdog
+state machine.
+The <c>peer</c> entry identifies the <c><seealso
+marker="diameter_app#peer_ref">diameter_app:peer_ref()</seealso></c> for
+which there will have been <seealso
+marker="diameter_app#peer_up">peer_up</seealso> callbacks for the
+Diameter applications identified by the <c>apps</c> entry,
+<c>common</c> being the <c><seealso
+marker="#application_alias">application_alias()</seealso></c>.
+The <c>caps</c> entry identifies the capabilities sent by the local
+node and received from the peer during capabilities exchange.
+The <c>port</c> entry displays socket-level information about the
+transport connection.
+The <c>statistics</c> entry presents Diameter-level counters,
+an entry like <c>{{{0,280,1},recv},2}</c> saying that the client has
+received 2 DWR messages: <c>{0,280,1} = {Application_Id, Command_Code,
+R_Flag}</c>.</p>
+
+<p>
+Note that <c>watchdog</c>, <c>peer</c>, <c>apps</c>, <c>caps</c>
+and <c>port</c> entries depend on connectivity
+with the peer and may not be present.
+Note also that the <c>statistics</c> entry presents values acuumulated
+during the lifetime of the transport configuration.</p>
+
+<p>
+A listening transport presents its information slightly differently
+since there may be multiple accepted connections for the same <c><seealso
+marker="#transport_ref">transport_ref()</seealso></c>.
+The <c>transport</c> info returned by a server with a single client
+connection might look as follows.</p>
+
+<code>
+[[{ref,#Ref&lt;0.0.0.61>},
+ {type,listen},
+ {options,[{transport_module,diameter_tcp},
+ {transport_config,[{reuseaddr,true},
+ {ip,{127,0,0,1}},
+ {port,3868}]}]},
+ {accept,[[{watchdog,{&lt;0.56.0>,{1346,171481,226895},okay}},
+ {peer,{&lt;0.58.0>,{1346,171491,999511}}},
+ {apps,[{0,common}]},
+ {caps,[{origin_host,{"server.example.com","client.example.com"}},
+ {origin_realm,{"example.com","example.com"}},
+ {host_ip_address,{[{127,0,0,1}],[{127,0,0,1}]}},
+ {vendor_id,{193,0}},
+ {product_name,{"Server","Client"}},
+ {origin_state_id,{[],[]}},
+ {supported_vendor_id,{[],[]}},
+ {auth_application_id,{[0],[0]}},
+ {inband_security_id,{[],[]}},
+ {acct_application_id,{[],[]}},
+ {vendor_specific_application_id,{[],[]}},
+ {firmware_revision,{[],[]}},
+ {avp,{[],[]}}]},
+ {port,[{owner,&lt;0.62.0>},
+ {module,diameter_tcp},
+ {socket,{{127,0,0,1},3868}},
+ {peer,{{127,0,0,1},48758}},
+ {statistics,[{recv_oct,1576},
+ {recv_cnt,16},
+ {recv_max,184},
+ {recv_avg,98},
+ {recv_dvi,26},
+ {send_oct,1396},
+ {send_cnt,16},
+ {send_max,148},
+ {send_avg,87},
+ {send_pend,0}]}]}],
+ [{watchdog,{&lt;0.72.0>,{1346,171491,998404},initial}}]]},
+ {statistics,[{{{0,280,0},recv},7},
+ {{{0,280,1},send},7},
+ {{{0,258,0},send,{'Result-Code',2001}},3},
+ {{{0,258,1},recv},3},
+ {{{0,258,0},send},3},
+ {{{0,280,1},recv},5},
+ {{{0,280,0},send},5},
+ {{{0,257,1},recv},1},
+ {{{0,257,0},send},1}]}]]
+</code>
+
+<p>
+The information presented here is as in the <c>connect</c> case except
+that the client connections are grouped under an <c>accept</c> tuple.</p>
+
+</item>
+
+<tag><c>connections</c></tag>
+<item>
+<p>
+Return a list containing one entry for every established transport
+connection whose watchdog state machine is not in the <c>down</c>
+state.
+This is a flat view of <c>transport</c> info which lists only active
+connections and for which Diameter-level statistics are accumulated
+only for the lifetime of the transport connection.
+A return value for the server above might look as follows.</p>
+
+<code>
+[[{ref,#Ref&lt;0.0.0.61>},
+ {type,accept},
+ {options,[{transport_module,diameter_tcp},
+ {transport_config,[{reuseaddr,true},
+ {ip,{127,0,0,1}},
+ {port,3868}]}]},
+ {watchdog,{&lt;0.56.0>,{1346,171481,226895},okay}},
+ {peer,{&lt;0.58.0>,{1346,171491,999511}}},
+ {apps,[{0,common}]},
+ {caps,[{origin_host,{"server.example.com","client.example.com"}},
+ {origin_realm,{"example.com","example.com"}},
+ {host_ip_address,{[{127,0,0,1}],[{127,0,0,1}]}},
+ {vendor_id,{193,0}},
+ {product_name,{"Server","Client"}},
+ {origin_state_id,{[],[]}},
+ {supported_vendor_id,{[],[]}},
+ {auth_application_id,{[0],[0]}},
+ {inband_security_id,{[],[]}},
+ {acct_application_id,{[],[]}},
+ {vendor_specific_application_id,{[],[]}},
+ {firmware_revision,{[],[]}},
+ {avp,{[],[]}}]},
+ {port,[{owner,&lt;0.62.0>},
+ {module,diameter_tcp},
+ {socket,{{127,0,0,1},3868}},
+ {peer,{{127,0,0,1},48758}},
+ {statistics,[{recv_oct,10124},
+ {recv_cnt,132},
+ {recv_max,184},
+ {recv_avg,76},
+ {recv_dvi,9},
+ {send_oct,10016},
+ {send_cnt,132},
+ {send_max,148},
+ {send_avg,75},
+ {send_pend,0}]}]},
+ {statistics,[{{{0,280,0},recv},62},
+ {{{0,280,1},send},62},
+ {{{0,258,0},send,{'Result-Code',2001}},3},
+ {{{0,258,1},recv},3},
+ {{{0,258,0},send},3},
+ {{{0,280,1},recv},66},
+ {{{0,280,0},send},66},
+ {{{0,257,1},recv},1},
+ {{{0,257,0},send},1}]}]]
+</code>
+
+<p>
+Note that there may be multiple entries with the same <c>ref</c>, in
+contrast to <c>transport</c> info.</p>
+</item>
+
+<tag><c>statistics</c></tag>
+<item>
+<p>
+Return a <c>{{Counter, Ref}, non_neg_integer()}</c> list of counter values.
+<c>Ref</c> can be either a <c><seealso
+marker="#transport_ref">transport_ref()</seealso></c>
+or a <c><seealso
+marker="diameter_app#peer_ref">diameter_app:peer_ref()</seealso></c>.
+Entries for the latter are folded into corresponding entries for the
+former as peer connections go down.
+Entries for both are removed at <seealso
+marker="#remove_transport">remove_transport/2</seealso>.
+The Diameter-level statistics returned by <c>transport</c> and
+<c>connections</c> info are based upon these entries.</p>
+</item>
+
+</taglist>
+
+<p>
+Requesting info for an unknown service causes <c>undefined</c> to be
+returned.
+Requesting a list of items causes a tagged list to be
+returned.</p>
<marker id="services"/>
</desc>
@@ -1160,7 +1437,7 @@ Return information about a started service.</p>
<name>services() -> [SvcName]</name>
<fsummary>Return the list of started services.</fsummary>
<type>
-<v>SvcName = service_name()</v>
+<v>SvcName = <seealso marker="#service_name">service_name()</seealso></v>
</type>
<desc>
<p>
@@ -1173,10 +1450,10 @@ Return the list of started services.</p>
<!-- ===================================================================== -->
<func>
-<name>session_id(Ident) -> OctetString()</name>
+<name>session_id(Ident) -> <seealso marker="diameter_dict#DATA_TYPES">OctetString()</seealso></name>
<fsummary>Return a value for a Session-Id AVP.</fsummary>
<type>
-<v>Ident = DiameterIdentity()</v>
+<v>Ident = <seealso marker="diameter_dict#DATA_TYPES">DiameterIdentity()</seealso></v>
</type>
<desc>
<p>
@@ -1201,7 +1478,7 @@ Start the diameter application.</p>
<p>
The diameter application must be started before starting a service.
-In a production system this will typically be accomplished by a boot
+In a production system this is typically accomplished by a boot
file, not by calling <c>start/0</c> explicitly.</p>
<marker id="start_service"/>
@@ -1213,8 +1490,8 @@ file, not by calling <c>start/0</c> explicitly.</p>
<name>start_service(SvcName, Options) -> ok | {error, Reason}</name>
<fsummary>Start a Diameter service.</fsummary>
<type>
-<v>SvcName = service_name()</v>
-<v>Options = [service_opt()]</v>
+<v>SvcName = <seealso marker="#service_name">service_name()</seealso></v>
+<v>Options = [<seealso marker="#service_opt">service_opt()</seealso>]</v>
<v>Reason = term()</v>
</type>
<desc>
@@ -1222,11 +1499,19 @@ file, not by calling <c>start/0</c> explicitly.</p>
Start a diameter service.</p>
<p>
-A service defines a locally-implemented Diameter peer, specifying the
-capabilities of the peer to be used during capabilities exchange and
-the Diameter applications that it supports.
+A service defines a locally-implemented Diameter node, specifying the
+capabilities to be advertised during capabilities exchange.
Transports are added to a service using <seealso
-marker="#add_transport">add_transport/2</seealso>.</p>
+marker="#add_transport">add_transport/2</seealso>.
+</p>
+
+<note>
+<p>
+A transport can both override its service's
+capabilities and restrict its supported Diameter applications so
+"service = Diameter node as identified by Origin-Host" is not
+necessarily the case.</p>
+</note>
<marker id="stop_service"/>
</desc>
@@ -1252,13 +1537,26 @@ Stop the diameter application.</p>
<name>stop_service(SvcName) -> ok | {error, Reason}</name>
<fsummary>Stop a Diameter service.</fsummary>
<type>
-<v>SvcName = service_name()</v>
+<v>SvcName = <seealso marker="#service_name">service_name()</seealso></v>
<v>Reason = term()</v>
</type>
<desc>
<p>
Stop a diameter service.</p>
+<p>
+Stopping a service causes all associated transport connections to be
+broken.
+A DPR message with be sent as in the case of <seealso
+marker="#remove_transport">remove_transport/2</seealso>.</p>
+
+<note>
+<p>
+Stopping a transport does not remove any associated transports:
+<seealso marker="#remove_transport">remove_transport/2</seealso> must
+be called to remove transport configuration.</p>
+</note>
+
<marker id="subscribe"/>
</desc>
</func>
@@ -1269,15 +1567,19 @@ Stop a diameter service.</p>
<name>subscribe(SvcName) -> true</name>
<fsummary>Subscribe to event messages.</fsummary>
<type>
-<v>SvcName = service_name()</v>
+<v>SvcName = <seealso marker="#service_name">service_name()</seealso></v>
</type>
<desc>
<p>
-Subscribe to <c>service_event()</c> messages from a service.</p>
+Subscribe to <c><seealso
+marker="#service_event">service_event()</seealso></c> messages from
+a service.</p>
<p>
It is not an error to subscribe to events from a service
-that does not yet exist.</p>
+that does not yet exist.
+Doing so before adding transports is required to guarantee the
+reception of all related events.</p>
<marker id="unsubscribe"/>
</desc>
@@ -1289,7 +1591,7 @@ that does not yet exist.</p>
<name>unsubscribe(SvcName) -> true</name>
<fsummary>Unsubscribe to event messages.</fsummary>
<type>
-<v>SvcName = service_name()</v>
+<v>SvcName = <seealso marker="#service_name">service_name()</seealso></v>
</type>
<desc>
<p>
diff --git a/lib/diameter/doc/src/diameter_app.xml b/lib/diameter/doc/src/diameter_app.xml
index a9ae0ebbec..4a4b212787 100644
--- a/lib/diameter/doc/src/diameter_app.xml
+++ b/lib/diameter/doc/src/diameter_app.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
-<year>2011</year>
+<year>2011</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -45,8 +45,8 @@ A diameter service as started by <seealso
marker="diameter#start_service">diameter:start_service/2</seealso>
configures one of more Diameter applications, each of whose
configuration specifies a callback that handles messages specific to
-its application.
-The messages and AVPs of the Diameter application are defined in a
+the application.
+The messages and AVPs of the application are defined in a
dictionary file whose format is documented in
<seealso marker="diameter_dict">diameter_dict(4)</seealso>
while the callback module is documented here.
@@ -106,11 +106,13 @@ and, for the call-specific callbacks, any extra arguments passed to
<taglist>
+<marker id="capabilities"/>
+
<tag><c>capabilities() = #diameter_caps{}</c></tag>
<item>
<p>
A record containing the identities of
-the local and remote Diameter peers having an established transport
+the local Diameter node and the remote Diameter peer having an established transport
connection, as well as the capabilities as
determined by capabilities exchange.
Each field of the record is a 2-tuple consisting of
@@ -119,6 +121,8 @@ Optional or possibly multiple values are encoded as lists of values,
mandatory values as the bare value.</p>
</item>
+<marker id="message"/>
+
<tag><c>message() = record() | list()</c></tag>
<item>
<p>
@@ -136,8 +140,8 @@ list of <c>{FieldName, FieldValue}</c> pairs.</p>
<p>
A third representation allows a message to be specified as a list
-whose head is a <c>diameter_header</c> record and whose tail is a list
-of <c>diameter_avp</c> records.
+whose head is a <c>#diameter_header{}</c> record and whose tail is a list
+of <c>#diameter_avp{}</c> records.
This representation is used by diameter itself when relaying requests
as directed by the return value of a
<seealso marker="#handle_request">handle_request/3</seealso>
@@ -149,15 +153,18 @@ are sent exactly as specified.</p>
</item>
+<marker id="packet"/>
+
<tag><c>packet() = #diameter_packet{}</c></tag>
<item>
<p>
-A container for incoming and outgoing Diameters message that's passed
+A container for incoming and outgoing Diameter messages that's passed
through encode/decode and transport.
-Fields of a packet() record should not be set in return values except
-as documented.</p>
+Fields should not be set in return values except as documented.</p>
</item>
+<marker id="peer_ref"/>
+
<tag><c>peer_ref() = term()</c></tag>
<item>
<p>
@@ -165,20 +172,15 @@ A term identifying a transport connection with a Diameter peer.
Should be treated opaquely.</p>
</item>
-<tag><c>peer() = {peer_ref(), capabilities()}</c></tag>
+<marker id="peer"/>
+
+<tag><c>peer() = {<seealso marker="#peer_ref">peer_ref()</seealso>, <seealso marker="#capabilities">capabilities()</seealso>}</c></tag>
<item>
<p>
A tuple representing a Diameter peer connection.</p>
</item>
-<tag><c>service_name() = term()</c></tag>
-<item>
-<p>
-The service supporting the Diameter application.
-Specified to <seealso
-marker="diameter#start_service">diameter:start_service/2</seealso>
-when starting the service.</p>
-</item>
+<marker id="state"/>
<tag><c>state() = term()</c></tag>
<item>
@@ -211,9 +213,9 @@ process.</p>
<name>Mod:peer_up(SvcName, Peer, State) -> NewState</name>
<fsummary>Invoked when a transport connection has been established</fsummary>
<type>
-<v>SvcName = service_name()</v>
-<v>Peer = peer()</v>
-<v>State = NewState = state()</v>
+<v>SvcName = <seealso marker="diameter#service_name">diameter:service_name()</seealso></v>
+<v>Peer = <seealso marker="#peer">peer()</seealso></v>
+<v>State = NewState = <seealso marker="#state">state()</seealso></v>
</type>
<desc>
<p>
@@ -230,9 +232,9 @@ the callback module in question has been configured.</p>
<name>Mod:peer_down(SvcName, Peer, State) -> NewState</name>
<fsummary>Invoked when a transport connection has been lost.</fsummary>
<type>
-<v>SvcName = service_name()</v>
-<v>Peer = peer()</v>
-<v>State = NewState = state()</v>
+<v>SvcName = <seealso marker="diameter#service_name">diameter:service_name()</seealso></v>
+<v>Peer = <seealso marker="#peer">peer()</seealso></v>
+<v>State = NewState = <seealso marker="#state">state()</seealso></v>
</type>
<desc>
<p>
@@ -248,21 +250,17 @@ call to <seealso marker="#peer_up">peer_up/3</seealso>.</p>
-> {ok, Peer} | {Peer, NewState} | false</name>
<fsummary>Select a target peer for an outgoing request.</fsummary>
<type>
-<v>Candidates = [peer()]</v>
-<v>Peer = peer() | false</v>
-<v>SvcName = service_name()</v>
-<v>State = NewState = state()</v>
+<v>Candidates = [<seealso marker="#peer">peer()</seealso>]</v>
+<v>Peer = <seealso marker="#peer">peer()</seealso> | false</v>
+<v>SvcName = <seealso marker="diameter#service_name">diameter:service_name()</seealso></v>
+<v>State = NewState = <seealso marker="#state">state()</seealso></v>
</type>
<desc>
<p>
Invoked as a consequence of a call to <seealso
marker="diameter#call">diameter:call/4</seealso> to select a destination
-peer for an outgoing request, the return value indicating the selected peer.
-A new application state can also be returned but only if the Diameter
-application in question was
-configured with the option <c>call_mutates_state</c> set to
-<c>true</c>, as documented for <seealso
-marker="diameter#start_service">diameter:start_service/2</seealso>.</p>
+peer for an outgoing request, the return value indicating the selected
+peer.</p>
<p>
The candidate peers list will only include those
@@ -282,7 +280,8 @@ equivalent when callback state is mutable, as are
<c>{ok, Peer}</c> and <c>{Peer, State}</c>.
Returning a peer as <c>false</c> causes <c>{error, no_connection}</c>
to be returned from <seealso marker="diameter#call">diameter:call/4</seealso>.
-Returning a peer() from an initial pick_peer/4 callback will result in a
+Returning a <seealso marker="#peer">peer()</seealso> from an initial
+pick_peer/4 callback will result in a
<seealso marker="#prepare_request">prepare_request/3</seealso> callback
followed by either <seealso
marker="#handle_answer">handle_answer/4</seealso>
@@ -301,6 +300,19 @@ marker="#pick_peer">pick_peer/4</seealso> will be, since a
retransmission to an alternate peer is abandoned if an answer is
received from a previously selected peer.</p>
+<note>
+<p>
+<c>{Peer, NewState}</c> and its equivalents can only be returned if
+the Diameter application in question was
+configured with the <seealso
+marker="diameter#application_opt">diameter:application_opt()</seealso>
+<c>{call_mutates_state, true}</c>.
+Otherwise, the <c>State</c> argument is always
+the intial value as configured on the application, not any subsequent
+value returned by a <seealso marker="#peer_up">peer_up/3</seealso>
+or <seealso marker="#peer_down">peer_down/3</seealso> callback.</p>
+</note>
+
<marker id="prepare_request"/>
</desc>
@@ -310,10 +322,10 @@ received from a previously selected peer.</p>
<name>Mod:prepare_request(Packet, SvcName, Peer) -> Action</name>
<fsummary>Return a request for encoding and transport.</fsummary>
<type>
-<v>Packet = packet()</v>
-<v>SvcName = service_name()</v>
-<v>Peer = peer()</v>
-<v>Action = {send, packet() | message()} | {discard, Reason} | discard</v>
+<v>Packet = <seealso marker="#packet">packet()</seealso></v>
+<v>SvcName = <seealso marker="diameter#service_name">diameter:service_name()</seealso></v>
+<v>Peer = <seealso marker="#peer">peer()</seealso></v>
+<v>Action = {send, <seealso marker="#packet">packet()</seealso> | <seealso marker="#message">message()</seealso>} | {discard, Reason} | discard</v>
</type>
<desc>
<p>
@@ -325,14 +337,14 @@ callback need not be limited to this usage.
Many implementations may simply want to return <c>{send, Packet}</c></p>
<p>
-A returned packet() should set the request to be encoded in its
+A returned <seealso marker="#packet">packet()</seealso> should set the request to be encoded in its
<c>msg</c> field and can set the <c>transport_data</c> field in order
to pass information to the transport module.
Extra arguments passed to <seealso
marker="diameter#call">diameter:call/4</seealso> can be used to
communicate transport data to the callback.
-A returned packet() can also set the <c>header</c> field to a
-<c>diameter_header</c> record in order to specify values that should
+A returned <seealso marker="#packet">packet()</seealso> can also set the <c>header</c> field to a
+<c>#diameter_header{}</c> record in order to specify values that should
be preserved in the outgoing request, although this should typically
not be necessary and allows the callback to set header values
inappropriately.
@@ -355,10 +367,10 @@ discarded}</c>.</p>
<name>Mod:prepare_retransmit(Packet, SvcName, Peer) -> Result</name>
<fsummary>Return a request for encoding and retransmission.</fsummary>
<type>
-<v>Packet = packet()</v>
-<v>SvcName = service_name()</v>
-<v>Peer = peer()</v>
-<v>Result = {send, packet() | message()} | {discard, Reason} | discard</v>
+<v>Packet = <seealso marker="#packet">packet()</seealso></v>
+<v>SvcName = <seealso marker="diameter#service_name">diameter:service_name()</seealso></v>
+<v>Peer = <seealso marker="#peer">peer()</seealso></v>
+<v>Result = {send, <seealso marker="#packet">packet()</seealso> | <seealso marker="#message">message()</seealso>} | {discard, Reason} | discard</v>
</type>
<desc>
<p>
@@ -366,7 +378,7 @@ Invoked to return a request for encoding and retransmission.
Has the same role as <seealso
marker="#prepare_request">prepare_request/3</seealso> in the case that
a peer connection is lost an an alternate peer selected but the
-argument packet() is as returned by the initial
+argument <seealso marker="#packet">packet()</seealso> is as returned by the initial
<c>prepare_request/3</c>.</p>
<p>
@@ -385,10 +397,10 @@ discarded}</c>.</p>
<name>Mod:handle_answer(Packet, Request, SvcName, Peer) -> Result</name>
<fsummary>Receive an answer message from a peer.</fsummary>
<type>
-<v>Packet = packet()</v>
-<v>Request = message()</v>
-<v>SvcName = service_name()</v>
-<v>Peer = peer()</v>
+<v>Packet = <seealso marker="#packet">packet()</seealso></v>
+<v>Request = <seealso marker="#message">message()</seealso></v>
+<v>SvcName = <seealso marker="diameter#service_name">diameter:service_name()</seealso></v>
+<v>Peer = <seealso marker="#peer">peer()</seealso></v>
<v>Result = term()</v>
</type>
<desc>
@@ -401,7 +413,7 @@ specified.</p>
<p>
The decoded answer record is in the <c>msg</c> field of the argument
-packet(),
+<seealso marker="#packet">packet()</seealso>,
the undecoded binary in the <c>packet</c> field.
<c>Request</c> is the outgoing request message as was returned from
<seealso marker="#prepare_request">prepare_request/3</seealso> or
@@ -438,9 +450,9 @@ marker="diameter#start_service">diameter:start_service/2</seealso>.</p>
<fsummary>Return an error from a outgoing request.</fsummary>
<type>
<v>Reason = timeout | failover | term()</v>
-<v>Request = message()</v>
-<v>SvcName = service_name()</v>
-<v>Peer = peer()</v>
+<v>Request = <seealso marker="#message">message()</seealso></v>
+<v>SvcName = <seealso marker="diameter#service_name">diameter:service_name()</seealso></v>
+<v>Peer = <seealso marker="#peer">peer()</seealso></v>
<v>Result = term()</v>
</type>
<desc>
@@ -469,14 +481,14 @@ callback returned false.</p>
<name>Mod:handle_request(Packet, SvcName, Peer) -> Action</name>
<fsummary>Receive an incoming request.</fsummary>
<type>
-<v>Packet = packet()</v>
+<v>Packet = <seealso marker="#packet">packet()</seealso></v>
<v>SvcName = term()</v>
-<v>Peer = peer()</v>
-<v>Action = Reply | {relay, Opts} | discard | {eval, Action, PostF}</v>
-<v>Reply = {reply, message()}
+<v>Peer = <seealso marker="#peer">peer()</seealso></v>
+<v>Action = Reply | {relay, [Opt]} | discard | {eval, Action, PostF}</v>
+<v>Reply = {reply, <seealso marker="#message">message()</seealso>}
| {protocol_error, 3000..3999}</v>
-<v>Opts = diameter:call_opts()</v>
-<v>PostF = diameter:evaluable()</v>
+<v>Opt = <seealso marker="diameter#call_opt">diameter:call_opt()</seealso></v>
+<v>PostF = <seealso marker="diameter#evaluable">diameter:evaluable()</seealso></v>
</type>
<desc>
<p>
@@ -492,13 +504,13 @@ itself as defining either the application in question or the Relay
application.</p>
<p>
-The argument packet() has the following signature.</p>
+The argument <seealso marker="#packet">packet()</seealso> has the following signature.</p>
<code>
#diameter_packet{header = #diameter_header{},
avps = [#diameter_avp{}],
msg = record() | undefined,
- errors = ['Unsigned32'() | {'Unsigned32'(), #diameter_avp{}}],
+ errors = [<seealso marker="diameter_dict#DATA_TYPES">Unsigned32()</seealso> | {<seealso marker="diameter_dict#DATA_TYPES">Unsigned32()</seealso>, #diameter_avp{}}],
bin = binary(),
transport_data = term()}
</code>
@@ -515,8 +527,8 @@ The <c>errors</c> field specifies any Result-Code's identifying errors
that were encountered in decoding the request.
In this case diameter will set both Result-Code and
Failed-AVP AVP's in a returned
-answer message() before sending it to the peer:
-the returned message() need only set any other required AVP's.
+answer <seealso marker="#message">message()</seealso> before sending it to the peer:
+the returned <seealso marker="#message">message()</seealso> need only set any other required AVP's.
Note that the errors detected by diameter are all of the 5xxx series
(Permanent Failures).
The <c>errors</c> list is empty if the request has been received in
@@ -526,7 +538,7 @@ the relay application.</p>
The <c>transport_data</c> field contains an arbitrary term passed into
diameter from the transport module in question, or the atom
<c>undefined</c> if the transport specified no data.
-The term is preserved in the packet() containing any answer message
+The term is preserved in the <seealso marker="#packet">packet()</seealso> containing any answer message
sent back to the transport process unless another value is explicitly
specified.</p>
@@ -535,7 +547,7 @@ The semantics of each of the possible return values are as follows.</p>
<taglist>
-<tag><c>{reply, message()}</c></tag>
+<tag><c>{reply, <seealso marker="#message">message()</seealso>}</c></tag>
<item>
<p>
Send the specified answer message to the peer.</p>
@@ -579,7 +591,7 @@ header of the relayed request.</p>
The returned <c>Opts</c> should not specify <c>detach</c>.
A subsequent <seealso marker="#handle_answer">handle_answer/4</seealso>
callback for the relayed request must return its first
-argument, the <c>diameter_packet</c> record containing the answer
+argument, the <c>#diameter_packet{}</c> record containing the answer
message.
Note that the <c>extra</c> option can be specified to supply arguments
that can distinguish the relay case from others if so desired.
diff --git a/lib/diameter/doc/src/diameter_compile.xml b/lib/diameter/doc/src/diameter_compile.xml
index 60e08d41da..7a6ca48798 100644
--- a/lib/diameter/doc/src/diameter_compile.xml
+++ b/lib/diameter/doc/src/diameter_compile.xml
@@ -4,7 +4,7 @@
<comref>
<header>
<copyright>
-<year>2011</year>
+<year>2011</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -31,7 +31,7 @@ supplied.
<description>
<p>
-The diameterc utility is used to transform diameter
+The diameterc utility is used to compile diameter
<seealso marker="diameter_dict">dictionary files</seealso>
into Erlang source.
The resulting source implements the interface diameter requires
@@ -47,7 +47,7 @@ to encode and decode the dictionary's messages and AVP's.</p>
<tag><![CDATA[diameterc [<options>] <file>]]></tag>
<item>
<p>
-Transforms a single dictionary file. Valid options are as follows.</p>
+Compiles a single dictionary file. Valid options are as follows.</p>
<!-- Leave -h/d/v undocumented, except for the usage message from the
utility itself. -->
@@ -64,47 +64,36 @@ Defaults to the current working directory.</p>
<item>
<p>
Specifies a directory to add to the code path.
-Use to point at beam files corresponding to dictionaries
-inherited by the one being compiled using <c>@inherits</c> or
-<c>--inherits</c>.
-Inheritance is a beam dependency, not an erl/hrl dependency.</p>
+Use to point at beam files compiled from inherited dictionaries,
+<c>@inherits</c> in a dictionary file creating a beam dependency, not
+an erl/hrl dependency.</p>
<p>
Multiple <c>-i</c> options can be specified.</p>
</item>
<tag><![CDATA[-E]]></tag>
-<item>
-<p>
-Supresses erl generation.</p>
-</item>
-
<tag><![CDATA[-H]]></tag>
<item>
<p>
-Supresses hrl generation.</p>
+Supresses erl and hrl generation, respectively.</p>
</item>
<tag><![CDATA[--name <name>]]></tag>
-<item>
-<p>
-Set <c>@name</c> in the dictionary file.
-Overrides any setting in the file itself.</p>
-</item>
-
<tag><![CDATA[--prefix <prefix>]]></tag>
<item>
<p>
-Set <c>@prefix</c> in the dictionary file.
+Set <c>@name</c> and <c>@prefix</c> in the dictionary,
+respectively.
Overrides any setting in the file itself.</p>
</item>
<tag><![CDATA[--inherits <dict>]]></tag>
<item>
<p>
-Append an <c>@inherits</c> to the dictionary file.
-Specifying <c>'-'</c> as the dictionary has the effect of clearing
-any previous inherits, effectively ignoring previous inherits.</p>
+Append an <c>@inherits</c> to the dictionary before compiling.
+Specifying <c>'-'</c> as the dictionary has the effect of clearing any
+previous inherits, causing them to be ignored.</p>
<p>
Multiple <c>--inherits</c> options can be specified.</p>
@@ -130,16 +119,6 @@ Returns 0 on success, non-zero on failure.</p>
<!-- ===================================================================== -->
<section>
-<title>BUGS</title>
-
-<p>
-The identification of errors in the source file is poor.</p>
-
-</section>
-
-<!-- ===================================================================== -->
-
-<section>
<title>SEE ALSO</title>
<p>
diff --git a/lib/diameter/doc/src/diameter_dict.xml b/lib/diameter/doc/src/diameter_dict.xml
index cc638dbc18..98adebf145 100644
--- a/lib/diameter/doc/src/diameter_dict.xml
+++ b/lib/diameter/doc/src/diameter_dict.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
-<year>2011</year>
+<year>2011</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -275,10 +275,12 @@ Location-Information 350 Grouped MV
Requested-Information 353 Enumerated V
</code>
+<warning>
<p>
-Note that the P flag has been deprecated by the Diameter Maintenance
-and Extensions Working Group of the IETF: diameter will set the P flag
-to 0 as mandated by the current draft standard.</p>
+The P flag has been deprecated by the Diameter Maintenance
+and Extensions Working Group of the IETF and should be omitted
+to conform to the current draft standard.</p>
+</warning>
</item>
diff --git a/lib/diameter/doc/src/diameter_examples.xml b/lib/diameter/doc/src/diameter_examples.xml
index 966d1f1eee..1fd7755695 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>2011</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
@@ -37,7 +37,6 @@ under the License.
<!-- ===================================================================== -->
<p>
-To be written.
Example code can be found in the diameter application's
<c>examples</c> subdirectory.</p>
diff --git a/lib/diameter/doc/src/diameter_intro.xml b/lib/diameter/doc/src/diameter_intro.xml
index ef08002a8b..bc2afbd453 100644
--- a/lib/diameter/doc/src/diameter_intro.xml
+++ b/lib/diameter/doc/src/diameter_intro.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
-<year>2011</year>
+<year>2011</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
@@ -44,11 +44,11 @@ agent.
This chapter provides a short overview of the application.</p>
<p>
-A Diameter peer is implemented by configuring a <em>service</em> and
+A Diameter node is implemented by configuring a <em>service</em> and
one or more <em>transports</em> using the interface module
<seealso marker="diameter">diameter</seealso>.
The service configuration defines the Diameter applications to be
-supported by the peer and, typically, the capabilities that it should
+supported by the node and, typically, the capabilities that it should
send to remote peers at capabilities exchange upon the establishment
of transport connections.
A transport is configured on a service and provides protocol-specific
@@ -57,16 +57,17 @@ diameter and implemented by a transport module.
The diameter application provides two transport modules: <seealso
marker="diameter_tcp">diameter_tcp</seealso> and <seealso
marker="diameter_sctp">diameter_sctp</seealso> for transport over TCP
-(using <c>gen_tcp</c>) and SCTP (using <c>gen_sctp</c>) respectively.
+(using <seealso marker="kernel:gen_tcp">gen_tcp</seealso>) and SCTP
+(using <seealso marker="kernel:gen_sctp">gen_sctp</seealso>) respectively.
Other transports can be provided by any module that implements
diameter's <seealso marker="diameter_transport">transport
interface</seealso>.</p>
<p>
-While a service typically implements a single Diameter peer (as
+While a service typically implements a single Diameter node (as
identified by an Origin-Host AVP), transports can themselves be
-associated with capabilities AVP's so that a single service be used to
-implement more than one Diameter peer.</p>
+associated with capabilities AVP's so that a single service can be
+used to implement more than one Diameter node.</p>
<p>
Each Diameter application defined on a service is configured with a
@@ -76,19 +77,19 @@ diameter communicates the connectivity of remote peers, requests peer
selection for outgoing requests, and communicates the reception of
incoming Diameter request and answer messages.
An application using diameter implements these application callback
-modules to provide the functionality of the Diameter peer(s) it
+modules to provide the functionality of the Diameter node(s) it
implements.</p>
<p>
-Each Diameter application is also configured with one or more
-dictionary modules
+Each Diameter application is also configured with a
+dictionary module
that provide encode/decode functionality for outgoing/incoming
-Diameter messages.
-A module is generated from a <seealso
+Diameter messages belonging to the application.
+A dictionary module is generated from a <seealso
marker="diameter_dict">specification file</seealso> using the <seealso
marker="diameterc">diameterc</seealso> utility.
Dictionaries for the RFC 3588 Diameter Common Messages, Base
-Accounting and Relay applications are provided by the diameter
+Accounting and Relay applications are provided with the diameter
application.</p>
</chapter>
diff --git a/lib/diameter/doc/src/diameter_sctp.xml b/lib/diameter/doc/src/diameter_sctp.xml
index c1e839b8e1..955169349c 100644
--- a/lib/diameter/doc/src/diameter_sctp.xml
+++ b/lib/diameter/doc/src/diameter_sctp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
-<year>2011</year>
+<year>2011</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -58,11 +58,11 @@ and implements the behaviour documented in
<fsummary>Start a transport process.</fsummary>
<type>
<v>Type = connect | accept</v>
-<v>Ref = reference()</v>
+<v>Ref = <seealso marker="diameter#transport_ref">diameter:transport_ref()</seealso></v>
<v>Svc = #diameter_service{}</v>
-<v>Opt = {raddr, ip_address()} | {rport, integer()} | term()</v>
+<v>Opt = {raddr, <seealso marker="kernel:inet#type-ip_address">inet:ip_address()</seealso>} | {rport, integer()} | term()</v>
<v>Pid = pid()</v>
-<v>LAddr = ip_address()</v>
+<v>LAddr = <seealso marker="kernel:inet#type-ip_address">inet:ip_address()</seealso></v>
<v>Reason = term()</v>
</type>
<desc>
@@ -75,12 +75,13 @@ marker="diameter_transport#start">diameter_transport(3)</seealso>.</p>
The only diameter_sctp-specific argument is the options list.
Options <c>raddr</c> and <c>rport</c> specify the remote address
and port for a connecting transport and not valid for a listening
-transport.
-The former is required while latter defaults to 3868 if unspecified.
+transport: the former is required while latter defaults to 3868 if
+unspecified.
More than one <c>raddr</c> option can be specified, in which case the
connecting transport in question attempts each in sequence until
an association is established.
-Remaining options are any accepted by gen_sctp:open/1, with the exception
+Remaining options are any accepted by <seealso
+marker="kernel:gen_sctp#open-1">gen_sctp:open/1</seealso>, with the exception
of options <c>mode</c>, <c>binary</c>, <c>list</c>, <c>active</c>
and <c>sctp_events</c>.
Note that options <c>ip</c> and <c>port</c> specify the local address
@@ -88,30 +89,45 @@ and port respectively.</p>
<p>
Multiple <c>ip</c> options can be specified for a multihomed peer.
-If none are specified then the values of Host-IP-Address
-on the service are used. (In particular, one of these must be specified.)
+If none are specified then the values of <c>Host-IP-Address</c>
+in the <c>#diameter_service{}</c> record are used.
+(In particular, one of these must be specified.)
Option <c>port</c> defaults to 3868 for a listening transport and 0 for a
connecting transport.</p>
+<warning>
+<p>
+An insufficiently large receive buffer may result in a peer having to
+resend incoming messages: set the <seealso
+marker="kernel:inet">inet(3)</seealso> option <c>recbuf</c> to increase
+the buffer size.</p>
+
+<p>
+An insufficiently large send buffer may result in outgoing messages
+being discarded: set the <seealso
+marker="kernel:inet">inet(3)</seealso> option <c>sndbuf</c> to increase
+the buffer size.</p>
+</warning>
+
<p>
diameter_sctp uses the <c>transport_data</c> field of
-the <c>diameter_packet</c> record to communicate the stream on which an
+the <c>#diameter_packet{}</c> record to communicate the stream on which an
inbound message has been received, or on which an outbound message
should be sent: the value will be of the form <c>{stream, Id}</c>
on an inbound message passed to a <seealso
marker="diameter_app#handle_request">handle_request</seealso> or <seealso
marker="diameter_app#handle_answer">handle_answer</seealso> callback.
-For an outbound message, either <c>undefined</c> (explicitly of
-by specifying the outbound message as a <c>binary()</c>) or a tuple
+For an outbound message, either <c>undefined</c> (explicitly or
+by receiving the outbound message as a <c>binary()</c>) or a tuple
should be set in the return value of <seealso
marker="diameter_app#handle_request">handle_request</seealso>
(typically by retaining the value passed into this function)
or <seealso
marker="diameter_app#prepare_request">prepare_request</seealso>.
-The value <c>undefined</c> uses a "next outbound stream" id and then
-increments this modulo the total number outbound streams. That
-is, successive values of <c>undefined</c> cycle through all outbound
-streams.</p>
+The value <c>undefined</c> uses a "next outbound stream" id and
+increments this modulo the total number outbound streams.
+That is, successive values of <c>undefined</c> cycle through all
+outbound streams.</p>
<!-- TODO: Some way of getting at the number of available outbound -->
<!-- streams. -->
@@ -128,7 +144,9 @@ streams.</p>
<title>SEE ALSO</title>
<p>
-<seealso marker="diameter_transport">diameter_transport(3)</seealso></p>
+<seealso marker="diameter_transport">diameter_transport(3)</seealso>,
+<seealso marker="kernel:gen_sctp">gen_sctp(3)</seealso>,
+<seealso marker="kernel:inet">inet(3)</seealso></p>
</section>
diff --git a/lib/diameter/doc/src/diameter_tcp.xml b/lib/diameter/doc/src/diameter_tcp.xml
index e6b53383c0..3ffcebfd90 100644
--- a/lib/diameter/doc/src/diameter_tcp.xml
+++ b/lib/diameter/doc/src/diameter_tcp.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
-<year>2011</year>
+<year>2011</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -38,8 +38,9 @@ under the License.
<description>
<p>
-This module implements diameter transport over TCP using gen_tcp.
-It can be specified as the value of a transport_module option to
+This module implements diameter transport over TCP using <seealso
+marker="kernel:gen_tcp">gen_tcp</seealso>.
+It can be specified as the value of a <c>transport_module</c> option to
<seealso
marker="diameter#add_transport">diameter:add_transport/2</seealso>
and implements the behaviour documented in
@@ -65,17 +66,17 @@ before configuring TLS capability on diameter transports.</p>
<fsummary>Start a transport process.</fsummary>
<type>
<v>Type = connect | accept</v>
-<v>Ref = reference()</v>
+<v>Ref = <seealso marker="diameter#transport_ref">diameter:transport_ref()</seealso></v>
<v>Svc = #diameter_service{}</v>
-<v>Opt = OwnOpt | SslOpt | OtherOpt</v>
+<v>Opt = OwnOpt | SslOpt | TcpOpt</v>
<v>Pid = pid()</v>
-<v>LAddr = ip_address()</v>
+<v>LAddr = <seealso marker="kernel:inet#type-ip_address">inet:ip_address()</seealso></v>
<v>Reason = term()</v>
-<v>OwnOpt = {raddr, ip_address()}
+<v>OwnOpt = {raddr, <seealso marker="kernel:inet#type-ip_address">inet:ip_address()</seealso>}
| {rport, integer()}
| {port, integer()}</v>
<v>SslOpt = {ssl_options, true | list()}</v>
-<v>OtherOpt = term()</v>
+<v>TcpOpt = term()</v>
</type>
<desc>
@@ -89,25 +90,32 @@ Options <c>raddr</c> and <c>rport</c> specify the remote address
and port for a connecting transport and are not valid for a listening
transport.
Option <c>ssl_options</c> must be specified for a transport
-that must be able to support TLS: a value of <c>true</c> results in a
+that should support TLS: a value of <c>true</c> results in a
TLS handshake immediately upon connection establishment while
-list() specifies options to be passed to ssl:connect/2 of ssl:ssl_accept/2
+<c>list()</c> specifies options to be passed to <seealso
+marker="ssl:ssl#connect-2">ssl:connect/2</seealso> or
+<seealso marker="ssl:ssl#ssl_accept-2">ssl:ssl_accept/2</seealso>
after capabilities exchange if TLS is negotiated.
-Remaining options are any accepted by ssl:connect/3 or gen_tcp:connect/3 for
-a connecting transport, or ssl:listen/3 or gen_tcp:listen/2 for
+Remaining options are any accepted by <seealso
+marker="ssl:ssl#connect-3">ssl:connect/3</seealso> or <seealso
+marker="kernel:gen_tcp#connect-3">gen_tcp:connect/3</seealso> for
+a connecting transport, or <seealso
+marker="ssl:ssl#listen-2">ssl:listen/2</seealso> or <seealso
+marker="kernel:gen_tcp#listen-2">gen_tcp:listen/2</seealso> for
a listening transport, depending on whether or not <c>{ssl_options, true}</c>
has been specified.
-Options <c>binary</c>, <c>packet</c> and <c>active</c> cannot be specified.
+Options <c>binary</c>,
+<c>packet</c> and <c>active</c> cannot be specified.
Also, option <c>port</c> can be specified for a listening transport
to specify the local listening port, the default being the standardized
3868 if unspecified.
-Note that option <c>ip</c> specifies the local address.</p>
+Note that the option <c>ip</c> specifies the local address.</p>
<p>
An <c>ssl_options</c> list must be specified if and only if
-the transport in question has specified an Inband-Security-Id
-AVP with value TLS on the relevant call to
-<seealso
+the transport in question has set <c>Inband-Security-Id</c> to
+1 (<c>TLS</c>), as
+specified to either <seealso
marker="diameter#start_service">start_service/2</seealso> or
<seealso
marker="diameter#add_transport">add_transport/2</seealso>,
@@ -122,9 +130,9 @@ that will not be forthcoming, which will eventually cause the RFC 3539
watchdog to take down the connection.</p>
<p>
-If the service specifies more than one Host-IP-Address and
-option <c>ip</c> is unspecified then then the
-first of the service's addresses is used as the local address.</p>
+If the <c>#diameter_service{}</c> record has more than one
+<c>Host-IP-Address</c> and option <c>ip</c> is unspecified then the
+first of the these addresses is used as the local address.</p>
<p>
The returned local address list has length one.</p>
@@ -142,7 +150,10 @@ The returned local address list has length one.</p>
<p>
<seealso marker="diameter">diameter(3)</seealso>,
-<seealso marker="diameter_transport">diameter_transport(3)</seealso></p>
+<seealso marker="diameter_transport">diameter_transport(3)</seealso>,
+<seealso marker="kernel:gen_tcp">gen_tcp(3)</seealso>,
+<seealso marker="kernel:inet">inet(3)</seealso>,
+<seealso marker="ssl:ssl">ssl(3)</seealso></p>
</section>
diff --git a/lib/diameter/doc/src/diameter_transport.xml b/lib/diameter/doc/src/diameter_transport.xml
index 087a90b099..9ab750e560 100644
--- a/lib/diameter/doc/src/diameter_transport.xml
+++ b/lib/diameter/doc/src/diameter_transport.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
-<year>2011</year>
+<year>2011</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -59,11 +59,11 @@ parent).</p>
<fsummary>Start a transport process.</fsummary>
<type>
<v>Type = connect | accept</v>
-<v>Ref = reference()</v>
+<v>Ref = <seealso marker="diameter#transport_ref">diameter:transport_ref()</seealso></v>
<v>Svc = #diameter_service{}</v>
<v>Opts = term()</v>
<v>Pid = pid()</v>
-<v>LAddrs = [ip_address()]</v>
+<v>LAddrs = [<seealso marker="kernel:inet#type-ip_address">inet:ip_address()</seealso>]</v>
<v>Reason = term()</v>
</type>
<desc>
@@ -93,16 +93,19 @@ It should not link to the parent.
It should exit if its transport connection with its peer is lost.</p>
<p>
-Transport processes for a given service are started sequentially.</p>
-
-<p>
-The start function should use the 'Host-IP-Address' list on the service,
-namely <c>Svc#diameter_service.host_ip_address</c>, and/or
+The capabilities in the <c>#diameter_service{}</c> record are as
+passed to <seealso
+marker="diameter#start_service">diameter:start_service/2</seealso> and
+<seealso
+marker="diameter#add_transport">diameter:add_transport/2</seealso>,
+values passed to the latter overriding those passed to the former.
+The start function should use the <c>Host-IP-Address</c> list and/or
<c>Opts</c> to select an appropriate list of local IP addresses,
-and should return this list if different from the service addresses.
-The returned list is used to populate 'Host-IP-Address' AVPs in outgoing
-capabilities exchange messages, the service addresses being used
-otherwise.</p>
+and should return this list if different from the
+<c>#diameter_service{}</c> addresses.
+The returned list is used to populate <c>Host-IP-Address</c> AVPs in
+outgoing capabilities exchange messages, the
+<c>#diameter_service{}</c> addresses being used otherwise.</p>
<marker id="MESSAGES"/>
</desc>
@@ -129,9 +132,10 @@ diameter.</p>
<item>
<p>
An outbound Diameter message.
-Packet can be either <c>binary()</c> (the message to be sent)
-or a <c>#diameter_packet{}</c> whose <c>transport_data</c> field
-containes a value other than undefined.</p>
+<c>Packet</c> can be either binary() (the message to be sent)
+or a <c>#diameter_packet{}</c> record whose <c>transport_data</c>
+field contains a value other than undefined and whose <c>bin</c> field
+contains the binary to send.</p>
</item>
<tag><c>{diameter, {close, Pid}}</c></tag>
@@ -140,7 +144,7 @@ containes a value other than undefined.</p>
A request to close the transport connection.
The transport process should terminate after closing the
connection.
-Pid is the pid() of the parent process.</p>
+<c>Pid</c> is the pid() of the parent process.</p>
</item>
<tag><c>{diameter, {tls, Ref, Type, Bool}}</c></tag>
@@ -148,17 +152,17 @@ Pid is the pid() of the parent process.</p>
<p>
Indication of whether or not capabilities exchange has selected
inband security using TLS.
-Ref is a reference() that must be included in the
+<c>Ref</c> is a reference() that must be included in the
<c>{diameter, {tls, Ref}}</c> reply message to the transport's
parent process (see below).
-Type is either <c>connect</c> or <c>accept</c> depending on
+<c>Type</c> is either <c>connect</c> or <c>accept</c> depending on
whether the process has been started for a connecting or listening
transport respectively.
-Bool is a boolean() indicating whether or not the transport connection
-should be upgraded to TLS.</p>
+<c>Bool</c> is a boolean() indicating whether or not the transport
+connection should be upgraded to TLS.</p>
<p>
-If TLS is requested (Bool = true) then a connecting process should
+If TLS is requested (<c>Bool=true</c>) then a connecting process should
initiate a TLS handshake with the peer and an accepting process should
prepare to accept a handshake.
A successful handshake should be followed by a <c>{diameter, {tls, Ref}}</c>
@@ -182,18 +186,18 @@ to its parent.</p>
<tag><c>{diameter, {self(), connected}}</c></tag>
<item>
<p>
-Inform the parent that the transport process with Type = accept has
+Inform the parent that the transport process with <c>Type=accept</c> has
established a connection with the peer.
-Not sent if the transport process has Type = connect.</p>
+Not sent if the transport process has <c>Type=connect</c>.</p>
</item>
<tag><c>{diameter, {self(), connected, Remote}}</c></tag>
<item>
<p>
-Inform the parent that the transport process with Type = connect
+Inform the parent that the transport process with <c>Type=connect</c>
has established a connection with a peer.
-Not sent if the transport process has Type = accept.
-Remote is an arbitrary term that uniquely identifies the remote
+Not sent if the transport process has <c>Type=accept</c>.
+<c>Remote</c> is an arbitrary term that uniquely identifies the remote
endpoint to which the transport has connected.</p>
</item>
@@ -201,14 +205,14 @@ endpoint to which the transport has connected.</p>
<item>
<p>
An inbound Diameter message.
-Packet can be either <c>binary()</c> (the message to be sent)
-or <c>#diameter_packet{}</c>
-whose <c>packet</c> field contains a <c>binary()</c>.
-Any value (other than undefined) set in
+<c>Packet</c> can be either binary() (the received message)
+or a <c>#diameter_packet{}</c> record
+whose <c>bin</c> field contains the received binary().
+Any value (other than <c>undefined</c>) set in
the <c>transport_data</c> field will be passed back with a
corresponding answer message in the case that the inbound message is a
request unless the sender sets another value.
-How the <c>transport_data</c> is used/interpreted is up to the
+How <c>transport_data</c> is used/interpreted is up to the
transport module.</p>
</item>
@@ -216,7 +220,7 @@ transport module.</p>
<item>
<p>
Acknowledgment of a successful TLS handshake.
-Ref is the reference() received in the
+<c>Ref</c> is the reference() received in the
<c>{diameter, {tls, Ref, Type, Bool}}</c> message in response
to which the reply is sent.
A transport must exit if a handshake is not successful.</p>
diff --git a/lib/diameter/doc/src/diameter_using.xml b/lib/diameter/doc/src/diameter_using.xml
index 809b76bdf3..7d9c0cd492 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>2011</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
@@ -23,7 +23,7 @@ under the License.
</legalnotice>
-<title>Using the stack</title>
+<title>Usage</title>
<prepared></prepared>
<responsible></responsible>
<docno></docno>
diff --git a/lib/diameter/doc/src/notes.xml b/lib/diameter/doc/src/notes.xml
index 6e364a3200..e57958ac09 100644
--- a/lib/diameter/doc/src/notes.xml
+++ b/lib/diameter/doc/src/notes.xml
@@ -36,6 +36,106 @@ first.</p>
<!-- ===================================================================== -->
+<section><title>Diameter 1.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fix broken Result-Code setting and Destination-Host/Realm
+ extraction.</p>
+ <p>
+ Result-Code was assumed to have arity 1 when setting this
+ value in an answer to a request containing AVP decode
+ errors. Destination-Host/Realm were only correctly
+ extracted from messages in the common application.</p>
+ <p>
+ Own Id: OTP-10202</p>
+ </item>
+ <item>
+ <p>
+ Handle insufficient capabilities configuration more
+ gracefully.</p>
+ <p>
+ A transport that does not have sufficient capabilities
+ configuration in order to encode CER/CEA will now emit an
+ error report noting the configuration error and exit
+ instead of failing. The error is not detected at
+ diameter:add_transport/2 since there is no requirement
+ that a service be configured before its transports.</p>
+ <p>
+ Own Id: OTP-10203</p>
+ </item>
+ <item>
+ <p>
+ Ensure a failing peer_up/down callback does not affect
+ transport connections to other peers.</p>
+ <p>
+ Such a failure would previously have taken down all of a
+ service's connections.</p>
+ <p>
+ Own Id: OTP-10215</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Statistics related to Diameter messages can be retrieved
+ using diameter:service_info/2.</p>
+ <p>
+ Both Diameter and socket-level statistics are available,
+ for both incoming and outgoing messages.</p>
+ <p>
+ Own Id: OTP-9608</p>
+ </item>
+ <item>
+ <p>
+ Allow multiple transport_module/config to
+ diameter:add_transport/2.</p>
+ <p>
+ Multiple values are attempted in sequence until one
+ results in an established connection. This provides a way
+ for a connecting transport to specify configuration in
+ order of preference. (For example, SCTP before TCP.)</p>
+ <p>
+ Own Id: OTP-9885</p>
+ </item>
+ <item>
+ <p>
+ Add events for state transitions in the RFC 3539 watchdog
+ state machine.</p>
+ <p>
+ The watchdog state is also available through
+ diameter:service_info/2.</p>
+ <p>
+ Own Id: OTP-10212</p>
+ </item>
+ <item>
+ <p>
+ Add diameter:service_info(SvcName, connections).</p>
+ <p>
+ This provides an alternative to
+ diameter:service_info(SvcName, transport) that presents
+ information per established connection instead of per
+ transport reference.</p>
+ <p>
+ Own Id: OTP-10213</p>
+ </item>
+ <item>
+ <p>
+ Assorted documentation corrections/improvements.</p>
+ <p>
+ Own Id: OTP-10216</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Diameter 1.0</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/diameter/examples/code/GNUmakefile b/lib/diameter/examples/code/GNUmakefile
index a0669119d2..98e36a99e3 100644
--- a/lib/diameter/examples/code/GNUmakefile
+++ b/lib/diameter/examples/code/GNUmakefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2011. All Rights Reserved.
+# Copyright Ericsson AB 2010-2012. 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/lib/diameter/examples/code/client.erl b/lib/diameter/examples/code/client.erl
index 9e65f98de0..bfe71b0e56 100644
--- a/lib/diameter/examples/code/client.erl
+++ b/lib/diameter/examples/code/client.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -38,7 +38,7 @@
-module(client).
-include_lib("diameter/include/diameter.hrl").
--include_lib("diameter/src/app/diameter_gen_base_rfc3588.hrl").
+-include_lib("diameter/include/diameter_gen_base_rfc3588.hrl").
-export([start/1, %% start a service
connect/2, %% add a connecting transport
diff --git a/lib/diameter/examples/code/client_cb.erl b/lib/diameter/examples/code/client_cb.erl
index 524a8f94a1..ee3dcb2fec 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -20,7 +20,7 @@
-module(client_cb).
-include_lib("diameter/include/diameter.hrl").
--include_lib("diameter/src/app/diameter_gen_base_rfc3588.hrl").
+-include_lib("diameter/include/diameter_gen_base_rfc3588.hrl").
%% diameter callbacks
-export([peer_up/3,
diff --git a/lib/diameter/examples/code/peer.erl b/lib/diameter/examples/code/peer.erl
index 89203e15c3..8fdeba57bf 100644
--- a/lib/diameter/examples/code/peer.erl
+++ b/lib/diameter/examples/code/peer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -25,7 +25,7 @@
-module(peer).
-include_lib("diameter/include/diameter.hrl").
--include_lib("diameter/src/app/diameter_gen_base_rfc3588.hrl").
+-include_lib("diameter/include/diameter_gen_base_rfc3588.hrl").
-export([start/2,
listen/2,
@@ -117,6 +117,11 @@ server(T) ->
%%
%% Return config for a connecting transport.
+client({all, LA, RA, RP}) ->
+ [[M,{K,C}], T]
+ = [client({P, LA, RA, RP}) || P <- [sctp,tcp]],
+ [M, {K,C,2000} | T];
+
client({T, LA, RA, RP}) ->
[{transport_module, tmod(T)},
{transport_config, [{ip, addr(LA)},
diff --git a/lib/diameter/examples/code/redirect.erl b/lib/diameter/examples/code/redirect.erl
index b54701243f..d4d94ab23a 100644
--- a/lib/diameter/examples/code/redirect.erl
+++ b/lib/diameter/examples/code/redirect.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -20,7 +20,7 @@
-module(redirect).
-include_lib("diameter/include/diameter.hrl").
--include_lib("diameter/src/app/diameter_gen_base_rfc3588.hrl").
+-include_lib("diameter/include/diameter_gen_base_rfc3588.hrl").
-export([start/1,
listen/2,
diff --git a/lib/diameter/examples/code/redirect_cb.erl b/lib/diameter/examples/code/redirect_cb.erl
index ea7ad38749..da31add70d 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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/lib/diameter/examples/code/relay.erl b/lib/diameter/examples/code/relay.erl
index deecb1cfc0..d3438f83f3 100644
--- a/lib/diameter/examples/code/relay.erl
+++ b/lib/diameter/examples/code/relay.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -32,7 +32,7 @@
-module(relay).
-include_lib("diameter/include/diameter.hrl").
--include_lib("diameter/src/app/diameter_gen_base_rfc3588.hrl").
+-include_lib("diameter/include/diameter_gen_base_rfc3588.hrl").
-export([start/1,
listen/2,
diff --git a/lib/diameter/examples/code/relay_cb.erl b/lib/diameter/examples/code/relay_cb.erl
index 9ed6517d5c..9f9cd8d5ae 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -20,7 +20,7 @@
-module(relay_cb).
-include_lib("diameter/include/diameter.hrl").
--include_lib("diameter/src/app/diameter_gen_base_rfc3588.hrl").
+-include_lib("diameter/include/diameter_gen_base_rfc3588.hrl").
%% diameter callbacks
-export([peer_up/3,
diff --git a/lib/diameter/examples/code/server.erl b/lib/diameter/examples/code/server.erl
index ebb408e501..3959461cec 100644
--- a/lib/diameter/examples/code/server.erl
+++ b/lib/diameter/examples/code/server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -35,7 +35,7 @@
-module(server).
-include_lib("diameter/include/diameter.hrl").
--include_lib("diameter/src/app/diameter_gen_base_rfc3588.hrl").
+-include_lib("diameter/include/diameter_gen_base_rfc3588.hrl").
-export([start/1, %% start a service
listen/2, %% add a listening transport
diff --git a/lib/diameter/examples/code/server_cb.erl b/lib/diameter/examples/code/server_cb.erl
index 43b8e24b5c..0f6eb32ed6 100644
--- a/lib/diameter/examples/code/server_cb.erl
+++ b/lib/diameter/examples/code/server_cb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -24,7 +24,7 @@
-module(server_cb).
-include_lib("diameter/include/diameter.hrl").
--include_lib("diameter/src/app/diameter_gen_base_rfc3588.hrl").
+-include_lib("diameter/include/diameter_gen_base_rfc3588.hrl").
%% diameter callbacks
-export([peer_up/3,
@@ -76,7 +76,7 @@ handle_request(#diameter_packet{msg = Req, errors = []}, _SvcName, {_, Caps})
%% ... or one that wasn't. 3xxx errors are answered by diameter itself
%% but these are 5xxx errors for which we must contruct a reply.
%% diameter will set Result-Code and Failed-AVP's.
-handle_request(#diameter_packet{msg = Req} = Pkt, _SvcName, {_, Caps})
+handle_request(#diameter_packet{msg = Req}, _SvcName, {_, Caps})
when is_record(Req, diameter_base_RAR) ->
#diameter_caps{origin_host = {OH,_},
origin_realm = {OR,_}}
diff --git a/lib/diameter/include/diameter.hrl b/lib/diameter/include/diameter.hrl
index 4273262015..beb577afaf 100644
--- a/lib/diameter/include/diameter.hrl
+++ b/lib/diameter/include/diameter.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -139,7 +139,6 @@
init_state, %% option 'state', initial callback state
id, %% 32-bit unsigned application identifier = Dict:id()
mutable = false, %% boolean(), do traffic callbacks modify state?
- answer_errors = report}). %% | callback | discard
- %% how to handle containing errors?
+ options = [{answer_errors, report}]}). %% | callback | discard
-endif. %% -ifdef(diameter_hrl).
diff --git a/lib/diameter/src/.gitignore b/lib/diameter/src/.gitignore
index feeb378fd8..cc06720fd1 100644
--- a/lib/diameter/src/.gitignore
+++ b/lib/diameter/src/.gitignore
@@ -1,2 +1,3 @@
/depend.mk
+/otp.plt
diff --git a/lib/diameter/src/Makefile b/lib/diameter/src/Makefile
index dbfaa4e140..99c343275b 100644
--- a/lib/diameter/src/Makefile
+++ b/lib/diameter/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2011. All Rights Reserved.
+# Copyright Ericsson AB 2010-2012. 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
@@ -181,6 +181,31 @@ clean:
rm -f $(TARGET_FILES) gen/*
rm -f depend.mk
+realclean: clean
+ rm -f ../ebin/*
+# Not $(EBIN) just to be a bit paranoid
+
+PLT = ./otp.plt
+
+plt:
+ dialyzer --build_plt \
+ --apps erts stdlib kernel \
+ xmerl ssl public_key crypto \
+ compiler syntax_tools runtime_tools \
+ --output_plt $(PLT) \
+ --verbose
+
+dialyze: opt $(PLT)
+ dialyzer --plt $(PLT) \
+ --verbose \
+ -Wno_improper_lists \
+ $(EBIN)/diameter_gen_base_rfc3588.$(EMULATOR) \
+ $(patsubst %, $(EBIN)/%.$(EMULATOR), \
+ $(notdir $(RT_MODULES) $(CT_MODULES)))
+# Omit all but the common dictionary module since these
+# (diameter_gen_relay in particular) generate warning depending on how
+# much of the included diameter_gen.hrl they use.
+
# ----------------------------------------------------
# Release targets
# ----------------------------------------------------
@@ -195,27 +220,27 @@ endif
release_spec: opt
for d in bin ebin include src/dict; do \
- $(INSTALL_DIR) $(RELSYSDIR)/$$d; \
+ $(INSTALL_DIR) "$(RELSYSDIR)/$$d"; \
done
- $(INSTALL_SCRIPT) $(BINS:%=../bin/%) $(RELSYSDIR)/bin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_SCRIPT) $(BINS:%=../bin/%) "$(RELSYSDIR)/bin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(EXTERNAL_HRLS:%=../include/%) $(DICT_HRLS) \
- $(RELSYSDIR)/include
- $(INSTALL_DATA) $(DICTS:%=dict/%.dia) $(RELSYSDIR)/src/dict
+ "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(DICTS:%=dict/%.dia) "$(RELSYSDIR)/src/dict"
$(MAKE) $(TARGET_DIRS:%/=release_src_%)
$(MAKE) $(EXAMPLE_DIRS:%/=release_examples_%)
$(TARGET_DIRS:%/=release_src_%): release_src_%:
- $(INSTALL_DIR) $(RELSYSDIR)/src/$*
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/$*"
$(INSTALL_DATA) $(filter $*/%, $(TARGET_MODULES:%=%.erl) \
$(INTERNAL_HRLS)) \
$(filter $*/%, compiler/$(DICT_YRL).yrl) \
- $(RELSYSDIR)/src/$*
+ "$(RELSYSDIR)/src/$*"
$(EXAMPLE_DIRS:%/=release_examples_%): release_examples_%:
- $(INSTALL_DIR) $(RELSYSDIR)/examples/$*
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/$*"
$(INSTALL_DATA) $(patsubst %, ../examples/%, $(filter $*/%, $(EXAMPLES))) \
- $(RELSYSDIR)/examples/$*
+ "$(RELSYSDIR)/examples/$*"
release_docs_spec:
@@ -245,10 +270,11 @@ depend.mk: depend.sed $(MODULES:%=%.erl) Makefile
-include depend.mk
-.PHONY: app clean depend dict info release_subdir
+.PHONY: app clean realclean depend dict info release_subdir
.PHONY: debug opt release_docs_spec release_spec
.PHONY: $(TARGET_DIRS:%/=%) $(TARGET_DIRS:%/=release_src_%)
.PHONY: $(EXAMPLE_DIRS:%/=release_examples_%)
+.PHONY: plt dialyze
# Keep intermediate files.
.SECONDARY: $(DICT_ERLS) $(DICT_HRLS) gen/$(DICT_YRL:%=%.erl)
diff --git a/lib/diameter/src/base/diameter.appup.src b/lib/diameter/src/base/diameter.appup.src
index b1c94d4cc8..9b2a7d18ab 100644
--- a/lib/diameter/src/base/diameter.appup.src
+++ b/lib/diameter/src/base/diameter.appup.src
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -21,10 +21,29 @@
{"%VSN%",
[
{"0.9", [{restart_application, diameter}]},
- {"0.10", [{restart_application, diameter}]}
+ {"0.10", [{restart_application, diameter}]},
+ {"1.0", [{restart_application, diameter}]},
+ {"1.1", [%% new code
+ {add_module, diameter_transport},
+ %% modified code
+ {load, diameter_sctp},
+ {load, diameter_stats},
+ {load, diameter_service},
+ {load, diameter_config},
+ {load, diameter_codec},
+ {load, diameter_watchdog},
+ {load, diameter_peer},
+ {load, diameter_peer_fsm},
+ {load, diameter},
+ %% unmodified but including modified diameter.hrl
+ {load, diameter_callback},
+ {load, diameter_capx},
+ {load, diameter_types}]}
],
[
{"0.9", [{restart_application, diameter}]},
- {"0.10", [{restart_application, diameter}]}
+ {"0.10", [{restart_application, diameter}]},
+ {"1.0", [{restart_application, diameter}]},
+ {"1.1", [{restart_application, diameter}]}
]
}.
diff --git a/lib/diameter/src/base/diameter.erl b/lib/diameter/src/base/diameter.erl
index 336f0c1f2d..4f90b741ae 100644
--- a/lib/diameter/src/base/diameter.erl
+++ b/lib/diameter/src/base/diameter.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -312,6 +312,7 @@ call(SvcName, App, Message) ->
-type transport_opt()
:: {transport_module, atom()}
| {transport_config, any()}
+ | {transport_config, any(), non_neg_integer() | infinity}
| {applications, [app_alias()]}
| {capabilities, [capability()]}
| {capabilities_cb, evaluable()}
@@ -322,10 +323,11 @@ call(SvcName, App, Message) ->
%% Predicate passed to remove_transport/2
-type transport_pred()
- :: fun((reference(), connect|listen, list()) -> boolean())
- | fun((reference(), list()) -> boolean())
+ :: fun((transport_ref(), connect|listen, list()) -> boolean())
+ | fun((transport_ref(), list()) -> boolean())
| fun((list()) -> boolean())
- | reference()
+ | transport_ref()
+ | boolean()
| list()
| {connect|listen, transport_pred()}
| {atom(), atom(), list()}.
diff --git a/lib/diameter/src/base/diameter_codec.erl b/lib/diameter/src/base/diameter_codec.erl
index fe1212b7e0..421e280422 100644
--- a/lib/diameter/src/base/diameter_codec.erl
+++ b/lib/diameter/src/base/diameter_codec.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -63,9 +63,9 @@ encode(Mod, #diameter_packet{} = Pkt) ->
e(Mod, Pkt)
catch
error: Reason ->
- %% Be verbose rather than letting the emulator truncate the
- %% error report.
- X = {Reason, ?STACK},
+ %% Be verbose since a crash report may be truncated and
+ %% encode errors are self-inflicted.
+ X = {?MODULE, encode, {Reason, ?STACK}},
diameter_lib:error_report(X, {?MODULE, encode, [Mod, Pkt]}),
exit(X)
end;
@@ -91,7 +91,8 @@ e(_, #diameter_packet{msg = [#diameter_header{} = Hdr | As]} = Pkt) ->
Flags = make_flags(0, Hdr),
- Pkt#diameter_packet{bin = <<Vsn:8, Length:24,
+ Pkt#diameter_packet{header = Hdr,
+ bin = <<Vsn:8, Length:24,
Flags:8, Code:24,
Aid:32,
Hid:32,
diff --git a/lib/diameter/src/base/diameter_config.erl b/lib/diameter/src/base/diameter_config.erl
index 9253af0de2..e47f63f814 100644
--- a/lib/diameter/src/base/diameter_config.erl
+++ b/lib/diameter/src/base/diameter_config.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -519,6 +519,7 @@ rm(SvcName, L) ->
Refs = lists:map(fun(#transport{ref = R}) -> R end, L),
case stop_transport(SvcName, Refs) of
ok ->
+ diameter_stats:flush(Refs),
lists:foreach(fun delete_object/1, L);
{error, _} = No ->
No
@@ -600,7 +601,7 @@ app_acc({application, Opts}, Acc) ->
module = init_mod(Mod),
init_state = ModS,
mutable = init_mutable(M),
- answer_errors = init_answers(A)}
+ options = [{answer_errors, init_answers(A)}]}
| Acc];
app_acc(_, Acc) ->
Acc.
diff --git a/lib/diameter/src/base/diameter_peer.erl b/lib/diameter/src/base/diameter_peer.erl
index 3e78c4caef..46b2ba9465 100644
--- a/lib/diameter/src/base/diameter_peer.erl
+++ b/lib/diameter/src/base/diameter_peer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -27,12 +27,15 @@
up/2]).
%% ... and the stack.
--export([start/3,
+-export([start/1,
send/2,
close/1,
abort/1,
notify/2]).
+%% Old interface only called from old code.
+-export([start/3]). %% < diameter-1.2 (R15B02)
+
%% Server start.
-export([start_link/0]).
@@ -57,6 +60,11 @@
%% Server state.
-record(state, {id = now()}).
+%% Default transport_module/config.
+-define(DEFAULT_TMOD, diameter_tcp).
+-define(DEFAULT_TCFG, []).
+-define(DEFAULT_TTMO, infinity).
+
%%% ---------------------------------------------------------------------------
%%% # notify/2
%%% ---------------------------------------------------------------------------
@@ -68,9 +76,119 @@ notify(SvcName, T) ->
%%% # start/3
%%% ---------------------------------------------------------------------------
-start(T, Opts, #diameter_service{} = Svc) ->
- {Mod, Cfg} = split_transport(Opts),
- apply(Mod, start, [T, Svc, Cfg]).
+%% From old code: make is restart.
+start(_T, _Opts, #diameter_service{}) ->
+ {error, restart}.
+
+%%% ---------------------------------------------------------------------------
+%%% # start/1
+%%% ---------------------------------------------------------------------------
+
+-spec start({T, [Opt], #diameter_service{}})
+ -> {TPid, [Addr], Tmo, Data}
+ | {error, [term()]}
+ when T :: {connect|accept, diameter:transport_ref()},
+ Opt :: diameter:transport_opt(),
+ TPid :: pid(),
+ Addr :: inet:ip_address(),
+ Tmo :: non_neg_integer() | infinity,
+ Data :: {{T, Mod, Cfg}, [Mod], [{T, [Mod], Cfg}], [Err]},
+ Mod :: module(),
+ Cfg :: term(),
+ Err :: term()
+ ; ({#diameter_service{}, Tmo, Data})
+ -> {TPid, [Addr], Tmo, Data}
+ | {error, [term()]}
+ when TPid :: pid(),
+ Addr :: inet:ip_address(),
+ Tmo :: non_neg_integer() | infinity,
+ Data :: {{T, Mod, Cfg}, [Mod], [{T, [Mod], Cfg}], [Err]},
+ T :: {connect|accept, diameter:transport_ref()},
+ Mod :: module(),
+ Cfg :: term(),
+ Err :: term().
+
+%% Initial start.
+start({T, Opts, #diameter_service{} = Svc}) ->
+ start(T, Svc, pair(Opts, [], []), []);
+
+%% Subsequent start.
+start({#diameter_service{} = Svc, Tmo, {{T, _, Cfg}, Ms, Rest, Errs}}) ->
+ start(T, Ms, Cfg, Svc, Tmo, Rest, Errs).
+
+%% pair/3
+%%
+%% Pair transport modules with config.
+
+%% Another transport_module: accumulate it.
+pair([{transport_module, M} | Rest], Mods, Acc) ->
+ pair(Rest, [M|Mods], Acc);
+
+%% Another transport_config: accumulate another tuple.
+pair([{transport_config = T, C} | Rest], Mods, Acc) ->
+ pair([{T, C, ?DEFAULT_TTMO} | Rest], Mods, Acc);
+pair([{transport_config, C, Tmo} | Rest], Mods, Acc) ->
+ pair(Rest, [], acc({Mods, C, Tmo}, Acc));
+
+pair([_ | Rest], Mods, Acc) ->
+ pair(Rest, Mods, Acc);
+
+%% No transport_module or transport_config: defaults.
+pair([], [], []) ->
+ [{[?DEFAULT_TMOD], ?DEFAULT_TCFG, ?DEFAULT_TTMO}];
+
+%% One transport_module, one transport_config.
+pair([], [M], [{[], Cfg, Tmo}]) ->
+ [{[M], Cfg, Tmo}];
+
+%% Trailing transport_module: default transport_config.
+pair([], [_|_] = Mods, Acc) ->
+ lists:reverse(acc({Mods, ?DEFAULT_TCFG, ?DEFAULT_TTMO}, Acc));
+
+pair([], [], Acc) ->
+ lists:reverse(def(Acc)).
+
+%% acc/2
+
+acc(T, Acc) ->
+ [T | def(Acc)].
+
+%% def/1
+%%
+%% Default module of previous pair if none were specified.
+
+def([{[], Cfg, Tmo} | Acc]) ->
+ [{[?DEFAULT_TMOD], Cfg, Tmo} | Acc];
+def(Acc) ->
+ Acc.
+
+%% start/4
+
+start(T, Svc, [{Ms, Cfg, Tmo} | Rest], Errs) ->
+ start(T, Ms, Cfg, Svc, Tmo, Rest, Errs);
+
+start(_, _, [], Errs) ->
+ {error, Errs}.
+
+%% start/7
+
+start(T, [], _, Svc, _, Rest, Errs) ->
+ start(T, Svc, Rest, Errs);
+
+start(T, [M|Ms], Cfg, Svc, Tmo, Rest, Errs) ->
+ case start(M, [T, Svc, Cfg]) of
+ {ok, TPid} ->
+ {TPid, [], Tmo, {{T, M, Cfg}, Ms, Rest, Errs}};
+ {ok, TPid, [_|_] = Addrs} ->
+ {TPid, Addrs, Tmo, {{T, M, Cfg}, Ms, Rest, Errs}};
+ E ->
+ start(T, Ms, Cfg, Svc, Tmo, Rest, [E|Errs])
+ end.
+
+%% start/2
+
+start(Mod, Args) ->
+ apply(Mod, start, Args).
%%% ---------------------------------------------------------------------------
%%% # up/[12]
@@ -204,21 +322,6 @@ bang(undefined = No, _) ->
bang(Pid, T) ->
Pid ! T.
-%% split_transport/1
-%%
-%% Split options into transport module, transport config and
-%% remaining options.
-
-split_transport(Opts) ->
- {[M,C], _} = proplists:split(Opts, [transport_module,
- transport_config]),
- {value(M, diameter_tcp), value(C, [])}.
-
-value([{_,V}], _) ->
- V;
-value([], V) ->
- V.
-
%% call/1
call(Request) ->
diff --git a/lib/diameter/src/base/diameter_peer_fsm.erl b/lib/diameter/src/base/diameter_peer_fsm.erl
index 99644814d2..302540e76b 100644
--- a/lib/diameter/src/base/diameter_peer_fsm.erl
+++ b/lib/diameter/src/base/diameter_peer_fsm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -54,6 +54,12 @@
-define(NO_INBAND_SECURITY, 0).
-define(TLS, 1).
+%% Keys in process dictionary.
+-define(CB_KEY, cb). %% capabilities callback
+-define(DWA_KEY, dwa). %% outgoing DWA
+-define(Q_KEY, q). %% transport start queue
+-define(START_KEY, start). %% start of connected transport
+
%% A 2xxx series Result-Code. Not necessarily 2001.
-define(IS_SUCCESS(N), 2 == (N) div 1000).
@@ -115,16 +121,20 @@
%%% Output: Pid
%%% ---------------------------------------------------------------------------
+-spec start(T, [Opt], #diameter_service{})
+ -> pid()
+ when T :: {connect|accept, diameter:transport_ref()},
+ Opt :: diameter:transport_opt().
+
%% diameter_config requires a non-empty list of applications on the
%% service but diameter_service then constrains the list to any
%% specified on the transport in question. Check here that the list is
%% still non-empty.
-start({_, Ref} = Type, Opts, #diameter_service{applications = Apps} = Svc) ->
+start({_,_} = Type, Opts, #diameter_service{applications = Apps} = Svc) ->
[] /= Apps orelse ?ERROR({no_apps, Type, Opts}),
T = {self(), Type, Opts, Svc},
{ok, Pid} = diameter_peer_fsm_sup:start_child(T),
- diameter_stats:reg(Pid, Ref),
Pid.
start_link(T) ->
@@ -143,18 +153,18 @@ init(T) ->
proc_lib:init_ack({ok, self()}),
gen_server:enter_loop(?MODULE, [], i(T)).
-i({WPid, T, Opts, #diameter_service{capabilities = Caps} = Svc0}) ->
- putr(dwa, dwa(Caps)),
+i({WPid, T, Opts, #diameter_service{capabilities = Caps} = Svc}) ->
+ putr(?DWA_KEY, dwa(Caps)),
{M, Ref} = T,
+ diameter_stats:reg(Ref),
{[Ts], Rest} = proplists:split(Opts, [capabilities_cb]),
- putr(capabilities_cb, {Ref, [F || {_,F} <- Ts]}),
- {ok, TPid, Svc} = start_transport(T, Rest, Svc0),
- erlang:monitor(process, TPid),
+ putr(?CB_KEY, {Ref, [F || {_,F} <- Ts]}),
erlang:monitor(process, WPid),
+ {TPid, Addrs} = start_transport(T, Rest, Svc),
#state{parent = WPid,
transport = TPid,
mode = M,
- service = Svc}.
+ service = svc(Svc, Addrs)}.
%% The transport returns its local ip addresses so that different
%% transports on the same service can use different local addresses.
%% The local addresses are put into Host-IP-Address avps here when
@@ -164,18 +174,56 @@ i({WPid, T, Opts, #diameter_service{capabilities = Caps} = Svc0}) ->
%% watchdog start (start/2) succeeds regardless so as not to crash the
%% service.
-start_transport(T, Opts, Svc) ->
- case diameter_peer:start(T, Opts, Svc) of
- {ok, TPid} ->
- {ok, TPid, Svc};
- {ok, TPid, [_|_] = Addrs} ->
- #diameter_service{capabilities = Caps0} = Svc,
- Caps = Caps0#diameter_caps{host_ip_address = Addrs},
- {ok, TPid, Svc#diameter_service{capabilities = Caps}};
+start_transport(T, Opts, #diameter_service{capabilities = Caps} = Svc) ->
+ Addrs0 = Caps#diameter_caps.host_ip_address,
+ start_transport(Addrs0, {T, Opts, Svc}).
+
+start_transport(Addrs0, T) ->
+ case diameter_peer:start(T) of
+ {TPid, Addrs, Tmo, Data} ->
+ erlang:monitor(process, TPid),
+ q_next(TPid, Addrs0, Tmo, Data),
+ {TPid, addrs(Addrs, Addrs0)};
No ->
exit({shutdown, No})
end.
+addrs([], Addrs0) ->
+ Addrs0;
+addrs(Addrs, _) ->
+ Addrs.
+
+svc(Svc, []) ->
+ Svc;
+svc(Svc, Addrs) ->
+ readdr(Svc, Addrs).
+
+readdr(#diameter_service{capabilities = Caps0} = Svc, Addrs) ->
+ Caps = Caps0#diameter_caps{host_ip_address = Addrs},
+ Svc#diameter_service{capabilities = Caps}.
+
+%% The 4-tuple Data returned from diameter_peer:start/1 identifies the
+%% transport module/config use to start the transport process in
+%% question as well as any alternates to try if a connection isn't
+%% established within Tmo.
+q_next(TPid, Addrs0, Tmo, {_,_,_,_} = Data) ->
+ send_after(Tmo, {connection_timeout, TPid}),
+ putr(?Q_KEY, {Addrs0, Tmo, Data}).
+
+%% Connection has been established: retain the started
+%% pid/module/config in the process dictionary. This is a part of the
+%% interface defined by this module, so that the transport pid can be
+%% found when constructing service_info (in order to extract further
+%% information from it).
+keep_transport(TPid) ->
+ {_, _, {{_,_,_} = T, _, _, _}} = eraser(?Q_KEY),
+ putr(?START_KEY, {TPid, T}).
+
+send_after(infinity, _) ->
+ ok;
+send_after(Tmo, T) ->
+ erlang:send_after(Tmo, self(), T).
+
%% handle_call/3
handle_call(_, _, State) ->
@@ -202,14 +250,27 @@ handle_info(T, #state{} = State) ->
?LOG(stop, T),
x(T, State)
catch
+ exit: {diameter_codec, encode, _} = Reason ->
+ close_wd(Reason, State#state.parent),
+ ?LOG(stop, Reason),
+ %% diameter_codec:encode/2 emits an error report. Only
+ %% indicate the probable reason here.
+ diameter_lib:info_report(probable_configuration_error,
+ insufficient_capabilities),
+ {stop, {shutdown, Reason}, State};
{?MODULE, Tag, Reason} ->
?LOG(Tag, {Reason, T}),
{stop, {shutdown, Reason}, State}
end.
-%% The form of the exception caught here is historical. It's
+%% The form of the throw caught here is historical. It's
%% significant that it's not a 2-tuple, as in ?FAILURE(Reason),
%% since these are caught elsewhere.
+%% Note that there's no guarantee that the service and transport
+%% capabilities are good enough to build a CER/CEA that can be
+%% succesfully encoded. It's not checked at diameter:add_transport/2
+%% since this can be called before creating the service.
+
x(Reason, #state{} = S) ->
close_wd(Reason, S),
{stop, {shutdown, Reason}, S}.
@@ -240,25 +301,48 @@ eraser(Key) ->
%% Connection to peer.
transition({diameter, {TPid, connected, Remote}},
- #state{state = PS,
+ #state{transport = TPid,
+ state = PS,
mode = M}
= S) ->
'Wait-Conn-Ack' = PS, %% assert
connect = M, %%
- send_CER(S#state{mode = {M, Remote},
- transport = TPid});
+ keep_transport(TPid),
+ send_CER(S#state{mode = {M, Remote}});
%% Connection from peer.
transition({diameter, {TPid, connected}},
- #state{state = PS,
+ #state{transport = TPid,
+ state = PS,
mode = M,
parent = Pid}
= S) ->
'Wait-Conn-Ack' = PS, %% assert
accept = M, %%
+ keep_transport(TPid),
Pid ! {accepted, self()},
- start_timer(S#state{state = recv_CER,
- transport = TPid});
+ start_timer(S#state{state = recv_CER});
+
+%% Connection established after receiving a connection_timeout
+%% message. This may be followed by an incoming message which arrived
+%% before the transport was killed and this can't be distinguished
+%% from one from the transport that's been started to replace it.
+transition({diameter, {_, connected}}, _) ->
+ {stop, connection_timeout};
+transition({diameter, {_, connected, _}}, _) ->
+ {stop, connection_timeout};
+
+%% Connection has timed out: start an alternate.
+transition({connection_timeout = T, TPid},
+ #state{transport = TPid,
+ state = 'Wait-Conn-Ack'}
+ = S) ->
+ exit(TPid, {shutdown, T}),
+ start_next(S);
+
+%% Connect timeout after connection or alternate start: ignore.
+transition({connection_timeout, _}, _) ->
+ ok;
%% Incoming message from the transport.
transition({diameter, {recv, Pkt}}, S) ->
@@ -305,14 +389,21 @@ transition({resolve_port, _Pid} = T, #state{transport = TPid}) ->
TPid ! T,
ok;
-%% Parent or transport has died.
-transition({'DOWN', _, process, P, _},
- #state{parent = Pid,
- transport = TPid})
- when P == Pid;
- P == TPid ->
+%% Parent has died.
+transition({'DOWN', _, process, WPid, _},
+ #state{parent = WPid}) ->
stop;
+%% Transport has died before connection timeout.
+transition({'DOWN', _, process, TPid, _},
+ #state{transport = TPid}
+ = S) ->
+ start_next(S);
+
+%% Transport has died after connection timeout.
+transition({'DOWN', _, process, _, _}, _) ->
+ ok;
+
%% State query.
transition({state, Pid}, #state{state = S, transport = TPid}) ->
Pid ! {self(), [S, TPid]},
@@ -320,6 +411,19 @@ transition({state, Pid}, #state{state = S, transport = TPid}) ->
%% Crash on anything unexpected.
+%% start_next/1
+
+start_next(#state{service = Svc0} = S) ->
+ case getr(?Q_KEY) of
+ {Addrs0, Tmo, Data} ->
+ Svc = readdr(Svc0, Addrs0),
+ {TPid, Addrs} = start_transport(Addrs0, {Svc, Tmo, Data}),
+ S#state{transport = TPid,
+ service = svc(Svc, Addrs)};
+ undefined ->
+ stop
+ end.
+
%% send_CER/1
send_CER(#state{mode = {connect, Remote},
@@ -649,7 +753,7 @@ rc([RC|_]) ->
%% answer/2
answer('DWR', _) ->
- getr(dwa);
+ getr(?DWA_KEY);
answer(Name, #state{service = #diameter_service{capabilities = Caps}}) ->
a(Name, Caps).
@@ -749,15 +853,15 @@ caps(#state{service = Svc}) ->
%% caps_cb/1
caps_cb(Caps) ->
- {Ref, Ts} = eraser(capabilities_cb),
- ccb(Ts, [Ref, Caps]).
+ {Ref, Ts} = eraser(?CB_KEY),
+ caps_cb(Ts, [Ref, Caps]).
-ccb([], _) ->
+caps_cb([], _) ->
ok;
-ccb([F | Rest], T) ->
+caps_cb([F | Rest], T) ->
case diameter_lib:eval([F|T]) of
ok ->
- ccb(Rest, T);
+ caps_cb(Rest, T);
N when ?IS_SUCCESS(N) -> %% 2xxx result code: accept immediately
N;
Res ->
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl
index 3dfdcee2b2..725cccda1e 100644
--- a/lib/diameter/src/base/diameter_service.erl
+++ b/lib/diameter/src/base/diameter_service.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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,8 +43,7 @@
subscriptions/0,
services/0,
services/1,
- whois/1,
- flush_stats/1]).
+ whois/1]).
%% test/debug
-export([call_module/3,
@@ -65,13 +64,33 @@
-include_lib("diameter/include/diameter.hrl").
-include("diameter_internal.hrl").
+%% The "old" states maintained in this module historically.
-define(STATE_UP, up).
-define(STATE_DOWN, down).
+-type op_state() :: ?STATE_UP
+ | ?STATE_DOWN.
+
+%% The RFC 3539 watchdog states that are now maintained, albeit
+%% along with the old up/down. okay = up, else down.
+-define(WD_INITIAL, initial).
+-define(WD_OKAY, okay).
+-define(WD_SUSPECT, suspect).
+-define(WD_DOWN, down).
+-define(WD_REOPEN, reopen).
+
+-type wd_state() :: ?WD_INITIAL
+ | ?WD_OKAY
+ | ?WD_SUSPECT
+ | ?WD_DOWN
+ | ?WD_REOPEN.
+
-define(DEFAULT_TC, 30000). %% RFC 3588 ch 2.1
-define(DEFAULT_TIMEOUT, 5000). %% for outgoing requests
-define(RESTART_TC, 1000). %% if restart was this recent
+-define(RELAY, ?DIAMETER_DICT_RELAY).
+
%% Used to be able to swap this with anything else dict-like but now
%% rely on the fact that a service's #state{} record does not change
%% in storing in it ?STATE table and not always going through the
@@ -117,7 +136,8 @@
type :: match(connect | accept),
ref :: match(reference()), %% key into diameter_config
options :: match([diameter:transport_opt()]),%% from start_transport
- op_state = ?STATE_DOWN :: match(?STATE_DOWN | ?STATE_UP),
+ op_state = {?STATE_DOWN, ?WD_INITIAL}
+ :: match(op_state() | {op_state(), wd_state()}),
started = now(), %% at process start
conn = false :: match(boolean() | pid())}).
%% true at accept, pid() at connection_up (connT key)
@@ -388,15 +408,6 @@ whois(SvcName) ->
undefined
end.
-%%% ---------------------------------------------------------------------------
-%%% # flush_stats/1
-%%%
-%%% Output: list of {{SvcName, Alias, Counter}, Value}
-%%% ---------------------------------------------------------------------------
-
-flush_stats(TPid) ->
- diameter_stats:flush(TPid).
-
%% ===========================================================================
%% ===========================================================================
@@ -516,6 +527,34 @@ transition({reconnect, Pid}, S) ->
reconnect(Pid, S),
ok;
+%% Watchdog is sending notification of a state transition. Note that
+%% the connection_up/down messages are pre-date this message and are
+%% still used. A 'watchdog' message will follow these and communicate
+%% the same state as was set in handling connection_up/down.
+transition({watchdog, Pid, {TPid, From, To}}, #state{service_name = SvcName,
+ peerT = PeerT}) ->
+ #peer{ref = Ref, type = T, options = Opts, op_state = {OS,_}}
+ = P
+ = fetch(PeerT, Pid),
+ insert(PeerT, P#peer{op_state = {OS, To}}),
+ send_event(SvcName, {watchdog, Ref, TPid, {From, To}, {T, Opts}}),
+ ok;
+%% Death of a peer process results in the removal of it's peer and any
+%% associated conn record when 'DOWN' is received (after this) but the
+%% states will be {?STATE_UP, ?WD_DOWN} for a short time. (No real
+%% problem since ?WD_* is only used in service_info.) We set ?WD_OKAY
+%% as a consequence of connection_up since we know a watchdog is
+%% coming. We can't set anything at connection_down since we don't
+%% know if the subsequent watchdog message will be ?WD_DOWN or
+%% ?WD_SUSPECT. We don't (yet) set ?STATE_* as a consequence of a
+%% watchdog message since this requires changing some of the matching
+%% on ?STATE_*.
+%%
+%% Death of a conn process results in connection_down followed by
+%% watchdog ?WD_DOWN. The latter doesn't result in the conn record
+%% being deleted since 'DOWN' from death of its peer doesn't (yet)
+%% deal with the record having been removed.
+
%% Monitor process has died. Just die with a reason that tells
%% diameter_config about the happening. If a cleaner shutdown is
%% required then someone should stop us.
@@ -879,7 +918,14 @@ accepted(Pid, _TPid, #state{peerT = PeerT} = S) ->
fetch(Tid, Key) ->
[T] = ets:lookup(Tid, Key),
- T.
+ case T of
+ #peer{op_state = ?STATE_UP} = P ->
+ P#peer{op_state = {?STATE_UP, ?WD_OKAY}};
+ #peer{op_state = ?STATE_DOWN} = P ->
+ P#peer{op_state = {?STATE_DOWN, ?WD_DOWN}};
+ _ ->
+ T
+ end.
%%% ---------------------------------------------------------------------------
%%% # connection_up/3
@@ -925,12 +971,12 @@ connection_up(T, P, C, #state{peerT = PeerT,
service
= #diameter_service{applications = Apps}}
= S) ->
- #peer{conn = TPid, op_state = ?STATE_DOWN}
+ #peer{conn = TPid, op_state = {?STATE_DOWN, _}}
= P,
#conn{apps = SApps, caps = Caps}
= C,
- insert(PeerT, P#peer{op_state = ?STATE_UP}),
+ insert(PeerT, P#peer{op_state = {?STATE_UP, ?WD_OKAY}}),
request_peer_up(TPid),
report_status(up, P, C, S, T),
@@ -945,27 +991,35 @@ ilp({Id, Alias}, {TC, SA}, LDict) ->
init_conn(Id, Alias, TC, SA),
?Dict:append(Alias, TC, LDict).
-init_conn(Id, Alias, TC, {SvcName, Apps}) ->
+init_conn(Id, Alias, {TPid, _} = TC, {SvcName, Apps}) ->
#diameter_app{module = ModX,
id = Id} %% assert
= find_app(Alias, Apps),
- peer_cb({ModX, peer_up, [SvcName, TC]}, Alias).
+ peer_cb({ModX, peer_up, [SvcName, TC]}, Alias)
+ orelse exit(TPid, kill). %% fake transport failure
+
+%% find_app/2
find_app(Alias, Apps) ->
- lists:keyfind(Alias, #diameter_app.alias, Apps).
+ case lists:keyfind(Alias, #diameter_app.alias, Apps) of
+ #diameter_app{options = E} = A when is_atom(E) -> %% upgrade
+ A#diameter_app{options = [{answer_errors, E}]};
+ A ->
+ A
+ end.
-%% A failing peer callback brings down the service. In the case of
-%% peer_up we could just kill the transport and emit an error but for
-%% peer_down we have no way to cleanup any state change that peer_up
-%% may have introduced.
+%% Don't bring down the service (and all associated connections)
+%% regardless of what happens.
peer_cb(MFA, Alias) ->
try state_cb(MFA, Alias) of
ModS ->
- mod_state(Alias, ModS)
+ mod_state(Alias, ModS),
+ true
catch
- E: Reason ->
- ?ERROR({E, Reason, MFA, ?STACK})
+ E:R ->
+ diameter_lib:error_report({failure, {E, R, Alias, ?STACK}}, MFA),
+ false
end.
%%% ---------------------------------------------------------------------------
@@ -979,22 +1033,22 @@ peer_cb(MFA, Alias) ->
connection_down(Pid, #state{peerT = PeerT,
connT = ConnT}
= S) ->
- #peer{op_state = ?STATE_UP, %% assert
+ #peer{op_state = {?STATE_UP, WS}, %% assert
conn = TPid}
= P
= fetch(PeerT, Pid),
C = fetch(ConnT, TPid),
- insert(PeerT, P#peer{op_state = ?STATE_DOWN}),
+ insert(PeerT, P#peer{op_state = {?STATE_DOWN, WS}}),
connection_down(P,C,S).
%% connection_down/3
-connection_down(#peer{op_state = ?STATE_DOWN}, _, S) ->
+connection_down(#peer{op_state = {?STATE_DOWN, _}}, _, S) ->
S;
connection_down(#peer{conn = TPid,
- op_state = ?STATE_UP}
+ op_state = {?STATE_UP, _}}
= P,
#conn{caps = Caps,
apps = SApps}
@@ -1043,7 +1097,7 @@ peer_down(Pid, Reason, #state{peerT = PeerT} = S) ->
%% Send an event at connection establishment failure.
closed({shutdown, {close, _TPid, Reason}},
- #peer{op_state = ?STATE_DOWN,
+ #peer{op_state = {?STATE_DOWN, _},
ref = Ref,
type = Type,
options = Opts},
@@ -1352,7 +1406,7 @@ send_request(Pkt, TPid, Caps, App, Opts, Caller, SvcName) ->
#diameter_app{alias = Alias,
dictionary = Dict,
module = ModX,
- answer_errors = AE}
+ options = [{answer_errors, AE} | _]}
= App,
EPkt = encode(Dict, Pkt),
@@ -1935,6 +1989,12 @@ is_loop(Code, Vid, OH, Avps) ->
%%
%% Send a locally originating reply.
+%% Skip the setting of Result-Code and Failed-AVP's below.
+reply([Msg], Dict, TPid, Pkt)
+ when is_list(Msg);
+ is_tuple(Msg) ->
+ reply(Msg, Dict, TPid, Pkt#diameter_packet{errors = []});
+
%% No errors or a diameter_header/avp list.
reply(Msg, Dict, TPid, #diameter_packet{errors = Es,
transport_data = TD}
@@ -1942,7 +2002,7 @@ reply(Msg, Dict, TPid, #diameter_packet{errors = Es,
when [] == Es;
is_record(hd(Msg), diameter_header) ->
Pkt = diameter_codec:encode(Dict, make_answer_packet(Msg, ReqPkt)),
- incr(send, Pkt, TPid), %% count result codes in sent answers
+ incr(send, Pkt, Dict, TPid), %% count result codes in sent answers
send(TPid, Pkt#diameter_packet{transport_data = TD});
%% Or not: set Result-Code and Failed-AVP AVP's.
@@ -1983,7 +2043,10 @@ rc(RC) ->
rc(Rec, RC, Failed, Dict)
when is_integer(RC) ->
- set(Rec, [{'Result-Code', RC} | failed_avp(Rec, Failed, Dict)], Dict).
+ set(Rec,
+ lists:append([rc(Rec, {'Result-Code', RC}, Dict),
+ failed_avp(Rec, Failed, Dict)]),
+ Dict).
%% Reply as name and tuple list ...
set([_|_] = Ans, Avps, _) ->
@@ -1993,6 +2056,22 @@ set([_|_] = Ans, Avps, _) ->
set(Rec, Avps, Dict) ->
Dict:'#set-'(Avps, Rec).
+%% rc/3
+%%
+%% Turn the result code into a list if its optional and only set it if
+%% the arity is 1 or {0,1}. In other cases (which probably shouldn't
+%% exist in practise) we can't know what's appropriate.
+
+rc([MsgName | _], {'Result-Code' = K, RC} = T, Dict) ->
+ case Dict:avp_arity(MsgName, 'Result-Code') of
+ 1 -> [T];
+ {0,1} -> [{K, [RC]}];
+ _ -> []
+ end;
+
+rc(Rec, T, Dict) ->
+ rc([Dict:rec2msg(element(1, Rec))], T, Dict).
+
%% failed_avp/3
failed_avp(_, [] = No, _) ->
@@ -2200,44 +2279,39 @@ handle_answer(SvcName, _, {error, Req, Reason}) ->
handle_answer(SvcName,
AnswerErrors,
{answer, #request{dictionary = Dict} = Req, Pkt}) ->
- a(examine(diameter_codec:decode(Dict, Pkt)),
- SvcName,
- AnswerErrors,
- Req).
+ answer(examine(diameter_codec:decode(Dict, Pkt)),
+ SvcName,
+ AnswerErrors,
+ Req).
%% We don't really need to do a full decode if we're a relay and will
%% just resend with a new hop by hop identifier, but might a proxy
%% want to examine the answer?
-a(#diameter_packet{errors = []}
- = Pkt,
- SvcName,
- AE,
- #request{transport = TPid,
- caps = Caps,
- packet = P}
- = Req) ->
+answer(Pkt, SvcName, AE, #request{transport = TPid,
+ dictionary = Dict}
+ = Req) ->
try
- incr(in, Pkt, TPid)
+ incr(recv, Pkt, Dict, TPid)
of
- _ ->
- cb(Req, handle_answer, [Pkt, msg(P), SvcName, {TPid, Caps}])
+ _ -> a(Pkt, SvcName, AE, Req)
catch
exit: {invalid_error_bit, _} = E ->
- e(Pkt#diameter_packet{errors = [E]}, SvcName, AE, Req)
- end;
-
-a(#diameter_packet{} = Pkt, SvcName, AE, Req) ->
- e(Pkt, SvcName, AE, Req).
+ a(Pkt#diameter_packet{errors = [E]}, SvcName, AE, Req)
+ end.
-e(Pkt, SvcName, callback, #request{transport = TPid,
- caps = Caps,
- packet = Pkt}
- = Req) ->
- cb(Req, handle_answer, [Pkt, msg(Pkt), SvcName, {TPid, Caps}]);
-e(Pkt, SvcName, report, Req) ->
+a(#diameter_packet{errors = Es} = Pkt, SvcName, AE, #request{transport = TPid,
+ caps = Caps,
+ packet = P}
+ = Req)
+ when [] == Es;
+ callback == AE ->
+ cb(Req, handle_answer, [Pkt, msg(P), SvcName, {TPid, Caps}]);
+
+a(Pkt, SvcName, report, Req) ->
x(errors, handle_answer, [SvcName, Req, Pkt]);
-e(Pkt, SvcName, discard, Req) ->
+
+a(Pkt, SvcName, discard, Req) ->
x({errors, handle_answer, [SvcName, Req, Pkt]}).
%% Note that we don't check that the application id in the answer's
@@ -2249,17 +2323,19 @@ e(Pkt, SvcName, discard, Req) ->
%% Increment a stats counter for an incoming or outgoing message.
%% TODO: fix
-incr(_, #diameter_packet{msg = undefined}, _) ->
+incr(_, #diameter_packet{msg = undefined}, _, _) ->
ok;
-incr(Dir, Pkt, TPid)
- when is_pid(TPid) ->
+incr(recv = D, #diameter_packet{header = H, errors = [_|_]}, _, TPid) ->
+ incr(TPid, {diameter_codec:msg_id(H), D, error});
+
+incr(Dir, Pkt, Dict, TPid) ->
#diameter_packet{header = #diameter_header{is_error = E}
= Hdr,
msg = Rec}
= Pkt,
- RC = int(get_avp_value(?BASE, 'Result-Code', Rec)),
+ RC = int(get_avp_value(Dict, 'Result-Code', Rec)),
PE = is_protocol_error(RC),
%% Check that the E bit is set only for 3xxx result codes.
@@ -2267,15 +2343,21 @@ incr(Dir, Pkt, TPid)
orelse (E andalso PE)
orelse x({invalid_error_bit, RC}, answer, [Dir, Pkt]),
- Ctr = rc_counter(Rec, RC),
- is_tuple(Ctr)
- andalso incr(TPid, {diameter_codec:msg_id(Hdr), Dir, Ctr}).
+ irc(TPid, Hdr, Dir, rc_counter(Dict, Rec, RC)).
+
+irc(_, _, _, undefined) ->
+ false;
+
+irc(TPid, Hdr, Dir, Ctr) ->
+ incr(TPid, {diameter_codec:msg_id(Hdr), Dir, Ctr}).
%% incr/2
incr(TPid, Counter) ->
diameter_stats:incr(Counter, TPid, 1).
+%% error_counter/2
+
%% RFC 3588, 7.6:
%%
%% All Diameter answer messages defined in vendor-specific
@@ -2285,26 +2367,27 @@ incr(TPid, Counter) ->
%% Maintain statistics assuming one or the other, not both, which is
%% surely the intent of the RFC.
-rc_counter(_, RC)
- when is_integer(RC) ->
- {'Result-Code', RC};
-rc_counter(Rec, _) ->
- rcc(get_avp_value(?BASE, 'Experimental-Result', Rec)).
+rc_counter(Dict, Rec, undefined) ->
+ er(get_avp_value(Dict, 'Experimental-Result', Rec));
+rc_counter(_, _, RC) ->
+ {'Result-Code', RC}.
%% Outgoing answers may be in any of the forms messages can be sent
%% in. Incoming messages will be records. We're assuming here that the
%% arity of the result code AVP's is 0 or 1.
-rcc([{_,_,RC} = T])
- when is_integer(RC) ->
+er([{_,_,N} = T | _])
+ when is_integer(N) ->
T;
-rcc({_,_,RC} = T)
- when is_integer(RC) ->
+er({_,_,N} = T)
+ when is_integer(N) ->
T;
-rcc(_) ->
+er(_) ->
undefined.
-int([N])
+%% Extract the first good looking integer. There's no guarantee
+%% that what we're looking for has arity 1.
+int([N|_])
when is_integer(N) ->
N;
int(N)
@@ -2349,8 +2432,11 @@ rt(#request{packet = #diameter_packet{msg = undefined}}, _) ->
false; %% TODO: Not what we should do.
%% ... or not.
-rt(#request{packet = #diameter_packet{msg = Msg}} = Req, S) ->
- find_transport(get_destination(Msg), Req, S).
+rt(#request{packet = #diameter_packet{msg = Msg},
+ dictionary = Dict}
+ = Req,
+ S) ->
+ find_transport(get_destination(Dict, Msg), Req, S).
%%% ---------------------------------------------------------------------------
%%% # report_status/5
@@ -2462,12 +2548,12 @@ find_transport({alias, Alias}, Msg, Opts, #state{service = Svc} = S) ->
find_transport(#diameter_app{} = App, Msg, Opts, S) ->
ft(App, Msg, Opts, S).
-ft(#diameter_app{module = Mod} = App, Msg, Opts, S) ->
+ft(#diameter_app{module = Mod, dictionary = Dict} = App, Msg, Opts, S) ->
#options{filter = Filter,
extra = Xtra}
= Opts,
pick_peer(App#diameter_app{module = Mod ++ Xtra},
- get_destination(Msg),
+ get_destination(Dict, Msg),
Filter,
S);
ft(false = No, _, _, _) ->
@@ -2503,11 +2589,11 @@ find_transport([_,_] = RH,
Filter,
S).
-%% get_destination/1
+%% get_destination/2
-get_destination(Msg) ->
- [str(get_avp_value(?BASE, 'Destination-Realm', Msg)),
- str(get_avp_value(?BASE, 'Destination-Host', Msg))].
+get_destination(Dict, Msg) ->
+ [str(get_avp_value(Dict, 'Destination-Realm', Msg)),
+ str(get_avp_value(Dict, 'Destination-Host', Msg))].
%% This is not entirely correct. The avp could have an arity 1, in
%% which case an empty list is a DiameterIdentity of length 0 rather
@@ -2531,6 +2617,15 @@ str(T) ->
%% question. The third form allows messages to be sent as is, without
%% a dictionary, which is needed in the case of relay agents, for one.
+%% Messages will be header/avps list as a relay and the only AVP's we
+%% look for are in the common dictionary. This is required since the
+%% relay dictionary doesn't inherit the common dictionary (which maybe
+%% it should).
+get_avp_value(?RELAY, Name, Msg) ->
+ get_avp_value(?BASE, Name, Msg);
+
+%% Message sent as a header/avps list, probably a relay case but not
+%% necessarily.
get_avp_value(Dict, Name, [#diameter_header{} | Avps]) ->
try
{Code, _, VId} = Dict:avp_header(Name),
@@ -2544,6 +2639,7 @@ get_avp_value(Dict, Name, [#diameter_header{} | Avps]) ->
undefined
end;
+%% Outgoing message as a name/values list.
get_avp_value(_, Name, [_MsgName | Avps]) ->
case lists:keyfind(Name, 1, Avps) of
{_, V} ->
@@ -2552,6 +2648,11 @@ get_avp_value(_, Name, [_MsgName | Avps]) ->
undefined
end;
+%% Record might be an answer message in the common dictionary.
+get_avp_value(Dict, Name, Rec)
+ when Dict /= ?BASE, element(1, Rec) == 'diameter_base_answer-message' ->
+ get_avp_value(?BASE, Name, Rec);
+
%% Message is typically a record but not necessarily: diameter:call/4
%% can be passed an arbitrary term.
get_avp_value(Dict, Name, Rec) ->
@@ -2746,20 +2847,45 @@ transports(#state{peerT = PeerT}) ->
'Vendor-Specific-Application-Id',
'Firmware-Revision']).
+%% The config returned by diameter:service_info(SvcName, all).
-define(ALL_INFO, [capabilities,
applications,
transport,
- pending,
- statistics]).
+ pending]).
+
+%% The rest.
+-define(OTHER_INFO, [connections,
+ name,
+ peers,
+ statistics]).
-service_info(Items, S)
- when is_list(Items) ->
- [{complete(I), service_info(I,S)} || I <- Items];
service_info(Item, S)
when is_atom(Item) ->
- service_info(Item, S, true).
+ case tagged_info(Item, S) of
+ {_, T} -> T;
+ undefined = No -> No
+ end;
-service_info(Item, #state{service = Svc} = S, Complete) ->
+service_info(Items, S) ->
+ tagged_info(Items, S).
+
+tagged_info(Item, S)
+ when is_atom(Item) ->
+ case complete(Item) of
+ {value, I} ->
+ {I, complete_info(I,S)};
+ false ->
+ undefined
+ end;
+
+tagged_info(Items, S)
+ when is_list(Items) ->
+ [T || I <- Items, T <- [tagged_info(I,S)], T /= undefined, T /= []];
+
+tagged_info(_, _) ->
+ undefined.
+
+complete_info(Item, #state{service = Svc} = S) ->
case Item of
name ->
S#state.service_name;
@@ -2803,84 +2929,160 @@ service_info(Item, #state{service = Svc} = S, Complete) ->
applications -> info_apps(S);
transport -> info_transport(S);
pending -> info_pending(S);
- statistics -> info_stats(S);
- keys -> ?ALL_INFO ++ ?CAP_INFO; %% mostly for test
+ keys -> ?ALL_INFO ++ ?CAP_INFO ++ ?OTHER_INFO;
all -> service_info(?ALL_INFO, S);
- _ when Complete -> service_info(complete(Item), S, false);
- _ -> undefined
+ statistics -> info_stats(S);
+ connections -> info_connections(S);
+ peers -> info_peers(S)
end.
+complete(I)
+ when I == keys;
+ I == all ->
+ {value, I};
complete(Pre) ->
P = atom_to_list(Pre),
- case [I || I <- [name | ?ALL_INFO] ++ ?CAP_INFO,
+ case [I || I <- ?ALL_INFO ++ ?CAP_INFO ++ ?OTHER_INFO,
lists:prefix(P, atom_to_list(I))]
of
- [I] -> I;
- _ -> Pre
+ [I] -> {value, I};
+ _ -> false
end.
+%% info_stats/1
+
info_stats(#state{peerT = PeerT}) ->
- Peers = ets:select(PeerT, [{#peer{ref = '$1', conn = '$2', _ = '_'},
- [{'is_pid', '$2'}],
- [['$1', '$2']]}]),
- diameter_stats:read(lists:append(Peers)).
-%% TODO: include peer identities in return value
-
-info_transport(#state{peerT = PeerT, connT = ConnT}) ->
- dict:fold(fun it/3,
+ MatchSpec = [{#peer{ref = '$1', conn = '$2', _ = '_'},
+ [{'is_pid', '$2'}],
+ [['$1', '$2']]}],
+ diameter_stats:read(lists:append(ets:select(PeerT, MatchSpec))).
+
+%% info_transport/1
+%%
+%% One entry per configured transport. Statistics for each entry are
+%% the accumulated values for the ref and associated peer pids.
+
+info_transport(S) ->
+ PeerD = peer_dict(S, config_dict(S)),
+ RefsD = dict:map(fun(_, Ls) -> [P || L <- Ls, {peer, {P,_}} <- L] end,
+ PeerD),
+ Refs = lists:append(dict:fold(fun(R, Ps, A) -> [[R|Ps] | A] end,
+ [],
+ RefsD)),
+ Stats = diameter_stats:read(Refs),
+ dict:fold(fun(R, Ls, A) ->
+ Ps = dict:fetch(R, RefsD),
+ [[{ref, R} | transport(Ls)] ++ [stats([R|Ps], Stats)]
+ | A]
+ end,
[],
- ets:foldl(fun(T,A) -> it_acc(ConnT, A, T) end,
- dict:new(),
- PeerT)).
-
-it(Ref, [[{type, connect} | _] = L], Acc) ->
- [[{ref, Ref} | L] | Acc];
-it(Ref, [[{type, accept}, {options, Opts} | _] | _] = L, Acc) ->
- [[{ref, Ref},
- {type, listen},
- {options, Opts},
- {accept, [lists:nthtail(2,A) || A <- L]}]
- | Acc].
-%% Each entry has the same Opts. (TODO)
-
-it_acc(ConnT, Acc, #peer{pid = Pid,
- type = Type,
- ref = Ref,
- options = Opts,
- op_state = OS,
- started = T,
- conn = TPid}) ->
+ PeerD).
+
+%% Only a config entry for a listening transport: use it.
+transport([[{type, listen}, _] = L]) ->
+ L ++ [{accept, []}];
+
+%% Only one config or peer entry for a connecting transport: use it.
+transport([[{type, connect} | _] = L]) ->
+ L;
+
+%% Peer entries: discard config. Note that the peer entries have
+%% length at least 3.
+transport([[_,_] | L]) ->
+ transport(L);
+
+%% Possibly many peer entries for a listening transport. Note that all
+%% have the same options by construction, which is not terribly space
+%% efficient. (TODO: all entries for the same Ref should share options.)
+transport([[{type, accept}, {options, Opts} | _] | _] = Ls) ->
+ [{type, listen},
+ {options, Opts},
+ {accept, [lists:nthtail(2,L) || L <- Ls]}].
+
+peer_dict(#state{peerT = PeerT, connT = ConnT}, Dict0) ->
+ ets:foldl(fun(T,A) -> peer_acc(ConnT, A, T) end, Dict0, PeerT).
+
+peer_acc(ConnT, Acc, #peer{pid = Pid,
+ type = Type,
+ ref = Ref,
+ options = Opts,
+ op_state = OS,
+ started = T,
+ conn = TPid}) ->
+ WS = wd_state(OS),
dict:append(Ref,
[{type, Type},
{options, Opts},
- {watchdog, {Pid, T, OS}}
- | info_conn(ConnT, TPid)],
+ {watchdog, {Pid, T, WS}}
+ | info_conn(ConnT, TPid, WS /= ?WD_DOWN)],
Acc).
-info_conn(ConnT, TPid) ->
- info_conn(ets:lookup(ConnT, TPid)).
+info_conn(ConnT, TPid, true)
+ when is_pid(TPid) ->
+ info_conn(ets:lookup(ConnT, TPid));
+info_conn(_, _, _) ->
+ [].
+
+%% The point of extracting the config here is so that 'transport' info
+%% has one entry for each transport ref, the peer table only
+%% containing entries that have a living watchdog.
+
+config_dict(#state{service_name = SvcName}) ->
+ lists:foldl(fun config_acc/2,
+ dict:new(),
+ diameter_config:lookup(SvcName)).
+
+config_acc({Ref, T, Opts}, Dict)
+ when T == listen;
+ T == connect ->
+ dict:store(Ref, [[{type, T}, {options, Opts}]], Dict);
+config_acc(_, Dict) ->
+ Dict.
+
+wd_state({_,S}) ->
+ S;
+wd_state(?STATE_UP) ->
+ ?WD_OKAY;
+wd_state(?STATE_DOWN) ->
+ ?WD_DOWN.
info_conn([#conn{pid = Pid, apps = SApps, caps = Caps, started = T}]) ->
[{peer, {Pid, T}},
{apps, SApps},
- {caps, info_caps(Caps)}];
+ {caps, info_caps(Caps)}
+ | try [{port, info_port(Pid)}] catch _:_ -> [] end];
info_conn([] = No) ->
No.
+%% Extract information that the processes involved are expected to
+%% "publish" in their process dictionaries. Simple but backhanded.
+info_port(Pid) ->
+ {_, PD} = process_info(Pid, dictionary),
+ {_, T} = lists:keyfind({diameter_peer_fsm, start}, 1, PD),
+ {TPid, {_Type, TMod, _Cfg}} = T,
+ {_, TD} = process_info(TPid, dictionary),
+ {_, Data} = lists:keyfind({TMod, info}, 1, TD),
+ [{owner, TPid},
+ {module, TMod}
+ | try TMod:info(Data) catch _:_ -> [] end].
+
+%% Use the fields names from diameter_caps instead of
+%% diameter_base_CER to distinguish between the 2-tuple values
+%% compared to the single capabilities values. Note also that the
+%% returned list is tagged 'caps' rather than 'capabilities' to
+%% emphasize the difference.
info_caps(#diameter_caps{} = C) ->
lists:zip(record_info(fields, diameter_caps), tl(tuple_to_list(C))).
info_apps(#state{service = #diameter_service{applications = Apps}}) ->
lists:map(fun mk_app/1, Apps).
-mk_app(#diameter_app{alias = Alias,
- dictionary = Dict,
- module = ModX,
- id = Id}) ->
- [{alias, Alias},
- {dictionary, Dict},
- {module, ModX},
- {id, Id}].
+mk_app(#diameter_app{} = A) ->
+ lists:zip(record_info(fields, diameter_app), tl(tuple_to_list(A))).
+
+%% info_pending/1
+%%
+%% One entry for each outgoing request whose answer is outstanding.
info_pending(#state{} = S) ->
MatchSpec = [{{'$1',
@@ -2895,3 +3097,57 @@ info_pending(#state{} = S) ->
{{from, '$3'}}]}}]}],
ets:select(?REQUEST_TABLE, MatchSpec).
+
+%% info_connections/1
+%%
+%% One entry per transport connection. Statistics for each entry are
+%% for the peer pid only.
+
+info_connections(S) ->
+ ConnL = conn_list(S),
+ Stats = diameter_stats:read([P || L <- ConnL, {peer, {P,_}} <- L]),
+ [L ++ [stats([P], Stats)] || L <- ConnL, {peer, {P,_}} <- L].
+
+conn_list(S) ->
+ lists:append(dict:fold(fun conn_acc/3, [], peer_dict(S, dict:new()))).
+
+conn_acc(Ref, Peers, Acc) ->
+ [[[{ref, Ref} | L] || L <- Peers, lists:keymember(peer, 1, L)]
+ | Acc].
+
+stats(Refs, Stats) ->
+ {statistics, dict:to_list(lists:foldl(fun(R,D) ->
+ stats_acc(R, D, Stats)
+ end,
+ dict:new(),
+ Refs))}.
+
+stats_acc(Ref, Dict, Stats) ->
+ lists:foldl(fun({C,N}, D) -> dict:update_counter(C, N, D) end,
+ Dict,
+ proplists:get_value(Ref, Stats, [])).
+
+%% info_peers/1
+%%
+%% One entry per peer Origin-Host. Statistics for each entry are
+%% accumulated values for all peer pids.
+
+info_peers(S) ->
+ {PeerD, RefD} = lists:foldl(fun peer_acc/2,
+ {dict:new(), dict:new()},
+ conn_list(S)),
+ Refs = lists:append(dict:fold(fun(_, Rs, A) -> [Rs|A] end,
+ [],
+ RefD)),
+ Stats = diameter_stats:read(Refs),
+ dict:fold(fun(OH, Cs, A) ->
+ Rs = dict:fetch(OH, RefD),
+ [{OH, [{connections, Cs}, stats(Rs, Stats)]} | A]
+ end,
+ [],
+ PeerD).
+
+peer_acc(Peer, {PeerD, RefD}) ->
+ [{TPid, _}, [{origin_host, {_, OH}} | _]]
+ = [proplists:get_value(K, Peer) || K <- [peer, caps]],
+ {dict:append(OH, Peer, PeerD), dict:append(OH, TPid, RefD)}.
diff --git a/lib/diameter/src/base/diameter_stats.erl b/lib/diameter/src/base/diameter_stats.erl
index 71479afa95..70727d068e 100644
--- a/lib/diameter/src/base/diameter_stats.erl
+++ b/lib/diameter/src/base/diameter_stats.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -22,14 +22,13 @@
%%
-module(diameter_stats).
--compile({no_auto_import, [monitor/2]}).
-behaviour(gen_server).
--export([reg/1, reg/2,
- incr/1, incr/2, incr/3,
+-export([reg/2, reg/1,
+ incr/3, incr/1,
read/1,
- flush/0, flush/1]).
+ flush/1]).
%% supervisor callback
-export([start_link/0]).
@@ -48,123 +47,105 @@
-include("diameter_internal.hrl").
-%% ets table containing stats. reg(Pid, Ref) inserts a {Pid, Ref},
-%% incr(Counter, X, N) updates the counter keyed at {Counter, X}, and
-%% Pid death causes counters keyed on {Counter, Pid} to be deleted and
-%% added to those keyed on {Counter, Ref}.
+%% ets table containing 2-tuple stats. reg(Pid, Ref) inserts a {Pid,
+%% Ref}, incr(Counter, X, N) updates the counter keyed at {Counter,
+%% X}, and Pid death causes counters keyed on {Counter, Pid} to be
+%% deleted and added to those keyed on {Counter, Ref}.
-define(TABLE, ?MODULE).
%% Name of registered server.
-define(SERVER, ?MODULE).
-%% Entries in the table.
--define(REC(Key, Value), {Key, Value}).
-
%% Server state.
-record(state, {id = now()}).
-type counter() :: any().
--type contrib() :: any().
-
-%%% ---------------------------------------------------------------------------
-%%% # reg(Pid, Contrib)
-%%%
-%%% Description: Register a process as a contributor of statistics
-%%% associated with a specified term. Statistics can be
-%%% contributed by specifying either Pid or Contrib as
-%%% the second argument to incr/3. Statistics contributed
-%%% by Pid are folded into the corresponding entry for
-%%% Contrib when the process dies.
-%%%
-%%% Contrib can be any term but should not be a pid
-%%% passed as the first argument to reg/2. Subsequent
-%%% registrations for the same Pid overwrite the association
-%%% ---------------------------------------------------------------------------
-
--spec reg(pid(), contrib())
- -> true.
+-type ref() :: any().
+
+%% ---------------------------------------------------------------------------
+%% # reg(Pid, Ref)
+%%
+%% Register a process as a contributor of statistics associated with a
+%% specified term. Statistics can be contributed by specifying either
+%% Pid or Ref as the second argument to incr/3. Statistics contributed
+%% by Pid are folded into the corresponding entry for Ref when the
+%% process dies.
+%% ---------------------------------------------------------------------------
+
+-spec reg(pid(), ref())
+ -> boolean().
-reg(Pid, Contrib)
+reg(Pid, Ref)
when is_pid(Pid) ->
- call({reg, Pid, Contrib}).
+ call({reg, Pid, Ref}).
--spec reg(contrib())
+-spec reg(ref())
-> true.
reg(Ref) ->
reg(self(), Ref).
-%%% ---------------------------------------------------------------------------
-%%% # incr(Counter, Contrib, N)
-%%%
-%%% Description: Increment a counter for the specified contributor.
-%%%
-%%% Contrib will typically be an argument passed to reg/2
-%%% but there's nothing that requires this. In particular,
-%%% if Contrib is a pid that hasn't been registered then
-%%% counters are unaffected by the death of the process.
-%%% ---------------------------------------------------------------------------
-
--spec incr(counter(), contrib(), integer())
- -> integer().
+%% ---------------------------------------------------------------------------
+%% # incr(Counter, Ref, N)
+%%
+%% Increment a counter for the specified contributor.
+%%
+%% Ref will typically be an argument passed to reg/2 but there's
+%% nothing that requires this. Only registered pids can contribute
+%% counters however, otherwise incr/3 is a no-op.
+%% ---------------------------------------------------------------------------
-incr(Ctr, Contrib, N) ->
- update_counter({Ctr, Contrib}, N).
+-spec incr(counter(), ref(), integer())
+ -> integer() | false.
-incr(Ctr, N)
+incr(Ctr, Ref, N)
when is_integer(N) ->
- incr(Ctr, self(), N);
-
-incr(Ctr, Contrib) ->
- incr(Ctr, Contrib, 1).
+ update_counter({Ctr, Ref}, N).
incr(Ctr) ->
incr(Ctr, self(), 1).
-%%% ---------------------------------------------------------------------------
-%%% # read(Contribs)
-%%%
-%%% Description: Retrieve counters for the specified contributors.
-%%% ---------------------------------------------------------------------------
+%% ---------------------------------------------------------------------------
+%% # read(Refs)
+%%
+%% Retrieve counters for the specified contributors.
+%% ---------------------------------------------------------------------------
--spec read([contrib()])
- -> [{contrib(), [{counter(), integer()}]}].
+-spec read([ref()])
+ -> [{ref(), [{counter(), integer()}]}].
-read(Contribs) ->
- lists:foldl(fun(?REC({T,C}, N), D) -> orddict:append(C, {T,N}, D) end,
+read(Refs) ->
+ read(Refs, false).
+
+read(Refs, B) ->
+ MatchSpec = [{{{'_', '$1'}, '_'},
+ [?ORCOND([{'=:=', '$1', {const, R}}
+ || R <- Refs])],
+ ['$_']}],
+ L = ets:select(?TABLE, MatchSpec),
+ B andalso delete(L),
+ lists:foldl(fun({{C,R}, N}, D) -> orddict:append(R, {C,N}, D) end,
orddict:new(),
- ets:select(?TABLE, [{?REC({'_', '$1'}, '_'),
- [?ORCOND([{'=:=', '$1', {const, C}}
- || C <- Contribs])],
- ['$_']}])).
-
-%%% ---------------------------------------------------------------------------
-%%% # flush(Contrib)
-%%%
-%%% Description: Retrieve and delete statistics for the specified
-%%% contributor.
-%%%
-%%% If Contrib is a pid registered with reg/2 then statistics
-%%% for both and its associated contributor are retrieved.
-%%% ---------------------------------------------------------------------------
-
--spec flush(contrib())
- -> [{counter(), integer()}].
+ L).
+
+%% ---------------------------------------------------------------------------
+%% # flush(Refs)
+%%
+%% Retrieve and delete statistics for the specified contributors.
+%% ---------------------------------------------------------------------------
+
+-spec flush([ref()])
+ -> [{ref(), {counter(), integer()}}].
-flush(Contrib) ->
+flush(Refs) ->
try
- call({flush, Contrib})
+ call({flush, Refs})
catch
exit: _ ->
[]
end.
-flush() ->
- flush(self()).
-
-%%% ---------------------------------------------------------
-%%% EXPORTED INTERNAL FUNCTIONS
-%%% ---------------------------------------------------------
+%% ===========================================================================
start_link() ->
ServerName = {local, ?SERVER},
@@ -179,18 +160,16 @@ state() ->
uptime() ->
call(uptime).
-%%% ----------------------------------------------------------
-%%% # init(_)
-%%%
-%%% Output: {ok, State}
-%%% ----------------------------------------------------------
+%% ----------------------------------------------------------
+%% # init/1
+%% ----------------------------------------------------------
init([]) ->
ets:new(?TABLE, [named_table, ordered_set, public]),
{ok, #state{}}.
%% ----------------------------------------------------------
-%% handle_call(Request, From, State)
+%% # handle_call/3
%% ----------------------------------------------------------
handle_call(state, _, State) ->
@@ -199,31 +178,31 @@ handle_call(state, _, State) ->
handle_call(uptime, _, #state{id = Time} = State) ->
{reply, diameter_lib:now_diff(Time), State};
-handle_call({reg, Pid, Contrib}, _From, State) ->
- monitor(not ets:member(?TABLE, Pid), Pid),
- {reply, insert(?REC(Pid, Contrib)), State};
+handle_call({incr, T}, _, State) ->
+ {reply, update_counter(T), State};
-handle_call({flush, Contrib}, _From, State) ->
- {reply, fetch(Contrib), State};
+handle_call({reg, Pid, Ref}, _From, State) ->
+ B = ets:insert_new(?TABLE, {Pid, Ref}),
+ B andalso erlang:monitor(process, Pid),
+ {reply, B, State};
+
+handle_call({flush, Refs}, _From, State) ->
+ {reply, read(Refs, true), State};
handle_call(Req, From, State) ->
?UNEXPECTED([Req, From]),
{reply, nok, State}.
%% ----------------------------------------------------------
-%% handle_cast(Request, State)
+%% # handle_cast/2
%% ----------------------------------------------------------
-handle_cast({incr, Rec}, State) ->
- update_counter(Rec),
- {noreply, State};
-
handle_cast(Msg, State) ->
?UNEXPECTED([Msg]),
{noreply, State}.
%% ----------------------------------------------------------
-%% handle_info(Request, State)
+%% # handle_info/2
%% ----------------------------------------------------------
handle_info({'DOWN', _MRef, process, Pid, _}, State) ->
@@ -235,91 +214,62 @@ handle_info(Info, State) ->
{noreply, State}.
%% ----------------------------------------------------------
-%% terminate(Reason, State)
+%% # terminate/2
%% ----------------------------------------------------------
terminate(_Reason, _State) ->
ok.
%% ----------------------------------------------------------
-%% code_change(OldVsn, State, Extra)
+%% # code_change/3
%% ----------------------------------------------------------
code_change(_OldVsn, State, _Extra) ->
{ok, State}.
-%%% ---------------------------------------------------------
-%%% INTERNAL FUNCTIONS
-%%% ---------------------------------------------------------
-
-%% monitor/2
-
-monitor(true, Pid) ->
- erlang:monitor(process, Pid);
-monitor(false = No, _) ->
- No.
+%% ===========================================================================
%% down/1
down(Pid) ->
- L = ets:match_object(?TABLE, ?REC({'_', Pid}, '_')),
- [?REC(_, Ref) = T] = lookup(Pid),
+ down(lookup(Pid), ets:match_object(?TABLE, {{'_', Pid}, '_'})).
+
+down([{_, Ref} = T], L) ->
fold(Ref, L),
- delete_object(T),
+ delete([T|L]);
+down([], L) -> %% flushed
delete(L).
-%% Fold Pid-based entries into Ref-based ones.
+%% Fold pid-based entries into ref-based ones.
fold(Ref, L) ->
- lists:foreach(fun(?REC({K, _}, V)) -> update_counter({{K, Ref}, V}) end,
- L).
-
-delete(Objs) ->
- lists:foreach(fun delete_object/1, Objs).
-
-%% fetch/1
-
-fetch(X) ->
- MatchSpec = [{?REC({'_', '$1'}, '_'),
- [?ORCOND([{'==', '$1', {const, T}} || T <- [X | ref(X)]])],
- ['$_']}],
- L = ets:select(?TABLE, MatchSpec),
- delete(L),
- D = lists:foldl(fun sum/2, dict:new(), L),
- dict:to_list(D).
-
-sum({{Ctr, _}, N}, Dict) ->
- dict:update(Ctr, fun(V) -> V+N end, N, Dict).
-
-ref(Pid)
- when is_pid(Pid) ->
- ets:select(?TABLE, [{?REC(Pid, '$1'), [], ['$1']}]);
-ref(_) ->
- [].
+ lists:foreach(fun({{K, _}, V}) -> update_counter({{K, Ref}, V}) end, L).
%% update_counter/2
%%
-%% From an arbitrary request process. Cast to the server process to
-%% insert a new element if the counter doesn't exists so that two
-%% processes don't do so simultaneously.
+%% From an arbitrary process. Call to the server process to insert a
+%% new element if the counter doesn't exists so that two processes
+%% don't insert simultaneously.
update_counter(Key, N) ->
try
ets:update_counter(?TABLE, Key, N)
catch
error: badarg ->
- cast({incr, ?REC(Key, N)})
+ call({incr, {Key, N}})
end.
%% update_counter/1
%%
-%% From the server process.
+%% From the server process, when update_counter/2 failed due to a
+%% non-existent entry.
-update_counter(?REC(Key, N) = T) ->
+update_counter({{_Ctr, Ref} = Key, N} = T) ->
try
ets:update_counter(?TABLE, Key, N)
catch
error: badarg ->
- insert(T)
+ (not is_pid(Ref) orelse ets:member(?TABLE, Ref))
+ andalso begin insert(T), N end
end.
insert(T) ->
@@ -328,13 +278,8 @@ insert(T) ->
lookup(Key) ->
ets:lookup(?TABLE, Key).
-delete_object(T) ->
- ets:delete_object(?TABLE, T).
-
-%% cast/1
-
-cast(Msg) ->
- gen_server:cast(?SERVER, Msg).
+delete(Objs) ->
+ lists:foreach(fun({K,_}) -> ets:delete(?TABLE, K) end, Objs).
%% call/1
diff --git a/lib/diameter/src/base/diameter_watchdog.erl b/lib/diameter/src/base/diameter_watchdog.erl
index fb22fd8275..d7474e5c56 100644
--- a/lib/diameter/src/base/diameter_watchdog.erl
+++ b/lib/diameter/src/base/diameter_watchdog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -54,7 +54,7 @@
%% number of DWAs received during reopen
%% end PCB
parent = self() :: pid(),
- transport :: pid(),
+ transport :: pid() | undefined,
tref :: reference(), %% reference for current watchdog timer
message_data}). %% term passed into diameter_service with message
@@ -64,6 +64,13 @@
%% that a failed capabilities exchange produces the desired exit
%% reason.
+-spec start(Type, {RecvData, [Opt], SvcName, #diameter_service{}})
+ -> {reference(), pid()}
+ when Type :: {connect|accept, diameter:transport_ref()},
+ RecvData :: term(),
+ Opt :: diameter:transport_opt(),
+ SvcName :: diameter:service_name().
+
start({_,_} = Type, T) ->
Ref = make_ref(),
{ok, Pid} = diameter_watchdog_sup:start_child({Ref, {Type, self(), T}}),
@@ -102,7 +109,7 @@ i({_, Pid, _} = T) -> %% from old code
erlang:monitor(process, Pid),
make_state(T).
-make_state({T, Pid, {ConnT,
+make_state({T, Pid, {RecvData,
Opts,
SvcName,
#diameter_service{applications = Apps,
@@ -116,7 +123,7 @@ make_state({T, Pid, {ConnT,
tw = proplists:get_value(watchdog_timer,
Opts,
?DEFAULT_TW_INIT),
- message_data = {ConnT, SvcName, Apps}}.
+ message_data = {RecvData, SvcName, Apps}}.
%% handle_call/3
@@ -134,14 +141,36 @@ handle_info(T, State) ->
case transition(T, State) of
ok ->
{noreply, State};
- #watchdog{status = X} = S ->
- ?LOGC(X =/= State#watchdog.status, transition, X),
+ #watchdog{} = S ->
+ event(State, S),
{noreply, S};
stop ->
?LOG(stop, T),
+ event(State, State#watchdog{status = down}),
{stop, {shutdown, T}, State}
end.
+event(#watchdog{status = T}, #watchdog{status = T}) ->
+ ok;
+
+event(#watchdog{transport = undefined}, #watchdog{transport = undefined}) ->
+ ok;
+
+event(#watchdog{status = From, transport = F, parent = Pid},
+ #watchdog{status = To, transport = T}) ->
+ E = {tpid(F,T), From, To},
+ notify(Pid, E),
+ ?LOG(transition, {self(), E}).
+
+tpid(_, Pid)
+ when is_pid(Pid) ->
+ Pid;
+tpid(Pid, _) ->
+ Pid.
+
+notify(Pid, E) ->
+ Pid ! {watchdog, self(), E}.
+
%% terminate/2
terminate(_, _) ->
@@ -251,8 +280,8 @@ transition({'DOWN', _, process, TPid, _},
status = initial}) ->
stop;
-transition({'DOWN', _, process, Pid, _},
- #watchdog{transport = Pid}
+transition({'DOWN', _, process, TPid, _},
+ #watchdog{transport = TPid}
= S) ->
failover(S),
close(S),
@@ -385,7 +414,7 @@ recv(Name, Pkt, S) ->
rcv(Name, Pkt, S),
NS
catch
- throw: {?MODULE, throwaway, #watchdog{} = NS} ->
+ {?MODULE, throwaway, #watchdog{} = NS} ->
NS
end.
diff --git a/lib/diameter/src/modules.mk b/lib/diameter/src/modules.mk
index 7a700a6d53..01f9284881 100644
--- a/lib/diameter/src/modules.mk
+++ b/lib/diameter/src/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2011. All Rights Reserved.
+# Copyright Ericsson AB 2010-2012. 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
@@ -58,6 +58,7 @@ RT_MODULES = \
transport/diameter_tcp_sup \
transport/diameter_sctp \
transport/diameter_sctp_sup \
+ transport/diameter_transport \
transport/diameter_transport_sup
# Handwritten (compile time) modules not included in the app file.
diff --git a/lib/diameter/src/transport/diameter_etcp.erl b/lib/diameter/src/transport/diameter_etcp.erl
index d925d62545..cd62cf34fa 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -36,7 +36,9 @@
send/2,
close/1,
setopts/2,
- port/1]).
+ sockname/1,
+ peername/1,
+ getstat/1]).
%% child start
-export([start_link/1]).
@@ -113,10 +115,20 @@ close(Pid) ->
setopts(_, _) ->
ok.
-%% port/1
+%% sockname/1
-port(_) ->
- 3868. %% We have no local port: fake it.
+sockname(_) ->
+ {error, ?MODULE}.
+
+%% peername/1
+
+peername(_) ->
+ {error, ?MODULE}.
+
+%% getstat/1
+
+getstat(_) ->
+ {error, ?MODULE}.
%% start_link/1
diff --git a/lib/diameter/src/transport/diameter_sctp.erl b/lib/diameter/src/transport/diameter_sctp.erl
index 68b0342cd5..79b8b851fb 100644
--- a/lib/diameter/src/transport/diameter_sctp.erl
+++ b/lib/diameter/src/transport/diameter_sctp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -37,12 +37,18 @@
code_change/3,
terminate/2]).
+-export([info/1]). %% service_info callback
+
-export([ports/0,
ports/1]).
-include_lib("kernel/include/inet_sctp.hrl").
-include_lib("diameter/include/diameter.hrl").
+%% Keys into process dictionary.
+-define(INFO_KEY, info).
+-define(REF_KEY, ref).
+
-define(ERROR(T), erlang:error({T, ?MODULE, ?LINE})).
%% The default port for a listener.
@@ -62,6 +68,7 @@
-record(transport,
{parent :: pid(),
mode :: {accept, pid()}
+ | accept
| {connect, {list(inet:ip_address()), uint(), list()}}
%% {RAs, RP, Errors}
| connect,
@@ -134,6 +141,24 @@ start_link(T) ->
diameter_lib:spawn_opts(server, [])).
%% ---------------------------------------------------------------------------
+%% # info/1
+%% ---------------------------------------------------------------------------
+
+info({gen_sctp, Sock}) ->
+ lists:flatmap(fun(K) -> info(K, Sock) end,
+ [{socket, sockname},
+ {peer, peername},
+ {statistics, getstat}]).
+
+info({K,F}, Sock) ->
+ case inet:F(Sock) of
+ {ok, V} ->
+ [{K,V}];
+ _ ->
+ []
+ end.
+
+%% ---------------------------------------------------------------------------
%% # init/1
%% ---------------------------------------------------------------------------
@@ -157,7 +182,7 @@ i({connect, Pid, Opts, Addrs, Ref}) ->
RAs = [diameter_lib:ipaddr(A) || {raddr, A} <- As],
[RP] = [P || {rport, P} <- Ps] ++ [P || P <- [?DEFAULT_PORT], [] == Ps],
{LAs, Sock} = open(Addrs, Rest, 0),
- putr(ref, Ref),
+ putr(?REF_KEY, Ref),
proc_lib:init_ack({ok, self(), LAs}),
erlang:monitor(process, Pid),
#transport{parent = Pid,
@@ -169,7 +194,7 @@ i({connect, _, _, _} = T) -> %% from old code
%% An accepting transport spawned by diameter.
i({accept, Pid, LPid, Sock, Ref})
when is_pid(Pid) ->
- putr(ref, Ref),
+ putr(?REF_KEY, Ref),
proc_lib:init_ack({ok, self()}),
erlang:monitor(process, Pid),
erlang:monitor(process, LPid),
@@ -181,7 +206,7 @@ i({accept, _, _, _} = T) -> %% from old code
%% An accepting transport spawned at association establishment.
i({accept, Ref, LPid, Sock, Id}) ->
- putr(ref, Ref),
+ putr(?REF_KEY, Ref),
proc_lib:init_ack({ok, self()}),
MRef = erlang:monitor(process, LPid),
%% Wait for a signal that the transport has been started before
@@ -325,6 +350,11 @@ terminate(_, #transport{assoc_id = undefined}) ->
ok;
terminate(_, #transport{socket = Sock,
+ mode = accept,
+ assoc_id = Id}) ->
+ close(Sock, Id);
+
+terminate(_, #transport{socket = Sock,
mode = {accept, _},
assoc_id = Id}) ->
close(Sock, Id);
@@ -356,13 +386,16 @@ start_timer(S) ->
%% Incoming message from SCTP.
l({sctp, Sock, _RA, _RP, Data} = Msg, #listener{socket = Sock} = S) ->
- setopts(Sock),
- case find(Data, S) of
+ Id = assoc_id(Data),
+
+ try find(Id, Data, S) of
{TPid, NewS} ->
- TPid ! Msg,
+ TPid ! {peeloff, peeloff(Sock, Id, TPid), Msg},
NewS;
false ->
S
+ after
+ setopts(Sock)
end;
%% Transport is asking message to be sent. See send/3 for why the send
@@ -430,15 +463,19 @@ t(T,S) ->
%% transition/2
-%% Incoming message.
-transition({sctp, Sock, _RA, _RP, Data}, #transport{socket = Sock,
- mode = {accept, _}}
- = S) ->
- recv(Data, S);
+%% Listening process is transfering ownership of an association.
+transition({peeloff, Sock, {sctp, LSock, _RA, _RP, _Data} = Msg},
+ #transport{mode = {accept, _},
+ socket = LSock}
+ = S) ->
+ transition(Msg, S#transport{socket = Sock});
-transition({sctp, Sock, _RA, _RP, Data}, #transport{socket = Sock} = S) ->
+%% Incoming message.
+transition({sctp, _Sock, _RA, _RP, Data}, #transport{socket = Sock} = S) ->
setopts(Sock),
recv(Data, S);
+%% Don't match on Sock since in R15B01 it can be the listening socket
+%% in the (peeled-off) accept case, which is likely a bug.
%% Outgoing message.
transition({diameter, {send, Msg}}, S) ->
@@ -456,13 +493,18 @@ transition({diameter, {close, Pid}}, #transport{parent = Pid}) ->
transition({diameter, {tls, _Ref, _Type, _Bool}}, _) ->
stop;
+%% Parent process has died.
+transition({'DOWN', _, process, Pid, _}, #transport{parent = Pid}) ->
+ stop;
+
%% Listener process has died.
transition({'DOWN', _, process, Pid, _}, #transport{mode = {accept, Pid}}) ->
stop;
-%% Parent process has died.
-transition({'DOWN', _, process, Pid, _}, #transport{parent = Pid}) ->
- stop;
+%% Ditto but we have ownership of the association. It might be that
+%% we'll go down anyway though.
+transition({'DOWN', _, process, _Pid, _}, #transport{mode = accept}) ->
+ ok;
%% Request for the local port number.
transition({resolve_port, Pid}, #transport{socket = Sock})
@@ -521,14 +563,6 @@ send(Bin, #transport{streams = {_, OS},
%% send/3
-%% Messages have to be sent from the controlling process, which is
-%% probably a bug. Sending from here causes an inet_reply, Sock,
-%% Status} message to be sent to the controlling process while
-%% gen_sctp:send/4 here hangs.
-send(StreamId, Bin, #transport{assoc_id = AId,
- mode = {accept, LPid}}) ->
- LPid ! {send, AId, StreamId, Bin};
-
send(StreamId, Bin, #transport{socket = Sock,
assoc_id = AId}) ->
send(Sock, AId, StreamId, Bin).
@@ -554,10 +588,9 @@ recv({_, #sctp_assoc_change{state = comm_up,
mode = {T, _},
socket = Sock}
= S) ->
- Ref = getr(ref),
+ Ref = getr(?REF_KEY),
is_reference(Ref) %% started in new code
- andalso
- (true = diameter_reg:add_new({?MODULE, T, {Ref, {Id, Sock}}})),
+ andalso publish(T, Ref, Id, Sock),
up(S#transport{assoc_id = Id,
streams = {IS, OS}});
@@ -599,6 +632,10 @@ recv({_, #sctp_paddr_change{}}, _) ->
recv({_, #sctp_pdapi_event{}}, _) ->
ok.
+publish(T, Ref, Id, Sock) ->
+ true = diameter_reg:add_new({?MODULE, T, {Ref, {Id, Sock}}}),
+ putr(?INFO_KEY, {gen_sctp, Sock}). %% for info/1
+
%% up/1
up(#transport{parent = Pid,
@@ -608,21 +645,15 @@ up(#transport{parent = Pid,
S#transport{mode = C};
up(#transport{parent = Pid,
- mode = {accept, _}}
+ mode = {accept = A, _}}
= S) ->
diameter_peer:up(Pid),
- S.
+ S#transport{mode = A}.
-%% find/2
-
-find({[#sctp_sndrcvinfo{assoc_id = Id}], _}
- = Data,
- #listener{tmap = T}
- = S) ->
- f(ets:lookup(T, Id), Data, S);
+%% find/3
-find({_, Rec} = Data, #listener{tmap = T} = S) ->
- f(ets:lookup(T, assoc_id(Rec)), Data, S).
+find(Id, Data, #listener{tmap = T} = S) ->
+ f(ets:lookup(T, Id), Data, S).
%% New association and a transport waiting for one: use it.
f([],
@@ -663,17 +694,29 @@ f([], _, _) ->
%% assoc_id/1
-assoc_id(#sctp_shutdown_event{assoc_id = Id}) ->
+assoc_id({[#sctp_sndrcvinfo{assoc_id = Id}], _}) ->
Id;
-assoc_id(#sctp_assoc_change{assoc_id = Id}) ->
+assoc_id({_, Rec}) ->
+ id(Rec).
+
+id(#sctp_shutdown_event{assoc_id = Id}) ->
+ Id;
+id(#sctp_assoc_change{assoc_id = Id}) ->
Id;
-assoc_id(#sctp_sndrcvinfo{assoc_id = Id}) ->
+id(#sctp_sndrcvinfo{assoc_id = Id}) ->
Id;
-assoc_id(#sctp_paddr_change{assoc_id = Id}) ->
+id(#sctp_paddr_change{assoc_id = Id}) ->
Id;
-assoc_id(#sctp_adaptation_event{assoc_id = Id}) ->
+id(#sctp_adaptation_event{assoc_id = Id}) ->
Id.
+%% peeloff/3
+
+peeloff(LSock, Id, TPid) ->
+ {ok, Sock} = gen_sctp:peeloff(LSock, Id),
+ ok = gen_sctp:controlling_process(Sock, TPid),
+ Sock.
+
%% connect/4
connect(_, [], _, Reasons) ->
diff --git a/lib/diameter/src/transport/diameter_tcp.erl b/lib/diameter/src/transport/diameter_tcp.erl
index 78dbda6888..f3fbbee609 100644
--- a/lib/diameter/src/transport/diameter_tcp.erl
+++ b/lib/diameter/src/transport/diameter_tcp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -37,11 +37,17 @@
code_change/3,
terminate/2]).
+-export([info/1]). %% service_info callback
+
-export([ports/0,
ports/1]).
-include_lib("diameter/include/diameter.hrl").
+%% Keys into process dictionary.
+-define(INFO_KEY, info).
+-define(REF_KEY, ref).
+
-define(ERROR(T), erlang:error({T, ?MODULE, ?LINE})).
-define(DEFAULT_PORT, 3868). %% RFC 3588, ch 2.1
@@ -74,7 +80,7 @@
%% Accepting/connecting transport process state.
-record(transport,
- {socket :: inet:socket(), %% accept or connect socket
+ {socket :: inet:socket() | ssl:sslsock(), %% accept or connect socket
parent :: pid(), %% of process that started us
module :: module(), %% gen_tcp-like module
frag = <<>> :: binary() | {tref(), frag()}, %% message fragment
@@ -111,6 +117,33 @@ start_link(T) ->
diameter_lib:spawn_opts(server, [])).
%% ---------------------------------------------------------------------------
+%% # info/1
+%% ---------------------------------------------------------------------------
+
+info({Mod, Sock}) ->
+ lists:flatmap(fun(K) -> info(Mod, K, Sock) end,
+ [{socket, fun sockname/2},
+ {peer, fun peername/2},
+ {statistics, fun getstat/2}
+ | ssl_info(Mod, Sock)]).
+
+info(Mod, {K,F}, Sock) ->
+ case F(Mod, Sock) of
+ {ok, V} ->
+ [{K,V}];
+ _ ->
+ []
+ end.
+
+ssl_info(ssl = M, Sock) ->
+ [{M, ssl_info(Sock)}];
+ssl_info(_, _) ->
+ [].
+
+ssl_info(Sock) ->
+ [{peercert, C} || {ok, C} <- [ssl:peercert(Sock)]].
+
+%% ---------------------------------------------------------------------------
%% # init/1
%% ---------------------------------------------------------------------------
@@ -133,7 +166,7 @@ i({T, Ref, Mod, Pid, Opts, Addrs})
MPid ! {stop, self()}, %% tell the monitor to die
M = if SslOpts -> ssl; true -> Mod end,
setopts(M, Sock),
- putr(ref, Ref),
+ putr(?REF_KEY, Ref),
#transport{parent = Pid,
module = M,
socket = Sock,
@@ -191,7 +224,7 @@ i(accept = T, Ref, Mod, Pid, Opts, Addrs) ->
{LAddr, LSock} = listener(Ref, {Mod, Opts, Addrs}),
proc_lib:init_ack({ok, self(), [LAddr]}),
Sock = ok(accept(Mod, LSock)),
- true = diameter_reg:add_new({?MODULE, T, {Ref, Sock}}),
+ publish(Mod, T, Ref, Sock),
diameter_peer:up(Pid),
Sock;
@@ -202,10 +235,14 @@ i(connect = T, Ref, Mod, Pid, Opts, Addrs) ->
RPort = get_port(RP),
proc_lib:init_ack({ok, self(), [LAddr]}),
Sock = ok(connect(Mod, RAddr, RPort, gen_opts(LAddr, Rest))),
- true = diameter_reg:add_new({?MODULE, T, {Ref, Sock}}),
+ publish(Mod, T, Ref, Sock),
diameter_peer:up(Pid, {RAddr, RPort}),
Sock.
+publish(Mod, T, Ref, Sock) ->
+ true = diameter_reg:add_new({?MODULE, T, {Ref, Sock}}),
+ putr(?INFO_KEY, {Mod, Sock}). %% for info/1
+
ok({ok, T}) ->
T;
ok(No) ->
@@ -521,7 +558,7 @@ tls_handshake(Type, true, #transport{socket = Sock,
ssl = Opts}
= S) ->
{ok, SSock} = tls(Type, Sock, [{cb_info, ?TCP_CB(M)} | Opts]),
- Ref = getr(ref),
+ Ref = getr(?REF_KEY),
is_reference(Ref) %% started in new code
andalso
(true = diameter_reg:add_new({?MODULE, Type, {Ref, SSock}})),
@@ -696,12 +733,32 @@ setopts(M, Sock) ->
portnr(gen_tcp, Sock) ->
inet:port(Sock);
-portnr(ssl, Sock) ->
- case ssl:sockname(Sock) of
+portnr(M, Sock) ->
+ case M:sockname(Sock) of
{ok, {_Addr, PortNr}} ->
{ok, PortNr};
{error, _} = No ->
No
- end;
-portnr(M, Sock) ->
- M:port(Sock).
+ end.
+
+%% sockname/2
+
+sockname(gen_tcp, Sock) ->
+ inet:sockname(Sock);
+sockname(M, Sock) ->
+ M:sockname(Sock).
+
+%% peername/2
+
+peername(gen_tcp, Sock) ->
+ inet:peername(Sock);
+peername(M, Sock) ->
+ M:peername(Sock).
+
+%% getstat/2
+
+getstat(gen_tcp, Sock) ->
+ inet:getstat(Sock);
+getstat(M, Sock) ->
+ M:getstat(Sock).
+%% Note that ssl:getstat/1 doesn't yet exist in R15B01.
diff --git a/lib/diameter/src/transport/diameter_transport.erl b/lib/diameter/src/transport/diameter_transport.erl
new file mode 100644
index 0000000000..ff4b6bbc6d
--- /dev/null
+++ b/lib/diameter/src/transport/diameter_transport.erl
@@ -0,0 +1,55 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(diameter_transport).
+
+%%
+%% This module implements a transport start function that
+%% evaluates its config argument.
+%%
+
+%% Transport start functions
+-export([start/3,
+ select/3,
+ eval/3]).
+
+%% start/3
+
+%% Call a start function in this module ...
+start(T, Svc, {F,A}) ->
+ start(T, Svc, {?MODULE, F, [A]});
+
+%% ... or some other.
+start(T, Svc, F) ->
+ diameter_lib:eval([F, T, Svc]).
+
+%% select/3
+%%
+%% A start function that whose config argument is expected to return a
+%% new start function.
+
+select(T, Svc, F) ->
+ start(T, Svc, diameter_lib:eval([F, T, Svc])).
+
+%% eval/3
+%%
+%% A start function that simply evaluates its config argument.
+
+eval(_, _, F) ->
+ diameter_lib:eval(F).
diff --git a/lib/diameter/test/Makefile b/lib/diameter/test/Makefile
index ab5b45ff3d..e3a57553c1 100644
--- a/lib/diameter/test/Makefile
+++ b/lib/diameter/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2011. All Rights Reserved.
+# Copyright Ericsson AB 2010-2012. 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
@@ -67,8 +67,13 @@ ERL_COMPILE_FLAGS += +warn_export_vars \
# Targets
# ----------------------------------------------------
+# Require success ...
all: opt
+# ... or not.
+any: opt
+ $(MAKE) -i $(SUITES)
+
run: $(SUITES)
debug opt: $(TARGET_FILES)
@@ -113,7 +118,7 @@ help:
@echo " Echo some relevant variables."
@echo ========================================
-.PHONY: all run clean debug docs help info opt realclean
+.PHONY: all any run clean debug docs help info opt realclean
# ----------------------------------------------------
# Special Targets
@@ -141,7 +146,7 @@ log:
# ----------------------------------------------------
/%: % force
- sed -f release.sed $< > $(RELSYSDIR)$@
+ sed -f release.sed $< > "$(RELSYSDIR)$@"
ifeq ($(ERL_TOP),)
include $(DIAMETER_TOP)/make/release_targets.mk
@@ -152,17 +157,17 @@ endif
release_spec release_docs_spec:
release_tests_spec:
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) $(TEST_SPEC_FILE) \
$(COVER_SPEC_FILE) \
$(HRL_FILES) \
- $(RELSYSDIR)
+ "$(RELSYSDIR)"
$(MAKE) $(DATA_DIRS:%/=release_data_%)
$(MAKE) $(ERL_FILES:%=/%)
$(DATA_DIRS:%/=release_data_%): release_data_%:
- $(INSTALL_DIR) $(RELSYSDIR)/$*
- $(INSTALL_DATA) $(filter $*/%, $(DATA)) $(RELSYSDIR)/$*
+ $(INSTALL_DIR) "$(RELSYSDIR)/$*"
+ $(INSTALL_DATA) $(filter $*/%, $(DATA)) "$(RELSYSDIR)/$*"
force:
diff --git a/lib/diameter/test/diameter_capx_SUITE.erl b/lib/diameter/test/diameter_capx_SUITE.erl
index 54a161d606..ae128b8203 100644
--- a/lib/diameter/test/diameter_capx_SUITE.erl
+++ b/lib/diameter/test/diameter_capx_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -93,12 +93,12 @@
-define(fail(T), erlang:error({T, process_info(self(), messages)})).
--define(TIMEOUT, 2000).
+-define(TIMEOUT, 10000).
%% ===========================================================================
suite() ->
- [{timetrap, {seconds, 10}}].
+ [{timetrap, {seconds, 60}}].
all() -> [start,
start_services,
diff --git a/lib/diameter/test/diameter_compiler_SUITE.erl b/lib/diameter/test/diameter_compiler_SUITE.erl
index 3b4c9706e0..4b792b5426 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -339,7 +339,7 @@
%% ===========================================================================
suite() ->
- [{timetrap, {seconds, 5}}].
+ [{timetrap, {minutes, 2}}].
all() ->
[format,
diff --git a/lib/diameter/test/diameter_ct.erl b/lib/diameter/test/diameter_ct.erl
index f8ee3dc1d7..ded50bf6c5 100644
--- a/lib/diameter/test/diameter_ct.erl
+++ b/lib/diameter/test/diameter_ct.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -25,15 +25,14 @@
-export([run/1]).
-%% ct:run_test/1 is currently documented as returning a list of test
-%% results ... but no. Instead it returns 'ok' regardless of whether
-%% or not the suite in question has failed testcases.
+%% The makefile looks for signs of failure so ignore the ct:run_test/1
+%% return value.
run([Suite]) ->
Start = info(),
- ok = ct:run_test([{suite, Suite},
- {logdir, "./log"},
- {auto_compile, false}]),
+ ct:run_test([{suite, Suite},
+ {logdir, "./log"},
+ {auto_compile, false}]),
info(Start , info()).
info() ->
diff --git a/lib/diameter/test/diameter_dict_SUITE.erl b/lib/diameter/test/diameter_dict_SUITE.erl
index 5cf8506d3f..3cc65c0257 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -48,7 +48,7 @@
%% ===========================================================================
suite() ->
- [{timetrap, {seconds, 10}}].
+ [{timetrap, {seconds, 60}}].
all() ->
[{group, all},
diff --git a/lib/diameter/test/diameter_failover_SUITE.erl b/lib/diameter/test/diameter_failover_SUITE.erl
index 53398dd93e..ed31670031 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -101,7 +101,7 @@
%% ===========================================================================
suite() ->
- [{timetrap, {seconds, 10}}].
+ [{timetrap, {seconds, 60}}].
all() ->
[start,
diff --git a/lib/diameter/test/diameter_gen_sctp_SUITE.erl b/lib/diameter/test/diameter_gen_sctp_SUITE.erl
index 7f435a6b7a..2fde7b9fdb 100644
--- a/lib/diameter/test/diameter_gen_sctp_SUITE.erl
+++ b/lib/diameter/test/diameter_gen_sctp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -175,7 +175,8 @@ send(Sock, Id) ->
send_from_multiple_clients(_) ->
{S, Rs} = T = send_from_multiple_clients(8, 1024),
- {false, [], _} = {?FOREVER < S,
+ Max = ?FOREVER*1000,
+ {false, [], _} = {Max < S,
Rs -- [OI || {O,_} = OI <- Rs, is_integer(O)],
T}.
@@ -223,6 +224,11 @@ send_from_multiple_clients(_) ->
%% {134,100},
%% {117,98},
%% {149,125}]}
+%%
+%% This turns out to have been due to SCTP resends as a consequence of
+%% the listener having an insufficient recbuf. Increasing the size
+%% solves the problem.
+%%
send_from_multiple_clients(N, Sz)
when is_integer(N), 0 < N, is_integer(Sz), 0 < Sz ->
@@ -341,8 +347,15 @@ receive_what_was_sent(_Config) ->
%% open/0
open() ->
- gen_sctp:open([{ip, ?ADDR}, {port, 0}, {active, true}, binary]).
+ open([]).
+
+%% open/1
+open(Opts) ->
+ gen_sctp:open([{ip, ?ADDR}, {port, 0}, {active, true}, binary,
+ {recbuf, 1 bsl 16}, {sndbuf, 1 bsl 16}
+ | Opts]).
+
%% assoc/1
assoc(Sock) ->
diff --git a/lib/diameter/test/diameter_reg_SUITE.erl b/lib/diameter/test/diameter_reg_SUITE.erl
index ec6a0ca731..4939019f7a 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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() ->
- [{timetrap, {seconds, 10}}].
+ [{timetrap, {seconds, 60}}].
all() ->
[{group, all},
diff --git a/lib/diameter/test/diameter_relay_SUITE.erl b/lib/diameter/test/diameter_relay_SUITE.erl
index 70e1866791..f10d82bdf8 100644
--- a/lib/diameter/test/diameter_relay_SUITE.erl
+++ b/lib/diameter/test/diameter_relay_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -48,6 +48,7 @@
send_loop/1,
send_timeout_1/1,
send_timeout_2/1,
+ info/1,
disconnect/1,
stop_services/1,
stop/1]).
@@ -112,7 +113,7 @@
%% ===========================================================================
suite() ->
- [{timetrap, {seconds, 10}}].
+ [{timetrap, {seconds, 60}}].
all() ->
[start,
@@ -136,7 +137,8 @@ tc() ->
send4,
send_loop,
send_timeout_1,
- send_timeout_2].
+ send_timeout_2,
+ info].
%% ===========================================================================
%% start/stop testcases
@@ -224,6 +226,9 @@ send_timeout(Tmo) ->
{'Re-Auth-Request-Type', ?AUTHORIZE_ONLY}],
call(Req, [{filter, realm}, {timeout, Tmo}]).
+info(_Config) ->
+ [] = ?util:info().
+
%% ===========================================================================
realm(Host) ->
diff --git a/lib/diameter/test/diameter_stats_SUITE.erl b/lib/diameter/test/diameter_stats_SUITE.erl
index e7807fd360..8b7d8cb1b6 100644
--- a/lib/diameter/test/diameter_stats_SUITE.erl
+++ b/lib/diameter/test/diameter_stats_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -30,16 +30,17 @@
end_per_suite/1]).
%% testcases
--export([an/1,
- twa/1]).
+-export([reg/1,
+ incr/1,
+ read/1,
+ flush/1]).
-define(stat, diameter_stats).
--define(util, diameter_util).
%% ===========================================================================
suite() ->
- [{timetrap, {seconds, 10}}].
+ [{timetrap, {seconds, 60}}].
all() ->
[{group, all},
@@ -49,8 +50,10 @@ groups() ->
[{all, [], tc()}].
tc() ->
- [an,
- twa].
+ [reg,
+ incr,
+ read,
+ flush].
init_per_suite(Config) ->
ok = diameter:start(),
@@ -61,25 +64,62 @@ end_per_suite(_Config) ->
%% ===========================================================================
-an(_) ->
- Ref = {'_', make_ref()},
+reg(_) ->
+ Ref = '$1',
true = ?stat:reg(Ref),
- true = ?stat:reg(Ref), %% duplicate
- ok = ?stat:incr(x),
- ok = ?stat:incr(x, Ref),
- ok = ?stat:incr(y, 2),
- ok = ?stat:incr(y, Ref),
- %% Flushing a pid flushes even stats on the registered reference.
- [{x,2},{y,3}] = lists:sort(?stat:flush()),
- [] = ?stat:flush(Ref),
- [] = ?stat:flush().
-
-twa(_) ->
+ false = ?stat:reg(Ref). %% duplicate
+
+incr(_) ->
+ Ref = '_',
+ Ctr = x,
+ false = ?stat:incr(Ctr), %% not registered,
+ 1 = ?stat:incr(Ctr, Ref, 1), %% only pids need register
+ true = ?stat:reg(Ref),
+ spawn(fun() ->
+ true = ?stat:reg(Ref),
+ 2 = ?stat:incr(Ctr, self(), 2)
+ end),
+ ok = fold(Ctr, Ref, 3), %% folded
+ ?stat:flush([self(), Ref]).
+
+read(_) ->
+ Ref = make_ref(),
+ C1 = {a,b},
+ C2 = {b,a},
+ true = ?stat:reg(Ref),
+ 1 = ?stat:incr(C1),
+ 1 = ?stat:incr(C2),
+ 2 = ?stat:incr(C1),
+ 7 = ?stat:incr(C1, Ref, 7),
+ Self = self(),
+ [{Ref, [{C1,7}]}, {Self, [{C1,2}, {C2,1}]}]
+ = lists:sort(?stat:read([self(), Ref, make_ref()])),
+ [] = ?stat:read([]),
+ [] = ?stat:read([make_ref()]),
+ ?stat:flush([self(), Ref, make_ref()]).
+
+flush(_) ->
Ref = make_ref(),
- ok = ?stat:incr(x, 8),
- ok = ?stat:incr(x, Ref, 7),
- %% Flushing a reference doesn't affect registered pids.
- [{x,7}] = ?stat:flush(Ref),
- [] = ?stat:flush(Ref),
- [{x,8}] = ?stat:flush(),
- [] = ?stat:flush().
+ Ctr = '_',
+ true = ?stat:reg(Ref),
+ 1 = ?stat:incr(Ctr),
+ 3 = ?stat:incr(Ctr, self(), 2),
+ 2 = ?stat:incr(Ctr, Ref, 2),
+ Self = self(),
+ [{Self, [{Ctr, 3}]}] = ?stat:flush([self()]),
+ 1 = ?stat:incr(Ctr),
+ [{Ref, [{Ctr, 2}]}] = ?stat:flush([Ref]),
+ [{Self, [{Ctr, 1}]}] = ?stat:flush([self()]),
+ [] = ?stat:flush([self(), Ref]).
+
+%% ===========================================================================
+
+%% Keep incremented until a fold results in the specified value.
+fold(Ctr, Ref, N) ->
+ case ?stat:incr(Ctr, Ref, 0) of
+ N ->
+ ok;
+ M when M < N ->
+ erlang:yield(),
+ fold(Ctr, Ref, N)
+ end.
diff --git a/lib/diameter/test/diameter_sync_SUITE.erl b/lib/diameter/test/diameter_sync_SUITE.erl
index ab629fb1c1..457efab8ae 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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() ->
- [{timetrap, {seconds, 10}}].
+ [{timetrap, {seconds, 60}}].
all() ->
[{group, all},
diff --git a/lib/diameter/test/diameter_tls_SUITE.erl b/lib/diameter/test/diameter_tls_SUITE.erl
index 85b953dc1a..6cc34b20c5 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -127,7 +127,7 @@
%% ===========================================================================
suite() ->
- [{timetrap, {seconds, 10}}].
+ [{timetrap, {seconds, 60}}].
all() ->
[start_ssl,
diff --git a/lib/diameter/test/diameter_traffic_SUITE.erl b/lib/diameter/test/diameter_traffic_SUITE.erl
index 6eed8d3b5d..669918f757 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -37,6 +37,7 @@
add_transports/1,
result_codes/1,
send_ok/1,
+ send_nok/1,
send_arbitrary/1,
send_unknown/1,
send_unknown_mandatory/1,
@@ -89,6 +90,7 @@
-include("diameter.hrl").
-include("diameter_gen_base_rfc3588.hrl").
+-include("diameter_gen_base_accounting.hrl").
%% ===========================================================================
@@ -101,11 +103,17 @@
-define(REALM, "erlang.org").
-define(HOST(Host, Realm), Host ++ [$.|Realm]).
--define(APP_ALIAS, base).
-define(EXTRA, an_extra_argument).
+
+-define(BASE, ?DIAMETER_DICT_COMMON).
+-define(ACCT, ?DIAMETER_DICT_ACCOUNTING).
+
+%% Run tests cases in different encoding variants. Send outgoing
+%% messages as lists or records.
-define(ENCODINGS, [list, record]).
--define(DICT, ?DIAMETER_DICT_COMMON).
+%% Not really what we should be setting unless the message is sent in
+%% the common application but diameter doesn't care.
-define(APP_ID, ?DIAMETER_APP_ID_COMMON).
%% Config for diameter:start_service/2.
@@ -115,11 +123,12 @@
{'Host-IP-Address', [?ADDR]},
{'Vendor-Id', 12345},
{'Product-Name', "OTP/diameter"},
- {'Acct-Application-Id', [?DIAMETER_APP_ID_COMMON]},
- {application, [{alias, ?APP_ALIAS},
- {dictionary, ?DIAMETER_DICT_COMMON},
- {module, ?MODULE},
- {answer_errors, callback}]}]).
+ {'Auth-Application-Id', [?DIAMETER_APP_ID_COMMON]},
+ {'Acct-Application-Id', [?DIAMETER_APP_ID_ACCOUNTING]}
+ | [{application, [{dictionary, D},
+ {module, ?MODULE},
+ {answer_errors, callback}]}
+ || D <- [?BASE, ?ACCT]]]).
-define(SUCCESS,
?'DIAMETER_BASE_RESULT-CODE_DIAMETER_SUCCESS').
@@ -131,6 +140,8 @@
?'DIAMETER_BASE_RESULT-CODE_DIAMETER_APPLICATION_UNSUPPORTED').
-define(INVALID_HDR_BITS,
?'DIAMETER_BASE_RESULT-CODE_DIAMETER_INVALID_HDR_BITS').
+-define(INVALID_AVP_BITS,
+ ?'DIAMETER_BASE_RESULT-CODE_DIAMETER_INVALID_AVP_BITS').
-define(AVP_UNSUPPORTED,
?'DIAMETER_BASE_RESULT-CODE_DIAMETER_AVP_UNSUPPORTED').
-define(UNSUPPORTED_VERSION,
@@ -154,24 +165,25 @@
-define(A, list_to_atom).
-define(L, atom_to_list).
--define(P(N), ?A("p_" ++ ?L(N))).
+
+-define(NAME(A,B), ?A(?L(A) ++ "," ++ ?L(B))).
%% ===========================================================================
suite() ->
- [{timetrap, {seconds, 10}}].
+ [{timetrap, {seconds, 60}}].
all() ->
[start, start_services, add_transports, result_codes]
- ++ [{group, E, P} || E <- ?ENCODINGS, P <- [[], [parallel]]]
+ ++ [{group, name([E]), P} || E <- ?ENCODINGS, P <- [[], [parallel]]]
++ [remove_transports, stop_services, stop].
groups() ->
Ts = tc(),
- [{E, [], Ts} || E <- ?ENCODINGS].
+ [{name([E]), [], Ts} || E <- ?ENCODINGS].
init_per_group(Name, Config) ->
- [{encode, Name} | Config].
+ [{group, Name} | Config].
end_per_group(_, _) ->
ok.
@@ -186,6 +198,7 @@ end_per_testcase(_, _) ->
%% established.
tc() ->
[send_ok,
+ send_nok,
send_arbitrary,
send_unknown,
send_unknown_mandatory,
@@ -257,7 +270,7 @@ capx(_, #diameter_caps{origin_host = {OH,DH}}) ->
%% Ensure that result codes have the expected values.
result_codes(_Config) ->
- {2001, 3001, 3002, 3003, 3004, 3007, 3008, 5001, 5011}
+ {2001, 3001, 3002, 3003, 3004, 3007, 3008, 3009, 5001, 5011}
= {?SUCCESS,
?COMMAND_UNSUPPORTED,
?UNABLE_TO_DELIVER,
@@ -265,6 +278,7 @@ result_codes(_Config) ->
?TOO_BUSY,
?APPLICATION_UNSUPPORTED,
?INVALID_HDR_BITS,
+ ?INVALID_AVP_BITS,
?AVP_UNSUPPORTED,
?UNSUPPORTED_VERSION}.
@@ -272,7 +286,16 @@ result_codes(_Config) ->
send_ok(Config) ->
Req = ['ACR', {'Accounting-Record-Type', ?EVENT_RECORD},
{'Accounting-Record-Number', 1}],
- #diameter_base_ACA{'Result-Code' = ?SUCCESS}
+
+ #diameter_base_accounting_ACA{'Result-Code' = ?SUCCESS}
+ = call(Config, Req).
+
+%% Send an accounting ACR that the server answers badly to.
+send_nok(Config) ->
+ Req = ['ACR', {'Accounting-Record-Type', ?EVENT_RECORD},
+ {'Accounting-Record-Number', 0}],
+
+ #'diameter_base_answer-message'{'Result-Code' = ?INVALID_AVP_BITS}
= call(Config, Req).
%% Send an ASR with an arbitrary AVP and expect success and the same
@@ -324,7 +347,7 @@ send_unsupported(Config) ->
#'diameter_base_answer-message'{'Result-Code' = ?COMMAND_UNSUPPORTED}
= call(Config, Req).
-%% Send an unsupported command and expect 3007.
+%% Send an unsupported application and expect 3007.
send_unsupported_app(Config) ->
Req = ['STR', {'Termination-Cause', ?BAD_ANSWER}],
#'diameter_base_answer-message'{'Result-Code' = ?APPLICATION_UNSUPPORTED}
@@ -516,34 +539,57 @@ call(Config, Req) ->
call(Config, Req, Opts) ->
Name = proplists:get_value(testcase, Config),
- Enc = proplists:get_value(encode, Config),
+ [Enc] = name(proplists:get_value(group, Config)),
diameter:call(?CLIENT,
- ?APP_ALIAS,
- msg(Req, Enc),
+ dict(Req),
+ req(Req, Enc),
[{extra, [Name]} | Opts]).
-msg([_|_] = L, list) ->
- L;
-msg([H|T], record) ->
- ?DICT:'#new-'(?DICT:msg2rec(H), T);
-msg(T, _) ->
+req(['ACR' = H | T], record) ->
+ ?ACCT:'#new-'(?ACCT:msg2rec(H), T);
+req([H|T], record) ->
+ ?BASE:'#new-'(?BASE:msg2rec(H), T);
+req(T, _) ->
T.
+dict(['ACR' | _]) ->
+ ?ACCT;
+dict(_) ->
+ ?BASE.
+
%% Set only values that aren't already.
set([H|T], Vs) ->
[H | Vs ++ T];
+set(#diameter_base_accounting_ACR{} = Rec, Vs) ->
+ set(Rec, Vs, ?ACCT);
set(Rec, Vs) ->
- lists:foldl(fun({F,_} = FV, A) -> set(?DICT:'#get-'(F, A), FV, A) end,
+ set(Rec, Vs, ?BASE).
+
+set(Rec, Vs, Dict) ->
+ lists:foldl(fun({F,_} = FV, A) ->
+ set(Dict, Dict:'#get-'(F, A), FV, A)
+ end,
Rec,
Vs).
-set(E, FV, Rec)
+set(Dict, E, FV, Rec)
when E == undefined;
E == [] ->
- ?DICT:'#set-'(FV, Rec);
-set(_, _, Rec) ->
+ Dict:'#set-'(FV, Rec);
+set(_, _, _, Rec) ->
Rec.
+%% Contruct and deconstruct names to work around group names being
+%% restricted to atoms. (Not really used yet.)
+
+name(Names)
+ when is_list(Names) ->
+ ?A(string:join([?L(A) || A <- Names], ","));
+
+name(A)
+ when is_atom(A) ->
+ [?A(S) || S <- string:tokens(?L(A), ",")].
+
%% ===========================================================================
%% diameter callbacks
@@ -584,14 +630,14 @@ prepare(Pkt, Caps, send_unsupported) ->
Req = prepare(Pkt, Caps),
#diameter_packet{bin = <<H:5/binary, _CmdCode:3/binary, T/binary>>}
= E
- = diameter_codec:encode(?DICT, Pkt#diameter_packet{msg = Req}),
+ = diameter_codec:encode(?BASE, Pkt#diameter_packet{msg = Req}),
E#diameter_packet{bin = <<H/binary, 42:24/integer, T/binary>>};
prepare(Pkt, Caps, send_unsupported_app) ->
Req = prepare(Pkt, Caps),
#diameter_packet{bin = <<H:8/binary, _ApplId:4/binary, T/binary>>}
= E
- = diameter_codec:encode(?DICT, Pkt#diameter_packet{msg = Req}),
+ = diameter_codec:encode(?BASE, Pkt#diameter_packet{msg = Req}),
E#diameter_packet{bin = <<H/binary, 42:32/integer, T/binary>>};
prepare(Pkt, Caps, send_error_bit) ->
@@ -612,7 +658,7 @@ prepare(Pkt, Caps, _Name) ->
prepare(Pkt, Caps).
prepare(#diameter_packet{msg = Req}, Caps)
- when is_record(Req, diameter_base_ACR);
+ when is_record(Req, diameter_base_accounting_ACR);
'ACR' == hd(Req) ->
#diameter_caps{origin_host = {OH, _},
origin_realm = {OR, DR}}
@@ -687,13 +733,16 @@ handle_error(Reason, _Req, ?CLIENT, _Peer, _Name) ->
%% Note that diameter will set Result-Code and Failed-AVPs if
%% #diameter_packet.errors is non-null.
-handle_request(Pkt, ?SERVER, {_Ref, Caps}) ->
- request(Pkt, Caps).
+handle_request(#diameter_packet{msg = M}, ?SERVER, {_Ref, Caps}) ->
+ request(M, Caps).
+
+request(#diameter_base_accounting_ACR{'Accounting-Record-Number' = 0},
+ _) ->
+ {protocol_error, ?INVALID_AVP_BITS};
-request(#diameter_packet{msg
- = #diameter_base_ACR{'Session-Id' = SId,
- 'Accounting-Record-Type' = RT,
- 'Accounting-Record-Number' = RN}},
+request(#diameter_base_accounting_ACR{'Session-Id' = SId,
+ 'Accounting-Record-Type' = RT,
+ 'Accounting-Record-Number' = RN},
#diameter_caps{origin_host = {OH, _},
origin_realm = {OR, _}}) ->
{reply, ['ACA', {'Result-Code', ?SUCCESS},
@@ -703,8 +752,8 @@ request(#diameter_packet{msg
{'Accounting-Record-Type', RT},
{'Accounting-Record-Number', RN}]};
-request(#diameter_packet{msg = #diameter_base_ASR{'Session-Id' = SId,
- 'AVP' = Avps}},
+request(#diameter_base_ASR{'Session-Id' = SId,
+ 'AVP' = Avps},
#diameter_caps{origin_host = {OH, _},
origin_realm = {OR, _}}) ->
{reply, #diameter_base_ASA{'Result-Code' = ?SUCCESS,
@@ -713,22 +762,22 @@ request(#diameter_packet{msg = #diameter_base_ASR{'Session-Id' = SId,
'Origin-Realm' = OR,
'AVP' = Avps}};
-request(#diameter_packet{msg = #diameter_base_STR{'Termination-Cause' = T}},
+request(#diameter_base_STR{'Termination-Cause' = T},
_Caps)
when T /= ?LOGOUT ->
discard;
-request(#diameter_packet{msg = #diameter_base_STR{'Destination-Realm'= R}},
+request(#diameter_base_STR{'Destination-Realm'= R},
#diameter_caps{origin_realm = {OR, _}})
when R /= undefined, R /= OR ->
{protocol_error, ?REALM_NOT_SERVED};
-request(#diameter_packet{msg = #diameter_base_STR{'Destination-Host'= [H]}},
+request(#diameter_base_STR{'Destination-Host'= [H]},
#diameter_caps{origin_host = {OH, _}})
when H /= OH ->
{protocol_error, ?UNABLE_TO_DELIVER};
-request(#diameter_packet{msg = #diameter_base_STR{'Session-Id' = SId}},
+request(#diameter_base_STR{'Session-Id' = SId},
#diameter_caps{origin_host = {OH, _},
origin_realm = {OR, _}}) ->
{reply, #diameter_base_STA{'Result-Code' = ?SUCCESS,
@@ -736,6 +785,6 @@ request(#diameter_packet{msg = #diameter_base_STR{'Session-Id' = SId}},
'Origin-Host' = OH,
'Origin-Realm' = OR}};
-request(#diameter_packet{msg = #diameter_base_RAR{}}, _Caps) ->
+request(#diameter_base_RAR{}, _Caps) ->
receive after 2000 -> ok end,
{protocol_error, ?TOO_BUSY}.
diff --git a/lib/diameter/test/diameter_util.erl b/lib/diameter/test/diameter_util.erl
index 0c42f955ad..890d24f6f8 100644
--- a/lib/diameter/test/diameter_util.erl
+++ b/lib/diameter/test/diameter_util.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -35,7 +35,8 @@
lport/3,
listen/2, listen/3,
connect/3, connect/4,
- disconnect/4]).
+ disconnect/4,
+ info/0]).
%% common_test-specific
-export([write_priv/3,
@@ -262,7 +263,10 @@ listen(SvcName, Prot) ->
listen(SvcName, Prot, []).
listen(SvcName, Prot, Opts) ->
- add_transport(SvcName, {listen, opts(Prot, listen) ++ Opts}).
+ SvcName = diameter:service_info(SvcName, name), %% assert
+ Ref = add_transport(SvcName, {listen, opts(Prot, listen) ++ Opts}),
+ true = transport(SvcName, Ref), %% assert
+ Ref.
%% ---------------------------------------------------------------------------
%% connect/2-3
@@ -275,15 +279,22 @@ connect(Client, Prot, LRef) ->
connect(Client, Prot, LRef, Opts) ->
[PortNr] = lport(Prot, LRef, 20),
- Ref = add_transport(Client, {connect, opts(Prot, PortNr) ++ Opts}),
+ Client = diameter:service_info(Client, name), %% assert
true = diameter:subscribe(Client),
+ Ref = add_transport(Client, {connect, opts(Prot, PortNr) ++ Opts}),
+ true = transport(Client, Ref), %% assert
+
ok = receive
{diameter_event, Client, {up, Ref, _, _, _}} -> ok
- after 2000 ->
+ after 10000 ->
{Client, Prot, PortNr, process_info(self(), messages)}
end,
Ref.
+transport(SvcName, Ref) ->
+ [Ref] == [R || [{ref, R} | _] <- diameter:service_info(SvcName, transport),
+ R == Ref].
+
%% ---------------------------------------------------------------------------
%% disconnect/4
%%
@@ -295,7 +306,7 @@ disconnect(Client, Ref, Server, LRef) ->
ok = diameter:remove_transport(Client, Ref),
ok = receive
{diameter_event, Server, {down, LRef, _, _}} -> ok
- after 2000 ->
+ after 10000 ->
{Client, Ref, Server, LRef, process_info(self(), messages)}
end.
@@ -320,3 +331,17 @@ opts(listen) ->
[];
opts(PortNr) ->
[{raddr, ?ADDR}, {rport, PortNr}].
+
+%% ---------------------------------------------------------------------------
+%% info/0
+
+info() ->
+ [_|_] = Svcs = diameter:services(), %% assert
+ run([[fun info/1, S] || S <- Svcs]).
+
+info(S) ->
+ [_|_] = Keys = diameter:service_info(S, keys),
+ [] = run([[fun info/2, K, S] || K <- Keys]).
+
+info(Key, SvcName) ->
+ [{Key, _}] = diameter:service_info(SvcName, [Key]).
diff --git a/lib/diameter/vsn.mk b/lib/diameter/vsn.mk
index 0c240798cc..48e6596e72 100644
--- a/lib/diameter/vsn.mk
+++ b/lib/diameter/vsn.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2011. All Rights Reserved.
+# Copyright Ericsson AB 2010-2012. 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
@@ -18,7 +18,7 @@
# %CopyrightEnd%
APPLICATION = diameter
-DIAMETER_VSN = 1.0
+DIAMETER_VSN = 1.2
PRE_VSN =
APP_VSN = "$(APPLICATION)-$(DIAMETER_VSN)$(PRE_VSN)"
diff --git a/lib/edoc/doc/src/Makefile b/lib/edoc/doc/src/Makefile
index b933094464..1f92d36f12 100644
--- a/lib/edoc/doc/src/Makefile
+++ b/lib/edoc/doc/src/Makefile
@@ -124,13 +124,13 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/edoc/doc/src/notes.xml b/lib/edoc/doc/src/notes.xml
index a74a19bc05..e01a6d6675 100644
--- a/lib/edoc/doc/src/notes.xml
+++ b/lib/edoc/doc/src/notes.xml
@@ -31,6 +31,25 @@
<p>This document describes the changes made to the EDoc
application.</p>
+<section><title>Edoc 0.7.10</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ List behaviour callbacks in Edoc when using -callback
+ attribute. (Thanks to Magnus Henoch.)</p>
+ <p>
+ Added special case for file names under Windows. (Thanks
+ to Beads Land-Trujillo.)</p>
+ <p>
+ Own Id: OTP-10174</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Edoc 0.7.9.1</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/edoc/include/Makefile b/lib/edoc/include/Makefile
index 5b2ad38c9d..cf2e051632 100644
--- a/lib/edoc/include/Makefile
+++ b/lib/edoc/include/Makefile
@@ -49,8 +49,8 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec:
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(INCLUDE_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(INCLUDE_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/edoc/priv/Makefile b/lib/edoc/priv/Makefile
index 13225e6d1a..73c42c05eb 100644
--- a/lib/edoc/priv/Makefile
+++ b/lib/edoc/priv/Makefile
@@ -45,9 +45,9 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DATA) $(PRIV_FILES) $(RELSYSDIR)/priv
- $(INSTALL_SCRIPT) $(GEN_SCRIPT) $(RELSYSDIR)/priv
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) $(PRIV_FILES) "$(RELSYSDIR)/priv"
+ $(INSTALL_SCRIPT) $(GEN_SCRIPT) "$(RELSYSDIR)/priv"
release_docs_spec:
diff --git a/lib/edoc/src/Makefile b/lib/edoc/src/Makefile
index fcb0b61292..72354ac711 100644
--- a/lib/edoc/src/Makefile
+++ b/lib/edoc/src/Makefile
@@ -85,10 +85,10 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(OBJECTS) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(SOURCES) $(HRL_FILES) $(YRL_FILE) $(RELSYSDIR)/src
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(OBJECTS) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(SOURCES) $(HRL_FILES) $(YRL_FILE) "$(RELSYSDIR)/src"
release_docs_spec:
diff --git a/lib/edoc/src/edoc_data.erl b/lib/edoc/src/edoc_data.erl
index aad0b14371..624f9177a2 100644
--- a/lib/edoc/src/edoc_data.erl
+++ b/lib/edoc/src/edoc_data.erl
@@ -167,7 +167,10 @@ callbacks(Es, Module, Env, Opts) ->
case lists:any(fun (#entry{name = {behaviour_info, 1}}) -> true;
(_) -> false
end,
- Es) of
+ Es)
+ orelse
+ lists:keymember(callback, 1, Module#module.attributes)
+ of
true ->
try (Module#module.name):behaviour_info(callbacks) of
Fs ->
diff --git a/lib/edoc/src/edoc_lib.erl b/lib/edoc/src/edoc_lib.erl
index 7fd8358add..90fb8a679c 100644
--- a/lib/edoc/src/edoc_lib.erl
+++ b/lib/edoc/src/edoc_lib.erl
@@ -469,6 +469,10 @@ uri_get("ftp:" ++ Path) ->
uri_get("//" ++ Path) ->
Msg = io_lib:format("cannot access network-path: '//~s'.", [Path]),
{error, Msg};
+uri_get([C, $:, $/ | _]=Path) when C >= $A, C =< $Z; C >= $a, C =< $z ->
+ uri_get_file(Path); % special case for Windows
+uri_get([C, $:, $\ | _]=Path) when C >= $A, C =< $Z; C >= $a, C =< $z ->
+ uri_get_file(Path); % special case for Windows
uri_get(URI) ->
case is_relative_uri(URI) of
true ->
diff --git a/lib/edoc/src/edoc_parser.yrl b/lib/edoc/src/edoc_parser.yrl
index 4d6428f75b..d7c1b1c045 100644
--- a/lib/edoc/src/edoc_parser.yrl
+++ b/lib/edoc/src/edoc_parser.yrl
@@ -100,9 +100,7 @@ ptype -> '[' utype ',' '...' ']' : #t_nonempty_list{type = '$2'}.
ptype -> utype_list:
if length(element(1, '$1')) == 1 ->
%% there must be exactly one utype in the list
- hd(element(1, '$1'));
- %% Replace last line when releasing next major release:
- %% #t_paren{type = hd(element(1, '$1'))};
+ #t_paren{type = hd(element(1, '$1'))};
length(element(1, '$1')) == 0 ->
return_error(element(2, '$1'), "syntax error before: ')'");
true ->
diff --git a/lib/edoc/test/Makefile b/lib/edoc/test/Makefile
index 2dbdb77eff..2033e003b3 100644
--- a/lib/edoc/test/Makefile
+++ b/lib/edoc/test/Makefile
@@ -57,10 +57,10 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(EMAKEFILE) $(ERL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) edoc.spec edoc.cover $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(EMAKEFILE) $(ERL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) edoc.spec edoc.cover "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/edoc/vsn.mk b/lib/edoc/vsn.mk
index b8f33894f1..2f403212c8 100644
--- a/lib/edoc/vsn.mk
+++ b/lib/edoc/vsn.mk
@@ -1 +1 @@
-EDOC_VSN = 0.7.9.1
+EDOC_VSN = 0.7.10
diff --git a/lib/eldap/.gitignore b/lib/eldap/.gitignore
new file mode 100644
index 0000000000..d3dd8228d5
--- /dev/null
+++ b/lib/eldap/.gitignore
@@ -0,0 +1,4 @@
+*.beam
+*.asn1db
+ebin/ELDAPv3.hrl
+ebin/ELDAPv3.erl
diff --git a/lib/eldap/AUTHORS b/lib/eldap/AUTHORS
new file mode 100644
index 0000000000..8f1e399306
--- /dev/null
+++ b/lib/eldap/AUTHORS
@@ -0,0 +1,7 @@
+Original author:
+ Torbjorn Tornkvist
+
+With patches from:
+ Simon MacMullen
+ Manuel Durán Aguete
+ voluntas \ No newline at end of file
diff --git a/lib/eldap/LICENSE b/lib/eldap/LICENSE
new file mode 100644
index 0000000000..1f6200918f
--- /dev/null
+++ b/lib/eldap/LICENSE
@@ -0,0 +1,21 @@
+
+Copyright (c) 2010, Torbjorn Tornkvist
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
diff --git a/lib/inviso/Makefile b/lib/eldap/Makefile
index be19199151..3635ec759d 100644
--- a/lib/inviso/Makefile
+++ b/lib/eldap/Makefile
@@ -1,37 +1,39 @@
-# ``The contents of this file are subject to the Erlang Public License,
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 2012. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
-# retrieved via the world wide web at http://www.erlang.org/.
-#
+# retrieved online at http://www.erlang.org/.
+#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
-#
-# The Initial Developer of the Original Code is Ericsson Utvecklings AB.
-# Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
-# AB. All Rights Reserved.''
-#
-# $Id$
+#
+# %CopyrightEnd%
+#
+
#
include $(ERL_TOP)/make/target.mk
include $(ERL_TOP)/make/$(TARGET)/otp.mk
-#
+# ----------------------------------------------------
# Macros
-#
+# ----------------------------------------------------
SUB_DIRECTORIES = src doc/src
include vsn.mk
-VSN = $(RUNTIME_TOOLS_VSN)
+VSN = $(ELDAP_VSN)
-SPECIAL_TARGETS =
+SPECIAL_TARGETS =
-#
+# ----------------------------------------------------
# Default Subdir Targets
-#
+# ----------------------------------------------------
include $(ERL_TOP)/make/otp_subdir.mk
-
diff --git a/lib/eldap/README b/lib/eldap/README
new file mode 100644
index 0000000000..e1bde9d658
--- /dev/null
+++ b/lib/eldap/README
@@ -0,0 +1,33 @@
+Hi,
+
+This is 'eldap', the Erlang LDAP library.
+
+It exports an API that can do all possible operations
+you may want to do against an LDAP server. The code has
+been tested to work at some point, but only the bind
+and search operations are running daily in our products,
+so there may be bugs lurking in some parts of the code.
+
+To just use eldap for doing authentication, do like in:
+
+ {ok,X} = eldap:open(["ldap.mycorp.com"], []).
+ eldap:simple_bind(X, "uid=tobbe,ou=People,dc=mycorp,dc=com", "passwd").
+
+In the doc/README.example you'll find a trace from a
+Erlang shell session as an example on how to setup a
+connection, authenticate (bind) and perform a search.
+Note that by using the option {ssl, true}, you should
+be able to setup an SSL tunnel (LDAPS) if your Erlang
+system has been configured with SSL.
+
+In the test directory there are some hints and examples
+on how to test the code and how to setup and populate
+an OpenLDAP server. The 'eldap' code has been tested
+agains OpenLDAP, IPlanet and ActiveDirectory servers.
+
+If you plan to incorporate this code into your system
+I suggest that you build a server/supervisor harnesk
+that uses 'eldap' (as we have done in our products).
+
+Good luck !
+/Tobbe
diff --git a/lib/eldap/asn1/ELDAPv3.asn1 b/lib/eldap/asn1/ELDAPv3.asn1
new file mode 100644
index 0000000000..72b87d7221
--- /dev/null
+++ b/lib/eldap/asn1/ELDAPv3.asn1
@@ -0,0 +1,278 @@
+-- Lightweight-Directory-Access-Protocol-V3 {1 3 6 1 1 18}
+-- Copyright (C) The Internet Society (2006). This version of
+-- this ASN.1 module is part of RFC 4511; see the RFC itself
+-- for full legal notices.
+ELDAPv3 DEFINITIONS
+IMPLICIT TAGS
+EXTENSIBILITY IMPLIED ::=
+
+BEGIN
+
+LDAPMessage ::= SEQUENCE {
+ messageID MessageID,
+ protocolOp CHOICE {
+ bindRequest BindRequest,
+ bindResponse BindResponse,
+ unbindRequest UnbindRequest,
+ searchRequest SearchRequest,
+ searchResEntry SearchResultEntry,
+ searchResDone SearchResultDone,
+ searchResRef SearchResultReference,
+ modifyRequest ModifyRequest,
+ modifyResponse ModifyResponse,
+ addRequest AddRequest,
+ addResponse AddResponse,
+ delRequest DelRequest,
+ delResponse DelResponse,
+ modDNRequest ModifyDNRequest,
+ modDNResponse ModifyDNResponse,
+ compareRequest CompareRequest,
+ compareResponse CompareResponse,
+ abandonRequest AbandonRequest,
+ extendedReq ExtendedRequest,
+ extendedResp ExtendedResponse,
+ ...,
+ intermediateResponse IntermediateResponse },
+ controls [0] Controls OPTIONAL }
+
+MessageID ::= INTEGER (0 .. maxInt)
+
+maxInt INTEGER ::= 2147483647 -- (2^^31 - 1) --
+
+LDAPString ::= OCTET STRING -- UTF-8 encoded,
+ -- [ISO10646] characters
+
+LDAPOID ::= OCTET STRING -- Constrained to <numericoid>
+ -- [RFC4512]
+
+LDAPDN ::= LDAPString -- Constrained to <distinguishedName>
+ -- [RFC4514]
+
+RelativeLDAPDN ::= LDAPString -- Constrained to <name-component>
+ -- [RFC4514]
+
+AttributeDescription ::= LDAPString
+ -- Constrained to <attributedescription>
+ -- [RFC4512]
+
+AttributeValue ::= OCTET STRING
+
+AttributeValueAssertion ::= SEQUENCE {
+ attributeDesc AttributeDescription,
+ assertionValue AssertionValue }
+
+AssertionValue ::= OCTET STRING
+
+PartialAttribute ::= SEQUENCE {
+ type AttributeDescription,
+ vals SET OF value AttributeValue }
+
+Attribute ::= PartialAttribute(WITH COMPONENTS {
+ ...,
+ vals (SIZE(1..MAX))})
+
+MatchingRuleId ::= LDAPString
+
+LDAPResult ::= SEQUENCE {
+ resultCode ENUMERATED {
+ success (0),
+ operationsError (1),
+ protocolError (2),
+ timeLimitExceeded (3),
+ sizeLimitExceeded (4),
+ compareFalse (5),
+ compareTrue (6),
+ authMethodNotSupported (7),
+ strongerAuthRequired (8),
+ -- 9 reserved --
+ referral (10),
+ adminLimitExceeded (11),
+ unavailableCriticalExtension (12),
+ confidentialityRequired (13),
+ saslBindInProgress (14),
+
+ noSuchAttribute (16),
+ undefinedAttributeType (17),
+ inappropriateMatching (18),
+ constraintViolation (19),
+ attributeOrValueExists (20),
+ invalidAttributeSyntax (21),
+ -- 22-31 unused --
+ noSuchObject (32),
+ aliasProblem (33),
+ invalidDNSyntax (34),
+ -- 35 reserved for undefined isLeaf --
+ aliasDereferencingProblem (36),
+ -- 37-47 unused --
+ inappropriateAuthentication (48),
+ invalidCredentials (49),
+ insufficientAccessRights (50),
+ busy (51),
+ unavailable (52),
+ unwillingToPerform (53),
+ loopDetect (54),
+ -- 55-63 unused --
+ namingViolation (64),
+ objectClassViolation (65),
+ notAllowedOnNonLeaf (66),
+ notAllowedOnRDN (67),
+ entryAlreadyExists (68),
+ objectClassModsProhibited (69),
+ -- 70 reserved for CLDAP --
+ affectsMultipleDSAs (71),
+ -- 72-79 unused --
+ other (80),
+ ... },
+ matchedDN LDAPDN,
+ diagnosticMessage LDAPString,
+ referral [3] Referral OPTIONAL }
+
+Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI
+
+URI ::= LDAPString -- limited to characters permitted in
+ -- URIs
+
+Controls ::= SEQUENCE OF control Control
+
+Control ::= SEQUENCE {
+ controlType LDAPOID,
+ criticality BOOLEAN DEFAULT FALSE,
+ controlValue OCTET STRING OPTIONAL }
+
+BindRequest ::= [APPLICATION 0] SEQUENCE {
+ version INTEGER (1 .. 127),
+ name LDAPDN,
+ authentication AuthenticationChoice }
+
+AuthenticationChoice ::= CHOICE {
+ simple [0] OCTET STRING,
+ -- 1 and 2 reserved
+ sasl [3] SaslCredentials,
+ ... }
+
+SaslCredentials ::= SEQUENCE {
+ mechanism LDAPString,
+ credentials OCTET STRING OPTIONAL }
+
+BindResponse ::= [APPLICATION 1] SEQUENCE {
+ COMPONENTS OF LDAPResult,
+ serverSaslCreds [7] OCTET STRING OPTIONAL }
+
+UnbindRequest ::= [APPLICATION 2] NULL
+
+SearchRequest ::= [APPLICATION 3] SEQUENCE {
+ baseObject LDAPDN,
+ scope ENUMERATED {
+ baseObject (0),
+ singleLevel (1),
+ wholeSubtree (2),
+ ... },
+ derefAliases ENUMERATED {
+ neverDerefAliases (0),
+ derefInSearching (1),
+ derefFindingBaseObj (2),
+ derefAlways (3) },
+ sizeLimit INTEGER (0 .. maxInt),
+ timeLimit INTEGER (0 .. maxInt),
+ typesOnly BOOLEAN,
+ filter Filter,
+ attributes AttributeSelection }
+
+AttributeSelection ::= SEQUENCE OF selector LDAPString
+ -- The LDAPString is constrained to
+ -- <attributeSelector> in Section 4.5.1.8
+
+Filter ::= CHOICE {
+ and [0] SET SIZE (1..MAX) OF filter Filter,
+ or [1] SET SIZE (1..MAX) OF filter Filter,
+ not [2] Filter,
+ equalityMatch [3] AttributeValueAssertion,
+ substrings [4] SubstringFilter,
+ greaterOrEqual [5] AttributeValueAssertion,
+ lessOrEqual [6] AttributeValueAssertion,
+ present [7] AttributeDescription,
+ approxMatch [8] AttributeValueAssertion,
+ extensibleMatch [9] MatchingRuleAssertion,
+ ... }
+
+SubstringFilter ::= SEQUENCE {
+ type AttributeDescription,
+ substrings SEQUENCE SIZE (1..MAX) OF substring CHOICE {
+ initial [0] AssertionValue, -- can occur at most once
+ any [1] AssertionValue,
+ final [2] AssertionValue } -- can occur at most once
+ }
+
+MatchingRuleAssertion ::= SEQUENCE {
+ matchingRule [1] MatchingRuleId OPTIONAL,
+ type [2] AttributeDescription OPTIONAL,
+ matchValue [3] AssertionValue,
+ dnAttributes [4] BOOLEAN DEFAULT FALSE }
+
+SearchResultEntry ::= [APPLICATION 4] SEQUENCE {
+ objectName LDAPDN,
+ attributes PartialAttributeList }
+
+PartialAttributeList ::= SEQUENCE OF
+ partialAttribute PartialAttribute
+
+SearchResultReference ::= [APPLICATION 19] SEQUENCE
+ SIZE (1..MAX) OF uri URI
+
+SearchResultDone ::= [APPLICATION 5] LDAPResult
+
+ModifyRequest ::= [APPLICATION 6] SEQUENCE {
+ object LDAPDN,
+ changes SEQUENCE OF change SEQUENCE {
+ operation ENUMERATED {
+ add (0),
+ delete (1),
+ replace (2),
+ ... },
+ modification PartialAttribute } }
+
+ModifyResponse ::= [APPLICATION 7] LDAPResult
+
+AddRequest ::= [APPLICATION 8] SEQUENCE {
+ entry LDAPDN,
+ attributes AttributeList }
+
+AttributeList ::= SEQUENCE OF attribute Attribute
+
+AddResponse ::= [APPLICATION 9] LDAPResult
+
+DelRequest ::= [APPLICATION 10] LDAPDN
+
+DelResponse ::= [APPLICATION 11] LDAPResult
+
+ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
+ entry LDAPDN,
+ newrdn RelativeLDAPDN,
+ deleteoldrdn BOOLEAN,
+ newSuperior [0] LDAPDN OPTIONAL }
+
+ModifyDNResponse ::= [APPLICATION 13] LDAPResult
+
+CompareRequest ::= [APPLICATION 14] SEQUENCE {
+ entry LDAPDN,
+ ava AttributeValueAssertion }
+
+CompareResponse ::= [APPLICATION 15] LDAPResult
+
+AbandonRequest ::= [APPLICATION 16] MessageID
+
+ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
+ requestName [0] LDAPOID,
+ requestValue [1] OCTET STRING OPTIONAL }
+
+ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
+ COMPONENTS OF LDAPResult,
+ responseName [10] LDAPOID OPTIONAL,
+ responseValue [11] OCTET STRING OPTIONAL }
+
+IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
+ responseName [0] LDAPOID OPTIONAL,
+ responseValue [1] OCTET STRING OPTIONAL }
+
+END
+
diff --git a/lib/inviso/doc/html/.gitignore b/lib/eldap/doc/html/.gitignore
index e69de29bb2..e69de29bb2 100644
--- a/lib/inviso/doc/html/.gitignore
+++ b/lib/eldap/doc/html/.gitignore
diff --git a/lib/inviso/doc/man3/.gitignore b/lib/eldap/doc/man3/.gitignore
index e69de29bb2..e69de29bb2 100644
--- a/lib/inviso/doc/man3/.gitignore
+++ b/lib/eldap/doc/man3/.gitignore
diff --git a/lib/inviso/doc/pdf/.gitignore b/lib/eldap/doc/pdf/.gitignore
index e69de29bb2..e69de29bb2 100644
--- a/lib/inviso/doc/pdf/.gitignore
+++ b/lib/eldap/doc/pdf/.gitignore
diff --git a/lib/inviso/doc/src/Makefile b/lib/eldap/doc/src/Makefile
index 1b184ed78b..a4827793f4 100644
--- a/lib/inviso/doc/src/Makefile
+++ b/lib/eldap/doc/src/Makefile
@@ -22,8 +22,8 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk
# Application version
# ----------------------------------------------------
include ../../vsn.mk
-VSN=$(INVISO_VSN)
-APPLICATION=inviso
+VSN=$(ELDAP_VSN)
+APPLICATION=eldap
# ----------------------------------------------------
# Release directory specification
@@ -34,25 +34,17 @@ RELSYSDIR = $(RELEASE_PATH)/lib/$(APPLICATION)-$(VSN)
# Target Specs
# ----------------------------------------------------
XML_APPLICATION_FILES = ref_man.xml
-XML_REF3_FILES = \
- inviso.xml \
- inviso_as_lib.xml \
- inviso_lfm.xml \
- inviso_lfm_tpfreader.xml \
- inviso_rt.xml \
- inviso_rt_meta.xml
+XML_REF3_FILES = eldap.xml
-XML_PART_FILES = part.xml part_notes.xml
-XML_CHAPTER_FILES = inviso_chapter.xml notes.xml
+XML_PART_FILES = release_notes.xml usersguide.xml
+XML_CHAPTER_FILES = notes.xml
BOOK_FILES = book.xml
-XML_FILES = \
- $(BOOK_FILES) $(XML_CHAPTER_FILES) \
- $(XML_PART_FILES) $(XML_REF3_FILES) $(XML_APPLICATION_FILES)
+XML_FILES = $(BOOK_FILES) $(XML_APPLICATION_FILES) $(XML_REF3_FILES) $(XML_REF6_FILES) \
+ $(XML_PART_FILES) $(XML_CHAPTER_FILES)
-GIF_FILES = \
- inviso_users_guide_pic1.gif
+GIF_FILES =
# ----------------------------------------------------
@@ -62,6 +54,7 @@ HTML_FILES = $(XML_APPLICATION_FILES:%.xml=$(HTMLDIR)/%.html) \
INFO_FILE = ../../info
MAN3_FILES = $(XML_REF3_FILES:%.xml=$(MAN3DIR)/%.3)
+MAN6_FILES = $(XML_REF6_FILES:%_app.xml=$(MAN6DIR)/%.6)
HTML_REF_MAN_FILE = $(HTMLDIR)/index.html
@@ -71,7 +64,6 @@ TOP_PDF_FILE = $(PDFDIR)/$(APPLICATION)-$(VSN).pdf
# FLAGS
# ----------------------------------------------------
XML_FLAGS +=
-DVIPS_FLAGS +=
# ----------------------------------------------------
# Targets
@@ -79,6 +71,7 @@ DVIPS_FLAGS +=
$(HTMLDIR)/%.gif: %.gif
$(INSTALL_DATA) $< $@
+
docs: pdf html man
$(TOP_PDF_FILE): $(XML_FILES)
@@ -87,36 +80,36 @@ pdf: $(TOP_PDF_FILE)
html: gifs $(HTML_REF_MAN_FILE)
-man: $(MAN3_FILES)
+man: $(MAN3_FILES) $(MAN6_FILES)
gifs: $(GIF_FILES:%=$(HTMLDIR)/%)
-debug opt:
+debug opt valgrind:
-clean clean_docs:
+clean clean_docs clean_tex:
rm -rf $(HTMLDIR)/*
rm -f $(MAN3DIR)/*
+ rm -f $(MAN6DIR)/*
rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
rm -f errs core *~
-
# ----------------------------------------------------
# Release Target
# ----------------------------------------------------
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
-
-release_spec:
-
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
+# $(INSTALL_DIR) "$(RELEASE_PATH)/man/man6"
+# $(INSTALL_DATA) $(MAN6DIR)/* "$(RELEASE_PATH)/man/man6"
+release_spec:
diff --git a/lib/inviso/doc/src/book.xml b/lib/eldap/doc/src/book.xml
index c258f33ff7..74f1c37cdc 100644
--- a/lib/inviso/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>2006</year><year>2009</year>
+ <year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -21,20 +21,19 @@
</legalnotice>
- <title>Inviso</title>
- <prepared></prepared>
+ <title>eldap</title>
+ <prepared>OTP team</prepared>
<docno></docno>
- <date></date>
- <rev></rev>
+ <date>1999-01-21</date>
+ <rev>A</rev>
+ <file>book.xml</file>
</header>
- <insidecover>
- </insidecover>
- <pagetext>Inviso</pagetext>
+ <pagetext>eldap</pagetext>
<preamble>
<contents level="2"></contents>
</preamble>
<parts lift="no">
- <xi:include href="part.xml"/>
+ <xi:include href="usersguide.xml"/>
</parts>
<applications>
<xi:include href="ref_man.xml"/>
diff --git a/lib/eldap/doc/src/eldap.xml b/lib/eldap/doc/src/eldap.xml
new file mode 100644
index 0000000000..04dad2eee7
--- /dev/null
+++ b/lib/eldap/doc/src/eldap.xml
@@ -0,0 +1,342 @@
+<?xml version="1.0" encoding="iso-8859-1" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ </legalnotice>
+
+ <title>eldap</title>
+ <prepared>Peter H&ouml;gfeldt</prepared>
+ <docno></docno>
+ <date>2000-06-20</date>
+ <rev>B</rev>
+ </header>
+ <module>eldap</module>
+ <modulesummary>Eldap Functions</modulesummary>
+ <description>
+ <p>This module provides a client api to the Lightweight Directory Access Protocol (LDAP).
+ </p>
+ <p>References:</p>
+ <list type="bulleted">
+ <item> <p>RFC 4510 - RFC 4519</p> </item>
+ </list>
+ <p>The above publications can be found at <url href="http://www.ietf.org">IETF</url>.
+ </p>
+ <p><em>Types</em></p>
+ <pre>
+handle() Connection handle
+attribute() {Type = string(), Values=[string()]}
+modify_op() See mod_add/2, mod_delete/2, mod_replace/2
+scope() See baseObject/0, singleLevel/0, wholeSubtree/0
+dereference() See neverDerefAliases/0, derefInSearching/0, derefFindingBaseObj/0, derefAlways/0
+filter() See present/1, substrings/2,
+ equalityMatch/2, greaterOrEqual/2, lessOrEqual/2,
+ approxMatch/2,
+ 'and'/1, 'or'/1, 'not'/1.
+ </pre>
+ <p></p>
+ </description>
+ <funcs>
+ <func>
+ <name>open([Host]) -> {ok, Handle} | {error, Reason}</name>
+ <fsummary>Open a connection to an LDAP server.</fsummary>
+ <type>
+ <v>Handle = handle()</v>
+ </type>
+ <desc>
+ <p>Setup a connection to an LDAP server, the <c>HOST</c>'s are tried in order. </p>
+ </desc>
+ </func>
+ <func>
+ <name>open([Host], [Option]) -> {ok, Handle} | {error, Reason}</name>
+ <fsummary>Open a connection to an LDAP server.</fsummary>
+ <type>
+ <v>Handle = handle()</v>
+ <v>Option = {port, integer()} | {log, function()} | {timeout, integer()} | {ssl, boolean()}</v>
+ </type>
+ <desc>
+ <p>Setup a connection to an LDAP server, the <c>HOST</c>'s are tried in order.</p>
+ <p>The log function takes three arguments, <c>fun(Level, FormatString, [FormatArg]) end</c>.</p>
+ <p>Timeout set the maximum time in milliseconds that each server request may take.</p>
+ </desc>
+ </func>
+ <func>
+ <name>close(Handle) -> ok</name>
+ <fsummary>Shutdown the connection.</fsummary>
+ <type>
+ <v>Handle = handle()</v>
+ </type>
+ <desc>
+ <p>Shutdown the connection.</p>
+ </desc>
+ </func>
+ <func>
+ <name>simple_bind(Handle, Dn, Password) -> ok | {error, Reason}</name>
+ <fsummary>Authenticate the connection.</fsummary>
+ <type>
+ <v>Handle = handle()</v>
+ <v>Dn = string()</v>
+ <v>Password = string()</v>
+ </type>
+ <desc>
+ <p>Authenticate the connection using simple authentication.</p>
+ </desc>
+ </func>
+ <func>
+ <name>add(Handle, Dn, [Attribute]) -> ok | {error, Reason}</name>
+ <fsummary>Add an entry.</fsummary>
+ <type>
+ <v>Handle = handle()</v>
+ <v>Dn = string()</v>
+ <v>Attribute = attribute()</v>
+ </type>
+ <desc>
+ <p> Add an entry. The entry must not exist.</p>
+ <pre>
+ add(Handle,
+ "cn=Bill Valentine, ou=people, o=Example Org, dc=example, dc=com",
+ [{"objectclass", ["person"]},
+ {"cn", ["Bill Valentine"]},
+ {"sn", ["Valentine"]},
+ {"telephoneNumber", ["545 555 00"]}]
+ )
+ </pre>
+ </desc>
+ </func>
+ <func>
+ <name>delete(Handle, Dn) -> ok | {error, Reason}</name>
+ <fsummary>Delete an entry.</fsummary>
+ <type>
+ <v>Dn = string()</v>
+ </type>
+ <desc>
+ <p> Delete an entry.</p>
+ <pre>
+ delete(Handle, "cn=Bill Valentine, ou=people, o=Example Org, dc=example, dc=com")
+ </pre>
+ </desc>
+ </func>
+
+ <func>
+ <name>mod_add(Type, [Value]) -> modify_op()</name>
+ <fsummary>Create a modification operation.</fsummary>
+ <type>
+ <v>Type = string()</v>
+ <v>Value = string()</v>
+ </type>
+ <desc> <p> Create an add modification operation.</p> </desc>
+ </func>
+ <func>
+ <name>mod_delete(Type, [Value]) -> modify_op()</name>
+ <fsummary>Create a modification operation.</fsummary>
+ <type>
+ <v>Type = string()</v>
+ <v>Value = string()</v>
+ </type>
+ <desc> <p> Create a delete modification operation.</p> </desc>
+ </func>
+ <func>
+ <name>mod_replace(Type, [Value]) -> modify_op()</name>
+ <fsummary>Create a modification operation.</fsummary>
+ <type>
+ <v>Type = string()</v>
+ <v>Value = string()</v>
+ </type>
+ <desc> <p> Create a replace modification operation.</p> </desc>
+ </func>
+
+ <func>
+ <name>modify(Handle, Dn, [ModifyOp]) -> ok | {error, Reason}</name>
+ <fsummary>Modify an entry.</fsummary>
+ <type>
+ <v>Dn = string()</v>
+ <v>ModifyOp = modify_op()</v>
+ </type>
+ <desc>
+ <p> Modify an entry.</p>
+ <pre>
+ modify(Handle, "cn=Bill Valentine, ou=people, o=Example Org, dc=example, dc=com",
+ [eldap:mod_replace("telephoneNumber", ["555 555 00"]),
+ eldap:mod_add("description", ["LDAP Hacker"]) ])
+ </pre>
+ </desc>
+ </func>
+ <func>
+ <name>modify_dn(Handle, Dn, NewRDN, DeleteOldRDN, NewSupDN) -> ok | {error, Reason}</name>
+ <fsummary>Modify the DN of an entry.</fsummary>
+ <type>
+ <v>Dn = string()</v>
+ <v>NewRDN = string()</v>
+ <v>DeleteOldRDN = boolean()</v>
+ <v>NewSupDN = string()</v>
+ </type>
+ <desc>
+ <p> Modify the DN of an entry. <c>DeleteOldRDN</c> indicates
+ whether the current RDN should be removed after operation.
+ <c>NewSupDN</c> should be "" if the RDN should not be moved or the new parent which
+ the RDN will be moved to.</p>
+ <pre>
+ modify_dn(Handle, "cn=Bill Valentine, ou=people, o=Example Org, dc=example, dc=com ",
+ "cn=Bill Jr Valentine", true, "")
+ </pre>
+ </desc>
+ </func>
+ <func>
+ <name>search(Handle, SearchOptions) -> {ok, #eldap_search_result{}} | {error, Reason}</name>
+ <fsummary>Search the Directory</fsummary>
+ <type>
+ <v>SearchOptions = #eldap_search{} | [SearchOption]</v>
+ <v>SearchOption = {base, string()} | {filter, filter()} | {scope, scope()}
+ | {attributes, [string()]} | {deref, dereference()} |
+ | {types_only, boolean()} | {timeout, integer()}
+ </v>
+ </type>
+ <desc>
+ <p>Search the directory with the supplied the SearchOptions.
+ The base and filter options must be supplied.
+ Default values: scope is <c>wholeSubtree()</c>, deref is <c>derefAlways()</c>,
+ types_only is <c>false</c> and timeout is <c>0</c> (meaning infinity).
+ </p>
+ <pre>
+ Filter = eldap:substrings("cn", [{any,"V"}]),
+ search(Handle, [{base, "dc=example, dc=com"}, {filter, Filter}, {attributes, ["cn"]}]),
+ </pre>
+ </desc>
+ </func>
+
+ <func>
+ <name>baseObject() -> scope()</name>
+ <fsummary>Create search scope.</fsummary>
+ <desc> <p> Search baseobject only.</p> </desc>
+ </func>
+ <func>
+ <name>singleLevel() -> scope()</name>
+ <fsummary>Create search scope.</fsummary>
+ <desc> <p> Search the specified level only, i.e. do not recurse.</p> </desc>
+ </func>
+ <func>
+ <name>wholeSubtree() -> scope()</name>
+ <fsummary>Create search scope.</fsummary>
+ <desc> <p> Search the entire subtree.</p> </desc>
+ </func>
+
+ <func>
+ <name>neverDerefAliases() -> dereference()</name>
+ <fsummary>Create search option.</fsummary>
+ <desc> <p>Never derefrence aliases, treat aliases as entries.</p> </desc>
+ </func>
+ <func>
+ <name>derefAlways() -> dereference()</name>
+ <fsummary>Create search option.</fsummary>
+ <desc> <p>Always derefrence aliases.</p> </desc>
+ </func>
+ <func>
+ <name>derefInSearching() -> dereference()</name>
+ <fsummary>Create search option.</fsummary>
+ <desc> <p>Derefrence aliases only when searching.</p> </desc>
+ </func>
+ <func>
+ <name>derefFindingBaseObj() -> dereference()</name>
+ <fsummary>Create search option.</fsummary>
+ <desc> <p>Derefrence aliases only in finding the base.</p> </desc>
+ </func>
+
+ <func>
+ <name>present(Type) -> filter()</name>
+ <fsummary>Create search filter option.</fsummary>
+ <type>
+ <v>Type = string()</v>
+ </type>
+ <desc> <p>Create a filter which filters on attribute type presence.</p> </desc>
+ </func>
+ <func>
+ <name>substrings(Type, [SubString]) -> filter()</name>
+ <fsummary>Create search filter option.</fsummary>
+ <type>
+ <v>Type = string()</v>
+ <v>SubString = {StringPart, string()}</v>
+ <v>StringPart = initial | any | final</v>
+ </type>
+ <desc> <p>Create a filter which filters on substrings.</p> </desc>
+ </func>
+ <func>
+ <name>equalityMatch(Type, Value) -> filter()</name>
+ <fsummary>Create search filter option.</fsummary>
+ <type>
+ <v>Type = string()</v>
+ <v>Value = string()</v>
+ </type>
+ <desc> <p>Create a equality filter.</p> </desc>
+ </func>
+ <func>
+ <name>greaterOrEqual(Type, Value) -> filter()</name>
+ <fsummary>Create search filter option.</fsummary>
+ <type>
+ <v>Type = string()</v>
+ <v>Value = string()</v>
+ </type>
+ <desc> <p>Create a greater or equal filter.</p> </desc>
+ </func>
+ <func>
+ <name>lessOrEqual(Type, Value) -> filter()</name>
+ <fsummary>Create search filter option.</fsummary>
+ <type>
+ <v>Type = string()</v>
+ <v>Value = string()</v>
+ </type>
+ <desc> <p>Create a less or equal filter.</p> </desc>
+ </func>
+ <func>
+ <name>approxMatch(Type, Value) -> filter()</name>
+ <fsummary>Create search filter option.</fsummary>
+ <type>
+ <v>Type = string()</v>
+ <v>Value = string()</v>
+ </type>
+ <desc> <p>Create a approximation match filter.</p> </desc>
+ </func>
+ <func>
+ <name>'and'([Filter]) -> filter()</name>
+ <fsummary>Create search filter option.</fsummary>
+ <type>
+ <v>Filter = filter()</v>
+ </type>
+ <desc> <p>Creates a filter where all <c>Filter</c> must be true.</p> </desc>
+ </func>
+ <func>
+ <name>'or'([Filter]) -> filter()</name>
+ <fsummary>Create search filter option.</fsummary>
+ <type>
+ <v>Filter = filter()</v>
+ </type>
+ <desc> <p>Create a filter where at least one of the <c>Filter</c> must be true.</p> </desc>
+ </func>
+ <func>
+ <name>'not'(Filter) -> filter()</name>
+ <fsummary>Create search filter option.</fsummary>
+ <type>
+ <v>Filter = filter()</v>
+ </type>
+ <desc> <p>Negate a filter.</p> </desc>
+ </func>
+
+ </funcs>
+
+</erlref>
+
diff --git a/lib/inviso/doc/src/fascicules.xml b/lib/eldap/doc/src/fascicules.xml
index 0678195e07..8fc250bc75 100644
--- a/lib/inviso/doc/src/fascicules.xml
+++ b/lib/eldap/doc/src/fascicules.xml
@@ -2,13 +2,13 @@
<!DOCTYPE fascicules SYSTEM "fascicules.dtd">
<fascicules>
- <fascicule file="part" href="part_frame.html" entry="no">
+ <fascicule file="usersguide" href="usersguide_frame.html" entry="no">
User's Guide
</fascicule>
<fascicule file="ref_man" href="ref_man_frame.html" entry="yes">
Reference Manual
</fascicule>
- <fascicule file="part_notes" href="part_notes_frame.html" entry="no">
+ <fascicule file="release_notes" href="release_notes_frame.html" entry="no">
Release Notes
</fascicule>
<fascicule file="" href="../../../../doc/print.html" entry="no">
diff --git a/lib/eldap/doc/src/note.gif b/lib/eldap/doc/src/note.gif
new file mode 100644
index 0000000000..6fffe30419
--- /dev/null
+++ b/lib/eldap/doc/src/note.gif
Binary files differ
diff --git a/lib/eldap/doc/src/notes.xml b/lib/eldap/doc/src/notes.xml
new file mode 100644
index 0000000000..d9b11875de
--- /dev/null
+++ b/lib/eldap/doc/src/notes.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="latin1" ?>
+<!DOCTYPE chapter SYSTEM "chapter.dtd">
+
+<chapter>
+ <header>
+ <copyright>
+ <year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ </legalnotice>
+
+ <title>Eldap Release Notes</title>
+ <prepared>OTP team</prepared>
+ <docno></docno>
+ <date>2003-06-06</date>
+ <rev>B</rev>
+ <file>notes.xml</file>
+ </header>
+ <p>This document describes the changes made to the Eldap application.</p>
+
+ <section>
+ <title>Eldap 1.0</title>
+ <p>New application. </p>
+ </section>
+</chapter>
+
diff --git a/lib/inviso/doc/src/ref_man.xml b/lib/eldap/doc/src/ref_man.xml
index c9e75e4029..70c4cee16d 100644
--- a/lib/inviso/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>2006</year><year>2009</year>
+ <year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -21,20 +21,17 @@
</legalnotice>
- <title>Inviso Reference Manual</title>
- <prepared></prepared>
+ <title>Eldap Reference Manual</title>
+ <prepared>OTP team</prepared>
<docno></docno>
- <date></date>
- <rev></rev>
+ <date>2003-06-01</date>
+ <rev>B</rev>
+ <file>refman.sgml</file>
</header>
<description>
- <p><em>Inviso</em>, an Erlang trace tool.</p>
+ <p>The <em>Eldap</em> application provides an api for accessing an LDAP server.</p>
+ <p>The original code was developed by Torbj&ouml;rn T&ouml;rnkvist.</p>
</description>
- <xi:include href="inviso.xml"/>
- <xi:include href="inviso_as_lib.xml"/>
- <xi:include href="inviso_lfm.xml"/>
- <xi:include href="inviso_lfm_tpfreader.xml"/>
- <xi:include href="inviso_rt.xml"/>
- <xi:include href="inviso_rt_meta.xml"/>
+ <xi:include href="eldap.xml"/>
</application>
diff --git a/lib/eldap/doc/src/release_notes.xml b/lib/eldap/doc/src/release_notes.xml
new file mode 100644
index 0000000000..778a49b894
--- /dev/null
+++ b/lib/eldap/doc/src/release_notes.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="latin1" ?>
+<!DOCTYPE part SYSTEM "part.dtd">
+
+<part>
+ <header>
+ <copyright>
+ <year>2012</year>
+ <holder>Ericsson AB, All Rights Reserved</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ The Initial Developer of the Original Code is Ericsson AB.
+ </legalnotice>
+
+ <title>Eldap Release Notes</title>
+ <prepared>OTP team</prepared>
+ <docno></docno>
+ <date>2003-06-01</date>
+ <rev>B</rev>
+ <file>release_notes.xml</file>
+ </header>
+ <description>
+ <p></p>
+ </description>
+ <include file="notes"></include>
+</part>
+
diff --git a/lib/inviso/doc/src/part_notes.xml b/lib/eldap/doc/src/usersguide.xml
index 1cd8b0f1a7..828588e88e 100644
--- a/lib/inviso/doc/src/part_notes.xml
+++ b/lib/eldap/doc/src/usersguide.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2006</year><year>2009</year>
+ <year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,23 +13,26 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
- <title>Inviso Release Notes</title>
- <prepared></prepared>
+ <title>Eldap User's Guide</title>
+ <prepared>OTP Team</prepared>
<docno></docno>
- <date></date>
- <rev></rev>
+ <date>2003-06-01</date>
+ <rev>C</rev>
+ <file>usersguide.xml</file>
</header>
<description>
- <p><em>Inviso</em>, an Erlang trace tool.</p>
+ <p>The <em>Eldap</em> application provides an api for accessing an LDAP server.</p>
+ <p>The original code was developed by Torbj&ouml;rn T&ouml;rnkvist.</p>
</description>
- <xi:include href="notes.xml"/>
+
+
</part>
diff --git a/lib/eldap/doc/src/warning.gif b/lib/eldap/doc/src/warning.gif
new file mode 100644
index 0000000000..96af52360e
--- /dev/null
+++ b/lib/eldap/doc/src/warning.gif
Binary files differ
diff --git a/lib/inviso/ebin/.gitignore b/lib/eldap/ebin/.gitignore
index e69de29bb2..e69de29bb2 100644
--- a/lib/inviso/ebin/.gitignore
+++ b/lib/eldap/ebin/.gitignore
diff --git a/lib/eldap/include/eldap.hrl b/lib/eldap/include/eldap.hrl
new file mode 100644
index 0000000000..7c12cd4f2b
--- /dev/null
+++ b/lib/eldap/include/eldap.hrl
@@ -0,0 +1,33 @@
+-ifndef( _ELDAP_HRL ).
+-define( _ELDAP_HRL , 1 ).
+
+%%%
+%%% Search input parameters
+%%%
+-record(eldap_search, {
+ base = [], % Baseobject
+ filter = [], % Search conditions
+ scope=wholeSubtree, % Search scope
+ deref=derefAlways, % Dereference
+ attributes = [], % Attributes to be returned
+ types_only = false, % Return types+values or types
+ timeout = 0 % Timelimit for search
+ }).
+
+%%%
+%%% Returned search result
+%%%
+-record(eldap_search_result, {
+ entries = [], % List of #eldap_entry{} records
+ referrals = [] % List of referrals
+ }).
+
+%%%
+%%% LDAP entry
+%%%
+-record(eldap_entry, {
+ object_name = "", % The DN for the entry
+ attributes = [] % List of {Attribute, Value} pairs
+ }).
+
+-endif.
diff --git a/lib/eldap/info b/lib/eldap/info
new file mode 100644
index 0000000000..463f9af6ea
--- /dev/null
+++ b/lib/eldap/info
@@ -0,0 +1,2 @@
+group: comm
+short: eldap - Erlang LDAP library
diff --git a/lib/eldap/src/Makefile b/lib/eldap/src/Makefile
new file mode 100644
index 0000000000..39a41d08e2
--- /dev/null
+++ b/lib/eldap/src/Makefile
@@ -0,0 +1,110 @@
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 2012. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+#
+#
+include $(ERL_TOP)/make/target.mk
+
+include $(ERL_TOP)/make/$(TARGET)/otp.mk
+
+# ----------------------------------------------------
+# Application version
+# ----------------------------------------------------
+include ../vsn.mk
+
+# ----------------------------------------------------
+# Release directory specification
+# ----------------------------------------------------
+RELSYSDIR = $(RELEASE_PATH)/lib/eldap-$(ELDAP_VSN)
+
+# ----------------------------------------------------
+# Target Specs
+# ----------------------------------------------------
+
+MODULES= eldap
+
+ASN1_FILES = ELDAPv3.asn1
+ASN1_HRL = $(EBIN)/$(ASN1_FILES:%.asn1=%.hrl)
+
+ERL_FILES= $(MODULES:%=%.erl)
+
+TARGET_FILES = $(MODULES:%=$(EBIN)/%.$(EMULATOR)) $(ASN1_FILES:%.asn1=$(EBIN)/%.$(EMULATOR))
+
+EXTERNAL_HRL_FILES = ../include/eldap.hrl
+
+HRL_FILES = $(EXTERNAL_HRL_FILES) $(ASN1_HRL)
+
+APPUP_FILE = eldap.appup
+APPUP_SRC = $(APPUP_FILE).src
+APPUP_TARGET = $(EBIN)/$(APPUP_FILE)
+
+APP_FILE = eldap.app
+APP_SRC = $(APP_FILE).src
+APP_TARGET = $(EBIN)/$(APP_FILE)
+
+# ----------------------------------------------------
+# FLAGS
+# ----------------------------------------------------
+ERL_COMPILE_FLAGS += -I../include -I../ebin
+
+# ----------------------------------------------------
+# Targets
+# ----------------------------------------------------
+opt: $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET)
+
+debug:
+ @${MAKE} TYPE=debug opt
+
+clean:
+ rm -f $(TARGET_FILES) $(GEN_FILES) $(APP_TARGET) $(APPUP_TARGET)
+ rm -f $(ASN1_FILES:%.asn1=$(EBIN)/%.*)
+ rm -f errs core *~
+
+$(APP_TARGET): $(APP_SRC) ../vsn.mk
+ sed -e 's;%VSN%;$(ELDAP_VSN);' $< > $@
+
+$(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
+ sed -e 's;%VSN%;$(ELDAP_VSN);' $< > $@
+
+docs:
+
+$(TARGET_FILES): $(HRL_FILES)
+
+# ----------------------------------------------------
+# Special Build Targets
+# ----------------------------------------------------
+$(ASN1_HRL): ../asn1/$(ASN1_FILES)
+ $(ERLC) -o $(EBIN) -bber_bin +optimize +nif $(ERL_COMPILE_FLAGS) ../asn1/ELDAPv3.asn1
+
+# ----------------------------------------------------
+# Release Target
+# ----------------------------------------------------
+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_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/asn1"
+ $(INSTALL_DATA) ../asn1/$(ASN1_FILES) "$(RELSYSDIR)/asn1"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(EXTERNAL_HRL_FILES) "$(RELSYSDIR)/include"
+
+release_docs_spec:
+
+
diff --git a/lib/eldap/src/eldap.app.src b/lib/eldap/src/eldap.app.src
new file mode 100644
index 0000000000..8215328910
--- /dev/null
+++ b/lib/eldap/src/eldap.app.src
@@ -0,0 +1,8 @@
+{application, eldap,
+ [{description, "Ldap api"},
+ {vsn, "%VSN%"},
+ {modules, [eldap, 'ELDAPv3']},
+ {registered, []},
+ {applications, [kernel, stdlib]},
+ {env, []}
+]}.
diff --git a/lib/eldap/src/eldap.appup.src b/lib/eldap/src/eldap.appup.src
new file mode 100644
index 0000000000..8d33482f11
--- /dev/null
+++ b/lib/eldap/src/eldap.appup.src
@@ -0,0 +1,6 @@
+%% -*- erlang -*-
+{"%VSN%",
+ [
+ ],
+ [
+ ]}.
diff --git a/lib/eldap/src/eldap.erl b/lib/eldap/src/eldap.erl
new file mode 100644
index 0000000000..699dfc8791
--- /dev/null
+++ b/lib/eldap/src/eldap.erl
@@ -0,0 +1,1114 @@
+-module(eldap).
+%%% --------------------------------------------------------------------
+%%% Created: 12 Oct 2000 by Tobbe <[email protected]>
+%%% Function: Erlang client LDAP implementation according RFC 2251,2253
+%%% and 2255. The interface is based on RFC 1823, and
+%%% draft-ietf-asid-ldap-c-api-00.txt
+%%%
+%%% Copyright (c) 2010 Torbjorn Tornkvist
+%%% See MIT-LICENSE at the top dir for licensing information.
+%%% --------------------------------------------------------------------
+-vc('$Id$ ').
+-export([open/1,open/2,simple_bind/3,controlling_process/2,
+ baseObject/0,singleLevel/0,wholeSubtree/0,close/1,
+ equalityMatch/2,greaterOrEqual/2,lessOrEqual/2,
+ approxMatch/2,search/2,substrings/2,present/1,
+ 'and'/1,'or'/1,'not'/1,modify/3, mod_add/2, mod_delete/2,
+ mod_replace/2, add/3, delete/2, modify_dn/5,parse_dn/1,
+ parse_ldap_url/1]).
+
+-export([neverDerefAliases/0, derefInSearching/0,
+ derefFindingBaseObj/0, derefAlways/0]).
+
+%% for upgrades
+-export([loop/2]).
+
+-import(lists,[concat/1]).
+
+-include("ELDAPv3.hrl").
+-include("eldap.hrl").
+
+-define(LDAP_VERSION, 3).
+-define(LDAP_PORT, 389).
+-define(LDAPS_PORT, 636).
+
+-record(eldap, {version = ?LDAP_VERSION,
+ host, % Host running LDAP server
+ port = ?LDAP_PORT, % The LDAP server port
+ fd, % Socket filedescriptor.
+ binddn = "", % Name of the entry to bind as
+ passwd, % Password for (above) entry
+ id = 0, % LDAP Request ID
+ log, % User provided log function
+ timeout = infinity, % Request timeout
+ anon_auth = false, % Allow anonymous authentication
+ use_tls = false % LDAP/LDAPS
+ }).
+
+%%% For debug purposes
+%%-define(PRINT(S, A), io:fwrite("~w(~w): " ++ S, [?MODULE,?LINE|A])).
+-define(PRINT(S, A), true).
+
+-define(elog(S, A), error_logger:info_msg("~w(~w): "++S,[?MODULE,?LINE|A])).
+
+%%% ====================================================================
+%%% Exported interface
+%%% ====================================================================
+
+%%% --------------------------------------------------------------------
+%%% open(Hosts [,Opts] )
+%%% --------------------
+%%% Setup a connection to on of the Hosts in the argument
+%%% list. Stop at the first successful connection attempt.
+%%% Valid Opts are: Where:
+%%%
+%%% {port, Port} - Port is the port number
+%%% {log, F} - F(LogLevel, FormatString, ListOfArgs)
+%%% {timeout, milliSec} - Server request timeout
+%%%
+%%% --------------------------------------------------------------------
+open(Hosts) ->
+ open(Hosts, []).
+
+open(Hosts, Opts) when is_list(Hosts), is_list(Opts) ->
+ Self = self(),
+ Pid = spawn_link(fun() -> init(Hosts, Opts, Self) end),
+ recv(Pid).
+
+%%% --------------------------------------------------------------------
+%%% Shutdown connection (and process) asynchronous.
+%%% --------------------------------------------------------------------
+
+close(Handle) when is_pid(Handle) ->
+ send(Handle, close).
+
+%%% --------------------------------------------------------------------
+%%% Set who we should link ourselves to
+%%% --------------------------------------------------------------------
+
+controlling_process(Handle, Pid) when is_pid(Handle), is_pid(Pid) ->
+ link(Pid),
+ send(Handle, {cnt_proc, Pid}),
+ recv(Handle).
+
+%%% --------------------------------------------------------------------
+%%% Authenticate ourselves to the Directory
+%%% using simple authentication.
+%%%
+%%% Dn - The name of the entry to bind as
+%%% Passwd - The password to be used
+%%%
+%%% Returns: ok | {error, Error}
+%%% --------------------------------------------------------------------
+simple_bind(Handle, Dn, Passwd) when is_pid(Handle) ->
+ send(Handle, {simple_bind, Dn, Passwd}),
+ recv(Handle).
+
+%%% --------------------------------------------------------------------
+%%% Add an entry. The entry field MUST NOT exist for the AddRequest
+%%% to succeed. The parent of the entry MUST exist.
+%%% Example:
+%%%
+%%% add(Handle,
+%%% "cn=Bill Valentine, ou=people, o=Bluetail AB, dc=bluetail, dc=com",
+%%% [{"objectclass", ["person"]},
+%%% {"cn", ["Bill Valentine"]},
+%%% {"sn", ["Valentine"]},
+%%% {"telephoneNumber", ["545 555 00"]}]
+%%% )
+%%% --------------------------------------------------------------------
+add(Handle, Entry, Attributes) when is_pid(Handle),is_list(Entry),is_list(Attributes) ->
+ send(Handle, {add, Entry, add_attrs(Attributes)}),
+ recv(Handle).
+
+%%% Do sanity check !
+add_attrs(Attrs) ->
+ F = fun({Type,Vals}) when is_list(Type),is_list(Vals) ->
+ %% Confused ? Me too... :-/
+ {'AddRequest_attributes',Type, Vals}
+ end,
+ case catch lists:map(F, Attrs) of
+ {'EXIT', _} -> throw({error, attribute_values});
+ Else -> Else
+ end.
+
+%%% --------------------------------------------------------------------
+%%% Delete an entry. The entry consists of the DN of
+%%% the entry to be deleted.
+%%% Example:
+%%%
+%%% delete(Handle,
+%%% "cn=Bill Valentine, ou=people, o=Bluetail AB, dc=bluetail, dc=com"
+%%% )
+%%% --------------------------------------------------------------------
+delete(Handle, Entry) when is_pid(Handle), is_list(Entry) ->
+ send(Handle, {delete, Entry}),
+ recv(Handle).
+
+%%% --------------------------------------------------------------------
+%%% Modify an entry. Given an entry a number of modification
+%%% operations can be performed as one atomic operation.
+%%% Example:
+%%%
+%%% modify(Handle,
+%%% "cn=Torbjorn Tornkvist, ou=people, o=Bluetail AB, dc=bluetail, dc=com",
+%%% [mod_replace("telephoneNumber", ["555 555 00"]),
+%%% mod_add("description", ["LDAP hacker"])]
+%%% )
+%%% --------------------------------------------------------------------
+modify(Handle, Object, Mods) when is_pid(Handle), is_list(Object), is_list(Mods) ->
+ send(Handle, {modify, Object, Mods}),
+ recv(Handle).
+
+%%%
+%%% Modification operations.
+%%% Example:
+%%% mod_replace("telephoneNumber", ["555 555 00"])
+%%%
+mod_add(Type, Values) when is_list(Type), is_list(Values) -> m(add, Type, Values).
+mod_delete(Type, Values) when is_list(Type), is_list(Values) -> m(delete, Type, Values).
+mod_replace(Type, Values) when is_list(Type), is_list(Values) -> m(replace, Type, Values).
+
+m(Operation, Type, Values) ->
+ #'ModifyRequest_changes_SEQOF'{
+ operation = Operation,
+ modification = #'PartialAttribute'{
+ type = Type,
+ vals = Values}}.
+
+%%% --------------------------------------------------------------------
+%%% Modify an entry. Given an entry a number of modification
+%%% operations can be performed as one atomic operation.
+%%% Example:
+%%%
+%%% modify_dn(Handle,
+%%% "cn=Bill Valentine, ou=people, o=Bluetail AB, dc=bluetail, dc=com",
+%%% "cn=Ben Emerson",
+%%% true,
+%%% ""
+%%% )
+%%% --------------------------------------------------------------------
+modify_dn(Handle, Entry, NewRDN, DelOldRDN, NewSup)
+ when is_pid(Handle),is_list(Entry),is_list(NewRDN),is_atom(DelOldRDN),is_list(NewSup) ->
+ send(Handle, {modify_dn, Entry, NewRDN,
+ bool_p(DelOldRDN), optional(NewSup)}),
+ recv(Handle).
+
+%%% Sanity checks !
+
+bool_p(Bool) when Bool==true;Bool==false -> Bool.
+
+optional([]) -> asn1_NOVALUE;
+optional(Value) -> Value.
+
+%%% --------------------------------------------------------------------
+%%% Synchronous search of the Directory returning a
+%%% requested set of attributes.
+%%%
+%%% Example:
+%%%
+%%% Filter = eldap:substrings("cn", [{any,"o"}]),
+%%% eldap:search(S, [{base, "dc=bluetail, dc=com"},
+%%% {filter, Filter},
+%%% {attributes,["cn"]}])),
+%%%
+%%% Returned result: {ok, #eldap_search_result{}}
+%%%
+%%% Example:
+%%%
+%%% {ok,{eldap_search_result,
+%%% [{eldap_entry,
+%%% "cn=Magnus Froberg, dc=bluetail, dc=com",
+%%% [{"cn",["Magnus Froberg"]}]},
+%%% {eldap_entry,
+%%% "cn=Torbjorn Tornkvist, dc=bluetail, dc=com",
+%%% [{"cn",["Torbjorn Tornkvist"]}]}],
+%%% []}}
+%%%
+%%% --------------------------------------------------------------------
+search(Handle, A) when is_pid(Handle), is_record(A, eldap_search) ->
+ call_search(Handle, A);
+search(Handle, L) when is_pid(Handle), is_list(L) ->
+ case catch parse_search_args(L) of
+ {error, Emsg} -> {error, Emsg};
+ A when is_record(A, eldap_search) -> call_search(Handle, A)
+ end.
+
+call_search(Handle, A) ->
+ send(Handle, {search, A}),
+ recv(Handle).
+
+parse_search_args(Args) ->
+ parse_search_args(Args,
+ #eldap_search{scope = wholeSubtree,
+ deref = derefAlways}).
+
+parse_search_args([{base, Base}|T],A) ->
+ parse_search_args(T,A#eldap_search{base = Base});
+parse_search_args([{filter, Filter}|T],A) ->
+ parse_search_args(T,A#eldap_search{filter = Filter});
+parse_search_args([{scope, Scope}|T],A) ->
+ parse_search_args(T,A#eldap_search{scope = Scope});
+parse_search_args([{deref, Deref}|T],A) ->
+ parse_search_args(T,A#eldap_search{deref = Deref});
+parse_search_args([{attributes, Attrs}|T],A) ->
+ parse_search_args(T,A#eldap_search{attributes = Attrs});
+parse_search_args([{types_only, TypesOnly}|T],A) ->
+ parse_search_args(T,A#eldap_search{types_only = TypesOnly});
+parse_search_args([{timeout, Timeout}|T],A) when is_integer(Timeout) ->
+ parse_search_args(T,A#eldap_search{timeout = Timeout});
+parse_search_args([H|_],_) ->
+ throw({error,{unknown_arg, H}});
+parse_search_args([],A) ->
+ A.
+
+%%%
+%%% The Scope parameter
+%%%
+baseObject() -> baseObject.
+singleLevel() -> singleLevel.
+wholeSubtree() -> wholeSubtree.
+
+%%
+%% The derefAliases parameter
+%%
+neverDerefAliases() -> neverDerefAliases.
+derefInSearching() -> derefInSearching.
+derefFindingBaseObj() -> derefFindingBaseObj.
+derefAlways() -> derefAlways.
+
+%%%
+%%% Boolean filter operations
+%%%
+'and'(ListOfFilters) when is_list(ListOfFilters) -> {'and',ListOfFilters}.
+'or'(ListOfFilters) when is_list(ListOfFilters) -> {'or', ListOfFilters}.
+'not'(Filter) when is_tuple(Filter) -> {'not',Filter}.
+
+%%%
+%%% The following Filter parameters consist of an attribute
+%%% and an attribute value. Example: F("uid","tobbe")
+%%%
+equalityMatch(Desc, Value) -> {equalityMatch, av_assert(Desc, Value)}.
+greaterOrEqual(Desc, Value) -> {greaterOrEqual, av_assert(Desc, Value)}.
+lessOrEqual(Desc, Value) -> {lessOrEqual, av_assert(Desc, Value)}.
+approxMatch(Desc, Value) -> {approxMatch, av_assert(Desc, Value)}.
+
+av_assert(Desc, Value) ->
+ #'AttributeValueAssertion'{attributeDesc = Desc,
+ assertionValue = Value}.
+
+%%%
+%%% Filter to check for the presence of an attribute
+%%%
+present(Attribute) when is_list(Attribute) ->
+ {present, Attribute}.
+
+
+%%%
+%%% A substring filter seem to be based on a pattern:
+%%%
+%%% InitValue*AnyValue*FinalValue
+%%%
+%%% where all three parts seem to be optional (at least when
+%%% talking with an OpenLDAP server). Thus, the arguments
+%%% to substrings/2 looks like this:
+%%%
+%%% Type ::= string( <attribute> )
+%%% SubStr ::= listof( {initial,Value} | {any,Value}, {final,Value})
+%%%
+%%% Example: substrings("sn",[{initial,"To"},{any,"kv"},{final,"st"}])
+%%% will match entries containing: 'sn: Tornkvist'
+%%%
+substrings(Type, SubStr) when is_list(Type), is_list(SubStr) ->
+ Ss = {'SubstringFilter_substrings',v_substr(SubStr)},
+ {substrings,#'SubstringFilter'{type = Type,
+ substrings = Ss}}.
+
+%%% --------------------------------------------------------------------
+%%% Worker process. We keep track of a controlling process to
+%%% be able to terminate together with it.
+%%% --------------------------------------------------------------------
+
+init(Hosts, Opts, Cpid) ->
+ Data = parse_args(Opts, Cpid, #eldap{}),
+ case try_connect(Hosts, Data) of
+ {ok,Data2} ->
+ send(Cpid, {ok,self()}),
+ ?MODULE:loop(Cpid, Data2);
+ Else ->
+ send(Cpid, Else),
+ unlink(Cpid),
+ exit(Else)
+ end.
+
+parse_args([{port, Port}|T], Cpid, Data) when is_integer(Port) ->
+ parse_args(T, Cpid, Data#eldap{port = Port});
+parse_args([{timeout, Timeout}|T], Cpid, Data) when is_integer(Timeout),Timeout>0 ->
+ parse_args(T, Cpid, Data#eldap{timeout = Timeout});
+parse_args([{anon_auth, true}|T], Cpid, Data) ->
+ parse_args(T, Cpid, Data#eldap{anon_auth = false});
+parse_args([{anon_auth, _}|T], Cpid, Data) ->
+ parse_args(T, Cpid, Data);
+parse_args([{ssl, true}|T], Cpid, Data) ->
+ parse_args(T, Cpid, Data#eldap{use_tls = true});
+parse_args([{ssl, _}|T], Cpid, Data) ->
+ parse_args(T, Cpid, Data);
+parse_args([{log, F}|T], Cpid, Data) when is_function(F) ->
+ parse_args(T, Cpid, Data#eldap{log = F});
+parse_args([{log, _}|T], Cpid, Data) ->
+ parse_args(T, Cpid, Data);
+parse_args([H|_], Cpid, _) ->
+ send(Cpid, {error,{wrong_option,H}}),
+ exit(wrong_option);
+parse_args([], _, Data) ->
+ Data.
+
+%%% Try to connect to the hosts in the listed order,
+%%% and stop with the first one to which a successful
+%%% connection is made.
+
+try_connect([Host|Hosts], Data) ->
+ TcpOpts = [{packet, asn1}, {active,false}],
+ try do_connect(Host, Data, TcpOpts) of
+ {ok,Fd} -> {ok,Data#eldap{host = Host, fd = Fd}};
+ Err ->
+ log2(Data, "Connect: ~p failed ~p~n",[Host, Err]),
+ try_connect(Hosts, Data)
+ catch _:Err ->
+ log2(Data, "Connect: ~p failed ~p~n",[Host, Err]),
+ try_connect(Hosts, Data)
+ end;
+try_connect([],_) ->
+ {error,"connect failed"}.
+
+do_connect(Host, Data, Opts) when Data#eldap.use_tls == false ->
+ gen_tcp:connect(Host, Data#eldap.port, Opts, Data#eldap.timeout);
+do_connect(Host, Data, Opts) when Data#eldap.use_tls == true ->
+ ssl:connect(Host, Data#eldap.port, [{verify,0}|Opts]).
+
+
+loop(Cpid, Data) ->
+ receive
+
+ {From, {search, A}} ->
+ {Res,NewData} = do_search(Data, A),
+ send(From,Res),
+ ?MODULE:loop(Cpid, NewData);
+
+ {From, {modify, Obj, Mod}} ->
+ {Res,NewData} = do_modify(Data, Obj, Mod),
+ send(From,Res),
+ ?MODULE:loop(Cpid, NewData);
+
+ {From, {modify_dn, Obj, NewRDN, DelOldRDN, NewSup}} ->
+ {Res,NewData} = do_modify_dn(Data, Obj, NewRDN, DelOldRDN, NewSup),
+ send(From,Res),
+ ?MODULE:loop(Cpid, NewData);
+
+ {From, {add, Entry, Attrs}} ->
+ {Res,NewData} = do_add(Data, Entry, Attrs),
+ send(From,Res),
+ ?MODULE:loop(Cpid, NewData);
+
+ {From, {delete, Entry}} ->
+ {Res,NewData} = do_delete(Data, Entry),
+ send(From,Res),
+ ?MODULE:loop(Cpid, NewData);
+
+ {From, {simple_bind, Dn, Passwd}} ->
+ {Res,NewData} = do_simple_bind(Data, Dn, Passwd),
+ send(From,Res),
+ ?MODULE:loop(Cpid, NewData);
+
+ {From, {cnt_proc, NewCpid}} ->
+ unlink(Cpid),
+ send(From,ok),
+ ?PRINT("New Cpid is: ~p~n",[NewCpid]),
+ ?MODULE:loop(NewCpid, Data);
+
+ {_From, close} ->
+ unlink(Cpid),
+ exit(closed);
+
+ {Cpid, 'EXIT', Reason} ->
+ ?PRINT("Got EXIT from Cpid, reason=~p~n",[Reason]),
+ exit(Reason);
+
+ _XX ->
+ ?PRINT("loop got: ~p~n",[_XX]),
+ ?MODULE:loop(Cpid, Data)
+
+ end.
+
+%%% --------------------------------------------------------------------
+%%% bindRequest
+%%% --------------------------------------------------------------------
+
+%%% Authenticate ourselves to the directory using
+%%% simple authentication.
+
+do_simple_bind(Data, anon, anon) -> %% For testing
+ do_the_simple_bind(Data, "", "");
+do_simple_bind(Data, Dn, _Passwd) when Dn=="",Data#eldap.anon_auth==false ->
+ {{error,anonymous_auth},Data};
+do_simple_bind(Data, _Dn, Passwd) when Passwd=="",Data#eldap.anon_auth==false ->
+ {{error,anonymous_auth},Data};
+do_simple_bind(Data, Dn, Passwd) ->
+ do_the_simple_bind(Data, Dn, Passwd).
+
+do_the_simple_bind(Data, Dn, Passwd) ->
+ case catch exec_simple_bind(Data#eldap{binddn = Dn,
+ passwd = Passwd,
+ id = bump_id(Data)}) of
+ {ok,NewData} -> {ok,NewData};
+ {error,Emsg} -> {{error,Emsg},Data};
+ Else -> {{error,Else},Data}
+ end.
+
+exec_simple_bind(Data) ->
+ Req = #'BindRequest'{version = Data#eldap.version,
+ name = Data#eldap.binddn,
+ authentication = {simple, Data#eldap.passwd}},
+ log2(Data, "bind request = ~p~n", [Req]),
+ Reply = request(Data#eldap.fd, Data, Data#eldap.id, {bindRequest, Req}),
+ log2(Data, "bind reply = ~p~n", [Reply]),
+ exec_simple_bind_reply(Data, Reply).
+
+exec_simple_bind_reply(Data, {ok,Msg}) when
+ Msg#'LDAPMessage'.messageID == Data#eldap.id ->
+ case Msg#'LDAPMessage'.protocolOp of
+ {bindResponse, Result} ->
+ case Result#'BindResponse'.resultCode of
+ success -> {ok,Data};
+ Error -> {error, Error}
+ end;
+ Other -> {error, Other}
+ end;
+exec_simple_bind_reply(_, Error) ->
+ {error, Error}.
+
+
+%%% --------------------------------------------------------------------
+%%% searchRequest
+%%% --------------------------------------------------------------------
+
+do_search(Data, A) ->
+ case catch do_search_0(Data, A) of
+ {error,Emsg} -> {ldap_closed_p(Data, Emsg),Data};
+ {'EXIT',Error} -> {ldap_closed_p(Data, Error),Data};
+ {ok,Res,Ref,NewData} -> {{ok,polish(Res, Ref)},NewData};
+ {{error,Reason},NewData} -> {{error,Reason},NewData};
+ Else -> {ldap_closed_p(Data, Else),Data}
+ end.
+
+%%%
+%%% Polish the returned search result
+%%%
+
+polish(Res, Ref) ->
+ R = polish_result(Res),
+ %%% No special treatment of referrals at the moment.
+ #eldap_search_result{entries = R,
+ referrals = Ref}.
+
+polish_result([H|T]) when is_record(H, 'SearchResultEntry') ->
+ ObjectName = H#'SearchResultEntry'.objectName,
+ F = fun({_,A,V}) -> {A,V} end,
+ Attrs = lists:map(F, H#'SearchResultEntry'.attributes),
+ [#eldap_entry{object_name = ObjectName,
+ attributes = Attrs}|
+ polish_result(T)];
+polish_result([]) ->
+ [].
+
+do_search_0(Data, A) ->
+ Req = #'SearchRequest'{baseObject = A#eldap_search.base,
+ scope = v_scope(A#eldap_search.scope),
+ derefAliases = v_deref(A#eldap_search.deref),
+ sizeLimit = 0, % no size limit
+ timeLimit = v_timeout(A#eldap_search.timeout),
+ typesOnly = v_bool(A#eldap_search.types_only),
+ filter = v_filter(A#eldap_search.filter),
+ attributes = v_attributes(A#eldap_search.attributes)
+ },
+ Id = bump_id(Data),
+ collect_search_responses(Data#eldap{id=Id}, Req, Id).
+
+%%% The returned answers cames in one packet per entry
+%%% mixed with possible referals
+
+collect_search_responses(Data, Req, ID) ->
+ S = Data#eldap.fd,
+ log2(Data, "search request = ~p~n", [Req]),
+ send_request(S, Data, ID, {searchRequest, Req}),
+ Resp = recv_response(S, Data),
+ log2(Data, "search reply = ~p~n", [Resp]),
+ collect_search_responses(Data, S, ID, Resp, [], []).
+
+collect_search_responses(Data, S, ID, {ok,Msg}, Acc, Ref)
+ when is_record(Msg,'LDAPMessage') ->
+ case Msg#'LDAPMessage'.protocolOp of
+ {'searchResDone',R} ->
+ case R#'LDAPResult'.resultCode of
+ success ->
+ log2(Data, "search reply = searchResDone ~n", []),
+ {ok,Acc,Ref,Data};
+ Reason ->
+ {{error,Reason},Data}
+ end;
+ {'searchResEntry',R} when is_record(R,'SearchResultEntry') ->
+ Resp = recv_response(S, Data),
+ log2(Data, "search reply = ~p~n", [Resp]),
+ collect_search_responses(Data, S, ID, Resp, [R|Acc], Ref);
+ {'searchResRef',R} ->
+ %% At the moment we don't do anyting sensible here since
+ %% I haven't been able to trigger the server to generate
+ %% a response like this.
+ Resp = recv_response(S, Data),
+ log2(Data, "search reply = ~p~n", [Resp]),
+ collect_search_responses(Data, S, ID, Resp, Acc, [R|Ref]);
+ Else ->
+ throw({error,Else})
+ end;
+collect_search_responses(_, _, _, Else, _, _) ->
+ throw({error,Else}).
+
+%%% --------------------------------------------------------------------
+%%% addRequest
+%%% --------------------------------------------------------------------
+
+do_add(Data, Entry, Attrs) ->
+ case catch do_add_0(Data, Entry, Attrs) of
+ {error,Emsg} -> {ldap_closed_p(Data, Emsg),Data};
+ {'EXIT',Error} -> {ldap_closed_p(Data, Error),Data};
+ {ok,NewData} -> {ok,NewData};
+ Else -> {ldap_closed_p(Data, Else),Data}
+ end.
+
+do_add_0(Data, Entry, Attrs) ->
+ Req = #'AddRequest'{entry = Entry,
+ attributes = Attrs},
+ S = Data#eldap.fd,
+ Id = bump_id(Data),
+ log2(Data, "add request = ~p~n", [Req]),
+ Resp = request(S, Data, Id, {addRequest, Req}),
+ log2(Data, "add reply = ~p~n", [Resp]),
+ check_reply(Data#eldap{id = Id}, Resp, addResponse).
+
+
+%%% --------------------------------------------------------------------
+%%% deleteRequest
+%%% --------------------------------------------------------------------
+
+do_delete(Data, Entry) ->
+ case catch do_delete_0(Data, Entry) of
+ {error,Emsg} -> {ldap_closed_p(Data, Emsg),Data};
+ {'EXIT',Error} -> {ldap_closed_p(Data, Error),Data};
+ {ok,NewData} -> {ok,NewData};
+ Else -> {ldap_closed_p(Data, Else),Data}
+ end.
+
+do_delete_0(Data, Entry) ->
+ S = Data#eldap.fd,
+ Id = bump_id(Data),
+ log2(Data, "del request = ~p~n", [Entry]),
+ Resp = request(S, Data, Id, {delRequest, Entry}),
+ log2(Data, "del reply = ~p~n", [Resp]),
+ check_reply(Data#eldap{id = Id}, Resp, delResponse).
+
+
+%%% --------------------------------------------------------------------
+%%% modifyRequest
+%%% --------------------------------------------------------------------
+
+do_modify(Data, Obj, Mod) ->
+ case catch do_modify_0(Data, Obj, Mod) of
+ {error,Emsg} -> {ldap_closed_p(Data, Emsg),Data};
+ {'EXIT',Error} -> {ldap_closed_p(Data, Error),Data};
+ {ok,NewData} -> {ok,NewData};
+ Else -> {ldap_closed_p(Data, Else),Data}
+ end.
+
+do_modify_0(Data, Obj, Mod) ->
+ v_modifications(Mod),
+ Req = #'ModifyRequest'{object = Obj,
+ changes = Mod},
+ S = Data#eldap.fd,
+ Id = bump_id(Data),
+ log2(Data, "modify request = ~p~n", [Req]),
+ Resp = request(S, Data, Id, {modifyRequest, Req}),
+ log2(Data, "modify reply = ~p~n", [Resp]),
+ check_reply(Data#eldap{id = Id}, Resp, modifyResponse).
+
+%%% --------------------------------------------------------------------
+%%% modifyDNRequest
+%%% --------------------------------------------------------------------
+
+do_modify_dn(Data, Entry, NewRDN, DelOldRDN, NewSup) ->
+ case catch do_modify_dn_0(Data, Entry, NewRDN, DelOldRDN, NewSup) of
+ {error,Emsg} -> {ldap_closed_p(Data, Emsg),Data};
+ {'EXIT',Error} -> {ldap_closed_p(Data, Error),Data};
+ {ok,NewData} -> {ok,NewData};
+ Else -> {ldap_closed_p(Data, Else),Data}
+ end.
+
+do_modify_dn_0(Data, Entry, NewRDN, DelOldRDN, NewSup) ->
+ Req = #'ModifyDNRequest'{entry = Entry,
+ newrdn = NewRDN,
+ deleteoldrdn = DelOldRDN,
+ newSuperior = NewSup},
+ S = Data#eldap.fd,
+ Id = bump_id(Data),
+ log2(Data, "modify DN request = ~p~n", [Req]),
+ Resp = request(S, Data, Id, {modDNRequest, Req}),
+ log2(Data, "modify DN reply = ~p~n", [Resp]),
+ check_reply(Data#eldap{id = Id}, Resp, modDNResponse).
+
+%%% --------------------------------------------------------------------
+%%% Send an LDAP request and receive the answer
+%%% --------------------------------------------------------------------
+
+request(S, Data, ID, Request) ->
+ send_request(S, Data, ID, Request),
+ recv_response(S, Data).
+
+send_request(S, Data, ID, Request) ->
+ Message = #'LDAPMessage'{messageID = ID,
+ protocolOp = Request},
+ {ok,Bytes} = asn1rt:encode('ELDAPv3', 'LDAPMessage', Message),
+ case do_send(S, Data, Bytes) of
+ {error,Reason} -> throw({gen_tcp_error,Reason});
+ Else -> Else
+ end.
+
+do_send(S, Data, Bytes) when Data#eldap.use_tls == false ->
+ gen_tcp:send(S, Bytes);
+do_send(S, Data, Bytes) when Data#eldap.use_tls == true ->
+ ssl:send(S, Bytes).
+
+do_recv(S, #eldap{use_tls=false, timeout=Timeout}, Len) ->
+ gen_tcp:recv(S, Len, Timeout);
+do_recv(S, #eldap{use_tls=true, timeout=Timeout}, Len) ->
+ ssl:recv(S, Len, Timeout).
+
+recv_response(S, Data) ->
+ case do_recv(S, Data, 0) of
+ {ok, Packet} ->
+ check_tag(Packet),
+ case asn1rt:decode('ELDAPv3', 'LDAPMessage', Packet) of
+ {ok,Resp} -> {ok,Resp};
+ Error -> throw(Error)
+ end;
+ {error,Reason} ->
+ throw({gen_tcp_error, Reason});
+ Error ->
+ throw(Error)
+ end.
+
+%%% Sanity check of received packet
+check_tag(Data) ->
+ case asn1rt_ber_bin:decode_tag(l2b(Data)) of
+ {_Tag, Data1, _Rb} ->
+ case asn1rt_ber_bin:decode_length(l2b(Data1)) of
+ {{_Len, _Data2}, _Rb2} -> ok;
+ _ -> throw({error,decoded_tag_length})
+ end;
+ _ -> throw({error,decoded_tag})
+ end.
+
+%%% Check for expected kind of reply
+check_reply(Data, {ok,Msg}, Op) when
+ Msg#'LDAPMessage'.messageID == Data#eldap.id ->
+ case Msg#'LDAPMessage'.protocolOp of
+ {Op, Result} ->
+ case Result#'LDAPResult'.resultCode of
+ success -> {ok,Data};
+ Error -> {error, Error}
+ end;
+ Other -> {error, Other}
+ end;
+check_reply(_, Error, _) ->
+ {error, Error}.
+
+
+%%% --------------------------------------------------------------------
+%%% Verify the input data
+%%% --------------------------------------------------------------------
+
+v_filter({'and',L}) -> {'and',L};
+v_filter({'or', L}) -> {'or',L};
+v_filter({'not',L}) -> {'not',L};
+v_filter({equalityMatch,AV}) -> {equalityMatch,AV};
+v_filter({greaterOrEqual,AV}) -> {greaterOrEqual,AV};
+v_filter({lessOrEqual,AV}) -> {lessOrEqual,AV};
+v_filter({approxMatch,AV}) -> {approxMatch,AV};
+v_filter({present,A}) -> {present,A};
+v_filter({substrings,S}) when is_record(S,'SubstringFilter') -> {substrings,S};
+v_filter(_Filter) -> throw({error,concat(["unknown filter: ",_Filter])}).
+
+v_modifications(Mods) ->
+ F = fun({_,Op,_}) ->
+ case lists:member(Op,[add,delete,replace]) of
+ true -> true;
+ _ -> throw({error,{mod_operation,Op}})
+ end
+ end,
+ lists:foreach(F, Mods).
+
+v_substr([{Key,Str}|T]) when is_list(Str),Key==initial;Key==any;Key==final ->
+ [{Key,Str}|v_substr(T)];
+v_substr([H|_]) ->
+ throw({error,{substring_arg,H}});
+v_substr([]) ->
+ [].
+v_scope(baseObject) -> baseObject;
+v_scope(singleLevel) -> singleLevel;
+v_scope(wholeSubtree) -> wholeSubtree;
+v_scope(_Scope) -> throw({error,concat(["unknown scope: ",_Scope])}).
+
+v_deref(DR = neverDerefAliases) -> DR;
+v_deref(DR = derefInSearching) -> DR;
+v_deref(DR = derefFindingBaseObj) -> DR;
+v_deref(DR = derefAlways ) -> DR.
+
+v_bool(true) -> true;
+v_bool(false) -> false;
+v_bool(_Bool) -> throw({error,concat(["not Boolean: ",_Bool])}).
+
+v_timeout(I) when is_integer(I), I>=0 -> I;
+v_timeout(_I) -> throw({error,concat(["timeout not positive integer: ",_I])}).
+
+v_attributes(Attrs) ->
+ F = fun(A) when is_list(A) -> A;
+ (A) -> throw({error,concat(["attribute not String: ",A])})
+ end,
+ lists:map(F,Attrs).
+
+
+%%% --------------------------------------------------------------------
+%%% Log routines. Call a user provided log routine F.
+%%% --------------------------------------------------------------------
+
+%log1(Data, Str, Args) -> log(Data, Str, Args, 1).
+log2(Data, Str, Args) -> log(Data, Str, Args, 2).
+
+log(Data, Str, Args, Level) when is_function(Data#eldap.log) ->
+ catch (Data#eldap.log)(Level, Str, Args);
+log(_, _, _, _) ->
+ ok.
+
+
+%%% --------------------------------------------------------------------
+%%% Misc. routines
+%%% --------------------------------------------------------------------
+
+send(To,Msg) -> To ! {self(),Msg}.
+recv(From) ->
+ receive
+ {From,Msg} -> Msg;
+ {'EXIT', From, Reason} ->
+ {error, {internal_error, Reason}}
+ end.
+
+ldap_closed_p(Data, Emsg) when Data#eldap.use_tls == true ->
+ %% Check if the SSL socket seems to be alive or not
+ case catch ssl:sockname(Data#eldap.fd) of
+ {error, _} ->
+ ssl:close(Data#eldap.fd),
+ {error, ldap_closed};
+ {ok, _} ->
+ {error, Emsg};
+ _ ->
+ %% sockname crashes if the socket pid is not alive
+ {error, ldap_closed}
+ end;
+ldap_closed_p(Data, Emsg) ->
+ %% non-SSL socket
+ case inet:port(Data#eldap.fd) of
+ {error,_} -> {error, ldap_closed};
+ _ -> {error,Emsg}
+ end.
+
+bump_id(Data) -> Data#eldap.id + 1.
+
+
+%%% --------------------------------------------------------------------
+%%% parse_dn/1 - Implementation of RFC 2253:
+%%%
+%%% "UTF-8 String Representation of Distinguished Names"
+%%%
+%%% Test cases:
+%%%
+%%% The simplest case:
+%%%
+%%% 1> eldap:parse_dn("CN=Steve Kille,O=Isode Limited,C=GB").
+%%% {ok,[[{attribute_type_and_value,"CN","Steve Kille"}],
+%%% [{attribute_type_and_value,"O","Isode Limited"}],
+%%% [{attribute_type_and_value,"C","GB"}]]}
+%%%
+%%% The first RDN is multi-valued:
+%%%
+%%% 2> eldap:parse_dn("OU=Sales+CN=J. Smith,O=Widget Inc.,C=US").
+%%% {ok,[[{attribute_type_and_value,"OU","Sales"},
+%%% {attribute_type_and_value,"CN","J. Smith"}],
+%%% [{attribute_type_and_value,"O","Widget Inc."}],
+%%% [{attribute_type_and_value,"C","US"}]]}
+%%%
+%%% Quoting a comma:
+%%%
+%%% 3> eldap:parse_dn("CN=L. Eagle,O=Sue\\, Grabbit and Runn,C=GB").
+%%% {ok,[[{attribute_type_and_value,"CN","L. Eagle"}],
+%%% [{attribute_type_and_value,"O","Sue\\, Grabbit and Runn"}],
+%%% [{attribute_type_and_value,"C","GB"}]]}
+%%%
+%%% A value contains a carriage return:
+%%%
+%%% 4> eldap:parse_dn("CN=Before
+%%% 4> After,O=Test,C=GB").
+%%% {ok,[[{attribute_type_and_value,"CN","Before\nAfter"}],
+%%% [{attribute_type_and_value,"O","Test"}],
+%%% [{attribute_type_and_value,"C","GB"}]]}
+%%%
+%%% 5> eldap:parse_dn("CN=Before\\0DAfter,O=Test,C=GB").
+%%% {ok,[[{attribute_type_and_value,"CN","Before\\0DAfter"}],
+%%% [{attribute_type_and_value,"O","Test"}],
+%%% [{attribute_type_and_value,"C","GB"}]]}
+%%%
+%%% An RDN in OID form:
+%%%
+%%% 6> eldap:parse_dn("1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB").
+%%% {ok,[[{attribute_type_and_value,"1.3.6.1.4.1.1466.0","#04024869"}],
+%%% [{attribute_type_and_value,"O","Test"}],
+%%% [{attribute_type_and_value,"C","GB"}]]}
+%%%
+%%%
+%%% --------------------------------------------------------------------
+
+parse_dn("") -> % empty DN string
+ {ok,[]};
+parse_dn([H|_] = Str) when H=/=$, -> % 1:st name-component !
+ case catch parse_name(Str,[]) of
+ {'EXIT',Reason} -> {parse_error,internal_error,Reason};
+ Else -> Else
+ end.
+
+parse_name("",Acc) ->
+ {ok,lists:reverse(Acc)};
+parse_name([$,|T],Acc) -> % N:th name-component !
+ parse_name(T,Acc);
+parse_name(Str,Acc) ->
+ {Rest,NameComponent} = parse_name_component(Str),
+ parse_name(Rest,[NameComponent|Acc]).
+
+parse_name_component(Str) ->
+ parse_name_component(Str,[]).
+
+parse_name_component(Str,Acc) ->
+ case parse_attribute_type_and_value(Str) of
+ {[$+|Rest], ATV} ->
+ parse_name_component(Rest,[ATV|Acc]);
+ {Rest,ATV} ->
+ {Rest,lists:reverse([ATV|Acc])}
+ end.
+
+parse_attribute_type_and_value(Str) ->
+ case parse_attribute_type(Str) of
+ {_Rest,[]} ->
+ parse_error(expecting_attribute_type,Str);
+ {Rest,Type} ->
+ Rest2 = parse_equal_sign(Rest),
+ {Rest3,Value} = parse_attribute_value(Rest2),
+ {Rest3,{attribute_type_and_value,Type,Value}}
+ end.
+
+-define(IS_ALPHA(X) , X>=$a,X=<$z;X>=$A,X=<$Z ).
+-define(IS_DIGIT(X) , X>=$0,X=<$9 ).
+-define(IS_SPECIAL(X) , X==$,;X==$=;X==$+;X==$<;X==$>;X==$#;X==$; ).
+-define(IS_QUOTECHAR(X) , X=/=$\\,X=/=$" ).
+-define(IS_STRINGCHAR(X) ,
+ X=/=$,,X=/=$=,X=/=$+,X=/=$<,X=/=$>,X=/=$#,X=/=$;,?IS_QUOTECHAR(X) ).
+-define(IS_HEXCHAR(X) , ?IS_DIGIT(X);X>=$a,X=<$f;X>=$A,X=<$F ).
+
+parse_attribute_type([H|T]) when ?IS_ALPHA(H) ->
+ %% NB: It must be an error in the RFC in the definition
+ %% of 'attributeType', should be: (ALPHA *keychar)
+ {Rest,KeyChars} = parse_keychars(T),
+ {Rest,[H|KeyChars]};
+parse_attribute_type([H|_] = Str) when ?IS_DIGIT(H) ->
+ parse_oid(Str);
+parse_attribute_type(Str) ->
+ parse_error(invalid_attribute_type,Str).
+
+
+
+%%% Is a hexstring !
+parse_attribute_value([$#,X,Y|T]) when ?IS_HEXCHAR(X),?IS_HEXCHAR(Y) ->
+ {Rest,HexString} = parse_hexstring(T),
+ {Rest,[$#,X,Y|HexString]};
+%%% Is a "quotation-sequence" !
+parse_attribute_value([$"|T]) ->
+ {Rest,Quotation} = parse_quotation(T),
+ {Rest,[$"|Quotation]};
+%%% Is a stringchar , pair or Empty !
+parse_attribute_value(Str) ->
+ parse_string(Str).
+
+parse_hexstring(Str) ->
+ parse_hexstring(Str,[]).
+
+parse_hexstring([X,Y|T],Acc) when ?IS_HEXCHAR(X),?IS_HEXCHAR(Y) ->
+ parse_hexstring(T,[Y,X|Acc]);
+parse_hexstring(T,Acc) ->
+ {T,lists:reverse(Acc)}.
+
+parse_quotation([$"|T]) -> % an empty: "" is ok !
+ {T,[$"]};
+parse_quotation(Str) ->
+ parse_quotation(Str,[]).
+
+%%% Parse to end of quotation
+parse_quotation([$"|T],Acc) ->
+ {T,lists:reverse([$"|Acc])};
+parse_quotation([X|T],Acc) when ?IS_QUOTECHAR(X) ->
+ parse_quotation(T,[X|Acc]);
+parse_quotation([$\\,X|T],Acc) when ?IS_SPECIAL(X) ->
+ parse_quotation(T,[X,$\\|Acc]);
+parse_quotation([$\\,$\\|T],Acc) ->
+ parse_quotation(T,[$\\,$\\|Acc]);
+parse_quotation([$\\,$"|T],Acc) ->
+ parse_quotation(T,[$",$\\|Acc]);
+parse_quotation([$\\,X,Y|T],Acc) when ?IS_HEXCHAR(X),?IS_HEXCHAR(Y) ->
+ parse_quotation(T,[Y,X,$\\|Acc]);
+parse_quotation(T,_) ->
+ parse_error(expecting_double_quote_mark,T).
+
+parse_string(Str) ->
+ parse_string(Str,[]).
+
+parse_string("",Acc) ->
+ {"",lists:reverse(Acc)};
+parse_string([H|T],Acc) when ?IS_STRINGCHAR(H) ->
+ parse_string(T,[H|Acc]);
+parse_string([$\\,X|T],Acc) when ?IS_SPECIAL(X) -> % is a pair !
+ parse_string(T,[X,$\\|Acc]);
+parse_string([$\\,$\\|T],Acc) -> % is a pair !
+ parse_string(T,[$\\,$\\|Acc]);
+parse_string([$\\,$" |T],Acc) -> % is a pair !
+ parse_string(T,[$" ,$\\|Acc]);
+parse_string([$\\,X,Y|T],Acc) when ?IS_HEXCHAR(X),?IS_HEXCHAR(Y) -> % is a pair!
+ parse_string(T,[Y,X,$\\|Acc]);
+parse_string(T,Acc) ->
+ {T,lists:reverse(Acc)}.
+
+parse_equal_sign([$=|T]) -> T;
+parse_equal_sign(T) -> parse_error(expecting_equal_sign,T).
+
+parse_keychars(Str) -> parse_keychars(Str,[]).
+
+parse_keychars([H|T],Acc) when ?IS_ALPHA(H) -> parse_keychars(T,[H|Acc]);
+parse_keychars([H|T],Acc) when ?IS_DIGIT(H) -> parse_keychars(T,[H|Acc]);
+parse_keychars([$-|T],Acc) -> parse_keychars(T,[$-|Acc]);
+parse_keychars(T,Acc) -> {T,lists:reverse(Acc)}.
+
+parse_oid(Str) -> parse_oid(Str,[]).
+
+parse_oid([H,$.|T], Acc) when ?IS_DIGIT(H) ->
+ parse_oid(T,[$.,H|Acc]);
+parse_oid([H|T], Acc) when ?IS_DIGIT(H) ->
+ parse_oid(T,[H|Acc]);
+parse_oid(T, Acc) ->
+ {T,lists:reverse(Acc)}.
+
+parse_error(Emsg,Rest) ->
+ throw({parse_error,Emsg,Rest}).
+
+
+%%% --------------------------------------------------------------------
+%%% Parse LDAP url according to RFC 2255
+%%%
+%%% Test case:
+%%%
+%%% 2> eldap:parse_ldap_url("ldap://10.42.126.33:389/cn=Administrative%20CA,o=Post%20Danmark,c=DK?certificateRevokationList;binary").
+%%% {ok,{{10,42,126,33},389},
+%%% [[{attribute_type_and_value,"cn","Administrative%20CA"}],
+%%% [{attribute_type_and_value,"o","Post%20Danmark"}],
+%%% [{attribute_type_and_value,"c","DK"}]],
+%%% {attributes,["certificateRevokationList;binary"]}}
+%%%
+%%% --------------------------------------------------------------------
+
+parse_ldap_url("ldap://" ++ Rest1 = Str) ->
+ {Rest2,HostPort} = parse_hostport(Rest1),
+ %% Split the string into DN and Attributes+etc
+ {Sdn,Rest3} = split_string(rm_leading_slash(Rest2),$?),
+ case parse_dn(Sdn) of
+ {parse_error,internal_error,_Reason} ->
+ {parse_error,internal_error,{Str,[]}};
+ {parse_error,Emsg,Tail} ->
+ Head = get_head(Str,Tail),
+ {parse_error,Emsg,{Head,Tail}};
+ {ok,DN} ->
+ %% We stop parsing here for now and leave
+ %% 'scope', 'filter' and 'extensions' to
+ %% be implemented later if needed.
+ {_Rest4,Attributes} = parse_attributes(Rest3),
+ {ok,HostPort,DN,Attributes}
+ end.
+
+rm_leading_slash([$/|Tail]) -> Tail;
+rm_leading_slash(Tail) -> Tail.
+
+parse_attributes([$?|Tail]) ->
+ case split_string(Tail,$?) of
+ {[],Attributes} ->
+ {[],{attributes,string:tokens(Attributes,",")}};
+ {Attributes,Rest} ->
+ {Rest,{attributes,string:tokens(Attributes,",")}}
+ end.
+
+parse_hostport(Str) ->
+ {HostPort,Rest} = split_string(Str,$/),
+ case split_string(HostPort,$:) of
+ {Shost,[]} ->
+ {Rest,{parse_host(Rest,Shost),?LDAP_PORT}};
+ {Shost,[$:|Sport]} ->
+ {Rest,{parse_host(Rest,Shost),
+ parse_port(Rest,Sport)}}
+ end.
+
+parse_port(Rest,Sport) ->
+ try list_to_integer(Sport)
+ catch _:_ -> parse_error(parsing_port,Rest)
+ end.
+
+parse_host(Rest,Shost) ->
+ case catch validate_host(Shost) of
+ {parse_error,Emsg,_} -> parse_error(Emsg,Rest);
+ Host -> Host
+ end.
+
+validate_host(Shost) ->
+ case inet_parse:address(Shost) of
+ {ok,Host} -> Host;
+ _ ->
+ case inet_parse:domain(Shost) of
+ true -> Shost;
+ _ -> parse_error(parsing_host,Shost)
+ end
+ end.
+
+
+split_string(Str,Key) ->
+ Pred = fun(X) when X==Key -> false; (_) -> true end,
+ lists:splitwith(Pred, Str).
+
+get_head(Str,Tail) ->
+ get_head(Str,Tail,[]).
+
+%%% Should always succeed !
+get_head([H|Tail],Tail,Rhead) -> lists:reverse([H|Rhead]);
+get_head([H|Rest],Tail,Rhead) -> get_head(Rest,Tail,[H|Rhead]).
+
+l2b(B) when is_binary(B) -> B;
+l2b(L) when is_list(L) -> list_to_binary(L).
+
diff --git a/lib/eldap/test/Makefile b/lib/eldap/test/Makefile
new file mode 100644
index 0000000000..3c5810eece
--- /dev/null
+++ b/lib/eldap/test/Makefile
@@ -0,0 +1,83 @@
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 2012. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+#
+
+include $(ERL_TOP)/make/target.mk
+include $(ERL_TOP)/make/$(TARGET)/otp.mk
+
+
+INCLUDES= -I. -I ../include
+
+# ----------------------------------------------------
+# Target Specs
+# ----------------------------------------------------
+
+MODULES= \
+ eldap_basic_SUITE
+
+ERL_FILES= $(MODULES:%=%.erl)
+
+HRL_FILES=
+
+TARGET_FILES= \
+ $(MODULES:%=$(EBIN)/%.$(EMULATOR))
+
+SPEC_FILES = eldap.spec
+
+# COVER_FILE = eldap.cover
+
+
+# ----------------------------------------------------
+# Release directory specification
+# ----------------------------------------------------
+RELSYSDIR = $(RELEASE_PATH)/eldap_test
+
+# ----------------------------------------------------
+# FLAGS
+# ----------------------------------------------------
+ERL_COMPILE_FLAGS += $(INCLUDES) -pa $(ERL_TOP)/lib/eldap/ebin
+
+EBIN = .
+
+# ----------------------------------------------------
+# Targets
+# ----------------------------------------------------
+
+tests debug opt: $(TARGET_FILES)
+
+
+clean:
+ rm -f $(TARGET_FILES)
+ rm -f core
+
+docs:
+
+# ----------------------------------------------------
+# Release Target
+# ----------------------------------------------------
+include $(ERL_TOP)/make/otp_release_targets.mk
+
+release_spec: opt
+
+release_tests_spec: opt
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(SPEC_FILES) $(ERL_FILES) $(COVER_FILE) $(HRL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+# @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
+release_docs_spec:
diff --git a/lib/eldap/test/eldap.spec b/lib/eldap/test/eldap.spec
new file mode 100644
index 0000000000..b14e9a655a
--- /dev/null
+++ b/lib/eldap/test/eldap.spec
@@ -0,0 +1 @@
+{suites,"../eldap_test",all}.
diff --git a/lib/eldap/test/eldap_basic_SUITE.erl b/lib/eldap/test/eldap_basic_SUITE.erl
new file mode 100644
index 0000000000..c7e3052b29
--- /dev/null
+++ b/lib/eldap/test/eldap_basic_SUITE.erl
@@ -0,0 +1,222 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(eldap_basic_SUITE).
+
+-compile(export_all).
+
+%%-include_lib("common_test/include/ct.hrl").
+-include_lib("test_server/include/test_server.hrl").
+-include_lib("eldap/include/eldap.hrl").
+
+-define(TIMEOUT, 120000). % 2 min
+
+init_per_suite(Config0) ->
+ {{EldapHost,Port}, Config1} =
+ case catch ct:get_config(eldap_server, undefined) of
+ undefined -> %% Dev test only
+ Server = {"localhost", 9876},
+ {Server, [{eldap_server, {"localhost", 9876}}|Config0]};
+ {'EXIT', _} -> %% Dev test only
+ Server = {"localhost", 9876},
+ {Server, [{eldap_server, {"localhost", 9876}}|Config0]};
+ Server ->
+ {Server, [{eldap_server, Server}|Config0]}
+ end,
+ %% Add path for this test run
+ try
+ {ok, Handle} = eldap:open([EldapHost], [{port, Port}]),
+ ok = eldap:simple_bind(Handle, "cn=Manager,dc=ericsson,dc=se", "hejsan"),
+ {ok, MyHost} = inet:gethostname(),
+ Path = "dc="++MyHost++",dc=ericsson,dc=se",
+ Config = [{eldap_path,Path}|Config1],
+ eldap:add(Handle,"dc=ericsson,dc=se",
+ [{"objectclass", ["dcObject", "organization"]},
+ {"dc", ["ericsson"]}, {"o", ["Testing"]}]),
+ eldap:add(Handle,Path,
+ [{"objectclass", ["dcObject", "organization"]},
+ {"dc", [MyHost]}, {"o", ["Test machine"]}]),
+ Config
+ catch error:{badmatch,Error} ->
+ io:format("Eldap init error ~p~n ~p~n",[Error, erlang:get_stacktrace()]),
+ {skip, lists:flatten(io_lib:format("Ldap init failed with host ~p", [EldapHost]))}
+ end.
+end_per_suite(Config) ->
+ %% Cleanup everything
+ {EHost, Port} = proplists:get_value(eldap_server, Config),
+ Path = proplists:get_value(eldap_path, Config),
+ {ok, H} = eldap:open([EHost], [{port, Port}]),
+ ok = eldap:simple_bind(H, "cn=Manager,dc=ericsson,dc=se", "hejsan"),
+ case eldap:search(H, [{base, Path},
+ {filter, eldap:present("objectclass")},
+ {scope, eldap:wholeSubtree()}])
+ of
+ {ok, {eldap_search_result, Entries, _}} ->
+ [ok = eldap:delete(H, Entry) || {eldap_entry, Entry, _} <- Entries];
+ _ -> ignore
+ end,
+ ok.
+
+init_per_testcase(_TestCase, Config) -> Config.
+end_per_testcase(_TestCase, _Config) -> ok.
+
+%% suite() ->
+
+all() ->
+ [app,
+ api].
+
+app(doc) -> "Test that the eldap app file is ok";
+app(suite) -> [];
+app(Config) when is_list(Config) ->
+ ok = test_server:app_test(public_key).
+
+api(doc) -> "Basic test that all api functions works as expected";
+api(suite) -> [];
+api(Config) ->
+ {Host,Port} = proplists:get_value(eldap_server, Config),
+ {ok, H} = eldap:open([Host], [{port,Port}]),
+ %% {ok, H} = eldap:open([Host], [{port,Port+1}, {ssl, true}]),
+ BasePath = proplists:get_value(eldap_path, Config),
+ All = fun(Where) ->
+ eldap:search(H, #eldap_search{base=Where,
+ filter=eldap:present("objectclass"),
+ scope= eldap:wholeSubtree()})
+ end,
+ Search = fun(Filter) ->
+ eldap:search(H, #eldap_search{base=BasePath,
+ filter=Filter,
+ scope=eldap:singleLevel()})
+ end,
+ {ok, #eldap_search_result{entries=[_]}} = All(BasePath),
+ {error, noSuchObject} = All("cn=Bar,"++BasePath),
+
+ {error, _} = eldap:add(H, "cn=Jonas Jonsson," ++ BasePath,
+ [{"objectclass", ["person"]},
+ {"cn", ["Jonas Jonsson"]}, {"sn", ["Jonsson"]}]),
+ eldap:simple_bind(H, "cn=Manager,dc=ericsson,dc=se", "hejsan"),
+
+ %% Add
+ ok = eldap:add(H, "cn=Jonas Jonsson," ++ BasePath,
+ [{"objectclass", ["person"]},
+ {"cn", ["Jonas Jonsson"]}, {"sn", ["Jonsson"]}]),
+ ok = eldap:add(H, "cn=Foo Bar," ++ BasePath,
+ [{"objectclass", ["person"]},
+ {"cn", ["Foo Bar"]}, {"sn", ["Bar"]}, {"telephoneNumber", ["555-1232", "555-5432"]}]),
+ ok = eldap:add(H, "ou=Team," ++ BasePath,
+ [{"objectclass", ["organizationalUnit"]},
+ {"ou", ["Team"]}]),
+
+ %% Search
+ JJSR = {ok, #eldap_search_result{entries=[#eldap_entry{}]}} = Search(eldap:equalityMatch("sn", "Jonsson")),
+ JJSR = Search(eldap:substrings("sn", [{any, "ss"}])),
+ FBSR = {ok, #eldap_search_result{entries=[#eldap_entry{object_name=FB}]}} =
+ Search(eldap:substrings("sn", [{any, "a"}])),
+ FBSR = Search(eldap:substrings("sn", [{initial, "B"}])),
+ FBSR = Search(eldap:substrings("sn", [{final, "r"}])),
+
+ F_AND = eldap:'and'([eldap:present("objectclass"), eldap:present("ou")]),
+ {ok, #eldap_search_result{entries=[#eldap_entry{}]}} = Search(F_AND),
+ F_NOT = eldap:'and'([eldap:present("objectclass"), eldap:'not'(eldap:present("ou"))]),
+ {ok, #eldap_search_result{entries=[#eldap_entry{}, #eldap_entry{}]}} = Search(F_NOT),
+
+ %% MODIFY
+ Mod = [eldap:mod_replace("telephoneNumber", ["555-12345"]),
+ eldap:mod_add("description", ["Nice guy"])],
+ %% io:format("MOD ~p ~p ~n",[FB, Mod]),
+ ok = eldap:modify(H, FB, Mod),
+ %% DELETE ATTR
+ ok = eldap:modify(H, FB, [eldap:mod_delete("telephoneNumber", [])]),
+
+ %% DELETE
+ {error, entryAlreadyExists} = eldap:add(H, "cn=Jonas Jonsson," ++ BasePath,
+ [{"objectclass", ["person"]},
+ {"cn", ["Jonas Jonsson"]}, {"sn", ["Jonsson"]}]),
+ ok = eldap:delete(H, "cn=Jonas Jonsson," ++ BasePath),
+ {error, noSuchObject} = eldap:delete(H, "cn=Jonas Jonsson," ++ BasePath),
+
+ %% MODIFY_DN
+ ok = eldap:modify_dn(H, FB, "cn=Niclas Andre", true, ""),
+ %%io:format("Res ~p~n ~p~n",[R, All(BasePath)]),
+
+ eldap:close(H),
+ ok.
+
+add(H, Attr, Value, Path0, Attrs, Class) ->
+ Path = case Path0 of
+ [] -> Attr ++ "=" ++ Value;
+ _ -> Attr ++ "=" ++ Value ++ "," ++ Path0
+ end,
+ case eldap:add(H, Path, [{"objectclass", Class}, {Attr, [Value]}] ++ Attrs)
+ of
+ ok -> {ok, Path};
+ {error, E = entryAlreadyExists} -> {E, Path};
+ R = {error, Reason} ->
+ io:format("~p:~p: ~s,~s =>~n ~p~n",
+ [?MODULE,?LINE, Attr, Value, R]),
+ exit({ldap, add, Reason})
+ end.
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Develop
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+test() ->
+ run().
+
+run() ->
+ Cases = all(),
+ run(Cases).
+
+run(Case) when is_atom(Case) ->
+ run([Case]);
+run(Cases) when is_list(Cases) ->
+ Run = fun(Test, Config0) ->
+ Config = init_per_testcase(Test, Config0),
+ try
+ io:format("~nTest ~p ... ",[Test]),
+ ?MODULE:Test(Config),
+ end_per_testcase(Test, Config),
+ io:format("ok~n",[])
+ catch _:Reason ->
+ io:format("~n FAIL (~p): ~p~n ~p~n",
+ [Test, Reason, erlang:get_stacktrace()])
+ end
+ end,
+ process_flag(trap_exit, true),
+ Pid = spawn_link(fun() ->
+ case init_per_suite([]) of
+ {skip, Reason} -> io:format("Skip ~s~n",[Reason]);
+ Config ->
+ try
+ [Run(Test, Config) || Test <- Cases]
+ catch _:Err ->
+ io:format("Error ~p in ~p~n",[Err, erlang:get_stacktrace()])
+ end,
+ end_per_suite(Config)
+ end
+ end),
+ receive
+ {'EXIT', Pid, normal} -> ok;
+ Msg -> io:format("Received ~p (~p)~n",[Msg, Pid])
+ after 100 -> ok end,
+ process_flag(trap_exit, false),
+ ok.
diff --git a/lib/eldap/test/ldap_server/slapd.conf b/lib/eldap/test/ldap_server/slapd.conf
new file mode 100644
index 0000000000..87be676d9f
--- /dev/null
+++ b/lib/eldap/test/ldap_server/slapd.conf
@@ -0,0 +1,14 @@
+include /etc/ldap/schema/core.schema
+pidfile /tmp/openldap-data/slapd.pid
+argsfile /tmp/openldap-data/slapd.args
+
+database bdb
+suffix "dc=ericsson,dc=se"
+rootdn "cn=Manager,dc=ericsson,dc=se"
+rootpw hejsan
+# The database must exist before running slapd
+directory /tmp/openldap-data
+# Indices to maintain
+index objectClass eq
+# URI "ldap://0.0.0.0:9876 ldaps://0.0.0.0:9870"
+# servers/slapd/slapd -d 255 -h "ldap://0.0.0.0:9876 ldaps://0.0.0.0:9870" -f /ldisk/dgud/src/otp/lib/eldap/test/ldap_server/slapd.conf \ No newline at end of file
diff --git a/lib/eldap/vsn.mk b/lib/eldap/vsn.mk
new file mode 100644
index 0000000000..c9d6e4e324
--- /dev/null
+++ b/lib/eldap/vsn.mk
@@ -0,0 +1 @@
+ELDAP_VSN = 1.0
diff --git a/lib/erl_docgen/doc/src/Makefile b/lib/erl_docgen/doc/src/Makefile
index ff50c12895..8d8dd0dd55 100644
--- a/lib/erl_docgen/doc/src/Makefile
+++ b/lib/erl_docgen/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2011-2011. All Rights Reserved.
+# Copyright Ericsson AB 2011-2012. 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
@@ -124,13 +124,13 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man6
- $(INSTALL_DATA) $(MAN6DIR)/* $(RELEASE_PATH)/man/man6
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man6"
+ $(INSTALL_DATA) $(MAN6DIR)/* "$(RELEASE_PATH)/man/man6"
release_spec:
diff --git a/lib/erl_docgen/doc/src/notes.xml b/lib/erl_docgen/doc/src/notes.xml
index 23f64b876a..ee62de86b1 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,7 +30,75 @@
</header>
<p>This document describes the changes made to the <em>erl_docgen</em> application.</p>
- <section><title>Erl_Docgen 0.3</title>
+ <section><title>Erl_Docgen 0.3.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p> A bug regarding spaces in C function prototypes has
+ been fixed. (Thanks to Richard O'Keefe.) </p>
+ <p>
+ Own Id: OTP-10138</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Erl_Docgen 0.3.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p> Some links in C libraries were not generated
+ correctly. This bug has been fixed. </p>
+ <p>
+ Own Id: OTP-9832</p>
+ </item>
+ <item>
+ <p>
+ Set `font-family: Courier, monospace' in OTP doc CSS</p>
+ <p>
+ left Courier as the primary original font and also added
+ monospace as secondary for people which in Linux does not
+ have it installed.</p>
+ <p>
+ Also adds minor cosmetic changes to the CSS. (Thanks to
+ Ricardo Catalinas Jim�nez)</p>
+ <p>
+ Own Id: OTP-9918</p>
+ </item>
+ <item>
+ <p>
+ When generating from edoc it is now possible to use
+ ranges in specs and &lt;img&gt; tags in the description.</p>
+ <p>
+ Own Id: OTP-9970</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p> Optimize and improve handling of multiple func:s.
+ </p>
+ <p>
+ Own Id: OTP-9877</p>
+ </item>
+ <item>
+ <p> The generation of the libraries' HTML documentation
+ has been optimized. </p>
+ <p>
+ Own Id: OTP-9893</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Erl_Docgen 0.3</title>
<section><title>Fixed Bugs and Malfunctions</title>
<list>
diff --git a/lib/erl_docgen/priv/bin/Makefile b/lib/erl_docgen/priv/bin/Makefile
index 95ad36216a..d6d0ad2260 100644
--- a/lib/erl_docgen/priv/bin/Makefile
+++ b/lib/erl_docgen/priv/bin/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2010. All Rights Reserved.
+# Copyright Ericsson AB 2009-2012. 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
@@ -64,8 +64,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/bin
- $(INSTALL_SCRIPT) $(ESCRIPT_FILES) $(RELSYSDIR)/priv/bin
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/bin"
+ $(INSTALL_SCRIPT) $(ESCRIPT_FILES) "$(RELSYSDIR)/priv/bin"
release_docs_spec:
diff --git a/lib/erl_docgen/priv/css/Makefile b/lib/erl_docgen/priv/css/Makefile
index 81124fb111..24abc4fa9c 100644
--- a/lib/erl_docgen/priv/css/Makefile
+++ b/lib/erl_docgen/priv/css/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009. All Rights Reserved.
+# Copyright Ericsson AB 2009-2012. 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
@@ -64,13 +64,13 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/css
- $(INSTALL_DATA) $(CSS_FILES) $(RELSYSDIR)/priv/css
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/css"
+ $(INSTALL_DATA) $(CSS_FILES) "$(RELSYSDIR)/priv/css"
release_docs_spec:
- $(INSTALL_DIR) $(RELEASE_PATH)/doc
- $(INSTALL_DATA) $(CSS_FILES) ../nyi.html $(RELEASE_PATH)/doc
+ $(INSTALL_DIR) "$(RELEASE_PATH)/doc"
+ $(INSTALL_DATA) $(CSS_FILES) ../nyi.html "$(RELEASE_PATH)/doc"
release_tests_spec:
diff --git a/lib/erl_docgen/priv/css/otp_doc.css b/lib/erl_docgen/priv/css/otp_doc.css
index 97d8c2df74..c56de378f4 100644
--- a/lib/erl_docgen/priv/css/otp_doc.css
+++ b/lib/erl_docgen/priv/css/otp_doc.css
@@ -1,6 +1,5 @@
-
-
-body {
+/* standard OTP style sheet */
+body {
background: white;
font-family: Verdana, Arial, Helvetica, sans-serif;
margin: 0;
@@ -11,7 +10,6 @@ body {
max-height: 100%;
}
-
th { font-family: Verdana, Arial, Helvetica, sans-serif }
td { font-family: Verdana, Arial, Helvetica, sans-serif }
p { font-family: Verdana, Arial, Helvetica, sans-serif }
@@ -33,8 +31,7 @@ a:visited { color: blue; text-decoration: none }
background-color: #fff;
}
-
-#leftnav {
+#leftnav {
position: fixed;
float: left;
top: 0;
@@ -47,8 +44,7 @@ a:visited { color: blue; text-decoration: none }
border-right: 1px solid red;
}
-
-#content {
+#content {
margin-left: 240px; /* set left value to WidthOfFrameDiv */
}
@@ -57,7 +53,6 @@ a:visited { color: blue; text-decoration: none }
padding-top: 50px; /* Magins for inner DIV inside each DIV (to provide padding) */
}
-
.innertube
{
margin: 15px; /* Magins for inner DIV inside each DIV (to provide padding) */
@@ -66,16 +61,15 @@ a:visited { color: blue; text-decoration: none }
.footer
{
margin: 15px; /* Magins for inner DIV inside each DIV (to provide padding) */
-
}
-span.bold_code { font-family: courier;font-weight: bold}
-span.code { font-family: courier;font-weight: normal}
+
+span.bold_code { font-family: Courier, monospace; font-weight: bold }
+span.code { font-family: Courier, monospace; font-weight: normal }
.note, .warning {
border: solid black 1px;
margin: 1em 3em;
}
-
.note .label {
background: #30d42a;
color: white;
@@ -102,16 +96,15 @@ span.code { font-family: courier;font-weight: normal}
font-size: 90%;
padding: 5px 10px;
}
-
-.example {
+.example {
background-color:#eeeeff;
padding: 0px 10px;
-}
+}
-pre { font-family: courier; font-weight: normal }
+pre { font-family: Courier, monospace; font-weight: normal }
.REFBODY { margin-left: 13mm }
.REFTYPES { margin-left: 8mm }
-footer { }
+footer { }
diff --git a/lib/erl_docgen/priv/dtd/Makefile b/lib/erl_docgen/priv/dtd/Makefile
index 65c68fcca7..4538b7f8e6 100644
--- a/lib/erl_docgen/priv/dtd/Makefile
+++ b/lib/erl_docgen/priv/dtd/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2011. All Rights Reserved.
+# Copyright Ericsson AB 2009-2012. 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
@@ -89,8 +89,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/dtd
- $(INSTALL_DATA) $(DTD_FILES) $(ENT_FILES) $(RELSYSDIR)/priv/dtd
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/dtd"
+ $(INSTALL_DATA) $(DTD_FILES) $(ENT_FILES) "$(RELSYSDIR)/priv/dtd"
release_docs_spec:
diff --git a/lib/erl_docgen/priv/dtd_html_entities/Makefile b/lib/erl_docgen/priv/dtd_html_entities/Makefile
index d57302bd1b..f8a10973b2 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. All Rights Reserved.
+# Copyright Ericsson AB 2009-2012. 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
@@ -63,8 +63,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/dtd_html_entities
- $(INSTALL_DATA) $(ENTITY_FILES) $(RELSYSDIR)/priv/dtd_html_entities
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/dtd_html_entities"
+ $(INSTALL_DATA) $(ENTITY_FILES) "$(RELSYSDIR)/priv/dtd_html_entities"
release_docs_spec:
diff --git a/lib/erl_docgen/priv/dtd_man_entities/Makefile b/lib/erl_docgen/priv/dtd_man_entities/Makefile
index 5651d8bc29..da4998dcbc 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. All Rights Reserved.
+# Copyright Ericsson AB 2009-2012. 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
@@ -63,8 +63,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/dtd_man_entities
- $(INSTALL_DATA) $(ENTITY_FILES) $(RELSYSDIR)/priv/dtd_man_entities
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/dtd_man_entities"
+ $(INSTALL_DATA) $(ENTITY_FILES) "$(RELSYSDIR)/priv/dtd_man_entities"
release_docs_spec:
diff --git a/lib/erl_docgen/priv/images/Makefile b/lib/erl_docgen/priv/images/Makefile
index 8b858fefb3..61016e927c 100644
--- a/lib/erl_docgen/priv/images/Makefile
+++ b/lib/erl_docgen/priv/images/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009. All Rights Reserved.
+# Copyright Ericsson AB 2009-2012. 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
@@ -66,13 +66,13 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/images
- $(INSTALL_DATA) $(GIF_FILES) $(PNG_FILES) $(RELSYSDIR)/priv/images
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/images"
+ $(INSTALL_DATA) $(GIF_FILES) $(PNG_FILES) "$(RELSYSDIR)/priv/images"
release_docs_spec:
- $(INSTALL_DIR) $(RELEASE_PATH)/doc
- $(INSTALL_DATA) $(PNG_FILES) $(RELEASE_PATH)/doc
+ $(INSTALL_DIR) "$(RELEASE_PATH)/doc"
+ $(INSTALL_DATA) $(PNG_FILES) "$(RELEASE_PATH)/doc"
release_tests_spec:
diff --git a/lib/erl_docgen/priv/js/flipmenu/Makefile b/lib/erl_docgen/priv/js/flipmenu/Makefile
index 65c5c91f35..7933752532 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. All Rights Reserved.
+# Copyright Ericsson AB 2009-2012. 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
@@ -68,13 +68,13 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/js/flipmenu
- $(INSTALL_DATA) $(JS_FILES) $(GIF_FILES) $(RELSYSDIR)/priv/js/flipmenu
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/js/flipmenu"
+ $(INSTALL_DATA) $(JS_FILES) $(GIF_FILES) "$(RELSYSDIR)/priv/js/flipmenu"
release_docs_spec:
- $(INSTALL_DIR) $(RELEASE_PATH)/doc/js/flipmenu
- $(INSTALL_DATA) $(JS_FILES) $(GIF_FILES) $(RELEASE_PATH)/doc/js/flipmenu
+ $(INSTALL_DIR) "$(RELEASE_PATH)/doc/js/flipmenu"
+ $(INSTALL_DATA) $(JS_FILES) $(GIF_FILES) "$(RELEASE_PATH)/doc/js/flipmenu"
release_tests_spec:
diff --git a/lib/erl_docgen/priv/xsl/Makefile b/lib/erl_docgen/priv/xsl/Makefile
index 92a53b8c0b..1510387d72 100644
--- a/lib/erl_docgen/priv/xsl/Makefile
+++ b/lib/erl_docgen/priv/xsl/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009. All Rights Reserved.
+# Copyright Ericsson AB 2009-2012. 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
@@ -68,8 +68,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/xsl
- $(INSTALL_DATA) $(XSL_FILES) $(RELSYSDIR)/priv/xsl
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/xsl"
+ $(INSTALL_DATA) $(XSL_FILES) "$(RELSYSDIR)/priv/xsl"
release_docs_spec:
diff --git a/lib/erl_docgen/priv/xsl/db_html.xsl b/lib/erl_docgen/priv/xsl/db_html.xsl
index 7cf5465f90..4bc5abb364 100644
--- a/lib/erl_docgen/priv/xsl/db_html.xsl
+++ b/lib/erl_docgen/priv/xsl/db_html.xsl
@@ -1817,7 +1817,14 @@
<xsl:choose>
<xsl:when test="ancestor::cref">
- <a name="{substring-before(nametext, '(')}"><span class="bold_code"><xsl:value-of select="ret"/><xsl:text> </xsl:text><xsl:value-of select="nametext"/></span></a><br/>
+ <a name="{substring-before(nametext, '(')}">
+ <span class="bold_code">
+ <xsl:value-of select="ret"/>
+ <xsl:call-template name="maybe-space-after-ret">
+ <xsl:with-param name="s" select="ret"/>
+ </xsl:call-template>
+ <xsl:value-of select="nametext"/>
+ </span></a><br/>
</xsl:when>
<xsl:when test="ancestor::erlref">
<xsl:variable name="fname">
@@ -1845,6 +1852,18 @@
</xsl:template>
+ <xsl:template name="maybe-space-after-ret">
+ <xsl:param name="s"/>
+ <xsl:variable name="last_char"
+ select="substring($s, string-length($s), 1)"/>
+ <xsl:choose>
+ <xsl:when test="$last_char != '*'">
+ <xsl:text> </xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+
<!-- Type -->
<xsl:template match="type">
<xsl:param name="partnum"/>
diff --git a/lib/erl_docgen/priv/xsl/db_man.xsl b/lib/erl_docgen/priv/xsl/db_man.xsl
index 5234ba6bd0..33808859c7 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-2011. All Rights Reserved.
+ # Copyright Ericsson AB 2009-2012. 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
@@ -758,10 +758,32 @@
<xsl:template name="name">
<xsl:text>&#10;.B&#10;</xsl:text>
- <xsl:apply-templates/>
+ <xsl:choose>
+ <xsl:when test="ancestor::cref">
+ <xsl:value-of select="ret"/>
+ <xsl:call-template name="maybe-space-after-ret">
+ <xsl:with-param name="s" select="ret"/>
+ </xsl:call-template>
+ <xsl:value-of select="nametext"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:text>&#10;.br</xsl:text>
</xsl:template>
+ <xsl:template name="maybe-space-after-ret">
+ <xsl:param name="s"/>
+ <xsl:variable name="last_char"
+ select="substring($s, string-length($s), 1)"/>
+ <xsl:choose>
+ <xsl:when test="$last_char != '*'">
+ <xsl:text> </xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
<!-- Type -->
<xsl:template match="type">
diff --git a/lib/erl_docgen/priv/xsl/db_pdf.xsl b/lib/erl_docgen/priv/xsl/db_pdf.xsl
index 4ed4fa14c4..da96052462 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-2011. All Rights Reserved.
+ # Copyright Ericsson AB 2009-2012. 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
@@ -1424,7 +1424,13 @@
<xsl:param name="partnum"/>
<xsl:choose>
<xsl:when test="ancestor::cref">
- <fo:block id="{generate-id(nametext)}"><xsl:value-of select="ret"/><xsl:text></xsl:text><xsl:value-of select="nametext"/></fo:block>
+ <fo:block id="{generate-id(nametext)}">
+ <xsl:value-of select="ret"/>
+ <xsl:call-template name="maybe-space-after-ret">
+ <xsl:with-param name="s" select="ret"/>
+ </xsl:call-template>
+ <xsl:value-of select="nametext"/>
+ </fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block id="{generate-id(.)}"><xsl:value-of select="."/></fo:block>
@@ -1432,6 +1438,16 @@
</xsl:choose>
</xsl:template>
+ <xsl:template name="maybe-space-after-ret">
+ <xsl:param name="s"/>
+ <xsl:variable name="last_char"
+ select="substring($s, string-length($s), 1)"/>
+ <xsl:choose>
+ <xsl:when test="$last_char != '*'">
+ <xsl:text> </xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
<!-- Type -->
<xsl:template match="type">
@@ -1564,7 +1580,7 @@
</xsl:variable>
<fo:block xsl:use-attribute-sets="image">
- <fo:external-graphic content-width="60%" src="{@file}"/>
+ <fo:external-graphic content-width="scale-down-to-fit" inline-progression-dimension.maximum="100%" src="{@file}"/>
<xsl:apply-templates>
<xsl:with-param name="chapnum" select="$chapnum"/>
diff --git a/lib/erl_docgen/src/Makefile b/lib/erl_docgen/src/Makefile
index cbaf6e4627..6c8b438b25 100644
--- a/lib/erl_docgen/src/Makefile
+++ b/lib/erl_docgen/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -89,10 +89,10 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
index dc9bc565ee..cbaa93a15d 100644
--- a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
+++ b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
@@ -187,6 +187,7 @@ chapter_title(#xmlElement{content=Es}) -> % name = h3 | h4
%% 8) <blockquote> contents may need to be made into paragraphs
%% 9) <th> (table header) is not allowed - is replaced by
%% <td><em>...</em></td>.
+%% 10) <img src=""> is not allowed, replace with <image file="">
otp_xmlify([]) ->
[];
otp_xmlify(Es0) ->
@@ -337,7 +338,7 @@ otp_xmlify_e(#xmlElement{name=code} = E) -> % 4)
end;
otp_xmlify_e(#xmlElement{name=Tag} = E) % 5a
when Tag==h1; Tag==h2; Tag==h3; Tag==h4; Tag==h5 ->
- Content = text_only(E#xmlElement.content),
+ Content = text_and_a_name_only(E#xmlElement.content),
[E#xmlElement{name=b, content=Content}];
otp_xmlify_e(#xmlElement{name=Tag} = E) % 5b-c)
when Tag==center;
@@ -416,6 +417,9 @@ otp_xmlify_e(#xmlElement{name=tr} = E) ->
otp_xmlify_e(#xmlElement{name=td} = E) ->
Content = otp_xmlify_e(E#xmlElement.content),
[E#xmlElement{content=Content}];
+otp_xmlify_e(#xmlElement{name=img} = E) -> % 10)
+ Content = otp_xmlify_e(E#xmlElement.content),
+ [otp_xmlify_img(E#xmlElement{ content = Content })];
otp_xmlify_e([E | Es]) ->
otp_xmlify_e(E) ++ otp_xmlify_e(Es);
otp_xmlify_e([]) ->
@@ -634,6 +638,20 @@ otp_xmlify_table([#xmlElement{name=td, content=Content}|Es]) ->
otp_xmlify_table([]) ->
[].
+%% otp_xmlify_img(E) -> Es.
+%% Transforms a <img src=""> into <image file="">
+otp_xmlify_img(E0) ->
+ Attrs = lists:map(
+ fun(#xmlAttribute{ name = src, value = Path} = A) ->
+ V = otp_xmlify_a_fileref(Path,this),
+ A#xmlAttribute{ name = file,
+ value = V };
+ (A) ->
+ A
+ end,E0#xmlElement.attributes),
+ E0#xmlElement{name = image, expanded_name = image,
+ attributes = Attrs}.
+
%%--Misc help functions used by otp_xmlify/1 et al---------------------
%% find_next(Tag, Es) -> {Es1, Es2}
@@ -975,6 +993,8 @@ t_type([E=#xmlElement{name = atom}]) ->
t_atom(E);
t_type([E=#xmlElement{name = integer}]) ->
t_integer(E);
+t_type([E=#xmlElement{name = range}]) ->
+ t_range(E);
t_type([E=#xmlElement{name = float}]) ->
t_float(E);
t_type([#xmlElement{name = nil}]) ->
@@ -1001,6 +1021,9 @@ t_atom(E) ->
t_integer(E) ->
[get_attrval(value, E)].
+t_range(E) ->
+ [get_attrval(value, E)].
+
t_float(E) ->
[get_attrval(value, E)].
@@ -1138,6 +1161,18 @@ get_text(#xmlElement{content=[#xmlText{value=Text}]}) ->
get_text(#xmlElement{content=[E]}) ->
get_text(E).
+%% text_and_name_only(Es) -> Ts
+text_and_a_name_only([#xmlElement{
+ name = a,
+ attributes = [#xmlAttribute{name=name}]} = Name|Es]) ->
+ [Name|text_and_a_name_only(Es)];
+text_and_a_name_only([#xmlElement{content = Content}|Es]) ->
+ text_and_a_name_only(Content) ++ text_and_a_name_only(Es);
+text_and_a_name_only([#xmlText{} = E |Es]) ->
+ [E | text_and_a_name_only(Es)];
+text_and_a_name_only([]) ->
+ [].
+
%% text_only(Es) -> Ts
%% Takes a list of xmlElement and xmlText and return a lists of xmlText.
text_only([#xmlElement{content = Content}|Es]) ->
diff --git a/lib/erl_docgen/vsn.mk b/lib/erl_docgen/vsn.mk
index dbd7e017b0..b05df254a6 100644
--- a/lib/erl_docgen/vsn.mk
+++ b/lib/erl_docgen/vsn.mk
@@ -1,2 +1,2 @@
-ERL_DOCGEN_VSN = 0.3
+ERL_DOCGEN_VSN = 0.3.2
diff --git a/lib/erl_interface/aclocal.m4 b/lib/erl_interface/aclocal.m4
index 339a15a2bb..b1cf1fe404 100644
--- a/lib/erl_interface/aclocal.m4
+++ b/lib/erl_interface/aclocal.m4
@@ -1,7 +1,7 @@
dnl
dnl %CopyrightBegin%
dnl
-dnl Copyright Ericsson AB 1998-2011. All Rights Reserved.
+dnl Copyright Ericsson AB 1998-2012. All Rights Reserved.
dnl
dnl The contents of this file are subject to the Erlang Public License,
dnl Version 1.1, (the "License"); you may not use this file except in
@@ -59,6 +59,7 @@ AC_ARG_VAR(erl_xcomp_isysroot, [Absolute cross system root include path (only us
dnl Cross compilation variables
AC_ARG_VAR(erl_xcomp_bigendian, [big endian system: yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_double_middle_endian, [double-middle-endian system: yes|no (only used when cross compiling)])
AC_ARG_VAR(erl_xcomp_linux_clock_gettime_correction, [clock_gettime() can be used for time correction: yes|no (only used when cross compiling)])
AC_ARG_VAR(erl_xcomp_linux_nptl, [have Native POSIX Thread Library: yes|no (only used when cross compiling)])
AC_ARG_VAR(erl_xcomp_linux_usable_sigusrx, [SIGUSR1 and SIGUSR2 can be used: yes|no (only used when cross compiling)])
@@ -606,6 +607,103 @@ ifelse([$5], , , [$5
fi
])
+dnl ----------------------------------------------------------------------
+dnl
+dnl AC_DOUBLE_MIDDLE_ENDIAN
+dnl
+dnl Checks whether doubles are represented in "middle-endian" format.
+dnl Sets ac_cv_double_middle_endian={no,yes,unknown} accordingly,
+dnl as well as DOUBLE_MIDDLE_ENDIAN.
+dnl
+dnl
+
+AC_DEFUN([AC_C_DOUBLE_MIDDLE_ENDIAN],
+[AC_CACHE_CHECK(whether double word ordering is middle-endian, ac_cv_c_double_middle_endian,
+[# It does not; compile a test program.
+AC_RUN_IFELSE(
+[AC_LANG_SOURCE([[#include <stdlib.h>
+
+int
+main(void)
+{
+ int i = 0;
+ int zero = 0;
+ int bigendian;
+ int zero_index = 0;
+
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+
+ /* we'll use the one with 32-bit words */
+ union
+ {
+ double d;
+ unsigned int c[2];
+ } vint;
+
+ union
+ {
+ double d;
+ unsigned long c[2];
+ } vlong;
+
+ union
+ {
+ double d;
+ unsigned short c[2];
+ } vshort;
+
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ u.l = 1;
+ bigendian = (u.c[sizeof (long int) - 1] == 1);
+
+ zero_index = bigendian ? 1 : 0;
+
+ vint.d = 1.0;
+ vlong.d = 1.0;
+ vshort.d = 1.0;
+
+ if (sizeof(unsigned int) == 4)
+ {
+ if (vint.c[zero_index] != 0)
+ zero = 1;
+ }
+ else if (sizeof(unsigned long) == 4)
+ {
+ if (vlong.c[zero_index] != 0)
+ zero = 1;
+ }
+ else if (sizeof(unsigned short) == 4)
+ {
+ if (vshort.c[zero_index] != 0)
+ zero = 1;
+ }
+
+ exit (zero);
+}
+]])],
+ [ac_cv_c_double_middle_endian=no],
+ [ac_cv_c_double_middle_endian=yes],
+ [ac_cv_c_double_middle=unknown])])
+case $ac_cv_c_double_middle_endian in
+ yes)
+ m4_default([$1],
+ [AC_DEFINE([DOUBLE_MIDDLE_ENDIAN], 1,
+ [Define to 1 if your processor stores the words in a double in
+ middle-endian format (like some ARMs).])]) ;;
+ no)
+ $2 ;;
+ *)
+ m4_default([$3],
+ [AC_MSG_WARN([unknown double endianness
+presetting ac_cv_c_double_middle_endian=no (or yes) will help])]) ;;
+esac
+])# AC_C_DOUBLE_MIDDLE_ENDIAN
+
dnl ----------------------------------------------------------------------
dnl
@@ -1337,6 +1435,14 @@ if test "$ac_cv_c_bigendian" = "yes"; then
AC_DEFINE(ETHR_BIGENDIAN, 1, [Define if bigendian])
fi
+case X$erl_xcomp_double_middle_endian in
+ X) ;;
+ Xyes|Xno|Xunknown) ac_cv_c_double_middle_endian=$erl_xcomp_double_middle_endian;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_double_middle_endian value: $erl_xcomp_double_middle_endian]);;
+esac
+
+AC_C_DOUBLE_MIDDLE_ENDIAN
+
AC_ARG_ENABLE(native-ethr-impls,
AS_HELP_STRING([--disable-native-ethr-impls],
[disable native ethread implementations]),
diff --git a/lib/erl_interface/doc/src/Makefile b/lib/erl_interface/doc/src/Makefile
index e05b647cb2..b8e638ed24 100644
--- a/lib/erl_interface/doc/src/Makefile
+++ b/lib/erl_interface/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2009. All Rights Reserved.
+# Copyright Ericsson AB 1998-2012. 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
@@ -113,16 +113,16 @@ clean clean_docs clean_tex:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man1
- $(INSTALL_DATA) $(MAN1_FILES) $(RELEASE_PATH)/man/man1
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3_FILES) $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man1"
+ $(INSTALL_DATA) $(MAN1_FILES) "$(RELEASE_PATH)/man/man1"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3_FILES) "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/erl_interface/doc/src/notes.xml b/lib/erl_interface/doc/src/notes.xml
index 4cb9532880..6791c39c7d 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,6 +30,38 @@
</header>
<p>This document describes the changes made to the Erl_interface application.</p>
+<section><title>Erl_Interface 3.7.8</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Detect when middle endian doubles are used by a platform
+ and account for it when decoding floats. (Thanks to Mike
+ Sperber)</p>
+ <p>
+ Own Id: OTP-10209</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Erl_Interface 3.7.7</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>Minor suppressions and fixes of compilation
+ warnings</p>
+ <p>
+ Own Id: OTP-10016</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Erl_Interface 3.7.6</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/erl_interface/src/Makefile.in b/lib/erl_interface/src/Makefile.in
index d6b0ca1f16..cb41391fe9 100644
--- a/lib/erl_interface/src/Makefile.in
+++ b/lib/erl_interface/src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -843,32 +843,32 @@ EXTRA = \
$(TARGET)/eidefs.mk
release: opt
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/lib
- $(INSTALL_DIR) $(RELSYSDIR)/bin
- $(INSTALL_DIR) $(RELSYSDIR)/src/auxdir
- $(INSTALL_DIR) $(RELSYSDIR)/src/connect
- $(INSTALL_DIR) $(RELSYSDIR)/src/decode
- $(INSTALL_DIR) $(RELSYSDIR)/src/encode
- $(INSTALL_DIR) $(RELSYSDIR)/src/epmd
- $(INSTALL_DIR) $(RELSYSDIR)/src/legacy
- $(INSTALL_DIR) $(RELSYSDIR)/src/misc
- $(INSTALL_DIR) $(RELSYSDIR)/src/prog
- $(INSTALL_DIR) $(RELSYSDIR)/src/registry
- $(INSTALL_DATA) $(HEADERS) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(OBJ_TARGETS) $(RELSYSDIR)/lib
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/lib"
+ $(INSTALL_DIR) "$(RELSYSDIR)/bin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/auxdir"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/connect"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/decode"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/encode"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/epmd"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/legacy"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/misc"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/prog"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/registry"
+ $(INSTALL_DATA) $(HEADERS) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(OBJ_TARGETS) "$(RELSYSDIR)/lib"
ifneq ($(EXE_TARGETS),)
- $(INSTALL_PROGRAM) $(EXE_TARGETS) $(RELSYSDIR)/bin
-endif
- $(INSTALL_DATA) $(EXTRA) $(RELSYSDIR)/src
- $(INSTALL_DATA) connect/*.[ch] $(RELSYSDIR)/src/connect
- $(INSTALL_DATA) decode/*.[ch] $(RELSYSDIR)/src/decode
- $(INSTALL_DATA) encode/*.[ch] $(RELSYSDIR)/src/encode
- $(INSTALL_DATA) epmd/*.[ch] $(RELSYSDIR)/src/epmd
- $(INSTALL_DATA) misc/*.[ch] $(RELSYSDIR)/src/misc
- $(INSTALL_DATA) registry/*.[ch] $(RELSYSDIR)/src/registry
- $(INSTALL_DATA) legacy/*.[ch] $(RELSYSDIR)/src/legacy
- $(INSTALL_DATA) prog/*.[ch] $(RELSYSDIR)/src/prog
+ $(INSTALL_PROGRAM) $(EXE_TARGETS) "$(RELSYSDIR)/bin"
+endif
+ $(INSTALL_DATA) $(EXTRA) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) connect/*.[ch] "$(RELSYSDIR)/src/connect"
+ $(INSTALL_DATA) decode/*.[ch] "$(RELSYSDIR)/src/decode"
+ $(INSTALL_DATA) encode/*.[ch] "$(RELSYSDIR)/src/encode"
+ $(INSTALL_DATA) epmd/*.[ch] "$(RELSYSDIR)/src/epmd"
+ $(INSTALL_DATA) misc/*.[ch] "$(RELSYSDIR)/src/misc"
+ $(INSTALL_DATA) registry/*.[ch] "$(RELSYSDIR)/src/registry"
+ $(INSTALL_DATA) legacy/*.[ch] "$(RELSYSDIR)/src/legacy"
+ $(INSTALL_DATA) prog/*.[ch] "$(RELSYSDIR)/src/prog"
release_docs:
diff --git a/lib/erl_interface/src/misc/ei_format.c b/lib/erl_interface/src/misc/ei_format.c
index c1e5d998e4..281a192535 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2001-2012. 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/lib/erl_interface/test/Makefile b/lib/erl_interface/test/Makefile
index 4faf89c0d6..2b85dfc571 100644
--- a/lib/erl_interface/test/Makefile
+++ b/lib/erl_interface/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -71,9 +71,9 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec:
release_tests_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(SPEC_FILES) $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(SPEC_FILES) $(COVER_FILE) $(ERL_FILES) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/erl_interface/test/all_SUITE_data/Makefile.src b/lib/erl_interface/test/all_SUITE_data/Makefile.src
index 70652e47c5..d2f57c8149 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-2011. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -32,7 +32,7 @@ all: $(ALL_OBJS)
$(EI_COMMON_OBJS): gccifier@exe@
-@IFEQ@ (@erl_interface_cross_compile@, true)
+@IFEQ@ (@cross@, yes)
gccifier@exe@:
$(CP) gccifier.sh gccifier@exe@
$(CHMOD) a+x gccifier@exe@
diff --git a/lib/erl_interface/test/all_SUITE_data/gccifier.c b/lib/erl_interface/test/all_SUITE_data/gccifier.c
index 9f556fc4ed..7e4ffc7281 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 2005-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2012. 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
@@ -16,7 +16,6 @@
*
* %CopyrightEnd%
*
-
*/
/*
@@ -74,17 +73,23 @@ save_arg(args_t *args, char *arg1, ...)
args->vec = (char **) (args->no
? realloc((void *) args->vec,
(sizeof(char *)
- *(args->no + ARGS_INCR + 1)))
+ *(args->no + ARGS_INCR + 2)))
: malloc((sizeof(char *)
- *(args->no + ARGS_INCR + 1))));
+ *(args->no + ARGS_INCR + 2))));
if (!args->vec)
enomem();
args->no += ARGS_INCR;
}
+ if (carg == arg1) {
+ args->vec[args->ix++] = "\"";
+ args->chars++;
+ }
args->vec[args->ix++] = carg;
args->chars += strlen(carg);
carg = va_arg(argp, char *);
}
+ args->vec[args->ix++] = "\"";
+ args->chars++;
args->vec[args->ix++] = " ";
args->chars++;
va_end(argp);
@@ -232,6 +237,9 @@ main(int argc, char *argv[])
CHECK_FIRST_LINK_ARG;
save_arg(&link_args, "-libpath:", arg, NULL);
}
+ else if (strcmp("-link",arg) == 0) {
+ CHECK_FIRST_LINK_ARG;
+ }
#endif /* #ifdef __WIN32__ */
else if (is_prefix("-l", &arg)) {
CHECK_FIRST_LINK_ARG;
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 7a599994fc..7e370c566a 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -48,8 +48,7 @@ run1(Name) ->
generate(TcName, Cases) ->
Hrl = TcName ++ "_cases.hrl",
{ok, HrlFile} = file:open(Hrl, write),
- {ok, Dir} = file:get_cwd(),
- generate_hrl(Cases, HrlFile, {filename:join(Dir, TcName), 0}),
+ generate_hrl(Cases, HrlFile, {TcName, 0}),
file:close(HrlFile),
C = TcName ++ "_decl.c",
{ok, CFile} = file:open(C, write),
@@ -57,7 +56,7 @@ generate(TcName, Cases) ->
file:close(CFile).
generate_hrl([Case|Rest], File, {Name, Number}) ->
- io:format(File, "-define(~s, {\"~s\", ~w}).~n", [Case, Name, Number]),
+ io:format(File, "-define(~s, {filename:join(proplists:get_value(data_dir,Config),\"~s\"), ~w}).~n", [Case, Name, Number]),
generate_hrl(Rest, File, {Name, Number+1});
generate_hrl([], _, _) ->
ok.
diff --git a/lib/erl_interface/test/ei_tmo_SUITE.erl b/lib/erl_interface/test/ei_tmo_SUITE.erl
index 7ff8c08280..c33beecbe9 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -88,12 +88,12 @@ ei_recv_tmo(doc) ->
ei_recv_tmo(suite) ->
[];
ei_recv_tmo(Config) when is_list(Config) ->
- ?line do_one_recv(c_node_recv_tmo_1),
- ?line do_one_recv_failure(c_node_recv_tmo_2),
+ ?line do_one_recv(Config,c_node_recv_tmo_1),
+ ?line do_one_recv_failure(Config,c_node_recv_tmo_2),
ok.
-do_one_recv(CNode) ->
+do_one_recv(Config,CNode) ->
?line {_,Host} = split(node()),
?line P1 = runner:start(?recv_tmo),
?line runner:send_term(P1,{CNode,
@@ -107,7 +107,7 @@ do_one_recv(CNode) ->
?line {term, Term1} = runner:get_term(P1, 10000),
?line runner:recv_eot(P1).
-do_one_recv_failure(CNode) ->
+do_one_recv_failure(Config,CNode) ->
?line P1 = runner:start(?recv_tmo),
?line runner:send_term(P1,{CNode,
erlang:get_cookie(),
@@ -128,14 +128,14 @@ ei_send_tmo(Config) when is_list(Config) ->
%dbg:p(self()),
VxSim = ?config(vxsim, Config),
?line register(ei_send_tmo_1,self()),
- ?line do_one_send(self(),c_node_send_tmo_1),
- ?line do_one_send(ei_send_tmo_1,c_node_send_tmo_2),
- ?line do_one_send_failure(self(),cccc1,c_nod_send_tmo_3,VxSim),
- ?line do_one_send_failure(ei_send_tmo_1,cccc2,c_nod_send_tmo_4,VxSim),
+ ?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),
ok.
-do_one_send(From,CNode) ->
+do_one_send(Config,From,CNode) ->
?line {_,Host} = split(node()),
?line P1 = runner:start(?send_tmo),
?line runner:send_term(P1,{CNode,
@@ -155,7 +155,7 @@ do_one_send(From,CNode) ->
?line {term, 0} = runner:get_term(P1, 10000),
?line runner:recv_eot(P1).
-do_one_send_failure(From,FakeName,CName,VxSim) ->
+do_one_send_failure(Config,From,FakeName,CName,VxSim) ->
?line {_,Host} = split(node()),
?line OurName = join(FakeName,Host),
?line Node = join(CName,Host),
diff --git a/lib/erl_interface/test/erl_match_SUITE.erl b/lib/erl_interface/test/erl_match_SUITE.erl
index e019fecca8..2cf4fafe82 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -29,7 +29,7 @@
bind/1, integers/1, floats/1, binaries/1, strings/1]).
%% For interactive running of matcher.
--export([start_matcher/0, erl_match/3]).
+-export([start_matcher/1, erl_match/3]).
%% This test suite tests the erl_match() function.
@@ -57,7 +57,7 @@ end_per_group(_GroupName, Config) ->
atoms(suite) -> [];
atoms(Config) when is_list(Config) ->
- ?line P = start_matcher(),
+ ?line P = start_matcher(Config),
?line eq(P, '', ''),
?line eq(P, a, a),
@@ -74,7 +74,7 @@ atoms(Config) when is_list(Config) ->
lists(suite) -> [];
lists(Config) when is_list(Config) ->
- ?line P = start_matcher(),
+ ?line P = start_matcher(Config),
?line eq(P, [], []),
?line ne(P, [], [a]),
@@ -101,7 +101,7 @@ lists(Config) when is_list(Config) ->
tuples(suite) -> [];
tuples(Config) when is_list(Config) ->
- ?line P = start_matcher(),
+ ?line P = start_matcher(Config),
?line ne(P, {}, {a, b}),
?line ne(P, {a, b}, {}),
@@ -129,7 +129,7 @@ tuples(Config) when is_list(Config) ->
references(suite) -> [];
references(Config) when is_list(Config) ->
- ?line P = start_matcher(),
+ ?line P = start_matcher(Config),
?line Ref1 = make_ref(),
?line Ref2 = make_ref(),
@@ -144,7 +144,7 @@ references(Config) when is_list(Config) ->
pids(suite) -> [];
pids(Config) when is_list(Config) ->
- ?line P = start_matcher(),
+ ?line P = start_matcher(Config),
?line Pid1 = c:pid(0,1,2),
?line Pid2 = c:pid(0,1,3),
@@ -163,8 +163,8 @@ ports(Config) when is_list(Config) ->
vxworks ->
{skipped,"not on vxworks, pucko"};
_ ->
- ?line P = start_matcher(),
- ?line P2 = start_matcher(),
+ ?line P = start_matcher(Config),
+ ?line P2 = start_matcher(Config),
?line eq(P, P, P),
?line ne(P, P, P2),
@@ -176,7 +176,7 @@ ports(Config) when is_list(Config) ->
integers(suite) -> [];
integers(Config) when is_list(Config) ->
- ?line P = start_matcher(),
+ ?line P = start_matcher(Config),
?line I1 = 123,
?line I2 = 12345,
?line I3 = -123,
@@ -195,7 +195,7 @@ integers(Config) when is_list(Config) ->
floats(suite) -> [];
floats(Config) when is_list(Config) ->
- ?line P = start_matcher(),
+ ?line P = start_matcher(Config),
?line F1 = 3.1414,
?line F2 = 3.1415,
?line F3 = 3.1416,
@@ -218,7 +218,7 @@ floats(Config) when is_list(Config) ->
binaries(suite) -> [];
binaries(Config) when is_list(Config) ->
- ?line P = start_matcher(),
+ ?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"),
@@ -237,7 +237,7 @@ binaries(Config) when is_list(Config) ->
strings(suite) -> [];
strings(Config) when is_list(Config) ->
- ?line P = start_matcher(),
+ ?line P = start_matcher(Config),
?line S1 = "string",
?line S2 = "streng",
@@ -254,7 +254,7 @@ strings(Config) when is_list(Config) ->
bind(suite) -> [];
bind(Config) when is_list(Config) ->
- ?line P = start_bind(),
+ ?line P = start_bind(Config),
?line S = "[X,Y,Z]",
?line L1 = [301,302,302],
?line L2 = [65,66,67],
@@ -265,7 +265,7 @@ bind(Config) when is_list(Config) ->
?line runner:finish(P),
ok.
-start_bind() ->
+start_bind(Config) ->
runner:start(?erl_match_bind).
bind_ok(Port, Bind, Term) ->
@@ -287,7 +287,7 @@ erl_bind(Port, Pattern, Term) ->
-start_matcher() ->
+start_matcher(Config) ->
runner:start(?erl_match_server).
eq(Port, Pattern, Term) ->
diff --git a/lib/erl_interface/vsn.mk b/lib/erl_interface/vsn.mk
index 2c402bba6c..4e401c874e 100644
--- a/lib/erl_interface/vsn.mk
+++ b/lib/erl_interface/vsn.mk
@@ -1 +1 @@
-EI_VSN = 3.7.6
+EI_VSN = 3.7.8
diff --git a/lib/et/doc/src/Makefile b/lib/et/doc/src/Makefile
index 6bb8164e91..249d45fa52 100644
--- a/lib/et/doc/src/Makefile
+++ b/lib/et/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2010. All Rights Reserved.
+# Copyright Ericsson AB 2002-2012. 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
@@ -97,14 +97,14 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/et/doc/src/et_intro.xml b/lib/et/doc/src/et_intro.xml
index 0c5fb14d55..f90a6d2b5c 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>2010</year>
+ <year>2002</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -40,8 +40,8 @@
ports or files.</p>
<section>
- <title>Scope and Purpose</title>'
-
+ <title>Scope and Purpose</title>
+
<p>This manual describes the <c>Event Tracer (ET)</c> application,
as a component of the Erlang/Open Telecom Platform development
environment. It is assumed that the reader is familiar with the
diff --git a/lib/et/doc/src/notes.xml b/lib/et/doc/src/notes.xml
index acc6120fcd..0b1f3eddce 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>2011</year>
+ <year>2002</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -36,6 +36,41 @@
one section in this document. The title of each section is the
version number of <c>Event Tracer (ET)</c>.</p>
+<section><title>ET 1.4.4.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fix typo in ET doc (Thanks to Ricardo Catalinas Jim�nez)</p>
+ <p>
+ Own Id: OTP-10119</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>ET 1.4.4.1</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>The GS applications is now deprecated and will be
+ removed in the R16 release. The following GS-based
+ applications have been superseded by the Observer
+ application and will removed in R16: Appmon, Pman,
+ Tv.</p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>
+ Own Id: OTP-9907</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>ET 1.4.4</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/et/examples/Makefile b/lib/et/examples/Makefile
index 67a6536fdf..3edbebc2e4 100644
--- a/lib/et/examples/Makefile
+++ b/lib/et/examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2010. All Rights Reserved.
+# Copyright Ericsson AB 2002-2012. 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
@@ -73,8 +73,8 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/examples
- $(INSTALL_DATA) $(ERL_FILES) $(DATA_FILES) $(HRL_FILES) $(RELSYSDIR)/examples
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples"
+ $(INSTALL_DATA) $(ERL_FILES) $(DATA_FILES) $(HRL_FILES) "$(RELSYSDIR)/examples"
release_docs_spec:
diff --git a/lib/et/src/Makefile b/lib/et/src/Makefile
index bb6632ee91..c68a3f4efd 100644
--- a/lib/et/src/Makefile
+++ b/lib/et/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2010. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -104,14 +104,14 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(APP_TARGET) $(APPUP_TARGET) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/et/src/et_gs_contents_viewer.erl b/lib/et/src/et_gs_contents_viewer.erl
index f6a87bd608..2d414f10b4 100644
--- a/lib/et/src/et_gs_contents_viewer.erl
+++ b/lib/et/src/et_gs_contents_viewer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2012. 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
@@ -21,6 +21,17 @@
%%----------------------------------------------------------------------
-module(et_gs_contents_viewer).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,editor,2}},
+ {nowarn_deprecated_function,{gs,frame,2}},
+ {nowarn_deprecated_function,{gs,menu,2}},
+ {nowarn_deprecated_function,{gs,menubar,2}},
+ {nowarn_deprecated_function,{gs,menubutton,2}},
+ {nowarn_deprecated_function,{gs,menuitem,2}},
+ {nowarn_deprecated_function,{gs,menuitem,3}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
-behaviour(gen_server).
diff --git a/lib/et/src/et_gs_viewer.erl b/lib/et/src/et_gs_viewer.erl
index 0af7814d15..ce8634d09f 100644
--- a/lib/et/src/et_gs_viewer.erl
+++ b/lib/et/src/et_gs_viewer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -21,6 +21,23 @@
%%----------------------------------------------------------------------
-module(et_gs_viewer).
+-compile([{nowarn_deprecated_function,{gs,canvas,2}},
+ {nowarn_deprecated_function,{gs,checkbutton,3}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,frame,2}},
+ {nowarn_deprecated_function,{gs,line,2}},
+ {nowarn_deprecated_function,{gs,menu,2}},
+ {nowarn_deprecated_function,{gs,menu,3}},
+ {nowarn_deprecated_function,{gs,menubar,2}},
+ {nowarn_deprecated_function,{gs,menubutton,2}},
+ {nowarn_deprecated_function,{gs,menubutton,3}},
+ {nowarn_deprecated_function,{gs,menuitem,2}},
+ {nowarn_deprecated_function,{gs,menuitem,3}},
+ {nowarn_deprecated_function,{gs,scale,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,text,2}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
-behaviour(gen_server).
diff --git a/lib/et/src/et_wx_contents_viewer.erl b/lib/et/src/et_wx_contents_viewer.erl
index 86f46f25d0..b559da8807 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2012. 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
@@ -245,12 +245,7 @@ handle_event(#wx{id = Id,
Data when is_record(Data, filter) ->
F = Data,
ChildState= S#state{active_filter = F#filter.name},
- case wx_object:start_link(?MODULE, [ChildState], []) of
- {ok, Pid} when S#state.parent_pid =/= self() ->
- unlink(Pid);
- _ ->
- ignore
- end;
+ wx_object:start_link(?MODULE, [ChildState], []);
{hide, Actors} ->
send_viewer_event(S, {delete_actors, Actors});
{show, Actors} ->
@@ -356,12 +351,7 @@ handle_event(#wx{event = #wxKey{rawCode = KeyCode}}, S) ->
case lists:keysearch(?DEFAULT_FILTER_NAME, #filter.name, S#state.filters) of
{value, F} when is_record(F, filter) ->
ChildState= S#state{active_filter = F#filter.name},
- case wx_object:start_link(?MODULE, [ChildState], []) of
- {ok, Pid} when S#state.parent_pid =/= self() ->
- unlink(Pid);
- _ ->
- ignore
- end;
+ wx_object:start_link(?MODULE, [ChildState], []);
false ->
ignore
end,
@@ -370,12 +360,7 @@ handle_event(#wx{event = #wxKey{rawCode = KeyCode}}, S) ->
case catch lists:nth(Int-$0, S#state.filters) of
F when is_record(F, filter) ->
ChildState= S#state{active_filter = F#filter.name},
- case wx_object:start_link(?MODULE, [ChildState], []) of
- {ok, Pid} when S#state.parent_pid =/= self() ->
- unlink(Pid);
- _ ->
- ignore
- end;
+ wx_object:start_link(?MODULE, [ChildState], []);
{'EXIT', _} ->
ignore
end,
diff --git a/lib/et/test/Makefile b/lib/et/test/Makefile
index e10a2a1587..3817079b5f 100644
--- a/lib/et/test/Makefile
+++ b/lib/et/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2011. All Rights Reserved.
+# Copyright Ericsson AB 2009-2012. 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
@@ -70,12 +70,12 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) et.spec et.cover $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)
- $(INSTALL_SCRIPT) ett $(RELSYSDIR)
- $(INSTALL_DATA) $(INSTALL_PROGS) $(RELSYSDIR)
-# chmod -R u+w $(RELSYSDIR)
-# @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) et.spec et.cover $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_SCRIPT) ett "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(INSTALL_PROGS) "$(RELSYSDIR)"
+# chmod -R u+w "$(RELSYSDIR)"
+# @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/et/vsn.mk b/lib/et/vsn.mk
index 239a72ad73..167c9d9594 100644
--- a/lib/et/vsn.mk
+++ b/lib/et/vsn.mk
@@ -1 +1 @@
-ET_VSN = 1.4.4
+ET_VSN = 1.4.4.2
diff --git a/lib/eunit/doc/overview.edoc b/lib/eunit/doc/overview.edoc
index ad449cb6fc..b4af31ae6a 100644
--- a/lib/eunit/doc/overview.edoc
+++ b/lib/eunit/doc/overview.edoc
@@ -723,8 +723,12 @@ A <em>simple test object</em> is one of the following:
```fun some_function/0'''
```fun some_module:some_function/0'''
</li>
- <li>A pair of atoms `{ModuleName, FunctionName}', referring to the
- function `ModuleName:FunctionName/0'</li>
+ <li>A tuple `{test, ModuleName, FunctionName}', where `ModuleName' and
+ `FunctionName' are atoms, referring to the function
+ `ModuleName:FunctionName/0'</li>
+ <li>(Obsolete) A pair of atoms `{ModuleName, FunctionName}', equivalent to
+ `{test, ModuleName, FunctionName}' if nothing else matches first. This
+ might be removed in a future version.</li>
<li>A pair `{LineNumber, SimpleTest}', where `LineNumber' is a
nonnegative integer and `SimpleTest' is another simple test
object. `LineNumber' should indicate the source line of the test.
diff --git a/lib/eunit/doc/src/Makefile b/lib/eunit/doc/src/Makefile
index 2cdc579275..cbcd4c1507 100644
--- a/lib/eunit/doc/src/Makefile
+++ b/lib/eunit/doc/src/Makefile
@@ -157,14 +157,14 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/eunit/doc/src/notes.xml b/lib/eunit/doc/src/notes.xml
index 34e8a47e3d..814580e228 100644
--- a/lib/eunit/doc/src/notes.xml
+++ b/lib/eunit/doc/src/notes.xml
@@ -32,6 +32,38 @@
</header>
<p>This document describes the changes made to the EUnit application.</p>
+<section><title>Eunit 2.2.3</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ New option 'no_tty' to silent the default tty report.</p>
+ <p>
+ Recognize the new stacktrace format introduced in R15,
+ adding location information. (Thanks to Klas Johansson.)</p>
+ <p>
+ Improve layout of error messages, printing the stack
+ trace before the error term.</p>
+ <p>
+ Heuristically detect and report bad return values from
+ generators and instantiators. E.g., "ok" will not be
+ interpreted as a module name, and a warning will be
+ printed.</p>
+ <p>
+ New test representation {test,M,F} for completeness along
+ with {generator,M,F}. Tuples {M,F} are deprecated.</p>
+ <p>
+ Use UTF-8 as encoding in Surefire output files. (Thanks
+ to Lukas Larsson.)</p>
+ <p>
+ Own Id: OTP-10173</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Eunit 2.2.2</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/eunit/examples/Makefile b/lib/eunit/examples/Makefile
index 48ec2ebf2b..cfa0a7a645 100644
--- a/lib/eunit/examples/Makefile
+++ b/lib/eunit/examples/Makefile
@@ -49,8 +49,8 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec:
- $(INSTALL_DIR) $(RELSYSDIR)/examples
- $(INSTALL_DATA) $(EXAMPLE_FILES) $(RELSYSDIR)/examples
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples"
+ $(INSTALL_DATA) $(EXAMPLE_FILES) "$(RELSYSDIR)/examples"
release_docs_spec:
diff --git a/lib/eunit/include/eunit.hrl b/lib/eunit/include/eunit.hrl
index db68d8ae60..fba840c3bd 100644
--- a/lib/eunit/include/eunit.hrl
+++ b/lib/eunit/include/eunit.hrl
@@ -25,11 +25,12 @@
%% will become undefined. NODEBUG also implies NOASSERT, unless testing
%% is enabled.
%%
-%% If including this file causes TEST to be defined, then NOASSERT will
-%% be undefined, even if it was previously defined and even if NODEBUG
-%% is defined. If both ASSERT and NOASSERT are defined before the file
-%% is included, then ASSERT takes precedence, and NOASSERT will become
-%% undefined regardless of TEST.
+%% Defining NOASSERT disables asserts. NODEBUG implies NOASSERT unless
+%% testing is enabled. If including this file causes TEST to be defined,
+%% then NOASSERT will be undefined, even if it was previously defined and
+%% even if NODEBUG is defined. If both ASSERT and NOASSERT are defined
+%% before the file is included, then ASSERT takes precedence, and NOASSERT
+%% will become undefined regardless of TEST.
%%
%% After including this file, EUNIT will be defined if and only if TEST
%% is defined.
@@ -127,9 +128,9 @@
current_function)))).
-endif.
--ifdef(NOASSERT).
%% The plain assert macro should be defined to do nothing if this file
%% is included when debugging/testing is turned off.
+-ifdef(NOASSERT).
-ifndef(assert).
-define(assert(BoolExpr),ok).
-endif.
diff --git a/lib/eunit/src/Makefile b/lib/eunit/src/Makefile
index bec2fdbe0b..0a2e71cf7b 100644
--- a/lib/eunit/src/Makefile
+++ b/lib/eunit/src/Makefile
@@ -28,6 +28,9 @@ ERL_COMPILE_FLAGS += -pa $(EBIN) -I$(INCLUDE) +warn_unused_vars +nowarn_shadow_v
PARSE_TRANSFORM = eunit_autoexport.erl
+BEHAVIOUR_SOURCES= \
+ eunit_listener.erl
+
SOURCES= \
eunit_striptests.erl \
eunit.erl \
@@ -40,13 +43,16 @@ SOURCES= \
eunit_data.erl \
eunit_tty.erl \
eunit_surefire.erl \
- eunit_listener.erl
INCLUDE_FILES = eunit.hrl
PARSE_TRANSFORM_BIN = $(PARSE_TRANSFORM:%.erl=$(EBIN)/%.$(EMULATOR))
-OBJECTS=$(SOURCES:%.erl=$(EBIN)/%.$(EMULATOR)) $(APP_TARGET) $(APPUP_TARGET)
+TARGET_FILES= $(SOURCES:%.erl=$(EBIN)/%.$(EMULATOR))
+
+BEHAVIOUR_TARGET_FILES= $(BEHAVIOUR_SOURCES:%.erl=$(EBIN)/%.$(EMULATOR))
+
+OBJECTS= $(TARGET_FILES) $(BEHAVIOUR_TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET)
INCLUDE_DELIVERABLES = $(INCLUDE_FILES:%=$(INCLUDE)/%)
@@ -62,6 +68,8 @@ APPUP_TARGET= $(EBIN)/$(APPUP_FILE)
# Targets
# ----------------------------------------------------
+$(TARGET_FILES): $(BEHAVIOUR_TARGET_FILES)
+
debug opt: $(PARSE_TRANSFORM_BIN) $(OBJECTS)
docs:
@@ -107,12 +115,12 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(PARSE_TRANSFORM_BIN) $(OBJECTS) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(PARSE_TRANSFORM) $(SOURCES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(INCLUDE_DELIVERABLES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(PARSE_TRANSFORM_BIN) $(OBJECTS) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(PARSE_TRANSFORM) $(SOURCES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(INCLUDE_DELIVERABLES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/eunit/src/eunit.app.src b/lib/eunit/src/eunit.app.src
index 5e16dfa2ce..431abac98b 100644
--- a/lib/eunit/src/eunit.app.src
+++ b/lib/eunit/src/eunit.app.src
@@ -14,7 +14,6 @@
eunit_striptests,
eunit_surefire,
eunit_test,
- eunit_tests,
eunit_tty]},
{registered,[]},
{applications, [kernel,stdlib]},
diff --git a/lib/eunit/src/eunit.erl b/lib/eunit/src/eunit.erl
index 95857e83c8..51846d73b3 100644
--- a/lib/eunit/src/eunit.erl
+++ b/lib/eunit/src/eunit.erl
@@ -139,7 +139,7 @@ test(Tests, Options) ->
%% @private
%% @doc See {@link test/2}.
test(Server, Tests, Options) ->
- Listeners = [eunit_tty:start(Options) | listeners(Options)],
+ Listeners = listeners(Options),
Serial = eunit_serial:start(Listeners),
case eunit_server:start_test(Server, Serial, Tests, Options) of
{ok, Reference} -> test_run(Reference, Listeners);
@@ -194,7 +194,10 @@ submit(Server, T, Options) ->
eunit_server:start_test(Server, Dummy, T, Options).
listeners(Options) ->
- Ps = start_listeners(proplists:get_all_values(report, Options)),
+ %% note that eunit_tty must always run, because it sends the final
+ %% {result,...} message that the test_run() function is waiting for
+ Ls = [{eunit_tty, Options} | proplists:get_all_values(report, Options)],
+ Ps = start_listeners(Ls),
%% the event_log option is for debugging, to view the raw events
case proplists:get_value(event_log, Options) of
undefined ->
diff --git a/lib/eunit/src/eunit_data.erl b/lib/eunit/src/eunit_data.erl
index 392d378a0e..0350f9bf6e 100644
--- a/lib/eunit/src/eunit_data.erl
+++ b/lib/eunit/src/eunit_data.erl
@@ -83,6 +83,7 @@
%% SimpleTest = TestFunction | {Line::integer(), SimpleTest}
%%
%% TestFunction = () -> any()
+%% | {test, M::moduleName(), F::functionName()}
%% | {M::moduleName(), F::functionName()}.
%%
%% AbstractTestFunction = (X::any()) -> any()
@@ -95,7 +96,6 @@
%%
%% @type moduleName() = atom()
%% @type functionName() = atom()
-%% @type arity() = integer()
%% @type appName() = atom()
%% @type fileName() = string()
@@ -156,8 +156,9 @@ iter_prev(#iter{prev = [T | Ts]} = I) ->
%% @spec (tests()) -> none | {testItem(), tests()}
%% @type testItem() = #test{} | #group{}
%% @throws {bad_test, term()}
-%% | {generator_failed, exception()}
-%% | {no_such_function, eunit_lib:mfa()}
+%% | {generator_failed, {{M::atom(),F::atom(),A::integer()},
+%% exception()}}
+%% | {no_such_function, mfa()}
%% | {module_not_found, moduleName()}
%% | {application_not_found, appName()}
%% | {file_read_error, {Reason::atom(), Message::string(),
@@ -221,17 +222,27 @@ parse({foreachx, P, S1, C1, Ps} = T)
[] ->
{data, []}
end;
-parse({generator, F} = T) when is_function(F) ->
+parse({generator, F}) when is_function(F) ->
+ {module, M} = erlang:fun_info(F, module),
+ {name, N} = erlang:fun_info(F, name),
+ {arity, A} = erlang:fun_info(F, arity),
+ parse({generator, F, {M,N,A}});
+parse({generator, F, {M,N,A}} = T)
+ when is_function(F), is_atom(M), is_atom(N), is_integer(A) ->
check_arity(F, 0, T),
%% use run_testfun/1 to handle wrapper exceptions
case eunit_test:run_testfun(F) of
{ok, T1} ->
+ case eunit_lib:is_not_test(T1) of
+ true -> throw({bad_generator, {{M,N,A}, T1}});
+ false -> ok
+ end,
{data, T1};
{error, {Class, Reason, Trace}} ->
- throw({generator_failed, {Class, Reason, Trace}})
+ throw({generator_failed, {{M,N,A}, {Class, Reason, Trace}}})
end;
parse({generator, M, F}) when is_atom(M), is_atom(F) ->
- parse({generator, eunit_test:function_wrapper(M, F)});
+ parse({generator, eunit_test:mf_wrapper(M, F), {M,F,0}});
parse({inorder, T}) ->
group(#group{tests = T, order = inorder});
parse({inparallel, T}) ->
@@ -421,8 +432,11 @@ parse_simple(F) ->
parse_function(F) when is_function(F) ->
check_arity(F, 0, F),
#test{f = F, location = eunit_lib:fun_parent(F)};
-parse_function({M,F}) when is_atom(M), is_atom(F) ->
- #test{f = eunit_test:function_wrapper(M, F), location = {M, F, 0}};
+parse_function({test, M, F}) when is_atom(M), is_atom(F) ->
+ #test{f = eunit_test:mf_wrapper(M, F), location = {M, F, 0}};
+parse_function({M, F}) when is_atom(M), is_atom(F) ->
+ %% {M,F} is now considered obsolete; use {test,M,F} instead
+ parse_function({test, M, F});
parse_function(F) ->
bad_test(F).
@@ -580,7 +594,7 @@ testfuns(Es, M, TestSuffix, GeneratorSuffix) ->
N = atom_to_list(F),
case lists:suffix(TestSuffix, N) of
true ->
- [{M,F} | Fs];
+ [{test, M, F} | Fs];
false ->
case lists:suffix(GeneratorSuffix, N) of
true ->
@@ -723,6 +737,7 @@ data_test_() ->
Tests = [T,T,T],
[?_assertMatch(ok, eunit:test(T)),
?_assertMatch(error, eunit:test(Fail)),
+ ?_assertMatch(ok, eunit:test({test, ?MODULE, trivial_test})),
?_assertMatch(ok, eunit:test({generator, fun () -> Tests end})),
?_assertMatch(ok, eunit:test({generator, fun generator/0})),
?_assertMatch(ok, eunit:test({generator, ?MODULE, generator_exported_})),
@@ -740,6 +755,12 @@ data_test_() ->
%%?_test({foreach, Setup, [T, T, T]})
].
+trivial_test() ->
+ ok.
+
+trivial_generator_test_() ->
+ [?_test(ok)].
+
lazy_test_() ->
{spawn, [?_test(undefined = put(count, 0)),
lazy_gen(7),
diff --git a/lib/eunit/src/eunit_lib.erl b/lib/eunit/src/eunit_lib.erl
index 1c41e229c5..ea9e944d7e 100644
--- a/lib/eunit/src/eunit_lib.erl
+++ b/lib/eunit/src/eunit_lib.erl
@@ -30,7 +30,8 @@
-export([dlist_next/1, uniq/1, fun_parent/1, is_string/1, command/1,
command/2, command/3, trie_new/0, trie_store/2, trie_match/2,
split_node/1, consult_file/1, list_dir/1, format_exit_term/1,
- format_exception/1, format_exception/2, format_error/1]).
+ format_exception/1, format_exception/2, format_error/1,
+ is_not_test/1]).
%% Type definitions for describing exceptions
@@ -39,13 +40,10 @@
%%
%% @type exceptionClass() = error | exit | throw
%%
-%% @type stackTrace() = [{moduleName(), functionName(),
-%% arity() | argList()}]
+%% @type stackTrace() = [{moduleName(), functionName(), arity() | argList()}]
%%
%% @type moduleName() = atom()
%% @type functionName() = atom()
-%% @type arity() = integer()
-%% @type mfa() = {moduleName(), functionName(), arity()}
%% @type argList() = [term()]
%% @type fileName() = string()
@@ -59,8 +57,9 @@ format_exception({Class,Term,Trace}, Depth)
when is_atom(Class), is_list(Trace) ->
case is_stacktrace(Trace) of
true ->
- io_lib:format("~w:~P\n~s",
- [Class, Term, Depth, format_stacktrace(Trace)]);
+ io_lib:format("~s**~w:~s",
+ [format_stacktrace(Trace), Class,
+ format_term(Term, Depth)]);
false ->
format_term(Term, Depth)
end;
@@ -86,6 +85,12 @@ analyze_exit_term(Term) ->
is_stacktrace([]) ->
true;
+is_stacktrace([{M,F,A,L}|Fs])
+ when is_atom(M), is_atom(F), is_integer(A), is_list(L) ->
+ is_stacktrace(Fs);
+is_stacktrace([{M,F,As,L}|Fs])
+ when is_atom(M), is_atom(F), is_list(As), is_list(L) ->
+ is_stacktrace(Fs);
is_stacktrace([{M,F,A}|Fs]) when is_atom(M), is_atom(F), is_integer(A) ->
is_stacktrace(Fs);
is_stacktrace([{M,F,As}|Fs]) when is_atom(M), is_atom(F), is_list(As) ->
@@ -96,10 +101,11 @@ is_stacktrace(_) ->
format_stacktrace(Trace) ->
format_stacktrace(Trace, "in function", "in call from").
-format_stacktrace([{M,F,A}|Fs], Pre, Pre1) when is_integer(A) ->
- [io_lib:fwrite(" ~s ~w:~w/~w\n", [Pre, M, F, A])
+format_stacktrace([{M,F,A,L}|Fs], Pre, Pre1) when is_integer(A) ->
+ [io_lib:fwrite("~s ~w:~w/~w~s\n",
+ [Pre, M, F, A, format_stacktrace_location(L)])
| format_stacktrace(Fs, Pre1, Pre1)];
-format_stacktrace([{M,F,As}|Fs], Pre, Pre1) when is_list(As) ->
+format_stacktrace([{M,F,As,L}|Fs], Pre, Pre1) when is_list(As) ->
A = length(As),
C = case is_op(M,F,A) of
true when A =:= 1 ->
@@ -112,12 +118,23 @@ format_stacktrace([{M,F,As}|Fs], Pre, Pre1) when is_list(As) ->
false ->
io_lib:fwrite("~w(~s)", [F,format_arglist(As)])
end,
- [io_lib:fwrite(" ~s ~w:~w/~w\n called as ~s\n",
- [Pre,M,F,A,C])
+ [io_lib:fwrite("~s ~w:~w/~w~s\n called as ~s\n",
+ [Pre,M,F,A,format_stacktrace_location(L),C])
| format_stacktrace(Fs,Pre1,Pre1)];
+format_stacktrace([{M,F,As}|Fs], Pre, Pre1) ->
+ format_stacktrace([{M,F,As,[]}|Fs], Pre, Pre1);
format_stacktrace([],_Pre,_Pre1) ->
"".
+format_stacktrace_location(Location) ->
+ File = proplists:get_value(file, Location),
+ Line = proplists:get_value(line, Location),
+ if File =/= undefined, Line =/= undefined ->
+ io_lib:format(" (~s, line ~w)", [File, Line]);
+ true ->
+ ""
+ end.
+
format_arg(A) ->
io_lib:format("~P",[A,15]).
@@ -139,9 +156,13 @@ is_op(_M, _F, _A) ->
format_error({bad_test, Term}) ->
error_msg("bad test descriptor", "~P", [Term, 15]);
-format_error({generator_failed, Exception}) ->
- error_msg("test generator failed", "~s",
- [format_exception(Exception)]);
+format_error({bad_generator, {{M,F,A}, Term}}) ->
+ error_msg(io_lib:format("result from generator ~w:~w/~w is not a test",
+ [M,F,A]),
+ "~P", [Term, 15]);
+format_error({generator_failed, {{M,F,A}, Exception}}) ->
+ error_msg(io_lib:format("test generator ~w:~w/~w failed",[M,F,A]),
+ "~s", [format_exception(Exception)]);
format_error({no_such_function, {M,F,A}})
when is_atom(M), is_atom(F), is_integer(A) ->
error_msg(io_lib:format("no such function: ~w:~w/~w", [M,F,A]),
@@ -158,14 +179,55 @@ format_error({setup_failed, Exception}) ->
format_error({cleanup_failed, Exception}) ->
error_msg("context cleanup failed", "~s",
[format_exception(Exception)]);
+format_error({{bad_instantiator, {{M,F,A}, Term}}, _DummyException}) ->
+ error_msg(io_lib:format("result from instantiator ~w:~w/~w is not a test",
+ [M,F,A]),
+ "~P", [Term, 15]);
format_error({instantiation_failed, Exception}) ->
error_msg("instantiation of subtests failed", "~s",
[format_exception(Exception)]).
error_msg(Title, Fmt, Args) ->
- Msg = io_lib:format("::"++Fmt, Args), % gets indentation right
+ Msg = io_lib:format("**"++Fmt, Args), % gets indentation right
io_lib:fwrite("*** ~s ***\n~s\n\n", [Title, Msg]).
+-ifdef(TEST).
+format_exception_test_() ->
+ [?_assertMatch(
+ "\nymmud:rorre"++_,
+ lists:reverse(lists:flatten(
+ format_exception(try erlang:error(dummy)
+ catch C:R -> {C, R, erlang:get_stacktrace()}
+ end)))),
+ ?_assertMatch(
+ "\nymmud:rorre"++_,
+ lists:reverse(lists:flatten(
+ format_exception(try erlang:error(dummy, [a])
+ catch C:R -> {C, R, erlang:get_stacktrace()}
+ end))))].
+-endif.
+
+%% ---------------------------------------------------------------------
+%% detect common return values that are definitely not tests
+
+is_not_test(T) ->
+ case T of
+ ok -> true;
+ error -> true;
+ true -> true;
+ false -> true;
+ undefined -> true;
+ {ok, _} -> true;
+ {error, _} -> true;
+ {'EXIT', _} -> true;
+ N when is_number(N) -> true;
+ [N|_] when is_number(N) -> true;
+ X when is_binary(X) -> true;
+ X when is_pid(X) -> true;
+ X when is_port(X) -> true;
+ X when is_reference(X) -> true;
+ _ -> false
+ end.
%% ---------------------------------------------------------------------
%% Deep list iterator; accepts improper lists/sublists, and also accepts
diff --git a/lib/eunit/src/eunit_surefire.erl b/lib/eunit/src/eunit_surefire.erl
index 2a6cbca14d..46b8c8b503 100644
--- a/lib/eunit/src/eunit_surefire.erl
+++ b/lib/eunit/src/eunit_surefire.erl
@@ -156,9 +156,33 @@ handle_end(test, Data, St) ->
St#state{testsuites=store_suite(NewTestSuite, TestSuites)}.
%% Cancel group does not give information on the individual cancelled test case
-%% We ignore this event
-handle_cancel(group, _Data, St) ->
- St;
+%% We ignore this event...
+handle_cancel(group, Data, St) ->
+ %% ...except when it tells us that a fixture setup or cleanup failed.
+ case proplists:get_value(reason, Data) of
+ {abort, {SomethingFailed, Exception}}
+ when SomethingFailed =:= setup_failed;
+ SomethingFailed =:= cleanup_failed ->
+ [GroupId|_] = proplists:get_value(id, Data),
+ TestSuites = St#state.testsuites,
+ TestSuite = lookup_suite_by_group_id(GroupId, TestSuites),
+
+ %% We don't have any proper name. Let's give all the
+ %% clues that we have.
+ Name = case SomethingFailed of
+ setup_failed -> "fixture setup ";
+ cleanup_failed -> "fixture cleanup "
+ end
+ ++ io_lib:format("~p", [proplists:get_value(id, Data)]),
+ Desc = format_desc(proplists:get_value(desc, Data)),
+ TestCase = #testcase{
+ name = Name, description = Desc,
+ time = 0, output = <<>>},
+ NewTestSuite = add_testcase_to_testsuite({error, Exception}, TestCase, TestSuite),
+ St#state{testsuites=store_suite(NewTestSuite, TestSuites)};
+ _ ->
+ St
+ end;
handle_cancel(test, Data, St) ->
%% Retrieve existing test suite:
[GroupId|_] = proplists:get_value(id, Data),
@@ -232,7 +256,7 @@ write_reports(TestSuites, XmlDir) ->
write_report(#testsuite{name = Name} = TestSuite, XmlDir) ->
Filename = filename:join(XmlDir, lists:flatten(["TEST-", escape_suitename(Name)], ".xml")),
- case file:open(Filename, [write, raw]) of
+ case file:open(Filename, [write,{encoding,utf8}]) of
{ok, FileDescriptor} ->
try
write_report_to(TestSuite, FileDescriptor)
diff --git a/lib/eunit/src/eunit_test.erl b/lib/eunit/src/eunit_test.erl
index bca49ae626..9cf40a738d 100644
--- a/lib/eunit/src/eunit_test.erl
+++ b/lib/eunit/src/eunit_test.erl
@@ -21,8 +21,7 @@
-module(eunit_test).
--export([run_testfun/1, function_wrapper/2, enter_context/4,
- multi_setup/1]).
+-export([run_testfun/1, mf_wrapper/2, enter_context/4, multi_setup/1]).
-include("eunit.hrl").
@@ -43,8 +42,12 @@ get_stacktrace(Ts) ->
prune_trace([{eunit_data, _, _} | Rest], Tail) ->
prune_trace(Rest, Tail);
+prune_trace([{eunit_data, _, _, _} | Rest], Tail) ->
+ prune_trace(Rest, Tail);
prune_trace([{?MODULE, _, _} | _Rest], Tail) ->
Tail;
+prune_trace([{?MODULE, _, _, _} | _Rest], Tail) ->
+ Tail;
prune_trace([T | Ts], Tail) ->
[T | prune_trace(Ts, Tail)];
prune_trace([], Tail) ->
@@ -258,7 +261,7 @@ macro_test_() ->
%% @type wrapperError() = {no_such_function, mfa()}
%% | {module_not_found, moduleName()}
-function_wrapper(M, F) ->
+mf_wrapper(M, F) ->
fun () ->
try M:F()
catch
@@ -289,12 +292,12 @@ fail(Term) ->
wrapper_test_() ->
{"error handling in function wrapper",
[?_assertException(throw, {module_not_found, eunit_nonexisting},
- run_testfun(function_wrapper(eunit_nonexisting,test))),
+ run_testfun(mf_wrapper(eunit_nonexisting,test))),
?_assertException(throw,
{no_such_function, {?MODULE,nonexisting_test,0}},
- run_testfun(function_wrapper(?MODULE,nonexisting_test))),
+ run_testfun(mf_wrapper(?MODULE,nonexisting_test))),
?_test({error, {error, undef, _T}}
- = run_testfun(function_wrapper(?MODULE,wrapper_test_exported_)))
+ = run_testfun(mf_wrapper(?MODULE,wrapper_test_exported_)))
]}.
%% this must be exported (done automatically by the autoexport transform)
@@ -319,6 +322,17 @@ enter_context(Setup, Cleanup, Instantiate, Callback) ->
R ->
try Instantiate(R) of
T ->
+ case eunit_lib:is_not_test(T) of
+ true ->
+ catch throw(error), % generate a stack trace
+ {module,M} = erlang:fun_info(Instantiate, module),
+ {name,N} = erlang:fun_info(Instantiate, name),
+ {arity,A} = erlang:fun_info(Instantiate, arity),
+ context_error({bad_instantiator, {{M,N,A},T}},
+ error, badarg);
+ false ->
+ ok
+ end,
try Callback(T) %% call back to client code
after
%% Always run cleanup; client may be an idiot
diff --git a/lib/eunit/src/eunit_tty.erl b/lib/eunit/src/eunit_tty.erl
index e3e7b710b2..f21b2da3d3 100644
--- a/lib/eunit/src/eunit_tty.erl
+++ b/lib/eunit/src/eunit_tty.erl
@@ -44,6 +44,7 @@ start(Options) ->
init(Options) ->
St = #state{verbose = proplists:get_bool(verbose, Options)},
+ put(no_tty, proplists:get_bool(no_tty, Options)),
receive
{start, _Reference} ->
if St#state.verbose -> print_header();
@@ -59,30 +60,30 @@ terminate({ok, Data}, St) ->
Cancel = proplists:get_value(cancel, Data, 0),
if Fail =:= 0, Skip =:= 0, Cancel =:= 0 ->
if Pass =:= 0 ->
- io:fwrite(" There were no tests to run.\n");
+ fwrite(" There were no tests to run.\n");
true ->
if St#state.verbose -> print_bar();
true -> ok
end,
if Pass =:= 1 ->
- io:fwrite(" Test passed.\n");
+ fwrite(" Test passed.\n");
true ->
- io:fwrite(" All ~w tests passed.\n", [Pass])
+ fwrite(" All ~w tests passed.\n", [Pass])
end
end,
sync_end(ok);
true ->
print_bar(),
- io:fwrite(" Failed: ~w. Skipped: ~w. Passed: ~w.\n",
- [Fail, Skip, Pass]),
+ fwrite(" Failed: ~w. Skipped: ~w. Passed: ~w.\n",
+ [Fail, Skip, Pass]),
if Cancel =/= 0 ->
- io:fwrite("One or more tests were cancelled.\n");
+ fwrite("One or more tests were cancelled.\n");
true -> ok
end,
sync_end(error)
end;
terminate({error, Reason}, _St) ->
- io:fwrite("Internal error: ~P.\n", [Reason, 25]),
+ fwrite("Internal error: ~P.\n", [Reason, 25]),
sync_end(error).
sync_end(Result) ->
@@ -93,10 +94,10 @@ sync_end(Result) ->
end.
print_header() ->
- io:fwrite("======================== EUnit ========================\n").
+ fwrite("======================== EUnit ========================\n").
print_bar() ->
- io:fwrite("=======================================================\n").
+ fwrite("=======================================================\n").
handle_begin(group, Data, St) ->
@@ -170,18 +171,18 @@ handle_cancel(test, Data, St) ->
indent(N) when is_integer(N), N >= 1 ->
- io:put_chars(lists:duplicate(N * 2, $\s));
+ fwrite(lists:duplicate(N * 2, $\s));
indent(_N) ->
ok.
print_group_start(I, Desc) ->
indent(I),
- io:fwrite("~s\n", [Desc]).
+ fwrite("~s\n", [Desc]).
print_group_end(I, Time) ->
if Time > 0 ->
indent(I),
- io:fwrite("[done in ~.3f s]\n", [Time/1000]);
+ fwrite("[done in ~.3f s]\n", [Time/1000]);
true ->
ok
end.
@@ -198,9 +199,9 @@ print_test_begin(I, Data) ->
end,
case proplists:get_value(source, Data) of
{Module, Name, _Arity} ->
- io:fwrite("~s:~s ~s~s...", [Module, L, Name, D]);
+ fwrite("~s:~s ~s~s...", [Module, L, Name, D]);
_ ->
- io:fwrite("~s~s...", [L, D])
+ fwrite("~s~s...", [L, D])
end.
print_test_end(Data) ->
@@ -208,36 +209,35 @@ print_test_end(Data) ->
T = if Time > 0 -> io_lib:fwrite("[~.3f s] ", [Time/1000]);
true -> ""
end,
- io:fwrite("~sok\n", [T]).
+ fwrite("~sok\n", [T]).
print_test_error({error, Exception}, Data) ->
Output = proplists:get_value(output, Data),
- io:fwrite("*failed*\n::~s",
- [eunit_lib:format_exception(Exception)]),
+ fwrite("*failed*\n~s", [eunit_lib:format_exception(Exception)]),
case Output of
<<>> ->
- io:put_chars("\n\n");
+ fwrite("\n\n");
<<Text:800/binary, _:1/binary, _/binary>> ->
- io:fwrite(" output:<<\"~s\">>...\n\n", [Text]);
+ fwrite(" output:<<\"~s\">>...\n\n", [Text]);
_ ->
- io:fwrite(" output:<<\"~s\">>\n\n", [Output])
+ fwrite(" output:<<\"~s\">>\n\n", [Output])
end;
print_test_error({skipped, Reason}, _) ->
- io:fwrite("*did not run*\n::~s\n", [format_skipped(Reason)]).
+ fwrite("*did not run*\n::~s\n", [format_skipped(Reason)]).
format_skipped({module_not_found, M}) ->
- io_lib:format("missing module: ~w", [M]);
+ io_lib:fwrite("missing module: ~w", [M]);
format_skipped({no_such_function, {M,F,A}}) ->
- io_lib:format("no such function: ~w:~w/~w", [M,F,A]).
+ io_lib:fwrite("no such function: ~w:~w/~w", [M,F,A]).
print_test_cancel(Reason) ->
- io:fwrite(format_cancel(Reason)).
+ fwrite(format_cancel(Reason)).
print_group_cancel(_I, {blame, _}) ->
ok;
print_group_cancel(I, Reason) ->
indent(I),
- io:fwrite(format_cancel(Reason)).
+ fwrite(format_cancel(Reason)).
format_cancel(undefined) ->
"*skipped*\n";
@@ -253,3 +253,12 @@ format_cancel({exit, Reason}) ->
[Reason, 15]);
format_cancel({abort, Reason}) ->
eunit_lib:format_error(Reason).
+
+fwrite(String) ->
+ fwrite(String, []).
+
+fwrite(String, Args) ->
+ case get(no_tty) of
+ false -> io:fwrite(String, Args);
+ true -> ok
+ end.
diff --git a/lib/eunit/test/Makefile b/lib/eunit/test/Makefile
index a2d276f619..e4ddf4e42c 100644
--- a/lib/eunit/test/Makefile
+++ b/lib/eunit/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2010. All Rights Reserved.
+# Copyright Ericsson AB 2009-2012. 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
@@ -74,9 +74,9 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) eunit.spec $(EMAKEFILE) \
$(COVERFILE) $(ERL_FILES) \
- $(RELSYSDIR)
+ "$(RELSYSDIR)"
release_docs_spec:
diff --git a/lib/eunit/vsn.mk b/lib/eunit/vsn.mk
index 445c070e96..174d197117 100644
--- a/lib/eunit/vsn.mk
+++ b/lib/eunit/vsn.mk
@@ -1 +1 @@
-EUNIT_VSN = 2.2.2
+EUNIT_VSN = 2.2.3
diff --git a/lib/gs/contribs/bonk/Makefile b/lib/gs/contribs/bonk/Makefile
index be096824dd..a630deaf24 100644
--- a/lib/gs/contribs/bonk/Makefile
+++ b/lib/gs/contribs/bonk/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -94,14 +94,14 @@ $(EBIN)/$(TOOLNAME).tool: $(TOOLNAME).tool
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/bonk/bitmaps
- $(INSTALL_DATA) $(BITMAPS) $(TOOLBOX_FILES) $(RELSYSDIR)/bonk/bitmaps
- $(INSTALL_DIR) $(RELSYSDIR)/bonk/sounds
- $(INSTALL_DATA) $(SOUNDS) $(RELSYSDIR)/bonk/sounds
- $(INSTALL_DIR) $(RELSYSDIR)/bonk
- $(INSTALL_DATA) $(ERL_FILES) $(EXTRA_FILES) $(RELSYSDIR)/bonk
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/bonk/bitmaps"
+ $(INSTALL_DATA) $(BITMAPS) $(TOOLBOX_FILES) "$(RELSYSDIR)/bonk/bitmaps"
+ $(INSTALL_DIR) "$(RELSYSDIR)/bonk/sounds"
+ $(INSTALL_DATA) $(SOUNDS) "$(RELSYSDIR)/bonk/sounds"
+ $(INSTALL_DIR) "$(RELSYSDIR)/bonk"
+ $(INSTALL_DATA) $(ERL_FILES) $(EXTRA_FILES) "$(RELSYSDIR)/bonk"
release_docs_spec:
diff --git a/lib/gs/contribs/bonk/bonk.erl b/lib/gs/contribs/bonk/bonk.erl
index 79f01bf659..3d1e8ce34b 100644
--- a/lib/gs/contribs/bonk/bonk.erl
+++ b/lib/gs/contribs/bonk/bonk.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -19,6 +19,12 @@
%%
-module(bonk).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,create,4}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,start,0}}]).
+
-export([run/0, run/1,bonk_dir/0,start/0]).
-record(colors, {miss, x, bomb, face}).
diff --git a/lib/gs/contribs/cols/Makefile b/lib/gs/contribs/cols/Makefile
index 75ca75ffc0..3af91e1dae 100644
--- a/lib/gs/contribs/cols/Makefile
+++ b/lib/gs/contribs/cols/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -91,12 +91,12 @@ $(EBIN)/help.gif: help.gif
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/cols/bitmaps
- $(INSTALL_DATA) $(BITMAPS) $(TOOLBOX_FILES) $(RELSYSDIR)/cols/bitmaps
- $(INSTALL_DIR) $(RELSYSDIR)/cols
- $(INSTALL_DATA) $(ERL_FILES) $(EXTRA_FILES) $(RELSYSDIR)/cols
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/cols/bitmaps"
+ $(INSTALL_DATA) $(BITMAPS) $(TOOLBOX_FILES) "$(RELSYSDIR)/cols/bitmaps"
+ $(INSTALL_DIR) "$(RELSYSDIR)/cols"
+ $(INSTALL_DATA) $(ERL_FILES) $(EXTRA_FILES) "$(RELSYSDIR)/cols"
release_docs_spec:
diff --git a/lib/gs/contribs/cols/cols.erl b/lib/gs/contribs/cols/cols.erl
index 111c9a58f1..d1a1b791c3 100644
--- a/lib/gs/contribs/cols/cols.erl
+++ b/lib/gs/contribs/cols/cols.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -19,6 +19,12 @@
%%
-module(cols).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,create,4}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}}]).
-export([start/0, init/0]).
diff --git a/lib/gs/contribs/cols/highscore.erl b/lib/gs/contribs/cols/highscore.erl
index 9ffbea50a7..7f80debb07 100644
--- a/lib/gs/contribs/cols/highscore.erl
+++ b/lib/gs/contribs/cols/highscore.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -19,6 +19,13 @@
%%
-module(highscore).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,grid,2}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
-export([run/2]).
diff --git a/lib/gs/contribs/mandel/Makefile b/lib/gs/contribs/mandel/Makefile
index 61a7a612e0..5f0b047955 100644
--- a/lib/gs/contribs/mandel/Makefile
+++ b/lib/gs/contribs/mandel/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -90,11 +90,11 @@ $(EBIN)/help.gif: help.gif
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/mandel/bitmaps
- $(INSTALL_DATA) $(BITMAPS) $(TOOLBOX_FILES) $(RELSYSDIR)/mandel/bitmaps
- $(INSTALL_DIR) $(RELSYSDIR)/mandel
- $(INSTALL_DATA) $(ERL_FILES) $(EXTRA_FILES) $(RELSYSDIR)/mandel
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/mandel/bitmaps"
+ $(INSTALL_DATA) $(BITMAPS) $(TOOLBOX_FILES) "$(RELSYSDIR)/mandel/bitmaps"
+ $(INSTALL_DIR) "$(RELSYSDIR)/mandel"
+ $(INSTALL_DATA) $(ERL_FILES) $(EXTRA_FILES) "$(RELSYSDIR)/mandel"
release_docs_spec:
diff --git a/lib/gs/contribs/mandel/mandel.erl b/lib/gs/contribs/mandel/mandel.erl
index 0f1df5c665..8ecd649532 100644
--- a/lib/gs/contribs/mandel/mandel.erl
+++ b/lib/gs/contribs/mandel/mandel.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -18,6 +18,11 @@
%%
-module(mandel).
+-compile([{nowarn_deprecated_function,{gs,assq,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,4}},
+ {nowarn_deprecated_function,{gs,image,2}},
+ {nowarn_deprecated_function,{gs,start,0}}]).
-author('(mbj,eklas)@erlang.ericsson.se').
%% User's interface
diff --git a/lib/gs/contribs/othello/Makefile b/lib/gs/contribs/othello/Makefile
index b81b35fb55..5f37d164f5 100644
--- a/lib/gs/contribs/othello/Makefile
+++ b/lib/gs/contribs/othello/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -89,12 +89,12 @@ $(EBIN)/$(TOOLNAME).tool: $(TOOLNAME).tool
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/othello
- $(INSTALL_DATA) $(ERL_FILES) $(EXTRA_FILES) $(RELSYSDIR)/othello
- $(INSTALL_DIR) $(RELSYSDIR)/othello/priv
- $(INSTALL_DATA) $(BITMAPS) $(TOOLBOX_FILES) $(RELSYSDIR)/othello/priv
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/othello"
+ $(INSTALL_DATA) $(ERL_FILES) $(EXTRA_FILES) "$(RELSYSDIR)/othello"
+ $(INSTALL_DIR) "$(RELSYSDIR)/othello/priv"
+ $(INSTALL_DATA) $(BITMAPS) $(TOOLBOX_FILES) "$(RELSYSDIR)/othello/priv"
release_docs_spec:
diff --git a/lib/gs/contribs/othello/othello_board.erl b/lib/gs/contribs/othello/othello_board.erl
index 212ba9bfe1..aaa4062ba8 100644
--- a/lib/gs/contribs/othello/othello_board.erl
+++ b/lib/gs/contribs/othello/othello_board.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -19,6 +19,12 @@
%%
-module(othello_board).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,create,4}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,start,0}}]).
+
-export([start/0,stop/0,init/0]).
diff --git a/lib/gs/doc/src/Makefile b/lib/gs/doc/src/Makefile
index 192dd67a52..bfc5e4c317 100644
--- a/lib/gs/doc/src/Makefile
+++ b/lib/gs/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -144,13 +144,13 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
- (/bin/cp -rf $(HTMLDIR) $(RELSYSDIR)/doc)
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
+ (/bin/cp -rf $(HTMLDIR) "$(RELSYSDIR)/doc")
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/gs/doc/src/gs.xml b/lib/gs/doc/src/gs.xml
index f2182fc673..417163e963 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>2010</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -39,9 +39,7 @@
graphical user interface.
</p>
<p>
- GS is not maintained and we plan to deprecate and remove it from
- the distribution as soon as possible, maybe already in the next
- major release (R15).
+ GS is deprecated and will be removed in the R16 release.
</p>
</warning>
<p>The Graphics System, GS, is easy to learn and
diff --git a/lib/gs/doc/src/notes.xml b/lib/gs/doc/src/notes.xml
index cd63104346..69b1e90ba5 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,7 +30,27 @@
</header>
<p>This document describes the changes made to the GS application.</p>
- <section><title>GS 1.5.15</title>
+ <section><title>GS 1.5.15.1</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>The GS applications is now deprecated and will be
+ removed in the R16 release. The following GS-based
+ applications have been superseded by the Observer
+ application and will removed in R16: Appmon, Pman,
+ Tv.</p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>
+ Own Id: OTP-9907</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>GS 1.5.15</title>
<section><title>Improvements and New Features</title>
<list>
diff --git a/lib/gs/examples/Makefile b/lib/gs/examples/Makefile
index 10b166b207..ee77990191 100644
--- a/lib/gs/examples/Makefile
+++ b/lib/gs/examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -87,9 +87,9 @@ clean:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/src
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/src"
release_docs_spec:
diff --git a/lib/gs/examples/ball.erl b/lib/gs/examples/ball.erl
index 3f91a7b379..42e3522fc7 100644
--- a/lib/gs/examples/ball.erl
+++ b/lib/gs/examples/ball.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -24,6 +24,12 @@
%% ------------------------------------------------------------
-module(ball).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,canvas,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,oval,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
-export([start/0,init/0]).
diff --git a/lib/gs/examples/browser.erl b/lib/gs/examples/browser.erl
index 1dba5a915b..dd01e0299b 100644
--- a/lib/gs/examples/browser.erl
+++ b/lib/gs/examples/browser.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,14 @@
%% ------------------------------------------------------------
-module(browser).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,entry,2}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,listbox,2}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
-export([start/0,start/2,init/3]).
diff --git a/lib/gs/examples/calc.erl b/lib/gs/examples/calc.erl
index 992b8adb4e..9ed8ed4dbd 100644
--- a/lib/gs/examples/calc.erl
+++ b/lib/gs/examples/calc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,11 @@
%% ------------------------------------------------------------
-module(calc).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
-export([start/0,calc/0]).
diff --git a/lib/gs/examples/calc2.erl b/lib/gs/examples/calc2.erl
index 0e841397f6..51f9c31d28 100644
--- a/lib/gs/examples/calc2.erl
+++ b/lib/gs/examples/calc2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -24,6 +24,12 @@
%% ------------------------------------------------------------
-module(calc2).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
+
-export([start/0,calc/0]).
start() ->
diff --git a/lib/gs/examples/color_demo.erl b/lib/gs/examples/color_demo.erl
index 650f853061..5ebfe36d75 100644
--- a/lib/gs/examples/color_demo.erl
+++ b/lib/gs/examples/color_demo.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -24,6 +24,11 @@
%% ------------------------------------------------------------
-module(color_demo).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,scale,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
-export([start/0,init/0]).
diff --git a/lib/gs/examples/color_demo2.erl b/lib/gs/examples/color_demo2.erl
index 817cc9ed7d..1c8db7a851 100644
--- a/lib/gs/examples/color_demo2.erl
+++ b/lib/gs/examples/color_demo2.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -24,6 +24,10 @@
%% ------------------------------------------------------------
-module(color_demo2).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,create,4}},
+ {nowarn_deprecated_function,{gs,start,0}}]).
-export([start/0,init/0]).
diff --git a/lib/gs/examples/distrib_draw.erl b/lib/gs/examples/distrib_draw.erl
index ecb1386c25..fc821c6df4 100644
--- a/lib/gs/examples/distrib_draw.erl
+++ b/lib/gs/examples/distrib_draw.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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,6 +43,11 @@
%%
-module(distrib_draw).
+-compile([{nowarn_deprecated_function,{gs,canvas,3}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,line,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
-export([start/2,init/0]).
diff --git a/lib/gs/examples/entry_demo.erl b/lib/gs/examples/entry_demo.erl
index a5ecfbc4d3..4cdbe7e279 100644
--- a/lib/gs/examples/entry_demo.erl
+++ b/lib/gs/examples/entry_demo.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,12 @@
%% ------------------------------------------------------------
-module(entry_demo).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,create,4}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
-export([start/0,init/1]).
diff --git a/lib/gs/examples/event_test.erl b/lib/gs/examples/event_test.erl
index f6fcc9b4b9..3231df00e1 100644
--- a/lib/gs/examples/event_test.erl
+++ b/lib/gs/examples/event_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -21,6 +21,9 @@
%% Demo for testing some events
-module(event_test).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
-export([start/0,init/0]).
diff --git a/lib/gs/examples/file_dialog.erl b/lib/gs/examples/file_dialog.erl
index ff20321374..37b19a322c 100644
--- a/lib/gs/examples/file_dialog.erl
+++ b/lib/gs/examples/file_dialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,11 @@
%% ------------------------------------------------------------
-module(file_dialog).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,4}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}}]).
-export([start/0,start/1,start/2,fs_init/3]).
diff --git a/lib/gs/examples/focus_demo.erl b/lib/gs/examples/focus_demo.erl
index b9d86866e6..990140d9bc 100644
--- a/lib/gs/examples/focus_demo.erl
+++ b/lib/gs/examples/focus_demo.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,11 @@
%% ------------------------------------------------------------
-module(focus_demo).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,4}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
-export([start/0,init/0]).
diff --git a/lib/gs/examples/frac.erl b/lib/gs/examples/frac.erl
index 139a4be310..be77c8f5d4 100644
--- a/lib/gs/examples/frac.erl
+++ b/lib/gs/examples/frac.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -21,6 +21,9 @@
%% Purpose : Fractal trees
-module(frac).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,start,0}}]).
-export([start/0, go/0, test/0, grow/2, expand/3, subst/2]).
diff --git a/lib/gs/examples/line_demo.erl b/lib/gs/examples/line_demo.erl
index c8a6a69e2e..32c2920878 100644
--- a/lib/gs/examples/line_demo.erl
+++ b/lib/gs/examples/line_demo.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -24,6 +24,12 @@
%% ------------------------------------------------------------
-module(line_demo).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,canvas,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,line,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
-export([start/0,init/0,line/3]).
diff --git a/lib/gs/examples/man.erl b/lib/gs/examples/man.erl
index a0ffd3364e..093ce854f8 100644
--- a/lib/gs/examples/man.erl
+++ b/lib/gs/examples/man.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,15 @@
%% ------------------------------------------------------------
-module(man).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,4}},
+ {nowarn_deprecated_function,{gs,entry,2}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,listbox,2}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
-export([start/0,init/0]).
-export([man_list/0]).
diff --git a/lib/gs/examples/menu_demo.erl b/lib/gs/examples/menu_demo.erl
index c95fc33152..60e335c40b 100644
--- a/lib/gs/examples/menu_demo.erl
+++ b/lib/gs/examples/menu_demo.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -19,6 +19,12 @@
%%
-module(menu_demo).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,create,4}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
-compile(export_all).
diff --git a/lib/gs/examples/rubber.erl b/lib/gs/examples/rubber.erl
index ba263f07ac..a9fe403b12 100644
--- a/lib/gs/examples/rubber.erl
+++ b/lib/gs/examples/rubber.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,14 @@
%% ------------------------------------------------------------
-module(rubber).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,canvas,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,radiobutton,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
-export([start/0, init/0]).
diff --git a/lib/gs/src/Makefile b/lib/gs/src/Makefile
index 43b530295b..4b7a4523b9 100644
--- a/lib/gs/src/Makefile
+++ b/lib/gs/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -107,13 +107,13 @@ $(GSTK_GENERIC_TARGET): gstk_generic.hrl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
$(INSTALL_DATA) $(APP_SRC) $(ERL_FILES) $(HRL_FILES) $(GEN_HRL_FILES) \
- $(GSTK_GENERIC) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/priv/bitmap
- $(INSTALL_DATA) $(IMAGES) $(RELSYSDIR)/priv/bitmap
+ $(GSTK_GENERIC) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/bitmap"
+ $(INSTALL_DATA) $(IMAGES) "$(RELSYSDIR)/priv/bitmap"
release_docs_spec:
diff --git a/lib/gs/src/gs.erl b/lib/gs/src/gs.erl
index 3e9a1c4b8b..c25c75766e 100644
--- a/lib/gs/src/gs.erl
+++ b/lib/gs/src/gs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -24,7 +24,13 @@
%%
-module(gs).
-
+-deprecated(module).
+-compile([{nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,create,4}},
+ {nowarn_deprecated_function,{gs,create_tree,2}},
+ {nowarn_deprecated_function,{gs,foreach,3}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,1}}]).
%% ----- Exports -----
-export([start/0, stop/0, start/1]).
diff --git a/lib/gs/src/gs_frontend.erl b/lib/gs/src/gs_frontend.erl
index 009b264e69..37f91cf37c 100644
--- a/lib/gs/src/gs_frontend.erl
+++ b/lib/gs/src/gs_frontend.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -24,6 +24,8 @@
%%
-module(gs_frontend).
+-compile([{nowarn_deprecated_function,{gs,assq,2}},
+ {nowarn_deprecated_function,{gs,error,2}}]).
-export([create/2,
config/2,
diff --git a/lib/gs/src/gs_make.erl b/lib/gs/src/gs_make.erl
index e41183f9bf..9acffcd62e 100644
--- a/lib/gs/src/gs_make.erl
+++ b/lib/gs/src/gs_make.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -19,6 +19,7 @@
%%
-module(gs_make).
+-compile([{nowarn_deprecated_function,{gs,assq,2}}]).
-export([start/0]).
diff --git a/lib/gs/src/gse.erl b/lib/gs/src/gse.erl
index b3ea2af4d4..b63841bc20 100644
--- a/lib/gs/src/gse.erl
+++ b/lib/gs/src/gse.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -23,6 +23,68 @@
%%%----------------------------------------------------------------------
-module(gse).
+-compile([{nowarn_deprecated_function,{gs,arc,2}},
+ {nowarn_deprecated_function,{gs,arc,3}},
+ {nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,button,3}},
+ {nowarn_deprecated_function,{gs,canvas,2}},
+ {nowarn_deprecated_function,{gs,canvas,3}},
+ {nowarn_deprecated_function,{gs,checkbutton,2}},
+ {nowarn_deprecated_function,{gs,checkbutton,3}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,create,4}},
+ {nowarn_deprecated_function,{gs,create_tree,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,editor,2}},
+ {nowarn_deprecated_function,{gs,editor,3}},
+ {nowarn_deprecated_function,{gs,entry,2}},
+ {nowarn_deprecated_function,{gs,entry,3}},
+ {nowarn_deprecated_function,{gs,frame,2}},
+ {nowarn_deprecated_function,{gs,frame,3}},
+ {nowarn_deprecated_function,{gs,grid,2}},
+ {nowarn_deprecated_function,{gs,grid,3}},
+ {nowarn_deprecated_function,{gs,gridline,2}},
+ {nowarn_deprecated_function,{gs,gridline,3}},
+ {nowarn_deprecated_function,{gs,image,2}},
+ {nowarn_deprecated_function,{gs,image,3}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,label,3}},
+ {nowarn_deprecated_function,{gs,line,2}},
+ {nowarn_deprecated_function,{gs,line,3}},
+ {nowarn_deprecated_function,{gs,listbox,2}},
+ {nowarn_deprecated_function,{gs,listbox,3}},
+ {nowarn_deprecated_function,{gs,menu,2}},
+ {nowarn_deprecated_function,{gs,menu,3}},
+ {nowarn_deprecated_function,{gs,menubar,2}},
+ {nowarn_deprecated_function,{gs,menubar,3}},
+ {nowarn_deprecated_function,{gs,menubutton,2}},
+ {nowarn_deprecated_function,{gs,menubutton,3}},
+ {nowarn_deprecated_function,{gs,menuitem,2}},
+ {nowarn_deprecated_function,{gs,menuitem,3}},
+ {nowarn_deprecated_function,{gs,message,2}},
+ {nowarn_deprecated_function,{gs,message,3}},
+ {nowarn_deprecated_function,{gs,oval,2}},
+ {nowarn_deprecated_function,{gs,oval,3}},
+ {nowarn_deprecated_function,{gs,polygon,2}},
+ {nowarn_deprecated_function,{gs,polygon,3}},
+ {nowarn_deprecated_function,{gs,prompter,2}},
+ {nowarn_deprecated_function,{gs,prompter,3}},
+ {nowarn_deprecated_function,{gs,radiobutton,2}},
+ {nowarn_deprecated_function,{gs,radiobutton,3}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,rectangle,2}},
+ {nowarn_deprecated_function,{gs,rectangle,3}},
+ {nowarn_deprecated_function,{gs,scale,2}},
+ {nowarn_deprecated_function,{gs,scale,3}},
+ {nowarn_deprecated_function,{gs,scrollbar,2}},
+ {nowarn_deprecated_function,{gs,scrollbar,3}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,start,1}},
+ {nowarn_deprecated_function,{gs,text,2}},
+ {nowarn_deprecated_function,{gs,text,3}},
+ {nowarn_deprecated_function,{gs,window,2}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
%%-compile(export_all).
-export([
diff --git a/lib/gs/src/gstk.erl b/lib/gs/src/gstk.erl
index 6f83cf8be4..04ca9b4722 100644
--- a/lib/gs/src/gstk.erl
+++ b/lib/gs/src/gstk.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -20,6 +20,8 @@
%%
-module(gstk).
+-compile([{nowarn_deprecated_function,{gs,assq,2}},
+ {nowarn_deprecated_function,{gs,creation_error,2}}]).
-export([start_link/4,
stop/1,
diff --git a/lib/gs/src/gstk_arc.erl b/lib/gs/src/gstk_arc.erl
index 8e80ef92b5..1441bb0b32 100644
--- a/lib/gs/src/gstk_arc.erl
+++ b/lib/gs/src/gstk_arc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,7 @@
%% ------------------------------------------------------------
-module(gstk_arc).
+-compile([{nowarn_deprecated_function,{gs,creation_error,2}}]).
%%-----------------------------------------------------------------------------
%% ARC OPTIONS
diff --git a/lib/gs/src/gstk_canvas.erl b/lib/gs/src/gstk_canvas.erl
index 868b3020fe..34e4be0667 100644
--- a/lib/gs/src/gstk_canvas.erl
+++ b/lib/gs/src/gstk_canvas.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,8 @@
%% ------------------------------------------------------------
-module(gstk_canvas).
+-compile([{nowarn_deprecated_function,{gs,pair,2}},
+ {nowarn_deprecated_function,{gs,val,2}}]).
%%-----------------------------------------------------------------------------
%% CANVAS OPTIONS
diff --git a/lib/gs/src/gstk_editor.erl b/lib/gs/src/gstk_editor.erl
index 6b90cee1d2..e918d93147 100644
--- a/lib/gs/src/gstk_editor.erl
+++ b/lib/gs/src/gstk_editor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,9 @@
%% ------------------------------------------------------------
-module(gstk_editor).
+-compile([{nowarn_deprecated_function,{gs,assq,2}},
+ {nowarn_deprecated_function,{gs,error,2}},
+ {nowarn_deprecated_function,{gs,val,2}}]).
%%------------------------------------------------------------------------------
%% CANVAS OPTIONS
diff --git a/lib/gs/src/gstk_entry.erl b/lib/gs/src/gstk_entry.erl
index 14f7831151..b10b6460f2 100644
--- a/lib/gs/src/gstk_entry.erl
+++ b/lib/gs/src/gstk_entry.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,7 @@
%% ------------------------------------------------------------
-module(gstk_entry).
+-compile([{nowarn_deprecated_function,{gs,error,2}}]).
%%------------------------------------------------------------------------------
%% ENTRY OPTIONS
diff --git a/lib/gs/src/gstk_generic.erl b/lib/gs/src/gstk_generic.erl
index 8fe19b428c..9b0efd07c1 100644
--- a/lib/gs/src/gstk_generic.erl
+++ b/lib/gs/src/gstk_generic.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -20,6 +20,7 @@
%%
-module(gstk_generic).
+-compile([{nowarn_deprecated_function,{gs,assq,2}}]).
-export([out_opts/8,
read_option/5,
@@ -322,7 +323,7 @@ handle_external_opt_call([Opt|Options],Gstkid,TkW,DB,ExtraArg,ExtRes,S,P,C) ->
end.
handle_external_read(Res) ->
- case Res of
+ _ = case Res of
{bad_result,{Objtype,Reason,Option}} ->
{error,{Objtype,Reason,Option}};
_ -> ok
diff --git a/lib/gs/src/gstk_grid.erl b/lib/gs/src/gstk_grid.erl
index 4189246822..5f4f4a24f0 100644
--- a/lib/gs/src/gstk_grid.erl
+++ b/lib/gs/src/gstk_grid.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -19,6 +19,7 @@
%%
-module(gstk_grid).
+-compile([{nowarn_deprecated_function,{gs,val,2}}]).
-export([event/5,create/3,config/3,option/5,read/3,delete/2,destroy/2,
mk_create_opts_for_child/4,read_option/5]).
diff --git a/lib/gs/src/gstk_gridline.erl b/lib/gs/src/gstk_gridline.erl
index c1dd5a1443..914a7f1c6d 100644
--- a/lib/gs/src/gstk_gridline.erl
+++ b/lib/gs/src/gstk_gridline.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -19,6 +19,8 @@
%%
-module(gstk_gridline).
+-compile([{nowarn_deprecated_function,{gs,val,2}},
+ {nowarn_deprecated_function,{gs,val,3}}]).
-export([event/5,create/3,config/3,option/5,read/3,delete/2,destroy/3,
read_option/5]).
diff --git a/lib/gs/src/gstk_image.erl b/lib/gs/src/gstk_image.erl
index 53789b312d..7dbcce3cf9 100644
--- a/lib/gs/src/gstk_image.erl
+++ b/lib/gs/src/gstk_image.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,7 @@
%% ------------------------------------------------------------
-module(gstk_image).
+-compile([{nowarn_deprecated_function,{gs,pair,2}}]).
%%-----------------------------------------------------------------------------
%% BITMAP OPTIONS
diff --git a/lib/gs/src/gstk_menu.erl b/lib/gs/src/gstk_menu.erl
index 3957951a35..09f3208299 100644
--- a/lib/gs/src/gstk_menu.erl
+++ b/lib/gs/src/gstk_menu.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,7 @@
%%------------------------------------------------------------------------------
-module(gstk_menu).
+-compile([{nowarn_deprecated_function,{gs,error,2}}]).
%%------------------------------------------------------------------------------
%% MENU OPTIONS
diff --git a/lib/gs/src/gstk_menuitem.erl b/lib/gs/src/gstk_menuitem.erl
index 36a9253598..03aca75b80 100644
--- a/lib/gs/src/gstk_menuitem.erl
+++ b/lib/gs/src/gstk_menuitem.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,7 @@
%% ------------------------------------------------------------
-module(gstk_menuitem).
+-compile([{nowarn_deprecated_function,{gs,error,2}}]).
%%-----------------------------------------------------------------------------
%% MENUITEM OPTIONS
diff --git a/lib/gs/src/gstk_port_handler.erl b/lib/gs/src/gstk_port_handler.erl
index 93f3e58dc2..3ecc6ac5d6 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -34,6 +34,7 @@
%% ------------------------------------------------------------
-module(gstk_port_handler).
+-compile([{nowarn_deprecated_function,{gs,error,2}}]).
-include("gstk.hrl").
diff --git a/lib/gs/src/gstk_rectangle.erl b/lib/gs/src/gstk_rectangle.erl
index 1e02977c9a..e26db2ed15 100644
--- a/lib/gs/src/gstk_rectangle.erl
+++ b/lib/gs/src/gstk_rectangle.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,7 @@
%% ------------------------------------------------------------
-module(gstk_rectangle).
+-compile([{nowarn_deprecated_function,{gs,pair,2}}]).
%%-----------------------------------------------------------------------------
%% RECTANGLE OPTIONS
diff --git a/lib/gs/src/gstk_window.erl b/lib/gs/src/gstk_window.erl
index acac452ed1..d9ab16df37 100644
--- a/lib/gs/src/gstk_window.erl
+++ b/lib/gs/src/gstk_window.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -23,6 +23,7 @@
%% ------------------------------------------------------------
-module(gstk_window).
+-compile([{nowarn_deprecated_function,{gs,destroy,1}}]).
%%------------------------------------------------------------------------------
%% WINDOW OPTIONS
diff --git a/lib/gs/src/tcl2erl.erl b/lib/gs/src/tcl2erl.erl
index 8845cf0b9a..d93f589656 100644
--- a/lib/gs/src/tcl2erl.erl
+++ b/lib/gs/src/tcl2erl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -25,6 +25,7 @@
%% ------------------------------------------------------------
-module(tcl2erl).
+-compile([{nowarn_deprecated_function,{gs,error,2}}]).
-export([parse_event/1,
ret_int/1,
diff --git a/lib/gs/src/tool_file_dialog.erl b/lib/gs/src/tool_file_dialog.erl
index 6b2c2e8c81..f47b4b9e3f 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,6 +19,16 @@
%%
-module(tool_file_dialog).
+-compile([{nowarn_deprecated_function,{gs,button,3}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,entry,3}},
+ {nowarn_deprecated_function,{gs,frame,3}},
+ {nowarn_deprecated_function,{gs,label,3}},
+ {nowarn_deprecated_function,{gs,listbox,3}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
+
-export([start/1]).
-record(opts, {type, % open | save | multiselect
diff --git a/lib/gs/src/tool_utils.erl b/lib/gs/src/tool_utils.erl
index f1b93c1af8..c6b75466be 100644
--- a/lib/gs/src/tool_utils.erl
+++ b/lib/gs/src/tool_utils.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,6 +19,11 @@
%%
-module(tool_utils).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,read,2}}]).
+
-include_lib("kernel/include/file.hrl").
%%%---------------------------------------------------------------------
diff --git a/lib/gs/tcl/Makefile.in b/lib/gs/tcl/Makefile.in
index dce34a4baa..c22a7037e8 100644
--- a/lib/gs/tcl/Makefile.in
+++ b/lib/gs/tcl/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2009. All Rights Reserved.
+# Copyright Ericsson AB 2002-2012. 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
@@ -74,10 +74,10 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec:
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DATA) $(TCL_FILES) $(EXTRA_FILES) $(RELSYSDIR)/priv
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) $(TCL_FILES) $(EXTRA_FILES) "$(RELSYSDIR)/priv"
ifneq ($(TCL_TAR),)
- gzip -dc $(TCL_TAR) | (cd $(RELSYSDIR)/priv && tar -xf -)
+ gzip -dc $(TCL_TAR) | (cd "$(RELSYSDIR)/priv" && tar -xf -)
endif
release_docs_spec:
diff --git a/lib/gs/vsn.mk b/lib/gs/vsn.mk
index 41a2561809..48249cb3d0 100644
--- a/lib/gs/vsn.mk
+++ b/lib/gs/vsn.mk
@@ -1,2 +1,2 @@
-GS_VSN = 1.5.15
+GS_VSN = 1.5.15.1
diff --git a/lib/hipe/Makefile b/lib/hipe/Makefile
index 6682c9aac0..2294f98158 100644
--- a/lib/hipe/Makefile
+++ b/lib/hipe/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2010. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -37,8 +37,13 @@ else
SUB_DIRECTORIES = $(ALWAYS_SUBDIRS)
endif
+
include native.mk
+ifndef EBIN
+EBIN = ../ebin
+endif
+
#
# Default Subdir Targets
#
@@ -52,12 +57,20 @@ edocs:
fi
all-subdirs:
- -for dir in $(SUB_DIRECTORIES); do \
- (cd $$dir; $(MAKE) $(MAKETARGET) EBIN=../ebin; cd ..); \
+ for dir in $(SUB_DIRECTORIES); do \
+ (cd $$dir; $(MAKE) $(MAKETARGET) EBIN=$(EBIN); cd ..); \
+ done
+
+# distclean and realclean should clean the bootstrap files
+all-subdirs-x:
+ for dir in $(SUB_DIRECTORIES); do \
+ (cd $$dir; $(MAKE) $(MAKETARGET) EBIN=../boot_ebin; cd ..); \
done
+clean:
+ $(MAKE) MAKETARGET="clean" all-subdirs all-subdirs-x
distclean:
- $(MAKE) MAKETARGET="distclean" all-subdirs
+ $(MAKE) MAKETARGET="distclean" all-subdirs all-subdirs-x
realclean:
- $(MAKE) MAKETARGET="realclean" all-subdirs
+ $(MAKE) MAKETARGET="realclean" all-subdirs all-subdirs-x
diff --git a/lib/hipe/amd64/Makefile b/lib/hipe/amd64/Makefile
index 58377e5349..50cd024d72 100644
--- a/lib/hipe/amd64/Makefile
+++ b/lib/hipe/amd64/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2010. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -89,6 +89,9 @@ clean:
rm -f $(TARGET_FILES)
rm -f core
+distclean: clean
+realclean: clean
+
$(DOCS)/%.html:%.erl
erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop
@@ -102,8 +105,8 @@ $(DOCS)/%.html:%.erl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/hipe/arm/Makefile b/lib/hipe/arm/Makefile
index 3f60cd77cc..651b82f1ed 100644
--- a/lib/hipe/arm/Makefile
+++ b/lib/hipe/arm/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2010. All Rights Reserved.
+# Copyright Ericsson AB 2005-2012. 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
@@ -90,6 +90,9 @@ clean:
rm -f $(TARGET_FILES)
rm -f core
+distclean: clean
+realclean: clean
+
$(DOCS)/%.html:%.erl
erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop
@@ -103,8 +106,8 @@ $(DOCS)/%.html:%.erl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/inviso/include/.gitignore b/lib/hipe/boot_ebin/.gitignore
index e69de29bb2..e69de29bb2 100644
--- a/lib/inviso/include/.gitignore
+++ b/lib/hipe/boot_ebin/.gitignore
diff --git a/lib/hipe/cerl/Makefile b/lib/hipe/cerl/Makefile
index 7fcc44d27d..506e993ff4 100644
--- a/lib/hipe/cerl/Makefile
+++ b/lib/hipe/cerl/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2010. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -42,7 +42,7 @@ RELSYSDIR = $(RELEASE_PATH)/lib/hipe-$(VSN)
# ----------------------------------------------------
# Target Specs
# ----------------------------------------------------
-MODULES = cerl_cconv cerl_closurean cerl_hipeify cerl_hybrid_transform \
+MODULES = cerl_cconv cerl_closurean cerl_hipeify \
cerl_lib cerl_messagean cerl_pmatch cerl_prettypr cerl_to_icode \
cerl_typean erl_bif_types erl_types
@@ -82,6 +82,9 @@ clean:
rm -f $(TARGET_FILES)
rm -f core
+distclean: clean
+realclean: clean
+
$(DOCS)/%.html:%.erl
erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop
@@ -97,10 +100,10 @@ $(DOCS)/%.html:%.erl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/cerl
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/cerl
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/cerl"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/cerl"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/hipe/cerl/cerl_hipe_primops.hrl b/lib/hipe/cerl/cerl_hipe_primops.hrl
index 36b1b62901..a777cd0108 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -59,7 +59,6 @@
-define(PRIMOP_IS_ATOM, 'is_atom'). % arity 1
-define(PRIMOP_IS_BIGNUM, 'is_bignum'). % arity 1
-define(PRIMOP_IS_BINARY, 'is_binary'). % arity 1
--define(PRIMOP_IS_CONSTANT, 'is_constant'). % arity 1
-define(PRIMOP_IS_FIXNUM, 'is_fixnum'). % arity 1
-define(PRIMOP_IS_FLOAT, 'is_float'). % arity 1
-define(PRIMOP_IS_FUNCTION, 'is_function'). % arity 1
diff --git a/lib/hipe/cerl/cerl_hipeify.erl b/lib/hipe/cerl/cerl_hipeify.erl
index 8f6c3561c9..3351be77f2 100644
--- a/lib/hipe/cerl/cerl_hipeify.erl
+++ b/lib/hipe/cerl/cerl_hipeify.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -392,7 +392,6 @@ call_to_primop(erlang, '=<', 2) -> {yes, ?PRIMOP_LE};
call_to_primop(erlang, '>=', 2) -> {yes, ?PRIMOP_GE};
call_to_primop(erlang, is_atom, 1) -> {yes, ?PRIMOP_IS_ATOM};
call_to_primop(erlang, is_binary, 1) -> {yes, ?PRIMOP_IS_BINARY};
-call_to_primop(erlang, is_constant, 1) -> {yes, ?PRIMOP_IS_CONSTANT};
call_to_primop(erlang, is_float, 1) -> {yes, ?PRIMOP_IS_FLOAT};
call_to_primop(erlang, is_function, 1) -> {yes, ?PRIMOP_IS_FUNCTION};
call_to_primop(erlang, is_integer, 1) -> {yes, ?PRIMOP_IS_INTEGER};
diff --git a/lib/hipe/cerl/cerl_hybrid_transform.erl b/lib/hipe/cerl/cerl_hybrid_transform.erl
deleted file mode 100644
index b248b0ccd0..0000000000
--- a/lib/hipe/cerl/cerl_hybrid_transform.erl
+++ /dev/null
@@ -1,153 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-
--module(cerl_hybrid_transform).
-
-%% Use compile option `{core_transform, cerl_hybrid_transform}' to
-%% insert this as a compilation pass.
-
--export([transform/2, core_transform/2]).
-
--spec core_transform(cerl:cerl(), [term()]) -> cerl:cerl().
-
-core_transform(Code, Opts) ->
- cerl:to_records(transform(cerl:from_records(Code), Opts)).
-
--spec transform(cerl:cerl(), [term()]) -> cerl:cerl().
-
-transform(Code, _Opts) ->
- Code0 = cerl_trees:map(fun unfold_literal/1, Code),
- {Code1, _} = cerl_trees:label(Code0),
- io:fwrite("Running hybrid heap analysis..."),
- {T1,_} = statistics(runtime),
- {Code2, _, Vars} = cerl_messagean:annotate(Code1),
- {T2,_} = statistics(runtime),
- io:fwrite("(~w ms), transform...", [T2 - T1]),
- Code3 = rewrite(Code2, Vars),
- io:fwrite("done.\n"),
- cerl_trees:map(fun fold_literal/1, Code3).
-
-unfold_literal(T) ->
- cerl:unfold_literal(T).
-
-fold_literal(T) ->
- cerl:fold_literal(T).
-
-%% If escape-annotated:
-%% {...} => hybrid:tuple([...])
-%% [H | T] => hybrid:cons(H, T)
-%%
-%% Wrapper for args to hybrid:cons/hybrid:tuple that may need copying:
-%% hybrid:copy(A)
-
-rewrite(Node, Vars) ->
- case cerl:type(Node) of
- tuple ->
- Es = rewrite_list(cerl:tuple_es(Node), Vars),
- case is_escaping(Node) of
- false ->
- cerl:update_c_tuple(Node, Es);
- true ->
- Es1 = wrap(Es, Node, Vars),
- cerl:update_c_call(Node,
- cerl:abstract(hybrid),
- cerl:abstract(tuple),
- [cerl:make_list(Es1)])
-%%% cerl:update_c_call(Node, cerl:abstract(hybrid),
-%%% cerl:abstract(tuple), Es1)
- end;
- cons ->
- H = rewrite(cerl:cons_hd(Node), Vars),
- T = rewrite(cerl:cons_tl(Node), Vars),
- case is_escaping(Node) of
- false ->
- cerl:update_c_cons(Node, H, T);
- true ->
- Es = wrap([H, T], Node, Vars),
- cerl:update_c_call(Node,
- cerl:abstract(hybrid),
- cerl:abstract(cons),
- Es)
- end;
-%%% call ->
-%%% M = rewrite(cerl:call_module(Node)),
-%%% F = rewrite(cerl:call_name(Node)),
-%%% As = rewrite_list(cerl:call_args(Node)),
-%%% case cerl:is_c_atom(M) andalso cerl:is_c_atom(F) of
-%%% true ->
-%%% case {cerl:atom_val(M), cerl:atom_val(F), length(As)} of
-%%% {erlang, '!', 2} ->
-%%% cerl:update_c_call(Node,
-%%% cerl:abstract(hipe_bifs),
-%%% cerl:abstract(send),
-%%% [cerl:make_list(As)]);
-%%% _ ->
-%%% cerl:update_c_call(Node, M, F, As)
-%%% end;
-%%% false ->
-%%% cerl:update_c_call(Node, M, F, As)
-%%% end;
- clause ->
- B = rewrite(cerl:clause_body(Node), Vars),
- cerl:update_c_clause(Node, cerl:clause_pats(Node),
- cerl:clause_guard(Node), B);
- primop ->
- case cerl:atom_val(cerl:primop_name(Node)) of
- match_fail ->
- Node;
- _ ->
- As = rewrite_list(cerl:primop_args(Node), Vars),
- cerl:update_c_primop(Node, cerl:primop_name(Node), As)
- end;
- _T ->
- case cerl:subtrees(Node) of
- [] ->
- Node;
- Gs ->
- cerl:update_tree(Node, [rewrite_list(Ns, Vars)
- || Ns <- Gs])
- end
- end.
-
-rewrite_list([N | Ns], Vars) ->
- [rewrite(N, Vars) | rewrite_list(Ns, Vars)];
-rewrite_list([], _) ->
- [].
-
-is_escaping(T) ->
- lists:member(escapes, cerl:get_ann(T)).
-
-wrap(Es, Node, Vars) ->
- L = cerl_trees:get_label(Node),
- Xs = dict:fetch(L, Vars),
- wrap(Es, Xs).
-
-wrap([E | Es], [{S, _} | Xs]) ->
- case ordsets:is_element(unsafe, S) of
-%% case cerl:type(E) =/= literal of
- true ->
- [cerl:c_call(cerl:abstract(hybrid),
- cerl:abstract(copy),
- [E])
- | wrap(Es, Xs)];
- false ->
- [E | wrap(Es, Xs)]
- end;
-wrap([], _) ->
- [].
diff --git a/lib/hipe/cerl/cerl_messagean.erl b/lib/hipe/cerl/cerl_messagean.erl
index 6dd93adaa3..ca812a0f0d 100644
--- a/lib/hipe/cerl/cerl_messagean.erl
+++ b/lib/hipe/cerl/cerl_messagean.erl
@@ -1,7 +1,7 @@
%% =====================================================================
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -1083,7 +1083,6 @@ is_imm_op(erlang, is_alive, 0) -> true;
is_imm_op(erlang, is_atom, 1) -> true;
is_imm_op(erlang, is_binary, 1) -> true;
is_imm_op(erlang, is_builtin, 3) -> true;
-is_imm_op(erlang, is_constant, 1) -> true;
is_imm_op(erlang, is_float, 1) -> true;
is_imm_op(erlang, is_function, 1) -> true;
is_imm_op(erlang, is_integer, 1) -> true;
diff --git a/lib/hipe/cerl/cerl_to_icode.erl b/lib/hipe/cerl/cerl_to_icode.erl
index 362c427cbe..1c1c10d9b0 100644
--- a/lib/hipe/cerl/cerl_to_icode.erl
+++ b/lib/hipe/cerl/cerl_to_icode.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -88,7 +88,6 @@
-define(TYPE_IS_ATOM, atom).
-define(TYPE_IS_BIGNUM, bignum).
-define(TYPE_IS_BINARY, binary).
--define(TYPE_IS_CONSTANT, constant).
-define(TYPE_IS_FIXNUM, fixnum).
-define(TYPE_IS_FLOAT, float).
-define(TYPE_IS_FUNCTION, function).
@@ -2051,7 +2050,6 @@ is_record_test(T, A, N, True, False, Ctxt, Env, S) ->
type_test(?PRIMOP_IS_ATOM) -> ?TYPE_IS_ATOM;
type_test(?PRIMOP_IS_BIGNUM) -> ?TYPE_IS_BIGNUM;
type_test(?PRIMOP_IS_BINARY) -> ?TYPE_IS_BINARY;
-type_test(?PRIMOP_IS_CONSTANT) -> ?TYPE_IS_CONSTANT;
type_test(?PRIMOP_IS_FIXNUM) -> ?TYPE_IS_FIXNUM;
type_test(?PRIMOP_IS_FLOAT) -> ?TYPE_IS_FLOAT;
type_test(?PRIMOP_IS_FUNCTION) -> ?TYPE_IS_FUNCTION;
@@ -2082,7 +2080,6 @@ is_bool_op(Op, A) when is_atom(Op), is_integer(A) -> false.
is_type_test(?PRIMOP_IS_ATOM, 1) -> true;
is_type_test(?PRIMOP_IS_BIGNUM, 1) -> true;
is_type_test(?PRIMOP_IS_BINARY, 1) -> true;
-is_type_test(?PRIMOP_IS_CONSTANT, 1) -> true;
is_type_test(?PRIMOP_IS_FIXNUM, 1) -> true;
is_type_test(?PRIMOP_IS_FLOAT, 1) -> true;
is_type_test(?PRIMOP_IS_FUNCTION, 1) -> true;
diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl
index cee399e861..776e336aea 100644
--- a/lib/hipe/cerl/erl_bif_types.erl
+++ b/lib/hipe/cerl/erl_bif_types.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -45,16 +45,13 @@
t_atom_vals/1,
t_binary/0,
t_bitstr/0,
- t_bitstrlist/0,
t_boolean/0,
t_byte/0,
t_char/0,
- t_charlist/0,
t_cons/0,
t_cons/2,
t_cons_hd/1,
t_cons_tl/1,
- t_constant/0,
t_fixnum/0,
t_non_neg_fixnum/0,
t_pos_fixnum/0,
@@ -73,21 +70,17 @@
t_non_neg_integer/0,
t_pos_integer/0,
t_integers/1,
- t_iodata/0,
- t_iolist/0,
t_is_any/1,
t_is_atom/1,
t_is_binary/1,
t_is_bitstr/1,
t_is_boolean/1,
t_is_cons/1,
- t_is_constant/1,
t_is_float/1,
t_is_float/1,
t_is_fun/1,
t_is_integer/1,
t_is_integer/1,
- t_is_list/1,
t_is_nil/1,
t_is_none/1,
t_is_none_or_unit/1,
@@ -120,14 +113,11 @@
t_subtract/2,
t_sup/1,
t_sup/2,
- t_tid/0,
- t_timeout/0,
t_tuple/0,
t_tuple/1,
t_tuple_args/1,
t_tuple_size/1,
- t_tuple_subtypes/1,
- t_unicode_string/0
+ t_tuple_subtypes/1
]).
-ifdef(DO_ERL_BIF_TYPES_TEST).
@@ -146,110 +136,14 @@ type(M, F, A) ->
-spec type(atom(), atom(), arity(), [erl_types:erl_type()]) -> erl_types:erl_type().
-%%-- binary -------------------------------------------------------------------
-type(binary, at, 2, Xs) ->
- strict(arg_types(binary, at, 2), Xs, fun(_) -> t_integer() end);
-type(binary, bin_to_list, Arity, Xs) when 1 =< Arity, Arity =< 3 ->
- strict(arg_types(binary, bin_to_list, Arity), Xs,
- fun(_) -> t_list(t_integer()) end);
-type(binary, compile_pattern, 1, Xs) ->
- strict(arg_types(binary, compile_pattern, 1), Xs,
- fun(_) -> t_binary_compiled_pattern() end);
-type(binary, copy, Arity, Xs) when Arity =:= 1; Arity =:= 2 ->
- strict(arg_types(binary, copy, Arity), Xs,
- fun(_) -> t_binary() end);
-type(binary, decode_unsigned, Arity, Xs) when Arity =:= 1; Arity =:= 2 ->
- strict(arg_types(binary, decode_unsigned, Arity), Xs,
- fun(_) -> t_non_neg_integer() end);
-type(binary, encode_unsigned, Arity, Xs) when Arity =:= 1; Arity =:= 2 ->
- strict(arg_types(binary, encode_unsigned, Arity), Xs,
- fun(_) -> t_binary() end);
-type(binary, first, 1, Xs) ->
- strict(arg_types(binary, first, 1), Xs, fun(_) -> t_non_neg_integer() end);
-type(binary, last, 1, Xs) ->
- strict(arg_types(binary, last, 1), Xs, fun(_) -> t_non_neg_integer() end);
-type(binary, list_to_bin, 1, Xs) ->
- type(erlang, list_to_binary, 1, Xs);
-type(binary, longest_common_prefix, 1, Xs) ->
- strict(arg_types(binary, longest_common_prefix, 1), Xs,
- fun(_) -> t_integer() end);
-type(binary, longest_common_suffix, 1, Xs) ->
- strict(arg_types(binary, longest_common_suffix, 1), Xs,
- fun(_) -> t_integer() end);
-type(binary, match, Arity, Xs) when Arity =:= 2; Arity =:= 3 ->
- strict(arg_types(binary, match, Arity), Xs,
- fun(_) ->
- t_sup(t_atom('nomatch'), t_binary_canonical_part())
- end);
-type(binary, matches, Arity, Xs) when Arity =:= 2; Arity =:= 3 ->
- strict(arg_types(binary, matches, Arity), Xs,
- fun(_) -> t_list(t_binary_canonical_part()) end);
-type(binary, part, 2, Xs) ->
- type(erlang, binary_part, 2, Xs);
-type(binary, part, 3, Xs) ->
- type(erlang, binary_part, 3, Xs);
-type(binary, referenced_byte_size, 1, Xs) ->
- strict(arg_types(binary, referenced_byte_size, 1), Xs,
- fun(_) -> t_non_neg_integer() end);
-%%-- code ---------------------------------------------------------------------
-type(code, get_chunk, 2, Xs) ->
- strict(arg_types(code, get_chunk, 2), Xs,
- fun (_) -> t_sup(t_binary(), t_atom('undefined')) end);
-type(code, is_module_native, 1, Xs) ->
- strict(arg_types(code, is_module_native, 1), Xs,
- fun (_) -> t_sup(t_boolean(), t_atom('undefined')) end);
-type(code, module_md5, 1, Xs) ->
- strict(arg_types(code, module_md5, 1), Xs,
- fun (_) -> t_sup(t_binary(), t_atom('undefined')) end);
-type(code, make_stub_module, 3, Xs) ->
- strict(arg_types(code, make_stub_module, 3), Xs, fun ([Mod,_,_]) -> Mod end);
-type(code, rehash, 0, _) ->
- t_atom('ok');
-%%-- erl_ddll -----------------------------------------------------------------
-type(erl_ddll, demonitor, 1, Xs) ->
- type(erlang, demonitor, 1, Xs);
-type(erl_ddll, format_error_int, 1, Xs) ->
- strict(arg_types(erl_ddll, format_error_int, 1), Xs,
- fun (_) -> t_string() end);
-type(erl_ddll, info, 2, Xs) ->
- strict(arg_types(erl_ddll, info, 2), Xs, fun (_) -> t_atom() end);
-type(erl_ddll, loaded_drivers, 0, _) ->
- t_tuple([t_atom('ok'), t_list(t_string())]);
-type(erl_ddll, monitor, 2, Xs) -> % return type is the same, though args are not
- type(erlang, monitor, 2, Xs);
-type(erl_ddll, try_load, 3, Xs) ->
- strict(arg_types(erl_ddll, try_load, 3), Xs,
- fun (_) ->
- t_sup([t_tuple([t_atom('ok'), t_atom('already_loaded')]),
- t_tuple([t_atom('ok'), t_atom('loaded')]),
- t_tuple([t_atom('ok'),
- t_atom('pending_driver'), t_reference()]),
- t_tuple([t_atom('error'), t_atom('inconsistent')]),
- t_tuple([t_atom('error'), t_atom('permanent')])])
- end);
-type(erl_ddll, try_unload, 2, Xs) ->
- strict(arg_types(erl_ddll, try_unload, 2), Xs,
- fun (_) ->
- t_sup([t_tuple([t_atom('ok'), t_atom('pending_process')]),
- t_tuple([t_atom('ok'), t_atom('unloaded')]),
- t_tuple([t_atom('ok'), t_atom('pending_driver')]),
- t_tuple([t_atom('ok'),
- t_atom('pending_driver'), t_reference()]),
- t_tuple([t_atom('error'), t_atom('permanent')]),
- t_tuple([t_atom('error'), t_atom('not_loaded')]),
- t_tuple([t_atom('error'),
- t_atom('not_loaded_by_this_process')])])
- end);
%%-- erlang -------------------------------------------------------------------
type(erlang, halt, 0, _) -> t_none();
type(erlang, halt, 1, _) -> t_none();
+type(erlang, halt, 2, _) -> t_none();
type(erlang, exit, 1, _) -> t_none();
-%% Note that exit/2 sends an exit signal to another process.
-type(erlang, exit, 2, _) -> t_atom('true');
type(erlang, error, 1, _) -> t_none();
type(erlang, error, 2, _) -> t_none();
type(erlang, throw, 1, _) -> t_none();
-type(erlang, hibernate, 3, _) -> t_none();
type(erlang, '==', 2, Xs = [X1, X2]) ->
case t_is_atom(X1) andalso t_is_atom(X2) of
true -> type(erlang, '=:=', 2, Xs);
@@ -601,20 +495,12 @@ type(erlang, 'bnot', 1, Xs) ->
{ok, T} -> T
end
end);
-%% This returns (-X)-1, so it often gives a negative result.
-%% strict(arg_types(erlang, 'bnot', 1), Xs, fun (_) -> t_integer() end);
+%% Guard bif, needs to be here.
type(erlang, abs, 1, Xs) ->
strict(arg_types(erlang, abs, 1), Xs, fun ([X]) -> X end);
-type(erlang, adler32, 1, Xs) ->
- strict(arg_types(erlang, adler32, 1), Xs, fun (_) -> t_adler32() end);
-type(erlang, adler32, 2, Xs) ->
- strict(arg_types(erlang, adler32, 2), Xs, fun (_) -> t_adler32() end);
-type(erlang, adler32_combine, 3, Xs) ->
- strict(arg_types(erlang, adler32_combine, 3), Xs,
- fun (_) -> t_adler32() end);
+%% This returns (-X)-1, so it often gives a negative result.
+%% strict(arg_types(erlang, 'bnot', 1), Xs, fun (_) -> t_integer() end);
type(erlang, append, 2, Xs) -> type(erlang, '++', 2, Xs); % alias
-type(erlang, append_element, 2, Xs) ->
- strict(arg_types(erlang, append_element, 2), Xs, fun (_) -> t_tuple() end);
type(erlang, apply, 2, Xs) ->
Fun = fun ([X, _Y]) ->
case t_is_fun(X) of
@@ -627,90 +513,24 @@ type(erlang, apply, 2, Xs) ->
strict(arg_types(erlang, apply, 2), Xs, Fun);
type(erlang, apply, 3, Xs) ->
strict(arg_types(erlang, apply, 3), Xs, fun (_) -> t_any() end);
-type(erlang, atom_to_binary, 2, Xs) ->
- strict(arg_types(erlang, atom_to_binary, 2), Xs, fun (_) -> t_binary() end);
-type(erlang, atom_to_list, 1, Xs) ->
- strict(arg_types(erlang, atom_to_list, 1), Xs, fun (_) -> t_string() end);
+%% Guard bif, needs to be here.
type(erlang, binary_part, 2, Xs) ->
strict(arg_types(erlang, binary_part, 2), Xs, fun (_) -> t_binary() end);
+%% Guard bif, needs to be here.
type(erlang, binary_part, 3, Xs) ->
strict(arg_types(erlang, binary_part, 3), Xs, fun (_) -> t_binary() end);
-type(erlang, binary_to_atom, 2, Xs) ->
- strict(arg_types(erlang, binary_to_atom, 2), Xs, fun (_) -> t_atom() end);
-type(erlang, binary_to_existing_atom, 2, Xs) ->
- type(erlang, binary_to_atom, 2, Xs);
-type(erlang, binary_to_list, 1, Xs) ->
- strict(arg_types(erlang, binary_to_list, 1), Xs,
- fun (_) -> t_list(t_byte()) end);
-type(erlang, binary_to_list, 3, Xs) ->
- strict(arg_types(erlang, binary_to_list, 3), Xs,
- fun (_) -> t_list(t_byte()) end);
-type(erlang, binary_to_term, 1, Xs) ->
- strict(arg_types(erlang, binary_to_term, 1), Xs, fun (_) -> t_any() end);
-type(erlang, binary_to_term, 2, Xs) ->
- strict(arg_types(erlang, binary_to_term, 2), Xs, fun (_) -> t_any() end);
-type(erlang, bitsize, 1, Xs) -> % XXX: TAKE OUT
- type(erlang, bit_size, 1, Xs);
+%% Guard bif, needs to be here.
type(erlang, bit_size, 1, Xs) ->
strict(arg_types(erlang, bit_size, 1), Xs,
fun (_) -> t_non_neg_integer() end);
-type(erlang, bitstr_to_list, 1, Xs) -> % XXX: TAKE OUT
- type(erlang, bitstring_to_list, 1, Xs);
-type(erlang, bitstring_to_list, 1, Xs) ->
- strict(arg_types(erlang, bitstring_to_list, 1), Xs,
- fun (_) -> t_list(t_sup(t_byte(), t_bitstr())) end);
-type(erlang, bump_reductions, 1, Xs) ->
- strict(arg_types(erlang, bump_reductions, 1), Xs,
- fun (_) -> t_atom('true') end);
+%% Guard bif, needs to be here.
type(erlang, byte_size, 1, Xs) ->
strict(arg_types(erlang, byte_size, 1), Xs,
fun (_) -> t_non_neg_integer() end);
-type(erlang, call_on_load_function, 1, Xs) ->
- %% Internal BIF used by on_load.
- strict(arg_types(erlang, call_on_load_function, 1), Xs,
- fun (_) -> t_any() end);
-type(erlang, cancel_timer, 1, Xs) ->
- strict(arg_types(erlang, cancel_timer, 1), Xs,
- fun (_) -> t_sup(t_integer(), t_atom('false')) end);
-type(erlang, check_old_code, 1, Xs) ->
- strict(arg_types(erlang, check_old_code, 1), Xs,
- fun (_) -> t_boolean() end);
-type(erlang, check_process_code, 2, Xs) ->
- strict(arg_types(erlang, check_process_code, 2), Xs,
- fun (_) -> t_boolean() end);
-type(erlang, crc32, 1, Xs) ->
- strict(arg_types(erlang, crc32, 1), Xs, fun (_) -> t_crc32() end);
-type(erlang, crc32, 2, Xs) ->
- strict(arg_types(erlang, crc32, 2), Xs, fun (_) -> t_crc32() end);
-type(erlang, crc32_combine, 3, Xs) ->
- strict(arg_types(erlang, crc32_combine, 3), Xs, fun (_) -> t_crc32() end);
-type(erlang, date, 0, _) ->
- t_date();
-type(erlang, decode_packet, 3, Xs) ->
- strict(arg_types(erlang, decode_packet, 3), Xs,
- fun (_) ->
- t_sup([t_tuple([t_atom('ok'), t_packet(), t_binary()]),
- t_tuple([t_atom('more'), t_sup([t_non_neg_integer(),
- t_atom('undefined')])]),
- t_tuple([t_atom('error'), t_any()])])
- end);
-type(erlang, delete_module, 1, Xs) ->
- strict(arg_types(erlang, delete_module, 1), Xs,
- fun (_) -> t_sup(t_atom('true'), t_atom('undefined')) end);
-type(erlang, demonitor, 1, Xs) ->
- strict(arg_types(erlang, demonitor, 1), Xs, fun (_) -> t_atom('true') end);
-%% TODO: overapproximation -- boolean only if 'info' is part of arg2 otherwise 'true'
-type(erlang, demonitor, 2, Xs) ->
- strict(arg_types(erlang, demonitor, 2), Xs, fun (_) -> t_boolean() end);
type(erlang, disconnect_node, 1, Xs) ->
strict(arg_types(erlang, disconnect_node, 1), Xs, fun (_) -> t_sup([t_boolean(), t_atom('ignored')]) end);
-type(erlang, display, 1, _) -> t_atom('true');
-type(erlang, display_string, 1, Xs) ->
- strict(arg_types(erlang, display_string, 1), Xs, fun(_) -> t_atom('true') end);
-type(erlang, display_nl, 0, _) ->
- t_atom('true');
-type(erlang, dist_exit, 3, Xs) ->
- strict(arg_types(erlang, dist_exit, 3), Xs, fun (_) -> t_atom('true') end);
+%% Guard bif, needs to be here.
+%% Also much more expressive than anything you could write in a spec...
type(erlang, element, 2, Xs) ->
strict(arg_types(erlang, element, 2), Xs,
fun ([X1, X2]) ->
@@ -734,95 +554,22 @@ type(erlang, element, 2, Xs) ->
t_sup([type(erlang, element, 2, [X1, Y]) || Y <- Ts])
end
end);
-type(erlang, erase, 0, _) -> t_any();
-type(erlang, erase, 1, _) -> t_any();
-type(erlang, external_size, 1, _) -> t_integer();
-type(erlang, external_size, 2, _) -> t_integer();
-type(erlang, finish_after_on_load, 2, Xs) ->
- %% Internal BIF used by on_load.
- strict(arg_types(erlang, finish_after_on_load, 2), Xs,
- fun (_) -> t_atom('true') end);
+%% Guard bif, needs to be here.
type(erlang, float, 1, Xs) ->
strict(arg_types(erlang, float, 1), Xs, fun (_) -> t_float() end);
-type(erlang, float_to_list, 1, Xs) ->
- strict(arg_types(erlang, float_to_list, 1), Xs, fun (_) -> t_string() end);
-type(erlang, function_exported, 3, Xs) ->
- strict(arg_types(erlang, function_exported, 3), Xs,
- fun (_) -> t_boolean() end);
type(erlang, fun_info, 1, Xs) ->
strict(arg_types(erlang, fun_info, 1), Xs,
fun (_) -> t_list(t_tuple([t_atom(), t_any()])) end);
-type(erlang, fun_info, 2, Xs) ->
- strict(arg_types(erlang, fun_info, 2), Xs,
- fun (_) -> t_tuple([t_atom(), t_any()]) end);
-type(erlang, fun_to_list, 1, Xs) ->
- strict(arg_types(erlang, fun_to_list, 1), Xs, fun (_) -> t_string() end);
-type(erlang, garbage_collect, 0, _) -> t_atom('true');
-type(erlang, garbage_collect, 1, Xs) ->
- strict(arg_types(erlang, garbage_collect, 1), Xs, fun (_) -> t_boolean() end);
-type(erlang, garbage_collect_message_area, 0, _) ->
- t_boolean();
-type(erlang, get, 0, _) -> t_list(t_tuple(2));
-type(erlang, get, 1, _) -> t_any(); % | t_atom('undefined')
type(erlang, get_cookie, 0, _) -> t_atom(); % | t_atom('nocookie')
-type(erlang, get_keys, 1, _) -> t_list();
-type(erlang, get_module_info, 1, Xs) ->
- strict(arg_types(erlang, get_module_info, 1), Xs,
- fun (_) ->
- t_list(t_tuple([t_atom(), t_list(t_tuple([t_atom(), t_any()]))]))
- end);
-type(erlang, get_module_info, 2, Xs) ->
- T_module_info_2_returns =
- t_sup([t_atom(),
- t_list(t_tuple([t_atom(), t_any()])),
- t_list(t_tuple([t_atom(), t_arity(), t_integer()]))]),
- strict(arg_types(erlang, get_module_info, 2), Xs,
- fun ([Module, Item]) ->
- case t_is_atom(Item) of
- true ->
- case t_atom_vals(Item) of
- ['module'] -> t_inf(t_atom(), Module);
- ['imports'] -> t_nil();
- ['exports'] -> t_list(t_tuple([t_atom(), t_arity()]));
- ['functions'] -> t_list(t_tuple([t_atom(), t_arity()]));
- ['attributes'] -> t_list(t_tuple([t_atom(), t_any()]));
- ['compile'] -> t_list(t_tuple([t_atom(), t_any()]));
- ['native_addresses'] -> % [{FunName, Arity, Address}]
- t_list(t_tuple([t_atom(), t_arity(), t_integer()]));
- List when is_list(List) ->
- T_module_info_2_returns;
- unknown ->
- T_module_info_2_returns
- end;
- false ->
- T_module_info_2_returns
- end
- end);
-type(erlang, get_stacktrace, 0, _) ->
- t_list(t_tuple([t_atom(), t_atom(), t_sup([t_arity(), t_list()]),
- t_list()]));
-type(erlang, group_leader, 0, _) -> t_pid();
-type(erlang, group_leader, 2, Xs) ->
- strict(arg_types(erlang, group_leader, 2), Xs,
- fun (_) -> t_atom('true') end);
-type(erlang, hash, 2, Xs) ->
- strict(arg_types(erlang, hash, 2), Xs, fun (_) -> t_integer() end);
+%% Guard bif, needs to be here.
type(erlang, hd, 1, Xs) ->
strict(arg_types(erlang, hd, 1), Xs, fun ([X]) -> t_cons_hd(X) end);
-type(erlang, integer_to_list, 1, Xs) ->
- strict(arg_types(erlang, integer_to_list, 1), Xs,
- fun (_) -> t_string() end);
type(erlang, integer_to_list, 2, Xs) ->
strict(arg_types(erlang, integer_to_list, 2), Xs,
fun (_) -> t_string() end);
type(erlang, info, 1, Xs) -> type(erlang, system_info, 1, Xs); % alias
-type(erlang, iolist_size, 1, Xs) ->
- strict(arg_types(erlang, iolist_size, 1), Xs,
- fun (_) -> t_non_neg_integer() end);
-type(erlang, iolist_to_binary, 1, Xs) ->
- strict(arg_types(erlang, iolist_to_binary, 1), Xs,
- fun (_) -> t_binary() end);
-type(erlang, is_alive, 0, _) -> t_boolean();
+%% All type tests are guard BIF's and may be implemented in ways that
+%% cannot be expressed in a type spec, why they are kept in erl_bif_types.
type(erlang, is_atom, 1, Xs) ->
Fun = fun (X) -> check_guard(X, fun (Y) -> t_is_atom(Y) end, t_atom()) end,
strict(arg_types(erlang, is_atom, 1), Xs, Fun);
@@ -831,8 +578,6 @@ type(erlang, is_binary, 1, Xs) ->
check_guard(X, fun (Y) -> t_is_binary(Y) end, t_binary())
end,
strict(arg_types(erlang, is_binary, 1), Xs, Fun);
-type(erlang, is_bitstr, 1, Xs) -> % XXX: TAKE OUT
- type(erlang, is_bitstring, 1, Xs);
type(erlang, is_bitstring, 1, Xs) ->
Fun = fun (X) ->
check_guard(X, fun (Y) -> t_is_bitstr(Y) end, t_bitstr())
@@ -843,13 +588,6 @@ type(erlang, is_boolean, 1, Xs) ->
check_guard(X, fun (Y) -> t_is_boolean(Y) end, t_boolean())
end,
strict(arg_types(erlang, is_boolean, 1), Xs, Fun);
-type(erlang, is_builtin, 3, Xs) ->
- strict(arg_types(erlang, is_builtin, 3), Xs, fun (_) -> t_boolean() end);
-type(erlang, is_constant, 1, Xs) ->
- Fun = fun (X) ->
- check_guard(X, fun (Y) -> t_is_constant(Y) end, t_constant())
- end,
- strict(arg_types(erlang, is_constant, 1), Xs, Fun);
type(erlang, is_float, 1, Xs) ->
Fun = fun (X) ->
check_guard(X, fun (Y) -> t_is_float(Y) end, t_float())
@@ -894,9 +632,6 @@ type(erlang, is_pid, 1, Xs) ->
type(erlang, is_port, 1, Xs) ->
Fun = fun (X) -> check_guard(X, fun (Y) -> t_is_port(Y) end, t_port()) end,
strict(arg_types(erlang, is_port, 1), Xs, Fun);
-type(erlang, is_process_alive, 1, Xs) ->
- strict(arg_types(erlang, is_process_alive, 1), Xs,
- fun (_) -> t_boolean() end);
type(erlang, is_record, 2, Xs) ->
Fun = fun ([X, Y]) ->
case t_is_tuple(X) of
@@ -998,68 +733,12 @@ type(erlang, is_tuple, 1, Xs) ->
check_guard(X, fun (Y) -> t_is_tuple(Y) end, t_tuple())
end,
strict(arg_types(erlang, is_tuple, 1), Xs, Fun);
+%% Guard bif, needs to be here.
type(erlang, length, 1, Xs) ->
strict(arg_types(erlang, length, 1), Xs, fun (_) -> t_non_neg_fixnum() end);
-type(erlang, link, 1, Xs) ->
- strict(arg_types(erlang, link, 1), Xs, fun (_) -> t_atom('true') end);
-type(erlang, list_to_atom, 1, Xs) ->
- strict(arg_types(erlang, list_to_atom, 1), Xs, fun (_) -> t_atom() end);
-type(erlang, list_to_binary, 1, Xs) ->
- strict(arg_types(erlang, list_to_binary, 1), Xs,
- fun (_) -> t_binary() end);
-type(erlang, list_to_bitstr, 1, Xs) ->
- type(erlang, list_to_bitstring, 1, Xs);
-type(erlang, list_to_bitstring, 1, Xs) ->
- strict(arg_types(erlang, list_to_bitstring, 1), Xs,
- fun (_) -> t_bitstr() end);
-type(erlang, list_to_existing_atom, 1, Xs) ->
- strict(arg_types(erlang, list_to_existing_atom, 1), Xs,
- fun (_) -> t_atom() end);
-type(erlang, list_to_float, 1, Xs) ->
- strict(arg_types(erlang, list_to_float, 1), Xs, fun (_) -> t_float() end);
-type(erlang, list_to_integer, 1, Xs) ->
- strict(arg_types(erlang, list_to_integer, 1), Xs,
- fun (_) -> t_integer() end);
type(erlang, list_to_integer, 2, Xs) ->
strict(arg_types(erlang, list_to_integer, 2), Xs,
fun (_) -> t_integer() end);
-type(erlang, list_to_pid, 1, Xs) ->
- strict(arg_types(erlang, list_to_pid, 1), Xs, fun (_) -> t_pid() end);
-type(erlang, list_to_tuple, 1, Xs) ->
- strict(arg_types(erlang, list_to_tuple, 1), Xs, fun (_) -> t_tuple() end);
-type(erlang, load_module, 2, Xs) ->
- strict(arg_types(erlang, load_module, 2), Xs,
- fun ([Mod,_Bin]) -> t_code_load_return(Mod) end);
-type(erlang, load_nif, 2, Xs) ->
- strict(arg_types(erlang, load_nif, 2), Xs,
- fun (_) ->
- Reason = t_atoms(['load_failed', 'bad_lib', 'load',
- 'reload', 'upgrade', 'old_code']),
- RsnPair = t_tuple([Reason, t_string()]),
- t_sup(t_atom('ok'), t_tuple([t_atom('error'), RsnPair]))
- end);
-type(erlang, loaded, 0, _) ->
- t_list(t_atom());
-type(erlang, localtime, 0, Xs) ->
- type(erlang, universaltime, 0, Xs); % same
-type(erlang, localtime_to_universaltime, 1, Xs) ->
- type(erlang, universaltime_to_localtime, 1, Xs); % same
-type(erlang, localtime_to_universaltime, 2, Xs) ->
- strict(arg_types(erlang, localtime_to_universaltime, 2), Xs, % typecheck
- fun ([X,_]) -> type(erlang, localtime_to_universaltime, 1, [X]) end);
-type(erlang, make_fun, 3, Xs) ->
- strict(arg_types(erlang, make_fun, 3), Xs,
- fun ([_, _, Arity]) ->
- case t_number_vals(Arity) of
- [N] ->
- case is_integer(N) andalso 0 =< N andalso N =< 255 of
- true -> t_fun(N, t_any());
- false -> t_none()
- end;
- _Other -> t_fun()
- end
- end);
-type(erlang, make_ref, 0, _) -> t_reference();
type(erlang, make_tuple, 2, Xs) ->
strict(arg_types(erlang, make_tuple, 2), Xs,
fun ([Int, _]) ->
@@ -1076,87 +755,19 @@ type(erlang, make_tuple, 3, Xs) ->
_Other -> t_tuple()
end
end);
-type(erlang, match_spec_test, 3, Xs) ->
- strict(arg_types(erlang, match_spec_test, 3), Xs,
- fun (_) -> t_sup(t_tuple([t_atom('ok'),
- t_any(), % it can be any term
- t_list(t_atom('return_trace')),
- t_match_spec_test_errors()]),
- t_tuple([t_atom('error'),
- t_match_spec_test_errors()])) end);
-type(erlang, md5, 1, Xs) ->
- strict(arg_types(erlang, md5, 1), Xs, fun (_) -> t_binary() end);
-type(erlang, md5_final, 1, Xs) ->
- strict(arg_types(erlang, md5_final, 1), Xs, fun (_) -> t_binary() end);
-type(erlang, md5_init, 0, _) -> t_binary();
-type(erlang, md5_update, 2, Xs) ->
- strict(arg_types(erlang, md5_update, 2), Xs, fun (_) -> t_binary() end);
type(erlang, memory, 0, _) -> t_list(t_tuple([t_atom(), t_non_neg_fixnum()]));
-type(erlang, memory, 1, Xs) ->
- strict(arg_types(erlang, memory, 1), Xs,
- fun ([Type]) ->
- case t_is_atom(Type) of
- true -> t_non_neg_fixnum();
- false ->
- case t_is_list(Type) of
- true -> t_list(t_tuple([t_atom(), t_non_neg_fixnum()]));
- false ->
- t_sup(t_non_neg_fixnum(),
- t_list(t_tuple([t_atom(), t_non_neg_fixnum()])))
- end
- end
- end);
-type(erlang, module_loaded, 1, Xs) ->
- strict(arg_types(erlang, module_loaded, 1), Xs, fun (_) -> t_boolean() end);
-type(erlang, monitor, 2, Xs) ->
- strict(arg_types(erlang, monitor, 2), Xs, fun (_) -> t_reference() end);
-type(erlang, monitor_node, 2, Xs) ->
- strict(arg_types(erlang, monitor_node, 2), Xs,
- fun (_) -> t_atom('true') end);
-type(erlang, monitor_node, 3, Xs) ->
- strict(arg_types(erlang, monitor_node, 3), Xs,
- fun (_) -> t_atom('true') end);
type(erlang, nif_error, 1, _) ->
t_any(); % this BIF and the next one are stubs for NIFs and never return
type(erlang, nif_error, 2, Xs) ->
strict(arg_types(erlang, nif_error, 2), Xs, fun (_) -> t_any() end);
+%% Guard bif, needs to be here.
type(erlang, node, 0, _) -> t_node();
+%% Guard bif, needs to be here.
type(erlang, node, 1, Xs) ->
strict(arg_types(erlang, node, 1), Xs, fun (_) -> t_node() end);
type(erlang, nodes, 0, _) -> t_list(t_node());
-type(erlang, nodes, 1, Xs) ->
- strict(arg_types(erlang, nodes, 1), Xs, fun (_) -> t_list(t_node()) end);
-type(erlang, now, 0, _) ->
- t_timestamp();
-type(erlang, open_port, 2, Xs) ->
- strict(arg_types(erlang, open_port, 2), Xs, fun (_) -> t_port() end);
-type(erlang, phash, 2, Xs) ->
- strict(arg_types(erlang, phash, 2), Xs, fun (_) -> t_pos_integer() end);
-type(erlang, phash2, 1, Xs) ->
- strict(arg_types(erlang, phash2, 1), Xs, fun (_) -> t_non_neg_integer() end);
-type(erlang, phash2, 2, Xs) ->
- strict(arg_types(erlang, phash2, 2), Xs, fun (_) -> t_non_neg_integer() end);
-type(erlang, pid_to_list, 1, Xs) ->
- strict(arg_types(erlang, pid_to_list, 1), Xs, fun (_) -> t_string() end);
type(erlang, port_call, Arity, Xs) when Arity =:= 2; Arity =:= 3 ->
strict(arg_types(erlang, port_call, Arity), Xs, fun (_) -> t_any() end);
-type(erlang, port_close, 1, Xs) ->
- strict(arg_types(erlang, port_close, 1), Xs,
- fun (_) -> t_atom('true') end);
-type(erlang, port_command, 2, Xs) ->
- strict(arg_types(erlang, port_command, 2), Xs,
- fun (_) -> t_atom('true') end);
-type(erlang, port_command, 3, Xs) ->
- strict(arg_types(erlang, port_command, 3), Xs,
- fun (_) -> t_boolean() end);
-type(erlang, port_connect, 2, Xs) ->
- strict(arg_types(erlang, port_connect, 2), Xs,
- fun (_) -> t_atom('true') end);
-type(erlang, port_control, 3, Xs) ->
- strict(arg_types(erlang, port_control, 3), Xs,
- fun (_) -> t_sup(t_string(), t_binary()) end);
-type(erlang, port_get_data, 1, Xs) ->
- strict(arg_types(erlang, port_get_data, 1), Xs, fun (_) -> t_any() end);
type(erlang, port_info, 1, Xs) ->
strict(arg_types(erlang, port_info, 1), Xs,
fun (_) -> t_sup(t_atom('undefined'), t_list()) end);
@@ -1171,6 +782,7 @@ type(erlang, port_info, 2, Xs) ->
['links'] -> t_tuple([Item, t_list(t_pid())]);
['name'] -> t_tuple([Item, t_string()]);
['output'] -> t_tuple([Item, t_integer()]);
+ ['os_pid'] -> t_tuple([Item, t_sup(t_non_neg_integer(),t_atom('undefined'))]);
['registered_name'] -> t_tuple([Item, t_atom()]);
List when is_list(List) ->
t_tuple([t_sup([t_atom(A) || A <- List]),
@@ -1185,179 +797,11 @@ type(erlang, port_info, 2, Xs) ->
t_string()])])
end)
end);
-type(erlang, port_to_list, 1, Xs) ->
- strict(arg_types(erlang, port_to_list, 1), Xs, fun (_) -> t_string() end);
-type(erlang, ports, 0, _) -> t_list(t_port());
-type(erlang, port_set_data, 2, Xs) ->
- strict(arg_types(erlang, port_set_data, 2), Xs,
- fun (_) -> t_atom('true') end);
-type(erlang, pre_loaded, 0, _) -> t_list(t_atom());
-type(erlang, process_display, 2, _) -> t_atom('true');
-type(erlang, process_flag, 2, Xs) ->
- T_process_flag_returns = t_sup([t_boolean(), t_atom(), t_non_neg_integer()]),
- strict(arg_types(erlang, process_flag, 2), Xs,
- fun ([Flag, _Option]) ->
- case t_is_atom(Flag) of
- true ->
- case t_atom_vals(Flag) of
- ['error_handler'] -> t_atom();
- ['min_heap_size'] -> t_non_neg_integer();
- ['scheduler'] -> t_non_neg_integer();
- ['monitor_nodes'] -> t_boolean();
- ['priority'] -> t_process_priority_level();
- ['save_calls'] -> t_non_neg_integer();
- ['trap_exit'] -> t_boolean();
- List when is_list(List) ->
- T_process_flag_returns;
- unknown ->
- T_process_flag_returns
- end;
- false -> % XXX: over-approximation if Flag is tuple
- T_process_flag_returns
- end
- end);
-type(erlang, process_flag, 3, Xs) ->
- strict(arg_types(erlang, process_flag, 3), Xs,
- fun (_) -> t_non_neg_integer() end);
-type(erlang, process_info, 1, Xs) ->
- strict(arg_types(erlang, process_info, 1), Xs,
- fun (_) ->
- t_sup(t_list(t_tuple([t_pinfo(), t_any()])),
- t_atom('undefined'))
- end);
-type(erlang, process_info, 2, Xs) ->
- %% we define all normal return values: the return when the process exists
- %% t_nil() is the return for 'registered_name'; perhaps for more
- T_process_info_2_normal_returns =
- t_sup([t_tuple([t_pinfo_item(), t_any()]), t_nil()]),
- strict(arg_types(erlang, process_info, 2), Xs,
- fun ([_Pid, InfoItem]) ->
- Ret = case t_is_atom(InfoItem) of
- true ->
- case t_atom_vals(InfoItem) of
- ['backtrace'] -> t_tuple([InfoItem, t_binary()]);
- ['current_function'] -> t_tuple([InfoItem, t_mfa()]);
- ['dictionary'] -> t_tuple([InfoItem, t_list()]);
- ['error_handler'] -> t_tuple([InfoItem, t_atom()]);
- ['garbage_collection'] ->
- t_tuple([InfoItem, t_list()]);
- ['group_leader'] -> t_tuple([InfoItem, t_pid()]);
- ['heap_size'] ->
- t_tuple([InfoItem, t_non_neg_integer()]);
- ['initial_call'] -> t_tuple([InfoItem, t_mfa()]);
- ['last_calls'] ->
- t_tuple([InfoItem,
- t_sup(t_atom('false'), t_list())]);
- ['links'] -> t_tuple([InfoItem, t_list(t_pid())]);
- ['memory'] ->
- t_tuple([InfoItem, t_non_neg_integer()]);
- ['message_binary'] -> t_tuple([InfoItem, t_list()]);
- ['message_queue_len'] ->
- t_tuple([InfoItem, t_non_neg_integer()]);
- ['messages'] -> t_tuple([InfoItem, t_list()]);
- ['monitored_by'] ->
- t_tuple([InfoItem, t_list(t_pid())]);
- ['monitors'] ->
- t_tuple([InfoItem,
- t_list(t_sup(t_tuple([t_atom('process'),
- t_pid()]),
- t_tuple([t_atom('process'),
- t_tuple([t_atom(),
- t_atom()])])))]);
- ['priority'] ->
- t_tuple([InfoItem, t_process_priority_level()]);
- ['reductions'] ->
- t_tuple([InfoItem, t_non_neg_integer()]);
- ['registered_name'] ->
- t_sup(t_tuple([InfoItem, t_atom()]), t_nil());
- ['sequential_trace_token'] ->
- t_tuple([InfoItem, t_any()]); %% Underspecified
- ['stack_size'] ->
- t_tuple([InfoItem, t_non_neg_integer()]);
- ['status'] ->
- t_tuple([InfoItem, t_process_status()]);
- ['suspending'] ->
- t_tuple([InfoItem,
- t_list(t_tuple([t_pid(),
- t_non_neg_integer(),
- t_non_neg_integer()]))]);
- ['total_heap_size'] ->
- t_tuple([InfoItem, t_non_neg_integer()]);
- ['trap_exit'] ->
- t_tuple([InfoItem, t_boolean()]);
- List when is_list(List) ->
- T_process_info_2_normal_returns;
- unknown ->
- T_process_info_2_normal_returns
- end;
- false ->
- case t_is_list(InfoItem) of
- true ->
- t_list(t_tuple([t_pinfo_item(), t_any()]));
- false ->
- t_sup(T_process_info_2_normal_returns,
- t_list(t_tuple([t_pinfo_item(), t_any()])))
- end
- end,
- t_sup([Ret, t_atom('undefined')])
- end);
-type(erlang, processes, 0, _) -> t_list(t_pid());
-type(erlang, purge_module, 1, Xs) ->
- strict(arg_types(erlang, purge_module, 1), Xs,
- fun (_) -> t_atom('true') end);
-type(erlang, put, 2, Xs) ->
- strict(arg_types(erlang, put, 2), Xs, fun (_) -> t_any() end);
-type(erlang, raise, 3, _) -> t_none();
-type(erlang, read_timer, 1, Xs) ->
- strict(arg_types(erlang, read_timer, 1), Xs,
- fun (_) -> t_sup(t_non_neg_integer(), t_atom('false')) end);
-type(erlang, ref_to_list, 1, Xs) ->
- strict(arg_types(erlang, ref_to_list, 1), Xs, fun (_) -> t_string() end);
-type(erlang, register, 2, Xs) ->
- strict(arg_types(erlang, register, 2), Xs, fun (_) -> t_atom('true') end);
-type(erlang, registered, 0, _) -> t_list(t_atom());
-type(erlang, resume_process, 1, Xs) ->
- strict(arg_types(erlang, resume_process, 1), Xs,
- fun (_) -> t_any() end); %% TODO: overapproximation -- fix this
+%% Guard bif, needs to be here.
type(erlang, round, 1, Xs) ->
strict(arg_types(erlang, round, 1), Xs, fun (_) -> t_integer() end);
-type(erlang, posixtime_to_universaltime, 1, Xs) ->
- strict(arg_types(erlang, posixtime_to_universaltime, 1), Xs,
- fun(_) -> t_tuple([t_date(), t_time()]) end);
+%% Guard bif, needs to be here.
type(erlang, self, 0, _) -> t_pid();
-type(erlang, send, 2, Xs) -> type(erlang, '!', 2, Xs); % alias
-type(erlang, send, 3, Xs) ->
- strict(arg_types(erlang, send, 3), Xs,
- fun (_) -> t_sup(t_atom('ok'), t_sendoptions()) end);
-type(erlang, send_after, 3, Xs) ->
- strict(arg_types(erlang, send_after, 3), Xs, fun (_) -> t_reference() end);
-type(erlang, seq_trace, 2, Xs) ->
- strict(arg_types(erlang, seq_trace, 2), Xs,
- fun (_) -> t_sup(t_seq_trace_info_returns(), t_tuple(5)) end);
-type(erlang, seq_trace_info, 1, Xs) ->
- strict(arg_types(erlang, seq_trace_info, 1), Xs,
- fun ([Item]) ->
- case t_atom_vals(Item) of
- ['label'] ->
- t_sup(t_tuple([Item, t_non_neg_integer()]), t_nil());
- ['serial'] ->
- t_sup(t_tuple([Item, t_tuple([t_non_neg_integer(),
- t_non_neg_integer()])]),
- t_nil());
- ['send'] -> t_tuple([Item, t_boolean()]);
- ['receive'] -> t_tuple([Item, t_boolean()]);
- ['print'] -> t_tuple([Item, t_boolean()]);
- ['timestamp'] -> t_tuple([Item, t_boolean()]);
- List when is_list(List) ->
- t_seq_trace_info_returns();
- unknown ->
- t_seq_trace_info_returns()
- end
- end);
-type(erlang, seq_trace_print, 1, Xs) ->
- strict(arg_types(erlang, seq_trace_print, 1), Xs, fun (_) -> t_boolean() end);
-type(erlang, seq_trace_print, 2, Xs) ->
- strict(arg_types(erlang, seq_trace_print, 2), Xs, fun (_) -> t_boolean() end);
type(erlang, set_cookie, 2, Xs) ->
strict(arg_types(erlang, set_cookie, 2), Xs, fun (_) -> t_atom('true') end);
type(erlang, setelement, 3, Xs) ->
@@ -1391,142 +835,22 @@ type(erlang, setelement, 3, Xs) ->
t_sup([type(erlang, setelement, 3, [X1, Y, X3]) || Y <- Ts])
end
end);
-type(erlang, setnode, 2, Xs) ->
- strict(arg_types(erlang, setnode, 2), Xs, fun (_) -> t_atom('true') end);
-type(erlang, setnode, 3, Xs) ->
- strict(arg_types(erlang, setnode, 3), Xs, fun (_) -> t_atom('true') end);
+%% Guard bif, needs to be here.
type(erlang, size, 1, Xs) ->
strict(arg_types(erlang, size, 1), Xs, fun (_) -> t_non_neg_integer() end);
type(erlang, spawn, 1, Xs) ->
strict(arg_types(erlang, spawn, 1), Xs, fun (_) -> t_pid() end);
type(erlang, spawn, 2, Xs) ->
strict(arg_types(erlang, spawn, 2), Xs, fun (_) -> t_pid() end);
-type(erlang, spawn, 3, Xs) ->
- strict(arg_types(erlang, spawn, 3), Xs, fun (_) -> t_pid() end);
type(erlang, spawn, 4, Xs) ->
strict(arg_types(erlang, spawn, 4), Xs, fun (_) -> t_pid() end);
type(erlang, spawn_link, 1, Xs) -> type(erlang, spawn, 1, Xs); % same
type(erlang, spawn_link, 2, Xs) -> type(erlang, spawn, 2, Xs); % same
-type(erlang, spawn_link, 3, Xs) -> type(erlang, spawn, 3, Xs); % same
type(erlang, spawn_link, 4, Xs) -> type(erlang, spawn, 4, Xs); % same
-type(erlang, spawn_opt, 1, Xs) ->
- strict(arg_types(erlang, spawn_opt, 1), Xs,
- fun ([Tuple]) ->
- Fun = fun (TS) ->
- [_, _, _, List] = t_tuple_args(TS),
- t_spawn_opt_return(List)
- end,
- t_sup([Fun(TS) || TS <- t_tuple_subtypes(Tuple)])
- end);
-type(erlang, spawn_opt, 2, Xs) ->
- strict(arg_types(erlang, spawn_opt, 2), Xs,
- fun ([_, List]) -> t_spawn_opt_return(List) end);
-type(erlang, spawn_opt, 3, Xs) ->
- strict(arg_types(erlang, spawn_opt, 3), Xs,
- fun ([_, _, List]) -> t_spawn_opt_return(List) end);
-type(erlang, spawn_opt, 4, Xs) ->
- strict(arg_types(erlang, spawn_opt, 4), Xs,
- fun ([_, _, _, List]) -> t_spawn_opt_return(List) end);
-type(erlang, split_binary, 2, Xs) ->
- strict(arg_types(erlang, split_binary, 2), Xs,
- fun (_) -> t_tuple([t_binary(), t_binary()]) end);
-type(erlang, start_timer, 3, Xs) ->
- strict(arg_types(erlang, start_timer, 3), Xs, fun (_) -> t_reference() end);
-type(erlang, statistics, 1, Xs) ->
- strict(arg_types(erlang, statistics, 1), Xs,
- fun ([Type]) ->
- T_statistics_1 = t_sup([t_non_neg_integer(),
- t_tuple([t_non_neg_integer(),
- t_non_neg_integer()]),
- %% When called with the argument 'io'.
- t_tuple([t_tuple([t_atom('input'),
- t_non_neg_integer()]),
- t_tuple([t_atom('output'),
- t_non_neg_integer()])]),
- t_tuple([t_non_neg_integer(),
- t_non_neg_integer(),
- t_non_neg_integer()])]),
- case t_atom_vals(Type) of
- ['context_switches'] ->
- t_tuple([t_non_neg_integer(), t_integer(0)]);
- ['exact_reductions'] ->
- t_tuple([t_non_neg_integer(), t_non_neg_integer()]);
- ['garbage_collection'] ->
- t_tuple([t_non_neg_integer(),
- t_non_neg_integer(),
- t_integer(0)]);
- ['io'] ->
- t_tuple([t_tuple([t_atom('input'), t_non_neg_integer()]),
- t_tuple([t_atom('output'), t_non_neg_integer()])]);
- ['reductions'] ->
- t_tuple([t_non_neg_integer(), t_non_neg_integer()]);
- ['run_queue'] ->
- t_non_neg_integer();
- ['runtime'] ->
- t_tuple([t_non_neg_integer(), t_integer(0)]);
- ['wall_clock'] ->
- t_tuple([t_non_neg_integer(), t_integer(0)]);
- List when is_list(List) ->
- T_statistics_1;
- unknown ->
- T_statistics_1
- end
- end);
type(erlang, subtract, 2, Xs) -> type(erlang, '--', 2, Xs); % alias
type(erlang, suspend_process, 1, Xs) ->
strict(arg_types(erlang, suspend_process, 1), Xs,
fun (_) -> t_atom('true') end);
-type(erlang, suspend_process, 2, Xs) ->
- strict(arg_types(erlang, suspend_process, 2), Xs,
- fun (_) -> t_boolean() end);
-type(erlang, system_flag, 2, Xs) ->
- strict(arg_types(erlang, system_flag, 2), Xs,
- fun ([Flag,_Value]) ->
- %% this provides an overapproximation of all return values
- T_system_flag_2 = t_sup([t_boolean(),
- t_integer(),
- t_sequential_tracer(),
- t_system_cpu_topology(),
- t_system_multi_scheduling()]),
- case t_is_atom(Flag) of
- true ->
- case t_atom_vals(Flag) of
- ['backtrace_depth'] ->
- t_non_neg_fixnum();
- ['cpu_topology'] ->
- t_system_cpu_topology();
- ['debug_flags'] ->
- t_atom('true');
- ['display_items'] ->
- t_non_neg_fixnum();
- ['fullsweep_after'] ->
- t_non_neg_fixnum();
- ['min_heap_size'] ->
- t_non_neg_fixnum();
- ['multi_scheduling'] ->
- t_system_multi_scheduling();
- ['schedulers_online'] ->
- t_pos_fixnum();
- ['scheduler_bind_type'] ->
- t_scheduler_bind_type_results();
- ['sequential_tracer'] ->
- t_sequential_tracer();
- ['trace_control_word'] ->
- t_integer();
- List when is_list(List) ->
- T_system_flag_2;
- unknown ->
- T_system_flag_2
- end;
- false ->
- case t_is_integer(Flag) of % SHOULD BE: t_is_fixnum
- true ->
- t_atom('true');
- false ->
- T_system_flag_2
- end
- end
- end);
type(erlang, system_info, 1, Xs) ->
strict(arg_types(erlang, system_info, 1), Xs,
fun ([Type]) ->
@@ -1559,7 +883,7 @@ type(erlang, system_info, 1, Xs) ->
['dist'] ->
t_binary();
['dist_ctrl'] ->
- t_list(t_tuple([t_atom(), t_sup([t_pid(), t_port])]));
+ t_list(t_tuple([t_atom(), t_sup([t_pid(), t_port()])]));
%% elib_malloc is intentionally not included,
%% because it scheduled for removal in R15.
['endian'] ->
@@ -1568,12 +892,10 @@ type(erlang, system_info, 1, Xs) ->
t_tuple([t_atom('fullsweep_after'), t_non_neg_integer()]);
['garbage_collection'] ->
t_list();
- ['global_heaps_size'] ->
- t_non_neg_integer();
['heap_sizes'] ->
t_list(t_integer());
['heap_type'] ->
- t_sup([t_atom('private'), t_atom('hybrid')]);
+ t_atom('private');
['hipe_architecture'] ->
t_atoms(['amd64', 'arm', 'powerpc', 'ppc64',
'undefined', 'ultrasparc', 'x86']);
@@ -1593,7 +915,6 @@ type(erlang, system_info, 1, Xs) ->
t_list(t_pid());
['os_type'] ->
t_tuple([t_sup([t_atom('unix'),
- t_atom('vxworks'),
t_atom('win32')]),
t_atom()]);
['os_version'] ->
@@ -1643,56 +964,13 @@ type(erlang, system_info, 1, Xs) ->
t_any() %% overapproximation as the return value might change
end
end);
-type(erlang, system_monitor, 0, Xs) ->
- strict(arg_types(erlang, system_monitor, 0), Xs,
- fun (_) -> t_system_monitor_settings() end);
-type(erlang, system_monitor, 1, Xs) ->
- strict(arg_types(erlang, system_monitor, 1), Xs,
- fun (_) -> t_system_monitor_settings() end);
-type(erlang, system_monitor, 2, Xs) ->
- strict(arg_types(erlang, system_monitor, 2), Xs,
- fun (_) -> t_system_monitor_settings() end);
-type(erlang, system_profile, 0, _) ->
- t_system_profile_return();
-type(erlang, system_profile, 2, Xs) ->
- strict(arg_types(erlang, system_profile, 2), Xs,
- fun (_) -> t_system_profile_return() end);
-type(erlang, term_to_binary, 1, Xs) ->
- strict(arg_types(erlang, term_to_binary, 1), Xs, fun (_) -> t_binary() end);
-type(erlang, term_to_binary, 2, Xs) ->
- strict(arg_types(erlang, term_to_binary, 2), Xs, fun (_) -> t_binary() end);
-type(erlang, time, 0, _) ->
- t_tuple([t_non_neg_integer(), t_non_neg_integer(), t_non_neg_integer()]);
+%% Guard bif, needs to be here.
type(erlang, tl, 1, Xs) ->
strict(arg_types(erlang, tl, 1), Xs, fun ([X]) -> t_cons_tl(X) end);
-type(erlang, trace, 3, Xs) ->
- strict(arg_types(erlang, trace, 3), Xs, fun (_) -> t_integer() end);
-type(erlang, trace_delivered, 1, Xs) ->
- strict(arg_types(erlang, trace_delivered, 1), Xs,
- fun (_) -> t_reference() end);
-type(erlang, trace_info, 2, Xs) ->
- strict(arg_types(erlang, trace_info, 2), Xs,
- fun (_) ->
- t_tuple([t_atom(),
- t_sup([%% the following is info about a PID
- t_list(t_atom()), t_pid(), t_port(),
- %% the following is info about a func
- t_atom('global'), t_atom('local'),
- t_atom('false'), t_atom('true'),
- t_list(), t_pid(), t_port(),
- t_integer(),
- t_list(t_tuple([t_atom(), t_any()])),
- %% and this is the 'not found' value
- t_atom('undefined')])])
- end);
-type(erlang, trace_pattern, 2, Xs) ->
- strict(arg_types(erlang, trace_pattern, 2), Xs,
- fun (_) -> t_non_neg_fixnum() end); %% num of MFAs that match pattern
-type(erlang, trace_pattern, 3, Xs) ->
- strict(arg_types(erlang, trace_pattern, 3), Xs,
- fun (_) -> t_non_neg_fixnum() end); %% num of MFAs that match pattern
+%% Guard bif, needs to be here.
type(erlang, trunc, 1, Xs) ->
strict(arg_types(erlang, trunc, 1), Xs, fun (_) -> t_integer() end);
+%% Guard bif, needs to be here.
type(erlang, tuple_size, 1, Xs) ->
strict(arg_types(erlang, tuple_size, 1), Xs, fun (_) -> t_non_neg_integer() end);
type(erlang, tuple_to_list, 1, Xs) ->
@@ -1715,266 +993,10 @@ type(erlang, tuple_to_list, 1, Xs) ->
end
end
end);
-type(erlang, universaltime, 0, _) ->
- t_tuple([t_date(), t_time()]);
-type(erlang, universaltime_to_localtime, 1, Xs) ->
- strict(arg_types(erlang, universaltime_to_localtime, 1), Xs,
- fun ([T]) -> T end);
-type(erlang, universaltime_to_posixtime, 1, Xs) ->
- strict(arg_types(erlang, universaltime_to_posixtime,1), Xs,
- fun(_) -> t_integer() end);
-type(erlang, unlink, 1, Xs) ->
- strict(arg_types(erlang, unlink, 1), Xs, fun (_) -> t_atom('true') end);
-type(erlang, unregister, 1, Xs) ->
- strict(arg_types(erlang, unregister, 1), Xs, fun (_) -> t_atom('true') end);
-type(erlang, whereis, 1, Xs) ->
- strict(arg_types(erlang, whereis, 1), Xs,
- fun (_) -> t_sup([t_pid(), t_port(), t_atom('undefined')]) end);
type(erlang, yield, 0, _) -> t_atom('true');
-%%-- erl_prim_loader ----------------------------------------------------------
-type(erl_prim_loader, get_file, 1, Xs) ->
- strict(arg_types(erl_prim_loader, get_file, 1), Xs,
- fun (_) ->
- t_sup(t_tuple([t_atom('ok'), t_binary(), t_string()]),
- t_atom('error'))
- end);
-type(erl_prim_loader, get_path, 0, _) ->
- t_tuple([t_atom('ok'), t_list(t_string())]);
-type(erl_prim_loader, set_path, 1, Xs) ->
- strict(arg_types(erl_prim_loader, set_path, 1), Xs,
- fun (_) -> t_atom('ok') end);
-%%-- error_logger -------------------------------------------------------------
-type(error_logger, warning_map, 0, _) ->
- t_sup([t_atom('info'), t_atom('warning'), t_atom('error')]);
-%%-- erts_debug ---------------------------------------------------------------
-type(erts_debug, breakpoint, 2, Xs) ->
- strict(arg_types(erts_debug, breakpoint, 2), Xs, fun (_) -> t_fixnum() end);
-type(erts_debug, disassemble, 1, Xs) ->
- strict(arg_types(erts_debug, disassemble, 1), Xs,
- fun (_) -> t_sup([t_atom('false'),
- t_atom('undef'),
- t_tuple([t_integer(), t_binary(), t_mfa()])]) end);
-type(erts_debug, display, 1, _) ->
- t_string();
-type(erts_debug, dist_ext_to_term, 2, Xs) ->
- strict(arg_types(erts_debug, dist_ext_to_term, 2), Xs,
- fun (_) -> t_any() end);
-type(erts_debug, dump_monitors, 1, Xs) ->
- strict(arg_types(erts_debug, dump_monitors, 1), Xs,
- fun(_) -> t_atom('true') end);
-type(erts_debug, dump_links, 1, Xs) ->
- strict(arg_types(erts_debug, dump_links, 1), Xs,
- fun(_) -> t_atom('true') end);
-type(erts_debug, flat_size, 1, Xs) ->
- strict(arg_types(erts_debug, flat_size, 1), Xs, fun (_) -> t_integer() end);
-type(erts_debug, get_internal_state, 1, _) ->
- t_any();
-type(erts_debug, instructions, 0, _) ->
- t_list(t_list(t_byte()));
-type(erts_debug, lock_counters, 1, Xs) ->
- strict(arg_types(erts_debug, lock_counters, 1), Xs,
- fun ([Arg]) ->
- case t_is_atom(Arg) of
- true ->
- case t_atom_vals(Arg) of
- ['enabled'] -> t_boolean();
- ['info'] -> t_any();
- ['clear'] -> t_atom(ok);
- _ -> t_sup([t_boolean(), t_any(), t_atom('ok')])
- end;
- false ->
- case t_is_tuple(Arg) of
- true -> t_boolean();
- false -> t_sup([t_boolean(), t_any(), t_atom('ok')])
- end
- end
- end);
-type(erts_debug, same, 2, Xs) ->
- strict(arg_types(erts_debug, same, 2), Xs, fun (_) -> t_boolean() end);
-type(erts_debug, set_internal_state, 2, _) ->
- t_any();
%%-- ets ----------------------------------------------------------------------
-type(ets, all, 0, _) ->
- t_list(t_tab());
-type(ets, delete, 1, Xs) ->
- strict(arg_types(ets, delete, 1), Xs, fun (_) -> t_atom('true') end);
-type(ets, delete, 2, Xs) ->
- strict(arg_types(ets, delete, 2), Xs, fun (_) -> t_atom('true') end);
-type(ets, delete_all_objects, 1, Xs) ->
- strict(arg_types(ets, delete_all_objects, 1), Xs,
- fun (_) -> t_atom('true') end);
-type(ets, delete_object, 2, Xs) ->
- strict(arg_types(ets, delete_object, 2), Xs, fun (_) -> t_atom('true') end);
-type(ets, first, 1, Xs) ->
- strict(arg_types(ets, first, 1), Xs, fun (_) -> t_any() end);
-type(ets, give_away, 3, Xs) ->
- strict(arg_types(ets, give_away, 3), Xs, fun (_) -> t_atom('true') end);
-type(ets, info, 1, Xs) ->
- strict(arg_types(ets, info, 1), Xs,
- fun (_) ->
- t_sup(t_list(t_tuple([t_ets_info_items(), t_any()])),
- t_atom('undefined'))
- end);
-type(ets, info, 2, Xs) ->
- strict(arg_types(ets, info, 2), Xs, fun (_) -> t_any() end);
-type(ets, insert, 2, Xs) ->
- strict(arg_types(ets, insert, 2), Xs, fun (_) -> t_atom('true') end);
-type(ets, insert_new, 2, Xs) ->
- strict(arg_types(ets, insert_new, 2), Xs, fun (_) -> t_boolean() end);
-type(ets, is_compiled_ms, 1, Xs) ->
- strict(arg_types(ets, is_compiled_ms, 1), Xs, fun (_) -> t_boolean() end);
-type(ets, last, 1, Xs) ->
- type(ets, first, 1, Xs);
-type(ets, lookup, 2, Xs) ->
- strict(arg_types(ets, lookup, 2), Xs, fun (_) -> t_list(t_tuple()) end);
-type(ets, lookup_element, 3, Xs) ->
- strict(arg_types(ets, lookup_element, 3), Xs, fun (_) -> t_any() end);
-type(ets, match, 1, Xs) ->
- strict(arg_types(ets, match, 1), Xs, fun (_) -> t_matchres() end);
-type(ets, match, 2, Xs) ->
- strict(arg_types(ets, match, 2), Xs, fun (_) -> t_list() end);
-type(ets, match, 3, Xs) ->
- strict(arg_types(ets, match, 3), Xs, fun (_) -> t_matchres() end);
-type(ets, match_object, 1, Xs) -> type(ets, match, 1, Xs);
-type(ets, match_object, 2, Xs) -> type(ets, match, 2, Xs);
-type(ets, match_object, 3, Xs) -> type(ets, match, 3, Xs);
-type(ets, match_spec_compile, 1, Xs) ->
- strict(arg_types(ets, match_spec_compile, 1), Xs, fun (_) -> t_any() end);
-type(ets, match_spec_run_r, 3, Xs) ->
- strict(arg_types(ets, match_spec_run_r, 3), Xs, fun (_) -> t_list() end);
-type(ets, member, 2, Xs) ->
- strict(arg_types(ets, member, 2), Xs, fun (_) -> t_boolean() end);
-type(ets, new, 2, Xs) ->
- strict(arg_types(ets, new, 2), Xs, fun (_) -> t_tab() end);
-type(ets, next, 2, Xs) ->
- strict(arg_types(ets, next, 2), Xs,
- %% t_any below stands for: term() | '$end_of_table'
- fun (_) -> t_any() end);
-type(ets, prev, 2, Xs) -> type(ets, next, 2, Xs);
type(ets, rename, 2, Xs) ->
strict(arg_types(ets, rename, 2), Xs, fun ([_, Name]) -> Name end);
-type(ets, safe_fixtable, 2, Xs) ->
- strict(arg_types(ets, safe_fixtable, 2), Xs, fun (_) -> t_atom('true') end);
-type(ets, select, 1, Xs) ->
- strict(arg_types(ets, select, 1), Xs, fun (_) -> t_matchres() end);
-type(ets, select, 2, Xs) ->
- strict(arg_types(ets, select, 2), Xs, fun (_) -> t_list() end);
-type(ets, select, 3, Xs) ->
- strict(arg_types(ets, select, 3), Xs, fun (_) -> t_matchres() end);
-type(ets, select_count, 2, Xs) ->
- strict(arg_types(ets, select_count, 2), Xs,
- fun (_) -> t_non_neg_fixnum() end);
-type(ets, select_delete, 2, Xs) ->
- strict(arg_types(ets, select_delete, 2), Xs,
- fun (_) -> t_non_neg_fixnum() end);
-type(ets, select_reverse, 1, Xs) -> type(ets, select, 1, Xs);
-type(ets, select_reverse, 2, Xs) -> type(ets, select, 2, Xs);
-type(ets, select_reverse, 3, Xs) -> type(ets, select, 3, Xs);
-type(ets, setopts, 2, Xs) ->
- strict(arg_types(ets, setopts, 2), Xs, fun (_) -> t_atom('true') end);
-type(ets, slot, 2, Xs) ->
- strict(arg_types(ets, slot, 2), Xs,
- fun (_) -> t_sup(t_list(t_tuple()), t_atom('$end_of_table')) end);
-type(ets, update_counter, 3, Xs) ->
- strict(arg_types(ets, update_counter, 3), Xs,
- fun ([_, _, Op]) ->
- case t_is_integer(Op) of
- true -> t_integer();
- false ->
- case t_is_tuple(Op) of
- true -> t_integer();
- false ->
- case t_is_list(Op) of
- true -> t_list(t_integer());
- false ->
- case t_is_nil(Op) of
- true -> t_nil();
- false -> t_sup([t_integer(), t_list(t_integer())])
- end
- end
- end
- end
- end);
-type(ets, update_element, 3, Xs) ->
- strict(arg_types(ets, update_element, 3), Xs, fun (_) -> t_boolean() end);
-%%-- file ---------------------------------------------------------------------
-type(file, native_name_encoding, 0, _) ->
- t_file_encoding();
-%%-- prim_file ----------------------------------------------------------------
-type(prim_file, internal_name2native, 1, Xs) ->
- strict(arg_types(prim_file, internal_name2native, 1), Xs,
- fun (_) -> t_binary() end);
-type(prim_file, internal_native2name, 1, Xs) ->
- strict(arg_types(prim_file, internal_native2name, 1), Xs,
- fun (_) -> t_prim_file_name() end);
-type(prim_file, internal_normalize_utf8, 1, Xs) ->
- strict(arg_types(prim_file, internal_normalize_utf8, 1), Xs,
- fun (_) -> t_unicode_string() end);
-%%-- gen_tcp ------------------------------------------------------------------
-%% NOTE: All type information for this module added to avoid loss of precision
-type(gen_tcp, accept, 1, Xs) ->
- strict(arg_types(gen_tcp, accept, 1), Xs, fun (_) -> t_gen_tcp_accept() end);
-type(gen_tcp, accept, 2, Xs) ->
- strict(arg_types(gen_tcp, accept, 2), Xs, fun (_) -> t_gen_tcp_accept() end);
-type(gen_tcp, connect, 3, Xs) ->
- strict(arg_types(gen_tcp, connect, 3), Xs,
- fun (_) ->
- t_sup(t_tuple([t_atom('ok'), t_socket()]),
- t_tuple([t_atom('error'), t_inet_posix_error()]))
- end);
-type(gen_tcp, connect, 4, Xs) ->
- strict(arg_types(gen_tcp, connect, 4), Xs,
- fun (_) ->
- t_sup(t_tuple([t_atom('ok'), t_socket()]),
- t_tuple([t_atom('error'), t_inet_posix_error()]))
- end);
-type(gen_tcp, listen, 2, Xs) ->
- strict(arg_types(gen_tcp, listen, 2), Xs,
- fun (_) ->
- t_sup(t_tuple([t_atom('ok'), t_socket()]),
- t_tuple([t_atom('error'), t_inet_posix_error()]))
- end);
-type(gen_tcp, recv, 2, Xs) ->
- strict(arg_types(gen_tcp, recv, 2), Xs, fun (_) -> t_gen_tcp_recv() end);
-type(gen_tcp, recv, 3, Xs) ->
- strict(arg_types(gen_tcp, recv, 3), Xs, fun (_) -> t_gen_tcp_recv() end);
-type(gen_tcp, send, 2, Xs) ->
- strict(arg_types(gen_tcp, send, 2), Xs,
- fun (_) ->
- t_sup(t_atom('ok'),
- t_tuple([t_atom('error'), t_inet_posix_error()]))
- end);
-type(gen_tcp, shutdown, 2, Xs) ->
- strict(arg_types(gen_tcp, shutdown, 2), Xs,
- fun (_) ->
- t_sup(t_atom('ok'),
- t_tuple([t_atom('error'), t_inet_posix_error()]))
- end);
-%%-- gen_udp ------------------------------------------------------------------
-%% NOTE: All type information for this module added to avoid loss of precision
-type(gen_udp, open, 1, Xs) ->
- strict(arg_types(gen_udp, open, 1), Xs,
- fun (_) ->
- t_sup(t_tuple([t_atom('ok'), t_socket()]),
- t_tuple([t_atom('error'), t_inet_posix_error()]))
- end);
-type(gen_udp, open, 2, Xs) ->
- strict(arg_types(gen_udp, open, 2), Xs,
- fun (_) ->
- t_sup(t_tuple([t_atom('ok'), t_socket()]),
- t_tuple([t_atom('error'), t_inet_posix_error()]))
- end);
-type(gen_udp, recv, 2, Xs) ->
- strict(arg_types(gen_udp, recv, 2), Xs, fun (_) -> t_gen_udp_recv() end);
-type(gen_udp, recv, 3, Xs) ->
- strict(arg_types(gen_udp, recv, 3), Xs, fun (_) -> t_gen_udp_recv() end);
-type(gen_udp, send, 4, Xs) ->
- strict(arg_types(gen_udp, send, 4), Xs,
- fun (_) ->
- t_sup(t_atom('ok'),
- t_tuple([t_atom('error'), t_sup(t_atom('not_owner'),
- t_inet_posix_error())]))
- end);
%%-- hipe_bifs ----------------------------------------------------------------
type(hipe_bifs, add_ref, 2, Xs) ->
strict(arg_types(hipe_bifs, add_ref, 2), Xs, fun (_) -> t_nil() end);
@@ -2097,26 +1119,6 @@ type(hipe_bifs, write_u32, 2, Xs) ->
strict(arg_types(hipe_bifs, write_u32, 2), Xs, fun (_) -> t_nil() end);
type(hipe_bifs, write_u64, 2, Xs) ->
strict(arg_types(hipe_bifs, write_u64, 2), Xs, fun (_) -> t_nil() end);
-%%-- io -----------------------------------------------------------------------
-type(io, format, 1, Xs) ->
- strict(arg_types(io, format, 1), Xs, fun (_) -> t_atom('ok') end);
-type(io, format, 2, Xs) ->
- strict(arg_types(io, format, 2), Xs, fun (_) -> t_atom('ok') end);
-type(io, format, 3, Xs) ->
- strict(arg_types(io, format, 3), Xs, fun (_) -> t_atom('ok') end);
-type(io, fwrite, 1, Xs) -> type(io, format, 1, Xs); % same
-type(io, fwrite, 2, Xs) -> type(io, format, 2, Xs); % same
-type(io, fwrite, 3, Xs) -> type(io, format, 3, Xs); % same
-type(io, put_chars, 1, Xs) ->
- strict(arg_types(io, put_chars, 1), Xs, fun (_) -> t_atom('ok') end);
-type(io, put_chars, 2, Xs) ->
- strict(arg_types(io, put_chars, 2), Xs, fun (_) -> t_atom('ok') end);
-%%-- io_lib -------------------------------------------------------------------
-type(io_lib, format, 2, Xs) ->
- strict(arg_types(io_lib, format, 2), Xs,
- %% t_list() because the character list might be arbitrarily nested
- fun (_) -> t_list(t_sup(t_char(), t_list())) end);
-type(io_lib, fwrite, 2, Xs) -> type(io_lib, format, 2, Xs); % same
%%-- lists --------------------------------------------------------------------
type(lists, all, 2, Xs) ->
strict(arg_types(lists, all, 2), Xs,
@@ -2486,8 +1488,6 @@ type(lists, merge, 2, Xs) ->
end
end
end);
-%% type(lists, merge, 3, Xs) ->
-%% type(lists, merge3, 3, Xs) ->
type(lists, min, 1, Xs) ->
strict(arg_types(lists, min, 1), Xs, fun ([L]) -> t_list_elements(L) end);
type(lists, nth, 2, Xs) ->
@@ -2524,10 +1524,6 @@ type(lists, reverse, 1, Xs) ->
strict(arg_types(lists, reverse, 1), Xs, fun ([X]) -> X end);
type(lists, reverse, 2, Xs) ->
type(erlang, '++', 2, Xs); % reverse-onto is just like append
-type(lists, seq, 2, Xs) ->
- strict(arg_types(lists, seq, 2), Xs, fun (_) -> t_list(t_integer()) end);
-type(lists, seq, 3, Xs) ->
- strict(arg_types(lists, seq, 3), Xs, fun (_) -> t_list(t_integer()) end);
type(lists, sort, 1, Xs) ->
strict(arg_types(lists, sort, 1), Xs, fun ([X]) -> X end);
type(lists, sort, 2, Xs) ->
@@ -2634,95 +1630,7 @@ type(lists, zipwith, 3, Xs) ->
type(lists, zipwith3, 4, Xs) ->
strict(arg_types(lists, zipwith3, 4), Xs,
fun ([F,_As,_Bs,_Cs]) -> t_sup(t_list(t_fun_range(F)), t_nil()) end);
-%%-- math ---------------------------------------------------------------------
-type(math, acos, 1, Xs) ->
- strict(arg_types(math, acos, 1), Xs, fun (_) -> t_float() end);
-type(math, acosh, 1, Xs) ->
- strict(arg_types(math, acosh, 1), Xs, fun (_) -> t_float() end);
-type(math, asin, 1, Xs) ->
- strict(arg_types(math, asin, 1), Xs, fun (_) -> t_float() end);
-type(math, asinh, 1, Xs) ->
- strict(arg_types(math, asinh, 1), Xs, fun (_) -> t_float() end);
-type(math, atan, 1, Xs) ->
- strict(arg_types(math, atan, 1), Xs, fun (_) -> t_float() end);
-type(math, atan2, 2, Xs) ->
- strict(arg_types(math, atan2, 2), Xs, fun (_) -> t_float() end);
-type(math, atanh, 1, Xs) ->
- strict(arg_types(math, atanh, 1), Xs, fun (_) -> t_float() end);
-type(math, cos, 1, Xs) ->
- strict(arg_types(math, cos, 1), Xs, fun (_) -> t_float() end);
-type(math, cosh, 1, Xs) ->
- strict(arg_types(math, cosh, 1), Xs, fun (_) -> t_float() end);
-type(math, erf, 1, Xs) ->
- strict(arg_types(math, erf, 1), Xs, fun (_) -> t_float() end);
-type(math, erfc, 1, Xs) ->
- strict(arg_types(math, erfc, 1), Xs, fun (_) -> t_float() end);
-type(math, exp, 1, Xs) ->
- strict(arg_types(math, exp, 1), Xs, fun (_) -> t_float() end);
-type(math, log, 1, Xs) ->
- strict(arg_types(math, log, 1), Xs, fun (_) -> t_float() end);
-type(math, log10, 1, Xs) ->
- strict(arg_types(math, log10, 1), Xs, fun (_) -> t_float() end);
-type(math, pi, 0, _) -> t_float();
-type(math, pow, 2, Xs) ->
- strict(arg_types(math, pow, 2), Xs, fun (_) -> t_float() end);
-type(math, sin, 1, Xs) ->
- strict(arg_types(math, sin, 1), Xs, fun (_) -> t_float() end);
-type(math, sinh, 1, Xs) ->
- strict(arg_types(math, sinh, 1), Xs, fun (_) -> t_float() end);
-type(math, sqrt, 1, Xs) ->
- strict(arg_types(math, sqrt, 1), Xs, fun (_) -> t_float() end);
-type(math, tan, 1, Xs) ->
- strict(arg_types(math, tan, 1), Xs, fun (_) -> t_float() end);
-type(math, tanh, 1, Xs) ->
- strict(arg_types(math, tanh, 1), Xs, fun (_) -> t_float() end);
-%%-- net_kernel ---------------------------------------------------------------
-type(net_kernel, dflag_unicode_io, 1, Xs) ->
- strict(arg_types(net_kernel, dflag_unicode_io, 1), Xs,
- fun (_) -> t_boolean() end);
-%%-- ordsets ------------------------------------------------------------------
-type(ordsets, filter, 2, Xs) ->
- type(lists, filter, 2, Xs);
-type(ordsets, fold, 3, Xs) ->
- type(lists, foldl, 3, Xs);
-%%-- os -----------------------------------------------------------------------
-type(os, getenv, 0, _) -> t_list(t_string());
-type(os, getenv, 1, Xs) ->
- strict(arg_types(os, getenv, 1), Xs,
- fun (_) -> t_sup(t_string(), t_atom('false')) end);
-type(os, getpid, 0, _) -> t_string();
-type(os, putenv, 2, Xs) ->
- strict(arg_types(os, putenv, 2), Xs, fun (_) -> t_atom('true') end);
-type(os, timestamp, 0, _) ->
- t_timestamp();
-%%-- re -----------------------------------------------------------------------
-type(re, compile, 1, Xs) ->
- strict(arg_types(re, compile, 1), Xs,
- fun (_) ->
- t_sup(t_tuple([t_atom('ok'), t_re_MP()]),
- t_tuple([t_atom('error'), t_re_ErrorSpec()]))
- end);
-type(re, compile, 2, Xs) ->
- strict(arg_types(re, compile, 2), Xs,
- fun (_) ->
- t_sup(t_tuple([t_atom('ok'), t_re_MP()]),
- t_tuple([t_atom('error'), t_re_ErrorSpec()]))
- end);
-type(re, run, 2, Xs) ->
- strict(arg_types(re, run, 2), Xs,
- fun (_) ->
- t_sup([t_tuple([t_atom('match'), t_re_Captured()]),
- t_atom('nomatch'),
- t_tuple([t_atom('error'), t_re_ErrorSpec()])])
- end);
-type(re, run, 3, Xs) ->
- strict(arg_types(re, run, 3), Xs,
- fun (_) ->
- t_sup([t_tuple([t_atom('match'), t_re_Captured()]),
- t_atom('match'),
- t_atom('nomatch'),
- t_tuple([t_atom('error'), t_re_ErrorSpec()])])
- end);
+
%%-- string -------------------------------------------------------------------
type(string, chars, 2, Xs) -> % NOTE: added to avoid loss of information
strict(arg_types(string, chars, 2), Xs, fun (_) -> t_string() end);
@@ -2741,41 +1649,6 @@ type(string, chars, 3, Xs) -> % NOTE: added to avoid loss of information
end
end
end);
-type(string, concat, 2, Xs) -> % NOTE: added to avoid loss of information
- strict(arg_types(string, concat, 2), Xs, fun (_) -> t_string() end);
-type(string, equal, 2, Xs) -> % NOTE: added to avoid loss of information
- strict(arg_types(string, equal, 2), Xs, fun (_) -> t_boolean() end);
-type(string, to_float, 1, Xs) ->
- strict(arg_types(string, to_float, 1), Xs,
- fun (_) -> t_sup(t_tuple([t_float(), t_string()]),
- t_tuple([t_atom('error'),
- t_sup(t_atom('no_float'),
- t_atom('not_a_list'))]))
- end);
-type(string, to_integer, 1, Xs) ->
- strict(arg_types(string, to_integer, 1), Xs,
- fun (_) -> t_sup(t_tuple([t_integer(), t_string()]),
- t_tuple([t_atom('error'),
- t_sup(t_atom('no_integer'),
- t_atom('not_a_list'))]))
- end);
-%%-- unicode ------------------------------------------------------------------
-type(unicode, characters_to_binary, 2, Xs) ->
- strict(arg_types(unicode, characters_to_binary, 2), Xs,
- fun (_) ->
- t_sup([t_binary(),
- t_tuple([t_atom('error'), t_binary(), t_ML()]),
- t_tuple([t_atom('incomplete'), t_binary(), t_ML()])])
- end);
-type(unicode, characters_to_list, 2, Xs) ->
- strict(arg_types(unicode, characters_to_list, 2), Xs,
- fun (_) ->
- t_sup([t_string(),
- t_tuple([t_atom('error'), t_string(), t_ML()]),
- t_tuple([t_atom('incomplete'), t_string(), t_ML()])])
- end);
-type(unicode, bin_is_7bit, 1, Xs) ->
- strict(arg_types(unicode, bin_is_7bit, 1), Xs, fun (_) -> t_boolean() end);
%%-----------------------------------------------------------------------------
type(M, F, A, Xs) when is_atom(M), is_atom(F),
@@ -3230,107 +2103,6 @@ key_comparisons_fail(X0, KeyPos, TupleList) ->
-spec arg_types(atom(), atom(), arity()) -> [erl_types:erl_type()] | 'unknown'.
-%%------- binary --------------------------------------------------------------
-arg_types(binary, at, 2) ->
- [t_binary(), t_non_neg_integer()];
-arg_types(binary, bin_to_list, 1) ->
- [t_binary()];
-arg_types(binary, bin_to_list, 2) ->
- [t_binary(), t_binary_part()];
-arg_types(binary, bin_to_list, 3) ->
- [t_binary(), t_integer(), t_non_neg_integer()];
-arg_types(binary, compile_pattern, 1) ->
- [t_sup(t_binary(), t_list(t_binary()))];
-arg_types(binary, copy, 1) ->
- [t_binary()];
-arg_types(binary, copy, 2) ->
- [t_binary(), t_non_neg_integer()];
-arg_types(binary, decode_unsigned, 1) ->
- [t_binary()];
-arg_types(binary, decode_unsigned, 2) ->
- [t_binary(), t_endian()];
-arg_types(binary, encode_unsigned, 1) ->
- [t_non_neg_integer()];
-arg_types(binary, encode_unsigned, 2) ->
- [t_non_neg_integer(), t_endian()];
-arg_types(binary, first, 1) ->
- [t_binary()];
-arg_types(binary, last, 1) ->
- [t_binary()];
-arg_types(binary, list_to_bin, 1) ->
- arg_types(erlang, list_to_binary, 1);
-arg_types(binary, longest_common_prefix, 1) ->
- [t_list(t_binary())];
-arg_types(binary, longest_common_suffix, 1) ->
- [t_list(t_binary())];
-arg_types(binary, match, 2) ->
- [t_binary(), t_binary_pattern()];
-arg_types(binary, match, 3) ->
- [t_binary(), t_binary_pattern(), t_binary_options()];
-arg_types(binary, matches, 2) ->
- [t_binary(), t_binary_pattern()];
-arg_types(binary, matches, 3) ->
- [t_binary(), t_binary_pattern(), t_binary_options()];
-arg_types(binary, part, 2) ->
- arg_types(erlang, binary_part, 2);
-arg_types(binary, part, 3) ->
- arg_types(erlang, binary_part, 3);
-arg_types(binary, referenced_byte_size, 1) ->
- [t_binary()];
-%%------- code ----------------------------------------------------------------
-arg_types(code, get_chunk, 2) ->
- [t_binary(), t_string()];
-arg_types(code, is_module_native, 1) ->
- [t_atom()];
-arg_types(code, module_md5, 1) ->
- [t_binary()];
-arg_types(code, make_stub_module, 3) ->
- [t_atom(), t_binary(), t_tuple([t_list(), t_list()])];
-arg_types(code, rehash, 0) ->
- [];
-%%------- erl_ddll ------------------------------------------------------------
-arg_types(erl_ddll, demonitor, 1) ->
- arg_types(erlang, demonitor, 1);
-arg_types(erl_ddll, format_error_int, 1) ->
- [t_sup([t_atom('inconsistent'),
- t_atom('linked_in_driver'),
- t_atom('permanent'),
- t_atom('not_loaded'),
- t_atom('not_loaded_by_this_process'),
- t_atom('not_pending'),
- t_atom('already_loaded'),
- t_atom('unloading')])];
-arg_types(erl_ddll, info, 2) ->
- [t_sup([t_atom(), t_string()]),
- t_sup([t_atom('awaiting_load'),
- t_atom('awaiting_unload'),
- t_atom('driver_options'),
- t_atom('linked_in_driver'),
- t_atom('permanent'),
- t_atom('port_count'),
- t_atom('processes')])];
-arg_types(erl_ddll, loaded_drivers, 0) ->
- [];
-arg_types(erl_ddll, monitor, 2) ->
- [t_atom('driver'),
- t_tuple([t_atom(), t_sup([t_atom('loaded'), t_atom('unloaded')])])];
-arg_types(erl_ddll, try_load, 3) ->
- [t_sup([t_atom(), t_string(), t_nonempty_list(t_sup([t_atom(), t_string()]))]),
- t_sup([t_atom(), t_string()]),
- t_list(t_sup([t_tuple([t_atom('driver_options'),
- t_list(t_atom('kill_ports'))]),
- t_tuple([t_atom('monitor'),
- t_sup([t_atom('pending_driver'),
- t_atom('pending')])]),
- t_tuple([t_atom('reload'),
- t_sup([t_atom('pending_driver'),
- t_atom('pending')])])]))];
-arg_types(erl_ddll, try_unload, 2) ->
- [t_sup([t_atom(), t_string(), t_nonempty_list(t_sup([t_atom(), t_string()]))]),
- t_list(t_sup([t_atom('kill_ports'),
- t_tuple([t_atom('monitor'),
- t_sup([t_atom('pending_driver'),
- t_atom('pending')])])]))];
%%------- erlang --------------------------------------------------------------
arg_types(erlang, '!', 2) ->
Pid = t_sup([t_pid(), t_port(), t_atom(),
@@ -3392,18 +2164,11 @@ arg_types(erlang, 'bsl', 2) ->
[t_integer(), t_integer()];
arg_types(erlang, 'bnot', 1) ->
[t_integer()];
+%% Guard bif, needs to be here.
arg_types(erlang, abs, 1) ->
[t_number()];
-arg_types(erlang, adler32, 1) ->
- [t_iodata()];
-arg_types(erlang, adler32, 2) ->
- [t_adler32(), t_iodata()];
-arg_types(erlang, adler32_combine, 3) ->
- [t_adler32(), t_adler32(), t_non_neg_integer()];
arg_types(erlang, append, 2) ->
arg_types(erlang, '++', 2);
-arg_types(erlang, append_element, 2) ->
- [t_tuple(), t_any()];
arg_types(erlang, apply, 2) ->
[t_sup(t_tuple([t_module(),
t_atom()]),
@@ -3411,164 +2176,58 @@ arg_types(erlang, apply, 2) ->
t_list()];
arg_types(erlang, apply, 3) ->
[t_sup(t_atom(), t_tuple()), t_atom(), t_list()];
-arg_types(erlang, atom_to_binary, 2) ->
- [t_atom(), t_encoding_a2b()];
-arg_types(erlang, atom_to_list, 1) ->
- [t_atom()];
+%% Guard bif, needs to be here.
arg_types(erlang, binary_part, 2) ->
[t_binary(), t_tuple([t_non_neg_integer(), t_integer()])];
+%% Guard bif, needs to be here.
arg_types(erlang, binary_part, 3) ->
[t_binary(), t_non_neg_integer(), t_integer()];
-arg_types(erlang, binary_to_atom, 2) ->
- [t_binary(), t_encoding_a2b()];
-arg_types(erlang, binary_to_existing_atom, 2) ->
- arg_types(erlang, binary_to_atom, 2);
-arg_types(erlang, binary_to_list, 1) ->
- [t_binary()];
-arg_types(erlang, binary_to_list, 3) ->
- [t_binary(), t_pos_integer(), t_pos_integer()]; % I want fixnum, but cannot
-arg_types(erlang, binary_to_term, 1) ->
- [t_binary()];
-arg_types(erlang, binary_to_term, 2) ->
- [t_binary(), t_list(t_atom('safe'))];
-arg_types(erlang, bitsize, 1) -> % XXX: TAKE OUT
- arg_types(erlang, bit_size, 1);
+%% Guard bif, needs to be here.
arg_types(erlang, bit_size, 1) ->
[t_bitstr()];
-arg_types(erlang, bitstr_to_list, 1) -> % XXX: TAKE OUT
- arg_types(erlang, bitstring_to_list, 1);
-arg_types(erlang, bitstring_to_list, 1) ->
- [t_bitstr()];
-arg_types(erlang, bump_reductions, 1) ->
- [t_pos_fixnum()];
+%% Guard bif, needs to be here.
arg_types(erlang, byte_size, 1) ->
[t_binary()];
-arg_types(erlang, call_on_load_function, 1) ->
- [t_atom()];
-arg_types(erlang, cancel_timer, 1) ->
- [t_reference()];
-arg_types(erlang, check_old_code, 1) ->
- [t_atom()];
-arg_types(erlang, check_process_code, 2) ->
- [t_pid(), t_atom()];
-arg_types(erlang, crc32, 1) ->
- [t_iodata()];
-arg_types(erlang, crc32, 2) ->
- [t_crc32(), t_iodata()];
-arg_types(erlang, crc32_combine, 3) ->
- [t_crc32(), t_crc32(), t_non_neg_integer()];
-arg_types(erlang, date, 0) ->
- [];
-arg_types(erlang, decode_packet, 3) ->
- [t_decode_packet_type(), t_binary(), t_list(t_decode_packet_option())];
-arg_types(erlang, delete_module, 1) ->
- [t_atom()];
-arg_types(erlang, demonitor, 1) ->
- [t_reference()];
-arg_types(erlang, demonitor, 2) ->
- [t_reference(), t_list(t_atoms(['flush', 'info']))];
arg_types(erlang, disconnect_node, 1) ->
[t_node()];
-arg_types(erlang, display, 1) ->
- [t_any()];
-arg_types(erlang, display_nl, 0) ->
- [];
-arg_types(erlang, display_string, 1) ->
- [t_string()];
-arg_types(erlang, dist_exit, 3) ->
- [t_pid(), t_dist_exit(), t_sup(t_pid(), t_port())];
-arg_types(erlang, element, 2) ->
- [t_pos_fixnum(), t_tuple()];
-arg_types(erlang, erase, 0) ->
+arg_types(erlang, halt, 0) ->
[];
-arg_types(erlang, erase, 1) ->
- [t_any()];
+arg_types(erlang, halt, 1) ->
+ [t_sup([t_non_neg_fixnum(), t_atom('abort'), t_string()])];
+arg_types(erlang, halt, 2) ->
+ [t_sup([t_non_neg_fixnum(), t_atom('abort'), t_string()]),
+ t_list(t_tuple([t_atom('flush'), t_boolean()]))];
arg_types(erlang, error, 1) ->
[t_any()];
arg_types(erlang, error, 2) ->
[t_any(), t_list()];
arg_types(erlang, exit, 1) ->
[t_any()];
-arg_types(erlang, exit, 2) ->
- [t_sup(t_pid(), t_port()), t_any()];
-arg_types(erlang, external_size, 1) ->
- [t_any()]; % takes any term as input
-arg_types(erlang, external_size, 2) ->
- [t_any(), t_list()]; % takes any term as input and a list of options
-arg_types(erlang, finish_after_on_load, 2) ->
- [t_atom(), t_boolean()];
+%% Guard bif, needs to be here.
+arg_types(erlang, element, 2) ->
+ [t_pos_fixnum(), t_tuple()];
+%% Guard bif, needs to be here.
arg_types(erlang, float, 1) ->
[t_number()];
-arg_types(erlang, float_to_list, 1) ->
- [t_float()];
-arg_types(erlang, function_exported, 3) ->
- [t_atom(), t_atom(), t_arity()];
arg_types(erlang, fun_info, 1) ->
[t_fun()];
-arg_types(erlang, fun_info, 2) ->
- [t_fun(), t_atom()];
-arg_types(erlang, fun_to_list, 1) ->
- [t_fun()];
-arg_types(erlang, garbage_collect, 0) ->
- [];
-arg_types(erlang, garbage_collect, 1) ->
- [t_pid()];
-arg_types(erlang, garbage_collect_message_area, 0) ->
- [];
-arg_types(erlang, get, 0) ->
- [];
-arg_types(erlang, get, 1) ->
- [t_any()];
arg_types(erlang, get_cookie, 0) ->
[];
-arg_types(erlang, get_keys, 1) ->
- [t_any()];
-arg_types(erlang, get_stacktrace, 0) ->
- [];
-arg_types(erlang, get_module_info, 1) ->
- [t_atom()];
-arg_types(erlang, get_module_info, 2) ->
- [t_atom(), t_module_info_2()];
-arg_types(erlang, group_leader, 0) ->
- [];
-arg_types(erlang, group_leader, 2) ->
- [t_pid(), t_pid()];
-arg_types(erlang, halt, 0) ->
- [];
-arg_types(erlang, halt, 1) ->
- [t_sup(t_non_neg_fixnum(), t_string())];
-arg_types(erlang, hash, 2) ->
- [t_any(), t_integer()];
+%% Guard bif, needs to be here.
arg_types(erlang, hd, 1) ->
[t_cons()];
-arg_types(erlang, hibernate, 3) ->
- [t_atom(), t_atom(), t_list()];
arg_types(erlang, info, 1) ->
arg_types(erlang, system_info, 1); % alias
-arg_types(erlang, iolist_to_binary, 1) ->
- [t_sup(t_iolist(), t_binary())];
-arg_types(erlang, iolist_size, 1) ->
- [t_sup(t_iolist(), t_binary())];
-arg_types(erlang, integer_to_list, 1) ->
- [t_integer()];
arg_types(erlang, integer_to_list, 2) ->
[t_integer(), t_from_range(2, 36)];
-arg_types(erlang, is_alive, 0) ->
- [];
arg_types(erlang, is_atom, 1) ->
[t_any()];
arg_types(erlang, is_binary, 1) ->
[t_any()];
-arg_types(erlang, is_bitstr, 1) -> % XXX: TAKE OUT
- arg_types(erlang, is_bitstring, 1);
arg_types(erlang, is_bitstring, 1) ->
[t_any()];
arg_types(erlang, is_boolean, 1) ->
[t_any()];
-arg_types(erlang, is_builtin, 3) ->
- [t_atom(), t_atom(), t_arity()];
-arg_types(erlang, is_constant, 1) ->
- [t_any()];
arg_types(erlang, is_float, 1) ->
[t_any()];
arg_types(erlang, is_function, 1) ->
@@ -3585,8 +2244,6 @@ arg_types(erlang, is_pid, 1) ->
[t_any()];
arg_types(erlang, is_port, 1) ->
[t_any()];
-arg_types(erlang, is_process_alive, 1) ->
- [t_pid()];
arg_types(erlang, is_record, 2) ->
[t_any(), t_atom()];
arg_types(erlang, is_record, 3) ->
@@ -3595,542 +2252,91 @@ arg_types(erlang, is_reference, 1) ->
[t_any()];
arg_types(erlang, is_tuple, 1) ->
[t_any()];
+%% Guard bif, needs to be here.
arg_types(erlang, length, 1) ->
[t_list()];
-arg_types(erlang, link, 1) ->
- [t_sup(t_pid(), t_port())];
-arg_types(erlang, list_to_atom, 1) ->
- [t_string()];
-arg_types(erlang, list_to_binary, 1) ->
- [t_iolist()];
-arg_types(erlang, list_to_bitstr, 1) -> % XXX: TAKE OUT
- arg_types(erlang, list_to_bitstring, 1);
-arg_types(erlang, list_to_bitstring, 1) ->
- [t_bitstrlist()];
-arg_types(erlang, list_to_existing_atom, 1) ->
- [t_string()];
-arg_types(erlang, list_to_float, 1) ->
- [t_list(t_byte())];
-arg_types(erlang, list_to_integer, 1) ->
- [t_list(t_byte())];
arg_types(erlang, list_to_integer, 2) ->
[t_list(t_byte()), t_from_range(2, 36)];
-arg_types(erlang, list_to_pid, 1) ->
- [t_string()];
-arg_types(erlang, list_to_tuple, 1) ->
- [t_list()];
-arg_types(erlang, load_module, 2) ->
- [t_atom(), t_binary()];
-arg_types(erlang, load_nif, 2) ->
- [t_string(), t_any()];
-arg_types(erlang, loaded, 0) ->
- [];
-arg_types(erlang, localtime, 0) ->
- [];
-arg_types(erlang, localtime_to_universaltime, 1) ->
- [t_tuple([t_date(), t_time()])];
-arg_types(erlang, localtime_to_universaltime, 2) ->
- arg_types(erlang, localtime_to_universaltime, 1) ++
- [t_sup(t_boolean(), t_atom('undefined'))];
-arg_types(erlang, make_fun, 3) ->
- [t_atom(), t_atom(), t_arity()];
-arg_types(erlang, make_ref, 0) ->
- [];
arg_types(erlang, make_tuple, 2) ->
[t_non_neg_fixnum(), t_any()]; % the value 0 is OK as first argument
arg_types(erlang, make_tuple, 3) ->
[t_non_neg_fixnum(), t_any(), t_list(t_tuple([t_pos_integer(), t_any()]))];
-arg_types(erlang, match_spec_test, 3) ->
- [t_sup(t_list(), t_tuple()),
- t_any(),
- t_sup(t_atom('table'), t_atom('trace'))];
-arg_types(erlang, md5, 1) ->
- [t_sup(t_iolist(), t_binary())];
-arg_types(erlang, md5_final, 1) ->
- [t_binary()];
-arg_types(erlang, md5_init, 0) ->
- [];
-arg_types(erlang, md5_update, 2) ->
- [t_binary(), t_sup(t_iolist(), t_binary())];
arg_types(erlang, memory, 0) ->
[];
-arg_types(erlang, memory, 1) ->
- Arg = t_atoms(['total', 'processes', 'processes_used', 'system',
- 'atom', 'atom_used', 'binary', 'code', 'ets',
- 'maximum']),
- [t_sup(Arg, t_list(Arg))];
-arg_types(erlang, module_loaded, 1) ->
- [t_atom()];
-arg_types(erlang, monitor, 2) ->
- [t_atom(), t_sup([t_pid(), t_atom(), t_tuple([t_atom(), t_node()])])];
-arg_types(erlang, monitor_node, 2) ->
- [t_node(), t_boolean()];
-arg_types(erlang, monitor_node, 3) ->
- [t_node(), t_boolean(), t_list(t_atom('allow_passive_connect'))];
arg_types(erlang, nif_error, 1) ->
[t_any()];
arg_types(erlang, nif_error, 2) ->
[t_any(), t_list()];
+%% Guard bif, needs to be here.
arg_types(erlang, node, 0) ->
[];
+%% Guard bif, needs to be here.
arg_types(erlang, node, 1) ->
[t_identifier()];
arg_types(erlang, nodes, 0) ->
[];
-arg_types(erlang, nodes, 1) ->
- NodesArg = t_atoms(['visible', 'hidden', 'connected', 'this', 'known']),
- [t_sup(NodesArg, t_list(NodesArg))];
-arg_types(erlang, now, 0) ->
- [];
-arg_types(erlang, open_port, 2) ->
- ArgT = t_sup(t_unicode_string(), t_binary()),
- [t_sup(t_atom(), t_sup([t_tuple([t_atom('spawn'), t_string()]),
- t_tuple([t_atom('spawn_driver'), t_string()]),
- t_tuple([t_atom('spawn_executable'), ArgT]),
- t_tuple([t_atom('fd'), t_integer(), t_integer()])])),
- t_list(t_sup(t_sup([t_atom('stream'),
- t_atom('exit_status'),
- t_atom('use_stdio'),
- t_atom('nouse_stdio'),
- t_atom('stderr_to_stdout'),
- t_atom('in'),
- t_atom('out'),
- t_atom('binary'),
- t_atom('eof'),
- t_atom('hide')]),
- t_sup([t_tuple([t_atom('packet'), t_integer()]),
- t_tuple([t_atom('line'), t_integer()]),
- t_tuple([t_atom('cd'), t_string()]),
- t_tuple([t_atom('env'), t_list(t_tuple(2))]), % XXX: More
- t_tuple([t_atom('args'), t_list(ArgT)]),
- t_tuple([t_atom('arg0'), ArgT])])))];
-arg_types(erlang, phash, 2) ->
- [t_any(), t_pos_integer()];
-arg_types(erlang, phash2, 1) ->
- [t_any()];
-arg_types(erlang, phash2, 2) ->
- [t_any(), t_pos_integer()];
-arg_types(erlang, pid_to_list, 1) ->
- [t_pid()];
arg_types(erlang, port_call, 2) ->
[t_sup(t_port(), t_atom()), t_any()];
arg_types(erlang, port_call, 3) ->
[t_sup(t_port(), t_atom()), t_integer(), t_any()];
-arg_types(erlang, port_close, 1) ->
- [t_sup(t_port(), t_atom())];
-arg_types(erlang, port_command, 2) ->
- [t_sup(t_port(), t_atom()), t_sup(t_iolist(), t_binary())];
-arg_types(erlang, port_command, 3) ->
- [t_sup(t_port(), t_atom()),
- t_sup(t_iolist(), t_binary()),
- t_list(t_atoms(['force', 'nosuspend']))];
-arg_types(erlang, port_connect, 2) ->
- [t_sup(t_port(), t_atom()), t_pid()];
-arg_types(erlang, port_control, 3) ->
- [t_sup(t_port(), t_atom()), t_integer(), t_sup(t_iolist(), t_binary())];
-arg_types(erlang, port_get_data, 1) ->
- [t_sup(t_port(), t_atom())];
arg_types(erlang, port_info, 1) ->
[t_sup(t_port(), t_atom())];
arg_types(erlang, port_info, 2) ->
[t_sup(t_port(), t_atom()),
t_atoms(['registered_name', 'id', 'connected',
- 'links', 'name', 'input', 'output'])];
-arg_types(erlang, port_to_list, 1) ->
- [t_port()];
-arg_types(erlang, ports, 0) ->
- [];
-arg_types(erlang, port_set_data, 2) ->
- [t_sup(t_port(), t_atom()), t_any()];
-arg_types(erlang, pre_loaded, 0) ->
- [];
-arg_types(erlang, process_display, 2) ->
- [t_pid(), t_atom('backtrace')];
-arg_types(erlang, process_flag, 2) ->
- [t_sup([t_atom('trap_exit'), t_atom('error_handler'),
- t_atom('min_heap_size'), t_atom('priority'), t_atom('save_calls'),
- t_atom('scheduler'), % undocumented
- t_atom('monitor_nodes'), % undocumented
- t_tuple([t_atom('monitor_nodes'), t_list()])]), % undocumented
- t_sup([t_boolean(), t_atom(), t_non_neg_integer()])];
-arg_types(erlang, process_flag, 3) ->
- [t_pid(), t_atom('save_calls'), t_non_neg_integer()];
-arg_types(erlang, process_info, 1) ->
- [t_pid()];
-arg_types(erlang, process_info, 2) ->
- [t_pid(), t_pinfo()];
-arg_types(erlang, processes, 0) ->
- [];
-arg_types(erlang, purge_module, 1) ->
- [t_atom()];
-arg_types(erlang, put, 2) ->
- [t_any(), t_any()];
-arg_types(erlang, raise, 3) ->
- OldStyleType = t_list(t_tuple([t_atom(), t_atom(),
- t_sup([t_arity(), t_list()])])),
- NewStyleType = type(erlang, get_stacktrace, 0, []),
- [t_raise_errorclass(), t_any(), t_sup(OldStyleType, NewStyleType)];
-arg_types(erlang, read_timer, 1) ->
- [t_reference()];
-arg_types(erlang, ref_to_list, 1) ->
- [t_reference()];
-arg_types(erlang, register, 2) ->
- [t_atom(), t_sup(t_port(), t_pid())];
-arg_types(erlang, registered, 0) ->
- [];
-arg_types(erlang, resume_process, 1) ->
- [t_pid()]; % intended for debugging only
+ 'links', 'name', 'input', 'output', 'os_pid'])];
+%% Guard bif, needs to be here.
arg_types(erlang, round, 1) ->
[t_number()];
-arg_types(erlang, posixtime_to_universaltime, 1) ->
- [t_integer()];
+%% Guard bif, needs to be here.
arg_types(erlang, self, 0) ->
[];
-arg_types(erlang, send, 2) ->
- arg_types(erlang, '!', 2); % alias
-arg_types(erlang, send, 3) ->
- arg_types(erlang, send, 2) ++ [t_list(t_sendoptions())];
-arg_types(erlang, send_after, 3) ->
- [t_non_neg_integer(), t_sup(t_pid(), t_atom()), t_any()];
-arg_types(erlang, seq_trace, 2) ->
- [t_atom(), t_sup([t_boolean(), t_tuple([t_fixnum(), t_fixnum()]), t_fixnum(), t_nil()])];
-arg_types(erlang, seq_trace_info, 1) ->
- [t_seq_trace_info()];
-arg_types(erlang, seq_trace_print, 1) ->
- [t_any()];
-arg_types(erlang, seq_trace_print, 2) ->
- [t_sup(t_atom(), t_fixnum()), t_any()];
arg_types(erlang, set_cookie, 2) ->
[t_node(), t_atom()];
arg_types(erlang, setelement, 3) ->
[t_pos_integer(), t_tuple(), t_any()];
-arg_types(erlang, setnode, 2) ->
- [t_atom(), t_integer()];
-arg_types(erlang, setnode, 3) ->
- [t_atom(), t_port(), t_tuple(4)];
+%% Guard bif, needs to be here.
arg_types(erlang, size, 1) ->
[t_sup(t_tuple(), t_binary())];
arg_types(erlang, spawn, 1) -> %% TODO: Tuple?
[t_fun()];
arg_types(erlang, spawn, 2) -> %% TODO: Tuple?
[t_node(), t_fun()];
-arg_types(erlang, spawn, 3) -> %% TODO: Tuple?
- [t_atom(), t_atom(), t_list()];
arg_types(erlang, spawn, 4) -> %% TODO: Tuple?
[t_node(), t_atom(), t_atom(), t_list()];
arg_types(erlang, spawn_link, 1) ->
arg_types(erlang, spawn, 1); % same
arg_types(erlang, spawn_link, 2) ->
arg_types(erlang, spawn, 2); % same
-arg_types(erlang, spawn_link, 3) ->
- arg_types(erlang, spawn, 3); % same
arg_types(erlang, spawn_link, 4) ->
arg_types(erlang, spawn, 4); % same
-arg_types(erlang, spawn_opt, 1) ->
- [t_tuple([t_atom(), t_atom(), t_list(), t_list(t_spawn_options())])];
-arg_types(erlang, spawn_opt, 2) ->
- [t_fun(), t_list(t_spawn_options())];
-arg_types(erlang, spawn_opt, 3) ->
- [t_atom(), t_fun(), t_list(t_spawn_options())];
-arg_types(erlang, spawn_opt, 4) ->
- [t_node(), t_atom(), t_list(), t_list(t_spawn_options())];
-arg_types(erlang, split_binary, 2) ->
- [t_binary(), t_non_neg_integer()];
-arg_types(erlang, start_timer, 3) ->
- [t_non_neg_integer(), t_sup(t_pid(), t_atom()), t_any()];
-arg_types(erlang, statistics, 1) ->
- [t_sup([t_atom('context_switches'),
- t_atom('exact_reductions'),
- t_atom('garbage_collection'),
- t_atom('io'),
- t_atom('reductions'),
- t_atom('run_queue'),
- t_atom('runtime'),
- t_atom('wall_clock')])];
arg_types(erlang, subtract, 2) ->
arg_types(erlang, '--', 2);
arg_types(erlang, suspend_process, 1) ->
[t_pid()];
-arg_types(erlang, suspend_process, 2) ->
- [t_pid(), t_list(t_sup([t_atom('unless_suspending'),
- t_atom('asynchronous')]))];
-arg_types(erlang, system_flag, 2) ->
- [t_sup([t_atom('backtrace_depth'),
- t_atom('cpu_topology'),
- t_atom('debug_flags'), % undocumented
- t_atom('display_items'), % undocumented
- t_atom('fullsweep_after'),
- t_atom('min_heap_size'),
- t_atom('multi_scheduling'),
- t_atom('schedulers_online'),
- t_atom('scheduler_bind_type'),
- %% Undocumented; used to implement (the documented) seq_trace module.
- t_atom('sequential_tracer'),
- t_atom('trace_control_word'),
- %% 'internal_cpu_topology' is an undocumented internal feature.
- t_atom('internal_cpu_topology'),
- t_integer()]),
- t_sup([t_integer(),
- %% 'cpu_topology'
- t_system_cpu_topology(),
- %% 'scheduler_bind_type'
- t_scheduler_bind_type_args(),
- %% Undocumented: the following is for 'debug_flags' that
- %% takes any erlang term as flags and currently ignores it.
- %% t_any(), % commented out since it destroys the type signature
- %%
- %% Again undocumented; the following are for 'sequential_tracer'
- t_sequential_tracer(),
- %% The following two are for 'multi_scheduling'
- t_atom('block'),
- t_atom('unblock'),
- %% The following is for 'internal_cpu_topology'
- t_internal_cpu_topology()])];
arg_types(erlang, system_info, 1) ->
[t_sup([t_atom(), % documented
t_tuple([t_atom(), t_any()]), % documented
t_tuple([t_atom(), t_atom(), t_any()]),
t_tuple([t_atom(allocator_sizes), t_reference(), t_any()])])];
-arg_types(erlang, system_monitor, 0) ->
- [];
-arg_types(erlang, system_monitor, 1) ->
- [t_system_monitor_settings()];
-arg_types(erlang, system_monitor, 2) ->
- [t_pid(), t_system_monitor_options()];
-arg_types(erlang, system_profile, 0) ->
- [];
-arg_types(erlang, system_profile, 2) ->
- [t_sup([t_pid(), t_port(), t_atom('undefined')]),
- t_system_profile_options()];
-arg_types(erlang, term_to_binary, 1) ->
- [t_any()];
-arg_types(erlang, term_to_binary, 2) ->
- [t_any(), t_list(t_sup([t_atom('compressed'),
- t_tuple([t_atom('compressed'), t_from_range(0, 9)]),
- t_tuple([t_atom('minor_version'), t_integers([0, 1])])]))];
arg_types(erlang, throw, 1) ->
[t_any()];
-arg_types(erlang, time, 0) ->
- [];
+%% Guard bif, needs to be here.
arg_types(erlang, tl, 1) ->
[t_cons()];
-arg_types(erlang, trace, 3) ->
- [t_sup(t_pid(), t_sup([t_atom('existing'), t_atom('new'), t_atom('all')])),
- t_boolean(),
- t_list(t_sup(t_atom(), t_tuple(2)))];
-arg_types(erlang, trace_delivered, 1) ->
- [t_sup(t_pid(), t_atom('all'))];
-arg_types(erlang, trace_info, 2) ->
- [t_sup([%% the following two get info about a PID
- t_pid(), t_atom('new'),
- %% while the following two get info about a func
- t_mfa(), t_atom('on_load')]),
- t_sup([%% the following are items about a PID
- t_atom('flags'), t_atom('tracer'),
- %% while the following are items about a func
- t_atom('traced'), t_atom('match_spec'), t_atom('meta'),
- t_atom('meta_match_spec'), t_atom('call_count'),
- t_atom('call_time'), t_atom('all')])];
-arg_types(erlang, trace_pattern, 2) ->
- [t_sup(t_tuple([t_atom(), t_atom(), t_sup(t_arity(), t_atom('_'))]),
- t_atom('on_load')),
- t_sup([t_boolean(), t_list(), t_atom('restart'), t_atom('pause')])];
-arg_types(erlang, trace_pattern, 3) ->
- arg_types(erlang, trace_pattern, 2) ++
- [t_list(t_sup([t_atom('global'), t_atom('local'),
- t_atom('meta'), t_tuple([t_atom('meta'), t_pid()]),
- t_atom('call_count'), t_atom('call_time')]))];
+%% Guard bif, needs to be here.
arg_types(erlang, trunc, 1) ->
[t_number()];
+%% Guard bif, needs to be here.
arg_types(erlang, tuple_size, 1) ->
[t_tuple()];
arg_types(erlang, tuple_to_list, 1) ->
[t_tuple()];
-arg_types(erlang, universaltime, 0) ->
- [];
-arg_types(erlang, universaltime_to_localtime, 1) ->
- [t_tuple([t_date(), t_time()])];
-arg_types(erlang, universaltime_to_posixtime, 1) ->
- [t_tuple([t_date(), t_time()])];
-arg_types(erlang, unlink, 1) ->
- [t_sup(t_pid(), t_port())];
-arg_types(erlang, unregister, 1) ->
- [t_atom()];
-arg_types(erlang, whereis, 1) ->
- [t_atom()];
arg_types(erlang, yield, 0) ->
[];
-%%------- erl_prim_loader -----------------------------------------------------
-arg_types(erl_prim_loader, get_file, 1) ->
- [t_sup(t_atom(), t_string())];
-arg_types(erl_prim_loader, get_path, 0) ->
- [];
-arg_types(erl_prim_loader, set_path, 1) ->
- [t_list(t_string())];
-%%------- error_logger --------------------------------------------------------
-arg_types(error_logger, warning_map, 0) ->
- [];
-%%------- erts_debug ----------------------------------------------------------
-arg_types(erts_debug, breakpoint, 2) ->
- [t_tuple([t_atom(), t_atom(), t_sup(t_integer(), t_atom('_'))]), t_boolean()];
-arg_types(erts_debug, disassemble, 1) ->
- [t_sup(t_mfa(), t_integer())];
-arg_types(erts_debug, display, 1) ->
- [t_any()];
-arg_types(erts_debug, dist_ext_to_term, 2) ->
- [t_tuple(), t_binary()];
-arg_types(erts_debug, dump_monitors, 1) ->
- [t_sup([t_pid(),t_atom()])];
-arg_types(erts_debug, dump_links, 1) ->
- [t_sup([t_pid(),t_atom(),t_port()])];
-arg_types(erts_debug, flat_size, 1) ->
- [t_any()];
-arg_types(erts_debug, get_internal_state, 1) ->
- [t_any()];
-arg_types(erts_debug, instructions, 0) ->
- [];
-arg_types(erts_debug, lock_counters, 1) ->
- [t_sup([t_atom(enabled),
- t_atom(info),
- t_atom(clear),
- t_tuple([t_atom(copy_save), t_boolean()]),
- t_tuple([t_atom(process_locks), t_boolean()])])];
-arg_types(erts_debug, same, 2) ->
- [t_any(), t_any()];
-arg_types(erts_debug, set_internal_state, 2) ->
- [t_any(), t_any()];
%%------- ets -----------------------------------------------------------------
-arg_types(ets, all, 0) ->
- [];
-arg_types(ets, delete, 1) ->
- [t_tab()];
-arg_types(ets, delete, 2) ->
- [t_tab(), t_any()];
-arg_types(ets, delete_all_objects, 1) ->
- [t_tab()];
-arg_types(ets, delete_object, 2) ->
- [t_tab(), t_tuple()];
-arg_types(ets, first, 1) ->
- [t_tab()];
-arg_types(ets, give_away, 3) ->
- [t_tab(), t_pid(), t_any()];
-arg_types(ets, info, 1) ->
- [t_tab()];
-arg_types(ets, info, 2) ->
- [t_tab(), t_ets_info_items()];
-arg_types(ets, insert, 2) ->
- [t_tab(), t_sup(t_tuple(), t_list(t_tuple()))];
-arg_types(ets, insert_new, 2) ->
- [t_tab(), t_sup(t_tuple(), t_list(t_tuple()))];
-arg_types(ets, is_compiled_ms, 1) ->
- [t_any()];
-arg_types(ets, last, 1) ->
- arg_types(ets, first, 1);
-arg_types(ets, lookup, 2) ->
- [t_tab(), t_any()];
-arg_types(ets, lookup_element, 3) ->
- [t_tab(), t_any(), t_pos_fixnum()];
-arg_types(ets, match, 1) ->
- [t_any()];
-arg_types(ets, match, 2) ->
- [t_tab(), t_match_pattern()];
-arg_types(ets, match, 3) ->
- [t_tab(), t_match_pattern(), t_pos_fixnum()];
-arg_types(ets, match_object, 1) ->
- arg_types(ets, match, 1);
-arg_types(ets, match_object, 2) ->
- arg_types(ets, match, 2);
-arg_types(ets, match_object, 3) ->
- arg_types(ets, match, 3);
-arg_types(ets, match_spec_compile, 1) ->
- [t_matchspecs()];
-arg_types(ets, match_spec_run_r, 3) ->
- [t_list(t_tuple()),t_matchspecs(), t_list()];
-arg_types(ets, member, 2) ->
- [t_tab(), t_any()];
-arg_types(ets, new, 2) ->
- [t_atom(), t_ets_new_options()];
-arg_types(ets, next, 2) ->
- [t_tab(), t_any()];
-arg_types(ets, prev, 2) ->
- [t_tab(), t_any()];
arg_types(ets, rename, 2) ->
[t_atom(), t_atom()];
-arg_types(ets, safe_fixtable, 2) ->
- [t_tab(), t_boolean()];
-arg_types(ets, select, 1) ->
- [t_any()];
-arg_types(ets, select, 2) ->
- [t_tab(), t_matchspecs()];
-arg_types(ets, select, 3) ->
- [t_tab(), t_matchspecs(), t_pos_fixnum()];
-arg_types(ets, select_count, 2) ->
- [t_tab(), t_matchspecs()];
-arg_types(ets, select_delete, 2) ->
- [t_tab(), t_matchspecs()];
-arg_types(ets, select_reverse, 1) ->
- arg_types(ets, select, 1);
-arg_types(ets, select_reverse, 2) ->
- arg_types(ets, select, 2);
-arg_types(ets, select_reverse, 3) ->
- arg_types(ets, select, 3);
-arg_types(ets, slot, 2) ->
- [t_tab(), t_non_neg_fixnum()]; % 2nd arg can be 0
-arg_types(ets, setopts, 2) ->
- Opt = t_sup([t_tuple([t_atom('heir'), t_pid(), t_any()]),
- t_tuple([t_atom('heir'), t_atom('none')]),
- t_tuple([t_atom('protection'),
- t_sup([t_atom('protected'),
- t_atom('private'),
- t_atom('public')])])]),
- [t_tab(), t_sup(Opt, t_list(Opt))];
-arg_types(ets, update_counter, 3) ->
- Int = t_integer(),
- UpdateOp = t_sup(t_tuple([Int, Int]), t_tuple([Int, Int, Int, Int])),
- [t_tab(), t_any(), t_sup([UpdateOp, t_list(UpdateOp), Int])];
-arg_types(ets, update_element, 3) ->
- PosValue = t_tuple([t_integer(), t_any()]),
- [t_tab(), t_any(), t_sup(PosValue, t_list(PosValue))];
-%%------- file ----------------------------------------------------------------
-arg_types(file, native_name_encoding, 0) ->
- [];
-%%-- prim_file ----------------------------------------------------------------
-arg_types(prim_file, internal_name2native, 1) ->
- [t_prim_file_name()];
-arg_types(prim_file, internal_native2name, 1) ->
- [t_binary()];
-arg_types(prim_file, internal_normalize_utf8, 1) ->
- [t_binary()];
-%%------- gen_tcp -------------------------------------------------------------
-arg_types(gen_tcp, accept, 1) ->
- [t_socket()];
-arg_types(gen_tcp, accept, 2) ->
- [t_socket(), t_timeout()];
-arg_types(gen_tcp, connect, 3) ->
- [t_gen_tcp_address(), t_gen_tcp_port(), t_list(t_gen_tcp_connect_option())];
-arg_types(gen_tcp, connect, 4) ->
- arg_types(gen_tcp, connect, 3) ++ [t_timeout()];
-arg_types(gen_tcp, listen, 2) ->
- [t_gen_tcp_port(), t_list(t_gen_tcp_listen_option())];
-arg_types(gen_tcp, recv, 2) ->
- [t_socket(), t_non_neg_integer()];
-arg_types(gen_tcp, recv, 3) ->
- arg_types(gen_tcp, recv, 2) ++ [t_timeout()];
-arg_types(gen_tcp, send, 2) ->
- [t_socket(), t_packet()];
-arg_types(gen_tcp, shutdown, 2) ->
- [t_socket(), t_sup([t_atom('read'), t_atom('write'), t_atom('read_write')])];
-%%------- gen_udp -------------------------------------------------------------
-arg_types(gen_udp, open, 1) ->
- [t_gen_tcp_port()];
-arg_types(gen_udp, open, 2) ->
- [t_gen_tcp_port(), t_list(t_gen_udp_connect_option())];
-arg_types(gen_udp, recv, 2) ->
- arg_types(gen_tcp, recv, 2);
-arg_types(gen_udp, recv, 3) ->
- arg_types(gen_tcp, recv, 3);
-arg_types(gen_udp, send, 4) ->
- [t_socket(), t_gen_tcp_address(), t_gen_tcp_port(), t_packet()];
%%------- hipe_bifs -----------------------------------------------------------
arg_types(hipe_bifs, add_ref, 2) ->
[t_mfa(), t_tuple([t_mfa(),
@@ -4177,7 +2383,7 @@ arg_types(hipe_bifs, check_crc, 1) ->
arg_types(hipe_bifs, enter_code, 2) ->
[t_binary(), t_sup(t_nil(), t_tuple())];
arg_types(hipe_bifs, enter_sdesc, 1) ->
- [t_tuple([t_integer(), t_integer(), t_integer(), t_integer(), t_integer()])];
+ [t_tuple([t_integer(), t_integer(), t_integer(), t_integer(), t_integer(), t_mfa()])];
arg_types(hipe_bifs, find_na_or_make_stub, 2) ->
[t_mfa(), t_boolean()];
arg_types(hipe_bifs, fun_to_address, 1) ->
@@ -4211,7 +2417,7 @@ arg_types(hipe_bifs, ref_get, 1) ->
arg_types(hipe_bifs, ref_set, 2) ->
[t_hiperef(), t_immediate()];
arg_types(hipe_bifs, remove_refs_from, 1) ->
- [t_mfa()];
+ [t_sup([t_mfa(), t_atom('all')])];
arg_types(hipe_bifs, set_funinfo_native_address, 3) ->
arg_types(hipe_bifs, set_native_address, 3);
arg_types(hipe_bifs, set_native_address, 3) ->
@@ -4228,28 +2434,6 @@ arg_types(hipe_bifs, write_u32, 2) ->
[t_integer(), t_integer()];
arg_types(hipe_bifs, write_u64, 2) ->
[t_integer(), t_integer()];
-%%------- io ------------------------------------------------------------------
-arg_types(io, format, 1) ->
- [t_io_format_string()];
-arg_types(io, format, 2) ->
- [t_io_format_string(), t_list()];
-arg_types(io, format, 3) ->
- [t_io_device(), t_io_format_string(), t_list()];
-arg_types(io, fwrite, 1) ->
- arg_types(io, format, 1);
-arg_types(io, fwrite, 2) ->
- arg_types(io, format, 2);
-arg_types(io, fwrite, 3) ->
- arg_types(io, format, 3);
-arg_types(io, put_chars, 1) ->
- [t_iodata()];
-arg_types(io, put_chars, 2) ->
- [t_io_device(), t_iodata()];
-%%------- io_lib --------------------------------------------------------------
-arg_types(io_lib, format, 2) ->
- arg_types(io, format, 2);
-arg_types(io_lib, fwrite, 2) ->
- arg_types(io_lib, format, 2);
%%------- lists ---------------------------------------------------------------
arg_types(lists, all, 2) ->
[t_fun([t_any()], t_boolean()), t_list()];
@@ -4321,10 +2505,6 @@ arg_types(lists, reverse, 1) ->
[t_list()];
arg_types(lists, reverse, 2) ->
[t_list(), t_any()];
-arg_types(lists, seq, 2) ->
- [t_integer(), t_integer()];
-arg_types(lists, seq, 3) ->
- [t_integer(), t_integer(), t_integer()];
arg_types(lists, sort, 1) ->
[t_list()];
arg_types(lists, sort, 2) ->
@@ -4353,97 +2533,12 @@ 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()];
-%%------- math ----------------------------------------------------------------
-arg_types(math, acos, 1) ->
- [t_number()];
-arg_types(math, acosh, 1) ->
- [t_number()];
-arg_types(math, asin, 1) ->
- [t_number()];
-arg_types(math, asinh, 1) ->
- [t_number()];
-arg_types(math, atan, 1) ->
- [t_number()];
-arg_types(math, atan2, 2) ->
- [t_number(), t_number()];
-arg_types(math, atanh, 1) ->
- [t_number()];
-arg_types(math, cos, 1) ->
- [t_number()];
-arg_types(math, cosh, 1) ->
- [t_number()];
-arg_types(math, erf, 1) ->
- [t_number()];
-arg_types(math, erfc, 1) ->
- [t_number()];
-arg_types(math, exp, 1) ->
- [t_number()];
-arg_types(math, log, 1) ->
- [t_number()];
-arg_types(math, log10, 1) ->
- [t_number()];
-arg_types(math, pi, 0) ->
- [];
-arg_types(math, pow, 2) ->
- [t_number(), t_number()];
-arg_types(math, sin, 1) ->
- [t_number()];
-arg_types(math, sinh, 1) ->
- [t_number()];
-arg_types(math, sqrt, 1) ->
- [t_number()];
-arg_types(math, tan, 1) ->
- [t_number()];
-arg_types(math, tanh, 1) ->
- [t_number()];
-%%-- net_kernel ---------------------------------------------------------------
-arg_types(net_kernel, dflag_unicode_io, 1) ->
- [t_pid()];
-%%------- ordsets -------------------------------------------------------------
-arg_types(ordsets, filter, 2) ->
- arg_types(lists, filter, 2);
-arg_types(ordsets, fold, 3) ->
- arg_types(lists, foldl, 3);
-%%------- os ------------------------------------------------------------------
-arg_types(os, getenv, 0) ->
- [];
-arg_types(os, getenv, 1) ->
- [t_string()];
-arg_types(os, getpid, 0) ->
- [];
-arg_types(os, putenv, 2) ->
- [t_string(), t_string()];
-arg_types(os, timestamp, 0) ->
- [];
-%%-- re -----------------------------------------------------------------------
-arg_types(re, compile, 1) ->
- [t_iodata()];
-arg_types(re, compile, 2) ->
- [t_sup(t_iodata(), t_charlist()), t_list(t_re_compile_option())];
-arg_types(re, run, 2) ->
- [t_sup(t_iodata(), t_charlist()), t_re_RE()];
-arg_types(re, run, 3) ->
- [t_sup(t_iodata(), t_charlist()), t_re_RE(), t_list(t_re_run_option())];
+
%%------- string --------------------------------------------------------------
arg_types(string, chars, 2) ->
[t_char(), t_non_neg_integer()];
arg_types(string, chars, 3) ->
[t_char(), t_non_neg_integer(), t_any()];
-arg_types(string, concat, 2) ->
- [t_string(), t_string()];
-arg_types(string, equal, 2) ->
- [t_string(), t_string()];
-arg_types(string, to_float, 1) ->
- [t_string()];
-arg_types(string, to_integer, 1) ->
- [t_string()];
-%%------- unicode -------------------------------------------------------------
-arg_types(unicode, characters_to_binary, 2) ->
- [t_ML(), t_encoding()];
-arg_types(unicode, characters_to_list, 2) ->
- [t_ML(), t_encoding()];
-arg_types(unicode, bin_is_7bit, 1) ->
- [t_binary()];
%%-----------------------------------------------------------------------------
arg_types(M, F, A) when is_atom(M), is_atom(F),
is_integer(A), 0 =< A, A =< 255 ->
@@ -4503,244 +2598,22 @@ check_fun_application(Fun, Args) ->
%% =====================================================================
-%% These are basic types that should probably be moved to erl_types
-%% =====================================================================
-
-t_socket() -> t_port(). % alias
-
-t_ip_address() ->
- T_int16 = t_from_range(0, 16#FFFF),
- t_sup(t_tuple([t_byte(), t_byte(), t_byte(), t_byte()]),
- t_tuple([T_int16, T_int16, T_int16, T_int16,
- T_int16, T_int16, T_int16, T_int16])).
-
-%% =====================================================================
%% Some basic types used in various parts of the system
%% =====================================================================
-t_date() ->
- t_tuple([t_pos_fixnum(), t_pos_fixnum(), t_pos_fixnum()]).
-
-t_time() ->
- t_tuple([t_non_neg_fixnum(), t_non_neg_fixnum(), t_non_neg_fixnum()]).
-
-t_timestamp() ->
- t_tuple([t_non_neg_fixnum(), t_non_neg_fixnum(), t_non_neg_fixnum()]).
-
-t_packet() ->
- t_sup([t_binary(), t_iolist(), t_httppacket()]).
-
-t_httppacket() ->
- t_sup([t_HttpRequest(), t_HttpResponse(),
- t_HttpHeader(), t_atom('http_eoh'), t_HttpError()]).
-
t_endian() ->
t_sup(t_atom('big'), t_atom('little')).
%% =====================================================================
-%% HTTP types documented in R12B-4
-%% =====================================================================
-
-t_HttpRequest() ->
- t_tuple([t_atom('http_request'), t_HttpMethod(), t_HttpUri(), t_HttpVersion()]).
-
-t_HttpResponse() ->
- t_tuple([t_atom('http_response'), t_HttpVersion(), t_integer(), t_HttpString()]).
-
-t_HttpHeader() ->
- t_tuple([t_atom('http_header'), t_integer(), t_HttpField(), t_any(), t_HttpString()]).
-
-t_HttpError() ->
- t_tuple([t_atom('http_error'), t_HttpString()]).
-
-t_HttpMethod() ->
- t_sup(t_HttpMethodAtom(), t_HttpString()).
-
-t_HttpMethodAtom() ->
- t_atoms(['OPTIONS', 'GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'TRACE']).
-
-t_HttpUri() ->
- t_sup([t_atom('*'),
- t_tuple([t_atom('absoluteURI'),
- t_sup(t_atom('http'), t_atom('https')),
- t_HttpString(),
- t_sup(t_non_neg_integer(), t_atom('undefined')),
- t_HttpString()]),
- t_tuple([t_atom('scheme'), t_HttpString(), t_HttpString()]),
- t_tuple([t_atom('abs_path'), t_HttpString()]),
- t_HttpString()]).
-
-t_HttpVersion() ->
- t_tuple([t_non_neg_integer(), t_non_neg_integer()]).
-
-t_HttpField() ->
- t_sup(t_HttpFieldAtom(), t_HttpString()).
-
-t_HttpFieldAtom() ->
- t_atoms(['Cache-Control', 'Connection', 'Date', 'Pragma', 'Transfer-Encoding',
- 'Upgrade', 'Via', 'Accept', 'Accept-Charset', 'Accept-Encoding',
- 'Accept-Language', 'Authorization', 'From', 'Host',
- 'If-Modified-Since', 'If-Match', 'If-None-Match', 'If-Range',
- 'If-Unmodified-Since', 'Max-Forwards', 'Proxy-Authorization',
- 'Range', 'Referer', 'User-Agent', 'Age', 'Location',
- 'Proxy-Authenticate', 'Public', 'Retry-After', 'Server', 'Vary',
- 'Warning', 'Www-Authenticate', 'Allow', 'Content-Base',
- 'Content-Encoding', 'Content-Language', 'Content-Length',
- 'Content-Location', 'Content-Md5', 'Content-Range', 'Content-Type',
- 'Etag', 'Expires', 'Last-Modified', 'Accept-Ranges',
- 'Set-Cookie', 'Set-Cookie2', 'X-Forwarded-For', 'Cookie',
- 'Keep-Alive', 'Proxy-Connection']).
-
-t_HttpString() ->
- t_sup(t_string(), t_binary()).
-
-%% =====================================================================
-%% These are used for the built-in functions of 'binary'
-%% =====================================================================
-
-t_binary_part() ->
- t_tuple([t_non_neg_integer(), t_integer()]).
-
-t_binary_canonical_part() ->
- t_tuple([t_non_neg_integer(), t_non_neg_integer()]).
-
-t_binary_pattern() ->
- t_sup([t_binary(),
- t_list(t_binary()),
- t_binary_compiled_pattern()]).
-
-t_binary_compiled_pattern() ->
- t_tuple([t_sup(t_atom('bm'), t_atom('ac')), t_binary()]).
-
-t_binary_options() ->
- t_list(t_tuple([t_atom('scope'), t_binary_part()])).
-
-%% =====================================================================
-%% These are used for the built-in functions of 'code'
-%% =====================================================================
-
-t_code_load_return(Mod) ->
- t_sup(t_tuple([t_atom('module'), case t_is_atom(Mod) of
- true -> Mod;
- false -> t_atom()
- end]),
- t_tuple([t_atom('error'), t_code_load_error_rsn()])).
-
-t_code_load_error_rsn() -> % also used in erlang:load_module/2
- t_sup([t_atom('badfile'),
- t_atom('nofile'),
- t_atom('not_purged'),
- t_atom('native_code'),
- t_atom('on_load'),
- t_atom('sticky_directory')]). % only for the 'code' functions
-
-%% =====================================================================
%% These are used for the built-in functions of 'erlang'
%% =====================================================================
-t_adler32() ->
- t_non_neg_integer().
-
t_crc32() ->
t_non_neg_integer().
-t_decode_packet_option() ->
- t_sup([t_tuple([t_atom('packet_size'), t_non_neg_integer()]),
- t_tuple([t_atom('line_length'), t_non_neg_integer()])]).
-
-t_decode_packet_type() ->
- t_sup([t_inet_setoption_packettype(), t_atom('httph'), t_atom('httph_bin')]).
-
-t_dist_exit() ->
- t_sup([t_atom('kill'), t_atom('noconnection'), t_atom('normal')]).
-
-t_match_spec_test_errors() ->
- t_list(t_sup(t_tuple([t_atom('error'), t_string()]),
- t_tuple([t_atom('warning'), t_string()]))).
-
-t_module_info_2() ->
- t_sup([t_atom('module'),
- t_atom('imports'),
- t_atom('exports'),
- t_atom('functions'),
- t_atom('attributes'),
- t_atom('compile'),
- t_atom('native_addresses')]).
-
-t_pinfo() ->
- t_sup([t_pinfo_item(), t_list(t_pinfo_item())]).
-
-t_pinfo_item() ->
- t_sup([t_atom('backtrace'),
- t_atom('current_function'),
- t_atom('dictionary'),
- t_atom('error_handler'),
- t_atom('garbage_collection'),
- t_atom('group_leader'),
- t_atom('heap_size'),
- t_atom('initial_call'),
- t_atom('last_calls'),
- t_atom('links'),
- t_atom('memory'),
- t_atom('message_binary'), % for hybrid heap only
- t_atom('message_queue_len'),
- t_atom('messages'),
- t_atom('monitored_by'),
- t_atom('monitors'),
- t_atom('priority'),
- t_atom('reductions'),
- t_atom('registered_name'),
- t_atom('sequential_trace_token'),
- t_atom('stack_size'),
- t_atom('status'),
- t_atom('suspending'),
- t_atom('total_heap_size'),
- t_atom('trap_exit')]).
-
-t_process_priority_level() ->
- t_sup([t_atom('max'), t_atom('high'), t_atom('normal'), t_atom('low')]).
-
-t_process_status() ->
- t_sup([t_atom('exiting'), t_atom('garbage_collecting'),
- t_atom('runnable'), t_atom('running'),
- t_atom('suspended'), t_atom('waiting')]).
-
-t_raise_errorclass() ->
- t_sup([t_atom('error'), t_atom('exit'), t_atom('throw')]).
-
-t_sendoptions() ->
- t_sup(t_atom('noconnect'), t_atom('nosuspend')).
-
-t_seq_trace_info() ->
- t_sup([t_atom('send'),
- t_atom('receive'),
- t_atom('print'),
- t_atom('timestamp'),
- t_atom('label'),
- t_atom('serial')]).
-
-%% XXX: Better if we also maintain correspondencies between infos and values
-t_seq_trace_info_returns() ->
- Values = t_sup([t_non_neg_integer(), t_boolean(),
- t_tuple([t_non_neg_integer(), t_non_neg_integer()])]),
- t_sup(t_tuple([t_seq_trace_info(), Values]), t_nil()).
-
t_sequential_tracer() ->
t_sup([t_atom('false'), t_pid(), t_port()]).
-t_spawn_options() ->
- t_sup([t_atom('link'),
- t_atom('monitor'),
- t_tuple([t_atom('priority'), t_process_priority_level()]),
- t_tuple([t_atom('min_heap_size'), t_fixnum()]),
- t_tuple([t_atom('fullsweep_after'), t_fixnum()])]).
-
-t_spawn_opt_return(List) ->
- case t_is_none(t_inf(t_list(t_atom('monitor')), List)) of
- true -> t_pid();
- false -> t_sup(t_pid(), t_tuple([t_pid(), t_reference()]))
- end.
-
t_system_cpu_topology() ->
t_sup(t_atom('undefined'), t_system_cpu_topology_level_entry_list()).
@@ -4777,17 +2650,6 @@ t_internal_cpu_topology() -> %% Internal undocumented type
t_non_neg_fixnum()])),
t_atom('undefined')).
-t_scheduler_bind_type_args() ->
- t_sup([t_atom('default_bind'),
- t_atom('no_node_processor_spread'),
- t_atom('no_node_thread_spread'),
- t_atom('no_spread'),
- t_atom('processor_spread'),
- t_atom('spread'),
- t_atom('thread_spread'),
- t_atom('thread_no_node_processor_spread'),
- t_atom('unbound')]).
-
t_scheduler_bind_type_results() ->
t_sup([t_atom('no_node_processor_spread'),
t_atom('no_node_thread_spread'),
@@ -4798,149 +2660,9 @@ t_scheduler_bind_type_results() ->
t_atom('thread_no_node_processor_spread'),
t_atom('unbound')]).
-t_system_monitor_settings() ->
- t_sup([t_atom('undefined'),
- t_tuple([t_pid(), t_system_monitor_options()])]).
-
-t_system_monitor_options() ->
- t_list(t_sup([t_atom('busy_port'),
- t_atom('busy_dist_port'),
- t_tuple([t_atom('long_gc'), t_integer()]),
- t_tuple([t_atom('large_heap'), t_integer()])])).
-
t_system_multi_scheduling() ->
t_sup([t_atom('blocked'), t_atom('disabled'), t_atom('enabled')]).
-t_system_profile_options() ->
- t_list(t_sup([t_atom('exclusive'),
- t_atom('runnable_ports'),
- t_atom('runnable_procs'),
- t_atom('scheduler')])).
-
-t_system_profile_return() ->
- t_sup(t_atom('undefined'),
- t_tuple([t_sup(t_pid(), t_port()), t_system_profile_options()])).
-
-%% =====================================================================
-%% These are used for the built-in functions of 'ets'
-%% =====================================================================
-
-t_tab() ->
- t_sup(t_tid(), t_atom()).
-
-t_match_pattern() ->
- t_sup(t_atom(), t_tuple()).
-
-t_matchspecs() ->
- t_list(t_tuple([t_match_pattern(), t_list(), t_list()])).
-
-t_matchres() ->
- t_sup(t_tuple([t_list(), t_any()]), t_atom('$end_of_table')).
-
-%% From the 'ets' documentation
-%%-----------------------------
-%% Option = Type | Access | named_table | {keypos,Pos}
-%% | {heir,pid(),HeirData} | {heir,none} | Tweaks
-%% Type = set | ordered_set | bag | duplicate_bag
-%% Access = public | protected | private
-%% Tweaks = {write_concurrency,boolean()}
-%% | {read_concurrency,boolean()} | compressed
-%% Pos = integer()
-%% HeirData = term()
-t_ets_new_options() ->
- t_list(t_sup([t_atom('set'),
- t_atom('ordered_set'),
- t_atom('bag'),
- t_atom('duplicate_bag'),
- t_atom('public'),
- t_atom('protected'),
- t_atom('private'),
- t_atom('named_table'),
- t_tuple([t_atom('keypos'), t_integer()]),
- t_tuple([t_atom('heir'), t_pid(), t_any()]),
- t_tuple([t_atom('heir'), t_atom('none')]),
- t_tuple([t_atom('write_concurrency'), t_boolean()]),
- t_tuple([t_atom('read_concurrency'), t_boolean()]),
- t_atom('compressed')])).
-
-t_ets_info_items() ->
- t_sup([t_atom('fixed'),
- t_atom('safe_fixed'),
- t_atom('keypos'),
- t_atom('memory'),
- t_atom('name'),
- t_atom('named_table'),
- t_atom('node'),
- t_atom('owner'),
- t_atom('protection'),
- t_atom('size'),
- t_atom('compressed'),
- t_atom('heir'),
- t_atom('stats'),
- t_atom('type')]).
-
-%% =====================================================================
-%% These are used for the built-in functions of 'gen_tcp'
-%% =====================================================================
-
-t_gen_tcp_accept() ->
- t_sup(t_tuple([t_atom('ok'), t_socket()]),
- t_tuple([t_atom('error'), t_sup([t_atom('closed'),
- t_atom('timeout'),
- t_inet_posix_error()])])).
-
-t_gen_tcp_address() ->
- t_sup([t_string(), t_atom(), t_ip_address()]).
-
-t_gen_tcp_port() ->
- t_from_range(0, 16#FFFF).
-
-t_gen_tcp_connect_option() ->
- t_sup([t_atom('list'),
- t_atom('binary'),
- t_tuple([t_atom('ip'), t_ip_address()]),
- t_tuple([t_atom('port'), t_gen_tcp_port()]),
- t_tuple([t_atom('fd'), t_integer()]),
- t_atom('inet6'),
- t_atom('inet'),
- t_inet_setoption()]).
-
-t_gen_tcp_listen_option() ->
- t_sup([t_atom('list'),
- t_atom('binary'),
- t_tuple([t_atom('backlog'), t_non_neg_integer()]),
- t_tuple([t_atom('ip'), t_ip_address()]),
- t_tuple([t_atom('fd'), t_integer()]),
- t_atom('inet6'),
- t_atom('inet'),
- t_inet_setoption()]).
-
-t_gen_tcp_recv() ->
- t_sup(t_tuple([t_atom('ok'), t_packet()]),
- t_tuple([t_atom('error'), t_sup([t_atom('closed'),
- t_inet_posix_error()])])).
-
-%% =====================================================================
-%% These are used for the built-in functions of 'gen_udp'
-%% =====================================================================
-
-t_gen_udp_connect_option() ->
- t_sup([t_atom('list'),
- t_atom('binary'),
- t_tuple([t_atom('ip'), t_ip_address()]),
- t_tuple([t_atom('fd'), t_integer()]),
- t_atom('inet6'),
- t_atom('inet'),
- t_inet_setoption()]).
-
-t_gen_udp_recv() ->
- t_sup(t_tuple([t_atom('ok'),
- t_tuple([t_ip_address(),
- t_gen_tcp_port(),
- t_packet()])]),
- t_tuple([t_atom('error'),
- t_sup(t_atom('not_owner'), t_inet_posix_error())])).
-
%% =====================================================================
%% These are used for the built-in functions of 'hipe_bifs'
%% =====================================================================
@@ -4973,131 +2695,6 @@ t_insn_type() ->
t_atom('closure')]).
%% =====================================================================
-%% These are used for the built-in functions of 'inet'
-%% =====================================================================
-
-t_inet_setoption() ->
- t_sup([%% first the 2-tuple options
- t_tuple([t_atom('active'), t_sup(t_boolean(), t_atom('once'))]),
- t_tuple([t_atom('broadcast'), t_boolean()]),
- t_tuple([t_atom('delay_send'), t_boolean()]),
- t_tuple([t_atom('dontroute'), t_boolean()]),
- t_tuple([t_atom('exit_on_close'), t_boolean()]),
- t_tuple([t_atom('header'), t_non_neg_integer()]),
- t_tuple([t_atom('keepalive'), t_boolean()]),
- t_tuple([t_atom('nodelay'), t_boolean()]),
- t_tuple([t_atom('packet'), t_inet_setoption_packettype()]),
- t_tuple([t_atom('packet_size'), t_non_neg_integer()]),
- t_tuple([t_atom('read_packets'), t_non_neg_integer()]),
- t_tuple([t_atom('recbuf'), t_non_neg_integer()]),
- t_tuple([t_atom('reuseaddr'), t_boolean()]),
- t_tuple([t_atom('send_timeout'), t_non_neg_integer()]),
- t_tuple([t_atom('sndbuf'), t_non_neg_integer()]),
- t_tuple([t_atom('priority'), t_non_neg_integer()]),
- t_tuple([t_atom('tos'), t_non_neg_integer()]),
- %% and a 4-tuple option
- t_tuple([t_atom('raw'),
- t_non_neg_integer(), % protocol level
- t_non_neg_integer(), % option number
- t_binary()])]). % actual option value
-
-t_inet_setoption_packettype() ->
- t_sup([t_atom('raw'),
- t_integers([0,1,2,4]),
- t_atom('asn1'), t_atom('cdr'), t_atom('sunrm'),
- t_atom('fcgi'), t_atom('tpkt'), t_atom('line'),
- t_atom('http'),
- t_atom('http_bin')]). %% but t_atom('httph') is not needed
-
-t_inet_posix_error() ->
- t_atom(). %% XXX: Very underspecified
-
-%% =====================================================================
-%% These are used for the built-in functions of 'io'
-%% =====================================================================
-
-t_io_device() ->
- t_sup(t_atom(), t_pid()).
-
-%% The documentation in R11B-4 reads
-%% Format ::= atom() | string() | binary()
-%% but the Format can also be a (deep) list, hence the type below
-t_io_format_string() ->
- t_sup([t_atom(), t_list(), t_binary()]).
-
-%% =====================================================================
-%% These are used for the built-in functions of 're'; the functions
-%% whose last name component starts with a capital letter are types
-%% =====================================================================
-
-t_re_MP() -> %% it's supposed to be an opaque data type
- t_tuple([t_atom('re_pattern'), t_integer(), t_integer(), t_binary()]).
-
-t_re_RE() ->
- t_sup([t_re_MP(), t_iodata(), t_charlist()]).
-
-t_re_compile_option() ->
- t_sup([t_atoms(['unicode', 'anchored', 'caseless', 'dollar_endonly',
- 'dotall', 'extended', 'firstline', 'multiline',
- 'no_auto_capture', 'dupnames', 'ungreedy']),
- t_tuple([t_atom('newline'), t_re_NLSpec()]),
- t_atoms(['bsr_anycrlf', 'bsr_unicode'])]).
-
-t_re_run_option() ->
- t_sup([t_atoms(['anchored', 'global', 'notbol', 'noteol', 'notempty']),
- t_tuple([t_atom('offset'), t_integer()]),
- t_tuple([t_atom('newline'), t_re_NLSpec()]),
- t_tuple([t_atom('capture'), t_re_ValueSpec()]),
- t_tuple([t_atom('capture'), t_re_ValueSpec(), t_re_Type()]),
- t_re_compile_option()]).
-
-t_re_ErrorSpec() ->
- t_tuple([t_string(), t_non_neg_integer()]).
-
-t_re_Type() ->
- t_atoms(['index', 'list', 'binary']).
-
-t_re_NLSpec() ->
- t_atoms(['cr', 'crlf', 'lf', 'anycrlf', 'any']).
-
-t_re_ValueSpec() ->
- t_sup(t_atoms(['all', 'all_but_first', 'first', 'none']), t_re_ValueList()).
-
-t_re_ValueList() ->
- t_list(t_sup([t_integer(), t_string(), t_atom()])).
-
-t_re_Captured() ->
- t_list(t_sup(t_re_CapturedData(), t_list(t_re_CapturedData()))).
-
-t_re_CapturedData() ->
- t_sup([t_tuple([t_integer(), t_integer()]), t_string(), t_binary()]).
-
-%% =====================================================================
-%% These are used for the built-in functions of 'prim_file'
-%% =====================================================================
-
-t_prim_file_name() ->
- t_sup(t_unicode_string(), t_binary()).
-
-%% =====================================================================
-%% These are used for the built-in functions of 'unicode'
-%% =====================================================================
-
-t_ML() -> % a binary or a possibly deep list of integers or binaries
- t_sup(t_list(t_sup([t_integer(), t_binary(), t_list()])), t_binary()).
-
-t_encoding() ->
- t_sup([t_atoms(['latin1', 'unicode', 'utf8', 'utf16', 'utf32']),
- t_tuple([t_atom('utf16'), t_endian()]),
- t_tuple([t_atom('utf32'), t_endian()])]).
-
-t_file_encoding() ->
- t_atoms(['latin1', 'utf8']).
-
-t_encoding_a2b() -> % for the 2nd arg of atom_to_binary/2 and binary_to_atom/2
- t_atoms(['latin1', 'unicode', 'utf8']).
-
-%% =====================================================================
%% Some testing code for ranges below
%% =====================================================================
diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl
index 620fed365e..bc7ea17077 100644
--- a/lib/hipe/cerl/erl_types.erl
+++ b/lib/hipe/cerl/erl_types.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -275,8 +275,8 @@
-type tag() :: ?atom_tag | ?binary_tag | ?function_tag | ?identifier_tag
| ?list_tag | ?matchstate_tag | ?nil_tag | ?number_tag
- | ?opaque_tag | ?product_tag | ?tuple_tag | ?tuple_set_tag
- | ?union_tag | ?var_tag.
+ | ?opaque_tag | ?product_tag | ?remote_tag
+ | ?tuple_tag | ?tuple_set_tag | ?union_tag | ?var_tag.
-define(float_qual, float).
-define(integer_qual, integer).
@@ -424,12 +424,7 @@ t_has_opaque_subtype(T) ->
-spec t_opaque_structure(erl_type()) -> erl_type().
t_opaque_structure(?opaque(Elements)) ->
- case ordsets:size(Elements) of
- 1 ->
- [#opaque{struct = Struct}] = ordsets:to_list(Elements),
- Struct;
- _ -> throw({error, "Unexpected multiple opaque types"})
- end.
+ t_sup([Struct || #opaque{struct = Struct} <- ordsets:to_list(Elements)]).
-spec t_opaque_module(erl_type()) -> module().
@@ -688,12 +683,12 @@ t_solve_remote(?opaque(Set), ET, R, C) ->
{NewList, RR} = opaques_solve_remote(List, ET, R, C),
{?opaque(ordsets:from_list(NewList)), RR};
t_solve_remote(?tuple(?any, _, _) = T, _ET, _R, _C) -> {T, []};
-t_solve_remote(?tuple(Types, Arity, Tag), ET, R, C) ->
+t_solve_remote(?tuple(Types, _Arity, _Tag), ET, R, C) ->
{RL, RR} = list_solve_remote(Types, ET, R, C),
- {?tuple(RL, Arity, Tag), RR};
+ {t_tuple(RL), RR};
t_solve_remote(?tuple_set(Set), ET, R, C) ->
- {NewSet, RR} = tuples_solve_remote(Set, ET, R, C),
- {?tuple_set(NewSet), RR};
+ {NewTuples, RR} = tuples_solve_remote(Set, ET, R, C),
+ {t_sup(NewTuples), RR};
t_solve_remote(?remote(Set), ET, R, C) ->
RemoteList = ordsets:to_list(Set),
{RL, RR} = list_solve_remote_type(RemoteList, ET, R, C),
@@ -793,10 +788,10 @@ opaques_solve_remote([#opaque{struct = Struct} = Remote|Tail], ET, R, C) ->
tuples_solve_remote([], _ET, _R, _C) ->
{[], []};
-tuples_solve_remote([{Sz, Tuples}|Tail], ET, R, C) ->
+tuples_solve_remote([{_Sz, Tuples}|Tail], ET, R, C) ->
{RL, RR1} = list_solve_remote(Tuples, ET, R, C),
{LSzTpls, RR2} = tuples_solve_remote(Tail, ET, R, C),
- {[{Sz, RL}|LSzTpls], RR1 ++ RR2}.
+ {RL ++ LSzTpls, RR1 ++ RR2}.
%%-----------------------------------------------------------------------------
%% Unit type. Signals non termination.
@@ -2323,10 +2318,14 @@ t_inf(?product(_), _, _Mode) ->
?none;
t_inf(_, ?product(_), _Mode) ->
?none;
-t_inf(?tuple(?any, ?any, ?any), ?tuple(_, _, _) = T, _Mode) -> T;
-t_inf(?tuple(_, _, _) = T, ?tuple(?any, ?any, ?any), _Mode) -> T;
-t_inf(?tuple(?any, ?any, ?any), ?tuple_set(_) = T, _Mode) -> T;
-t_inf(?tuple_set(_) = T, ?tuple(?any, ?any, ?any), _Mode) -> T;
+t_inf(?tuple(?any, ?any, ?any), ?tuple(_, _, _) = T, _Mode) ->
+ subst_all_vars_to_any(T);
+t_inf(?tuple(_, _, _) = T, ?tuple(?any, ?any, ?any), _Mode) ->
+ subst_all_vars_to_any(T);
+t_inf(?tuple(?any, ?any, ?any), ?tuple_set(_) = T, _Mode) ->
+ subst_all_vars_to_any(T);
+t_inf(?tuple_set(_) = T, ?tuple(?any, ?any, ?any), _Mode) ->
+ subst_all_vars_to_any(T);
t_inf(?tuple(Elements1, Arity, _Tag1), ?tuple(Elements2, Arity, _Tag2), Mode) ->
case t_inf_lists_strict(Elements1, Elements2, Mode) of
bottom -> ?none;
@@ -2560,8 +2559,8 @@ t_subst_dict(?list(Contents, Termination, Size), Dict) ->
?nil -> ?list(NewContents, ?nil, Size);
?any -> ?list(NewContents, ?any, Size);
Other ->
- ?list(NewContents, NewTermination, _) = t_cons(NewContents, Other),
- ?list(NewContents, NewTermination, Size)
+ ?list(NewContents2, NewTermination, _) = t_cons(NewContents, Other),
+ ?list(NewContents2, NewTermination, Size)
end
end;
t_subst_dict(?function(Domain, Range), Dict) ->
@@ -2602,8 +2601,8 @@ t_subst_aux(?list(Contents, Termination, Size), VarMap) ->
?nil -> ?list(NewContents, ?nil, Size);
?any -> ?list(NewContents, ?any, Size);
Other ->
- ?list(NewContents, NewTermination, _) = t_cons(NewContents, Other),
- ?list(NewContents, NewTermination, Size)
+ ?list(NewContents2, NewTermination, _) = t_cons(NewContents, Other),
+ ?list(NewContents2, NewTermination, Size)
end
end;
t_subst_aux(?function(Domain, Range), VarMap) ->
@@ -3191,8 +3190,8 @@ t_abstract_records(?list(Contents, Termination, Size), RecDict) ->
?nil -> ?list(NewContents, ?nil, Size);
?any -> ?list(NewContents, ?any, Size);
Other ->
- ?list(NewContents, NewTermination, _) = t_cons(NewContents, Other),
- ?list(NewContents, NewTermination, Size)
+ ?list(NewContents2, NewTermination, _) = t_cons(NewContents, Other),
+ ?list(NewContents2, NewTermination, Size)
end
end;
t_abstract_records(?function(Domain, Range), RecDict) ->
diff --git a/lib/hipe/doc/Makefile b/lib/hipe/doc/Makefile
index cdf9c9c798..4ea0137202 100644
--- a/lib/hipe/doc/Makefile
+++ b/lib/hipe/doc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2010. All Rights Reserved.
+# Copyright Ericsson AB 2006-2012. 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
@@ -24,6 +24,9 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk
clean:
-rm -f *.html edoc-info stylesheet.css erlang.png
+distclean: clean
+realclean: clean
+
# ----------------------------------------------------
# Special Build Targets
# ----------------------------------------------------
diff --git a/lib/hipe/doc/src/Makefile b/lib/hipe/doc/src/Makefile
index d440178e4c..fbfd4ca327 100644
--- a/lib/hipe/doc/src/Makefile
+++ b/lib/hipe/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2010. All Rights Reserved.
+# Copyright Ericsson AB 2006-2012. 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
@@ -97,18 +97,21 @@ clean clean_docs:
rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
rm -f errs core *~
+distclean: clean
+realclean: clean
+
# ----------------------------------------------------
# Release Target
# ----------------------------------------------------
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
release_spec:
diff --git a/lib/hipe/doc/src/notes.xml b/lib/hipe/doc/src/notes.xml
index 3f28cf9959..1841c7d9de 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>2011</year>
+ <year>2006</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,6 +30,96 @@
</header>
<p>This document describes the changes made to HiPE.</p>
+<section><title>Hipe 3.9.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p> Correct handling of type names in contracts. Fix
+ crash related to contract checking. Do not rewrite
+ unchanged PLT. </p>
+ <p>
+ Own Id: OTP-10083</p>
+ </item>
+ <item>
+ <p>
+ Changes in comments and minor code cleanups</p>
+ <p>
+ Thanks to Kostis Sagonas.</p>
+ <p>
+ Own Id: OTP-10230</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Remove all code, documentation, options and diagnostic
+ functions which were related to the experimental hybrid
+ heap implementation.</p>
+ <p>
+ Own Id: OTP-10105</p>
+ </item>
+ <item>
+ <p> Bugs in <c>erl_types:t_inf()</c> (HiPE) and in
+ <c>dialyzer_dataflow</c> (Dialyzer) have been fixed. </p>
+ <p>
+ Own Id: OTP-10191</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Hipe 3.9.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ References to <c>is_constant/1</c> (which was removed in
+ the R12 release) has been removed from documentation and
+ code.</p>
+ <p>
+ Own Id: OTP-6454 Aux Id: seq10407 </p>
+ </item>
+ <item>
+ <p>
+ Fixed a discrepancy in compile_info</p>
+ <p>
+ The BEAM disassembler used the atom 'none' to signify the
+ absence of a compile_info chunk in a .beam file. This
+ clashed with the type declaration of the compile_info
+ field of a #beam_file{} record as containing a list. Now
+ [] signifies the absence of this chunk. This simplifies
+ the code and avoids a dialyzer warning.</p>
+ <p>
+ Own Id: OTP-9917</p>
+ </item>
+ <item>
+ <p>
+ Make dialyzer recognize the process_flag option sensitive
+ add missing specs to documentation (Thanks to Tobias
+ Schlager)</p>
+ <p>
+ Own Id: OTP-9923</p>
+ </item>
+ <item>
+ <p>
+ Remove hipe_ceach from hipe.app.src to fix
+ reltool-generated release startup. (Thanks to Tim
+ Stewart)</p>
+ <p>
+ Own Id: OTP-9939</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Hipe 3.9</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/hipe/flow/Makefile b/lib/hipe/flow/Makefile
index bbe8ef8666..75e156b542 100644
--- a/lib/hipe/flow/Makefile
+++ b/lib/hipe/flow/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2010. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -82,6 +82,9 @@ clean:
rm -f $(TARGET_FILES)
rm -f core
+distclean: clean
+realclean: clean
+
$(DOCS)/%.html:%.erl
erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop
@@ -97,10 +100,10 @@ $(DOCS)/%.html:%.erl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/flow
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(INC_FILES) $(RELSYSDIR)/flow
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/flow"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(INC_FILES) "$(RELSYSDIR)/flow"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/hipe/flow/cfg.hrl b/lib/hipe/flow/cfg.hrl
index 62f47a707a..95bf5f7194 100644
--- a/lib/hipe/flow/cfg.hrl
+++ b/lib/hipe/flow/cfg.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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/lib/hipe/icode/Makefile b/lib/hipe/icode/Makefile
index bd6436c8b3..0f2d6db39b 100644
--- a/lib/hipe/icode/Makefile
+++ b/lib/hipe/icode/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2010. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -100,6 +100,9 @@ clean:
rm -f $(TARGET_FILES)
rm -f core
+distclean: clean
+realclean: clean
+
$(DOCS)/%.html:%.erl
erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop
@@ -115,10 +118,10 @@ $(DOCS)/%.html:%.erl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/icode
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/icode
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/icode"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/icode"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/hipe/icode/hipe_beam_to_icode.erl b/lib/hipe/icode/hipe_beam_to_icode.erl
index 992f387bd5..81249c958e 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -41,6 +41,9 @@
%%
%%-ifndef(DEBUG).
%%-define(DEBUG,6).
+%% Choose one of two tracing methods
+%%-define(DEBUG_BIF_CALL_TRACE,true).
+%%-define(IO_FORMAT_CALL_TRACE,true).
%%-endif.
-include("../main/hipe.hrl").
@@ -51,8 +54,27 @@
-define(no_debug_msg(Str,Xs),ok).
%%-define(no_debug_msg(Str,Xs),msg(Str,Xs)).
--define(mk_debugcode(MFA, Env, Code),
- case MFA of
+-ifdef(DEBUG_BIF_CALL_TRACE).
+
+%% Use BIF hipe_bifs_debug_native_called_2 to trace function calls
+mk_debug_calltrace({_M,_F,A}=MFA, Env, Code) ->
+ MFAVar = mk_var(new),
+ Ignore = mk_var(new),
+ MkMfa = hipe_icode:mk_move(MFAVar,hipe_icode:mk_const(MFA)),
+ Args = [mk_var({x,I-1}) || I <- lists:seq(1,A)],
+ ArgTup = mk_var(new),
+ MkArgTup = hipe_icode:mk_primop([ArgTup], mktuple, Args),
+ Call = hipe_icode:mk_primop([Ignore], debug_native_called,
+ [MFAVar,ArgTup]),
+ {[MkMfa,MkArgTup,Call | Code], Env}.
+
+-endif.
+
+-ifdef(IO_FORMAT_CALL_TRACE).
+
+%% Use io:format to trace function calls
+mk_debug_calltrace(MFA, Env, Code) ->
+ case MFA of
{io,_,_} ->
%% We do not want to loop infinitely if we are compiling
%% the module io.
@@ -69,15 +91,16 @@
Call =
hipe_icode:mk_call([Ignore],io,format,[StringVar,MFAVar],remote),
{[MkMfa,MkString,Call | Code], Env}
- end).
+ end.
+-endif.
+
%%-----------------------------------------------------------------------
-%% Exported types
+%% Types
%%-----------------------------------------------------------------------
-type hipe_beam_to_icode_ret() :: [{mfa(),#icode{}}].
-
%%-----------------------------------------------------------------------
%% Internal data structures
%%-----------------------------------------------------------------------
@@ -127,7 +150,7 @@ trans_mfa_code(M,F,A, FunBeamCode, ClosureInfo) ->
MFA = {M,F,A},
%% Debug code
?IF_DEBUG_LEVEL(5,
- {Code3,_Env3} = ?mk_debugcode(MFA, Env2, Code2),
+ {Code3,_Env3} = mk_debug_calltrace(MFA, Env1, Code2),
{Code3,_Env3} = {Code2,Env1}),
%% For stack optimization
Leafness = leafness(Code3),
@@ -315,19 +338,19 @@ trans_fun([{call_ext_last,_N,{extfunc,M,F,A},_}|Instructions], Env) ->
%%--- bif0 ---
trans_fun([{bif,BifName,nofail,[],Reg}|Instructions], Env) ->
BifInst = trans_bif0(BifName,Reg),
- [hipe_icode:mk_comment({bif0,BifName}),BifInst|trans_fun(Instructions,Env)];
+ [BifInst|trans_fun(Instructions,Env)];
%%--- bif1 ---
trans_fun([{bif,BifName,{f,Lbl},[_] = Args,Reg}|Instructions], Env) ->
{BifInsts,Env1} = trans_bif(1,BifName,Lbl,Args,Reg,Env),
- [hipe_icode:mk_comment({bif1,BifName})|BifInsts] ++ trans_fun(Instructions,Env1);
+ BifInsts ++ trans_fun(Instructions,Env1);
%%--- bif2 ---
trans_fun([{bif,BifName,{f,Lbl},[_,_] = Args,Reg}|Instructions], Env) ->
{BifInsts,Env1} = trans_bif(2,BifName,Lbl,Args,Reg,Env),
- [hipe_icode:mk_comment({bif2,BifName})|BifInsts] ++ trans_fun(Instructions,Env1);
+ BifInsts ++ trans_fun(Instructions,Env1);
%%--- bif3 ---
trans_fun([{bif,BifName,{f,Lbl},[_,_,_] = Args,Reg}|Instructions], Env) ->
{BifInsts,Env1} = trans_bif(3,BifName,Lbl,Args,Reg,Env),
- [hipe_icode:mk_comment({bif3,BifName})|BifInsts] ++ trans_fun(Instructions,Env1);
+ BifInsts ++ trans_fun(Instructions,Env1);
%%--- allocate
trans_fun([{allocate,StackSlots,_}|Instructions], Env) ->
trans_allocate(StackSlots) ++ trans_fun(Instructions,Env);
@@ -465,10 +488,6 @@ trans_fun([{test,is_nil,{f,Lbl},[Arg]}|Instructions], Env) ->
trans_fun([{test,is_binary,{f,Lbl},[Arg]}|Instructions], Env) ->
{Code,Env1} = trans_type_test(binary,Lbl,Arg,Env),
[Code | trans_fun(Instructions,Env1)];
-%%--- is_constant ---
-trans_fun([{test,is_constant,{f,Lbl},[Arg]}|Instructions], Env) ->
- {Code,Env1} = trans_type_test(constant,Lbl,Arg,Env),
- [Code | trans_fun(Instructions,Env1)];
%%--- is_list ---
trans_fun([{test,is_list,{f,Lbl},[Arg]}|Instructions], Env) ->
{Code,Env1} = trans_type_test(list,Lbl,Arg,Env),
@@ -820,7 +839,7 @@ trans_fun([{test,bs_test_tail2,{f,Lbl},[Ms,Numbits]}| Instructions], Env) ->
trans_op_call({hipe_bs_primop,{bs_test_tail,Numbits}},
Lbl, [MsVar], [], Env, Instructions);
%%--------------------------------------------------------------------
-%% New bit syntax instructions added in February 2004 (R10B).
+%% bit syntax instructions added in February 2004 (R10B).
%%--------------------------------------------------------------------
trans_fun([{bs_init2,{f,Lbl},Size,_Words,_LiveRegs,{field_flags,Flags0},X}|
Instructions], Env) ->
@@ -1035,7 +1054,7 @@ trans_fun([{arithfbif,fnegate,Lab,[SrcR],DestR}|Instructions], Env) ->
trans_fun([{arithbif,'-',Lab,[{float,0.0},SrcR],DestR}|Instructions], Env)
end;
%%--------------------------------------------------------------------
-%% New apply instructions added in April 2004 (R10B).
+%% apply instructions added in April 2004 (R10B).
%%--------------------------------------------------------------------
trans_fun([{apply,Arity}|Instructions], Env) ->
BeamArgs = extract_fun_args(Arity+2), %% +2 is for M and F
@@ -1051,21 +1070,21 @@ trans_fun([{apply_last,Arity,_N}|Instructions], Env) -> % N is StackAdjustment?
hipe_icode:mk_enter_primop(#apply_N{arity=Arity}, [M,F|Args])
| trans_fun(Instructions,Env)];
%%--------------------------------------------------------------------
-%% New test instruction added in April 2004 (R10B).
+%% test for boolean added in April 2004 (R10B).
%%--------------------------------------------------------------------
%%--- is_boolean ---
trans_fun([{test,is_boolean,{f,Lbl},[Arg]}|Instructions], Env) ->
{Code,Env1} = trans_type_test(boolean,Lbl,Arg,Env),
[Code | trans_fun(Instructions,Env1)];
%%--------------------------------------------------------------------
-%% New test instruction added in June 2005 for R11
+%% test for function with specific arity added in June 2005 (R11).
%%--------------------------------------------------------------------
%%--- is_function2 ---
trans_fun([{test,is_function2,{f,Lbl},[Arg,Arity]}|Instructions], Env) ->
{Code,Env1} = trans_type_test2(function2,Lbl,Arg,Arity,Env),
[Code | trans_fun(Instructions,Env1)];
%%--------------------------------------------------------------------
-%% New garbage-collecting BIFs added in January 2006 for R11B.
+%% garbage collecting BIFs added in January 2006 (R11B).
%%--------------------------------------------------------------------
trans_fun([{gc_bif,'-',Fail,_Live,[SrcR],DstR}|Instructions], Env) ->
%% Unary minus. Change this to binary minus.
@@ -1083,21 +1102,21 @@ trans_fun([{gc_bif,Name,Fail,_Live,SrcRs,DstR}|Instructions], Env) ->
trans_fun([{bif,Name,Fail,SrcRs,DstR}|Instructions], Env)
end;
%%--------------------------------------------------------------------
-%% New test instruction added in July 2007 for R12.
+%% test for bitstream added in July 2007 (R12).
%%--------------------------------------------------------------------
%%--- is_bitstr ---
trans_fun([{test,is_bitstr,{f,Lbl},[Arg]}|Instructions], Env) ->
{Code,Env1} = trans_type_test(bitstr, Lbl, Arg, Env),
[Code | trans_fun(Instructions, Env1)];
%%--------------------------------------------------------------------
-%% New stack triming instruction added in October 2007 for R12.
+%% stack triming instruction added in October 2007 (R12).
%%--------------------------------------------------------------------
trans_fun([{trim,N,NY}|Instructions], Env) ->
%% trim away N registers leaving NY registers
Moves = trans_trim(N, NY),
Moves ++ trans_fun(Instructions, Env);
%%--------------------------------------------------------------------
-%% New line/1 instruction in R15.
+%% line instruction added in Fall 2012 (R15).
%%--------------------------------------------------------------------
trans_fun([{line,_}|Instructions], Env) ->
trans_fun(Instructions,Env);
@@ -1301,7 +1320,7 @@ trans_bin([{bs_put_integer,{f,Lbl},Size,Unit,{field_flags,Flags0},Source}|
SrcInstrs ++ trans_bin_call({hipe_bs_primop, Name},
Lbl, [Src|Args], [Offset], Base, Offset, Env2, Instructions);
%%----------------------------------------------------------------
-%% New binary construction instructions added in R12B-5 (Fall 2008).
+%% binary construction instructions added in Fall 2008 (R12B-5).
%%----------------------------------------------------------------
trans_bin([{bs_put_utf8,{f,Lbl},_FF,A3}|Instructions], Base, Offset, Env) ->
Src = trans_arg(A3),
@@ -1352,7 +1371,7 @@ trans_bs_get_or_skip_utf32(Lbl, Ms, Flags0, X, Instructions, Env) ->
Lbl, [Dst,MsVar], [MsVar], Env1, Instructions).
%%-----------------------------------------------------------------------
-%% trans_arith(Op, SrcVars, Des, Lab, Env) -> { Icode, NewEnv }
+%% trans_arith(Op, SrcVars, Des, Lab, Env) -> {Icode, NewEnv}
%% A failure label of type {f,0} means in a body.
%% A failure label of type {f,L} where L>0 means in a guard.
%% Within a guard a failure should branch to the next guard and
@@ -1458,7 +1477,7 @@ clone_dst(Dest) ->
%%-----------------------------------------------------------------------
-%% trans_type_test(Test, Lbl, Arg, Env) -> { Icode, NewEnv }
+%% trans_type_test(Test, Lbl, Arg, Env) -> {Icode, NewEnv}
%% Handles all unary type tests like is_integer etc.
%%-----------------------------------------------------------------------
@@ -1470,7 +1489,7 @@ trans_type_test(Test, Lbl, Arg, Env) ->
{[Move,I,True],Env1}.
%%
-%% This handles binary type tests. Currently, the only such is the new
+%% This handles binary type tests. Currently, the only such is the
%% is_function/2 BIF.
%%
trans_type_test2(function2, Lbl, Arg, Arity, Env) ->
@@ -1483,7 +1502,7 @@ trans_type_test2(function2, Lbl, Arg, Arity, Env) ->
%%-----------------------------------------------------------------------
%% trans_puts(Code, Environment) ->
-%% { Movs, Code, Vars, NewEnv }
+%% {Movs, Code, Vars, NewEnv}
%%-----------------------------------------------------------------------
trans_puts(Code, Env) ->
diff --git a/lib/hipe/icode/hipe_icode.hrl b/lib/hipe/icode/hipe_icode.hrl
index 65deaf6d7c..d76eebf78d 100644
--- a/lib/hipe/icode/hipe_icode.hrl
+++ b/lib/hipe/icode/hipe_icode.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -64,9 +64,9 @@
-type icode_if_op() :: '>' | '<' | '>=' | '=<' | '=:=' | '=/=' | '==' | '/='
| 'fixnum_eq' | 'fixnum_neq' | 'fixnum_lt'
| 'fixnum_le' | 'fixnum_ge' | 'fixnum_gt'
- | 'suspend_msg_timeout'.
+ | 'op_exact_eqeq_2' | 'suspend_msg_timeout'.
--type icode_type_test() :: 'atom' | 'bignum' | 'binary' | 'bitrst' | 'boolean'
+-type icode_type_test() :: 'atom' | 'bignum' | 'binary' | 'bitstr' | 'boolean'
| 'cons' | 'constant' | 'fixnum' | 'float'
| 'function' | 'function2' | 'integer' | 'list' | 'nil'
| 'number' | 'pid' | 'port' | 'reference' | 'tuple'
@@ -88,7 +88,7 @@
-type icode_call_type() :: 'local' | 'primop' | 'remote'.
-type icode_exit_class() :: 'error' | 'exit' | 'rethrow' | 'throw'.
--type icode_comment_text() :: atom() | string() | {atom(), term()}.
+-type icode_comment_text() :: atom() | string().
-type icode_info() :: [{'arg_types', [erl_types:erl_type()]}].
diff --git a/lib/hipe/icode/hipe_icode_inline_bifs.erl b/lib/hipe/icode/hipe_icode_inline_bifs.erl
index 27296dcad5..6ef15b9a18 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -29,7 +29,7 @@
%% Currently inlined BIFs:
%% and, or, xor, not, <, >, >=, =<, ==, /=, =/=, =:=
-%% is_atom, is_boolean, is_binary, is_constant, is_float, is_function,
+%% is_atom, is_boolean, is_binary, is_float, is_function,
%% is_integer, is_list, is_pid, is_port, is_reference, is_tuple
-module(hipe_icode_inline_bifs).
@@ -131,7 +131,6 @@ is_type_test(Name) ->
is_boolean -> {true, boolean};
is_function -> {true, function};
is_reference -> {true, reference};
- is_constant -> {true, constant};
is_port -> {true, port};
_ -> false
end.
diff --git a/lib/hipe/icode/hipe_icode_primops.erl b/lib/hipe/icode/hipe_icode_primops.erl
index a413531c07..b0113fc556 100644
--- a/lib/hipe/icode/hipe_icode_primops.erl
+++ b/lib/hipe/icode/hipe_icode_primops.erl
@@ -137,7 +137,8 @@ is_safe({hipe_bs_primop, {bs_private_append, _, _}}) -> false;
is_safe({hipe_bs_primop, bs_init_writable}) -> true;
is_safe(#mkfun{}) -> true;
is_safe(#unsafe_element{}) -> true;
-is_safe(#unsafe_update_element{}) -> true.
+is_safe(#unsafe_update_element{}) -> true;
+is_safe(debug_native_called) -> false.
-spec fails(icode_funcall()) -> boolean().
@@ -237,6 +238,7 @@ fails({hipe_bs_primop, bs_init_writable}) -> true;
fails(#mkfun{}) -> false;
fails(#unsafe_element{}) -> false;
fails(#unsafe_update_element{}) -> false;
+fails(debug_native_called) -> false;
%% Apparently, we are calling fails/1 for all MFAs which are compiled.
%% This is weird and we should restructure the compiler to avoid
%% calling fails/1 for things that are not primops.
@@ -721,6 +723,8 @@ type(Primop, Args) ->
erl_types:t_any();
redtest ->
erl_types:t_any();
+ debug_native_called ->
+ erl_types:t_any();
{M, F, A} ->
erl_bif_types:type(M, F, A, Args)
end.
@@ -893,6 +897,8 @@ type(Primop) ->
erl_types:t_any();
redtest ->
erl_types:t_any();
+ debug_native_called ->
+ erl_types:t_any();
{M, F, A} ->
erl_bif_types:type(M, F, A)
end.
diff --git a/lib/hipe/icode/hipe_icode_type.erl b/lib/hipe/icode/hipe_icode_type.erl
index 3f9488d7c3..046949d2f2 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -79,13 +79,13 @@
-import(erl_types, [number_min/1, number_max/1,
t_any/0, t_atom/1, t_atom/0, t_atom_vals/1,
t_binary/0, t_bitstr/0, t_bitstr_base/1, t_bitstr_unit/1,
- t_boolean/0, t_cons/0, t_constant/0,
+ t_boolean/0, t_cons/0,
t_float/0, t_from_term/1, t_from_range/2,
t_fun/0, t_fun/1, t_fun/2, t_fun_args/1, t_fun_arity/1,
t_inf/2, t_inf_lists/2, t_integer/0,
t_integer/1, t_is_atom/1, t_is_any/1,
t_is_binary/1, t_is_bitstr/1, t_is_bitwidth/1, t_is_boolean/1,
- t_is_fixnum/1, t_is_cons/1, t_is_constant/1,
+ t_is_fixnum/1, t_is_cons/1,
t_is_maybe_improper_list/1, t_is_equal/2, t_is_float/1,
t_is_fun/1, t_is_integer/1, t_is_non_neg_integer/1,
t_is_number/1, t_is_matchstate/1,
@@ -587,7 +587,6 @@ do_type(I, Info, Var) ->
TrueLab = hipe_icode:type_true_label(I),
FalseLab = hipe_icode:type_false_label(I),
None = t_none(),
-
case lookup(Var, Info) of
None ->
[{TrueLab, Info}, {FalseLab, Info}];
@@ -899,9 +898,7 @@ test_type0(list, T) ->
test_type0(cons, T) ->
t_is_cons(T);
test_type0(nil, T) ->
- t_is_nil(T);
-test_type0(constant, T) ->
- t_is_constant(T).
+ t_is_nil(T).
true_branch_info(integer) ->
@@ -940,8 +937,6 @@ true_branch_info(nil) ->
t_nil();
true_branch_info(boolean) ->
t_boolean();
-true_branch_info(constant) ->
- t_constant();
true_branch_info(T) ->
exit({?MODULE,unknown_typetest,T}).
@@ -1703,7 +1698,6 @@ lookup_list0([H|T], Info, Acc) ->
lookup_list0([], _, Acc) ->
lists:reverse(Acc).
-
%% safe_lookup treats anything that is neither in the map nor a
%% constant as t_any(). Use this during transformations.
diff --git a/lib/hipe/main/Makefile b/lib/hipe/main/Makefile
index a14c9c3ca4..673431a175 100644
--- a/lib/hipe/main/Makefile
+++ b/lib/hipe/main/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2010. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -93,6 +93,9 @@ clean:
rm -f $(TARGET_FILES) $(DOC_FILES) $(HRL_FILES)
rm -f core
+distclean: clean
+realclean: clean
+
$(DOCS)/%.html:%.erl
erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop
@@ -112,10 +115,10 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DATA) ../vsn.mk $(RELSYSDIR)
- $(INSTALL_DIR) $(RELSYSDIR)/main
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/main
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DATA) ../vsn.mk "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELSYSDIR)/main"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/main"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/hipe/main/hipe.app.src b/lib/hipe/main/hipe.app.src
index e5d6d1e540..7db4db8a57 100644
--- a/lib/hipe/main/hipe.app.src
+++ b/lib/hipe/main/hipe.app.src
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -24,7 +24,6 @@
{modules, [cerl_cconv,
cerl_closurean,
cerl_hipeify,
- cerl_hybrid_transform,
cerl_lib,
cerl_messagean,
cerl_pmatch,
@@ -74,7 +73,6 @@
hipe_arm_specific,
hipe_bb,
hipe_beam_to_icode,
- hipe_ceach,
hipe_coalescing_regalloc,
hipe_consttab,
hipe_data_pp,
diff --git a/lib/hipe/main/hipe.erl b/lib/hipe/main/hipe.erl
index 309d847374..b2789978a4 100644
--- a/lib/hipe/main/hipe.erl
+++ b/lib/hipe/main/hipe.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -482,12 +482,7 @@ compile(Name, File, Opts0) when is_atom(Name) ->
compile_core(Name, Core0, File, Opts) ->
Core = cerl:from_records(Core0),
- Core1 = case (erlang:system_info(heap_type) =:= hybrid)
- andalso proplists:get_bool(hybrid, Opts) of
- true -> cerl_hybrid_transform:transform(Core, Opts);
- false -> Core
- end,
- compile(Name, Core1, File, Opts).
+ compile(Name, Core, File, Opts).
%% @spec compile(Name, Core, File, options()) ->
%% {ok, {Target, Binary}} | {error, Reason}
@@ -574,12 +569,8 @@ file(File, Options) when is_atom(File) ->
disasm(File) ->
case beam_disasm:file(File) of
#beam_file{labeled_exports = LabeledExports,
- compile_info = CompInfo0,
+ compile_info = CompInfo,
code = BeamCode} ->
- CompInfo = case CompInfo0 of
- none -> [];
- _ -> CompInfo0
- end,
CompOpts = proplists:get_value(options, CompInfo, []),
HCompOpts = case lists:keyfind(hipe, 1, CompOpts) of
{hipe, L} when is_list(L) -> L;
diff --git a/lib/hipe/misc/Makefile b/lib/hipe/misc/Makefile
index 98a69d62c7..16166f552c 100644
--- a/lib/hipe/misc/Makefile
+++ b/lib/hipe/misc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2010. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -100,10 +100,10 @@ $(DOCS)/%.html:%.erl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/misc
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/misc
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/misc"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/misc"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/hipe/native.mk b/lib/hipe/native.mk
index 6f4602477b..738e78e556 100644
--- a/lib/hipe/native.mk
+++ b/lib/hipe/native.mk
@@ -1,5 +1,7 @@
-ifndef SECONDARY_BOOTSTRAP
ifeq ($(NATIVE_LIBS_ENABLED),yes)
+ifndef SECONDARY_BOOTSTRAP
ERL_COMPILE_FLAGS += +native
+else
+EBIN = ../boot_ebin
endif
endif
diff --git a/lib/hipe/opt/Makefile b/lib/hipe/opt/Makefile
index 4596201801..a21c543574 100644
--- a/lib/hipe/opt/Makefile
+++ b/lib/hipe/opt/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2010. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -80,6 +80,9 @@ clean:
rm -f $(TARGET_FILES)
rm -f core
+distclean: clean
+realclean: clean
+
$(DOCS)/%.html:%.erl
erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop
@@ -94,8 +97,8 @@ $(DOCS)/%.html:%.erl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/hipe/ppc/Makefile b/lib/hipe/ppc/Makefile
index f24139e34b..8bd2a8226c 100644
--- a/lib/hipe/ppc/Makefile
+++ b/lib/hipe/ppc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2010. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -92,6 +92,9 @@ clean:
rm -f $(TARGET_FILES)
rm -f core
+distclean: clean
+realclean: clean
+
$(DOCS)/%.html:%.erl
erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop
@@ -105,8 +108,8 @@ $(DOCS)/%.html:%.erl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/hipe/regalloc/Makefile b/lib/hipe/regalloc/Makefile
index 386f3589c6..d4be79ea85 100644
--- a/lib/hipe/regalloc/Makefile
+++ b/lib/hipe/regalloc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2010. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -94,6 +94,9 @@ clean:
rm -f $(TARGET_FILES)
rm -f core
+distclean: clean
+realclean: clean
+
$(DOCS)/%.html:%.erl
erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop
@@ -109,8 +112,8 @@ $(DOCS)/%.html:%.erl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/hipe/rtl/Makefile b/lib/hipe/rtl/Makefile
index 48086ec79f..426d1bd3ee 100644
--- a/lib/hipe/rtl/Makefile
+++ b/lib/hipe/rtl/Makefile
@@ -89,6 +89,9 @@ clean:
rm -f $(TARGET_FILES)
rm -f core erl_crash.dump
+distclean: clean
+realclean: clean
+
# ----------------------------------------------------
# Special Build Targets
# ----------------------------------------------------
@@ -100,10 +103,10 @@ clean:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/rtl
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/rtl
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/rtl"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/rtl"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/hipe/rtl/hipe_rtl_primops.erl b/lib/hipe/rtl/hipe_rtl_primops.erl
index 5f273d8251..53aaa72aa6 100644
--- a/lib/hipe/rtl/hipe_rtl_primops.erl
+++ b/lib/hipe/rtl/hipe_rtl_primops.erl
@@ -396,6 +396,8 @@ gen_primop({Op,Dst,Args,Cont,Fail}, IsGuard, ConstTab) ->
[Dst1]->
hipe_tagscheme:unsafe_tag_float(Dst1, Arg)
end;
+ debug_native_called ->
+ [hipe_rtl:mk_call(Dst, Op, Args, Cont, Fail, not_remote)];
%% Only names listed above are accepted! MFA:s are not primops!
_ ->
diff --git a/lib/hipe/sparc/Makefile b/lib/hipe/sparc/Makefile
index f25212a89b..eb40117691 100644
--- a/lib/hipe/sparc/Makefile
+++ b/lib/hipe/sparc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2010. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -92,6 +92,9 @@ clean:
rm -f $(TARGET_FILES)
rm -f core
+distclean: clean
+realclean: clean
+
$(DOCS)/%.html:%.erl
erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop
@@ -105,8 +108,8 @@ $(DOCS)/%.html:%.erl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/hipe/sparc/hipe_rtl_to_sparc.erl b/lib/hipe/sparc/hipe_rtl_to_sparc.erl
index df5e2b0077..dc001f865e 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -19,6 +19,7 @@
%%
-module(hipe_rtl_to_sparc).
+
-export([translate/1]).
-include("../rtl/hipe_rtl.hrl").
@@ -142,8 +143,7 @@ mk_fload_rr(Base1, Base2, Dst) ->
mk_fload_ii(Base1, Base2, Dst) ->
io:format("~w: RTL fload with two immediates\n", [?MODULE]),
Tmp = new_untagged_temp(),
- mk_set(Base1, Tmp,
- mk_fload_ri(Tmp, Base2, Dst)).
+ mk_set(Base1, Tmp, mk_fload_ri(Tmp, Base2, Dst)).
mk_fload_ri(Base, Disp, Dst) ->
hipe_sparc:mk_fload(Base, Disp, Dst, 'new').
@@ -239,8 +239,7 @@ mk_alu_ii(XAluOp, Src1, Src2, Dst) ->
io:format("~w: ALU with two immediates (~w ~w ~w ~w)\n",
[?MODULE, XAluOp, Src1, Src2, Dst]),
Tmp = new_untagged_temp(),
- mk_set(Src1, Tmp,
- mk_alu_ri(XAluOp, Tmp, Src2, Dst)).
+ mk_set(Src1, Tmp, mk_alu_ri(XAluOp, Tmp, Src2, Dst)).
mk_alu_ir(XAluOp, Src1, Src2, Dst) ->
case xaluop_commutes(XAluOp) of
@@ -249,8 +248,7 @@ mk_alu_ir(XAluOp, Src1, Src2, Dst) ->
true};
_ ->
Tmp = new_untagged_temp(),
- {mk_set(Src1, Tmp,
- mk_alu_rs(XAluOp, Tmp, Src2, Dst)),
+ {mk_set(Src1, Tmp, mk_alu_rs(XAluOp, Tmp, Src2, Dst)),
false}
end.
@@ -274,8 +272,7 @@ mk_arith_ri(XAluOp, Src1, Src2, Dst) when is_integer(Src2) ->
mk_alu_rs(XAluOp, Src1, hipe_sparc:mk_simm13(Src2), Dst);
true ->
Tmp = new_untagged_temp(),
- mk_set(Src2, Tmp,
- mk_alu_rs(XAluOp, Src1, Tmp, Dst))
+ mk_set(Src2, Tmp, mk_alu_rs(XAluOp, Src1, Tmp, Dst))
end.
mk_alu_rs(XAluOp, Src1, Src2, Dst) ->
@@ -623,8 +620,7 @@ mk_move(Src, Dst, Tail) ->
conv_return(I, Map, Data) ->
%% TODO: multiple-value returns
{[Arg], Map0} = conv_src_list(hipe_rtl:return_varlist(I), Map),
- I2 = mk_move(Arg, hipe_sparc:mk_rv(),
- [hipe_sparc:mk_pseudo_ret()]),
+ I2 = mk_move(Arg, hipe_sparc:mk_rv(), [hipe_sparc:mk_pseudo_ret()]),
{I2, Map0, Data}.
conv_store(I, Map, Data) ->
@@ -648,8 +644,7 @@ mk_store(StOp, Src, Base1, Base2) ->
mk_store2(StOp, Src, Base1, Base2);
_ ->
Tmp = new_untagged_temp(),
- mk_set(Src, Tmp,
- mk_store2(StOp, Tmp, Base1, Base2))
+ mk_set(Src, Tmp, mk_store2(StOp, Tmp, Base1, Base2))
end.
mk_store2(StOp, Src, Base1, Base2) ->
@@ -674,8 +669,7 @@ conv_switch(I, Map, Data) ->
[] ->
hipe_consttab:insert_block(Data, word, LMap);
SortOrder ->
- hipe_consttab:insert_sorted_block(
- Data, word, LMap, SortOrder)
+ hipe_consttab:insert_sorted_block(Data, word, LMap, SortOrder)
end,
%% no immediates allowed here
{IndexR, Map1} = conv_dst(hipe_rtl:switch_src(I), Map),
@@ -722,7 +716,7 @@ conv_aluop(RtlAluOp) ->
xaluop_commutes(XAluOp) ->
case XAluOp of
- 'cmp' -> true;
+ %% 'cmp' -> true;
'cmpcc' -> true;
'add' -> true;
'addcc' -> true;
@@ -739,16 +733,16 @@ xaluop_commutes(XAluOp) ->
'sll' -> false;
'srl' -> false;
'sra' -> false;
- 'sllx' -> false;
- 'srlx' -> false;
- 'srax' -> false;
+ %% 'sllx' -> false;
+ %% 'srlx' -> false;
+ %% 'srax' -> false;
'ldsb' -> true;
'ldsh' -> true;
- 'ldsw' -> true;
+ %% 'ldsw' -> true;
'ldub' -> true;
'lduh' -> true;
- 'lduw' -> true;
- 'ldx' -> true
+ 'lduw' -> true
+ %% 'ldx' -> true
end.
%%% Check if an extended SPARC AluOp is a shift.
diff --git a/lib/hipe/tools/Makefile b/lib/hipe/tools/Makefile
index f90d3c9f70..3ce8ad5dd7 100644
--- a/lib/hipe/tools/Makefile
+++ b/lib/hipe/tools/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2012. 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
@@ -96,8 +96,8 @@ $(DOCS)/%.html:%.erl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/hipe/tools/hipe_tool.erl b/lib/hipe/tools/hipe_tool.erl
index 990805ceca..efcf073efa 100644
--- a/lib/hipe/tools/hipe_tool.erl
+++ b/lib/hipe/tools/hipe_tool.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -30,6 +30,18 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-module(hipe_tool).
+-compile([{nowarn_deprecated_function,{gs,button,3}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,editor,3}},
+ {nowarn_deprecated_function,{gs,label,3}},
+ {nowarn_deprecated_function,{gs,listbox,3}},
+ {nowarn_deprecated_function,{gs,menu,3}},
+ {nowarn_deprecated_function,{gs,menubar,3}},
+ {nowarn_deprecated_function,{gs,menubutton,3}},
+ {nowarn_deprecated_function,{gs,menuitem,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
-export([start/0]).
diff --git a/lib/hipe/util/Makefile b/lib/hipe/util/Makefile
index 85719ec3d6..a5ee232057 100644
--- a/lib/hipe/util/Makefile
+++ b/lib/hipe/util/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2010. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -85,6 +85,9 @@ clean:
rm -f $(TARGET_FILES)
rm -f core
+distclean: clean
+realclean: clean
+
$(DOCS)/%.html:%.erl
erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop
@@ -100,10 +103,10 @@ $(DOCS)/%.html:%.erl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/util
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/util
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/util"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/util"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/hipe/vsn.mk b/lib/hipe/vsn.mk
index 347a0336cd..144167f5d1 100644
--- a/lib/hipe/vsn.mk
+++ b/lib/hipe/vsn.mk
@@ -1 +1 @@
-HIPE_VSN = 3.9
+HIPE_VSN = 3.9.2
diff --git a/lib/hipe/x86/Makefile b/lib/hipe/x86/Makefile
index d7d0c7bf5a..3602949944 100644
--- a/lib/hipe/x86/Makefile
+++ b/lib/hipe/x86/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2010. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -100,6 +100,9 @@ clean:
rm -f $(TARGET_FILES)
rm -f core
+distclean: clean
+realclean: clean
+
$(DOCS)/%.html:%.erl
erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop
@@ -113,8 +116,8 @@ $(DOCS)/%.html:%.erl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/ic/c_src/Makefile.in b/lib/ic/c_src/Makefile.in
index 5e034c47c6..de46eadb3b 100644
--- a/lib/ic/c_src/Makefile.in
+++ b/lib/ic/c_src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2011. All Rights Reserved.
+# Copyright Ericsson AB 1998-2012. 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
@@ -140,12 +140,12 @@ $(OBJDIR)/%.o: %.c
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/c_src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/priv/lib
- $(INSTALL_DATA) ic.c ic_tmo.c $(RELSYSDIR)/c_src
- $(INSTALL_DATA) $(IDL_FILES) $(H_FILES) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(LIBRARY) $(RELSYSDIR)/priv/lib
+ $(INSTALL_DIR) "$(RELSYSDIR)/c_src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/lib"
+ $(INSTALL_DATA) ic.c ic_tmo.c "$(RELSYSDIR)/c_src"
+ $(INSTALL_DATA) $(IDL_FILES) $(H_FILES) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(LIBRARY) "$(RELSYSDIR)/priv/lib"
release_docs_spec:
diff --git a/lib/ic/doc/src/Makefile b/lib/ic/doc/src/Makefile
index 208f16e441..af76cdeaaa 100644
--- a/lib/ic/doc/src/Makefile
+++ b/lib/ic/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2011. All Rights Reserved.
+# Copyright Ericsson AB 1998-2012. 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
@@ -220,12 +220,12 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
- (/bin/cp -rf $(HTMLDIR) $(RELSYSDIR)/doc)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3_FILES) $(RELEASE_PATH)/man/man3
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
+ (/bin/cp -rf $(HTMLDIR) "$(RELSYSDIR)/doc")
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3_FILES) "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/ic/doc/src/ic_clib.xml b/lib/ic/doc/src/ic_clib.xml
index b557c4b5f6..ebeaabae91 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>2009</year>
+ <year>2003</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -41,7 +41,7 @@
</section>
<funcs>
<func>
- <name><ret>CORBA_Environment*</ret><nametext>CORBA_Environment_alloc(int inbufsz, int outbufsz)</nametext></name>
+ <name><ret>CORBA_Environment *</ret><nametext>CORBA_Environment_alloc(int inbufsz, int outbufsz)</nametext></name>
<fsummary>Allocate environment data.</fsummary>
<desc>
<p>This function is used to allocate and initiate the
@@ -79,14 +79,14 @@
</desc>
</func>
<func>
- <name><ret>CORBA_char*</ret><nametext>CORBA_string_alloc(CORBA_unsigned_long len)</nametext></name>
+ <name><ret>CORBA_char *</ret><nametext>CORBA_string_alloc(CORBA_unsigned_long len)</nametext></name>
<fsummary>Allocate a string.</fsummary>
<desc>
<p>Allocates a (simple) CORBA character string of length <c>len + 1</c>.</p>
</desc>
</func>
<func>
- <name><ret>CORBA_wchar*</ret><nametext>CORBA_wstring_alloc(CORBA_unsigned_long len)</nametext></name>
+ <name><ret>CORBA_wchar *</ret><nametext>CORBA_wstring_alloc(CORBA_unsigned_long len)</nametext></name>
<fsummary>Allocate a wide string.</fsummary>
<desc>
<p>Allocates a CORBA wide string of length <c>len + 1</c>.</p>
@@ -101,7 +101,7 @@
</section>
<funcs>
<func>
- <name><ret>CORBA_char*</ret><nametext>CORBA_exception_id(CORBA_Environment *env)</nametext></name>
+ <name><ret>CORBA_char *</ret><nametext>CORBA_exception_id(CORBA_Environment *env)</nametext></name>
<fsummary>Get exception identity.</fsummary>
<desc>
<p>Returns the exception identity if an exception is set, otherwise
@@ -109,7 +109,7 @@
</desc>
</func>
<func>
- <name><ret>void*</ret><nametext>CORBA_exception_value(CORBA_Environment *env)</nametext></name>
+ <name><ret>void *</ret><nametext>CORBA_exception_value(CORBA_Environment *env)</nametext></name>
<fsummary>Get exception value.</fsummary>
<desc>
<p>Returns the exception value, if an exception is set, otherwise
@@ -160,7 +160,7 @@
</desc>
</func>
<func>
- <name><ret>oe_map_t*</ret><nametext>oe_merge_maps(oe_map_t *maps, int size)</nametext></name>
+ <name><ret>oe_map_t *</ret><nametext>oe_merge_maps(oe_map_t *maps, int size)</nametext></name>
<fsummary>Merge an array of server maps to one single map.</fsummary>
<desc>
<p>Merge an array of server maps to one single map.</p>
diff --git a/lib/ic/doc/src/notes.xml b/lib/ic/doc/src/notes.xml
index 6329bf1fb5..3ac35aa0e5 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>2011</year>
+ <year>1998</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,7 +30,45 @@
<file>notes.xml</file>
</header>
- <section><title>IC 4.2.29</title>
+ <section><title>IC 4.2.31</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fix bug where the ic pre-processor would ignore
+ whitespace quoting.</p>
+ <p>
+ Own Id: OTP-10109</p>
+ </item>
+ <item>
+ <p> A bug regarding spaces in C function prototypes has
+ been fixed. (Thanks to Richard O'Keefe.) </p>
+ <p>
+ Own Id: OTP-10138</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>IC 4.2.30</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Add generation of Erlang callback functions to generated
+ Erlang source code to avoid compiler warnings.</p>
+ <p>
+ Own Id: OTP-9998</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>IC 4.2.29</title>
<section><title>Improvements and New Features</title>
<list>
diff --git a/lib/ic/examples/pre_post_condition/Makefile b/lib/ic/examples/pre_post_condition/Makefile
index 8f85babb1a..d18f81fec9 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-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -124,8 +124,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/examples/pre_post_condition
- $(INSTALL_DATA) $(ERL_FILES) $(IDL_FILES) $(TXT_FILES) $(RELSYSDIR)/examples/pre_post_condition
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/pre_post_condition"
+ $(INSTALL_DATA) $(ERL_FILES) $(IDL_FILES) $(TXT_FILES) "$(RELSYSDIR)/examples/pre_post_condition"
release_docs_spec:
diff --git a/lib/ic/java_src/com/ericsson/otp/ic/Makefile b/lib/ic/java_src/com/ericsson/otp/ic/Makefile
index f730749ccb..cf4c353f3f 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-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -109,10 +109,10 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/java_src/com/ericsson/otp/ic
- $(INSTALL_DATA) $(JAVA_FILES) $(RELSYSDIR)/java_src/com/ericsson/otp/ic
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DATA) $(JAVA_DEST_ROOT)$(JARFILE) $(RELSYSDIR)/priv
+ $(INSTALL_DIR) "$(RELSYSDIR)/java_src/com/ericsson/otp/ic"
+ $(INSTALL_DATA) $(JAVA_FILES) "$(RELSYSDIR)/java_src/com/ericsson/otp/ic"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) $(JAVA_DEST_ROOT)$(JARFILE) "$(RELSYSDIR)/priv"
release_docs_spec:
diff --git a/lib/ic/src/Makefile b/lib/ic/src/Makefile
index 5dac304e32..280d86a8a4 100644
--- a/lib/ic/src/Makefile
+++ b/lib/ic/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2009. All Rights Reserved.
+# Copyright Ericsson AB 1998-2012. 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
@@ -196,23 +196,23 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(YRL_FILE) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/examples
- $(INSTALL_DIR) $(RELSYSDIR)/examples/c-client
- $(INSTALL_DATA) $(CCL_EX_FILES) $(RELSYSDIR)/examples/c-client
- $(INSTALL_DIR) $(RELSYSDIR)/examples/c-server
- $(INSTALL_DATA) $(CSRV_EX_FILES) $(RELSYSDIR)/examples/c-server
- $(INSTALL_DIR) $(RELSYSDIR)/examples/erl-plain
- $(INSTALL_DATA) $(EPL_EX_FILES) $(RELSYSDIR)/examples/erl-plain
- $(INSTALL_DIR) $(RELSYSDIR)/examples/erl-genserv
- $(INSTALL_DATA) $(ESRV_EX_FILES) $(RELSYSDIR)/examples/erl-genserv
- $(INSTALL_DIR) $(RELSYSDIR)/examples/java-client-server
- $(INSTALL_DATA) $(JAVA_EX_FILES) $(RELSYSDIR)/examples/java-client-server
- $(INSTALL_DIR) $(RELSYSDIR)/examples/all-against-all
- $(INSTALL_DATA) $(MIXED_EX_FILES) $(RELSYSDIR)/examples/all-against-all
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(YRL_FILE) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/c-client"
+ $(INSTALL_DATA) $(CCL_EX_FILES) "$(RELSYSDIR)/examples/c-client"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/c-server"
+ $(INSTALL_DATA) $(CSRV_EX_FILES) "$(RELSYSDIR)/examples/c-server"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/erl-plain"
+ $(INSTALL_DATA) $(EPL_EX_FILES) "$(RELSYSDIR)/examples/erl-plain"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/erl-genserv"
+ $(INSTALL_DATA) $(ESRV_EX_FILES) "$(RELSYSDIR)/examples/erl-genserv"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/java-client-server"
+ $(INSTALL_DATA) $(JAVA_EX_FILES) "$(RELSYSDIR)/examples/java-client-server"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/all-against-all"
+ $(INSTALL_DATA) $(MIXED_EX_FILES) "$(RELSYSDIR)/examples/all-against-all"
release_docs_spec:
diff --git a/lib/ic/src/ic.erl b/lib/ic/src/ic.erl
index 50fad921c4..c0742cf7bd 100644
--- a/lib/ic/src/ic.erl
+++ b/lib/ic/src/ic.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -250,7 +250,7 @@ make_erl_options(Opts) ->
Optimize = Opts#options.optimize,
PreProc =
lists:flatten(
- lists:map(fun(D) -> io_lib:format("-I~s ", [ic_util:to_list(D)]) end,
+ lists:map(fun(D) -> io_lib:format("-I\"~s\" ", [ic_util:to_list(D)]) end,
Includes1)++
lists:map(
fun ({Name, Value}) ->
diff --git a/lib/ic/src/ic_noc.erl b/lib/ic/src/ic_noc.erl
index d43d550a52..fcb413ba2e 100644
--- a/lib/ic/src/ic_noc.erl
+++ b/lib/ic/src/ic_noc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -289,6 +289,9 @@ emit_serv_std(G, N, X) ->
emit(Fd, "terminate(Reason, State) ->\n"),
emit(Fd, " ~p:~p(Reason, State).\n",
[Impl, terminate]),
+ nl(Fd),
+ emit(Fd, "code_change(_OldVsn, State, _Extra) ->\n"),
+ emit(Fd, " {ok, State}.\n"),
nl(Fd), nl(Fd)
end,
Fd.
@@ -304,13 +307,13 @@ gen_end_of_call(G, _N, _X) ->
Fd = ic_genobj:stubfiled(G),
nl(Fd), nl(Fd),
ic_codegen:mcomment_light(Fd, ["Standard gen_server call handle"]),
- emit(Fd, "handle_call(stop, From, State) ->\n"),
+ emit(Fd, "handle_call(stop, _From, State) ->\n"),
emit(Fd, " {stop, normal, ok, State}"),
case get_opt(G, serv_last_call) of
exception ->
emit(Fd, ";\n"),
nl(Fd),
- emit(Fd, "handle_call(Req, From, State) ->\n"),
+ emit(Fd, "handle_call(_Req, _From, State) ->\n"),
emit(Fd, " {reply, ~p, State}.\n",[getCallErr()]);
exit ->
emit(Fd, ".\n"),
@@ -335,7 +338,7 @@ gen_end_of_cast(G, _N, _X) ->
exception ->
emit(Fd, ";\n"),
nl(Fd),
- emit(Fd, "handle_cast(Req, State) ->\n"),
+ emit(Fd, "handle_cast(_Req, State) ->\n"),
emit(Fd, " {reply, ~p, State}.\n",[getCastErr()]);
exit ->
emit(Fd, ".\n"),
@@ -353,12 +356,13 @@ emit_skel_footer(G, N, X) ->
Fd = ic_genobj:stubfiled(G),
nl(Fd), nl(Fd),
ic_codegen:mcomment_light(Fd, ["Standard gen_server handles"]),
- emit(Fd, "handle_info(X, State) ->\n"),
case use_impl_handle_info(G, N, X) of
true ->
+ emit(Fd, "handle_info(X, State) ->\n"),
emit(Fd, " ~p:handle_info(X, State).\n\n",
[list_to_atom(ic_genobj:impl(G))]);
false ->
+ emit(Fd, "handle_info(_X, State) ->\n"),
emit(Fd, " {reply, ~p, State}.\n\n",[getInfoErr()])
end
end,
@@ -402,9 +406,8 @@ get_if_gen(G, N, X) ->
[io_lib:format("Standard Operation: ~p",
[Name])]),
- emit(Fd, "handle_call({~s, ~p, []}, From, State) ->~n",
+ emit(Fd, "handle_call({_~s, ~p, []}, _From, State) ->~n",
[mk_name(G, "Ref"), Name]),
-
emit(Fd, " {reply, ~p, State};~n", [IFC_TKS]),
nl(Fd),
ok;
@@ -479,8 +482,8 @@ gen_head_special(G, N, X) when is_record(X, interface) ->
nl(Fd),
ic_codegen:comment(Fd, "gen server export stuff"),
emit(Fd, "-behaviour(gen_server).\n"),
- ic_codegen:export(Fd, [{init, 1}, {terminate, 2}, {handle_call, 3},
- {handle_cast, 2}, {handle_info, 2}]),
+ ic_codegen:export(Fd, [{init, 1}, {terminate, 2}, {code_change, 3},
+ {handle_call, 3}, {handle_cast, 2}, {handle_info, 2}]),
nl(Fd), nl(Fd),
ic_codegen:mcomment(Fd, ["Object interface functions."]),
nl(Fd), nl(Fd), nl(Fd)
diff --git a/lib/ic/src/ic_pp.erl b/lib/ic/src/ic_pp.erl
index 8b53473caa..54701f7438 100644
--- a/lib/ic/src/ic_pp.erl
+++ b/lib/ic/src/ic_pp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -1894,23 +1894,37 @@ include_dir(Flags) when is_list(Flags)->
include_dir(_Flags) ->
[].
-include_dir(Flags,IncDir) ->
+include_dir(Flags,IncDirs) ->
case string:str(Flags,"-I") of
0 ->
- lists:reverse(IncDir);
+ lists:reverse(IncDirs);
X ->
- Rem2 = string:sub_string(Flags, X+2),
- Rem = string:strip(Rem2, left),
- Y = string:str(Rem," "),
- case string:str(Rem," ") of
- 0 ->
- lists:reverse([string:sub_string(Rem, Y+1)|IncDir]);
- Y ->
- include_dir(string:sub_string(Rem, Y+1),
- [string:sub_string(Rem,1,Y-1)|IncDir])
- end
+ {NewDir, RemainingFlags} =
+ gobble_inc_dir(string:sub_string(Flags, X+2),nq,[]),
+ include_dir(RemainingFlags, [NewDir|IncDirs])
end.
+% nq = not-quoted, q = quoted.
+% Possible strange scenarios:
+% /usr/test\ ing/
+% "/usr/test ing/"
+% /usr/test\"ing/
+% "/usr/test\"ing/"
+gobble_inc_dir([],nq,Acc) ->
+ % Only accept nq here, if we end up here in q mode the user has missed a "
+ {lists:reverse(Acc),[]};
+gobble_inc_dir([$\\,$"|R],Q,Acc) ->
+ gobble_inc_dir(R,Q,[$"|Acc]);
+gobble_inc_dir([$"|R],nq,Acc) ->
+ gobble_inc_dir(R,q,Acc);
+gobble_inc_dir([$"|R],q,Acc) ->
+ gobble_inc_dir(R,nq,Acc);
+gobble_inc_dir([$\\,$ |R],nq,Acc) ->
+ gobble_inc_dir(R,nq,[$ |Acc]);
+gobble_inc_dir([$ |R],nq,Acc) ->
+ {lists:reverse(Acc),R};
+gobble_inc_dir([C|R],Q,Acc) ->
+ gobble_inc_dir(R,Q,[C|Acc]).
%%===============================================================
@@ -1954,7 +1968,6 @@ find_inc_file2(FileName, [D|Rem]) ->
_ ->
D++"/"
end,
-
case catch file:read_file_info(Dir++FileName) of
{ok, _} ->
{ok, Dir++FileName};
diff --git a/lib/ic/test/Makefile b/lib/ic/test/Makefile
index 1d90a1bc17..54ac186c16 100644
--- a/lib/ic/test/Makefile
+++ b/lib/ic/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2011. All Rights Reserved.
+# Copyright Ericsson AB 1998-2012. 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
@@ -239,39 +239,39 @@ release_spec:
release_docs_spec:
release_tests_spec: tests
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELSYSDIR)/ic_SUITE_data
- $(INSTALL_DIR) $(RELSYSDIR)/ic_register_SUITE_data
- $(INSTALL_DIR) $(RELSYSDIR)/ic_pragma_SUITE_data
- $(INSTALL_DIR) $(RELSYSDIR)/ic_pp_SUITE_data
- $(INSTALL_DIR) $(RELSYSDIR)/ic_be_SUITE_data
- $(INSTALL_DIR) $(RELSYSDIR)/c_client_erl_server_SUITE_data
- $(INSTALL_DIR) $(RELSYSDIR)/c_client_erl_server_proto_SUITE_data
- $(INSTALL_DIR) $(RELSYSDIR)/c_client_erl_server_proto_tmo_SUITE_data
- $(INSTALL_DIR) $(RELSYSDIR)/erl_client_c_server_SUITE_data
- $(INSTALL_DIR) $(RELSYSDIR)/erl_client_c_server_proto_SUITE_data
- $(INSTALL_DIR) $(RELSYSDIR)/java_client_erl_server_SUITE_data
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ic_SUITE_data"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ic_register_SUITE_data"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ic_pragma_SUITE_data"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ic_pp_SUITE_data"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ic_be_SUITE_data"
+ $(INSTALL_DIR) "$(RELSYSDIR)/c_client_erl_server_SUITE_data"
+ $(INSTALL_DIR) "$(RELSYSDIR)/c_client_erl_server_proto_SUITE_data"
+ $(INSTALL_DIR) "$(RELSYSDIR)/c_client_erl_server_proto_tmo_SUITE_data"
+ $(INSTALL_DIR) "$(RELSYSDIR)/erl_client_c_server_SUITE_data"
+ $(INSTALL_DIR) "$(RELSYSDIR)/erl_client_c_server_proto_SUITE_data"
+ $(INSTALL_DIR) "$(RELSYSDIR)/java_client_erl_server_SUITE_data"
$(INSTALL_DATA) $(IDL_FILES) ic.cover $(TEST_SPEC_FILE) $(ERL_FILES) \
- $(RELSYSDIR)
- $(INSTALL_DATA) $(COMPILER_TEST_FILES) $(RELSYSDIR)/ic_SUITE_data
+ "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(COMPILER_TEST_FILES) "$(RELSYSDIR)/ic_SUITE_data"
$(INSTALL_DATA) $(COMPILER_TEST_FILES2) \
- $(RELSYSDIR)/ic_register_SUITE_data
+ "$(RELSYSDIR)/ic_register_SUITE_data"
$(INSTALL_DATA) $(COMPILER_TEST_FILES3) \
- $(RELSYSDIR)/ic_pragma_SUITE_data
+ "$(RELSYSDIR)/ic_pragma_SUITE_data"
$(INSTALL_DATA) $(COMPILER_TEST_FILES4) \
- $(RELSYSDIR)/ic_be_SUITE_data
+ "$(RELSYSDIR)/ic_be_SUITE_data"
$(INSTALL_DATA) $(PREPROCESSOR_TEST_FILES) \
- $(RELSYSDIR)/ic_pp_SUITE_data
+ "$(RELSYSDIR)/ic_pp_SUITE_data"
$(INSTALL_DATA) $(C_CLIENT_ERL_SERVER_TEST_FILES) \
- $(RELSYSDIR)/c_client_erl_server_SUITE_data
+ "$(RELSYSDIR)/c_client_erl_server_SUITE_data"
$(INSTALL_DATA) $(C_CLIENT_ERL_SERVER_PROTO_TEST_FILES) \
- $(RELSYSDIR)/c_client_erl_server_proto_SUITE_data
+ "$(RELSYSDIR)/c_client_erl_server_proto_SUITE_data"
$(INSTALL_DATA) $(C_CLIENT_ERL_SERVER_PROTO_TMO_TEST_FILES) \
- $(RELSYSDIR)/c_client_erl_server_proto_tmo_SUITE_data
+ "$(RELSYSDIR)/c_client_erl_server_proto_tmo_SUITE_data"
$(INSTALL_DATA) $(ERL_CLIENT_C_SERVER_TEST_FILES) \
- $(RELSYSDIR)/erl_client_c_server_SUITE_data
+ "$(RELSYSDIR)/erl_client_c_server_SUITE_data"
$(INSTALL_DATA) $(ERL_CLIENT_C_SERVER_PROTO_TEST_FILES) \
- $(RELSYSDIR)/erl_client_c_server_proto_SUITE_data
- $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR)
+ "$(RELSYSDIR)/erl_client_c_server_proto_SUITE_data"
+ $(INSTALL_DATA) $(SUITE_TARGET_FILES) "$(RELSYSDIR)"
$(INSTALL_DATA) $(JAVA_CLIENT_ERL_SERVER_TEST_FILES) \
- $(RELSYSDIR)/java_client_erl_server_SUITE_data
+ "$(RELSYSDIR)/java_client_erl_server_SUITE_data"
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 d5277eb256..f3e6fdb67e 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-2011. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -122,24 +122,33 @@ EBINS = $(ERL_FILES:.erl=.@EMULATOR@)
all: $(PGMS) $(EBINS)
+$(GEN_ERL_FILES) $(GEN_HRL_FILES): c_erl_test.built_erl
+$(GEN_C_FILES) $(GEN_H_FILES): c_erl_test.built_c
+$(OBJS): $(GEN_C_FILES) $(GEN_H_FILES)
+$(EBINS): $(GEN_ERL_FILES) $(GEN_HRL_FILES)
+
clean:
-rm -f $(OBJS) $(GEN_C_FILES) $(GEN_H_FILES) $(PGMS) \
- $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES)
+ $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES) \
+ c_erl_test.built_erl c_erl_test.built_c
-del /F /Q $(OBJS) $(GEN_C_FILES) $(GEN_H_FILES) $(PGMS) \
- $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES)
+ $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES) \
+ c_erl_test.built_erl c_erl_test.built_c
$(PGMS): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
-$(GEN_C_FILES) $(GEN_H_FILES): c_erl_test.idl
+c_erl_test.built_c: c_erl_test.idl
$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,c_client}" c_erl_test.idl
+ echo done > c_erl_test.built_c
-$(GEN_ERL_FILES) $(GEN_HRL_FILES): c_erl_test.idl
+c_erl_test.built_erl: c_erl_test.idl
$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,erl_genserv}" c_erl_test.idl
+ echo done > c_erl_test.built_erl
-.c@obj@:
+.c@obj@:
$(CC) -c -o $*@obj@ $(CFLAGS) $<
-.erl.@EMULATOR@:
+.erl.@EMULATOR@:
$(ERLC) -I $(IC_INCLUDE_PATH) $<
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 8bc1a907a7..0818be01a6 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-2011. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -122,25 +122,34 @@ EBINS = $(ERL_FILES:.erl=.@EMULATOR@)
all: $(PGMS) $(EBINS)
+$(GEN_ERL_FILES) $(GEN_HRL_FILES): c_erl_test.built_erl
+$(GEN_C_FILES) $(GEN_H_FILES): c_erl_test.built_c
+$(OBJS): $(GEN_C_FILES) $(GEN_H_FILES)
+$(EBINS): $(GEN_ERL_FILES) $(GEN_HRL_FILES)
+
clean:
-rm -f $(OBJS) $(GEN_C_FILES) $(GEN_H_FILES) $(PGMS) \
- $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES)
+ $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES) \
+ c_erl_test.built_erl c_erl_test.built_c
-del /F /Q $(OBJS) $(GEN_C_FILES) $(GEN_H_FILES) $(PGMS) \
- $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES)
+ $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES) \
+ c_erl_test.built_erl c_erl_test.built_c
$(PGMS): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
-$(GEN_C_FILES) $(GEN_H_FILES): c_erl_test.idl
+c_erl_test.built_c: c_erl_test.idl
$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,c_client}" \
"+{user_protocol,my}" c_erl_test.idl
+ echo done > c_erl_test.built_c
-$(GEN_ERL_FILES) $(GEN_HRL_FILES): c_erl_test.idl
+c_erl_test.built_erl: c_erl_test.idl
$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,erl_genserv}" c_erl_test.idl
+ echo done > c_erl_test.built_erl
-.c@obj@:
+.c@obj@:
$(CC) -c -o $*@obj@ $(CFLAGS) $<
-.erl.@EMULATOR@:
+.erl.@EMULATOR@:
$(ERLC) -I $(IC_INCLUDE_PATH) $<
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 2585341791..07b353bc0a 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-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -122,25 +122,33 @@ EBINS = $(ERL_FILES:.erl=.@EMULATOR@)
all: $(PGMS) $(EBINS)
+$(GEN_ERL_FILES) $(GEN_HRL_FILES): c_erl_test.built_erl
+$(GEN_C_FILES) $(GEN_H_FILES): c_erl_test.built_c
+$(OBJS): $(GEN_C_FILES) $(GEN_H_FILES)
+$(EBINS): $(GEN_ERL_FILES) $(GEN_HRL_FILES)
+
clean:
-rm -f $(OBJS) $(GEN_C_FILES) $(GEN_H_FILES) $(PGMS) \
- $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES)
+ $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES) \
+ c_erl_test.built_erl c_erl_test.built_c
-del /F /Q $(OBJS) $(GEN_C_FILES) $(GEN_H_FILES) $(PGMS) \
- $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES)
+ $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES) \
+ c_erl_test.built_erl c_erl_test.built_c
$(PGMS): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
-$(GEN_C_FILES) $(GEN_H_FILES): c_erl_test.idl
- $(ERLC) -I $(IC_INCLUDE_PATH) "+{be,c_client}" \
- "+{user_protocol,my}" "+{c_timeout,{5000,5000}}" c_erl_test.idl
+c_erl_test.built_c: c_erl_test.idl
+ $(ERLC) -I $(IC_INCLUDE_PATH) "+{be,c_client}" c_erl_test.idl
+ echo done > c_erl_test.built_c
-$(GEN_ERL_FILES) $(GEN_HRL_FILES): c_erl_test.idl
+c_erl_test.built_erl: c_erl_test.idl
$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,erl_genserv}" c_erl_test.idl
+ echo done > c_erl_test.built_erl
-.c@obj@:
+.c@obj@:
$(CC) -c -o $*@obj@ $(CFLAGS) $<
-.erl.@EMULATOR@:
+.erl.@EMULATOR@:
$(ERLC) -I $(IC_INCLUDE_PATH) $<
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 50cf9d4445..e190295d70 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-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2012. 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
@@ -122,25 +122,34 @@ EBINS = $(ERL_FILES:.erl=.@EMULATOR@)
all: $(PGMS) $(EBINS)
+$(GEN_ERL_FILES) $(GEN_HRL_FILES): c_erl_test.built_erl
+$(GEN_C_FILES) $(GEN_H_FILES): c_erl_test.built_c
+$(OBJS): $(GEN_C_FILES) $(GEN_H_FILES)
+$(EBINS): $(GEN_ERL_FILES) $(GEN_HRL_FILES)
+
clean:
-rm -f $(OBJS) $(GEN_C_FILES) $(GEN_H_FILES) $(PGMS) \
- $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES)
+ $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES) \
+ c_erl_test.built_erl c_erl_test.built_c
-del /F /Q $(OBJS) $(GEN_C_FILES) $(GEN_H_FILES) $(PGMS) \
- $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES)
+ $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES) \
+ c_erl_test.built_erl c_erl_test.built_c
$(PGMS): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
-$(GEN_C_FILES) $(GEN_H_FILES): erl_c_test.idl
+c_erl_test.built_c: erl_c_test.idl
$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,c_server}" \
"+{scoped_op_calls,true}" erl_c_test.idl
+ echo done > c_erl_test.built_c
# If we have scoped operation calls for C, we must have that for
# Erlang as well, if we use the m_i.erl file for calling the server.
-$(GEN_ERL_FILES) $(GEN_HRL_FILES): erl_c_test.idl
+c_erl_test.built_erl: erl_c_test.idl
$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,erl_genserv}" \
"+{scoped_op_calls,true}" "+{timeout,true}" erl_c_test.idl
+ echo done > c_erl_test.built_erl
.c@obj@:
$(CC) -c -o $*@obj@ $(CFLAGS) $<
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 6c7701ca50..86917950c9 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-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -122,25 +122,34 @@ EBINS = $(ERL_FILES:.erl=.@EMULATOR@)
all: $(PGMS) $(EBINS)
+$(GEN_ERL_FILES) $(GEN_HRL_FILES): c_erl_test.built_erl
+$(GEN_C_FILES) $(GEN_H_FILES): c_erl_test.built_c
+$(OBJS): $(GEN_C_FILES) $(GEN_H_FILES)
+$(EBINS): $(GEN_ERL_FILES) $(GEN_HRL_FILES)
+
clean:
-rm -f $(OBJS) $(GEN_C_FILES) $(GEN_H_FILES) $(PGMS) \
- $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES)
+ $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES) \
+ c_erl_test.built_erl c_erl_test.built_c
-del /F /Q $(OBJS) $(GEN_C_FILES) $(GEN_H_FILES) $(PGMS) \
- $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES)
+ $(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES) \
+ c_erl_test.built_erl c_erl_test.built_c
$(PGMS): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
-$(GEN_C_FILES) $(GEN_H_FILES): erl_c_test.idl
+c_erl_test.built_c: erl_c_test.idl
$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,c_server}" \
"+{scoped_op_calls,true}" erl_c_test.idl
+ echo done > c_erl_test.built_c
# If we have scoped operation calls for C, we must have that for
# Erlang as well, if we use the m_i.erl file for calling the server.
-$(GEN_ERL_FILES) $(GEN_HRL_FILES): erl_c_test.idl
+c_erl_test.built_erl: erl_c_test.idl
$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,erl_genserv}" \
"+{scoped_op_calls,true}" "+{timeout,true}" erl_c_test.idl
+ echo done > c_erl_test.built_erl
.c@obj@:
$(CC) -c -o $*@obj@ $(CFLAGS) $<
diff --git a/lib/ic/test/java_client_erl_server_SUITE.erl b/lib/ic/test/java_client_erl_server_SUITE.erl
index 407c3d2d44..c2bec94697 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -249,7 +249,7 @@ marshal_any_2(Config) when is_list(Config) ->
java(Java, Dir, ClassAndArgs) ->
- cmd(Java++" -classpath "++classpath(Dir)++" "++ClassAndArgs).
+ cmd(Java++" -classpath \""++classpath(Dir)++"\" "++ClassAndArgs).
java(Java, Dir, Class, Args) ->
java(Java, Dir, Class++" "++to_string(Args)).
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 5e190fe1a5..ac8f2e619f 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-2011. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -66,23 +66,35 @@ CLASS_FILES = $(JAVA_FILES:.java=.class)
ERL_FILES = $(GEN_ERL_FILES) m_i_impl.erl
EBINS = $(ERL_FILES:.erl=.@EMULATOR@)
-
+@IFEQ@ (@jinterface_classpath@,)
+all:
+@ELSE
all: $(CLASS_FILES) $(EBINS)
+@ENDIF@
+
+$(GEN_ERL_FILES) $(GEN_HRL_FILES): java_erl_test.built_erl
+$(GEN_JAVA_FILES): java_erl_test.built_java
+$(CLASS_FILES): $(GEN_JAVA_FILES)
+$(EBINS): $(GEN_ERL_FILES) $(GEN_HRL_FILES)
clean:
-rm -f $(GEN_JAVA_FILES) $(CLASS_FILES) \
- $(GEN_ERL_FILES) $(GEN_HRL_FILES) $(EBINS)
+ $(GEN_ERL_FILES) $(GEN_HRL_FILES) $(EBINS) \
+ java_erl_test.built_erl java_erl_test.built_java
-del /F /Q $(GEN_JAVA_FILES) $(CLASS_FILES) \
- $(GEN_ERL_FILES) $(GEN_HRL_FILES) $(EBINS)
+ $(GEN_ERL_FILES) $(GEN_HRL_FILES) $(EBINS) \
+ java_erl_test.built_erl java_erl_test.built_java
-$(GEN_JAVA_FILES) : java_erl_test.idl
+java_erl_test.built_java: java_erl_test.idl
$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,java}" java_erl_test.idl
+ echo done > java_erl_test.built_java
$(CLASS_FILES) : $(JAVA_FILES)
$(JAVAC) -classpath $(CLASSPATH) $(JAVA_FILES)
-$(GEN_ERL_FILES) $(GEN_HRL_FILES): java_erl_test.idl
+java_erl_test.built_erl: java_erl_test.idl
$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,erl_genserv}" java_erl_test.idl
+ echo done > java_erl_test.built_erl
.erl.@EMULATOR@:
$(ERLC) -I $(IC_INCLUDE_PATH) $<
diff --git a/lib/ic/vsn.mk b/lib/ic/vsn.mk
index e21fc8fbb2..0dbf5a1f52 100644
--- a/lib/ic/vsn.mk
+++ b/lib/ic/vsn.mk
@@ -1 +1 @@
-IC_VSN = 4.2.29
+IC_VSN = 4.2.31
diff --git a/lib/inets/doc/src/Makefile b/lib/inets/doc/src/Makefile
index 53d505b102..1a8e1c7ca8 100644
--- a/lib/inets/doc/src/Makefile
+++ b/lib/inets/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -48,6 +48,7 @@ XML_REF3_FILES = \
inets.xml \
ftp.xml \
tftp.xml \
+ http_uri.xml\
httpc.xml\
httpd.xml \
httpd_conf.xml \
@@ -139,13 +140,13 @@ clean_man:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(HTMLDIR)/* $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(HTMLDIR)/* "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/inets/doc/src/book.xml b/lib/inets/doc/src/book.xml
index 7da0abd98f..51cbb2d963 100644
--- a/lib/inets/doc/src/book.xml
+++ b/lib/inets/doc/src/book.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE book SYSTEM "book.dtd">
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header titlestyle="normal">
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/fascicules.xml b/lib/inets/doc/src/fascicules.xml
index 101e745722..ea3b988882 100644
--- a/lib/inets/doc/src/fascicules.xml
+++ b/lib/inets/doc/src/fascicules.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE fascicules SYSTEM "fascicules.dtd">
<fascicules>
diff --git a/lib/inets/doc/src/ftp_client.xml b/lib/inets/doc/src/ftp_client.xml
index 7f62a453a6..b44674d997 100644
--- a/lib/inets/doc/src/ftp_client.xml
+++ b/lib/inets/doc/src/ftp_client.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/http_uri.xml b/lib/inets/doc/src/http_uri.xml
new file mode 100644
index 0000000000..bd31ae42d2
--- /dev/null
+++ b/lib/inets/doc/src/http_uri.xml
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="iso-8859-1" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2012</year><year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ </legalnotice>
+
+ <title>http_uri</title>
+ <prepared></prepared>
+ <responsible></responsible>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ </header>
+
+ <module>http_uri</module>
+ <modulesummary>URI utility module</modulesummary>
+
+ <description>
+ <p>This module provides utility functions for working with URIs,
+ according to RFC 3986. </p>
+
+ </description>
+
+ <section>
+ <title>COMMON DATA TYPES </title>
+ <p>Type definitions that are used more than once in
+ this module:</p>
+ <code type="none"><![CDATA[
+boolean() = true | false
+string() = list of ASCII characters
+ ]]></code>
+
+ </section>
+
+ <section>
+ <title>URI DATA TYPES </title>
+ <p>Type definitions that are related to URI:</p>
+ <p>For more information about URI, see RFC 3986. </p>
+
+ <code type="none"><![CDATA[
+uri() = string() - Syntax according to the URI definition in rfc 3986, ex: "http://www.erlang.org/"
+user_info() = string()
+scheme() = atom() - Example: http, https
+host() = string()
+port() = pos_integer()
+path() = string() - Representing a file path or directory path
+query() = string()
+ ]]></code>
+
+ <marker id="scheme_defaults"></marker>
+ </section>
+
+ <funcs>
+ <func>
+ <name>scheme_defaults() -> SchemeDefaults</name>
+ <fsummary>A list of scheme and their default ports</fsummary>
+ <type>
+ <v>SchemeDefaults = [{scheme(), default_scheme_port_number()}] </v>
+ <v>default_scheme_port_number() = pos_integer()</v>
+ </type>
+ <desc>
+ <p>This function provides a list of the scheme and their default
+ port numbers currently supported (by default) by this utility. </p>
+
+ <marker id="parse"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>parse(URI) -> {ok, Result} | {error, Reason}</name>
+ <name>parse(URI, Options) -> {ok, Result} | {error, Reason}</name>
+ <fsummary>Parse an URI</fsummary>
+ <type>
+ <v>URI = uri() </v>
+ <v>Options = [Option] </v>
+ <v>Option = {ipv6_host_with_brackets, boolean()} |
+ {scheme_defaults, scheme_defaults()}]</v>
+ <v>Result = {Scheme, UserInfo, Host, Port, Path, Query}</v>
+ <v>UserInfo = user_info()</v>
+ <v>Host = host()</v>
+ <v>Port = pos_integer()</v>
+ <v>Path = path()</v>
+ <v>Query = query()</v>
+ <v>Reason = term() </v>
+ </type>
+ <desc>
+ <p>This function is used to parse an URI. If no scheme defaults
+ are provided, the value of
+ <seealso marker="#scheme_defaults">scheme_defaults</seealso>
+ function will be used. </p>
+
+ <p>Note that when parsing an URI with an unknown scheme (that is,
+ a scheme not found in the scheme defaults) a port number must be
+ provided or else the parsing will fail. </p>
+
+ <marker id="encode"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>encode(URI) -> HexEncodedURI</name>
+
+ <fsummary>Hex encode an URI</fsummary>
+ <type>
+ <v>URI = uri()</v>
+ <v>HexEncodedURI = string() - Hex encoded uri</v>
+ </type>
+
+ <desc>
+ <p>Hex encode an URI. </p>
+
+ <marker id="decode"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>decode(HexEncodedURI) -> URI</name>
+
+ <fsummary>Decode a hex encoded URI</fsummary>
+ <type>
+ <v>HexEncodedURI = string() - A possibly hex encoded uri</v>
+ <v>URI = uri()</v>
+ </type>
+
+ <desc>
+ <p>Decode a possibly hex encoded URI. </p>
+
+ </desc>
+ </func>
+
+ </funcs>
+
+<!--
+ <section>
+ <title>SEE ALSO</title>
+ <p>RFC 2616, <seealso marker="inets">inets(3)</seealso>,
+ <seealso marker="kernel:gen_tcp">gen_tcp(3)</seealso>,
+ <seealso marker="ssl:ssl">ssl(3)</seealso>
+ </p>
+ </section>
+-->
+
+</erlref>
diff --git a/lib/inets/doc/src/httpc.xml b/lib/inets/doc/src/httpc.xml
index 48a2089605..741f2abaef 100644
--- a/lib/inets/doc/src/httpc.xml
+++ b/lib/inets/doc/src/httpc.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -43,8 +43,12 @@
cookies and other options that can be applied to more than one
request. </p>
- <p>If the scheme
- https is used the ssl application needs to be started.</p>
+ <p>If the scheme https is used the ssl application needs to be
+ started. When https links needs to go through a proxy the
+ CONNECT method extension to HTTP-1.1 is used to establish a
+ tunnel and then the connection is upgraded to TLS,
+ however "TLS upgrade" according to RFC 2817 is not
+ supported.</p>
<p>Also note that pipelining will only be used if the pipeline
timeout is set, otherwise persistent connections without
@@ -449,7 +453,8 @@ apply(Module, Function, [ReplyInfo | Args])
<type>
<v>Options = [Option]</v>
<v>Option = {proxy, {Proxy, NoProxy}} |
- {max_sessions, MaxSessions} |
+ {https_proxy, {Proxy, NoProxy}} |
+ {max_sessions, MaxSessions} |
{max_keep_alive_length, MaxKeepAlive} |
{keep_alive_timeout, KeepAliveTimeout} |
{max_pipeline_length, MaxPipeline} |
@@ -460,86 +465,124 @@ apply(Module, Function, [ReplyInfo | Args])
{port, Port} |
{socket_opts, socket_opts()} |
{verbose, VerboseMode} </v>
+
<v>Proxy = {Hostname, Port}</v>
<v>Hostname = string() </v>
<d>ex: "localhost" or "foo.bar.se"</d>
<v>Port = integer()</v>
<d>ex: 8080 </d>
- <v>socket_opts() = [socket_opt()]</v>
- <d>The options are appended to the socket options used by the
- client. </d>
- <d>These are the default values when a new request handler
- is started (for the initial connect). They are passed directly
- to the underlying transport (gen_tcp or ssl) <em>without</em>
- verification! </d>
<v>NoProxy = [NoProxyDesc]</v>
<v>NoProxyDesc = DomainDesc | HostName | IPDesc</v>
<v>DomainDesc = "*.Domain"</v>
<d>ex: "*.ericsson.se"</d>
<v>IpDesc = string()</v>
<d>ex: "134.138" or "[FEDC:BA98" (all IP-addresses starting with 134.138 or FEDC:BA98), "66.35.250.150" or "[2010:836B:4179::836B:4179]" (a complete IP-address).</d>
- <v>MaxSessions = integer() </v>
+
+ <d>proxy defaults to {undefined, []} e.i. no proxy is configured and https_proxy defaults to
+ the value of proxy.</d>
+
+ <v>MaxSessions = integer() </v>
<d>Default is <c>2</c>.
- Maximum number of persistent connections to a host.</d>
+ Maximum number of persistent connections to a host.</d>
<v>MaxKeepAlive = integer() </v>
- <d>Default is <c>5</c>.
- Maximum number of outstanding requests on the same connection to
- a host.</d>
- <v>KeepAliveTimeout = integer() </v>
- <d>Default is <c>120000</c> (= 2 min).
- If a persistent connection is idle longer than the
- <c>keep_alive_timeout</c> the client will close the connection.
- The server may also have such a time out but you should
- not count on it!</d>
+ <d>Default is <c>5</c>.
+ Maximum number of outstanding requests on the same connection to
+ a host.</d>
+ <v>KeepAliveTimeout = integer() </v>
+ <d>Default is <c>120000</c> (= 2 min).
+ If a persistent connection is idle longer than the
+ <c>keep_alive_timeout</c> in milliseconds,
+ the client will close the connection.
+ The server may also have such a time out but you should
+ not count on it!</d>
<v>MaxPipeline = integer() </v>
- <d>Default is <c>2</c>.
- Maximum number of outstanding requests on a pipelined connection to a host.</d>
- <v>PipelineTimeout = integer() </v>
- <d>Default is <c>0</c>,
- which will result in pipelining not being used.
- If a persistent connection is idle longer than the
- <c>pipeline_timeout</c> the client will close the connection. </d>
+ <d>Default is <c>2</c>.
+ Maximum number of outstanding requests on a pipelined connection
+ to a host.</d>
+ <v>PipelineTimeout = integer() </v>
+ <d>Default is <c>0</c>,
+ which will result in pipelining not being used.
+ If a persistent connection is idle longer than the
+ <c>pipeline_timeout</c> in milliseconds,
+ the client will close the connection. </d>
<v>CookieMode = enabled | disabled | verify </v>
<d>Default is <c>disabled</c>.
- If Cookies are enabled all valid cookies will automatically be
- saved in the client manager's cookie database.
- If the option <c>verify</c> is used the function <c>store_cookies/2</c>
- has to be called for the cookies to be saved.</d>
- <v>IpFamily = inet | inet6 | inet6fb4 </v>
- <d>By default <c>inet</c>.
- When it is set to <c>inet6fb4</c> you can use both ipv4 and ipv6.
- It first tries <c>inet6</c> and if that does not works falls back to <c>inet</c>.
- The option is here to provide a workaround for buggy ipv6 stacks to ensure that
- ipv4 will always work.</d>
+ If Cookies are enabled all valid cookies will automatically be
+ saved in the client manager's cookie database.
+ If the option <c>verify</c> is used the function <c>store_cookies/2</c>
+ has to be called for the cookies to be saved.</d>
+ <v>IpFamily = inet | inet6 | inet6fb4 </v>
+ <d>By default <c>inet</c>.
+ When it is set to <c>inet6fb4</c> you can use both ipv4 and ipv6.
+ It first tries <c>inet6</c> and if that does not works falls back to <c>inet</c>.
+ The option is here to provide a workaround for buggy ipv6 stacks to ensure that
+ ipv4 will always work.</d>
<v>IpAddress = ip_address() </v>
- <d>If the host has several network interfaces, this option specifies which one to use.
- See <seealso marker="kernel:gen_tcp#connect">gen_tcp:connect/3,4</seealso> for more info. </d>
+ <d>If the host has several network interfaces, this option specifies which one to use.
+ See <seealso marker="kernel:gen_tcp#connect">gen_tcp:connect/3,4</seealso> for more info. </d>
<v>Port = integer() </v>
- <d>Specify which local port number to use.
- See <seealso marker="kernel:gen_tcp#connect">gen_tcp:connect/3,4</seealso> for more info. </d>
- <v>VerboseMode = false | verbose | debug | trace </v>
- <d>Default is <c>false</c>.
- This option is used to switch on (or off)
- different levels of erlang trace on the client.
- It is a debug feature.</d>
+ <d>Specify which local port number to use.
+ See <seealso marker="kernel:gen_tcp#connect">gen_tcp:connect/3,4</seealso> for more info. </d>
+ <v>socket_opts() = [socket_opt()]</v>
+ <d>The options are appended to the socket options used by the
+ client. </d>
+ <d>These are the default values when a new request handler
+ is started (for the initial connect). They are passed directly
+ to the underlying transport (gen_tcp or ssl) <em>without</em>
+ verification! </d>
+ <v>VerboseMode = false | verbose | debug | trace </v>
+ <d>Default is <c>false</c>.
+ This option is used to switch on (or off)
+ different levels of erlang trace on the client.
+ It is a debug feature.</d>
<v>Profile = profile() | pid() (when started <c>stand_alone</c>)</v>
</type>
<desc>
- <p>Sets options to be used for subsequent requests.</p>
- <note>
- <p>If possible the client will keep its connections
- alive and use persistent connections
- with or without pipeline depending on configuration
- and current circumstances. The HTTP/1.1 specification does not
- provide a guideline for how many requests would be
- ideal to be sent on a persistent connection,
- this very much depends on the
- application. Note that a very long queue of requests may cause a
- user perceived delay as earlier requests may take a long time
- to complete. The HTTP/1.1 specification does suggest a
- limit of 2 persistent connections per server, which is the
- default value of the <c>max_sessions</c> option. </p>
- </note>
+ <p>Sets options to be used for subsequent requests.</p>
+ <note>
+ <p>If possible the client will keep its connections
+ alive and use persistent connections
+ with or without pipeline depending on configuration
+ and current circumstances. The HTTP/1.1 specification does not
+ provide a guideline for how many requests would be
+ ideal to be sent on a persistent connection,
+ this very much depends on the
+ application. Note that a very long queue of requests may cause a
+ user perceived delay as earlier requests may take a long time
+ to complete. The HTTP/1.1 specification does suggest a
+ limit of 2 persistent connections per server, which is the
+ default value of the <c>max_sessions</c> option. </p>
+ </note>
+
+ <marker id="get_options"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>get_options(OptionItems) -> {ok, Values} | {error, Reason}</name>
+ <name>get_options(OptionItems, Profile) -> {ok, Values} | {error, Reason}</name>
+ <fsummary>Gets the currently used options.</fsummary>
+ <type>
+ <v>OptionItems = all | [option_item()]</v>
+ <v>option_item() = proxy |
+ https_proxy
+ max_sessions |
+ keep_alive_timeout |
+ max_keep_alive_length |
+ pipeline_timeout |
+ max_pipeline_length |
+ cookies |
+ ipfamily |
+ ip |
+ port |
+ socket_opts |
+ verbose</v>
+ <v>Profile = profile() | pid() (when started <c>stand_alone</c>)</v>
+ <v>Values = [{option_item(), term()}]</v>
+ <v>Reason = term() </v>
+ </type>
+ <desc>
+ <p>Retrieves the options currently used by the client.</p>
<marker id="stream_next"></marker>
</desc>
@@ -619,6 +662,8 @@ apply(Module, Function, [ReplyInfo | Args])
<p>Resets (clears) the cookie database for the specified
<c>Profile</c>. If no profile is specified the default profile
will be used. </p>
+
+ <marker id="which_cookies"></marker>
</desc>
</func>
@@ -638,6 +683,42 @@ apply(Module, Function, [ReplyInfo | Args])
<p>This function produces a list of the entire cookie database.
It is intended for debugging/testing purposes.
If no profile is specified the default profile will be used. </p>
+
+ <marker id="which_sessions"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>which_sessions() -> session_info()</name>
+ <name>which_sessions(Profile) -> session_info()</name>
+ <fsummary>Produces a slightly processed dump of the sessions database.</fsummary>
+ <type>
+ <v>Profile = profile() | pid() (when started <c>stand_alone</c>)</v>
+ <v>session_info() = {GoodSessions, BadSessions, NonSessions}</v>
+ <v>GoodSessions = session()</v>
+ <v>BadSessions = tuple()</v>
+ <v>NonSessions = term()</v>
+ </type>
+ <desc>
+ <p>This function produces a slightly processed dump of the session
+ database. It is intended for debugging.
+ If no profile is specified the default profile will be used. </p>
+
+ <marker id="info"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>info() -> list()</name>
+ <name>info(Profile) -> list()</name>
+ <fsummary>Produces a list of miscelleneous info</fsummary>
+ <type>
+ <v>Profile = profile() | pid() (when started <c>stand_alone</c>)</v>
+ </type>
+ <desc>
+ <p>This function produces a list of miscelleneous info.
+ It is intended for debugging.
+ If no profile is specified the default profile will be used. </p>
</desc>
</func>
</funcs>
diff --git a/lib/inets/doc/src/httpd.xml b/lib/inets/doc/src/httpd.xml
index f88099a82e..7e21229fcf 100644
--- a/lib/inets/doc/src/httpd.xml
+++ b/lib/inets/doc/src/httpd.xml
@@ -55,14 +55,14 @@
<section>
<title>ERLANG HTTP SERVER SERVICE START/STOP </title>
<p>A web server can be configured to start when starting the inets
- application or started dynamically in runtime by calling the
- Inets application API <c>inets:start(httpd, ServiceConfig)</c>, or
- <c>inets:start(httpd, ServiceConfig, How)</c>,
- see <seealso marker="inets">inets(3)</seealso> Below follows a
- description of the available configuration options, also called
- properties.</p>
-
- <marker id="file_prop"></marker>
+ application or started dynamically in runtime by calling the
+ Inets application API <c>inets:start(httpd, ServiceConfig)</c>, or
+ <c>inets:start(httpd, ServiceConfig, How)</c>,
+ see <seealso marker="inets">inets(3)</seealso> Below follows a
+ description of the available configuration options, also called
+ properties.</p>
+
+ <marker id="props_file"></marker>
<p><em>File properties</em></p>
<p>When the web server is started
@@ -76,21 +76,25 @@
list.</p>
<taglist>
+ <marker id="prop_proplist_file"></marker>
<tag>{proplist_file, path()}</tag>
<item>
- If this property is defined inets will expect to find
- all other properties defined in this file. Note that the
- file must include all properties listed under mandatory
- properties. </item>
- <tag>{file, path()}</tag>
+ <p>If this property is defined inets will expect to find
+ all other properties defined in this file. Note that the
+ file must include all properties listed under mandatory
+ properties. </p>
+ </item>
- <item> If this property is defined
- inets will expect to find all other properties defined in this
- file, that uses Apache like syntax. Note that the file must
- include all properties listed under mandatory properties. The
- Apache like syntax is the property, written as one word where
- each new word begins with a capital, followed by a white-space
- followed by the value followed by a new line. Ex:
+ <marker id="prop_file"></marker>
+ <tag>{file, path()}</tag>
+ <item>
+ <p>If this property is defined inets will expect to find all
+ other properties defined in this file, that uses Apache like
+ syntax. Note that the file must include all properties listed
+ under mandatory properties. The Apache like syntax is the property,
+ written as one word where each new word begins with a capital,
+ followed by a white-space followed by the value followed by a
+ new line. Ex: </p>
<code>
{server_root, "/urs/local/www"} -> ServerRoot /usr/local/www
@@ -114,40 +118,51 @@
<p>The properties proplist_file and file are mutually exclusive.</p>
</note>
- <marker id="mand_prop"></marker>
+ <marker id="props_mand"></marker>
<p><em>Mandatory properties</em></p>
<taglist>
+ <marker id="prop_port"></marker>
<tag>{port, integer()} </tag>
<item>
- The port that the HTTP server shall listen on.
- If zero is specified as port, an arbitrary available port
- will be picked and you can use the httpd:info/2 function to find
- out which port was picked. </item>
+ <p>The port that the HTTP server shall listen on.
+ If zero is specified as port, an arbitrary available port
+ will be picked and you can use the httpd:info/2 function to find
+ out which port was picked. </p>
+ </item>
+
+ <marker id="prop_server_name"></marker>
<tag>{server_name, string()} </tag>
<item>
- The name of your server, normally a fully qualified domain
- name.
+ <p>The name of your server, normally a fully qualified domain name. </p>
</item>
+
+ <marker id="prop_server_root"></marker>
<tag>{server_root, path()} </tag>
<item>
- Defines the servers home directory where log files etc can
+ <p>Defines the servers home directory where log files etc can
be stored. Relative paths specified in other properties refer
- to this directory.</item>
+ to this directory. </p>
+ </item>
+
+ <marker id="prop_doc_root"></marker>
<tag>{document_root, path()}</tag>
<item>
Defines the top directory for the documents that
- are available on the HTTP server.</item>
+ are available on the HTTP server.
+ </item>
</taglist>
- <marker id="comm_prop"></marker>
+ <marker id="props_comm"></marker>
<p><em>Communication properties</em> </p>
<taglist>
+ <marker id="prop_bind_address"></marker>
<tag>{bind_address, ip_address() | hostname() | any} </tag>
<item>
- Defaults to <c>any</c>. Note that <c>any</c> is denoted <em>*</em>
- in the apache like configuration file.
+ <p>Defaults to <c>any</c>. Note that <c>any</c> is denoted <em>*</em>
+ in the apache like configuration file. </p>
</item>
+ <marker id="prop_socket_type"></marker>
<tag>{socket_type, ip_comm | ssl | essl}</tag>
<item>
<p>When using ssl, there are currently only one alternative.
@@ -156,6 +171,7 @@
<p>Defaults to <c>ip_comm</c>. </p>
</item>
+ <marker id="prop_ipfamily"></marker>
<tag>{ipfamily, inet | inet6 | inet6fb4}</tag>
<item>
<p>Defaults to <c>inet6fb4. </c> </p>
@@ -165,74 +181,93 @@
</taglist>
+ <marker id="props_api_modules"></marker>
<p><em>Erlang Web server API modules</em> </p>
<taglist>
+ <marker id="prop_modules"></marker>
<tag>{modules, [atom()]} </tag>
<item>
- Defines which modules the HTTP server will use to handle
+ <p>Defines which modules the HTTP server will use to handle
requests. Defaults to: <c>[mod_alias, mod_auth, mod_esi,
mod_actions, mod_cgi, mod_dir, mod_get, mod_head, mod_log,
mod_disk_log] </c>
Note that some mod-modules are dependent on
others, so the order can not be entirely arbitrary. See the
<seealso marker="http_server"> Inets Web server Modules in the
- Users guide</seealso> for more information.
+ Users guide</seealso> for more information. </p>
</item>
- </taglist>
+ </taglist>
- <marker id="limit_prop"></marker>
+ <marker id="props_limit"></marker>
<p><em>Limit properties</em> </p>
<taglist>
+ <marker id="prop_disable_chunked_encoding"></marker>
<tag>{disable_chunked_transfer_encoding_send, boolean()}</tag>
<item>
- This property allows you to disable chunked
+ <p>This property allows you to disable chunked
transfer-encoding when sending a response to a HTTP/1.1
- client, by default this is false.</item>
+ client, by default this is false. </p>
+ </item>
+ <marker id="prop_keep_alive"></marker>
<tag>{keep_alive, boolean()}</tag>
<item>
- Instructs the server whether or not to use persistent
+ <p>Instructs the server whether or not to use persistent
connections when the client claims to be HTTP/1.1
- compliant, default is true.</item>
+ compliant, default is true. </p>
+ </item>
+ <marker id="prop_keep_alive_timeout"></marker>
<tag>{keep_alive_timeout, integer()}</tag>
<item>
- The number of seconds the server will wait for a
+ <p>The number of seconds the server will wait for a
subsequent request from the client before closing the
- connection. Default is 150.</item>
+ connection. Default is 150. </p>
+ </item>
+ <marker id="prop_max_body_size"></marker>
<tag>{max_body_size, integer()}</tag>
<item>
- Limits the size of the message body of HTTP request.
- By the default there is no limit.</item>
+ <p>Limits the size of the message body of HTTP request.
+ By the default there is no limit. </p>
+ </item>
+ <marker id="prop_max_clients"></marker>
<tag>{max_clients, integer()}</tag>
<item>
- Limits the number of simultaneous requests that can be
- supported. Defaults to 150. </item>
+ <p>Limits the number of simultaneous requests that can be
+ supported. Defaults to 150. </p>
+ </item>
+ <marker id="prop_max_header_size"></marker>
<tag>{max_header_size, integer()}</tag>
<item>
- Limits the size of the message header of HTTP request.
- Defaults to 10240.
+ <p>Limits the size of the message header of HTTP request.
+ Defaults to 10240. </p>
</item>
+ <marker id="prop_max_uri"></marker>
<tag>{max_uri, integer()}</tag>
<item>
- Limits the size of the HTTP request URI. By
- default there is no limit.</item>
+ <p>Limits the size of the HTTP request URI. By
+ default there is no limit. </p>
+ </item>
+ <marker id="prop_max_keep_alive_req"></marker>
<tag>{max_keep_alive_requests, integer()}</tag>
- <item> The number of request that a client can do on one
+ <item>
+ <p>The number of request that a client can do on one
connection. When the server has responded to the number of
requests defined by max_keep_alive_requests the server close the
connection. The server will close it even if there are queued
- request. Defaults to no limit.</item>
+ request. Defaults to no limit. </p>
+ </item>
</taglist>
- <marker id="admin_prop"></marker>
+ <marker id="props_admin"></marker>
<p><em>Administrative properties</em></p>
<taglist>
+ <marker id="prop_mime_types"></marker>
<tag>{mime_types, [{MimeType, Extension}] | path()}</tag>
<item>
<p>Where MimeType = string() and Extension = string().
@@ -250,19 +285,43 @@ text/plain asc txt
<p>Defaults to [{"html","text/html"},{"htm","text/html"}]</p>
</item>
+ <marker id="prop_mime_type"></marker>
<tag>{mime_type, string()}</tag>
-
<item>
- When the server is asked to provide a document type which
+ <p>When the server is asked to provide a document type which
cannot be determined by the MIME Type Settings, the server will
- use this default type. </item>
+ use this default type. </p>
+ </item>
+ <marker id="prop_server_admin"></marker>
<tag>{server_admin, string()}</tag>
<item>
- ServerAdmin defines the email-address of the server
+ <p>ServerAdmin defines the email-address of the server
administrator, to be included in any error messages returned by
- the server.</item>
+ the server. </p>
+ </item>
+ <marker id="prop_server_tokens"></marker>
+ <tag>{server_tokens, prod|major|minor|minimal|os|full|{private, string()}}</tag>
+ <item>
+ <p>ServerTokens defines how the value of the server header
+ should look. </p>
+ <p>Example: Assuming the version of inets is 5.8.1,
+ here is what the server header string could look like for
+ the different values of server-tokens: </p>
+ <pre>
+prod "inets"
+major "inets/5"
+minor "inets/5.8"
+minimal "inets/5.8.1"
+os "inets/5.8.1 (unix)"
+full "inets/5.8.1 (unix/linux) OTP/R15B"
+{private, "foo/bar"} "foo/bar"
+ </pre>
+ <p>By default, the value is as before, which is <c>minimal</c>. </p>
+ </item>
+
+ <marker id="prop_log_format"></marker>
<tag>{log_format, common | combined}</tag>
<item>
<p>Defines if access logs should be written according to the common
@@ -307,8 +366,9 @@ bytes
<p>This affects the access logs written by mod_log and mod_disk_log.
</p>
- </item>
-
+ </item>
+
+ <marker id="prop_elog_format"></marker>
<tag>{error_log_format, pretty | compact}</tag>
<item>
<p>Defaults to pretty. If the error log is meant to be read
@@ -330,63 +390,77 @@ bytes
</taglist>
- <marker id="ssl_prop"></marker>
+ <marker id="props_ssl"></marker>
<p><em>ssl properties</em></p>
<taglist>
+ <marker id="prop_ssl_ca_cert_file"></marker>
<tag>{ssl_ca_certificate_file, path()}</tag>
<item>
- Used as cacertfile option in ssl:listen/2 see
- <seealso marker="ssl:ssl">ssl(3)</seealso> </item>
+ <p>Used as cacertfile option in ssl:listen/2 see
+ <seealso marker="ssl:ssl">ssl(3)</seealso>. </p>
+ </item>
+ <marker id="prop_ssl_cert_file"></marker>
<tag>{ssl_certificate_file, path()}</tag>
<item>
- Used as certfile option in ssl:listen/2 see
- <seealso marker="ssl:ssl">ssl(3)</seealso>
+ <p>Used as certfile option in ssl:listen/2 see
+ <seealso marker="ssl:ssl">ssl(3)</seealso>. </p>
</item>
+ <marker id="prop_ssl_ciphers"></marker>
<tag>{ssl_ciphers, list()}</tag>
<item>
- Used as ciphers option in ssl:listen/2 see
- <seealso marker="ssl:ssl">ssl(3)</seealso>
+ <p>Used as ciphers option in ssl:listen/2 see
+ <seealso marker="ssl:ssl">ssl(3)</seealso>. </p>
</item>
+ <marker id="prop_ssl_verify_client"></marker>
<tag>{ssl_verify_client, integer()}</tag>
<item>
- Used as verify option in ssl:listen/2 see
- <seealso marker="ssl:ssl">ssl(3)</seealso> </item>
+ <p>Used as verify option in ssl:listen/2 see
+ <seealso marker="ssl:ssl">ssl(3)</seealso>. </p>
+ </item>
+ <marker id="prop_ssl_verify_depth"></marker>
<tag>{ssl_verify_depth, integer()}</tag>
<item>
- Used as depth option in ssl:listen/2 see
- <seealso marker="ssl:ssl">ssl(3)</seealso> </item>
+ <p>Used as depth option in ssl:listen/2 see
+ <seealso marker="ssl:ssl">ssl(3)</seealso>. </p>
+ </item>
+ <marker id="prop_ssl_passwd_callback_funct"></marker>
<tag>{ssl_password_callback_function, atom()}</tag>
<item>
- Used together with ssl_password_callback_module
+ <p>Used together with ssl_password_callback_module
to retrieve a value to use as password option to ssl:listen/2
- see <seealso marker="ssl:ssl">ssl(3)</seealso>
+ see <seealso marker="ssl:ssl">ssl(3)</seealso>. </p>
</item>
+ <marker id="prop_ssl_passwd_callback_args"></marker>
<tag>{ssl_password_callback_arguments, list()}</tag>
<item>
- Used together with ssl_password_callback_function to supply a
+ <p>Used together with ssl_password_callback_function to supply a
list of arguments to the callback function. If not specified
- the callback function will be assumed to have arity 0. </item>
+ the callback function will be assumed to have arity 0. </p>
+ </item>
+ <marker id="prop_ssl_passwd_callback_mod"></marker>
<tag>{ssl_password_callback_module, atom()}</tag>
<item>
- Used together with ssl_password_callback_function
+ <p>Used together with ssl_password_callback_function
to retrieve a value to use as password option to ssl:listen/2
- see <seealso marker="ssl:ssl">ssl(3)</seealso></item>
+ see <seealso marker="ssl:ssl">ssl(3)</seealso>. </p>
+ </item>
</taglist>
- <marker id="alias_prop"></marker>
+ <marker id="props_alias"></marker>
<p><em>URL aliasing properties - requires mod_alias</em></p>
<taglist>
+ <marker id="prop_alias"></marker>
<tag>{alias, {Alias, RealName}}</tag>
-
- <item> Where Alias = string() and RealName = string().
+ <item>
+ <p>Where Alias = string() and RealName = string().
The Alias property allows documents to be stored in the local file
system instead of the document_root location. URLs with a path that
begins with url-path is mapped to local files that begins with
@@ -395,11 +469,13 @@ bytes
<code>{alias, {"/image", "/ftp/pub/image"}</code>
and an access to http://your.server.org/image/foo.gif would refer to
- the file /ftp/pub/image/foo.gif.</item>
+ the file /ftp/pub/image/foo.gif. </p>
+ </item>
- <tag>{re_write, {Re, Replacement}}</tag>
-
- <item> Where Re = string() and Replacement = string().
+ <marker id="prop_re_write"></marker>
+ <tag>{re_write, {Re, Replacement}}</tag>
+ <item>
+ <p>Where Re = string() and Replacement = string().
The ReWrite property allows documents to be stored in the local file
system instead of the document_root location. URLs are rewritten
by re:replace/3 to produce a path in the local filesystem.
@@ -419,13 +495,13 @@ bytes
Beware of trailing space in Replacement that will be used.
If you must have a space in Re use e.g the character encoding
- <code>\040</code> see <seealso marker="stdlib:re">re(3)</seealso>.
+ <code>\040</code> see <seealso marker="stdlib:re">re(3)</seealso>. </p>
</item>
- <tag>{directory_index, [string()]}</tag>
-
+ <marker id="prop_dir_idx"></marker>
+ <tag>{directory_index, [string()]}</tag>
<item>
- DirectoryIndex specifies a list of resources to look for
+ <p>DirectoryIndex specifies a list of resources to look for
if a client requests a directory using a / at the end of the
directory name. file depicts the name of a file in the
directory. Several files may be given, in which case the server
@@ -436,70 +512,79 @@ bytes
and access to http://your.server.org/docs/ would return
http://your.server.org/docs/index.html or
http://your.server.org/docs/welcome.html if index.html do not
- exist.
+ exist. </p>
</item>
</taglist>
- <marker id="cgi_prop"></marker>
+ <marker id="props_cgi"></marker>
<p><em>CGI properties - requires mod_cgi</em></p>
<taglist>
+ <marker id="prop_script_alias"></marker>
<tag>{script_alias, {Alias, RealName}}</tag>
- <item> Where Alias = string() and RealName = string().
+ <item>
+ <p>Where Alias = string() and RealName = string().
Has the same behavior as the Alias property, except that
it also marks the target directory as containing CGI
scripts. URLs with a path beginning with url-path are mapped to
scripts beginning with directory-filename, for example:
- <code> {script_alias, {"/cgi-bin/", "/web/cgi-bin/"}</code>
+ <code>{script_alias, {"/cgi-bin/", "/web/cgi-bin/"}</code>
and an access to http://your.server.org/cgi-bin/foo would cause
- the server to run the script /web/cgi-bin/foo.
+ the server to run the script /web/cgi-bin/foo. </p>
</item>
+ <marker id="prop_script_re_write"></marker>
<tag>{script_re_write, {Re, Replacement}}</tag>
- <item> Where Re = string() and Replacement = string().
+ <item>
+ <p>Where Re = string() and Replacement = string().
Has the same behavior as the ReWrite property, except that
it also marks the target directory as containing CGI
scripts. URLs with a path beginning with url-path are mapped to
scripts beginning with directory-filename, for example:
- <code> {script_re_write, {"^/cgi-bin/(\\d+)/", "/web/\\1/cgi-bin/"}</code>
+ <code>{script_re_write, {"^/cgi-bin/(\\d+)/", "/web/\\1/cgi-bin/"}</code>
and an access to http://your.server.org/cgi-bin/17/foo would cause
- the server to run the script /web/17/cgi-bin/foo.
+ the server to run the script /web/17/cgi-bin/foo. </p>
</item>
+ <marker id="prop_script_nocache"></marker>
<tag>{script_nocache, boolean()}</tag>
-
<item>
- If ScriptNoCache is set to true the HTTP server will by
+ <p>If ScriptNoCache is set to true the HTTP server will by
default add the header fields necessary to prevent proxies from
caching the page. Generally this is something you want. Defaults
- to false.</item>
+ to false. </p>
+ </item>
+ <marker id="prop_script_timeout"></marker>
<tag>{script_timeout, integer()}</tag>
-
<item>
- The time in seconds the web server will wait between each
+ <p>The time in seconds the web server will wait between each
chunk of data from the script. If the CGI-script not delivers
any data before the timeout the connection to the client will be
- closed. Defaults to 15. </item>
+ closed. Defaults to 15. </p>
+ </item>
+ <marker id="prop_action"></marker>
<tag>{action, {MimeType, CgiScript}} - requires mod_action</tag>
-
- <item>Where MimeType = string() and CgiScript = string().
+ <item>
+ <p>Where MimeType = string() and CgiScript = string().
Action adds an action, which will activate a cgi-script
whenever a file of a certain mime-type is requested. It
propagates the URL and file path of the requested document using
the standard CGI PATH_INFO and PATH_TRANSLATED environment
variables.
- <code> {action, {"text/plain", "/cgi-bin/log_and_deliver_text"}
- </code>
+
+ <code>{action, {"text/plain", "/cgi-bin/log_and_deliver_text"}</code>
+ </p>
</item>
+ <marker id="prop_script"></marker>
<tag>{script, {Method, CgiScript}} - requires mod_action</tag>
-
- <item>Where Method = string() and CgiScript = string().
+ <item>
+ <p>Where Method = string() and CgiScript = string().
Script adds an action, which will activate a cgi-script
whenever a file is requested using a certain HTTP method. The
method is either GET or POST as defined in RFC 1945. It
@@ -507,18 +592,19 @@ bytes
the standard CGI PATH_INFO and PATH_TRANSLATED environment
variables.
- <code> {script, {"PUT", "/cgi-bin/put"}
- </code>
+ <code>{script, {"PUT", "/cgi-bin/put"}</code>
+ </p>
</item>
</taglist>
- <marker id="esi_prop"></marker>
+ <marker id="props_esi"></marker>
<p><em>ESI properties - requires mod_esi</em></p>
<taglist>
- <tag>{erl_script_alias, {URLPath, [AllowedModule]}}</tag>
-
- <item>Where URLPath = string() and AllowedModule = atom().
+ <marker id="prop_esi_alias"></marker>
+ <tag>{erl_script_alias, {URLPath, [AllowedModule]}}</tag>
+ <item>
+ <p>Where URLPath = string() and AllowedModule = atom().
erl_script_alias marks all URLs matching url-path as erl
scheme scripts. A matching URL is mapped into a specific module
and function. For example:
@@ -531,140 +617,151 @@ bytes
would refer to httpd_example:yahoo/3 or, if that did not exist,
httpd_example:yahoo/2 and
http://your.server.org/cgi-bin/example/other:yahoo would
- not be allowed to execute.
+ not be allowed to execute. </p>
</item>
+ <marker id="prop_esi_nocache"></marker>
<tag>{erl_script_nocache, boolean()}</tag>
-
<item>
- If erl_script_nocache is set to true the server will add
+ <p>If erl_script_nocache is set to true the server will add
http header fields that prevents proxies from caching the
page. This is generally a good idea for dynamic content, since
- the content often vary between each request. Defaults to false.
+ the content often vary between each request.
+ Defaults to false. </p>
</item>
+ <marker id="prop_esi_timeout"></marker>
<tag>{erl_script_timeout, integer()}</tag>
-
<item>
- If erl_script_timeout sets the time in seconds the server will
+ <p>If erl_script_timeout sets the time in seconds the server will
wait between each chunk of data to be delivered through
mod_esi:deliver/2. Defaults to 15. This is only relevant
- for scripts that uses the erl scheme.
+ for scripts that uses the erl scheme. </p>
</item>
+ <marker id="prop_esi_timeout"></marker>
<tag>{eval_script_alias, {URLPath, [AllowedModule]}}</tag>
-
- <item>Where URLPath = string() and AllowedModule = atom().
+ <item>
+ <p>Where URLPath = string() and AllowedModule = atom().
Same as erl_script_alias but for scripts
- using the eval scheme. Note that this is only supported
- for backwards compatibility. The eval scheme is deprecated.</item>
+ using the eval scheme. Note that this is only supported
+ for backwards compatibility. The eval scheme is deprecated. </p>
+ </item>
</taglist>
- <marker id="log_prop"></marker>
+ <marker id="props_log"></marker>
<p><em>Log properties - requires mod_log</em></p>
<taglist>
+ <marker id="prop_elog"></marker>
<tag>{error_log, path()}</tag>
-
<item>
- Defines the filename of the error log file to be used to log
+ <p>Defines the filename of the error log file to be used to log
server errors. If the filename does not begin with a slash (/)
- it is assumed to be relative to the server_root</item>
+ it is assumed to be relative to the server_root. </p>
+ </item>
+ <marker id="prop_slog"></marker>
<tag>{security_log, path()}</tag>
-
<item>
- Defines the filename of the access log file to be used to
- log security events. If the filename does not begin with a slash
- (/) it is assumed to be relative to the server_root.
+ <p>Defines the filename of the access log file to be used to
+ log security events. If the filename does not begin with a slash
+ (/) it is assumed to be relative to the server_root. </p>
</item>
+ <marker id="prop_tlog"></marker>
<tag>{transfer_log, path()}</tag>
-
<item>
- Defines the filename of the access log file to be used to
+ <p>Defines the filename of the access log file to be used to
log incoming requests. If the filename does not begin with a
- slash (/) it is assumed to be relative to the server_root.
+ slash (/) it is assumed to be relative to the server_root. </p>
</item>
</taglist>
- <marker id="dlog_prop"></marker>
+ <marker id="props_dlog"></marker>
<p><em>Disk Log properties - requires mod_disk_log</em></p>
<taglist>
+ <marker id="prop_dlog_format"></marker>
<tag>{disk_log_format, internal | external}</tag>
-
<item>
- Defines the file-format of the log files see disk_log for
+ <p>Defines the file-format of the log files see disk_log for
more information. If the internal file-format is used, the
logfile will be repaired after a crash. When a log file is
repaired data might get lost. When the external file-format is
used httpd will not start if the log file is broken. Defaults to
- external.
+ external. </p>
</item>
+ <marker id="prop_edlog"></marker>
<tag>{error_disk_log, internal | external}</tag>
-
<item>
- Defines the filename of the (disk_log(3)) error log file
+ <p>Defines the filename of the (disk_log(3)) error log file
to be used to log server errors. If the filename does not begin
- with a slash (/) it is assumed to be relative to the server_root.
+ with a slash (/) it is assumed to be relative to the server_root. </p>
</item>
+ <marker id="prop_edlog_size"></marker>
<tag>{error_disk_log_size, {MaxBytes, MaxFiles}}</tag>
-
- <item>Where MaxBytes = integer() and MaxFiles = integer().
+ <item>
+ <p>Where MaxBytes = integer() and MaxFiles = integer().
Defines the properties of the (disk_log(3)) error log
file. The disk_log(3) error log file is of type wrap log and
max-bytes will be written to each file and max-files will be
- used before the first file is truncated and reused. </item>
+ used before the first file is truncated and reused. </p>
+ </item>
+ <marker id="prop_sdlog"></marker>
<tag>{security_disk_log, path()}</tag>
-
<item>
- Defines the filename of the (disk_log(3)) access log file
+ <p>Defines the filename of the (disk_log(3)) access log file
which logs incoming security events i.e authenticated
requests. If the filename does not begin with a slash (/) it
- is assumed to be relative to the server_root.
+ is assumed to be relative to the server_root. </p>
</item>
+ <marker id="prop_sdlog_size"></marker>
<tag>{security_disk_log_size, {MaxBytes, MaxFiles}}</tag>
-
- <item>Where MaxBytes = integer() and MaxFiles = integer().
+ <item>
+ <p>Where MaxBytes = integer() and MaxFiles = integer().
Defines the properties of the disk_log(3) access log
file. The disk_log(3) access log file is of type wrap log and
max-bytes will be written to each file and max-files will be
- used before the first file is truncated and reused.</item>
+ used before the first file is truncated and reused. </p>
+ </item>
- <tag>{transfer_disk_log, path()}</tag>
-
+ <marker id="prop_tdlog"></marker>
+ <tag>{transfer_disk_log, path()}</tag>
<item>
- Defines the filename of the (disk_log(3)) access log file
+ <p>Defines the filename of the (disk_log(3)) access log file
which logs incoming requests. If the filename does not begin
with a slash (/) it is assumed to be relative to the
- server_root.
+ server_root. </p>
</item>
+ <marker id="prop_tdlog_size"></marker>
<tag>{transfer_disk_log_size, {MaxBytes, MaxFiles}}</tag>
-
- <item>Where MaxBytes = integer() and MaxFiles = integer().
+ <item>
+ <p>Where MaxBytes = integer() and MaxFiles = integer().
Defines the properties of the disk_log(3) access log
file. The disk_log(3) access log file is of type wrap log and
max-bytes will be written to each file and max-files will be
- used before the first file is truncated and reused.</item>
+ used before the first file is truncated and reused. </p>
+ </item>
</taglist>
- <marker id="auth_prop"></marker>
+ <marker id="props_auth"></marker>
<p><em>Authentication properties - requires mod_auth</em></p>
+ <marker id="prop_dri"></marker>
<p><em>{directory, {path(), [{property(), term()}]}}</em></p>
- <marker id="dir_prop"></marker>
+ <marker id="props_dir"></marker>
<p>Here follows the valid properties for directories </p>
<taglist>
+ <marker id="prop_allow_from"></marker>
<tag>{allow_from, all | [RegxpHostString]}</tag>
-
<item>
- Defines a set of hosts which should be granted access to a
+ <p>Defines a set of hosts which should be granted access to a
given directory.
For example:
@@ -672,34 +769,36 @@ bytes
<code>{allow_from, ["123.34.56.11", "150.100.23"] </code>
The host 123.34.56.11 and all machines on the 150.100.23
- subnet are allowed access.</item>
+ subnet are allowed access. </p>
+ </item>
+ <marker id="prop_deny_from"></marker>
<tag>{deny_from, all | [RegxpHostString]}</tag>
-
<item>
- Defines a set of hosts
+ <p>Defines a set of hosts
which should be denied access to a given directory.
For example:
<code>{deny_from, ["123.34.56.11", "150.100.23"] </code>
The host 123.34.56.11 and all machines on the 150.100.23
- subnet are not allowed access.</item>
+ subnet are not allowed access. </p>
+ </item>
+ <marker id="prop_auth_type"></marker>
<tag>{auth_type, plain | dets | mnesia}</tag>
-
<item>
- Sets the type of authentication database that is used for the
+ <p>Sets the type of authentication database that is used for the
directory.The key difference between the different methods is
that dynamic data can be saved when Mnesia and Dets is used.
This property is called AuthDbType in the Apache like
- configuration files.
+ configuration files. </p>
</item>
+ <marker id="prop_auth_user_file"></marker>
<tag>{auth_user_file, path()}</tag>
-
<item>
- Sets the name of a file which contains the list of users and
+ <p>Sets the name of a file which contains the list of users and
passwords for user authentication. filename can be either
absolute or relative to the <c>server_root</c>. If using the
plain storage method, this file is a plain text file, where
@@ -717,12 +816,13 @@ bytes
storage method. For security reasons, make sure that the
<c>auth_user_file</c> is stored outside the document tree of the Web
server. If it is placed in the directory which it protects,
- clients will be able to download it.
+ clients will be able to download it. </p>
</item>
+ <marker id="prop_auth_group_file"></marker>
<tag>{auth_group_file, path()}</tag>
-
- <item> Sets the name of a file which contains the list of user
+ <item>
+ <p>Sets the name of a file which contains the list of user
groups for user authentication. Filename can be either
absolute or relative to the <c>server_root</c>. If you use the plain
storage method, the group file is a plain text file, where
@@ -738,93 +838,109 @@ bytes
For security reasons, make sure that the <c>auth_group_file</c> is
stored outside the document tree of the Web server. If it is
placed in the directory which it protects, clients will be
- able to download it.</item>
+ able to download it. </p>
+ </item>
+ <marker id="prop_auth_name"></marker>
<tag>{auth_name, string()}</tag>
-
<item>
- Sets the name of the authorization realm (auth-domain) for
+ <p>Sets the name of the authorization realm (auth-domain) for
a directory. This string informs the client about which user
- name and password to use. </item>
+ name and password to use. </p>
+ </item>
+ <marker id="prop_auth_access_passwd"></marker>
<tag>{auth_access_password, string()}</tag>
-
- <item> If set to other than "NoPassword" the password is required
+ <item>
+ <p>If set to other than "NoPassword" the password is required
for all API calls. If the password is set to "DummyPassword" the
password must be changed before any other API calls. To secure
the authenticating data the password must be changed after the
web server is started since it otherwise is written in clear
- text in the configuration file.</item>
+ text in the configuration file. </p>
+ </item>
+ <marker id="prop_req_user"></marker>
<tag>{require_user, [string()]}</tag>
<item>
- Defines users which should be granted access to a given
- directory using a secret password.
+ <p>Defines users which should be granted access to a given
+ directory using a secret password. </p>
</item>
+ <marker id="prop_req_grp"></marker>
<tag>{require_group, [string()]}</tag>
<item>
- Defines users which should be granted access to a given
- directory using a secret password.
+ <p>Defines users which should be granted access to a given
+ directory using a secret password. </p>
</item>
</taglist>
- <marker id="htaccess_prop"></marker>
+ <marker id="props_htaccess"></marker>
<p><em>Htaccess authentication properties - requires mod_htaccess</em></p>
<taglist>
+ <marker id="prop_access_files"></marker>
<tag>{access_files, [path()]}</tag>
-
- <item> Specify which filenames that are used for
+ <item>
+ <p>Specify which filenames that are used for
access-files. When a request comes every directory in the path
to the requested asset will be searched after files with the
names specified by this parameter. If such a file is found the
file will be parsed and the restrictions specified in it will
- be applied to the request.
+ be applied to the request. </p>
</item>
</taglist>
- <marker id="sec_prop"></marker>
+ <marker id="props_sec"></marker>
<p><em>Security properties - requires mod_security </em></p>
+ <marker id="prop_sec_dir"></marker>
<p><em>{security_directory, {path(), [{property(), term()}]}</em></p>
- <marker id="sdir_prop"></marker>
- <p> Here follows the valid properties for security directories</p>
+ <marker id="props_sdir"></marker>
+ <p>Here follows the valid properties for security directories</p>
<taglist>
- <tag>{data_file, path()}</tag>
-
+ <marker id="prop_data_file"></marker>
+ <tag>{data_file, path()}</tag>
<item>
- Name of the security data file. The filename can either
+ <p>Name of the security data file. The filename can either
absolute or relative to the server_root. This file is used to
- store persistent data for the mod_security module. </item>
-
- <tag>{max_retries, integer()}</tag>
+ store persistent data for the mod_security module. </p>
+ </item>
- <item> Specifies the maximum number of tries to authenticate a
+ <marker id="prop_max_retries"></marker>
+ <tag>{max_retries, integer()}</tag>
+ <item>
+ <p>Specifies the maximum number of tries to authenticate a
user has before the user is blocked out. If a user
successfully authenticates when the user has been blocked, the
user will receive a 403 (Forbidden) response from the
server. If the user makes a failed attempt while blocked the
server will return 401 (Unauthorized), for security
- reasons. Defaults to 3 may also be set to infinity.</item>
+ reasons.
+ Defaults to 3 may also be set to infinity. </p>
+ </item>
+ <marker id="prop_block_time"></marker>
<tag>{block_time, integer()}</tag>
-
- <item> Specifies the number of minutes a user is blocked. After
+ <item>
+ <p>Specifies the number of minutes a user is blocked. After
this amount of time, he automatically regains access.
- Defaults to 60</item>
+ Defaults to 60. </p>
+ </item>
+ <marker id="prop_fail_exp_time"></marker>
<tag>{fail_expire_time, integer()}</tag>
-
<item>
- Specifies the number of minutes a failed user authentication
+ <p>Specifies the number of minutes a failed user authentication
is remembered. If a user authenticates after this amount of
time, his previous failed authentications are
- forgotten. Defaults to 30</item>
+ forgotten.
+ Defaults to 30. </p>
+ </item>
+ <marker id="prop_auth_timeout"></marker>
<tag>{auth_timeout, integer()}</tag>
-
<item>
Specifies the number of seconds a successful user
authentication is remembered. After this time has passed, the
@@ -835,6 +951,7 @@ bytes
<funcs>
<func>
+ <marker id="info1"></marker>
<name>info(Pid) -></name>
<name>info(Pid, Properties) -> [{Option, Value}]</name>
<fsummary>Fetches information about the HTTP server</fsummary>
@@ -858,6 +975,7 @@ bytes
</func>
<func>
+ <marker id="info2"></marker>
<name>info(Address, Port) -> </name>
<name>info(Address, Port, Properties) -> [{Option, Value}] </name>
<fsummary>Fetches information about the HTTP server</fsummary>
@@ -883,6 +1001,7 @@ bytes
</func>
<func>
+ <marker id="reload_config"></marker>
<name>reload_config(Config, Mode) -> ok | {error, Reason}</name>
<fsummary>Reloads the HTTP server configuration without
restarting the server.</fsummary>
@@ -1003,6 +1122,7 @@ bytes
</section>
<funcs>
<func>
+ <marker id="module_do"></marker>
<name>Module:do(ModData)-> {proceed, OldData} | {proceed, NewData} | {break, NewData} | done</name>
<fsummary>Called for each request to the Web server.</fsummary>
<type>
@@ -1046,7 +1166,9 @@ bytes
closing the connection.</p>
</desc>
</func>
+
<func>
+ <marker id="module_load"></marker>
<name>Module:load(Line, AccIn)-> eof | ok | {ok, AccOut} | {ok, AccOut, {Option, Value}} | {ok, AccOut, [{Option, Value}]} | {error, Reason} </name>
<fsummary>Load is used to convert a line in a Apache like config
file to a <c>{Option, Value}</c> tuple.</fsummary>
@@ -1068,7 +1190,9 @@ bytes
</p>
</desc>
</func>
+
<func>
+ <marker id="module_store"></marker>
<name>Module:store({Option, Value}, Config)-> {ok, {Option, NewValue}} | {error, Reason} </name>
<fsummary></fsummary>
<type>
@@ -1092,6 +1216,7 @@ bytes
</func>
<func>
+ <marker id="module_remove"></marker>
<name>Module:remove(ConfigDB) -> ok | {error, Reason} </name>
<fsummary>Callback function that is called when the Web server is closed.</fsummary>
<type>
@@ -1112,6 +1237,7 @@ bytes
</section>
<funcs>
<func>
+ <marker id="parse_query"></marker>
<name>parse_query(QueryString) -> [{Key,Value}]</name>
<fsummary>Parse incoming data to <c>erl </c>and <c>eval </c>scripts.</fsummary>
<type>
@@ -1120,7 +1246,6 @@ bytes
<v>Value = string()</v>
</type>
<desc>
- <marker id="parse_query"></marker>
<p><c>parse_query/1</c> parses incoming data to <c>erl</c> and
<c>eval</c> scripts (See <seealso marker="mod_esi">mod_esi(3)</seealso>) as defined in the standard
URL format, that is '+' becomes 'space' and decoding of
diff --git a/lib/inets/doc/src/httpd_conf.xml b/lib/inets/doc/src/httpd_conf.xml
index a1ad76a8ae..fc34f14ec3 100644
--- a/lib/inets/doc/src/httpd_conf.xml
+++ b/lib/inets/doc/src/httpd_conf.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -33,11 +33,14 @@
Web server API programmer.</modulesummary>
<description>
<p>This module provides the Erlang Webserver API programmer with
- utility functions for adding run-time configuration directives.</p>
+ utility functions for adding run-time configuration directives.</p>
+
+ <marker id="check_enum"></marker>
</description>
+
<funcs>
<func>
- <name>check_enum(EnumString,ValidEnumStrings) -> Result</name>
+ <name>check_enum(EnumString, ValidEnumStrings) -> Result</name>
<fsummary>Check if string is a valid enumeration.</fsummary>
<type>
<v>EnumString = string()</v>
@@ -47,10 +50,13 @@
<desc>
<marker id="check_enum"></marker>
<p><c>check_enum/2</c> checks if <c>EnumString</c> is a valid
- enumeration of <c>ValidEnumStrings</c> in which case it is
- returned as an atom.</p>
+ enumeration of <c>ValidEnumStrings</c> in which case it is
+ returned as an atom.</p>
+
+ <marker id="clean"></marker>
</desc>
</func>
+
<func>
<name>clean(String) -> Stripped</name>
<fsummary>Remove leading and/or trailing white spaces.</fsummary>
@@ -60,9 +66,12 @@
<desc>
<marker id="clean"></marker>
<p><c>clean/1</c> removes leading and/or trailing white spaces
- from <c>String</c>.</p>
+ from <c>String</c>.</p>
+
+ <marker id="custom_clean"></marker>
</desc>
</func>
+
<func>
<name>custom_clean(String,Before,After) -> Stripped</name>
<fsummary>Remove leading and/or trailing white spaces and custom characters.</fsummary>
@@ -73,11 +82,14 @@
<desc>
<marker id="custom_clean"></marker>
<p><c>custom_clean/3</c> removes leading and/or trailing white
- spaces and custom characters from <c>String</c>. <c>Before</c>
- and <c>After</c> are regular expressions, as defined in
- <c>regexp(3)</c>, describing the custom characters.</p>
+ spaces and custom characters from <c>String</c>. <c>Before</c>
+ and <c>After</c> are regular expressions, as defined in
+ <c>regexp(3)</c>, describing the custom characters.</p>
+
+ <marker id="is_directory"></marker>
</desc>
</func>
+
<func>
<name>is_directory(FilePath) -> Result</name>
<fsummary>Check if a file path is a directory.</fsummary>
@@ -91,13 +103,16 @@
<desc>
<marker id="is_directory"></marker>
<p><c>is_directory/1</c> checks if <c>FilePath</c> is a
- directory in which case it is returned. Please read
- <c>file(3)</c> for a description of <c>enoent</c>,
- <c>eaccess</c> and <c>enotdir</c>. The definition of
- the file info record can be found by including <c>file.hrl</c>
- from the kernel application, see file(3).</p>
+ directory in which case it is returned. Please read
+ <c>file(3)</c> for a description of <c>enoent</c>,
+ <c>eaccess</c> and <c>enotdir</c>. The definition of
+ the file info record can be found by including <c>file.hrl</c>
+ from the kernel application, see file(3).</p>
+
+ <marker id="is_file"></marker>
</desc>
</func>
+
<func>
<name>is_file(FilePath) -> Result</name>
<fsummary>Check if a file path is a regular file.</fsummary>
@@ -111,13 +126,16 @@
<desc>
<marker id="is_file"></marker>
<p><c>is_file/1</c> checks if <c>FilePath</c> is a regular
- file in which case it is returned. Read <c>file(3)</c> for a
- description of <c>enoent</c>, <c>eaccess</c> and
- <c>enotdir</c>. The definition of the file info record can be
- found by including <c>file.hrl</c> from the kernel application,
- see file(3).</p>
+ file in which case it is returned. Read <c>file(3)</c> for a
+ description of <c>enoent</c>, <c>eaccess</c> and
+ <c>enotdir</c>. The definition of the file info record can be
+ found by including <c>file.hrl</c> from the kernel application,
+ see file(3).</p>
+
+ <marker id="make_integer"></marker>
</desc>
</func>
+
<func>
<name>make_integer(String) -> Result</name>
<fsummary>Return an integer representation of a string.</fsummary>
diff --git a/lib/inets/doc/src/httpd_socket.xml b/lib/inets/doc/src/httpd_socket.xml
index fba1a58d3a..58cd2ec575 100644
--- a/lib/inets/doc/src/httpd_socket.xml
+++ b/lib/inets/doc/src/httpd_socket.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -33,10 +33,13 @@
Web server API programmer.</modulesummary>
<description>
<p>This module provides the Erlang Web server API module programmer
- with utility functions for generic sockets communication. The
- appropriate communication mechanism is transparently used, that
- is <c>ip_comm</c> or <c>ssl</c>.</p>
+ with utility functions for generic sockets communication. The
+ appropriate communication mechanism is transparently used, that
+ is <c>ip_comm</c> or <c>ssl</c>.</p>
+
+ <marker id="deliver"></marker>
</description>
+
<funcs>
<func>
<name>deliver(SocketType, Socket, Data) -> Result</name>
@@ -50,11 +53,14 @@
<desc>
<marker id="deliver"></marker>
<p><c>deliver/3</c> sends the <c>Binary</c> over the
- <c>Socket</c> using the specified <c>SocketType</c>. Socket
- and SocketType should be the socket and the socket_type form
- the mod record as defined in httpd.hrl</p>
+ <c>Socket</c> using the specified <c>SocketType</c>. Socket
+ and SocketType should be the socket and the socket_type form
+ the mod record as defined in httpd.hrl</p>
+
+ <marker id="peername"></marker>
</desc>
</func>
+
<func>
<name>peername(SocketType,Socket) -> {Port,IPAddress}</name>
<fsummary>Return the port and IP-address of the remote socket.</fsummary>
@@ -67,9 +73,12 @@
<desc>
<marker id="peername"></marker>
<p><c>peername/3</c> returns the <c>Port</c> and
- <c>IPAddress</c> of the remote <c>Socket</c>. </p>
+ <c>IPAddress</c> of the remote <c>Socket</c>. </p>
+
+ <marker id="resolve"></marker>
</desc>
</func>
+
<func>
<name>resolve() -> HostName</name>
<fsummary>Return the official name of the current host.</fsummary>
@@ -79,7 +88,7 @@
<desc>
<marker id="resolve"></marker>
<p><c>resolve/0</c> returns the official <c>HostName</c> of
- the current host. </p>
+ the current host. </p>
</desc>
</func>
</funcs>
diff --git a/lib/inets/doc/src/httpd_util.xml b/lib/inets/doc/src/httpd_util.xml
index 6ac2b13c72..9f290084d2 100644
--- a/lib/inets/doc/src/httpd_util.xml
+++ b/lib/inets/doc/src/httpd_util.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1997</year><year>2010</year>
+ <year>1997</year><year>2012</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 c274d67f19..e282050b12 100644
--- a/lib/inets/doc/src/inets_services.xml
+++ b/lib/inets/doc/src/inets_services.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2012</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 c783b99b23..265a1b8e76 100644
--- a/lib/inets/doc/src/mod_alias.xml
+++ b/lib/inets/doc/src/mod_alias.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -32,8 +32,11 @@
<modulesummary>URL aliasing.</modulesummary>
<description>
<p>Erlang Webserver Server internal API for handling of things
- such as interaction data exported by the mod_alias module.</p>
+ such as interaction data exported by the mod_alias module.</p>
+
+ <marker id="default_index"></marker>
</description>
+
<funcs>
<func>
<name>default_index(ConfigDB, Path) -> NewPath</name>
@@ -45,17 +48,20 @@
<desc>
<marker id="default_index"></marker>
<p>If <c>Path</c> is a directory, <c>default_index/2</c>, it starts
- searching for resources or files that are specified in the config
- directive DirectoryIndex.
- If an appropriate resource or file is found, it is appended to
- the end of <c>Path</c> and then returned. <c>Path</c> is
- returned unaltered, if no appropriate
- file is found, or if <c>Path</c> is not a directory.
- <c>config_db()</c> is the server config file in ETS table format
- as described in
- <seealso marker="http_server">Inets Users Guide.</seealso>.</p>
+ searching for resources or files that are specified in the config
+ directive DirectoryIndex.
+ If an appropriate resource or file is found, it is appended to
+ the end of <c>Path</c> and then returned. <c>Path</c> is
+ returned unaltered, if no appropriate
+ file is found, or if <c>Path</c> is not a directory.
+ <c>config_db()</c> is the server config file in ETS table format
+ as described in
+ <seealso marker="http_server">Inets Users Guide.</seealso>.</p>
+
+ <marker id="path"></marker>
</desc>
</func>
+
<func>
<name>path(PathData, ConfigDB, RequestURI) -> Path</name>
<fsummary>Return the actual file path to a URL.</fsummary>
@@ -67,15 +73,19 @@
<desc>
<marker id="path"></marker>
<p><c>path/3</c> returns the actual file <c>Path</c> in the
- <c>RequestURI</c> (See RFC 1945). If the interaction data
- <c>{real_name,{Path,AfterPath}}</c> has been exported by
- mod_alias;
- <c>Path</c> is returned. If no interaction data has been
- exported, ServerRoot is used to
- generate a file <c>Path</c>. <c>config_db()</c> and
- <c>interaction_data()</c> are as defined in <seealso marker="http_server">Inets Users Guide</seealso>.</p>
+ <c>RequestURI</c> (See RFC 1945). If the interaction data
+ <c>{real_name,{Path,AfterPath}}</c> has been exported by
+ mod_alias;
+ <c>Path</c> is returned. If no interaction data has been
+ exported, ServerRoot is used to
+ generate a file <c>Path</c>. <c>config_db()</c> and
+ <c>interaction_data()</c> are as defined in
+ <seealso marker="http_server">Inets Users Guide</seealso>.</p>
+
+ <marker id="real_name"></marker>
</desc>
</func>
+
<func>
<name>real_name(ConfigDB, RequestURI, Aliases) -> Ret</name>
<fsummary>Expand a request uri using Alias config directives.</fsummary>
@@ -89,18 +99,24 @@
<desc>
<marker id="real_name"></marker>
<p><c>real_name/3</c> traverses <c>Aliases</c>, typically
- extracted from <c>ConfigDB</c>, and matches each
- <c>FakeName</c> with <c>RequestURI</c>. If a match is found
- <c>FakeName</c> is replaced with <c>RealName</c> in the
- match. The resulting path is split into two parts, that
- is <c>ShortPath</c> and <c>AfterPath</c> as defined in <seealso marker="httpd_util#split_path">httpd_util:split_path/1</seealso>.
- <c>Path</c> is generated from <c>ShortPath</c>, that is
- the result from <seealso marker="#default_index">default_index/2</seealso> with
- <c>ShortPath</c> as an argument.
- <c>config_db()</c> is the server config file in ETS table
- format as described in <seealso marker="http_server">Inets User Guide.</seealso>. </p>
+ extracted from <c>ConfigDB</c>, and matches each
+ <c>FakeName</c> with <c>RequestURI</c>. If a match is found
+ <c>FakeName</c> is replaced with <c>RealName</c> in the
+ match. The resulting path is split into two parts, that
+ is <c>ShortPath</c> and <c>AfterPath</c> as defined in
+ <seealso marker="httpd_util#split_path">httpd_util:split_path/1</seealso>.
+ <c>Path</c> is generated from <c>ShortPath</c>, that is
+ the result from
+ <seealso marker="#default_index">default_index/2</seealso> with
+ <c>ShortPath</c> as an argument.
+ <c>config_db()</c> is the server config file in ETS table
+ format as described in
+ <seealso marker="http_server">Inets User Guide.</seealso>. </p>
+
+ <marker id="real_script_name"></marker>
</desc>
</func>
+
<func>
<name>real_script_name(ConfigDB,RequestURI,ScriptAliases) -> Ret</name>
<fsummary>Expand a request uri using ScriptAlias config directives.</fsummary>
@@ -114,15 +130,15 @@
<desc>
<marker id="real_script_name"></marker>
<p><c>real_name/3</c> traverses <c>ScriptAliases</c>,
- typically extracted from <c>ConfigDB</c>, and matches each
- <c>FakeName</c> with <c>RequestURI</c>. If a match is found
- <c>FakeName</c> is replaced with <c>RealName</c> in the
- match. If the resulting match is not an executable script
- <c>not_a_script</c> is returned. If it is a script the
- resulting script path is in two parts, that is
- <c>ShortPath</c> and <c>AfterPath</c> as defined in <seealso marker="httpd_util#split_script_path">httpd_util:split_script_path/1</seealso>.
- <c>config_db()</c> is the server config file in ETS table
- format as described in <seealso marker="http_server">Inets Users Guide.</seealso>.</p>
+ typically extracted from <c>ConfigDB</c>, and matches each
+ <c>FakeName</c> with <c>RequestURI</c>. If a match is found
+ <c>FakeName</c> is replaced with <c>RealName</c> in the
+ match. If the resulting match is not an executable script
+ <c>not_a_script</c> is returned. If it is a script the
+ resulting script path is in two parts, that is
+ <c>ShortPath</c> and <c>AfterPath</c> as defined in <seealso marker="httpd_util#split_script_path">httpd_util:split_script_path/1</seealso>.
+ <c>config_db()</c> is the server config file in ETS table
+ format as described in <seealso marker="http_server">Inets Users Guide.</seealso>.</p>
</desc>
</func>
</funcs>
diff --git a/lib/inets/doc/src/mod_auth.xml b/lib/inets/doc/src/mod_auth.xml
index 2134ebeeae..a176242a72 100644
--- a/lib/inets/doc/src/mod_auth.xml
+++ b/lib/inets/doc/src/mod_auth.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1997</year><year>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -32,8 +32,11 @@
<modulesummary>User authentication using text files, dets or mnesia database.</modulesummary>
<description>
<p>This module provides for basic user authentication using
- textual files, dets databases as well as mnesia databases. </p>
+ textual files, dets databases as well as mnesia databases. </p>
+
+ <marker id="add_user"></marker>
</description>
+
<funcs>
<func>
<name>add_user(UserName, Options) -> true| {error, Reason}</name>
@@ -55,12 +58,17 @@
<desc>
<marker id="user_api"></marker>
<marker id="add_user"></marker>
- <p><c>add_user/2, add_user/5</c> and <c>add_user/6</c> adds a user to the user
- database. If the operation is successful, this function returns
- <c>true</c>. If an error occurs, <c>{error,Reason}</c> is returned. When <c>add_user/2</c>
- is called the Password, UserData Port and Dir options is mandatory.</p>
+ <p><c>add_user/2, add_user/5</c> and <c>add_user/6</c> adds a
+ user to the user
+ database. If the operation is successful, this function returns
+ <c>true</c>. If an error occurs, <c>{error,Reason}</c> is returned.
+ When <c>add_user/2</c> is called the Password,
+ UserData Port and Dir options is mandatory.</p>
+
+ <marker id="delete_user"></marker>
</desc>
</func>
+
<func>
<name>delete_user(UserName,Options) -> true | {error, Reason}</name>
<name>delete_user(UserName, Port, Dir) -> true | {error, Reason}</name>
@@ -79,13 +87,16 @@
<desc>
<marker id="delete_user"></marker>
<p><c>delete_user/2, delete_user/3</c> and <c>delete_user/4</c>
- deletes a user
- from the user database. If the operation is successful, this
- function returns <c>true</c>. If an error occurs,
- <c>{error,Reason}</c> is returned. When <c>delete_user/2</c> is
- called the Port and Dir options are mandatory.</p>
+ deletes a user from the user database.
+ If the operation is successful, this function returns <c>true</c>.
+ If an error occurs, <c>{error,Reason}</c> is returned.
+ When <c>delete_user/2</c> is called the Port and Dir options
+ are mandatory.</p>
+
+ <marker id="get_user"></marker>
</desc>
</func>
+
<func>
<name>get_user(UserName,Options) -> {ok, #httpd_user} |{error, Reason}</name>
<name>get_user(UserName, Port, Dir) -> {ok, #httpd_user} | {error, Reason}</name>
@@ -104,12 +115,15 @@
<desc>
<marker id="get_user"></marker>
<p><c>get_user/2, get_user/3</c> and <c>get_user/4</c> returns a
- <c>httpd_user</c> record containing the userdata for a
- specific user. If the user cannot be found, <c>{error, Reason}</c>
- is returned. When <c>get_user/2</c> is called the Port and Dir
- options are mandatory.</p>
+ <c>httpd_user</c> record containing the userdata for a
+ specific user. If the user cannot be found, <c>{error, Reason}</c>
+ is returned. When <c>get_user/2</c> is called the Port and Dir
+ options are mandatory.</p>
+
+ <marker id="list_users"></marker>
</desc>
</func>
+
<func>
<name>list_users(Options) -> {ok, Users} | {error, Reason}</name>
<name>list_users(Port, Dir) -> {ok, Users} | {error, Reason}</name>
@@ -127,12 +141,16 @@
</type>
<desc>
<marker id="list_users"></marker>
- <p><c>list_users/1, list_users/2</c> and <c>list_users/3</c> returns a list
- of users in the user database for a specific <c>Port/Dir</c>.
- When <c>list_users/1</c> is called the Port and Dir
- options are mandatory.</p>
+ <p><c>list_users/1, list_users/2</c> and <c>list_users/3</c>
+ returns a list
+ of users in the user database for a specific <c>Port/Dir</c>.
+ When <c>list_users/1</c> is called the Port and Dir
+ options are mandatory.</p>
+
+ <marker id="add_group_member"></marker>
</desc>
</func>
+
<func>
<name>add_group_member(GroupName, UserName, Options) -> true | {error, Reason}</name>
<name>add_group_member(GroupName, UserName, Port, Dir) -> true | {error, Reason}</name>
@@ -151,13 +169,18 @@
</type>
<desc>
<marker id="add_group_member"></marker>
- <p><c>add_group_member/3, add_group_member/4</c> and <c>add_group_member/5</c>
- adds a user to a group. If the group does not exist, it
- is created and the user is added to the group. Upon successful
- operation, this function returns <c>true</c>. When <c>add_group_members/3</c>
- is called the Port and Dir options are mandatory.</p>
+ <p><c>add_group_member/3, add_group_member/4</c> and
+ <c>add_group_member/5</c>
+ adds a user to a group. If the group does not exist, it
+ is created and the user is added to the group. Upon successful
+ operation, this function returns <c>true</c>.
+ When <c>add_group_members/3</c>
+ is called the Port and Dir options are mandatory.</p>
+
+ <marker id="delete_group_member"></marker>
</desc>
</func>
+
<func>
<name>delete_group_member(GroupName, UserName, Options) -> true | {error, Reason}</name>
<name>delete_group_member(GroupName, UserName, Port, Dir) -> true | {error, Reason}</name>
@@ -176,13 +199,17 @@
</type>
<desc>
<marker id="delete_group_member"></marker>
- <p><c>delete_group_member/3, delete_group_member/4</c> and <c>delete_group_member/5</c> deletes a user from a group.
- If the group or the user does not exist,
- this function returns an error, otherwise it returns <c>true</c>.
- When <c>delete_group_member/3</c> is called the Port and Dir options
- are mandatory.</p>
+ <p><c>delete_group_member/3, delete_group_member/4</c> and
+ <c>delete_group_member/5</c> deletes a user from a group.
+ If the group or the user does not exist,
+ this function returns an error, otherwise it returns <c>true</c>.
+ When <c>delete_group_member/3</c> is called the Port and Dir options
+ are mandatory.</p>
+
+ <marker id="list_group_members"></marker>
</desc>
</func>
+
<func>
<name>list_group_members(GroupName, Options) -> {ok, Users} | {error, Reason}</name>
<name>list_group_members(GroupName, Port, Dir) -> {ok, Users} | {error, Reason}</name>
@@ -201,13 +228,17 @@
</type>
<desc>
<marker id="list_group_members"></marker>
- <p><c>list_group_members/2, list_group_members/3</c> and <c>list_group_members/4</c>
- lists the members of a specified group. If the group does not
- exist or there is an error, <c>{error, Reason}</c> is returned.
- When <c>list_group_members/2</c> is called the Port and Dir options
- are mandatory.</p>
+ <p><c>list_group_members/2, list_group_members/3</c> and
+ <c>list_group_members/4</c>
+ lists the members of a specified group. If the group does not
+ exist or there is an error, <c>{error, Reason}</c> is returned.
+ When <c>list_group_members/2</c> is called the Port and Dir options
+ are mandatory.</p>
+
+ <marker id="list_groups"></marker>
</desc>
</func>
+
<func>
<name>list_groups(Options) -> {ok, Groups} | {error, Reason}</name>
<name>list_groups(Port, Dir) -> {ok, Groups} | {error, Reason}</name>
@@ -225,12 +256,16 @@
</type>
<desc>
<marker id="list_groups"></marker>
- <p><c>list_groups/1, list_groups/2</c> and <c>list_groups/3</c> lists all
- the groups available. If there is an error, <c>{error, Reason}</c>
- is returned. When <c>list_groups/1</c> is called the Port and Dir options
- are mandatory.</p>
+ <p><c>list_groups/1, list_groups/2</c> and <c>list_groups/3</c>
+ lists all the groups available.
+ If there is an error, <c>{error, Reason}</c> is returned.
+ When <c>list_groups/1</c> is called the Port and Dir options
+ are mandatory.</p>
+
+ <marker id="delete_group"></marker>
</desc>
</func>
+
<func>
<name>delete_group(GroupName, Options) -> true | {error,Reason} &lt;name>delete_group(GroupName, Port, Dir) -> true | {error, Reason}</name>
<name>delete_group(GroupName, Address, Port, Dir) -> true | {error, Reason}</name>
@@ -247,12 +282,16 @@
</type>
<desc>
<marker id="delete_group"></marker>
- <p><c>delete_group/2, delete_group/3</c> and <c>delete_group/4</c> deletes the
- group specified and returns <c>true</c>. If there is an error,
- <c>{error, Reason}</c> is returned. When <c>delete_group/2</c> is called the
- Port and Dir options are mandatory.</p>
+ <p><c>delete_group/2, delete_group/3</c> and <c>delete_group/4</c>
+ deletes the group specified and returns <c>true</c>.
+ If there is an error, <c>{error, Reason}</c> is returned.
+ When <c>delete_group/2</c> is called the
+ Port and Dir options are mandatory.</p>
+
+ <marker id="update_password"></marker>
</desc>
</func>
+
<func>
<name>update_password(Port, Dir, OldPassword, NewPassword, NewPassword) -> ok | {error, Reason}</name>
<name>update_password(Address,Port, Dir, OldPassword, NewPassword, NewPassword) -> ok | {error, Reason}</name>
@@ -268,10 +307,12 @@
</type>
<desc>
<marker id="update_password"></marker>
- <p><c>update_password/5</c> and <c>update_password/6</c> Updates the AuthAccessPassword
- for the specified directory. If NewPassword is equal to "NoPassword" no password is requires to
- change authorisation data. If NewPassword is equal to "DummyPassword" no changes can be done
- without changing the password first.</p>
+ <p><c>update_password/5</c> and <c>update_password/6</c>
+ Updates the AuthAccessPassword for the specified directory.
+ If NewPassword is equal to "NoPassword" no password is requires to
+ change authorisation data.
+ If NewPassword is equal to "DummyPassword" no changes can be done
+ without changing the password first.</p>
</desc>
</func>
</funcs>
diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml
index cfc58b8ddb..3aae1ff70a 100644
--- a/lib/inets/doc/src/notes.xml
+++ b/lib/inets/doc/src/notes.xml
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>Inets Release Notes</title>
@@ -32,7 +32,174 @@
<file>notes.xml</file>
</header>
+
+ <section>
+ <title>Inets 5.9.1</title>
+
+ <section>
+ <title>Improvements and New Features</title>
+ <!--
+ <p>-</p>
+ -->
+
+ <list>
+ <item>
+ <p>Better handling of errorI(s) during update of the session
+ database. </p>
+ <p>Also added and updated some debugging functions
+ <seealso marker="httpc#which_sessions">which_sessions/10,1</seealso>
+ and
+ <seealso marker="httpc#info">info/0</seealso>. </p>
+ <p>Own Id: OTP-10093</p>
+ <p>Aux Id: Seq 12062</p>
+ </item>
+
+ <item>
+ <p>Removed R14B compatible version of (inets-service and
+ tftp) behaviour definition. </p>
+ <p>Own Id: OTP-10095</p>
+ </item>
+
+ <item>
+ <p>[httpc] Documentation of KeepAlive and Pipeline timeout
+ options have been improved. </p>
+ <p>Own Id: OTP-10114</p>
+ </item>
+ </list>
+
+ </section>
+
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
+ <!--
+ <p>-</p>
+ -->
+
+ <list>
+ <item>
+ <p>[httpc] Cancel request does not work due to incorrect
+ handler table creation (wrong keypos). </p>
+ <p>Vyacheslav Vorobyov</p>
+ <p>Own Id: OTP-10092</p>
+ </item>
+
+ </list>
+ </section>
+
+ <section>
+ <title>Incompatibilities</title>
+ <p>-</p>
+
+ <!--
+ <list>
+ <item>
+ <p>[httpc|httpd] The old ssl implementation (based on OpenSSL),
+ has been deprecated. The config option that specified usage of
+ this version of the ssl app, <c>ossl</c>, has been removed. </p>
+ <p>Own Id: OTP-9522</p>
+ </item>
+
+ </list>
+ -->
+
+ </section>
+
+ </section> <!-- 5.9.1 -->
+
+
+ <section>
+ <title>Inets 5.9</title>
+
+ <section>
+ <title>Improvements and New Features</title>
+ <!--
+ <p>-</p>
+ -->
+
+ <list>
+ <item>
+ <p>[httpd] Make the server header configurable with new config
+ option
+ <seealso marker="httpd#prop_server_tokens">server_tokens</seealso>.
+ The value of the server header, which was previously hard-coded
+ (at compile time), is now possible to manipulate through the means
+ of the
+ <seealso marker="httpd#prop_server_tokens">server_tokens</seealso>
+ config option. </p>
+ <p>Own Id: OTP-9805</p>
+ </item>
+
+ <item>
+ <p>Improve inets support for inets as an included application. </p>
+ <p><c>inets_app</c> calls <c>supervisor:start_link/3</c> directly
+ rather than calling the root supervisor function
+ <c>inets_sup:start_link/0</c>.
+ This precludes using included_applications to start inets without
+ having a wrapper function. </p>
+ <p>Jay Nelson</p>
+ <p>Own Id: OTP-9960</p>
+ </item>
+
+ <item>
+ <p>[httpc] Add function for retrieving current options,
+ <seealso marker="httpc#get_options">get_options/1,2</seealso>. </p>
+ <p>Own Id: OTP-9979</p>
+ </item>
+
+ <item>
+ <p>Utility module
+ <seealso marker="http_uri">http_uri</seealso>
+ now officially supported. </p>
+ <p>Also, the
+ <seealso marker="http_uri#parse">parse</seealso>
+ function has been extended with more
+ scheme support and a way to provide your own scheme info. </p>
+ <p>Own Id: OTP-9983</p>
+ <p>Aux Id: Seq 12022</p>
+ </item>
+
+ </list>
+
+ </section>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <p>-</p>
+
+<!--
+ <list>
+ <item>
+ <p>[httpd] Fix logging of content length in mod_log. </p>
+ <p>Garrett Smith</p>
+ <p>Own Id: OTP-9715</p>
+ </item>
+
+ </list>
+-->
+
+ </section>
+
+<!--
+ <section>
+ <title>Incompatibilities</title>
+ <p>-</p>
+
+ <list>
+ <item>
+ <p>[httpc|httpd] The old ssl implementation (based on OpenSSL),
+ has been deprecated. The config option that specified usage of
+ this version of the ssl app, <c>ossl</c>, has been removed. </p>
+ <p>Own Id: OTP-9522</p>
+ </item>
+
+ </list>
+
+ </section>
+-->
+
+ </section> <!-- 5.9 -->
+
+
<section><title>Inets 5.8.1</title>
<section><title>Improvements and New Features</title>
<p>-</p>
@@ -195,31 +362,6 @@
</section>
- <section>
- <title>Incompatibilities</title>
-<!--
- <p>-</p>
--->
-
- <list>
- <item>
- <p>[httpc] Deprecated interface module <c>http</c> has been removed.
- It has (long) been replaced by http client interface module
- <seealso marker="httpc#">httpc</seealso>. </p>
- <p>Own Id: OTP-9359</p>
- </item>
-
- <item>
- <p>[httpc|httpd] The old ssl implementation (based on OpenSSL),
- has been deprecated. The config option that specified usage of
- this version of the ssl app, <c>ossl</c>, has been removed. </p>
- <p>Own Id: OTP-9522</p>
- </item>
-
- </list>
-
- </section>
-
<section><title>Fixed Bugs and Malfunctions</title>
<!--
<p>-</p>
@@ -242,6 +384,24 @@
</list>
</section>
+<!--
+ <section>
+ <title>Incompatibilities</title>
+ <p>-</p>
+
+ <list>
+ <item>
+ <p>[httpc] Deprecated interface module <c>http</c> has been removed.
+ It has (long) been replaced by http client interface module
+ <seealso marker="httpc#">httpc</seealso>. </p>
+ <p>Own Id: OTP-9359</p>
+ </item>
+
+ </list>
+
+ </section>
+-->
+
</section> <!-- 5.7.2 -->
@@ -417,7 +577,7 @@
<p><c>ossl</c> will work for as long as the ssl application
supports it. </p>
<p>See the httpd
- <seealso marker="httpd#comm_prop">socket_type</seealso>
+ <seealso marker="httpd#props_comm">socket_type</seealso>
communication property or the httpc
<seealso marker="httpc#request2">request/4,5</seealso> function
for more info. </p>
@@ -436,7 +596,7 @@
<list>
<item>
<p>[httpd] Wrong
- <seealso marker="httpd#sec_prop">security property</seealso>
+ <seealso marker="httpd#props_sec">security property</seealso>
names used in documentation. </p>
<p><c>security_data_file</c> used instead of <c>data_file</c>. </p>
<p><c>security_max_retries</c> used instead of <c>max_retries</c>. </p>
@@ -620,7 +780,7 @@
the <c>essl</c> tag instead. </p>
<p>See the <c>http_option</c> option in the
<seealso marker="httpc#request2">request/4,5</seealso> or
- the <seealso marker="httpd#comm_prop">socket-type</seealso>
+ the <seealso marker="httpd#props_comm">socket-type</seealso>
section of the Communication properties chapter for more info, </p>
<p>Own Id: OTP-7907</p>
</item>
@@ -637,9 +797,9 @@
<p>[httpd] - Improved mod_alias.
Now able to do better URL rewrites. </p>
<p>See
- <seealso marker="httpd#alias_prop">URL aliasing properties</seealso>
+ <seealso marker="httpd#props_alias">URL aliasing properties</seealso>
and the
- <seealso marker="httpd#cgi_prop">CGI properties</seealso>
+ <seealso marker="httpd#props_cgi">CGI properties</seealso>
section(s) for more info, </p>
<p>Own Id: OTP-8573</p>
</item>
@@ -1225,7 +1385,7 @@
<p>Default is <c>inet6fb4</c> which emulates the
behaviour of the previous version. </p>
<p>See the
- <seealso marker="httpd#comm_prop">Communication properties</seealso>
+ <seealso marker="httpd#props_comm">Communication properties</seealso>
section for more info. </p>
<p>Own Id: OTP-8069</p>
<p>Aux Id: seq11086</p>
diff --git a/lib/inets/doc/src/notes_history.xml b/lib/inets/doc/src/notes_history.xml
index 151bec375e..bd59c1ba47 100644
--- a/lib/inets/doc/src/notes_history.xml
+++ b/lib/inets/doc/src/notes_history.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>2004</year><year>2011</year>
+ <year>2004</year><year>2012</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 36955df6b3..3b6734a9b8 100644
--- a/lib/inets/doc/src/part.xml
+++ b/lib/inets/doc/src/part.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE part SYSTEM "part.dtd">
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2012</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 21f464318b..81b0dedbfa 100644
--- a/lib/inets/doc/src/part_notes.xml
+++ b/lib/inets/doc/src/part_notes.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE part SYSTEM "part.dtd">
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>2002</year><year>2009</year>
+ <year>2002</year><year>2012</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 3c1e6f5232..f714a6d2e3 100644
--- a/lib/inets/doc/src/part_notes_history.xml
+++ b/lib/inets/doc/src/part_notes_history.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE part SYSTEM "part.dtd">
<part>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/inets/doc/src/ref_man.xml b/lib/inets/doc/src/ref_man.xml
index 45d5dfcd0e..e44829827c 100644
--- a/lib/inets/doc/src/ref_man.xml
+++ b/lib/inets/doc/src/ref_man.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE application SYSTEM "application.dtd">
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2010</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,8 +30,8 @@
</header>
<description>
<p>Inets is a container for Internet clients and
- servers. Currently a FTP client, a HTTP client and server, and
- a tftp client and server has been incorporated in Inets.</p>
+ servers. Currently a FTP client, a HTTP client and server, and
+ a tftp client and server has been incorporated in Inets.</p>
</description>
<xi:include href="inets.xml"/>
<xi:include href="ftp.xml"/>
@@ -45,6 +45,7 @@
<xi:include href="mod_auth.xml"/>
<xi:include href="mod_esi.xml"/>
<xi:include href="mod_security.xml"/>
+ <xi:include href="http_uri.xml"/>
</application>
diff --git a/lib/inets/doc/src/tftp.xml b/lib/inets/doc/src/tftp.xml
index 96d6ae0dd5..0b3e93a153 100644
--- a/lib/inets/doc/src/tftp.xml
+++ b/lib/inets/doc/src/tftp.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2006</year><year>2009</year>
+ <year>2006</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -218,6 +218,8 @@
<c>5</c> times when the timeout expires.</p>
</item>
</taglist>
+
+ <marker id="start1"></marker>
</section>
<funcs>
@@ -231,11 +233,14 @@
</type>
<desc>
<p>Starts a daemon process which listens for udp packets on a
- port. When it receives a request for read or write it spawns
- a temporary server process which handles the actual transfer
- of the (virtual) file.</p>
+ port. When it receives a request for read or write it spawns
+ a temporary server process which handles the actual transfer
+ of the (virtual) file.</p>
+
+ <marker id="read_file"></marker>
</desc>
</func>
+
<func>
<name>read_file(RemoteFilename, LocalFilename, Options) -> {ok, LastCallbackState} | {error, Reason}</name>
<fsummary>Read a (virtual) file from a TFTP server</fsummary>
@@ -248,23 +253,26 @@
</type>
<desc>
<p>Reads a (virtual) file <c>RemoteFilename</c> from a TFTP
- server.</p>
- <p>If <c>LocalFilename</c> is the atom <c>binary</c>,
- <c>tftp_binary</c> is used as callback module. It concatenates
- all transferred blocks and returns them as one single binary
- in <c>LastCallbackState</c>.</p>
- <p>If <c>LocalFilename</c> is a string and there are no
- registered callback modules, <c>tftp_file</c> is used as
- callback module. It writes each transferred block to the file
- named <c>LocalFilename</c> and returns the number of
- transferred bytes in <c>LastCallbackState</c>.</p>
- <p>If <c>LocalFilename</c> is a string and there are registered
- callback modules, <c>LocalFilename</c> is tested against
- the regexps of these and the callback module corresponding to
- the first match is used, or an error tuple is returned if no
- matching regexp is found.</p>
+ server.</p>
+ <p>If <c>LocalFilename</c> is the atom <c>binary</c>,
+ <c>tftp_binary</c> is used as callback module. It concatenates
+ all transferred blocks and returns them as one single binary
+ in <c>LastCallbackState</c>.</p>
+ <p>If <c>LocalFilename</c> is a string and there are no
+ registered callback modules, <c>tftp_file</c> is used as
+ callback module. It writes each transferred block to the file
+ named <c>LocalFilename</c> and returns the number of
+ transferred bytes in <c>LastCallbackState</c>.</p>
+ <p>If <c>LocalFilename</c> is a string and there are registered
+ callback modules, <c>LocalFilename</c> is tested against
+ the regexps of these and the callback module corresponding to
+ the first match is used, or an error tuple is returned if no
+ matching regexp is found.</p>
</desc>
+
+ <marker id="write_file"></marker>
</func>
+
<func>
<name>write_file(RemoteFilename, LocalFilename, Options) -> {ok, LastCallbackState} | {error, Reason}</name>
<fsummary>Write a (virtual) file to a TFTP server</fsummary>
@@ -288,10 +296,12 @@
block by block and returns the number of transferred bytes
in <c>LastCallbackState</c>.</p>
<p>If <c>LocalFilename</c> is a string and there are registered
- callback modules, <c>LocalFilename</c> is tested against
- the regexps of these and the callback module corresponding to
- the first match is used, or an error tuple is returned if no
- matching regexp is found.</p>
+ callback modules, <c>LocalFilename</c> is tested against
+ the regexps of these and the callback module corresponding to
+ the first match is used, or an error tuple is returned if no
+ matching regexp is found.</p>
+
+ <marker id="info_daemons"></marker>
</desc>
</func>
@@ -304,8 +314,9 @@
<v>Reason = term()</v>
</type>
<desc>
- <p>Returns info about all TFTP daemon processes.
- </p>
+ <p>Returns info about all TFTP daemon processes. </p>
+
+ <marker id="info_servers"></marker>
</desc>
</func>
@@ -318,8 +329,9 @@
<v>Reason = term()</v>
</type>
<desc>
- <p>Returns info about all TFTP server processes.
- </p>
+ <p>Returns info about all TFTP server processes. </p>
+
+ <marker id="info_pid"></marker>
</desc>
</func>
@@ -332,6 +344,8 @@
</type>
<desc>
<p>Returns info about a TFTP daemon, server or client process.</p>
+
+ <marker id="change_config_daemons"></marker>
</desc>
</func>
@@ -346,8 +360,9 @@
<v>Reason = term()</v>
</type>
<desc>
- <p>Changes config for all TFTP daemon processes
- </p>
+ <p>Changes config for all TFTP daemon processes. </p>
+
+ <marker id="change_config_servers"></marker>
</desc>
</func>
@@ -362,8 +377,9 @@
<v>Reason = term()</v>
</type>
<desc>
- <p>Changes config for all TFTP server processes
- </p>
+ <p>Changes config for all TFTP server processes. </p>
+
+ <marker id="change_config_pid"></marker>
</desc>
</func>
@@ -378,8 +394,11 @@
</type>
<desc>
<p>Changes config for a TFTP daemon, server or client process</p>
+
+ <marker id="start2"></marker>
</desc>
</func>
+
<func>
<name>start() -> ok | {error, Reason}</name>
<fsummary>Start the Inets application</fsummary>
@@ -442,8 +461,9 @@
by the already ongoing connection on the server
side. By not setting up yet another connection, in
parallel with the ongoing one, the server will
- consumer lesser resources.
- </p>
+ consumer lesser resources. </p>
+
+ <marker id="prepare"></marker>
</section>
<funcs>
@@ -468,17 +488,20 @@
<v>Text = string()</v>
</type>
<desc>
- <p>Prepares to open a file on the client side.</p>
- <p>No new options may be added, but the ones that are present in
- <c>SuggestedOptions</c> may be omitted or replaced with new
- values in <c>AcceptedOptions</c>.</p>
- <p>Will be followed by a call to <c>open/4</c> before any
- read/write access is performed. <c>AcceptedOptions</c> is
- sent to the server which replies with those options that it
- accepts. These will be forwarded to <c>open/4</c> as
- <c>SuggestedOptions</c>.</p>
+ <p>Prepares to open a file on the client side.</p>
+ <p>No new options may be added, but the ones that are present in
+ <c>SuggestedOptions</c> may be omitted or replaced with new
+ values in <c>AcceptedOptions</c>.</p>
+ <p>Will be followed by a call to <c>open/4</c> before any
+ read/write access is performed. <c>AcceptedOptions</c> is
+ sent to the server which replies with those options that it
+ accepts. These will be forwarded to <c>open/4</c> as
+ <c>SuggestedOptions</c>.</p>
+
+ <marker id="open"></marker>
</desc>
</func>
+
<func>
<name>open(Peer, Access, Filename, Mode, SuggestedOptions, State) -> {ok, AcceptedOptions, NewState} | {error, {Code, Text}}</name>
<fsummary>Open a file for read or write access</fsummary>
@@ -503,14 +526,17 @@
<desc>
<p>Opens a file for read or write access.</p>
<p>On the client side where the <c>open/5</c> call has been
- preceded by a call to <c>prepare/5</c>, all options must be
- accepted or rejected.</p>
- <p>On the server side, where there is no preceding
- <c>prepare/5</c> call, no new options may be added, but
- the ones that are present in <c>SuggestedOptions</c> may be
- omitted or replaced with new values in <c>AcceptedOptions</c>.</p>
+ preceded by a call to <c>prepare/5</c>, all options must be
+ accepted or rejected.</p>
+ <p>On the server side, where there is no preceding
+ <c>prepare/5</c> call, no new options may be added, but
+ the ones that are present in <c>SuggestedOptions</c> may be
+ omitted or replaced with new values in <c>AcceptedOptions</c>.</p>
+
+ <marker id="read"></marker>
</desc>
</func>
+
<func>
<name>read(State) -> {more, Bin, NewState} | {last, Bin, FileSize} | {error, {Code, Text}}</name>
<fsummary>Read a chunk from the file</fsummary>
@@ -526,15 +552,18 @@
<desc>
<p>Read a chunk from the file.</p>
<p>The callback function is expected to close
- the file when the last file chunk is
- encountered. When an error is encountered
- the callback function is expected to clean
- up after the aborted file transfer, such as
- closing open file descriptors etc. In both
- cases there will be no more calls to any of
- the callback functions.</p>
+ the file when the last file chunk is
+ encountered. When an error is encountered
+ the callback function is expected to clean
+ up after the aborted file transfer, such as
+ closing open file descriptors etc. In both
+ cases there will be no more calls to any of
+ the callback functions.</p>
+
+ <marker id="write"></marker>
</desc>
</func>
+
<func>
<name>write(Bin, State) -> {more, NewState} | {last, FileSize} | {error, {Code, Text}}</name>
<fsummary>Write a chunk to the file</fsummary>
@@ -550,15 +579,18 @@
<desc>
<p>Write a chunk to the file.</p>
<p>The callback function is expected to close
- the file when the last file chunk is
- encountered. When an error is encountered
- the callback function is expected to clean
- up after the aborted file transfer, such as
- closing open file descriptors etc. In both
- cases there will be no more calls to any of
- the callback functions.</p>
+ the file when the last file chunk is
+ encountered. When an error is encountered
+ the callback function is expected to clean
+ up after the aborted file transfer, such as
+ closing open file descriptors etc. In both
+ cases there will be no more calls to any of
+ the callback functions.</p>
+
+ <marker id="abort"></marker>
</desc>
</func>
+
<func>
<name>abort(Code, Text, State) -> ok</name>
<fsummary>Abort the file transfer</fsummary>
@@ -572,14 +604,14 @@
<desc>
<p>Invoked when the file transfer is aborted.</p>
<p>The callback function is expected to clean
- up its used resources after the aborted file
- transfer, such as closing open file
- descriptors etc. The function will not be
- invoked if any of the other callback
- functions returns an error, as it is
- expected that they already have cleaned up
- the necessary resources. It will however be
- invoked if the functions fails (crashes).</p>
+ up its used resources after the aborted file
+ transfer, such as closing open file
+ descriptors etc. The function will not be
+ invoked if any of the other callback
+ functions returns an error, as it is
+ expected that they already have cleaned up
+ the necessary resources. It will however be
+ invoked if the functions fails (crashes).</p>
</desc>
</func>
</funcs>
@@ -589,7 +621,9 @@
<title>LOGGER FUNCTIONS</title>
<p>A <c>tftp_logger</c> callback module should be implemented as a
- <c>tftp_logger</c> behavior and export the functions listed below.</p>
+ <c>tftp_logger</c> behavior and export the functions listed below.</p>
+
+ <marker id="error_msg"></marker>
</section>
<funcs>
@@ -602,7 +636,10 @@
<v>Reason = term()</v>
</type>
<desc>
- <p>Log an error message. See <c>error_logger:error_msg/2 for details.</c> </p>
+ <p>Log an error message.
+ See <c>error_logger:error_msg/2 for details.</c> </p>
+
+ <marker id="warning_msg"></marker>
</desc>
</func>
@@ -615,7 +652,10 @@
<v>Reason = term()</v>
</type>
<desc>
- <p>Log a warning message. See <c>error_logger:warning_msg/2 for details.</c> </p>
+ <p>Log a warning message.
+ See <c>error_logger:warning_msg/2 for details.</c> </p>
+
+ <marker id="info_msg"></marker>
</desc>
</func>
@@ -628,7 +668,8 @@
<v>Reason = term()</v>
</type>
<desc>
- <p>Log an info message. See <c>error_logger:info_msg/2 for details.</c> </p>
+ <p>Log an info message.
+ See <c>error_logger:info_msg/2 for details.</c> </p>
</desc>
</func>
</funcs>
diff --git a/lib/inets/examples/httpd_load_test/Makefile b/lib/inets/examples/httpd_load_test/Makefile
index 1cc61ad8ae..abd2d8c35d 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. All Rights Reserved.
+# Copyright Ericsson AB 2010-2012. 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
@@ -34,7 +34,7 @@ VSN=$(INETS_VSN)
# Release directory specification
# ----------------------------------------------------
RELSYSDIR = $(RELEASE_PATH)/lib/inets-$(VSN)
-EXAMPLE_RELSYSDIR = $(RELSYSDIR)/examples
+EXAMPLE_RELSYSDIR = "$(RELSYSDIR)/examples"
HDLT_RELSYSDIR = $(EXAMPLE_RELSYSDIR)/httpd_load_test
diff --git a/lib/inets/examples/server_root/Makefile b/lib/inets/examples/server_root/Makefile
index d7a3231068..7a0ee78ecf 100644
--- a/lib/inets/examples/server_root/Makefile
+++ b/lib/inets/examples/server_root/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2010. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -174,36 +174,36 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/examples/server_root/auth
- $(INSTALL_DATA) $(AUTH_FILES) $(RELSYSDIR)/examples/server_root/auth
- $(INSTALL_DIR) $(RELSYSDIR)/examples/server_root/cgi-bin
- $(INSTALL_SCRIPT) $(CGI_FILES) $(RELSYSDIR)/examples/server_root/cgi-bin
- $(INSTALL_DIR) $(RELSYSDIR)/examples/server_root/conf
- $(INSTALL_DATA) $(CONF_FILES) $(RELSYSDIR)/examples/server_root/conf
- $(INSTALL_DIR) $(RELSYSDIR)/examples/server_root/htdocs/open
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/server_root/auth"
+ $(INSTALL_DATA) $(AUTH_FILES) "$(RELSYSDIR)/examples/server_root/auth"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/server_root/cgi-bin"
+ $(INSTALL_SCRIPT) $(CGI_FILES) "$(RELSYSDIR)/examples/server_root/cgi-bin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/server_root/conf"
+ $(INSTALL_DATA) $(CONF_FILES) "$(RELSYSDIR)/examples/server_root/conf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/server_root/htdocs/open"
$(INSTALL_DATA) $(OPEN_FILES) \
- $(RELSYSDIR)/examples/server_root/htdocs/open
- $(INSTALL_DIR) $(RELSYSDIR)/examples/server_root/htdocs/mnesia_open
+ "$(RELSYSDIR)/examples/server_root/htdocs/open"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/server_root/htdocs/mnesia_open"
$(INSTALL_DATA) $(MNESIA_OPEN_FILES) \
- $(RELSYSDIR)/examples/server_root/htdocs/mnesia_open
- $(INSTALL_DIR) $(RELSYSDIR)/examples/server_root/htdocs/misc
+ "$(RELSYSDIR)/examples/server_root/htdocs/mnesia_open"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/server_root/htdocs/misc"
$(INSTALL_DATA) $(MISC_FILES) \
- $(RELSYSDIR)/examples/server_root/htdocs/misc
+ "$(RELSYSDIR)/examples/server_root/htdocs/misc"
$(INSTALL_DIR) \
- $(RELSYSDIR)/examples/server_root/htdocs/secret/top_secret
+ "$(RELSYSDIR)/examples/server_root/htdocs/secret/top_secret"
$(INSTALL_DIR) \
- $(RELSYSDIR)/examples/server_root/htdocs/mnesia_secret/top_secret
+ "$(RELSYSDIR)/examples/server_root/htdocs/mnesia_secret/top_secret"
$(INSTALL_DATA) $(SECRET_FILES) \
- $(RELSYSDIR)/examples/server_root/htdocs/secret
+ "$(RELSYSDIR)/examples/server_root/htdocs/secret"
$(INSTALL_DATA) $(MNESIA_SECRET_FILES) \
- $(RELSYSDIR)/examples/server_root/htdocs/mnesia_secret
- $(INSTALL_DIR) $(RELSYSDIR)/examples/server_root/htdocs
- $(INSTALL_DATA) $(HTDOCS_FILES) $(RELSYSDIR)/examples/server_root/htdocs
- $(INSTALL_DIR) $(RELSYSDIR)/examples/server_root/icons
- $(INSTALL_DATA) $(ICON_FILES) $(RELSYSDIR)/examples/server_root/icons
- $(INSTALL_DIR) $(RELSYSDIR)/examples/server_root/ssl
- $(INSTALL_DATA) $(SSL_FILES) $(RELSYSDIR)/examples/server_root/ssl
- $(INSTALL_DIR) $(RELSYSDIR)/examples/server_root/logs
+ "$(RELSYSDIR)/examples/server_root/htdocs/mnesia_secret"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/server_root/htdocs"
+ $(INSTALL_DATA) $(HTDOCS_FILES) "$(RELSYSDIR)/examples/server_root/htdocs"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/server_root/icons"
+ $(INSTALL_DATA) $(ICON_FILES) "$(RELSYSDIR)/examples/server_root/icons"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/server_root/ssl"
+ $(INSTALL_DATA) $(SSL_FILES) "$(RELSYSDIR)/examples/server_root/ssl"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/server_root/logs"
release_docs_spec:
diff --git a/lib/inets/priv/Makefile b/lib/inets/priv/Makefile
index 85da409e55..acca20f076 100644
--- a/lib/inets/priv/Makefile
+++ b/lib/inets/priv/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -57,8 +57,8 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/bin
- $(INSTALL_SCRIPT) $(EXECUTABLES) $(RELSYSDIR)/priv/bin
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/bin"
+ $(INSTALL_SCRIPT) $(EXECUTABLES) "$(RELSYSDIR)/priv/bin"
release_docs_spec:
diff --git a/lib/inets/src/ftp/Makefile b/lib/inets/src/ftp/Makefile
index 19b93870df..2c3d2b6d13 100644
--- a/lib/inets/src/ftp/Makefile
+++ b/lib/inets/src/ftp/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2010. All Rights Reserved.
+# Copyright Ericsson AB 2005-2012. 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
@@ -88,11 +88,11 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/ftp
- $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) $(RELSYSDIR)/src/ftp
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/ftp"
+ $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) "$(RELSYSDIR)/src/ftp"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/inets/src/ftp/ftp.erl b/lib/inets/src/ftp/ftp.erl
index 560ee55271..fe25c23316 100644
--- a/lib/inets/src/ftp/ftp.erl
+++ b/lib/inets/src/ftp/ftp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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/lib/inets/src/http_client/Makefile b/lib/inets/src/http_client/Makefile
index d490e59929..f0d4ce139e 100644
--- a/lib/inets/src/http_client/Makefile
+++ b/lib/inets/src/http_client/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2011. All Rights Reserved.
+# Copyright Ericsson AB 2005-2012. 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
@@ -89,11 +89,11 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/http_client
- $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) $(RELSYSDIR)/src/http_client
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/http_client"
+ $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) "$(RELSYSDIR)/src/http_client"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl
index ae87ceed93..ede649a5a9 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -31,12 +31,15 @@
-export([
request/1, request/2, request/4, request/5,
cancel_request/1, cancel_request/2,
- set_option/2, set_option/3,
+ set_option/2, set_option/3,
set_options/1, set_options/2,
+ get_option/1, get_option/2,
+ get_options/1, get_options/2,
store_cookies/2, store_cookies/3,
cookie_header/1, cookie_header/2, cookie_header/3,
which_cookies/0, which_cookies/1,
reset_cookies/0, reset_cookies/1,
+ which_sessions/0, which_sessions/1,
stream_next/1,
default_profile/0,
profile_name/1, profile_name/2,
@@ -156,7 +159,7 @@ request(Method,
{http_options, HTTPOptions},
{options, Options},
{profile, Profile}]),
- case http_uri:parse(Url, Options) of
+ case uri_parse(Url, Options) of
{error, Reason} ->
{error, Reason};
{ok, ParsedUrl} ->
@@ -177,7 +180,7 @@ request(Method,
{http_options, HTTPOptions},
{options, Options},
{profile, Profile}]),
- case http_uri:parse(Url, Options) of
+ case uri_parse(Url, Options) of
{error, Reason} ->
{error, Reason};
{ok, ParsedUrl} ->
@@ -230,7 +233,7 @@ cancel_request(RequestId, Profile)
set_options(Options) ->
set_options(Options, default_profile()).
set_options(Options, Profile) when is_atom(Profile) orelse is_pid(Profile) ->
- ?hcrt("set cookies", [{options, Options}, {profile, Profile}]),
+ ?hcrt("set options", [{options, Options}, {profile, Profile}]),
case validate_options(Options) of
{ok, Opts} ->
try
@@ -253,6 +256,59 @@ set_option(Key, Value, Profile) ->
%%--------------------------------------------------------------------------
+%% get_options(OptionItems) -> {ok, Values} | {error, Reason}
+%% get_options(OptionItems, Profile) -> {ok, Values} | {error, Reason}
+%% OptionItems - all | [option_item()]
+%% option_item() - proxy | pipeline_timeout | max_pipeline_length |
+%% keep_alive_timeout | max_keep_alive_length |
+%% max_sessions | verbose |
+%% cookies | ipfamily | ip | port | socket_opts
+%% Profile - atom()
+%% Values - [{option_item(), term()}]
+%% Reason - term()
+%% Description: Retrieves the current options.
+%%-------------------------------------------------------------------------
+
+get_options() ->
+ record_info(fields, options).
+
+get_options(Options) ->
+ get_options(Options, default_profile()).
+
+get_options(all = _Options, Profile) ->
+ get_options(get_options(), Profile);
+get_options(Options, Profile)
+ when (is_list(Options) andalso
+ (is_atom(Profile) orelse is_pid(Profile))) ->
+ ?hcrt("get options", [{options, Options}, {profile, Profile}]),
+ case Options -- get_options() of
+ [] ->
+ try
+ begin
+ {ok, httpc_manager:get_options(Options,
+ profile_name(Profile))}
+ end
+ catch
+ exit:{noproc, _} ->
+ {error, inets_not_started}
+ end;
+ InvalidGetOptions ->
+ {error, {invalid_options, InvalidGetOptions}}
+ end.
+
+get_option(Key) ->
+ get_option(Key, default_profile()).
+
+get_option(Key, Profile) ->
+ case get_options([Key], Profile) of
+ {ok, [{Key, Value}]} ->
+ {ok, Value};
+ Error ->
+ Error
+ end.
+
+
+%%--------------------------------------------------------------------------
%% store_cookies(SetCookieHeaders, Url [, Profile]) -> ok | {error, reason}
%%
%%
@@ -274,7 +330,7 @@ store_cookies(SetCookieHeaders, Url, Profile)
%% Since the Address part is not actually used
%% by the manager when storing cookies, we dont
%% care about ipv6-host-with-brackets.
- {ok, {_, _, Host, Port, Path, _}} = http_uri:parse(Url),
+ {ok, {_, _, Host, Port, Path, _}} = uri_parse(Url),
Address = {Host, Port},
ProfileName = profile_name(Profile),
Cookies = httpc_cookie:cookies(SetCookieHeaders, Path, Host),
@@ -319,8 +375,6 @@ cookie_header(Url, Opts, Profile)
{error, {not_started, Profile}}
end.
-
-
%%--------------------------------------------------------------------------
%% which_cookies() -> [cookie()]
@@ -344,10 +398,32 @@ which_cookies(Profile) ->
%%--------------------------------------------------------------------------
+%% which_sessions() -> {GoodSession, BadSessions, NonSessions}
+%% which_sessions(Profile) -> {GoodSession, BadSessions, NonSessions}
+%%
+%% Description: Debug function, dumping the sessions database, sorted
+%% into three groups (Good-, Bad- and Non-sessions).
+%%-------------------------------------------------------------------------
+which_sessions() ->
+ which_sessions(default_profile()).
+
+which_sessions(Profile) ->
+ ?hcrt("which sessions", [{profile, Profile}]),
+ try
+ begin
+ httpc_manager:which_sessions(profile_name(Profile))
+ end
+ catch
+ exit:{noproc, _} ->
+ {[], [], []}
+ end.
+
+
+%%--------------------------------------------------------------------------
%% info() -> list()
%% info(Profile) -> list()
%%
-%% Description: Debug function, retreive info about the profile
+%% Description: Debug function, retrieve info about the profile
%%-------------------------------------------------------------------------
info() ->
info(default_profile()).
@@ -841,6 +917,10 @@ validate_options([{proxy, Proxy} = Opt| Tail], Acc) ->
validate_proxy(Proxy),
validate_options(Tail, [Opt | Acc]);
+validate_options([{https_proxy, Proxy} = Opt| Tail], Acc) ->
+ validate_https_proxy(Proxy),
+ validate_options(Tail, [Opt | Acc]);
+
validate_options([{max_sessions, Value} = Opt| Tail], Acc) ->
validate_max_sessions(Value),
validate_options(Tail, [Opt | Acc]);
@@ -903,6 +983,14 @@ validate_proxy({{ProxyHost, ProxyPort}, NoProxy} = Proxy)
validate_proxy(BadProxy) ->
bad_option(proxy, BadProxy).
+validate_https_proxy({{ProxyHost, ProxyPort}, NoProxy} = Proxy)
+ when is_list(ProxyHost) andalso
+ is_integer(ProxyPort) andalso
+ is_list(NoProxy) ->
+ Proxy;
+validate_https_proxy(BadProxy) ->
+ bad_option(https_proxy, BadProxy).
+
validate_max_sessions(Value) when is_integer(Value) andalso (Value >= 0) ->
Value;
validate_max_sessions(BadValue) ->
@@ -1144,6 +1232,22 @@ validate_headers(RequestHeaders, _, _) ->
RequestHeaders.
+%%--------------------------------------------------------------------------
+%% These functions is just simple wrappers to parse specifically HTTP URIs
+%%--------------------------------------------------------------------------
+
+scheme_defaults() ->
+ [{http, 80}, {https, 443}].
+
+uri_parse(URI) ->
+ http_uri:parse(URI, [{scheme_defaults, scheme_defaults()}]).
+
+uri_parse(URI, Opts) ->
+ http_uri:parse(URI, [{scheme_defaults, scheme_defaults()} | Opts]).
+
+
+%%--------------------------------------------------------------------------
+
child_name2info(undefined) ->
{error, no_such_service};
child_name2info(httpc_manager) ->
diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl
index bfe9b14ef6..784a9c0019 100644
--- a/lib/inets/src/http_client/httpc_handler.erl
+++ b/lib/inets/src/http_client/httpc_handler.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -29,44 +29,44 @@
%%--------------------------------------------------------------------
%% Internal Application API
-export([
- start_link/4,
- %% connect_and_send/2,
- send/2,
- cancel/3,
- stream/3,
- stream_next/1,
- info/1
- ]).
+ start_link/4,
+ %% connect_and_send/2,
+ send/2,
+ cancel/3,
+ stream/3,
+ stream_next/1,
+ info/1
+ ]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
- terminate/2, code_change/3]).
+ terminate/2, code_change/3]).
-record(timers,
- {
- request_timers = [], % [ref()]
- queue_timer % ref()
- }).
+ {
+ request_timers = [], % [ref()]
+ queue_timer % ref()
+ }).
-record(state,
- {
- request, % #request{}
- session, % #session{}
- status_line, % {Version, StatusCode, ReasonPharse}
- headers, % #http_response_h{}
- body, % binary()
- mfa, % {Moduel, Function, Args}
- pipeline = queue:new(), % queue()
- keep_alive = queue:new(), % queue()
- status, % undefined | new | pipeline | keep_alive | close | ssl_tunnel
- canceled = [], % [RequestId]
- max_header_size = nolimit, % nolimit | integer()
- max_body_size = nolimit, % nolimit | integer()
- options, % #options{}
- timers = #timers{}, % #timers{}
- profile_name, % atom() - id of httpc_manager process.
- once % send | undefined
- }).
+ {
+ request, % #request{}
+ session, % #session{}
+ status_line, % {Version, StatusCode, ReasonPharse}
+ headers, % #http_response_h{}
+ body, % binary()
+ mfa, % {Module, Function, Args}
+ pipeline = queue:new(), % queue()
+ keep_alive = queue:new(), % queue()
+ status, % undefined | new | pipeline | keep_alive | close | {ssl_tunnel, Request}
+ canceled = [], % [RequestId]
+ max_header_size = nolimit, % nolimit | integer()
+ max_body_size = nolimit, % nolimit | integer()
+ options, % #options{}
+ timers = #timers{}, % #timers{}
+ profile_name, % atom() - id of httpc_manager process.
+ once % send | undefined
+ }).
%%====================================================================
@@ -75,8 +75,8 @@
%%--------------------------------------------------------------------
%% Function: start_link(Request, Options, ProfileName) -> {ok, Pid}
%%
-%% Request = #request{}
-%% Options = #options{}
+%% Request = #request{}
+%% Options = #options{}
%% ProfileName = atom() - id of httpc manager process
%%
%% Description: Starts a http-request handler process. Intended to be
@@ -96,11 +96,11 @@
start_link(Parent, Request, Options, ProfileName) ->
{ok, proc_lib:start_link(?MODULE, init, [[Parent, Request, Options,
- ProfileName]])}.
+ ProfileName]])}.
%%--------------------------------------------------------------------
%% Function: send(Request, Pid) -> ok
-%% Request = #request{}
+%% Request = #request{}
%% Pid = pid() - the pid of the http-request handler process.
%%
%% Description: Uses this handlers session to send a request. Intended
@@ -112,7 +112,7 @@ send(Request, Pid) ->
%%--------------------------------------------------------------------
%% Function: cancel(RequestId, Pid) -> ok
-%% RequestId = ref()
+%% RequestId = ref()
%% Pid = pid() - the pid of the http-request handler process.
%%
%% Description: Cancels a request. Intended to be called by the httpc
@@ -142,12 +142,16 @@ stream_next(Pid) ->
%% Used for debugging and testing
%%--------------------------------------------------------------------
info(Pid) ->
- call(info, Pid).
-
+ try
+ call(info, Pid)
+ catch
+ _:_ ->
+ []
+ end.
%%--------------------------------------------------------------------
%% Function: stream(BodyPart, Request, Code) -> _
-%% BodyPart = binary()
+%% BodyPart = binary()
%% Request = #request{}
%% Code = integer()
%%
@@ -167,7 +171,7 @@ stream(BodyPart, #request{stream = Self} = Request, Code)
((Self =:= self) orelse (Self =:= {self, once})) ->
?hcrt("stream - self", [{stream, Self}, {code, Code}]),
httpc_response:send(Request#request.from,
- {Request#request.id, stream, BodyPart}),
+ {Request#request.id, stream, BodyPart}),
{<<>>, Request};
%% Stream to file
@@ -177,11 +181,11 @@ stream(BodyPart, #request{stream = Filename} = Request, Code)
when ((Code =:= 200) orelse (Code =:= 206)) andalso is_list(Filename) ->
?hcrt("stream - filename", [{stream, Filename}, {code, Code}]),
case file:open(Filename, [write, raw, append, delayed_write]) of
- {ok, Fd} ->
- ?hcrt("stream - file open ok", [{fd, Fd}]),
- stream(BodyPart, Request#request{stream = Fd}, 200);
- {error, Reason} ->
- exit({stream_to_file_failed, Reason})
+ {ok, Fd} ->
+ ?hcrt("stream - file open ok", [{fd, Fd}]),
+ stream(BodyPart, Request#request{stream = Fd}, 200);
+ {error, Reason} ->
+ exit({stream_to_file_failed, Reason})
end;
%% Stream to file
@@ -189,10 +193,10 @@ stream(BodyPart, #request{stream = Fd} = Request, Code)
when ((Code =:= 200) orelse (Code =:= 206)) ->
?hcrt("stream to file", [{stream, Fd}, {code, Code}]),
case file:write(Fd, BodyPart) of
- ok ->
- {<<>>, Request};
- {error, Reason} ->
- exit({stream_to_file_failed, Reason})
+ ok ->
+ {<<>>, Request};
+ {error, Reason} ->
+ exit({stream_to_file_failed, Reason})
end;
stream(BodyPart, Request,_) -> % only 200 and 206 responses can be streamed
@@ -208,7 +212,7 @@ stream(BodyPart, Request,_) -> % only 200 and 206 responses can be streamed
%% Function: init([Options, ProfileName]) -> {ok, State} |
%% {ok, State, Timeout} | ignore | {stop, Reason}
%%
-%% Options = #options{}
+%% Options = #options{}
%% ProfileName = atom() - id of httpc manager process
%%
%% Description: Initiates the httpc_handler process
@@ -224,20 +228,19 @@ init([Parent, Request, Options, ProfileName]) ->
%% Do not let initial tcp-connection block the manager-process
proc_lib:init_ack(Parent, self()),
handle_verbose(Options#options.verbose),
- Address = handle_proxy(Request#request.address, Options#options.proxy),
+ ProxyOptions = handle_proxy_options(Request#request.scheme, Options),
+ Address = handle_proxy(Request#request.address, ProxyOptions),
{ok, State} =
- case {Address /= Request#request.address, Request#request.scheme} of
- {true, https} ->
- Error = https_through_proxy_is_not_currently_supported,
- self() ! {init_error,
- Error, httpc_response:error(Request, Error)},
- {ok, #state{request = Request, options = Options,
- status = ssl_tunnel}};
- {_, _} ->
- connect_and_send_first_request(Address, Request,
- #state{options = Options,
- profile_name = ProfileName})
- end,
+ case {Address /= Request#request.address, Request#request.scheme} of
+ {true, https} ->
+ connect_and_send_upgrade_request(Address, Request,
+ #state{options = Options,
+ profile_name = ProfileName});
+ {_, _} ->
+ connect_and_send_first_request(Address, Request,
+ #state{options = Options,
+ profile_name = ProfileName})
+ end,
gen_server:enter_loop(?MODULE, [], State).
%%--------------------------------------------------------------------
@@ -250,139 +253,139 @@ init([Parent, Request, Options, ProfileName]) ->
%% Description: Handling call messages
%%--------------------------------------------------------------------
handle_call(#request{address = Addr} = Request, _,
- #state{status = Status,
- session = #session{type = pipeline} = Session,
- timers = Timers,
- options = #options{proxy = Proxy} = _Options,
- profile_name = ProfileName} = State)
+ #state{status = Status,
+ session = #session{type = pipeline} = Session,
+ timers = Timers,
+ options = #options{proxy = Proxy} = _Options,
+ profile_name = ProfileName} = State)
when Status =/= undefined ->
?hcrv("new request on a pipeline session",
- [{request, Request},
- {profile, ProfileName},
- {status, Status},
- {timers, Timers}]),
+ [{request, Request},
+ {profile, ProfileName},
+ {status, Status},
+ {timers, Timers}]),
Address = handle_proxy(Addr, Proxy),
case httpc_request:send(Address, Session, Request) of
ok ->
- ?hcrd("request sent", []),
+ ?hcrd("request sent", []),
- %% Activate the request time out for the new request
- NewState =
- activate_request_timeout(State#state{request = Request}),
+ %% Activate the request time out for the new request
+ NewState =
+ activate_request_timeout(State#state{request = Request}),
- ClientClose =
- httpc_request:is_client_closing(Request#request.headers),
+ ClientClose =
+ httpc_request:is_client_closing(Request#request.headers),
case State#state.request of
#request{} -> %% Old request not yet finished
- ?hcrd("old request still not finished", []),
- %% Make sure to use the new value of timers in state
- NewTimers = NewState#state.timers,
+ ?hcrd("old request still not finished", []),
+ %% Make sure to use the new value of timers in state
+ NewTimers = NewState#state.timers,
NewPipeline = queue:in(Request, State#state.pipeline),
- NewSession =
- Session#session{queue_length =
- %% Queue + current
- queue:len(NewPipeline) + 1,
- client_close = ClientClose},
- insert_session(NewSession, ProfileName),
- ?hcrd("session updated", []),
+ NewSession =
+ Session#session{queue_length =
+ %% Queue + current
+ queue:len(NewPipeline) + 1,
+ client_close = ClientClose},
+ insert_session(NewSession, ProfileName),
+ ?hcrd("session updated", []),
{reply, ok, State#state{pipeline = NewPipeline,
- session = NewSession,
- timers = NewTimers}};
- undefined ->
- %% Note: tcp-message receiving has already been
- %% activated by handle_pipeline/2.
- ?hcrd("no current request", []),
- cancel_timer(Timers#timers.queue_timer,
- timeout_queue),
- NewSession =
- Session#session{queue_length = 1,
- client_close = ClientClose},
- httpc_manager:insert_session(NewSession, ProfileName),
- Relaxed =
- (Request#request.settings)#http_options.relaxed,
- MFA = {httpc_response, parse,
- [State#state.max_header_size, Relaxed]},
- NewTimers = Timers#timers{queue_timer = undefined},
- ?hcrd("session created", []),
- {reply, ok, NewState#state{request = Request,
- session = NewSession,
- mfa = MFA,
- timers = NewTimers}}
- end;
- {error, Reason} ->
- ?hcri("failed sending request", [{reason, Reason}]),
- {reply, {pipeline_failed, Reason}, State}
+ session = NewSession,
+ timers = NewTimers}};
+ undefined ->
+ %% Note: tcp-message receiving has already been
+ %% activated by handle_pipeline/2.
+ ?hcrd("no current request", []),
+ cancel_timer(Timers#timers.queue_timer,
+ timeout_queue),
+ NewSession =
+ Session#session{queue_length = 1,
+ client_close = ClientClose},
+ httpc_manager:insert_session(NewSession, ProfileName),
+ Relaxed =
+ (Request#request.settings)#http_options.relaxed,
+ MFA = {httpc_response, parse,
+ [State#state.max_header_size, Relaxed]},
+ NewTimers = Timers#timers{queue_timer = undefined},
+ ?hcrd("session created", []),
+ {reply, ok, NewState#state{request = Request,
+ session = NewSession,
+ mfa = MFA,
+ timers = NewTimers}}
+ end;
+ {error, Reason} ->
+ ?hcri("failed sending request", [{reason, Reason}]),
+ {reply, {pipeline_failed, Reason}, State}
end;
handle_call(#request{address = Addr} = Request, _,
- #state{status = Status,
- session = #session{type = keep_alive} = Session,
- timers = Timers,
- options = #options{proxy = Proxy} = _Options,
- profile_name = ProfileName} = State)
+ #state{status = Status,
+ session = #session{type = keep_alive} = Session,
+ timers = Timers,
+ options = #options{proxy = Proxy} = _Options,
+ profile_name = ProfileName} = State)
when Status =/= undefined ->
?hcrv("new request on a keep-alive session",
- [{request, Request},
- {profile, ProfileName},
- {status, Status}]),
+ [{request, Request},
+ {profile, ProfileName},
+ {status, Status}]),
Address = handle_proxy(Addr, Proxy),
case httpc_request:send(Address, Session, Request) of
- ok ->
+ ok ->
- ?hcrd("request sent", []),
+ ?hcrd("request sent", []),
- %% Activate the request time out for the new request
- NewState =
- activate_request_timeout(State#state{request = Request}),
+ %% Activate the request time out for the new request
+ NewState =
+ activate_request_timeout(State#state{request = Request}),
- ClientClose =
- httpc_request:is_client_closing(Request#request.headers),
+ ClientClose =
+ httpc_request:is_client_closing(Request#request.headers),
- case State#state.request of
- #request{} -> %% Old request not yet finished
- %% Make sure to use the new value of timers in state
- ?hcrd("old request still not finished", []),
- NewTimers = NewState#state.timers,
+ case State#state.request of
+ #request{} -> %% Old request not yet finished
+ %% Make sure to use the new value of timers in state
+ ?hcrd("old request still not finished", []),
+ NewTimers = NewState#state.timers,
NewKeepAlive = queue:in(Request, State#state.keep_alive),
- NewSession =
- Session#session{queue_length =
- %% Queue + current
- queue:len(NewKeepAlive) + 1,
- client_close = ClientClose},
- insert_session(NewSession, ProfileName),
- ?hcrd("session updated", []),
+ NewSession =
+ Session#session{queue_length =
+ %% Queue + current
+ queue:len(NewKeepAlive) + 1,
+ client_close = ClientClose},
+ insert_session(NewSession, ProfileName),
+ ?hcrd("session updated", []),
{reply, ok, State#state{keep_alive = NewKeepAlive,
- session = NewSession,
- timers = NewTimers}};
- undefined ->
- %% Note: tcp-message reciving has already been
- %% activated by handle_pipeline/2.
- ?hcrd("no current request", []),
- cancel_timer(Timers#timers.queue_timer,
- timeout_queue),
- NewSession =
- Session#session{queue_length = 1,
- client_close = ClientClose},
- insert_session(NewSession, ProfileName),
- Relaxed =
- (Request#request.settings)#http_options.relaxed,
- MFA = {httpc_response, parse,
- [State#state.max_header_size, Relaxed]},
- {reply, ok, NewState#state{request = Request,
- session = NewSession,
- mfa = MFA}}
- end;
+ session = NewSession,
+ timers = NewTimers}};
+ undefined ->
+ %% Note: tcp-message reciving has already been
+ %% activated by handle_pipeline/2.
+ ?hcrd("no current request", []),
+ cancel_timer(Timers#timers.queue_timer,
+ timeout_queue),
+ NewSession =
+ Session#session{queue_length = 1,
+ client_close = ClientClose},
+ insert_session(NewSession, ProfileName),
+ Relaxed =
+ (Request#request.settings)#http_options.relaxed,
+ MFA = {httpc_response, parse,
+ [State#state.max_header_size, Relaxed]},
+ {reply, ok, NewState#state{request = Request,
+ session = NewSession,
+ mfa = MFA}}
+ end;
- {error, Reason} ->
- ?hcri("failed sending request", [{reason, Reason}]),
- {reply, {request_failed, Reason}, State}
+ {error, Reason} ->
+ ?hcri("failed sending request", [{reason, Reason}]),
+ {reply, {request_failed, Reason}, State}
end;
@@ -411,25 +414,25 @@ handle_call(info, _, State) ->
%% request as if it was never issued as in this case the request will
%% not have been sent.
handle_cast({cancel, RequestId, From},
- #state{request = #request{id = RequestId} = Request,
- profile_name = ProfileName,
- canceled = Canceled} = State) ->
+ #state{request = #request{id = RequestId} = Request,
+ profile_name = ProfileName,
+ canceled = Canceled} = State) ->
?hcrv("cancel current request", [{request_id, RequestId},
- {profile, ProfileName},
- {canceled, Canceled}]),
+ {profile, ProfileName},
+ {canceled, Canceled}]),
httpc_manager:request_canceled(RequestId, ProfileName, From),
?hcrv("canceled", []),
{stop, normal,
State#state{canceled = [RequestId | Canceled],
- request = Request#request{from = answer_sent}}};
+ request = Request#request{from = answer_sent}}};
handle_cast({cancel, RequestId, From},
- #state{profile_name = ProfileName,
- request = #request{id = CurrId},
- canceled = Canceled} = State) ->
+ #state{profile_name = ProfileName,
+ request = #request{id = CurrId},
+ canceled = Canceled} = State) ->
?hcrv("cancel", [{request_id, RequestId},
- {curr_req_id, CurrId},
- {profile, ProfileName},
- {canceled, Canceled}]),
+ {curr_req_id, CurrId},
+ {profile, ProfileName},
+ {canceled, Canceled}]),
httpc_manager:request_canceled(RequestId, ProfileName, From),
?hcrv("canceled", []),
{noreply, State#state{canceled = [RequestId | Canceled]}};
@@ -446,94 +449,94 @@ handle_cast(stream_next, #state{session = Session} = State) ->
%% Description: Handling all non call/cast messages
%%--------------------------------------------------------------------
handle_info({Proto, _Socket, Data},
- #state{mfa = {Module, Function, Args},
- request = #request{method = Method,
- stream = Stream} = Request,
- session = Session,
- status_line = StatusLine} = State)
+ #state{mfa = {Module, Function, Args},
+ request = #request{method = Method,
+ stream = Stream} = Request,
+ session = Session,
+ status_line = StatusLine} = State)
when (Proto =:= tcp) orelse
(Proto =:= ssl) orelse
(Proto =:= httpc_handler) ->
?hcri("received data", [{proto, Proto},
- {module, Module},
- {function, Function},
- {method, Method},
- {stream, Stream},
- {session, Session},
- {status_line, StatusLine}]),
+ {module, Module},
+ {function, Function},
+ {method, Method},
+ {stream, Stream},
+ {session, Session},
+ {status_line, StatusLine}]),
FinalResult =
- try Module:Function([Data | Args]) of
- {ok, Result} ->
- ?hcrd("data processed - ok", []),
- handle_http_msg(Result, State);
- {_, whole_body, _} when Method =:= head ->
- ?hcrd("data processed - whole body", []),
- handle_response(State#state{body = <<>>});
- {Module, whole_body, [Body, Length]} ->
- ?hcrd("data processed - whole body", [{length, Length}]),
- {_, Code, _} = StatusLine,
- {NewBody, NewRequest} = stream(Body, Request, Code),
- %% When we stream we will not keep the already
- %% streamed data, that would be a waste of memory.
- NewLength =
- case Stream of
- none ->
- Length;
- _ ->
- Length - size(Body)
- end,
-
- NewState = next_body_chunk(State),
- NewMFA = {Module, whole_body, [NewBody, NewLength]},
- {noreply, NewState#state{mfa = NewMFA,
- request = NewRequest}};
- NewMFA ->
- ?hcrd("data processed - new mfa", []),
- activate_once(Session),
- {noreply, State#state{mfa = NewMFA}}
- catch
- exit:_Exit ->
- ?hcrd("data processing exit", [{exit, _Exit}]),
- ClientReason = {could_not_parse_as_http, Data},
- ClientErrMsg = httpc_response:error(Request, ClientReason),
- NewState = answer_request(Request, ClientErrMsg, State),
- {stop, normal, NewState};
- error:_Error ->
- ?hcrd("data processing error", [{error, _Error}]),
- ClientReason = {could_not_parse_as_http, Data},
- ClientErrMsg = httpc_response:error(Request, ClientReason),
- NewState = answer_request(Request, ClientErrMsg, State),
- {stop, normal, NewState}
-
- end,
+ try Module:Function([Data | Args]) of
+ {ok, Result} ->
+ ?hcrd("data processed - ok", []),
+ handle_http_msg(Result, State);
+ {_, whole_body, _} when Method =:= head ->
+ ?hcrd("data processed - whole body", []),
+ handle_response(State#state{body = <<>>});
+ {Module, whole_body, [Body, Length]} ->
+ ?hcrd("data processed - whole body", [{length, Length}]),
+ {_, Code, _} = StatusLine,
+ {NewBody, NewRequest} = stream(Body, Request, Code),
+ %% When we stream we will not keep the already
+ %% streamed data, that would be a waste of memory.
+ NewLength =
+ case Stream of
+ none ->
+ Length;
+ _ ->
+ Length - size(Body)
+ end,
+
+ NewState = next_body_chunk(State),
+ NewMFA = {Module, whole_body, [NewBody, NewLength]},
+ {noreply, NewState#state{mfa = NewMFA,
+ request = NewRequest}};
+ NewMFA ->
+ ?hcrd("data processed - new mfa", []),
+ activate_once(Session),
+ {noreply, State#state{mfa = NewMFA}}
+ catch
+ exit:_Exit ->
+ ?hcrd("data processing exit", [{exit, _Exit}]),
+ ClientReason = {could_not_parse_as_http, Data},
+ ClientErrMsg = httpc_response:error(Request, ClientReason),
+ NewState = answer_request(Request, ClientErrMsg, State),
+ {stop, normal, NewState};
+ error:_Error ->
+ ?hcrd("data processing error", [{error, _Error}]),
+ ClientReason = {could_not_parse_as_http, Data},
+ ClientErrMsg = httpc_response:error(Request, ClientReason),
+ NewState = answer_request(Request, ClientErrMsg, State),
+ {stop, normal, NewState}
+
+ end,
?hcri("data processed", [{final_result, FinalResult}]),
FinalResult;
handle_info({Proto, Socket, Data},
- #state{mfa = MFA,
- request = Request,
- session = Session,
- status = Status,
- status_line = StatusLine,
- profile_name = Profile} = State)
+ #state{mfa = MFA,
+ request = Request,
+ session = Session,
+ status = Status,
+ status_line = StatusLine,
+ profile_name = Profile} = State)
when (Proto =:= tcp) orelse
(Proto =:= ssl) orelse
(Proto =:= httpc_handler) ->
error_logger:warning_msg("Received unexpected ~p data on ~p"
- "~n Data: ~p"
- "~n MFA: ~p"
- "~n Request: ~p"
- "~n Session: ~p"
- "~n Status: ~p"
- "~n StatusLine: ~p"
- "~n Profile: ~p"
- "~n",
- [Proto, Socket, Data, MFA,
- Request, Session, Status, StatusLine, Profile]),
+ "~n Data: ~p"
+ "~n MFA: ~p"
+ "~n Request: ~p"
+ "~n Session: ~p"
+ "~n Status: ~p"
+ "~n StatusLine: ~p"
+ "~n Profile: ~p"
+ "~n",
+ [Proto, Socket, Data, MFA,
+ Request, Session, Status, StatusLine, Profile]),
{noreply, State};
@@ -572,45 +575,45 @@ handle_info({ssl_error, _, _} = Reason, State) ->
%% Internally, to a request handling process, a request timeout is
%% seen as a canceled request.
handle_info({timeout, RequestId},
- #state{request = #request{id = RequestId} = Request,
- canceled = Canceled,
- profile_name = ProfileName} = State) ->
+ #state{request = #request{id = RequestId} = Request,
+ canceled = Canceled,
+ profile_name = ProfileName} = State) ->
?hcri("timeout of current request", [{id, RequestId}]),
httpc_response:send(Request#request.from,
- httpc_response:error(Request, timeout)),
+ httpc_response:error(Request, timeout)),
httpc_manager:request_done(RequestId, ProfileName),
?hcrv("response (timeout) sent - now terminate", []),
{stop, normal,
State#state{request = Request#request{from = answer_sent},
- canceled = [RequestId | Canceled]}};
+ canceled = [RequestId | Canceled]}};
handle_info({timeout, RequestId},
- #state{canceled = Canceled,
- profile_name = ProfileName} = State) ->
+ #state{canceled = Canceled,
+ profile_name = ProfileName} = State) ->
?hcri("timeout", [{id, RequestId}]),
Filter =
- fun(#request{id = Id, from = From} = Request) when Id =:= RequestId ->
- ?hcrv("found request", [{id, Id}, {from, From}]),
- %% Notify the owner
- httpc_response:send(From,
- httpc_response:error(Request, timeout)),
- httpc_manager:request_done(RequestId, ProfileName),
- ?hcrv("response (timeout) sent", []),
- [Request#request{from = answer_sent}];
- (_) ->
- true
- end,
+ fun(#request{id = Id, from = From} = Request) when Id =:= RequestId ->
+ ?hcrv("found request", [{id, Id}, {from, From}]),
+ %% Notify the owner
+ httpc_response:send(From,
+ httpc_response:error(Request, timeout)),
+ httpc_manager:request_done(RequestId, ProfileName),
+ ?hcrv("response (timeout) sent", []),
+ [Request#request{from = answer_sent}];
+ (_) ->
+ true
+ end,
case State#state.status of
- pipeline ->
- ?hcrd("pipeline", []),
- Pipeline = queue:filter(Filter, State#state.pipeline),
- {noreply, State#state{canceled = [RequestId | Canceled],
- pipeline = Pipeline}};
- keep_alive ->
- ?hcrd("keep_alive", []),
- KeepAlive = queue:filter(Filter, State#state.keep_alive),
- {noreply, State#state{canceled = [RequestId | Canceled],
- keep_alive = KeepAlive}}
+ pipeline ->
+ ?hcrd("pipeline", []),
+ Pipeline = queue:filter(Filter, State#state.pipeline),
+ {noreply, State#state{canceled = [RequestId | Canceled],
+ pipeline = Pipeline}};
+ keep_alive ->
+ ?hcrd("keep_alive", []),
+ KeepAlive = queue:filter(Filter, State#state.keep_alive),
+ {noreply, State#state{canceled = [RequestId | Canceled],
+ keep_alive = KeepAlive}}
end;
handle_info(timeout_queue, State = #state{request = undefined}) ->
@@ -619,11 +622,11 @@ handle_info(timeout_queue, State = #state{request = undefined}) ->
%% Timing was such as the pipeline_timout was not canceled!
handle_info(timeout_queue, #state{timers = Timers} = State) ->
{noreply, State#state{timers =
- Timers#timers{queue_timer = undefined}}};
+ Timers#timers{queue_timer = undefined}}};
%% Setting up the connection to the server somehow failed.
handle_info({init_error, Tag, ClientErrMsg},
- State = #state{request = Request}) ->
+ State = #state{request = Request}) ->
?hcrv("init error", [{tag, Tag}, {client_error, ClientErrMsg}]),
NewState = answer_request(Request, ClientErrMsg, State),
{stop, normal, NewState};
@@ -647,21 +650,21 @@ handle_info({'EXIT', _, _}, State) ->
%% Init error there is no socket to be closed.
terminate(normal,
- #state{request = Request,
- session = {send_failed, AReason} = Reason} = State) ->
+ #state{request = Request,
+ session = {send_failed, AReason} = Reason} = State) ->
?hcrd("terminate", [{send_reason, AReason}, {request, Request}]),
maybe_send_answer(Request,
- httpc_response:error(Request, Reason),
- State),
+ httpc_response:error(Request, Reason),
+ State),
ok;
terminate(normal,
- #state{request = Request,
- session = {connect_failed, AReason} = Reason} = State) ->
+ #state{request = Request,
+ session = {connect_failed, AReason} = Reason} = State) ->
?hcrd("terminate", [{connect_reason, AReason}, {request, Request}]),
maybe_send_answer(Request,
- httpc_response:error(Request, Reason),
- State),
+ httpc_response:error(Request, Reason),
+ State),
ok;
terminate(normal, #state{session = undefined}) ->
@@ -670,21 +673,21 @@ terminate(normal, #state{session = undefined}) ->
%% Init error sending, no session information has been setup but
%% there is a socket that needs closing.
terminate(normal,
- #state{session = #session{id = undefined} = Session}) ->
+ #state{session = #session{id = undefined} = Session}) ->
close_socket(Session);
%% Socket closed remotely
terminate(normal,
- #state{session = #session{socket = {remote_close, Socket},
- socket_type = SocketType,
- id = Id},
- profile_name = ProfileName,
- request = Request,
- timers = Timers,
- pipeline = Pipeline,
- keep_alive = KeepAlive} = State) ->
+ #state{session = #session{socket = {remote_close, Socket},
+ socket_type = SocketType,
+ id = Id},
+ profile_name = ProfileName,
+ request = Request,
+ timers = Timers,
+ pipeline = Pipeline,
+ keep_alive = KeepAlive} = State) ->
?hcrt("terminate(normal) - remote close",
- [{id, Id}, {profile, ProfileName}]),
+ [{id, Id}, {profile, ProfileName}]),
%% Clobber session
(catch httpc_manager:delete_session(Id, ProfileName)),
@@ -702,15 +705,15 @@ terminate(normal,
http_transport:close(SocketType, Socket);
terminate(Reason, #state{session = #session{id = Id,
- socket = Socket,
- socket_type = SocketType},
- request = undefined,
- profile_name = ProfileName,
- timers = Timers,
- pipeline = Pipeline,
- keep_alive = KeepAlive} = State) ->
+ socket = Socket,
+ socket_type = SocketType},
+ request = undefined,
+ profile_name = ProfileName,
+ timers = Timers,
+ pipeline = Pipeline,
+ keep_alive = KeepAlive} = State) ->
?hcrt("terminate",
- [{id, Id}, {profile, ProfileName}, {reason, Reason}]),
+ [{id, Id}, {profile, ProfileName}, {reason, Reason}]),
%% Clobber session
(catch httpc_manager:delete_session(Id, ProfileName)),
@@ -728,16 +731,16 @@ terminate(Reason, #state{request = undefined}) ->
terminate(Reason, #state{request = Request} = State) ->
?hcrd("terminate", [{reason, Reason}, {request, Request}]),
NewState = maybe_send_answer(Request,
- httpc_response:error(Request, Reason),
- State),
+ httpc_response:error(Request, Reason),
+ State),
terminate(Reason, NewState#state{request = undefined}).
maybe_retry_queue(Q, State) ->
case queue:is_empty(Q) of
- false ->
- retry_pipeline(queue:to_list(Q), State);
- true ->
- ok
+ false ->
+ retry_pipeline(queue:to_list(Q), State);
+ true ->
+ ok
end.
maybe_send_answer(#request{from = answer_sent}, _Reason, State) ->
@@ -761,44 +764,44 @@ deliver_answer(Request) ->
%%--------------------------------------------------------------------
code_change(_,
- #state{session = OldSession,
- profile_name = ProfileName} = State,
- upgrade_from_pre_5_8_1) ->
+ #state{session = OldSession,
+ profile_name = ProfileName} = State,
+ upgrade_from_pre_5_8_1) ->
case OldSession of
- {session,
- Id, ClientClose, Scheme, Socket, SocketType, QueueLen, Type} ->
- NewSession = #session{id = Id,
- client_close = ClientClose,
- scheme = Scheme,
- socket = Socket,
- socket_type = SocketType,
- queue_length = QueueLen,
- type = Type},
- insert_session(NewSession, ProfileName),
- {ok, State#state{session = NewSession}};
- _ ->
- {ok, State}
+ {session,
+ Id, ClientClose, Scheme, Socket, SocketType, QueueLen, Type} ->
+ NewSession = #session{id = Id,
+ client_close = ClientClose,
+ scheme = Scheme,
+ socket = Socket,
+ socket_type = SocketType,
+ queue_length = QueueLen,
+ type = Type},
+ insert_session(NewSession, ProfileName),
+ {ok, State#state{session = NewSession}};
+ _ ->
+ {ok, State}
end;
code_change(_,
- #state{session = OldSession,
- profile_name = ProfileName} = State,
- downgrade_to_pre_5_8_1) ->
+ #state{session = OldSession,
+ profile_name = ProfileName} = State,
+ downgrade_to_pre_5_8_1) ->
case OldSession of
- #session{id = Id,
- client_close = ClientClose,
- scheme = Scheme,
- socket = Socket,
- socket_type = SocketType,
- queue_length = QueueLen,
- type = Type} ->
- NewSession = {session,
- Id, ClientClose, Scheme, Socket, SocketType,
- QueueLen, Type},
- insert_session(NewSession, ProfileName),
- {ok, State#state{session = NewSession}};
- _ ->
- {ok, State}
+ #session{id = Id,
+ client_close = ClientClose,
+ scheme = Scheme,
+ socket = Socket,
+ socket_type = SocketType,
+ queue_length = QueueLen,
+ type = Type} ->
+ NewSession = {session,
+ Id, ClientClose, Scheme, Socket, SocketType,
+ QueueLen, Type},
+ insert_session(NewSession, ProfileName),
+ {ok, State#state{session = NewSession}};
+ _ ->
+ {ok, State}
end;
code_change(_, State, _) ->
@@ -806,22 +809,22 @@ code_change(_, State, _) ->
%% new_http_options({http_options, TimeOut, AutoRedirect, SslOpts,
-%% Auth, Relaxed}) ->
+%% Auth, Relaxed}) ->
%% {http_options, "HTTP/1.1", TimeOut, AutoRedirect, SslOpts,
%% Auth, Relaxed}.
%% old_http_options({http_options, _, TimeOut, AutoRedirect,
-%% SslOpts, Auth, Relaxed}) ->
+%% SslOpts, Auth, Relaxed}) ->
%% {http_options, TimeOut, AutoRedirect, SslOpts, Auth, Relaxed}.
%% new_queue(Queue, Fun) ->
%% List = queue:to_list(Queue),
%% NewList =
-%% lists:map(fun(Request) ->
-%% Settings =
-%% Fun(Request#request.settings),
-%% Request#request{settings = Settings}
-%% end, List),
+%% lists:map(fun(Request) ->
+%% Settings =
+%% Fun(Request#request.settings),
+%% Request#request{settings = Settings}
+%% end, List),
%% queue:from_list(NewList).
@@ -830,88 +833,121 @@ code_change(_, State, _) ->
%%%--------------------------------------------------------------------
connect(SocketType, ToAddress,
- #options{ipfamily = IpFamily,
- ip = FromAddress,
- port = FromPort,
- socket_opts = Opts0}, Timeout) ->
+ #options{ipfamily = IpFamily,
+ ip = FromAddress,
+ port = FromPort,
+ socket_opts = Opts0}, Timeout) ->
Opts1 =
- case FromPort of
- default ->
- Opts0;
- _ ->
- [{port, FromPort} | Opts0]
- end,
+ case FromPort of
+ default ->
+ Opts0;
+ _ ->
+ [{port, FromPort} | Opts0]
+ end,
Opts2 =
- case FromAddress of
- default ->
- Opts1;
- _ ->
- [{ip, FromAddress} | Opts1]
- end,
+ case FromAddress of
+ default ->
+ Opts1;
+ _ ->
+ [{ip, FromAddress} | Opts1]
+ end,
case IpFamily of
- inet6fb4 ->
- Opts3 = [inet6 | Opts2],
- case http_transport:connect(SocketType, ToAddress, Opts3, Timeout) of
- {error, _Reason} = Error ->
- Opts4 = [inet | Opts2],
- case http_transport:connect(SocketType,
- ToAddress, Opts4, Timeout) of
- {error, _} ->
- %% Reply with the "original" error
- Error;
- OK ->
- OK
- end;
- OK ->
- OK
- end;
- _ ->
- Opts3 = [IpFamily | Opts2],
- http_transport:connect(SocketType, ToAddress, Opts3, Timeout)
+ inet6fb4 ->
+ Opts3 = [inet6 | Opts2],
+ case http_transport:connect(SocketType,
+ ToAddress, Opts3, Timeout) of
+ {error, Reason6} ->
+ Opts4 = [inet | Opts2],
+ case http_transport:connect(SocketType,
+ ToAddress, Opts4, Timeout) of
+ {error, Reason4} ->
+ {error, {failed_connect,
+ [{to_address, ToAddress},
+ {inet6, Opts3, Reason6},
+ {inet, Opts4, Reason4}]}};
+ OK ->
+ OK
+ end;
+ OK ->
+ OK
+ end;
+ _ ->
+ Opts3 = [IpFamily | Opts2],
+ case http_transport:connect(SocketType, ToAddress, Opts3, Timeout) of
+ {error, Reason} ->
+ {error, {failed_connect, [{to_address, ToAddress},
+ {IpFamily, Opts3, Reason}]}};
+ Else ->
+ Else
+ end
end.
connect_and_send_first_request(Address, Request, #state{options = Options} = State) ->
SocketType = socket_type(Request),
ConnTimeout = (Request#request.settings)#http_options.connect_timeout,
?hcri("connect",
- [{address, Address}, {request, Request}, {options, Options}]),
+ [{address, Address}, {request, Request}, {options, Options}]),
+ case connect(SocketType, Address, Options, ConnTimeout) of
+ {ok, Socket} ->
+ ClientClose =
+ httpc_request:is_client_closing(
+ Request#request.headers),
+ SessionType = httpc_manager:session_type(Options),
+ SocketType = socket_type(Request),
+ Session = #session{id = {Request#request.address, self()},
+ scheme = Request#request.scheme,
+ socket = Socket,
+ socket_type = SocketType,
+ client_close = ClientClose,
+ type = SessionType},
+ ?hcri("connected - now send first request", [{socket, Socket}]),
+
+ case httpc_request:send(Address, Session, Request) of
+ ok ->
+ ?hcri("first request sent", []),
+ TmpState = State#state{request = Request,
+ session = Session,
+ mfa = init_mfa(Request, State),
+ status_line =
+ init_status_line(Request),
+ headers = undefined,
+ body = undefined,
+ status = new},
+ http_transport:setopts(SocketType,
+ Socket, [{active, once}]),
+ NewState = activate_request_timeout(TmpState),
+ {ok, NewState};
+ {error, Reason} ->
+ self() ! {init_error, error_sending,
+ httpc_response:error(Request, Reason)},
+ {ok, State#state{request = Request,
+ session =
+ #session{socket = Socket}}}
+ end;
+ {error, Reason} ->
+ self() ! {init_error, error_connecting,
+ httpc_response:error(Request, Reason)},
+ {ok, State#state{request = Request}}
+ end.
+
+connect_and_send_upgrade_request(Address, Request, #state{options = Options} = State) ->
+ ConnTimeout = (Request#request.settings)#http_options.connect_timeout,
+ SocketType = ip_comm,
case connect(SocketType, Address, Options, ConnTimeout) of
- {ok, Socket} ->
- ClientClose =
- httpc_request:is_client_closing(
- Request#request.headers),
+ {ok, Socket} ->
SessionType = httpc_manager:session_type(Options),
- SocketType = socket_type(Request),
- Session = #session{id = {Request#request.address, self()},
- scheme = Request#request.scheme,
- socket = Socket,
+ Session = #session{socket = Socket,
socket_type = SocketType,
- client_close = ClientClose,
+ id = {Request#request.address, self()},
+ scheme = http,
+ client_close = false,
type = SessionType},
- ?hcri("connected - now send first request", [{socket, Socket}]),
-
- case httpc_request:send(Address, Session, Request) of
- ok ->
- ?hcri("first request sent", []),
- TmpState = State#state{request = Request,
- session = Session,
- mfa = init_mfa(Request, State),
- status_line =
- init_status_line(Request),
- headers = undefined,
- body = undefined,
- status = new},
- http_transport:setopts(SocketType,
- Socket, [{active, once}]),
- NewState = activate_request_timeout(TmpState),
- {ok, NewState};
- {error, Reason} ->
- self() ! {init_error, error_sending,
- httpc_response:error(Request, Reason)},
- {ok, State#state{request = Request,
- session =
- #session{socket = Socket}}}
- end;
+ ErrorHandler =
+ fun(ERequest, EState, EReason) ->
+ self() ! {init_error, error_sending,
+ httpc_response:error(ERequest, EReason)},
+ {ok, EState#state{request = ERequest}} end,
+ tls_tunnel(Address, Request, State#state{session = Session}, ErrorHandler);
{error, Reason} ->
self() ! {init_error, error_connecting,
httpc_response:error(Request, Reason)},
@@ -1015,15 +1051,25 @@ handle_http_msg(Body, #state{status_line = {_,Code, _}} = State) ->
{NewBody, NewRequest} = stream(Body, State#state.request, Code),
handle_response(State#state{body = NewBody, request = NewRequest}).
-handle_http_body(<<>>, State = #state{status_line = {_,304, _}}) ->
+handle_http_body(_, #state{status = {ssl_tunnel, _},
+ status_line = {_,200, _}} = State) ->
+ tls_upgrade(State);
+
+handle_http_body(_, #state{status = {ssl_tunnel, Request},
+ status_line = StatusLine} = State) ->
+ ClientErrMsg = httpc_response:error(Request,{could_no_establish_ssh_tunnel, StatusLine}),
+ NewState = answer_request(Request, ClientErrMsg, State),
+ {stop, normal, NewState};
+
+handle_http_body(<<>>, #state{status_line = {_,304, _}} = State) ->
?hcrt("handle_http_body - 304", []),
handle_response(State#state{body = <<>>});
-handle_http_body(<<>>, State = #state{status_line = {_,204, _}}) ->
+handle_http_body(<<>>, #state{status_line = {_,204, _}} = State) ->
?hcrt("handle_http_body - 204", []),
handle_response(State#state{body = <<>>});
-handle_http_body(<<>>, State = #state{request = #request{method = head}}) ->
+handle_http_body(<<>>, #state{request = #request{method = head}} = State) ->
?hcrt("handle_http_body - head", []),
handle_response(State#state{body = <<>>});
@@ -1110,7 +1156,7 @@ handle_response(#state{request = Request,
{session, Session},
{status_line, StatusLine}]),
- handle_cookies(Headers, Request, Options, ProfileName),
+ handle_cookies(Headers, Request, Options, httpc_manager), %% FOO profile_name
case httpc_response:result({StatusLine, Headers, Body}, Request) of
%% 100-continue
continue ->
@@ -1494,6 +1540,12 @@ retry_pipeline([Request | PipeLine],
end,
retry_pipeline(PipeLine, NewState).
+handle_proxy_options(https, #options{https_proxy = {HttpsProxy, _} = HttpsProxyOpt}) when
+ HttpsProxy =/= undefined ->
+ HttpsProxyOpt;
+handle_proxy_options(_, #options{proxy = Proxy}) ->
+ Proxy.
+
%%% Check to see if the given {Host,Port} tuple is in the NoProxyList
%%% Returns an eventually updated {Host,Port} tuple, with the proxy address
handle_proxy(HostPort = {Host, _Port}, {Proxy, NoProxy}) ->
@@ -1687,6 +1739,96 @@ send_raw(SocketType, Socket, ProcessBody, Acc) ->
end
end.
+tls_tunnel(Address, Request, #state{session = #session{socket = Socket,
+ socket_type = SocketType} = Session} = State,
+ ErrorHandler) ->
+ UpgradeRequest = tls_tunnel_request(Request),
+ case httpc_request:send(Address, Session, UpgradeRequest) of
+ ok ->
+ TmpState = State#state{request = UpgradeRequest,
+ %% session = Session,
+ mfa = init_mfa(UpgradeRequest, State),
+ status_line =
+ init_status_line(UpgradeRequest),
+ headers = undefined,
+ body = undefined},
+ http_transport:setopts(SocketType,
+ Socket, [{active, once}]),
+ NewState = activate_request_timeout(TmpState),
+ {ok, NewState#state{status = {ssl_tunnel, Request}}};
+ {error, Reason} ->
+ ErrorHandler(Request, State, Reason)
+ end.
+
+tls_tunnel_request(#request{headers = Headers,
+ settings = Options,
+ address = {Host, Port}= Adress,
+ ipv6_host_with_brackets = IPV6}) ->
+
+ URI = Host ++":" ++ integer_to_list(Port),
+
+ #request{
+ id = make_ref(),
+ from = self(),
+ scheme = http, %% Use tcp-first and then upgrade!
+ address = Adress,
+ path = URI,
+ pquery = "",
+ method = connect,
+ headers = #http_request_h{host = host_header(Headers, URI),
+ te = "",
+ pragma = "no-cache",
+ other = [{"Proxy-Connection", " Keep-Alive"}]},
+ settings = Options,
+ abs_uri = URI,
+ stream = false,
+ userinfo = "",
+ headers_as_is = [],
+ started = http_util:timestamp(),
+ ipv6_host_with_brackets = IPV6
+ }.
+
+host_header(#http_request_h{host = Host}, _) ->
+ Host;
+
+%% Handles header_as_is
+host_header(_, URI) ->
+ {ok, {_, _, Host, _, _, _}} = http_uri:parse(URI),
+ Host.
+
+tls_upgrade(#state{status =
+ {ssl_tunnel,
+ #request{settings =
+ #http_options{ssl = {_, TLSOptions} = SocketType}} = Request},
+ session = #session{socket = TCPSocket} = Session0,
+ options = Options} = State) ->
+
+ case ssl:connect(TCPSocket, TLSOptions) of
+ {ok, TLSSocket} ->
+ Address = Request#request.address,
+ ClientClose = httpc_request:is_client_closing(Request#request.headers),
+ SessionType = httpc_manager:session_type(Options),
+ Session = Session0#session{
+ scheme = https,
+ socket = TLSSocket,
+ socket_type = SocketType,
+ type = SessionType,
+ client_close = ClientClose},
+ httpc_request:send(Address, Session, Request),
+ http_transport:setopts(SocketType, TLSSocket, [{active, once}]),
+ NewState = State#state{session = Session,
+ request = Request,
+ mfa = init_mfa(Request, State),
+ status_line =
+ init_status_line(Request),
+ headers = undefined,
+ body = undefined,
+ status = new
+ },
+ {noreply, activate_request_timeout(NewState)};
+ {error, _Reason} ->
+ {stop, normal, State#state{request = Request}}
+ end.
%% ---------------------------------------------------------------------
%% Session wrappers
@@ -1704,7 +1846,32 @@ update_session(ProfileName, #session{id = SessionId} = Session, Pos, Value) ->
catch
error:undef -> % This could happen during code upgrade
Session2 = erlang:setelement(Pos, Session, Value),
- insert_session(Session2, ProfileName)
+ insert_session(Session2, ProfileName);
+ T:E ->
+ error_logger:error_msg("Failed updating session: "
+ "~n ProfileName: ~p"
+ "~n SessionId: ~p"
+ "~n Pos: ~p"
+ "~n Value: ~p"
+ "~nwhen"
+ "~n Session (db) info: ~p"
+ "~n Session (db): ~p"
+ "~n Session (record): ~p"
+ "~n T: ~p"
+ "~n E: ~p",
+ [ProfileName, SessionId, Pos, Value,
+ (catch httpc_manager:which_session_info(ProfileName)),
+ Session,
+ (catch httpc_manager:lookup_session(ProfileName, SessionId)),
+ T, E]),
+ exit({failed_updating_session,
+ [{profile, ProfileName},
+ {session_id, SessionId},
+ {pos, Pos},
+ {value, Value},
+ {etype, T},
+ {error, E},
+ {stacktrace, erlang:get_stacktrace()}]})
end.
diff --git a/lib/inets/src/http_client/httpc_internal.hrl b/lib/inets/src/http_client/httpc_internal.hrl
index 8af752546c..30e2742e9d 100644
--- a/lib/inets/src/http_client/httpc_internal.hrl
+++ b/lib/inets/src/http_client/httpc_internal.hrl
@@ -37,6 +37,7 @@
-define(HTTP_MAX_REDIRECTS, 4).
-define(HTTP_KEEP_ALIVE_TIMEOUT, 120000).
-define(HTTP_KEEP_ALIVE_LENGTH, 5).
+-define(TLS_UPGRADE_TOKEN, "TLS/1.0").
%%% HTTP Client per request settings
-record(http_options,
@@ -72,6 +73,7 @@
-record(options,
{
proxy = {undefined, []}, % {{ProxyHost, ProxyPort}, [NoProxy]},
+ https_proxy = {undefined, []}, % {{ProxyHost, ProxyPort}, [NoProxy]}
%% 0 means persistent connections are used without pipelining
pipeline_timeout = ?HTTP_PIPELINE_TIMEOUT,
max_pipeline_length = ?HTTP_PIPELINE_LENGTH,
diff --git a/lib/inets/src/http_client/httpc_manager.erl b/lib/inets/src/http_client/httpc_manager.erl
index 453081da21..c45dcab802 100644
--- a/lib/inets/src/http_client/httpc_manager.erl
+++ b/lib/inets/src/http_client/httpc_manager.erl
@@ -34,9 +34,13 @@
retry_request/2,
redirect_request/2,
insert_session/2,
+ lookup_session/2,
update_session/4,
delete_session/2,
+ which_sessions/1,
+ which_session_info/1,
set_options/2,
+ get_options/2,
store_cookies/3,
which_cookies/1, which_cookies/2, which_cookies/3,
reset_cookies/1,
@@ -58,17 +62,9 @@
options = #options{}
}).
--record(handler_info,
- {
- id, % Id of the request: request_id()
- starter, % Pid of the handler starter process (temp): pid()
- handler, % Pid of the handler process: pid()
- from, % From for the request: from()
- state % State of the handler: initiating | started | operational | canceled
- }).
-
-define(DELAY, 500).
+
%%====================================================================
%% Internal Application API
%%====================================================================
@@ -194,13 +190,28 @@ insert_session(Session, ProfileName) ->
%%--------------------------------------------------------------------
+%% Function: lookup_session(SessionId, ProfileName) -> _
+%% SessionId - term()
+%% ProfileName - atom()
+%%
+%% Description: Looks up a session record in the httpc manager
+%% table <ProfileName>__session_db.
+%%--------------------------------------------------------------------
+
+lookup_session(SessionId, ProfileName) ->
+ SessionDbName = session_db_name(ProfileName),
+ ?hcrt("lookup session", [{session_id, SessionId}, {profile, ProfileName}]),
+ ets:lookup(SessionDbName, SessionId).
+
+
+%%--------------------------------------------------------------------
%% Function: update_session(ProfileName, SessionId, Pos, Value) -> _
%% Session - #session{}
%% ProfileName - atom()
%%
%% Description: Update, only one field (Pos) of the session record
%% identified by the SessionId, the session information
-%% of the httpc manager table <ProfileName>_session_db.
+%% of the httpc manager table <ProfileName>__session_db.
%% Intended to be called by the httpc request handler process.
%%--------------------------------------------------------------------
@@ -215,12 +226,12 @@ update_session(ProfileName, SessionId, Pos, Value) ->
%%--------------------------------------------------------------------
-%% Function: delete_session(SessionId, ProfileName) -> _
+%% Function: delete_session(SessionId, ProfileName) -> void()
%% SessionId - {{Host, Port}, HandlerPid}
%% ProfileName - atom()
%%
%% Description: Deletes session information from the httpc manager
-%% table httpc_manager_session_db_<Profile>. Intended to be called by
+%% table <ProfileName>__session_db. Intended to be called by
%% the httpc request handler process.
%%--------------------------------------------------------------------
@@ -231,6 +242,57 @@ delete_session(SessionId, ProfileName) ->
%%--------------------------------------------------------------------
+%% Function: which sessions(ProfileName) -> SessionsInfo
+%% ProfileName - atom()
+%% SessionsInfo - {GoodSessions, BadSessions, NonSessions}
+%% GoodSessions - [#session{}]
+%% BadSessions - [tuple()]
+%% NonSessions - [term()]
+%%
+%% Description: Produces a list of all sessions in the session db.
+%% Used for debugging and since that is the intent, there is some
+%% checking and transforming done, which produces the results.
+%%--------------------------------------------------------------------
+
+which_sessions(ProfileName) ->
+ ?hcrt("which_sessions", [{profile, ProfileName}]),
+ SessionDbName = session_db_name(ProfileName),
+ which_sessions2(SessionDbName).
+
+which_sessions2(SessionDbName) ->
+ Sessions = which_sessions_order(ets:tab2list(SessionDbName)),
+ GoodSessions = [GoodSession || {good_session, GoodSession} <- Sessions],
+ BadSessions = [BadSession || {bad_session, BadSession} <- Sessions],
+ NonSessions = [NonSession || {non_session, NonSession} <- Sessions],
+ {lists:keysort(#session.id, GoodSessions),
+ lists:keysort(#session.id, BadSessions),
+ lists:sort(NonSessions)}.
+
+which_sessions_order([]) ->
+ [];
+which_sessions_order([Session|Sessions]) when is_record(Session, session) ->
+ [{good_session, Session} | which_sessions_order(Sessions)];
+which_sessions_order([BadSession|Sessions])
+ when is_tuple(BadSession) andalso
+ (element(1, BadSession) =:= session) ->
+ [{bad_session, BadSession} | which_sessions_order(Sessions)];
+which_sessions_order([NonSession|Sessions]) ->
+ [{non_session, NonSession} | which_sessions_order(Sessions)].
+
+
+%%--------------------------------------------------------------------
+%% Function: which session_info(ProfileName) -> list()
+%%
+%% Description: Produces a ets table info list of the sessions table
+%%--------------------------------------------------------------------
+
+which_session_info(ProfileName) ->
+ SessionDbName = session_db_name(ProfileName),
+ ?hcrt("which_session_info", [{profile, ProfileName}]),
+ ets:info(SessionDbName).
+
+
+%%--------------------------------------------------------------------
%% Function: set_options(Options, ProfileName) -> ok
%%
%% Options = [Option]
@@ -250,6 +312,21 @@ set_options(Options, ProfileName) ->
%%--------------------------------------------------------------------
+%% Function: get_options(OptionItems, ProfileName) -> Values
+%%
+%% OptionItems = [OptionItem]
+%% OptionItem = Any or all fields of the current #options{} record
+%% Values = [{OptionItem, Value}]
+%% Value = term()
+%%
+%% Description: Gets the specified options used by the client.
+%%--------------------------------------------------------------------
+
+get_options(Options, ProfileName) ->
+ call(ProfileName, {get_options, Options}).
+
+
+%%--------------------------------------------------------------------
%% Function: store_cookies(Cookies, Address, ProfileName) -> ok
%%
%% Cookies = [Cookie]
@@ -363,8 +440,7 @@ do_init(ProfileName, CookiesDir) ->
%% Create handler db
?hcrt("create handler/request db", []),
HandlerDbName = handler_db_name(ProfileName),
- ets:new(HandlerDbName,
- [protected, set, named_table, {keypos, #handler_info.id}]),
+ ets:new(HandlerDbName, [protected, set, named_table, {keypos, 1}]),
%% Cookie DB
?hcrt("create cookie db", []),
@@ -398,9 +474,10 @@ handle_call({request, Request}, _, State) ->
{stop, Error, httpc_response:error(Request, Error), State}
end;
-handle_call({cancel_request, RequestId}, From, State) ->
+handle_call({cancel_request, RequestId}, From,
+ #state{handler_db = HandlerDb} = State) ->
?hcri("cancel_request", [{request_id, RequestId}]),
- case ets:lookup(State#state.handler_db, RequestId) of
+ case ets:lookup(HandlerDb, RequestId) of
[] ->
%% The request has allready compleated make sure
%% it is deliverd to the client process queue so
@@ -412,9 +489,9 @@ handle_call({cancel_request, RequestId}, From, State) ->
{noreply, State};
[{_, Pid, _}] ->
httpc_handler:cancel(RequestId, Pid, From),
- {noreply, State#state{cancel =
- [{RequestId, Pid, From} |
- State#state.cancel]}}
+ {noreply,
+ State#state{cancel =
+ [{RequestId, Pid, From} | State#state.cancel]}}
end;
handle_call(reset_cookies, _, #state{cookie_db = CookieDb} = State) ->
@@ -430,7 +507,7 @@ handle_call(which_cookies, _, #state{cookie_db = CookieDb} = State) ->
handle_call({which_cookies, Url, Options}, _,
#state{cookie_db = CookieDb} = State) ->
?hcrv("which cookies", [{url, Url}, {options, Options}]),
- case http_uri:parse(Url, Options) of
+ case uri_parse(Url, Options) of
{ok, {Scheme, _, Host, Port, Path, _}} ->
CookieHeaders =
httpc_cookie:header(CookieDb, Scheme, {Host, Port}, Path),
@@ -439,6 +516,12 @@ handle_call({which_cookies, Url, Options}, _,
{reply, ERROR, State}
end;
+handle_call({get_options, OptionItems}, _, #state{options = Options} = State) ->
+ ?hcrv("get options", [{option_items, OptionItems}]),
+ Reply = [{OptionItem, get_option(OptionItem, Options)} ||
+ OptionItem <- OptionItems],
+ {reply, Reply, State};
+
handle_call(info, _, State) ->
?hcrv("info", []),
Info = get_manager_info(State),
@@ -494,6 +577,7 @@ handle_cast({set_options, Options}, State = #state{options = OldOptions}) ->
?hcrv("set options", [{options, Options}, {old_options, OldOptions}]),
NewOptions =
#options{proxy = get_proxy(Options, OldOptions),
+ https_proxy = get_https_proxy(Options, OldOptions),
pipeline_timeout = get_pipeline_timeout(Options, OldOptions),
max_pipeline_length = get_max_pipeline_length(Options, OldOptions),
max_keep_alive_length = get_max_keep_alive_length(Options, OldOptions),
@@ -623,7 +707,7 @@ code_change(_,
code_change(_, State, _) ->
{ok, State}.
-%% This function is to catch everything that calls through the cracks...
+%% This function is used to catch everything that falls through the cracks...
update_session_table(SessionDB, Transform) ->
ets:safe_fixtable(SessionDB, true),
update_session_table(SessionDB, ets:first(SessionDB), Transform),
@@ -651,39 +735,42 @@ update_session_table(SessionDB, Key, Transform) ->
%%--------------------------------------------------------------------
get_manager_info(#state{handler_db = HDB,
- cookie_db = CDB} = _State) ->
+ session_db = SDB,
+ cookie_db = CDB,
+ options = Options} = _State) ->
HandlerInfo = get_handler_info(HDB),
+ SessionInfo = which_sessions2(SDB),
+ OptionsInfo =
+ [{Item, get_option(Item, Options)} ||
+ Item <- record_info(fields, options)],
CookieInfo = httpc_cookie:which_cookies(CDB),
- [{handlers, HandlerInfo}, {cookies, CookieInfo}].
+ [{handlers, HandlerInfo},
+ {sessions, SessionInfo},
+ {options, OptionsInfo},
+ {cookies, CookieInfo}].
+
+sort_handlers(Unsorted) ->
+ sort_handlers2(lists:keysort(1, Unsorted)).
+
+sort_handlers2([]) ->
+ [];
+sort_handlers2([{HandlerPid, RequestId}|L]) ->
+ {Handler, Rest} = sort_handlers2(HandlerPid, [RequestId], L),
+ [Handler | sort_handlers2(Rest)].
+
+sort_handlers2(HandlerPid, Reqs, []) ->
+ {{HandlerPid, lists:sort(Reqs)}, []};
+sort_handlers2(HandlerPid, Reqs, [{HandlerPid, ReqId}|Rest]) ->
+ sort_handlers2(HandlerPid, [ReqId|Reqs], Rest);
+sort_handlers2(HandlerPid1, Reqs, [{HandlerPid2, _}|_] = Rest)
+ when HandlerPid1 =/= HandlerPid2 ->
+ {{HandlerPid1, lists:sort(Reqs)}, Rest}.
get_handler_info(Tab) ->
- Pattern = #handler_info{handler = '$1',
- state = '$2',
- _ = '_'},
- Handlers1 = [{Pid, State} || [Pid, State] <- ets:match(Tab, Pattern)],
- F = fun({Pid, State} = Elem, Acc) when State =/= canceled ->
- case lists:keymember(Pid, 1, Acc) of
- true ->
- Acc;
- false ->
- [Elem | Acc]
- end;
- (_, Acc) ->
- Acc
- end,
- Handlers2 = lists:foldl(F, [], Handlers1),
- Handlers3 = [{Pid, State,
- case (catch httpc_handler:info(Pid)) of
- {'EXIT', _} ->
- %% Why would this crash?
- %% Only if the process has died, but we don't
- %% know about it?
- [];
- Else ->
- Else
- end} ||
- {Pid, State} <- Handlers2],
- Handlers3.
+ Pattern = {'$2', '$1', '_'},
+ Handlers1 = [{Pid, Id} || [Pid, Id] <- ets:match(Tab, Pattern)],
+ Handlers2 = sort_handlers(Handlers1),
+ [{Pid, Reqs, httpc_handler:info(Pid)} || {Pid, Reqs} <- Handlers2].
handle_request(#request{settings =
#http_options{version = "HTTP/0.9"}} = Request,
@@ -736,19 +823,21 @@ handle_request(Request, State = #state{options = Options}) ->
{reply, {ok, NewRequest#request.id}, State}.
-start_handler(Request, State) ->
+start_handler(#request{id = Id,
+ from = From} = Request,
+ #state{profile_name = ProfileName,
+ handler_db = HandlerDb,
+ options = Options}) ->
{ok, Pid} =
case is_inets_manager() of
true ->
httpc_handler_sup:start_child([whereis(httpc_handler_sup),
- Request, State#state.options,
- State#state.profile_name]);
+ Request, Options, ProfileName]);
false ->
- httpc_handler:start_link(self(), Request, State#state.options,
- State#state.profile_name)
+ httpc_handler:start_link(self(), Request, Options, ProfileName)
end,
- ets:insert(State#state.handler_db, {Request#request.id,
- Pid, Request#request.from}),
+ HandlerInfo = {Id, Pid, From},
+ ets:insert(HandlerDb, HandlerInfo),
erlang:monitor(process, Pid).
@@ -805,12 +894,14 @@ select_session(Candidates, Max) ->
{ok, HandlerPid}
end.
-pipeline_or_keep_alive(Request, HandlerPid, State) ->
+pipeline_or_keep_alive(#request{id = Id,
+ from = From} = Request,
+ HandlerPid,
+ #state{handler_db = HandlerDb} = State) ->
case (catch httpc_handler:send(Request, HandlerPid)) of
ok ->
- ets:insert(State#state.handler_db, {Request#request.id,
- HandlerPid,
- Request#request.from});
+ HandlerInfo = {Id, HandlerPid, From},
+ ets:insert(HandlerDb, HandlerInfo);
_ -> % timeout pipelining failed
start_handler(Request, State)
end.
@@ -872,6 +963,19 @@ make_db_name(ProfileName, Post) ->
list_to_atom(atom_to_list(ProfileName) ++ Post).
+%%--------------------------------------------------------------------------
+%% These functions is just simple wrappers to parse specifically HTTP URIs
+%%--------------------------------------------------------------------------
+
+scheme_defaults() ->
+ [{http, 80}, {https, 443}].
+
+uri_parse(URI, Opts) ->
+ http_uri:parse(URI, [{scheme_defaults, scheme_defaults()} | Opts]).
+
+
+%%--------------------------------------------------------------------------
+
call(ProfileName, Msg) ->
Timeout = infinity,
@@ -883,9 +987,39 @@ cast(ProfileName, Msg) ->
gen_server:cast(ProfileName, Msg).
+get_option(proxy, #options{proxy = Proxy}) ->
+ Proxy;
+get_option(https_proxy, #options{https_proxy = Proxy}) ->
+ Proxy;
+get_option(pipeline_timeout, #options{pipeline_timeout = Timeout}) ->
+ Timeout;
+get_option(max_pipeline_length, #options{max_pipeline_length = Length}) ->
+ Length;
+get_option(keep_alive_timeout, #options{keep_alive_timeout = Timeout}) ->
+ Timeout;
+get_option(max_keep_alive_length, #options{max_keep_alive_length = Length}) ->
+ Length;
+get_option(max_sessions, #options{max_sessions = MaxSessions}) ->
+ MaxSessions;
+get_option(cookies, #options{cookies = Cookies}) ->
+ Cookies;
+get_option(verbose, #options{verbose = Verbose}) ->
+ Verbose;
+get_option(ipfamily, #options{ipfamily = IpFamily}) ->
+ IpFamily;
+get_option(ip, #options{ip = IP}) ->
+ IP;
+get_option(port, #options{port = Port}) ->
+ Port;
+get_option(socket_opts, #options{socket_opts = SocketOpts}) ->
+ SocketOpts.
+
get_proxy(Opts, #options{proxy = Default}) ->
proplists:get_value(proxy, Opts, Default).
+get_https_proxy(Opts, #options{https_proxy = Default}) ->
+ proplists:get_value(https_proxy, Opts, Default).
+
get_pipeline_timeout(Opts, #options{pipeline_timeout = Default}) ->
proplists:get_value(pipeline_timeout, Opts, Default).
diff --git a/lib/inets/src/http_client/httpc_response.erl b/lib/inets/src/http_client/httpc_response.erl
index 919115a23a..04976447cc 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -342,7 +342,7 @@ redirect(Response = {StatusLine, Headers, Body}, Request) ->
RedirUrl ->
UrlParseOpts = [{ipv6_host_with_brackets,
Request#request.ipv6_host_with_brackets}],
- case http_uri:parse(RedirUrl, UrlParseOpts) of
+ case uri_parse(RedirUrl, UrlParseOpts) of
{error, no_scheme} when
(Request#request.settings)#http_options.relaxed ->
NewLocation = fix_relative_uri(Request, RedirUrl),
@@ -437,3 +437,17 @@ format_response({StatusLine, Headers, Body}) ->
end,
{{StatusLine, http_response:header_list(Headers), NewBody}, Data}.
+%%--------------------------------------------------------------------------
+%% These functions is just simple wrappers to parse specifically HTTP URIs
+%%--------------------------------------------------------------------------
+
+scheme_defaults() ->
+ [{http, 80}, {https, 443}].
+
+uri_parse(URI, Opts) ->
+ http_uri:parse(URI, [{scheme_defaults, scheme_defaults()} | Opts]).
+
+
+%%--------------------------------------------------------------------------
+
+
diff --git a/lib/inets/src/http_lib/Makefile b/lib/inets/src/http_lib/Makefile
index aaf3cfb995..51167b34fa 100644
--- a/lib/inets/src/http_lib/Makefile
+++ b/lib/inets/src/http_lib/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2010. All Rights Reserved.
+# Copyright Ericsson AB 2005-2012. 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
@@ -87,11 +87,11 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/http_lib
- $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) $(RELSYSDIR)/src/http_lib
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/http_lib"
+ $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) "$(RELSYSDIR)/src/http_lib"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/inets/src/http_lib/http_uri.erl b/lib/inets/src/http_lib/http_uri.erl
index 32c6305a79..5962001c3a 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -17,39 +17,95 @@
%% %CopyrightEnd%
%%
%%
-%% RFC 3986
+%% This is from chapter 3, Syntax Components, of RFC 3986:
+%%
+%% The generic URI syntax consists of a hierarchical sequence of
+%% components referred to as the scheme, authority, path, query, and
+%% fragment.
+%%
+%% URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
+%%
+%% hier-part = "//" authority path-abempty
+%% / path-absolute
+%% / path-rootless
+%% / path-empty
+%%
+%% The scheme and path components are required, though the path may be
+%% empty (no characters). When authority is present, the path must
+%% either be empty or begin with a slash ("/") character. When
+%% authority is not present, the path cannot begin with two slash
+%% characters ("//"). These restrictions result in five different ABNF
+%% rules for a path (Section 3.3), only one of which will match any
+%% given URI reference.
+%%
+%% The following are two example URIs and their component parts:
+%%
+%% foo://example.com:8042/over/there?name=ferret#nose
+%% \_/ \______________/\_________/ \_________/ \__/
+%% | | | | |
+%% scheme authority path query fragment
+%% | _____________________|__
+%% / \ / \
+%% urn:example:animal:ferret:nose
+%%
+%% scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
+%% authority = [ userinfo "@" ] host [ ":" port ]
+%% userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
+%%
%%
-module(http_uri).
-export([parse/1, parse/2,
+ scheme_defaults/0,
encode/1, decode/1]).
+-export_type([scheme/0, default_scheme_port_number/0]).
+
%%%=========================================================================
%%% API
%%%=========================================================================
+
+-type scheme() :: atom().
+-type default_scheme_port_number() :: pos_integer().
+
+-spec scheme_defaults() ->
+ [{scheme(), default_scheme_port_number()}].
+
+scheme_defaults() ->
+ [{http, 80},
+ {https, 443},
+ {ftp, 21},
+ {ssh, 22},
+ {sftp, 22},
+ {tftp, 69}].
+
parse(AbsURI) ->
parse(AbsURI, []).
parse(AbsURI, Opts) ->
- case parse_scheme(AbsURI) of
+ case parse_scheme(AbsURI, Opts) of
{error, Reason} ->
{error, Reason};
- {Scheme, Rest} ->
- case (catch parse_uri_rest(Scheme, Rest, Opts)) of
- {UserInfo, Host, Port, Path, Query} ->
+ {Scheme, DefaultPort, Rest} ->
+ case (catch parse_uri_rest(Scheme, DefaultPort, Rest, Opts)) of
+ {ok, {UserInfo, Host, Port, Path, Query}} ->
{ok, {Scheme, UserInfo, Host, Port, Path, Query}};
+ {error, Reason} ->
+ {error, {Reason, Scheme, AbsURI}};
_ ->
- {error, {malformed_url, AbsURI}}
+ {error, {malformed_url, Scheme, AbsURI}}
end
end.
+reserved() ->
+ sets:from_list([$;, $:, $@, $&, $=, $+, $,, $/, $?,
+ $#, $[, $], $<, $>, $\", ${, $}, $|,
+ $\\, $', $^, $%, $ ]).
+
encode(URI) ->
- Reserved = sets:from_list([$;, $:, $@, $&, $=, $+, $,, $/, $?,
- $#, $[, $], $<, $>, $\", ${, $}, $|,
- $\\, $', $^, $%, $ ]),
- %% lists:append(lists:map(fun(Char) -> uri_encode(Char, Reserved) end, URI)).
+ Reserved = reserved(),
lists:append([uri_encode(Char, Reserved) || Char <- URI]).
decode(String) ->
@@ -67,20 +123,31 @@ do_decode([]) ->
%%% Internal functions
%%%========================================================================
-parse_scheme(AbsURI) ->
+which_scheme_defaults(Opts) ->
+ Key = scheme_defaults,
+ case lists:keysearch(Key, 1, Opts) of
+ {value, {Key, SchemeDefaults}} ->
+ SchemeDefaults;
+ false ->
+ scheme_defaults()
+ end.
+
+parse_scheme(AbsURI, Opts) ->
case split_uri(AbsURI, ":", {error, no_scheme}, 1, 1) of
{error, no_scheme} ->
{error, no_scheme};
- {StrScheme, Rest} ->
- case list_to_atom(http_util:to_lower(StrScheme)) of
- Scheme when (Scheme =:= http) orelse (Scheme =:= https) ->
- {Scheme, Rest};
- Scheme ->
- {error, {not_supported_scheme, Scheme}}
+ {SchemeStr, Rest} ->
+ Scheme = list_to_atom(http_util:to_lower(SchemeStr)),
+ SchemeDefaults = which_scheme_defaults(Opts),
+ case lists:keysearch(Scheme, 1, SchemeDefaults) of
+ {value, {Scheme, DefaultPort}} ->
+ {Scheme, DefaultPort, Rest};
+ false ->
+ {Scheme, no_default_port, Rest}
end
end.
-parse_uri_rest(Scheme, "//" ++ URIPart, Opts) ->
+parse_uri_rest(Scheme, DefaultPort, "//" ++ URIPart, Opts) ->
{Authority, PathQuery} =
case split_uri(URIPart, "/", URIPart, 1, 0) of
Split = {_, _} ->
@@ -93,26 +160,25 @@ parse_uri_rest(Scheme, "//" ++ URIPart, Opts) ->
{URIPart,""}
end
end,
-
{UserInfo, HostPort} = split_uri(Authority, "@", {"", Authority}, 1, 1),
- {Host, Port} = parse_host_port(Scheme, HostPort, Opts),
+ {Host, Port} = parse_host_port(Scheme, DefaultPort, HostPort, Opts),
{Path, Query} = parse_path_query(PathQuery),
- {UserInfo, Host, Port, Path, Query}.
+ {ok, {UserInfo, Host, Port, Path, Query}}.
parse_path_query(PathQuery) ->
{Path, Query} = split_uri(PathQuery, "\\?", {PathQuery, ""}, 1, 0),
{path(Path), Query}.
-parse_host_port(Scheme,"[" ++ HostPort, Opts) -> %ipv6
- DefaultPort = default_port(Scheme),
+%% In this version of the function, we no longer need
+%% the Scheme argument, but just in case...
+parse_host_port(_Scheme, DefaultPort, "[" ++ HostPort, Opts) -> %ipv6
{Host, ColonPort} = split_uri(HostPort, "\\]", {HostPort, ""}, 1, 1),
Host2 = maybe_ipv6_host_with_brackets(Host, Opts),
{_, Port} = split_uri(ColonPort, ":", {"", DefaultPort}, 0, 1),
{Host2, int_port(Port)};
-parse_host_port(Scheme, HostPort, _Opts) ->
- DefaultPort = default_port(Scheme),
+parse_host_port(_Scheme, DefaultPort, HostPort, _Opts) ->
{Host, Port} = split_uri(HostPort, ":", {HostPort, DefaultPort}, 1, 1),
{Host, int_port(Port)}.
@@ -133,15 +199,14 @@ maybe_ipv6_host_with_brackets(Host, Opts) ->
Host
end.
-default_port(http) ->
- 80;
-default_port(https) ->
- 443.
int_port(Port) when is_integer(Port) ->
Port;
int_port(Port) when is_list(Port) ->
- list_to_integer(Port).
+ list_to_integer(Port);
+%% This is the case where no port was found and there was no default port
+int_port(no_default_port) ->
+ throw({error, no_default_port}).
path("") ->
"/";
diff --git a/lib/inets/src/http_server/Makefile b/lib/inets/src/http_server/Makefile
index 55cc68dede..67555d5f1c 100644
--- a/lib/inets/src/http_server/Makefile
+++ b/lib/inets/src/http_server/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2010. All Rights Reserved.
+# Copyright Ericsson AB 2005-2012. 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
@@ -88,6 +88,8 @@ ERL_FILES = $(MODULES:%=%.erl)
TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR))
+INETS_FLAGS = -D'SERVER_SOFTWARE="$(APPLICATION)/$(VSN)"'
+
# ----------------------------------------------------
# FLAGS
@@ -121,11 +123,11 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/http_server
- $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) $(RELSYSDIR)/src/http_server
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/http_server"
+ $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) "$(RELSYSDIR)/src/http_server"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/inets/src/http_server/httpd_conf.erl b/lib/inets/src/http_server/httpd_conf.erl
index 7646300409..747118431e 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -210,12 +210,32 @@ load("MaxBodySize " ++ MaxBodySize, []) ->
{ok, Integer} ->
{ok, [], {max_body_size,Integer}};
{error, _} ->
- {error, ?NICE(clean(MaxBodySize)++
+ {error, ?NICE(clean(MaxBodySize) ++
" is an invalid number of MaxBodySize")}
end;
load("ServerName " ++ ServerName, []) ->
- {ok,[],{server_name,clean(ServerName)}};
+ {ok,[], {server_name, clean(ServerName)}};
+
+load("ServerTokens " ++ ServerTokens, []) ->
+ %% These are the valid *plain* server tokens:
+ %% sprod, major, minor, minimum, os, full
+ %% It can also be a "private" server token: private:<any string>
+ case string:tokens(ServerTokens, [$:]) of
+ ["private", Private] ->
+ {ok,[], {server_tokens, clean(Private)}};
+ [TokStr] ->
+ Tok = list_to_atom(clean(TokStr)),
+ case lists:member(Tok, [prod, major, minor, minimum, os, full]) of
+ true ->
+ {ok,[], {server_tokens, Tok}};
+ false ->
+ {error, ?NICE(clean(ServerTokens) ++
+ " is an invalid ServerTokens")}
+ end;
+ _ ->
+ {error, ?NICE(clean(ServerTokens) ++ " is an invalid ServerTokens")}
+ end;
load("SocketType " ++ SocketType, []) ->
%% ssl is the same as HTTP_DEFAULT_SSL_KIND
@@ -475,7 +495,7 @@ validate_properties(Properties) ->
validate_properties2(Properties) ->
case proplists:get_value(bind_address, Properties) of
undefined ->
- case proplists:get_value(sock_type, Properties, ip_comm) of
+ case proplists:get_value(sock_type, Properties, ip_comm) of
ip_comm ->
case proplists:get_value(ipfamily, Properties) of
undefined ->
@@ -537,6 +557,20 @@ validate_config_params([{server_name, Value} | Rest])
validate_config_params([{server_name, Value} | _]) ->
throw({server_name, Value});
+validate_config_params([{server_tokens, Value} | Rest])
+ when is_atom(Value) ->
+ case lists:member(Value, plain_server_tokens()) of
+ true ->
+ validate_config_params(Rest);
+ false ->
+ throw({server_tokens, Value})
+ end;
+validate_config_params([{server_tokens, {private, Value}} | Rest])
+ when is_list(Value) ->
+ validate_config_params(Rest);
+validate_config_params([{server_tokens, Value} | _]) ->
+ throw({server_tokens, Value});
+
validate_config_params([{socket_type, Value} | Rest])
when (Value =:= ip_comm) orelse
(Value =:= ssl) orelse
@@ -737,9 +771,71 @@ store({log_format, LogFormat}, _ConfigList)
store({log_format, LogFormat}, _ConfigList)
when (LogFormat =:= compact) orelse (LogFormat =:= pretty) ->
{ok, {log_format, LogFormat}};
+store({server_tokens, ServerTokens} = Entry, _ConfigList) ->
+ Server = server(ServerTokens),
+ {ok, [Entry, {server, Server}]};
store(ConfigListEntry, _ConfigList) ->
{ok, ConfigListEntry}.
+
+%% The SERVER_SOFTWARE macro has the following structure:
+%% <product>/<version>
+%% Example: "inets/1.2.3"
+%% So, with this example (on a linux machine, with OTP R15B),
+%% this will result in:
+%% prod: "inets"
+%% major: "inets/1"
+%% minor: "inets/1.2"
+%% minimal: "inets/1.2.3"
+%% os: "inets/1.2.3 (unix)
+%% full: "inets/1.2.3 (unix/linux) OTP/R15B"
+%% Note that the format of SERVER_SOFTWARE is that of 'minimal'.
+%% Also, there will always be atleast two digits in a version:
+%% Not just 1 but 1.0
+%%
+%% We have already checked that the value is valid,
+%% so there is no need to check enything here.
+%%
+server(prod = _ServerTokens) ->
+ [Prod|_Version] = string:tokens(?SERVER_SOFTWARE, [$/]),
+ Prod;
+server(major = _ServerTokens) ->
+ [Prod|Version] = string:tokens(?SERVER_SOFTWARE, [$/]),
+ [Major|_] = string:tokens(Version, [$.]),
+ Prod ++ "/" ++ Major;
+server(minor = _ServerTokens) ->
+ [Prod|Version] = string:tokens(?SERVER_SOFTWARE, [$/]),
+ [Major,Minor|_] = string:tokens(Version, [$.]),
+ Prod ++ "/" ++ Major ++ "." ++ Minor;
+server(minimal = _ServerTokens) ->
+ %% This is the default
+ ?SERVER_SOFTWARE;
+server(os = _ServerTokens) ->
+ OS = os_info(partial),
+ lists:flatten(io_lib:format("~s ~s", [?SERVER_SOFTWARE, OS]));
+server(full = _ServerTokens) ->
+ OTPRelease = otp_release(),
+ OS = os_info(full),
+ lists:flatten(
+ io_lib:format("~s ~s OTP/~s", [?SERVER_SOFTWARE, OS, OTPRelease]));
+server({private, Server} = _ServerTokens) when is_list(Server) ->
+ %% The user provide its own
+ Server;
+server(_) ->
+ ?SERVER_SOFTWARE.
+
+os_info(Info) ->
+ case os:type() of
+ {OsFamily, _OsName} when Info =:= partial ->
+ lists:flatten(io_lib:format("(~w)", [OsFamily]));
+ {OsFamily, OsName} ->
+ lists:flatten(io_lib:format("(~w/~w)", [OsFamily, OsName]))
+ end.
+
+otp_release() ->
+ erlang:system_info(otp_release).
+
+
%% Phase 3: Remove
remove_all(ConfigDB) ->
Modules = httpd_util:lookup(ConfigDB,modules,[]),
@@ -1159,6 +1255,10 @@ ssl_ca_certificate_file(ConfigDB) ->
[{cacertfile, File}]
end.
+plain_server_tokens() ->
+ [prod, major, minor, minimum, os, full].
+
error_report(Where,M,F,Error) ->
error_logger:error_report([{?MODULE, Where},
{apply, {M, F, []}}, Error]).
+
diff --git a/lib/inets/src/http_server/httpd_log.erl b/lib/inets/src/http_server/httpd_log.erl
index 60ab326a20..a34435e0e8 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -36,8 +36,8 @@
AuthUser :: string(),
Date :: string(),
StatusCode :: pos_integer(),
- Size :: pos_integer() | string()) ->
- {Log :: atom() | pid(), Entry :: string()}.
+ Size :: 0 | pos_integer() | string()) ->
+ {Log :: atom() | pid(), Entry :: string()} | term() .
access_entry(Log, NoLog, Info, RFC931, AuthUser, Date, StatusCode, SizeStr)
when is_list(SizeStr) ->
@@ -69,7 +69,7 @@ access_entry(Log, NoLog,
Info :: #mod{},
Date :: string(),
Reason :: term()) ->
- {Log :: atom() | pid(), Entry :: string()}.
+ {Log :: atom() | pid(), Entry :: string()} | term().
error_entry(Log, NoLog,
#mod{config_db = ConfigDB,
@@ -87,7 +87,7 @@ error_entry(Log, NoLog,
ConfigDB :: term(),
Date :: string(),
ErrroStr :: string()) ->
- {Log :: atom() | pid(), Entry :: string()}.
+ {Log :: atom() | pid(), Entry :: string()} | term().
error_report_entry(Log, NoLog, ConfigDb, Date, ErrorStr) ->
MakeEntry = fun() -> io_lib:format("[~s], ~s~n", [Date, ErrorStr]) end,
@@ -99,7 +99,7 @@ error_report_entry(Log, NoLog, ConfigDb, Date, ErrorStr) ->
ConfigDB :: term(),
Date :: string(),
Reason :: term()) ->
- {Log :: atom() | pid(), Entry :: string()}.
+ {Log :: atom() | pid(), Entry :: string()} | term().
security_entry(Log, NoLog, #mod{config_db = ConfigDB}, Date, Reason) ->
MakeEntry = fun() -> io_lib:format("[~s] ~s~n", [Date, Reason]) end,
diff --git a/lib/inets/src/http_server/httpd_response.erl b/lib/inets/src/http_server/httpd_response.erl
index dd7223876e..2dedb088e4 100644
--- a/lib/inets/src/http_server/httpd_response.erl
+++ b/lib/inets/src/http_server/httpd_response.erl
@@ -144,10 +144,14 @@ send_response(ModData, Header, Body) ->
end
end.
-send_header(#mod{socket_type = Type, socket = Sock,
- http_version = Ver, connection = Conn} = _ModData,
+send_header(#mod{socket_type = Type,
+ socket = Sock,
+ http_version = Ver,
+ connection = Conn,
+ config_db = ConfigDb} = _ModData,
StatusCode, KeyValueTupleHeaders) ->
- Headers = create_header(lists:map(fun transform/1, KeyValueTupleHeaders)),
+ Headers = create_header(ConfigDb,
+ lists:map(fun transform/1, KeyValueTupleHeaders)),
NewVer = case {Ver, StatusCode} of
{[], _} ->
%% May be implicit!
@@ -275,13 +279,20 @@ cache_headers(#mod{config_db = Db}) ->
[]
end.
-create_header(KeyValueTupleHeaders) ->
- NewHeaders = add_default_headers([{"date", httpd_util:rfc1123_date()},
- {"content-type", "text/html"},
- {"server", ?SERVER_SOFTWARE}],
- KeyValueTupleHeaders),
+create_header(ConfigDb, KeyValueTupleHeaders) ->
+ Date = httpd_util:rfc1123_date(),
+ ContentType = "text/html",
+ Server = server(ConfigDb),
+ NewHeaders = add_default_headers([{"date", Date},
+ {"content-type", ContentType},
+ {"server", Server}],
+ KeyValueTupleHeaders),
lists:map(fun fix_header/1, NewHeaders).
+
+server(ConfigDb) ->
+ httpd_util:lookup(ConfigDb, server, ?SERVER_SOFTWARE).
+
fix_header({Key0, Value}) ->
%% make sure first letter is capital
Words1 = string:tokens(Key0, "-"),
diff --git a/lib/inets/src/http_server/httpd_script_env.erl b/lib/inets/src/http_server/httpd_script_env.erl
index d3115150b0..ac79a8cc63 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -50,29 +50,44 @@ create_env(ScriptType, ModData, ScriptElements) ->
%%%========================================================================
%%% Internal functions
%%%========================================================================
+
+which_server(#mod{config_db = ConfigDb}) ->
+ httpd_util:lookup(ConfigDb, server, ?SERVER_SOFTWARE).
+
+which_port(#mod{config_db = ConfigDb}) ->
+ httpd_util:lookup(ConfigDb, port, 80).
+
+which_peername(#mod{init_data = #init_data{peername = {_, RemoteAddr}}}) ->
+ RemoteAddr.
+
+which_resolve(#mod{init_data = #init_data{resolve = Resolve}}) ->
+ Resolve.
+
+which_method(#mod{method = Method}) ->
+ Method.
+
+which_request_uri(#mod{request_uri = RUri}) ->
+ RUri.
+
create_basic_elements(esi, ModData) ->
- {_, RemoteAddr} = (ModData#mod.init_data)#init_data.peername,
- [{server_software, ?SERVER_SOFTWARE},
- {server_name, (ModData#mod.init_data)#init_data.resolve},
- {gateway_interface,?GATEWAY_INTERFACE},
- {server_protocol, ?SERVER_PROTOCOL},
- {server_port, httpd_util:lookup(ModData#mod.config_db,port,80)},
- {request_method, ModData#mod.method},
- {remote_addr, RemoteAddr},
- {script_name, ModData#mod.request_uri}];
+ [{server_software, which_server(ModData)},
+ {server_name, which_resolve(ModData)},
+ {gateway_interface, ?GATEWAY_INTERFACE},
+ {server_protocol, ?SERVER_PROTOCOL},
+ {server_port, which_port(ModData)},
+ {request_method, which_method(ModData)},
+ {remote_addr, which_peername(ModData)},
+ {script_name, which_request_uri(ModData)}];
create_basic_elements(cgi, ModData) ->
- {_, RemoteAddr} = (ModData#mod.init_data)#init_data.peername,
- [{"SERVER_SOFTWARE",?SERVER_SOFTWARE},
- {"SERVER_NAME", (ModData#mod.init_data)#init_data.resolve},
- {"GATEWAY_INTERFACE",?GATEWAY_INTERFACE},
- {"SERVER_PROTOCOL",?SERVER_PROTOCOL},
- {"SERVER_PORT",
- integer_to_list(httpd_util:lookup(
- ModData#mod.config_db, port, 80))},
- {"REQUEST_METHOD", ModData#mod.method},
- {"REMOTE_ADDR", RemoteAddr},
- {"SCRIPT_NAME", ModData#mod.request_uri}].
+ [{"SERVER_SOFTWARE", which_server(ModData)},
+ {"SERVER_NAME", which_resolve(ModData)},
+ {"GATEWAY_INTERFACE", ?GATEWAY_INTERFACE},
+ {"SERVER_PROTOCOL", ?SERVER_PROTOCOL},
+ {"SERVER_PORT", integer_to_list(which_port(ModData))},
+ {"REQUEST_METHOD", which_method(ModData)},
+ {"REMOTE_ADDR", which_peername(ModData)},
+ {"SCRIPT_NAME", which_request_uri(ModData)}].
create_http_header_elements(ScriptType, Headers) ->
create_http_header_elements(ScriptType, Headers, []).
@@ -80,7 +95,7 @@ create_http_header_elements(ScriptType, Headers) ->
create_http_header_elements(_, [], Acc) ->
Acc;
create_http_header_elements(ScriptType, [{Name, [Value | _] = Values } |
- Headers], Acc)
+ Headers], Acc)
when is_list(Value) ->
NewName = lists:map(fun(X) -> if X == $- -> $_; true -> X end end, Name),
Element = http_env_element(ScriptType, NewName, multi_value(Values)),
diff --git a/lib/inets/src/http_server/httpd_sup.erl b/lib/inets/src/http_server/httpd_sup.erl
index 264dc9f006..8f3e8f9500 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -162,17 +162,30 @@ httpd_config([Value| _] = Config) when is_tuple(Value) ->
httpd_child_spec([Value| _] = Config, AcceptTimeout, Debug)
when is_tuple(Value) ->
+ ?hdrt("httpd_child_spec - entry", [{accept_timeout, AcceptTimeout},
+ {debug, Debug}]),
Address = proplists:get_value(bind_address, Config, any),
Port = proplists:get_value(port, Config, 80),
httpd_child_spec(Config, AcceptTimeout, Debug, Address, Port);
-httpd_child_spec(ConfigFile, AcceptTimeout, Debug) ->
+%% In this case the AcceptTimeout and Debug will only have default values...
+httpd_child_spec(ConfigFile, AcceptTimeoutDef, DebugDef) ->
+ ?hdrt("httpd_child_spec - entry", [{config_file, ConfigFile},
+ {accept_timeout_def, AcceptTimeoutDef},
+ {debug_def, DebugDef}]),
case httpd_conf:load(ConfigFile) of
{ok, ConfigList} ->
+ ?hdrt("httpd_child_spec - loaded", [{config_list, ConfigList}]),
case (catch httpd_conf:validate_properties(ConfigList)) of
{ok, Config} ->
+ ?hdrt("httpd_child_spec - validated", [{config, Config}]),
Address = proplists:get_value(bind_address, Config, any),
Port = proplists:get_value(port, Config, 80),
+ AcceptTimeout =
+ proplists:get_value(accept_timeout, Config,
+ AcceptTimeoutDef),
+ Debug =
+ proplists:get_value(debug, Config, DebugDef),
httpd_child_spec([{file, ConfigFile} | Config],
AcceptTimeout, Debug, Address, Port);
Error ->
@@ -183,7 +196,7 @@ httpd_child_spec(ConfigFile, AcceptTimeout, Debug) ->
end.
httpd_child_spec(Config, AcceptTimeout, Debug, Addr, Port) ->
- case Port == 0 orelse proplists:is_defined(fd, Config) of
+ case (Port =:= 0) orelse proplists:is_defined(fd, Config) of
true ->
httpd_child_spec_listen(Config, AcceptTimeout, Debug, Addr, Port);
false ->
diff --git a/lib/inets/src/http_server/mod_get.erl b/lib/inets/src/http_server/mod_get.erl
index 5cb30e3d97..758985f330 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -18,9 +18,16 @@
%%
%%
-module(mod_get).
+
-export([do/1]).
+
-include("httpd.hrl").
-include("httpd_internal.hrl").
+-include("inets_internal.hrl").
+
+-define(VMODULE,"GET").
+
+
%% do
do(Info) ->
@@ -84,15 +91,16 @@ send_response(_Socket, _SocketType, Path, Info)->
file:close(FileDescriptor),
{proceed,[{response,{already_sent,200,
FileInfo#file_info.size}},
- {mime_type,MimeType}|Info#mod.data]};
+ {mime_type,MimeType} | Info#mod.data]};
{error, Reason} ->
+ ?hdrt("send_response -> failed open file",
+ [{path, Path}, {reason, Reason}]),
Status = httpd_file:handle_error(Reason, "open", Info, Path),
- {proceed,
- [{status, Status}| Info#mod.data]}
+ {proceed, [{status, Status} | Info#mod.data]}
end.
%% send
-
+
send(#mod{socket = Socket, socket_type = SocketType} = Info,
StatusCode, Headers, FileDescriptor) ->
?DEBUG("send -> send header",[]),
diff --git a/lib/inets/src/inets_app/Makefile b/lib/inets/src/inets_app/Makefile
index d99e33b4ea..7d68145287 100644
--- a/lib/inets/src/inets_app/Makefile
+++ b/lib/inets/src/inets_app/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2011. All Rights Reserved.
+# Copyright Ericsson AB 2005-2012. 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
@@ -46,7 +46,8 @@ MODULES = \
inets_service \
inets_app \
inets_sup \
- inets_regexp
+ inets_regexp \
+ inets_trace
INTERNAL_HRL_FILES = inets_internal.hrl
EXTERNAL_HRL_FILES = ../../include/httpd.hrl \
@@ -110,13 +111,13 @@ $(APPUP_TARGET): $(APPUP_SRC) ../../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/inets_app
- $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(ERL_FILES) $(RELSYSDIR)/src/inets_app
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(EXTERNAL_HRL_FILES) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/inets_app"
+ $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(ERL_FILES) "$(RELSYSDIR)/src/inets_app"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(EXTERNAL_HRL_FILES) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/inets/src/inets_app/inets.app.src b/lib/inets/src/inets_app/inets.app.src
index 1db7ed2c30..4aea2ef3d7 100644
--- a/lib/inets/src/inets_app/inets.app.src
+++ b/lib/inets/src/inets_app/inets.app.src
@@ -18,14 +18,15 @@
%%
{application,inets,
- [{description,"INETS CXC 138 49"},
- {vsn,"%VSN%"},
+ [{description, "INETS CXC 138 49"},
+ {vsn, "%VSN%"},
{modules,[
inets,
inets_sup,
inets_app,
inets_service,
inets_regexp,
+ inets_trace,
%% FTP
ftp,
diff --git a/lib/inets/src/inets_app/inets.appup.src b/lib/inets/src/inets_app/inets.appup.src
index e80cb2a23b..2adb2a0fc8 100644
--- a/lib/inets/src/inets_app/inets.appup.src
+++ b/lib/inets/src/inets_app/inets.appup.src
@@ -18,62 +18,92 @@
{"%VSN%",
[
- {"5.8",
+ {"5.9",
[
- {load_module, ftp, soft_purge, soft_purge, []},
- {update, httpc_handler, {advanced, upgrade_from_pre_5_8_1},
- soft_purge, soft_purge, []},
- {update, httpc_manager, {advanced, upgrade_from_pre_5_8_1},
- soft_purge, soft_purge, [httpc_handler]}
+ {load_module, tftp, soft_purge, soft_purge, [inets_service]},
+ {load_module, inets_service, soft_purge, soft_purge, []},
+ {load_module, httpc, soft_purge, soft_purge, [httpc_manager]},
+ {update, httpc_handler, soft, soft_purge, soft_purge, [httpc_manager]},
+ {update, httpc_manager, soft, soft_purge, soft_purge, []}
]
},
- {"5.7.2",
+ {"5.8.1",
[
- {restart_application, inets}
- ]
- },
- {"5.7.1",
- [
- {restart_application, inets}
+ {load_module, tftp, soft_purge, soft_purge, [inets_service]},
+ {load_module, inets_service, soft_purge, soft_purge, []},
+
+ {load_module, http_uri, soft_purge, soft_purge, []},
+ {load_module, httpc_response, soft_purge, soft_purge, [http_uri]},
+
+ {load_module, httpc, soft_purge, soft_purge,
+ [http_uri, httpc_manager]},
+
+ {load_module, inets_app, soft_purge, soft_purge, [inets_sup]},
+ {update, inets_sup, soft, soft_purge, soft_purge, []},
+
+ {load_module, httpd_conf, soft_purge, soft_purge, []},
+ {load_module, httpd_response, soft_purge, soft_purge, []},
+ {load_module, httpd_script_env, soft_purge, soft_purge, []},
+
+ {load_module, inets, soft_purge, soft_purge, [inets_trace]},
+ {update, httpc_manager, soft, soft_purge, soft_purge, [http_uri]},
+ {update, httpc_handler, soft, soft_purge, soft_purge, [httpc_manager]},
+ {update, httpd_sup, soft, soft_purge, soft_purge, []},
+ {add_module, inets_trace}
]
},
- {"5.7",
+ {"5.8",
[
{restart_application, inets}
]
},
- {"5.6",
+ {"5.7.2",
[
{restart_application, inets}
]
- }
+ }
],
[
- {"5.8",
+ {"5.9",
[
- {load_module, ftp, soft_purge, soft_purge, []},
- {update, httpc_handler, {advanced, upgrade_from_pre_5_8_1},
- soft_purge, soft_purge, []},
- {update, httpc_manager, {advanced, upgrade_from_pre_5_8_1},
- soft_purge, soft_purge, [httpc_handler]}
+ {load_module, tftp, soft_purge, soft_purge, [inets_service]},
+ {load_module, inets_service, soft_purge, soft_purge, []},
+ {load_module, httpc, soft_purge, soft_purge, [httpc_manager]},
+ {update, httpc_handler, soft, soft_purge, soft_purge, [httpc_manager]},
+ {update, httpc_manager, soft, soft_purge, soft_purge, []}
]
},
- {"5.7.2",
+ {"5.8.1",
[
- {restart_application, inets}
- ]
- },
- {"5.7.1",
- [
- {restart_application, inets}
+ {load_module, tftp, soft_purge, soft_purge, [inets_service]},
+ {load_module, inets_service, soft_purge, soft_purge, []},
+
+ {load_module, http_uri, soft_purge, soft_purge, []},
+ {load_module, httpc_response, soft_purge, soft_purge, [http_uri]},
+
+ {load_module, httpc, soft_purge, soft_purge,
+ [http_uri, httpc_manager]},
+
+ {load_module, inets_app, soft_purge, soft_purge, [inets_sup]},
+ {update, inets_sup, soft, soft_purge, soft_purge, []},
+
+ {load_module, httpd_conf, soft_purge, soft_purge, []},
+ {load_module, httpd_response, soft_purge, soft_purge, []},
+ {load_module, httpd_script_env, soft_purge, soft_purge, []},
+
+ {load_module, inets, soft_purge, soft_purge, []},
+ {update, httpc_manager, soft, soft_purge, soft_purge, [http_uri]},
+ {update, httpc_handler, soft, soft_purge, soft_purge, [httpc_manager]},
+ {update, httpd_sup, soft, soft_purge, soft_purge, []},
+ {remove, {inets_trace, soft_purge, brutal_purge}}
]
},
- {"5.7",
+ {"5.8",
[
{restart_application, inets}
]
},
- {"5.6",
+ {"5.7.2",
[
{restart_application, inets}
]
diff --git a/lib/inets/src/inets_app/inets.erl b/lib/inets/src/inets_app/inets.erl
index 054468e445..ed8082534f 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -28,7 +28,7 @@
stop/0, stop/2,
services/0, services_info/0,
service_names/0]).
--export([enable_trace/2, enable_trace/3, disable_trace/0, set_trace/1,
+-export([enable_trace/2, enable_trace/3, disable_trace/0, set_trace/1,
report_event/4]).
-export([versions/0,
print_version_info/0, print_version_info/1]).
@@ -274,13 +274,8 @@ sys_info() ->
os_info() ->
V = os:version(),
- case os:type() of
- {OsFam, OsName} ->
- [{fam, OsFam}, {name, OsName}, {ver, V}];
- OsFam ->
- [{fam, OsFam}, {ver, V}]
- end.
-
+ {OsFam, OsName} = os:type(),
+ [{fam, OsFam}, {name, OsName}, {ver, V}].
print_mods_info(Versions) ->
case key1search(mod_info, Versions) of
@@ -409,47 +404,8 @@ service_names() ->
%% Severity withing Limit) will be written to stdout using io:format.
%%
%%-----------------------------------------------------------------
-enable_trace(Level, Dest) ->
- enable_trace(Level, Dest, all).
-
-enable_trace(Level, Dest, Service) ->
- case valid_trace_service(Service) of
- true ->
- enable_trace2(Level, Dest, Service);
- false ->
- {error, {invalid_service, Service}}
- end.
-
-enable_trace2(Level, File, Service)
- when is_list(File) ->
- case file:open(File, [write]) of
- {ok, Fd} ->
- HandleSpec = {fun handle_trace/2, {Service, Fd}},
- do_enable_trace(Level, process, HandleSpec);
- Err ->
- Err
- end;
-enable_trace2(Level, Port, _) when is_integer(Port) ->
- do_enable_trace(Level, port, dbg:trace_port(ip, Port));
-enable_trace2(Level, io, Service) ->
- HandleSpec = {fun handle_trace/2, {Service, standard_io}},
- do_enable_trace(Level, process, HandleSpec);
-enable_trace2(Level, {Fun, _Data} = HandleSpec, _) when is_function(Fun) ->
- do_enable_trace(Level, process, HandleSpec).
-
-do_enable_trace(Level, Type, HandleSpec) ->
- case dbg:tracer(Type, HandleSpec) of
- {ok, _} ->
- set_trace(Level),
- ok;
- Error ->
- Error
- end.
-
-valid_trace_service(all) ->
- true;
-valid_trace_service(Service) ->
- lists:member(Service, [httpc, httpd, ftpc, tftp]).
+enable_trace(Level, Dest) -> inets_trace:enable(Level, Dest).
+enable_trace(Level, Dest, Service) -> inets_trace:enable(Level, Dest, Service).
%%-----------------------------------------------------------------
@@ -458,12 +414,7 @@ valid_trace_service(Service) ->
%% Description:
%% This function is used to stop tracing.
%%-----------------------------------------------------------------
-disable_trace() ->
- %% This is to make handle_trace/2 close the output file (if the
- %% event gets there before dbg closes)
- inets:report_event(100, "stop trace", stop_trace, [stop_trace]),
- dbg:stop().
-
+disable_trace() -> inets_trace:disable().
%%-----------------------------------------------------------------
@@ -476,60 +427,7 @@ disable_trace() ->
%% This function is used to change the trace level when tracing has
%% already been started.
%%-----------------------------------------------------------------
-set_trace(Level) ->
- set_trace(Level, all).
-
-set_trace(Level, Service) ->
- Pat = make_pattern(?MODULE, Service, Level),
- change_pattern(Pat).
-
-make_pattern(Mod, Service, Level)
- when is_atom(Mod) andalso is_atom(Service) ->
- case Level of
- min ->
- {Mod, Service, []};
- max ->
- Head = ['$1', '_', '_', '_'],
- Body = [],
- Cond = [],
- {Mod, Service, [{Head, Cond, Body}]};
- DetailLevel when is_integer(DetailLevel) ->
- Head = ['$1', '_', '_', '_'],
- Body = [],
- Cond = [{ '=<', '$1', DetailLevel}],
- {Mod, Service, [{Head, Cond, Body}]};
- _ ->
- exit({bad_level, Level})
- end.
-
-change_pattern({Mod, Service, Pattern})
- when is_atom(Mod) andalso is_atom(Service) ->
- MFA = {Mod, report_event, 4},
- case Pattern of
- [] ->
- try
- error_to_exit(ctp, dbg:ctp(MFA)),
- error_to_exit(p, dbg:p(all, clear))
- catch
- exit:{Where, Reason} ->
- {error, {Where, Reason}}
- end;
- List when is_list(List) ->
- try
- error_to_exit(ctp, dbg:ctp(MFA)),
- error_to_exit(tp, dbg:tp(MFA, Pattern)),
- error_to_exit(p, dbg:p(all, [call, timestamp]))
- catch
- exit:{Where, Reason} ->
- {error, {Where, Reason}}
- end
- end,
- ok.
-
-error_to_exit(_Where, {ok, _} = OK) ->
- OK;
-error_to_exit(Where, {error, Reason}) ->
- exit({Where, Reason}).
+set_trace(Level) -> inets_trace:set_level(Level).
%%-----------------------------------------------------------------
@@ -546,164 +444,8 @@ error_to_exit(Where, {error, Reason}) ->
%% put trace on this function.
%%-----------------------------------------------------------------
-report_event(Severity, Label, Service, Content)
- when (is_integer(Severity) andalso
- (Severity >= 0) andalso (100 >= Severity)) andalso
- is_list(Label) andalso
- is_atom(Service) andalso
- is_list(Content) ->
- hopefully_traced.
-
-
-%% ----------------------------------------------------------------------
-%% handle_trace(Event, Fd) -> Verbosity
-%%
-%% Parameters:
-%% Event -> The trace event (only megaco 'trace_ts' events are printed)
-%% Fd -> standard_io | file_descriptor() | trace_port()
-%%
-%% Description:
-%% This function is used to "receive" and print the trace events.
-%% Events are printed if:
-%% - Verbosity is max
-%% - Severity is =< Verbosity (e.g. Severity = 30, and Verbosity = 40)
-%% Events are not printed if:
-%% - Verbosity is min
-%% - Severity is > Verbosity
-%%-----------------------------------------------------------------
-
-handle_trace(_, closed_file = Fd) ->
- Fd;
-handle_trace({trace_ts, _Who, call,
- {?MODULE, report_event,
- [_Sev, "stop trace", stop_trace, [stop_trace]]},
- Timestamp},
- {_, standard_io} = Fd) ->
- (catch io:format(standard_io, "stop trace at ~s~n", [format_timestamp(Timestamp)])),
- Fd;
-handle_trace({trace_ts, _Who, call,
- {?MODULE, report_event,
- [_Sev, "stop trace", stop_trace, [stop_trace]]},
- Timestamp},
- standard_io = Fd) ->
- (catch io:format(Fd, "stop trace at ~s~n", [format_timestamp(Timestamp)])),
- Fd;
-handle_trace({trace_ts, _Who, call,
- {?MODULE, report_event,
- [_Sev, "stop trace", stop_trace, [stop_trace]]},
- Timestamp},
- {_Service, Fd}) ->
- (catch io:format(Fd, "stop trace at ~s~n", [format_timestamp(Timestamp)])),
- (catch file:close(Fd)),
- closed_file;
-handle_trace({trace_ts, _Who, call,
- {?MODULE, report_event,
- [_Sev, "stop trace", stop_trace, [stop_trace]]},
- Timestamp},
- Fd) ->
- (catch io:format(Fd, "stop trace at ~s~n", [format_timestamp(Timestamp)])),
- (catch file:close(Fd)),
- closed_file;
-handle_trace({trace_ts, Who, call,
- {?MODULE, report_event,
- [Sev, Label, Service, Content]}, Timestamp},
- Fd) ->
- (catch print_inets_trace(Fd, Sev, Timestamp, Who,
- Label, Service, Content)),
- Fd;
-handle_trace(Event, Fd) ->
- (catch print_trace(Fd, Event)),
- Fd.
-
-
-print_inets_trace({Service, Fd},
- Sev, Timestamp, Who, Label, Service, Content) ->
- do_print_inets_trace(Fd, Sev, Timestamp, Who, Label, Service, Content);
-print_inets_trace({ServiceA, Fd},
- Sev, Timestamp, Who, Label, ServiceB, Content)
- when (ServiceA =:= all) ->
- do_print_inets_trace(Fd, Sev, Timestamp, Who, Label, ServiceB, Content);
-print_inets_trace({ServiceA, _Fd},
- _Sev, _Timestamp, _Who, _Label, ServiceB, _Content)
- when ServiceA =/= ServiceB ->
- ok;
-print_inets_trace(Fd, Sev, Timestamp, Who, Label, Service, Content) ->
- do_print_inets_trace(Fd, Sev, Timestamp, Who, Label, Service, Content).
-
-do_print_inets_trace(Fd, Sev, Timestamp, Who, Label, Service, Content) ->
- Ts = format_timestamp(Timestamp),
- io:format(Fd, "[inets ~w trace ~w ~w ~s] ~s "
- "~n Content: ~p"
- "~n",
- [Service, Sev, Who, Ts, Label, Content]).
-
-print_trace({_, Fd}, Event) ->
- do_print_trace(Fd, Event);
-print_trace(Fd, Event) ->
- do_print_trace(Fd, Event).
-
-do_print_trace(Fd, {trace, Who, What, Where}) ->
- io:format(Fd, "[trace]"
- "~n Who: ~p"
- "~n What: ~p"
- "~n Where: ~p"
- "~n", [Who, What, Where]);
-
-do_print_trace(Fd, {trace, Who, What, Where, Extra}) ->
- io:format(Fd, "[trace]"
- "~n Who: ~p"
- "~n What: ~p"
- "~n Where: ~p"
- "~n Extra: ~p"
- "~n", [Who, What, Where, Extra]);
-
-do_print_trace(Fd, {trace_ts, Who, What, Where, When}) ->
- Ts = format_timestamp(When),
- io:format(Fd, "[trace ~s]"
- "~n Who: ~p"
- "~n What: ~p"
- "~n Where: ~p"
- "~n", [Ts, Who, What, Where]);
-
-do_print_trace(Fd, {trace_ts, Who, What, Where, Extra, When}) ->
- Ts = format_timestamp(When),
- io:format(Fd, "[trace ~s]"
- "~n Who: ~p"
- "~n What: ~p"
- "~n Where: ~p"
- "~n Extra: ~p"
- "~n", [Ts, Who, What, Where, Extra]);
-
-do_print_trace(Fd, {seq_trace, What, Where}) ->
- io:format(Fd, "[seq trace]"
- "~n What: ~p"
- "~n Where: ~p"
- "~n", [What, Where]);
-
-do_print_trace(Fd, {seq_trace, What, Where, When}) ->
- Ts = format_timestamp(When),
- io:format(Fd, "[seq trace ~s]"
- "~n What: ~p"
- "~n Where: ~p"
- "~n", [Ts, What, Where]);
-
-do_print_trace(Fd, {drop, Num}) ->
- io:format(Fd, "[drop trace] ~p~n", [Num]);
-
-do_print_trace(Fd, Trace) ->
- io:format(Fd, "[trace] "
- "~n ~p"
- "~n", [Trace]).
-
-
-format_timestamp({_N1, _N2, N3} = Now) ->
- {Date, Time} = calendar:now_to_datetime(Now),
- {YYYY,MM,DD} = Date,
- {Hour,Min,Sec} = Time,
- FormatDate =
- io_lib:format("~.4w:~.2.0w:~.2.0w ~.2.0w:~.2.0w:~.2.0w 4~w",
- [YYYY,MM,DD,Hour,Min,Sec,round(N3/1000)]),
- lists:flatten(FormatDate).
+report_event(Severity, Label, Service, Content) ->
+ inets_trace:report_event(Severity, Label, Service, Content).
%%--------------------------------------------------------------------
diff --git a/lib/inets/src/inets_app/inets.mk b/lib/inets/src/inets_app/inets.mk
index 194b4ca2b1..adef32dc19 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-2011. All Rights Reserved.
+# Copyright Ericsson AB 2010-2012. 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
@@ -33,16 +33,10 @@ ifeq ($(WARN_UNUSED_WARS), true)
ERL_COMPILE_FLAGS += +warn_unused_vars
endif
-ifeq ($(shell erl -noshell -eval 'io:format("~4s", [erlang:system_info(otp_release)])' -s init stop), R14B)
-INETS_ERL_COMPILE_FLAGS += -D'OTP-R14B-COMPILER'
-endif
-
INETS_APP_VSN_COMPILE_FLAGS = \
+'{parse_transform,sys_pre_attributes}' \
+'{attribute,insert,app_vsn,$(APP_VSN)}'
-INETS_FLAGS = -D'SERVER_SOFTWARE="$(APPLICATION)/$(VSN)"'
-
INETS_ERL_COMPILE_FLAGS += \
-pa $(ERL_TOP)/lib/inets/ebin \
$(INETS_APP_VSN_COMPILE_FLAGS)
diff --git a/lib/inets/src/inets_app/inets_app.erl b/lib/inets/src/inets_app/inets_app.erl
index cae79a6767..ee3359c4c3 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -24,7 +24,7 @@
-export([start/2, stop/1]).
start(_Type, _State) ->
- supervisor:start_link({local, inets_sup}, inets_sup, []).
+ inets_sup:start_link().
stop(_State) ->
ok.
diff --git a/lib/inets/src/inets_app/inets_internal.hrl b/lib/inets/src/inets_app/inets_internal.hrl
index 55c3669e4a..e56af3b59d 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2011. 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
@@ -24,8 +24,8 @@
%% Various trace macros
-define(report(Severity, Label, Service, Content),
- inets:report_event(Severity, Label, Service,
- [{module, ?MODULE}, {line, ?LINE} | Content])).
+ inets_trace:report_event(Severity, Label, Service,
+ [{module, ?MODULE}, {line, ?LINE} | Content])).
-define(report_important(Label, Service, Content),
?report(20, Label, Service, Content)).
-define(report_verbose(Label, Service, Content),
diff --git a/lib/inets/src/inets_app/inets_service.erl b/lib/inets/src/inets_app/inets_service.erl
index a057a51e2c..d17fdfe13e 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -20,20 +20,6 @@
-module(inets_service).
--ifdef('OTP-R14B-COMPILER').
-
--export([behaviour_info/1]).
-
-behaviour_info(callbacks) ->
- [{start_standalone, 1},
- {start_service, 1},
- {stop_service, 1},
- {services, 0},
- {service_info, 1}];
-behaviour_info(_) ->
- undefined.
-
--else.
%% Starts service stand-alone
%% start_standalone(Config) -> % {ok, Pid} | {error, Reason}
@@ -83,4 +69,3 @@ behaviour_info(_) ->
-callback service_info(Service :: term()) ->
{ok, [{Property :: term(), Value :: term()}]} | {error, Reason :: term()}.
--endif.
diff --git a/lib/inets/src/inets_app/inets_sup.erl b/lib/inets/src/inets_app/inets_sup.erl
index 20d5ef343e..66a0cdf785 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -25,9 +25,19 @@
-behaviour(supervisor).
+%% External API
+-export([start_link/0]).
+
+%% Supervisor callbacks
-export([init/1]).
%%%=========================================================================
+%%% External functions
+%%%=========================================================================
+start_link() ->
+ supervisor:start_link({local, ?MODULE}, ?MODULE, []).
+
+%%%=========================================================================
%%% Supervisor callback
%%%=========================================================================
init([]) ->
diff --git a/lib/inets/src/inets_app/inets_trace.erl b/lib/inets/src/inets_app/inets_trace.erl
new file mode 100644
index 0000000000..8911f65897
--- /dev/null
+++ b/lib/inets/src/inets_app/inets_trace.erl
@@ -0,0 +1,357 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2011-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+%%
+%%----------------------------------------------------------------------
+%% Purpose: Module for debug trace functions of the inets application
+%%----------------------------------------------------------------------
+
+-module(inets_trace).
+
+%% API
+-export([enable/2, enable/3,
+ disable/0,
+ set_level/1, set_level/2,
+ report_event/4]).
+
+
+%%====================================================================
+%% API
+%%====================================================================
+
+%%-----------------------------------------------------------------
+%% enable(Level, Destination) -> void()
+%% enable(Level, Destination, Service) -> void()
+%%
+%% Parameters:
+%% Level -> max | min | integer()
+%% Destination -> File | Port | io | HandlerSpec
+%% Service -> httpc | httpd | ftpc | tftp | all
+%% File -> string()
+%% Port -> integer()
+%% Verbosity -> true | false
+%% HandlerSpec = {function(), Data}
+%% Data = term()
+%%
+%% Description:
+%% This function is used to start tracing at level Level and send
+%% the result either to the file File, the port Port or to a
+%% trace handler.
+%% Note that it starts a tracer server.
+%% When Destination is the atom io (or the tuple {io, Verbosity}),
+%% all (printable) inets trace events (trace_ts events which has
+%% Severity withing Limit) will be written to stdout using io:format.
+%%
+%%-----------------------------------------------------------------
+enable(Level, Dest) ->
+ enable(Level, Dest, all).
+
+enable(Level, Dest, Service) ->
+ case valid_trace_service(Service) of
+ true ->
+ enable2(Level, Dest, Service);
+ false ->
+ {error, {invalid_service, Service}}
+ end.
+
+enable2(Level, File, Service)
+ when is_list(File) ->
+ case file:open(File, [write]) of
+ {ok, Fd} ->
+ HandleSpec = {fun handle_trace/2, {Service, Fd}},
+ do_enable(Level, process, HandleSpec);
+ Err ->
+ Err
+ end;
+enable2(Level, Port, _) when is_integer(Port) ->
+ do_enable(Level, port, dbg:trace_port(ip, Port));
+enable2(Level, io, Service) ->
+ HandleSpec = {fun handle_trace/2, {Service, standard_io}},
+ do_enable(Level, process, HandleSpec);
+enable2(Level, {Fun, _Data} = HandleSpec, _) when is_function(Fun) ->
+ do_enable(Level, process, HandleSpec).
+
+do_enable(Level, Type, HandleSpec) ->
+ case dbg:tracer(Type, HandleSpec) of
+ {ok, _} ->
+ set_level(Level),
+ ok;
+ Error ->
+ Error
+ end.
+
+valid_trace_service(all) ->
+ true;
+valid_trace_service(Service) ->
+ lists:member(Service, [httpc, httpd, ftpc, tftp]).
+
+
+%%-----------------------------------------------------------------
+%% disable() -> void()
+%%
+%% Description:
+%% This function is used to stop tracing.
+%%-----------------------------------------------------------------
+
+disable() ->
+ %% This is to make handle_trace/2 close the output file (if the
+ %% event gets there before dbg closes)
+ inets_trace:report_event(100, "stop trace", stop_trace, [stop_trace]),
+ dbg:stop().
+
+
+
+%%-----------------------------------------------------------------
+%% set_level(Level) -> void()
+%%
+%% Parameters:
+%% Level -> max | min | integer()
+%%
+%% Description:
+%% This function is used to change the trace level when tracing has
+%% already been started.
+%%-----------------------------------------------------------------
+set_level(Level) ->
+ set_level(Level, all).
+
+set_level(Level, Service) ->
+ Pat = make_pattern(?MODULE, Service, Level),
+ change_pattern(Pat).
+
+make_pattern(Mod, Service, Level)
+ when is_atom(Mod) andalso is_atom(Service) ->
+ case Level of
+ min ->
+ {Mod, Service, []};
+ max ->
+ Head = ['$1', '_', '_', '_'],
+ Body = [],
+ Cond = [],
+ {Mod, Service, [{Head, Cond, Body}]};
+ DetailLevel when is_integer(DetailLevel) ->
+ Head = ['$1', '_', '_', '_'],
+ Body = [],
+ Cond = [{ '=<', '$1', DetailLevel}],
+ {Mod, Service, [{Head, Cond, Body}]};
+ _ ->
+ exit({bad_level, Level})
+ end.
+
+change_pattern({Mod, Service, Pattern})
+ when is_atom(Mod) andalso is_atom(Service) ->
+ MFA = {Mod, report_event, 4},
+ case Pattern of
+ [] ->
+ try
+ error_to_exit(ctp, dbg:ctp(MFA)),
+ error_to_exit(p, dbg:p(all, clear))
+ catch
+ exit:{Where, Reason} ->
+ {error, {Where, Reason}}
+ end;
+ List when is_list(List) ->
+ try
+ error_to_exit(ctp, dbg:ctp(MFA)),
+ error_to_exit(tp, dbg:tp(MFA, Pattern)),
+ error_to_exit(p, dbg:p(all, [call, timestamp]))
+ catch
+ exit:{Where, Reason} ->
+ {error, {Where, Reason}}
+ end
+ end.
+
+error_to_exit(_Where, {ok, _} = OK) ->
+ OK;
+error_to_exit(Where, {error, Reason}) ->
+ exit({Where, Reason}).
+
+
+%%-----------------------------------------------------------------
+%% report_event(Severity, Label, Service, Content)
+%%
+%% Parameters:
+%% Severity -> 0 =< integer() =< 100
+%% Label -> string()
+%% Service -> httpd | httpc | ftp | tftp
+%% Content -> [{tag, term()}]
+%%
+%% Description:
+%% This function is used to generate trace events, that is,
+%% put trace on this function.
+%%-----------------------------------------------------------------
+
+report_event(Severity, Label, Service, Content)
+ when (is_integer(Severity) andalso
+ (Severity >= 0) andalso (100 >= Severity)) andalso
+ is_list(Label) andalso
+ is_atom(Service) andalso
+ is_list(Content) ->
+ hopefully_traced.
+
+
+%% ----------------------------------------------------------------------
+%% handle_trace(Event, Fd) -> Verbosity
+%%
+%% Parameters:
+%% Event -> The trace event
+%% Fd -> standard_io | file_descriptor() | trace_port()
+%%
+%% Description:
+%% This function is used to "receive" and pretty print the trace events.
+%% Events are printed if:
+%% - Verbosity is max
+%% - Severity is =< Verbosity (e.g. Severity = 30, and Verbosity = 40)
+%% Events are not printed if:
+%% - Verbosity is min
+%% - Severity is > Verbosity
+%%-----------------------------------------------------------------
+
+handle_trace(_, closed_file = Fd) ->
+ Fd;
+handle_trace({trace_ts, _Who, call,
+ {?MODULE, report_event,
+ [_Sev, "stop trace", stop_trace, [stop_trace]]},
+ Timestamp},
+ {_, standard_io} = Fd) ->
+ (catch io:format(standard_io, "stop trace at ~s~n", [format_timestamp(Timestamp)])),
+ Fd;
+handle_trace({trace_ts, _Who, call,
+ {?MODULE, report_event,
+ [_Sev, "stop trace", stop_trace, [stop_trace]]},
+ Timestamp},
+ standard_io = Fd) ->
+ (catch io:format(Fd, "stop trace at ~s~n", [format_timestamp(Timestamp)])),
+ Fd;
+handle_trace({trace_ts, _Who, call,
+ {?MODULE, report_event,
+ [_Sev, "stop trace", stop_trace, [stop_trace]]},
+ Timestamp},
+ {_Service, Fd}) ->
+ (catch io:format(Fd, "stop trace at ~s~n", [format_timestamp(Timestamp)])),
+ (catch file:close(Fd)),
+ closed_file;
+handle_trace({trace_ts, _Who, call,
+ {?MODULE, report_event,
+ [_Sev, "stop trace", stop_trace, [stop_trace]]},
+ Timestamp},
+ Fd) ->
+ (catch io:format(Fd, "stop trace at ~s~n", [format_timestamp(Timestamp)])),
+ (catch file:close(Fd)),
+ closed_file;
+handle_trace({trace_ts, Who, call,
+ {?MODULE, report_event,
+ [Sev, Label, Service, Content]}, Timestamp},
+ Fd) ->
+ (catch print_inets_trace(Fd, Sev, Timestamp, Who,
+ Label, Service, Content)),
+ Fd;
+handle_trace(Event, Fd) ->
+ (catch print_trace(Fd, Event)),
+ Fd.
+
+
+print_inets_trace({Service, Fd},
+ Sev, Timestamp, Who, Label, Service, Content) ->
+ do_print_inets_trace(Fd, Sev, Timestamp, Who, Label, Service, Content);
+print_inets_trace({ServiceA, Fd},
+ Sev, Timestamp, Who, Label, ServiceB, Content)
+ when (ServiceA =:= all) ->
+ do_print_inets_trace(Fd, Sev, Timestamp, Who, Label, ServiceB, Content);
+print_inets_trace({ServiceA, _Fd},
+ _Sev, _Timestamp, _Who, _Label, ServiceB, _Content)
+ when ServiceA =/= ServiceB ->
+ ok;
+print_inets_trace(Fd, Sev, Timestamp, Who, Label, Service, Content) ->
+ do_print_inets_trace(Fd, Sev, Timestamp, Who, Label, Service, Content).
+
+do_print_inets_trace(Fd, Sev, Timestamp, Who, Label, Service, Content) ->
+ Ts = format_timestamp(Timestamp),
+ io:format(Fd, "[inets ~w trace ~w ~w ~s] ~s "
+ "~n Content: ~p"
+ "~n",
+ [Service, Sev, Who, Ts, Label, Content]).
+
+print_trace({_, Fd}, Event) ->
+ do_print_trace(Fd, Event);
+print_trace(Fd, Event) ->
+ do_print_trace(Fd, Event).
+
+do_print_trace(Fd, {trace, Who, What, Where}) ->
+ io:format(Fd, "[trace]"
+ "~n Who: ~p"
+ "~n What: ~p"
+ "~n Where: ~p"
+ "~n", [Who, What, Where]);
+
+do_print_trace(Fd, {trace, Who, What, Where, Extra}) ->
+ io:format(Fd, "[trace]"
+ "~n Who: ~p"
+ "~n What: ~p"
+ "~n Where: ~p"
+ "~n Extra: ~p"
+ "~n", [Who, What, Where, Extra]);
+
+do_print_trace(Fd, {trace_ts, Who, What, Where, When}) ->
+ Ts = format_timestamp(When),
+ io:format(Fd, "[trace ~s]"
+ "~n Who: ~p"
+ "~n What: ~p"
+ "~n Where: ~p"
+ "~n", [Ts, Who, What, Where]);
+
+do_print_trace(Fd, {trace_ts, Who, What, Where, Extra, When}) ->
+ Ts = format_timestamp(When),
+ io:format(Fd, "[trace ~s]"
+ "~n Who: ~p"
+ "~n What: ~p"
+ "~n Where: ~p"
+ "~n Extra: ~p"
+ "~n", [Ts, Who, What, Where, Extra]);
+
+do_print_trace(Fd, {seq_trace, What, Where}) ->
+ io:format(Fd, "[seq trace]"
+ "~n What: ~p"
+ "~n Where: ~p"
+ "~n", [What, Where]);
+
+do_print_trace(Fd, {seq_trace, What, Where, When}) ->
+ Ts = format_timestamp(When),
+ io:format(Fd, "[seq trace ~s]"
+ "~n What: ~p"
+ "~n Where: ~p"
+ "~n", [Ts, What, Where]);
+
+do_print_trace(Fd, {drop, Num}) ->
+ io:format(Fd, "[drop trace] ~p~n", [Num]);
+
+do_print_trace(Fd, Trace) ->
+ io:format(Fd, "[trace] "
+ "~n ~p"
+ "~n", [Trace]).
+
+
+format_timestamp({_N1, _N2, N3} = Now) ->
+ {Date, Time} = calendar:now_to_datetime(Now),
+ {YYYY,MM,DD} = Date,
+ {Hour,Min,Sec} = Time,
+ FormatDate =
+ io_lib:format("~.4w:~.2.0w:~.2.0w ~.2.0w:~.2.0w:~.2.0w 4~w",
+ [YYYY,MM,DD,Hour,Min,Sec,round(N3/1000)]),
+ lists:flatten(FormatDate).
+
+
diff --git a/lib/inets/src/tftp/Makefile b/lib/inets/src/tftp/Makefile
index 759b70c8e4..b368b12462 100644
--- a/lib/inets/src/tftp/Makefile
+++ b/lib/inets/src/tftp/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2010. All Rights Reserved.
+# Copyright Ericsson AB 2005-2012. 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
@@ -39,8 +39,10 @@ RELSYSDIR = $(RELEASE_PATH)/lib/$(APPLICATION)-$(VSN)
# ----------------------------------------------------
# Target Specs
# ----------------------------------------------------
+BEHAVIOUR_MODULES= \
+ tftp
+
MODULES = \
- tftp \
tftp_binary \
tftp_engine \
tftp_file \
@@ -50,10 +52,13 @@ MODULES = \
HRL_FILES = tftp.hrl
-ERL_FILES = $(MODULES:%=%.erl)
+ERL_FILES= \
+ $(MODULES:%=%.erl) \
+ $(BEHAVIOUR_MODULES:%=%.erl)
TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR))
+BEHAVIOUR_TARGET_FILES= $(BEHAVIOUR_MODULES:%=$(EBIN)/%.$(EMULATOR))
# ----------------------------------------------------
# FLAGS
@@ -72,10 +77,12 @@ ERL_COMPILE_FLAGS += \
# Targets
# ----------------------------------------------------
+$(TARGET_FILES): $(BEHAVIOUR_TARGET_FILES)
+
debug opt: $(TARGET_FILES)
clean:
- rm -f $(TARGET_FILES)
+ rm -f $(TARGET_FILES) $(BEHAVIOUR_TARGET_FILES)
rm -f core
docs:
@@ -86,11 +93,11 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/tftp
- $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) $(RELSYSDIR)/src/tftp
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/tftp"
+ $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) "$(RELSYSDIR)/src/tftp"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) $(BEHAVIOUR_TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/inets/src/tftp/tftp.erl b/lib/inets/src/tftp/tftp.erl
index 0d7ae1a89e..1621add246 100644
--- a/lib/inets/src/tftp/tftp.erl
+++ b/lib/inets/src/tftp/tftp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -224,20 +224,6 @@
service_info/1
]).
--ifdef('OTP-R14B-COMPILER').
-
--export([behaviour_info/1]).
-
-behaviour_info(callbacks) ->
- [{prepare, 6},
- {open, 6},
- {read, 1},
- {write, 2},
- {abort, 3}];
-behaviour_info(_) ->
- undefined.
-
--else.
-type peer() :: {PeerType :: inet | inet6,
PeerHost :: inet:ip_address(),
@@ -280,8 +266,6 @@ behaviour_info(_) ->
-callback abort(Code :: error_code(), string(), State :: term()) -> 'ok'.
--endif.
-
-include("tftp.hrl").
diff --git a/lib/inets/test/Makefile b/lib/inets/test/Makefile
index 87ca60e4b3..0ca99e8692 100644
--- a/lib/inets/test/Makefile
+++ b/lib/inets/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -149,6 +149,7 @@ INETS_ROOT = ../../inets
MODULES = \
inets_test_lib \
+ erl_make_certs \
ftp_SUITE \
ftp_format_SUITE \
ftp_solaris8_sparc_test \
@@ -169,6 +170,7 @@ MODULES = \
http_format_SUITE \
httpc_SUITE \
httpc_cookie_SUITE \
+ httpc_proxy_SUITE \
httpd_SUITE \
httpd_basic_SUITE \
httpd_mod \
@@ -213,7 +215,7 @@ INETS_FILES = inets.config $(INETS_SPECS)
INETS_DATADIRS = inets_SUITE_data inets_sup_SUITE_data
HTTPD_DATADIRS = httpd_test_data httpd_SUITE_data
-HTTPC_DATADIRS = httpc_SUITE_data
+HTTPC_DATADIRS = httpc_SUITE_data httpc_proxy_SUITE_data
FTP_DATADIRS = ftp_SUITE_data
DATADIRS = $(INETS_DATADIRS) $(HTTPD_DATADIRS) $(HTTPC_DATADIRS) $(FTP_DATADIRS)
@@ -234,7 +236,7 @@ endif
# Release directory specification
# ----------------------------------------------------
-RELTESTSYSDIR = $(RELEASE_PATH)/inets_test
+RELTESTSYSDIR = "$(RELEASE_PATH)/inets_test"
RELTESTSYSALLDATADIR = $(RELTESTSYSDIR)/all_SUITE_data
RELTESTSYSBINDIR = $(RELTESTSYSALLDATADIR)/bin
@@ -284,9 +286,9 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/test
- $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) $(RELSYSDIR)/test
- $(INSTALL_DATA) $(INETS_FILES) $(RELSYSDIR)/test
+ $(INSTALL_DIR) "$(RELSYSDIR)/test"
+ $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) "$(RELSYSDIR)/test"
+ $(INSTALL_DATA) $(INETS_FILES) "$(RELSYSDIR)/test"
@for d in $(DATADIRS); do \
echo "installing data dir $$d"; \
if test -f $$d/TAR.exclude; then \
@@ -299,9 +301,9 @@ release_spec: opt
find $$d -name 'erl_crash.dump' >> $$d/TAR.exclude2; \
find $$d -name 'core' >> $$d/TAR.exclude2; \
find $$d -name '.cmake.state' >> $$d/TAR.exclude2; \
- tar cfX - $$d/TAR.exclude2 $$d | (cd $(RELSYSDIR)/test; tar xf -); \
+ tar cfX - $$d/TAR.exclude2 $$d | (cd "$(RELSYSDIR)/test"; tar xf -); \
else \
- tar cf - $$d | (cd $(RELSYSDIR)/test; tar xf -); \
+ tar cf - $$d | (cd "$(RELSYSDIR)/test"; tar xf -); \
fi; \
done
@@ -330,8 +332,8 @@ info:
@echo "INETS_SPECS = $(INETS_SPECS)"
@echo "INETS_FILES = $(INETS_FILES)"
@echo ""
- @echo "RELEASE_PATH = $(RELEASE_PATH)"
- @echo "RELSYSDIR = $(RELSYSDIR)"
+ @echo "RELEASE_PATH = "$(RELEASE_PATH)""
+ @echo "RELSYSDIR = "$(RELSYSDIR)""
@echo "RELTESTSYSDIR = $(RELTESTSYSDIR)"
@echo "RELTESTSYSALLDATADIR = $(RELTESTSYSALLDATADIR)"
@echo "RELTESTSYSBINDIR = $(RELTESTSYSBINDIR)"
diff --git a/lib/inets/test/erl_make_certs.erl b/lib/inets/test/erl_make_certs.erl
new file mode 100644
index 0000000000..254aa6d2f9
--- /dev/null
+++ b/lib/inets/test/erl_make_certs.erl
@@ -0,0 +1,429 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2011. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%% Create test certificates
+
+-module(erl_make_certs).
+-include_lib("public_key/include/public_key.hrl").
+
+-export([make_cert/1, gen_rsa/1, verify_signature/3, write_pem/3]).
+-compile(export_all).
+
+%%--------------------------------------------------------------------
+%% @doc Create and return a der encoded certificate
+%% Option Default
+%% -------------------------------------------------------
+%% digest sha1
+%% validity {date(), date() + week()}
+%% version 3
+%% subject [] list of the following content
+%% {name, Name}
+%% {email, Email}
+%% {city, City}
+%% {state, State}
+%% {org, Org}
+%% {org_unit, OrgUnit}
+%% {country, Country}
+%% {serial, Serial}
+%% {title, Title}
+%% {dnQualifer, DnQ}
+%% issuer = {Issuer, IssuerKey} true (i.e. a ca cert is created)
+%% (obs IssuerKey migth be {Key, Password}
+%% key = KeyFile|KeyBin|rsa|dsa Subject PublicKey rsa or dsa generates key
+%%
+%%
+%% (OBS: The generated keys are for testing only)
+%% @spec ([{::atom(), ::term()}]) -> {Cert::binary(), Key::binary()}
+%% @end
+%%--------------------------------------------------------------------
+
+make_cert(Opts) ->
+ SubjectPrivateKey = get_key(Opts),
+ {TBSCert, IssuerKey} = make_tbs(SubjectPrivateKey, Opts),
+ Cert = public_key:pkix_sign(TBSCert, IssuerKey),
+ true = verify_signature(Cert, IssuerKey, undef), %% verify that the keys where ok
+ {Cert, encode_key(SubjectPrivateKey)}.
+
+%%--------------------------------------------------------------------
+%% @doc Writes pem files in Dir with FileName ++ ".pem" and FileName ++ "_key.pem"
+%% @spec (::string(), ::string(), {Cert,Key}) -> ok
+%% @end
+%%--------------------------------------------------------------------
+write_pem(Dir, FileName, {Cert, Key = {_,_,not_encrypted}}) when is_binary(Cert) ->
+ ok = der_to_pem(filename:join(Dir, FileName ++ ".pem"),
+ [{'Certificate', Cert, not_encrypted}]),
+ ok = der_to_pem(filename:join(Dir, FileName ++ "_key.pem"), [Key]).
+
+%%--------------------------------------------------------------------
+%% @doc Creates a rsa key (OBS: for testing only)
+%% the size are in bytes
+%% @spec (::integer()) -> {::atom(), ::binary(), ::opaque()}
+%% @end
+%%--------------------------------------------------------------------
+gen_rsa(Size) when is_integer(Size) ->
+ Key = gen_rsa2(Size),
+ {Key, encode_key(Key)}.
+
+%%--------------------------------------------------------------------
+%% @doc Creates a dsa key (OBS: for testing only)
+%% the sizes are in bytes
+%% @spec (::integer()) -> {::atom(), ::binary(), ::opaque()}
+%% @end
+%%--------------------------------------------------------------------
+gen_dsa(LSize,NSize) when is_integer(LSize), is_integer(NSize) ->
+ Key = gen_dsa2(LSize, NSize),
+ {Key, encode_key(Key)}.
+
+%%--------------------------------------------------------------------
+%% @doc Verifies cert signatures
+%% @spec (::binary(), ::tuple()) -> ::boolean()
+%% @end
+%%--------------------------------------------------------------------
+verify_signature(DerEncodedCert, DerKey, _KeyParams) ->
+ Key = decode_key(DerKey),
+ case Key of
+ #'RSAPrivateKey'{modulus=Mod, publicExponent=Exp} ->
+ public_key:pkix_verify(DerEncodedCert,
+ #'RSAPublicKey'{modulus=Mod, publicExponent=Exp});
+ #'DSAPrivateKey'{p=P, q=Q, g=G, y=Y} ->
+ public_key:pkix_verify(DerEncodedCert, {Y, #'Dss-Parms'{p=P, q=Q, g=G}})
+ end.
+
+%%%%%%%%%%%%%%%%%%%%%%%%% Implementation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+get_key(Opts) ->
+ case proplists:get_value(key, Opts) of
+ undefined -> make_key(rsa, Opts);
+ rsa -> make_key(rsa, Opts);
+ dsa -> make_key(dsa, Opts);
+ Key ->
+ Password = proplists:get_value(password, Opts, no_passwd),
+ decode_key(Key, Password)
+ end.
+
+decode_key({Key, Pw}) ->
+ decode_key(Key, Pw);
+decode_key(Key) ->
+ decode_key(Key, no_passwd).
+
+
+decode_key(#'RSAPublicKey'{} = Key,_) ->
+ Key;
+decode_key(#'RSAPrivateKey'{} = Key,_) ->
+ Key;
+decode_key(#'DSAPrivateKey'{} = Key,_) ->
+ Key;
+decode_key(PemEntry = {_,_,_}, Pw) ->
+ public_key:pem_entry_decode(PemEntry, Pw);
+decode_key(PemBin, Pw) ->
+ [KeyInfo] = public_key:pem_decode(PemBin),
+ decode_key(KeyInfo, Pw).
+
+encode_key(Key = #'RSAPrivateKey'{}) ->
+ {ok, Der} = 'OTP-PUB-KEY':encode('RSAPrivateKey', Key),
+ {'RSAPrivateKey', list_to_binary(Der), not_encrypted};
+encode_key(Key = #'DSAPrivateKey'{}) ->
+ {ok, Der} = 'OTP-PUB-KEY':encode('DSAPrivateKey', Key),
+ {'DSAPrivateKey', list_to_binary(Der), not_encrypted}.
+
+make_tbs(SubjectKey, Opts) ->
+ Version = list_to_atom("v"++integer_to_list(proplists:get_value(version, Opts, 3))),
+
+ IssuerProp = proplists:get_value(issuer, Opts, true),
+ {Issuer, IssuerKey} = issuer(IssuerProp, Opts, SubjectKey),
+
+ {Algo, Parameters} = sign_algorithm(IssuerKey, Opts),
+
+ SignAlgo = #'SignatureAlgorithm'{algorithm = Algo,
+ parameters = Parameters},
+ Subject = case IssuerProp of
+ true -> %% Is a Root Ca
+ Issuer;
+ _ ->
+ subject(proplists:get_value(subject, Opts),false)
+ end,
+
+ {#'OTPTBSCertificate'{serialNumber = trunc(random:uniform()*100000000)*10000 + 1,
+ signature = SignAlgo,
+ issuer = Issuer,
+ validity = validity(Opts),
+ subject = Subject,
+ subjectPublicKeyInfo = publickey(SubjectKey),
+ version = Version,
+ extensions = extensions(Opts)
+ }, IssuerKey}.
+
+issuer(true, Opts, SubjectKey) ->
+ %% Self signed
+ {subject(proplists:get_value(subject, Opts), true), SubjectKey};
+issuer({Issuer, IssuerKey}, _Opts, _SubjectKey) when is_binary(Issuer) ->
+ {issuer_der(Issuer), decode_key(IssuerKey)};
+issuer({File, IssuerKey}, _Opts, _SubjectKey) when is_list(File) ->
+ {ok, [{cert, Cert, _}|_]} = pem_to_der(File),
+ {issuer_der(Cert), decode_key(IssuerKey)}.
+
+issuer_der(Issuer) ->
+ Decoded = public_key:pkix_decode_cert(Issuer, otp),
+ #'OTPCertificate'{tbsCertificate=Tbs} = Decoded,
+ #'OTPTBSCertificate'{subject=Subject} = Tbs,
+ Subject.
+
+subject(undefined, IsRootCA) ->
+ User = if IsRootCA -> "RootCA"; true -> user() end,
+ Opts = [{email, User ++ "@erlang.org"},
+ {name, User},
+ {city, "Stockholm"},
+ {country, "SE"},
+ {org, "erlang"},
+ {org_unit, "testing dep"}],
+ subject(Opts);
+subject(Opts, _) ->
+ subject(Opts).
+
+user() ->
+ case os:getenv("USER") of
+ false ->
+ "test_user";
+ User ->
+ User
+ end.
+
+subject(SubjectOpts) when is_list(SubjectOpts) ->
+ Encode = fun(Opt) ->
+ {Type,Value} = subject_enc(Opt),
+ [#'AttributeTypeAndValue'{type=Type, value=Value}]
+ end,
+ {rdnSequence, [Encode(Opt) || Opt <- SubjectOpts]}.
+
+%% Fill in the blanks
+subject_enc({name, Name}) -> {?'id-at-commonName', {printableString, Name}};
+subject_enc({email, Email}) -> {?'id-emailAddress', Email};
+subject_enc({city, City}) -> {?'id-at-localityName', {printableString, City}};
+subject_enc({state, State}) -> {?'id-at-stateOrProvinceName', {printableString, State}};
+subject_enc({org, Org}) -> {?'id-at-organizationName', {printableString, Org}};
+subject_enc({org_unit, OrgUnit}) -> {?'id-at-organizationalUnitName', {printableString, OrgUnit}};
+subject_enc({country, Country}) -> {?'id-at-countryName', Country};
+subject_enc({serial, Serial}) -> {?'id-at-serialNumber', Serial};
+subject_enc({title, Title}) -> {?'id-at-title', {printableString, Title}};
+subject_enc({dnQualifer, DnQ}) -> {?'id-at-dnQualifier', DnQ};
+subject_enc(Other) -> Other.
+
+
+extensions(Opts) ->
+ case proplists:get_value(extensions, Opts, []) of
+ false ->
+ asn1_NOVALUE;
+ Exts ->
+ lists:flatten([extension(Ext) || Ext <- default_extensions(Exts)])
+ end.
+
+default_extensions(Exts) ->
+ Def = [{key_usage,undefined},
+ {subject_altname, undefined},
+ {issuer_altname, undefined},
+ {basic_constraints, default},
+ {name_constraints, undefined},
+ {policy_constraints, undefined},
+ {ext_key_usage, undefined},
+ {inhibit_any, undefined},
+ {auth_key_id, undefined},
+ {subject_key_id, undefined},
+ {policy_mapping, undefined}],
+ Filter = fun({Key, _}, D) -> lists:keydelete(Key, 1, D) end,
+ Exts ++ lists:foldl(Filter, Def, Exts).
+
+extension({_, undefined}) -> [];
+extension({basic_constraints, Data}) ->
+ case Data of
+ default ->
+ #'Extension'{extnID = ?'id-ce-basicConstraints',
+ extnValue = #'BasicConstraints'{cA=true},
+ critical=true};
+ false ->
+ [];
+ Len when is_integer(Len) ->
+ #'Extension'{extnID = ?'id-ce-basicConstraints',
+ extnValue = #'BasicConstraints'{cA=true, pathLenConstraint=Len},
+ critical=true};
+ _ ->
+ #'Extension'{extnID = ?'id-ce-basicConstraints',
+ extnValue = Data}
+ end;
+extension({Id, Data, Critical}) ->
+ #'Extension'{extnID = Id, extnValue = Data, critical = Critical}.
+
+
+publickey(#'RSAPrivateKey'{modulus=N, publicExponent=E}) ->
+ Public = #'RSAPublicKey'{modulus=N, publicExponent=E},
+ Algo = #'PublicKeyAlgorithm'{algorithm= ?rsaEncryption, parameters='NULL'},
+ #'OTPSubjectPublicKeyInfo'{algorithm = Algo,
+ subjectPublicKey = Public};
+publickey(#'DSAPrivateKey'{p=P, q=Q, g=G, y=Y}) ->
+ Algo = #'PublicKeyAlgorithm'{algorithm= ?'id-dsa',
+ parameters={params, #'Dss-Parms'{p=P, q=Q, g=G}}},
+ #'OTPSubjectPublicKeyInfo'{algorithm = Algo, subjectPublicKey = Y}.
+
+validity(Opts) ->
+ DefFrom0 = calendar:gregorian_days_to_date(calendar:date_to_gregorian_days(date())-1),
+ DefTo0 = calendar:gregorian_days_to_date(calendar:date_to_gregorian_days(date())+7),
+ {DefFrom, DefTo} = proplists:get_value(validity, Opts, {DefFrom0, DefTo0}),
+ Format = fun({Y,M,D}) -> lists:flatten(io_lib:format("~w~2..0w~2..0w000000Z",[Y,M,D])) end,
+ #'Validity'{notBefore={generalTime, Format(DefFrom)},
+ notAfter ={generalTime, Format(DefTo)}}.
+
+sign_algorithm(#'RSAPrivateKey'{}, Opts) ->
+ Type = case proplists:get_value(digest, Opts, sha1) of
+ sha1 -> ?'sha1WithRSAEncryption';
+ sha512 -> ?'sha512WithRSAEncryption';
+ sha384 -> ?'sha384WithRSAEncryption';
+ sha256 -> ?'sha256WithRSAEncryption';
+ md5 -> ?'md5WithRSAEncryption';
+ md2 -> ?'md2WithRSAEncryption'
+ end,
+ {Type, 'NULL'};
+sign_algorithm(#'DSAPrivateKey'{p=P, q=Q, g=G}, _Opts) ->
+ {?'id-dsa-with-sha1', {params,#'Dss-Parms'{p=P, q=Q, g=G}}}.
+
+make_key(rsa, _Opts) ->
+ %% (OBS: for testing only)
+ gen_rsa2(64);
+make_key(dsa, _Opts) ->
+ gen_dsa2(128, 20). %% Bytes i.e. {1024, 160}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% RSA key generation (OBS: for testing only)
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+-define(SMALL_PRIMES, [65537,97,89,83,79,73,71,67,61,59,53,
+ 47,43,41,37,31,29,23,19,17,13,11,7,5,3]).
+
+gen_rsa2(Size) ->
+ P = prime(Size),
+ Q = prime(Size),
+ N = P*Q,
+ Tot = (P - 1) * (Q - 1),
+ [E|_] = lists:dropwhile(fun(Candidate) -> (Tot rem Candidate) == 0 end, ?SMALL_PRIMES),
+ {D1,D2} = extended_gcd(E, Tot),
+ D = erlang:max(D1,D2),
+ case D < E of
+ true ->
+ gen_rsa2(Size);
+ false ->
+ {Co1,Co2} = extended_gcd(Q, P),
+ Co = erlang:max(Co1,Co2),
+ #'RSAPrivateKey'{version = 'two-prime',
+ modulus = N,
+ publicExponent = E,
+ privateExponent = D,
+ prime1 = P,
+ prime2 = Q,
+ exponent1 = D rem (P-1),
+ exponent2 = D rem (Q-1),
+ coefficient = Co
+ }
+ end.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% DSA key generation (OBS: for testing only)
+%% See http://en.wikipedia.org/wiki/Digital_Signature_Algorithm
+%% and the fips_186-3.pdf
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+gen_dsa2(LSize, NSize) ->
+ Q = prime(NSize), %% Choose N-bit prime Q
+ X0 = prime(LSize),
+ P0 = prime((LSize div 2) +1),
+
+ %% Choose L-bit prime modulus P such that p–1 is a multiple of q.
+ case dsa_search(X0 div (2*Q*P0), P0, Q, 1000) of
+ error ->
+ gen_dsa2(LSize, NSize);
+ P ->
+ G = crypto:mod_exp(2, (P-1) div Q, P), % Choose G a number whose multiplicative order modulo p is q.
+ %% such that This may be done by setting g = h^(p–1)/q mod p, commonly h=2 is used.
+
+ X = prime(20), %% Choose x by some random method, where 0 < x < q.
+ Y = crypto:mod_exp(G, X, P), %% Calculate y = g^x mod p.
+
+ #'DSAPrivateKey'{version=0, p=P, q=Q, g=G, y=Y, x=X}
+ end.
+
+%% See fips_186-3.pdf
+dsa_search(T, P0, Q, Iter) when Iter > 0 ->
+ P = 2*T*Q*P0 + 1,
+ case is_prime(crypto:mpint(P), 50) of
+ true -> P;
+ false -> dsa_search(T+1, P0, Q, Iter-1)
+ end;
+dsa_search(_,_,_,_) ->
+ error.
+
+
+%%%%%%% Crypto Math %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+prime(ByteSize) ->
+ Rand = odd_rand(ByteSize),
+ crypto:erlint(prime_odd(Rand, 0)).
+
+prime_odd(Rand, N) ->
+ case is_prime(Rand, 50) of
+ true ->
+ Rand;
+ false ->
+ NotPrime = crypto:erlint(Rand),
+ prime_odd(crypto:mpint(NotPrime+2), N+1)
+ end.
+
+%% see http://en.wikipedia.org/wiki/Fermat_primality_test
+is_prime(_, 0) -> true;
+is_prime(Candidate, Test) ->
+ CoPrime = odd_rand(<<0,0,0,4, 10000:32>>, Candidate),
+ case crypto:mod_exp(CoPrime, Candidate, Candidate) of
+ CoPrime -> is_prime(Candidate, Test-1);
+ _ -> false
+ end.
+
+odd_rand(Size) ->
+ Min = 1 bsl (Size*8-1),
+ Max = (1 bsl (Size*8))-1,
+ odd_rand(crypto:mpint(Min), crypto:mpint(Max)).
+
+odd_rand(Min,Max) ->
+ Rand = <<Sz:32, _/binary>> = crypto:rand_uniform(Min,Max),
+ BitSkip = (Sz+4)*8-1,
+ case Rand of
+ Odd = <<_:BitSkip, 1:1>> -> Odd;
+ Even = <<_:BitSkip, 0:1>> ->
+ crypto:mpint(crypto:erlint(Even)+1)
+ end.
+
+extended_gcd(A, B) ->
+ case A rem B of
+ 0 ->
+ {0, 1};
+ N ->
+ {X, Y} = extended_gcd(B, N),
+ {Y, X-Y*(A div B)}
+ end.
+
+pem_to_der(File) ->
+ {ok, PemBin} = file:read_file(File),
+ public_key:pem_decode(PemBin).
+
+der_to_pem(File, Entries) ->
+ PemBin = public_key:pem_encode(Entries),
+ file:write_file(File, PemBin).
diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl
index 881266b70a..cb81d2cc5e 100644
--- a/lib/inets/test/httpc_SUITE.erl
+++ b/lib/inets/test/httpc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -34,9 +34,6 @@
-compile(export_all).
%% Test server specific exports
--define(PROXY_URL, "http://www.erlang.org").
--define(PROXY, "www-proxy.ericsson.se").
--define(PROXY_PORT, 8080).
-define(IP_PORT, 8998).
-define(SSL_PORT, 8999).
-define(NOT_IN_USE_PORT, 8997).
@@ -91,7 +88,6 @@ all() ->
options,
headers_as_is,
selecting_session,
- {group, proxy},
{group, ssl},
{group, stream},
{group, ipv6},
@@ -101,18 +97,6 @@ all() ->
groups() ->
[
- {proxy, [], [proxy_options,
- proxy_head,
- proxy_get,
- proxy_trace,
- proxy_post,
- proxy_put,
- proxy_delete,
- proxy_auth,
- proxy_headers,
- proxy_emulate_lower_versions,
- proxy_page_does_not_exist,
- proxy_https_not_supported]},
{ssl, [], [ssl_head,
essl_head,
ssl_get,
@@ -120,13 +104,11 @@ groups() ->
ssl_trace,
essl_trace]},
{stream, [], [http_stream,
- http_stream_once,
- proxy_stream]},
+ http_stream_once]},
{tickets, [], [hexed_query_otp_6191,
empty_body_otp_6243,
empty_response_header_otp_6830,
transfer_encoding_otp_6807,
- proxy_not_modified_otp_6821,
no_content_204_otp_6982,
missing_CR_otp_7304,
{group, otp_7883},
@@ -146,6 +128,20 @@ groups() ->
].
+init_per_group(ipv6 = _GroupName, Config) ->
+ case inets_test_lib:has_ipv6_support() of
+ {ok, _} ->
+ Config;
+ _ ->
+ {skip, "Host does not support IPv6"}
+ end;
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+
%%--------------------------------------------------------------------
%% Function: init_per_suite(Config) -> Config
%% Config - [tuple()]
@@ -156,6 +152,9 @@ groups() ->
%% variable, but should NOT alter/remove any existing entries.
%%--------------------------------------------------------------------
init_per_suite(Config) ->
+
+ ?PRINT_SYSTEM_INFO([]),
+
PrivDir = ?config(priv_dir, Config),
DataDir = ?config(data_dir, Config),
ServerRoot = filename:join(PrivDir, "server_root"),
@@ -179,10 +178,11 @@ init_per_suite(Config) ->
{ok, FileInfo} = file:read_file_info(Cgi),
ok = file:write_file_info(Cgi, FileInfo#file_info{mode = 8#00755}),
- [{server_root, ServerRoot},
- {doc_root, DocRoot},
- {local_port, ?IP_PORT},
- {local_ssl_port, ?SSL_PORT} | Config].
+ [{has_ipv6_support, inets_test_lib:has_ipv6_support()},
+ {server_root, ServerRoot},
+ {doc_root, DocRoot},
+ {local_port, ?IP_PORT},
+ {local_ssl_port, ?SSL_PORT} | Config].
%%--------------------------------------------------------------------
@@ -198,6 +198,7 @@ end_per_suite(Config) ->
application:stop(ssl),
ok.
+
%%--------------------------------------------------------------------
%% Function: init_per_testcase(Case, Config) -> Config
%% Case - atom()
@@ -229,12 +230,12 @@ init_per_testcase(initial_server_connect = Case, Config) ->
"~n ~p", [Case, App, ActualError]),
SkipString =
"Could not start " ++ atom_to_list(App),
- {skip, SkipString};
+ skip(SkipString);
_:X ->
SkipString =
lists:flatten(
io_lib:format("Failed starting apps: ~p", [X])),
- {skip, SkipString}
+ skip(SkipString)
end;
init_per_testcase(Case, Config) ->
@@ -244,6 +245,7 @@ init_per_testcase(Case, Timeout, Config) ->
io:format(user,
"~n~n*** INIT ~w:~w[~w] ***"
"~n~n", [?MODULE, Case, Timeout]),
+
PrivDir = ?config(priv_dir, Config),
application:stop(inets),
Dog = test_server:timetrap(inets_test_lib:minutes(Timeout)),
@@ -267,66 +269,6 @@ init_per_testcase(Case, Timeout, Config) ->
init_per_testcase_ssl(essl, PrivDir, SslConfFile,
[{watchdog, Dog} | TmpConfig]);
- "proxy_" ++ Rest ->
- io:format("init_per_testcase -> Rest: ~p~n", [Rest]),
- case Rest of
- "https_not_supported" ->
- tsp("init_per_testcase -> [proxy case] start inets"),
- inets:start(),
- tsp("init_per_testcase -> "
- "[proxy case] start crypto, public_key and ssl"),
- try ?ENSURE_STARTED([crypto, public_key, ssl]) of
- ok ->
- [{watchdog, Dog} | TmpConfig]
- catch
- throw:{error, {failed_starting, App, _}} ->
- SkipString =
- "Could not start " ++ atom_to_list(App),
- skip(SkipString);
- _:X ->
- SkipString =
- lists:flatten(
- io_lib:format("Failed starting apps: ~p", [X])),
- skip(SkipString)
- end;
-
- _ ->
- %% We use erlang.org for the proxy tests
- %% and after the switch to erlang-web, many
- %% of the test cases no longer work (erlang.org
- %% previously run on Apache).
- %% Until we have had time to update inets
- %% (and updated erlang.org to use that inets)
- %% and the test cases, we simply skip the
- %% problematic test cases.
- %% This is not ideal, but I am busy....
- case is_proxy_available(?PROXY, ?PROXY_PORT) of
- true ->
- BadCases =
- [
- "delete",
- "get",
- "head",
- "not_modified_otp_6821",
- "options",
- "page_does_not_exist",
- "post",
- "put",
- "stream"
- ],
- case lists:member(Rest, BadCases) of
- true ->
- [skip("TC and server not compatible") |
- TmpConfig];
- false ->
- inets:start(),
- [{watchdog, Dog} | TmpConfig]
- end;
- false ->
- [skip("proxy not responding") | TmpConfig]
- end
- end;
-
"ipv6_" ++ _Rest ->
%% Ensure needed apps (crypto, public_key and ssl) are started
try ?ENSURE_STARTED([crypto, public_key, ssl]) of
@@ -337,7 +279,8 @@ init_per_testcase(Case, Timeout, Config) ->
inets:start(httpc,
[{profile, Profile},
{data_dir, PrivDir}], stand_alone),
- httpc:set_options([{ipfamily, inet6}], ProfilePid),
+ ok = httpc:set_options([{ipfamily, inet6}],
+ ProfilePid),
tsp("httpc profile pid: ~p", [ProfilePid]),
[{watchdog, Dog}, {profile, ProfilePid}| TmpConfig]
catch
@@ -346,27 +289,60 @@ init_per_testcase(Case, Timeout, Config) ->
"~n ~p", [Case, App, ActualError]),
SkipString =
"Could not start " ++ atom_to_list(App),
- {skip, SkipString};
+ skip(SkipString);
_:X ->
SkipString =
lists:flatten(
io_lib:format("Failed starting apps: ~p", [X])),
- {skip, SkipString}
+ skip(SkipString)
end;
_ ->
+ %% Try inet6fb4 on windows...
+ %% No need? Since it is set above?
+
+ %% tsp("init_per_testcase -> allways try IPv6 on windows"),
+ %% ?RUN_ON_WINDOWS(
+ %% fun() ->
+ %% tsp("init_per_testcase:set_options_fun -> "
+ %% "set-option ipfamily to inet6fb4"),
+ %% Res = httpc:set_options([{ipfamily, inet6fb4}]),
+ %% tsp("init_per_testcase:set_options_fun -> "
+ %% "~n Res: ~p", [Res]),
+ %% Res
+ %% end),
+
TmpConfig2 = lists:keydelete(local_server, 1, TmpConfig),
%% Will start inets
+ tsp("init_per_testcase -> try start server"),
Server = start_http_server(PrivDir, IpConfFile),
[{watchdog, Dog}, {local_server, Server} | TmpConfig2]
end,
- %% This will fail for the ipv6_ - cases (but that is ok)
- ProxyExceptions = ["localhost", ?IPV6_LOCAL_HOST],
- httpc:set_options([{proxy, {{?PROXY, ?PROXY_PORT}, ProxyExceptions}}]),
+ %% <IPv6>
+ %% Set default ipfamily to the same as the main server has by default
+ %% This makes the client try w/ ipv6 before falling back to ipv4,
+ %% as that is what the server is configured to do.
+ %% Note that this is required for the tests to run on *BSD w/ ipv6 enabled
+ %% as well as on Windows. The Linux behaviour of allowing ipv4 connects
+ %% to ipv6 sockets is not required or even encouraged.
+
+ tsp("init_per_testcase -> Options before ipfamily set: ~n~p",
+ [httpc:get_options(all)]),
+ ok = httpc:set_options([{ipfamily, inet6fb4}]),
+ tsp("init_per_testcase -> Options after ipfamily set: ~n~p",
+ [httpc:get_options(all)]),
+
+ %% Note that the IPv6 test case(s) *must* use inet6,
+ %% so this value will be overwritten (see "ipv6_" below).
+ %% </IPv6>
+
inets:enable_trace(max, io, httpc),
%% inets:enable_trace(max, io, all),
%% snmp:set_trace([gen_tcp]),
+ tsp("init_per_testcase(~w) -> done when"
+ "~n NewConfig: ~p"
+ "~n~n", [Case, NewConfig]),
NewConfig.
@@ -405,6 +381,7 @@ end_per_testcase(http_save_to_file = Case, Config) ->
end_per_testcase(Case, Config) ->
io:format(user, "~n~n*** END ~w:~w ***~n~n",
[?MODULE, Case]),
+ dbg:stop(), % ?
case atom_to_list(Case) of
"ipv6_" ++ _Rest ->
tsp("end_per_testcase(~w) -> stop ssl", [Case]),
@@ -449,29 +426,39 @@ http_options(doc) ->
http_options(suite) ->
[];
http_options(Config) when is_list(Config) ->
- {skip, "Not supported by httpd"}.
+ skip("Not supported by httpd").
http_head(doc) ->
["Test http head request against local server."];
http_head(suite) ->
[];
http_head(Config) when is_list(Config) ->
- case ?config(local_server, Config) of
- ok ->
- Port = ?config(local_port, Config),
- URL = ?URL_START ++ integer_to_list(Port) ++ "/dummy.html",
- case httpc:request(head, {URL, []}, [], []) of
- {ok, {{_,200,_}, [_ | _], []}} ->
- ok;
- {ok, WrongReply} ->
- tsf({wrong_reply, WrongReply});
- Error ->
- tsf({failed, Error})
- end;
- _ ->
- {skip, "Failed to start local http-server"}
- end.
+ tsp("http_head -> entry with"
+ "~n Config: ~p", [Config]),
+ Method = head,
+ Port = ?config(local_port, Config),
+ URL = ?URL_START ++ integer_to_list(Port) ++ "/dummy.html",
+ Request = {URL, []},
+ HttpOpts = [],
+ Opts = [],
+ VerifyResult =
+ fun({ok, {{_,200,_}, [_ | _], []}}) ->
+ ok;
+ ({ok, UnexpectedReply}) ->
+ tsp("http_head:verify_fun -> Unexpected Reply: "
+ "~n ~p", [UnexpectedReply]),
+ tsf({unexpected_reply, UnexpectedReply});
+ ({error, Reason} = Error) ->
+ tsp("http_head:verify_fun -> Error reply: "
+ "~n Reason: ~p", [Reason]),
+ tsf({bad_reply, Error})
+ end,
+ simple_request_and_verify(Config,
+ Method, Request, HttpOpts, Opts, VerifyResult).
+
+
%%-------------------------------------------------------------------------
+
http_get(doc) ->
["Test http get request against local server"];
http_get(suite) ->
@@ -488,7 +475,8 @@ http_get(Config) when is_list(Config) ->
Request = {URL, []},
Timeout = timer:seconds(1),
ConnTimeout = Timeout + timer:seconds(1),
- HttpOptions1 = [{timeout, Timeout}, {connect_timeout, ConnTimeout}],
+ HttpOptions1 = [{timeout, Timeout},
+ {connect_timeout, ConnTimeout}],
Options1 = [],
Body =
case httpc:request(Method, Request, HttpOptions1, Options1) of
@@ -516,14 +504,15 @@ http_get(Config) when is_list(Config) ->
tsf({bad_reply, Error2})
end;
_ ->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
%%-------------------------------------------------------------------------
+
http_post(doc) ->
- ["Test http post request against local server. We do in this case"
- " only care about the client side of the the post. The server"
- " script will not actually use the post data."];
+ ["Test http post request against local server. We do in this case "
+ "only care about the client side of the the post. The server "
+ "script will not actually use the post data."];
http_post(suite) ->
[];
http_post(Config) when is_list(Config) ->
@@ -551,7 +540,7 @@ http_post(Config) when is_list(Config) ->
httpc:request(post, {URL, [{"expect","100-continue"}],
"text/plain", "foobar"}, [], []);
_ ->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
%%-------------------------------------------------------------------------
@@ -597,7 +586,7 @@ http_post_streaming(Config) when is_list(Config) ->
"text/plain", {BodyFun, 10}}, [], []);
_ ->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
@@ -621,7 +610,7 @@ http_emulate_lower_versions(Config) when is_list(Config) ->
httpc:request(get, {URL, []}, [{version, "HTTP/1.1"}], []),
inets_test_lib:check_body(Body2);
_->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
@@ -682,124 +671,166 @@ http_inets_pipe(Config) when is_list(Config) ->
URL = ?URL_START ++ integer_to_list(Port) ++ "/dummy.html",
test_pipeline(URL);
_ ->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
test_pipeline(URL) ->
- p("test_pipeline -> entry with"
- "~n URL: ~p", [URL]),
-
- httpc:set_options([{pipeline_timeout, 50000}]),
-
- p("test_pipeline -> issue (async) request 1"),
- {ok, RequestId1} =
+ p("test_pipeline -> entry with"
+ "~n URL: ~p", [URL]),
+
+ httpc:set_options([{pipeline_timeout, 50000}]),
+
+ p("test_pipeline -> issue (async) request 1"
+ "~n when profile info: ~p", [httpc:info()]),
+ {ok, RequestIdA1} =
httpc:request(get, {URL, []}, [], [{sync, false}]),
- test_server:format("RequestId1: ~p~n", [RequestId1]),
- p("test_pipeline -> RequestId1: ~p", [RequestId1]),
-
- %% Make sure pipeline is initiated
- p("test_pipeline -> sleep some", []),
- test_server:sleep(4000),
-
- p("test_pipeline -> issue (async) request 2"),
- {ok, RequestId2} =
+ tsp("RequestIdA1: ~p", [RequestIdA1]),
+ p("test_pipeline -> RequestIdA1: ~p"
+ "~n when profile info: ~p", [RequestIdA1, httpc:info()]),
+
+ %% Make sure pipeline is initiated
+ p("test_pipeline -> sleep some", []),
+ test_server:sleep(4000),
+
+ p("test_pipeline -> issue (async) request A2, A3 and A4"
+ "~n when profile info: ~p", [httpc:info()]),
+ {ok, RequestIdA2} =
httpc:request(get, {URL, []}, [], [{sync, false}]),
- tsp("RequestId2: ~p", [RequestId2]),
- p("test_pipeline -> RequestId2: ~p", [RequestId2]),
-
- p("test_pipeline -> issue (sync) request 3"),
- {ok, {{_,200,_}, [_ | _], [_ | _]}} =
+ {ok, RequestIdA3} =
+ httpc:request(get, {URL, []}, [], [{sync, false}]),
+ {ok, RequestIdA4} =
+ httpc:request(get, {URL, []}, [], [{sync, false}]),
+ tsp("RequestIdAs => A2: ~p, A3: ~p and A4: ~p",
+ [RequestIdA2, RequestIdA3, RequestIdA4]),
+ p("test_pipeline -> RequestIds => A2: ~p, A3: ~p and A4: ~p"
+ "~n when profile info: ~p",
+ [RequestIdA2, RequestIdA3, RequestIdA4, httpc:info()]),
+
+ p("test_pipeline -> issue (sync) request 3"),
+ {ok, {{_,200,_}, [_ | _], [_ | _]}} =
httpc:request(get, {URL, []}, [], []),
+
+ p("test_pipeline -> expect reply for (async) request A1, A2, A3 and A4"
+ "~n when profile info: ~p", [httpc:info()]),
+ pipeline_await_async_reply([{RequestIdA1, a1, 200},
+ {RequestIdA2, a2, 200},
+ {RequestIdA3, a3, 200},
+ {RequestIdA4, a4, 200}], ?MINS(1)),
- p("test_pipeline -> expect reply for (async) request 1 or 2"),
- receive
- {http, {RequestId1, {{_, 200, _}, _, _}}} ->
- p("test_pipeline -> received reply for (async) request 1 - now wait for 2"),
- receive
- {http, {RequestId2, {{_, 200, _}, _, _}}} ->
- p("test_pipeline -> received reply for (async) request 2"),
- ok;
- {http, Msg1} ->
- tsf(Msg1)
- end;
- {http, {RequestId2, {{_, 200, _}, _, _}}} ->
- io:format("test_pipeline -> received reply for (async) request 2 - now wait for 1"),
- receive
- {http, {RequestId1, {{_, 200, _}, _, _}}} ->
- io:format("test_pipeline -> received reply for (async) request 1"),
- ok;
- {http, Msg2} ->
- tsf(Msg2)
- end;
- {http, Msg3} ->
- tsf(Msg3)
- after 60000 ->
- receive Any1 ->
- tsp("received crap after timeout: ~n ~p", [Any1]),
- tsf({error, {timeout, Any1}})
- end
- end,
-
- p("test_pipeline -> sleep some"),
- test_server:sleep(4000),
-
- p("test_pipeline -> issue (async) request 4"),
- {ok, RequestId3} =
+ p("test_pipeline -> sleep some"
+ "~n when profile info: ~p", [httpc:info()]),
+ test_server:sleep(4000),
+
+ p("test_pipeline -> issue (async) request B1, B2, B3 and B4"
+ "~n when profile info: ~p", [httpc:info()]),
+ {ok, RequestIdB1} =
httpc:request(get, {URL, []}, [], [{sync, false}]),
- tsp("RequestId3: ~p", [RequestId3]),
- p("test_pipeline -> RequestId3: ~p", [RequestId3]),
-
- p("test_pipeline -> issue (async) request 5"),
- {ok, RequestId4} =
+ {ok, RequestIdB2} =
httpc:request(get, {URL, []}, [], [{sync, false}]),
- tsp("RequestId4: ~p~n", [RequestId4]),
- p("test_pipeline -> RequestId4: ~p", [RequestId4]),
-
- p("test_pipeline -> cancel (async) request 4"),
- ok = httpc:cancel_request(RequestId3),
-
- p("test_pipeline -> expect *no* reply for cancelled (async) request 4 (for 3 secs)"),
- receive
- {http, {RequestId3, _}} ->
- tsf(http_cancel_request_failed)
- after 3000 ->
- ok
- end,
-
- p("test_pipeline -> expect reply for (async) request 4"),
- Body =
- receive
- {http, {RequestId4, {{_, 200, _}, _, BinBody4}}} = Res ->
- p("test_pipeline -> received reply for (async) request 5"),
- tsp("Receive : ~p", [Res]),
- BinBody4;
- {http, Msg4} ->
- tsf(Msg4)
- after 60000 ->
- receive Any2 ->
- tsp("received crap after timeout: ~n ~p", [Any2]),
- tsf({error, {timeout, Any2}})
- end
- end,
+ {ok, RequestIdB3} =
+ httpc:request(get, {URL, []}, [], [{sync, false}]),
+ {ok, RequestIdB4} =
+ httpc:request(get, {URL, []}, [], [{sync, false}]),
+ tsp("RequestIdBs => B1: ~p, B2: ~p, B3: ~p and B4: ~p",
+ [RequestIdB1, RequestIdB2, RequestIdB3, RequestIdB4]),
+ p("test_pipeline -> RequestIdBs => B1: ~p, B2: ~p, B3: ~p and B4: ~p"
+ "~n when profile info: ~p",
+ [RequestIdB1, RequestIdB2, RequestIdB3, RequestIdB4, httpc:info()]),
+
+ p("test_pipeline -> cancel (async) request B2"
+ "~n when profile info: ~p", [httpc:info()]),
+ ok = httpc:cancel_request(RequestIdB2),
+
+ p("test_pipeline -> "
+ "expect *no* reply for cancelled (async) request B2 (for 3 secs)"
+ "~n when profile info: ~p", [httpc:info()]),
+ receive
+ {http, {RequestIdB2, _}} ->
+ tsf(http_cancel_request_failed)
+ after 3000 ->
+ ok
+ end,
+
+ p("test_pipeline -> expect reply for (async) request B1, B3 and B4"
+ "~n when profile info: ~p", [httpc:info()]),
+ Bodies = pipeline_await_async_reply([{RequestIdB1, b1, 200},
+ {RequestIdB3, b3, 200},
+ {RequestIdB4, b4, 200}], ?MINS(1)),
+ [{b1, Body}|_] = Bodies,
- p("test_pipeline -> check reply for (async) request 5"),
+ p("test_pipeline -> check reply for (async) request B1"
+ "~n when profile info: ~p", [httpc:info()]),
inets_test_lib:check_body(binary_to_list(Body)),
-
- p("test_pipeline -> ensure no unexpected incomming"),
+
+ p("test_pipeline -> ensure no unexpected incomming"
+ "~n when profile info: ~p", [httpc:info()]),
receive
{http, Any} ->
tsf({unexpected_message, Any})
after 500 ->
ok
end,
-
- p("test_pipeline -> done"),
+
+ p("test_pipeline -> done"
+ "~n when profile info: ~p", [httpc:info()]),
ok.
+pipeline_await_async_reply(ReqIds, Timeout) ->
+ pipeline_await_async_reply(ReqIds, Timeout, []).
+
+pipeline_await_async_reply([], _, Acc) ->
+ lists:keysort(1, Acc);
+pipeline_await_async_reply(ReqIds, Timeout, Acc) when Timeout > 0 ->
+ T1 = inets_test_lib:timestamp(),
+ p("pipeline_await_async_reply -> await replies"
+ "~n ReqIds: ~p"
+ "~n Timeout: ~p", [ReqIds, Timeout]),
+ receive
+ {http, {RequestId, {{_, Status, _}, _, Body}}} ->
+ p("pipeline_await_async_reply -> received reply for"
+ "~n RequestId: ~p"
+ "~n Status: ~p", [RequestId, Status]),
+ case lists:keysearch(RequestId, 1, ReqIds) of
+ {value, {RequestId, N, Status}} ->
+ p("pipeline_await_async_reply -> "
+ "found expected request ~w", [N]),
+ ReqIds2 = lists:keydelete(RequestId, 1, ReqIds),
+ NewTimeout = Timeout - (inets_test_lib:timestamp()-T1),
+ pipeline_await_async_reply(ReqIds2, NewTimeout,
+ [{N, Body} | Acc]);
+ {value, {RequestId, N, WrongStatus}} ->
+ p("pipeline_await_async_reply -> "
+ "found request ~w with wrong status", [N]),
+ tsf({reply_with_unexpected_status,
+ {RequestId, N, WrongStatus}});
+ false ->
+ tsf({unexpected_reply, {RequestId, Status}})
+ end;
+ {http, Msg} ->
+ tsf({unexpected_reply, Msg})
+ after Timeout ->
+ receive
+ Any ->
+ tsp("pipeline_await_async_reply -> "
+ "received unknown data after timeout: "
+ "~n ~p", [Any]),
+ tsf({timeout, {unknown, Any}})
+ end
+ end;
+pipeline_await_async_reply(ReqIds, _, Acc) ->
+ tsp("pipeline_await_async_reply -> "
+ "timeout: "
+ "~n ~p"
+ "~nwhen"
+ "~n ~p", [ReqIds, Acc]),
+ tsf({timeout, ReqIds, Acc}).
+
+
+
%%-------------------------------------------------------------------------
http_trace(doc) ->
- ["Perform a TRACE request that goes through a proxy."];
+ ["Perform a TRACE request."];
http_trace(suite) ->
[];
http_trace(Config) when is_list(Config) ->
@@ -818,7 +849,7 @@ http_trace(Config) when is_list(Config) ->
tsf({failed, Error})
end;
_ ->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
%%-------------------------------------------------------------------------
http_async(doc) ->
@@ -853,7 +884,7 @@ http_async(Config) when is_list(Config) ->
ok
end;
_ ->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
%%-------------------------------------------------------------------------
@@ -874,7 +905,7 @@ http_save_to_file(Config) when is_list(Config) ->
{ok, {{_,200,_}, [_ | _], Body}} = httpc:request(URL),
Bin == Body;
_ ->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
@@ -904,7 +935,7 @@ http_save_to_file_async(Config) when is_list(Config) ->
{ok, {{_,200,_}, [_ | _], Body}} = httpc:request(URL),
Bin == Body;
_ ->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
%%-------------------------------------------------------------------------
http_headers(doc) ->
@@ -961,7 +992,7 @@ http_headers(Config) when is_list(Config) ->
]}, [], []),
ok;
_ ->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
%%-------------------------------------------------------------------------
@@ -1096,9 +1127,9 @@ ssl_head(SslTag, Config) ->
{ok, {{_,200, _}, [_ | _], []}} =
httpc:request(head, {URL, []}, [{ssl, SSLConfig}], []);
{ok, _} ->
- {skip, "local http-server not started"};
+ skip("local http-server not started");
_ ->
- {skip, "SSL not started"}
+ skip("SSL not started")
end.
@@ -1136,13 +1167,24 @@ ssl_get(SslTag, Config) when is_list(Config) ->
"~n URL: ~p"
"~n SslTag: ~p"
"~n SSLOptions: ~p", [URL, SslTag, SSLOptions]),
- {ok, {{_,200, _}, [_ | _], Body = [_ | _]}} =
- httpc:request(get, {URL, []}, [{ssl, SSLConfig}], []),
- inets_test_lib:check_body(Body);
+ case httpc:request(get, {URL, []}, [{ssl, SSLConfig}], []) of
+ {ok, {{_,200, _}, [_ | _], Body = [_ | _]}} ->
+ inets_test_lib:check_body(Body),
+ ok;
+ {ok, {StatusLine, Headers, _Body}} ->
+ tsp("ssl_get -> unexpected result: "
+ "~n StatusLine: ~p"
+ "~n Headers: ~p", [StatusLine, Headers]),
+ tsf({unexpected_response, StatusLine, Headers});
+ {error, Reason} ->
+ tsp("ssl_get -> request failed: "
+ "~n Reason: ~p", [Reason]),
+ tsf({request_failed, Reason})
+ end;
{ok, _} ->
- {skip, "local http-server not started"};
+ skip("local http-server not started");
_ ->
- {skip, "SSL not started"}
+ skip("SSL not started")
end.
@@ -1191,9 +1233,9 @@ ssl_trace(SslTag, Config) when is_list(Config) ->
tsf({failed, Error})
end;
{ok, _} ->
- {skip, "local http-server not started"};
+ skip("local http-server not started");
_ ->
- {skip, "SSL not started"}
+ skip("SSL not started")
end.
@@ -1208,8 +1250,8 @@ http_redirect(Config) when is_list(Config) ->
"~n Config: ~p", [Config]),
case ?config(local_server, Config) of
ok ->
- tsp("http_redirect -> set ipfamily option to inet"),
- ok = httpc:set_options([{ipfamily, inet}]),
+ %% tsp("http_redirect -> set ipfamily option to inet"),
+ %% ok = httpc:set_options([{ipfamily, inet}]),
tsp("http_redirect -> start dummy server inet"),
{DummyServerPid, Port} = dummy_server(ipv4),
@@ -1312,7 +1354,7 @@ http_redirect(Config) when is_list(Config) ->
ok;
_ ->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
@@ -1427,258 +1469,6 @@ http_cookie(Config) when is_list(Config) ->
ok.
%%-------------------------------------------------------------------------
-proxy_options(doc) ->
- ["Perform a OPTIONS request that goes through a proxy."];
-proxy_options(suite) ->
- [];
-proxy_options(Config) when is_list(Config) ->
- %% As of 2011-03-24, erlang.org (which is used as server)
- %% does no longer run Apache, but instead runs inets, which
- %% do not implement "options".
- case ?config(skip, Config) of
- undefined ->
- case httpc:request(options, {?PROXY_URL, []}, [], []) of
- {ok, {{_,200,_}, Headers, _}} ->
- case lists:keysearch("allow", 1, Headers) of
- {value, {"allow", _}} ->
- ok;
- _ ->
- tsf(http_options_request_failed)
- end;
- Unexpected ->
- tsf({unexpected_result, Unexpected})
- end;
- Reason ->
- {skip, Reason}
- end.
-
-
-%%-------------------------------------------------------------------------
-proxy_head(doc) ->
- ["Perform a HEAD request that goes through a proxy."];
-proxy_head(suite) ->
- [];
-proxy_head(Config) when is_list(Config) ->
- %% As of 2011-03-24, erlang.org (which is used as server)
- %% does no longer run Apache, but instead runs inets.
- case ?config(skip, Config) of
- undefined ->
- case httpc:request(head, {?PROXY_URL, []}, [], []) of
- {ok, {{_,200, _}, [_ | _], []}} ->
- ok;
- Unexpected ->
- tsf({unexpected_result, Unexpected})
- end;
- Reason ->
- {skip, Reason}
- end.
-
-
-%%-------------------------------------------------------------------------
-proxy_get(doc) ->
- ["Perform a GET request that goes through a proxy."];
-proxy_get(suite) ->
- [];
-proxy_get(Config) when is_list(Config) ->
- case ?config(skip, Config) of
- undefined ->
- case httpc:request(get, {?PROXY_URL, []}, [], []) of
- {ok, {{_,200,_}, [_ | _], Body = [_ | _]}} ->
- inets_test_lib:check_body(Body);
- Unexpected ->
- tsf({unexpected_result, Unexpected})
- end;
- Reason ->
- {skip, Reason}
- end.
-
-%%-------------------------------------------------------------------------
-proxy_emulate_lower_versions(doc) ->
- ["Perform requests as 0.9 and 1.0 clients."];
-proxy_emulate_lower_versions(suite) ->
- [];
-proxy_emulate_lower_versions(Config) when is_list(Config) ->
- case ?config(skip, Config) of
- undefined ->
- Result09 = pelv_get("HTTP/0.9"),
- case Result09 of
- {ok, [_| _] = Body0} ->
- inets_test_lib:check_body(Body0),
- ok;
- _ ->
- tsf({unexpected_result, "HTTP/0.9", Result09})
- end,
-
- %% We do not check the version here as many servers
- %% do not behave according to the rfc and send
- %% 1.1 in its response.
- Result10 = pelv_get("HTTP/1.0"),
- case Result10 of
- {ok,{{_, 200, _}, [_ | _], Body1 = [_ | _]}} ->
- inets_test_lib:check_body(Body1),
- ok;
- _ ->
- tsf({unexpected_result, "HTTP/1.0", Result10})
- end,
-
- Result11 = pelv_get("HTTP/1.1"),
- case Result11 of
- {ok, {{"HTTP/1.1", 200, _}, [_ | _], Body2 = [_ | _]}} ->
- inets_test_lib:check_body(Body2);
- _ ->
- tsf({unexpected_result, "HTTP/1.1", Result11})
- end;
-
- Reason ->
- {skip, Reason}
- end.
-
-pelv_get(Version) ->
- httpc:request(get, {?PROXY_URL, []}, [{version, Version}], []).
-
-%%-------------------------------------------------------------------------
-proxy_trace(doc) ->
- ["Perform a TRACE request that goes through a proxy."];
-proxy_trace(suite) ->
- [];
-proxy_trace(Config) when is_list(Config) ->
- %%{ok, {{_,200,_}, [_ | _], "TRACE " ++ _}} =
- %% httpc:request(trace, {?PROXY_URL, []}, [], []),
- {skip, "HTTP TRACE is no longer allowed on the ?PROXY_URL server due "
- "to security reasons"}.
-
-
-%%-------------------------------------------------------------------------
-proxy_post(doc) ->
- ["Perform a POST request that goes through a proxy. Note the server"
- " will reject the request this is a test of the sending of the"
- " request."];
-proxy_post(suite) ->
- [];
-proxy_post(Config) when is_list(Config) ->
- %% As of 2011-03-24, erlang.org (which is used as server)
- %% does no longer run Apache, but instead runs inets.
- case ?config(skip, Config) of
- undefined ->
- case httpc:request(post, {?PROXY_URL, [],
- "text/plain", "foobar"}, [],[]) of
- {ok, {{_,405,_}, [_ | _], [_ | _]}} ->
- ok;
- Unexpected ->
- tsf({unexpected_result, Unexpected})
- end;
- Reason ->
- {skip, Reason}
- end.
-
-
-%%-------------------------------------------------------------------------
-proxy_put(doc) ->
- ["Perform a PUT request that goes through a proxy. Note the server"
- " will reject the request this is a test of the sending of the"
- " request."];
-proxy_put(suite) ->
- [];
-proxy_put(Config) when is_list(Config) ->
- %% As of 2011-03-24, erlang.org (which is used as server)
- %% does no longer run Apache, but instead runs inets.
- case ?config(skip, Config) of
- undefined ->
- case httpc:request(put, {"http://www.erlang.org/foobar.html", [],
- "html", "<html> <body><h1> foo </h1>"
- "<p>bar</p> </body></html>"}, [], []) of
- {ok, {{_,405,_}, [_ | _], [_ | _]}} ->
- ok;
- Unexpected ->
- tsf({unexpected_result, Unexpected})
- end;
- Reason ->
- {skip, Reason}
- end.
-
-
-%%-------------------------------------------------------------------------
-proxy_delete(doc) ->
- ["Perform a DELETE request that goes through a proxy. Note the server"
- " will reject the request this is a test of the sending of the"
- " request. But as the file does not exist the return code will"
- " be 404 not found."];
-proxy_delete(suite) ->
- [];
-proxy_delete(Config) when is_list(Config) ->
- %% As of 2011-03-24, erlang.org (which is used as server)
- %% does no longer run Apache, but instead runs inets.
- case ?config(skip, Config) of
- undefined ->
- URL = ?PROXY_URL ++ "/foobar.html",
- case httpc:request(delete, {URL, []}, [], []) of
- {ok, {{_,404,_}, [_ | _], [_ | _]}} ->
- ok;
- Unexpected ->
- tsf({unexpected_result, Unexpected})
- end;
- Reason ->
- {skip, Reason}
- end.
-
-
-%%-------------------------------------------------------------------------
-proxy_headers(doc) ->
- ["Use as many request headers as possible"];
-proxy_headers(suite) ->
- [];
-proxy_headers(Config) when is_list(Config) ->
- case ?config(skip, Config) of
- undefined ->
- {ok, {{_,200,_}, [_ | _], [_ | _]}}
- = httpc:request(get, {?PROXY_URL,
- [
- {"Accept",
- "text/*, text/html,"
- " text/html;level=1,"
- " */*"},
- {"Accept-Charset",
- "iso-8859-5, unicode-1-1;"
- "q=0.8"},
- {"Accept-Encoding", "*"},
- {"Accept-Language",
- "sv, en-gb;q=0.8,"
- " en;q=0.7"},
- {"User-Agent", "inets"},
- {"Max-Forwards","5"},
- {"Referer",
- "http://otp.ericsson.se:8000"
- "/product/internal"}
- ]}, [], []),
- ok;
- Reason ->
- {skip, Reason}
- end.
-
-%%-------------------------------------------------------------------------
-proxy_auth(doc) ->
- ["Test the code for sending of proxy authorization."];
-proxy_auth(suite) ->
- [];
-proxy_auth(Config) when is_list(Config) ->
- %% Our proxy seems to ignore the header, however our proxy
- %% does not requirer an auth header, but we want to know
- %% atleast the code for sending the header does not crash!
- case ?config(skip, Config) of
- undefined ->
- case httpc:request(get, {?PROXY_URL, []},
- [{proxy_auth, {"foo", "bar"}}], []) of
- {ok, {{_,200, _}, [_ | _], [_|_]}} ->
- ok;
- Unexpected ->
- tsf({unexpected_result, Unexpected})
- end;
- Reason ->
- {skip, Reason}
- end.
-
-
-%%-------------------------------------------------------------------------
http_server_does_not_exist(doc) ->
["Test that we get an error message back when the server "
"does note exist."];
@@ -1706,38 +1496,6 @@ page_does_not_exist(Config) when is_list(Config) ->
%%-------------------------------------------------------------------------
-proxy_page_does_not_exist(doc) ->
- ["Test that we get a 404 when the page is not found."];
-proxy_page_does_not_exist(suite) ->
- [];
-proxy_page_does_not_exist(Config) when is_list(Config) ->
- case ?config(skip, Config) of
- undefined ->
- URL = ?PROXY_URL ++ "/doesnotexist.html",
- {ok, {{_,404,_}, [_ | _], [_ | _]}} =
- httpc:request(get, {URL, []}, [], []),
- ok;
- Reason ->
- {skip, Reason}
- end.
-
-
-%%-------------------------------------------------------------------------
-
-proxy_https_not_supported(doc) ->
- [];
-proxy_https_not_supported(suite) ->
- [];
-proxy_https_not_supported(Config) when is_list(Config) ->
- Result = httpc:request(get, {"https://login.yahoo.com", []}, [], []),
- case Result of
- {error, https_through_proxy_is_not_currently_supported} ->
- ok;
- _ ->
- tsf({unexpected_reason, Result})
- end.
-
-%%-------------------------------------------------------------------------
http_stream(doc) ->
["Test the option stream for asynchrony requests"];
@@ -1838,36 +1596,6 @@ once(URL) ->
%%-------------------------------------------------------------------------
-proxy_stream(doc) ->
- ["Test the option stream for asynchrony requests"];
-proxy_stream(suite) ->
- [];
-proxy_stream(Config) when is_list(Config) ->
- case ?config(skip, Config) of
- undefined ->
- {ok, {{_,200,_}, [_ | _], Body}} =
- httpc:request(get, {?PROXY_URL, []}, [], []),
-
- {ok, RequestId} =
- httpc:request(get, {?PROXY_URL, []}, [],
- [{sync, false}, {stream, self}]),
-
- receive
- {http, {RequestId, stream_start, _Headers}} ->
- ok;
- {http, Msg} ->
- tsf(Msg)
- end,
-
- StreamedBody = receive_streamed_body(RequestId, <<>>),
-
- Body == binary_to_list(StreamedBody);
- Reason ->
- {skip, Reason}
- end.
-
-
-%%-------------------------------------------------------------------------
parse_url(doc) ->
["Test that an url is parsed correctly"];
parse_url(suite) ->
@@ -1886,7 +1614,7 @@ parse_url(Config) when is_list(Config) ->
http_uri:parse("http://[2010:836B:4179::836B:4179]/foobar.html",
[{foo, false}]),
{error,
- {malformed_url,"http://2010:836B:4179::836B:4179/foobar.html"}} =
+ {malformed_url, _, "http://2010:836B:4179::836B:4179/foobar.html"}} =
http_uri:parse("http://2010:836B:4179::836B:4179/foobar.html"),
%% ipv4
@@ -1902,8 +1630,8 @@ parse_url(Config) when is_list(Config) ->
http_uri:parse("http://nisse:foobar@localhost:8888/foobar.html"),
%% Scheme error
- {error,no_scheme} = http_uri:parse("localhost/foobar.html"),
- {error,{not_supported_scheme,localhost}} =
+ {error, no_scheme} = http_uri:parse("localhost/foobar.html"),
+ {error, {malformed_url, _, _}} =
http_uri:parse("localhost:8888/foobar.html"),
%% Query
@@ -1966,7 +1694,7 @@ ipv6_essl(Config) when is_list(Config) ->
ipv6(SocketType, Scheme, HTTPOptions, Extra, Config) ->
%% Check if we are a IPv6 host
- tsp("ipv6 -> verify ipv6 support", []),
+ tsp("ipv6 -> verify ipv6 support"),
case inets_test_lib:has_ipv6_support(Config) of
{ok, Addr} ->
tsp("ipv6 -> ipv6 supported: ~p", [Addr]),
@@ -1997,8 +1725,8 @@ ipv6(SocketType, Scheme, HTTPOptions, Extra, Config) ->
end,
ok;
_ ->
- tsp("ipv6 -> ipv6 not supported", []),
- {skip, "Host does not support IPv6"}
+ tsp("ipv6 -> ipv6 not supported"),
+ skip("Host does not support IPv6")
end.
@@ -2355,7 +2083,7 @@ options(Config) when is_list(Config) ->
= httpc:request(get, {URL, []}, [{timeout, infinity}],
[{full_result, false}]);
_ ->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
@@ -2459,21 +2187,6 @@ transfer_encoding_otp_6807(Config) when is_list(Config) ->
%%-------------------------------------------------------------------------
-proxy_not_modified_otp_6821(doc) ->
- ["If unmodified no body should be returned"];
-proxy_not_modified_otp_6821(suite) ->
- [];
-proxy_not_modified_otp_6821(Config) when is_list(Config) ->
- case ?config(skip, Config) of
- undefined ->
- provocate_not_modified_bug(?PROXY_URL);
- Reason ->
- {skip, Reason}
- end.
-
-
-%%-------------------------------------------------------------------------
-
empty_response_header_otp_6830(doc) ->
["Test the case that the HTTP server does not send any headers"];
empty_response_header_otp_6830(suite) ->
@@ -2870,7 +2583,7 @@ otp_8106_pid(Config) when is_list(Config) ->
ok;
_ ->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
@@ -2890,7 +2603,7 @@ otp_8106_fun(Config) when is_list(Config) ->
ok;
_ ->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
@@ -2910,7 +2623,7 @@ otp_8106_mfa(Config) when is_list(Config) ->
ok;
_ ->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
@@ -3059,7 +2772,7 @@ otp_8352(Config) when is_list(Config) ->
ok;
_ ->
- {skip, "Failed to start local http-server"}
+ skip("Failed to start local http-server")
end.
@@ -3254,7 +2967,11 @@ create_config(FileName, ComType, Port, PrivDir, ServerRoot, DocRoot,
" mod_include mod_dir mod_get mod_head"
" mod_log mod_disk_log mod_trace",
+ %% BindAddress = "*|inet", % Force the use of IPv4
+ BindAddress = "*", % This corresponds to using IpFamily inet6fb4
+
HttpConfig = [
+ cline(["BindAddress ", BindAddress]),
cline(["Port ", integer_to_list(Port)]),
cline(["ServerName ", "httpc_test"]),
cline(["SocketType ", atom_to_list(ComType)]),
@@ -3276,15 +2993,6 @@ create_config(FileName, ComType, Port, PrivDir, ServerRoot, DocRoot,
cline(List) ->
lists:flatten([List, "\r\n"]).
-is_proxy_available(Proxy, Port) ->
- case gen_tcp:connect(Proxy, Port, []) of
- {ok, Socket} ->
- gen_tcp:close(Socket),
- true;
- _ ->
- false
- end.
-
receive_streamed_body(RequestId, Body) ->
receive
{http, {RequestId, stream, BinBodyPart}} ->
@@ -3778,40 +3486,32 @@ content_length(["content-length:" ++ Value | _]) ->
content_length([_Head | Tail]) ->
content_length(Tail).
-provocate_not_modified_bug(Url) ->
- Timeout = 15000, %% 15s should be plenty
-
- {ok, {{_, 200, _}, ReplyHeaders, _Body}} =
- httpc:request(get, {Url, []}, [{timeout, Timeout}], []),
- Etag = pick_header(ReplyHeaders, "ETag"),
- Last = pick_header(ReplyHeaders, "last-modified"),
-
- case httpc:request(get, {Url, [{"If-None-Match", Etag},
- {"If-Modified-Since", Last}]},
- [{timeout, 15000}],
- []) of
- {ok, {{_, 304, _}, _, _}} -> %% The expected reply
- page_unchanged;
- {ok, {{_, 200, _}, _, _}} ->
- %% If the page has changed since the
- %% last request we retry to
- %% trigger the bug
- provocate_not_modified_bug(Url);
- {error, timeout} ->
- %% Not what we expected. Tcpdump can be used to
- %% verify that we receive the complete http-reply
- %% but still time out.
- incorrect_result
+%% -------------------------------------------------------------------------
+
+simple_request_and_verify(Config,
+ Method, Request, HttpOpts, Opts, VerifyResult)
+ when (is_list(Config) andalso
+ is_atom(Method) andalso
+ is_list(HttpOpts) andalso
+ is_list(Opts) andalso
+ is_function(VerifyResult, 1)) ->
+ tsp("request_and_verify -> entry with"
+ "~n Method: ~p"
+ "~n Request: ~p"
+ "~n HttpOpts: ~p"
+ "~n Opts: ~p", [Method, Request, HttpOpts, Opts]),
+ case ?config(local_server, Config) of
+ ok ->
+ tsp("request_and_verify -> local-server running"),
+ Result = (catch httpc:request(Method, Request, HttpOpts, Opts)),
+ VerifyResult(Result);
+ _ ->
+ tsp("request_and_verify -> local-server *not* running - skip"),
+ hard_skip("Local http-server not running")
end.
-pick_header(Headers, Name) ->
- case lists:keysearch(string:to_lower(Name), 1,
- [{string:to_lower(X), Y} || {X, Y} <- Headers]) of
- false ->
- [];
- {value, {_Key, Val}} ->
- Val
- end.
+
+
not_implemented_yet() ->
exit(not_implemented_yet).
@@ -3823,9 +3523,9 @@ p(F, A) ->
io:format("~p ~w:" ++ F ++ "~n", [self(), ?MODULE | A]).
tsp(F) ->
- inets_test_lib:tsp(F).
+ inets_test_lib:tsp("[~w]" ++ F, [?MODULE]).
tsp(F, A) ->
- inets_test_lib:tsp(F, A).
+ inets_test_lib:tsp("[~w]" ++ F, [?MODULE|A]).
tsf(Reason) ->
test_server:fail(Reason).
@@ -3864,6 +3564,8 @@ dummy_ssl_server_hang_loop(_) ->
ok
end.
+hard_skip(Reason) ->
+ throw(skip(Reason)).
skip(Reason) ->
{skip, Reason}.
diff --git a/lib/inets/test/httpc_proxy_SUITE.erl b/lib/inets/test/httpc_proxy_SUITE.erl
new file mode 100644
index 0000000000..84db39e76b
--- /dev/null
+++ b/lib/inets/test/httpc_proxy_SUITE.erl
@@ -0,0 +1,575 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+%%
+
+%%
+%% ts:run(inets, httpc_proxy_SUITE, [batch]).
+%% ct:run("../inets_test", httpc_proxy_SUITE).
+%%
+
+-module(httpc_proxy_SUITE).
+
+-include_lib("common_test/include/ct.hrl").
+
+-include_lib("kernel/include/file.hrl").
+-include("inets_test_lib.hrl").
+
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+
+-define(LOCAL_PROXY_SCRIPT, "server_proxy.sh").
+-define(p(F, A), % Debug printout
+ begin
+ io:format(
+ "~w ~w: " ++ begin F end,
+ [self(),?MODULE] ++ begin A end)
+ end).
+
+%%--------------------------------------------------------------------
+%% Common Test interface functions -----------------------------------
+%%--------------------------------------------------------------------
+
+suite() ->
+ [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [{group,local_proxy},
+ {group,local_proxy_https}].
+
+groups() ->
+ [{local_proxy,[],
+ [http_emulate_lower_versions
+ |local_proxy_cases()]},
+ {local_proxy_https,[],
+ local_proxy_cases()}].
+
+%% internal functions
+
+local_proxy_cases() ->
+ [http_head,
+ http_get,
+ http_options,
+ http_trace,
+ http_post,
+ http_put,
+ http_delete,
+ http_headers,
+ http_proxy_auth,
+ http_doesnotexist,
+ http_stream,
+ http_not_modified_otp_6821].
+
+%%--------------------------------------------------------------------
+
+init_per_suite(Config0) ->
+ case init_apps([crypto,public_key], Config0) of
+ Config when is_list(Config) ->
+ make_cert_files(dsa, "server-", Config),
+ Config;
+ Other ->
+ Other
+ end.
+
+end_per_suite(_Config) ->
+ [app_stop(App) || App <- r(suite_apps())],
+ ok.
+
+%% internal functions
+
+suite_apps() ->
+ [crypto,public_key].
+
+%%--------------------------------------------------------------------
+
+init_per_group(local_proxy, Config) ->
+ init_local_proxy([{protocol,http}|Config]);
+init_per_group(local_proxy_https, Config) ->
+ init_local_proxy([{protocol,https}|Config]).
+
+end_per_group(Group, Config)
+ when
+ Group =:= local_proxy;
+ Group =:= local_proxy_https ->
+ rcmd_local_proxy(["stop"], Config),
+ Config;
+end_per_group(_, Config) ->
+ Config.
+
+%%--------------------------------------------------------------------
+
+init_per_testcase(Case, Config0) ->
+ ct:timetrap({seconds,30}),
+ Apps = apps(Case, Config0),
+ case init_apps(Apps, Config0) of
+ Config when is_list(Config) ->
+ case app_start(inets, Config) of
+ ok ->
+ Config;
+ Error ->
+ [app_stop(N) || N <- [inets|r(Apps)]],
+ ct:fail({could_not_init_inets,Error})
+ end;
+ E3 ->
+ E3
+ end.
+
+end_per_testcase(_Case, Config) ->
+ app_stop(inets),
+ Config.
+
+%% internal functions
+
+apps(_Case, Config) ->
+ case ?config(protocol, Config) of
+ https ->
+ [ssl];
+ _ ->
+ []
+ end.
+
+%%--------------------------------------------------------------------
+%% Test Cases --------------------------------------------------------
+%%--------------------------------------------------------------------
+
+http_head(doc) ->
+ ["Test http/https HEAD request."];
+http_head(Config) when is_list(Config) ->
+ Method = head,
+ URL = url("/index.html", Config),
+ Request = {URL,[]},
+ HttpOpts = [],
+ Opts = [],
+ {ok,{{_,200,_},[_|_],[]}} =
+ httpc:request(Method, Request, HttpOpts, Opts),
+ ok.
+
+%%--------------------------------------------------------------------
+
+http_get(doc) ->
+ ["Test http/https GET request."];
+http_get(Config) when is_list(Config) ->
+ Method = get,
+ URL = url("/index.html", Config),
+ Request = {URL,[]},
+ Timeout = timer:seconds(1),
+ ConnTimeout = Timeout + timer:seconds(1),
+
+ HttpOpts1 = [{timeout,Timeout},{connect_timeout,ConnTimeout}],
+ Opts1 = [],
+ {ok,{{_,200,_},[_|_],[_|_]=B1}} =
+ httpc:request(Method, Request, HttpOpts1, Opts1),
+ inets_test_lib:check_body(B1),
+
+ HttpOpts2 = [],
+ Opts2 = [{body_format,binary}],
+ {ok,{{_,200,_},[_|_],B2}} =
+ httpc:request(Method, Request, HttpOpts2, Opts2),
+ inets_test_lib:check_body(binary_to_list(B2)).
+
+%%--------------------------------------------------------------------
+
+http_options(doc) ->
+ ["Perform an OPTIONS request."];
+http_options(Config) when is_list(Config) ->
+ Method = options,
+ URL = url("/index.html", Config),
+ Request = {URL,[]},
+ HttpOpts = [],
+ Opts = [],
+ {ok,{{_,200,_},Headers,_}} =
+ httpc:request(Method, Request, HttpOpts, Opts),
+ {value,_} = lists:keysearch("allow", 1, Headers),
+ ok.
+
+%%--------------------------------------------------------------------
+
+http_trace(doc) ->
+ ["Perform a TRACE request."];
+http_trace(Config) when is_list(Config) ->
+ Method = trace,
+ URL = url("/index.html", Config),
+ Request = {URL,[]},
+ HttpOpts = [],
+ Opts = [],
+ {ok,{{_,200,_},[_|_],"TRACE "++_}} =
+ httpc:request(Method, Request, HttpOpts, Opts),
+ ok.
+
+%%--------------------------------------------------------------------
+
+http_post(doc) ->
+ ["Perform a POST request that goes through a proxy. When the "
+ "request goes to an ordinary file it seems the POST data "
+ "is ignored."];
+http_post(Config) when is_list(Config) ->
+ Method = post,
+ URL = url("/index.html", Config),
+ Request = {URL,[],"text/plain","foobar"},
+ HttpOpts = [],
+ Opts = [],
+ {ok,{{_,200,_},[_|_],[_|_]}} =
+ httpc:request(Method, Request, HttpOpts, Opts),
+ ok.
+
+%%--------------------------------------------------------------------
+
+http_put(doc) ->
+ ["Perform a PUT request. The server will not allow it "
+ "but we only test sending the request."];
+http_put(Config) when is_list(Config) ->
+ Method = put,
+ URL = url("/put.html", Config),
+ Content =
+ "<html><body> <h1>foo</h1> <p>bar</p> </body></html>",
+ Request = {URL,[],"html",Content},
+ HttpOpts = [],
+ Opts = [],
+ {ok,{{_,405,_},[_|_],[_|_]}} =
+ httpc:request(Method, Request, HttpOpts, Opts),
+ ok.
+
+%%--------------------------------------------------------------------
+
+http_delete(doc) ->
+ ["Perform a DELETE request that goes through a proxy. Note the server "
+ "will reject the request with a 405 Method Not Allowed,"
+ "but this is just a test of sending the request."];
+http_delete(Config) when is_list(Config) ->
+ Method = delete,
+ URL = url("/delete.html", Config),
+ Request = {URL,[]},
+ HttpOpts = [],
+ Opts = [],
+ {ok,{{_,405,_},[_|_],[_|_]}} =
+ httpc:request(Method, Request, HttpOpts, Opts),
+ ok.
+
+%%--------------------------------------------------------------------
+
+http_headers(doc) ->
+ ["Use as many request headers as possible"];
+http_headers(Config) when is_list(Config) ->
+ Method = get,
+ URL = url("/index.html", Config),
+ Headers =
+ [{"Accept",
+ "text/*, text/html, text/html;level=1, */*"},
+ {"Accept-Charset",
+ "iso-8859-5, unicode-1-1;q=0.8"},
+ {"Accept-Encoding", "*"},
+ {"Accept-Language",
+ "sv, en-gb;q=0.8, en;q=0.7"},
+ {"User-Agent", "inets"},
+ {"Max-Forwards","5"},
+ {"Referer",
+ "http://otp.ericsson.se:8000/product/internal"}],
+ Request = {URL,Headers},
+ HttpOpts = [],
+ Opts = [],
+ {ok,{{_,200,_},[_|_],[_|_]}} =
+ httpc:request(Method, Request, HttpOpts, Opts),
+ ok.
+
+%%--------------------------------------------------------------------
+
+http_proxy_auth(doc) ->
+ ["Test the code for sending of proxy authorization."];
+http_proxy_auth(Config) when is_list(Config) ->
+ %% Our proxy seems to ignore the header, however our proxy
+ %% does not requirer an auth header, but we want to know
+ %% atleast the code for sending the header does not crash!
+ Method = get,
+ URL = url("/index.html", Config),
+ Request = {URL,[]},
+ HttpOpts = [{proxy_auth,{"foo","bar"}}],
+ Opts = [],
+ {ok,{{_,200,_},[_|_],[_|_]}} =
+ httpc:request(Method, Request, HttpOpts, Opts),
+ ok.
+
+%%--------------------------------------------------------------------
+
+http_doesnotexist(doc) ->
+ ["Test that we get a 404 when the page is not found."];
+http_doesnotexist(Config) when is_list(Config) ->
+ Method = get,
+ URL = url("/doesnotexist.html", Config),
+ Request = {URL,[]},
+ HttpOpts = [{proxy_auth,{"foo","bar"}}],
+ Opts = [],
+ {ok,{{_,404,_},[_|_],[_|_]}} =
+ httpc:request(Method, Request, HttpOpts, Opts),
+ ok.
+
+%%--------------------------------------------------------------------
+
+http_stream(doc) ->
+ ["Test the option stream for asynchronous requests"];
+http_stream(Config) when is_list(Config) ->
+ Method = get,
+ URL = url("/index.html", Config),
+ Request = {URL,[]},
+ HttpOpts = [],
+
+ Opts1 = [{body_format,binary}],
+ {ok,{{_,200,_},[_|_],Body}} =
+ httpc:request(Method, Request, HttpOpts, Opts1),
+
+ Opts2 = [{sync,false},{stream,self}],
+ {ok,RequestId} =
+ httpc:request(Method, Request, HttpOpts, Opts2),
+ receive
+ {http,{RequestId,stream_start,[_|_]}} ->
+ ok
+ end,
+ case http_stream(RequestId, <<>>) of
+ Body -> ok
+ end.
+ %% StreamedBody = http_stream(RequestId, <<>>),
+ %% Body =:= StreamedBody,
+ %% ok.
+
+http_stream(RequestId, Body) ->
+ receive
+ {http,{RequestId,stream,Bin}} ->
+ http_stream(RequestId, <<Body/binary,Bin/binary>>);
+ {http,{RequestId,stream_end,_Headers}} ->
+ Body
+ end.
+
+%%--------------------------------------------------------------------
+
+http_emulate_lower_versions(doc) ->
+ ["Perform requests as 0.9 and 1.0 clients."];
+http_emulate_lower_versions(Config) when is_list(Config) ->
+ Method = get,
+ URL = url("/index.html", Config),
+ Request = {URL,[]},
+ Opts = [],
+
+ HttpOpts1 = [{version,"HTTP/0.9"}],
+ {ok,[_|_]=B1} =
+ httpc:request(Method, Request, HttpOpts1, Opts),
+ inets_test_lib:check_body(B1),
+
+ HttpOpts2 = [{version,"HTTP/1.0"}],
+ {ok,{{_,200,_},[_|_],[_|_]=B2}} =
+ httpc:request(Method, Request, HttpOpts2, Opts),
+ inets_test_lib:check_body(B2),
+
+ HttpOpts3 = [{version,"HTTP/1.1"}],
+ {ok,{{_,200,_},[_|_],[_|_]=B3}} =
+ httpc:request(Method, Request, HttpOpts3, Opts),
+ inets_test_lib:check_body(B3),
+
+ ok.
+
+%%--------------------------------------------------------------------
+http_not_modified_otp_6821(doc) ->
+ ["If unmodified no body should be returned"];
+http_not_modified_otp_6821(Config) when is_list(Config) ->
+ Method = get,
+ URL = url("/index.html", Config),
+ Opts = [],
+
+ Request1 = {URL,[]},
+ HttpOpts1 = [],
+ {ok,{{_,200,_},ReplyHeaders,[_|_]}} =
+ httpc:request(Method, Request1, HttpOpts1, Opts),
+ ETag = header_value("etag", ReplyHeaders),
+ LastModified = header_value("last-modified", ReplyHeaders),
+
+ Request2 =
+ {URL,
+ [{"If-None-Match",ETag},
+ {"If-Modified-Since",LastModified}]},
+ HttpOpts2 = [{timeout,15000}], % Limit wait for bug result
+ {ok,{{_,304,_},_,[]}} = % Page Unchanged
+ httpc:request(Method, Request2, HttpOpts2, Opts),
+
+ ok.
+
+header_value(Name, [{HeaderName,HeaderValue}|Headers]) ->
+ case string:to_lower(HeaderName) of
+ Name ->
+ HeaderValue;
+ _ ->
+ header_value(Name, Headers)
+ end.
+
+%%--------------------------------------------------------------------
+%% Internal Functions ------------------------------------------------
+%%--------------------------------------------------------------------
+
+init_apps([], Config) ->
+ Config;
+init_apps([App|Apps], Config) ->
+ case app_start(App, Config) of
+ ok ->
+ init_apps(Apps, Config);
+ Error ->
+ Msg =
+ lists:flatten(
+ io_lib:format(
+ "Could not start ~p due to ~p.~n",
+ [App, Error])),
+ {skip,Msg}
+ end.
+
+app_start(App, Config) ->
+ try
+ case App of
+ crypto ->
+ crypto:stop(),
+ ok = crypto:start();
+ inets ->
+ application:stop(App),
+ ok = application:start(App),
+ case ?config(proxy, Config) of
+ undefined -> ok;
+ {_,ProxySpec} ->
+ ok = httpc:set_options([{proxy,ProxySpec}])
+ end;
+ _ ->
+ application:stop(App),
+ ok = application:start(App)
+ end
+ catch
+ Class:Reason ->
+ {exception,Class,Reason}
+ end.
+
+app_stop(App) ->
+ application:stop(App).
+
+make_cert_files(Alg, Prefix, Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ CaInfo = {CaCert,_} = erl_make_certs:make_cert([{key,Alg}]),
+ {Cert,CertKey} = erl_make_certs:make_cert([{key,Alg},{issuer,CaInfo}]),
+ CaCertFile = filename:join(PrivDir, Prefix++"cacerts.pem"),
+ CertFile = filename:join(PrivDir, Prefix++"cert.pem"),
+ KeyFile = filename:join(PrivDir, Prefix++"key.pem"),
+ der_to_pem(CaCertFile, [{'Certificate', CaCert, not_encrypted}]),
+ der_to_pem(CertFile, [{'Certificate', Cert, not_encrypted}]),
+ der_to_pem(KeyFile, [CertKey]),
+ ok.
+
+der_to_pem(File, Entries) ->
+ PemBin = public_key:pem_encode(Entries),
+ file:write_file(File, PemBin).
+
+
+
+url(AbsPath, Config) ->
+ Protocol = ?config(protocol, Config),
+ {ServerName,ServerPort} = ?config(Protocol, Config),
+ atom_to_list(Protocol) ++ "://" ++
+ ServerName ++ ":" ++ integer_to_list(ServerPort) ++
+ AbsPath.
+
+%%--------------------------------------------------------------------
+
+init_local_proxy(Config) ->
+ case os:type() of
+ {unix,_} ->
+ case rcmd_local_proxy(["start"], Config) of
+ {0,[":STARTED:"++String]} ->
+ init_local_proxy_string(String, Config);
+ {_,[":SKIP:"++_|_]}=Reason ->
+ {skip,Reason};
+ Error ->
+ rcmd_local_proxy(["stop"], Config),
+ ct:fail({local_proxy_start_failed,Error})
+ end;
+ _ ->
+ {skip,"Platform can not run local proxy start script"}
+ end.
+
+init_local_proxy_string(String, Config) ->
+ {Proxy,Server} = split($|, String),
+ {ProxyName,ProxyPort} = split($:, Proxy),
+ {ServerName,ServerPorts} = split($:, Server),
+ {ServerHttpPort,ServerHttpsPort} = split($:, ServerPorts),
+ [{proxy,{local,{{ProxyName,list_to_integer(ProxyPort)},[]}}},
+ {http,{ServerName,list_to_integer(ServerHttpPort)}},
+ {https,{ServerName,list_to_integer(ServerHttpsPort)}}
+ |Config].
+
+rcmd_local_proxy(Args, Config) ->
+ DataDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
+ Script = filename:join(DataDir, ?LOCAL_PROXY_SCRIPT),
+ rcmd(Script, Args, [{cd,PrivDir}]).
+
+rcmd(Cmd, Args, Opts) ->
+ Port =
+ erlang:open_port(
+ {spawn_executable,Cmd},
+ [{args,Args},{line,80},exit_status,eof,hide|Opts]),
+ rcmd_loop(Port, [], [], undefined, false).
+
+rcmd_loop(Port, Lines, Buf, Exit, EOF) ->
+ receive
+ {Port,{data,{Flag,Line}}} ->
+ case Flag of
+ noeol ->
+ rcmd_loop(Port, Lines, r(Line, Buf), Exit, EOF);
+ eol ->
+ rcmd_loop(Port, [r(Buf, Line)|Lines], [], Exit, EOF)
+ end;
+ {Port,{exit_status,Status}} when Exit =:= undefined ->
+ case EOF of
+ true ->
+ rcmd_close(Port, Lines, Buf, Status);
+ false ->
+ rcmd_loop(Port, Lines, Buf, Status, EOF)
+ end;
+ {Port,eof} when EOF =:= false ->
+ case Exit of
+ undefined ->
+ rcmd_loop(Port, Lines, Buf, Exit, true);
+ Status ->
+ rcmd_close(Port, Lines, Buf, Status)
+ end;
+ {Port,_}=Unexpected ->
+ ct:fail({unexpected_from_port,Unexpected})
+ end.
+
+rcmd_close(Port, Lines, Buf, Status) ->
+ catch port_close(Port),
+ case Buf of
+ [] ->
+ {Status,Lines};
+ _ ->
+ {Status,[r(Buf)|Lines]}
+ end.
+
+%%--------------------------------------------------------------------
+
+%% Split on first match of X in Ys, do not include X in neither part
+split(X, Ys) ->
+ split(X, Ys, []).
+%%
+split(X, [X|Ys], Rs) ->
+ {r(Rs),Ys};
+split(X, [Y|Ys], Rs) ->
+ split(X, Ys, [Y|Rs]).
+
+r(L) -> lists:reverse(L).
+r(L, R) -> lists:reverse(L, R).
diff --git a/lib/inets/test/httpc_proxy_SUITE_data/apache2/apache2.conf b/lib/inets/test/httpc_proxy_SUITE_data/apache2/apache2.conf
new file mode 100644
index 0000000000..37af88c510
--- /dev/null
+++ b/lib/inets/test/httpc_proxy_SUITE_data/apache2/apache2.conf
@@ -0,0 +1,87 @@
+## Simple Apache 2 configuration file for daily test very local http server
+##
+## %CopyrightBegin%
+##
+## Copyright Ericsson AB 2012. All Rights Reserved.
+##
+## The contents of this file are subject to the Erlang Public License,
+## Version 1.1, (the "License"); you may not use this file except in
+## compliance with the License. You should have received a copy of the
+## Erlang Public License along with this software. If not, it can be
+## retrieved online at http://www.erlang.org/.
+##
+## Software distributed under the License is distributed on an "AS IS"
+## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+## the License for the specific language governing rights and limitations
+## under the License.
+##
+## %CopyrightEnd%
+##
+## Author: Raimo Niskanen, Erlang/OTP
+#
+LockFile ${APACHE_LOCK_DIR}/accept.lock
+PidFile ${APACHE_PID_FILE}
+
+Timeout 300
+
+User ${APACHE_RUN_USER}
+Group ${APACHE_RUN_GROUP}
+
+DefaultType text/plain
+HostnameLookups Off
+ErrorLog ${APACHE_LOG_DIR}/error.log
+LogLevel warn
+
+Include ${APACHE_MODS_DIR}/*.load
+Include ${APACHE_MODS_DIR}/*.conf
+
+Listen ${APACHE_HTTP_PORT} http
+
+<IfModule mod_ssl.c>
+ Listen ${APACHE_HTTPS_PORT} https
+ SSLMutex file:${APACHE_LOCK_DIR}/ssl_mutex
+</IfModule>
+
+#<IfModule mod_gnutls.c>
+# Listen 8443
+#</IfModule>
+
+#LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
+LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
+#LogFormat "%h %l %u %t \"%r\" %>s %O" common
+#LogFormat "%{Referer}i -> %U" referer
+#LogFormat "%{User-agent}i" agent
+
+CustomLog ${APACHE_LOG_DIR}/access.log combined
+
+<Directory />
+ AllowOverride None
+ Order Deny,Allow
+ Deny from all
+</Directory>
+
+ServerTokens Minimal
+ServerSignature Off
+KeepAlive On
+KeepAliveTimeout 5
+
+ServerName ${APACHE_SERVER_NAME}
+ServerAdmin webmaster@${APACHE_SERVER_NAME}
+DocumentRoot ${APACHE_DOCROOT}
+<Directory ${APACHE_DOCROOT}>
+ Options Indexes FollowSymLinks MultiViews
+ AllowOverride None
+ Order allow,deny
+ Allow from all
+</Directory>
+
+<VirtualHost *:${APACHE_HTTP_PORT}>
+</VirtualHost>
+
+<IfModule mod_ssl.c>
+ <VirtualHost *:${APACHE_HTTPS_PORT}>
+ SSLCertificateFile ${APACHE_CERTS_DIR}/server-cert.pem
+ SSLCertificateKeyFile ${APACHE_CERTS_DIR}/server-key.pem
+ SSLEngine on
+ </VirtualHost>
+</IfModule>
diff --git a/lib/inets/test/httpc_proxy_SUITE_data/apache2/htdocs/index.html b/lib/inets/test/httpc_proxy_SUITE_data/apache2/htdocs/index.html
new file mode 100644
index 0000000000..1c70d95348
--- /dev/null
+++ b/lib/inets/test/httpc_proxy_SUITE_data/apache2/htdocs/index.html
@@ -0,0 +1,4 @@
+<html><body><h1>It works!</h1>
+<p>This is the default web page for this server.</p>
+<p>The web server software is running but no content has been added, yet.</p>
+</body></html>
diff --git a/lib/inets/test/httpc_proxy_SUITE_data/server_proxy.sh b/lib/inets/test/httpc_proxy_SUITE_data/server_proxy.sh
new file mode 100755
index 0000000000..4b05ea63ef
--- /dev/null
+++ b/lib/inets/test/httpc_proxy_SUITE_data/server_proxy.sh
@@ -0,0 +1,198 @@
+#! /bin/sh
+##
+## Command file to handle external webserver and proxy
+## apache2 and tinyproxy.
+##
+## %CopyrightBegin%
+##
+## Copyright Ericsson AB 2012. All Rights Reserved.
+##
+## The contents of this file are subject to the Erlang Public License,
+## Version 1.1, (the "License"); you may not use this file except in
+## compliance with the License. You should have received a copy of the
+## Erlang Public License along with this software. If not, it can be
+## retrieved online at http://www.erlang.org/.
+##
+## Software distributed under the License is distributed on an "AS IS"
+## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+## the License for the specific language governing rights and limitations
+## under the License.
+##
+## %CopyrightEnd%
+##
+## Author: Raimo Niskanen, Erlang/OTP
+#
+
+PATH=/usr/local/bin:/usr/local/sbin:/bin:/usr/bin:/sbin:/usr/sbin
+SHELL=/bin/sh
+unset CDPATH ENV BASH_ENV
+IFS='
+ '
+
+APACHE_MODS_AVAILABLE_DIR="/etc/apache2/mods-available"
+MODS="authz_host.load mime.conf mime.load ssl.conf ssl.load"
+
+APACHE_HTTP_PORT=8080
+APACHE_HTTPS_PORT=8443
+APACHE_SERVER_NAME=localhost
+export APACHE_HTTP_PORT APACHE_HTTPS_PORT APACHE_SERVER_NAME
+
+PROXY_SERVER_NAME=localhost
+PROXY_PORT=8000
+export PROXY_SERVER_NAME PROXY_PORT
+
+# All stdout goes to the calling erlang port, therefore
+# these helpers push all side info to stderr.
+status () { echo "$@"; }
+info () { echo "$@" 1>&2; }
+die () { REASON="$?"; status "$@"; exit "$REASON"; }
+cmd () { "$@" 1>&2; }
+silent () { "$@" 1>/dev/null 2>&1; }
+
+wait_for_pidfile () {
+ PIDFILE="${1:?Missing argument: PidFile}"
+ for t in 1 1 1 2 2 3 3 3 4; do
+ PID="`head -1 "$1" 2>/dev/null`" && [ :"$PID" != : ] && break
+ sleep $t
+ done
+ [ :"$PID" = : ] && die ":ERROR:No or empty PidFile: $1"
+ info "Started $PIDFILE[$PID]."
+}
+
+kill_and_wait () {
+ PID_FILE="${1:?Missing argument: PidFile}"
+ if [ -f "$PID_FILE" ]; then
+ PID="`head -1 "$PID_FILE" 2>/dev/null`"
+ [ :"$PID" = : ] && \
+ info "Empty Pid file: $1"
+ info "Stopping $1 [$PID]..."
+ shift
+ case :"${1:?Missing argument: kill command}" in
+ :kill)
+ [ :"$PID" = : ] || cmd kill "$PID";;
+ :*)
+ cmd "$@";;
+ esac
+ wait "$PID"
+ for t in 1 1 1 2; do
+ sleep $t
+ [ -e "$PID_FILE" ] || break
+ done
+ silent rm "$PID_FILE"
+ else
+ info "No pid file: $1"
+ fi
+}
+
+
+PRIV_DIR="`pwd`"
+DATA_DIR="`dirname "$0"`"
+DATA_DIR="`cd "$DATA_DIR" && pwd`"
+
+silent type apache2ctl || \
+ die ":SKIP: Can not find apache2ctl."
+silent type tinyproxy || \
+ die ":SKIP: Can not find tinyproxy."
+
+[ -d "$APACHE_MODS_AVAILABLE_DIR" ] || \
+ die ":SKIP:Can not locate modules dir $APACHE_MODS_AVAILABLE_DIR."
+
+silent mkdir apache2 tinyproxy
+cd apache2 || \
+ die ":ERROR:Can not cd to apache2"
+CWD="`pwd`"
+(cd ../tinyproxy) || \
+ die ":ERROR:Can not cd to ../tinyproxy"
+
+unset APACHE_HTTPD APACHE_LYNX APACHE_STATUSURL
+
+## apache2ctl envvars variables
+APACHE_CONFDIR="$DATA_DIR/apache2"
+[ -f "$APACHE_CONFDIR"/apache2.conf ] || \
+ die ":SKIP:No config file: $APACHE_CONFDIR/apache2.conf."
+APACHE_RUN_USER=`id | sed 's/^uid=[0-9]\{1,\}(\([^)]*\)).*/\1/'`
+APACHE_RUN_GROUP=`id | sed 's/.*[ ]gid=[0-9]\{1,\}(\([^)]*\)).*/\1/'`
+APACHE_RUN_DIR="$CWD/run"
+APACHE_PID_FILE="$APACHE_RUN_DIR/pid"
+APACHE_LOCK_DIR="$CWD/lock"
+APACHE_LOG_DIR="$CWD/log"
+export APACHE_CONFDIR APACHE_RUN_USER APACHE_RUN_GROUP
+export APACHE_RUN_DIR APACHE_PID_FILE
+export APACHE_LOCK_DIR APACHE_LOG_DIR
+silent cmd mkdir "$APACHE_CONFDIR"
+silent cmd mkdir "$APACHE_RUN_DIR" "$APACHE_LOCK_DIR" "$APACHE_LOG_DIR"
+
+## Our apache2.conf additional variables
+APACHE_MODS_DIR="$CWD/mods"
+APACHE_DOCROOT="$APACHE_CONFDIR/htdocs"
+APACHE_CERTS_DIR="$PRIV_DIR"
+export APACHE_MODS_DIR APACHE_DOCROOT APACHE_CERTS_DIR
+[ -d "$APACHE_MODS_DIR" ] || {
+ cmd mkdir "$APACHE_MODS_DIR"
+ for MOD in $MODS; do
+ cmd ln -s "$APACHE_MODS_AVAILABLE_DIR/$MOD" "$APACHE_MODS_DIR" || {
+ die ":ERROR:ln of apache 2 module $MOD failed"
+ }
+ done
+}
+
+case :"${1:?}" in
+
+ :start)
+ info "Starting apache2..."
+ cmd apache2ctl start
+ [ $? = 0 ] || \
+ die ":ERROR: apache2 did not start."
+ wait_for_pidfile "$APACHE_PID_FILE"
+
+ info "Starting tinyproxy..."
+ cmd cd ../tinyproxy || \
+ die ":ERROR:Can not cd to `pwd`/../tinyproxy"
+ cat >tinyproxy.conf <<EOF
+Port $PROXY_PORT
+
+Listen 127.0.0.1
+BindSame yes
+Timeout 600
+
+DefaultErrorFile "default.html"
+Logfile "tinyproxy.log"
+PidFile "tinyproxy.pid"
+
+MaxClients 100
+MinSpareServers 2
+MaxSpareServers 8
+StartServers 2
+MaxRequestsPerChild 0
+
+ViaProxyName "tinyproxy"
+
+ConnectPort $APACHE_HTTPS_PORT
+EOF
+ (tinyproxy -d -c tinyproxy.conf 1>/dev/null 2>&1 </dev/null &)&
+ wait_for_pidfile tinyproxy.pid
+
+ status ":STARTED:$PROXY_SERVER_NAME:$PROXY_PORT|\
+$APACHE_SERVER_NAME:$APACHE_HTTP_PORT:$APACHE_HTTPS_PORT"
+ exit 0
+ ;;
+
+ :stop)
+ kill_and_wait ../tinyproxy/tinyproxy.pid kill
+ kill_and_wait "$APACHE_PID_FILE" apache2ctl stop
+
+ status ":STOPPED:"
+ exit 0
+ ;;
+
+ :apache2ctl)
+ shift
+ cmd apache2ctl ${1+"$@"}
+ exit
+ ;;
+
+ :*)
+ (exit 1); die ":ERROR: I do not know of command '$1'."
+ ;;
+
+esac
diff --git a/lib/inets/test/httpd_SUITE.erl b/lib/inets/test/httpd_SUITE.erl
index a4bb8f7159..58f7d4fa25 100644
--- a/lib/inets/test/httpd_SUITE.erl
+++ b/lib/inets/test/httpd_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -224,7 +224,8 @@ all() ->
].
groups() ->
- [{ip, [],
+ [
+ {ip, [],
[ip_mod_alias, ip_mod_actions, ip_mod_security,
ip_mod_auth, ip_mod_auth_api, ip_mod_auth_mnesia_api,
ip_mod_htaccess, ip_mod_cgi, ip_mod_esi, ip_mod_get,
@@ -293,6 +294,14 @@ groups() ->
[ticket_5775, ticket_5865, ticket_5913, ticket_6003,
ticket_7304]}].
+
+init_per_group(ipv6 = _GroupName, Config) ->
+ case inets_test_lib:has_ipv6_support() of
+ {ok, _} ->
+ Config;
+ _ ->
+ {skip, "Host does not support IPv6"}
+ end;
init_per_group(_GroupName, Config) ->
Config.
@@ -314,6 +323,8 @@ init_per_suite(Config) ->
"~n Config: ~p"
"~n", [Config]),
+ ?PRINT_SYSTEM_INFO([]),
+
PrivDir = ?config(priv_dir, Config),
SuiteTopDir = filename:join(PrivDir, ?MODULE),
case file:make_dir(SuiteTopDir) of
@@ -325,10 +336,11 @@ init_per_suite(Config) ->
throw({error, {failed_creating_suite_top_dir, Error}})
end,
- [{suite_top_dir, SuiteTopDir},
- {node, node()},
- {host, inets_test_lib:hostname()},
- {address, getaddr()} | Config].
+ [{has_ipv6_support, inets_test_lib:has_ipv6_support()},
+ {suite_top_dir, SuiteTopDir},
+ {node, node()},
+ {host, inets_test_lib:hostname()},
+ {address, getaddr()} | Config].
%%--------------------------------------------------------------------
@@ -363,10 +375,9 @@ init_per_testcase(Case, Config) ->
init_per_testcase2(Case, Config) ->
- io:format(user, "~w:init_per_testcase2(~w) -> entry with"
- "~n Config: ~p"
- "~n", [?MODULE, Case, Config]),
-
+ tsp("init_per_testcase2 -> entry with"
+ "~n Config: ~p", [Config]),
+
IpNormal = integer_to_list(?IP_PORT) ++ ".conf",
IpHtaccess = integer_to_list(?IP_PORT) ++ "htaccess.conf",
SslNormal = integer_to_list(?SSL_PORT) ++ ".conf",
@@ -375,39 +386,33 @@ init_per_testcase2(Case, Config) ->
DataDir = ?config(data_dir, Config),
SuiteTopDir = ?config(suite_top_dir, Config),
- io:format(user, "~w:init_per_testcase2(~w) -> "
- "~n SuiteDir: ~p"
- "~n DataDir: ~p"
- "~n", [?MODULE, Case, SuiteTopDir, DataDir]),
+ tsp("init_per_testcase2 -> "
+ "~n SuiteDir: ~p"
+ "~n DataDir: ~p", [SuiteTopDir, DataDir]),
TcTopDir = filename:join(SuiteTopDir, Case),
?line ok = file:make_dir(TcTopDir),
- io:format(user, "~w:init_per_testcase2(~w) -> "
- "~n TcTopDir: ~p"
- "~n", [?MODULE, Case, TcTopDir]),
+ tsp("init_per_testcase2 -> "
+ "~n TcTopDir: ~p", [TcTopDir]),
DataSrc = filename:join([DataDir, "server_root"]),
ServerRoot = filename:join([TcTopDir, "server_root"]),
- io:format(user, "~w:init_per_testcase2(~w) -> "
- "~n DataSrc: ~p"
- "~n ServerRoot: ~p"
- "~n", [?MODULE, Case, DataSrc, ServerRoot]),
+ tsp("init_per_testcase2 -> "
+ "~n DataSrc: ~p"
+ "~n ServerRoot: ~p", [DataSrc, ServerRoot]),
ok = file:make_dir(ServerRoot),
ok = file:make_dir(filename:join([TcTopDir, "logs"])),
NewConfig = [{tc_top_dir, TcTopDir}, {server_root, ServerRoot} | Config],
- io:format(user, "~w:init_per_testcase2(~w) -> "
- "copy DataSrc to ServerRoot~n",
- [?MODULE, Case]),
+ tsp("init_per_testcase2 -> copy DataSrc to ServerRoot"),
inets_test_lib:copy_dirs(DataSrc, ServerRoot),
- io:format(user, "~w:init_per_testcase2(~w) -> fix cgi~n",
- [?MODULE, Case]),
+ tsp("init_per_testcase2 -> fix cgi"),
EnvCGI = filename:join([ServerRoot, "cgi-bin", "printenv.sh"]),
{ok, FileInfo} = file:read_file_info(EnvCGI),
ok = file:write_file_info(EnvCGI,
@@ -427,16 +432,14 @@ init_per_testcase2(Case, Config) ->
FileInfo1#file_info{mode = 8#00755}),
%% To be used by IP test cases
- io:format(user, "~w:init_per_testcase2(~w) -> ip testcase setups~n",
- [?MODULE, Case]),
+ tsp("init_per_testcase2 -> ip testcase setups"),
create_config([{port, ?IP_PORT}, {sock_type, ip_comm} | NewConfig],
normal_access, IpNormal),
create_config([{port, ?IP_PORT}, {sock_type, ip_comm} | NewConfig],
mod_htaccess, IpHtaccess),
%% To be used by SSL test cases
- io:format(user, "~w:init_per_testcase2(~w) -> ssl testcase setups~n",
- [?MODULE, Case]),
+ tsp("init_per_testcase2 -> ssl testcase setups"),
SocketType =
case atom_to_list(Case) of
[X, $s, $s, $l | _] ->
@@ -460,8 +463,7 @@ init_per_testcase2(Case, Config) ->
%% when you run the whole test suite due to shortcomings
%% of the test server.
- io:format(user, "~w:init_per_testcase2(~w) -> "
- "maybe generate IPv6 config file(s)", [?MODULE, Case]),
+ tsp("init_per_testcase2 -> maybe generate IPv6 config file(s)"),
NewConfig2 =
case atom_to_list(Case) of
"ipv6_" ++ _ ->
@@ -502,15 +504,15 @@ init_per_testcase2(Case, Config) ->
NewConfig
end,
- io:format(user, "~w:init_per_testcase2(~w) -> done~n",
- [?MODULE, Case]),
+ tsp("init_per_testcase2 -> done when"
+ "~n NewConfig2: ~p", [NewConfig2]),
NewConfig2.
init_per_testcase3(Case, Config) ->
- io:format(user, "~w:init_per_testcase3(~w) -> entry with"
- "~n Config: ~p", [?MODULE, Case, Config]),
+ tsp("init_per_testcase3(~w) -> entry with"
+ "~n Config: ~p", [Case, Config]),
%% %% Create a new fresh node to be used by the server in this test-case
@@ -532,12 +534,10 @@ init_per_testcase3(Case, Config) ->
%% Set trace level
case lists:reverse(atom_to_list(Case)) of
"tset_emit" ++ _Rest -> % test-cases ending with time_test
- io:format(user, "~w:init_per_testcase3(~w) -> disabling trace",
- [?MODULE, Case]),
+ tsp("init_per_testcase3(~w) -> disabling trace", [Case]),
inets:disable_trace();
_ ->
- io:format(user, "~w:init_per_testcase3(~w) -> enabling trace",
- [?MODULE, Case]),
+ tsp("init_per_testcase3(~w) -> enabling trace", [Case]),
%% TraceLevel = 70,
TraceLevel = max,
TraceDest = io,
@@ -545,8 +545,7 @@ init_per_testcase3(Case, Config) ->
end,
%% Start initialization
- io:format(user, "~w:init_per_testcase3(~w) -> start init",
- [?MODULE, Case]),
+ tsp("init_per_testcase3(~w) -> start init", [Case]),
Dog = test_server:timetrap(inets_test_lib:minutes(10)),
@@ -627,26 +626,32 @@ init_per_testcase3(Case, Config) ->
end
end,
- case CaseRest of
- {skip, _} = Skip ->
- Skip;
- "mod_auth_" ++ _ ->
- start_mnesia(?config(node, Config)),
- [{watchdog, Dog} | NewConfig];
- "mod_htaccess" ->
- ServerRoot = ?config(server_root, Config),
- Path = filename:join([ServerRoot, "htdocs"]),
- catch remove_htaccess(Path),
- create_htaccess_data(Path, ?config(address, Config)),
- [{watchdog, Dog} | NewConfig];
- "range" ->
- ServerRoot = ?config(server_root, Config),
- Path = filename:join([ServerRoot, "htdocs"]),
- create_range_data(Path),
- [{watchdog, Dog} | NewConfig];
- _ ->
- [{watchdog, Dog} | NewConfig]
- end.
+ InitRes =
+ case CaseRest of
+ {skip, _} = Skip ->
+ Skip;
+ "mod_auth_" ++ _ ->
+ start_mnesia(?config(node, Config)),
+ [{watchdog, Dog} | NewConfig];
+ "mod_htaccess" ->
+ ServerRoot = ?config(server_root, Config),
+ Path = filename:join([ServerRoot, "htdocs"]),
+ catch remove_htaccess(Path),
+ create_htaccess_data(Path, ?config(address, Config)),
+ [{watchdog, Dog} | NewConfig];
+ "range" ->
+ ServerRoot = ?config(server_root, Config),
+ Path = filename:join([ServerRoot, "htdocs"]),
+ create_range_data(Path),
+ [{watchdog, Dog} | NewConfig];
+ _ ->
+ [{watchdog, Dog} | NewConfig]
+ end,
+
+ tsp("init_per_testcase3(~w) -> done when"
+ "~n InitRes: ~p", [Case, InitRes]),
+
+ InitRes.
%%--------------------------------------------------------------------
@@ -664,16 +669,14 @@ end_per_testcase(Case, Config) ->
ok.
end_per_testcase2(Case, Config) ->
- io:format(user, "~w:end_per_testcase2(~w) -> entry with"
- "~n Config: ~p~n",
- [?MODULE, Case, Config]),
+ tsp("end_per_testcase2(~w) -> entry with"
+ "~n Config: ~p", [Case, Config]),
application:unset_env(inets, services),
application:stop(inets),
application:stop(ssl),
application:stop(crypto), % used by the new ssl (essl test cases)
cleanup_mnesia(),
- io:format(user, "~w:end_per_testcase2(~w) -> done~n",
- [?MODULE, Case]),
+ tsp("end_per_testcase2(~w) -> done", [Case]),
ok.
@@ -759,14 +762,9 @@ ip_mod_cgi(doc) ->
ip_mod_cgi(suite) ->
[];
ip_mod_cgi(Config) when is_list(Config) ->
- case test_server:os_type() of
- vxworks ->
- {skip, cgi_not_supported_on_vxwoks};
- _ ->
- httpd_mod:cgi(ip_comm, ?IP_PORT,
- ?config(host, Config), ?config(node, Config)),
- ok
- end.
+ httpd_mod:cgi(ip_comm, ?IP_PORT,
+ ?config(host, Config), ?config(node, Config)),
+ ok.
%%-------------------------------------------------------------------------
ip_mod_esi(doc) ->
["Module test: mod_esi"];
@@ -1272,16 +1270,11 @@ essl_mod_cgi(Config) when is_list(Config) ->
ssl_mod_cgi(essl, Config).
ssl_mod_cgi(Tag, Config) ->
- case test_server:os_type() of
- vxworks ->
- {skip, cgi_not_supported_on_vxwoks};
- _ ->
- httpd_mod:cgi(Tag,
- ?SSL_PORT,
- ?config(host, Config),
- ?config(node, Config)),
- ok
- end.
+ httpd_mod:cgi(Tag,
+ ?SSL_PORT,
+ ?config(host, Config),
+ ?config(node, Config)),
+ ok.
%%-------------------------------------------------------------------------
@@ -2354,32 +2347,33 @@ create_config(Config, Access, FileName) ->
true ->
[]
end,
- ModOrder = case Access of
- mod_htaccess ->
- "Modules mod_alias mod_htaccess mod_auth "
- "mod_security "
- "mod_responsecontrol mod_trace mod_esi "
- "mod_actions mod_cgi mod_include mod_dir "
- "mod_range mod_get "
- "mod_head mod_log mod_disk_log";
- _ ->
- "Modules mod_alias mod_auth mod_security "
- "mod_responsecontrol mod_trace mod_esi "
- "mod_actions mod_cgi mod_include mod_dir "
+ ModOrder =
+ case Access of
+ mod_htaccess ->
+ "Modules mod_alias mod_htaccess mod_auth "
+ "mod_security "
+ "mod_responsecontrol mod_trace mod_esi "
+ "mod_actions mod_cgi mod_include mod_dir "
+ "mod_range mod_get "
+ "mod_head mod_log mod_disk_log";
+ _ ->
+ "Modules mod_alias mod_auth mod_security "
+ "mod_responsecontrol mod_trace mod_esi "
+ "mod_actions mod_cgi mod_include mod_dir "
"mod_range mod_get "
- "mod_head mod_log mod_disk_log"
- end,
+ "mod_head mod_log mod_disk_log"
+ end,
-%% The test suite currently does not handle an explicit BindAddress.
-%% They assume any has been used, that is Addr is always set to undefined!
+ %% The test suite currently does not handle an explicit BindAddress.
+ %% They assume any has been used, that is Addr is always set to undefined!
-%% {ok, Hostname} = inet:gethostname(),
-%% {ok, Addr} = inet:getaddr(Hostname, inet6),
-%% AddrStr = make_ipv6(Addr),
-%% BindAddress = lists:flatten(io_lib:format("~s|inet6", [AddrStr])),
+ %% {ok, Hostname} = inet:gethostname(),
+ %% {ok, Addr} = inet:getaddr(Hostname, inet6),
+ %% AddrStr = make_ipv6(Addr),
+ %% BindAddress = lists:flatten(io_lib:format("~s|inet6", [AddrStr])),
- %% BindAddress = "*|inet",
- BindAddress = "*",
+ BindAddress = "*|inet",
+ %% BindAddress = "*",
HttpConfig = [
cline(["Port ", integer_to_list(Port)]),
@@ -2694,11 +2688,6 @@ dos_hostname_request(Host) ->
get_nof_clients(Mode, Load) ->
get_nof_clients(test_server:os_type(), Mode, Load).
-get_nof_clients(vxworks, _, light) -> 1;
-get_nof_clients(vxworks, ip_comm, medium) -> 3;
-get_nof_clients(vxworks, ssl, medium) -> 3;
-get_nof_clients(vxworks, ip_comm, heavy) -> 5;
-get_nof_clients(vxworks, ssl, heavy) -> 5;
get_nof_clients(_, ip_comm, light) -> 5;
get_nof_clients(_, ssl, light) -> 2;
get_nof_clients(_, ip_comm, medium) -> 10;
@@ -2770,10 +2759,10 @@ create_ipv6_config(Config, FileName, Ipv6Address) ->
ok = file:close(Fd).
-%% tsp(F) ->
-%% inets_test_lib:tsp(F).
+tsp(F) ->
+ inets_test_lib:tsp("[~w]" ++ F, [?MODULE]).
tsp(F, A) ->
- inets_test_lib:tsp(F, A).
+ inets_test_lib:tsp("[~w]" ++ F, [?MODULE|A]).
tsf(Reason) ->
inets_test_lib:tsf(Reason).
diff --git a/lib/inets/test/httpd_basic_SUITE.erl b/lib/inets/test/httpd_basic_SUITE.erl
index 4cd38f2ec4..7a476ea14a 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -20,6 +20,8 @@
-module(httpd_basic_SUITE).
-include_lib("common_test/include/ct.hrl").
+-include("inets_test_lib.hrl").
+
%% Note: This directive should only be used in test suites.
-compile(export_all).
@@ -184,6 +186,15 @@ escaped_url_in_error_body(doc) ->
escaped_url_in_error_body(suite) ->
[];
escaped_url_in_error_body(Config) when is_list(Config) ->
+ %% <CONDITIONAL-SKIP>
+ %% This skip is due to a problem on windows with long path's
+ %% If a path is too long file:open fails with, for example, eio.
+ %% Until that problem is fixed, we skip this case...
+ Skippable = [win32],
+ Condition = fun() -> ?OS_BASED_SKIP(Skippable) end,
+ ?NON_PC_TC_MAYBE_SKIP(Config, Condition),
+ %% </CONDITIONAL-SKIP>
+
tsp("escaped_url_in_error_body -> entry"),
HttpdConf = ?config(httpd_conf, Config),
{ok, Pid} = inets:start(httpd, [{port, 0} | HttpdConf]),
@@ -192,6 +203,7 @@ escaped_url_in_error_body(Config) when is_list(Config) ->
_Address = proplists:get_value(bind_address, Info),
%% Request 1
+ tss(1000),
tsp("escaped_url_in_error_body -> request 1"),
URL1 = ?URL_START ++ integer_to_list(Port),
%% Make sure the server is ok, by making a request for a valid page
@@ -202,11 +214,12 @@ escaped_url_in_error_body(Config) when is_list(Config) ->
{ok, {200, _}} ->
%% Don't care about the the body, just that we get a ok response
ok;
- {ok, UnexpectedOK1} ->
- tsf({unexpected_ok_1, UnexpectedOK1})
+ {ok, {StatusCode1, Body1}} ->
+ tsf({unexpected_ok_1, StatusCode1, Body1})
end,
%% Request 2
+ tss(1000),
tsp("escaped_url_in_error_body -> request 2"),
%% Make sure the server is ok, by making a request for a valid page
case httpc:request(get, {URL1 ++ "/dummy.html", []},
@@ -216,11 +229,12 @@ escaped_url_in_error_body(Config) when is_list(Config) ->
{ok, {200, _}} ->
%% Don't care about the the body, just that we get a ok response
ok;
- {ok, UnexpectedOK2} ->
- tsf({unexpected_ok_2, UnexpectedOK2})
+ {ok, {StatusCode2, Body2}} ->
+ tsf({unexpected_ok_2, StatusCode2, Body2})
end,
%% Request 3
+ tss(1000),
tsp("escaped_url_in_error_body -> request 3"),
%% Ask for a non-existing page(1)
Path = "/<b>this_is_bold<b>",
@@ -238,10 +252,11 @@ escaped_url_in_error_body(Config) when is_list(Config) ->
tsf({unexpected_path_3, HTMLEncodedPath, BadPath3})
end;
{ok, UnexpectedOK3} ->
- tsf({unexpected_ok_1, UnexpectedOK3})
+ tsf({unexpected_ok_3, UnexpectedOK3})
end,
%% Request 4
+ tss(1000),
tsp("escaped_url_in_error_body -> request 4"),
%% Ask for a non-existing page(2)
case httpc:request(get, {URL2, []},
@@ -253,11 +268,12 @@ escaped_url_in_error_body(Config) when is_list(Config) ->
HTMLEncodedPath ->
ok;
BadPath4 ->
- tsf({unexpected_path_2, HTMLEncodedPath, BadPath4})
+ tsf({unexpected_path_4, HTMLEncodedPath, BadPath4})
end;
{ok, UnexpectedOK4} ->
tsf({unexpected_ok_4, UnexpectedOK4})
end,
+ tss(1000),
tsp("escaped_url_in_error_body -> stop inets"),
inets:stop(httpd, Pid),
tsp("escaped_url_in_error_body -> done"),
@@ -277,7 +293,12 @@ tsp(F, A) ->
inets_test_lib:tsp(F, A).
tsf(Reason) ->
- test_server:fail(Reason).
+ inets_test_lib:tsf(Reason).
+
+tss(Time) ->
+ inets_test_lib:tss(Time).
+
+
skip(Reason) ->
diff --git a/lib/inets/test/httpd_mod.erl b/lib/inets/test/httpd_mod.erl
index 5016cdb9e6..387263ce58 100644
--- a/lib/inets/test/httpd_mod.erl
+++ b/lib/inets/test/httpd_mod.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -39,14 +39,10 @@
%% Test cases starts here.
%%-------------------------------------------------------------------------
alias(Type, Port, Host, Node) ->
-%% io:format(user, "~w:alias -> entry with"
-%% "~n Type: ~p"
-%% "~n Port: ~p"
-%% "~n Host: ~p"
-%% "~n Node: ~p"
-%% "~n", [?MODULE, Type, Port, Host, Node]),
-
- ok = httpd_test_lib:verify_request(Type, Host, Port, Node,
+ %% This is very crude, but...
+ tsp("alias -> Has IPv6 support: ~p", [inets_test_lib:has_ipv6_support()]),
+ Opts = [],
+ ok = httpd_test_lib:verify_request(Type, Host, Port, Opts, Node,
"GET /pics/icon.sheet.gif "
"HTTP/1.0\r\n\r\n",
[{statuscode, 200},
@@ -55,7 +51,7 @@ alias(Type, Port, Host, Node) ->
{header, "Date"},
{version, "HTTP/1.0"}]),
- ok = httpd_test_lib:verify_request(Type, Host, Port, Node,
+ ok = httpd_test_lib:verify_request(Type, Host, Port, Opts, Node,
"GET / HTTP/1.0\r\n\r\n",
[{statuscode, 200},
{header, "Content-Type","text/html"},
@@ -63,7 +59,7 @@ alias(Type, Port, Host, Node) ->
{header, "Date"},
{version, "HTTP/1.0"}]),
- ok = httpd_test_lib:verify_request(Type,Host,Port,Node,
+ ok = httpd_test_lib:verify_request(Type, Host, Port, Opts, Node,
"GET /misc/ HTTP/1.0\r\n\r\n",
[{statuscode, 200},
{header, "Content-Type","text/html"},
@@ -71,8 +67,8 @@ alias(Type, Port, Host, Node) ->
{header, "Date"},
{version, "HTTP/1.0"}]),
- %% Check redirection if trailing slash is missing.
- ok = httpd_test_lib:verify_request(Type,Host,Port,Node,
+ %% Check redirection if trailing slash is missing.
+ ok = httpd_test_lib:verify_request(Type, Host, Port, Opts, Node,
"GET /misc HTTP/1.0\r\n\r\n",
[{statuscode, 301},
{header, "Location"},
@@ -86,19 +82,23 @@ actions(Type, Port, Host, Node) ->
[{statuscode, 200},
{version, "HTTP/1.0"}]).
+
%%-------------------------------------------------------------------------
security(ServerRoot, Type, Port, Host, Node) ->
- %% io:format(user, "~w:security -> entry with"
- %% "~n ServerRoot: ~p"
- %% "~n Type: ~p"
- %% "~n Port: ~p"
- %% "~n Host: ~p"
- %% "~n Node: ~p"
- %% "~n", [?MODULE, ServerRoot, Type, Port, Host, Node]),
-
-%% io:format(user, "~w:security -> register~n", [?MODULE]),
+ tsp("security -> "
+ "entry with"
+ "~n ServerRoot: ~p"
+ "~n Type: ~p"
+ "~n Port: ~p"
+ "~n Host: ~p"
+ "~n Node: ~p", [ServerRoot, Type, Port, Host, Node]),
+
+ tsp("security -> "
+ "register - receive security events"),
global:register_name(mod_security_test, self()), % Receive events
+ tsp("security -> "
+ "sleep"),
test_server:sleep(5000),
OpenDir = filename:join([ServerRoot, "htdocs", "open"]),
@@ -106,133 +106,240 @@ security(ServerRoot, Type, Port, Host, Node) ->
%% Test blocking / unblocking of users.
%% /open, require user one Aladdin
-%% io:format(user, "~w:security -> remove user~n", [?MODULE]),
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "remove all existing users"),
remove_users(Node, ServerRoot, Host, Port, "open"),
-%% io:format(user, "~w:security -> auth request~n", [?MODULE]),
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "auth request for nonex user 'one' - expect 401"),
auth_request(Type, Host, Port, Node, "/open/", "one", "onePassword",
[{statuscode, 401}]),
-%% io:format(user, "~w:security -> await fail security event~n", [?MODULE]),
+
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "await fail security event"),
receive_security_event({event, auth_fail, Port, OpenDir,
[{user, "one"}, {password, "onePassword"}]},
Node, Port),
-%% io:format(user, "~w:security -> auth request~n", [?MODULE]),
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "auth request for nonex user 'two' - expect 401"),
auth_request(Type,Host,Port,Node,"/open/", "two", "twoPassword",
[{statuscode, 401}]),
-%% io:format(user, "~w:security -> await fail security event~n", [?MODULE]),
+
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "await fail security event"),
receive_security_event({event, auth_fail, Port, OpenDir,
[{user, "two"}, {password, "twoPassword"}]},
Node, Port),
-%% io:format(user, "~w:security -> auth request~n", [?MODULE]),
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "auth request for nonex user 'Alladin' - expect 401"),
auth_request(Type, Host, Port, Node,"/open/", "Aladdin",
"AladdinPassword", [{statuscode, 401}]),
-%% io:format(user, "~w:security -> await fail security event~n", [?MODULE]),
+
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "await fail security event"),
receive_security_event({event, auth_fail, Port, OpenDir,
[{user, "Aladdin"},
{password, "AladdinPassword"}]},
Node, Port),
-%% io:format(user, "~w:security -> add users~n", [?MODULE]),
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "add user 'one'"),
add_user(Node, ServerRoot, Port, "open", "one", "onePassword", []),
+
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "add user 'two'"),
add_user(Node, ServerRoot, Port, "open", "two", "twoPassword", []),
-%% io:format(user, "~w:security -> auth request~n", [?MODULE]),
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "auth request 1 for user 'one' with wrong password - expect 401"),
auth_request(Type, Host, Port, Node,"/open/", "one", "WrongPassword",
[{statuscode, 401}]),
-%% io:format(user, "~w:security -> await fail security event~n", [?MODULE]),
+
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "await fail security event"),
receive_security_event({event, auth_fail, Port, OpenDir,
[{user, "one"}, {password, "WrongPassword"}]},
Node, Port),
-%% io:format(user, "~w:security -> auth request~n", [?MODULE]),
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "auth request 2 for user 'one' with wrong password - expect 401"),
auth_request(Type, Host, Port, Node,"/open/", "one", "WrongPassword",
[{statuscode, 401}]),
-%% io:format(user, "~w:security -> await fail security event~n", [?MODULE]),
+
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "await fail security event"),
receive_security_event({event, auth_fail, Port, OpenDir,
[{user, "one"}, {password, "WrongPassword"}]},
Node, Port),
-%% io:format(user, "~w:security -> await block security event~n", [?MODULE]),
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "await block security event (two failed attempts)"),
receive_security_event({event, user_block, Port, OpenDir,
[{user, "one"}]}, Node, Port),
-%% io:format(user, "~w:security -> unregister~n", [?MODULE]),
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "unregister - no more security events"),
global:unregister_name(mod_security_test), % No more events.
-%% io:format(user, "~w:security -> auth request~n", [?MODULE]),
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "auth request for user 'one' with wrong password - expect 401"),
auth_request(Type, Host, Port, Node,"/open/", "one", "WrongPassword",
[{statuscode, 401}]),
-%% io:format(user, "~w:security -> auth request~n", [?MODULE]),
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "auth request for user 'one' with correct password - expect 403"),
auth_request(Type, Host, Port, Node,"/open/", "one", "onePassword",
[{statuscode, 403}]),
%% User "one" should be blocked now..
- %% [{"one",_, Port, OpenDir,_}] = list_blocked_users(Node,Port),
-%% io:format(user, "~w:security -> list blocked users~n", [?MODULE]),
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "list blocked users - 'one' should be the only one"),
case list_blocked_users(Node, Port) of
[{"one",_, Port, OpenDir,_}] ->
ok;
Blocked ->
- %% io:format(user, "~w:security -> Blocked: ~p"
- %% "~n", [?MODULE, Blocked]),
+ tsp(" *** unexpected blocked users ***"
+ "~n Blocked: ~p", [Blocked]),
exit({unexpected_blocked, Blocked})
end,
-
-%% io:format(user, "~w:security -> list blocked users~n", [?MODULE]),
- [{"one",_, Port, OpenDir,_}] = list_blocked_users(Node,Port,OpenDir),
-%% io:format(user, "~w:security -> unblock user~n", [?MODULE]),
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "list users blocked for dir '~p' - "
+ "user 'one' should be the only one", [OpenDir]),
+ [{"one",_, Port, OpenDir,_}] = list_blocked_users(Node, Port, OpenDir),
+
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "unblock user 'one' for dir '~p'", [OpenDir]),
true = unblock_user(Node, "one", Port, OpenDir),
- %% User "one" should not be blocked any more..
-%% io:format(user, "~w:security -> list blocked users~n", [?MODULE]),
+ %% User "one" should not be blocked any more.
+
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "ensure user 'one' is no longer blocked"),
[] = list_blocked_users(Node, Port),
-%% io:format(user, "~w:security -> list blocked users~n", [?MODULE]),
- [] = list_blocked_users(Node, Port, OpenDir),
-%% io:format(user, "~w:security -> auth request~n", [?MODULE]),
+
+
+ tsp("security -> "
+ "blocking and unblocking of users - "
+ "auth request for user 'one' with correct password - expect 200"),
auth_request(Type, Host, Port, Node,"/open/", "one", "onePassword",
[{statuscode, 200}]),
+
+
%% Test list_auth_users & auth_timeout
-%% io:format(user, "~w:security -> list blocked users~n", [?MODULE]),
+
+ tsp("security -> "
+ "list-auth-users and auth-timeout - "
+ "list auth users - expect user 'one'"),
["one"] = list_auth_users(Node, Port),
-%% io:format(user, "~w:security -> list blocked users~n", [?MODULE]),
- ["one"] = list_auth_users(Node, Port, OpenDir),
-%% io:format(user, "~w:security -> auth request~n", [?MODULE]),
+
+ tsp("security -> "
+ "list-auth-users and auth-timeout - "
+ "auth request for user 'two' with wrong password - expect 401"),
auth_request(Type, Host, Port, Node,"/open/", "two", "onePassword",
[{statuscode, 401}]),
-%% io:format(user, "~w:security -> list blocked users~n", [?MODULE]),
+
+ tsp("security -> "
+ "list-auth-users and auth-timeout - "
+ "list auth users - expect user 'one'"),
["one"] = list_auth_users(Node, Port),
-%% io:format(user, "~w:security -> list blocked users~n", [?MODULE]),
+
+ tsp("security -> "
+ "list-auth-users and auth-timeout - "
+ "list auth users for dir '~p' - expect user 'one'", [OpenDir]),
["one"] = list_auth_users(Node, Port, OpenDir),
-%% io:format(user, "~w:security -> auth request~n", [?MODULE]),
+
+ tsp("security -> "
+ "list-auth-users and auth-timeout - "
+ "auth request for user 'two' with correct password - expect 401"),
auth_request(Type, Host, Port, Node,"/open/", "two", "twoPassword",
[{statuscode, 401}]),
-%% io:format(user, "~w:security -> list blocked users~n", [?MODULE]),
+
+ tsp("security -> "
+ "list-auth-users and auth-timeout - "
+ "list auth users - expect user 'one'"),
["one"] = list_auth_users(Node, Port),
-%% io:format(user, "~w:security -> list blocked users~n", [?MODULE]),
+
+ tsp("security -> "
+ "list-auth-users and auth-timeout - "
+ "list auth users for dir '~p' - expect user 'one'", [OpenDir]),
["one"] = list_auth_users(Node, Port, OpenDir),
+
%% Wait for successful auth to timeout.
+ tsp("security -> "
+ "list-auth-users and auth-timeout - "
+ "wait for successful auth to timeout"),
test_server:sleep(?AUTH_TIMEOUT*1001),
-%% io:format(user, "~w:security -> list blocked users~n", [?MODULE]),
+
+ tsp("security -> "
+ "list-auth-users and auth-timeout - "
+ "list auth users - expect none"),
[] = list_auth_users(Node, Port),
-%% io:format(user, "~w:security -> list blocked users~n", [?MODULE]),
+
+ tsp("security -> "
+ "list-auth-users and auth-timeout - "
+ "list auth users for dir '~p'~n - expect none", [OpenDir]),
[] = list_auth_users(Node, Port, OpenDir),
+
%% "two" is blocked.
-%% io:format(user, "~w:security -> unblock user~n", [?MODULE]),
+
+ tsp("security -> "
+ "list-auth-users and auth-timeout - "
+ "unblock user 'two' for dir '~p'", [OpenDir]),
true = unblock_user(Node, "two", Port, OpenDir),
+
+
%% Test explicit blocking. Block user 'two'.
-%% io:format(user, "~w:security -> list blocked users~n", [?MODULE]),
+
+ tsp("security -> "
+ "explicit blocking - list blocked users - should be none"),
[] = list_blocked_users(Node,Port,OpenDir),
-%% io:format(user, "~w:security -> block user~n", [?MODULE]),
+
+ tsp("security -> "
+ "explicit blocking - "
+ "block user 'two' for dir '~p'", [OpenDir]),
true = block_user(Node, "two", Port, OpenDir, 10),
-%% io:format(user, "~w:security -> auth request~n", [?MODULE]),
+
+ tsp("security -> "
+ "explicit blocking - "
+ "auth request for user 'two' with correct password - expect 401"),
auth_request(Type, Host, Port, Node,"/open/", "two", "twoPassword",
- [{statuscode, 401}]).
+ [{statuscode, 401}]),
+ tsp("security -> "
+ "done").
+
%%-------------------------------------------------------------------------
auth(Type, Port, Host, Node) ->
+ tsp("auth -> "
+ "entry with"
+ "~n Type: ~p"
+ "~n Port: ~p"
+ "~n Host: ~p"
+ "~n Node: ~p", [Type, Port, Host, Node]),
+
%% Authentication required!
ok = httpd_test_lib:verify_request(Type,Host,Port,Node,
"GET /open/ HTTP/1.0\r\n\r\n",
@@ -917,13 +1024,11 @@ list_users(Node, Root, _Host, Port, Dir) ->
receive_security_event(Event, Node, Port) ->
- %% io:format(user, "~w:receive_security_event -> entry with"
- %% "~n Event: ~p"
- %% "~n Node: ~p"
- %% "~n Port: ~p"
- %% "~n", [?MODULE, Event, Node, Port]),
+ tsp("receive_security_event -> await ~w event", [element(2, Event)]),
receive
Event ->
+ tsp("receive_security_event -> "
+ "received expected ~w event", [element(2, Event)]),
ok;
{'EXIT', _, _} ->
receive_security_event(Event, Node, Port)
@@ -1031,10 +1136,17 @@ check_lists_members1(L1,L2) ->
{error,{lists_not_equal,L1,L2}}.
-%% tsp(F) ->
-%% tsp(F, []).
-%% tsp(F, A) ->
-%% test_server:format("~p ~p:" ++ F ++ "~n", [self(), ?MODULE | A]).
+%% p(F) ->
+%% p(F, []).
+
+%% p(F, A) ->
+%% io:format(user, "~w:" ++ F ++ "~n", [?MODULE|A]).
+
+tsp(F) ->
+ inets_test_lib:tsp(F).
+tsp(F, A) ->
+ inets_test_lib:tsp(F, A).
+
tsf(Reason) ->
test_server:fail(Reason).
diff --git a/lib/inets/test/httpd_test_lib.erl b/lib/inets/test/httpd_test_lib.erl
index 2f5867559a..4b33350cf2 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -79,19 +79,19 @@
%%--------------------------------------------------------------------
%% API
%%------------------------------------------------------------------
+
verify_request(SocketType, Host, Port, Node, RequestStr, Options) ->
- verify_request(SocketType, Host, Port, Node, RequestStr,
- Options, 30000).
+ verify_request(SocketType, Host, Port, Node, RequestStr, Options, 30000).
+
verify_request(SocketType, Host, Port, TranspOpts, Node, RequestStr, Options)
when is_list(TranspOpts) ->
- verify_request(SocketType, Host, Port, TranspOpts, Node, RequestStr,
- Options, 30000);
+ verify_request(SocketType, Host, Port, TranspOpts, Node, RequestStr, Options, 30000);
+
verify_request(SocketType, Host, Port, Node, RequestStr, Options, TimeOut)
when (is_integer(TimeOut) orelse (TimeOut =:= infinity)) ->
- verify_request(SocketType, Host, Port, [], Node, RequestStr,
- Options, TimeOut).
-verify_request(SocketType, Host, Port, TranspOpts, Node, RequestStr,
- Options, TimeOut) ->
+ verify_request(SocketType, Host, Port, [], Node, RequestStr, Options, TimeOut).
+
+verify_request(SocketType, Host, Port, TranspOpts, Node, RequestStr, Options, TimeOut) ->
tsp("verify_request -> entry with"
"~n SocketType: ~p"
"~n Host: ~p"
@@ -101,7 +101,7 @@ verify_request(SocketType, Host, Port, TranspOpts, Node, RequestStr,
"~n Options: ~p"
"~n TimeOut: ~p",
[SocketType, Host, Port, TranspOpts, Node, Options, TimeOut]),
- case (catch inets_test_lib:connect_bin(SocketType, Host, Port, TranspOpts)) of
+ try inets_test_lib:connect_bin(SocketType, Host, Port, TranspOpts) of
{ok, Socket} ->
tsp("verify_request -> connected - now send message"),
SendRes = inets_test_lib:send(SocketType, Socket, RequestStr),
@@ -117,25 +117,37 @@ verify_request(SocketType, Host, Port, TranspOpts, Node, RequestStr,
case request(State#state{request = RequestStr,
socket = Socket}, TimeOut) of
{error, Reason} ->
- tsp("request failed: "
+ tsp("verify_request -> request failed: "
"~n Reason: ~p", [Reason]),
{error, Reason};
NewState ->
- tsp("validate reply: "
+ tsp("verify_request -> validate reply: "
"~n NewState: ~p", [NewState]),
ValidateResult =
validate(RequestStr, NewState, Options, Node, Port),
- tsp("validation result: "
+ tsp("verify_request -> validation result: "
"~n ~p", [ValidateResult]),
inets_test_lib:close(SocketType, Socket),
ValidateResult
end;
ConnectError ->
- tsp("verify_request -> connect failed: "
+ tsp("verify_request -> connect error: "
"~n ~p"
"~n", [ConnectError]),
- tsf({connect_failure, ConnectError})
+ tsf({connect_error, ConnectError,
+ [SocketType, Host, Port, TranspOpts]})
+ catch
+ T:E ->
+ tsp("verify_request -> connect failed: "
+ "~n E: ~p"
+ "~n T: ~p"
+ "~n", [E, T]),
+ tsf({connect_failure,
+ [{type, T},
+ {error, E},
+ {stacktrace, erlang:get_stacktrace()},
+ {args, [SocketType, Host, Port, TranspOpts]}]})
end.
request(#state{mfa = {Module, Function, Args},
diff --git a/lib/inets/test/inets.spec.vxworks b/lib/inets/test/inets.spec.vxworks
deleted file mode 100644
index 6886299226..0000000000
--- a/lib/inets/test/inets.spec.vxworks
+++ /dev/null
@@ -1,5 +0,0 @@
-{topcase, {dir, "../inets_test"}}.
-{skip, {inets_SUITE, ip_mod_cgi, "Requires processes"}}.
-{skip, {inets_SUITE, ip_mod_all_modules, "Requires processes"}}.
-{skip, {inets_SUITE, ssl, "Requires SSL"}}.
-
diff --git a/lib/inets/test/inets_test_lib.erl b/lib/inets/test/inets_test_lib.erl
index bbed35e1f8..0f8671b682 100644
--- a/lib/inets/test/inets_test_lib.erl
+++ b/lib/inets/test/inets_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -31,42 +31,49 @@
send/3, close/2]).
-export([copy_file/3, copy_files/2, copy_dirs/2, del_dirs/1]).
-export([info/4, log/4, debug/4, print/4]).
--export([tsp/1, tsp/2, tsf/1]).
+-export([timestamp/0, formated_timestamp/0]).
+-export([tsp/1, tsp/2, tsf/1, tss/1]).
-export([check_body/1]).
-export([millis/0, millis_diff/2, hours/1, minutes/1, seconds/1, sleep/1]).
--export([oscmd/1, has_ipv6_support/1]).
+-export([oscmd/1, has_ipv6_support/0, has_ipv6_support/1, print_system_info/1]).
+-export([run_on_os/2, run_on_windows/1]).
-export([ensure_started/1]).
-export([non_pc_tc_maybe_skip/4, os_based_skip/1, skip/3, fail/3]).
-export([flush/0]).
-export([start_node/1, stop_node/1]).
+
%% -- Misc os command and stuff
+has_ipv6_support() ->
+ tsp("has_ipv6_support -> no ipv6_hosts config"),
+ {ok, Hostname} = inet:gethostname(),
+ case inet:getaddrs(Hostname, inet6) of
+ {ok, [Addr|_]} when is_tuple(Addr) andalso
+ (element(1, Addr) =/= 0) ->
+ %% We actually need to test that the addr can be used,
+ %% this is done by attempting to create a (tcp)
+ %% listen socket
+ tsp("has_ipv6_support -> check Addr: ~p", [Addr]),
+ case (catch gen_tcp:listen(0, [inet6, {ip, Addr}])) of
+ {ok, LSock} ->
+ tsp("has_ipv6_support -> we are ipv6 host"),
+ gen_tcp:close(LSock),
+ {ok, Addr};
+ _ ->
+ undefined
+ end;
+ _ ->
+ undefined
+ end.
+
has_ipv6_support(Config) ->
case lists:keysearch(ipv6_hosts, 1, Config) of
false ->
%% Do a basic check to se if
%% our own host has a working IPv6 address...
- tsp("has_ipv6_support -> no ipv6_hosts config"),
- {ok, Hostname} = inet:gethostname(),
- case inet:getaddrs(Hostname, inet6) of
- {ok, [Addr|_]} when is_tuple(Addr) andalso
- (element(1, Addr) =/= 0) ->
- %% We actually need to test that the addr can be used,
- %% this is done by attempting to create a (tcp)
- %% listen socket
- tsp("has_ipv6_support -> check Addr: ~p", [Addr]),
- case (catch gen_tcp:listen(0, [inet6, {ip, Addr}])) of
- {ok, LSock} ->
- tsp("has_ipv6_support -> we are ipv6 host"),
- gen_tcp:close(LSock),
- {ok, Addr};
- _ ->
- undefined
- end;
- _ ->
- undefined
- end;
+ has_ipv6_support();
+
{value, {_, Hosts}} when is_list(Hosts) ->
%% Check if our host is in the list of *known* IPv6 hosts
tsp("has_ipv6_support -> Hosts: ~p", [Hosts]),
@@ -88,6 +95,49 @@ has_ipv6_support(Config) ->
oscmd(Cmd) ->
string:strip(os:cmd(Cmd), right, $\n).
+
+print_system_info([]) ->
+ do_print_system_info("System Info");
+print_system_info(Prefix) when is_list(Prefix) ->
+ NewPrefix = lists:flatten(io_lib:format("~s: System Info", [Prefix])),
+ do_print_system_info(NewPrefix).
+
+do_print_system_info(Prefix) ->
+ tsp("~s => "
+ "~n"
+ "~n OS Type: ~p"
+ "~n OS version: ~p"
+ "~n Sys Arch: ~p"
+ "~n CPU Topology: ~p"
+ "~n Num logical procs: ~p"
+ "~n SMP support: ~p"
+ "~n Num schedulers: ~p"
+ "~n Scheduler bindings: ~p"
+ "~n Wordsize: ~p"
+ "~n~n", [Prefix,
+ os:type(), os:version(),
+ erlang:system_info(system_architecture),
+ erlang:system_info(cpu_topology),
+ erlang:system_info(logical_processors),
+ erlang:system_info(smp_support),
+ erlang:system_info(schedulers),
+ erlang:system_info(scheduler_bindings),
+ erlang:system_info(wordsize)]),
+ ok.
+
+
+run_on_windows(Fun) ->
+ run_on_os(windows, Fun).
+
+run_on_os(windows, Fun) ->
+ case os:type() of
+ {win32, _} ->
+ Fun();
+ _ ->
+ ok
+ end.
+
+
%% -- Misc node operation wrapper functions --
start_node(Name) ->
@@ -156,6 +206,17 @@ do_ensure_started(App, Start) when is_function(Start) ->
end.
+ensure_loaded(App) ->
+ case application:load(App) of
+ ok ->
+ ok;
+ {error, {already_loaded,inets}} ->
+ ok;
+ Error ->
+ Error
+ end.
+
+
%% ----------------------------------------------------------------
%% HTTPD starter functions
@@ -165,8 +226,9 @@ start_http_server(Conf) ->
start_http_server(Conf, ?HTTP_DEFAULT_SSL_KIND).
start_http_server(Conf, essl = _SslTag) ->
- tsp("start_http_server(essl) -> entry - try start crypto and public_key"),
+ tsp("start_http_server(essl) -> try start crypto"),
application:start(crypto),
+ tsp("start_http_server(essl) -> try start public_key"),
application:start(public_key),
do_start_http_server(Conf);
start_http_server(Conf, SslTag) ->
@@ -177,23 +239,32 @@ do_start_http_server(Conf) ->
tsp("do_start_http_server -> entry with"
"~n Conf: ~p"
"~n", [Conf]),
- application:load(inets),
- case application:set_env(inets, services, [{httpd, Conf}]) of
+ tsp("do_start_http_server -> load inets"),
+ case ensure_loaded(inets) of
ok ->
- tsp("start_http_server -> httpd conf stored in inets app env"),
- case application:start(inets) of
+ tsp("do_start_http_server -> inets loaded - now set_env for httpd"),
+ case application:set_env(inets, services, [{httpd, Conf}]) of
ok ->
- tsp("start_http_server -> inets started"),
- ok;
- Error1 ->
- tsp("<ERROR> Failed starting application: "
- "~n Error1: ~p", [Error1]),
- Error1
+ tsp("do_start_http_server -> "
+ "httpd conf stored in inets app env"),
+ case (catch application:start(inets)) of
+ ok ->
+ tsp("do_start_http_server -> inets started"),
+ ok;
+ Error1 ->
+ tsp("<ERROR> Failed starting application: "
+ "~n Error1: ~p", [Error1]),
+ tsf({failed_starting_inets, Error1})
+ end;
+ Error2 ->
+ tsp("<ERROR> Failed set application env: "
+ "~n Error: ~p", [Error2]),
+ tsf({failed_set_env, Error2})
end;
- Error2 ->
- tsp("<ERROR> Failed set application env: "
- "~n Error: ~p", [Error2]),
- Error2
+ {error, Reason} ->
+ tsp("do_start_http_server -> failed loading inets"
+ "~n Reason: ~p", [Reason]),
+ tsf({failed_loading_inets, Reason})
end.
start_http_server_ssl(FileName) ->
@@ -213,6 +284,7 @@ do_start_http_server_ssl(FileName) ->
catch do_start_http_server(FileName).
+
%% ----------------------------------------------------------------------
%% print functions
%%
@@ -257,20 +329,49 @@ copy_files(FromDir, ToDir) ->
copy_dirs(FromDirRoot, ToDirRoot) ->
- {ok, Files} = file:list_dir(FromDirRoot),
- lists:foreach(
- fun(FileOrDir) ->
- %% Check if it's a directory or a file
- case filelib:is_dir(filename:join(FromDirRoot, FileOrDir)) of
- true ->
- FromDir = filename:join([FromDirRoot, FileOrDir]),
- ToDir = filename:join([ToDirRoot, FileOrDir]),
- ok = file:make_dir(ToDir),
- copy_dirs(FromDir, ToDir);
- false ->
- copy_file(FileOrDir, FromDirRoot, ToDirRoot)
- end
- end, Files).
+ case file:list_dir(FromDirRoot) of
+ {ok, Files} ->
+ lists:foreach(
+ fun(FileOrDir) ->
+ %% Check if it's a directory or a file
+ case filelib:is_dir(filename:join(FromDirRoot,
+ FileOrDir)) of
+ true ->
+ FromDir = filename:join([FromDirRoot, FileOrDir]),
+ ToDir = filename:join([ToDirRoot, FileOrDir]),
+ case file:make_dir(ToDir) of
+ ok ->
+ copy_dirs(FromDir, ToDir);
+ {error, Reason} ->
+ tsp("<ERROR> Failed creating directory: "
+ "~n ToDir: ~p"
+ "~n Reason: ~p"
+ "~nwhen"
+ "~n ToDirRoot: ~p"
+ "~n ToDirRoot file info: ~p",
+ [ToDir,
+ Reason,
+ ToDirRoot,
+ file:read_file_info(ToDirRoot)]),
+ tsf({failed_copy_dir, ToDir, Reason})
+ end;
+ false ->
+ copy_file(FileOrDir, FromDirRoot, ToDirRoot)
+ end
+ end, Files);
+ {error, Reason} ->
+ tsp("<ERROR> Failed get directory file list: "
+ "~n FromDirRoot: ~p"
+ "~n Reason: ~p"
+ "~nwhen"
+ "~n FromDirRoot file info: ~p",
+ [FromDirRoot,
+ Reason,
+ file:read_file_info(FromDirRoot)]),
+ tsf({failed_list_dir, FromDirRoot, Reason})
+ end.
+
+
del_dirs(Dir) ->
case file:list_dir(Dir) of
@@ -394,56 +495,73 @@ connect_byte(ip_comm, Host, Port, Opts0) ->
connect(ip_comm, Host, Port, Opts).
-connect(ssl, Host, Port, Opts) ->
+%% This always falls back on IPV4, but tries IPV6 first.
+connect(Proto, Host, Port, Opts0) ->
+ Opts = Opts0 -- [inet, inet6],
+ connect(Proto, Host, Port, Opts ++ [inet6], inet6).
+
+connect(ssl, Host, Port, Opts, Type) ->
tsp("connect(ssl) -> entry with"
"~n Host: ~p"
"~n Port: ~p"
- "~n Opts: ~p", [Host, Port, Opts]),
+ "~n Opts: ~p"
+ "~n Type: ~p", [Host, Port, Opts, Type]),
ssl:start(),
- %% Does not support ipv6 in old ssl
+ %% We ignore this option for ssl...
+ %% ...maybe we should really treat this in the same way as ip_comm...
case ssl:connect(Host, Port, Opts) of
{ok, Socket} ->
{ok, Socket};
+ {error, Reason} when Type =:= inet6 ->
+ tsp("connect(ssl) -> failed connecting with inet6: "
+ "~n Reason: ~p"
+ "~n trying inet", [Reason]),
+ connect(ssl, Host, Port, Opts -- [inet6], inet);
{error, Reason} ->
- {error, Reason};
+ tsp("connect(ssl) -> failed connecting: "
+ "~n Reason: ~p", [Reason]),
+ {error, Reason};
Error ->
Error
end;
-connect(ip_comm, Host, Port, Opts) ->
+connect(ip_comm, Host, Port, Opts, Type) ->
tsp("connect(ip_comm) -> entry with"
"~n Host: ~p"
"~n Port: ~p"
- "~n Opts: ~p", [Host, Port, Opts]),
- case gen_tcp:connect(Host,Port, Opts) of
+ "~n Opts: ~p"
+ "~n Type: ~p", [Host, Port, Opts, Type]),
+
+ case gen_tcp:connect(Host, Port, Opts, timer:seconds(10)) of
{ok, Socket} ->
tsp("connect success"),
{ok, Socket};
- {error, nxdomain} ->
- tsp("connect error nxdomain when opts: ~p", [Opts]),
- connect(ip_comm, Host, Port, lists:delete(inet6, Opts));
- {error, eafnosupport} ->
- tsp("connect error eafnosupport when opts: ~p", [Opts]),
- connect(ip_comm, Host, Port, lists:delete(inet6, Opts));
- {error, econnreset} ->
- tsp("connect error econnreset when opts: ~p", [Opts]),
- connect(ip_comm, Host, Port, lists:delete(inet6, Opts));
- {error, enetunreach} ->
- tsp("connect error eafnosupport when opts: ~p", [Opts]),
- connect(ip_comm, Host, Port, lists:delete(inet6, Opts));
- {error, {enfile,_}} ->
- tsp("connect error enfile when opts: ~p", [Opts]),
- {error, enfile};
+
+ {error, Reason} when ((Type =:= inet6) andalso
+ ((Reason =:= timeout) orelse
+ (Reason =:= nxdomain) orelse
+ (Reason =:= eafnosupport) orelse
+ (Reason =:= econnreset) orelse
+ (Reason =:= enetunreach) orelse
+ (Reason =:= econnrefused) orelse
+ (Reason =:= ehostunreach))) ->
+ tsp("connect(ip_comm) -> Connect error: "
+ "~n Reason: ~p"
+ "~n Type: ~p"
+ "~n Opts: ~p", [Reason, Type, Opts]),
+ connect(ip_comm, Host, Port, Opts -- [inet6], inet);
+
Error ->
- tsp("Unexpected error: "
+ tsp("connect(ip_comm) -> Fatal connect error: "
"~n Error: ~p"
"~nwhen"
"~n Host: ~p"
"~n Port: ~p"
"~n Opts: ~p"
- "~n", [Error, Host, Port, Opts]),
+ "~n Type: ~p"
+ "~n", [Error, Host, Port, Opts, Type]),
Error
end.
-
+
send(ssl, Socket, Data) ->
ssl:send(Socket, Data);
@@ -509,12 +627,18 @@ tsp(F) ->
tsp(F, []).
tsp(F, A) ->
Timestamp = formated_timestamp(),
- test_server:format("*** ~s ~p ~p ~w:" ++ F ++ "~n",
- [Timestamp, node(), self(), ?MODULE | A]).
+ test_server:format("*** ~s ~p ~p " ++ F ++ "~n",
+ [Timestamp, node(), self() | A]).
tsf(Reason) ->
test_server:fail(Reason).
+tss(Time) ->
+ test_server:sleep(Time).
+
+timestamp() ->
+ http_util:timestamp().
+
formated_timestamp() ->
format_timestamp( os:timestamp() ).
diff --git a/lib/inets/test/inets_test_lib.hrl b/lib/inets/test/inets_test_lib.hrl
index c578398c55..6a86b1b764 100644
--- a/lib/inets/test/inets_test_lib.hrl
+++ b/lib/inets/test/inets_test_lib.hrl
@@ -50,6 +50,11 @@
-define(OSCMD(Cmd), inets_test_lib:oscmd(Cmd)).
+-define(PRINT_SYSTEM_INFO(P), inets_test_lib:print_system_info(P)).
+
+-define(RUN_ON_OS(OS, FUN), inets_test_lib:run_on_os(OS, FUN)).
+-define(RUN_ON_WINDOWS(FUN), inets_test_lib:run_on_windows(FUN)).
+
%% - Test case macros -
diff --git a/lib/inets/test/rules.mk b/lib/inets/test/rules.mk
index 047c03b267..c4a62a87ed 100644
--- a/lib/inets/test/rules.mk
+++ b/lib/inets/test/rules.mk
@@ -17,17 +17,12 @@ DEFAULT_TARGETS = opt debug instr release release_docs clean docs
# Erlang language section
# ----------------------------------------------------
EMULATOR = beam
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
-# VxWorks object files should be compressed.
-# Other object files should have debug_info.
-ERL_COMPILE_FLAGS += +compressed
-else
+
ifdef BOOTSTRAP
ERL_COMPILE_FLAGS += +slim
else
ERL_COMPILE_FLAGS += +debug_info
endif
-endif
ERLC_WFLAGS = -W
ERLC = erlc $(ERLC_WFLAGS) $(ERLC_FLAGS)
ERL.beam = erl.beam -boot start_clean
diff --git a/lib/inets/vsn.mk b/lib/inets/vsn.mk
index 77eb43a7ed..949eceea7f 100644
--- a/lib/inets/vsn.mk
+++ b/lib/inets/vsn.mk
@@ -18,7 +18,7 @@
# %CopyrightEnd%
APPLICATION = inets
-INETS_VSN = 5.8.1
+INETS_VSN = 5.9.1
PRE_VSN =
APP_VSN = "$(APPLICATION)-$(INETS_VSN)$(PRE_VSN)"
diff --git a/lib/inviso/AUTHORS b/lib/inviso/AUTHORS
deleted file mode 100644
index fc5040fe92..0000000000
--- a/lib/inviso/AUTHORS
+++ /dev/null
@@ -1,4 +0,0 @@
-Original Authors and Contributors:
-
-Lennart Ohman
-
diff --git a/lib/inviso/doc/src/inviso.xml b/lib/inviso/doc/src/inviso.xml
deleted file mode 100644
index c0e2e8f0de..0000000000
--- a/lib/inviso/doc/src/inviso.xml
+++ /dev/null
@@ -1,693 +0,0 @@
-<?xml version="1.0" encoding="latin1" ?>
-<!DOCTYPE erlref SYSTEM "erlref.dtd">
-
-<erlref>
- <header>
- <copyright>
- <year>2006</year><year>2011</year>
- <holder>Ericsson AB. All Rights Reserved.</holder>
- </copyright>
- <legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
-
- </legalnotice>
-
- <title>inviso</title>
- <prepared></prepared>
- <docno></docno>
- <date></date>
- <rev></rev>
- </header>
- <module>inviso</module>
- <modulesummary>Main API Module to the Inviso Tracer</modulesummary>
- <description>
- <warning>
- <p>The <c>inviso</c> application is deprecated and will be
- removed in the R16 release.</p>
- </warning>
- <p>With the <c>inviso</c> API runtime components can be started and tracing managed across a network of distributed Erlang nodes, using a control component also started with <c>inviso</c> API functions.</p>
- <p>Inviso can be used both in a distributed environment and in a non-distributed. API functions not taking a list of nodes as argument works on all started runtime components. If it is the non-distributed case, that is the local runtime component. The API functions taking a list of nodes as argument, or as part of one of the arguments, can not be used in a non-distributed environment. Return values named <c>NodeResult</c> refers to return values from a single Erlang node, and will therefore be the return in the non-distributed environment.</p>
- </description>
- <funcs>
- <func>
- <name>start() -> {ok,pid()} | {error,Reason}</name>
- <name>start(Options) -> {ok,pid()} | {error,Reason}</name>
- <fsummary>Start a control component at the local node</fsummary>
- <type>
- <v>Options = [Option]</v>
- </type>
- <desc>
- <p><c>Options</c> may contain both options which will be default options to a runtime component when started, and options to the control component. See <seealso marker="#add_nodes/3">add_nodes/3</seealso> for details on runtime component options. The control component recognizes the following options:</p>
- <taglist>
- <tag><c>{subscribe,Pid}</c></tag>
- <item>
- <p>Making the process <c>Pid</c> receive Inviso events from the control component.</p>
- <p>Starts a control component process on the local node. A control component must be started before runtime components can be started manually or otherwise accessed through the <c>inviso</c> API.</p>
- </item>
- </taglist>
- </desc>
- </func>
- <func>
- <name>stop() -> shutdown</name>
- <fsummary>Stop the control component</fsummary>
- <desc>
- <p>Stops the control component. Runtime components are left as is. They will behave according to their dependency values.</p>
- </desc>
- </func>
- <func>
- <name>add_node(RTtag) -> NodeResult | {error,Reason}</name>
- <name>add_node(RTtag,Options) -> NodeResult | {error,Reason}</name>
- <fsummary>Starts or adopts a runtime component at the local node</fsummary>
- <type>
- <v>RTtag = PreviousRTtag = term()</v>
- <v>Options = [Option]</v>
- <v>&nbsp;Option -- see below</v>
- <v>&nbsp;Option = {dependency,Dep}</v>
- <v>&nbsp;&nbsp;Dep = int() | infinity</v>
- <d>The timeout, in milliseconds, before the runtime component will terminate if abandoned by <em>this</em>control component.</d>
- <v>&nbsp;Option = {overload,Overload} | overload</v>
- <d>Controls how and how often overload checks shall be performed. Just <c>overload</c>specifies that no loadcheck shall be performed.</d>
- <v>&nbsp;&nbsp;Overload = Interval | {LoadMF,Interval,InitMFA,RemoveMFA}</v>
- <v>&nbsp;&nbsp;&nbsp;LoadMF = {Mod,Func} | function()/1</v>
- <v>&nbsp;&nbsp;&nbsp;Interval = int() | infinity</v>
- <d>Interval is the time in milliseconds between overload checks.</d>
- <v>&nbsp;&nbsp;&nbsp;InitMFA = RemoveMFA = {Mod,Func,ArgList} | void</v>
- <d>When starting up the runtime component or when changing options (see <c>change_options/2</c>) the overload mechanism is initialized with a call to the <c>InitMFA</c>function. It shall return <c>LoadCheckData</c>. Every time a load check is performed, <c>LoadMF</c>is called with <c>LoadCheckData</c>as its only argument. <c>LoadMF</c>shall return <c>ok</c>or <c>{suspend,Reason}</c>. When the runtime component is stopped or made to change options involving changing overload-check, the <c>RemoveMFA</c>function is called. Its return value is discarded.</d>
- <v>NodeResult = {ok,NAns} | {error,Reason}</v>
- <v>&nbsp;NAns = new | {adopted,State,Status,PreviousRTtag} | already_added</v>
- <v>&nbsp;&nbsp;State = new | tracing | idle</v>
- <v>&nbsp;&nbsp;Status = running | {suspended,SReason}</v>
- </type>
- <desc>
- <p>Starts or tries to connect to an existing runtime component at the local node, regardless if the system is distributed or not. <c>Options</c> will override any default options specified at start-up of the control component.</p>
- <p>The <c>PreviousRTtag</c> can indicate if the incarnation of the runtime component at the node in question was started by "us" and then can be expected to do tracing according to "our" instructions or not.</p>
- </desc>
- </func>
- <func>
- <name>add_node_if_ref(RTtag) -> NodeResult | {error,{wrong_reference,OtherTag}} | {error,Reason}</name>
- <name>add_node_if_ref(RTtag,Options) -> NodeResult | {error,{wrong_reference,OtherRef}} | {error,Reason}</name>
- <fsummary>Start or adopt a runtime component at the local node, provided it has a certain rttag</fsummary>
- <type>
- <v>OtherRef = term()</v>
- <d>rttag of the running incarnation</d>
- </type>
- <desc>
- <p>As <seealso marker="#add_node/1">add_node/1,2</seealso> but will only adopt the runtime component if its rttag is <c>RTtag</c>.</p>
- </desc>
- </func>
- <func>
- <name>add_nodes(Nodes,RTtag) -> {ok,NodeResults} | {error,Reason}</name>
- <name>add_nodes(Nodes,RTtag,Options) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Start or adopt runtime components at some nodes</fsummary>
- <type>
- <v>Nodes = [Node]</v>
- <v>NodeResults = [{Node,NodeResult}]</v>
- </type>
- <desc>
- <p>As <seealso marker="#add_node/1">add_node/1,2</seealso> but for a distributed environment.</p>
- </desc>
- </func>
- <func>
- <name>add_nodes_if_ref(Nodes,RTtag) -> NodeResult | {error,Reason}</name>
- <name>add_nodes_if_ref(Nodes,RTtag,Options) -> NodeResult | {error,Reason}</name>
- <fsummary>Start or adopt runtime components at some nodes, provided they have a certain rttag</fsummary>
- <type>
- <v>Nodes = [Node]</v>
- <v>NodeResults = [{Node,NodeResult}]</v>
- </type>
- <desc>
- <p>As <seealso marker="#add_node_if_ref/1">add_node_if_ref/1,2</seealso> but for a distributed environment.</p>
- </desc>
- </func>
- <func>
- <name>stop_nodes() -> {ok,NodeResults} | NodeResult</name>
- <name>stop_nodes(Nodes) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Stop runtime components</fsummary>
- <type>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>Stops runtime component on <c>Nodes</c>. <c>stop_nodes/0</c> will if the control component is running on a distributed node stop all runtime components. And if running on a non distributed node, stop the local and only runtime component.</p>
- </desc>
- </func>
- <func>
- <name>stop_all() = {ok,NodeResults} | NodeResult</name>
- <fsummary>Stop both control and runtime components</fsummary>
- <type>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>A combination of <seealso marker="#stop/0">stop/0</seealso> and <seealso marker="#stop_nodes/0">stop_nodes/0</seealso>.</p>
- </desc>
- </func>
- <func>
- <name>change_options(Options) -> NodeResult | {ok,NodeResults} | {error,Reason}</name>
- <name>change_options(Nodes,Options) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Change options for runtime components</fsummary>
- <type>
- <v>Nodes = [Node]</v>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>Changes the options for one or several runtime components. If for instance overload is redefined, the previous overload will be stopped and the new started. See <seealso marker="#add_node/1">add_node/1</seealso> for details on <c>Options</c>.</p>
- </desc>
- </func>
- <func>
- <name>init_tracing(TracerData) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>init_tracing(TracerList) -> {ok,NodeResults} | {error,Reason}</name>
- <name>init_tracing(Nodes,TracerData) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Initiate tracing</fsummary>
- <type>
- <v>TracerData = [{trace,LogTD} [,{ti,TiTD}] }] | LogTD</v>
- <v>LogTD = {HandlerFun,Data1} | collector | {relayer,CollectingNode} | {ip,IPPortParameters} | {file,FilePortParameters}</v>
- <v>TiTD = {file,FileName} | {file,FileName,TiSpec} | {relay,Node}</v>
- <v>&nbsp;TiSpec = {InitMFA,RemoveMF,CleanMF}</v>
- <v>&nbsp;&nbsp;InitMFA = {Mi,Fi,Argsi}</v>
- <v>&nbsp;&nbsp;RemoveMF = {Mr,Fr} | void</v>
- <v>&nbsp;&nbsp;CleanMF = {Mc,Fc}</v>
- <v>&nbsp;&nbsp;Mi = Fi = Mr = Fr = Mc = Fd = atom()</v>
- <v>&nbsp;&nbsp;Argsi = [term()]</v>
- <v>TracerList = [{Node,TracerData}]</v>
- <v>IPPortParameters = Portno | {Portno,Qsize}</v>
- <v>&nbsp;Portno = tcp_portno()</v>
- <v>&nbsp;Qsize = int()</v>
- <v>FilePortParameters = {Filename,wrap,Tail,{time,WrapTime},WrapCnt} | {FileName,wrap,Tail,WrapSize,WrapCnt} | {FileName,wrap,Tail,WrapSize} | {FileName,wrap,Tail} | FileName</v>
- <v>&nbsp;FileName = string()</v>
- <v>&nbsp;Tail = string() =/= ""</v>
- <v>&nbsp;WrapTime = WrapCnt = WrapSize = int() >0</v>
- <v>TracerList = [{Node,TracerData}]</v>
- <v>Nodes = [Node]</v>
- <v>HandlerFun = function()/2;</v>
- <v>&nbsp;HandlerFun(TraceMsg,Data1) -> NewData</v>
- <v>CollectingNode = pid() | node()</v>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = {ok,LogResults} | {error,NReason}</v>
- <v>&nbsp;LogResults = [LogResult]</v>
- <v>&nbsp;&nbsp;LogResult = {trace_log,LogRes} | {ti_log,LogRes}</v>
- <v>&nbsp;&nbsp;&nbsp;LogRes = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>Starts the tracing at the specified nodes, meaning that the runtime components transits from the state <c>new</c> or <c>idle</c> to <c>tracing</c>. For trace messages to be generated, there must of course also be trace pattern and/or trace flags set. Such can not be set before tracing has been initiated with <c>init_tracing/1,2</c>.</p>
- <p><c>TracerData</c> controls how the runtime component will handle generated trace messages. The <c>trace</c> tag controls how regular trace messages are handled. The <c>ti</c> tag controls if and how trace information will be stored and the meta tracer will be activated. That is if <c>ti</c> is omitted, no meta tracer will be started as part of the runtime component. It is possible to have <c>ti</c> without <c>trace</c>, but most likely not useful.</p>
- <p>The <c>ip</c> and <c>file</c> trace tracerdata instructions results in using the built in trace ip-port and file-port respectively. <c>relayer</c> will result in that all regular trace messages are forwarded to a runtime component at the specified node. Using a <c>HandlerFun</c> will result in that every incoming regular trace message is applied to the <c>HandlerFun</c>. <c>collector</c> can be used to use this runtime component to receive relayed trace messages and print them to the shell.
- </p>
- <p>The trace information can be configured to either write trace information to a plain trace information file or to relay it to another inviso meta tracer on another node. The inviso meta tracer is capable of matching function calls with their function returns (only if <c>return_trace</c> is activated in the meta trace match specification for the function in question). This is necessary since it may not be possible to decide what to do, if anything shall be done at all, until the return value of the function call is examined.
- </p>
- <p>To be able to match calls with returns a state can be saved when detecting a function call in a public loop data structure kept by the inviso meta tracer. The public loop data structure is given as argument to a handler-function called whenever a meta trace message arrives to the inviso meta tracer (both function calls and function returns). The public loop data structure is first initiated by the <c>Mi:Fi</c> function which takes the items in <c>Argsi</c> as arguments. <c>Fi</c> shall return the initial public loop data structure. When meta tracing is stopped, either because tracing is stopped or because tracing is suspended, the <c>Mr:Fr(PublicLoopData)</c> is called to offer a possibility to clean-up. Note that for every function meta-tracing is activated, a public loop data modification function can be specified. That function will prepare the current loop data structure for this particular function.
- </p>
- <p>Further there is a risk that function call states becomes abandoned inside the public loop data structure. This will happen if a function call is entered into the public loop data structure, but no function return occurs. To prevent the public loop data structure from growing infinitely the clean function <c>Fc</c> will periodically be called with the public loop data structure as argument. Elements entered into the public loop data structure as a result of a function call must contain a timestamp for the <c>Fc</c> to be able to conclude if it is abandoned or not. <c>Fc</c> shall return a new public loop data structure.
- </p>
- <p>When initiating tracing involving trace information without a <c>TiSpec</c>, a default public loop data structure will be initiated to handle locally registered process aliases. The default public loop data structure is a two-tuple where the first element is used by the meta tracing on the BIF <c>register/2</c>. The second element is left for user usage.</p>
- <p>The default public loop data structure may be extended with more element positions. The first position must be left to the implementation of registered-name translations. If the public loop data structure is changed no longer meeting this requirement, the <seealso marker="#tpm_localnames/0">tpm_localnames/0,1</seealso> and <seealso marker="#tpm_globalnames/0">tpm_globalnames/0,1</seealso> can no longer be used.</p>
- <p>A wrap files specification is used to limit the disk space consumed by the trace. The trace is written to a limited number of files each with a limited size. The actual filenames are <c>Filename ++ SeqCnt ++ Tail</c>, where <c>SeqCnt</c> counts as a decimal string from 0 to <c>WrapCnt</c> and then around again from 0. When a trace message written to the current file makes it longer than <c>WrapSize</c>, that file is closed, if the number of files in this wrap trace is as many as <c>WrapCnt</c> the oldest file is deleted then a new file is opened to become the current. Thus, when a wrap trace has been stopped, there are at most <c>WrapCnt</c> trace files saved with a size of at least <c>WrapSize</c> (but not much bigger), except for the last file that might even be empty. The default values are <c>WrapSize == 128*1024</c> and <c>WrapCnt == 8</c>.</p>
- <p>The <c>SeqCnt</c> values in the filenames are all in the range 0 through <c>WrapCnt</c> with a gap in the circular sequence. The gap is needed to find the end of the trace.</p>
- <p>If the <c>WrapSize</c> is specified as <c>{time,WrapTime}</c>, the current file is closed when it has been open more than <c>WrapTime</c> milliseconds, regardless of it being empty or not.</p>
- <p>The ip trace driver has a queue of <c>QSize</c> messages waiting to be delivered. If the driver cannot deliver messages as fast as they are produced by the runtime system, they are dropped. The number of dropped messages are indicated in the trace log as separate trace message.</p>
- </desc>
- </func>
- <func>
- <name>stop_tracing(Nodes) -> {ok,NodeResults} | {error,Reason}</name>
- <name>stop_tracing() -> {ok,NodeResults} | NodeResult</name>
- <fsummary>Stop tracing</fsummary>
- <type>
- <v>Nodes = [Node]</v>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = {ok,State} | {error,Reason}</v>
- <v>&nbsp;State = new | idle</v>
- </type>
- <desc>
- <p>Stops tracing on all or specified <c>Nodes</c>. Flushes the trace buffer if a trace-port is used, closes the trace-port and removes all trace flags and meta-patterns. The nodes are called in parallel.</p>
- <p>Stopping tracing means going to state <c><![CDATA[idle<c>. If the runtime component was already in state <c>new]]></c>, it will of course remain in state <c>new</c> (then there was no tracing to stop).</p>
- </desc>
- </func>
- <func>
- <name>clear() -> {ok,NodeResults} | NodeResult</name>
- <name>clear(Nodes,Options) -> {ok,NodeResults} | {error,Reason}</name>
- <name>clear(Options) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <fsummary>Stop tracing and remove meta trace patterns</fsummary>
- <type>
- <v>Nodes = [Node]</v>
- <v>Options = [Option]</v>
- <v>&nbsp;Option = keep_trace_patterns | keep_log_files</v>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>&nbsp;NodeResult = {ok,{new,Status}} | {error,Reason}</v>
- <v>&nbsp;&nbsp;Status = running | {suspended,SReason}</v>
- </type>
- <desc>
- <p>Stops all tracing including removing meta-trace patterns. Removes all trace patterns. If the node is <c>tracing</c> or <c>idle</c>, trace-logs belonging to the current tracerdata are removed. Hence the node is returned to state <c>new</c>. Note that the node can still be suspended.</p>
- <p>Various options can make the node keep set trace patterns and log-files. The node still enters the <c>new</c> state.</p>
- </desc>
- </func>
- <func>
- <name>tp(Nodes,Mod,Func,Arity,MatchSpec,Opts) -> </name>
- <name>tp(Nodes,Mod,Func,Arity,MatchSpec) -> {ok,NodeResults} | {error,Reason}</name>
- <name>tp(Mod,Func,Arity,MatchSpec,Opts) -> </name>
- <name>tp(Mod,Func,Arity,MatchSpec) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>tp(Nodes,PatternList) -> {ok,NodeResults} | {error,Reason}</name>
- <name>tp(PatternList) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <fsummary>Set global trace patterns</fsummary>
- <type>
- <v>Nodes = [Node]</v>
- <v>Mod = Func = atom() | '_'</v>
- <v>Arity = int() | '_'</v>
- <v>MatchSpec = true | false | [] | matchspec()</v>
- <v>PatternList = [Pattern],</v>
- <v>&nbsp;Pattern = {Mod,Func,Arity,MatchSpec,Opts}</v>
- <v>Opts = [Opt]</v>
- <v>&nbsp;Opt = only_loaded</v>
- <v>NodeResults = [NodeResult]</v>
- <v>&nbsp;NodeResult = {ok,[Ans]} | {error,Reason}</v>
- <v>&nbsp;&nbsp;Ans = int() | {error,Reason}</v>
- </type>
- <desc>
- <p>Set trace pattern (global) on specified or all nodes. The integer replied if the call was successfully describes the number of matched functions. The functions without a <c>Nodes</c> argument means all nodes, in a non-distributed environment it means the local node. Using wildcards follows the rules for wildcards of <c>erlang:trace_pattern/3</c>. It is for instance illegal to specify <c>M == '_'</c> while <c>F</c> is not <c>'_'</c>.</p>
- <p>When calling several nodes, the nodes are called in parallel.</p>
- <p>The option <c>only_loaded</c> will prevent modules not loaded (yet) into the runtime system to become loaded just as a result of that a trace pattern is requested to be set on it. Otherwise modules are automatically loaded if not already loaded (since the module must be present for a trace pattern to be set on it). The latter does not apply if the wildcard <c>'_'</c> is used as module specification.</p>
- </desc>
- </func>
- <func>
- <name>tpl(Nodes,Mod,Func,Arity,MatchSpec) -> </name>
- <name>tpl(Nodes,Mod,Func,Arity,MatchSpec,Opts) -> {ok,NodeResults} | {error,Reason}</name>
- <name>tpl(Mod,Func,Arity,MatchSpec) -> </name>
- <name>tpl(Mod,Func,Arity,MatchSpec,Opts) -> {ok,NodeResults} | NodeResult| {error,Reason}</name>
- <name>tpl(Nodes,PatternList) -> {ok,NodeResults} | {error,Reason}</name>
- <name>tpl(PatternList) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <fsummary>Set local trace patterns</fsummary>
- <desc>
- <p>See <seealso marker="#tp/6">tp/N</seealso> function above for details on arguments and return values.</p>
- <p>Set local trace pattern on specified functions. When calling several nodes, the nodes are called in parallel.</p>
- </desc>
- </func>
- <func>
- <name>ctp(Nodes,Mod,Func,Arity) -> {ok,NodeResults} | {error,Reason}</name>
- <name>ctp(Mod,Func,Arity) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <fsummary>Clear global trace patterns</fsummary>
- <desc>
- <p>See <seealso marker="#tp/6">tp/N</seealso> for argument descriptions.</p>
- <p>Clear global trace patterns. When calling several nodes, the nodes are called in parallel.</p>
- </desc>
- </func>
- <func>
- <name>ctpl(Nodes,Mod,Func,Arity) -> {ok,NodeResults} | {error,Reason}</name>
- <name>ctpl(Mod,Funct,Arity) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <fsummary>Clear local trace patterns</fsummary>
- <desc>
- <p>See <seealso marker="#tp/6">tp/N</seealso> for argument description.</p>
- <p>Clear local trace patterns. When calling several nodes, the nodes are called in parallel.</p>
- </desc>
- </func>
- <func>
- <name>tf(Nodes,PidSpec,FlagList) -> {ok,NodeResults} | {error,Reason}</name>
- <name>tf(PidSpec,FlagList) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>tf(Nodes,TraceConfList) -> {ok,NodeResults} | {error,Reason}</name>
- <name>tf(NodeTraceConfList) -> {ok,NodeResults} | {error,Reason}</name>
- <name>tf(TraceConfList) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <fsummary>Set process trace flags</fsummary>
- <type>
- <v>Nodes = [Node]</v>
- <v>NodeTraceConfList = [{Node,TraceConfList}]</v>
- <v>TraceConfList = [{PidSpec,FlagList}]</v>
- <v>FlagList = [Flag]</v>
- <v>PidSpec = all | new| existing | pid() | locally_registered_name()</v>
- <v>Flag -- see erlang:trace/3</v>
- <v>NodeResult = {ok,[Ans]} | {error,Reason}</v>
- <v>Ans = int() | {error,Reason}</v>
- </type>
- <desc>
- <p>Set process trace flags on processes on all or specified nodes. The integer returned if the call was successful describes the matched number of processes. The functions without a <c>Nodes</c> argument means all nodes, in a non-distributed environment it means the local node.
- </p>
- <p>There are many combinations which does not make much sense. For instance specifying a certain process identifier at all nodes. Or an empty <c>TraceConfList</c> for all nodes.</p>
- <p>When calling several nodes, the nodes are called in parallel.</p>
- </desc>
- </func>
- <func>
- <name>ctf(Nodes,PidSpec,FlagList) -> {ok,NodeResults} | {error,Reason}</name>
- <name>ctf(PidSpec,FlagList) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>ctf(Nodes,TraceConfList) -> {ok,NodeResults} | {error,Reason}</name>
- <name>ctf(TraceConfList) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <fsummary>Clear process trace flags</fsummary>
- <desc>
- <p>See <seealso marker="#tf/3">tf/N</seealso> for arguments and return value description.</p>
- <p>Clear process trace flags on all or specified nodes. When calling several nodes, the nodes are called in parallel.</p>
- </desc>
- </func>
- <func>
- <name>ctf_all(Nodes) -> {ok,NodeResults} | {error,Reason}</name>
- <name>ctf_all() -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <fsummary>Clear all process trace flags</fsummary>
- <type>
- <v>Nodes = [Node]</v>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>Clears all trace flags on all or specified nodes. Just for convenience.</p>
- </desc>
- </func>
- <func>
- <name>init_tpm(Mod,Func,Arity,CallFunc) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>init_tpm(Nodes,Mod,Func,Arity,CallFunc) -> {ok,NodeResults} | {error,Reason}</name>
- <name>init_tpm(Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>init_tpm(Nodes,Mod,Func,Arity, InitFunc,CallFunc,ReturnFunc,RemoveFunc) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Initialize meta tracing</fsummary>
- <type>
- <v>Mod = Func = atom()</v>
- <v>Arity = int()</v>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = ok | {error,Reason}</v>
- <v>InitFunc,RemoveFunc = {Module,Function} | function()/4 | void</v>
- <v>CallFunc = ReturnFunc = {Module,Function} | function()/3 | void</v>
- </type>
- <desc>
- <p>Initializes <c>Mod:Func/Arity</c> for meta tracing without setting any meta trace patterns. This is necessary if the named match specs will be used (see <seealso marker="#tpm_ms/5">tpm_ms/5,6</seealso>). Otherwise initialization of public loop data can be done at the same time as setting meta trace patterns using <seealso marker="#tpm/8">tpm/8,9</seealso>.</p>
- <p>Note that we can not use wildcards here (even if it is perfectly legal in Erlang). It also sets the <c>CallFunc</c> and <c>ReturnFunc</c> for the meta traced function. That is the functions which will be called when a function call and a return_trace meta trace message respectively arrives to the inviso meta tracer for <c>Mod:Func/Arity</c>.</p>
- <p>This function is also available without <c>InitFunc</c> and <c>RemoveFunc</c>. That means that no initialization of the public loop data structure will be done and that <c>CallFunc</c> and <c>ReturnFunc</c> must either use already existing parts of public loop data structure or not use it at all.</p>
- <p>The <c>InitFunc</c> initializes the already existing public loop data structure for use with <c>Mod:Func/Arity. InitFunc(Mod,Func,Arity,PublLD) -> {ok,NewPublLD,Output}</c> where <c>OutPut</c> can be a binary which will then be written to the trace information file. If it is not a binary, no output will be done. <c>RemoveFunc</c> will be called when the meta tracing is cleared with <seealso marker="#ctpm/3">ctpm/3,4</seealso>. <c>RemoveFunc(Mod,Func,Arity,PublLD) -> {ok,NewPublLD}</c>.</p>
- <p>See <seealso marker="#tpm/4">tpm/N</seealso> for details on <c>CallFunc</c> and <c>ReturnFunc</c>.</p>
- </desc>
- </func>
- <func>
- <name>tpm(Mod,Func,Arity,MS) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>tpm(Nodes,Mod,Func,Arity,MS) -> {ok,NodeResults} | {error,Reason}</name>
- <name>tpm(Mod,Func,Arity,MS,CallFunc) -> {ok,NodeResults} | NodeResults | {error,Reason}</name>
- <name>tpm(Nodes,Mod,Func,Arity,MS,CallFunc) -> {ok,NodeResults} | {error,Reason}</name>
- <name>tpm(Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc) -> {ok,NodeResults} | NodeResults | {error,Reason}</name>
- <name>tpm(Nodes,Mod,Func,Arity,MS, InitFunc,CallFunc,ReturnFunc,RemoveFunc) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Activate meta tracing</fsummary>
- <type>
- <v>Mod = Func = atom()</v>
- <v>Arity = int()</v>
- <v>MS = [match_spec()]</v>
- <v>Nodes = [Node]</v>
- <v>InitFunc = RemoveFunc = {Module,Function} | function()/4 | void</v>
- <v>CallFunc = ReturnFunc = {Module,Function} | function()/3 | void</v>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = {ok,1} | {ok,0} | {error,Reason}1</v>
- </type>
- <desc>
- <p>Activates meta-tracing in the inviso_rt_meta tracer. Except when using <c>tpm/6</c>, <c>tpm/8</c> and <c>tpm/9</c> the <c>Mod:Func/Arity</c> must first have been initiated using <seealso marker="#init_tpm/4">init_tpm/N</seealso>. When calling several nodes, the nodes are called in parallel.</p>
- <p><c>CallFunc</c> will be called every time a meta trace message arrives to the inviso meta tracer because of a call to <c>Func</c>. <c>CallFunc(CallingPid,ActualArgList,PublLD) -> {ok,NewPrivLD,Output}</c> where <c>Output</c> can be a binary or <c>void</c>. If it is a binary it will be written to the trace information file.</p>
- <p><c>ReturnFunc</c> will be called every time a meta return_trace message arrives to the inviso meta tracer because of a return_trace of a call to <c>Func</c>. <c>ReturnFunc(CallingPid,ReturnValue,PublLD) -> {ok,NewPrivLD,Output}</c>. Further the <c>ReturnFunc</c> must handle the fact that a return_trace message arrives for a call which was never noticed. This because the message queue of the meta tracer may have been emptied.</p>
- </desc>
- </func>
- <func>
- <name>tpm_tracer(Mod,Func,Arity,MS) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>tpm_tracer(Nodes,Mod,Func,Arity,MS) -> {ok,NodeResults} | {error,Reason}</name>
- <name>tpm_tracer(Mod,Func,Arity,MS,CallFunc) -> {ok,NodeResults} | NodeResults | {error,Reason}</name>
- <name>tpm_tracer(Nodes,Mod,Func,Arity,MS,CallFunc) -> {ok,NodeResults} | {error,Reason}</name>
- <name>tpm_tracer(Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc) -> {ok,NodeResults} | NodeResults | {error,Reason}</name>
- <name>tpm_tracer(Nodes,Mod,Func,Arity,MS, InitFunc,CallFunc,ReturnFunc,RemoveFunc) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Activate meta tracing and at the same time append a {tracer,Tracer} process trace flag to the enable list in a match specification <c>trace</c>action term</fsummary>
- <desc>
- <p>See tpm/X for details on arguments and return values.</p>
- <p>Same as tpm/X but all match specs in <c>MS</c> containing a <c>trace</c> action term will have a <c>{tracer,Tracer}</c> appended to its enable-list. <c>Tracer</c> will be the current output for regular trace messages as specified when tracing was initiated. This function is useful when setting a meta trace pattern on a function with the intent that its execution shall turn tracing on for the process executing the match-spec in the meta trace pattern. The reason the <c>tracer</c> process trace flag can not be explicitly written in the action term by the user is that it may be difficult to learn its exact value for a remote node. Further more inviso functions are made to work on several nodes at the same time, requiring different match specs to be set for different nodes.</p>
- <p>Simple example: We want any process executing the function <c>mymod:init(1234)</c> (with the argument, exactly the integer 1234) to begin function-call tracing. In the example, if the process is found to be one that shall start call tracing, we also first disable <c>all</c> process trace flags to ensure that we have full control over what the process traces. <c>void</c> in the example specifies that the meta-tracer (inviso_rt_meta) will not call any function when meta trace messages for <c>mymod:init/1</c> arrives. There is no need for a <c>CallFunc</c> since the side-effect (start call-tracing) is achieved immediately with the match-spec.</p>
- <code type="none">
- inviso:tpm_tracer(mymod,init,1,[{[1234],[],[{trace,[all],[call]}]}],void). </code>
- <p>This will internally, by the meta tracer on each Erlang node, be translated to:</p>
- <code type="none">
- erlang:trace_pattern({mymod,init,1},[{[1234],[],[{trace,[all],[call,{{tracer,T}}]}]}],[{meta,P}]).
- </code>
- <p>Where <c>T</c> is the tracer for regular trace messages (most often a trace-port, but can be the runtime component inviso_rt process), and <c>P</c> is the meta tracer (the inviso_rt_meta process).</p>
- </desc>
- </func>
- <func>
- <name>tpm_ms(Mod,Func,Arity,MSname,MS) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>tpm_ms(Nodes,Mod,Func,Arity,MSname,MS) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Add match specifications</fsummary>
- <type>
- <v>Nodes = [Node]&lt;v> &lt;v>Mod = Func = atom()&lt;v> &lt;v>Arity = int()&lt;v> &lt;v>MSname = term()&lt;v> &lt;v>MS = [match_spec()]&lt;v> &lt;v>NodeResults = [{Node,NodeResult}]&lt;v> &lt;v>NodeResult = {ok,1} | {ok,0} | {error,Reason}&lt;v></v>
- </type>
- <desc>
- <p>This function adds a list of match-specs to the already existing ones. It uses an internal database to keep track of existing match-specs. This set of match specs can hereafter be referred to with the name <c>MSname</c>. If the match-spec does not result in any meta traced functions (for whatever reason), the <c>MS</c> is not saved in the database. The previously known match-specs are not removed. If <c>MSname</c> is already in use as a name referring to a set of match-specs for this particular meta-traced function, the previous set of match-specs are replaced with <c>MS</c>.</p>
- <p><c>Mod:Func/Arity</c> must previously have been initiated in order for this function to add a match-spec.</p>
- <p>When calling several nodes, the nodes are called in parallel. <c>{ok,1}</c> indicates success.</p>
- </desc>
- </func>
- <func>
- <name>tpm_ms_tracer(Mod,Func,Arity,MSname,MS) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>tpm_ms_tracer(Nodes,Mod,Func,Arity,MSname,MS) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Add match specifications and at the same time append a {tracer,Tracer} process trace flag to the enable list in a match specification <c>trace</c>action term</fsummary>
- <desc>
- <p>See tpm_ms/X for details on arguments and return values, and tpm_tracer/X for explanations about the appending of <c>{tracer,Tracer}</c> process trace flag.</p>
- </desc>
- </func>
- <func>
- <name>ctpm_ms(Mod,Func,Arity,MSname) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>ctpm_ms(Nodes,Mod,Func,Arity,MSname) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Remove a match specification</fsummary>
- <type>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>Removes a named match-spec from the meta traced function. Note that it never is a fault to remove a match spec. Not even from a function which is non existent.</p>
- <p>When calling several nodes, the nodes are called in parallel.</p>
- </desc>
- </func>
- <func>
- <name>ctpm(Mod,Func,Arity) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>ctpm(Nodes,Mod,Func,Arity) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Remove a meta trace pattern</fsummary>
- <type>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>Removes the meta trace pattern for the function, means stops generating output for this function. The public loop data structure may be cleared by the previously entered <c>RemoveFunc</c>.</p>
- <p>When calling several nodes, the nodes are called in parallel.</p>
- </desc>
- </func>
- <func>
- <name>tpm_localnames() -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>tpm_localnames(Nodes) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Set meta trace pattern on <c>register/2</c></fsummary>
- <type>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = {R1,R2}</v>
- <v>R1 = R2 = {ok,0} | {ok,1} | {error,Reason}</v>
- </type>
- <desc>
- <p>Quick version for setting meta-trace patterns on <c>erlang:register/2</c>. It uses a default <c>CallFunc</c> and <c>ReturnFunc</c> in the meta-tracer server. The main purpose of this function is to create ti-log entries for associations between pids and registered name aliases. The implementation uses return_trace to see if the registration was successful or not, before actually making the ti-log alias entry. Further the implementation also meta traces the BIF <c>unregister/1</c>.</p>
- <p>If both <c>N1</c> and <c>N2</c> is 1, function call was successful. <c>N1</c> and <c>N2</c> represent setting meta trace pattern on <c>register/2</c> and <c>unregister/1</c>.</p>
- </desc>
- </func>
- <func>
- <name>ctpm_localnames() -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>ctpm_localnames(Nodes) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Clear meta trace pattern on <c>register/2</c></fsummary>
- <type>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = {R1,R2}</v>
- <v>R1 = R2 = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>Function for removing previously set patters by <seealso marker="#tpm_localnames/0">tpm_localnames/0</seealso>. The two results <c>R1</c> and <c>R2</c> represents that meta pattern is removed from both <c>register/2</c> and <c>unregister/1</c>.</p>
- </desc>
- </func>
- <func>
- <name>tpm_globalnames() -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>tpm_globalnames(Nodes) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Set meta trace pattern on <c>global:register_name/2</c></fsummary>
- <type>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = {R1,R2}</v>
- <v>R1 = R2 = {ok,0} | {ok,1} | {error,Reason}</v>
- </type>
- <desc>
- <p>Quick version for setting meta-trace patterns capable of learning the association of a pid with a globally registered name (registered using <c>global:register_name</c>). The implementation meta-traces on <c>global:handle_call({register,'_','_','_'},'_','_')</c> and <c>global:delete_global_name/2</c>. The <c>N1</c> and <c>N2</c> represents the success of the two sub-tmp calls.</p>
- </desc>
- </func>
- <func>
- <name>ctpm_globalnames() -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>ctpm_globalnames(Nodes) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Clear meta trace pattern on <c>global:register_name/2</c></fsummary>
- <type>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = {R1,R2} | {error,Reason}</v>
- <v>R1 = R2 = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>Function for removing previously set meta patters by <seealso marker="#tpm_globalnames/0">tpm_globalnames/0,1</seealso>. The two results <c>R1</c> and <c>R2</c> represents that meta pattern are removed from both <c>global:handle_call/3</c> and <c>global:delete_global_name/1</c>.</p>
- </desc>
- </func>
- <func>
- <name>ctp_all() -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>ctp_all(Nodes) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Clear all (global and local) trace patterns</fsummary>
- <type>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>Clears all, both global and local trace patterns. Does not clear meta trace patterns. Equivalent to a call to <seealso marker="#ctp/4">ctp/3,4</seealso> and to <seealso marker="#ctpl/4">ctpl/3,4</seealso> with wildcards <c>'_'</c> for all modules, functions and arities.</p>
- </desc>
- </func>
- <func>
- <name>suspend(SReason) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>suspend(Nodes,SReason) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Suspend runtime components</fsummary>
- <type>
- <v>SReason = term()</v>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>Suspends the runtime components. <c>SReason</c> will become the suspend-reason replied in for instance a <seealso marker="#get_status/0">get_status/0,1</seealso> call. A runtime component that becomes suspended removes all trace flags and all meta trace patterns. In that way trace output is no longer generated. The task of reactivating a suspended runtime component is outside the scoop of inviso. It can for instance be implemented by a higher layer trace-tool "remembering" all trace flags and meta patterns set.</p>
- </desc>
- </func>
- <func>
- <name>cancel_suspension() -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>cancel_suspend(Nodes) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Reactivate suspended runtime components</fsummary>
- <type>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>Makes the runtime components <c>running</c> again (as opposite to <c>suspended).</c> Since reactivating previous trace flags and meta trace patterns is outside the scoop of inviso, cancelling suspension is simply making it possible to set trace flags and meta trace patterns again.</p>
- </desc>
- </func>
- <func>
- <name>get_status() -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>get_status(Nodes) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Get status of runtime components</fsummary>
- <type>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = {ok,{State,Status}} | {error,Reason}</v>
- <v>State = new | idle | tracing</v>
- <v>Status = running | {suspended,SReason}</v>
- <v>SReason = term()</v>
- </type>
- <desc>
- <p>Finds out the state and status of a runtime component. A runtime component is in state <c>new</c> before it has been initiated to do any tracing the first time. There are clear-functions which can make a runtime component become <c>new</c> again without having to restart. A runtime component becomes <c>idle</c> after tracing is stopped.</p>
- </desc>
- </func>
- <func>
- <name>get_tracerdata() -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>get_tracerdata(Nodes) -> {ok,NodeResults} | {error,Reason}</name>
- <fsummary>Get tracerdata of runtime components</fsummary>
- <type>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = {ok,NResult} | {error,Reason}</v>
- <v>NResult = TracerData | no_tracerdata</v>
- </type>
- <desc>
- <p>Returns the current tracerdata of a runtime component. A runtime component in state <c>new</c> can not have tracerdata. An <c>idle</c> runtime component does have tracerdata, the last active tracerdata. <c>TracerData</c> will be a term as specified to <c>init_tracing</c> when tracing was initiated for the runtime component.</p>
- </desc>
- </func>
- <func>
- <name>list_logs() -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>list_logs(Nodes) -> {ok,NodeResults} | {error,Reason}</name>
- <name>list_logs(NodeTracerData) -> {ok,NodeResults} | {error,Reason}</name>
- <name>list_logs(TracerData) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <fsummary>Get log file names associated with tracerdata</fsummary>
- <type>
- <v>TracerData -- see init_tracing/1,2</v>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = {ok,FileList} | {ok,no_log} | {error,Reason}</v>
- <v>&nbsp;FileList = [FileType]</v>
- <v>&nbsp;&nbsp;FileType = {trace_log,Dir,Files} | {ti_log,Dir,Files}</v>
- <v>&nbsp;&nbsp;Files = [FileNameWithOutPath]</v>
- </type>
- <desc>
- <p>Returns the actually existing log files associated with <c>TracerData</c>. If a tracerdata is not specified, current tracerdata is used for that particular runtime component. <c>Files</c> will be a list of one or more files should it be a wrap-set. Otherwise the it is a list of only one filename.</p>
- <p>This function is useful to learn the name and path of all files belonging to a trace. This information can later be used to move those files for merging. Note that since it is possible to ask on other tracerdata than the current, it is possible to learn filenames of previously done traces, under the circumstances that they have not been removed.</p>
- </desc>
- </func>
- <func>
- <name>fetch_log(LogSpecList,DestDir,Prefix) -> {ok,NodeResults} | {error,not_distributed} | {error,Reason} </name>
- <name>fetch_log(DestDir,Prefix) -> {ok,NodeResults} | {error,not_distributed} | {error,Reason}</name>
- <fsummary>Fetch log files to control component node</fsummary>
- <type>
- <v>DestDir = string()</v>
- <v>Prefix = string()</v>
- <v>LogSpecList = [LogSpec]</v>
- <v>&nbsp;LogSpec = {Node,FileSpecList} | Node | {Node,TracerData}</v>
- <v>TracerData = see init_tracing/1,/2</v>
- <v>FileSpecList = [{trace_log,Dir,FileList},{ti_log,Dir,FileList}] | [{trace_log,Dir,FileList}]</v>
- <v>&nbsp;FileList = [RemoteFileName]</v>
- <v>NodeResult = {Conclusion,ResultFileSpec} | no_log | {error,NReason}</v>
- <v>&nbsp;NReason = own_node | Reason</v>
- <v>&nbsp;Conclusion = complete | incomplete</v>
- <v>&nbsp;ResultFileSpec = [{trace_log,FileResults},{ti_log,FileResults}]</v>
- <v>&nbsp;&nbsp;FileResults = [FileResult]</v>
- <v>&nbsp;&nbsp;&nbsp; FileResult = {ok,FileName} | {error,FReason}</v>
- <v>&nbsp;&nbsp;&nbsp;&nbsp;FReason = {file_open,{posix(),FileName}} | {file_open,{posix(),RemoteFileName}} | {file_open,{posix(),[DestDir,Prefix,RemoteFileName]}} | {file_write,{posix(),FileName}} | {truncated,FileName} | {truncated,{Reason,FileName}}</v>
- <v>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;posix() = atom()</v>
- </type>
- <desc>
- <p>Copies log files over distributed erlang to the control component node. This function can only be used in a distributed system.</p>
- <p>The resulting transferred files will have the prefix <c>Prefix</c> and will be located in <c>DestDir</c>. The source files can either be pointed out using a <c>FileListSpec</c> or tracerdata. If no files are explicitly specified, current tracerdata for that node will be used. Note that if source files have the same name (on several nodes) they will overwrite each other at <c>DestDir</c>.</p>
- </desc>
- </func>
- <func>
- <name>delete_log(Nodes,TracerData) -> {ok,NodeResults} | {error,Reason}</name>
- <name>delete_log(NodeSpecList) -> {ok,NodeResults} | {error,Reason}</name>
- <name>delete_log(Spec) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>delete_log(TracerData) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <name>delete_log() -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <fsummary>Delete log files associated with tracerdata</fsummary>
- <type>
- <v>Nodes = [Node]</v>
- <v>NodeSpecList = [{Node,Spec}]</v>
- <v>&nbsp;Spec = [AbsPathFileName] | LogSpecs</v>
- <v>&nbsp;&nbsp;LogSpecs = [LogSpec]</v>
- <v>&nbsp;&nbsp;&nbsp;LogSpec = {trace_log,Dir,[FileNameWithoutPath]} | {ti_log,Dir,[FileNameWithoutPath]}</v>
- <v>TracerData -- see init_tracing/1,/2</v>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = {ok,no_log} | {ok,LogInfos} | {ok,FileInfos}</v>
- <v>&nbsp;LogInfos = [LogInfo]</v>
- <v>&nbsp;&nbsp;LogInfo = {trace_log,FileInfos} | {ti_log,FileInfos}</v>
- <v>&nbsp;FileInfos = [FileInfo]</v>
- <v>&nbsp;&nbsp;FileInfo = {ok,FileName} | {error,Reason} </v>
- </type>
- <desc>
- <p>Deletes listed files or files corresponding to tracerdata. If no tracerdata or list of files are specified in the call, current tracerdata at the runtime components will be used to identify files to delete. All filenames shall be strings.</p>
- <p><c>FileName</c> can either be an absolute path or just a filename depending on if <c>AbsPathFileName</c> or a <c>LogSpec</c> was used to identify the file.</p>
- </desc>
- </func>
- <func>
- <name>subscribe() -> ok | {error,Reason}</name>
- <name>subscribe(Pid) -> ok | {error,Reason}</name>
- <fsummary>Subscribe to Inviso events</fsummary>
- <type>
- <v>Pid = pid()</v>
- </type>
- <desc>
- <p>Adds <c>Pid</c> or <c>self()</c> if using <c>subscribe/0</c> to the inviso-event sending list. Note that it is possible to add a pid several times and that the <c>Pid</c> then will receive multiple copies of inviso-event messages.</p>
- <p>All events will be sent to all subscribers in the event sending list.</p>
- <code type="none">
-Event = {inviso_event,ControllerPid,erlang:localtime(),Msg}
- Msg = {connected, Node, {RTtag, {State,Status}}}
- | {disconnected, Node, NA}
- | {state_change,Node,{State,Status}}
- | {port_down,Node,Reason}
- Node = node() | local_runtime
- </code>
- <p>Subscribing to inviso-event may be necessary for a higher layer trace-tool using inviso to follow the runtime components. <c>local_runtime</c> will be used for a runtime component running in a non-distributed environment.</p>
- </desc>
- </func>
- <func>
- <name>unsubscribe() -> ok</name>
- <name>unsubscribe(Pid) -> ok</name>
- <fsummary>Unsubscribe to Inviso events</fsummary>
- <desc>
- <p>Removes <c>Pid</c> (once) from the subscription list.</p>
- </desc>
- </func>
- </funcs>
-</erlref>
-
diff --git a/lib/inviso/doc/src/inviso_as_lib.xml b/lib/inviso/doc/src/inviso_as_lib.xml
deleted file mode 100644
index 1f4961166c..0000000000
--- a/lib/inviso/doc/src/inviso_as_lib.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="latin1" ?>
-<!DOCTYPE erlref SYSTEM "erlref.dtd">
-
-<erlref>
- <header>
- <copyright>
- <year>2006</year>
- <year>2011</year>
- <holder>Ericsson AB, All Rights Reserved</holder>
- </copyright>
- <legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
-
- The Initial Developer of the Original Code is Ericsson AB.
- </legalnotice>
-
- <title>inviso_as_lib</title>
- <prepared></prepared>
- <docno></docno>
- <date></date>
- <rev></rev>
- </header>
- <module>inviso_as_lib</module>
- <modulesummary>The Inviso Autostart Utility Library</modulesummary>
- <description>
- <p>The purpose of the Inviso autostart utility library is to facilitate the creation and modification of autostart configuration files used by the standard autostart.</p>
- </description>
- <funcs>
- <func>
- <name>setup_autostart(Node, R, Opts, TracerData, CmdFiles, Bindings, Transl, RTtag) -> ok | {error, Reason}</name>
- <fsummary>Create an autostart configuration file</fsummary>
- <type>
- <v>Node = atom()</v>
- <v>R = int()</v>
- <v>Opts -- see inviso:add_nodes/2,3</v>
- <v>TracerData -- see inviso:init_tracing/1,2</v>
- <v>CmdFiles = [CmdFile]</v>
- <v>&nbsp;CmdFile = string()</v>
- <v>Bindings = [{Var,Val}]</v>
- <v>&nbsp;Var = atom()</v>
- <v>&nbsp;Val = term()</v>
- <v>Transl = [{{M1,F1,Arity}, {M2,F2,{Mt,Ft}}}]</v>
- <v>&nbsp;M1 = F1 = M2 = F2 = Mt = Ft = atom()</v>
- <v>&nbsp;Arity = int()</v>
- <v>RTtag = term()</v>
- <v>Reason = term()</v>
- </type>
- <desc>
- <p>Creates an autostart configuration file on <c>Node</c>. The name of the file is automatically deducted from consulting the Runtime_Tools configuration parameters at <c>Node</c>.</p>
- <p><c>R</c> is the number of allowed autostarts remaining.</p>
- <p><c>Opts</c> is the options which shall be given to the runtime component. See <seealso marker="inviso#add_nodes/2">inviso:add_nodes/2,3</seealso>.</p>
- <p><c>TracerData</c> is used when initiating tracing on this node. See <seealso marker="inviso#init_tracing/1">inviso:init_tracing/1,2</seealso>.</p>
- <p><c>CmdFiles</c> points out files containing instructions understood by the <c>inviso_autostart_server</c> implementation of an autostart initiator.</p>
- <p><c>Bindings</c> is a list of <c>{Var, Val}</c> tuples, where <c>Var</c> is the name of a variable and <c>Val</c> the actual value of the variable.</p>
- <p><c>Transl</c> means that <c>M1:F1/Arity</c> shall be translated into <c>M2:F2</c>.</p>
- <p><c>RTtag</c> is the incarnation tag of the runtime component. See See <seealso marker="inviso#add_nodes/2">inviso:add_nodes/2,3</seealso>.</p>
- </desc>
- </func>
- <func>
- <name>set_repeat(Node, R) -> ok | {error, Reason}</name>
- <fsummary>Set the repeat parameter in the autostart file</fsummary>
- <type>
- <v>Node = atom()</v>
- <v>R = int()</v>
- <v>Reason = term()</v>
- </type>
- <desc>
- <p>Sets the repeat parameter in the autostart file at <c>Node</c> without changing any of its other contents. The autostart configuration file must exist.</p>
- <p><c>R</c> is the number of allowed autostarts remaining.</p>
- </desc>
- </func>
- <func>
- <name>inhibit_autostart(Node) -> ok | {error, Reason}</name>
- <fsummary>Set the repeat parameter in the autostart file to 0</fsummary>
- <type>
- <v>Node = atom()</v>
- <v>Reason = term()</v>
- </type>
- <desc>
- <p>Sets the repeat parameter in the autostart file at <c>Node</c> to 0. Equivalent to <c>set_repeat(Node, 0)</c>.</p>
- </desc>
- </func>
- </funcs>
-</erlref>
-
diff --git a/lib/inviso/doc/src/inviso_chapter.xml b/lib/inviso/doc/src/inviso_chapter.xml
deleted file mode 100644
index b69fb97586..0000000000
--- a/lib/inviso/doc/src/inviso_chapter.xml
+++ /dev/null
@@ -1,362 +0,0 @@
-<?xml version="1.0" encoding="latin1" ?>
-<!DOCTYPE chapter SYSTEM "chapter.dtd">
-
-<chapter>
- <header>
- <copyright>
- <year>2006</year><year>2011</year>
- <holder>Ericsson AB. All Rights Reserved.</holder>
- </copyright>
- <legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
-
- </legalnotice>
-
- <title>Inviso</title>
- <prepared></prepared>
- <docno></docno>
- <date></date>
- <rev></rev>
- <file>inviso_chapter.xml</file>
- </header>
-
- <section>
- <p><em>inviso</em>: (Latin) to go to see, visit, inspect, look at.</p>
- <warning>
- <p>The <c>inviso</c> application is deprecated and will be
- removed in the R16 release.</p>
- </warning>
- <title>Introduction</title>
- <p>The Inviso trace system consists of one or several runtime components supposed to run on each Erlang node doing tracing and one control component which can run on any node with available processor power. Inviso may also be part of a higher layer trace tool. See the inviso-tool as an example. The implementation is spread out over the Runtime_tools and the Inviso Erlang/OTP applications. Erlang modules necessary to run the runtime component are located in Runtime_tools and therefore assumed to be available on any node. Even though Inviso is introduced with Erlang/OTP R11B the runtime component implementation is done with backward compatibility in mind. Meaning that it is possible to compile and run it on older Erlang/OTP releases.</p>
- <image file="inviso_users_guide_pic1.gif">
- <icaption>Inviso Trace System Architecture Overview.</icaption>
- </image>
- <p>This document describes the control and runtime components of the Inviso trace system.</p>
-
- <section>
- <title>Underlying Mechanisms</title>
- <p>Inviso is built on Erlang trace BIFs and standard linked in trace-port drivers for efficient trace message logging. This means that Inviso can not co-exist in runtime with any other trace tool using the trace BIFs.</p>
- </section>
-
- <section>
- <title>Trace Recepie</title>
- <p>This is a short step-by-step description of how tracing using Inviso can be done.</p>
- <list type="ordered">
- <item>Start the Inviso control component at any node. Preferably a node that is not participating in the "work" done by your "system". The control component runs independently and normally not linked to any other process. (Prompt 2 in the example below.)</item>
- <item>Add all Erlang nodes to the inviso control component where you want to trace. This is starting runtime components on all involved Erlang nodes. Can include the node where the control component runs as well. Note that the Runtime_Tools application must be running on the nodes where runtime components shall be started. (Prompt 1 and 3 in the example below.)</item>
- <item>Initiate tracing on the added nodes. Initiating tracing means "opening" the output to where trace-messages will be written. Most commonly this is a file. Note that it is not actually necessary to initiate the same tracing on all nodes. It might for instance be wise to use different filenames on different nodes. In the example below tracing is initiated on two nodes. The same node as where the shell is running (<c>node()</c>) and at <c>node2@hurin</c>. Further both "regular" tracing (<c>trace</c>) as well as trace information (<c>ti</c>) are specified for both nodes. (Prompt 4 in the example below).</item>
- <item>If needing pid-to-alias translations, activate meta tracing on the necessary functions. This requires that trace information was specified when initiating tracing. (Prompt 5 in the example below illustrates using pid to locally registered name translations).</item>
- <item>Set trace-patterns on the functions that shall be traced. (Prompt 6 in the example below).</item>
- <item>Set process trace flags on necessary processes. Do not forget to use the <c>timestamp</c> flag in order to be able to merge log files together in chronological order. (Prompt 7 in the example below).</item>
- <item>Run your code. (Prompt 8 in the example below).</item>
- <item>Stop tracing (opposite of initiate tracing) and clear trace-patterns on the nodes. It is actually not necessary to stop tracing on all nodes at once. Nodes no longer of interest can be made to stop tracing before others. (Prompt 9 in the example below stops tracing. Prompt 13 removes all trace flags and trace patterns. Removing trace flags are really not necessary since those will be removed when the runtime components are stopped. Removing trace patterns may many times be necessary to "return" the node to a "clean" state from a trace perspective. Trace patterns are never automatically cleared by the runtime system unless the Erlang module in question is reloaded.)</item>
- <item>If necessary fetch the log files from the various nodes. (Prompt 10 in the example blow).</item>
- <item>Merge and format the log files. (Prompt 12 in the example below).</item>
- <item>Stop the runtime components. This is important if the Erlang nodes are real "live" systems, and will not necessarily be stopped just because the tracing is completed. (Prompt 14 in the example below).</item>
- </list>
- <p>This "recipe" is valid also when tracing in a non-distributed environment. The only difference is that function calls not taking a node-name as argument are used. The runtime component will then of course run on the same node as the control component.</p>
- <p>Simple example illustrating the above listed recipe. It traces on two nodes, node1 where the control component also runs. And node2 which is a remote node from the control components perspective. The example uses a mixture of API-calls specifying what nodes to trace on and API functions working on all added nodes. This is in this example interchangeable since all to the control component known nodes are participating in the same way.</p>
- <pre>
-Eshell V5.5 (abort with ^G)
-(node1@hurin)1><input>application:start(runtime_tools).</input>
-ok
-(node1@hurin)2> <input>inviso:start().</input>
-{ok,&lt;0.56.0>}
-(node1@hurin)3> <input>inviso:add_nodes([node(),node2@hurin],mytag).</input>
-{ok,[{'node1@hurin',{ok,new}},
- {'node2@hurin',{ok,new}}]}
-(node1@hurin)4> <input>inviso:init_tracing( [{node(),[{trace,{file,"tracefile_node1.log"}},{ti,{file,"trace_node1.ti"}}]}, {node2@hurin,[{trace,{file,"tracefile_node2.log"}},{ti,{file,"trace_node2.ti"}}]}]).</input>
-{ok,[{'node1@hurin',{ok,[{trace_log,ok},{ti_log,ok}]}},
- {'node2@hurin',{ok,[{trace_log,ok},{ti_log,ok}]}}]}
-(node1@hurin)5> <input>inviso:tpm_localnames([node(),node2@hurin]).</input>
-{ok,[{'node1@hurin',{{ok,1},{ok,1}}},
- {'node2@hurin',{{ok,1},{ok,1}}}]}
-(node1@hurin)6> <input>inviso:tpl([node(),node2@hurin],code,which,'_',[]).</input>
-{ok,[{'node1@hurin',{ok,[2]}},
- {'node2@hurin',{ok,[2]}}]}
-(node1@hurin)7> <input>inviso:tf(all,[call,timestamp]).</input>
-{ok,[{'node1@hurin',{ok,"/"}},
- {'node2@hurin',{ok,"-"}}]}
-(node1@hurin)8> <input>code:which(ordset).</input>
-non_existing
-(node1@hurin)9> <input>inviso:stop_tracing().</input>
-{ok,[{'node1@hurin',{ok,idle}},
- {'node2@hurin',{ok,idle}}]}
-(node1@hurin)10> <input>inviso:fetch_log([node2@hurin],".","aprefix_").</input>
-{ok,[{'node2@hurin',
- {complete,[{trace_log,[{ok,"aprefix_tracefile_node2.log"}]},
- {ti_log,[{ok,"aprefix_trace_node2.ti"}]}]}}]}
-(node1@hurin)11> <input>inviso:list_logs([node()]).</input>
-{ok,[{'node1@hurin',
- {ok,[{trace_log,".",["tracefile_node1.log"]},
- {ti_log,".",["trace_node1.ti"]}]}}]}
-(node1@hurin)12> <input>inviso_lfm:merge( [{node(),[{trace_log,["tracefile_node1.log"]}, {ti_log,["trace_node1.ti"]}]}, {node2@hurin,[{trace_log,["aprefix_tracefile_node2.log"]}, {ti_log,["aprefix_trace_node2.ti"]}]}],"theoutfile.txt").</input>
-{ok,15}
-(node1@hurin)13> <input>inviso:clear().</input>
-{ok,[{'node1@hurin',{ok,{new,running}}},
- {'node2@hurin',{ok,{new,running}}}]}
-(node1@hurin)14> <input>inviso:stop_nodes().</input>
-{ok,[{'node2@hurin',ok},
- {'node1@hurin',ok}]}
-(node1@hurin)15> </pre>
- </section>
- </section>
-
- <section>
- <title>Incarnation runtime tags</title>
- <p>Incarnation runtime tags are used to identify an incarnation of a runtime component. An incarnation is one "start-up" of a runtime component on a specific Erlang node. The reason why it can sometimes be necessary to examine the incarnation runtime tag is that a user wants to connect, adopt, an already running runtime component. This may be the case if the runtime component has autostarted or because the control component terminated without killing the runtime component. While the user has been out of control of the runtime component it may very well have terminated and been restarted. If it was restarted without the user's knowledge, its incarnation runtime tag has most likely changed. The user can therefore, if the current incarnation runtime tag is not what it is supposed to be, conclude that the runtime component is not "doing" what is expected.</p>
- <p>The runtime tag is set at runtime component start-up. This is either done when it is started manually by a call to <c>inviso:add_nodes/X</c>, or according to a specification in one of the autostart configuration files.</p>
- </section>
-
- <section>
- <title>Runtime component state and status</title>
- <p>A runtime component has a state and a status. The possible states are: <c>new</c>, <c>tracing</c> and <c>idle</c>. A runtime component that is <c>tracing</c> has (possibly) open log files. A <c>new</c> runtime component has no current tracer-data. That is it lacks any history of what it has done just recently. An <c>idle</c> runtime component is no longer tracing. It does therefore have current tracer-data that describes what it did do when it was tracing.</p>
- <p>The status describes if the runtime component is <c>running</c> or suspended. A suspended runtime component may very well be in state <c>tracing</c>. However the point is that it shall not generate any processor load. It will therefore refrain from generating any trace messages.</p>
- </section>
-
- <section>
- <title>The Runtime Meta Tracer</title>
- <p>Meta tracing is a trace mechanism separate from the regular tracing. It is normally used by a trace-tool to learn about function calls made anywhere in an Erlang node. A typical example is that there is a possibility in Inviso to get pids translated to registered name in the final formatted trace-log (for processes having registered names). This is done by meta-tracing on the BIF <c>register/2</c> to learn about all name/pid associations made.</p>
- <p>Meta tracing in Inviso is done by the <c>inviso_rt_meta</c> process, which is part of the runtime component if trace-information, ti, is initiated. See <seealso marker="inviso#init_tracing/1">inviso:init_tracing/1</seealso> for details. The runtime meta tracer opens and controls the so called trace information file. Translations can then be done off-line using the associations logged in the trace information file. Currently the only type of trace information file available is a straight binary file. A wrap-file makes no sense since pid-to-name associations made in the beginning will most likely be lost.</p>
- <p>The runtime meta tracer can also be used to translate pids to own identifiers. The only thing needed is one or several association points in the form of function calls which will only be made if an association is done in the system. The pid and own-identifier must be arguments and/or return values from the same function call.</p>
- <p>The runtime meta tracer can further more be used to achieve side-effects during tracing, like turning tracing on or off.</p>
-
- <section>
- <title>Matching function calls with return values</title>
- <p>It may sometimes be necessary to wait for a meta traced function to return before it can be decided what to do. This may be due to that one piece of information to make the decision is in the arguments to the function, the other in the return value. This kind of logic can be programmed to be executed by the inviso meta tracer. In order for the inviso meta tracer to "remember" function-call arguments until the function return trace message arrives, a <c>public loop data structure</c> is implemented. The public loop data structure is first created when tracing is initiated (of course only when trace information is specified in the <em>init_tracing</em> call). The public loop data can then later be further initiated each time meta tracing (<c>tpm</c> and <c>tpm_ms</c>) is activated for a certain function.</p>
- <p>The default public loop data structure is a tuple of size two. The first element in that tuple is used by the predefined meta tracing for capturing locally registered names. The second element is free to use for any other purpose. The elements of the tuple must in the default implementation be lists of tuples. Where each sub-tuple shall represent one waiting call. The last element of that tuple must be a now-stamp (as returned by the BIF <c>now/0</c>). See below for an explanation of the now-stamp. The size of the outer most tuple may be increased as long as the term residing in the first element is left unchanged, and all other elements follow the above described rules.</p>
- <p>The inviso meta tracer "cleans" the public loop data structure approximately once every minute. The reason for this is that entries in the public loop data structure may become abandoned. If for instance a process crashes while executing the body of a meta traced function, no return value will be generated. Or in other words, receiving the call meta trace-message can have caused information to have been written into the public loop data structure. That entry will be used and removed when the return_trace meta trace-message arrives. But if the meta traced function causes an exception, no return_trace message will come. The function which normally removes the entry is then therefore never called.</p>
- <p>The default clean-function assumes that every item in the public loop data tuple is a list. Where each list contains tuples where the last element of those tuples are "now-stamps". The default clean-function considers an entry older than 30 seconds to be abandoned.</p>
- </section>
-
- <section>
- <title>Making pid/alias entries in the ti-file</title>
- <p>When activating meta tracing for a function for the purpose of writing pid-alias associations in the trace information file, a call-func and possibly also a return-func is specified. These functions will be called when a meta trace message arrives to the inviso meta tracer as a result of function calls or returns for this meta traced function. What exactly to write in the trace information file is dictated by the merge mechanism. This since pid-alias translations are done off line when merging log-files. See the chapter on merging and formatting log files for more details.</p>
- <p>Simple example where the call to the function <c>connection:assoc_id(Pid,Ref)</c> will associated <c>Pid</c> with the id <c>Ref</c>. We will then in a merged log-file see a translation between <c>Pid</c> and <c>Ref</c>. Actually for all future since there is no unalias function meta traced in this example. The inviso meta tracer will receive a meta trace message every time <c>connection:assoc_id/2</c> is called. When that message arrives the meta tracer will call <c>mytrace:call_assoc_id/3</c> which must return <c>{ok,NewPublicLoopData,OutPutBinary}</c>.</p>
- <code type="none">
- -module(mytrace).
-
- call_assoc_id(_CallingPid,[Pid,Ref],PublLoopData) ->
- {ok,PublLoopData,term_to_binary({Pid,Ref,alias,now()})}.
- </code>
- <pre>
-
-(node1@hurin)21> <input>inviso:tpm(connection,assoc_id,2,[], {mytrace,call_assoc_id}).</input>
-{ok,[{'node1@hurin',{ok,1}},
- {'node2@hurin',{ok,1}}]}
-(node1@hurin)22> </pre>
- </section>
-
- <section>
- <title>Extending the public loop data structure.</title>
- <p>It is of course very likely that the public loop data structure must be extended to host all functions where the meta tracer must delay its action until the function in question returns. What is necessary is to create your own public loop data structure at trace initialization. This is done by using the <c>TiSpec</c>. <c>TiSpec={InitMFA,RemoveMF,CleanMF}</c>, where <c>InitMFA</c> creates the structure, <c>RemoveMF</c> removes it (must often not necessary unless a database, file or similar is used as storage instead of a tuple). <c>CleanMF</c> is the function which will be called each every 60 seconds to go over the public loop data structure. Following the below rules, not much programming will be needed, apart from the <c>InitMFA</c>:</p>
- <list type="bulleted">
- <item>Make the public loop data structure a tuple of lists, where each list is a list of tuples where the tuples represents one entry.</item>
- <item>Make the <c>CallFunc</c> (the function called each time a call meta trace message arrives for the function in question) add a tuple to the correct list where the last element of that tuple is a now-stamp.</item>
- <item>Make sure that the first element in the loop data structure tuple is left alone for the default implementation of the handling of registered names.</item>
- <item>Use <c>inviso_rt_meta:clean_std_publld/1</c> (which is exported for this purpose) as <c>CleanMF</c>. This function is normally the default clean function, if not using the possibility to in detail initiate the inner workings of the inviso meta tracer.</item>
- </list>
- <p>Simple example where tracing is initiated with a public loop data structure having 10 places for nine (the locally registered names is mandatory) different functions to be meta traced. Note that the BIF <c>list_to_tuple/1</c> is used as initialization function. And that the Stdlib function <c>lists:duplicate/2</c> is used to create something for the initialization function to work on.</p>
- <pre>
-(node1@hurin)4> <input>inviso:init_tracing( [{node2@hurin,[{trace,{file,"tracefile_node2.log"}}, {ti,{file,"trace_node2.ti",{{erlang,list_to_tuple,[lists:duplicate(10,[])]}, void,{inviso_rt_meta,clean_std_publld}}}}]}]).</input>
-{ok,[{'node2@hurin',{ok,[{trace_log,ok},{ti_log,ok}]}}]}
-(node1@hurin)5> </pre>
- </section>
-
- <section>
- <title>Using the inviso meta tracer to achieve side effects</title>
- <p>Since meta tracing is independent of regular tracing and catches any function call to a particular function made in any process, it is well suited to be used to turn things on or off during execution. That trick is done by letting the <c>CallFunc</c> and (if used) <c>ReturnFunc</c> do these sideeffects. One must of course remember that the inviso meta tracer is a process amongst all other processes in the system. Meaning that the side effect is not necessarily done exactly when the meta traced function is called. Unless the side effect can be achieved using a match specification action.</p>
- </section>
- </section>
-
- <section>
- <title>Runtime Component Autostart</title>
- <p>In order to trace before any user interaction is possible, an autostart mechanism is implemented. The runtime component is started by the top supervisor of the Runtime_Tools application top supervisor. Hence the Runtime_Tools application must be part of the boot script for autostart tracing to work. The Runtime_Tools applications must of course be started before any application that is to be traced. Do note that application startup is not entirely synchronous. Meaning that just because the application controller has begun starting the next application, Runtime_Tools is not necessarily fully up and running.</p>
- <p>The autostart mechanism is configurable. The runtime component comes with a standard autostart configuration, only missing two text-files to be completely operational.</p>
-
- <section>
- <title>Autostart Configuration</title>
- <p>The autostart is controlled by the Runtime_Tools application configuration parameter <c>inviso_autostart_mod</c>. It must be the name of a module exporting an <c>autostart/1</c> function. The default value is <c>inviso_autostart</c>, a module which is provided with Runtime_Tools. See <seealso marker="#inviso_autostart">below</seealso> for details.</p>
- <p>An <c>autostart/1</c> function must offer the following:</p>
- <code type="none">
-autostart(RuntimeToolsArg) = {MFA,Options,Tag} | any()
- </code>
- <p><c>RuntimeToolsArgs</c> is the argument <c>Arg</c> provided to the Runtime_Tools application through the application resource file <c>{mod,{Module,Arg}}</c> parameter.</p>
- <p><c>MFA = {AutoMod,AutoFunc,AutoArgs} | any()</c> controls how tracing will be initiated. Note that initiating tracing is not necessarily the same as starting a runtime component. It is possible to have a runtime component without doing any tracing. The runtime component is started as long as <c>autostart/1</c> returns the proper tuple, and <c>Options</c> does not for instance require a certain non-existing control component. If it is not a proper tuple or there are other faults in the tuple items, the autostart will terminate. Typically will this happen if there is no <c>autostart/1</c> function.</p>
- <p>If MFA does not properly point out a function possible to call with <c>spawn(AutoMod,AutoFunc,AutoArg)</c>, there will simply be no initialization. (Initialization is done by a separate process spawned by the runtime component during autostart.) It may be worth reminding that <c>AutoMod</c> must be present at the node where the runtime component is supposed to run. Not necessarily the node where the control component usually runs.</p>
- <p><c>Options</c> is the list of options given to the runtime component. See <c>Options</c> in <seealso marker="inviso#add_nodes/2">inviso:add_nodes/2</seealso>.</p>
- <p><c>Tag</c> is the runtime component incarnation tag. See <c>Tag</c> in <seealso marker="inviso#add_nodes/2">inviso:add_nodes/2</seealso>.</p>
- </section>
-
- <section>
- <title>The Standard Autostart Implementation</title>
- <p>As mentioned above, Inviso comes with a complete implementation of autostart sufficient for most situations.</p>
-
- <section>
- <marker id="inviso_autostart"></marker>
- <title>inviso_autostart</title>
- <p>The default autostart module is <c>inviso_autostart</c>, provided as part of the Runtime_Tools application. Since that name is the default module name, it is not really necessary to set the <c>inviso_autostart_mod</c> configuration parameter for the Runtime_Tools application.</p>
- <p>Its <c>autostart/1</c> function reads a configuration file pointed out by the Runtime_Tools application configuration parameter <c>inviso_autostart_conf</c>. If the parameter is not present, a default file, <c>inviso_autostart.config</c> in the current working directory, will be consulted.</p>
- <p>The config file must be an ascii text file with one or more tuples ended with a dot. The following parameters are recognized:</p>
- <taglist>
- <tag><c>{repeat,N}</c></tag>
- <item>
- <p>Optional parameter where <c>N</c> specifies the maximum remaining autostarts. The autostart functionality will rewrite the configuration decreasing <c>N</c> if present. If <c>N==0</c> the autostart will be terminated.</p>
- </item>
- <tag><c>{mfa,{M,F,Args}}</c></tag>
- <item>
- <p>Optional parameter controlling how initialization shall be done. The control component will spawn a separate process to do the initializations by doing <c>spawn(M,F,Args)</c>.</p>
- </item>
- <tag><c>{options,Options}</c></tag>
- <item>
- <p>Optional parameter specifying the options for the runtime component itself. See <c>Options</c> in <seealso marker="inviso#add_nodes/2">inviso:add_nodes/2</seealso>.</p>
- </item>
- <tag><c>{tag,Tag}</c></tag>
- <item>
- <p>Optional parameter specifying the runtime component tag. If missing the default tag will be <c>default_tag</c>.</p>
- </item>
- </taglist>
- <p>Example:</p>
- <code type="none">
-{repeat,1}.
-{mfa,{inviso_autostart_server,
- init,
- [[{tracerdata,{file,"mylogfile"}},
- {cmdfiles,["a_trace_case.txt"]},
- {bindings,[{'M',mymod},{'F','_'},{'Arity','_'}]},
- {translations,[]}]]}}.
- </code>
- <p>The example file results in the start of a runtime component given no specific options. There will only be one autostart since the repeat parameter is set to 1. Tracing will be initiated by the standard initiator (<seealso marker="#autostart_server">inviso_autostart_server</seealso>). The initiator will initiate tracing opening a plain trace-port logfile (<c>"mylogfile"</c>). It will further read the <c>"a_trace_case.txt"</c> file to get instructions on what patterns and flags to set. If there are variables mentioned in the trace-case file <c>"a_trace_case.txt"</c>, it is parameterized, the variables <c>M</c>, <c>F</c> and <c>Arity</c> will get the values according to <c>bindings</c>. There will be no translations done, hence the trace-case file must be written using <c>inviso_rt</c> function calls directly.</p>
- </section>
-
- <section>
- <marker id="autostart_server"></marker>
- <title>inviso_autostart_server</title>
- <p>To further facilitate the standard autostart implementation a default initiator is implemented. To use it, simply specify it as mfa in the config file read by the standard autostart module.</p>
- <p>Its <c>init/1</c> function takes one argument on the form of a list of tuples. The following tuple-parameters are recognized:</p>
- <taglist>
- <tag><c>{tracerdata,TracerData}</c></tag>
- <item>
- <p>Specifies how tracing is initiated. See <seealso marker="inviso#init_tracing/1">inviso:init_tracing/1</seealso> for details on <c>TracerData</c>.</p>
- </item>
- <tag><c>{cmdfiles,ListOfFileNames}</c></tag>
- <item>
- <p>Specifies trace-case files which shall be executed to set the patterns and flags of the trace. See the <seealso marker="#trace_cases">Trace Cases</seealso> chapter for more details. The files will be executed in the order specified.</p>
- </item>
- <tag><c>{translations,Translations}</c></tag>
- <item>
- <p>Optional parameter specifying how functions in trace-case files shall be translated. This is useful since trace-cases can be written for higher-layer Inviso tools, but must during an autostart execute using <c>inviso_rt</c> function calls only.</p>
- <code type="none">
-Translations=
- [{{Mod1,Func1,Arity},
- {Mod2,Func2,{TranslMod,TranslFunc}}},...]
-TranslMod:TranslFunc(ListOfOrigArgs)->
- ListOfTransformedArgs
- </code>
- <p><c>Mod1:Func1/Arity</c> specifies the function that shall be translated into <c>Mod2:Func2/Arity</c>. The actual arguments will be translated with <c>TranslMod:TranslFunc/1</c>. The translation function shall take a list of the actual arguments, and return a list of new arguments. The return-value list may for instance have certain arguments removed, if such are not relevant to the <c>Func2</c> function. (Such arguments must actually be removed since the return-value list from the translation function must have the correct amount of elements corresponding to the arity of <c>Func2</c>.)</p>
- </item>
- <tag><c>{bindings,Bindings}</c></tag>
- <item>
- <p><c>Bindings=[{Var,Val}]</c> <br></br>
-<c>Var=atom()</c>, the name of the variable</p>
- <p>Optional parameter specifying the actual values of variables used in the trace-cases. <c>Bindings</c> is a bindings structure as used by functions in the <c>erl_eval</c> module.</p>
- </item>
- </taglist>
- </section>
-
- <section>
- <title>The Standard Autostart Utility Library</title>
- <p>To facilitate creating the configuration file described above, there are functions in a module named <c>inviso_as_lib</c> which can both create new files according to supplied arguments and update existing configuration files.</p>
- <p>The node(s) in question must be running since the functionality in the utility library uses distributed Erlang to access the file system.</p>
- </section>
- </section>
- </section>
-
- <section>
- <title>The Dependency Property</title>
- <p>In order to protect real "live" systems from getting a runtime component lingering around without a control component, a dependency property can be specified at runtime component start-up. The property specifies a dependency in milliseconds. Meaning that if the property is set to 0 (zero), the runtime component will terminate immediately if its current control component terminates.</p>
- <p>If a control component tries to start a runtime component at an Erlang node where there already is a runtime component, the control component will adopt the already existing runtime component if it has no current control component. Otherwise the control component will experience an error, not being able to start a runtime component at that node.</p>
- <p>It must also be noted that an autostart runtime component is running without control component, at least before any control component adopts it.</p>
- </section>
-
- <section>
- <title>Overload Protection</title>
- <p>Since Inviso is intended to be used on real "live" systems, it is possible to protect the system against overload, having Inviso suspend tracing should an overload situation occur.</p>
- <p>What indicates an overload situation must be programmed and configured outside of Inviso. Inviso can initiate an overload protection, call an overload function periodically and clean-up an overload mechanism should it decide to terminate.</p>
- <p>Internally inside the runtime component, suspending tracing means removing all process trace flags and meta patterns. Reactivating tracing is outside the scoop of Inviso, but can be implemented in a tool using Inviso.</p>
- <p>Simple example adding a runtime component and making it protect its Erlang node from overload.</p>
- <pre>
-inviso:add_node(my_rt_tag,
- [{overload,{{my_ovl,check},
- 15000,
- {my_ovl,start,[my_port_pgm]},
- {my_ovl,stop,[my_port_pgm]}}}]).
- </pre>
- <p>Immediately when the runtime component is started, it will initiate overload protection by calling <c>my_ovl:start(my_port_pgm)</c>. When tracing (not when in state idle or new), the runtime component will every 15000 milliseconds call <c>my_ovl:check/1</c>. Depending on its return value, the runtime component will either do nothing or suspend tracing. When the runtime component is stopped, <c>my_ovl:stop(my_port_pgm)</c> will be called.</p>
- </section>
-
- <section>
- <title>Merging and Formatting Logfiles</title>
- <p>If logging trace messages to a logfile has been used (decided when tracing is initiated) the various log files will be located on the different Erlang nodes participating in the trace. The log files must be merged and formatted for the following reasons:</p>
- <list type="bulleted">
- <item>The various log files from the different nodes must be merged into one logfile in chronological order (where trace messages from different nodes will be mixed). If only one Erlang node participated in the trace, this step is obviously not necessary.</item>
- <item>Trace-port log files are on binary format and must in most cases be transformed in some way. This can for instance be to a text-file format or inserted into a database for analysis.</item>
- <item>Use trace information data to translate process identifiers to aliases, both standard Erlang ones (as registered names) as well as own invented.</item>
- </list>
- <p>The first step before any merging can take place is of course to get all log files, including any trace information files to a location where the logfile merger can access them. This can either be done by simply copying the files. However if the file systems on the Erlang nodes are not that easily accessed, there is a <c>fetch_log</c> function implemented in the runtime component. It will transfer log files using distributed Erlang.</p>
- <p>Inviso comes with two Erlang modules, <c>inviso_lfm</c> and <c>inviso_lfm_tpfreader</c>, implementing a standard log file merger and formatter. The log file merger (<c>inviso_lfm</c>) uses a file reader process (implemented in <c>inviso_lfm_tpfreader</c>) to access log entries in parallel. It is possible to write your own logfile reader. This is necessary since you may have your own trace-log format and/or own trace information log format. The logfile merger can further more be configured to use your own formatter, customizing what to do with a trace message.</p>
- <p>Trace messages in the log files must of course be time-stamped for the logfile merger to be capable of correctly merging them. This means using the <c>timestamp</c> process trace flag.</p>
- <p>The standard inviso log-file reader understands the following trace information file entries:</p>
- <list type="bulleted">
- <item>
- <code type="none">
-{Pid,Alias,alias,NowStamp} </code>
- </item>
- <item>
- <code type="none">
-{Pid,Alias,unalias,NowStamp} </code>
- </item>
- </list>
- <p>The <c>Pid</c> in an <c>alias</c> entry must always be a proper pid. In an <c>unalias</c> entry it may also be the atom <c>undefined</c>. The latter means that all associations involving <c>Alias</c> shall stop to be valid. The standard inviso log file reader uses the now-stamp to make sure that associations are only used during time periods in the log-file when such are valid.</p>
- </section>
-
- <section>
- <marker id="trace_cases"></marker>
- <title>Trace Cases</title>
- <p>The idea behind trace cases is that someone knowledgeable of a certain system component can write a file specifying the trace-patterns and process trace flags necessary to trace on certain items once and for all. Hence a trace case will most likely be a series of calls to functions setting trace patterns and process trace flags.</p>
- <p>However, the actual Erlang nodes and values of arguments given in the trace function calls can not be static in order for the trace cases to become useful and reusable. A trace case file must therefore be possible to parameterize. Introducing variables that will get their values at the time of trace case execution. It may also be the case that Inviso is used as a component in a higher layer trace tool. Trace cases may therefore be written calling more complex functions than the low level <c>inviso_rt</c> functions which are available to autostart mechanisms. In a matter of fact, the <c>inviso</c> API itself can be considered a higher layer. It addresses multiple nodes at once where the <c>inviso_rt</c> API can only address the local node.</p>
- <p>This results in that for trace cases to be useful there must be a function call translation mechanism and an execution environment capable of handling variable bindings.</p>
- <p>A trace-case is a text ascii file consisting of function calls written as they could have been done in the Erlang shell:</p>
- <code type="none">
-modulename:functionname(arg1,arg3,...).
- </code>
- <p>A trace-case may contain any valid function call, including binding new variables which are used later in the trace-case, but:</p>
- <list type="bulleted">
- <item>No spawn, send or receive.</item>
- <item>No apply or similar (including <c>mod:F(Arg1,Arg2)</c>). This because the variable environment is not available during the translation. Only during execution.</item>
- </list>
- <p>Example: Trace cases are expected to be written to be executed directly in an Erlang shell (by some utility reading a text file on trace case format) calling <c>inviso</c> functions. The translations must then translate <c>inviso</c> function calls to <c>inviso_rt</c> function calls, since <c>inviso</c> is not available in the Runtime_Tools applications. It can not be assumed that any trace tools outside the Runtime_Tools application is available on the nodes. Luckily (!) the <c>inviso_rt</c> API resembles the <c>inviso</c> API very much, apart from that the <c>inviso_rt</c> API does not take a list of nodes as an argument. Therefore in most situations the only transformation necessary is to change from <c>inviso</c> to <c>inviso_rt</c> and remove the first argument to the function call.</p>
- <p>Assume that we have the following trace-case file:</p>
- <code type="none">
-inviso:tpl(Nodes,mymod,'_','_',MS).
-inviso:tf(Nodes,all,[call,timestamp]).
- </code>
- <p>For this to work in an autostart the following translation is needed:</p>
- <code type="none">
-[{{inviso,tpl,5},{inviso_rt,tpl,{erlang,tl}}},
- {{inviso,tf,3},{inviso_rt,tf,{erlang,tl}}}]
- </code>
- <p>Since transforming the arguments from <c>inviso</c> calls to <c>inviso_rt</c> calls is simply removing the first argument, there is no need to program any function to do this. The BIF <c>tl/1</c> can be used directly.</p>
- <p>Further there must be a variable binding for <c>MS</c> when executing the trace-case. It is not necessary to have one for <c>Nodes</c> since that argument is removed from all function calls by the translation.</p>
- </section>
-</chapter>
-
diff --git a/lib/inviso/doc/src/inviso_lfm.xml b/lib/inviso/doc/src/inviso_lfm.xml
deleted file mode 100644
index 70207d0b58..0000000000
--- a/lib/inviso/doc/src/inviso_lfm.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="latin1" ?>
-<!DOCTYPE erlref SYSTEM "erlref.dtd">
-
-<erlref>
- <header>
- <copyright>
- <year>2006</year>
- <year>2011</year>
- <holder>Ericsson AB, All Rights Reserved</holder>
- </copyright>
- <legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
-
- The Initial Developer of the Original Code is Ericsson AB.
- </legalnotice>
-
- <title>inviso_lfm</title>
- <prepared></prepared>
- <docno></docno>
- <date></date>
- <rev></rev>
- </header>
- <module>inviso_lfm</module>
- <modulesummary>An Inviso Off-Line Logfile Merger</modulesummary>
- <description>
- <p>Implements an off-line logfile merger, merging binary trace-log files from several nodes together in chronological order. The logfile merger can also do pid-to-alias translations.</p>
- <p>The logfile merger is supposed to be called from the Erlang shell or a higher layer trace tool. For it to work, all logfiles and trace information files (containing the pid-alias associations) must be located in the file system accessible from this node and organized according to the API description.</p>
- <p>The logfile merger starts a process, the output process, which in its turn starts one reader process for every node it shall merge logfiles from. Note that the reason for a process for each node is not remote communication, the logfile merger is an off-line utility, it is to sort the logfile entries in chronological order.</p>
- <p>The logfile merger can be customized both when it comes to the implementation of the reader processes and the output the output process shall generate for every logfile entry.</p>
- </description>
- <funcs>
- <func>
- <name>merge(Files, OutFile) -></name>
- <name>merge(Files, WorkHFun, InitHandlerData) -></name>
- <name>merge(Files, BeginHFun, WorkHFun, EndHFun, InitHandlerData) -> {ok, Count} | {error, Reason}</name>
- <fsummary>Merge logfiles into one file in chronological order</fsummary>
- <type>
- <v>Files = [FileDescription]</v>
- <v>&nbsp;FileDescription = FileSet | {reader,RMod,RFunc,FileSet}</v>
- <v>&nbsp;&nbsp;FileSet = {Node,LogFiles} | {Node,[LogFiles]}</v>
- <v>&nbsp;&nbsp;&nbsp;Node = atom()</v>
- <v>&nbsp;&nbsp;&nbsp;LogFiles = [{trace_log,[FileName]}] | [{trace_log,[FileName]},{ti_log,TiFileSpec}]</v>
- <v>&nbsp;&nbsp;&nbsp;&nbsp;TiFileSpec = [string()] - a list of one string.</v>
- <v>&nbsp;&nbsp;&nbsp;&nbsp;FileName = string()</v>
- <v>&nbsp;&nbsp;RMod = RFunc = atom()</v>
- <v>OutFile = string()</v>
- <v>BeginHFun = fun(InitHandlerData) -> {ok, NewHandlerData} | {error, Reason}</v>
- <v>WorkHFun = fun(Node, LogEntry, PidMappings, HandlerData) -> {ok, NewHandlerData}</v>
- <v>&nbsp;LogEntry = tuple()</v>
- <v>&nbsp;PidMappings = term()</v>
- <v>EndHFun = fun(HandlerData) -> ok | {error, Reason}</v>
- <v>Count = int()</v>
- <v>Reason = term()</v>
- </type>
- <desc>
- <p>Merges the logfiles in <c>Files</c> together into one file in chronological order. The logfile merger consists of an output process and one or several reader processes.</p>
- <p>Returns <c>{ok, Count}</c> where <c>Count</c> is the total number of log entries processed, if successful.</p>
- <p>When specifying <c>LogFiles</c>, currently the standard reader-process only supports:</p>
- <list type="bulleted">
- <item>one single file</item>
- <item>a list of wraplog files, following the naming convention <c><![CDATA[<Prefix><Nr><Suffix>]]></c>.</item>
- </list>
- <p>Note that (when using the standard reader process) it is possible to give a list of <c>LogFiles</c>. The list must be sorted starting with the oldest. This will cause several trace-logs (from the same node) to be merged together in the same <c>OutFile</c>. The reader process will simply start reading the next file (or wrapset) when the previous is done.</p>
- <p><c>FileDescription == {reader,RMod,RFunc,FileSet}</c> indicates that <c>spawn(RMod, RFunc, [OutputPid,LogFiles])</c> shall create a reader process.</p>
- <p>The output process is customized with <c>BeginHFun</c>, <c>WorkHFun</c> and <c>EndHFun</c>. If using <c>merge/2</c> a default output process configuration is used, basically creating a text file and writing the output line by line. <c>BeginHFun</c> is called once before requesting log entries from the reader processes. <c>WorkHFun</c> is called for every log entry (trace message) <c>LogEntry</c>. Here the log entry typically gets written to the output. <c>PidMappings</c> is the translations produced by the reader process. <c>EndHFun</c> is called when all reader processes have terminated.</p>
- <p>Currently the standard reader can only handle one ti-file (per <c>LogFiles</c>). The current inviso meta tracer is further not capable of wrapping ti-files. (This also because a wrapped ti-log will most likely be worthless since alias associations done in the beginning are erased but still used in the trace-log).</p>
- <p>The standard reader process is implemented in the module <c>inviso_lfm_tpreader</c> (trace port reader). It understands Erlang linked in trace-port driver generated trace-logs and <c>inviso_rt_meta</c> generated trace information files.</p>
- </desc>
- </func>
- </funcs>
-
- <section>
- <title>Writing Your Own Reader Process</title>
- <p>Writing a reader process is not that difficult. It must:</p>
- <list type="bulleted">
- <item>Export an init-like function accepting two arguments, pid of the output process and the <c>LogFiles</c> component. <c>LogFiles</c> is actually only used by the reader processes, making it possible to redefine <c>LogFiles</c> if implementing an own reader process.</item>
- <item>Respond to <c>{get_next_entry, OutputPid}</c> messages with <c>{next_entry, self(), PidMappings, NowTimeStamp, Term}</c> or <c>{next_entry, self(), {error,Reason}}</c>.</item>
- <item>Terminate normally when no more log entries are available.</item>
- <item>Terminate on an incoming EXIT-signal from <c>OutputPid</c>.</item>
- </list>
- <p>The reader process must of course understand the format of a logfile written by the runtime component.</p>
- </section>
-</erlref>
-
diff --git a/lib/inviso/doc/src/inviso_lfm_tpfreader.xml b/lib/inviso/doc/src/inviso_lfm_tpfreader.xml
deleted file mode 100644
index bae40522a3..0000000000
--- a/lib/inviso/doc/src/inviso_lfm_tpfreader.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="latin1" ?>
-<!DOCTYPE erlref SYSTEM "erlref.dtd">
-
-<erlref>
- <header>
- <copyright>
- <year>2006</year>
- <year>2011</year>
- <holder>Ericsson AB, All Rights Reserved</holder>
- </copyright>
- <legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
-
- The Initial Developer of the Original Code is Ericsson AB.
- </legalnotice>
-
- <title>inviso_lfm_tpfreader</title>
- <prepared></prepared>
- <docno></docno>
- <date></date>
- <rev></rev>
- </header>
- <module>inviso_lfm_tpfreader</module>
- <modulesummary>Inviso Standard Reader Process to Standard Logfile Merger</modulesummary>
- <description>
- <p>Implements the standard reader process to the standard logfile merger <c>inviso_lfm</c>.</p>
- <p>The reader process reads logfiles belonging to the same set (normally one node) in chronological order and delivers logged trace messages one by one to the output process. Before any trace messages are delivered, the <c>inviso_lfm_tpreader</c> implementation reads the entire trace information file (if in use) and builds a database over pid-to-alias associations.</p>
- <p>The <c>inviso_lfm_tpreader</c> implementation is capable of considering that an alias may have been used for several processes during different times. An alias may also be in use for several pids at the same time, on purpose. If a process has generated a trace message, all associations between that pid and aliases will be presented as the list <c>PidMappings</c> in the message sent to the output process.</p>
- </description>
- <funcs>
- <func>
- <name>handle_logfile_sort_wrapset(LogFiles) -> FileList2</name>
- <fsummary>Sort logfiles in chronological order</fsummary>
- <type>
- <v>LogFiles = [{trace_log, FileList}]</v>
- <v>FileList = FileList2 = [FileName]</v>
- <v>&nbsp;FileName = string()</v>
- </type>
- <desc>
- <p>Only one <c>{trace_log, FileList}</c> tuple is expected in <c>LogFiles</c>, all other tuples are ignored. <c>FileList</c> must:</p>
- <list type="bulleted">
- <item>contain one single file name, or</item>
- <item>a list of wraplog files, following the naming convention <c><![CDATA[<Prefix><Nr><Suffix>]]></c>.</item>
- </list>
- <p>Sorts the files in <c>FileList</c> in chronological order beginning with the oldest. Sorting is only relevant if <c>FileList</c> is a list of wraplogs. The sorting is done on finding the modulo-counter in the filename and not on filesystem timestamps.</p>
- <p>This function is exported for convenience should an own reader process be implemented.</p>
- </desc>
- </func>
- </funcs>
-
- <section>
- <title>The Trace Information File Protocol</title>
- <p>The format of a trace information file is dictated by the meta tracer process. The <c>inviso_lfm_tpfreader</c> implementation of a reader process understands the following trace information entries. Note that the <c>inviso_rt_meta</c> trace information file is on binary format prefixing every entry with a 4 byte length indicator.</p>
- <taglist>
- <tag><c>{Pid, Alias, alias, NowStamp}</c></tag>
- <item>
- <p><c>Pid = pid()</c> <br></br>
-<c>Alias = term()</c> <br></br>
-<c>NowStamp = term()</c>, but in current implementation as
- returned from <c>erlang:now/0</c></p>
- <p>This message indicates that from now on shall <c>Pid</c> be associated with <c>Alias</c>.</p>
- </item>
- <tag><c>{MaybePid, Alias, unalias, NowStamp}</c></tag>
- <item>
- <p><c>MaybePid = pid() | undefined</c> <br></br>
-<c>Alias = term()</c> <br></br>
-<c>NowStamp = term()</c>, see above</p>
- <p>This message indicates that, if <c>MaybePid</c> is a pid, this pid shall no longer be associated with <c>Alias</c>. If it is <c>undefined</c>, all associations with <c>Alias</c> from now shall be considered invalid.</p>
- <p>Also note that there are many situations where <c>unalias</c> entries will be missing. For instance if a process terminates without making explicit function calls removing its associations first. This is seldom a problem unless the pid is reused.</p>
- </item>
- </taglist>
- </section>
-</erlref>
-
diff --git a/lib/inviso/doc/src/inviso_rt.xml b/lib/inviso/doc/src/inviso_rt.xml
deleted file mode 100644
index 3a8e77f65c..0000000000
--- a/lib/inviso/doc/src/inviso_rt.xml
+++ /dev/null
@@ -1,246 +0,0 @@
-<?xml version="1.0" encoding="latin1" ?>
-<!DOCTYPE erlref SYSTEM "erlref.dtd">
-
-<erlref>
- <header>
- <copyright>
- <year>2006</year>
- <year>2011</year>
- <holder>Ericsson AB, All Rights Reserved</holder>
- </copyright>
- <legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
-
- The Initial Developer of the Original Code is Ericsson AB.
- </legalnotice>
-
- <title>inviso_rt</title>
- <prepared></prepared>
- <docno></docno>
- <date></date>
- <rev></rev>
- </header>
- <module>inviso_rt</module>
- <modulesummary>Direct API to the Inviso Runtime Component</modulesummary>
- <description>
- <p>The <c>inviso_rt</c> API is normally only used when programming autostart scripts or similar mechanisms. The reason is that the runtime component is part of the Runtime_tools application and will therefore always be available. But the regular inviso API is part of the Inviso application not necessarily available on the node doing an autostart. It is of course possible to runt a "lean" tracer only using the runtime component manually (i.e not through autostart). The runtime component shall otherwise be controlled through the control component, which is accessed with the <c>inviso</c> API.</p>
- </description>
- <funcs>
- <func>
- <name>init_tracing(TracerData) -> NodeResult | {error,Reason}</name>
- <fsummary>Initiate tracing</fsummary>
- <desc>
- <p>See <seealso marker="inviso#init_tracing/2">inviso:init_tracing/2</seealso> for details.</p>
- </desc>
- </func>
- <func>
- <name>tp(Mod,Func,Arity,MatchSpec,Opts) -></name>
- <name>tp(Mod,Func,Arity,MatchSpec) -> NodeResult | {error,Reason}</name>
- <name>tp(PatternList) -> NodeResult | {error,Reason}</name>
- <fsummary>Set global trace patterns</fsummary>
- <type>
- <v>Mod,Func = atom() | '_' | ModRegExp | {DirRegExp,ModRegExp}</v>
- <v>&nbsp;ModRegExp = regexp_string()</v>
- <v>&nbsp;DirRegExp = regexp_string()</v>
- <v>Arity = int() | '_'</v>
- <v>MatchSpec = true | false | [] | matchspec()</v>
- <v>PatternList = [Pattern],</v>
- <v>&nbsp;Pattern = {Mod,Func,Arity,MatchSpec,Opts}</v>
- <v>Opts = [Opt]</v>
- <v>&nbsp;Opt = only_loaded</v>
- <v>NodeResult = {ok,[Ans]} | {error,Reason}</v>
- <v>&nbsp;&nbsp;Ans = int() | {error,Reason}</v>
- </type>
- <desc>
- <p>Set global trace patterns. The integer replied if the call was successfull describes the number of matched functions. Using wildcards follows the rules for wildcards of <c>erlang:trace_pattern</c>. It is for instance illegal to specify <c>M=='_'</c> while <c>F</c> is not <c>'_'</c>.</p>
- <p>Modules can also be specified using Erlang regular expressions as described in the <c>regexp</c> module. If <c>{DirRegExp,ModRegExp}</c> is used, module selection will further be restricted by that the module must be loaded from a location containing <c>DirRegExp</c> somewhere in the path. This can be used to for instance trace on all modules belonging to a certain application.</p>
- </desc>
- </func>
- <func>
- <name>tpl(Mod,Func,Arity,MatchSpec) -></name>
- <name>tpl(Mod,Func,Arity,MatchSpec,Opts) -> NodeResult | {error,Reason}</name>
- <name>tpl(PatternList) -> NodeResult | {error,Reason}</name>
- <fsummary>Set local trace patterns</fsummary>
- <desc>
- <p>See <seealso marker="#tp/5">tp/N</seealso> function above for details on arguments and return values.</p>
- <p>Set local trace pattern on specified functions.</p>
- </desc>
- </func>
- <func>
- <name>ctp(Mod,Func,Arity) -> NodeResult | {error,Reason}</name>
- <fsummary>Clear global trace patterns</fsummary>
- <desc>
- <p>See <seealso marker="#tp/5">tp/N</seealso> for argument descriptions.</p>
- <p>Clear global trace patterns.</p>
- </desc>
- </func>
- <func>
- <name>ctpl(Mod,Func,Arity) -> NodeResult | {error,Reason}</name>
- <fsummary>Clear local trace patterns</fsummary>
- <desc>
- <p>See <seealso marker="#tp/5">tp/N</seealso> for argument description.</p>
- <p>Clear local trace patterns.</p>
- </desc>
- </func>
- <func>
- <name>tf(PidSpec,FlagList) -> NodeResult | {error,Reason}</name>
- <name>tf(TraceConfList) -> NodeResult | {error,Reason}</name>
- <fsummary>Set process trace flags</fsummary>
- <type>
- <v>TraceConfList = [{PidSpec,FlagList}]</v>
- <v>FlagList = [Flag]</v>
- <v>PidSpec = all | new| existing | pid() | locally_registered_name()</v>
- <v>Flag = all process trace flags allowed.</v>
- <v>NodeResult = {ok,[Ans]} | {error,Reason}</v>
- <v>Ans = int() | {error,Reason}</v>
- </type>
- <desc>
- <p>Set process trace flags. The integer returned if the call was successful describes the matched number of processes.</p>
- </desc>
- </func>
- <func>
- <name>ctf(PidSpec,FlagList) -> NodeResult | {error,Reason}</name>
- <name>ctf(TraceConfList) -> NodeResult | {error,Reason}</name>
- <fsummary>Clear process trace flags</fsummary>
- <desc>
- <p>See <seealso marker="#tf/2">tf/1,2</seealso> for arguments and return value description.</p>
- <p>Clear process trace flags.</p>
- </desc>
- </func>
- <func>
- <name>init_tpm(Mod,Func,Arity,CallFunc) -> NodeResult | {error,Reason}</name>
- <name>init_tpm(Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc) -> NodeResult | {error,Reason}</name>
- <fsummary>Initialize meta tracing</fsummary>
- <type>
- <v>Mod = Func = atom()</v>
- <v>Arity = int()</v>
- <v>NodeResult = ok | {error,Reason}</v>
- <v>InitFunc = RemoveFunc = {Module,Function} | function()/4 | void</v>
- </type>
- <desc>
- <p>See <seealso marker="inviso#init_tpm/4">inviso:init_tpm/5,7</seealso> for details.</p>
- </desc>
- </func>
- <func>
- <name>tpm(Mod,Func,Arity,MS) -> NodeResult | {error,Reason}</name>
- <name>tpm(Mod,Func,Arity,MS,CallFunc) -> NodeResults | {error,Reason}</name>
- <name>tpm(Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc) -> NodeResults | {error,Reason}</name>
- <fsummary>Activate meta tracing</fsummary>
- <type>
- <v>Mod = Func = atom() =/= '_'</v>
- <v>Arity = int()</v>
- <v>MS = match_spec()</v>
- <v>InitFunc = CallFunc = ReturnFunc = RemoveFunc = {Module,Function} | function()</v>
- <v>NodeResult = {ok,1} | {ok,0} | {error,Reason}</v>
- </type>
- <desc>
- <p>See <seealso marker="inviso#tpm/4">inviso:tpm/4,5,8</seealso> for details.</p>
- </desc>
- </func>
- <func>
- <name>tpm_tracer(Mod,Func,Arity,MS) -> NodeResult | {error,Reason}</name>
- <name>tpm_tracer(Mod,Func,Arity,MS,CallFunc) -> NodeResults | {error,Reason}</name>
- <name>tpm_tracer(Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc) -> NodeResults | {error,Reason}</name>
- <fsummary>Activate meta tracing</fsummary>
- <desc>
- <p>See inviso:tpm_tracer/4,5,8 for details.</p>
- </desc>
- </func>
- <func>
- <name>tpm_ms(Mod,Func,Arity,MSname,MS) ->d NodeResult | {error,Reason}</name>
- <fsummary>Add match specifications</fsummary>
- <type>
- <v>Mod = Func = atom()</v>
- <v>Arity = int()</v>
- <v>MSname = term()</v>
- <v>MatchSpec = [match_spec()]</v>
- <v>NodeResult = {ok,1} | {ok,0} | {error,Reason}</v>
- </type>
- <desc>
- <p>See <seealso marker="inviso#tpm_ms/5">inviso:tpm_ms/5</seealso> for details.</p>
- </desc>
- </func>
- <func>
- <name>tpm_ms_tracer(Mod,Func,Arity,MSname,MS) ->d NodeResult | {error,Reason}</name>
- <fsummary>Add match specifications</fsummary>
- <desc>
- <p>See inviso:tpm_ms_tracer/5 for details.</p>
- </desc>
- </func>
- <func>
- <name>ctpm_ms(Mod,Func,Arity,MSname) -> NodeResult | {error,Reason}</name>
- <fsummary>Remove a match specification</fsummary>
- <type>
- <v>NodeResult = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>See <seealso marker="inviso#ctpm_ms/4">inviso:ctpm_ms/4</seealso> for details.</p>
- </desc>
- </func>
- <func>
- <name>ctpm(Mod,Func,Arity) -> {ok,NodeResults} | NodeResult | {error,Reason}</name>
- <fsummary>Remove a meta trace pattern</fsummary>
- <type>
- <v>NodeResults = [{Node,NodeResult}]</v>
- <v>NodeResult = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>See <seealso marker="inviso#ctpm/3">inviso:ctpm/3</seealso> for details.</p>
- </desc>
- </func>
- <func>
- <name>local_register() ->NodeResult | {error,Reason}</name>
- <fsummary>Set meta trace pattern on <c>register/2</c></fsummary>
- <type>
- <v>NodeResult = {R1,R2}</v>
- <v>R1 = R2 = {ok,0} | {ok,1} | {error,Reason}</v>
- </type>
- <desc>
- <p>See <seealso marker="inviso#tpm_localnames/0">inviso:tpm_localnames/0</seealso> for details.</p>
- </desc>
- </func>
- <func>
- <name>remove_local_register() ->NodeResult | {error,Reason}</name>
- <fsummary>Clear meta trace pattern on <c>register/2</c></fsummary>
- <type>
- <v>NodeResult = {R1,R2} | {error,Reason}</v>
- <v>R1 = R2 = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>See <seealso marker="inviso#ctpm_localnames/0">inviso:ctpm_localnames/0</seealso> for details.</p>
- </desc>
- </func>
- <func>
- <name>global_register() ->NodeResult | {error,Reason}</name>
- <fsummary>Set meta trace pattern on <c>global:register_name/2</c></fsummary>
- <type>
- <v>NodeResult = {R1,R2} | {error,Reason}</v>
- <v>R1 = R2 = {ok,0} | {ok,1} | {error,Reason}</v>
- </type>
- <desc>
- <p>See <seealso marker="inviso#tpm_globalnames/0">inviso:tpm_globalnames/0</seealso> for details.</p>
- </desc>
- </func>
- <func>
- <name>remove_global_register() ->NodeResult | {error,Reason}</name>
- <fsummary>Clear meta trace pattern on <c>global:register_name/2</c></fsummary>
- <type>
- <v>NodeResult = {R1,R2} | {error,Reason}</v>
- <v>R1 = R2 = ok | {error,Reason}</v>
- </type>
- <desc>
- <p>See <seealso marker="inviso#ctpm_globalnames/0">inviso:ctpm_globalnames/0</seealso> for details.</p>
- </desc>
- </func>
- </funcs>
-</erlref>
-
diff --git a/lib/inviso/doc/src/inviso_rt_meta.xml b/lib/inviso/doc/src/inviso_rt_meta.xml
deleted file mode 100644
index a1e5400ce0..0000000000
--- a/lib/inviso/doc/src/inviso_rt_meta.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="latin1" ?>
-<!DOCTYPE erlref SYSTEM "erlref.dtd">
-
-<erlref>
- <header>
- <copyright>
- <year>2006</year><year>2009</year>
- <holder>Ericsson AB. All Rights Reserved.</holder>
- </copyright>
- <legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
-
- </legalnotice>
-
- <title>inviso_rt_meta</title>
- <prepared></prepared>
- <docno></docno>
- <date></date>
- <rev></rev>
- </header>
- <module>inviso_rt_meta</module>
- <modulesummary>Direct API to the Inviso Runtime Component's meta tracer</modulesummary>
- <description>
- <p>This module provides a direct API to the inviso meta tracer. These functions are only meant to be used in meta tracing <c>CallFunc</c> and <c>RemoveFunc</c>.</p>
- <p>It can sometimes be necessary to manipulate meta match-patterns from <c>CallFunc</c>s and <c>RemoveFunc</c>s. The problem then is that call-funcs and remove-funcs are meta trace call-backs executed inside the inviso meta tracer's context. Hence making calls to the regular API's manipulating meta trace-patterns will hang the inviso meta tracer!.</p>
- <p>To remedy this problem, a number of useful tpm-functions are available in this API. It must be understood that their actions are local to the Erlang node where they are called.</p>
- </description>
- <funcs>
- <func>
- <name>tpm_ms(Mod,Func,Arity,MSname,MS) -> {ok,0} | {ok,1} | {error,not_initiated}</name>
- <fsummary>Adds a list of match-specs, associated with the name <c>MSname</c>, to <c>Mod:Func/Arity</c>.</fsummary>
- <desc>
- <p>See inviso:tpm_ms/6 for details. Note that this function only effects meta trace-patterns on the Erlang node where the function is called. This also implies that only the local inviso meta tracer's name-database is updated with <c>MSname</c>.</p>
- </desc>
- </func>
- <func>
- <name>tpm_ms_tracer(Mod,Func,Arity,MSname,MS) -> {ok,0} | {ok,1} | {error,not_initiated}</name>
- <fsummary>As tpm_ms_tracer/5 but also adds a <c>{tracer,Tracer}</c>trace flag to the enable-list of every <c>trace</c>in <c>MS</c>.</fsummary>
- <desc>
- <p>See inviso:tpm_ms_ms/6 for details. Note that this function only effects meta trace-patterns on the Erlang node where the function is called. This also implies that only the local inviso meta tracer's name-database is updated with <c>MSname</c>.</p>
- </desc>
- </func>
- <func>
- <name>list_tpm_ms(Mod,Func,Arity) -> [MSname]</name>
- <fsummary>Returns a list of <c>MSname</c>.</fsummary>
- <desc>
- <p>Returns a list of all <c>MSname</c> in use for <c>Mod:Func/Arity</c>. This can be useful instead of having to have an own-implemented database over currently in use meta match-functions for a particular function.</p>
- </desc>
- </func>
- <func>
- <name>ctpm_ms(Mod,Func,Arity,MSname) -> ok</name>
- <fsummary>Removes the list of match-specs associated with the <c>MSname</c>from the meta trace-pattern of <c>Mod:Func/Arity</c>.</fsummary>
- <desc>
- <p>See inviso:ctpm_ms/5 for details. Note that this function only effects meta trace-patterns on the Erlang node where the function is called. This also implies that only the local inviso meta tracer's name-database is updated with <c>MSname</c>.</p>
- </desc>
- </func>
- <func>
- <name>get_tracer() -> Tracer</name>
- <fsummary>Returns the pid or port acting as regular tracer.</fsummary>
- <type>
- <v>Tracer = pid() | port()</v>
- </type>
- <desc>
- <p>Returns the pid or port acting as the receiver of regular trace messages. This is useful if it is necessary to manipulate meta trace-patterns by hand (using <c>erlang:trace_pattern/3</c>) and the <c>{tracer,Tracer}</c> must be used in one of the match-function bodies.</p>
- </desc>
- </func>
- </funcs>
-</erlref>
-
diff --git a/lib/inviso/doc/src/inviso_users_guide_pic1.gif b/lib/inviso/doc/src/inviso_users_guide_pic1.gif
deleted file mode 100644
index a6da9d37de..0000000000
--- a/lib/inviso/doc/src/inviso_users_guide_pic1.gif
+++ /dev/null
Binary files differ
diff --git a/lib/inviso/doc/src/inviso_users_guide_pic1.ps b/lib/inviso/doc/src/inviso_users_guide_pic1.ps
deleted file mode 100644
index fc859cd129..0000000000
--- a/lib/inviso/doc/src/inviso_users_guide_pic1.ps
+++ /dev/null
@@ -1,24489 +0,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%Title: /clearcase/otp/tools/inviso/doc/src/inviso_users_guide_pic1b.ps
-%%Creator: XV Version 3.10a Rev: 12/29/94 - by John Bradley
-%%BoundingBox: -1 161 615 630
-%%Pages: 1
-%%DocumentFonts:
-%%EndComments
-%%EndProlog
-
-%%Page: 1 1
-
-% remember original state
-/origstate save def
-
-% build a temporary dictionary
-20 dict begin
-
-% define string to hold a scanline's worth of data
-/pix 1848 string def
-
-% define space for color conversions
-/grays 616 string def % space for gray scale line
-/npixls 0 def
-/rgbindx 0 def
-
-% lower left corner
--1 161 translate
-
-% size of image (on paper, in 1/72inch coords)
-616.03200 469.00800 scale
-
-% define 'colorimage' if it isn't defined
-% ('colortogray' and 'mergeprocs' come from xwd2ps
-% via xgrab)
-/colorimage where % do we know about 'colorimage'?
- { pop } % yes: pop off the 'dict' returned
- { % no: define one
- /colortogray { % define an RGB->I function
- /rgbdata exch store % call input 'rgbdata'
- rgbdata length 3 idiv
- /npixls exch store
- /rgbindx 0 store
- 0 1 npixls 1 sub {
- grays exch
- rgbdata rgbindx get 20 mul % Red
- rgbdata rgbindx 1 add get 32 mul % Green
- rgbdata rgbindx 2 add get 12 mul % Blue
- add add 64 idiv % I = .5G + .31R + .18B
- put
- /rgbindx rgbindx 3 add store
- } for
- grays 0 npixls getinterval
- } bind def
-
- % Utility procedure for colorimage operator.
- % This procedure takes two procedures off the
- % stack and merges them into a single procedure.
-
- /mergeprocs { % def
- dup length
- 3 -1 roll
- dup
- length
- dup
- 5 1 roll
- 3 -1 roll
- add
- array cvx
- dup
- 3 -1 roll
- 0 exch
- putinterval
- dup
- 4 2 roll
- putinterval
- } bind def
-
- /colorimage { % def
- pop pop % remove 'false 3' operands
- {colortogray} mergeprocs
- image
- } bind def
- } ifelse % end of 'false' case
-
-
-
-616 469 8 % dimensions of data
-[616 0 0 -469 0 469] % mapping matrix
-{currentfile pix readhexstring pop}
-false 3 colorimage
-
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffff000000000000
-000000ffffffccccccffffffffffffffffff000000000000ffffffffffffccccccffffff
-000000ffffff000000000000ffffffffffffcccccc000000000000000000000000ffffff
-000000ffffff000000000000ffffffffffffffffff000000000000ffffffccccccffffff
-ffffffffffff000000ffffffffffffffffffccccccffffffffffffffffff000000000000
-000000ffffffccccccffffffffffffffffff000000000000ffffffffffffccccccffffff
-ffffff000000ffffff000000000000ffffffcccccc000000000000ffffffffffffffffff
-ffffff000000cccccc000000000000ffffffffffffffffffffffffffffffcccccc000000
-000000ffffffffffffffffffffffffffffff000000ffffff000000000000ffffffffffff
-ffffffffffff000000000000000000ffffffffffffffffffffffff000000cccccc000000
-000000ffffffffffff000000000000000000000000ffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffff000000ffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffff000000ffffffffffff000000
-000000000000ffffffffffff000000ffffffffffffffffff000000ffffffffffff000000
-000000000000ffffffffffffffffffffffff000000ffffffffffff000000ffffffffffff
-ffffffffffff000000ffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffff000000ffffffffffffffffff
-000000000000000000ffffffffffff000000000000ffffffffffff000000ffffffffffff
-000000000000000000ffffffffffff000000ffffffffffffffffffffffff000000ffffff
-ffffff000000ffffffffffffffffff000000000000000000ffffffffffff000000ffffff
-ffffff000000ffffffffffffffffff000000ffffffffffff000000000000000000ffffff
-ffffff000000ffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffff000000ffffffffffff
-000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffffffffffffffff000000ffffff
-ffffffffffff000000ffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffffffffff000000ffffffffffff000000ffffffffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffff000000000000000000000000000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffff000000ffffffffffff
-000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffffffffffffffff000000ffffff
-ffffffffffff000000ffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffffffffff000000ffffffffffff000000ffffffffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffff000000ccccccffffff
-ffffffffffffffffffffffff000000ffffffccccccffffffffffff000000ffffffffffff
-000000ffffffccccccffffff000000ffffffffffffffffff000000ffffffccccccffffff
-000000ffffffffffffffffffffffff000000ccccccffffffffffffffffff000000ffffff
-ffffffffffff000000ffffffffffffffffffffffffffffffffffff000000ccccccffffff
-ffffffffffffffffffffffff000000ffffffccccccffffffffffff000000ffffffffffff
-ffffff000000ccccccffffffffffff000000ffffffffffffffffff000000ccccccffffff
-ffffff000000ffffffffffffffffffffffff000000ffffffffffff000000ffffffffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffff000000ffffffffffffffffffffffffccccccffffffffffff000000ffffffffffff
-ffffff000000ccccccffffff000000ffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-000000ffffff000000000000000000000000ffffffffffff000000000000ccccccffffff
-ffffff000000ffffff000000000000ffffffccccccffffff000000000000000000000000
-ffffffffffff000000ffffffffffffffffff000000ffffff000000000000ccccccffffff
-000000000000ffffffffffffffffffffffffcccccc000000000000000000ffffffffffff
-ffffffffffffccccccffffffffffffffffff000000000000000000ffffffccccccffffff
-ffffffffffff000000000000ffffffffffffccccccffffffffffff000000ffffff000000
-000000ffffffcccccc000000000000ffffffffffffffffff000000ffffff000000000000
-ffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffffffffffff
-ffffff000000cccccc000000000000ffffffffffffffffffffffff000000000000000000
-ffffffffffffffffffffffff000000ffffff000000000000ffffffffffffffffff000000
-000000000000000000ffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffff000000ffffffffffffffffff
-000000ffffffffffffffffff000000ffffffffffffffffff000000ffffff000000ffffff
-000000ffffffffffffffffffffffffffffff000000ffffffffffff000000ffffffffffff
-ffffffffffff000000ffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffff000000ffffffffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000000000ffffffffffff000000ffffffffffffffffffffffff000000ffffff
-ffffff000000ffffffffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffff000000ffffff000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-000000000000000000ffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000000000ffffffffffff000000000000000000ffffffffffff000000000000
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffff000000ffffffffffffffffff000000000000000000ffffff
-ffffff000000000000ffffffffffff000000ffffff000000000000000000ffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffff000000ffffffffffffffffff
-000000000000000000ffffffffffff000000ffffffffffff000000ffffffffffffffffff
-000000ffffffffffff000000000000000000ffffffffffff000000ffffffffffffffffff
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000
-000000ffffffffffffffffffffffffffffff000000000000ffffffffffffffffff000000
-000000000000ffffff000000000000000000ffffffffffff000000000000ffffff000000
-000000000000ffffffffffffffffffffffffffffff000000000000ffffffffffffffffff
-ffffff000000000000000000ffffffffffffffffffffffffffffffffffff000000000000
-000000ffffffffffffffffffffffffffffff000000000000ffffffffffffffffffffffff
-000000000000000000ffffff000000000000000000ffffff000000000000000000ffffff
-ffffff000000ffffff000000000000ffffffffffffffffffffffffffffffffffff000000
-000000ffffffffffffffffffffffff000000000000000000ffffff000000000000000000
-ffffffffffff000000000000000000ffffffffffffffffff000000000000000000ffffff
-000000000000000000ffffff000000000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffffffffff000000ffffffffffffffffff000000000000000000000000000000ffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffff000000ffffffffffffffffff
-ffffff000000ffffffffffff000000ffffffffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffff000000000000000000000000
-000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffff000000ffffffffffffffffff
-ffffff000000ffffffffffff000000ffffffffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffff000000ffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffff000000ccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-000000ffffffffffffffffffffffff000000ccccccffffffffffff000000ffffffffffff
-ffffff000000ccccccffffffffffff000000ffffffffffffffffff000000ccccccffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffff000000ccccccffffffffffffffffffffffffffffff
-000000ffffffccccccffffffffffff000000ffffffffffffffffff000000ccccccffffff
-ffffff000000ffffffffffffffffff000000ccccccffffff000000ffffffffffffffffff
-ffffff000000ccccccffffff000000ffffffffffffffffffffffff000000ccccccffffff
-ffffff000000ffffffffffffffffff000000ccccccffffff000000ffffffffffffffffff
-ffffffffffffccccccffffff000000ffffffffffffffffff000000ffffffccccccffffff
-000000ffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffff000000000000000000ffffff
-ffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffff000000
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffff000000ffffffffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffff000000000000ffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffff000000ffffffffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffff000000ffffffffffffffffff
-000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff
-000000ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000000000ffffffffffffffffffffffff000000000000ffffff000000ffffffffffff
-000000000000000000ffffff000000000000000000ffffffffffff000000000000ffffff
-ffffff000000000000000000ffffff000000000000000000ffffff000000000000000000
-ffffff000000000000000000ffffffffffffffffff000000000000000000ffffffffffff
-ffffffffffffffffffffffffffffffffffff000000000000000000ffffffffffffffffff
-ffffffffffff000000000000ffffffffffffffffffffffff000000000000000000ffffff
-000000000000000000ffffff000000000000000000ffffff000000ffffff000000000000
-ffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffffffffffff
-000000000000000000ffffff000000000000000000ffffffffffff000000000000000000
-ffffffffffffffffff000000000000000000ffffff000000000000000000ffffffffffff
-000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffff000000ffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff000000000000000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffcccccc666666ffffffffffffffffffcccccc999999ccccccffffffffffff
-ffffff666666999999ffffffffffffffffffcccccc666666ffffffffffffffffffcccccc
-999999ccccccffffffffffffffffff666666999999ffffffffffffffffffcccccc666666
-ffffffffffffffffffcccccc999999ccccccffffffffffffffffff666666999999ffffff
-ffffffffffffcccccc666666ffffffffffffffffffcccccc999999ccccccffffffffffff
-ffffff666666999999ffffffffffffffffffcccccc666666ffffffffffffffffffcccccc
-999999999999ffffffffffffffffff999999999999ffffffffffffffffffcccccc666666
-ffffffffffffffffffcccccc999999999999ffffffffffffffffff999999999999ffffff
-ffffffffffffcccccc666666ffffffffffffffffffcccccc999999999999ffffffffffff
-ffffff999999999999ffffffffffffffffffcccccc666666ffffffffffffffffffcccccc
-666666999999ffffffffffffffffff999999999999ffffffffffffffffffcccccc666666
-ffffffffffffffffffcccccc666666999999ffffffffffffffffff999999999999ffffff
-ffffffffffffcccccc666666ffffffffffffffffffcccccc666666999999ffffffffffff
-ffffff999999999999ffffffffffffffffffcccccc666666ffffffffffffffffffcccccc
-666666999999ffffffffffffffffff999999999999ffffffffffffffffffcccccc666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc999999ccccccffffffffffffffffff666666999999ffffff
-ffffffffffff999999666666ffffffffffffffffffcccccc666666ccccccffffffffffff
-ffffff666666999999ffffffffffffffffff999999666666ffffffffffffffffffcccccc
-666666ccccccffffffffffffffffff666666999999ffffffffffffffffff999999666666
-ffffffffffffffffffcccccc666666ccccccffffffffffffffffff666666999999ffffff
-ffffffffffff999999666666ffffffffffffffffffcccccc666666ccccccffffffffffff
-ffffff666666999999ffffffffffffffffffcccccc666666ffffffffffffffffffcccccc
-666666ccccccffffffffffffffffff666666999999ffffffffffffffffffcccccc666666
-ffffffffffffffffffcccccc666666ccccccffffffffffffffffff666666999999ffffff
-ffffffffffffcccccc666666ffffffffffffffffffcccccc666666ccccccffffffffffff
-ffffff666666999999ffffffffffffffffffcccccc666666ffffffffffffffffffcccccc
-666666ccccccffffffffffffffffff666666999999ffffffffffffffffffcccccc666666
-ffffffffffffffffffcccccc999999ccccccffffffffffffffffff666666999999ffffff
-ffffffffffffcccccc666666ffffffffffffffffffcccccc999999ccccccffffffffffff
-ffffff666666999999ffffffffffffffffffcccccc666666ffffffffffffffffffcccccc
-999999ccccccffffffffffffffffff666666999999ffffffffffffffffffcccccc666666
-ffffffffffffffffffcccccc999999ccccccffffffffffffffffff666666999999ffffff
-ffffffffffffcccccc666666ffffffffffffffffffcccccc999999ccccccffffffffffff
-ffffff666666999999ffffffffffffffffffcccccc666666ffffffffffffffffffcccccc
-999999999999ffffffffffffffffff999999999999ffffffffffffffffffcccccc666666
-ffffffffffffffffffcccccc999999999999ffffffffffffffffff999999999999ffffff
-ffffffffffffcccccc666666ffffffffffffffffffcccccc999999999999ffffffffffff
-ffffff999999999999ffffffffffffffffffcccccc666666ffffffffffffffffffcccccc
-666666999999ffffffffffffffffff999999999999ffffffffffffffffffcccccc666666
-ffffffffffffffffffcccccc666666999999ffffffffffffffffff999999999999ffffff
-ffffffffffffcccccc666666ffffffffffffffffffcccccc666666999999ffffffffffff
-ffffff999999999999ffffffffffffffffffcccccc666666ffffffffffffffffffcccccc
-666666999999ffffffffffffffffff999999999999ffffffffffffffffffcccccc666666
-ffffffffffffffffffffffff
-ffffffffffff000000000000666666ffffffffffff666666000000333333ffffffffffff
-999999000000000000ccccccffffffffffff000000000000666666ffffffffffff666666
-000000333333ffffffffffff999999000000000000ccccccffffffffffff000000000000
-666666ffffffffffff666666000000333333ffffffffffff999999000000000000cccccc
-ffffffffffff000000000000666666ffffffffffff666666000000333333ffffffffffff
-999999000000000000ccccccffffffffffff000000000000666666ffffffffffff666666
-000000333333ffffffffffff999999000000000000ccccccffffffffffff000000000000
-666666ffffffffffff666666000000333333ffffffffffff999999000000000000cccccc
-ffffffffffff000000000000666666ffffffffffff666666000000333333ffffffffffff
-999999000000000000ccccccffffffffffff000000000000666666ffffffffffff666666
-000000333333ffffffffffff999999000000000000ccccccffffffffffff000000000000
-666666ffffffffffff666666000000333333ffffffffffff999999000000000000cccccc
-ffffffffffff000000000000666666ffffffffffff666666000000333333ffffffffffff
-999999000000000000ccccccffffffffffff000000000000666666ffffffffffff666666
-000000333333ffffffffffff999999000000000000ccccccffffffffffff000000000000
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333000000333333ffffffffffff999999000000000000ffffff
-ffffffffffff000000000000999999ffffffffffff333333000000333333ffffffffffff
-999999000000000000ffffffffffffffffff000000000000666666ffffffffffff333333
-000000333333ffffffffffff999999000000000000ffffffffffffffffff000000000000
-666666ffffffffffff333333000000333333ffffffffffff999999000000000000ffffff
-ffffffffffff000000000000666666ffffffffffff666666000000333333ffffffffffff
-999999000000000000ccccccffffffffffff000000000000666666ffffffffffff666666
-000000333333ffffffffffff999999000000000000ccccccffffffffffff000000000000
-666666ffffffffffff666666000000333333ffffffffffff999999000000000000cccccc
-ffffffffffff000000000000666666ffffffffffff666666000000333333ffffffffffff
-999999000000000000ccccccffffffffffff000000000000666666ffffffffffff666666
-000000333333ffffffffffff999999000000000000ccccccffffffffffff000000000000
-666666ffffffffffff666666000000333333ffffffffffff999999000000000000cccccc
-ffffffffffff000000000000666666ffffffffffff666666000000333333ffffffffffff
-999999000000000000ccccccffffffffffff000000000000666666ffffffffffff666666
-000000333333ffffffffffff999999000000000000ccccccffffffffffff000000000000
-666666ffffffffffff666666000000333333ffffffffffff999999000000000000cccccc
-ffffffffffff000000000000666666ffffffffffff666666000000333333ffffffffffff
-999999000000000000ccccccffffffffffff000000000000666666ffffffffffff666666
-000000333333ffffffffffff999999000000000000ccccccffffffffffff000000000000
-666666ffffffffffff666666000000333333ffffffffffff999999000000000000cccccc
-ffffffffffff000000000000666666ffffffffffff666666000000333333ffffffffffff
-999999000000000000ccccccffffffffffff000000000000666666ffffffffffff666666
-000000333333ffffffffffff999999000000000000ccccccffffffffffff000000000000
-666666ffffffffffff666666000000333333ffffffffffff999999000000000000cccccc
-ffffffffffff000000000000666666ffffffffffff666666000000333333ffffffffffff
-999999000000000000ccccccffffffffffff000000000000666666ffffffffffff666666
-000000333333ffffffffffff999999000000000000ccccccffffffffffff000000000000
-666666ffffffffffffffffff
-ffffffffffff999999333333ccccccffffffffffffcccccc333333999999ffffffffffff
-ffffff333333666666ffffffffffffffffff999999333333ccccccffffffffffffcccccc
-333333999999ffffffffffffffffff333333666666ffffffffffffffffff999999333333
-ccccccffffffffffffcccccc333333999999ffffffffffffffffff333333666666ffffff
-ffffffffffff999999333333ccccccffffffffffffcccccc333333999999ffffffffffff
-ffffff333333666666ffffffffffffffffff999999333333ccccccffffffffffffcccccc
-333333666666ffffffffffffffffff333333666666ffffffffffffffffff999999333333
-ccccccffffffffffffcccccc333333666666ffffffffffffffffff333333666666ffffff
-ffffffffffff999999333333ccccccffffffffffffcccccc333333666666ffffffffffff
-ffffff333333666666ffffffffffffffffff999999333333ccccccffffffffffffcccccc
-333333666666ffffffffffffffffff333333666666ffffffffffffffffff999999333333
-ccccccffffffffffffcccccc333333666666ffffffffffffffffff333333666666ffffff
-ffffffffffff999999333333ccccccffffffffffffcccccc333333666666ffffffffffff
-ffffff333333666666ffffffffffffffffff999999333333ccccccffffffffffffcccccc
-333333666666ffffffffffffffffff333333666666ffffffffffffffffff999999333333
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333999999ffffffffffffffffff333333666666ffffff
-ffffffffffff666666333333ffffffffffffffffff999999333333999999ffffffffffff
-ffffff333333666666ffffffffffffffffff666666333333ffffffffffffffffff999999
-333333999999ffffffffffffffffff333333666666ffffffffffffffffff666666333333
-ffffffffffffffffff999999333333999999ffffffffffffffffff333333666666ffffff
-ffffffffffff666666333333ffffffffffffffffff999999333333999999ffffffffffff
-ffffff333333666666ffffffffffffffffff999999333333ffffffffffffffffff999999
-333333999999ffffffffffffffffff333333666666ffffffffffffffffff999999333333
-ffffffffffffffffff999999333333999999ffffffffffffffffff333333666666ffffff
-ffffffffffff999999333333ffffffffffffffffff999999333333999999ffffffffffff
-ffffff333333666666ffffffffffffffffff999999333333ffffffffffffffffff999999
-333333999999ffffffffffffffffff333333666666ffffffffffffffffff999999333333
-ccccccffffffffffffcccccc333333999999ffffffffffffffffff333333666666ffffff
-ffffffffffff999999333333ccccccffffffffffffcccccc333333999999ffffffffffff
-ffffff333333666666ffffffffffffffffff999999333333ccccccffffffffffffcccccc
-333333999999ffffffffffffffffff333333666666ffffffffffffffffff999999333333
-ccccccffffffffffffcccccc333333999999ffffffffffffffffff333333666666ffffff
-ffffffffffff999999333333ccccccffffffffffffcccccc333333999999ffffffffffff
-ffffff333333666666ffffffffffffffffff999999333333ccccccffffffffffffcccccc
-333333666666ffffffffffffffffff333333666666ffffffffffffffffff999999333333
-ccccccffffffffffffcccccc333333666666ffffffffffffffffff333333666666ffffff
-ffffffffffff999999333333ccccccffffffffffffcccccc333333666666ffffffffffff
-ffffff333333666666ffffffffffffffffff999999333333ccccccffffffffffffcccccc
-333333666666ffffffffffffffffff333333666666ffffffffffffffffff999999333333
-ccccccffffffffffffcccccc333333666666ffffffffffffffffff333333666666ffffff
-ffffffffffff999999333333ccccccffffffffffffcccccc333333666666ffffffffffff
-ffffff333333666666ffffffffffffffffff999999333333ccccccffffffffffffcccccc
-333333666666ffffffffffffffffff333333666666ffffffffffffffffff999999333333
-ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc333333333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff333333000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000333333ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc333333333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc999999cccccc666666999999666666999999666666333333
-333333333333333333333333333333333333333333333333333333999999666666999999
-666666999999999999ccccccccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffff000000ffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffcccccc000000ffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffff000000ccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffff000000ffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999666666
-666666000000000000333333666666333333666666666666999999666666999999cccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccc666666999999666666
-999999666666666666333333333333000000333333333333999999999999cccccccccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffff000000
-000000000000000000ffffffffffff000000000000ffffffffffffffffff000000ffffff
-000000000000ffffffffffffffffff000000000000000000000000ffffffffffff000000
-ffffffffffffffffff000000ffffff000000000000ffffffffffff000000000000ffffff
-ffffffffffffffffffffffff000000000000000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000000000000000000000ffffffffffffffffff
-000000000000ffffffffffffffffffffffffffffffffffff000000000000ffffffffffff
-ffffffffffffffffff000000ffffffffffffffffffffffff000000000000000000ffffff
-ffffffffffffffffffffffffffffffffffff000000000000000000ffffffffffffffffff
-000000ffffff000000000000ffffffffffffffffffffffff000000ffffff000000000000
-ffffffffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffffffffff000000000000000000ffffffffffffffffffffffff000000000000000000
-ffffffffffffffffff000000000000000000000000ffffffffffff000000ffffffffffff
-ffffffffffff000000000000ffffffffffffffffffffffffffffff000000ffffff000000
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc666666666666333333000000000000333333666666999999
-999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccccccccc666666666666333333333333
-000000333333333333999999ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000ffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffff000000000000000000
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000000000
-ffffffffffff000000000000000000ffffffffffff000000000000ffffffffffff000000
-ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff000000ffffffffffffffffffffffff000000
-ffffffffffff000000ffffffffffffffffffffffff000000ffffffffffff000000ffffff
-ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff000000ffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffff000000ffffff000000
-000000000000ffffffffffff000000ffffffffffff000000000000000000ffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffff000000000000ffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffff000000ffffffffffffffffff
-000000ffffffffffffffffff000000ffffffffffffffffff000000000000ffffffffffff
-ffffff000000ffffffffffff000000ffffffffffffffffff000000000000000000ffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-999999666666333333333333999999999999ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccccccccc666666333333000000666666999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffffffffff000000
-ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000
-ffffffffffffffffff000000000000000000000000000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffffffffffffffff000000ffffffffffff000000ffffffffffffffffffffffff000000
-ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000000000ffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffff000000ffffffffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000ffffffffffffffffff000000ffffffffffffffffffffffff000000ffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666000000333333
-666666999999ccccccffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffff999999666666000000333333666666999999
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffff000000ccccccffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffffcccccc000000
-ffffffffffffffffff000000ffffffffffffcccccc000000ffffffffffffffffff000000
-ffffffffffffcccccc000000ffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffffffffffcccccc000000ffffffffffff000000ffffffffffffffffffcccccc000000
-ffffffffffffffffff000000ffffffffffffccccccffffff000000000000ffffffffffff
-ffffffffffffccccccffffffffffffffffff000000000000ffffff000000ccccccffffff
-000000ffffffffffffffffffffffff000000ccccccffffff000000ffffffffffffffffff
-ffffff000000ccccccffffffffffff000000ffffffffffffffffff000000ccccccffffff
-ffffff000000ffffffffffffffffffffffffccccccffffffffffff000000000000ffffff
-000000ffffffccccccffffff000000ffffffffffffffffffffffff000000ccccccffffff
-000000ffffffffffffffffffffffff000000ccccccffffffffffff000000ffffffffffff
-ffffff000000ccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999666666000000666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999666666
-000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffffffffff000000
-ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000
-ffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffffffffffffffff000000ffffffffffff000000ffffffffffffffffffffffff000000
-ffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff000000ffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffff000000ffffffffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff
-000000ffffffffffffffffff000000ffffffffffffffffffffffff000000ffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999666666000000666666999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666333333333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffff000000ffffffffffff000000000000000000ffffffffffff000000ffffff
-ffffffffffff000000ffffffffffffffffff000000ffffff000000ffffffffffff000000
-ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff000000
-ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff000000ffffff000000ffffffffffff000000
-ffffffffffff000000ffffffffffffffffffffffff000000ffffffffffff000000ffffff
-ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff000000ffffff
-ffffffffffffffffffffffffffffff000000ffffffffffff000000000000ffffffffffff
-000000000000ffffffffffff000000ffffffffffffffffff000000000000ffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffff000000ffffffffffff000000
-000000ffffffffffffffffff000000ffffff000000ffffffffffff000000ffffffffffff
-ffffff000000ffffffffffff000000ffffffffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333666666999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc333333333333999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000ffffff
-ffffffffffffffffff000000000000ffffff000000ffffffffffff000000000000000000
-ffffff000000000000000000ffffffffffff000000000000ffffffffffff000000000000
-000000ffffff000000000000000000ffffff000000000000000000ffffff000000000000
-000000ffffffffffffffffff000000000000000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffffffffffff
-000000000000ffffffffffffffffffffffffffffffffffff000000000000ffffffffffff
-ffffffffffff000000000000000000ffffffffffff000000000000000000ffffffffffff
-ffffffffffffffffffffffffffffff000000000000000000ffffff000000000000ffffff
-000000ffffff000000000000ffffffffffffffffffffffff000000ffffff000000000000
-ffffffffffffffffffffffff000000000000000000ffffff000000000000000000ffffff
-ffffffffffff000000000000000000ffffffffffffffffff000000000000000000ffffff
-000000000000ffffffffffff000000000000ffffffffffff000000000000000000ffffff
-ffffffffffff000000000000ffffffffffffffffffffffff000000000000000000ffffff
-000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666333333
-666666ffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffcccccc666666000000999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-000000ffffffccccccffffffffffffffffffffffffffffff000000ffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999000000999999cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666333333666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc333333333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999333333666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999
-000000999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000
-000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000000000ffffffffffffffffffffffffffffff000000000000000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff333333666666ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333ccccccccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffff999999333333666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999333333ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc333333ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-666666ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff333333ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc333333ccccccffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffcccccc
-333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff666666999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc333333ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff333333ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc333333ccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffff333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccccccccccccccccccccc
-ffffffffffffffffffcccccc999999ccccccffffffffffffffffffcccccccccccccccccc
-ccccccccccccccccccccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffccccccffffffffffffffffff
-ffffff999999333333333333333333000000000000000000000000000000000000333333
-ffffffffffffffffffffffff000000ccccccffffffffffffffffff333333000000000000
-000000000000000000000000000000000000000000333333ffffffffffffffffffffffff
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc999999ffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-cccccc999999999999333333ffffffffffffffffffcccccc000000ccccccffffffffffff
-ffffff666666666666666666999999666666cccccc999999ccccccccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccccccccccccccccccccc999999ffffffffffffffffffcccccc
-000000ccccccffffffffffffffffff666666666666666666ccccccccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc333333ffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc666666666666333333333333000000000000
-000000000000333333666666ffffffffffffffffffffffff999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999333333333333000000000000000000333333
-666666999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999999999ffffffffffffffffff666666333333333333666666666666cccccccccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999666666
-666666000000000000666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc999999666666333333ccccccffffffffffffffffff
-333333999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffff999999333333ffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff000000000000000000ffffffffffffffffff000000000000ffffff
-000000000000ffffff000000000000000000ffffff000000000000000000ffffff000000
-000000000000ffffffffffffffffffffffff000000000000000000000000ffffffffffff
-000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000000000000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-999999666666333333000000000000000000333333333333ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffccccccccccccffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333ffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffff000000ffffffffffffffffffffffff000000000000
-ffffffffffff000000ffffff000000ffffffccccccffffff000000ffffffffffffffffff
-ffffff000000ccccccffffffffffff000000ffffffffffffffffffffffffcccccc000000
-ffffffffffffffffff000000ffffffffffffccccccffffffffffffffffffffffffffffff
-000000ffffffccccccffffff000000ffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffff666666999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999000000000000
-000000333333000000999999ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000333333666666ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffff000000ffffff
-ffffffffffff000000ffffff000000ffffffffffff000000ffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffff000000000000000000ffffffffffff000000
-ffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666333333ffffffffffffffffffcccccccccccccccccc
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc666666333333000000333333666666ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffff000000ffffff
-ffffffffffff000000ffffffffffff000000ffffff000000ffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffff000000ffffff000000
-ffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333ffffffffffffffffffcccccc999999666666333333000000
-666666ffffffffffffffffff999999ccccccffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc666666333333000000333333999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff000000000000000000000000000000ffffff000000000000000000
-ffffff000000000000000000ffffff000000000000ffffffffffffffffffffffff000000
-000000000000000000000000ffffff000000000000000000000000ffffffffffffffffff
-000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000000000000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999333333999999333333333333000000000000333333666666999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffcccccc333333666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666ffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffff000000000000000000666666666666ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff333333ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc333333ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000000000000000000000000000000000000000
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffccccccccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff333333ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff333333000000333333ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc333333ccccccffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666000000333333
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333
-000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff333333999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999333333000000666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc999999ffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333999999
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-666666333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff333333999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc333333999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc333333ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333666666ffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffcccccc666666333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999333333ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999333333333333999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666333333333333ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff666666333333999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-333333666666666666000000000000000000666666ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333000000666666ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc666666333333ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666333333
-ccccccffffffcccccc000000000000000000000000000000666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc000000333333999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333333333
-999999ffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffff999999333333333333999999ffffff
-ffffffffffffffffff000000000000000000000000000000000000666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff333333000000666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-666666000000999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999333333666666ccccccffffffffffffffffff
-ffffffffffffffffff666666000000000000000000000000666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666333333333333999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999666666000000666666ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffff999999000000000000000000000000ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc666666333333333333999999ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999
-666666000000666666999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc000000000000999999333333333333ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccccccccc666666333333000000666666
-999999ffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffcccccc999999666666333333000000666666
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ccccccffffffffffff333333333333ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-666666000000333333666666ccccccccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc999999333333333333666666999999ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc999999333333333333000000333333333333999999999999cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999cccccc666666666666
-333333000000000000666666666666ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc000000666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999cccccc666666666666333333
-000000333333666666666666999999666666ccccccccccccccccccccccccccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccccccccccccccc
-cccccc999999999999666666999999333333333333000000666666333333999999999999
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc000000
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999333333ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999999999666666999999333333333333333333333333333333000000
-000000000000000000000000000000000000000000000000000000333333333333333333
-333333666666666666666666666666ccccccccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-000000999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc000000000000999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-333333000000ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666000000666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333666666
-cccccc000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999000000333333ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc666666333333ffffffffffff
-999999000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333000000
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff666666333333999999ffffffffffffffffff
-333333000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666
-000000999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999000000999999ffffffffffffffffffffffffcccccc
-333333000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff333333999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999333333666666ffffffffffffffffffffffffffffffffffff999999
-666666000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333666666ccccccffffffffffffffffffffffffffffffffffffffffff333333
-cccccc000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666
-000000ccccccffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff333333666666ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999333333999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999000000666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333cccccc
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666000000999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc666666333333ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333ffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666000000999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666333333999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333000000
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999000000666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff333333ccccccffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc000000
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999333333333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333ffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999000000999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff333333ccccccffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff333333000000999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999333333666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333ffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666000000666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc333333666666ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc666666333333ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff333333ccccccffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999666666ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffccccccccccccffffffffffffffffff666666999999666666333333
-333333333333333333333333999999ffffffcccccc333333666666999999666666999999
-666666999999666666ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc333333ffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc666666ffffffffffffffffffffffffffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999999999666666
-666666333333000000000000666666ffffffffffffffffff999999666666999999cccccc
-ccccccccccccccccccccccccffffffffffffffffffcccccc999999666666999999666666
-999999666666999999666666ffffffffffffffffff333333666666666666cccccccccccc
-ffffffffffffffffffffffffffffffffffff999999666666ffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999333333ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666ffffffffffffffffff333333666666999999
-999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc666666999999333333333333
-000000333333666666ffffffffffffffffff333333ccccccffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffccccccccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-cccccc666666333333000000666666999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffff999999000000999999ffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff333333666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333333333
-333333999999ccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffff999999333333666666000000333333333333cccccc
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc000000666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc999999999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff333333ccccccffffffffffffcccccc999999333333
-333333000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc000000
-666666ccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc999999333333333333666666ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc333333ffffffffffffffffffffffffffffffffffff
-cccccc000000ffffffffffff999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-000000000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999000000666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666000000666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666ffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffff666666000000666666ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc000000666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000999999ccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffff333333ccccccccccccffffffffffffffffffffffffffffff
-ffffff000000ccccccffffffffffffffffff666666333333333333ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc000000666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc000000333333ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc333333ffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffff999999000000666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc000000666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc000000333333ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999000000999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999666666ffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffff999999cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc000000ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc333333333333ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc333333333333ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff333333666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999333333999999ffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffff000000000000000000000000
-000000ffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-000000000000ffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333ffffffffffffffffffffffffffffffffffffccccccffffff
-ffffff000000ffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffcccccc000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000ffffff000000ffffff
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffcccccc666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff333333666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-000000000000ffffff000000ffffffffffff000000000000000000ffffffffffffffffff
-000000000000ffffffffffffffffff000000000000ffffffffffffffffffffffffffffff
-000000ffffffffffff000000000000000000ffffffffffff000000000000000000000000
-ffffffcccccc333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff333333666666ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ccccccffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffff000000ffffffffffff
-ffffff000000000000ffffffffffff000000ffffffffffff000000ffffffcccccc000000
-ffffff000000ffffffffffff000000ffffff000000ccccccccccccffffffffffffffffff
-000000999999000000333333333333000000333333000000ffffffffffff333333333333
-666666666666333333999999666666999999666666ccccccffffffffffffffffffffffff
-ffffff000000ccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffff000000999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffcccccc
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffff000000ffffffffffffffffff000000ffffff000000ffffff
-ffffff999999999999000000333333000000000000000000666666ffffffffffffffffff
-999999666666999999ccccccccccccccccccccccccccccccffffffffffffffffffcccccc
-999999666666999999666666999999666666999999666666ffffffffffffffffff333333
-666666000000ccccccccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffff999999
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff
-000000ffffffffffffffffff000000ffffffffffff000000999999666666666666ffffff
-ffffff333333666666999999999999ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-666666000000333333333333000000333333666666ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-333333000000999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff000000000000000000ffffffffffff
-000000ffffffffffffcccccc000000000000333333000000666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffccccccccccccffffffffffffcccccc666666999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333333333ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffff333333999999
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffff333333333333333333999999ccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffff000000ffffffffffffffffffffffffccccccffffffffffffffffff999999666666
-000000333333333333ccccccffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff666666000000666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999000000333333ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffff333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc999999333333333333999999ffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999000000666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc333333333333ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffcccccc333333ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc999999333333333333666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffccccccccccccffffffffffff999999666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999000000333333ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc333333333333ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffccccccccccccffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc666666000000666666ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666000000333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc333333333333ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333333333ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffff000000999999ccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffff000000ccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffff666666333333
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333000000ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000666666ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-000000999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffff333333ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333333333
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc000000
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffff666666333333ffffffffffffffffffffffffffffffffffffffffff333333999999
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffff999999333333999999ffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-000000000000000000000000000000ffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffff000000000000ffffffffffffffffffffffffccccccffffff
-ffffff333333ffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffcccccc000000999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666333333ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffff000000ffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff333333999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc333333ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff333333666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc000000333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffff000000000000ffffff000000ffffffffffff000000000000
-000000ffffffffffffffffff000000000000ffffffffffffffffff000000000000ffffff
-ffffffffffffffffffffffff000000ffffffffffff000000000000000000ffffffffffff
-000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff333333666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc333333333333ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-333333333333ccccccffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffccccccffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffff000000ffffffffffffffffff000000000000ffffffffffff000000ffffffffffff
-000000ffffffcccccc000000ffffff000000ffffffffffff000000ffffff000000cccccc
-ccccccffffffffffffffffff000000999999000000333333333333000000333333000000
-ffffffffffff333333333333666666999999666666999999666666999999666666cccccc
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffff000000999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc333333000000ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999000000ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffff000000ffffffffffffffffff
-000000ffffff000000ffffffffffff999999999999000000333333000000000000000000
-666666ffffffffffffffffff999999666666999999cccccccccccccccccccccccccccccc
-ffffffffffffffffffcccccc999999666666999999666666999999666666999999666666
-ffffffffffffffffff333333666666666666ccccccccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999000000999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff666666000000ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff000000
-999999666666666666ffffffffffff333333666666999999999999ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc666666999999333333333333000000333333666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999000000666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666000000ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000000000ffffffffffff000000ffffffffffffcccccc000000000000333333000000
-666666999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffccccccccccccffffff
-ffffffcccccc666666999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333333333999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666000000ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666333333ccccccffffffffffffffffffccccccffffff
-ffffffffffff333333999999ffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffff333333333333333333999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffff999999666666000000333333333333ccccccffffffffffffffffffffffff
-999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999333333999999ffffffffffffffffffffffff
-ffffffffffff333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc999999999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc999999333333333333999999ffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666000000
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc333333333333ccccccffffffffffff
-ffffffcccccc333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999
-333333333333666666ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffccccccccccccffffffffffff
-999999666666999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-000000ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999000000666666cccccc
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666000000666666
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-666666000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-666666999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666cccccc
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffff000000999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffff666666333333333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999000000666666ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999000000999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666000000666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc333333333333ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999000000333333999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffff666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff333333999999ffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-999999333333999999ffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffff000000000000000000000000000000ffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffff000000000000ffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffcccccc000000999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333000000
-333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffff000000ffffff000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-333333000000999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-333333666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999000000333333999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc000000ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffff000000000000ffffff000000
-ffffffffffff000000000000000000ffffffffffffffffff000000000000ffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffff000000ffffffffffff000000
-000000000000ffffffffffff000000000000000000000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666000000ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff333333333333ccccccffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffccccccffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffff000000ffffffffffffffffff000000000000ffffff
-ffffff000000ffffffffffff000000ffffffcccccc000000ffffff000000ffffffffffff
-000000ffffff000000ffffffffffffffffffffffffffffff000000ffffff000000ffffff
-ffffff000000ffffff000000ffffffffffff000000ffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffff000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff333333999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-000000ffffffffffffffffff000000ffffff000000ffffffffffffffffffffffff000000
-000000000000ffffffffffffffffffffffffffffffffffff000000000000ffffffffffff
-ffffff000000ffffff000000000000000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc000000ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666000000
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff
-000000ffffffffffff000000ffffffffffff000000ffffffffffff000000ffffff000000
-ffffffffffff000000ffffffffffffffffffffffff000000ffffff000000ffffffffffff
-000000ffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-000000ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc333333ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff000000000000000000ffffffffffff000000ffffffffffffffffff
-000000000000000000000000000000ffffff000000000000000000ffffffffffff000000
-000000000000ffffffffffffffffffffffffffffff000000000000000000000000000000
-ffffffffffffffffff000000000000000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-333333333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666333333ccccccffffff
-ffffffffffffccccccffffffffffffffffff333333999999ffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffff999999666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-666666000000000000999999ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999333333999999
-ffffffffffffffffffffffffffffffffffff333333ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000000000000000000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666000000333333666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff333333666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333
-333333ccccccffffffffffffffffffcccccc333333ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff666666999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666333333000000666666ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000666666ccccccffffff999999666666ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff666666999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999333333000000333333ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff666666ccccccffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffff999999666666ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff666666ffffffffffffffffffcccccc999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff666666999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc333333ccccccffffffcccccc333333333333
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000000000ffffff000000000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff666666999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc000000000000000000
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff333333ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff000000ffffffffffff000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff333333ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333000000000000000000
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffff666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff333333999999ffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffff000000ffffffffffff000000ffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffff000000ccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999000000000000666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc000000000000000000000000000000
-333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc666666ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000000000ffffffffffffffffff000000000000000000
-ffffffffffff000000ffffffffffff000000ffffffffffffffffff000000000000ffffff
-ffffff000000000000ffffff000000000000000000ffffffffffff000000000000000000
-ffffff000000000000ffffff000000ffffff000000000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999333333000000000000
-666666ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc333333000000000000000000000000000000
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff333333999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff000000ffffff000000ffffffffffff000000ffffffffffff000000
-ffffffffffff000000ffffffffffff000000ffffffffffff000000ffffff000000ffffff
-000000ffffff000000ffffffffffff000000ffffffffffff000000ffffffffffff000000
-ffffffffffff000000000000ffffffffffff000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffccccccccccccffffffffffffffffff999999666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999
-000000000000000000999999ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc999999333333000000000000000000
-000000ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000ffffffffffffffffffffffff000000ffffffffffffffffff000000
-ffffffffffff000000ffffffffffff000000ffffff000000000000000000ffffff000000
-ffffffffffffffffffffffffffffff000000ffffff000000ffffffffffffffffff000000
-ffffffffffff000000ffffffffffffffffffffffff000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333999999999999666666000000000000000000ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666000000333333ffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999333333
-000000666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff333333333333ccccccffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffff000000ffffffffffff000000ffffff000000ffffffffffff000000ffffff
-ffffff000000ffffffffffff000000ffffffcccccc000000ffffffffffff000000000000
-ffffffffffff000000ffffff000000ffffffffffff000000ffffffffffff000000ffffff
-ffffff000000ffffffffffffffffff000000cccccc000000ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffff000000000000000000000000000000000000000000000000ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffccccccffffffffffffffffffcccccc999999ffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999cccccc999999999999666666999999666666999999333333333333
-333333000000333333333333333333333333333333333333666666999999666666999999
-666666cccccc999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff333333999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000000000000000ffffffffffff000000000000000000ffffffffffff
-ffffff000000000000ffffff000000000000ffffff000000000000000000ffffff000000
-000000000000ffffffffffff000000000000ffffff000000000000000000ffffffffffff
-ffffff000000ffffffffffffffffff000000000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666333333333333000000000000000000000000000000000000666666666666
-ccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999333333ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccccccccc999999999999333333
-333333000000666666333333666666666666999999666666999999666666cccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccc999999666666999999666666
-666666333333666666333333000000000000666666666666999999ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999333333ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-666666333333ccccccffffff666666000000000000000000000000333333333333333333
-000000000000000000333333333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc333333999999999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc999999333333333333000000333333333333666666666666cccccc
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc999999999999666666333333000000000000
-333333666666666666ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff333333000000999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-333333ffffffffffffffffffffffffcccccc333333000000000000666666ffffffffffff
-ffffffcccccc999999666666999999ffffffffffffffffffcccccc333333ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666000000000000000000666666999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-666666000000333333666666ccccccccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc999999999999333333333333666666999999ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000ffffff
-666666333333ccccccffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffcccccc333333
-ccccccffffffffffffffffffffffffffffffcccccc666666000000999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999ffffffffffff
-ffffffffffff000000333333333333999999999999ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccccccccc999999333333000000000000333333666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc999999666666333333000000666666
-999999ffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffcccccc999999333333333333000000666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc000000333333ffffff
-ffffff999999333333999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffccccccccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc666666666666333333000000000000000000000000666666666666
-ccccccccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffff999999666666333333000000
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999333333333333666666999999ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666000000
-666666999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc999999999999666666999999666666666666999999ffffffffffffcccccc333333
-666666333333999999666666999999666666ccccccccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666000000666666ffffff
-ffffffffffffcccccc333333333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc666666666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc999999999999333333333333
-666666000000000000cccccc999999999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-ffffffffffffffffffffffff333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666333333333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999666666000000666666999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccccccccc999999ffffffffffff999999
-000000666666666666999999666666999999999999ffffffffffffffffffcccccccccccc
-999999cccccc666666999999666666999999333333333333666666ffffffffffffcccccc
-999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666000000ccccccffffff
-ffffffffffffffffffffffff999999000000666666ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff666666333333666666ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc999999666666ffffffffffffffffffcccccc666666666666
-ccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc666666ffffffffffffffffffffffff999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-333333333333999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999666666333333999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999666666000000333333333333ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-666666333333333333333333ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000000000ccccccffffff
-ffffffffffffffffffffffffffffffffffff666666ccccccffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffcccccc666666000000666666ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffcccccc333333333333
-000000000000000000333333666666999999999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333000000000000
-333333999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999000000666666
-ccccccffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffff333333333333666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666000000666666999999ffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffcccccc999999333333000000333333ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc000000333333ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666333333666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccccccccc666666666666000000000000000000ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-666666000000000000000000333333666666ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666333333666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc999999000000999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffccccccffffffffffff
-ffffff999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999000000666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999333333
-000000666666ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffccccccccccccffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccccccccccccccffffffffffffffffff
-000000999999ffffffffffffffffffccccccccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc999999666666333333000000ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999000000999999ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666333333
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333333333ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333333333
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff333333000000999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666000000000000999999ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999333333333333ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffffffffff666666000000000000666666666666cccccccccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc333333666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-666666333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999333333333333ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-666666000000999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000666666666666999999ffffffffffffccccccffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffcccccccccccc
-333333333333ccccccffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffcccccc999999666666333333000000666666ccccccffffffffffffffffff
-ffffffffffff333333999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999999999666666333333000000000000
-000000333333666666999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-ccccccffffffffffffffffff666666333333333333999999999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff666666333333ccccccffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffcccccc000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc000000333333999999ffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffcccccc333333000000999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff000000333333ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-000000000000999999ffffffffffffffffffffffffffffff999999000000333333666666
-ccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666000000
-000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-ffffffffffffffffff333333999999ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffff666666000000333333999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-999999666666666666333333ffffffffffffffffffffffff999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc666666666666000000000000000000333333666666
-999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999000000666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999000000
-000000999999ffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999
-333333333333000000666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333000000000000333333
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccccccccc999999999999333333333333000000666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc333333000000333333ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc000000ffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999666666333333
-000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc333333ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff666666000000ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc000000000000
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc999999ffffffffffffffffff333333000000333333666666666666
-999999ccccccccccccffffffffffffcccccc666666000000000000000000999999cccccc
-ffffffffffffffffffffffffffffffffffffcccccccccccccccccccccccccccccc666666
-999999ffffffffffffffffff333333333333666666666666ccccccccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc666666000000666666ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333000000000000333333333333999999ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffcccccc000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999333333
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc666666999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff000000000000ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999000000000000999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999999999
-666666333333333333999999333333000000000000000000000000000000000000000000
-000000000000ccccccffffffffffff333333000000333333333333333333333333999999
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333000000333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccccccccc666666666666000000000000000000333333333333999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccccccccffffffffffffffffffffffff
-000000000000333333666666999999ccccccccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999333333ffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffcccccc666666999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333666666
-ccccccffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffff666666666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc000000333333ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc000000000000999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666000000000000000000999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999333333666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccccccccc666666666666999999
-ffffffffffffffffffccccccccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc999999999999333333333333000000000000333333666666666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999000000666666ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999000000000000999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-333333000000000000333333666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333ffffffffffffffffffccccccccccccccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc999999999999333333333333666666ffffff
-ffffffffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999333333ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff333333666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff333333000000999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999000000000000999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666000000
-000000000000999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff000000ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999000000000000000000
-666666999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999666666ffffffffffffffffffcccccc666666666666999999999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc333333ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffff000000ffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999000000000000666666ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333000000000000000000
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc999999ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666
-333333000000000000000000333333999999999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333333333000000000000
-000000000000333333666666666666ccccccccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff000000ccccccffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffcccccc333333
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999333333ccccccffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffff000000ffffff000000ffffff000000000000ffffff
-ffffff000000ffffff000000000000000000cccccc000000000000000000ffffffffffff
-000000000000cccccc000000000000000000ffffffffffff000000000000000000ffffff
-000000000000ffffff000000000000000000000000ffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-333333999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc000000333333ffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc000000000000999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc666666000000000000000000999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc999999666666000000333333ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-cccccc999999666666333333333333000000ccccccffffffffffffffffffcccccccccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff666666ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000000000000000000000ffffffffffff000000ffffff
-ffffff000000ffffffffffff000000ffffff000000ffffffffffff000000ffffffffffff
-000000ffffffffffffffffff000000ffffffffffff000000ffffffffffff000000ffffff
-ffffff000000000000ffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666000000666666ffffffffffffffffffffffffffffff
-ffffffffffff999999000000000000999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc333333000000000000333333666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc000000333333999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffcccccc000000
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffff333333999999
-ffffffffffffffffffcccccc666666999999999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc333333ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffff000000ffffffffffff000000ffffff
-ffffff000000ffffffffffff000000000000ffffffffffffffffff000000ffffffffffff
-ffffff000000ffffffffffff000000ffffff000000ffffffffffffffffff000000ffffff
-ffffff000000ffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666000000ccccccffffffffffffffffffffffffffffff
-ffffffcccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666000000000000000000999999ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666000000333333
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-ffffffffffffffffffffffff666666666666ccccccccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999666666000000000000000000333333333333666666999999
-ccccccccccccffffffffffff666666999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff000000ffffffffffffffffff000000ffffff000000ffffffffffff
-000000ffffffffffff000000ffffff000000ffffffffffff000000ffffffffffff000000
-ffffff000000ffffff000000ffffffffffff000000ffffffffffff000000ffffffffffff
-000000ffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000000000ccccccffffffffffffffffffffffffffffff
-999999000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-333333000000000000000000666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666
-000000333333999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666333333000000000000000000666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccccccccc666666666666333333000000
-000000000000cccccccccccc333333ffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffff666666999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666666666ccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffff000000000000000000ffffff000000000000000000000000000000000000
-000000000000cccccc000000000000000000000000000000ffffffffffffcccccc000000
-000000ffffffffffff000000000000ffffff000000000000000000000000000000ffffff
-000000ffffffccccccffffff000000000000ffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc000000333333ffffffffffffffffffffffffffffffcccccc
-000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666000000
-000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000333333ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc999999333333000000000000
-333333000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffff666666999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999000000666666ffffffffffffffffffffffff999999000000
-000000999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333000000000000333333
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999333333000000999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999
-333333000000000000ccccccffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333000000999999ffffffffffffffffff999999000000000000
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc666666000000000000000000999999cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffff666666666666ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-333333333333666666000000000000999999ffffffffffff999999000000000000666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc333333000000000000000000666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccccccccffffffffffffffffff999999
-666666999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999333333ffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffff333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999666666ffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffff666666999999ffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000000000000000000000666666999999000000000000999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffff
-ffffffcccccc666666000000000000000000999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-333333000000000000333333999999999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff666666999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000000000000000000000000000000000000000999999ffffffffffff
-ffffffffffffffffffffffffffffffffffff999999333333ccccccffffffffffffcccccc
-333333000000000000333333666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999666666000000000000000000666666999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff666666999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff666666999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000000000000000000000000000000000666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc000000000000999999cccccc666666000000
-000000000000999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc999999333333000000333333ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000
-000000ffffffffffffffffff000000000000ffffff000000000000ffffff000000000000
-000000ffffff000000000000000000ffffff000000000000000000ffffffffffffffffff
-ffffff000000000000000000000000ffffffffffff000000000000000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff000000000000ffffff000000000000
-ffffff000000000000000000000000000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff666666999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffccccccccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000000000000000000000000000000000000000ccccccffffffffffff
-ffffffffffffffffffffffffcccccc333333000000000000000000000000000000000000
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff666666000000000000999999ffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999666666ffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-000000ffffffffffffffffffffffff000000000000ffffffffffff000000ffffff000000
-ffffffffffffcccccc000000ffffffffffffffffffffffff000000ffffffccccccffffff
-000000ffffffffffffffffffffffffffffff000000ffffffffffffffffff000000ffffff
-ffffffffffffccccccffffffffffffffffffffffffffffff000000000000ccccccffffff
-ffffffffffff000000ffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffff333333999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffff
-ffffffffffffcccccc000000ffffffffffffffffffffffffffffff000000ccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333000000000000000000000000000000000000000000000000ccccccffffff
-ffffffffffffffffffffffff666666000000000000000000000000000000999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc666666000000333333999999ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffffffffff000000ffffff000000
-ffffffffffff000000ffffffffffffffffffffffffffffff000000ffffffffffffffffff
-ffffff000000000000000000ffffffffffff000000ffffffffffffffffff000000ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff
-ffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff666666ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999000000000000000000000000000000333333666666ccccccffffffffffff
-ffffffffffffffffff999999000000000000000000000000000000333333ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc666666000000000000999999ffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999000000333333999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-000000ffffff000000ffffffffffffffffffffffffffffff000000ffffffffffffffffff
-ffffffffffffffffffffffff000000ffffff000000ffffffffffffffffff000000ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000000000ffffff000000000000ffffff000000000000
-ffffff000000000000ffffff000000000000000000000000000000ffffffffffffffffff
-000000000000000000000000000000000000ffffffffffff000000000000000000ffffff
-000000000000ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc000000000000333333999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc000000000000000000000000000000000000000000999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc666666000000333333ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999666666000000000000333333
-999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000
-000000000000000000ffffff000000000000000000ffffff000000000000000000ffffff
-000000000000ffffffffffffffffffffffff000000000000000000000000000000ffffff
-000000000000000000000000ffffffffffffffffff000000000000000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff000000000000000000000000ffffff
-ffffffffffffffffff000000000000000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffff000000000000ffffff000000
-ffffffffffff000000ffffffffffff000000ffffffffffff000000ffffffffffff000000
-ffffffffffff000000ffffff000000ffffffffffff000000ffffffffffff000000ffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff333333999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccccccccc999999999999666666999999666666333333333333333333333333333333
-333333333333000000333333333333333333333333333333333333333333333333666666
-666666999999333333666666666666666666666666666666666666999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666
-000000000000000000666666999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc333333ffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffff666666999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff333333999999ffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffff000000ffffffffffff000000ffffffcccccc000000
-ffffffffffff000000ffffffffffff000000ccccccffffff000000ffffff000000ffffff
-ffffffffffff000000ffffff000000ffffff000000ffffffffffffffffff000000ffffff
-ffffff000000ffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffcccccc000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc999999999999333333333333000000
-333333333333666666666666999999666666999999cccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc666666
-999999666666666666333333666666000000000000000000666666666666999999cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc999999999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc999999333333333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc333333ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffff000000ffffffffffff000000ffffff
-ffffff000000ffffffffffff000000ffffffffffff000000ffffffffffff000000ffffff
-ffffff000000ffffff000000ffffffffffff000000ffffffffffff000000ffffffffffff
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999666666333333000000333333666666666666ccccccccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999999999666666333333
-000000333333666666ccccccccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffccccccffffffffffffffffff999999999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000000000000000000000000000000000000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff666666666666ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000000000ffffff000000ffffffffffff000000000000
-ffffff000000000000ffffff000000000000ffffff000000000000ffffff000000000000
-000000000000000000000000000000ffffff000000000000000000ffffffffffffffffff
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-666666000000666666999999ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc999999666666333333666666ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff333333ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff333333999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333333333
-999999ffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffff999999333333666666ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffff333333333333ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999000000999999ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc000000ffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffcccccc333333
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff333333ccccccffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffff999999333333
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff333333ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999333333ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc666666000000666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666000000000000333333999999ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999666666ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff333333666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333000000
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666000000000000333333999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-cccccc000000000000999999ffffffffffffffffffffffff999999000000ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffcccccc
-666666000000333333999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999666666000000000000333333
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666333333ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-cccccc666666333333ffffffffffffffffffffffffffffff666666666666000000666666
-ccccccffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffcccccc666666333333666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc333333000000333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffff999999666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-666666333333999999ffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffcccccc000000666666ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff999999
-333333333333999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999666666000000999999ffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999666666ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999333333666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999000000ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffcccccc666666333333000000666666666666ccccccccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999999999
-333333000000333333666666999999ffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc999999ffffffffffffffffffccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc333333999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc666666000000999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999333333333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffff999999999999333333333333000000333333333333
-666666666666999999999999ccccccccccccccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-cccccccccccccccccc666666999999333333666666333333000000333333666666666666
-ccccccffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666000000666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff666666999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccccccccc
-999999999999666666666666333333333333333333000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000333333
-333333333333333333999999666666cccccc999999ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999000000000000
-000000999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff333333666666ccccccffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffff666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-666666000000000000666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666000000666666
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999666666000000666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666000000000000999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999666666000000333333999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc666666333333ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999333333
-333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999
-333333000000333333999999ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666000000666666999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc999999000000333333999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc333333666666ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc666666ffffffffffffffffff999999ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-ccccccffffffffffffcccccc666666999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff666666000000000000999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999333333000000999999
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffff999999333333333333ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999333333000000000000333333
-666666999999999999ffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffcccccc999999999999333333333333000000333333
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999000000333333ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-333333999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc999999000000666666ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-999999666666666666ffffffffffffffffff000000000000000000000000000000000000
-000000000000ffffffffffffffffff333333666666666666ccccccccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666000000666666999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc999999333333333333666666ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffff999999ccccccffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333000000333333999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999666666000000666666999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999333333
-333333666666ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999333333000000ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc333333000000000000666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999666666000000333333333333999999
-ccccccffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffff999999666666000000333333666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999666666000000000000000000000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc999999000000000000333333
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccccccccc666666
-333333333333999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccccccccc666666333333000000666666999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000000000000000000000000000333333ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc666666666666ffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666000000333333999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666666666000000000000333333666666666666ccccccccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc999999999999333333333333
-000000333333333333999999ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666000000000000000000000000000000999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-cccccc000000000000999999ffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666333333000000
-999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc999999999999333333333333000000
-333333333333999999666666999999999999cccccc999999ccccccccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccccccccccccccc999999
-cccccc666666999999666666666666333333000000333333666666666666cccccccccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff666666000000000000000000000000ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-cccccc666666333333ffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999
-000000000000666666ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999000000ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccccccccc666666999999666666666666333333333333333333333333000000000000
-000000000000000000000000000000000000000000000000333333333333333333333333
-333333999999666666999999999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999000000000000000000000000000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999333333000000666666ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333
-333333000000000000ffffffcccccc666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999999999000000999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999000000666666
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666333333666666cccccc
-ffffff000000000000ffffffffffff999999000000666666ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-000000000000666666ffffffffffffcccccc999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333
-000000333333999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc666666000000999999ccccccffffffffffff
-ffffff000000000000ffffffffffffffffffffffff999999333333666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffff666666999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666000000000000666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc999999333333333333999999ffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffff999999000000666666
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000
-333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333000000666666ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666333333666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffff999999
-333333666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff333333000000333333
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999000000333333666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc333333ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666
-000000999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999000000666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff333333000000000000ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666333333000000666666ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333333333999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff333333000000333333ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffccccccffffff666666999999ffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffff666666999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999333333000000333333999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff666666333333666666ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999000000666666ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff666666000000000000ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc666666000000333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc666666000000999999ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999333333666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff666666000000000000ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000333333999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc999999333333333333999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999000000666666
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999000000000000ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffff999999ccccccffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff666666000000000000999999ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-333333666666ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-333333666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999000000000000999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333cccccc
-ffffffffffffccccccffffffffffffffffffffffffffffff666666999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc999999ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc999999000000000000333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666000000999999
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999000000666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999000000000000999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff333333666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999333333000000
-666666ccccccffffffffffffffffffffffffcccccc333333333333999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc333333000000999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc666666666666ffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666333333000000666666
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-333333666666ffffffffffff666666333333666666ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999000000666666ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-cccccc000000000000999999ffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333
-000000000000999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666000000999999999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999333333666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-333333000000666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-cccccc666666333333ffffffffffffffffffffffffffffff666666333333999999ffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffff999999000000999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc999999000000000000333333999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999
-333333333333999999ffffffffffff333333333333ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999000000666666
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333
-000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffff666666333333ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff333333333333ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc666666000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666333333666666
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-333333666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666000000
-333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666000000ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc000000999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666ffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc666666000000999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000666666
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999000000666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666000000333333
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999ccccccffffffffffffffffffffffffffffff999999666666333333666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc999999333333ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666ffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc333333333333999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333
-000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999000000333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffcccccc999999
-000000666666999999ccccccffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffcccccc999999333333333333666666ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666000000333333666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff666666333333666666ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666000000333333999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999000000666666ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999000000000000999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666333333333333333333999999999999ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccccccccc666666
-666666000000333333666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666333333000000666666999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-666666000000999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666000000000000999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999333333666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc000000000000999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc999999666666666666333333000000333333333333
-333333999999666666cccccc999999cccccc999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-999999cccccc999999999999666666666666333333333333000000333333333333999999
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999333333000000000000666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999333333333333
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc666666000000333333ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999000000666666
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc000000000000999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999
-cccccc666666999999333333666666333333666666000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000333333
-666666333333666666666666999999999999ccccccccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffcccccccccccc333333000000000000
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666333333666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-333333666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc000000000000666666ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffcccccc999999
-666666ffffffffffffffffffccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc666666000000999999ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999000000666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc000000000000666666ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999333333ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333333333999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333000000333333ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffccccccccccccffffffffffffffffffcccccc999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-666666333333666666ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666999999ffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999000000666666ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000000000333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999000000000000
-333333999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666000000
-999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999000000333333999999ffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999333333666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333000000333333ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999
-333333000000000000333333666666ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc999999333333333333999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff666666000000000000999999ccccccffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999000000666666
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-333333000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc666666333333000000333333666666ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff666666333333666666ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999000000333333666666
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-333333666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc666666666666ffffffffffffffffffffffff
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc666666000000999999ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999333333
-000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999000000666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666000000
-000000ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333333333999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999000000000000
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ccccccffffffffffffffffffcccccc666666666666ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666333333
-666666ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffccccccccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999000000666666ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999000000000000999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff666666333333000000333333666666999999cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc666666000000999999cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffff666666333333ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999333333666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc000000000000999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc666666666666000000000000
-000000666666999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999cccccc999999999999666666999999666666999999666666333333333333333333
-333333333333333333333333333333333333000000333333333333999999666666999999
-999999cccccc999999ccccccccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffccccccffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999000000666666
-ccccccffffffffffffffffffffffffffffffcccccc000000000000999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-999999333333000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc999999666666666666333333000000000000
-333333333333333333333333666666666666666666666666999999999999999999999999
-999999999999999999333333333333333333999999666666666666666666666666666666
-666666333333333333333333333333000000333333333333999999999999cccccccccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffff666666333333
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-333333666666ffffffffffffffffffcccccc333333000000666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffcccccc000000999999ffffffcccccc999999
-666666666666333333000000000000333333333333666666666666999999999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999999999000000666666999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc666666999999666666666666333333000000
-000000333333333333999999999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffcccccc666666
-000000333333999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999cccccc
-999999666666000000666666999999333333000000333333333333333333333333333333
-333333ccccccffffffffffff999999999999666666999999666666999999999999cccccc
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666666666333333333333333333
-666666666666999999cccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccc999999999999666666666666000000333333666666ccccccccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666000000333333999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccccccccffffffffffff999999000000000000333333666666333333
-666666666666cccccc999999333333666666cccccccccccccccccccccccccccccccccccc
-ccccccccccccffffffffffffcccccc666666999999666666999999666666666666333333
-666666000000333333333333999999ffffffffffffccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc999999666666333333000000333333666666999999999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999666666333333000000000000666666
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc666666000000333333999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999999999666666333333
-000000000000333333999999ffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccccccccccccccffffffffffff999999000000000000333333666666
-666666ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-999999333333333333333333999999999999cccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc999999666666
-666666000000333333666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff666666000000000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffccccccffffffffffffffffff999999666666666666cccccc999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999
-999999333333000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999000000333333
-666666999999999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999666666000000333333666666ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999666666000000000000666666ffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffff333333333333666666999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc333333333333666666cccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccc999999666666333333333333999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666333333000000
-666666666666ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc999999333333333333333333
-999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666000000333333999999999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999666666000000666666
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffccccccffffffffffffcccccc666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffff999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666000000999999999999cccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc666666
-333333666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffccccccccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333333333ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff333333999999ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-333333333333666666cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999999999000000666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff333333000000333333ccccccffffffffffffffffffffffff
-cccccc666666000000333333999999ffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffcccccc333333000000666666ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666333333
-999999cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccc666666333333666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999666666000000666666ccccccffffff666666
-333333666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc999999000000666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc666666666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999333333666666cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999666666000000999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333000000333333666666
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666333333
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-cccccc000000000000999999ffffff999999666666ccccccffffffffffffffffff666666
-ccccccffffffffffffffffff999999999999ffffffffffffffffff999999666666cccccc
-ffffffffffffffffff666666ccccccffffffffffffffffff999999999999ffffffffffff
-ffffff999999666666ccccccffffffffffffffffff666666ccccccffffffffffffffffff
-999999999999ffffffffffffffffff999999666666ccccccffffffffffffffffff666666
-ccccccffffffffffffffffff999999999999ffffffffffffffffff999999666666cccccc
-ffffffffffffffffff666666ccccccffffffffffffffffff999999999999ffffffffffff
-ffffff999999666666ccccccffffffffffffffffff666666ccccccffffffffffffffffff
-999999999999ffffffffffffffffff999999666666ccccccffffffffffffffffff666666
-ccccccffffffffffffffffff999999999999ffffffffffffffffff999999666666cccccc
-ffffffffffffffffff666666ccccccffffffffffffffffff999999999999ffffffffffff
-ffffff999999666666ccccccffffffffffffffffff666666ccccccffffffffffffffffff
-999999999999ffffffffffffffffff999999666666ccccccffffffffffffffffff666666
-ccccccffffffffffffffffff999999999999ffffffffffffffffff999999666666cccccc
-ffffffffffffffffff666666ccccccffffffffffffffffff999999666666ffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff333333666666999999cccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccc333333333333ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666ffffffcccccc666666000000
-333333999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-cccccc666666333333ffffffcccccc000000000000666666ffffffffffff333333000000
-000000ffffffffffffcccccc000000000000ccccccffffffcccccc000000000000666666
-ffffffffffff333333000000000000ffffffffffffcccccc000000000000ccccccffffff
-cccccc000000000000666666ffffffffffff333333000000000000ffffffffffffcccccc
-000000000000999999ffffffcccccc000000000000666666ffffffffffff333333000000
-000000ffffffffffffcccccc000000000000999999ffffffcccccc000000000000666666
-ffffffffffff333333000000000000ffffffffffffcccccc000000000000999999ffffff
-cccccc000000000000666666ffffffffffff333333000000000000ffffffffffffcccccc
-000000000000999999ffffffffffff333333000000666666ffffffffffff333333000000
-000000ffffffffffffcccccc000000000000999999ffffffffffff333333000000666666
-ffffffffffff333333000000000000ffffffffffffcccccc000000000000999999ffffff
-ffffff333333000000666666ffffffffffff333333000000000000ffffffffffffcccccc
-000000000000999999ffffffffffff333333000000666666ffffffffffff333333000000
-000000ffffffffffffcccccc000000000000999999ffffffffffff333333000000666666
-ffffffffffff333333000000000000ffffffffffffcccccc000000000000999999ffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999000000999999999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999333333999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999000000666666ccccccffffffcccccccccccc
-666666000000ccccccffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffff999999333333666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffff666666333333ccccccffffffffffffcccccc333333
-999999ffffffffffffffffff333333333333ffffffffffffffffff666666333333cccccc
-ffffffffffffcccccc333333999999ffffffffffffffffff333333333333ffffffffffff
-ffffff666666333333ccccccffffffffffffcccccc333333999999ffffffffffffffffff
-333333333333ffffffffffffffffff666666333333ccccccffffffffffffcccccc333333
-999999ffffffffffffffffff333333333333ffffffffffffffffff666666333333cccccc
-ffffffffffffcccccc333333999999ffffffffffffffffff333333333333ffffffffffff
-ffffff666666333333ccccccffffffffffffcccccc333333999999ffffffffffffffffff
-666666333333ffffffffffffffffff666666333333ccccccffffffffffffcccccc333333
-999999ffffffffffffffffff666666333333ffffffffffffffffff666666333333cccccc
-ffffffffffffcccccc333333999999ffffffffffffffffff666666333333ffffffffffff
-ffffff666666333333ccccccffffffffffffcccccc333333999999ffffffffffffffffff
-666666333333ffffffffffffffffff666666333333ccccccffffffffffffcccccc333333
-999999ffffffffffffffffff666666333333ffffffffffffffffff666666333333cccccc
-ffffffffffffcccccc333333999999ffffffffffffffffff666666333333ffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666333333cccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccc999999666666666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc333333333333ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc666666333333ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666666666cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999666666
-333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999333333999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc000000999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff333333999999cccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-999999333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff333333666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999999999333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffff666666999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-666666999999cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccc999999333333ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-666666cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999666666333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999333333
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccc666666999999ffffffffffffffffff666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffccccccccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff333333999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999333333ccccccffffffcccccc333333999999ffffff
-ffffffffffff666666666666666666ccccccccccccffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffff666666000000999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff333333666666ffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-666666333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999cccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccc666666999999ffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333333333000000000000000000333333333333999999999999
-cccccc000000000000ffffffffffffffffff999999000000000000666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999333333ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc000000ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccccccccc666666666666333333000000
-000000000000000000ffffffcccccc999999333333000000000000000000333333cccccc
-ffffffffffffffffffffffffffffffffffffcccccc333333ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666cccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccc666666666666ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffcccccc000000000000000000000000000000000000000000
-999999ffffffffffffffffffffffffffffff666666666666ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000999999999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999333333ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffff000000000000000000000000000000000000
-000000999999ffffffffffffffffffffffff666666ffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffcccccc333333ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333cccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccc333333ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffcccccc000000000000000000000000666666999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000ffffffffffff000000ffffffffffffffffffffffffffffffffffff000000000000
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999333333999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffff999999000000666666999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999666666cccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccc000000cccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccc000000cccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccc333333ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-000000ffffffccccccffffff000000ffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-000000ffffffffffffffffffffffffffffffccccccffffffffffffffffffffffff000000
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666666666cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc000000cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999000000
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999666666666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc666666ccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-000000000000000000000000000000ffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffff000000000000ffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffff000000000000
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffcccccc000000
-000000ffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffff666666ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffff000000000000000000ffffff000000ffffff000000000000
-000000ffffffffffffffffff000000000000000000ffffff000000000000ffffffffffff
-ffffff000000000000ffffffffffff000000000000ffffffffffffffffffffffffffffff
-000000ffffff000000000000ffffff000000000000ffffff000000000000ffffff000000
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999666666cccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccc000000000000000000cccccccccccccccccc
-000000000000cccccc000000000000cccccc000000000000000000cccccc000000000000
-000000cccccc000000000000000000cccccccccccccccccccccccc000000000000000000
-000000cccccccccccc000000000000000000cccccccccccccccccccccccccccccccccccc
-cccccccccccccccccc000000000000cccccc000000000000cccccc000000000000000000
-000000000000cccccccccccccccccccccccccccccccccccccccccc000000000000000000
-cccccc000000cccccccccccccccccccccccc000000000000000000cccccc000000000000
-000000000000000000cccccccccccccccccccccccc000000000000000000cccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccc333333999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffff000000ffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffff000000
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000000000000000000000ffffffffffff000000000000ffffff000000ffffffffffff
-ffffff000000ffffff000000ffffffffffff000000000000ffffffffffff000000ffffff
-000000ffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffff000000ffffffffffff000000000000ffffff000000ffffff000000
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc000000cccccc999999cccccc
-999999000000000000cccccc999999000000999999000000999999cccccc999999000000
-999999cccccc999999cccccc000000cccccc999999cccccc000000cccccc999999cccccc
-999999cccccc000000cccccc999999cccccc000000cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc000000000000999999cccccc999999cccccc000000cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc000000cccccc
-000000cccccc000000cccccc999999000000999999cccccc999999000000999999000000
-999999cccccc999999cccccc999999cccccc000000cccccc999999cccccc000000cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999333333999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff000000
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffffffffff000000ffffffffffff000000ffffffffffff
-ffffff000000ffffff000000ffffffffffffffffff000000000000000000000000ffffff
-ffffff000000000000ffffffffffff000000000000ffffffffffffffffffffffffffffff
-000000ffffffffffff000000ffffffffffff000000ffffffffffff000000ffffff000000
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333cccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccc000000cccccccccccccccccc
-cccccc000000cccccccccccccccccc000000cccccc000000cccccccccccc000000cccccc
-cccccccccccccccccccccccc000000cccccccccccccccccccccccc000000000000000000
-cccccccccccc000000cccccccccccccccccc000000cccccccccccccccccccccccccccccc
-cccccccccccccccccccccccc000000cccccccccccccccccccccccccccccc000000cccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc000000cccccc
-000000cccccc000000cccccccccccc000000000000000000000000000000cccccc000000
-cccccccccccccccccccccccccccccccccccccccccc000000000000000000000000cccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccc333333ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffff000000000000ffffff000000ffffffffffff000000000000
-000000ffffffffffffffffff000000000000ffffffffffffffffff000000000000ffffff
-ffffffffffffffffffffffff000000ffffffffffff000000000000000000ffffffffffff
-000000000000000000000000ffffffffffffffffff000000000000000000ffffffffffff
-000000000000ffffff000000000000000000ffffff000000000000ffffffffffff000000
-ffffff000000000000ffffffffffff000000000000ffffff000000000000ffffff000000
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-000000ffffffffffffffffffffffffffffff000000ffffffffffff000000ffffffffffff
-ffffff000000cccccc000000ffffffffffffffffff000000ffffffffffffccccccffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffffffffffffffff
-000000ffffffcccccc000000ffffffffffff000000ffffffffffff000000cccccc000000
-ffffff000000ffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc000000cccccc999999cccccc
-999999000000999999cccccc999999000000999999cccccc000000cccccc000000cccccc
-999999cccccc999999cccccc000000cccccc999999cccccc999999cccccc999999cccccc
-000000cccccc000000cccccc999999cccccc000000cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc000000cccccc999999cccccc999999cccccc000000cccccc
-999999cccccc000000cccccc999999cccccc999999cccccc999999cccccc000000cccccc
-000000cccccc000000cccccc999999000000999999cccccc999999cccccc999999000000
-999999cccccc999999000000999999cccccc000000cccccc999999cccccc000000cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666ffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffff000000ffffffffffffffffff000000000000ffffffffffff000000ffffffffffff
-000000ffffffcccccc000000ffffff000000ffffffffffff000000ffffff000000ffffff
-ffffffffffffffffffffffff000000ffffff000000ffffffffffff000000ffffff000000
-ffffffffffff000000ffffffffffffffffffffffffffffff000000ffffffcccccc000000
-ffffff000000ffffffffffff000000ffffff000000ffffff000000ffffffffffff000000
-000000ffffff000000ffffff000000ffffff000000ffffffffffff000000000000ffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffff666666ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333333333ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000000000ffffffffffffffffff000000000000000000ffffffffffff000000000000
-000000ffffffffffffffffff000000000000000000ffffff000000000000000000ffffff
-000000000000ffffffffffff000000000000ffffffffffffffffffffffffffffff000000
-000000000000000000000000000000000000000000000000ffffff000000000000000000
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666666666cccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccc000000000000000000000000000000cccccc
-000000000000000000cccccc000000000000000000cccccc000000000000cccccccccccc
-cccccccccccc000000000000000000000000000000cccccc000000000000000000000000
-cccccccccccccccccc000000000000000000cccccccccccccccccccccccccccccccccccc
-cccccccccccccccccc000000000000000000000000cccccccccccccccccccccccc000000
-000000000000cccccccccccccccccccccccccccccccccccccccccc000000000000000000
-000000000000000000000000cccccccccccc000000000000000000000000cccccccccccc
-000000000000000000cccccccccccccccccc000000000000000000000000000000000000
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccc999999666666ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff333333ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffff000000ffffffffffff000000ffffffffffffffffff
-000000ffffff000000ffffffffffffffffffffffff000000000000000000ffffffffffff
-ffffffffffffffffffffffff000000000000ffffffffffffffffff000000ffffff000000
-000000000000ffffffffffffffffffffffffffffffffffff000000ffffff000000000000
-000000ffffffffffffffffff000000000000ffffffffffffffffffffffffffffff000000
-ffffffffffff000000000000000000000000ffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999333333999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc333333ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff333333ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff000000
-ffffffffffff000000ffffffffffff000000ffffff000000ffffffffffff000000ffffff
-ffffffffffffffffff000000ffffff000000ffffffffffff000000ffffffffffff000000
-ffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff000000ffffff
-ffffff000000ffffff000000ffffff000000ffffffffffff000000ffffff000000ffffff
-ffffff000000ffffff000000ffffffffffff000000ffffff000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff333333999999cccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccc999999666666ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000000000ffffffffffff000000ffffffffffffffffff000000000000000000000000
-000000ffffff000000000000000000ffffffffffff000000000000000000ffffffffffff
-ffffffffffffffffff000000000000000000000000000000ffffffffffffffffff000000
-000000000000ffffffffffffffffffffffffffffff000000ffffffffffff000000000000
-000000ffffffffffff000000000000000000000000000000ffffffffffff000000ffffff
-ffffff000000000000000000000000000000ffffffffffff000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999666666ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff333333000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc000000cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc000000000000000000000000
-000000000000000000cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999000000000000000000000000000000000000000000999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999333333ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffff000000ffffff
-ffffffffffff000000ffffffffffff000000cccccc000000ffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccc666666666666ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000
-000000000000ffffffffffffffffff000000000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999999999333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc333333ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-333333999999cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccc333333ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-999999333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc333333999999cccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccc333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc000000ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc333333999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999999999
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc333333666666cccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc999999333333
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc000000
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc666666333333cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999333333333333ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc333333999999cccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccc666666333333999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff333333333333999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999999999333333666666ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff666666ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333666666
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccc999999666666333333ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999333333999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999000000999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-000000666666999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999999999333333333333999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc666666000000ccccccffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffff999999333333333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333333333ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999333333333333999999cccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc999999
-666666000000ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc000000666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666333333999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999000000333333666666cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999666666333333333333
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999000000666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc666666000000666666999999cccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccc999999333333333333666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc000000000000999999ffffffcccccc
-666666ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-000000ffffffccccccffffff000000ffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffff000000ccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999333333000000666666
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999999999333333333333333333999999ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc000000000000666666ffffffffffffffffff
-666666333333000000999999ccccccffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffff999999333333000000999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffff000000000000000000ffffff000000ffffff000000000000
-000000ffffffffffffffffff000000000000000000ffffff000000000000ffffffffffff
-ffffff000000000000ffffffffffff000000000000ffffffffffffffffffffffff000000
-000000ffffff000000000000ffffff000000000000ffffff000000000000000000ffffff
-000000000000ffffff000000000000ffffff000000000000000000000000000000ffffff
-ffffff000000000000000000ffffff000000000000ffffff000000000000000000000000
-000000ffffff000000000000ffffffffffff000000000000000000000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-333333000000666666666666cccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc999999
-999999333333333333333333999999ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000000000666666ffffffffffffffffffffffff
-ffffffffffffcccccc333333333333666666ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc999999000000666666999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000000000000000000000ffffffffffff000000000000ffffff000000ffffffffffff
-ffffff000000ffffff000000ffffffffffff000000000000ffffffffffff000000ffffff
-000000ffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-000000000000ffffff000000000000ffffff000000000000ffffffffffffffffff000000
-ffffff000000000000ffffff000000ffffffffffff000000ffffff000000ffffffffffff
-000000ffffffffffffffffff000000ffffff000000000000ffffffffffff000000ffffff
-000000000000ffffff000000ffffff000000ffffffffffff000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999666666000000000000333333666666999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999999999666666333333000000333333
-666666999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000000000333333ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc999999333333ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000333333666666ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffffffffff000000ffffffffffff000000ffffffffffff
-ffffff000000ffffff000000ffffffffffffffffff000000000000000000000000ffffff
-ffffff000000000000ffffffffffff000000000000ffffffffffffffffffffffffffffff
-000000ffffffffffff000000ffffffffffff000000000000ffffffffffffffffff000000
-ffffff000000ffffffffffff000000ffffffffffff000000ffffff000000ffffffffffff
-000000ffffffffffffffffff000000ffffff000000ffffffffffffffffff000000ffffff
-000000ffffffffffff000000ffffffffffff000000000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc666666333333000000666666666666
-999999999999cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccc999999999999333333333333333333999999999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff333333000000333333ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333333333
-999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-000000ffffffffffffffffffffffffffffff000000ffffffffffff000000ffffffffffff
-ffffff000000cccccc000000ffffffffffffffffff000000ffffffffffffccccccffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffffffffffffffff
-000000ffffffcccccc000000ffffffffffff000000000000ffffffffffffcccccc000000
-ffffff000000ffffffffffff000000ffffffcccccc000000ffffff000000ffffffffffff
-000000ffffffccccccffffff000000ffffff000000ffffffffffffffffff000000ffffff
-000000ffffffffffff000000ffffff000000ccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666
-333333000000000000333333333333666666666666999999999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc666666666666333333333333
-333333000000000000333333666666ccccccccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff333333000000333333ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999
-666666333333000000666666999999ccccccccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffcccccc999999333333000000000000666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000000000ffffffffffffffffff000000000000000000ffffffffffff000000000000
-000000ffffffffffffffffff000000000000000000ffffff000000000000000000ffffff
-000000000000ffffffffffff000000000000ffffffffffffffffffffffffffffff000000
-000000000000ffffff000000000000ffffff000000000000000000000000000000ffffff
-000000000000000000ffffff000000000000000000000000000000000000000000ffffff
-ffffff000000000000000000ffffff000000000000000000ffffff000000000000000000
-000000000000ffffff000000000000000000000000000000000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccccccccc666666666666333333333333000000333333333333
-666666666666666666666666999999999999999999999999cccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccc999999999999999999999999999999
-999999666666666666666666666666333333000000000000666666666666999999999999
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333000000333333ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff999999666666666666ffffffffffffffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666333333666666ccccccccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999cccccc
-666666999999666666666666333333333333333333333333000000000000000000000000
-000000000000000000000000000000000000000000333333333333333333333333333333
-333333999999666666999999999999ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-333333000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999333333000000333333
-333333666666666666999999ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccccccccc999999999999333333333333000000000000
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff000000000000000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666
-000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc999999999999333333999999ffffffffffff999999666666666666999999999999
-ccccccccccccccccccccccccffffff999999999999ccccccccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccccccccc999999cccccccccccc999999666666
-999999ccccccffffffffffff999999333333666666666666ccccccccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffff999999000000000000000000000000000000000000000000000000000000000000
-999999ffffffffffffffffff333333999999ffffffffffffffffff999999000000000000
-000000000000000000000000000000000000000000000000999999ffffffffffffffffff
-333333999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000000000333333999999ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666000000
-000000ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999999999666666999999
-333333333333333333999999ffffff999999000000000000000000000000000000000000
-000000000000333333ffffffffffffcccccc333333333333333333333333666666999999
-666666ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-ffffffffffffffffffffffffccccccccccccffffffffffffffffffcccccccccccccccccc
-ccccccccccccccccccccccccccccccccccccccccccccccccffffffffffffffffffffffff
-ccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666000000000000000000000000333333999999999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999000000000000
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc000000000000000000000000000000000000
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666000000000000000000000000000000666666
-999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999000000000000999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666000000000000000000000000000000333333
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc999999333333000000000000
-000000000000333333666666ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc333333000000999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666000000000000000000000000000000000000000000333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999
-666666333333000000000000000000000000333333999999ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc000000000000666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666
-000000000000000000000000000000999999999999000000000000000000ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333333333ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc999999333333000000000000000000000000333333999999cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc333333000000666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999666666000000000000000000
-000000333333999999ccccccffffffffffffffffff333333333333ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999666666000000000000000000000000
-000000666666999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc333333000000333333ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666000000000000000000000000333333999999
-ccccccffffffffffffffffffffffffffffffffffff999999ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc999999333333
-000000000000000000000000333333666666ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff666666000000333333ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666000000000000000000000000333333999999ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc999999333333333333000000000000000000000000333333999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffff666666000000333333ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666
-000000000000000000000000000000999999ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc666666333333000000000000000000000000333333
-999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff666666000000333333ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff999999666666000000000000000000
-000000333333999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999666666000000000000
-000000000000000000666666999999ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999000000000000999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666000000000000000000000000333333999999
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-999999333333000000000000000000000000333333666666ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666000000000000000000000000333333999999ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-999999999999666666999999333333333333333333333333333333333333333333666666
-666666999999666666ccccccccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc999999333333000000000000000000000000000000333333999999
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffff999999
-000000000000999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666
-000000000000000000000000000000999999ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc999999333333000000000000
-333333666666666666666666999999999999999999999999999999999999999999666666
-666666666666666666333333333333000000666666999999ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc666666333333000000000000000000
-000000333333999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffcccccc000000
-000000666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc666666000000000000000000
-000000333333999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc999999000000333333333333999999999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999666666000000333333999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666
-000000000000000000000000000000666666999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffffcccccc000000000000
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666000000000000000000000000333333999999
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffff
-ffffffffffffffffffcccccc333333333333999999cccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccc999999666666333333
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc999999333333000000000000000000000000333333666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ffffffffffffffffffffffffffffffffffff000000000000333333
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666000000000000000000000000333333999999ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffffffffff999999333333999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999999999
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-000000ffffffccccccffffff000000ffffffffffffffffffffffffffffffccccccffffff
-ffffff000000ffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffcccccc000000
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffff000000ffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffcccccc999999333333000000000000000000000000000000
-333333999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999
-666666000000000000666666666666999999ffffffffffff000000000000333333ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666
-000000000000000000000000000000999999ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffcccccc333333cccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccc000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666333333000000
-000000000000000000333333666666999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999000000
-000000000000000000000000000000666666ffffff333333000000333333ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc666666000000000000000000
-000000333333999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffff999999333333cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999666666999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-ffffffffffffffffffffffffffffff000000ffffff000000000000000000000000ffffff
-000000000000000000ffffff000000000000ffffff000000000000000000ffffffffffff
-000000000000ffffff000000000000ffffff000000000000ffffffffffffffffff000000
-ffffffffffffffffff000000000000000000000000ffffffffffffffffff000000000000
-ffffffffffff000000000000ffffff000000000000ffffff000000000000ffffff000000
-000000ffffffffffff000000000000ffffff000000000000ffffff000000000000ffffff
-ffffff000000000000ffffff000000000000ffffff000000000000000000000000000000
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999666666000000000000000000000000000000666666666666ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc000000
-000000000000000000000000000000ffffff333333000000000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666000000000000000000000000333333999999
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffcccccc333333cccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccc333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-ffffffffffffffffffffffffffffff000000ffffffffffff000000ffffffffffff000000
-ffffff000000ffffffffffffffffff000000000000ffffffffffffffffff000000ffffff
-ffffff000000000000ffffff000000ffffffffffffffffff000000ffffffffffff000000
-ffffffffffffffffffffffff000000ffffffffffff000000ffffff000000ffffffffffff
-000000ffffffffffff000000000000ffffff000000000000ffffff000000000000ffffff
-000000ffffffffffffffffffffffff000000ffffff000000000000ffffff000000ffffff
-000000ffffffffffff000000ffffff000000000000ffffff000000ffffff000000ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc999999333333000000000000000000000000333333666666
-ccccccffffffffffffffffffffffffffffffffffff333333999999ffffffffffff666666
-000000000000000000000000999999666666000000000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666000000000000000000000000333333999999ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffff666666666666999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-333333999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffcccccc000000
-ffffffffffffffffffffffffffffff000000ccccccffffff000000ffffffffffff000000
-ffffff000000ccccccffffffffffff000000000000ffffffffffffffffff000000ffffff
-ffffff000000ffffffffffff000000ffffff000000000000000000ffffffffffff000000
-ffffffffffffccccccffffff000000ffffffffffff000000ffffff000000000000000000
-000000ffffffffffff000000ffffffffffff000000ffffffffffff000000ffffffffffff
-000000ffffffcccccc000000000000000000ffffff000000ffffffffffff000000ffffff
-000000000000000000000000ffffff000000ccccccffffff000000ffffff000000ffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc999999333333000000000000000000
-000000000000333333999999ccccccffffffcccccc000000000000999999ffffffffffff
-000000000000000000000000666666000000000000ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666
-000000000000000000000000000000999999ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffff
-ffffffffffffffffff999999333333666666cccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc999999333333
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffff000000ffffffffffffffffff000000ffffffffffff000000
-ffffff000000ffffffffffffffffff000000000000ffffffffffffffffff000000ffffff
-ffffff000000ffffffffffff000000000000ffffffffffff000000ffffffffffff000000
-ffffffffffffffffffffffff000000ffffffffffff000000ffffff000000ffffffffffff
-ffffffffffffffffff000000ffffffffffff000000ffffffffffff000000ffffffffffff
-000000ffffff000000ffffffffffff000000ffffff000000ffffffffffff000000ffffff
-000000ffffffffffffffffffffffff000000ffffffffffff000000ffffff000000ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666
-333333000000000000000000000000000000666666000000000000000000666666ffffff
-999999000000000000333333000000000000ccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc666666000000000000000000
-000000333333999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffcccccc666666000000666666666666cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc999999cccccc
-999999cccccc999999cccccc999999cccccc999999999999333333000000333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000000000ffffffffffffffffffffffff000000000000000000ffffff
-ffffff000000000000ffffff000000000000000000000000000000000000ffffffffffff
-000000000000000000ffffff000000000000000000000000000000000000000000000000
-000000ffffffffffffffffff000000000000000000ffffffffffffffffff000000000000
-000000ffffff000000000000000000000000000000000000ffffff000000000000ffffff
-000000000000ffffff000000000000000000000000000000000000ffffff000000000000
-ffffff000000000000000000000000000000000000ffffff000000000000000000000000
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999666666000000000000000000000000000000000000000000666666
-cccccc000000000000000000000000999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff999999666666000000000000000000000000333333999999
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffff999999666666000000333333333333
-666666999999999999999999cccccccccccccccccccccccccccccccccccccccccc999999
-999999999999999999666666666666333333000000333333999999ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc000000000000000000000000000000000000
-666666333333000000000000999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffcccccc666666000000000000000000000000333333999999ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999999999
-666666333333333333333333000000000000000000000000000000000000000000333333
-333333333333333333999999999999ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffff000000000000000000ccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffff000000000000000000ccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff999999cccccc666666666666000000000000000000000000000000000000
-000000333333000000333333333333333333333333333333333333333333333333333333
-666666666666000000000000000000666666999999ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc999999666666666666000000
-000000000000666666333333999999333333000000000000666666666666999999999999
-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-999999666666666666666666666666333333333333000000333333333333999999999999
-ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccccccccc666666333333000000333333666666999999999999ffffff
-ffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccccccccc999999666666
-333333000000333333666666999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333666666999999ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc999999666666000000666666ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666
-333333999999ccccccffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffff999999333333666666ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff333333999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff999999333333ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000000000000000ffffffffffff000000000000ffffff000000000000000000000000
-ffffffffffffffffff000000000000000000ffffffffffff000000000000ffffffffffff
-ffffff000000000000ffffffffffff000000000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff333333666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffff000000ffffffffffff000000000000000000ffffffffffffffffff
-000000ffffff000000ffffffffffff000000ffffff000000ffffffffffff000000ffffff
-000000ffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff000000999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-000000ffffffcccccc000000ffffffffffff000000ffffff000000ffffffccccccffffff
-000000ffffff000000ffffffffffffffffffcccccc000000000000000000000000ffffff
-ffffff000000000000ffffffffffff000000000000ffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999333333333333
-666666ffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffcccccc666666333333666666666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffff000000ffffffffffff000000ffffff000000ffffffffffffffffff
-000000ffffff000000ffffffffffffffffffffffff000000ffffffffffffffffffffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-999999000000666666999999ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffcccccc999999333333333333999999ffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000000000000000ffffffffffff000000000000000000ffffff000000000000000000
-ffffffffffffffffff000000000000000000ffffffffffff000000000000000000ffffff
-000000000000ffffffffffff000000000000ffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffff999999666666333333000000333333999999999999ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccccccccc
-666666666666000000333333666666ccccccffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffcccccc666666666666333333000000333333
-666666333333999999666666ccccccccccccccccccccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccccccccccccccc999999999999666666666666333333333333000000333333333333
-999999999999ffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccccccccc
-ffffffffffffffffff666666333333333333333333ffffffffffffffffff666666999999
-666666999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffcccccc000000
-000000000000ffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-999999cccccc666666999999333333333333333333333333000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-333333333333333333666666666666999999999999ccccccccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff666666000000333333333333
-ffffffffffffffffff999999ccccccccccccccccccffffffffffffffffff999999666666
-999999666666666666000000000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffff999999ccccccffffffffffff999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffcccccc000000999999ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffff
-ffffffffffffcccccc000000666666ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffcccccc000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffff000000
-ffffffffffff000000ffffffffffff000000ffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000ffffffffffffffffffffffff000000000000ffffffffffff000000
-000000ffffff000000000000ffffff000000000000000000000000000000000000ffffff
-ffffff000000000000000000ffffffffffff000000000000ffffff000000ffffff000000
-000000ffffff000000000000ffffff000000000000ffffff000000000000000000ffffff
-ffffff000000000000000000000000ffffffffffff000000000000ffffff000000000000
-000000000000ffffffffffffffffff000000000000000000ffffffffffff000000000000
-ffffffffffffffffff000000000000ffffffffffff000000000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000cccccc
-ffffff999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-333333999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffff000000ffffffffffff
-000000000000ffffff000000000000ffffff000000ffffff000000ffffffffffff000000
-000000ffffffffffffffffff000000ffffffffffff000000000000ffffffffffffffffff
-ffffff000000ffffff000000000000ffffff000000ffffffffffff000000ffffffffffff
-ffffffffffff000000ffffffffffff000000ffffffffffff000000000000000000ffffff
-ffffffffffff000000ffffff000000ffffffffffff000000ffffff000000ffffffffffff
-000000ffffff000000ffffffffffffffffff000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333cccccc
-ffffff666666333333ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666
-333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffff000000ffffffffffffffffff000000000000000000000000ffffffffffff
-000000ffffffcccccc000000ffffffffffff000000ffffff000000ffffffcccccc000000
-000000ffffffffffffffffff000000ffffffcccccc000000ffffffffffffffffff000000
-000000000000cccccc000000ffffffffffff000000ffffff000000ffffffccccccffffff
-ffffffffffff000000ffffffffffff000000ccccccffffff000000ffffff000000ffffff
-ffffffffffff000000ffffff000000ffffffffffffffffffffffff000000000000000000
-000000ffffffffffff000000000000ffffffcccccc000000000000ffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffff999999000000ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffffffffffffffff
-000000ffffffffffff000000ffffffffffff000000ffffff000000ffffffffffff000000
-000000ffffffffffffffffff000000ffffffffffff000000ffffffffffff000000ffffff
-ffffff000000ffffff000000ffffffffffffffffff000000000000ffffffffffffffffff
-ffffffffffff000000ffffffffffff000000ffffffffffff000000ffffff000000ffffff
-ffffffffffff000000ffffff000000ffffffffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffff000000ffffffffffffffffff000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffccccccccccccffffffffffffccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000000000ffffffffffffffffff000000000000000000ffffff000000
-000000000000ffffff000000000000ffffff000000000000000000000000000000ffffff
-ffffff000000000000000000ffffffffffff000000000000000000ffffffffffff000000
-000000000000000000000000000000ffffffffffff000000ffffffffffffffffffffffff
-ffffffffffff000000000000000000ffffffffffff000000000000000000ffffff000000
-000000000000ffffffffffffffffff000000000000000000ffffffffffff000000000000
-000000ffffff000000000000ffffffffffff000000000000ffffffffffffffffff000000
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffff333333333333333333666666ffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffff999999
-ccccccffffffffffffcccccc666666000000333333999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffffffffff
-ffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccccccccc666666ffffff
-ffffffffffff333333000000000000000000ffffffffffffffffff000000000000333333
-333333ffffffffffffffffff999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffcccccc000000000000000000ffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffff000000000000ffffffffffffffffffffffffffffff
-ffffff000000000000000000ffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffff999999666666ffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffff999999666666ffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccccccccc
-666666999999666666666666333333333333333333333333333333333333333333999999
-666666999999999999ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffff999999666666ffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffcccccc999999333333000000333333333333
-999999666666999999999999cccccccccccccccccccccccccccccccccccccccccc666666
-999999666666666666333333000000333333999999ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffff999999333333333333999999999999ffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffcccccc666666333333000000999999ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffff
-ffffffffffffcccccc333333666666ccccccffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffffcccccc333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333
-999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999000000999999
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffff999999333333666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffff333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff333333333333ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff333333666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-666666999999ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff666666000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccc333333666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-cccccc333333ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-333333ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999666666333333
-999999ccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffff666666333333ccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc666666
-666666ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-000000ffffffffffffffffff000000ffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffff000000ffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-666666333333333333999999ccccccffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffcccccc999999666666000000999999ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc666666333333ffffff
-ffffffffffff999999333333ccccccffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffff999999333333999999
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffff000000ffffffffffff000000000000ffffff000000000000
-ffffff000000000000000000ffffff000000000000ffffff000000000000ffffff000000
-000000ffffffffffff000000000000ffffff000000000000ffffff000000000000ffffff
-ffffff000000000000ffffff000000000000000000000000000000ffffffffffffffffff
-000000000000000000000000ffffff000000000000ffffff000000ffffff000000000000
-000000ffffffffffff000000000000000000ffffffffffff000000000000ffffffffffff
-ffffff000000000000ffffffffffff000000000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffcccccc666666333333000000666666666666ccccccccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff999999
-999999333333333333333333666666999999ffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffcccccc333333333333666666ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999666666000000666666ccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000000000000000000000ffffffffffff000000ffffffffffff000000ffffff000000
-000000ffffffffffff000000000000ffffff000000000000ffffff000000ffffffffffff
-ffffff000000ffffffffffff000000000000ffffff000000000000ffffffffffff000000
-ffffffffffff000000000000ffffff000000ffffff000000ffffffffffffffffffffffff
-ffffff000000ffffffffffff000000ffffff000000000000ffffff000000ffffffffffff
-ffffff000000000000ffffffffffff000000ffffff000000ffffffffffff000000ffffff
-000000ffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffff999999999999333333333333000000333333
-333333666666666666999999999999cccccc999999ccccccffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999cccccc999999999999666666999999333333333333333333000000333333666666
-666666ccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff666666666666ffffff
-ffffffffffffffffffffffffffffffcccccc999999333333333333333333666666666666
-ccccccccccccccccccccccccffffffffffffffffffffffffffffffffffffffffff999999
-cccccccccccc999999666666666666000000666666999999ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000ffffffffffffffffffffffffffffff000000000000000000000000ffffff000000
-ffffffffffffffffff000000ffffffffffff000000ffffffffffff000000ffffff000000
-000000000000ffffffffffff000000ffffffffffff000000000000000000000000000000
-ffffffffffff000000ffffffffffff000000ffffff000000ffffffffffffffffffffffff
-ffffff000000ffffffffffff000000ffffff000000ffffffffffff000000ffffffffffff
-ffffff000000000000ffffffffffffffffffffffff000000000000000000000000ffffff
-ffffff000000000000ffffffffffff000000000000ffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcccccc
-cccccc999999999999666666666666333333333333333333000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-666666333333666666333333999999666666cccccc999999ccccccffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffcccccccccccc999999999999
-333333333333333333333333000000000000000000000000000000000000000000333333
-333333333333666666999999999999ffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-000000ffffffccccccffffffffffffffffff000000ffffffffffffffffffcccccc000000
-ffffffffffffffffff000000ffffffffffff000000ffffffffffff000000000000ffffff
-ffffff000000ccccccffffff000000ffffffffffff000000000000ffffffccccccffffff
-ffffffffffff000000ffffffffffff000000cccccc000000ffffffffffffffffffffffff
-ffffff000000ccccccffffff000000ffffff000000ffffffffffff000000ccccccffffff
-ffffff000000000000ffffffffffffffffffcccccc000000ffffffffffffffffffffffff
-ffffffffffff000000ffffffffffffffffff000000ffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000
-000000000000ffffffffffffffffffffffffffffff000000000000000000000000000000
-000000ffffff000000000000000000ffffff000000000000ffffff000000000000000000
-000000000000000000000000000000000000ffffff000000000000000000000000000000
-ffffff000000000000000000ffffff000000000000000000000000ffffffffffffffffff
-ffffff000000000000000000ffffff000000000000000000ffffffffffff000000000000
-000000ffffffffffff000000000000000000ffffffffffff000000000000000000ffffff
-000000000000ffffffffffff000000000000ffffffffffffffffff000000ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccccccccffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff333333333333ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-999999000000000000ccccccffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999999999ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000cccccc
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffccccccffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffff999999666666ffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc000000000000ccccccffffffcccccc666666ccccccffffffffffffffffff666666
-ccccccffffffffffffffffff999999666666ffffffffffffffffffcccccc666666cccccc
-ffffffffffffffffff666666ccccccffffffffffffffffff999999666666ffffffffffff
-ffffffcccccc666666ccccccffffffffffffffffff666666ccccccffffffffffffffffff
-999999666666ffffffffffffffffffcccccc666666ccccccffffffffffffffffff666666
-ccccccffffffffffffffffffcccccc666666ffffffffffffffffffcccccc666666cccccc
-ffffffffffffffffff666666ccccccffffffffffffffffffcccccc666666ffffffffffff
-ffffffcccccc666666ccccccffffffffffffffffff666666ccccccffffffffffffffffff
-cccccc666666ffffffffffffffffffcccccc666666ccccccffffffffffffffffff666666
-ccccccffffffffffffffffffcccccc666666ffffffffffffffffffcccccc666666cccccc
-ffffffffffffffffff666666ccccccffffffffffffffffffcccccc666666ffffffffffff
-ffffffcccccc666666ccccccffffffffffffffffff666666ccccccffffffffffffffffff
-cccccc666666ffffffffffffffffffcccccc666666ccccccffffffffffffffffff666666
-ccccccffffffffffffffffffcccccc666666ffffffffffffffffffcccccc666666cccccc
-ffffffffffffffffff666666ccccccffffffffffffffffffcccccc666666ffffffffffff
-ffffffcccccc666666ccccccffffffffffffffffff666666ccccccffffffffffffffffff
-cccccc666666ffffffffffffffffffcccccc666666ccccccffffffffffffffffff666666
-ccccccffffffffffffffffffcccccc666666ffffffffffffffffffcccccc666666cccccc
-ffffffffffffffffff666666ccccccffffffffffffffffffcccccc666666ffffffffffff
-ffffffcccccc666666ccccccffffffffffffffffff666666ccccccffffffffffffffffff
-cccccc666666ffffffffffffffffffcccccc666666ccccccffffffffffffffffff666666
-ccccccffffffffffffffffffcccccc666666ffffffffffffffffffcccccc666666cccccc
-ffffffffffffffffff666666ccccccffffffffffffffffffcccccc666666ffffffffffff
-ffffffcccccc666666ccccccffffffffffffffffff666666ccccccffffffffffffffffff
-cccccc666666ffffffffffffffffffcccccc666666ccccccffffffffffffffffff666666
-999999ffffffffffffffffffcccccc666666ffffffffffffffffffcccccc666666cccccc
-ffffffffffffffffff666666999999ffffffffffffffffffcccccc666666ffffffffffff
-ffffffcccccc666666ccccccffffffffffffffffff666666999999ffffffffffffffffff
-cccccc666666ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-cccccc333333000000ffffffffffff333333000000666666ffffffffffff666666000000
-000000ffffffffffffcccccc000000000000999999ffffffffffff333333000000666666
-ffffffffffff666666000000000000ffffffffffffcccccc000000000000999999ffffff
-ffffff333333000000666666ffffffffffff666666000000000000ffffffffffffcccccc
-000000000000999999ffffffffffff333333000000666666ffffffffffff666666000000
-000000ffffffffffffcccccc000000000000999999ffffffffffff333333000000666666
-ffffffffffff666666000000000000ffffffffffffcccccc000000000000999999ffffff
-ffffff333333000000333333ffffffffffff666666000000000000ffffffffffffcccccc
-000000000000999999ffffffffffff333333000000333333ffffffffffff666666000000
-000000ffffffffffffcccccc000000000000999999ffffffffffff333333000000333333
-ffffffffffff666666000000000000ffffffffffffcccccc000000000000999999ffffff
-ffffff333333000000333333ffffffffffff999999000000000000ffffffffffffcccccc
-000000000000999999ffffffffffff333333000000333333ffffffffffff999999000000
-000000ffffffffffffcccccc000000000000999999ffffffffffff333333000000333333
-ffffffffffff999999000000000000ffffffffffffcccccc000000000000999999ffffff
-ffffff333333000000333333ffffffffffff999999000000000000ffffffffffffcccccc
-000000000000999999ffffffffffff333333000000333333ffffffffffff999999000000
-000000ffffffffffffcccccc000000000000999999ffffffffffff333333000000333333
-ffffffffffff999999000000000000ffffffffffffffffff000000000000999999ffffff
-ffffff333333000000333333ffffffffffff999999000000000000ffffffffffffffffff
-000000000000999999ffffffffffff333333000000333333ffffffffffff999999000000
-000000ffffffffffffffffff000000000000666666ffffffffffff333333000000333333
-ffffffffffff999999000000000000ffffffffffffffffff000000000000666666ffffff
-ffffff333333000000333333ffffffffffff999999000000000000ffffffffffffffffff
-000000000000666666ffffffffffff333333000000333333ffffffffffff999999000000
-000000ffffffffffffffffff000000000000666666ffffffffffff666666000000333333
-ffffffffffff999999000000000000ffffffffffffffffff000000000000666666ffffff
-ffffff666666000000333333ffffffffffff999999000000000000ffffffffffffffffff
-000000000000666666ffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffff999999333333999999ffffffffffffffffff333333
-999999ffffffffffffffffff666666333333ffffffffffffffffff999999333333999999
-ffffffffffffffffff333333999999ffffffffffffffffff666666333333ffffffffffff
-ffffff999999333333999999ffffffffffffffffff333333999999ffffffffffffffffff
-666666333333ffffffffffffffffff999999333333999999ffffffffffffffffff333333
-666666ffffffffffffffffff666666333333ffffffffffffffffff999999333333999999
-ffffffffffffffffff333333666666ffffffffffffffffff666666333333ffffffffffff
-ffffff999999333333999999ffffffffffffffffff333333666666ffffffffffffffffff
-666666333333ffffffffffffffffff999999333333999999ffffffffffffffffff333333
-666666ffffffffffffffffff666666333333ffffffffffffffffff999999333333999999
-ffffffffffffffffff333333666666ffffffffffffffffff666666333333ffffffffffff
-ffffff999999333333999999ffffffffffffffffff333333666666ffffffffffffffffff
-666666333333ffffffffffffffffff999999333333999999ffffffffffffffffff333333
-666666ffffffffffffffffff666666333333ffffffffffffffffff999999333333999999
-ffffffffffffffffff333333666666ffffffffffffffffff666666333333ffffffffffff
-ffffff999999333333999999ffffffffffffffffff333333666666ffffffffffffffffff
-666666333333ffffffffffffffffff999999333333999999ffffffffffffffffff333333
-666666ffffffffffffffffff666666333333ffffffffffffffffff999999333333999999
-ffffffffffffffffff333333666666ffffffffffffffffff666666333333ffffffffffff
-ffffff999999333333999999ffffffffffffffffff333333666666ffffffffffffffffff
-666666333333ffffffffffffffffff999999333333999999ffffffffffffffffff333333
-666666ffffffffffffffffff666666333333ffffffffffffffffff999999333333999999
-ffffffffffffffffff333333666666ffffffffffffffffff666666333333ffffffffffff
-ffffff999999333333999999ffffffffffffffffff333333666666ffffffffffffffffff
-666666333333ffffffffffffffffff999999333333999999ffffffffffffffffff333333
-666666ffffffffffffffffff999999333333ffffffffffffffffff999999333333999999
-ffffffffffffffffff333333666666ffffffffffffffffff999999333333ffffffffffff
-ffffff999999333333999999ffffffffffffffffff333333666666ffffffffffffffffff
-999999333333ffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffccccccffffffffffffffffffffffffffffffffffffffffffccccccffffff
-ffffffffffffffffffffffffffffffffffffccccccffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffff
-
-showpage
-
-% stop using temporary dictionary
-end
-
-% restore original state
-origstate restore
-
-%%Trailer
diff --git a/lib/inviso/doc/src/notes.xml b/lib/inviso/doc/src/notes.xml
deleted file mode 100644
index 661284e786..0000000000
--- a/lib/inviso/doc/src/notes.xml
+++ /dev/null
@@ -1,278 +0,0 @@
-<?xml version="1.0" encoding="latin1" ?>
-<!DOCTYPE chapter SYSTEM "chapter.dtd">
-
-<chapter>
- <header>
- <copyright>
- <year>2006</year><year>2011</year>
- <holder>Ericsson AB. All Rights Reserved.</holder>
- </copyright>
- <legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
-
- </legalnotice>
-
- <title>Inviso Release Notes</title>
- <prepared></prepared>
- <docno></docno>
- <date></date>
- <rev></rev>
- <file>notes.xml</file>
- </header>
- <p>This document describes the changes made to the Inviso application.</p>
-
-
- <section><title>Inviso 0.6.3</title>
-
- <section><title>Improvements and New Features</title>
- <list>
- <item>
- <p>The <c>inviso</c> application has been deprecated and
- will be removed in the R16 release.</p>
- <p>
- Own Id: OTP-9798</p>
- </item>
- <item>
- <p>
- Eliminate use of deprecated regexp module</p>
- <p>
- Own Id: OTP-9810</p>
- </item>
- </list>
- </section>
-
-</section>
-
-<section><title>Inviso 0.6.2</title>
-
- <section><title>Fixed Bugs and Malfunctions</title>
- <list>
- <item>
- <p>
- The obsolete guards has now been changed to the new guard
- interface.</p>
- <p>
- Own Id: OTP-8747</p>
- </item>
- </list>
- </section>
-
-</section>
-
-<section><title>Inviso 0.6.1</title>
-
- <section><title>Improvements and New Features</title>
- <list>
- <item>
- <p>
- The documentation is now built with open source tools
- (xsltproc and fop) that exists on most platforms. One
- visible change is that the frames are removed.</p>
- <p>
- Own Id: OTP-8201</p>
- </item>
- </list>
- </section>
-
-</section>
-
-<section><title>Inviso 0.6</title>
- <section><title>Fixed Bugs and Malfunctions</title>
- <list>
- <item>
- <p>
- In this release the following has been fixed and
- enhanced: Autostart: It is now possible to configure
- modules that shall be loaded by the autostart mechanism.
- This because it is not certain that all application
- systems make use of the OTP boot script to set up paths
- to all Erlang modules. Runtime_tools/Inviso: A bug in the
- fetch_log functionality has been fixed. Further a bug
- that was (supposedly) fixed in a previous patch
- concerning meta-tracer write_ti has been fixed (again) in
- this patch. A bug in inviso_as_lib making remote
- autostart config file updates fail has been fixed.
- Inviso: inviso_tool has been given a flush API.</p>
- <p>
- Own Id: OTP-6918</p>
- </item>
- </list>
- </section>
-
-</section>
-<section><title>Inviso 0.5</title>
-
- <section><title>Improvements and New Features</title>
- <list>
- <item>
- <p>
- The following bugs/improvements have been done: Internal
- interworking between inviso_rt and inviso_rt_meta. The
- call function used by inviso_rt to call inviso_rt_meta is
- now protected with a monitor. Inviso_rt_meta now includes
- the timestamp of the incoming meta trace message when
- calling the call-callback. (Makes it possible to add a
- "better" timestamp to the ti-file.) Bug in inviso_tool
- making it not remove trace patterns when terminating. Bug
- in internal function h_start_session making inviso_tool
- crash if there were no active nodes to start the session
- on. The user-inviso_tool and inviso API-inviso control
- component request/response gen_server protocols had
- default time-out. Since many trace operations can be time
- consuming, a longer time-out is necessary. Improved
- overload protection. It is now possible to let the
- overload protection renew itself (e.g after an exit from
- an external overload protector). Inviso_rt_meta now fully
- uses the exception_trace match spec action term. Run
- Trace Case API (as in contrast to activate and deactivate
- trace case APIs) in inviso_tool. Flush trace-port API
- added to inviso. Get_session_data API added to
- inviso_tool. Improved inviso_tool:stop making it possible
- to name nodes which shall not have their trace patterns
- removed when inviso_tool terminates. Bug in handling of
- writing multiple ti-entries if returned from a
- call/return_from call-back in inviso_rt_meta Process
- trace flags are no longer explicitly removed by the
- inviso_tool when it terminates. Not necessary.
- Inviso_tool get_autostart_data adopted to standard
- autostarter.</p>
- <p>
- *** INCOMPATIBILITY with Meta trace call-backs are called
- with different arguments now. ***</p>
- <p>
- Own Id: OTP-6881</p>
- </item>
- </list>
- </section>
-
-</section>
-<section><title>Inviso 0.4</title>
-
- <section><title>Fixed Bugs and Malfunctions</title>
- <list>
- <item>
- <p>
- A bug in inviso_rt_meta caused an ETS table containing
- information on initiated (init_tpm) functions to be lost
- when suspending tracing. Further an enhancement to
- inviso_rt has been introduced making it possible to
- activate process trace flags based on globally registered
- names. It is then not an error to activate a global name
- on a node where the name does not reside. The process
- count in the return value will simply be set to zero
- (hence exactly one node in the NodeResult part of the
- return value will indicate one matching process found). A
- bug was found in fetch_log API. At the same time the
- fetch_log functionality was enhanced to also offer flow
- control making fetcher processes send chunks of
- transferred file data at a slower pace.</p>
- <p>
- Own Id: OTP-6703</p>
- </item>
- </list>
- </section>
-
-
- <section><title>Improvements and New Features</title>
- <list>
- <item>
- <p>
- Minor Makefile changes.</p>
- <p>
- Own Id: OTP-6689 Aux Id: OTP-6742 </p>
- </item>
- </list>
- </section>
-
-</section>
-
-
-<section><title>Inviso 0.3</title>
-
- <section><title>Improvements and New Features</title>
- <list>
- <item>
- <p>
- In this release the first working version of the
- inviso_tool is included. Updates and small bugfixes in
- the inviso application.</p>
- <p>
- Own Id: OTP-6677</p>
- </item>
- </list>
- </section>
-
-</section>
-<section><title>Inviso 0.2.1</title>
-
- <section><title>Improvements and New Features</title>
- <list>
- <item>
- <p>
- Misc improvements.</p>
- <p>
- Own Id: OTP-6576</p>
- </item>
- </list>
- </section>
-
-</section>
-
-<section><title>Inviso 0.2</title>
-
- <section><title>Fixed Bugs and Malfunctions</title>
- <list>
- <item>
- <p>
- This ticket includes several improvements and bugfixes to
- both runtime_tools and inviso. The overload mechanism can
- now also react to incoming messages. This is useful if
- an external overload watch-dog is used. Some improvements
- of variable bindings has been done to the default
- autostart mechanism - inviso_autostart_server. Autostart
- "jobs" can now be done in parallel, allowing for some
- jobs to hang waiting for some parts of the traced system
- to become ready before proceeding. Previously when using
- named meta-match-specs (tpm_ms) ending up with zero
- match-specs still kept the meta trace pattern active.
- This caused zero match-specs to be equal to unlimited
- meta tracing on that particular function. If the internal
- database becomes empty of meta match specs, meta trace
- pattern is removed for that function. Standard public
- loop data in the inviso runtime meta tracer process is
- now extended to a 2-tuple. The functions ctp/1 and ctpl/1
- are added making it possible to remove trace patterns for
- a list of functions rather than one by one.
- Inviso_rt_meta will now accept a list of binaries to be
- output into the trace information file, in additions to a
- single binary. Further it is also possible to make own
- output to the trace information file using the write_ti/1
- function. An error was discovered in inviso_rt making the
- inviso_rt_meta remain rather than terminate if the
- inviso_rt terminated due to "running alone" (not allowed
- to run without a control component). A new tool,
- inviso_tool, has been added to the inviso application.</p>
- <p>
- Own Id: OTP-6426</p>
- </item>
- </list>
- </section>
-
-</section>
-
- <section>
- <title>Inviso 0.1</title>
- <p>First version.</p>
- </section>
-
-</chapter>
-
diff --git a/lib/inviso/info b/lib/inviso/info
deleted file mode 100644
index 3190d6d1cc..0000000000
--- a/lib/inviso/info
+++ /dev/null
@@ -1,2 +0,0 @@
-group: tools
-short: A trace tool for both development and delivered systems.
diff --git a/lib/inviso/src/Makefile b/lib/inviso/src/Makefile
deleted file mode 100644
index 1f2f8b1aff..0000000000
--- a/lib/inviso/src/Makefile
+++ /dev/null
@@ -1,104 +0,0 @@
-# ``The contents of this file are subject to the Erlang Public License,
-# Version 1.1, (the "License"); you may not use this file except in
-# compliance with the License. You should have received a copy of the
-# Erlang Public License along with this software. If not, it can be
-# retrieved via the world wide web at http://www.erlang.org/.
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-# the License for the specific language governing rights and limitations
-# under the License.
-#
-# The Initial Developer of the Original Code is Ericsson Utvecklings AB.
-# Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
-# AB. All Rights Reserved.''
-#
-# $Id$
-#
-include $(ERL_TOP)/make/target.mk
-include $(ERL_TOP)/make/$(TARGET)/otp.mk
-
-# ----------------------------------------------------
-# Application version
-# ----------------------------------------------------
-include ../vsn.mk
-VSN=$(INVISO_VSN)
-
-# ----------------------------------------------------
-# Release directory specification
-# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/lib/inviso-$(VSN)
-
-# ----------------------------------------------------
-# Common Macros
-# ----------------------------------------------------
-
-MODULES= \
- inviso \
- inviso_c \
- inviso_lfm \
- inviso_lfm_tpfreader \
- inviso_tool \
- inviso_tool_lib
-
-
-#HRL_FILES= ../include/
-
-ERL_FILES= $(MODULES:%=%.erl)
-
-TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR)) $(APP_TARGET) $(APPUP_TARGET)
-
-APP_FILE= inviso.app
-
-APP_SRC= $(APP_FILE).src
-APP_TARGET= $(EBIN)/$(APP_FILE)
-
-APPUP_FILE= inviso.appup
-
-APPUP_SRC= $(APPUP_FILE).src
-APPUP_TARGET= $(EBIN)/$(APPUP_FILE)
-
-# ----------------------------------------------------
-# FLAGS
-# ----------------------------------------------------
-ERL_COMPILE_FLAGS += +warn_unused_vars -I../include
-
-# ----------------------------------------------------
-# Targets
-# ----------------------------------------------------
-
-debug opt: $(TARGET_FILES)
-
-clean:
- rm -f $(TARGET_FILES)
- rm -f errs core *~
-
-$(APP_TARGET): $(APP_SRC) ../vsn.mk
- sed -e 's;%VSN%;$(VSN);' $< > $@
-
-$(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
- sed -e 's;%VSN%;$(VSN);' $< > $@
-
-docs:
-
-# ----------------------------------------------------
-# Release Target
-# ----------------------------------------------------
-include $(ERL_TOP)/make/otp_release_targets.mk
-
-release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src
-# $(INSTALL_DIR) $(RELSYSDIR)/include
-# $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
-
-release_docs_spec:
-
-
-
-
-
-
-
diff --git a/lib/inviso/src/inviso.app.src b/lib/inviso/src/inviso.app.src
deleted file mode 100644
index 91eaa1b9b2..0000000000
--- a/lib/inviso/src/inviso.app.src
+++ /dev/null
@@ -1,13 +0,0 @@
-{application,inviso,
- [{description, "INVISO trace tool"},
- {vsn, "%VSN%"},
- {modules, [inviso_c,inviso,
- inviso_lfm,inviso_lfm_tpfreader
- ]},
- {registered, [inviso_c]},
- {applications, [kernel, stdlib, runtime_tools]},
- {env, []}
- ]}.
-
-
-
diff --git a/lib/inviso/src/inviso.appup.src b/lib/inviso/src/inviso.appup.src
deleted file mode 100644
index 54a63833e6..0000000000
--- a/lib/inviso/src/inviso.appup.src
+++ /dev/null
@@ -1 +0,0 @@
-{"%VSN%",[],[]}.
diff --git a/lib/inviso/src/inviso.erl b/lib/inviso/src/inviso.erl
deleted file mode 100644
index 07bdf3e649..0000000000
--- a/lib/inviso/src/inviso.erl
+++ /dev/null
@@ -1,1056 +0,0 @@
-%% ``The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved via the world wide web at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
-%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
-%% AB. All Rights Reserved.''
-%%
-%% $Id$
-%%
-%% Author: Ann-Marie L�f, [email protected]
-%% Lennart �hman, [email protected]
-%%
-%% Description: API module for the inviso system.
-%% Inviso consists of a control component and possibly one or more runtime
-%% components. This module is simply the API to the inviso system. All normal
-%% calls goes through the control component.
-%% ------------------------------------------------------------------------------
-
--module(inviso).
--deprecated(module).
-
-%% ------------------------------------------------------------------------------
-%% Exported API functions.
-%% ------------------------------------------------------------------------------
-
--export([start/0, start/1,
- add_node/1, add_node/2, add_node_if_ref/1, add_node_if_ref/2,
- add_nodes/2, add_nodes/3, add_nodes_if_ref/2, add_nodes_if_ref/3,
- change_options/1, change_options/2,
- init_tracing/1, init_tracing/2,
- stop_tracing/0, stop_tracing/1,
- clear/0, clear/1, clear/2,
- flush/0,flush/1,
- stop/0, stop_nodes/0, stop_nodes/1, stop_all/0,
- tp/1,tp/2,tp/4,tp/5,tp/6,
- tpl/1,tpl/2,tpl/4,tpl/5,tpl/6,
- tpm_localnames/0,tpm_localnames/1,tpm_globalnames/0,tpm_globalnames/1,
- init_tpm/4,init_tpm/5,init_tpm/7,init_tpm/8,
- tpm/4,tpm/5,tpm/6,tpm/8,tpm/9,
- tpm_tracer/4,tpm_tracer/5,tpm_tracer/6,tpm_tracer/8,tpm_tracer/9,
- tpm_ms/5,tpm_ms/6,
- tpm_ms_tracer/5,tpm_ms_tracer/6,
- ctpm_ms/4,ctpm_ms/5,ctpm/3,ctpm/4,
- ctpm_localnames/0,ctpm_localnames/1,ctpm_globalnames/0,ctpm_globalnames/1,
- ctp/1,ctp/2,ctp/3,ctp/4,
- ctpl/1,ctpl/2,ctpl/3,ctpl/4,
- tf/1, tf/2, tf/3,
- ctf/1, ctf/2, ctf/3,
- ctp_all/0, ctp_all/1, ctf_all/0, ctf_all/1,
- suspend/1, suspend/2,
- cancel_suspension/0, cancel_suspension/1,
- get_status/0, get_status/1,
- get_tracerdata/0, get_tracerdata/1,
- list_logs/0, list_logs/1,
- fetch_log/2, fetch_log/3, fetch_log/4,
- delete_log/0, delete_log/1, delete_log/2,
- subscribe/0, subscribe/1,
- unsubscribe/0, unsubscribe/1]).
-
-%% debuging inviso
--export([state/0, state/1]).
-
-%% ------------------------------------------------------------------------------
-%% Macros used in this module.
-%% ------------------------------------------------------------------------------
-
--define(CONTROLLER,inviso_c).
-
-%% Some function calls to runtime components may take long time, we must wait
-%% longer than the standard timeout for a reply from the control component.
--define(CALL_TIMEOUT,60000).
-%% ------------------------------------------------------------------------------
-
-
-
-%% =============================================================================
-%% CONTROL COMPONENT API FUNCTIONS.
-%% =============================================================================
-
-%% start()={ok,pid()}|{error,Reason}
-%% start(Options)={ok,pid()}|{error,Reason}
-%% Options=[Option,...], the options will be default options to runtime components
-%% later started. See add_node about available options.
-%% There are also options consumed by the control component:
-%% Option={subscribe,pid()}
-%%
-%% Starts a control component process on the local node. A control component must
-%% be started before runtime components can be started manually.
-start() ->
- gen_server:start({local,?CONTROLLER},?CONTROLLER,{self(),[]},[]).
-
-start(Options) ->
- gen_server:start({local,?CONTROLLER},?CONTROLLER,{self(),Options},[]).
-%% -----------------------------------------------------------------------------
-
-%% add_node(Reference)=NodeResult|{error, Reason}
-%% add_node(Reference,Options)=NodeResult|{error, Reason}
-%% Reference=PreviousReference = term(),
-%% Options=[Option,...],
-%% Option={dependency,Dep}
-%% Dep=integer()|'infinity'; The timeout before the runtime component will
-%% terminate if abandoned by this control component.
-%% Option={overload,Overload}; controls how and how often overload checks shall
-%% be performed. Instead of specifying a tuple, the atom 'overload' can be
-%% specified to state no loadcheck. The result will actually be the same
-%% if 'infinity' is used as intervall. It is sometimes necessary to
-%% initialize the overlaod check. This can be done with InitMFA. The
-%% loadchecker must then also be removed by using a RemoveMFA.
-%% Overload=Iterval (int() in milliseconds) |
-%% {LoadMF,Interval}|{LoadMF,Interval,InitMFA,RemoveMFA}
-%% LoadMF={Mod,Func}
-%% InitMFA,RemoveMFA={Mod,Func,ArgList}|void
-%% If just Interval is used, it means using a default overload check.
-%% NodeResult={ok,NAns}|{error,Reason}
-%% NAns=new|{adopted,State,Status,PreviousReference}|already_added
-%% Status = running | {suspended, SReason}
-%%
-%% Starts or tries to connect to an existing runtime component at the local
-%% node, regardless if the system is distributed or not.
-%% Options will override any default options specified at start-up of the
-%% control component.
-add_node(Reference) ->
- gen_server:call(?CONTROLLER,{add_nodes,[node()],[],Reference,any_ref},?CALL_TIMEOUT).
-
-add_node(Reference,Options) when is_list(Options) ->
- gen_server:call(?CONTROLLER,{add_nodes,[node()],Options,Reference,any_ref},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% add_node(Reference)=NodeResult|{error,{wrong_reference,OtherRef}}|{error,Reason}
-%% add_node(Reference,Options)=NodeResult|{error,{wrong_reference,OtherRef}}|
-%% {error,Reason}
-%%
-%% As add_node/1,/2 but will only connect to an already existing runtime component
-%% if its reference is the same as the one given as argument.
-add_node_if_ref(Reference) ->
- gen_server:call(?CONTROLLER,{add_nodes,[node()],[],Reference,if_ref},?CALL_TIMEOUT).
-
-add_node_if_ref(Reference,Options) when is_list(Options) ->
- gen_server:call(?CONTROLLER,{add_nodes,[node()],Options,Reference,if_ref},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% add_nodes(Nodes,Reference)={ok,NodeResults}|{error,Reason}
-%% add_nodes(Nodes,Reference,Options)={ok,NodeResults}|{error,Reason}
-%% Nodes=[Node,...],
-%% NodeResults=[{Node,NodeResult},...]
-%%
-%% As add_node/1,/2 but for the nodes specified in Nodes.
-%% It is possible but not intended to use this function in a non-distributed
-%% system. By speicifying node() as the node where the runtime component shall
-%% be started. The return value will then follow the rules of non distributed
-%% returnvalues and not have a node indicator.
-add_nodes(Nodes,Reference) when is_list(Nodes) ->
- gen_server:call(?CONTROLLER,{add_nodes,Nodes,[],Reference,any_ref},?CALL_TIMEOUT).
-
-add_nodes(Nodes,Reference,Options) when is_list(Nodes),is_list(Options) ->
- gen_server:call(?CONTROLLER,{add_nodes,Nodes,Options,Reference,any_ref},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% add_nodes_if_ref(Nodes,Reference)={ok,NodeResults}|{error,Reason}
-%% add_nodes_if_ref(Nodes,Reference,Options)={ok,NodeResults}|{error,Reason}
-%%
-%% As add_nodes/2,/3 but will only connect to an already existing runtime component
-%% if its reference is the same as the one given as argument.
-add_nodes_if_ref(Nodes,Reference) when is_list(Nodes) ->
- gen_server:call(?CONTROLLER,{add_nodes,Nodes,[],Reference,if_ref},?CALL_TIMEOUT).
-
-add_nodes_if_ref(Nodes,Reference,Options) when is_list(Nodes),is_list(Options) ->
- gen_server:call(?CONTROLLER,{add_nodes,Nodes,Options,Reference,if_ref},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% change_options(Options)={ok,NodeResults}|NodeResult|{error,Reason}
-%% change_options(Nodes,Options)={ok,NodeResults}|{error,Reason}
-%% Nodes=[Node,...],
-%% Options= see add_node and add_nodes on available options.
-%%
-%% Change options on all or specified Nodes. This may result in for instance
-%% reinitialization of overloadcheck.
-change_options(Options) when is_list(Options) ->
- gen_server:call(?CONTROLLER,{change_options,all,Options},?CALL_TIMEOUT).
-change_options(Nodes,Options) when is_list(Nodes),is_list(Options) ->
- gen_server:call(?CONTROLLER,{change_options,Nodes,Options},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% init_tracing(TracerData)={ok,[{Node,NodeResult}]} | NodeResult | {error,Reason}
-%% init_tracing(TracerList)={ok,[{Node,NodeResult}]} | {error,Reason}
-%% init_tracing(Nodes,TracerData)={ok,[{Node,NodeResult}]}|{error,Reason}
-%% TracerData = [{trace,LogTD} [,{ti,TiTD}]}] | LogTD
-%% LogTD = {HandlerFun,Data} | collector | {relayer,pid()} |
-%% {relayer,CollectingNode} | {ip,IPPortParameters} |
-%% {file,FilePortParameters}
-%% TiTD = {file,FileName} | {file,FileName,TiMFA}
-%% TiMFA = {Module,Function,ArgumentList} initiating a private loopdata
-%% inside the meta-tracer.
-%% TracerList = [{Node,TracerData}],
-%% IPPortParameters = Portno | {Portno, Qsiz}
-%% Qsiz =
-%% FilePortParameters = {Filename, wrap, Tail, {time, WrapTime}, WrapCnt} |
-%% {FileName, wrap, Tail, WrapSize, WrapCnt} |
-%% {FileName, wrap, Tail, WrapSize} |
-%% {FileName, wrap, Tail} | FileName
-%% Tail =/= ""
-%% HandlerFun is a function taking 2 arguments.
-%% Nodes = [node()],
-%% CollectingNode = pid() | node(),
-%% NodeResult = {ok,LogResults} | {error, NReason}
-%% LogResults=[LogResult,...]
-%% LogResult={trace_log,LogRes} | {ti_log,LogRes}
-%% LogRes=ok|{error,Reason}
-%%
-%% Starts tracing on the nodes specified. If just providing a TracerData tracing
-%% will be initiated on all our nodes. If it is the non distributed case, that
-%% means only on the local non distributed node.
-%%
-%% {HandlerFun,Data}
-%% Will use the runtime components own process as tracer and handle all
-%% incomming trace message using HandlerFun.
-%% {relayer,CollectingNode}
-%% The runtime component addressed will act tracer and relay all incomming trace
-%% messages to Node or Pid, if CollectingNode is not a traced node connected
-%% to the controll component, the init_tracing call will return an error.
-%% Note that {relayer, Node} only is syntactical sugar for
-%% {relayer, rpc:call(Node,erlang,whereis,[inviso_rt])}
-%% collector
-%% The runtime component is used as tracer or collector of relayed
-%% trace messages using the default handler writing them to io.
-%% ip | file - will open a trace-port on Node using PortParameters
-init_tracing(TracerDataList) ->
- gen_server:call(?CONTROLLER,{init_tracing,TracerDataList},?CALL_TIMEOUT).
-
-init_tracing(Nodes,TracerData) when is_list(Nodes) ->
- gen_server:call(?CONTROLLER,{init_tracing,Nodes,TracerData},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% stop_tracing(Nodes)={ok,NodeResults}|{error,Reason}
-%% stop_tracing()={ok,NodeResults}|NodeResult
-%% Nodes=[Node,...],
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult={ok,State}|{error,Reason}
-%% State=new|idle
-%% Stops tracing on all or specified Nodes. Flushes trace buffert,
-%% closes trace port and removes all trace flags and meta-patterns.
-%% The nodes are called in parallel.
-stop_tracing() ->
- gen_server:call(?CONTROLLER,{stop_tracing,all},?CALL_TIMEOUT).
-
-stop_tracing(Nodes) when is_list(Nodes) ->
- gen_server:call(?CONTROLLER,{stop_tracing,Nodes},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% clear()={ok,NodeResults}|NodeResult
-%% clear(Nodes,Options)={ok,NodeResults}|{error,Reason}
-%% clear(Options)={ok,NodeResults}|NodeResult|{error,Reason}
-%% Nodes=[Node,...],
-%% Options=[Option,...],
-%% Option=keep_trace_patterns|keep_log_files
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult={ok,{new,Status}}|{error,Reason}
-%% Status=running|{suspended,SReason}
-%%
-%% Stops all tracing including removing meta-trace patterns. If the node is tracing
-%% or idle, logs belonging to the current tracerdata are removed. Hence the node
-%% is returned to state 'new'. Note that node can still be suspended.
-clear() ->
- gen_server:call(?CONTROLLER,{clear,all,[]},?CALL_TIMEOUT).
-
-clear(Nodes) when is_list(Nodes) ->
- gen_server:call(?CONTROLLER,{clear,Nodes,[]},?CALL_TIMEOUT).
-
-clear(Nodes,Options) when is_list(Nodes),is_list(Options) ->
- gen_server:call(?CONTROLLER,{clear,Nodes,Options},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% flush()={ok,NodeResults} | NodeResult
-%% flush(Nodes)={ok,NodeResults}
-%% Nodes=[Node,...]
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult=ok | {error,Reason}
-%% Sends a flush request to the trace-port driver on the nodes in Nodes.
-%% There will be an error for nodes that are not tracing. It is not an error to
-%% try to flush runtime components not using a trace-port.
-flush() ->
- gen_server:call(?CONTROLLER,{flush,all},?CALL_TIMEOUT).
-flush(Nodes) when is_list(Nodes) ->
- gen_server:call(?CONTROLLER,{flush,Nodes},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% stop()=shutdown
-%%
-%% Stops the controll component. Runtime components are left as is. They will
-%% behave according to their dependency values.
-stop() ->
- case catch gen_server:call(?CONTROLLER,stop,?CALL_TIMEOUT) of
- shutdown ->
- shutdown;
- {'EXIT',{noproc,_}} ->
- shutdown;
- {'EXIT',Reason} ->
- exit(Reason)
- end.
-%% -----------------------------------------------------------------------------
-
-%% stop_nodes()={ok,NodeResults}|NodeResult
-%% stop_nodes(Nodes)={ok,NodeResults}|{error,Reason}
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult=ok|{error,Reason}
-%%
-%% Stops runtime component on Nodes. stop_nodes/0 will if the control component
-%% is running on a distributed node stop all runtime components. And if running
-%% on a non distributed node, stop the local and only runtime component.
-stop_nodes() ->
- gen_server:call(?CONTROLLER,{stop_nodes,all},?CALL_TIMEOUT).
-stop_nodes(Nodes) when is_list(Nodes) ->
- gen_server:call(?CONTROLLER,{stop_nodes,Nodes},?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% stop_all()={ok,NodeResults}|NodeResult
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult=ok|{error,Reason}
-%%
-%% A combination of stop/0 and stop_nodes/0.
-stop_all() ->
- gen_server:call(?CONTROLLER, stop_all,?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% tp(Nodes,Module,Function,Arity,MatchSpec,Opts)={ok,NodeResults}|{error,Reason}
-%% tp(Nodes,Module,Function,Arity,MatchSpec)={ok,NodeResults}|{error,Reason}
-%% tp(Module,Function,Arity,MatchSpec)={ok,NodeResults}|NodeResult|{error,Reason}
-%% tp(Nodes,PatternList)={ok,NodeResults}|{error,Reason}
-%% tp(PatternList)={ok,NodeResults}|NodeResult|{error,Reason}
-%% Nodes=[Node,...]
-%% Module,Function=atom() | '_'
-%% Arity=integer() | '_'
-%% MatchSpec=true|false|[]| matchspec()
-%% PatternList=[Pattern,...],
-%% Pattern={Module,Function,Arity,MatchSpec,Opts},
-%% Opts=[Opt,...]
-%% Opt='only_loaded'; means that the runtime component shall not try to load
-%% a module should it not already be present in the runtime system.
-%% NodeResults=[NodeResult,...]
-%% NodeResult={ok,[Ans]}|{error,Reason},
-%% Ans=integer()|{error,Reason}
-%%
-%% Set trace pattern (global) on specified or all Nodes. The integer replied
-%% if the call was successfully describes the matched number of functions.
-%% The functions without a Nodes argument means all nodes, in a non-distributed
-%% environment it means the local node.
-%% When calling several nodes, the nodes are called in parallel.
-tp(Nodes,Module,Function,Arity,MatchSpec,Opts) ->
- trace_pattern(Nodes,[{Module,Function,Arity,MatchSpec,Opts}],[global]).
-
-tp(Nodes,Module,Function,Arity,MatchSpec) when is_list(Nodes) ->
- trace_pattern(Nodes,[{Module,Function,Arity,MatchSpec,[]}],[global]);
-tp(Module,Function,Arity,MatchSpec,Opts) when is_atom(Module) ->
- trace_pattern(all,[{Module,Function,Arity,MatchSpec,Opts}],[global]).
-
-tp(Module,Function,Arity,MatchSpec) ->
- trace_pattern(all,[{Module,Function,Arity,MatchSpec,[]}],[global]).
-
-tp(Nodes,PatternList) ->
- trace_pattern(Nodes,PatternList,[global]).
-
-tp(PatternList) ->
- trace_pattern(all,PatternList,[global]).
-%% -----------------------------------------------------------------------------
-
-%% tpl(Nodes,Module,Function,Arity,MatchSpec)={ok,NodeResults}|{error,Reason}
-%% tpl(Module,Function,Arity,MatchSpec)={ok,NodeResults}|NodeResult|{error,Reason}
-%% tpl(Nodes,PatternList)={ok,NodeResults}|{error,Reason}
-%% tpl(PatternList)={ok,NodeResults}|NodeResult|{error,Reason}
-%% see tp/X for description.
-%%
-%% Set trace pattern (local) on specified or all Nodes. The integer replied
-%% if the command was successfully describes the matched number of functions.
-%% The functions without a Nodes argument means all nodes, in a non-distributed
-%% environment it means the local node.
-%% When calling several nodes, the nodes are called in parallel.
-tpl(Nodes,Module,Function,Arity,MatchSpec,Opts) ->
- trace_pattern(Nodes,[{Module,Function,Arity,MatchSpec,Opts}],[local]).
-
-tpl(Nodes,Module,Function,Arity,MatchSpec) when is_list(Nodes) ->
- trace_pattern(Nodes,[{Module,Function,Arity,MatchSpec,[]}],[local]);
-tpl(Module,Function,Arity,MatchSpec,Opts) when is_atom(Module) ->
- trace_pattern(all,[{Module,Function,Arity,MatchSpec,Opts}],[local]).
-
-tpl(Module,Function,Arity,MatchSpec) ->
- trace_pattern(all,[{Module,Function,Arity,MatchSpec,[]}],[local]).
-
-tpl(Nodes, PatternList) ->
- trace_pattern(Nodes,PatternList,[local]).
-
-tpl(PatternList) ->
- trace_pattern(all,PatternList,[local]).
-%% -----------------------------------------------------------------------------
-
-%% ctp(Nodes,Module,Function,Arity)={ok,NodeResults}|{error,Reason}
-%% ctp(Module,Function,Arity)={ok,NodeResults}|NodeResult|{error,Reason}
-%% ctp(Nodes,PatternList)={ok,NodeResults}|{error,Reason}
-%% ctp(PatternList)={ok,NodeResults}|NodeResult|{error,Reason}
-%% PatternList=[{Mod,Func,Arity},...]
-%% see tp/X for other argument descriptions.
-%%
-%% Clear trace pattern (global) on specified or all Nodes. The integer replied
-%% if the call was successfully describes the matched number of functions.
-%% The functions without a Nodes argument means all nodes, in a non-distributed
-%% environment it means the local node.
-%% When calling several nodes, the nodes are called in parallel.
-ctp(Nodes,Module,Function,Arity) ->
- trace_pattern(Nodes,[{Module,Function,Arity,false,[only_loaded]}],[global]).
-
-ctp(Module,Function,Arity) ->
- trace_pattern(all,[{Module,Function,Arity,false,[only_loaded]}],[global]).
-
-ctp(Nodes,PatternList) when is_list(PatternList) ->
- trace_pattern(Nodes,
- lists:map(fun({M,F,A})->{M,F,A,false,[only_loaded]} end,PatternList),
- [global]).
-
-ctp(PatternList) when is_list(PatternList) ->
- trace_pattern(all,
- lists:map(fun({M,F,A})->{M,F,A,false,[only_loaded]} end,PatternList),
- [global]).
-%% -----------------------------------------------------------------------------
-
-%% ctpl(Nodes,Module,Function,Arity)={ok,NodeResults}|{error,Reason}
-%% ctpl(Module,Function,Arity)={ok,NodeResults}|NodeResult|{error,Reason}
-%% ctpl(Nodes,PatternList)={ok,NodeResults}|{error,Reason}
-%% ctpl(PatternList)={ok,NodeResults}|NodeResult|{error,Reason}
-%% see ctp/X for argument description.
-%%
-%% Clear trace pattern (local) on specified or all Nodes. The integer replied
-%% if the call was successfully describes the matched number of functions.
-%% The functions without a Nodes argument means all nodes, in a non-distributed
-%% environment it means the local node.
-%% When calling several nodes, the nodes are called in parallel.
-ctpl(Nodes,Module,Function,Arity) ->
- trace_pattern(Nodes,[{Module,Function,Arity,false,[only_loaded]}],[local]).
-
-ctpl(Module,Function,Arity) ->
- trace_pattern(all,[{Module,Function,Arity,false,[only_loaded]}],[local]).
-
-ctpl(Nodes,PatternList) when is_list(PatternList) ->
- trace_pattern(Nodes,
- lists:map(fun({M,F,A})->{M,F,A,false,[only_loaded]} end,PatternList),
- [local]).
-
-ctpl(PatternList) when is_list(PatternList) ->
- trace_pattern(all,
- lists:map(fun({M,F,A})->{M,F,A,false,[only_loaded]} end,PatternList),
- [local]).
-%% -----------------------------------------------------------------------------
-
-%% Help function doing the control component calling for all tp/X, tpl/X, ctp/X
-%% and ctpl/X functions.
-trace_pattern(Nodes,Patterns,FlagList) ->
- gen_server:call(?CONTROLLER, {trace_pattern, Nodes, Patterns, FlagList},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-%% -----------------------------------------------------------------------------
-
-%% tf(Nodes,PidSpec,FlagList)={ok,NodeResults}|{error,Reason}
-%% tf(PidSpec,FlagList)={ok,NodeResults}|NodeResult|{error,Reason}
-%% tf(Nodes,TraceConfList)={ok,NodeResults}|{error,Reason}
-%% tf(NodeTraceConfList)={ok,NodeResults}|{error,Reason}
-%% tf(TraceConfList)={ok,NodeResults}|NodeResult|{error,Reason}
-%% Nodes=[Node,...],
-%% NodeTraceConfList=[{Node,TraceConfList}]
-%% TraceConfList=[{PidSpec,FlagList},...],
-%% FlagList=[Flags],
-%% PidSpec=all|new|existing|pid()|locally_registered_name()
-%% Flags= all process trace flags allowed.
-%% NodeResult={ok,[Ans]}|{error,Reason},
-%% Ans=integer() | {error,Reason}
-%%
-%% Set process trace flags on processes on all or specified Nodes. The integer
-%% return if the call was successfully describes the matched number of processes.
-%% The functions without a Nodes argument means all nodes, in a non-distributed
-%% environment it means the local node.
-%% There are many combinations which does not make musch scense. For instance
-%% specifying a certain pid at all nodes. Or an empty TraceConfList for all
-%% nodes.
-%% When calling several nodes, the nodes are called in parallel.
-tf(Nodes,PidSpec,FlagList) when is_list(Nodes),is_list(FlagList) ->
- trace_flags(Nodes,[{PidSpec, FlagList}],true).
-
-tf(Nodes,TraceConfList) when is_list(Nodes),is_list(TraceConfList) ->
- trace_flags(Nodes,TraceConfList,true);
-tf(PidSpec,FlagList) when is_list(FlagList) ->
- trace_flags(all,[{PidSpec,FlagList}],true).
-
-tf(ArgList) when is_list(ArgList) -> % This one has triple functionality!
- case ArgList of
- [{_Process,Flags}|_] when is_list(Flags),is_atom(hd(Flags))-> % A call to all nodes.
- trace_flags(all,ArgList,true);
- [{_Node,TraceConfList}|_] when is_list(TraceConfList),is_tuple(hd(TraceConfList)) ->
- trace_flags(ArgList,true);
- [{_Node,_TraceConfList,_How}|_] ->
- trace_flags(ArgList);
- [] -> % Stupid but allowed.
- trace_flags(all,ArgList,true) % Actually doesn't matter which we choose.
- end.
-%% -----------------------------------------------------------------------------
-
-%% ctf(Nodes,PidSpec,FlagList)={ok,NodeResults}|{error,Reason}
-%% ctf(PidSpec,FlagList)={ok,NodeResults}|NodeResult|{error,Reason}
-%% ctf(Nodes,TraceConfList)={ok,NodeResults}|{error,Reason}
-%% ctf(TraceConfList)={ok,NodeResults}|NodeResult|{error,Reason}
-%% see tf/X for arguments.
-%%
-%% Clear process trace flags on all or specified Nodes. The integer replied
-%% if the command was successfully describes the matched number of processes.
-%% The functions without a Nodes argument means all nodes, in a non-distributed
-%% environment it means the local node.
-%% When calling several nodes, the nodes are called in parallel.
-ctf(Nodes,PidSpec,FlagList) when is_list(Nodes),is_list(FlagList) ->
- trace_flags(Nodes,[{PidSpec,FlagList}],false).
-
-ctf(Nodes,TraceConfList) when is_list(Nodes),is_list(TraceConfList) ->
- trace_flags(Nodes,TraceConfList,false);
-ctf(PidSpec,FlagList) when is_list(FlagList) ->
- trace_flags(all,[{PidSpec,FlagList}],false).
-
-ctf(TraceConfList) when is_list(TraceConfList) ->
- trace_flags(all,TraceConfList,false).
-%% -----------------------------------------------------------------------------
-
-%% ctf_all(Nodes)={ok,NodeResults}|{error,Reason}
-%% ctf_all()={ok,NodeResults}|NodeResult|{error,Reason}
-%% Nodes=[Node,...],
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult=ok|{error,Reason},
-%%
-%% Clears all trace flags on all or specified nodes. Just for convenience.
-ctf_all() ->
- gen_server:call(?CONTROLLER,{trace_flags,all,[{all,[all]}],false},?CALL_TIMEOUT).
-
-ctf_all(Nodes) ->
- gen_server:call(?CONTROLLER,{trace_flags,Nodes,[{all,[all]}],false},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% Help function to tf/X and ctf/X making the call to the control component.
-trace_flags(Nodes, TraceConfList, How) ->
- gen_server:call(?CONTROLLER, {trace_flags, Nodes, TraceConfList, How},?CALL_TIMEOUT).
-
-trace_flags(NodeTraceConfList,How) ->
- gen_server:call(?CONTROLLER,{trace_flags,NodeTraceConfList,How},?CALL_TIMEOUT).
-
-trace_flags(NodeTraceConfListHow) ->
- gen_server:call(?CONTROLLER,{trace_flags,NodeTraceConfListHow},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-%% -----------------------------------------------------------------------------
-
-%% tpm_localnames()={ok,NodeResults}|NodeResult|{error,Reason}
-%% tpm_localnames(Nodes)={ok,NodeResults}|{error,Reason}
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult={ok,N}|{error,Reason}, Note that N can only be 0 or 1.
-%%
-%% Quick version for setting meta-trace patterns on erlang:register/2. It uses
-%% a default CallFunc and ReturnFunc in the meta-tracer server.
-%% The main purpose of this function is to create ti-log entries for printing
-%% the aliases for process instead of their process identities.
-tpm_localnames() ->
- tpm_localnames(all).
-
-tpm_localnames(Nodes) ->
- gen_server:call(?CONTROLLER,{meta_pattern,Nodes,{local_register,[]}},?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% tpm_globalnames()={ok,NodeResults}|NodeResult|{error,Reason}
-%% tpm_globalnames(Nodes)={ok,NodeResults}|{error,Reason}
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult={SubResult,SubResult}
-%% SubResult={ok,N}|{error,Reason}, Note that N can only be 0 or 1.
-%% As tpm_locanames/0,/1 but for registering names with global. Note that this
-%% actually involves setting meta trace patterns on two functions in global.
-tpm_globalnames() ->
- tpm_globalnames(all).
-
-tpm_globalnames(Nodes) ->
- gen_server:call(?CONTROLLER,{meta_pattern,Nodes,{global_register,[]}},?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% init_tpm(Mod,Func,Arity,CallFunc)={ok,NodeResults}|NodeResult|{error,Reason}
-%% init_tpm(Nodes,Mod,Func,Arity,CallFunc)={ok,NodeResults}|{error,Reason}
-%% init_tpm(Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc)=
-%% {ok,NodeResults}|NodeResult|{error,Reason}
-%% init_tpm(Nodes,Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc)=
-%% {ok,NodeResults}|{error,Reason}
-%%
-%% Mod,Func=Pointing out the function which shall be meta traced, atom().
-%% Arity=As above, integer().
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult=ok|{error,Reason}
-%%
-%% InitFunc,RemoveFunc={Module,Function}|fun(), functions being called when
-%% to initialize the public loopdata structure, and to reset it.
-%% InitFunc(Mod,Func,Arity,PublLD)->{ok,NewPublLD,Output}
-%% Supposed to initialize whatever needs to be done before
-%% handling any incoming meta-trace message for the Mod:Func/Arity.
-%% RemoveFunc(Mod,Func,Arity,PublLD)->{ok,NewPublLD}
-%% Called when meta tracing of Mod:Func/Arity is stopped. It is supposed
-%% to clear datastructures away from the PublLD.
-%% Initializes the public loopdata for this function. Note that we can not use wildcards
-%% here (even if it is perfectly legal in Erlang). It also sets the CallFunc and
-%% ReturnFunc for the meta traced function. The function is hence ready to be
-%% meta traced with either tpm/5 or tpm_ms/5.
-%% When calling several nodes, the nodes are called in parallel.
-init_tpm(Mod,Func,Arity,CallFunc) ->
- init_tpm(all,Mod,Func,Arity,CallFunc).
-
-init_tpm(Nodes,Mod,Func,Arity,CallFunc) ->
- gen_server:call(?CONTROLLER,
- {meta_pattern,
- Nodes,
- {init_tpm,
- [Mod,Func,Arity,CallFunc]}},
- ?CALL_TIMEOUT).
-
-init_tpm(Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc) ->
- init_tpm(all,Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc).
-
-init_tpm(Nodes,Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc) ->
- gen_server:call(?CONTROLLER,
- {meta_pattern,
- Nodes,
- {init_tpm,
- [Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc]}},
- ?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% tpm(Mod,Func,Arity,MS)={ok,NodeResults}|NodeResult|{error,Reason}
-%% tpm(Nodes,Mod,Func,Arity,MS)={ok,NodeResults}|{error,Reason}
-%% tpm(Mod,Func,Arity,MS,CallFunc)={ok,NodeResults}|NodeResults|{error,Reason}
-%% tpm(Nodes,Mod,Func,Arity,MS,CallFunc)={ok,NodeResults}|{error,Reason}
-%% tpm(Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc)=
-%% {ok,NodeResults}|NodeResults|{error,Reason}
-%% tpm(Nodes,Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc)=
-%% {ok,NodeResults}|{error,Reason}
-%%
-%% Mod,Func=atom() and not '_'.
-%% Arity=integer()
-%% MS=list(), matchspecification.
-%% Nodes=List of nodenames.
-%% InitFunc,CallFunc,ReturnFunc,RemoveFunc={Module,Function}|fun(),
-%% functions being called when these functions are called by the meta trace
-%% server at certain events.
-%% CallFunc(CallingPid,ActualArgList,PublLD)->{ok,NewPrivLD,Output}
-%% ReturnFunc(CallingPid,ReturnValue,PublLD)->{ok,NewPrivLD,Output}
-%% When a call respectively return_from trace message arrives for the meta
-%% traced function, the corresponding function is called.
-%% The ReturnFunc must handle the fact that a return_from message arrives
-%% for a call which was never noticed. This because the message queue of the
-%% meta tracer may have been emptied.
-%%
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult={ok,N}|{error,Reason}, Note that N can only be 0 or 1.
-%%
-%% Activates meta-tracing in the inviso_rt_meta tracer. Except when using tpm/6,/8
-%% and /9 the function must first have been initiated using init_tpm. If running
-%% a non distributed system the variants without Node shall be used. If running
-%% in a distributed environment, without Node means all our nodes.
-%% When calling several nodes, the nodes are called in parallel.
-tpm(Mod,Func,Arity,MS) ->
- tpm(all,Mod,Func,Arity,MS).
-
-tpm(Nodes,Mod,Func,Arity,MS) when is_integer(Arity) ->
- gen_server:call(?CONTROLLER,
- {meta_pattern,Nodes,{tpm,[Mod,Func,Arity,MS]}});
-tpm(Mod,Func,Arity,MS,CallFunc) when is_integer(Arity) ->
- tpm(all,Mod,Func,Arity,MS,CallFunc).
-
-tpm(Nodes,Mod,Func,Arity,MS,CallFunc) ->
- gen_server:call(?CONTROLLER,
- {meta_pattern,Nodes,{tpm,[Mod,Func,Arity,MS,CallFunc]}}).
-
-tpm(Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc) ->
- tpm(all,Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc).
-
-tpm(Nodes,Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc) ->
- gen_server:call(?CONTROLLER,
- {meta_pattern,
- Nodes,
- {tpm,
- [Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc]}},
- ?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% Same as tpm/X but the meta tracer will append {tracer,Tracer} to any enable
-%% list in a trace body action term.
-tpm_tracer(Mod,Func,Arity,MS) ->
- tpm_tracer(all,Mod,Func,Arity,MS).
-
-tpm_tracer(Nodes,Mod,Func,Arity,MS) when is_integer(Arity) ->
- gen_server:call(?CONTROLLER,
- {meta_pattern,Nodes,{tpm_tracer,[Mod,Func,Arity,MS]}},
- ?CALL_TIMEOUT);
-tpm_tracer(Mod,Func,Arity,MS,CallFunc) when is_integer(Arity) ->
- tpm_tracer(all,Mod,Func,Arity,MS,CallFunc).
-
-tpm_tracer(Nodes,Mod,Func,Arity,MS,CallFunc) ->
- gen_server:call(?CONTROLLER,
- {meta_pattern,Nodes,{tpm_tracer,[Mod,Func,Arity,MS,CallFunc]}}).
-
-tpm_tracer(Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc) ->
- tpm_tracer(all,Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc).
-
-tpm_tracer(Nodes,Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc) ->
- gen_server:call(?CONTROLLER,
- {meta_pattern,
- Nodes,
- {tpm_tracer,
- [Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc]}},
- ?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% tpm_ms(Mod,Func,Arity,MSname,MS)={ok,NodeResults}|NodeResult|{error,Reason}
-%% tpm_ms(Nodes,Mod,Func,Arity,MSname,MS)={ok,NodeResults}|{error,Reason}
-%% Nodes= List of all nodes where the function shall be carried out.
-%% Mod,Func=Pointing out the function to which we shall add a match-spec., atom().
-%% Arity=As above, integer().
-%% MSname=A name to be used if this MS shall be removed later. term().
-%% MatchSpec=List of match specification, Remember {return_trace}
-%% if expecting return_from messages.
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult={ok,1}|{ok,0}|{error,Reason} where {ok,1} indicates that
-%% setting the matchspecification for the function succeeded.
-%%
-%% This function adds a list of match-specs to the already existing ones. It
-%% uses an internal database to keep track of existing match-specs. If the
-%% match-spec does not result in any meta traced functions (for whatever reason),
-%% the MS is not saved in the database. The previously known match-specs are
-%% not removed.
-%% The function must previously have been initiated in order for this function
-%% to add a match-spec.
-%% When calling several nodes, the nodes are called in parallel.
-tpm_ms(Mod,Func,Arity,MSname,MS) ->
- tpm_ms(all,Mod,Func,Arity,MSname,MS).
-
-tpm_ms(Nodes,Mod,Func,Arity,MSname,MS) ->
- gen_server:call(?CONTROLLER,
- {meta_pattern,Nodes,{tpm_ms,[Mod,Func,Arity,MSname,MS]}},
- ?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% Same as tpm_ms/5, /6 but the meta tracer will append {tracer,Tracer} to any enable
-%% list in a trace body action term.
-tpm_ms_tracer(Mod,Func,Arity,MSname,MS) ->
- tpm_ms_tracer(all,Mod,Func,Arity,MSname,MS).
-
-tpm_ms_tracer(Nodes,Mod,Func,Arity,MSname,MS) ->
- gen_server:call(?CONTROLLER,
- {meta_pattern,Nodes,{tpm_ms_tracer,[Mod,Func,Arity,MSname,MS]}},
- ?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% ctpm_ms(Mod,Func,Arity,MSname)={ok,NodeResults}|NodeResult|{error,Reason}
-%% ctpm_ms(Nodes,Mod,Func,Arity,MSname)={ok,NodeResults}|{error,Reason}
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult=ok|{error,Reason}
-%%
-%% Removes a named match-spec from the meta traced function. Note that it never
-%% is a fault to remove an MS. Not even from a function which is non existant.
-%% When calling several nodes, the nodes are called in parallel.
-ctpm_ms(Mod,Func,Arity,MSname) ->
- ctpm_ms(all,Mod,Func,Arity,MSname).
-
-ctpm_ms(Nodes,Mod,Func,Arity,MSname) ->
- gen_server:call(?CONTROLLER,
- {meta_pattern,Nodes,{ctpm_ms,[Mod,Func,Arity,MSname]}},
- ?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% ctpm(Mod,Func,Arity)={ok,NodeResults}|NodeResult|{error,Reason}
-%% ctpm(Node,Mod,Func,Arity)={ok,NodeResults}|{error,Reason}
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult=ok|{error,Reason}
-%%
-%% Removes the meta trace pattern for the function, means stops generating output
-%% for this function. The public LD may be cleared by the previously entered
-%% RemoveFunc.
-%% When calling several nodes, the nodes are called in parallel.
-ctpm(Mod,Func,Arity) ->
- ctpm(all,Mod,Func,Arity).
-
-ctpm(Nodes,Mod,Func,Arity) ->
- gen_server:call(?CONTROLLER,
- {meta_pattern,Nodes,{ctpm,[Mod,Func,Arity]}},
- ?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% ctpm_localnames()={ok,NodeResults}|NodeResult|{error,Reason}
-%% ctpm_localnames(Nodes)={ok,NodeResults}|{error,Reason}
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult=ok|{error,Reason}
-%%
-%% Removes meta-trace pattern for erlang:register/2, previously set by tpm_localnames.
-%% When calling several nodes, the nodes are called in parallel.
-ctpm_localnames() ->
- ctpm_localnames(all).
-
-ctpm_localnames(Nodes) ->
- gen_server:call(?CONTROLLER,{meta_pattern,Nodes,{remove_local_register,[]}},?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% ctpm_localnames()={ok,NodeResults}|NodeResult|{error,Reason}
-%% ctpm_localnames(Nodes)={ok,NodeResults}|{error,Reason}
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult={SubResult,Subresult}
-%% SubResult=ok|{error,Reason}
-%%
-%% Removes meta-trace pattern for the register functions in global. Note that there
-%% are two of them.
-%% When calling several nodes, the nodes are called in parallel.
-ctpm_globalnames() ->
- ctpm_globalnames(all).
-
-ctpm_globalnames(Nodes) ->
- gen_server:call(?CONTROLLER,{meta_pattern,Nodes,{remove_global_register,[]}},?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% ctp_all(Nodes)={ok,NodeResults}|{error,Reason}
-%% ctp_all()={ok,NodeResults}|NodeResult|{error,Reason}
-%% Nodes=[Node,...],
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult=ok|{error,Reason},
-%%
-%% Clears all both global and local trace patterns on all or specified nodes.
-%% Does not effect meta patterns.
-ctp_all() ->
- gen_server:call(?CONTROLLER,{ctp_all,all},?CALL_TIMEOUT).
-
-ctp_all(Nodes) ->
- gen_server:call(?CONTROLLER,{ctp_all,Nodes},?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% suspend(Nodes,Reason)={ok,NodeResults}|{error,Reason}
-%% suspend(Reason)={ok,NodeResults}|NodeResult|{error,Reason}
-%% Nodes=[Node],
-%% Reason=term(); supposed to describe the reason why suspended.
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult=ok|{error,Reason},
-%%
-%% Suspend all or specified Nodes with reason Reason. Suspend means that all
-%% process trace flags are removed and all meta-patterns.
-suspend(Nodes, Reason) ->
- gen_server:call(?CONTROLLER,{suspend,Reason,Nodes},?CALL_TIMEOUT).
-
-suspend(Reason) ->
- gen_server:call(?CONTROLLER,{suspend,Reason,all},?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% cancel_suspension(Nodes)={ok,NodeResults}|{error,Reason}
-%% cancel_suspension()={ok,NodeResults}|NodeResult|{error,Reason}
-%% Nodes=[Node,...],
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult=ok|{error,Reason},
-%% Cancel suspension on all or specified Nodes. Note that this does not imply
-%% that "business" is resumed as before. You must reactivate flags and meta-patter
-%% your self.
-cancel_suspension(Nodes) ->
- gen_server:call(?CONTROLLER,{cancel_suspension,Nodes},?CALL_TIMEOUT).
-
-cancel_suspension() ->
- gen_server:call(?CONTROLLER,{cancel_suspension,all},?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% get_status(Nodes)={ok,NodeResults}|{error,Reason}
-%% get_status()={ok,NodeResults}|NodeResult|{error,Reason}
-%% Nodes=[Node,...],
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult={ok,{State,Status}}|{error,Reason},
-%% State=new|idle|tracing
-%% Status=running|{suspended,SReason}
-%%
-%% Get Status form all or specified runtime components.
-get_status(Nodes) when is_list(Nodes) ->
- gen_server:call(?CONTROLLER,{get_status,Nodes},?CALL_TIMEOUT).
-
-get_status() ->
- gen_server:call(?CONTROLLER,{get_status,all},?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% get_tracerdata()={ok,NodeResults}|NodeResult|{error,Reason}
-%% get_tracerdata(Nodes)={ok,NodeResults}|{error,Reason}
-%% Nodes=[Node,...],
-%% NodeResult={ok,NResult}|{error,Reason},
-%% NResult=TracerData|no_tracerdata
-%% TracerData will be exactly as it was specified when doing init_tracing.
-%%
-%% Get TracerData form all or specified runtime components.
-get_tracerdata() ->
- gen_server:call(?CONTROLLER,{get_tracerdata,all},?CALL_TIMEOUT).
-
-get_tracerdata(Nodes) when is_list(Nodes) ->
- gen_server:call(?CONTROLLER,{get_tracerdata,Nodes},?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% list_logs(TracerData)={ok,NodeResults}|NodeResult|{error,Reason}
-%% list_logs(NodeList)={ok,NodeResults}|{error,Reason}
-%% list_logs()={ok,NodeResults}|NodeResult|{error,Reason}
-%% TracerData see init_tracing/1/2
-%% NodeList=[NodeSpec,...]
-%% NodeSpec=Node|{Node,TracerData}
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult={ok,FileList}|{ok,no_log}|{error,Reason}
-%% FileList=[FileType,...], one or more of different types.
-%% FileType={trace_log,Dir,Files}|{ti_log,Dir,Files}
-%% Files=[FileNameWithOutPath,...]
-%%
-%% Ask local or specified runtime components for now existing logs given
-%% TracerData. If TracerData is left out, the runtime components TracerData,
-%% if existing, will be used instead.
-list_logs() ->
- gen_server:call(?CONTROLLER,list_logs,?CALL_TIMEOUT).
-
-list_logs(TracerDataOrNodesList) when is_list(TracerDataOrNodesList) ->
- gen_server:call(?CONTROLLER,{list_logs,TracerDataOrNodesList},?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-%% fetch_log(LogSpecList,DestDir,Prefix)={ok,NodeResults}|{error,not_distributed}|
-%% {error,Reason}
-%% fetch_log(DestDir,Prefix)={ok,NodeResults}|{error,not_distributed}|
-%% {error,Reason}
-%% fetch_log(ToNode,DestDir,Prefix)=
-%% fetch_log(ToNode,LogSpecList,DestDir,Prefix)=
-%% DestDir=string(), to where the fetched files shall be placed.
-%% Prefix=string(), prefix on locally saved fetched files.
-%% LogSpecList=[LogSpec,...],
-%% LogSpec={Node,FileSpecList}|Node|{Node,TracerData}
-%% TracerData=see init_tracing/1/2
-%% FileSpecList=[{trace_log,Dir,FileList},{ti_log,Dir,FileList}]
-%% where each tuple-item is optional.
-%% FileList=[RemoteFileName,...]
-%% ToNode=atom()
-%% NodeResult={Conclusion,ResultFileSpec}|no_log|{error,NReason}
-%% Conclusion=complete|incomplete
-%% ResultFileSpec=[{trace_log,FileResults},{ti_log,FileResults}]
-%% FileResults=[FileResult,...]
-%% FileResult={ok,FileName}|{error,FReason}
-%% NReason=own_node|Reason
-%% FReason = {file_open,{posix(),FileName}} |
-%% {file_open,{posix(),RemoteFileName}}
-%% {file_open,{posix(),[DestDir,Prefix,RemoteFileName]}}
-%% {file_write,{posix(),FileName}} |
-%% {truncated,FileName}
-%% {truncated,{Reason,FileName}}
-%% posix() - an atom which is named from the Posix error codes used in
-%% Unix, and in the runtime libraries of most C compilers.
-%% See module file in Kernel Reference manual.
-%%
-%% Copies logfiles over distributed erlang to ToNode. This
-%% function can only be used in a distributed system.
-%% The resulting transfered files will have the prefix Prefix and will be
-%% located in DestDir.
-%% Note that the client process using this function will wait until all files
-%% are moved. The job can be cancelled, causing any already copied files to be
-%% removed, by simply terminating the waiting client process.
-fetch_log(DestDir,Prefix) when is_list(DestDir),is_list(Prefix) ->
- gen_server:call(?CONTROLLER,{fetch_log,node(),all,DestDir,Prefix},infinity).
-
-fetch_log(ToNode,DestDir,Prefix) when is_atom(ToNode),is_list(DestDir),is_list(Prefix) ->
- gen_server:call(?CONTROLLER,{fetch_log,ToNode,all,DestDir,Prefix},infinity);
-
-fetch_log(LogSpecList,DestDir,Prefix) when is_list(LogSpecList),is_list(DestDir),is_list(Prefix) ->
- gen_server:call(?CONTROLLER,{fetch_log,node(),LogSpecList,DestDir,Prefix},infinity).
-
-fetch_log(ToNode,LogSpecList,DestDir,Prefix)
- when is_atom(ToNode),is_list(LogSpecList),is_list(DestDir),is_list(Prefix) ->
- gen_server:call(?CONTROLLER,{fetch_log,ToNode,LogSpecList,DestDir,Prefix},infinity).
-%% ------------------------------------------------------------------------------
-
-%% delete_log(Nodes,TracerData)={ok,NodeResults}|{error,Reason}
-%% delete_log(NodeSpecList)={ok,NodeResults}|{error,Reason}
-%% delete_log(Spec)={ok,NodeResults}|NodeResult|{error,Reason}
-%% delete_log(TracerData)={ok,NodeResults}|NodeResult|{error,Reason}
-%% delete_log()={ok,NodeResults}|NodeResult|{error,Reason}
-%% Nodes=[Node,...],
-%% NodeSpecList=[{Node,Spec},...]
-%% Spec=[AbsPathFileName,...]|LogSpecs
-%% LogSpecs=[LogSpec,...]
-%% LogSpec={trace_log,Dir,[FileNameWithoutPath,...]}|
-%% {ti_log,Dir,[FileNameWithoutPath,...]}
-%% TracerData = see init_tracing/1/2
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult={ok,no_log}|{ok,LogInfos}|{ok,FileInfos}
-%% LogInfos=[LogInfo,...]
-%% LogInfo={trace_log,FileInfos}|{ti_log,FileInfos}
-%% FileInfos=[FileInfo,...]
-%% FileInfo={ok,FileName}|{error,Reason} whether FileName contains
-%% full path or not depends on if AbsPathFileName or LogSpec was
-%% used when specifying the files.
-%%
-%% Deletes listed files or files corresponding to TracerData from specified
-%% or all Nodes. If no TracerData or list of files is specified in the call the
-%% TracerData at Node will be used to identify log files to delete.
-delete_log() ->
- gen_server:call(?CONTROLLER,{delete_log,all},?CALL_TIMEOUT).
-delete_log(What) ->
- gen_server:call(?CONTROLLER,{delete_log,What},?CALL_TIMEOUT).
-delete_log(Nodes,Spec) ->
- gen_server:call(?CONTROLLER,{delete_log,Nodes,Spec},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% subscribe()= same as subscribe(self())
-%% subscribe(Pid)=ok|{error,Reason}
-%% Pid=pid(),
-%% Reason =
-%% Add Pid or self() to event sending list. Note that it is possible to add a
-%% pid several times and that the Pid then will receive several event messages.
-%% All events will be sent to all subscribers in the event sending list.
-%% Event={inviso_event,ControllerPid,erlang:localtime(),Msg},
-%% Msg=
-%% {connected, Node, {Tag, {State, Status}}}
-%% {disconnected, Node, not_applicable}
-%% {state_change, Node, {State, Status}}
-%% {port_down, Node, Reason}
-%% Node = node() | local_runtime (when running in a non-distributed
-%% environment)
-subscribe() ->
- gen_server:call(?CONTROLLER,{subscribe,self()},?CALL_TIMEOUT).
-
-subscribe(Pid) ->
- gen_server:call(?CONTROLLER,{subscribe,Pid},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% unsubscribe()= same as unsubscribe(self())
-%% unsubscribe(Pid)=ok
-%% Pid=pid(),
-%%
-%% Remove, if present, first occurrence of Pid or self() from event sending
-%% list. Note that it is not an error to remove a non existing subscription.
-unsubscribe() ->
- gen_server:call(?CONTROLLER,{unsubscribe,self()},?CALL_TIMEOUT).
-
-unsubscribe(Pid) ->
- gen_server:call(?CONTROLLER,{unsubscribe,Pid},?CALL_TIMEOUT).
-%% ------------------------------------------------------------------------------
-
-
-
-%% debuging the controller
-%% ----------------------------------------------------------------------------
-state() ->
- ?CONTROLLER ! state.
-
-%% debuging the runtime component
-state(Node) ->
- ?CONTROLLER ! {state, Node}.
-
-%%% end of file
diff --git a/lib/inviso/src/inviso_c.erl b/lib/inviso/src/inviso_c.erl
deleted file mode 100644
index b1597a7f35..0000000000
--- a/lib/inviso/src/inviso_c.erl
+++ /dev/null
@@ -1,1335 +0,0 @@
-%% ``The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved via the world wide web at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
-%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
-%% AB. All Rights Reserved.''
-%%
-%% $Id$
-%%
-%% Author: Ann-Marie L�f, [email protected]
-%% Lennart �hman, [email protected]
-%%
-%% Description: The controlling part of the trace tool Inviso
-%%
-%% This code implements the inviso control component meant to be run on an Erlang
-%% node doing any tracing. It can also be used in a non distributed system where
-%% the control component and the runtime component will run on the same virtual
-%% machine.
-%% The control component is not meant to be started by a supervisor but rather
-%% directly by the user when needed.
-%% This module does not provide any APIs to users. Those are found in inviso.erl.
-%% This module merly has the gen_server call-backs.
-%% ------------------------------------------------------------------------------
-
--module(inviso_c).
--behavior(gen_server).
-
-
-%% ------------------------------------------------------------------------------
-%% gen_server callbacks.
-%% ------------------------------------------------------------------------------
--export([init/1,
- handle_call/3,handle_cast/2,handle_info/2,
- terminate/2,
- code_change/3]).
-%% ------------------------------------------------------------------------------
-
-%% ------------------------------------------------------------------------------
-%% Exported internal functions (used in spawn of help process).
-%% ------------------------------------------------------------------------------
--export([log_rec_init/4]).
-
-%% ------------------------------------------------------------------------------
-
-%% ------------------------------------------------------------------------------
-%% Records.
-%% ------------------------------------------------------------------------------
-
-%% #state
-%% Record used in the loopdata.
--record(state,{
- nodes=[], % [#node,...]
- distributed, % false | true
- subscribers=[], % [{pid(),monitor_ref()},...]
- rt_options=[{dependency,{infinity,node()}},{overload, default}]
- }).
-%% ------------------------------------------------------------------------------
-
-%% #node
-%% Record storing information about a runtime component connected to this control
-%% component.
--record(node,{
- node, % [atom(),...]
- pid, % pid()
- vsn,
- ref, % monitor_ref()
- tag % term()
- }).
-%% ------------------------------------------------------------------------------
-
-%% ------------------------------------------------------------------------------
-%% Macros used in this module.
-%% ------------------------------------------------------------------------------
-
--define(RUNTIME,inviso_rt). % The module API name of the runtime.
-%% ------------------------------------------------------------------------------
-
-
-
-%% ==============================================================================
-%% Controller component implmentation.
-%% ==============================================================================
-
-init({_Parent,Options}) ->
- process_flag(trap_exit,true),
- case check_options(Options,start) of
- {ok,Options2} ->
- LoopData=initiate_state(Options2),
- {ok,LoopData};
- Error ->
- {stop,Error}
- end.
-%% ------------------------------------------------------------------------------
-
-handle_call({subscribe,Pid},_From,LD) when is_pid(Pid) ->
- MRef=erlang:monitor(process,Pid),
- {reply,ok,LD#state{subscribers=[{Pid,MRef}|LD#state.subscribers]}};
-handle_call({subscribe,Faulty},_From,LD) ->
- {reply,{error,{badarg,Faulty}},LD};
-handle_call({unsubscribe,Pid},_From,LD) ->
- case lists:keysearch(Pid,1,LD#state.subscribers) of
- {value,{_,MRef}} ->
- erlang:demonitor(MRef),
- {reply,ok,LD#state{subscribers=lists:keydelete(Pid,1,LD#state.subscribers)}};
- false ->
- {reply,ok,LD}
- end;
-handle_call({add_nodes,Nodes,Opts,Tag,Condition},_From,LD) ->
- case check_options(Opts,add_node) of
- {ok,Opts2} ->
- Opts3=merge_options(LD#state.rt_options,Opts2),
- {NewLD,Reply}=do_add_nodes(Nodes,LD,Opts3,Tag,Condition),
- {reply,adapt_reply(NewLD,Reply),NewLD};
- Error ->
- {reply,Error,LD}
- end;
-handle_call({change_options,Nodes,Opts},_From,LD) ->
- case check_options(Opts,add_node) of
- {ok,Opts2} ->
- {reply,adapt_reply(LD,do_change_option(Nodes,Opts2,LD)),LD};
- Error ->
- {reply,Error,LD}
- end;
-handle_call({init_tracing,TracerDataList},_From,LD) ->
- {reply,adapt_reply(LD,do_init_tracing(TracerDataList,LD)),LD};
-handle_call({init_tracing,Nodes,TracerData},_From,LD) when is_list(Nodes) ->
- TracerDataList=
- lists:map(fun(N)->{N,TracerData} end,started_trace_nodes(Nodes,LD)),
- {reply,adapt_reply(LD,do_init_tracing(TracerDataList,LD)),LD};
-handle_call({init_tracing,Nodes,_TracerData},_From,LD) ->
- {reply,{error,{badarg,Nodes}},LD};
-handle_call({trace_pattern,Nodes,Patterns,FlagList},_From,LD) ->
- {reply,adapt_reply(LD,distribute_tp(Nodes,Patterns,FlagList,LD)),LD};
-handle_call({trace_flags,Nodes,Args,How},_From,LD) ->
- {reply,adapt_reply(LD,distribute_tf(Nodes,Args,How,LD)),LD};
-handle_call({trace_flags,NodeArgs,How},_From,LD) ->
- {reply,distribute_tf(NodeArgs,How,LD),LD}; % Always distributed here.
-handle_call({trace_flags,NodeArgHows},_From,LD) ->
- {reply,distribute_tf(NodeArgHows,LD),LD}; % Always distributed here.
-handle_call({meta_pattern,Nodes,Args},_From,LD) ->
- {reply,adapt_reply(LD,distribute_metapattern(Nodes,Args,LD)),LD};
-handle_call({ctp_all,Nodes},_From,LD) ->
- {reply,adapt_reply(LD,do_ctp_all(Nodes,LD)),LD};
-handle_call({suspend,Reason,Nodes},_From,LD) ->
- {reply,adapt_reply(LD,do_suspend(Nodes,Reason,LD)),LD};
-handle_call({cancel_suspension,Nodes},_From,LD) ->
- {reply,adapt_reply(LD,do_cancel_suspension(Nodes,LD)),LD};
-handle_call({stop_tracing,Nodes},_From,LD) ->
- {reply,adapt_reply(LD,do_stop_tracing(Nodes,LD)),LD};
-handle_call({get_status,Nodes},_From,LD) ->
- {reply,adapt_reply(LD,do_get_status(Nodes,LD)),LD};
-handle_call({get_tracerdata,Nodes},_From,LD) ->
- {reply,adapt_reply(LD,do_get_tracerdata(Nodes,LD)),LD};
-handle_call(list_logs,_From,LD) ->
- {reply,adapt_reply(LD,do_list_logs(all,LD)),LD};
-handle_call({list_logs,TracerDataOrNodesList},_From,LD) ->
- {reply,adapt_reply(LD,do_list_logs(TracerDataOrNodesList,LD)),LD};
-handle_call({fetch_log,ToNode,Spec,Dest,Prefix},From,LD) ->
- case LD#state.distributed of
- true -> % It is a distributed system.
- do_fetch_log(ToNode,Spec,Dest,Prefix,From,LD),
- {noreply,LD}; % Reply will come from collector pid.
- false -> % Stupidity! you dont want this!
- {reply,{error,not_distributed},LD}
- end;
-handle_call({delete_log,NodesOrNodeSpecs},_From,LD) ->
- {reply,adapt_reply(LD,do_delete_log(NodesOrNodeSpecs,LD)),LD};
-handle_call({delete_log,Nodes,Specs},_From,LD) when is_list(Nodes) ->
- Reply=do_delete_log(lists:map(fun(N)->{N,Specs} end,Nodes),LD),
- {reply,adapt_reply(LD,Reply),LD};
-handle_call({delete_log,FaultyNodes,_Specs},_From,LD) ->
- {reply,{error,{badarg,FaultyNodes}},LD};
-handle_call({clear,Nodes,Options},_From,LD) ->
- {reply,adapt_reply(LD,do_clear(Nodes,LD,Options)),LD};
-handle_call({flush,Nodes},_From,LD) ->
- {reply,adapt_reply(LD,do_flush(Nodes,LD)),LD};
-handle_call({stop_nodes,Nodes},_From,LD) ->
- {NewLD,Reply}=do_stop_nodes(Nodes,LD),
- {reply,adapt_reply(NewLD,Reply),NewLD};
-handle_call(stop,_From,LD) ->
- {stop,normal,shutdown,LD};
-handle_call(stop_all,_From,LD) ->
- {NewLD,Reply}=do_stop_nodes(started_trace_nodes(all,LD),LD),
- {stop,normal,adapt_reply(NewLD,Reply),NewLD};
-handle_call(Request,_From,LD) -> %% for debug purpose only
- {reply,{error,{invalid_request,Request}},LD}.
-
-handle_cast(_Request,LD) -> % There are no casts.
- {noreply,LD}.
-
-handle_info({connect,_Node,Pid,_VSN,Tag},LD) -> % From connecting runtime.
- {noreply,do_confirm_connection(Pid,Tag,LD)};
-handle_info({trace_event,Event},LD) -> % A runtime component issues an event.
- send_to_subscribers(Event,LD), % Relay to our subscribers.
- {noreply,LD};
-handle_info({'DOWN',Ref,process,_From,Info},LD) -> % A runtime component died?
- {noreply,do_down_msg(Ref,Info,LD)};
-handle_info(state,LD) -> % For debug purposes.
- io:format("trace_c state: ~p~n",[LD]),
- {noreply,LD};
-handle_info(_Msg,LD) ->
- {noreply,LD}.
-
-terminate(_Reason, _LD) ->
- ok.
-
-code_change(_OldVsn, LoopData, _Extra) ->
- {ok, LoopData}.
-%% -----------------------------------------------------------------------------
-
-
-%% -----------------------------------------------------------------------------
-%% Handle call help functions.
-%% -----------------------------------------------------------------------------
-
-%% Help function which adapts a reply based on if this is a distributed system
-%% or not. The first argument indicates distribution (='true').
-%% If we are not running a distributed system, all node references are removed.
-adapt_reply(#state{distributed=Distributed},Reply) ->
- adapt_reply(Distributed,Reply);
-adapt_reply(true,Reply) -> % We are distributed.
- Reply;
-adapt_reply(false,{ok,[{_Node,LocalReply}]}) ->
- LocalReply;
-adapt_reply(false,{ok,[]}) ->
- {error,not_an_added_node}; % �R DET H�R VERKLIGEN RIKTIGT?
-adapt_reply(false,Reply) ->
- Reply.
-%% ------------------------------------------------------------------------------
-
-
-%% ==============================================================================
-%% First level help functions to handler functions.
-%% ==============================================================================
-
-%% Function starting a runtime component at the nodes in Nodes. If doing non
-%% distributed, Nodes will be a list of nonode@nohost.
-%% Returns {NewLD,{ok,Replies}} or {LD,{error,Reason}}.
-do_add_nodes(Nodes,LD,Options,Tag,Condition) ->
- do_add_nodes_2(Nodes,LD,Options,Tag,Condition,[]).
-
-do_add_nodes_2([Node|Tail],LD,Options,Tag,Condition,Replies) ->
- case find(fun is_started/2,LD#state.nodes,Node) of
- {value,true} -> % Already started by us.
- do_add_nodes_2(Tail,LD,Options,Tag,Condition,[{Node,{ok,already_added}}|Replies]);
- no_match ->
- case ?RUNTIME:start(Node,Options,Tag,Condition) of
- {node_info,_Node,Pid,VSN,State,Status,new} ->
- NewLD=do_add_nodes_3(Node,LD,Tag,Pid,VSN,State,Status),
- do_add_nodes_2(Tail,NewLD,Options,Tag,Condition,[{Node,{ok,new}}|Replies]);
- {node_info,_Node,Pid,VSN,State,Status,{tag,Tag2}} ->
- NewLD=do_add_nodes_3(Node,LD,Tag,Pid,VSN,State,Status),
- do_add_nodes_2(Tail,NewLD,Options,Tag,Condition,
- [{Node,{ok,{adopted,State,Status,Tag2}}}|Replies]);
- Error ->
- do_add_nodes_2(Tail,LD,Options,Tag,Condition,[{Node,Error}|Replies])
- end
- end;
-do_add_nodes_2([],LD,_,_,_,Replies) ->
- {LD,{ok,lists:reverse(Replies)}};
-do_add_nodes_2(Faulty,LD,_,_,_,_) -> % Not a list of nodes.
- {LD,{error,{badarg,Faulty}}}.
-
-do_add_nodes_3(Node,LD,Tag,Pid,VSN,State,Status) ->
- MRef=erlang:monitor(process,Pid),
- NodeRec=#node{node=Node,pid=Pid,vsn=VSN,ref=MRef,tag=Tag},
- send_to_subscribers({connected,Node,{Tag,{State,Status}}},LD),
- _NewLD=set_node_rec(NodeRec,LD).
-%% ------------------------------------------------------------------------------
-
-%% Function calling change_options sequensially on all nodes in Nodes.
-%% Returns {ok,Replies} or {error,Reason}.
-do_change_option(Nodes,Options,LD) ->
- do_change_option_2(started_trace_nodes(Nodes,LD#state.nodes),Options,LD,[]).
-
-do_change_option_2([Node|Tail],Options,LD,Replies) ->
- case get_node_rec(Node,LD) of
- Rec when is_record(Rec,node) ->
- Answer=?RUNTIME:change_options(Rec#node.pid,Options),
- do_change_option_2(Tail,Options,LD,[{Node,Answer}|Replies]);
- Error ->
- do_change_option_2(Tail,Options,LD,[{Node,Error}|Replies])
- end;
-do_change_option_2([],_Options,_LD,Replies) ->
- {ok,Replies};
-do_change_option_2(Faulty,_,_,_) ->
- {error,{badarg,Faulty}}.
-%% ------------------------------------------------------------------------------
-
-%% Function which calls the runtime components in TracerDataList and initiates
-%% the tracing. TracerDataList may either be just one tracer data which shall be
-%% applied to all runtime components, or a list of nodes and tracerdata.
-do_init_tracing(TracerDataList,LD) ->
- case inviso_rt_lib:is_tracerdata(TracerDataList) of
- true -> % Then we must add all our nodes.
- List=lists:map(fun(N)->{N,TracerDataList} end,started_trace_nodes(all,LD)),
- do_init_tracing_2(List,LD,[]);
- false -> % Assume it is a list of {Node,Tracerdata}
- do_init_tracing_2(TracerDataList,LD,[])
- end.
-
-do_init_tracing_2([{Node,TracerData}|Tail],LD,Replies) ->
- case get_node_rec(Node,LD) of
- Rec when is_record(Rec,node) ->
- case check_modify_tracerdata(TracerData,LD) of
- {ok,NewTracerData} -> % Tracerdata ok and node->pid.
- Reply=?RUNTIME:init_tracing(Rec#node.pid,NewTracerData),
- do_init_tracing_2(Tail,LD,[{Node,Reply}|Replies]);
- {error,Reason} -> % Unknown tracerdata.
- do_init_tracing_2(Tail,LD,[{Node,{error,Reason}}|Replies])
- end;
- {error,Reason} ->
- do_init_tracing_2(Tail,LD,[{Node,{error,Reason}}|Replies])
- end;
-do_init_tracing_2([_|Tail],LD,Replies) -> % Just ignore item we don't understand.
- do_init_tracing_2(Tail,LD,Replies); % Will not end up in Replies either.
-do_init_tracing_2([],_LD,Replies) ->
- {ok,lists:reverse(Replies)};
-do_init_tracing_2(What,_LD,_) ->
- {error,{badarg,What}}.
-%% -----------------------------------------------------------------------------
-
-%% Function setting trace patterns on all nodes mentioned in Nodes. Uses a
-%% parallel mechanism in the runtime component.
-%% Returns {ok,Reply} or {error,Reason}.
-distribute_tp(all,Patterns,FlagList,LD) ->
- distribute_tp(started_trace_nodes(all,LD),Patterns,FlagList,LD);
-distribute_tp(Nodes,Patterns,FlagList,LD) when is_list(Nodes) ->
- RTpids=lists:map(fun(N)->case get_node_rec(N,LD) of
- #node{pid=Pid} ->
- {Pid,N};
- Error ->
- {Error,N}
- end
- end,
- Nodes),
- {ok,?RUNTIME:trace_patterns_parallel(RTpids,Patterns,FlagList)};
-distribute_tp(Faulty,_,_,_) ->
- {error,{badarg,Faulty}}.
-%% ------------------------------------------------------------------------------
-
-%% Function which in parallel sets trace flags on all nodes in Nodes. Can be
-%% either a list of node names or 'all'. Note that in the reply list there will be an
-%% error indicating nodes not reachable. Either because such a node disappeared or
-%% because it is not one of "our" nodes.
-%% Returns {ok,Reply} or {error,Reason}.
-distribute_tf(all,Args,How,LD) ->
- distribute_tf(started_trace_nodes(all,LD),Args,How,LD);
-distribute_tf(Nodes,Args,How,LD) when is_list(Nodes) ->
- RTpids=lists:map(fun(Node)->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- {Pid,Node};
- Error -> % Not an added node then!
- {Error,Node}
- end
- end,
- Nodes),
- {ok,?RUNTIME:trace_flags_parallel(RTpids,Args,How)};
-distribute_tf(Faulty,_,_,_) ->
- {error,{badarg,Faulty}}.
-
-%% As above but specific args for each node.
-distribute_tf(NodeArgs,How,LD) when is_list(NodeArgs) ->
- RTpidArgs=lists:map(fun({Node,Args})->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- {Pid,Node,Args};
- Error -> % Not an added node then!
- {Error,Node}
- end
- end,
- NodeArgs),
- {ok,?RUNTIME:trace_flags_parallel(RTpidArgs,How)};
-distribute_tf(Faulty,_,_) ->
- {error,{badarg,Faulty}}.
-
-%% As above but both specific args for each node and How (set or remove flag).
-distribute_tf(NodeArgHows,LD) when is_list(NodeArgHows) ->
- RTpidArgHows=
- lists:map(fun({Node,Args,How}) ->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- {Pid,Node,Args,How};
- Error -> % Not an added node then!
- {Error,Node}
- end
- end,
- NodeArgHows),
- {ok,?RUNTIME:trace_flags_parallel(RTpidArgHows)};
-distribute_tf(Faulty,_) ->
- {error,{badarg,Faulty}}.
-%% ------------------------------------------------------------------------------
-
-%% Function making a parallel call to all nodes in Nodes, calling the generic
-%% meta-tracer function stated in Args.
-%% Returns {ok,Reply} or {error,Reason}.
-distribute_metapattern(all,Args,LD) ->
- distribute_metapattern(started_trace_nodes(all,LD),Args,LD);
-distribute_metapattern(Nodes,Args,LD) when is_list(Nodes) ->
- RTpids=lists:map(fun(N)->case get_node_rec(N,LD) of
- #node{pid=Pid} ->
- {Pid,N};
- Error ->
- {Error,N}
- end
- end,
- Nodes),
- {ok,?RUNTIME:meta_tracer_call_parallel(RTpids,Args)};
-distribute_metapattern(Faulty,_,_) ->
- {error,{badarg,Faulty}}.
-%% ------------------------------------------------------------------------------
-
-%% Function clearing all trace patterns on all node mentioned in Nodes.
-%% Returns {ok,Reply} or {error,Reason}.
-do_ctp_all(Nodes,LD) ->
- do_ctp_all_2(started_trace_nodes(Nodes,LD),LD,[]).
-
-do_ctp_all_2([Node|Tail],LD,Replies) ->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- do_ctp_all_2(Tail,LD,[{Node,?RUNTIME:clear_all_tp(Pid)}|Replies]);
- Error ->
- do_ctp_all_2(Tail,LD,[{Node,Error}|Replies])
- end;
-do_ctp_all_2([],_LD,Replies) ->
- {ok,lists:reverse(Replies)};
-do_ctp_all_2(Faulty,_,_) ->
- {error,{badarg,Faulty}}.
-%% ------------------------------------------------------------------------------
-
-%% Function suspending all runtime components mentioned in Nodes.
-%% Returns {ok,Reply} or {error,Reason}.
-do_suspend(Nodes,Reason,LD) ->
- do_suspend_2(started_trace_nodes(Nodes,LD),Reason,LD,[]).
-
-do_suspend_2([Node|Tail],Reason,LD,Replies) ->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- Answer=?RUNTIME:call_suspend(Pid,Reason),
- do_suspend_2(Tail,Reason,LD,[{Node,Answer}|Replies]);
- Error ->
- do_suspend_2(Tail,Reason,LD,[{Node,Error}|Replies])
- end;
-do_suspend_2([],_Reason,_LD,Replies) ->
- {ok,lists:reverse(Replies)};
-do_suspend_2(Faulty,_,_,_) ->
- {error,{badarg,Faulty}}.
-%% ------------------------------------------------------------------------------
-
-%% Function cancelling a suspension at the runtime components mentioned in Nodes.
-%% Returns {ok,Reply} or {error,Reason}.
-do_cancel_suspension(Nodes,LD) ->
- do_cancel_suspension_2(started_trace_nodes(Nodes,LD),LD,[]).
-
-do_cancel_suspension_2([Node|Tail],LD,Replies) ->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- Answer=?RUNTIME:cancel_suspension(Pid),
- do_cancel_suspension_2(Tail,LD,[{Node,Answer}|Replies]);
- Error ->
- do_cancel_suspension_2(Tail,LD,[{Node,Error}|Replies])
- end;
-do_cancel_suspension_2([],_LD,Replies) ->
- {ok,lists:reverse(Replies)};
-do_cancel_suspension_2(Faulty,_,_) ->
- {error,{badarg,Faulty}}.
-%% ------------------------------------------------------------------------------
-
-%% Function which stops tracing on all nodes in Nodes. The function is performed
-%% in parallel over the nodes to get a more precise stop-time.
-%% Return {ok,Reply} or {error,Reason}.
-do_stop_tracing(all,LD) ->
- do_stop_tracing(started_trace_nodes(all,LD),LD);
-do_stop_tracing(Nodes,LD) when is_list(Nodes) ->
- RTpids=lists:map(fun(N)->case get_node_rec(N,LD) of
- #node{pid=Pid} ->
- {Pid,N};
- Error ->
- {Error,N}
- end
- end,
- Nodes),
- {ok,?RUNTIME:stop_tracing_parallel(RTpids)};
-do_stop_tracing(Faulty,_) ->
- {error,{badarg,Faulty}}.
-%% -----------------------------------------------------------------------------
-
-%% Function fetching the current status of the runtime components in Nodes.
-%% Returns {ok,Reply} or {error,Reason}.
-do_get_status(Nodes,LD) ->
- do_get_status_2(started_trace_nodes(Nodes,LD),LD,[]).
-
-do_get_status_2([Node|Tail],LD,Replies) ->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- do_get_status_2(Tail,LD,[{Node,?RUNTIME:get_status(Pid)}|Replies]);
- Error ->
- do_get_status_2(Tail,LD,[{Node,Error}|Replies])
- end;
-do_get_status_2([],_LD,Replies) ->
- {ok,lists:reverse(Replies)};
-do_get_status_2(Faulty,_,_) ->
- {error,{badarg,Faulty}}.
-%% ------------------------------------------------------------------------------
-
-%% Function retrieving the tracerdata for the nodes in Nodes.
-%% Returns {ok,Reply} or {error,Reason}.
-do_get_tracerdata(Nodes,LD) ->
- do_get_tracerdata_2(started_trace_nodes(Nodes,LD),LD,[]).
-
-do_get_tracerdata_2([Node|Tail],LD,Replies) ->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- do_get_tracerdata_2(Tail,LD,[{Node,?RUNTIME:get_tracerdata(Pid)}|Replies]);
- Error ->
- do_get_tracerdata_2(Tail,LD,[{Node,Error}|Replies])
- end;
-do_get_tracerdata_2([],_LD,Replies) ->
- {ok,lists:reverse(Replies)};
-do_get_tracerdata_2(Faulty,_,_) ->
- {error,{badarg,Faulty}}.
-%% ------------------------------------------------------------------------------
-
-%% Function that lists all logfiles associated with a certain tracerdata
-%% or the current tracerdata should no tracerdata be mentioned.
-%% Returns {ok,Replies} or {error,Reason}.
-do_list_logs(all,LD) -> % When doing all known nodes.
- do_list_logs_2(started_trace_nodes(all,LD),LD,[]);
-do_list_logs(TracerDataOrNodesList,LD) ->
- case inviso_rt_lib:is_tracerdata(TracerDataOrNodesList) of
- true -> % It is tracerdata for this node.
- do_list_logs_2([{node(),TracerDataOrNodesList}],LD,[]);
- false ->
- do_list_logs_2(TracerDataOrNodesList,LD,[])
- end.
-
-do_list_logs_2([{Node,TD}|Tail],LD,Replies) ->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- case check_modify_tracerdata(TD,LD) of
- {ok,TracerData} ->
- Answer=?RUNTIME:list_logs(Pid,TracerData),
- do_list_logs_2(Tail,LD,[{Node,Answer}|Replies]);
- Error ->
- do_list_logs_2(Tail,LD,[{Node,Error}|Replies])
- end;
- Error ->
- do_list_logs_2(Tail,LD,[{Node,Error}|Replies])
- end;
-do_list_logs_2([Node|Tail],LD,Replies) ->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- Answer=?RUNTIME:list_logs(Pid),
- do_list_logs_2(Tail,LD,[{Node,Answer}|Replies]);
- Error ->
- do_list_logs_2(Tail,LD,[{Node,Error}|Replies])
- end;
-do_list_logs_2([],_LD,Replies) ->
- {ok,lists:reverse(Replies)};
-do_list_logs_2(Other,_LD,_Replies) ->
- {error,{badarg,Other}}.
-%% -----------------------------------------------------------------------------
-
-%% Function fetching logfiles using distributed erlang. This function does not
-%% return anything significant. This since the reply to the client is always
-%% sent by the CollectPid unless there is badarg fault detected before the
-%% CollectPid is spawned. Note that this function sends a list of fetchers from
-%% which the CollectPid shall expect replies.
-%% We try to catch some bad arguments like Destination and Prefix not being
-%% strings. However the fact that they are lists does not guarantee they are
-%% proper strings.
-do_fetch_log(ToNode,all,Dest,Prefix,From,LD) ->
- do_fetch_log(ToNode,started_trace_nodes(all,LD),Dest,Prefix,From,LD);
-do_fetch_log(ToNode,Specs,Dest,Prefix,From,LD) when is_list(Dest),is_list(Prefix) ->
- CollectPid=spawn_link(ToNode,?MODULE,log_rec_init,[self(),Dest,Prefix,From]),
- do_fetch_log_2(Specs,LD,CollectPid,[],[]);
-do_fetch_log(_ToNode,_Specs,Dest,Prefix,From,_LD) ->
- gen_server:reply(From,{error,{badarg,[Dest,Prefix]}}).
-
-do_fetch_log_2([{Node,Spec}|Rest],LD,CollectPid,Fetchers,Replies) ->
- if
- Node==node() -> % This is plain stupid!
- do_fetch_log_2(Rest,LD,CollectPid,Fetchers,[{Node,{error,own_node}}|Replies]);
- true ->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- {NewFetchers,NewReplies}=
- do_fetch_log_3(Fetchers,
- Replies,
- Node,
- ?RUNTIME:fetch_log(Pid,CollectPid,Spec)),
- do_fetch_log_2(Rest,LD,CollectPid,NewFetchers,NewReplies);
- Error -> % Most likely the node does not exist.
- do_fetch_log_2(Rest,LD,CollectPid,Fetchers,[{Node,Error}|Replies])
- end
- end;
-do_fetch_log_2([Node|Rest],LD,CollectPid,Fetchers,Replies) ->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- {NewFetchers,NewReplies}=
- do_fetch_log_3(Fetchers,Replies,Node,?RUNTIME:fetch_log(Pid,CollectPid)),
- do_fetch_log_2(Rest,LD,CollectPid,NewFetchers,NewReplies);
- Error -> % Most likely the node does not exist.
- do_fetch_log_2(Rest,LD,CollectPid,Fetchers,[{Node,Error}|Replies])
- end;
-do_fetch_log_2([],_,CollectPid,Fetchers,Replies) ->
- CollectPid ! {?MODULE,self(),Fetchers,Replies};
-do_fetch_log_2(FaultySpec,_,CollectPid,_Fetchers,_Replies) ->
- CollectPid ! {?MODULE,self(),[],{error,{badarg,FaultySpec}}}.
-
-do_fetch_log_3(Fetchers,Replies,Node,{ok,Fetcher}) ->
- {[{Node,Fetcher}|Fetchers],Replies};
-do_fetch_log_3(Fetchers,Replies,Node,{complete,no_log}) ->
- {Fetchers,[{Node,{complete,no_log}}|Replies]};
-do_fetch_log_3(Fetchers,Replies,Node,{error,Reason}) ->
- {Fetchers,[{Node,{error,Reason}}|Replies]}.
-%% -----------------------------------------------------------------------------
-
-%% Function removing files from the runtime components. We can either ask for
-%% all files associated with the current tracerdata to be removed, or provide
-%% tracerdata or a list of files to be removed.
-%% Returns the client reply.
-do_delete_log(all,LD) ->
- do_delete_log_2(started_trace_nodes(all,LD),LD,[]);
-do_delete_log(NodeSpecs,LD) ->
- case inviso_rt_lib:is_tracerdata(NodeSpecs) of
- true -> % It is tracerdata for all nodes.
- do_delete_log_2(lists:map(fun(N)->{N,NodeSpecs} end,
- started_trace_nodes(all,LD)),
- LD,[]);
- false ->
- if
- is_list(NodeSpecs),is_list(hd(NodeSpecs)) -> % A list of files.
- do_delete_log_2(lists:map(fun(N)->{N,NodeSpecs} end,
- started_trace_nodes(all,LD)),
- LD,[]);
- true -> % Then use it as is.
- do_delete_log_2(NodeSpecs,LD,[])
- end
- end.
-
-do_delete_log_2([{Node,Spec}|Tail],LD,Replies) ->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- do_delete_log_2(Tail,LD,[{Node,?RUNTIME:delete_log(Pid,Spec)}|Replies]);
- Error ->
- do_delete_log_2(Tail,LD,[{Node,Error}|Replies])
- end;
-do_delete_log_2([Node|Tail],LD,Replies) ->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- do_delete_log_2(Tail,LD,[{Node,?RUNTIME:delete_log(Pid)}|Replies]);
- Error ->
- do_delete_log_2(Tail,LD,[{Node,Error}|Replies])
- end;
-do_delete_log_2([],_LD,Replies) ->
- {ok,lists:reverse(Replies)};
-do_delete_log_2(Faulty,_,_) ->
- {error,{badarg,Faulty}}.
-%% -----------------------------------------------------------------------------
-
-%% Function removing files from runtime components.
-%% Returns {ok,Replies} or {error,Reason}.
-do_clear(Nodes,LD,Options) ->
- do_clear_2(started_trace_nodes(Nodes,LD),LD,Options,[]).
-
-do_clear_2([Node|Tail],LD,Options,Replies) ->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- do_clear_2(Tail,LD,Options,[{Node,?RUNTIME:clear(Pid,Options)}|Replies]);
- Error ->
- do_clear_2(Tail,LD,Options,[{Node,Error}|Replies])
- end;
-do_clear_2([],_LD,_Options,Replies) ->
- {ok,lists:reverse(Replies)};
-do_clear_2(FaultyNodes,_LD,_Options,_Replies) ->
- {error,{badarg,FaultyNodes}}.
-%% -----------------------------------------------------------------------------
-
-%% Function doing a flush trace-port.
-%% Returns {ok,Replies} or {error,Reason}.
-do_flush(Nodes,LD) ->
- do_flush_2(started_trace_nodes(Nodes,LD),LD,[]).
-
-do_flush_2([Node|Rest],LD,Replies) ->
- case get_node_rec(Node,LD) of
- #node{pid=Pid} ->
- do_flush_2(Rest,LD,[{Node,?RUNTIME:flush(Pid)}|Replies]);
- Error ->
- do_flush_2(Rest,LD,[{Node,Error}|Replies])
- end;
-do_flush_2([],_LD,Replies) ->
- {ok,lists:reverse(Replies)};
-do_flush_2(FaultyNodes,_LD,_Replies) ->
- {error,{badarg,FaultyNodes}}.
-%% -----------------------------------------------------------------------------
-
-%% Function stopping runtime components. We can only stop runtime components
-%% belonging to this control component.
-%% Returns {NewLoopdata,Reply}.
-do_stop_nodes(Nodes,LD) ->
- do_stop_nodes_2(started_trace_nodes(Nodes,LD),LD,[]).
-
-do_stop_nodes_2([Node|Tail],LD,Replies) ->
- case get_node_rec(Node,LD) of
- #node{ref=MRef} ->
- erlang:demonitor(MRef),
- case ?RUNTIME:stop(Node) of
- ok ->
- NewLD=delete_node_rec(Node,LD),
- send_to_subscribers({disconnected,Node,void},LD),
- do_stop_nodes_2(Tail,NewLD,[{Node,ok}|Replies]);
- Error ->
- do_stop_nodes_2(Tail,LD,[{Node,Error}|Replies])
- end;
- Error ->
- do_stop_nodes_2(Tail,LD,[{Node,Error}|Replies])
- end;
-do_stop_nodes_2([],LD,Replies) ->
- {LD,{ok,Replies}};
-do_stop_nodes_2(Faulty,LD,_) ->
- {LD,{error,{badarg,Faulty}}}.
-%% -----------------------------------------------------------------------------
-
-%% Function being called when a runtime component sends a connect message to
-%% the controlcomponent. The control component then confirms that is has indeed
-%% taken on that runtime component.
-%% Returns a new loopdata structure.
-do_confirm_connection(Pid,Tag,LD) ->
- case ?RUNTIME:confirm_connection(Pid,Tag) of
- {node_info,Node,_Pid,VSN,State,Status,_Tag} ->
- MRef=erlang:monitor(process,Pid), % We must monitor it from now on.
- Rec=#node{node=Node,vsn=VSN,tag=Tag,ref=MRef,pid=Pid},
- send_to_subscribers({connected,Node,{Tag,{State,Status}}},LD),
- set_node_rec(Rec,LD); % Makes new loopdata.
- _Error -> % Strange, it wanted us as control!?
- LD
- end.
-%% ------------------------------------------------------------------------------
-
-%% Function handling an incomming DOWN message. This can be one of our runtime
-%% components terminating, or a process subscribing to events. Send a trace-event
-%% to subscribers if it was a runtime terminating and remove it from
-%% our list of runtime components.
-%% Note that if a subscriber has subscribed multiple times to events, we will get
-%% multiple DOWN messages too, since we have monitored that process multiple
-%% times. It is therefore sufficient to remove just one subscription entry here
-%% each time (remove on the monitor reference!).
-%% Returns a new LoopData structure.
-do_down_msg(Ref,Info,LD) ->
- case find(fun ref/2,LD#state.nodes,Ref) of
- {value,Node} -> % Yes it was one of our nodes.
- send_to_subscribers({disconnected,Node,Info},LD),
- delete_node_rec(Node,LD);
- no_match -> % Not one of our nodes.
- case lists:keysearch(Ref,2,LD#state.subscribers) of
- {value,{_Pid,_}} -> % It was a subscriber terminating.
- LD#state{subscribers=lists:keydelete(Ref,2,LD#state.subscribers)};
- false -> % Not one of our subscribers either.
- LD % Do nothing then.
- end
- end.
-%% ------------------------------------------------------------------------------
-
-
-
-%% ==============================================================================
-%% Help functions.
-%% ==============================================================================
-
-
-%% Help function which inspects options to start and add_node. Returns a new
-%% list of options in {ok,Options} or {error,Reason}.
-check_options(Options, Context) ->
- check_options_2(Options, Context, []).
-
-check_options_2([],_Context,Result) ->
- {ok,Result};
-check_options_2([{subscribe,Pid}|OptionsTail],start,Result) when is_pid(Pid) ->
- check_options_2(OptionsTail,start,[{subscribe,Pid}|Result]);
-check_options_2([{unsubscribe,Pid}|OptionsTail],start,Result) when is_pid(Pid) ->
- check_options_2(OptionsTail,start,[{unsubscribe,Pid}|Result]);
-check_options_2([{dependency,How}|OptionsTail],Context,Result) ->
- check_options_2(OptionsTail,Context,[{dependency,How}|Result]);
-check_options_2([{overload,How}|OptionsTail],Context,Result) ->
- check_options_2(OptionsTail,Context,[{overload,How}|Result]);
-check_options_2([overload|OptionsTail],Context,Result) ->
- check_options_2(OptionsTail,Context,[overload|Result]);
-check_options_2([UnKnown|_],_Context,_Result) ->
- {error,{unknown_option,UnKnown}};
-check_options_2(UnKnown,_Context,_Result) ->
- {error,{unknown_option,UnKnown}}.
-%% ------------------------------------------------------------------------------
-
-%% Help function initiating the #state structure, i.e the loopdata. Since there
-%% are some initial values from the record defaults when creating a new #state,
-%% those must be compared with possibly specified Options. Specified Options shall
-%% of course override defaults.
-%% Note that it is not the control component's responsibility to understand all
-%% options later given to a runtime component. It mearly stores them in rt_options
-%% so they can be passed to the runtime component at start-up.
-%% Returns a loopdata structure.
-initiate_state(Options) ->
- ResultingOptions=merge_options((#state{})#state.rt_options,Options),
- LD1=initiate_state_2(ResultingOptions,#state{rt_options=[]}),
- case node() of % Finally set the distribution flag.
- nonode@nohost ->
- LD1#state{distributed=false};
- _ ->
- LD1#state{distributed=true}
- end.
-
-initiate_state_2([{subscribe,Proc}|Tail],LD) when is_pid(Proc);is_atom(Proc)->
- MRef=erlang:monitor(process,Proc),
- initiate_state_2(Tail,LD#state{subscribers=[{Proc,MRef}|LD#state.subscribers]});
-initiate_state_2([Opt|Tail],LD) when is_tuple(Opt),size(Opt)>=1 ->
- initiate_state_2(Tail,initiate_state_3(element(1,Opt),Opt,LD));
-initiate_state_2([Opt|Tail],LD) when is_atom(Opt) ->
- initiate_state_2(Tail,initiate_state_3(Opt,Opt,LD));
-initiate_state_2([_|Tail],LD) ->
- initiate_state_2(Tail,LD);
-initiate_state_2([],LD) ->
- LD.
-
-initiate_state_3(OptName,Opt,LD) ->
- case initiate_state_is_rt_option(OptName) of
- true -> % Yes, it shall be part of the rt_options.
- LD#state{rt_options=[Opt|LD#state.rt_options]};
- false -> % Ignore the option then.
- LD
- end.
-
-%% This is the only place you have to change should there be more rt_options
-%% introduced.
-initiate_state_is_rt_option(overload) -> true;
-initiate_state_is_rt_option(dependency) -> true;
-initiate_state_is_rt_option(_) -> false.
-%% ------------------------------------------------------------------------------
-
-%% Help function which takes a list of default options and a list of overriding
-%% options. The function builds a return value consisting of all default options
-%% unless they are overridden by a overriding option.
-%% An option can be either {Param,.....} or Param. I.e either a tuple with zero
-%% or more values associated with the Parameter, or just an atom.
-merge_options([], Options) ->
- Options;
-merge_options([T|DefaultTail],Options) when is_tuple(T),size(T)>=1 ->
- merge_options(DefaultTail,merge_options_2(element(1,T),T,Options));
-merge_options([Param|DefaultTail],Options) when is_atom(Param) ->
- merge_options(DefaultTail,merge_options_2(Param,Param,Options));
-merge_options([_|DefaultTail],Options) -> % Strange, bad default option!
- merge_options(DefaultTail,Options).
-
-merge_options_2(Param,Opt,Options) ->
- case merge_options_find(Param,Options) of
- true ->
- Options;
- false ->
- [Opt|Options]
- end.
-
-merge_options_find(Param,[T|_]) when is_tuple(T),element(1,T)==Param ->
- true;
-merge_options_find(Param,[Param|_]) ->
- true;
-merge_options_find(Param,[_|Rest]) ->
- merge_options_find(Param,Rest);
-merge_options_find(_,[]) ->
- false.
-%% ------------------------------------------------------------------------------
-
-%% Help function which transforms certain parts of a tracer data. Those are
-%% parts which must be transformed at the controlnode like node to pid mappings.
-%% It also checks the formatting of the tracerdata since runtime components
-%% does not accept too badly formatted tracerdata.
-%% Returns {ok,NewTraceData} or {error,Reason}.
-check_modify_tracerdata(TracerData,LoopData) when is_list(TracerData) ->
- case lists:keysearch(trace,1,TracerData) of
- {value,{_,TraceTD}} -> % Examine the trace part.
- case check_modify_tracerdata(TraceTD,LoopData) of
- {ok,NewTraceTD} ->
- {ok,lists:keyreplace(trace,1,TracerData,{trace,NewTraceTD})};
- {error,Reason} -> % The trace part was faulty.
- {error,Reason} % Ruins everything :-)
- end;
- false -> % Unusual, but no trace part.
- {ok,TracerData} % No modifications necessary.
- end;
-check_modify_tracerdata(collector,_LoopData) ->
- {ok, collector};
-check_modify_tracerdata({relayer,Collector},_LoopData) when is_pid(Collector) ->
- {ok,{relayer,Collector}};
-check_modify_tracerdata({relayer,Collector},LoopData) when is_atom(Collector) ->
- case get_node_rec(Collector,LoopData) of
- Rec when is_record(Rec,node) -> % Collector is a known node.
- {ok,{relayer,Rec#node.pid}};
- {error,not_an_added_node} ->
- {error,{not_an_added_node,Collector}}
- end;
-check_modify_tracerdata({Type,Data},_LoopData) when Type==ip;Type==file ->
- {ok,{Type,Data}};
-check_modify_tracerdata({Handler,Data},_LoopData) when is_function(Handler) ->
- {ok,{Handler,Data}};
-check_modify_tracerdata(Data,_LoopData) ->
- {error,{bad_tracerdata,Data}}.
-%% -----------------------------------------------------------------------------
-
-%% Help function sending an event to all processes subscribing to events.
-%% Note that the function manipulates the from Node indicator incase we are not
-%% running in a distributed system.
-%% Returns nothing significant.
-send_to_subscribers(Msg={Event,_Node,Data},LD) ->
- AdaptedMsg=
- case LD#state.distributed of
- true ->
- Msg;
- false ->
- {Event,local_runtime,Data}
- end,
- TraceEvent={inviso_event,self(),erlang:localtime(),AdaptedMsg},
- send_to_subscribers_2(LD#state.subscribers,TraceEvent).
-
-send_to_subscribers_2([],_) ->
- ok;
-send_to_subscribers_2([{Subscriber,_}|Tail],TraceEvent) ->
- Subscriber ! TraceEvent,
- send_to_subscribers_2(Tail,TraceEvent).
-%% -----------------------------------------------------------------------------
-
-%% Help function converting the Nodes parameter to known nodes. Actually today
-%% it only converts the all atom to all known nodes.
-%% Returns a list of nodes.
-started_trace_nodes(all,LoopData) ->
- lists:map(fun(N)->N#node.node end,LoopData#state.nodes);
-started_trace_nodes(Nodes,_) ->
- Nodes.
-%% ------------------------------------------------------------------------------
-
-%% Help function searching through a list of elements looking for an element
-%% containing Key. How the element shall be interpreted is done by the Fun.
-%% Returns {value,Element} or 'no_match'.
-%% Fun=fun(Element,Key)={return,Value} | false
-find(_,[],_Key) ->
- no_match;
-find(Fun,[H|T],Key) ->
- case Fun(H,Key) of
- {return,Value}->
- {value,Value};
- _ ->
- find(Fun,T,Key)
- end.
-%% -----------------------------------------------------------------------------
-
-
-%% -----------------------------------------------------------------------------
-%% Functions handling the nodes datastructure part of the #state.
-%% #state.nodes is a list of #node.
-%% -----------------------------------------------------------------------------
-
-%% Function used to build find fun, looking for a certain #node with its monitoring
-%% reference set to Ref. Useful when finding out if a DOWN message comes from one
-%% of our runtime components.
-ref(#node{ref=Ref,node=Node},Ref) ->
- {return,Node};
-ref(_,_) ->
- false.
-%% -----------------------------------------------------------------------------
-
-%% use in find/3
-%% Function used to build find fun, finding out if we have a node with the node
-%% name Node.
-is_started(#node{node=Node},Node) ->
- {return,true};
-is_started(_,_) ->
- false.
-%% -----------------------------------------------------------------------------
-
-%% Help function replacing or adding an entry for a node. Works on either a list
-%% of #node or a loopdata structure. Returns a new list of #node or a loopdata struct.
-set_node_rec(Rec,LD=#state{nodes=NodeList}) ->
- LD#state{nodes=set_node_rec_2(Rec,NodeList)}.
-
-set_node_rec_2(Rec,[]) ->
- [Rec];
-set_node_rec_2(Rec,[NodeRec|Tail]) when NodeRec#node.node==Rec#node.node ->
- [Rec|Tail];
-set_node_rec_2(Rec,[NodeRec|Tail]) ->
- [NodeRec|set_node_rec_2(Rec,Tail)].
-%% ------------------------------------------------------------------------------
-
-%% Help function finding a node record for Node in a list of #node or in loopdata.
-%% Returns the #node in question or {error,not_an_added_node}.
-get_node_rec(Node,NodeList) when is_list(NodeList) ->
- get_node_rec_2(Node,NodeList);
-get_node_rec(Node,#state{nodes=NodeList}) ->
- get_node_rec_2(Node,NodeList).
-
-get_node_rec_2(_Node,[]) ->
- {error,not_an_added_node};
-get_node_rec_2(Node,[NodeRec|_]) when NodeRec#node.node==Node ->
- NodeRec;
-get_node_rec_2(Node,[_NodeRec|Tail]) ->
- get_node_rec_2(Node,Tail).
-%% ------------------------------------------------------------------------------
-
-%% Help function removing a #node from either a list of #node or from a loopdata
-%% structure. Returns a new list of #node or a new loopdata structure.
-delete_node_rec(Node,LD=#state{nodes=NodeList}) ->
- LD#state{nodes=delete_node_rec_2(Node,NodeList)};
-delete_node_rec(Node,NodeList) when is_list(NodeList) ->
- delete_node_rec_2(Node,NodeList).
-
-delete_node_rec_2(_,[]) ->
- [];
-delete_node_rec_2(#node{node=Node},[#node{node=Node}|Tail]) ->
- Tail;
-delete_node_rec_2(Node,[#node{node=Node}|Tail]) ->
- Tail;
-delete_node_rec_2(Node,[NRec|Tail]) ->
- [NRec|delete_node_rec_2(Node,Tail)].
-%% ------------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% Implementation of the help process receiving all logs from the runtime
-%% components. This process is referred to as the CollectPid.
-%% It is responsible for sending the reply back to the control component
-%% client. If a runtime component becomes suspended, the CollectPid is
-%% alerted by the DOWN message.
-%% Note that it may take some time before this process responds back to the client.
-%% Therefore the client must wait for 'infinity'. The job of transferring the
-%% files can be costly. Therefore it is a good idea to stop if no one is really
-%% interested in the result. This collector process monitors the From client in
-%% order to learn if the job can be cancelled. That will also be a possibility
-%% for a client to willfully cancel a fetch job.
-%% =============================================================================
-
-%% Intitial function on which the control component spawns. Note that the start
-%% must be done in two steps since the runtime components must be informed of
-%% the CollectPid. But the CollectPid must also know from which runtime components
-%% it can expect files from.
-%% InitialReplies: contains {Node,Result} for nodes from where there will be no
-%% files, but which must be part of the final reply.
-log_rec_init(Parent,Dest,Prefix,From={ClientPid,_}) ->
- receive
- {?MODULE,Parent,Fetchers,InitialReplies} ->
- RTs=lists:map(fun({N,F})->
- {N,erlang:monitor(process,F),void,void,void}
- end,
- Fetchers),
- CMRef=erlang:monitor(process,ClientPid), % Monitor the client.
- case log_rec_loop(Dest,Prefix,RTs,InitialReplies,CMRef) of
- Reply when is_list(Reply) -> % It is an ok value.
- gen_server:reply(From,{ok,Reply});
- {error,Reason} ->
- gen_server:reply(From,{error,Reason});
- false -> % The client terminated, no response.
- true % Simply terminate, fetchers will notice.
- end
- end.
-
-log_rec_loop(_Dest,_Prefix,[],Replies,_CMRef) -> % All nodes done!
- Replies; % This is the final reply.
-log_rec_loop(Dest,Prefix,RTs,Replies,CMRef) ->
- receive
- {Node,open,{FType,RemoteFName}} ->
- case lists:keysearch(Node,1,RTs) of
- {value,{_,MRef,_,_,_}} ->
- {NewRTs,NewReplies}=
- log_rec_open(Dest,Prefix,Node,MRef,FType,RemoteFName,RTs,Replies),
- log_rec_loop(Dest,Prefix,NewRTs,NewReplies,CMRef);
- false ->
- log_rec_loop(Dest,Prefix,RTs,Replies,CMRef)
- end;
- {Node,open_failure,{FType,RemoteFName}} ->
- case lists:keysearch(Node,1,RTs) of
- {value,{_,MRef,_,_,_}} ->
- {NewRTs,NewReplies}=
- log_rec_open_failure(Node,MRef,FType,RemoteFName,RTs,Replies),
- log_rec_loop(Dest,Prefix,NewRTs,NewReplies,CMRef);
- false ->
- log_rec_loop(Dest,Prefix,RTs,Replies,CMRef)
- end;
- {Node,payload,Bin,FPid} -> % A chunk of data from a fetcher.
- case lists:keysearch(Node,1,RTs) of
- {value,{_,_,_,_,void}} -> % Node has no file open here.
- FPid ! {self(),cancel_transmission}, % No use sending more to me.
- log_rec_loop(Dest,Prefix,RTs,Replies,CMRef); % Simply ignore payload.
- {value,{_Node,MRef,FType,FName,FD}} ->
- case log_rec_payload(Node,MRef,FType,FName,FD,Bin,RTs,Replies) of
- {ok,{NewRTs,NewReplies}} ->
- FPid ! {self(),chunk_ack}, % For flow control.
- log_rec_loop(Dest,Prefix,NewRTs,NewReplies,CMRef);
- {error,{NewRTs,NewReplies}} ->
- FPid ! {self(),cancel_transmission}, % No use sending more to me.
- log_rec_loop(Dest,Prefix,NewRTs,NewReplies,CMRef)
- end;
- false -> % Node is not part of transfere.
- FPid ! {self(),cancel_transmission}, % No use sending more to me.
- log_rec_loop(Dest,Prefix,RTs,Replies,CMRef)
- end;
- {Node,end_of_file} ->
- case lists:keysearch(Node,1,RTs) of
- {value,{_,_,_,_,void}} -> % Node has no file open here.
- log_rec_loop(Dest,Prefix,RTs,Replies,CMRef);
- {value,{_,MRef,FType,FName,FD}} ->
- {NewRTs,NewReplies}=
- log_rec_eof(Node,MRef,FType,FName,FD,RTs,Replies),
- log_rec_loop(Dest,Prefix,NewRTs,NewReplies,CMRef);
- false ->
- log_rec_loop(Dest,Prefix,RTs,Replies,CMRef)
- end;
- {Node,end_of_transmission} -> % This runtime is done!
- case lists:keysearch(Node,1,RTs) of
- {value,{_Node,MRef,_,_,_}} ->
- erlang:demonitor(MRef),
- log_rec_loop(Dest,Prefix,
- lists:keydelete(Node,1,RTs),
- log_rec_mkreply(Node,complete,Replies),
- CMRef);
- false -> % Strange, not one of our nodes.
- log_rec_loop(Dest,Prefix,RTs,Replies,CMRef)
- end;
- {Node,incomplete} -> % This runtime is done (with errors).
- case lists:keysearch(Node,1,RTs) of
- {value,{_,MRef,FType,FName,FD}} ->
- erlang:demonitor(MRef),
- {NewRTs,NewReplies}=
- log_rec_incomplete(Node,FType,FName,FD,RTs,Replies),
- log_rec_loop(Dest,Prefix,NewRTs,NewReplies,CMRef);
- false -> % Not our, or not anylonger.
- log_rec_loop(Dest,Prefix,RTs,Replies,CMRef)
- end;
- {Node,{error,Reason}} -> % Remote file read_error.
- case lists:keysearch(Node,1,RTs) of
- {value,{_,MRef,FType,FName,FD}} ->
- {NewRTs,NewReplies}=
- log_rec_error(Node,MRef,FType,FName,FD,RTs,Reason,Replies),
- log_rec_loop(Dest,Prefix,NewRTs,NewReplies,CMRef);
- false ->
- log_rec_loop(Dest,Prefix,RTs,Replies,CMRef)
- end;
- {'DOWN',CMRef,process,_,_} -> % The client got tired waiting.
- log_rec_cancel(Dest,RTs,Replies), % Close and remove all files.
- false; % Indicate no response message.
- {'DOWN',Ref,process,_P,_Info} ->
- case lists:keysearch(Ref,2,RTs) of
- {value,{Node,_,FType,FName,FD}} ->
- {NewRTs,NewReplies}=
- log_rec_incomplete(Node,FType,FName,FD,RTs,Replies),
- log_rec_loop(Dest,Prefix,NewRTs,NewReplies,CMRef);
- false -> % Not our, or not anylonger.
- log_rec_loop(Dest,Prefix,RTs,Replies,CMRef)
- end;
- _ ->
- log_rec_loop(Dest,Prefix,RTs,Replies,CMRef)
- end.
-
-%% Help function opening a new target file on the receiver. It returns
-%% {NewRTs,NewReplies}.
-%% Note that we must protect us against that some of the strings are not proper
-%% strings, but contains garbage.
-log_rec_open(Dest,Prefix,Node,MRef,FType,RemoteFName,RTs,Replies) ->
- case catch log_rec_open_2(Dest,Prefix,Node,MRef,FType,RemoteFName,RTs,Replies) of
- {'EXIT',Reason} ->
- NewRTs=lists:keyreplace(Node,1,RTs,{Node,MRef,void,void,void}),
- NewReplies=
- log_rec_addreply(Node,
- FType,
- {error,{file_open,{Reason,[Dest,Prefix,RemoteFName]}}},Replies),
- {NewRTs,NewReplies};
- Result ->
- Result
- end.
-
-log_rec_open_2(Dest,Prefix,Node,MRef,FType,RemoteFName,RTs,Replies) ->
- FName=Prefix++RemoteFName, % Our file name.
- case file:open(filename:join([Dest,FName]),[write]) of
- {ok,FD} ->
- NewRTs=lists:keyreplace(Node,1,RTs,{Node,MRef,FType,FName,FD}),
- {NewRTs,Replies};
- {error,Reason} ->
- NewRTs=lists:keyreplace(Node,1,RTs,{Node,MRef,void,void,void}),
- NewReplies=
- log_rec_addreply(Node,FType,{error,{file_open,{Reason,FName}}},Replies),
- {NewRTs,NewReplies}
- end.
-
-%% Help function adding a file that was unsuccessfully opened as failed.
-log_rec_open_failure(Node,MRef,FType,RemoteFName,RTs,Replies) ->
- NewRTs=lists:keyreplace(Node,1,RTs,{Node,MRef,void,void,void}),
- NewReplies=
- log_rec_addreply(Node,
- FType,
- {error,{remote_open,RemoteFName}},Replies),
- {NewRTs,NewReplies}.
-
-%% Help function whih writes the Bin to the FD file. If writing was unsuccessful,
-%% close the file and modify RTs and add a reply to Replies. Note that we can not
-%% stop the runtime from sending us more data belonging to this file. But we will
-%% simply just inore it from now on.
-%% Returns {SuccessCode,{NewRTs,NewReplies}}.
-log_rec_payload(Node,MRef,FType,FName,FD,Bin,RTs,Replies) ->
- case file:write(FD,Bin) of
- ok ->
- {ok,{RTs,Replies}};
- {error,Reason} ->
- file:close(FD),
- NewRTs=lists:keyreplace(Node,1,RTs,{Node,MRef,void,void,void}),
- NewReplies=
- log_rec_addreply(Node,FType,{error,{file_write,{Reason,FName}}},Replies),
- {error,{NewRTs,NewReplies}}
- end.
-
-%% Help function whih shall be used when a file has been successfully transfered.
-%% This function closes the output file and updates RTs and the Replies.
-%% Returns {NewRTs,NewReplies}.
-log_rec_eof(Node,MRef,FType,FName,FD,RTs,Replies) ->
- file:close(FD),
- NewRTs=lists:keyreplace(Node,1,RTs,{Node,MRef,void,void,void}),
- {NewRTs,log_rec_addreply(Node,FType,{ok,FName},Replies)}.
-
-%% Help function which, if there is an open file, indicates it as truncated in the
-%% replies. And finalize the reply for Node assuming that the node is in total incomplete
-%% Returns {NewRTs,NewReplies}.
-log_rec_incomplete(Node,_FType,_FName,void,RTs,Replies) ->
- NewRTs=lists:keydelete(Node,1,RTs), % The node is done.
- {NewRTs,log_rec_mkreply(Node,incomplete,Replies)};
-log_rec_incomplete(Node,FType,FName,FD,RTs,Replies) ->
- file:close(FD), % Not going to write anymore in this file.
- NewRTs=lists:keydelete(Node,1,RTs), % The node is done.
- NewReplies=log_rec_addreply(Node,FType,{error,{truncated,FName}},Replies),
- {NewRTs,log_rec_mkreply(Node,incomplete,NewReplies)}.
-
-%% Help function handling the case when runtime component experiences an error
-%% transferering the file. That means that there will be no more chunks of this
-%% file. Hence it works a bit like EOF.
-%% Returns {NewRTs,NewReplies}.
-log_rec_error(Node,MRef,FType,FName,FD,RTs,Reason,Replies) ->
- file:close(FD),
- NewRTs=lists:keyreplace(Node,1,RTs,{Node,MRef,void,void,void}),
- {NewRTs,log_rec_addreply(Node,FType,{error,{truncated,{Reason,FName}}},Replies)}.
-%% -----------------------------------------------------------------------------
-
-%% Help function adding a reply to the list of replies.
-%% Replies is a list {Node,FType,Reply} for each file handled, sucessfully or not.
-%% The list may also contain finalized nodes, which will be on the format:
-%% {Node,{Conclusion,[{trace_log,TraceLogReplies},{ti_log,TiLogReplies}]}}.
-log_rec_addreply(Node,FType,Reply,Replies) ->
- [{Node,FType,Reply}|Replies].
-
-%% Help function which converts the {Node,FType,Reply} tuples in Replies to
-%% a finalized reply.
-log_rec_mkreply(Node,Conclusion,Replies) ->
- {RemainingReplies,TiReplies,TraceReplies}=
- log_rec_mkreply_node_ftype(Node,Replies,[],[],[]),
- [{Node,{Conclusion,[{trace_log,TraceReplies},{ti_log,TiReplies}]}}|
- RemainingReplies].
-
-%% Help function taking out the ti_log and trace_log file-types replies for
-%% Node. Returns {RemainingReplies,Ti,Trace}.
-log_rec_mkreply_node_ftype(Node,[{Node,ti_log,Result}|Rest],Replies,Ti,Trace) ->
- log_rec_mkreply_node_ftype(Node,Rest,Replies,[Result|Ti],Trace);
-log_rec_mkreply_node_ftype(Node,[{Node,trace_log,Result}|Rest],Replies,Ti,Trace) ->
- log_rec_mkreply_node_ftype(Node,Rest,Replies,Ti,[Result|Trace]);
-log_rec_mkreply_node_ftype(Node,[Reply|Rest],Replies,Ti,Trace) ->
- log_rec_mkreply_node_ftype(Node,Rest,[Reply|Replies],Ti,Trace);
-log_rec_mkreply_node_ftype(_,[],Replies,Ti,Trace) ->
- {Replies,Ti,Trace}.
-%% -----------------------------------------------------------------------------
-
-%% If the fetching job shall be cancelled, we must close all open files and
-%% remove them including all already closed files. Returns nothing significant.
-log_rec_cancel(Dest,RTs,Replies) ->
- log_rec_cancel_open(Dest,RTs), % First close and remove all open files.
- log_rec_cancel_finished(Dest,Replies). % Remove all already closed files.
-
-log_rec_cancel_open(Dest,[{_Node,_MRef,_FType,_FName,void}|Rest]) ->
- log_rec_cancel_open(Dest,Rest); % There is no open file to close.
-log_rec_cancel_open(Dest,[{_Node,_MRef,_FType,FName,FD}|Rest]) ->
- file:close(FD),
- catch file:delete(filename:join(Dest,FName)), % Will just try to do my best.
- log_rec_cancel_open(Dest,Rest);
-log_rec_cancel_open(_Dest,[]) ->
- true.
-
-log_rec_cancel_finished(Dest,[{_N,_FT,Reply}|Rest]) ->
- [FName]=log_rec_cancel_finished_get_fname([Reply]),
- catch file:delete(filename:join(Dest,FName)),
- log_rec_cancel_finished(Dest,Rest);
-log_rec_cancel_finished(Dest,[{_N,{_Conclusion,[{_,Replies1},{_,Replies2}]}}|Rest]) ->
- FNames1=log_rec_cancel_finished_get_fname(Replies1),
- lists:foreach(fun(FName)->
- catch file:delete(filename:join(Dest,FName))
- end,
- FNames1),
- FNames2=log_rec_cancel_finished_get_fname(Replies2),
- lists:foreach(fun(FName)->
- catch file:delete(filename:join(Dest,FName))
- end,
- FNames2),
- log_rec_cancel_finished(Dest,Rest);
-log_rec_cancel_finished(_Dest,[]) ->
- true.
-
-%% Help function going through all possible reply values for a file. So
-%% consequently there must be a clause here for every possible log_rec_addreply
-%% call above. Returns a list of filenames that shall be removed in order to
-%% restore the disk since the fetch job is cancelled.
-log_rec_cancel_finished_get_fname([{error,{file_open,{_,FName}}}|Rest]) ->
- [FName|log_rec_cancel_finished_get_fname(Rest)];
-log_rec_cancel_finished_get_fname([{error,{file_write,{_,FName}}}|Rest]) ->
- [FName|log_rec_cancel_finished_get_fname(Rest)];
-log_rec_cancel_finished_get_fname([{ok,FName}|Rest]) ->
- [FName|log_rec_cancel_finished_get_fname(Rest)];
-log_rec_cancel_finished_get_fname([{error,{truncated,{_,FName}}}|Rest]) ->
- [FName|log_rec_cancel_finished_get_fname(Rest)];
-log_rec_cancel_finished_get_fname([{error,{truncated,FName}}|Rest]) ->
- [FName|log_rec_cancel_finished_get_fname(Rest)];
-log_rec_cancel_finished_get_fname([_|Rest]) -> % This shall not happend.
- log_rec_cancel_finished_get_fname(Rest);
-log_rec_cancel_finished_get_fname([]) ->
- [].
-%% -----------------------------------------------------------------------------
-
-%% EOF
diff --git a/lib/inviso/src/inviso_lfm.erl b/lib/inviso/src/inviso_lfm.erl
deleted file mode 100644
index 085048518c..0000000000
--- a/lib/inviso/src/inviso_lfm.erl
+++ /dev/null
@@ -1,431 +0,0 @@
-%% ``The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved via the world wide web at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
-%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
-%% AB. All Rights Reserved.''
-%%
-%% $Id$
-%%
-%% Author: Lennart �hman, [email protected]
-%%
-%% INVISO LogFile Merger.
-%%
-%% Merges all log-entries in all files in Files in chronological order
-%% into what ever is handled by WorkHandlerFun. Note that Files can contain
-%% several files. Both in the sence that it can be a wrapset. But also because
-%% the log is spread over more than one LogFiles (i.e trace_log + ti_log).
-%% It is further possible to use another reader-process (for the logfiles)
-%% than the default one. This is useful if the logfiles are formatted in
-%% another way than as done by a trace-port.
-
--module(inviso_lfm).
-
-%% -----------------------------------------------------------------------------
-%% API exports.
-%% -----------------------------------------------------------------------------
-
--export([merge/2,merge/3,merge/4,merge/5,merge/6]).
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% Default handler exports.
-%% -----------------------------------------------------------------------------
-
--export([outfile_opener/1,outfile_writer/4,outfile_closer/1]).
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% Formatting functions.
-%% -----------------------------------------------------------------------------
-
--export([format_arguments/3,format_argument_string/2]).
-%% -----------------------------------------------------------------------------
-%% Internal exports.
-%% -----------------------------------------------------------------------------
-
--export([init_receiver/7]).
-%% -----------------------------------------------------------------------------
-
-%% merge(Files,BeginHandlerFun,WorkHandlerFun,EndHandlerFun,HandlerData)=
-%% {ok,Count} | {error,Reason}
-%% merge(Files,OutputFile) =
-%%
-%% Files=[FileDescription,...]
-%% FileDescription=FileSet | {reader,Mod,Func,FileSet}
-%% FileSet={Node,LogFiles} | {Node,[LogFiles,...]}
-%% in the latter case the LogFiles must be sorted, beginning with the oldest.
-%% LogFiles=[{trace_log,Files} [,{ti_log,[FileName]}] ]
-%% either just trace_log or trace_log and ti_log.
-%% Files=[FileName] | [FileName,...]
-%% in the latter case it is a wrapset.
-%% BeginHandlerFun= ( fun(HandlerData)->{ok,NewHandleData} | {error,Reason} )
-%% WorkHandlerFun= ( fun(Node,Term,PidMappings,HandlerData)->
-%% {ok,NewHandlerData} | {error,Reason}
-%% EndHandlerFun= ( fun(HandlerData)->ok | {error,Reason} )
-%% Count=integer(), the total number of handled log entries.
-%%
-%% Merges all logfiles in Files together into one common log file, in chronological
-%% order according to the time-stamps in each log. Each entry is also marked with
-%% the node name in the merged log.
-%% Configuration:
-%% If a non-default reader shall be used, Mod:Func(ReceiverPid,LogFiles) shall
-%% spawn a reader process complying to the receiver/reader message protocoll.
-%% The default reader reads logs generated by a trace-port.
-%% BeginHandler is called before any logentries are processed, typically to open
-%% the out-file, if any.
-%% WorkHandlerFun is called for every log-entry. It typically writes the output.
-%% EndHandlerFun is called when the last reader has finished, typically to
-%% close the outfile.
-%%
-%% Using merge/2 assumes you want to use default handlers writing to a file.
-merge(Files,OutputFile) when is_list(OutputFile) ->
- merge(Files,fun outfile_opener/1,fun outfile_writer/4,fun outfile_closer/1,OutputFile,off).
-merge(Files,WorkHandlerFun,HandlerData) when is_function(WorkHandlerFun) ->
- merge(Files,void,WorkHandlerFun,void,HandlerData,off);
-merge(Files,OutputFile,Dbg) when is_list(OutputFile) ->
- merge(Files,fun outfile_opener/1,fun outfile_writer/4,fun outfile_closer/1,OutputFile,Dbg).
-merge(Files,WorkHandlerFun,HandlerData,Dbg) when is_function(WorkHandlerFun) ->
- merge(Files,void,WorkHandlerFun,void,HandlerData,Dbg).
-merge(Files,BeginHandlerFun,WorkHandlerFun,EndHandlerFun,HandlerData) ->
- merge(Files,BeginHandlerFun,WorkHandlerFun,EndHandlerFun,HandlerData,off).
-merge(Files,BeginHandlerFun,WorkHandlerFun,EndHandlerFun,HandlerData,Dbg) ->
- ReceiverPid=spawn_link(?MODULE,
- init_receiver,
- [self(),Files,BeginHandlerFun,WorkHandlerFun,
- EndHandlerFun,HandlerData,Dbg]),
- wait_for_response(ReceiverPid).
-
-wait_for_response(ReceiverPid) ->
- receive
- {reply,ReceiverPid,Reply} ->
- Reply;
- {'EXIT',ReceiverPid,Reason} ->
- {error,Reason}
- end.
-%% -----------------------------------------------------------------------------
-
-%% =============================================================================
-%% Code for the receiver process.
-%% =============================================================================
-
-%% Initial function for the receiver process. This function must be exported.
-init_receiver(From,Files,BeginHandlerFun,WorkHandlerFun,EndHandlerFun,HandlerData,Dbg) ->
- case setup_readers(Files) of % Create the reader processes.
- {ok,Readers} ->
- process_flag(trap_exit,true),
- if
- is_function(BeginHandlerFun) ->
- case catch BeginHandlerFun(HandlerData) of
- {ok,NewHandlerData} ->
- init_receiver_2(From,WorkHandlerFun,EndHandlerFun,
- NewHandlerData,Dbg,Readers);
- {error,Reason} -> % Faulty begin-function.
- From ! {reply,self(),{error,{begin_handler,Reason}}};
- {'EXIT',Reason} ->
- From ! {reply,self(),{error,{begin_handler,Reason}}}
- end;
- true -> % There is no begin-handler.
- init_receiver_2(From,WorkHandlerFun,EndHandlerFun,HandlerData,Dbg,Readers)
- end;
- {error,Reason} ->
- From ! {reply,self(),{error,{files,Reason}}}
- end.
-
-init_receiver_2(From,WorkHandlerFun,EndHandlerFun,HandlerData,Dbg,Readers) ->
- {NewReaders,EntryStruct}=mk_entrystruct(Readers,Dbg),
- {Reply,NewHandlerData}=
- loop(From,WorkHandlerFun,HandlerData,NewReaders,EntryStruct,Dbg,0),
- if
- is_function(EndHandlerFun) ->
- case EndHandlerFun(NewHandlerData) of
- ok ->
- From ! {reply,self(),Reply};
- {error,_Reason} ->
- From ! {reply,self(),Reply}
- end;
- true -> % Reply directly then, no finish fun.
- From ! {reply,self(),Reply}
- end.
-
-%% Function that spawns a help process for each group of files in the list.
-%% The help process will read entries from the input files in the correct order
-%% and deliver them to the receiver process.
-%% Note that there is a possibility to design your own readers. The default
-%% reader understands trace-port generated logfiles.
-%% Returns a list of {Node,Pid}.
-setup_readers(Files) ->
- setup_readers_2(Files,[]).
-
-setup_readers_2([{reader,Mod,Func,{Node,FileStruct}}|Rest],Acc) ->
- Pid=spawn_link(Mod,Func,[self(),FileStruct]),
- setup_readers_2(Rest,[{Node,Pid}|Acc]);
-setup_readers_2([{Node,FileStruct}|Rest],Acc) ->
- Pid=spawn_link(inviso_lfm_tpfreader,init,[self(),FileStruct]),
- setup_readers_2(Rest,[{Node,Pid}|Acc]);
-setup_readers_2([],Acc) ->
- {ok,Acc};
-setup_readers_2([Faulty|_],_Acc) ->
- {error,{bad_reader_spec,Faulty}}.
-%% -----------------------------------------------------------------------------
-
-%% This is the workloop that polls each reader for messages and writes them
-%% in the correct order.
-loop(From,WorkHFun,HData,Readers,EntryStruct,Dbg,Count) ->
- case find_oldest_entry(EntryStruct) of
- {Pid,Node,PidMappings,Term} ->
- case get_and_insert_new_entry(From,Node,Pid,Readers,EntryStruct,Dbg) of
- {ok,{NewReaders,NewEntryStruct}} ->
- case WorkHFun(Node,Term,PidMappings,HData) of
- {ok,NewHData} ->
- loop(From,WorkHFun,NewHData,NewReaders,NewEntryStruct,Dbg,Count+1);
- {error,Reason} -> % Serious, we cant go on then.
- stop_readers(NewReaders),
- {{error,{writing_output_file,Reason}},HData}
- end;
- {stop,_Reason} -> % The original caller is no longer there!
- stop_readers(Readers),
- {error,HData}
- end;
- done -> % No more readers.
- {{ok,Count},HData}
- end.
-
-%% Help function which finds the oldest entry in the EntryStruct. Note that the
-%% timestamp can actually be the atom 'false'. This happens for instance if it is
-%% a dropped-messages term. But since 'false' is smaller than any tuple, that
-%% term will be consumed immediately as soon as it turns up in EntryList.
-find_oldest_entry(EntryStruct) ->
- case list_all_entries(EntryStruct) of
- [] -> % The we are done!
- done;
- EntryList when is_list(EntryList) -> % Find smallest timestamp in here then.
- {Pid,Node,PidMappings,_TS,Term}=
- lists:foldl(fun({P,N,PMap,TS1,T},{_P,_N,_PMap,TS0,_T}) when TS1<TS0 ->
- {P,N,PMap,TS1,T};
- (_,Acc) ->
- Acc
- end,
- hd(EntryList),
- EntryList),
- {Pid,Node,PidMappings,Term}
- end.
-
-%% Help function which signals all reader process to clean-up and terminate.
-%% Returns nothing significant.
-stop_readers([Pid|Rest]) ->
- Pid ! {stop,self()},
- stop_readers(Rest);
-stop_readers([]) ->
- ok.
-%% -----------------------------------------------------------------------------
-
-%% Help function which tries to replace the entry by Pid in EntryStruct with
-%% a new one from that process. If one is returned on request, it replaces
-%% the old one in EntryStruct. If Pid is done or otherwise dissapears, Pid
-%% is simply removed from Readers and the EntryStruct.
-get_and_insert_new_entry(Node,Pid,Readers,EntryStruct,Dbg) ->
- get_and_insert_new_entry(void,Node,Pid,Readers,EntryStruct,Dbg).
-
-get_and_insert_new_entry(From,Node,Pid,Readers,EntryStruct,Dbg) ->
- Pid ! {get_next_entry,self()},
- receive
- {'EXIT',From,Reason} -> % No one is waiting for our reply!
- {stop,Reason}; % No use continuing then.
- {next_entry,Pid,PidMappings,TS,Term} -> % We got a next entry from Pid!
- ets:insert(EntryStruct,{Pid,Node,PidMappings,TS,Term}),
- {ok,{Readers,EntryStruct}};
- {next_entry,Pid,{error,_Reason}} -> % Reading an entry went wrong.
- get_and_insert_new_entry(From,Node,Pid,Readers,EntryStruct,Dbg);
- {'EXIT',Pid,_Reason} -> % The process has terminated.
- ets:delete(EntryStruct,Pid),
- NewReaders=lists:delete(Pid,Readers),
- {ok,{NewReaders,EntryStruct}}
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function which from a list of reader processes creates the private
-%% storage where the oldest entry from each reader is always kept.
-%% Returns {Readers,EntryStruct}.
-mk_entrystruct(Pids,Dbg) ->
- TId=ets:new(list_to_atom("inviso_lfm_tab_"++pid_to_list(self())),[set]),
- mk_entrystruct_2(Pids,lists:map(fun({_,P})->P end,Pids),Dbg,TId).
-
-mk_entrystruct_2([{Node,Pid}|Rest],Readers,Dbg,EntryStruct) ->
- {ok,{NewReaders,NewEntryStruct}}=
- get_and_insert_new_entry(Node,Pid,Readers,EntryStruct,Dbg),
- mk_entrystruct_2(Rest,NewReaders,Dbg,NewEntryStruct);
-mk_entrystruct_2([],Readers,_Dbg,EntryStruct) ->
- {Readers,EntryStruct}.
-%% -----------------------------------------------------------------------------
-
-%% Help function that returns a list of our oldest entry structure.
-%% [{Pid,Node,PidMappings,TimeStamp,Term},...]
-list_all_entries(EntryStruct) ->
- ets:tab2list(EntryStruct).
-%% -----------------------------------------------------------------------------
-
-%% =============================================================================
-%% Default handlers for the receiver
-%% =============================================================================
-
-%% These functions are also exported in order to make them available when creating
-%% other funs in other modules.
-
-%% Default begin-handler.
-outfile_opener(FileName) ->
- case file:open(FileName,[write]) of
- {ok,FD} ->
- {ok,FD}; % Let the descriptor be handlerdata.
- {error,Reason} ->
- {error,{open,Reason}}
- end.
-
-%% Default work-handler.
-%% DEN H�R �R L�NGT IFR�N F�RDIG!!!
-outfile_writer(Node,Term,PidMappings,FD) ->
- io:format(FD,"~w ~w ~w~n",[Node,PidMappings,Term]),
- {ok,FD}.
-
-%% Default end-handler.
-outfile_closer(FD) ->
- file:close(FD),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% =============================================================================
-%% Formatting functions.
-%% =============================================================================
-
-%% This section contains a useful formatting function formatting an (function)
-%% argument list. It also offers a working example of how to write
-%% own datatype translators (which will be used by the formatting function to
-%% further enhance the output).
-
-%% format_arguments(Args,FOpts,Transaltors)=Args2 | <failure>
-%% Args=list(), list of the argument as usually given in a trace message,
-%% a stack trace or similar.
-%% FOpts=term(), formatting options understood by the translation functions.
-%% Translations=[Translator,...]
-%% Translator=fun(Term,FOpts)=TResult | {M,F}, where M:F(Term,FOpts)=TResult
-%% TResult={ok,TranslationString} | false
-%% Arg2=list(), list of Args where terms may be replaced by own representations.
-%% Note that terms not effected will remain as is, but if an own representation
-%% is choosen, that must be a string in order for any io format function to
-%% print it exactly as formatted here.
-format_arguments([Arg|Rest],FOpts,Translators) -> % More than one argument.
- [format_argument(Arg,FOpts,Translators)|format_arguments(Rest,FOpts,Translators)];
-format_arguments([],_FOpts,_Translators) ->
- []. % The empty list.
-
-%% Help function handling the various Erlang datatypes. There must hence be one
-%% clause here for every existing datatype.
-format_argument(List,FOpts,Translators) when is_list(List) ->
- case format_argument_own_datatype(List,FOpts,Translators) of
- {true,TranslationStr} ->
- TranslationStr;
- false ->
- format_argument_list(List,FOpts,Translators)
- end;
-format_argument(Tuple,FOpts,Translators) when is_tuple(Tuple) ->
- case format_argument_own_datatype(Tuple,FOpts,Translators) of
- {true,TranslationStr} -> % It was one of our special datatypes.
- TranslationStr;
- false -> % Regular tuple.
- format_argument_tuple(Tuple,FOpts,Translators)
- end;
-format_argument(Binary,FOpts,Translators) when is_binary(Binary) ->
- case format_argument_own_datatype(Binary,FOpts,Translators) of
- {true,TranslationStr} -> % It was one of our special datatypes..
- TranslationStr;
- false -> % Regular binary.
- format_argument_binary(Binary,FOpts,Translators)
- end;
-format_argument(Atom,_FOpts,_Translators) when is_atom(Atom) ->
- Atom;
-format_argument(Integer,_FOpts,_Translators) when is_integer(Integer) ->
- Integer;
-format_argument(Float,_FOpts,_Translators) when is_float(Float) ->
- Float;
-format_argument(Pid,_FOpts,_Translators) when is_pid(Pid) ->
- Pid;
-format_argument(Port,_FOpts,_Translators) when is_port(Port) ->
- Port;
-format_argument(Ref,_FOpts,_Translators) when is_reference(Ref) ->
- Ref;
-format_argument(Fun,_FOpts,_Translators) when is_function(Fun) ->
- Fun.
-
-%% Help function handling the case when an element is a list.
-format_argument_list([Element|Rest],FOpts,Translators) ->
- [format_argument(Element,FOpts,Translators)|
- format_argument_list(Rest,FOpts,Translators)];
-format_argument_list([],_FOpts,_Translators) ->
- [].
-
-%% Help function handling the case when an element is a tuple.
-format_argument_tuple(Tuple,FOpts,Translators) ->
- list_to_tuple(format_argument_tuple(Tuple,FOpts,Translators,size(Tuple),[])).
-
-format_argument_tuple(_,_,_,0,List) ->
- List;
-format_argument_tuple(Tuple,FOpts,Translators,Index,List) ->
- E=format_argument(element(Index,Tuple),FOpts,Translators),
- format_argument_tuple(Tuple,FOpts,Translators,Index-1,[E|List]).
-
-%% Help function handling the case when an element is a binary.
-format_argument_binary(Binary,_FOpts,_Translators) ->
- Binary.
-
-%% Help function trying to use the translations.
-format_argument_own_datatype(Term,FOpts,[Fun|Rest]) when is_function(Fun) ->
- case catch Fun(Term,FOpts) of
- {ok,TranslationStr} ->
- {true,TranslationStr};
- _ ->
- format_argument_own_datatype(Term,FOpts,Rest)
- end;
-format_argument_own_datatype(Term,FOpts,[{M,F}|Rest]) ->
- case catch M:F(Term,FOpts) of
- {ok,TranslationStr} ->
- {true,TranslationStr};
- _ ->
- format_argument_own_datatype(Term,FOpts,Rest)
- end;
-format_argument_own_datatype(Term,FOpts,[_|Rest]) ->
- format_argument_own_datatype(Term,FOpts,Rest);
-format_argument_own_datatype(_Term,_FOpts,[]) -> % There is no applicable format.
- false.
-%% -----------------------------------------------------------------------------
-
-%% format_argument_string(String,_FOpts)={ok,QuotedString} | false
-%% String=string() | term()
-%% QuotedString="String"
-%% Example of datatype checker that checks, in this case, that its argument is
-%% a string. If it is, it returns a deep list of the characters to print in order
-%% to make it a quoted string.
-format_argument_string(List=[_|_],_FOpts) -> % Must be at least one element.
- case format_argument_string_2(List) of
- true ->
- {ok,[$",List,$"]};
- false ->
- false
- end;
-format_argument_string(_,_FOpts) ->
- false.
-
-format_argument_string_2([C|Rest]) when (((C<127) and (C>=32)) or ((C>=8) and (C=<13))) ->
- format_argument_string_2(Rest);
-format_argument_string_2([_|_]) ->
- false;
-format_argument_string_2([]) ->
- true.
-%% -----------------------------------------------------------------------------
diff --git a/lib/inviso/src/inviso_lfm_tpfreader.erl b/lib/inviso/src/inviso_lfm_tpfreader.erl
deleted file mode 100644
index 6de4d11fe0..0000000000
--- a/lib/inviso/src/inviso_lfm_tpfreader.erl
+++ /dev/null
@@ -1,388 +0,0 @@
-%% ``The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved via the world wide web at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
-%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
-%% AB. All Rights Reserved.''
-%%
-%% $Id$
-%%
-%% Author: Lennart �hman, [email protected]
-
-%%
-%% INVISO LogFileMerger TracePort File READER.
-%%
-%% This module implements a reader process capable of reading traceport files
-%% and feeding them according to the logfile merger process message protocoll
-%% to the logfile merger process.
-%% This module can also serve as example for writing file readers for other
-%% file formats.
-%%
-%% A reader process must:
-%% Support the reader-receiver protocoll.
-%% receive next_entry message: {get_next_entry,ReceiverPid}
-%% recieve stop message should the receiver wish to quit: {stop,ReceiverPid}.
-%% send next_entry message, either with entry or fault-code.
-%% next_entry message contains:{next_entry,self(),PidMappings,Timestamp,Term}
-%% {next_entry,self(),Error}
-%% recognize receiver termination (EXIT-signal).
-%% Understand logfile structure, both filename structure and content.
-%% Understand content (log-entry) details to extract the entry and entry
-%% components as timestamp and originating pid (to make pid-mappings).
-%% Understand any trace information files (ti).
-%%
-%% The logfile structure written by inviso_rt_meta is:
-%% {Pid,Alias,Op,TimeStamp} where:
-%% Pid=pid(), if Alias==unalias: pid()|other_than_pid()
-%% Op=alias|unalias,
-%% TimeStamp=now()
-%% -----------------------------------------------------------------------------
--module(inviso_lfm_tpfreader).
-
--export([init/2]).
-%% -----------------------------------------------------------------------------
-
--export([handle_logfile_sort_wrapset/1]). % Exported as a service to other readers.
-%% -----------------------------------------------------------------------------
-
-%% init(RecPid,FileStruct)=N/A
-%% RecPid=pid(), the process id of the log file merger.
-%% FileStruct=LogFiles | [LogFiles,...]
-%% LogFiles=[{trace_log,[File,...]} [,{ti_log,[File]}] ]
-%% File=string()
-%% Spawn on this function to start a reader process for trace-port generated
-%% logfiles, possibly with inviso-generated ti-files.
-init(RecPid,LogFiles=[Tuple|_]) when is_tuple(Tuple) -> % Only one LogFiles.
- init(RecPid,[LogFiles]);
-init(RecPid,FileStruct) when is_list(FileStruct) ->
- logfiles_loop(RecPid,FileStruct).
-%% -----------------------------------------------------------------------------
-
-logfiles_loop(RecPid,[LogFiles|Rest]) ->
- {TIalias,TIunalias}=handle_ti_file(LogFiles),% If there is a ti-file, read it.
- Files=handle_logfiles(LogFiles), % Returns a sorted list of logfiles.
- case open_next_file(Files) of
- {ok,FileName,FD,NewFiles} ->
- case loop(RecPid,FileName,NewFiles,TIalias,TIunalias,FD) of
- next ->
- logfiles_loop(RecPid,Rest);
- stop ->
- true % Terminate normally.
- end;
- done -> % Hmm, already out of files.
- true; % Then lets terminate normally.
- {error,Reason} -> % Couldn't even open the first file.
- exit(Reason)
- end;
-logfiles_loop(_RecPid,[]) -> % No more files in LogFiles.
- true. % Terminate normally.
-
-%% This workloop reads an entry from the input file upon request from the merger
-%% process and sends it back to the merger process (Parent). If the file ends
-%% there are more files to open and read in Files, the next file will be opened.
-loop(RecPid,FileName,Files,TIalias,TIunalias,FD) ->
- receive
- {get_next_entry,RecPid} -> % The receiver request the next entry.
- case fetch_next(FileName,FD,Files) of
- {ok,Term,NewCurrFile,NewFiles,NewFD} ->
- TS=find_timestamp_in_term(Term),
- PidMappings=make_pid_mappings(Term,TIalias,TIunalias,TS),
- RecPid ! {next_entry,self(),PidMappings,TS,Term},
- loop(RecPid,NewCurrFile,NewFiles,TIalias,TIunalias,NewFD);
- {error,Reason} -> % Not a properly formatted entry.
- RecPid ! {next_entry,self(),{error,Reason}},
- loop(RecPid,FileName,Files,TIalias,TIunalias,FD);
- done -> % No more files to read in this LogFiles.
- next % Are there more Files in FileStruct?
- end;
- {stop,RecPid} -> % The receiver process is done.
- file:close(FD), % Close file and terminate normally.
- stop
- end.
-%% -----------------------------------------------------------------------------
-
-%% Function which reads the next trace-entry from the file handled by FD, or if
-%% that file reaches EOF opens the next file in Files. Files must be sorted in
-%% the correct order.
-%% Returns {ok,Term,NewFileName,NewFiles,NewFD}, {error,Reason} or 'done'.
-fetch_next(FileName,FD,Files) ->
- case read_traceport_file(FileName,FD) of
- {ok,Term} -> % There were more terms in the file.
- {ok,Term,FileName,Files,FD}; % No changes necessary then.
- eof -> % This file is empty, try next file!
- file:close(FD),
- case open_next_file(Files) of
- {ok,NewFileName,NewFD,NewFiles} -> % A new file has been opened.
- fetch_next(NewFileName,NewFD,NewFiles); % Try again.
- done -> % No more files.
- done;
- {error,Reason} -> % Problems opening files.
- {error,Reason}
- end;
- {error,Reason} -> % Problems reading the file.
- {error,Reason}
- end.
-
-read_traceport_file(FileName,FD) ->
- case file:read(FD,5) of % Trace-port file entries start with 5 bytes.
- {ok,<<0,Size:32>>} -> % Each entry in a traceport file begins.
- case file:read(FD,Size) of
- {ok,Bin} when is_binary(Bin),size(Bin)=:=Size ->
- try binary_to_term(Bin) of
- Term -> % Bin was a properly formatted term!
- {ok,Term}
- catch
- error:_Reason -> % Not a properly formatted term!
- {error,{binary_to_term,[FileName,Bin]}}
- end;
- {ok,Bin} -> % Incorrect length.
- {error,{faulty_length,[FileName,Size,Bin]}};
- eof -> % This is premature end of file!
- {error,{premature_eof,FileName}}
- end;
- {ok,<<1,DroppedMsgs:32>>} ->
- {ok,{drop,DroppedMsgs}};
- {ok,JunkBin} -> % Don't understand, report it as error.
- {error,{junk,[FileName,JunkBin]}};
- eof -> % A correct end of file!
- eof
- end.
-
-%% Help function which opens a file in raw binary mode and returns
-%% {ok,FileName,FD,Rest} or {error,Reason}.
-open_next_file([]) -> % There are no more files to open.
- done;
-open_next_file([FileName|Rest]) ->
- case file:open(FileName,[read,raw,binary]) of
- {ok,FD} ->
- {ok,FileName,FD,Rest};
- {error,Reason} ->
- {error,{open,[FileName,Reason]}}
- end.
-%% ------------------------------------------------------------------------------
-
-%% ==============================================================================
-%% Help functions.
-%% ==============================================================================
-
-
-%% Help function which extract the originating process id from the log entry
-%% term and returns a list of all associations to the PID found in TIalias.
-make_pid_mappings(_,void,_,_) -> % Trace Information is not used.
- []; % Simply no pid mappings then!
-make_pid_mappings(Term,TIalias,TIunalias,TS)
- when element(1,Term)==trace;element(1,Term)==trace_ts ->
- Pid=element(2,Term), % The pid.
- TempAliases=find_aliases(ets:lookup(TIalias,Pid),TS),
- remove_expired_aliases(TempAliases,TIalias,TIunalias,TS),
- lists:map(fun({_,_,Alias})->Alias end,
- find_aliases(ets:lookup(TIalias,Pid),TS));
-make_pid_mappings(_Term,_TIalias,_TIunalias,_TS) -> % Don't understand Term.
- []. % Simply no translations then!
-
-%% Help function traversing a list of ets-alias-table entries and returning a
-%% list of those old enough to have happend before TS.
-%% Note that it is possible to have an Offset in microseconds. This because an
-%% association may end up in the ti-file a short time after logentries starts
-%% to appear in the log file for the process in question. We therefore like to
-%% allow some slack,
-find_aliases(List,TS) ->
- lists:filter(fun({_,Now,_}) when Now<TS -> true;
- (_) -> false
- end,
- List).
-%% ------------------------------------------------------------------------------
-
-%% Help function which removes aliases that are no longer valid from the
-%% ETS table. It uses unalias entries which are older than TS but younger than
-%% the alias association.
-%% Returns nothing significant.
-remove_expired_aliases([{Pid,Now1,Alias}|Rest],TIalias,TIunalias,TS) ->
- Candidates=ets:lookup(TIunalias,Alias),
- lists:foreach(fun({_,Now2,P})
- when (Now2>Now1) and
- (Now2<TS) and
- ((P==Pid) or (not(is_pid(P)))) ->
- ets:delete_object(TIalias,{Pid,Now1,Alias}),
- true; % This alias is infact no longer.
- (_) ->
- false
- end,
- Candidates),
- remove_expired_aliases(Rest,TIalias,TIunalias,TS);
-remove_expired_aliases([],_,_,_) ->
- true.
-%% ------------------------------------------------------------------------------
-
-find_timestamp_in_term({trace_ts,_,_,_,TS}) ->
- TS;
-find_timestamp_in_term({trace_ts,_,_,_,_,TS}) ->
- TS;
-find_timestamp_in_term(_) -> % Don't know if there is a timestamp.
- false.
-%% -----------------------------------------------------------------------------
-
-
-%% -----------------------------------------------------------------------------
-%% Help function handling a trace-information file and building the TIstruct storage.
-%% -----------------------------------------------------------------------------
-
-%% Help function which opens a standard ti-file, reads its content and
-%% builds two ETS-table where PID is primary index in the one for aliases, and
-%% the alias is primary index in the one for unalias.
-%% Returns a handle to the two ETS tables.
-%%
-%% This function currently handles:
-%% (1) plain straight raw binary files.
-handle_ti_file(FileStruct) ->
- case lists:keysearch(ti_log,1,FileStruct) of
- {value,{_,[FileName]}} when is_list(FileName) -> % There is one ti-file in this set.
- case file:open(FileName,[read,raw,binary]) of
- {ok,FD} ->
- TIdAlias=ets:new(list_to_atom("inviso_ti_atab_"++pid_to_list(self())),
- [bag]),
- TIdUnalias=ets:new(list_to_atom("inviso_ti_utab_"++pid_to_list(self())),
- [bag]),
- handle_ti_file_2(FD,TIdAlias,TIdUnalias), % Fill the table.
- file:close(FD),
- {TIdAlias,TIdUnalias};
- {error,_Reason} -> % Hmm, unable to open the file.
- {void,void} % Treat it as no ti-file.
- end;
- {value,_} -> % Some other file-set.
- {void,void}; % Pretend we don't understand.
- false -> % No ti-file in this set.
- {void,void}
- end.
-
-handle_ti_file_2(FD,TIdAlias,TIdUnalias) ->
- case file:read(FD,5) of % First read the header.
- {ok,<<_,Size:32>>} ->
- case file:read(FD,Size) of % Read the actual term.
- {ok,Bin} when size(Bin)=:=Size ->
- try binary_to_term(Bin) of
- {Pid,Alias,alias,NowStamp} -> % Save this association.
- ets:insert(TIdAlias,{Pid,NowStamp,Alias}),
- handle_ti_file_2(FD,TIdAlias,TIdUnalias);
- {Pid,Alias,unalias,NowStamp} ->
- ets:insert(TIdUnalias,{Alias,NowStamp,Pid}),
- handle_ti_file_2(FD,TIdAlias,TIdUnalias);
- _Term -> % Don't understand!
- handle_ti_file_2(FD,TIdAlias,TIdUnalias)
- catch
- error:_Reason -> % Badly formatted term
- handle_ti_file_2(FD,TIdAlias,TIdUnalias)
- end;
- {ok,_JunkBin} -> % To short probably.
- handle_ti_file_2(FD,TIdAlias,TIdUnalias); % Just drop it.
- eof -> % Should not come here, but
- {TIdAlias,TIdUnalias} % not much we can do, drop it and stop.
- end;
- {ok,_} -> % Also an error.
- handle_ti_file_2(FD,TIdAlias,TIdUnalias);
- eof -> % This is the normal eof point.
- {TIdAlias,TIdUnalias}
- end.
-%% -----------------------------------------------------------------------------
-
-
-%% -----------------------------------------------------------------------------
-%% Help functions sorting out what kind of logfiles we have to deal with.
-%% -----------------------------------------------------------------------------
-
-%% Help function which takes the filestruct argument and retrieves the names
-%% of all log-files mentioned there. If there are several logfiles, this function
-%% sorts them beginning with the oldest. That means that this function must
-%% have knowledge of how wrap-sets and so on works.
-%% Today known set-types:
-%% (1) file: One plain file.
-%% (2) wrap_set: List of files belonging to a wrap-set. Must be sorted.
-handle_logfiles(FileStruct) ->
- handle_logfiles_2(lists:keysearch(trace_log,1,FileStruct)).
-
-handle_logfiles_2({value,{_,[FileName]}}) when is_list(FileName)-> % One single plain file.
- [FileName];
-handle_logfiles_2({value,{_,Files}}) when is_list(Files) -> % A wrap-set.
- handle_logfile_sort_wrapset(Files);
-handle_logfiles_2(_) ->
- []. % Pretend there were no files otherwise.
-
-%% Help function which sorts the files in WrapSet beginning with the oldest.
-%% It assumes that a logfile is Name++SeqNo++Suffix.
-%% First the Name and Suffix must be established. We look at all files to find
-%% that out.
-%% Returns a list of sorted filenames.
-%% This function is exported since it might turn useful in own implemented
-%% readers.
-handle_logfile_sort_wrapset(Set=[_FileName]) -> % Only one file! Done then :-)
- Set;
-handle_logfile_sort_wrapset([]) -> % Also pretty simple :-)
- [];
-handle_logfile_sort_wrapset(FileSet) ->
- Prefix=find_common_prefix(FileSet),
- Suffix=find_common_prefix(lists:map(fun(Str)->lists:reverse(Str) end,FileSet)),
- find_hole_in_wrapset(FileSet,length(Prefix),length(Suffix)).
-
-%% Help function which finds the longest common prefix of all strings in the
-%% argument-list. Returns that string.
-find_common_prefix(Files=[[FirstChar|_]|_]) ->
- find_common_prefix_2(Files,FirstChar,[],[]);
-find_common_prefix([_|_]) -> % Means that prefix is "".
- "".
-
-find_common_prefix_2([[CurrChar|RestString]|Rest],CurrChar,Files,RevPrefix) ->
- find_common_prefix_2(Rest,CurrChar,[RestString|Files],RevPrefix);
-find_common_prefix_2([_String|_],_CurrChar,_Files,RevPrefix) ->
- lists:reverse(RevPrefix); % Found a difference.
-find_common_prefix_2([],CurrChar,Files=[[FirstChar|_]|_],RevPrefix) ->
- find_common_prefix_2(Files,FirstChar,[],[CurrChar|RevPrefix]);
-find_common_prefix_2([],CurrChar,_,RevPrefix) ->
- lists:reverse([CurrChar|RevPrefix]). % Actually, prefix was entire string!
-
-%% Help function which returns a sorted list of FileSet with the oldest first.
-find_hole_in_wrapset(FileSet,PreLen,SufLen) ->
- NumberedFiles=find_hole_in_wrapset_2(FileSet,PreLen,SufLen),
- find_hole_in_wrapset_3(lists:sort(NumberedFiles),0,[]). % Wrap-sets start at 0.
-
-find_hole_in_wrapset_2([FileName|Rest],PreLen,SufLen) ->
- [{list_to_integer(lists:sublist(FileName,PreLen+1,length(FileName)-PreLen-SufLen)),
- FileName}|
- find_hole_in_wrapset_2(Rest,PreLen,SufLen)];
-find_hole_in_wrapset_2([],_,_) ->
- [].
-
-find_hole_in_wrapset_3([{N,FileName}|Rest],N,Acc) ->
- find_hole_in_wrapset_3(Rest,N+1,[FileName|Acc]);
-find_hole_in_wrapset_3([{_,FileName}|Rest],_N,Acc) -> % FileName is the oldest one.
- [FileName|lists:map(fun({_,FN})->FN end,Rest)]++lists:reverse(Acc);
-find_hole_in_wrapset_3([],_,Acc) -> % Means all were in order.
- lists:reverse(Acc).
-%% -----------------------------------------------------------------------------
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/lib/inviso/src/inviso_tool.erl b/lib/inviso/src/inviso_tool.erl
deleted file mode 100644
index 7d3cfb9da0..0000000000
--- a/lib/inviso/src/inviso_tool.erl
+++ /dev/null
@@ -1,3255 +0,0 @@
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%% Description:
-%% The inviso_tool implementation. A tool that uses inviso.
-%%
-%% Authors:
-%% Lennart Öhman, [email protected]
-%% -----------------------------------------------------------------------------
-
--module(inviso_tool).
-
-
-%% This is the inviso tool, which is a tool using the inviso trace application.
-%% It is developed to make tracing using trace cases possible in an environment
-%% of distributed Erlang nodes.
-%% A current restriction is that the Erlang nodes are supposed to have the same
-%% code. This since inviso tool can at this point not handle subsets of nodes.
-%% Instead all participating Erlang nodes are treated the same.
-%%
-%% The main functionality of the inviso tool are:
-%%
-%% (1) Handles start and stop of tracing at participating nodes.
-%% (2) Interprets trace-case files at a distributed network level.
-%% (The inviso runtime component is responsible for interpreting
-%% trace cases at a local level, if run in an autostart).
-%% (3) Keeps a command history log from which:
-%% (a) Sequences easily can be repeated.
-%% (b) Autostart configuration files can be created (understood by the
-%% default inviso autostart mechanism).
-%% (4) Performs reactivation in case tracing is suspended (manually or by
-%% an overload mechanism).
-%% (5) Can reconnect crashed nodes and by using the history bringing them
-%% up to speed.
-
-%% Distributed Erlang
-%% ------------------
-%% Inviso is built to run in a distributed environment.
-%% The inviso tool can also be used in a non distributed environment.
-
-%% Short description
-%% -----------------
-%% Start-up of the inviso tool
-%% During the start-up of the tool, the tool starts runtime components at
-%% all participating nodes. A runtime component can already be running at
-%% a particular node and will then simply be adopted.
-%%
-%% Session
-%% A session is said to start when tracing is initiated, and ends when
-%% made to stop by the user. When a session is stopped, tracing is stopped
-%% at all participating nodes. Note that participating nodes may come and
-%% go though the time-frame of a session. That means that if a node is
-%% reconnected it may resume its tracing in the current session through
-%% a 'restart_session'. A runtime component that is already tracing at the
-%% time start-session will simply be part of the session without its
-%% ingoing tracing being changed.
-%%
-%% Reactivation
-%% A node that is suspended can be reactivated to resume tracing. Note that
-%% tracing has in this situation never been stopped at the node in question.
-%% The inviso tool resumes the node and applies the history to it.
-%%
-%% Reconnect
-%% A node that is "down" from the inviso tool's perspective can be
-%% reconnected. During reconnection the tool restarts the runtime component
-%% at that node but does not (re)initiate tracing. The latter is called
-%% restart_session and must be done explicitly, unless the node in question
-%% is in fact already tracing. If the node is already tracing (due to an autostart
-%% for instance), it automatically becomes part of the ongoing session (if
-%% there is an ongoing session).
-%%
-%% Restart Session
-%% A node that has been down and has been reconnected can be made to
-%% initialize and resume its tracing. This is done by starting the session
-%% at the node in question and redoing the current history.
-
-%% Trace files within a session
-%% Since it is possible to init-tracing (from an inviso perspective) several
-%% times within the same session, a session may leave several trace log files
-%% behind. This must be resolved by the tracer data generator function
-%% (user supplied) by marking filenames in a chronological order but still
-%% making them possible to identify as part of the same session
-
-
-
-%% -----------------------------------------------------------------------------
-%% API exports.
-%% -----------------------------------------------------------------------------
-
--export([start/0,start/1,stop/0,stop/1]).
--export([reconnect_nodes/0,reconnect_nodes/1,
- start_session/0,start_session/1,
- reinitiate_session/0,reinitiate_session/1,
- restore_session/0,restore_session/1,restore_session/2,
- stop_session/0,
- reset_nodes/0,reset_nodes/1,
- atc/3,sync_atc/3,sync_atc/4,
- sync_rtc/2,sync_rtc/3,
- dtc/2,sync_dtc/2,sync_dtc/3,
- inviso/2]).
--export([reactivate/0,reactivate/1,
- save_history/1,
- get_autostart_data/1,get_autostart_data/2,
- get_activities/0,get_node_status/0,get_node_status/1,get_session_data/0]).
--export([flush/0,flush/1]).
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% Debug exports.
-%% -----------------------------------------------------------------------------
-
--export([get_loopdata/0]).
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% OTP exports and call backs.
-%% -----------------------------------------------------------------------------
-
--export([init/1,handle_call/3,handle_cast/2,handle_info/2,terminate/2]).
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% Internal exports.
-%% -----------------------------------------------------------------------------
-
--export([tc_executer/4,reactivator_executer/6]).
--export([std_options_generator/1]).
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% Constants.
-%% -----------------------------------------------------------------------------
-
-%% Defines the inviso function calls that shall be possible to do through the
-%% inviso API in this tool.
--define(INVISO_CMDS,
- [{tp,5},{tp,4},{tp,1},{tpl,5},{tpl,4},{tpl,1},
- {ctp,1},{ctp,2},{ctp,3},{ctpl,1},{ctpl,2},{ctpl,3},
- {tf,2},{tf,1},{ctf,2},{ctf,1},{ctf_all,0},
- {init_tpm,4},{init_tpm,7},
- {tpm,4},{tpm,5},{tpm,8},
- {tpm_tracer,4},{tpm_tracer,5},{init_tpm,8},
- {tpm_ms,5},{tpm_ms_tracer,5},
- {ctpm_ms,4},{ctpm,3},
- {tpm_localnames,0},{ctpm_localnames,0},
- {tpm_globalnames,0},{ctpm_globalnames,0},
- {ctp_all,0},
- {suspend,1},{cancel_suspension,0}]).
-%% -----------------------------------------------------------------------------
-
-%% These inviso functions shall be included in the command history log. Others
-%% are not relevant to be redone during a recactivation, a restart session or
-%% exported to an autostart file.
--define(INVISO_CMD_HISTORY,
- [{tp,5},{tp,4},{tp,1},{tpl,5},{tpl,4},{tpl,1},
- {ctp,1},{ctp,2},{ctp,3},{ctpl,1},{ctpl,2},{ctpl,3},
- {tf,2},{tf,1},{ctf,2},{ctf,1},{ctf_all,0},
- {init_tpm,4},{init_tpm,7},
- {tpm,4},{tpm,5},{tpm,8},
- {tpm_tracer,4},{tpm_tracer,5},{init_tpm,8},
- {tpm_ms,5},{tpm_ms_tracer,5},
- {ctpm_ms,4},{ctpm,3},
- {tpm_localnames,0},{ctpm_localnames,0},
- {tpm_globalnames,0},{ctpm_globalnames,0},
- {ctp_all,0}]).
-%% -----------------------------------------------------------------------------
-
-%% Since many function calls to inviso may take long time, especially if they
-%% involve difficult and many trace patterns to set, the default gen_server:call
-%% time out can not be used. We just do not want to get stuck for ever if some
-%% error occurs.
--define(CALL_TIMEOUT,60000).
-
-%% Default max time to wait for a trace case called synchronously to return.
--define(SYNC_TC_TIMEOUT,10000).
-
-%% Runtime components shall terminate when the tool terminates.
--define(DEFAULT_DEPENDENCY,{dependency,0}).
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% Record definitions.
-%% -----------------------------------------------------------------------------
-
-%% The loopdata record.
--record(ld,{
- dir=".", % Working dir of the tool.
- nodes=down, % The nodesD database, defaults to non-distr.
- c_node, % Location of inviso_c.
- c_pid, % The inviso control component.
- regexp_node, % Node for regexp expansions.
- tc_dict, % Trace case definition db.
- chl, % Command history log.
- session_state=passive, % passive | tracing
- tdg={inviso_tool_lib,std_tdg,[]}, % Tracer data generator func.
- tracer_data, % Current session nr and TDGargs.
- reactivators=[], % Pids of now running reactivators.
- tc_def_file, % Trace case definition file.
- optg={?MODULE,std_options_generator,[]}, % Generates options to add_nodes/3.
- initial_tcs=[], % Initial trace cases.
- started_initial_tcs=[], % Cases that must be stopped when stop_tracing.
- history_dir, % File path for history file.
- keep_nodes=[], % Nodes that shall not be cleared when stopping.
- debug=false % Internal debug mode
- }).
-%% -----------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% API
-%% =============================================================================
-
-%% start()={ok,Pid} | {error,{already_started,pid()}}
-%% start(Config)
-%% Config=[{Opt,Value},...], list of tuple options.
-%% Opt=dir|nodes|c_node|regexp_node|tdg|tc_def_file|optg|initial_tcs|
-%% history_dir|keep_nodes
-%% Starts the inviso_tool process. Options in Config are the same as those
-%% which are kept in the #ld structure.
-start() ->
- start([]).
-start(Config) ->
- gen_server:start({local,?MODULE},?MODULE,Config,[]).
-%% -----------------------------------------------------------------------------
-
-%% stop(UntouchedNodes)=
-%% stop()={ok,NodeResults} | NodeResult | {error,Reason}
-%% UntouchedNodes=list(), nodes where any trace patterns shall not be removed.
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult=ok | {error,Reason} | patterns_untouched
-%% Stops the inviso tool and the inviso control component. Runtime components are
-%% stopped by them selves depending on their dependcy of the control component.
-%% All runtime components that are not marked as to be kept will have their
-%% trace patterns cleared before the inviso control component is shutdown.
-%% The NodeResults indicates which nodes were successfullt handled.
-stop() ->
- stop([]).
-stop(UntouchedNodes) ->
- gen_server:call(?MODULE,{stop,UntouchedNodes},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% reconnect_nodes()=NodeResult; function for the nod-distributed case.
-%% reconnect_nodes(Nodes)={ok,NodesResults}
-%% NodesResults=[{Node,NodeResult},...]
-%% NodeResult={ok,{State,Status}} | {error,NReason}
-%% State=tracing | inactive
-%% Status=running | suspended
-%% NReason=unknown_node | already_connected | down
-%% (Re)starts the inviso runtime components at Nodes. Depending on its state
-%% (new,idle or tracing) and if the tool is running a session or not, it becomes
-%% part of the tool's ongoing session. If the newly reconnected node is not
-%% tracing but the tool runs a session, the node must be reinitiated to become
-%% tracing.
-reconnect_nodes() ->
- gen_server:call(?MODULE,{reconnect_nodes,local_runtime},?CALL_TIMEOUT).
-reconnect_nodes(Node) when is_atom(Node) ->
- reconnect_nodes([Node]);
-reconnect_nodes(Nodes) when is_list(Nodes) ->
- gen_server:call(?MODULE,{reconnect_nodes,Nodes},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% start_session()={ok,{SessionNr,InvisoReturn}} | {error,Reason}
-%% start_session(MoreTDGargs)=
-%% MoreTDGargs=list(), prepended to the fixed list of args used when calling the
-%% tracer data generator function.
-%% SessionNr=integer(), trace sessions are numbered by the tool.
-%% InvisoReturn=If successful inviso call, the returnvalue from inviso.
-%% Note that individual nodes may be unsuccessful. See inviso:init_tracing/1
-%% Initiates tracing at all participating nodes.
-start_session() ->
- start_session([]).
-start_session(MoreTDGargs) ->
- gen_server:call(?MODULE,{start_session,MoreTDGargs},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% reinitiate_session(Nodes)={ok,InvisoReturn} | {error,Reason}
-%% InvisoReturn=If successful inviso call, the returnvalue from inviso:init_tracing/1.
-%% Note that individual nodes may be unsuccessful. Mentioned nodes not part
-%% of the tool or not in state inactive will be marked as failing by the
-%% tool in the InvisoReturn.
-%% To reinitate a node means to (inviso) init tracing at it according to saved
-%% tracer data generator arguments for the current session and then redo the current
-%% history to bring it up to speed. Note that the tool must be running a session
-%% for reinitiate to work.
-reinitiate_session() ->
- gen_server:call(?MODULE,{reinitiate_session,local_runtime},?CALL_TIMEOUT).
-reinitiate_session(Nodes) ->
- gen_server:call(?MODULE,{reinitiate_session,Nodes},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% restore_session()=
-%% restore_session(MoreTDGargs)=
-%% restore_session(FileName)=
-%% restore_session(FileName,MoreTDGargs)={ok,{SessionNr,InvisoReturn}} | {error,Reason}
-%% The two first clauses will start a new session using the last history. This
-%% implies that there must have been a session running prior.
-%% The two last clauses starts a session and reads a history file and executes the
-%% tracecases in it at all inactive nodes.
-%% In both cases the reused or read history becomes the current histoy, just if the
-%% session had been initiated manually. The tool may not
-%% have a session ongoing, and nodes already tracing (nodes which were adopted)
-%% are not effected. Just like when starting a session manually.
-restore_session() ->
- restore_session([]).
-restore_session([]) -> % This cant be a filename.
- gen_server:call(?MODULE,{restore_session,[]},?CALL_TIMEOUT);
-restore_session(FileNameOrMoreTDGargs) ->
- case is_string(FileNameOrMoreTDGargs) of
- true -> % Interpret it as a filename.
- restore_session(FileNameOrMoreTDGargs,[]);
- false -> % The we want to use last session history!
- gen_server:call(?MODULE,{restore_session,FileNameOrMoreTDGargs},?CALL_TIMEOUT)
- end.
-restore_session(FileName,MoreTDGargs) ->
- gen_server:call(?MODULE,{restore_session,{FileName,MoreTDGargs}},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% stop_session()={ok,{SessionNr,Result}} | {error,Reason}
-%% SessionNr=integer()
-%% Result=[{Node,NodeResult},...] | NonDistributedNodeResult
-%% NodeResult=ok | {error,Reason}
-%% NonDistributedNodeResult=[ok] | []
-%% Stops inviso tracing at all participating nodes. The inviso runtime components
-%% will go to state idle. It is now time to fetch the logfiles. Will most often
-%% succeed. Will only return an error if the entire inviso call returned an
-%% error. Not if an individual node failed stop tracing successfully.
-%% Any running trace case, including reactivator processes will be terminated.
-stop_session() ->
- gen_server:call(?MODULE,stop_session,?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% reset_nodes()=NodeResult | {error,Reason}
-%% reset_nodes(Nodes)={ok,NodeResults} | {error,Reason}
-%% NodeResults and NodeResult as returned by inviso:clear/1 and /0.
-%% Clear nodes from trace flags, trace patterns and meta trace patterns. The tool
-%% must not be having a running session.
-reset_nodes() ->
- gen_server:call(?MODULE,{reset_nodes,local_runtime},?CALL_TIMEOUT).
-reset_nodes(Nodes) ->
- gen_server:call(?MODULE,{reset_nodes,Nodes},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% atc(TC,Id,Vars)=ok | {error,Reason}
-%% TC=atom(), name of the trace case.
-%% Id=term(), given name of this usage of TC.
-%% Vars=list(), list of variable bindings [{Var,Value},...], Var=atom(),Value=term().
-%% Function activating a trace case. The trace case must be defined in the
-%% trace case dictionary. The 'ok' return value is only a signal that the
-%% trace case has started successfully. It may then run for as long as it is
-%% programmed to run. An erroneous return value does not necessarily mean that
-%% the trace case has not been executed. It rather means that is undetermined
-%% what happend.
-atc(TC,Id,Vars) ->
- gen_server:call(?MODULE,{atc,{TC,Id,Vars}},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% sync_atc(TC,Id,Vars)=Result | {error,Reason}
-%% sync_atc(TC,Id,Vars,TimeOut)=
-%% Result=term(), what ever is returned be the last expression in the trace case.
-%% TimeOut=interger() | infinity, the max wait time for the trace case to finnish.
-%% As atc/3 but waits for the trace case to finish.
-sync_atc(TC,Id,Vars) ->
- gen_server:call(?MODULE,{sync_atc,{TC,Id,Vars,?SYNC_TC_TIMEOUT}},?CALL_TIMEOUT).
-sync_atc(TC,Id,Vars,TimeOut) ->
- gen_server:call(?MODULE,{sync_atc,{TC,Id,Vars,TimeOut}},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% sync_rtc(TC,Vars)=Result | {error,Reason}
-%% sync_rtc(TC,Vars,TimeOut)=
-%% Result=term(), what ever is returned be the last expression in the trace case.
-%% TimeOut=interger() | infinity, the max wait time for the trace case to finnish.
-%% As sync_atc/3 but the trace case is not marked as activated. It is mearly placed
-%% in the history. Hence with sync_rtc a trace case can be "activated" multiple time.
-sync_rtc(TC,Vars) ->
- gen_server:call(?MODULE,{sync_rtc,{TC,Vars,?SYNC_TC_TIMEOUT}},?CALL_TIMEOUT).
-sync_rtc(TC,Vars,TimeOut) ->
- gen_server:call(?MODULE,{sync_rtc,{TC,Vars,TimeOut}},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% dtc(TC,Id)=ok | {error,Reason}
-%% Deactivates a previosly activated trace case. This function can only be used
-%% on trace cases that has a deactivation defined in the trace case dictionary.
-%% There is of course really no difference between a file containing an activation
-%% compared to a deactivation. But to be able cancelling activations out from the
-%% history log, a defined deactivation is essential.
-%% As with activation, the returned 'ok' simply indicates the start of the trace
-%% case.
-dtc(TC,Id) ->
- gen_server:call(?MODULE,{dtc,{TC,Id}},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% sync_dtc(TC,Id)=Result | {error,Reason}
-%% sync_dtc(TC,Id,TimeOut)=
-%% Synchronous deactivation of trace case. See dtc/2 and sync_atc/3 for
-%% parameters.
-sync_dtc(TC,Id) ->
- gen_server:call(?MODULE,{sync_dtc,{TC,Id,?SYNC_TC_TIMEOUT}},?CALL_TIMEOUT).
-sync_dtc(TC,Id,TimeOut) ->
- gen_server:call(?MODULE,{sync_dtc,{TC,Id,TimeOut}},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% inviso(Cmd,Args)=Result
-%% Cmd=atom(), the (inviso) function name that shall be called.
-%% Args=list(), the arguments to Cmd.
-%% Result=term(), the result from the inviso function call.
-%% This function executes a Cmd in the inviso tool context. The inviso call will
-%% be logged in history log and thereby repeated in case of a reactivation.
-%% Note that this function is intended for use with inviso function API without
-%% specifying any nodes, since the function call is supposed to be carried out on
-%% all nodes.
-%% When these functions are written to an autostart config file by the tool there
-%% is supposed to be a translation to inviso_rt functions.
-inviso(Cmd,Args) ->
- gen_server:call(?MODULE,{inviso,{Cmd,Args}},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% reactivate()=ok | {error,Reason}
-%% reactivate(Node)=ok | {error,Reason}
-%% Moves a runtime component from suspended to the state running. This can be
-%% done for both tracing and inactive nodes. The later is necessary since you
-%% may have stopped tracing with a node suspended.
-%% In case the node is tracing, commands in the command history log are redone at
-%% the node in questions.
-%% Note that this function returns 'ok' before the node is running. This because the
-%% the reactivated history is done by a separate process and there is no guarantee
-%% when it will be ready. The reactivated node will not be marked as running in
-%% the tool until done reactivating.
-%% Further it is important to understand that if there are "ongoing" tracecases
-%% (i.e tracecase scripts that are currently executing) and this node was running
-%% at the time that tracecase script started to execute, the list of nodes bound
-%% to the Nodes variable in that script executer includes this node. Making it
-%% no longer suspended makes it start executing inviso commands from where ever
-%% such are called. Hence the reactivation may be interferred by that tracecase.
-reactivate() -> % Non-distributed API.
- reactivate(node()).
-reactivate(Node) ->
- gen_server:call(?MODULE,{reactivate,Node},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% save_history(FileName)={ok,AbsFileName} | {error,Reason}
-%% Saves the currently collected command history log to a file. The file will
-%% be a binary-file. If FileName is an absolute path, it will be saved to that
-%% file. Otherwise the history dir will be used. If no history dir was specified
-%% the tool dir will be used, prepended to FileName.
-save_history(FileName) ->
- gen_server:call(?MODULE,{save_history,FileName},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% get_autostart_data(Nodes,Dependency)={ok,{AutoStartData,NodeResults} |
-%% {ok,{AutoStartData,NodeResult}} | {error,Reason}
-%% Dependency=inviso dependency parameter which will be used for every
-%% autostarted runtime component (included in Options).
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult={ok,{Options,{tdg,{M,F,CompleteTDGargs}}}} | {error,Reason}
-%% Options=add_nodes options to the inviso runtime component.
-%% M,F=atom(), the module and function for tracerdata generation.
-%% CompleteTDGargs=list(), all arguments as they are given to the tracer
-%% data generator function.
-%% AutostartData=[CaseSpec,...]
-%% CaseSpec={file,{FileName,Bindings}} | {mfa,{M,F,Args}}
-%% FileName=string(), pointing out the trace case file. Note that this
-%% is the same as the path used by the tool.
-%% Bindings=Var bindings used according to the history for the
-%% invocation.
-%% M,F=atom(), the function that shall be called (normally some inviso).
-%% Args=list(), the actual arguments. Note that this may contain things
-%% which can not be written to file (ports, pids,...).
-%% Function returning information on how to autostart a node to make it trace
-%% according to the current history. The inviso_tool does not know how to write
-%% the necessary files at the nodes in question. That must be done by the user
-%% of the tool, guided by the return value from this function.
-%% Note that there will be two types of trace case files. Regular trace case
-%% files and binaries returned from this function. The latter contains the
-%% inviso commands which have been executed. Note that the order amongst the
-%% trace cases and binaries is of importance (otherwise they will be redone in
-%% an incorrect order).
-get_autostart_data(Dependency) ->
- gen_server:call(?MODULE,{get_autostart_data,Dependency},?CALL_TIMEOUT).
-get_autostart_data(Nodes,Dependency) ->
- gen_server:call(?MODULE,{get_autostart_data,{Nodes,Dependency}},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% get_activities()={ok,Ongoing} | {error,Reason}
-%% Ongoing=list(); [ [TraceCases] [,Reactivators] ]
-%% TraceCases={tracecases,TraceCaseList}
-%% TraceCaseList=[{{TCname,Id},Phase},...]
-%% Phase=activating | deactivating
-%% Reactivators={reactivating_nodes,ReactivatingNodes}
-%% ReactivatingNodes=[Node,...]
-%% Returns a list of assynchronous tracecases and nodes doing reactivation at
-%% this momement. This can be useful to implement "home brewn" synchronization,
-%% waiting for the runtime components to reach a certain state.
-get_activities() ->
- gen_server:call(?MODULE,get_activities,?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% get_status(Node)={ok,StateStatus} | {error,Reason}
-%% StateStatus={State,Status} | reactivating | down
-%% State=tracing | inactive | trace_failure
-%% Status=running | suspended
-get_node_status() ->
- get_node_status(local_runtime).
-get_node_status(Node) ->
- gen_server:call(?MODULE,{get_node_status,Node},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% get_session_data()={ok,{Status,SessionNr,TDGargs}} | {error,Reason}
-%% Status=tracing | not_tracing, info about current/last session.
-%% SessionNr=integer()
-%% TDGargs=list(), list of the arguments that will be given to the tracer data
-%% generator function (not including the leading Nodes list).
-%% Returns data about the current or last session.
-get_session_data() ->
- gen_server:call(?MODULE,get_session_data,?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% flush()={ok,NodeResults} | NodeResult | {error,Reason}
-%% flush(Nodes)={ok,NodesResults} | {error,Reason}
-%% NodeResults=[{Node,NodeResult},...]
-%% NodeResult=ok | {error,Reason}
-%% Makes runtime components flush their trace ports.
-flush() ->
- gen_server:call(?MODULE,flush,?CALL_TIMEOUT).
-flush(Nodes) ->
- gen_server:call(?MODULE,{flush,Nodes},?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% get_loopdata()=#ld
-%% Debug API returning the internal loopdata structure. See #ld above for details.
-get_loopdata() ->
- gen_server:call(?MODULE,get_loopdata,?CALL_TIMEOUT).
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% Internal APIs.
-%% -----------------------------------------------------------------------------
-
-%% tc_executer_reply(To,Reply)=nothing significant
-%% To=pid()
-%% Reply=term()
-%% Internal API used by a trace case executer process to signal its completion.
-tc_executer_reply(To,Reply) ->
- gen_server:cast(To,{tc_executer_reply,Reply}).
-%% -----------------------------------------------------------------------------
-
-%% Internal API used by a reactivator process indicating it is done with the
-%% history log it has got so far.
-%% Timeout set to infinity since the tool may be busy, then the reactivator just
-%% have to wait. If the tool crashes the reactivator will be go down too automatically.
-reactivator_reply(TPid,Counter) ->
- gen_server:call(TPid,{reactivator_reply,{Counter,self()}},infinity).
-%% -----------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% gen_server implementation.
-%% =============================================================================
-
-init(Config) ->
- case fetch_configuration(Config) of % From conf-file and Config.
- {ok,LD} when is_record(LD,ld) ->
- case start_inviso_at_c_node(LD) of
- {ok,CPid} ->
- LD2=start_runtime_components(LD),
- LD3=read_trace_case_definitions(LD2),
- process_flag(trap_exit,true),
- start_subscribe_inviso_events(LD3#ld.c_node),
- {ok,LD3#ld{c_pid=CPid}};
- {error,Reason} -> % Most likely already running.
- {stop,{error,Reason}}
- end;
- {error,Reason} ->
- {stop,{error,{start_up,Reason}}}
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function starting the inviso control component at node c_node, or "here"
-%% if it is not a distributed network.
-start_inviso_at_c_node(#ld{c_node=undefined}) -> % Non distributed case.
- case inviso:start() of
- {ok,Pid} ->
- {ok,Pid};
- {error,Reason} ->
- {error,Reason}
- end;
-start_inviso_at_c_node(#ld{c_node=CNode}) ->
- case rpc:call(CNode,inviso,start,[]) of
- {ok,Pid} ->
- {ok,Pid};
- {error,{already_started,_}} -> % A control component already started.
- {error,{inviso_control_already_running,CNode}};
- {error,Reason} ->
- {error,Reason};
- {badrpc,Reason} ->
- {error,{inviso_control_node_error,Reason}}
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function starting the runtime components at all particapting nodes.
-%% It also updates the nodes structure in the #ld to indicate which nodes where
-%% successfully started. Returns a new #ld.
-%% Note that a runtime component may actually be running at one or several nodes.
-%% This is supposed to be the result of an (wanted) autostart. Meaning that the
-%% inviso tool can not handle the situation if a runtime component is not doing
-%% what it is supposed to do. In case a runtime component is already running it
-%% will be adopted and therefore marked as running.
-start_runtime_components(LD=#ld{c_node=undefined}) ->
- start_runtime_components_2(local_runtime,undefined,LD);
-start_runtime_components(LD=#ld{c_node=CNode,nodes=NodesD}) ->
- start_runtime_components_2(get_all_nodenames_nodes(NodesD),CNode,LD).
-start_runtime_components(Nodes,LD=#ld{c_node=CNode}) ->
- start_runtime_components_2(Nodes,CNode,LD).
-
-start_runtime_components_2(local_runtime,CNode,LD=#ld{optg=OptG}) ->
- Opts=start_runtime_components_mk_opts(local_runtime,OptG),
- case inviso:add_node(mk_rt_tag(),Opts) of
- {ok,NAnsw} -> % Should be more clever really!
- NewNodesD=update_added_nodes(CNode,{ok,NAnsw},LD#ld.nodes),
- LD#ld{nodes=NewNodesD};
- {error,_Reason} ->
- LD
- end;
-start_runtime_components_2([Node|Rest],CNode,LD=#ld{optg=OptG}) ->
- Opts=start_runtime_components_mk_opts(Node,OptG),
- case rpc:call(CNode,inviso,add_nodes,[[Node],mk_rt_tag(),Opts]) of
- {ok,NodeResults} ->
- NewNodesD=update_added_nodes(CNode,NodeResults,LD#ld.nodes),
- start_runtime_components_2(Rest,CNode,LD#ld{nodes=NewNodesD});
- {error,_Reason} ->
- start_runtime_components_2(Rest,CNode,LD);
- {badrpc,_Reason} ->
- start_runtime_components_2(Rest,CNode,LD)
- end;
-start_runtime_components_2([],_,LD) ->
- LD.
-
-start_runtime_components_mk_opts(Node,{M,F,Args}) ->
- case catch apply(M,F,[Node|Args]) of
- {ok,Opts} when is_list(Opts) ->
- start_runtime_component_mk_opts_add_dependency(Opts);
- _ ->
- [?DEFAULT_DEPENDENCY]
- end.
-
-%% The options generator is not supposed to generate the dependency. Hence this
-%% function adds and if necessary removes an incorrectly added dependency tag.
-start_runtime_component_mk_opts_add_dependency(Opts) ->
- case lists:keysearch(dependency,1,Opts) of
- {value,_} -> % Not allowed!!!
- [?DEFAULT_DEPENDENCY|lists:keydelete(dependecy,1,Opts)];
- false ->
- [?DEFAULT_DEPENDENCY|Opts]
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function subscribing to inviso events from the inviso controller. This
-%% will make it possible to follow runtime components going down.
-start_subscribe_inviso_events(undefined) ->
- inviso:subscribe();
-start_subscribe_inviso_events(CNode) ->
- rpc:call(CNode,inviso,subscribe,[self()]). % Don't want the rpc-proc to subscribe!
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% gen_server handle call back functions.
-%% -----------------------------------------------------------------------------
-
-handle_call({stop,UntouchedNodes},_From,LD=#ld{nodes=NodesD,c_node=CNode,keep_nodes=KeepNodes})
- when is_list(UntouchedNodes) ->
- {stop,
- normal,
- remove_all_trace_patterns(CNode,
- UntouchedNodes++KeepNodes,
- get_available_nodes(NodesD)),
- LD};
-handle_call({stop,BadArg},_From,LD) ->
- {reply,{error,{badarg,BadArg}},LD};
-
-handle_call({reconnect_nodes,Nodes},_From,LD) ->
- case h_reconnect_nodes(Nodes,LD) of
- {ok,{Nodes2,NodesErr,NewLD}} ->
- if
- Nodes==local_runtime ->
- {reply,
- build_reconnect_nodes_reply(Nodes,Nodes2,NodesErr,NewLD#ld.nodes),
- NewLD};
- is_list(Nodes) ->
- {reply,
- {ok,build_reconnect_nodes_reply(Nodes,Nodes2,NodesErr,NewLD#ld.nodes)},
- NewLD}
- end;
- {error,Reason} ->
- {reply,{error,Reason},LD}
- end;
-
-handle_call({start_session,MoreTDGargs},_From,LD=#ld{session_state=SState}) ->
- case is_tracing(SState) of
- false -> % No session running.
- if
- is_list(MoreTDGargs) ->
- DateTime=calendar:universal_time(),
- {M,F,Args}=LD#ld.tdg,
- TDGargs=inviso_tool_lib:mk_tdg_args(DateTime,MoreTDGargs++Args),
- case h_start_session(M,F,TDGargs,LD) of
- {ok,{SessionNr,ReturnVal,NewLD}} -> % No nodes to initiate.
- NewLD2=add_initial_tcs_to_history(NewLD#ld.initial_tcs,
- NewLD#ld{chl=mk_chl(LD#ld.chl)}),
- {reply,
- {ok,{SessionNr,ReturnVal}},
- NewLD2#ld{session_state=tracing_sessionstate()}};
- {ok,{SessionNr,ReturnVal,Nodes2,NewLD}} ->
- NewLD2=do_initial_tcs(NewLD#ld.initial_tcs,
- Nodes2,
- NewLD#ld{chl=mk_chl(LD#ld.chl)}),
- {reply,
- {ok,{SessionNr,ReturnVal}},
- NewLD2#ld{session_state=tracing_sessionstate()}};
- {error,Reason} ->
- {reply,{error,Reason},LD}
- end;
- true -> % Faulty TDGargs.
- {reply,{error,{badarg,MoreTDGargs}},LD}
- end;
- true ->
- {reply,{error,session_already_started},LD}
- end;
-
-handle_call({reinitiate_session,Nodes},_From,LD=#ld{session_state=SState}) ->
- case is_tracing(SState) of
- true -> % The tool must be tracing.
- {M,F,_Args}=LD#ld.tdg,
- TDGargs=get_latest_tdgargs_tracer_data(LD#ld.tracer_data),
- case h_reinitiate_session(Nodes,M,F,TDGargs,LD) of
- {ok,{NodesErr,ReturnVal,NewLD}} ->
- {reply,
- {ok,build_reinitiate_session_reply(Nodes,NodesErr,ReturnVal)},
- NewLD};
- {error,Reason} ->
- {reply,{error,Reason},LD}
- end;
- false -> % Must have a running session!
- {reply,{error,no_session},LD}
- end;
-
-handle_call({restore_session,{FileName,MoreTDGargs}},_From,LD=#ld{chl=OldCHL})
- when is_list(MoreTDGargs) ->
- case is_tracing(LD#ld.session_state) of
- false ->
- case catch make_absolute_path(FileName,LD#ld.dir) of
- AbsFileName when is_list(AbsFileName) ->
- case file:read_file(AbsFileName) of
- {ok,Bin} ->
- if
- is_list(MoreTDGargs) ->
- case catch replace_history_chl(OldCHL,
- binary_to_term(Bin)) of
- {ok,CHL} -> % The file was well formatted.
- case h_restore_session(MoreTDGargs,
- LD#ld{chl=CHL}) of
- {ok,{SessionNr,ReturnVal,NewLD}} ->
- {reply,
- {ok,{SessionNr,ReturnVal}},
- NewLD#ld{session_state=
- tracing_sessionstate()}};
- {error,Reason} ->
- {reply,{error,Reason},LD}
- end;
- Error -> % Badly formatted file.
- {reply,
- {error,{bad_file,{AbsFileName,Error}}},
- LD}
- end;
- true ->
- {reply,{error,{badarg,MoreTDGargs}},LD}
- end;
- {error,Reason} ->
- {reply,{error,{read_file,Reason}},LD}
- end;
- Error ->
- {reply,{error,{bad_filename,{FileName,Error}}},LD}
- end;
- true ->
- {reply,{error,session_already_started},LD}
- end;
-%% This is doing restore session on the current history.
-handle_call({restore_session,MoreTDGargs},_From,LD=#ld{chl=CHL}) ->
- case is_tracing(LD#ld.session_state) of
- false ->
- case history_exists_chl(CHL) of
- true -> % There is a history to redo.
- if
- is_list(MoreTDGargs) ->
- case h_restore_session(MoreTDGargs,LD) of
- {ok,{SessionNr,ReturnVal,NewLD}} ->
- {reply,
- {ok,{SessionNr,ReturnVal}},
- NewLD#ld{session_state=tracing_sessionstate()}};
- {error,Reason} ->
- {reply,{error,Reason},LD}
- end;
- true ->
- {reply,{error,{badarg,MoreTDGargs}},LD}
- end;
- false ->
- {reply,{error,no_history},LD}
- end;
- true ->
- {reply,{error,session_already_started},LD}
- end;
-
-%% To stop tracing means stop_tracing through the inviso API. But we must also
-%% remove any help processes executing inviso commands (trace case executers
-%% and reactivators).
-%% Note that to be really sure we should actually wait for EXIT-signals from those
-%% processes before returning a successful returnvalue to the caller. In theory
-%% those processes could issue an inviso call effecting a new trace session started
-%% with init_tracing shortly after the call to stop_tracing. But too complicated! :-)
-%% Further, stop-tracing is done on all nodes in our nodes structure. Regardless
-%% if the node is tracing or not
-handle_call(stop_session,_From,LD=#ld{session_state=SState,chl=CHL,reactivators=ReAct}) ->
- case is_tracing(SState) of
- true ->
- NewCHL=stop_all_tc_executer_chl(CHL), % Stop any running trace case proc.
- NewReAct=stop_all_reactivators(ReAct), % Stop any running reactivators.
- case h_stop_session(LD) of
- {ok,{SessionNr,Result}} ->
- NewNodesD=set_inactive_nodes(Result,LD#ld.nodes),
- {reply,
- {ok,{SessionNr,Result}},
- LD#ld{session_state=passive_sessionstate(),
- nodes=NewNodesD,
- chl=NewCHL,
- reactivators=NewReAct,
- started_initial_tcs=[]}};
- {error,Reason} -> % Now we're really in deep shit :-)
- {reply,{error,{unrecoverable,Reason}},LD}
- end;
- false ->
- {reply,{error,no_session},LD}
- end;
-
-handle_call({reset_nodes,Nodes},_From,LD=#ld{session_state=SState}) ->
- case is_tracing(SState) of
- false -> % We can not be in a session.
- {reply,h_reset_nodes(Nodes,LD#ld.c_node),LD};
- true ->
- {reply,{error,session_active},LD}
- end;
-
-%% Calling a trace-case, or "turning it on".
-handle_call({atc,{TC,Id,Vars}},_From,LD=#ld{session_state=SState}) ->
- case is_tracing(SState) of % Check that we are tracing now.
- true ->
- case h_atc(TC,Id,Vars,LD) of
- {ok,NewLD} -> % Trace case executed.
- {reply,ok,NewLD};
- {error,Reason} ->
- {reply,{error,Reason},LD}
- end;
- false -> % Can't activate if not tracing.
- {reply,{error,no_session},LD}
- end;
-
-handle_call({sync_atc,{TC,Id,Vars,TimeOut}},_From,LD=#ld{session_state=SState}) ->
- case is_tracing(SState) of
- true ->
- if
- is_integer(TimeOut);TimeOut==infinity ->
- case h_sync_atc(TC,Id,Vars,TimeOut,LD) of
- {ok,NewLD,Result} ->
- {reply,Result,NewLD};
- {error,Reason} ->
- {reply,{error,Reason},LD}
- end;
- true ->
- {reply,{error,{badarg,TimeOut}},LD}
- end;
- false ->
- {reply,{error,no_session},LD}
- end;
-
-handle_call({sync_rtc,{TC,Vars,TimeOut}},_From,LD=#ld{session_state=SState}) ->
- case is_tracing(SState) of
- true ->
- if
- is_integer(TimeOut);TimeOut==infinity ->
- case h_sync_rtc(TC,Vars,TimeOut,LD) of
- {ok,NewLD,Result} ->
- {reply,Result,NewLD};
- {error,Reason} ->
- {reply,{error,Reason},LD}
- end;
- true ->
- {reply,{error,{badarg,TimeOut}},LD}
- end;
- false ->
- {reply,{error,no_session},LD}
- end;
-
-
-handle_call({dtc,{TC,Id}},_From,LD=#ld{session_state=SState}) ->
- case is_tracing(SState) of % Check that we are tracing now.
- true ->
- case h_dtc(TC,Id,LD) of
- {ok,NewLD} ->
- {reply,ok,NewLD};
- {error,Reason} ->
- {reply,{error,Reason},LD}
- end;
- false -> % Can't activate if not tracing.
- {reply,{error,no_session},LD}
- end;
-
-handle_call({sync_dtc,{TC,Id,TimeOut}},_From,LD=#ld{session_state=SState}) ->
- case is_tracing(SState) of % Check that we are tracing now.
- true ->
- if
- is_integer(TimeOut);TimeOut==infinity ->
- case h_sync_dtc(TC,Id,TimeOut,LD) of
- {ok,NewLD,Result} ->
- {reply,Result,NewLD};
- {error,Reason} ->
- {reply,{error,Reason},LD}
- end;
- true ->
- {reply,{error,{badarg,TimeOut}},LD}
- end;
- false -> % Can't activate if not tracing.
- {reply,{error,no_session},LD}
- end;
-
-handle_call({inviso,{Cmd,Args}},_From,LD=#ld{session_state=SState}) ->
- case is_tracing(SState) of
- true ->
- if
- is_list(Args) ->
- case h_inviso(Cmd,Args,LD) of
- {ok,{Reply,NewLD}} ->
- {reply,Reply,NewLD};
- {error,Reason} ->
- {reply,{error,Reason},LD}
- end;
- true ->
- {reply,{error,{badarg,Args}},LD}
- end;
- false -> % Can't do if not tracing.
- {reply,{error,no_session},LD}
- end;
-
-handle_call({reactivate,Node},_From,LD=#ld{nodes=NodesD,c_node=CNode}) ->
- case get_state_nodes(Node,NodesD) of
- {trace_failure,_} ->
- {reply,{error,trace_failure},LD};
- {State,suspended} -> % The node is infact suspended.
- case h_reactivate(Node,CNode) of
- ok ->
- case {State,is_tracing(LD#ld.session_state)} of
- {tracing,true} -> % Only then shall we redo cmds.
- {reply,ok,redo_cmd_history(Node,LD)};
- _ -> % All other just no longer suspended.
- {reply,ok,LD#ld{nodes=set_running_nodes(Node,NodesD)}}
- end;
- {error,Reason} ->
- {reply,{error,Reason},LD}
- end;
- reactivating ->
- {reply,{error,reactivating},LD};
- {_,running} ->
- {reply,{error,already_running},LD};
- down ->
- {reply,{error,not_available},LD};
- false ->
- {reply,{error,unknown_node},LD}
- end;
-
-handle_call({save_history,FileName},_From,LD=#ld{chl=CHL,dir=Dir,history_dir=HDir}) ->
- case lists:keysort(2,get_loglist_chl(CHL)) of
- [] -> % Empty history or no history.
- {reply,{error,no_history},LD};
- Log ->
- case h_save_history(HDir,Dir,FileName,Log) of
- {ok,AbsFileName} ->
- {reply,{ok,AbsFileName},LD};
- {error,Reason} ->
- {reply,{error,Reason},LD}
- end
- end;
-
-handle_call({get_autostart_data,{Nodes,Dependency}},_From,LD=#ld{chl=CHL}) ->
- {ok,ASD} = build_autostart_data(lists:keysort(2,get_loglist_chl(CHL)),LD#ld.tc_dict),
- TDGargs=get_latest_tdgargs_tracer_data(LD#ld.tracer_data),
- {M,F,_}=LD#ld.tdg,
- OptsG=LD#ld.optg, % Addnodes options generator.
- {reply,
- h_get_autostart_data(Nodes,LD#ld.c_node,Dependency,ASD,M,F,TDGargs,OptsG),
- LD};
-
-handle_call({get_autostart_data,Dependency},From,LD=#ld{c_node=undefined}) ->
- handle_call({get_autostart_data,{local_runtime,Dependency}},From,LD);
-handle_call({get_autostart_data,Dependency},From,LD=#ld{nodes=NodesD}) ->
- Nodes=get_all_nodenames_nodes(NodesD),
- handle_call({get_autostart_data,{local_runtime,{Nodes,Dependency}}},From,LD);
-
-handle_call(get_activities,_From,LD=#ld{chl=CHL,reactivators=Reactivators}) ->
- TraceCases=get_ongoing_chl(CHL),
- RNodes=get_all_nodes_reactivators(Reactivators),
- ReturnList1=
- if
- TraceCases==[] ->
- [];
- true ->
- [{tracecases,TraceCases}]
- end,
- ReturnList2=
- if
- RNodes==[] ->
- ReturnList1;
- true ->
- [{reactivating_nodes,RNodes}|ReturnList1]
- end,
- {reply,{ok,ReturnList2},LD};
-
-handle_call({get_node_status,Node},_Node,LD) ->
- case get_state_nodes(Node,LD#ld.nodes) of
- false ->
- {reply,{error,unknown_node},LD};
- StateStatus ->
- {reply,{ok,StateStatus},LD}
- end;
-
-handle_call(get_session_data,_From,LD=#ld{session_state=SState,tracer_data=TD}) ->
- case get_latest_session_nr_tracer_data(TD) of
- undefined ->
- {reply,{error,no_session},LD};
- SessionNr ->
- TDGargs=get_latest_tdgargs_tracer_data(TD),
- case is_tracing(SState) of
- true ->
- {reply,{ok,{tracing,SessionNr,TDGargs}},LD};
- false ->
- {reply,{ok,{not_tracing,SessionNr,TDGargs}},LD}
- end
- end;
-
-handle_call(flush,_From,LD=#ld{c_node=CNode,nodes=NodesD}) ->
- Nodes=get_tracing_nodes(NodesD),
- {reply,h_flush(CNode,Nodes),LD};
-handle_call({flush,Nodes},_From,LD=#ld{c_node=CNode}) ->
- {reply,h_flush(CNode,Nodes),LD};
-
-handle_call(get_loopdata,_From,LD) ->
- {reply,LD,LD};
-
-%% Internal handle_call callbacks.
-
-handle_call({reactivator_reply,{Counter,RPid}},_From,LD=#ld{chl=CHL}) ->
- HighestUsedCounter=get_highest_used_counter_chl(CHL),
- if
- HighestUsedCounter>Counter -> % There are now more log entries.
- NewUnsortedLog=get_loglist_chl(CHL),
- {reply,{more,NewUnsortedLog},LD};
- true -> % No Counter is youngest log entry.
- NodesD=LD#ld.nodes,
- Node=get_node_reactivators(RPid,LD#ld.reactivators),
- {reply,
- done,
- LD#ld{nodes=set_running_nodes(Node,NodesD),
- reactivators=del_reactivators(RPid,LD#ld.reactivators)}}
- end.
-%% -----------------------------------------------------------------------------
-
-%% Handling a notification from a trace case execution process. Receiving this
-%% indicated that this phase of the trace case is finnished.
-handle_cast({tc_executer_reply,{Phase,ProcH,Result}},LD) ->
- case Phase of
- activating -> % The trace case is running now.
- {ok,NewLD}=h_tc_activation_done(ProcH,Result,LD),
- {noreply,NewLD};
- stopping ->
- {ok,NewLD}=h_tc_stopping_done(ProcH,Result,LD),
- {noreply,NewLD};
- _ ->
- {noreply,LD}
- end;
-handle_cast(_,LD) ->
- {noreply,LD}.
-%% -----------------------------------------------------------------------------
-
-%% This is the case when a runtime component goes down. We stop all running
-%% reactivators for this node. Note that there can also be tracecases ongoing
-%% where this node is part of the Nodes variable. But there is not much we can
-%% do about that. Other then informing the user that it is unwise to reconnect
-%% this node before those tracecases have stopped being ongoing.
-handle_info({inviso_event,_CNode,_Time,{disconnected,Node,_}},LD) ->
- {noreply,LD#ld{nodes=set_down_nodes(Node,LD#ld.nodes),
- reactivators=stop_node_reactivators(Node,LD#ld.reactivators)}};
-
-%% This is the case when a runtime component gets suspended. Much of the same
-%% problem as described above applies.
-handle_info({inviso_event,_CNode,_Time,{state_change,Node,{_,{suspended,_}}}},LD) ->
- {noreply,LD#ld{nodes=set_suspended_nodes(Node,LD#ld.nodes),
- reactivators=stop_node_reactivators(Node,LD#ld.reactivators)}};
-
-handle_info(_,LD) ->
- {noreply,LD}.
-%% -----------------------------------------------------------------------------
-
-%% Called when the tool server stops. First clause, termination is initiated by
-%% our self and therefore controlled another way. In the second case we are
-%% stopping for some external reason, and we must then do more here in terminate/2.
-terminate(normal,#ld{c_node=CNode}) -> % This is when we are stopping our self.
- stop_inviso_at_c_node(CNode);
-terminate(_,#ld{c_node=CNode,nodes=NodesD,keep_nodes=KeepNodes}) ->
- remove_all_trace_patterns(CNode,KeepNodes,get_all_nodenames_nodes(NodesD)),
- stop_inviso_at_c_node(CNode).
-%% -----------------------------------------------------------------------------
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%% =============================================================================
-%% Handler first level help functions.
-%% =============================================================================
-
-%% -----------------------------------------------------------------------------
-%% reconnect_nodes
-%% -----------------------------------------------------------------------------
-
-%% Help function reconnecting the nodes in Nodes. Listed nodes must be part of
-%% the set of nodes handled by the tool. It is not possible to reconnect a node
-%% that is not marked as down. This partly because we otherwise risk losing the
-%% trace_failure state (which can not be rediscovered).
-h_reconnect_nodes(local_runtime,LD=#ld{nodes=NodesD}) -> % Non-distributed.
- case get_state_nodes(local_runtime,NodesD) of
- down ->
- {ok,{local_runtime,[],start_runtime_components(local_runtime,LD)}};
- _ -> % Allready connected!
- {ok,{[],{error,already_connected},LD}}
- end;
-h_reconnect_nodes(Nodes,LD=#ld{nodes=NodesD}) when is_list(Nodes) ->
- {Nodes2,NodesErr}=
- lists:foldl(fun(N,{Nodes2,NodesErr})->
- case get_state_nodes(N,NodesD) of
- down -> % Yes this node can be reconnected.
- {[N|Nodes2],NodesErr};
- false -> % Not part of the node-set!
- {Nodes2,[{N,{error,unknown_node}}|NodesErr]};
- _ -> % Allready connected!
- {Nodes2,[{N,{error,already_connected}}|NodesErr]}
- end
- end,
- {[],[]},
- Nodes),
- LD2=start_runtime_components(Nodes2,LD), % Inpect the #ld.nodes for result.
- {ok,{Nodes2,NodesErr,LD2}};
-h_reconnect_nodes(Nodes,_LD) ->
- {error,{badarg,Nodes}}.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% start_session
-%% -----------------------------------------------------------------------------
-
-%% Help function starting the tracing at all nodes. Note that the tracer data
-%% is calculated using a user defined function. This is how for instance the
-%% file names (of the log files) are determined.
-%% Before the nodes are initiated their (possibly remaining) trace patterns are
-%% cleared, both local and global.
-h_start_session(M,F,TDGargs,LD=#ld{c_node=CNode,nodes=NodesD,tracer_data=TDs}) ->
- case get_inactive_running_nodes(NodesD) of
- [] -> % There are no nodes to initiate!
- h_start_session_nonodes(TDGargs,LD,[]);
- Nodes -> % List of nodes or 'local_runtime'.
- case h_start_session_ctp_all(CNode,Nodes) of
- {ok,Errors,[]} -> % Now no nodes to initiate!
- h_start_session_nonodes(TDGargs,LD,Errors);
- {ok,Errors,Nodes2} -> % Now these nodes are fresh.
- case call_tracer_data_generator(CNode,M,F,TDGargs,Nodes2) of
- {ok,TracerList} -> % Generated our tracerdata.
- case h_start_session_2(CNode,TracerList,Errors) of
- {ok,ReturnValue} -> % Some nodes are initialized now.
- {NewNodesD,Nodes3}=
- set_tracing_running_nodes(CNode,ReturnValue,NodesD),
- {SessionNr,NewTDs}=insert_td_tracer_data(TDGargs,TDs),
- {ok,{SessionNr,
- ReturnValue,
- Nodes3, % The nodes that shall get initial tracases.
- LD#ld{nodes=NewNodesD,tracer_data=NewTDs}}};
- {error,Reason} ->
- {error,Reason}
- end;
- {error,Reason} -> % Faulty tracer data generator func.
- {error,{bad_tdg,Reason}}
- end;
- {error,Reason} -> % Error clearing patterns.
- {error,Reason}
- end
- end.
-
-h_start_session_nonodes(TDGargs,LD=#ld{c_node=CNode,tracer_data=TDs},Errors) ->
- {SessionNr,NewTDs}=insert_td_tracer_data(TDGargs,TDs),
- if
- CNode==undefined ->
- {ok,{SessionNr,[],LD#ld{tracer_data=NewTDs}}};
- true ->
- {ok,{SessionNr,{ok,Errors},LD#ld{tracer_data=NewTDs}}}
- end.
-
-%% Help function clearing all trace patterns on all nodes.
-h_start_session_ctp_all(CNode,Nodes) ->
- case remove_all_trace_patterns(CNode,[],Nodes) of
- ok -> % Non-distributed case1.
- {ok,[],local_runtime};
- {error,Reason} -> % Non-distributed case2 and general failure.
- {error,Reason};
- {ok,NodeResults} ->
- h_start_session_ctp_all_2(NodeResults,[],[])
- end.
-
-h_start_session_ctp_all_2([{Node,{error,Reason}}|Rest],Errors,Nodes) ->
- h_start_session_ctp_all_2(Rest,[{Node,{error,Reason}}|Errors],Nodes);
-h_start_session_ctp_all_2([{Node,_OkOrPatternsUntouched}|Rest],Errors,Nodes) ->
- h_start_session_ctp_all_2(Rest,Errors,[Node|Nodes]);
-h_start_session_ctp_all_2([],Errors,Nodes) ->
- {ok,Errors,Nodes}.
-
-%% Help function doing the actual init_tracing.
-h_start_session_2(undefined,TracerData,_Errors) -> % Non distributed case.
- case inviso:init_tracing(TracerData) of
- {ok,LogResult} when is_list(LogResult) ->
- {ok,{ok,LogResult}};
- {error,already_initated} -> % Perhaps adopted!?
- {ok,{error,already_initiated}}; % Not necessarily wrong.
- {error,Reason} ->
- {error,Reason}
- end;
-h_start_session_2(CNode,TracerList,Errors) ->
- case rpc:call(CNode,inviso,init_tracing,[TracerList]) of
- {ok,NodeResults} ->
- {ok,{ok,Errors++NodeResults}};
- {error,Reason} ->
- {error,Reason};
- {badrpc,Reason} ->
- {error,{inviso_control_node_error,Reason}}
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function starting all initial trace cases. They are actually handled
-%% the same way as user started trace cases. We actually only start initial
-%% tracecases at Nodes (if Nodes is a list of nodes). This because we may have
-%% adopted some nodes some already tracing nodes, and such are supposed to have
-%% the correct patterns and flags set.
-do_initial_tcs([{TC,Vars}|Rest],Nodes,LD) ->
- Id=make_ref(), % Trace case ID.
- case h_atc(TC,Id,Vars,LD,Nodes) of % Start using regular start methods.
- {ok,NewLD} -> % Trace case was successfully started.
- NewInitialTcs=add_initial_tcs(TC,Id,NewLD#ld.started_initial_tcs),
- do_initial_tcs(Rest,Nodes,NewLD#ld{started_initial_tcs=NewInitialTcs});
- {error,_Reason} ->
- do_initial_tcs(Rest,Nodes,LD)
- end;
-do_initial_tcs([_|Rest],Nodes,LD) ->
- do_initial_tcs(Rest,Nodes,LD);
-do_initial_tcs([],_Nodes,LD) ->
- LD.
-%% -----------------------------------------------------------------------------
-
-%% This help functio is used instead of do_initial_tcs/3 if there actually are no
-%% nodes to do the trace cases on. The reason we must have this function is that
-%% the tracecases must still be entered into the history with bindings and all.
-%% But we let them be marked as 'running' immediately (no need for the activator
-%% process).
-add_initial_tcs_to_history([{TC,Vars}|Rest],LD=#ld{tc_dict=TCdict,chl=CHL}) ->
- case get_tracecase_tc_dict(TC,TCdict) of
- {ok,TraceCase} ->
- case check_bindings(Vars,TraceCase) of
- {ok,Bindings} ->
- Id=make_ref(), % Trace case ID.
- FakeProcH=make_ref(), % Need something to enter as activator.
- NewCHL=set_activating_chl(TC,Id,CHL,Bindings,FakeProcH),
- NewCHL2=set_running_chl(FakeProcH,TC,Id,void,NewCHL), % Result=void.
- NewInitialTcs=add_initial_tcs(TC,Id,LD#ld.started_initial_tcs),
- add_initial_tcs_to_history(Rest,LD#ld{chl=NewCHL2,
- started_initial_tcs=NewInitialTcs});
- {error,_Reason} -> % Not much we can do about that.
- add_initial_tcs_to_history(Rest,LD)
- end;
- false ->
- add_initial_tcs_to_history(Rest,LD)
- end;
-add_initial_tcs_to_history([],LD) ->
- LD.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% reinitiate_session
-%% -----------------------------------------------------------------------------
-
-%% Function doing the reinitiation. That means first do init_tracing at the nodes
-%% in question. Then redo the command history to bring them up to speed.
-%% But first the runtime component is cleared of all trace patterns.
-h_reinitiate_session(Nodes,M,F,TDGargs,LD=#ld{c_node=CNode,nodes=NodesD}) ->
- case h_reinitiate_session_2(Nodes,NodesD,CNode) of
- {ok,{[],NodesErr}} -> % No nodes to reinitiate.
- {ok,{NodesErr,{ok,[]},LD}};
- {ok,{Nodes2,NodesErr}} -> % List of nodes or local_runtime.
- case call_tracer_data_generator(CNode,M,F,TDGargs,Nodes2) of
- {ok,TracerList} ->
- case h_start_session_2(CNode,TracerList,[]) of % Borrow from start_session.
- {ok,ReturnValue} -> % Ok, now we must redo cmd history.
- {NewNodesD,_Nodes}=
- set_tracing_running_nodes(CNode,ReturnValue,NodesD),
- NewLD=h_reinitiate_session_chl(Nodes2,LD#ld{nodes=NewNodesD}),
- {ok,{NodesErr,ReturnValue,NewLD}};
- {error,Reason} ->
- {error,Reason}
- end;
- {error,Reason} ->
- {error,{bad_tdg,Reason}}
- end;
- {error,Reason} ->
- {error,Reason}
- end.
-
-%% Help function finding out which nodes in Nodes actually can be reinitiated.
-%% A node must be up, inactive and not suspended in order for this to work. All the
-%% rest is just a matter of how detailed error return values we want to generate.
-h_reinitiate_session_2(local_runtime,NodesD,undefined) -> % Non distributed case.
- case get_state_nodes(local_runtime,NodesD) of
- {inactive,running} -> % Only ok case.
- case inviso:ctp_all() of
- ok ->
- {ok,{local_runtime,[]}};
- {error,Reason} -> % This is strange.
- {error,Reason}
- end;
- {_,suspended} ->
- {ok,{[],{error,suspended}}};
- down ->
- {ok,{[],{error,down}}};
- _ ->
- {ok,{[],{error,already_in_session}}}
- end;
-h_reinitiate_session_2(Nodes,NodesD,CNode) when is_list(Nodes) ->
- {ok,lists:foldl(fun(N,{Nodes2,NodesErr})->
- case get_state_nodes(N,NodesD) of
- {inactive,running} -> % Only ok case.
- case rpc:call(CNode,inviso,ctp_all,[[N]]) of
- {ok,[{N,ok}]} ->
- {[N|Nodes2],NodesErr};
- {ok,[{N,{error,Reason}}]} ->
- {Nodes2,[{N,{error,Reason}}|NodesErr]};
- {error,Reason} ->
- {Nodes2,[{N,{error,Reason}}|NodesErr]};
- {badrpc,Reason} ->
- {Nodes2,[{N,{error,{badrpc,Reason}}}|NodesErr]}
- end;
- {_,suspended} ->
- {Nodes2,[{N,{error,suspended}}|NodesErr]};
- down ->
- {Nodes2,[{N,{error,down}}|NodesErr]};
- false ->
- {Nodes2,[{N,{error,unknown_node}}|NodesErr]};
- _ ->
- {Nodes2,[{N,{error,already_in_session}}|NodesErr]}
- end
- end,
- {[],[]},
- Nodes)};
-h_reinitiate_session_2(Nodes,_NodesD,_CNode) ->
- {error,{badarg7,Nodes}}.
-
-%% Help function redoing the command history log at all nodes that actually
-%% started to trace. Note that we do not modify the return value which will be
-%% given to the caller just because we decide not to redo commands. The user
-%% must conclude him self from the inviso return value that commands were not
-%% redone at a particular node.
-h_reinitiate_session_chl(local_runtime,LD) ->
- h_reinitiate_session_chl([local_runtime],LD);
-h_reinitiate_session_chl([Node|Rest],LD=#ld{nodes=NodesD}) ->
- case get_state_nodes(Node,NodesD) of
- {tracing,running} -> % Only case when we shall redo!
- h_reinitiate_session_chl(Rest,redo_cmd_history(Node,LD));
- _ -> % No redo of chl in other cases.
- h_reinitiate_session_chl(Rest,LD)
- end;
-h_reinitiate_session_chl([],LD) ->
- LD.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% restore_session
-%% -----------------------------------------------------------------------------
-
-%% Help function starting a session (init tracing) and redoes the history
-%% found in CHL.
-h_restore_session(MoreTDGargs,LD) ->
- DateTime=calendar:universal_time(),
- {M,F,Args}=LD#ld.tdg,
- TDGargs=inviso_tool_lib:mk_tdg_args(DateTime,MoreTDGargs++Args),
- case h_start_session(M,F,TDGargs,LD) of
- {ok,{SessionNr,ReturnVal,NewLD}} -> % There were no available nodes.
- {ok,{SessionNr,ReturnVal,NewLD}};
- {ok,{SessionNr,ReturnVal,Nodes2,NewLD}} ->
- NewLD2=h_reinitiate_session_chl(Nodes2,NewLD),
- {ok,{SessionNr,ReturnVal,NewLD2}};
- {error,Reason} -> % Risk of out of control.
- {error,Reason}
- end.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% stop_session
-%% -----------------------------------------------------------------------------
-
-%% Help function stopping tracing at tracing nodes.
-h_stop_session(#ld{c_node=CNode,nodes=NodesD,tracer_data=TDs}) ->
- case h_stop_session_2(CNode,NodesD) of
- {ok,Result} ->
- {ok,{get_latest_session_nr_tracer_data(TDs),Result}};
- {error,Reason} ->
- {error,Reason}
- end.
-
-h_stop_session_2(undefined,NodesD) -> % The non distributed case.
- case get_tracing_nodes(NodesD) of
- {up,{inactive,_}} -> % Already not tracing!
- {ok,[]};
- {up,_} ->
- case inviso:stop_tracing() of
- {ok,_State} ->
- {ok,[ok]};
- {error,no_response} ->
- {ok,[]};
- {error,Reason} ->
- {error,Reason}
- end;
- down ->
- {ok,[]}
- end;
-h_stop_session_2(CNode,NodesD) ->
- Nodes=get_tracing_nodes(NodesD),
- case rpc:call(CNode,inviso,stop_tracing,[Nodes]) of
- {ok,NodeResults} ->
- {ok,lists:map(fun({N,{ok,_}})->{N,ok};
- (NodeError)->NodeError
- end,
- NodeResults)};
- {error,Reason} ->
- {error,Reason};
- {badrpc,Reason} ->
- {error,{inviso_control_node_error,Reason}}
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function removing any trace flags, trace patterns and meta trace patterns
-%% at Nodes. This will cause the nodes to become "fresh".
-h_reset_nodes(local_runtime,_CNode) ->
- inviso:clear([keep_log_files]);
-h_reset_nodes(Nodes,CNode) ->
- case inviso_tool_lib:inviso_cmd(CNode,clear,[Nodes,[keep_log_files]]) of
- {ok,NodeResults} ->
- {ok,NodeResults};
- {error,Reason} ->
- {error,Reason}
- end.
-%% -----------------------------------------------------------------------------
-
-
-%% -----------------------------------------------------------------------------
-%% atc
-%% -----------------------------------------------------------------------------
-
-%% Function handling ativating a trace case. Trace cases that do not have a
-%% particular on/off handling (but just on in some scense) are handled here too.
-%% The trace case is entered into the Command History Log.
-%% Note that the trace case can not be executed at this node but must be
-%% executed where the inviso control component is.
-%% Further it is possible to either activated the tracecase for all running and
-%% tracing nodes, or just for a specified list of nodes.
-%% TC=tracecase_name(),
-%% Id=term(), identifiying this usage so we can turn it off later.
-%% Vars=list(), list of variable-value bindnings.
-h_atc(TC,Id,Vars,LD) ->
- h_atc(TC,Id,Vars,LD,void). % For all running-tracing nodes.
-
-h_atc(TC,Id,Vars,LD=#ld{c_node=CNode,tc_dict=TCdict,chl=CHL},Nodes) ->
- case find_id_chl(TC,Id,CHL) of
- activating -> % Already started.
- {error,activating};
- stopping -> % Not yet stopped.
- {error,deactivating};
- false ->
- case get_tracecase_tc_dict(TC,TCdict) of
- {ok,TraceCase} -> % Such a trace case exists.
- case check_bindings(Vars,TraceCase) of
- {ok,Bindings} -> % Necessary vars exists in Vars.
- if
- is_list(Nodes) -> % Nodes predefined.
- h_atc_2(TC,Id,CNode,CHL,LD,TraceCase,Bindings,Nodes);
- true -> % Use all tracing and running nodes.
- Nodes1=get_nodenames_running_nodes(LD#ld.nodes),
- h_atc_2(TC,Id,CNode,CHL,LD,TraceCase,Bindings,Nodes1)
- end;
- {error,Reason} -> % Variable def missing.
- {error,Reason}
- end;
- false ->
- {error,unknown_tracecase}
- end;
- {ok,_Bindings} -> % Already activated and running.
- {error,already_started}
- end.
-
-h_atc_2(TC,Id,CNode,CHL,LD,TraceCase,Bindings,Nodes) ->
- {ok,ProcH} = exec_trace_case_on(CNode,TraceCase,Bindings,Nodes),
- %% Trace cases have no return values.
- NewCHL=set_activating_chl(TC,Id,CHL,Bindings,ProcH),
- {ok,LD#ld{chl=NewCHL}}.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% sync_atc
-%% -----------------------------------------------------------------------------
-
-h_sync_atc(TC,Id,Vars,TimeOut,LD=#ld{c_node=CNode,tc_dict=TCdict,chl=CHL}) ->
- case find_id_chl(TC,Id,CHL) of
- activating -> % Already started.
- {error,activating};
- stopping -> % Not yet stopped.
- {error,deactivating};
- false ->
- case get_tracecase_tc_dict(TC,TCdict) of
- {ok,TraceCase} -> % Such a trace case exists.
- case check_bindings(Vars,TraceCase) of
- {ok,Bindings} -> % Necessary vars exists in Vars.
- {ok,TcFName}=get_tc_activate_fname(TraceCase),
- Nodes=get_nodenames_running_nodes(LD#ld.nodes),
- Bindings2=erl_eval:add_binding('Nodes',Nodes,Bindings),
- RpcNode=get_rpc_nodename(CNode),
- case rpc:call(RpcNode,file,script,[TcFName,Bindings2],TimeOut) of
- {ok,Value} ->
- FakeProcH=make_ref(),
- NewCHL1=set_activating_chl(TC,Id,CHL,Bindings,FakeProcH),
- NewCHL2=set_running_chl(FakeProcH,TC,Id,Value,NewCHL1),
- {ok,LD#ld{chl=NewCHL2},Value};
- {error,Reason} ->
- {error,{faulty_tracecase,{TcFName,Reason}}};
- {badrpc,Reason} ->
- {error,{badrpc,Reason}}
- end;
- {error,Reason} -> % Variable def missing.
- {error,Reason}
- end;
- false ->
- {error,unknown_tracecase}
- end;
- {ok,_Bindings} -> % Already activated and running.
- {error,already_started}
- end.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% rtc
-%% -----------------------------------------------------------------------------
-
-%% Function handling running a trace case without marking it as activated. It
-%% is in the history mearly indicated as activated
-h_sync_rtc(TC,Vars,TimeOut,LD=#ld{c_node=CNode,tc_dict=TCdict,chl=CHL}) ->
- case get_tracecase_tc_dict(TC,TCdict) of
- {ok,TraceCase} -> % Such a trace case exists.
- case check_bindings(Vars,TraceCase) of
- {ok,Bindings} -> % Necessary vars exists in Vars.
- {ok,TcFName}=get_tc_activate_fname(TraceCase),
- Nodes=get_nodenames_running_nodes(LD#ld.nodes),
- Bindings2=erl_eval:add_binding('Nodes',Nodes,Bindings),
- RpcNode=get_rpc_nodename(CNode),
- case rpc:call(RpcNode,file,script,[TcFName,Bindings2],TimeOut) of
- {ok,Value} ->
- {ok,LD#ld{chl=add_rtc_chl(TC,Bindings2,CHL)},Value};
- {error,Reason} ->
- {error,{faulty_tracecase,{TcFName,Reason}}};
- {badrpc,Reason} ->
- {error,{badrpc,Reason}}
- end;
- {error,Reason} -> % Variable def missing.
- {error,Reason}
- end;
- false ->
- {error,unknown_tracecase}
- end.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% dtc
-%% -----------------------------------------------------------------------------
-
-%% Function handling turning a trace case off. The trace case must be registered
-%% as having an off mechanism. If it has an off mechanism and was previously entered
-%% into the Command History Log and is done with its activation phase, it will be
-%% executed and removed from the CHL.
-h_dtc(TC,Id,LD=#ld{c_node=CNode,tc_dict=TCdict,chl=CHL}) ->
- case find_id_chl(TC,Id,CHL) of
- {ok,Bindings} -> % Yes, we have turned it on before.
- case get_tracecase_tc_dict(TC,TCdict) of
- {ok,TraceCase} ->
- Nodes=get_nodenames_running_nodes(LD#ld.nodes),
- case exec_trace_case_off(CNode,TraceCase,Bindings,Nodes) of
- {ok,ProcH} ->
- NewCHL=set_stopping_chl(TC,Id,CHL,ProcH),
- {ok,LD#ld{chl=NewCHL}};
- {error,Reason} ->
- {error,Reason}
- end;
- false -> % Strange, Id ok but no such trace case.
- {error,unknown_tracecase}
- end;
- false -> % Not previously turned on.
- {error,unknown_id};
- activating ->
- {error,activating};
- stopping ->
- {error,already_deactivating}
- end.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% sync_dtc
-%% -----------------------------------------------------------------------------
-
-h_sync_dtc(TC,Id,TimeOut,LD=#ld{c_node=CNode,tc_dict=TCdict,chl=CHL}) ->
- case find_id_chl(TC,Id,CHL) of
- {ok,Bindings} -> % Yes, we have turned it on before.
- case get_tracecase_tc_dict(TC,TCdict) of
- {ok,TraceCase} ->
- case get_tc_deactivate_fname(TraceCase) of
- {ok,TcFName} ->
- Nodes=get_nodenames_running_nodes(LD#ld.nodes),
- Bindings2=erl_eval:add_binding('Nodes',Nodes,Bindings),
- RpcNode=get_rpc_nodename(CNode),
- case rpc:call(RpcNode,file,script,[TcFName,Bindings2],TimeOut) of
- {ok,Value} ->
- FakeProcH=make_ref(),
- NewCHL1=set_stopping_chl(TC,Id,CHL,FakeProcH),
- NewCHL2=nullify_chl(FakeProcH,TC,Id,NewCHL1),
- {ok,LD#ld{chl=NewCHL2},Value};
- {error,Reason} -> % Script fault.
- {error,{faulty_tracecase,{TcFName,Reason}}};
- {badrpc,Reason} ->
- {error,{badrpc,Reason}}
- end;
- false ->
- {error,no_deactivation}
- end;
- false -> % Strange, Id ok but no such trace case.
- {error,unknown_tracecase}
- end;
- false -> % Not previously turned on.
- {error,unknown_id};
- activating ->
- {error,activating};
- stopping ->
- {error,already_deactivating}
- end.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% inviso
-%% -----------------------------------------------------------------------------
-
-%% Function executing one inviso command. The returnvalue from the inviso
-%% function call will be the return value to the client. The command is
-%% entered into the history command log.
-%% Note that the inviso call may have to be done at another node, dictated
-%% by the c_node field. Further, if the module name is not an atom it is
-%% most likely a regexp, which must be expanded at the regexp_node. Note
-%% this is only relevant for tp and tpl.
-h_inviso(Cmd,Args,LD=#ld{c_node=CNode,regexp_node=RegExpNode,chl=CHL}) ->
- Arity=length(Args),
- case check_proper_inviso_call(Cmd,Arity) of
- {true,RegExpFlag} -> % Yes it is an inviso call.
- Nodes=get_nodenames_running_nodes(LD#ld.nodes),
- case h_inviso_2(Cmd,Args,CNode,RegExpNode,RegExpFlag,Nodes) of
- {ok,Result} ->
- case check_inviso_call_to_history(Cmd,Arity) of
- true -> % This function shall be added to chl.
- {ok,{Result,LD#ld{chl=add_inviso_call_chl(Cmd,Args,CHL)}}};
- false -> % Do not add it.
- {ok,{Result,LD}}
- end;
- {error,Reason} ->
- {error,Reason}
- end;
- false -> % Not an inviso function.
- {error,invalid_function_name}
- end.
-
-h_inviso_2(Cmd,Args,undefined,_,_,_) -> % A non distributed system.
- case catch apply(inviso,Cmd,Args) of % Regexp expansion only relevant when
- {'EXIT',Reason} -> % distributed, here let inviso_rt expand.
- {error,{'EXIT',Reason}};
- Result ->
- {ok,Result}
- end;
-h_inviso_2(Cmd,Args,CNode,RegExpNode,RegExpFlag,Nodes) ->
- case expand_module_regexps(Args,RegExpNode,Nodes,RegExpFlag) of
- {ok,NewArgs} ->
- case catch inviso_tool_lib:inviso_cmd(CNode,Cmd,[Nodes|NewArgs]) of
- {'EXIT',Reason} ->
- {error,{'EXIT',Reason}};
- {error,{badrpc,Reason}} -> % Includes runtime failure.
- {error,{badrpc,Reason}};
- Result ->
- {ok,Result}
- end;
- {error,Reason} ->
- {error,Reason}
- end.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% reactivate
-%% -----------------------------------------------------------------------------
-
-h_reactivate(_Node,undefined) -> % The non-distributed case.
- case inviso:cancel_suspension() of
- ok ->
- ok;
- {error,Reason} ->
- {error,Reason}
- end;
-h_reactivate(Node,CNode) ->
- case inviso_tool_lib:inviso_cmd(CNode,cancel_suspension,[[Node]]) of
- {ok,[{Node,ok}]} ->
- ok;
- {ok,[{Node,{error,Reason}}]} ->
- {error,Reason};
- {error,Reason} ->
- {error,Reason}
- end.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% save_history
-%% -----------------------------------------------------------------------------
-
-h_save_history(HDir,Dir,FileName,SortedLog) ->
- Dir0=
- if
- is_list(HDir) -> % There is a history dir specified.
- HDir; % Use it then.
- true ->
- Dir % Else use the tool dir.
- end,
- case catch make_absolute_path(FileName,Dir0) of
- AbsFileName when is_list(AbsFileName) ->
- Log2=build_saved_history_data(SortedLog), % Remove stopped tracecases.
- case file:write_file(AbsFileName,term_to_binary(Log2)) of
- ok ->
- {ok,AbsFileName};
- {error,Reason} ->
- {error,{write_file,Reason}}
- end;
- {'EXIT',_Reason} ->
- {error,{bad_filename,FileName}}
- end.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% get_autostart_data
-%% -----------------------------------------------------------------------------
-
-%% Help function building the structures used when exporting autostart information
-%% from the tool. Note that we remove the tool-dependency and insert the one
-%% specify in the get_autostart_data call.
-h_get_autostart_data(local_runtime,_,Dependency,ASD,M,F,TDGargs,OptsG) ->
- CompleteTDGargs=call_tracer_data_generator_mkargs(local_runtime,TDGargs),
- Opts0=start_runtime_components_mk_opts(local_runtime,OptsG),
- Opts=[Dependency|lists:keydelete(dependency,1,Opts0)],
- {ok,{ASD,{ok,{Opts,{tdg,{M,F,CompleteTDGargs}}}}}};
-
-h_get_autostart_data(Nodes,CNode,Dependency,ASD,M,F,TDGargs,OptsG) when is_list(Nodes) ->
- {ok,{ASD,h_get_autostart_data_2(Nodes,CNode,Dependency,M,F,TDGargs,OptsG)}};
-h_get_autostart_data(Nodes,_CNode,_Dependency,_ASD,_M,_F,_TDGargs,_OptsG) ->
- {error,{badarg,Nodes}}.
-
-h_get_autostart_data_2([Node|Rest],CNode,Dependency,M,F,TDGargs,OptsG) ->
- CompleteTDGargs=call_tracer_data_generator_mkargs(Node,TDGargs),
- Opts0=start_runtime_components_mk_opts(Node,OptsG),
- Opts=[Dependency|lists:keydelete(dependency,1,Opts0)],
- [{Node,{ok,{Opts,{tdg,{M,F,CompleteTDGargs}}}}}|
- h_get_autostart_data_2(Rest,CNode,Dependency,M,F,TDGargs,OptsG)];
-h_get_autostart_data_2([],_CNode,_Dependency,_M,_F,_TDGargs,_OptsG) ->
- [].
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% flush
-%% -----------------------------------------------------------------------------
-
-h_flush(undefined,_Nodes) ->
- inviso:flush();
-h_flush(CNode,Nodes) ->
- inviso_tool_lib:inviso_cmd(CNode,flush,[Nodes]).
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% tc_executer_reply
-%% -----------------------------------------------------------------------------
-
-%% Function handling that a trace case has completed its activation phase and
-%% shall now be marked in the Command History Log as running.
-h_tc_activation_done(ProcH,Result,LD=#ld{chl=CHL}) ->
- case find_tc_executer_chl(ProcH,CHL) of
- {activating,{TC,Id}} ->
- case Result of
- {ok,Value} -> % The trace case is successful activated.
- {ok,LD#ld{chl=set_running_chl(ProcH,TC,Id,Value,CHL)}};
- {error,_} -> % Then pretend it never happend :-)
- {ok,LD#ld{chl=del_tc_chl(ProcH,TC,Id,CHL)}} % Remove it.
- end;
- _ -> % Where did this come from?
- {ok,LD} % Well just ignore it then.
- end.
-%% -----------------------------------------------------------------------------
-
-%% Function handling that a trace case has completed its stopping phase and
-%% shall now be nulled in the Command History Log (meaning that it will not
-%% be repeated in the event of a reactivation).
-h_tc_stopping_done(ProcH,Result,LD=#ld{chl=CHL}) ->
- case find_tc_executer_chl(ProcH,CHL) of
- {stopping,{TC,Id}} ->
- case Result of
- {ok,_Result} -> % _Result is returned from the tracecase.
- {ok,LD#ld{chl=nullify_chl(ProcH,TC,Id,CHL)}};
- {error,_} -> % This is difficult, is it still active?
- {ok,LD#ld{chl=nullify_chl(ProcH,TC,Id,CHL)}}
- end;
- _ -> % Strange.
- {ok,LD}
- end.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% Terminate.
-%% -----------------------------------------------------------------------------
-
-%% Help function stopping the inviso control component. Does not return
-%% anything significant.
-stop_inviso_at_c_node(undefined) -> % Non distributed case.
- inviso:stop();
-stop_inviso_at_c_node(CNode) ->
- rpc:call(CNode,inviso,stop,[]).
-%% -----------------------------------------------------------------------------
-
-%% Help function that removes all trace patterns from the nodes that are not
-%% marked as such were patterns shall be left after stopping of inviso.
-%% Returns {ok,NodeResult} or {error,Reason}. In the non-distributed case
-%% 'ok' is returned incase of success, ot 'patterns_untouched'.
-remove_all_trace_patterns(undefined,KeepNodes,_Nodes) ->
- case KeepNodes of
- undefined -> % No, remove patterns from localruntime.
- inviso:ctp_all();
- _ ->
- patterns_untouched
- end;
-remove_all_trace_patterns(CNode,KeepNodes,Nodes) ->
- Nodes2=lists:filter(fun(N)->not(lists:member(N,KeepNodes)) end,Nodes),
- case inviso_tool_lib:inviso_cmd(CNode,ctp_all,[Nodes2]) of
- {ok,NodeResults} ->
- F=fun(N) ->
- case lists:member(N,KeepNodes) of
- true ->
- {N,patterns_untouched};
- false ->
- case lists:keysearch(N,1,NodeResults) of
- {value,Result} ->
- Result; % {Node,ok}
- false -> % Extremely strange.
- {N,{error,general_error}}
- end
- end
- end,
- {ok,lists:map(F,Nodes)};
- {error,{badrpc,Reason}} ->
- {error,{inviso_control_node_error,Reason}};
- {error,Reason} ->
- {error,Reason}
- end.
-%% -----------------------------------------------------------------------------
-
-%% =============================================================================
-%% Second level help functions.
-%% =============================================================================
-
-%% Help function building a reply to a reconnection call based on which nodes
-%% where asked to be reconnected and which of those are actually now working.
-%% We actually make an effort to serve the return value in the same order as the
-%% nodes were mentioned in the original call (Nodes).
-build_reconnect_nodes_reply(local_runtime,local_runtime,_NodesErr,NodesD) ->
- case get_state_nodes(local_runtime,NodesD) of
- down ->
- {error,down};
- {State,Status} ->
- {ok,{State,Status}}
- end;
-build_reconnect_nodes_reply(local_runtime,_,NodesErr,_NodesD) ->
- NodesErr;
-build_reconnect_nodes_reply([Node|Rest],Nodes2,NodesErr,NodesD) ->
- case lists:member(Node,Nodes2) of
- true -> % Ok, look in the #ld.nodes.
- case get_state_nodes(Node,NodesD) of
- down -> % Somekind of failure, still down.
- [{Node,{error,down}}|
- build_reconnect_nodes_reply(Rest,Nodes2,NodesErr,NodesD)];
- {State,Status} -> % {State,Status}
- [{Node,{ok,{State,Status}}}|
- build_reconnect_nodes_reply(Rest,Nodes2,NodesErr,NodesD)]
- end;
- false -> % Error already from the beginning.
- {value,{_,Error}}=lists:keysearch(Node,1,NodesErr),
- [{Node,Error}|build_reconnect_nodes_reply(Rest,Nodes2,NodesErr,NodesD)]
- end;
-build_reconnect_nodes_reply([],_,_,_) ->
- [].
-%% -----------------------------------------------------------------------------
-
-%% Help function building a return value to reinitiate_session. Nodes contains
-%% all involved nodes. If the node occurrs in NodesErr, we choose the error in
-%% NodesErr. Otherwise the returnvalue in ReturnVal is used.
-build_reinitiate_session_reply(Nodes,NodesErr,{ok,NodesResults}) ->
- {ok,build_reinitiate_session_reply_2(Nodes,NodesErr,NodesResults)};
-build_reinitiate_session_reply(local_runtime,[],NodeResult) ->
- NodeResult;
-build_reinitiate_session_reply(local_runtime,NodesErr,_NodeResult) ->
- NodesErr.
-build_reinitiate_session_reply_2([Node|Rest],NodesErr,NodeResults) ->
- case lists:keysearch(Node,1,NodesErr) of
- {value,{_,Error}} ->
- [{Node,Error}|build_reinitiate_session_reply_2(Rest,NodesErr,NodeResults)];
- false ->
- case lists:keysearch(Node,1,NodeResults) of
- {value,Value} ->
- [Value|build_reinitiate_session_reply_2(Rest,NodesErr,NodeResults)]
- end
- end;
-build_reinitiate_session_reply_2([],_NodesErr,_NodeResults) ->
- [].
-%% -----------------------------------------------------------------------------
-
-%% Help function returning a history log where stop and stopping entries have
-%% been removed. Further all tracecase log entries must be set to running since
-%% there can not be such a thing as an activating tracecase stored away in a
-%% saved historyfile!
-%% We must also take away any #Ref.
-build_saved_history_data(SortedLog) ->
- CleanedLog=
- lists:filter(fun({_,_,Stop,_}) when Stop==stop;Stop==stopping -> false;
- (_) -> true
- end,
- SortedLog),
- lists:map(fun({{TC,Id},C,activating,B}) -> {{TC,Id},C,running,B};
- ({{TC,Id},C,S,B}) -> {{TC,Id},C,S,B};
- ({{M,F,Args,_Ref},C}) -> {{M,F,Args},C};
- ({{TC,_Ref},C,B}) -> {TC,C,B} % An rtc.
- end,
- CleanedLog).
-%% -----------------------------------------------------------------------------
-
-%% This help function builds the AutoStartData structure which is returned from
-%% get_austostart_data. An AutoStartData structure is a list of trace-files and
-%% inviso commands. The order is significant since it is the idea that doing
-%% the trace case files and inviso commands in that order will bring a node to
-%% a certain state in a trace perspective.
-%% Returns {ok,AutoStartData} or {error,Reason}
-build_autostart_data(SortedLog,TCdict) ->
- build_autostart_data_2(SortedLog,TCdict,[]).
-
-build_autostart_data_2([{_,_C,Stop,_B}|Rest],TCdict,Accum) when Stop==stop;Stop==stopping->
- build_autostart_data_2(Rest,TCdict,Accum); % Simply skip deactivated/deativating.
-build_autostart_data_2([{{TCname,_},_C,activating,Bindings}|Rest],TCdict,Accum) ->
- build_autostart_data_tc(TCname,Bindings,TCdict,Rest,Accum);
-build_autostart_data_2([{{TCname,_},_C,running,Bindings}|Rest],TCdict,Accum) ->
- build_autostart_data_tc(TCname,Bindings,TCdict,Rest,Accum);
-build_autostart_data_2([{{TCname,_Ref},_C,Bindings}|Rest],TCdict,Accum) ->
- build_autostart_data_tc(TCname,Bindings,TCdict,Rest,Accum);
-build_autostart_data_2([{{M,F,Args,_Ref},_C}|Rest],TCdict,Accum) ->
- build_autostart_data_2(Rest,TCdict,[{mfa,{M,F,Args}}|Accum]);
-build_autostart_data_2([],_TCdict,Accum) ->
- {ok,lists:reverse(Accum)}.
-
-%% Help function placing the filename in the AutoStartData structure.
-build_autostart_data_tc(TCname,Bindings,TCdict,Rest,Accum) ->
- {ok,TC}=get_tracecase_tc_dict(TCname,TCdict),
- {ok,FName}=get_tc_activate_fname(TC),
- build_autostart_data_2(Rest,TCdict,[{file,{FName,Bindings}}|Accum]).
-%% -----------------------------------------------------------------------------
-
-%% Help function generating tracerdata to init inviso tracing. The generation
-%% is done by the TracerDataGenerator, TDG, function.
-%% Individual tracerdata is generated for each node in Nodes.
-%% Returns {ok,TracerData} or {error,Reason}.
-call_tracer_data_generator(undefined,M,F,TDGargs,_Nodes) -> % Non distributed.
- case catch call_tracer_data_generator_3(M,F,TDGargs,local_runtime) of
- {'EXIT',Reason} ->
- {error,{'EXIT',Reason}};
- TracerData ->
- {ok,TracerData}
- end;
-call_tracer_data_generator(_CNode,M,F,TDGargs,Nodes) ->
- case catch call_tracer_data_generator_2(M,F,TDGargs,Nodes) of
- {'EXIT',Reason} ->
- {error,{'EXIT',Reason}};
- TracerList ->
- {ok,TracerList}
- end.
-
-call_tracer_data_generator_2(M,F,TDGargs,[Node|Rest]) ->
- [{Node,call_tracer_data_generator_3(M,F,TDGargs,Node)}|
- call_tracer_data_generator_2(M,F,TDGargs,Rest)];
-call_tracer_data_generator_2(_,_,_,[]) ->
- [].
-
-call_tracer_data_generator_3(M,F,TDGargs,Node) ->
- apply(M,F,call_tracer_data_generator_mkargs(Node,TDGargs)).
-
-%% This function creates the arguments that the tracer data generator function
-%% accepts (in an apply call). The reason for making it a sepparate function is
-%% that the arguments are constructed in more situations than just when actually
-%% doing the apply. By having a function it will become obvious where to change
-%% should the arguments change.
-call_tracer_data_generator_mkargs(Node,TDGargs) ->
- inviso_tool_lib:mk_complete_tdg_args(Node,TDGargs).
-%% -----------------------------------------------------------------------------
-
-%% This function acts as standard options generator function. That is returning
-%% the options argument to inviso:add_node/3. Note that this function must not
-%% return the dependency part of that option.
-std_options_generator(_Node) ->
- []. % No particular options(!)
-%% -----------------------------------------------------------------------------
-
-
-%% Help function checking that Vars contains a binding for every variable
-%% listed in the VarNames field in TraceCase. Note that the special variable 'Nodes'
-%% is disregarded, since it is always added by the inviso_tool.
-%% Returns {ok,Bindings} or {error,Reason}. Where Bindings is a bindngs structure
-%% according to file:eval functionality.
-check_bindings(Vars,TraceCase) ->
- case catch check_bindings_2(Vars,
- get_tc_varnames(TraceCase),
- erl_eval:new_bindings()) of
- {'EXIT',_Reason} ->
- {error,variable_error};
- {error,Reason} -> % Missing a bindning.
- {error,Reason};
- {ok,Bindings} ->
- {ok,Bindings}
- end.
-
-check_bindings_2(Vars,['Nodes'|Rest],Bindings) ->
- check_bindings_2(Vars,Rest,Bindings); % Disregard Nodes since it is automatic.
-check_bindings_2(Vars,[VarName|Rest],Bindings) ->
- case lists:keysearch(VarName,1,Vars) of
- {value,{_,Val}} ->
- check_bindings_2(Vars,Rest,erl_eval:add_binding(VarName,Val,Bindings));
- false -> % Mandatory variable missing.
- {error,{missing_variable,VarName}} % Quite here then.
- end;
-check_bindings_2(_,[],Bindings) ->
- {ok,Bindings}.
-%% -----------------------------------------------------------------------------
-
-%% This help function checks that the command the user tries to do is amongst
-%% the inviso API. It at the same time returns what kind of command it is.
-%% {true,RegExpFlag} or 'false' where RegExpFlag indicates if this command
-%% needs to have its argument modified by module regexp expansion or not.
-check_proper_inviso_call(Cmd,Arity) ->
- case lists:member({Cmd,Arity},?INVISO_CMDS) of
- true -> % It is part of inviso API.
- {true,check_proper_inviso_call_regexp(Cmd,Arity)};
- false ->
- false
- end.
-
-%% Returns {Type,Arity,PlaceOfModuleSpec} or 'false'.
-check_proper_inviso_call_regexp(tp,5) -> {tp,5,1};
-check_proper_inviso_call_regexp(tp,4) -> {tp,4,1};
-check_proper_inviso_call_regexp(tp,1) -> {tp,1,1};
-check_proper_inviso_call_regexp(tpl,5) -> {tp,5,1};
-check_proper_inviso_call_regexp(tpl,4) -> {tp,4,1};
-check_proper_inviso_call_regexp(tpl,1) -> {tp,1,1};
-check_proper_inviso_call_regexp(ctp,3) -> {ctp,3,1};
-check_proper_inviso_call_regexp(ctp,1) -> {ctp,1,1};
-check_proper_inviso_call_regexp(ctpl,3) -> {ctp,3,1};
-check_proper_inviso_call_regexp(ctpl,1) -> {ctp,1,1};
-check_proper_inviso_call_regexp(_,_) -> % No regexp expansion.
- false.
-%% -----------------------------------------------------------------------------
-
-%% Help function checking if this inviso command shall be added to the command
-%% history log. Returns true or false.
-check_inviso_call_to_history(Cmd,Arity) ->
- case lists:member({Cmd,Arity},?INVISO_CMD_HISTORY) of
- true ->
- true;
- false ->
- false
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function traversing the arguments and expanding module names stated
-%% as regular expressions. This means that the resulting arguments may be longer
-%% than the orginal ones.
-%% When we run this function it has been determined that we are a distributed
-%% system.
-%% Also note that if there are no regexps in Args, no regexpansion will be
-%% made and RegExpNode may be 'undefined' (as it is if not set at start-up).
-%% If RegExpNode is unavailable the nodes found in Nodes will be used until
-%% one that works is found.
-expand_module_regexps(Args,_RegExpNode,_Nodes,false) ->
- {ok,Args};
-expand_module_regexps([PatternList],RegExpNode,Nodes,{tp,1,1}) ->
- case catch expand_module_regexps_tp(PatternList,RegExpNode,Nodes) of
- NewPatternList when is_list(NewPatternList) ->
- {ok,[NewPatternList]};
- {error,Reason} ->
- {error,Reason}
- end;
-expand_module_regexps([PatternList],RegExpNode,Nodes,{ctp,1,1}) ->
- case catch expand_module_regexps_ctp(PatternList,RegExpNode,Nodes) of
- NewPatternList when is_list(NewPatternList) ->
- {ok,[NewPatternList]};
- {error,Reason} ->
- {error,Reason}
- end;
-expand_module_regexps([M,F,Arity,MS,Opts],RegExpNode,Nodes,{tp,5,1}) ->
- expand_module_regexps([[{M,F,Arity,MS,Opts}]],RegExpNode,Nodes,{tp,1,1});
-expand_module_regexps([M,F,Arity,MS],RegExpNode,Nodes,{tp,4,1}) ->
- expand_module_regexps([[{M,F,Arity,MS,[]}]],RegExpNode,Nodes,{tp,1,1});
-expand_module_regexps([M,F,Arity],RegExpNode,Nodes,{ctp,3,1}) ->
- expand_module_regexps([[{M,F,Arity}]],RegExpNode,Nodes,{ctp,1,1}).
-
-
-expand_module_regexps_tp([E={M,_,_,_,_}|Rest],RegExpNode,Nodes) when is_atom(M) ->
- [E|expand_module_regexps_tp(Rest,RegExpNode,Nodes)];
-expand_module_regexps_tp([{M,F,Arity,MS,Opts}|Rest],RegExpNode,Nodes) when is_list(M);is_tuple(M) ->
- case inviso_tool_lib:expand_module_names([RegExpNode],
- M,
- [{expand_only_at,RegExpNode}]) of
- {singlenode_expansion,Modules} ->
- expand_module_regexps_tp_2(Modules,F,Arity,MS,Opts,Rest,RegExpNode,Nodes);
- {error,{faulty_node,RegExpNode}} -> % RegExpNode probably down.
- case Nodes of
- [NewRegExpNode|RestNodes] -> % Ok, just choose a node.
- expand_module_regexps_tp([{M,F,Arity,MS,Opts}|Rest],NewRegExpNode,RestNodes);
- [] -> % No more nodes to choose from.
- throw({error,no_available_regexpnode})
- end;
- {error,_Reason} ->
- expand_module_regexps_tp(Rest,RegExpNode,Nodes)
- end;
-expand_module_regexps_tp([_|Rest],RegExpNode,Nodes) ->
- expand_module_regexps_tp(Rest,RegExpNode,Nodes); % Skip faulty module specification.
-expand_module_regexps_tp([],_RegExpNodes,_Nodes) ->
- [].
-
-expand_module_regexps_tp_2([M|MRest],F,Arity,MS,Opts,Rest,RegExpNode,Nodes) ->
- [{M,F,Arity,MS,Opts}|
- expand_module_regexps_tp_2(MRest,F,Arity,MS,Opts,Rest,RegExpNode,Nodes)];
-expand_module_regexps_tp_2([],_,_,_,_,Rest,RegExpNode,Nodes) ->
- expand_module_regexps_tp(Rest,RegExpNode,Nodes).
-
-expand_module_regexps_ctp([E={M,_,_}|Rest],RegExpNode,Nodes) when is_atom(M) ->
- [E|expand_module_regexps_ctp(Rest,RegExpNode,Nodes)];
-expand_module_regexps_ctp([{M,F,Arity}|Rest],RegExpNode,Nodes) when is_list(M);is_tuple(M) ->
- case inviso_tool_lib:expand_module_names([RegExpNode],
- M,
- [{expand_only_at,RegExpNode}]) of
- {singlenode_expansion,Modules} ->
- expand_module_regexps_ctp_2(Modules,F,Arity,Rest,RegExpNode,Nodes);
- {error,_Reason} ->
- expand_module_regexps_ctp(Rest,RegExpNode,Nodes)
- end;
-expand_module_regexps_ctp([_|Rest],RegExpNode,Nodes) ->
- expand_module_regexps_tp(Rest,RegExpNode,Nodes); % Skip faulty module specification.
-expand_module_regexps_ctp([],_RegExpNodes,_Nodes) ->
- [].
-
-expand_module_regexps_ctp_2([M|MRest],F,Arity,Rest,RegExpNode,Nodes) ->
- [{M,F,Arity}|expand_module_regexps_ctp_2(MRest,F,Arity,Rest,RegExpNode,Nodes)];
-expand_module_regexps_ctp_2([],_,_,Rest,RegExpNode,Nodes) ->
- expand_module_regexps_ctp(Rest,RegExpNode,Nodes).
-%% -----------------------------------------------------------------------------
-
-
-
-%% Help function running the activation of a trace case. Note that this must
-%% be done at the inviso control component's Erlang node *and* that it must be
-%% done in its own process since there is no telling for how long a trace case
-%% may run.
-%% Returns {ok,ActivationHandler}.
-exec_trace_case_on(CNode,TraceCase,Bindings,Nodes) ->
- {ok,TcFName}=get_tc_activate_fname(TraceCase),
- {ok,exec_trace_case_2(CNode,
- TcFName,
- erl_eval:add_binding('Nodes',Nodes,Bindings),
- activating)}.
-
-%% Help function running the deactivation of a trace case.
-exec_trace_case_off(CNode,TraceCase,Bindings,Nodes) ->
- case get_tc_deactivate_fname(TraceCase) of
- {ok,TcFName} -> % There is a deactivation.
- {ok,exec_trace_case_2(CNode,
- TcFName,
- erl_eval:add_binding('Nodes',Nodes,Bindings),
- stopping)};
- false ->
- {error,no_deactivation}
- end.
-
-exec_trace_case_2(CNode,TcFName,Bindings,Phase) ->
- if
- CNode==undefined -> % The non distributed case.
- spawn_link(?MODULE,tc_executer,[TcFName,Bindings,Phase,self()]);
- true ->
- spawn_link(CNode,?MODULE,tc_executer,[TcFName,Bindings,Phase,self()])
- end.
-
-%% This function is run in its own process and is responsible for executing
-%% the trace case.
-tc_executer(TcFName,Bindings,Phase,Parent) ->
- case catch file:script(TcFName,Bindings) of
- {ok,Value} ->
- tc_executer_reply(Parent,{Phase,self(),{ok,Value}});
- {'EXIT',Reason} ->
- tc_executer_reply(Parent,{Phase,self(),{error,{'EXIT',Reason}}});
- Error ->
- tc_executer_reply(Parent,{Phase,self(),Error})
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function which starts a reactivator process redoing command history at
-%% Node. It also updates the loopdata to indicate that Node is now in state
-%% reactivating. It is a good idea to only handle one node per reactivator process.
-%% This because if the node terminates and comes back up, the reactivator must be
-%% stopped.
-redo_cmd_history(Node,LD=#ld{c_node=CNode,tc_dict=TCdict,chl=CHL,nodes=NodesD}) ->
- P=start_reactivator(Node,CNode,TCdict,CHL),
- LD#ld{nodes=set_reactivating_nodes(Node,NodesD),
- reactivators=add_reactivators(Node,P,LD#ld.reactivators)}.
-
-%% Help function starting a reactivator process replaying the command history log.
-%% Returns a pid of the reactivator process.
-start_reactivator(Node,CNode,TCdict,CHL) ->
- UnsortedLog=get_loglist_chl(CHL), % Must fetch here, later on wrong node.
- if
- CNode==undefined -> % The non-distributed case.
- spawn_link(?MODULE,
- reactivator_executer,
- [Node,TCdict,UnsortedLog,self(),0,[]]);
- true ->
- spawn_link(CNode,
- ?MODULE,
- reactivator_executer,
- [Node,TCdict,UnsortedLog,self(),0,[]])
- end.
-
-%% The strategy is to traverse the CHL ETS table in Counter order, redoing the
-%% commands one by one. We wait until one command is finished until we do the
-%% next. Commands marked as nullified are not performed. In fact when a command
-%% is nullified only the stop will be found in the CHL. Its activation will be
-%% removed.
-reactivator_executer(Node,TCdict,UnsortedLog,TPid,StartCounter,DoneCases) ->
- SortedLog=lists:keysort(2,UnsortedLog), % Sort on Counter, oldest first.
- Log=reactivator_skip_log_entries(SortedLog,StartCounter),
- case reactivator_executer_2(Node,TCdict,TPid,StartCounter,DoneCases,Log) of
- done ->
- true; % Simply terminate the reactivator then.
- {more,{NewStartCounter,NewDoneCases,NewUnsortedLog}} ->
- reactivator_executer(Node,TCdict,NewUnsortedLog,TPid,NewStartCounter,NewDoneCases)
- end.
-
-reactivator_executer_2(Node,TCdict,TPid,_Counter,DoneCases,
- [{{TCname,Id},NextC,running,Bindings}|Rest]) ->
- reactivator_executer_3(Node,TCdict,TPid,DoneCases,Rest,TCname,Id,NextC,Bindings,Rest);
-reactivator_executer_2(Node,TCdict,TPid,_Counter,DoneCases,
- [{{TCname,_Ref},NextC,Bindings}|Rest]) ->
- reactivator_executer_rtc(Node,TCdict,TPid,DoneCases,Rest,TCname,NextC,Bindings,Rest);
-reactivator_executer_2(Node,TCdict,TPid,_Counter,DoneCases,
- [{{TCname,Id},NextC,activating,Bindings}|Rest]) ->
- reactivator_executer_3(Node,TCdict,TPid,DoneCases,Rest,TCname,Id,NextC,Bindings,Rest);
-reactivator_executer_2(Node,TCdict,TPid,_Counter,DoneCases,
- [{{M,F,Args,_Ref},NextC}|Rest]) ->
- reactivator_executer_cmd(Node,M,F,Args),
- reactivator_executer_2(Node,TCdict,TPid,NextC,DoneCases,Rest);
-reactivator_executer_2(Node,TCdict,TPid,_Counter,DoneCases,
- [{{_TCname,_Id},NextC,stopping,_Bindings}|Rest]) ->
- reactivator_executer_2(Node,TCdict,TPid,NextC,DoneCases,Rest);
-reactivator_executer_2(Node,TCdict,TPid,_Counter,DoneCases,
- [{{TCname,Id,_Ref},NextC,stop,Bindings}|Rest]) ->
- case lists:member({TCname,Id},DoneCases) of
- true -> % We have activated it, must stop then.
- case get_tracecase_tc_dict(TCname,TCdict) of
- {ok,{_,_,_,_,FNameOff}} ->
- reactivator_executer_tc(Node,Bindings,FNameOff),
- NewDoneCases=lists:delete({TCname,Id},DoneCases),
- reactivator_executer_2(Node,TCdict,TPid,NextC,NewDoneCases,Rest);
- {ok,_} -> % No stop-filename, strange!
- reactivator_executer_2(Node,TCdict,TPid,NextC,DoneCases,Rest);
- false -> % Even stranger, does not exist!?
- reactivator_executer_2(Node,TCdict,TPid,NextC,DoneCases,Rest)
- end;
- false -> % Never activated in the first place.
- reactivator_executer_2(Node,TCdict,TPid,NextC,DoneCases,Rest)
- end;
-%% Done all log entries found this lap. See if there are more entries by now.
-reactivator_executer_2(_Node,_TCdict,TPid,Counter,DoneCases,[]) ->
- case reactivator_reply(TPid,Counter) of % Ask the tool process for more entries.
- done -> % No more entries in the CHL.
- done;
- {more,NewUnsortedLog} -> % Repeat the procedure
- {more,{Counter+1,DoneCases,NewUnsortedLog}} % with log entries from Counter+1.
- end.
-
-%% This help function activates a tracecase.
-reactivator_executer_3(Node,TCdict,TPid,DoneCases,Rest,TCname,Id,NextC,Bindings,Rest) ->
- case get_tracecase_tc_dict(TCname,TCdict) of
- {ok,{_,_,_,FNameOn}} -> % A case with just on functionality.
- reactivator_executer_tc(Node,Bindings,FNameOn),
- reactivator_executer_2(Node,TCdict,TPid,NextC,[{TCname,Id}|DoneCases],Rest);
- {ok,{_,_,_,FNameOn,_}} ->
- reactivator_executer_tc(Node,Bindings,FNameOn),
- reactivator_executer_2(Node,TCdict,TPid,NextC,[{TCname,Id}|DoneCases],Rest);
- false -> % Strange, does not exist anylonger!?
- reactivator_executer_2(Node,TCdict,TPid,NextC,DoneCases,Rest)
- end.
-
-%% Help function executing a trace case in the reactivators context. Does not
-%% return anything significant.
-reactivator_executer_tc(Node,Bindings,FileName) ->
- catch file:eval(FileName,erl_eval:add_binding('Nodes',[Node],Bindings)).
-
-%% Help function handling trace case that are simply executed - rtc.
-reactivator_executer_rtc(Node,TCdict,TPid,DoneCases,Rest,TCname,NextC,Bindings,Rest) ->
- case get_tracecase_tc_dict(TCname,TCdict) of
- {ok,{_,_,_,FNameOn}} -> % A case with just on functionality.
- reactivator_executer_tc(Node,Bindings,FNameOn),
- reactivator_executer_2(Node,TCdict,TPid,NextC,DoneCases,Rest);
- {ok,{_,_,_,FNameOn,_}} ->
- reactivator_executer_tc(Node,Bindings,FNameOn),
- reactivator_executer_2(Node,TCdict,TPid,NextC,DoneCases,Rest);
- false -> % Strange, does not exist anylonger!?
- reactivator_executer_2(Node,TCdict,TPid,NextC,DoneCases,Rest)
- end.
-
-reactivator_executer_cmd(nonode@nohost,M,F,Args) ->
- catch apply(M,F,Args); % Non-distributed.
-reactivator_executer_cmd(Node,M,F,Args) ->
- catch apply(M,F,[[Node]|Args]).
-
-%% Help function returning a list of log entries missing the first entries
-%% having a counter less or equal to C1.
-reactivator_skip_log_entries([{_,C,_,_}|Rest],C1) when C<C1 ->
- reactivator_skip_log_entries(Rest,C1);
-reactivator_skip_log_entries([{_,C}|Rest],C1) when C<C1 ->
- reactivator_skip_log_entries(Rest,C1);
-reactivator_skip_log_entries(Log,_) ->
- Log.
-%% -----------------------------------------------------------------------------
-
-%% Help function returning the node name to use in an rpc call.
-get_rpc_nodename(undefined) ->
- node();
-get_rpc_nodename(CNode) ->
- CNode.
-%% -----------------------------------------------------------------------------
-
-mk_rt_tag() ->
- inviso_tool.
-%% -----------------------------------------------------------------------------
-
-is_string([C|Rest]) when C>=32, C=<255 ->
- is_string(Rest);
-is_string([]) ->
- true;
-is_string(_) ->
- false.
-%% -----------------------------------------------------------------------------
-
-
-%% -----------------------------------------------------------------------------
-%% Functions for handling the configuration file.
-%% -----------------------------------------------------------------------------
-
-%% The inviso tool is configured via start arguments and/or a configuration file.
-%% Start arguments will override any definitions in a configuration file.
-%% The configuration file is pointed out by either a start argument or the
-%% inviso application parameter 'inviso_tool_config_file'.
-
-%% Help function building the internal configuration structure. Configurations
-%% in the start argument will override parameters found in a configuration file.
-fetch_configuration(Config) ->
- case fetch_config_filename(Config) of
- {ok,FName} -> % We are supposed to use a conf-file.
- case read_config_file(FName) of
- {ok,LD} -> % Managed to open a file.
- NewLD=read_config_list(LD,Config),
- {ok,NewLD};
- Error = {error,_Reason} -> % Problem finding/opening file.
- Error
- end;
- false -> % No filename specified.
- LD=read_config_list(#ld{},Config),
- {ok,LD}
- end.
-
-%% Help function determining the name of the file which shall be consulted as
-%% the main configuration file.
-%% Returns {ok,FileName} or 'false'. The latter if no name could be determined.
-fetch_config_filename(Config) ->
- case catch lists:keysearch(config_file,1,Config) of
- {value,{_,FName}} when is_list(FName) ->
- {ok,FName};
- _ -> % No filename in the start argument.
- fetch_config_filename_2()
- end.
-
-fetch_config_filename_2() ->
- case application:get_env(inviso_tool_config_file) of
- {ok,FName} when is_list(FName) ->
- {ok,FName};
- _ -> % Application parameter not specified.
- false % Means no config file will be used.
- end.
-
-%% Help function reading the configuration file. Returns a #conf or {error,Reason}.
-read_config_file(FName) ->
- case catch file:consult(FName) of
- {ok,Terms} ->
- {ok,read_config_list(#ld{},Terms)};
- {error,Reason} ->
- {error,{file_consult,Reason}};
- {'EXIT',Reason} ->
- {error,{failure,Reason}}
- end.
-
-%% Help function traversing the Terms list entering known tag-values into #ld.
-read_config_list(LD,Terms) ->
- LD#ld{
- nodes = case mk_nodes(proplists:get_value(nodes,Terms,LD#ld.nodes)) of
- {ok,Nodes} -> Nodes;
- _ -> LD#ld.nodes
- end,
- c_node = proplists:get_value(c_node,Terms,LD#ld.c_node), % atom8)
- regexp_node = proplists:get_value(regexp_node,Terms,LD#ld.regexp_node), % atom()
- tc_def_file = proplists:get_value(tc_def_file,Terms,LD#ld.tc_def_file),
- tdg = proplists:get_value(tdg,Terms,LD#ld.tdg),
- debug = proplists:get_value(debug,Terms,LD#ld.debug),
- initial_tcs = proplists:get_value(initial_tcs,Terms,LD#ld.initial_tcs),
- dir = proplists:get_value(dir,Terms,LD#ld.dir),
- optg = proplists:get_value(optg,Terms,LD#ld.optg)
- }.
-
-%% -----------------------------------------------------------------------------
-
-
-%% Help function which, if it exists, consults the trace definition file. The
-%% idea behind the trace definition file is to point out which trace cases there
-%% are, where to find them and how to turn them on and off.
-%% Trace case definitions are:
-%% {TCname,Type,VariableNameList,ActivatioFileName} |
-%% {TCname,Type,VariableNameList,ActivationFileName,DeactivationFileName}
-%% TCname=atom()
-%% Type=on | on_off
-%% VariableNameList=[atom(),...]
-%% ActivationFileName=DeactivationFileName=string()
-read_trace_case_definitions(LD) ->
- case LD#ld.tc_def_file of
- TCfileName when is_list(TCfileName) ->
- case catch file:consult(TCfileName) of
- {ok,Terms} ->
- Dir=LD#ld.dir, % The working directory of the tool.
- TCdict=read_trace_case_definitions_2(Terms,Dir,mk_tc_dict()),
- LD#ld{tc_dict=TCdict};
- _ ->
- LD
- end;
- _ ->
- LD
- end.
-
-read_trace_case_definitions_2([{TCname,on,VarNames,FName}|Rest],Dir,TCdict) ->
- FileName=make_absolute_path(FName,Dir),
- read_trace_case_definitions_2(Rest,
- Dir,
- insert_tracecase_tc_dict(TCname,
- on,
- VarNames,
- FileName,
- TCdict));
-read_trace_case_definitions_2([{TCname,on_off,VarNames,FNameOn,FNameOff}|Rest],Dir,TCdict) ->
- FileNameOn=make_absolute_path(FNameOn,Dir),
- FileNameOff=make_absolute_path(FNameOff,Dir),
- read_trace_case_definitions_2(Rest,
- Dir,
- insert_tracecase_tc_dict(TCname,
- on_off,
- VarNames,
- FileNameOn,
- FileNameOff,
- TCdict));
-read_trace_case_definitions_2([_|Rest],Dir,TCdict) ->
- read_trace_case_definitions_2(Rest,Dir,TCdict);
-read_trace_case_definitions_2([],_Dir,TCdict) ->
- TCdict.
-
-%% Help function returning an absolute path to FName if FName is not already
-%% absolute. Dir is the working dir of the tool and supposed to be absolute.
-make_absolute_path(FName,Dir) ->
- case filename:pathtype(FName) of
- absolute -> % Then do nothing, allready absolute.
- FName;
- _ ->
- filename:join(Dir,FName)
- end.
-%% -----------------------------------------------------------------------------
-
-get_status(undefined,_Node) ->
- inviso:get_status();
-get_status(CNode,Nodes) ->
- inviso_tool_lib:inviso_cmd(CNode,get_status,[Nodes]).
-%% -----------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% Internal data structure functions.
-%% =============================================================================
-
-%% -----------------------------------------------------------------------------
-%% The nodes database structure.
-%% -----------------------------------------------------------------------------
-
-%% The purpose of the nodes database structure is to keep track of what runtime
-%% nodes we have, and their current status.
-%% Implementation:
-%% [{NodeName,AvailableStatus},...] or AvailableStatus in the
-%% non-distributed case.
-%% AvailableStatus={up,Status1} | down
-%% Status1={State,Status} | reactivating
-%% State=tracing | inactive | trace_failure
-%% Status=running | suspended
-%% reactivating=the node is now being brought up to date.
-%% inactive=not tracing, can be initiated and then reactivated.
-%% The following states can occure.
-%% {inactive,running}
-%% Mainly when we start the tool, before a session has been started.
-%% {tracing,running}
-%% When a trace session is on-going.
-%% {trace_failure,running}
-%% If init_tracing failed for some reason.
-%% {tracing,suspended}
-%% reactivating
-%% The node is tracing (has always been) but was suspended. It is now
-%% no longer suspended and the tool is redong commands.
-%% {inactive,suspended}
-%% We can end up here if a session is stopped with this node suspended.
-
-%% Returns a nodes database structure filled with the nodes Nodes.
-mk_nodes(Nodes) when is_list(Nodes) ->
- {ok,lists:map(fun(N) when is_atom(N)->{N,down} end,Nodes)};
-mk_nodes(local_runtime) -> % The non-distributed case.
- down;
-mk_nodes(_Nodes) ->
- error.
-%% -----------------------------------------------------------------------------
-
-%% Updates the nodes database structure for each node that has been added.
-%% This is the case when we start the tool or reactivate a node. Note that a node
-%% may have become adopted instead of started.
-%% Returns a new nodes database structure.
-update_added_nodes(CNode,[{Node,NodeResult}|Rest],NodesD) ->
- case update_added_nodes_3(NodeResult) of
- already_added -> % Already added to the control component.
- case get_status(CNode,[Node]) of % Examine if it is tracing or not.
- {ok,[{Node,NodeResult2}]} ->
- Result=mk_nodes_state_from_status(NodeResult2),
- update_added_nodes_2(CNode,Node,Result,NodesD,Rest);
- {error,_Reason} -> % Strange, mark it as down now.
- update_added_nodes_2(CNode,Node,down,NodesD,Rest)
- end;
- Result ->
- update_added_nodes_2(CNode,Node,Result,NodesD,Rest)
- end;
-update_added_nodes(_CNode,[],NodesD) ->
- NodesD;
-update_added_nodes(_CNode,NodeResult,_NodesD) -> % Non distributed case.
- case update_added_nodes_3(NodeResult) of
- already_added -> % Already added, most likely autostart.
- mk_nodes_state_from_status(inviso:get_status());
- Result ->
- Result % Simply replace NodesD.
- end.
-
-update_added_nodes_2(CNode,Node,Result,NodesD,Rest) ->
- case lists:keysearch(Node,1,NodesD) of
- {value,_} -> % Node already exists, replace!
- update_added_nodes(CNode,Rest,lists:keyreplace(Node,1,NodesD,{Node,Result}));
- false -> % Strange, unknown node!
- update_added_nodes(CNode,Rest,NodesD)
- end.
-
-update_added_nodes_3({ok,{adopted,tracing,running,_Tag}}) ->
- {up,{tracing,running}};
-update_added_nodes_3({ok,{adopted,tracing,{suspended,_SReason},_Tag}}) ->
- {up,{tracing,suspended}};
-update_added_nodes_3({ok,{adopted,_,running,_Tag}}) ->
- {up,{inactive,running}};
-update_added_nodes_3({ok,{adopted,_,{suspended,_SReason},_Tag}}) ->
- {up,{inactive,suspended}};
-update_added_nodes_3({ok,new}) ->
- {up,{inactive,running}};
-update_added_nodes_3({ok,already_added}) ->
- already_added; % This is an error value!
-update_added_nodes_3({error,_Reason}) ->
- down.
-%% -----------------------------------------------------------------------------
-
-%% Function marking all nodes that, according to the returnvalue from init_tracing,
-%% now are successfully initiated as tracing and running. Note that nodes that
-%% does not fully respond 'ok' when init_tracing are marked as 'trace_failure'.
-%% Also note that we assume that the nodes must be running to have made it this far.
-%% A node can of course have become suspended in the process, but that node will
-%% be marked as suspended later when that inviso event message arrives to the tool.
-%% Returns {NewNodesD,Nodes} where Nodes are the nodes that actually got initiated
-%% as a result of the init_tracing call (judged from the LogResults).
-set_tracing_running_nodes(undefined,{ok,_LogResults},_AvailableStatus) -> % Non-distr. case.
- {{up,{tracing,running}},local_runtime};
-set_tracing_running_nodes(undefined,{error,already_initiated},_) -> % Non-distributed case.
- {mk_nodes_state_from_status(inviso:get_status()),[]}; % Ask it for its status.
-set_tracing_running_nodes(undefined,{error,_Reason},_) -> % Non-distributed case.
- {down,[]}; % This is questionable!
-set_tracing_running_nodes(CNode,{ok,NodeResults},NodesD) ->
- set_tracing_running_nodes_2(CNode,NodeResults,NodesD,[]).
-
-set_tracing_running_nodes_2(CNode,[{Node,{ok,_LogResults}}|Rest],NodesD,Nodes) ->
- case lists:keysearch(Node,1,NodesD) of
- {value,_} ->
- NewNodesD=lists:keyreplace(Node,1,NodesD,{Node,{up,{tracing,running}}}),
- set_tracing_running_nodes_2(CNode,Rest,NewNodesD,[Node|Nodes]);
- false -> % Strange.
- set_tracing_running_nodes_2(CNode,Rest,NodesD,Nodes)
- end;
-set_tracing_running_nodes_2(CNode,[{Node,{error,already_initiated}}|Rest],NodesD,Nodes) ->
- case get_status(CNode,[Node]) of % Then we must ask what it is doing now.
- {ok,[{Node,NodeResult}]} ->
- Result=mk_nodes_state_from_status(NodeResult),
- NewNodesD=lists:keyreplace(Node,1,NodesD,{Node,Result}),
- set_tracing_running_nodes_2(CNode,Rest,NewNodesD,Nodes);
- {error,_Reason} -> % Strange, mark it as down.
- NewNodesD=lists:keyreplace(Node,1,NodesD,{Node,down}),
- set_tracing_running_nodes_2(CNode,Rest,NewNodesD,Nodes)
- end;
-set_tracing_running_nodes_2(CNode,[{Node,{error,_Reason}}|Rest],NodesD,Nodes) ->
- NewNodesD=lists:keyreplace(Node,1,NodesD,{Node,{up,{trace_failure,running}}}),
- set_tracing_running_nodes_2(CNode,Rest,NewNodesD,Nodes);
-set_tracing_running_nodes_2(_CNode,[],NodesD,Nodes) ->
- {NodesD,Nodes}. % New NodesD and nodes successfully initiated.
-
-%% -----------------------------------------------------------------------------
-
-%% Function updating Node in the NodesD structure and sets it to 'down'.
-%% Returns a new nodes structure.
-set_down_nodes(Node,[{Node,_}|Rest]) ->
- [{Node,down}|Rest];
-set_down_nodes(Node,[NodeStruct|Rest]) ->
- [NodeStruct|set_down_nodes(Node,Rest)];
-set_down_nodes(_,[]) ->
- [];
-set_down_nodes(_,_) -> % Non-distributed case.
- down. % One can argue if this can happend.
-%% -----------------------------------------------------------------------------
-
-%% Function updating Node in NodesD to now be suspended. Note that if the node is
-%% reactivating it must be moved to state tracing because that is what is doing.
-set_suspended_nodes(Node,[{Node,{up,reactivating}}|Rest]) ->
- [{Node,{up,{tracing,suspended}}}|Rest];
-set_suspended_nodes(Node,[{Node,{up,{State,_}}}|Rest]) ->
- [{Node,{up,{State,suspended}}}|Rest];
-set_suspended_nodes(Node,[NodesData|Rest]) ->
- [NodesData|set_suspended_nodes(Node,Rest)];
-set_suspended_nodes(_Node,[]) -> % Hmm, strange why did we end up here?
- [];
-set_suspended_nodes(_,{up,reactivating}) -> % Non-distributed case.
- {up,{tracing,suspended}};
-set_suspended_nodes(_,{up,{State,_}}) ->
- {up,{State,suspended}}.
-%% -----------------------------------------------------------------------------
-
-%% This function is called when reactivation is completed. Hence it moves the
-%% node to no longer suspended. Note this can mean that the node is either
-%% tracing or inactive. Reactivation is not allowed for a node have trace_failure.
-set_running_nodes(Node,NodesD) when is_list(NodesD) ->
- case lists:keysearch(Node,1,NodesD) of
- {value,{_,AvailableStatus}} ->
- lists:keyreplace(Node,1,NodesD,{Node,set_running_nodes_2(AvailableStatus)});
- false -> % Very strange!
- NodesD
- end;
-set_running_nodes(_,NodesD) -> % The non-distributed case.
- set_running_nodes_2(NodesD).
-
-set_running_nodes_2({up,reactivating}) ->
- {up,{tracing,running}};
-set_running_nodes_2({up,{State,suspended}}) ->
- {up,{State,running}}.
-%% -----------------------------------------------------------------------------
-
-%% Function marking node as now reactivating. That means it is not suspended
-%% any longer (and tracing), but still not part of the set of nodes which shall
-%% get all commands. Returns a new NodesD.
-set_reactivating_nodes(Node,[{Node,_}|Rest]) ->
- [{Node,{up,reactivating}}|Rest];
-set_reactivating_nodes(Node,[NodesData|Rest]) ->
- [NodesData|set_reactivating_nodes(Node,Rest)];
-set_reactivating_nodes(_,[]) ->
- [];
-set_reactivating_nodes(_,{up,_}) -> % The non-distributed case.
- {up,reactivating}.
-%% -----------------------------------------------------------------------------
-
-%% Function called when stop-tracing is done. That is all nodes in Nodes shall
-%% be inactive now. Note that an inactive node can still be suspended.
-%% Returns a new NodesD.
-set_inactive_nodes(_,{up,reactivating}) -> % Non-distributed case.
- {up,{inactive,running}};
-set_inactive_nodes(_,{up,{_,Status}}) -> % Tracing or trace_failure.
- {up,{inactive,Status}};
-set_inactive_nodes(_,down) ->
- down;
-set_inactive_nodes([{Node,ok}|Rest],NodesD) ->
- case lists:keysearch(Node,1,NodesD) of
- {value,{_,{up,reactivating}}} ->
- set_inactive_nodes(Rest,lists:keyreplace(Node,1,NodesD,{Node,{up,{inactive,running}}}));
- {value,{_,{up,{_,Status}}}} -> % Tracing or trace_failure.
- set_inactive_nodes(Rest,lists:keyreplace(Node,1,NodesD,{Node,{up,{inactive,Status}}}));
- _ -> % This should not happend.
- set_inactive_nodes(Rest,NodesD)
- end;
-set_inactive_nodes([{_Node,_Error}|Rest],NodesD) ->
- set_inactive_nodes(Rest,NodesD);
-set_inactive_nodes([],NodesD) ->
- NodesD.
-%% -----------------------------------------------------------------------------
-
-%% Returns a list of all node names. Note that it can only be used in the
-%% distributed case.
-get_all_nodenames_nodes(NodesD) ->
- lists:map(fun({Node,_})->Node end,NodesD).
-%% -----------------------------------------------------------------------------
-
-%% Returns a list of all nodes that are up, tracing and running (not suspended),
-%% or 'void' in the non-distributed case. This is the list of nodes that shall get
-%% inviso commands.
-get_nodenames_running_nodes([{Node,{up,{tracing,running}}}|Rest]) ->
- [Node|get_nodenames_running_nodes(Rest)];
-get_nodenames_running_nodes([{_Node,_}|Rest]) ->
- get_nodenames_running_nodes(Rest);
-get_nodenames_running_nodes([]) ->
- [];
-get_nodenames_running_nodes(_) ->
- void. % When non distributed, N/A.
-%% -----------------------------------------------------------------------------
-
-%% Returns a list of nodes that can be made to initiate tracing.
-get_inactive_running_nodes({up,{inactive,running}}) ->
- local_runtime;
-get_inactive_running_nodes(NonDistributed) when not(is_list(NonDistributed)) ->
- [];
-get_inactive_running_nodes([{Node,{up,{inactive,running}}}|Rest]) ->
- [Node|get_inactive_running_nodes(Rest)];
-get_inactive_running_nodes([{_Node,_}|Rest]) ->
- get_inactive_running_nodes(Rest);
-get_inactive_running_nodes([]) ->
- [].
-%% -----------------------------------------------------------------------------
-
-%% Returns a list of nodes that are currently tracing (not necessarily running).
-%% In the non-distributed case the status of the runtime component will be
-%% returned.
-%% Note that nodes showing trace_failure will be included since we like to stop
-%% tracing at those nodes too.
-get_tracing_nodes([{Node,{up,{tracing,_}}}|Rest]) ->
- [Node|get_tracing_nodes(Rest)];
-get_tracing_nodes([{Node,{up,{trace_failure,_}}}|Rest]) ->
- [Node|get_tracing_nodes(Rest)];
-get_tracing_nodes([{Node,{up,reactivating}}|Rest]) ->
- [Node|get_tracing_nodes(Rest)];
-get_tracing_nodes([_|Rest]) ->
- get_tracing_nodes(Rest);
-get_tracing_nodes([]) ->
- [];
-get_tracing_nodes(AvailableStatus) ->
- AvailableStatus.
-%% -----------------------------------------------------------------------------
-
-%% Returns a list of all nodes that are currently up.
-get_available_nodes(down) ->
- undefined;
-get_available_nodes([{_Node,down}|Rest]) ->
- get_available_nodes(Rest);
-get_available_nodes([{Node,_}|Rest]) ->
- [Node|get_available_nodes(Rest)];
-get_available_nodes([]) ->
- [].
-%% -----------------------------------------------------------------------------
-
-%% Function returning the "state" of Node. Mainly used to check if the node is
-%% suspended or not.
-%% Returns {State,Status} | reactivating | down
-%% where
-get_state_nodes(Node,NodesD) when is_list(NodesD) ->
- case lists:keysearch(Node,1,NodesD) of
- {value,{_,AvailableStatus}} ->
- get_state_nodes_2(AvailableStatus);
- false ->
- false
- end;
-get_state_nodes(_,NodesD) -> % Non distributed case.
- get_state_nodes_2(NodesD).
-
-get_state_nodes_2({up,{trace_failure,Status}}) ->
- {trace_failure,Status};
-get_state_nodes_2({up,{State,suspended}}) -> % {tracing|inactive,suspended}
- {State,suspended};
-get_state_nodes_2({up,reactivating}) ->
- reactivating;
-get_state_nodes_2({up,{State,running}}) ->
- {State,running};
-get_state_nodes_2(down) ->
- down.
-%% -----------------------------------------------------------------------------
-
-%% Help function in the case we need to consult the state/status of a runtime
-%% component. Returns a nodesD value that can be added to the nodes database.
-mk_nodes_state_from_status({ok,{tracing,running}}) ->
- {up,{tracing,running}};
-mk_nodes_state_from_status({ok,{tracing,{suspended,_SReason}}}) ->
- {up,{tracing,suspended}};
-mk_nodes_state_from_status({ok,{_,running}}) ->
- {up,{inactive,running}};
-mk_nodes_state_from_status({ok,{_,{suspended,_SReason}}}) ->
- {up,{inactive,suspended}};
-mk_nodes_state_from_status({error,_Reason}) ->
- down.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% The session_state.
-%% -----------------------------------------------------------------------------
-
-%% The session state reflects if the inviso_tool is tracing or not.
-%% This means that if the tool is tracing a reconnected node can be made to
-%% restart_session.
-
-%% Returns the correct value indicating that we are tracing now.
-tracing_sessionstate() ->
- tracing.
-%% -----------------------------------------------------------------------------
-
-%% Returns true or false depending on if we are tracing now or not.
-is_tracing(tracing) ->
- true;
-is_tracing(_) ->
- false.
-%% -----------------------------------------------------------------------------
-
-%% Returns the correct value indicating that the tool is not tracing.
-passive_sessionstate() ->
- idle.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% The tracer_data datastructure.
-%% -----------------------------------------------------------------------------
-
-%% The tracer_data structure collects the tracer data arguments used to init tracing
-%% by this inviso tool. The args are saved per session. Each session has
-%% a number.
-%% Implementation:
-%% Sessions=[{SessionNr,TDGargs},...]
-%% SessionNr=integer()
-%% TDGargs=list(), args given to the tracer data generator
-%% minus the first argument which is the Node name.
-
-%% Function taking tracerdata args structure inserting yet another session.
-%% Returns {SessionNr,NewTDs}.
-insert_td_tracer_data(TDGargs,TDs=[{SNr,_}|_]) ->
- {SNr+1,[{SNr+1,TDGargs}|TDs]};
-insert_td_tracer_data(TDGargs,undefined) ->
- {1,[{1,TDGargs}]}.
-%% -----------------------------------------------------------------------------
-
-%% Returns the latest session nr.
-get_latest_session_nr_tracer_data(undefined) ->
- undefined;
-get_latest_session_nr_tracer_data([{SessionNr,_}|_]) ->
- SessionNr.
-%% -----------------------------------------------------------------------------
-
-%% Returns the tracer data arguments used when creating the trace data for the
-%% latest session.
-get_latest_tdgargs_tracer_data(undefined) ->
- undefined;
-get_latest_tdgargs_tracer_data([{_,TDGargs}|_]) ->
- TDGargs.
-%% -----------------------------------------------------------------------------
-
-
-%% -----------------------------------------------------------------------------
-%% The tc_dict or trace case dictionary datastructure.
-%% -----------------------------------------------------------------------------
-
-%% The tc_dict stores information about all available trace cases.
-%% Implementation:
-%% [{TCname,Type,VarNames,FNameOn [,FNameOff]},...]
-%% TCname=atom()
-%% Type=on | on_off
-%% VarNames=[atom(),...]
-%% FNameOn=FNameOff=string()
-
-%% Returns the empty trace case dictionary.
-mk_tc_dict() ->
- [].
-%% -----------------------------------------------------------------------------
-
-%% Function inserting a new trace case into the trace case dictionary.
-insert_tracecase_tc_dict(TCname,on,VarNames,FNameOn,TCdict) ->
- [{TCname,on,VarNames,FNameOn}|TCdict].
-insert_tracecase_tc_dict(TCname,on_off,VarNames,FNameOn,FNameOff,TCdict) ->
- [{TCname,on_off,VarNames,FNameOn,FNameOff}|TCdict].
-%% -----------------------------------------------------------------------------
-
-%% Function finding a trace case definition in the tc_dict structure.
-%% Returns {ok,{TCname,Type,VarNAmes,FNameOn [,FNameOff]}} or 'false'.
-get_tracecase_tc_dict(TCname,[Tuple|_]) when element(1,Tuple)==TCname ->
- {ok,Tuple};
-get_tracecase_tc_dict(TCname,[_|Rest]) ->
- get_tracecase_tc_dict(TCname,Rest);
-get_tracecase_tc_dict(_,[]) ->
- false;
-get_tracecase_tc_dict(_,_) -> % There are no trace cases!
- false.
-%% -----------------------------------------------------------------------------
-
-%% Function working on the trace case definition returned by get_tracecase_tc_dict/2
-%% function.
-%% Returning {ok,ActivationFileName}.
-get_tc_activate_fname({_TCname,_Type,_VarNames,FNameOn}) ->
- {ok,FNameOn};
-get_tc_activate_fname({_TCname,_Type,_VarNames,FNameOn,_FNameOff}) ->
- {ok,FNameOn}.
-
-get_tc_deactivate_fname({_TCname,_Type,_VarNames,_FNameOn,FNameOff}) ->
- {ok,FNameOff};
-get_tc_deactivate_fname(_) -> % Not a case with off function.
- false.
-
-get_tc_varnames({_TCname,_Type,VarNames,_FNameOn}) ->
- VarNames;
-get_tc_varnames({_TCname,_Type,VarNames,_FNameOn,_FNameOff}) ->
- VarNames.
-
-%% -----------------------------------------------------------------------------
-
-
-%% The Command History Log (CHL) stores commands to make it possible to
-%% reactivate suspended nodes, reconnect restarted nodes, and to make
-%% autostart files.
-%% Each time tracing is initiated (that is started) the CHL is cleared since
-%% it would not make scense to repeat commands from an earlier tracing at
-%% reactivation for instance.
-
-%% Implementation: {NextCounter,OnGoingList,ETStable}
-%% NextCounter=integer(), next command number - to be able to sort them in order.
-%% OnGoingList=[{ProcH,{TCname,ID}},...]
-%% ID=term(), instance id for this execution of this trace case.
-%% ETStable=tid() -> {{TCname,Id},Counter,State1,Bindings}
-%% ETStable=tid() -> {{TCname,Id},Counter,running,Bindings,Result} |
-%% {{TCname,Id,#Ref},Counter,stop,Bindings} |
-%% {{TCname,#Ref},Counter,Bindings} % An rtc
-%% {{M,F,Args,#Ref},Counter}
-%% Counter=integer(), the order-counter for this logged entry.
-%% State1=activating | stopping
-%% Where:
-%% activating: the activation file for the tracecase is running.
-%% running : activation is completed.
-%% stopping : set on the previously running ETS entry when deactivation
-%% file is currently executing.
-%% stop : entered with own Counter into the ETS table when
-%% deactivation file is executing. Remains after too.
-%% Result=term(), the result returned from the tr-case or inviso call.
-
-
-%% Returning an initial empty CHL.
-mk_chl(undefined) ->
- {1,[],ets:new(inviso_tool_chl,[set,protected])};
-mk_chl({_,_,TId}) ->
- ets:delete(TId),
- mk_chl(undefined).
-
-%% Help function returning 'true' if there is a current history.
-history_exists_chl(undefined) ->
- false;
-history_exists_chl({_,_,_}) ->
- true.
-
-%% Function looking up the state of this trace case.
-find_id_chl(TCname,Id,{_NextCounter,_OnGoingList,TId}) ->
- case ets:lookup(TId,{TCname,Id}) of
- [{_,_,running,Bindings,_Result}] -> % The trace case is tracing.
- {ok,Bindings};
- [{_,_,State,_}] -> % activating or stopping.
- State;
- [] ->
- false
- end.
-
-%% Function finding the Trace case associated with a process handle
-%% doing this trace case's activation or stopping.
-find_tc_executer_chl(ProcH,{_,OnGoingList,TId}) ->
- case lists:keysearch(ProcH,1,OnGoingList) of
- {value,{_,{TCname,Id}}} ->
- [{_,_,State,_}]=ets:lookup(TId,{TCname,Id}),
- {State,{TCname,Id}}; % Should be activating or stopping.
- false ->
- false
- end.
-
-%% Adds a Trace case to the CHL. This is done when it is turned on. Or when it
-%% is called for trace cases that do not have on/off functionality.
-set_activating_chl(TCname,Id,{Counter,OnGoingList,TId},Bindings,ProcH) ->
- ets:insert(TId,{{TCname,Id},Counter,activating,Bindings}),
- {Counter+1,[{ProcH,{TCname,Id}}|OnGoingList],TId}.
-
-%% Function marking a trace case as now running. That is the activation
-%% phase is completed. It is normaly completed when the process executing
-%% the trace case signals that it is done.
-set_running_chl(ProcH,TCname,Id,Result,{NextCounter,OnGoingList,TId}) ->
- [{_,Counter,_,Bindings}]=ets:lookup(TId,{TCname,Id}),
- ets:insert(TId,{{TCname,Id},Counter,running,Bindings,Result}),
- NewOnGoingList=lists:keydelete(ProcH,1,OnGoingList),
- {NextCounter,NewOnGoingList,TId}.
-
-%% Function marking trace case TCname with identifier Id as now in its stopping
-%% state. Where ProcH is the handler to the process running the stopping
-%% trace case.
-set_stopping_chl(TCname,Id,{NextCounter,OnGoingList,TId},ProcH)->
- [{_,Counter,_,Bindings,_}]=ets:lookup(TId,{TCname,Id}),
- ets:insert(TId,{{TCname,Id},Counter,stopping,Bindings}),
- ets:insert(TId,{{TCname,Id,make_ref()},NextCounter,stop,Bindings}),
- {NextCounter+1,[{ProcH,{TCname,Id}}|OnGoingList],TId}.
-
-%% Function removing a TCname-Id from the CHL. This is mostly used
-%% if activating the trace case failed for some reason. We do not then
-%% expect the user to stop the trace case. Hence it must be removed now.
-%% A reactivation process may have noticed the activating-entry and started
-%% to activate it. But since the general state reached after an unsuccessful
-%% activation can not easily be determined, we don't try to do much about it.
-del_tc_chl(ProcH,TCname,Id,{NextCounter,OnGoingList,TId}) ->
- ets:delete(TId,{TCname,Id}),
- NewOnGoingList=lists:keydelete(ProcH,1,OnGoingList),
- {NextCounter,NewOnGoingList,TId}.
-
-%% Function removing the entry TCname+Id from the CHL. This makes it
-%% possible to activate a tracecase with this id again. The entry was
-%% previously marked as stopping.
-nullify_chl(ProcH,TCname,Id,{NextCounter,OnGoingList,TId}) ->
- ets:delete(TId,{TCname,Id}),
- NewOnGoingList=lists:keydelete(ProcH,1,OnGoingList),
- {NextCounter+1,NewOnGoingList,TId}.
-
-%% Function stopping all processes saved as being now running tc executers.
-%% This is useful as cleanup during stop tracing for instance.
-%% Returns a new CHL which is not in all parts correct. Entries in the
-%% ETS table are for instance not properly state-changed. But the CHL will
-%% from now on only be used to create command files and similar.
-stop_all_tc_executer_chl({NextCounter,[{ProcH,_}|Rest],TId}) ->
- exit(ProcH,kill),
- stop_all_tc_executer_chl({NextCounter,Rest,TId});
-stop_all_tc_executer_chl({NextCounter,[],TId}) ->
- {NextCounter,[],TId}.
-
-%% Function adding a "plain" inviso call to the CHL.
-add_inviso_call_chl(Cmd,Args,{NextCounter,OnGoingList,TId}) ->
- ets:insert(TId,{{inviso,Cmd,Args,make_ref()},NextCounter}),
- {NextCounter+1,OnGoingList,TId}.
-
-%% Function adding a run trace case entry to the chl.
-add_rtc_chl(TCname,Bindings,{NextCounter,OnGoingList,TId}) ->
- ets:insert(TId,{{TCname,make_ref()},NextCounter,Bindings}),
- {NextCounter+1,OnGoingList,TId}.
-%% Returns the highest used counter number in the command history log.
-get_highest_used_counter_chl({NextCounter,_,_}) ->
- NextCounter-1.
-
-%% Help function returning a list of {{TCname,Id},Phase} for all ongoing
-%% assynchronous tracecases.
-get_ongoing_chl(undefined) ->
- [];
-get_ongoing_chl({_,OngoingList,TId}) ->
- get_ongoing_chl_2(OngoingList,TId).
-
-get_ongoing_chl_2([{_ProcH,{TCname,Id}}|Rest],TId) ->
- case ets:lookup(TId,{TCname,Id}) of
- [{_,_C,activating,_B}] ->
- [{{TCname,Id},activating}|get_ongoing_chl_2(Rest,TId)];
- [{_,_C,stopping,_B}] ->
- [{{TCname,Id},deactivating}|get_ongoing_chl_2(Rest,TId)]
- end;
-get_ongoing_chl_2([],_) ->
- [].
-
-%% Function returning a list of log entries. Note that the list is unsorted
-%% in respect to Counter.
-get_loglist_chl({_,_,TId}) ->
- L=ets:tab2list(TId),
- lists:map(fun({{TC,Id},C,S,B,_Result}) -> {{TC,Id},C,S,B}; % running
- (Tuple={{_TC,_Id},_C,_S,_B}) -> Tuple; % activating | stopping
- (Tuple={{_TC,_Id,_Ref},_C,_S,_B}) -> Tuple; % stop
- (Tuple={{_M,_F,_Args,_Ref},_C}) -> Tuple;
- (Tuple={{_TC,_Ref},_C,_B}) -> Tuple
- end,
- L);
-get_loglist_chl(_) -> % The history is not initiated, ever!
- [].
-
-%% Function returning a list of log entries, but only those which are not
-%% cancelled out by deactivations.
-% get_loglist_active_chl({_,_,TId}) ->
-% L=ets:tab2list(TId),
-% lists:zf(fun({{TC,Id},C,S,B,_Result}) -> {true,{{TC,Id},C,S,B}}; % running
-% (Tuple={{_TC,_Id},_C,_S,_B}) -> Tuple; % activating | stopping
-% (Tuple={{_TC,_Id,_Ref},_C,_S,_B}) -> Tuple; % stop
-% (Tuple={{_M,_F,_Args,_Ref},_C}) -> Tuple
-% end,
-% L);
-% get_loglist_chl(_) -> % The history is not initiated, ever!
-% [].
-
-
-%% This helpfunction recreates a history from a saved history list. This function
-%% is supposed to crash if the log is not well formatted. Note that we must restore
-%% the counter in order for the counter to work if new commands are added to the
-%% history.
-replace_history_chl(OldCHL,SortedLog) ->
- {_,Ongoing,TId}=mk_chl(OldCHL),
- {NewTId,Counter}=replace_history_chl_2(TId,SortedLog,0),
- {ok,{Counter+1,Ongoing,NewTId}}.
-
-replace_history_chl_2(TId,[{{TC,Id},C,running,B}|Rest],_Counter) ->
- ets:insert(TId,{{TC,Id},C,running,B,undefined}),
- replace_history_chl_2(TId,Rest,C);
-replace_history_chl_2(TId,[{{M,F,Args},C}|Rest],_Counter) ->
- ets:insert(TId,{{M,F,Args,make_ref()},C}),
- replace_history_chl_2(TId,Rest,C);
-replace_history_chl_2(TId,[{TC,C,B}|Rest],_Counter) ->
- ets:insert(TId,{{TC,make_ref()},C,B}),
- replace_history_chl_2(TId,Rest,C);
-replace_history_chl_2(TId,[],Counter) ->
- {TId,Counter}.
-%% -----------------------------------------------------------------------------
-
-
-%% -----------------------------------------------------------------------------
-%% Reactivators data structure.
-%% -----------------------------------------------------------------------------
-
-%% Function adding a new node-reactivatorpid pair to the reactivators structure.
-%% In this way we know which reactivators to remove if Node terminates, or when
-%% a node is fully updated when a reactivator is done.
-add_reactivators(Node,Pid,Reactivators) ->
- [{Node,Pid}|Reactivators].
-
-%% Function removing a reactivator entry from the reactivators structure.
-del_reactivators(RPid,[{_Node,RPid}|Rest]) ->
- Rest;
-del_reactivators(RPid,[Element|Rest]) ->
- [Element|del_reactivators(RPid,Rest)];
-del_reactivators(_,[]) -> % This should not happend.
- [].
-
-get_node_reactivators(RPid,Reactivators) ->
- case lists:keysearch(RPid,2,Reactivators) of
- {value,{Node,_}} ->
- Node;
- false -> % This should not happend.
- false
- end.
-
-%% Returns a list of list all nodes that are currently reactivating.
-get_all_nodes_reactivators([{Nodes,_Pid}|Rest]) ->
- [Nodes|get_all_nodes_reactivators(Rest)];
-get_all_nodes_reactivators([]) ->
- [].
-
-%% Function stopping all running reactivator processes. Returns a new empty
-%% reactivators structure. Note that this function does not set the state of
-%% Nodes. It must most often be set to running.
-stop_all_reactivators([{_Nodes,Pid}|Rest]) ->
- exit(Pid,kill),
- stop_all_reactivators(Rest);
-stop_all_reactivators([]) ->
- []. % Returns an empty reactivators.
-
-%% Help function stopping the reactivator (if any) that reactivates Node.
-%% Returns a new list of reactivators structure.
-stop_node_reactivators(Node,[{Node,Pid}|Rest]) ->
- exit(Pid,kill),
- Rest;
-stop_node_reactivators(Node,[NodePid|Rest]) ->
- [NodePid|stop_node_reactivators(Node,Rest)];
-stop_node_reactivators(_,[]) ->
- [].
-%% -----------------------------------------------------------------------------
-
-
-%% -----------------------------------------------------------------------------
-%% Started initial trace cases data structure.
-%% -----------------------------------------------------------------------------
-
-%% This datastructure keeps information about ongoing trace cases started
-%% automatically at init_tracing. These must be automatically stopped when calling
-%% stop_tracing.
-
-add_initial_tcs(TCname,Id,StartedInitialTcs) ->
- [{TCname,Id}|StartedInitialTcs].
-%% -----------------------------------------------------------------------------
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/lib/inviso/src/inviso_tool_lib.erl b/lib/inviso/src/inviso_tool_lib.erl
deleted file mode 100644
index f221c4b6de..0000000000
--- a/lib/inviso/src/inviso_tool_lib.erl
+++ /dev/null
@@ -1,379 +0,0 @@
-% ``The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved via the world wide web at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
-%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
-%% AB. All Rights Reserved.''
-%%
-%% $Id$
-%%
-%% Description:
-%% Support module to the inviso tool.
-%%
-%% Authors:
-%% Lennart Öhman, [email protected]
-%% -----------------------------------------------------------------------------
-
--module(inviso_tool_lib).
-
-%% -----------------------------------------------------------------------------
-%% Exported library APIs
-%% -----------------------------------------------------------------------------
--export([inviso_cmd/3,expand_module_names/3,make_patterns/7,std_tdg/2]).
--export([mk_tdg_args/2,mk_complete_tdg_args/2,get_datetime_from_tdg_args/1]).
--export([debug/3]).
-
-%% -----------------------------------------------------------------------------
-%% Constants.
-%% -----------------------------------------------------------------------------
--define(DBG_OFF,off). % No internal debug indicator.
-
-
-%% =============================================================================
-%% Functions for inviso_cmd
-%% =============================================================================
-
-%% Help function which executes a trace control call. The reason for having a special
-%% function is that we either want to do rpc if the trace control component is
-%% located on another Erlang node than this one. Or call trace_c directly if
-%% it actually is on this node.
-%% Returns whatever the inviso function returns. In case of badrpc it is wrapped
-%% in an error-tuple.
-inviso_cmd(NodeName,Func,Args) ->
- case node() of
- NodeName -> % Control component on this node.
- apply(inviso,Func,Args);
- _ -> % On other node, must do RPC.
- case rpc:call(NodeName,inviso,Func,Args) of
- {badrpc,Reason} ->
- {error,{badrpc,Reason}};
- Result ->
- Result
- end
- end.
-%% -----------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% Functions for expand_module_names
-%% =============================================================================
-
-%% Help function which expands the module name depending on how it is expressed.
-%% Setting Nodes to 'void' makes it non-distributed, expanding only here.
-%% The following special cases are handled:
-%% '_' =All modules, no expansion into individual module names. Instead
-%% it is intended to use the '_' mechanism in the trace_pattern BIF.
-%% Can therefore not be combined with a directory regexp.
-%% "*" =Is translated into ".*".
-%% "abc"=Means ".*abc.*". Can only be used for module or directory names
-%% containing upper or lowercase, digits and a slash.
-%% Returns {multinode_expansion,NodeModules},
-%% {singlenode_expansion,Modules},
-%% 'module', 'wildcard' or {error,Reason},
-%% To limit the places where expansion is done, the option {expand_only_at,Node}
-%% can be provided in the Opts list.
-%% In the non-distributed case the singlenode_expansion will be returned.
-expand_module_names(_Nodes,Mod={_,'_'},_) ->
- {error,{faulty_regexp_combination,Mod}};
-expand_module_names(Nodes,{DirStr,ModStr},Opts) when is_list(DirStr), is_list(ModStr) ->
- case expand_module_names_special_regexp(DirStr) of
- {ok,NewDirStr} ->
- case expand_module_names_special_regexp(ModStr) of
- {ok,NewModStr} ->
- expand_module_names_2(Nodes,NewDirStr,NewModStr,Opts);
- {error,_Reason} ->
- {error,{faulty_regexp,ModStr}}
- end;
- {error,_Reason} ->
- {error,{faulty_regexp,DirStr}}
- end;
-expand_module_names(_,'_',_Opts) -> % If we want to trace all modules
- wildcard; % we shall not expand it.
-expand_module_names(_Nodes,Mod,_Opts) when is_atom(Mod) ->
- module; % If it is an atom, no expansion.
-expand_module_names(Nodes,"*",Opts) -> % Treat this as a reg.exp.
- expand_module_names(Nodes,".*",Opts);
-expand_module_names(Nodes,ModStr,Opts) when is_list(ModStr) ->
- case expand_module_names_special_regexp(ModStr) of
- {ok,NewModStr} ->
- expand_module_names_2(Nodes,NewModStr,Opts);
- {error,_Reason} ->
- {error,{faulty_regexp,ModStr}}
- end.
-
-expand_module_names_2(void,ModStr,Opts) -> % Non-distributed case.
- {singlenode_expansion,inviso_rt_lib:expand_regexp(ModStr,Opts)};
-expand_module_names_2(Nodes,ModStr,Opts) ->
- case get_expand_regexp_at_opts(Opts) of
- {ok,Node} -> % Expansion only at this node.
- case inviso_rt_lib:expand_regexp([Node],ModStr,Opts) of
- [{Node,Modules}] when is_list(Modules) ->
- {singlenode_expansion,Modules};
- [{Node,_}] -> % Most likely badrpc.
- {error,{faulty_node,Node}}
- end;
- false -> % Expand on all nodes.
- Result=inviso_rt_lib:expand_regexp(Nodes,ModStr,Opts),
- {multinode_expansion,Result}
- end.
-expand_module_names_2(void,DirStr,ModStr,Opts) -> % Non-distributed case.
- {singlenode_expansion,inviso_rt_lib:expand_regexp(DirStr,ModStr,Opts)};
-expand_module_names_2(Nodes,DirStr,ModStr,Opts) ->
- case get_expand_regexp_at_opts(Opts) of
- {ok,Node} -> % Expansion only at this node.
- case inviso_rt_lib:expand_regexp([Node],DirStr,ModStr,Opts) of
- [{Node,Modules}] when is_list(Modules) ->
- {singlenode_expansion,Modules};
- [{Node,_}] -> % Most likely badrpc.
- {error,{faulty_node,Node}}
- end;
- false -> % Expand on all nodes.
- Result=inviso_rt_lib:expand_regexp(Nodes,DirStr,ModStr,Opts),
- {multinode_expansion,Result}
- end.
-
-%% Help function which converts a special regexp into a proper one. With
-%% special regexps we mean e.g:"abc" which is supposed to mean ".*abc.*".
-%% Always returns a regexp or {error,Reason}.
-expand_module_names_special_regexp(Str) ->
- StrLen=length(Str),
- case re:run(Str,"[0-9a-zA-Z_/]*") of
- {match,[{0,StrLen}]} -> % Ok, it is the special case.
- {ok,".*"++Str++".*"}; % Convert it to a proper regexp.
- {match,_} ->
- {ok,Str}; % Keep it and hope it is a regexp.
- nomatch ->
- {ok,Str}; % Keep it and hope it is a regexp.
- {error,Reason} -> % Can't continue with this!
- {error,Reason}
- end.
-%% -----------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% Functions for make_pattern.
-%% =============================================================================
-
--define(DEPTH,3). % Max recursive safety catch depth.
-
-%% Help function that creates trace-patterns for each module in the list.
-%% It can handle both lists of modules or lists of nodes and modules.
-%% It will also in the process apply safety catches, if such are not disabled,
-%% in order to prevent certain patterns to form.
-%% The safety catch function is supposed to return either 'ok' or {new,NewTracePattern}.
-%% Where the NewTracePattern is a list of zero or more {M,F,Arity,MS}. The
-%% NewTracePatter is then the replacement for the tried trace-pattern.
-%% Note that the new trace-pattern(s) are also tried against all safety catches.
-%% This can possibly result in even replacements of the replacements. There is
-%% a depth meter to prevent the safety catch mechanism from circularly expanding
-%% trace patterns for ever.
-%% Returns a list of [{Node,PatternList},...] or [Pattern,...].
-%% The latter is used when the modules have been expanded on a single node.
-make_patterns(Catches,Opts,Dbg,NodeModsOrMods,F,A,MS) ->
- OwnArg=get_ownarg_opts(Opts),
- case get_disable_safety_opts(Opts) of
- true -> % Do not use the safety catches.
- make_patterns_2(void,OwnArg,Dbg,NodeModsOrMods,F,A,MS);
- false ->
- make_patterns_2(Catches,OwnArg,Dbg,NodeModsOrMods,F,A,MS)
- end.
-
-make_patterns_2(Catches,OwnArg,Dbg,[{Node,Mods}|Rest],F,A,MS) when is_list(Mods) ->
- TPs=make_patterns_3(Catches,OwnArg,Dbg,Mods,F,A,MS,[]),
- [{Node,join_patterns(TPs)}|make_patterns_2(Catches,OwnArg,Dbg,Rest,F,A,MS)];
-make_patterns_2(Catches,OwnArg,Dbg,[{_Node,_}|Rest],F,A,MS) -> % badrpc!?
- make_patterns_2(Catches,OwnArg,Dbg,Rest,F,A,MS);
-make_patterns_2(Catches,OwnArg,Dbg,Modules,F,A,MS) when is_list(Modules) ->
- TPs=make_patterns_3(Catches,OwnArg,Dbg,Modules,F,A,MS,[]),
- join_patterns(TPs);
-make_patterns_2(_,_,_,[],_,_,_) ->
- [].
-
-make_patterns_3(void,OwnArg,Dbg,[M|Rest],F,A,MS,Result) -> % S-catches not used!
- make_patterns_3(void,OwnArg,Dbg,Rest,F,A,MS,[{M,F,A,MS}|Result]);
-make_patterns_3(Catches,OwnArg,Dbg,[M|Rest],F,A,MS,Result) ->
- NewTPs=try_safety_catches(Catches,OwnArg,[{M,F,A,MS}],Dbg,[],?DEPTH),
- make_patterns_3(Catches,OwnArg,Dbg,Rest,F,A,MS,[NewTPs|Result]);
-make_patterns_3(_,_,_,[],_,_,_,Result) ->
- lists:flatten(Result).
-
-try_safety_catches(_Catches,_OwnArg,TPs,Dbg,_Accum,0) -> % Max depth here!
- debug(max_catch_depth,Dbg,[TPs]),
- TPs; % Just return them unchanged.
-try_safety_catches(Catches,OwnArg,[TP={M,F,A,MS}|Rest],Dbg,Accum,Depth) ->
- case try_safety_catch(Catches,OwnArg,M,F,A,MS,Dbg) of
- ok -> % This pattern is safe!
- try_safety_catches(Catches,OwnArg,Rest,Dbg,[TP|Accum],?DEPTH);
- {new,NewTPs} -> % Then we must try them too!
- NewTPs2=try_safety_catches(Catches,OwnArg,NewTPs,Dbg,[],Depth-1),
- try_safety_catches(Catches,OwnArg,Rest,Dbg,[NewTPs2|Accum],?DEPTH)
- end;
-try_safety_catches(_,_,[],_,Accum,_) ->
- Accum.
-
-try_safety_catch([{SafetyMod,SafetyFunc}|Rest],OwnArg,M,F,A,MS,Dbg) ->
- case (catch apply(SafetyMod,SafetyFunc,[M,F,A,MS,OwnArg])) of
- ok -> % This catch has no oppinion about it.
- try_safety_catch(Rest,OwnArg,M,F,A,MS,Dbg); % Continue with the next.
- {new,NewTPs} -> % Replace it with this or these new.
- debug(safety_catch,Dbg,[new,{SafetyMod,SafetyFunc},M,F,A,MS,NewTPs]),
- {new,NewTPs}; % and stop trying safety cathes.
- {'EXIT',Reason} -> % Something wrong with the safety catch.
- debug(safety_catch,Dbg,['EXIT',{SafetyMod,SafetyFunc},M,F,A,MS,Reason]),
- try_safety_catch(Rest,OwnArg,M,F,A,MS,Dbg) % Skip it and go on.
- end;
-try_safety_catch([],_,_,_,_,_,_) ->
- ok. % Since it passed all, it is safe!
-%% -----------------------------------------------------------------------------
-
-%% Help function that joins patterns together. This is necessary since you can
-%% only set the pattern once for a module-function-arity. This function can not
-%% remove conflicting match-spec "commands". Match-specs will simply be concatenated.
-%% Returns a list of patterns where each mod-func-arity is unique.
-join_patterns(Patterns) ->
- join_patterns_2(Patterns,[]).
-
-join_patterns_2([{M,F,Arity,MS}|Rest],Result) ->
- case join_patterns_is_already_done(M,F,Arity,Result) of
- false -> % No we have not collapsed this one.
- case join_patterns_3(M,F,Arity,Rest) of
- [] -> % No this combination is unique.
- join_patterns_2(Rest,[{M,F,Arity,MS}|Result]);
- MSs -> % We got a list of all other TPs.
- join_patterns_2(Rest,[{M,F,Arity,MS++MSs}|Result])
- end;
- true -> % We already joined this M-F-Arity.
- join_patterns_2(Rest,Result) % Simply skip it, already done.
- end;
-join_patterns_2([],Result) ->
- Result. % Reversed but does not matter!
-
-%% Help function checking if we have already built a trace-pattern for
-%% this M-F-Arity. If so, the found M-F-Arity is already handled.
-join_patterns_is_already_done(M,F,Arity,[{M,F,Arity,_}|_]) ->
- true;
-join_patterns_is_already_done(M,F,Arity,[_|Rest]) ->
- join_patterns_is_already_done(M,F,Arity,Rest);
-join_patterns_is_already_done(_,_,_,[]) ->
- false.
-
-%% Help function which simply concatenates all match-specs for this
-%% M-F-Arity.
-join_patterns_3(M,F,Arity,[{M,F,Arity,MS}|Rest]) ->
- [MS|join_patterns_3(M,F,Arity,Rest)];
-join_patterns_3(M,F,Arity,[_|Rest]) ->
- join_patterns_3(M,F,Arity,Rest);
-join_patterns_3(_,_,_,[]) ->
- [].
-%% -----------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% Function for tracer data creation.
-%% =============================================================================
-
--define(I2L(Arg),integer_to_list(Arg)).
-
-%% The inviso_tool uses a tracer-data generator function to create the tracer_data
-%% specification for each node that shall participate in tracing controlled
-%% through the inviso-tool. If no own tracer data generator function is specified,
-%% this function is used.
-std_tdg(Node,{{Y,Mo,D},{H,Mi,S}}) ->
- NameStr=atom_to_list(Node)++"_"++?I2L(Y)++"-"++?I2L(Mo)++"-"++?I2L(D)++"_"++
- ?I2L(H)++"-"++?I2L(Mi)++"-"++?I2L(S),
- LogTD={file,NameStr++".log"},
- TiTD={file,NameStr++".ti"},
- [{trace,LogTD},{ti,TiTD}].
-%% ------------------------------------------------------------------------------
-
-%% mk_tdg_args(DateTime,Args)=TDGargs
-%% DateTime={Date,Time}
-%% Date=tuple(),
-%% Time=tuple(),
-%% Args=list()
-%% TDGargs=list(),
-%% Creates the TDGargs list used when calling functions making the CompleteTDGargs.
-mk_tdg_args(DateTime,Args) ->
- [DateTime|Args].
-%% ------------------------------------------------------------------------------
-
-%% mk_complete_tdg_args(Node,TDGargs)=CompleteTDGargs
-%% Returns the list of all arguments a tracer data generator function must accept.
-mk_complete_tdg_args(Node,TDGargs) ->
- [Node|TDGargs].
-%% ------------------------------------------------------------------------------
-
-%% get_datetime_from_tdg_args(TDGargs)=DateTime
-%% Function returning the DateTime tuple in a TDGargs list.
-get_datetime_from_tdg_args([DateTime|_]) ->
- DateTime.
-%% ------------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% Various help functions.
-%% =============================================================================
-
-%% -----------------------------------------------------------------------------
-%% Functions handling set trace-pattern options.
-%% -----------------------------------------------------------------------------
-
-%% Gets additional arguments given to various configurable functions.
-%% Returns a list.
-get_ownarg_opts(Opts) ->
- case lists:keysearch(arg,1,Opts) of
- {value,{_,OwnArg}} when is_list(OwnArg) ->
- OwnArg;
- {value,{_,OwnArg}} ->
- [OwnArg];
- false ->
- []
- end.
-%% -----------------------------------------------------------------------------
-
-get_disable_safety_opts(Opts) ->
- case lists:member(disable_safety,Opts) of
- true ->
- true;
- false ->
- false
- end.
-%% -----------------------------------------------------------------------------
-
-get_expand_regexp_at_opts(Opts) ->
- case lists:keysearch(expand_only_at,1,Opts) of
- {value,{_,Node}} when is_atom(Node) ->
- {ok,Node};
- _ ->
- false
- end.
-%% -----------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% Functions for the internal debugging system.
-%% =============================================================================
-
-%% The debug system is meant to provide tracing of inviso tool at different levels.
-%%
-%% debug(What,Level,Description) -> nothing significant.
-%% What : controls what kind of event. This can both be certain parts of the tool
-%% as well as certain levels (info to catastrophy).
-%% Level: Determines if What shall be printed or not.
-%% Description: this is what happend.
-debug(_What,?DBG_OFF,_Description) ->
- true; % Debug is off, no action.
-debug(What,On,Description) ->
- debug_2(What,On,Description).
-
-debug_2(What,_,Description) ->
- io:format("INVISO DEBUG:~w, ~p~n",[What,Description]).
-%% -----------------------------------------------------------------------------
diff --git a/lib/inviso/src/inviso_tool_sh.erl b/lib/inviso/src/inviso_tool_sh.erl
deleted file mode 100644
index b02f498c5b..0000000000
--- a/lib/inviso/src/inviso_tool_sh.erl
+++ /dev/null
@@ -1,1749 +0,0 @@
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%% Description:
-%% The runtime component of the trace tool Inviso.
-%%
-%% Authors:
-%% Lennart �hman, [email protected]
-%% -----------------------------------------------------------------------------
-
--module(inviso_tool_sh).
-
-%% Inviso Session Handler.
-%% This is the code for the session handler process. Its purpose is that we have
-%% one session handler process for each trace session started through the
-%% start_session inviso tool API. The session handler process is responsible for:
-%%
-%% -Knowing the state/status of all participating runtime components.
-%% -Keeping storage of all tracerdata all our participants have used. This means
-%% also to find out the tracerdata of runtime components connecting by them
-%% selves.
-%%
-%% STORAGE STRATEGY
-%% ----------------
-%% The local information storage can be changed by two things. Either by executing
-%% commands issued through our APIs. Or by receiving trace_event from the control
-%% component. When we execute commands, a corresponding event will also follow.
-%% Meaning that in those situations we are informed twice.
-%% A simple strategy could be to wait for the event even when doing the changes
-%% to the runtime components our self (through commands). But that may result in
-%% a small time frame where someone might do yet another command and failing
-%% because the local information storage is not uptodate as it would have been
-%% expected to be. Therefore we always update the local storage when making changes
-%% to a runtime component our selves. There will eventually be a double update
-%% through an incoming event. But the storage must coop with that, preventing
-%% inconsitancies to happend. An example of a strategy is that the tracerdata table
-%% is a bag, not allowing for double entries of the same kind. Therefore a double
-%% update is harmless there.
-
-%% ------------------------------------------------------------------------------
-%% Module wide constants.
-%% ------------------------------------------------------------------------------
--define(LOCAL_RUNTIME,local_runtime). % Used as node name when non-disitrbuted.
--define(TRACING,tracing). % A state defined by the control component.
--define(RUNNING,running). % A status according to control componet.
-
--define(COPY_LOG_FROM,copy_log_from). % Common fileystem option.
-%% ------------------------------------------------------------------------------
-
-%% ------------------------------------------------------------------------------
-%% API exports.
-%% ------------------------------------------------------------------------------
--export([start_link/5,start_link/8]).
--export([cancel_session/1,stop_session/3]).
--export([reactivate/1,reactivate/2]).
--export([ctpl/5,tpl/5,tpl/6,tpl/7,
- tf/2,tf/3,
- tpm_localnames/2,init_tpm/6,init_tpm/9,tpm/6,tpm/7,tpm/10,
- tpm_ms/7,ctpm_ms/6,ctpm/5
- ]).
-%% ------------------------------------------------------------------------------
-
-
-%% ------------------------------------------------------------------------------
-%% Internal exports.
-%% ------------------------------------------------------------------------------
--export([init/1,handle_call/3,handle_info/2,terminate/2]).
-
--export([get_loopdata/1]).
-%% ------------------------------------------------------------------------------
-
-
-%% ------------------------------------------------------------------------------
-%% Includes.
-%% ------------------------------------------------------------------------------
--include_lib("kernel/include/file.hrl"). % Necessary for file module.
-%% ------------------------------------------------------------------------------
-
-
-%% ==============================================================================
-%% Exported API functions.
-%% ==============================================================================
-
-%% start_link(From,NodeParams,CtrlNode,CtrlPid,SafetyCatches,NodesIn,NodesNotIn) =
-%% {ok,Pid} | {error,Reason}
-%% From= pid(), the initial client expecting the reply.
-%% NodeParams=[{Node,TracerData},{Node,TracerData,Opts}...]
-%% CtrlNode=atom() | 'void', the node where the trace control component is.
-%% CtrlPid=pid(), the pid of the trace control component.
-%% SafetyCatches=
-%% Dir=string(), where to place fetched logs and the merged log.
-%% Dbg=debug structure.
-%% NodesIn=[Node,...], list of nodes already in another session.
-%% NodesNotIn=[Node,...], list of nodes not in another session.
-%%
-%% Starts a session-handler. It keeps track of the the state and status of all
-%% participating runtime components. Note that there is a non-distributed case too.
-%% In the non-distributed case there is no things such as CtrlNode.
-start_link(From,TracerData,CtrlPid,SafetyCatches,Dbg) ->
- gen_server:start_link(?MODULE,
- {self(),From,TracerData,CtrlPid,SafetyCatches,Dbg},
- []).
-
-start_link(From,NodeParams,CtrlNode,CtrlPid,SafetyCatches,Dbg,NodesIn,NodesNotIn) ->
- gen_server:start_link(?MODULE,
- {self(),From,NodeParams,CtrlNode,CtrlPid,
- SafetyCatches,Dbg,NodesIn,NodesNotIn},
- []).
-%% ------------------------------------------------------------------------------
-
-%% Stops tracing where it is ongoing. Fetches all logfiles.
-stop_session(SID,Dir,Prefix) ->
- gen_server:call(SID,{stop_session,Dir,Prefix}).
-%% ------------------------------------------------------------------------------
-
-%% stop_session(SID) = ok
-%%
-%% Cancels the session brutaly. All runtime components are made to stop tracing,
-%% all local log files are removed using the tracerdata we know for them.
-cancel_session(SID) ->
- gen_server:call(SID,cancel_session).
-%% ------------------------------------------------------------------------------
-
-%% reactivate(SID) = {ok,
-%% reactivate(SID,Nodes) = {ok,NodeResults} | {error,Reason}.
-%% SID=session id, pid().
-%% Nodes=[Node,...]
-%% NodeResult=[{Node,Result},...]
-%% Result={Good,Bad}
-%% Good,Bad=integer(), the number of redone activities.
-%%
-%% Function which reactivates runtime components being suspended. This is done
-%% replaying all trace flags (in the correct order) to the corresponding nodes.
-%% Note that this may also mean turning flags off. Like first turning them on
-%% then off a split second later.
-reactivate(SID) ->
- gen_server:call(SID,reactivate). %% NOT IMPLEMENTED YET.
-reactivate(SID,Nodes) ->
- gen_server:call(SID,{reactivate,Nodes}).
-%% ------------------------------------------------------------------------------
-
-
-%% tpl(SessionID,Mod,Func,Arity,MS)=
-%% tpl(SessionID,Mod,Func,Arity,MS,Opts)={ok,N}|{error,Reason}.
-%% tpl(SessionID,Nodes,Mod,Func,Arity,MS)=
-%% tpl(SessionID,Nodes,Mod,Func,Arity,MS,Opts)={ok,Result}|{error,Reason}
-%% Mod='_' | ModuleName | ModRegExp | {DirRegExp,ModRegExp}
-%% ModRegExp=DirRegExp= string()
-%% Func='_' | FunctionName
-%% Arity='_' | integer()
-%% MS=[] | false | a match specification
-%% Opts=[Opts,...]
-%% Opt={arg,Arg}, disable_safety, {expand_regexp_at,NodeName}, only_loaded
-%% Nodes=[NodeName,...]
-tpl(SID,Mod,Func,Arity,MS) ->
- gen_server:call(SID,{tp,tpl,Mod,Func,Arity,MS,[]}).
-tpl(SID,Mod,Func,Arity,MS,Opts) when list(MS);MS==true;MS==false ->
- gen_server:call(SID,{tp,tpl,Mod,Func,Arity,MS,Opts});
-tpl(SID,Nodes,Mod,Func,Arity,MS) when integer(Arity);Arity=='_' ->
- gen_server:call(SID,{tp,tpl,Nodes,Mod,Func,Arity,MS,[]}).
-tpl(SID,Nodes,Mod,Func,Arity,MS,Opts) ->
- gen_server:call(SID,{tp,tpl,Nodes,Mod,Func,Arity,MS,Opts}).
-%% ------------------------------------------------------------------------------
-
-%% ctpl(SessionID,Nodes,Mod,Func,Arity)=
-%% See tpl/X for arguments.
-%%
-%% Removes local trace-patterns from functions.
-ctpl(SID,Nodes,Mod,Func,Arity) ->
- gen_server:call(SID,{ctp,ctpl,Nodes,Mod,Func,Arity}).
-%% ------------------------------------------------------------------------------
-
-
-tpm_localnames(SID,Nodes) ->
- gen_server:call(SID,{tpm_localnames,Nodes}).
-
-%% tpm_globalnames(SID,Nodes) ->
-%% gen_server:call(SID,{tpm_globalnames,Nodes}).
-
-init_tpm(SID,Nodes,Mod,Func,Arity,CallFunc) ->
- gen_server:call(SID,{init_tpm,Nodes,Mod,Func,Arity,CallFunc}).
-init_tpm(SID,Nodes,Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc) ->
- gen_server:call(SID,
- {init_tpm,Nodes,Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc}).
-tpm(SID,Nodes,Mod,Func,Arity,MS) ->
- gen_server:call(SID,{tpm,Nodes,Mod,Func,Arity,MS}).
-tpm(SID,Nodes,Mod,Func,Arity,MS,CallFunc) ->
- gen_server:call(SID,{tpm,Nodes,Mod,Func,Arity,MS,CallFunc}).
-tpm(SID,Nodes,Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc) ->
- gen_server:call(SID,{tpm,Nodes,Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc}).
-
-tpm_ms(SID,Nodes,Mod,Func,Arity,MSname,MS) ->
- gen_server:call(SID,{tpm_ms,Nodes,Mod,Func,Arity,MSname,MS}).
-
-ctpm_ms(SID,Nodes,Mod,Func,Arity,MSname) ->
- gen_server:call(SID,{tpm_ms,Nodes,Mod,Func,Arity,MSname}).
-
-ctpm(SID,Nodes,Mod,Func,Arity) ->
- gen_server:call(SID,{ctpm,Nodes,Mod,Func,Arity}).
-%% ------------------------------------------------------------------------------
-
-
-%% tf(SessionID,Nodes,TraceConfList)=
-%% TraceConfList=[{PidSpec,Flags},...]
-%% PidSpec=pid()|atom()|all|new|existing
-%% Flags=[Flag,...]
-tf(SID,TraceConfList) ->
- gen_server:call(SID,{tf,TraceConfList}).
-tf(SID,Nodes,TraceConfList) ->
- gen_server:call(SID,{tf,Nodes,TraceConfList}).
-%% ------------------------------------------------------------------------------
-
-
-get_loopdata(SID) ->
- gen_server:call(SID,get_loopdata).
-%% ------------------------------------------------------------------------------
-
-%% ==============================================================================
-%% Genserver call-backs.
-%% ==============================================================================
-
-%% Initial function for the session handler process. The nodes participating in
-%% the session must previously have been added to our control component by the tool.
-%% The session handler first finds out the state/status of the specified runtime
-%% components, then it tries to initiate tracing on those where it is applicable.
-%% Note that a reply to the initial (tool)client is done from here instead from
-%% the tool-server.
-init({Parent,From,TracerData,CtrlPid,SafetyCatches,Dbg}) -> % The non-distributed case.
- {ok,StateStatus}=init_rtcomponent_states([],void,CtrlPid,[?LOCAL_RUNTIME]),
- case is_tool_internal_tracerdata(TracerData) of
- false -> % We shall initiate local runtime.
- case inviso:init_tracing(TracerData) of
- ok ->
- gen_server:reply(From,{ok,{self(),ok}}),
- {ok,mk_ld(Parent,
- void,
- CtrlPid,
- to_rtstates([{?LOCAL_RUNTIME,{tracing,?RUNNING},[]}]),
- [{?LOCAL_RUNTIME,TracerData}],
- [],
- SafetyCatches,
- Dbg)};
- {error,Reason} -> % It might have become suspended?!
- gen_server:reply(From,{error,Reason}),
- {ok,mk_ld(Parent,
- void,
- CtrlPid,
- to_rtstates([{?LOCAL_RUNTIME,StateStatus,[]}]),
- [{?LOCAL_RUNTIME,TracerData}],
- [],
- SafetyCatches,
- Dbg)}
- end;
- true -> % We shall not pass this one on.
- gen_server:reply(From,{ok,{self(),ok}}), % Then it is ok.
- {ok,mk_ld(Parent,
- void,
- CtrlPid,
- to_rtstates([{?LOCAL_RUNTIME,StateStatus,[]}]),
- [],
- [?LOCAL_RUNTIME],
- SafetyCatches,
- Dbg)}
- end;
-init({Parent,From,NodeParams,CtrlNode,CtrlPid,SafetyCatches,Dbg,NodesIn,NodesNotIn}) ->
- case init_rtcomponent_states(NodeParams,CtrlNode,CtrlPid,NodesNotIn) of
- {ok,States} -> % A list of {Node,{State,Status},Opts}.
- {NodeParams2,Nodes2}=remove_nodeparams(NodesIn,NodeParams),
- case inviso_tool_lib:inviso_cmd(CtrlNode,init_tracing,[NodeParams2]) of
- {ok,Result} -> % Resulted in state changes!
- RTStates=set_tracing_rtstates(to_rtstates(States),Result),
- ReplyValue=init_fix_resultnodes(NodesIn,Nodes2,Result),
- gen_server:reply(From,{ok,{self(),ReplyValue}}),
- {ok,mk_ld(Parent,CtrlNode,CtrlPid,RTStates,
- NodeParams2,Nodes2,SafetyCatches,Dbg)};
- {error,Reason} -> % Some general failure.
- inviso_tool_lib:inviso_cmd(CtrlNode,unsubscribe,[]),
- gen_server:reply(From,{error,{init_tracing,Reason}}),
- {stop,{init_tracing,Reason}};
- What ->
- io:format("GOT:~n~w~n",[What]),
- exit(foo)
- end;
- {error,Reason} -> % Unable to get the state/status.
- inviso_tool_lib:inviso_cmd(CtrlNode,unsubscribe,[]),
- gen_server:reply(From,{error,Reason}),
- {stop,{error,Reason}};
- What ->
- io:format("GOT:~n~w~n",[What]),
- exit(foo)
- end.
-%% ------------------------------------------------------------------------------
-
-%% To stop a session means stop the tracing and remove all local files on the
-%% runtime nodes. We do have a table with all tracer data and that is how we are
-%% going to recreate what files to remove.
-%% Since runtime components may actually change state when this procedure is
-%% on-going, we do not care! It is the state in the session handling process at
-%% the time of start of this procedure which is used.
-handle_call(cancel_session,_From,LD) ->
- CtrlNode=get_ctrlnode_ld(LD),
- RTStates=get_rtstates_ld(LD),
- Dbg=get_dbg_ld(LD),
- TracingNodes=get_all_tracing_nodes_rtstates(RTStates),
- case stop_all_tracing(CtrlNode,Dbg,TracingNodes) of
- ok-> % Hopefully all nodes are stopped now.
- AvailableNodes=get_all_available_nodes_rtstates(RTStates),
- TRDstorage=get_trdstorage_ld(LD),
- remove_all_local_logs(CtrlNode,TRDstorage,AvailableNodes,Dbg),
- {stop,normal,ok,LD}; % LD actually not correct now!
- {error,Reason} -> % Some serious error when stop_tracing.
- {stop,normal,{error,Reason},LD}
- end;
-%% ------------------------------------------------------------------------------
-
-%% *Stop all tracing on runtime components still tracing.
-%% *Copy all local log files to the collection directory.
-handle_call({stop_session,Dir,Prefix},_From,LD) ->
- case check_directory_exists(Dir) of % Check that this directory exists here.
- true ->
- RTStates=get_rtstates_ld(LD),
- CtrlNode=get_ctrlnode_ld(LD),
- Dbg=get_dbg_ld(LD),
- TracingNodes=get_all_tracing_nodes_rtstates(RTStates),
- case stop_all_tracing(CtrlNode,Dbg,TracingNodes) of
- ok -> % Hopefully no node is still tracing now.
- TRDstorage=get_trdstorage_ld(LD),
- AvailableNodes=get_all_available_nodes_rtstates(RTStates),
- {FailedNodes,FetchedFiles}=
- transfer_logfiles(RTStates,CtrlNode,Dir,Prefix,
- TRDstorage,Dbg,AvailableNodes),
- RemoveNodes= % We only delete local logs where fetch ok.
- lists:filter(fun(N)->
- case lists:keysearch(N,1,FailedNodes) of
- {value,_} ->
- false;
- false ->
- true
- end
- end,
- AvailableNodes),
- remove_all_local_logs(CtrlNode,TRDstorage,RemoveNodes,Dbg),
- {stop,normal,{ok,{FailedNodes,FetchedFiles}},LD};
- {error,Reason} -> % Some general failure, quit.
- {stop,normal,{error,Reason},LD}
- end;
- false -> % You specified a non-existing directory!
- {reply,{error,{faulty_dir,Dir}},LD}
- end;
-%% ------------------------------------------------------------------------------
-
-handle_call({reactivate,Nodes},_From,LD) ->
- RTStates=get_rtstates_ld(LD),
- {OurNodes,OtherNodes}=
- remove_nodes_not_ours(Nodes,get_all_session_nodes_rtstates(RTStates)),
- CtrlNode=get_ctrlnode_ld(LD),
- ACTstorage=get_actstorage_ld(LD),
- case h_reactivate(CtrlNode,OurNodes,ACTstorage) of
- {ok,Results} -> % A list of {Node,Result}.
- if
- OtherNodes==[] -> % Normal case, no non-session nodes.
- {reply,{ok,Results},LD};
- true -> % Add error values for non-session nodes.
- {reply,
- {ok,
- lists:map(fun(N)->{N,{error,not_in_session}} end,OtherNodes)++
- Results},
- LD}
- end;
- {error,Reason} -> % Then this error takes presidence.
- {reply,{error,Reason},LD}
- end;
-%% ------------------------------------------------------------------------------
-
-%% Call-back for set trace-pattern for both global and local functions.
-handle_call({tp,PatternFunc,Mod,F,A,MS,Opts},_From,LD) ->
- Reply=h_tp(all,PatternFunc,Mod,F,A,MS,Opts,LD), % For all active nodes in the session.
- {reply,Reply,LD};
-handle_call({tp,PatternFunc,Nodes,Mod,F,A,MS,Opts},_From,LD) ->
- RTStates=get_rtstates_ld(LD),
- SNodes=get_all_session_nodes_rtstates(RTStates), % Notes belongoing to the session.
- {Nodes2,FaultyNodes}=remove_nodes_not_ours(Nodes,SNodes),
- Reply=h_tp(Nodes2,PatternFunc,Mod,F,A,MS,Opts,LD),
- ErrorReply=lists:map(fun(N)->{N,{error,not_in_session}} end,FaultyNodes),
- {reply,ErrorReply++Reply,LD};
-%% ------------------------------------------------------------------------------
-
-%% Call-back handling the removal of both local and global trace-patterns.
-%% NOT IMPLEMENTED YET.
-handle_call({ctp,PatternFunc,Nodes,Mod,F,A},_From,LD) ->
- Reply=h_ctp(Nodes,PatternFunc,Mod,F,A,LD),
- {reply,Reply,LD};
-%% ------------------------------------------------------------------------------
-
-handle_call({tpm_localnames,Nodes},_From,LD) ->
- RTStates=get_rtstates_ld(LD),
- OurNodes=get_all_session_nodes_rtstates(RTStates),
- {Nodes2,NotOurNodes}=remove_nodes_not_ours(Nodes,OurNodes),
- ACTstorage=get_actstorage_ld(LD),
- {Reply,NewACTstorage}=
- h_tpm_localnames(get_ctrlnode_ld(LD),Nodes2,RTStates,ACTstorage),
- ErrorReply=lists:map(fun(N)->{N,{error,not_in_session}} end,NotOurNodes),
- {reply,ErrorReply++Reply,put_actstorage_ld(NewACTstorage,LD)};
-
-handle_call({init_tpm,Nodes,Mod,Func,Arity,CallFunc},_From,LD) ->
- RTStates=get_rtstates_ld(LD),
- OurNodes=get_all_session_nodes_rtstates(RTStates),
- {Nodes2,NotOurNodes}=remove_nodes_not_ours(Nodes,OurNodes),
- ACTstorage=get_actstorage_ld(LD),
- {Reply,NewACTstorage}=
- h_all_tpm(get_ctrlnode_ld(LD),
- Nodes2,
- init_tpm,
- [Mod,Func,Arity,CallFunc],
- RTStates,
- ACTstorage),
- ErrorReply=lists:map(fun(N)->{N,{error,not_in_session}} end,NotOurNodes),
- {reply,ErrorReply++Reply,put_actstorage_ld(NewACTstorage,LD)};
-
-handle_call({init_tpm,Nodes,Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc},_From,LD) ->
- RTStates=get_rtstates_ld(LD),
- OurNodes=get_all_session_nodes_rtstates(RTStates),
- {Nodes2,NotOurNodes}=remove_nodes_not_ours(Nodes,OurNodes),
- ACTstorage=get_actstorage_ld(LD),
- {Reply,NewACTstorage}=
- h_all_tpm(get_ctrlnode_ld(LD),
- Nodes2,
- init_tpm,
- [Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc],
- RTStates,
- ACTstorage),
- ErrorReply=lists:map(fun(N)->{N,{error,not_in_session}} end,NotOurNodes),
- {reply,ErrorReply++Reply,put_actstorage_ld(NewACTstorage,LD)};
-
-handle_call({tpm,Nodes,Mod,Func,Arity,MS},_From,LD) ->
- RTStates=get_rtstates_ld(LD),
- OurNodes=get_all_session_nodes_rtstates(RTStates),
- {Nodes2,NotOurNodes}=remove_nodes_not_ours(Nodes,OurNodes),
- ACTstorage=get_actstorage_ld(LD),
- {Reply,NewACTstorage}=
- h_all_tpm(get_ctrlnode_ld(LD),Nodes2,tpm,[Mod,Func,Arity,MS],RTStates,ACTstorage),
- ErrorReply=lists:map(fun(N)->{N,{error,not_in_session}} end,NotOurNodes),
- {reply,ErrorReply++Reply,put_actstorage_ld(NewACTstorage,LD)};
-
-handle_call({tpm,Nodes,Mod,Func,Arity,MS,CallFunc},_From,LD) ->
- RTStates=get_rtstates_ld(LD),
- OurNodes=get_all_session_nodes_rtstates(RTStates),
- {Nodes2,NotOurNodes}=remove_nodes_not_ours(Nodes,OurNodes),
- ACTstorage=get_actstorage_ld(LD),
- {Reply,NewACTstorage}=
- h_all_tpm(get_ctrlnode_ld(LD),
- Nodes2,
- tpm,
- [Mod,Func,Arity,MS,CallFunc],
- RTStates,
- ACTstorage),
- ErrorReply=lists:map(fun(N)->{N,{error,not_in_session}} end,NotOurNodes),
- {reply,ErrorReply++Reply,put_actstorage_ld(NewACTstorage,LD)};
-
-handle_call({tpm,Nodes,Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc},_From,LD) ->
- RTStates=get_rtstates_ld(LD),
- OurNodes=get_all_session_nodes_rtstates(RTStates),
- {Nodes2,NotOurNodes}=remove_nodes_not_ours(Nodes,OurNodes),
- ACTstorage=get_actstorage_ld(LD),
- {Reply,NewACTstorage}=
- h_all_tpm(get_ctrlnode_ld(LD),
- Nodes2,
- tpm,
- [Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc],
- RTStates,
- ACTstorage),
- ErrorReply=lists:map(fun(N)->{N,{error,not_in_session}} end,NotOurNodes),
- {reply,ErrorReply++Reply,put_actstorage_ld(NewACTstorage,LD)};
-
-handle_call({tpm_ms,Nodes,Mod,Func,Arity,MSname,MS},_From,LD) ->
- RTStates=get_rtstates_ld(LD),
- OurNodes=get_all_session_nodes_rtstates(RTStates),
- {Nodes2,NotOurNodes}=remove_nodes_not_ours(Nodes,OurNodes),
- ACTstorage=get_actstorage_ld(LD),
- {Reply,NewACTstorage}=
- h_all_tpm(get_ctrlnode_ld(LD),
- Nodes2,
- tpm_ms,
- [Mod,Func,Arity,MSname,MS],
- RTStates,
- ACTstorage),
- ErrorReply=lists:map(fun(N)->{N,{error,not_in_session}} end,NotOurNodes),
- {reply,ErrorReply++Reply,put_actstorage_ld(NewACTstorage,LD)};
-
-handle_call({ctpm_ms,Nodes,Mod,Func,Arity,MSname},_From,LD) ->
- RTStates=get_rtstates_ld(LD),
- OurNodes=get_all_session_nodes_rtstates(RTStates),
- {Nodes2,NotOurNodes}=remove_nodes_not_ours(Nodes,OurNodes),
- ACTstorage=get_actstorage_ld(LD),
- {Reply,NewACTstorage}=
- h_all_tpm(get_ctrlnode_ld(LD),
- Nodes2,
- ctpm_ms,
- [Mod,Func,Arity,MSname],
- RTStates,
- ACTstorage),
- ErrorReply=lists:map(fun(N)->{N,{error,not_in_session}} end,NotOurNodes),
- {reply,ErrorReply++Reply,put_actstorage_ld(NewACTstorage,LD)};
-
-handle_call({ctpm,Nodes,Mod,Func,Arity},_From,LD) ->
- RTStates=get_rtstates_ld(LD),
- OurNodes=get_all_session_nodes_rtstates(RTStates),
- {Nodes2,NotOurNodes}=remove_nodes_not_ours(Nodes,OurNodes),
- ACTstorage=get_actstorage_ld(LD),
- {Reply,NewACTstorage}=
- h_all_tpm(get_ctrlnode_ld(LD),Nodes2,ctpm,[Mod,Func,Arity],RTStates,ACTstorage),
- ErrorReply=lists:map(fun(N)->{N,{error,not_in_session}} end,NotOurNodes),
- {reply,ErrorReply++Reply,put_actstorage_ld(NewACTstorage,LD)};
-%% ------------------------------------------------------------------------------
-
-%% Call-back for setting process trace-flags. Handles both distributed and non-
-%% distributed case.
-handle_call({tf,TraceConfList},From,LD) ->
- handle_call({tf,all,TraceConfList},From,LD);
-handle_call({tf,Nodes,TraceConfList},_From,LD) ->
- {Reply,NewACTstorage}=h_tf(get_ctrlnode_ld(LD),
- Nodes,
- TraceConfList,
- get_actstorage_ld(LD),
- get_rtstates_ld(LD)),
- {reply,Reply,put_actstorage_ld(NewACTstorage,LD)};
-%% ------------------------------------------------------------------------------
-
-
-
-handle_call(get_loopdata,_From,LD) ->
- io:format("The loopdata:~n~p~n",[LD]),
- {reply,ok,LD}.
-%% ------------------------------------------------------------------------------
-
-
-%% Clause handling an incomming state-change event from the control component.
-%% Note that it does not have to be one of our nodes since it is not possible
-%% to subscribe to certain node-events.
-%% We may very well get state-change events for state-changes we are the source
-%% to our selves. Those state-changes are already incorporated into the RTStates.
-%% There is however no harm in doing them again since we know that this event
-%% message will reach us before a reply to a potentially following state-change
-%% request will reach us. Hence we will do all state-changes in the correct order,
-%% even if sometimes done twice.
-handle_info({trace_event,CtrlPid,_Time,{state_change,Node,{State,Status}}},LD) ->
- case get_ctrlpid_ld(LD) of
- CtrlPid -> % It is from our control component.
- case {State,Status} of
- {?TRACING,?RUNNING} -> % This is the only case when new tracerdata!
- NewTracerData=add_current_tracerdata_ld(get_ctrlnode_ld(LD),
- Node,
- get_rtstates_ld(LD),
- get_trdstorage_ld(LD)),
- NewRTStates=statechange_rtstates(Node,State,Status,get_rtstates_ld(LD)),
- {noreply,put_trdstorage_ld(NewTracerData,
- put_rtstates_ld(NewRTStates,LD))};
- _ -> % In all other cases, just fix rtstates.
- NewRTStates=statechange_rtstates(Node,State,Status,get_rtstates_ld(LD)),
- {noreply,put_rtstates_ld(NewRTStates,LD)}
- end;
- _ ->
- {noreply,LD}
- end;
-%% If a new runtime component connects to our trace control component, and it is
-%% in our list of runtime components belonging to this session, we may update its
-%% state to now being present. Otherwise it does not belong to this session.
-%% Note that we avoid updating an already connected runtime component. This
-%% can happend if it connected by itself after we started the session handler,
-%% but before we managed to initiate tracing. Doing so or not will not result in
-%% any error in the long run, but during a short period of time we might be
-%% prevented from doing things with the runtime though it actually is tracing.
-handle_info({trace_event,CtrlPid,_Time,{connected,Node,{_Tag,{State,Status}}}},LD) ->
- case get_ctrlpid_ld(LD) of
- CtrlPid -> % It is from our control component.
- case get_statestatus_rtstates(Node,get_rtstates_ld(LD)) of
- {ok,unavailable} -> % This is the situation when we update!
- NewRTStates=statechange_rtstates(Node,State,Status,get_rtstates_ld(LD)),
- {noreply,put_rtstates_ld(NewRTStates,LD)};
- _ -> % In all other cases, let it be.
- {noreply,LD}
- end;
- _ -> % Not from our control component.
- {noreply,LD}
- end;
-%% If a runtime component disconnects we mark it as unavailable. We must also
-%% remove all saved trace-flags in order for them to not be accidently reactivated
-%% should the runtime component reconnect and then suspend.
-handle_info({trace_event,CtrlPid,_Time,{disconnected,Node,_}},LD) ->
- case get_ctrlpid_ld(LD) of
- CtrlPid -> % It is from our control component.
- NewRTStates=set_unavailable_rtstates(Node,get_rtstates_ld(LD)),
- NewACTstorage=del_node_actstorage(Node,get_actstorage_ld(LD)),
- {noreply,put_actstorage_ld(NewACTstorage,put_rtstates_ld(NewRTStates,LD))};
- _ ->
- {noreply,LD}
- end;
-handle_info(_,LD) ->
- {noreply,LD}.
-%% ------------------------------------------------------------------------------
-
-%% In terminate we cancel our subscription to event from the trace control component.
-%% That should actually not be necessary, but lets do it the correct way!
-terminate(_,LD) ->
- case get_ctrlnode_ld(LD) of
- void -> % Non-distributed.
- inviso:unsubscribe();
- Node ->
- inviso_tool_lib:inviso_cmd(Node,unsubscribe,[])
- end.
-%% ------------------------------------------------------------------------------
-
-
-
-%% ==============================================================================
-%% First level help functions to call-backs.
-%% ==============================================================================
-
-%% ------------------------------------------------------------------------------
-%% Help functions to init.
-%% ------------------------------------------------------------------------------
-
-%% Help function which find out the state/status of the runtime components.
-%% Note that since we have just started subscribe to state changes we must
-%% check our inqueue to see that we have no waiting messages for the nodes
-%% we learned the state/status of. If there is a waiting message we don't
-%% know whether that was a state change received before or after the state
-%% check was done. We will then redo the state-check.
-%% Returns {ok,States} or {error,Reason}.
-%% Where States is [{Node,{State,Status},Opts},...].
-%% Note that {error,Reason} can not occur in the non-distributed case.
-init_rtcomponent_states(NodeParams,void,CtrlPid,Nodes) -> % The non-distributed case.
- ok=inviso:subscribe(),
- init_rtcomponent_states_2(NodeParams,void,CtrlPid,Nodes,[]);
-init_rtcomponent_states(NodeParams,CtrlNode,CtrlPid,Nodes) ->
- ok=inviso_tool_lib:inviso_cmd(CtrlNode,subscribe,[]),
- init_rtcomponent_states_2(NodeParams,CtrlNode,CtrlPid,Nodes,[]).
-
-init_rtcomponent_states_2(_,_,_,[],States) ->
- {ok,States};
-init_rtcomponent_states_2(NodeParams,void,CtrlPid,_Nodes,States) ->
- case inviso:get_status() of
- {ok,StateStatus} -> % Got its state/status, now...
- {ProblemNodes,NewStates}=
- init_rtcomponent_states_3(NodeParams,CtrlPid,[{?LOCAL_RUNTIME,{ok,StateStatus}}],
- [],States),
- init_rtcomponent_states_2(NodeParams,void,CtrlPid,ProblemNodes,NewStates);
- {error,_Reason} -> % The runtime is not available!?
- {ok,[{?LOCAL_RUNTIME,unavailable,[]}]} % Create the return value immediately.
- end;
-init_rtcomponent_states_2(NodeParams,CtrlNode,CtrlPid,Nodes,States) ->
- case inviso_tool_lib:inviso_cmd(CtrlNode,get_status,[Nodes]) of
- {ok,NodeResult} ->
- {ProblemNodes,NewStates}=
- init_rtcomponent_states_3(NodeParams,CtrlPid,NodeResult,[],States),
- init_rtcomponent_states_2(NodeParams,CtrlNode,CtrlPid,ProblemNodes,NewStates);
- {error,Reason} -> % Severe problem, abort the session.
- {error,{get_status,Reason}}
- end.
-
-%% Traverses the list of returnvalues and checks that we do not have an event
-%% waiting in the message queue. If we do have, it is a problem. That node will
-%% be asked about its state again.
-%% Note that it is here we construct the RTStatesList.
-init_rtcomponent_states_3(NodeParams,CtrlPid,[{Node,{ok,{State,Status}}}|Rest],Problems,States) ->
- receive
- {trace_event,CtrlPid,_Time,{state_change,Node,_}} ->
- init_rtcomponent_states_3(NodeParams,CtrlPid,Rest,[Node|Problems],States)
- after
- 0 -> % Not in msg queue, then we're safe!
- RTState=case lists:keysearch(Node,1,NodeParams) of
- {value,{_Node,_TracerData,Opts}} ->
- {Node,{State,Status},Opts};
- _ -> % No option available, use [].
- {Node,{State,Status},[]}
- end,
- init_rtcomponent_states_3(NodeParams,CtrlPid,Rest,Problems,[RTState|States])
- end;
-init_rtcomponent_states_3(NodeParams,CtrlPid,[{Node,{error,_Reason}}|Rest],Problems,States) ->
- RTState=case lists:keysearch(Node,1,NodeParams) of
- {value,{_Node,_TracerData,Opts}} ->
- {Node,unavailable,Opts};
- _ -> % No option available, use [].
- {Node,unavailable,[]}
- end,
- init_rtcomponent_states_3(NodeParams,CtrlPid,Rest,Problems,[RTState|States]);
-init_rtcomponent_states_3(_,_,[],Problems,States) ->
- {Problems,States}.
-%% ------------------------------------------------------------------------------
-
-%% Help function removing nodes from NodeParams. The reason for this can either
-%% be that we are using a tool internal tracerdata that shall not be forwarded to
-%% the trace control component, or that the node is actually already part of
-%% another session.
-%% Returns {NewNodeParams,NodesWhichShallNotBeInitiated}.
-remove_nodeparams(Nodes,NodesParams) ->
- remove_nodeparams_2(Nodes,NodesParams,[],[]).
-
-remove_nodeparams_2(Nodes,[NodeParam|Rest],NPAcc,NAcc) when % NPAcc=NodeParamsAcc.
- (is_tuple(NodeParam) and ((size(NodeParam)==2) or (size(NodeParam)==3))) ->
- Node=element(1,NodeParam),
- Params=element(2,NodeParam), % This is tracerdata!
- case lists:member(Node,Nodes) of
- true -> % Remove this one, in another session.
- remove_nodeparams_2(Nodes,Rest,NPAcc,NAcc);
- false -> % Ok so far...
- case is_tool_internal_tracerdata(Params) of
- false -> % Then keep it and use it later!
- remove_nodeparams_2(Nodes,Rest,[{Node,Params}|NPAcc],NAcc);
- true -> % Since it is, remove it from the list.
- remove_nodeparams_2(Nodes,Rest,NPAcc,[Node|NAcc])
- end
- end;
-remove_nodeparams_2(Nodes,[_|Rest],NPAcc,NAcc) -> % Faulty NodeParam, skip it!
- remove_nodeparams_2(Nodes,Rest,NPAcc,NAcc);
-remove_nodeparams_2(_,[],NPAcc,NAcc) ->
- {lists:reverse(NPAcc),NAcc}.
-%% ------------------------------------------------------------------------------
-
-%% Help function which adds both the nodes which were already part of another
-%% session and the nodes that we actually did not issue any init_tracing for.
-%% Returns a new Result list of [{Node,NodeResult},...].
-init_fix_resultnodes(NodesOtherSes,NodesNotInit,Result) ->
- NewResult=init_fix_resultnodes_2(NodesOtherSes,{error,in_other_session},Result),
- init_fix_resultnodes_2(NodesNotInit,ok,NewResult).
-
-init_fix_resultnodes_2([Node|Rest],NodeResult,Result) ->
- [{Node,NodeResult}|init_fix_resultnodes_2(Rest,NodeResult,Result)];
-init_fix_resultnodes_2([],_,Result) ->
- Result. % Append Result to the end of the list.
-%% ------------------------------------------------------------------------------
-
-
-%% ------------------------------------------------------------------------------
-%% Help functions to reactivate.
-%% ------------------------------------------------------------------------------
-
-h_reactivate(CtrlNode,Nodes,ACTstorage) -> % Distributed case.
- case inviso_tool_lib:inviso_cmd(CtrlNode,cancel_suspension,[Nodes]) of
- {ok,CSuspResults} ->
- {GoodNodes,BadResults}= % Sort out nodes no longer suspended.
- lists:foldl(fun({Node,ok},{GoodNs,BadNs})->
- {[Node|GoodNs],BadNs};
- ({Node,{error,Reason}},{GoodNs,BadNs})->
- {GoodNs,[{Node,{error,{cancel_suspension,Reason}}}|BadNs]}
- end,
- {[],[]},
- CSuspResults),
- Results=h_reactivate_redo_activity(CtrlNode,GoodNodes,ACTstorage,[]),
- {ok,BadResults++Results};
- {error,Reason} -> % General failure cancelling suspend.
- {error,{cancel_suspension,Reason}}
- end.
-%% ------------------------------------------------------------------------------
-
-%% Help function which traverses the list of nodes known to be ours and have
-%% cancelled their suspend. If we fail redoing one of the activities associated
-%% with a node, the node will be reported in the return value as failed. From
-%% that point on its state must be considered unknown since we do not know how
-%% many of the activities were successfully redone.
-h_reactivate_redo_activity(CtrlNode,[Node|Rest],ACTstorage,Acc) ->
- case get_activities_actstorage(Node,ACTstorage) of
- {ok,Activities} -> % The node existed in activity storage.
- {Good,Bad}=h_reactivate_redo_activity_2(CtrlNode,Node,Activities,0,0),
- h_reactivate_redo_activity(CtrlNode,Rest,ACTstorage,[{Node,{Good,Bad}}|Acc]);
- false -> % Node not present in activity storage.
- h_reactivate_redo_activity(CtrlNode,Rest,ACTstorage,[{Node,{0,0}}|Acc])
- end;
-h_reactivate_redo_activity(_CtrlNode,[],_,Acc) ->
- lists:reverse(Acc).
-
-%% Help function actually redoing the activity. Note that there must be one
-%% clause here for every type of activity.
-%% Returns {NrGoodCmds,NrBadCmds}.
-%% The number of good or bad commands refers to inviso commands done. If any
-%% of the subparts of such a command returned an error, the command is concidered
-%% no good.
-h_reactivate_redo_activity_2(CtrlNode,Node,[{tf,{Op,TraceConfList}}|Rest],Good,Bad) ->
- case inviso_tool_lib:inviso_cmd(CtrlNode,Op,[[Node],TraceConfList]) of
- {ok,[{_Node,{ok,Answers}}]} ->
- case h_reactivate_redo_activity_check_tf(Answers) of
- ok ->
- h_reactivate_redo_activity_2(CtrlNode,Node,Rest,Good+1,Bad);
- error -> % At least oneReports the first encountered error.
- h_reactivate_redo_activity_2(CtrlNode,Node,Rest,Good,Bad+1)
- end;
- {ok,[{_Node,{error,_Reason}}]} ->
- h_reactivate_redo_activity_2(CtrlNode,Node,Rest,Good,Bad+1);
- {error,_Reason} -> % General error when doing cmd.
- h_reactivate_redo_activity_2(CtrlNode,Node,Rest,Good,Bad+1)
- end;
-h_reactivate_redo_activity_2(CtrlNode,Node,[{tpm,{Op,InvisoCmdParams}}|Rest],Good,Bad) ->
- case inviso_tool_lib:inviso_cmd(CtrlNode,Op,[[Node]|InvisoCmdParams]) of
- {ok,[{_Node,ok}]} ->
- h_reactivate_redo_activity_2(CtrlNode,Node,Rest,Good+1,Bad);
- {ok,[{_Node,{error,_Reason}}]} ->
- h_reactivate_redo_activity_2(CtrlNode,Node,Rest,Good,Bad+1);
- {error,_Reason} -> % General error when doing cmd.
- h_reactivate_redo_activity_2(CtrlNode,Node,Rest,Good,Bad+1)
- end;
-h_reactivate_redo_activity_2(_CtrlNode,_Node,[],Good,Bad) ->
- {Good,Bad}.
-
-%% Help function traversing a list of results from inviso:tf/2 or inviso:ctf/2
-%% to see if there were any errors.
-h_reactivate_redo_activity_check_tf([N|Rest]) when integer(N) ->
- h_reactivate_redo_activity_check_tf(Rest);
-h_reactivate_redo_activity_check_tf([{error,_Reason}|_]) ->
- error;
-h_reactivate_redo_activity_check_tf([]) ->
- ok.
-%% ------------------------------------------------------------------------------
-
-
-%% ------------------------------------------------------------------------------
-%% Help functions to tp (setting trace patterns, both local and global).
-%% ------------------------------------------------------------------------------
-
-%% Help function which handles both tpl and tp. Note that the non-distributed case
-%% handled with Nodes='all'.
-%% Returns what shall be the reply to the client.
-h_tp(all,PatternFunc,Mod,F,A,MS,Opts,LD) -> % All available runtime nodes.
- Nodes=get_all_available_nodes_rtstates(get_rtstates_ld(LD)),
- h_tp(Nodes,PatternFunc,Mod,F,A,MS,Opts,LD);
-h_tp(Nodes,PatternFunc,Mod,F,A,MS,Opts,LD) -> % Only certain nodes in the session.
- CtrlNode=get_ctrlnode_ld(LD),
- Dbg=get_dbg_ld(LD),
- SafetyCatches=get_safetycatches_ld(LD),
- case inviso_tool_lib:expand_module_names(Nodes,Mod,Opts) of % Take care of any reg-exps.
- {multinode_expansion,NodeMods} ->
- NodeTPs=inviso_tool_lib:make_patterns(SafetyCatches,Opts,Dbg,NodeMods,F,A,MS),
- h_tp_node_by_node(CtrlNode,PatternFunc,Dbg,NodeTPs,[]);
- {singlenode_expansion,Modules} ->
- TPs=inviso_tool_lib:make_patterns(SafetyCatches,Opts,Dbg,Modules,F,A,MS),
- h_tp_do_tps(CtrlNode,Nodes,TPs,PatternFunc,Dbg);
- module ->
- TPs=inviso_tool_lib:make_patterns(SafetyCatches,Opts,Dbg,[Mod],F,A,MS),
- h_tp_do_tps(CtrlNode,Nodes,TPs,PatternFunc,Dbg);
- wildcard -> % Means do for all modules, no safety.
- h_tp_do_tps(CtrlNode,Nodes,[{Mod,F,A,MS}],PatternFunc,Dbg);
- {error,Reason} ->
- {error,Reason}
- end.
-
-%% Note that this function can never be called in the non-distributed case.
-h_tp_node_by_node(CtrlNode,PatternFunc,Dbg,[{Node,TPs}|Rest],Accum) ->
- case h_tp_do_tps(CtrlNode,[Node],TPs,PatternFunc,Dbg) of
- {ok,[{Node,Result}]} ->
- h_tp_node_by_node(CtrlNode,PatternFunc,Dbg,Rest,[{Node,Result}|Accum]);
- {error,Reason} -> % Failure, but don't stop.
- h_tp_node_by_node(CtrlNode,PatternFunc,Dbg,Rest,[{Node,{error,Reason}}|Accum])
- end;
-h_tp_node_by_node(_,_,_,[],Accum) ->
- {ok,lists:reverse(Accum)}.
-
-%% Help function which does the actual call to the trace control component.
-%% Note that Nodes can be a list of nodes (including a single one) or
-%% ?LOCAL_RUNTIME if we are not distributed. The non-distributed case is otherwise
-%% detected by the 'void' CtrlNode.
-%% Returns {ok,[{Node,{ok,{NrOfFunctions,NrOfErrors}}},{Node,{error,Reason}},...]} or
-%% {error,Reason}. In the non-distributed case {ok,{NrOfFunctions,NrOfErros}} or
-%% {error,Reason}.
-h_tp_do_tps(void,_Nodes,TPs,PatternFunc,Dbg) -> % Non distributed case!
- inviso_tool_lib:debug(tp,Dbg,[TPs,PatternFunc]),
- case inviso:PatternFunc(TPs) of
- {ok,Result} -> % A list of [Nr1,Nr2,error,...].
- {ok,
- lists:foldl(fun(N,{AccNr,AccErr}) when integer(N) ->
- {AccNr+N,AccErr};
- (error,{AccNr,AccErr}) ->
- {AccNr,AccErr+1}
- end,
- {0,0},
- Result)};
- {error,Reason} ->
- {error,{PatternFunc,Reason}}
- end;
-h_tp_do_tps(CtrlNode,Nodes,TPs,PatternFunc,Dbg) ->
- inviso_tool_lib:debug(tp,Dbg,[Nodes,TPs,PatternFunc]),
- case inviso_tool_lib:inviso_cmd(CtrlNode,PatternFunc,[Nodes,TPs]) of
- {ok,Result} -> % Result is [{Node,Result},...].
- {ok,
- lists:map(fun({Node,{ok,Res}})->
- {Node,lists:foldl(fun(N,{ok,{AccNr,AccErr}}) when integer(N) ->
- {ok,{AccNr+N,AccErr}};
- (error,{AccNr,AccErr}) ->
- {ok,{AccNr,AccErr+1}}
- end,
- {ok,{0,0}},
- Res)};
- ({_Node,{error,Reason}})->
- {error,Reason}
- end,
- Result)};
- {error,Reason} ->
- {error,{PatternFunc,Reason}}
- end.
-%% ------------------------------------------------------------------------------
-
-%% ------------------------------------------------------------------------------
-%% Help functions for removing trace-patterns.
-%% ------------------------------------------------------------------------------
-
-%% NOT IMPLEMENTED YET.
-h_ctp(Node,PatternFunc,Mod,F,A,LD) ->
- tbd.
-%% ------------------------------------------------------------------------------
-
-
-%% ------------------------------------------------------------------------------
-%% Help functions for calling the trace information facility.
-%% ------------------------------------------------------------------------------
-
-
-%% Function handling the meta trace pattern for capturing registration of local
-%% process names.
-h_tpm_localnames(CtrlNode,Nodes,RTStates,ACTstorage) ->
- AvailableNodes=get_all_available_nodes_rtstates(RTStates),
- {Nodes3,FaultyNodes}=remove_nodes_not_ours(Nodes,AvailableNodes),
- case inviso_tool_lib:inviso_cmd(CtrlNode,tpm_localnames,[Nodes3]) of
- {ok,Result} -> % That good we want to modify tpmstorage!
- NewACTstorage=add_tpm_actstorage(Result,tpm_localnames,[],ACTstorage),
- ErrorResult=lists:map(fun(N)->{N,{error,not_available}} end,FaultyNodes),
- {{ok,ErrorResult++Result},NewACTstorage};
- {error,Reason} -> % If general failure, do not modify storage.
- {{error,Reason},ACTstorage}
- end.
-%% ------------------------------------------------------------------------------
-
-%% Functions calling meta trace functions for specified nodes. This function is
-%% intended for use with all tmp function calls, init_tpm,tpm,tpm_ms,ctpm_ms and
-%% ctpm.
-%% Note that we must store called meta trace functions and their parameters in the
-%% activity storage in order to be able to redo them in case of a reactivate.
-h_all_tpm(CtrlNode,Nodes,TpmCmd,InvisoCmdParams,RTStates,ACTstorage) ->
- AvailableNodes=get_all_available_nodes_rtstates(RTStates),
- {Nodes3,FaultyNodes}=remove_nodes_not_ours(Nodes,AvailableNodes),
- case inviso_tool_lib:inviso_cmd(CtrlNode,TpmCmd,[Nodes3|InvisoCmdParams]) of
- {ok,Result} -> % That good we want to modify tpmstorage!
- NewACTstorage=add_tpm_actstorage(Result,TpmCmd,InvisoCmdParams,ACTstorage),
- ErrorResult=lists:map(fun(N)->{N,{error,not_available}} end,FaultyNodes),
- {{ok,ErrorResult++Result},NewACTstorage};
- {error,Reason} -> % If general failure, do not modify storage.
- {{error,Reason},ACTstorage}
- end.
-%% ------------------------------------------------------------------------------
-
-
-%% ------------------------------------------------------------------------------
-%% Help functions for set trace flags.
-%% ------------------------------------------------------------------------------
-
-%% Help function which sets the tracepatterns in TraceConfList for all nodes
-%% mentioned in Nodes. Note that non-distributed case is handled with Nodes='all'.
-%% Returns {Reply,NewACTstorage} where Reply is whatever shall be returned to caller
-%% and NewACTstorage is traceflag storage modified with the flags added to the
-%% corresponding nodes.
-h_tf(void,_Nodes,TraceConfList,ACTstorage,_RTStates) -> % The non-distributed case.
- Reply=inviso:tf(TraceConfList),
- NewACTstorage=add_tf_actstorage([{?LOCAL_RUNTIME,Reply}],tf,TraceConfList,ACTstorage),
- {Reply,NewACTstorage};
-h_tf(CtrlNode,all,TraceConfList,ACTstorage,RTStates) ->
- AllNodes=get_all_session_nodes_rtstates(RTStates),
- h_tf(CtrlNode,AllNodes,TraceConfList,ACTstorage,RTStates);
-h_tf(CtrlNode,Nodes,TraceConfList,ACTstorage,_RTStates) ->
- case inviso_tool_lib:inviso_cmd(CtrlNode,tf,[Nodes,TraceConfList]) of
- {ok,Result} -> % That good we want to modify actstorage!
- NewACTstorage=add_tf_actstorage(Result,tf,TraceConfList,ACTstorage),
- {{ok,Result},NewACTstorage};
- {error,Reason} -> % If general failure, do not modify actstorage.
- {{error,Reason},ACTstorage}
- end.
-%% ------------------------------------------------------------------------------
-
-%% ------------------------------------------------------------------------------
-%% Help functions to stop_session.
-%% ------------------------------------------------------------------------------
-
-%% This function fetches all local log-files using our stored tracerdata. Note
-%% that there are two major ways of tranfering logfiles. Either via distributed
-%% Erlang or by common filesystem (like NFS). The default is distributed Erlang.
-%% But there may be info in the RTStates structure about a common file-system.
-%% Returns {FailedNodes,FetchedFileNames} where FailedNodes is a list of
-%% nodenames where problems occurred. Note that problems does not necessarily
-%% mean that no files were copied.
-%% FetchedFileNames contains one or two of the tuples {trace_log,Files} and/or
-%% {ti_log,Files}, listing all files successfully fetched. Note that the
-%% list of fetched files contains sublists of filenames. One for each node and
-%% tracerdata.
-%% In the non-distributed system we always use copy (since the files always
-%% resides locally).
-transfer_logfiles(RTStates,CtrlNode,Dir,Prefix,TRDstorage,Dbg,AvailableNodes) ->
- if
- CtrlNode==void -> % When non-distributed, always copy!
- fetch_logfiles_copy(CtrlNode,Dir,Prefix,TRDstorage,Dbg,[?LOCAL_RUNTIME]);
- true -> % The distributed case.
- {FetchNodes,CopyNodes}=find_logfile_transfer_methods(AvailableNodes,RTStates),
- {FailedFetchNodes,FetchedFiles}=
- case fetch_logfiles_distributed(CtrlNode,Dir,Prefix,TRDstorage,Dbg,FetchNodes) of
- {ok,Failed,Files} -> % So far no disasters.
- {Failed,Files};
- {error,Reason} -> % Means all fetch-nodes failed!
- inviso_tool_lib:debug(transfer_logfiles,Dbg,[FetchNodes,Reason]),
- {lists:map(fun(N)->{N,error} end,FetchNodes),[]}
- end,
- {FailedCopyNodes,CopiedFiles}=
- fetch_logfiles_copy(CtrlNode,Dir,Prefix,TRDstorage,Dbg,CopyNodes),
- {FailedFetchNodes++FailedCopyNodes,FetchedFiles++CopiedFiles}
- end.
-
-%% Help function which finds out which node we have a common file system with
-%% and from which we must make distributed erlang tranfere.
-%% Returns {DistributedNodes,CopyNodes} where CopyNode is [{Node,CopyFromDir},...].
-find_logfile_transfer_methods(Nodes,RTStates) ->
- find_logfile_transfer_methods_2(Nodes,RTStates,[],[]).
-
-find_logfile_transfer_methods_2([Node|Rest],RTStates,FetchAcc,CopyAcc) ->
- {ok,Opts}=get_opts_rtstates(Node,RTStates), % Node must be in RTStates!
- case lists:keysearch(?COPY_LOG_FROM,1,Opts) of
- {value,{_,FromDir}} when list(FromDir) -> % Node has common filesystem.
- find_logfile_transfer_methods_2(Rest,RTStates,FetchAcc,[{Node,FromDir}|CopyAcc]);
- {value,_} -> % Can't understand dir option.
- find_logfile_transfer_methods_2(Rest,RTStates,[Node|FetchAcc],CopyAcc);
- false -> % Then we want to use fetch instead.
- find_logfile_transfer_methods_2(Rest,RTStates,[Node|FetchAcc],CopyAcc)
- end;
-find_logfile_transfer_methods_2([],_,FetchAcc,CopyAcc) ->
- {FetchAcc,CopyAcc}.
-%% ------------------------------------------------------------------------------
-
-%% Help function which transferes all local logfiles according to the tracerdata
-%% stored for the nodes in Nodes.
-%% Returns {ok,FailedNodes,FileNodeSpecs} or {error,Reason}.
-%% FailedNodes is a list of nodes where fetching logs did not succeed, partially
-%% or not at all.
-%% FileNames is a list of list of actually fetched files (the name as it is here, including
-%% Dir). The sublists are files which belong together.
-fetch_logfiles_distributed(CtrlNode,Dir,Prefix,TRDstorage,Dbg,Nodes) ->
- LogSpecList=build_logspeclist(Nodes,TRDstorage),
- case inviso_fetch_log(inviso_tool_lib:inviso_cmd(CtrlNode,
- fetch_log,
- [LogSpecList,Dir,Prefix])) of
- {ok,Result} ->
- Files=get_all_filenames_fetchlog_result(Result,Dbg),
- FailedNodes=get_all_failednodes_fetchlog_result(Result),
- {ok,FailedNodes,Files};
- {error,Reason} -> % Some general failure!
- {error,{fetch_log,Reason}}
- end.
-
-%% Help function which constructs a list {Node,TracerData} for all nodes in Nodes.
-%% Note that there may be more than one tracerdata for a node, resulting in multiple
-%% tuples for that node.
-build_logspeclist(Nodes,TRDstorage) ->
- build_logspeclist_2(Nodes,TRDstorage,[]).
-
-build_logspeclist_2([Node|Rest],TRDstorage,Acc) ->
- TRDlist=find_tracerdata_for_node_trd(Node,TRDstorage), % A list of all tracerdata.
- build_logspeclist_2(Rest,
- TRDstorage,
- [lists:map(fun(TRD)->{Node,TRD} end,TRDlist)|Acc]);
-build_logspeclist_2([],_,Acc) ->
- lists:flatten(Acc).
-
-%% Help function which translates inviso:fetch_log return values to what I
-%% want!
-inviso_fetch_log({error,Reason}) ->
- {error,Reason};
-inviso_fetch_log({_Success,ResultList}) ->
- {ok,ResultList}.
-
-%% Help function which collects all filenames mentioned in a noderesult structure.
-%% The files may or may not be complete.
-%% Returns a list of list of filenames. Each sublist contains files which belong
-%% together, i.e because they are a wrap-set.
-get_all_filenames_fetchlog_result(NodeResult,Dbg) ->
- get_all_filenames_fetchlog_result_2(NodeResult,Dbg,[]).
-
-get_all_filenames_fetchlog_result_2([{Node,{Success,FileInfo}}|Rest],Dbg,Accum)
- when Success=/=error, list(FileInfo) ->
- SubAccum=get_all_filenames_fetchlog_result_3(FileInfo,[]),
- get_all_filenames_fetchlog_result_2(Rest,Dbg,[{Node,SubAccum}|Accum]);
-get_all_filenames_fetchlog_result_2([{Node,{error,FReason}}|Rest],Dbg,Accum) ->
- inviso_tool_lib:debug(fetch_files,Dbg,[Node,FReason]),
- get_all_filenames_fetchlog_result_2(Rest,Dbg,Accum);
-get_all_filenames_fetchlog_result_2([],_Dbg,Accum) ->
- Accum.
-
-get_all_filenames_fetchlog_result_3([{FType,Files}|Rest],SubAccum) ->
- FilesOnly=lists:foldl(fun({ok,FName},Acc)->[FName|Acc];(_,Acc)->Acc end,[],Files),
- get_all_filenames_fetchlog_result_3(Rest,[{FType,FilesOnly}|SubAccum]);
-get_all_filenames_fetchlog_result_3([],SubAccum) ->
- SubAccum.
-
-%% Help function which traverses a noderesult and builds a list as return
-%% value containing the nodenames of all nodes not being complete.
-%% Note that a node may occur multiple times since may have fetched logfiles
-%% for several tracerdata from the same node. Makes sure the list contains
-%% unique node names.
-%% Returns a list nodes.
-get_all_failednodes_fetchlog_result(NodeResult) ->
- get_all_failednodes_fetchlog_result_2(NodeResult,[]).
-
-get_all_failednodes_fetchlog_result_2([{_Node,{complete,_}}|Rest],Acc) ->
- get_all_failednodes_fetchlog_result_2(Rest,Acc);
-get_all_failednodes_fetchlog_result_2([{Node,{_Severity,_}}|Rest],Acc) ->
- case lists:member(Node,Acc) of
- true -> % Already in the list.
- get_all_failednodes_fetchlog_result_2(Rest,Acc);
- false -> % Not in Acc, add it!
- get_all_failednodes_fetchlog_result_2(Rest,[Node|Acc])
- end;
-get_all_failednodes_fetchlog_result_2([],Acc) ->
- Acc.
-%% ------------------------------------------------------------------------------
-
-%% Help function which copies files from one location to Dir and at the same time
-%% adds the Prefix to the filename. NodeSpecs contains full path to the files. The
-%% reason the node information is still part of NodeSpecs is that otherwise we can
-%% not report faulty nodes. Note that one node may occur multiple times since there
-%% may be more than one tracerdata for a node.
-%% Returns {FailedNodes,Files} where FailedNodes is a list of nodes where problems
-%% occurred. Files is a tuple list of [{Node,[{FType,FileNames},...]},...].
-fetch_logfiles_copy(CtrlNode,Dir,Prefix,TRDstorage,Dbg,NodeSpecs) ->
- CopySpecList=build_copylist(CtrlNode,Dbg,NodeSpecs,TRDstorage),
- fetch_logfiles_copy_2(Dir,Prefix,Dbg,CopySpecList,[],[]).
-
-fetch_logfiles_copy_2(Dir,Prefix,Dbg,[{Node,CopySpecs}|Rest],FailedNodes,Files) ->
- case fetch_logfiles_copy_3(Dir,Prefix,Dbg,CopySpecs,[],0) of
- {0,LocalFiles} -> % Copy went ok and zero errors.
- fetch_logfiles_copy_2(Dir,Prefix,Dbg,Rest,FailedNodes,[{Node,LocalFiles}|Files]);
- {_N,LocalFiles} -> % Copied files, but some went wrong.
- case lists:member(Node,FailedNodes) of
- true -> % Node already in FailedNodes.
- fetch_logfiles_copy_2(Dir,Prefix,Dbg,Rest,FailedNodes,
- [{Node,LocalFiles}|Files]);
- false -> % Node not marked as failed, yet.
- fetch_logfiles_copy_2(Dir,Prefix,Dbg,Rest,[Node|FailedNodes],
- [{Node,LocalFiles}|Files])
- end
- end;
-fetch_logfiles_copy_2(_,_,_,[],FailedNodes,Files) ->
- {FailedNodes,Files}. % The return value from fetch_logfiles_copy.
-
-fetch_logfiles_copy_3(Dir,Prefix,Dbg,[{FType,RemoteFiles}|Rest],Results,Errors) ->
- {Err,LocalFiles}=fetch_logfiles_copy_3_1(Dir,Prefix,Dbg,RemoteFiles,[],0),
- fetch_logfiles_copy_3(Dir,Prefix,Dbg,Rest,[{FType,LocalFiles}|Results],Errors+Err);
-fetch_logfiles_copy_3(_,_,_,[],Results,Errors) ->
- {Errors,Results}.
-
-%% For each file of one file-type (e.g. trace_log).
-fetch_logfiles_copy_3_1(Dir,Prefix,Dbg,[File|Rest],LocalFiles,Errors) ->
- DestName=Prefix++filename:basename(File),
- Destination=filename:join(Dir,DestName),
- case do_copy_file(File,Destination) of
- ok ->
- fetch_logfiles_copy_3_1(Dir,Prefix,Dbg,Rest,[DestName|LocalFiles],Errors);
- {error,Reason} ->
- inviso_tool_lib:debug(copy_files,Dbg,[File,Destination,Reason]),
- fetch_logfiles_copy_3_1(Dir,Prefix,Dbg,Rest,LocalFiles,Errors+1)
- end;
-fetch_logfiles_copy_3_1(_,_,_,[],LocalFiles,Errors) ->
- {Errors,LocalFiles}.
-
-%% Help function which builds a [{Node,[{Type,[ListOfRemoteFiles]}},...}]
-%% where Type describes trace_log or ti_log and each entry in ListOfRemoteFiles
-%% is a complete path to a file to be copied.
-build_copylist(CtrlNode,Dbg,NodeSpecList,TRDstorage) ->
- build_copylist_2(CtrlNode,Dbg,NodeSpecList,TRDstorage,[]).
-
-%% For each node specified in the NodeSpecList.
-build_copylist_2(CtrlNode,Dbg,[{Node,SourceDir}|Rest],TRDstorage,Acc) ->
- TRDlist=find_tracerdata_for_node_trd(Node,TRDstorage),
- CopySpecList=build_copylist_3(CtrlNode,Dbg,SourceDir,Node,TRDlist),
- build_copylist_2(CtrlNode,Dbg,Rest,TRDstorage,[CopySpecList|Acc]);
-build_copylist_2(_,_,[],_,Acc) ->
- lists:flatten(Acc).
-
-%% For each tracerdata found for the node.
-build_copylist_3(void,Dbg,SourceDir,Node,[TRD|Rest]) -> % The non-distributed case.
- case inviso:list_logs(TRD) of
- {ok,FileSpec} when list(FileSpec) -> % [{trace_log,Dir,Files},...]
- NewFileSpec=build_copylist_4(SourceDir,FileSpec,[]),
- [{Node,NewFileSpec}|build_copylist_3(void,Dbg,SourceDir,Node,Rest)];
- {ok,no_log} -> % This tracedata not associated with any log.
- build_copylist_3(void,Dbg,SourceDir,Node,Rest);
- {error,Reason} ->
- inviso_tool_lib:debug(list_logs,Dbg,[Node,TRD,Reason]),
- build_copylist_3(void,Dbg,SourceDir,Node,Rest)
- end;
-build_copylist_3(CtrlNode,Dbg,SourceDir,Node,[TRD|Rest]) -> % The distributed case.
- case inviso_tool_lib:inviso_cmd(CtrlNode,list_logs,[[{Node,TRD}]]) of
- {ok,[{Node,{ok,FileSpec}}]} when list(FileSpec) ->
- NewFileSpec=build_copylist_4(SourceDir,FileSpec,[]),
- [{Node,NewFileSpec}|build_copylist_3(CtrlNode,Dbg,SourceDir,Node,Rest)];
- {ok,[{Node,{ok,no_log}}]} -> % It relays to another node, no files!
- build_copylist_3(CtrlNode,Dbg,SourceDir,Node,Rest);
- {ok,[{Node,{error,Reason}}]} ->
- inviso_tool_lib:debug(list_logs,Dbg,[Node,TRD,Reason]),
- build_copylist_3(CtrlNode,Dbg,SourceDir,Node,Rest);
- {error,Reason} -> % Some general failure.
- inviso_tool_lib:debug(list_logs,Dbg,[Node,TRD,Reason]),
- build_copylist_3(CtrlNode,Dbg,SourceDir,Node,Rest)
- end;
-build_copylist_3(_,_,_,_,[]) ->
- [].
-
-%% Help function which makes a [{Type,Files},...] list where each file in Files
-%% is with full path as found from our file-system.
-build_copylist_4(SourceDir,[{Type,_Dir,Files}|Rest],Accum) ->
- NewFiles=
- lists:foldl(fun(FName,LocalAcc)->[filename:join(SourceDir,FName)|LocalAcc] end,
- [],
- Files),
- build_copylist_4(SourceDir,Rest,[{Type,NewFiles}|Accum]);
-build_copylist_4(_,[],Accum) ->
- Accum.
-
-
-%% Help function which copies a file using os:cmd.
-%% Returns 'ok' or {error,Reason}.
-do_copy_file(Source,Destination) ->
- case os:type() of
- {win32,_} ->
- os:cmd("copy "++Source++" "++Destination), % Perhaps a test on success?
- ok;
- {unix,_} ->
- os:cmd("cp "++Source++" "++Destination), % Perhaps a test on success?
- ok
- end.
-%% ------------------------------------------------------------------------------
-
-
-%% ------------------------------------------------------------------------------
-
-%% ==============================================================================
-%% Various help functions.
-%% ==============================================================================
-
-%% Help function going through the Nodes list and checking that only nodes
-%% mentioned in OurNodes gets returned. It also makes the nodes in the return
-%% value unique.
-remove_nodes_not_ours(Nodes,OurNodes) ->
- remove_nodes_not_ours_2(Nodes,OurNodes,[],[]).
-
-remove_nodes_not_ours_2([Node|Rest],OurNodes,OurAcc,OtherAcc) ->
- case lists:member(Node,OurNodes) of
- true -> % Ok it is one of our nodes.
- case lists:member(Node,OurAcc) of
- true -> % Already in the list, skip.
- remove_nodes_not_ours_2(Rest,OurNodes,OurAcc,OtherAcc);
- false ->
- remove_nodes_not_ours_2(Rest,OurNodes,[Node|OurAcc],OtherAcc)
- end;
- false ->
- case lists:member(Node,OtherAcc) of
- true ->
- remove_nodes_not_ours_2(Rest,OurNodes,OurAcc,OtherAcc);
- false ->
- remove_nodes_not_ours_2(Rest,OurNodes,OurAcc,[Node|OtherAcc])
- end
- end;
-remove_nodes_not_ours_2([],_,OurAcc,OtherAcc) ->
- {lists:reverse(OurAcc),lists:reverse(OtherAcc)}.
-%% ------------------------------------------------------------------------------
-
-%% Help function which returns 'true' or 'false' depending on if TracerData is
-%% meant to be used by the session handler (true) or if it supposed to be passed
-%% on to the trace system.
-is_tool_internal_tracerdata(_) -> % CURRENTLY NO INTERNAL TRACER DATA!
- false.
-%% ------------------------------------------------------------------------------
-
-%% Help function which checks that all nodes in the first list of nodes exists
-%% in the second list of nodes. Returns 'true' or 'false'. The latter if as much
-%% as one incorrect node was found.
-check_our_nodes([Node|Rest],AllNodes) ->
- case lists:member(Node,AllNodes) of
- true ->
- check_our_nodes(Rest,AllNodes);
- false -> % Then we can stop right here.
- false
- end;
-check_our_nodes([],_) ->
- true.
-%% ------------------------------------------------------------------------------
-
-%% Help function which checks that a directory actually exists. Returns 'true' or
-%% 'false'.
-check_directory_exists(Dir) ->
- case file:read_file_info(Dir) of
- {ok,#file_info{type=directory}} ->
- true;
- _ -> % In all other cases it is not valid.
- false
- end.
-%% ------------------------------------------------------------------------------
-
-%% This function stops the tracing on all nodes in Nodes. Preferably Nodes is a list
-%% of only tracing runtime components. Not that there will actually be any difference
-%% since the return value does not reflect how stopping the nodes went.
-%% Returns 'ok' or {error,Reason}, the latter only in case of general failure.
-stop_all_tracing(void,Dbg,[?LOCAL_RUNTIME]) -> % The non-distributed case, and is tracing.
- case inviso:stop_tracing() of
- {ok,_State} ->
- ok;
- {error,Reason} -> % We actually don't care.
- inviso_tool_lib:debug(stop_tracing,Dbg,[?LOCAL_RUNTIME,Reason]),
- ok
- end;
-stop_all_tracing(void,_,_) -> % There is no local runtime started.
- ok;
-stop_all_tracing(CtrlNode,Dbg,Nodes) ->
- case inviso_tool_lib:inviso_cmd(CtrlNode,stop_tracing,[Nodes]) of
- {ok,Result} -> % The result is only used for debug.
- Failed=lists:foldl(fun({N,{error,Reason}},Acc)->[{N,{error,Reason}}|Acc];
- (_,Acc)->Acc
- end,
- [],
- Result),
- if
- Failed==[] ->
- ok;
- true ->
- inviso_tool_lib:debug(stop_tracing,Dbg,[Nodes,Failed]),
- ok
- end;
- {error,Reason} ->
- {error,{stop_tracing,Reason}}
- end.
-%% ------------------------------------------------------------------------------
-
-%% Help function removing all local logs using the tracerdata to determine what
-%% logs to remove from where.
-%% There is no significant return value since it is not really clear what to do
-%% if removal went wrong. The function can make debug-reports thought.
-remove_all_local_logs(CtrlNode,TRDstorage,Nodes,Dbg) ->
- LogSpecList=build_logspeclist_remove_logs(Nodes,TRDstorage),
- case inviso_tool_lib:inviso_cmd(CtrlNode,delete_log,[LogSpecList]) of
- {ok,Results} ->
- case look_for_errors_resultlist(Results) of
- [] -> % No errors found in the result!
- true;
- Errors ->
- inviso_tool_lib:debug(remove_all_local_logs,Dbg,[Errors]),
- true
- end;
- {error,Reason} -> % Some general error.
- inviso_tool_lib:debug(remove_all_local_logs,Dbg,[{error,Reason}]),
- true
- end.
-
-%% Help function which puts together a list of {Node,Tracerdata} tuples. Note that
-%% we must build one tuple for each tracerdata for one node.
-build_logspeclist_remove_logs(Nodes,TRDstorage) ->
- [{Node,TracerData}||Node<-Nodes,TracerData<-find_tracerdata_for_node_trd(Node,TRDstorage)].
-%% ------------------------------------------------------------------------------
-
-%% Help function which traverses a resultlist from an inviso function. Such are
-%% built up as [{Node,SubResults},...] where SubResult is a list of tuples for each
-%% file-type (e.g trace_log) {FType,FileList} where a FileList is either {error,Reason}
-%% or {ok,FileName}.
-%% Returns a list of {Node,[{error,Reason},...]}.
-look_for_errors_resultlist([{Node,{error,Reason}}|Rest]) ->
- [{Node,{error,Reason}}|look_for_errors_resultlist(Rest)];
-look_for_errors_resultlist([{Node,{ok,NResults}}|Rest]) when list(NResults) ->
- case look_for_errors_resultlist_2(NResults,[]) of
- [] ->
- look_for_errors_resultlist(Rest);
- Errors -> % A list of lists.
- [{Node,lists:flatten(Errors)}|look_for_errors_resultlist(Rest)]
- end;
-look_for_errors_resultlist([_|Rest]) ->
- look_for_errors_resultlist(Rest);
-look_for_errors_resultlist([]) ->
- [].
-
-look_for_errors_resultlist_2([{_FType,NSubResult}|Rest],Accum) ->
- case lists:filter(fun({error,_Reason})->true;(_)->false end,NSubResult) of
- [] -> % No errors for this node.
- look_for_errors_resultlist_2(Rest,Accum);
- Errors -> % A list of at least one error.
- look_for_errors_resultlist_2(Rest,[Errors|Accum])
- end;
-look_for_errors_resultlist_2([],Accum) ->
- Accum.
-%% ------------------------------------------------------------------------------
-
-
-%% ------------------------------------------------------------------------------
-%% Functions working on the loopdata structure.
-%% Its main purpose is to store information about runtime components participating
-%% in the session and their current status.
-%% ------------------------------------------------------------------------------
-
--record(ld,{parent,
- ctrlnode,
- ctrlpid, % To where to send inviso cmd.
- rtstates,
- tracerdata,
- safetycatches,
- dbg,
- actstorage % Activity storage, for reactivate.
- }).
-
-%% Function creating the initial datastructure.
-%% The datastructure is [{Node,State},...].
-%%
-%% The tracerdata table is a bag simply for the reason that if we try to insert
-%% the same tracerdata for a node twice, we will end up with one tracerdata after
-%% all. This is useful when we insert tracerdata ourselves, the tracerdata will
-%% come as a state-change too.
-mk_ld(Parent,CtrlNode,CtrlPid,RTStates,NodeParams,OtherNodes,SafetyCatches,Dbg) ->
- TRDtableName=list_to_atom("inviso_tool_sh_trdstorage_"++pid_to_list(self())),
- TRDtid=ets:new(TRDtableName,[bag]),
- ACTtableName=list_to_atom("inviso_tool_sh_actstorage_"++pid_to_list(self())),
- ACTtid=ets:new(ACTtableName,[bag]),
- mk_ld_fill_tracerdata(CtrlNode,TRDtid,NodeParams,OtherNodes), % Fill the ETS table.
- #ld{parent=Parent, % The tool main process.
- ctrlnode=CtrlNode, % Node name where the control component is.
- ctrlpid=CtrlPid, % The process id of the control component.
- rtstates=RTStates, % All nodes and their state/status.
- tracerdata=TRDtid,
- safetycatches=SafetyCatches,
- dbg=Dbg,
- actstorage=ACTtid
- }.
-
-%% Help function which inserts tracer data for the nodes. Note that we can get
-%% tracer data either from the return value from init_tracing or by asking the
-%% node for it. The latter is necessary for the nodes which were marked not to
-%% be initiated by the session handler. This maybe because those nodes have
-%% autostarted.
-mk_ld_fill_tracerdata(CtrlNode,TId,NodeParams,OtherNodes) ->
- mk_ld_fill_tracerdata_nodeparams(TId,NodeParams),
- mk_ld_fill_tracerdata_othernodes(CtrlNode,TId,OtherNodes).
-
-mk_ld_fill_tracerdata_nodeparams(TId,[{Node,TracerData}|Rest]) ->
- ets:insert(TId,{Node,TracerData}),
- mk_ld_fill_tracerdata_nodeparams(TId,Rest);
-mk_ld_fill_tracerdata_nodeparams(_,[]) ->
- ok.
-
-mk_ld_fill_tracerdata_othernodes(_,_,[]) -> % Then not necessary to do anything.
- ok;
-mk_ld_fill_tracerdata_othernodes(void,TId,[Node]) -> % The non-distributed case.
- case inviso:get_tracerdata() of
- {error,_Reason} -> % Perhaps in state new or disconnected.
- ok; % Do nothing.
- {ok,TracerData} ->
- ets:insert(TId,{Node,TracerData})
- end;
-mk_ld_fill_tracerdata_othernodes(CtrlNode,TId,Nodes) ->
- case inviso_tool_lib:invisomd(CtrlNode,get_tracerdata,[Nodes]) of
- {ok,Results} ->
- mk_ld_fill_tracerdata_othernodes_2(TId,Results);
- {error,_Reason} -> % Strange, we will probably crash later.
- ok
- end.
-
-mk_ld_fill_tracerdata_othernodes_2(TId,[{_Node,{ok,no_tracerdata}}|Rest]) ->
- mk_ld_fill_tracerdata_othernodes_2(TId,Rest); % It was not initiated then!
-mk_ld_fill_tracerdata_othernodes_2(TId,[{Node,{ok,TracerData}}|Rest]) ->
- ets:insert(TId,{Node,TracerData}),
- mk_ld_fill_tracerdata_othernodes_2(TId,Rest);
-mk_ld_fill_tracerdata_othernodes_2(_,[]) ->
- ok.
-%% ------------------------------------------------------------------------------
-
-get_ctrlnode_ld(#ld{ctrlnode=CtrlNode}) ->
- CtrlNode.
-%% ------------------------------------------------------------------------------
-
-
-get_ctrlpid_ld(#ld{ctrlpid=CtrlPid}) ->
- CtrlPid.
-%% ------------------------------------------------------------------------------
-
-get_rtstates_ld(#ld{rtstates=RTStates}) ->
- RTStates.
-
-put_rtstates_ld(NewRTStates,LD) ->
- LD#ld{rtstates=NewRTStates}.
-%% ------------------------------------------------------------------------------
-
-get_trdstorage_ld(#ld{tracerdata=TId}) ->
- TId.
-
-put_trdstorage_ld(_NewTId,LD) ->
- LD.
-%% ------------------------------------------------------------------------------
-
-%% Help function which adds the current tracerdata of node Node to the tracerdata
-%% storage. We only want to add tracerdata we have not seen before. We therefore
-%% avoid adding it if the node already is in state ?TRACING.
-%% Returns a new tracerdata (what ever it is)!
-add_current_tracerdata_ld(CtrlNode,Node,RTStates,TId) ->
- case get_statestatus_rtstates(Node,RTStates) of
- {ok,{?TRACING,_}} -> % Then we have already added the tracerdata.
- TId; % Then do nothing.
- {ok,_} -> % Since we were not tracing before.
- case add_current_tracerdata_ld_fetchtracerdata(CtrlNode,Node) of
- {ok,TracerData} ->
- ets:insert(TId,{Node,TracerData});
- no_tracerdata -> % Strange, how could we become tracing
- ok;
- {error,_Reason} -> % The node perhaps disconnected!?
- ok
- end;
- false -> % Very strange, not our node!
- ok % Do nothing.
- end.
-
-add_current_tracerdata_ld_fetchtracerdata(void,_Node) ->
- case inviso:get_tracerdata() of
- {ok,TracerData} ->
- {ok,TracerData};
- {error,no_tracerdata} ->
- no_tracerdata;
- {error,Reason} ->
- {error,Reason}
- end;
-add_current_tracerdata_ld_fetchtracerdata(CtrlNode,Node) ->
- case inviso_tool_lib:inviso_cmd(CtrlNode,get_tracerdata,[[Node]]) of
- {ok,[{Node,{ok,TracerData}}]} ->
- {ok,TracerData};
- {ok,[{Node,{error,no_tracerdata}}]} ->
- no_tracerdata;
- {ok,[{Node,{error,Reason}}]} ->
- {error,Reason};
- {error,Reason} ->
- {error,Reason}
- end.
-%% ------------------------------------------------------------------------------
-
-
-get_safetycatches_ld(#ld{safetycatches=SCs}) ->
- SCs.
-%% ------------------------------------------------------------------------------
-
-get_dbg_ld(#ld{dbg=Dbg}) ->
- Dbg.
-%% ------------------------------------------------------------------------------
-
-get_actstorage_ld(#ld{actstorage=ACTstorage}) ->
- ACTstorage.
-
-put_actstorage_ld(_NewACTstorage,LD) ->
- LD.
-%% ------------------------------------------------------------------------------
-
-
-
-%% ------------------------------------------------------------------------------
-%% Functions working on the rtstates structure (which is a substructure of loopdata).
-%% It is either:
-%% [{Node,StateStatus,Opts},...]
-%% Node is either the node name of the runtime component erlang node or
-%% ?LOCAL_RUNTIME as returned from the trace control component.
-%% StateStatus is {State,Status}, 'unavailable' or 'unknown'.
-%% Status is the returnvalue from trace control component.
-%% i.e: running | {suspended,Reason}
-%% ------------------------------------------------------------------------------
-
-%% Function contructing an rtstates structure from a list of [{Node,StateStatus,Opts},...].
-to_rtstates(ListOfStates) when list(ListOfStates) ->
- ListOfStates.
-%% ------------------------------------------------------------------------------
-
-%% Function which takes a rtstates structure and returns a list of [{Node,StateStatus},...].
-from_rtstates(RTStates) ->
- RTStates.
-%% ------------------------------------------------------------------------------
-
-%% Function which takes an rtstates structure and a result as returned from
-%% init_tracing. The RTStates is modified for the nodes that changed state as a
-%% result of successful init_tracing.
-%% Returns a new RTStates.
-set_tracing_rtstates([E={Node,_StateStatus,Opts}|Rest],Result) ->
- case lists:keysearch(Node,1,Result) of
- {value,{_,ok}} -> % Means state-change to tracing!
- [{Node,{tracing,running},Opts}|set_tracing_rtstates(Rest,Result)];
- _ -> % Otherwise, leave it as is.
- [E|set_tracing_rtstates(Rest,Result)]
- end;
-set_tracing_rtstates([],_Result) ->
- [].
-%% ------------------------------------------------------------------------------
-
-%% Function updating the state/status for a certain runtime component.
-%% Returns a new RTStates structure. Note that Node must not necessarily be one
-%% of the nodes in the session. Meaning that Node shall not be added to RTStates
-%% should it not already be in there.
-statechange_rtstates(Node,State,Status,RTStates) when list(RTStates) ->
- case lists:keysearch(Node,1,RTStates) of
- {value,{_,_,Opts}} ->
- lists:keyreplace(Node,1,RTStates,{Node,{State,Status},Opts});
- _ -> % Then Node does not exist.
- RTStates % Just keep it as is, as keyreplace would have done.
- end.
-%% ------------------------------------------------------------------------------
-
-%% Function updating the state/status for a certain runtime component. The
-%% state/status is set to 'unavailable'.
-%% Returns a new RTStates structure.
-set_unavailable_rtstates(Node,RTStates) when list(RTStates) ->
- case lists:keysearch(Node,1,RTStates) of
- {value,{_,_,Opts}} ->
- lists:keyreplace(Node,1,RTStates,{Node,unavailable,Opts});
- _ -> % Then Node does not exist.
- RTStates % Just keep it as is, as keyreplace would have done.
- end.
-%% ------------------------------------------------------------------------------
-
-%% Function finding the statestatus associated with Node in the RTStates structure.
-%% Returns {ok,StateStatus} or 'false'.
-get_statestatus_rtstates(Node,RTStates) ->
- case lists:keysearch(Node,1,RTStates) of
- {value,{_,StateStatus,_}} ->
- {ok,StateStatus};
- false ->
- false
- end.
-%% ------------------------------------------------------------------------------
-
-%% Help function which returns a list of all nodes that are currently marked
-%% as available to us in the runtime state structure.
-get_all_available_nodes_rtstates(RTStates) ->
- get_all_session_nodes_rtstates(lists:filter(fun({_N,unavailable,_})->false;
- (_)->true
- end,
- RTStates)).
-%% ------------------------------------------------------------------------------
-
-%% Help function returning a list of all nodes belonging to this session.
-get_all_session_nodes_rtstates(RTStates) ->
- lists:map(fun({Node,_,_})->Node end,RTStates).
-%% ------------------------------------------------------------------------------
-
-%% Function which returns a list of nodes that are indicated as tracing in the
-%% RTStates structure.
-get_all_tracing_nodes_rtstates(RTStates) ->
- lists:map(fun({N,_,_})->N end,
- lists:filter(fun({_,{tracing,_},_})->true;(_)->false end,RTStates)).
-%% ------------------------------------------------------------------------------
-
-%% Returns the options associated with Node in the RTStates structure.
-get_opts_rtstates(Node,RTStates) ->
- case lists:keysearch(Node,1,RTStates) of
- {value,{_,_,Opts}} ->
- {ok,Opts};
- false ->
- false
- end.
-
-%% ------------------------------------------------------------------------------
-%% Functions working on the tracerdata structure, which is a part of the loopdata.
-%% The tracerdata structure is an ETS-table of type bag storing:
-%% {Node,TracerData}.
-%% Note that there can of course be multiple entries for a node.
-%% ------------------------------------------------------------------------------
-
-%% Help function which takes a tracerdata loopdata structure and returns a list
-%% of all stored tracerdata for a certain Node.
-find_tracerdata_for_node_trd(Node,TRD) ->
- case ets:lookup(TRD,Node) of
- Result when list(Result) ->
- lists:map(fun({_Node,TracerData})->TracerData end,Result);
- _ -> % Should probably never happend.
- []
- end.
-%% ------------------------------------------------------------------------------
-
-
-%% ------------------------------------------------------------------------------
-%% Functions working on the activity storage structure, which is part of the
-%% loopdata. It stores entries about things that needs to be "redone" in case
-%% of a reactivation of the node. The time order is also important.
-%% Note that for every ActivityType there must be a "handler" in the reactivation
-%% functionality.
-%%
-%% The structure is a bag of {Node,ActivityType,What}.
-%% ActivityType/What=tf/{Op,TraceConfList}|tpm/{Op,[Mod,Func,Arity,MS,CallFunc]}
-%% /{Op,[Mod,Func,Arity,MS,CallFunc,ReturnFunc]}
-%% /{Op,[]}
-%% TraceConfList=[{Proc,Flags},...]
-%% How=true|false
-%% ------------------------------------------------------------------------------
-
-%% Function that adds meta-pattern activities to the activity storage. Note
-%% that one of the parameters to the function is a return value from an
-%% inviso call. In that way we do not enter activities that were unsuccessful.
-%% Op can be either the setting or clearing of a meta pattern.
-%% Returns a new ACTstorage.
-add_tpm_actstorage([{Node,ok}|Rest],Op,InvisoCmdParams,ACTstorage) ->
- true=ets:insert(ACTstorage,{Node,tpm,{Op,InvisoCmdParams}}),
- add_tpm_actstorage(Rest,Op,InvisoCmdParams,ACTstorage);
-add_tpm_actstorage([_|Rest],Op,InvisoCmdParams,ACTstorage) ->
- add_tpm_actstorage(Rest,Op,InvisoCmdParams,ACTstorage);
-add_tpm_actstorage([],_,_,ACTstorage) ->
- ACTstorage.
-
-%% Function that adds process trace-flags to the activity storage. Note that one
-%% of the parameters is the return value from an inviso function. Meaning that
-%% if the flags failed in their entirety, no activity will be saved. If only
-%% some of the flags failed, we will not go through the effort of trying to find
-%% out exactly which.
-%% Returns a new activity storage structure.
-add_tf_actstorage([{_Node,{error,_Reason}}|Rest],Op,TraceConfList,ACTstorage) ->
- add_tf_actstorage(Rest,Op,TraceConfList,ACTstorage);
-add_tf_actstorage([{Node,_Result}|Rest],Op,TraceConfList,ACTstorage) ->
- true=ets:insert(ACTstorage,{Node,tf,{Op,TraceConfList}}),
- add_tf_actstorage(Rest,Op,TraceConfList,ACTstorage);
-add_tf_actstorage([],_,_,ACTstorage) ->
- ACTstorage.
-%% ------------------------------------------------------------------------------
-
-%% Finds all activities associated with Node. Returns a list of them in the
-%% same order as they were inserted.
-get_activities_actstorage(Node,ACTstorage) ->
- case ets:lookup(ACTstorage,Node) of
- [] ->
- false;
- Result when list(Result) ->
- {ok,lists:map(fun({_N,Type,What})->{Type,What} end,Result)}
- end.
-%% ------------------------------------------------------------------------------
-
-%% Function removing all activity entries associated with Node. This is useful
-%% if the Node disconnects for instance.
-del_node_actstorage(Node,ACTstorage) ->
- ets:delete(ACTstorage,Node),
- ACTstorage.
-%% ------------------------------------------------------------------------------
-
diff --git a/lib/inviso/test/Makefile b/lib/inviso/test/Makefile
deleted file mode 100644
index c1df29d631..0000000000
--- a/lib/inviso/test/Makefile
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-include $(ERL_TOP)/make/target.mk
-include $(ERL_TOP)/make/$(TARGET)/otp.mk
-
-MODULES = \
- inviso_tool_SUITE
-
-ERL_FILES= $(MODULES:%=%.erl)
-
-TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR))
-INSTALL_PROGS= $(TARGET_FILES)
-
-EMAKEFILE=Emakefile
-
-# ----------------------------------------------------
-# Release directory specification
-# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/inviso_test
-
-# ----------------------------------------------------
-# FLAGS
-# ----------------------------------------------------
-ERL_MAKE_FLAGS +=
-ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/test_server/include
-
-EBIN = .
-
-# ----------------------------------------------------
-# Targets
-# ----------------------------------------------------
-
-make_emakefile:
- $(ERL_TOP)/make/make_emakefile $(ERL_COMPILE_FLAGS) -o$(EBIN) $(MODULES)\
- > $(EMAKEFILE)
-
-tests debug opt: make_emakefile
- erl $(ERL_MAKE_FLAGS) -make
-
-clean:
- rm -f $(EMAKEFILE)
- rm -f $(TARGET_FILES)
- rm -f core
-
-docs:
-
-# ----------------------------------------------------
-# Release Target
-# ----------------------------------------------------
-include $(ERL_TOP)/make/otp_release_targets.mk
-
-release_spec: opt
-
-release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) inviso.spec inviso.cover $(ERL_FILES) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
-
-release_docs_spec:
-
-
diff --git a/lib/inviso/test/inviso.cover b/lib/inviso/test/inviso.cover
deleted file mode 100644
index e23b9fa59b..0000000000
--- a/lib/inviso/test/inviso.cover
+++ /dev/null
@@ -1,2 +0,0 @@
-{incl_app,inviso,details}.
-
diff --git a/lib/inviso/test/inviso.spec b/lib/inviso/test/inviso.spec
deleted file mode 100644
index 49f9b0b460..0000000000
--- a/lib/inviso/test/inviso.spec
+++ /dev/null
@@ -1 +0,0 @@
-{suites,"../inviso_test",all}.
diff --git a/lib/inviso/test/inviso_tool_SUITE.erl b/lib/inviso/test/inviso_tool_SUITE.erl
deleted file mode 100644
index f8a9cea47f..0000000000
--- a/lib/inviso/test/inviso_tool_SUITE.erl
+++ /dev/null
@@ -1,1166 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%%
-%% Description:
-%% Test suite for the inviso_tool. It is here assumed that inviso works
-%% properly.
-%%
-%% Authors:
-%% Lennart Öhman, [email protected]
-%% -----------------------------------------------------------------------------
-
--module(inviso_tool_SUITE).
--compile(export_all).
-
--include_lib("common_test/include/ct.hrl").
--include_lib("kernel/include/file.hrl").
-
--define(l,?line).
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
-
-all() ->
- [dist_basic_1, dist_rtc, dist_reconnect, dist_adopt,
- dist_history, dist_start_session_special].
-
-groups() ->
- [].
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
-%% -----------------------------------------------------------------------------
-
-init_per_suite(Config) ->
- case test_server:is_native(lists) of
- true ->
- {skip,"Native libs -- tracing doesn't work"};
- false ->
- Config
- end.
-%% -----------------------------------------------------------------------------
-
-end_per_suite(_Config) ->
- ok.
-%% -----------------------------------------------------------------------------
-
-%% For each distributed testcase, we need two other distributed nodes to run the
-%% runtime components on. Since they are freshly started every time there is no
-%% need to clean them up first.
-init_per_testcase(_Case,Config) ->
- ?l TH=test_server:timetrap(100000),
- ?l {ok,Node1}=test_server:start_node(inviso1,peer,[]),
- ?l {ok,Node2}=test_server:start_node(inviso2,peer,[]),
- ?l SuiteDir=filename:dirname(code:which(?MODULE)),
-
- %% Otherwise peer nodes will not find this module!
- ?l true=rpc:call(Node1,code,add_patha,[SuiteDir]),
- ?l true=rpc:call(Node2,code,add_patha,[SuiteDir]),
-
- %% SPECIAL FOR MY PRIVATE TEST ENVIROMENT
-% ?l rpc:call(Node1,code,add_patha,["/clearcase/otp/tools/runtime_tools/ebin"]),
-% ?l rpc:call(Node1,code,add_patha,["/clearcase/otp/tools/inviso/ebin"]),
-% ?l rpc:call(Node2,code,add_patha,["/clearcase/otp/tools/runtime_tools/ebin"]),
-% ?l rpc:call(Node2,code,add_patha,["/clearcase/otp/tools/inviso/ebin"]),
-
-% %% SPECIAL FOR MY PRIVATE TEST ENVIROMENT, windows.
-% ?l rpc:call(Node1,code,add_patha,["C:/DATA/PROJECTS/inviso_project/runtime_tools/ebin"]),
-% ?l rpc:call(Node1,code,add_patha,["C:/DATA/PROJECTS/inviso_project/inviso/ebin"]),
-% ?l rpc:call(Node2,code,add_patha,["C:/DATA/PROJECTS/inviso_project/runtime_tools/ebin"]),
-% ?l rpc:call(Node2,code,add_patha,["C:/DATA/PROJECTS/inviso_project/inviso/ebin"]),
-
- ?l ok=rpc:call(Node1,application,start,[runtime_tools]),
- ?l ok=rpc:call(Node2,application,start,[runtime_tools]),
- ?l timer:sleep(100), % Problem with autostarted runtime.
- %% The following is a test that the inviso_rt processes which are autostarted
- %% are now gone.
-
- ?l ok=poll(rpc,call,[Node1,erlang,whereis,[inviso_rt]],undefined,20),
- ?l ok=poll(rpc,call,[Node2,erlang,whereis,[inviso_rt]],undefined,20),
-
- NewConfig1=insert_remotenode_config(inviso1,Node1,Config),
- NewConfig2=insert_remotenode_config(inviso2,Node2,NewConfig1),
- insert_timetraphandle_config(TH,NewConfig2).
-%% -----------------------------------------------------------------------------
-
-end_per_testcase(_Case,Config) ->
- ?l test_server:stop_node(get_remotenode_config(inviso1,Config)),
- ?l test_server:stop_node(get_remotenode_config(inviso2,Config)),
- ?l test_server:timetrap_cancel(get_timetraphandle_config(Config)),
- ?l case whereis(inviso_tool) of % In case inviso_tool did not stop.
- Pid when is_pid(Pid) ->
- ?l io:format("Had to kill inviso_tool!~n",[]),
- ?l exit(Pid,kill);
- _ ->
- true
- end,
- ?l case whereis(inviso_rt) of % In case we ran a runtime here.
- Pid2 when is_pid(Pid2) ->
- ?l io:format("Had to kill inviso_rt!~n",[]),
- ?l exit(Pid2,kill);
- _ ->
- true
- end,
- ?l case whereis(inviso_c) of % In case we ran the controll component here.
- Pid3 when is_pid(Pid3) ->
- ?l io:format("Had to kill inviso_c!~n",[]),
- ?l exit(Pid3,kill);
- _ ->
- true
- end,
- NewConfig1=remove_remotenode_config(inviso1,Config),
- NewConfig2=remove_remotenode_config(inviso2,NewConfig1),
- remove_timetraphandle_config(NewConfig2).
-%% -----------------------------------------------------------------------------
-
-%% ==============================================================================
-%% Testcases.
-%% ==============================================================================
-
-%% -----------------------------------------------------------------------------
-%% Functional tests:
-%% API:
-%% start/0 dist_basic_1
-%% stop/0 dist_basic_1
-%% reconnect_nodes/1 dist_reconnect
-%% start_session/0 dist_basic_1
-%% reinitiate_session/1 dist_reconnect
-%% stop_session/0 dist_basic_1
-%% atc/3 dist_basic_1
-%% sync_atc/3 dist_basic_1
-%% sync_rtc/2, dist_rtc
-%% dtc/2 dist_basic_1
-%% sync_dtc/2 dist_basic_1
-%% inviso/2 dist_basic_1
-%% reactivate/1 dist_basic_1
-%% get_autostart_data/2 dist_basic_1
-%% get_activities/0 dist_basic_1
-%% save_history/1 dist_history
-%% restore_session/1 dist_history
-%% get_node_status/1 dist_basic_1
-%% get_session_data/0 dist_basic_1
-%% flush/0 dist_basic_1
-%% -----------------------------------------------------------------------------
-
-%% Non functional tests:
-%% Run the control component on both the dist_history
-%% same node as the tool and on a
-%% different node.
-%% Let a trace case crash in its execution dist_basic_1
-%% and check that it does not become
-%% part of the history.
-%% Check that tracer data becomes what the NOT IMPLEMENTED
-%% tdg function generates.
-%% Check that all inviso runtime stop_inviso_tool/2
-%% components terminate if the tool is
-%% killed.
-%% Check that activation/deactivation dist_basic_1
-%% cancels each other out in the history.
-%% Check that regexp expansion is done on dist_reconnect
-%% another node if regexp_node is down.
-%% Test that tool-commands activating dist_basic_1
-%% something done during a reactivation
-%% are actually done a bit later at the
-%% reactivated node (this since the the
-%% command being reactivated at the momen
-%% at the reactivating node may not
-%% be finished at the time the new tool
-%% command is issued).
-%% Check that deactivating tracecases are dist_basic_1
-%% not redone at a reactivating node.
-%% (to prevent it from being redone and
-%% then just deactivated).
-%% Check that on-going reactivators and NOT IMPLEMENTED
-%% tracecases are killed when stop_session.
-%% Check that inviso_tool can and will adopt
-%% a running runtime component. dist_adopt
-%% -----------------------------------------------------------------------------
-
--define(TC_DEF_FILE,filename:join(DataDir,"tracecase_def.txt")).
-
-%% TEST CASE: Basic, distributed, start of inviso_tool with simple tracing.
-dist_basic_1(doc) -> ["Simple test"];
-dist_basic_1(suite) -> [];
-dist_basic_1(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- [RegExpNode|_]=RemoteNodes,
- CNode=node(),
- Nodes=RemoteNodes,
- DataDir=?config(data_dir,Config),
- PrivDir=filename:join(?config(priv_dir,Config),""),
- Opts=[{regexp_node,RegExpNode},
- {tdg,{?MODULE,tdg,[PrivDir]}},
- {tc_def_file,?TC_DEF_FILE},
- {initial_tcs,[{tracecase_init,[]}]},
- {dir,DataDir}], % This is where we find tracecases.
- ?l start_inviso_tool(Nodes,CNode,Opts),
- %% Now we know that all inviso runtimes are running and are not tracing.
- ?l {error,no_session}=inviso_tool:inviso(tpl,[lists,module_info,0,[]]),
- ?l {error,no_session}=inviso_tool:get_session_data(),
- ?l start_inviso_tool_session(CNode,[],1,Nodes),
- ?l {ok,{tracing,1,TDGargs}}=inviso_tool:get_session_data(),
- ?l true=is_list(TDGargs),
- %% Check that the initial tracecase has been executed at all tracing nodes.
- ?l lists:foreach(fun(N)->
- ok=poll(rpc,
- call,
- [N,
- erlang,
- trace_info,
- [{lists,module_info,1},traced]],
- {traced,local},
- 20)
- end,
- Nodes),
- %% Start a test process at every node with a runtime component.
- ?l lists:foreach(fun(N)->spawn(N,?MODULE,test_proc_init,[]) end,Nodes),
-
- %% Let the processes start
- timer:sleep(100),
-
- %% Find the pids of the test processes.
- ?l TestProcs=lists:map(fun(N)->rpc:call(N,erlang,whereis,[inviso_tool_test_proc]) end,
- Nodes),
- ?l true=(1=<length(TestProcs)),
-
- %% Activate a trace case.
- ?l {error,unknown_tracecase}=inviso_tool:atc(nonexistant,id,[]),
- ?l {error,{missing_variable,'ProcessName'}}=
- inviso_tool:atc(tracecase1,id1,[]),
- ?l ok=inviso_tool:atc(tracecase1,id1,[{'ProcessName',inviso_tool_test_proc}]),
- ?l {error,activating}=inviso_tool:atc(tracecase1,id1,[{'ProcessName',inviso_tool_test_proc}]),
- ?l {ok,[{tracecases,[{{tracecase1,id1},activating}]}]}=inviso_tool:get_activities(),
- ?l timer:sleep(1700), % There is a 500 ms delay in the tracecase.
- ?l {error,already_started}=
- inviso_tool:atc(tracecase1,id1,[{'ProcessName',inviso_tool_test_proc}]),
-
- %% Now check that the trace case was executed at Nodes.
- ?l lists:foreach(fun(P)->
- ?l ok=poll(rpc,
- call,
- [node(P),erlang,trace_info,[P,flags]],
- {flags,[call]},
- 10),
- ?l ok=poll(rpc,
- call,
- [node(P),erlang,trace_info,[{math,module_info,1},traced]],
- {traced,local},
- 10)
- end,
- TestProcs),
- ?l lists:foreach(fun(P) ->
- ?l ok=poll(rpc,
- call,
- [node(P),erlang,trace_info,[{math,module_info,0},traced]],
- {traced,false},
- 1)
- end,
- TestProcs),
-
- %% Test inviso_tool:inviso/2.
- ?l {ok,NodeResults1}=inviso_tool:inviso(tpl,[math,module_info,0,[]]),
- ?l true=check_noderesults(Nodes,{ok,[1]},NodeResults1),
- ?l lists:foreach(fun(P) ->
- ?l ok=poll(rpc,
- call,
- [node(P),erlang,trace_info,[{math,module_info,0},traced]],
- {traced,local},
- 10)
- end,
- TestProcs),
-
- %% Test inviso_tool:sync_atc/3.
- ?l a_return_value=inviso_tool:sync_atc(tracecase2,id2,[]), % This will take 3000 ms.
- ?l lists:foreach(fun(P) ->
- ?l ok=poll(rpc,
- call,
- [node(P),erlang,trace_info,[{math,pi,0},traced]],
- {traced,local},
- 10)
- end,
- TestProcs),
-
- %% Test the reactivation mechanism.
- ?l [ANode|OtherNodes]=Nodes, % Get a node to suspend.
- ?l {ok,{tracing,running}}=inviso_tool:get_node_status(ANode),
- ?l {ok,[{ANode,ok}]}=rpc:call(CNode,inviso,suspend,[[ANode],test]),
- ?l [APid|_]=TestProcs, % The first process is at ANode.
- %% Now check that trace flags were removed at ANode. This is actually testing inviso.
- ?l ok=poll(rpc,call,[node(APid),erlang,trace_info,[APid,flags]],{flags,[]},10),
- ?l {ok,{tracing,suspended}}=inviso_tool:get_node_status(ANode),
- %% Now reactivate it and expect the history to be redone. But it will take
- %% 3000 ms since there is a delay in tracecase2. Use that delay to issue a new
- %% tool command.
- ?l ok=inviso_tool:reactivate(ANode),
- ?l {ok,reactivating}=inviso_tool:get_node_status(ANode),
- ?l {ok,NodeResults2}=inviso_tool:inviso(tpl,[math,sin,1,[]]),
- ?l true=check_noderesults(OtherNodes,{ok,[1]},NodeResults2),
- %% Verify that the inviso command was not done (yet) at ANode.
- ?l {traced,false}=rpc:call(ANode,erlang,trace_info,[{math,sin,1},traced]),
- ?l {ok,[{reactivating_nodes,[ANode]}]}=inviso_tool:get_activities(),
- ?l timer:sleep(3600),
- %% Now the history shall have been redone including the new inviso command.
- ?l ok=poll(rpc,call,[ANode,erlang,trace_info,[{math,sin,1},traced]],{traced,local},10),
- ?l {flags,[call]}=rpc:call(ANode,erlang,trace_info,[APid,flags]),
- ?l {ok,[]}=inviso_tool:get_activities(),
-
- %% Check the get_autostart function. We know that we use the standard options
- %% generator and the tracecases activated above.
- ?l {ok,{AutostartData1,NodeResults3}}=
- inviso_tool:get_autostart_data(Nodes,{dependency,infinity}),
- ?l true=check_noderesults(Nodes,
- fun({_N,{ok,{[{dependency,infinity}],{tdg,{_M,_F,TDlist}}}}})
- when is_list(TDlist)->
- true;
- (_) ->
- false
- end,
- NodeResults3),
- %% Check the tracecase that shall be activated and their order.
- ?l TraceCaseFileNameInit=filename:join(DataDir,"./tracecase_init.trc"),
- ?l TraceCaseFileName1=filename:join(DataDir,"./tracecase1_on.trc"),
- ?l TraceCaseFileName2=filename:join(DataDir,"./tracecase2_on.trc"),
- ?l [{file,{TraceCaseFileNameInit,[]}},
- {file,{TraceCaseFileName1,[{'ProcessName',inviso_tool_test_proc}]}},
- {mfa,{inviso,tpl,[math,module_info,0,[]]}},
- {file,{TraceCaseFileName2,[]}},
- {mfa,{inviso,tpl,[math,sin,1,[]]}}]=AutostartData1,
-
- %% Try to activate a faulty tracecase. We shall get the same history as before.
- ?l ok=inviso_tool:atc(tracecase3,id3,[]),
- ?l ok=poll(inviso_tool,get_activities,[],{ok,[]},10),
- ?l {ok,{AutostartData1,NodeResults3}}=
- inviso_tool:get_autostart_data(Nodes,{dependency,infinity}),
-
- %% Now deactivate a trace case.
- ?l inviso_tool:dtc(tracecase1,id1),
- %% Check that the now deactivated trace case is not part of autostart data
- %% if requested from the tool.
- ?l {ok,{AutostartData2,_NodeResults}}=
- inviso_tool:get_autostart_data(Nodes,{dependency,infinity}),
- ?l [{file,{TraceCaseFileNameInit,[]}},
- {mfa,{inviso,tpl,[math,module_info,0,[]]}},
- {file,{TraceCaseFileName2,[]}},
- {mfa,{inviso,tpl,[math,sin,1,[]]}}]=AutostartData2,
- %% Now tracing shall be removed since we deactivated tracecase1.
- ?l lists:foreach(fun(P)->
- ?l ok=poll(rpc,
- call,
- [node(P),erlang,trace_info,[P,flags]],
- {flags,[]},
- 10),
- ?l ok=poll(rpc,
- call,
- [node(P),erlang,trace_info,[{math,module_info,1},traced]],
- {traced,false},
- 10)
- end,
- TestProcs),
-
- %% Suspend the ANode again and check that when it is reactivated that
- %% tracecase1 is not redone at all. We use an ets table with a counter that is
- %% incremented every time the tracecase1 is executed.
- ?l {ok,[{ANode,ok}]}=rpc:call(CNode,inviso,suspend,[[ANode],testagain]),
- ?l [{counter,SideEffectCounter1}]=rpc:call(ANode,ets,lookup,[test_proc_tab,counter]),
- ?l true=(SideEffectCounter1>0),
- ?l ok=inviso_tool:reactivate(ANode),
- ?l timer:sleep(3000), % The delay in tracecase2.
- ?l ok=poll(inviso_tool,get_activities,[],{ok,[]},10),
- %% Now the reactivation is done, check that tracecase1 was not redone at ANode.
- ?l [{counter,SideEffectCounter1}]=rpc:call(ANode,ets,lookup,[test_proc_tab,counter]),
-
- %% Deactivate tracecase2.
- ?l another_return_value=inviso_tool:sync_dtc(tracecase2,id2),
- %% Immediately check the autostart data (again!). This time we want to see
- %% that the two inviso commands have been joined since there is no tracecase
- %% in between.
- ?l {ok,{AutostartData3,NodeResults}}=
- inviso_tool:get_autostart_data(Nodes,{dependency,infinity}),
- ?l [{file,{TraceCaseFileNameInit,[]}},
- {mfa,{inviso,tpl,[math,module_info,0,[]]}},
- {mfa,{inviso,tpl,[math,sin,1,[]]}}]=AutostartData3,
-
- %% Check that a deactivating tracecase is not redone at a reactivating node.
- ?l inviso_tool:sync_atc(tracecase5,id5,[]), % Updates the counter.
- %% Yet again suspend the node when we know that tracecase5 has been executed.
- ?l {ok,[{ANode,ok}]}=rpc:call(CNode,inviso,suspend,[[ANode],testagain2]),
- ?l timer:sleep(100), % Subscription reaches the tool.
- ?l [{counter,SideEffectCounter2A}]=rpc:call(ANode,ets,lookup,[test_proc_tab,counter]),
- ?l [BNode|_]=OtherNodes,
- ?l [{counter,SideEffectCounter2B}]=rpc:call(BNode,ets,lookup,[test_proc_tab,counter]),
- ?l ok=inviso_tool:dtc(tracecase5,id5), % In here there is a 2000 ms delay!
- ?l ok=inviso_tool:reactivate(ANode),
- %% Check that the reactivator is done, but that the tracecase remains. The
- %% reactivator should be done pretty quickly since there are no delays in the
- %% still active tracecases.
- ?l ok=poll(inviso_tool,
- get_activities,
- [],
- {ok,[{tracecases,[{{tracecase5,id5},deactivating}]}]},
- 10),
- ?l ok=poll(inviso_tool,get_activities,[],{ok,[]},30),
- ?l [{counter,SideEffectCounter2A}]=rpc:call(ANode,ets,lookup,[test_proc_tab,counter]),
- ?l SideEffectCounter2B1=SideEffectCounter2B+1,
- ?l [{counter,SideEffectCounter2B1}]=rpc:call(BNode,ets,lookup,[test_proc_tab,counter]),
-
- %% Check the flush function. It is difficult to find out if it really flushed.
- ?l {ok,NodeResults4}=inviso_tool:flush(),
- ?l true=check_noderesults(Nodes,ok,NodeResults4),
-
- %% Check that this function still has a trace pattern. We are going to stop session
- %% and check that it is still there.
- ?l lists:foreach(fun(N)->
- ok=poll(rpc,
- call,
- [N,
- erlang,
- trace_info,
- [{math,sin,1},traced]],
- {traced,local},
- 20)
- end,
- Nodes),
-
- ?l stop_inviso_tool_session(CNode,1,Nodes),
- ?l {ok,{not_tracing,1,TDGargs}}=inviso_tool:get_session_data(),
-
- ?l {ok,NodeResults5}=inviso_tool:flush(Nodes),
- ?l true=check_noderesults(Nodes,fun({_,{error,_}})->true;(_)->false end,NodeResults5),
- ?l {ok,[]}=inviso_tool:flush(),
-
- %% Check that you can not start trace cases when the session is stopped.
- ?l {error,no_session}=inviso_tool:atc(tracecase2,id3,[]),
- %% But the history shall be there to retrieve.
- ?l {ok,{AutostartData3,NodeResults}}=
- inviso_tool:get_autostart_data(Nodes,{dependency,infinity}),
- ?l {ok,{inactive,running}}=inviso_tool:get_node_status(ANode),
-
- %% Check that the trace pattern is still there.
- ?l lists:foreach(fun(N)->
- ok=poll(rpc,
- call,
- [N,
- erlang,
- trace_info,
- [{math,sin,1},traced]],
- {traced,local},
- 20)
- end,
- Nodes),
-
- %% Now start a session and check that the trace patterns is gone.
- ?l start_inviso_tool_session(CNode,[],2,Nodes),
- ?l lists:foreach(fun(N)->
- ok=poll(rpc,
- call,
- [N,
- erlang,
- trace_info,
- [{math,sin,1},traced]],
- {traced,false},
- 20)
- end,
- Nodes),
- ?l stop_inviso_tool_session(CNode,2,Nodes),
-
- ?l stop_inviso_tool(CNode,Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% This test case tests the rtc trace case mechanism.
-dist_rtc(doc) -> [""];
-dist_rtc(suite) -> [];
-dist_rtc(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- [RegExpNode|_]=RemoteNodes,
- CNode=node(),
- Nodes=RemoteNodes,
- DataDir=?config(data_dir,Config),
- PrivDir=filename:join(?config(priv_dir,Config),""),
- Opts=[{regexp_node,RegExpNode},
- {tdg,{?MODULE,tdg,[PrivDir]}},
- {tc_def_file,?TC_DEF_FILE},
- {initial_tcs,[{tracecase_init,[]}]},
- {dir,DataDir}], % This is where we find tracecases.
- ?l start_inviso_tool(Nodes,CNode,Opts),
- ?l start_inviso_tool_session(CNode,[],1,Nodes),
- %% Check that the initial tracecase has been executed at all tracing nodes.
- ?l lists:foreach(fun(N)->
- ok=poll(rpc,
- call,
- [N,
- erlang,
- trace_info,
- [{lists,module_info,1},traced]],
- {traced,local},
- 20)
- end,
- Nodes),
- %% Start a test process at every node with a runtime component.
- ?l lists:foreach(fun(N)->spawn(N,?MODULE,test_proc_init,[]) end,Nodes),
-
- %% Let the processes start
- timer:sleep(100),
-
- %% Find the pids of the test processes.
- ?l TestProcs=lists:map(fun(N)->rpc:call(N,erlang,whereis,[inviso_tool_test_proc]) end,
- Nodes),
- ?l true=(1=<length(TestProcs)),
- ?l [ANode|_]=Nodes,
- ?l [{counter,Val}]=rpc:call(ANode,ets,lookup,[test_proc_tab,counter]),
- %% Call the tracecase as an rtc.
- ?l inviso_tool:sync_rtc(tracecase5,[]), % Updates the counter.
- ?l [{counter,Val2}]=rpc:call(ANode,ets,lookup,[test_proc_tab,counter]),
- ?l true=(Val2==Val+1),
- ?l inviso_tool:sync_rtc(tracecase5,[]), % Updates the counter.
- ?l [{counter,Val3}]=rpc:call(ANode,ets,lookup,[test_proc_tab,counter]),
- ?l true=(Val3==Val2+1),
-
- %% Now we stop the session and restore it again.
- ?l stop_inviso_tool_session(CNode,1,Nodes),
- ?l {ok,{2,_InvisoReturn}}=inviso_tool:restore_session(),
- %% The tracecase shall be done twice then.
- ?l ok=poll(rpc,call,[ANode,ets,lookup,[test_proc_tab,counter]],
- fun([{counter,V}]) when V==Val3+2 -> true;
- (_) -> false
- end,
- 20),
- ?l stop_inviso_tool_session(CNode,2,Nodes),
-
- ?l {ok,{AutostartData,_NodeResults}}=
- inviso_tool:get_autostart_data(Nodes,{dependency,infinity}),
- ?l [{file,{_FileNameInit,_}},{file,{FileName,Bindings}},{file,{FileName,Bindings}}]=
- AutostartData,
- ?l stop_inviso_tool(CNode,Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-
-%% This test case tests mainly that reconnect and reinitiations of a node works.
-dist_reconnect(doc) -> [""];
-dist_reconnect(suite) -> [];
-dist_reconnect(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- [RegExpNode|OtherNodes]=RemoteNodes,
- CNode=node(),
- Nodes=RemoteNodes,
- DataDir=?config(data_dir,Config),
- PrivDir=filename:join(?config(priv_dir,Config),""),
- Opts=[{regexp_node,RegExpNode},
- {tdg,{?MODULE,tdg,[PrivDir]}},
- {tc_def_file,?TC_DEF_FILE},
- {initial_tcs,[{tracecase_init,[]}]},
- {dir,DataDir}], % This is where we find tracecases.
- ?l start_inviso_tool(Nodes,CNode,Opts),
- ?l start_inviso_tool_session(CNode,[],1,Nodes),
- %% Start a test process at every node with a runtime component.
- ?l lists:foreach(fun(N)->spawn(N,?MODULE,test_proc_init,[]) end,Nodes),
-
- %% Let the processes start
- timer:sleep(100),
-
- %% Find the pids of the test processes.
- ?l TestProcs=lists:map(fun(N)->rpc:call(N,erlang,whereis,[inviso_tool_test_proc]) end,
- Nodes),
- ?l true=(1=<length(TestProcs)),
- ?l ok=inviso_tool:atc(tracecase1,id1,[{'ProcessName',inviso_tool_test_proc}]),
- ?l ok=poll(inviso_tool,get_activities,[],{ok,[]},20),
-
- %% Now we want to crash a node. Lets choose the RegExp node, then we can test
- %% that regexp expansion is done elsewhere too.
- ?l test_server:stop_node(RegExpNode),
- ?l ok=poll(net_adm,ping,[RegExpNode],pang,10),
- %% Make time for the monitoring signal to reach inviso_c and for inviso_c to
- %% inform its subscribers e.g inviso_tool.
- ?l timer:sleep(100),
- ?l {_,[{_Node,Modules}]}=
- inviso_tool_lib:expand_module_names([node()],"application.*",[]),
- ?l NrOfModules=length(Modules),
- %% This also checks that regexp expansion can be made at another node
- %% than RexExpNode.
- ?l {ok,NodeResults1}=inviso_tool:inviso(tp,["application.*",module_info,0,[]]),
- ?l true=check_noderesults(OtherNodes,
- fun({_N,{ok,Ints}}) when is_list(Ints) ->
- NrOfModules=lists:sum(Ints),
- true;
- (_) ->
- false
- end,
- NodeResults1),
-
- %% Do some faulty tests on the dead node.
- ?l {ok,{ok,[{RegExpNode,{error,down}}]}}=
- inviso_tool:reinitiate_session([RegExpNode]),
- ?l {ok,down}=inviso_tool:get_node_status(RegExpNode),
-
- %% Now it is time to restart the crashed node and reconnect it and then
- %% finally reinitiate it.
- ?l RegExpNodeString=atom_to_list(RegExpNode),
- ?l [NodeNameString,_HostNameString] = string:tokens(RegExpNodeString,[$@]),
- ?l RegExpNodeName=list_to_atom(NodeNameString),
- ?l test_server:start_node(RegExpNodeName,peer,[]),
- ?l ok=poll(net_adm,ping,[RegExpNode],pong,20),
- ?l SuiteDir=filename:dirname(code:which(?MODULE)),
- ?l true=rpc:call(RegExpNode,code,add_patha,[SuiteDir]),
- ?l ok=rpc:call(RegExpNode,application,start,[runtime_tools]),
- ?l ok=poll(rpc,call,[RegExpNode,erlang,whereis,[inviso_rt]],undefined,20),
- ?l {ok,down}=inviso_tool:get_node_status(RegExpNode),
-
- %% Restart the test process.
- ?l spawn(RegExpNode,?MODULE,test_proc_init,[]),
- ?l ok=poll(rpc,
- call,
- [RegExpNode,erlang,whereis,[inviso_tool_test_proc]],
- fun(P) when is_pid(P) -> true;
- (undefined) -> false
- end,
- 10),
- ?l TPid=rpc:call(RegExpNode,erlang,whereis,[inviso_tool_test_proc]),
- ?l {ok,[{RegExpNode,{ok,{inactive,running}}}]}=inviso_tool:reconnect_nodes([RegExpNode]),
- %% Try to reconnect the node again and an unknown node.
- ?l UnknownNode='unknown@nonexistant',
- ?l {ok,[{RegExpNode,{error,already_connected}},{UnknownNode,{error,unknown_node}}]}=
- inviso_tool:reconnect_nodes([RegExpNode,UnknownNode]),
- ?l {ok,{ok,[{RegExpNode,{ok,_}}]}}=inviso_tool:reinitiate_session([RegExpNode]),
- ?l ok=poll(rpc,
- call,
- [RegExpNode,erlang,trace_info,[TPid,flags]],
- {flags,[call]},
- 10),
- ?l {ok,{ok,[{RegExpNode,{error,already_in_session}},{UnknownNode,{error,unknown_node}}]}}=
- inviso_tool:reinitiate_session([RegExpNode,UnknownNode]),
-
- %% Suspend RegExpNode and test that it can not be reinitiated.
- ?l {ok,[{RegExpNode,ok}]}=rpc:call(CNode,inviso,suspend,[[RegExpNode],yetatest]),
- ?l {ok,[{RegExpNode,{error,already_connected}}]}=inviso_tool:reconnect_nodes([RegExpNode]),
- ?l {ok,{ok,[{RegExpNode,{error,suspended}}]}}=inviso_tool:reinitiate_session([RegExpNode]),
-
- %% Now we start a tracecase that will never terminate. We then reactivate the
- %% suspended node. Then there will be a running reactivator and a running
- %% tracecase to kill.
- ?l ok=inviso_tool:atc(tracecase4,id4,[]), % This one will not terminate.
- ?l ok=inviso_tool:reactivate(RegExpNode),
- ?l ok=poll(inviso_tool,
- get_activities,
- [],
- fun({ok,L}) when length(L)==2 -> true;
- (_) -> false
- end,
- 20),
- %% Now the reactivator and the tracecase shall be stuck(!)
- ?l {links,ToolLinks}=process_info(whereis(inviso_tool),links),
- ?l [P1,P2]=lists:foldl(fun(P,Acc)->case process_info(P,initial_call) of
- {initial_call,{inviso_tool,_,_}} ->
- [P|Acc];
- _ ->
- Acc
- end
- end,
- [],
- ToolLinks),
- ?l stop_inviso_tool_session(CNode,1,Nodes),
- %% Check that the processes are killed.
- ?l ok=poll(erlang,process_info,[P1],undefined,10),
- ?l ok=poll(erlang,process_info,[P2],undefined,10),
- ?l stop_inviso_tool(CNode,Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% This test tests that we can adopt a running inviso runtime component and
-%% mark it as tracing-running.
-dist_adopt(doc) -> [""];
-dist_adopt(suite) -> [];
-dist_adopt(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- [RegExpNode|_]=RemoteNodes,
- CNode=node(),
- Nodes=RemoteNodes,
- DataDir=?config(data_dir,Config),
- PrivDir=filename:join(?config(priv_dir,Config),""),
-
- %% Then first start runtime components at different nodes for us to
- %% later adopt.
- ?l {ok,_IPid}=inviso:start(),
- ?l {ok,NodeResults1}=inviso:add_nodes(Nodes,a_tag,[{dependency,infinity}]),
- ?l true=check_noderesults(Nodes,{ok,new},NodeResults1),
- ?l [ANode|OtherNodes]=Nodes,
- ?l {ok,[{ANode,_LogResult}]}=
- inviso:init_tracing([ANode],
- [{trace,{file,filename:join(PrivDir,"dist_adopt_adoptednode.log")}},
- {ti,{file,filename:join(PrivDir,"dist_adopt_adoptednode.ti")}}]),
- ?l inviso:stop(),
- ?l ok=poll(erlang,whereis,[inviso_c],undefined,10),
- ?l lists:foreach(fun(N)->true=(is_pid(rpc:call(N,erlang,whereis,[inviso_rt]))) end,
- Nodes),
-
- %% Now start the tool and watch it adopt the runtimes.
- Opts=[{regexp_node,RegExpNode},
- {tdg,{?MODULE,tdg,[PrivDir]}},
- {tc_def_file,?TC_DEF_FILE},
- {initial_tcs,[{tracecase_init,[]}]},
- {dir,DataDir}], % This is where we find tracecases.
- ?l Options=[{nodes,Nodes},{c_node,CNode}|Opts],
- ?l {ok,_Pid}=inviso_tool:start(Options),
- ?l ok=poll(erlang,whereis,[inviso_tool],fun(X)->true=is_pid(X) end,10),
- ?l io:format("LoopData:~p~n",[inviso_tool:get_loopdata()]),
- ?l {ok,{1,InvisoReturn}}=inviso_tool:start_session([]),
- ?l io:format("Invisoreturn:~p~n",[InvisoReturn]),
- %% Now check that all nodes are tracing.
- ?l lists:foreach(fun(N)->ok=poll(rpc,
- call,
- [CNode,inviso,get_status,[[N]]],
- fun({ok,[{_N,{ok,{tracing,running}}}]})->true;
- (_) ->false
- end,
- 10)
- end,
- Nodes),
-
- %% At this point all nodes shall be tracing. However the initial tracecase
- %% shall not have been executed at ANode since it was adopted by the tool.
- ?l {traced,false}=rpc:call(ANode,erlang,trace_info,[{lists,module_info,1},traced]),
- ?l lists:foreach(fun(N)->
- {traced,local}=
- rpc:call(N,erlang,trace_info,[{lists,module_info,1},traced])
- end,
- OtherNodes),
- ?l stop_inviso_tool_session(CNode,1,Nodes),
- ?l [BNode|_]=OtherNodes,
- %% Since nodes are not cleared the pattern still be there.
- ?l {traced,local}=rpc:call(BNode,erlang,trace_info,[{lists,module_info,1},traced]),
- ?l start_inviso_tool_session(CNode,[],2,Nodes),
- ?l stop_inviso_tool_session(CNode,2,Nodes),
- ?l {ok,_NodeResults}=inviso_tool:stop(),
- ?l ok=poll(erlang,whereis,[inviso_tool],undefined,10),
- ?l ok=poll(rpc,call,[CNode,erlang,whereis,[inviso_c]],undefined,10),
-
- ok.
-%% -----------------------------------------------------------------------------
-
-%% This test tests that saving and restoring a history works.
-dist_history(doc) -> [""];
-dist_history(suite) -> [];
-dist_history(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- [RegExpNode|_]=RemoteNodes,
- CNode=RegExpNode, % We use a remote control component.
- Nodes=RemoteNodes,
- DataDir=?config(data_dir,Config),
- PrivDir=filename:join(?config(priv_dir,Config),""),
-
- %% Start up the tool and a couple of inviso runtimes.
- Opts=[{regexp_node,RegExpNode},
- {tdg,{?MODULE,tdg,[PrivDir]}},
- {tc_def_file,?TC_DEF_FILE},
- {initial_tcs,[{tracecase_init,[]}]},
- {dir,DataDir}], % This is where we find tracecases.
- ?l start_inviso_tool(Nodes,CNode,Opts),
- ?l start_inviso_tool_session(CNode,[],1,Nodes),
- %% Start a test process at every node with a runtime component.
- ?l lists:foreach(fun(N)->spawn(N,?MODULE,test_proc_init,[]) end,Nodes),
-
- %% Activate tracing of the test process.
- ?l ok=inviso_tool:atc(tracecase1,id1,[{'ProcessName',inviso_tool_test_proc}]),
- ?l ok=poll(inviso_tool,get_activities,[],{ok,[]},10),
- ?l TestProcs=lists:map(fun(N)->rpc:call(N,erlang,whereis,[inviso_tool_test_proc]) end,
- Nodes),
- ?l lists:foreach(fun(P)->
- ?l ok=poll(rpc,
- call,
- [node(P),erlang,trace_info,[P,flags]],
- {flags,[call]},
- 10),
- ?l ok=poll(rpc,
- call,
- [node(P),erlang,trace_info,[{math,module_info,1},traced]],
- {traced,local},
- 10)
- end,
- TestProcs),
-
- %% Create a history file.
- ?l AbsFileName=filename:join(PrivDir,"dist_history.his"),
- ?l {ok,AbsFileName}=inviso_tool:save_history(AbsFileName),
- ?l {ok,_FileInfo}=file:read_file_info(AbsFileName),
-
- %% Stop the tracing of the test process.
- ?l inviso_tool:sync_dtc(tracecase1,id1),
- ?l lists:foreach(fun(P)->
- ?l ok=poll(rpc,
- call,
- [node(P),erlang,trace_info,[P,flags]],
- {flags,[]},
- 10),
- ?l ok=poll(rpc,
- call,
- [node(P),erlang,trace_info,[{math,module_info,1},traced]],
- {traced,false},
- 10)
- end,
- TestProcs),
- %% Now stop the session.
- ?l stop_inviso_tool_session(CNode,1,Nodes),
- %% Restart the session using the previously saved history.
- ?l {ok,{2,_InvisoReturn}}=inviso_tool:restore_session(AbsFileName),
- ?l ok=poll(inviso_tool,get_activities,[],{ok,[]},10),
- %% Check that the history has been redone.
- ?l lists:foreach(fun(P)->
- ?l ok=poll(rpc,
- call,
- [node(P),erlang,trace_info,[P,flags]],
- {flags,[call]},
- 10),
- ?l ok=poll(rpc,
- call,
- [node(P),erlang,trace_info,[{math,module_info,1},traced]],
- {traced,local},
- 10)
- end,
- TestProcs),
- ?l {ok,_NodeResults1}=inviso_tool:inviso(tpl,[math,module_info,0,[]]),
- %% Also check that the restored history now is our history.
- ?l {ok,{AutostartData,_NodeResults2}}=
- inviso_tool:get_autostart_data(Nodes,{dependency,infinity}),
- ?l FNameInit=filename:join(DataDir,"tracecase_init.trc"),
- ?l FName1=filename:join(DataDir,"tracecase1_on.trc"),
- ?l [{file,{FNameInit,[]}},
- {file,{FName1,[{'ProcessName',inviso_tool_test_proc}]}},
- {mfa,{inviso,tpl,[math,module_info,0,[]]}}]=AutostartData,
- ?l stop_inviso_tool_session(CNode,2,Nodes),
- ?l NodeCounters=lists:foldl(fun(N,Acc)->[{_,X}]=rpc:call(N,ets,lookup,[test_proc_tab,counter]),
- [{N,X}|Acc]
- end,
- [],
- Nodes),
- %% Remove the patterns set by the initial tracecase.
- ?l lists:foreach(fun(N)->rpc:call(N,
- erlang,
- trace_pattern,
- [{lists,module_info,1},false,[local]])
- end,
- Nodes),
- %% Now we want to test that we can do restore on the current session.
- ?l {ok,{3,_InvisoReturn2}}=inviso_tool:restore_session(),
- ?l ok=poll(inviso_tool,get_activities,[],{ok,[]},10),
- %% Check that the history has been redone yet again.
- ?l lists:foreach(fun({N,X})->
- [{counter,Y}]=
- rpc:call(N,ets,lookup,[test_proc_tab,counter]),
- Y=X+1
- end,
- NodeCounters),
- ?l lists:foreach(fun(N)->
- {traced,local}=
- rpc:call(N,erlang,trace_info,[{lists,module_info,1},traced])
- end,
- Nodes),
-
- ?l {error,session_active}=inviso_tool:reset_nodes(Nodes),
- %% Now stop the session and check that we can clear the nodes.
- ?l stop_inviso_tool_session(CNode,3,Nodes),
- ?l lists:foreach(fun(N)->{traced,local}=
- rpc:call(N,erlang,trace_info,[{lists,module_info,1},traced])
- end,
- Nodes),
- ?l {ok,NodeResults3}=inviso_tool:reset_nodes(Nodes),
- ?l true=check_noderesults(Nodes,{ok,{new,running}},NodeResults3),
- ?l lists:foreach(fun(N)->{traced,false}=
- rpc:call(N,erlang,trace_info,[{lists,module_info,1},traced])
- end,
- Nodes),
- ?l stop_inviso_tool(CNode,Nodes),
-
- %% Now we want to test that restoring a session at no active nodes will
- %% not result in a crash. (Previous error).
- ?l FaultyNodes=[gurka@nonexistant,tomat@nonexistant],
- ?l Options=[{nodes,FaultyNodes},{c_node,CNode}|Opts],
- ?l {ok,_Pid}=inviso_tool:start(Options),
- ?l ok=poll(erlang,whereis,[inviso_tool],fun(X)->true=is_pid(X) end,10),
- %% Now try to restore a session.
- ?l {ok,{_,{ok,[]}}}=inviso_tool:restore_session(AbsFileName),
- ?l {ok,down}=inviso_tool:get_node_status(gurka@nonexistant),
- %% Now stop the (useless) session.
- ?l {ok,{_,[]}}=inviso_tool:stop_session(),
- ?l stop_inviso_tool(CNode,[]),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% This test tests a few strange situations when activating a session and there
-%% are no nodes that can be initiated or reinitiated.
-dist_start_session_special(doc) -> [""];
-dist_start_session_special(suite) -> [];
-dist_start_session_special(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- [RegExpNode|_]=RemoteNodes,
- CNode=RegExpNode, % We use a remote control component.
-% Nodes=RemoteNodes,
- DataDir=?config(data_dir,Config),
- PrivDir=filename:join(?config(priv_dir,Config),""),
-
- %% Start up the tool but with no exiting nodes.
- FaultyNodes=[gurka@nonexistant,tomat@nonexistant],
- Opts=[{regexp_node,RegExpNode},
- {tdg,{?MODULE,tdg,[PrivDir]}},
- {tc_def_file,?TC_DEF_FILE},
- {initial_tcs,[{tracecase_init,[]}]},
- {dir,DataDir}], % This is where we find tracecases.
- ?l Options=[{nodes,FaultyNodes},{c_node,CNode}|Opts],
- ?l {ok,_Pid}=inviso_tool:start(Options),
- ?l ok=poll(erlang,whereis,[inviso_tool],fun(X)->true=is_pid(X) end,10),
- %% Now try to initate a session.
- ?l {ok,{SessionNr,{ok,[]}}}=inviso_tool:start_session(),
- ?l {ok,down}=inviso_tool:get_node_status(gurka@nonexistant),
- %% Now stop the (useless) session.
- ?l {ok,{SessionNr,[]}}=inviso_tool:stop_session(),
-
- %% Now start again, still no useful nodes.
- ?l {ok,{SessionNr2,{ok,[]}}}=inviso_tool:start_session(),
- ?l {ok,{SessionNr2,[]}}=inviso_tool:stop_session(),
- ?l stop_inviso_tool(CNode,[]), % No nodes are connected.
-
- ok.
-%% -----------------------------------------------------------------------------
-
-
-%% ==============================================================================
-%% Help functions.
-%% ==============================================================================
-
-%% Help function starting the inviso_tool with runtime components at Nodes
-%% and the inviso control component at CNode. OtherOpts shall contain all other
-%% necessary options except nodes and c_node. Returns nothing significant.
-start_inviso_tool(Nodes,CNode,OtherOpts) ->
- ?l Options=[{nodes,Nodes},{c_node,CNode}|OtherOpts],
- ?l {ok,_Pid}=inviso_tool:start(Options),
- ?l ok=poll(erlang,whereis,[inviso_tool],fun(X)->true=is_pid(X) end,10),
- %% Now the runtime components shall be started but no tracing started.
- ?l lists:foreach(fun(N)->ok=poll(rpc,
- call,
- [CNode,inviso,get_status,[[N]]],
- fun({ok,[{_N,{ok,{new,running}}}]})->true;
- (_) ->false
- end,
- 10)
- end,
- Nodes),
- true.
-%% -----------------------------------------------------------------------------
-
-%% Stops the inviso_tool.
-stop_inviso_tool(CNode,Nodes) ->
- ?l {ok,NodeResults}=inviso_tool:stop(),
- ?l true=check_noderesults(Nodes,ok,NodeResults),
- ?l ok=poll(erlang,whereis,[inviso_tool],undefined,10),
- %% Check that all inviso components are gone.
- ?l ok=poll(rpc,call,[CNode,erlang,whereis,[inviso_c]],undefined,10),
- ?l lists:foreach(fun(N)->ok=poll(rpc,
- call,
- [N,erlang,whereis,[inviso_rt]],
- undefined,
- 10)
- end,
- Nodes),
- true.
-%% -----------------------------------------------------------------------------
-
-%% Starts a trace session. Returns the InvisoReturn part of the return value.
-start_inviso_tool_session(CNode,MoreTDGargs,SessionNr,Nodes) ->
- ?l {ok,{SessionNr,InvisoReturn}}=inviso_tool:start_session(MoreTDGargs),
- %% Now check that all nodes are tracing.
- ?l lists:foreach(fun(N)->ok=poll(rpc,
- call,
- [CNode,inviso,get_status,[[N]]],
- fun({ok,[{_N,{ok,{tracing,running}}}]})->true;
- (_) ->false
- end,
- 10),
- %% Check that the initial trace case is executed.
- ?l ok=poll(rpc,
- call,
- [N,erlang,trace_info,[{lists,module_info,1},traced]],
- {traced,local},
- 10)
- end,
- Nodes),
- InvisoReturn.
-%% -----------------------------------------------------------------------------
-
-%% Stops a trace session.
-stop_inviso_tool_session(CNode,SessionNr,Nodes) ->
- ?l {ok,{SessionNr,NodeResults}}=inviso_tool:stop_session(),
- ?l true=check_noderesults(Nodes,ok,NodeResults),
- %% Now the runtimes shall not be tracing any longer.
- ?l lists:foreach(fun(N)->ok=poll(rpc,
- call,
- [CNode,inviso,get_status,[[N]]],
- fun({ok,[{_N,{ok,{idle,running}}}]})->true;
- (_) ->false
- end,
- 10)
- end,
- Nodes),
- true.
-%% -----------------------------------------------------------------------------
-
-%% Help function checking that there is a Result for each node in Nodes.
-%% Returns 'true' if successful.
-check_noderesults(Nodes,Fun,[{Node,Result}|Rest]) when is_function(Fun) ->
- case Fun({Node,Result}) of
- true ->
- case lists:member(Node,Nodes) of
- true ->
- check_noderesults(lists:delete(Node,Nodes),Fun,Rest);
- false -> % Not good.
- unknown_node_in_returnvalue
- end;
- _ ->
- illegal_result
- end;
-check_noderesults(Nodes,Result,[{Node,Result}|Rest]) ->
- case lists:member(Node,Nodes) of
- true ->
- check_noderesults(lists:delete(Node,Nodes),Result,Rest);
- false -> % Not good.
- unknown_node_in_returnvalue
- end;
-check_noderesults([],_,[]) ->
- true;
-check_noderesults(X,Y,Z) ->
- io:format("Bad arguments to check noderesults:~w~n~w~n~w~n",[X,Y,Z]),
- false.
-%% ------------------------------------------------------------------------------
-
-%% Help function which waits for a function call to become Result. This is useful
-%% if what we are waiting for can happend independantly of indications we have
-%% access to.
-poll(_,_,_,_,0) ->
- error;
-poll(M,F,Args,Result,Times) ->
- try apply(M,F,Args) of
- What when is_function(Result) ->
- case Result(What) of
- true ->
- ok;
- X ->
- io:format("Poll: ~w:~w ~w ~w ~w~n",[M,F,Args,Result,X]),
- timer:sleep(100),
- poll(M,F,Args,Result,Times-1)
- end;
- Result ->
- ok;
- X ->
- io:format("Poll: ~w:~w ~w ~w ~w~n",[M,F,Args,Result,X]),
- timer:sleep(100),
- poll(M,F,Args,Result,Times-1)
- catch
- error:Reason ->
- io:format("Apply in suite-function poll/5 failed, ~w~n",[Reason]),
- timer:sleep(100),
- poll(M,F,Args,Result,Times-1)
- end.
-%% ------------------------------------------------------------------------------
-
-%% ------------------------------------------------------------------------------
-%% The Tracer Data Generator function.
-%% ------------------------------------------------------------------------------
-
--define(I2L(Arg),integer_to_list(Arg)).
-
-tdg(Node,{{Y,Mo,D},{H,Mi,S}},PrivDir) ->
- NameStr=atom_to_list(Node)++"_"++?I2L(Y)++"-"++?I2L(Mo)++"-"++?I2L(D)++"_"++
- ?I2L(H)++"-"++?I2L(Mi)++"-"++?I2L(S),
- LogTD={file,filename:join(PrivDir,NameStr++".log")},
- TiTD={file,filename:join(PrivDir,NameStr++".ti")},
- [{trace,LogTD},{ti,TiTD}].
-%% ------------------------------------------------------------------------------
-
-
-%% ------------------------------------------------------------------------------
-%% Handling the test server Config.
-%% ------------------------------------------------------------------------------
-
-insert_remotenode_config(Name,Node,Config) ->
- [{remotenode,{Name,Node}}|Config].
-%% ------------------------------------------------------------------------------
-
-insert_timetraphandle_config(Handle,Config) ->
- [{timetraphandle,Handle}|Config].
-%% ------------------------------------------------------------------------------
-
-get_remotenode_config(Name, [{remotenode, {Name, Node}}| _Cs]) ->
- Node;
-get_remotenode_config(Name, [_C | Cs]) ->
- get_remotenode_config(Name, Cs);
-get_remotenode_config(Name, []) ->
- exit({no_remotenode, Name}).
-
-%% ------------------------------------------------------------------------------
-
-get_timetraphandle_config(Config) ->
- {value,{_,Handle}}=lists:keysearch(timetraphandle,1,Config),
- Handle.
-%% ------------------------------------------------------------------------------
-
-get_remotenodes_config([{remotenode,{_Name,Node}}|Config]) ->
- [Node|get_remotenodes_config(Config)];
-get_remotenodes_config([_|Config]) ->
- get_remotenodes_config(Config);
-get_remotenodes_config([]) ->
- [].
-%% ------------------------------------------------------------------------------
-
-remove_remotenode_config(Name, [{remotenode, {Name, _}} | Cs]) ->
- Cs;
-remove_remotenode_config(Name, [C | Cs]) ->
- [C | remove_remotenode_config(Name, Cs)];
-remove_remotenode_config(_Name, []) ->
- [].
-%% ------------------------------------------------------------------------------
-
-remove_timetraphandle_config(Config) ->
- lists:keydelete(timetraphandle,1,Config).
-%% ------------------------------------------------------------------------------
-
-
-%% ==============================================================================
-%% Code for a test process which can be started.
-%% ==============================================================================
-
-%% The test proc is also responsible for owning a side effect table. The table
-%% can be updated by tracecases.
-test_proc_init() ->
- register(inviso_tool_test_proc,self()),
- ets:new(test_proc_tab,[named_table,public]),
- ets:insert(test_proc_tab,{counter,0}),
- test_proc_loop().
-
-test_proc_loop() ->
- receive
- {apply,M,F,Args} ->
- apply(M,F,Args),
- test_proc_loop();
- X ->
- io:format("Got ~w~n",[X]),
- test_proc_loop()
- end.
-%% ------------------------------------------------------------------------------
diff --git a/lib/inviso/test/inviso_tool_SUITE_data/tracecase1_off.trc b/lib/inviso/test/inviso_tool_SUITE_data/tracecase1_off.trc
deleted file mode 100644
index 426c1ed9f9..0000000000
--- a/lib/inviso/test/inviso_tool_SUITE_data/tracecase1_off.trc
+++ /dev/null
@@ -1,12 +0,0 @@
-%% TRACECASE1_OFF.TRC
-%% -----------------------------------------------------------------------------
-%% This is a test trace case to be used by the inviso_tool_SUITE.
-%% Trace case deactivating the trace started by the activation case tracecase1_on.
-%%
-%% ProcessName=atom(), variable set in the test environment.
-%% Nodes=list(), inviso_tool variable - all traced nodes.
-%% -----------------------------------------------------------------------------
-
-inviso:ctf(Nodes,ProcessName,[call]).
-inviso:ctpl(Nodes,math,module_info,1).
-%% END-OF-TRACE-CASE
diff --git a/lib/inviso/test/inviso_tool_SUITE_data/tracecase1_on.trc b/lib/inviso/test/inviso_tool_SUITE_data/tracecase1_on.trc
deleted file mode 100644
index a9106dbc78..0000000000
--- a/lib/inviso/test/inviso_tool_SUITE_data/tracecase1_on.trc
+++ /dev/null
@@ -1,17 +0,0 @@
-%% TRACECASE1_ON.TRC
-%% -----------------------------------------------------------------------------
-%% This is a test trace case to be used by the inviso_tool_SUITE.
-%% Trace case setting a local pattern on math:module_info/1 and process flags
-%% on a test process which is supposed to be started by the test environment.
-%%
-%% ProcessName=atom(), variable set in the test environment.
-%% Nodes=list(), inviso_tool variable - all traced nodes.
-%% -----------------------------------------------------------------------------
-
-inviso:tpl(Nodes,math,module_info,1,[]).
-inviso:tf(Nodes,ProcessName,[call]).
-lists:foreach(fun(N)->rpc:call(N,ets,update_counter,[test_proc_tab,counter,1]) end,
- Nodes).
-timer:sleep(500).
-%% END-OF-TRACE-CASE
-
diff --git a/lib/inviso/test/inviso_tool_SUITE_data/tracecase2_off.trc b/lib/inviso/test/inviso_tool_SUITE_data/tracecase2_off.trc
deleted file mode 100644
index cc89c3aa03..0000000000
--- a/lib/inviso/test/inviso_tool_SUITE_data/tracecase2_off.trc
+++ /dev/null
@@ -1,12 +0,0 @@
-%% TRACECASE2_OFF.TRC
-%% -----------------------------------------------------------------------------
-%% This is a test trace case to be used by the inviso_tool_SUITE.
-%% The tracecase is mainly used for testing that synchronous tracecases return
-%% values.
-%%
-%% Nodes=list(), inviso_tool variable - all traced nodes.
-%% -----------------------------------------------------------------------------
-
-inviso:ctpl(Nodes,math,pi,0).
-another_return_value.
-%% END-OF-TRACE-CASE
diff --git a/lib/inviso/test/inviso_tool_SUITE_data/tracecase2_on.trc b/lib/inviso/test/inviso_tool_SUITE_data/tracecase2_on.trc
deleted file mode 100644
index a3ab5fcfc7..0000000000
--- a/lib/inviso/test/inviso_tool_SUITE_data/tracecase2_on.trc
+++ /dev/null
@@ -1,16 +0,0 @@
-%% TRACECASE2_ON.TRC
-%% -----------------------------------------------------------------------------
-%% This is a test trace case to be used by the inviso_tool_SUITE.
-%% The tracecase is mainly used for testing that synchronous tracecases return
-%% values.
-%% We also use this tracecase to check that reactivation works when it comes to
-%% handling simulataneously issued tool commands (issued during reactivation).
-%%
-%% Nodes=list(), inviso_tool variable - all traced nodes.
-%% -----------------------------------------------------------------------------
-
-inviso:tpl(Nodes,math,pi,0,[]).
-timer:sleep(3000).
-a_return_value.
-%% END-OF-TRACE-CASE
-
diff --git a/lib/inviso/test/inviso_tool_SUITE_data/tracecase3_on.trc b/lib/inviso/test/inviso_tool_SUITE_data/tracecase3_on.trc
deleted file mode 100644
index e6c5ff78b1..0000000000
--- a/lib/inviso/test/inviso_tool_SUITE_data/tracecase3_on.trc
+++ /dev/null
@@ -1,9 +0,0 @@
-%% TRACECASE3_ON.TRC
-%% -----------------------------------------------------------------------------
-%% This is a test trace case to be used by the inviso_tool_SUITE.
-%% It is faulty and meant to cause a crash!
-%% -----------------------------------------------------------------------------
-
-1=2.
-%% END-OF-TRACE-CASE
-
diff --git a/lib/inviso/test/inviso_tool_SUITE_data/tracecase4_on.trc b/lib/inviso/test/inviso_tool_SUITE_data/tracecase4_on.trc
deleted file mode 100644
index d14c11f78c..0000000000
--- a/lib/inviso/test/inviso_tool_SUITE_data/tracecase4_on.trc
+++ /dev/null
@@ -1,9 +0,0 @@
-%% TRACECASE4_ON.TRC
-%% -----------------------------------------------------------------------------
-%% This is a test trace case to be used by the inviso_tool_SUITE.
-%% It contains an infinity timer in order for the tracecase executer to hang.
-%% -----------------------------------------------------------------------------
-
-timer:sleep(infinity).
-%% END-OF-TRACE-CASE
-
diff --git a/lib/inviso/test/inviso_tool_SUITE_data/tracecase5_off.trc b/lib/inviso/test/inviso_tool_SUITE_data/tracecase5_off.trc
deleted file mode 100644
index feb67acb11..0000000000
--- a/lib/inviso/test/inviso_tool_SUITE_data/tracecase5_off.trc
+++ /dev/null
@@ -1,11 +0,0 @@
-%% TRACECASE5_OFF.TRC
-%% -----------------------------------------------------------------------------
-%% This is a test trace case to be used by the inviso_tool_SUITE.
-%% Contains a 2 second sleep.
-%% -----------------------------------------------------------------------------
-
-lists:foreach(fun(N)->rpc:call(N,ets,update_counter,[test_proc_tab,counter,1]) end,
- Nodes).
-timer:sleep(2000).
-%% END-OF-TRACE-CASE
-
diff --git a/lib/inviso/test/inviso_tool_SUITE_data/tracecase5_on.trc b/lib/inviso/test/inviso_tool_SUITE_data/tracecase5_on.trc
deleted file mode 100644
index 724c617c5a..0000000000
--- a/lib/inviso/test/inviso_tool_SUITE_data/tracecase5_on.trc
+++ /dev/null
@@ -1,11 +0,0 @@
-%% TRACECASE5_ON.TRC
-%% -----------------------------------------------------------------------------
-%% This is a test trace case to be used by the inviso_tool_SUITE.
-%% This tracecase updates an ETS table. Can be used to verify that it has been
-%% done (or not done!).
-%% -----------------------------------------------------------------------------
-
-lists:foreach(fun(N)->rpc:call(N,ets,update_counter,[test_proc_tab,counter,1]) end,
- Nodes).
-%% END-OF-TRACE-CASE
-
diff --git a/lib/inviso/test/inviso_tool_SUITE_data/tracecase_def.txt b/lib/inviso/test/inviso_tool_SUITE_data/tracecase_def.txt
deleted file mode 100644
index 5b08fa32a5..0000000000
--- a/lib/inviso/test/inviso_tool_SUITE_data/tracecase_def.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-{tracecase_init,on,[],"./tracecase_init.trc"}.
-{tracecase1,on_off,['ProcessName'],"./tracecase1_on.trc","./tracecase1_off.trc"}.
-{tracecase2,on_off,[],"./tracecase2_on.trc","./tracecase2_off.trc"}.
-{tracecase3,on,[],"./tracecase3_on.trc"}.
-{tracecase4,on,[],"./tracecase4_on.trc"}.
-{tracecase5,on_off,[],"./tracecase5_on.trc","./tracecase5_off.trc"}.
-
-
diff --git a/lib/inviso/test/inviso_tool_SUITE_data/tracecase_init.trc b/lib/inviso/test/inviso_tool_SUITE_data/tracecase_init.trc
deleted file mode 100644
index 49a79cd3a5..0000000000
--- a/lib/inviso/test/inviso_tool_SUITE_data/tracecase_init.trc
+++ /dev/null
@@ -1,10 +0,0 @@
-%% TRACECASE_INIT.TRC
-%% -----------------------------------------------------------------------------
-%% This is a test trace case to be used by the inviso_tool_SUITE.
-%% Initial trace case executed at session start.
-%%
-%% Nodes=list(), inviso_tool variable - all traced nodes.
-%% -----------------------------------------------------------------------------
-
-inviso:tpl(Nodes,lists,module_info,1,[]).
-%% END-OF-TRACE-CASE
diff --git a/lib/inviso/vsn.mk b/lib/inviso/vsn.mk
deleted file mode 100644
index c6b0398bde..0000000000
--- a/lib/inviso/vsn.mk
+++ /dev/null
@@ -1 +0,0 @@
-INVISO_VSN = 0.6.3
diff --git a/lib/jinterface/doc/src/Makefile b/lib/jinterface/doc/src/Makefile
index acd5307dee..4d5713566c 100644
--- a/lib/jinterface/doc/src/Makefile
+++ b/lib/jinterface/doc/src/Makefile
@@ -3,7 +3,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2010. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -160,17 +160,17 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html/java/$(JAVA_PKG_PATH)
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- (/bin/cp -rf ../html $(RELSYSDIR)/doc)
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html/java/$(JAVA_PKG_PATH)"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ (/bin/cp -rf ../html "$(RELSYSDIR)/doc")
# $(INSTALL_DATA) $(GIF_FILES) $(EXTRA_FILES) $(HTML_FILES) \
-# $(RELSYSDIR)/doc/html
-# $(INSTALL_DATA) $(JAVA_EXTRA_FILES) $(RELSYSDIR)/doc/html/java
-# $(INSTALL_DATA) $(TOP_HTML_FILES) $(RELSYSDIR)/doc
+# "$(RELSYSDIR)/doc/html"
+# $(INSTALL_DATA) $(JAVA_EXTRA_FILES) "$(RELSYSDIR)/doc/html/java"
+# $(INSTALL_DATA) $(TOP_HTML_FILES) "$(RELSYSDIR)/doc"
release_spec:
diff --git a/lib/jinterface/doc/src/notes.xml b/lib/jinterface/doc/src/notes.xml
index bf94077114..19f25e3681 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>2011</year>
+ <year>2000</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,6 +30,39 @@
</header>
<p>This document describes the changes made to the Jinterface application.</p>
+<section><title>Jinterface 1.5.6</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Correct spelling of registered (Thanks to Richard
+ Carlsson)</p>
+ <p>
+ Own Id: OTP-9925</p>
+ </item>
+ <item>
+ <p>
+ Java 1.5 has a bug where detecting codepoint offsets in
+ strings that are created by String.substring() gives
+ wrong results. The new implementation uses a different
+ method, avoinding the issue. (Thanks to Vlad Dumitrescu)</p>
+ <p>
+ Own Id: OTP-9927</p>
+ </item>
+ <item>
+ <p>
+ Improve error message when creating a too long
+ OtpErlangAtom. Also print the value that we tried to use
+ for the atom. (Thanks to Vlad Dumitrescu)</p>
+ <p>
+ Own Id: OTP-9928</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Jinterface 1.5.5</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/Makefile b/lib/jinterface/java_src/com/ericsson/otp/erlang/Makefile
index 365798e68a..8ae63a1561 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-2011. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -66,7 +66,7 @@ JARFLAGS=-cvf
JAVA_OPTIONS =
ifeq ($(TESTROOT),)
-RELEASE_PATH=$(ERL_TOP)/release/$(TARGET)
+RELEASE_PATH="$(ERL_TOP)/release/$(TARGET)"
else
RELEASE_PATH=$(TESTROOT)
endif
@@ -96,13 +96,13 @@ docs:
# include $(ERL_TOP)/make/otp_release_targets.mk
release release_docs release_tests release_html:
- $(MAKE) $(MFLAGS) RELEASE_PATH=$(RELEASE_PATH) $(TARGET_MAKEFILE) $@_spec
+ $(MAKE) $(MFLAGS) RELEASE_PATH="$(RELEASE_PATH)" $(TARGET_MAKEFILE) $@_spec
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/java_src/com/ericsson/otp/erlang
- $(INSTALL_DATA) $(JAVA_SRC) $(RELSYSDIR)/java_src/com/ericsson/otp/erlang
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DATA) $(JAVA_DEST_ROOT)$(JARFILE) $(RELSYSDIR)/priv
+ $(INSTALL_DIR) "$(RELSYSDIR)/java_src/com/ericsson/otp/erlang"
+ $(INSTALL_DATA) $(JAVA_SRC) "$(RELSYSDIR)/java_src/com/ericsson/otp/erlang"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) $(JAVA_DEST_ROOT)$(JARFILE) "$(RELSYSDIR)/priv"
release_docs_spec:
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 4d53447164..ced4dbb8c2 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-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2012. 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
@@ -53,7 +53,7 @@ public class OtpErlangAtom extends OtpErlangObject implements Serializable,
if (atom.length() > maxAtomLength) {
throw new java.lang.IllegalArgumentException("Atom may not exceed "
- + maxAtomLength + " characters");
+ + maxAtomLength + " characters: " + atom);
}
this.atom = atom;
}
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 8cd900aada..6766b52ce5 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2012. 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
@@ -154,13 +154,16 @@ public class OtpErlangString extends OtpErlangObject implements Serializable,
* Unicode code points
*/
- public static int[] stringToCodePoints(final String s) {
- final int m = s.codePointCount(0, s.length());
- final int [] codePoints = new int[m];
- for (int i = 0, j = 0; j < m; i = s.offsetByCodePoints(i, 1), j++) {
- codePoints[j] = s.codePointAt(i);
- }
- return codePoints;
+ public static int[] stringToCodePoints(final String s) {
+ final int m = s.codePointCount(0, s.length());
+ final int[] codePoints = new int[m];
+ int j = 0;
+ for (int offset = 0; offset < s.length();) {
+ final int codepoint = s.codePointAt(offset);
+ codePoints[j++] = codepoint;
+ offset += Character.charCount(codepoint);
+ }
+ return codePoints;
}
/**
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 d6f319d378..0fd93b09f4 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2012. 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
@@ -141,7 +141,7 @@ public class OtpMbox {
* Get the registered name of this mailbox.
*
* @return the registered name of this mailbox, or null if the mailbox had
- * no registerd name.
+ * no registered name.
*/
public String getName() {
return name;
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 be7c8e5b1a..7ead0b9c54 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-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2000-2012. 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/lib/jinterface/test/Makefile b/lib/jinterface/test/Makefile
index a85d0e7411..d9ff406994 100644
--- a/lib/jinterface/test/Makefile
+++ b/lib/jinterface/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -80,6 +80,6 @@ release_spec:
release_docs_spec:
release_tests_spec: tests
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(TEST_SPEC_FILE) $(COVER_FILE) $(ERL_FILES) $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(TEST_SPEC_FILE) $(COVER_FILE) $(ERL_FILES) "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
diff --git a/lib/jinterface/test/jitu.erl b/lib/jinterface/test/jitu.erl
index c57fb9bfad..fb262cf9d7 100644
--- a/lib/jinterface/test/jitu.erl
+++ b/lib/jinterface/test/jitu.erl
@@ -89,13 +89,19 @@ classpath(Dir) ->
{win32, _} -> ";";
_ -> ":"
end,
- Dir++PS++
+ es(Dir++PS++
filename:join([code:lib_dir(jinterface),"priv","OtpErlang.jar"])++PS++
case os:getenv("CLASSPATH") of
false -> "";
Classpath -> Classpath
- end.
-
+ end).
+
+es(L) ->
+ lists:flatmap(fun($ ) ->
+ "\\ ";
+ (C) ->
+ [C]
+ end,lists:flatten(L)).
cmd(Cmd) ->
PortOpts = [{line,80},eof,exit_status,stderr_to_stdout],
diff --git a/lib/jinterface/test/nc_SUITE.erl b/lib/jinterface/test/nc_SUITE.erl
index da54f5bf51..9c88400c2a 100644
--- a/lib/jinterface/test/nc_SUITE.erl
+++ b/lib/jinterface/test/nc_SUITE.erl
@@ -296,7 +296,8 @@ lists_roundtrip_2(Config) when is_list(Config) ->
{[z,23|24],tail3},
{[z|25],tail3},
{"abc123",sub3atom},
- {"abc",sub3atom}
+ {"abc",sub3atom},
+ {"abcdefg",codepointBug}
],
Trans =
fun ([_|T], tail) ->
@@ -308,7 +309,9 @@ lists_roundtrip_2(Config) when is_list(Config) ->
(L, tail3) when is_list(L) ->
null;
([_,_,_|L], sub3atom) ->
- list_to_atom(L)
+ list_to_atom(L);
+ (L, codepointBug) ->
+ L
end,
OutTrans =
fun ({L,Twist}) ->
diff --git a/lib/jinterface/test/nc_SUITE_data/echo_server.java b/lib/jinterface/test/nc_SUITE_data/echo_server.java
index 0550e4beb1..2e18e908d4 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-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2004-2012. 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
@@ -202,6 +202,12 @@ public class echo_server {
final OtpErlangAtom o = new OtpErlangAtom(s.stringValue()
.substring(3));
return o;
+ } else if (atomValue.equals("codepointBug")
+ && i instanceof OtpErlangString) {
+ final OtpErlangString s = (OtpErlangString) i;
+ final String ss = s.stringValue().substring(3, 6);
+ final int[] cps = OtpErlangString.stringToCodePoints(ss);
+ return s;
} else if (atomValue.equals("utf8")) {
if (i instanceof OtpErlangString) {
final OtpErlangString s = (OtpErlangString) i;
diff --git a/lib/jinterface/vsn.mk b/lib/jinterface/vsn.mk
index 9d8229e9fa..15423e5658 100644
--- a/lib/jinterface/vsn.mk
+++ b/lib/jinterface/vsn.mk
@@ -1 +1 @@
-JINTERFACE_VSN = 1.5.5
+JINTERFACE_VSN = 1.5.6
diff --git a/lib/kernel/doc/src/Makefile b/lib/kernel/doc/src/Makefile
index 214e994889..5e04bff0c1 100644
--- a/lib/kernel/doc/src/Makefile
+++ b/lib/kernel/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -155,18 +155,18 @@ $(SPECDIR)/specs_zlib_stub.xml:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man4
- $(INSTALL_DATA) $(MAN4_FILES) $(RELEASE_PATH)/man/man4
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man6
- $(INSTALL_DATA) $(MAN6_FILES) $(RELEASE_PATH)/man/man6
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man4"
+ $(INSTALL_DATA) $(MAN4_FILES) "$(RELEASE_PATH)/man/man4"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man6"
+ $(INSTALL_DATA) $(MAN6_FILES) "$(RELEASE_PATH)/man/man6"
release_spec:
diff --git a/lib/kernel/doc/src/app.xml b/lib/kernel/doc/src/app.xml
index ff8a12fe97..1914844b37 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>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -75,7 +75,7 @@ MaxT int() infinity
Names [Name] []
Apps [App] []
Env [{Par,Val}] []
-Start {Module,StartArgs} undefined
+Start {Module,StartArgs} []
Phases [{Phase,PhaseArgs}] undefined
Module = Name = App = Par = Phase = atom()
Val = StartArgs = PhaseArgs = term()</code>
diff --git a/lib/kernel/doc/src/code.xml b/lib/kernel/doc/src/code.xml
index ee687511a3..279c7558bc 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>2011</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -91,7 +91,7 @@
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) shold contain
+ <p>The environment variable <c>ERL_LIBS</c> (if defined) should 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
@@ -728,16 +728,13 @@ rpc:call(Node, code, load_binary, [Module, Filename, Binary]),
</desc>
</func>
<func>
- <name>is_module_native(Module) -> boolean() | undefined</name>
+ <name name="is_module_native" arity="1"/>
<fsummary>Test whether a module has native code</fsummary>
- <type>
- <v>Module = module()</v>
- </type>
<desc>
- <p>This function returns <c>true</c> if <c>Module</c> is
+ <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>Module</c> is loaded but does not have
- native. If <c>Module</c> is not loaded, this function returns
+ <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>
</desc>
</func>
diff --git a/lib/kernel/doc/src/erl_ddll.xml b/lib/kernel/doc/src/erl_ddll.xml
index 1911fb628e..26db11cfcd 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>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -182,11 +182,8 @@
</datatypes>
<funcs>
<func>
- <name>demonitor(MonitorRef) -> ok</name>
+ <name name="demonitor" arity="1"/>
<fsummary>Remove a monitor for a driver</fsummary>
- <type>
- <v>MonitorRef = reference()</v>
- </type>
<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
@@ -232,24 +229,19 @@
</desc>
</func>
<func>
- <name>info(Name, Tag) -> Value</name>
+ <name name="info" arity="2"/>
<fsummary>Retrieve specific information about one driver</fsummary>
- <type>
- <v>Name = string() | atom()</v>
- <v>Tag = processes | driver_options | port_count | linked_in_driver | permanent | awaiting_load | awaiting_unload</v>
- <v>Value = term()</v>
- </type>
<desc>
<p>This function returns specific information about one aspect
- of a driver. The <c>Tag</c> parameter specifies which aspect
- to get information about. The <c>Value</c> return differs
+ 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
between different tags:</p>
<taglist>
<tag><em>processes</em></tag>
<item>
<p>Return all processes containing <seealso marker="#users">users</seealso> of the specific drivers
- as a list of tuples <c>{pid(),int()}</c>, where the
- <c>int()</c> denotes the number of users in the process
+ as a list of tuples <c>{pid(),integer() >= 0}</c>, where the
+ <c>integer()</c> denotes the number of users in the process
<c>pid()</c>.</p>
</item>
<tag><em>driver_options</em></tag>
@@ -261,16 +253,16 @@
</item>
<tag><em>port_count</em></tag>
<item>
- <p>Return the number of ports (an <c>int()</c>) using the driver.</p>
+ <p>Return the number of ports (an <c>integer >= 0()</c>) using the driver.</p>
</item>
<tag><em>linked_in_driver</em></tag>
<item>
- <p>Return a <c>bool()</c>, being <c>true</c> if the driver is a
+ <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>
</item>
<tag><em>permanent</em></tag>
<item>
- <p>Return a <c>bool()</c>, being <c>true</c> if the driver has made
+ <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>
</item>
@@ -278,14 +270,14 @@
<item>
<p>Return a list of all processes having monitors for
<c>loading</c> active, each process returned as
- <c>{pid(),int()}</c>, where the <c>int()</c> is the
+ <c>{pid(),integer() >= 0}</c>, where the <c>integer()</c> is the
number of monitors held by the process <c>pid()</c>.</p>
</item>
<tag><em>awaiting_unload</em></tag>
<item>
<p>Return a list of all processes having monitors for
<c>unloading</c> active, each process returned as
- <c>{pid(),int()}</c>, where the <c>int()</c> is the
+ <c>{pid(),integer() >= 0}</c>, where the <c>integer()</c> is the
number of monitors held by the process <c>pid()</c>.</p>
</item>
</taglist>
@@ -377,41 +369,34 @@
</desc>
</func>
<func>
- <name>monitor(Tag, Item) -> MonitorRef</name>
+ <name name="monitor" arity="2"/>
<fsummary>Create a monitor for a driver</fsummary>
- <type>
- <v>Tag = driver </v>
- <v>Item = {Name, When}</v>
- <v>Name = atom() | string()</v>
- <v>When = loaded | unloaded | unloaded_only</v>
- <v>MonitorRef = reference()</v>
- </type>
<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>,
does for processes. When a driver changes state, the monitor
results in a monitor-message being sent to the calling
- process. The <c>MonitorRef</c> returned by this function is
+ process. The <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>MonitorRef</c> can also be used in subsequent calls
+ <p>The <c><anno>MonitorRef</anno></c> can also be used in subsequent calls
to <seealso marker="#demonitor/1">demonitor/1</seealso> to
remove a monitor.</p>
<p>The function accepts the following parameters:</p>
<taglist>
- <tag><em>Tag</em></tag>
+ <tag><em><anno>Tag</anno></em></tag>
<item>
<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>
</item>
- <tag><em>Item</em></tag>
+ <tag><em><anno>Item</anno></em></tag>
<item>
- <p>The <c>Item</c> parameter specifies which driver one
+ <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
is a tuple of arity two whose first element is the
@@ -588,22 +573,8 @@
</desc>
</func>
<func>
- <name>try_load(Path, Name, OptionList) -> {ok,Status} | {ok, PendingStatus, Ref} | {error, ErrorDesc}</name>
+ <name name="try_load" arity="3"/>
<fsummary>Load a driver</fsummary>
- <type>
- <v>Path = Name = string() | atom()</v>
- <v>OptionList = [ Option ]</v>
- <v>Option = {driver_options, DriverOptionList} | {monitor, MonitorOption} | {reload, ReloadOption}</v>
- <v>DriverOptionList = [ DriverOption ]</v>
- <v>DriverOption = kill_ports</v>
- <v>MonitorOption = pending_driver | pending</v>
- <v>ReloadOption = pending_driver | pending</v>
- <v>Status = loaded | already_loaded | PendingStatus </v>
- <v>PendingStatus = pending_driver | pending_process</v>
- <v>Ref = reference()</v>
- <v>ErrorDesc = ErrorAtom | OpaqueError</v>
- <v>ErrorAtom = linked_in_driver | inconsistent | permanent | not_loaded_by_this_process | not_loaded | pending_reload | pending_process</v>
- </type>
<desc>
<p>This function provides more control than the
<c>load/2</c>/<c>reload/2</c> and
@@ -655,65 +626,65 @@
<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, PendingOption}</c> option.</p>
+ 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, PendingStatus, reference()}</c> and the process will, at a later
+ 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>
<note>
<p>Note that in case of loading, monitoring can
- <em>not</em> only get triggered by using the <c>{reload, ReloadOption}</c> option, but also in special cases where
+ <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>
</note>
<p>The function accepts the following parameters:</p>
<taglist>
- <tag><em>Path</em></tag>
+ <tag><em><anno>Path</anno></em></tag>
<item>
<p>The filesystem path to the directory where the driver
object file is situated. 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>Path</c> might be provided as an <em>io_list</em>,
- meaning it can be a list of other io_lists, characters
+ <c><anno>Path</anno></c> might 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
into a sequence of characters.</p>
- <p>The (possibly flattened) <c>Path</c> parameter must be
+ <p>The (possibly flattened) <c><anno>Path</anno></c> parameter must be
consistent throughout the system, a driver should, by
all <seealso marker="#users">users</seealso>, be loaded
- using the same <em>literal</em><c>Path</c>. The
+ 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>Path</c> may be specified
+ 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>Path</c> if the <c>Path</c> is changed using a
+ 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
to have <em>only one loader</em> of a driver one wants to
upgrade in a running system! </p>
</item>
- <tag><em>Name</em></tag>
+ <tag><em><anno>Name</anno></em></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>io_list()</c> or
+ 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>Path</c> and the system implied
+ 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>Name</c> parameter, much as a beam-file's
+ with this <c><anno>Name</anno></c> parameter, much as a beam-file's
module name much correspond to its filename.</p>
</item>
- <tag><em>OptionList</em></tag>
+ <tag><em><anno>OptionList</anno></em></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
meanings:</p>
<taglist>
- <tag><em>{driver_options, DriverOptionsList}</em></tag>
+ <tag><em>{driver_options, <anno>DriverOptionList</anno>}</em></tag>
<item>
<p>This option is to provide options that will change
its general behavior and will "stick" to the driver
@@ -729,14 +700,14 @@
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>
</item>
- <tag><em>{monitor, MonitorOption}</em></tag>
+ <tag><em>{monitor, <anno>MonitorOption</anno>}</em></tag>
<item>
- <p>A <c>MonitorOption</c> tells <c>try_load/3</c> to
+ <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, PendingStatus, reference()}</c>, where the <c>reference()</c> is
+ 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>MonitorOption</c> can be specified and
+ <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
@@ -747,7 +718,7 @@
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>MonitorOption</c> as the <c>ReloadOption</c>
+ 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
@@ -760,12 +731,12 @@
<c>{monitor, pending_driver}</c> in production
code (see the monitor discussion above). </p>
</item>
- <tag><em>{reload,RealoadOption}</em></tag>
+ <tag><em>{reload,<anno>ReloadOption</anno>}</em></tag>
<item>
<p>This option is used when one wants 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>Path</c> parameter need
+ also implies that the <c><anno>Path</anno></c> parameter need
<em>not</em> be consistent with earlier loads of
the driver.</p>
<p>To reload a driver, the process needs to have previously
@@ -814,9 +785,9 @@
<tag><em>{error,inconsistent}</em></tag>
<item>
<p>The driver has already been loaded with either other
- <c>DriverOptions</c> or a different <em>literal</em><c>Path</c> argument.</p>
+ <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>DriverOptions</c> differ from the current.</p>
+ if the <c>DriverOptionList</c> differ from the current.</p>
</item>
<tag><em>{error, permanent}</em></tag>
<item>
@@ -830,19 +801,19 @@
</item>
<tag><em>{error, pending_reload}</em></tag>
<item>
- <p>Driver reload is already requested by another <seealso marker="#users">user</seealso> when the <c>{reload, ReloadOption}</c> option was given.</p>
+ <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>
</item>
<tag><em>{error, not_loaded_by_this_process}</em></tag>
<item>
<p>Appears when the <c>reload</c> option is given. The
- driver <c>Name</c> is present in the system, but there is no
+ 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>
<item>
<p>Appears when the <c>reload</c> option is given. The
- driver <c>Name</c> is not in the system. Only drivers
+ driver <c><anno>Name</anno></c> is not in the system. Only drivers
loaded by this process can be reloaded.</p>
</item>
</taglist>
@@ -856,18 +827,8 @@
</desc>
</func>
<func>
- <name>try_unload(Name, OptionList) -> {ok,Status} | {ok, PendingStatus, Ref} | {error, ErrorAtom}</name>
+ <name name="try_unload" arity="2"/>
<fsummary>Unload a driver</fsummary>
- <type>
- <v>Name = string() | atom()</v>
- <v>OptionList = [ Option ]</v>
- <v>Option = {monitor, MonitorOption} | kill_ports</v>
- <v>MonitorOption = pending_driver | pending</v>
- <v>Status = unloaded | PendingStatus </v>
- <v>PendingStatus = pending_driver | pending_process</v>
- <v>Ref = reference()</v>
- <v>ErrorAtom = linked_in_driver | not_loaded | not_loaded_by_this_process | permanent</v>
- </type>
<desc>
<p>This is the low level function to unload (or decrement
reference counts of) a driver. It can be used to force port
@@ -948,15 +909,15 @@
</taglist>
<p>The function accepts the following parameters:</p>
<taglist>
- <tag><em>Name</em></tag>
+ <tag><em><anno>Name</anno></em></tag>
<item>
<p>The name parameter is the name of the driver to be
unloaded. The name can be specified either as an
- <c>io_list()</c> or as an <c>atom()</c>. </p>
+ <c>iolist()</c> or as an <c>atom()</c>. </p>
</item>
- <tag><em>OptionList</em></tag>
+ <tag><em><anno>OptionList</anno></em></tag>
<item>
- <p>The <c>OptionList</c> argument can be used to specify
+ <p>The <c><anno>OptionList</anno></c> argument can be used to specify
certain behavior regarding ports as well as triggering
monitors under certain conditions:</p>
<taglist>
@@ -972,10 +933,10 @@
unloads, one should use the driver option
<c>kill_ports</c> when loading the driver instead.</p>
</item>
- <tag><em>{monitor, MonitorOption}</em></tag>
+ <tag><em>{monitor, <anno>MonitorOption</anno>}</em></tag>
<item>
<p>This option creates a driver monitor if the condition
- given in <c>MonitorOptions</c> is true. The valid
+ given in <c><anno>MonitorOption</anno></c> is true. The valid
options are:</p>
<taglist>
<tag><em>pending_driver</em></tag>
@@ -989,7 +950,7 @@
<c>{ok, pending_driver}</c> or <c>{ok, pending_process}</c>.</p>
</item>
</taglist>
- <p>The <c>pending_driver</c> <c>MonitorOption</c> is by far
+ <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
@@ -1016,11 +977,11 @@
</item>
<tag><em>{error, not_loaded}</em></tag>
<item>
- <p>The driver <c>Name</c> is not present in the system.</p>
+ <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>
<item>
- <p>The driver <c>Name</c> is present in the system, but
+ <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
@@ -1088,12 +1049,8 @@
</desc>
</func>
<func>
- <name>loaded_drivers() -> {ok, Drivers}</name>
+ <name name="loaded_drivers" arity="0"/>
<fsummary>List loaded drivers</fsummary>
- <type>
- <v>Drivers = [Driver]</v>
- <v>Driver = string()</v>
- </type>
<desc>
<p>Returns a list of all the available drivers, both
(statically) linked-in and dynamically loaded ones.</p>
diff --git a/lib/kernel/doc/src/error_logger.xml b/lib/kernel/doc/src/error_logger.xml
index 2d95f96ac7..cd86b364f6 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>2011</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -49,7 +49,7 @@
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
+ 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
@@ -127,11 +127,8 @@ ok</pre>
</desc>
</func>
<func>
- <name>warning_map() -> Tag</name>
+ <name name="warning_map" arity="0"/>
<fsummary>Return the current mapping for warning events</fsummary>
- <type>
- <v>Tag = error | warning | info</v>
- </type>
<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>
diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml
index 772eff13cc..b2a259080d 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>2011</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -412,7 +412,7 @@
</desc>
</func>
<func>
- <name>file_info(Filename) -> {ok, FileInfo} | {error, Reason}</name>
+ <name name="file_info" arity="1"/>
<fsummary>Get information about a file (deprecated)</fsummary>
<desc>
<p>This function is obsolete. Use <c>read_file_info/1,2</c>
@@ -598,7 +598,7 @@
</desc>
</func>
<func>
- <name>native_name_encoding() -> latin1 | utf8</name>
+ <name name="native_name_encoding" arity="0"/>
<fsummary>Return the VM's configured filename encoding.</fsummary>
<desc>
<p>This function returns the configured default file name encoding to use for raw file names. Generally an application supplying file names raw (as binaries), should obey the character encoding returned by this function.</p>
diff --git a/lib/kernel/doc/src/gen_sctp.xml b/lib/kernel/doc/src/gen_sctp.xml
index 579b7f1f74..7ea58fffff 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>2011</year>
+ <year>2007</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -123,7 +123,7 @@
<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
is blocking or otherwise depending of the value of
- the <seealso marker="#option-linger">linger</seealso> socket
+ 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 call returns and the data is flushed in the background.</p>
@@ -309,8 +309,8 @@
<seealso marker="#option-active">passive</seealso> mode,
with <anno>SockType</anno> <c>seqpacket</c>,
and with reasonably large
- <seealso marker="#option-sndbuf">kernel</seealso> and driver
- <seealso marker="#option-buffer">buffers.</seealso></p>
+ <seealso marker="inet#option-sndbuf">kernel</seealso> and driver
+ <seealso marker="inet#option-buffer">buffers.</seealso></p>
</desc>
</func>
<func>
@@ -530,19 +530,8 @@
SCTP data interleaved with other inter-process messages.</p>
</item>
</list>
- <marker id="option-buffer"></marker>
</item>
- <tag><c>{buffer, integer()}</c></tag>
- <item>
- <p>Determines the size of the user-level software buffer used by
- the SCTP 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>.
- 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.</p>
- </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
@@ -567,19 +556,8 @@
<c>{IP,Port}</c> of the socket can be re-used immediately:
no waiting in the CLOSE_WAIT state is performed (may be
required for high-throughput servers).</p>
- <marker id="option-linger"></marker>
- </item>
- <tag><c>{linger, {true|false, integer()}</c></tag>
- <item>
- <p>Determines the timeout in seconds for flushing unsent data in the
- <c>gen_sctp: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>gen_sctp:close/1</c> returns immediately not waiting
- for data to be flushed. Otherwise, the 2nd component is
- the flushing time-out in seconds.</p>
- <marker id="option-sndbuf"></marker>
</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.
Sending errors would occur for datagrams larger than
@@ -593,6 +571,15 @@
<c>val(sndbuf)</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_rtoinfo, #sctp_rtoinfo{}}</c></tag>
<item>
<pre> #sctp_rtoinfo{
diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml
index 8a5d40bb16..11a0843c10 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>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -96,37 +96,47 @@ do_recv(Sock, Bs) ->
can be either a hostname, or an IP address.</p>
<p>The available options are:</p>
<taglist>
- <tag><c>list</c></tag>
- <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>
- <tag><c>{ip, ip_address()}</c></tag>
+ <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>{port, Port}</c></tag>
+
+ <tag><c>{ifaddr, ip_address()}</c></tag>
<item>
- <p>Specify which local port number to use.</p>
- </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.</p>
</item>
- <tag><c>inet6</c></tag>
+
+ <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>
- <tag><c>inet</c></tag>
+
+ <tag><c>{port, Port}</c></tag>
<item>
- <p>Set up the socket for IPv4.</p>
+ <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>
+
<tag><c>Opt</c></tag>
<item>
<p>See
@@ -197,6 +207,13 @@ do_recv(Sock, Bs) ->
<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 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>
@@ -205,6 +222,14 @@ do_recv(Sock, Bs) ->
<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>
+
<tag><c>Opt</c></tag>
<item>
<p>See
@@ -235,7 +260,9 @@ do_recv(Sock, Bs) ->
<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. May also return a POSIX error
+ 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>
@@ -297,7 +324,7 @@ do_recv(Sock, Bs) ->
<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, eperm}</c> is returned.</p>
+ <c>{error, not_owner}</c> is returned.</p>
</desc>
</func>
<func>
diff --git a/lib/kernel/doc/src/gen_udp.xml b/lib/kernel/doc/src/gen_udp.xml
index daa9b7d887..4850278a64 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>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -72,6 +72,14 @@
<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>
+
+
<tag><c>{fd, integer() >= 0}</c></tag>
<item>
<p>If a socket has somehow been opened without using
@@ -86,6 +94,51 @@
<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>
+
+ <tag><c>{multicast_if, Address}</c></tag>
+ <item>
+ <p>Set 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>
+
+ <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>
+
<tag><c>Opt</c></tag>
<item>
<p>See
@@ -136,7 +189,9 @@
<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.</p>
+ 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>
diff --git a/lib/kernel/doc/src/global.xml b/lib/kernel/doc/src/global.xml
index 304a9b1d88..9c50049503 100644
--- a/lib/kernel/doc/src/global.xml
+++ b/lib/kernel/doc/src/global.xml
@@ -163,7 +163,8 @@
<fsummary>Globally register a name for a pid</fsummary>
<type name="method"/>
<type_desc name="method">{<c>Module</c>, <c>Function</c>}
- is also allowed
+ is currently 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,
@@ -180,6 +181,15 @@
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>
+ </warning>
+
<p>There are three pre-defined resolve functions:
<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
diff --git a/lib/kernel/doc/src/inet.xml b/lib/kernel/doc/src/inet.xml
index 1a05b4ba99..32b4a429dd 100644
--- a/lib/kernel/doc/src/inet.xml
+++ b/lib/kernel/doc/src/inet.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1997</year><year>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -149,7 +149,7 @@ fe80::204:acff:fe17:bf38
<fsummary>Return a descriptive string for an error reason</fsummary>
<desc>
<p>Returns a diagnostic error string. See the section below
- for possible <c><anno>Posix</anno></c> values and the corresponding
+ for possible Posix values and the corresponding
strings.</p>
</desc>
</func>
@@ -445,10 +445,24 @@ fe80::204:acff:fe17:bf38
flow control; the other side will not be able send
faster than the receiver can read.</p>
</item>
+
<tag><c>{broadcast, Boolean}</c>(UDP sockets)</tag>
<item>
<p>Enable/disable permission to send broadcasts.</p>
+ <marker id="option-buffer"></marker>
</item>
+
+ <tag><c>{buffer, Size}</c></tag>
+ <item>
+ <p>Determines 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>.
+ 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.</p>
+ </item>
+
<tag><c>{delay_send, Boolean}</c></tag>
<item>
<p>Normally, when an Erlang process sends to a socket,
@@ -463,10 +477,19 @@ fe80::204:acff:fe17:bf38
real property of the socket. Needless to say it is an
implementation specific option. Default is <c>false</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>
</item>
+
<tag><c>{exit_on_close, Boolean}</c></tag>
<item>
<p>By default this option is set to <c>true</c>.</p>
@@ -476,6 +499,7 @@ fe80::204:acff:fe17:bf38
<seealso marker="gen_tcp#shutdown/2">gen_tcp:shutdown/2</seealso>
to shutdown the write side.</p>
</item>
+
<tag><c>{header, Size}</c></tag>
<item>
<p>This option is only meaningful if the <c>binary</c>
@@ -487,6 +511,15 @@ fe80::204:acff:fe17:bf38
example <c>Size == 2</c>, the data received will match
<c>[Byte1,Byte2|Binary]</c>.</p>
</item>
+
+ <tag><c>{high_watermark, Size}</c></tag>
+ <item> <p>
+ Sender is forced busy if sent and enqueued data
+ reaches the highwater mark.
+ <br /> Default: 8192 kB.
+ </p>
+ </item>
+
<tag><c>{keepalive, Boolean}</c>(TCP/IP sockets)</tag>
<item>
<p>Enables/disables periodic transmission on a connected
@@ -494,7 +527,43 @@ fe80::204:acff:fe17:bf38
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>
</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_watermark, Size}</c></tag>
+ <item> <p>
+ If the port has reached its <c>high_watermark</c> it will
+ force busy onto senders. When the port data queue reaches the
+ <c>low_watermark</c> callers are no longer forced busy.
+ <br /> Default: 4096 kB.
+ </p>
+ </item>
+
+ <tag><c>{mode, Mode :: binary | list}</c></tag>
+ <item>
+ <p>Received <c>Packet</c> is delivered as defined by Mode.</p>
+ </item>
+
+ <tag><c>list</c></tag>
+ <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>
+
<tag><c>{nodelay, Boolean}</c>(TCP/IP sockets)</tag>
<item>
<p>If <c>Boolean == true</c>, the <c>TCP_NODELAY</c> option
@@ -578,6 +647,16 @@ fe80::204:acff:fe17:bf38
indicated length are accepted and not considered invalid due
to internal buffer limitations.</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
@@ -589,7 +668,7 @@ fe80::204:acff:fe17:bf38
high the system can become unresponsive due to
UDP packet flooding.</p>
</item>
- <tag><c>{recbuf, Integer}</c></tag>
+ <tag><c>{recbuf, Size}</c></tag>
<item>
<p>Gives the size of the receive buffer to use for
the socket.</p>
@@ -618,9 +697,10 @@ fe80::204:acff:fe17:bf38
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>
</item>
- <tag><c>{sndbuf, Integer}</c></tag>
+ <tag><c>{sndbuf, Size}</c></tag>
<item>
<p>Gives the size of the send buffer to use for the socket.</p>
</item>
@@ -639,6 +719,7 @@ fe80::204:acff:fe17:bf38
not implemented. Use with caution.</p>
</item>
</taglist>
+
<p>In addition to the options mentioned above, <em>raw</em>
option specifications can be used. The raw options are
specified as a tuple of arity four, beginning with the tag
diff --git a/lib/kernel/doc/src/kernel_app.xml b/lib/kernel/doc/src/kernel_app.xml
index 0f71a4f0f2..faa8f86dbd 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>2011</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -104,7 +104,7 @@
that node. <c>Value</c> is one of:</p>
<taglist>
<tag><c>never</c></tag>
- <item>Connections are never automatically connected, they
+ <item>Connections are never automatically established, they
must be explicitly connected. See <c>net_kernel(3)</c>.</item>
<tag><c>once</c></tag>
<item>Connections will be established automatically, but only
diff --git a/lib/kernel/doc/src/notes.xml b/lib/kernel/doc/src/notes.xml
index 9121186631..8e911a406b 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,6 +30,224 @@
</header>
<p>This document describes the changes made to the Kernel application.</p>
+<section><title>Kernel 2.15.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fixed issue where using controlling_process/2 with self()
+ as the second argument caused the port to leak if self()
+ crashes. (Thanks to Ricardo Catalinas Jim�nez)</p>
+ <p>
+ Own Id: OTP-10094</p>
+ </item>
+ <item>
+ <p>
+ When sending large files using the file:sendfile fallback
+ file:sendfile would crash. This is now fixed.</p>
+ <p>
+ Own Id: OTP-10098</p>
+ </item>
+ <item>
+ <p>
+ Fix rpc:call/5 for local calls with a finite Timeout
+ (Thanks to Tomer Chachamu)</p>
+ <p>
+ Own Id: OTP-10149</p>
+ </item>
+ <item>
+ <p>
+ fix escript/primary archive reloading</p>
+ <p>
+ If the mtime of an escript/primary archive file changes
+ after being added to the code path, correctly reload the
+ archive and update the cache. (Thanks to Tuncer Ayaz)</p>
+ <p>
+ Own Id: OTP-10151</p>
+ </item>
+ <item>
+ <p>
+ Support added for home directories named with non-ASCII
+ characters (codepoints above 127) on a system running in
+ Unicode file mode (e.g. on MacOSX or Linux with startup
+ arguments +fnu or +fna with the right LOCALE). Also
+ environment variables with Unicode content are supported
+ in applicable environments.</p>
+ <p>
+ Own Id: OTP-10160</p>
+ </item>
+ <item>
+ <p>
+ Allow mixed IPv4 and IPv6 addresses to sctp_bindx</p>
+ <p>
+ Also allow mixed address families to bind, since the
+ first address on a multihomed sctp socket must be bound
+ with bind, while the rest are to be bound using
+ sctp_bindx. At least Linux supports adding address of
+ mixing families. Make inet_set_faddress function
+ available also when HAVE_SCTP is not defined, since we
+ use it to find an address for bind to be able to mix ipv4
+ and ipv6 addresses. Thanks to Tomas Abrahamsson</p>
+ <p>
+ Own Id: OTP-10217</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>Document inet options: high_watermark, priority,
+ linger and a some other options that previously was
+ undocumented.</p>
+ <p>
+ Own Id: OTP-10053</p>
+ </item>
+ <item>
+ <p>Remove bit8 option support from inet</p>
+ <p>
+ Own Id: OTP-10056</p>
+ </item>
+ <item>
+ <p> The type of the disk log header has been corrected.
+ (Thanks to Niclas Eklund.) </p>
+ <p>
+ Own Id: OTP-10131</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Kernel 2.15.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Driver output has been corrected so output of large
+ binaries (> 4 GiB) now does not silently fail or crash
+ the emulator, but either outputs the binary or fails the
+ call. This means that writing a binary > 4 Gib to file
+ now works but on e.g 64-bit Windows (that has
+ scatter/gather I/O buffer segment lengths of 32 bits)
+ fails. The behaviour may change in the future to always
+ write the binary, in parts if necessary.</p>
+ <p>
+ Own Id: OTP-9820 Aux Id: OTP-9795 </p>
+ </item>
+ <item>
+ <p>
+ erts: minor fix for unnecessary condition erts: change
+ SENDFILE_CHUNK_SIZE from signed to unsigned (Thanks to
+ jovi zhang)</p>
+ <p>
+ Own Id: OTP-9872</p>
+ </item>
+ <item>
+ <p> Two contracts in <c>gen_sctp</c> have been corrected.
+ </p>
+ <p>
+ Own Id: OTP-9874</p>
+ </item>
+ <item>
+ <p>If a process calls a module with an running on_load
+ handler, the process is supposed to be suspended. But if
+ the module with the on_load handler was loading used
+ <c>code:load_binary/3</c>, the call would instead fail
+ with an <c>undef</c> exception.</p>
+ <p>
+ Own Id: OTP-9875</p>
+ </item>
+ <item>
+ <p>
+ File name and error reason is now returned if creation of
+ a cookie fails. (Thanks to Magnus Henoch)</p>
+ <p>
+ Own Id: OTP-9954</p>
+ </item>
+ <item>
+ <p>
+ Fix port leak in <c>zlib</c> when passing invalid data to
+ <c>compress,uncompress,zip,unzip,gzip,gunzip</c>.</p>
+ <p>
+ Own Id: OTP-9981</p>
+ </item>
+ <item>
+ <p>
+ Various typographical errors corrected in documentation
+ for the global, error_logger, etop, lists, ets and
+ supervisor modules and in the c_portdriver and kernel_app
+ documentation. (Thanks to Ricardo Catalinas Jim�nez)</p>
+ <p>
+ Own Id: OTP-9987</p>
+ </item>
+ <item>
+ <p> Fix returned error from gen_tcp:accept/1,2 when
+ running out of ports
+ <p>
+ The {error, enfile} return value is badly misleading and
+ confusing for this case, since the Posix ENFILE errno
+ value has a well-defined meaning that has nothing to do
+ with Erlang ports. The fix changes the return value to
+ {error, system_limit}, which is consistent with e.g.
+ various file(3) functions. inet:format_error/1 has also
+ been updated to support system_limit in the same manner
+ as file:format_error/1. (Thanks to Per Hedeland)</p></p>
+ <p>
+ Own Id: OTP-9990</p>
+ </item>
+ <item>
+ <p><c>erts_debug:size/1</c> has been corrected to take
+ sharing in the environment of funs into account. For funs
+ it used to always give the same result as
+ <c>erts_debug:flat_size/1</c>.</p>
+ <p>
+ Own Id: OTP-9991</p>
+ </item>
+ <item>
+ <p>
+ In some cases when the process doing file:sendfile
+ crashes while sending the file the efile_drv code would
+ not clean up after itself correctly. This has now been
+ fixed.</p>
+ <p>
+ Own Id: OTP-9993</p>
+ </item>
+ <item>
+ <p>
+ On BSD based platforms file:sendfile would sometime go
+ into an infinite loop when sending big files. This has
+ now been fixed.</p>
+ <p>
+ Own Id: OTP-9994</p>
+ </item>
+ <item>
+ <p>While <c>disk_log</c> eagerly collects logged terms
+ for better performance, collecting too much data may
+ choke the system and cause huge binaries to be
+ written.</p>
+ <p>The problem was addressed in OTP-9764, but the
+ situation was not improved in all cases.</p>
+ <p>(Thanks to Richard Carlsson.)</p>
+ <p>
+ Own Id: OTP-9999 Aux Id: OTP-9764 </p>
+ </item>
+ <item>
+ <p>
+ The documentation of .app files incorrectly said that the
+ default value for the <c>mod</c> parameter is
+ <c>undefined</c>. This is now corrected to <c>[]</c>.</p>
+ <p>
+ Own Id: OTP-10002</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Kernel 2.15</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/kernel/doc/src/os.xml b/lib/kernel/doc/src/os.xml
index e94119845a..5e182de41d 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>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -73,65 +73,65 @@ DirOut = os:cmd("dir"), % on Win32 platform</code>
</desc>
</func>
<func>
- <name>getenv() -> [string()]</name>
+ <name name="getenv" arity="0"/>
<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
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>
</desc>
</func>
<func>
- <name>getenv(VarName) -> Value | false</name>
+ <name name="getenv" arity="1"/>
<fsummary>Get the value of an environment variable</fsummary>
- <type>
- <v>VarName = string() </v>
- <v>Value = string()</v>
- </type>
<desc>
- <p>Returns the <c>Value</c> of the environment variable
- <c>VarName</c>, or <c>false</c> if the environment variable
+ <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>
</desc>
</func>
<func>
- <name>getpid() -> Value </name>
+ <name name="getpid" arity="0"/>
<fsummary>Return the process identifier of the emulator process</fsummary>
- <type>
- <v>Value = string()</v>
- </type>
<desc>
<p>Returns the process identifier of the current Erlang emulator
in the format most commonly used by the operating system
- environment. <c>Value</c> is returned as a string containing
+ environment. <c><anno>Value</anno></c> is returned 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 VxWorks, <c>Value</c> contains the task id
- (decimal notation) of the Erlang task. On Windows,
+ system call. On Windows,
the process id as returned by the <c>GetCurrentProcessId()</c>
system call is used.</p>
</desc>
</func>
<func>
- <name>putenv(VarName, Value) -> true</name>
+ <name name="putenv" arity="2"/>
<fsummary>Set a new value for an environment variable</fsummary>
- <type>
- <v>VarName = string() </v>
- <v>Value = string()</v>
- </type>
<desc>
- <p>Sets a new <c>Value</c> for the environment variable
- <c>VarName</c>.</p>
+ <p>Sets a new <c><anno>Value</anno></c> for 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 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>
</desc>
</func>
<func>
- <name>timestamp() -> Timestamp</name>
+ <name name="timestamp" arity="0"/>
+ <type_desc variable="Timestamp">Timestamp = {MegaSecs, Secs, MicroSecs}</type_desc>
<fsummary>Returna a timestamp from the OS in the erlang:now/0 format</fsummary>
- <type>
- <v>Timestamp = {MegaSecs, Secs, MicroSecs} = <seealso marker="erts:erlang#type-timestamp">erlang:timestamp()</seealso></v>
- <v>MegaSecs = Secs = MicroSecs = integer() >= 0</v>
- </type>
<desc>
<p>Returns a tuple in the same format as <seealso marker="erts:erlang#now/0">erlang:now/0</seealso>. The difference is that this function returns what the operating system thinks (a.k.a. the wall clock time) without any attempts at time correction. The result of two different calls to this function is <em>not</em> guaranteed to be different.</p>
<p>The most obvious use for this function is logging. 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>
@@ -168,8 +168,6 @@ format_utc_timestamp() ->
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>
- <p>On VxWorks the OS family alone is returned, that is
- <c>vxworks</c>.</p>
<note>
<p>Think twice before using this function. Use the
<c>filename</c> module if you want to inspect or build
diff --git a/lib/kernel/doc/src/packages.xml b/lib/kernel/doc/src/packages.xml
index 80de2e05fc..8a82b91a90 100644
--- a/lib/kernel/doc/src/packages.xml
+++ b/lib/kernel/doc/src/packages.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -204,11 +204,5 @@ ok
Explicitly
declaring each use of a module makes for safe code.</p>
</description>
- <funcs>
- <func>
- <name>no functions exported</name>
- <fsummary>x</fsummary>
- </func>
- </funcs>
</erlref>
diff --git a/lib/kernel/examples/Makefile b/lib/kernel/examples/Makefile
index fb27f8d438..21dfd0ec0e 100644
--- a/lib/kernel/examples/Makefile
+++ b/lib/kernel/examples/Makefile
@@ -47,8 +47,8 @@ RELSYSDIR = $(RELEASE_PATH)/lib/kernel-$(KERNEL_VSN)/examples
EXAMPLES = uds_dist
release_spec:
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
tar cf - $(EXAMPLES) | \
- (cd $(RELSYSDIR); tar xf - ; chmod -R ug+w $(EXAMPLES) )
+ (cd "$(RELSYSDIR)"; tar xf - ; chmod -R ug+w $(EXAMPLES) )
release_docs_spec:
diff --git a/lib/kernel/examples/uds_dist/c_src/uds_drv.c b/lib/kernel/examples/uds_dist/c_src/uds_drv.c
index 9327ab19dc..9ad6b85a0f 100644
--- a/lib/kernel/examples/uds_dist/c_src/uds_drv.c
+++ b/lib/kernel/examples/uds_dist/c_src/uds_drv.c
@@ -967,7 +967,7 @@ static void *my_malloc(size_t size)
void *ptr;
if ((ptr = driver_alloc(size)) == NULL) {
- erl_exit(1,"Could not allocate %d bytes of memory",(int) size);
+ erl_exit(1,"Could not allocate %lu bytes of memory",(unsigned long) size);
}
return ptr;
}
@@ -977,7 +977,7 @@ static void *my_realloc(void *ptr, size_t size)
void erl_exit(int, char *, ...);
void *nptr;
if ((nptr = driver_realloc(ptr, size)) == NULL) {
- erl_exit(1,"Could not reallocate %d bytes of memory",(int) size);
+ erl_exit(1,"Could not reallocate %lu bytes of memory",(unsigned long) size);
}
return nptr;
}
diff --git a/lib/kernel/src/Makefile b/lib/kernel/src/Makefile
index 54f21eb2b8..c76ff9e2f0 100644
--- a/lib/kernel/src/Makefile
+++ b/lib/kernel/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -198,13 +198,13 @@ $(EBIN)/erl_epmd.beam: $(ESRC)/erl_epmd.erl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/kernel/src/application.erl b/lib/kernel/src/application.erl
index c299fb085c..9b7c4aa7b8 100644
--- a/lib/kernel/src/application.erl
+++ b/lib/kernel/src/application.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -37,8 +37,7 @@
-type application_opt() :: {'description', Description :: string()}
| {'vsn', Vsn :: string()}
| {'id', Id :: string()}
- | {'modules', [(Module :: module()) |
- {Module :: module(), Version :: term()}]}
+ | {'modules', [Module :: module()]}
| {'registered', Names :: [Name :: atom()]}
| {'applications', [Application :: atom()]}
| {'included_applications', [Application :: atom()]}
diff --git a/lib/kernel/src/application_controller.erl b/lib/kernel/src/application_controller.erl
index ebfe84463a..68cd26ec10 100644
--- a/lib/kernel/src/application_controller.erl
+++ b/lib/kernel/src/application_controller.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -162,7 +162,7 @@
%% appl_opt() = {description, string()} |
%% {vsn, string()} |
%% {id, string()}, |
-%% {modules, [Module|{Module,Vsn}]} |
+%% {modules, [Module]} |
%% {registered, [atom()]} |
%% {applications, [atom()]} |
%% {included_applications, [atom()]} |
@@ -172,7 +172,6 @@
%% {maxP, integer()|infinity} |
%% {mod, {Module, term()}}
%% Module = atom()
-%% Vsn = term()
%% Purpose: Starts the application_controller. This process starts all
%% application masters for the applications.
%% The kernel application is the only application that is
@@ -446,7 +445,7 @@ get_application_module(Module) ->
get_application_module(Module, AppModules).
get_application_module(Module, [[AppName, Modules]|AppModules]) ->
- case in_modules(Module, Modules) of
+ case lists:member(Module, Modules) of
true ->
{ok, AppName};
false ->
@@ -455,16 +454,6 @@ get_application_module(Module, [[AppName, Modules]|AppModules]) ->
get_application_module(_Module, []) ->
undefined.
-%% 'modules' key in .app is a list of Module or {Module,Vsn}
-in_modules(Module, [Module|_Modules]) ->
- true;
-in_modules(Module, [{Module, _Vsn}|_Modules]) ->
- true;
-in_modules(Module, [_Module|Modules]) ->
- in_modules(Module, Modules);
-in_modules(_Module, []) ->
- false.
-
permit_application(ApplName, Flag) ->
gen_server:call(?AC,
{permit_application, ApplName, Flag},
diff --git a/lib/kernel/src/auth.erl b/lib/kernel/src/auth.erl
index c329a5652a..6ae786ebd9 100644
--- a/lib/kernel/src/auth.erl
+++ b/lib/kernel/src/auth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -381,13 +381,17 @@ create_cookie(Name) ->
case {R1, R2} of
{ok, ok} ->
ok;
- {{error,_Reason}, _} ->
- {error, "Failed to create cookie file"};
+ {{error,Reason}, _} ->
+ {error,
+ lists:flatten(
+ io_lib:format("Failed to write to cookie file '~s': ~p", [Name, Reason]))};
{ok, {error, Reason}} ->
{error, "Failed to change mode: " ++ atom_to_list(Reason)}
end;
- {error,_Reason} ->
- {error, "Failed to create cookie file"}
+ {error,Reason} ->
+ {error,
+ lists:flatten(
+ io_lib:format("Failed to create cookie file '~s': ~p", [Name, Reason]))}
end.
random_cookie(0, _, Result) ->
diff --git a/lib/kernel/src/code.erl b/lib/kernel/src/code.erl
index b7fda69ce0..c808ac7cb7 100644
--- a/lib/kernel/src/code.erl
+++ b/lib/kernel/src/code.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -63,53 +63,13 @@
which/1,
where_is_file/1,
where_is_file/2,
- set_primary_archive/3,
+ set_primary_archive/4,
clash/0]).
-export_type([load_error_rsn/0, load_ret/0]).
-include_lib("kernel/include/file.hrl").
-%% User interface.
-%%
-%% objfile_extension() -> ".beam"
-%% get_path() -> [Dir]
-%% set_path([Dir]) -> true | {error, bad_directory | bad_path}
-%% add_path(Dir) -> true | {error, bad_directory}
-%% add_patha(Dir) -> true | {error, bad_directory}
-%% add_pathz(Dir) -> true | {error, bad_directory}
-%% add_paths([Dir]) -> ok
-%% add_pathsa([Dir]) -> ok
-%% add_pathsz([Dir]) -> ok
-%% del_path(Dir) -> boolean() | {error, bad_name}
-%% replace_path(Name, Dir) -> true | {error, bad_directory | bad_name
-%% | {badarg,_}}
-%% load_file(Module) -> {module, Module} | {error, What :: atom()}
-%% load_abs(File) -> {module, Module} | {error, What :: atom()}
-%% load_abs(File, Module) -> {module, Module} | {error, What :: atom()}
-%% load_binary(Module, File, Bin)-> {module, Module} | {error, What :: atom()}
-%% ensure_loaded(Module) -> {module, Module} | {error, What :: atom()}
-%% delete(Module) -> boolean()
-%% purge(Module) -> boolean() kills all procs running old code
-%% soft_purge(Module) -> boolean()
-%% is_loaded(Module) -> {file, loaded_filename()} | false
-%% all_loaded() -> [{Module, loaded_filename()}]
-%% get_object_code(Module) -> {Module, Bin, Filename} | error
-%% stop() -> no_return()
-%% root_dir() -> Dir
-%% compiler_dir() -> Dir
-%% lib_dir() -> Dir
-%% lib_dir(Application) -> Dir | {error, bad_name}
-%% priv_dir(Application) -> Dir | {error, bad_name}
-%% stick_dir(Dir) -> ok | error
-%% unstick_dir(Dir) -> ok | error
-%% stick_mod(Module) -> true
-%% unstick_mod(Module) -> true
-%% is_sticky(Module) -> boolean()
-%% which(Module) -> Filename | loaded_ret_atoms() | non_existing
-%% set_primary_archive((FileName, Bin, FileInfo) -> ok | {error, Reason}
-%% clash() -> ok prints out number of clashes
-
%%----------------------------------------------------------------------------
%% Some types for basic exported functions of this module
%%----------------------------------------------------------------------------
@@ -125,6 +85,39 @@
-type loaded_ret_atoms() :: 'cover_compiled' | 'preloaded'.
-type loaded_filename() :: (Filename :: file:filename()) | loaded_ret_atoms().
+%%% BIFs
+
+-export([get_chunk/2, is_module_native/1, make_stub_module/3, module_md5/1]).
+
+-spec get_chunk(Bin, Chunk) ->
+ binary() | undefined when
+ Bin :: binary(),
+ Chunk :: string().
+
+get_chunk(_, _) ->
+ erlang:nif_error(undef).
+
+-spec is_module_native(Module) -> true | false | undefined when
+ Module :: module().
+
+is_module_native(_) ->
+ erlang:nif_error(undef).
+
+-spec make_stub_module(Module, Beam, Info) -> Module when
+ Module :: module(),
+ Beam :: binary(),
+ Info :: {list(), list()}.
+
+make_stub_module(_, _, _) ->
+ erlang:nif_error(undef).
+
+-spec module_md5(binary()) -> binary() | undefined.
+
+module_md5(_) ->
+ erlang:nif_error(undef).
+
+%%% End of BIFs
+
%%----------------------------------------------------------------------------
%% User interface
%%----------------------------------------------------------------------------
@@ -481,13 +474,16 @@ where_is_file(Path, File) when is_list(Path), is_list(File) ->
-spec set_primary_archive(ArchiveFile :: file:filename(),
ArchiveBin :: binary(),
- FileInfo :: file:file_info())
+ FileInfo :: file:file_info(),
+ ParserFun :: fun())
-> 'ok' | {'error', atom()}.
-set_primary_archive(ArchiveFile0, ArchiveBin, #file_info{} = FileInfo)
+set_primary_archive(ArchiveFile0, ArchiveBin, #file_info{} = FileInfo,
+ ParserFun)
when is_list(ArchiveFile0), is_binary(ArchiveBin) ->
ArchiveFile = filename:absname(ArchiveFile0),
- case call({set_primary_archive, ArchiveFile, ArchiveBin, FileInfo}) of
+ case call({set_primary_archive, ArchiveFile, ArchiveBin, FileInfo,
+ ParserFun}) of
{ok, []} ->
ok;
{ok, _Mode, Ebins} ->
diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl
index 5d4f2eb70c..00ad923466 100644
--- a/lib/kernel/src/code_server.erl
+++ b/lib/kernel/src/code_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -394,8 +394,8 @@ handle_call(stop,{_From,_Tag}, S) ->
handle_call({is_cached,_File}, {_From,_Tag}, S=#state{cache=no_cache}) ->
{reply, no, S};
-handle_call({set_primary_archive, File, ArchiveBin, FileInfo}, {_From,_Tag}, S=#state{mode=Mode}) ->
- case erl_prim_loader:set_primary_archive(File, ArchiveBin, FileInfo) of
+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
{ok, Files} ->
{reply, {ok, Mode, Files}, S};
{error, _Reason} = Error ->
diff --git a/lib/kernel/src/disk_log.erl b/lib/kernel/src/disk_log.erl
index fb9415d440..5b1efcd395 100644
--- a/lib/kernel/src/disk_log.erl
+++ b/lib/kernel/src/disk_log.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -282,7 +282,8 @@ change_notify(Log, Pid, NewNotify) ->
-spec change_header(Log, Header) -> 'ok' | {'error', Reason} when
Log :: log(),
- Header :: {head, dlog_head_opt()} | {head_func, mfa()},
+ Header :: {head, dlog_head_opt()}
+ | {head_func, MFA :: {atom(), atom(), list()}},
Reason :: no_such_log | nonode | {read_only_mode, Log}
| {blocked_log, Log} | {badarg, head}.
change_header(Log, NewHead) ->
@@ -336,7 +337,9 @@ format_error(Error) ->
ok | {blocked, QueueLogRecords :: boolean()}}
| {node, Node :: node()}
| {distributed, Dist :: local | [node()]}
- | {head, Head :: none | {head, term()} | mfa()}
+ | {head, Head :: none
+ | {head, term()}
+ | (MFA :: {atom(), atom(), list()})}
| {no_written_items, NoWrittenItems ::non_neg_integer()}
| {full, Full :: boolean}
| {no_current_bytes, non_neg_integer()}
@@ -1034,10 +1037,9 @@ sync_loop(From, S) ->
-define(MAX_LOOK_AHEAD, 64*1024).
%% Inlined.
-log_loop(S, Pids, _Bins, _Sync, _Sz) when S#state.cache_error =/= ok ->
+log_loop(#state{cache_error = CE}=S, Pids, _Bins, _Sync, _Sz) when CE =/= ok ->
loop(cache_error(S, Pids));
-log_loop(#state{messages = []}=S, Pids, Bins, Sync, Sz)
- when Sz > ?MAX_LOOK_AHEAD ->
+log_loop(#state{}=S, Pids, Bins, Sync, Sz) when Sz > ?MAX_LOOK_AHEAD ->
loop(log_end(S, Pids, Bins, Sync));
log_loop(#state{messages = []}=S, Pids, Bins, Sync, Sz) ->
receive
@@ -1046,8 +1048,7 @@ log_loop(#state{messages = []}=S, Pids, Bins, Sync, Sz) ->
after 0 ->
loop(log_end(S, Pids, Bins, Sync))
end;
-log_loop(S, Pids, Bins, Sync, Sz) ->
- [M | Ms] = S#state.messages,
+log_loop(#state{messages = [M | Ms]}=S, Pids, Bins, Sync, Sz) ->
S1 = S#state{messages = Ms},
log_loop(M, Pids, Bins, Sync, Sz, S1, get(log)).
diff --git a/lib/kernel/src/disk_log.hrl b/lib/kernel/src/disk_log.hrl
index 259967650f..242a25a7a6 100644
--- a/lib/kernel/src/disk_log.hrl
+++ b/lib/kernel/src/disk_log.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -74,7 +74,7 @@
| {distributed, Nodes :: [node()]}
| {notify, boolean()}
| {head, Head :: dlog_head_opt()}
- | {head_func, mfa()}
+ | {head_func, MFA :: {atom(), atom(), list()}}
| {mode, Mode :: dlog_mode()}.
-type dlog_options() :: [dlog_option()].
-type dlog_repair() :: 'truncate' | boolean().
diff --git a/lib/kernel/src/disk_log_1.erl b/lib/kernel/src/disk_log_1.erl
index 266df84a03..0cb1ed579a 100644
--- a/lib/kernel/src/disk_log_1.erl
+++ b/lib/kernel/src/disk_log_1.erl
@@ -1495,7 +1495,7 @@ fwrite_close2(Fd, FileName, B) ->
pwrite_close2(Fd, FileName, Position, B) ->
case file:pwrite(Fd, Position, B) of
ok -> ok;
- Error -> file_error(FileName, {error, Error})
+ {error,Error} -> file_error(FileName, {error, Error})
end.
position2(Fd, FileName, Pos) ->
diff --git a/lib/kernel/src/erl_ddll.erl b/lib/kernel/src/erl_ddll.erl
index 646cac99c5..f967fcc2ef 100644
--- a/lib/kernel/src/erl_ddll.erl
+++ b/lib/kernel/src/erl_ddll.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -30,9 +30,99 @@
%%----------------------------------------------------------------------------
-type path() :: string() | atom().
--type driver() :: string() | atom().
+-type driver() :: iolist() | atom().
%%----------------------------------------------------------------------------
+%%% BIFs
+
+-export([demonitor/1, info/2, format_error_int/1, monitor/2,
+ try_load/3, try_unload/2, loaded_drivers/0]).
+
+-spec demonitor(MonitorRef) -> ok when
+ MonitorRef :: reference().
+
+demonitor(_) ->
+ erlang:nif_error(undef).
+
+-spec info(Name, Tag) -> Value when
+ Name :: driver(),
+ Tag :: processes | driver_options | port_count | linked_in_driver
+ | permanent | awaiting_load | awaiting_unload,
+ Value :: term().
+
+info(_, _) ->
+ erlang:nif_error(undef).
+
+-spec format_error_int(ErrSpec) -> string() when
+ ErrSpec :: inconsisten | linked_in_driver | permanent
+ | not_loaded | not_loaded_by_this_process | not_pending
+ | already_loaded | unloading.
+
+format_error_int(_) ->
+ erlang:nif_error(undef).
+
+-spec monitor(Tag, Item) -> MonitorRef when
+ Tag :: driver,
+ Item :: {Name, When},
+ Name :: driver(),
+ When :: loaded | unloaded | unloaded_only,
+ MonitorRef :: reference().
+
+monitor(_, _) ->
+ erlang:nif_error(undef).
+
+-spec try_load(Path, Name, OptionList) ->
+ {ok,Status} |
+ {ok, PendingStatus, Ref} |
+ {error, ErrorDesc} when
+ Path :: path(),
+ Name :: driver(),
+ OptionList :: [Option],
+ Option :: {driver_options, DriverOptionList}
+ | {monitor, MonitorOption}
+ | {reload, ReloadOption},
+ DriverOptionList :: [DriverOption],
+ DriverOption :: kill_ports,
+ MonitorOption :: pending_driver | pending,
+ ReloadOption :: pending_driver | pending,
+ Status :: loaded | already_loaded | PendingStatus,
+ PendingStatus :: pending_driver | pending_process,
+ Ref :: reference(),
+ ErrorDesc :: ErrorAtom | OpaqueError,
+ ErrorAtom :: linked_in_driver | inconsistent | permanent
+ | not_loaded_by_this_process | not_loaded
+ | pending_reload | pending_process,
+ OpaqueError :: term().
+
+try_load(_, _, _) ->
+ erlang:nif_error(undef).
+
+-spec try_unload(Name, OptionList) ->
+ {ok, Status} |
+ {ok, PendingStatus, Ref} |
+ {error, ErrorAtom} when
+ Name :: driver(),
+ OptionList :: [Option],
+ Option :: {monitor, MonitorOption} | kill_ports,
+ MonitorOption :: pending_driver | pending,
+ Status :: unloaded | PendingStatus,
+ PendingStatus :: pending_driver | pending_process,
+ Ref :: reference(),
+ ErrorAtom :: linked_in_driver | not_loaded |
+ not_loaded_by_this_process | permanent.
+
+try_unload(_, _) ->
+ erlang:nif_error(undef).
+
+-spec loaded_drivers() -> {ok, Drivers} when
+ Drivers :: [Driver],
+ Driver :: string().
+
+loaded_drivers() ->
+ erlang:nif_error(undef).
+
+%%% End of BIFs
+
-spec start() -> {'error', {'already_started', 'undefined'}}.
diff --git a/lib/kernel/src/error_handler.erl b/lib/kernel/src/error_handler.erl
index a67b11a888..f8bc5f499c 100644
--- a/lib/kernel/src/error_handler.erl
+++ b/lib/kernel/src/error_handler.erl
@@ -90,7 +90,7 @@ int() -> int.
crash(Fun, Args) ->
crash({Fun,Args,[]}).
--spec crash(atom(), atom(), arity()) -> no_return().
+-spec crash(atom(), atom(), arity() | [term()]) -> no_return().
crash(M, F, A) ->
crash({M,F,A,[]}).
diff --git a/lib/kernel/src/error_logger.erl b/lib/kernel/src/error_logger.erl
index f94cca000f..92c1eb80dc 100644
--- a/lib/kernel/src/error_logger.erl
+++ b/lib/kernel/src/error_logger.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -42,6 +42,18 @@
-type state() :: {non_neg_integer(), non_neg_integer(), [term()]}.
+%%% BIF
+
+-export([warning_map/0]).
+
+-spec warning_map() -> Tag when
+ Tag :: error | warning | info.
+
+warning_map() ->
+ erlang:nif_error(undef).
+
+%%% End of BIF
+
%%-----------------------------------------------------------------
-spec start() -> {'ok', pid()} | {'error', any()}.
diff --git a/lib/kernel/src/erts_debug.erl b/lib/kernel/src/erts_debug.erl
index 7d6a5ade94..6654cd9ee7 100644
--- a/lib/kernel/src/erts_debug.erl
+++ b/lib/kernel/src/erts_debug.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -28,6 +28,135 @@
%% same/2
%% flat_size/1
+%%% BIFs
+
+-export([breakpoint/2, disassemble/1, display/1, dist_ext_to_term/2,
+ dump_monitors/1, dump_links/1, flat_size/1,
+ get_internal_state/1, instructions/0, lock_counters/1,
+ same/2, set_internal_state/2]).
+
+-spec breakpoint(MFA, Flag) -> non_neg_integer() when
+ MFA :: {Module :: module(),
+ Function :: atom(),
+ Arity :: arity() | '_'},
+ Flag :: boolean().
+
+breakpoint(_, _) ->
+ erlang:nif_error(undef).
+
+-spec disassemble(What) -> false | undef | Result when
+ What :: MFA | Address,
+ Result :: {Address, Code, MFA},
+ MFA :: mfa(),
+ Address :: non_neg_integer(),
+ Code :: binary().
+
+disassemble(_) ->
+ erlang:nif_error(undef).
+
+-spec display(Term) -> string() when
+ Term :: term().
+
+display(_) ->
+ erlang:nif_error(undef).
+
+-spec dist_ext_to_term(Tuple, Binary) -> term() when
+ Tuple :: tuple(),
+ Binary :: binary().
+
+dist_ext_to_term(_, _) ->
+ erlang:nif_error(undef).
+
+-spec dump_monitors(Id) -> true when
+ Id :: pid() | atom().
+
+dump_monitors(_) ->
+ erlang:nif_error(undef).
+
+-spec dump_links(Id) -> true when
+ Id :: pid() | port() | atom().
+
+dump_links(_) ->
+ erlang:nif_error(undef).
+
+-spec flat_size(Term) -> non_neg_integer() when
+ Term :: term().
+
+flat_size(_) ->
+ erlang:nif_error(undef).
+
+-spec get_internal_state(W) -> term() when
+ W :: reds_left | node_and_dist_references | monitoring_nodes
+ | next_pid | 'DbTable_words' | check_io_debug
+ | process_info_args | processes | processes_bif_info
+ | max_atom_out_cache_index | nbalance | available_internal_state
+ | force_heap_frags | memory
+ | {process_status, pid()}
+ | {link_list, pid() | port() | node()}
+ | {monitor_list, pid() | node()}
+ | {channel_number, non_neg_integer()}
+ | {have_pending_exit, pid() | port() | atom()}
+ | {binary_info, binary()}
+ | {term_to_binary_no_funs, term()}
+ | {dist_port, port()}
+ | {atom_out_cache_index, atom()}
+ | {fake_scheduler_bindings,
+ default_bind | spread | processor_spread | thread_spread
+ | thread_no_node_processor_spread | no_node_processor_spread
+ | no_node_thread_spread | no_spread | unbound}
+ | {reader_groups_map, non_neg_integer()}.
+
+get_internal_state(_) ->
+ erlang:nif_error(undef).
+
+-spec instructions() -> [string()].
+
+instructions() ->
+ erlang:nif_error(undef).
+
+-spec lock_counters(info) -> term();
+ (clear) -> ok;
+ ({copy_save, boolean()}) -> boolean();
+ ({process_locks, boolean()}) -> boolean().
+
+lock_counters(_) ->
+ erlang:nif_error(undef).
+
+-spec same(Term1, Term2) -> boolean() when
+ Term1 :: term(),
+ Term2 :: term().
+
+same(_, _) ->
+ erlang:nif_error(undef).
+
+-spec set_internal_state(available_internal_state, boolean()) -> boolean();
+ (reds_left, non_neg_integer()) -> true;
+ (block, non_neg_integer()) -> true;
+ (sleep, non_neg_integer()) -> true;
+ (block_scheduler, non_neg_integer()) -> true;
+ (next_pid, non_neg_integer()) -> false | integer();
+ (force_gc, pid() | atom()) -> boolean();
+ (send_fake_exit_signal, {pid() | port(), pid(), term()}) -> dead | message | unaffected | exit;
+ (colliding_names, {atom(), non_neg_integer()}) ->
+ [atom()];
+ (binary_loop_limit, default) -> -1;
+ (binary_loop_limit, non_neg_integer()) -> non_neg_integer();
+ (re_loop_limit, default) -> -1;
+ (re_loop_limit, non_neg_integer()) -> non_neg_integer();
+ (unicode_loop_limit, default) -> -1;
+ (unicode_loop_limit, non_neg_integer()) -> non_neg_integer();
+ (hipe_test_reschedule_suspend, term()) -> nil();
+ (hipe_test_reschedule_resume, pid() | port()) -> boolean();
+ (test_long_gc_sleep, non_neg_integer()) -> true;
+ (kill_dist_connection, port()) -> boolean();
+ (not_running_optimization, boolean()) -> boolean();
+ (wait, deallocations) -> ok.
+
+set_internal_state(_, _) ->
+ erlang:nif_error(undef).
+
+%%% End of BIFs
+
%% size(Term)
%% Returns the size of Term in actual heap words. Shared subterms are
%% counted once. Example: If A = [a,b], B =[A,A] then size(B) returns 8,
@@ -53,6 +182,11 @@ size(Tuple, Seen0, Sum0) when is_tuple(Tuple) ->
Sum = Sum0 + 1 + tuple_size(Tuple),
tuple_size(1, tuple_size(Tuple), Tuple, Seen, Sum)
end;
+size(Fun, Seen0, Sum) when is_function(Fun) ->
+ case remember_term(Fun, Seen0) of
+ seen -> {Sum,Seen0};
+ Seen -> fun_size(Fun, Seen, Sum)
+ end;
size(Term, Seen0, Sum) ->
case erts_debug:flat_size(Term) of
0 -> {Sum,Seen0};
@@ -68,6 +202,21 @@ tuple_size(I, Sz, _, Seen, Sum) when I > Sz ->
tuple_size(I, Sz, Tuple, Seen0, Sum0) ->
{Sum,Seen} = size(element(I, Tuple), Seen0, Sum0),
tuple_size(I+1, Sz, Tuple, Seen, Sum).
+
+fun_size(Fun, Seen, Sum) ->
+ case erlang:fun_info(Fun, type) of
+ {type,external} ->
+ {Sum + erts_debug:flat_size(Fun),Seen};
+ {type,local} ->
+ Sz = erts_debug:flat_size(fun() -> ok end),
+ {env,Env} = erlang:fun_info(Fun, env),
+ fun_size_1(Env, Seen, Sum+Sz+length(Env))
+ end.
+
+fun_size_1([H|T], Seen0, Sum0) ->
+ {Sum,Seen} = size(H, Seen0, Sum0),
+ fun_size_1(T, Seen, Sum);
+fun_size_1([], Seen, Sum) -> {Sum,Seen}.
remember_term(Term, Seen) ->
case gb_trees:lookup(Term, Seen) of
diff --git a/lib/kernel/src/file.erl b/lib/kernel/src/file.erl
index 4028dd4f0b..22af38c598 100644
--- a/lib/kernel/src/file.erl
+++ b/lib/kernel/src/file.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -111,6 +111,24 @@
-type sendfile_option() :: {chunk_size, non_neg_integer()}.
-type file_info_option() :: {'time', 'local'} | {'time', 'universal'}
| {'time', 'posix'}.
+%%% BIFs
+
+-export([file_info/1, native_name_encoding/0]).
+
+-spec file_info(Filename) -> {ok, FileInfo} | {error, Reason} when
+ Filename :: name(),
+ FileInfo :: file_info(),
+ Reason :: posix() | badarg.
+
+file_info(_) ->
+ erlang:nif_error(undef).
+
+-spec native_name_encoding() -> latin1 | utf8.
+
+native_name_encoding() ->
+ erlang:nif_error(undef).
+
+%%% End of BIFs
%%%-----------------------------------------------------------------
@@ -1258,7 +1276,7 @@ sendfile_fallback_int(File, Sock, Bytes, ChunkSize, BytesSent)
when Bytes > BytesSent; Bytes == 0 ->
Size = if Bytes == 0 ->
ChunkSize;
- (Bytes - BytesSent + ChunkSize) > 0 ->
+ (Bytes - BytesSent) < ChunkSize ->
Bytes - BytesSent;
true ->
ChunkSize
@@ -1416,7 +1434,11 @@ mode_list(_) ->
%% Functions for communicating with the file server
call(Command, Args) when is_list(Args) ->
- gen_server:call(?FILE_SERVER, list_to_tuple([Command | Args]), infinity).
+ X = erlang:dt_spread_tag(true),
+ Y = gen_server:call(?FILE_SERVER, list_to_tuple([Command | Args]),
+ infinity),
+ erlang:dt_restore_tag(X),
+ Y.
check_and_call(Command, Args) when is_list(Args) ->
case check_args(Args) of
diff --git a/lib/kernel/src/file_io_server.erl b/lib/kernel/src/file_io_server.erl
index 14da9c1a55..0bff56cf46 100644
--- a/lib/kernel/src/file_io_server.erl
+++ b/lib/kernel/src/file_io_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2012. 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
@@ -57,9 +57,11 @@ start_link(Owner, FileName, ModeList)
do_start(Spawn, Owner, FileName, ModeList) ->
Self = self(),
Ref = make_ref(),
+ Utag = erlang:dt_spread_tag(true),
Pid =
erlang:Spawn(
fun() ->
+ erlang:dt_restore_tag(Utag),
%% process_flag(trap_exit, true),
case parse_options(ModeList) of
{ReadMode, UnicodeMode, Opts} ->
@@ -84,6 +86,7 @@ do_start(Spawn, Owner, FileName, ModeList) ->
exit(Reason1)
end
end),
+ erlang:dt_restore_tag(Utag),
Mref = erlang:monitor(process, Pid),
receive
{Ref, {error, _Reason} = Error} ->
diff --git a/lib/kernel/src/gen_sctp.erl b/lib/kernel/src/gen_sctp.erl
index d8954f0cf7..8fa963ec78 100644
--- a/lib/kernel/src/gen_sctp.erl
+++ b/lib/kernel/src/gen_sctp.erl
@@ -425,9 +425,10 @@ error_string(X) ->
erlang:error(badarg, [X]).
--spec controlling_process(Socket, Pid) -> ok when
+-spec controlling_process(Socket, Pid) -> ok | {error, Reason} when
Socket :: sctp_socket(),
- Pid :: pid().
+ Pid :: pid(),
+ Reason :: closed | not_owner | inet:posix().
controlling_process(S, Pid) when is_port(S), is_pid(Pid) ->
inet:udp_controlling_process(S, Pid);
diff --git a/lib/kernel/src/gen_tcp.erl b/lib/kernel/src/gen_tcp.erl
index 4d6c7f5f1d..e6dfdadb03 100644
--- a/lib/kernel/src/gen_tcp.erl
+++ b/lib/kernel/src/gen_tcp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -31,7 +31,6 @@
-type option() ::
{active, true | false | once} |
- {bit8, clear | set | on | off} |
{buffer, non_neg_integer()} |
{delay_send, boolean()} |
{deliver, port | term} |
@@ -61,7 +60,6 @@
{tos, non_neg_integer()}.
-type option_name() ::
active |
- bit8 |
buffer |
delay_send |
deliver |
@@ -175,7 +173,7 @@ try_connect([], _Port, _Opts, _Timer, _Mod, Err) ->
Port :: inet:port_number(),
Options :: [listen_option()],
ListenSocket :: socket(),
- Reason :: inet:posix().
+ Reason :: system_limit | inet:posix().
listen(Port, Opts) ->
Mod = mod(Opts, undefined),
@@ -194,7 +192,7 @@ listen(Port, Opts) ->
-spec accept(ListenSocket) -> {ok, Socket} | {error, Reason} when
ListenSocket :: socket(),
Socket :: socket(),
- Reason :: closed | timeout | inet:posix().
+ Reason :: closed | timeout | system_limit | inet:posix().
accept(S) ->
case inet_db:lookup_socket(S) of
@@ -208,7 +206,7 @@ accept(S) ->
ListenSocket :: socket(),
Timeout :: timeout(),
Socket :: socket(),
- Reason :: closed | timeout | inet:posix().
+ Reason :: closed | timeout | system_limit | inet:posix().
accept(S, Time) when is_port(S) ->
case inet_db:lookup_socket(S) of
diff --git a/lib/kernel/src/gen_udp.erl b/lib/kernel/src/gen_udp.erl
index 8688799ae9..830ca61b3c 100644
--- a/lib/kernel/src/gen_udp.erl
+++ b/lib/kernel/src/gen_udp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -185,9 +185,10 @@ connect(S, Address, Port) when is_port(S) ->
Error
end.
--spec controlling_process(Socket, Pid) -> ok when
+-spec controlling_process(Socket, Pid) -> ok | {error, Reason} when
Socket :: socket(),
- Pid :: pid().
+ Pid :: pid(),
+ Reason :: closed | not_owner | inet:posix().
controlling_process(S, NewOwner) ->
inet:udp_controlling_process(S, NewOwner).
diff --git a/lib/kernel/src/global.erl b/lib/kernel/src/global.erl
index fa97614eca..b24a9d5eac 100644
--- a/lib/kernel/src/global.erl
+++ b/lib/kernel/src/global.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -232,7 +232,8 @@ register_name(Name, Pid) when is_pid(Pid) ->
Name :: term(),
Pid :: pid(),
Resolve :: method().
-register_name(Name, Pid, Method) when is_pid(Pid) ->
+register_name(Name, Pid, Method0) when is_pid(Pid) ->
+ Method = allow_tuple_fun(Method0),
Fun = fun(Nodes) ->
case (where(Name) =:= undefined) andalso check_dupname(Name, Pid) of
true ->
@@ -280,17 +281,18 @@ unregister_name(Name) ->
gen_server:call(global_name_server, {registrar, Fun}, infinity)
end.
--spec re_register_name(Name, Pid) -> _ when
+-spec re_register_name(Name, Pid) -> 'yes' when
Name :: term(),
Pid :: pid().
re_register_name(Name, Pid) when is_pid(Pid) ->
re_register_name(Name, Pid, fun random_exit_name/3).
--spec re_register_name(Name, Pid, Resolve) -> _ when
+-spec re_register_name(Name, Pid, Resolve) -> 'yes' when
Name :: term(),
Pid :: pid(),
Resolve :: method().
-re_register_name(Name, Pid, Method) when is_pid(Pid) ->
+re_register_name(Name, Pid, Method0) when is_pid(Pid) ->
+ Method = allow_tuple_fun(Method0),
Fun = fun(Nodes) ->
gen_server:multi_call(Nodes,
global_name_server,
@@ -1965,7 +1967,7 @@ resolve_it(Method, Name, Pid1, Pid2) ->
minmax(P1,P2) ->
if node(P1) < node(P2) -> {P1, P2}; true -> {P2, P1} end.
--spec random_exit_name(Name, Pid1, Pid2) -> 'none' when
+-spec random_exit_name(Name, Pid1, Pid2) -> pid() when
Name :: term(),
Pid1 :: pid(),
Pid2 :: pid().
@@ -1976,7 +1978,7 @@ random_exit_name(Name, Pid, Pid2) ->
exit(Max, kill),
Min.
--spec random_notify_name(Name, Pid1, Pid2) -> 'none' when
+-spec random_notify_name(Name, Pid1, Pid2) -> pid() when
Name :: term(),
Pid1 :: pid(),
Pid2 :: pid().
@@ -2175,7 +2177,7 @@ get_own_nodes() ->
start_the_registrar() ->
spawn_link(fun() -> loop_the_registrar() end).
-
+
loop_the_registrar() ->
receive
{trans_all_known, Fun, From} ->
@@ -2218,3 +2220,9 @@ intersection(_, []) ->
[];
intersection(L1, L2) ->
L1 -- (L1 -- L2).
+
+%% Support legacy tuple funs as resolve functions.
+allow_tuple_fun({M, F}) when is_atom(M), is_atom(F) ->
+ fun M:F/3;
+allow_tuple_fun(Fun) when is_function(Fun, 3) ->
+ Fun.
diff --git a/lib/kernel/src/heart.erl b/lib/kernel/src/heart.erl
index 255ae4e51b..28452a377e 100644
--- a/lib/kernel/src/heart.erl
+++ b/lib/kernel/src/heart.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -18,6 +18,10 @@
%%
-module(heart).
+-compile(no_native).
+% 'no_native' as part of a crude fix to make init:restart/0 work by clearing
+% all hipe inter-module information (hipe_mfa_info's in hipe_bif0.c).
+
%%%--------------------------------------------------------------------
%%% This is a rewrite of pre_heart from BS.3.
%%%
diff --git a/lib/kernel/src/hipe_unified_loader.erl b/lib/kernel/src/hipe_unified_loader.erl
index 8b3aa0286d..06d404905d 100644
--- a/lib/kernel/src/hipe_unified_loader.erl
+++ b/lib/kernel/src/hipe_unified_loader.erl
@@ -34,6 +34,13 @@
-module(hipe_unified_loader).
+-compile(no_native).
+% 'no_native' is a workaround to avoid "The code server called unloaded module"
+% caused by Mod:module_info(exports) in patch_to_emu_step1() called by post_beam_load.
+% Reproducable with hipelibs and asn1_SUITE.
+% I think the real solution would be to let BIF erlang:load_module/2 redirect all
+% hipe calls to the module and thereby remove post_beam_load.
+
-export([chunk_name/1,
%% Only the code and code_server modules may call the entries below!
load_native_code/2,
@@ -330,11 +337,16 @@ exports(ExportMap, BaseAddress) ->
exports(ExportMap, BaseAddress, [], []).
exports([Offset,M,F,A,IsClosure,IsExported|Rest], BaseAddress, MFAs, Addresses) ->
- MFA = {M,F,A},
- Address = BaseAddress + Offset,
- FunDef = #fundef{address=Address, mfa=MFA, is_closure=IsClosure,
- is_exported=IsExported},
- exports(Rest, BaseAddress, [MFA|MFAs], [FunDef|Addresses]);
+ case IsExported andalso erlang:is_builtin(M, F, A) of
+ true ->
+ exports(Rest, BaseAddress, MFAs, Addresses);
+ _false ->
+ MFA = {M,F,A},
+ Address = BaseAddress + Offset,
+ FunDef = #fundef{address=Address, mfa=MFA, is_closure=IsClosure,
+ is_exported=IsExported},
+ exports(Rest, BaseAddress, [MFA|MFAs], [FunDef|Addresses])
+ end;
exports([], _, MFAs, Addresses) ->
{MFAs, Addresses}.
@@ -498,7 +510,7 @@ patch_offset(Type, Data, Address, ConstAndZone, Addresses) ->
Atom = Data,
patch_atom(Address, Atom);
sdesc ->
- patch_sdesc(Data, Address, ConstAndZone);
+ patch_sdesc(Data, Address, ConstAndZone, Addresses);
x86_abs_pcrel ->
patch_instr(Address, Data, x86_abs_pcrel)
%% _ ->
@@ -511,14 +523,16 @@ patch_atom(Address, Atom) ->
patch_instr(Address, hipe_bifs:atom_to_word(Atom), atom).
patch_sdesc(?STACK_DESC(SymExnRA, FSize, Arity, Live),
- Address, {_ConstMap2,CodeAddress}) ->
+ Address, {_ConstMap2,CodeAddress}, _Addresses) ->
ExnRA =
case SymExnRA of
[] -> 0; % No catch
LabelOffset -> CodeAddress + LabelOffset
end,
?ASSERT(assert_local_patch(Address)),
- hipe_bifs:enter_sdesc({Address, ExnRA, FSize, Arity, Live}).
+ DBG_MFA = ?IF_DEBUG(address_to_mfa_lth(Address, _Addresses), {undefined,undefined,0}),
+ hipe_bifs:enter_sdesc({Address, ExnRA, FSize, Arity, Live, DBG_MFA}).
+
%%----------------------------------------------------------------
%% Handle a 'load_address'-type patch.
@@ -725,7 +739,7 @@ find_const(ConstNo, []) ->
%%
add_ref(CalleeMFA, Address, Addresses, RefType, Trampoline, RemoteOrLocal) ->
- CallerMFA = address_to_mfa(Address, Addresses),
+ CallerMFA = address_to_mfa_lth(Address, Addresses),
%% just a sanity assertion below
true = case RemoteOrLocal of
local ->
@@ -738,11 +752,31 @@ add_ref(CalleeMFA, Address, Addresses, RefType, Trampoline, RemoteOrLocal) ->
%% io:format("Adding ref ~w\n",[{CallerMFA, CalleeMFA, Address, RefType}]),
hipe_bifs:add_ref(CalleeMFA, {CallerMFA,Address,RefType,Trampoline,RemoteOrLocal}).
-address_to_mfa(Address, [#fundef{address=Adr, mfa=MFA}|_Rest]) when Address >= Adr -> MFA;
-address_to_mfa(Address, [_ | Rest]) -> address_to_mfa(Address, Rest);
-address_to_mfa(Address, []) ->
- ?error_msg("Local adddress not found ~w\n",[Address]),
- exit({?MODULE, local_address_not_found}).
+% For FunDefs sorted from low to high addresses
+address_to_mfa_lth(Address, FunDefs) ->
+ case address_to_mfa_lth(Address, FunDefs, false) of
+ false ->
+ ?error_msg("Local adddress not found ~w\n",[Address]),
+ exit({?MODULE, local_address_not_found});
+ MFA ->
+ MFA
+ end.
+
+address_to_mfa_lth(Address, [#fundef{address=Adr, mfa=MFA}|Rest], Prev) ->
+ if Address < Adr ->
+ Prev;
+ true ->
+ address_to_mfa_lth(Address, Rest, MFA)
+ end;
+address_to_mfa_lth(_Address, [], Prev) ->
+ Prev.
+
+% For FunDefs sorted from high to low addresses
+%% address_to_mfa_htl(Address, [#fundef{address=Adr, mfa=MFA}|_Rest]) when Address >= Adr -> MFA;
+%% address_to_mfa_htl(Address, [_ | Rest]) -> address_to_mfa_htl(Address, Rest);
+%% address_to_mfa_htl(Address, []) ->
+%% ?error_msg("Local adddress not found ~w\n",[Address]),
+%% exit({?MODULE, local_address_not_found}).
%%----------------------------------------------------------------
%% Change callers of the given module to instead trap to BEAM.
diff --git a/lib/kernel/src/inet.erl b/lib/kernel/src/inet.erl
index 49f64a9236..b4ebb1500c 100644
--- a/lib/kernel/src/inet.erl
+++ b/lib/kernel/src/inet.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -535,7 +535,7 @@ options() ->
buffer, header, active, packet, deliver, mode,
multicast_if, multicast_ttl, multicast_loop,
exit_on_close, high_watermark, low_watermark,
- bit8, send_timeout, send_timeout_close
+ send_timeout, send_timeout_close
].
%% Return a list of statistics options
@@ -552,7 +552,7 @@ stats() ->
connect_options() ->
[tos, priority, reuseaddr, keepalive, linger, sndbuf, recbuf, nodelay,
header, active, packet, packet_size, buffer, mode, deliver,
- exit_on_close, high_watermark, low_watermark, bit8, send_timeout,
+ exit_on_close, high_watermark, low_watermark, send_timeout,
send_timeout_close, delay_send,raw].
connect_options(Opts, Family) ->
@@ -608,7 +608,7 @@ con_add(Name, Val, R, Opts, AllOpts) ->
listen_options() ->
[tos, priority, reuseaddr, keepalive, linger, sndbuf, recbuf, nodelay,
header, active, packet, buffer, mode, deliver, backlog,
- exit_on_close, high_watermark, low_watermark, bit8, send_timeout,
+ exit_on_close, high_watermark, low_watermark, send_timeout,
send_timeout_close, delay_send, packet_size,raw].
listen_options(Opts, Family) ->
@@ -763,8 +763,12 @@ sctp_opt([Opt|Opts], Mod, R, As) ->
{Name,Val} -> sctp_opt (Opts, Mod, R, As, Name, Val);
_ -> {error,badarg}
end;
-sctp_opt([], _Mod, R, _SockOpts) ->
- {ok, R}.
+sctp_opt([], _Mod, #sctp_opts{ifaddr=IfAddr}=R, _SockOpts) ->
+ if is_list(IfAddr) ->
+ {ok, R#sctp_opts{ifaddr=lists:reverse(IfAddr)}};
+ true ->
+ {ok, R}
+ end.
sctp_opt(Opts, Mod, R, As, Name, Val) ->
case add_opt(Name, Val, R#sctp_opts.opts, As) of
@@ -1015,11 +1019,7 @@ open(Fd, Addr, Port, Opts, Protocol, Family, Type, Module) when Fd < 0 ->
case prim_inet:setopts(S, Opts) of
ok ->
case if is_list(Addr) ->
- prim_inet:bind(S, add,
- [case A of
- {_,_} -> A;
- _ -> {A,Port}
- end || A <- Addr]);
+ bindx(S, Addr, Port);
true ->
prim_inet:bind(S, Addr, Port)
end of
@@ -1040,6 +1040,34 @@ open(Fd, Addr, Port, Opts, Protocol, Family, Type, Module) when Fd < 0 ->
open(Fd, _Addr, _Port, Opts, Protocol, Family, Type, Module) ->
fdopen(Fd, Opts, Protocol, Family, Type, Module).
+bindx(S, [Addr], Port0) ->
+ {IP, Port} = set_bindx_port(Addr, Port0),
+ prim_inet:bind(S, IP, Port);
+bindx(S, Addrs, Port0) ->
+ [{IP, Port} | Rest] = [set_bindx_port(Addr, Port0) || Addr <- Addrs],
+ case prim_inet:bind(S, IP, Port) of
+ {ok, AssignedPort} when Port =:= 0 ->
+ %% On newer Linux kernels, Solaris and FreeBSD, calling
+ %% bindx with port 0 is ok, but on SuSE 10, it results in einval
+ Rest2 = [change_bindx_0_port(Addr, AssignedPort) || Addr <- Rest],
+ prim_inet:bind(S, add, Rest2);
+ {ok, _} ->
+ prim_inet:bind(S, add, Rest);
+ Error ->
+ Error
+ end.
+
+set_bindx_port({_IP, _Port}=Addr, _OtherPort) ->
+ Addr;
+set_bindx_port(IP, Port) ->
+ {IP, Port}.
+
+change_bindx_0_port({IP, 0}, AssignedPort) ->
+ {IP, AssignedPort};
+change_bindx_0_port({_IP, _Port}=Addr, _AssignedPort) ->
+ Addr.
+
+
-spec fdopen(Fd :: non_neg_integer(),
Opts :: [socket_setopt()],
Protocol :: socket_protocol(),
@@ -1218,11 +1246,13 @@ port_list(Name) ->
%% utils
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--spec format_error(Posix) -> string() when
- Posix :: posix().
+-spec format_error(Reason) -> string() when
+ Reason :: posix() | system_limit.
format_error(exbadport) -> "invalid port state";
format_error(exbadseq) -> "bad command sequence";
+format_error(system_limit) ->
+ "a system limit was hit, probably not enough ports";
format_error(Tag) ->
erl_posix_msg:message(Tag).
@@ -1244,6 +1274,8 @@ udp_close(S) when is_port(S) ->
%% Set controlling process for TCP socket.
tcp_controlling_process(S, NewOwner) when is_port(S), is_pid(NewOwner) ->
case erlang:port_info(S, connected) of
+ {connected, NewOwner} ->
+ ok;
{connected, Pid} when Pid =/= self() ->
{error, not_owner};
undefined ->
@@ -1251,7 +1283,10 @@ tcp_controlling_process(S, NewOwner) when is_port(S), is_pid(NewOwner) ->
_ ->
case prim_inet:getopt(S, active) of
{ok, A0} ->
- prim_inet:setopt(S, active, false),
+ case A0 of
+ false -> ok;
+ _ -> prim_inet:setopt(S, active, false)
+ end,
case tcp_sync_input(S, NewOwner, false) of
true -> %% socket already closed,
ok;
@@ -1259,7 +1294,10 @@ tcp_controlling_process(S, NewOwner) when is_port(S), is_pid(NewOwner) ->
try erlang:port_connect(S, NewOwner) of
true ->
unlink(S), %% unlink from port
- prim_inet:setopt(S, active, A0),
+ case A0 of
+ false -> ok;
+ _ -> prim_inet:setopt(S, active, A0)
+ end,
ok
catch
error:Reason ->
@@ -1295,6 +1333,8 @@ tcp_sync_input(S, Owner, Flag) ->
%% Set controlling process for UDP or SCTP socket.
udp_controlling_process(S, NewOwner) when is_port(S), is_pid(NewOwner) ->
case erlang:port_info(S, connected) of
+ {connected, NewOwner} ->
+ ok;
{connected, Pid} when Pid =/= self() ->
{error, not_owner};
_ ->
diff --git a/lib/kernel/src/inet_config.erl b/lib/kernel/src/inet_config.erl
index 1ddbdcec25..526baca335 100644
--- a/lib/kernel/src/inet_config.erl
+++ b/lib/kernel/src/inet_config.erl
@@ -197,16 +197,6 @@ do_load_resolv({win32,Type}, longnames) ->
win32_load_from_registry(Type),
inet_db:set_lookup([native]);
-do_load_resolv(vxworks, _) ->
- vxworks_load_hosts(),
- inet_db:set_lookup([file, dns]),
- case os:getenv("ERLRESCONF") of
- false ->
- no_ERLRESCONF;
- Resolv ->
- load_resolv(Resolv, resolv)
- end;
-
do_load_resolv(_, _) ->
inet_db:set_lookup([native]).
@@ -408,55 +398,6 @@ win32_get_strings(Reg, [Name|Rest], Result) ->
win32_get_strings(_, [], Result) ->
lists:reverse(Result).
-%%
-%% Load host data from VxWorks hostShow command
-%%
-
-vxworks_load_hosts() ->
- HostShow = os:cmd("hostShow"),
- case check_hostShow(HostShow) of
- Hosts when is_list(Hosts) ->
- case inet_parse:hosts_vxworks({chars, Hosts}) of
- {ok, Ls} ->
- foreach(
- fun({IP, Name, Aliases}) ->
- inet_db:add_host(IP, [Name|Aliases])
- end,
- Ls);
- {error,Reason} ->
- error("parser error VxWorks hostShow ~s", [Reason])
- end;
- _Error ->
- error("error in VxWorks hostShow~s~n", [HostShow])
- end.
-
-%%
-%% Check if hostShow yields at least two line; the first one
-%% starting with "hostname", the second one starting with
-%% "--------".
-%% Returns: list of hosts in VxWorks notation
-%% rows of 'Name IP [Aliases] \n'
-%% if hostShow yielded these two lines, false otherwise.
-check_hostShow(HostShow) ->
- check_hostShow(["hostname", "--------"], HostShow).
-
-check_hostShow([], HostShow) ->
- HostShow;
-check_hostShow([String_match|Rest], HostShow) ->
- case lists:prefix(String_match, HostShow) of
- true ->
- check_hostShow(Rest, next_line(HostShow));
- false ->
- false
- end.
-
-next_line([]) ->
- [];
-next_line([$\n|Rest]) ->
- Rest;
-next_line([_First|Rest]) ->
- next_line(Rest).
-
read_rc() ->
{RcFile,CfgList} = read_inetrc(),
case extract_cfg_files(CfgList, [], []) of
diff --git a/lib/kernel/src/inet_int.hrl b/lib/kernel/src/inet_int.hrl
index cf893c73eb..467c4d5065 100644
--- a/lib/kernel/src/inet_int.hrl
+++ b/lib/kernel/src/inet_int.hrl
@@ -134,7 +134,6 @@
-define(INET_LOPT_EXITONCLOSE, 26).
-define(INET_LOPT_TCP_HIWTRMRK, 27).
-define(INET_LOPT_TCP_LOWTRMRK, 28).
--define(INET_LOPT_BIT8, 29).
-define(INET_LOPT_TCP_SEND_TIMEOUT, 30).
-define(INET_LOPT_TCP_DELAY_SEND, 31).
-define(INET_LOPT_PACKET_SIZE, 32).
@@ -186,12 +185,6 @@
-define(TCP_PB_HTTP_BIN,13).
-define(TCP_PB_HTTPH_BIN,14).
-%% bit options, INET_LOPT_BIT8
--define(INET_BIT8_CLEAR, 0).
--define(INET_BIT8_SET, 1).
--define(INET_BIT8_ON, 2).
--define(INET_BIT8_OFF, 3).
-
%% getstat, INET_REQ_GETSTAT
-define(INET_STAT_RECV_CNT, 1).
diff --git a/lib/kernel/src/inet_parse.erl b/lib/kernel/src/inet_parse.erl
index 65edddcb46..ba62a59068 100644
--- a/lib/kernel/src/inet_parse.erl
+++ b/lib/kernel/src/inet_parse.erl
@@ -23,7 +23,6 @@
%% Avoid warning for local function error/2 clashing with autoimported BIF.
-compile({no_auto_import,[error/2]}).
-export([hosts/1, hosts/2]).
--export([hosts_vxworks/1]).
-export([protocols/1, protocols/2]).
-export([netmasks/1, netmasks/2]).
-export([networks/1, networks/2]).
@@ -107,18 +106,6 @@ hosts(Fname,File) ->
parse_file(Fname, File, Fn).
%% --------------------------------------------------------------------------
-%% Parse hostShow vxworks style
-%% Syntax:
-%% Name IP [Aliases] \n
-%% --------------------------------------------------------------------------
-hosts_vxworks(Hosts) ->
- Fn = fun([Name, Address | Aliases]) ->
- {ok,IP} = address(Address),
- {IP, Name, Aliases}
- end,
- parse_file(Hosts, Fn).
-
-%% --------------------------------------------------------------------------
%% Parse resolv file unix style
%% Syntax:
%% domain Domain \n
@@ -291,9 +278,6 @@ networks(Fname, File) ->
%%
%% --------------------------------------------------------------------------
-parse_file(File, Fn) ->
- parse_file(noname, File, Fn).
-
parse_file(Fname, {fd,Fd}, Fn) ->
parse_fd(Fname,Fd, 1, Fn, []);
parse_file(Fname, {chars,Cs}, Fn) when is_list(Cs) ->
diff --git a/lib/kernel/src/kernel.appup.src b/lib/kernel/src/kernel.appup.src
index bded2408a7..54628800a8 100644
--- a/lib/kernel/src/kernel.appup.src
+++ b/lib/kernel/src/kernel.appup.src
@@ -17,11 +17,11 @@
%% %CopyrightEnd%
{"%VSN%",
%% Up from - max two major revisions back
- [{<<"2\\.15(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15
- {<<"2\\.14(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R14
- {<<"2\\.13(\\.[0-9]+)*">>,[restart_new_emulator]}],%% R13
+ [{<<"2\\.16(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R16
+ {<<"2\\.15(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15
+ {<<"2\\.14(\\.[0-9]+)*">>,[restart_new_emulator]}],%% R14
%% Down to - max two major revisions back
- [{<<"2\\.15(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15
- {<<"2\\.14(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R14
- {<<"2\\.13(\\.[0-9]+)*">>,[restart_new_emulator]}] %% R13
+ [{<<"2\\.16(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R16
+ {<<"2\\.15(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15
+ {<<"2\\.14(\\.[0-9]+)*">>,[restart_new_emulator]}] %% R14
}.
diff --git a/lib/kernel/src/net_kernel.erl b/lib/kernel/src/net_kernel.erl
index 9e3d730cee..0d59e7af67 100644
--- a/lib/kernel/src/net_kernel.erl
+++ b/lib/kernel/src/net_kernel.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -142,6 +142,17 @@
-include("net_address.hrl").
+%%% BIF
+
+-export([dflag_unicode_io/1]).
+
+-spec dflag_unicode_io(pid()) -> boolean().
+
+dflag_unicode_io(_) ->
+ erlang:nif_error(undef).
+
+%%% End of BIF
+
%% Interface functions
kernel_apply(M,F,A) -> request({apply,M,F,A}).
diff --git a/lib/kernel/src/os.erl b/lib/kernel/src/os.erl
index f6769df585..e20a2434b4 100644
--- a/lib/kernel/src/os.erl
+++ b/lib/kernel/src/os.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -24,16 +24,48 @@
-include("file.hrl").
--spec type() -> vxworks | {Osfamily, Osname} when
+%%% BIFs
+
+-export([getenv/0, getenv/1, getpid/0, putenv/2, timestamp/0]).
+
+-spec getenv() -> [string()].
+
+getenv() -> erlang:nif_error(undef).
+
+-spec getenv(VarName) -> Value | false when
+ VarName :: string(),
+ Value :: string().
+
+getenv(_) ->
+ erlang:nif_error(undef).
+
+-spec getpid() -> Value when
+ Value :: string().
+
+getpid() ->
+ erlang:nif_error(undef).
+
+-spec putenv(VarName, Value) -> true when
+ VarName :: string(),
+ Value :: string().
+
+putenv(_, _) ->
+ erlang:nif_error(undef).
+
+-spec timestamp() -> Timestamp when
+ Timestamp :: erlang:timestamp().
+
+timestamp() ->
+ erlang:nif_error(undef).
+
+%%% End of BIFs
+
+-spec type() -> {Osfamily, Osname} when
Osfamily :: unix | win32,
Osname :: atom().
type() ->
- case erlang:system_info(os_type) of
- {vxworks, _} ->
- vxworks;
- Else -> Else
- end.
+ erlang:system_info(os_type).
-spec version() -> VersionString | {Major, Minor, Release} when
VersionString :: string(),
@@ -83,25 +115,14 @@ find_executable1(_Name, [], _Extensions) ->
verify_executable(Name0, [Ext|Rest], OrigExtensions) ->
Name1 = Name0 ++ Ext,
- case os:type() of
- vxworks ->
- %% We consider all existing VxWorks files to be executable
- case file:read_file_info(Name1) of
- {ok, _} ->
- {ok, Name1};
- _ ->
- verify_executable(Name0, Rest, OrigExtensions)
- end;
+ case file:read_file_info(Name1) of
+ {ok, #file_info{type=regular,mode=Mode}}
+ when Mode band 8#111 =/= 0 ->
+ %% XXX This test for execution permission is not fool-proof
+ %% on Unix, since we test if any execution bit is set.
+ {ok, Name1};
_ ->
- case file:read_file_info(Name1) of
- {ok, #file_info{type=regular,mode=Mode}}
- when Mode band 8#111 =/= 0 ->
- %% XXX This test for execution permission is not fool-proof
- %% on Unix, since we test if any execution bit is set.
- {ok, Name1};
- _ ->
- verify_executable(Name0, Rest, OrigExtensions)
- end
+ verify_executable(Name0, Rest, OrigExtensions)
end;
verify_executable(Name, [], OrigExtensions) when OrigExtensions =/= [""] -> %% Windows
%% Will only happen on windows, hence case insensitivity
@@ -154,8 +175,7 @@ reverse_element(List) ->
extensions() ->
case type() of
{win32, _} -> [".exe",".com",".cmd",".bat"];
- {unix, _} -> [""];
- vxworks -> [""]
+ {unix, _} -> [""]
end.
%% Executes the given command in the default shell for the operating system.
@@ -173,11 +193,6 @@ cmd(Cmd) ->
{Cspec,_} -> lists:concat([Cspec," /c",Cmd])
end,
Port = open_port({spawn, Command}, [stream, in, eof, hide]),
- get_data(Port, []);
- %% VxWorks uses a 'sh -c hook' in 'vxcall.c' to run os:cmd.
- vxworks ->
- Command = lists:concat(["sh -c '", Cmd, "'"]),
- Port = open_port({spawn, Command}, [stream, in, eof]),
get_data(Port, [])
end.
diff --git a/lib/kernel/src/rpc.erl b/lib/kernel/src/rpc.erl
index e214ffa404..0b1fc6e939 100644
--- a/lib/kernel/src/rpc.erl
+++ b/lib/kernel/src/rpc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -286,7 +286,7 @@ call(N,M,F,A) ->
Reason :: term(),
Timeout :: timeout().
-call(N,M,F,A,_Timeout) when node() =:= N -> %% Optimize local call
+call(N,M,F,A,infinity) when node() =:= N -> %% Optimize local call
local_call(M,F,A);
call(N,M,F,A,infinity) ->
do_call(N, {call,M,F,A,group_leader()}, infinity);
diff --git a/lib/kernel/test/Makefile b/lib/kernel/test/Makefile
index 5dcaad3f5e..8eca37029d 100644
--- a/lib/kernel/test/Makefile
+++ b/lib/kernel/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -140,12 +140,12 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) $(APP_FILES) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(APP_FILES) "$(RELSYSDIR)"
$(INSTALL_DATA) kernel.spec $(EMAKEFILE)\
- $(COVERFILE) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(COVERFILE) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/kernel/test/bif_SUITE.erl b/lib/kernel/test/bif_SUITE.erl
index 6276270d20..c369dca4e1 100644
--- a/lib/kernel/test/bif_SUITE.erl
+++ b/lib/kernel/test/bif_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -260,23 +260,15 @@ spawn_opt2(Config) when is_list(Config) ->
?line P1 = spawn_opt(fun() ->
Parent ! {self(), fetch_proc_vals(self())}
end,
- case heap_type() of
- separate ->
- [{fullsweep_after, 0},{min_heap_size, 1000}];
- shared ->
- []
- end
- ++ [link, {priority, max}]),
+ [{fullsweep_after, 0},{min_heap_size, 1000},
+ link, {priority, max}]),
?line receive
{P1, PV1} ->
?line Node = node(P1),
?line check_proc_vals(true, max, 0, 1000, PV1)
end,
?line P2 = spawn_opt(fun() -> Parent ! {self(), fetch_proc_vals(self())} end,
- case heap_type() of
- separate -> [{min_heap_size, 10}];
- shared -> []
- end),
+ [{min_heap_size, 10}]),
?line receive
{P2, PV2} ->
?line Node = node(P2),
@@ -295,13 +287,8 @@ spawn_opt3(Config) when is_list(Config) ->
fun() ->
Parent ! {self(), fetch_proc_vals(self())}
end,
- case heap_type() of
- separate ->
- [{fullsweep_after,0}, {min_heap_size,1000}];
- shared ->
- []
- end
- ++ [link, {priority, max}]),
+ [{fullsweep_after,0}, {min_heap_size,1000},
+ link, {priority, max}]),
?line receive
{P1, PV1} ->
?line Node = node(P1),
@@ -309,10 +296,7 @@ spawn_opt3(Config) when is_list(Config) ->
end,
?line P2 = spawn_opt(Node,
fun() -> Parent ! {self(), fetch_proc_vals(self())} end,
- case heap_type() of
- separate -> [{min_heap_size, 10}];
- shared -> []
- end),
+ [{min_heap_size, 10}]),
?line receive
{P2, PV2} ->
?line Node = node(P2),
@@ -333,13 +317,8 @@ spawn_opt4(Config) when is_list(Config) ->
[fun() ->
Parent ! {self(), fetch_proc_vals(self())}
end],
- case heap_type() of
- separate ->
- [{fullsweep_after,0}, {min_heap_size,1000}];
- shared ->
- []
- end
- ++ [link, {priority, max}]),
+ [{fullsweep_after,0}, {min_heap_size,1000},
+ link, {priority, max}]),
?line receive
{P1, PV1} ->
?line Node = node(P1),
@@ -350,10 +329,7 @@ spawn_opt4(Config) when is_list(Config) ->
[fun() ->
Parent ! {self(), fetch_proc_vals(self())}
end],
- case heap_type() of
- separate -> [{min_heap_size, 10}];
- shared -> []
- end),
+ [{min_heap_size, 10}]),
?line receive
{P2, PV2} ->
?line Node = node(P2),
@@ -374,13 +350,8 @@ spawn_opt5(Config) when is_list(Config) ->
[fun() ->
Parent ! {self(), fetch_proc_vals(self())}
end],
- case heap_type() of
- separate ->
- [{fullsweep_after,0}, {min_heap_size,1000}];
- shared ->
- []
- end
- ++ [link, {priority, max}]),
+ [{fullsweep_after,0}, {min_heap_size,1000},
+ link, {priority, max}]),
?line receive
{P1, PV1} ->
?line Node = node(P1),
@@ -392,10 +363,7 @@ spawn_opt5(Config) when is_list(Config) ->
[fun() ->
Parent ! {self(), fetch_proc_vals(self())}
end],
- case heap_type() of
- separate -> [{min_heap_size, 10}];
- shared -> []
- end),
+ [{min_heap_size, 10}]),
?line receive
{P2, PV2} ->
?line Node = node(P2),
@@ -532,34 +500,19 @@ spawn_failures(Config) when is_list(Config) ->
check_proc_vals(Link, Priority, FullsweepAfter, MinHeapSize, {Ls, P, FA, HS}) ->
?line Link = lists:member(self(), Ls),
?line Priority = P,
- ?line case heap_type() of
- separate ->
- ?line FullsweepAfter = FA,
- ?line true = (HS >= MinHeapSize);
- shared ->
- ?line ok
- end,
+ FullsweepAfter = FA,
+ true = (HS >= MinHeapSize),
?line ok.
fetch_proc_vals(Pid) ->
?line PI = process_info(Pid),
?line {value,{links, Ls}} = lists:keysearch(links, 1, PI),
?line {value,{priority,P}} = lists:keysearch(priority, 1, PI),
- ?line {FA, HS}
- = case heap_type() of
- separate ->
- ?line {value,
- {garbage_collection,
- Gs}} = lists:keysearch(garbage_collection, 1, PI),
- ?line {value,
- {fullsweep_after,
- Fa}} = lists:keysearch(fullsweep_after, 1, Gs),
- ?line {value,
- {heap_size,Hs}} = lists:keysearch(heap_size, 1, PI),
- ?line {Fa, Hs};
- shared ->
- {undefined, undefined}
- end,
+ {value,{garbage_collection,Gs}} =
+ lists:keysearch(garbage_collection, 1, PI),
+ {value,{fullsweep_after,FA}} =
+ lists:keysearch(fullsweep_after, 1, Gs),
+ {value,{heap_size,HS}} = lists:keysearch(heap_size, 1, PI),
?line {Ls, P, FA, HS}.
% This testcase should probably be moved somewhere else
@@ -650,12 +603,3 @@ stop_node(Node) ->
run_fun(Fun) ->
Fun().
-
-heap_type() ->
- case catch erlang:system_info(heap_type) of
- shared -> shared;
- unified -> shared;
- _ -> separate
- end.
-
-
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl
index 99b0cd2ffb..5e0300639e 100644
--- a/lib/kernel/test/code_SUITE.erl
+++ b/lib/kernel/test/code_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -25,6 +25,7 @@
replace_path/1, load_file/1, load_abs/1, ensure_loaded/1,
delete/1, purge/1, soft_purge/1, is_loaded/1, all_loaded/1,
load_binary/1, dir_req/1, object_code/1, set_path_file/1,
+ upgrade/1,
sticky_dir/1, pa_pz_option/1, add_del_path/1,
dir_disappeared/1, ext_mod_dep/1, clash/1,
load_cached/1, start_node_with_cache/1, add_and_rehash/1,
@@ -43,6 +44,8 @@
handle_event/2, handle_call/2, handle_info/2,
terminate/2]).
+-export([compile_load/4]).
+
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
@@ -50,6 +53,7 @@ all() ->
replace_path, load_file, load_abs, ensure_loaded,
delete, purge, soft_purge, is_loaded, all_loaded,
load_binary, dir_req, object_code, set_path_file,
+ upgrade,
pa_pz_option, add_del_path, dir_disappeared,
ext_mod_dep, clash, load_cached, start_node_with_cache,
add_and_rehash, where_is_file_no_cache,
@@ -450,6 +454,46 @@ load_binary(Config) when is_list(Config) ->
code:delete(code_b_test),
ok.
+upgrade(Config) ->
+ DataDir = ?config(data_dir, Config),
+
+ %%T = [beam, hipe],
+ T = [beam],
+
+ [upgrade_do(DataDir, Client, U1, U2, O1, O2)
+ || Client<-T, U1<-T, U2<-T, O1<-T, O2<-T],
+
+ ok.
+
+upgrade_do(DataDir, Client, U1, U2, O1, O2) ->
+ compile_load(upgrade_client, DataDir, undefined, Client),
+ upgrade_client:run(DataDir, U1, U2, O1, O2),
+ ok.
+
+compile_load(Mod, Dir, Ver, CodeType) ->
+ Version = case Ver of
+ undefined ->
+ io:format("Compiling '~p' as ~p\n", [Mod, CodeType]),
+ [];
+ _ ->
+ io:format("Compiling version ~p of '~p' as ~p\n",
+ [Ver, Mod, CodeType]),
+ [{d,list_to_atom("VERSION_" ++ integer_to_list(Ver))}]
+ end,
+ Target = case CodeType of
+ beam -> [];
+ hipe -> [native]
+ end,
+ CompOpts = [binary, report] ++ Target ++ Version,
+
+ Src = filename:join(Dir, atom_to_list(Mod) ++ ".erl"),
+ %io:format("compile:file(~p,~p)\n", [Src, CompOpts]),
+ {ok,Mod,Code} = compile:file(Src, CompOpts),
+ ObjFile = filename:basename(Src,".erl") ++ ".beam",
+ {module,Mod} = code:load_binary(Mod, ObjFile, Code),
+ %IsNative = code:is_module_native(Mod),
+ ok.
+
dir_req(suite) -> [];
dir_req(doc) -> [];
dir_req(Config) when is_list(Config) ->
@@ -501,7 +545,7 @@ sticky_dir(doc) -> ["Test that a module with the same name as a module in ",
"a sticky directory cannot be loaded."];
sticky_dir(Config) when is_list(Config) ->
MyDir=filename:dirname(code:which(?MODULE)),
- ?line {ok, Node}=?t:start_node(sticky_dir, slave,[{args, "-pa "++MyDir}]),
+ ?line {ok, Node}=?t:start_node(sticky_dir, slave,[{args, "-pa \""++MyDir++"\""}]),
File=filename:join([?config(data_dir, Config), "calendar"]),
?line Ret=rpc:call(Node, ?MODULE, sticky_compiler, [File]),
case Ret of
@@ -535,30 +579,25 @@ sticky_compiler(File) ->
pa_pz_option(suite) -> [];
pa_pz_option(doc) -> ["Test that the -pa and -pz options work as expected"];
pa_pz_option(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {comment, "Slave nodes not supported on VxWorks"};
- _ ->
- DDir = ?config(data_dir,Config),
- PaDir = filename:join(DDir,"pa"),
- PzDir = filename:join(DDir,"pz"),
- ?line {ok, Node}=?t:start_node(pa_pz1, slave,
- [{args,
- "-pa " ++ PaDir
- ++ " -pz " ++ PzDir}]),
- ?line Ret=rpc:call(Node, code, get_path, []),
- ?line [PaDir|Paths] = Ret,
- ?line [PzDir|_] = lists:reverse(Paths),
- ?t:stop_node(Node),
- ?line {ok, Node2}=?t:start_node(pa_pz2, slave,
- [{args,
- "-mode embedded " ++ "-pa "
- ++ PaDir ++ " -pz " ++ PzDir}]),
- ?line Ret2=rpc:call(Node2, code, get_path, []),
- ?line [PaDir|Paths2] = Ret2,
- ?line [PzDir|_] = lists:reverse(Paths2),
- ?t:stop_node(Node2)
- end.
+ DDir = ?config(data_dir,Config),
+ PaDir = filename:join(DDir,"pa"),
+ PzDir = filename:join(DDir,"pz"),
+ {ok, Node}=?t:start_node(pa_pz1, slave,
+ [{args,
+ "-pa " ++ PaDir
+ ++ " -pz " ++ PzDir}]),
+ Ret=rpc:call(Node, code, get_path, []),
+ [PaDir|Paths] = Ret,
+ [PzDir|_] = lists:reverse(Paths),
+ ?t:stop_node(Node),
+ {ok, Node2}=?t:start_node(pa_pz2, slave,
+ [{args,
+ "-mode embedded " ++ "-pa "
+ ++ PaDir ++ " -pz " ++ PzDir}]),
+ Ret2=rpc:call(Node2, code, get_path, []),
+ [PaDir|Paths2] = Ret2,
+ [PzDir|_] = lists:reverse(Paths2),
+ ?t:stop_node(Node2).
add_del_path(suite) ->
[];
@@ -822,7 +861,7 @@ load_cached(Config) when is_list(Config) ->
?line WD = filename:dirname(code:which(?MODULE)),
?line {ok,Node} =
?t:start_node(code_cache_node, peer, [{args,
- "-pa " ++ WD},
+ "-pa \"" ++ WD ++ "\""},
{erl, [this]}]),
CCTabCreated = fun(Tab) ->
case ets:info(Tab, name) of
@@ -907,7 +946,7 @@ add_and_rehash(Config) when is_list(Config) ->
?line WD = filename:dirname(code:which(?MODULE)),
?line {ok,Node} =
?t:start_node(code_cache_node, peer, [{args,
- "-pa " ++ WD},
+ "-pa \"" ++ WD ++ "\""},
{erl, [this]}]),
CCTabCreated = fun(Tab) ->
case ets:info(Tab, name) of
@@ -1441,6 +1480,9 @@ filter_app("netconf",_) ->
% Safe has the same kind of error in the .app file as ic
filter_app("safe",_) ->
false;
+% Comte cannot be started in the "usual" way
+filter_app("comte",_) ->
+ false;
% OS_mon does not find it's port program when running cerl
filter_app("os_mon",true) ->
false;
@@ -1547,7 +1589,8 @@ native_early_modules_1(Architecture) ->
true ->
?line true = lists:all(fun code:is_module_native/1,
[ets,file,filename,gb_sets,gb_trees,
- hipe_unified_loader,lists,os,packages]),
+ %%hipe_unified_loader, no_native as workaround
+ lists,os,packages]),
ok
end.
diff --git a/lib/kernel/test/code_SUITE_data/other.erl b/lib/kernel/test/code_SUITE_data/other.erl
new file mode 100644
index 0000000000..58ce87f222
--- /dev/null
+++ b/lib/kernel/test/code_SUITE_data/other.erl
@@ -0,0 +1,38 @@
+-module(other).
+
+-ifdef(VERSION_1).
+-define(VERSION,1).
+-export([exp1/0]).
+-export([exp1loc2/0]).
+-export([exp1exp2/0]).
+exp1() -> check([loc1(),exp1loc2(),exp1exp2(),loc1exp2(),loc1loc2()]).
+loc1() -> check([exp1loc2(),exp1exp2(),loc1exp2(),loc1loc2()]).
+exp1loc2() -> check([exp1exp2(),loc1exp2(),loc1loc2()]).
+exp1exp2() -> check([loc1exp2(),loc1loc2()]).
+loc1exp2() -> check([loc1loc2()]).
+-endif. % VERSION_1
+
+-ifdef(VERSION_2).
+-define(VERSION,2).
+-export([exp2/0]).
+-export([loc1exp2/0]).
+-export([exp1exp2/0]).
+loc1exp2() -> check([exp1exp2(),exp1loc2(),loc2(),exp2(),loc1loc2()]).
+exp1exp2() -> check([exp1loc2(),loc2(),exp2(),loc1loc2()]).
+exp1loc2() -> check([loc2(),exp2(),loc1loc2()]).
+loc2() -> check([exp2(),loc1loc2()]).
+exp2() -> check([loc1loc2()]).
+
+-endif. % VERSION_2
+
+loc1loc2() -> ?VERSION.
+
+
+check(VerList) ->
+ case lists:all(fun(?VERSION) -> true; (_) -> false end,
+ VerList) of
+ true ->
+ ?VERSION;
+ false ->
+ VerList
+ end.
diff --git a/lib/kernel/test/code_SUITE_data/upgrade_client.erl b/lib/kernel/test/code_SUITE_data/upgrade_client.erl
new file mode 100644
index 0000000000..bb655e01d3
--- /dev/null
+++ b/lib/kernel/test/code_SUITE_data/upgrade_client.erl
@@ -0,0 +1,259 @@
+-module(upgrade_client).
+
+-export([run/5]).
+
+%%-define(line, io:format("~s:~p\n", [?MODULE,?LINE]),).
+-define(line,).
+
+run(Dir, Upgradee1, Upgradee2, Other1, Other2) ->
+ %% Load version 1 of upgradee
+ code_SUITE:compile_load(upgradee, Dir, 1, Upgradee1),
+
+ ?line 1 = upgradee:exp1(),
+ ?line 1 = upgradee:exp1exp2(),
+ ?line 1 = upgradee:exp1loc2(),
+
+ ?line {'EXIT',{undef,_}} = (catch upgradee:loc1()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:exp2()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:loc2()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:loc1exp2()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:loc1loc2()),
+
+ P = spawn_link(upgradee,dispatch_loop,[]),
+
+ ?line 1 = proxy_call(P, local, exp1),
+ ?line 1 = proxy_call(P, local, loc1),
+ ?line 1 = proxy_call(P, local, exp1exp2),
+ ?line 1 = proxy_call(P, local, exp1loc2),
+ ?line 1 = proxy_call(P, local, loc1exp2),
+ ?line 1 = proxy_call(P, local, loc1loc2),
+ ?line 1 = proxy_call(P, external, exp1),
+ ?line 1 = proxy_call(P, external, exp1exp2),
+ ?line 1 = proxy_call(P, external, exp1loc2),
+
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, loc1),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, loc1exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, loc1loc2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, loc2),
+ ?line {cannot_compile,1} = proxy_call(P, local, exp2),
+ ?line {cannot_compile,1} = proxy_call(P, local, loc2),
+
+ ?line {'EXIT',{undef,_}} = (catch other:exp1()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc1()),
+ ?line {'EXIT',{undef,_}} = (catch other:exp1loc2()),
+ ?line {'EXIT',{undef,_}} = (catch other:exp1exp2()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc11exp2()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc1loc2()),
+ ?line {'EXIT',{undef,_}} = (catch other:exp2()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc2()),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, exp1),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, exp1loc2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, exp1exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc1exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc1loc2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc1),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc2),
+
+ %%
+ %% Load version 1 of other
+ %%
+ code_SUITE:compile_load(other, Dir, 1, Other1),
+ ?line 1 = other:exp1(),
+ ?line 1 = other:exp1loc2(),
+ ?line 1 = other:exp1exp2(),
+ ?line {'EXIT',{undef,_}} = (catch other:loc1()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc1exp2()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc1loc2()),
+ ?line {'EXIT',{undef,_}} = (catch other:exp2()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc2()),
+
+ ?line 1 = proxy_call(P, other, exp1),
+ ?line 1 = proxy_call(P, other, exp1loc2),
+ ?line 1 = proxy_call(P, other, exp1exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc1),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc1exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc1loc2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc2),
+
+ %%
+ %% Load version 2 of upgradee
+ %%
+ code_SUITE:compile_load(upgradee, Dir, 2, Upgradee2),
+
+ ?line 2 = upgradee:exp2(),
+ ?line 2 = upgradee:exp1exp2(),
+ ?line 2 = upgradee:loc1exp2(),
+
+ ?line {'EXIT',{undef,_}} = (catch upgradee:exp1()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:loc1()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:exp1loc2()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:loc1loc2()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:loc2()),
+
+ ?line 1 = proxy_call(P, local, exp1),
+ ?line 1 = proxy_call(P, local, loc1),
+ ?line 1 = proxy_call(P, local, exp1exp2),
+ ?line 1 = proxy_call(P, local, exp1loc2),
+ ?line 1 = proxy_call(P, local, loc1exp2),
+ ?line 1 = proxy_call(P, local, loc1loc2),
+ ?line {cannot_compile,1} = proxy_call(P, local, exp2),
+ ?line {cannot_compile,1} = proxy_call(P, local, loc2),
+
+ ?line 2 = proxy_call(P, external, exp1exp2),
+ ?line 2 = proxy_call(P, external, loc1exp2),
+ ?line 2 = proxy_call(P, external, exp2),
+
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, exp1),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, loc1),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, exp1loc2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, loc1loc2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, loc2),
+
+ ?line 1 = other:exp1(),
+ ?line 1 = other:exp1loc2(),
+ ?line 1 = other:exp1exp2(),
+ ?line {'EXIT',{undef,_}} = (catch other:loc1()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc1exp2()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc1loc2()),
+ ?line {'EXIT',{undef,_}} = (catch other:exp2()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc2()),
+
+ ?line 1 = proxy_call(P, other, exp1),
+ ?line 1 = proxy_call(P, other, exp1loc2),
+ ?line 1 = proxy_call(P, other, exp1exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc1),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc1exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc1loc2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc2),
+
+ %%
+ %% Load version 2 of other
+ %%
+ code_SUITE:compile_load(other, Dir, 2, Other2),
+
+ ?line 2 = upgradee:exp2(),
+ ?line 2 = upgradee:exp1exp2(),
+ ?line 2 = upgradee:loc1exp2(),
+
+ ?line {'EXIT',{undef,_}} = (catch upgradee:exp1()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:loc1()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:exp1loc2()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:loc1loc2()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:loc2()),
+
+ ?line 1 = proxy_call(P, local, exp1),
+ ?line 1 = proxy_call(P, local, loc1),
+ ?line 1 = proxy_call(P, local, exp1exp2),
+ ?line 1 = proxy_call(P, local, exp1loc2),
+ ?line 1 = proxy_call(P, local, loc1exp2),
+ ?line 1 = proxy_call(P, local, loc1loc2),
+ ?line {cannot_compile,1} = proxy_call(P, local, exp2),
+ ?line {cannot_compile,1} = proxy_call(P, local, loc2),
+
+ ?line 2 = proxy_call(P, external, exp1exp2),
+ ?line 2 = proxy_call(P, external, loc1exp2),
+ ?line 2 = proxy_call(P, external, exp2),
+
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, exp1),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, loc1),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, exp1loc2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, loc1loc2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, loc2),
+
+ ?line 2 = other:exp2(),
+ ?line 2 = other:loc1exp2(),
+ ?line 2 = other:exp1exp2(),
+ ?line {'EXIT',{undef,_}} = (catch other:exp1()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc1()),
+ ?line {'EXIT',{undef,_}} = (catch other:exp1loc2()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc1loc2()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc2()),
+
+ ?line 2 = proxy_call(P, other, exp2),
+ ?line 2 = proxy_call(P, other, loc1exp2),
+ ?line 2 = proxy_call(P, other, exp1exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, exp1),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc1),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, exp1loc2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc1loc2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc2),
+
+
+ %%
+ %% Upgrade proxy to version 2
+ %%
+ P ! upgrade_order,
+
+
+ %%
+ io:format("Delete version 2 of 'upgradee'\n",[]),
+ %%
+ code:purge(upgradee),
+ code:delete(upgradee),
+
+ ?line {'EXIT',{undef,_}} = (catch upgradee:exp2()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:exp1exp2()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:loc1exp2()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:exp1()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:loc1()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:exp1loc2()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:loc1loc2()),
+ ?line {'EXIT',{undef,_}} = (catch upgradee:loc2()),
+
+ ?line 2 = proxy_call(P, local, exp2),
+ ?line 2 = proxy_call(P, local, loc2),
+ ?line 2 = proxy_call(P, local, exp1exp2),
+ ?line 2 = proxy_call(P, local, exp1loc2),
+ ?line 2 = proxy_call(P, local, loc1exp2),
+ ?line 2 = proxy_call(P, local, loc1loc2),
+ ?line {cannot_compile,2} = proxy_call(P, local, exp1),
+ ?line {cannot_compile,2} = proxy_call(P, local, loc1),
+
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, exp1exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, loc1exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, exp1),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, loc1),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, exp1loc2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, loc1loc2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, external, loc2),
+
+ ?line 2 = other:exp2(),
+ ?line 2 = other:loc1exp2(),
+ ?line 2 = other:exp1exp2(),
+ ?line {'EXIT',{undef,_}} = (catch other:exp1()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc1()),
+ ?line {'EXIT',{undef,_}} = (catch other:exp1loc2()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc1loc2()),
+ ?line {'EXIT',{undef,_}} = (catch other:loc2()),
+
+ ?line 2 = proxy_call(P, other, exp2),
+ ?line 2 = proxy_call(P, other, loc1exp2),
+ ?line 2 = proxy_call(P, other, exp1exp2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, exp1),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc1),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, exp1loc2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc1loc2),
+ ?line {'EXIT',{undef,_}} = proxy_call(P, other, loc2),
+
+ unlink(P),
+ exit(P, die_please),
+
+ io:format("Purge 'upgradee'\n",[]),
+ code:purge(upgradee),
+
+ io:format("Delete and purge 'other'\n",[]),
+ code:purge(other),
+ code:delete(other),
+ code:purge(other),
+ ok.
+
+proxy_call(Pid, CallType, Func) ->
+ Pid ! {self(), CallType, Func},
+ receive
+ {Pid, call_result, Func, Ret} -> Ret
+ end.
diff --git a/lib/kernel/test/code_SUITE_data/upgradee.erl b/lib/kernel/test/code_SUITE_data/upgradee.erl
new file mode 100644
index 0000000000..62b1d95e30
--- /dev/null
+++ b/lib/kernel/test/code_SUITE_data/upgradee.erl
@@ -0,0 +1,123 @@
+-module(upgradee).
+
+-export([dispatch_loop/0]).
+
+-ifdef(VERSION_1).
+-define(VERSION,1).
+
+-export([exp1/0]). % only exported in v1
+-export([exp1loc2/0]). % exported in v1, local in v2
+-export([exp1exp2/0]). % exported in v1 and v2
+
+exp1() -> ?VERSION.
+loc1() -> ?VERSION.
+
+-endif. % VERSION_1
+
+-ifdef(VERSION_2).
+-define(VERSION,2).
+
+-export([exp2/0]).
+-export([loc1exp2/0]).
+-export([exp1exp2/0]).
+
+exp2() -> ?VERSION.
+loc2() -> ?VERSION.
+
+-endif. % VERSION_2
+
+exp1exp2() -> ?VERSION.
+exp1loc2() -> ?VERSION.
+loc1exp2() -> ?VERSION.
+loc1loc2() -> ?VERSION.
+
+dispatch_loop() ->
+ receive
+ upgrade_order ->
+ %%erlang:display({"upgradee version", ?VERSION, "got upgrade_order"}),
+ ?MODULE:dispatch_loop();
+
+ Msg ->
+ %%erlang:display({"upgradee version", ?VERSION, "got msg", Msg}),
+ {Func,Ret} = case Msg of
+ %% Local calls
+ {Pid, local, F=exp1} ->
+ {F, local_exp1()};
+ {Pid, local, F=loc1} ->
+ {F, local_loc1()};
+ {Pid, local, F=exp1exp2} ->
+ {F, catch exp1exp2()};
+ {Pid, local, F=exp1loc2} ->
+ {F, catch exp1loc2()};
+ {Pid, local, F=loc1exp2} ->
+ {F, catch loc1exp2()};
+ {Pid, local, F=loc1loc2} ->
+ {F, catch loc1loc2()};
+ {Pid, local, F=exp2} ->
+ {F, local_exp2()};
+ {Pid, local, F=loc2} ->
+ {F, local_loc2()};
+
+ %% Extern calls to own module
+ {Pid, external, F=exp1} ->
+ {F, catch ?MODULE:exp1()};
+ {Pid, external, F=loc1} ->
+ {F, catch ?MODULE:loc1()};
+ {Pid, external, F=exp1exp2} ->
+ {F, catch ?MODULE:exp1exp2()};
+ {Pid, external, F=exp1loc2} ->
+ {F, catch ?MODULE:exp1loc2()};
+ {Pid, external, F=loc1exp2} ->
+ {F, catch ?MODULE:loc1exp2()};
+ {Pid, external, F=loc1loc2} ->
+ {F, catch ?MODULE:loc1loc2()};
+ {Pid, external, F=exp2} ->
+ {F, catch ?MODULE:exp2()};
+ {Pid, external, F=loc2} ->
+ {F, catch ?MODULE:loc2()};
+
+ %% External calls to other module
+ {Pid, other, F=exp1} ->
+ {F, catch other:exp1()};
+ {Pid, other, F=loc1} ->
+ {F, catch other:loc1()};
+ {Pid, other, F=exp1exp2} ->
+ {F, catch other:exp1exp2()};
+ {Pid, other, F=exp1loc2} ->
+ {F, catch other:exp1loc2()};
+ {Pid, other, F=loc1exp2} ->
+ {F, catch other:loc1exp2()};
+ {Pid, other, F=loc1loc2} ->
+ {F, catch other:loc1loc2()};
+ {Pid, other, F=exp2} ->
+ {F, catch other:exp2()};
+ {Pid, other, F=loc2} ->
+ {F, catch other:loc2()}
+ end,
+ Pid ! {self(), call_result, Func, Ret},
+
+ dispatch_loop() % A local call, we don't want to upgrade the dispatcher
+ end.
+
+
+
+-ifdef(VERSION_1).
+local_exp1() -> catch exp1().
+local_loc1() -> catch loc1().
+-else.
+local_exp1() ->
+ %%erlang:display({"upgradee:local_exp1 in version", ?VERSION}),
+ {cannot_compile,?VERSION}.
+local_loc1() -> {cannot_compile,?VERSION}.
+-endif.
+
+-ifdef(VERSION_2).
+local_exp2() -> catch exp2().
+local_loc2() -> catch loc2().
+-else.
+local_exp2() ->
+ %%erlang:display({"upgradee:local_exp2 in version", ?VERSION}),
+ {cannot_compile,?VERSION}.
+local_loc2() ->
+ {cannot_compile,?VERSION}.
+-endif.
diff --git a/lib/kernel/test/disk_log_SUITE.erl b/lib/kernel/test/disk_log_SUITE.erl
index ad987fe7a7..0f811b8f73 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -90,7 +90,7 @@
evil/1,
- otp_6278/1]).
+ otp_6278/1, otp_10131/1]).
-export([head_fun/1, hf/0, lserv/1,
measure/0, init_m/1, xx/0, head_exit/0, slow_header/1]).
@@ -124,12 +124,7 @@
[halt_int, wrap_int, halt_ext, wrap_ext, read_mode, head,
notif, new_idx_vsn, reopen, block, unblock, open, close,
error, chunk, truncate, many_users, info, change_size,
- change_attribute, distribution, evil, otp_6278]).
-
-%% The following two lists should be mutually exclusive. To skip a case
-%% on VxWorks altogether, use the kernel.spec.vxworks file instead.
-%% PLEASE don't skip out of laziness, the goal is to make every
-%% testcase runnable on VxWorks.
+ change_attribute, distribution, evil, otp_6278, otp_10131]).
%% These test cases should be skipped if the VxWorks card is
%% configured without NFS cache.
@@ -153,7 +148,7 @@ all() ->
{group, open}, {group, close}, {group, error}, chunk,
truncate, many_users, {group, info},
{group, change_size}, change_attribute,
- {group, distribution}, evil, otp_6278].
+ {group, distribution}, evil, otp_6278, otp_10131].
groups() ->
[{halt_int, [], [halt_int_inf, {group, halt_int_sz}]},
@@ -4915,6 +4910,22 @@ otp_6278(Conf) when is_list(Conf) ->
end,
?line error_logger:delete_report_handler(?MODULE).
+otp_10131(suite) -> [];
+otp_10131(doc) -> ["OTP-10131. head_func type."];
+otp_10131(Conf) when is_list(Conf) ->
+ Dir = ?privdir(Conf),
+ Log = otp_10131,
+ File = filename:join(Dir, lists:concat([Log, ".LOG"])),
+ HeadFunc = {?MODULE, head_fun, [{ok,"head"}]},
+ {ok, Log} = disk_log:open([{name,Log},{file,File},
+ {head_func, HeadFunc}]),
+ HeadFunc = info(Log, head, undef),
+ HeadFunc2 = {?MODULE, head_fun, [{ok,"head2"}]},
+ ok = disk_log:change_header(Log, {head_func, HeadFunc2}),
+ HeadFunc2 = info(Log, head, undef),
+ ok = disk_log:close(Log),
+ ok.
+
mark(FileName, What) ->
{ok,Fd} = file:open(FileName, [raw, binary, read, write]),
{ok,_} = file:position(Fd, 4),
@@ -5110,33 +5121,8 @@ stop_node(Node) ->
%% If the board is configured without NFS, the port program will fail to load
%% and this will return 0, which may or may not be the wrong thing to do.
-check_nfs(Config) ->
- case (catch check_cache(Config)) of
- N when is_integer(N) ->
- N;
- _ ->
- 0
- end.
-
-check_cache(Config) ->
- ?line Check = filename:join(?datadir(Config), "nfs_check"),
- ?line P = open_port({spawn, Check}, [{line,100}, eof]),
- ?line Size = receive
- {P,{data,{eol,S}}} ->
- list_to_integer(S)
- after 1000 ->
- erlang:display(got_timeout),
- exit(timeout)
- end,
- ?line receive
- {P, eof} ->
- ok
- end,
- ?line P ! {self(), close},
- ?line receive
- {P, closed} -> ok
- end,
- Size.
+check_nfs(_Config) ->
+ 0.
skip_expand([]) ->
[];
@@ -5159,13 +5145,8 @@ skip_list(Config) ->
skip_expand(?SKIP_LARGE_CACHE)
end.
-should_skip(Test,Config) ->
- case os:type() of
- vxworks ->
- lists:member(Test, skip_list(Config));
- _ ->
- false
- end.
+should_skip(_Test,_Config) ->
+ false.
%%-----------------------------------------------------------------
%% The error_logger handler used.
diff --git a/lib/kernel/test/disk_log_SUITE_data/Makefile.src b/lib/kernel/test/disk_log_SUITE_data/Makefile.src
deleted file mode 100644
index cae2f23d29..0000000000
--- a/lib/kernel/test/disk_log_SUITE_data/Makefile.src
+++ /dev/null
@@ -1,15 +0,0 @@
-CC = @CC@
-LD = @LD@
-CFLAGS = @CFLAGS@ -I@erl_include@ @DEFS@
-CROSSLDFLAGS = @CROSSLDFLAGS@
-
-PROGS = nfs_check@exe@
-
-all: $(PROGS)
-
-nfs_check@exe@: nfs_check@obj@
- $(LD) $(CROSSLDFLAGS) -o nfs_check nfs_check@obj@ @LIBS@
-
-nfs_check@obj@: nfs_check.c
- $(CC) -c -o nfs_check@obj@ $(CFLAGS) nfs_check.c
-
diff --git a/lib/kernel/test/disk_log_SUITE_data/nfs_check.c b/lib/kernel/test/disk_log_SUITE_data/nfs_check.c
deleted file mode 100644
index 31e9ba8190..0000000000
--- a/lib/kernel/test/disk_log_SUITE_data/nfs_check.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Author: Patrik Nyblom
- * Purpose: A port program to check the NFS cache size on VxWorks (returns 0
- * for other platforms).
- */
-
-#ifdef VXWORKS
-#include <vxWorks.h>
-#include <taskVarLib.h>
-#include <taskLib.h>
-#include <sysLib.h>
-#include <string.h>
-#include <ioLib.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#ifdef VXWORKS
-extern unsigned nfsCacheSize;
-#define MAIN(argc, argv) nfs_check(argc, argv)
-#else
-#define MAIN(argc, argv) main(argc, argv)
-#endif
-
-
-MAIN(argc, argv)
-int argc;
-char *argv[];
-{
-#ifdef VXWORKS
- char str[100];
- sprintf(str,"%d\n", nfsCacheSize);
- write(1, str, strlen(str));
-#else
- fprintf(stdout,"0");
- fflush(stdout);
-#endif
- return 0;
-}
-
diff --git a/lib/kernel/test/erl_prim_loader_SUITE.erl b/lib/kernel/test/erl_prim_loader_SUITE.erl
index d0d52c5ea7..35502a1d27 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -110,56 +110,46 @@ get_file(Config) when is_list(Config) ->
inet_existing(doc) -> ["Start a node using the 'inet' loading method, ",
"from an already started boot server."];
inet_existing(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {comment, "VxWorks: tested separately"};
- _ ->
- ?line Name = erl_prim_test_inet_existing,
- ?line Host = host(),
- ?line Cookie = atom_to_list(erlang:get_cookie()),
- ?line IpStr = ip_str(Host),
- ?line LFlag = get_loader_flag(os:type()),
- ?line Args = LFlag ++ " -hosts " ++ IpStr ++
- " -setcookie " ++ Cookie,
- ?line {ok, BootPid} = erl_boot_server:start_link([Host]),
- ?line {ok, Node} = start_node(Name, Args),
- ?line {ok,[["inet"]]} = rpc:call(Node, init, get_argument, [loader]),
- ?line stop_node(Node),
- ?line unlink(BootPid),
- ?line exit(BootPid, kill),
- ok
- end.
+ Name = erl_prim_test_inet_existing,
+ Host = host(),
+ Cookie = atom_to_list(erlang:get_cookie()),
+ IpStr = ip_str(Host),
+ LFlag = get_loader_flag(os:type()),
+ Args = LFlag ++ " -hosts " ++ IpStr ++
+ " -setcookie " ++ Cookie,
+ {ok, BootPid} = erl_boot_server:start_link([Host]),
+ {ok, Node} = start_node(Name, Args),
+ {ok,[["inet"]]} = rpc:call(Node, init, get_argument, [loader]),
+ stop_node(Node),
+ unlink(BootPid),
+ exit(BootPid, kill),
+ ok.
inet_coming_up(doc) -> ["Start a node using the 'inet' loading method, ",
"but start the boot server afterwards."];
inet_coming_up(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {comment, "VxWorks: tested separately"};
- _ ->
- ?line Name = erl_prim_test_inet_coming_up,
- ?line Cookie = atom_to_list(erlang:get_cookie()),
- ?line Host = host(),
- ?line IpStr = ip_str(Host),
- ?line LFlag = get_loader_flag(os:type()),
- ?line Args = LFlag ++
- " -hosts " ++ IpStr ++
- " -setcookie " ++ Cookie,
- ?line {ok, Node} = start_node(Name, Args, [{wait, false}]),
-
- %% Wait a while, then start boot server, and wait for node to start.
- ?line test_server:sleep(test_server:seconds(6)),
- io:format("erl_boot_server:start_link([~p]).", [Host]),
- ?line {ok, BootPid} = erl_boot_server:start_link([Host]),
- ?line wait_really_started(Node, 25),
-
- %% Check loader argument, then cleanup.
- ?line {ok,[["inet"]]} = rpc:call(Node, init, get_argument, [loader]),
- ?line stop_node(Node),
- ?line unlink(BootPid),
- ?line exit(BootPid, kill),
- ok
- end.
+ Name = erl_prim_test_inet_coming_up,
+ Cookie = atom_to_list(erlang:get_cookie()),
+ Host = host(),
+ IpStr = ip_str(Host),
+ LFlag = get_loader_flag(os:type()),
+ Args = LFlag ++
+ " -hosts " ++ IpStr ++
+ " -setcookie " ++ Cookie,
+ {ok, Node} = start_node(Name, Args, [{wait, false}]),
+
+ %% Wait a while, then start boot server, and wait for node to start.
+ test_server:sleep(test_server:seconds(6)),
+ io:format("erl_boot_server:start_link([~p]).", [Host]),
+ {ok, BootPid} = erl_boot_server:start_link([Host]),
+ wait_really_started(Node, 25),
+
+ %% Check loader argument, then cleanup.
+ {ok,[["inet"]]} = rpc:call(Node, init, get_argument, [loader]),
+ stop_node(Node),
+ unlink(BootPid),
+ exit(BootPid, kill),
+ ok.
wait_really_started(Node, 0) ->
test_server:fail({not_booted,Node});
@@ -249,8 +239,6 @@ multiple_slaves(doc) ->
"verify that the boot server manages"];
multiple_slaves(Config) when is_list(Config) ->
case os:type() of
- vxworks ->
- {comment, "VxWorks: tested separately"};
{ose,_} ->
{comment, "OSE: multiple nodes not supported"};
_ ->
@@ -426,7 +414,9 @@ primary_archive(Config) when is_list(Config) ->
ExpectedEbins = [Archive, DictDir ++ "/ebin", DummyDir ++ "/ebin"],
io:format("ExpectedEbins: ~p\n", [ExpectedEbins]),
?line {ok, FileInfo} = prim_file:read_file_info(Archive),
- ?line {ok, Ebins} = rpc:call(Node, erl_prim_loader, set_primary_archive, [Archive, ArchiveBin, FileInfo]),
+ ?line {ok, Ebins} = rpc:call(Node, erl_prim_loader, set_primary_archive,
+ [Archive, ArchiveBin, FileInfo,
+ fun escript:parse_file/1]),
?line ExpectedEbins = lists:sort(Ebins), % assert
?line {ok, TopFiles2} = rpc:call(Node, erl_prim_loader, list_dir, [Archive]),
@@ -435,7 +425,9 @@ primary_archive(Config) when is_list(Config) ->
?line ok = test_archive(Node, Archive, DictDir, BeamName),
%% Cleanup
- ?line {ok, []} = rpc:call(Node, erl_prim_loader, set_primary_archive, [undefined, undefined, undefined]),
+ ?line {ok, []} = rpc:call(Node, erl_prim_loader, set_primary_archive,
+ [undefined, undefined, undefined,
+ fun escript:parse_file/1]),
?line stop_node(Node),
?line ok = file:delete(Archive),
ok.
diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl
index 2b6af7e1fb..9c507fd437 100644
--- a/lib/kernel/test/file_SUITE.erl
+++ b/lib/kernel/test/file_SUITE.erl
@@ -492,8 +492,6 @@ cur_dir_1(Config) when is_list(Config) ->
?line case os:type() of
{unix, _} ->
?line {error, enotsup} = ?FILE_MODULE:get_cwd("d:");
- vxworks ->
- ?line {error, enotsup} = ?FILE_MODULE:get_cwd("d:");
{win32, _} ->
win_cur_dir_1(Config)
end,
@@ -1038,32 +1036,29 @@ file_info_basic_file(Config) when is_list(Config) ->
file_info_basic_directory(suite) -> [];
file_info_basic_directory(doc) -> [];
file_info_basic_directory(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(5)),
+ Dog = test_server:timetrap(test_server:seconds(5)),
%% Note: filename:join/1 removes any trailing slash,
%% which is essential for ?FILE_MODULE:file_info/1 to work on
%% platforms such as Windows95.
- ?line RootDir = filename:join([?config(priv_dir, Config)]),
+ RootDir = filename:join([?config(priv_dir, Config)]),
%% Test that the RootDir directory has the expected attributes.
- ?line test_directory(RootDir, read_write),
+ test_directory(RootDir, read_write),
%% Note that on Windows file systems,
%% "/" or "c:/" are *NOT* directories.
%% Therefore, test that ?FILE_MODULE:file_info/1 behaves as if they were
%% directories.
- ?line case os:type() of
- {win32, _} ->
- ?line test_directory("/", read_write),
- ?line test_directory("c:/", read_write),
- ?line test_directory("c:\\", read_write);
- {unix, _} ->
- ?line test_directory("/", read);
- vxworks ->
- %% Check is just done for owner
- ?line test_directory("/", read_write)
- end,
- ?line test_server:timetrap_cancel(Dog).
+ case os:type() of
+ {win32, _} ->
+ ?line test_directory("/", read_write),
+ ?line test_directory("c:/", read_write),
+ ?line test_directory("c:\\", read_write);
+ {unix, _} ->
+ ?line test_directory("/", read)
+ end,
+ test_server:timetrap_cancel(Dog).
test_directory(Name, ExpectedAccess) ->
?line {ok,#file_info{size=Size,type=Type,access=Access,
@@ -1784,9 +1779,7 @@ e_delete(Config) when is_list(Config) ->
Base, #file_info {mode=8#600});
{win32, _} ->
%% Remove a character device.
- ?line {error, eacces} = ?FILE_MODULE:delete("nul");
- vxworks ->
- ok
+ ?line {error, eacces} = ?FILE_MODULE:delete("nul")
end,
?line [] = flush(),
@@ -1801,148 +1794,133 @@ e_delete(Config) when is_list(Config) ->
e_rename(suite) -> [];
e_rename(doc) -> [];
e_rename(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {comment, "Windriver: dosFs must be fixed first!"};
- _ ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line Base = filename:join(RootDir,
- atom_to_list(?MODULE)++"_e_rename"),
- ?line ok = ?FILE_MODULE:make_dir(Base),
-
- %% Create an empty directory.
- ?line EmptyDir = filename:join(Base, "empty_dir"),
- ?line ok = ?FILE_MODULE:make_dir(EmptyDir),
-
- %% Create a non-empty directory.
- ?line NonEmptyDir = filename:join(Base, "non_empty_dir"),
- ?line ok = ?FILE_MODULE:make_dir(NonEmptyDir),
- ?line ok = ?FILE_MODULE:write_file(
- filename:join(NonEmptyDir, "a_file"),
- "hello\n"),
-
- %% Create another non-empty directory.
- ?line ADirectory = filename:join(Base, "a_directory"),
- ?line ok = ?FILE_MODULE:make_dir(ADirectory),
- ?line ok = ?FILE_MODULE:write_file(
- filename:join(ADirectory, "a_file"),
- "howdy\n\n"),
-
- %% Create a data file.
- ?line File = filename:join(Base, "just_a_file"),
- ?line ok = ?FILE_MODULE:write_file(File, "anything goes\n\n"),
-
- %% Move an existing directory to a non-empty directory.
- ?line {error, eexist} =
- ?FILE_MODULE:rename(ADirectory, NonEmptyDir),
-
- %% Move a root directory.
- ?line {error, einval} = ?FILE_MODULE:rename("/", "arne"),
-
- %% Move Base into Base/new_name.
- ?line {error, einval} =
- ?FILE_MODULE:rename(Base, filename:join(Base, "new_name")),
-
- %% Overwrite a directory with a file.
- ?line expect({error, eexist}, %FreeBSD (?)
- {error, eisdir},
- ?FILE_MODULE:rename(File, EmptyDir)),
- ?line expect({error, eexist}, %FreeBSD (?)
- {error, eisdir},
- ?FILE_MODULE:rename(File, NonEmptyDir)),
-
- %% Move a non-existing file.
- ?line NonExistingFile =
- filename:join(Base, "non_existing_file"),
- ?line {error, enoent} =
- ?FILE_MODULE:rename(NonExistingFile, NonEmptyDir),
-
- %% Overwrite a file with a directory.
- ?line expect({error, eexist}, %FreeBSD (?)
- {error, enotdir},
- ?FILE_MODULE:rename(ADirectory, File)),
-
- %% Move a file to another filesystem.
- %% XXX - This test case is bogus. We cannot be guaranteed that
- %% the source and destination are on
- %% different filesystems.
- %%
- %% XXX - Gross hack!
- ?line Comment =
- case os:type() of
- {unix, _} ->
- OtherFs = "/tmp",
- ?line NameOnOtherFs =
- filename:join(OtherFs, filename:basename(File)),
- ?line {ok, Com} =
- case ?FILE_MODULE:rename(File, NameOnOtherFs) of
- {error, exdev} ->
- %% The file could be in
- %% the same filesystem!
- {ok, ok};
- ok ->
- {ok, {comment,
- "Moving between filesystems "
- "suceeded, files are probably "
- "in the same filesystem!"}};
- {error, eperm} ->
- {ok, {comment, "SBS! You don't "
- "have the permission to do "
- "this test!"}};
- Else ->
- Else
- end,
- Com;
- {win32, _} ->
- %% At least Windows NT can
- %% successfully move a file to
- %% another drive.
- ok
- end,
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
- Comment
- end.
+ Dog = test_server:timetrap(test_server:seconds(10)),
+ RootDir = ?config(priv_dir, Config),
+ Base = filename:join(RootDir,
+ atom_to_list(?MODULE)++"_e_rename"),
+ ok = ?FILE_MODULE:make_dir(Base),
+
+ %% Create an empty directory.
+ EmptyDir = filename:join(Base, "empty_dir"),
+ ok = ?FILE_MODULE:make_dir(EmptyDir),
+
+ %% Create a non-empty directory.
+ NonEmptyDir = filename:join(Base, "non_empty_dir"),
+ ok = ?FILE_MODULE:make_dir(NonEmptyDir),
+ ok = ?FILE_MODULE:write_file(
+ filename:join(NonEmptyDir, "a_file"),
+ "hello\n"),
+
+ %% Create another non-empty directory.
+ ADirectory = filename:join(Base, "a_directory"),
+ ok = ?FILE_MODULE:make_dir(ADirectory),
+ ok = ?FILE_MODULE:write_file(
+ filename:join(ADirectory, "a_file"),
+ "howdy\n\n"),
+
+ %% Create a data file.
+ File = filename:join(Base, "just_a_file"),
+ ok = ?FILE_MODULE:write_file(File, "anything goes\n\n"),
+
+ %% Move an existing directory to a non-empty directory.
+ {error, eexist} = ?FILE_MODULE:rename(ADirectory, NonEmptyDir),
+
+ %% Move a root directory.
+ {error, einval} = ?FILE_MODULE:rename("/", "arne"),
+
+ %% Move Base into Base/new_name.
+ {error, einval} =
+ ?FILE_MODULE:rename(Base, filename:join(Base, "new_name")),
+
+ %% Overwrite a directory with a file.
+ expect({error, eexist}, %FreeBSD (?)
+ {error, eisdir},
+ ?FILE_MODULE:rename(File, EmptyDir)),
+ expect({error, eexist}, %FreeBSD (?)
+ {error, eisdir},
+ ?FILE_MODULE:rename(File, NonEmptyDir)),
+
+ %% Move a non-existing file.
+ NonExistingFile = filename:join(Base, "non_existing_file"),
+ {error, enoent} = ?FILE_MODULE:rename(NonExistingFile, NonEmptyDir),
+
+ %% Overwrite a file with a directory.
+ expect({error, eexist}, %FreeBSD (?)
+ {error, enotdir},
+ ?FILE_MODULE:rename(ADirectory, File)),
+
+ %% Move a file to another filesystem.
+ %% XXX - This test case is bogus. We cannot be guaranteed that
+ %% the source and destination are on
+ %% different filesystems.
+ %%
+ %% XXX - Gross hack!
+ Comment = case os:type() of
+ {unix, _} ->
+ OtherFs = "/tmp",
+ NameOnOtherFs = filename:join(OtherFs, filename:basename(File)),
+ {ok, Com} = case ?FILE_MODULE:rename(File, NameOnOtherFs) of
+ {error, exdev} ->
+ %% The file could be in
+ %% the same filesystem!
+ {ok, ok};
+ ok ->
+ {ok, {comment,
+ "Moving between filesystems "
+ "suceeded, files are probably "
+ "in the same filesystem!"}};
+ {error, eperm} ->
+ {ok, {comment, "SBS! You don't "
+ "have the permission to do "
+ "this test!"}};
+ Else ->
+ Else
+ end,
+ Com;
+ {win32, _} ->
+ %% At least Windows NT can
+ %% successfully move a file to
+ %% another drive.
+ ok
+ end,
+ [] = flush(),
+ test_server:timetrap_cancel(Dog),
+ Comment.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
e_make_dir(suite) -> [];
e_make_dir(doc) -> [];
e_make_dir(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line Base = filename:join(RootDir,
- atom_to_list(?MODULE)++"_e_make_dir"),
- ?line ok = ?FILE_MODULE:make_dir(Base),
+ Dog = test_server:timetrap(test_server:seconds(10)),
+ RootDir = ?config(priv_dir, Config),
+ Base = filename:join(RootDir,
+ atom_to_list(?MODULE)++"_e_make_dir"),
+ ok = ?FILE_MODULE:make_dir(Base),
%% A component of the path does not exist.
- ?line {error, enoent} =
- ?FILE_MODULE:make_dir(filename:join([Base, "a", "b"])),
+ {error, enoent} = ?FILE_MODULE:make_dir(filename:join([Base, "a", "b"])),
%% Use a path-name with a non-directory component.
- ?line Afile = filename:join(Base, "a_directory"),
- ?line ok = ?FILE_MODULE:write_file(Afile, "hello\n"),
- ?line case ?FILE_MODULE:make_dir(
- filename:join(Afile, "another_directory")) of
- {error, enotdir} -> io:format("Result: enotdir");
- {error, enoent} -> io:format("Result: enoent")
- end,
+ Afile = filename:join(Base, "a_directory"),
+ ok = ?FILE_MODULE:write_file(Afile, "hello\n"),
+ case ?FILE_MODULE:make_dir(
+ filename:join(Afile, "another_directory")) of
+ {error, enotdir} -> io:format("Result: enotdir");
+ {error, enoent} -> io:format("Result: enoent")
+ end,
%% No permission (on Unix only).
case os:type() of
{unix, _} ->
- ?line ?FILE_MODULE:write_file_info(Base, #file_info {mode=0}),
- ?line {error, eacces} =
- ?FILE_MODULE:make_dir(filename:join(Base, "xxxx")),
- ?line ?FILE_MODULE:write_file_info(
+ ?FILE_MODULE:write_file_info(Base, #file_info {mode=0}),
+ {error, eacces} = ?FILE_MODULE:make_dir(filename:join(Base, "xxxx")),
+ ?FILE_MODULE:write_file_info(
Base, #file_info {mode=8#600});
{win32, _} ->
- ok;
- vxworks ->
ok
end,
- ?line test_server:timetrap_cancel(Dog),
+ test_server:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1950,57 +1928,50 @@ e_make_dir(Config) when is_list(Config) ->
e_del_dir(suite) -> [];
e_del_dir(doc) -> [];
e_del_dir(Config) when is_list(Config) ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line Base = test_server:temp_name(filename:join(RootDir, "e_del_dir")),
- ?line io:format("Base: ~p", [Base]),
- ?line ok = ?FILE_MODULE:make_dir(Base),
+ Dog = test_server:timetrap(test_server:seconds(10)),
+ RootDir = ?config(priv_dir, Config),
+ Base = test_server:temp_name(filename:join(RootDir, "e_del_dir")),
+ io:format("Base: ~p", [Base]),
+ ok = ?FILE_MODULE:make_dir(Base),
%% Delete a non-existent directory.
- ?line {error, enoent} =
+ {error, enoent} =
?FILE_MODULE:del_dir(filename:join(Base, "non_existing")),
%% Use a path-name with a non-directory component.
- ?line Afile = filename:join(Base, "a_directory"),
- ?line ok = ?FILE_MODULE:write_file(Afile, "hello\n"),
- ?line {error, E1} =
- expect({error, enotdir}, {error, enoent},
- ?FILE_MODULE:del_dir(
- filename:join(Afile, "another_directory"))),
- ?line io:format("Result: ~p", [E1]),
+ Afile = filename:join(Base, "a_directory"),
+ ok = ?FILE_MODULE:write_file(Afile, "hello\n"),
+ {error, E1} = expect({error, enotdir}, {error, enoent},
+ ?FILE_MODULE:del_dir(
+ filename:join(Afile, "another_directory"))),
+ io:format("Result: ~p", [E1]),
%% Delete a non-empty directory.
- ?line {error, E2} =
- expect({error, enotempty}, {error, eexist}, {error, eacces},
+ {error, E2} = expect({error, enotempty}, {error, eexist}, {error, eacces},
?FILE_MODULE:del_dir(Base)),
- ?line io:format("Result: ~p", [E2]),
+ io:format("Result: ~p", [E2]),
%% Remove the current directory.
- ?line {error, E3} =
- expect({error, einval},
+ {error, E3} = expect({error, einval},
{error, eperm}, % Linux and DUX
{error, eacces},
{error, ebusy},
?FILE_MODULE:del_dir(".")),
- ?line io:format("Result: ~p", [E3]),
+ io:format("Result: ~p", [E3]),
%% No permission.
case os:type() of
{unix, _} ->
- ?line ADirectory = filename:join(Base, "no_perm"),
- ?line ok = ?FILE_MODULE:make_dir(ADirectory),
- ?line ?FILE_MODULE:write_file_info(
- Base, #file_info {mode=0}),
- ?line {error, eacces} = ?FILE_MODULE:del_dir(ADirectory),
- ?line ?FILE_MODULE:write_file_info(
- Base, #file_info {mode=8#600});
+ ADirectory = filename:join(Base, "no_perm"),
+ ok = ?FILE_MODULE:make_dir(ADirectory),
+ ?FILE_MODULE:write_file_info( Base, #file_info {mode=0}),
+ {error, eacces} = ?FILE_MODULE:del_dir(ADirectory),
+ ?FILE_MODULE:write_file_info( Base, #file_info {mode=8#600});
{win32, _} ->
- ok;
- vxworks ->
ok
end,
- ?line [] = flush(),
- ?line test_server:timetrap_cancel(Dog),
+ [] = flush(),
+ test_server:timetrap_cancel(Dog),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2358,6 +2329,7 @@ symlinks(doc) -> "Test operations on symbolic links (for Unix).";
symlinks(suite) -> [];
symlinks(Config) when is_list(Config) ->
?line Dog = test_server:timetrap(test_server:seconds(10)),
+ ?line {error, _} = ?FILE_MODULE:read_link(lists:duplicate(10000,$a)),
?line RootDir = ?config(priv_dir, Config),
?line NewDir = filename:join(RootDir,
atom_to_list(?MODULE)
@@ -2563,147 +2535,123 @@ delayed_write(doc) ->
["Tests the file open option {delayed_write, Size, Delay}"];
delayed_write(Config) when is_list(Config) ->
- ?line Dog = ?t:timetrap(?t:seconds(20)),
- %%
- ?line RootDir = ?config(priv_dir, Config),
- ?line File = filename:join(RootDir,
- atom_to_list(?MODULE)++"_delayed_write.txt"),
- ?line Data1 = "asdfghjkl",
- ?line Data2 = "qwertyuio",
- ?line Data3 = "zxcvbnm,.",
- ?line Size = length(Data1),
- ?line Size = length(Data2),
- ?line Size = length(Data3),
- ?line Data1Data1 = Data1++Data1,
- ?line Data1Data1Data1 = Data1Data1++Data1,
- ?line Data1Data1Data1Data1 = Data1Data1++Data1Data1,
+ Dog = ?t:timetrap(?t:seconds(20)),
+
+ RootDir = ?config(priv_dir, Config),
+ File = filename:join(RootDir,
+ atom_to_list(?MODULE)++"_delayed_write.txt"),
+ Data1 = "asdfghjkl",
+ Data2 = "qwertyuio",
+ Data3 = "zxcvbnm,.",
+ Size = length(Data1),
+ Size = length(Data2),
+ Size = length(Data3),
+ Data1Data1 = Data1++Data1,
+ Data1Data1Data1 = Data1Data1++Data1,
+ Data1Data1Data1Data1 = Data1Data1++Data1Data1,
%%
%% Test caching and normal close of non-raw file
- ?line {ok, Fd1} =
+ {ok, Fd1} =
?FILE_MODULE:open(File, [write, {delayed_write, Size+1, 2000}]),
- ?line ok = ?FILE_MODULE:write(Fd1, Data1),
- ?line ?t:sleep(1000), % Just in case the file system is slow
- ?line {ok, Fd2} = ?FILE_MODULE:open(File, [read]),
- ?line case os:type() of
- vxworks ->
- io:format("Line ~p skipped on vxworks", [?LINE]);
- _ ->
- ?line eof = ?FILE_MODULE:read(Fd2, 1)
- end,
- ?line ok = ?FILE_MODULE:write(Fd1, Data1), % Data flush on size
- ?line ?t:sleep(1000), % Just in case the file system is slow
- ?line {ok, Data1Data1} = ?FILE_MODULE:pread(Fd2, bof, 2*Size+1),
- ?line ok = ?FILE_MODULE:write(Fd1, Data1),
- ?line ?t:sleep(3000), % Wait until data flush on timeout
- ?line {ok, Data1Data1Data1} = ?FILE_MODULE:pread(Fd2, bof, 3*Size+1),
- ?line ok = ?FILE_MODULE:write(Fd1, Data1),
- ?line ok = ?FILE_MODULE:close(Fd1), % Data flush on close
- ?line ?t:sleep(1000), % Just in case the file system is slow
- ?line {ok, Data1Data1Data1Data1} = ?FILE_MODULE:pread(Fd2, bof, 4*Size+1),
- ?line ok = ?FILE_MODULE:close(Fd2),
+ ok = ?FILE_MODULE:write(Fd1, Data1),
+ ?t:sleep(1000), % Just in case the file system is slow
+ {ok, Fd2} = ?FILE_MODULE:open(File, [read]),
+ eof = ?FILE_MODULE:read(Fd2, 1),
+ ok = ?FILE_MODULE:write(Fd1, Data1), % Data flush on size
+ ?t:sleep(1000), % Just in case the file system is slow
+ {ok, Data1Data1} = ?FILE_MODULE:pread(Fd2, bof, 2*Size+1),
+ ok = ?FILE_MODULE:write(Fd1, Data1),
+ ?t:sleep(3000), % Wait until data flush on timeout
+ {ok, Data1Data1Data1} = ?FILE_MODULE:pread(Fd2, bof, 3*Size+1),
+ ok = ?FILE_MODULE:write(Fd1, Data1),
+ ok = ?FILE_MODULE:close(Fd1), % Data flush on close
+ ?t:sleep(1000), % Just in case the file system is slow
+ {ok, Data1Data1Data1Data1} = ?FILE_MODULE:pread(Fd2, bof, 4*Size+1),
+ ok = ?FILE_MODULE:close(Fd2),
%%
%% Test implicit close through exit by file owning process,
%% raw file, default parameters.
- ?line Parent = self(),
- ?line Fun =
- fun () ->
- Child = self(),
- Test =
- fun () ->
- ?line {ok, Fd} =
- ?FILE_MODULE:open(File,
- [raw, write,
- delayed_write]),
- ?line ok = ?FILE_MODULE:write(Fd, Data1),
- ?line Parent ! {Child, wrote},
- ?line receive
- {Parent, continue, Reason} ->
- {ok, Reason}
- end
- end,
- case (catch Test()) of
- {ok, Reason} ->
- exit(Reason);
- Unknown ->
- exit({Unknown, get(test_server_loc)})
- end
- end,
- ?line Child1 = spawn(Fun),
- ?line Mref1 = erlang:monitor(process, Child1),
- ?line receive
- {Child1, wrote} ->
- ok;
- {'DOWN', Mref1, _, _, _} = Down1a ->
- ?t:fail(Down1a)
- end,
- ?line ?t:sleep(1000), % Just in case the file system is slow
- ?line {ok, Fd3} = ?FILE_MODULE:open(File, [read]),
- ?line case os:type() of
- vxworks ->
- io:format("Line ~p skipped on vxworks", [?LINE]);
- _ ->
- ?line eof = ?FILE_MODULE:read(Fd3, 1)
- end,
- ?line Child1 ! {Parent, continue, normal},
- ?line receive
- {'DOWN', Mref1, process, Child1, normal} ->
- ok;
- {'DOWN', Mref1, _, _, _} = Down1b ->
- ?t:fail(Down1b)
- end,
- ?line ?t:sleep(1000), % Just in case the file system is slow
- ?line {ok, Data1} = ?FILE_MODULE:pread(Fd3, bof, Size+1),
- ?line ok = ?FILE_MODULE:close(Fd3),
+ Parent = self(),
+ Fun = fun() ->
+ Child = self(),
+ Test =
+ fun () ->
+ {ok, Fd} = ?FILE_MODULE:open(File,
+ [raw, write, delayed_write]),
+ ok = ?FILE_MODULE:write(Fd, Data1),
+ Parent ! {Child, wrote},
+ receive
+ {Parent, continue, Reason} ->
+ {ok, Reason}
+ end
+ end,
+ case (catch Test()) of
+ {ok, Reason} -> exit(Reason);
+ Unknown ->
+ exit({Unknown, get(test_server_loc)})
+ end
+ end,
+ Child1 = spawn(Fun),
+ Mref1 = erlang:monitor(process, Child1),
+ receive
+ {Child1, wrote} ->
+ ok;
+ {'DOWN', Mref1, _, _, _} = Down1a ->
+ ?t:fail(Down1a)
+ end,
+ ?t:sleep(1000), % Just in case the file system is slow
+ {ok, Fd3} = ?FILE_MODULE:open(File, [read]),
+ eof = ?FILE_MODULE:read(Fd3, 1),
+ Child1 ! {Parent, continue, normal},
+ receive
+ {'DOWN', Mref1, process, Child1, normal} ->
+ ok;
+ {'DOWN', Mref1, _, _, _} = Down1b ->
+ ?t:fail(Down1b)
+ end,
+ ?t:sleep(1000), % Just in case the file system is slow
+ {ok, Data1} = ?FILE_MODULE:pread(Fd3, bof, Size+1),
+ ok = ?FILE_MODULE:close(Fd3),
%%
%% The same again, but this time with reason 'kill'.
- ?line Child2 = spawn(Fun),
- ?line Mref2 = erlang:monitor(process, Child2),
- ?line receive
- {Child2, wrote} ->
- ok;
- {'DOWN', Mref2, _, _, _} = Down2a ->
- ?t:fail(Down2a)
- end,
- ?line ?t:sleep(1000), % Just in case the file system is slow
- ?line {ok, Fd4} = ?FILE_MODULE:open(File, [read]),
- ?line case os:type() of
- vxworks ->
- io:format("Line ~p skipped on vxworks", [?LINE]);
- _ ->
- ?line eof = ?FILE_MODULE:read(Fd4, 1)
- end,
- ?line Child2 ! {Parent, continue, kill},
- ?line receive
- {'DOWN', Mref2, process, Child2, kill} ->
- ok;
- {'DOWN', Mref2, _, _, _} = Down2b ->
- ?t:fail(Down2b)
- end,
- ?line ?t:sleep(1000), % Just in case the file system is slow
- ?line eof = ?FILE_MODULE:pread(Fd4, bof, 1),
- ?line ok = ?FILE_MODULE:close(Fd4),
+ Child2 = spawn(Fun),
+ Mref2 = erlang:monitor(process, Child2),
+ receive
+ {Child2, wrote} ->
+ ok;
+ {'DOWN', Mref2, _, _, _} = Down2a ->
+ ?t:fail(Down2a)
+ end,
+ ?t:sleep(1000), % Just in case the file system is slow
+ {ok, Fd4} = ?FILE_MODULE:open(File, [read]),
+ eof = ?FILE_MODULE:read(Fd4, 1),
+ Child2 ! {Parent, continue, kill},
+ receive
+ {'DOWN', Mref2, process, Child2, kill} ->
+ ok;
+ {'DOWN', Mref2, _, _, _} = Down2b ->
+ ?t:fail(Down2b)
+ end,
+ ?t:sleep(1000), % Just in case the file system is slow
+ eof = ?FILE_MODULE:pread(Fd4, bof, 1),
+ ok = ?FILE_MODULE:close(Fd4),
%%
%% Test if file position works with delayed_write
- ?line {ok, Fd5} = ?FILE_MODULE:open(File, [raw, read, write,
- delayed_write]),
- ?line ok = ?FILE_MODULE:truncate(Fd5),
- ?line ok = ?FILE_MODULE:write(Fd5, [Data1|Data2]),
- ?line {ok, 0} = ?FILE_MODULE:position(Fd5, bof),
- ?line ok = ?FILE_MODULE:write(Fd5, [Data3]),
- ?line {ok, Data2} = ?FILE_MODULE:read(Fd5, Size+1),
- ?line {ok, 0} = ?FILE_MODULE:position(Fd5, bof),
- ?line Data3Data2 = Data3++Data2,
- ?line {ok, Data3Data2} = ?FILE_MODULE:read(Fd5, 2*Size+1),
- ?line ok = ?FILE_MODULE:close(Fd5),
+ {ok, Fd5} = ?FILE_MODULE:open(File, [raw, read, write,
+ delayed_write]),
+ ok = ?FILE_MODULE:truncate(Fd5),
+ ok = ?FILE_MODULE:write(Fd5, [Data1|Data2]),
+ {ok, 0} = ?FILE_MODULE:position(Fd5, bof),
+ ok = ?FILE_MODULE:write(Fd5, [Data3]),
+ {ok, Data2} = ?FILE_MODULE:read(Fd5, Size+1),
+ {ok, 0} = ?FILE_MODULE:position(Fd5, bof),
+ Data3Data2 = Data3++Data2,
+ {ok, Data3Data2} = ?FILE_MODULE:read(Fd5, 2*Size+1),
+ ok = ?FILE_MODULE:close(Fd5),
%%
- ?line [] = flush(),
- ?line ?t:timetrap_cancel(Dog),
- ?line case os:type() of
- vxworks ->
- {comment, "Some lines skipped on vxworks"};
- _ ->
- ok
- end.
+ [] = flush(),
+ ?t:timetrap_cancel(Dog),
+ ok.
pid2name(doc) -> "Tests file:pid2name/1.";
diff --git a/lib/kernel/test/file_name_SUITE.erl b/lib/kernel/test/file_name_SUITE.erl
index 53bcb1162d..3aa010a708 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -74,7 +74,7 @@
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([normal/1,icky/1,very_icky/1,normalize/1]).
+-export([normal/1,icky/1,very_icky/1,normalize/1,home_dir/1]).
init_per_testcase(_Func, Config) ->
@@ -88,7 +88,7 @@ end_per_testcase(_Func, Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [normal, icky, very_icky, normalize].
+ [normal, icky, very_icky, normalize, home_dir].
groups() ->
[].
@@ -105,6 +105,54 @@ init_per_group(_GroupName, Config) ->
end_per_group(_GroupName, Config) ->
Config.
+home_dir(suite) ->
+ [];
+home_dir(doc) ->
+ ["Check that Erlang can be started with unicode named home directory"];
+home_dir(Config) when is_list(Config) ->
+ try
+ Name=[960,945,964,961,953,954],
+ Priv = ?config(priv_dir, Config),
+ UniMode = file:native_name_encoding() =/= latin1,
+ if
+ not UniMode ->
+ throw(need_unicode_mode);
+ true ->
+ ok
+ end,
+ NewHome=filename:join(Priv,Name),
+ file:make_dir(NewHome),
+ {SaveOldName,SaveOldValue} = case os:type() of
+ {win32,nt} ->
+ HomePath=re:replace(filename:nativename(NewHome),"^[a-zA-Z]:","",[{return,list},unicode]),
+ Save = os:getenv("HOMEPATH"),
+ os:putenv("HOMEPATH",HomePath),
+ {"HOMEPATH",Save};
+ {unix,_} ->
+ Save = os:getenv("HOME"),
+ os:putenv("HOME",NewHome),
+ {"HOME",Save};
+ _ ->
+ rm_rf(prim_file,NewHome),
+ throw(unsupported_os)
+ end,
+ try
+ {ok,Node} = test_server:start_node(test_unicode_homedir,slave,[{args,"-setcookie "++atom_to_list(erlang:get_cookie())}]),
+ test_server:stop_node(Node),
+ ok
+ after
+ os:putenv(SaveOldName,SaveOldValue),
+ rm_rf(prim_file,NewHome)
+ end
+ catch
+ throw:need_unicode_mode ->
+ io:format("Sorry, can only run in unicode mode.~n"),
+ {skipped,"VM needs to be started in Unicode filename mode"};
+ throw:unsupported_os ->
+ io:format("Sorry, can only run on Unix/Windows.~n"),
+ {skipped,"Runs only on Unix/Windows"}
+ end.
+
normalize(suite) ->
[];
normalize(doc) ->
diff --git a/lib/kernel/test/gen_sctp_SUITE.erl b/lib/kernel/test/gen_sctp_SUITE.erl
index 8f490b6643..bcc2f0b840 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -31,14 +31,22 @@
[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,
- basic_stream/1, xfer_stream_min/1, peeloff/1, buffers/1]).
+ basic_stream/1, xfer_stream_min/1, peeloff/1, buffers/1,
+ open_multihoming_ipv4_socket/1,
+ open_unihoming_ipv6_socket/1,
+ open_multihoming_ipv6_socket/1,
+ open_multihoming_ipv4_and_ipv6_socket/1]).
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[basic, api_open_close, api_listen, api_connect_init,
api_opts, xfer_min, xfer_active, def_sndrcvinfo, implicit_inet6,
- basic_stream, xfer_stream_min, peeloff, buffers].
+ basic_stream, xfer_stream_min, peeloff, buffers,
+ open_multihoming_ipv4_socket,
+ open_unihoming_ipv6_socket,
+ open_multihoming_ipv6_socket,
+ open_multihoming_ipv4_and_ipv6_socket].
groups() ->
[].
@@ -1105,6 +1113,192 @@ mk_data(N, Bytes, Bin) when N < Bytes ->
mk_data(_, _, Bin) ->
Bin.
+
+
+open_multihoming_ipv4_socket(doc) ->
+ "Test opening a multihoming ipv4 socket";
+open_multihoming_ipv4_socket(suite) ->
+ [];
+open_multihoming_ipv4_socket(Config) when is_list(Config) ->
+ ?line case get_addrs_by_family(inet, 2) of
+ {ok, [Addr1, Addr2]} ->
+ ?line do_open_and_connect([Addr1, Addr2], Addr1);
+ {error, Reason} ->
+ {skip, Reason}
+ end.
+
+open_unihoming_ipv6_socket(doc) ->
+ %% This test is mostly aimed to indicate
+ %% whether host has a non-working ipv6 setup
+ "Test opening a unihoming (non-multihoming) ipv6 socket";
+open_unihoming_ipv6_socket(suite) ->
+ [];
+open_unihoming_ipv6_socket(Config) when is_list(Config) ->
+ ?line case get_addrs_by_family(inet6, 1) of
+ {ok, [Addr]} ->
+ ?line do_open_and_connect([Addr], Addr);
+ {error, Reason} ->
+ {skip, Reason}
+ end.
+
+
+open_multihoming_ipv6_socket(doc) ->
+ "Test opening a multihoming ipv6 socket";
+open_multihoming_ipv6_socket(suite) ->
+ [];
+open_multihoming_ipv6_socket(Config) when is_list(Config) ->
+ ?line case get_addrs_by_family(inet6, 2) of
+ {ok, [Addr1, Addr2]} ->
+ ?line do_open_and_connect([Addr1, Addr2], Addr1);
+ {error, Reason} ->
+ {skip, Reason}
+ end.
+
+open_multihoming_ipv4_and_ipv6_socket(doc) ->
+ "Test opening a multihoming ipv6 socket with ipv4 and ipv6 addresses";
+open_multihoming_ipv4_and_ipv6_socket(suite) ->
+ [];
+open_multihoming_ipv4_and_ipv6_socket(Config) when is_list(Config) ->
+ ?line case get_addrs_by_family(inet_and_inet6, 2) of
+ {ok, [[InetAddr1, InetAddr2], [Inet6Addr1, Inet6Addr2]]} ->
+ %% Connect to the first address to test bind
+ ?line do_open_and_connect([InetAddr1, Inet6Addr1, InetAddr2],
+ InetAddr1),
+ ?line do_open_and_connect([Inet6Addr1, InetAddr1],
+ Inet6Addr1),
+
+ %% Connect an address, not the first,
+ %% to test sctp_bindx
+ ?line do_open_and_connect([Inet6Addr1, Inet6Addr2, InetAddr1],
+ Inet6Addr2),
+ ?line do_open_and_connect([Inet6Addr1, Inet6Addr2, InetAddr1],
+ InetAddr1);
+ {error, Reason} ->
+ {skip, Reason}
+ end.
+
+
+get_addrs_by_family(Family, NumAddrs) ->
+ case os:type() of
+ {unix,linux} ->
+ get_addrs_by_family_aux(Family, NumAddrs);
+ {unix,freebsd} ->
+ get_addrs_by_family_aux(Family, NumAddrs);
+ {unix,sunos} ->
+ case get_addrs_by_family_aux(Family, NumAddrs) of
+ {ok, [InetAddrs, Inet6Addrs]} when Family =:= inet_and_inet6 ->
+ %% Man page for sctp_bindx on Solaris says: "If sock is an
+ %% Internet Protocol Version 6 (IPv6) socket, addrs should
+ %% be an array of sockaddr_in6 structures containing IPv6
+ %% or IPv4-mapped IPv6 addresses."
+ {ok, [ipv4_map_addrs(InetAddrs), Inet6Addrs]};
+ {ok, Addrs} ->
+ {ok, Addrs};
+ {error, Reason} ->
+ {error, Reason}
+ end;
+ Os ->
+ Reason = if Family =:= inet_and_inet6 ->
+ f("Mixing ipv4 and ipv6 addresses for multihoming "
+ " has not been verified on ~p", [Os]);
+ true ->
+ f("Multihoming for ~p has not been verified on ~p",
+ [Family, Os])
+ end,
+ {error, Reason}
+ end.
+
+get_addrs_by_family_aux(Family, NumAddrs) when Family =:= inet;
+ Family =:= inet6 ->
+ ?line
+ case inet:getaddr(localhost, Family) of
+ {error,eafnosupport} ->
+ {skip, f("No support for ~p", Family)};
+ {ok, _} ->
+ ?line IfAddrs = ok(inet:getifaddrs()),
+ ?line case filter_addrs_by_family(IfAddrs, Family) of
+ Addrs when length(Addrs) >= NumAddrs ->
+ {ok, lists:sublist(Addrs, NumAddrs)};
+ [] ->
+ {error, f("Need ~p ~p address(es) found none~n",
+ [NumAddrs, Family])};
+ Addrs ->
+ {error,
+ f("Need ~p ~p address(es) found only ~p: ~p~n",
+ [NumAddrs, Family, length(Addrs), Addrs])}
+ end
+ end;
+get_addrs_by_family_aux(inet_and_inet6, NumAddrs) ->
+ ?line catch {ok, [case get_addrs_by_family_aux(Family, NumAddrs) of
+ {ok, Addrs} -> Addrs;
+ {error, Reason} -> throw({error, Reason})
+ end || Family <- [inet, inet6]]}.
+
+filter_addrs_by_family(IfAddrs, Family) ->
+ lists:flatten([[Addr || {addr, Addr} <- Info,
+ is_good_addr(Addr, Family)]
+ || {_IfName, Info} <- IfAddrs]).
+
+is_good_addr(Addr, inet) when tuple_size(Addr) =:= 4 ->
+ true;
+is_good_addr({0,0,0,0,0,16#ffff,_,_}, inet6) ->
+ false; %% ipv4 mapped
+is_good_addr({16#fe80,_,_,_,_,_,_,_}, inet6) ->
+ false; %% link-local
+is_good_addr(Addr, inet6) when tuple_size(Addr) =:= 8 ->
+ true;
+is_good_addr(_Addr, _Family) ->
+ false.
+
+ipv4_map_addrs(InetAddrs) ->
+ [begin
+ <<AB:16>> = <<A,B>>,
+ <<CD:16>> = <<C,D>>,
+ {0, 0, 0, 0, 0, 16#ffff, AB, CD}
+ end || {A,B,C,D} <- InetAddrs].
+
+f(F, A) ->
+ lists:flatten(io_lib:format(F, A)).
+
+do_open_and_connect(ServerAddresses, AddressToConnectTo) ->
+ ?line ServerFamily = get_family_by_addrs(ServerAddresses),
+ ?line io:format("Serving ~p addresses: ~p~n",
+ [ServerFamily, ServerAddresses]),
+ ?line S1 = ok(gen_sctp:open(0, [{ip,Addr} || Addr <- ServerAddresses] ++
+ [ServerFamily])),
+ ?line ok = gen_sctp:listen(S1, true),
+ ?line P1 = ok(inet:port(S1)),
+ ?line ClientFamily = get_family_by_addr(AddressToConnectTo),
+ ?line io:format("Connecting to ~p ~p~n",
+ [ClientFamily, AddressToConnectTo]),
+ ?line S2 = ok(gen_sctp:open(0, [ClientFamily])),
+ %% Verify client can connect
+ ?line #sctp_assoc_change{state=comm_up} =
+ ok(gen_sctp:connect(S2, AddressToConnectTo, P1, [])),
+ %% verify server side also receives comm_up from client
+ ?line recv_comm_up_eventually(S1),
+ ?line ok = gen_sctp:close(S2),
+ ?line ok = gen_sctp:close(S1).
+
+%% If at least one of the addresses is an ipv6 address, return inet6, else inet.
+get_family_by_addrs(Addresses) ->
+ ?line case lists:usort([get_family_by_addr(Addr) || Addr <- Addresses]) of
+ [inet, inet6] -> inet6;
+ [inet] -> inet;
+ [inet6] -> inet6
+ end.
+
+get_family_by_addr(Addr) when tuple_size(Addr) =:= 4 -> inet;
+get_family_by_addr(Addr) when tuple_size(Addr) =:= 8 -> inet6.
+
+recv_comm_up_eventually(S) ->
+ ?line case ok(gen_sctp:recv(S)) of
+ {_Addr, _Port, _Info, #sctp_assoc_change{state=comm_up}} ->
+ ok;
+ {_Addr, _Port, _Info, _OtherSctpMsg} ->
+ ?line recv_comm_up_eventually(S)
+ end.
+
%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% socket gen_server ultra light
diff --git a/lib/kernel/test/gen_tcp_echo_SUITE.erl b/lib/kernel/test/gen_tcp_echo_SUITE.erl
index 5bbaeb02ad..94f95798a0 100644
--- a/lib/kernel/test/gen_tcp_echo_SUITE.erl
+++ b/lib/kernel/test/gen_tcp_echo_SUITE.erl
@@ -190,24 +190,19 @@ echo_test_1(SockOpts, EchoFun, Config0) ->
ok.
echo_packet(SockOpts, EchoFun, Opts) ->
- ?line Type =
- case lists:keysearch(type, 1, Opts) of
- {value, {type, T}} ->
- T;
- _ ->
- {value, {packet, T}} = lists:keysearch(packet, 1, SockOpts),
- T
- end,
+ Type = case lists:keysearch(type, 1, Opts) of
+ {value, {type, T}} ->
+ T;
+ _ ->
+ {value, {packet, T}} = lists:keysearch(packet, 1, SockOpts),
+ T
+ end,
%% Connect to the echo server.
- ?line EchoPort = ?config(echo_port, Opts),
- ?line {ok, Echo} = gen_tcp:connect(localhost, EchoPort, SockOpts),
+ EchoPort = ?config(echo_port, Opts),
+ {ok, Echo} = gen_tcp:connect(localhost, EchoPort, SockOpts),
- ?line SlowEcho =
- case os:type() of
- vxworks -> true;
- _ -> lists:member(slow_echo, Opts)
- end,
+ SlowEcho = lists:member(slow_echo, Opts),
case Type of
http ->
diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl
index 3da4b07c05..5d45b91ee5 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -24,7 +24,8 @@
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
- controlling_process/1, no_accept/1, close_with_pending_output/1,
+ controlling_process/1, controlling_process_self/1,
+ no_accept/1, close_with_pending_output/1,
data_before_close/1, iter_max_socks/1, get_status/1,
passive_sockets/1, accept_closed_by_other_process/1,
init_per_testcase/2, end_per_testcase/2,
@@ -39,7 +40,8 @@
accept_timeouts_in_order/1,accept_timeouts_in_order2/1,
accept_timeouts_in_order3/1,accept_timeouts_mixed/1,
killing_acceptor/1,killing_multi_acceptors/1,killing_multi_acceptors2/1,
- several_accepts_in_one_go/1,active_once_closed/1, send_timeout/1, send_timeout_active/1,
+ several_accepts_in_one_go/1, accept_system_limit/1,
+ active_once_closed/1, send_timeout/1, send_timeout_active/1,
otp_7731/1, zombie_sockets/1, otp_7816/1, otp_8102/1,
otp_9389/1]).
@@ -57,7 +59,7 @@ end_per_testcase(_Func, Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [controlling_process, no_accept,
+ [controlling_process, controlling_process_self, no_accept,
close_with_pending_output, data_before_close,
iter_max_socks, passive_sockets,
accept_closed_by_other_process, otp_3924, closed_socket,
@@ -71,7 +73,7 @@ all() ->
accept_timeouts_in_order, accept_timeouts_in_order2,
accept_timeouts_in_order3, accept_timeouts_mixed,
killing_acceptor, killing_multi_acceptors,
- killing_multi_acceptors2, several_accepts_in_one_go,
+ killing_multi_acceptors2, several_accepts_in_one_go, accept_system_limit,
active_once_closed, send_timeout, send_timeout_active, otp_7731,
zombie_sockets, otp_7816, otp_8102, otp_9389].
@@ -306,45 +308,55 @@ not_owner(S) ->
ok
end.
+controlling_process_self(doc) ->
+ ["Open a listen port and assign the controlling process to "
+ "it self, then exit and make sure the port is closed properly."];
+controlling_process_self(Config) when is_list(Config) ->
+ S = self(),
+ process_flag(trap_exit,true),
+ spawn_link(fun() ->
+ {ok,Sock} = gen_tcp:listen(0,[]),
+ S ! {socket, Sock},
+ ok = gen_tcp:controlling_process(Sock,self()),
+ S ! done
+ end),
+ receive
+ done ->
+ receive
+ {socket,Sock} ->
+ process_flag(trap_exit,false),
+ %% Make sure the port is invalid after process crash
+ {error,einval} = inet:port(Sock)
+ end;
+ Msg when element(1,Msg) /= socket ->
+ process_flag(trap_exit,false),
+ exit({unknown_msg,Msg})
+ end.
+
+
no_accept(doc) ->
["Open a listen port and connect to it, then close the listen port ",
"without doing any accept. The connected socket should receive ",
"a tcp_closed message."];
no_accept(suite) -> [];
no_accept(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {skip,"Too tough for vxworks"};
- _ ->
- no_accept2()
+ {ok, L} = gen_tcp:listen(0, []),
+ {ok, {_, Port}} = inet:sockname(L),
+ {ok, Client} = gen_tcp:connect(localhost, Port, []),
+ ok = gen_tcp:close(L),
+ receive
+ {tcp_closed, Client} ->
+ ok
+ after 5000 ->
+ ?line test_server:fail(never_closed)
+
end.
-no_accept2() ->
- ?line {ok, L} = gen_tcp:listen(0, []),
- ?line {ok, {_, Port}} = inet:sockname(L),
- ?line {ok, Client} = gen_tcp:connect(localhost, Port, []),
- ?line ok = gen_tcp:close(L),
- ?line receive
- {tcp_closed, Client} ->
- ok
- after 5000 ->
- ?line test_server:fail(never_closed)
-
- end.
-
close_with_pending_output(doc) ->
["Send several packets to a socket and close it. All packets should arrive ",
"to the other end."];
close_with_pending_output(suite) -> [];
close_with_pending_output(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {skipped,"Too tough for vxworks"};
- _ ->
- close_with_pending_output2()
- end.
-
-close_with_pending_output2() ->
?line {ok, L} = gen_tcp:listen(0, [binary, {active, false}]),
?line {ok, {_, Port}} = inet:sockname(L),
?line Packets = 16,
@@ -395,22 +407,16 @@ otp_3924(doc) ->
otp_3924(suite) -> [];
otp_3924(Config) when is_list(Config) ->
MaxDelay = (case has_superfluous_schedulers() of
- true -> 4;
- false -> 1
- end
- * case {erlang:system_info(debug_compiled),
- erlang:system_info(lock_checking)} of
- {true, _} -> 6;
- {_, true} -> 2;
- _ -> 1
- end * ?OTP_3924_MAX_DELAY),
- case os:type() of
- vxworks ->
-%% {skip,"Too tough for vxworks"};
- otp_3924_1(MaxDelay);
- _ ->
- otp_3924_1(MaxDelay)
- end.
+ true -> 4;
+ false -> 1
+ end
+ * case {erlang:system_info(debug_compiled),
+ erlang:system_info(lock_checking)} of
+ {true, _} -> 6;
+ {_, true} -> 2;
+ _ -> 1
+ end * ?OTP_3924_MAX_DELAY),
+ otp_3924_1(MaxDelay).
otp_3924_1(MaxDelay) ->
Dog = test_server:timetrap(test_server:seconds(240)),
@@ -531,26 +537,18 @@ otp_3924_sender(Receiver, Host, Port, Data) ->
data_before_close(doc) ->
["Tests that a huge amount of data can be received before a close."];
data_before_close(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {skip,"Too tough for vxworks"};
- _ ->
- data_before_close2()
- end.
-
-data_before_close2() ->
- ?line {ok, L} = gen_tcp:listen(0, [binary]),
- ?line {ok, {_, TcpPort}} = inet:sockname(L),
- ?line Bytes = 256*1024,
- ?line spawn_link(fun() -> huge_sender(TcpPort, Bytes) end),
- ?line {ok, A} = gen_tcp:accept(L),
- ?line case count_bytes_recv(A, 0) of
- {Bytes, Result} ->
- io:format("Result: ~p", [Result]);
- {Wrong, Result} ->
- io:format("Result: ~p", [Result]),
- test_server:fail({wrong_count, Wrong})
- end,
+ {ok, L} = gen_tcp:listen(0, [binary]),
+ {ok, {_, TcpPort}} = inet:sockname(L),
+ Bytes = 256*1024,
+ spawn_link(fun() -> huge_sender(TcpPort, Bytes) end),
+ {ok, A} = gen_tcp:accept(L),
+ case count_bytes_recv(A, 0) of
+ {Bytes, Result} ->
+ io:format("Result: ~p", [Result]);
+ {Wrong, Result} ->
+ io:format("Result: ~p", [Result]),
+ test_server:fail({wrong_count, Wrong})
+ end,
ok.
count_bytes_recv(Sock, Total) ->
@@ -583,32 +581,18 @@ get_status(Config) when is_list(Config) ->
?line {ok,{socket,Pid,_,_}} = gen_tcp:listen(5678,[]),
?line {status,Pid,_,_} = sys:get_status(Pid).
+-define(RECOVER_SLEEP, 60000).
+-define(RETRY_SLEEP, 15000).
+
iter_max_socks(doc) ->
["Open as many sockets as possible. Do this several times and check ",
"that we get the same number of sockets every time."];
iter_max_socks(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {skip,"Too tough for vxworks"};
- _ ->
- iter_max_socks2()
- end.
-
--define(RECOVER_SLEEP, 60000).
--define(RETRY_SLEEP, 15000).
-
-iter_max_socks2() ->
- ?line N =
- case os:type() of
- vxworks ->
- 10;
- _ ->
- 20
- end,
+ N = 20,
L = do_iter_max_socks(N, initalize),
- ?line io:format("Result: ~p",[L]),
- ?line all_equal(L),
- ?line {comment, "Max sockets: " ++ integer_to_list(hd(L))}.
+ io:format("Result: ~p",[L]),
+ all_equal(L),
+ {comment, "Max sockets: " ++ integer_to_list(hd(L))}.
do_iter_max_socks(0, _) ->
[];
@@ -1837,6 +1821,54 @@ wait_until_accepting(Proc,N) ->
end.
+accept_system_limit(suite) ->
+ [];
+accept_system_limit(doc) ->
+ ["Check that accept returns {error, system_limit} "
+ "(and not {error, enfile}) when running out of ports"];
+accept_system_limit(Config) when is_list(Config) ->
+ ?line {ok, LS} = gen_tcp:listen(0, []),
+ ?line {ok, TcpPort} = inet:port(LS),
+ ?line Connector = spawn_link(fun () -> connector(TcpPort) end),
+ ?line ok = acceptor(LS, false, []),
+ ?line Connector ! stop,
+ ok.
+
+acceptor(LS, GotSL, A) ->
+ case gen_tcp:accept(LS, 1000) of
+ {ok, S} ->
+ acceptor(LS, GotSL, [S|A]);
+ {error, system_limit} ->
+ acceptor(LS, true, A);
+ {error, timeout} when GotSL ->
+ ok;
+ {error, timeout} ->
+ error
+ end.
+
+connector(TcpPort) ->
+ ManyPorts = open_ports([]),
+ ConnF = fun (Port) ->
+ case catch gen_tcp:connect({127,0,0,1}, TcpPort, []) of
+ {ok, Sock} ->
+ Sock;
+ _Error ->
+ port_close(Port)
+ end
+ end,
+ R = [ConnF(Port) || Port <- lists:sublist(ManyPorts, 10)],
+ receive stop -> R end.
+
+open_ports(L) ->
+ case catch open_port({spawn_driver, "ram_file_drv"}, []) of
+ Port when is_port(Port) ->
+ open_ports([Port|L]);
+ {'EXIT', {system_limit, _}} ->
+ {L1, L2} = lists:split(5, L),
+ [port_close(Port) || Port <- L1],
+ L2
+ end.
+
active_once_closed(suite) ->
[];
@@ -1995,7 +2027,7 @@ send_timeout_active(Config) when is_list(Config) ->
?line {error,timeout} =
Loop(fun() ->
receive
- {tcp, Sock, _Data} ->
+ {tcp, _Sock, _Data} ->
inet:setopts(A, [{active, once}]),
Res = gen_tcp:send(A,lists:duplicate(1000, $a)),
%erlang:display(Res),
@@ -2487,7 +2519,7 @@ otp_8102_do(LSocket, PortNum, {Bin,PType}) ->
otp_9389(doc) -> ["Verify packet_size handles long HTTP header lines"];
otp_9389(suite) -> [];
otp_9389(Config) when is_list(Config) ->
- ?line {ok, LS} = gen_tcp:listen(0, []),
+ ?line {ok, LS} = gen_tcp:listen(0, [{active,false}]),
?line {ok, {_, PortNum}} = inet:sockname(LS),
io:format("Listening on ~w with port number ~p\n", [LS, PortNum]),
OrigLinkHdr = "/" ++ string:chars($S, 8192),
diff --git a/lib/kernel/test/heart_SUITE.erl b/lib/kernel/test/heart_SUITE.erl
index 233e438dc9..31005a01e2 100644
--- a/lib/kernel/test/heart_SUITE.erl
+++ b/lib/kernel/test/heart_SUITE.erl
@@ -266,13 +266,8 @@ dont_drop(doc) ->
"set just before halt on very high I/O load."];
dont_drop(Config) when is_list(Config) ->
%%% Have to do it some times to make it happen...
- case os:type() of
- vxworks ->
- {comment, "No use to run with slaves on other nodes..."};
- _ ->
- [ok,ok,ok,ok,ok,ok,ok,ok,ok,ok] = do_dont_drop(Config,10),
- ok
- end.
+ [ok,ok,ok,ok,ok,ok,ok,ok,ok,ok] = do_dont_drop(Config,10),
+ ok.
do_dont_drop(_,0) ->
[];
@@ -333,13 +328,7 @@ kill_pid(doc) ->
["Tests that heart kills the old erlang node before executing ",
"heart command."];
kill_pid(Config) when is_list(Config) ->
- %%% Have to do it some times to make it happen...
- case os:type() of
- vxworks ->
- {comment, "No use to run with slaves on other nodes..."};
- _ ->
- ok = do_kill_pid(Config)
- end.
+ ok = do_kill_pid(Config).
do_kill_pid(_Config) ->
Name = heart_test,
diff --git a/lib/kernel/test/heart_SUITE_data/simple_echo.c b/lib/kernel/test/heart_SUITE_data/simple_echo.c
index 0093dbce9b..a92bb8af95 100644
--- a/lib/kernel/test/heart_SUITE_data/simple_echo.c
+++ b/lib/kernel/test/heart_SUITE_data/simple_echo.c
@@ -2,11 +2,7 @@
#include <stdlib.h>
#include <string.h>
-#ifdef VXWORKS
-int simple_echo(void){
-#else
int main(void){
-#endif
int x;
while((x = getchar()) != EOF){
putchar(x);
@@ -14,4 +10,3 @@ int main(void){
}
return 0;
}
-
diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl
index 7241b093d0..ce138b6804 100644
--- a/lib/kernel/test/inet_SUITE.erl
+++ b/lib/kernel/test/inet_SUITE.erl
@@ -66,7 +66,7 @@ required(v6) ->
{require, test_dummy_ipv6_host}];
required(hosts) ->
case os:type() of
- {OS, _} when OS =:= win32; OS =:= vxworks ->
+ {OS, _} when OS =:= win32 ->
[{require, hardcoded_hosts},
{require, hardcoded_ipv6_hosts}];
_Else ->
@@ -614,17 +614,12 @@ t_gethostnative(Config) when is_list(Config) ->
%% this will result in 26 bytes sent which causes problem in Windows
%% if the port-program has not assured stdin to be read in BINARY mode
%% OTP-2555
- case os:type() of
- vxworks ->
- {skipped, "VxWorks has no native gethostbyname()"};
- _ ->
- ?line case inet_gethost_native:gethostbyname(
- "a23456789012345678901234") of
- {error,notfound} ->
- ?line ok;
- {error,no_data} ->
- ?line ok
- end
+ ?line case inet_gethost_native:gethostbyname(
+ "a23456789012345678901234") of
+ {error,notfound} ->
+ ?line ok;
+ {error,no_data} ->
+ ?line ok
end.
gethostnative_parallell(suite) ->
diff --git a/lib/kernel/test/inet_sockopt_SUITE.erl b/lib/kernel/test/inet_sockopt_SUITE.erl
index 0c63a6d653..087ae6055b 100644
--- a/lib/kernel/test/inet_sockopt_SUITE.erl
+++ b/lib/kernel/test/inet_sockopt_SUITE.erl
@@ -623,7 +623,6 @@ all_listen_options() ->
{exit_on_close, true, false, true, true},
%{high_watermark,4096,8192,true,true},
%{low_watermark,2048,4096,true,true},
- {bit8,on,off,true,true},
{send_timeout,infinity,1000,true,true},
{send_timeout_close,false,true,true,true},
{delay_send,false,true,true,true},
@@ -647,7 +646,6 @@ all_connect_options() ->
{exit_on_close, true, false, true, true},
{high_watermark,4096,8192,false,true},
{low_watermark,2048,4096,false,true},
- {bit8,on,off,true,true},
{send_timeout,infinity,1000,true,true},
{send_timeout_close,false,true,true,true},
{delay_send,false,true,true,true},
diff --git a/lib/kernel/test/inet_sockopt_SUITE_data/sockopt_helper.c b/lib/kernel/test/inet_sockopt_SUITE_data/sockopt_helper.c
index f24c93edf5..9c8f8eb91a 100644
--- a/lib/kernel/test/inet_sockopt_SUITE_data/sockopt_helper.c
+++ b/lib/kernel/test/inet_sockopt_SUITE_data/sockopt_helper.c
@@ -1,12 +1,3 @@
-#if defined(VXWORKS)
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-int sockopt_helper(void){
- return 0;
-}
-#else
-
#if defined(__WIN32__)
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
@@ -215,5 +206,3 @@ int main(void){
} while (x != C_QUIT);
return 0;
}
-#endif
-
diff --git a/lib/kernel/test/init_SUITE.erl b/lib/kernel/test/init_SUITE.erl
index b39fadd65f..6fe97ed04f 100644
--- a/lib/kernel/test/init_SUITE.erl
+++ b/lib/kernel/test/init_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -256,47 +256,42 @@ get_plain_arguments(Config) when is_list(Config) ->
boot_var(doc) -> [];
boot_var(suite) -> {req, [distribution, {local_slave_nodes, 1}]};
boot_var(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {comment, "Not run on VxWorks"};
+ ?line Dog = ?t:timetrap(?t:seconds(100)),
+
+ {BootScript, TEST_VAR, KernelVsn, StdlibVsn} = create_boot(Config),
+
+ %% Should fail as we have not given -boot_var TEST_VAR
+ ?line {error, timeout} =
+ start_node(init_test, "-boot " ++ BootScript),
+
+ case is_real_system(KernelVsn, StdlibVsn) of
+ true ->
+ %% Now it should work !!
+ ?line {ok, Node} =
+ start_node(init_test,
+ "-boot " ++ BootScript ++
+ " -boot_var TEST_VAR " ++ TEST_VAR),
+ stop_node(Node),
+ Res = ok;
_ ->
- ?line Dog = ?t:timetrap(?t:seconds(100)),
-
- {BootScript, TEST_VAR, KernelVsn, StdlibVsn} = create_boot(Config),
-
- %% Should fail as we have not given -boot_var TEST_VAR
- ?line {error, timeout} =
- start_node(init_test, "-boot " ++ BootScript),
-
- case is_real_system(KernelVsn, StdlibVsn) of
- true ->
- %% Now it should work !!
- ?line {ok, Node} =
- start_node(init_test,
- "-boot " ++ BootScript ++
- " -boot_var TEST_VAR " ++ TEST_VAR),
- stop_node(Node),
- Res = ok;
- _ ->
-%% What we need is not so much version numbers on the directories, but
-%% for the boot var TEST_VAR to appear in the boot script, and it doesn't
-%% if we give the 'local' option to systools:make_script.
- ?t:format(
- "Test case not complete as we are not~n"
- "running in a real system!~n"
- "Probably this test is performed in a "
- "clearcase view or source tree.~n"
- "Need version numbers on the kernel and "
- "stdlib directories!~n",
- []),
- Res = {skip,
- "Test case only partially run since it is run "
- "in a clearcase view or in a source tree. "
- "Need an installed system to complete this test."}
- end,
- ?line ?t:timetrap_cancel(Dog),
- Res
- end.
+ %% What we need is not so much version numbers on the directories, but
+ %% for the boot var TEST_VAR to appear in the boot script, and it doesn't
+ %% if we give the 'local' option to systools:make_script.
+ ?t:format(
+ "Test case not complete as we are not~n"
+ "running in a real system!~n"
+ "Probably this test is performed in a "
+ "clearcase view or source tree.~n"
+ "Need version numbers on the kernel and "
+ "stdlib directories!~n",
+ []),
+ Res = {skip,
+ "Test case only partially run since it is run "
+ "in a clearcase view or in a source tree. "
+ "Need an installed system to complete this test."}
+ end,
+ ?line ?t:timetrap_cancel(Dog),
+ Res.
create_boot(Config) ->
?line {ok, OldDir} = file:get_cwd(),
@@ -579,55 +574,47 @@ script_id(Config) when is_list(Config) ->
boot1(doc) -> [];
boot1(suite) -> {req, [distribution, {local_slave_nodes, 1}, {time, 35}]};
boot1(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {comment, "Not run on VxWorks"};
- _ ->
- ?line Dog = ?t:timetrap(?t:seconds(80)),
- Args = args() ++ " -boot start_sasl",
- ?line {ok, Node} = start_node(init_test, Args),
- ?line stop_node(Node),
-
- %% Try to start with non existing boot file.
- Args1 = args() ++ " -boot dummy_script",
- ?line {error, timeout} = start_node(init_test, Args1),
-
- ?line ?t:timetrap_cancel(Dog),
- ok
- end.
+ ?line Dog = ?t:timetrap(?t:seconds(80)),
+ Args = args() ++ " -boot start_sasl",
+ ?line {ok, Node} = start_node(init_test, Args),
+ ?line stop_node(Node),
+
+ %% Try to start with non existing boot file.
+ Args1 = args() ++ " -boot dummy_script",
+ ?line {error, timeout} = start_node(init_test, Args1),
+
+ ?line ?t:timetrap_cancel(Dog),
+ ok.
boot2(doc) -> [];
boot2(suite) -> {req, [distribution, {local_slave_nodes, 1}, {time, 35}]};
boot2(Config) when is_list(Config) ->
+ Dog = ?t:timetrap(?t:seconds(80)),
+
+ %% Absolute boot file name
+ Boot = filename:join([code:root_dir(), "bin", "start_sasl"]),
+
+ Args = args() ++ " -boot \"" ++ Boot++"\"",
+ {ok, Node} = start_node(init_test, Args),
+ stop_node(Node),
+
case os:type() of
- vxworks ->
- {comment, "Not run on VxWorks"};
+ {win32, _} ->
+ %% Absolute boot file name for Windows -- all slashes are
+ %% converted to backslashes.
+ Win_boot = lists:map(fun
+ ($/) -> $\\;
+ (C) -> C
+ end, Boot),
+ Args2 = args() ++ " -boot \"" ++ Win_boot ++ "\"",
+ {ok, Node2} = start_node(init_test, Args2),
+ stop_node(Node2);
_ ->
- ?line Dog = ?t:timetrap(?t:seconds(80)),
-
- %% Absolute boot file name
- Boot = filename:join([code:root_dir(), "bin", "start_sasl"]),
-
- Args = args() ++ " -boot " ++ Boot,
- ?line {ok, Node} = start_node(init_test, Args),
- ?line stop_node(Node),
-
- case os:type() of
- {win32, _} ->
- %% Absolute boot file name for Windows -- all slashes are
- %% converted to backslashes.
- Win_boot = lists:map(fun($/) -> $\\; (C) -> C end,
- Boot),
- Args2 = args() ++ " -boot " ++ Win_boot,
- ?line {ok, Node2} = start_node(init_test, Args2),
- ?line stop_node(Node2);
- _ ->
- ok
- end,
-
- ?line ?t:timetrap_cancel(Dog),
ok
- end.
+ end,
+
+ ?t:timetrap_cancel(Dog),
+ ok.
%% Misc. functions
diff --git a/lib/kernel/test/interactive_shell_SUITE.erl b/lib/kernel/test/interactive_shell_SUITE.erl
index b2308dd321..4787f19250 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -251,7 +251,7 @@ rtnode(Commands,Nodename,ErlPrefix) ->
?line {skip, Reason2};
Tempdir ->
?line SPid =
- start_runerl_node(RunErl,ErlPrefix++Erl,
+ start_runerl_node(RunErl,ErlPrefix++"\\\""++Erl++"\\\"",
Tempdir,Nodename),
?line CPid = start_toerl_server(ToErl,Tempdir),
?line erase(getline_skipped),
@@ -487,7 +487,7 @@ start_runerl_node(RunErl,Erl,Tempdir,Nodename) ->
" -setcookie "++atom_to_list(erlang:get_cookie())
end,
spawn(fun() ->
- os:cmd(RunErl++" "++Tempdir++"/ "++Tempdir++" \""++
+ os:cmd("\""++RunErl++"\" "++Tempdir++"/ "++Tempdir++" \""++
Erl++XArg++"\"")
end).
@@ -518,7 +518,7 @@ try_to_erl(Command, N) ->
end.
toerl_server(Parent,ToErl,Tempdir) ->
- Port = try_to_erl(ToErl++" "++Tempdir++"/ 2>/dev/null",8),
+ Port = try_to_erl("\""++ToErl++"\" "++Tempdir++"/ 2>/dev/null",8),
case Port of
P when is_port(P) ->
Parent ! {self(),started};
diff --git a/lib/kernel/test/kernel.spec.wxworks b/lib/kernel/test/kernel.spec.wxworks
deleted file mode 100644
index 370e474e64..0000000000
--- a/lib/kernel/test/kernel.spec.wxworks
+++ /dev/null
@@ -1,63 +0,0 @@
-%% -*- erlang -*-
-{suites,"kernel_test",all}.
-{skip_cases,"kernel_test",bif_SUITE,[spawn_link_race1],"Known bug."}.
-{skip_cases,"kernel_test",file_SUITE,
- [read_write_file],
- "VxWorks filesystem can't handle this"}.
-{skip_cases,"kernel_test",file_SUITE,
- [cur_dir_0],
- "VxWorks filesystem can't handle this"}.
-{skip_cases,"kernel_test",file_SUITE,
- [open1],
- "VxWorks filesystem can't handle this"}.
-{skip_cases,"kernel_test",file_SUITE,
- [file_info_times],
- "VxWorks filesystem can't handle this"}.
-{skip_cases,"kernel_test",file_SUITE,
- [file_write_file_info],
- "VxWorks filesystem can't handle this"}.
-{skip_cases,"kernel_test",file_SUITE,
- [truncate],
- "VxWorks filesystem can't handle this"}.
-{skip_cases,"kernel_test",file_SUITE,
- [rename],
- "VxWorks filesystem can't handle this"}.
-{skip_cases,"kernel_test",file_SUITE,
- [e_delete],
- "VxWorks filesystem can't handle this"}.
-{skip_cases,"kernel_test",file_SUITE,
- [e_rename],
- "VxWorks filesystem can't handle this"}.
-{skip_cases,"kernel_test",file_SUITE,
- [delayed_write],
- "VxWorks filesystem can't handle this"}.
-{skip_cases,"kernel_test",file_SUITE,
- [read_ahead],
- "VxWorks filesystem can't handle this"}.
-{skip_cases,"kernel_test",file_SUITE,
- [segment_write],
- "VxWorks filesystem would overload"}.
-{skip_cases,"kernel_test",file_SUITE,
- [segment_read],
- "VxWorks filesystem would overload"}.
-{skip_cases,"kernel_test",file_SUITE,
- [compress_errors],
- "VxWorks filesystem can't handle this"}.
-{skip_cases,"kernel_test",init_SUITE,[restart],"Uses peer nodes"}.
-{skip_cases,"kernel_test",os_SUITE,[space_in_cwd],"VxWorks can't handle this"}.
-{skip_cases,"kernel_test",os_SUITE,
- [space_in_name],
- "VxWorks can't handle this"}.
-{skip_cases,"kernel_test",os_SUITE,[quoting],"VxWorks can't handle this"}.
-{skip_cases,"kernel_test",prim_file_SUITE,
- [open1],
- "VxWorks filesystem can't handle this"}.
-{skip_cases,"kernel_test",prim_file_SUITE,
- [compress_errors],
- "VxWorks filesystem can't handle this"}.
-{skip_cases,"kernel_test",seq_trace_SUITE,
- [distributed_recv],
- "Test not adopted to slaves on different machine"}.
-{skip_cases,"kernel_test",seq_trace_SUITE,
- [distributed_exit],
- "Test not adopted to slaves on different machine"}.
diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl
index ae3410d13f..3f2195b609 100644
--- a/lib/kernel/test/os_SUITE.erl
+++ b/lib/kernel/test/os_SUITE.erl
@@ -202,8 +202,6 @@ find_executable(Config) when is_list(Config) ->
%% Never return a directory name.
?line false = os:find_executable("unix", [DataDir]),
- ok;
- vxworks ->
ok
end.
diff --git a/lib/kernel/test/pdict_SUITE.erl b/lib/kernel/test/pdict_SUITE.erl
index 8afdfc8a47..60b818cbe3 100644
--- a/lib/kernel/test/pdict_SUITE.erl
+++ b/lib/kernel/test/pdict_SUITE.erl
@@ -152,7 +152,6 @@ heavy(Config) when is_list(Config) ->
time(5000),
?M([],get()),
case {os:type(),?t:is_debug()} of
- {vxworks,_} -> ok;
{_,true} -> ok;
_ ->
time(50000),
diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl
index 3e2202922c..a56746bbc4 100644
--- a/lib/kernel/test/prim_file_SUITE.erl
+++ b/lib/kernel/test/prim_file_SUITE.erl
@@ -406,9 +406,6 @@ cur_dir_1(Config, Handle) ->
{unix, _} ->
?line {error, enotsup} =
?PRIM_FILE_call(get_cwd, Handle, ["d:"]);
- vxworks ->
- ?line {error, enotsup} =
- ?PRIM_FILE_call(get_cwd, Handle, ["d:"]);
{win32, _} ->
win_cur_dir_1(Config, Handle)
end,
@@ -843,10 +840,7 @@ file_info_basic_directory(Config, Handle) ->
?line test_directory("c:/", read_write, Handle),
?line test_directory("c:\\", read_write, Handle);
{unix, _} ->
- ?line test_directory("/", read, Handle);
- vxworks ->
- %% Check is just done for owner
- ?line test_directory("/", read_write, Handle)
+ ?line test_directory("/", read, Handle)
end,
?line test_server:timetrap_cancel(Dog).
@@ -1508,9 +1502,7 @@ e_delete(Config) when is_list(Config) ->
Base, #file_info {mode=8#600});
{win32, _} ->
%% Remove a character device.
- ?line {error, eacces} = ?PRIM_FILE:delete("nul");
- vxworks ->
- ok
+ ?line {error, eacces} = ?PRIM_FILE:delete("nul")
end,
?line test_server:timetrap_cancel(Dog),
@@ -1524,110 +1516,105 @@ e_delete(Config) when is_list(Config) ->
e_rename(suite) -> [];
e_rename(doc) -> [];
e_rename(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {comment, "Windriver: dosFs must be fixed first!"};
- _ ->
- ?line Dog = test_server:timetrap(test_server:seconds(10)),
- ?line RootDir = ?config(priv_dir, Config),
- ?line Base = filename:join(RootDir,
- atom_to_list(?MODULE)++"_e_rename"),
- ?line ok = ?PRIM_FILE:make_dir(Base),
-
- %% Create an empty directory.
- ?line EmptyDir = filename:join(Base, "empty_dir"),
- ?line ok = ?PRIM_FILE:make_dir(EmptyDir),
-
- %% Create a non-empty directory.
- ?line NonEmptyDir = filename:join(Base, "non_empty_dir"),
- ?line ok = ?PRIM_FILE:make_dir(NonEmptyDir),
- ?line ok = ?PRIM_FILE:write_file(
- filename:join(NonEmptyDir, "a_file"),
- "hello\n"),
-
- %% Create another non-empty directory.
- ?line ADirectory = filename:join(Base, "a_directory"),
- ?line ok = ?PRIM_FILE:make_dir(ADirectory),
- ?line ok = ?PRIM_FILE:write_file(
- filename:join(ADirectory, "a_file"),
- "howdy\n\n"),
+ ?line Dog = test_server:timetrap(test_server:seconds(10)),
+ ?line RootDir = ?config(priv_dir, Config),
+ ?line Base = filename:join(RootDir,
+ atom_to_list(?MODULE)++"_e_rename"),
+ ?line ok = ?PRIM_FILE:make_dir(Base),
- %% Create a data file.
- ?line File = filename:join(Base, "just_a_file"),
- ?line ok = ?PRIM_FILE:write_file(File, "anything goes\n\n"),
-
- %% Move an existing directory to a non-empty directory.
- ?line {error, eexist} =
- ?PRIM_FILE:rename(ADirectory, NonEmptyDir),
-
- %% Move a root directory.
- ?line {error, einval} = ?PRIM_FILE:rename("/", "arne"),
-
- %% Move Base into Base/new_name.
- ?line {error, einval} =
- ?PRIM_FILE:rename(Base, filename:join(Base, "new_name")),
-
- %% Overwrite a directory with a file.
- ?line expect({error, eexist}, % FreeBSD (?)
- {error, eisdir},
- ?PRIM_FILE:rename(File, EmptyDir)),
- ?line expect({error, eexist}, % FreeBSD (?)
- {error, eisdir},
- ?PRIM_FILE:rename(File, NonEmptyDir)),
-
- %% Move a non-existing file.
- ?line NonExistingFile = filename:join(
- Base, "non_existing_file"),
- ?line {error, enoent} =
- ?PRIM_FILE:rename(NonExistingFile, NonEmptyDir),
-
- %% Overwrite a file with a directory.
- ?line expect({error, eexist}, % FreeBSD (?)
- {error, enotdir},
- ?PRIM_FILE:rename(ADirectory, File)),
-
- %% Move a file to another filesystem.
- %% XXX - This test case is bogus. We cannot be guaranteed that
- %% the source and destination are on
- %% different filesystems.
- %%
- %% XXX - Gross hack!
- ?line Comment =
- case os:type() of
- {unix, _} ->
- OtherFs = "/tmp",
- ?line NameOnOtherFs =
- filename:join(OtherFs,
- filename:basename(File)),
- ?line {ok, Com} =
- case ?PRIM_FILE:rename(
- File, NameOnOtherFs) of
- {error, exdev} ->
- %% The file could be in
- %% the same filesystem!
- {ok, ok};
- ok ->
- {ok, {comment,
- "Moving between filesystems "
- "suceeded, files are probably "
- "in the same filesystem!"}};
- {error, eperm} ->
- {ok, {comment, "SBS! You don't "
- "have the permission to do "
- "this test!"}};
- Else ->
- Else
- end,
- Com;
- {win32, _} ->
- %% At least Windows NT can
- %% successfully move a file to
- %% another drive.
- ok
- end,
- ?line test_server:timetrap_cancel(Dog),
- Comment
- end.
+ %% Create an empty directory.
+ ?line EmptyDir = filename:join(Base, "empty_dir"),
+ ?line ok = ?PRIM_FILE:make_dir(EmptyDir),
+
+ %% Create a non-empty directory.
+ ?line NonEmptyDir = filename:join(Base, "non_empty_dir"),
+ ?line ok = ?PRIM_FILE:make_dir(NonEmptyDir),
+ ?line ok = ?PRIM_FILE:write_file(
+ filename:join(NonEmptyDir, "a_file"),
+ "hello\n"),
+
+ %% Create another non-empty directory.
+ ?line ADirectory = filename:join(Base, "a_directory"),
+ ?line ok = ?PRIM_FILE:make_dir(ADirectory),
+ ?line ok = ?PRIM_FILE:write_file(
+ filename:join(ADirectory, "a_file"),
+ "howdy\n\n"),
+
+ %% Create a data file.
+ ?line File = filename:join(Base, "just_a_file"),
+ ?line ok = ?PRIM_FILE:write_file(File, "anything goes\n\n"),
+
+ %% Move an existing directory to a non-empty directory.
+ ?line {error, eexist} =
+ ?PRIM_FILE:rename(ADirectory, NonEmptyDir),
+
+ %% Move a root directory.
+ ?line {error, einval} = ?PRIM_FILE:rename("/", "arne"),
+
+ %% Move Base into Base/new_name.
+ ?line {error, einval} =
+ ?PRIM_FILE:rename(Base, filename:join(Base, "new_name")),
+
+ %% Overwrite a directory with a file.
+ ?line expect({error, eexist}, % FreeBSD (?)
+ {error, eisdir},
+ ?PRIM_FILE:rename(File, EmptyDir)),
+ ?line expect({error, eexist}, % FreeBSD (?)
+ {error, eisdir},
+ ?PRIM_FILE:rename(File, NonEmptyDir)),
+
+ %% Move a non-existing file.
+ ?line NonExistingFile = filename:join(
+ Base, "non_existing_file"),
+ ?line {error, enoent} =
+ ?PRIM_FILE:rename(NonExistingFile, NonEmptyDir),
+
+ %% Overwrite a file with a directory.
+ ?line expect({error, eexist}, % FreeBSD (?)
+ {error, enotdir},
+ ?PRIM_FILE:rename(ADirectory, File)),
+
+ %% Move a file to another filesystem.
+ %% XXX - This test case is bogus. We cannot be guaranteed that
+ %% the source and destination are on
+ %% different filesystems.
+ %%
+ %% XXX - Gross hack!
+ ?line Comment =
+ case os:type() of
+ {unix, _} ->
+ OtherFs = "/tmp",
+ ?line NameOnOtherFs =
+ filename:join(OtherFs,
+ filename:basename(File)),
+ ?line {ok, Com} =
+ case ?PRIM_FILE:rename(
+ File, NameOnOtherFs) of
+ {error, exdev} ->
+ %% The file could be in
+ %% the same filesystem!
+ {ok, ok};
+ ok ->
+ {ok, {comment,
+ "Moving between filesystems "
+ "suceeded, files are probably "
+ "in the same filesystem!"}};
+ {error, eperm} ->
+ {ok, {comment, "SBS! You don't "
+ "have the permission to do "
+ "this test!"}};
+ Else ->
+ Else
+ end,
+ Com;
+ {win32, _} ->
+ %% At least Windows NT can
+ %% successfully move a file to
+ %% another drive.
+ ok
+ end,
+ ?line test_server:timetrap_cancel(Dog),
+ Comment.
e_make_dir(suite) -> [];
e_make_dir(doc) -> [];
@@ -1660,8 +1647,6 @@ e_make_dir(Config) when is_list(Config) ->
?line
?PRIM_FILE:write_file_info(Base, #file_info {mode=8#600});
{win32, _} ->
- ok;
- vxworks ->
ok
end,
?line test_server:timetrap_cancel(Dog),
@@ -1716,8 +1701,6 @@ e_del_dir(Config) when is_list(Config) ->
?line ?PRIM_FILE:write_file_info(
Base, #file_info {mode=8#600});
{win32, _} ->
- ok;
- vxworks ->
ok
end,
?line test_server:timetrap_cancel(Dog),
diff --git a/lib/kernel/test/sendfile_SUITE.erl b/lib/kernel/test/sendfile_SUITE.erl
index 6d0848ee05..4cf4c6489d 100644
--- a/lib/kernel/test/sendfile_SUITE.erl
+++ b/lib/kernel/test/sendfile_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -26,7 +26,9 @@
all() ->
[t_sendfile_small
- ,t_sendfile_big
+ ,t_sendfile_big_all
+ ,t_sendfile_big_size
+ ,t_sendfile_many_small
,t_sendfile_partial
,t_sendfile_offset
,t_sendfile_sendafter
@@ -38,20 +40,25 @@ all() ->
].
init_per_suite(Config) ->
- Priv = ?config(priv_dir, Config),
- SFilename = filename:join(Priv, "sendfile_small.html"),
- {ok, DS} = file:open(SFilename,[write,raw]),
- file:write(DS,"yo baby yo"),
- file:sync(DS),
- file:close(DS),
- BFilename = filename:join(Priv, "sendfile_big.html"),
- {ok, DB} = file:open(BFilename,[write,raw]),
- [file:write(DB,[<<0:(10*8*1024*1024)>>]) || _I <- lists:seq(1,51)],
- file:sync(DB),
- file:close(DB),
- [{small_file, SFilename},
- {file_opts,[raw,binary]},
- {big_file, BFilename}|Config].
+ case {os:type(),os:version()} of
+ {{unix,sunos}, {5,8,_}} ->
+ {skip, "Solaris 8 not supported for now"};
+ _ ->
+ Priv = ?config(priv_dir, Config),
+ SFilename = filename:join(Priv, "sendfile_small.html"),
+ {ok, DS} = file:open(SFilename,[write,raw]),
+ file:write(DS,"yo baby yo"),
+ file:sync(DS),
+ file:close(DS),
+ BFilename = filename:join(Priv, "sendfile_big.html"),
+ {ok, DB} = file:open(BFilename,[write,raw]),
+ [file:write(DB,[<<0:(10*8*1024*1024)>>]) || _I <- lists:seq(1,51)],
+ file:sync(DB),
+ file:close(DB),
+ [{small_file, SFilename},
+ {file_opts,[raw,binary]},
+ {big_file, BFilename}|Config]
+ end.
end_per_suite(Config) ->
file:delete(proplists:get_value(big_file, Config)).
@@ -91,7 +98,34 @@ t_sendfile_small(Config) when is_list(Config) ->
ok = sendfile_send(Send).
-t_sendfile_big(Config) when is_list(Config) ->
+t_sendfile_many_small(Config) when is_list(Config) ->
+ Filename = proplists:get_value(small_file, Config),
+ FileOpts = proplists:get_value(file_opts, Config, []),
+
+ error_logger:add_report_handler(?MODULE,[self()]),
+
+ Send = fun(Sock) ->
+ {Size,_} = sendfile_file_info(Filename),
+ N = 10000,
+ {ok,D} = file:open(Filename,[read|FileOpts]),
+ [begin
+ {ok,Size} = file:sendfile(D,Sock,0,0,[])
+ end || _I <- lists:seq(1,N)],
+ file:close(D),
+ Size*N
+ end,
+
+ ok = sendfile_send({127,0,0,1}, Send, 0),
+
+ receive
+ {stolen,Reason} ->
+ exit(Reason)
+ after 200 ->
+ ok
+ end.
+
+
+t_sendfile_big_all(Config) when is_list(Config) ->
Filename = proplists:get_value(big_file, Config),
Send = fun(Sock) ->
@@ -103,6 +137,20 @@ t_sendfile_big(Config) when is_list(Config) ->
ok = sendfile_send({127,0,0,1}, Send, 0).
+t_sendfile_big_size(Config) ->
+ Filename = proplists:get_value(big_file, Config),
+ FileOpts = proplists:get_value(file_opts, Config, []),
+
+ SendAll = fun(Sock) ->
+ {ok, #file_info{size = Size}} =
+ file:read_file_info(Filename),
+ {ok,D} = file:open(Filename,[read|FileOpts]),
+ {ok, Size} = file:sendfile(D, Sock,0,Size,[]),
+ Size
+ end,
+
+ ok = sendfile_send({127,0,0,1}, SendAll, 0).
+
t_sendfile_partial(Config) ->
Filename = proplists:get_value(small_file, Config),
FileOpts = proplists:get_value(file_opts, Config, []),
@@ -310,6 +358,10 @@ sendfile_server(ClientPid, Orig) ->
-define(SENDFILE_TIMEOUT, 10000).
sendfile_do_recv(Sock, Bs) ->
+ TimeoutMul = case os:type() of
+ {win32, _} -> 6;
+ _ -> 1
+ end,
receive
stop when Bs /= 0,is_integer(Bs) ->
gen_tcp:close(Sock),
@@ -333,7 +385,7 @@ sendfile_do_recv(Sock, Bs) ->
{tcp_closed, Sock} when is_integer(Bs) ->
ct:log("Stopped due to close"),
{ok, Bs}
- after ?SENDFILE_TIMEOUT ->
+ after ?SENDFILE_TIMEOUT * TimeoutMul ->
ct:log("Sendfile timeout"),
timeout
end.
diff --git a/lib/kernel/test/zlib_SUITE.erl b/lib/kernel/test/zlib_SUITE.erl
index 74bafe8935..bd237cb513 100644
--- a/lib/kernel/test/zlib_SUITE.erl
+++ b/lib/kernel/test/zlib_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -73,6 +73,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[{group, api}, {group, examples}, {group, func}, smp,
+ otp_9981,
otp_7359].
groups() ->
@@ -964,6 +965,24 @@ otp_7359_def_inf(Data,{DefSize,InfSize}) ->
?line ok = zlib:close(ZInf),
ok.
+otp_9981(Config) when is_list(Config) ->
+ Ports = lists:sort(erlang:ports()),
+ Invalid = <<"My invalid data">>,
+ catch zlib:compress(invalid),
+ Ports = lists:sort(erlang:ports()),
+ catch zlib:uncompress(Invalid),
+ Ports = lists:sort(erlang:ports()),
+ catch zlib:zip(invalid),
+ Ports = lists:sort(erlang:ports()),
+ catch zlib:unzip(Invalid),
+ Ports = lists:sort(erlang:ports()),
+ catch zlib:gzip(invalid),
+ Ports = lists:sort(erlang:ports()),
+ catch zlib:gunzip(Invalid),
+ Ports = lists:sort(erlang:ports()),
+ ok.
+
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Helps with testing directly %%%%%%%%%%%%%
diff --git a/lib/kernel/vsn.mk b/lib/kernel/vsn.mk
index 76d3003ff4..46a991eb38 100644
--- a/lib/kernel/vsn.mk
+++ b/lib/kernel/vsn.mk
@@ -1 +1 @@
-KERNEL_VSN = 2.15.1
+KERNEL_VSN = 2.16
diff --git a/lib/megaco/Makefile b/lib/megaco/Makefile
index 9dc84c122c..3bf502ba1c 100644
--- a/lib/megaco/Makefile
+++ b/lib/megaco/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -49,11 +49,14 @@ VSN=$(MEGACO_VSN)
DIR_NAME = megaco_src-$(VSN)$(PRE_VSN)
+nullstring :=
+space := $(nullstring) # a space at the end
+
ifndef APP_RELEASE_DIR
ifndef TESTROOT
APP_RELEASE_DIR = /tmp
else
- APP_RELEASE_DIR = $(TESTROOT)
+ APP_RELEASE_DIR = $(subst $(space),\ ,$(TESTROOT))
endif
endif
@@ -151,7 +154,7 @@ version:
# Application install (of a app built from source) targets
# ----------------------------------------------------
app_install:
- $(MAKE) TESTROOT=$(APP_INSTALL_DIR) release
+ $(MAKE) TESTROOT="$(APP_INSTALL_DIR)" release
# ----------------------------------------------------
@@ -185,20 +188,20 @@ TAR.exclude2: Makefile TAR.exclude
(cd ..; find megaco -name '.cmake.state' >> megaco/TAR.exclude2)
$(APP_DIR): tar_exclude
- mkdir -p $(APP_DIR); \
+ mkdir -p "$(subst $(space),\ ,$@)"; \
(cd ..; tar cfX - megaco/TAR.exclude2 megaco) | \
- (cd $(APP_DIR); tar xf -); \
- mv $(APP_DIR)/megaco/* $(APP_DIR)/; \
- mkdir $(APP_DIR)/autoconf; \
- cp autoconf/config.guess $(APP_DIR)/autoconf/; \
- cp autoconf/config.sub $(APP_DIR)/autoconf/; \
- cp autoconf/install-sh $(APP_DIR)/autoconf/; \
- rmdir $(APP_DIR)/megaco
+ (cd "$(subst $(space),\ ,$@)"; tar xf -); \
+ mv "$(subst $(space),\ ,$@)"/megaco/* "$(subst $(space),\ ,$@)"/; \
+ mkdir $(subst $(space),\ ,$@)/autoconf; \
+ cp autoconf/config.guess "$(subst $(space),\ ,$@)"/autoconf/; \
+ cp autoconf/config.sub "$(subst $(space),\ ,$@)"/autoconf/; \
+ cp autoconf/install-sh "$(subst $(space),\ ,$@)"/autoconf/; \
+ rmdir "$(subst $(space),\ ,$@)"/megaco
tar: $(APP_TAR_FILE)
$(APP_TAR_FILE): $(APP_DIR)
- (cd $(APP_RELEASE_DIR); gtar zcf $(APP_TAR_FILE) $(DIR_NAME))
+ (cd "$(APP_RELEASE_DIR)"; gtar zcf "$(subst $(space),\ ,$@)" $(DIR_NAME))
dialyzer_plt: $(DIA_PLT)
diff --git a/lib/megaco/configure.in b/lib/megaco/configure.in
index 42c50b8961..722ccc3fb4 100644
--- a/lib/megaco/configure.in
+++ b/lib/megaco/configure.in
@@ -145,7 +145,7 @@ AC_ARG_ENABLE(megaco_flex_scanner_lineno,
AC_SUBST(ENABLE_MEGACO_FLEX_SCANNER_LINENO)
-dnl This is the os flavour, should be unix, vxworks or win32
+dnl This is the os flavour, should be unix or win32
if test "X$host" = "Xwin32"; then
ERLANG_OSTYPE=win32
else
diff --git a/lib/megaco/doc/src/Makefile b/lib/megaco/doc/src/Makefile
index 137f0315d8..f35413a4fd 100644
--- a/lib/megaco/doc/src/Makefile
+++ b/lib/megaco/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2011. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -164,16 +164,16 @@ info:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
- $(INSTALL_DIR) $(RELSYSDIR)/doc/standard
- $(INSTALL_DATA) $(STANDARDS) $(RELSYSDIR)/doc/standard
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/standard"
+ $(INSTALL_DATA) $(STANDARDS) "$(RELSYSDIR)/doc/standard"
release_spec:
diff --git a/lib/megaco/doc/src/notes.xml b/lib/megaco/doc/src/notes.xml
index d9c575885f..928e3bea82 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>2011</year>
+ <year>2000</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -36,6 +36,147 @@
section is the version number of Megaco.</p>
+ <section><title>Megaco 3.16.0.2</title>
+
+ <p>Version 3.16.0.2 supports code replacement in runtime from/to
+ version 3.16.0.1, 3.16, 3.15.1.1, 3.15.1 and 3.15.</p>
+
+ <section>
+ <title>Improvements and new features</title>
+
+<!--
+ <p>-</p>
+-->
+
+ <list type="bulleted">
+ <item>
+ <p>Allow whitespaces in installation path. </p>
+ <p>It is now possible to give configure and make an
+ installation/release path with whitespaces in it. </p>
+ <p>Own Id: OTP-10107</p>
+ </item>
+
+ <item>
+ <p>Fix parallel make for behaviours. </p>
+ </item>
+
+ <item>
+ <p>Removed use of deprecated system flag,
+ <c>global_haeps_size</c>, in the measurement tool
+ <c>mstone1</c>. </p>
+ </item>
+
+ </list>
+
+ </section>
+
+ <section>
+ <title>Fixed bugs and malfunctions</title>
+
+ <p>-</p>
+
+ <!--
+ <list type="bulleted">
+ <item>
+ <p>Fixing miscellaneous things detected by dialyzer. </p>
+ <p>Own Id: OTP-9075</p>
+ </item>
+
+ </list>
+ -->
+
+ </section>
+
+ <section>
+ <title>Incompatibilities</title>
+ <p>-</p>
+
+<!--
+ <list type="bulleted">
+ <item>
+ <p>Due to the change in the flex driver API,
+ we may no longer be able to build and/or use
+ the flex driver without reentrant support. </p>
+ <p>Own Id: OTP-9795</p>
+ </item>
+
+ </list>
+-->
+
+ </section>
+
+ </section> <!-- 3.16.0.2 -->
+
+
+ <section><title>Megaco 3.16.0.1</title>
+
+ <p>Version 3.16.0.1 supports code replacement in runtime from/to
+ version 3.16, 3.15.1.1, 3.15.1 and 3.15.</p>
+
+ <section>
+ <title>Improvements and new features</title>
+
+<!--
+ <p>-</p>
+-->
+
+ <list type="bulleted">
+ <item>
+ <p>Fixed some faulty test cases. </p>
+<!--
+ <p>Own Id: OTP-9795</p>
+-->
+ </item>
+
+ <item>
+ <p>Removed use of deprecated system flag,
+ <c>scheduler_bind_type</c>, in the measurement tool
+ <c>mstone1</c>. </p>
+ <p>Own Id: OTP-9949</p>
+ </item>
+
+ </list>
+
+ </section>
+
+ <section>
+ <title>Fixed bugs and malfunctions</title>
+
+ <p>-</p>
+
+ <!--
+ <list type="bulleted">
+ <item>
+ <p>Fixing miscellaneous things detected by dialyzer. </p>
+ <p>Own Id: OTP-9075</p>
+ </item>
+
+ </list>
+ -->
+
+ </section>
+
+ <section>
+ <title>Incompatibilities</title>
+ <p>-</p>
+
+<!--
+ <list type="bulleted">
+ <item>
+ <p>Due to the change in the flex driver API,
+ we may no longer be able to build and/or use
+ the flex driver without reentrant support. </p>
+ <p>Own Id: OTP-9795</p>
+ </item>
+
+ </list>
+-->
+
+ </section>
+
+ </section> <!-- 3.16.0.1 -->
+
+
<section><title>Megaco 3.16</title>
<p>Version 3.16 supports code replacement in runtime from/to
@@ -50,7 +191,7 @@
<list type="bulleted">
<item>
- <p>Minor improvemnts to the emasurement tool mstone1. </p>
+ <p>Minor improvements to the measurement tool <c>mstone1</c>. </p>
<p>Own Id: OTP-9604</p>
</item>
diff --git a/lib/megaco/examples/meas/Makefile.in b/lib/megaco/examples/meas/Makefile.in
index 6af7ef6c65..c517fd21cf 100644
--- a/lib/megaco/examples/meas/Makefile.in
+++ b/lib/megaco/examples/meas/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2012. 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
@@ -131,12 +131,12 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(EXAMPLE_RELSYSDIR)
- $(INSTALL_DIR) $(MEAS_RELSYSDIR)
- $(INSTALL_DATA) $(MESSAGE_PACKAGES) $(MEAS_RELSYSDIR)
- $(INSTALL_DATA) $(SCRIPT_SKELETONS) $(MEAS_RELSYSDIR)
- $(INSTALL_DATA) $(TARGET_FILES) $(MEAS_RELSYSDIR)
- $(INSTALL_DATA) $(ERL_FILES) $(MEAS_RELSYSDIR)
+ $(INSTALL_DIR) "$(EXAMPLE_RELSYSDIR)"
+ $(INSTALL_DIR) "$(MEAS_RELSYSDIR)"
+ $(INSTALL_DATA) $(MESSAGE_PACKAGES) "$(MEAS_RELSYSDIR)"
+ $(INSTALL_DATA) $(SCRIPT_SKELETONS) "$(MEAS_RELSYSDIR)"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(MEAS_RELSYSDIR)"
+ $(INSTALL_DATA) $(ERL_FILES) "$(MEAS_RELSYSDIR)"
release_docs_spec:
diff --git a/lib/megaco/examples/meas/meas.sh.skel.src b/lib/megaco/examples/meas/meas.sh.skel.src
index c7bd6cdd2a..ecf463b9c6 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-2011. All Rights Reserved.
+# Copyright Ericsson AB 2007-2012. 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
@@ -32,6 +32,7 @@ STOP="-s init stop"
ERL="erl \
-noshell \
+ +sbt tnnps \
-pa $MEAS_HOME \
$MEAS_DEFAULT \
$STOP"
diff --git a/lib/megaco/examples/meas/megaco_codec_mstone1.erl b/lib/megaco/examples/meas/megaco_codec_mstone1.erl
index 9ab7822df8..2133cd633c 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -191,7 +191,6 @@ mstone_init(MessagePackage, Factor, Codecs, DrvInclude) ->
do_mstone(MessagePackage, Factor, Codecs, DrvInclude) ->
io:format("~n", []),
- ?LIB:set_default_sched_bind(),
?LIB:display_os_info(),
?LIB:display_system_info(),
?LIB:display_app_info(),
diff --git a/lib/megaco/examples/meas/megaco_codec_mstone2.erl b/lib/megaco/examples/meas/megaco_codec_mstone2.erl
index f3588f2e3d..54b889345f 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -40,7 +40,7 @@
%% When the finished timer expires, it will stop respawing
%% the worker processes, and instead just wait for them all
%% to finish.
-%% The test is finished by printing the statistics.
+%% The test is finishes by printing the statistics.
%% - A worker process for each codec combination.
%% This process is spawned by the loader process. It receives
%% at start a list of messages. It shall decode and then
@@ -162,7 +162,6 @@ parse_message_package(BadMessagePackage) ->
mstone_init(MessagePackage, DrvInclude) ->
io:format("~n", []),
- ?LIB:set_default_sched_bind(),
?LIB:display_os_info(),
?LIB:display_system_info(),
?LIB:display_app_info(),
diff --git a/lib/megaco/examples/meas/megaco_codec_mstone_lib.erl b/lib/megaco/examples/meas/megaco_codec_mstone_lib.erl
index 040af9826b..9af88d9f50 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -30,7 +30,6 @@
-compile({no_auto_import,[error/1]}).
-export([start_flex_scanner/0, stop_flex_scanner/1,
expanded_messages/2, expanded_messages/3,
- set_default_sched_bind/0,
display_os_info/0,
display_system_info/0,
display_alloc_info/0,
@@ -70,16 +69,6 @@ detect_version(Codec, Conf, Bin) ->
%%----------------------------------------------------------------------
%%
-%% S c h e d u l e r b i n d t y p e
-%%
-%%----------------------------------------------------------------------
-
-set_default_sched_bind() ->
- (catch erlang:system_flag(scheduler_bind_type, default_bind)).
-
-
-%%----------------------------------------------------------------------
-%%
%% D i s p l a y O s I n f o
%%
%%----------------------------------------------------------------------
@@ -111,7 +100,6 @@ display_system_info() ->
OtpRel = otp_release(),
SysVer = system_version(),
SysHT = heap_type(),
- SysGHSz = global_heaps_size(),
SysSMP = smp_support(),
SysNumSched = schedulers(),
SysProcLimit = process_limit(),
@@ -124,7 +112,6 @@ display_system_info() ->
io:format("OTP release: ~s~n", [OtpRel]),
io:format("System version: ~s~n", [SysVer]),
io:format("Heap type: ~s~n", [SysHT]),
- io:format("Global heap size: ~s~n", [SysGHSz]),
io:format("Thread support: ~s~n", [SysThreads]),
io:format("Thread pool size: ~s~n", [SysTPSz]),
io:format("Process limit: ~s~n", [SysProcLimit]),
@@ -148,9 +135,6 @@ system_version() ->
heap_type() ->
system_info(heap_type, any).
-global_heaps_size() ->
- system_info(global_heaps_size, any).
-
smp_support() ->
system_info(smp_support, any).
diff --git a/lib/megaco/examples/meas/mstone1.sh.skel.src b/lib/megaco/examples/meas/mstone1.sh.skel.src
index 54a6c61a58..b1935acef6 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-2011. All Rights Reserved.
+# Copyright Ericsson AB 2007-2012. 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
@@ -55,6 +55,15 @@ Options:
flex scanner will be used
nd - only codec config(s) without drivers will be used
od - only codec config(s) with drivers will be used
+ -sbt <bind-type> Set scheduler bind type. See erl man page for more info.
+ tnnps - Thread no node processor spread (default)
+ u - Unbound
+ ns - No spread
+ ts - Thread spread
+ ps - Processor spread
+ s - Spread
+ nnts - No node thread spread
+ nnps - No node processor spread
-- everything after this is just passed on to erl.
"
@@ -67,6 +76,7 @@ MODULE=megaco_codec_mstone1
STARTF="start"
FACTOR=""
MSG_PACK=time_test
+SBT="+sbt tnnps"
while test $# != 0; do
# echo "DBG: Value = $1"
@@ -107,6 +117,17 @@ while test $# != 0; do
exit 0
esac;;
+ -sbt)
+ case $2 in
+ tnnps|u|ns|ts|ps|s|nnts|nnps)
+ SBT="+sbt $2";
+ shift ; shift ;;
+ *)
+ echo "unknown scheduler bind type: $2";
+ echo "$usage" ;
+ exit 0
+ esac;;
+
-f)
if [ "x$SCHED" != "x" ]; then
echo "option(s) -s and -f cannot both be given" ;
@@ -177,6 +198,7 @@ if [ $TYPE = factor ]; then
ERL="erl \
-noshell \
+ $SBT \
$PHS \
$ATP \
$SMP_OPTS \
@@ -218,6 +240,7 @@ elif [ $TYPE = sched ]; then
ERL="erl \
-noshell \
+ $SBT \
$PHS \
$ATP \
$SMP_OPTS \
diff --git a/lib/megaco/examples/simple/Makefile b/lib/megaco/examples/simple/Makefile
index f91d1d886f..8ec9db71db 100644
--- a/lib/megaco/examples/simple/Makefile
+++ b/lib/megaco/examples/simple/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -139,9 +139,9 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/examples
- $(INSTALL_DIR) $(RELSYSDIR)/examples/simple
- $(INSTALL_DATA) $(ERL_FILES) $(TARGET_FILES) $(RELSYSDIR)/examples/simple
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/simple"
+ $(INSTALL_DATA) $(ERL_FILES) $(TARGET_FILES) "$(RELSYSDIR)/examples/simple"
release_docs_spec:
diff --git a/lib/megaco/src/app/Makefile b/lib/megaco/src/app/Makefile
index 01dfb9b860..42030c5b1c 100644
--- a/lib/megaco/src/app/Makefile
+++ b/lib/megaco/src/app/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2009. All Rights Reserved.
+# Copyright Ericsson AB 2007-2012. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
@@ -108,14 +108,14 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(APP_TARGET) $(APPUP_TARGET) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/app
- $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src/app
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(EXTERNAL_HRL_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/app"
+ $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src/app"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(EXTERNAL_HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/megaco/src/app/megaco.appup.src b/lib/megaco/src/app/megaco.appup.src
index 3c9740818a..a7b38eb107 100644
--- a/lib/megaco/src/app/megaco.appup.src
+++ b/lib/megaco/src/app/megaco.appup.src
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -142,10 +142,24 @@
%% |
%% v
%% 3.16
+%% |
+%% v
+%% 3.16.0.1
+%% |
+%% v
+%% 3.16.0.2
%%
%%
{"%VSN%",
[
+ {"3.16.0.1",
+ [
+ ]
+ },
+ {"3.16",
+ [
+ ]
+ },
{"3.15.1.1",
[
{restart_application, megaco}
@@ -163,6 +177,14 @@
}
],
[
+ {"3.16.0.1",
+ [
+ ]
+ },
+ {"3.16",
+ [
+ ]
+ },
{"3.15.1.1",
[
{restart_application, megaco}
diff --git a/lib/megaco/src/binary/Makefile b/lib/megaco/src/binary/Makefile
index d594f34f43..695599b9dc 100644
--- a/lib/megaco/src/binary/Makefile
+++ b/lib/megaco/src/binary/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2009. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -194,11 +194,11 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/binary
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(ASN1_FILES) $(RELSYSDIR)/src/binary
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/binary"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(ASN1_FILES) "$(RELSYSDIR)/src/binary"
release_docs_spec:
diff --git a/lib/megaco/src/engine/Makefile b/lib/megaco/src/engine/Makefile
index 3943f4b957..7cecef1444 100644
--- a/lib/megaco/src/engine/Makefile
+++ b/lib/megaco/src/engine/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -42,9 +42,14 @@ RELSYSDIR = $(RELEASE_PATH)/lib/megaco-$(VSN)
include modules.mk
-ERL_FILES = $(MODULES:%=%.erl)
+ERL_FILES = \
+ $(MODULES:%=%.erl) \
+ $(BEHAVIOUR_MODULES:%=%.erl)
-TARGET_FILES = \
+BEHAVIOUR_TARGET_FILES= \
+ $(BEHAVIOUR_MODULES:%=$(EBIN)/%.$(EMULATOR))
+
+TARGET_FILES = \
$(MODULES:%=$(EBIN)/%.$(EMULATOR))
@@ -65,19 +70,23 @@ ERL_COMPILE_FLAGS += \
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
+
+$(TARGET_FILES): $(BEHAVIOUR_TARGET_FILES)
+
debug:
@${MAKE} TYPE=debug opt
opt: $(TARGET_FILES)
clean:
- rm -f $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET)
+ rm -f $(BEHAVIOUR_TARGET_FILES) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET)
rm -f errs core *~
docs:
info:
@echo "MODULES = $(MODULES)"
+ @echo "BEHAVIOUR_MODULES = $(BEHAVIOUR_MODULES)"
@echo ""
@@ -88,12 +97,12 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/engine
- $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src/engine
- $(INSTALL_DIR) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(BEHAVIOUR_TARGET_FILES) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/engine"
+ $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src/engine"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/megaco/src/engine/modules.mk b/lib/megaco/src/engine/modules.mk
index 4bc57cd63e..e6e5e29829 100644
--- a/lib/megaco/src/engine/modules.mk
+++ b/lib/megaco/src/engine/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2011. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -23,7 +23,6 @@ BEHAVIOUR_MODULES = \
megaco_transport
MODULES = \
- $(BEHAVIOUR_MODULES) \
megaco_config_misc \
megaco_config \
megaco_digit_map \
diff --git a/lib/megaco/src/flex/Makefile.in b/lib/megaco/src/flex/Makefile.in
index 7d82644246..cb5f5412f4 100644
--- a/lib/megaco/src/flex/Makefile.in
+++ b/lib/megaco/src/flex/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2011. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -104,10 +104,6 @@ ENABLE_MEGACO_FLEX_SCANNER_LINENO = @ENABLE_MEGACO_FLEX_SCANNER_LINENO@
endif
endif
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
- DED_INCLUDES += -I$(ERL_TOP)/erts/etc/vxworks
-endif
-
PRIVDIR = ../../priv
LIBDIR = $(PRIVDIR)/lib/$(TARGET)
OBJDIR = $(PRIVDIR)/obj/$(TARGET)
@@ -146,15 +142,10 @@ ifeq ($(findstring win32,$(TARGET)), win32)
FLEX_SCANNER_SO =
SOLIBS = $(FLEX_SCANNER_SO)
else
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
-FLEX_SCANNER_SO =
-SOLIBS = $(FLEX_SCANNER_SO)
-else
FLEX_SCANNER_SO = $(LIBDIR)/$(STD_DRV).$(DED_EXT)
FLEX_SCANNER_MT_SO = $(LIBDIR)/$(MT_DRV).$(DED_EXT)
SOLIBS = $(FLEX_SCANNER_SO) $(FLEX_SCANNER_MT_SO)
endif
-endif
# ----------------------------------------------------
@@ -271,16 +262,16 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/flex
- $(INSTALL_DIR) $(RELSYSDIR)/priv/lib
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src/flex
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/flex"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/lib"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src/flex"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
ifeq ($(ENABLE_MEGACO_FLEX_SCANNER),true)
- $(INSTALL_DATA) $(FLEX_FILES) $(C_TARGETS) $(RELSYSDIR)/src/flex
- $(INSTALL_PROGRAM) $(SOLIBS) $(RELSYSDIR)/priv/lib
+ $(INSTALL_DATA) $(FLEX_FILES) $(C_TARGETS) "$(RELSYSDIR)/src/flex"
+ $(INSTALL_PROGRAM) $(SOLIBS) "$(RELSYSDIR)/priv/lib"
endif
diff --git a/lib/megaco/src/rules.mk b/lib/megaco/src/rules.mk
index 20fbed2a76..a59060032d 100644
--- a/lib/megaco/src/rules.mk
+++ b/lib/megaco/src/rules.mk
@@ -29,10 +29,6 @@ PERL = perl
# Erlang language section
# ----------------------------------------------------
EMULATOR = beam
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
-# VxWorks jam object files should be compressed
-ERL_COMPILE_FLAGS += +compressed
-endif
ERLC_WFLAGS = -W
ERLC = erlc $(ERLC_WFLAGS) $(ERLC_FLAGS)
ERL.beam = erl.beam -boot start_clean
diff --git a/lib/megaco/src/tcp/Makefile b/lib/megaco/src/tcp/Makefile
index 0bd4b7c4ee..0c30abae2c 100644
--- a/lib/megaco/src/tcp/Makefile
+++ b/lib/megaco/src/tcp/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2009. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -89,11 +89,11 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/tcp
- $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src/tcp
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/tcp"
+ $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src/tcp"
release_docs_spec:
diff --git a/lib/megaco/src/text/Makefile b/lib/megaco/src/text/Makefile
index b2e8e762dd..cab4256e68 100644
--- a/lib/megaco/src/text/Makefile
+++ b/lib/megaco/src/text/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2009. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -130,11 +130,11 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(BEAM_TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/text
- $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_YRL_FILES) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src/text
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(BEAM_TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/text"
+ $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_YRL_FILES) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src/text"
release_docs_spec:
diff --git a/lib/megaco/src/udp/Makefile b/lib/megaco/src/udp/Makefile
index 64b6478c2c..9486804d38 100644
--- a/lib/megaco/src/udp/Makefile
+++ b/lib/megaco/src/udp/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2009. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -89,11 +89,11 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/udp
- $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src/udp
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/udp"
+ $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src/udp"
release_docs_spec:
diff --git a/lib/megaco/test/Makefile b/lib/megaco/test/Makefile
index 88f6f06e73..b78f21f608 100644
--- a/lib/megaco/test/Makefile
+++ b/lib/megaco/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2010. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -748,11 +748,11 @@ release_spec:
release_docs_spec:
release_tests_spec: tests
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(RELTEST_FILES) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(RELTEST_FILES) "$(RELSYSDIR)"
# $(INSTALL_DATA) $(TEST_SPEC_FILE) $(COVER_SPEC_FILE) \
# $(HRL_FILES) $(ERL_FILES) \
-# $(RELSYSDIR)
+# "$(RELSYSDIR)"
#
- chmod -R u+w $(RELSYSDIR)
+ chmod -R u+w "$(RELSYSDIR)"
diff --git a/lib/megaco/test/megaco.spec.vxworks b/lib/megaco/test/megaco.spec.vxworks
deleted file mode 100644
index 2ac250e443..0000000000
--- a/lib/megaco/test/megaco.spec.vxworks
+++ /dev/null
@@ -1,5 +0,0 @@
-{topcase, {dir, "../megaco_test"}}.
-{require_nodenames, 1}.
-{skip, {megaco_digit_map_test, all, "Not yet implemented"}}.
-{skip, {megaco_measure_test, all, "Not yet implemented"}}.
-%{skip, {M, F, "Not yet implemented"}}.
diff --git a/lib/megaco/test/megaco_mess_test.erl b/lib/megaco/test/megaco_mess_test.erl
index 8bafab1aba..663ac8c329 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -324,9 +324,6 @@
min(M) -> timer:minutes(M).
%% Test server callbacks
-% init_per_testcase(pending_ack = Case, Config) ->
-% put(dbg,true),
-% megaco_test_lib:init_per_testcase(Case, Config);
init_per_testcase(otp_7189 = Case, Config) ->
C = lists:keydelete(tc_timeout, 1, Config),
megaco_test_lib:init_per_testcase(Case, [{tc_timeout, min(2)} |C]);
@@ -337,9 +334,6 @@ init_per_testcase(Case, Config) ->
C = lists:keydelete(tc_timeout, 1, Config),
megaco_test_lib:init_per_testcase(Case, [{tc_timeout, min(1)} |C]).
-% end_per_testcase(pending_ack = Case, Config) ->
-% erase(dbg),
-% megaco_test_lib:end_per_testcase(Case, Config);
end_per_testcase(Case, Config) ->
megaco_test_lib:end_per_testcase(Case, Config).
@@ -434,6 +428,7 @@ connect(suite) ->
connect(doc) ->
[];
connect(Config) when is_list(Config) ->
+ %% ?SKIP("Needs a re-write..."),
?ACQUIRE_NODES(1, Config),
PrelMid = preliminary_mid,
MgMid = ipv4_mid(4711),
@@ -457,16 +452,25 @@ connect(Config) when is_list(Config) ->
?VERIFY(bad_send_mod, megaco:conn_info(PrelCH, send_mod)),
SC = service_change_request(),
case megaco:call(PrelCH, [SC], []) of
- {error,
- {send_message_failed,
- {'EXIT', {undef, [{bad_send_mod, send_message, [sh, _]} | _]}}}} ->
+ {_Version,
+ {error,
+ {send_message_failed,
+ {'EXIT', {undef, [{bad_send_mod, send_message, [sh, _]} | _]}}}}
+ } ->
+ %% R14B and previous
+ ?LOG("expected send failure (1)", []),
ok;
%% As of R15, we also get some extra info (e.g. line numbers)
- {error,
- {send_message_failed,
- {'EXIT', {undef, [{bad_send_mod, send_message, [sh, _], _} | _]}}}} ->
+ {_Version,
+ {error,
+ {send_message_failed,
+ {'EXIT', {undef, [{bad_send_mod, send_message, [sh, _], _} | _]}}}}
+ } ->
+ %% R15B and later
+ ?LOG("expected send failure (2)", []),
ok;
+
Unexpected ->
?ERROR(Unexpected)
end,
diff --git a/lib/megaco/vsn.mk b/lib/megaco/vsn.mk
index bb6f5f554a..5e72ade769 100644
--- a/lib/megaco/vsn.mk
+++ b/lib/megaco/vsn.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -18,6 +18,6 @@
# %CopyrightEnd%
APPLICATION = megaco
-MEGACO_VSN = 3.16
+MEGACO_VSN = 3.16.0.2
PRE_VSN =
APP_VSN = "$(APPLICATION)-$(MEGACO_VSN)$(PRE_VSN)"
diff --git a/lib/mnesia/doc/src/Makefile b/lib/mnesia/doc/src/Makefile
index 1ac5760510..6a72b98ebc 100644
--- a/lib/mnesia/doc/src/Makefile
+++ b/lib/mnesia/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -142,13 +142,13 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3_FILES) $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3_FILES) "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/mnesia/doc/src/company.erl b/lib/mnesia/doc/src/company.erl
index 28c32ed513..eef5535ed3 100644
--- a/lib/mnesia/doc/src/company.erl
+++ b/lib/mnesia/doc/src/company.erl
@@ -1,19 +1,20 @@
-%% ``The contents of this file are subject to the Erlang Public License,
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
-%% retrieved via the world wide web at http://www.erlang.org/.
-%%
+%% retrieved online at http://www.erlang.org/.
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
-%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
-%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
-%% AB. All Rights Reserved.''
-%%
-%% $Id$
+%%
+%% %CopyrightEnd%
%%
-module(company).
@@ -83,16 +84,24 @@ g() -> l.
%3
female_bosses() ->
- Q = qlc:q( [{E#employee.name, Boss#employee.name} ||
- E <- mnesia:table(employee),
- Boss <- mnesia:table(employee),
- Atdep <- mnesia:table(at_dep),
- Mgr <- mnesia:table(manager),
- E#employee.sex == female,
- Atdep#at_dep.emp == E#employee.emp_no,
- Mgr#manager.emp == Boss#employee.emp_no,
- Atdep#at_dep.dept_id == Mgr#manager.dept]
+ H1 = qlc:q( [{Atdep#at_dep.dept_id,E} ||
+ E <- mnesia:table(employee),
+ E#employee.sex == female,
+ Atdep <- mnesia:table(at_dep),
+ Atdep#at_dep.emp == E#employee.emp_no]
+ ),
+
+ H2 = qlc:q( [{Mgr#manager.emp,E} ||
+ {AtdepDeptId, E} <- H1,
+ Mgr <- mnesia:table(manager),
+ AtdepDeptId == Mgr#manager.dept]
),
+
+ Q = qlc:q( [{E#employee.name, Boss#employee.name} ||
+ {MgrEmp,E} <- H2,
+ Boss <- mnesia:table(employee),
+ MgrEmp == Boss#employee.emp_no]
+ ),
mnesia:transaction(fun() -> qlc:e(Q) end).
%3
diff --git a/lib/mnesia/doc/src/company_o.erl b/lib/mnesia/doc/src/company_o.erl
index 3c7ad0d5e5..dffe9840bb 100644
--- a/lib/mnesia/doc/src/company_o.erl
+++ b/lib/mnesia/doc/src/company_o.erl
@@ -1,20 +1,22 @@
-%% ``The contents of this file are subject to the Erlang Public License,
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
-%% retrieved via the world wide web at http://www.erlang.org/.
-%%
+%% retrieved online at http://www.erlang.org/.
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
-%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
-%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
-%% AB. All Rights Reserved.''
-%%
-%% $Id$
%%
+%% %CopyrightEnd%
+%%
+
-module(company_o).
-compile(export_all).
diff --git a/lib/mnesia/doc/src/notes.xml b/lib/mnesia/doc/src/notes.xml
index a300fcc12d..04b8c106fd 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>2011</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -38,7 +38,67 @@
thus constitutes one section in this document. The title of each
section is the version number of Mnesia.</p>
- <section><title>Mnesia 4.6</title>
+ <section><title>Mnesia 4.7.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Add tests showing that trying to delete non-existing
+ object may corrupt the </p>
+ <p>
+ In case of bag tables, trying to delete a non-existing
+ object leads to the index becoming corrupt. This happens
+ if the non-existing object we try to delete happens to
+ share its key and index field value with a single
+ existing object in the table. Result: The index entry
+ corresponding to the existing object is removed.</p>
+ <p>
+ Prevent index from being corrupted if a nonexistent item
+ is deleted</p>
+ <p>
+ We have to ensure that we actually delete the last object
+ with a given (key, index) pair before removing the index.
+ Thanks to Bartlomiej Puzon</p>
+ <p>
+ Own Id: OTP-10220</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Mnesia 4.7</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Returns the same value for
+ mnesia_loader:disc_load_table/2 as
+ mnesia_loader:net_load_table/4 if a table copy can not be
+ found. (Thanks to Uwe Dauernheim)</p>
+ <p>
+ Own Id: OTP-10015</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Improved table lock algorithm.</p>
+ <p>
+ Own Id: OTP-9890</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Mnesia 4.6</title>
<section><title>Fixed Bugs and Malfunctions</title>
<list>
diff --git a/lib/mnesia/examples/Makefile b/lib/mnesia/examples/Makefile
index ff00ee76a5..d9e6def283 100644
--- a/lib/mnesia/examples/Makefile
+++ b/lib/mnesia/examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -78,9 +78,9 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/examples
- $(INSTALL_DATA) $(ERL_FILES) $(DATA_FILES) $(HRL_FILES) $(RELSYSDIR)/examples
- $(INSTALL_DIR) $(RELSYSDIR)/examples/bench
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples"
+ $(INSTALL_DATA) $(ERL_FILES) $(DATA_FILES) $(HRL_FILES) "$(RELSYSDIR)/examples"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/bench"
(cd bench; $(INSTALL_DATA) \
Makefile \
README \
@@ -96,8 +96,8 @@ release_spec: opt
bench.config5 \
bench.config6 \
bench.config7 \
- $(RELSYSDIR)/examples/bench)
- (cd bench; $(INSTALL_SCRIPT) bench.sh $(RELSYSDIR)/examples/bench)
+ "$(RELSYSDIR)/examples/bench")
+ (cd bench; $(INSTALL_SCRIPT) bench.sh "$(RELSYSDIR)/examples/bench")
release_docs_spec:
diff --git a/lib/mnesia/examples/mnesia_tpcb.erl b/lib/mnesia/examples/mnesia_tpcb.erl
index 903c53a21c..f36b43a495 100644
--- a/lib/mnesia/examples/mnesia_tpcb.erl
+++ b/lib/mnesia/examples/mnesia_tpcb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -99,9 +99,13 @@
replica_test/1,
sticky_replica_test/1,
remote_test/1,
- remote_frag2_test/1
+ remote_frag2_test/1,
+
+ conflict_benchmark/1
]).
+-include_lib("common_test/include/ct_event.hrl").
+
-define(SECOND, 1000000).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -191,8 +195,10 @@
driver_nodes = [node()],
n_drivers_per_node = 1,
use_running_mnesia = false,
+ seed,
stop_after = timer:minutes(15), % Minimum 15 min
report_interval = timer:minutes(1),
+ send_bench_report = false,
use_sticky_locks = false,
spawn_near_branch = false,
activity_type = transaction,
@@ -397,8 +403,30 @@ config(remote_frag2_test, ReplicaType) ->
{stop_after, timer:minutes(1)},
{report_interval, timer:seconds(10)},
{reuse_history_id, true}
+ ];
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Ten drivers per node, tables replicated to all nodes, single branch
+
+config(conflict_benchmark, ReplicaType) ->
+ Remote = nodes(),
+ Local = node(),
+ Nodes = [Local | Remote],
+ [{seed, {1326,448637,337711}},
+ {db_nodes, Nodes},
+ {driver_nodes, Nodes},
+ {replica_nodes, Nodes},
+ {n_drivers_per_node, 10},
+ {n_branches, 1},
+ {n_accounts_per_branch, 10},
+ {replica_type, ReplicaType},
+ {stop_after, timer:minutes(1)},
+ {report_interval, timer:seconds(10)},
+ {send_bench_report, true},
+ {reuse_history_id, true}
].
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
start(What, ReplicaType) ->
@@ -422,6 +450,9 @@ remote_test(ReplicaType) ->
remote_frag2_test(ReplicaType) ->
start(remote_frag2_test, ReplicaType).
+conflict_benchmark(ReplicaType) ->
+ start(config(conflict_benchmark, ReplicaType)).
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Args is a list of {Key, Val} tuples where Key is a field name
%% in either the record tab_config or run_config. Unknown keys are ignored.
@@ -866,6 +897,7 @@ add_time(Acc, New) ->
show_report(State) ->
Now = now_to_micros(erlang:now()),
Iters = State#reporter_state.n_iters,
+ Cfg = State#reporter_state.run_config,
Time = State#reporter_state.curr,
Max = Time#time.max_time,
N = Time#time.n_trans,
@@ -888,7 +920,17 @@ show_report(State) ->
"duration of longest transaction was ~p milliseconds~n",
[Tps, BruttoTps, Max div 1000])
end,
- State#reporter_state{prev_tps = Tps, prev_micros = Now}.
+ case Cfg#run_config.send_bench_report of
+ true ->
+ ct_event:notify(
+ #event{name = benchmark_data,
+ data = [{suite,"mnesia_tpcb"},
+ {value,Tps}]});
+ _ ->
+ ok
+ end,
+
+ State#reporter_state{prev_tps = Tps, prev_micros = Now}.
signed_diff(Iters, Curr, Prev) ->
case Iters > 1 of
@@ -955,7 +997,13 @@ alloc_local_branches([], Specs, OrphanBranches) ->
{Specs, OrphanBranches}.
driver_init(DS, AllBranches) ->
- Seed = erlang:now(),
+ case (DS#driver_state.run_config)#run_config.seed of
+ undefined ->
+ Seed = erlang:now();
+ Seed ->
+ Seed
+ end,
+
DS2 =
if
DS#driver_state.n_local_branches =:= 0 ->
diff --git a/lib/mnesia/include/Makefile b/lib/mnesia/include/Makefile
index f9b7d72abe..eea28045ea 100644
--- a/lib/mnesia/include/Makefile
+++ b/lib/mnesia/include/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2009. All Rights Reserved.
+# Copyright Ericsson AB 1998-2012. 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
@@ -54,8 +54,8 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec:
- $(INSTALL_DIR) $(RELSYSDIR)/include
-# $(INSTALL_DATA) $(INCLUDE_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+# $(INSTALL_DATA) $(INCLUDE_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/mnesia/src/Makefile b/lib/mnesia/src/Makefile
index 1c8ec54605..6f289433ff 100644
--- a/lib/mnesia/src/Makefile
+++ b/lib/mnesia/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -132,10 +132,10 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/mnesia/src/mnesia.appup.src b/lib/mnesia/src/mnesia.appup.src
index 304a15242f..355aafb215 100644
--- a/lib/mnesia/src/mnesia.appup.src
+++ b/lib/mnesia/src/mnesia.appup.src
@@ -1,6 +1,9 @@
%% -*- erlang -*-
{"%VSN%",
[
+ {"4.7.1", [{restart_application, mnesia}]},
+ {"4.7", [{restart_application, mnesia}]},
+ {"4.6", [{restart_application, mnesia}]},
{"4.5.1", [{restart_application, mnesia}]},
{"4.5", [{restart_application, mnesia}]},
{"4.4.19", [{restart_application, mnesia}]},
@@ -9,6 +12,9 @@
{"4.4.16", [{restart_application, mnesia}]}
],
[
+ {"4.7.1", [{restart_application, mnesia}]},
+ {"4.7", [{restart_application, mnesia}]},
+ {"4.6", [{restart_application, mnesia}]},
{"4.5.1", [{restart_application, mnesia}]},
{"4.5", [{restart_application, mnesia}]},
{"4.4.19", [{restart_application, mnesia}]},
diff --git a/lib/mnesia/src/mnesia_index.erl b/lib/mnesia/src/mnesia_index.erl
index 61210d7e55..f9f3ce2ea4 100644
--- a/lib/mnesia/src/mnesia_index.erl
+++ b/lib/mnesia/src/mnesia_index.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -120,9 +120,9 @@ del_object_bag(Tab, Key, Obj, Pos, Ixt, undefined) ->
IxKey = element(Pos, Obj),
Old = [X || X <- mnesia_lib:db_get(Tab, Key), element(Pos, X) =:= IxKey],
del_object_bag(Tab, Key, Obj, Pos, Ixt, Old);
-%% If Tab type is bag we need remove index identifier if Tab
-%% contains less than 2 elements.
-del_object_bag(_Tab, Key, Obj, Pos, Ixt, Old) when length(Old) < 2 ->
+%% If Tab type is bag we need remove index identifier if the object being
+%% deleted was the last one
+del_object_bag(_Tab, Key, Obj, Pos, Ixt, Old) when Old =:= [Obj] ->
del_ixes(Ixt, [Obj], Pos, Key);
del_object_bag(_Tab, _Key, _Obj, _Pos, _Ixt, _Old) -> ok.
diff --git a/lib/mnesia/src/mnesia_loader.erl b/lib/mnesia/src/mnesia_loader.erl
index e443b54016..4ba400fbbf 100644
--- a/lib/mnesia/src/mnesia_loader.erl
+++ b/lib/mnesia/src/mnesia_loader.erl
@@ -57,7 +57,7 @@ disc_load_table(Tab, Reason) ->
do_get_disc_copy2(Tab, _Reason, Storage, _Type) when Storage == unknown ->
verbose("Local table copy of ~p has recently been deleted, ignored.~n",
[Tab]),
- {loaded, ok}; %% ?
+ {not_loaded, storage_unknown};
do_get_disc_copy2(Tab, Reason, Storage, Type) when Storage == disc_copies ->
%% NOW we create the actual table
Repair = mnesia_monitor:get_env(auto_repair),
diff --git a/lib/mnesia/test/Makefile b/lib/mnesia/test/Makefile
index ae4c9626c7..45ce5b1983 100644
--- a/lib/mnesia/test/Makefile
+++ b/lib/mnesia/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -26,6 +26,7 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk
MODULES= \
mt \
mnesia_SUITE \
+ mnesia_bench_SUITE \
mnesia_test_lib \
mnesia_install_test \
mnesia_registry_test \
@@ -52,24 +53,29 @@ MODULES= \
mnesia_cost \
mnesia_dbn_meters
-MnesiaExamplesDir := ../examples
+DocExamplesDir := ../doc/src/
-ExampleModules = \
+DocExampleModules = \
company \
company_o \
- bup \
- mnesia_meter \
- mnesia_tpcb
-ExamplesHrl = \
+ bup
+
+DocExamplesHrl = \
company.hrl \
company_o.hrl
-ERL_FILES= $(MODULES:%=%.erl) $(ExampleModules:%=$(MnesiaExamplesDir)/%.erl)
+ExamplesDir := ../examples/
+
+ExampleModules = \
+ mnesia_meter \
+ mnesia_tpcb
-HRL_FILES= mnesia_test_lib.hrl $(ExamplesHrl:%=$(MnesiaExamplesDir)/%)
+ERL_FILES= $(MODULES:%=%.erl) $(DocExampleModules:%=$(DocExamplesDir)/%.erl) $(ExampleModules:%=$(ExamplesDir)/%.erl)
+
+HRL_FILES= mnesia_test_lib.hrl $(DocExamplesHrl:%=$(DocExamplesDir)/%)
TARGET_FILES= \
- $(MODULES:%=$(EBIN)/%.$(EMULATOR)) $(ExampleModules:%=$(EBIN)/%.$(EMULATOR))
+ $(MODULES:%=$(EBIN)/%.$(EMULATOR)) $(DocExampleModules:%=$(EBIN)/%.$(EMULATOR)) $(ExampleModules:%=$(EBIN)/%.$(EMULATOR))
INSTALL_PROGS= $(TARGET_FILES)
@@ -91,7 +97,10 @@ EBIN = .
tests debug opt: $(TARGET_FILES)
-$(EBIN)/%.beam: $(MnesiaExamplesDir)/%.erl
+$(EBIN)/%.beam: $(DocExamplesDir)/%.erl
+ $(ERLC) -bbeam $(ERL_COMPILE_FLAGS) -o$(EBIN) $<
+
+$(EBIN)/%.beam: $(ExamplesDir)/%.erl
$(ERLC) -bbeam $(ERL_COMPILE_FLAGS) -o$(EBIN) $<
clean:
@@ -108,11 +117,11 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) mnesia.spec mnesia.cover $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)
- $(INSTALL_SCRIPT) mt $(INSTALL_PROGS) $(RELSYSDIR)
-# chmod -R u+w $(RELSYSDIR)
-# @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) mnesia.spec mnesia_bench.spec mnesia.cover $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_SCRIPT) mt $(INSTALL_PROGS) "$(RELSYSDIR)"
+# chmod -R u+w "$(RELSYSDIR)"
+# @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/mnesia/test/mnesia.spec.vxworks b/lib/mnesia/test/mnesia.spec.vxworks
deleted file mode 100644
index 11c01ea3fe..0000000000
--- a/lib/mnesia/test/mnesia.spec.vxworks
+++ /dev/null
@@ -1,362 +0,0 @@
-{topcase, {dir, "../mnesia_test"}}.
-{require_nodenames, 3}.
-{diskless, true}.
-{skip, {mnesia_measure_test, all, "Too heavy"}}.
-%{mnesia_install_test, silly_durability} 'IMPL'
-%{mnesia_install_test, silly_move} 'IMPL'
-{skip, {mnesia_install_test, silly_upgrade, "Uses disk"}}.
-%{mnesia_install_test, conflict} 'IMPL'
-%{mnesia_install_test, dist} 'IMPL'
-{skip, {mnesia_examples_test, all, "Uses disk"}}.
-{skip, {mnesia_nice_coverage_test, all, "Uses disk"}}.
-
-%{mnesia_evil_coverage_test, system_info} 'IMPL'
-%{mnesia_evil_coverage_test, table_info} 'IMPL'
-%{mnesia_evil_coverage_test, error_description} 'IMPL'
-{skip, {mnesia_evil_coverage_test, db_node_lifecycle, "Uses disk"}}.
-{skip, {mnesia_evil_coverage_test, local_content, "Uses disk"}}.
-%{mnesia_evil_coverage_test, start_and_stop} 'IMPL'
-%{mnesia_evil_coverage_test, transaction} 'IMPL'
-{skip, {mnesia_evil_coverage_test, checkpoint, "Uses disk"}}.
-{skip, {mnesia_evil_backup, backup, "Uses disk"}}.
-{skip, {mnesia_evil_backup, global_backup_checkpoint, "Uses disk"}}.
-{skip, {mnesia_evil_backup, incremental_backup_checkpoint, "Uses disk"}}.
-{skip, {mnesia_evil_backup, local_backup_checkpoint, "Uses disk"}}.
-{skip, {mnesia_evil_backup, selective_backup_checkpoint, "Uses disk"}}.
-{skip, {mnesia_evil_backup, restore_errors, "Uses disk"}}.
-{skip, {mnesia_evil_backup, restore_clear, "Uses disk"}}.
-{skip, {mnesia_evil_backup, restore_keep, "Uses disk"}}.
-{skip, {mnesia_evil_backup, restore_recreate, "Uses disk"}}.
-{skip, {mnesia_evil_backup, traverse_backup, "Uses disk"}}.
-{skip, {mnesia_evil_backup, install_fallback, "Uses disk"}}.
-{skip, {mnesia_evil_backup, uninstall_fallback, "Uses disk"}}.
-{skip, {mnesia_evil_backup, local_fallback, "Uses disk"}}.
-%{mnesia_evil_coverage_test, table_lifecycle} 'IMPL'
-{skip, {mnesia_evil_coverage_test, replica_management, "Uses disk"}}.
-%{mnesia_evil_coverage_test, change_table_access_mode} 'IMPL'
-%{mnesia_evil_coverage_test, change_table_load_order} 'IMPL'
-{skip, {mnesia_evil_coverage_test, set_master_nodes, "Uses disk"}}.
-{skip, {mnesia_evil_coverage_test, offline_set_master_nodes, "Uses disk"}}.
-{skip, {mnesia_evil_coverage_test, replica_location, "Uses disk"}}.
-%{mnesia_evil_coverage_test, add_table_index_ram} 'IMPL'
-{skip, {mnesia_trans_access_test, add_table_index_disc, "Uses disc"}}.
-{skip, {mnesia_trans_access_test, add_table_index_disc_only, "Uses disc"}}.
-%{mnesia_evil_coverage_test, create_live_table_index_ram} 'IMPL'
-{skip, {mnesia_trans_access_test, create_live_table_index_disc, "Uses disc"}}.
-{skip, {mnesia_trans_access_test, create_live_table_index_disc_only, "Uses disc"}}.
-%{mnesia_evil_coverage_test, del_table_index_ram} 'IMPL'
-{skip, {mnesia_trans_access_test, del_table_index_disc, "Uses disc"}}.
-{skip, {mnesia_trans_access_test, del_table_index_disc_only, "Uses disc"}}.
-{skip, {mnesia_trans_access_test, idx_schema_changes_ram, "Uses disk"}}.
-{skip, {mnesia_trans_access_test, idx_schema_changes_disc, "Uses disc"}}.
-{skip, {mnesia_trans_access_test, idx_schema_changes_disc_only, "Uses disc"}}.
-%{mnesia_dirty_access_test, dirty_write_ram} 'IMPL'
-
-{skip, {mnesia_dirty_access_test, dirty_write_disc, "Uses disc"}}.
-{skip, {mnesia_dirty_access_test, dirty_write_disc_only, "Uses disc"}}.
-%{mnesia_dirty_access_test, dirty_read_ram} 'IMPL'
-{skip, {mnesia_dirty_access_test, dirty_read_disc, "Uses disc"}}.
-{skip, {mnesia_dirty_access_test, dirty_read_disc_only, "Uses disc"}}.
-%{mnesia_dirty_access_test, dirty_update_counter_ram} 'IMPL'
-{skip, {mnesia_dirty_access_test, dirty_update_counter_disc, "Uses disc"}}.
-{skip, {mnesia_dirty_access_test, dirty_update_counter_disc_only, "Uses disc"}}.
-%{mnesia_dirty_access_test, dirty_delete_ram} 'IMPL'
-{skip, {mnesia_dirty_access_test, dirty_delete_disc, "Uses disc"}}.
-{skip, {mnesia_dirty_access_test, dirty_delete_disc_only, "Uses disc"}}.
-%{mnesia_dirty_access_test, dirty_delete_object_ram} 'IMPL'
-{skip, {mnesia_dirty_access_test, dirty_delete_object_disc, "Uses disc"}}.
-{skip, {mnesia_dirty_access_test, dirty_delete_object_disc_only, "Uses disc"}}.
-%{mnesia_dirty_access_test, dirty_match_object_ram} 'IMPL'
-{skip, {mnesia_dirty_access_test, dirty_match_object_disc, "Uses disc"}}.
-{skip, {mnesia_dirty_access_test, dirty_match_object_disc_only, "Uses disc"}}.
-%{mnesia_dirty_access_test, dirty_index_match_object_ram} 'IMPL'
-{skip, {mnesia_dirty_access_test, dirty_index_match_object_disc, "Uses disc"}}.
-{skip, {mnesia_dirty_access_test, dirty_index_match_object_disc_only, "Uses disc"}}.
-%{mnesia_dirty_access_test, dirty_index_read_ram} 'IMPL'
-{skip, {mnesia_dirty_access_test, dirty_index_read_disc, "Uses disc"}}.
-{skip, {mnesia_dirty_access_test, dirty_index_read_disc_only, "Uses disc"}}.
-%{mnesia_dirty_access_test, dirty_index_update_set_ram} 'IMPL'
-{skip, {mnesia_dirty_access_test, dirty_index_update_set_disc, "Uses disc"}}.
-{skip, {mnesia_dirty_access_test, dirty_index_update_set_disc_only, "Uses disc"}}.
-%{mnesia_dirty_access_test, dirty_index_update_bag_ram} 'IMPL'
-{skip, {mnesia_dirty_access_test, dirty_index_update_bag_disc, "Uses disc"}}.
-{skip, {mnesia_dirty_access_test, dirty_index_update_bag_disc_only, "Uses disc"}}.
-%{mnesia_dirty_access_test, dirty_iter_ram} 'IMPL'
-{skip, {mnesia_dirty_access_test, dirty_iter_disc, "Uses disc"}}.
-{skip, {mnesia_dirty_access_test, dirty_iter_disc_only, "Uses disc"}}.
-{skip, {mnesia_dirty_access_test, admin_tests, "Uses disk"}}.
-
-%{mnesia_trans_access_test, write} 'IMPL'
-%{mnesia_trans_access_test, read} 'IMPL'
-%{mnesia_trans_access_test, wread} 'IMPL'
-%{mnesia_trans_access_test, delete} 'IMPL'
-%{mnesia_trans_access_test, delete_object} 'IMPL'
-%{mnesia_trans_access_test, match_object} 'IMPL'
-%{mnesia_trans_access_test, all_keys} 'IMPL'
-%{mnesia_trans_access_test, index_match_object} 'IMPL'
-%{mnesia_trans_access_test, index_read} 'IMPL'
-%{mnesia_trans_access_test, index_update_set} 'IMPL'
-%{mnesia_trans_access_test, index_update_bag} 'IMPL'
-{skip, {mnesia_evil_coverage_test, dump_tables, "Uses disk"}}.
-{skip, {mnesia_evil_coverage_test, dump_log, "Uses disk"}}.
-%{mnesia_evil_coverage_test, wait_for_tables} 'IMPL'
-{skip, {mnesia_evil_coverage_test, force_load_table, "Uses disk"}}.
-%{mnesia_evil_coverage_test, user_properties} 'IMPL'
-%{mnesia_evil_coverage_test, record_name_dirty_access_ram} 'IMPL'
-{skip, {mnesia_evil_coverage_test, record_name_dirty_access_disc, "Uses disc"}}.
-{skip, {mnesia_evil_coverage_test, record_name_dirty_access_disc_only, "Uses disc"}}.
-%{mnesia_evil_coverage_test, snmp_open_table} 'IMPL'
-%{mnesia_evil_coverage_test, snmp_close_table} 'IMPL'
-%{mnesia_evil_coverage_test, snmp_get_next_index} 'IMPL'
-%{mnesia_evil_coverage_test, snmp_get_row} 'IMPL'
-%{mnesia_evil_coverage_test, snmp_get_mnesia_key} 'IMPL'
-%{mnesia_evil_coverage_test, snmp_update_counter} 'IMPL'
-%{mnesia_evil_coverage_test, info} 'IMPL'
-%{mnesia_evil_coverage_test, schema_0} 'IMPL'
-%{mnesia_evil_coverage_test, schema_1} 'IMPL'
-%{mnesia_evil_coverage_test, view_0} 'IMPL'
-{skip, {mnesia_evil_coverage_test, view_1, "Uses disk"}}.
-{skip, {mnesia_evil_coverage_test, view_2, "Uses disk"}}.
-%{mnesia_evil_coverage_test, lkill} 'IMPL'
-%{mnesia_evil_coverage_test, kill} 'IMPL'
-
-%{mnesia_config_test, access_module} 'IMPL'
-%{mnesia_config_test, auto_repair} 'IMPL'
-{skip, {mnesia_config_test, backup_module, "Uses disk"}}.
-{skip, {mnesia_config_test, dynamic_connect, "Uses disk"}}.
-%{mnesia_config_test, debug} 'IMPL'
-%{mnesia_config_test, dir} 'IMPL'
-{skip, {mnesia_config_test, dump_log_load_regulation, "Uses disk"}}.
-{skip, {mnesia_config_test, dump_log_time_threshold, "Uses disk"}}.
-{skip, {mnesia_config_test, dump_log_write_threshold, "Uses disk"}}.
-{skip, {mnesia_config_test, dump_log_update_in_place, "Uses disk"}}.
-{skip, {mnesia_config_test, embedded_mnemosyne, "Uses Mnemosyne"}}.
-%{mnesia_config_test, event_module} 'IMPL'
-{skip, {mnesia_config_test, ignore_fallback_at_startup, "Not Yet impl"}}.
-%{mnesia_config_test, inconsistent_database} 'IMPL'
-{skip, {mnesia_config_test, max_wait_for_decision, "Not Yet impl"}}.
-{skip, {mnesia_config_test, start_one_disc_full_then_one_disc_less, "Uses disc"}}.
-{skip, {mnesia_config_test, start_first_one_disc_less_then_one_disc_full, "Uses disc"}}.
-%%{skip, {mnesia_config_test, start_first_one_disc_less_then_two_more_disc_less, "Uses disc"}}.
-{skip, {mnesia_config_test, schema_location_and_extra_db_nodes_combinations, "Uses disk"}}.
-{skip, {mnesia_config_test, table_load_to_disc_less_nodes, "Uses disc"}}.
-{skip, {mnesia_config_test, schema_merge, "Uses Disc"}}.
-%{mnesia_config_test, unknown_config} 'IMPL'
-%{mnesia_registry_test, good_dump} 'IMPL'
-%{mnesia_registry_test, bad_dump} 'IMPL'
-
-%{mnesia_atomicity_test, explicit_abort_in_middle_of_trans} 'IMPL'
-%{mnesia_atomicity_test, runtime_error_in_middle_of_trans} 'IMPL'
-%{mnesia_atomicity_test, kill_self_in_middle_of_trans} 'IMPL'
-%{mnesia_atomicity_test, throw_in_middle_of_trans} 'IMPL'
-%{mnesia_atomicity_test, mnesia_down_during_infinite_trans} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_sw_rt} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_sw_wt} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_wr_r} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_sw_sw} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_sw_w} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_sw_wr} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_wr_wt} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_wr_sw} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_wr_w} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_r_sw} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_r_w} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_r_wt} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_rt_sw} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_rt_w} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_rt_wt} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_wt_r} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_wt_w} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_wt_rt} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_wt_wt} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_wt_wr} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_wt_sw} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_w_wr} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_w_sw} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_w_r} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_w_w} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_w_rt} 'IMPL'
-%{mnesia_atomicity_test, lock_waiter_w_wt} 'IMPL'
-%{mnesia_atomicity_test, restart_r_one} 'IMPL'
-%{mnesia_atomicity_test, restart_w_one} 'IMPL'
-%{mnesia_atomicity_test, restart_rt_one} 'IMPL'
-%{mnesia_atomicity_test, restart_wt_one} 'IMPL'
-%{mnesia_atomicity_test, restart_wr_one} 'IMPL'
-%{mnesia_atomicity_test, restart_sw_one} 'IMPL'
-%{mnesia_atomicity_test, restart_r_two} 'IMPL'
-%{mnesia_atomicity_test, restart_w_two} 'IMPL'
-%{mnesia_atomicity_test, restart_rt_two} 'IMPL'
-%{mnesia_atomicity_test, restart_wt_two} 'IMPL'
-%{mnesia_atomicity_test, restart_wr_two} 'IMPL'
-%{mnesia_atomicity_test, restart_sw_two} 'IMPL'
-
-%{mnesia_isolation_test, no_conflict} 'IMPL'
-%{mnesia_isolation_test, simple_queue_conflict} 'IMPL'
-%{mnesia_isolation_test, advanced_queue_conflict} 'IMPL'
-%{mnesia_isolation_test, simple_deadlock_conflict} 'IMPL'
-%{mnesia_isolation_test, advanced_deadlock_conflict} 'IMPL'
-%{mnesia_isolation_test, lock_burst} 'IMPL'
-%{mnesia_isolation_test, basic_sticky_functionality} 'IMPL'
-%{mnesia_isolation_test, create_table} 'IMPL'
-%{mnesia_isolation_test, delete_table} 'IMPL'
-%{mnesia_isolation_test, move_table_copy} 'IMPL'
-%{mnesia_isolation_test, add_table_index} 'IMPL'
-%{mnesia_isolation_test, del_table_index} 'IMPL'
-%{mnesia_isolation_test, transform_table} 'IMPL'
-%{mnesia_isolation_test, snmp_open_table} 'IMPL'
-%{mnesia_isolation_test, snmp_close_table} 'IMPL'
-{skip, {mnesia_isolation_test, change_table_copy_type, "Uses disk"}}.
-%{mnesia_isolation_test, change_table_access} 'IMPL'
-%{mnesia_isolation_test, add_table_copy} 'IMPL'
-%{mnesia_isolation_test, del_table_copy} 'IMPL'
-{skip, {mnesia_isolation_test, dump_tables, "Uses disk"}}.
-{skip, {mnesia_isolation_test, extra_admin_tests, "Uses disk"}}.
-%{mnesia_isolation_test, del_table_copy_1} 'IMPL'
-%{mnesia_isolation_test, del_table_copy_2} 'IMPL'
-%{mnesia_isolation_test, del_table_copy_3} 'IMPL'
-%{mnesia_isolation_test, add_table_copy_1} 'IMPL'
-%{mnesia_isolation_test, add_table_copy_2} 'IMPL'
-%{mnesia_isolation_test, add_table_copy_3} 'IMPL'
-%{mnesia_isolation_test, add_table_copy_4} 'IMPL'
-%{mnesia_isolation_test, move_table_copy_1} 'IMPL'
-%{mnesia_isolation_test, move_table_copy_2} 'IMPL'
-%{mnesia_isolation_test, move_table_copy_3} 'IMPL'
-%{mnesia_isolation_test, move_table_copy_4} 'IMPL'
-%{mnesia_isolation_test, dirty_updates_visible_direct} 'IMPL'
-%{mnesia_isolation_test, dirty_reads_regardless_of_trans} 'IMPL'
-%{mnesia_isolation_test, trans_update_invisibible_outside_trans} 'IMPL'
-%{mnesia_isolation_test, trans_update_visible_inside_trans} 'IMPL'
-%{mnesia_isolation_test, write_shadows} 'IMPL'
-%{mnesia_isolation_test, delete_shadows} 'IMPL'
-%{mnesia_isolation_test, write_delete_shadows_bag} 'IMPL'
-
-{skip, {mnesia_durability_test, all, "Uses disk "}}.
-%{mnesia_durability_test, load_local_contents_directly} 'IMPL'
-%{mnesia_durability_test, load_directly_when_all_are_ram_copiesA} 'IMPL'
-%{mnesia_durability_test, load_directly_when_all_are_ram_copiesB} 'IMPL'
-%{skip, {mnesia_durability_test, late_load_when_all_are_ram_copies_on_ram_nodes1, "Uses disk schema"}}.
-%{skip, {mnesia_durability_test, late_load_when_all_are_ram_copies_on_ram_nodes2, "Uses disk schema"}}.
-%{skip, {mnesia_durability_test, load_when_last_replica_becomes_available, "Uses disk"}}.
-%{skip, {mnesia_durability_test, load_when_we_have_down_from_all_other_replica_nodes, "Uses disk"}}.
-%{skip, {mnesia_durability_test, late_load_transforms_into_disc_load, "Uses disc"}}.
-%{mnesia_durability_test, late_load_leads_to_hanging} 'IMPL'
-%{mnesia_durability_test, force_load_when_nobody_intents_to_load} 'IMPL'
-%{mnesia_durability_test, force_load_when_someone_has_decided_to_load} 'IMPL'
-%{mnesia_durability_test, force_load_when_someone_else_already_has_loaded} 'IMPL'
-%{mnesia_durability_test, force_load_when_we_has_loaded} 'IMPL'
-%{mnesia_durability_test, force_load_on_a_non_local_table} 'IMPL'
-%{mnesia_durability_test, force_load_when_the_table_does_not_exist} 'IMPL'
-%{mnesia_durability_test, master_nodes} 'IMPL'
-%{mnesia_durability_test, master_on_non_local_tables} 'IMPL'
-%{mnesia_durability_test, remote_force_load_with_local_master_node} 'IMPL'
-%{mnesia_durability_test, dump_ram_copies} 'IMPL'
-%{skip, {mnesia_durability_test, dump_disc_copies, "Uses disc"}}.
-%{skip, {mnesia_durability_test, dump_disc_only, "Uses disc"}}.
-%{skip, {mnesia_durability_test, durability_of_disc_copies, "Uses disc"}}.
-%{skip, {mnesia_durability_test, durability_of_disc_only_copies, "Uses disc"}}.
-
-{skip, {mnesia_recovery_test, mnesia_down, "Uses Disk"}}.
-%{mnesia_recovery_test, no_master_2} 'IMPL'
-%{mnesia_recovery_test, no_master_3} 'IMPL'
-%{mnesia_recovery_test, one_master_2} 'IMPL'
-%{mnesia_recovery_test, one_master_3} 'IMPL'
-%{mnesia_recovery_test, two_master_2} 'IMPL'
-%{mnesia_recovery_test, two_master_3} 'IMPL'
-%{mnesia_recovery_test, all_master_2} 'IMPL'
-%{mnesia_recovery_test, all_master_3} 'IMPL'
-{skip, {mnesia_recovery_test, mnesia_down_during_startup_disk_ram, "Uses disk"}}.
-%{mnesia_recovery_test, mnesia_down_during_startup_init_ram} 'IMPL'
-{skip, {mnesia_recovery_test, mnesia_down_during_startup_init_disc, "Uses disc"}}.
-{skip, {mnesia_recovery_test, mnesia_down_during_startup_init_disc_only, "Uses disc"}}.
-%{mnesia_recovery_test, mnesia_down_during_startup_tm_ram} 'IMPL'
-{skip, {mnesia_recovery_test, mnesia_down_during_startup_tm_disc, "Uses disc"}}.
-{skip, {mnesia_recovery_test, mnesia_down_during_startup_tm_disc_only, "Uses disc"}}.
-%{mnesia_recovery_test, explicit_stop_during_snmp} 'IMPL'
-
-{skip, {mnesia_recovery_test, schema_trans, "Uses Disk, needs disk log"}}.
-{skip, {mnesia_recovery_test, async_dirty, "Uses disc"}}.
-{skip, {mnesia_recovery_test, sync_dirty, "Uses disc"}}.
-{skip, {mnesia_recovery_test, sym_trans, "Uses disc"}}.
-{skip, {mnesia_recovery_test, asym_trans, "Uses disc"}}.
-
-{skip, {mnesia_recovery_test, after_full_disc_partition, "Not Yet impl"}}.
-{skip, {mnesia_recovery_test, after_corrupt_files, "Uses disk"}}.
-
-%{mnesia_evil_coverage_test, subscriptions} 'IMPL'
-%{mnesia_evil_coverage_test, nested_trans_both_ok} 'IMPL'
-%{mnesia_evil_coverage_test, nested_trans_child_dies} 'IMPL'
-%{mnesia_evil_coverage_test, nested_trans_parent_dies} 'IMPL'
-%{mnesia_evil_coverage_test, nested_trans_both_dies} 'IMPL'
-%{mnesia_evil_coverage_test, mix_of_trans_sync_dirty} 'IMPL'
-%{mnesia_evil_coverage_test, mix_of_trans_async_dirty} 'IMPL'
-%{mnesia_evil_coverage_test, mix_of_trans_ets} 'IMPL'
-
-{skip, {mnesia_recovery_test, disc_less, "Uses disc (on the other nodes)"}}.
-{skip, {mnesia_recovery_test, system_upgrade, "Not Yet impl"}}.
-%{mnesia_consistency_test, consistency_after_restart_1_ram} 'IMPL'
-{skip, {mnesia_consistency_test, consistency_after_restart_1_disc, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_restart_1_disc_only, "Uses disc"}}.
-%{mnesia_consistency_test, consistency_after_restart_2_ram} 'IMPL'
-{skip, {mnesia_consistency_test, consistency_after_restart_2_disc, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_restart_2_disc_only, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_dump_tables_1_ram, "Uses disk"}}.
-{skip, {mnesia_consistency_test, consistency_after_dump_tables_2_ram, "Uses disk"}}.
-%{mnesia_consistency_test, consistency_after_add_replica_2_ram} 'IMPL'
-{skip, {mnesia_consistency_test, consistency_after_add_replica_2_disc, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_add_replica_2_disc_only, "Uses disc"}}.
-%{mnesia_consistency_test, consistency_after_add_replica_3_ram} 'IMPL'
-{skip, {mnesia_consistency_test, consistency_after_add_replica_3_disc, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_add_replica_3_disc_only, "Uses disc"}}.
-%{mnesia_consistency_test, consistency_after_del_replica_2_ram} 'IMPL'
-{skip, {mnesia_consistency_test, consistency_after_del_replica_2_disc, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_del_replica_2_disc_only, "Uses disc"}}.
-%{mnesia_consistency_test, consistency_after_del_replica_3_ram} 'IMPL'
-{skip, {mnesia_consistency_test, consistency_after_del_replica_3_disc, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_del_replica_3_disc_only, "Uses disc"}}.
-%{mnesia_consistency_test, consistency_after_move_replica_2_ram} 'IMPL'
-{skip, {mnesia_consistency_test, consistency_after_move_replica_2_disc, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_move_replica_2_disc_only, "Uses disc"}}.
-%{mnesia_consistency_test, consistency_after_move_replica_3_ram} 'IMPL'
-{skip, {mnesia_consistency_test, consistency_after_move_replica_3_disc, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_move_replica_3_disc_only, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_transform_table, "Not yet implemented"}}.
-{skip, {mnesia_consistency_test, consistency_after_change_table_copy_type, "Not yet implemented"}}.
-{skip, {mnesia_consistency_test, consistency_after_fallback_2_ram, "Uses disk"}}.
-{skip, {mnesia_consistency_test, consistency_after_fallback_2_disc, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_fallback_2_disc_only, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_fallback_3_ram, "Uses disk"}}.
-{skip, {mnesia_consistency_test, consistency_after_fallback_3_disc, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_fallback_3_disc_only, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_restore_clear_ram, "Uses disk"}}.
-{skip, {mnesia_consistency_test, consistency_after_restore_clear_disc, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_restore_clear_disc_only, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_restore_recreate_ram, "Uses disk"}}.
-{skip, {mnesia_consistency_test, consistency_after_restore_recreate_disc, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_restore_recreate_disc_only, "Uses disc"}}.
-{skip, {mnesia_consistency_test, consistency_after_rename_of_node, "Not yet implemented"}}.
-{skip, {mnesia_consistency_test, updates_during_checkpoint_activation, "Uses disk"}}.
-%{skip, {mnesia_consistency_test, updates_during_checkpoint_activation_2_disc, "Uses disc"}}.
-%{skip, {mnesia_consistency_test, updates_during_checkpoint_activation_2_disc_only, "Uses disc"}}.
-%%{mnesia_consistency_test, updates_during_checkpoint_activation_3_ram} 'IMPL'
-%{skip, {mnesia_consistency_test, updates_during_checkpoint_activation_3_disc, "Uses disc"}}.
-%{skip, {mnesia_consistency_test, updates_during_checkpoint_activation_3_disc_only, "Uses disc"}}.
-{skip, {mnesia_consistency_test, updates_during_checkpoint_iteration, "Uses disk"}}.
-%{skip, {mnesia_consistency_test, updates_during_checkpoint_iteration_2_disc, "Uses disc"}}.
-%{skip, {mnesia_consistency_test, updates_during_checkpoint_iteration_2_disc_only, "Uses disc"}}.
-{skip, {mnesia_consistency_test, load_table_with_activated_checkpoint_ram, "Uses disk"}}.
-{skip, {mnesia_consistency_test, load_table_with_activated_checkpoint_disc, "Uses disc"}}.
-{skip, {mnesia_consistency_test, load_table_with_activated_checkpoint_disc_only, "Uses disc"}}.
-{skip, {mnesia_consistency_test, add_table_copy_to_table_with_activated_checkpoint_ram, "Uses disk"}}.
-{skip, {mnesia_consistency_test, add_table_copy_to_table_with_activated_checkpoint_disc, "Uses disc"}}.
-{skip, {mnesia_consistency_test, add_table_copy_to_table_with_activated_checkpoint_disc_only, "Uses disc"}}.
-{skip, {mnesia_consistency_test, inst_fallback_process_dies, "Uses disk"}}.
-{skip, {mnesia_consistency_test, fatal_when_inconsistency, "Uses disk"}}.
-{skip, {mnesia_consistency_test, after_delete, "Uses disk"}}.
-{skip, {mnesia_consistency_test, mnesia_down_during_backup_causes_switch, "Uses disk"}}.
-{skip, {mnesia_consistency_test, mnesia_down_during_backup_causes_abort, "Uses disk"}}.
-%{mnesia_consistency_test, cause_switch_after} 'IMPL'
-%{mnesia_consistency_test, cause_abort_before} 'IMPL'
-%{mnesia_consistency_test, cause_abort_after} 'IMPL'
-%{mnesia_consistency_test, change_schema_before} 'IMPL'
-%{mnesia_consistency_test, change_schema_after} 'IMPL'
-
diff --git a/lib/mnesia/test/mnesia_bench.spec b/lib/mnesia/test/mnesia_bench.spec
new file mode 100644
index 0000000000..7b17cb5c4e
--- /dev/null
+++ b/lib/mnesia/test/mnesia_bench.spec
@@ -0,0 +1 @@
+{suites,"../mnesia_test",[mnesia_bench_SUITE]}. \ No newline at end of file
diff --git a/lib/mnesia/test/mnesia_bench_SUITE.erl b/lib/mnesia/test/mnesia_bench_SUITE.erl
new file mode 100644
index 0000000000..7cbf77f046
--- /dev/null
+++ b/lib/mnesia/test/mnesia_bench_SUITE.erl
@@ -0,0 +1,69 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+-module(mnesia_bench_SUITE).
+-author('[email protected]').
+-compile(export_all).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+suite() -> [{ct_hooks,[{ts_install_cth,[{nodenames,2}]}]}].
+
+
+all() ->
+ [{group,tpcb}].
+
+groups() ->
+ [{tpcb,[{repeat,2}],[tpcb_conflict_ramcopies,
+ tpcb_conflict_disk_only_copies]}].
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(Config) ->
+ Config.
+
+init_per_testcase(_Func, Conf) ->
+ Conf.
+
+end_per_testcase(_Func, _Conf) ->
+ ok.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+tpcb_conflict_ramcopies(_Config) ->
+ mnesia_tpcb:conflict_benchmark(ram_copies).
+
+tpcb_conflict_disk_only_copies(_Config) ->
+ mnesia_tpcb:conflict_benchmark(disc_only_copies).
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+
+
diff --git a/lib/mnesia/test/mnesia_consistency_test.erl b/lib/mnesia/test/mnesia_consistency_test.erl
index f38e13f3a2..922b89ec2b 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -100,7 +100,7 @@ groups() ->
{group, updates_during_checkpoint_iteration},
{group, load_table_with_activated_checkpoint},
{group,
- add_table_copy_to_table_with_activated_checkpoint}]},
+ add_table_copy_to_table_checkpoint}]},
{updates_during_checkpoint_activation, [],
[updates_during_checkpoint_activation_2_ram,
updates_during_checkpoint_activation_2_disc,
@@ -116,10 +116,10 @@ groups() ->
[load_table_with_activated_checkpoint_ram,
load_table_with_activated_checkpoint_disc,
load_table_with_activated_checkpoint_disc_only]},
- {add_table_copy_to_table_with_activated_checkpoint, [],
- [add_table_copy_to_table_with_activated_checkpoint_ram,
- add_table_copy_to_table_with_activated_checkpoint_disc,
- add_table_copy_to_table_with_activated_checkpoint_disc_only]},
+ {add_table_copy_to_table_checkpoint, [],
+ [add_table_copy_to_table_checkpoint_ram,
+ add_table_copy_to_table_checkpoint_disc,
+ add_table_copy_to_table_checkpoint_disc_only]},
{backup_consistency, [],
[{group, interupted_install_fallback},
{group, interupted_uninstall_fallback},
@@ -952,16 +952,16 @@ view(Source, Mod) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-add_table_copy_to_table_with_activated_checkpoint_ram(suite) -> [];
-add_table_copy_to_table_with_activated_checkpoint_ram(Config) when is_list(Config) ->
+add_table_copy_to_table_checkpoint_ram(suite) -> [];
+add_table_copy_to_table_checkpoint_ram(Config) when is_list(Config) ->
add_table_copy_to_table_with_activated_checkpoint(ram_copies, Config).
-add_table_copy_to_table_with_activated_checkpoint_disc(suite) -> [];
-add_table_copy_to_table_with_activated_checkpoint_disc(Config) when is_list(Config) ->
+add_table_copy_to_table_checkpoint_disc(suite) -> [];
+add_table_copy_to_table_checkpoint_disc(Config) when is_list(Config) ->
add_table_copy_to_table_with_activated_checkpoint(disc_copies, Config).
-add_table_copy_to_table_with_activated_checkpoint_disc_only(suite) -> [];
-add_table_copy_to_table_with_activated_checkpoint_disc_only(Config) when is_list(Config) ->
+add_table_copy_to_table_checkpoint_disc_only(suite) -> [];
+add_table_copy_to_table_checkpoint_disc_only(Config) when is_list(Config) ->
add_table_copy_to_table_with_activated_checkpoint(disc_only_copies, Config).
add_table_copy_to_table_with_activated_checkpoint(Type,Config) ->
diff --git a/lib/mnesia/test/mnesia_dirty_access_test.erl b/lib/mnesia/test/mnesia_dirty_access_test.erl
index abbdab48c0..6017092095 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -527,6 +527,9 @@ dirty_index_update_bag(Config, Storage) ->
?match(ok, mnesia:dirty_write(Rec1)),
?match([Rec1], mnesia:dirty_index_read(Tab, 2, ValPos)),
+ ?match(ok, mnesia:dirty_delete_object(Rec5)),
+ ?match([Rec1], mnesia:dirty_index_read(Tab, 2, ValPos)),
+
?match({atomic, ok}, mnesia:transaction(fun() -> mnesia:write(Rec2) end)),
R1 = mnesia:dirty_index_read(Tab, 2, ValPos),
?match([Rec1, Rec2], lists:sort(R1)),
diff --git a/lib/mnesia/test/mnesia_recovery_test.erl b/lib/mnesia/test/mnesia_recovery_test.erl
index 625e6e824c..c4910a4b11 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -99,21 +99,21 @@ groups() ->
async_dirty_post_kill_coord_node,
async_dirty_post_kill_coord_pid]},
{asym_trans, [],
- [asym_trans_kill_part_ask,
- asym_trans_kill_part_commit_vote,
- asym_trans_kill_part_pre_commit,
- asym_trans_kill_part_log_commit,
- asym_trans_kill_part_do_commit,
- asym_trans_kill_coord_got_votes,
- asym_trans_kill_coord_pid_got_votes,
- asym_trans_kill_coord_log_commit_rec,
- asym_trans_kill_coord_pid_log_commit_rec,
- asym_trans_kill_coord_log_commit_dec,
- asym_trans_kill_coord_pid_log_commit_dec,
- asym_trans_kill_coord_rec_acc_pre_commit_log_commit,
- asym_trans_kill_coord_pid_rec_acc_pre_commit_log_commit,
- asym_trans_kill_coord_rec_acc_pre_commit_done_commit,
- asym_trans_kill_coord_pid_rec_acc_pre_commit_done_commit]},
+ [asymtrans_part_ask,
+ asymtrans_part_commit_vote,
+ asymtrans_part_pre_commit,
+ asymtrans_part_log_commit,
+ asymtrans_part_do_commit,
+ asymtrans_coord_got_votes,
+ asymtrans_coord_pid_got_votes,
+ asymtrans_coord_log_commit_rec,
+ asymtrans_coord_pid_log_commit_rec,
+ asymtrans_coord_log_commit_dec,
+ asymtrans_coord_pid_log_commit_dec,
+ asymtrans_coord_rec_acc_pre_commit_log_commit,
+ asymtrans_coord_pid_rec_acc_pre_commit_log_commit,
+ asymtrans_coord_rec_acc_pre_commit_done_commit,
+ asymtrans_coord_pid_rec_acc_pre_commit_done_commit]},
{after_corrupt_files, [],
[after_corrupt_files_decision_log_head,
after_corrupt_files_decision_log_tail,
@@ -978,8 +978,8 @@ do_async_dirty([Tab], _Fahter) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-asym_trans_kill_part_ask(suite) -> [];
-asym_trans_kill_part_ask(Config) when is_list(Config) ->
+asymtrans_part_ask(suite) -> [];
+asymtrans_part_ask(Config) when is_list(Config) ->
?is_debug_compiled,
Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]),
[Coord, Part1, Part2] = Nodes,
@@ -989,8 +989,8 @@ asym_trans_kill_part_ask(Config) when is_list(Config) ->
kill_after_debug_point(Part1, {Part1, {mnesia_tm, doit_ask_commit}},
TransFun, [Tab1, Tab2], Nodes).
-asym_trans_kill_part_commit_vote(suite) -> [];
-asym_trans_kill_part_commit_vote(Config) when is_list(Config) ->
+asymtrans_part_commit_vote(suite) -> [];
+asymtrans_part_commit_vote(Config) when is_list(Config) ->
?is_debug_compiled,
Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]),
[Coord, Part1, Part2] = Nodes,
@@ -1000,8 +1000,8 @@ asym_trans_kill_part_commit_vote(Config) when is_list(Config) ->
kill_after_debug_point(Part1, {Part1, {mnesia_tm, commit_participant, vote_yes}},
TransFun, [Tab1, Tab2], Nodes).
-asym_trans_kill_part_pre_commit(suite) -> [];
-asym_trans_kill_part_pre_commit(Config) when is_list(Config) ->
+asymtrans_part_pre_commit(suite) -> [];
+asymtrans_part_pre_commit(Config) when is_list(Config) ->
?is_debug_compiled,
Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]),
[Coord, Part1, Part2] = Nodes,
@@ -1011,8 +1011,8 @@ asym_trans_kill_part_pre_commit(Config) when is_list(Config) ->
kill_after_debug_point(Part1, {Part1, {mnesia_tm, commit_participant, pre_commit}},
TransFun, [Tab1, Tab2], Nodes).
-asym_trans_kill_part_log_commit(suite) -> [];
-asym_trans_kill_part_log_commit(Config) when is_list(Config) ->
+asymtrans_part_log_commit(suite) -> [];
+asymtrans_part_log_commit(Config) when is_list(Config) ->
?is_debug_compiled,
Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]),
[Coord, Part1, Part2] = Nodes,
@@ -1022,8 +1022,8 @@ asym_trans_kill_part_log_commit(Config) when is_list(Config) ->
kill_after_debug_point(Part1, {Part1, {mnesia_tm, commit_participant, log_commit}},
TransFun, [Tab1, Tab2], Nodes).
-asym_trans_kill_part_do_commit(suite) -> [];
-asym_trans_kill_part_do_commit(Config) when is_list(Config) ->
+asymtrans_part_do_commit(suite) -> [];
+asymtrans_part_do_commit(Config) when is_list(Config) ->
?is_debug_compiled,
Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]),
[Coord, Part1, Part2] = Nodes,
@@ -1033,8 +1033,8 @@ asym_trans_kill_part_do_commit(Config) when is_list(Config) ->
kill_after_debug_point(Part1, {Part1, {mnesia_tm, commit_participant, do_commit}},
TransFun, [Tab1, Tab2], Nodes).
-asym_trans_kill_coord_got_votes(suite) -> [];
-asym_trans_kill_coord_got_votes(Config) when is_list(Config) ->
+asymtrans_coord_got_votes(suite) -> [];
+asymtrans_coord_got_votes(Config) when is_list(Config) ->
?is_debug_compiled,
Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]),
[Coord, Part1, Part2] = Nodes,
@@ -1044,8 +1044,8 @@ asym_trans_kill_coord_got_votes(Config) when is_list(Config) ->
kill_after_debug_point(Coord, {Coord, {mnesia_tm, multi_commit_asym_got_votes}},
TransFun, [Tab1, Tab2], Nodes).
-asym_trans_kill_coord_pid_got_votes(suite) -> [];
-asym_trans_kill_coord_pid_got_votes(Config) when is_list(Config) ->
+asymtrans_coord_pid_got_votes(suite) -> [];
+asymtrans_coord_pid_got_votes(Config) when is_list(Config) ->
?is_debug_compiled,
Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]),
[Coord, Part1, Part2] = Nodes,
@@ -1055,8 +1055,8 @@ asym_trans_kill_coord_pid_got_votes(Config) when is_list(Config) ->
kill_after_debug_point(coord_pid, {Coord, {mnesia_tm, multi_commit_asym_got_votes}},
TransFun, [Tab1, Tab2], Nodes).
-asym_trans_kill_coord_log_commit_rec(suite) -> [];
-asym_trans_kill_coord_log_commit_rec(Config) when is_list(Config) ->
+asymtrans_coord_log_commit_rec(suite) -> [];
+asymtrans_coord_log_commit_rec(Config) when is_list(Config) ->
?is_debug_compiled,
Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]),
[Coord, Part1, Part2] = Nodes,
@@ -1066,8 +1066,8 @@ asym_trans_kill_coord_log_commit_rec(Config) when is_list(Config) ->
kill_after_debug_point(Coord, {Coord, {mnesia_tm, multi_commit_asym_log_commit_rec}},
TransFun, [Tab1, Tab2], Nodes).
-asym_trans_kill_coord_pid_log_commit_rec(suite) -> [];
-asym_trans_kill_coord_pid_log_commit_rec(Config) when is_list(Config) ->
+asymtrans_coord_pid_log_commit_rec(suite) -> [];
+asymtrans_coord_pid_log_commit_rec(Config) when is_list(Config) ->
?is_debug_compiled,
Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]),
[Coord, Part1, Part2] = Nodes,
@@ -1077,8 +1077,8 @@ asym_trans_kill_coord_pid_log_commit_rec(Config) when is_list(Config) ->
kill_after_debug_point(coord_pid, {Coord, {mnesia_tm, multi_commit_asym_log_commit_rec}},
TransFun, [Tab1, Tab2], Nodes).
-asym_trans_kill_coord_log_commit_dec(suite) -> [];
-asym_trans_kill_coord_log_commit_dec(Config) when is_list(Config) ->
+asymtrans_coord_log_commit_dec(suite) -> [];
+asymtrans_coord_log_commit_dec(Config) when is_list(Config) ->
?is_debug_compiled,
Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]),
[Coord, Part1, Part2] = Nodes,
@@ -1088,8 +1088,8 @@ asym_trans_kill_coord_log_commit_dec(Config) when is_list(Config) ->
kill_after_debug_point(Coord, {Coord, {mnesia_tm, multi_commit_asym_log_commit_dec}},
TransFun, [Tab1, Tab2], Nodes).
-asym_trans_kill_coord_pid_log_commit_dec(suite) -> [];
-asym_trans_kill_coord_pid_log_commit_dec(Config) when is_list(Config) ->
+asymtrans_coord_pid_log_commit_dec(suite) -> [];
+asymtrans_coord_pid_log_commit_dec(Config) when is_list(Config) ->
?is_debug_compiled,
Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]),
[Coord, Part1, Part2] = Nodes,
@@ -1099,8 +1099,8 @@ asym_trans_kill_coord_pid_log_commit_dec(Config) when is_list(Config) ->
kill_after_debug_point(coord_pid, {Coord, {mnesia_tm, multi_commit_asym_log_commit_dec}},
TransFun, [Tab1, Tab2], Nodes).
-asym_trans_kill_coord_rec_acc_pre_commit_log_commit(suite) -> [];
-asym_trans_kill_coord_rec_acc_pre_commit_log_commit(Config) when is_list(Config) ->
+asymtrans_coord_rec_acc_pre_commit_log_commit(suite) -> [];
+asymtrans_coord_rec_acc_pre_commit_log_commit(Config) when is_list(Config) ->
?is_debug_compiled,
Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]),
[Coord, Part1, Part2] = Nodes,
@@ -1110,8 +1110,8 @@ asym_trans_kill_coord_rec_acc_pre_commit_log_commit(Config) when is_list(Config)
kill_after_debug_point(Coord, {Coord, {mnesia_tm, rec_acc_pre_commit_log_commit}},
TransFun, [Tab1, Tab2], Nodes).
-asym_trans_kill_coord_pid_rec_acc_pre_commit_log_commit(suite) -> [];
-asym_trans_kill_coord_pid_rec_acc_pre_commit_log_commit(Config) when is_list(Config) ->
+asymtrans_coord_pid_rec_acc_pre_commit_log_commit(suite) -> [];
+asymtrans_coord_pid_rec_acc_pre_commit_log_commit(Config) when is_list(Config) ->
?is_debug_compiled,
Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]),
[Coord, Part1, Part2] = Nodes,
@@ -1121,8 +1121,8 @@ asym_trans_kill_coord_pid_rec_acc_pre_commit_log_commit(Config) when is_list(Con
kill_after_debug_point(coord_pid, {Coord, {mnesia_tm, rec_acc_pre_commit_log_commit}},
TransFun, [Tab1, Tab2], Nodes).
-asym_trans_kill_coord_rec_acc_pre_commit_done_commit(suite) -> [];
-asym_trans_kill_coord_rec_acc_pre_commit_done_commit(Config) when is_list(Config) ->
+asymtrans_coord_rec_acc_pre_commit_done_commit(suite) -> [];
+asymtrans_coord_rec_acc_pre_commit_done_commit(Config) when is_list(Config) ->
?is_debug_compiled,
Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]),
[Coord, Part1, Part2] = Nodes,
@@ -1132,8 +1132,8 @@ asym_trans_kill_coord_rec_acc_pre_commit_done_commit(Config) when is_list(Config
kill_after_debug_point(Coord, {Coord, {mnesia_tm, rec_acc_pre_commit_done_commit}},
TransFun, [Tab1, Tab2], Nodes).
-asym_trans_kill_coord_pid_rec_acc_pre_commit_done_commit(suite) -> [];
-asym_trans_kill_coord_pid_rec_acc_pre_commit_done_commit(Config) when is_list(Config) ->
+asymtrans_coord_pid_rec_acc_pre_commit_done_commit(suite) -> [];
+asymtrans_coord_pid_rec_acc_pre_commit_done_commit(Config) when is_list(Config) ->
?is_debug_compiled,
Nodes = ?acquire_nodes(3, Config ++ [{tc_timeout, timer:minutes(2)}]),
[Coord, Part1, Part2] = Nodes,
diff --git a/lib/mnesia/test/mnesia_test_lib.erl b/lib/mnesia/test/mnesia_test_lib.erl
index ba5bf84e24..57cbc61495 100644
--- a/lib/mnesia/test/mnesia_test_lib.erl
+++ b/lib/mnesia/test/mnesia_test_lib.erl
@@ -272,25 +272,13 @@ slave_start_link(Host, Name, Retries) ->
end.
starter(Host, Name, Args) ->
- case os:type() of
- vxworks ->
- X = test_server:start_node(Name, slave, [{args,Args}]),
- timer:sleep(5000),
- X;
- _ ->
- slave:start(Host, Name, Args)
- end.
+ slave:start(Host, Name, Args).
slave_sup() ->
process_flag(trap_exit, true),
receive
{'EXIT', _, _} ->
- case os:type() of
- vxworks ->
- erlang:halt();
- _ ->
- ignore
- end
+ ignore
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/lib/mnesia/test/mnesia_trans_access_test.erl b/lib/mnesia/test/mnesia_trans_access_test.erl
index c040d0ca3f..157e441b27 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -896,6 +896,10 @@ index_update_bag(Config)when is_list(Config) ->
?match({atomic, [Rec1]},
mnesia:transaction(fun() -> mnesia:index_read(Tab, 2, ValPos) end)),
+ ?match({atomic, ok}, mnesia:transaction(fun() -> mnesia:delete_object(Rec5) end)),
+ ?match({atomic, [Rec1]},
+ mnesia:transaction(fun() -> mnesia:index_read(Tab, 2, ValPos) end)),
+
?match({atomic, ok},
mnesia:transaction(fun() -> mnesia:write(Rec2) end)),
{atomic, R1} = mnesia:transaction(fun() -> mnesia:index_read(Tab, 2, ValPos) end),
diff --git a/lib/mnesia/vsn.mk b/lib/mnesia/vsn.mk
index 080548acac..6d5df448c9 100644
--- a/lib/mnesia/vsn.mk
+++ b/lib/mnesia/vsn.mk
@@ -1 +1 @@
-MNESIA_VSN = 4.6
+MNESIA_VSN = 4.7.1
diff --git a/lib/observer/doc/src/Makefile b/lib/observer/doc/src/Makefile
index cd9f9466ca..0f564d3299 100644
--- a/lib/observer/doc/src/Makefile
+++ b/lib/observer/doc/src/Makefile
@@ -133,16 +133,16 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man6
- $(INSTALL_DATA) $(MAN6_FILES) $(RELEASE_PATH)/man/man6
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man6"
+ $(INSTALL_DATA) $(MAN6_FILES) "$(RELEASE_PATH)/man/man6"
release_spec:
diff --git a/lib/observer/doc/src/etop.xml b/lib/observer/doc/src/etop.xml
index 78047caab3..af6bb2442b 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>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -114,6 +114,37 @@ Default: <c>on</c></item>
</description>
<funcs>
<func>
+ <name>start() -> ok</name>
+ <fsummary>Start etop</fsummary>
+ <desc>
+ <p>This function starts <c>etop</c>.
+ Note that etop is preferably started with the etop and getop scripts</p>
+ </desc>
+ </func>
+ <func>
+ <name>start(Options) -> ok</name>
+ <fsummary>Start etop</fsummary>
+ <type>
+ <v>Options = [Option]</v>
+ <v>Option = {Key, Value}</v>
+ <v>Key = atom()</v>
+ <v>Value = term()</v>
+ </type>
+ <desc>
+ <p>This function starts <c>etop</c>. Use
+ <seealso marker="#help/0">help/0</seealso> to see a
+ description of the possible options.</p>
+ </desc>
+ </func>
+ <func>
+ <name>help() -> ok</name>
+ <fsummary>Print etop's help</fsummary>
+ <desc>
+ <p>This function prints the help of <c>etop</c> and
+ its options.</p>
+ </desc>
+ </func>
+ <func>
<name>config(Key,Value) -> Result</name>
<fsummary>Change tool's configuration</fsummary>
<type>
diff --git a/lib/observer/doc/src/notes.xml b/lib/observer/doc/src/notes.xml
index a9554a08f4..ea665eee88 100644
--- a/lib/observer/doc/src/notes.xml
+++ b/lib/observer/doc/src/notes.xml
@@ -31,6 +31,75 @@
<p>This document describes the changes made to the Observer
application.</p>
+<section><title>Observer 1.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ The module name in the link to the detail page for each
+ loaded module was earlier not URL encoded. If the module
+ name contained e.g. a # this could cause the crashdump
+ viewer to crash when opening the link. This has been
+ corrected.</p>
+ <p>
+ Own Id: OTP-10090 Aux Id: seq12068 </p>
+ </item>
+ <item>
+ <p>
+ Escape control characters in Table Viewer</p>
+ <p>
+ Similar behaviour to old tv. Objects in tables supposed
+ to be printed in a single line and it looks ugly when a
+ [...,10,...] integer list creates a new-line. Fix Table
+ Viewer search crash on new|changed|deleted rows.</p>
+ <p>
+ Fix Table Viewer crash after a 'Found' -&gt; 'Not found'
+ search sequence</p>
+ <p>
+ Start position was lost after a 'Found' -&gt; 'Not found'
+ search sequence leading an undefined position in the next
+ search. Thanks to Peti G�mori</p>
+ <p>
+ Own Id: OTP-10218</p>
+ </item>
+ <item>
+ <p>
+ observer: fix app file (Noticed-by: Motiejus Jakstys)</p>
+ <p>
+ Add missing observer modules to observer.app.src. Thanks
+ to Tuncer Ayaz.</p>
+ <p>
+ Own Id: OTP-10221</p>
+ </item>
+ <item>
+ <p>
+ Make Table Viewer search a bit faster</p>
+ <p>
+ Edit table row in a multiline text dialog. Thanks to Peti
+ Gomori.</p>
+ <p>
+ Own Id: OTP-10225</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>Allow tracing on bifs.</p> <p>Ask epmd for local
+ nodes, and remember users last input in connect.</p>
+ <p>Fix crashes when a table or process information could
+ not be retrieved.</p>
+ <p>
+ Own Id: OTP-10075</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Observer 1.0</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/observer/priv/erlang_observer.png b/lib/observer/priv/erlang_observer.png
index 78e70461b1..01723d210b 100644
--- a/lib/observer/priv/erlang_observer.png
+++ b/lib/observer/priv/erlang_observer.png
Binary files differ
diff --git a/lib/observer/src/Makefile b/lib/observer/src/Makefile
index ca26afc11d..7135a6abd5 100644
--- a/lib/observer/src/Makefile
+++ b/lib/observer/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2012. 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
@@ -45,6 +45,7 @@ MODULES= \
observer_app_wx \
observer_lib \
observer_wx \
+ observer_perf_wx \
observer_pro_wx \
observer_procinfo \
observer_sys_wx \
@@ -128,20 +129,20 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/examples
- $(INSTALL_DATA) $(EXAMPLE_FILES) $(RELSYSDIR)/examples
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/priv/bin
- $(INSTALL_SCRIPT) $(EXECUTABLES) $(RELSYSDIR)/priv/bin
- $(INSTALL_DIR) $(RELSYSDIR)/priv/crashdump_viewer
- $(INSTALL_DATA) $(WEBTOOLFILES) $(RELSYSDIR)/priv
- $(INSTALL_DATA) $(GIF_FILES) $(RELSYSDIR)/priv/crashdump_viewer
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples"
+ $(INSTALL_DATA) $(EXAMPLE_FILES) "$(RELSYSDIR)/examples"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/bin"
+ $(INSTALL_SCRIPT) $(EXECUTABLES) "$(RELSYSDIR)/priv/bin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/crashdump_viewer"
+ $(INSTALL_DATA) $(WEBTOOLFILES) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) $(GIF_FILES) "$(RELSYSDIR)/priv/crashdump_viewer"
release_docs_spec:
diff --git a/lib/observer/src/crashdump_viewer_html.erl b/lib/observer/src/crashdump_viewer_html.erl
index 24a80b1916..3151b83bfb 100644
--- a/lib/observer/src/crashdump_viewer_html.erl
+++ b/lib/observer/src/crashdump_viewer_html.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -1394,7 +1394,7 @@ timers_table(Timer) ->
td("ALIGN=right",Time)]).
loaded_mods_table(#loaded_mod{mod=Mod,current_size=CS,old_size=OS}) ->
- tr([td(href(["loaded_mod_details?mod=",Mod],Mod)),
+ tr([td(href(["loaded_mod_details?mod=",http_uri:encode(Mod)],Mod)),
td("ALIGN=right",CS),
td("ALIGN=right",OS)]).
diff --git a/lib/observer/src/etop.erl b/lib/observer/src/etop.erl
index 0bf1d68534..428757e5ce 100644
--- a/lib/observer/src/etop.erl
+++ b/lib/observer/src/etop.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -31,9 +31,9 @@
help() ->
io:format(
- "Usage of the erlang top program~n"
- "Options are set as command line parameters as in -node a@host -..~n"
- "or as parameter to etop:start([{node, a@host}, {...}])~n"
+ "Usage of the Erlang top program~n~n"
+ "Options are set as command line parameters as in -node my@host~n"
+ "or as parameters to etop:start([{node, my@host}, {...}]).~n~n"
"Options are:~n"
" node atom Required The erlang node to measure ~n"
" port integer The used port, NOTE: due to a bug this program~n"
diff --git a/lib/observer/src/etop_gui.erl b/lib/observer/src/etop_gui.erl
index ff1b8078ad..f5cc0deb38 100644
--- a/lib/observer/src/etop_gui.erl
+++ b/lib/observer/src/etop_gui.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -17,6 +17,13 @@
%% %CopyrightEnd%
%%
-module(etop_gui).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,create,4}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}}]).
+
-author('[email protected]').
-export([init/1,stop/1]).
diff --git a/lib/observer/src/observer.app.src b/lib/observer/src/observer.app.src
index 5c65ea5c8f..e881cb3c97 100644
--- a/lib/observer/src/observer.app.src
+++ b/lib/observer/src/observer.app.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -25,6 +25,18 @@
etop_gui,
etop_tr,
etop_txt,
+ observer,
+ observer_app_wx,
+ observer_lib,
+ observer_perf_wx,
+ observer_pro_wx,
+ observer_procinfo,
+ observer_sys_wx,
+ observer_trace_wx,
+ observer_traceoptions_wx,
+ observer_tv_table,
+ observer_tv_wx,
+ observer_wx,
ttb,
ttb_et]},
{registered, []},
diff --git a/lib/observer/src/observer_app_wx.erl b/lib/observer/src/observer_app_wx.erl
index 62046577ad..380532e90c 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. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -27,6 +27,12 @@
-include_lib("wx/include/wx.hrl").
-include("observer_defs.hrl").
+%% Import drawing wrappers
+-import(observer_perf_wx, [haveGC/1,
+ setPen/2, setFont/3, setBrush/2,
+ strokeLine/5, strokeLines/2, drawRoundedRectangle/6,
+ drawText/4, getTextExtent/2]).
+
-record(state,
{
parent,
@@ -37,7 +43,8 @@
current,
app,
sel,
- appmon
+ appmon,
+ usegc = false
}).
-record(paint, {font, pen, brush, sel, links}).
@@ -63,6 +70,8 @@
-define(ID_TRACE_TREE_PIDS, 106).
-define(ID_TRACE_TREE_NAMES, 107).
+-define(wxGC, wxGraphicsContext).
+
start_link(Notebook, Parent) ->
wx_object:start_link(?MODULE, [Notebook, Parent], []).
@@ -99,22 +108,34 @@ init([Notebook, Parent]) ->
wxPanel:connect(DrawingArea, left_up),
wxPanel:connect(DrawingArea, left_dclick),
wxPanel:connect(DrawingArea, right_down),
+ case os:type() of
+ {win32, _} -> %% Ignore erase on windows
+ wxPanel:connect(DrawingArea, erase_background, [{callback, fun(_,_) -> ok end}]);
+ _ -> ok
+ end,
- DefFont = wxSystemSettings:getFont(?wxSYS_DEFAULT_GUI_FONT),
+ UseGC = haveGC(DrawingArea),
+ Font = case os:type() of
+ {unix,_} when UseGC ->
+ wxFont:new(12,?wxFONTFAMILY_DECORATIVE,?wxFONTSTYLE_NORMAL,?wxFONTWEIGHT_NORMAL);
+ _ ->
+ wxSystemSettings:getFont(?wxSYS_DEFAULT_GUI_FONT)
+ end,
SelCol = wxSystemSettings:getColour(?wxSYS_COLOUR_HIGHLIGHT),
+ GreyBrush = wxBrush:new({230,230,240}),
SelBrush = wxBrush:new(SelCol),
LinkPen = wxPen:new(SelCol, [{width, 2}]),
- %% GC = wxGraphicsContext:create(DrawingArea),
- %% _Font = wxGraphicsContext:createFont(GC, DefFont),
+ process_flag(trap_exit, true),
{Panel, #state{parent=Parent,
panel =Panel,
apps_w=Apps,
app_w =DrawingArea,
- paint=#paint{font= DefFont,
- pen= ?wxBLACK_PEN,
- brush=?wxLIGHT_GREY_BRUSH,
- sel= SelBrush,
- links=LinkPen
+ usegc = UseGC,
+ paint=#paint{font = Font,
+ pen = wxPen:new({80,80,80}, [{width, 2}]),
+ brush= GreyBrush,
+ sel = SelBrush,
+ links= LinkPen
}
}}.
@@ -126,11 +147,11 @@ setup_scrollbar({CW, CH}, AppWin, #app{dim={W0,H0}}) ->
H = max(H0,CH),
PPC = 20,
if W0 =< CW, H0 =< CH ->
- wxScrolledWindow:setScrollbars(AppWin, W, H, 1, 1);
+ wxScrolledWindow:setScrollbars(AppWin, W, H, 0, 0);
H0 =< CH ->
- wxScrolledWindow:setScrollbars(AppWin, PPC, H, W div PPC+1, 1);
+ wxScrolledWindow:setScrollbars(AppWin, PPC, H, W div PPC+1, 0);
W0 =< CW ->
- wxScrolledWindow:setScrollbars(AppWin, W, PPC, 1, H div PPC+1);
+ wxScrolledWindow:setScrollbars(AppWin, W, PPC, 0, H div PPC+1);
true ->
wxScrolledWindow:setScrollbars(AppWin, PPC, PPC, W div PPC+1, H div PPC+1)
end;
@@ -183,7 +204,7 @@ handle_event(#wx{id=?ID_PROC_MSG, event=#wxCommand{type=command_menu_selected}},
handle_event(#wx{id=?ID_PROC_KILL, event=#wxCommand{type=command_menu_selected}},
State = #state{panel=Panel, sel={#box{s1=#str{pid=Pid}},_}}) ->
- case observer_lib:user_term(Panel, "Enter Exit Reason", "") of
+ case observer_lib:user_term(Panel, "Enter Exit Reason", "kill") of
cancel -> ok;
{ok, Term} -> exit(Pid, Term);
{error, Error} -> observer_lib:display_info_dialog(Error)
@@ -215,12 +236,28 @@ handle_event(Event, _State) ->
%%%%%%%%%%
handle_sync_event(#wx{event = #wxPaint{}},_,
- #state{app_w=DA, app=App, sel=Sel, paint=Paint}) ->
+ #state{app_w=DA, app=App, sel=Sel, paint=Paint, usegc=UseGC}) ->
%% PaintDC must be created in a callback to work on windows.
- DC = wxPaintDC:new(DA),
- wxScrolledWindow:doPrepareDC(DA,DC),
+ IsWindows = element(1, os:type()) =:= win32,
+ %% Avoid Windows flickering hack
+ DC = if IsWindows -> wx:typeCast(wxBufferedPaintDC:new(DA), wxPaintDC);
+ true -> wxPaintDC:new(DA)
+ end,
+ IsWindows andalso wxDC:clear(DC),
+ GC = case UseGC of
+ true ->
+ GC0 = ?wxGC:create(DC),
+ %% Argh must handle scrolling when using ?wxGC
+ {Sx,Sy} = wxScrolledWindow:calcScrolledPosition(DA, {0,0}),
+ ?wxGC:translate(GC0, Sx,Sy),
+ GC0;
+ false ->
+ wxScrolledWindow:doPrepareDC(DA,DC),
+ DC
+ end,
%% Nothing is drawn until wxPaintDC is destroyed.
- draw(DC, App, Sel, Paint),
+ draw({UseGC, GC}, App, Sel, Paint),
+ UseGC andalso ?wxGC:destroy(GC),
wxPaintDC:destroy(DC),
ok.
%%%%%%%%%%
@@ -232,43 +269,60 @@ handle_cast(Event, _State) ->
%%%%%%%%%%
handle_info({active, Node}, State = #state{parent=Parent, current=Curr, appmon=Appmon}) ->
create_menus(Parent, []),
- {ok, Pid} = appmon_info:start_link(Node, self(), []),
- case Appmon of
- undefined -> ok;
- Pid -> ok;
- _ -> %% Deregister me as client (and stop appmon if last)
- exit(Appmon, normal)
- end,
+ Pid = try
+ Node = node(Appmon),
+ Appmon
+ catch _:_ ->
+ {ok, P} = appmon_info:start_link(Node, self(), []),
+ P
+ end,
appmon_info:app_ctrl(Pid, Node, true, []),
(Curr =/= undefined) andalso appmon_info:app(Pid, Curr, true, []),
{noreply, State#state{appmon=Pid}};
-
-handle_info(not_active, State = #state{appmon=AppMon, current=Prev}) ->
+handle_info(not_active, State = #state{appmon=AppMon}) ->
appmon_info:app_ctrl(AppMon, node(AppMon), false, []),
- (Prev =/= undefined) andalso appmon_info:app(AppMon, Prev, false, []),
- {noreply, State};
-
+ lists:member(node(AppMon), nodes()) andalso exit(AppMon, normal),
+ observer_wx:set_status(""),
+ {noreply, State#state{appmon=undefined}};
handle_info({delivery, Pid, app_ctrl, _, Apps0},
- State = #state{appmon=Pid, apps_w=LBox}) ->
+ State = #state{appmon=Pid, apps_w=LBox, current=Curr0}) ->
Apps = [atom_to_list(App) || {_, App, {_, _, _}} <- Apps0],
wxListBox:clear(LBox),
wxListBox:appendStrings(LBox, [App || App <- lists:sort(Apps)]),
- {noreply, State};
-
+ case Apps of
+ [App|_] when Curr0 =:= undefined ->
+ Curr = list_to_atom(App),
+ appmon_info:app(Pid, Curr, true, []),
+ {noreply, State#state{current=Curr}};
+ _ ->
+ {noreply, State}
+ end;
handle_info({delivery, _Pid, app, _Curr, {[], [], [], []}},
State = #state{panel=Panel}) ->
wxWindow:refresh(Panel),
{noreply, State#state{app=undefined, sel=undefined}};
handle_info({delivery, Pid, app, Curr, AppData},
- State = #state{panel=Panel, appmon=Pid, current=Curr,
+ State = #state{panel=Panel, appmon=Pid, current=Curr, usegc=UseGC,
app_w=AppWin, paint=#paint{font=Font}}) ->
- App = build_tree(AppData, {AppWin,Font}),
+ GC = if UseGC -> ?wxGC:create(AppWin);
+ true -> wxWindowDC:new(AppWin)
+ end,
+ FontW = {UseGC, GC},
+ setFont(FontW, Font, {0,0,0}),
+ App = build_tree(AppData, FontW),
+ if UseGC -> ?wxGC:destroy(GC);
+ true -> wxWindowDC:destroy(GC)
+ end,
setup_scrollbar(AppWin, App),
wxWindow:refresh(Panel),
wxWindow:layout(Panel),
{noreply, State#state{app=App, sel=undefined}};
+handle_info({'EXIT', _, noconnection}, State) ->
+ {noreply, State};
+handle_info({'EXIT', _, normal}, State) ->
+ {noreply, State};
handle_info(_Event, State) ->
%% io:format("~p:~p: ~p~n",[?MODULE,?LINE,_Event]),
{noreply, State}.
@@ -286,6 +340,7 @@ handle_mouse_click(Node = {#box{s1=#str{pid=Pid}},_}, Type,
right_down -> popup_menu(Panel);
_ -> ok
end,
+ observer_wx:set_status(io_lib:format("Pid: ~p", [Pid])),
wxWindow:refresh(AppWin),
State#state{sel=Node};
handle_mouse_click(_, _, State = #state{sel=undefined}) ->
@@ -294,6 +349,7 @@ handle_mouse_click(_, right_down, State=#state{panel=Panel}) ->
popup_menu(Panel),
State;
handle_mouse_click(_, _, State=#state{app_w=AppWin}) ->
+ observer_wx:set_status(""),
wxWindow:refresh(AppWin),
State#state{sel=undefined}.
@@ -321,10 +377,11 @@ popup_menu(Panel) ->
wxMenu:append(Menu, ?ID_TRACE_NAME, "Trace named process"),
wxMenu:append(Menu, ?ID_TRACE_TREE_PIDS, "Trace process tree"),
wxMenu:append(Menu, ?ID_TRACE_TREE_NAMES, "Trace named process tree"),
+ wxMenu:append(Menu, ?ID_PROC_MSG, "Send Msg"),
+ wxMenu:append(Menu, ?ID_PROC_KILL, "Kill process"),
wxWindow:popupMenu(Panel, Menu),
wxMenu:destroy(Menu).
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
locate_node(X, _Y, [{Box=#box{x=BX}, _Chs}|_Rest])
when X < BX ->
@@ -354,11 +411,11 @@ locate_box(From, []) -> {false, From}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-build_tree({Root, P2Name, Links, XLinks0}, Font) ->
+build_tree({Root, P2Name, Links, XLinks0}, FontW) ->
Fam = sofs:relation_to_family(sofs:relation(Links)),
Name2P = gb_trees:from_orddict(lists:sort([{Name,Pid} || {Pid,Name} <- P2Name])),
Lookup = gb_trees:from_orddict(sofs:to_external(Fam)),
- {_, Tree0} = build_tree2(Root, Lookup, Name2P, Font),
+ {_, Tree0} = build_tree2(Root, Lookup, Name2P, FontW),
{Tree, Dim} = calc_tree_size(Tree0),
Fetch = fun({From, To}, Acc) ->
try {value, ToPid} = gb_trees:lookup(To, Name2P),
@@ -371,18 +428,18 @@ build_tree({Root, P2Name, Links, XLinks0}, Font) ->
XLinks = lists:foldl(Fetch, [], XLinks0),
#app{ptree=Tree, dim=Dim, links=XLinks}.
-build_tree2(Root, Tree0, N2P, Font) ->
+build_tree2(Root, Tree0, N2P, FontW) ->
case gb_trees:lookup(Root, Tree0) of
- none -> {Tree0, {box(Root, N2P, Font), []}};
+ none -> {Tree0, {box(Root, N2P, FontW), []}};
{value, Children} ->
Tree1 = gb_trees:delete(Root, Tree0),
{Tree, CHs} = lists:foldr(fun("port " ++_, Acc) ->
Acc; %% Skip ports
(Child,{T0, Acc}) ->
- {T, C} = build_tree2(Child, T0, N2P, Font),
+ {T, C} = build_tree2(Child, T0, N2P, FontW),
{T, [C|Acc]}
end, {Tree1, []}, Children),
- {Tree, {box(Root, N2P, Font), CHs}}
+ {Tree, {box(Root, N2P, FontW), CHs}}
end.
calc_tree_size(Tree) ->
@@ -427,15 +484,15 @@ middle([{#box{y=Y0},_}|List], _) ->
{#box{y=Y1},_} = lists:last(List),
(Y0+Y1) div 2.
-box(Str0, N2P, {Win,Font}) ->
+box(Str0, N2P, FontW) ->
Pid = gb_trees:get(Str0, N2P),
Str = if hd(Str0) =:= $< -> lists:append(io_lib:format("~w", [Pid]));
true -> Str0
end,
- {TW,TH, _, _} = wxWindow:getTextExtent(Win, Str, [{theFont, Font}]),
+ {TW,TH} = getTextExtent(FontW, Str),
Data = #str{text=Str, x=?BX_HE, y=?BY_HE, pid=Pid},
%% Add pid
- #box{w=TW+?BX_E, h=TH+?BY_E, s1=Data}.
+ #box{w=round(TW)+?BX_E, h=round(TH)+?BY_E, s1=Data}.
box_to_pid(#box{s1=#str{pid=Pid}}) -> Pid.
box_to_reg(#box{s1=#str{text=[$<|_], pid=Pid}}) -> Pid;
@@ -453,39 +510,30 @@ draw(_DC, undefined, _, _) ->
ok;
draw(DC, #app{dim={_W,_H}, ptree=Tree, links=Links}, Sel,
#paint{font=Font, pen=Pen, brush=Brush, links=LPen, sel=SelBrush}) ->
- %% Canvas = wxGraphicsContext:create(DC),
- %% Pen = wxGraphicsContext:createPen(Canvas, ?wxBLACK_PEN),
- %% wxGraphicsContext:setPen(Canvas, Pen),
- %% Brush = wxGraphicsContext:createBrush(Canvas, ?wxLIGHT_GREY_BRUSH),
- %% wxGraphicsContext:setBrush(Canvas, Brush),
- %% Font = wxGraphicsContext:createFont(Canvas, wxSystemSettings:getFont(?wxSYS_DEFAULT_GUI_FONT)),
- %% wxGraphicsContext:setFont(Canvas, Font),
- %% draw_tree(Tree, Canvas).
- wxDC:setPen(DC, LPen),
+ setPen(DC, LPen),
[draw_xlink(Link, DC) || Link <- Links],
- wxDC:setPen(DC, Pen),
- %% wxDC:drawRectangle(DC, {2,2}, {W-2,H-2}), %% DEBUG
- wxDC:setBrush(DC, Brush),
- wxDC:setFont(DC, Font),
+ setPen(DC, Pen),
+ %% ?wxGC:drawRectangle(DC, 2,2, _W-2,_H-2), %% DEBUG
+ setBrush(DC, Brush),
+ setFont(DC, Font, {0,0,0}),
draw_tree(Tree, root, DC),
case Sel of
undefined -> ok;
{#box{x=X,y=Y,w=W,h=H,s1=Str1}, _} ->
- wxDC:setBrush(DC, SelBrush),
- wxDC:drawRoundedRectangle(DC, {X-1,Y-1}, {W+2,H+2}, 8.0),
+ setBrush(DC, SelBrush),
+ drawRoundedRectangle(DC, X-1,Y-1, W+2,H+2, 8.0),
draw_str(DC, Str1, X, Y)
end.
draw_tree({Box=#box{x=X,y=Y,w=W,h=H,s1=Str1}, Chs}, Parent, DC) ->
- %%wxGraphicsContext:drawRoundedRectangle(DC, float(X), float(Y), float(W), float(H), 8.0),
- wxDC:drawRoundedRectangle(DC, {X,Y}, {W,H}, 8.0),
+ drawRoundedRectangle(DC, X,Y, W,H, 8.0),
draw_str(DC, Str1, X, Y),
Dot = case Chs of
[] -> ok;
[{#box{x=CX0},_}|_] ->
CY = Y+(H div 2),
CX = CX0-(?BB_X div 2),
- wxDC:drawLine(DC, {X+W, CY}, {CX, CY}),
+ strokeLine(DC, X+W, CY, CX, CY),
{CX, CY}
end,
draw_link(Parent, Box, DC),
@@ -495,9 +543,9 @@ draw_link({CX,CY}, #box{x=X,y=Y0,h=H}, DC) ->
Y = Y0+(H div 2),
case Y =:= CY of
true ->
- wxDC:drawLine(DC, {CX, CY}, {X, CY});
+ strokeLine(DC, CX, CY, X, CY);
false ->
- wxDC:drawLines(DC, [{CX, CY}, {CX, Y}, {X,Y}])
+ strokeLines(DC, [{CX, CY}, {CX, Y}, {X,Y}])
end;
draw_link(_, _, _) -> ok.
@@ -516,9 +564,8 @@ draw_xlink(X0, Y00, X1, Y11, BH, DC) ->
{Y0,Y1} = if Y00 < Y11 -> {Y00+BH-6, Y11+6};
true -> {Y00+6, Y11+BH-6}
end,
- wxDC:drawLines(DC, [{X0,Y0}, {X0+5,Y0}, {X1-5,Y1}, {X1,Y1}]).
+ strokeLines(DC, [{X0,Y0}, {X0+5,Y0}, {X1-5,Y1}, {X1,Y1}]).
draw_str(DC, #str{x=Sx,y=Sy, text=Text}, X, Y) ->
- %%wxGraphicsContext:drawText(DC, Text, float(Sx+X), float(Sy+Y));
- wxDC:drawText(DC, Text, {X+Sx,Y+Sy});
+ drawText(DC, Text, X+Sx,Y+Sy);
draw_str(_, _, _, _) -> ok.
diff --git a/lib/observer/src/observer_lib.erl b/lib/observer/src/observer_lib.erl
index 5260861497..4077f8371a 100644
--- a/lib/observer/src/observer_lib.erl
+++ b/lib/observer/src/observer_lib.erl
@@ -19,7 +19,7 @@
-module(observer_lib).
-export([get_wx_parent/1,
- display_info_dialog/1, user_term/3,
+ display_info_dialog/1, user_term/3, user_term_multiline/3,
interval_dialog/4, start_timer/1, stop_timer/1,
display_info/2, fill_info/2, update_info/2, to_str/1,
create_menus/3, create_menu_item/3,
@@ -154,7 +154,9 @@ to_str(Value) when is_atom(Value) ->
to_str({bytes, B}) ->
KB = B div 1024,
MB = KB div 1024,
+ GB = MB div 1024,
if
+ GB > 10 -> integer_to_list(GB) ++ " gB";
MB > 10 -> integer_to_list(MB) ++ " mB";
KB > 0 -> integer_to_list(KB) ++ " kB";
true -> integer_to_list(B) ++ " B "
@@ -345,6 +347,58 @@ user_term(Parent, Title, Default) ->
cancel
end.
+user_term_multiline(Parent, Title, Default) ->
+ Dialog = wxDialog:new(Parent, ?wxID_ANY, Title,
+ [{style, ?wxDEFAULT_DIALOG_STYLE bor
+ ?wxRESIZE_BORDER}]),
+ Panel = wxPanel:new(Dialog),
+
+ TextCtrl = wxTextCtrl:new(Panel, ?wxID_ANY,
+ [{value, Default},
+ {style, ?wxDEFAULT bor ?wxTE_MULTILINE}]),
+ Line = wxStaticLine:new(Panel, [{style, ?wxLI_HORIZONTAL}]),
+
+ Buttons = wxDialog:createButtonSizer(Dialog, ?wxOK bor ?wxCANCEL),
+
+ InnerSizer = wxBoxSizer:new(?wxVERTICAL),
+ wxSizer:add(InnerSizer, TextCtrl,
+ [{flag, ?wxEXPAND bor ?wxALL},{proportion, 1},{border, 5}]),
+ wxSizer:add(InnerSizer, Line,
+ [{flag, ?wxEXPAND},{proportion, 0},{border, 5}]),
+ wxPanel:setSizer(Panel, InnerSizer),
+
+ TopSizer = wxBoxSizer:new(?wxVERTICAL),
+ wxSizer:add(TopSizer, Panel,
+ [{flag, ?wxEXPAND bor ?wxALL},{proportion, 1},{border, 5}]),
+ wxSizer:add(TopSizer, Buttons,
+ [{flag, ?wxEXPAND bor ?wxBOTTOM bor ?wxRIGHT},{border, 10}]),
+
+ % calculate the size of TopSizer when the whole user_term
+ % fits in the TextCtrl
+ DC = wxClientDC:new(Panel),
+ W = wxDC:getCharWidth(DC),
+ H = wxDC:getCharHeight(DC),
+ {EW, EH} = wxDC:getMultiLineTextExtent(DC, Default),
+ wxSizer:setItemMinSize(InnerSizer, 0, EW+2*W, EH+H),
+ TopSize = wxSizer:getMinSize(TopSizer),
+ % reset min size of TextCtrl to 40 chararacters * 4 lines
+ wxSizer:setItemMinSize(InnerSizer, 0, 40*W, 4*H),
+
+ wxWindow:setSizerAndFit(Dialog, TopSizer),
+ wxSizer:setSizeHints(TopSizer, Dialog),
+
+ wxWindow:setClientSize(Dialog, TopSize),
+
+ case wxDialog:showModal(Dialog) of
+ ?wxID_OK ->
+ Str = wxTextCtrl:getValue(TextCtrl),
+ wxDialog:destroy(Dialog),
+ parse_string(ensure_last_is_dot(Str));
+ ?wxID_CANCEL ->
+ wxDialog:destroy(Dialog),
+ cancel
+ end.
+
parse_string(Str) ->
try
Tokens = case erl_scan:string(Str) of
diff --git a/lib/observer/src/observer_perf_wx.erl b/lib/observer/src/observer_perf_wx.erl
new file mode 100644
index 0000000000..abf90ac612
--- /dev/null
+++ b/lib/observer/src/observer_perf_wx.erl
@@ -0,0 +1,575 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+-module(observer_perf_wx).
+
+-export([start_link/2]).
+
+%% wx_object callbacks
+-export([init/1, handle_info/2, terminate/2, code_change/3, handle_call/3,
+ handle_event/2, handle_sync_event/3, handle_cast/2]).
+
+%% Drawing wrappers for DC and GC areas
+-export([haveGC/1,
+ setPen/2, setFont/3, setBrush/2,
+ strokeLine/5, strokeLines/2, drawRoundedRectangle/6,
+ drawText/4, getTextExtent/2]).
+
+-behaviour(wx_object).
+-include_lib("wx/include/wx.hrl").
+-include("observer_defs.hrl").
+
+-record(state,
+ {
+ offset = 0.0,
+ active = false,
+ parent,
+ windows,
+ data = {0, queue:new()},
+ panel,
+ paint,
+ appmon,
+ usegc = false
+ }).
+
+-define(wxGC, wxGraphicsContext).
+
+-record(paint, {font, small, pen, pen2, pens}).
+
+-define(RQ_W, 1).
+-define(MEM_W, 2).
+-define(IO_W, 3).
+
+start_link(Notebook, Parent) ->
+ wx_object:start_link(?MODULE, [Notebook, Parent], []).
+
+init([Notebook, Parent]) ->
+ try
+ Panel = wxPanel:new(Notebook),
+ Main = wxBoxSizer:new(?wxVERTICAL),
+ Style = ?wxFULL_REPAINT_ON_RESIZE bor ?wxCLIP_CHILDREN,
+ CPU = wxPanel:new(Panel, [{winid, ?RQ_W}, {style,Style}]),
+ wxWindow:setBackgroundColour(CPU, ?wxWHITE),
+ wxSizer:add(Main, CPU, [{flag, ?wxEXPAND bor ?wxALL},
+ {proportion, 1}, {border, 5}]),
+ MemIO = wxBoxSizer:new(?wxHORIZONTAL),
+ MEM = wxPanel:new(Panel, [{winid, ?MEM_W}, {style,Style}]),
+ wxWindow:setBackgroundColour(MEM, ?wxWHITE),
+ IO = wxPanel:new(Panel, [{winid, ?IO_W}, {style,Style}]),
+ wxWindow:setBackgroundColour(IO, ?wxWHITE),
+ wxSizer:add(MemIO, MEM, [{flag, ?wxEXPAND bor ?wxLEFT},
+ {proportion, 1}, {border, 5}]),
+ wxSizer:add(MemIO, IO, [{flag, ?wxEXPAND bor ?wxLEFT bor ?wxRIGHT},
+ {proportion, 1}, {border, 5}]),
+ wxSizer:add(Main, MemIO, [{flag, ?wxEXPAND bor ?wxDOWN},
+ {proportion, 1}, {border, 5}]),
+ wxWindow:setSizer(Panel, Main),
+
+ wxPanel:connect(CPU, paint, [callback]),
+ wxPanel:connect(IO, paint, [callback]),
+ wxPanel:connect(MEM, paint, [callback]),
+ case os:type() of
+ {win32, _} -> %% Ignore erase on windows
+ wxPanel:connect(CPU, erase_background, [{callback, fun(_,_) -> ok end}]),
+ wxPanel:connect(IO, erase_background, [{callback, fun(_,_) -> ok end}]),
+ wxPanel:connect(MEM, erase_background, [{callback, fun(_,_) -> ok end}]);
+ _ -> ok
+ end,
+
+ UseGC = haveGC(Panel),
+ {Font, SmallFont}
+ = case os:type() of
+ {unix, _} when UseGC ->
+ %% Def font is really small when using Graphics contexts for some reason
+ %% Hardcode it
+ F = wxFont:new(12,?wxFONTFAMILY_DECORATIVE,?wxFONTSTYLE_NORMAL,?wxFONTWEIGHT_BOLD),
+ SF = wxFont:new(10, ?wxFONTFAMILY_DECORATIVE, ?wxFONTSTYLE_NORMAL, ?wxFONTWEIGHT_NORMAL),
+ {F, SF};
+ _ ->
+ DefFont = wxSystemSettings:getFont(?wxSYS_DEFAULT_GUI_FONT),
+ DefSize = wxFont:getPointSize(DefFont),
+ DefFamily = wxFont:getFamily(DefFont),
+ F = wxFont:new(DefSize, DefFamily, ?wxFONTSTYLE_NORMAL, ?wxFONTWEIGHT_BOLD),
+ SF = wxFont:new(DefSize-1, DefFamily, ?wxFONTSTYLE_NORMAL, ?wxFONTWEIGHT_NORMAL),
+ {F, SF}
+ end,
+ BlackPen = wxPen:new({0,0,0}, [{width, 2}]),
+ Pens = [wxPen:new(Col, [{width, 2}]) || Col <- tuple_to_list(colors())],
+ process_flag(trap_exit, true),
+ {Panel, #state{parent=Parent,
+ panel =Panel,
+ windows = {CPU, MEM, IO},
+ usegc=UseGC,
+ paint=#paint{font = Font,
+ small = SmallFont,
+ pen = ?wxGREY_PEN,
+ pen2 = BlackPen,
+ pens = list_to_tuple(Pens)
+ }
+ }}
+ catch _:Err ->
+ io:format("~p crashed ~p: ~p~n",[?MODULE, Err, erlang:get_stacktrace()]),
+ {stop, Err}
+ end.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+handle_event(#wx{event=#wxCommand{type=command_menu_selected}},
+ State = #state{}) ->
+ {noreply, State};
+
+handle_event(Event, _State) ->
+ error({unhandled_event, Event}).
+
+%%%%%%%%%%
+handle_sync_event(#wx{obj=Panel, event = #wxPaint{}},_,
+ #state{active=Active, offset=Offset, paint=Paint,
+ windows=Windows, data=Data, usegc=UseGC}) ->
+ %% PaintDC must be created in a callback to work on windows.
+ %% Sigh workaround bug on MacOSX (Id in paint event is always 0)
+ %% Panel = element(Id, Windows),
+ Id = if Panel =:= element(?RQ_W, Windows) -> ?RQ_W;
+ Panel =:= element(?MEM_W, Windows) -> ?MEM_W;
+ Panel =:= element(?IO_W, Windows) -> ?IO_W
+ end,
+ IsWindows = element(1, os:type()) =:= win32,
+
+ DC = if IsWindows ->
+ %% Ugly hack to aviod flickering on windows, works on windows only
+ %% But the other platforms are doublebuffered by default
+ wx:typeCast(wxBufferedPaintDC:new(Panel), wxPaintDC);
+ true ->
+ wxPaintDC:new(Panel)
+ end,
+ IsWindows andalso wxDC:clear(DC),
+ GC = if UseGC -> ?wxGC:create(DC);
+ true -> DC
+ end,
+ %% Nothing is drawn until wxPaintDC is destroyed.
+ try
+ draw(Offset, Id, {UseGC, GC}, Panel, Paint, Data, Active)
+ catch _:Err ->
+ io:format("Internal error ~p ~p~n",[Err, erlang:get_stacktrace()])
+ end,
+ UseGC andalso ?wxGC:destroy(GC),
+ wxPaintDC:destroy(DC),
+ ok.
+%%%%%%%%%%
+handle_call(Event, From, _State) ->
+ error({unhandled_call, Event, From}).
+
+handle_cast(Event, _State) ->
+ error({unhandled_cast, Event}).
+%%%%%%%%%%
+handle_info(Stats = {stats, 1, _, _, _},
+ State = #state{panel=Panel, data=Data, active=Active}) ->
+ if Active ->
+ wxWindow:refresh(Panel),
+ Freq = 6,
+ erlang:send_after(trunc(1000 / Freq), self(), {refresh, 1, Freq});
+ true -> ignore
+ end,
+ {noreply, State#state{offset=0.0, data = add_data(Stats, Data)}};
+
+handle_info({refresh, Seq, Freq}, State = #state{panel=Panel, offset=Prev}) ->
+ wxWindow:refresh(Panel),
+ Next = Seq+1,
+ if Seq > 1, Prev =:= 0.0 ->
+ %% We didn't have time to handle the refresh
+ {noreply, State};
+ Next < Freq ->
+ erlang:send_after(trunc(1000 / Freq), self(), {refresh, Next, Freq}),
+ {noreply, State#state{offset=Seq/Freq}};
+ true ->
+ {noreply, State#state{offset=Seq/Freq}}
+ end;
+
+handle_info({active, Node}, State = #state{parent=Parent, panel=Panel, appmon=Old}) ->
+ create_menus(Parent, []),
+ try
+ Node = node(Old),
+ wxWindow:refresh(Panel),
+ {noreply, State#state{active=true}}
+ catch _:_ ->
+ catch Old ! exit,
+ Me = self(),
+ Pid = spawn_link(Node, observer_backend, fetch_stats, [Me, 1000]),
+ wxWindow:refresh(Panel),
+ {noreply, State#state{active=true, appmon=Pid, data={0, queue:new()}}}
+ end;
+
+handle_info(not_active, State = #state{appmon=_Pid}) ->
+ %% Pid ! exit,
+ {noreply, State#state{active=false}};
+
+handle_info({'EXIT', Old, _}, State = #state{appmon=Old}) ->
+ {noreply, State#state{active=false, appmon=undefined}};
+
+handle_info(_Event, State) ->
+ %% io:format("~p:~p: ~p~n",[?MODULE,?LINE,_Event]),
+ {noreply, State}.
+
+%%%%%%%%%%
+terminate(_Event, #state{appmon=Pid}) ->
+ catch Pid ! exit,
+ ok.
+code_change(_, _, State) ->
+ State.
+
+add_data(Stats, {N, Q}) when N > 60 ->
+ {N, queue:drop(queue:in(Stats, Q))};
+add_data(Stats, {N, Q}) ->
+ {N+1, queue:in(Stats, Q)}.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+create_menus(Parent, _) ->
+ MenuEntries =
+ [{"File",
+ [
+ ]}
+ ],
+ observer_wx:create_menus(Parent, MenuEntries).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+collect_data(?RQ_W, {N, Q}) ->
+ case queue:to_list(Q) of
+ [] -> {0, 0, []};
+ [_] -> {0, 0, []};
+ [{stats, _Ver, Init0, _IO, _Mem}|Data0] ->
+ Init = lists:sort(Init0),
+ [_|Data=[First|_]] = lists:foldl(fun({stats, _, T0, _, _}, [Prev|Acc]) ->
+ TN = lists:sort(T0),
+ Delta = calc_delta(TN, Prev),
+ [TN, list_to_tuple(Delta)|Acc]
+ end, [Init], Data0),
+ {N, lmax(Data), lists:reverse([First|Data])}
+ end;
+collect_data(?MEM_W, {N, Q}) ->
+ MemT = mem_types(),
+ Data = [list_to_tuple([Value || {Type,Value} <- MemInfo,
+ lists:member(Type, MemT)])
+ || {stats, _Ver, _RQ, _IO, MemInfo} <- queue:to_list(Q)],
+ {N, lmax(Data), Data};
+collect_data(?IO_W, {N, Q}) ->
+ case queue:to_list(Q) of
+ [] -> {0, 0, []};
+ [_] -> {0, 0, []};
+ [{stats, _Ver, _RQ, {{_,In0}, {_,Out0}}, _Mem}|Data0] ->
+ [_,_|Data=[First|_]] =
+ lists:foldl(fun({stats, _, _, {{_,In}, {_,Out}}, _}, [PIn,Pout|Acc]) ->
+ [In,Out,{In-PIn,Out-Pout}|Acc]
+ end, [In0,Out0], Data0),
+ {N, lmax(Data), lists:reverse([First|Data])}
+ end.
+
+mem_types() ->
+ [total, processes, atom, binary, code, ets].
+
+lmax([]) -> 0;
+lmax(List) ->
+ lists:max([lists:max(tuple_to_list(T)) || T <- List]).
+
+calc_delta([{Id, WN, TN}|Ss], [{Id, WP, TP}|Ps]) ->
+ [100*(WN-WP) div (TN-TP)|calc_delta(Ss, Ps)];
+calc_delta([], []) -> [].
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+draw(Offset, Id, DC, Panel, Paint=#paint{pens=Pens, small=Small}, Data, Active) ->
+ %% This can be optimized a lot by collecting data once
+ %% and draw to memory and then blit memory and only draw new entries in new memory
+ %% area. Hmm now rewritten to use ?wxGC I don't now if it is feasable.
+ {Len, Max0, Hs} = collect_data(Id, Data),
+ Max = calc_max(Max0),
+ NoGraphs = try tuple_size(hd(Hs)) catch _:_ -> 0 end,
+ Size = wxWindow:getClientSize(Panel),
+ {X0,Y0,WS,HS} = draw_borders(Id, NoGraphs, DC, Size, Max, Paint),
+ Last = 60*WS+X0-1,
+ Start = max(61-Len, 0)*WS+X0 - Offset*WS,
+ case Hs of
+ [] -> ignore;
+ [_] -> ignore;
+ _ ->
+ Draw = fun(N) ->
+ Lines = make_lines(Hs, Start, N, {X0,Max*HS,Last}, Y0, WS, HS),
+ setPen(DC, element(1+ ((N-1) rem tuple_size(Pens)), Pens)),
+ strokeLines(DC, Lines),
+ N+1
+ end,
+ [Draw(I) || I <- lists:seq(NoGraphs, 1, -1)]
+ end,
+ case Active of
+ false ->
+ NotActive = "Service not available",
+ setFont(DC, Small, {0,0,0}),
+ drawText(DC, NotActive, X0 + 100, element(2,Size) div 2);
+ true ->
+ ignore
+ end,
+ ok.
+
+make_lines(Ds = [Data|_], PX, N, Clip, ZeroY, WS, HS) ->
+ Y = element(N,Data),
+ make_lines(Ds, PX, N, Clip, ZeroY, WS, HS, Y, []).
+
+make_lines([D1 | Ds = [D2|Rest]], PX, N, Clip={Cx,Cy, _}, ZeroY, WS, HS, Y0, Acc0) ->
+ Y1 = element(N,D1),
+ Y2 = element(N,D2),
+ Y3 = case Rest of
+ [D3|_] -> element(N,D3);
+ [] -> Y2
+ end,
+ This = {max(Cx, PX),ZeroY-min(Cy,Y1*HS)},
+ Acc = if (abs(Y1-Y2) * HS) < 3.0 -> [This|Acc0];
+ WS < 3.0 -> [This|Acc0];
+ PX < Cx ->
+ make_splines(Y0,Y1,Y2,Y3,PX,Clip,ZeroY,WS,HS,Acc0);
+ true ->
+ make_splines(Y0,Y1,Y2,Y3,PX,Clip,ZeroY,WS,HS,[This|Acc0])
+ end,
+ make_lines(Ds, PX+WS, N, Clip, ZeroY, WS, HS, Y1, Acc);
+make_lines([D1], _PX, N, {_,Cy,Last}, ZeroY, _WS, HS, _Y0, Acc) ->
+ Y1 = element(N,D1),
+ [{Last,ZeroY-min(Cy, Y1*HS)}|Acc].
+
+make_splines(Y00,Y10,Y20,Y30,PX,Clip,ZeroY,WS,HS,Acc) ->
+ Y1 = Y10*HS,
+ Y2 = Y20*HS,
+ Steps = min(abs(Y1-Y2), WS),
+ if Steps > 2 ->
+ Y0 = Y00*HS,
+ Y3 = Y30*HS,
+ Tan = spline_tan(Y0,Y1,Y2,Y3),
+ Delta = 1/Steps,
+ splines(Steps-1, 0.0, Delta, Tan, Y1,Y2, PX, Clip,ZeroY, Delta*WS, Acc);
+ true ->
+ Acc
+ end.
+
+splines(N, XD, XD0, Tan, Y1,Y2, PX0, Clip={Cx,Cy,_},ZeroY, WS, Acc) when N > 0 ->
+ PX = PX0+WS,
+ Delta = XD+XD0,
+ if PX < Cx ->
+ splines(N-1, Delta, XD0, Tan, Y1, Y2, PX, Clip,ZeroY, WS, Acc);
+ true ->
+ Y = min(Cy, max(0,spline(Delta, Tan, Y1,Y2))),
+ splines(N-1, Delta, XD0, Tan, Y1, Y2, PX, Clip,ZeroY, WS,
+ [{PX, ZeroY-Y}|Acc])
+ end;
+splines(_N, _XD, _XD0, _Tan, _Y1,_Y2, _PX, _Clip,_ZeroY, _WS, Acc) -> Acc.
+
+spline(T, {M1, M2}, Y1, Y2) ->
+ %% Hermite Basis Funcs
+ T2 = T*T, T3 = T*T*T,
+ H1 = 2*T3-3*T2+1,
+ H2 = -2*T3+3*T2,
+ H3 = T3-2*T2+T,
+ H4 = T3-T2,
+ %% Result
+ M1*H3 + Y1*H1 + Y2*H2 + M2*H4.
+
+spline_tan(Y0, Y1, Y2, Y3) ->
+ S = 1.0,
+ C = 0.5,
+ %% Calc tangent values
+ M1 = S*C*(Y2-Y0),
+ M2 = S*C*(Y3-Y1),
+ {M1,M2}.
+
+-define(BW, 5).
+-define(BH, 5).
+
+draw_borders(Type, NoGraphs, DC, {W,H}, Max,
+ #paint{pen=Pen, pen2=Pen2, font=Font, small=Small}) ->
+ {Unit, MaxUnit} = bytes(Type, Max),
+ Str1 = observer_lib:to_str(MaxUnit),
+ Str2 = observer_lib:to_str(MaxUnit div 2),
+ Str3 = observer_lib:to_str(0),
+
+ setFont(DC, Font, {0,0,0}),
+ {TW,TH} = getTextExtent(DC, Str1),
+ {SpaceW, _} = getTextExtent(DC, "W"),
+
+ GraphX0 = ?BW+TW+?BW,
+ GraphX1 = W-?BW*4,
+ TopTextX = ?BW+TW+?BW,
+ MaxTextY = ?BH+TH+?BH,
+ BottomTextY = H-?BH-TH,
+ SecondsY = BottomTextY - ?BH - TH,
+ GraphY0 = MaxTextY + (TH / 2),
+ GraphY1 = SecondsY - ?BH,
+ GraphW = GraphX1-GraphX0-1,
+ GraphH = GraphY1-GraphY0-1,
+ GraphY25 = GraphY0 + (GraphY1 - GraphY0) / 4,
+ GraphY50 = GraphY0 + (GraphY1 - GraphY0) / 2,
+ GraphY75 = GraphY0 + 3*(GraphY1 - GraphY0) / 4,
+ ScaleW = GraphW / 60,
+ ScaleH = GraphH / Max,
+
+ setFont(DC, Small, {0,0,0}),
+ Align = fun(Str, Y) ->
+ {StrW, _} = getTextExtent(DC, Str),
+ drawText(DC, Str, GraphX0 - StrW - ?BW, Y)
+ end,
+ Align(Str1, MaxTextY),
+ Align(Str2, GraphY50 - (TH / 2)),
+ Align(Str3, GraphY1 - (TH / 2) + 1),
+
+ setPen(DC, Pen),
+ DrawSecs = fun(Secs, Pos) ->
+ Str = [observer_lib:to_str(Secs)|" s"],
+ X = GraphX0+Pos,
+ drawText(DC, Str, X-SpaceW, SecondsY),
+ strokeLine(DC, X, GraphY0, X, GraphY1+5),
+ Pos + 10*ScaleW
+ end,
+ lists:foldl(DrawSecs, 0, lists:seq(60,0, -10)),
+
+ strokeLine(DC, GraphX0-3, GraphY25, GraphX1, GraphY25),
+ strokeLine(DC, GraphX0-3, GraphY50, GraphX1, GraphY50),
+ strokeLine(DC, GraphX0-3, GraphY75, GraphX1, GraphY75),
+
+ setPen(DC, Pen2),
+ strokeLines(DC, [{GraphX0, GraphY0-1}, {GraphX0, GraphY1+1},
+ {GraphX1, GraphY1+1}, {GraphX1, GraphY0-1},
+ {GraphX0, GraphY0-1}]),
+
+ setFont(DC, Font, {0,0,0}),
+ case Type of
+ ?RQ_W -> drawText(DC, "Scheduler Utilization (%) ", TopTextX,?BH);
+ ?MEM_W -> drawText(DC, "Memory Usage " ++ Unit, TopTextX,?BH);
+ ?IO_W -> drawText(DC, "IO Usage " ++ Unit, TopTextX,?BH)
+ end,
+
+ Text = fun(X,Y, Str, PenId) ->
+ if PenId == 0 ->
+ setFont(DC, Font, {0,0,0});
+ PenId > 0 ->
+ Id = 1 + ((PenId-1) rem tuple_size(colors())),
+ setFont(DC, Font, element(Id, colors()))
+ end,
+ drawText(DC, Str, X, Y),
+ {StrW, _} = getTextExtent(DC, Str),
+ StrW + X + SpaceW
+ end,
+ case Type of
+ ?RQ_W ->
+ TN0 = Text(?BW, BottomTextY, "Scheduler: ", 0),
+ lists:foldl(fun(Id, Pos0) ->
+ Text(Pos0, BottomTextY, integer_to_list(Id), Id)
+ end, TN0, lists:seq(1, NoGraphs));
+ ?MEM_W ->
+ lists:foldl(fun(MType, {PenId, Pos0}) ->
+ Str = uppercase(atom_to_list(MType)),
+ Pos = Text(Pos0, BottomTextY, Str, PenId),
+ {PenId+1, Pos}
+ end, {1, ?BW}, mem_types());
+ ?IO_W ->
+ TN0 = Text(?BW, BottomTextY, "Input", 1),
+ Text(TN0, BottomTextY, "Output", 2)
+ end,
+ {GraphX0+1, GraphY1, ScaleW, ScaleH}.
+
+uppercase([C|Rest]) ->
+ [C-$a+$A|Rest].
+
+calc_max(Max) when Max < 10 -> 10;
+calc_max(Max) -> calc_max1(Max).
+
+calc_max1(Max) ->
+ case Max div 10 of
+ X when X < 10 ->
+ case Max rem 10 of
+ 0 -> Max;
+ _ ->
+ (X+1)*10
+ end;
+ X ->
+ 10*calc_max1(X)
+ end.
+
+bytes(?RQ_W, Val) -> {"", Val};
+bytes(_, B) ->
+ KB = B div 1024,
+ MB = KB div 1024,
+ GB = MB div 1024,
+ if
+ GB > 10 -> {"(GB)", GB};
+ MB > 10 -> {"(MB)", MB};
+ KB > 0 -> {"(KB)", KB};
+ true -> {"(B)", B}
+ end.
+
+colors() ->
+ {{200, 50, 50}, {50, 200, 50}, {50, 50, 200},
+ {255, 110, 0}, {50, 200, 200}, {200, 50, 200},
+ {240, 200, 80}, {140, 2, 140},
+ {100, 200, 240}, {100, 240, 100}
+ }.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% wxDC and ?wxGC wrappers
+
+haveGC(Win) ->
+ try
+ GC = ?wxGC:create(Win),
+ ?wxGC:destroy(GC),
+ true
+ catch _:_ -> false
+ end.
+
+setPen({false, DC}, Pen) ->
+ wxDC:setPen(DC, Pen);
+setPen({true, GC}, Pen) ->
+ ?wxGC:setPen(GC, Pen).
+
+setFont({false, DC}, Font, Color) ->
+ wxDC:setTextForeground(DC, Color),
+ wxDC:setFont(DC, Font);
+setFont({true, GC}, Font, Color) ->
+ ?wxGC:setFont(GC, Font, Color).
+
+setBrush({false, DC}, Brush) ->
+ wxDC:setBrush(DC, Brush);
+setBrush({true, GC}, Brush) ->
+ ?wxGC:setBrush(GC, Brush).
+
+strokeLine({false, DC}, X0, Y0, X1, Y1) ->
+ wxDC:drawLine(DC, {round(X0), round(Y0)}, {round(X1), round(Y1)});
+strokeLine({true, GC}, X0, Y0, X1, Y1) ->
+ ?wxGC:strokeLine(GC, X0, Y0, X1, Y1).
+
+strokeLines({false, DC}, Lines) ->
+ wxDC:drawLines(DC, [{round(X), round(Y)} || {X,Y} <- Lines]);
+strokeLines({true, GC}, Lines) ->
+ ?wxGC:strokeLines(GC, Lines).
+
+drawRoundedRectangle({false, DC}, X0, Y0, X1, Y1, R) ->
+ wxDC:drawRoundedRectangle(DC, {round(X0), round(Y0)}, {round(X1), round(Y1)}, round(R));
+drawRoundedRectangle({true, GC}, X0, Y0, X1, Y1, R) ->
+ ?wxGC:drawRoundedRectangle(GC, X0, Y0, X1, Y1, R).
+
+drawText({false, DC}, Str, X, Y) ->
+ wxDC:drawText(DC, Str, {round(X),round(Y)});
+drawText({true, GC}, Str, X, Y) ->
+ ?wxGC:drawText(GC, Str, X, Y).
+
+getTextExtent({false, DC}, Str) ->
+ wxDC:getTextExtent(DC, Str);
+getTextExtent({true, GC}, Str) ->
+ {W,H,_,_} = ?wxGC:getTextExtent(GC, Str),
+ {W,H}.
diff --git a/lib/observer/src/observer_pro_wx.erl b/lib/observer/src/observer_pro_wx.erl
index 7578215ff9..ee67664539 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. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -191,13 +191,20 @@ dump_to_file(Parent, FileName, Holder) ->
start_procinfo(undefined, _Frame, Opened) ->
Opened;
start_procinfo(Pid, Frame, Opened) ->
- case lists:member(Pid, Opened) of
- true ->
- Opened;
- false ->
- observer_procinfo:start(Pid, Frame, self()),
- [Pid | Opened]
+ %% This code doesn't work until we collect which windows have been
+ %% closed maybe it should moved to observer_wx.erl
+ %% and add a global menu which remembers windows.
+ %% case lists:keyfind(Pid, 1, Opened) of
+ %% false ->
+ case observer_procinfo:start(Pid, Frame, self()) of
+ {error, _} -> Opened;
+ PI -> [{Pid, PI} | Opened]
end.
+ %%;
+ %% {_, PI} ->
+ %% wxFrame:raise(PI),
+ %% Opened
+ %% end.
call(Holder, What) ->
Ref = erlang:monitor(process, Holder),
@@ -251,8 +258,7 @@ terminate(_Reason, #state{holder=Holder}) ->
ok.
code_change(_, _, State) ->
- {stop, not_yet_implemented, State}.
-
+ {ok, State}.
handle_call(Msg, _From, State) ->
io:format("~p:~p: Unhandled call ~p~n",[?MODULE, ?LINE, Msg]),
diff --git a/lib/observer/src/observer_procinfo.erl b/lib/observer/src/observer_procinfo.erl
index ec08d3aff1..45218c177b 100644
--- a/lib/observer/src/observer_procinfo.erl
+++ b/lib/observer/src/observer_procinfo.erl
@@ -49,7 +49,8 @@ init([Pid, ParentFrame, Parent]) ->
try
Title=case observer_wx:try_rpc(node(Pid), erlang, process_info, [Pid, registered_name]) of
[] -> io_lib:format("~p",[Pid]);
- {registered_name, Registered} -> atom_to_list(Registered)
+ {registered_name, Registered} -> io_lib:format("~p (~p)",[Registered, Pid]);
+ undefined -> throw(process_undefined)
end,
Frame=wxFrame:new(ParentFrame, ?wxID_ANY, [atom_to_list(node(Pid)), $:, Title],
[{style, ?wxDEFAULT_FRAME_STYLE}, {size, {850,600}}]),
@@ -75,7 +76,10 @@ init([Pid, ParentFrame, Parent]) ->
}}
catch error:{badrpc, _} ->
observer_wx:return_to_localnode(ParentFrame, node(Pid)),
- {stop, badrpc, #state{parent=Parent, pid=Pid}}
+ {stop, badrpc};
+ process_undefined ->
+ observer_lib:display_info_dialog("No such alive process"),
+ {stop, normal}
end.
init_panel(Notebook, Str, Pid, Fun) ->
@@ -94,8 +98,11 @@ handle_event(#wx{event=#wxClose{type=close_window}}, State) ->
handle_event(#wx{id=?wxID_CLOSE, event=#wxCommand{type=command_menu_selected}}, State) ->
{stop, normal, State};
-handle_event(#wx{id=?REFRESH}, #state{pages=Pages}=State) ->
- [(W#worker.callback)() || W <- Pages],
+handle_event(#wx{id=?REFRESH}, #state{frame=Frame, pid=Pid, pages=Pages}=State) ->
+ try [(W#worker.callback)() || W <- Pages]
+ catch process_undefined ->
+ wxFrame:setTitle(Frame, io_lib:format("*DEAD* ~p",[Pid]))
+ end,
{noreply, State};
handle_event(Event, _State) ->
@@ -120,17 +127,15 @@ terminate(_Reason, #state{parent=Parent,pid=Pid,frame=Frame}) ->
ok.
code_change(_, _, State) ->
- {stop, not_yet_implemented, State}.
+ {ok, State}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
init_process_page(Panel, Pid) ->
Fields0 = process_info_fields(Pid),
{FPanel, _, UpFields} = observer_lib:display_info(Panel, Fields0),
- {FPanel, fun() -> case process_info_fields(Pid) of
- Fields when is_list(Fields) ->
- observer_lib:update_info(UpFields, Fields);
- _ -> ok
- end
+ {FPanel, fun() ->
+ Fields = process_info_fields(Pid),
+ observer_lib:update_info(UpFields, Fields)
end}.
init_text_page(Parent) ->
@@ -162,7 +167,8 @@ init_message_page(Parent, Pid) ->
false ->
wxTextCtrl:writeText(Text, Messages)
end;
- _ -> ok
+ _ ->
+ throw(process_undefined)
end
end,
Update(),
@@ -178,7 +184,8 @@ init_dict_page(Parent, Pid) ->
Last = wxTextCtrl:getLastPosition(Text),
wxTextCtrl:remove(Text, 0, Last),
wxTextCtrl:writeText(Text, Dict);
- _ -> ok
+ _ ->
+ throw(process_undefined)
end
end,
Update(),
@@ -216,7 +223,8 @@ init_stack_page(Parent, Pid) ->
wxListCtrl:setItem(LCtrl, Row, 1, FileLine),
Row+1
end, 0, RawBt);
- _ -> ok
+ _ ->
+ throw(process_undefined)
end
end,
Resize = fun(#wx{event=#wxSize{size={W,_}}},Ev) ->
@@ -266,7 +274,7 @@ process_info_fields(Pid) ->
RawInfo when is_list(RawInfo) ->
observer_lib:fill_info(Struct, RawInfo);
_ ->
- ok
+ throw(process_undefined)
end.
item_list() ->
diff --git a/lib/observer/src/observer_sys_wx.erl b/lib/observer/src/observer_sys_wx.erl
index 09602bbd9e..f00a666a35 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. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -147,7 +147,7 @@ terminate(_Reason, _State) ->
ok.
code_change(_, _, State) ->
- {stop, not_yet_implemented, State}.
+ {ok, State}.
handle_call(Msg, _From, State) ->
io:format("~p~p: Unhandled Call ~p~n",[?MODULE, ?LINE, Msg]),
diff --git a/lib/observer/src/observer_trace_wx.erl b/lib/observer/src/observer_trace_wx.erl
index d0b6a1e063..f2a1084f85 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. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -489,7 +489,7 @@ terminate(_Reason, #state{nodes=_Nodes}) ->
ok.
code_change(_, _, State) ->
- {stop, not_yet_implemented, State}.
+ {ok, State}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
do_add_patterns({Module, NewPs}, State=#state{tpatterns=TPs0, m_view=Mview, f_view=Fview}) ->
diff --git a/lib/observer/src/observer_traceoptions_wx.erl b/lib/observer/src/observer_traceoptions_wx.erl
index 6a634e06f0..e27f565abc 100644
--- a/lib/observer/src/observer_traceoptions_wx.erl
+++ b/lib/observer/src/observer_traceoptions_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -167,8 +167,10 @@ module_selector(Parent, Node) ->
function_selector(Parent, Node, Module) ->
Functions = observer_wx:try_rpc(Node, Module, module_info, [functions]),
- Choices = lists:sort([{Name, Arity} || {Name, Arity} <- Functions,
- not(erl_internal:guard_bif(Name, Arity))]),
+ Externals = observer_wx:try_rpc(Node, Module, module_info, [exports]),
+
+ Choices = lists:usort([{Name, Arity} || {Name, Arity} <- Externals ++ Functions,
+ not(erl_internal:guard_bif(Name, Arity))]),
ParsedChoices = parse_function_names(Choices),
case check_selector(Parent, ParsedChoices) of
[] -> [{Module, '_', '_'}];
diff --git a/lib/observer/src/observer_tv_table.erl b/lib/observer/src/observer_tv_table.erl
index f432173f57..c41f0f006a 100644
--- a/lib/observer/src/observer_tv_table.erl
+++ b/lib/observer/src/observer_tv_table.erl
@@ -24,6 +24,8 @@
-export([init/1, handle_info/2, terminate/2, code_change/3, handle_call/3,
handle_event/2, handle_sync_event/3, handle_cast/2]).
+-export([format/1]).
+
-include("observer_defs.hrl").
-import(observer_lib, [to_str/1]).
@@ -218,8 +220,8 @@ search_area(Parent) ->
search=TC1,goto=TC2,radio={Nbtn,Pbtn,Cbtn}}.
edit(Index, #state{pid=Pid, frame=Frame}) ->
- Str = get_row(Pid, Index, all),
- case observer_lib:user_term(Frame, "Edit object:", Str) of
+ Str = get_row(Pid, Index, all_multiline),
+ case observer_lib:user_term_multiline(Frame, "Edit object:", Str) of
cancel -> ok;
{ok, Term} -> Pid ! {edit, Index, Term};
Err = {error, _} -> self() ! Err
@@ -265,7 +267,8 @@ handle_event(#wx{id=?ID_DELETE},
wxStatusBar:setStatusText(StatusBar, io_lib:format("Deleted object: ~s",[Str])),
{noreply, State};
-handle_event(#wx{id=?wxID_CLOSE}, State) ->
+handle_event(#wx{id=?wxID_CLOSE}, State = #state{frame=Frame}) ->
+ wxFrame:destroy(Frame),
{stop, normal, State};
handle_event(Help = #wx{id=?wxID_HELP}, State) ->
@@ -321,7 +324,7 @@ handle_event(#wx{id=?SEARCH_ENTRY, event=#wxCommand{type=command_text_enter,cmdS
wxStatusBar:setStatusText(SB, "Not found"),
Pid ! {mark_search_hit, Find#find.start},
wxListCtrl:refreshItem(Grid, Find#find.start),
- {noreply, State#state{search=Search#search{find=#find{found=false}}}};
+ {noreply, State#state{search=Search#search{find=Find#find{found=false}}}};
Row ->
wxListCtrl:ensureVisible(Grid, Row),
wxListCtrl:refreshItem(Grid, Row),
@@ -453,7 +456,7 @@ get_attr(Table, Item) ->
Ref = erlang:monitor(process, Table),
Table ! {get_attr, self(), Item},
receive
- {'DOWN', Ref, _, _, _} -> "";
+ {'DOWN', Ref, _, _, _} -> wx:null();
{Table, Res} ->
erlang:demonitor(Ref),
Res
@@ -594,7 +597,7 @@ keysort(Col, Table) ->
lists:sort(Sort, Table).
search([Str, Row, Dir0, CaseSens],
- S=#holder{parent=Parent, table=Table}) ->
+ S=#holder{parent=Parent, table=Table0}) ->
Opt = case CaseSens of
true -> [];
false -> [caseless]
@@ -605,29 +608,35 @@ search([Str, Row, Dir0, CaseSens],
end,
Res = case re:compile(Str, Opt) of
{ok, Re} ->
+ Table =
+ case Dir0 of
+ true ->
+ lists:nthtail(Row, Table0);
+ false ->
+ lists:reverse(lists:sublist(Table0, Row+1))
+ end,
search(Row, Dir, Re, Table);
{error, _} -> false
end,
Parent ! {self(), Res},
S#holder{search=Res}.
-search(Row, Dir, Re, Table) ->
- Res = try lists:nth(Row+1, Table) of
- Term ->
- Str = format(Term),
- re:run(Str, Re)
- catch _:_ -> no_more
- end,
+search(Row, Dir, Re, [ [Term|_] |Table]) ->
+ Str = format(Term),
+ Res = re:run(Str, Re),
case Res of
nomatch -> search(Row+Dir, Dir, Re, Table);
- no_more -> false;
{match,_} -> Row
- end.
+ end;
+search(_, _, _, []) ->
+ false.
get_row(From, Row, Col, Table) ->
case lists:nth(Row+1, Table) of
[Object|_] when Col =:= all ->
From ! {self(), format(Object)};
+ [Object|_] when Col =:= all_multiline ->
+ From ! {self(), io_lib:format("~p", [Object])};
[Object|_] when tuple_size(Object) >= Col ->
From ! {self(), format(element(Col, Object))};
_ ->
@@ -747,6 +756,13 @@ format(List) when is_list(List) ->
format_list(List);
format(Bin) when is_binary(Bin), byte_size(Bin) > 100 ->
io_lib:format("<<#Bin:~w>>", [byte_size(Bin)]);
+format(Bin) when is_binary(Bin) ->
+ try
+ true = printable_list(unicode:characters_to_list(Bin)),
+ io_lib:format("<<\"~ts\">>", [Bin])
+ catch _:_ ->
+ io_lib:format("~w", [Bin])
+ end;
format(Float) when is_float(Float) ->
io_lib:format("~.3g", [Float]);
format(Term) ->
@@ -762,7 +778,7 @@ format_tuple(_Tuple, 1, 0) ->
format_list([]) -> "[]";
format_list(List) ->
case printable_list(List) of
- true -> io_lib:format("\"~ts\"", [List]);
+ true -> io_lib:format("\"~ts\"", [map_printable_list(List)]);
false -> [$[ | make_list(List)]
end.
@@ -771,6 +787,24 @@ make_list([Last]) ->
make_list([Head|Tail]) ->
[format(Head), $,|make_list(Tail)].
+map_printable_list([$\n|Cs]) ->
+ [$\\, $n|map_printable_list(Cs)];
+map_printable_list([$\r|Cs]) ->
+ [$\\, $r|map_printable_list(Cs)];
+map_printable_list([$\t|Cs]) ->
+ [$\\, $t|map_printable_list(Cs)];
+map_printable_list([$\v|Cs]) ->
+ [$\\, $v|map_printable_list(Cs)];
+map_printable_list([$\b|Cs]) ->
+ [$\\, $b|map_printable_list(Cs)];
+map_printable_list([$\f|Cs]) ->
+ [$\\, $f|map_printable_list(Cs)];
+map_printable_list([$\e|Cs]) ->
+ [$\\, $e|map_printable_list(Cs)];
+map_printable_list([]) -> [];
+map_printable_list([C|Cs]) ->
+ [C|map_printable_list(Cs)].
+
%% printable_list([Char]) -> bool()
%% Return true if CharList is a list of printable characters, else
%% false.
diff --git a/lib/observer/src/observer_wx.erl b/lib/observer/src/observer_wx.erl
index 5a593abf11..e433bea8c2 100644
--- a/lib/observer/src/observer_wx.erl
+++ b/lib/observer/src/observer_wx.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -20,7 +20,7 @@
-behaviour(wx_object).
-export([start/0]).
--export([create_menus/2, get_attrib/1, get_tracer/0,
+-export([create_menus/2, get_attrib/1, get_tracer/0, set_status/1,
create_txt_dialog/4, try_rpc/4, return_to_localnode/2]).
-export([init/1, handle_event/2, handle_cast/2, terminate/2, code_change/3,
@@ -55,9 +55,11 @@
sys_panel,
trace_panel,
app_panel,
+ perf_panel,
active_tab,
node,
- nodes
+ nodes,
+ prev_node=""
}).
start() ->
@@ -72,6 +74,9 @@ create_menus(Object, Menus) when is_list(Menus) ->
get_attrib(What) ->
wx_object:call(observer, {get_attrib, What}).
+set_status(What) ->
+ wx_object:cast(observer, {status_bar, What}).
+
get_tracer() ->
wx_object:call(observer, get_tracer).
@@ -129,6 +134,10 @@ setup(#state{frame = Frame} = State) ->
%% I postpone the creation of the other tabs so they can query/use
%% the window size
+ %% Perf Viewer Panel
+ PerfPanel = observer_perf_wx:start_link(Notebook, self()),
+ wxNotebook:addPage(Notebook, PerfPanel, "Load Charts", []),
+
%% App Viewer Panel
AppPanel = observer_app_wx:start_link(Notebook, self()),
wxNotebook:addPage(Notebook, AppPanel, "Applications", []),
@@ -160,6 +169,7 @@ setup(#state{frame = Frame} = State) ->
tv_panel = TVPanel,
trace_panel = TracePanel,
app_panel = AppPanel,
+ perf_panel = PerfPanel,
active_tab = SysPid,
node = node(),
nodes = Nodes
@@ -185,10 +195,13 @@ setup(#state{frame = Frame} = State) ->
%%Callbacks
handle_event(#wx{event=#wxNotebook{type=command_notebook_page_changing}},
#state{active_tab=Previous, node=Node} = State) ->
- Pid = get_active_pid(State),
- Previous ! not_active,
- Pid ! {active, Node},
- {noreply, State#state{active_tab=Pid}};
+ case get_active_pid(State) of
+ Previous -> {noreply, State};
+ Pid ->
+ Previous ! not_active,
+ Pid ! {active, Node},
+ {noreply, State#state{active_tab=Pid}}
+ end;
handle_event(#wx{event = #wxClose{}}, State) ->
{stop, normal, State};
@@ -252,20 +265,21 @@ handle_event(#wx{id = ?ID_CONNECT, event = #wxCommand{type = command_menu_select
handle_event(#wx{id = ?ID_PING, event = #wxCommand{type = command_menu_selected}},
#state{frame = Frame} = State) ->
UpdState = case create_connect_dialog(ping, State) of
- cancel -> State;
+ cancel -> State;
{value, Value} when is_list(Value) ->
try
Node = list_to_atom(Value),
case net_adm:ping(Node) of
pang ->
create_txt_dialog(Frame, "Connect failed", "Pang", ?wxICON_EXCLAMATION),
- State;
+ State#state{prev_node=Value};
pong ->
- change_node_view(Node, State)
+ State1 = change_node_view(Node, State),
+ State1#state{prev_node=Value}
end
catch _:_ ->
create_txt_dialog(Frame, "Connect failed", "Pang", ?wxICON_EXCLAMATION),
- State
+ State#state{prev_node=Value}
end
end,
{noreply, UpdState};
@@ -282,6 +296,10 @@ handle_event(Event, State) ->
Pid ! Event,
{noreply, State}.
+handle_cast({status_bar, Msg}, State=#state{status_bar=SB}) ->
+ wxStatusBar:setStatusText(SB, Msg),
+ {noreply, State};
+
handle_cast(_Cast, State) ->
{noreply, State}.
@@ -322,8 +340,9 @@ handle_info({nodedown, Node},
create_txt_dialog(Frame, Msg, "Node down", ?wxICON_EXCLAMATION),
{noreply, State3};
-handle_info({'EXIT', _Pid, _Reason}, State) ->
- io:format("Child crashed exiting: ~p ~p~n", [_Pid,_Reason]),
+handle_info({'EXIT', Pid, _Reason}, State) ->
+ io:format("Child (~s) crashed exiting: ~p ~p~n",
+ [pid2panel(Pid, State), Pid,_Reason]),
{stop, normal, State};
handle_info(_Info, State) ->
@@ -334,7 +353,7 @@ terminate(_Reason, #state{frame = Frame}) ->
ok.
code_change(_, _, State) ->
- {stop, not_yet_implemented, State}.
+ {ok, State}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -345,6 +364,7 @@ try_rpc(Node, Mod, Func, Args) ->
error_logger:error_report([{node, Node},
{call, {Mod, Func, Args}},
{reason, {badrpc, Reason}}]),
+ observer ! {nodedown, Node},
error({badrpc, Reason});
Res ->
Res
@@ -393,7 +413,9 @@ connect2(NodeName, Opts, Cookie) ->
end.
change_node_view(Node, State) ->
- get_active_pid(State) ! {active, Node},
+ Tab = get_active_pid(State),
+ Tab ! not_active,
+ Tab ! {active, Node},
StatusText = ["Observer - " | atom_to_list(Node)],
wxFrame:setTitle(State#state.frame, StatusText),
wxStatusBar:setStatusText(State#state.status_bar, StatusText),
@@ -404,18 +426,35 @@ check_page_title(Notebook) ->
wxNotebook:getPageText(Notebook, Selection).
get_active_pid(#state{notebook=Notebook, pro_panel=Pro, sys_panel=Sys,
- tv_panel=Tv, trace_panel=Trace, app_panel=App}) ->
+ tv_panel=Tv, trace_panel=Trace, app_panel=App,
+ perf_panel=Perf
+ }) ->
Panel = case check_page_title(Notebook) of
"Processes" -> Pro;
"System" -> Sys;
"Table Viewer" -> Tv;
?TRACE_STR -> Trace;
+ "Load Charts" -> Perf;
"Applications" -> App
end,
wx_object:get_pid(Panel).
-create_connect_dialog(ping, #state{frame = Frame}) ->
- Dialog = wxTextEntryDialog:new(Frame, "Connect to node"),
+pid2panel(Pid, #state{pro_panel=Pro, sys_panel=Sys,
+ tv_panel=Tv, trace_panel=Trace, app_panel=App,
+ perf_panel=Perf}) ->
+ case Pid of
+ Pro -> "Processes";
+ Sys -> "System";
+ Tv -> "Table Viewer" ;
+ Trace -> ?TRACE_STR;
+ Perf -> "Load Charts";
+ App -> "Applications";
+ _ -> "unknown"
+ end.
+
+
+create_connect_dialog(ping, #state{frame = Frame, prev_node=Prev}) ->
+ Dialog = wxTextEntryDialog:new(Frame, "Connect to node", [{value, Prev}]),
case wxDialog:showModal(Dialog) of
?wxID_OK ->
Value = wxTextEntryDialog:getValue(Dialog),
@@ -535,7 +574,16 @@ remove_menu_items([], _MB) ->
ok.
get_nodes() ->
- Nodes = [node()| nodes()],
+ Nodes0 = case erlang:is_alive() of
+ false -> [];
+ true ->
+ case net_adm:names() of
+ {error, _} -> nodes();
+ {ok, Names} ->
+ epmd_nodes(Names) ++ nodes()
+ end
+ end,
+ Nodes = lists:usort(Nodes0),
{_, Menues} =
lists:foldl(fun(Node, {Id, Acc}) when Id < ?LAST_NODES_MENU_ID ->
{Id + 1, [#create_menu{id=Id + ?FIRST_NODES_MENU_ID,
@@ -543,6 +591,10 @@ get_nodes() ->
end, {1, []}, Nodes),
{Nodes, lists:reverse(Menues)}.
+epmd_nodes(Names) ->
+ [_, Host] = string:tokens(atom_to_list(node()),"@"),
+ [list_to_atom(Name ++ [$@|Host]) || {Name, _} <- Names].
+
update_node_list(State = #state{menubar=MenuBar}) ->
{Nodes, NodesMenuItems} = get_nodes(),
NodeMenuId = wxMenuBar:findMenu(MenuBar, "Nodes"),
diff --git a/lib/observer/test/Makefile b/lib/observer/test/Makefile
index bf99f07081..9df0591da5 100644
--- a/lib/observer/test/Makefile
+++ b/lib/observer/test/Makefile
@@ -82,11 +82,11 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) observer.spec $(EMAKEFILE) \
$(COVERFILE) $(ERL_FILES) \
- $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/observer/test/crashdump_viewer_SUITE.erl b/lib/observer/test/crashdump_viewer_SUITE.erl
index 79ece7edf5..6f882d0be9 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -318,7 +318,7 @@ browse_file(Port,File) ->
%% The page where a filename can be entered
title(Port,"read_file_frame","Read File"),
-
+
%% Load a file
Url = "http://localhost:"++Port++"/cdv_erl/crashdump_viewer/read_file",
Html = request_sync(post,{Url,[],[],"path="++File}),
@@ -414,6 +414,10 @@ special(Port,File) ->
_ ->
ok
end;
+ ".strangemodname" ->
+ AllMods = contents(Port,"loaded_modules"),
+ open_all_modules(Port,AllMods),
+ ok;
%%! No longer needed - all atoms are shown on one page!!
%% ".250atoms" ->
%% Html1 = contents(Port,"atoms"),
@@ -496,6 +500,26 @@ expand_binary_link(Html) ->
expand_binary_link(T)
end.
+open_all_modules(Port,Modules) ->
+ case get_first_module(Modules) of
+ {Module,Rest} ->
+ ModuleDetails = contents(Port,"loaded_mod_details?mod=" ++ Module),
+ ModTitle = http_uri:decode(Module),
+ ModTitle = title(ModuleDetails),
+ open_all_modules(Port,Rest);
+ false ->
+ ok
+ end.
+
+get_first_module([]) ->
+ false;
+get_first_module(Html) ->
+ case Html of
+ "<TD><A HREF=\"loaded_mod_details?mod=" ++ Rest ->
+ {string:sub_word(Rest,1,$"),Rest};
+ [_H|T] ->
+ get_first_module(T)
+ end.
%% next_link(Html) ->
%% case Html of
@@ -565,7 +589,7 @@ create_dumps(DataDir,[Rel|Rels],Acc) ->
Fun = fun() -> do_create_dumps(DataDir,Rel) end,
Pa = filename:dirname(code:which(?MODULE)),
{SlAllocDumps,Dumps,DosDump} =
- ?t:run_on_shielded_node(Fun, compat_rel(Rel) ++ "-pa " ++ Pa),
+ ?t:run_on_shielded_node(Fun, compat_rel(Rel) ++ "-pa \"" ++ Pa ++ "\""),
create_dumps(DataDir,Rels,SlAllocDumps ++ Dumps ++ Acc ++ DosDump);
create_dumps(_DataDir,[],Acc) ->
Acc.
@@ -590,7 +614,8 @@ do_create_dumps(DataDir,Rel) ->
case Rel of
current ->
CD3 = dump_with_args(DataDir,Rel,"instr","+Mim true"),
- {SlAllocDumps, [CD1,CD2,CD3], DosDump};
+ CD4 = dump_with_strange_module_name(DataDir,Rel,"strangemodname"),
+ {SlAllocDumps, [CD1,CD2,CD3,CD4], DosDump};
_ ->
{SlAllocDumps, [CD1,CD2], DosDump}
end.
@@ -600,7 +625,7 @@ do_create_dumps(DataDir,Rel) ->
%% not connected node, and with monitors and links between nodes.
full_dist_dump(DataDir,Rel) ->
Opt = rel_opt(Rel),
- Pz = "-pz " ++ filename:dirname(code:which(?MODULE)),
+ Pz = "-pz \"" ++ filename:dirname(code:which(?MODULE)) ++ "\"",
PzOpt = [{args,Pz}],
{ok,N1} = ?t:start_node(n1,peer,Opt ++ PzOpt),
{ok,N2} = ?t:start_node(n2,peer,Opt ++ PzOpt),
@@ -648,7 +673,22 @@ dump_with_args(DataDir,Rel,DumpName,Args) ->
?t:stop_node(n1),
CD.
+%% This dump is added to test OTP-10090 - regarding URL encoding of
+%% module names in the module detail link.
+dump_with_strange_module_name(DataDir,Rel,DumpName) ->
+ Opt = rel_opt(Rel),
+ {ok,N1} = ?t:start_node(n1,peer,Opt),
+ Mod = '<mod ule#with?strange%name>',
+ File = atom_to_list(Mod) ++ ".erl",
+ Forms = [{attribute,1,file,{File,1}},
+ {attribute,1,module,Mod},
+ {eof,4}],
+ {ok,Mod,Bin} = rpc:call(N1,compile,forms,[Forms,[binary]]),
+ {module,Mod} = rpc:call(N1,code,load_binary,[Mod,File,Bin]),
+ CD = dump(N1,DataDir,Rel,DumpName),
+ ?t:stop_node(n1),
+ CD.
dump(Node,DataDir,Rel,DumpName) ->
rpc:call(Node,erlang,halt,[DumpName]),
@@ -711,6 +751,7 @@ rel_opt(Rel) ->
r11b -> [{erl,[{release,"r11b_patched"}]}];
r12b -> [{erl,[{release,"r12b_patched"}]}];
r13b -> [{erl,[{release,"r13b_patched"}]}];
+ r14b -> [{erl,[{release,"r14b_latest"}]}]; %naming convention changed
current -> []
end.
@@ -734,6 +775,6 @@ compat_rel(Rel) ->
r11b -> "+R11 ";
r12b -> "+R12 ";
r13b -> "+R13 ";
- r14b -> "+R13 ";
+ r14b -> "+R14 ";
current -> ""
end.
diff --git a/lib/observer/test/etop_SUITE.erl b/lib/observer/test/etop_SUITE.erl
index a277453620..06577f82cc 100644
--- a/lib/observer/test/etop_SUITE.erl
+++ b/lib/observer/test/etop_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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/lib/observer/vsn.mk b/lib/observer/vsn.mk
index fa104ede01..32e13004b6 100644
--- a/lib/observer/vsn.mk
+++ b/lib/observer/vsn.mk
@@ -1 +1 @@
-OBSERVER_VSN = 1.0
+OBSERVER_VSN = 1.2
diff --git a/lib/odbc/aclocal.m4 b/lib/odbc/aclocal.m4
index 339a15a2bb..b1cf1fe404 100644
--- a/lib/odbc/aclocal.m4
+++ b/lib/odbc/aclocal.m4
@@ -1,7 +1,7 @@
dnl
dnl %CopyrightBegin%
dnl
-dnl Copyright Ericsson AB 1998-2011. All Rights Reserved.
+dnl Copyright Ericsson AB 1998-2012. All Rights Reserved.
dnl
dnl The contents of this file are subject to the Erlang Public License,
dnl Version 1.1, (the "License"); you may not use this file except in
@@ -59,6 +59,7 @@ AC_ARG_VAR(erl_xcomp_isysroot, [Absolute cross system root include path (only us
dnl Cross compilation variables
AC_ARG_VAR(erl_xcomp_bigendian, [big endian system: yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_double_middle_endian, [double-middle-endian system: yes|no (only used when cross compiling)])
AC_ARG_VAR(erl_xcomp_linux_clock_gettime_correction, [clock_gettime() can be used for time correction: yes|no (only used when cross compiling)])
AC_ARG_VAR(erl_xcomp_linux_nptl, [have Native POSIX Thread Library: yes|no (only used when cross compiling)])
AC_ARG_VAR(erl_xcomp_linux_usable_sigusrx, [SIGUSR1 and SIGUSR2 can be used: yes|no (only used when cross compiling)])
@@ -606,6 +607,103 @@ ifelse([$5], , , [$5
fi
])
+dnl ----------------------------------------------------------------------
+dnl
+dnl AC_DOUBLE_MIDDLE_ENDIAN
+dnl
+dnl Checks whether doubles are represented in "middle-endian" format.
+dnl Sets ac_cv_double_middle_endian={no,yes,unknown} accordingly,
+dnl as well as DOUBLE_MIDDLE_ENDIAN.
+dnl
+dnl
+
+AC_DEFUN([AC_C_DOUBLE_MIDDLE_ENDIAN],
+[AC_CACHE_CHECK(whether double word ordering is middle-endian, ac_cv_c_double_middle_endian,
+[# It does not; compile a test program.
+AC_RUN_IFELSE(
+[AC_LANG_SOURCE([[#include <stdlib.h>
+
+int
+main(void)
+{
+ int i = 0;
+ int zero = 0;
+ int bigendian;
+ int zero_index = 0;
+
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+
+ /* we'll use the one with 32-bit words */
+ union
+ {
+ double d;
+ unsigned int c[2];
+ } vint;
+
+ union
+ {
+ double d;
+ unsigned long c[2];
+ } vlong;
+
+ union
+ {
+ double d;
+ unsigned short c[2];
+ } vshort;
+
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ u.l = 1;
+ bigendian = (u.c[sizeof (long int) - 1] == 1);
+
+ zero_index = bigendian ? 1 : 0;
+
+ vint.d = 1.0;
+ vlong.d = 1.0;
+ vshort.d = 1.0;
+
+ if (sizeof(unsigned int) == 4)
+ {
+ if (vint.c[zero_index] != 0)
+ zero = 1;
+ }
+ else if (sizeof(unsigned long) == 4)
+ {
+ if (vlong.c[zero_index] != 0)
+ zero = 1;
+ }
+ else if (sizeof(unsigned short) == 4)
+ {
+ if (vshort.c[zero_index] != 0)
+ zero = 1;
+ }
+
+ exit (zero);
+}
+]])],
+ [ac_cv_c_double_middle_endian=no],
+ [ac_cv_c_double_middle_endian=yes],
+ [ac_cv_c_double_middle=unknown])])
+case $ac_cv_c_double_middle_endian in
+ yes)
+ m4_default([$1],
+ [AC_DEFINE([DOUBLE_MIDDLE_ENDIAN], 1,
+ [Define to 1 if your processor stores the words in a double in
+ middle-endian format (like some ARMs).])]) ;;
+ no)
+ $2 ;;
+ *)
+ m4_default([$3],
+ [AC_MSG_WARN([unknown double endianness
+presetting ac_cv_c_double_middle_endian=no (or yes) will help])]) ;;
+esac
+])# AC_C_DOUBLE_MIDDLE_ENDIAN
+
dnl ----------------------------------------------------------------------
dnl
@@ -1337,6 +1435,14 @@ if test "$ac_cv_c_bigendian" = "yes"; then
AC_DEFINE(ETHR_BIGENDIAN, 1, [Define if bigendian])
fi
+case X$erl_xcomp_double_middle_endian in
+ X) ;;
+ Xyes|Xno|Xunknown) ac_cv_c_double_middle_endian=$erl_xcomp_double_middle_endian;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_double_middle_endian value: $erl_xcomp_double_middle_endian]);;
+esac
+
+AC_C_DOUBLE_MIDDLE_ENDIAN
+
AC_ARG_ENABLE(native-ethr-impls,
AS_HELP_STRING([--disable-native-ethr-impls],
[disable native ethread implementations]),
diff --git a/lib/odbc/c_src/Makefile.in b/lib/odbc/c_src/Makefile.in
index 3a96a53ef8..026da39e6f 100644
--- a/lib/odbc/c_src/Makefile.in
+++ b/lib/odbc/c_src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -128,12 +128,12 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
ifdef EXE_TARGET
- $(INSTALL_DIR) $(RELSYSDIR)/c_src
- $(INSTALL_DATA) $(C_FILES) $(H_FILES) $(RELSYSDIR)/c_src
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DIR) $(RELSYSDIR)/priv/bin
- $(INSTALL_DIR) $(RELSYSDIR)/priv/obj
- $(INSTALL_PROGRAM) $(EXE_TARGET) $(RELSYSDIR)/priv/bin
+ $(INSTALL_DIR) "$(RELSYSDIR)/c_src"
+ $(INSTALL_DATA) $(C_FILES) $(H_FILES) "$(RELSYSDIR)/c_src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/bin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/obj"
+ $(INSTALL_PROGRAM) $(EXE_TARGET) "$(RELSYSDIR)/priv/bin"
endif
release_docs_spec:
diff --git a/lib/odbc/c_src/odbcserver.c b/lib/odbc/c_src/odbcserver.c
index ab2d7fe210..6d4460014f 100644
--- a/lib/odbc/c_src/odbcserver.c
+++ b/lib/odbc/c_src/odbcserver.c
@@ -176,7 +176,7 @@ static void encode_column_dyn(db_column column, int column_nr,
static void encode_data_type(SQLSMALLINT sql_type, SQLINTEGER size,
SQLSMALLINT decimal_digits, db_state *state);
static Boolean decode_params(db_state *state, byte *buffer, int *index, param_array **params,
- int i, int j);
+ int i, int j, int num_param_values);
/*------------- Erlang port communication functions ----------------------*/
@@ -212,6 +212,7 @@ static db_column * alloc_column_buffer(int n);
static void free_column_buffer(db_column **columns, int n);
static void free_params(param_array **params, int cols);
static void clean_state(db_state *state);
+static SQLLEN* alloc_strlen_indptr(int n, int val);
/* ------------- Init/map/bind/retrive functions -------------------------*/
@@ -1157,7 +1158,7 @@ static db_result_msg encode_out_params(db_state *state,
break;
case SQL_C_BIT:
ei_x_encode_atom(&dynamic_buffer(state),
- ((Boolean*)values)[j]==TRUE?"true":"false");
+ ((byte*)values)[j]==TRUE?"true":"false");
break;
default:
ei_x_encode_atom(&dynamic_buffer(state), "error");
@@ -1579,37 +1580,48 @@ static void encode_data_type(SQLSMALLINT sql_type, SQLINTEGER size,
}
static Boolean decode_params(db_state *state, byte *buffer, int *index, param_array **params,
- int i, int j)
+ int i, int j, int num_param_values)
{
int erl_type, size;
long bin_size, l64;
long val;
param_array* param;
TIMESTAMP_STRUCT* ts;
+ char atomarray[MAXATOMLEN+1];
ei_get_type(buffer, index, &erl_type, &size);
param = &(*params)[i];
+ if(erl_type == ERL_ATOM_EXT) {
+ ei_decode_atom(buffer, index, atomarray);
+ if(strncmp(atomarray, "null", 4) == 0 ) {
+ param->offset += param->type.len;
+
+ if(!param->type.strlen_or_indptr_array)
+ param->type.strlen_or_indptr_array = alloc_strlen_indptr(num_param_values, param->type.len);
+
+ param->type.strlen_or_indptr_array[j] = SQL_NULL_DATA;
+ return TRUE;
+ }
+ }
+
switch (param->type.c) {
case SQL_C_CHAR:
if (binary_strings(state)) {
ei_decode_binary(buffer, index,
&(param->values.string[param->offset]), &bin_size);
param->offset += param->type.len;
- param->type.strlen_or_indptr_array[j] = SQL_NTS;
} else {
if(erl_type != ERL_STRING_EXT) {
return FALSE;
}
ei_decode_string(buffer, index, &(param->values.string[param->offset]));
param->offset += param->type.len;
- param->type.strlen_or_indptr_array[j] = SQL_NTS;
}
break;
case SQL_C_WCHAR:
ei_decode_binary(buffer, index, &(param->values.string[param->offset]), &bin_size);
param->offset += param->type.len;
- param->type.strlen_or_indptr_array[j] = SQL_NTS;
break;
case SQL_C_TYPE_TIMESTAMP:
ts = (TIMESTAMP_STRUCT*) param->values.string;
@@ -1661,9 +1673,13 @@ static Boolean decode_params(db_state *state, byte *buffer, int *index, param_ar
if((erl_type != ERL_ATOM_EXT)) {
return FALSE;
}
- ei_decode_boolean(buffer, index, &(param->values.bool[j]));
+ if (strncmp((char*)atomarray,"true",4) == 0)
+ param->values.bool[j] = TRUE;
+ else if (strncmp((char*)atomarray,"false",5) == 0)
+ param->values.bool[j] = FALSE;
+ else
+ return -1;
break;
-
default:
return FALSE;
}
@@ -2014,6 +2030,18 @@ static void clean_state(db_state *state)
nr_of_columns(state) = 0;
}
+/* Allocates and fill with default value StrLen_or_IndPtr array */
+static SQLLEN* alloc_strlen_indptr(int n, int val)
+{
+ int i;
+ SQLLEN* arr = (SQLLEN*)safe_malloc(n * sizeof(SQLLEN));
+
+ for( i=0; i < n; ++i )
+ arr[i] = val;
+
+ return arr;
+}
+
/* ------------- Init/map/bind/retrive functions ------------------------*/
/* Prepare the state for a connection */
@@ -2118,7 +2146,7 @@ static void init_param_column(param_array *params, byte *buffer, int *index,
(double *)safe_malloc(num_param_values * params->type.len);
} else if(params->type.c == SQL_C_CHAR) {
params->type.strlen_or_indptr_array
- = (SQLLEN*)safe_malloc(num_param_values * sizeof(SQLINTEGER));
+ = alloc_strlen_indptr(num_param_values, SQL_NTS);
params->values.string =
(byte *)safe_malloc(num_param_values *
sizeof(byte)* params->type.len);
@@ -2136,8 +2164,8 @@ static void init_param_column(param_array *params, byte *buffer, int *index,
params->type.len = length+1;
params->type.c = SQL_C_CHAR;
params->type.col_size = (SQLUINTEGER)length;
- params->type.strlen_or_indptr_array =
- (SQLLEN*)safe_malloc(num_param_values * sizeof(SQLINTEGER));
+ params->type.strlen_or_indptr_array
+ = alloc_strlen_indptr(num_param_values, SQL_NTS);
params->values.string =
(byte *)safe_malloc(num_param_values *
sizeof(byte)* params->type.len);
@@ -2159,8 +2187,8 @@ static void init_param_column(param_array *params, byte *buffer, int *index,
params->type.len = (length+1)*sizeof(SQLWCHAR);
params->type.c = SQL_C_WCHAR;
params->type.col_size = (SQLUINTEGER)length;
- params->type.strlen_or_indptr_array =
- (SQLLEN*)safe_malloc(num_param_values * sizeof(SQLINTEGER));
+ params->type.strlen_or_indptr_array
+ = alloc_strlen_indptr(num_param_values, SQL_NTS);
params->values.string =
(byte *)safe_malloc(num_param_values * sizeof(byte) * params->type.len);
@@ -2201,10 +2229,10 @@ static void init_param_column(param_array *params, byte *buffer, int *index,
case USER_BOOLEAN:
params->type.sql = SQL_BIT;
params->type.c = SQL_C_BIT;
- params->type.len = sizeof(Boolean);
+ params->type.len = sizeof(byte);
params->type.col_size = params->type.len;
params->values.bool =
- (Boolean *)safe_malloc(num_param_values * params->type.len);
+ (byte *)safe_malloc(num_param_values * params->type.len);
break;
}
params->offset = 0;
@@ -2411,7 +2439,7 @@ static param_array * bind_parameter_arrays(byte *buffer, int *index,
}
for (j = 0; j < num_param_values; j++) {
- if(!decode_params(state, buffer, index, &params, i, j)) {
+ if(!decode_params(state, buffer, index, &params, i, j, num_param_values)) {
/* An input parameter was not of the expected type */
free_params(&params, i);
return params;
diff --git a/lib/odbc/c_src/odbcserver.h b/lib/odbc/c_src/odbcserver.h
index 56b6148777..a76cedf1af 100644
--- a/lib/odbc/c_src/odbcserver.h
+++ b/lib/odbc/c_src/odbcserver.h
@@ -156,7 +156,7 @@ typedef struct {
byte *string;
SQLINTEGER *integer;
double *floating;
- Boolean *bool;
+ byte *bool;
}values;
} param_array;
diff --git a/lib/odbc/doc/src/Makefile b/lib/odbc/doc/src/Makefile
index 0d456085f3..53a855f182 100644
--- a/lib/odbc/doc/src/Makefile
+++ b/lib/odbc/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -125,13 +125,13 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/odbc/doc/src/notes.xml b/lib/odbc/doc/src/notes.xml
index 08763163b8..5f6cf91961 100644
--- a/lib/odbc/doc/src/notes.xml
+++ b/lib/odbc/doc/src/notes.xml
@@ -31,7 +31,27 @@
<p>This document describes the changes made to the odbc application.
</p>
- <section><title>ODBC 2.10.12</title>
+ <section><title>ODBC 2.10.13</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Add support for NULL value in odbc:param_query</p>
+ <p>
+ Support atom 'null' in odbc:param_query as database NULL
+ value Fix "ODBC: received unexpected info:{tcp_closed,
+ ...}" when connection is terminated. Fix possible access
+ violation with 64bit ODBC. Thanks to Maxim Zrazhevskiy</p>
+ <p>
+ Own Id: OTP-10206</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>ODBC 2.10.12</title>
<section><title>Fixed Bugs and Malfunctions</title>
<list>
diff --git a/lib/odbc/src/Makefile b/lib/odbc/src/Makefile
index b48dd768c8..2af65cc757 100644
--- a/lib/odbc/src/Makefile
+++ b/lib/odbc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
@@ -108,13 +108,13 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(EXT_HRL_FILES) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(EXT_HRL_FILES) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) \
- $(RELSYSDIR)/ebin
+ "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/odbc/src/odbc.appup.src b/lib/odbc/src/odbc.appup.src
index 853323da09..c7c83ea079 100644
--- a/lib/odbc/src/odbc.appup.src
+++ b/lib/odbc/src/odbc.appup.src
@@ -1,12 +1,8 @@
%% -*- erlang -*-
{"%VSN%",
[
- {"2.10.11", [{restart_application, odbc}]},
- {"2.10.10", [{restart_application, odbc}]},
- {"2.10.9", [{restart_application, odbc}]}
+ {<<"2\\.*">>, [{restart_application, odbc}]}
],
[
- {"2.10.11", [{restart_application, odbc}]},
- {"2.10.10", [{restart_application, odbc}]},
- {"2.10.9", [{restart_application, odbc}]}
+ {<<"2\\.*">>, [{restart_application, odbc}]}
]}.
diff --git a/lib/odbc/src/odbc.erl b/lib/odbc/src/odbc.erl
index 36afd1abcf..16fdb4aabd 100644
--- a/lib/odbc/src/odbc.erl
+++ b/lib/odbc/src/odbc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -451,7 +451,7 @@ init(Args) ->
%% Start the port program (a c program) that utilizes the odbc driver
case os:find_executable(?SERVERPROG, ?SERVERDIR) of
FileName when is_list(FileName)->
- Port = open_port({spawn, FileName},
+ Port = open_port({spawn, "\""++FileName++"\""},
[{packet, ?LENGTH_INDICATOR_SIZE}, binary,
exit_status]),
State = #state{listen_sockets =
@@ -755,7 +755,10 @@ handle_info({'DOWN', _Ref, _Type, _Process, shutdown}, State) ->
handle_info({'DOWN', _Ref, _Type, Process, Reason}, State) ->
{stop, {stopped, {'EXIT', Process, Reason}},
State#state{reply_to = undefined}};
-
+
+handle_info({tcp_closed, Socket}, State = #state{odbc_socket=Socket,
+ state = disconnecting}) ->
+ {stop, normal, State};
%---------------------------------------------------------------------------
%% Catch all - throws away unknown messages (This could happen by "accident"
%% so we do not want to crash, but we make a log entry as it is an
@@ -942,9 +945,11 @@ fix_params({sql_bit, InOut, Values}) ->
fix_params({'sql_timestamp', InOut, Values}) ->
NewValues =
case (catch
- lists:map(fun({{Year,Month,Day},{Hour,Minute,Second}}) ->
- {Year,Month,Day,Hour,Minute,Second}
- end, Values)) of
+ lists:map(
+ fun({{Year,Month,Day},{Hour,Minute,Second}}) ->
+ {Year,Month,Day,Hour,Minute,Second};
+ (null) -> null
+ end, Values)) of
Result ->
Result
end,
@@ -960,15 +965,15 @@ fix_inout(out) ->
fix_inout(inout) ->
?INOUT.
-string_terminate([Value| _ ] = Values) when is_list(Value)->
- case (catch
- lists:map(fun(Str) -> Str ++ [?STR_TERMINATOR] end, Values)) of
- Result ->
- Result
- end;
-string_terminate([Value| _ ] = Values) when is_binary(Value)->
- case (catch
- lists:map(fun(B) -> <<B/binary,0:16>> end, Values)) of
+string_terminate(Values) ->
+ case (catch lists:map(fun string_terminate_value/1, Values)) of
Result ->
Result
end.
+
+string_terminate_value(String) when is_list(String) ->
+ String ++ [?STR_TERMINATOR];
+string_terminate_value(Binary) when is_binary(Binary) ->
+ <<Binary/binary,0:16>>;
+string_terminate_value(null) ->
+ null.
diff --git a/lib/odbc/test/Makefile b/lib/odbc/test/Makefile
index bc6449242e..d45073281b 100644
--- a/lib/odbc/test/Makefile
+++ b/lib/odbc/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -101,8 +101,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(SPEC_FILES) $(COVER_FILE) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(SPEC_FILES) $(COVER_FILE) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)"
release_docs_spec:
diff --git a/lib/odbc/test/odbc_test_lib.erl b/lib/odbc/test/odbc_test_lib.erl
index a8439d5fb6..e814cd2aca 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -29,6 +29,7 @@
unique_table_name() ->
lists:reverse(lists:foldl(fun($@, Acc) -> [$t, $A |Acc] ;
+ ($-,Acc) -> Acc;
(X, Acc) -> [X |Acc] end,
[], atom_to_list(node()))).
diff --git a/lib/odbc/vsn.mk b/lib/odbc/vsn.mk
index fb6e208a52..3bb2fe5bce 100644
--- a/lib/odbc/vsn.mk
+++ b/lib/odbc/vsn.mk
@@ -1 +1 @@
-ODBC_VSN = 2.10.12
+ODBC_VSN = 2.10.13
diff --git a/lib/orber/COSS/CosNaming/Makefile b/lib/orber/COSS/CosNaming/Makefile
index 064447f148..769c08a9e9 100644
--- a/lib/orber/COSS/CosNaming/Makefile
+++ b/lib/orber/COSS/CosNaming/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -141,11 +141,11 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/COSS/CosNaming
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(IDL_FILE) $(RELSYSDIR)/COSS/CosNaming
- $(INSTALL_DATA) $(GEN_FILES) $(RELSYSDIR)/COSS/CosNaming
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/COSS/CosNaming"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(IDL_FILE) "$(RELSYSDIR)/COSS/CosNaming"
+ $(INSTALL_DATA) $(GEN_FILES) "$(RELSYSDIR)/COSS/CosNaming"
release_docs_spec:
diff --git a/lib/orber/c_src/Makefile.in b/lib/orber/c_src/Makefile.in
index 56f0d57545..9970642a9f 100644
--- a/lib/orber/c_src/Makefile.in
+++ b/lib/orber/c_src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -58,15 +58,9 @@ ifeq ($(findstring win32,$(TARGET)),win32)
orber:
echo "Nothing to build on NT"
else
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
-orber:
- echo "Nothing to build for VxWorks"
-
-else
orber:
echo "Nothing to build"
endif
-endif
clean:
@@ -89,24 +83,16 @@ include $(ERL_TOP)/make/otp_release_targets.mk
ifeq ($(findstring win32,$(TARGET)),win32)
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/src
- $(INSTALL_DIR) $(RELSYSDIR)/priv/include
- $(INSTALL_PROGRAM) $(CC_FILES) $(RELSYSDIR)/priv/src
- $(INSTALL_PROGRAM) $(HH_FILES) $(RELSYSDIR)/priv/include
-else
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
-release_spec:
- $(INSTALL_DIR) $(RELSYSDIR)/priv/src
- $(INSTALL_DIR) $(RELSYSDIR)/priv/include
- $(INSTALL_PROGRAM) $(CC_FILES) $(RELSYSDIR)/priv/src
- $(INSTALL_PROGRAM) $(HH_FILES) $(RELSYSDIR)/priv/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/include"
+ $(INSTALL_PROGRAM) $(CC_FILES) "$(RELSYSDIR)/priv/src"
+ $(INSTALL_PROGRAM) $(HH_FILES) "$(RELSYSDIR)/priv/include"
else
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/src
- $(INSTALL_DIR) $(RELSYSDIR)/priv/include
- $(INSTALL_DATA) $(CC_FILES) $(RELSYSDIR)/priv/src
- $(INSTALL_DATA) $(HH_FILES) $(RELSYSDIR)/priv/include
-endif
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/include"
+ $(INSTALL_DATA) $(CC_FILES) "$(RELSYSDIR)/priv/src"
+ $(INSTALL_DATA) $(HH_FILES) "$(RELSYSDIR)/priv/include"
endif
diff --git a/lib/orber/doc/src/Makefile b/lib/orber/doc/src/Makefile
index 68fbe3dce0..4cd7c45437 100644
--- a/lib/orber/doc/src/Makefile
+++ b/lib/orber/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -164,13 +164,13 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/orber/doc/src/ch_install.xml b/lib/orber/doc/src/ch_install.xml
index de9c0e3a9d..89c0e19173 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>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -396,13 +396,13 @@ nodeB@hostB> orber:start().
<row>
<cell align="left" valign="middle">ssl_server_options</cell>
<cell align="left" valign="middle">list()</cell>
- <cell align="left" valign="middle">See the <seealso marker="ssl:ssl">SSL</seealso> application
+ <cell align="left" valign="middle">See the <seealso marker="ssl:ssl">SSL application</seealso>
for valid options.</cell>
</row>
<row>
<cell align="left" valign="middle">ssl_client_options</cell>
<cell align="left" valign="middle">list()</cell>
- <cell align="left" valign="middle">See the <seealso marker="ssl:ssl">SSL</seealso> application
+ <cell align="left" valign="middle">See the <seealso marker="ssl:ssl">SSL application</seealso>
for valid options.</cell>
</row>
<row>
@@ -631,9 +631,19 @@ nodeB@hostB> orber:start().
<c>{local, DefaultNATPort, [{Port, NATPort}]}</c>. See also
<seealso marker="ch_install#firewall">Firewall Configuration</seealso>.</item>
<tag><em>ssl_server_options</em></tag>
- <item>the file path to a server side CA certificate.</item>
+ <item>A list of the SSL options when Orber is the server.
+ In general it's just to remove the 'ssl_server_' prefix from the old options,
+ i.e. <c>ssl_server_verify</c> will just be <c>verify</c> in this option list.
+ See the <seealso marker="ssl:ssl">SSL application</seealso> for the correct list of possible
+ options and their values.
+ </item>
<tag><em>ssl_client_options</em></tag>
- <item>The path to a file containing a chain of PEM encoded certificates.</item>
+ <item>A list of the SSL options when Orber is the client.
+ In general it's just to remove the <c>ssl_client_</c> prefix from the old options,
+ i.e. <c>ssl_client_depth</c> will just be <c>depth</c> in this option list.
+ See the <seealso marker="ssl:ssl">SSL application</seealso> for the correct list of possible
+ options and their values.
+ </item>
<tag><em>iiop_ssl_out_keepalive</em></tag>
<item>Enables periodic transmission on a connected socket, when no other
data is being exchanged. If the other end does not respond, the
diff --git a/lib/orber/doc/src/notes.xml b/lib/orber/doc/src/notes.xml
index 35ee5e35dd..d561199998 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>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -32,7 +32,29 @@
<file>notes.xml</file>
</header>
- <section><title>Orber 3.6.23</title>
+ <section><title>Orber 3.6.24</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fix number of arguments in orber dbg printout</p>
+ <p>
+ Own Id: OTP-9887</p>
+ </item>
+ <item>
+ <p> The descriptions of <c>ssl_server_options</c> and
+ <c>ssl_client_options</c> are corrected.<br/> Seq. Id:
+ seq12018 </p>
+ <p>
+ Own Id: OTP-9966 Aux Id: OTP-9773 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Orber 3.6.23</title>
<section><title>Fixed Bugs and Malfunctions</title>
<list>
diff --git a/lib/orber/examples/Stack/Makefile b/lib/orber/examples/Stack/Makefile
index b985f348fa..f1a5106a7b 100644
--- a/lib/orber/examples/Stack/Makefile
+++ b/lib/orber/examples/Stack/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -118,8 +118,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/examples/Stack
- $(INSTALL_DATA) $(ERL_FILES) $(JAVA_FILES) $(CPP_FILES) $(IDL_FILES) $(RELSYSDIR)/examples/Stack
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/Stack"
+ $(INSTALL_DATA) $(ERL_FILES) $(JAVA_FILES) $(CPP_FILES) $(IDL_FILES) "$(RELSYSDIR)/examples/Stack"
release_docs_spec:
diff --git a/lib/orber/java_src/Orber/Makefile b/lib/orber/java_src/Orber/Makefile
index 49da975a8b..f7f7336622 100644
--- a/lib/orber/java_src/Orber/Makefile
+++ b/lib/orber/java_src/Orber/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -63,8 +63,8 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/java_src/Orber
- $(INSTALL_DATA) $(JAVA_FILES) $(RELSYSDIR)/java_src/Orber
+ $(INSTALL_DIR) "$(RELSYSDIR)/java_src/Orber"
+ $(INSTALL_DATA) $(JAVA_FILES) "$(RELSYSDIR)/java_src/Orber"
release_docs_spec:
diff --git a/lib/orber/priv/Makefile b/lib/orber/priv/Makefile
index af82177466..cd361e3f0a 100644
--- a/lib/orber/priv/Makefile
+++ b/lib/orber/priv/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2011. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -58,8 +58,8 @@ clean:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DATA) $(HELP_FILES) $(HTML_FILES) $(RELSYSDIR)/priv
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) $(HELP_FILES) $(HTML_FILES) "$(RELSYSDIR)/priv"
release_docs_spec:
diff --git a/lib/orber/src/Makefile b/lib/orber/src/Makefile
index d2e98686da..72610def2b 100644
--- a/lib/orber/src/Makefile
+++ b/lib/orber/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -254,12 +254,12 @@ 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_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(YRL_FILE) $(GEN_HRL_FILES_LOC) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(EXTERNAL_HRL_FILES) $(GEN_HRL_FILES_EXT) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(YRL_FILE) $(GEN_HRL_FILES_LOC) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(EXTERNAL_HRL_FILES) $(GEN_HRL_FILES_EXT) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/orber/src/orber_ifr.erl b/lib/orber/src/orber_ifr.erl
index c23374cd68..4004ffa005 100644
--- a/lib/orber/src/orber_ifr.erl
+++ b/lib/orber/src/orber_ifr.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -478,7 +478,7 @@ get_module(Id, Type) ->
What ->
orber:dbg("[~p] ~p:get_module(~p, ~p).~n"
"Id doesn't exist, mismatch Id vs Type or DB error: ~p",
- [?LINE, ?MODULE, Id, What], ?DEBUG_LEVEL),
+ [?LINE, ?MODULE, Id, Type, What], ?DEBUG_LEVEL),
corba:raise(#'MARSHAL'{completion_status=?COMPLETED_MAYBE})
end.
diff --git a/lib/orber/src/orber_tb.erl b/lib/orber/src/orber_tb.erl
index d3e3a8497d..26a36df0e9 100644
--- a/lib/orber/src/orber_tb.erl
+++ b/lib/orber/src/orber_tb.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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/lib/orber/test/Makefile b/lib/orber/test/Makefile
index d4be009af3..2f8777c773 100644
--- a/lib/orber/test/Makefile
+++ b/lib/orber/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -209,12 +209,12 @@ release_spec:
release_docs_spec:
release_tests_spec: tests
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) $(IDL_FILES) $(TEST_SPEC_FILE) $(COVER_FILE) \
- $(ERL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- $(INSTALL_DIR) $(RELSYSDIR)/$(IDLOUTDIR)
+ $(ERL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(SUITE_TARGET_FILES) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELSYSDIR)/$(IDLOUTDIR)"
$(INSTALL_DATA) $(GEN_TARGET_FILES) $(GEN_FILES) \
- $(RELSYSDIR)/$(IDLOUTDIR)
+ "$(RELSYSDIR)/$(IDLOUTDIR)"
diff --git a/lib/orber/test/csiv2_SUITE.erl b/lib/orber/test/csiv2_SUITE.erl
index 60ffa1eb09..b89bf0a56c 100644
--- a/lib/orber/test/csiv2_SUITE.erl
+++ b/lib/orber/test/csiv2_SUITE.erl
@@ -668,67 +668,57 @@ code_OpenSSL509_api(_Config) ->
ssl_server_peercert_api(doc) -> ["Test ssl:peercert (server side)"];
ssl_server_peercert_api(suite) -> [];
ssl_server_peercert_api(_Config) ->
- case os:type() of
- vxworks ->
- {skipped, "No SSL-support for VxWorks."};
- _ ->
- Options = orber_test_lib:get_options(iiop_ssl, server,
- 2, [{iiop_ssl_port, 0}]),
- {ok, ServerNode, ServerHost} =
- ?match({ok,_,_}, orber_test_lib:js_node(Options)),
- ServerPort = orber_test_lib:remote_apply(ServerNode, orber, iiop_ssl_port, []),
- SSLOptions = orber_test_lib:get_options(ssl, client),
- {ok, Socket} =
- ?match({ok, _}, fake_client_ORB(ssl, ServerHost, ServerPort, SSLOptions)),
- {ok, _PeerCert} = ?match({ok, _}, orber_socket:peercert(ssl, Socket)),
- %% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [pkix, subject])),
- %% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [ssl, subject])),
- % ?match({ok, #'Certificate'{}},
- % 'OrberCSIv2':decode('Certificate', PeerCert)),
- destroy_fake_ORB(ssl, Socket),
- ok
- end.
+ Options = orber_test_lib:get_options(iiop_ssl, server,
+ 2, [{iiop_ssl_port, 0}]),
+ {ok, ServerNode, ServerHost} =
+ ?match({ok,_,_}, orber_test_lib:js_node(Options)),
+ ServerPort = orber_test_lib:remote_apply(ServerNode, orber, iiop_ssl_port, []),
+ SSLOptions = orber_test_lib:get_options(ssl, client),
+ {ok, Socket} =
+ ?match({ok, _}, fake_client_ORB(ssl, ServerHost, ServerPort, SSLOptions)),
+ {ok, _PeerCert} = ?match({ok, _}, orber_socket:peercert(ssl, Socket)),
+ %% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [pkix, subject])),
+ %% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [ssl, subject])),
+ % ?match({ok, #'Certificate'{}},
+ % 'OrberCSIv2':decode('Certificate', PeerCert)),
+ destroy_fake_ORB(ssl, Socket),
+ ok.
ssl_client_peercert_api(doc) -> ["Test ssl:peercert (client side)"];
ssl_client_peercert_api(suite) -> [];
ssl_client_peercert_api(_Config) ->
- case os:type() of
- vxworks ->
- {skipped, "No SSL-support for VxWorks."};
- _ ->
- Options = orber_test_lib:get_options(iiop_ssl, client,
- 2, [{iiop_ssl_port, 0}]),
- {ok, ClientNode, _ClientHost} =
- ?match({ok,_,_}, orber_test_lib:js_node(Options)),
- crypto:start(),
- ssl:start(),
- SSLOptions = orber_test_lib:get_options(ssl, server),
- {ok, LSock} = ?match({ok, _}, ssl:listen(0, SSLOptions)),
- {ok, {_Address, LPort}} = ?match({ok, {_, _}}, ssl:sockname(LSock)),
- IOR = ?match({'IOP_IOR',_,_},
- iop_ior:create_external({1, 2}, "IDL:FAKE:1.0",
- "localhost", 6004, "FAKE",
- [#'IOP_TaggedComponent'
- {tag=?TAG_SSL_SEC_TRANS,
- component_data=#'SSLIOP_SSL'
- {target_supports = 2,
- target_requires = 2,
- port = LPort}}])),
- spawn(orber_test_lib, remote_apply,
- [ClientNode, corba_object, non_existent, [IOR]]),
- {ok, Socket} = ?match({ok, _}, ssl:transport_accept(LSock)),
- ?match(ok, ssl:ssl_accept(Socket)),
-
- {ok, _PeerCert} = ?match({ok, _}, orber_socket:peercert(ssl, Socket)),
- %% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [pkix, subject])),
- %% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [ssl, subject])),
- % ?match({ok, #'Certificate'{}},
- % 'OrberCSIv2':decode('Certificate', PeerCert)),
- ssl:close(Socket),
- ssl:close(LSock),
- ssl:stop(),
- ok
- end.
+ Options = orber_test_lib:get_options(iiop_ssl, client,
+ 2, [{iiop_ssl_port, 0}]),
+ {ok, ClientNode, _ClientHost} =
+ ?match({ok,_,_}, orber_test_lib:js_node(Options)),
+ crypto:start(),
+ ssl:start(),
+ SSLOptions = orber_test_lib:get_options(ssl, server),
+ {ok, LSock} = ?match({ok, _}, ssl:listen(0, SSLOptions)),
+ {ok, {_Address, LPort}} = ?match({ok, {_, _}}, ssl:sockname(LSock)),
+ IOR = ?match({'IOP_IOR',_,_},
+ iop_ior:create_external({1, 2}, "IDL:FAKE:1.0",
+ "localhost", 6004, "FAKE",
+ [#'IOP_TaggedComponent'
+ {tag=?TAG_SSL_SEC_TRANS,
+ component_data=#'SSLIOP_SSL'
+ {target_supports = 2,
+ target_requires = 2,
+ port = LPort}}])),
+ spawn(orber_test_lib, remote_apply,
+ [ClientNode, corba_object, non_existent, [IOR]]),
+ {ok, Socket} = ?match({ok, _}, ssl:transport_accept(LSock)),
+ ?match(ok, ssl:ssl_accept(Socket)),
+
+ {ok, _PeerCert} = ?match({ok, _}, orber_socket:peercert(ssl, Socket)),
+ %% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [pkix, subject])),
+ %% ?match({ok, {rdnSequence, _}}, orber_socket:peercert(ssl, Socket, [ssl, subject])),
+ % ?match({ok, #'Certificate'{}},
+ % 'OrberCSIv2':decode('Certificate', PeerCert)),
+ ssl:close(Socket),
+ ssl:close(LSock),
+ ssl:stop(),
+ ok.
%%-----------------------------------------------------------------
%% Local functions.
diff --git a/lib/orber/test/orber_SUITE.erl b/lib/orber/test/orber_SUITE.erl
index be6ffa201c..26dc656b63 100644
--- a/lib/orber/test/orber_SUITE.erl
+++ b/lib/orber/test/orber_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -20,7 +20,6 @@
-module(orber_SUITE).
-include_lib("test_server/include/test_server.hrl").
-
-define(default_timeout, ?t:minutes(15)).
-define(application, orber).
@@ -31,7 +30,11 @@
% Test cases must be exported.
-export([app_test/1, undefined_functions/1, install_load_order/1,
- install_local_content/1]).
+ install_local_content/1,
+ otp_9887/1]).
+
+%% Exporting error handler callbacks for use in otp_9887
+-export([init/1, handle_event/2]).
%%
%% all/1
@@ -40,7 +43,8 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[app_test, undefined_functions, install_load_order,
- install_local_content].
+ install_local_content,
+ otp_9887].
groups() ->
[].
@@ -76,6 +80,27 @@ app_test(_Config) ->
?line ok=?t:app_test(orber),
ok.
+otp_9887(_Config) ->
+ orber:jump_stop(),
+ application:set_env(orber, orber_debug_level, 10),
+ orber:jump_start([]),
+
+ mnesia:create_table(orber_light_ifr, []),
+
+ error_logger:add_report_handler(?MODULE,[self()]),
+ catch orber_ifr:get_module(foo, bar),
+
+ receive
+ {stolen,Reason} ->
+ {error,_Pid1, {_Pid2, _ErrorString, ArgumentList}} = Reason,
+ 5 = length(ArgumentList)
+ after 500 ->
+ test_server:fail("OTP_9887 TIMED OUT")
+ end,
+
+ orber:jump_stop(),
+ ok.
+
%% Install Orber using the load_order option.
install_load_order(suite) ->
[];
@@ -192,5 +217,10 @@ key1search(Key, L) ->
fail(Reason) ->
exit({suite_failed, Reason}).
+%% Error handler
+init([Proc]) -> {ok,Proc}.
+handle_event(Event, Proc) ->
+ Proc ! {stolen,Event},
+ {ok,Proc}.
diff --git a/lib/orber/test/orber_acl_SUITE.erl b/lib/orber/test/orber_acl_SUITE.erl
index 49107cde84..ab2c2c872c 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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/lib/orber/test/orber_test_lib.erl b/lib/orber/test/orber_test_lib.erl
index 0ddde49cd6..6824d25aef 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -278,23 +278,13 @@ check_options(Options) ->
end.
starter(Host, Name, Args) ->
- case os:type() of
- vxworks ->
- test_server:start_node(Name, slave, [{args,Args}]);
- _ ->
- slave:start_link(Host, Name, Args)
- end.
+ io:format("slave:start_link(~p,~p,~p).~n",[Host,Name,Args]),
+ slave:start_link(Host, Name, Args).
slave_sup() ->
process_flag(trap_exit, true),
receive
- {'EXIT', _, _} ->
- case os:type() of
- vxworks ->
- erlang:halt();
- _ ->
- ignore
- end
+ {'EXIT', _, _} -> ignore
end.
start_ssl(true, Node) ->
@@ -403,8 +393,8 @@ create_paths() ->
filename:join(Path, "idl_output") ++
" -pa " ++
filename:join(Path, "all_SUITE_data") ++
- " -pa " ++
- filename:dirname(code:which(orber)).
+ " -pa \"" ++
+ filename:dirname(code:which(orber))++"\"".
%%------------------------------------------------------------
%% function : destroy_node
@@ -418,12 +408,7 @@ destroy_node(Node, Type) ->
stopper(Node, Type).
stopper(Node, _Type) ->
- case os:type() of
- vxworks ->
- test_server:stop_node(Node);
- _ ->
- slave:stop(Node)
- end.
+ slave:stop(Node).
%%------------------------------------------------------------
diff --git a/lib/orber/vsn.mk b/lib/orber/vsn.mk
index 0eac1e1410..f891440600 100644
--- a/lib/orber/vsn.mk
+++ b/lib/orber/vsn.mk
@@ -1,3 +1,3 @@
-ORBER_VSN = 3.6.23
+ORBER_VSN = 3.6.24
diff --git a/lib/os_mon/c_src/Makefile.in b/lib/os_mon/c_src/Makefile.in
index bac0413ece..e728e43a09 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-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -63,14 +63,10 @@ ENTRY_OBJ=$(ERL_TOP)/erts/obj/$(TARGET)/port_entry.o
PORT_ENTRY_POINT=erl_port_entry
ENTRY_LDFLAGS=-entry:$(PORT_ENTRY_POINT)
else
-ifeq ($(findstring vxworks_simso,$(TARGET)),vxworks_simso)
-PROGRAMS =
-else
PROGRAMS = \
memsup @os_mon_programs@
C_FILES= $(PROGRAMS:%=%.c)
endif
-endif
TARGET_FILES= $(PROGRAMS:%=$(BINDIR)/%)
@@ -127,14 +123,10 @@ $(OBJDIR)/memsup.o: memsup.h
# ----------------------------------------------------
include $(ERL_TOP)/make/otp_release_targets.mk
-ifeq ($(findstring vxworks_simso,$(TARGET)),vxworks_simso)
-release_spec:
-else
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(C_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/priv/bin
- $(INSTALL_PROGRAM) $(TARGET_FILES) $(RELSYSDIR)/priv/bin
-endif
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(C_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/bin"
+ $(INSTALL_PROGRAM) $(TARGET_FILES) "$(RELSYSDIR)/priv/bin"
release_docs_spec:
diff --git a/lib/os_mon/c_src/cpu_sup.c b/lib/os_mon/c_src/cpu_sup.c
index 9c5f9a6aa5..7372d5b0e8 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2012. 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
@@ -458,8 +458,18 @@ static void error(char* err_msg) {
* if we get error here we have trouble,
* silence unnecessary warnings
*/
- if(write(FD_ERR, err_msg, strlen(err_msg)));
- if(write(FD_ERR, "\n", 1));
+ char buffer[256] = "[os_mon] cpu supervisor port (cpu_sup): ";
+ int i = strlen(buffer), j = 0;
+ int n = strlen(err_msg);
+
+ while(i < 253 && j < n) {
+ buffer[i++] = err_msg[j++];
+ }
+ buffer[i++] = '\r';
+ buffer[i++] = '\n';
+
+ /* try to use one write only */
+ if(write(FD_ERR, buffer, i));
exit(-1);
}
diff --git a/lib/os_mon/c_src/memsup.c b/lib/os_mon/c_src/memsup.c
index 241e7718db..3a1a8e9444 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-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1996-2012. 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
@@ -31,7 +31,7 @@
*
* This program is started from Erlang as follows,
*
- * Port = open_port({spawn, 'memsup'}, [{packet,1}]) for UNIX and VxWorks
+ * Port = open_port({spawn, 'memsup'}, [{packet,1}]) for UNIX
*
* Erlang sends one of the request condes defined in memsup.h and this program
* answers in one of two ways:
@@ -75,10 +75,6 @@
* that there is no process at the other end of the connection
* having the connection open for writing (end-of-file).
*
- * COMPILING
- *
- * When the target is VxWorks the identifier VXWORKS must be defined for
- * the preprocessor (usually by a -D option).
*/
#if defined(sgi) || defined(__sgi) || defined(__sgi__)
@@ -90,9 +86,7 @@
#include <stddef.h>
#include <stdlib.h>
-#ifndef VXWORKS
#include <unistd.h>
-#endif
#if (defined(__unix__) || defined(unix)) && !defined(USG)
#include <sys/param.h>
@@ -104,12 +98,6 @@
#include <time.h>
#include <errno.h>
-#ifdef VXWORKS
-#include <vxWorks.h>
-#include <ioLib.h>
-#include <memLib.h>
-#endif
-
#ifdef BSD4_4
#include <sys/types.h>
#include <sys/sysctl.h>
@@ -143,20 +131,8 @@
/* prototypes */
static void print_error(const char *,...);
-#ifdef VXWORKS
-extern int erl_mem_info_get(MEM_PART_STATS *);
-#endif
-
-#ifdef VXWORKS
-#define MAIN memsup
-static MEM_PART_STATS latest;
-static unsigned long latest_system_total; /* does not fit in the struct */
-
-#else
#define MAIN main
-#endif
-
/*
* example, we want procfs information, now give them something equivalent:
@@ -282,16 +258,6 @@ send_tag(int value){
}
}
-
-#ifdef VXWORKS
-static void load_statistics(void){
- if(memPartInfoGet(memSysPartId,&latest) != OK)
- memset(&latest,0,sizeof(latest));
- latest_system_total = latest.numBytesFree + latest.numBytesAlloc;
- erl_mem_info_get(&latest); /* if it fails, latest is untouched */
-}
-#endif
-
#ifdef BSD4_4
static int
get_vmtotal(struct vmtotal *vt) {
@@ -327,27 +293,27 @@ get_mem_procfs(memory_ext *me){
/* Total and free is NEEDED! */
bp = strstr(buffer, "MemTotal:");
- if (sscanf(bp, "MemTotal: %lu kB\n", &(me->total))) me->flag |= F_MEM_TOTAL;
+ if (bp != NULL && sscanf(bp, "MemTotal: %lu kB\n", &(me->total))) me->flag |= F_MEM_TOTAL;
bp = strstr(buffer, "MemFree:");
- if (sscanf(bp, "MemFree: %lu kB\n", &(me->free))) me->flag |= F_MEM_FREE;
+ if (bp != NULL && sscanf(bp, "MemFree: %lu kB\n", &(me->free))) me->flag |= F_MEM_FREE;
/* Extensions */
bp = strstr(buffer, "Buffers:");
- if (sscanf(bp, "Buffers: %lu kB\n", &(me->buffered))) me->flag |= F_MEM_BUFFERS;
+ if (bp != NULL && sscanf(bp, "Buffers: %lu kB\n", &(me->buffered))) me->flag |= F_MEM_BUFFERS;
bp = strstr(buffer, "Cached:");
- if (sscanf(bp, "Cached: %lu kB\n", &(me->cached))) me->flag |= F_MEM_CACHED;
+ if (bp != NULL && sscanf(bp, "Cached: %lu kB\n", &(me->cached))) me->flag |= F_MEM_CACHED;
/* Swap */
bp = strstr(buffer, "SwapTotal:");
- if (sscanf(bp, "SwapTotal: %lu kB\n", &(me->total_swap))) me->flag |= F_SWAP_TOTAL;
+ if (bp != NULL && sscanf(bp, "SwapTotal: %lu kB\n", &(me->total_swap))) me->flag |= F_SWAP_TOTAL;
bp = strstr(buffer, "SwapFree:");
- if (sscanf(bp, "SwapFree: %lu kB\n", &(me->free_swap))) me->flag |= F_SWAP_FREE;
+ if (bp != NULL && sscanf(bp, "SwapFree: %lu kB\n", &(me->free_swap))) me->flag |= F_SWAP_FREE;
me->pagesize = 1024; /* procfs defines its size in kB */
@@ -358,19 +324,6 @@ get_mem_procfs(memory_ext *me){
/* arch specific functions */
-#if defined(VXWORKS)
-static int
-get_extended_mem_vxwork(memory_ext *me) {
- load_statistics();
- me->total = (latest.numBytesFree + latest.numBytesAlloc);
- me->free = latest.numBytesFree;
- me->pagesize = 1;
- me->flag = F_MEM_TOTAL | F_MEM_FREE;
- return 1;
-}
-#endif
-
-
#if defined(__linux__) /* ifdef SYSINFO */
/* sysinfo does not include cached memory which is a problem. */
static int
@@ -442,12 +395,8 @@ get_extended_mem_sgi(memory_ext *me) {
static void
get_extended_mem(memory_ext *me) {
-/* vxworks */
-#if defined(VXWORKS)
- if (get_extended_mem_vxworks(me)) return;
-
/* linux */
-#elif defined(__linux__)
+#if defined(__linux__)
if (get_mem_procfs(me)) return;
if (get_extended_mem_sysinfo(me)) return;
@@ -477,12 +426,7 @@ get_extended_mem(memory_ext *me) {
static void
get_basic_mem(unsigned long *tot, unsigned long *used, unsigned long *pagesize){
-#if defined(VXWORKS)
- load_statistics();
- *tot = (latest.numBytesFree + latest.numBytesAlloc);
- *used = latest.numBytesAlloc;
- *pagesize = 1;
-#elif defined(_SC_AVPHYS_PAGES) /* Does this exist on others than Solaris2? */
+#if defined(_SC_AVPHYS_PAGES) /* Does this exist on others than Solaris2? */
unsigned long avPhys, phys, pgSz;
phys = sysconf(_SC_PHYS_PAGES);
@@ -493,7 +437,7 @@ get_basic_mem(unsigned long *tot, unsigned long *used, unsigned long *pagesize){
#elif defined(__linux__) && !defined(_SC_AVPHYS_PAGES)
memory_ext me;
if (get_mem_procfs(&me) < 0) {
- print_error("ProcFS read error.");
+ print_error("ProcFS read error");
exit(1);
}
*tot = me.total;
@@ -557,17 +501,8 @@ extended_show_mem(void){
if (me.flag & F_SWAP_TOTAL) { send_tag(SWAP_TOTAL); send(me.total_swap, ps); }
if (me.flag & F_SWAP_FREE) { send_tag(SWAP_FREE); send(me.free_swap, ps); }
-#ifdef VXWORKS
- send_tag(SM_SYSTEM_TOTAL);
- send(latest_system_total, 1);
- send_tag(SM_LARGEST_FREE);
- send(latest.maxBlockSizeFree, 1);
- send_tag(SM_NUMBER_OF_FREE);
- send(latest.numBlocksFree, 1);
-#else
/* total is system total*/
if (me.flag & F_MEM_TOTAL) { send_tag(MEM_SYSTEM_TOTAL); send(me.total, ps); }
-#endif
send_tag(SHOW_SYSTEM_MEM_END);
}
@@ -582,7 +517,7 @@ message_loop(int erlin_fd)
* Wait for command from Erlang
*/
if ((res = read(erlin_fd, &cmdLen, 1)) < 0) {
- print_error("Error reading from Erlang.");
+ print_error("Error reading from Erlang");
return;
}
@@ -603,19 +538,19 @@ message_loop(int erlin_fd)
break;
case 0:
- print_error("Erlang has closed.");
+ print_error("Erlang has closed");
return;
default:
- print_error("Error reading from Erlang.");
+ print_error("Error reading from Erlang");
return;
} /* switch() */
} else { /* cmdLen != 1 */
- print_error("Invalid command length (%d) received.", cmdLen);
+ print_error("Invalid command length (%d) received", cmdLen);
return;
}
} else { /* Erlang end closed */
- print_error("Erlang has closed.");
+ print_error("Erlang has closed");
return;
}
}
@@ -641,15 +576,12 @@ static void
print_error(const char *format,...)
{
va_list args;
+ char buffer[256];
va_start(args, format);
- fprintf(stderr, "%s: ", program_name);
- vfprintf(stderr, format, args);
+ vsnprintf(buffer, 256, format, args);
va_end(args);
- fprintf(stderr, " \n");
+ /* try to use one write only */
+ fprintf(stderr, "[os_mon] memory supervisor port (memsup): %s\r\n", buffer);
+ fflush(stderr);
}
-
-
-
-
-
diff --git a/lib/os_mon/c_src/win32sysinfo.c b/lib/os_mon/c_src/win32sysinfo.c
index 2a155aae87..f02ae637b2 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-2009. All Rights Reserved.
+ * Copyright Ericsson AB 1997-2012. 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
@@ -89,6 +89,7 @@ typedef BOOL (WINAPI *tfpGetDiskFreeSpaceEx)(LPCTSTR, PULARGE_INTEGER,PULARGE_IN
static tfpGetDiskFreeSpaceEx fpGetDiskFreeSpaceEx;
+static void print_error(const char *msg);
static void
return_answer(char* value)
{
@@ -98,7 +99,7 @@ return_answer(char* value)
res = write(1,(char*) &bytes,1);
if (res != 1) {
- fprintf(stderr,"win32sysinfo:Error writing to pipe");
+ print_error("Error writing to pipe");
exit(1);
}
@@ -107,9 +108,8 @@ return_answer(char* value)
while (left > 0)
{
res = write(1, value+bytes-left, left);
- if (res <= 0)
- {
- fprintf(stderr,"win32sysinfo:Error writing to pipe");
+ if (res <= 0) {
+ print_error("Error writing to pipe");
exit(1);
}
left -= res;
@@ -248,7 +248,6 @@ message_loop()
char cmd[512];
int res;
- fprintf(stderr,"in message_loop\n");
/* Startup ACK. */
return_answer(OK);
while (1)
@@ -257,12 +256,12 @@ message_loop()
* Wait for command from Erlang
*/
if ((res = read(0, &cmdLen, 1)) < 0) {
- fprintf(stderr,"win32sysinfo:Error reading from Erlang.");
+ print_error("Error reading from Erlang");
return;
}
if (res != 1){ /* Exactly one byte read ? */
- fprintf(stderr,"win32sysinfo:Erlang has closed.");
+ print_error("Erlang has closed");
return;
}
if ((res = read(0, &cmd, cmdLen)) == cmdLen){
@@ -291,11 +290,11 @@ message_loop()
return_answer("xEND");
}
else if (res == 0) {
- fprintf(stderr,"win32sysinfo:Erlang has closed.");
+ print_error("Erlang has closed");
return;
}
else {
- fprintf(stderr,"win32sysinfo:Error reading from Erlang.");
+ print_error("Error reading from Erlang");
return;
}
}
@@ -309,10 +308,9 @@ int main(int argc, char ** argv){
message_loop();
return 0;
}
-
-
-
-
-
-
-
+static void
+print_error(const char *msg) {
+ /* try to use one write only */
+ fprintf(stderr, "[os_mon] win32 supervisor port (win32sysinfo): %s\r\n", msg);
+ fflush(stderr);
+}
diff --git a/lib/os_mon/doc/src/Makefile b/lib/os_mon/doc/src/Makefile
index c9765749c9..08fd23ec92 100644
--- a/lib/os_mon/doc/src/Makefile
+++ b/lib/os_mon/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -109,16 +109,16 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man6
- $(INSTALL_DATA) $(MAN6DIR)/* $(RELEASE_PATH)/man/man6
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man6"
+ $(INSTALL_DATA) $(MAN6DIR)/* "$(RELEASE_PATH)/man/man6"
release_spec:
diff --git a/lib/os_mon/doc/src/notes.xml b/lib/os_mon/doc/src/notes.xml
index b459e31fa5..061183e51c 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,6 +30,46 @@
</header>
<p>This document describes the changes made to the OS_Mon application.</p>
+<section><title>Os_Mon 2.2.10</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Infinity timeout added to internal calls in disksup to
+ allow it to work properly under very heavy load.</p>
+ <p>
+ Own Id: OTP-10100</p>
+ </item>
+ <item>
+ <p>Clarify error messages from os_mon port programs</p>
+ <p>
+ Own Id: OTP-10161</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Os_Mon 2.2.9</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fix segmentation fault in memsup</p>
+ <p>
+ when /proc/meminfo does not include information about
+ buffers/cache (for instance inside OpenVZ container)
+ (Thanks to Anton Vorobev)</p>
+ <p>
+ Own Id: OTP-9913</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Os_Mon 2.2.8</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/os_mon/mibs/Makefile b/lib/os_mon/mibs/Makefile
index 655190edf4..3e24c3d373 100644
--- a/lib/os_mon/mibs/Makefile
+++ b/lib/os_mon/mibs/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -88,13 +88,13 @@ $(SNMP_BIN_TARGET_DIR)/OTP-OS-MON-MIB.bin: \
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/mibs
- $(INSTALL_DIR) $(RELSYSDIR)/mibs/v1
- $(INSTALL_DATA) $(MIB_FILES) $(FUNCS_FILES) $(RELSYSDIR)/mibs
- $(INSTALL_DATA) $(V1_MIB_FILES) $(RELSYSDIR)/mibs/v1
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(HRL_TARGETS) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/priv/mibs
- $(INSTALL_DATA) $(BIN_TARGETS) $(RELSYSDIR)/priv/mibs
+ $(INSTALL_DIR) "$(RELSYSDIR)/mibs"
+ $(INSTALL_DIR) "$(RELSYSDIR)/mibs/v1"
+ $(INSTALL_DATA) $(MIB_FILES) $(FUNCS_FILES) "$(RELSYSDIR)/mibs"
+ $(INSTALL_DATA) $(V1_MIB_FILES) "$(RELSYSDIR)/mibs/v1"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(HRL_TARGETS) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/mibs"
+ $(INSTALL_DATA) $(BIN_TARGETS) "$(RELSYSDIR)/priv/mibs"
release_docs_spec:
diff --git a/lib/os_mon/src/Makefile b/lib/os_mon/src/Makefile
index 9a75446a89..864d7a09d4 100644
--- a/lib/os_mon/src/Makefile
+++ b/lib/os_mon/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -94,11 +94,11 @@ $(EBIN)/memsup.$(EMULATOR): $(MEMSUP_HRL)
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/os_mon/src/disksup.erl b/lib/os_mon/src/disksup.erl
index 308cd1b7fa..f5f76f1488 100644
--- a/lib/os_mon/src/disksup.erl
+++ b/lib/os_mon/src/disksup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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,24 +43,24 @@ start_link() ->
gen_server:start_link({local, disksup}, disksup, [], []).
get_disk_data() ->
- os_mon:call(disksup, get_disk_data).
+ os_mon:call(disksup, get_disk_data, infinity).
get_check_interval() ->
- os_mon:call(disksup, get_check_interval).
+ os_mon:call(disksup, get_check_interval, infinity).
set_check_interval(Minutes) ->
case param_type(disk_space_check_interval, Minutes) of
true ->
- os_mon:call(disksup, {set_check_interval, Minutes});
+ os_mon:call(disksup, {set_check_interval, Minutes}, infinity);
false ->
erlang:error(badarg)
end.
get_almost_full_threshold() ->
- os_mon:call(disksup, get_almost_full_threshold).
+ os_mon:call(disksup, get_almost_full_threshold, infinity).
set_almost_full_threshold(Float) ->
case param_type(disk_almost_full_threshold, Float) of
true ->
- os_mon:call(disksup, {set_almost_full_threshold, Float});
+ os_mon:call(disksup, {set_almost_full_threshold, Float}, infinity);
false ->
erlang:error(badarg)
end.
diff --git a/lib/os_mon/src/memsup.erl b/lib/os_mon/src/memsup.erl
index 49533da1f7..a1b8591c8c 100644
--- a/lib/os_mon/src/memsup.erl
+++ b/lib/os_mon/src/memsup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -112,7 +112,7 @@ get_helper_timeout() ->
set_helper_timeout(Seconds) ->
case param_type(memsup_helper_timeout, Seconds) of
true ->
- os_mon:call(memsup, {set_helper_timeout, Seconds});
+ os_mon:call(memsup, {set_helper_timeout, Seconds}, infinity);
false ->
erlang:error(badarg)
end.
@@ -185,7 +185,6 @@ init([]) ->
{unix, irix} -> true;
{unix, sunos} -> true;
{win32, _OSname} -> false;
- vxworks -> true;
_ ->
exit({unsupported_os, OS})
end,
@@ -617,8 +616,7 @@ code_change(Vsn, PrevState, "1.8") ->
{unix, openbsd} -> true;
{unix, netbsd} -> true;
{unix, sunos} -> true;
- {win32, _OSname} -> false;
- vxworks -> true
+ {win32, _OSname} -> false
end,
Pid = if
PortMode -> spawn_link(fun() -> port_init() end);
diff --git a/lib/os_mon/src/os_mon.erl b/lib/os_mon/src/os_mon.erl
index 3098c38808..df1eccb064 100644
--- a/lib/os_mon/src/os_mon.erl
+++ b/lib/os_mon/src/os_mon.erl
@@ -85,13 +85,13 @@ open_port(Name, Opts) ->
%% Check os_mon*/priv/bin/Name
case filelib:is_regular(ReleasedPath) of
true ->
- erlang:open_port({spawn, ReleasedPath}, Opts);
+ erlang:open_port({spawn, "\""++ReleasedPath++"\""}, Opts);
false ->
%% Use os_mon*/priv/bin/Arch/Name
ArchPath =
filename:join(
[PrivDir,"bin",erlang:system_info(system_architecture),Name]),
- erlang:open_port({spawn, ArchPath}, Opts)
+ erlang:open_port({spawn, "\""++ArchPath++"\""}, Opts)
end.
@@ -177,8 +177,6 @@ services({unix, _}) -> % Other unix.
[cpu_sup, disksup, memsup];
services({win32, _}) ->
[disksup, memsup, os_sup, sysinfo];
-services(vxworks) ->
- [memsup];
services(_) ->
[].
diff --git a/lib/os_mon/src/os_mon_sysinfo.erl b/lib/os_mon/src/os_mon_sysinfo.erl
index 080885d5d6..fb732d1e3a 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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/lib/os_mon/test/Makefile b/lib/os_mon/test/Makefile
index a240640f92..461bebc102 100644
--- a/lib/os_mon/test/Makefile
+++ b/lib/os_mon/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -84,9 +84,10 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec:
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) os_mon.spec os_mon.cover $(EMAKEFILE) $(SOURCE) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) os_mon.spec os_mon.cover $(EMAKEFILE) $(SOURCE) "$(RELSYSDIR)"
+ $(INSTALL_DATA) os_mon_mib_SUITE.cfg "$(RELSYSDIR)"
-## tar chf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+## tar chf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/os_mon/test/os_mon.spec b/lib/os_mon/test/os_mon.spec
index d292b258f3..4b4286b313 100644
--- a/lib/os_mon/test/os_mon.spec
+++ b/lib/os_mon/test/os_mon.spec
@@ -1 +1,2 @@
{suites,"../os_mon_test",all}.
+{config,"os_mon_mib_SUITE.cfg"}. \ No newline at end of file
diff --git a/lib/os_mon/test/os_mon_mib_SUITE.cfg b/lib/os_mon/test/os_mon_mib_SUITE.cfg
new file mode 100644
index 0000000000..a33c23530b
--- /dev/null
+++ b/lib/os_mon/test/os_mon_mib_SUITE.cfg
@@ -0,0 +1,8 @@
+%% -*- erlang -*-
+{snmp, [{start_agent,true},
+ {users,[{os_mon_mib_test,[snmpm_user_default,[]]}]},
+ {managed_agents,[{os_mon_mib_test,
+ [os_mon_mib_test, {127,0,0,1}, 4000, []]}]},
+ {agent_sysname,"Test os_mon_mibs"},
+ {mgr_port,5001}
+ ]}.
diff --git a/lib/os_mon/test/os_mon_mib_SUITE.erl b/lib/os_mon/test/os_mon_mib_SUITE.erl
index a137efc441..08f5532d50 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -18,16 +18,20 @@
%%
-module(os_mon_mib_SUITE).
-%-define(STANDALONE,1).
+%%-----------------------------------------------------------------
+%% This suite can no longer be executed standalone, i.e. it must be
+%% executed with common test. The reason is that ct_snmp is used
+%% instead of the snmp application directly. The suite requires a
+%% config file, os_mon_mib_SUITE.cfg, found in the same directory as
+%% the suite.
+%%
+%% Execute with:
+%% > ct_run -suite os_mon_mib_SUITE -config os_mon_mib_SUITE.cfg
+%%-----------------------------------------------------------------
--ifdef(STANDALONE).
--define(line,erlang:display({line,?LINE}),).
--define(config(A,B), config(A,B)).
--else.
-include_lib("test_server/include/test_server.hrl").
-include_lib("os_mon/include/OTP-OS-MON-MIB.hrl").
-include_lib("snmp/include/snmp_types.hrl").
--endif.
% Test server specific exports
-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,
@@ -60,15 +64,6 @@
-define(MGR_PORT, 5001).
%%---------------------------------------------------------------------
--ifdef(STANDALONE).
--export([run/0]).
-run() ->
- catch init_per_suite([]),
- Ret = (catch update_load_table([])),
- catch end_per_suite([]),
- Ret.
--else.
-
init_per_testcase(_Case, Config) when is_list(Config) ->
Dog = test_server:timetrap(test_server:minutes(6)),
[{watchdog, Dog}|Config].
@@ -78,7 +73,8 @@ end_per_testcase(_Case, Config) when is_list(Config) ->
test_server:timetrap_cancel(Dog),
Config.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() -> [{ct_hooks,[ts_install_cth]},
+ {require, snmp_mgr_agent, snmp}].
all() ->
[load_unload, get_mem_sys_mark, get_mem_proc_mark,
@@ -104,8 +100,6 @@ end_per_group(_GroupName, Config) ->
Config.
-
--endif.
%%---------------------------------------------------------------------
%%--------------------------------------------------------------------
%% Function: init_per_suite(Config) -> Config
@@ -121,50 +115,13 @@ init_per_suite(Config) ->
?line application:start(mnesia),
?line application:start(os_mon),
- %% Create initial configuration data for the snmp application
- ?line PrivDir = ?config(priv_dir, Config),
- ?line ConfDir = filename:join(PrivDir, "conf"),
- ?line DbDir = filename:join(PrivDir,"db"),
- ?line MgrDir = filename:join(PrivDir,"mgr"),
-
- ?line file:make_dir(ConfDir),
- ?line file:make_dir(DbDir),
- ?line file:make_dir(MgrDir),
-
- {ok, HostName} = inet:gethostname(),
- {ok, Addr} = inet:getaddr(HostName, inet),
-
- ?line snmp_config:write_agent_snmp_files(ConfDir, ?CONF_FILE_VER,
- tuple_to_list(Addr), ?TRAP_UDP,
- tuple_to_list(Addr),
- ?AGENT_UDP, ?SYS_NAME),
-
- ?line snmp_config:write_manager_snmp_files(MgrDir, tuple_to_list(Addr),
- ?MGR_PORT, ?MAX_MSG_SIZE,
- ?ENGINE_ID, [], [], []),
-
- %% To make sure application:set_env is not overwritten by any
- %% app-file settings.
- ?line ok = application:load(snmp),
-
- ?line application:set_env(snmp, agent, [{db_dir, DbDir},
- {config, [{dir, ConfDir}]},
- {agent_type, master},
- {agent_verbosity, trace},
- {net_if, [{verbosity, trace}]}]),
- ?line application:set_env(snmp, manager, [{config, [{dir, MgrDir},
- {db_dir, MgrDir},
- {verbosity, trace}]},
- {server, [{verbosity, trace}]},
- {net_if, [{verbosity, trace}]},
- {versions, [v1, v2, v3]}]),
- application:start(snmp),
+ ok = ct_snmp:start(Config,snmp_mgr_agent),
%% Load the mibs that should be tested
otp_mib:load(snmp_master_agent),
os_mon_mib:load(snmp_master_agent),
- [{agent_ip, Addr}| Config].
+ Config.
%%--------------------------------------------------------------------
%% Function: end_per_suite(Config) -> _
%% Config - [tuple()]
@@ -197,7 +154,7 @@ end_per_suite(Config) ->
load_unload(doc) ->
["Test to unload and the reload the OTP.mib "];
load_unload(suite) -> [];
-load_unload(Config) when list(Config) ->
+load_unload(Config) when is_list(Config) ->
?line os_mon_mib:unload(snmp_master_agent),
?line os_mon_mib:load(snmp_master_agent),
ok.
@@ -424,7 +381,7 @@ cpu_load(doc) ->
[];
cpu_load(suite) ->
[];
-cpu_load(Config) when list(Config) ->
+cpu_load(Config) when is_list(Config) ->
?line [{[?loadCpuLoad, Len | NodeStr], Load}] =
os_mon_mib:load_table(get_next,[], [?loadCpuLoad]),
?line Len = length(NodeStr),
@@ -640,32 +597,24 @@ disk_capacity(Config) when is_list(Config) ->
%%---------------------------------------------------------------------
real_snmp_request(doc) ->
- ["Starts an snmp manager and sends a real snmp-reques. i.e. "
+ ["Starts an snmp manager and sends a real snmp-request. i.e. "
"sends a udp message on the correct format."];
real_snmp_request(suite) -> [];
-real_snmp_request(Config) when list(Config) ->
- Agent_ip = ?config(agent_ip, Config),
-
- ?line ok = snmpm:register_user(os_mon_mib_test, snmpm_user_default, []),
- ?line ok = snmpm:register_agent(os_mon_mib_test, Agent_ip, ?AGENT_UDP),
-
+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(Agent_ip,
- [?loadEntry ++
+ ?line ok = snmp_get([?loadEntry ++
[?loadLargestErlProcess, Len | NodStr]],
PidStr),
- ?line ok = snmp_get_next(Agent_ip,
- [?loadEntry ++
+ ?line ok = snmp_get_next([?loadEntry ++
[?loadSystemUsedMemory, Len | NodStr]],
?loadEntry ++ [?loadSystemUsedMemory + 1, Len
| NodStr], PidStr),
- ?line ok = snmp_set(Agent_ip, [?loadEntry ++
- [?loadLargestErlProcess, Len | NodStr]],
- s, "<0.101.0>"),
+ ?line ok = snmp_set([?loadEntry ++ [?loadLargestErlProcess, Len | NodStr]],
+ s, "<0.101.0>", Config),
ok.
otp_7441(doc) ->
@@ -674,34 +623,17 @@ otp_7441(doc) ->
otp_7441(suite) ->
[];
otp_7441(Config) when is_list(Config) ->
- Agent_ip = ?config(agent_ip, Config),
-
-
NodStr = atom_to_list(node()),
Len = length(NodStr),
Oids = [Oid|_] = [?loadEntry ++ [?loadSystemTotalMemory, Len | NodStr]],
- ?line { ok, {noError,0,[#varbind{oid = Oid, variabletype = 'Unsigned32'}]}, _} =
- snmpm:g(os_mon_mib_test, Agent_ip, ?AGENT_UDP, Oids),
+ {noError,0,[#varbind{oid = Oid, variabletype = 'Unsigned32'}]} =
+ ct_snmp:get_values(os_mon_mib_test, Oids, snmp_mgr_agent),
ok.
%%---------------------------------------------------------------------
%% Internal functions
%%---------------------------------------------------------------------
--ifdef(STANDALONE).
-config(priv_dir,_) ->
- "/tmp".
-
-start_node() ->
- Host = hd(tl(string:tokens(atom_to_list(node()),"@"))),
- {ok,Node} = slave:start(Host,testnisse),
- net_adm:ping(testnisse),
- Node.
-
-
-stop_node(Node) ->
- rpc:call(Node,erlang,halt,[]).
--else.
start_node() ->
?line Pa = filename:dirname(code:which(?MODULE)),
?line {ok,Node} = test_server:start_node(testnisse, slave,
@@ -711,8 +643,6 @@ start_node() ->
stop_node(Node) ->
test_server:stop_node(Node).
--endif.
-
del_dir(Dir) ->
io:format("Deleting: ~s~n",[Dir]),
{ok, Files} = file:list_dir(Dir),
@@ -722,21 +652,22 @@ del_dir(Dir) ->
file:del_dir(Dir).
%%---------------------------------------------------------------------
-snmp_get(Agent_ip, Oids = [Oid |_], Result) ->
- ?line {ok,{noError,0,[#varbind{oid = Oid,
- variabletype = 'OCTET STRING',
- value = Result}]}, _} =
- snmpm:g(os_mon_mib_test, Agent_ip, ?AGENT_UDP, Oids),
+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),
ok.
-snmp_get_next(Agent_ip, Oids, NextOid, Result) ->
- ?line {ok,{noError,0,[#varbind{oid = NextOid,
- variabletype = 'OCTET STRING',
- value = Result}]},_} =
- snmpm:gn(os_mon_mib_test, Agent_ip, ?AGENT_UDP, Oids),
+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),
ok.
-snmp_set(Agent_ip, Oid, ValuType, Value) ->
- ?line {ok, {notWritable, _, _}, _} =
- snmpm:s(os_mon_mib_test,Agent_ip,?AGENT_UDP,[{Oid, ValuType, Value}]),
+snmp_set(Oid, ValuType, Value, Config) ->
+ {notWritable, _, _} =
+ ct_snmp:set_values(os_mon_mib_test, [{Oid, ValuType, Value}],
+ snmp_mgr_agent, Config),
ok.
diff --git a/lib/os_mon/vsn.mk b/lib/os_mon/vsn.mk
index 89dfa59dd9..180906127c 100644
--- a/lib/os_mon/vsn.mk
+++ b/lib/os_mon/vsn.mk
@@ -1 +1 @@
-OS_MON_VSN = 2.2.8
+OS_MON_VSN = 2.2.10
diff --git a/lib/otp_mibs/doc/src/Makefile b/lib/otp_mibs/doc/src/Makefile
index bd2810034b..6b8610bc23 100644
--- a/lib/otp_mibs/doc/src/Makefile
+++ b/lib/otp_mibs/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -102,14 +102,14 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/otp_mibs/doc/src/notes.xml b/lib/otp_mibs/doc/src/notes.xml
index 71e33fceb9..3d3a1272a4 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>2009</year>
+ <year>2004</year><year>2012</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 5e59824d3f..703c4b3ed4 100644
--- a/lib/otp_mibs/mibs/Makefile
+++ b/lib/otp_mibs/mibs/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -76,13 +76,13 @@ v1/%.mib.v1: %.mib
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/mibs
- $(INSTALL_DIR) $(RELSYSDIR)/mibs/v1
- $(INSTALL_DATA) $(MIB_FILES) $(FUNCS_FILES) $(RELSYSDIR)/mibs
- $(INSTALL_DATA) $(V1_MIB_FILES) $(RELSYSDIR)/mibs/v1
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(HRL_TARGETS) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/priv/mibs
- $(INSTALL_DATA) $(BIN_TARGETS) $(RELSYSDIR)/priv/mibs
+ $(INSTALL_DIR) "$(RELSYSDIR)/mibs"
+ $(INSTALL_DIR) "$(RELSYSDIR)/mibs/v1"
+ $(INSTALL_DATA) $(MIB_FILES) $(FUNCS_FILES) "$(RELSYSDIR)/mibs"
+ $(INSTALL_DATA) $(V1_MIB_FILES) "$(RELSYSDIR)/mibs/v1"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(HRL_TARGETS) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/mibs"
+ $(INSTALL_DATA) $(BIN_TARGETS) "$(RELSYSDIR)/priv/mibs"
release_docs_spec:
diff --git a/lib/otp_mibs/src/Makefile b/lib/otp_mibs/src/Makefile
index 833a439adb..03298d39d5 100644
--- a/lib/otp_mibs/src/Makefile
+++ b/lib/otp_mibs/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -95,10 +95,10 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGETS) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGETS) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/parsetools/doc/src/Makefile b/lib/parsetools/doc/src/Makefile
index 6e693e0cf0..96879084d8 100644
--- a/lib/parsetools/doc/src/Makefile
+++ b/lib/parsetools/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -105,14 +105,14 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/parsetools/src/Makefile b/lib/parsetools/src/Makefile
index 89e079e411..4f199da8ee 100644
--- a/lib/parsetools/src/Makefile
+++ b/lib/parsetools/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -89,12 +89,12 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/parsetools/test/Makefile b/lib/parsetools/test/Makefile
index 624c4e6975..6455f6ade7 100644
--- a/lib/parsetools/test/Makefile
+++ b/lib/parsetools/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2011. All Rights Reserved.
+# Copyright Ericsson AB 2005-2012. 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
@@ -70,9 +70,9 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) parsetools.spec parsetools.cover $(EMAKEFILE) $(ERL_FILES) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- # @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) parsetools.spec parsetools.cover $(EMAKEFILE) $(ERL_FILES) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ # @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/percept/doc/src/Makefile b/lib/percept/doc/src/Makefile
index f0d43c5a01..3182dc2954 100644
--- a/lib/percept/doc/src/Makefile
+++ b/lib/percept/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2010. All Rights Reserved.
+# Copyright Ericsson AB 2007-2012. 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
@@ -175,15 +175,15 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTML_EXAMPLE_FILES) $(HTML_STYLESHEET_FILES) \
$(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/percept/priv/Makefile b/lib/percept/priv/Makefile
index 7c37ccd98b..b82b51ed4b 100644
--- a/lib/percept/priv/Makefile
+++ b/lib/percept/priv/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2009. All Rights Reserved.
+# Copyright Ericsson AB 2007-2012. 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
@@ -77,20 +77,20 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
# Finished
- $(INSTALL_DIR) $(RELSYSDIR)/priv/logs
- $(INSTALL_DIR) $(RELSYSDIR)/priv/server_root
- $(INSTALL_DIR) $(RELSYSDIR)/priv/server_root/htdocs
- $(INSTALL_DATA) $(HTDOCS_FILES) $(RELSYSDIR)/priv/server_root/htdocs
- $(INSTALL_DIR) $(RELSYSDIR)/priv/server_root/conf
- $(INSTALL_DATA) $(CONF_FILES) $(RELSYSDIR)/priv/server_root/conf
- $(INSTALL_DIR) $(RELSYSDIR)/priv/server_root/scripts
- $(INSTALL_DATA) $(SCRIPT_FILES) $(RELSYSDIR)/priv/server_root/scripts
- $(INSTALL_DIR) $(RELSYSDIR)/priv/server_root/css
- $(INSTALL_DATA) $(CSS_FILES) $(RELSYSDIR)/priv/server_root/css
- $(INSTALL_DIR) $(RELSYSDIR)/priv/server_root/images
- $(INSTALL_DATA) $(IMAGE_FILES) $(RELSYSDIR)/priv/server_root/images
- $(INSTALL_DIR) $(RELSYSDIR)/priv/fonts
- $(INSTALL_DATA) $(FONT_FILES) $(RELSYSDIR)/priv/fonts
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/logs"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/server_root"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/server_root/htdocs"
+ $(INSTALL_DATA) $(HTDOCS_FILES) "$(RELSYSDIR)/priv/server_root/htdocs"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/server_root/conf"
+ $(INSTALL_DATA) $(CONF_FILES) "$(RELSYSDIR)/priv/server_root/conf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/server_root/scripts"
+ $(INSTALL_DATA) $(SCRIPT_FILES) "$(RELSYSDIR)/priv/server_root/scripts"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/server_root/css"
+ $(INSTALL_DATA) $(CSS_FILES) "$(RELSYSDIR)/priv/server_root/css"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/server_root/images"
+ $(INSTALL_DATA) $(IMAGE_FILES) "$(RELSYSDIR)/priv/server_root/images"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/fonts"
+ $(INSTALL_DATA) $(FONT_FILES) "$(RELSYSDIR)/priv/fonts"
release_docs_spec:
diff --git a/lib/percept/src/Makefile b/lib/percept/src/Makefile
index 5dfc72575a..253a8c2da3 100644
--- a/lib/percept/src/Makefile
+++ b/lib/percept/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2009. All Rights Reserved.
+# Copyright Ericsson AB 2007-2012. 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
@@ -93,12 +93,12 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src
-# $(INSTALL_DIR) $(RELSYSDIR)/include
-# $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
+# $(INSTALL_DIR) "$(RELSYSDIR)/include"
+# $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/percept/src/percept.app.src b/lib/percept/src/percept.app.src
index c70fede721..7b20093ece 100644
--- a/lib/percept/src/percept.app.src
+++ b/lib/percept/src/percept.app.src
@@ -17,14 +17,26 @@
%% %CopyrightEnd%
%%
-{application,percept,
- [{description, "PERCEPT Erlang Concurrency Profiling Tool"},
- {vsn, "%VSN%"},
- {modules, [percept,percept_db,percept_html,percept_graph,percept_analyzer]},
- {registered, [percept_db,percept_port]},
- {applications, [kernel,stdlib]},
- {env, []}
- ]}.
-
+{application,percept, [
+ {description, "PERCEPT Erlang Concurrency Profiling Tool"},
+ {vsn, "%VSN%"},
+ {modules, [
+ egd,
+ egd_font,
+ egd_png,
+ egd_primitives,
+ egd_render,
+ percept,
+ percept_analyzer,
+ percept_db,
+ percept_graph,
+ percept_html,
+ percept_image
+ ]},
+ {registered, [percept_db,percept_port]},
+ {applications, [kernel,stdlib]},
+ {env,[]}
+]}.
+%% vim: syntax=erlang
diff --git a/lib/percept/test/Makefile b/lib/percept/test/Makefile
index d927386d1c..156ef5dd0a 100644
--- a/lib/percept/test/Makefile
+++ b/lib/percept/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2007-2011. All Rights Reserved.
+# Copyright Ericsson AB 2007-2012. 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
@@ -81,10 +81,10 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) percept.spec percept.cover $(EMAKEFILE) $(SOURCE) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) percept.spec percept.cover $(EMAKEFILE) $(SOURCE) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/pman/doc/src/Makefile b/lib/pman/doc/src/Makefile
index 4e116cb23e..d9e0317f05 100644
--- a/lib/pman/doc/src/Makefile
+++ b/lib/pman/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -103,14 +103,14 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/pman/doc/src/notes.xml b/lib/pman/doc/src/notes.xml
index 407a10a50a..778f960004 100644
--- a/lib/pman/doc/src/notes.xml
+++ b/lib/pman/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,6 +30,26 @@
</header>
<p>This document describes the changes made to the Pman application.</p>
+<section><title>Pman 2.7.1.2</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>The GS applications is now deprecated and will be
+ removed in the R16 release. The following GS-based
+ applications have been superseded by the Observer
+ application and will removed in R16: Appmon, Pman,
+ Tv.</p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>
+ Own Id: OTP-9907</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Pman 2.7.1.1</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/pman/doc/src/pman.xml b/lib/pman/doc/src/pman.xml
index 84d5a5772a..48eaf9167c 100644
--- a/lib/pman/doc/src/pman.xml
+++ b/lib/pman/doc/src/pman.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -32,6 +32,12 @@
<module>pman</module>
<modulesummary>A graphical process manager.</modulesummary>
<description>
+ <warning>
+ <p>
+ The Pman application has been superseded by the Observer application.
+ Pman will be removed in R16.
+ </p>
+ </warning>
<p>A graphical tool used to inspect the Erlang processes executing either
locally or on remote nodes. It is also possible to trace events in
the individual processes.</p>
diff --git a/lib/pman/doc/src/pman_chapter.xml b/lib/pman/doc/src/pman_chapter.xml
index 141b488415..ce4adbec45 100644
--- a/lib/pman/doc/src/pman_chapter.xml
+++ b/lib/pman/doc/src/pman_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1996</year><year>2009</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -32,6 +32,12 @@
<section>
<title>Introduction</title>
+ <warning>
+ <p>
+ The Pman application has been superseded by the Observer application.
+ Pman will be removed in R16.
+ </p>
+ </warning>
<p>The process manager Pman is a tool for viewing processes executing
locally or on remote nodes. Its main purpose is to locate
erroneous code by inspecting the state of the processes and by tracing
diff --git a/lib/pman/priv/Makefile b/lib/pman/priv/Makefile
index 43f9d45d94..a89278fd3a 100644
--- a/lib/pman/priv/Makefile
+++ b/lib/pman/priv/Makefile
@@ -50,8 +50,8 @@ clean:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DATA) $(TOOLBAR_FILES) $(RELSYSDIR)/priv
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) $(TOOLBAR_FILES) "$(RELSYSDIR)/priv"
release_docs_spec:
diff --git a/lib/pman/src/Makefile b/lib/pman/src/Makefile
index e573e57220..fa01fe7238 100644
--- a/lib/pman/src/Makefile
+++ b/lib/pman/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -103,10 +103,10 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(TOOLBOX_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(TARGET_TOOLBOX_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(TOOLBOX_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) $(TARGET_TOOLBOX_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/pman/src/pman_buf_converter.erl b/lib/pman/src/pman_buf_converter.erl
index b6f560411c..c8b3fe37aa 100644
--- a/lib/pman/src/pman_buf_converter.erl
+++ b/lib/pman/src/pman_buf_converter.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -29,6 +29,7 @@
%%----------------------------------------------------------------------
-module(pman_buf_converter).
+-compile([{nowarn_deprecated_function,{gs,start,0}}]).
%%-compile(export_all).
-export([init/2]).
diff --git a/lib/pman/src/pman_buf_printer.erl b/lib/pman/src/pman_buf_printer.erl
index 74e935171a..3284c57559 100644
--- a/lib/pman/src/pman_buf_printer.erl
+++ b/lib/pman/src/pman_buf_printer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -18,6 +18,8 @@
%%
-module(pman_buf_printer).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,start,0}}]).
%%-compile(export_all).
-export([init/2]).
diff --git a/lib/pman/src/pman_main.erl b/lib/pman/src/pman_main.erl
index b68da1d2c3..2f51284293 100644
--- a/lib/pman/src/pman_main.erl
+++ b/lib/pman/src/pman_main.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -17,6 +17,8 @@
%% %CopyrightEnd%
%%
-module(pman_main).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,read,2}}]).
%% Main process and window
diff --git a/lib/pman/src/pman_module_info.erl b/lib/pman/src/pman_module_info.erl
index cfd711a6e1..944fd4a462 100644
--- a/lib/pman/src/pman_module_info.erl
+++ b/lib/pman/src/pman_module_info.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -17,6 +17,8 @@
%% %CopyrightEnd%
%%
-module(pman_module_info).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,start,1}}]).
%% Window with module information (View->Module Info...)
diff --git a/lib/pman/src/pman_shell.erl b/lib/pman/src/pman_shell.erl
index 0b13890460..2d2b8ce000 100644
--- a/lib/pman/src/pman_shell.erl
+++ b/lib/pman/src/pman_shell.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -25,6 +25,10 @@
%% ---------------------------------------------------------------
-module(pman_shell).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,start,1}}]).
%% ---------------------------------------------------------------
%% The user interface exports
diff --git a/lib/pman/src/pman_tool.erl b/lib/pman/src/pman_tool.erl
index 1d33fb9764..36382745af 100644
--- a/lib/pman/src/pman_tool.erl
+++ b/lib/pman/src/pman_tool.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -17,6 +17,7 @@
%% %CopyrightEnd%
%%
-module(pman_tool).
+-compile([{nowarn_deprecated_function,{gs,read,2}}]).
%% Listbox selection window
diff --git a/lib/pman/src/pman_win.erl b/lib/pman/src/pman_win.erl
index 52d5a237cf..350bc2dd7f 100644
--- a/lib/pman/src/pman_win.erl
+++ b/lib/pman/src/pman_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -21,6 +21,16 @@
%% ------------------------------------------------------------
-module(pman_win).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,canvas,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,create,4}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,1}},
+ {nowarn_deprecated_function,{gs,text,2}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
%% ---------------------------------------------------------------
%% The user interface exports
diff --git a/lib/pman/vsn.mk b/lib/pman/vsn.mk
index a62a9d7c89..13dce1a7a5 100644
--- a/lib/pman/vsn.mk
+++ b/lib/pman/vsn.mk
@@ -1 +1 @@
-PMAN_VSN = 2.7.1.1
+PMAN_VSN = 2.7.1.2
diff --git a/lib/public_key/asn1/Makefile b/lib/public_key/asn1/Makefile
index 943d97bdb8..4bd043ee5d 100644
--- a/lib/public_key/asn1/Makefile
+++ b/lib/public_key/asn1/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2011. All Rights Reserved.
+# Copyright Ericsson AB 2008-2012. 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
@@ -91,13 +91,13 @@ $(INCLUDE)/%.hrl: %.hrl
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/asn1
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/asn1"
$(INSTALL_DATA) $(ASN_ASNS) $(ASN_ERLS) $(ASN_HRLS) $(ASN_CONFIGS) \
- $(GEN_ERLS) $(RELSYSDIR)/asn1
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(GEN_ERLS) "$(RELSYSDIR)/asn1"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/public_key/asn1/OTP-PKIX.asn1 b/lib/public_key/asn1/OTP-PKIX.asn1
index fbf531df40..4f20208bce 100644
--- a/lib/public_key/asn1/OTP-PKIX.asn1
+++ b/lib/public_key/asn1/OTP-PKIX.asn1
@@ -119,6 +119,7 @@ IMPORTS
md2WithRSAEncryption,
md5WithRSAEncryption,
sha1WithRSAEncryption,
+ sha224WithRSAEncryption,
sha256WithRSAEncryption,
sha384WithRSAEncryption,
sha512WithRSAEncryption
@@ -225,7 +226,17 @@ dnQualifier ATTRIBUTE-TYPE-AND-VALUE-CLASS ::= {
countryName ATTRIBUTE-TYPE-AND-VALUE-CLASS ::= {
ID id-at-countryName
- TYPE X520countryName }
+ TYPE X520countryName } -- this is currently not used when decoding
+ -- The decoding and mapping between ID and Type is done in the code
+ -- in module publickey_cert_records via the function attribute_type
+ -- To be more forgiving and compatible with other SSL implementations
+ -- regarding how to handle and sometimes accept incorrect certificates
+ -- we define and use the type below instead of X520countryName
+
+ OTP-X520countryname ::= CHOICE {
+ printableString PrintableString (SIZE (2)),
+ utf8String UTF8String (SIZE (2))
+}
serialNumber ATTRIBUTE-TYPE-AND-VALUE-CLASS ::= {
ID id-at-serialNumber
@@ -307,6 +318,7 @@ PublicKeyAlgorithm ::= SEQUENCE {
SupportedSignatureAlgorithms SIGNATURE-ALGORITHM-CLASS ::= {
dsa-with-sha1 | md2-with-rsa-encryption |
md5-with-rsa-encryption | sha1-with-rsa-encryption |
+ sha224-with-rsa-encryption |
sha256-with-rsa-encryption |
sha384-with-rsa-encryption |
sha512-with-rsa-encryption |
@@ -355,6 +367,10 @@ SupportedPublicKeyAlgorithms PUBLIC-KEY-ALGORITHM-CLASS ::= {
ID sha1WithRSAEncryption
TYPE NULL }
+ sha224-with-rsa-encryption SIGNATURE-ALGORITHM-CLASS ::= {
+ ID sha224WithRSAEncryption
+ TYPE NULL }
+
sha256-with-rsa-encryption SIGNATURE-ALGORITHM-CLASS ::= {
ID sha256WithRSAEncryption
TYPE NULL }
diff --git a/lib/public_key/asn1/PKCS-1.asn1 b/lib/public_key/asn1/PKCS-1.asn1
index b06f5efa9d..c83289e779 100644
--- a/lib/public_key/asn1/PKCS-1.asn1
+++ b/lib/public_key/asn1/PKCS-1.asn1
@@ -33,6 +33,9 @@ sha1WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 5 }
sha256WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 11 }
sha384WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 12 }
sha512WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 13 }
+sha224WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 14 }
+
+
id-sha1 OBJECT IDENTIFIER ::= {
iso(1) identified-organization(3) oiw(14) secsig(3)
diff --git a/lib/public_key/doc/src/Makefile b/lib/public_key/doc/src/Makefile
index 9616a96195..17fb67e95c 100644
--- a/lib/public_key/doc/src/Makefile
+++ b/lib/public_key/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2011. All Rights Reserved.
+# Copyright Ericsson AB 2008-2012. 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
@@ -114,14 +114,14 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
info:
diff --git a/lib/public_key/doc/src/notes.xml b/lib/public_key/doc/src/notes.xml
index c9a5561e3f..d895042570 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>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -34,6 +34,60 @@
<file>notes.xml</file>
</header>
+<section><title>Public_Key 0.16</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Add crypto and public_key support for the hash functions
+ SHA224, SHA256, SHA384 and SHA512 and also hmac and
+ rsa_sign/verify support using these hash functions.
+ Thanks to Andreas Schultz for making a prototype.</p>
+ <p>
+ Own Id: OTP-9908</p>
+ </item>
+ <item>
+ <p>
+ Optimize RSA private key handling in <c>crypto</c> and
+ <c>public_key</c>.</p>
+ <p>
+ Own Id: OTP-10065</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Public_Key 0.15</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Changed ssh implementation to use the public_key
+ application for all public key handling. This is also a
+ first step for enabling a callback API for supplying
+ public keys and handling keys protected with password
+ phrases. </p>
+ <p>
+ Additionally the test suites where improved so that they
+ do not copy the users keys to test server directories as
+ this is a security liability. Also ipv6 and file access
+ issues found in the process has been fixed.</p>
+ <p>
+ This change also solves OTP-7677 and OTP-7235</p>
+ <p>
+ This changes also involves some updates to public_keys
+ ssh-functions.</p>
+ <p>
+ Own Id: OTP-9911</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Public_Key 0.14</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/public_key/doc/src/public_key.xml b/lib/public_key/doc/src/public_key.xml
index 0b6673e826..5c227557f2 100644
--- a/lib/public_key/doc/src/public_key.xml
+++ b/lib/public_key/doc/src/public_key.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2008</year>
- <year>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -82,9 +82,9 @@
<p><code> rsa_padding() = 'rsa_pkcs1_padding' | 'rsa_pkcs1_oaep_padding'
| 'rsa_no_padding'</code></p>
- <p><code> rsa_digest_type() = 'md5' | 'sha' </code></p>
+ <p><code> rsa_digest_type() = 'md5' | 'sha' | 'sha224' | 'sha256' | 'sha384' | 'sha512' </code></p>
- <p><code> dss_digest_type() = 'none' | 'sha' </code></p>
+ <p><code> dss_digest_type() = 'sha' </code></p>
<p><code> ssh_file() = openssh_public_key | rfc4716_public_key |
known_hosts | auth_keys </code></p>
@@ -396,14 +396,14 @@
<name>sign(Msg, DigestType, Key) -> binary()</name>
<fsummary> Create digital signature.</fsummary>
<type>
- <v>Msg = binary()</v>
+ <v>Msg = binary() | {digest,binary()}</v>
<d>The msg is either the binary "plain text" data to be
- signed or in the case that digest type is <c>none</c>
- it is the hashed value of "plain text" i.e. the digest.</d>
- <v>DigestType = rsa_digest_type() | dsa_digest_type()</v>
+ signed or it is the hashed value of "plain text" i.e. the
+ digest.</d>
+ <v>DigestType = rsa_digest_type() | dss_digest_type()</v>
<v>Key = rsa_private_key() | dsa_private_key()</v>
- </type>
- <desc>
+ </type>
+ <desc>
<p> Creates a digital signature.</p>
</desc>
</func>
@@ -461,11 +461,10 @@
<name>verify(Msg, DigestType, Signature, Key) -> boolean()</name>
<fsummary>Verifies a digital signature.</fsummary>
<type>
- <v>Msg = binary()</v>
+ <v>Msg = binary() | {digest,binary()}</v>
<d>The msg is either the binary "plain text" data
- or in the case that digest type is <c>none</c>
- it is the hashed value of "plain text" i.e. the digest.</d>
- <v>DigestType = rsa_digest_type() | dsa_digest_type()</v>
+ or it is the hashed value of "plain text" i.e. the digest.</d>
+ <v>DigestType = rsa_digest_type() | dss_digest_type()</v>
<v>Signature = binary()</v>
<v>Key = rsa_public_key() | dsa_public_key()</v>
</type>
diff --git a/lib/public_key/src/Makefile b/lib/public_key/src/Makefile
index 062c495a65..d5cd13d81a 100644
--- a/lib/public_key/src/Makefile
+++ b/lib/public_key/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2011. All Rights Reserved.
+# Copyright Ericsson AB 2008-2012. 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
@@ -102,11 +102,11 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/public_key/src/pubkey_cert.erl b/lib/public_key/src/pubkey_cert.erl
index b76e32a2a0..f9e2025479 100644
--- a/lib/public_key/src/pubkey_cert.erl
+++ b/lib/public_key/src/pubkey_cert.erl
@@ -376,8 +376,12 @@ encoded_tbs_cert(Cert) ->
digest_type(?sha1WithRSAEncryption) ->
sha;
+digest_type(?sha224WithRSAEncryption) ->
+ sha224;
digest_type(?sha256WithRSAEncryption) ->
sha256;
+digest_type(?sha384WithRSAEncryption) ->
+ sha384;
digest_type(?sha512WithRSAEncryption) ->
sha512;
digest_type(?md5WithRSAEncryption) ->
diff --git a/lib/public_key/src/pubkey_cert_records.erl b/lib/public_key/src/pubkey_cert_records.erl
index b86d7a1f0c..33fe940ea2 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -57,6 +57,15 @@ transform(#'OTPTBSCertificate'{}= TBS, decode) ->
transform(#'AttributeTypeAndValue'{type=Id,value=Value0} = ATAV, Func) ->
{ok, Value} =
case attribute_type(Id) of
+ 'X520countryName'when Func == decode ->
+ %% Workaround that some certificates break the ASN-1 spec
+ %% and encode countryname as utf8
+ case 'OTP-PUB-KEY':Func('OTP-X520countryname', Value0) of
+ {ok, {utf8String, Utf8Value}} ->
+ {ok, unicode:characters_to_list(Utf8Value)};
+ {ok, {printableString, ASCCI}} ->
+ {ok, ASCCI}
+ end;
Type when is_atom(Type) -> 'OTP-PUB-KEY':Func(Type, Value0);
_UnknownType -> {ok, Value0}
end,
diff --git a/lib/public_key/src/pubkey_ssh.erl b/lib/public_key/src/pubkey_ssh.erl
index f342eab159..008ea96dd3 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -47,7 +47,7 @@ decode(Bin, public_key)->
rfc4716_decode(Bin)
end;
decode(Bin, rfc4716_public_key) ->
- rfc4716_decode(Bin);
+ rfc4716_decode(Bin);
decode(Bin, Type) ->
openssh_decode(Bin, Type).
@@ -58,7 +58,7 @@ decode(Bin, Type) ->
%% Description: Encodes a list of ssh file entries.
%%--------------------------------------------------------------------
encode(Entries, Type) ->
- erlang:iolist_to_binary(lists:map(fun({Key, Attributes}) ->
+ iolist_to_binary(lists:map(fun({Key, Attributes}) ->
do_encode(Type, Key, Attributes)
end, Entries)).
@@ -106,7 +106,7 @@ rfc4716_decode_line(Line, Lines, Acc) ->
_ ->
{Body, Rest} = join_entry([Line | Lines], []),
{lists:reverse(Acc), rfc4716_pubkey_decode(base64:mime_decode(Body)), Rest}
- end.
+ end.
join_entry([<<"---- END SSH2 PUBLIC KEY ----", _/binary>>| Lines], Entry) ->
{lists:reverse(Entry), Lines};
@@ -115,16 +115,16 @@ join_entry([Line | Lines], Entry) ->
rfc4716_pubkey_decode(<<?UINT32(Len), Type:Len/binary,
- ?UINT32(SizeE), E:SizeE/binary,
- ?UINT32(SizeN), N:SizeN/binary>>) when Type == <<"ssh-rsa">> ->
+ ?UINT32(SizeE), E:SizeE/binary,
+ ?UINT32(SizeN), N:SizeN/binary>>) when Type == <<"ssh-rsa">> ->
#'RSAPublicKey'{modulus = erlint(SizeN, N),
publicExponent = erlint(SizeE, E)};
rfc4716_pubkey_decode(<<?UINT32(Len), Type:Len/binary,
- ?UINT32(SizeP), P:SizeP/binary,
- ?UINT32(SizeQ), Q:SizeQ/binary,
- ?UINT32(SizeG), G:SizeG/binary,
- ?UINT32(SizeY), Y:SizeY/binary>>) when Type == <<"ssh-dss">> ->
+ ?UINT32(SizeP), P:SizeP/binary,
+ ?UINT32(SizeQ), Q:SizeQ/binary,
+ ?UINT32(SizeG), G:SizeG/binary,
+ ?UINT32(SizeY), Y:SizeY/binary>>) when Type == <<"ssh-dss">> ->
{erlint(SizeY, Y),
#'Dss-Parms'{p = erlint(SizeP, P),
q = erlint(SizeQ, Q),
@@ -143,75 +143,63 @@ do_openssh_decode(FileType, [<<>> | Lines], Acc) ->
do_openssh_decode(FileType,[<<"#", _/binary>> | Lines], Acc) ->
do_openssh_decode(FileType, Lines, Acc);
do_openssh_decode(auth_keys = FileType, [Line | Lines], Acc) ->
- Split = binary:split(Line, <<" ">>, [global]),
- case mend_split(Split, []) of
- %% ssh2
- [Options, KeyType, Base64Enc, Comment] when KeyType == <<"ssh-rsa">>;
- KeyType == <<"ssh-dss">> ->
+ case decode_auth_keys(Line) of
+ {ssh2, {options, [Options, KeyType, Base64Enc| Comment]}} ->
do_openssh_decode(FileType, Lines,
- [{openssh_pubkey_decode(KeyType, Base64Enc),
- [{comment, string_decode(Comment)},
- {options, comma_list_decode(Options)}]}
- | Acc]);
-
- [KeyType, Base64Enc, Comment] when KeyType == <<"ssh-rsa">>;
- KeyType == <<"ssh-dss">> ->
+ [{openssh_pubkey_decode(KeyType, Base64Enc),
+ decode_comment(Comment) ++ [{options, comma_list_decode(Options)}]} | Acc]);
+ {ssh2, {no_options, [KeyType, Base64Enc| Comment]}} ->
do_openssh_decode(FileType, Lines,
- [{openssh_pubkey_decode(KeyType, Base64Enc),
- [{comment, string_decode(Comment)}]} | Acc]);
- %% ssh1
- [Options, Bits, Exponent, Modulus, Comment] ->
+ [{openssh_pubkey_decode(KeyType, Base64Enc),
+ decode_comment(Comment)} | Acc]);
+ {ssh1, {options, [Options, Bits, Exponent, Modulus | Comment]}} ->
do_openssh_decode(FileType, Lines,
[{ssh1_rsa_pubkey_decode(Modulus, Exponent),
- [{comment, string_decode(Comment)},
- {options, comma_list_decode(Options)},
- {bits, integer_decode(Bits)}]} | Acc]);
- [Bits, Exponent, Modulus, Comment] ->
+ decode_comment(Comment) ++ [{options, comma_list_decode(Options)},
+ {bits, integer_decode(Bits)}]
+ } | Acc]);
+ {ssh1, {no_options, [Bits, Exponent, Modulus | Comment]}} ->
do_openssh_decode(FileType, Lines,
[{ssh1_rsa_pubkey_decode(Modulus, Exponent),
- [{comment, string_decode(Comment)},
- {bits, integer_decode(Bits)}]} | Acc])
- end;
+ decode_comment(Comment) ++ [{bits, integer_decode(Bits)}]
+ } | Acc])
+ end;
do_openssh_decode(known_hosts = FileType, [Line | Lines], Acc) ->
- case binary:split(Line, <<" ">>, [global]) of
- %% ssh 2
- [HostNames, KeyType, Base64Enc] when KeyType == <<"ssh-rsa">>;
- KeyType == <<"ssh-dss">> ->
+ case decode_known_hosts(Line) of
+ {ssh2, [HostNames, KeyType, Base64Enc| Comment]} ->
do_openssh_decode(FileType, Lines,
- [{openssh_pubkey_decode(KeyType, Base64Enc),
- [{hostnames, comma_list_decode(HostNames)}]}| Acc]);
- [HostNames, KeyType, Base64Enc, Comment] when KeyType == <<"ssh-rsa">>;
- KeyType == <<"ssh-dss">> ->
+ [{openssh_pubkey_decode(KeyType, Base64Enc),
+ decode_comment(Comment) ++
+ [{hostnames, comma_list_decode(HostNames)}]}| Acc]);
+ {ssh1, [HostNames, Bits, Exponent, Modulus | Comment]} ->
do_openssh_decode(FileType, Lines,
- [{openssh_pubkey_decode(KeyType, Base64Enc),
- [{comment, string_decode(Comment)},
- {hostnames, comma_list_decode(HostNames)}]} | Acc]);
- %% ssh 1
- [HostNames, Bits, Exponent, Modulus, Comment] ->
- do_openssh_decode(FileType, Lines,
- [{ssh1_rsa_pubkey_decode(Modulus, Exponent),
- [{comment, string_decode(Comment)},
- {hostnames, comma_list_decode(HostNames)},
- {bits, integer_decode(Bits)}]} | Acc]);
- [HostNames, Bits, Exponent, Modulus] ->
- do_openssh_decode(FileType, Lines,
- [{ssh1_rsa_pubkey_decode(Modulus, Exponent),
- [{comment, []},
- {hostnames, comma_list_decode(HostNames)},
- {bits, integer_decode(Bits)}]} | Acc])
- end;
+ [{ssh1_rsa_pubkey_decode(Modulus, Exponent),
+ decode_comment(Comment) ++
+ [{hostnames, comma_list_decode(HostNames)},
+ {bits, integer_decode(Bits)}]}
+ | Acc])
+ end;
do_openssh_decode(openssh_public_key = FileType, [Line | Lines], Acc) ->
- case binary:split(Line, <<" ">>, [global]) of
- [KeyType, Base64Enc, Comment0] when KeyType == <<"ssh-rsa">>;
- KeyType == <<"ssh-dss">> ->
- Comment = string:strip(binary_to_list(Comment0), right, $\n),
+ case split_n(2, Line, []) of
+ [KeyType, Base64Enc] when KeyType == <<"ssh-rsa">>;
+ KeyType == <<"ssh-dss">> ->
+ do_openssh_decode(FileType, Lines,
+ [{openssh_pubkey_decode(KeyType, Base64Enc),
+ []} | Acc]);
+ [KeyType, Base64Enc | Comment0] when KeyType == <<"ssh-rsa">>;
+ KeyType == <<"ssh-dss">> ->
+ Comment = string:strip(string_decode(iolist_to_binary(Comment0)), right, $\n),
do_openssh_decode(FileType, Lines,
[{openssh_pubkey_decode(KeyType, Base64Enc),
[{comment, Comment}]} | Acc])
end.
+decode_comment([]) ->
+ [];
+decode_comment(Comment) ->
+ [{comment, string_decode(iolist_to_binary(Comment))}].
openssh_pubkey_decode(<<"ssh-rsa">>, Base64Enc) ->
<<?UINT32(StrLen), _:StrLen/binary,
@@ -231,7 +219,9 @@ openssh_pubkey_decode(<<"ssh-dss">>, Base64Enc) ->
{erlint(SizeY, Y),
#'Dss-Parms'{p = erlint(SizeP, P),
q = erlint(SizeQ, Q),
- g = erlint(SizeG, G)}}.
+ g = erlint(SizeG, G)}};
+openssh_pubkey_decode(KeyType, Base64Enc) ->
+ {KeyType, base64:mime_decode(Base64Enc)}.
erlint(MPIntSize, MPIntValue) ->
Bits= MPIntSize * 8,
@@ -246,7 +236,7 @@ integer_decode(BinStr) ->
list_to_integer(binary_to_list(BinStr)).
string_decode(BinStr) ->
- binary_to_list(BinStr).
+ unicode_decode(BinStr).
unicode_decode(BinStr) ->
unicode:characters_to_list(BinStr).
@@ -264,11 +254,11 @@ do_encode(Type, Key, Attributes) ->
openssh_encode(Type, Key, Attributes).
rfc4716_encode(Key, [],[]) ->
- erlang:iolist_to_binary([begin_marker(),"\n",
+ iolist_to_binary([begin_marker(),"\n",
split_lines(base64:encode(ssh2_pubkey_encode(Key))),
"\n", end_marker(), "\n"]);
rfc4716_encode(Key, [], [_|_] = Acc) ->
- erlang:iolist_to_binary([begin_marker(), "\n",
+ iolist_to_binary([begin_marker(), "\n",
lists:reverse(Acc),
split_lines(base64:encode(ssh2_pubkey_encode(Key))),
"\n", end_marker(), "\n"]);
@@ -298,9 +288,9 @@ rfc4716_encode_value(Value) ->
end.
openssh_encode(openssh_public_key, Key, Attributes) ->
- Comment = proplists:get_value(comment, Attributes),
+ Comment = proplists:get_value(comment, Attributes, ""),
Enc = base64:encode(ssh2_pubkey_encode(Key)),
- erlang:iolist_to_binary([key_type(Key), " ", Enc, " ", Comment, "\n"]);
+ iolist_to_binary([key_type(Key), " ", Enc, " ", Comment, "\n"]);
openssh_encode(auth_keys, Key, Attributes) ->
Comment = proplists:get_value(comment, Attributes, ""),
@@ -324,30 +314,30 @@ openssh_encode(known_hosts, Key, Attributes) ->
end.
openssh_ssh2_auth_keys_encode(undefined, Key, Comment) ->
- erlang:iolist_to_binary([key_type(Key)," ", base64:encode(ssh2_pubkey_encode(Key)), line_end(Comment)]);
+ iolist_to_binary([key_type(Key)," ", base64:encode(ssh2_pubkey_encode(Key)), line_end(Comment)]);
openssh_ssh2_auth_keys_encode(Options, Key, Comment) ->
- erlang:iolist_to_binary([comma_list_encode(Options, []), " ",
+ iolist_to_binary([comma_list_encode(Options, []), " ",
key_type(Key)," ", base64:encode(ssh2_pubkey_encode(Key)), line_end(Comment)]).
openssh_ssh1_auth_keys_encode(undefined, Bits,
#'RSAPublicKey'{modulus = N, publicExponent = E},
Comment) ->
- erlang:iolist_to_binary([integer_to_list(Bits), " ", integer_to_list(E), " ", integer_to_list(N),
+ iolist_to_binary([integer_to_list(Bits), " ", integer_to_list(E), " ", integer_to_list(N),
line_end(Comment)]);
openssh_ssh1_auth_keys_encode(Options, Bits,
#'RSAPublicKey'{modulus = N, publicExponent = E},
Comment) ->
- erlang:iolist_to_binary([comma_list_encode(Options, []), " ", integer_to_list(Bits),
+ iolist_to_binary([comma_list_encode(Options, []), " ", integer_to_list(Bits),
" ", integer_to_list(E), " ", integer_to_list(N), line_end(Comment)]).
openssh_ssh2_know_hosts_encode(Hostnames, Key, Comment) ->
- erlang:iolist_to_binary([comma_list_encode(Hostnames, []), " ",
+ iolist_to_binary([comma_list_encode(Hostnames, []), " ",
key_type(Key)," ", base64:encode(ssh2_pubkey_encode(Key)), line_end(Comment)]).
openssh_ssh1_known_hosts_encode(Hostnames, Bits,
- #'RSAPublicKey'{modulus = N, publicExponent = E},
- Comment) ->
- erlang:iolist_to_binary([comma_list_encode(Hostnames, [])," ", integer_to_list(Bits)," ",
+ #'RSAPublicKey'{modulus = N, publicExponent = E},
+ Comment) ->
+ iolist_to_binary([comma_list_encode(Hostnames, [])," ", integer_to_list(Bits)," ",
integer_to_list(E)," ", integer_to_list(N), line_end(Comment)]).
line_end("") ->
@@ -390,28 +380,16 @@ ssh2_pubkey_encode({Y, #'Dss-Parms'{p = P, q = Q, g = G}}) ->
GBin/binary,
YBin/binary>>.
-mend_split([Part1, Part2 | Rest] = List, Acc) ->
- case option_end(Part1, Part2) of
- true ->
- lists:reverse(Acc) ++ List;
- false ->
- case length(binary:matches(Part1, <<"\"">>)) of
- N when N rem 2 == 0 ->
- mend_split(Rest, [Part1 | Acc]);
- _ ->
- mend_split([<<Part1/binary, Part2/binary>> | Rest], Acc)
- end
- end.
-
-option_end(Part1, Part2) ->
- (is_key_field(Part1) orelse is_bits_field(Part1))
- orelse
- (is_key_field(Part2) orelse is_bits_field(Part2)).
-
is_key_field(<<"ssh-dss">>) ->
true;
is_key_field(<<"ssh-rsa">>) ->
true;
+is_key_field(<<"ecdsa-sha2-nistp256">>) ->
+ true;
+is_key_field(<<"ecdsa-sha2-nistp384">>) ->
+ true;
+is_key_field(<<"ecdsa-sha2-nistp521">>) ->
+ true;
is_key_field(_) ->
false.
@@ -429,3 +407,72 @@ split_lines(<<Text:?ENCODED_LINE_LENGTH/binary, Rest/binary>>) ->
[Text, $\n | split_lines(Rest)];
split_lines(Bin) ->
[Bin].
+
+decode_auth_keys(Line) ->
+ [First, Rest] = binary:split(Line, <<" ">>, []),
+ case is_key_field(First) of
+ true ->
+ {ssh2, decode_auth_keys_ssh2(First, Rest)};
+ false ->
+ case is_bits_field(First) of
+ true ->
+ {ssh1, decode_auth_keys_ssh1(First, Rest)};
+ false ->
+ decode_auth_keys(First, Rest)
+ end
+ end.
+
+decode_auth_keys(First, Line) ->
+ [Second, Rest] = binary:split(Line, <<" ">>, []),
+ case is_key_field(Second) of
+ true ->
+ {ssh2, decode_auth_keys_ssh2(First, Second, Rest)};
+ false ->
+ case is_bits_field(Second) of
+ true ->
+ {ssh1, decode_auth_keys_ssh1(First, Second, Rest)};
+ false ->
+ decode_auth_keys(<<First/binary, Second/binary>>, Rest)
+ end
+ end.
+
+decode_auth_keys_ssh2(KeyType, Rest) ->
+ {no_options, [KeyType | split_n(1, Rest, [])]}.
+
+decode_auth_keys_ssh2(Options, Next, Rest) ->
+ {options, [Options, Next | split_n(1, Rest, [])]}.
+
+decode_auth_keys_ssh1(Options, Next, Rest) ->
+ {options, [Options, Next | split_n(2, Rest, [])]}.
+
+decode_auth_keys_ssh1(First, Rest) ->
+ {no_options, [First | split_n(2, Rest, [])]}.
+
+decode_known_hosts(Line) ->
+ [First, Rest] = binary:split(Line, <<" ">>, []),
+ [Second, Rest1] = binary:split(Rest, <<" ">>, []),
+
+ case is_bits_field(Second) of
+ true ->
+ {ssh1, decode_known_hosts_ssh1(First, Second, Rest1)};
+ false ->
+ {ssh2, decode_known_hosts_ssh2(First, Second, Rest1)}
+ end.
+
+decode_known_hosts_ssh1(Hostnames, Bits, Rest) ->
+ [Hostnames, Bits | split_n(2, Rest, [])].
+
+decode_known_hosts_ssh2(Hostnames, KeyType, Rest) ->
+ [Hostnames, KeyType | split_n(1, Rest, [])].
+
+split_n(0, <<>>, Acc) ->
+ lists:reverse(Acc);
+split_n(0, Bin, Acc) ->
+ lists:reverse([Bin | Acc]);
+split_n(N, Bin, Acc) ->
+ case binary:split(Bin, <<" ">>, []) of
+ [First, Rest] ->
+ split_n(N-1, Rest, [First | Acc]);
+ [Last] ->
+ split_n(0, <<>>, [Last | Acc])
+ end.
diff --git a/lib/public_key/src/public_key.appup.src b/lib/public_key/src/public_key.appup.src
index 2945fb1213..aacd3b866d 100644
--- a/lib/public_key/src/public_key.appup.src
+++ b/lib/public_key/src/public_key.appup.src
@@ -1,16 +1,8 @@
%% -*- erlang -*-
{"%VSN%",
[
- {"0.13", [{restart_application, public_key}]},
- {"0.11", [{restart_application, public_key}]},
- {"0.10", [{restart_application, public_key}]},
- {"0.9", [{restart_application, public_key}]},
- {"0.8", [{restart_application, public_key}]}
+ {<<"0\\.*">>, [{restart_application, public_key}]}
],
[
- {"0.13", [{restart_application, public_key}]},
- {"0.11", [{restart_application, public_key}]},
- {"0.10", [{restart_application, public_key}]},
- {"0.9", [{restart_application, public_key}]},
- {"0.8", [{restart_application, public_key}]}
+ {<<"0\\.*">>, [{restart_application, public_key}]}
]}.
diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl
index 2e2a6cd296..d5df53e848 100644
--- a/lib/public_key/src/public_key.erl
+++ b/lib/public_key/src/public_key.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -48,8 +48,8 @@
-type rsa_padding() :: 'rsa_pkcs1_padding' | 'rsa_pkcs1_oaep_padding'
| 'rsa_no_padding'.
-type public_crypt_options() :: [{rsa_pad, rsa_padding()}].
--type rsa_digest_type() :: 'md5' | 'sha'| 'sha256' | 'sha512'.
--type dss_digest_type() :: 'none' | 'sha'.
+-type rsa_digest_type() :: 'md5' | 'sha'| 'sha224' | 'sha256' | 'sha384' | 'sha512'.
+-type dss_digest_type() :: 'none' | 'sha'. %% None is for backwards compatibility
-define(UINT32(X), X:32/unsigned-big-integer).
-define(DER_NULL, <<5, 0>>).
@@ -241,15 +241,15 @@ pkix_encode(Asn1Type, Term0, otp) when is_atom(Asn1Type) ->
decrypt_private(CipherText, Key) ->
decrypt_private(CipherText, Key, []).
-decrypt_private(CipherText,
- #'RSAPrivateKey'{modulus = N,publicExponent = E,
- privateExponent = D},
- Options) when is_binary(CipherText),
- is_list(Options) ->
+decrypt_private(CipherText,
+ #'RSAPrivateKey'{modulus = N, publicExponent = E,
+ privateExponent = D} = Key,
+ Options)
+ when is_binary(CipherText),
+ is_integer(N), is_integer(E), is_integer(D),
+ is_list(Options) ->
Padding = proplists:get_value(rsa_pad, Options, rsa_pkcs1_padding),
- crypto:rsa_private_decrypt(CipherText,
- [crypto:mpint(E), crypto:mpint(N),
- crypto:mpint(D)], Padding).
+ crypto:rsa_private_decrypt(CipherText, format_rsa_private_key(Key), Padding).
%%--------------------------------------------------------------------
-spec decrypt_public(CipherText :: binary(), rsa_public_key() | rsa_private_key()) ->
@@ -307,72 +307,86 @@ encrypt_public(PlainText, #'RSAPrivateKey'{modulus=N,publicExponent=E},
encrypt_private(PlainText, Key) ->
encrypt_private(PlainText, Key, []).
-encrypt_private(PlainText, #'RSAPrivateKey'{modulus = N,
- publicExponent = E,
- privateExponent = D},
- Options) when is_binary(PlainText), is_list(Options) ->
+encrypt_private(PlainText,
+ #'RSAPrivateKey'{modulus = N, publicExponent = E,
+ privateExponent = D} = Key,
+ Options)
+ when is_binary(PlainText),
+ is_integer(N), is_integer(E), is_integer(D),
+ is_list(Options) ->
Padding = proplists:get_value(rsa_pad, Options, rsa_pkcs1_padding),
- crypto:rsa_private_encrypt(PlainText, [crypto:mpint(E),
- crypto:mpint(N),
- crypto:mpint(D)], Padding).
+ crypto:rsa_private_encrypt(PlainText, format_rsa_private_key(Key), Padding).
+
+
+format_rsa_private_key(#'RSAPrivateKey'{modulus = N, publicExponent = E,
+ privateExponent = D,
+ prime1 = P1, prime2 = P2,
+ exponent1 = E1, exponent2 = E2,
+ coefficient = C})
+ when is_integer(P1), is_integer(P2),
+ is_integer(E1), is_integer(E2), is_integer(C) ->
+ [crypto:mpint(K) || K <- [E, N, D, P1, P2, E1, E2, C]];
+
+format_rsa_private_key(#'RSAPrivateKey'{modulus = N, publicExponent = E,
+ privateExponent = D}) ->
+ [crypto:mpint(K) || K <- [E, N, D]].
%%--------------------------------------------------------------------
--spec sign(PlainTextOrDigest :: binary(), rsa_digest_type() | dss_digest_type(),
- rsa_private_key() |
+-spec sign(binary() | {digest, binary()}, rsa_digest_type() | dss_digest_type(),
+ rsa_private_key() |
dsa_private_key()) -> Signature :: binary().
-%%
%% Description: Create digital signature.
%%--------------------------------------------------------------------
-sign(PlainText, DigestType, #'RSAPrivateKey'{modulus = N, publicExponent = E,
- privateExponent = D})
- when is_binary(PlainText),
- (DigestType == md5 orelse
- DigestType == sha) ->
-
- crypto:rsa_sign(DigestType, sized_binary(PlainText), [crypto:mpint(E),
- crypto:mpint(N),
- crypto:mpint(D)]);
-
-sign(Digest, none, #'DSAPrivateKey'{p = P, q = Q, g = G, x = X})
- when is_binary(Digest)->
- crypto:dss_sign(none, Digest,
- [crypto:mpint(P), crypto:mpint(Q),
+sign({digest,_}=Digest, DigestType, Key = #'RSAPrivateKey'{}) ->
+ crypto:rsa_sign(DigestType, Digest, format_rsa_private_key(Key));
+
+sign(PlainText, DigestType, Key = #'RSAPrivateKey'{}) ->
+ crypto:rsa_sign(DigestType, sized_binary(PlainText), format_rsa_private_key(Key));
+
+sign({digest,_}=Digest, sha, #'DSAPrivateKey'{p = P, q = Q, g = G, x = X}) ->
+ crypto:dss_sign(Digest,
+ [crypto:mpint(P), crypto:mpint(Q),
crypto:mpint(G), crypto:mpint(X)]);
-
-sign(PlainText, sha, #'DSAPrivateKey'{p = P, q = Q, g = G, x = X})
- when is_binary(PlainText) ->
- crypto:dss_sign(sized_binary(PlainText),
- [crypto:mpint(P), crypto:mpint(Q),
- crypto:mpint(G), crypto:mpint(X)]).
+
+sign(PlainText, sha, #'DSAPrivateKey'{p = P, q = Q, g = G, x = X}) ->
+ crypto:dss_sign(sized_binary(PlainText),
+ [crypto:mpint(P), crypto:mpint(Q),
+ crypto:mpint(G), crypto:mpint(X)]);
+
+%% Backwards compatible
+sign(Digest, none, #'DSAPrivateKey'{} = Key) ->
+ sign({digest,Digest}, sha, Key).
%%--------------------------------------------------------------------
--spec verify(PlainTextOrDigest :: binary(), rsa_digest_type() | dss_digest_type(),
- Signature :: binary(), rsa_public_key()
+-spec verify(binary() | {digest, binary()}, rsa_digest_type() | dss_digest_type(),
+ Signature :: binary(), rsa_public_key()
| dsa_public_key()) -> boolean().
-%%
%% Description: Verifies a digital signature.
%%--------------------------------------------------------------------
-verify(PlainText, DigestType, Signature,
- #'RSAPublicKey'{modulus = Mod, publicExponent = Exp})
- when is_binary (PlainText) and (DigestType == sha orelse
- DigestType == sha256 orelse
- DigestType == sha512 orelse
- DigestType == md5) ->
+verify({digest,_}=Digest, DigestType, Signature,
+ #'RSAPublicKey'{modulus = Mod, publicExponent = Exp}) ->
+ crypto:rsa_verify(DigestType, Digest,
+ sized_binary(Signature),
+ [crypto:mpint(Exp), crypto:mpint(Mod)]);
+
+verify(PlainText, DigestType, Signature,
+ #'RSAPublicKey'{modulus = Mod, publicExponent = Exp}) ->
crypto:rsa_verify(DigestType,
sized_binary(PlainText),
sized_binary(Signature),
[crypto:mpint(Exp), crypto:mpint(Mod)]);
-verify(Digest, none, Signature, {Key, #'Dss-Parms'{p = P, q = Q, g = G}})
- when is_integer(Key), is_binary(Digest), is_binary(Signature) ->
- crypto:dss_verify(none,
- Digest,
- sized_binary(Signature),
+verify({digest,_}=Digest, sha, Signature, {Key, #'Dss-Parms'{p = P, q = Q, g = G}})
+ when is_integer(Key), is_binary(Signature) ->
+ crypto:dss_verify(Digest, sized_binary(Signature),
[crypto:mpint(P), crypto:mpint(Q),
crypto:mpint(G), crypto:mpint(Key)]);
-
+%% Backwards compatibility
+verify(Digest, none, Signature, {_, #'Dss-Parms'{}} = Key ) ->
+ verify({digest,Digest}, sha, Signature, Key);
+
verify(PlainText, sha, Signature, {Key, #'Dss-Parms'{p = P, q = Q, g = G}})
- when is_integer(Key), is_binary(PlainText), is_binary(Signature) ->
+ when is_integer(Key), is_binary(PlainText), is_binary(Signature) ->
crypto:dss_verify(sized_binary(PlainText),
sized_binary(Signature),
[crypto:mpint(P), crypto:mpint(Q),
diff --git a/lib/public_key/test/Makefile b/lib/public_key/test/Makefile
index b7f91981a5..929d321d69 100644
--- a/lib/public_key/test/Makefile
+++ b/lib/public_key/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2011. All Rights Reserved.
+# Copyright Ericsson AB 2008-2012. 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
@@ -21,7 +21,7 @@ include $(ERL_TOP)/make/target.mk
include $(ERL_TOP)/make/$(TARGET)/otp.mk
-INCLUDES= -I. -I ../include
+INCLUDES= -I. -I ../include -pa $(ERL_TOP)/lib/public_key/ebin
# ----------------------------------------------------
# Target Specs
@@ -78,11 +78,11 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(SPEC_FILES) $(ERL_FILES) $(COVER_FILE) $(HRL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(SPEC_FILES) $(ERL_FILES) $(COVER_FILE) $(HRL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl
index a91dcfa029..f2f30dad6e 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -107,7 +107,7 @@ all() ->
{group, ssh_public_key_decode_encode},
encrypt_decrypt,
{group, sign_verify},
- pkix, pkix_path_validation].
+ pkix, pkix_countryname, pkix_path_validation].
groups() ->
[{pem_decode_encode, [], [dsa_pem, rsa_pem, encrypted_pem,
@@ -405,9 +405,20 @@ ssh_known_hosts(Config) when is_list(Config) ->
Datadir = ?config(data_dir, Config),
{ok, SshKnownHosts} = file:read_file(filename:join(Datadir, "known_hosts")),
- [{#'RSAPublicKey'{}, Attributes1}, {#'RSAPublicKey'{}, Attributes2}] = Decoded =
+ [{#'RSAPublicKey'{}, Attributes1}, {#'RSAPublicKey'{}, Attributes2},
+ {#'RSAPublicKey'{}, Attributes3}, {#'RSAPublicKey'{}, Attributes4}] = Decoded =
public_key:ssh_decode(SshKnownHosts, known_hosts),
+ Comment1 = undefined,
+ Comment2 = "[email protected]",
+ Comment3 = "Comment with whitespaces",
+ Comment4 = "[email protected] Comment with whitespaces",
+
+ Comment1 = proplists:get_value(comment, Attributes1, undefined),
+ Comment2 = proplists:get_value(comment, Attributes2),
+ Comment3 = proplists:get_value(comment, Attributes3),
+ Comment4 = proplists:get_value(comment, Attributes4),
+
Value1 = proplists:get_value(hostnames, Attributes1, undefined),
Value2 = proplists:get_value(hostnames, Attributes2, undefined),
true = (Value1 =/= undefined) and (Value2 =/= undefined),
@@ -425,13 +436,16 @@ ssh1_known_hosts(Config) when is_list(Config) ->
Datadir = ?config(data_dir, Config),
{ok, SshKnownHosts} = file:read_file(filename:join(Datadir, "ssh1_known_hosts")),
- [{#'RSAPublicKey'{}, Attributes1}, {#'RSAPublicKey'{}, Attributes2}] = Decoded =
- public_key:ssh_decode(SshKnownHosts, known_hosts),
+ [{#'RSAPublicKey'{}, Attributes1}, {#'RSAPublicKey'{}, Attributes2},{#'RSAPublicKey'{}, Attributes3}]
+ = Decoded = public_key:ssh_decode(SshKnownHosts, known_hosts),
Value1 = proplists:get_value(hostnames, Attributes1, undefined),
Value2 = proplists:get_value(hostnames, Attributes2, undefined),
true = (Value1 =/= undefined) and (Value2 =/= undefined),
+ Comment ="dhopson@VMUbuntu-DSH comment with whitespaces",
+ Comment = proplists:get_value(comment, Attributes3),
+
Encoded = public_key:ssh_encode(Decoded, known_hosts),
Decoded = public_key:ssh_decode(Encoded, known_hosts).
@@ -444,12 +458,22 @@ ssh_auth_keys(Config) when is_list(Config) ->
Datadir = ?config(data_dir, Config),
{ok, SshAuthKeys} = file:read_file(filename:join(Datadir, "auth_keys")),
- [{#'RSAPublicKey'{}, Attributes1}, {{_, #'Dss-Parms'{}}, _Attributes2}] = Decoded =
+ [{#'RSAPublicKey'{}, Attributes1}, {{_, #'Dss-Parms'{}}, Attributes2},
+ {#'RSAPublicKey'{}, Attributes3}, {{_, #'Dss-Parms'{}}, Attributes4}
+ ] = Decoded =
public_key:ssh_decode(SshAuthKeys, auth_keys),
Value1 = proplists:get_value(options, Attributes1, undefined),
true = Value1 =/= undefined,
+ Comment1 = Comment2 = "dhopson@VMUbuntu-DSH",
+ Comment3 = Comment4 ="dhopson@VMUbuntu-DSH comment with whitespaces",
+
+ Comment1 = proplists:get_value(comment, Attributes1),
+ Comment2 = proplists:get_value(comment, Attributes2),
+ Comment3 = proplists:get_value(comment, Attributes3),
+ Comment4 = proplists:get_value(comment, Attributes4),
+
Encoded = public_key:ssh_encode(Decoded, auth_keys),
Decoded = public_key:ssh_decode(Encoded, auth_keys).
@@ -462,13 +486,24 @@ ssh1_auth_keys(Config) when is_list(Config) ->
Datadir = ?config(data_dir, Config),
{ok, SshAuthKeys} = file:read_file(filename:join(Datadir, "ssh1_auth_keys")),
- [{#'RSAPublicKey'{}, Attributes1}, {#'RSAPublicKey'{}, Attributes2}] = Decoded =
+ [{#'RSAPublicKey'{}, Attributes1},
+ {#'RSAPublicKey'{}, Attributes2}, {#'RSAPublicKey'{}, Attributes3},
+ {#'RSAPublicKey'{}, Attributes4}, {#'RSAPublicKey'{}, Attributes5}] = Decoded =
public_key:ssh_decode(SshAuthKeys, auth_keys),
- Value1 = proplists:get_value(bits, Attributes1, undefined),
- Value2 = proplists:get_value(bits, Attributes2, undefined),
+ Value1 = proplists:get_value(bits, Attributes2, undefined),
+ Value2 = proplists:get_value(bits, Attributes3, undefined),
true = (Value1 =/= undefined) and (Value2 =/= undefined),
+ Comment2 = Comment3 = "dhopson@VMUbuntu-DSH",
+ Comment4 = Comment5 ="dhopson@VMUbuntu-DSH comment with whitespaces",
+
+ undefined = proplists:get_value(comment, Attributes1, undefined),
+ Comment2 = proplists:get_value(comment, Attributes2),
+ Comment3 = proplists:get_value(comment, Attributes3),
+ Comment4 = proplists:get_value(comment, Attributes4),
+ Comment5 = proplists:get_value(comment, Attributes5),
+
Encoded = public_key:ssh_encode(Decoded, auth_keys),
Decoded = public_key:ssh_decode(Encoded, auth_keys).
@@ -626,6 +661,34 @@ pkix(Config) when is_list(Config) ->
VerifyStr = public_key:pkix_normalize_name(TestStr),
ok.
+
+%%--------------------------------------------------------------------
+pkix_countryname(doc) ->
+ "Test workaround for certs that code x509countryname as utf8";
+pkix_countryname(suite) ->
+ [];
+pkix_countryname(Config) when is_list(Config) ->
+ Cert = incorrect_pkix_cert(),
+ OTPCert = public_key:pkix_decode_cert(Cert, otp),
+ TBSCert = OTPCert#'OTPCertificate'.tbsCertificate,
+ Issuer = TBSCert#'OTPTBSCertificate'.issuer,
+ Subj = TBSCert#'OTPTBSCertificate'.subject,
+ check_countryname(Issuer),
+ check_countryname(Subj).
+
+check_countryname({rdnSequence,DirName}) ->
+ do_check_countryname(DirName).
+do_check_countryname([]) ->
+ ok;
+do_check_countryname([#'AttributeTypeAndValue'{type = ?'id-at-countryName',
+ value = "US"}|_]) ->
+ ok;
+do_check_countryname([#'AttributeTypeAndValue'{type = ?'id-at-countryName',
+ value = Value}|_]) ->
+ test_server:fail({incorrect_cuntry_name, Value});
+do_check_countryname([_| Rest]) ->
+ do_check_countryname(Rest).
+
%%--------------------------------------------------------------------
pkix_path_validation(doc) ->
"Misc pkix tests not covered elsewhere";
@@ -716,3 +779,6 @@ check_entry_type(_,_) ->
strip_ending_newlines(Bin) ->
string:strip(binary_to_list(Bin), right, 10).
+
+incorrect_pkix_cert() ->
+ <<48,130,5,186,48,130,4,162,160,3,2,1,2,2,7,7,250,61,63,6,140,137,48,13,6,9,42, 134,72,134,247,13,1,1,5,5,0,48,129,220,49,11,48,9,6,3,85,4,6,19,2,85,83,49, 16,48,14,6,3,85,4,8,19,7,65,114,105,122,111,110,97,49,19,48,17,6,3,85,4,7,19, 10,83,99,111,116,116,115,100,97,108,101,49,37,48,35,6,3,85,4,10,19,28,83,116, 97,114,102,105,101,108,100,32,84,101,99,104,110,111,108,111,103,105,101,115, 44,32,73,110,99,46,49,57,48,55,6,3,85,4,11,19,48,104,116,116,112,58,47,47,99, 101,114,116,105,102,105,99,97,116,101,115,46,115,116,97,114,102,105,101,108, 100,116,101,99,104,46,99,111,109,47,114,101,112,111,115,105,116,111,114,121, 49,49,48,47,6,3,85,4,3,19,40,83,116,97,114,102,105,101,108,100,32,83,101,99, 117,114,101,32,67,101,114,116,105,102,105,99,97,116,105,111,110,32,65,117, 116,104,111,114,105,116,121,49,17,48,15,6,3,85,4,5,19,8,49,48,54,56,56,52,51, 53,48,30,23,13,49,48,49,48,50,51,48,49,51,50,48,53,90,23,13,49,50,49,48,50, 51,48,49,51,50,48,53,90,48,122,49,11,48,9,6,3,85,4,6,12,2,85,83,49,11,48,9,6, 3,85,4,8,12,2,65,90,49,19,48,17,6,3,85,4,7,12,10,83,99,111,116,116,115,100, 97,108,101,49,38,48,36,6,3,85,4,10,12,29,83,112,101,99,105,97,108,32,68,111, 109,97,105,110,32,83,101,114,118,105,99,101,115,44,32,73,110,99,46,49,33,48, 31,6,3,85,4,3,12,24,42,46,108,111,103,105,110,46,115,101,99,117,114,101,115, 101,114,118,101,114,46,110,101,116,48,130,1,34,48,13,6,9,42,134,72,134,247, 13,1,1,1,5,0,3,130,1,15,0,48,130,1,10,2,130,1,1,0,185,136,240,80,141,36,124, 245,182,130,73,19,188,74,166,117,72,228,185,209,43,129,244,40,44,193,231,11, 209,12,234,88,43,142,1,162,48,122,17,95,230,105,171,131,12,147,46,204,36,80, 250,171,33,253,35,62,83,22,71,212,186,141,14,198,89,89,121,204,224,122,246, 127,110,188,229,162,67,95,6,74,231,127,99,131,7,240,85,102,203,251,50,58,58, 104,245,103,181,183,134,32,203,121,232,54,32,188,139,136,112,166,126,14,91, 223,153,172,164,14,61,38,163,208,215,186,210,136,213,143,70,147,173,109,217, 250,169,108,31,211,104,238,103,93,182,59,165,43,196,189,218,241,30,148,240, 109,90,69,176,194,52,116,173,151,135,239,10,209,179,129,192,102,75,11,25,168, 223,32,174,84,223,134,70,167,55,172,143,27,130,123,226,226,7,34,142,166,39, 48,246,96,231,150,84,220,106,133,193,55,95,159,227,24,249,64,36,1,142,171,16, 202,55,126,7,156,15,194,22,116,53,113,174,104,239,203,120,45,131,57,87,84, 163,184,27,83,57,199,91,200,34,43,98,61,180,144,76,65,170,177,2,3,1,0,1,163, 130,1,224,48,130,1,220,48,15,6,3,85,29,19,1,1,255,4,5,48,3,1,1,0,48,29,6,3, 85,29,37,4,22,48,20,6,8,43,6,1,5,5,7,3,1,6,8,43,6,1,5,5,7,3,2,48,14,6,3,85, 29,15,1,1,255,4,4,3,2,5,160,48,56,6,3,85,29,31,4,49,48,47,48,45,160,43,160, 41,134,39,104,116,116,112,58,47,47,99,114,108,46,115,116,97,114,102,105,101, 108,100,116,101,99,104,46,99,111,109,47,115,102,115,50,45,48,46,99,114,108, 48,83,6,3,85,29,32,4,76,48,74,48,72,6,11,96,134,72,1,134,253,110,1,7,23,2,48, 57,48,55,6,8,43,6,1,5,5,7,2,1,22,43,104,116,116,112,115,58,47,47,99,101,114, 116,115,46,115,116,97,114,102,105,101,108,100,116,101,99,104,46,99,111,109, 47,114,101,112,111,115,105,116,111,114,121,47,48,129,141,6,8,43,6,1,5,5,7,1, 1,4,129,128,48,126,48,42,6,8,43,6,1,5,5,7,48,1,134,30,104,116,116,112,58,47, 47,111,99,115,112,46,115,116,97,114,102,105,101,108,100,116,101,99,104,46,99, 111,109,47,48,80,6,8,43,6,1,5,5,7,48,2,134,68,104,116,116,112,58,47,47,99, 101,114,116,105,102,105,99,97,116,101,115,46,115,116,97,114,102,105,101,108, 100,116,101,99,104,46,99,111,109,47,114,101,112,111,115,105,116,111,114,121, 47,115,102,95,105,110,116,101,114,109,101,100,105,97,116,101,46,99,114,116, 48,31,6,3,85,29,35,4,24,48,22,128,20,73,75,82,39,209,27,188,242,161,33,106, 98,123,81,66,122,138,215,213,86,48,59,6,3,85,29,17,4,52,48,50,130,24,42,46, 108,111,103,105,110,46,115,101,99,117,114,101,115,101,114,118,101,114,46,110, 101,116,130,22,108,111,103,105,110,46,115,101,99,117,114,101,115,101,114,118, 101,114,46,110,101,116,48,29,6,3,85,29,14,4,22,4,20,138,233,191,208,157,203, 249,85,242,239,20,195,48,10,148,49,144,101,255,116,48,13,6,9,42,134,72,134, 247,13,1,1,5,5,0,3,130,1,1,0,82,31,121,162,49,50,143,26,167,202,143,61,71, 189,201,199,57,81,122,116,90,192,88,24,102,194,174,48,157,74,27,87,210,223, 253,93,3,91,150,109,120,1,110,27,11,200,198,141,222,246,14,200,71,105,41,138, 13,114,122,106,63,17,197,181,234,121,61,89,74,65,41,231,248,219,129,83,176, 219,55,107,55,211,112,98,38,49,69,77,96,221,108,123,152,12,210,159,157,141, 43,226,55,187,129,3,82,49,136,66,81,196,91,234,196,10,82,48,6,80,163,83,71, 127,102,177,93,209,129,26,104,2,84,24,255,248,161,3,244,169,234,92,122,110, 43,4,17,113,185,235,108,219,210,236,132,216,177,227,17,169,58,162,159,182, 162,93,160,229,200,9,163,229,110,121,240,168,232,14,91,214,188,196,109,210, 164,222,0,109,139,132,113,91,16,118,173,178,176,80,132,34,41,199,51,206,250, 224,132,60,115,192,94,107,163,219,212,226,225,65,169,148,108,213,46,174,173, 103,110,189,229,166,149,254,31,51,44,144,108,187,182,11,251,201,206,86,138, 208,59,51,86,132,235,81,225,88,34,190,8,184>>.
diff --git a/lib/public_key/test/public_key_SUITE_data/auth_keys b/lib/public_key/test/public_key_SUITE_data/auth_keys
index 0c4b47edde..8be7357a06 100644
--- a/lib/public_key/test/public_key_SUITE_data/auth_keys
+++ b/lib/public_key/test/public_key_SUITE_data/auth_keys
@@ -1,3 +1,7 @@
command="dump /home",no-pty,no-port-forwarding ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAwrr66r8n6B8Y0zMF3dOpXEapIQD9DiYQ6D6/zwor9o39jSkHNiMMER/GETBbzP83LOcekm02aRjo55ArO7gPPVvCXbrirJu9pkm4AC4BBre5xSLS7soyzwbigFruM8G63jSXqpHqJ/ooi168sKMC2b0Ncsi+JlTfNYlDXJVLKEeZgZOInQyMmtisaDTUQWTIv1snAizf4iIYENuAkGYGNCL77u5Y5VOu5eQipvFajTnps9QvUx/zdSFYn9e2sulWM3Bxc/S4IJ67JWHVRpfJxGi3hinRBH8WQdXuUwdJJTiJHKPyYrrM7Q6Xq4TOMFtcRuLDC6u3BXM1L0gBvHPNOnD5l2Lp5EjUkQ9CBf2j4A4gfH+iWQZyk08esAG/iwArAVxkl368+dkbMWOXL8BN4x5zYgdzoeypQZZ2RKH780MCTSo4WQ19DP8pw+9q3bSFC9H3xYAxrKAJNWjeTUJOTrTe+mWXXU770gYyQTxa2ycnYrlZucn1S3vsvn6eq7NZZ8NRbyv1n15Ocg+nHK4fuKOrwPhU3NbKQwtjb0Wsxx1gAmQqIOLTpAdsrAauPxC7TPYA5qQVCphvimKuhQM/1gMV225JrnjspVlthCzuFYUjXOKC3wxz6FFEtwnXu3uC5bVVkmkNadJmD21gD23yk4BraGXVYpRMIB+X+OTUUI8= dhopson@VMUbuntu-DSH
ssh-dss AAAAB3NzaC1kc3MAAACBAPY8ZOHY2yFSJA6XYC9HRwNHxaehvx5wOJ0rzZdzoSOXxbETW6ToHv8D1UJ/z+zHo9Fiko5XybZnDIaBDHtblQ+Yp7StxyltHnXF1YLfKD1G4T6JYrdHYI14Om1eg9e4NnCRleaqoZPF3UGfZia6bXrGTQf3gJq2e7Yisk/gF+1VAAAAFQDb8D5cvwHWTZDPfX0D2s9Rd7NBvQAAAIEAlN92+Bb7D4KLYk3IwRbXblwXdkPggA4pfdtW9vGfJ0/RHd+NjB4eo1D+0dix6tXwYGN7PKS5R/FXPNwxHPapcj9uL1Jn2AWQ2dsknf+i/FAAvioUPkmdMc0zuWoSOEsSNhVDtX3WdvVcGcBq9cetzrtOKWOocJmJ80qadxTRHtUAAACBAN7CY+KKv1gHpRzFwdQm7HK9bb1LAo2KwaoXnadFgeptNBQeSXG1vO+JsvphVMBJc9HSn24VYtYtsMu74qXviYjziVucWKjjKEb11juqnF0GDlB3VVmxHLmxnAz643WK42Z7dLM5sY29ouezv4Xz2PuMch5VGPP+CDqzCM4loWgV dhopson@VMUbuntu-DSH
+
+command="dump /home",no-pty,no-port-forwarding ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAwrr66r8n6B8Y0zMF3dOpXEapIQD9DiYQ6D6/zwor9o39jSkHNiMMER/GETBbzP83LOcekm02aRjo55ArO7gPPVvCXbrirJu9pkm4AC4BBre5xSLS7soyzwbigFruM8G63jSXqpHqJ/ooi168sKMC2b0Ncsi+JlTfNYlDXJVLKEeZgZOInQyMmtisaDTUQWTIv1snAizf4iIYENuAkGYGNCL77u5Y5VOu5eQipvFajTnps9QvUx/zdSFYn9e2sulWM3Bxc/S4IJ67JWHVRpfJxGi3hinRBH8WQdXuUwdJJTiJHKPyYrrM7Q6Xq4TOMFtcRuLDC6u3BXM1L0gBvHPNOnD5l2Lp5EjUkQ9CBf2j4A4gfH+iWQZyk08esAG/iwArAVxkl368+dkbMWOXL8BN4x5zYgdzoeypQZZ2RKH780MCTSo4WQ19DP8pw+9q3bSFC9H3xYAxrKAJNWjeTUJOTrTe+mWXXU770gYyQTxa2ycnYrlZucn1S3vsvn6eq7NZZ8NRbyv1n15Ocg+nHK4fuKOrwPhU3NbKQwtjb0Wsxx1gAmQqIOLTpAdsrAauPxC7TPYA5qQVCphvimKuhQM/1gMV225JrnjspVlthCzuFYUjXOKC3wxz6FFEtwnXu3uC5bVVkmkNadJmD21gD23yk4BraGXVYpRMIB+X+OTUUI8= dhopson@VMUbuntu-DSH comment with whitespaces
+
+ssh-dss AAAAB3NzaC1kc3MAAACBAPY8ZOHY2yFSJA6XYC9HRwNHxaehvx5wOJ0rzZdzoSOXxbETW6ToHv8D1UJ/z+zHo9Fiko5XybZnDIaBDHtblQ+Yp7StxyltHnXF1YLfKD1G4T6JYrdHYI14Om1eg9e4NnCRleaqoZPF3UGfZia6bXrGTQf3gJq2e7Yisk/gF+1VAAAAFQDb8D5cvwHWTZDPfX0D2s9Rd7NBvQAAAIEAlN92+Bb7D4KLYk3IwRbXblwXdkPggA4pfdtW9vGfJ0/RHd+NjB4eo1D+0dix6tXwYGN7PKS5R/FXPNwxHPapcj9uL1Jn2AWQ2dsknf+i/FAAvioUPkmdMc0zuWoSOEsSNhVDtX3WdvVcGcBq9cetzrtOKWOocJmJ80qadxTRHtUAAACBAN7CY+KKv1gHpRzFwdQm7HK9bb1LAo2KwaoXnadFgeptNBQeSXG1vO+JsvphVMBJc9HSn24VYtYtsMu74qXviYjziVucWKjjKEb11juqnF0GDlB3VVmxHLmxnAz643WK42Z7dLM5sY29ouezv4Xz2PuMch5VGPP+CDqzCM4loWgV dhopson@VMUbuntu-DSH comment with whitespaces
diff --git a/lib/public_key/test/public_key_SUITE_data/known_hosts b/lib/public_key/test/public_key_SUITE_data/known_hosts
index 30fc3b1fe8..3c3af68178 100644
--- a/lib/public_key/test/public_key_SUITE_data/known_hosts
+++ b/lib/public_key/test/public_key_SUITE_data/known_hosts
@@ -1,3 +1,8 @@
hostname.domain.com,192.168.0.1 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA1XY18+zA8VNK2YkzygOkMqUxHSTfxT1Xxx8CgDZgcQH8HUhPssW5ttvG8nKetlPQZAVk1C4WkWS1y5b3ekBhZTIxocp9Joc6V1+f2EOfO2mSLRwB16RGrdw6q7msrBXTC/dl+hF45kMMzVNzqxnSMVOa0sEPK2zK6Sg3Vi9fCSM=
|1|BWO5qDxk/cFH0wa05JLdHn+j6xQ=|rXQvIxh5cDD3C43k5DPDamawVNA= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA1XY18+zA8VNK2YkzygOkMqUxHSTfxT1Xxx8CgDZgcQH8HUhPssW5ttvG8nKetlPQZAVk1C4WkWS1y5b3ekBhZTIxocp9Joc6V1+f2EOfO2mSLRwB16RGrdw6q7msrBXTC/dl+hF45kMMzVNzqxnSMVOa0sEPK2zK6Sg3Vi9fCSM= [email protected]
+
+hostname.domain.com,192.168.0.1 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA1XY18+zA8VNK2YkzygOkMqUxHSTfxT1Xxx8CgDZgcQH8HUhPssW5ttvG8nKetlPQZAVk1C4WkWS1y5b3ekBhZTIxocp9Joc6V1+f2EOfO2mSLRwB16RGrdw6q7msrBXTC/dl+hF45kMMzVNzqxnSMVOa0sEPK2zK6Sg3Vi9fCSM= Comment with whitespaces
+
+|1|BWO5qDxk/cFH0wa05JLdHn+j6xQ=|rXQvIxh5cDD3C43k5DPDamawVNA= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA1XY18+zA8VNK2YkzygOkMqUxHSTfxT1Xxx8CgDZgcQH8HUhPssW5ttvG8nKetlPQZAVk1C4WkWS1y5b3ekBhZTIxocp9Joc6V1+f2EOfO2mSLRwB16RGrdw6q7msrBXTC/dl+hF45kMMzVNzqxnSMVOa0sEPK2zK6Sg3Vi9fCSM= [email protected] Comment with whitespaces
+
diff --git a/lib/public_key/test/public_key_SUITE_data/ssh1_auth_keys b/lib/public_key/test/public_key_SUITE_data/ssh1_auth_keys
index c91f4e4679..ac3d61b4c7 100644
--- a/lib/public_key/test/public_key_SUITE_data/ssh1_auth_keys
+++ b/lib/public_key/test/public_key_SUITE_data/ssh1_auth_keys
@@ -1,3 +1,9 @@
+1024 35 794430685278501116412873221867658581245241426828503388129294124540165981586596106773643485704743298698207838825035605868404742682423919455523383721081589378970796492944950066480951790660582889972423189943567111507801410254720228911513553205592856585541922662924268445466959576882300405064708497308004255650466014242855505233634626075778108365396568863197935915425650388910408127232583533503834009244199384570662092164277923946411149853110048365318587554141774139652307149492021035538341281427025252592933784473453522113124752189378715431529801894015739903371171585194505182320772654217490509848165365152457990491089951560694728469571221819385402117009544812199223715540348068497710535492913376699508575875577554607325905000745578091554027803374110357015655416894607641289462159580964951182385869168785183135763253784745647466464331174922663455073627501620274348748413309761116542324505123795743603781806636788810617169341018091186028310551725315297135354426735951943325476221811539822892501042385411792050504283745898099390893596941969752683246939665141002098430129617772928840718016009187577151479855846883928332010147501182201528575840364152774917950524127063432334646746291719251739989499132767590205934821590545762802261107691663
+
1024 35 794430685278501116412873221867658581245241426828503388129294124540165981586596106773643485704743298698207838825035605868404742682423919455523383721081589378970796492944950066480951790660582889972423189943567111507801410254720228911513553205592856585541922662924268445466959576882300405064708497308004255650466014242855505233634626075778108365396568863197935915425650388910408127232583533503834009244199384570662092164277923946411149853110048365318587554141774139652307149492021035538341281427025252592933784473453522113124752189378715431529801894015739903371171585194505182320772654217490509848165365152457990491089951560694728469571221819385402117009544812199223715540348068497710535492913376699508575875577554607325905000745578091554027803374110357015655416894607641289462159580964951182385869168785183135763253784745647466464331174922663455073627501620274348748413309761116542324505123795743603781806636788810617169341018091186028310551725315297135354426735951943325476221811539822892501042385411792050504283745898099390893596941969752683246939665141002098430129617772928840718016009187577151479855846883928332010147501182201528575840364152774917950524127063432334646746291719251739989499132767590205934821590545762802261107691663 dhopson@VMUbuntu-DSH
command="dump /home",no-pty,no-port-forwarding 1024 35 794430685278501116412873221867658581245241426828503388129294124540165981586596106773643485704743298698207838825035605868404742682423919455523383721081589378970796492944950066480951790660582889972423189943567111507801410254720228911513553205592856585541922662924268445466959576882300405064708497308004255650466014242855505233634626075778108365396568863197935915425650388910408127232583533503834009244199384570662092164277923946411149853110048365318587554141774139652307149492021035538341281427025252592933784473453522113124752189378715431529801894015739903371171585194505182320772654217490509848165365152457990491089951560694728469571221819385402117009544812199223715540348068497710535492913376699508575875577554607325905000745578091554027803374110357015655416894607641289462159580964951182385869168785183135763253784745647466464331174922663455073627501620274348748413309761116542324505123795743603781806636788810617169341018091186028310551725315297135354426735951943325476221811539822892501042385411792050504283745898099390893596941969752683246939665141002098430129617772928840718016009187577151479855846883928332010147501182201528575840364152774917950524127063432334646746291719251739989499132767590205934821590545762802261107691663 dhopson@VMUbuntu-DSH
+
+1024 35 794430685278501116412873221867658581245241426828503388129294124540165981586596106773643485704743298698207838825035605868404742682423919455523383721081589378970796492944950066480951790660582889972423189943567111507801410254720228911513553205592856585541922662924268445466959576882300405064708497308004255650466014242855505233634626075778108365396568863197935915425650388910408127232583533503834009244199384570662092164277923946411149853110048365318587554141774139652307149492021035538341281427025252592933784473453522113124752189378715431529801894015739903371171585194505182320772654217490509848165365152457990491089951560694728469571221819385402117009544812199223715540348068497710535492913376699508575875577554607325905000745578091554027803374110357015655416894607641289462159580964951182385869168785183135763253784745647466464331174922663455073627501620274348748413309761116542324505123795743603781806636788810617169341018091186028310551725315297135354426735951943325476221811539822892501042385411792050504283745898099390893596941969752683246939665141002098430129617772928840718016009187577151479855846883928332010147501182201528575840364152774917950524127063432334646746291719251739989499132767590205934821590545762802261107691663 dhopson@VMUbuntu-DSH comment with whitespaces
+
+command="dump /home",no-pty,no-port-forwarding 1024 35 794430685278501116412873221867658581245241426828503388129294124540165981586596106773643485704743298698207838825035605868404742682423919455523383721081589378970796492944950066480951790660582889972423189943567111507801410254720228911513553205592856585541922662924268445466959576882300405064708497308004255650466014242855505233634626075778108365396568863197935915425650388910408127232583533503834009244199384570662092164277923946411149853110048365318587554141774139652307149492021035538341281427025252592933784473453522113124752189378715431529801894015739903371171585194505182320772654217490509848165365152457990491089951560694728469571221819385402117009544812199223715540348068497710535492913376699508575875577554607325905000745578091554027803374110357015655416894607641289462159580964951182385869168785183135763253784745647466464331174922663455073627501620274348748413309761116542324505123795743603781806636788810617169341018091186028310551725315297135354426735951943325476221811539822892501042385411792050504283745898099390893596941969752683246939665141002098430129617772928840718016009187577151479855846883928332010147501182201528575840364152774917950524127063432334646746291719251739989499132767590205934821590545762802261107691663 dhopson@VMUbuntu-DSH comment with whitespaces
diff --git a/lib/public_key/test/public_key_SUITE_data/ssh1_known_hosts b/lib/public_key/test/public_key_SUITE_data/ssh1_known_hosts
index ec668fe05b..835b16ab67 100644
--- a/lib/public_key/test/public_key_SUITE_data/ssh1_known_hosts
+++ b/lib/public_key/test/public_key_SUITE_data/ssh1_known_hosts
@@ -1,2 +1,3 @@
hostname.domain.com,192.168.0.1 1024 35 794430685278501116412873221867658581245241426828503388129294124540165981586596106773643485704743298698207838825035605868404742682423919455523383721081589378970796492944950066480951790660582889972423189943567111507801410254720228911513553205592856585541922662924268445466959576882300405064708497308004255650466014242855505233634626075778108365396568863197935915425650388910408127232583533503834009244199384570662092164277923946411149853110048365318587554141774139652307149492021035538341281427025252592933784473453522113124752189378715431529801894015739903371171585194505182320772654217490509848165365152457990491089951560694728469571221819385402117009544812199223715540348068497710535492913376699508575875577554607325905000745578091554027803374110357015655416894607641289462159580964951182385869168785183135763253784745647466464331174922663455073627501620274348748413309761116542324505123795743603781806636788810617169341018091186028310551725315297135354426735951943325476221811539822892501042385411792050504283745898099390893596941969752683246939665141002098430129617772928840718016009187577151479855846883928332010147501182201528575840364152774917950524127063432334646746291719251739989499132767590205934821590545762802261107691663 dhopson@VMUbuntu-DSH
hostname2.domain.com,192.168.0.2 1024 35 794430685278501116412873221867658581245241426828503388129294124540165981586596106773643485704743298698207838825035605868404742682423919455523383721081589378970796492944950066480951790660582889972423189943567111507801410254720228911513553205592856585541922662924268445466959576882300405064708497308004255650466014242855505233634626075778108365396568863197935915425650388910408127232583533503834009244199384570662092164277923946411149853110048365318587554141774139652307149492021035538341281427025252592933784473453522113124752189378715431529801894015739903371171585194505182320772654217490509848165365152457990491089951560694728469571221819385402117009544812199223715540348068497710535492913376699508575875577554607325905000745578091554027803374110357015655416894607641289462159580964951182385869168785183135763253784745647466464331174922663455073627501620274348748413309761116542324505123795743603781806636788810617169341018091186028310551725315297135354426735951943325476221811539822892501042385411792050504283745898099390893596941969752683246939665141002098430129617772928840718016009187577151479855846883928332010147501182201528575840364152774917950524127063432334646746291719251739989499132767590205934821590545762802261107691663
+hostname3.domain.com,192.168.0.3 1024 35 794430685278501116412873221867658581245241426828503388129294124540165981586596106773643485704743298698207838825035605868404742682423919455523383721081589378970796492944950066480951790660582889972423189943567111507801410254720228911513553205592856585541922662924268445466959576882300405064708497308004255650466014242855505233634626075778108365396568863197935915425650388910408127232583533503834009244199384570662092164277923946411149853110048365318587554141774139652307149492021035538341281427025252592933784473453522113124752189378715431529801894015739903371171585194505182320772654217490509848165365152457990491089951560694728469571221819385402117009544812199223715540348068497710535492913376699508575875577554607325905000745578091554027803374110357015655416894607641289462159580964951182385869168785183135763253784745647466464331174922663455073627501620274348748413309761116542324505123795743603781806636788810617169341018091186028310551725315297135354426735951943325476221811539822892501042385411792050504283745898099390893596941969752683246939665141002098430129617772928840718016009187577151479855846883928332010147501182201528575840364152774917950524127063432334646746291719251739989499132767590205934821590545762802261107691663 dhopson@VMUbuntu-DSH comment with whitespaces
diff --git a/lib/public_key/vsn.mk b/lib/public_key/vsn.mk
index d8f811bf25..c8165fa247 100644
--- a/lib/public_key/vsn.mk
+++ b/lib/public_key/vsn.mk
@@ -1 +1 @@
-PUBLIC_KEY_VSN = 0.14
+PUBLIC_KEY_VSN = 0.16
diff --git a/lib/reltool/doc/src/Makefile b/lib/reltool/doc/src/Makefile
index 8bc1488f77..2373b5e507 100644
--- a/lib/reltool/doc/src/Makefile
+++ b/lib/reltool/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2010. All Rights Reserved.
+# Copyright Ericsson AB 2009-2012. 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
@@ -97,13 +97,13 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(HTMLDIR)/* $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(HTMLDIR)/* "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/reltool/doc/src/notes.xml b/lib/reltool/doc/src/notes.xml
index cf2cf7f7bc..66ec7e9035 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>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -37,7 +37,170 @@
thus constitutes one section in this document. The title of each
section is the version number of Reltool.</p>
- <section><title>Reltool 0.5.7.1</title>
+ <section><title>Reltool 0.6.1</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ A new sys level configuration parameter
+ <c>{excl_lib,otp_root}</c> is added. When this is set,
+ the target system will not contain anything from
+ <c>$OTP_ROOT</c>. It will only contain a releases
+ directory with rel, script and boot files, and a lib
+ directory with applications found outside of
+ <c>$OTP_ROOT</c> (i.e. "your own" applications).</p>
+ <p>
+ Own Id: OTP-9743</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Reltool 0.6</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Miscellaneous corrections: <list> <item> Start of reltool
+ GUI would sometimes crash with a badmatch in
+ reltool_sys_win:do_init. This has been corrected. </item>
+ <item> Minor corrections of documentation and type
+ specifications of app() and mod() are done. </item>
+ <item> If a module name is duplicated in an app file
+ reltool would return an error. This is now changed to a
+ warning. </item> <item> Reltool would earlier not
+ necessarily keep the order of applications as listed in
+ the rel specification in the configuration. This has been
+ corrected. </item> <item> Reltool would earlier set the
+ default for included applications to an empty list if it
+ was not set in the rel specification in the
+ configuration. This was correct according to
+ sasl/systools documentation, but not according to
+ sasl/systools implementation. We decided to change the
+ documentation and reltool to use the value of
+ included_applications from the .app file as default
+ instead of the empty list, since this seems more
+ intuitive and since systools always has done the same.
+ </item> <item> The value of included applications in the
+ rel specification in the configuration did not overwrite
+ included_applications in the .app file if it was set to
+ an empty list. This has been corrected. </item> <item>
+ Reltool would earlier add load instructions in the
+ script/boot files for ALL modules in the ebin directory
+ of an application even if mod_cond was set to app
+ (include only modules listed in the .app file). This has
+ been corrected. </item> <item> Reltool would earlier add
+ start instructions in the script/boot file for included
+ applications. This has been corrected - included
+ applications shall only be loaded since the including
+ application is responsible for starting them. </item>
+ <item> Status bar now indicates that reltool is working
+ (Processing libraries...) for all configuration changes,
+ and when generating target system. </item> <item> Title
+ of dependecies column in app and mod window is changed
+ from "Modules used by others" to "Modules using this".
+ </item> </list></p>
+ <p>
+ Own Id: OTP-9792</p>
+ </item>
+ <item>
+ <p>
+ Configuration changes via the GUI had a few bugs related
+ to error handling, rollback and undo. A major re-write of
+ the reltool_server has been done in order to align the
+ way reltool_server updates and uses its state and tables
+ for all different kinds of configuration change. </p>
+ <p>
+ All configuration changes (except undo) now cause a
+ re-read of the file system, meaning that if something has
+ changed in the file system it will be reflected in the
+ result of the configuration change.</p>
+ <p>
+ When loading a new configuration file via the GUI, the
+ old configuration is now completely scratched, and only
+ the new is valid.</p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>
+ Own Id: OTP-9794</p>
+ </item>
+ <item>
+ <p>
+ Some bug fixes related to the handling of escripts:
+ <list> <item> Reltool could not handle escripts with
+ inlined applications. This has been corrected. Inlined
+ applications will be visible in the GUI, but not possible
+ to include/exclude separately. </item> <item> Loading a
+ config which contains an escript via the GUI menu did not
+ produce the same result as when using the same
+ configuration at reltool start. Paths, version and label
+ could differ. This has been corrected. </item> <item>
+ Loading config with same escript (source) twice caused
+ reltool to add same module twice. This has been
+ corrected. </item> <item> Loading config with same
+ escript (inlined beam) twice caused reltool to fail
+ saying module is included by two different applications.
+ This has been corrected. </item> <item> Loading config
+ which in addition to an existing escript also adds
+ another escript, for which the name sorts before the
+ existing one, would cause reltool to fail saying
+ "Application name clash". This has been corrected.
+ </item> </list></p>
+ <p>
+ Own Id: OTP-9968</p>
+ </item>
+ <item>
+ <p>
+ Reltool would sometimes generate a .app file containing
+ <c>{start_phases,undefined}</c>, which would cause an
+ exception in systools at parse time. This has been
+ corrected so reltool now omits the <c>start_phases</c>
+ entry if the value is <c>undefined</c>. (Thanks to Juan
+ Jose Comellas)</p>
+ <p>
+ In order to align with reltool, sasl will also omit
+ <c>start_phases</c> entries with value <c>undefined</c>
+ in .script files.</p>
+ <p>
+ Own Id: OTP-10003</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ A warning list is added to the sys window of the reltool
+ GUI. This list will continuously show all warnings
+ produced by the current configuration.</p>
+ <p>
+ Own Id: OTP-9967</p>
+ </item>
+ <item>
+ <p>
+ As a way of specifying one specific version of an
+ application, the following configuration parameter is
+ added on application level:</p>
+ <p>
+ {lib_dir,Dir}, Dir = string()</p>
+ <p>
+ This can be useful if the parent directory of the
+ application directory is not suitable to use as a lib dir
+ on system level.</p>
+ <p>
+ Own Id: OTP-9977</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Reltool 0.5.7.1</title>
<section><title>Improvements and New Features</title>
<list>
diff --git a/lib/reltool/doc/src/reltool.xml b/lib/reltool/doc/src/reltool.xml
index 60e886e8f5..fbe29753be 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>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -51,8 +51,18 @@
defines library directories where additional applications
may reside and it defaults to the directories
listed by the operating system environment variable
- <c>ERL_LIBS</c>. See the module <c>code</c> for more info.
- Finally single modules and entire applications may be read from
+ <c>ERL_LIBS</c>. See the module <c>code</c> for more info.</p>
+
+ <p>An application directory <c>AppDir</c> under a library
+ directory is recognized by the existence of an <c>AppDir/ebin</c>
+ directory. If this does not exist, <c>reltool</c> will not
+ consider <c>AppDir</c> at all when looking for applications.</p>
+
+ <p>It is recommended that application directories are named as the
+ application, possibly followed by a dash and the version
+ number. For example <c>myapp</c> or <c>myapp-1.1</c>.</p>
+
+ <p>Finally single modules and entire applications may be read from
Escripts.</p>
<p>Some configuration parameters control the behavior of Reltool
@@ -144,7 +154,7 @@
value <c>include</c> implies that all applications and
escripts that do not have any explicit <c>incl_cond</c>
setting will be included. <c>exclude</c> implies that all
- applications and escripts) that do not have any explicit
+ applications and escripts that do not have any explicit
<c>incl_cond</c> setting will be excluded.</p>
</item>
@@ -221,6 +231,52 @@
system.</p>
</item>
+ <tag><c>excl_lib</c></tag>
+ <item>
+ <warning><p>This option is experimental.</p></warning>
+ <p>If the <c>excl_lib</c> option is set to <c>otp_root</c>
+ then reltool will not copy anything from the Erlang/OTP
+ installation ($OTP_ROOT) into the target structure. The goal
+ is to create a "slim" release which can be used together with
+ an existing Erlang/OTP installation. The target structure will
+ therefore only contain a <c>lib</c> directory with the
+ applications that were found outside of $OTP_ROOT (typically
+ your own applications), and a <c>releases</c> directory with
+ the generated <c>.rel,</c> <c>.script</c> and <c>.boot</c>
+ files.</p>
+
+ <p>When starting this release, three things must be specified:</p>
+ <taglist>
+ <tag><b>Which <c>releases</c> directory to use</b></tag>
+ <item>Tell the release handler to use the <c>releases</c>
+ directory in our target structure instead of
+ <c>$OTP_ROOT/releases</c>. This is done by setting the SASL
+ environment variable <c>releases_dir</c>, either from the
+ command line (<c>-sasl releases_dir
+ &lt;target-dir&gt;/releases</c>) or in
+ <c>sys.config</c>.</item>
+
+ <tag><b>Which boot file to use</b></tag>
+ <item>The default boot file is <c>$OTP_ROOT/bin/start</c>,
+ but in this case we need to specify a boot file from our
+ target structure, typically
+ <c>&lt;target-dir&gt;/releases/&lt;vsn&gt;/&lt;RelName&gt;</c>. This
+ is done with the <c>-boot</c> command line option to
+ <c>erl</c></item>
+
+ <tag><b>The location of our applications</b></tag>
+ <item>The generated .script (and .boot) file uses the
+ environment variable <c>$RELTOOL_EXT_LIB</c> as prefix for
+ the paths to all applications. The <c>-boot_var</c> option
+ to <c>erl</c> can be used for specifying the value of this
+ variable, typically <c>-boot_var RELTOOL_EXT_LIB
+ &lt;target-dir&gt;/lib</c>.</item>
+ </taglist>
+
+ <p>Example:</p>
+ <p><code>erl -sasl releases_dir \"mytarget/releases\" -boot mytarget/releases/1.0/myrel -boot_var RELTOOL_EXT_LIB mytarget/lib</code></p>
+ </item>
+
<tag><c>incl_sys_filters</c></tag>
<item>
<p>This parameter normally contains a list of regular
@@ -322,8 +378,31 @@
<item>
<p>The version of the application. In an installed system there may
exist several versions of an application. The <c>vsn</c> parameter
- controls which version of the application will be chosen. If it
- is omitted, the latest version will be chosen.</p>
+ controls which version of the application will be chosen.</p>
+ <p>This parameter is mutual exclusive with <c>lib_dir</c>. If
+ <c>vsn</c> and <c>lib_dir</c> are both omitted, the latest version
+ will be chosen.</p>
+ <p>Note that in order for reltool to sort application versions
+ and thereby be able to select the latest, it is required that
+ the version id for the application consits of integers and
+ dots only, for example <c>1</c>, <c>2.0</c> or
+ <c>3.17.1</c>.</p>
+ </item>
+ <tag><c>lib_dir</c></tag>
+ <item>
+ <p>The directory to read the application from. This parameter
+ can be used to point out a specific location to fetch the
+ application from. This is useful for instance if the parent
+ directory for some reason is no good as a library directory on
+ system level.</p>
+ <p>This parameter is mutual exclusive with <c>vsn</c>. If
+ <c>vsn</c> and <c>lib_dir</c> are both omitted, the latest version
+ will be chosen.</p>
+ <p>Note that in order for reltool to sort application versions
+ and thereby be able to select the latest, it is required that
+ the version id for the application consits of integers and
+ dots only, for example <c>1</c>, <c>2.0</c> or
+ <c>3.17.1</c>.</p>
</item>
<tag><c>mod</c></tag>
<item>
@@ -387,7 +466,7 @@
<tag><c>incl_cond</c></tag>
<item>
<p>This parameter controls whether the module is included or not. By
- default the <c>mod_incl</c> parameter on application and system level
+ default the <c>mod_cond</c> parameter on application and system level
will be used to control whether the module is included or not. The
value of <c>incl_cond</c> overrides the module inclusion policy.
<c>include</c> implies that the module is included, while
@@ -433,11 +512,13 @@ sys() = {root_dir, root_dir()}
| {excl_archive_filters, excl_archive_filters()}
| {archive_opts, [archive_opt()]}
app() = {vsn, app_vsn()}
- | {mod, mod_name(), mod()}
+ | {lib_dir, lib_dir()}
+ | {mod, mod_name(), [mod()]}
| {mod_cond, mod_cond()}
| {incl_cond, incl_cond()}
| {debug_info, debug_info()}
| {app_file, app_file()}
+ | {excl_lib, excl_lib()}
| {incl_sys_filters, incl_sys_filters()}
| {excl_sys_filters, excl_sys_filters()}
| {incl_app_filters, incl_app_filters()}
@@ -445,8 +526,7 @@ app() = {vsn, app_vsn()}
| {incl_archive_filters, incl_archive_filters()}
| {excl_archive_filters, excl_archive_filters()}
| {archive_opts, [archive_opt()]}
-mod() = {vsn, app_vsn()}
- | {incl_cond, incl_cond()}
+mod() = {incl_cond, incl_cond()}
| {debug_info, debug_info()}
rel_app() = app_name()
| {app_name(), app_type()}
@@ -464,6 +544,7 @@ escript() = {incl_cond, incl_cond()}
escript_file() = file()
excl_app_filters() = regexps()
excl_archive_filters() = regexps()
+excl_lib() = otp_root
excl_sys_filters() = regexps()
file() = string()
incl_app() = app_name()
@@ -664,10 +745,10 @@ target_spec() = [target_spec()]
</func>
<func>
- <name>install(Server, TargetDir) -> ok | {error, Reason}</name>
+ <name>install(RelName, TargetDir) -> ok | {error, Reason}</name>
<fsummary>Install a target system</fsummary>
<type>
- <v>Server = server()</v>
+ <v>RelName = rel_name()</v>
<v>TargetDir = target_dir()</v>
<v>Reason = reason()</v>
</type>
diff --git a/lib/reltool/doc/src/reltool_usage.xml b/lib/reltool/doc/src/reltool_usage.xml
index d128e80a77..0041e60d8f 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>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -257,6 +257,11 @@
policy</c> part of the page. By default the latest version of the
application is selected, but it is possible to override this by
explicitly selecting another version.</p>
+
+ <p>Note that in order for reltool to sort application versions and
+ thereby be able to select the latest, it is required that the
+ version id for the application consits of integers and dots only,
+ for example <c>1</c>, <c>2.0</c> or <c>3.17.1</c>.</p>
<p>By default the <c>Application inclusion policy</c> on system
level is used for all applications. Set the value to
@@ -335,7 +340,7 @@
<p>There are two categories of modules on the <c>Module
dependencies</c> page. If the module is used by other modules,
- these are listed under <c>Modules used by others</c>. If the
+ these are listed under <c>Modules using this</c>. If the
module uses other modules, these are listed under <c>Used
modules</c>.</p>
@@ -365,7 +370,7 @@
<p>There are two categories of modules on the <c>Dependencies</c>
page. If the module is used by other modules, these are listed
- under <c>Modules used by others</c>. If the module uses other
+ under <c>Modules using this</c>. If the module uses other
modules, these are listed under <c>Used modules</c>.</p>
<p>Double click on an module name to launch a module window.</p>
diff --git a/lib/reltool/examples/Makefile b/lib/reltool/examples/Makefile
index dacfd4e7d4..0b495b14b7 100644
--- a/lib/reltool/examples/Makefile
+++ b/lib/reltool/examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009. All Rights Reserved.
+# Copyright Ericsson AB 2009-2012. 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
@@ -72,8 +72,8 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/examples
- $(INSTALL_DATA) $(ERL_FILES) $(DATA_FILES) $(HRL_FILES) $(RELSYSDIR)/examples
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples"
+ $(INSTALL_DATA) $(ERL_FILES) $(DATA_FILES) $(HRL_FILES) "$(RELSYSDIR)/examples"
release_docs_spec:
diff --git a/lib/reltool/src/Makefile b/lib/reltool/src/Makefile
index 4e6a112b7e..a7e34053f1 100644
--- a/lib/reltool/src/Makefile
+++ b/lib/reltool/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2010. All Rights Reserved.
+# Copyright Ericsson AB 2009-2012. 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
@@ -97,11 +97,11 @@ $(TARGET_FILES): $(HRL_FILES) $(INTERNAL_HRL_FILES)
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(APP_TARGET) $(APPUP_TARGET) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/reltool/src/reltool.erl b/lib/reltool/src/reltool.erl
index 54eb1ca9e1..2bdf222aa0 100644
--- a/lib/reltool/src/reltool.erl
+++ b/lib/reltool/src/reltool.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -59,7 +59,7 @@ start_link(Options) when is_list(Options) ->
{ok, _WinPid} = OK ->
OK;
{error, Reason} ->
- {error, lists:flatten(io_lib:format("~p", [Reason]))}
+ {error, Reason}
end.
%% Start server process with options
@@ -69,7 +69,7 @@ start_server(Options) ->
{ok, ServerPid, _Common, _Sys} ->
{ok, ServerPid};
{error, Reason} ->
- {error, lists:flatten(io_lib:format("~p", [Reason]))}
+ {error, Reason}
end.
%% Start server process with options
diff --git a/lib/reltool/src/reltool.hrl b/lib/reltool/src/reltool.hrl
index 93f47f6381..f0d8b38519 100644
--- a/lib/reltool/src/reltool.hrl
+++ b/lib/reltool/src/reltool.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -45,6 +45,7 @@
-type profile() :: development | embedded | standalone.
-type relocatable() :: boolean().
-type escript_file() :: file().
+-type escript_app_name() :: app_name().
-type mod_name() :: atom().
-type app_name() :: atom().
-type app_vsn() :: string(). % e.g. "4.7"
@@ -62,7 +63,8 @@
-type mod() :: {incl_cond, incl_cond()}
| {debug_info, debug_info()}.
-type app() :: {vsn, app_vsn()}
- | {mod, mod_name(), mod()}
+ | {lib_dir, lib_dir()}
+ | {mod, mod_name(), [mod()]}
| {mod_cond, mod_cond()}
| {incl_cond, incl_cond()}
| {app_file, app_file()}
@@ -77,6 +79,7 @@
| {debug_info, debug_info()}
| {app_file, app_file()}
| {profile, profile()}
+ | {excl_lib, excl_lib()}
| {incl_sys_filters, incl_sys_filters()}
| {excl_sys_filters, excl_sys_filters()}
| {incl_app_filters, incl_app_filters()}
@@ -121,32 +124,31 @@
-type incl_defaults() :: boolean().
-type incl_derived() :: boolean().
-type status() :: missing | ok.
+-type excl_lib() :: otp_root.
-record(common,
{
sys_debug :: term(),
wx_debug :: term(),
- trap_exit :: boolean(),
- app_tab :: ets:tab(),
- mod_tab :: ets:tab(),
- mod_used_by_tab :: ets:tab()
+ trap_exit :: boolean()
}).
+%% Types '$1','$2' and '_' are needed for match specs to ets:select
-record(mod,
{ %% Static
- name :: mod_name(),
- app_name :: app_name(),
- incl_cond :: incl_cond() | undefined,
- debug_info :: debug_info() | undefined,
- is_app_mod :: boolean(),
- is_ebin_mod :: boolean(),
- uses_mods :: [mod_name()],
- exists :: boolean(),
+ name :: '$1' | mod_name(),
+ app_name :: '_' | app_name(),
+ incl_cond :: '_' | incl_cond() | undefined,
+ debug_info :: '_' | debug_info() | undefined,
+ is_app_mod :: '_' | boolean(),
+ is_ebin_mod :: '_' | boolean(),
+ uses_mods :: '$2' | [mod_name()],
+ exists :: '_' | boolean(),
%% Dynamic
- status :: status(),
- used_by_mods :: [mod_name()],
- is_pre_included :: boolean() | undefined,
- is_included :: boolean() | undefined
+ status :: '_' | status(),
+ used_by_mods :: '_' | [mod_name()],
+ is_pre_included :: '_' | boolean() | undefined,
+ is_included :: '_' | boolean() | undefined
}).
-record(app_info,
@@ -167,48 +169,49 @@
-record(regexp, {source, compiled}).
+%% Types '$1','$2' and '_' are needed for match specs to ets:select
-record(app,
{ %% Static info
- name :: app_name(),
- is_escript :: boolean(),
- use_selected_vsn :: boolean() | undefined,
- active_dir :: dir(),
- sorted_dirs :: [dir()],
- vsn :: app_vsn(),
- label :: app_label(),
- info :: #app_info{} | undefined,
- mods :: [#mod{}],
+ name :: '_' | app_name(),
+ is_escript :: '_' | boolean() | {inlined, escript_app_name()},
+ use_selected_vsn :: '_' | vsn | dir | undefined,
+ active_dir :: '_' | dir(),
+ sorted_dirs :: '_' | [dir()],
+ vsn :: '_' | app_vsn(),
+ label :: '_' | app_label(),
+ info :: '_' | #app_info{} | undefined,
+ mods :: '_' | [#mod{}],
%% Static source cond
- mod_cond :: mod_cond() | undefined,
- incl_cond :: incl_cond() | undefined,
+ mod_cond :: '_' | mod_cond() | undefined,
+ incl_cond :: '_' | incl_cond() | undefined,
%% Static target cond
- debug_info :: debug_info() | undefined,
- app_file :: app_file() | undefined,
- app_type :: app_type() | undefined,
- incl_app_filters :: [#regexp{}],
- excl_app_filters :: [#regexp{}],
- incl_archive_filters :: [#regexp{}],
- excl_archive_filters :: [#regexp{}],
- archive_opts :: [archive_opt()],
+ debug_info :: '_' | debug_info() | undefined,
+ app_file :: '_' | app_file() | undefined,
+ app_type :: '_' | app_type() | undefined,
+ incl_app_filters :: '_' | [#regexp{}],
+ excl_app_filters :: '_' | [#regexp{}],
+ incl_archive_filters :: '_' | [#regexp{}],
+ excl_archive_filters :: '_' | [#regexp{}],
+ archive_opts :: '_' | [archive_opt()],
%% Dynamic
- status :: status(),
- uses_mods :: [mod_name()],
- used_by_mods :: [mod_name()],
- uses_apps :: [app_name()],
- used_by_apps :: [app_name()],
- is_pre_included :: boolean(),
- is_included :: boolean(),
- rels :: [rel_name()]
+ status :: '_' | status(),
+ uses_mods :: '_' | [mod_name()],
+ used_by_mods :: '_' | [mod_name()],
+ uses_apps :: '_' | [app_name()],
+ used_by_apps :: '_' | [app_name()],
+ is_pre_included :: '_' | '$2' | boolean() | undefined,
+ is_included :: '_' | '$1' | boolean() | undefined,
+ rels :: '_' | [rel_name()]
}).
-record(rel_app,
{
name :: app_name(),
app_type :: app_type() | undefined,
- incl_apps = [] :: [incl_app()]
+ incl_apps :: [incl_app()] | undefined
}).
-record(rel,
@@ -225,13 +228,14 @@
escripts :: [file()],
mod_cond :: mod_cond(),
incl_cond :: incl_cond(),
- apps :: [#app{}],
+ apps :: [#app{}] | undefined,
%% Target cond
boot_rel :: boot_rel(),
rels :: [#rel{}],
emu_name :: emu_name(),
profile :: profile(),
+ excl_lib :: excl_lib(),
incl_sys_filters :: [#regexp{}],
excl_sys_filters :: [#regexp{}],
incl_app_filters :: [#regexp{}],
diff --git a/lib/reltool/src/reltool_app_win.erl b/lib/reltool/src/reltool_app_win.erl
index 70bd72b258..6cd0d2f90b 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -271,8 +271,8 @@ create_apps_list_ctrl(Panel, Sizer, Text) ->
ListItem = wxListItem:new(),
wxListItem:setAlign(ListItem, ?wxLIST_FORMAT_LEFT),
wxListItem:setText(ListItem, Text),
+ wxListItem:setWidth(ListItem, reltool_utils:get_column_width(ListCtrl)),
wxListCtrl:insertColumn(ListCtrl, ?APPS_APP_COL, ListItem),
- %% wxListCtrl:setColumnWidth(ListCtrl, ?APPS_APP_COL, ?APPS_APP_COL_WIDTH),
wxListItem:destroy(ListItem),
wxSizer:add(Sizer, ListCtrl,
@@ -292,7 +292,7 @@ create_deps_page(S, Derived) ->
UsedByCtrl = create_mods_list_ctrl(Panel,
Main,
- "Modules used by others",
+ "Modules using this",
" and their applications",
undefined,
undefined),
@@ -611,7 +611,7 @@ handle_event(#state{sys = Sys, app = App} = S, Wx) ->
redraw_window(S2);
#wx{userData = use_selected_vsn} ->
%% Use selected version
- App2 = App#app{use_selected_vsn = true},
+ App2 = App#app{use_selected_vsn = dir},
{ok, App3} = reltool_sys_win:set_app(S#state.parent_pid, App2),
S2 = S#state{app = App3},
redraw_window(S2);
@@ -619,7 +619,8 @@ handle_event(#state{sys = Sys, app = App} = S, Wx) ->
event = #wxCommand{type = command_radiobox_selected,
cmdString = ActiveDir}} ->
%% Change app source
- S2 = change_version(S, App, ActiveDir),
+ App2 = App#app{use_selected_vsn = dir},
+ S2 = change_version(S, App2, ActiveDir),
redraw_window(S2);
#wx{userData = {mod_button, Action, ListCtrl},
event = #wxCommand{type = command_button_clicked}} ->
@@ -942,11 +943,11 @@ redraw_config(#state{sys = #sys{incl_cond = GlobalIncl,
LatestRadio,
SelectedRadio,
SourceBox,
- fun(true) ->
+ fun(false) ->
+ 0;
+ (_) ->
reltool_utils:elem_to_index(ActiveDir,
- SortedDirs) - 1;
- (false) ->
- 0
+ SortedDirs) - 1
end).
redraw_double_box(Global, Local, GlobalRadio, LocalRadio, LocalBox, GetChoice) ->
diff --git a/lib/reltool/src/reltool_mod_win.erl b/lib/reltool/src/reltool_mod_win.erl
index e1c2fa5100..899423bb6d 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -215,7 +215,7 @@ create_deps_page(S) ->
UsedByCtrl = create_mods_list_ctrl(Panel,
Main,
- "Modules used by others",
+ "Modules using this",
" and their applications"),
wxSizer:add(Main,
wxStaticLine:new(Panel, [{style, ?wxLI_VERTICAL}]),
@@ -314,8 +314,8 @@ do_create_code_page(#state{xref_pid = Xref, mod = M} = S, PageName) ->
{ok, App} = reltool_server:get_app(Xref, M#mod.app_name),
ErlBin =
case App#app.is_escript of
- true -> find_escript_bin(App, M);
- false -> find_regular_bin(App, M)
+ false -> find_regular_bin(App, M);
+ _ -> find_escript_bin(App, M)
end,
load_code(Editor, ErlBin),
diff --git a/lib/reltool/src/reltool_server.erl b/lib/reltool/src/reltool_server.erl
index 692baea0a4..c56e29152d 100644
--- a/lib/reltool/src/reltool_server.erl
+++ b/lib/reltool/src/reltool_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -51,7 +51,12 @@
sys,
old_sys,
status,
- old_status}).
+ old_status,
+ app_tab,
+ old_app_tab,
+ mod_tab,
+ old_mod_tab,
+ mod_used_by_tab}).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Client
@@ -123,174 +128,165 @@ gen_spec(Pid) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Server
-init(Options) ->
+init([{parent,Parent}|_] = Options) ->
try
do_init(Options)
catch
+ throw:{error,Reason} ->
+ proc_lib:init_ack(Parent,{error,Reason});
error:Reason ->
exit({Reason, erlang:get_stacktrace()})
end.
do_init(Options) ->
- {S, Status} = parse_options(Options),
- #state{parent_pid = ParentPid, common = C, sys = Sys} = S,
-
- %% process_flag(trap_exit, (S#state.common)#common.trap_exit),
- proc_lib:init_ack(ParentPid,
- {ok, self(), C, Sys#sys{apps = undefined}}),
- {S2, Status2} = refresh(S, true, Status),
- {S3, Status3} =
- analyse(S2#state{old_sys = S2#state.sys}, Status2),
- case Status3 of
- {ok, _Warnings} -> % BUGBUG: handle warnings
- loop(S3#state{status = Status3, old_status = {ok, []}});
- {error, Reason} ->
- exit(Reason)
- end.
-
-parse_options(Opts) ->
- AppTab = ets:new(reltool_apps, [public, ordered_set, {keypos, #app.name}]),
- ModTab = ets:new(reltool_mods, [public, ordered_set, {keypos, #mod.name}]),
+ AppTab = ets:new(reltool_apps1, [public, ordered_set, {keypos,#app.name}]),
+ OldAppTab = ets:new(reltool_apps2, [public, ordered_set, {keypos,#app.name}]),
+ ModTab = ets:new(reltool_mods1, [public, ordered_set, {keypos,#mod.name}]),
+ OldModTab = ets:new(reltool_mods2, [public, ordered_set, {keypos,#mod.name}]),
ModUsesTab = ets:new(reltool_mod_uses, [public, bag, {keypos, 1}]),
- Sys = #sys{root_dir = reltool_utils:root_dir(),
- lib_dirs = reltool_utils:erl_libs(),
- escripts = [],
- incl_cond = ?DEFAULT_INCL_COND,
- mod_cond = ?DEFAULT_MOD_COND,
- apps = ?DEFAULT_APPS,
- boot_rel = ?DEFAULT_REL_NAME,
- rels = reltool_utils:default_rels(),
- emu_name = ?DEFAULT_EMU_NAME,
- profile = ?DEFAULT_PROFILE,
- incl_sys_filters = dec_re(incl_sys_filters,
- ?DEFAULT_INCL_SYS_FILTERS,
- []),
- excl_sys_filters = dec_re(excl_sys_filters,
- ?DEFAULT_EXCL_SYS_FILTERS,
- []),
- incl_app_filters = dec_re(incl_app_filters,
- ?DEFAULT_INCL_APP_FILTERS,
- []),
- excl_app_filters = dec_re(excl_app_filters,
- ?DEFAULT_EXCL_APP_FILTERS,
- []),
- relocatable = ?DEFAULT_RELOCATABLE,
- rel_app_type = ?DEFAULT_REL_APP_TYPE,
- embedded_app_type = ?DEFAULT_EMBEDDED_APP_TYPE,
- app_file = ?DEFAULT_APP_FILE,
- incl_archive_filters = dec_re(incl_archive_filters,
- ?DEFAULT_INCL_ARCHIVE_FILTERS,
- []),
- excl_archive_filters = dec_re(excl_archive_filters,
- ?DEFAULT_EXCL_ARCHIVE_FILTERS,
- []),
- archive_opts = ?DEFAULT_ARCHIVE_OPTS,
- debug_info = ?DEFAULT_DEBUG_INFO},
- C2 = #common{sys_debug = [],
- wx_debug = 0,
- trap_exit = true,
- app_tab = AppTab,
- mod_tab = ModTab,
- mod_used_by_tab = ModUsesTab},
- S = #state{options = Opts},
- parse_options(Opts, S, C2, Sys, {ok, []}).
+ S = #state{options = Options,
+ app_tab = AppTab,
+ old_app_tab = OldAppTab,
+ mod_tab = ModTab,
+ old_mod_tab = OldModTab,
+ mod_used_by_tab = ModUsesTab},
+
+ S2 = parse_options(S),
+ {S3, Apps, Status2} = refresh(S2),
+ Status3 = analyse(S3, Apps, Status2),
+ %% Set old_xxx equal to xxx to allow undo=nop
+ FakeBackup = {ets:tab2list(S3#state.app_tab),ets:tab2list(S3#state.mod_tab)},
+ S4 = save_old(S3, S3, FakeBackup, Status3),
+ #state{parent_pid = Parent, sys=Sys, common=C} = S4,
+ proc_lib:init_ack(Parent, {ok, self(), C, Sys#sys{apps=undefined}}),
+ loop(S4).
+
+parse_options(S) ->
+ Sys = default_sys(),
+ C = #common{sys_debug = [],
+ wx_debug = 0,
+ trap_exit = true},
+ parse_options(S#state.options, S, C, Sys).
+
+default_sys() ->
+ #sys{root_dir = reltool_utils:root_dir(),
+ lib_dirs = reltool_utils:erl_libs(),
+ escripts = [],
+ incl_cond = ?DEFAULT_INCL_COND,
+ mod_cond = ?DEFAULT_MOD_COND,
+ apps = ?DEFAULT_APPS,
+ boot_rel = ?DEFAULT_REL_NAME,
+ rels = reltool_utils:default_rels(),
+ emu_name = ?DEFAULT_EMU_NAME,
+ profile = ?DEFAULT_PROFILE,
+ incl_sys_filters = dec_re(incl_sys_filters,
+ ?DEFAULT_INCL_SYS_FILTERS,
+ []),
+ excl_sys_filters = dec_re(excl_sys_filters,
+ ?DEFAULT_EXCL_SYS_FILTERS,
+ []),
+ incl_app_filters = dec_re(incl_app_filters,
+ ?DEFAULT_INCL_APP_FILTERS,
+ []),
+ excl_app_filters = dec_re(excl_app_filters,
+ ?DEFAULT_EXCL_APP_FILTERS,
+ []),
+ relocatable = ?DEFAULT_RELOCATABLE,
+ rel_app_type = ?DEFAULT_REL_APP_TYPE,
+ embedded_app_type = ?DEFAULT_EMBEDDED_APP_TYPE,
+ app_file = ?DEFAULT_APP_FILE,
+ incl_archive_filters = dec_re(incl_archive_filters,
+ ?DEFAULT_INCL_ARCHIVE_FILTERS,
+ []),
+ excl_archive_filters = dec_re(excl_archive_filters,
+ ?DEFAULT_EXCL_ARCHIVE_FILTERS,
+ []),
+ archive_opts = ?DEFAULT_ARCHIVE_OPTS,
+ debug_info = ?DEFAULT_DEBUG_INFO}.
dec_re(Key, Regexps, Old) ->
reltool_utils:decode_regexps(Key, Regexps, Old).
-parse_options([{Key, Val} | KeyVals], S, C, Sys, Status) ->
+parse_options([{Key, Val} | KeyVals], S, C, Sys) ->
case Key of
parent ->
- parse_options(KeyVals, S#state{parent_pid = Val}, C, Sys, Status);
+ parse_options(KeyVals, S#state{parent_pid = Val}, C, Sys);
sys_debug ->
- parse_options(KeyVals, S, C#common{sys_debug = Val}, Sys, Status);
+ parse_options(KeyVals, S, C#common{sys_debug = Val}, Sys);
wx_debug ->
- parse_options(KeyVals, S, C#common{wx_debug = Val}, Sys, Status);
+ parse_options(KeyVals, S, C#common{wx_debug = Val}, Sys);
trap_exit ->
- parse_options(KeyVals, S, C#common{trap_exit = Val}, Sys, Status);
+ parse_options(KeyVals, S, C#common{trap_exit = Val}, Sys);
config ->
- {Sys2, Status2} = read_config(Sys, Val, Status),
- parse_options(KeyVals, S, C, Sys2, Status2);
+ Sys2 = read_config(Sys, Val),
+ parse_options(KeyVals, S, C, Sys2);
sys ->
- {Sys2, Status2} = read_config(Sys, {sys, Val}, Status),
- parse_options(KeyVals, S, C, Sys2, Status2);
+ Sys2 = read_config(Sys, {sys, Val}),
+ parse_options(KeyVals, S, C, Sys2);
_ ->
- Text = lists:flatten(io_lib:format("~p", [{Key, Val}])),
- Status2 =
- reltool_utils:return_first_error(Status,
- "Illegal option: " ++ Text),
- parse_options(KeyVals, S, C, Sys, Status2)
+ reltool_utils:throw_error("Illegal option: ~p", [{Key, Val}])
end;
-parse_options([], S, C, Sys, Status) ->
- {S#state{common = C, sys = Sys}, Status};
-parse_options(KeyVals, S, C, Sys, Status) ->
- Text = lists:flatten(io_lib:format("~p", [KeyVals])),
- Status2 = reltool_utils:return_first_error(Status,
- "Illegal options: " ++ Text),
- {S#state{common = C, sys = Sys}, Status2}.
-
-loop(#state{common = C, sys = Sys} = S) ->
+parse_options([], S, C, Sys) ->
+ S#state{common = C, sys = Sys};
+parse_options(KeyVals, _S, _C, _Sys) ->
+ reltool_utils:throw_error("Illegal option: ~p", [KeyVals]).
+
+loop(#state{sys = Sys} = S) ->
receive
{system, From, Msg} ->
sys:handle_system_msg(Msg,
From,
S#state.parent_pid,
?MODULE,
- C#common.sys_debug,
+ (S#state.common)#common.sys_debug,
S);
{call, ReplyTo, Ref, {get_config, InclDef, InclDeriv}} ->
Reply = do_get_config(S, InclDef, InclDeriv),
reltool_utils:reply(ReplyTo, Ref, Reply),
?MODULE:loop(S);
{call, ReplyTo, Ref, {load_config, SysConfig}} ->
- {S2, Reply} = do_load_config(S, SysConfig),
- reltool_utils:reply(ReplyTo, Ref, Reply),
- ?MODULE:loop(S2);
+ Fun = fun() -> do_load_config(S, SysConfig) end,
+ {S3, Status2} = config_and_refresh(S, Fun),
+ reltool_utils:reply(ReplyTo, Ref, Status2),
+ ?MODULE:loop(S3);
{call, ReplyTo, Ref, {save_config, Filename, InclDef, InclDeriv}} ->
Reply = do_save_config(S, Filename, InclDef, InclDeriv),
reltool_utils:reply(ReplyTo, Ref, Reply),
?MODULE:loop(S);
{call, ReplyTo, Ref, reset_config} ->
- {S2, Status} = parse_options(S#state.options),
- S3 = shrink_sys(S2),
- {S4, Status2} = refresh(S3, true, Status),
- {S5, Status3} = analyse(S4#state{old_sys = S4#state.sys}, Status2),
- S6 =
- case Status3 of
- {ok, _Warnings} ->
- S5#state{status = Status3, old_status = S#state.status};
- {error, _} ->
- %% Keep old state
- S
- end,
- reltool_utils:reply(ReplyTo, Ref, Status3),
- ?MODULE:loop(S6);
+ Fun = fun() -> parse_options(S) end,
+ {S3, Status2} = config_and_refresh(S, Fun),
+ reltool_utils:reply(ReplyTo, Ref, Status2),
+ ?MODULE:loop(S3);
{call, ReplyTo, Ref, undo_config} ->
- reltool_utils:reply(ReplyTo, Ref, ok),
S2 = S#state{sys = S#state.old_sys,
- old_sys = S#state.sys,
- status = S#state.old_status,
- old_status = S#state.status},
+ old_sys = Sys,
+ status = S#state.old_status,
+ old_status = S#state.status,
+ app_tab = S#state.old_app_tab,
+ old_app_tab = S#state.app_tab,
+ mod_tab = S#state.old_mod_tab,
+ old_mod_tab = S#state.mod_tab},
+ reltool_utils:reply(ReplyTo, Ref, ok),
?MODULE:loop(S2);
{call, ReplyTo, Ref, {get_rel, RelName}} ->
- Sys = S#state.sys,
Reply =
case lists:keysearch(RelName, #rel.name, Sys#sys.rels) of
{value, Rel} ->
- reltool_target:gen_rel(Rel, Sys);
+ reltool_target:gen_rel(Rel, sys_all_apps(S));
false ->
{error, "No such release: " ++ RelName}
end,
reltool_utils:reply(ReplyTo, Ref, Reply),
?MODULE:loop(S);
{call, ReplyTo, Ref, {get_script, RelName}} ->
- Sys = S#state.sys,
Reply =
case lists:keysearch(RelName, #rel.name, Sys#sys.rels) of
{value, Rel} ->
PathFlag = true,
Vars = [],
- reltool_target:gen_script(Rel, Sys, PathFlag, Vars);
+ reltool_target:gen_script(Rel, sys_all_apps(S),
+ PathFlag, Vars);
false ->
{error, "No such release: " ++ RelName}
end,
@@ -298,7 +294,7 @@ loop(#state{common = C, sys = Sys} = S) ->
?MODULE:loop(S);
{call, ReplyTo, Ref, {get_mod, ModName}} ->
Reply =
- case ets:lookup(C#common.mod_tab, ModName) of
+ case ets:lookup(S#state.mod_tab, ModName) of
[M] ->
{ok, M};
[] ->
@@ -308,92 +304,83 @@ loop(#state{common = C, sys = Sys} = S) ->
?MODULE:loop(S);
{call, ReplyTo, Ref, {get_app, AppName}} when is_atom(AppName) ->
Reply =
- case lists:keysearch(AppName, #app.name, Sys#sys.apps) of
- {value, App} ->
+ case ets:lookup(S#state.app_tab,AppName) of
+ [App] ->
{ok, App};
- false ->
+ [] ->
{error, "No such application: " ++
atom_to_list(AppName)}
end,
reltool_utils:reply(ReplyTo, Ref, Reply),
?MODULE:loop(S);
{call, ReplyTo, Ref, {set_app, App}} ->
- {S2, Status} = do_set_app(S, App, {ok, []}),
- {S3, Status2} = analyse(S2, Status),
- case Status2 of
- {ok, Warnings} ->
- App2 = ?KEYSEARCH(App#app.name,
- #app.name,
- (S3#state.sys)#sys.apps),
- reltool_utils:reply(ReplyTo, Ref, {ok, App2, Warnings}),
- ?MODULE:loop(S3);
- {error, Reason} ->
- %% Keep old state
- reltool_utils:reply(ReplyTo, Ref, {error, Reason}),
- ?MODULE:loop(S)
- end;
+ Fun = fun() -> do_set_apps(S, [App]) end,
+ {S3, Status2} = config_and_refresh(S, Fun),
+ Reply =
+ case Status2 of
+ {ok, Warnings} ->
+ [App2] = ets:lookup(S3#state.app_tab,App#app.name),
+ {ok, App2, Warnings};
+ {error, _} ->
+ Status2
+ end,
+ reltool_utils:reply(ReplyTo, Ref, Reply),
+ ?MODULE:loop(S3);
{call, ReplyTo, Ref, {get_apps, Kind}} ->
AppNames =
case Kind of
whitelist ->
- [A ||
- A <- Sys#sys.apps,
- A#app.is_pre_included =:= true];
- blacklist ->
- [A ||
- A <- Sys#sys.apps,
- A#app.is_pre_included =:= false];
- source ->
- [A ||
- A <- Sys#sys.apps,
- A#app.is_included =/= true,
- A#app.is_pre_included =/= false];
+ %% Pre-included
+ ets:select(S#state.app_tab,
+ [{#app{is_pre_included=true,_='_'},
+ [],
+ ['$_']}]);
+ blacklist ->
+ %% Pre-excluded
+ ets:select(S#state.app_tab,
+ [{#app{is_pre_included=false,_='_'},
+ [],
+ ['$_']}]);
+ source ->
+ %% Not included and not pre-excluded
+ ets:select(S#state.app_tab,
+ [{#app{is_included='$1',
+ is_pre_included='$2',
+ _='_'},
+ [{'=/=','$1',true},
+ {'=/=','$2',false}],
+ ['$_']}]);
derived ->
- [A ||
- A <- Sys#sys.apps,
- A#app.is_included =:= true,
- A#app.is_pre_included =/= true]
+ %% Included, but not pre-included
+ ets:select(S#state.app_tab,
+ [{#app{is_included='$1',
+ is_pre_included='$2',
+ _='_'},
+ [{'=:=','$1',true},
+ {'=/=','$2',true}],
+ ['$_']}])
end,
reltool_utils:reply(ReplyTo, Ref, {ok, AppNames}),
?MODULE:loop(S);
{call, ReplyTo, Ref, {set_apps, Apps}} ->
- {S2, Status} =
- lists:foldl(fun(A, {X, Y}) -> do_set_app(X, A, Y) end,
- {S, {ok, []}},
- Apps),
- {S3, Status2} = analyse(S2, Status),
+ Fun = fun() -> do_set_apps(S, Apps) end,
+ {S3, Status2} = config_and_refresh(S, Fun),
reltool_utils:reply(ReplyTo, Ref, Status2),
- ?MODULE:loop(S3);
+ ?MODULE:loop(S3);
{call, ReplyTo, Ref, get_sys} ->
reltool_utils:reply(ReplyTo, Ref, {ok, Sys#sys{apps = undefined}}),
?MODULE:loop(S);
{call, ReplyTo, Ref, {set_sys, Sys2}} ->
- S2 = S#state{sys = Sys2#sys{apps = Sys#sys.apps}},
- Force =
- (Sys2#sys.root_dir =/= Sys#sys.root_dir) orelse
- (Sys2#sys.lib_dirs =/= Sys#sys.lib_dirs) orelse
- (Sys2#sys.escripts =/= Sys#sys.escripts),
- {S3, Status} = refresh(S2, Force, {ok, []}),
- {S4, Status2} =
- analyse(S3#state{old_sys = S#state.sys}, Status),
- {S5, Status3} =
- case Status2 of
- {ok, _Warnings} -> % BUGBUG: handle warnings
- {S4#state{status = Status2,
- old_status = S#state.status},
- Status2};
- {error, _} ->
- %% Keep old state
- {S, Status2}
- end,
- reltool_utils:reply(ReplyTo, Ref, Status3),
- ?MODULE:loop(S5);
+ Fun = fun() -> S#state{sys = Sys2#sys{apps = Sys#sys.apps}} end,
+ {S3, Status} = config_and_refresh(S, Fun),
+ reltool_utils:reply(ReplyTo, Ref, Status),
+ ?MODULE:loop(S3);
{call, ReplyTo, Ref, get_status} ->
reltool_utils:reply(ReplyTo, Ref, S#state.status),
?MODULE:loop(S);
{call, ReplyTo, Ref, {gen_rel_files, Dir}} ->
Status =
- case reltool_target:gen_rel_files(S#state.sys, Dir) of
+ case reltool_target:gen_rel_files(sys_all_apps(S), Dir) of
ok ->
{ok, []};
{error, Reason} ->
@@ -402,11 +389,11 @@ loop(#state{common = C, sys = Sys} = S) ->
reltool_utils:reply(ReplyTo, Ref, Status),
?MODULE:loop(S);
{call, ReplyTo, Ref, {gen_target, Dir}} ->
- Reply = reltool_target:gen_target(S#state.sys, Dir),
+ Reply = reltool_target:gen_target(sys_all_apps(S), Dir),
reltool_utils:reply(ReplyTo, Ref, Reply),
?MODULE:loop(S);
{call, ReplyTo, Ref, gen_spec} ->
- Reply = reltool_target:gen_spec(S#state.sys),
+ Reply = reltool_target:gen_spec(sys_all_apps(S)),
reltool_utils:reply(ReplyTo, Ref, Reply),
?MODULE:loop(S);
{'EXIT', Pid, Reason} when Pid =:= S#state.parent_pid ->
@@ -422,101 +409,215 @@ loop(#state{common = C, sys = Sys} = S) ->
?MODULE:loop(S)
end.
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-do_set_app(#state{sys = Sys} = S, App, Status) ->
- AppName = App#app.name,
- {App2, Status2} = refresh_app(App, false, Status),
- Apps = Sys#sys.apps,
- Apps2 = lists:keystore(AppName, #app.name, Apps, App2),
- Escripts = [A#app.active_dir || A <- Apps2, A#app.is_escript],
- Sys2 = Sys#sys{apps = Apps2, escripts = Escripts},
- {S#state{sys = Sys2}, Status2}.
-
-analyse(#state{common = C,
- sys = #sys{apps = Apps0, rels = Rels} = Sys} = S,
- Status) ->
- Apps = lists:keydelete(?MISSING_APP_NAME, #app.name, Apps0),
- ets:delete_all_objects(C#common.app_tab),
- ets:delete_all_objects(C#common.mod_tab),
- ets:delete_all_objects(C#common.mod_used_by_tab),
- MissingApp = default_app(?MISSING_APP_NAME, "missing"),
- ets:insert(C#common.app_tab, MissingApp),
-
- {RevRelApps, Status2} = apps_in_rels(Rels, Apps, Status),
- RelApps2 = lists:reverse(RevRelApps),
- {Apps2, Status3} =
- lists:mapfoldl(fun(App, Acc) ->
- app_init_is_included(C, Sys, App, RelApps2, Acc)
- end,
- Status2,
- Apps),
- Apps3 =
- case app_propagate_is_included(C, Sys, Apps2, []) of
- [] ->
- Apps2;
- MissingMods ->
- %% io:format("Missing mods: ~p\n", [MissingMods]),
- MissingApp2 = MissingApp#app{label = ?MISSING_APP_TEXT,
- info = missing_app_info(""),
- mods = MissingMods,
- status = missing,
- uses_mods = []},
- [MissingApp2 | Apps2]
- end,
- app_propagate_is_used_by(C, Apps3),
- {Apps4,Status4} = app_recap_dependencies(C, Sys, Apps3, [], Status3),
- %% io:format("Missing app: ~p\n",
- %% [lists:keysearch(?MISSING_APP_NAME, #app.name, Apps4)]),
- Sys2 = Sys#sys{apps = Apps4},
-
- case verify_config(RelApps2, Sys2, Status4) of
- {ok, _Warnings} = Status5 ->
- {S#state{sys = Sys2}, Status5};
- {error, _} = Status5 ->
- {S, Status5}
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+do_set_apps(#state{sys = Sys} = S, ChangedApps) ->
+ %% Create new list of configured applications
+ SysApps = app_update_config(ChangedApps, Sys#sys.apps),
+ S#state{sys = Sys#sys{apps = SysApps}}.
+
+%% Re-create the #sys.apps list by
+%% 1) taking configurable fields from the changed #app records and
+%% create new default records
+%% 2) removing #app records if no configurable fields are set
+%% 3) keeping #app records that are not changed
+app_update_config([#app{name=Name,is_escript={inlined,Escript}}|_],_SysApps) ->
+ reltool_utils:throw_error("Application ~p is inlined in ~p. Can not change "
+ "configuration for an inlined application.",
+ [Name,Escript]);
+app_update_config([Config|Configs],SysApps) ->
+ NewSysApps =
+ case app_set_config_only(Config) of
+ {delete,Name} ->
+ lists:keydelete(Name,#app.name,SysApps);
+ New ->
+ lists:ukeymerge(#app.name,[New],SysApps)
+ end,
+ app_update_config(Configs,NewSysApps);
+app_update_config([],SysApps) ->
+ SysApps.
+
+app_set_config_only(#app{mods=ConfigMods} = Config) ->
+ app_set_config_only(mod_set_config_only(ConfigMods),Config).
+
+app_set_config_only([],#app{name = Name,
+ incl_cond = undefined,
+ mod_cond = undefined,
+ use_selected_vsn = undefined,
+ debug_info = undefined,
+ app_file = undefined,
+ app_type = undefined,
+ incl_app_filters = undefined,
+ excl_app_filters = undefined,
+ incl_archive_filters = undefined,
+ excl_archive_filters = undefined,
+ archive_opts = undefined,
+ is_escript = false})->
+ {delete,Name};
+app_set_config_only(Mods,#app{name = Name,
+ incl_cond = InclCond,
+ mod_cond = ModCond,
+ use_selected_vsn = UseSelectedVsn,
+ debug_info = DebugInfo,
+ app_file = AppFile,
+ app_type = AppType,
+ incl_app_filters = InclAppFilters,
+ excl_app_filters = ExclAppFilters,
+ incl_archive_filters = InclArchiveFilters,
+ excl_archive_filters = ExclArchiveFilters,
+ archive_opts = ArchiveOpts,
+ vsn = Vsn,
+ is_escript = IsEscript,
+ label = Label,
+ info = Info,
+ active_dir = ActiveDir,
+ sorted_dirs = SortedDirs}) ->
+ App = (default_app(Name))#app{incl_cond = InclCond,
+ mod_cond = ModCond,
+ use_selected_vsn = UseSelectedVsn,
+ debug_info = DebugInfo,
+ app_file = AppFile,
+ app_type = AppType,
+ incl_app_filters = InclAppFilters,
+ excl_app_filters = ExclAppFilters,
+ incl_archive_filters = InclArchiveFilters,
+ excl_archive_filters = ExclArchiveFilters,
+ archive_opts = ArchiveOpts,
+ vsn = Vsn,
+ mods = Mods},
+
+ if IsEscript ->
+ %% Some fields shall only be set if it is an escript, e.g. label
+ %% must never be set for any other applications since that will
+ %% prevent refreshing.
+ App#app{is_escript = IsEscript,
+ active_dir = ActiveDir,
+ sorted_dirs = SortedDirs,
+ label = Label,
+ info = Info};
+ UseSelectedVsn =:= dir ->
+ %% Must not loose active_dir if it is configured to be used
+ App#app{active_dir = ActiveDir,
+ sorted_dirs = [ActiveDir]};
+ true ->
+ App
end.
-apps_in_rels(Rels, Apps, Status) ->
- lists:foldl(fun(Rel, {RelApps, S}) ->
- {MoreRelApps, S2} = apps_in_rel(Rel, Apps, S),
- {MoreRelApps ++ RelApps, S2}
- end,
- {[], Status},
- Rels).
+mod_set_config_only(ConfigMods) ->
+ [#mod{name = Name,
+ incl_cond = InclCond,
+ debug_info = DebugInfo} ||
+ #mod{name = Name,
+ incl_cond = InclCond,
+ debug_info = DebugInfo} <- ConfigMods,
+ (InclCond =/= undefined) orelse (DebugInfo =/= undefined)].
-apps_in_rel(#rel{name = RelName, rel_apps = RelApps}, Apps, Status) ->
- Mandatory = [{RelName, kernel}, {RelName, stdlib}],
- Other = [{RelName, AppName} ||
- RA <- RelApps,
- AppName <- [RA#rel_app.name | RA#rel_app.incl_apps],
- not lists:keymember(AppName, 2, Mandatory)],
- more_apps_in_rels(Mandatory ++ Other, Apps, [], Status).
-more_apps_in_rels([{RelName, AppName} = RA | RelApps], Apps, Acc, Status) ->
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+analyse(#state{sys=Sys} = S, Apps, Status) ->
+ %% Create a list of {RelName,AppName}, one element for each
+ %% AppName that needs to be included for the given release.
+ RelApps = apps_in_rels(Sys#sys.rels, Apps),
+
+ %% Initiate is_pre_included and is_included for all applications
+ %% based on #sys.incl_cond, #app.incl_cond and if the application
+ %% is included in a release (rel spec - see apps_in_rels above).
+ %% Then initiate the same for each module, and check that there
+ %% are no duplicated module names (in different applications)
+ %% where we can not decide which one to use.
+ %% Write all #app to app_tab and all #mod to mod_tab.
+ Status2 = apps_init_is_included(S, Apps, RelApps, Status),
+
+ %% For each module that has #mod.is_included==true, propagate
+ %% is_included to the modules it uses.
+ propagate_is_included(S),
+
+ %% Insert reverse dependencies - i.e. for each
+ %% #mod{name=Mod, uses_mods=[UsedMod]},
+ %% insert an entry {UsedMod,Mod} in mod_used_by_tab.
+ propagate_is_used_by(S),
+
+ %% Set the above reverse dependencies in #mod records
+ %% (used_by_mods) and accumulate in #app records.
+ %% Make sure #app.is_included is always true if some
+ %% #mod.is_included==true for at least one module in the app.
+ %% Set status=missing|ok for #app and #mod - indicates if module
+ %% (.beam file) is missing in file system.
+ app_recap_dependencies(S),
+
+ %% Check that the boot_rel exists.
+ %% Check that all applications that are listed in a 'rel' spec are
+ %% also really included in the target release.
+ %% Check that all mandatory applications are included in all rels.
+ verify_config(S, RelApps, Status2).
+
+apps_in_rels(Rels, Apps) ->
+ AllRelApps =
+ lists:foldl(fun(Rel, RelApps) ->
+ MoreRelApps = apps_in_rel(Rel, Apps),
+ MoreRelApps ++ RelApps
+ end,
+ [],
+ Rels),
+ lists:reverse(AllRelApps).
+
+apps_in_rel(#rel{name = RelName, rel_apps = RelApps}, Apps) ->
+ Mandatory = [{RelName, kernel}, {RelName, stdlib}],
+ Other =
+ [{RelName, AppName} ||
+ RA <- RelApps,
+ AppName <- [RA#rel_app.name |
+ %% Included applications in rel shall overwrite included
+ %% applications in .app. I.e. included applications in
+ %% .app shall only be used if it is not defined in rel.
+ case RA#rel_app.incl_apps of
+ undefined ->
+ case lists:keyfind(RA#rel_app.name,
+ #app.name,
+ Apps) of
+ #app{info = #app_info{incl_apps = IA}} ->
+ IA;
+ false ->
+ reltool_utils:throw_error(
+ "Release ~p uses non existing "
+ "application ~p",
+ [RelName,RA#rel_app.name])
+ end;
+ IA ->
+ IA
+ end],
+ not lists:keymember(AppName, 2, Mandatory)],
+ more_apps_in_rels(Mandatory ++ Other, Apps, []).
+
+more_apps_in_rels([{RelName, AppName} = RA | RelApps], Apps, Acc) ->
case lists:member(RA, Acc) of
true ->
- more_apps_in_rels(RelApps, Apps, Acc, Status);
+ more_apps_in_rels(RelApps, Apps, Acc);
false ->
case lists:keyfind(AppName, #app.name, Apps) of
#app{info = #app_info{applications = InfoApps}} ->
Extra = [{RelName, N} || N <- InfoApps],
- {Acc2, Status2} =
- more_apps_in_rels(Extra, Apps, [RA | Acc], Status),
- more_apps_in_rels(RelApps, Apps, Acc2, Status2);
+ Acc2 = more_apps_in_rels(Extra, Apps, [RA | Acc]),
+ more_apps_in_rels(RelApps, Apps, Acc2);
false ->
- Text = lists:concat(["Release ", RelName,
- " uses non existing application ",
- AppName]),
- Status2 = reltool_utils:return_first_error(Status, Text),
- more_apps_in_rels(RelApps, Apps, Acc, Status2)
+ reltool_utils:throw_error(
+ "Release ~p uses non existing application ~p",
+ [RelName,AppName])
end
end;
-more_apps_in_rels([], _Apps, Acc, Status) ->
- {Acc, Status}.
+more_apps_in_rels([], _Apps, Acc) ->
+ Acc.
+
+
+apps_init_is_included(S, Apps, RelApps, Status) ->
+ lists:foldl(fun(App, AccStatus) ->
+ app_init_is_included(S, App, RelApps, AccStatus)
+ end,
+ Status,
+ Apps).
-app_init_is_included(C,
- Sys,
+app_init_is_included(#state{app_tab = AppTab, mod_tab = ModTab, sys=Sys},
#app{name = AppName, mods = Mods} = A,
RelApps,
Status) ->
@@ -538,18 +639,16 @@ app_init_is_included(C,
{exclude, []} ->
{undefined, false, false, Status};
{exclude, [RelName | _]} -> % App is included in at least one rel
- Text = lists:concat(["Application ", AppName, " is used "
- "in release ", RelName, " and cannot "
- "be excluded"]),
- TmpStatus = reltool_utils:return_first_error(Status, Text),
- {undefined, false, false, TmpStatus};
+ reltool_utils:throw_error(
+ "Application ~p is used in release ~p and cannot be excluded",
+ [AppName,RelName]);
{derived, []} ->
{undefined, undefined, undefined, Status};
{derived, [_ | _]} -> % App is included in at least one rel
{true, undefined, true, Status}
end,
{Mods2,Status3} = lists:mapfoldl(fun(Mod,Acc) ->
- mod_init_is_included(C,
+ mod_init_is_included(ModTab,
Mod,
ModCond,
AppCond,
@@ -562,10 +661,10 @@ app_init_is_included(C,
is_pre_included = IsPreIncl,
is_included = IsIncl,
rels = Rels},
- ets:insert(C#common.app_tab, A2),
- {A2, Status3}.
+ ets:insert(AppTab, A2),
+ Status3.
-mod_init_is_included(C, M, ModCond, AppCond, Default, Status) ->
+mod_init_is_included(ModTab, M, ModCond, AppCond, Default, Status) ->
%% print(M#mod.name, hipe, "incl_cond -> ~p\n", [AppCond]),
IsIncl =
case AppCond of
@@ -575,6 +674,8 @@ mod_init_is_included(C, M, ModCond, AppCond, Default, Status) ->
true;
exclude ->
false;
+ derived ->
+ undefined;
undefined ->
%% print(M#mod.name, hipe, "mod_cond -> ~p\n",
%% [ModCond]),
@@ -594,6 +695,8 @@ mod_init_is_included(C, M, ModCond, AppCond, Default, Status) ->
true;
exclude ->
false;
+ derived ->
+ undefined;
undefined ->
Default
end
@@ -602,43 +705,33 @@ mod_init_is_included(C, M, ModCond, AppCond, Default, Status) ->
M2 = M#mod{is_pre_included = IsIncl, is_included = IsIncl},
Status2 =
- case ets:lookup(C#common.mod_tab,M#mod.name) of
+ case ets:lookup(ModTab,M#mod.name) of
[Existing] ->
case {Existing#mod.is_included,IsIncl} of
{false,_} ->
- Warning =
- lists:concat(
- ["Module ",M#mod.name,
- " exists in applications ", Existing#mod.app_name,
- " and ", M#mod.app_name,
- ". Using module from application ",
- M#mod.app_name, "."]),
- ets:insert(C#common.mod_tab, M2),
- reltool_utils:add_warning(Status,Warning);
+ ets:insert(ModTab, M2),
+ reltool_utils:add_warning(
+ "Module ~p exists in applications ~p and ~p. "
+ "Using module from application ~p.",
+ [M#mod.name, Existing#mod.app_name,
+ M#mod.app_name, M#mod.app_name],
+ Status);
{_,false} ->
- Warning =
- lists:concat(
- ["Module ",M#mod.name,
- " exists in applications ", Existing#mod.app_name,
- " and ", M#mod.app_name,
- ". Using module from application ",
- Existing#mod.app_name, "."]),
-
- %% Don't insert in mod_tab - using Existing
- reltool_utils:add_warning(Status,Warning);
+ %% Don't insert in ModTab - using Existing
+ reltool_utils:add_warning(
+ "Module ~p exists in applications ~p and ~p. "
+ "Using module from application ~p.",
+ [M#mod.name, Existing#mod.app_name,
+ M#mod.app_name,Existing#mod.app_name],
+ Status);
{_,_} ->
- Error =
- lists:concat(
- ["Module ",M#mod.name,
- " potentially included by ",
- "two different applications: ",
- Existing#mod.app_name, " and ",
- M#mod.app_name, "."]),
- %% Don't insert in mod_tab - using Existing
- reltool_utils:return_first_error(Status,Error)
+ reltool_utils:throw_error(
+ "Module ~p potentially included by two different "
+ "applications: ~p and ~p.",
+ [M#mod.name,Existing#mod.app_name,M#mod.app_name])
end;
[] ->
- ets:insert(C#common.mod_tab, M2),
+ ets:insert(ModTab, M2),
Status
end,
@@ -651,76 +744,59 @@ false_to_undefined(Bool) ->
_ -> Bool
end.
-app_propagate_is_included(C, Sys, [#app{mods = Mods} = A | Apps], Acc) ->
- Acc2 = mod_propagate_is_included(C, Sys, A, Mods, Acc),
- app_propagate_is_included(C, Sys, Apps, Acc2);
-app_propagate_is_included(_C, _Sys, [], Acc) ->
- Acc.
-
-mod_propagate_is_included(C, Sys, A, [#mod{name = ModName} | Mods], Acc) ->
- Acc2 =
- case ets:lookup(C#common.mod_tab, ModName) of
- [M2] when M2#mod.app_name=:=A#app.name ->
- %% print(ModName, file, "Maybe Prop ~p -> ~p\n",
- %% [M2, M2#mod.is_included]),
- %% print(ModName, filename, "Maybe Prop ~p -> ~p\n",
- %% [M2, M2#mod.is_included]),
- case M2#mod.is_included of
- true ->
- %% Propagate include mark
- mod_mark_is_included(C,Sys,ModName,M2#mod.uses_mods,Acc);
- false ->
- Acc;
- undefined ->
- Acc
- end;
- [_] ->
- %% This module is currently used from a different application
- %% Ignore
- Acc
- end,
- mod_propagate_is_included(C, Sys, A, Mods, Acc2);
-mod_propagate_is_included(_C, _Sys, _A, [], Acc) ->
- Acc.
+%% Return the list for {ModName, UsesModNames} for all modules where
+%% #mod.is_included==true.
+get_all_mods_and_dependencies(S) ->
+ ets:select(S#state.mod_tab, [{#mod{name='$1',
+ uses_mods='$2',
+ is_included=true,
+ _='_'},
+ [],
+ [{{'$1','$2'}}]}]).
+
+propagate_is_included(S) ->
+ case lists:flatmap(
+ fun({ModName,UsesModNames}) ->
+ mod_mark_is_included(S,ModName,UsesModNames,[])
+ end,
+ get_all_mods_and_dependencies(S)) of
+ [] ->
+ ok;
+ MissingMods ->
+ MissingApp = default_app(?MISSING_APP_NAME, "missing"),
+ MissingApp2 = MissingApp#app{label = ?MISSING_APP_TEXT,
+ info = missing_app_info(""),
+ mods = MissingMods,
+ status = missing,
+ uses_mods = []},
+ ets:insert(S#state.app_tab, MissingApp2),
+ ok
+ end.
-mod_mark_is_included(C, Sys, UsedByName, [ModName | ModNames], Acc) ->
+mod_mark_is_included(#state{app_tab=AppTab, mod_tab=ModTab, sys=Sys} = S,
+ UsedByName, [ModName | ModNames], Acc) ->
Acc3 =
- case ets:lookup(C#common.mod_tab, ModName) of
+ case ets:lookup(ModTab, ModName) of
[M] ->
- %% print(UsedByName, file, "Maybe Mark ~p -> ~p\n",
- %% [M, M#mod.is_included]),
- %% print(UsedByName, filename, "Maybe Mark ~p -> ~p\n",
- %% [M, M#mod.is_included]),
case M#mod.is_included of
- true ->
- %% Already marked
- Acc;
- false ->
- %% Already marked
- Acc;
undefined ->
- %% Mark and propagate
+ %% Not yet marked => mark and propagate
M2 =
case M#mod.incl_cond of
include ->
M#mod{is_pre_included = true,
is_included = true};
exclude ->
- M#mod{is_pre_included = true,
- is_included = true};
- undefined ->
+ M#mod{is_pre_included = false,
+ is_included = false};
+ ModInclCond when ModInclCond==undefined;
+ ModInclCond==derived ->
M#mod{is_included = true}
end,
- ets:insert(C#common.mod_tab, M2),
- %% io:format("Propagate mod: ~p -> ~p (~p)\n",
- %% [UsedByName, ModName, M#mod.incl_cond]),
- [A] = ets:lookup(C#common.app_tab, M2#mod.app_name),
+ ets:insert(ModTab, M2),
+ [A] = ets:lookup(AppTab, M2#mod.app_name),
Acc2 =
case A#app.is_included of
- true ->
- Acc;
- false ->
- Acc;
undefined ->
ModCond =
case A#app.mod_cond of
@@ -738,63 +814,50 @@ mod_mark_is_included(C, Sys, UsedByName, [ModName | ModNames], Acc) ->
end
end,
Mods = lists:filter(Filter, A#app.mods),
- %% io:format("Propagate app: ~p ~p -> ~p\n",
- %% [UsedByName, A#app.name,
- %% [M3#mod.name || M3 <- Mods]]),
A2 = A#app{is_included = true},
- ets:insert(C#common.app_tab, A2),
- mod_mark_is_included(C,
- Sys,
+ ets:insert(AppTab, A2),
+ mod_mark_is_included(S,
ModName,
[M3#mod.name ||
M3 <- Mods],
- Acc)
+ Acc);
+ _ ->
+ %% Already marked true or false
+ Acc
end,
- mod_mark_is_included(C,
- Sys,
- ModName,
- M2#mod.uses_mods,
- Acc2)
+ mod_mark_is_included(S, ModName, M2#mod.uses_mods, Acc2);
+ _ ->
+ %% Already marked true or false
+ Acc
end;
[] ->
M = missing_mod(ModName, ?MISSING_APP_NAME),
M2 = M#mod{is_included = true},
- ets:insert(C#common.mod_tab, M2),
- ets:insert(C#common.mod_used_by_tab, {UsedByName, ModName}),
+ ets:insert(ModTab, M2),
[M2 | Acc]
end,
- mod_mark_is_included(C, Sys, UsedByName, ModNames, Acc3);
-mod_mark_is_included(_C, _Sys, _UsedByName, [], Acc) ->
+ mod_mark_is_included(S, UsedByName, ModNames, Acc3);
+mod_mark_is_included(_S, _UsedByName, [], Acc) ->
Acc.
-app_propagate_is_used_by(C, [#app{mods = Mods, name = Name} | Apps]) ->
- case Name =:= ?MISSING_APP_NAME of
- true -> ok;
- false -> ok
- end,
- mod_propagate_is_used_by(C, Mods),
- app_propagate_is_used_by(C, Apps);
-app_propagate_is_used_by(_C, []) ->
- ok.
+propagate_is_used_by(S) ->
+ lists:foreach(
+ fun({Mod,UsesMods}) ->
+ lists:foreach(
+ fun(UsedMod) ->
+ ets:insert(S#state.mod_used_by_tab,{UsedMod,Mod})
+ end,
+ UsesMods)
+ end,
+ get_all_mods_and_dependencies(S)).
-mod_propagate_is_used_by(C, [#mod{name = ModName} | Mods]) ->
- [M] = ets:lookup(C#common.mod_tab, ModName),
- case M#mod.is_included of
- true ->
- [ets:insert(C#common.mod_used_by_tab, {UsedModName, ModName}) ||
- UsedModName <- M#mod.uses_mods];
- false ->
- ignore;
- undefined ->
- ignore
- end,
- mod_propagate_is_used_by(C, Mods);
-mod_propagate_is_used_by(_C, []) ->
- ok.
-app_recap_dependencies(C, Sys, [#app{mods = Mods, is_included = IsIncl} = A | Apps], Acc, Status) ->
- {Mods2, IsIncl2, Status2} =
- mod_recap_dependencies(C, Sys, A, Mods, [], IsIncl, Status),
+app_recap_dependencies(S) ->
+ ets:foldl(fun(App,_) -> app_recap_dependencies(S,App) end,
+ ok, S#state.app_tab).
+
+app_recap_dependencies(S, #app{mods = Mods, is_included = IsIncl} = A) ->
+ {Mods2, IsIncl2} = mod_recap_dependencies(S, A, Mods, [], IsIncl),
AppStatus =
case lists:keymember(missing, #mod.status, Mods2) of
true -> missing;
@@ -803,12 +866,12 @@ app_recap_dependencies(C, Sys, [#app{mods = Mods, is_included = IsIncl} = A | Ap
UsesMods = [M#mod.uses_mods || M <- Mods2, M#mod.is_included =:= true],
UsesMods2 = lists:usort(lists:flatten(UsesMods)),
UsesApps = [M#mod.app_name || ModName <- UsesMods2,
- M <- ets:lookup(C#common.mod_tab, ModName)],
+ M <- ets:lookup(S#state.mod_tab, ModName)],
UsesApps2 = lists:usort(UsesApps),
UsedByMods = [M#mod.used_by_mods || M <- Mods2, M#mod.is_included =:= true],
UsedByMods2 = lists:usort(lists:flatten(UsedByMods)),
UsedByApps = [M#mod.app_name || ModName <- UsedByMods2,
- M <- ets:lookup(C#common.mod_tab, ModName)],
+ M <- ets:lookup(S#state.mod_tab, ModName)],
UsedByApps2 = lists:usort(UsedByApps),
A2 = A#app{mods = Mods2,
@@ -818,13 +881,11 @@ app_recap_dependencies(C, Sys, [#app{mods = Mods, is_included = IsIncl} = A | Ap
uses_apps = UsesApps2,
used_by_apps = UsedByApps2,
is_included = IsIncl2},
- ets:insert(C#common.app_tab,A2),
- app_recap_dependencies(C, Sys, Apps, [A2 | Acc], Status2);
-app_recap_dependencies(_C, _Sys, [], Acc, Status) ->
- {lists:reverse(Acc), Status}.
+ ets:insert(S#state.app_tab,A2),
+ ok.
-mod_recap_dependencies(C, Sys, A, [#mod{name = ModName}=M1 | Mods], Acc, IsIncl, Status) ->
- case ets:lookup(C#common.mod_tab, ModName) of
+mod_recap_dependencies(S, A, [#mod{name = ModName}=M1 | Mods], Acc, IsIncl) ->
+ case ets:lookup(S#state.mod_tab, ModName) of
[M2] when M2#mod.app_name=:=A#app.name ->
ModStatus = do_get_status(M2),
%% print(M2#mod.name, hipe, "status -> ~p\n", [ModStatus]),
@@ -832,32 +893,28 @@ mod_recap_dependencies(C, Sys, A, [#mod{name = ModName}=M1 | Mods], Acc, IsIncl,
case M2#mod.is_included of
true ->
UsedByMods =
- [N || {_, N} <- ets:lookup(C#common.mod_used_by_tab,
+ [N || {_, N} <- ets:lookup(S#state.mod_used_by_tab,
ModName)],
{true, M2#mod{status = ModStatus, used_by_mods = UsedByMods}};
_ ->
{IsIncl, M2#mod{status = ModStatus, used_by_mods = []}}
end,
- ets:insert(C#common.mod_tab, M3),
- mod_recap_dependencies(C, Sys, A, Mods, [M3 | Acc], IsIncl2, Status);
+ ets:insert(S#state.mod_tab, M3),
+ mod_recap_dependencies(S, A, Mods, [M3 | Acc], IsIncl2);
[_] when A#app.is_included==false; M1#mod.incl_cond==exclude ->
%% App is explicitely excluded so it is ok that the module
%% record does not exist for this module in this
%% application.
- mod_recap_dependencies(C, Sys, A, Mods, [M1 | Acc], IsIncl, Status);
+ mod_recap_dependencies(S, A, Mods, [M1 | Acc], IsIncl);
[M2] ->
%% A module is potensially included by multiple
%% applications. This is not allowed!
- Error =
- lists:concat(
- ["Module ",ModName,
- " potentially included by two different applications: ",
- A#app.name, " and ", M2#mod.app_name, "."]),
- Status2 = reltool_utils:return_first_error(Status,Error),
- mod_recap_dependencies(C, Sys, A, Mods, [M1 | Acc], IsIncl, Status2)
+ reltool_utils:throw_error(
+ "Module ~p potentially included by two different applications: "
+ "~p and ~p", [ModName,A#app.name, " and ", M2#mod.app_name, "."])
end;
-mod_recap_dependencies(_C, _Sys, _A, [], Acc, IsIncl, Status) ->
- {lists:reverse(Acc), IsIncl, Status}.
+mod_recap_dependencies(_S, _A, [], Acc, IsIncl) ->
+ {lists:reverse(Acc), IsIncl}.
do_get_status(M) ->
if
@@ -867,48 +924,49 @@ do_get_status(M) ->
ok
end.
-shrink_sys(#state{sys = #sys{apps = Apps} = Sys} = S) ->
- Apps2 = lists:zf(fun filter_app/1, Apps),
- S#state{sys = Sys#sys{apps = Apps2}}.
-
-filter_app(A) ->
- Mods = [M#mod{is_app_mod = undefined,
- is_ebin_mod = undefined,
- uses_mods = undefined,
- exists = false} ||
- M <- A#app.mods,
- M#mod.incl_cond =/= undefined],
- if
- A#app.is_escript ->
- {true, A#app{vsn = undefined,
- label = undefined,
- info = undefined,
- mods = [],
- uses_mods = undefined}};
- Mods =:= [],
- A#app.mod_cond =:= undefined,
- A#app.incl_cond =:= undefined,
- A#app.use_selected_vsn =:= undefined ->
- false;
+verify_config(#state{app_tab=AppTab, sys=#sys{boot_rel = BootRel, rels = Rels}},
+ RelApps, Status) ->
+ case lists:keymember(BootRel, #rel.name, Rels) of
true ->
- {Dir, Dirs, OptVsn} =
- case A#app.use_selected_vsn of
- undefined ->
- {shrinked, [], undefined};
- false ->
- {shrinked, [], undefined};
- true ->
- {A#app.active_dir, [A#app.active_dir], A#app.vsn}
- end,
- {true, A#app{active_dir = Dir,
- sorted_dirs = Dirs,
- vsn = OptVsn,
- label = undefined,
- info = undefined,
- mods = Mods,
- uses_mods = undefined}}
+ Status2 = lists:foldl(fun(RA, Acc) ->
+ check_app(AppTab, RA, Acc) end,
+ Status,
+ RelApps),
+ lists:foldl(fun(#rel{name = RelName}, Acc)->
+ check_rel(RelName, RelApps, Acc)
+ end,
+ Status2,
+ Rels);
+ false ->
+ reltool_utils:throw_error(
+ "Release ~p is mandatory (used as boot_rel)",[BootRel])
end.
+check_app(AppTab, {RelName, AppName}, Status) ->
+ case ets:lookup(AppTab, AppName) of
+ [#app{is_pre_included=IsPreIncl, is_included=IsIncl}]
+ when IsPreIncl; IsIncl ->
+ Status;
+ _ ->
+ reltool_utils:throw_error(
+ "Release ~p uses non included application ~p",[RelName,AppName])
+ end.
+
+check_rel(RelName, RelApps, Status) ->
+ EnsureApp =
+ fun(AppName, Acc) ->
+ case lists:member({RelName, AppName}, RelApps) of
+ true ->
+ Acc;
+ false ->
+ reltool_utils:throw_error(
+ "Mandatory application ~p is not included in "
+ "release ~p", [AppName,RelName])
+ end
+ end,
+ Mandatory = [kernel, stdlib],
+ lists:foldl(EnsureApp, Status, Mandatory).
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
refresh_app(#app{name = AppName,
@@ -926,7 +984,7 @@ refresh_app(#app{name = AppName,
%% Add info from .app file
Base = get_base(AppName, ActiveDir),
- {_, DefaultVsn} = reltool_utils:split_app_name(Base),
+ DefaultVsn = get_vsn_from_dir(AppName,Base),
Ebin = filename:join([ActiveDir, "ebin"]),
AppFile =
filename:join([Ebin,
@@ -937,30 +995,57 @@ refresh_app(#app{name = AppName,
AppName,
DefaultVsn,
Status),
+
+ %% And read all modules from ebin and create
+ %% #mod record with dependencies (uses_mods).
{AI, read_ebin_mods(Ebin, AppName), Status2};
- true ->
+ _ ->
{App#app.info, Mods, Status}
end,
- %% Add non-existing modules
- AppInfoMods = AppInfo#app_info.modules,
- AppModNames =
- case AppInfo#app_info.mod of
- {StartModName, _} ->
- case lists:member(StartModName, AppInfoMods) of
- true -> AppInfoMods;
- false -> [StartModName | AppInfoMods]
- end;
- undefined ->
- AppInfoMods
- end,
- MissingMods = add_missing_mods(AppName, EbinMods, AppModNames),
+ %% Add non-existing modules - i.e. create default #mod
+ %% records for all modules that are listed in .app file
+ %% but do not exist in ebin.
+ AppInfoMods = lists:usort(AppInfo#app_info.modules),
+ Status4 =
+ case AppInfo#app_info.modules -- AppInfoMods of
+ [] ->
+ Status3;
+ DuplicatedMods ->
+ lists:foldl(
+ fun(M,S) ->
+ reltool_utils:add_warning(
+ "Module ~p duplicated in app file for "
+ "application ~p.", [M, AppName], S)
+ end,
+ Status3,
+ DuplicatedMods)
+ end,
+ AppModNames =
+ case AppInfo#app_info.mod of
+ {StartModName, _} ->
+ case lists:member(StartModName, AppInfoMods) of
+ true -> AppInfoMods;
+ false -> [StartModName | AppInfoMods]
+ end;
+ undefined ->
+ AppInfoMods
+ end,
+ MissingMods = add_missing_mods(AppName, EbinMods, AppModNames),
- %% Add optional user config for each module
+ %% Add optional user config for each module.
+ %% The #mod records that are already in the #app record at
+ %% this point do only contain user defined configuration
+ %% (set by parse_options/4). So here we merge with the
+ %% default records from above.
Mods2 = add_mod_config(MissingMods ++ EbinMods, Mods),
- %% Set app flag for each module in app file
+ %% Set app flag for each module in app file, i.e. the flag
+ %% which indicates if the module is listed in the .app
+ %% file or not. The start module also get the flag set to true.
Mods3 = set_mod_flags(Mods2, AppModNames),
+
+ %% Finally, set label and update the #app record
AppVsn = AppInfo#app_info.vsn,
AppLabel =
case AppVsn of
@@ -971,7 +1056,7 @@ refresh_app(#app{name = AppName,
label = AppLabel,
info = AppInfo,
mods = lists:keysort(#mod.name, Mods3)},
- {App2, Status3};
+ {App2, Status4};
true ->
{App, Status}
end.
@@ -988,22 +1073,21 @@ read_app_info(AppFileOrBin, AppFile, AppName, DefaultVsn, Status) ->
AI = #app_info{vsn = DefaultVsn},
parse_app_info(AppFile, Info, AI, Status);
{ok, _BadApp} ->
- Text = lists:concat([AppName,
- ": Illegal contents in app file ", AppFile,
- ", application tuple with arity 3 expected."]),
{missing_app_info(DefaultVsn),
- reltool_utils:add_warning(Status, Text)};
+ reltool_utils:add_warning("~p: Illegal contents in app file ~p, "
+ "application tuple with arity 3 expected.",
+ [AppName,AppFile],
+ Status)};
{error, Text} when Text =:= EnoentText ->
- Text2 = lists:concat([AppName,
- ": Missing app file ", AppFile, "."]),
{missing_app_info(DefaultVsn),
- reltool_utils:add_warning(Status, Text2)};
+ reltool_utils:add_warning("~p: Missing app file ~p.",
+ [AppName,AppFile],
+ Status)};
{error, Text} ->
- Text2 = lists:concat([AppName,
- ": Cannot parse app file ",
- AppFile, " (", Text, ")."]),
{missing_app_info(DefaultVsn),
- reltool_utils:add_warning(Status, Text2)}
+ reltool_utils:add_warning("~p: Cannot parse app file ~p (~p).",
+ [AppName,AppFile,Text],
+ Status)}
end.
parse_app_info(File, [{Key, Val} | KeyVals], AI, Status) ->
@@ -1037,10 +1121,11 @@ parse_app_info(File, [{Key, Val} | KeyVals], AI, Status) ->
parse_app_info(File, KeyVals, AI#app_info{start_phases = Val},
Status);
_ ->
- String = lists:concat(["Unexpected item ",
- Key, "in app file ", File]),
- parse_app_info(File, KeyVals, AI,
- reltool_utils:add_warning(Status, String))
+ Status2 =
+ reltool_utils:add_warning("Unexpected item ~p in app file ~p.",
+ [Key,File],
+ Status),
+ parse_app_info(File, KeyVals, AI, Status2)
end;
parse_app_info(_, [], AI, Status) ->
{AI, Status}.
@@ -1171,12 +1256,54 @@ set_mod_flags(Mods, AppModNames) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
do_get_config(S, InclDef, InclDeriv) ->
- S2 =
+ AppTab = S#state.app_tab,
+ Sys =
case InclDeriv of
- false -> shrink_sys(S);
- true -> S
+ false ->
+ %% Only the apps that exist in #sys.apps shall be
+ %% included,and they shall be minimized
+ Apps = [shrink_app(App) ||
+ #app{name=Name} <- (S#state.sys)#sys.apps,
+ App <- ets:lookup(AppTab,Name)],
+ (S#state.sys)#sys{apps=Apps};
+ true ->
+ sys_all_apps(S)
end,
- reltool_target:gen_config(S2#state.sys, InclDef).
+ reltool_target:gen_config(Sys, InclDef).
+
+shrink_app(A) ->
+ Mods = [M#mod{is_app_mod = undefined,
+ is_ebin_mod = undefined,
+ uses_mods = undefined,
+ exists = false} ||
+ M <- A#app.mods,
+ M#mod.incl_cond =/= undefined],
+ if
+ A#app.is_escript ->
+ A#app{vsn = undefined,
+ label = undefined,
+ info = undefined,
+ mods = [],
+ uses_mods = undefined};
+ true ->
+ {Dir, Dirs, OptVsn} =
+ case A#app.use_selected_vsn of
+ undefined ->
+ {undefined, [], undefined};
+ vsn ->
+ {undefined, [], A#app.vsn};
+ dir ->
+ {A#app.active_dir, [A#app.active_dir], undefined}
+ end,
+ A#app{active_dir = Dir,
+ sorted_dirs = Dirs,
+ vsn = OptVsn,
+ label = undefined,
+ info = undefined,
+ mods = Mods,
+ uses_mods = undefined}
+ end.
+
do_save_config(S, Filename, InclDef, InclDeriv) ->
{ok, Config} = do_get_config(S, InclDef, InclDeriv),
@@ -1187,132 +1314,83 @@ do_save_config(S, Filename, InclDef, InclDeriv) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
do_load_config(S, SysConfig) ->
- OldSys = S#state.sys,
- S2 = shrink_sys(S),
- ShrinkedSys = S2#state.sys,
- {NewSys, Status} =
- read_config(ShrinkedSys#sys{apps = []}, SysConfig, {ok, []}),
- case Status of
- {ok, _Warnings} ->
- Force = false,
- {MergedSys, Status2} = merge_config(OldSys, NewSys, Force, Status),
- {S3, Status3} =
- analyse(S2#state{sys = MergedSys, old_sys = OldSys}, Status2),
- S4 =
- case Status3 of
- {ok, _Warnings2} ->
- S3#state{status = Status3, old_status = S#state.status};
- {error, _} ->
- %% Keep old state
- S
- end,
- {S4, Status3};
- {error, _} ->
- %% Keep old state
- {S, Status}
- end.
+ S#state{sys = read_config(default_sys(), SysConfig)}.
-read_config(OldSys, Filename, Status) when is_list(Filename) ->
+read_config(OldSys, Filename) when is_list(Filename) ->
case file:consult(Filename) of
{ok, [SysConfig | _]} ->
- read_config(OldSys, SysConfig, Status);
+ read_config(OldSys, SysConfig);
{ok, Content} ->
- Text = lists:flatten(io_lib:format("~p", [Content])),
- {OldSys,
- reltool_utils:return_first_error(Status,
- "Illegal file content: " ++
- Text)};
+ reltool_utils:throw_error("Illegal file content: ~p",[Content]);
{error, Reason} ->
- Text = file:format_error(Reason),
- {OldSys,
- reltool_utils:return_first_error(Status,
- "Illegal config file " ++
- Filename ++ ": " ++ Text)}
+ reltool_utils:throw_error("Illegal config file ~p: ~s",
+ [Filename,file:format_error(Reason)])
end;
-read_config(OldSys, {sys, KeyVals}, Status) ->
- {NewSys, Status2} =
- decode(OldSys#sys{apps = [], rels = []}, KeyVals, Status),
- case Status2 of
- {ok, _Warnings} -> % BUGBUG: handle warnings
- Apps = [A#app{mods = lists:sort(A#app.mods)} ||
- A <- NewSys#sys.apps],
- case NewSys#sys.rels of
- [] -> Rels = reltool_utils:default_rels();
- Rels -> ok
- end,
- NewSys2 = NewSys#sys{apps = lists:sort(Apps),
- rels = lists:sort(Rels)},
- case lists:keymember(NewSys2#sys.boot_rel,
- #rel.name,
- NewSys2#sys.rels) of
- true ->
- {NewSys2, Status2};
- false ->
- Text2 = lists:concat(["Release " ++ NewSys2#sys.boot_rel,
- " is mandatory (used as boot_rel)"]),
- {OldSys, reltool_utils:return_first_error(Status2, Text2)}
- end;
- {error, _} ->
- %% Keep old state
- {OldSys, Status2}
+read_config(OldSys, {sys, KeyVals}) ->
+ NewSys = decode(OldSys#sys{apps = [], rels = []}, KeyVals),
+ Apps = [A#app{mods = lists:sort(A#app.mods)} || A <- NewSys#sys.apps],
+ Rels =
+ case NewSys#sys.rels of
+ [] -> reltool_utils:default_rels();
+ Rs -> Rs
+ end,
+ NewSys2 = NewSys#sys{apps = lists:sort(Apps),
+ rels = lists:sort(Rels)},
+ case lists:keymember(NewSys2#sys.boot_rel, #rel.name, NewSys2#sys.rels) of
+ true ->
+ NewSys2;
+ false ->
+ reltool_utils:throw_error(
+ "Release ~p is mandatory (used as boot_rel)",
+ [NewSys2#sys.boot_rel])
end;
-read_config(OldSys, BadConfig, Status) ->
- Text = lists:flatten(io_lib:format("~p", [BadConfig])),
- {OldSys,
- reltool_utils:return_first_error(Status, "Illegal content: " ++ Text)}.
+read_config(_OldSys, BadConfig) ->
+ reltool_utils:throw_error("Illegal content: ~p", [BadConfig]).
-decode(#sys{apps = Apps} = Sys, [{erts = Name, AppKeyVals} | SysKeyVals],
- Status)
+decode(#sys{apps = Apps} = Sys, [{erts = Name, AppKeyVals} | SysKeyVals])
when is_atom(Name), is_list(AppKeyVals) ->
App = default_app(Name),
- {App2, Status2} = decode(App, AppKeyVals, Status),
- decode(Sys#sys{apps = [App2 | Apps]}, SysKeyVals, Status2);
-decode(#sys{apps = Apps} = Sys, [{app, Name, AppKeyVals} | SysKeyVals], Status)
+ App2= decode(App, AppKeyVals),
+ decode(Sys#sys{apps = [App2 | Apps]}, SysKeyVals);
+decode(#sys{apps = Apps} = Sys, [{app, Name, AppKeyVals} | SysKeyVals])
when is_atom(Name), is_list(AppKeyVals) ->
App = default_app(Name),
- {App2, Status2} = decode(App, AppKeyVals, Status),
- decode(Sys#sys{apps = [App2 | Apps]}, SysKeyVals, Status2);
+ App2 = decode(App, AppKeyVals),
+ decode(Sys#sys{apps = [App2 | Apps]}, SysKeyVals);
decode(#sys{apps = Apps, escripts = Escripts} = Sys,
- [{escript, File, AppKeyVals} | SysKeyVals], Status)
- when is_list(File), is_list(AppKeyVals) ->
- {Name, Label} = split_escript_name(File),
- App = default_app(Name, File),
- App2 = App#app{is_escript = true,
- label = Label,
- info = missing_app_info(""),
- active_dir = File,
- sorted_dirs = [File]},
- {App3, Status2} = decode(App2, AppKeyVals, Status),
- decode(Sys#sys{apps = [App3 | Apps], escripts = [File | Escripts]},
- SysKeyVals,
- Status2);
-decode(#sys{rels = Rels} = Sys, [{rel, Name, Vsn, RelApps} | SysKeyVals],
- Status)
+ [{escript, File0, AppKeyVals} | SysKeyVals])
+ when is_list(File0), is_list(AppKeyVals) ->
+ File = filename:absname(File0),
+ App = default_escript_app(File),
+ App2 = decode(App, AppKeyVals),
+ decode(Sys#sys{apps = [App2 | Apps], escripts = [File | Escripts]},
+ SysKeyVals);
+decode(#sys{rels = Rels} = Sys, [{rel, Name, Vsn, RelApps} | SysKeyVals])
when is_list(Name), is_list(Vsn), is_list(RelApps) ->
Rel = #rel{name = Name, vsn = Vsn, rel_apps = []},
- {Rel2, Status2} = decode(Rel, RelApps, Status),
- decode(Sys#sys{rels = [Rel2 | Rels]}, SysKeyVals, Status2);
-decode(#sys{} = Sys, [{Key, Val} | KeyVals], Status) ->
- {Sys3, Status3} =
+ Rel2 = decode(Rel, RelApps),
+ decode(Sys#sys{rels = [Rel2 | Rels]}, SysKeyVals);
+decode(#sys{} = Sys, [{Key, Val} | KeyVals]) ->
+ Sys3 =
case Key of
root_dir when is_list(Val) ->
- {Sys#sys{root_dir = Val}, Status};
+ Sys#sys{root_dir = Val};
lib_dirs when is_list(Val) ->
- {Sys#sys{lib_dirs = Val}, Status};
+ Sys#sys{lib_dirs = Val};
mod_cond when Val =:= all;
Val =:= app;
Val =:= ebin;
Val =:= derived;
Val =:= none ->
- {Sys#sys{mod_cond = Val}, Status};
+ Sys#sys{mod_cond = Val};
incl_cond when Val =:= include;
Val =:= exclude;
Val =:= derived ->
- {Sys#sys{incl_cond = Val}, Status};
+ Sys#sys{incl_cond = Val};
boot_rel when is_list(Val) ->
- {Sys#sys{boot_rel = Val}, Status};
+ Sys#sys{boot_rel = Val};
emu_name when is_list(Val) ->
- {Sys#sys{emu_name = Val}, Status};
+ Sys#sys{emu_name = Val};
profile when Val =:= development;
Val =:= embedded;
Val =:= standalone ->
@@ -1321,198 +1399,169 @@ decode(#sys{} = Sys, [{Key, Val} | KeyVals], Status) ->
InclApp = reltool_utils:choose_default(incl_app_filters, Val, false),
ExclApp = reltool_utils:choose_default(excl_app_filters, Val, false),
AppType = reltool_utils:choose_default(embedded_app_type, Val, false),
- {Sys#sys{profile = Val,
- incl_sys_filters = dec_re(incl_sys_filters,
- InclSys,
- Sys#sys.incl_sys_filters),
- excl_sys_filters = dec_re(excl_sys_filters,
- ExclSys,
- Sys#sys.excl_sys_filters),
- incl_app_filters = dec_re(incl_app_filters,
- InclApp,
- Sys#sys.incl_app_filters),
- excl_app_filters = dec_re(excl_app_filters,
- ExclApp,
- Sys#sys.excl_app_filters),
- embedded_app_type = AppType},
- Status};
+ Sys#sys{profile = Val,
+ incl_sys_filters = dec_re(incl_sys_filters,
+ InclSys,
+ Sys#sys.incl_sys_filters),
+ excl_sys_filters = dec_re(excl_sys_filters,
+ ExclSys,
+ Sys#sys.excl_sys_filters),
+ incl_app_filters = dec_re(incl_app_filters,
+ InclApp,
+ Sys#sys.incl_app_filters),
+ excl_app_filters = dec_re(excl_app_filters,
+ ExclApp,
+ Sys#sys.excl_app_filters),
+ embedded_app_type = AppType};
+ excl_lib when Val =:= otp_root ->
+ Sys#sys{excl_lib=Val};
incl_sys_filters ->
- {Sys#sys{incl_sys_filters =
- dec_re(Key,
- Val,
- Sys#sys.incl_sys_filters)},
- Status};
+ Sys#sys{incl_sys_filters =
+ dec_re(Key, Val, Sys#sys.incl_sys_filters)};
excl_sys_filters ->
- {Sys#sys{excl_sys_filters =
- dec_re(Key,
- Val,
- Sys#sys.excl_sys_filters)},
- Status};
+ Sys#sys{excl_sys_filters =
+ dec_re(Key, Val, Sys#sys.excl_sys_filters)};
incl_app_filters ->
- {Sys#sys{incl_app_filters =
- dec_re(Key,
- Val,
- Sys#sys.incl_app_filters)},
- Status};
+ Sys#sys{incl_app_filters =
+ dec_re(Key, Val, Sys#sys.incl_app_filters)};
excl_app_filters ->
- {Sys#sys{excl_app_filters =
- dec_re(Key,
- Val,
- Sys#sys.excl_app_filters)},
- Status};
+ Sys#sys{excl_app_filters =
+ dec_re(Key, Val, Sys#sys.excl_app_filters)};
incl_archive_filters ->
- {Sys#sys{incl_archive_filters =
- dec_re(Key,
- Val,
- Sys#sys.incl_archive_filters)},
- Status};
+ Sys#sys{incl_archive_filters =
+ dec_re(Key, Val, Sys#sys.incl_archive_filters)};
excl_archive_filters ->
- {Sys#sys{excl_archive_filters =
- dec_re(Key,
- Val,
- Sys#sys.excl_archive_filters)},
- Status};
+ Sys#sys{excl_archive_filters =
+ dec_re(Key, Val, Sys#sys.excl_archive_filters)};
archive_opts when is_list(Val) ->
- {Sys#sys{archive_opts = Val}, Status};
+ Sys#sys{archive_opts = Val};
relocatable when Val =:= true; Val =:= false ->
- {Sys#sys{relocatable = Val}, Status};
+ Sys#sys{relocatable = Val};
rel_app_type when Val =:= permanent;
Val =:= transient;
Val =:= temporary;
Val =:= load;
Val =:= none ->
- {Sys#sys{rel_app_type = Val}, Status};
+ Sys#sys{rel_app_type = Val};
embedded_app_type when Val =:= permanent;
Val =:= transient;
Val =:= temporary;
Val =:= load;
Val =:= none;
Val =:= undefined ->
- {Sys#sys{embedded_app_type = Val}, Status};
+ Sys#sys{embedded_app_type = Val};
app_file when Val =:= keep; Val =:= strip; Val =:= all ->
- {Sys#sys{app_file = Val}, Status};
+ Sys#sys{app_file = Val};
debug_info when Val =:= keep; Val =:= strip ->
- {Sys#sys{debug_info = Val}, Status};
+ Sys#sys{debug_info = Val};
_ ->
- Text = lists:flatten(io_lib:format("~p", [{Key, Val}])),
- {Sys, reltool_utils:return_first_error(Status,
- "Illegal option: " ++
- Text)}
+ reltool_utils:throw_error("Illegal option: ~p", [{Key, Val}])
end,
- decode(Sys3, KeyVals, Status3);
-decode(#app{} = App, [{Key, Val} | KeyVals], Status) ->
- {App2, Status2} =
+ decode(Sys3, KeyVals);
+decode(#app{} = App, [{Key, Val} | KeyVals]) ->
+ App2 =
case Key of
mod_cond when Val =:= all;
Val =:= app;
Val =:= ebin;
Val =:= derived;
Val =:= none ->
- {App#app{mod_cond = Val}, Status};
+ App#app{mod_cond = Val};
incl_cond when Val =:= include;
Val =:= exclude;
Val =:= derived ->
- {App#app{incl_cond = Val}, Status};
+ App#app{incl_cond = Val};
debug_info when Val =:= keep;
Val =:= strip ->
- {App#app{debug_info = Val}, Status};
+ App#app{debug_info = Val};
app_file when Val =:= keep;
Val =:= strip;
Val =:= all ->
- {App#app{app_file = Val}, Status};
+ App#app{app_file = Val};
app_type when Val =:= permanent;
Val =:= transient;
Val =:= temporary;
Val =:= load;
Val =:= none;
Val =:= undefined ->
- {App#app{app_type = Val}, Status};
+ App#app{app_type = Val};
incl_app_filters ->
- {App#app{incl_app_filters =
- dec_re(Key,
- Val,
- App#app.incl_app_filters)},
- Status};
+ App#app{incl_app_filters =
+ dec_re(Key, Val, App#app.incl_app_filters)};
excl_app_filters ->
- {App#app{excl_app_filters =
- dec_re(Key,
- Val,
- App#app.excl_app_filters)},
- Status};
+ App#app{excl_app_filters =
+ dec_re(Key, Val, App#app.excl_app_filters)};
incl_archive_filters ->
- {App#app{incl_archive_filters =
- dec_re(Key,
- Val,
- App#app.incl_archive_filters)},
- Status};
+ App#app{incl_archive_filters =
+ dec_re(Key, Val, App#app.incl_archive_filters)};
excl_archive_filters ->
- {App#app{excl_archive_filters =
- dec_re(Key,
- Val,
- App#app.excl_archive_filters)},
- Status};
+ App#app{excl_archive_filters =
+ dec_re(Key, Val, App#app.excl_archive_filters)};
archive_opts when is_list(Val) ->
- {App#app{archive_opts = Val}, Status};
- vsn when is_list(Val) ->
- {App#app{use_selected_vsn = true, vsn = Val}, Status};
+ App#app{archive_opts = Val};
+ vsn when is_list(Val), App#app.use_selected_vsn=:=undefined ->
+ App#app{use_selected_vsn = vsn, vsn = Val};
+ lib_dir when is_list(Val), App#app.use_selected_vsn=:=undefined ->
+ case filelib:is_dir(Val) of
+ true ->
+ Dir = reltool_utils:normalize_dir(Val),
+ App#app{use_selected_vsn = dir,
+ active_dir = Dir,
+ sorted_dirs = [Dir]};
+ false ->
+ reltool_utils:throw_error("Illegal lib dir for ~p: ~p",
+ [App#app.name, Val])
+ end;
+ SelectVsn when SelectVsn=:=vsn; SelectVsn=:=lib_dir ->
+ reltool_utils:throw_error("Mutual exclusive options "
+ "'vsn' and 'lib_dir'",[]);
_ ->
- Text = lists:flatten(io_lib:format("~p", [{Key, Val}])),
- {App, reltool_utils:return_first_error(Status,
- "Illegal option: " ++ Text)}
+ reltool_utils:throw_error("Illegal option: ~p", [{Key, Val}])
end,
- decode(App2, KeyVals, Status2);
-decode(#app{mods = Mods} = App, [{mod, Name, ModKeyVals} | AppKeyVals],
- Status) ->
- {Mod, Status2} = decode(#mod{name = Name}, ModKeyVals, Status),
- decode(App#app{mods = [Mod | Mods]}, AppKeyVals, Status2);
-decode(#mod{} = Mod, [{Key, Val} | KeyVals], Status) ->
- {Mod2, Status2} =
+ decode(App2, KeyVals);
+decode(#app{mods = Mods} = App, [{mod, Name, ModKeyVals} | AppKeyVals]) ->
+ Mod = decode(#mod{name = Name}, ModKeyVals),
+ decode(App#app{mods = [Mod | Mods]}, AppKeyVals);
+decode(#mod{} = Mod, [{Key, Val} | KeyVals]) ->
+ Mod2 =
case Key of
incl_cond when Val =:= include; Val =:= exclude; Val =:= derived ->
- {Mod#mod{incl_cond = Val}, Status};
+ Mod#mod{incl_cond = Val};
debug_info when Val =:= keep; Val =:= strip ->
- {Mod#mod{debug_info = Val}, Status};
+ Mod#mod{debug_info = Val};
_ ->
- Text = lists:flatten(io_lib:format("~p", [{Key, Val}])),
- {Mod,
- reltool_utils:return_first_error(Status,
- "Illegal option: " ++ Text)}
+ reltool_utils:throw_error("Illegal option: ~p", [{Key, Val}])
end,
- decode(Mod2, KeyVals, Status2);
-decode(#rel{rel_apps = RelApps} = Rel, [RelApp | KeyVals], Status) ->
+ decode(Mod2, KeyVals);
+decode(#rel{rel_apps = RelApps} = Rel, [RelApp | KeyVals]) ->
{ValidTypesAssigned, RA} =
case RelApp of
Name when is_atom(Name) ->
{true, #rel_app{name = Name}};
- {Name, Type} when is_atom(Name) ->
- {is_type(Type), #rel_app{name = Name, app_type = Type}};
{Name, InclApps} when is_atom(Name), is_list(InclApps) ->
VI = lists:all(fun erlang:is_atom/1, InclApps),
{VI, #rel_app{name = Name, incl_apps = InclApps}};
+ {Name, Type} when is_atom(Name) ->
+ {is_type(Type), #rel_app{name = Name, app_type = Type}};
{Name, Type, InclApps} when is_atom(Name), is_list(InclApps) ->
VT = is_type(Type),
VI = lists:all(fun erlang:is_atom/1, InclApps),
{VT andalso VI,
#rel_app{name = Name, app_type = Type, incl_apps = InclApps}};
_ ->
- {false, #rel_app{incl_apps = []}}
+ {false, #rel_app{}}
end,
case ValidTypesAssigned of
true ->
- decode(Rel#rel{rel_apps = RelApps ++ [RA]}, KeyVals, Status);
+ decode(Rel#rel{rel_apps = RelApps ++ [RA]}, KeyVals);
false ->
- Text = lists:flatten(io_lib:format("~p", [RelApp])),
- Status2 =
- reltool_utils:return_first_error(Status,
- "Illegal option: " ++ Text),
- decode(Rel, KeyVals, Status2)
+ reltool_utils:throw_error("Illegal option: ~p", [RelApp])
end;
-decode(Acc, [], Status) ->
- {Acc, Status};
-decode(Acc, KeyVal, Status) ->
- Text = lists:flatten(io_lib:format("~p", [KeyVal])),
- {Acc, reltool_utils:return_first_error(Status, "Illegal option: " ++ Text)}.
+decode(Acc, []) ->
+ Acc;
+decode(_Acc, KeyVal) ->
+ reltool_utils:throw_error("Illegal option: ~p", [KeyVal]).
is_type(Type) ->
case Type of
@@ -1529,79 +1578,50 @@ split_escript_name(File) when is_list(File) ->
Label = filename:basename(File, ".escript"),
{list_to_atom("*escript* " ++ Label), Label}.
+default_escript_app(File) ->
+ {Name, Label} = split_escript_name(File),
+ App = default_app(Name, File),
+ App#app{is_escript = true,
+ label = Label,
+ info = missing_app_info("")}.
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-refresh(#state{sys = Sys} = S, Force, Status) ->
- {Sys2, Status2} = merge_config(Sys, Sys#sys{apps = []}, Force, Status),
- {S#state{sys = Sys2}, Status2}.
-
-merge_config(OldSys, NewSys, Force, Status) ->
- RootDir = filename:absname(NewSys#sys.root_dir),
- LibDirs = [filename:absname(D) || D <- NewSys#sys.lib_dirs],
- Escripts = [filename:absname(E) || E <- NewSys#sys.escripts],
- {SourceDirs, Status2} =
- libs_to_dirs(RootDir, LibDirs, Status),
- MergedApps = merge_app_dirs(SourceDirs, NewSys#sys.apps, OldSys#sys.apps),
- {AllApps, Status3} =
- escripts_to_apps(Escripts, MergedApps, OldSys#sys.apps, Status2),
- {RefreshedApps, Status4} =
- refresh_apps(OldSys#sys.apps, AllApps, [], Force, Status3),
- {PatchedApps, Status5} =
- patch_erts_version(RootDir, RefreshedApps, Status4),
- Escripts2 = [A#app.active_dir || A <- PatchedApps, A#app.is_escript],
- NewSys2 = NewSys#sys{root_dir = RootDir,
- lib_dirs = LibDirs,
- escripts = Escripts2,
- apps = PatchedApps},
- {NewSys2, Status5}.
+%% Apps is a list of #app records - sorted on #app.name - containing
+%% only the apps that have specific configuration (e.g. in the config
+%% file)
+refresh(#state{sys=Sys} = S) ->
+ RootDir = filename:absname(Sys#sys.root_dir),
+ LibDirs = [filename:absname(D) || D <- Sys#sys.lib_dirs],
+ Escripts = [filename:absname(E) || E <- Sys#sys.escripts],
-verify_config(RelApps, #sys{boot_rel = BootRel, rels = Rels, apps = Apps}, Status) ->
- case lists:keymember(BootRel, #rel.name, Rels) of
- true ->
- Status2 = lists:foldl(fun(RA, Acc) ->
- check_app(RA, Apps, Acc) end,
- Status,
- RelApps),
- lists:foldl(fun(#rel{name = RelName}, Acc)->
- check_rel(RelName, RelApps, Acc)
- end,
- Status2,
- Rels);
- false ->
- Text = lists:concat(["Release ", BootRel,
- " is mandatory (used as boot_rel)"]),
- reltool_utils:return_first_error(Status, Text)
- end.
+ %% Read all lib dirs and return sorted [{AppName,Dir}]
+ SourceDirs = libs_to_dirs(RootDir, LibDirs),
-check_app({RelName, AppName}, Apps, Status) ->
- case lists:keysearch(AppName, #app.name, Apps) of
- {value, App} when App#app.is_pre_included ->
- Status;
- {value, App} when App#app.is_included ->
- Status;
- _ ->
- Text = lists:concat(["Release ", RelName,
- " uses non included application ",
- AppName]),
- reltool_utils:return_first_error(Status, Text)
- end.
+ %% Create #app records for all apps in SourceDirs, and merge with
+ %% list of apps from config.
+ MergedApps = merge_app_dirs(SourceDirs, Sys#sys.apps),
-check_rel(RelName, RelApps, Status) ->
- EnsureApp =
- fun(AppName, Acc) ->
- case lists:member({RelName, AppName}, RelApps) of
- true ->
- Acc;
- false ->
- Text = lists:concat(["Mandatory application ",
- AppName,
- " is not included in release ",
- RelName]),
- reltool_utils:return_first_error(Acc, Text)
- end
- end,
- Mandatory = [kernel, stdlib],
- lists:foldl(EnsureApp, Status, Mandatory).
+ %% For each escript, find all related files and convert to #app
+ %% and #mod records
+ {AllApps, Status2} = escripts_to_apps(Escripts, MergedApps, {ok,[]}),
+
+ %% Make sure correct version of each application is used according
+ %% to the user configuration.
+ %% Then find all modules and their dependencies and set user
+ %% configuration per module if it exists.
+ {RefreshedApps, Status3} = refresh_apps(Sys#sys.apps, AllApps, [],
+ true, Status2),
+
+ %% Make sure erts exists in app list and has a version (or warn)
+ {PatchedApps, Status4} = patch_erts_version(RootDir, RefreshedApps, Status3),
+
+ %% Update #sys and return
+ Escripts2 = [A#app.active_dir || A <- PatchedApps, A#app.is_escript],
+ Sys2 = Sys#sys{root_dir = RootDir,
+ lib_dirs = LibDirs,
+ escripts = Escripts2},
+ {S#state{sys=Sys2}, PatchedApps, Status4}.
patch_erts_version(RootDir, Apps, Status) ->
AppName = erts,
@@ -1615,18 +1635,17 @@ patch_erts_version(RootDir, Apps, Status) ->
Apps2 = lists:keystore(AppName, #app.name, Apps, Erts2),
{Apps2, Status};
Vsn =:= "" ->
- {Apps, reltool_utils:add_warning(Status,
- "erts has no version")};
+ {Apps, reltool_utils:add_warning("erts has no version",[],
+ Status)};
true ->
{Apps, Status}
end;
false ->
- Text = "erts cannot be found in the root directory " ++ RootDir,
- Status2 = reltool_utils:return_first_error(Status, Text),
- {Apps, Status2}
+ reltool_utils:throw_error(
+ "erts cannot be found in the root directory ~p", [RootDir])
end.
-libs_to_dirs(RootDir, LibDirs, Status) ->
+libs_to_dirs(RootDir, LibDirs) ->
case file:list_dir(RootDir) of
{ok, RootFiles} ->
RootLibDir = filename:join([RootDir, "lib"]),
@@ -1648,21 +1667,16 @@ libs_to_dirs(RootDir, LibDirs, Status) ->
end,
ErtsFiles = [{erts, Fun(F)} || F <- RootFiles,
lists:prefix("erts", F)],
- app_dirs2(AllLibDirs, [ErtsFiles], Status);
+ app_dirs2(AllLibDirs, [ErtsFiles]);
[Duplicate | _] ->
- {[],
- reltool_utils:return_first_error(Status,
- "Duplicate library: " ++
- Duplicate)}
+ reltool_utils:throw_error("Duplicate library: ~p",[Duplicate])
end;
{error, Reason} ->
- Text = file:format_error(Reason),
- {[], reltool_utils:return_first_error(Status,
- "Missing root library " ++
- RootDir ++ ": " ++ Text)}
+ reltool_utils:throw_error("Missing root library ~p: ~s",
+ [RootDir,file:format_error(Reason)])
end.
-app_dirs2([Lib | Libs], Acc, Status) ->
+app_dirs2([Lib | Libs], Acc) ->
case file:list_dir(Lib) of
{ok, Files} ->
Filter =
@@ -1671,8 +1685,7 @@ app_dirs2([Lib | Libs], Acc, Status) ->
EbinDir = filename:join([AppDir, "ebin"]),
case filelib:is_dir(EbinDir, erl_prim_loader) of
true ->
- {Name, _Vsn} =
- reltool_utils:split_app_name(Base),
+ Name = find_app_name(Base,EbinDir),
case Name of
erts -> false;
_ -> {true, {Name, AppDir}}
@@ -1682,27 +1695,82 @@ app_dirs2([Lib | Libs], Acc, Status) ->
end
end,
Files2 = lists:zf(Filter, Files),
- app_dirs2(Libs, [Files2 | Acc], Status);
+ app_dirs2(Libs, [Files2 | Acc]);
{error, Reason} ->
- Text = file:format_error(Reason),
- {[], reltool_utils:return_first_error(Status,
- "Illegal library " ++
- Lib ++ ": " ++ Text)}
+ reltool_utils:throw_error("Illegal library ~p: ~s",
+ [Lib, file:format_error(Reason)])
end;
-app_dirs2([], Acc, Status) ->
- {lists:sort(lists:append(Acc)), Status}.
+app_dirs2([], Acc) ->
+ lists:sort(lists:append(Acc)).
+
+find_app_name(Base,EbinDir) ->
+ {ok,EbinFiles} = erl_prim_loader:list_dir(EbinDir),
+ AppFile =
+ case [F || F <- EbinFiles, filename:extension(F)=:=".app"] of
+ [AF] ->
+ AF;
+ _ ->
+ undefined
+ end,
+ find_app_name1(Base,AppFile).
-escripts_to_apps([Escript | Escripts], Apps, OldApps, Status) ->
+find_app_name1(Base,undefined) ->
+ {Name,_} = reltool_utils:split_app_name(Base),
+ Name;
+find_app_name1(_Base,AppFile) ->
+ list_to_atom(filename:rootname(AppFile)).
+
+get_vsn_from_dir(AppName,Base) ->
+ Prefix = atom_to_list(AppName) ++ "-",
+ case lists:prefix(Prefix,Base) of
+ true ->
+ lists:nthtail(length(Prefix),Base);
+ false ->
+ ""
+ end.
+
+
+escripts_to_apps([Escript | Escripts], Apps, Status) ->
{EscriptAppName, _Label} = split_escript_name(Escript),
Ext = code:objfile_extension(),
+
+ %% First find all .app files and associate the app name to the app
+ %% label - this is in order to now which application a module
+ %% belongs to in the next round.
+ AppFun = fun(FullName, _GetInfo, _GetBin, AppFiles) ->
+ Components = filename:split(FullName),
+ case Components of
+ [AppLabel, "ebin", File] ->
+ case filename:extension(File) of
+ ".app" ->
+ [{AppLabel,File}|AppFiles];
+ _ ->
+ AppFiles
+ end;
+ _ ->
+ AppFiles
+ end
+ end,
+ AppFiles =
+ case reltool_utils:escript_foldl(AppFun, [], Escript) of
+ {ok, AF} ->
+ AF;
+ {error, Reason1} ->
+ reltool_utils:throw_error("Illegal escript ~p: ~p",
+ [Escript,Reason1])
+ end,
+
+ %% Next, traverse all files...
Fun = fun(FullName, _GetInfo, GetBin, {FileAcc, StatusAcc}) ->
Components = filename:split(FullName),
case Components of
[AppLabel, "ebin", File] ->
case filename:extension(File) of
".app" ->
- {AppName, DefaultVsn} =
- reltool_utils:split_app_name(AppLabel),
+ AppName =
+ list_to_atom(filename:rootname(File)),
+ DefaultVsn =
+ get_vsn_from_dir(AppName,AppLabel),
AppFileName =
filename:join([Escript, FullName]),
{Info, StatusAcc2} =
@@ -1715,8 +1783,9 @@ escripts_to_apps([Escript | Escripts], Apps, OldApps, Status) ->
{[{AppName, app, Dir, Info} | FileAcc],
StatusAcc2};
E when E =:= Ext ->
- {AppName, _} =
- reltool_utils:split_app_name(AppLabel),
+ AppFile =
+ proplists:get_value(AppLabel,AppFiles),
+ AppName = find_app_name1(AppLabel,AppFile),
Mod = init_mod(AppName,
File,
{File, GetBin()},
@@ -1753,158 +1822,118 @@ escripts_to_apps([Escript | Escripts], Apps, OldApps, Status) ->
{FileAcc, StatusAcc}
end
end,
+
case reltool_utils:escript_foldl(Fun, {[], Status}, Escript) of
{ok, {Files, Status2}} ->
+ EscriptApp =
+ case lists:keyfind(EscriptAppName,#app.name,Apps) of
+ false -> default_escript_app(Escript);
+ EA -> EA
+ end,
{Apps2, Status3} =
- files_to_apps(Escript,
- lists:sort(Files),
- Apps,
- Apps,
- OldApps,
- Status2),
- escripts_to_apps(Escripts, Apps2, OldApps, Status3);
- {error, Reason} ->
- Text = lists:flatten(io_lib:format("~p", [Reason])),
- {[], reltool_utils:return_first_error(Status,
- "Illegal escript " ++
- Escript ++ ": " ++ Text)}
+ escript_files_to_apps(EscriptAppName,
+ lists:sort(Files),
+ [EscriptApp],
+ Apps,
+ Status2),
+ escripts_to_apps(Escripts, Apps2, Status3);
+ {error, Reason2} ->
+ reltool_utils:throw_error("Illegal escript ~p: ~p",
+ [Escript,Reason2])
end;
-escripts_to_apps([], Apps, _OldApps, Status) ->
+escripts_to_apps([], Apps, Status) ->
{Apps, Status}.
%% Assume that all files for an app are in consecutive order
%% Assume the app info is before the mods
-files_to_apps(Escript,
- [{AppName, Type, Dir, ModOrInfo} | Files] = AllFiles,
- Acc,
- Apps,
- OldApps,
- Status) ->
- case Type of
- mod ->
- case Acc of
- [] ->
- Info = missing_app_info(""),
- {NewApp, Status2} =
- merge_escript_app(AppName,
- Dir,
- Info,
- [ModOrInfo],
- Apps,
- OldApps,
- Status),
- files_to_apps(Escript,
- AllFiles,
- [NewApp | Acc],
- Apps,
- OldApps, Status2);
- [App | Acc2] when App#app.name =:= ModOrInfo#mod.app_name ->
- App2 = App#app{mods = [ModOrInfo | App#app.mods]},
- files_to_apps(Escript,
- Files,
- [App2 | Acc2],
- Apps,
- OldApps,
- Status);
- [App | Acc2] ->
- PrevApp = App#app{mods = lists:keysort(#mod.name,
- App#app.mods)},
- Info = missing_app_info(""),
- {NewApp, Status2} =
- merge_escript_app(AppName,
- Dir,
- Info,
- [ModOrInfo],
- Apps,
- OldApps,
- Status),
- files_to_apps(Escript,
- Files,
- [NewApp, PrevApp | Acc2],
- Apps,
- OldApps,
- Status2)
- end;
- app ->
- {App, Status2} =
- merge_escript_app(AppName, Dir, ModOrInfo, [], Apps, OldApps,
- Status),
- files_to_apps(Escript, Files, [App | Acc], Apps, OldApps, Status2)
- end;
-files_to_apps(_Escript, [], Acc, _Apps, _OldApps, Status) ->
- {lists:keysort(#app.name, Acc), Status}.
-
-merge_escript_app(AppName, Dir, Info, Mods, Apps, OldApps, Status) ->
- App1 = case lists:keyfind(AppName, #app.name, OldApps) of
- #app{} = App ->
- App;
- false ->
- default_app(AppName, Dir)
- end,
- App2 = App1#app{is_escript = true,
+escript_files_to_apps(EscriptAppName,
+ [{AppName, Type, Dir, ModOrInfo} | Files],
+ Acc,
+ Apps,
+ Status) ->
+ {NewAcc,Status3} =
+ case Type of
+ mod ->
+ case Acc of
+ [App | Acc2] when App#app.name =:= ModOrInfo#mod.app_name ->
+ Mods = lists:ukeymerge(#mod.name,
+ [ModOrInfo],
+ App#app.mods),
+ {[App#app{mods = Mods} | Acc2], Status};
+ Acc ->
+ {NewApp, Status2} = init_escript_app(AppName,
+ EscriptAppName,
+ Dir,
+ missing_app_info(""),
+ [ModOrInfo],
+ Apps,
+ Status),
+ {[NewApp | Acc], Status2}
+ end;
+ app ->
+ {App, Status2} = init_escript_app(AppName,
+ EscriptAppName,
+ Dir,
+ ModOrInfo,
+ [],
+ Apps,
+ Status),
+ {[App | Acc], Status2}
+ end,
+ escript_files_to_apps(EscriptAppName, Files, NewAcc, Apps, Status3);
+escript_files_to_apps(_EscriptAppName, [], Acc, Apps, Status) ->
+ {lists:ukeymerge(#app.name, lists:reverse(Acc), Apps), Status}.
+
+init_escript_app(AppName, EscriptAppName, Dir, Info, Mods, Apps, Status) ->
+ App1 = default_app(AppName, Dir),
+ IsEscript =
+ if AppName=:=EscriptAppName -> true;
+ true -> {inlined, EscriptAppName}
+ end,
+ InclCond = (lists:keyfind(EscriptAppName,#app.name,Apps))#app.incl_cond,
+ App2 = App1#app{is_escript = IsEscript,
label = filename:basename(Dir, ".escript"),
info = Info,
mods = Mods,
active_dir = Dir,
- sorted_dirs = [Dir]},
+ sorted_dirs = [Dir],
+ incl_cond = InclCond},% inlined apps inherit incl from escript
case lists:keymember(AppName, #app.name, Apps) of
true ->
- Error = lists:concat([AppName, ": Application name clash. ",
- "Escript ", Dir," contains application ",
- AppName, "."]),
- {App2, reltool_utils:return_first_error(Status, Error)};
+ reltool_utils:throw_error(
+ "~p: Application name clash. Escript ~p contains application ~p.",
+ [AppName,Dir,AppName]);
false ->
{App2, Status}
end.
-merge_app_dirs([{Name, Dir} | Rest], [App | Apps], OldApps)
- when App#app.name =:= Name ->
- %% Add new dir to app
- App2 = App#app{sorted_dirs = [Dir | App#app.sorted_dirs]},
- merge_app_dirs(Rest, [App2 | Apps], OldApps);
-merge_app_dirs([{Name, Dir} | Rest], Apps, OldApps) ->
- %% Initate app
- Apps2 = sort_app_dirs(Apps),
- Apps4 =
+merge_app_dirs([{Name, Dir} | Rest], Apps) ->
+ App =
case lists:keyfind(Name, #app.name, Apps) of
false ->
- case lists:keyfind(Name, #app.name, OldApps) of
- false ->
- App = default_app(Name, Dir),
- [App | Apps2];
- #app{active_dir = Dir} = OldApp ->
- [OldApp | Apps2];
- OldApp ->
- App =
- case filter_app(OldApp) of
- {true, NewApp} ->
- NewApp#app{active_dir = Dir,
- sorted_dirs = [Dir]};
- false ->
- default_app(Name, Dir)
- end,
- [App | Apps2]
- end;
+ default_app(Name, Dir);
OldApp ->
- Apps3 = lists:keydelete(Name, #app.name, Apps2),
- App = OldApp#app{sorted_dirs = [Dir | OldApp#app.sorted_dirs]},
- [App | Apps3]
+ SortedDirs = lists:umerge(fun reltool_utils:app_dir_test/2,
+ [Dir], OldApp#app.sorted_dirs),
+ OldApp#app{sorted_dirs = SortedDirs}
end,
- merge_app_dirs(Rest, Apps4, OldApps);
-merge_app_dirs([], Apps, _OldApps) ->
- Apps2 = sort_app_dirs(Apps),
- lists:reverse(Apps2).
-
-sort_app_dirs([#app{sorted_dirs = Dirs} = App | Acc]) ->
- SortedDirs = lists:sort(fun reltool_utils:app_dir_test/2, Dirs),
- case SortedDirs of
- [ActiveDir | _] -> ok;
- [] -> ActiveDir = undefined
- end,
- [App#app{active_dir = ActiveDir, sorted_dirs = SortedDirs} | Acc];
-sort_app_dirs([]) ->
+ Apps2 = lists:ukeymerge(#app.name, [App], Apps),
+ merge_app_dirs(Rest, Apps2);
+merge_app_dirs([], Apps) ->
+ set_active_dirs(Apps).
+
+%% First dir, i.e. the one with highest version, is set to active dir,
+%% unless a specific dir is given in config
+set_active_dirs([#app{use_selected_vsn = dir} = App | Apps]) ->
+ [App | set_active_dirs(Apps)];
+set_active_dirs([#app{sorted_dirs = [ActiveDir|_]} = App | Apps]) ->
+ [App#app{active_dir = ActiveDir} | set_active_dirs(Apps)];
+set_active_dirs([#app{sorted_dirs = []} = App | Apps]) ->
+ [App#app{active_dir = undefined} | set_active_dirs(Apps)];
+set_active_dirs([]) ->
[].
+
default_app(Name, Dir) ->
App = default_app(Name),
App#app{active_dir = Dir,
@@ -1913,91 +1942,55 @@ default_app(Name, Dir) ->
default_app(Name) ->
#app{name = Name,
is_escript = false,
- use_selected_vsn = undefined,
- active_dir = undefined,
sorted_dirs = [],
- vsn = undefined,
- label = undefined,
- info = undefined,
mods = [],
-
- mod_cond = undefined,
- incl_cond = undefined,
-
- status = missing,
- uses_mods = undefined,
- is_pre_included = undefined,
- is_included = undefined,
- rels = undefined}.
-
-%% Assume that the application are sorted
-refresh_apps([Old | OldApps], [New | NewApps], Acc, Force, Status)
- when New#app.name =:= Old#app.name ->
- {Info, ActiveDir, Status2} = ensure_app_info(New, Status),
- OptLabel =
- case Info#app_info.vsn =:= New#app.vsn of
- true -> New#app.label;
- false -> undefined % Cause refresh
- end,
- {Refreshed, Status3} =
- refresh_app(New#app{label = OptLabel,
- active_dir = ActiveDir,
- vsn = Info#app_info.vsn,
- info = Info},
- Force,
- Status2),
- refresh_apps(OldApps, NewApps, [Refreshed | Acc], Force, Status3);
-refresh_apps([Old | OldApps], [New | NewApps], Acc, Force, Status)
- when New#app.name < Old#app.name ->
- %% No old app version exists. Use new as is.
- %% BUGBUG: Issue warning if the active_dir is not defined
- {New2, Status2} = refresh_app(New, Force, Status),
- refresh_apps([Old | OldApps], NewApps, [New2 | Acc], Force, Status2);
-refresh_apps([Old | OldApps], [New | NewApps], Acc, Force, Status)
- when New#app.name > Old#app.name ->
- %% No new version. Remove the old.
- Status2 =
- case Old#app.name =:= ?MISSING_APP_NAME of
- true ->
- Status;
- false ->
- Warning =
- lists:concat([Old#app.name,
- ": The source dirs does not ",
- "contain the application anymore."]),
- reltool_utils:add_warning(Status, Warning)
- end,
- refresh_apps(OldApps, [New | NewApps], Acc, Force, Status2);
-refresh_apps([], [New | NewApps], Acc, Force, Status) ->
- %% No old app version exists. Use new as is.
- {New2, Status2} = refresh_app(New, Force, Status),
- refresh_apps([], NewApps, [New2 | Acc], Force, Status2);
-refresh_apps([Old | OldApps], [], Acc, Force, Status) ->
- %% No new version. Remove the old.
- Status2 =
- case Old#app.name =:= ?MISSING_APP_NAME of
- true ->
- Status;
- false ->
- Warning =
- lists:concat([Old#app.name,
- ": The source dirs does not "
- "contain the application anymore."]),
- reltool_utils:add_warning(Status, Warning)
- end,
- refresh_apps(OldApps, [], Acc, Force, Status2);
-refresh_apps([], [], Acc, _Force, Status) ->
+ status = missing}.
+
+
+
+refresh_apps(ConfigApps, [New | NewApps], Acc, Force, Status) ->
+ {New2, Status3} =
+ case lists:keymember(New#app.name,#app.name,ConfigApps) of
+ true ->
+ %% There is user defined config for this application, make
+ %% sure that the application exists and that correct
+ %% version is used. Set active directory.
+ {Info, ActiveDir, Status2} = ensure_app_info(New, Status),
+ OptLabel =
+ case Info#app_info.vsn =:= New#app.vsn of
+ true -> New#app.label;
+ false -> undefined % Cause refresh
+ end,
+ refresh_app(New#app{label = OptLabel,
+ active_dir = ActiveDir,
+ vsn = Info#app_info.vsn,
+ info = Info},
+ Force,
+ Status2);
+ false ->
+ %% There is no user defined config for this
+ %% application. This means that the app is found in the
+ %% lib dirs, and that the highest version shall be
+ %% used. I.e. the active_dir and vsn are already correct
+ %% from merge_app_dirs.
+ refresh_app(New, Force, Status)
+ end,
+ refresh_apps(ConfigApps, NewApps, [New2 | Acc], Force, Status3);
+refresh_apps(_ConfigApps, [], Acc, _Force, Status) ->
{lists:reverse(Acc), Status}.
-ensure_app_info(#app{is_escript = true, active_dir = Dir, info = Info},
- Status) ->
+
+ensure_app_info(#app{is_escript = IsEscript, active_dir = Dir, info = Info},
+ Status)
+ when IsEscript=/=false ->
+ %% Escript or application which is inlined in an escript
{Info, Dir, Status};
-ensure_app_info(#app{name = Name, sorted_dirs = []}, Status) ->
- Error = lists:concat([Name, ": Missing application directory."]),
- Status2 = reltool_utils:return_first_error(Status, Error),
- {missing_app_info(""), undefined, Status2};
+ensure_app_info(#app{name = Name, sorted_dirs = []}, _Status) ->
+ reltool_utils:throw_error("~p: : Missing application directory.",[Name]);
ensure_app_info(#app{name = Name,
vsn = Vsn,
+ use_selected_vsn = UseSelectedVsn,
+ active_dir = ActiveDir,
sorted_dirs = Dirs,
info = undefined},
Status) ->
@@ -2005,7 +1998,7 @@ ensure_app_info(#app{name = Name,
fun(Dir, StatusAcc) ->
Base = get_base(Name, Dir),
Ebin = filename:join([Dir, "ebin"]),
- {_, DefaultVsn} = reltool_utils:split_app_name(Base),
+ DefaultVsn = get_vsn_from_dir(Name,Base),
AppFile = filename:join([Ebin, atom_to_list(Name) ++ ".app"]),
read_app_info(AppFile, AppFile, Name, DefaultVsn, StatusAcc)
end,
@@ -2017,32 +2010,36 @@ ensure_app_info(#app{name = Name,
%% No redundant info
Status2;
[BadVsn | _] ->
- Error2 =
- lists:concat([Name, ": Application version clash. ",
- "Multiple directories contains version \"",
- BadVsn, "\"."]),
- reltool_utils:return_first_error(Status2, Error2)
+ reltool_utils:throw_error(
+ "~p: Application version clash. "
+ "Multiple directories contains version ~p.",
+ [Name,BadVsn])
end,
FirstInfo = hd(AllInfo),
FirstDir = hd(Dirs),
if
- Vsn =:= undefined ->
- {FirstInfo, FirstDir, Status3};
- Vsn =:= FirstInfo#app_info.vsn ->
- {FirstInfo, FirstDir, Status3};
- true ->
- case find_vsn(Vsn, AllInfo, Dirs) of
- {Info, VsnDir} ->
- {Info, VsnDir, Status3};
- false ->
- Error3 =
- lists:concat([Name,
- ": No application directory contains ",
- "selected version \"",
- Vsn, "\"."]),
- Status4 = reltool_utils:return_first_error(Status3, Error3),
- {FirstInfo, FirstDir, Status4}
- end
+ UseSelectedVsn =:= dir ->
+ if ActiveDir =:= FirstDir ->
+ {FirstInfo, FirstDir, Status3};
+ true ->
+ Info = find_dir(ActiveDir, AllInfo, Dirs),
+ {Info, ActiveDir, Status3}
+ end;
+ UseSelectedVsn =:= vsn ->
+ if Vsn =:= FirstInfo#app_info.vsn ->
+ {FirstInfo, FirstDir, Status3};
+ true ->
+ case find_vsn(Vsn, AllInfo, Dirs) of
+ {Info, VsnDir} ->
+ {Info, VsnDir, Status3};
+ false ->
+ reltool_utils:throw_error(
+ "~p: No application directory contains "
+ "selected version ~p", [Name,Vsn])
+ end
+ end;
+ true ->
+ {FirstInfo, FirstDir, Status3}
end;
ensure_app_info(#app{active_dir = Dir, info = Info}, Status) ->
{Info, Dir, Status}.
@@ -2054,6 +2051,11 @@ find_vsn(Vsn, [_ | MoreInfo], [_ | MoreDirs]) ->
find_vsn(_, [], []) ->
false.
+find_dir(Dir, [Info | _], [Dir | _]) ->
+ Info;
+find_dir(Dir, [_ | MoreInfo], [_ | MoreDirs]) ->
+ find_dir(Dir, MoreInfo, MoreDirs).
+
get_base(Name, Dir) ->
case Name of
erts ->
@@ -2067,6 +2069,54 @@ get_base(Name, Dir) ->
filename:basename(Dir)
end.
+sys_all_apps(#state{app_tab=AppTab, sys=Sys}) ->
+ Sys#sys{apps = ets:match_object(AppTab,'_')}.
+
+config_and_refresh(OldS, Fun) ->
+ try
+ S = Fun(),
+ {S2, Apps, Status2} = refresh(S),
+ %% Analyse will write to app_tab and mod_tab, so we first
+ %% backup these tables and clear them
+ Backup = backup(OldS),
+ try
+ Status3 = analyse(S2, Apps, Status2),
+ S3 = save_old(OldS, S2, Backup, Status3),
+ {S3, Status3}
+ catch throw:{error,_} = Error1 ->
+ restore(Backup,OldS),
+ throw(Error1)
+ end
+ catch throw:{error,_} = Error2 ->
+ {OldS, Error2}
+ end.
+
+
+backup(S) ->
+ Apps = ets:tab2list(S#state.app_tab),
+ Mods = ets:tab2list(S#state.mod_tab),
+ ets:delete_all_objects(S#state.app_tab),
+ ets:delete_all_objects(S#state.mod_tab),
+ ets:delete_all_objects(S#state.mod_used_by_tab), %tmp tab, no backup needed
+ {Apps,Mods}.
+
+restore({Apps,Mods}, S) ->
+ insert_all(S#state.app_tab,Apps),
+ insert_all(S#state.mod_tab,Mods).
+
+save_old(#state{status=OldStatus,sys=OldSys},NewS,{OldApps,OldMods},NewStatus) ->
+ ets:delete_all_objects(NewS#state.old_app_tab),
+ ets:delete_all_objects(NewS#state.old_mod_tab),
+ insert_all(NewS#state.old_app_tab,OldApps),
+ insert_all(NewS#state.old_mod_tab,OldMods),
+ NewS#state{old_sys=OldSys,
+ old_status=OldStatus,
+ status=NewStatus}.
+
+insert_all(Tab,Items) ->
+ lists:foreach(fun(Item) -> ets:insert(Tab,Item) end, Items).
+
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% sys callbacks
diff --git a/lib/reltool/src/reltool_sys_win.erl b/lib/reltool/src/reltool_sys_win.erl
index 8b0f64eb45..0c0b295db1 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -56,7 +56,9 @@
derived,
fgraph_wins,
app_box,
- mod_box
+ mod_box,
+ warning_list,
+ warning_wins
}).
-define(WIN_WIDTH, 800).
@@ -88,6 +90,10 @@
-define(blacklist, "Excluded").
-define(derived, "Derived").
+-define(WARNING_COL, 0).
+-define(DEFAULT_WARNING_TIP, "Warnings are listed in this window").
+-define(WARNING_POPUP_SIZE, {400,150}).
+
-define(safe_config,{sys,[{incl_cond,exclude},
{app,kernel,[{incl_cond,include}]},
{app,stdlib,[{incl_cond,include}]},
@@ -141,48 +147,44 @@ do_init([{safe_config, Safe}, {parent, Parent} | Options]) ->
wx:debug(C#common.wx_debug),
%% wx_misc:beginBusyCursor(),
- case reltool_server:get_status(ServerPid) of
- {ok, Warnings} ->
- exit_dialog(Warnings),
- {ok, Sys} = reltool_server:get_sys(ServerPid),
- S = #state{parent_pid = Parent,
- server_pid = ServerPid,
- common = C,
- config_file = filename:absname("config.reltool"),
- target_dir = filename:absname("reltool_target_dir"),
- app_wins = [],
- sys = Sys,
- fgraph_wins = []},
- S2 = create_window(S),
- S5 = wx:batch(fun() ->
- Title = atom_to_list(?APPLICATION),
- wxFrame:setTitle(S2#state.frame,
- Title),
- %% wxFrame:setMinSize(Frame,
- %% {?WIN_WIDTH, ?WIN_HEIGHT}),
- wxStatusBar:setStatusText(
- S2#state.status_bar,
- "Done."),
- S3 = redraw_apps(S2),
- S4 = redraw_libs(S3),
- redraw_config_page(S4)
- end),
- %% wx_misc:endBusyCursor(),
- %% wxFrame:destroy(Frame),
- proc_lib:init_ack(S#state.parent_pid, {ok, self()}),
- loop(S5);
- {error, Reason} ->
- restart_server_safe_config(Safe,Parent,Reason)
- end;
+ {ok, Warnings} = reltool_server:get_status(ServerPid),
+ exit_dialog(Warnings),
+ S = #state{parent_pid = Parent,
+ server_pid = ServerPid,
+ common = C,
+ config_file = filename:absname("config.reltool"),
+ target_dir = filename:absname("reltool_target_dir"),
+ app_wins = [],
+ sys = Sys,
+ fgraph_wins = [],
+ warning_wins = []},
+ S2 = create_window(S),
+ S5 = wx:batch(fun() ->
+ Title = atom_to_list(?APPLICATION),
+ wxFrame:setTitle(S2#state.frame,
+ Title),
+ %% wxFrame:setMinSize(Frame,
+ %% {?WIN_WIDTH, ?WIN_HEIGHT}),
+ wxStatusBar:setStatusText(
+ S2#state.status_bar,
+ "Done."),
+ S3 = redraw_apps(S2),
+ S4 = redraw_libs(S3),
+ redraw_config_page(S4)
+ end),
+ %% wx_misc:endBusyCursor(),
+ %% wxFrame:destroy(Frame),
+ proc_lib:init_ack(S#state.parent_pid, {ok, self()}),
+ loop(S5);
{error, Reason} ->
- io:format("~p(~p): <ERROR> ~p\n", [?MODULE, ?LINE, Reason]),
- exit(Reason)
+ restart_server_safe_config(Safe,Parent,Reason)
end.
-restart_server_safe_config(true,_Parent,Reason) ->
+restart_server_safe_config(true,Parent,Reason) ->
io:format("~p(~p): <ERROR> ~p\n", [?MODULE, ?LINE, Reason]),
- exit(Reason);
+ proc_lib:init_ack(Parent, {error,Reason});
restart_server_safe_config(false,Parent,Reason) ->
+ wx:new(),
Strings =
[{?wxBLACK,"Could not start reltool server:\n\n"},
{?wxRED,Reason++"\n\n"},
@@ -197,7 +199,7 @@ restart_server_safe_config(false,Parent,Reason) ->
do_init([{safe_config,true},{parent,Parent},?safe_config]);
?wxID_CANCEL ->
io:format("~p(~p): <ERROR> ~p\n", [?MODULE, ?LINE, Reason]),
- exit(Reason)
+ proc_lib:init_ack(Parent,{error,Reason})
end.
exit_dialog([]) ->
@@ -240,10 +242,18 @@ loop(S) ->
lists:keydelete(ObjRef, #fgraph_win.frame, FWs),
?MODULE:loop(S#state{fgraph_wins = FWs2});
false ->
- error_logger:format("~p~p got unexpected "
- "message:\n\t~p\n",
- [?MODULE, self(), Msg]),
- ?MODULE:loop(S)
+ WWs = S#state.warning_wins,
+ case lists:member(ObjRef, WWs) of
+ true ->
+ wxFrame:destroy(ObjRef),
+ WWs2 = lists:delete(ObjRef, WWs),
+ ?MODULE:loop(S#state{warning_wins = WWs2});
+ false ->
+ error_logger:format("~p~p got unexpected "
+ "message:\n\t~p\n",
+ [?MODULE, self(), Msg]),
+ ?MODULE:loop(S)
+ end
end
end;
#wx{id = ?CLOSE_ITEM,
@@ -297,8 +307,8 @@ handle_child_exit({'EXIT', Pid, _Reason} = Exit, FWs, AWs) ->
msg_warning(Exit, application_window),
{FWs, lists:keydelete(Pid, #app_win.pid, AWs)};
false ->
- msg_warning(Exit, unknown),
- {FWs, AWs}
+ msg_warning(Exit, unknown),
+ {FWs, AWs}
end
end.
@@ -340,8 +350,12 @@ create_window(S) ->
fun create_main_release_page/1,
fun create_config_page/1
]),
+
+ S4 = create_warning_list(S3),
+
Sizer = wxBoxSizer:new(?wxVERTICAL),
wxSizer:add(Sizer, Book, [{flag, ?wxEXPAND}, {proportion, 1}]),
+ wxSizer:add(Sizer, S4#state.warning_list, [{flag, ?wxEXPAND}]),
wxPanel:setSizer(Panel, Sizer),
wxSizer:fit(Sizer, Frame),
@@ -349,7 +363,7 @@ create_window(S) ->
wxFrame:connect(Frame, close_window),
wxFrame:show(Frame),
- S3.
+ S4.
create_menubar(Frame) ->
MenuBar = wxMenuBar:new(),
@@ -444,6 +458,7 @@ create_app_list_ctrl(Panel, OuterSz, Title, Tick, Cross) ->
ListItem = wxListItem:new(),
wxListItem:setAlign(ListItem, ?wxLIST_FORMAT_LEFT),
wxListItem:setText(ListItem, Title),
+ wxListItem:setWidth(ListItem, reltool_utils:get_column_width(ListCtrl)),
wxListCtrl:insertColumn(ListCtrl, ?APPS_APP_COL, ListItem),
wxListItem:destroy(ListItem),
@@ -642,6 +657,49 @@ redraw_config_page(#state{sys = Sys, app_box = AppBox, mod_box = ModBox} = S) ->
wxRadioBox:setSelection(ModBox, ModChoice),
S.
+create_warning_list(#state{panel = Panel} = S) ->
+ ListCtrl = wxListCtrl:new(Panel,
+ [{style,
+ ?wxLC_REPORT bor
+ ?wxLC_HRULES bor
+ ?wxVSCROLL},
+ {size, {?WIN_WIDTH,80}}]),
+ reltool_utils:assign_image_list(ListCtrl),
+ wxListCtrl:insertColumn(ListCtrl, ?WARNING_COL, "Warnings",
+ [{format,?wxLIST_FORMAT_LEFT},
+ {width,reltool_utils:get_column_width(ListCtrl)}]),
+ wxListCtrl:setToolTip(ListCtrl, ?DEFAULT_WARNING_TIP),
+ wxEvtHandler:connect(ListCtrl, size,
+ [{skip, true}, {userData, warnings}]),
+ wxEvtHandler:connect(ListCtrl, command_list_item_activated,
+ [{userData, warnings}]),
+ wxEvtHandler:connect(ListCtrl, motion, [{userData, warnings}]),
+ wxEvtHandler:connect(ListCtrl, enter_window),
+ S#state{warning_list=ListCtrl}.
+
+redraw_warnings(S) ->
+ {ok,Warnings} = reltool_server:get_status(S#state.server_pid),
+ redraw_warnings(S#state.warning_list,Warnings),
+ length(Warnings).
+
+redraw_warnings(ListCtrl, []) ->
+ wxListCtrl:deleteAllItems(ListCtrl),
+ ok;
+redraw_warnings(ListCtrl, Warnings) ->
+ wxListCtrl:deleteAllItems(ListCtrl),
+ Show = fun(Warning, Row) ->
+ wxListCtrl:insertItem(ListCtrl, Row, ""),
+ wxListCtrl:setItem(ListCtrl,
+ Row,
+ ?WARNING_COL,
+ Warning,
+ [{imageId, ?WARN_IMAGE}]),
+ Row + 1
+ end,
+ wx:foldl(Show, 0, Warnings),
+ ok.
+
+
create_main_release_page(#state{book = Book} = S) ->
Panel = wxPanel:new(Book, []),
RelBook = wxNotebook:new(Panel, ?wxID_ANY, []),
@@ -783,6 +841,9 @@ escript_popup(S, File, Tree, Item) ->
handle_event(S, #wx{id = Id, obj= ObjRef, userData = UserData, event = Event} = _Wx) ->
%% io:format("wx: ~p\n", [Wx]),
case Event of
+ _ when UserData =:= warnings;
+ is_tuple(UserData), element(1,UserData)=:=warning ->
+ handle_warning_event(S, ObjRef, UserData, Event);
#wxSize{type = size, size = {W, _H}} when UserData =:= app_list_ctrl ->
wxListCtrl:setColumnWidth(ObjRef, ?APPS_APP_COL, W),
S;
@@ -848,7 +909,9 @@ handle_event(S, #wx{id = Id, obj= ObjRef, userData = UserData, event = Event} =
when S#state.popup_menu =/= undefined ->
handle_popup_event(S, Type, Id, ObjRef, UserData, Str);
#wxMouse{type = enter_window} ->
- wxWindow:setFocus(ObjRef),
+ %% The following is commented out because it raises the
+ %% main system window on top of popup windows.
+ %% wxWindow:setFocus(ObjRef),
S;
_ ->
case wxNotebook:getPageText(S#state.book,
@@ -860,6 +923,110 @@ handle_event(S, #wx{id = Id, obj= ObjRef, userData = UserData, event = Event} =
end
end.
+handle_warning_event(S, ObjRef, _, #wxSize{type = size}) ->
+ ColumnWidth = reltool_utils:get_column_width(ObjRef),
+ wxListCtrl:setColumnWidth(ObjRef, ?WARNING_COL, ColumnWidth),
+ S;
+handle_warning_event(S, ObjRef, _, #wxMouse{type = motion, x=X, y=Y}) ->
+ Pos = reltool_utils:wait_for_stop_motion(ObjRef, {X,Y}),
+ warning_list_set_tool_tip(os:type(),ObjRef,Pos),
+ S;
+handle_warning_event(S, ObjRef, _, #wxList{type = command_list_item_activated,
+ itemIndex = Pos}) ->
+ Text = wxListCtrl:getItemText(ObjRef, Pos),
+ S#state{warning_wins = [display_warning(S,Text) | S#state.warning_wins]};
+handle_warning_event(S, _ObjRef, {warning,Frame},
+ #wxCommand{type = command_button_clicked}) ->
+ wxFrame:destroy(Frame),
+ S#state{warning_wins = lists:delete(Frame,S#state.warning_wins)}.
+
+warning_list_set_tool_tip({win32,_},ListCtrl,{_X,Y}) ->
+ case win_find_item(ListCtrl,Y,0) of
+ -1 ->
+ wxListCtrl:setToolTip(ListCtrl,?DEFAULT_WARNING_TIP);
+ _Index ->
+ %% The following is commented out because there seems to
+ %% be an utomatic tooltip under Windows that shows the
+ %% expanded list item in case it is truncated because it
+ %% is too long for column width.
+ %% Tip =
+ %% case wxListCtrl:getItemText(ListCtrl,Index) of
+ %% "" ->
+ %% ?DEFAULT_WARNING_TIP;
+ %% Text ->
+ %% "WARNING:\n" ++ Text
+ %% end,
+ %% wxListCtrl:setToolTip(ListCtrl,Tip),
+ ok
+ end;
+warning_list_set_tool_tip(_,ListCtrl,Pos) ->
+ case wxListCtrl:findItem(ListCtrl,-1,Pos,0) of
+ Index when Index >= 0 ->
+ Tip =
+ case wxListCtrl:getItemText(ListCtrl,Index) of
+ "" ->
+ ?DEFAULT_WARNING_TIP;
+ Text ->
+ "WARNING:\n" ++ Text
+ end,
+ wxListCtrl:setToolTip(ListCtrl, Tip);
+ _ ->
+ ok
+ end.
+
+win_find_item(ListCtrl,YPos,Index) ->
+ case wxListCtrl:getItemRect(ListCtrl,Index) of
+ {true,{_,Y,_,H}} when YPos>=Y, YPos=<Y+H ->
+ Index;
+ {true,_} ->
+ win_find_item(ListCtrl,YPos,Index+1);
+ {false,_} ->
+ -1
+ end.
+
+display_warning(S,Warning) ->
+ Pos = warning_popup_position(S,?WARNING_POPUP_SIZE),
+ Frame = wxFrame:new(wx:null(), ?wxID_ANY, "Warning",[{pos,Pos}]),
+ Panel = wxPanel:new(Frame, []),
+ TextStyle = ?wxTE_READONLY bor ?wxTE_WORDWRAP bor ?wxTE_MULTILINE,
+ Text = wxTextCtrl:new(Panel, ?wxID_ANY, [{value, Warning},
+ {style, TextStyle},
+ {size, ?WARNING_POPUP_SIZE}]),
+ Attr = wxTextAttr:new(),
+ wxTextAttr:setLeftIndent(Attr,10),
+ wxTextAttr:setRightIndent(Attr,10),
+ true = wxTextCtrl:setDefaultStyle(Text, Attr),
+ wxTextAttr:destroy(Attr),
+ Sizer = wxBoxSizer:new(?wxVERTICAL),
+ wxSizer:add(Sizer, Text, [{border, 2},
+ {flag, ?wxEXPAND bor ?wxALL},
+ {proportion, 1}]),
+
+ Close = wxButton:new(Panel, ?wxID_ANY, [{label, "Close"}]),
+ wxButton:setToolTip(Close, "Close window."),
+ wxButton:connect(Close, command_button_clicked, [{userData,{warning,Frame}}]),
+ wxSizer:add(Sizer, Close, [{flag, ?wxALIGN_CENTER_HORIZONTAL}]),
+
+ wxPanel:setSizer(Panel, Sizer),
+ wxSizer:fit(Sizer, Frame),
+ wxSizer:setSizeHints(Sizer, Frame),
+ wxFrame:connect(Frame, close_window),
+
+ wxFrame:show(Frame),
+ Frame.
+
+warning_popup_position(#state{frame=MF,warning_list=WL},{WFW,WFH}) ->
+ {MFX,MFY} = wxWindow:getPosition(MF),
+ {MFW,MFH} = wxWindow:getSize(MF),
+ {_WLW,WLH} = wxWindow:getSize(WL),
+
+ %% Position the popup in the middle of the main frame, above the
+ %% warning list, and with a small offset from the exact middle...
+ Offset = 50,
+ X = MFX + (MFW-WFW) div 2 - Offset,
+ Y = MFY + (MFH-WLH-WFH) div 2 - Offset,
+ {X,Y}.
+
handle_popup_event(S, _Type, 0, _ObjRef, _UserData, _Str) ->
S#state{popup_menu = undefined};
handle_popup_event(#state{popup_menu = #root_popup{dir = OldDir,
@@ -1079,16 +1246,16 @@ handle_app_event(S, Event, ObjRef, UserData) ->
[?MODULE, self(), ObjRef, UserData, Event]),
S.
-handle_app_button(#state{server_pid = ServerPid, app_wins = AppWins} = S,
+handle_app_button(#state{server_pid = ServerPid,
+ status_bar = Bar,
+ app_wins = AppWins} = S,
Items,
Action) ->
+ wxStatusBar:setStatusText(Bar, "Processing libraries..."),
NewApps = [move_app(S, Item, Action) || Item <- Items],
case reltool_server:set_apps(ServerPid, NewApps) of
- {ok, []} ->
+ {ok, _Warnings} ->
ok;
- {ok, Warnings} ->
- Msg = lists:flatten([[W, $\n] || W <- Warnings]),
- display_message(Msg, ?wxICON_WARNING);
{error, Reason} ->
display_message(Reason, ?wxICON_ERROR)
end,
@@ -1125,23 +1292,22 @@ move_app(S, {_ItemNo, AppBase}, Action) ->
end,
OldApp#app{incl_cond = AppCond}.
-do_set_app(#state{server_pid = ServerPid, app_wins = AppWins} = S, NewApp) ->
+do_set_app(#state{server_pid = ServerPid,
+ status_bar = Bar,
+ app_wins = AppWins} = S, NewApp) ->
+ wxStatusBar:setStatusText(Bar, "Processing libraries..."),
Result = reltool_server:set_app(ServerPid, NewApp),
- [ok = reltool_app_win:refresh(AW#app_win.pid) || AW <- AppWins],
- S2 = redraw_apps(S),
ReturnApp =
case Result of
- {ok, AnalysedApp, []} ->
- AnalysedApp;
- {ok, AnalysedApp, Warnings} ->
- Msg = lists:flatten([[W, $\n] || W <- Warnings]),
- display_message(Msg, ?wxICON_WARNING),
+ {ok, AnalysedApp, _Warnings} ->
AnalysedApp;
{error, Reason} ->
display_message(Reason, ?wxICON_ERROR),
{ok,OldApp} = reltool_server:get_app(ServerPid, NewApp#app.name),
OldApp
end,
+ [ok = reltool_app_win:refresh(AW#app_win.pid) || AW <- AppWins],
+ S2 = redraw_apps(S),
{ok, ReturnApp, S2}.
redraw_apps(#state{server_pid = ServerPid,
@@ -1164,8 +1330,14 @@ redraw_apps(#state{server_pid = ServerPid,
WhiteN = redraw_apps(WhiteApps, WhiteCtrl, ?TICK_IMAGE, ?ERR_IMAGE),
redraw_apps(BlackApps2, BlackCtrl, ?CROSS_IMAGE, ?WARN_IMAGE),
DerivedN = redraw_apps(DerivedApps, DerivedCtrl, ?TICK_IMAGE, ?ERR_IMAGE),
+
+ WarningsN = redraw_warnings(S),
+ WarningText = if WarningsN==1 -> "warning";
+ true -> "warnings"
+ end,
Status = lists:concat([WhiteN, " whitelisted modules and ",
- DerivedN, " derived modules."]),
+ DerivedN, " derived modules, ",
+ WarningsN, " ", WarningText, "."]),
wxStatusBar:setStatusText(S#state.status_bar, Status),
S.
@@ -1323,26 +1495,28 @@ save_config(#state{config_file = OldFile} = S, InclDefaults, InclDerivates) ->
S
end.
-gen_rel_files(#state{target_dir = OldDir} = S) ->
+gen_rel_files(#state{status_bar = Bar, target_dir = OldDir} = S) ->
Style = ?wxFD_SAVE bor ?wxFD_OVERWRITE_PROMPT,
case select_dir(S#state.frame,
"Select a directory to generate rel, script and boot files to",
OldDir,
Style) of
{ok, NewDir} ->
+ wxStatusBar:setStatusText(Bar, "Processing libraries..."),
Status = reltool_server:gen_rel_files(S#state.server_pid, NewDir),
check_and_refresh(S, Status);
cancel ->
S
end.
-gen_target(#state{target_dir = OldDir} = S) ->
+gen_target(#state{status_bar = Bar, target_dir = OldDir} = S) ->
Style = ?wxFD_SAVE bor ?wxFD_OVERWRITE_PROMPT,
case select_dir(S#state.frame,
"Select a directory to generate a target system to",
OldDir,
Style) of
{ok, NewDir} ->
+ wxStatusBar:setStatusText(Bar, "Processing libraries..."),
Status = reltool_server:gen_target(S#state.server_pid, NewDir),
check_and_refresh(S#state{target_dir = NewDir}, Status);
cancel ->
@@ -1380,8 +1554,8 @@ check_and_refresh(S, Status) ->
case Status of
ok ->
true;
- {ok, Warnings} ->
- undo_dialog(S, Warnings);
+ {ok, _Warnings} ->
+ true;
{error, Reason} when is_list(Reason) ->
display_message(Reason, ?wxICON_ERROR),
false;
@@ -1435,19 +1609,6 @@ question_dialog(Question, Details) ->
wxDialog:destroy(Dialog),
Answer.
-undo_dialog(_S, []) ->
- true;
-undo_dialog(S, Warnings) ->
- Question = "Do you want to perform the update despite these warnings?",
- Details = lists:flatten([[W, $\n] || W <- Warnings]),
- case question_dialog(Question, Details) of
- ?wxID_OK ->
- true;
- ?wxID_CANCEL ->
- reltool_server:undo_config(S#state.server_pid),
- false
- end.
-
display_message(Message, Icon) ->
Dialog = wxMessageDialog:new(wx:null(),
Message,
@@ -1491,8 +1652,6 @@ add_text(_,_,[]) ->
ok.
-
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% sys callbacks
diff --git a/lib/reltool/src/reltool_target.erl b/lib/reltool/src/reltool_target.erl
index 0fcf89a360..6cb7ba0163 100644
--- a/lib/reltool/src/reltool_target.erl
+++ b/lib/reltool/src/reltool_target.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -101,7 +101,7 @@ do_gen_config(#sys{root_dir = RootDir,
|| A <- Apps,
A#app.name =/= ?MISSING_APP_NAME,
A#app.name =/= erts,
- not A#app.is_escript],
+ A#app.is_escript =/= true],
EscriptItems = [{escript,
A#app.active_dir,
emit(incl_cond, A#app.incl_cond, undefined, InclDefs)}
@@ -155,6 +155,7 @@ do_gen_config(#app{name = Name,
archive_opts = ArchiveOpts,
use_selected_vsn = UseSelected,
vsn = Vsn,
+ active_dir = ActiveDir,
mods = Mods,
is_included = IsIncl},
InclDefs) ->
@@ -170,9 +171,10 @@ do_gen_config(#app{name = Name,
emit(excl_archive_filters, ExclArchiveDirs, undefined, InclDefs),
emit(archive_opts, ArchiveOpts, undefined, InclDefs),
if
- IsIncl, InclDefs -> [{vsn, Vsn}];
- UseSelected -> [{vsn, Vsn}];
- true -> []
+ IsIncl, InclDefs -> [{vsn, Vsn}, {lib_dir, ActiveDir}];
+ UseSelected =:= vsn -> [{vsn, Vsn}];
+ UseSelected =:= dir -> [{lib_dir, ActiveDir}];
+ true -> []
end,
[do_gen_config(M, InclDefs) || M <- Mods]
],
@@ -208,10 +210,10 @@ do_gen_config(#rel_app{name = Name,
incl_apps = InclApps},
_InclDefs) ->
case {Type, InclApps} of
- {undefined, []} -> Name;
- {undefined, _} -> {Name, InclApps};
- {_, []} -> {Name, Type};
- {_, _} -> {Name, Type, InclApps}
+ {undefined, undefined} -> Name;
+ {undefined, _} -> {Name, InclApps};
+ {_, undefined} -> {Name, Type};
+ {_, _} -> {Name, Type, InclApps}
end;
do_gen_config({Tag, Val}, InclDefs) ->
emit(Tag, Val, undefined, InclDefs);
@@ -247,10 +249,15 @@ gen_app(#app{name = Name,
env = Env,
mod = StartMod,
start_phases = StartPhases}}) ->
- StartMod2 =
- case StartMod =:= undefined of
- true -> [];
- false -> [{mod, StartMod}]
+ StartPhases2 =
+ case StartPhases of
+ undefined -> [];
+ _ -> [{start_phases, StartPhases}]
+ end,
+ Tail =
+ case StartMod of
+ undefined -> StartPhases2;
+ _ -> [{mod, StartMod} | StartPhases2]
end,
{application, Name,
[{description, Desc},
@@ -261,10 +268,9 @@ gen_app(#app{name = Name,
{applications, ReqApps},
{included_applications, InclApps},
{env, Env},
- {start_phases, StartPhases},
{maxT, MaxT},
{maxP, MaxP} |
- StartMod2]}.
+ Tail]}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Generate the contents of a rel file
@@ -279,7 +285,7 @@ gen_rel(Rel, Sys) ->
{error, Text}
end.
-do_gen_rel(#rel{name = RelName, vsn = RelVsn},
+do_gen_rel(#rel{name = RelName, vsn = RelVsn, rel_apps = RelApps},
#sys{apps = Apps},
MergedApps) ->
ErtsName = erts,
@@ -288,7 +294,7 @@ do_gen_rel(#rel{name = RelName, vsn = RelVsn},
{release,
{RelName, RelVsn},
{ErtsName, Erts#app.vsn},
- [strip_rel_info(App) || App <- MergedApps]};
+ [strip_rel_info(App, RelApps) || App <- MergedApps]};
false ->
reltool_utils:throw_error("Mandatory application ~p is "
"not included",
@@ -298,13 +304,17 @@ do_gen_rel(#rel{name = RelName, vsn = RelVsn},
strip_rel_info(#app{name = Name,
vsn = Vsn,
app_type = Type,
- info = #app_info{incl_apps = InclApps}})
- when Type =/= undefined ->
- case {Type, InclApps} of
- {permanent, []} -> {Name, Vsn};
- {permanent, _} -> {Name, Vsn, InclApps};
- {_, []} -> {Name, Vsn, Type};
- {_, _} -> {Name, Vsn, Type, InclApps}
+ info = #app_info{incl_apps = AppInclApps}},
+ RelApps) when Type =/= undefined ->
+ RelInclApps = case lists:keyfind(Name,#rel_app.name,RelApps) of
+ #rel_app{incl_apps = RIA} when RIA =/= undefined -> RIA;
+ _ -> undefined
+ end,
+ case {Type, RelInclApps} of
+ {permanent, undefined} -> {Name, Vsn};
+ {permanent, _} -> {Name, Vsn, AppInclApps};
+ {_, undefined} -> {Name, Vsn, Type};
+ {_, _} -> {Name, Vsn, Type, AppInclApps}
end.
merge_apps(#rel{name = RelName,
@@ -323,7 +333,9 @@ merge_apps(#rel{name = RelName,
A#app.name =/= ?MISSING_APP_NAME,
not lists:keymember(A#app.name, #app.name, MergedApps2)],
MergedApps3 = do_merge_apps(RelName, Embedded, Apps, EmbAppType, MergedApps2),
- sort_apps(MergedApps3).
+ RevMerged = lists:reverse(MergedApps3),
+ MergedSortedUsedAndIncs = sort_used_and_incl_apps(RevMerged,RevMerged),
+ sort_apps(MergedSortedUsedAndIncs).
do_merge_apps(RelName, [#rel_app{name = Name} = RA | RelApps], Apps, RelAppType, Acc) ->
case is_already_merged(Name, RelApps, Acc) of
@@ -332,34 +344,29 @@ do_merge_apps(RelName, [#rel_app{name = Name} = RA | RelApps], Apps, RelAppType,
false ->
{value, App} = lists:keysearch(Name, #app.name, Apps),
MergedApp = merge_app(RelName, RA, RelAppType, App),
- MoreNames = (MergedApp#app.info)#app_info.applications,
+ ReqNames = (MergedApp#app.info)#app_info.applications,
+ IncNames = (MergedApp#app.info)#app_info.incl_apps,
Acc2 = [MergedApp | Acc],
- do_merge_apps(RelName, MoreNames ++ RelApps, Apps, RelAppType, Acc2)
+ do_merge_apps(RelName, ReqNames ++ IncNames ++ RelApps,
+ Apps, RelAppType, Acc2)
end;
do_merge_apps(RelName, [Name | RelApps], Apps, RelAppType, Acc) ->
case is_already_merged(Name, RelApps, Acc) of
true ->
do_merge_apps(RelName, RelApps, Apps, RelAppType, Acc);
false ->
- RelApp = init_rel_app(Name, Apps),
+ RelApp = #rel_app{name = Name},
do_merge_apps(RelName, [RelApp | RelApps], Apps, RelAppType, Acc)
end;
do_merge_apps(_RelName, [], _Apps, _RelAppType, Acc) ->
- lists:reverse(Acc).
-
-init_rel_app(Name, Apps) ->
- {value, App} = lists:keysearch(Name, #app.name, Apps),
- Info = App#app.info,
- #rel_app{name = Name,
- app_type = undefined,
- incl_apps = Info#app_info.incl_apps}.
+ Acc.
merge_app(RelName,
- #rel_app{name = Name,
- app_type = Type,
- incl_apps = InclApps},
- RelAppType,
- App) ->
+ #rel_app{name = Name,
+ app_type = Type,
+ incl_apps = InclApps0},
+ RelAppType,
+ App) ->
Type2 =
case {Type, App#app.app_type} of
{undefined, undefined} -> RelAppType;
@@ -367,6 +374,11 @@ merge_app(RelName,
{_, _} -> Type
end,
Info = App#app.info,
+ InclApps =
+ case InclApps0 of
+ undefined -> Info#app_info.incl_apps;
+ _ -> InclApps0
+ end,
case InclApps -- Info#app_info.incl_apps of
[] ->
App#app{app_type = Type2, info = Info#app_info{incl_apps = InclApps}};
@@ -421,7 +433,10 @@ do_gen_script(#rel{name = RelName, vsn = RelVsn},
Mandatory = mandatory_modules(),
Early = Mandatory ++ Preloaded,
{value, KernelApp} = lists:keysearch(kernel, #app.name, MergedApps),
- InclApps = [I || #app{info = #app_info{incl_apps = I}} <- MergedApps],
+ InclApps = lists:flatmap(fun(#app{info = #app_info{incl_apps = I}}) ->
+ I
+ end,
+ MergedApps),
%% Create the script
DeepList =
@@ -471,7 +486,7 @@ load_app_mods(#app{mods = Mods} = App, Mand, PathFlag, Variables) ->
Path = cr_path(App, PathFlag, Variables),
PartNames =
lists:sort([{packages:split(M),M} ||
- #mod{name = M} <- Mods,
+ #mod{name = M, is_included=true} <- Mods,
not lists:member(M, Mand)]),
SplitMods =
lists:foldl(
@@ -496,6 +511,56 @@ load_app_mods(#app{mods = Mods} = App, Mand, PathFlag, Variables) ->
SplitMods).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% sort_used_and_incl_apps(Apps, OrderedApps) -> Apps
+%% Apps = [#app{}]
+%% OrderedApps = [#app{}]
+%%
+%% OTP-4121, OTP-9984
+%% (Tickets are written for systools, but needs to be implemented here
+%% as well.)
+%% Make sure that used and included applications are given in the same
+%% order as in the release resource file (.rel). Otherwise load and
+%% start instructions in the boot script, and consequently release
+%% upgrade instructions in relup, may end up in the wrong order.
+
+sort_used_and_incl_apps([#app{info=Info} = App|Apps], OrderedApps) ->
+ Incls2 =
+ case Info#app_info.incl_apps of
+ Incls when length(Incls)>1 ->
+ sort_appl_list(Incls, OrderedApps);
+ Incls ->
+ Incls
+ end,
+ Uses2 =
+ case Info#app_info.applications of
+ Uses when length(Uses)>1 ->
+ sort_appl_list(Uses, OrderedApps);
+ Uses ->
+ Uses
+ end,
+ App2 = App#app{info=Info#app_info{incl_apps=Incls2, applications=Uses2}},
+ [App2|sort_used_and_incl_apps(Apps, OrderedApps)];
+sort_used_and_incl_apps([], _OrderedApps) ->
+ [].
+
+sort_appl_list(List, Order) ->
+ IndexedList = find_pos(List, Order),
+ SortedIndexedList = lists:keysort(1, IndexedList),
+ lists:map(fun({_Index,Name}) -> Name end, SortedIndexedList).
+
+find_pos([Name|Incs], OrderedApps) ->
+ [find_pos(1, Name, OrderedApps)|find_pos(Incs, OrderedApps)];
+find_pos([], _OrderedApps) ->
+ [].
+
+find_pos(N, Name, [#app{name=Name}|_OrderedApps]) ->
+ {N, Name};
+find_pos(N, Name, [_OtherAppl|OrderedApps]) ->
+ find_pos(N+1, Name, OrderedApps).
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Function: sort_apps(Apps) -> {ok, Apps'} | throw({error, Error})
%% Types: Apps = {{Name, Vsn}, #application}]
%% Purpose: Sort applications according to dependencies among
@@ -513,7 +578,12 @@ sort_apps([#app{name = Name, info = Info} = App | Apps],
Circular,
Visited) ->
{Uses, Apps1, NotFnd1} =
- find_all(Name, Info#app_info.applications, Apps, Visited, [], []),
+ find_all(Name,
+ lists:reverse(Info#app_info.applications),
+ Apps,
+ Visited,
+ [],
+ []),
{Incs, Apps2, NotFnd2} =
find_all(Name,
lists:reverse(Info#app_info.incl_apps),
@@ -671,6 +741,8 @@ strip_name_ebin(Dir, Name, Vsn) ->
case lists:reverse(Dir) of
["ebin", Name | D] -> {ok, lists:reverse(D)};
["ebin", FullName | D] -> {ok, lists:reverse(D)};
+ [Name | D] -> {ok, lists:reverse(D)};
+ [FullName | D] -> {ok, lists:reverse(D)};
_ -> false
end.
@@ -717,8 +789,20 @@ do_spec_rel_files(#rel{name = RelName} = Rel, Sys) ->
BootFile = RelName ++ ".boot",
MergedApps = merge_apps(Rel, Sys),
GenRel = do_gen_rel(Rel, Sys, MergedApps),
+ Variables =
+ case Sys#sys.excl_lib of
+ otp_root ->
+ %% All applications that are fetched from somewhere
+ %% other than $OTP_ROOT/lib will get $RELTOOL_EXT_LIB
+ %% as path prefix in the .script file.
+ [{"RELTOOL_EXT_LIB",LibDir} || LibDir <- Sys#sys.lib_dirs] ++
+ [{"RELTOOL_EXT_LIB",filename:dirname(AppLibDir)} ||
+ #app{active_dir=AppLibDir,use_selected_vsn=dir}
+ <- MergedApps];
+ _ ->
+ []
+ end,
PathFlag = true,
- Variables = [],
{ok, Script} = do_gen_script(Rel, Sys, MergedApps, PathFlag, Variables),
{ok, BootBin} = gen_boot(Script),
Date = date(),
@@ -755,29 +839,34 @@ gen_spec(Sys) ->
end.
do_gen_spec(#sys{root_dir = RootDir,
+ excl_lib = ExclLib,
incl_sys_filters = InclRegexps,
excl_sys_filters = ExclRegexps,
relocatable = Relocatable,
apps = Apps} = Sys) ->
- {create_dir, _, SysFiles} = spec_dir(RootDir),
- {ExclRegexps2, SysFiles2} =
- strip_sys_files(Relocatable, SysFiles, Apps, ExclRegexps),
RelFiles = spec_rel_files(Sys),
- {InclRegexps2, BinFiles} =
- spec_bin_files(Sys, SysFiles, SysFiles2, RelFiles, InclRegexps),
+ {SysFiles, InclRegexps2, ExclRegexps2, Mandatory} =
+ case ExclLib of
+ otp_root ->
+ {[],InclRegexps,ExclRegexps,["lib"]};
+ _ ->
+ {create_dir, _, SF} = spec_dir(RootDir),
+ {ER2, SF2} = strip_sys_files(Relocatable, SF, Apps, ExclRegexps),
+ {IR2, BinFiles} =
+ spec_bin_files(Sys, SF, SF2, RelFiles, InclRegexps),
+ SF3 = [{create_dir, "bin", BinFiles}] ++ SF2,
+ {SF3,IR2,ER2,["bin","erts","lib"]}
+ end,
LibFiles = spec_lib_files(Sys),
{BootVsn, StartFile} = spec_start_file(Sys),
- SysFiles3 =
- [
- {create_dir, "releases",
+ SysFiles2 =
+ [{create_dir, "releases",
[StartFile,
- {create_dir,BootVsn, RelFiles}]},
- {create_dir, "bin", BinFiles}
- ] ++ SysFiles2,
- SysFiles4 = filter_spec(SysFiles3, InclRegexps2, ExclRegexps2),
- SysFiles5 = SysFiles4 ++ [{create_dir, "lib", LibFiles}],
- check_sys(["bin", "erts", "lib"], SysFiles5),
- SysFiles5.
+ {create_dir,BootVsn, RelFiles}]}] ++ SysFiles,
+ SysFiles3 = filter_spec(SysFiles2, InclRegexps2, ExclRegexps2),
+ SysFiles4 = SysFiles3 ++ [{create_dir, "lib", LibFiles}],
+ check_sys(Mandatory, SysFiles4),
+ SysFiles4.
strip_sys_files(Relocatable, SysFiles, Apps, ExclRegexps) ->
ExclRegexps2 =
@@ -895,7 +984,7 @@ spec_escripts(#sys{apps = Apps}, ErtsBin, BinFiles) ->
if
Name =:= ?MISSING_APP_NAME ->
false;
- not IsEscript ->
+ IsEscript =/= true ->
false;
IsIncl; IsPre ->
{true, do_spec_escript(File, ErtsBin, BinFiles)};
@@ -951,22 +1040,35 @@ safe_lookup_spec(Prefix, Specs) ->
%% Specify applications
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-spec_lib_files(#sys{apps = Apps} = Sys) ->
+spec_lib_files(#sys{root_dir = RootDir,
+ apps = Apps,
+ excl_lib = ExclLib} = Sys) ->
Filter = fun(#app{is_escript = IsEscript, is_included = IsIncl,
- is_pre_included = IsPre, name = Name}) ->
+ is_pre_included = IsPre, name = Name,
+ active_dir = ActiveDir}) ->
if
Name =:= ?MISSING_APP_NAME ->
false;
- IsEscript ->
+ IsEscript =/= false ->
false;
IsIncl; IsPre ->
- true;
+ case ExclLib of
+ otp_root ->
+ not lists:prefix(RootDir,ActiveDir);
+ _ ->
+ true
+ end;
true ->
false
end
end,
SelectedApps = lists:filter(Filter, Apps),
- check_apps([kernel, stdlib], SelectedApps),
+ case ExclLib of
+ otp_root ->
+ ok;
+ _ ->
+ check_apps([kernel, stdlib], SelectedApps)
+ end,
lists:flatten([spec_app(App, Sys) || App <- SelectedApps]).
check_apps([Mandatory | Names], Apps) ->
@@ -1372,12 +1474,10 @@ do_install(RelName, TargetDir) ->
BinDir = filename:join([TargetDir2, "bin"]),
case os:type() of
{win32, _} ->
- NativeRootDir = filename:nativename(TargetDir2),
- %% NativeBinDir =
- %% filename:nativename(filename:join([BinDir, "win32"])),
- NativeBinDir = filename:nativename(BinDir),
+ NativeRootDir = nativename(TargetDir2),
+ NativeErtsBinDir = nativename(ErtsBinDir),
IniData = ["[erlang]\r\n",
- "Bindir=", NativeBinDir, "\r\n",
+ "Bindir=", NativeErtsBinDir, "\r\n",
"Progname=erl\r\n",
"Rootdir=", NativeRootDir, "\r\n"],
IniFile = filename:join([BinDir, "erl.ini"]),
@@ -1397,6 +1497,15 @@ do_install(RelName, TargetDir) ->
reltool_utils:throw_error("~s: Illegal data file syntax", [DataFile])
end.
+nativename(Dir) ->
+ escape_backslash(filename:nativename(Dir)).
+escape_backslash([$\\|T]) ->
+ [$\\,$\\|escape_backslash(T)];
+escape_backslash([H|T]) ->
+ [H|escape_backslash(T)];
+escape_backslash([]) ->
+ [].
+
subst_src_scripts(Scripts, SrcDir, DestDir, Vars, Opts) ->
Fun = fun(Script) ->
subst_src_script(Script, SrcDir, DestDir, Vars, Opts)
diff --git a/lib/reltool/src/reltool_utils.erl b/lib/reltool/src/reltool_utils.erl
index 39d057d994..6149d6ef06 100644
--- a/lib/reltool/src/reltool_utils.erl
+++ b/lib/reltool/src/reltool_utils.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -22,15 +22,17 @@
-export([root_dir/0, erl_libs/0, lib_dirs/1,
split_app_name/1, prim_consult/1,
default_rels/0, choose_default/3,
+ normalize_dir/1,
- assign_image_list/1, get_latest_resize/1,
+ assign_image_list/1, get_latest_resize/1, wait_for_stop_motion/2,
mod_conds/0, list_to_mod_cond/1, mod_cond_to_index/1,
incl_conds/0, list_to_incl_cond/1, incl_cond_to_index/1, elem_to_index/2,
app_dir_test/2, split_app_dir/1,
get_item/1, get_items/1, get_selected_items/3,
select_items/3, select_item/2,
+ get_column_width/1,
- safe_keysearch/5, print/4, return_first_error/2, add_warning/2,
+ safe_keysearch/5, print/4, add_warning/3,
create_dir/1, list_dir/1, read_file_info/1,
write_file_info/2, read_file/1, write_file/2,
@@ -86,6 +88,21 @@ split_app_name(Name) ->
{list_to_atom(Name), ""}
end.
+
+normalize_dir(RelDir) ->
+ Tokens = filename:split(filename:absname(RelDir)),
+ filename:join(lists:reverse(normalize_dir(Tokens, []))).
+
+normalize_dir([".."|Dirs], [_Dir|Path]) ->
+ normalize_dir(Dirs, Path);
+normalize_dir(["."|Dirs], Path) ->
+ normalize_dir(Dirs, Path);
+normalize_dir([Dir|Dirs], Path) ->
+ normalize_dir(Dirs, [Dir|Path]);
+normalize_dir([], Path) ->
+ Path.
+
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
prim_consult(Bin) when is_binary(Bin) ->
@@ -126,18 +143,14 @@ prim_parse(Tokens, Acc) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
default_rels() ->
- %%Kernel = #rel_app{name = kernel, incl_apps = []},
- %%Stdlib = #rel_app{name = stdlib, incl_apps = []},
- Sasl = #rel_app{name = sasl, incl_apps = []},
+ %% kernel and stdlib are added automatically in every release
[
#rel{name = ?DEFAULT_REL_NAME,
vsn = "1.0",
rel_apps = []},
- %%rel_apps = [Kernel, Stdlib]},
#rel{name = "start_sasl",
vsn = "1.0",
- rel_apps = [Sasl]}
- %%rel_apps = [Kernel, Sasl, Stdlib]}
+ rel_apps = [#rel_app{name = sasl}]}
].
choose_default(Tag, Profile, InclDefs)
@@ -191,6 +204,16 @@ get_latest_resize(#wx{obj = ObjRef, event = #wxSize{}} = Wx) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+wait_for_stop_motion(ObjRef, {_,_}=Pos) ->
+ receive
+ #wx{obj = ObjRef, event = #wxMouse{type = motion, x=X, y=Y}} ->
+ wait_for_stop_motion(ObjRef, {X,Y})
+ after 100 ->
+ Pos
+ end.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
mod_conds() ->
["all (ebin + app file)", "ebin + derived", "app file + derived", "derived", "none"].
@@ -249,7 +272,7 @@ app_dir_test(Dir1, Dir2) ->
Name1 > Name2 -> false;
Vsn1 < Vsn2 -> false;
Vsn1 > Vsn2 -> true;
- Parent1 < Parent2 -> true;
+ Parent1 =< Parent2 -> true;
true -> false
end.
@@ -377,6 +400,26 @@ select_item(ListCtrl, [{ItemNo, Text} | Items]) ->
select_item(_ListCtrl, []) ->
ok.
+get_column_width(ListCtrl) ->
+ wx:batch(fun() ->
+ {Total, _} = wxWindow:getClientSize(ListCtrl),
+ Total - scroll_size(ListCtrl)
+ end).
+
+scroll_size(ObjRef) ->
+ case os:type() of
+ {win32, nt} -> 0;
+ {unix, darwin} ->
+ %% I can't figure out is there is a visible scrollbar
+ %% Always make room for it
+ wxSystemSettings:getMetric(?wxSYS_VSCROLL_X);
+ _ ->
+ case wxWindow:hasScrollbar(ObjRef, ?wxVERTICAL) of
+ true -> wxSystemSettings:getMetric(?wxSYS_VSCROLL_X);
+ false -> 0
+ end
+ end.
+
safe_keysearch(Key, Pos, List, Mod, Line) ->
case lists:keysearch(Key, Pos, List) of
false ->
@@ -392,31 +435,13 @@ print(X, X, Format, Args) ->
print(_, _, _, _) ->
ok.
-%% -define(SAFE(M,F,A), safe(M, F, A, ?MODULE, ?LINE)).
-%%
-%% safe(M, F, A, Mod, Line) ->
-%% case catch apply(M, F, A) of
-%% {'EXIT', Reason} ->
-%% io:format("~p(~p): ~p:~p~p -> ~p\n", [Mod, Line, M, F, A, Reason]),
-%% timer:sleep(infinity);
-%% Res ->
-%% Res
-%% end.
-
-return_first_error(Status, NewError) when is_list(NewError) ->
- case Status of
- {ok, _Warnings} ->
- {error, NewError};
- {error, OldError} ->
- {error, OldError}
- end.
-
-add_warning(Status, Warning) ->
- case Status of
- {ok, Warnings} ->
- {ok, [Warning | Warnings]};
- {error, Error} ->
- {error, Error}
+add_warning(Format, Args, {ok,Warnings}) ->
+ Warning = lists:flatten(io_lib:format(Format,Args)),
+ case lists:member(Warning,Warnings) of
+ true ->
+ {ok,Warnings};
+ false ->
+ {ok,[Warning|Warnings]}
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/lib/reltool/test/Makefile b/lib/reltool/test/Makefile
index 767454b66a..52cdef44da 100644
--- a/lib/reltool/test/Makefile
+++ b/lib/reltool/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2011. All Rights Reserved.
+# Copyright Ericsson AB 2009-2012. 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
@@ -28,6 +28,7 @@ MODULES= \
reltool_app_SUITE \
reltool_wx_SUITE \
reltool_server_SUITE \
+ reltool_manual_gui_SUITE \
reltool_test_lib
@@ -48,7 +49,7 @@ RELSYSDIR = $(RELEASE_PATH)/reltool_test
# ----------------------------------------------------
# FLAGS
# ----------------------------------------------------
-#ERL_COMPILE_FLAGS +=
+ERL_COMPILE_FLAGS += -pa $(ERL_TOP)/lib/reltool/ebin/
EBIN = .
@@ -72,12 +73,12 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) reltool.spec reltool.cover $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)
- $(INSTALL_SCRIPT) rtt $(INSTALL_PROGS) $(RELSYSDIR)
- $(INSTALL_DATA) $(INSTALL_PROGS) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) reltool.spec reltool.cover $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_SCRIPT) rtt $(INSTALL_PROGS) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(INSTALL_PROGS) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/reltool/test/reltool.spec b/lib/reltool/test/reltool.spec
index 2995720105..2501a7a203 100644
--- a/lib/reltool/test/reltool.spec
+++ b/lib/reltool/test/reltool.spec
@@ -1 +1,2 @@
{suites,"../reltool_test",all}.
+{skip_suites,"../reltool_test",[reltool_manual_gui_SUITE],"Manual only"}.
diff --git a/lib/reltool/test/reltool_manual_gui_SUITE.erl b/lib/reltool/test/reltool_manual_gui_SUITE.erl
new file mode 100644
index 0000000000..0dcc5cbf15
--- /dev/null
+++ b/lib/reltool/test/reltool_manual_gui_SUITE.erl
@@ -0,0 +1,266 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+
+-module(reltool_manual_gui_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).
+
+-include_lib("common_test/include/ct.hrl").
+-include("reltool_test_lib.hrl").
+
+%% Initialization functions.
+init_per_suite(Config) ->
+ reltool_test_lib:wx_init_per_suite(Config).
+
+end_per_suite(Config) ->
+ reltool_test_lib:wx_end_per_suite(Config).
+
+init_per_testcase(Func,Config) ->
+ reltool_test_lib:init_per_testcase(Func,Config).
+end_per_testcase(Func,Config) ->
+ reltool_test_lib:end_per_testcase(Func,Config).
+
+%% SUITE specification
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [config, depgraphs].
+
+groups() ->
+ [].
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+
+%% The test cases
+
+%% Semi-automatic walkthrough of the GUI
+config(Config) ->
+ DataDir = ?config(data_dir,Config),
+ PrivDir = ?config(priv_dir,Config),
+ {ok, SysPid} = ?msym({ok, _}, reltool:start([])),
+ link(SysPid),
+
+ SimpleConfigFile = create_simple_config(PrivDir),
+ WarningConfigFile = create_warning_config(PrivDir,DataDir),
+
+ break("there are no modules in the 'Included' and 'Excluded' columns, "
+ "and now warnings are displayed",
+ {"load configuration ~p",[SimpleConfigFile]}),
+ break("kernel, stdlib and sasl are included and all other are excluded",
+ "undo"),
+ break("we are back to default - no included and no excluded applications",
+ "undo again"),
+ break("kernel, stdlib and sasl are included and all other are excluded",
+ {"load configuration ~p",
+ [WarningConfigFile]}),
+ break("a warning is displayed in the warning list",
+ "undo"),
+ break("no warning is displayed in the warning list",
+ "load same configuration again"),
+ break("application a is added in the 'Included' column and "
+ "one warning is displayed",
+ "reset configuration"),
+ break("we are back to default - no included and no excluded applications, "
+ "and no warnings",
+ "undo"),
+ break("a, kernel, stdlib and sasl are included and all other are excluded. "
+ "One warning should now exist through the rest of this test case",
+ "double click the warning"),
+ break("a popup window occurs displaying the warning text",
+ "close it with the 'Close' button"),
+ break("it disappears",
+ "open it again"),
+ break("the warning text can be marked, copied and pasted",
+ "close the popup with the close box on the top frame"),
+ break("it disappears",
+ "select application a from 'Included' column and click 'cross'-button "
+ "with to exclude it"),
+ break("application a is moved to 'Excluded' column",
+ "select application tools from 'Excluded' column and click "
+ "'tick'-button to include it"),
+ break("application tools is moved to 'Included' column",
+ "select application runtime_tools from 'Excluded' column and click "
+ "'tick'-button to include it"),
+ break("application runtime_tools is moved to 'Included' column",
+ "undo"),
+
+ ExplicitConfig = filename:join(PrivDir,"explicit.config"),
+ break("application runtime_tools is moved back to 'Excluded' column",
+ {"save configuration as 'explicit' to ~p",[ExplicitConfig]}),
+ ExpectedExplicitConfig =
+ {sys,[{lib_dirs,[filename:join(DataDir,"faulty_app_file")]},
+ {incl_cond,exclude},
+ {app,a,[{incl_cond,exclude}]},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,tools,[{incl_cond,include}]}]},
+ check_config(ExpectedExplicitConfig,ExplicitConfig),
+
+ break("The saved configuration file is checked and is ok.\n"
+ "Now go to the 'Libraries' tab and change the root directory to "
+ "some invalid directory."),
+ break("an error dialog occurs saying that there is no lib dir",
+ {"add library directory ~p",
+ [filename:join(DataDir,"dependencies")]}),
+ break("applications x, y and z are added to the 'Excluded' column in "
+ "'Applications' tab",
+ "go to the 'System settings' tab and set application inclusion policy "
+ "to 'derived'"),
+ break("a is excluded, kernel, stdlib, sasl and tools are included and "
+ "x, y and z are available in the 'Applications' tab",
+ "undo"),
+ break("all non included application are moved to the 'Excluded' column "
+ "and that 'Application inclusion policy' under 'System settings' "
+ "tab is set back to 'exclude'",
+ "undo again"),
+ break("applications x, y and z are in the 'Available' column",
+ "open application x, go to the 'Application settings' tab and set "
+ "'Application inclusion policy' to 'Use application specific config' "
+ "and 'include'. Close the window"),
+ break("application x is moved to the 'Included' column and z and y are moved "
+ "to the 'Derived' column in the system window",
+ "open application y"),
+ break("modules y1, y2 and y3 are in the 'Derived' column",
+ "go to 'Application dependencies' tab"),
+ break("application y is used by x, requires kernel and stdlib, and uses z",
+ "go to 'Module dependencies' tab"),
+ break("y is used by x2 and x3, and uses z1",
+ "got to 'Application settings' tab and select "
+ "'Source selection policy' 'Use selected version'"),
+ break("'Directories' frame becomes enabled (clickable)",
+ "select 'Module inclusion policy' 'Use application specific config' "
+ "and select 'app file + derived'"),
+ break("module y3 is moved to the 'Available' column in the 'Modules' tab",
+ "open module y1"),
+ break("module y1 is used by x2 and uses z1",
+ "go to the 'Code' tab and double click the line with call to z1:f()"),
+ break("new tab is opened with module z1",
+ "find something"),
+ break("it is found",
+ "goto some line"),
+ break("the cursor is moved to that line",
+ "click the 'Back' button"),
+ break("the cursor is moved back to the line of your previous 'find'",
+ "terminate the application window (but keep the module window)."),
+
+ {ok,ServerPid} = reltool:get_server(SysPid),
+ unlink(SysPid),
+ break("the system window is still alive",
+ "terminate reltool by hitting 'Ctrl-q' (linux) or clicking the "
+ "close box on the top fram when system window is active"),
+ false = erlang:is_process_alive(SysPid),
+ false = erlang:is_process_alive(ServerPid),
+
+ break("Check that both module window and system window are terminated"),
+
+ ok.
+
+
+depgraphs(Config) ->
+ PrivDir = ?config(priv_dir,Config),
+ SimpleConfigFile = create_simple_config(PrivDir),
+ {ok, SysPid} = ?msym({ok, _}, reltool:start([{config,SimpleConfigFile}])),
+ link(SysPid),
+
+ break("Open the application dependency graph and \n\n"
+ "*move the complete graph by left clicking somewhere over it and drag\n"
+ "*move one node left clicking the node and drag\n"
+ "*lock node to position by holding down shift while releasing\n"
+ "*select several nodes with ctrl and left mouse button\n"
+ "*lock/unlock selected nodes with suitable buttons\n"
+ "*freeze\n"
+ "*reset\n"
+ "*left slider: push nodes apart\n"
+ "*right slider: pull nodes together\n"
+ "*middle slider: adjust length of links\n"
+ "*select node and delete\n"),
+ break("Open the module dependency graph and meditate over it... "),
+
+ unlink(SysPid),
+ break("Terminate reltool from the file menu in the system window"),
+ false = erlang:is_process_alive(SysPid),
+
+ break("Check that system window and graphs are terminated"),
+
+ ok.
+
+
+
+
+%%%-----------------------------------------------------------------
+%%% Internal functions
+break(CheckStr,DoStr) when is_list(CheckStr), is_list(DoStr) ->
+ Str = io_lib:format("Check that ~s.~n~nThen ~s.",[CheckStr,DoStr]),
+ break(Str);
+break(Check,Do) ->
+ CheckStr =
+ case Check of
+ {CheckFormat,CheckArgs} -> io_lib:format(CheckFormat,CheckArgs);
+ _ -> Check
+ end,
+ DoStr =
+ case Do of
+ {DoFormat,DoArgs} -> io_lib:format(DoFormat,DoArgs);
+ _ -> Do
+ end,
+ break(CheckStr,DoStr).
+
+break(Str) ->
+ Count =
+ case get(count) of
+ undefined -> 1;
+ C -> C
+ end,
+ put(count,Count+1),
+ test_server:break("Step " ++ integer_to_list(Count) ++ ":\n" ++ Str).
+
+check_config(Expected,File) ->
+ {ok,[Config]} = file:consult(File),
+ ?m(Expected,Config).
+
+create_simple_config(PrivDir) ->
+ SimpleConfigFile = filename:join(PrivDir,"simple.config"),
+ SimpleConfig = {sys,[{incl_cond,exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]}]},
+ ok=file:write_file(SimpleConfigFile,io_lib:format("~p.~n",[SimpleConfig])),
+ SimpleConfigFile.
+
+create_warning_config(PrivDir,DataDir) ->
+ WarningConfigFile = filename:join(PrivDir,"warning.config"),
+ FaultyAppFileDir = filename:join(DataDir,"faulty_app_file"),
+ WarningConfig = {sys,[{lib_dirs,[FaultyAppFileDir]},
+ {incl_cond,exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,a,[{incl_cond,include}]}
+ ]},
+ ok=file:write_file(WarningConfigFile,io_lib:format("~p.~n",[WarningConfig])),
+ WarningConfigFile.
diff --git a/lib/reltool/test/reltool_manual_gui_SUITE_data/Makefile.src b/lib/reltool/test/reltool_manual_gui_SUITE_data/Makefile.src
new file mode 100644
index 0000000000..9a340274ad
--- /dev/null
+++ b/lib/reltool/test/reltool_manual_gui_SUITE_data/Makefile.src
@@ -0,0 +1,28 @@
+EFLAGS=+debug_info
+
+DEPENDENCIES= \
+ dependencies/x-1.0/ebin/x1.@EMULATOR@ \
+ dependencies/x-1.0/ebin/x2.@EMULATOR@ \
+ dependencies/x-1.0/ebin/x3.@EMULATOR@ \
+ dependencies/y-1.0/ebin/y1.@EMULATOR@ \
+ dependencies/y-1.0/ebin/y2.@EMULATOR@ \
+ dependencies/y-1.0/ebin/y3.@EMULATOR@ \
+ dependencies/z-1.0/ebin/z1.@EMULATOR@
+
+
+all: $(DEPENDENCIES)
+
+dependencies/x-1.0/ebin/x1.@EMULATOR@: dependencies/x-1.0/src/x1.erl
+ erlc $(EFLAGS) -odependencies/x-1.0/ebin dependencies/x-1.0/src/x1.erl
+dependencies/x-1.0/ebin/x2.@EMULATOR@: dependencies/x-1.0/src/x2.erl
+ erlc $(EFLAGS) -odependencies/x-1.0/ebin dependencies/x-1.0/src/x2.erl
+dependencies/x-1.0/ebin/x3.@EMULATOR@: dependencies/x-1.0/src/x3.erl
+ erlc $(EFLAGS) -odependencies/x-1.0/ebin dependencies/x-1.0/src/x3.erl
+dependencies/y-1.0/ebin/y1.@EMULATOR@: dependencies/y-1.0/src/y1.erl
+ erlc $(EFLAGS) -odependencies/y-1.0/ebin dependencies/y-1.0/src/y1.erl
+dependencies/y-1.0/ebin/y2.@EMULATOR@: dependencies/y-1.0/src/y2.erl
+ erlc $(EFLAGS) -odependencies/y-1.0/ebin dependencies/y-1.0/src/y2.erl
+dependencies/y-1.0/ebin/y3.@EMULATOR@: dependencies/y-1.0/src/y3.erl
+ erlc $(EFLAGS) -odependencies/y-1.0/ebin dependencies/y-1.0/src/y3.erl
+dependencies/z-1.0/ebin/z1.@EMULATOR@: dependencies/z-1.0/src/z1.erl
+ erlc $(EFLAGS) -odependencies/z-1.0/ebin dependencies/z-1.0/src/z1.erl
diff --git a/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/ebin/x.app b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/ebin/x.app
new file mode 100644
index 0000000000..ccaab8a8c7
--- /dev/null
+++ b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/ebin/x.app
@@ -0,0 +1,7 @@
+% -*-erlang-*-
+{application, x,
+ [{description, "Main application in reltool dependency test"},
+ {vsn, "1.0"},
+ {modules, [x1,x2,x3]},
+ {registered, []},
+ {applications, [kernel, stdlib]}]}.
diff --git a/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/src/x1.erl b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/src/x1.erl
new file mode 100644
index 0000000000..bf1e7f9279
--- /dev/null
+++ b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/src/x1.erl
@@ -0,0 +1,5 @@
+-module(x1).
+-compile(export_all).
+
+f() ->
+ ok.
diff --git a/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/src/x2.erl b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/src/x2.erl
new file mode 100644
index 0000000000..82191ba278
--- /dev/null
+++ b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/src/x2.erl
@@ -0,0 +1,5 @@
+-module(x2).
+-compile(export_all).
+
+f() ->
+ y1:f().
diff --git a/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/src/x3.erl b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/src/x3.erl
new file mode 100644
index 0000000000..618c75c9a7
--- /dev/null
+++ b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/x-1.0/src/x3.erl
@@ -0,0 +1,5 @@
+-module(x3).
+-compile(export_all).
+
+f() ->
+ y2:f().
diff --git a/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/ebin/y.app b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/ebin/y.app
new file mode 100644
index 0000000000..4f9b610b69
--- /dev/null
+++ b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/ebin/y.app
@@ -0,0 +1,7 @@
+% -*-erlang-*-
+{application, y,
+ [{description, "Library application in reltool dependency test"},
+ {vsn, "1.0"},
+ {modules, [y1,y2]}, % y3 is skipped on purpose - to test module inclusion policy
+ {registered, []},
+ {applications, [kernel, stdlib]}]}.
diff --git a/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/src/y1.erl b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/src/y1.erl
new file mode 100644
index 0000000000..dd21b33292
--- /dev/null
+++ b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/src/y1.erl
@@ -0,0 +1,5 @@
+-module(y1).
+-compile(export_all).
+
+f() ->
+ z1:f().
diff --git a/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/src/y2.erl b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/src/y2.erl
new file mode 100644
index 0000000000..bf8ddf6080
--- /dev/null
+++ b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/src/y2.erl
@@ -0,0 +1,5 @@
+-module(y2).
+-compile(export_all).
+
+f() ->
+ ok.
diff --git a/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/src/y3.erl b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/src/y3.erl
new file mode 100644
index 0000000000..915d64d5b9
--- /dev/null
+++ b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/y-1.0/src/y3.erl
@@ -0,0 +1,5 @@
+-module(y3).
+-compile(export_all).
+
+f() ->
+ ok.
diff --git a/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/z-1.0/ebin/z.app b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/z-1.0/ebin/z.app
new file mode 100644
index 0000000000..437a0968e9
--- /dev/null
+++ b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/z-1.0/ebin/z.app
@@ -0,0 +1,7 @@
+% -*-erlang-*-
+{application, z,
+ [{description, "Library application in reltool dependency test"},
+ {vsn, "1.0"},
+ {modules, [z1]},
+ {registered, []},
+ {applications, [kernel, stdlib]}]}.
diff --git a/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/z-1.0/src/z1.erl b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/z-1.0/src/z1.erl
new file mode 100644
index 0000000000..97ef90b87f
--- /dev/null
+++ b/lib/reltool/test/reltool_manual_gui_SUITE_data/dependencies/z-1.0/src/z1.erl
@@ -0,0 +1,5 @@
+-module(z1).
+-compile(export_all).
+
+f() ->
+ ok.
diff --git a/lib/reltool/test/reltool_manual_gui_SUITE_data/faulty_app_file/a-1.0/ebin/a.app b/lib/reltool/test/reltool_manual_gui_SUITE_data/faulty_app_file/a-1.0/ebin/a.app
new file mode 100644
index 0000000000..ea77103598
--- /dev/null
+++ b/lib/reltool/test/reltool_manual_gui_SUITE_data/faulty_app_file/a-1.0/ebin/a.app
@@ -0,0 +1 @@
+faulty app file
diff --git a/lib/sasl/test/release_handler_SUITE_data/P2B/a-2.0/src/a.erl b/lib/reltool/test/reltool_manual_gui_SUITE_data/faulty_app_file/a-1.0/src/a.erl
index cfe38b55ce..bb500bed69 100644
--- a/lib/sasl/test/release_handler_SUITE_data/P2B/a-2.0/src/a.erl
+++ b/lib/reltool/test/reltool_manual_gui_SUITE_data/faulty_app_file/a-1.0/src/a.erl
@@ -20,6 +20,8 @@
-behaviour(gen_server).
+-vsn(1).
+
%% External exports
-export([start_link/0, a/0]).
%% Internal exports
diff --git a/lib/sasl/test/release_handler_SUITE_data/P2B/a-2.0/src/a_sup.erl b/lib/reltool/test/reltool_manual_gui_SUITE_data/faulty_app_file/a-1.0/src/a_sup.erl
index a141c1767b..a141c1767b 100644
--- a/lib/sasl/test/release_handler_SUITE_data/P2B/a-2.0/src/a_sup.erl
+++ b/lib/reltool/test/reltool_manual_gui_SUITE_data/faulty_app_file/a-1.0/src/a_sup.erl
diff --git a/lib/reltool/test/reltool_server_SUITE.erl b/lib/reltool/test/reltool_server_SUITE.erl
index 9ed79e8c95..8d71865508 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -24,6 +24,7 @@
-compile(export_all).
+-include_lib("reltool/src/reltool.hrl").
-include("reltool_test_lib.hrl").
-include_lib("common_test/include/ct.hrl").
@@ -51,10 +52,48 @@ end_per_testcase(Func,Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [start_server, set_config, create_release,
- create_script, create_target, create_embedded,
- create_standalone, create_old_target,
- otp_9135, otp_9229_exclude_app, otp_9229_exclude_mod].
+ [start_server,
+ set_config,
+ get_config,
+ create_release,
+ create_release_sort,
+ create_script,
+ create_script_sort,
+ create_target,
+ create_embedded,
+ create_standalone,
+ create_standalone_beam,
+ create_standalone_app,
+ create_standalone_app_clash,
+ create_multiple_standalone,
+ create_old_target,
+ create_slim,
+ eval_target_spec,
+ otp_9135,
+ otp_9229_dupl_mod_exclude_app,
+ otp_9229_dupl_mod_exclude_mod,
+ dupl_mod_in_app_file,
+ get_apps,
+ get_mod,
+ get_sys,
+ set_app_and_undo,
+ set_apps_and_undo,
+ set_apps_inlined,
+ set_sys_and_undo,
+ load_config_and_undo,
+ load_config_fail,
+ load_config_escript_path,
+ load_config_same_escript_source,
+ load_config_same_escript_beam,
+ load_config_add_escript,
+ reset_config_and_undo,
+ gen_rel_files,
+ save_config,
+ dependencies,
+ mod_incl_cond_derived,
+ use_selected_vsn,
+ use_selected_vsn_relative_path,
+ non_standard_vsn_id].
groups() ->
[].
@@ -69,10 +108,17 @@ end_per_group(_GroupName, Config) ->
%% The test cases
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% A dummy break test case which is NOT in all(), but can be run
+%% directly from the command line with ct_run. It just does a
+%% test_server:break()...
+break(_Config) ->
+ test_server:break(""),
+ ok.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Start a server process and check that it does not crash
-start_server(TestInfo) when is_atom(TestInfo) ->
- reltool_test_lib:tc_info(TestInfo);
start_server(_Config) ->
{ok, Pid} = ?msym({ok, _}, reltool:start_server([])),
Libs = lists:sort(erl_libs()),
@@ -88,8 +134,6 @@ start_server(_Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Start a server process and check that it does not crash
-set_config(TestInfo) when is_atom(TestInfo) ->
- reltool_test_lib:tc_info(TestInfo);
set_config(_Config) ->
Libs = lists:sort(erl_libs()),
Default =
@@ -112,10 +156,102 @@ set_config(_Config) ->
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Check that get_config returns the expected derivates and defaults
+%% as specified
+get_config(_Config) ->
+
+ KVsn = latest(kernel),
+ StdVsn = latest(stdlib),
+ SaslVsn = latest(sasl),
+
+ LibDir = code:lib_dir(),
+ KLibDir = filename:join(LibDir,"kernel-"++KVsn),
+ StdLibDir = filename:join(LibDir,"stdlib-"++StdVsn),
+ SaslLibDir = filename:join(LibDir,"sasl-"++SaslVsn),
+
+ Sys = {sys,[{incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include},{vsn,SaslVsn}]},
+ {app,stdlib,[{incl_cond,include},{lib_dir,StdLibDir}]}]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])),
+ ?m({ok, Sys}, reltool:get_config(Pid)),
+ ?m({ok, Sys}, reltool:get_config(Pid,false,false)),
+
+ %% Include derived info
+ ?msym({ok,{sys,[{incl_cond, exclude},
+ {erts,[]},
+ {app,kernel,[{incl_cond,include},{mod,_,[]}|_]},
+ {app,sasl,[{incl_cond,include},{vsn,SaslVsn},{mod,_,[]}|_]},
+ {app,stdlib,[{incl_cond,include},{lib_dir,StdLibDir},
+ {mod,_,[]}|_]}]}},
+ reltool:get_config(Pid,false,true)),
+
+ %% Include defaults
+ ?msym({ok,{sys,[{root_dir,_},
+ {lib_dirs,_},
+ {mod_cond,all},
+ {incl_cond,exclude},
+ {app,kernel,[{incl_cond,include},{vsn,undefined},
+ {lib_dir,undefined}]},
+ {app,sasl,[{incl_cond,include},{vsn,SaslVsn},
+ {lib_dir,undefined}]},
+ {app,stdlib,[{incl_cond,include},{vsn,undefined},
+ {lib_dir,StdLibDir}]},
+ {boot_rel,"start_clean"},
+ {rel,"start_clean","1.0",[]},
+ {rel,"start_sasl","1.0",[sasl]},
+ {emu_name,"beam"},
+ {relocatable,true},
+ {profile,development},
+ {incl_sys_filters,[".*"]},
+ {excl_sys_filters,[]},
+ {incl_app_filters,[".*"]},
+ {excl_app_filters,[]},
+ {incl_archive_filters,[".*"]},
+ {excl_archive_filters,["^include$","^priv$"]},
+ {archive_opts,[]},
+ {rel_app_type,permanent},
+ {app_file,keep},
+ {debug_info,keep}]}},
+ reltool:get_config(Pid,true,false)),
+
+ %% Include both defaults and derived info
+ ?msym({ok,{sys,[{root_dir,_},
+ {lib_dirs,_},
+ {mod_cond,all},
+ {incl_cond,exclude},
+ {erts,[]},
+ {app,kernel,[{incl_cond,include},{vsn,KVsn},
+ {lib_dir,KLibDir},{mod,_,[]}|_]},
+ {app,sasl,[{incl_cond,include},{vsn,SaslVsn},
+ {lib_dir,SaslLibDir},{mod,_,[]}|_]},
+ {app,stdlib,[{incl_cond,include},{vsn,StdVsn},
+ {lib_dir,StdLibDir},{mod,_,[]}|_]},
+ {boot_rel,"start_clean"},
+ {rel,"start_clean","1.0",[]},
+ {rel,"start_sasl","1.0",[sasl]},
+ {emu_name,"beam"},
+ {relocatable,true},
+ {profile,development},
+ {incl_sys_filters,[".*"]},
+ {excl_sys_filters,[]},
+ {incl_app_filters,[".*"]},
+ {excl_app_filters,[]},
+ {incl_archive_filters,[".*"]},
+ {excl_archive_filters,["^include$","^priv$"]},
+ {archive_opts,[]},
+ {rel_app_type,permanent},
+ {app_file,keep},
+ {debug_info,keep}]}},
+ reltool:get_config(Pid,true,true)),
+
+ ?m(ok, reltool:stop(Pid)),
+ ok.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% OTP-9135, test that app_file option can be set to all | keep | strip
-otp_9135(TestInfo) when is_atom(TestInfo) ->
- reltool_test_lib:tc_info(TestInfo);
otp_9135(_Config) ->
Libs = lists:sort(erl_libs()),
StrippedDefaultSys =
@@ -145,8 +281,6 @@ otp_9135(_Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Generate releases
-create_release(TestInfo) when is_atom(TestInfo) ->
- reltool_test_lib:tc_info(TestInfo);
create_release(_Config) ->
%% Configure the server
RelName = "Just testing...",
@@ -170,10 +304,161 @@ create_release(_Config) ->
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Generate releases and make sure order of applications specified in
+%% 'rel' parameter is preserved and that included applications are
+%% started before the including application.
+%% Circular dependencies shall also be detected and cause error.
+
+create_release_sort(Config) ->
+ DataDir = ?config(data_dir,Config),
+ %% Configure the server
+ RelName1 = "MnesiaFirst",
+ RelName2 = "SaslFirst",
+ RelName3 = "Include-both",
+ RelName4 = "Include-only-app",
+ RelName5 = "Include-only-rel",
+ RelName6 = "Auto-add-missing-apps",
+ RelName7 = "Circular",
+ RelName8 = "Include-rel-alter-order",
+ RelName9 = "Include-none-overwrite",
+ RelName10= "Uses-order-as-rel",
+ RelName11= "Auto-add-dont-overwrite-load",
+ RelVsn = "1.0",
+ %% Application z (.app file):
+ %% includes [tools, mnesia]
+ %% uses [kernel, stdlib, sasl, inets]
+ Sys =
+ {sys,
+ [
+ {lib_dirs, [filename:join(DataDir,"sort_apps")]},
+ {boot_rel, RelName1},
+ {rel, RelName1, RelVsn, [stdlib, kernel, mnesia, sasl]},
+ {rel, RelName2, RelVsn, [stdlib, kernel, sasl, mnesia]},
+ {rel, RelName3, RelVsn, [stdlib, kernel, {z,[tools]}, tools, mnesia]},
+ {rel, RelName4, RelVsn, [stdlib, kernel, z, mnesia, tools]},
+ {rel, RelName5, RelVsn, [stdlib, kernel, {sasl,[tools]}]},
+ {rel, RelName6, RelVsn, [z]},
+ {rel, RelName7, RelVsn, [stdlib, kernel, mnesia, y, sasl, x]},
+ {rel, RelName8, RelVsn, [stdlib, kernel, {z,[mnesia,tools]}]},
+ {rel, RelName9, RelVsn, [stdlib, kernel, {z,[]}]},
+ {rel, RelName10, RelVsn, [stdlib, kernel, {z,[]}, inets, sasl]},
+ {rel, RelName11, RelVsn, [stdlib, kernel, z, {inets, load}]},
+ {incl_cond,exclude},
+ {mod_cond,app},
+ {app,kernel,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,mnesia,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,inets,[{incl_cond,include}]},
+ {app,x,[{incl_cond,include}]},
+ {app,y,[{incl_cond,include}]},
+ {app,z,[{incl_cond,include}]},
+ {app,tools,[{mod_cond,app},{incl_cond,include}]}
+ ]},
+ %% Generate release
+
+ ?msym({ok, {release, {RelName1, RelVsn},
+ {erts, _},
+ [{kernel, _},
+ {stdlib, _},
+ {mnesia, _},
+ {sasl, _}]}},
+ reltool:get_rel([{config, Sys}], RelName1)),
+
+ ?msym({ok, {release, {RelName2, RelVsn},
+ {erts, _},
+ [{kernel, _},
+ {stdlib, _},
+ {sasl, _},
+ {mnesia, _}]}},
+ reltool:get_rel([{config, Sys}], RelName2)),
+
+ ?msym({ok, {release, {RelName3, RelVsn},
+ {erts, _},
+ [{kernel, _},
+ {stdlib, _},
+ {sasl, _},
+ {inets, _},
+ {tools, _},
+ {z, _, [tools]},
+ {mnesia, _}]}},
+ reltool:get_rel([{config, Sys}], RelName3)),
+
+ ?msym({ok, {release, {RelName4, RelVsn},
+ {erts, _},
+ [{kernel, _},
+ {stdlib, _},
+ {sasl, _},
+ {inets, _},
+ {mnesia, _},
+ {tools, _},
+ {z, _}]}},
+ reltool:get_rel([{config, Sys}], RelName4)),
+
+ ?m({error,"sasl: These applications are used by release "
+ "Include-only-rel but are missing as included_applications "
+ "in the app file: [tools]"},
+ reltool:get_rel([{config, Sys}], RelName5)),
+
+ ?msym({ok, {release, {RelName6, RelVsn},
+ {erts, _},
+ [{kernel, _},
+ {stdlib, _},
+ {sasl, _},
+ {inets, _},
+ {tools, _},
+ {mnesia, _},
+ {z, _}]}},
+ reltool:get_rel([{config, Sys}], RelName6)),
+
+ ?m({error,"Circular dependencies: [x,y]"},
+ reltool:get_rel([{config, Sys}], RelName7)),
+
+ ?msym({ok, {release, {RelName8, RelVsn},
+ {erts, _},
+ [{kernel, _},
+ {stdlib, _},
+ {sasl, _},
+ {inets, _},
+ {mnesia, _},
+ {tools, _},
+ {z, _, [mnesia,tools]}]}},
+ reltool:get_rel([{config, Sys}], RelName8)),
+
+ ?msym({ok,{release,{RelName9,RelVsn},
+ {erts,_},
+ [{kernel,_},
+ {stdlib,_},
+ {sasl, _},
+ {inets, _},
+ {z,_,[]}]}},
+ reltool:get_rel([{config, Sys}], RelName9)),
+
+ ?msym({ok,{release,{RelName10,RelVsn},
+ {erts,_},
+ [{kernel,_},
+ {stdlib,_},
+ {inets, _},
+ {sasl, _},
+ {z,_,[]}]}},
+ reltool:get_rel([{config, Sys}], RelName10)),
+
+ ?msym({ok,{release,{RelName11,RelVsn},
+ {erts,_},
+ [{kernel,_},
+ {stdlib,_},
+ {sasl, _},
+ {inets, _, load},
+ {tools, _},
+ {mnesia, _},
+ {z,_}]}},
+ reltool:get_rel([{config, Sys}], RelName11)),
+
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Generate boot scripts
-create_script(TestInfo) when is_atom(TestInfo) ->
- reltool_test_lib:tc_info(TestInfo);
create_script(_Config) ->
%% Configure the server
RelName = "Just testing",
@@ -218,10 +503,223 @@ create_script(_Config) ->
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Test creation of .script with different sorting of applications and
+%% included applications.
+%% Test that result is equal to what systools produces
+create_script_sort(Config) ->
+ DataDir = ?config(data_dir,Config),
+ %% Configure the server
+ RelName1 = "MnesiaFirst",
+ RelName2 = "SaslFirst",
+ RelName3 = "Include-both",
+ RelName4 = "Include-only-app",
+ RelName5 = "Include-only-rel",
+ RelName6 = "Auto-add-missing-apps",
+ RelName7 = "Circular",
+ RelName8 = "Include-rel-alter-order",
+ RelName9 = "Include-none-overwrite",
+ RelName10= "Uses-order-as-rel",
+ RelVsn = "1.0",
+ LibDir = filename:join(DataDir,"sort_apps"),
+ %% Application z (.app file):
+ %% includes [tools, mnesia]
+ %% uses [kernel, stdlib, sasl, inets]
+ Sys =
+ {sys,
+ [
+ {lib_dirs, [LibDir]},
+ {boot_rel, RelName1},
+ {rel, RelName1, RelVsn, [stdlib, kernel, mnesia, sasl]},
+ {rel, RelName2, RelVsn, [stdlib, kernel, sasl, mnesia]},
+ {rel, RelName3, RelVsn, [stdlib, kernel, {z,[tools]}, tools, mnesia]},
+ {rel, RelName4, RelVsn, [stdlib, kernel, z, mnesia, tools]},
+ {rel, RelName5, RelVsn, [stdlib, kernel, {sasl,[tools]}]},
+ {rel, RelName6, RelVsn, [z]},
+ {rel, RelName7, RelVsn, [stdlib, kernel, mnesia, y, sasl, x]},
+ {rel, RelName8, RelVsn, [stdlib, kernel, {z,[mnesia,tools]}]},
+ {rel, RelName9, RelVsn, [stdlib, kernel, {z,[]}]},
+ {rel, RelName10, RelVsn, [stdlib, kernel, {z,[]}, inets, sasl]},
+ {incl_cond,exclude},
+ {mod_cond,app},
+ {app,kernel,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,mnesia,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,inets,[{incl_cond,include}]},
+ {app,x,[{incl_cond,include}]},
+ {app,y,[{incl_cond,include}]},
+ {app,z,[{incl_cond,include}]},
+ {app,tools,[{mod_cond,app},{incl_cond,include}]}
+ ]},
+
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])),
+
+ %% Generate release files
+ application:load(sasl),
+ application:load(inets),
+ application:load(mnesia),
+ application:load(tools),
+ {ok,KernelVsn} = application:get_key(kernel,vsn),
+ {ok,StdlibVsn} = application:get_key(stdlib,vsn),
+ {ok,SaslVsn} = application:get_key(sasl,vsn),
+ {ok,InetsVsn} = application:get_key(inets,vsn),
+ {ok,MnesiaVsn} = application:get_key(mnesia,vsn),
+ {ok,ToolsVsn} = application:get_key(tools,vsn),
+ ErtsVsn = erlang:system_info(version),
+
+ Rel1 = {release, {RelName1,RelVsn}, {erts,ErtsVsn},
+ [{kernel,KernelVsn},
+ {stdlib,StdlibVsn},
+ {mnesia,MnesiaVsn},
+ {sasl,SaslVsn}]},
+ FullName1 = filename:join(?WORK_DIR,RelName1),
+ ?m(ok, file:write_file(FullName1 ++ ".rel", io_lib:format("~p.\n", [Rel1]))),
+ Rel2 = {release, {RelName2,RelVsn}, {erts,ErtsVsn},
+ [{kernel,KernelVsn},
+ {stdlib,StdlibVsn},
+ {sasl,SaslVsn},
+ {mnesia,MnesiaVsn}]},
+ FullName2 = filename:join(?WORK_DIR,RelName2),
+ ?m(ok, file:write_file(FullName2 ++ ".rel", io_lib:format("~p.\n", [Rel2]))),
+ Rel3 = {release, {RelName3,RelVsn}, {erts,ErtsVsn},
+ [{kernel,KernelVsn},
+ {stdlib,StdlibVsn},
+ {z,"1.0",[tools]},
+ {tools,ToolsVsn},
+ {mnesia,MnesiaVsn},
+ {sasl,SaslVsn},
+ {inets,InetsVsn}]},
+ FullName3 = filename:join(?WORK_DIR,RelName3),
+ ?m(ok, file:write_file(FullName3 ++ ".rel", io_lib:format("~p.\n", [Rel3]))),
+ Rel4 = {release, {RelName4,RelVsn}, {erts,ErtsVsn},
+ [{kernel,KernelVsn},
+ {stdlib,StdlibVsn},
+ {z,"1.0"},
+ {mnesia,MnesiaVsn},
+ {tools,ToolsVsn},
+ {sasl,SaslVsn},
+ {inets,InetsVsn}]},
+ FullName4 = filename:join(?WORK_DIR,RelName4),
+ ?m(ok, file:write_file(FullName4 ++ ".rel", io_lib:format("~p.\n", [Rel4]))),
+ Rel5 = {release, {RelName5,RelVsn}, {erts,ErtsVsn},
+ [{kernel,KernelVsn},
+ {stdlib,StdlibVsn},
+ {sasl,SaslVsn,[tools]},
+ {tools,ToolsVsn}]},
+ FullName5 = filename:join(?WORK_DIR,RelName5),
+ ?m(ok, file:write_file(FullName5 ++ ".rel", io_lib:format("~p.\n", [Rel5]))),
+ Rel6 = {release, {RelName6,RelVsn}, {erts,ErtsVsn},
+ [{kernel,KernelVsn},
+ {stdlib,StdlibVsn},
+ {sasl,SaslVsn},
+ {inets,InetsVsn},
+ {tools,ToolsVsn},
+ {mnesia,MnesiaVsn},
+ {z,"1.0"}]},
+ FullName6 = filename:join(?WORK_DIR,RelName6),
+ ?m(ok, file:write_file(FullName6 ++ ".rel", io_lib:format("~p.\n", [Rel6]))),
+ Rel7 = {release, {RelName7,RelVsn}, {erts,ErtsVsn},
+ [{kernel,KernelVsn},
+ {stdlib,StdlibVsn},
+ {mnesia,MnesiaVsn},
+ {y,"1.0"},
+ {sasl,SaslVsn},
+ {x,"1.0"}]},
+ FullName7 = filename:join(?WORK_DIR,RelName7),
+ ?m(ok, file:write_file(FullName7 ++ ".rel", io_lib:format("~p.\n", [Rel7]))),
+ Rel8 = {release, {RelName8,RelVsn}, {erts,ErtsVsn},
+ [{kernel,KernelVsn},
+ {stdlib,StdlibVsn},
+ {z,"1.0",[mnesia,tools]},
+ {sasl,SaslVsn},
+ {inets,InetsVsn},
+ {mnesia,MnesiaVsn},
+ {tools,ToolsVsn}]},
+ FullName8 = filename:join(?WORK_DIR,RelName8),
+ ?m(ok, file:write_file(FullName8 ++ ".rel", io_lib:format("~p.\n", [Rel8]))),
+ Rel9 = {release, {RelName9,RelVsn}, {erts,ErtsVsn},
+ [{kernel,KernelVsn},
+ {stdlib,StdlibVsn},
+ {z,"1.0",[]},
+ {sasl,SaslVsn},
+ {inets,InetsVsn}]},
+ FullName9 = filename:join(?WORK_DIR,RelName9),
+ ?m(ok, file:write_file(FullName9 ++ ".rel", io_lib:format("~p.\n", [Rel9]))),
+ Rel10 = {release, {RelName10,RelVsn}, {erts,ErtsVsn},
+ [{kernel,KernelVsn},
+ {stdlib,StdlibVsn},
+ {z,"1.0",[]},
+ {inets,InetsVsn},
+ {sasl,SaslVsn}]},
+ FullName10 = filename:join(?WORK_DIR,RelName10),
+ ?m(ok, file:write_file(FullName10 ++ ".rel", io_lib:format("~p.\n", [Rel10]))),
+
+ %% Generate script files with systools and reltool and compare
+ ZPath = filename:join([LibDir,"*",ebin]),
+
+ ?msym({ok,_,_}, systools_make_script(FullName1,ZPath)),
+ {ok, [SystoolsScript1]} = ?msym({ok,[_]}, file:consult(FullName1++".script")),
+ {ok, Script1} = ?msym({ok, _}, reltool:get_script(Pid, RelName1)),
+ ?m(equal, diff_script(SystoolsScript1, Script1)),
+
+ ?msym({ok,_,_}, systools_make_script(FullName2,ZPath)),
+ {ok, [SystoolsScript2]} = ?msym({ok,[_]}, file:consult(FullName2++".script")),
+ {ok, Script2} = ?msym({ok, _}, reltool:get_script(Pid, RelName2)),
+ ?m(equal, diff_script(SystoolsScript2, Script2)),
+
+ ?msym({ok,_,_}, systools_make_script(FullName3,ZPath)),
+ {ok, [SystoolsScript3]} = ?msym({ok,[_]}, file:consult(FullName3++".script")),
+ {ok, Script3} = ?msym({ok, _}, reltool:get_script(Pid, RelName3)),
+ ?m(equal, diff_script(SystoolsScript3, Script3)),
+
+ ?msym({ok,_,_}, systools_make_script(FullName4,ZPath)),
+ {ok, [SystoolsScript4]} = ?msym({ok,[_]}, file:consult(FullName4++".script")),
+ {ok, Script4} = ?msym({ok, _}, reltool:get_script(Pid, RelName4)),
+ ?m(equal, diff_script(SystoolsScript4, Script4)),
+
+ ?msym({error,_,[{error_reading,{sasl,{override_include,_}}}]},
+ systools_make_script(FullName5,ZPath)),
+ ?m({error,"sasl: These applications are used by release "
+ "Include-only-rel but are missing as included_applications "
+ "in the app file: [tools]"},
+ reltool:get_script(Pid, RelName5)),
+
+ ?msym({ok,_,_}, systools_make_script(FullName6,ZPath)),
+ {ok, [SystoolsScript6]} = ?msym({ok,[_]}, file:consult(FullName6++".script")),
+ {ok, Script6} = ?msym({ok, _}, reltool:get_script(Pid, RelName6)),
+ ?m(equal, diff_script(SystoolsScript6, Script6)),
+
+ ?msym({error,_,{circular_dependencies,_}},
+ systools_make_script(FullName7,ZPath)),
+ ?m({error,"Circular dependencies: [x,y]"},
+ reltool:get_script(Pid, RelName7)),
+
+ ?msym({ok,_,_}, systools_make_script(FullName8,ZPath)),
+ {ok, [SystoolsScript8]} = ?msym({ok,[_]}, file:consult(FullName8++".script")),
+ {ok, Script8} = ?msym({ok, _}, reltool:get_script(Pid, RelName8)),
+ ?m(equal, diff_script(SystoolsScript8, Script8)),
+
+ ?msym({ok,_,_}, systools_make_script(FullName9,ZPath)),
+ {ok, [SystoolsScript9]} = ?msym({ok,[_]}, file:consult(FullName9++".script")),
+ {ok, Script9} = ?msym({ok, _}, reltool:get_script(Pid, RelName9)),
+ ?m(equal, diff_script(SystoolsScript9, Script9)),
+
+ ?msym({ok,_,_}, systools_make_script(FullName10,ZPath)),
+ {ok, [SystoolsScript10]} = ?msym({ok,[_]}, file:consult(FullName10++".script")),
+ {ok, Script10} = ?msym({ok, _}, reltool:get_script(Pid, RelName10)),
+ ?m(equal, diff_script(SystoolsScript10, Script10)),
+
+ %% Stop server
+ ?m(ok, reltool:stop(Pid)),
+ ok.
+
+
+systools_make_script(Name,Path) ->
+ systools:make_script(Name,[{path,[Path]},{outdir,?WORK_DIR},silent]).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Generate target system
-create_target(TestInfo) when is_atom(TestInfo) ->
- reltool_test_lib:tc_info(TestInfo);
create_target(_Config) ->
%% Configure the server
RelName1 = "Just testing",
@@ -243,7 +741,7 @@ create_target(_Config) ->
?m(ok, reltool_utils:recursive_delete(TargetDir)),
?m(ok, file:make_dir(TargetDir)),
?log("SPEC: ~p\n", [reltool:get_target_spec([{config, Config}])]),
- ?m(ok, reltool:create_target([{config, Config}], TargetDir)),
+ ok = ?m(ok, reltool:create_target([{config, Config}], TargetDir)),
Erl = filename:join([TargetDir, "bin", "erl"]),
{ok, Node} = ?msym({ok, _}, start_node(?NODE_NAME, Erl)),
@@ -254,8 +752,6 @@ create_target(_Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Generate embedded target system
-create_embedded(TestInfo) when is_atom(TestInfo) ->
- reltool_test_lib:tc_info(TestInfo);
create_embedded(_Config) ->
%% Configure the server
RelName1 = "Just testing",
@@ -276,7 +772,7 @@ create_embedded(_Config) ->
TargetDir = filename:join([?WORK_DIR, "target_embedded"]),
?m(ok, reltool_utils:recursive_delete(TargetDir)),
?m(ok, file:make_dir(TargetDir)),
- ?m(ok, reltool:create_target([{config, Config}], TargetDir)),
+ ok = ?m(ok, reltool:create_target([{config, Config}], TargetDir)),
Erl = filename:join([TargetDir, "bin", "erl"]),
{ok, Node} = ?msym({ok, _}, start_node(?NODE_NAME, Erl)),
@@ -287,8 +783,6 @@ create_embedded(_Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Generate standalone system
-create_standalone(TestInfo) when is_atom(TestInfo) ->
- reltool_test_lib:tc_info(TestInfo);
create_standalone(_Config) ->
%% Configure the server
ExDir = code:lib_dir(reltool, examples),
@@ -306,30 +800,221 @@ create_standalone(_Config) ->
TargetDir = filename:join([?WORK_DIR, "target_standalone"]),
?m(ok, reltool_utils:recursive_delete(TargetDir)),
?m(ok, file:make_dir(TargetDir)),
- ?m(ok, reltool:create_target([{config, Config}], TargetDir)),
+ ok = ?m(ok, reltool:create_target([{config, Config}], TargetDir)),
+ %% Start the target system and fetch root dir
BinDir = filename:join([TargetDir, "bin"]),
Erl = filename:join([BinDir, "erl"]),
{ok, Node} = ?msym({ok, _}, start_node(?NODE_NAME, Erl)),
RootDir = ?ignore(rpc:call(Node, code, root_dir, [])),
?msym(ok, stop_node(Node)),
+ %% Execute escript
Expected = iolist_to_binary(["Root dir: ", RootDir, "\n"
"Script args: [\"-arg1\",\"arg2\",\"arg3\"]\n",
"Smp: false\n",
"ExitCode:0"]),
io:format("Expected: ~s\n", [Expected]),
- ?m(Expected, run(BinDir, EscriptName ++ " -arg1 arg2 arg3")),
+ ?m(Expected, run(BinDir, EscriptName, "-arg1 arg2 arg3")),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Generate old type of target system
+%% Generate standalone system with inlined beam file
+
+create_standalone_beam(Config) ->
+ %% Read beam file
+ DataDir = ?config(data_dir,Config),
+ BeamFile = filename:join([DataDir,escript,"someapp-1.0",ebin,"mymod.beam"]),
+ {ok,BeamBin} = file:read_file(BeamFile),
+
+ %% Create the escript
+ EscriptName = "mymod.escript",
+ Escript = filename:join(?WORK_DIR,EscriptName),
+ ok = escript:create(Escript,[shebang,{beam,BeamBin}]),
+ ok = file:change_mode(Escript,8#00744),
+
+ %% Configure the server
+ Sys =
+ {sys,
+ [
+ {lib_dirs, []},
+ {escript, Escript, [{incl_cond, include}]},
+ {profile, standalone}
+ ]},
+
+ %% Generate target file
+ TargetDir = filename:join([?WORK_DIR, "target_standalone_beam"]),
+ ?m(ok, reltool_utils:recursive_delete(TargetDir)),
+ ?m(ok, file:make_dir(TargetDir)),
+ ok = ?m(ok, reltool:create_target([{config, Sys}], TargetDir)),
+
+ %% Start the target system and fetch root dir
+ BinDir = filename:join([TargetDir, "bin"]),
+ Erl = filename:join([BinDir, "erl"]),
+ {ok, Node} = ?msym({ok, _}, start_node(?NODE_NAME, Erl)),
+ RootDir = ?ignore(rpc:call(Node, code, root_dir, [])),
+ ?msym(ok, stop_node(Node)),
+
+ %% Execute escript
+ Expected = iolist_to_binary(["Root dir: ", RootDir, "\n"
+ "Script args: [\"-arg1\",\"arg2\",\"arg3\"]\n",
+ "ExitCode:0"]),
+ io:format("Expected: ~s\n", [Expected]),
+ ?m(Expected, run(BinDir, EscriptName, "-arg1 arg2 arg3")),
+
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Generate standalone system with inlined archived application
+
+create_standalone_app(Config) ->
+ %% Create archive
+ DataDir = ?config(data_dir,Config),
+ EscriptDir = filename:join(DataDir,escript),
+ {ok,{_Archive,Bin}} = zip:create("someapp-1.0.ez",["someapp-1.0"],
+ [memory,
+ {cwd,EscriptDir},
+ {compress,all},
+ {uncompress,[".beam",".app"]}]),
+
+ %% Create the escript
+ EscriptName = "someapp.escript",
+ Escript = filename:join(?WORK_DIR,EscriptName),
+ ok = escript:create(Escript,[shebang,
+ {emu_args,"-escript main mymod"},
+ {archive,Bin}]),
+ ok = file:change_mode(Escript,8#00744),
+
+ %% Configure the server
+ Sys =
+ {sys,
+ [
+ {lib_dirs, []},
+ {escript, Escript, [{incl_cond, include}]},
+ {profile, standalone}
+ ]},
+
+ %% Generate target file
+ TargetDir = filename:join([?WORK_DIR, "target_standalone_app"]),
+ ?m(ok, reltool_utils:recursive_delete(TargetDir)),
+ ?m(ok, file:make_dir(TargetDir)),
+ ok = ?m(ok, reltool:create_target([{config, Sys}], TargetDir)),
+
+ %% Start the target system and fetch root dir
+ BinDir = filename:join([TargetDir, "bin"]),
+ Erl = filename:join([BinDir, "erl"]),
+ {ok, Node} = ?msym({ok, _}, start_node(?NODE_NAME, Erl)),
+ RootDir = ?ignore(rpc:call(Node, code, root_dir, [])),
+ ?msym(ok, stop_node(Node)),
+
+ %% Execute escript
+ Expected = iolist_to_binary(["Root dir: ", RootDir, "\n"
+ "Script args: [\"-arg1\",\"arg2\",\"arg3\"]\n",
+ "ExitCode:0"]),
+ io:format("Expected: ~s\n", [Expected]),
+ ?m(Expected, run(BinDir, EscriptName, "-arg1 arg2 arg3")),
+
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Generate standalone system with inlined archived application
+%% Check that the inlined app can not be explicitly configured
+
+create_standalone_app_clash(Config) ->
+ %% Create archive
+ DataDir = ?config(data_dir,Config),
+ EscriptDir = filename:join(DataDir,escript),
+ {ok,{_Archive,Bin}} = zip:create("someapp-1.0.ez",["someapp-1.0"],
+ [memory,
+ {cwd,EscriptDir},
+ {compress,all},
+ {uncompress,[".beam",".app"]}]),
+
+ %% Create the escript
+ EscriptName = "someapp.escript",
+ Escript = filename:join(?WORK_DIR,EscriptName),
+ ok = escript:create(Escript,[shebang,
+ {emu_args,"-escript main mymod"},
+ {archive,Bin}]),
+ ok = file:change_mode(Escript,8#00744),
-create_old_target(TestInfo) when is_atom(TestInfo) ->
- reltool_test_lib:tc_info(TestInfo);
+ %% Configure the server
+ Sys =
+ {sys,
+ [
+ {lib_dirs, []},
+ {escript, Escript, [{incl_cond, include}]},
+ {profile, standalone},
+ {app, someapp, [{incl_cond,include}]}
+ ]},
+
+ ?msym({error,"someapp: Application name clash. Escript "++_},
+ reltool:start_server([{config,Sys}])),
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Generate standalone system with multiple escripts
+
+create_multiple_standalone(Config) ->
+ %% First escript
+ ExDir = code:lib_dir(reltool, examples),
+ EscriptName1 = "display_args",
+ Escript1 = filename:join([ExDir, EscriptName1]),
+
+ %% Second escript
+ DataDir = ?config(data_dir,Config),
+ BeamFile = filename:join([DataDir,escript,"someapp-1.0",ebin,"mymod.beam"]),
+ {ok,BeamBin} = file:read_file(BeamFile),
+ EscriptName2 = "mymod.escript",
+ Escript2 = filename:join(?WORK_DIR,EscriptName2),
+ ok = escript:create(Escript2,[shebang,{beam,BeamBin}]),
+ ok = file:change_mode(Escript2,8#00744),
+
+ %% Configure server
+ Sys =
+ {sys,
+ [
+ {lib_dirs, []},
+ {escript, Escript1, [{incl_cond, include}]},
+ {escript, Escript2, [{incl_cond, include}]},
+ {profile, standalone}
+ ]},
+
+ %% Generate target system
+ TargetDir = filename:join([?WORK_DIR, "target_multiple_standalone"]),
+ ?m(ok, reltool_utils:recursive_delete(TargetDir)),
+ ?m(ok, file:make_dir(TargetDir)),
+ ok = ?m(ok, reltool:create_target([{config,Sys}], TargetDir)),
+
+ %% Start the target system and fetch root dir
+ BinDir = filename:join([TargetDir, "bin"]),
+ Erl = filename:join([BinDir, "erl"]),
+ {ok, Node} = ?msym({ok, _}, start_node(?NODE_NAME, Erl)),
+ RootDir = ?ignore(rpc:call(Node, code, root_dir, [])),
+ ?msym(ok, stop_node(Node)),
+
+ %% Execute escript1
+ Expected1 = iolist_to_binary(["Root dir: ", RootDir, "\n"
+ "Script args: [\"-arg1\",\"arg2\",\"arg3\"]\n",
+ "Smp: false\n",
+ "ExitCode:0"]),
+ io:format("Expected1: ~s\n", [Expected1]),
+ ?m(Expected1, run(BinDir, EscriptName1, "-arg1 arg2 arg3")),
+
+
+ %% Execute escript2
+ Expected2 = iolist_to_binary(["Root dir: ", RootDir, "\n"
+ "Script args: [\"-arg1\",\"arg2\",\"arg3\"]\n",
+ "ExitCode:0"]),
+ io:format("Expected2: ~s\n", [Expected2]),
+ ?m(Expected2, run(BinDir, EscriptName2, "-arg1 arg2 arg3")),
+
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Generate old type of target system
create_old_target(_Config) ->
- ?skip("Old style of target", []),
%% Configure the server
RelName1 = "Just testing",
@@ -350,10 +1035,9 @@ create_old_target(_Config) ->
TargetDir = filename:join([?WORK_DIR, "target_old_style"]),
?m(ok, reltool_utils:recursive_delete(TargetDir)),
?m(ok, file:make_dir(TargetDir)),
- ?m(ok, reltool:create_target([{config, Config}], TargetDir)),
-
- %% io:format("Will fail on Windows (should patch erl.ini)\n", []),
- ?m(ok, reltool:install(RelName2, TargetDir)),
+ ok = ?m(ok, reltool:create_target([{config, Config}], TargetDir)),
+
+ ok = ?m(ok, reltool:install(RelName2, TargetDir)),
Erl = filename:join([TargetDir, "bin", "erl"]),
{ok, Node} = ?msym({ok, _}, start_node(?NODE_NAME, Erl)),
@@ -362,11 +1046,98 @@ create_old_target(_Config) ->
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Generate target system
+
+create_slim(Config) ->
+ %% Configure the server
+ RelName = "slim",
+ RelVsn = "1.0",
+
+ DataDir = ?config(data_dir,Config),
+ LibDir = filename:join(DataDir,"slim"),
+
+ Sys =
+ {sys,
+ [
+ {root_dir, code:root_dir()},
+ {lib_dirs, []},
+ {boot_rel, RelName},
+ {rel, RelName, RelVsn, [sasl, stdlib, kernel, a]},
+ {app, sasl, [{incl_cond, include}]},
+ {app, a, [{incl_cond, include},
+ {lib_dir,filename:join(LibDir,"a-1.0")}]},
+ {excl_lib,otp_root}
+ ]},
+
+ %% Generate target file
+ TargetDir = filename:absname(filename:join([?WORK_DIR, "target_slim"])),
+ ?m(ok, reltool_utils:recursive_delete(TargetDir)),
+ ?m(ok, file:make_dir(TargetDir)),
+ ?log("SPEC: ~p\n", [reltool:get_target_spec([{config, Sys}])]),
+ ok = ?m(ok, reltool:create_target([{config, Sys}], TargetDir)),
+
+ TargetLibDir = filename:join(TargetDir,"lib"),
+ TargetRelDir = filename:join(TargetDir,"releases"),
+ TargetRelVsnDir = filename:join(TargetRelDir,RelVsn),
+
+ {ok,["a-1.0.ez"]} = file:list_dir(TargetLibDir),
+
+ RootDir = code:root_dir(),
+ Erl = filename:join([RootDir, "bin", "erl"]),
+ EscapedQuote =
+ case os:type() of
+ {win32,_} -> "\\\"";
+ _ -> "\""
+ end,
+ Args = ["-boot_var", "RELTOOL_EXT_LIB", TargetLibDir,
+ "-boot", filename:join(TargetRelVsnDir,RelName),
+ "-sasl", "releases_dir", EscapedQuote++TargetRelDir++EscapedQuote],
+ {ok, Node} = ?msym({ok, _}, start_node(?NODE_NAME, Erl, Args)),
+ ?msym(RootDir, rpc:call(Node, code, root_dir, [])),
+ ?msym([{RelName,RelVsn,_,permanent}],
+ rpc:call(Node,release_handler,which_releases,[])),
+ ?msym(ok, stop_node(Node)),
+
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Generate target system with eval_target_spec/3
+
+eval_target_spec(_Config) ->
+ %% Configure the server
+ RelName1 = "Just testing",
+ RelName2 = "Just testing with SASL",
+ RelVsn = "1.0",
+ Config =
+ {sys,
+ [
+ {root_dir, code:root_dir()},
+ {lib_dirs, []},
+ {boot_rel, RelName2},
+ {rel, RelName1, RelVsn, [stdlib, kernel]},
+ {rel, RelName2, RelVsn, [sasl, stdlib, kernel]},
+ {app, sasl, [{incl_cond, include}]}
+ ]},
+
+ %% Generate target file
+ TargetDir = filename:join([?WORK_DIR, "eval_target_spec"]),
+ ?m(ok, reltool_utils:recursive_delete(TargetDir)),
+ ?m(ok, file:make_dir(TargetDir)),
+ {ok, Spec} = ?msym({ok,_}, reltool:get_target_spec([{config, Config}])),
+ ok = ?m(ok, reltool:eval_target_spec(Spec, code:root_dir(), TargetDir)),
+
+ Erl = filename:join([TargetDir, "bin", "erl"]),
+ {ok, Node} = ?msym({ok, _}, start_node(?NODE_NAME, Erl)),
+ ?msym(ok, stop_node(Node)),
+
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% OTP-9229 - handle duplicated module names, i.e. same module name
%% exists in two applications.
%% Include on app, exclude the other
-otp_9229_exclude_app(Config) ->
+otp_9229_dupl_mod_exclude_app(Config) ->
DataDir = ?config(data_dir,Config),
LibDir = filename:join(DataDir,"otp_9229"),
@@ -389,8 +1160,8 @@ otp_9229_exclude_app(Config) ->
?m(ok, reltool_utils:recursive_delete(TargetDir)),
?m(ok, file:make_dir(TargetDir)),
?log("SPEC: ~p\n", [reltool:get_target_spec([{config, ExclApp}])]),
- {ok,["Module mylib exists in applications x and y. Using module from application x."]} = reltool:get_status([{config, ExclApp}]),
- ?m(ok, reltool:create_target([{config, ExclApp}], TargetDir)),
+ ?m({ok,["Module mylib exists in applications x and y. Using module from application x."]}, reltool:get_status([{config, ExclApp}])),
+ ok = ?m(ok, reltool:create_target([{config, ExclApp}], TargetDir)),
Erl = filename:join([TargetDir, "bin", "erl"]),
{ok, Node} = ?msym({ok, _}, start_node(?NODE_NAME, Erl)),
@@ -413,7 +1184,7 @@ otp_9229_exclude_app(Config) ->
ok.
%% Include both apps, but exclude common module from one app
-otp_9229_exclude_mod(Config) ->
+otp_9229_dupl_mod_exclude_mod(Config) ->
DataDir = ?config(data_dir,Config),
LibDir = filename:join(DataDir,"otp_9229"),
@@ -436,8 +1207,8 @@ otp_9229_exclude_mod(Config) ->
?m(ok, reltool_utils:recursive_delete(TargetDir)),
?m(ok, file:make_dir(TargetDir)),
?log("SPEC: ~p\n", [reltool:get_target_spec([{config, ExclMod}])]),
- {ok,["Module mylib exists in applications x and y. Using module from application x."]} = reltool:get_status([{config, ExclMod}]),
- ?m(ok, reltool:create_target([{config, ExclMod}], TargetDir)),
+ ?m({ok,["Module mylib exists in applications x and y. Using module from application x."]}, reltool:get_status([{config, ExclMod}])),
+ ok = ?m(ok, reltool:create_target([{config, ExclMod}], TargetDir)),
Erl = filename:join([TargetDir, "bin", "erl"]),
{ok, Node} = ?msym({ok, _}, start_node(?NODE_NAME, Erl)),
@@ -466,7 +1237,1104 @@ otp_9229_exclude_mod(Config) ->
ok.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Test that if a module is duplicated in a .app file, then a warning
+%% is produced, but target can still be created.
+dupl_mod_in_app_file(Config) ->
+ DataDir = ?config(data_dir,Config),
+ LibDir = filename:join(DataDir,"dupl_mod"),
+ %% Configure the server
+ Sys =
+ {sys,
+ [
+ {lib_dirs, [LibDir]},
+ {incl_cond,exclude},
+ {app,a,[{incl_cond,include}]},
+ {app,kernel,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]}
+ ]},
+
+ %% Generate target file
+ TargetDir = filename:join([?WORK_DIR, "target_dupl_mod_in_app_file"]),
+ ?m(ok, reltool_utils:recursive_delete(TargetDir)),
+ ?m(ok, file:make_dir(TargetDir)),
+ ?log("SPEC: ~p\n", [reltool:get_target_spec([{config, Sys}])]),
+ ?m({ok,["Module a duplicated in app file for application a."]},
+ reltool:get_status([{config, Sys}])),
+
+ %%! test that only one module installed (in spec)
+
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Test the interface used by the GUI:
+%% get_app
+%% get_apps
+%% set_app
+%% set_apps
+%% load_config
+%% reset_config
+%%
+%% Also, for each operation which manipulates the config, test
+%% get_status and undo_config.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+get_apps(_Config) ->
+ Sys = {sys,[{app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,tools,[{incl_cond,derived}]},
+ {app,runtime_tools,[{incl_cond,exclude}]}]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])),
+
+ {ok,Sasl} = ?msym({ok,#app{name=sasl}}, reltool_server:get_app(Pid,sasl)),
+ {ok,[#app{name=kernel},
+ #app{name=sasl}=Sasl,
+ #app{name=stdlib}] = White} =
+ ?msym({ok,_}, reltool_server:get_apps(Pid,whitelist)),
+ {ok,[#app{name=runtime_tools}] = Black} =
+ ?msym({ok,_}, reltool_server:get_apps(Pid,blacklist)),
+
+ {ok,Derived} = ?msym({ok,_}, reltool_server:get_apps(Pid,derived)),
+ true = lists:keymember(tools,#app.name,Derived),
+
+ {ok,Source} = ?msym({ok,_}, reltool_server:get_apps(Pid,source)),
+ true = lists:keymember(common_test,#app.name,Source),
+
+ %% Check that the four lists are disjoint
+ Number = length(White) + length(Black) + length(Derived) + length(Source),
+ WN = lists:usort([N || #app{name=N} <- White]),
+ BN = lists:usort([N || #app{name=N} <- Black]),
+ DN = lists:usort([N || #app{name=N} <- Derived]),
+ SN = lists:usort([N || #app{name=N} <- Source]),
+ AllN = lists:umerge([WN,BN,DN,SN]),
+ ?m(Number,length(AllN)),
+
+ ?m(ok, reltool:stop(Pid)),
+ ok.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+get_mod(_Config) ->
+ Sys = {sys,[{app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,tools,[{incl_cond,derived}]},
+ {app,runtime_tools,[{incl_cond,exclude}]}]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])),
+
+ %% Read app and get a module from the #app record
+ {ok,Tools} = ?msym({ok,#app{name=tools}}, reltool_server:get_app(Pid,tools)),
+ Cover = lists:keyfind(cover,#mod.name,Tools#app.mods),
+
+ %% get_mod - and check that it is equal to the one in #app.mods
+ ?m({ok,Cover}, reltool_server:get_mod(Pid,cover)),
+
+ ?m(ok, reltool:stop(Pid)),
+ ok.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+get_sys(_Config) ->
+ Sys = {sys,[{app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,tools,[{incl_cond,derived}]},
+ {app,runtime_tools,[{incl_cond,exclude}]}]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])),
+
+ RootDir = code:root_dir(),
+ ?msym({ok,#sys{root_dir=RootDir,apps=undefined}},reltool_server:get_sys(Pid)),
+
+ ?m(ok, reltool:stop(Pid)),
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+set_app_and_undo(Config) ->
+ Sys = {sys,[{lib_dirs,[filename:join(datadir(Config),"faulty_app_file")]},
+ {incl_cond, exclude},
+ {app,a,[{incl_cond,include}]},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,tools,[{incl_cond,include}]}]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])),
+ ?m({ok, Sys}, reltool:get_config(Pid)),
+ ?msym({ok,["a: Cannot parse app file"++_]},reltool_server:get_status(Pid)),
+
+ %% Get app and mod
+ {ok,Tools} = ?msym({ok,_}, reltool_server:get_app(Pid,tools)),
+ {ok,Cover} = ?msym({ok,#mod{name=cover, is_included=true}},
+ reltool_server:get_mod(Pid,cover)),
+
+ %% Exclude one module with set_app
+ ExclCover = Cover#mod{incl_cond=exclude},
+ Mods = Tools#app.mods,
+ Tools1 = Tools#app{mods = lists:keyreplace(cover,#mod.name,Mods,ExclCover)},
+ {ok,ToolsNoCover,["a: Cannot parse app file"++_|_]} =
+ ?msym({ok,_,["a: Cannot parse app file"++_|_]},
+ reltool_server:set_app(Pid,Tools1)),
+ ?msym({ok,["a: Cannot parse app file"++_]}, reltool_server:get_status(Pid)),
+
+ %% Check that the module is no longer included
+ ?m({ok,ToolsNoCover}, reltool_server:get_app(Pid,tools)),
+ {ok,NoIncludeCover} = ?msym({ok,#mod{name=cover, is_included=false}},
+ reltool_server:get_mod(Pid,cover)),
+
+ %% Undo
+ ?m(ok, reltool_server:undo_config(Pid)),
+ ?m({ok,Tools}, reltool_server:get_app(Pid,tools)),
+ ?m({ok,Cover}, reltool_server:get_mod(Pid,cover)),
+ ?msym({ok,["a: Cannot parse app file"++_]}, reltool_server:get_status(Pid)),
+
+ %% Undo again, to check that it toggles
+ ?msym(ok, reltool_server:undo_config(Pid)),
+ ?m({ok,ToolsNoCover}, reltool_server:get_app(Pid,tools)),
+ ?m({ok,NoIncludeCover}, reltool_server:get_mod(Pid,cover)),
+ ?msym({ok,["a: Cannot parse app file"++_]}, reltool_server:get_status(Pid)),
+
+ ?m(ok, reltool:stop(Pid)),
+ ok.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+set_apps_and_undo(Config) ->
+ Sys = {sys,[{lib_dirs,[filename:join(datadir(Config),"faulty_app_file")]},
+ {incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,tools,[{incl_cond,include}]}]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])),
+ ?m({ok, Sys}, reltool:get_config(Pid)),
+ ?msym({ok,["a: Cannot parse app file"++_]},reltool_server:get_status(Pid)),
+
+ %% Get app and mod
+ {ok,Tools} = ?msym({ok,_}, reltool_server:get_app(Pid,tools)),
+ ?m(true, Tools#app.is_pre_included),
+ ?m(true, Tools#app.is_included),
+ {ok,Cover} = ?msym({ok,#mod{name=cover, is_included=true}},
+ reltool_server:get_mod(Pid,cover)),
+
+ %% Exclude one application with set_apps
+ ExclTools = Tools#app{incl_cond=exclude},
+ ?msym({ok,["a: Cannot parse app file"++_]},
+ reltool_server:set_apps(Pid,[ExclTools])),
+ ?msym({ok,["a: Cannot parse app file"++_]}, reltool_server:get_status(Pid)),
+
+ %% Check that the app and its modules (one of them) are no longer included
+ {ok,NoTools} = ?msym({ok,_}, reltool_server:get_app(Pid,tools)),
+ ?m(false, NoTools#app.is_pre_included),
+ ?m(false, NoTools#app.is_included),
+ {ok,NoIncludeCover} = ?msym({ok,#mod{name=cover, is_included=false}},
+ reltool_server:get_mod(Pid,cover)),
+
+ %% Undo
+ ?m(ok, reltool_server:undo_config(Pid)),
+ ?m({ok,Tools}, reltool_server:get_app(Pid,tools)),
+ ?m({ok,Cover}, reltool_server:get_mod(Pid,cover)),
+ ?msym({ok,["a: Cannot parse app file"++_]},reltool_server:get_status(Pid)),
+
+ %% Undo again, to check that it toggles
+ ?m(ok, reltool_server:undo_config(Pid)),
+ ?m({ok,NoTools}, reltool_server:get_app(Pid,tools)),
+ ?m({ok,NoIncludeCover}, reltool_server:get_mod(Pid,cover)),
+ ?msym({ok,["a: Cannot parse app file"++_]}, reltool_server:get_status(Pid)),
+
+ ?m(ok, reltool:stop(Pid)),
+ ok.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Test that escript can be configured, but not its inlined applications
+set_apps_inlined(Config) ->
+ %% Create archive
+ DataDir = ?config(data_dir,Config),
+ EscriptDir = filename:join(DataDir,escript),
+ {ok,{_Archive,Bin}} = zip:create("someapp-1.0.ez",["someapp-1.0"],
+ [memory,
+ {cwd,EscriptDir},
+ {compress,all},
+ {uncompress,[".beam",".app"]}]),
+
+ %% Create the escript
+ EscriptName = "someapp.escript",
+ Escript = filename:join(?WORK_DIR,EscriptName),
+ ok = escript:create(Escript,[shebang,
+ {emu_args,"-escript main mymod"},
+ {archive,Bin}]),
+ ok = file:change_mode(Escript,8#00744),
+
+ %% Configure the server
+ Sys = {sys,[{incl_cond, exclude},
+ {escript,Escript,[]},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]}]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])),
+ ?msym({ok,[]},reltool_server:get_status(Pid)),
+
+ %% Get app and mod
+ {ok,EApp} = ?msym({ok,_}, reltool_server:get_app(Pid,'*escript* someapp')),
+ {ok,Someapp} = ?msym({ok,_}, reltool_server:get_app(Pid,someapp)),
+ ?m(undefined, EApp#app.incl_cond),
+ ?m(undefined, Someapp#app.incl_cond),
+ ?m(false, Someapp#app.is_included),
+ ?m(false, Someapp#app.is_pre_included),
+
+ %% Include escript
+ EApp1 = EApp#app{incl_cond=include},
+ ?m({ok,[]}, reltool_server:set_apps(Pid,[EApp1])),
+ ExpectedEApp = EApp1#app{is_included=true,is_pre_included=true},
+ ?m({ok,ExpectedEApp}, reltool_server:get_app(Pid,'*escript* someapp')),
+ {ok,Someapp1} = ?msym({ok,_}, reltool_server:get_app(Pid,someapp)),
+ ?m(include, Someapp1#app.incl_cond),
+ ?m(true, Someapp1#app.is_included),
+ ?m(true, Someapp1#app.is_pre_included),
+
+ %% Check that inlined app can not be configured
+ Someapp2 = Someapp1#app{incl_cond=exclude},
+ ?msym({error,
+ "Application someapp is inlined in '*escript* someapp'. "
+ "Can not change configuration for an inlined application."},
+ reltool_server:set_apps(Pid,[Someapp2])),
+ ?m({ok,Someapp1}, reltool_server:get_app(Pid,someapp)),
+
+ %% Exclude escript
+ {ok,EApp2} = ?msym({ok,_}, reltool_server:get_app(Pid,'*escript* someapp')),
+ EApp3 = EApp2#app{incl_cond=exclude},
+ ?m({ok,[]}, reltool_server:set_apps(Pid,[EApp3])),
+ ExpectedEApp3 = EApp3#app{is_included=false,is_pre_included=false},
+ ?m({ok,ExpectedEApp3}, reltool_server:get_app(Pid,'*escript* someapp')),
+ {ok,Someapp3} = ?msym({ok,_}, reltool_server:get_app(Pid,someapp)),
+ ?m(exclude, Someapp3#app.incl_cond),
+ ?m(false, Someapp3#app.is_included),
+ ?m(false, Someapp3#app.is_pre_included),
+
+ ?m(ok, reltool:stop(Pid)),
+ ok.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+set_sys_and_undo(Config) ->
+ Sys1 = {sys,[{incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,tools,[{incl_cond,include}]}]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys1}])),
+ ?m({ok,[]}, reltool_server:get_status(Pid)),
+
+ %% Read sys record
+ {ok, SysRec} = reltool_server:get_sys(Pid),
+
+ %% Set lib dirs by call to set_sys
+ NewLib = filename:join(datadir(Config),"faulty_app_file"),
+ NewLibDirs = [NewLib | SysRec#sys.lib_dirs],
+ NewSysRec = SysRec#sys{lib_dirs=NewLibDirs},
+ ?msym({ok,["a: Cannot parse app file"++_]},
+ reltool_server:set_sys(Pid, NewSysRec)),
+ ?m({ok,NewSysRec}, reltool_server:get_sys(Pid)),
+ ?msym({ok,["a: Cannot parse app file"++_]},reltool_server:get_status(Pid)),
+
+ %% Undo
+ ?m(ok, reltool_server:undo_config(Pid)),
+ ?m({ok,SysRec}, reltool_server:get_sys(Pid)),
+ ?m({ok,[]}, reltool_server:get_status(Pid)),
+
+ %% Undo again, to check that it toggles
+ ?m(ok,reltool_server:undo_config(Pid)),
+ ?m({ok,NewSysRec}, reltool_server:get_sys(Pid)),
+ ?msym({ok,["a: Cannot parse app file"++_]},reltool_server:get_status(Pid)),
+
+ ?m(ok, reltool:stop(Pid)),
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+load_config_and_undo(Config) ->
+ Sys1 = {sys,[{incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,tools,[{incl_cond,include}]}]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys1}])),
+ ?m({ok, Sys1}, reltool:get_config(Pid)),
+ ?m({ok,[]}, reltool_server:get_status(Pid)),
+
+ %% Get app and mod
+ {ok,Tools1} = ?msym({ok,_}, reltool_server:get_app(Pid,tools)),
+ ?m(true, Tools1#app.is_pre_included),
+ ?m(true, Tools1#app.is_included),
+ {ok,Cover1} = ?msym({ok,#mod{name=cover,
+ is_included=true,
+ is_pre_included=true}},
+ reltool_server:get_mod(Pid,cover)),
+
+ %% Change tools from include to derived by loading new config
+ Sys2 = {sys,[{lib_dirs,[filename:join(datadir(Config),"faulty_app_file")]},
+ {app,a,[{incl_cond,include}]},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,tools,[{incl_cond,derived}]}]},
+ ?msym({ok,["a: Cannot parse app file"++_]},
+ reltool_server:load_config(Pid,Sys2)),
+%%% OTP-0702, 15) ?m({ok, Sys2}, reltool:get_config(Pid)),
+%%% Note that {incl_cond,exclude} is removed compared to Sys1 -
+%%% config is merged, not overwritten - is this correct???
+ ?msym({ok,["a: Cannot parse app file"++_]},reltool_server:get_status(Pid)),
+
+ %% Check that tools is included (since it is used by sasl) but not
+ %% pre-included (neither included or excluded => undefined)
+ {ok,Tools2} = ?msym({ok,_}, reltool_server:get_app(Pid,tools)),
+ ?m(undefined, Tools2#app.is_pre_included),
+ ?m(true, Tools2#app.is_included),
+ {ok,Cover2} = ?msym({ok,#mod{name=cover,
+ is_included=true,
+ is_pre_included=undefined}},
+ reltool_server:get_mod(Pid,cover)),
+
+ %% Undo
+ ?m(ok, reltool_server:undo_config(Pid)),
+ ?m({ok,Tools1}, reltool_server:get_app(Pid,tools)),
+ ?m({ok,Cover1}, reltool_server:get_mod(Pid,cover)),
+ ?m({ok,[]}, reltool_server:get_status(Pid)),
+
+ %% Undo again, to check that it toggles
+ ?m(ok, reltool_server:undo_config(Pid)),
+ ?m({ok,Tools2}, reltool_server:get_app(Pid,tools)),
+ ?m({ok,Cover2}, reltool_server:get_mod(Pid,cover)),
+ ?msym({ok,["a: Cannot parse app file"++_]},reltool_server:get_status(Pid)),
+
+ ?m(ok, reltool:stop(Pid)),
+ ok.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Test that load_config is properly rolled back if it fails
+load_config_fail(_Config) ->
+ Sys1 = {sys,[{incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,tools,[{incl_cond,include}]}]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys1}])),
+ ?m({ok, Sys1}, reltool:get_config(Pid)),
+ ?m({ok,[]}, reltool_server:get_status(Pid)),
+
+ %% Get app and mod
+ {ok,Tools} = ?msym({ok,_}, reltool_server:get_app(Pid,tools)),
+
+ %% Try to load a config with a faulty rel statement (includes a
+ %% non-existing application)
+ Sys2 = {sys,[{incl_cond, exclude},
+ {boot_rel, "faulty_rel"},
+ {rel, "faulty_rel", "1.0", [kernel, sasl, stdlib, xxx]},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]}]},
+ ?msym({error,"Release \"faulty_rel\" uses non existing application xxx"},
+ reltool_server:load_config(Pid,Sys2)),
+
+ %% Check that a rollback is done to the old configuration
+ ?m({ok, Sys1}, reltool:get_config(Pid,false,false)),
+
+ %% and that tools is not changed (i.e. that the new configuration
+ %% is not applied)
+ ?m({ok,Tools}, reltool_server:get_app(Pid,tools)),
+
+ ?m(ok, reltool:stop(Pid)),
+ ok.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Load config with escript
+
+load_config_escript_path(Config) ->
+ %% Create escript
+ DataDir = ?config(data_dir,Config),
+ BeamFile = filename:join([DataDir,escript,"someapp-1.0",ebin,"mymod.beam"]),
+ {ok,BeamBin} = file:read_file(BeamFile),
+ EscriptName = "mymod.escript",
+ Escript = filename:join(?WORK_DIR,EscriptName),
+ ok = escript:create(Escript,[shebang,{beam,BeamBin}]),
+ ok = file:change_mode(Escript,8#00744),
+
+ %% Start reltool_server with one escript in configuration
+ EscriptSys =
+ {sys,
+ [
+ {lib_dirs, []},
+ {escript, Escript, [{incl_cond, include}]},
+ {profile, standalone}
+ ]},
+
+ {ok, Pid1} = ?msym({ok, _}, reltool:start_server([{config, EscriptSys}])),
+ {ok,[#app{name='*escript* mymod'}=A]} =
+ ?msym({ok,[_]}, reltool_server:get_apps(Pid1,whitelist)),
+ ?m(ok, reltool:stop(Pid1)),
+
+
+ %% Do same again, but now start reltool first with simple config,
+ %% then add escript by loading new configuration and check that
+ %% #app is the same
+ SimpleSys =
+ {sys,
+ [
+ {lib_dirs, []}
+ ]},
+
+ {ok, Pid2} = ?msym({ok, _}, reltool:start_server([{config, SimpleSys}])),
+ ?m({ok,[]}, reltool_server:get_apps(Pid2,whitelist)),
+ ?m({ok,[]}, reltool_server:load_config(Pid2,EscriptSys)),
+ ?m({ok,[A]}, reltool_server:get_apps(Pid2,whitelist)),
+
+ ?m(ok, reltool:stop(Pid2)),
+
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Load config with same (source) escript twice and check that the
+%% application information is not changed.
+
+load_config_same_escript_source(_Config) ->
+ %% Create escript
+ ExDir = code:lib_dir(reltool, examples),
+ EscriptName = "display_args",
+ Escript = filename:join([ExDir, EscriptName]),
+
+ %% Start reltool_server with one escript in configuration
+ Sys =
+ {sys,
+ [
+ {lib_dirs, []},
+ {escript, Escript, [{incl_cond, include}]},
+ {profile, standalone}
+ ]},
+
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])),
+% {ok,[#app{name='*escript* display_args'}]} =
+ ?msym({ok,[#app{name='*escript* display_args',mods=[_]}]},
+ reltool_server:get_apps(Pid,whitelist)),
+
+ %% Load the same config again, then check that app is not changed
+ ?m({ok,[]}, reltool_server:load_config(Pid,Sys)),
+ ?msym({ok,[#app{name='*escript* display_args',mods=[_]}]},
+ reltool_server:get_apps(Pid,whitelist)),
+
+ ?m(ok, reltool:stop(Pid)),
+
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Load config with same (beam) escript twice and check that the
+%% application information is not changed.
+
+load_config_same_escript_beam(Config) ->
+ %% Create escript
+ DataDir = ?config(data_dir,Config),
+ BeamFile = filename:join([DataDir,escript,"someapp-1.0",ebin,"mymod.beam"]),
+ {ok,BeamBin} = file:read_file(BeamFile),
+ EscriptName = "mymod.escript",
+ Escript = filename:join(?WORK_DIR,EscriptName),
+ ok = escript:create(Escript,[shebang,{beam,BeamBin}]),
+ ok = file:change_mode(Escript,8#00744),
+
+ %% Start reltool_server with one escript in configuration
+ Sys =
+ {sys,
+ [
+ {lib_dirs, []},
+ {escript, Escript, [{incl_cond, include}]},
+ {profile, standalone}
+ ]},
+
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])),
+ {ok,[#app{name='*escript* mymod'}=A]} =
+ ?msym({ok,[_]}, reltool_server:get_apps(Pid,whitelist)),
+
+ %% Load the same config again, then check that app is not changed
+ ?m({ok,[]}, reltool_server:load_config(Pid,Sys)),
+ ?m({ok,[A]}, reltool_server:get_apps(Pid,whitelist)),
+
+ ?m(ok, reltool:stop(Pid)),
+
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Load config with escript
+
+load_config_add_escript(Config) ->
+ %% First escript
+ ExDir = code:lib_dir(reltool, examples),
+ EscriptName1 = "display_args",
+ Escript1 = filename:join([ExDir, EscriptName1]),
+
+ %% Second escript
+ DataDir = ?config(data_dir,Config),
+ BeamFile = filename:join([DataDir,escript,"someapp-1.0",ebin,"mymod.beam"]),
+ {ok,BeamBin} = file:read_file(BeamFile),
+ EscriptName2 = "mymod.escript",
+ Escript2 = filename:join(?WORK_DIR,EscriptName2),
+ ok = escript:create(Escript2,[shebang,{beam,BeamBin}]),
+ ok = file:change_mode(Escript2,8#00744),
+
+ %% Start reltool_server with one escript in configuration
+ Sys1 =
+ {sys,
+ [
+ {lib_dirs, []},
+ {escript, Escript2, [{incl_cond, include}]},
+ {profile, standalone}
+ ]},
+
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys1}])),
+
+ %% Add second escript by loading new configuration
+ Sys2 =
+ {sys,
+ [
+ {lib_dirs, []},
+ {escript, Escript1, [{incl_cond, include}]},
+ {escript, Escript2, [{incl_cond, include}]},
+ {profile, standalone}
+ ]},
+
+ {ok,[]} = ?m({ok,[]}, reltool_server:load_config(Pid,Sys2)),
+ {ok,[#app{name='*escript* display_args'},
+ #app{name='*escript* mymod'}]} =
+ ?msym({ok,[_,_]}, reltool_server:get_apps(Pid,whitelist)),
+
+ ?m(ok, reltool:stop(Pid)),
+
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+reset_config_and_undo(Config) ->
+ Sys1 = {sys,[{lib_dirs,[filename:join(datadir(Config),"faulty_app_file")]},
+ {incl_cond, exclude},
+ {app,a,[{incl_cond,include}]},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,tools,[{incl_cond,include}]}]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys1}])),
+ ?m({ok, Sys1}, reltool:get_config(Pid)),
+ ?msym({ok,["a: Cannot parse app file"++_]},reltool_server:get_status(Pid)),
+
+ %% Get app and mod
+ {ok,Tools1} = ?msym({ok,_}, reltool_server:get_app(Pid,tools)),
+ ?m(true, Tools1#app.is_pre_included),
+ ?m(true, Tools1#app.is_included),
+ {ok,Cover1} = ?msym({ok,#mod{name=cover,
+ is_included=true,
+ is_pre_included=true}},
+ reltool_server:get_mod(Pid,cover)),
+
+ %% Exclude tools by loading new config
+ Sys2 = {sys,[{incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,tools,[{incl_cond,exclude}]}]},
+ ?m({ok,[]}, reltool_server:load_config(Pid,Sys2)),
+ ?m({ok,[]}, reltool_server:get_status(Pid)),
+
+ %% Check that tools is excluded
+ {ok,Tools2} = ?msym({ok,_}, reltool_server:get_app(Pid,tools)),
+ ?m(false, Tools2#app.is_pre_included),
+ ?m(false, Tools2#app.is_included),
+ {ok,Cover2} = ?msym({ok,#mod{name=cover,
+ is_included=false,
+ is_pre_included=false}},
+ reltool_server:get_mod(Pid,cover)),
+
+ %% Reset
+ ?msym({ok,["a: Cannot parse app file"++_]},reltool_server:reset_config(Pid)),
+ ?m({ok,Tools1}, reltool_server:get_app(Pid,tools)),
+ ?m({ok,Cover1}, reltool_server:get_mod(Pid,cover)),
+ ?msym({ok,["a: Cannot parse app file"++_]},reltool_server:get_status(Pid)),
+
+ %% Undo
+ ?m(ok, reltool_server:undo_config(Pid)),
+ ?m({ok,Tools2}, reltool_server:get_app(Pid,tools)),
+ ?m({ok,Cover2}, reltool_server:get_mod(Pid,cover)),
+ ?m({ok,[]}, reltool_server:get_status(Pid)),
+
+ %% Undo again, to check that it toggles
+ ?m(ok, reltool_server:undo_config(Pid)),
+ ?m({ok,Tools1}, reltool_server:get_app(Pid,tools)),
+ ?m({ok,Cover1}, reltool_server:get_mod(Pid,cover)),
+ ?msym({ok,["a: Cannot parse app file"++_]},reltool_server:get_status(Pid)),
+
+ ?m(ok, reltool:stop(Pid)),
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+gen_rel_files(_Config) ->
+ %% Configure the server
+ RelName = "gen_fel_files_test",
+ RelVsn = "1.0",
+ Sys =
+ {sys,
+ [
+ {lib_dirs, []},
+ {boot_rel, RelName},
+ {rel, RelName, RelVsn, [kernel, stdlib]}
+ ]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])),
+
+ %% Generate .rel, .script and .boot
+ Dir = filename:join(?WORK_DIR,"gen_rel_files"),
+ ok = file:make_dir(Dir),
+ ?m({ok,[]}, reltool_server:gen_rel_files(Pid,Dir)),
+
+ Script = RelName ++ ".script",
+ Rel = RelName ++ ".rel",
+ Boot = RelName ++ ".boot",
+ {ok,Files} = ?msym({ok,_}, file:list_dir(Dir)),
+ [Boot,Rel,Script] = lists:sort(Files),
+
+ %% Check that contents is reasonable
+ {ok,[S]} = ?msym({ok,[{script,_,_}]},file:consult(filename:join(Dir,Script))),
+ ?msym({ok,[{release,_,_,_}]}, file:consult(filename:join(Dir,Rel))),
+ {ok,Bin} = ?msym({ok,_}, file:read_file(filename:join(Dir,Boot))),
+ ?m(S,binary_to_term(Bin)),
+
+ ?m(ok, reltool:stop(Pid)),
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+save_config(Config) ->
+ PrivDir = ?config(priv_dir,Config),
+ Sys = {sys,[{incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]}]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])),
+ ?m({ok, Sys}, reltool:get_config(Pid)),
+
+ Simple = filename:join(PrivDir,"save_simple.reltool"),
+ ?m(ok, reltool_server:save_config(Pid,Simple,false,false)),
+ ?m({ok,[Sys]}, file:consult(Simple)),
+
+ Derivates = filename:join(PrivDir,"save_derivates.reltool"),
+ ?m(ok, reltool_server:save_config(Pid,Derivates,false,true)),
+ ?msym({ok,[{sys,[{incl_cond, exclude},
+ {erts,[]},
+ {app,kernel,[{incl_cond,include},{mod,_,[]}|_]},
+ {app,sasl,[{incl_cond,include},{mod,_,[]}|_]},
+ {app,stdlib,[{incl_cond,include},{mod,_,[]}|_]}]}]},
+ file:consult(Derivates)),
+
+ Defaults = filename:join(PrivDir,"save_defaults.reltool"),
+ ?m(ok, reltool_server:save_config(Pid,Defaults,true,false)),
+ ?msym({ok,[{sys,[{root_dir,_},
+ {lib_dirs,_},
+ {mod_cond,all},
+ {incl_cond,exclude},
+ {app,kernel,[{incl_cond,include},{vsn,undefined},
+ {lib_dir,undefined}]},
+ {app,sasl,[{incl_cond,include},{vsn,undefined},
+ {lib_dir,undefined}]},
+ {app,stdlib,[{incl_cond,include},{vsn,undefined},
+ {lib_dir,undefined}]},
+ {boot_rel,"start_clean"},
+ {rel,"start_clean","1.0",[]},
+ {rel,"start_sasl","1.0",[sasl]},
+ {emu_name,"beam"},
+ {relocatable,true},
+ {profile,development},
+ {incl_sys_filters,[".*"]},
+ {excl_sys_filters,[]},
+ {incl_app_filters,[".*"]},
+ {excl_app_filters,[]},
+ {incl_archive_filters,[".*"]},
+ {excl_archive_filters,["^include$","^priv$"]},
+ {archive_opts,[]},
+ {rel_app_type,permanent},
+ {app_file,keep},
+ {debug_info,keep}]}]},
+ file:consult(Defaults)),
+
+ KVsn = latest(kernel),
+ StdVsn = latest(stdlib),
+ SaslVsn = latest(sasl),
+
+ LibDir = code:lib_dir(),
+ KLibDir = filename:join(LibDir,"kernel-"++KVsn),
+ StdLibDir = filename:join(LibDir,"stdlib-"++StdVsn),
+ SaslLibDir = filename:join(LibDir,"sasl-"++SaslVsn),
+
+ All = filename:join(PrivDir,"save_all.reltool"),
+ ?m(ok, reltool_server:save_config(Pid,All,true,true)),
+ ?msym({ok,[{sys,[{root_dir,_},
+ {lib_dirs,_},
+ {mod_cond,all},
+ {incl_cond,exclude},
+ {erts,[]},
+ {app,kernel,[{incl_cond,include},{vsn,KVsn},
+ {lib_dir,KLibDir},{mod,_,[]}|_]},
+ {app,sasl,[{incl_cond,include},{vsn,SaslVsn},
+ {lib_dir,SaslLibDir},{mod,_,[]}|_]},
+ {app,stdlib,[{incl_cond,include},{vsn,StdVsn},
+ {lib_dir,StdLibDir},{mod,_,[]}|_]},
+ {boot_rel,"start_clean"},
+ {rel,"start_clean","1.0",[]},
+ {rel,"start_sasl","1.0",[sasl]},
+ {emu_name,"beam"},
+ {relocatable,true},
+ {profile,development},
+ {incl_sys_filters,[".*"]},
+ {excl_sys_filters,[]},
+ {incl_app_filters,[".*"]},
+ {excl_app_filters,[]},
+ {incl_archive_filters,[".*"]},
+ {excl_archive_filters,["^include$","^priv$"]},
+ {archive_opts,[]},
+ {rel_app_type,permanent},
+ {app_file,keep},
+ {debug_info,keep}]}]},
+ file:consult(All)),
+
+ ?m(ok, reltool:stop(Pid)),
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Test calculation of dependencies
+%% The following test applications are used
+%%
+%% x-1.0: x1.erl x2.erl x3.erl
+%% \ / (x2 calls y1, x3 calls y2)
+%% y-1.0: y0.erl y1.erl y2.erl
+%% \ (y1 calls z1)
+%% z-1.0 z1.erl
+%%
+%% Test includes x and derives y and z.
+%%
+dependencies(Config) ->
+ %% Default: all modules included => y and z are included (derived)
+ Sys = {sys,[{lib_dirs,[filename:join(datadir(Config),"dependencies")]},
+ {incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,x,[{incl_cond,include}]},
+ {app,y,[{incl_cond,derived}]},
+ {app,z,[{incl_cond,derived}]}]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])),
+
+ ?msym({ok,[#app{name=kernel},
+ #app{name=sasl},
+ #app{name=stdlib},
+ #app{name=x,uses_apps=[y]}]},
+ reltool_server:get_apps(Pid,whitelist)),
+ {ok, Der} = ?msym({ok,_},
+ reltool_server:get_apps(Pid,derived)),
+ ?msym([#app{name=y,uses_apps=[z]},
+ #app{name=z}],
+ rm_missing_app(Der)),
+ ?msym({ok,[]},
+ reltool_server:get_apps(Pid,source)),
+
+ %% Excluding x2 => y still included since y2 is used by x3
+ %% z still included since z1 is used by y1
+ Sys2 = {sys,[{lib_dirs,[filename:join(datadir(Config),"dependencies")]},
+ {incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,x,[{incl_cond,include},{mod,x2,[{incl_cond,exclude}]}]},
+ {app,y,[{incl_cond,derived}]},
+ {app,z,[{incl_cond,derived}]}]},
+ ?m({ok,[]}, reltool_server:load_config(Pid,Sys2)),
+ ?msym({ok,[#app{name=kernel},
+ #app{name=sasl},
+ #app{name=stdlib},
+ #app{name=x,uses_apps=[y]}]},
+ reltool_server:get_apps(Pid,whitelist)),
+ {ok, Der2} = ?msym({ok,_},
+ reltool_server:get_apps(Pid,derived)),
+ ?msym([#app{name=y,uses_apps=[z]},
+ #app{name=z}],
+ rm_missing_app(Der2)),
+ ?msym({ok,[]},
+ reltool_server:get_apps(Pid,source)),
+
+ %% Excluding x3 => y still included since y1 is used by x2
+ %% z still included since z1 is used by y1
+ Sys3 = {sys,[{lib_dirs,[filename:join(datadir(Config),"dependencies")]},
+ {incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,x,[{incl_cond,include},{mod,x3,[{incl_cond,exclude}]}]},
+ {app,y,[{incl_cond,derived}]},
+ {app,z,[{incl_cond,derived}]}]},
+ ?m({ok,[]}, reltool_server:load_config(Pid,Sys3)),
+ ?msym({ok,[#app{name=kernel},
+ #app{name=sasl},
+ #app{name=stdlib},
+ #app{name=x,uses_apps=[y]}]},
+ reltool_server:get_apps(Pid,whitelist)),
+ {ok, Der3} = ?msym({ok,_},
+ reltool_server:get_apps(Pid,derived)),
+ ?msym([#app{name=y,uses_apps=[z]},
+ #app{name=z}],
+ rm_missing_app(Der3)),
+ ?msym({ok,[]},
+ reltool_server:get_apps(Pid,source)),
+
+ %% Excluding x2 and x3 => y and z excluded
+ Sys4 = {sys,[{lib_dirs,[filename:join(datadir(Config),"dependencies")]},
+ {incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,x,[{incl_cond,include},
+ {mod,x2,[{incl_cond,exclude}]},
+ {mod,x3,[{incl_cond,exclude}]}]},
+ {app,y,[{incl_cond,derived}]},
+ {app,z,[{incl_cond,derived}]}]},
+ ?m({ok,[]}, reltool_server:load_config(Pid,Sys4)),
+ ?msym({ok,[#app{name=kernel},
+ #app{name=sasl},
+ #app{name=stdlib},
+ #app{name=x,uses_apps=[]}]},
+ reltool_server:get_apps(Pid,whitelist)),
+ {ok, Der4} = ?msym({ok,_},
+ reltool_server:get_apps(Pid,derived)),
+ ?msym([], rm_missing_app(Der4)),
+ ?msym({ok,[#app{name=y},
+ #app{name=z}]},
+ reltool_server:get_apps(Pid,source)),
+
+ %% Excluding y1 => y still included since y2 is used by x3
+ %% z excluded since not used by any other than y1
+ Sys5 = {sys,[{lib_dirs,[filename:join(datadir(Config),"dependencies")]},
+ {incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,x,[{incl_cond,include}]},
+ {app,y,[{incl_cond,derived},
+ {mod,y1,[{incl_cond,exclude}]}]},
+ {app,z,[{incl_cond,derived}]}]},
+ ?m({ok,[]}, reltool_server:load_config(Pid,Sys5)),
+ ?msym({ok,[#app{name=kernel},
+ #app{name=sasl},
+ #app{name=stdlib},
+ #app{name=x,uses_apps=[y]}]},
+ reltool_server:get_apps(Pid,whitelist)),
+ {ok, Der5} = ?msym({ok,_},
+ reltool_server:get_apps(Pid,derived)),
+ ?msym([#app{name=y,uses_apps=[]}], rm_missing_app(Der5)),
+ ?msym({ok,[#app{name=z}]},
+ reltool_server:get_apps(Pid,source)),
+
+ ?m(ok, reltool:stop(Pid)),
+ ok.
+
+
+%% Test that incl_cond on mod level overwrites mod_cond on app level
+%% Uses same test applications as dependencies/1 above
+mod_incl_cond_derived(Config) ->
+ %% In app y: mod_cond=none means no module shall be included
+ %% but mod_cond is overwritten by incl_cond on mod level
+ Sys = {sys,[{lib_dirs,[filename:join(datadir(Config),"dependencies")]},
+ {incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,x,[{incl_cond,include}]},
+ {app,y,[{incl_cond,include},
+ {mod_cond,none},
+ {mod,y0,[{incl_cond,derived}]},
+ {mod,y2,[{incl_cond,derived}]}]}]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])),
+
+ ?msym({ok,[#app{name=kernel},
+ #app{name=sasl},
+ #app{name=stdlib},
+ #app{name=x,uses_apps=[y]},
+ #app{name=y,uses_apps=[]}]},
+ reltool_server:get_apps(Pid,whitelist)),
+ {ok, Der} = ?msym({ok,_},reltool_server:get_apps(Pid,derived)),
+ ?msym([], rm_missing_app(Der)),
+ ?msym({ok,[]}, reltool_server:get_apps(Pid,source)),
+
+ %% 1. check that y0 is not included since it has
+ %% incl_cond=derived, but is not used by any other module.
+ ?msym({ok,#mod{is_included=undefined}}, reltool_server:get_mod(Pid,y0)),
+
+ %% 2. check that y1 is excluded since it has undefined incl_cond
+ %% on mod level, so mod_cond on app level shall be used.
+ ?msym({ok,#mod{is_included=false}}, reltool_server:get_mod(Pid,y1)),
+
+ %% 3. check that y2 is included since it has incl_cond=derived and
+ %% is used by x3.
+ ?msym({ok,#mod{is_included=true}}, reltool_server:get_mod(Pid,y2)),
+
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+use_selected_vsn(Config) ->
+ LibDir1 = filename:join(datadir(Config),"use_selected_vsn"),
+ B1Dir = filename:join(LibDir1,"b-1.0"),
+ B3Dir = filename:join(LibDir1,"b-3.0"),
+
+ LibDir2 = filename:join(LibDir1,"lib2"),
+ B2Dir = filename:join(LibDir2,"b-2.0"),
+
+ %%-----------------------------------------------------------------
+ %% Pre-selected vsn of app b
+ Sys1 = {sys,[{lib_dirs,[LibDir1]},
+ {incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,b,[{incl_cond,include},{vsn,"1.0"}]}]},
+ {ok, Pid1} = ?msym({ok, _}, reltool:start_server([{config, Sys1}])),
+ {ok,B11} = ?msym({ok,#app{vsn="1.0",active_dir=B1Dir}},
+ reltool_server:get_app(Pid1,b)),
+
+ %% Change from a pre-selected vsn to use a specific dir
+ ?msym({ok, #app{vsn ="3.0", active_dir = B3Dir}, []},
+ reltool_server:set_app(Pid1,
+ B11#app{active_dir = B3Dir,
+ use_selected_vsn = dir,
+ label = undefined,
+ vsn = undefined,
+ info = undefined})),
+ ?m(ok, reltool:stop(Pid1)),
+
+
+ %%-----------------------------------------------------------------
+ %% Pre-selected vsn of app b
+ Sys2 = {sys,[{lib_dirs,[LibDir1]},
+ {incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,b,[{incl_cond,include},{vsn,"1.0"}]}]},
+ {ok, Pid2} = ?msym({ok, _}, reltool:start_server([{config, Sys2}])),
+ {ok,B21} = ?msym({ok,#app{vsn="1.0",active_dir=B1Dir}},
+ reltool_server:get_app(Pid2,b)),
+
+ %% Change from a pre-selected vsn to use latest
+ ?msym({ok, #app{vsn ="3.0", active_dir = B3Dir}, []},
+ reltool_server:set_app(Pid2,
+ B21#app{use_selected_vsn=undefined,
+ label = undefined,
+ vsn = undefined,
+ info = undefined})),
+ ?m(ok, reltool:stop(Pid2)),
+
+
+ %%-----------------------------------------------------------------
+ %% Pre-selected directory for app b
+ Sys3 = {sys,[{lib_dirs,[LibDir1]},
+ {incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,b,[{incl_cond,include},{lib_dir,B2Dir}]}]},
+ {ok, Pid3} = ?msym({ok, _}, reltool:start_server([{config, Sys3}])),
+% test_server:break("Pid3 = list_to_pid(\""++pid_to_list(Pid3)++"\")."),
+ {ok,B31} = ?msym({ok,#app{vsn="2.0",active_dir=B2Dir}},
+ reltool_server:get_app(Pid3,b)),
+ %% Change from a pre-selected dir to use latest
+ {ok,B32,_} = ?msym({ok, #app{vsn ="3.0", active_dir = B3Dir}, []},
+ reltool_server:set_app(Pid3,
+ B31#app{use_selected_vsn=undefined,
+ label = undefined,
+ vsn = undefined,
+ info = undefined})),
+ %% Change back to use selected dir
+ {ok,B33,_} = ?msym({ok, #app{vsn ="3.0", active_dir = B3Dir}, []},
+ reltool_server:set_app(Pid3,
+ B32#app{use_selected_vsn = dir})),
+ %% use dir 1
+ {ok,B34,_} = ?msym({ok, #app{vsn ="1.0", active_dir = B1Dir}, []},
+ reltool_server:set_app(Pid3,
+ B33#app{active_dir = B1Dir,
+ label = undefined,
+ vsn = undefined,
+ info = undefined})),
+ %% use dir 2
+ {ok,B35,_} = ?msym({ok, #app{vsn ="2.0", active_dir = B2Dir}, []},
+ reltool_server:set_app(Pid3,
+ B34#app{active_dir = B2Dir,
+ label = undefined,
+ vsn = undefined,
+ info = undefined})),
+ %% use dir 3
+ ?msym({ok, #app{vsn ="3.0", active_dir = B3Dir}, []},
+ reltool_server:set_app(Pid3,
+ B35#app{active_dir = B3Dir,
+ label = undefined,
+ vsn = undefined,
+ info = undefined})),
+ ?m(ok, reltool:stop(Pid3)),
+ ok.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+use_selected_vsn_relative_path(Config) ->
+ LibDir = filename:join([datadir(Config),"use_selected_vsn","b-1.0"]),
+ RelDir = filename:join(LibDir,"rel"),
+
+ {ok,Cwd} = file:get_cwd(),
+ ok = file:set_cwd(RelDir),
+
+ Sys = {sys,[{incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,b,[{incl_cond,include},{lib_dir,".."}]}]},
+ {ok, Pid} = ?msym({ok, _}, reltool:start_server([{config, Sys}])),
+
+ ?msym({ok,#app{vsn="1.0",active_dir=LibDir}},reltool_server:get_app(Pid,b)),
+
+ ?m(ok, reltool:stop(Pid)),
+
+ ok = file:set_cwd(Cwd),
+ ok.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Test that reltool recognizes an application with its real name even
+%% though it uses non standard format for its version number (in the
+%% directory name)
+non_standard_vsn_id(Config) ->
+ LibDir = filename:join(datadir(Config),"non_standard_vsn_id"),
+ B1Dir = filename:join(LibDir,"b-first"),
+ B2Dir = filename:join(LibDir,"b-second"),
+
+ %%-----------------------------------------------------------------
+ %% Default vsn of app b
+ Sys1 = {sys,[{lib_dirs,[LibDir]},
+ {incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,b,[{incl_cond,include}]}]},
+ {ok, Pid1} = ?msym({ok, _}, reltool:start_server([{config, Sys1}])),
+ ?msym({ok,#app{vsn="first",active_dir=B1Dir,sorted_dirs=[B1Dir,B2Dir]}},
+ reltool_server:get_app(Pid1,b)),
+
+ %%-----------------------------------------------------------------
+ %% Pre-selected vsn of app b
+ Sys2 = {sys,[{lib_dirs,[LibDir]},
+ {incl_cond, exclude},
+ {app,kernel,[{incl_cond,include}]},
+ {app,sasl,[{incl_cond,include}]},
+ {app,stdlib,[{incl_cond,include}]},
+ {app,b,[{incl_cond,include},{vsn,"second"}]}]},
+ {ok, Pid2} = ?msym({ok, _}, reltool:start_server([{config, Sys2}])),
+ ?msym({ok,#app{vsn="second",active_dir=B2Dir,sorted_dirs=[B1Dir,B2Dir]}},
+ reltool_server:get_app(Pid2,b)),
+ ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -478,6 +2346,20 @@ erl_libs() ->
LibStr -> string:tokens(LibStr, ":;")
end.
+datadir(Config) ->
+ %% Removes the trailing slash...
+ filename:nativename(?config(data_dir,Config)).
+
+latest(App) ->
+ AppStr = atom_to_list(App),
+ AppDirs = filelib:wildcard(filename:join(code:lib_dir(),AppStr++"-*")),
+ [LatestAppDir|_] = lists:reverse(AppDirs),
+ [_,Vsn] = string:tokens(filename:basename(LatestAppDir),"-"),
+ Vsn.
+
+rm_missing_app(Apps) ->
+ lists:keydelete(?MISSING_APP_NAME,#app.name,Apps).
+
diff_script(Script, Script) ->
equal;
diff_script({script, Rel, Commands1}, {script, Rel, Commands2}) ->
@@ -534,10 +2416,14 @@ mod_path(Node,Mod) ->
%% Node handling
start_node(Name, ErlPath) ->
+ start_node(Name, ErlPath, []).
+start_node(Name, ErlPath, Args0) ->
FullName = full_node_name(Name),
- CmdLine = mk_node_cmdline(Name, ErlPath),
- io:format("Starting node ~p: ~s~n", [FullName, CmdLine]),
- case open_port({spawn, CmdLine}, []) of
+ Args = mk_node_args(Name, Args0),
+ io:format("Starting node ~p: ~s~n",
+ [FullName, lists:flatten([[X," "] || X <- [ErlPath|Args]])]),
+ %io:format("open_port({spawn_executable, ~p}, [{args,~p}])~n",[ErlPath,Args]),
+ case open_port({spawn_executable, ErlPath}, [{args,Args}]) of
Port when is_port(Port) ->
unlink(Port),
erlang:port_close(Port),
@@ -554,29 +2440,21 @@ stop_node(Node) ->
spawn(Node, fun () -> halt() end),
receive {nodedown, Node} -> ok end.
-mk_node_cmdline(Name) ->
- Prog = case catch init:get_argument(progname) of
- {ok,[[P]]} -> P;
- _ -> exit(no_progname_argument_found)
- end,
- mk_node_cmdline(Name, Prog).
-
-mk_node_cmdline(Name, Prog) ->
- Static = "-detached -noinput",
+mk_node_args(Name, Args) ->
Pa = filename:dirname(code:which(?MODULE)),
NameSw = case net_kernel:longnames() of
- false -> "-sname ";
- true -> "-name ";
+ false -> "-sname";
+ true -> "-name";
_ -> exit(not_distributed_node)
end,
{ok, Pwd} = file:get_cwd(),
NameStr = atom_to_list(Name),
- Prog ++ " "
- ++ Static ++ " "
- ++ NameSw ++ " " ++ NameStr ++ " "
- ++ "-pa " ++ Pa ++ " "
- ++ "-env ERL_CRASH_DUMP " ++ Pwd ++ "/erl_crash_dump." ++ NameStr ++ " "
- ++ "-setcookie " ++ atom_to_list(erlang:get_cookie()).
+ ["-detached", "-noinput",
+ NameSw, NameStr,
+ "-pa", Pa,
+ "-env", "ERL_CRASH_DUMP", Pwd ++ "/erl_crash_dump." ++ NameStr,
+ "-setcookie", atom_to_list(erlang:get_cookie())
+ | Args].
full_node_name(PreName) ->
HostSuffix = lists:dropwhile(fun ($@) -> false; (_) -> true end,
@@ -610,14 +2488,16 @@ wait_for_process(Node, Name, N) when is_integer(N), N > 0 ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Run escript
-run(Dir, Cmd0) ->
+run(Dir, Script, Args) ->
+ Cmd0 = filename:rootname(Script) ++ " " ++ Args,
Cmd = case os:type() of
{win32,_} -> filename:nativename(Dir) ++ "\\" ++ Cmd0;
_ -> Cmd0
end,
do_run(Dir, Cmd).
-run(Dir, Opts, Cmd0) ->
+run(Dir, Opts, Script, Args) ->
+ Cmd0 = filename:rootname(Script) ++ " " ++ Args,
Cmd = case os:type() of
{win32,_} -> Opts ++ " " ++ filename:nativename(Dir) ++ "\\" ++ Cmd0;
_ -> Opts ++ " " ++ Dir ++ "/" ++ Cmd0
@@ -626,7 +2506,9 @@ run(Dir, Opts, Cmd0) ->
do_run(Dir, Cmd) ->
io:format("Run: ~p\n", [Cmd]),
- Env = [{"PATH",Dir++":"++os:getenv("PATH")}],
+ Env = [{"PATH",Dir++":"++os:getenv("PATH")},
+ {"ERL_FLAGS",""}, % Make sure no flags are set that can override
+ {"ERL_ZFLAGS",""}], % any of the flags set in the escript.
Port = open_port({spawn,Cmd}, [exit_status,eof,in,{env,Env}]),
Res = get_data(Port, []),
receive
diff --git a/lib/reltool/test/reltool_server_SUITE_data/Makefile.src b/lib/reltool/test/reltool_server_SUITE_data/Makefile.src
index 049e8dd6cc..02846f42b6 100644
--- a/lib/reltool/test/reltool_server_SUITE_data/Makefile.src
+++ b/lib/reltool/test/reltool_server_SUITE_data/Makefile.src
@@ -6,8 +6,27 @@ OTP9229= \
otp_9229/y-1.0/ebin/y.@EMULATOR@ \
otp_9229/y-1.0/ebin/mylib.@EMULATOR@
+DEPENDENCIES= \
+ dependencies/x-1.0/ebin/x1.@EMULATOR@ \
+ dependencies/x-1.0/ebin/x2.@EMULATOR@ \
+ dependencies/x-1.0/ebin/x3.@EMULATOR@ \
+ dependencies/y-1.0/ebin/y1.@EMULATOR@ \
+ dependencies/y-1.0/ebin/y2.@EMULATOR@ \
+ dependencies/z-1.0/ebin/z1.@EMULATOR@
-all: $(OTP9229)
+ESCRIPT= \
+ escript/someapp-1.0/ebin/mymod.@EMULATOR@
+
+SEL_VSN= \
+ use_selected_vsn/b-1.0/ebin/b.@EMULATOR@ \
+ use_selected_vsn/b-3.0/ebin/b.@EMULATOR@ \
+ use_selected_vsn/lib2/b-2.0/ebin/b.@EMULATOR@
+
+SLIM= \
+ slim/a-1.0/ebin/a_sup.@EMULATOR@ \
+ slim/a-1.0/ebin/a.@EMULATOR@
+
+all: $(OTP9229) $(DEPENDENCIES) $(ESCRIPT) $(SEL_VSN) $(SLIM)
otp_9229/x-1.0/ebin/x.@EMULATOR@: otp_9229/x-1.0/src/x.erl
erlc $(EFLAGS) -ootp_9229/x-1.0/ebin otp_9229/x-1.0/src/x.erl
@@ -17,3 +36,31 @@ otp_9229/y-1.0/ebin/y.@EMULATOR@: otp_9229/y-1.0/src/y.erl
erlc $(EFLAGS) -ootp_9229/y-1.0/ebin otp_9229/y-1.0/src/y.erl
otp_9229/y-1.0/ebin/mylib.@EMULATOR@: otp_9229/y-1.0/src/mylib.erl
erlc $(EFLAGS) -ootp_9229/y-1.0/ebin otp_9229/y-1.0/src/mylib.erl
+
+dependencies/x-1.0/ebin/x1.@EMULATOR@: dependencies/x-1.0/src/x1.erl
+ erlc $(EFLAGS) -odependencies/x-1.0/ebin dependencies/x-1.0/src/x1.erl
+dependencies/x-1.0/ebin/x2.@EMULATOR@: dependencies/x-1.0/src/x2.erl
+ erlc $(EFLAGS) -odependencies/x-1.0/ebin dependencies/x-1.0/src/x2.erl
+dependencies/x-1.0/ebin/x3.@EMULATOR@: dependencies/x-1.0/src/x3.erl
+ erlc $(EFLAGS) -odependencies/x-1.0/ebin dependencies/x-1.0/src/x3.erl
+dependencies/y-1.0/ebin/y1.@EMULATOR@: dependencies/y-1.0/src/y1.erl
+ erlc $(EFLAGS) -odependencies/y-1.0/ebin dependencies/y-1.0/src/y1.erl
+dependencies/y-1.0/ebin/y2.@EMULATOR@: dependencies/y-1.0/src/y2.erl
+ erlc $(EFLAGS) -odependencies/y-1.0/ebin dependencies/y-1.0/src/y2.erl
+dependencies/z-1.0/ebin/z1.@EMULATOR@: dependencies/z-1.0/src/z1.erl
+ erlc $(EFLAGS) -odependencies/z-1.0/ebin dependencies/z-1.0/src/z1.erl
+
+escript/someapp-1.0/ebin/mymod.@EMULATOR@: escript/someapp-1.0/src/mymod.erl
+ erlc $(EFLAGS) -oescript/someapp-1.0/ebin escript/someapp-1.0/src/mymod.erl
+
+use_selected_vsn/b-1.0/ebin/b.@EMULATOR@: use_selected_vsn/b-1.0/src/b.erl
+ erlc $(EFLAGS) -ouse_selected_vsn/b-1.0/ebin use_selected_vsn/b-1.0/src/b.erl
+use_selected_vsn/b-3.0/ebin/b.@EMULATOR@: use_selected_vsn/b-3.0/src/b.erl
+ erlc $(EFLAGS) -ouse_selected_vsn/b-3.0/ebin use_selected_vsn/b-3.0/src/b.erl
+use_selected_vsn/lib2/b-2.0/ebin/b.@EMULATOR@: use_selected_vsn/lib2/b-2.0/src/b.erl
+ erlc $(EFLAGS) -ouse_selected_vsn/lib2/b-2.0/ebin use_selected_vsn/lib2/b-2.0/src/b.erl
+
+slim/a-1.0/ebin/a_sup.@EMULATOR@: slim/a-1.0/src/a_sup.erl
+ erlc $(EFLAGS) -oslim/a-1.0/ebin slim/a-1.0/src/a_sup.erl
+slim/a-1.0/ebin/a.@EMULATOR@: slim/a-1.0/src/a.erl
+ erlc $(EFLAGS) -oslim/a-1.0/ebin slim/a-1.0/src/a.erl
diff --git a/lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/ebin/x.app b/lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/ebin/x.app
new file mode 100644
index 0000000000..ccaab8a8c7
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/ebin/x.app
@@ -0,0 +1,7 @@
+% -*-erlang-*-
+{application, x,
+ [{description, "Main application in reltool dependency test"},
+ {vsn, "1.0"},
+ {modules, [x1,x2,x3]},
+ {registered, []},
+ {applications, [kernel, stdlib]}]}.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/src/x1.erl b/lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/src/x1.erl
new file mode 100644
index 0000000000..bf1e7f9279
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/src/x1.erl
@@ -0,0 +1,5 @@
+-module(x1).
+-compile(export_all).
+
+f() ->
+ ok.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/src/x2.erl b/lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/src/x2.erl
new file mode 100644
index 0000000000..82191ba278
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/src/x2.erl
@@ -0,0 +1,5 @@
+-module(x2).
+-compile(export_all).
+
+f() ->
+ y1:f().
diff --git a/lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/src/x3.erl b/lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/src/x3.erl
new file mode 100644
index 0000000000..618c75c9a7
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/dependencies/x-1.0/src/x3.erl
@@ -0,0 +1,5 @@
+-module(x3).
+-compile(export_all).
+
+f() ->
+ y2:f().
diff --git a/lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/ebin/y.app b/lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/ebin/y.app
new file mode 100644
index 0000000000..39fdabeea4
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/ebin/y.app
@@ -0,0 +1,7 @@
+% -*-erlang-*-
+{application, y,
+ [{description, "Library application in reltool dependency test"},
+ {vsn, "1.0"},
+ {modules, [y0,y1,y2]},
+ {registered, []},
+ {applications, [kernel, stdlib]}]}.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/src/y0.erl b/lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/src/y0.erl
new file mode 100644
index 0000000000..dc188ba7b6
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/src/y0.erl
@@ -0,0 +1,5 @@
+-module(y0).
+-compile(export_all).
+
+f() ->
+ ok.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/src/y1.erl b/lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/src/y1.erl
new file mode 100644
index 0000000000..dd21b33292
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/src/y1.erl
@@ -0,0 +1,5 @@
+-module(y1).
+-compile(export_all).
+
+f() ->
+ z1:f().
diff --git a/lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/src/y2.erl b/lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/src/y2.erl
new file mode 100644
index 0000000000..bf8ddf6080
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/dependencies/y-1.0/src/y2.erl
@@ -0,0 +1,5 @@
+-module(y2).
+-compile(export_all).
+
+f() ->
+ ok.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/dependencies/z-1.0/ebin/z.app b/lib/reltool/test/reltool_server_SUITE_data/dependencies/z-1.0/ebin/z.app
new file mode 100644
index 0000000000..437a0968e9
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/dependencies/z-1.0/ebin/z.app
@@ -0,0 +1,7 @@
+% -*-erlang-*-
+{application, z,
+ [{description, "Library application in reltool dependency test"},
+ {vsn, "1.0"},
+ {modules, [z1]},
+ {registered, []},
+ {applications, [kernel, stdlib]}]}.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/dependencies/z-1.0/src/z1.erl b/lib/reltool/test/reltool_server_SUITE_data/dependencies/z-1.0/src/z1.erl
new file mode 100644
index 0000000000..97ef90b87f
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/dependencies/z-1.0/src/z1.erl
@@ -0,0 +1,5 @@
+-module(z1).
+-compile(export_all).
+
+f() ->
+ ok.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/dupl_mod/a-1.0/ebin/a.app b/lib/reltool/test/reltool_server_SUITE_data/dupl_mod/a-1.0/ebin/a.app
new file mode 100644
index 0000000000..fada34847a
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/dupl_mod/a-1.0/ebin/a.app
@@ -0,0 +1,7 @@
+% -*-erlang-*-
+{application, a,
+ [{description, "Application with duplicated module name in .app file"},
+ {vsn, "1.0"},
+ {modules, [a,a]},
+ {registered, []},
+ {applications, [kernel, stdlib]}]}.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/escript/someapp-1.0/ebin/someapp.app b/lib/reltool/test/reltool_server_SUITE_data/escript/someapp-1.0/ebin/someapp.app
new file mode 100644
index 0000000000..ea2209941e
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/escript/someapp-1.0/ebin/someapp.app
@@ -0,0 +1,6 @@
+%% -*- erlang -*-
+{application, someapp,
+ [{description, "Some app for reltool test including archives in escripts"},
+ {vsn, "1.0"},
+ {modules, [someapp]},
+ {applications, [kernel, stdlib]}]}.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/escript/someapp-1.0/src/mymod.erl b/lib/reltool/test/reltool_server_SUITE_data/escript/someapp-1.0/src/mymod.erl
new file mode 100644
index 0000000000..b6c71c666d
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/escript/someapp-1.0/src/mymod.erl
@@ -0,0 +1,26 @@
+%% ``The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved via the world wide web at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
+%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
+%% AB. All Rights Reserved.''
+%%
+%% $Id$
+%%
+-module(mymod).
+
+-export([main/1]).
+
+%%%-----------------------------------------------------------------
+%%% escript main function
+main(Args) ->
+ io:format("Root dir: ~s\n", [code:root_dir()]),
+ io:format("Script args: ~p\n", [Args]).
diff --git a/lib/reltool/test/reltool_server_SUITE_data/faulty_app_file/a-1.0/ebin/a.app b/lib/reltool/test/reltool_server_SUITE_data/faulty_app_file/a-1.0/ebin/a.app
new file mode 100644
index 0000000000..ea77103598
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/faulty_app_file/a-1.0/ebin/a.app
@@ -0,0 +1 @@
+faulty app file
diff --git a/lib/reltool/test/reltool_server_SUITE_data/faulty_app_file/a-1.0/src/a.erl b/lib/reltool/test/reltool_server_SUITE_data/faulty_app_file/a-1.0/src/a.erl
new file mode 100644
index 0000000000..bb500bed69
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/faulty_app_file/a-1.0/src/a.erl
@@ -0,0 +1,49 @@
+%% ``The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved via the world wide web at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
+%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
+%% AB. All Rights Reserved.''
+%%
+%% $Id$
+%%
+-module(a).
+
+
+-behaviour(gen_server).
+
+-vsn(1).
+
+%% External exports
+-export([start_link/0, a/0]).
+%% Internal exports
+-export([init/1, handle_call/3, handle_info/2, terminate/2]).
+
+start_link() -> gen_server:start_link({local, aa}, a, [], []).
+
+a() -> gen_server:call(aa, a).
+
+%%-----------------------------------------------------------------
+%% Callback functions from gen_server
+%%-----------------------------------------------------------------
+init([]) ->
+ process_flag(trap_exit, true),
+ {ok, state}.
+
+handle_call(a, _From, State) ->
+ X = application:get_all_env(a),
+ {reply, X, State}.
+
+handle_info(_, State) ->
+ {noreply, State}.
+
+terminate(_Reason, _State) ->
+ ok.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/faulty_app_file/a-1.0/src/a_sup.erl b/lib/reltool/test/reltool_server_SUITE_data/faulty_app_file/a-1.0/src/a_sup.erl
new file mode 100644
index 0000000000..a141c1767b
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/faulty_app_file/a-1.0/src/a_sup.erl
@@ -0,0 +1,37 @@
+%% ``The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved via the world wide web at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
+%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
+%% AB. All Rights Reserved.''
+%%
+%% $Id$
+%%
+-module(a_sup).
+
+
+-behaviour(supervisor).
+
+%% External exports
+-export([start/2]).
+
+%% Internal exports
+-export([init/1]).
+
+start(_, _) ->
+ supervisor:start_link({local, a_sup}, a_sup, []).
+
+init([]) ->
+ SupFlags = {one_for_one, 4, 3600},
+ Config = {a,
+ {a, start_link, []},
+ permanent, 2000, worker, [a]},
+ {ok, {SupFlags, [Config]}}.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-first/ebin/b.app b/lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-first/ebin/b.app
new file mode 100644
index 0000000000..55550a8190
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-first/ebin/b.app
@@ -0,0 +1,6 @@
+%% -*- erlang -*-
+{application, b,
+ [{description, "Reltool test app for using selected version of app"},
+ {vsn, "first"},
+ {modules, [b]},
+ {applications, [kernel, stdlib]}]}.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-first/src/b.erl b/lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-first/src/b.erl
new file mode 100644
index 0000000000..a6b4ff1c05
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-first/src/b.erl
@@ -0,0 +1,4 @@
+-module(b).
+-compile(export_all).
+
+foo() -> ok.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-second/ebin/b.app b/lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-second/ebin/b.app
new file mode 100644
index 0000000000..91e1365df7
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-second/ebin/b.app
@@ -0,0 +1,6 @@
+%% -*- erlang -*-
+{application, b,
+ [{description, "Reltool test app for using selected version of app"},
+ {vsn, "second"},
+ {modules, [b]},
+ {applications, [kernel, stdlib]}]}.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-second/src/b.erl b/lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-second/src/b.erl
new file mode 100644
index 0000000000..a6b4ff1c05
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/non_standard_vsn_id/b-second/src/b.erl
@@ -0,0 +1,4 @@
+-module(b).
+-compile(export_all).
+
+foo() -> ok.
diff --git a/lib/sasl/test/release_handler_SUITE_data/P2B/a-2.0/ebin/a.app b/lib/reltool/test/reltool_server_SUITE_data/slim/a-1.0/ebin/a.app
index 200cfcfe47..3160e00da7 100644
--- a/lib/sasl/test/release_handler_SUITE_data/P2B/a-2.0/ebin/a.app
+++ b/lib/reltool/test/reltool_server_SUITE_data/slim/a-1.0/ebin/a.app
@@ -1,8 +1,7 @@
{application, a,
[{description, "A CXC 138 11"},
- {vsn, "2.0"},
- {modules, [{a, 1}, {a_sup,1}]},
+ {vsn, "1.0"},
+ {modules, [a, a_sup]},
{registered, [a_sup]},
{applications, [kernel, stdlib]},
- {env, [{key1, val1}]},
{mod, {a_sup, []}}]}.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/slim/a-1.0/src/a.erl b/lib/reltool/test/reltool_server_SUITE_data/slim/a-1.0/src/a.erl
new file mode 100644
index 0000000000..bb500bed69
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/slim/a-1.0/src/a.erl
@@ -0,0 +1,49 @@
+%% ``The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved via the world wide web at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
+%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
+%% AB. All Rights Reserved.''
+%%
+%% $Id$
+%%
+-module(a).
+
+
+-behaviour(gen_server).
+
+-vsn(1).
+
+%% External exports
+-export([start_link/0, a/0]).
+%% Internal exports
+-export([init/1, handle_call/3, handle_info/2, terminate/2]).
+
+start_link() -> gen_server:start_link({local, aa}, a, [], []).
+
+a() -> gen_server:call(aa, a).
+
+%%-----------------------------------------------------------------
+%% Callback functions from gen_server
+%%-----------------------------------------------------------------
+init([]) ->
+ process_flag(trap_exit, true),
+ {ok, state}.
+
+handle_call(a, _From, State) ->
+ X = application:get_all_env(a),
+ {reply, X, State}.
+
+handle_info(_, State) ->
+ {noreply, State}.
+
+terminate(_Reason, _State) ->
+ ok.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/slim/a-1.0/src/a_sup.erl b/lib/reltool/test/reltool_server_SUITE_data/slim/a-1.0/src/a_sup.erl
new file mode 100644
index 0000000000..a141c1767b
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/slim/a-1.0/src/a_sup.erl
@@ -0,0 +1,37 @@
+%% ``The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved via the world wide web at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
+%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
+%% AB. All Rights Reserved.''
+%%
+%% $Id$
+%%
+-module(a_sup).
+
+
+-behaviour(supervisor).
+
+%% External exports
+-export([start/2]).
+
+%% Internal exports
+-export([init/1]).
+
+start(_, _) ->
+ supervisor:start_link({local, a_sup}, a_sup, []).
+
+init([]) ->
+ SupFlags = {one_for_one, 4, 3600},
+ Config = {a,
+ {a, start_link, []},
+ permanent, 2000, worker, [a]},
+ {ok, {SupFlags, [Config]}}.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/sort_apps/x-1.0/ebin/x.app b/lib/reltool/test/reltool_server_SUITE_data/sort_apps/x-1.0/ebin/x.app
new file mode 100644
index 0000000000..5fa2a92969
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/sort_apps/x-1.0/ebin/x.app
@@ -0,0 +1,7 @@
+% -*-erlang-*-
+{application, x,
+ [{description, "Application in reltool sort app test - circular dependency"},
+ {vsn, "1.0"},
+ {modules,[]},
+ {registered, []},
+ {applications, [kernel, stdlib, y]}]}.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/sort_apps/y-1.0/ebin/y.app b/lib/reltool/test/reltool_server_SUITE_data/sort_apps/y-1.0/ebin/y.app
new file mode 100644
index 0000000000..c4bc62f55f
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/sort_apps/y-1.0/ebin/y.app
@@ -0,0 +1,7 @@
+% -*-erlang-*-
+{application, y,
+ [{description, "Application in reltool sort app test - circular dependency"},
+ {vsn, "1.0"},
+ {modules,[]},
+ {registered, []},
+ {applications, [kernel, stdlib, x]}]}.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/sort_apps/z-1.0/ebin/z.app b/lib/reltool/test/reltool_server_SUITE_data/sort_apps/z-1.0/ebin/z.app
new file mode 100644
index 0000000000..8608bc554b
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/sort_apps/z-1.0/ebin/z.app
@@ -0,0 +1,8 @@
+% -*-erlang-*-
+{application, z,
+ [{description, "Application in reltool sort app test - included applications"},
+ {vsn, "1.0"},
+ {modules,[]},
+ {registered, []},
+ {applications, [kernel, stdlib, sasl, inets]},
+ {included_applications, [tools, mnesia]}]}.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-1.0/ebin/b.app b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-1.0/ebin/b.app
new file mode 100644
index 0000000000..c511dcc8f1
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-1.0/ebin/b.app
@@ -0,0 +1,6 @@
+%% -*- erlang -*-
+{application, b,
+ [{description, "Reltool test app for using selected version of app"},
+ {vsn, "1.0"},
+ {modules, [b]},
+ {applications, [kernel, stdlib]}]}.
diff --git a/lib/inviso/priv b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-1.0/rel/.gitignore
index e69de29bb2..e69de29bb2 100644
--- a/lib/inviso/priv
+++ b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-1.0/rel/.gitignore
diff --git a/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-1.0/src/b.erl b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-1.0/src/b.erl
new file mode 100644
index 0000000000..a6b4ff1c05
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-1.0/src/b.erl
@@ -0,0 +1,4 @@
+-module(b).
+-compile(export_all).
+
+foo() -> ok.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-3.0/ebin/b.app b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-3.0/ebin/b.app
new file mode 100644
index 0000000000..9ed7695a40
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-3.0/ebin/b.app
@@ -0,0 +1,6 @@
+%% -*- erlang -*-
+{application, b,
+ [{description, "Reltool test app for using selected version of app"},
+ {vsn, "3.0"},
+ {modules, [b]},
+ {applications, [kernel, stdlib]}]}.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-3.0/src/b.erl b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-3.0/src/b.erl
new file mode 100644
index 0000000000..a6b4ff1c05
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/b-3.0/src/b.erl
@@ -0,0 +1,4 @@
+-module(b).
+-compile(export_all).
+
+foo() -> ok.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/lib2/b-2.0/ebin/b.app b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/lib2/b-2.0/ebin/b.app
new file mode 100644
index 0000000000..33c633d635
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/lib2/b-2.0/ebin/b.app
@@ -0,0 +1,6 @@
+%% -*- erlang -*-
+{application, b,
+ [{description, "Reltool test app for using selected version of app"},
+ {vsn, "2.0"},
+ {modules, [b]},
+ {applications, [kernel, stdlib]}]}.
diff --git a/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/lib2/b-2.0/src/b.erl b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/lib2/b-2.0/src/b.erl
new file mode 100644
index 0000000000..a6b4ff1c05
--- /dev/null
+++ b/lib/reltool/test/reltool_server_SUITE_data/use_selected_vsn/lib2/b-2.0/src/b.erl
@@ -0,0 +1,4 @@
+-module(b).
+-compile(export_all).
+
+foo() -> ok.
diff --git a/lib/reltool/test/reltool_test_lib.erl b/lib/reltool/test/reltool_test_lib.erl
index b8bcbcd009..61f783190c 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -138,10 +138,6 @@ end_per_testcase(_Func, Config) when is_list(Config) ->
reset_kill_timer(Config),
Config.
-%% Backwards compatible with test_server
-tc_info(suite) -> [];
-tc_info(doc) -> "".
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Use ?log(Format, Args) as wrapper
diff --git a/lib/reltool/test/reltool_test_lib.hrl b/lib/reltool/test/reltool_test_lib.hrl
index b592ebb2f0..0dfc08b81c 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -18,20 +18,10 @@
-include_lib("wx/include/wx.hrl").
--define(flat_format(Format,Args), lists:flatten(io_lib:format(Format,Args))).
-define(log(Format,Args), reltool_test_lib:log(Format,Args,?FILE,?LINE)).
--define(warning(Format,Args), ?log("<WARNING>\n " ++ Format,Args)).
-define(error(Format,Args), reltool_test_lib:error(Format,Args,?FILE,?LINE)).
-define(verbose(Format,Args), reltool_test_lib:verbose(Format,Args,?FILE,?LINE)).
--define(fatal(Format,Args),
- ?error(Format, Args),
- exit({test_case_fatal, Format, Args, ?FILE, ?LINE})).
-
--define(skip(Format,Args),
- ?warning(Format, Args),
- exit({skipped, ?flat_format(Format, Args)})).
-
-define(ignore(Expr),
fun() ->
AcTuAlReS = (catch (Expr)),
@@ -68,25 +58,3 @@
AcTuAlReS
end
end()).
-
--define(m_receive(ExpectedMsg),
- ?m(ExpectedMsg,reltool_test_lib:pick_msg())).
-
--define(m_multi_receive(ExpectedMsgs),
- fun() ->
- TmPeXpCtEdMsGs = lists:sort(ExpectedMsgs),
- AcTuAlReS =
- lists:sort(lists:map(fun(_) ->
- reltool_test_lib:pick_msg()
- end, TmPeXpCtEdMsGs)),
- case AcTuAlReS of
- TmPeXpCtEdMsGs ->
- ?verbose("ok: ~p\n",[AcTuAlReS]),
- AcTuAlReS;
- _ ->
- reltool_test_lib:error("Not matching actual result was:\n ~p \nExpected ~p\n",
- [AcTuAlReS, ExpectedMsgs],
- ?FILE, ?LINE),
- AcTuAlReS
- end
- end()).
diff --git a/lib/reltool/test/reltool_wx_SUITE.erl b/lib/reltool/test/reltool_wx_SUITE.erl
index 424bc7d189..13d71f4fd6 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -61,9 +61,46 @@ start_all_windows(TestInfo) when is_atom(TestInfo) ->
reltool_test_lib:tc_info(TestInfo);
start_all_windows(_Config) ->
{ok, SysPid} = ?msym({ok, _}, reltool:start([{trap_exit, false}])),
+ erlang:monitor(process,SysPid),
{ok, AppPid} = ?msym({ok, _}, reltool_sys_win:open_app(SysPid, stdlib)),
- ?msym({ok, _}, reltool_app_win:open_mod(AppPid, escript)),
+ erlang:monitor(process,AppPid),
+ {ok, ModPid} = ?msym({ok, _}, reltool_app_win:open_mod(AppPid, escript)),
+ erlang:monitor(process,ModPid),
+
+ %% Let all windows get started
timer:sleep(timer:seconds(10)),
+
+ %% Test that server pid can be fetched, and that server is alive
+ {ok, Server} = ?msym({ok,_}, reltool:get_server(SysPid)),
+ ?m(true, erlang:is_process_alive(Server)),
+ ?m({ok,{sys,[]}}, reltool:get_config(Server)),
+
+ %% Terminate
+ check_no_win_crash(),
?m(ok, reltool:stop(SysPid)),
-
+ wait_terminate([{sys,SysPid},{app,AppPid},{mod,ModPid}]),
+
ok.
+
+
+%%%-----------------------------------------------------------------
+%%% Internal functions
+check_no_win_crash() ->
+ receive {'DOWN',_,_,_,_} = Down ->
+ ct:log("Unexpected termination of window:~n~p",[Down]),
+ ct:fail("window crashed")
+ after 0 ->
+ ok
+ end.
+
+wait_terminate([]) ->
+ ok;
+wait_terminate([{Win,P}|Rest]) ->
+ receive
+ {'DOWN',_,process,P,shutdown} ->
+ wait_terminate(Rest);
+ {'DOWN',_,process,P,Reason} ->
+ ct:log("~p window terminated with unexpected reason:~n~p",
+ [Win,Reason]),
+ ct:fail("unexpected exit reason from window")
+ end.
diff --git a/lib/reltool/vsn.mk b/lib/reltool/vsn.mk
index 3869284ee7..6872539b8c 100644
--- a/lib/reltool/vsn.mk
+++ b/lib/reltool/vsn.mk
@@ -1 +1 @@
-RELTOOL_VSN = 0.5.7.1
+RELTOOL_VSN = 0.6.1
diff --git a/lib/runtime_tools/c_src/Makefile.in b/lib/runtime_tools/c_src/Makefile.in
index 3d9a7ed69d..586f649924 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-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -21,6 +21,11 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk
include $(ERL_TOP)/make/$(TARGET)/otp_ded.mk
# ----------------------------------------------------
+# Items from top-level configure
+# ----------------------------------------------------
+DTRACE_ENABLED=@DTRACE_ENABLED@
+DTRACE_ENABLED_2STEP=@DTRACE_ENABLED_2STEP@
+# ----------------------------------------------------
# Application version
# ----------------------------------------------------
include ../vsn.mk
@@ -38,22 +43,26 @@ SHELL = /bin/sh
LIBS = $(DED_LIBS)
LDFLAGS += $(DED_LDFLAGS)
+DTRACE_LIBNAME = dyntrace
+
SYSINCLUDE = $(DED_SYS_INCLUDE)
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
- SYSINCLUDE += -I$(ERL_TOP)/erts/etc/vxworks
-endif
TRACE_DRV_INCLUDES = $(SYSINCLUDE)
-ALL_CFLAGS = $(CFLAGS) @DEFS@ $(TYPE_FLAGS) $(TRACE_DRV_INCLUDES)
-
+ALL_CFLAGS = $(CFLAGS) @DEFS@ $(TYPE_FLAGS) $(TRACE_DRV_INCLUDES) \
+ -I$(OBJDIR) -I$(ERL_TOP)/erts/emulator/$(TARGET)
ifeq ($(TYPE),debug)
TYPEMARKER = .debug
-TYPE_FLAGS = -g -DDEBUG @DEBUG_FLAGS@
+TYPE_FLAGS = $(subst -O3,,$(subst -O2,,$(CFLAGS))) -DDEBUG @DEBUG_FLAGS@
+else
+ifeq ($(TYPE),valgrind)
+TYPEMARKER = .valgrind
+TYPE_FLAGS = $(subst -O3,,$(subst -O2,,$(CFLAGS))) -DVALGRIND
else
TYPEMARKER =
-TYPE_FLAGS = -O2
+TYPE_FLAGS = $(CFLAGS)
+endif
endif
ROOTDIR = $(ERL_TOP)/lib
@@ -69,6 +78,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@
+
+ifeq ($(HOST_OS),)
+HOST_OS := $(shell $(ERL_TOP)/erts/autoconf/config.guess)
+endif
+
TRACE_IP_DRV_OBJS = \
$(OBJDIR)/trace_ip_drv.o
@@ -79,19 +98,52 @@ ifeq ($(findstring win32,$(TARGET)), win32)
SOLIBS = $(LIBDIR)/trace_ip_drv.dll $(LIBDIR)/trace_file_drv.dll
LN=cp
else
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
-SOLIBS = $(LIBDIR)/trace_ip_drv.eld $(LIBDIR)/trace_file_drv.eld
-else
SOLIBS = $(LIBDIR)/trace_ip_drv.so $(LIBDIR)/trace_file_drv.so
endif
-endif
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
_create_dirs := $(shell mkdir -p $(OBJDIR) $(LIBDIR))
-debug opt: $(SOLIBS)
+debug opt valgrind: $(SOLIBS) $(OBJDIR) $(LIBDIR) $(NIF_LIB)
+
+ifdef DTRACE_ENABLED
+DTRACE_USER_HEADER=$(OBJDIR)/dtrace_user.h
+$(OBJDIR)/dtrace_user.h: ./dtrace_user.d
+ dtrace -h -C $(INCLUDES) \
+ -s ./dtrace_user.d \
+ -o ./dtrace_user.tmp
+ sed -e '/^#define[ ]*ERLANG_[A-Z0-9_]*(.*)/y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' ./dtrace_user.tmp > $@
+ rm ./dtrace_user.tmp
+else
+DTRACE_USER_HEADER=
+endif
+
+DTRACE_OBJS =
+ifdef DTRACE_ENABLED_2STEP
+DTRACE_OBJS += $(OBJDIR)/dtrace_user.o
+$(OBJDIR)/dtrace_user.o: $(before_DTrace_OBJS) $(OBJDIR)/dtrace_user.h
+ dtrace -G -C \
+ -s ./dtrace_user.d \
+ -o $@ $(before_DTrace_OBJS)
+endif
+
+DYNTRACE_OBJS = $(before_DTrace_OBJS) $(DTRACE_OBJS)
+
+$(OBJDIR):
+ -@mkdir -p $(OBJDIR)
+
+$(LIBDIR):
+ -@mkdir -p $(LIBDIR)
+
+$(OBJDIR)/dyntrace$(TYPEMARKER).o: dyntrace.c $(DTRACE_USER_HEADER)
+ $(INSTALL_DIR) $(OBJDIR)
+ $(CC) -c -o $@ $(ALL_CFLAGS) $<
+
+$(NIF_LIB): $(DYNTRACE_OBJS)
+ $(INSTALL_DIR) $(LIBDIR)
+ $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
$(OBJDIR)/%.o: %.c
$(CC) -c -o $@ $(ALL_CFLAGS) $<
@@ -106,18 +158,15 @@ $(LIBDIR)/trace_ip_drv.dll: $(TRACE_IP_DRV_OBJS)
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
$(LIBDIR)/trace_file_drv.dll: $(TRACE_FILE_DRV_OBJS)
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
-#
-# VxWorks is simply to different from Unix in this sense.
-# Here are the inference rules for VxWorks
-#
-$(LIBDIR)/trace_ip_drv.eld: $(TRACE_IP_DRV_OBJS)
- $(LD) $(LDFLAGS) -o $@ $^
-
-$(LIBDIR)/trace_file_drv.eld: $(TRACE_FILE_DRV_OBJS)
- $(LD) $(LDFLAGS) -o $@ $^
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 core *~
docs:
@@ -128,8 +177,10 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/lib
- $(INSTALL_PROGRAM) $(SOLIBS) $(RELSYSDIR)/priv/lib
+ $(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"
release_docs_spec:
diff --git a/lib/runtime_tools/c_src/dtrace_user.d b/lib/runtime_tools/c_src/dtrace_user.d
new file mode 100644
index 0000000000..9e180a3cb2
--- /dev/null
+++ b/lib/runtime_tools/c_src/dtrace_user.d
@@ -0,0 +1,33 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie 2011-2012.
+ * All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+provider erlang {
+ /*
+ * The set of probes for use by Erlang code ... moved from here to
+ * erts/emulator/beam/erlang_dtrace.d until a more portable solution is
+ * found; see erlang_dtrace.d for details.
+ */
+};
+
+#pragma D attributes Evolving/Evolving/Common provider erlang provider
+#pragma D attributes Private/Private/Common provider erlang module
+#pragma D attributes Private/Private/Common provider erlang function
+#pragma D attributes Evolving/Evolving/Common provider erlang name
+#pragma D attributes Evolving/Evolving/Common provider erlang args
diff --git a/lib/runtime_tools/c_src/dyntrace.c b/lib/runtime_tools/c_src/dyntrace.c
new file mode 100644
index 0000000000..eef03afd1c
--- /dev/null
+++ b/lib/runtime_tools/c_src/dyntrace.c
@@ -0,0 +1,127 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+/*
+ * Purpose: Dynamically loadable NIF library for DTrace
+ */
+
+
+
+#include "erl_nif.h"
+#include "config.h"
+#include "sys.h"
+#include "dtrace-wrapper.h"
+#if defined(USE_DYNAMIC_TRACE) && (defined(USE_DTRACE) || defined(USE_SYSTEMTAP))
+#define HAVE_USE_DTRACE 1
+#endif
+#ifdef HAVE_USE_DTRACE
+#include "dtrace_user.h"
+#endif
+
+void dtrace_nifenv_str(ErlNifEnv *env, char *process_buf);
+void get_string_maybe(ErlNifEnv *env, const ERL_NIF_TERM term, char **ptr, char *buf, int bufsiz);
+#ifdef HAVE_USE_DTRACE
+ERL_NIF_TERM erl_nif_user_trace_s1(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM erl_nif_user_trace_i4s4(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+#endif
+
+#ifdef VALGRIND
+ # include <valgrind/memcheck.h>
+#endif
+
+#ifdef __GNUC__
+ # define INLINE __inline__
+#else
+ # define INLINE
+#endif
+
+#define MESSAGE_BUFSIZ 1024
+
+/* NIF interface declarations */
+static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info);
+
+/* The NIFs: */
+static ERL_NIF_TERM available(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM user_trace_s1(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+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 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}
+};
+
+ERL_NIF_INIT(dyntrace, nif_funcs, load, NULL, NULL, NULL)
+
+static ERL_NIF_TERM atom_true;
+static ERL_NIF_TERM atom_false;
+static ERL_NIF_TERM atom_error;
+static ERL_NIF_TERM atom_not_available;
+static ERL_NIF_TERM atom_badarg;
+static ERL_NIF_TERM atom_ok;
+
+static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info)
+{
+ atom_true = enif_make_atom(env,"true");
+ atom_false = enif_make_atom(env,"false");
+ atom_error = enif_make_atom(env,"error");
+ atom_not_available = enif_make_atom(env,"not_available");
+ atom_badarg = enif_make_atom(env,"badarg");
+ atom_ok = enif_make_atom(env,"ok");
+
+ return 0;
+}
+
+static ERL_NIF_TERM available(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+#ifdef HAVE_USE_DTRACE
+ return atom_true;
+#else
+ return atom_false;
+#endif
+}
+
+static ERL_NIF_TERM user_trace_s1(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+#ifdef HAVE_USE_DTRACE
+ return erl_nif_user_trace_s1(env, argc, argv);
+#else
+ return atom_error;
+#endif
+}
+
+static ERL_NIF_TERM user_trace_i4s4(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+#ifdef HAVE_USE_DTRACE
+ return erl_nif_user_trace_i4s4(env, argc, argv);
+#else
+ return atom_error;
+#endif
+}
+
+static ERL_NIF_TERM user_trace_n(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+#ifdef HAVE_USE_DTRACE
+ return erl_nif_user_trace_n(env, argc, argv);
+#else
+ return atom_error;
+#endif
+}
diff --git a/lib/runtime_tools/c_src/trace_ip_drv.c b/lib/runtime_tools/c_src/trace_ip_drv.c
index 7ae6c1b329..a7d132ca6e 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 1999-2012. 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
@@ -34,21 +34,12 @@
#include <stdlib.h>
#include <string.h>
#ifndef __WIN32__
-# ifdef VXWORKS
-# include <sockLib.h>
-# include <sys/times.h>
-# include <iosLib.h>
-# include <taskLib.h>
-# include <selectLib.h>
-# include <ioLib.h>
-# include "reclaim.h"
-# endif
-# include <unistd.h>
-# include <errno.h>
-# include <sys/types.h>
-# include <sys/socket.h>
-# include <netinet/in.h>
-# include <fcntl.h>
+# include <unistd.h>
+# include <errno.h>
+# include <sys/types.h>
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <fcntl.h>
#endif
#ifdef DEBUG
@@ -590,8 +581,8 @@ static void *my_alloc(size_t size)
void *ret;
if ((ret = driver_alloc(size)) == NULL) {
/* May or may not work... */
- fprintf(stderr, "Could not allocate %d bytes of memory in %s.",
- (int) size, __FILE__);
+ fprintf(stderr, "Could not allocate %lu bytes of memory in %s.",
+ (unsigned long) size, __FILE__);
exit(1);
}
return ret;
@@ -605,8 +596,8 @@ static ErlDrvBinary *my_alloc_binary(int size)
ErlDrvBinary *ret;
if ((ret = driver_alloc_binary(size)) == NULL) {
/* May or may not work... */
- fprintf(stderr, "Could not allocate a binary of %d bytes in %s.",
- (int) size, __FILE__);
+ fprintf(stderr, "Could not allocate a binary of %lu bytes in %s.",
+ (unsigned long) size, __FILE__);
exit(1);
}
return ret;
@@ -910,7 +901,7 @@ static void stop_select(ErlDrvEvent event, void* _)
WSACloseEvent((HANDLE)event);
}
-#else /* UNIX/VXWORKS */
+#else /* UNIX */
static int my_driver_select(TraceIpData *desc, SOCKET fd, int flags, enum MySelectOp op)
{
diff --git a/lib/runtime_tools/doc/src/Makefile b/lib/runtime_tools/doc/src/Makefile
index dbbae81cfe..51d93df418 100644
--- a/lib/runtime_tools/doc/src/Makefile
+++ b/lib/runtime_tools/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2009. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -40,12 +40,14 @@ RELSYSDIR = $(RELEASE_PATH)/lib/$(APPLICATION)-$(VSN)
# Target Specs
# ----------------------------------------------------
XML_APPLICATION_FILES = ref_man.xml
-XML_REF3_FILES = dbg.xml erts_alloc_config.xml
+XML_REF3_FILES = dbg.xml dyntrace.xml erts_alloc_config.xml
XML_REF6_FILES = runtime_tools_app.xml
-XML_PART_FILES = part_notes.xml part_notes_history.xml
+XML_PART_FILES = part_notes.xml part_notes_history.xml part.xml
XML_CHAPTER_FILES = notes.xml notes_history.xml
+GENERATED_XML_FILES = DTRACE.xml SYSTEMTAP.xml
+
BOOK_FILES = book.xml
XML_FILES = \
@@ -78,6 +80,11 @@ DVIPS_FLAGS +=
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
+$(XML_FILES): $(GENERATED_XML_FILES)
+
+%.xml: $(ERL_TOP)/HOWTO/%.md $(ERL_TOP)/make/emd2exml
+ $(ERL_TOP)/make/emd2exml $< $@
+
$(HTMLDIR)/%.gif: %.gif
$(INSTALL_DATA) $< $@
@@ -108,16 +115,16 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man6
- $(INSTALL_DATA) $(MAN6_FILES) $(RELEASE_PATH)/man/man6
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man6"
+ $(INSTALL_DATA) $(MAN6_FILES) "$(RELEASE_PATH)/man/man6"
release_spec:
diff --git a/lib/runtime_tools/doc/src/book.xml b/lib/runtime_tools/doc/src/book.xml
index 3f0dd7d55e..ad7d709644 100644
--- a/lib/runtime_tools/doc/src/book.xml
+++ b/lib/runtime_tools/doc/src/book.xml
@@ -34,6 +34,9 @@
<preamble>
<contents level="2"></contents>
</preamble>
+ <parts lift="no">
+ <xi:include href="part.xml"/>
+ </parts>
<applications>
<xi:include href="ref_man.xml"/>
</applications>
diff --git a/lib/runtime_tools/doc/src/dyntrace.xml b/lib/runtime_tools/doc/src/dyntrace.xml
new file mode 100644
index 0000000000..f0149d0665
--- /dev/null
+++ b/lib/runtime_tools/doc/src/dyntrace.xml
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="latin1" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>1996</year><year>2012</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ </legalnotice>
+
+ <title>dyntrace</title>
+ <prepared>Patrik Nyblom</prepared>
+ <responsible></responsible>
+ <docno>1</docno>
+ <approved>ETX/B/SFP (Kenneth Lundin)</approved>
+ <checked></checked>
+ <date>12-03-20</date>
+ <rev>A</rev>
+ <file>dyntrace.xml</file>
+ </header>
+ <module>dyntrace</module>
+ <modulesummary>Interface to dynamic tracing</modulesummary>
+ <description>
+ <p>This module implements interfaces to dynamic tracing, should such be compiled into the virtual machine. For a standard and/or commercial build, no dynamic tracing is available, in which case none of the functions in this module is usable or give any effect.</p>
+ <p>Should dynamic tracing be enabled in the current build, either by configuring with <c>./configure --with-dynamic-trace=dtrace</c> or with <c>./configure --with-dynamic-trace=systemtap</c>, the module can be used for two things:</p>
+ <list type="bulleted">
+ <item>Trigger the user-probe <c>user_trace_i4s4</c> in the NIF library <c>dyntrace.so</c> by calling <c>dyntrace:p/{1,2,3,4,5,6,7,8}</c>.</item>
+ <item>Set a user specified tag that will be present in the trace messages of both the <c>efile_drv</c> and the user-probe mentioned above.</item>
+ </list>
+ <p>Both building with dynamic trace probes and using them is experimental and unsupported by Erlang/OTP. It is included as an option for the developer to trace and debug performance issues in their systems.</p>
+ <p>The original implementation is mostly done by Scott Lystiger Fritchie as an Open Source Contribution and it should be viewed as such even though the source for dynamic tracing as well as this module is included in the main distribution. However, the ability to use dynamic tracing of the virtual machine is a very valuable contribution which OTP has every intention to maintain as a tool for the developer.</p>
+ <p>How to write <c>d</c> programs or <c>systemtap</c> scripts can be learned from books and from a lot of pages on the Internet. This manual page does not include any documentation about using the dynamic trace tools of respective platform. The <c>examples</c> directory of the <c>runtime_tools</c> application however contains comprehensive examples of both <c>d</c> and <c>systemtap</c> programs that will help you get started. Another source of information is the <seealso marker="DTRACE">dtrace</seealso> and <seealso marker="SYSTEMTAP">systemtap</seealso> chapters in the Runtime Tools Users' Guide.</p>
+ </description>
+ <funcs>
+ <func>
+ <name>available() -> boolean()</name>
+ <fsummary>Check if dynamic tracing is available</fsummary>
+ <desc>
+ <p>This function uses the NIF library to determine if dynamic
+ tracing is available. Usually calling <seealso
+ marker="erts:erlang#system_info/1">erlang:system_info/1</seealso>
+ is a better indicator of the availability of dynamic
+ tracing.</p>
+ <p>The function will throw an exception if the <c>dyntrace</c> NIF library could not be loaded by the on_load function of this module.</p>
+ </desc>
+ </func>
+ <func>
+ <name>p() -> true | false | error | badarg</name>
+ <fsummary>Trigger the user trace probe.</fsummary>
+ <desc>
+ <p>Calling this function will trigger the "user" trace probe user_trace_i4s4 in the dyntrace NIF module, sending a trace message only containing the user tag and zeroes/empty strings in all other fields.</p>
+ </desc>
+ </func>
+ <func>
+ <name>p(integer() | string()) -> true | false | error | badarg</name>
+ <fsummary>Trigger the user trace probe.</fsummary>
+ <desc>
+ <p>Calling this function will trigger the "user" trace probe user_trace_i4s4 in the dyntrace NIF module, sending a trace message containing the user tag and the integer or string parameter in the first integer/string field.</p>
+ </desc>
+ </func>
+ <func>
+ <name>p(integer() | string(), integer() | string()) -> true | false | error | badarg</name>
+ <fsummary>Trigger the user trace probe.</fsummary>
+ <desc>
+ <p>Calling this function will trigger the "user" trace probe user_trace_i4s4 in the dyntrace NIF module, sending a trace message containing the user tag and the integer() or string() parameters as the first fields of respective type. integer() parameters should be put before any string() parameters. I.e. <c>p(1,"Hello")</c> is ok, as is <c>p(1,1)</c> and <c>p("Hello","Again")</c>, but not <c>p("Hello",1)</c>.</p>
+ </desc>
+ </func>
+ <func>
+ <name>p(integer() | string(), integer() | string(), integer() | string()) -> true | false | error | badarg</name>
+ <fsummary>Trigger the user trace probe.</fsummary>
+ <desc>
+ <p>Calling this function will trigger the "user" trace probe user_trace_i4s4 in the dyntrace NIF module, sending a trace message containing the user tag and the integer() or string() parameters as the first fields of respective type. integer() parameters should be put before any string() parameters, as in <seealso marker="#p/2">p/2</seealso>.</p>
+ </desc>
+ </func>
+ <func>
+ <name>p(integer() | string(), integer() | string(), integer() | string(), integer() | string()) -> true | false | error | badarg</name>
+ <fsummary>Trigger the user trace probe.</fsummary>
+ <desc>
+ <p>Calling this function will trigger the "user" trace probe user_trace_i4s4 in the dyntrace NIF module, sending a trace message containing the user tag and the integer() or string() parameters as the first fields of respective type. integer() parameters should be put before any string() parameters, as in <seealso marker="#p/2">p/2</seealso>.</p>
+ </desc>
+ </func>
+ <func>
+ <name>p(integer(), integer() | string(), integer() | string(), integer() | string(), string()) -> true | false | error | badarg</name>
+ <fsummary>Trigger the user trace probe.</fsummary>
+ <desc>
+ <p>Calling this function will trigger the "user" trace probe user_trace_i4s4 in the dyntrace NIF module, sending a trace message containing the user tag and the integer() or string() parameters as the first fields of respective type. integer() parameters should be put before any string() parameters, as in <seealso marker="#p/2">p/2</seealso>.</p>
+ <p>There can be no more than four parameters of any type (integer() or string()), so the first parameter has to be an integer() and the last a string().</p>
+ </desc>
+ </func>
+ <func>
+ <name>p(integer(), integer(), integer() | string(), integer() | string(), string(), string()) -> true | false | error | badarg</name>
+ <fsummary>Trigger the user trace probe.</fsummary>
+ <desc>
+ <p>Calling this function will trigger the "user" trace probe user_trace_i4s4 in the dyntrace NIF module, sending a trace message containing the user tag and the integer() or string() parameters as the first fields of respective type. integer() parameters should be put before any string() parameters, as in <seealso marker="#p/2">p/2</seealso>.</p>
+ <p>There can be no more than four parameters of any type (integer() or string()), so the first two parameters has to be integer()'s and the last two string()'s.</p>
+ </desc>
+ </func>
+ <func>
+ <name>p(integer(), integer(), integer(), integer() | string(), string(), string(), string()) -> true | false | error | badarg</name>
+ <fsummary>Trigger the user trace probe.</fsummary>
+ <desc>
+ <p>Calling this function will trigger the "user" trace probe user_trace_i4s4 in the dyntrace NIF module, sending a trace message containing the user tag and the integer() or string() parameters as the first fields of respective type. integer() parameters should be put before any string() parameters, as in <seealso marker="#p/2">p/2</seealso>.</p>
+ <p>There can be no more than four parameters of any type (integer() or string()), so the first three parameters has to be integer()'s and the last three string()'s.</p>
+ </desc>
+ </func>
+ <func>
+ <name>p(integer(), integer(), integer(), integer(), string(), string(), string(), string()) -> true | false | error | badarg</name>
+ <fsummary>Trigger the user trace probe.</fsummary>
+ <desc>
+ <p>Calling this function will trigger the "user" trace probe user_trace_i4s4 in the dyntrace NIF module, sending a trace message containing all the integer()'s and string()'s provided, as well as any user tag set in the current process.</p>
+ </desc>
+ </func>
+ <func>
+ <name>get_tag() -> binary() | undefined</name>
+ <fsummary>Get the user tag set in the process.</fsummary>
+ <desc>
+ <p>This function returns the user tag set in the current
+ process. If no tag is set or dynamic tracing is not available,
+ it returns <c>undefined</c></p>
+ </desc>
+ </func>
+ <func>
+ <name>get_tag() -> binary() | undefined</name>
+ <fsummary>Get the user tag set in the process or sent to the process.</fsummary>
+ <desc>
+ <p>This function returns the user tag set in the current
+ process or, if no user tag is present, the last user tag sent
+ to the process together with a message (in the same way as
+ <seealso marker="kernel:seq_trace">sequential trace
+ tokens</seealso> are spread to other processes together with
+ messages. For an explanation of how user tags can be spread
+ together with messages, see <seealso
+ marker="#spread_tag/1">spread_tag/1</seealso>. If no tag is
+ found or dynamic tracing is not available, it returns
+ <c>undefined</c></p>
+ </desc>
+ </func>
+
+ <func>
+ <name>put_tag(Item) -> binary() | undefined </name>
+ <fsummary>Set the user tag of the current process.</fsummary>
+ <type>
+ <v>Item = iodata()</v>
+ </type>
+ <desc>
+ <p>This function sets the user tag of the current process. The user tag is a binary(), but can be specified as any iodata(), which is automatically converted to a binary by this function.</p>
+ <p>The user tag is provided to the user probes triggered by calls top <c>dyntrace:p/{1,2,3,4,5,6,7,8}</c> as well as probes in the efile_driver. In the future, user tags might be added to more probes.</p>
+ <p>The old user tag (if any) is returned, or <c>undefined</c> if no user tag was present or dynamic tracing is not enabled.</p>
+ </desc>
+ </func>
+ <func>
+ <name>spread_tag(boolean()) -> TagData</name>
+ <fsummary>Start or stop spreading dynamic trace user tags with the next message.</fsummary>
+ <type>
+ <v>TagData = opaque data that can be used as parameter to <seealso marker="#restore_tag/1">restore_tag/1</seealso></v>
+ </type>
+ <desc>
+ <p>This function controls if user tags are to be spread to other processes with the next message. Spreading of user tags work like spreading of sequential trace tokens, so that a received user tag will be active in the process until the next message arrives (if that message does not also contain the user tag.</p>
+ <p>This functionality is used when a client process communicates with a file i/o-server to spread the user tag to the I/O-server and then down to the efile_drv driver. By using <c>spread_tag/1</c> and <c>restore_tag/1</c>, one can enable or disable spreading of user tags to other processes and then restore the previous state of the user tag. The TagData returned from this call contains all previous information so the state (including any previously spread user tags) will be completely restored by a later call to <c>restore_tag/1</c>.</p>
+ <p>The <seealso marker="kernel:file">file</seealso> module already spread's tags, so there is noo need to manually call these function to get user tags spread to the efile driver through that module.</p>
+ <p>The most use of this function would be if one for example uses the <seealso marker="stdlib:io">io</seealso> module to communicate with an I/O-server for a regular file, like in the following example:</p>
+<pre>
+f() ->
+ {ok, F} = file:open("test.tst",[write]),
+ Saved = dyntrace:spread_tag(true),
+ io:format(F,"Hello world!",[]),
+ dyntrace:restore_tag(Saved),
+ file:close(F).
+</pre>
+ <p>In this example, any user tag set in the calling process will be spread to the I/O-server when the io:format call is done.</p>
+ </desc>
+ </func>
+ <func>
+ <name>restore_tag(TagData) -> true</name>
+ <fsummary>Restore to a previous state of user tag spreading.</fsummary>
+ <type>
+ <v>TagData = opaque data returned by <seealso marker="#spread_tag/1">spread_tag/1</seealso></v>
+ </type>
+ <desc>
+ <p>Restores the previous state of user tags and their spreading as it was before a call to <seealso marker="#spread_tag/1">spread_tag/1</seealso>. Note that the restoring is not limited to the same process, one can utilize this to turn off spreding in one process and restore it in a newly created, the one that actually is going to send messages:</p>
+<pre>
+f() ->
+ TagData=dyntrace:spread_tag(false),
+ spawn(fun() ->
+ dyntrace:restore_tag(TagData),
+ do_something()
+ end),
+ do_something_else(),
+ dyntrace:restore_tag(TagData).
+</pre>
+ <p>Correctly handling user tags and their spreading might take some effort, as Erlang programs tend to send and receive messages so that sometimes the user tag gets lost due to various things, like double receives or communication with a port (ports do not handle user tags, in the same way as they do not handle regular sequential trace tokens).</p>
+ </desc>
+ </func>
+ </funcs>
+ </erlref>
+
diff --git a/lib/runtime_tools/doc/src/notes.xml b/lib/runtime_tools/doc/src/notes.xml
index ccf11bf0fe..90641719c5 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -31,6 +31,74 @@
<p>This document describes the changes made to the Runtime_Tools
application.</p>
+<section><title>Runtime_Tools 1.8.9</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Change the module-level docs to give complete
+ step-by-step instructions for using the `dyntrace:p()`
+ trace function. (Thanks to Scott Lystig Fritchie)</p>
+ <p>
+ Own Id: OTP-10141</p>
+ </item>
+ <item>
+ <p>
+ Add 1024 separate USDT probes to dyntrace.erl and
+ dyntrace.c (Thanks to Scott Lystig Fritchie)</p>
+ <p>
+ Own Id: OTP-10143</p>
+ </item>
+ <item>
+ <p>
+ Relocate bodies of DTrace probes to the statically-linked
+ VM.</p>
+ <p>
+ Due to various operating systems (in both the DTrace and
+ SystemTap worlds) not fully supporting DTrace probes (or
+ SystemTap-compatibility mode probes) in shared libraries,
+ we relocate those probes to the statically-linked virtual
+ machine. This could be seen as pollution of the pristine
+ VM by a (yet) experimental feature. However:</p>
+ <p>
+ 1. This code can be eliminated completely by the C
+ preprocessor. 2. Leaving the probes in the dyntrace NIF
+ shared library simply does not work correctly on too many
+ platforms. *Many* thanks to Macneil Shonle at Basho for
+ assisting when my RSI-injured fingers gave out. (note:
+ Solaris 10 and FreeBSD 9.0-RELEASE can take a long time
+ to compile)</p>
+ <p>
+ Own Id: OTP-10189</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Runtime_Tools 1.8.8</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ The DTrace source patch from Scott Lystig Fritchie is
+ integrated in the source tree. Using an emulator with
+ dtrace probe is still not supported for production use,
+ but may be a valuable debugging tool. Configure with
+ --with-dynamic-trace=dtrace (or
+ --with-dynamic-trace=systemtap) to create a build with
+ dtrace probes enabled. See runtime_tools for
+ documentation and examples.</p>
+ <p>
+ Own Id: OTP-10017</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Runtime_Tools 1.8.7</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/inviso/doc/src/part.xml b/lib/runtime_tools/doc/src/part.xml
index 08ced28f47..948d4a8020 100644
--- a/lib/inviso/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>2006</year><year>2009</year>
+ <year>2012</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -21,15 +21,22 @@
</legalnotice>
- <title>Inviso User's Guide</title>
- <prepared></prepared>
+ <title>Runtime Tools User's Guide</title>
+ <prepared>Lukas Larsson</prepared>
<docno></docno>
- <date></date>
+ <date>2012-07-18</date>
<rev></rev>
+ <file>part.xml</file>
</header>
+
<description>
- <p><em>Inviso</em>, an Erlang trace tool.</p>
+ <p><em>Runtime Tools</em></p>
</description>
- <xi:include href="inviso_chapter.xml"/>
+
+ <xi:include href="DTRACE.xml"/>
+ <xi:include href="SYSTEMTAP.xml"/>
</part>
+
+
+
diff --git a/lib/runtime_tools/doc/src/ref_man.xml b/lib/runtime_tools/doc/src/ref_man.xml
index 579efcd969..df3446cd17 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>2009</year>
+ <year>1999</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -33,6 +33,7 @@
</description>
<xi:include href="runtime_tools_app.xml"/>
<xi:include href="dbg.xml"/>
+ <xi:include href="dyntrace.xml"/>
<xi:include href="erts_alloc_config.xml"/>
</application>
diff --git a/lib/runtime_tools/examples/dist.d b/lib/runtime_tools/examples/dist.d
new file mode 100644
index 0000000000..7e2d7f0e35
--- /dev/null
+++ b/lib/runtime_tools/examples/dist.d
@@ -0,0 +1,62 @@
+/* example usage: dtrace -q -s /path/to/dist.d */
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+erlang*:::dist-monitor
+{
+ printf("monitor: pid %d, who %s, what %s, node %s, type %s, reason %s\n",
+ pid,
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), copyinstr(arg3),
+ copyinstr(arg4));
+}
+
+erlang*:::dist-port_busy
+{
+ printf("dist port_busy: node %s, port %s, remote_node %s, blocked pid %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), copyinstr(arg3));
+ /*
+ * For variable use advice, see:
+ * http://dtrace.org/blogs/brendan/2011/11/25/dtrace-variable-types/
+ *
+ * Howevever, it's quite possible for the blocked events to span
+ * threads, so we'll use globals.
+ */
+ blocked_procs[copyinstr(arg3)] = timestamp;
+}
+
+erlang*:::dist-output
+{
+ printf("dist output: node %s, port %s, remote_node %s bytes %d\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), arg3);
+}
+
+erlang*:::dist-outputv
+{
+ printf("port outputv: node %s, port %s, remote_node %s bytes %d\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), arg3);
+}
+
+erlang*:::process-scheduled
+/blocked_procs[copyinstr(arg0)]/
+{
+ pidstr = copyinstr(arg0);
+ printf("blocked pid %s scheduled now, waited %d microseconds\n",
+ pidstr, (timestamp - blocked_procs[pidstr]) / 1000);
+ blocked_procs[pidstr] = 0;
+}
diff --git a/lib/runtime_tools/examples/dist.systemtap b/lib/runtime_tools/examples/dist.systemtap
new file mode 100644
index 0000000000..8935e19e28
--- /dev/null
+++ b/lib/runtime_tools/examples/dist.systemtap
@@ -0,0 +1,76 @@
+/* example usage: stap /path/to/dist.systemtap -x <pid> */
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+/*
+ * Note: This file assumes that you're using the non-SMP-enabled Erlang
+ * virtual machine, "beam". The SMP-enabled VM is called "beam.smp".
+ * Note that other variations of the virtual machine also have
+ * different names, e.g. the debug build of the SMP-enabled VM
+ * is "beam.debug.smp".
+ *
+ * To use a different virtual machine, replace each instance of
+ * "beam" with "beam.smp" or the VM name appropriate to your
+ * environment.
+ */
+
+probe process("beam").mark("dist-monitor")
+{
+ printf("monitor: pid %d, who %s, what %s, node %s, type %s, reason %s\n",
+ pid(),
+ user_string($arg1), user_string($arg2), user_string($arg3), user_string($arg4),
+ user_string($arg5));
+}
+
+probe process("beam").mark("dist-port_busy")
+{
+ printf("dist port_busy: node %s, port %s, remote_node %s, blocked pid %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3), user_string($arg4));
+ blocked_procs[user_string($arg4)] = timestamp;
+}
+
+probe process("beam").mark("dist-port_busy")
+{
+ printf("dist port_busy: node %s, port %s, remote_node %s, blocked pid %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3), user_string($arg4));
+ blocked_procs[user_string($arg4)] = timestamp;
+}
+
+probe process("beam").mark("dist-output")
+{
+ printf("dist output: node %s, port %s, remote_node %s bytes %d\n",
+ user_string($arg1), user_string($arg2), user_string($arg3), $arg4);
+}
+
+probe process("beam").mark("dist-outputv")
+{
+ printf("port outputv: node %s, port %s, remote_node %s bytes %d\n",
+ user_string($arg1), user_string($arg2), user_string($arg3), $arg4);
+}
+
+probe process("beam").mark("process-scheduled")
+{
+ pidstr = user_string($arg1);
+ if (pidstr in blocked_procs) {
+ printf("blocked pid %s scheduled now, waited %d microseconds\n",
+ pidstr, (timestamp - blocked_procs[pidstr]) / 1000);
+ delete blocked_procs[pidstr];
+ }
+}
+
+global blocked_procs;
diff --git a/lib/runtime_tools/examples/driver1.d b/lib/runtime_tools/examples/driver1.d
new file mode 100644
index 0000000000..4871a8ee69
--- /dev/null
+++ b/lib/runtime_tools/examples/driver1.d
@@ -0,0 +1,114 @@
+/* example usage: dtrace -q -s /path/to/driver1.d */
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+erlang*:::driver-init
+{
+ printf("driver init name %s major %d minor %d flags %d\n",
+ copyinstr(arg0), arg1, arg2, arg3);
+}
+
+erlang*:::driver-start
+{
+ printf("driver start pid %s driver name %s port %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2));
+}
+
+erlang*:::driver-stop
+{
+ printf("driver stop pid %s driver name %s port %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2));
+}
+
+erlang*:::driver-finish
+{
+ printf("driver finish driver name %s port %s\n",
+ copyinstr(arg0), copyinstr(arg1));
+}
+
+erlang*:::driver-flush
+{
+ printf("driver flush pid %s port %s port name %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2));
+}
+
+erlang*:::driver-output
+{
+ printf("driver output pid %s port %s port name %s bytes %d\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), arg3);
+}
+
+erlang*:::driver-outputv
+{
+ printf("driver outputv pid %s port %s port name %s bytes %d\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), arg3);
+}
+
+erlang*:::driver-control
+{
+ printf("driver control pid %s port %s port name %s command %d bytes %d\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), arg3, arg4);
+}
+
+erlang*:::driver-call
+{
+ printf("driver call pid %s port %s port name %s command %d bytes %d\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), arg3, arg4);
+}
+
+erlang*:::driver-event
+{
+ printf("driver event pid %s port %s port name %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2));
+}
+
+erlang*:::driver-ready_input
+{
+ printf("driver ready_input pid %s port %s port name %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2));
+}
+
+erlang*:::driver-ready_output
+{
+ printf("driver ready_output pid %s port %s port name %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2));
+}
+
+erlang*:::driver-timeout
+{
+ printf("driver timeout pid %s port %s port name %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2));
+}
+
+erlang*:::driver-ready_async
+{
+ printf("driver ready_async pid %s port %s port name %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2));
+}
+
+erlang*:::driver-process_exit
+{
+ printf("driver process_exit pid %s port %s port name %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2));
+}
+
+erlang*:::driver-stop_select
+{
+ printf("driver stop_select driver name %s\n", copyinstr(arg0));
+}
diff --git a/lib/runtime_tools/examples/driver1.systemtap b/lib/runtime_tools/examples/driver1.systemtap
new file mode 100644
index 0000000000..deae82f8fb
--- /dev/null
+++ b/lib/runtime_tools/examples/driver1.systemtap
@@ -0,0 +1,125 @@
+/* example usage: stap /path/to/driver1.systemtap -x <pid> */
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+/*
+ * Note: This file assumes that you're using the non-SMP-enabled Erlang
+ * virtual machine, "beam". The SMP-enabled VM is called "beam.smp".
+ * Note that other variations of the virtual machine also have
+ * different names, e.g. the debug build of the SMP-enabled VM
+ * is "beam.debug.smp".
+ *
+ * To use a different virtual machine, replace each instance of
+ * "beam" with "beam.smp" or the VM name appropriate to your
+ * environment.
+ */
+
+probe process("beam").mark("driver-init")
+{
+ printf("driver init name %s major %d minor %d flags %d\n",
+ user_string($arg1), $arg2, $arg3, $arg4);
+}
+
+probe process("beam").mark("driver-start")
+{
+ printf("driver start pid %s driver name %s port %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3));
+}
+
+probe process("beam").mark("driver-stop")
+{
+ printf("driver stop pid %s driver name %s port %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3));
+}
+
+probe process("beam").mark("driver-finish")
+{
+ printf("driver finish driver name %s\n",
+ user_string($arg1));
+}
+
+probe process("beam").mark("driver-flush")
+{
+ printf("driver flush pid %s port %s port name %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3));
+}
+
+probe process("beam").mark("driver-output")
+{
+ printf("driver output pid %s port %s port name %s bytes %d\n",
+ user_string($arg1), user_string($arg2), user_string($arg3), $arg4);
+}
+
+probe process("beam").mark("driver-outputv")
+{
+ printf("driver outputv pid %s port %s port name %s bytes %d\n",
+ user_string($arg1), user_string($arg2), user_string($arg3), $arg4);
+}
+
+probe process("beam").mark("driver-control")
+{
+ printf("driver control pid %s port %s port name %s command %d bytes %d\n",
+ user_string($arg1), user_string($arg2), user_string($arg3), $arg4, $arg5);
+}
+
+probe process("beam").mark("driver-call")
+{
+ printf("driver call pid %s port %s port name %s command %d bytes %d\n",
+ user_string($arg1), user_string($arg2), user_string($arg3), $arg4, $arg5);
+}
+
+probe process("beam").mark("driver-event")
+{
+ printf("driver event pid %s port %s port name %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3));
+}
+
+probe process("beam").mark("driver-ready_input")
+{
+ printf("driver ready_input pid %s port %s port name %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3));
+}
+
+probe process("beam").mark("driver-ready_output")
+{
+ printf("driver ready_output pid %s port %s port name %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3));
+}
+
+probe process("beam").mark("driver-timeout")
+{
+ printf("driver timeout pid %s port %s port name %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3));
+}
+
+probe process("beam").mark("driver-ready_async")
+{
+ printf("driver ready_async pid %s port %s port name %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3));
+}
+
+probe process("beam").mark("driver-process_exit")
+{
+ printf("driver process_exit pid %s port %s port name %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3));
+}
+
+probe process("beam").mark("driver-stop_select")
+{
+ printf("driver stop_select driver name %s\n", user_string($arg1));
+}
diff --git a/lib/runtime_tools/examples/efile_drv.d b/lib/runtime_tools/examples/efile_drv.d
new file mode 100644
index 0000000000..2442222552
--- /dev/null
+++ b/lib/runtime_tools/examples/efile_drv.d
@@ -0,0 +1,104 @@
+/* example usage: dtrace -q -s /path/to/efile_drv.d */
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+BEGIN
+{
+ op_map[1] = "OPEN";
+ op_map[2] = "READ";
+ op_map[3] = "LSEEK";
+ op_map[4] = "WRITE";
+ op_map[5] = "FSTAT";
+ op_map[6] = "PWD";
+ op_map[7] = "READDIR";
+ op_map[8] = "CHDIR";
+ op_map[9] = "FSYNC";
+ op_map[10] = "MKDIR";
+ op_map[11] = "DELETE";
+ op_map[12] = "RENAME";
+ op_map[13] = "RMDIR";
+ op_map[14] = "TRUNCATE";
+ op_map[15] = "READ_FILE";
+ op_map[16] = "WRITE_INFO";
+ op_map[19] = "LSTAT";
+ op_map[20] = "READLINK";
+ op_map[21] = "LINK";
+ op_map[22] = "SYMLINK";
+ op_map[23] = "CLOSE";
+ op_map[24] = "PWRITEV";
+ op_map[25] = "PREADV";
+ op_map[26] = "SETOPT";
+ op_map[27] = "IPREAD";
+ op_map[28] = "ALTNAME";
+ op_map[29] = "READ_LINE";
+ op_map[30] = "FDATASYNC";
+ op_map[31] = "FADVISE";
+}
+
+erlang*:::aio_pool-add
+{
+ printf("async I/O pool port %s queue len %d\n", copyinstr(arg0), arg1);
+}
+
+erlang*:::aio_pool-get
+{
+ printf("async I/O pool port %s queue len %d\n", copyinstr(arg0), arg1);
+}
+
+erlang*:::efile_drv-entry
+{
+ printf("efile_drv enter tag={%d,%d} %s%s | %s (%d) | args: %s %s , %d %d (port %s)\n",
+ arg0, arg1,
+ arg2 == NULL ? "" : "user tag ",
+ arg2 == NULL ? "" : copyinstr(arg2),
+ op_map[arg3], arg3,
+ arg4 == NULL ? "" : copyinstr(arg4),
+ arg5 == NULL ? "" : copyinstr(arg5), arg6, arg7,
+ /* NOTE: port name in args[10] is experimental */
+ (args[10] == NULL) ?
+ "?" : copyinstr((user_addr_t) args[10]));
+}
+
+erlang*:::efile_drv-int*
+{
+ printf("async I/O worker tag={%d,%d} | %s (%d) | %s\n",
+ arg0, arg1, op_map[arg2], arg2, probename);
+}
+
+/* efile_drv-return error case */
+erlang*:::efile_drv-return
+/arg4 == 0/
+{
+ printf("efile_drv return tag={%d,%d} %s%s | %s (%d) | errno %d\n",
+ arg0, arg1,
+ arg2 == NULL ? "" : "user tag ",
+ arg2 == NULL ? "" : copyinstr(arg2),
+ op_map[arg3], arg3,
+ arg5);
+}
+
+/* efile_drv-return success case */
+erlang*:::efile_drv-return
+/arg4 != 0/
+{
+ printf("efile_drv return tag={%d,%d} %s | %s (%d) ok\n",
+ arg0, arg1,
+ arg2 == NULL ? "" : copyinstr(arg2),
+ op_map[arg3], arg3);
+}
diff --git a/lib/runtime_tools/examples/efile_drv.systemtap b/lib/runtime_tools/examples/efile_drv.systemtap
new file mode 100644
index 0000000000..4b92e67048
--- /dev/null
+++ b/lib/runtime_tools/examples/efile_drv.systemtap
@@ -0,0 +1,112 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+/*
+ * Note: This file assumes that you're using the non-SMP-enabled Erlang
+ * virtual machine, "beam". The SMP-enabled VM is called "beam.smp".
+ * Note that other variations of the virtual machine also have
+ * different names, e.g. the debug build of the SMP-enabled VM
+ * is "beam.debug.smp".
+ *
+ * To use a different virtual machine, replace each instance of
+ * "beam" with "beam.smp" or the VM name appropriate to your
+ * environment.
+ */
+
+probe begin
+{
+ op_map[1] = "OPEN";
+ op_map[2] = "READ";
+ op_map[3] = "LSEEK";
+ op_map[4] = "WRITE";
+ op_map[5] = "FSTAT";
+ op_map[6] = "PWD";
+ op_map[7] = "READDIR";
+ op_map[8] = "CHDIR";
+ op_map[9] = "FSYNC";
+ op_map[10] = "MKDIR";
+ op_map[11] = "DELETE";
+ op_map[12] = "RENAME";
+ op_map[13] = "RMDIR";
+ op_map[14] = "TRUNCATE";
+ op_map[15] = "READ_FILE";
+ op_map[16] = "WRITE_INFO";
+ op_map[19] = "LSTAT";
+ op_map[20] = "READLINK";
+ op_map[21] = "LINK";
+ op_map[22] = "SYMLINK";
+ op_map[23] = "CLOSE";
+ op_map[24] = "PWRITEV";
+ op_map[25] = "PREADV";
+ op_map[26] = "SETOPT";
+ op_map[27] = "IPREAD";
+ op_map[28] = "ALTNAME";
+ op_map[29] = "READ_LINE";
+ op_map[30] = "FDATASYNC";
+ op_map[31] = "FADVISE";
+}
+
+probe process("beam").mark("aio_pool-add")
+{
+ printf("async I/O pool port %s queue len %d\n", user_string($arg1), $arg2);
+}
+
+probe process("beam").mark("aio_pool-get")
+{
+ printf("async I/O pool port %s queue len %d\n", user_string($arg1), $arg2);
+}
+
+probe process("beam").mark("efile_drv-entry")
+{
+ printf("efile_drv enter tag={%d,%d} %s%s | %s (%d) | args: %s %s , %d %d (port %s)\n",
+ $arg1, $arg2,
+ $arg3 == NULL ? "" : "user tag ",
+ $arg3 == NULL ? "" : user_string($arg3),
+ op_map[$arg4], $arg4,
+ $arg5 == NULL ? "" : user_string($arg5),
+ $arg6 == NULL ? "" : user_string($arg6), $arg7, $arg8,
+ /* NOTE: port name in $arg[11] is experimental */
+ user_string($arg11))
+}
+
+probe process("beam").mark("efile_drv-int*")
+{
+ printf("async I/O worker tag={%d,%d} | %s (%d) | %s\n",
+ $arg1, $arg2, op_map[$arg3], $arg3, probefunc());
+}
+
+probe process("beam").mark("efile_drv-return")
+{
+ if ($arg5 == 0) {
+ /* efile_drv-return error case */
+ printf("efile_drv return tag={%d,%d} %s%s | %s (%d) | errno %d\n",
+ $arg1, $arg2,
+ $arg3 == NULL ? "" : "user tag ",
+ $arg3 == NULL ? "" : user_string($arg3),
+ op_map[$arg4], $arg4,
+ $arg6);
+ } else {
+ /* efile_drv-return success case */
+ printf("efile_drv return tag={%d,%d} %s | %s (%d) ok\n",
+ $arg1, $arg2,
+ $arg3 == NULL ? "" : user_string($arg3),
+ op_map[$arg4], $arg4);
+ }
+}
+
+global op_map;
diff --git a/lib/runtime_tools/examples/function-calls.d b/lib/runtime_tools/examples/function-calls.d
new file mode 100644
index 0000000000..ec6090553e
--- /dev/null
+++ b/lib/runtime_tools/examples/function-calls.d
@@ -0,0 +1,57 @@
+/* example usage: dtrace -q -s /path/to/function-calls.d */
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+erlang*:::local-function-entry
+{
+ printf("pid %s enter (local) %s depth %d\n",
+ copyinstr(arg0), copyinstr(arg1), arg2);
+}
+
+erlang*:::global-function-entry
+{
+ printf("pid %s enter (global) %s depth %d\n",
+ copyinstr(arg0), copyinstr(arg1), arg2);
+}
+
+erlang*:::function-return
+{
+ printf("pid %s return %s depth %d\n",
+ copyinstr(arg0), copyinstr(arg1), arg2);
+}
+
+erlang*:::bif-entry
+{
+ printf("pid %s BIF entry mfa %s\n", copyinstr(arg0), copyinstr(arg1));
+}
+
+erlang*:::bif-return
+{
+ printf("pid %s BIF return mfa %s\n", copyinstr(arg0), copyinstr(arg1));
+}
+
+erlang*:::nif-entry
+{
+ printf("pid %s NIF entry mfa %s\n", copyinstr(arg0), copyinstr(arg1));
+}
+
+erlang*:::nif-return
+{
+ printf("pid %s NIF return mfa %s\n", copyinstr(arg0), copyinstr(arg1));
+}
diff --git a/lib/runtime_tools/examples/function-calls.systemtap b/lib/runtime_tools/examples/function-calls.systemtap
new file mode 100644
index 0000000000..4de54cfb5a
--- /dev/null
+++ b/lib/runtime_tools/examples/function-calls.systemtap
@@ -0,0 +1,67 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+/*
+ * Note: This file assumes that you're using the non-SMP-enabled Erlang
+ * virtual machine, "beam". The SMP-enabled VM is called "beam.smp".
+ * Note that other variations of the virtual machine also have
+ * different names, e.g. the debug build of the SMP-enabled VM
+ * is "beam.debug.smp".
+ *
+ * To use a different virtual machine, replace each instance of
+ * "beam" with "beam.smp" or the VM name appropriate to your
+ * environment.
+ */
+
+probe process("beam").mark("local-function-entry")
+{
+ printf("pid %s enter (local) %s depth %d\n",
+ user_string($arg1), user_string($arg2), $arg3);
+}
+
+probe process("beam").mark("global-function-entry")
+{
+ printf("pid %s enter (global) %s depth %d\n",
+ user_string($arg1), user_string($arg2), $arg3);
+}
+
+probe process("beam").mark("function-return")
+{
+ printf("pid %s return %s depth %d\n",
+ user_string($arg1), user_string($arg2), $arg3);
+}
+
+probe process("beam").mark("bif-entry")
+{
+ printf("pid %s BIF entry mfa %s\n", user_string($arg1), user_string($arg2));
+}
+
+probe process("beam").mark("bif-return")
+{
+ printf("pid %s BIF return mfa %s\n", user_string($arg1), user_string($arg2));
+}
+
+probe process("beam").mark("nif-entry")
+{
+ printf("pid %s NIF entry mfa %s\n", user_string($arg1), user_string($arg2));
+}
+
+probe process("beam").mark("nif-return")
+{
+ printf("pid %s NIF return mfa %s\n", user_string($arg1), user_string($arg2));
+}
diff --git a/lib/runtime_tools/examples/garbage-collection.d b/lib/runtime_tools/examples/garbage-collection.d
new file mode 100644
index 0000000000..ebc40a19ec
--- /dev/null
+++ b/lib/runtime_tools/examples/garbage-collection.d
@@ -0,0 +1,39 @@
+/* example usage: dtrace -q -s /path/to/garbage-collection.d */
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+erlang*:::gc_major-start
+{
+ printf("GC major start pid %s need %d words\n", copyinstr(arg0), arg1);
+}
+
+erlang*:::gc_minor-start
+{
+ printf("GC minor start pid %s need %d words\n", copyinstr(arg0), arg1);
+}
+
+erlang*:::gc_major-end
+{
+ printf("GC major end pid %s reclaimed %d words\n", copyinstr(arg0), arg1);
+}
+
+erlang*:::gc_minor-start
+{
+ printf("GC minor end pid %s reclaimed %d words\n", copyinstr(arg0), arg1);
+}
diff --git a/lib/runtime_tools/examples/garbage-collection.systemtap b/lib/runtime_tools/examples/garbage-collection.systemtap
new file mode 100644
index 0000000000..81e9d38196
--- /dev/null
+++ b/lib/runtime_tools/examples/garbage-collection.systemtap
@@ -0,0 +1,49 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+/*
+ * Note: This file assumes that you're using the non-SMP-enabled Erlang
+ * virtual machine, "beam". The SMP-enabled VM is called "beam.smp".
+ * Note that other variations of the virtual machine also have
+ * different names, e.g. the debug build of the SMP-enabled VM
+ * is "beam.debug.smp".
+ *
+ * To use a different virtual machine, replace each instance of
+ * "beam" with "beam.smp" or the VM name appropriate to your
+ * environment.
+ */
+
+probe process("beam").mark("gc_major-start")
+{
+ printf("GC major start pid %s need %d words\n", user_string($arg1), $arg2);
+}
+
+probe process("beam").mark("gc_minor-start")
+{
+ printf("GC minor start pid %s need %d words\n", user_string($arg1), $arg2);
+}
+
+probe process("beam").mark("gc_major-end")
+{
+ printf("GC major end pid %s reclaimed %d words\n", user_string($arg1), $arg2);
+}
+
+probe process("beam").mark("gc_minor-start")
+{
+ printf("GC minor end pid %s reclaimed %d words\n", user_string($arg1), $arg2);
+}
diff --git a/lib/runtime_tools/examples/memory1.d b/lib/runtime_tools/examples/memory1.d
new file mode 100644
index 0000000000..b222aeae62
--- /dev/null
+++ b/lib/runtime_tools/examples/memory1.d
@@ -0,0 +1,41 @@
+/* example usage: dtrace -q -s /path/to/memory1.d */
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+erlang*:::copy-struct
+{
+ printf("copy_struct %d bytes\n", arg0);
+}
+
+erlang*:::copy-object
+{
+ printf("copy_object pid %s %d bytes\n", copyinstr(arg0), arg1);
+}
+
+erlang*:::process-heap_grow
+{
+ printf("proc heap grow pid %s %d -> %d bytes\n", copyinstr(arg0),
+ arg1, arg2);
+}
+
+erlang*:::process-heap_shrink
+{
+ printf("proc heap shrink pid %s %d -> %d bytes\n", copyinstr(arg0),
+ arg1, arg2);
+}
diff --git a/lib/runtime_tools/examples/memory1.systemtap b/lib/runtime_tools/examples/memory1.systemtap
new file mode 100644
index 0000000000..9374b97d18
--- /dev/null
+++ b/lib/runtime_tools/examples/memory1.systemtap
@@ -0,0 +1,51 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+/*
+ * Note: This file assumes that you're using the non-SMP-enabled Erlang
+ * virtual machine, "beam". The SMP-enabled VM is called "beam.smp".
+ * Note that other variations of the virtual machine also have
+ * different names, e.g. the debug build of the SMP-enabled VM
+ * is "beam.debug.smp".
+ *
+ * To use a different virtual machine, replace each instance of
+ * "beam" with "beam.smp" or the VM name appropriate to your
+ * environment.
+ */
+
+probe process("beam").mark("copy-struct")
+{
+ printf("copy_struct %d bytes\n", $arg1);
+}
+
+probe process("beam").mark("copy-object")
+{
+ printf("copy_object pid %s %d bytes\n", user_string($arg1), $arg2);
+}
+
+probe process("beam").mark("process-heap_grow")
+{
+ printf("proc heap grow pid %s %d -> %d bytes\n", user_string($arg1),
+ $arg2, $arg3);
+}
+
+probe process("beam").mark("process-heap_shrink")
+{
+ printf("proc heap shrink pid %s %d -> %d bytes\n", user_string($arg1),
+ $arg2, $arg3);
+}
diff --git a/lib/runtime_tools/examples/messages.d b/lib/runtime_tools/examples/messages.d
new file mode 100644
index 0000000000..08cf52f3d2
--- /dev/null
+++ b/lib/runtime_tools/examples/messages.d
@@ -0,0 +1,94 @@
+/* example usage: dtrace -q -s /path/to/messages.d */
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+BEGIN
+{
+ printf("\n");
+ printf("NOTE: message-queue message size 4294967295 means an external\n");
+ printf(" message that the code isn't smart enough to determine\n");
+ printf(" the actual size.\n");
+ printf("\n");
+}
+
+erlang*:::message-send
+/arg3 == 0 && arg4 == 0 && arg5 == 0/
+{
+ printf("send: %s -> %s: %d words\n",
+ copyinstr(arg0), copyinstr(arg1), arg2);
+}
+
+erlang*:::message-send
+/arg3 != 0 || arg4 != 0 || arg5 != 0/
+{
+ printf("send: %s label %d token {%d,%d} -> %s: %d words\n",
+ copyinstr(arg0),
+ arg3, arg4, arg5,
+ copyinstr(arg1), arg2);
+}
+
+/*
+ * TODO:
+ * Weird, on my OS X box, beam says arg6 = 0 but this script says 4294967296.
+ */
+
+erlang*:::message-send-remote
+/arg4 == 0 && arg5 == 0 && (arg6 == 0 || arg6 >= 4294967296)/
+{
+ printf("send : %s -> %s %s: %d words\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), arg3);
+}
+
+erlang*:::message-send-remote
+/arg4 != 0 || arg5 != 0 || arg6 < 4294967296/
+{
+ printf("send : %s label %d token {%d,%d} -> %s %s: %d words\n",
+ copyinstr(arg0),
+ arg4, arg5, arg6,
+ copyinstr(arg1), copyinstr(arg2), arg3);
+}
+
+erlang*:::message-queued
+/arg3 == 0 && arg4 == 0 && arg5 == 0/
+{
+ printf("queued: %s: %d words, queue len %d\n", copyinstr(arg0), arg1, arg2);
+}
+
+erlang*:::message-queued
+/arg3 != 0 || arg4 != 0 || arg5 != 0/
+{
+ printf("queued: %s label %d token {%d,%d}: %d words, queue len %d\n",
+ copyinstr(arg0), arg3, arg4, arg5,
+ arg1, arg2);
+}
+
+erlang*:::message-receive
+/arg3 == 0 && arg4 == 0 && arg5 == 0/
+{
+ printf("receive: %s: %d words, queue len %d\n",
+ copyinstr(arg0), arg1, arg2);
+}
+
+erlang*:::message-receive
+/arg3 != 0 || arg4 != 0 || arg5 != 0/
+{
+ printf("receive: %s label %d token {%d,%d}: %d words, queue len %d\n",
+ copyinstr(arg0), arg3, arg4, arg5,
+ arg1, arg2);
+}
diff --git a/lib/runtime_tools/examples/messages.systemtap b/lib/runtime_tools/examples/messages.systemtap
new file mode 100644
index 0000000000..c58e1168f9
--- /dev/null
+++ b/lib/runtime_tools/examples/messages.systemtap
@@ -0,0 +1,87 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+/*
+ * Note: This file assumes that you're using the non-SMP-enabled Erlang
+ * virtual machine, "beam". The SMP-enabled VM is called "beam.smp".
+ * Note that other variations of the virtual machine also have
+ * different names, e.g. the debug build of the SMP-enabled VM
+ * is "beam.debug.smp".
+ *
+ * To use a different virtual machine, replace each instance of
+ * "beam" with "beam.smp" or the VM name appropriate to your
+ * environment.
+ */
+
+probe begin
+{
+ printf("\n");
+ printf("NOTE: message-queue message size 4294967295 means an external\n");
+ printf(" message that the code isn't smart enough to determine\n");
+ printf(" the actual size.\n");
+ printf("\n");
+}
+
+probe process("beam").mark("message-send")
+{
+ if ($arg4 == 0 && $arg5 == 0 && $arg6 == 0) {
+ printf("send: %s -> %s: %d words\n",
+ user_string($arg1), user_string($arg2), $arg3);
+ } else {
+ printf("send: %s label %d token {%d,%d} -> %s: %d words\n",
+ user_string($arg1),
+ $arg4, $arg5, $arg6,
+ user_string($arg2), $arg3);
+ }
+}
+
+probe process("beam").mark("message-send-remote")
+{
+ if ($arg5 == 0 && $arg6 == 0 && $arg7 == 0) {
+ printf("send : %s -> %s %s: %d words\n",
+ user_string($arg1), user_string($arg2), user_string($arg3), $arg4);
+ } else {
+ printf("send : %s label %d token {%d,%d} -> %s %s: %d words\n",
+ user_string($arg1),
+ $arg5, $arg6, $arg7,
+ user_string($arg2), user_string($arg3), $arg4);
+ }
+}
+
+probe process("beam").mark("message-queued")
+{
+ if ($arg4 == 0 && $arg5 == 0 && $arg6 == 0) {
+ printf("queued: %s: %d words, queue len %d\n", user_string($arg1), $arg2, $arg3);
+ } else {
+ printf("queued: %s label %d token {%d,%d}: %d words, queue len %d\n",
+ user_string($arg1), $arg4, $arg5, $arg6,
+ $arg2, $arg3);
+ }
+}
+
+probe process("beam").mark("message-receive")
+{
+ if ($arg4 == 0 && $arg5 == 0 && $arg6 == 0) {
+ printf("receive: %s: %d words, queue len %d\n",
+ user_string($arg1), $arg2, $arg3);
+ } else {
+ printf("receive: %s label %d token {%d,%d}: %d words, queue len %d\n",
+ user_string($arg1), $arg4, $arg5, $arg6,
+ $arg2, $arg3);
+ }
+}
diff --git a/lib/runtime_tools/examples/port1.d b/lib/runtime_tools/examples/port1.d
new file mode 100644
index 0000000000..1e3bd3d8a9
--- /dev/null
+++ b/lib/runtime_tools/examples/port1.d
@@ -0,0 +1,142 @@
+/* example usage: dtrace -q -s /path/to/port1.d */
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+BEGIN
+{
+ driver_map["tcp_inet", 1] = "OPEN";
+ driver_map["tcp_inet", 2] = "CLOSE";
+ driver_map["tcp_inet", 3] = "CONNECT";
+ driver_map["tcp_inet", 4] = "PEER";
+ driver_map["tcp_inet", 5] = "NAME";
+ driver_map["tcp_inet", 6] = "BIND";
+ driver_map["tcp_inet", 7] = "SETOPTS";
+ driver_map["tcp_inet", 8] = "GETOPTS";
+ driver_map["tcp_inet", 11] = "GETSTAT";
+ driver_map["tcp_inet", 12] = "GETHOSTNAME";
+ driver_map["tcp_inet", 13] = "FDOPEN";
+ driver_map["tcp_inet", 14] = "GETFD";
+ driver_map["tcp_inet", 15] = "GETTYPE";
+ driver_map["tcp_inet", 16] = "GETSTATUS";
+ driver_map["tcp_inet", 17] = "GETSERVBYNAME";
+ driver_map["tcp_inet", 18] = "GETSERVBYPORT";
+ driver_map["tcp_inet", 19] = "SETNAME";
+ driver_map["tcp_inet", 20] = "SETPEER";
+ driver_map["tcp_inet", 21] = "GETIFLIST";
+ driver_map["tcp_inet", 22] = "IFGET";
+ driver_map["tcp_inet", 23] = "IFSET";
+ driver_map["tcp_inet", 24] = "SUBSCRIBE";
+ driver_map["tcp_inet", 25] = "GETIFADDRS";
+ driver_map["tcp_inet", 40] = "ACCEPT";
+ driver_map["tcp_inet", 41] = "LISTEN";
+ driver_map["tcp_inet", 42] = "RECV";
+ driver_map["tcp_inet", 43] = "UNRECV";
+ driver_map["tcp_inet", 44] = "SHUTDOWN";
+ driver_map["tcp_inet", 60] = "RECV";
+ driver_map["tcp_inet", 61] = "LISTEN";
+ driver_map["tcp_inet", 62] = "BINDX";
+ /* No looping constructs, so repeat for udp_inet */
+ driver_map["udp_inet", 1] = "OPEN";
+ driver_map["udp_inet", 2] = "CLOSE";
+ driver_map["udp_inet", 3] = "CONNECT";
+ driver_map["udp_inet", 4] = "PEER";
+ driver_map["udp_inet", 5] = "NAME";
+ driver_map["udp_inet", 6] = "BIND";
+ driver_map["udp_inet", 7] = "SETOPTS";
+ driver_map["udp_inet", 8] = "GETOPTS";
+ driver_map["udp_inet", 11] = "GETSTAT";
+ driver_map["udp_inet", 12] = "GETHOSTNAME";
+ driver_map["udp_inet", 13] = "FDOPEN";
+ driver_map["udp_inet", 14] = "GETFD";
+ driver_map["udp_inet", 15] = "GETTYPE";
+ driver_map["udp_inet", 16] = "GETSTATUS";
+ driver_map["udp_inet", 17] = "GETSERVBYNAME";
+ driver_map["udp_inet", 18] = "GETSERVBYPORT";
+ driver_map["udp_inet", 19] = "SETNAME";
+ driver_map["udp_inet", 20] = "SETPEER";
+ driver_map["udp_inet", 21] = "GETIFLIST";
+ driver_map["udp_inet", 22] = "IFGET";
+ driver_map["udp_inet", 23] = "IFSET";
+ driver_map["udp_inet", 24] = "SUBSCRIBE";
+ driver_map["udp_inet", 25] = "GETIFADDRS";
+ driver_map["udp_inet", 40] = "ACCEPT";
+ driver_map["udp_inet", 41] = "LISTEN";
+ driver_map["udp_inet", 42] = "RECV";
+ driver_map["udp_inet", 43] = "UNRECV";
+ driver_map["udp_inet", 44] = "SHUTDOWN";
+ driver_map["udp_inet", 60] = "RECV";
+ driver_map["udp_inet", 61] = "LISTEN";
+ driver_map["udp_inet", 62] = "BINDX";
+}
+
+erlang*:::port-open
+{
+ printf("port open pid %s port name %s port %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2));
+}
+
+erlang*:::port-command
+{
+ printf("port command pid %s port %s port name %s command type %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), copyinstr(arg3));
+}
+
+erlang*:::port-control
+{
+ /* http://dtrace.org/blogs/brendan/2011/11/25/dtrace-variable-types/ */
+ this->cmd = driver_map[copyinstr(arg2), arg3];
+ this->cmd_str = (this->cmd == 0) ? "unknown" : this->cmd;
+ printf("port control pid %s port %s port name %s command %d %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), arg3,
+ this->cmd_str);
+}
+
+/* port-exit is fired as a result of port_close() or exit signal */
+
+erlang*:::port-exit
+{
+ printf("port exit pid %s port %s port name %s reason %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), copyinstr(arg3));
+}
+
+erlang*:::port-connect
+{
+ printf("port connect pid %s port %s port name %s new pid %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), copyinstr(arg3));
+}
+
+erlang*:::port-busy
+{
+ printf("port busy %s\n", copyinstr(arg0));
+}
+
+erlang*:::port-not_busy
+{
+ printf("port not busy %s\n", copyinstr(arg0));
+}
+
+erlang*:::aio_pool-add
+{
+ printf("async I/O pool add thread %d queue len %d\n", arg0, arg1);
+}
+
+erlang*:::aio_pool-get
+{
+ printf("async I/O pool get thread %d queue len %d\n", arg0, arg1);
+}
diff --git a/lib/runtime_tools/examples/port1.systemtap b/lib/runtime_tools/examples/port1.systemtap
new file mode 100644
index 0000000000..c8af240d85
--- /dev/null
+++ b/lib/runtime_tools/examples/port1.systemtap
@@ -0,0 +1,152 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+/*
+ * Note: This file assumes that you're using the non-SMP-enabled Erlang
+ * virtual machine, "beam". The SMP-enabled VM is called "beam.smp".
+ * Note that other variations of the virtual machine also have
+ * different names, e.g. the debug build of the SMP-enabled VM
+ * is "beam.debug.smp".
+ *
+ * To use a different virtual machine, replace each instance of
+ * "beam" with "beam.smp" or the VM name appropriate to your
+ * environment.
+ */
+
+probe begin
+{
+ driver_map["tcp_inet", 1] = "OPEN";
+ driver_map["tcp_inet", 2] = "CLOSE";
+ driver_map["tcp_inet", 3] = "CONNECT";
+ driver_map["tcp_inet", 4] = "PEER";
+ driver_map["tcp_inet", 5] = "NAME";
+ driver_map["tcp_inet", 6] = "BIND";
+ driver_map["tcp_inet", 7] = "SETOPTS";
+ driver_map["tcp_inet", 8] = "GETOPTS";
+ driver_map["tcp_inet", 11] = "GETSTAT";
+ driver_map["tcp_inet", 12] = "GETHOSTNAME";
+ driver_map["tcp_inet", 13] = "FDOPEN";
+ driver_map["tcp_inet", 14] = "GETFD";
+ driver_map["tcp_inet", 15] = "GETTYPE";
+ driver_map["tcp_inet", 16] = "GETSTATUS";
+ driver_map["tcp_inet", 17] = "GETSERVBYNAME";
+ driver_map["tcp_inet", 18] = "GETSERVBYPORT";
+ driver_map["tcp_inet", 19] = "SETNAME";
+ driver_map["tcp_inet", 20] = "SETPEER";
+ driver_map["tcp_inet", 21] = "GETIFLIST";
+ driver_map["tcp_inet", 22] = "IFGET";
+ driver_map["tcp_inet", 23] = "IFSET";
+ driver_map["tcp_inet", 24] = "SUBSCRIBE";
+ driver_map["tcp_inet", 25] = "GETIFADDRS";
+ driver_map["tcp_inet", 40] = "ACCEPT";
+ driver_map["tcp_inet", 41] = "LISTEN";
+ driver_map["tcp_inet", 42] = "RECV";
+ driver_map["tcp_inet", 43] = "UNRECV";
+ driver_map["tcp_inet", 44] = "SHUTDOWN";
+ driver_map["tcp_inet", 60] = "RECV";
+ driver_map["tcp_inet", 61] = "LISTEN";
+ driver_map["tcp_inet", 62] = "BINDX";
+ /* No looping constructs, so repeat for udp_inet */
+ driver_map["udp_inet", 1] = "OPEN";
+ driver_map["udp_inet", 2] = "CLOSE";
+ driver_map["udp_inet", 3] = "CONNECT";
+ driver_map["udp_inet", 4] = "PEER";
+ driver_map["udp_inet", 5] = "NAME";
+ driver_map["udp_inet", 6] = "BIND";
+ driver_map["udp_inet", 7] = "SETOPTS";
+ driver_map["udp_inet", 8] = "GETOPTS";
+ driver_map["udp_inet", 11] = "GETSTAT";
+ driver_map["udp_inet", 12] = "GETHOSTNAME";
+ driver_map["udp_inet", 13] = "FDOPEN";
+ driver_map["udp_inet", 14] = "GETFD";
+ driver_map["udp_inet", 15] = "GETTYPE";
+ driver_map["udp_inet", 16] = "GETSTATUS";
+ driver_map["udp_inet", 17] = "GETSERVBYNAME";
+ driver_map["udp_inet", 18] = "GETSERVBYPORT";
+ driver_map["udp_inet", 19] = "SETNAME";
+ driver_map["udp_inet", 20] = "SETPEER";
+ driver_map["udp_inet", 21] = "GETIFLIST";
+ driver_map["udp_inet", 22] = "IFGET";
+ driver_map["udp_inet", 23] = "IFSET";
+ driver_map["udp_inet", 24] = "SUBSCRIBE";
+ driver_map["udp_inet", 25] = "GETIFADDRS";
+ driver_map["udp_inet", 40] = "ACCEPT";
+ driver_map["udp_inet", 41] = "LISTEN";
+ driver_map["udp_inet", 42] = "RECV";
+ driver_map["udp_inet", 43] = "UNRECV";
+ driver_map["udp_inet", 44] = "SHUTDOWN";
+ driver_map["udp_inet", 60] = "RECV";
+ driver_map["udp_inet", 61] = "LISTEN";
+ driver_map["udp_inet", 62] = "BINDX";
+}
+
+probe process("beam").mark("port-open")
+{
+ printf("port open pid %s port name %s port %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3));
+}
+
+probe process("beam").mark("port-command")
+{
+ printf("port command pid %s port %s port name %s command type %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3), user_string($arg4));
+}
+
+probe process("beam").mark("port-control")
+{
+ cmd = driver_map[user_string($arg3), $arg4];
+ cmd_str = (cmd == "") ? "unknown" : cmd;
+ printf("port control pid %s port %s port name %s command %d %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3), $arg4, cmd_str);
+}
+
+/* port-exit is fired as a result of port_close() or exit signal */
+
+probe process("beam").mark("port-exit")
+{
+ printf("port exit pid %s port %s port name %s reason %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3), user_string($arg4));
+}
+
+probe process("beam").mark("port-connect")
+{
+ printf("port connect pid %s port %s port name %s new pid %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3), user_string($arg4));
+}
+
+probe process("beam").mark("port-busy")
+{
+ printf("port busy %s\n", user_string($arg1));
+}
+
+probe process("beam").mark("port-not_busy")
+{
+ printf("port not busy %s\n", user_string($arg1));
+}
+
+probe process("beam").mark("aio_pool-add")
+{
+ printf("async I/O pool add thread %d queue len %d\n", $arg1, $arg2);
+}
+
+probe process("beam").mark("aio_pool-get")
+{
+ printf("async I/O pool get thread %d queue len %d\n", $arg1, $arg2);
+}
+
+global driver_map; \ No newline at end of file
diff --git a/erts/emulator/sys/vxworks/driver_int.h b/lib/runtime_tools/examples/process-scheduling.d
index f6bc71a799..6408d7d5f2 100644
--- a/erts/emulator/sys/vxworks/driver_int.h
+++ b/lib/runtime_tools/examples/process-scheduling.d
@@ -1,30 +1,35 @@
+/* example usage: dtrace -q -s /path/to/process-scheduling.d */
/*
* %CopyrightBegin%
- *
- * Copyright Ericsson AB 1997-2009. All Rights Reserved.
- *
+ *
+ * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ *
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
* compliance with the License. You should have received a copy of the
* Erlang Public License along with this software. If not, it can be
* retrieved online at http://www.erlang.org/.
- *
+ *
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
- *
+ *
* %CopyrightEnd%
*/
-/*----------------------------------------------------------------------
-** Purpose : System dependant driver declarations
-**---------------------------------------------------------------------- */
-#ifndef __DRIVER_INT_H__
-#define __DRIVER_INT_H__
+erlang*:::process-scheduled
+{
+ printf(" Schedule pid %s mfa %s\n", copyinstr(arg0), copyinstr(arg1));
+}
-#include <ioLib.h>
+erlang*:::process-unscheduled
+{
+ printf("Unschedule pid %s\n", copyinstr(arg0));
+}
-typedef struct iovec SysIOVec;
-
-#endif
+erlang*:::process-hibernate
+{
+ printf(" Hibernate pid %s resume mfa %s\n",
+ copyinstr(arg0), copyinstr(arg1));
+}
diff --git a/lib/runtime_tools/examples/process-scheduling.systemtap b/lib/runtime_tools/examples/process-scheduling.systemtap
new file mode 100644
index 0000000000..4cc3ef555c
--- /dev/null
+++ b/lib/runtime_tools/examples/process-scheduling.systemtap
@@ -0,0 +1,45 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+/*
+ * Note: This file assumes that you're using the non-SMP-enabled Erlang
+ * virtual machine, "beam". The SMP-enabled VM is called "beam.smp".
+ * Note that other variations of the virtual machine also have
+ * different names, e.g. the debug build of the SMP-enabled VM
+ * is "beam.debug.smp".
+ *
+ * To use a different virtual machine, replace each instance of
+ * "beam" with "beam.smp" or the VM name appropriate to your
+ * environment.
+ */
+
+probe process("beam").mark("process-scheduled")
+{
+ printf(" Schedule pid %s mfa %s\n", user_string($arg1), user_string($arg2));
+}
+
+probe process("beam").mark("process-unscheduled")
+{
+ printf("Unschedule pid %s\n", user_string($arg1));
+}
+
+probe process("beam").mark("process-hibernate")
+{
+ printf(" Hibernate pid %s resume mfa %s\n",
+ user_string($arg1), user_string($arg2));
+}
diff --git a/lib/runtime_tools/examples/spawn-exit.d b/lib/runtime_tools/examples/spawn-exit.d
new file mode 100644
index 0000000000..ae690b819a
--- /dev/null
+++ b/lib/runtime_tools/examples/spawn-exit.d
@@ -0,0 +1,41 @@
+/* example usage: dtrace -q -s /path/to/spawn-exit.d */
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+erlang*:::process-spawn
+{
+ printf("pid %s mfa %s\n", copyinstr(arg0), copyinstr(arg1));
+}
+
+erlang*:::process-exit
+{
+ printf("pid %s reason %s\n", copyinstr(arg0), copyinstr(arg1));
+}
+
+erlang*:::process-exit_signal
+{
+ printf("sender %s -> pid %s reason %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2));
+}
+
+erlang*:::process-exit_signal-remote
+{
+ printf("sender %s -> node %s pid %s reason %s\n",
+ copyinstr(arg0), copyinstr(arg1), copyinstr(arg2), copyinstr(arg3));
+}
diff --git a/lib/runtime_tools/examples/spawn-exit.systemtap b/lib/runtime_tools/examples/spawn-exit.systemtap
new file mode 100644
index 0000000000..4b69e4aea6
--- /dev/null
+++ b/lib/runtime_tools/examples/spawn-exit.systemtap
@@ -0,0 +1,51 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+/*
+ * Note: This file assumes that you're using the non-SMP-enabled Erlang
+ * virtual machine, "beam". The SMP-enabled VM is called "beam.smp".
+ * Note that other variations of the virtual machine also have
+ * different names, e.g. the debug build of the SMP-enabled VM
+ * is "beam.debug.smp".
+ *
+ * To use a different virtual machine, replace each instance of
+ * "beam" with "beam.smp" or the VM name appropriate to your
+ * environment.
+ */
+
+probe process("beam").mark("process-spawn")
+{
+ printf("pid %s mfa %s\n", user_string($arg1), user_string($arg2));
+}
+
+probe process("beam").mark("process-exit")
+{
+ printf("pid %s reason %s\n", user_string($arg1), user_string($arg2));
+}
+
+probe process("beam").mark("process-exit_signal")
+{
+ printf("sender %s -> pid %s reason %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3));
+}
+
+probe process("beam").mark("process-exit_signal-remote")
+{
+ printf("sender %s -> node %s pid %s reason %s\n",
+ user_string($arg1), user_string($arg2), user_string($arg3), user_string($arg4));
+}
diff --git a/lib/runtime_tools/examples/user-probe-n.d b/lib/runtime_tools/examples/user-probe-n.d
new file mode 100644
index 0000000000..06a3e5c9b9
--- /dev/null
+++ b/lib/runtime_tools/examples/user-probe-n.d
@@ -0,0 +1,44 @@
+/* example usage: dtrace -q -s /path/to/user-probe.d */
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+erlang*:::user_trace-n0
+{
+ printf("probe n0: %s %s %d %d %d %d '%s' '%s' '%s' '%s'\n",
+ copyinstr(arg0),
+ arg1 == NULL ? "" : copyinstr(arg1),
+ arg2, arg3, arg4, arg5,
+ arg6 == NULL ? "" : copyinstr(arg6),
+ arg7 == NULL ? "" : copyinstr(arg7),
+ arg8 == NULL ? "" : copyinstr(arg8),
+ arg9 == NULL ? "" : copyinstr(arg9));
+}
+
+erlang*:::user_trace-n1
+{
+ printf("probe n1: %s %s %d %d %d %d '%s' '%s' '%s' '%s'\n",
+ copyinstr(arg0),
+ arg1 == NULL ? "" : copyinstr(arg1),
+ arg2, arg3, arg4, arg5,
+ arg6 == NULL ? "" : copyinstr(arg6),
+ arg7 == NULL ? "" : copyinstr(arg7),
+ arg8 == NULL ? "" : copyinstr(arg8),
+ arg9 == NULL ? "" : copyinstr(arg9));
+}
+
diff --git a/lib/runtime_tools/examples/user-probe-n.systemtap b/lib/runtime_tools/examples/user-probe-n.systemtap
new file mode 100644
index 0000000000..6aa415bb67
--- /dev/null
+++ b/lib/runtime_tools/examples/user-probe-n.systemtap
@@ -0,0 +1,53 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+/*
+ * Note: This file assumes that you're using the non-SMP-enabled Erlang
+ * virtual machine, "beam". The SMP-enabled VM is called "beam.smp".
+ * Note that other variations of the virtual machine also have
+ * different names, e.g. the debug build of the SMP-enabled VM
+ * is "beam.debug.smp".
+ *
+ * To use a different virtual machine, replace each instance of
+ * "beam" with "beam.smp" or the VM name appropriate to your
+ * environment.
+ */
+
+probe process("beam").mark("user_trace-n0")
+{
+ printf("probe n0: %s %s %d %d %d %d '%s' '%s' '%s' '%s'\n",
+ user_string($arg1),
+ $arg2 == NULL ? "" : user_string($arg2),
+ $arg3, $arg4, $arg5, $arg6,
+ $arg7 == NULL ? "" : user_string($arg7),
+ $arg8 == NULL ? "" : user_string($arg8),
+ $arg9 == NULL ? "" : user_string($arg9),
+ $arg9 == NULL ? "" : user_string($arg9));
+}
+
+probe process("beam").mark("user_trace-n1")
+{
+ printf("probe n1: %s %s %d %d %d %d '%s' '%s' '%s' '%s'\n",
+ user_string($arg1),
+ $arg2 == NULL ? "" : user_string($arg2),
+ $arg3, $arg4, $arg5, $arg6,
+ $arg7 == NULL ? "" : user_string($arg7),
+ $arg8 == NULL ? "" : user_string($arg8),
+ $arg9 == NULL ? "" : user_string($arg9),
+ $arg9 == NULL ? "" : user_string($arg9));
+}
diff --git a/lib/runtime_tools/examples/user-probe.d b/lib/runtime_tools/examples/user-probe.d
new file mode 100644
index 0000000000..5cb5d61a76
--- /dev/null
+++ b/lib/runtime_tools/examples/user-probe.d
@@ -0,0 +1,36 @@
+/* example usage: dtrace -q -s /path/to/user-probe.d */
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+
+erlang*:::user_trace-s1
+{
+ printf("%s\n", copyinstr(arg0));
+}
+
+erlang*:::user_trace-i4s4
+{
+ printf("%s %s %d %d %d %d '%s' '%s' '%s' '%s'\n",
+ copyinstr(arg0),
+ arg1 == NULL ? "" : copyinstr(arg1),
+ arg2, arg3, arg4, arg5,
+ arg6 == NULL ? "" : copyinstr(arg6),
+ arg7 == NULL ? "" : copyinstr(arg7),
+ arg8 == NULL ? "" : copyinstr(arg8),
+ arg9 == NULL ? "" : copyinstr(arg9));
+}
diff --git a/lib/runtime_tools/examples/user-probe.systemtap b/lib/runtime_tools/examples/user-probe.systemtap
new file mode 100644
index 0000000000..0482235324
--- /dev/null
+++ b/lib/runtime_tools/examples/user-probe.systemtap
@@ -0,0 +1,46 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Scott Lystig Fritchie and Andreas Schultz, 2011-2012. All Rights Reserved.
+ *
+ * The contents of this file are subject to the Erlang Public License,
+ * Version 1.1, (the "License"); you may not use this file except in
+ * compliance with the License. You should have received a copy of the
+ * Erlang Public License along with this software. If not, it can be
+ * retrieved online at http://www.erlang.org/.
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ * the License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * %CopyrightEnd%
+ */
+/*
+ * Note: This file assumes that you're using the non-SMP-enabled Erlang
+ * virtual machine, "beam". The SMP-enabled VM is called "beam.smp".
+ * Note that other variations of the virtual machine also have
+ * different names, e.g. the debug build of the SMP-enabled VM
+ * is "beam.debug.smp".
+ *
+ * To use a different virtual machine, replace each instance of
+ * "beam" with "beam.smp" or the VM name appropriate to your
+ * environment.
+ */
+
+probe process("beam").mark("user_trace-s1")
+{
+ printf("%s\n", user_string($arg1));
+}
+
+probe process("beam").mark("user_trace-i4s4")
+{
+ printf("%s %s %d %d %d %d '%s' '%s' '%s' '%s'\n",
+ user_string($arg1),
+ $arg2 == NULL ? "" : user_string($arg2),
+ $arg3, $arg4, $arg5, $arg6,
+ $arg7 == NULL ? "" : user_string($arg7),
+ $arg8 == NULL ? "" : user_string($arg8),
+ $arg9 == NULL ? "" : user_string($arg9),
+ $arg9 == NULL ? "" : user_string($arg9));
+}
diff --git a/lib/runtime_tools/src/Makefile b/lib/runtime_tools/src/Makefile
index 946409b262..d6750f3a88 100644
--- a/lib/runtime_tools/src/Makefile
+++ b/lib/runtime_tools/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -36,15 +36,10 @@ RELSYSDIR = $(RELEASE_PATH)/lib/runtime_tools-$(VSN)
MODULES= \
erts_alloc_config \
- inviso_rt \
- inviso_rt_meta \
- inviso_rt_lib \
- inviso_as_lib \
- inviso_autostart \
- inviso_autostart_server \
runtime_tools \
runtime_tools_sup \
dbg \
+ dyntrace \
percept_profile \
observer_backend \
ttb_autostart
@@ -64,10 +59,15 @@ APPUP_FILE= runtime_tools.appup
APPUP_SRC= $(APPUP_FILE).src
APPUP_TARGET= $(EBIN)/$(APPUP_FILE)
+EXAMPLE_FILES= \
+ ../examples/*
# ----------------------------------------------------
# FLAGS
# ----------------------------------------------------
-ERL_COMPILE_FLAGS += -I../include
+ERL_COMPILE_FLAGS += \
+ -I../include \
+ -I ../../et/include \
+ -I ../../../libraries/et/include
# ----------------------------------------------------
# Targets
@@ -93,12 +93,14 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples"
+ $(INSTALL_DATA) $(EXAMPLE_FILES) "$(RELSYSDIR)/examples"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/runtime_tools/src/dbg.erl b/lib/runtime_tools/src/dbg.erl
index 385047ee73..d35c8e781e 100644
--- a/lib/runtime_tools/src/dbg.erl
+++ b/lib/runtime_tools/src/dbg.erl
@@ -431,10 +431,8 @@ trace_port1(file, Filename, Options) ->
fun() ->
Name = filename:absname(Filename),
%% Absname is needed since the driver uses
- %% the supplied name without further investigations,
- %% and if the name is relative the resulting path
- %% might be too long which can cause a bus error
- %% on vxworks instead of a nice error code return.
+ %% the supplied name without further investigations.
+
%% Also, the absname must be found inside the fun,
%% in case the actual node where the port shall be
%% started is on another node (or even another host)
diff --git a/lib/runtime_tools/src/dyntrace.erl b/lib/runtime_tools/src/dyntrace.erl
new file mode 100644
index 0000000000..b4579fd5ce
--- /dev/null
+++ b/lib/runtime_tools/src/dyntrace.erl
@@ -0,0 +1,352 @@
+-module(dyntrace).
+
+%%% @doc The Dynamic tracing interface module
+%%%
+%%% This Dynamic tracing interface module, with the corresponding NIFs, should
+%%% work on any operating system platform where user-space DTrace/Systemtap
+%%% (and in the future LttNG UST) probes are supported.
+%%%
+%%% It is recommended that you use the `dyntrace:p()' function to add
+%%% Dynamic trace probes to your Erlang code. This function can accept up to
+%%% four integer arguments and four string arguments; the integer
+%%% argument(s) must come before any string argument.
+%%%
+%%% If using DTrace, enable the dynamic trace probe using the 'dtrace'
+%%% command, for example:
+%%%
+%%% dtrace -s /your/path/to/lib/runtime_tools-1.8.7/examples/user-probe.d
+%%%
+%%% Then, back at the Erlang shell, try this example:
+%%% ```
+%%% 1> dyntrace:put_tag("GGOOOAAALL!!!!!").
+%%% true
+%%%
+%%% 2> dyntrace:p(7, 8, 9, "one", "four").
+%%% true
+%%% '''
+%%%
+%%% Output from the example D script `user-probe.d' looks like:
+%%% ```
+%%% <0.34.0> GGOOOAAALL!!!!! 7 8 9 0 'one' 'four' '' ''
+%%% '''
+%%%
+%%% If the expected type of variable is not present, e.g. integer when
+%%% integer() is expected, or an I/O list when iolist() is expected,
+%%% then the driver will ignore the user's input and use a default
+%%% value of 0 or NULL, respectively.
+
+-export([available/0,
+ user_trace_s1/1, % TODO: unify with pid & tag args like user_trace_i4s4
+ p/0, p/1, p/2, p/3, p/4, p/5, p/6, p/7, p/8,
+ 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([user_trace_i4s4/9]). % Know what you're doing!
+-on_load(on_load/0).
+
+-type probe_arg() :: integer() | iolist().
+-type int_p_arg() :: integer() | iolist() | undef.
+-type n_probe_label() :: 0..1023.
+
+%% The *_maybe() types use atom() instead of a stricter 'undef'
+%% because user_trace_i4s4/9 is exposed to the outside world, and
+%% because the driver will allow any atom to be used as a "not
+%% present" indication, we'll allow any atom in the types.
+
+-type integer_maybe() :: integer() | atom().
+-type iolist_maybe() :: iolist() | atom().
+
+on_load() ->
+ PrivDir = code:priv_dir(runtime_tools),
+ LibName = "dyntrace",
+ Lib = filename:join([PrivDir, "lib", LibName]),
+ Status = case erlang:load_nif(Lib, 0) of
+ ok -> ok;
+ {error, {load_failed, _}}=Error1 ->
+ ArchLibDir =
+ filename:join([PrivDir, "lib",
+ erlang:system_info(system_architecture)]),
+ Candidate =
+ filelib:wildcard(filename:join([ArchLibDir,LibName ++ "*" ])),
+ case Candidate of
+ [] -> Error1;
+ _ ->
+ ArchLib = filename:join([ArchLibDir, LibName]),
+ erlang:load_nif(ArchLib, 0)
+ end;
+ Error1 -> Error1
+ end,
+ case Status of
+ ok -> ok;
+ {error, {E, Str}} ->
+ case erlang:system_info(dynamic_trace) of
+ none ->
+ ok;
+ _ ->
+ error_logger:error_msg("Unable to load dyntrace library. Failed with error:~n
+\"~p, ~s\"~n"
+ "Dynamic tracing is enabled but the driver is not built correctly~n",[
+ E,Str]),
+ Status
+ end
+ end.
+
+%%%
+%%% NIF placeholders
+%%%
+
+-spec available() -> true | false.
+
+available() ->
+ erlang:nif_error(nif_not_loaded).
+
+-spec user_trace_s1(iolist()) -> true | false | error | badarg.
+
+user_trace_s1(_Message) ->
+ erlang:nif_error(nif_not_loaded).
+
+-spec user_trace_i4s4(iolist(),
+ integer_maybe(), integer_maybe(),
+ integer_maybe(), integer_maybe(),
+ iolist_maybe(), iolist_maybe(),
+ iolist_maybe(), iolist_maybe()) ->
+ true | false | error | badarg.
+
+user_trace_i4s4(_, _, _, _, _, _, _, _, _) ->
+ erlang:nif_error(nif_not_loaded).
+
+-spec user_trace_n(n_probe_label(), iolist(),
+ integer_maybe(), integer_maybe(),
+ integer_maybe(), integer_maybe(),
+ iolist_maybe(), iolist_maybe(),
+ iolist_maybe(), iolist_maybe()) ->
+ true | false | error | badarg.
+
+user_trace_n(_, _, _, _, _, _, _, _, _, _) ->
+ erlang:nif_error(nif_not_loaded).
+
+%%%
+%%% Erlang support functions
+%%%
+
+-spec p() -> true | false | error | badarg.
+
+p() ->
+ user_trace_int(undef, undef, undef, undef, undef, undef, undef, undef).
+
+-spec p(probe_arg()) -> true | false | error | badarg.
+
+p(I1) when is_integer(I1) ->
+ user_trace_int(I1, undef, undef, undef, undef, undef, undef, undef);
+p(S1) ->
+ user_trace_int(undef, undef, undef, undef, S1, undef, undef, undef).
+
+-spec p(probe_arg(), probe_arg()) -> true | false | error | badarg.
+
+p(I1, I2) when is_integer(I1), is_integer(I2) ->
+ user_trace_int(I1, I2, undef, undef, undef, undef, undef, undef);
+p(I1, S1) when is_integer(I1) ->
+ user_trace_int(I1, undef, undef, undef, S1, undef, undef, undef);
+p(S1, S2) ->
+ user_trace_int(undef, undef, undef, undef, S1, S2, undef, undef).
+
+-spec p(probe_arg(), probe_arg(), probe_arg()) -> true | false | error | badarg.
+
+p(I1, I2, I3) when is_integer(I1), is_integer(I2), is_integer(I3) ->
+ user_trace_int(I1, I2, I3, undef, undef, undef, undef, undef);
+p(I1, I2, S1) when is_integer(I1), is_integer(I2) ->
+ user_trace_int(I1, I2, undef, undef, S1, undef, undef, undef);
+p(I1, S1, S2) when is_integer(I1) ->
+ user_trace_int(I1, undef, undef, undef, S1, S2, undef, undef);
+p(S1, S2, S3) ->
+ user_trace_int(undef, undef, undef, undef, S1, S2, S3, undef).
+
+-spec p(probe_arg(), probe_arg(), probe_arg(), probe_arg()) ->
+ true | false | error | badarg.
+
+p(I1, I2, I3, I4) when is_integer(I1), is_integer(I2), is_integer(I3), is_integer(I4) ->
+ user_trace_int(I1, I2, I3, I4, undef, undef, undef, undef);
+p(I1, I2, I3, S1) when is_integer(I1), is_integer(I2), is_integer(I3) ->
+ user_trace_int(I1, I2, I3, undef, S1, undef, undef, undef);
+p(I1, I2, S1, S2) when is_integer(I1), is_integer(I2) ->
+ user_trace_int(I1, I2, undef, undef, S1, S2, undef, undef);
+p(I1, S1, S2, S3) when is_integer(I1) ->
+ user_trace_int(I1, undef, undef, undef, S1, S2, S3, undef);
+p(S1, S2, S3, S4) ->
+ user_trace_int(undef, undef, undef, undef, S1, S2, S3, S4).
+
+-spec p(probe_arg(), probe_arg(), probe_arg(), probe_arg(),
+ probe_arg()) ->
+ true | false | error | badarg.
+
+p(I1, I2, I3, I4, S1) when is_integer(I1), is_integer(I2), is_integer(I3), is_integer(I4) ->
+ user_trace_int(I1, I2, I3, I4, S1, undef, undef, undef);
+p(I1, I2, I3, S1, S2) when is_integer(I1), is_integer(I2), is_integer(I3) ->
+ user_trace_int(I1, I2, I3, undef, S1, S2, undef, undef);
+p(I1, I2, S1, S2, S3) when is_integer(I1), is_integer(I2) ->
+ user_trace_int(I1, I2, undef, undef, S1, S2, S3, undef);
+p(I1, S1, S2, S3, S4) when is_integer(I1) ->
+ user_trace_int(I1, undef, undef, undef, S1, S2, S3, S4).
+
+-spec p(probe_arg(), probe_arg(), probe_arg(), probe_arg(),
+ probe_arg(), probe_arg()) ->
+ true | false | error | badarg.
+
+p(I1, I2, I3, I4, S1, S2) when is_integer(I1), is_integer(I2), is_integer(I3), is_integer(I4) ->
+ user_trace_int(I1, I2, I3, I4, S1, S2, undef, undef);
+p(I1, I2, I3, S1, S2, S3) when is_integer(I1), is_integer(I2), is_integer(I3) ->
+ user_trace_int(I1, I2, I3, undef, S1, S2, S3, undef);
+p(I1, I2, S1, S2, S3, S4) when is_integer(I1), is_integer(I2) ->
+ user_trace_int(I1, I2, undef, undef, S1, S2, S3, S4).
+
+-spec p(probe_arg(), probe_arg(), probe_arg(), probe_arg(),
+ probe_arg(), probe_arg(), probe_arg()) ->
+ true | false | error | badarg.
+
+p(I1, I2, I3, I4, S1, S2, S3) when is_integer(I1), is_integer(I2), is_integer(I3), is_integer(I4) ->
+ user_trace_int(I1, I2, I3, I4, S1, S2, S3, undef);
+p(I1, I2, I3, S1, S2, S3, S4) when is_integer(I1), is_integer(I2), is_integer(I3) ->
+ user_trace_int(I1, I2, I3, undef, S1, S2, S3, S4).
+
+-spec p(probe_arg(), probe_arg(), probe_arg(), probe_arg(),
+ probe_arg(), probe_arg(), probe_arg(), probe_arg()) ->
+ true | false | error | badarg.
+
+p(I1, I2, I3, I4, S1, S2, S3, S4) when is_integer(I1), is_integer(I2), is_integer(I3), is_integer(I4) ->
+ user_trace_int(I1, I2, I3, I4, S1, S2, S3, S4).
+
+-spec user_trace_int(int_p_arg(), int_p_arg(), int_p_arg(), int_p_arg(),
+ int_p_arg(), int_p_arg(), int_p_arg(), int_p_arg()) ->
+ true | false | error | badarg.
+
+user_trace_int(I1, I2, I3, I4, S1, S2, S3, S4) ->
+ UTag = get_tag(),
+ try
+ user_trace_i4s4(UTag, I1, I2, I3, I4, S1, S2, S3, S4)
+ catch
+ error:nif_not_loaded ->
+ false
+ end.
+
+-spec pn(n_probe_label()) -> true | false | error | badarg.
+
+pn(ProbeLabel) ->
+ user_trace_n_int(ProbeLabel, undef, undef, undef, undef, undef, undef, undef, undef).
+
+-spec pn(n_probe_label(), probe_arg()) -> true | false | error | badarg.
+
+pn(ProbeLabel, I1) when is_integer(I1) ->
+ user_trace_n_int(ProbeLabel, I1, undef, undef, undef, undef, undef, undef, undef);
+pn(ProbeLabel, S1) ->
+ user_trace_n_int(ProbeLabel, undef, undef, undef, undef, S1, undef, undef, undef).
+
+-spec pn(n_probe_label(), probe_arg(), probe_arg()) -> true | false | error | badarg.
+
+pn(ProbeLabel, I1, I2) when is_integer(I1), is_integer(I2) ->
+ user_trace_n_int(ProbeLabel, I1, I2, undef, undef, undef, undef, undef, undef);
+pn(ProbeLabel, I1, S1) when is_integer(I1) ->
+ user_trace_n_int(ProbeLabel, I1, undef, undef, undef, S1, undef, undef, undef);
+pn(ProbeLabel, S1, S2) ->
+ user_trace_n_int(ProbeLabel, undef, undef, undef, undef, S1, S2, undef, undef).
+
+-spec pn(n_probe_label(), probe_arg(), probe_arg(), probe_arg()) -> true | false | error | badarg.
+
+pn(ProbeLabel, I1, I2, I3) when is_integer(I1), is_integer(I2), is_integer(I3) ->
+ user_trace_n_int(ProbeLabel, I1, I2, I3, undef, undef, undef, undef, undef);
+pn(ProbeLabel, I1, I2, S1) when is_integer(I1), is_integer(I2) ->
+ user_trace_n_int(ProbeLabel, I1, I2, undef, undef, S1, undef, undef, undef);
+pn(ProbeLabel, I1, S1, S2) when is_integer(I1) ->
+ user_trace_n_int(ProbeLabel, I1, undef, undef, undef, S1, S2, undef, undef);
+pn(ProbeLabel, S1, S2, S3) ->
+ user_trace_n_int(ProbeLabel, undef, undef, undef, undef, S1, S2, S3, undef).
+
+-spec pn(n_probe_label(), probe_arg(), probe_arg(), probe_arg(), probe_arg()) ->
+ true | false | error | badarg.
+
+pn(ProbeLabel, I1, I2, I3, I4) when is_integer(I1), is_integer(I2), is_integer(I3), is_integer(I4) ->
+ user_trace_n_int(ProbeLabel, I1, I2, I3, I4, undef, undef, undef, undef);
+pn(ProbeLabel, I1, I2, I3, S1) when is_integer(I1), is_integer(I2), is_integer(I3) ->
+ user_trace_n_int(ProbeLabel, I1, I2, I3, undef, S1, undef, undef, undef);
+pn(ProbeLabel, I1, I2, S1, S2) when is_integer(I1), is_integer(I2) ->
+ user_trace_n_int(ProbeLabel, I1, I2, undef, undef, S1, S2, undef, undef);
+pn(ProbeLabel, I1, S1, S2, S3) when is_integer(I1) ->
+ user_trace_n_int(ProbeLabel, I1, undef, undef, undef, S1, S2, S3, undef);
+pn(ProbeLabel, S1, S2, S3, S4) ->
+ user_trace_n_int(ProbeLabel, undef, undef, undef, undef, S1, S2, S3, S4).
+
+-spec pn(n_probe_label(), probe_arg(), probe_arg(), probe_arg(), probe_arg(),
+ probe_arg()) ->
+ true | false | error | badarg.
+
+pn(ProbeLabel, I1, I2, I3, I4, S1) when is_integer(I1), is_integer(I2), is_integer(I3), is_integer(I4) ->
+ user_trace_n_int(ProbeLabel, I1, I2, I3, I4, S1, undef, undef, undef);
+pn(ProbeLabel, I1, I2, I3, S1, S2) when is_integer(I1), is_integer(I2), is_integer(I3) ->
+ user_trace_n_int(ProbeLabel, I1, I2, I3, undef, S1, S2, undef, undef);
+pn(ProbeLabel, I1, I2, S1, S2, S3) when is_integer(I1), is_integer(I2) ->
+ user_trace_n_int(ProbeLabel, I1, I2, undef, undef, S1, S2, S3, undef);
+pn(ProbeLabel, I1, S1, S2, S3, S4) when is_integer(I1) ->
+ user_trace_n_int(ProbeLabel, I1, undef, undef, undef, S1, S2, S3, S4).
+
+-spec pn(n_probe_label(), probe_arg(), probe_arg(), probe_arg(), probe_arg(),
+ probe_arg(), probe_arg()) ->
+ true | false | error | badarg.
+
+pn(ProbeLabel, I1, I2, I3, I4, S1, S2) when is_integer(I1), is_integer(I2), is_integer(I3), is_integer(I4) ->
+ user_trace_n_int(ProbeLabel, I1, I2, I3, I4, S1, S2, undef, undef);
+pn(ProbeLabel, I1, I2, I3, S1, S2, S3) when is_integer(I1), is_integer(I2), is_integer(I3) ->
+ user_trace_n_int(ProbeLabel, I1, I2, I3, undef, S1, S2, S3, undef);
+pn(ProbeLabel, I1, I2, S1, S2, S3, S4) when is_integer(I1), is_integer(I2) ->
+ user_trace_n_int(ProbeLabel, I1, I2, undef, undef, S1, S2, S3, S4).
+
+-spec pn(n_probe_label(), probe_arg(), probe_arg(), probe_arg(), probe_arg(),
+ probe_arg(), probe_arg(), probe_arg()) ->
+ true | false | error | badarg.
+
+pn(ProbeLabel, I1, I2, I3, I4, S1, S2, S3) when is_integer(I1), is_integer(I2), is_integer(I3), is_integer(I4) ->
+ user_trace_n_int(ProbeLabel, I1, I2, I3, I4, S1, S2, S3, undef);
+pn(ProbeLabel, I1, I2, I3, S1, S2, S3, S4) when is_integer(I1), is_integer(I2), is_integer(I3) ->
+ user_trace_n_int(ProbeLabel, I1, I2, I3, undef, S1, S2, S3, S4).
+
+-spec pn(n_probe_label(), probe_arg(), probe_arg(), probe_arg(), probe_arg(),
+ probe_arg(), probe_arg(), probe_arg(), probe_arg()) ->
+ true | false | error | badarg.
+
+pn(ProbeLabel, I1, I2, I3, I4, S1, S2, S3, S4) when is_integer(I1), is_integer(I2), is_integer(I3), is_integer(I4) ->
+ user_trace_n_int(ProbeLabel, I1, I2, I3, I4, S1, S2, S3, S4).
+
+-spec user_trace_n_int(n_probe_label(),
+ int_p_arg(), int_p_arg(), int_p_arg(), int_p_arg(),
+ int_p_arg(), int_p_arg(), int_p_arg(), int_p_arg()) ->
+ true | false | error | badarg.
+
+user_trace_n_int(ProbeLabel, I1, I2, I3, I4, S1, S2, S3, S4) ->
+ UTag = get_tag(),
+ try
+ user_trace_n(ProbeLabel, UTag, I1, I2, I3, I4, S1, S2, S3, S4)
+ catch
+ error:nif_not_loaded ->
+ false
+ end.
+
+-spec put_tag(undefined | iodata()) -> binary() | undefined.
+put_tag(Data) ->
+ erlang:dt_put_tag(unicode:characters_to_binary(Data)).
+
+-spec get_tag() -> binary() | undefined.
+get_tag() ->
+ erlang:dt_get_tag().
+
+-spec get_tag_data() -> binary() | undefined.
+%% Gets tag if set, otherwise the spread tag data from last incoming message
+get_tag_data() ->
+ erlang:dt_get_tag_data().
+
+-spec spread_tag(boolean()) -> true | {non_neg_integer(), binary() | []}.
+%% Makes the tag behave as a sequential trace token, will spread with
+%% messages to be picked up by someone using get_tag_data
+spread_tag(B) ->
+ erlang:dt_spread_tag(B).
+
+-spec restore_tag(true | {non_neg_integer(), binary() | []}) -> true.
+restore_tag(T) ->
+ erlang:dt_restore_tag(T).
diff --git a/lib/runtime_tools/src/inviso_as_lib.erl b/lib/runtime_tools/src/inviso_as_lib.erl
deleted file mode 100644
index 75f3d9d004..0000000000
--- a/lib/runtime_tools/src/inviso_as_lib.erl
+++ /dev/null
@@ -1,155 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-%%% File : inviso_as_lib.erl
-%%% Author : Lennart �hman <[email protected]>
-%%% Description :
-%% The purpose of the inviso autostart library is to provide useful functions
-%% for anyone wanting to customize the autostart mechanism in the inviso
-%% tracer. It is intended to work well with the example 'inviso_autostart_server'.
-%%%
-%%% Created : 15 Dec 2005 by Lennart �hman
-%% -----------------------------------------------------------------------------
-
--module(inviso_as_lib).
-
--export([setup_autostart/7,setup_autostart/8,setup_autostart/9,
- inhibit_autostart/1,
- set_repeat/2,set_repeat_2/2]).
-%% -----------------------------------------------------------------------------
-
-%% setup_autostart(Node,Repeat,Options,TracerData,CmdFiles,Bindings) = ok|{error,Reason}.
-%% Repeat=integer(), where 0 means no (more) autostarts.
-%% Options=List of options as taken by the runtime component at start-up.
-%% TracerData= Tracerdata as given to inviso_rt:init_tracing.
-%% CmdFiles=[FileName,...] list of string(), files that will be executed
-%% by the subprocess started during autostart.
-%% Bindings=[{VarName,Value},...] Variable bindings for CmdFiles.
-%% VarName=atom(),
-%%
-%% This function creates the inviso_autostart.config file on Erlang node Node.
-%% This is useful when you wish to prepare for an autostarted trace.
-setup_autostart(Node,Repeat,Options,TracerData,CmdFiles,Bindings,Translations) ->
- setup_autostart(Node,Repeat,Options,TracerData,CmdFiles,
- Bindings,Translations,inviso_std_ref,off).
-setup_autostart(Node,Repeat,Options,TracerData,CmdFiles,Bindings,Translations,RTtag) ->
- setup_autostart(Node,Repeat,Options,TracerData,CmdFiles,
- Bindings,Translations,RTtag,off).
-setup_autostart(Node,Repeat,Options,TracerData,CmdFiles,Bindings,Translations,RTtag,Dbg) ->
- case rpc:call(Node,inviso_autostart,which_config_file,[]) of
- FileName when is_list(FileName) -> % Write to this file then.
- {String,Args}=format_config_file(Repeat,TracerData,Options,CmdFiles,
- Bindings,Translations,RTtag,Dbg),
- Bytes=list_to_binary(io_lib:format(String,Args)),
- case rpc:call(Node,file,write_file,[FileName,Bytes]) of
- ok ->
- ok;
- {error,Reason} ->
- {error,{write_file,Reason}};
- {badrpc,Reason} ->
- {error,{badrpc,{write_file,Reason}}}
- end;
- {error,Reason} ->
- {error,{which_config_file,Reason}};
- {badrpc,Reason} ->
- {error,{badrpc,{which_config_file,Reason}}}
- end.
-%% -----------------------------------------------------------------------------
-
-%% inhibit_autostart(Node) = ok|{error,Reason}
-%%
-%% Inhibits autostart by simply making the repeat parameter zero in the
-%% configuration file at node Node. All other parameters are left untouched.
-inhibit_autostart(Node) ->
- set_repeat(Node,0).
-%% -----------------------------------------------------------------------------
-
-%% set_repeat(Node,N)=ok | {error,Reason}
-%% N=integer(), the number of time autostart shall be allowed.
-set_repeat(Node,N) ->
- case examine_config_file(Node) of
- {ok,FileName,Terms} ->
- NewTerms=[{repeat,N}|lists:keydelete(repeat,1,Terms)],
- case rpc:call(Node,?MODULE,set_repeat_2,[FileName,NewTerms]) of
- {badrpc,Reason} ->
- {error,{badrpc,{open,Reason}}};
- Result ->
- Result
- end;
- {error,Reason} ->
- {error,Reason}
- end.
-
-%% Must be a sepparate function to do rpc on. The entire function must be done
-%% in one rpc call. Otherwise the FD will die since it is linked to the opening
-%% process.
-set_repeat_2(FileName,NewTerms) ->
- case file:open(FileName,[write]) of
- {ok,FD} ->
- String=lists:flatten(lists:map(fun(_)->"~w.~n" end,NewTerms)),
- case catch io:format(FD,String,NewTerms) of
- ok ->
- file:close(FD),
- ok;
- {'EXIT',Reason} ->
- file:close(FD),
- {error,{format,Reason}}
- end;
- {error,Reason} ->
- {error,Reason}
- end.
-%% -----------------------------------------------------------------------------
-
-examine_config_file(Node) ->
- case rpc:call(Node,inviso_autostart,which_config_file,[]) of
- FileName when is_list(FileName) -> % Read this file, and then modify it.
- case rpc:call(Node,file,consult,[FileName]) of
- {ok,Terms} ->
- {ok,FileName,Terms};
- {error,Reason} ->
- {error,{consult,Reason}};
- {badrpc,Reason} ->
- {error,{badrpc,{consult,Reason}}}
- end;
- {error,Reason} ->
- {error,{which_config_file,Reason}};
- {badrpc,Reason} ->
- {error,{badrpc,{which_config_file,Reason}}}
- end.
-%% -----------------------------------------------------------------------------
-
-format_config_file(Repeat,TracerData,Options,CmdFiles,Bindings,Translations,RTtag,Dbg) ->
- String="~w.~n~w.~n~w.~n~w.~n",
- Args=[{repeat,Repeat},
- {mfa,{inviso_autostart_server,init,[[{tracerdata,TracerData},
- {cmdfiles,CmdFiles},
- {bindings,Bindings},
- {translations,Translations},
- {debug,Dbg}]]}},
- {options,Options},
- {tag,RTtag}],
- {String,Args}.
-%% -----------------------------------------------------------------------------
-
-
-
-
-
-
-
diff --git a/lib/runtime_tools/src/inviso_autostart.erl b/lib/runtime_tools/src/inviso_autostart.erl
deleted file mode 100644
index 787292e244..0000000000
--- a/lib/runtime_tools/src/inviso_autostart.erl
+++ /dev/null
@@ -1,201 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%% Author: Lennart �hman, [email protected]
--module(inviso_autostart).
-
--export([autostart/1,which_config_file/0]).
-
-%% This module implements the default autostart module for the inviso runtime
-%% component.
-%% It will:
-%% (1) Open the autostart configuration file (either the default or the one
-%% pointed out by the runtime_tools application parameter inviso_autostart_config).
-%% (2) Check that the incarnation counter has not reached 0. If so, we do not
-%% allow (yet) one autostart.
-%% (3) Rewrite the configuration file if there was an incarnation counter.
-%% (With the counter decreased).
-%% (4) Inspect the content of the configuration file and pass paramters in the
-%% return value (which is interpreted by the runtime component).
-%%
-%% CONTENT OF A CONFIGURATION FILE:
-%% A plain text file containing erlang tuple terms, each ended with a period(.).
-%% The following parameters are recognized:
-%% {repeat,N} N=interger(),
-%% The number of remaining allowed autostart incarnations of inviso.
-%% {options,Options} Options=list()
-%% The options which controls the runtime component, such as overload and
-%% dependency.
-%% {mfa,{Mod,Func,Args}} Args=list()
-%% Controls how a spy process initiating tracing, patterns and flags shall
-%% be started.
-%% {tag,Tag}
-%% The tag identifying the runtime component to control components.
-%% =============================================================================
-
-%% This function is run in the runtime component's context during autostart
-%% to determine whether to continue and if, then how.
-autostart(_AutoModArgs) ->
- ConfigFile=
- case application:get_env(inviso_autostart_conf) of
- {ok,FileName} when is_list(FileName) -> % Use this filename then.
- FileName;
- {ok,{load,FileNames,{M,F}}} -> % First load the module, then...
- case try_load_module(FileNames) of
- ok ->
- autostart_apply(M,F);
-
- false -> % No such module available
- "inviso_autostart.config"
- end;
- {ok,{M,F}} -> % Use M:F(node())
- autostart_apply(M,F);
- {ok,no_autostart} ->
- false;
- _ -> % Use a default name, in CWD!
- "inviso_autostart.config"
- end,
- if
- is_list(ConfigFile) ->
- case file:consult(ConfigFile) of
- {ok,Terms} -> % There is a configuration.
- case handle_repeat(ConfigFile,Terms) of
- ok -> % Handled or not, we shall continue.
- {get_mfa(Terms),get_options(Terms),get_tag(Terms)};
- stop -> % We are out of allowed starts.
- true % Then no autostart.
- end;
- {error,_} -> % There is no config file
- true % Then no autostart!
- end;
- true -> % Skip it then.
- true
- end.
-
-autostart_apply(M,F) ->
- case catch M:F(node()) of
- FileName when is_list(FileName) ->
- FileName;
- no_autostart -> % No autostart after all.
- false;
- _ ->
- "inviso_autostart.config"
- end.
-
-%% This function is necessary since it is not always the case that all code-paths
-%% are set at the time of an autostart.
-try_load_module([AbsFileName|Rest]) when is_list(AbsFileName) ->
- case catch code:load_abs(AbsFileName) of % May not be a proper filename.
- {module,_Mod} ->
- try_load_module(Rest);
- _ ->
- false
- end;
-try_load_module([]) -> % Load all beam files successfully.
- ok;
-try_load_module(AbsFileName) when is_list(AbsFileName) ->
- try_load_module([AbsFileName]).
-%% -----------------------------------------------------------------------------
-
-%% Function returning the filename probably used as autostart config file.
-%% Note that this function must be executed at the node in question.
-which_config_file() ->
- case application:get_env(runtime_tools,inviso_autostart_conf) of
- {ok,FileName} when is_list(FileName) -> % Use this filename then.
- FileName;
- {ok,{M,F}} -> % Use M:F(node())
- case catch M:F(node()) of
- FileName when is_list(FileName) ->
- FileName;
- _ ->
- {ok,CWD}=file:get_cwd(),
- filename:join(CWD,"inviso_autostart.config")
- end;
- _ -> % Use a default name, in CWD!
- {ok,CWD}=file:get_cwd(),
- filename:join(CWD,"inviso_autostart.config")
- end.
-%% -----------------------------------------------------------------------------
-
-
-%% Help function which finds out if there is a limit on the number of times
-%% we shall autostart. If there is a repeat parameter and it is greater than
-%% zero, the file must be rewritten with the parameter decreased with one.
-%% Returns 'ok' or 'stop'.
-handle_repeat(FileName,Terms) ->
- case lists:keysearch(repeat,1,Terms) of
- {value,{_,N}} when N>0 -> % Controlls how many time more.
- handle_repeat_rewritefile(FileName,Terms,N-1),
- ok; % Indicate that we shall continue.
- {value,_} -> % No we have reached the limit.
- stop;
- false -> % There is no repeat parameter.
- ok % No restrictions then!
- end.
-
-%% Help function which writes the configuration file again, but with the
-%% repeat parameter set to NewN.
-%% Returns nothing significant.
-handle_repeat_rewritefile(FileName,Term,NewN) ->
- case file:open(FileName,[write]) of
- {ok,FD} ->
- NewTerm=lists:keyreplace(repeat,1,Term,{repeat,NewN}),
- handle_repeat_rewritefile_2(FD,NewTerm),
- file:close(FD);
- {error,_Reason} -> % Not much we can do then?!
- error
- end.
-
-handle_repeat_rewritefile_2(FD,[Tuple|Rest]) ->
- io:format(FD,"~w.~n",[Tuple]),
- handle_repeat_rewritefile_2(FD,Rest);
-handle_repeat_rewritefile_2(_,[]) ->
- true.
-%% -----------------------------------------------------------------------------
-
-%% Three help functions finding the parameters possible to give to the runtime
-%% component. Note that some of them have default values, should the parameter
-%% not exist.
-get_mfa(Terms) ->
- case lists:keysearch(mfa,1,Terms) of
- {value,{_,MFA}} ->
- MFA;
- false ->
- false
- end.
-
-get_options(Terms) ->
- case lists:keysearch(options,1,Terms) of
- {value,{_,Options}} ->
- Options;
- false ->
- []
- end.
-
-get_tag(Terms) ->
- case lists:keysearch(tag,1,Terms) of
- {value,{_,Tag}} ->
- Tag;
- false ->
- default_tag
- end.
-%% -----------------------------------------------------------------------------
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
diff --git a/lib/runtime_tools/src/inviso_autostart_server.erl b/lib/runtime_tools/src/inviso_autostart_server.erl
deleted file mode 100644
index 1e352822f4..0000000000
--- a/lib/runtime_tools/src/inviso_autostart_server.erl
+++ /dev/null
@@ -1,311 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2006-2010. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%% Author: Lennart �hman, [email protected]
-%%
--module(inviso_autostart_server).
--export([init/1]).
-
-%% -----------------------------------------------------------------------------
-%% Internal exports
-%% -----------------------------------------------------------------------------
--export([cmd_file_interpreter_init/4]).
-%% -----------------------------------------------------------------------------
-
-
-%% This module provides a (well working) example of how to program an
-%% autostart server responsible for initializing trace, setting patterns
-%% and flags.
-%%
-%% The general idea is that this code spawns interpreter processes in order to
-%% execute commands concurrently. Each of the interpreter processes opens one or
-%% several files (in sequence) containing erlang function calls which are evaluated
-%% in the interpreter process context.
-%% The argument provided to init shall be a list of options controlling
-%% how to initialize tracing, which file(s) to open and variable bindings.
-%%
-%% This autostart_server interpreters understands standard inviso trace case files.
-%%
-%% The runtime component provides an API very similar to the API provided
-%% by the control component. It is therefore easy to translate inviso calls to
-%% inviso_rt calls.
-%%
-%% This process may be killed by the inviso_rt process if stop_tracing is called.
-%% The reason is that there is no time limit to the interpreter processes. Hence
-%% they should be killed if tracing is not possible anylonger.
-%% =============================================================================
-
-
-%% -----------------------------------------------------------------------------
-
-%% The independent autostart process spawned by the runtime component to carry
-%% out initializations is spawened on this function (if using the example
-%% autostart which comes with inviso).
-%% ArgsFromConfig is as can be heard from the name comming from a paramater in
-%% the autostart configuration file. Here it is supposed to be:
-%% ArgsFromConfig=[ServerParam,...]
-%% ServerParam={tracerdata,TracerData}|{cmdfiles,Files}|{bindings,Bindings}|
-%% {translations,Translations}|{debug,DbgLevel}
-%% TracerData=tracerdata given to inviso_rt:init_tracing/1 function.
-%% Files=[FileNameSpecs,...] where each FileNameSpecs will be executed in
-%% a separate process. Making each FileNameSpec parallel.
-%% FileNameSpecs=[FileNameSpec,...]
-%% FileNameSpec=FileName | {FileName,Bindings}
-%% Bindings=[{Var,Value},...] variable environment understood by
-%% erl_eval:exprs/2.
-%% Translations=[Translation,...]
-%% A translation file is a text-file with following tuples
-%% Translation={{Mod,Func,Arity,{Mod2,Func2,ParamMF}}}|
-%% {{Func,Arity,{Mod2,Func2,ParamMF}}}
-%% ParamMF={M,F} | any()
-%% Translates Mod:Func/Arity to Mod2:Func2 with the arguments to
-%% Mod:Func translated using M:F/1. Note that ParamMF is not
-%% necessarily an MF. If no translation shall be done, ParamMF
-%% shall be anything else but an MF.
-%% Also note that Mod is optional in a Translation. That means that
-%% function calls without a module in the trace case file will
-%% be translated according to that translation.
-init(ArgsFromConfig) ->
- case get_tracerdata_opts(ArgsFromConfig) of
- {ok,TracerData} -> % Otherwise we can not start a trace!
- case inviso_rt:init_tracing(TracerData) of
- {ok,_Response} -> % Ok, tracing has been initiated.
- case get_cmdfiles_opts(ArgsFromConfig) of
- {ok,CmdFiles} -> % List of cmd-files.
- Bindings=get_initialbindings_opts(ArgsFromConfig),
- Translations=get_translations_opts(ArgsFromConfig),
- Dbg=get_dbg_opts(ArgsFromConfig),
- Procs=start_cmd_file_interpreters(CmdFiles,
- Bindings,
- Translations,
- Dbg),
- loop(Procs,Dbg); % Wait for procs to be done.
- false -> % Then we can terminate normally.
- true
- end;
- {error,Reason} -> % This is fault, lets terminate abnormally.
- exit({inviso,{error,Reason}})
- end;
- false -> % Then there is not much use then.
- true % Just terminate normally.
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function which starts a process for each item found in the FileNames
-%% list. The idea is that each item will be processed concurrently. The items
-%% them selves may be a sequence of filenames.
-%% Returns a list of spawned interpret processes.
-start_cmd_file_interpreters([FileNames|Rest],Bindings,Translations,Dbg) ->
- P=spawn_link(?MODULE,cmd_file_interpreter_init,[FileNames,Bindings,Translations,Dbg]),
- MRef=erlang:monitor(process,P), % Can't trap exits in this process.
- [{P,MRef}|start_cmd_file_interpreters(Rest,Bindings,Translations,Dbg)];
-start_cmd_file_interpreters([],_,_,_) ->
- [].
-%% -----------------------------------------------------------------------------
-
-
-%% The loop where this process simply waits for all of the interpreters to be
-%% done. Note that that may take som time. An interpreter may take as long time
-%% necessary to do its task.
-loop(Procs,Dbg) ->
- receive
- {'DOWN',MRef,process,Pid,_Reason} ->
- case lists:keysearch(MRef,1,Procs) of
- {value,{Pid,_}} -> % It was an interpreter that terminated.
- case lists:keydelete(MRef,1,Procs) of
- [] -> % No more interpreters.
- true; % Then terminate.
- NewProcs ->
- loop(NewProcs,Dbg)
- end;
- false ->
- loop(Procs,Dbg)
- end;
- _ ->
- loop(Procs,Dbg)
- end.
-
-
-%% -----------------------------------------------------------------------------
-%% The interpret process.
-%%
-%% An interpreter process executes trace case files. Several interpreter processes
-%% may be running in parallel. It is not within the scoop of this implementation
-%% of an autostart server to solve conflicts. (You may implement your own autostart
-%% server!).
-%% An interpret process may run for as long as necessary. Hence the function called
-%% within the trace case file can contain wait functions, waiting for a certain
-%% system state to occure before continuing.
-%% Note that this process also mixes global and local bindings. GlobalBindings
-%% is a binding() structure, where LocalBindings is a list of {Var,Value}.
-%% Further it is possible to let FileName be a {inviso,Func,Args} tuple instead.
-%% -----------------------------------------------------------------------------
-
-%% Init function for an interpreter process instance.
-cmd_file_interpreter_init(FileNames,GlobalBindings,Translations,Dbg) ->
- interpret_cmd_files(FileNames,GlobalBindings,Translations,Dbg).
-
-interpret_cmd_files([{FileName,LocalBindings}|Rest],GlobalBindings,Translations,Dbg) ->
- Bindings=join_local_and_global_vars(LocalBindings,GlobalBindings),
- interpret_cmd_files_1(FileName,Bindings,Translations,Dbg),
- interpret_cmd_files(Rest,GlobalBindings,Translations,Dbg);
-interpret_cmd_files([],_,_,_) -> % Done, return nothing significant!
- true;
-interpret_cmd_files(FileName,GlobalBindings,Translations,Dbg) ->
- interpret_cmd_files_1(FileName,GlobalBindings,Translations,Dbg).
-% interpret_cmd_files(Rest,GlobalBindings,Translations,Dbg).
-
-%% This is "inline" inviso calls.
-interpret_cmd_files_1({inviso,F,Args},Bindings,Translations,Dbg) ->
- {ok,Tokens1,_}=erl_scan:string("inviso:"++atom_to_list(F)++"("),
- Tokens2=tokenize_args(Args),
- {ok,Tokens3,_}=erl_scan:string(")."),
- case erl_parse:parse_exprs(Tokens1++Tokens2++Tokens3) of
- {ok,Exprs} ->
- interpret_cmd_files_3(Bindings,Exprs,Translations,Dbg);
- {error,_Reason} ->
- error
- end;
-interpret_cmd_files_1({Mod,Func,Args},_Bindings,_Translations,_Dbg) ->
- catch apply(Mod,Func,Args);
-%% This is the case when it actually is a trace case file.
-interpret_cmd_files_1(FileName,Bindings,Translations,Dbg) ->
- case file:open(FileName,[read]) of
- {ok,FD} ->
- interpret_cmd_files_2(FD,Bindings,io:parse_erl_exprs(FD,""),Translations,Dbg),
- file:close(FD);
- {error,Reason} -> % Something wrong with the file.
- inviso_rt_lib:debug(Dbg,interpret_cmd_files,[FileName,{error,Reason}])
- end.
-
-%% Help function which handles Exprs returned from io:parse_erl_exprs and
-%% tries to eval them. It is the side-effects we are interested in, like
-%% setting flags and patterns. Note that we will get a failure should there
-%% be a variable conflict.
-%% Also note that there is logic to translate control component API calls to
-%% corresponding runtime component calls.
-%% Returns nothing significant.
-interpret_cmd_files_2(FD,Bindings,{ok,Exprs,_},Translations,Dbg) ->
- {next,NewBindings}=interpret_cmd_files_3(Bindings,Exprs,Translations,Dbg),
- interpret_cmd_files_2(FD,NewBindings,io:parse_erl_exprs(FD,""),Translations,Dbg);
-interpret_cmd_files_2(FD,Bindings,{error,ErrorInfo,Line},Translations,Dbg) ->
- inviso_rt_lib:debug(Dbg,parse_erl_exprs,[ErrorInfo,Line]),
- interpret_cmd_files_2(FD,Bindings,io:parse_erl_exprs(FD,""),Translations,Dbg);
-interpret_cmd_files_2(_,_,{eof,_},_,_) -> % End of file.
- true.
-
-interpret_cmd_files_3(Bindings,Exprs,Translations,Dbg) ->
- case catch inviso_rt_lib:transform(Exprs,Translations) of
- NewExprs when is_list(NewExprs) -> % We may have translated the API.
- case catch erl_eval:exprs(NewExprs,Bindings) of
- {'EXIT',Reason} ->
- inviso_rt_lib:debug(Dbg,exprs,[Exprs,Bindings,{'EXIT',Reason}]),
- {next,Bindings};
- {value,_Val,NewBindings} -> % Only interested in the side effects!
- {next,NewBindings}
- end;
- {'EXIT',Reason} ->
- inviso_rt_lib:debug(Dbg,translate2runtime_funcs,[Exprs,Reason]),
- {next,Bindings}
- end.
-
-%% Help function adding variables to a bindings structure. If the variable already
-%% is assigned in the structure, it will be overridden. Returns a new
-%% bindings structure.
-join_local_and_global_vars([{Var,Val}|Rest],Bindings) when is_atom(Var) ->
- join_local_and_global_vars(Rest,erl_eval:add_binding(Var,Val,Bindings));
-join_local_and_global_vars([_|Rest],Bindings) ->
- join_local_and_global_vars(Rest,Bindings);
-join_local_and_global_vars([],Bindings) ->
- Bindings.
-
-%% Help function returning a string of tokens, including "," separation
-%% between the arguments.
-tokenize_args(Args=[Arg|Rest]) when length(Args)>1 ->
- AbsTerm=erl_parse:abstract(Arg),
- Tokens=erl_parse:tokens(AbsTerm),
- {ok,Token,_}=erl_scan:string(","),
- Tokens++Token++tokenize_args(Rest);
-tokenize_args([Arg]) ->
- AbsTerm=erl_parse:abstract(Arg),
- erl_parse:tokens(AbsTerm);
-tokenize_args([]) ->
- "".
-%% -----------------------------------------------------------------------------
-
-
-%% -----------------------------------------------------------------------------
-%% Help functions working on the options given as argument to init during spawn.
-%% -----------------------------------------------------------------------------
-
-get_tracerdata_opts(ArgsFromConfig) ->
- case lists:keysearch(tracerdata,1,ArgsFromConfig) of
- {value,{_,{mfa,{M,F,CompleteTDGargs}}}} -> % Dynamic tracerdata.
- case catch apply(M,F,CompleteTDGargs) of
- {'EXIT',_Reason} ->
- false;
- TracerData ->
- {ok,TracerData}
- end;
- {value,{_,TracerData}} -> % Interpret this as static tracerdata.
- {ok,TracerData};
- false ->
- false
- end.
-%% -----------------------------------------------------------------------------
-
-get_cmdfiles_opts(ArgsFromConfig) ->
- case lists:keysearch(cmdfiles,1,ArgsFromConfig) of
- {value,{_,CmdFiles}} ->
- {ok,CmdFiles};
- false ->
- false
- end.
-%% -----------------------------------------------------------------------------
-
-get_initialbindings_opts(ArgsFromConfig) ->
- case lists:keysearch(bindings,1,ArgsFromConfig) of
- {value,{_,Bindings}} ->
- Bindings;
- false -> % Then we use empty bindings.
- erl_eval:new_bindings()
- end.
-%% -----------------------------------------------------------------------------
-
-get_translations_opts(ArgsFromConfig) ->
- case lists:keysearch(translations,1,ArgsFromConfig) of
- {value,{_,Translations}} ->
- Translations;
- false -> % This becomes nearly point less.
- []
- end.
-%% -----------------------------------------------------------------------------
-
-get_dbg_opts(ArgsFromConfig) ->
- case lists:keysearch(debug,1,ArgsFromConfig) of
- {value,{_,DbgLevel}} ->
- DbgLevel;
- false ->
- off
- end.
-%% -----------------------------------------------------------------------------
-
-%% EOF
-
-
-
diff --git a/lib/runtime_tools/src/inviso_rt.erl b/lib/runtime_tools/src/inviso_rt.erl
deleted file mode 100644
index b162f5b045..0000000000
--- a/lib/runtime_tools/src/inviso_rt.erl
+++ /dev/null
@@ -1,2885 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%% Description:
-%% The runtime component of the trace tool Inviso.
-%%
-%% Authors:
-%% Ann-Marie L�f, [email protected]
-%% Lennart �hman, [email protected]
-%% -----------------------------------------------------------------------------
-
--module(inviso_rt).
-
-
-%% -----------------------------------------------------------------------------
-%% interface for supervisor
-%% -----------------------------------------------------------------------------
--export([start_link_man/3,start_link_auto/1]).
-
-%% API for controll component.
--export([start/4,stop/1,
- init_tracing/2,stop_tracing_parallel/1,
- try_to_adopt/3,confirm_connection/2,get_node_info/1,
- suspend/2,call_suspend/2,cancel_suspension/1,change_options/2,
- clear/2,clear_all_tp/1,
- flush/1,
- trace_patterns_parallel/3,
- trace_flags_parallel/3,trace_flags_parallel/2,trace_flags_parallel/1,
- meta_tracer_call_parallel/2,
- get_status/1,get_tracerdata/1,list_logs/1,list_logs/2,fetch_log/2,fetch_log/3,
- delete_log/1,delete_log/2,
- state/1]).
-%% -----------------------------------------------------------------------------
-
-%% API mostly for autostart scripts, instead of corresponding control component
-%% apis not available doing local function calls.
--export([init_tracing/1,tp/4,tp/5,tp/1,tpg/4,tpg/5,tpg/1,
- tpl/4,tpl/5,tpl/1,
- ctp/1,ctp/3,ctpg/1,ctpg/3,ctpl/1,ctpl/3,
- init_tpm/4,init_tpm/7,
- tpm/4,tpm/5,tpm/8,tpm_tracer/4,tpm_tracer/5,tpm_tracer/8,
- tpm_ms/5,tpm_ms_tracer/5,
- ctpm_ms/4,
- local_register/0,global_register/0,
- ctpm/3,remove_local_register/0,remove_global_register/0,
- tf/2,tf/1,ctf/2,ctf/1]).
-%% -----------------------------------------------------------------------------
-
-%% Internal exports.
--export([init/4,auto_init/2,fetch_init/4]).
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% Constants.
-%% -----------------------------------------------------------------------------
-
--define(DEFAULT_OVERLOAD_FUNC,default_overload_func).
--define(NO_LOADCHECK,no_loadcheck).
-
--define(RT_SUP,runtime_tools_sup). % Refers to the registered name.
--define(CTRL,inviso_c). % Refers to the registered name.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% Record definition.
-%% -----------------------------------------------------------------------------
-
-%% #rt
-%% All record fields must be bound to listed values when leaving init or
-%% auto_init.
-%% dependency: Timeout accepting being without control component.
-%% overload : Controlls which module to call, if any, when time for a check.
-%% timer_ref: Used when timing delayed shutdown due to lost control component.
--record(rt,{state = new, % new | idle | tracing
- status = running, % running | {suspended, Reason}
- next_loadcheck = now(), % now | "No Loadcheck"
- parent, % pid()
- tracerdata, % undefined|{fun(),term()}|{file,Param}|{ip,Param}
- tracer_port, % port() | undefined
- handler, % {fun(), term()} | undefined
- auto_starter, % pid() | undefined; proc starting interpreters.
- meta_tracer, % undefined | pid()
- fetchers=[], % [pid(),...] processes transfering logfiles.
-% spies = [],
- dependency={infinity,node()}, % {TOut,Node} | TOut; TOut=int()|infinity
- overload=no_loadcheck, % ?NO_LOADCHECK|{LoadMF,Interval,InitMFA,RemoveMFA}
- overload_data=void, % Datastructure given to LoadMF and RemoveMFA.
- timer_ref, % undefined | reference()
- ctrl, % undefined | pid()
- ctrl_ref, % undefined | reference()
- vsn, % list()
- tag % term()
- }).
-%% -----------------------------------------------------------------------------
-
-
-%% ==============================================================================
-%% Start API
-%% ==============================================================================
-
-%% Note that the runtime component may be started in many different ways.
-%% It can be autostarted by the runtime_tools_sup during initial start-up of the
-%% system. It is actually most likely that it will be started that way. However
-%% if there are no autostart trace-cases to run, the inviso_rt runtime component
-%% will terminate. It will then however remain as a child of the runtime_tools_sup
-%% supervisor. This means that if the runtime component is started again, manually,
-%% by the control component, some actions must be taken.
-%% For instance is it very likely that the child already exists. But since it
-%% must be started with different arguments when started manually, the child-spec
-%% must be changed.
-%%
-%% The runtime component is not a proper gen_server, to allow full control of
-%% what happens. It however mimcs gen_server behaviour to be managed by the
-%% runtime_tools_sup supervisor.
-
-
-%% start_link_auto(AutoModArgs)={ok,Pid}
-%%
-%% This function is entered into the child-spec when planning on doing autostart
-%% of the runtime component. The autostart is controlled by the so called
-%% inviso_autostart_mod. It is an application environment parameter of the
-%% runtime_tools application. If it exists, it shall point out a module name.
-%% If it does not exist, the default 'inviso_autostart' module will be tried.
-%% Note that these start_link functions do not implement proper otp-behaviour.
-%% For instance they return {ok,Pid} immediately making the init-phase of the
-%% runtime component process empty.
-%%
-%% The inviso_autostart_mod shall export one function:
-%% autostart(AutoModArgs) -> {MFA,Options,Tag}, where
-%% AutoModArgs=term(), comes from the application start parameters in the
-%% runtime_tools application resource file.
-%% MFA={Mod,Func,Args} | term().
-%% If it is MFA it will cause a trace initiator process to start spawning
-%% on spawn_link(Mod,Func,Args). The trace initiator may for instance
-%% initiate the wanted tracing.
-start_link_auto(AutoModArgs) ->
- {ok,spawn_link(?MODULE,auto_init,[AutoModArgs,self()])}.
-%% ------------------------------------------------------------------------------
-
-%% This function is entered into the child-specification of the runtime_tools_sup
-%% if the runtime component shall be started manually via the control component.
-start_link_man(Ctrl,Options,Tag) ->
- {ok,spawn_link(?MODULE,init,[Ctrl,Options,Tag,self()])}.
-%% ------------------------------------------------------------------------------
-
-%% start(Node,Options,Tag,Condition)=tbd
-%% Node=The node where the runtime component shall be started.
-%% Options=[Opt]; List of options to the runtime component.
-%% Opt={dependency,Val}|{dependency,{Val,Node}}
-%% Val=int()|infinity
-%% If the runtime component may run on its own or not. Val=0 means a runtime
-%% component which will terminate immediately without its control component.
-%% Note that if the runtime component is started manually, the Node part
-%% is never used. The runtime is supposed to be dependent of the Ctrl mentioned
-%% in the start_link_man parameters.
-%% Opt={overload,OverLoad} | overload
-%% The latter means no loadcheck. Necessary if changing the options.
-%% Overload=Iterval (int() in milliseconds) |
-%% {LoadMF,Interval}|{LoadMF,Interval,InitMFA,RemoveMFA}
-%% LoadMF={Mod,Func}|function()
-%% InitMFA,RemoveMFA={Mod,Func,ArgList} where
-%% apply(InitM,InitF,InitArgs) -> {ok,DataStruct}|'void'.
-%% apply(RemoveM,RemoveF,[DataStruct|Args]) -> don't care
-%% LoadMF is called each time loadcheck is performed.
-%% Mod:Func(DataStruct)->ok|{suspend,Reason}
-%% If just Interval is used, it means using a default overload check.
-%% Tag=term(), used to identify an incarnation of a runtime component so that
-%% a control component reconnecting will know if it was its own incarnation
-%% still alive, or some elses.
-%% Condition='if_ref'|term(). Controls if we want to adopt the runtime component.
-%% If 'if_ref' is stated it means that we only want to adopt a runtime component
-%% with the suggested Tag.
-%%
-%% This is the API used by the control component when tries to start a runtime
-%% component. Note that it will try to adopt an already running, if possible.
-%% Adoptions are only possible if the runtime component at hand is running
-%% without control component.
-start(Node, Options, Tag, Condition) when Node == node() ->
- ChildSpec = {?MODULE, {?MODULE, start_link_man, [self(), Options, Tag]},
- temporary, 5000, worker, [?MODULE]},
- case catch supervisor:start_child(?RT_SUP, ChildSpec) of
- {ok, Pid} when is_pid(Pid) ->
- {node_info, _Node, Pid, VSN, State, Status, _Tag} =
- get_node_info(Pid),
- {node_info, Node, Pid, VSN, State, Status, new};
- {error, already_present} ->
- supervisor:delete_child(?RT_SUP, ?MODULE),
- start(Node, Options, Tag, Condition);
- {error, {already_started, Pid}} ->
- try_to_adopt(Pid, Tag, Condition);
- {error,Reason} ->
- {error,Reason};
- {'EXIT',Reason} ->
- {error,Reason}
- end;
-start(Node, Options, Tag, Condition) ->
- case rt_version(Node) of
- {error,Error} ->
- {error,Error};
- _VSN ->
- ChildSpec = {?MODULE, {?MODULE, start_link_man,
- [self(), Options, Tag]},
- temporary, 5000, worker, [?MODULE]},
- case catch rpc:call(Node, supervisor, start_child,
- [?RT_SUP, ChildSpec]) of
- {ok, Pid} when is_pid(Pid) ->
- {node_info, _Node, Pid,
- VSN, State, Status, _Tag} = get_node_info(Pid),
- {node_info, Node, Pid, VSN, State, Status, new};
- {error, already_present} ->
- rpc:call(Node, supervisor, delete_child,
- [?RT_SUP, ?MODULE]),
- start(Node, Options, Tag, Condition);
- {error, {already_started, Pid}} ->
- try_to_adopt(Pid, Tag, Condition);
- {error,Reason} -> % Could not start child.
- {error,Reason};
- {badrpc,nodedown} ->
- {error,nodedown};
- {badrpc,Reason} ->
- {error,{badrpc,Reason}};
- {'EXIT',Reason} ->
- {error,Reason}
- end
- end.
-
-rt_version(Node) ->
- case catch rpc:call(Node,application,loaded_applications,[]) of
- List when is_list(List) ->
- case lists:keysearch(runtime_tools,1,List) of
- {value,{_,_,VSN}} ->
- VSN;
- false ->
- {error,not_loaded}
- end;
- {badrpc,nodedown} ->
- {error,nodedown};
- {'EXIT',Reason} ->
- {error,Reason}
- end.
-%% ------------------------------------------------------------------------------
-
-%% stop(Node)=ok|{error,Reason}
-%% Stops the runtim component on node Node. Note that this is mearly calling the
-%% supervisor API to shutdown the inviso_rt child belonging to the runtime_tools_sup.
-stop(Node) when Node==node() ->
- supervisor:terminate_child(?RT_SUP,?MODULE),
- supervisor:delete_child(?RT_SUP,?MODULE),
- ok;
-stop(Node) ->
- case catch rpc:call(Node,supervisor,terminate_child,[?RT_SUP,?MODULE]) of
- ok ->
- stop_delete_child(Node);
- {error,_} -> % No child running.
- stop_delete_child(Node); % Make sure we remove it also.
- {badrpc,Reason} ->
- {error,{badrpc,Reason}};
- {'EXIT',Reason} ->
- {error,Reason}
- end.
-
-stop_delete_child(Node) ->
- case catch rpc:call(Node,supervisor,delete_child,[?RT_SUP,?MODULE]) of
- ok ->
- ok;
- {error,_} -> % No child running.
- ok;
- {badrpc,Reason} ->
- {error,{badrpc,Reason}};
- {'EXIT',Reason} ->
- {error,Reason}
- end.
-%% ------------------------------------------------------------------------------
-
-
-%% ==============================================================================
-%% API for the control component.
-%% ==============================================================================
-
-%% init_tracing(TracerData) ->
-%% TracerData = LogTD | [{trace,LogTD},{ti,TiTD}]
-%% LogTD = {HandlerFun, Data} | collector |
-%% {relayer, pid()} | {ip, IPPortParameters} |
-%% {file, FilePortParameters}
-%% TiTD = {file,FileName} | {file,FileName,{InitPublLD,RemovePublLD,CleanPublLD}}
-%% | {relay,Node} | {relay,Node,{InitPublLD,RemovePublLD,CleanPublLD}}
-%% HandlerFun=fun(TraceMsg,Data)->NewData
-%% IPPortParameters = Portno | {Portno, Qsiz}
-%% Qsiz =
-%% FilePortParameters = {Filename, wrap, Tail, {time, WrapTime}, WrapCnt} |
-%% {FileName, wrap, Tail, WrapSize, WrapCnt} |
-%% {FileName, wrap, Tail, WrapSize} |
-%% {FileName, wrap, Tail} | FileName
-%% Defines a tracer:
-%% {HandlerFun, Data} - will be used as handler inside the runtime component for
-%% every incomming trace message.
-%% relayer - the runtime component will relay all comming trace messages to
-%% the runtime component Pid.
-%% collector - the runtime component is used as tracer or collector of relayed
-%% trace messages using the default handler writing them to io.
-%% ip | file - will start a tracer port using PortParameters
-init_tracing(Pid,TracerData) ->
- call(Pid,{init_tracing,TracerData}).
-%% ------------------------------------------------------------------------------
-
-%% stop_tracing(RTpids)=[{Node,NodeResult},...]
-%% RTpids=[RTinfo,...]
-%% RTinfo={RTpid,Node} | {{error,Reason},Node}
-%% NodeResult={ok,State} | {error,Reason}
-%% Sends a request to stop tracing to all nodes in RTpids, in parallel. Stop
-%% tracing means that all trace flags are removed and the nodes go to idle
-%% state.
-stop_tracing_parallel(RTpids) ->
- call_parallel(lists:map(fun({Pid,Node})->{Pid,Node,stop_tracing};
- (Error)->Error
- end,
- RTpids)).
-%% ------------------------------------------------------------------------------
-
-%% try_to_adopt(Pid,NewTag,Condition)=
-%% {node_info,node(),self(),VSN,State,Status,{tag,PreviousTag}}|{error,Reason}
-%% NewTag=term(), the identification tag we want the runtime component to use
-%% from now on if adoption was successful.
-%% Condition='if_ref', only adopt if current tag is NewTag.
-%% PreviousTag= the tag the runtime component had before it accepted the
-%% adoption.
-%% This function shall only be used by a control component wishing to adopt this
-%% runtime component.
-try_to_adopt(Pid, Tag, Condition) ->
- call(Pid,{try_to_adopt,Tag,Condition}).
-%% ------------------------------------------------------------------------------
-
-%% confirm_connection(Pid,Tag)= {node_info,node(),self(),VSN,State,Status,Tag}|
-%% {error,refused}.
-%% Must only be used by a control component having been contacted by the runtime
-%% component Pid. It confirms to the runtime component that the control component
-%% has accepted the connect request.
-confirm_connection(Pid,Tag) ->
- call(Pid,{confirm_connection,Tag}).
-%% ------------------------------------------------------------------------------
-
-%% get_node_info(Pid)={node_info,Node,Pid,VSN,State,Status,Tag}.
-get_node_info(Pid) ->
- call(Pid,get_node_info).
-%% ------------------------------------------------------------------------------
-
-%% suspend(NodeOrPid,Reason)=ok
-%% call_suspend(NodeOrPid,Reason)=ok
-%% Makes the runtime component and all of its helpers suspend. suspend/2 is
-%% assynchronous.
-suspend(NodeOrPid,Reason) ->
- cast(NodeOrPid,{suspend,Reason}).
-
-call_suspend(NodeOrPid,Reason) ->
- call(NodeOrPid,{suspend,Reason}).
-%% ------------------------------------------------------------------------------
-
-%% cancel_suspension(Pid)=ok
-%% Function moving the runtime component to status running. Regardless of its
-%% current status.
-cancel_suspension(Pid) ->
- call(Pid,cancel_suspension).
-%% ------------------------------------------------------------------------------
-
-%% change_options(Pid,Options)=ok
-%% Options=list(); see the start_link_XXX functions.
-%% Changes options according to Options list.
-%% Changing the control component we shall be depending on has no effect. The
-%% dependency value in self can however be changed, and takes effect immediately.
-change_options(Pid,Options) ->
- call(Pid,{change_options,Options}).
-%% ------------------------------------------------------------------------------
-
-%% clear_all_tp(Pid)=ok
-%% Function removing all, both local and global trace-patterns from the node.
-clear_all_tp(Pid) ->
- call(Pid,clear_all_tp).
-%% ------------------------------------------------------------------------------
-
-%% clear(Pid,Options)={ok,{new,Status}}
-%% Options=[Opt,...]
-%% Opt=keep_trace_patterns | keep_log_files
-%% Resets the runtime component to state 'new' by stopping all ongoing tracing,
-%% closing and removing all associated logfiles. The Options can be used to
-%% prevent the runtime component from being totally erased.
-clear(Pid,Options) ->
- call(Pid,{clear,Options}).
-%% ------------------------------------------------------------------------------
-
-%% flush(Pid)=ok | {error,Reason}
-%% Sends the flush command to the trace-port, if we are using a trace-port and
-%% are tracing.
-flush(Pid) ->
- call(Pid,flush).
-%% ------------------------------------------------------------------------------
-
-%% trace_patterns_parallel(RTpids,Args,Flags)=[{Node,Answer},...]
-%% RTpids=[{RTpid,Node},...] or [{Error,Node},...]
-%% Args=[Arg,...]
-%% Arg={Mod,Func,Arity,MS}|{Mod,Func,Arity,MS,Opts}
-%% Mod=atom()|reg_exp()|{Dir,reg_exp()}
-%% Dir=reg_exp()
-%% Answer=[Answer,...]
-%% Answer=int()|{error,Reason}
-%% API function for the control component sending trace-patterns to a list of
-%% runtime components. Returns a [{Node,Answer},...] list in the same order.
-trace_patterns_parallel(RTpids,Args,Flags) -> % Same args and flags for all.
- call_parallel(lists:map(fun({Pid,Node})when is_pid(Pid)->{Pid,Node,{tp,Args,Flags}};
- (Error)-> Error
- end,
- RTpids)).
-%% ------------------------------------------------------------------------------
-
-%% trace_flags_parallel(RTpids,Args,How)=
-%% trace_flags_parallel(RTpidsArgs,How)=
-%% trace_flags_parallel(RTpidsArgsHow)=[{Node,Reply},...]
-%% RTpids=[RTpidEntry,...]
-%% RTpidEntry={RTpid,Node}|{Error,Node}
-%% Error=term(), any term you wish to have as reply in Answer assoc. to Node.
-%% Args=[{Process,Flags},...]
-%% Process=pid()|registeredname()|'all'|'new'|'existing'
-%% Flags=List of the allowed process trace flags.
-%% RTpidsArgs=[RTpidArgEntry,...]
-%% RTpidArgEntry={RTpid,Node,Args}|{Error,Node}
-%% RTpidsArgsHow=[RTpidArgsHowEntry,...]
-%% RTpidArgsHowEntry={RTpid,Node,Args,How}|{Error,Node}
-%% How=true|false
-%% Reply={ok,Answers}
-%% Answers=[Answer,...], one for each Args and in the same order.
-%% Answer=int()|{error,Reason}
-%% API function used by the control component to send flags to a list of runtime
-%% components. Returns a list of [{Node,Answer},... ] in the same order.
-trace_flags_parallel(RTpids,Args,How) -> % Same args for every node!
- call_parallel(lists:map(fun({Pid,Node})when is_pid(Pid)->{Pid,Node,{tf,Args,How}};
- (Error)-> Error
- end,
- RTpids)).
-
-trace_flags_parallel(RTpidArgs,How) -> % Different args but same how.
- call_parallel(lists:map(fun({Pid,Node,Args})when is_pid(Pid)->
- {Pid,Node,{tf,Args,How}};
- (Error)->
- Error
- end,
- RTpidArgs)).
-
-trace_flags_parallel(RTpidArgsHow) -> % Both different args and hows.
- call_parallel(lists:map(fun({Pid,Node,Args,How})when is_pid(Pid)->
- {Pid,Node,{tf,Args,How}};
- (Error)->
- Error
- end,
- RTpidArgsHow)).
-%% ------------------------------------------------------------------------------
-
-%% meta_pattern(RTpids,Args)=[{Node,Answer},...]
-%% RTpids=[{RTpid,Node},...] or [{Error,Node},...]
-%% Args={FunctionName,ArgList}
-%% FunctionName=atom()
-%% ArgList=list(), list of the arguments to FunctionName.
-%% Answer=[Answer,...]
-%% Answer=int()|{error,Reason}
-%% Makes a call to the meta-tracer through its runtime component. Returns a list
-%% a answers in the same order as RTpids. Note that if "someone" has discovered
-%% that there is an error with a particular node, the error answer can be placed
-%% in the RTpids list from the start.
-meta_tracer_call_parallel(RTpids,Args) -> % Same args for all nodes.
- call_parallel(lists:map(fun({Pid,Node})when is_pid(Pid)->
- {Pid,Node,{meta_tracer_call,Args}};
- (Error)->
- Error
- end,
- RTpids)).
-%% ------------------------------------------------------------------------------
-
-%% get_status(Pid)={ok,{State,Status}}
-%% State=new|tracing|idle
-%% Status=running|{suspended,Reason}
-get_status(Pid) ->
- call(Pid,get_status).
-%% ------------------------------------------------------------------------------
-
-%% get_tracerdata(Pid)={ok,TracerData} | {ok,no_tracerdata} | {error,Reason}
-%% TracerData=see init_tracing
-%% Fetches the current tracerdata from the runtime component.
-get_tracerdata(Pid) ->
- call(Pid,get_tracerdata).
-%% ------------------------------------------------------------------------------
-
-%% list_log(Pid)={ok,no_log}|{ok,LogCollection}|{error,Reason}
-%% list_log(Pid,TracerData)=
-%% LogCollection=[LogTypes,...]
-%% LogTypes={trace_log,Dir,Files}|{ti_log,Dir,Files}
-%% Dir=string()
-%% Files=[FileNameWithoutDir,...]
-%% Lists all files associated with the current tracerdata. Or finds out which
-%% files there are stored in this node given a tracerdata.
-list_logs(Pid) ->
- call(Pid,list_logs).
-list_logs(Pid,TD) ->
- call(Pid,{list_logs,TD}).
-%% ------------------------------------------------------------------------------
-
-%% fetch_log(Pid,CollectPid)={ok,FetcherPid}|{complete,no_log}|{error,Reason}
-%% fetch_log(Pid,CollectPid,Spec)=
-%% CollectPid=pid(), the process which will be given the transfered logs.
-%% Spec=TracerData|LogCollection
-%% Transferes a number of files using ditributed Erlang to CollectPid. This
-%% function is supposed to be used internally by a control component. It returns
-%% when the transfer is initiated and does not mean it is done or successful.
-fetch_log(Pid,CollectPid) ->
- call(Pid,{fetch_log,CollectPid}).
-fetch_log(Pid,CollectPid,Spec) ->
- call(Pid,{fetch_log,CollectPid,Spec}).
-%% ------------------------------------------------------------------------------
-
-%% delete_log(Pid,TracerDataOrLogList)={ok,Results}|{error,Reason}
-%% TracerDataOrLogList=[FileNameWithPath,...]|LogCollection|TracerData
-%% Results=[LogType,...]
-%% LogType={trace_log,FileSpecs}|{ti_log,FilesSpecs}
-%% FilesSpecs=[FileSpec,...]
-%% FileSpec={ok,FileName}|{error,{Posix,FileName}}
-%% Filename=string(), the filename without dir-path.
-delete_log(Pid) ->
- call(Pid,delete_logs).
-delete_log(Pid,TracerDataOrLogList) ->
- call(Pid,{delete_logs,TracerDataOrLogList}).
-%% ------------------------------------------------------------------------------
-
-%% state(NodeOrPid)=LoopData
-%% Returns the loopdata of the runtime component. Only meant for debugging.
-state(NodeOrPid) ->
- call(NodeOrPid,state).
-%% ------------------------------------------------------------------------------
-
-
-%% ==============================================================================
-%% API for local calls made from the same node. E.g autostart.
-%% ==============================================================================
-
-%% init_tracing(TracerData)=
-%% See init_tracing/2.
-init_tracing(TracerData) ->
- call_regname(?MODULE,{init_tracing,TracerData}).
-%% ------------------------------------------------------------------------------
-
-
-%% Meaning that these function does most often not have to be called by a
-%% control component because there are more efficient ones above.
-
-%% tp(Module,Function,Arity,MatchSpec) ->
-%% tp(Module,Function,Arity,MatchSpec,Opts) ->
-%% tp(PatternList) ->
-%% Module = '_'|atom()|ModRegExp|{DirRegExp,ModRegExp}
-%% Function == atom() | '_'
-%% Arity = integer() | '_'
-%% MatchSpec = true | false | [] | matchspec() see ERTS User's guide for a
-%% description of match specifications.
-%% Opts=list(); 'only_loaded'
-%% PatternList = [Pattern],
-%% Pattern = {Module,Function,Arity,MatchSpec,Opts},
-%% Set trace pattern (global).
-tp(Module,Function,Arity,MatchSpec) ->
- tp(Module,Function,Arity,MatchSpec,[]).
-tp(Module,Function,Arity,MatchSpec,Opts) ->
- call_regname(?MODULE,{tp,[{Module,Function,Arity,MatchSpec,Opts}],[global]}).
-tp(PatternList) ->
- call_regname(?MODULE,{tp,PatternList,[global]}).
-%% ------------------------------------------------------------------------------
-
-tpg(Mod,Func,Arity,MatchSpec) ->
- tp(Mod,Func,Arity,MatchSpec).
-tpg(Mod,Func,Arity,MatchSpec,Opts) ->
- tp(Mod,Func,Arity,MatchSpec,Opts).
-tpg(PatternList) ->
- tp(PatternList).
-%% ------------------------------------------------------------------------------
-
-%% tpl(Module,Function,Arity,MatchSpec) ->
-%% tpl(Module,Function,Arity,MatchSpec,Opts) ->
-%% tpl(PatternList) ->
-%% Module = Function == atom() | '_' | RegExpMod | {RegExpDir,RegExpMod}
-%% Arity = integer() | '_'
-%% MatchSpec = true | false | [] | matchspec() see ERTS User's guide for a
-%% Opts=list(); 'only_loaded'
-%% description of match specifications.
-%% PatternList = [Pattern],
-%% Pattern = {Module, Function, Arity, MatchSpec},
-%% Set trace pattern (local).
-tpl(Module,Function,Arity,MatchSpec) ->
- call_regname(?MODULE,{tp,[{Module,Function,Arity,MatchSpec,[]}],[local]}).
-tpl(Module,Function,Arity,MatchSpec,Opts) ->
- call_regname(?MODULE,{tp,[{Module,Function,Arity,MatchSpec,Opts}],[local]}).
-tpl(PatternList) ->
- call_regname(?MODULE,{tp,PatternList,[local]}).
-%% ------------------------------------------------------------------------------
-
-%% ctp(Module,Function,Arity) ->
-%% ctp(PatternList)=
-%% Module = atom()|'_'|RegExpMod|{RegExpDir,RegExpMod}
-%% Function == atom() | '_'
-%% Arity = integer() | '_'
-%% PatternList=[{Mod,Func,Arity},...]
-%% Clear trace pattern (global).
-%% Note that it is possible to clear patterns using regexps. But we can for
-%% natural reasons only clear patterns for loaded modules. Further more there
-%% seems to be a fault in the emulator (<=R10B) crashing if we remove patterns
-%% for deleted modules. Therefore we use the only_loaded option.
-ctp(Module,Function,Arity) ->
- call_regname(?MODULE,{tp,[{Module,Function,Arity,false,[only_loaded]}],[global]}).
-ctp(PatternList) ->
- call_regname(?MODULE,
- {tp,
- lists:map(fun({M,F,A})->{M,F,A,false,[only_loaded]} end,PatternList),
- [global]}).
-%% ------------------------------------------------------------------------------
-
-ctpg(Mod,Func,Arity) ->
- ctp(Mod,Func,Arity).
-ctpg(PatternList) ->
- ctp(PatternList).
-%% ------------------------------------------------------------------------------
-
-%% ctpl(Module,Function,Arity) ->
-%% Module = atom()|'_'|RegExpMod|{RegExpDir,RegExpMod}
-%% Function == atom() | '_'
-%% Arity = integer() | '_'
-%% PatternList=[{Mod,Func,Arity},...]
-%% Clear trace pattern (local).
-ctpl(Module,Function,Arity) ->
- call_regname(?MODULE,{tp,[{Module,Function,Arity,false,[only_loaded]}],[local]}).
-ctpl(PatternList) ->
- call_regname(?MODULE,
- {tp,
- lists:map(fun({M,F,A})->{M,F,A,false,[only_loaded]} end,PatternList),
- [local]}).
-%% ------------------------------------------------------------------------------
-
-init_tpm(Mod,Func,Arity,CallFunc) ->
- call_regname(?MODULE,{meta_tracer_call,{init_tpm,[Mod,Func,Arity,CallFunc]}}).
-
-init_tpm(Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc) ->
- call_regname(?MODULE,
- {meta_tracer_call,
- {init_tpm,
- [Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc]}}).
-%% ------------------------------------------------------------------------------
-
-tpm(Mod,Func,Arity,MS) ->
- call_regname(?MODULE,{meta_tracer_call,{tpm,[Mod,Func,Arity,MS]}}).
-tpm(Mod,Func,Arity,MS,CallFunc) ->
- call_regname(?MODULE,{meta_tracer_call,{tpm,[Mod,Func,Arity,MS,CallFunc]}}).
-tpm(Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc) ->
- call_regname(?MODULE,
- {meta_tracer_call,
- {tpm,
- [Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc]}}).
-%% ------------------------------------------------------------------------------
-
-tpm_tracer(Mod,Func,Arity,MS) ->
- call_regname(?MODULE,{meta_tracer_call,{tpm_tracer,[Mod,Func,Arity,MS]}}).
-tpm_tracer(Mod,Func,Arity,MS,CallFunc) ->
- call_regname(?MODULE,{meta_tracer_call,{tpm_tracer,[Mod,Func,Arity,MS,CallFunc]}}).
-tpm_tracer(Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc) ->
- call_regname(?MODULE,
- {meta_tracer_call,
- {tpm_tracer,
- [Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc]}}).
-%% ------------------------------------------------------------------------------
-
-tpm_ms(Mod,Func,Arity,MSname,MS) ->
- call_regname(?MODULE,{meta_tracer_call,{tpm_ms,[Mod,Func,Arity,MSname,MS]}}).
-%% ------------------------------------------------------------------------------
-
-tpm_ms_tracer(Mod,Func,Arity,MSname,MS) ->
- call_regname(?MODULE,{meta_tracer_call,{tpm_ms_tracer,[Mod,Func,Arity,MSname,MS]}}).
-%% ------------------------------------------------------------------------------
-
-ctpm_ms(Mod,Func,Arity,MSname) ->
- call_regname(?MODULE,{meta_tracer_call,{ctpm_ms,[Mod,Func,Arity,MSname]}}).
-%% ------------------------------------------------------------------------------
-
-local_register() ->
- call_regname(?MODULE,{meta_tracer_call,{local_register,[]}}).
-%% ------------------------------------------------------------------------------
-
-global_register() ->
- call_regname(?MODULE,{meta_tracer_call,{global_register,[]}}).
-%% ------------------------------------------------------------------------------
-
-ctpm(Mod,Func,Arity) ->
- call_regname(?MODULE,{meta_tracer_call,{ctpm,[Mod,Func,Arity]}}).
-%% ------------------------------------------------------------------------------
-
-remove_local_register() ->
- call_regname(?MODULE,{meta_tracer_call,{remove_local_register,[]}}).
-%% ------------------------------------------------------------------------------
-
-remove_global_register() ->
- call_regname(?MODULE,{meta_tracer_call,{remove_global_register,[]}}).
-%% ------------------------------------------------------------------------------
-
-%% tf(PidSpec, FlagList) ->
-%% tf(TraceConfList) ->
-%% TraceConfList = [{PidSpec, FlagList}],
-%% FlagList = [Flags],
-%% PidSpec = all | new | existing | pid() | registeredname()
-%% Flags = all | send | 'receive' | procs | call | silent | return_to |
-%% running | garbage_collection | timestamp | cpu_timestamp | arity |
-%% set_on_spawn | set_on_first_spawn | set_on_link | set_on_first_link
-%% Set trace flags.
-tf(PidSpec, FlagList) ->
- call_regname(?MODULE,{tf,[{PidSpec,FlagList}],true}).
-
-tf(TraceConfList) ->
- call_regname(?MODULE,{tf,TraceConfList,true}).
-%% ------------------------------------------------------------------------------
-
-%% ctf(PidSpec, FlagList) ->
-%% ctf(TraceConfList) ->
-%% TraceConfList = [{PidSpec, FlagList}],
-%% FlagList = [Flags],
-%% PidSpec = all | new | existing | pid() | registeredname()
-%% Flags = all | send | 'receive' | procs | call | silent | return_to |
-%% running | garbage_collection | timestamp | cpu_timestamp | arity |
-%% set_on_spawn | set_on_first_spawn | set_on_link | set_on_first_link
-%% Clear trace flags.
-ctf(PidSpec, FlagList) ->
- call_regname(?MODULE,{tf,[{PidSpec,FlagList}],false}).
-
-ctf(TraceConfList) ->
- call_regname(?MODULE,{tf_as,TraceConfList,false}).
-%% ------------------------------------------------------------------------------
-
-
-%% ------------------------------------------------------------------------------
-%% Client side functions.
-%% ------------------------------------------------------------------------------
-
-%% Call function managing the client to server communication. This function may
-%% be run by a client on a different node.
-%% Note that we must use two different functions for calling a named process and
-%% calling the runtime component at a specified node.
-call(Pid,Request) when is_pid(Pid) ->
- call_2(Pid,Request);
-call(Node,Request) when Node==node() -> % To our node!
- call_2(?MODULE,Request);
-call(Node,Request) when is_atom(Node) ->
- call_2({?MODULE,Node},Request);
-call(To,_Request) ->
- {error,{badarg,To}}.
-
-call_regname(Name,Request) when is_atom(Name) -> % To a registered name.
- call_2(Name,Request).
-
-call_2(To,Request) ->
- MRef=erlang:monitor(process,To), % Use a monitor to avoid waiting for ever.
- Ref=make_ref(),
- case catch To ! {Request,self(),Ref} of % Can be a remote pid.
- {'EXIT',_} -> % If we use registered name.
- erlang:demonitor(MRef), % Maybe not necessary!?
- receive
- {'DOWN',MRef,_Type,_Obj,_Info} ->
- true
- after
- 0 ->
- true
- end,
- {error,not_started};
- _ -> % At least no obvious error.
- receive
- {Msg,Ref} ->
- erlang:demonitor(MRef),
- Msg;
- {'DOWN',MRef,_Type,_Obj,Info} -> % The runtime component disapeared.
- {error,{no_response,Info}}
- end
- end.
-%% -----------------------------------------------------------------------------
-
-%% Multicall function taking a list of [{Pid,Node,Request},...] and sends
-%% a request to every Pid. This function then also allows you to send multiple
-%% requests to the same Pid since it will sit and wait for all replies.
-%% Note that RTspec may also be an [{{error,Reason},Node},...]. That tuple will
-%% then be used as reply in the reply list.
-%% Returns [{Node,Reply},...] for every element in RTspec, in the same order.
-call_parallel(RTspec) ->
- Ref=make_ref(),
- {Nr,Pending}=call_parallel_2(RTspec,Ref,0,[]),
- Replies=call_parallel_3(Ref,Pending,Nr,[],[]),
- call_parallel_build_reply(RTspec,1,Replies).
-
-call_parallel_2([{Pid,Node,Request}|Rest],Ref,Nr,Pending) when is_pid(Pid) ->
- Pid ! {Request,self(),{Ref,Nr+1}},
- MRef=erlang:monitor(process,Pid), % So we won't wait for ever for it.
- call_parallel_2(Rest,Ref,Nr+1,[{Nr+1,Node,MRef}|Pending]);
-call_parallel_2([{{error,_Reason},_Node}|Rest],Ref,Nr,Pending) ->
- call_parallel_2(Rest,Ref,Nr,Pending); % Just skip it. This is no process.
-call_parallel_2([_Faulty|Rest],Ref,Nr,Pending) -> % Should not happend.
- call_parallel_2(Rest,Ref,Nr,Pending); % But we choose to skip it instead of crash.
-call_parallel_2([],_,Nr,Pending) ->
- {Nr,Pending}.
-
-%% Help function collecting reply-messages sent from the runtime components. We
-%% count down until we got a reply for every pending request. Or if we get a DOWN
-%% message indicating that the runtime component is no longer present. Note that
-%% we can by accident read away DOWN messages not belonging to this procedure.
-%% They are collected to be reissued after we are done.
-call_parallel_3(_Ref,_Pending,0,Replies,DownMsgs) -> % All expected received.
- lists:foreach(fun({MRef,Pid,Info}) -> self() ! {'DOWN',MRef,process,Pid,Info} end,
- DownMsgs), % Reissue the down messages!
- Replies;
-call_parallel_3(Ref,Pending,NrOfPending,Replies,DownMsgs) ->
- receive
- {Reply,{Ref,Nr}} ->
- case lists:keysearch(Nr,1,Pending) of
- {value,{_Nr,Node,MRef}} ->
- erlang:demonitor(MRef),
- call_parallel_3(Ref,Pending,NrOfPending-1,
- [{Nr,Node,Reply}|Replies],DownMsgs);
- false -> % Really strange!
- call_parallel_3(Ref,Pending,NrOfPending,Replies,DownMsgs)
- end;
- {'DOWN',MRef,process,Pid,Info} -> % Probably process we monitor terminated.
- case lists:keysearch(MRef,3,Pending) of
- {value,{Nr,Node,_}} -> % Yes it was one of our processes.
- call_parallel_3(Ref,Pending,NrOfPending-1,
- [{Nr,Node,{error,no_reponse}}|Replies],DownMsgs);
- false -> % We picked up a DOWN msg by misstake.
- call_parallel_3(Ref,Pending,NrOfPending,Replies,
- [{MRef,Pid,Info}|DownMsgs])
- end
- end.
-
-%% Help function which build up the [{Node,Reply},...] list in the same order as RTspec.
-call_parallel_build_reply([],_,_) ->
- [];
-call_parallel_build_reply([{Pid,Node,_Request}|Rest],Nr,Replies) when is_pid(Pid) ->
- {value,{_Nr,_Node,Reply}}=lists:keysearch(Nr,1,Replies),
- [{Node,Reply}|call_parallel_build_reply(Rest,Nr+1,Replies)];
-call_parallel_build_reply([{{error,Reason},Node}|Rest],Nr,Replies) ->
- [{Node,{error,Reason}}|call_parallel_build_reply(Rest,Nr,Replies)];
-call_parallel_build_reply([_Faulty|Rest],Nr,Replies) ->
- call_parallel_build_reply(Rest,Nr,Replies).
-%% ------------------------------------------------------------------------------
-
-cast(Pid,Request) when is_pid(Pid) ->
- cast2(Pid,Request);
-cast(Node,Request) when Node==node() ->
- catch cast2(?MODULE,Request),
- ok;
-cast(Node,Request) when is_atom(Node) ->
- catch cast2({?MODULE,Node},Request),
- ok;
-cast(BadAddress,_Request) ->
- {error,{badarg,BadAddress}}.
-
-cast2(To,Request) ->
- To ! {Request,void,void}. % Mimics the call protocol.
-%% ------------------------------------------------------------------------------
-
-
-%% ==============================================================================
-%% Implementation of the runtime component (server side).
-%% ==============================================================================
-
-%% Since the runtime component is not implemented using gen_sever we are "free"
-%% to use what ever functionnames we like.
-
-%% Initial function on which the runtime component is spawned on if started by
-%% a controlcomponent.
-init(Ctrl, Options, Tag, Parent) when is_list(Options) ->
- %% started from controller
- process_flag(trap_exit,true),
- register(?MODULE,self()), % Will crash if rt is already running
- do_clear_trace_patterns(), % Remove potential old patterns left.
- LD1=read_option_list(Options,
- #rt{state=new,
- parent=Parent,
- ctrl=Ctrl,
- vsn=get_application_vsn(),
- tag=Tag}),
- OverloadData=initialize_overload(LD1),
- CtrlRef=erlang:monitor(process,Ctrl), % Monitor our control component.
- loop1(LD1#rt{ctrl_ref=CtrlRef,overload_data=OverloadData}).
-%% ----------------------------------------------------------------------------
-
-%% Initial function on which the runtime component is spawned on if started
-%% by the runtime_tools supervisor. It is here it is determined if we shall
-%% autostart.
-auto_init(AutoModArgs,Parent) ->
- %% autostart
- process_flag(trap_exit, true),
- register(?MODULE, self()), % Will crash if a rt is already running
- AutoMod=get_autostart_module(), % Determine which module to use!
- case catch AutoMod:autostart(AutoModArgs) of
- {MFA,Options,Tag} ->
- do_clear_trace_patterns(), % Remove previously left patterns.
- LD1=read_option_list(Options,#rt{state=new,
- parent=Parent,
- vsn=get_application_vsn(),
- tag=Tag}),
- case auto_init_connect_control(LD1) of
- {ok,LD2} -> % Either connected or running_alone.
- OverloadData=initialize_overload(LD2),
- case auto_init_check_mfa(MFA) of
- {ok,{M,F,A}} -> % We shall start somekind of tracing!
- P=spawn_link(M,F,A), % It lives its own life, only link!
- loop1(LD2#rt{auto_starter=P,overload_data=OverloadData});
- false ->
- loop1(LD2#rt{overload_data=OverloadData})
- end;
- stop -> % Not allowed to run alone!
- true % Simply terminate.
- end;
- _ -> % Non existent or faulty autostart mod!
- true % Terminate normally.
- end.
-
-auto_init_connect_control(LD1) ->
- case auto_init_connect_find_pid(LD1#rt.dependency) of
- Pid when is_pid(Pid) -> % There is a control component.
- CtrlRef=erlang:monitor(process,Pid),
- Pid ! {connect,node(),self(),LD1#rt.vsn,LD1#rt.tag},
- {ok,LD1#rt{ctrl_ref=CtrlRef,ctrl=Pid}};
- _ -> % There is no control component.
- do_down_message(LD1) % Will return 'stop' or a LoopData.
- end.
-
-%% Help function which finds the pid of the control component.
-auto_init_connect_find_pid({_TimeOut,Node}) when Node==node() ->
- whereis(?CTRL);
-auto_init_connect_find_pid({_TimeOut,Node}) when is_atom(Node) ->
- rpc:call(Node,erlang,whereis,[?CTRL]);
-auto_init_connect_find_pid(_) -> % Node is not a proper node.
- undefined. % Act as could not find control comp.
-
-%% Help function checking that the parameter is reasonable to be used as
-%% spawn_link argument.
-auto_init_check_mfa({M,F,A}) when is_atom(M),is_atom(F),is_list(A) ->
- {ok,{M,F,A}};
-auto_init_check_mfa(_) ->
- false.
-
-%% Help function to init_auto which finds out which module to call for
-%% guidance on how to proceed. Returns an atom.
-get_autostart_module() ->
- case application:get_env(inviso_autostart_mod) of
- {ok,Mod} when is_atom(Mod) ->
- Mod;
- _ ->
- inviso_autostart % The default autostart module.
- end.
-%% ----------------------------------------------------------------------------
-
-
-%% This is the preloop function which performs loadcheck if necessary. Note
-%% that it calculates the timeout used in the after in the real loop. There is
-%% further no use doing overload checks if we are not tracing or already
-%% suspended. There is yet one more situation, we do not want to perform
-%% overload checks if the interval is set to infinity. This can be the case if
-%% we are using an external source pushing overload information instead.
-loop1(LD=#rt{overload=Overload}) ->
- if
- Overload/=?NO_LOADCHECK,element(2,Overload)/=infinity ->
- Now=now(),
- if
- LD#rt.status==running,
- LD#rt.state==tracing,
- Now>LD#rt.next_loadcheck -> % Do loadcheck only then!
- {NewLD,TimeOut}=do_check_overload(LD,{timeout,LD#rt.overload_data}),
- loop(NewLD,TimeOut);
- LD#rt.status==running,LD#rt.state==tracing ->
- Timeout=calc_diff_to_now(Now,LD#rt.next_loadcheck),
- loop(LD,Timeout);
- true -> % Do not spend CPU on this! :-)
- loop(LD,infinity)
- end;
- true -> % Either no check or infinity.
- loop(LD,infinity)
- end.
-
-loop(LoopData,Timeout) ->
- receive
- Msg when element(1,Msg)==trace_ts;
- element(1,Msg)==trace;
- element(1,Msg)==drop;
- element(1,Msg)==seq_trace ->
- case LoopData#rt.handler of
- {HandlerFun,Data} ->
- NewData=HandlerFun(Msg,Data),
- loop1(LoopData#rt{handler={HandlerFun,NewData}});
- _ ->
- loop1(LoopData)
- end;
- {{tp,Args,Flags},From,Ref} ->
- if
- LoopData#rt.status==running -> % Not when suspended.
- Reply=do_set_trace_patterns(Args,Flags),
- if
- LoopData#rt.state==new -> % No longer new when tp set.
- reply_and_loop({ok,Reply},From,Ref,LoopData#rt{state=idle});
- true ->
- reply_and_loop({ok,Reply},From,Ref,LoopData)
- end;
- true -> % We are suspended!
- reply_and_loop({error,suspended},From,Ref,LoopData)
- end;
- {{tf,Args,How},From,MRef} ->
- Reply=
- case How of
- true ->
- if
- LoopData#rt.status==running ->
- case {LoopData#rt.tracer_port,LoopData#rt.handler} of
- {Port,_} when is_port(Port) ->
- do_set_trace_flags(Port,Args,How);
- {_,{Handler,_D}} when is_function(Handler) ->
- do_set_trace_flags(self(),Args,How);
- _ ->
- {error,no_tracer}
- end;
- true -> % Can't turn *on* flags if suspended.
- {error, suspended}
- end;
- false -> % No tracer needed when turning off.
- do_set_trace_flags(void,Args,How)
- end,
- reply_and_loop(Reply,From,MRef,LoopData);
- {{meta_tracer_call,Args},From,MRef} ->
- if
- LoopData#rt.status==running ->
- case LoopData#rt.meta_tracer of
- MPid when is_pid(MPid) ->
- Reply=do_meta_pattern(MPid,Args),
- reply_and_loop(Reply,From,MRef,LoopData);
- _ ->
- reply_and_loop({error,no_metatracer},From,MRef,LoopData)
- end;
- true ->
- reply_and_loop({error,suspended},From,MRef,LoopData)
- end;
- {clear_all_tp,From,MRef} ->
- do_clear_trace_patterns(),
- reply_and_loop(ok,From,MRef,LoopData);
- {{init_tracing,TracerData},From,MRef} ->
- {NewLoopData,Reply}=
- if
- LoopData#rt.status==running ->
- if
- LoopData#rt.state==tracing ->
- {LoopData,{error,already_initiated}};
- true -> % Otherwise, try to init-tracing!
- case translate_td(TracerData) of
- {ok,LogTD,MetaTD} ->
- do_init_tracing(LoopData,TracerData,LogTD,MetaTD);
- Error ->
- {LoopData,Error}
- end
- end;
- true -> % Can't init tracing if not running.
- {LoopData,{error,suspended}}
- end,
- reply_and_loop(Reply,From,MRef,NewLoopData);
- {stop_tracing,From,MRef} ->
- case LoopData#rt.state of
- tracing -> % Only case we need to do anything.
- reply_and_loop({ok,idle},From,MRef,do_stop_tracing(LoopData));
- idle -> % Already idle!
- reply_and_loop({ok,idle},From,MRef,LoopData);
- new -> % Have actually never traced!
- reply_and_loop({ok,new},From,MRef,LoopData)
- end;
- {{suspend,Reason},From,MRef} ->
- if
- LoopData#rt.status==running ->
- NewLD=do_suspend(LoopData,Reason),
- reply_and_loop(ok,From,MRef,NewLD);
- true -> % No need suspend if not running!
- reply_and_loop(ok,From,MRef,LoopData)
- end;
- {cancel_suspension,From,MRef} ->
- NewLoopData=LoopData#rt{status=running,next_loadcheck=now()},
- send_event(state_change,NewLoopData),
- reply_and_loop(ok,From,MRef,NewLoopData);
- {{clear,Options},From,MRef} ->
- NewLoopData=do_clear(LoopData,Options),
- reply_and_loop({ok,{new,NewLoopData#rt.status}},From,MRef,NewLoopData);
- {flush,From,MRef} ->
- case LoopData#rt.state of
- tracing -> % Can only flush if we are tracing.
- if
- is_port(LoopData#rt.tracer_port) ->
- trace_port_control(LoopData#rt.tracer_port,flush),
- reply_and_loop(ok,From,MRef,LoopData);
- true -> % Not necessary but lets pretend.
- reply_and_loop(ok,From,MRef,LoopData)
- end;
- State ->
- reply_and_loop({error,{not_tracing,State}},From,MRef,LoopData)
- end;
- {list_logs,From,MRef} ->
- TracerData=LoopData#rt.tracerdata, % Current tracerdata.
- if
- TracerData/=undefined -> % There is tracerdata!
- reply_and_loop(do_list_logs(TracerData),From,MRef,LoopData);
- true -> % Have no current tracerdata!
- reply_and_loop({error,no_tracerdata},From,MRef,LoopData)
- end;
- {{list_logs,TracerData},From,MRef} ->
- reply_and_loop(do_list_logs(TracerData),From,MRef,LoopData);
- {{fetch_log,CollectPid},From,MRef} -> % Fetch according to current tracerdata.
- TracerData=LoopData#rt.tracerdata, % Current tracerdata.
- if
- TracerData/=undefined -> % There is tracerdata!
- {Reply,NewLD}=do_fetch_log(LoopData,CollectPid,TracerData),
- reply_and_loop(Reply,From,MRef,NewLD);
- true -> % No tracerdata!
- reply_and_loop({error,no_tracerdata},From,MRef,LoopData)
- end;
- {{fetch_log,CollectPid,Spec},From,MRef} -> % Either list of files or tracerdata.
- {Reply,NewLD}=do_fetch_log(LoopData,CollectPid,Spec),
- reply_and_loop(Reply,From,MRef,NewLD);
- {delete_logs,From,MRef} ->
- if
- LoopData#rt.state==tracing -> % Can't remove then!
- reply_and_loop({error,tracing},From,MRef,LoopData);
- true ->
- TracerData=LoopData#rt.tracerdata,
- reply_and_loop(do_delete_logs(TracerData),From,MRef,LoopData)
- end;
- {{delete_logs,TracerDataOrLogList},From,MRef} ->
- if
- LoopData#rt.state==tracing -> % Can't remove then!
- reply_and_loop({error,tracing},From,MRef,LoopData);
- true ->
- reply_and_loop(do_delete_logs(TracerDataOrLogList),From,MRef,LoopData)
- end;
- {get_node_info,From,MRef} ->
- Reply=collect_node_info(LoopData),
- reply_and_loop(Reply,From,MRef,LoopData);
- {{try_to_adopt,Tag,Condition},From,MRef} ->
- if
- LoopData#rt.ctrl_ref==undefined -> % We have no control component.
- {Reply,NewLoopData}=do_try_to_adopt(Tag,Condition,LoopData,From),
- reply_and_loop(Reply,From,MRef,NewLoopData);
- true -> % We already have a control component.
- reply_and_loop({error,refused},From,MRef,LoopData)
- end;
- {{confirm_connection,_Tag},From,MRef} ->
- if
- LoopData#rt.ctrl==From -> % It must be from this process!
- Reply=collect_node_info(LoopData),
- reply_and_loop(Reply,From,MRef,LoopData);
- true -> % Strange, some one is joking?
- reply_and_loop({error,refused},From,MRef,LoopData)
- end;
- {{change_options,Options},From,MRef} ->
- case do_change_options(Options,LoopData) of
- stop -> % Can't run alone with these options!
- terminate_overload(LoopData),
- From ! {ok,MRef}; % Don't care if From not a proper pid!
- NewLoopData when is_record(NewLoopData,rt) ->
- reply_and_loop(ok,From,MRef,NewLoopData)
- end;
- {get_status,From,MRef} ->
- Reply={ok,{LoopData#rt.state,LoopData#rt.status}},
- reply_and_loop(Reply,From,MRef,LoopData);
- {get_tracerdata,From,MRef} ->
- case LoopData#rt.tracerdata of
- undefined ->
- reply_and_loop({ok,no_tracerdata},From,MRef,LoopData);
- TracerData ->
- reply_and_loop({ok,TracerData},From,MRef,LoopData)
- end;
- {state,From,MRef} -> % For debugging purposes.
- reply_and_loop(LoopData,From,MRef,LoopData);
-
- {'DOWN',CtrlRef,process,_,_} when CtrlRef==LoopData#rt.ctrl_ref ->
- case do_down_message(LoopData) of
- stop -> % inviso_c gone and we must stop!
- terminate_overload(LoopData),
- exit(running_alone);
- {ok,NewLoopData} ->
- loop1(NewLoopData)
- end;
- {'EXIT',Pid,Reason} ->
- case act_on_exit(Pid,Reason,LoopData) of
- exit ->
- terminate_overload(LoopData),
- exit(Reason);
- NewLoopData when is_record(NewLoopData,rt) ->
- loop1(NewLoopData);
- {NewLoopData,NewTimeOut} when is_record(NewLoopData,rt) ->
- loop(NewLoopData,NewTimeOut)
- end;
- Other -> % Check if it concerns overload.
- if
- LoopData#rt.overload/=?NO_LOADCHECK,
- LoopData#rt.status==running,
- LoopData#rt.state==tracing ->
- {NewLD,NewTimeOut}=
- do_check_overload(LoopData,
- {msg,{Other,LoopData#rt.overload_data}}),
- loop(NewLD,NewTimeOut);
- true ->
- NewTimeOut=calc_diff_to_now(now(),LoopData#rt.next_loadcheck),
- loop(LoopData,NewTimeOut)
- end
- after
- Timeout ->
- loop1(LoopData)
- end.
-
-reply_and_loop(Reply,To,MRef,LoopData) when is_pid(To) ->
- To ! {Reply,MRef},
- loop1(LoopData);
-reply_and_loop(_,_,_,LoopData) -> % Used together with incoming casts.
- loop1(LoopData).
-%% -----------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% File transfer process implementation.
-%% =============================================================================
-
-%% Files that are to to be transfered from the runtime component to the control
-%% component are done so by reading them as binaries and sending them with
-%% normal message passing (over distributed Erlang).
-%% Reading the files are done in a process separate to the runtime component,
-%% to both make the code more simple. But also to free up the runtime component.
-%%
-%% This help process must be capable of recognizing the fact that the runtime
-%% component has been suspended, and then of course also discontinue any file
-%% transfere.
-fetch_init(Parent,Files,CollectPid,ChunkSize) ->
- process_flag(trap_exit,true), % We must clean-up.
- process_flag(priority,low), % Lets be careful.
- case fetch_open_file(Files,CollectPid) of
- {ok,FileName,FD,RestFiles} ->
- MRef=erlang:monitor(process,CollectPid),
- fetch_loop(Parent,RestFiles,CollectPid,ChunkSize,FileName,FD,MRef);
- done ->
- fetch_end(CollectPid);
- error ->
- fetch_incomplete(CollectPid)
- end.
-
-fetch_loop(Parent,Files,CollectPid,ChunkSize,FName,FD,MRef) ->
- receive
- {suspend,Parent} -> % The runtime component is suspended.
- file:close(FD), % We must clean-up.
- fetch_incomplete(CollectPid);
- {'DOWN',MRef,process,_,_} -> % The CollectPid terminated!
- file:close(FD); % Close file and terminate.
- {'EXIT',Parent,_Reason} -> % The runtime component terminated.
- file:close(FD),
- fetch_incomplete(CollectPid);
- _ ->
- fetch_loop(Parent,Files,CollectPid,ChunkSize,FName,FD,MRef)
- after
- 0 -> % If non of the above, get to work!
- case file:read(FD,ChunkSize) of
- {ok,Bin} ->
- fetch_send_chunk(CollectPid,Bin),
- case fetch_wait_for_chunk_ack(CollectPid,MRef) of
- ok -> % Collector ready to receive next chunk.
- fetch_loop(Parent,Files,CollectPid,ChunkSize,FName,FD,MRef);
- cancel -> % Send no more files!
- file:close(FD), % Close file, send incomplete, terminate!
- fetch_incomplete(CollectPid);
- 'DOWN' -> % Collector has terminate, stop!
- file:close(FD) % Close file and terminate.
- end;
- eof -> % Ok, go on with the next file.
- file:close(FD),
- fetch_send_eof(CollectPid),
- case fetch_open_file(Files,CollectPid) of
- {ok,NewFName,NewFD,RestFiles} ->
- fetch_loop(Parent,RestFiles,CollectPid,
- ChunkSize,NewFName,NewFD,MRef);
- done ->
- fetch_end(CollectPid);
- error ->
- fetch_incomplete(CollectPid)
- end;
- {error,Reason} -> % Do not continue.
- file:close(FD),
- fetch_send_readerror(CollectPid,FName,Reason),
- fetch_incomplete(CollectPid)
- end
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function which opens the next file to be transferred. It also communicates
-%% the opening of the file to the collector process.
-%% We know here that it will be a list of three-tuples. But there is no guarantee
-%% that Dir or FileName are proper strings.
-%% Returns {ok,FileName,FileDescriptor,RemainingFiles} or 'done'.
-fetch_open_file([{FType,Dir,FileName}|RestFiles],CollectPid) ->
- case catch file:open(filename:join(Dir,FileName),[read,raw,binary]) of
- {ok,FD} ->
- CollectPid ! {node(),open,{FType,FileName}},
- {ok,FileName,FD,RestFiles};
- {error,_Reason} ->
- CollectPid ! {node(),open_failure,{FType,FileName}},
- error;
- {'EXIT',_Reason} -> % Faulty Dir or FileName.
- CollectPid ! {node(),open_failure,{FType,FileName}},
- error
- end;
-fetch_open_file([],_CollectPid) ->
- done.
-%% -----------------------------------------------------------------------------
-
-%% A group of help functions sending information to the collector process.
-%% Returns nothing significant.
-fetch_send_chunk(CollectPid,Bin) ->
- CollectPid ! {node(),payload,Bin,self()}.
-%% -----------------------------------------------------------------------------
-
-fetch_send_eof(CollectPid) ->
- CollectPid ! {node(),end_of_file}.
-%% -----------------------------------------------------------------------------
-
-fetch_end(CollectPid) ->
- CollectPid ! {node(),end_of_transmission}.
-%% -----------------------------------------------------------------------------
-
-fetch_send_readerror(CollectPid,FName,Reason) ->
- CollectPid ! {node(),{error,{file_read,{Reason,FName}}}}.
-%% -----------------------------------------------------------------------------
-
-fetch_incomplete(CollectPid) ->
- CollectPid ! {node(),incomplete}.
-%% -----------------------------------------------------------------------------
-
-%% Help function waiting for the collector to respond that it is ready to receive
-%% the next chunk. This is in order to exercise flow control protecting the
-%% collector to get swamped if the node where the collector runs is busy.
-fetch_wait_for_chunk_ack(CollectPid,MRef) ->
- receive
- {CollectPid,chunk_ack} ->
- ok;
- {CollectPid,cancel_transmission} -> % Some problem at collector side.
- cancel;
- {'DOWN',MRef,process,_,_} -> % The collector terminated.
- 'DOWN'
- end.
-%% -----------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% First level do-functions, called from the main server loop on incomming
-%% requests.
-%% =============================================================================
-
-%% Function performing the overload check. Returns {NewLoopData,TimeOut}.
-%% Note that this function may also cause a suspend to be carried out if the
-%% loadcheck turns out negative.
-do_check_overload(LD,Data) ->
- case do_check_overload_2(LD#rt.overload,Data) of
- ignore -> % Load check not performed.
- {LD,calc_diff_to_now(now(),LD#rt.next_loadcheck)};
- {ok,Interval} -> % No problem, continue.
- NextLoadCheck=add_to_now(now(),Interval),
- {LD#rt{next_loadcheck=NextLoadCheck},Interval};
- {suspend,Reason} -> % Emergency! suspend, suspend!
- NewLD=do_suspend(LD,Reason),
- {NewLD,infinity}; % No need to do load-checks now!
- {new,NewData,Interval} -> % The overload was restarted or something.
- NextLoadCheck=add_to_now(now(),Interval),
- {LD#rt{overload_data=NewData,next_loadcheck=NextLoadCheck},Interval};
- error -> % Inhibit overload check then.
- {LD#rt{overload=?NO_LOADCHECK},infinity}
- end.
-
-%% Help function performing an overload check. Returns {ok,Interval},
-%% {suspend,Reason}, 'error' ir 'ignore'.
-do_check_overload_2({{Mod,Func},Interval,_,_},Data) ->
- do_check_overload_3(Interval,catch Mod:Func(Data));
-do_check_overload_2({Fun,Interval,_,_},Data) when is_function(Fun) ->
- do_check_overload_3(Interval,catch Fun(Data));
-do_check_overload_2(_,_) -> % Bad loadcheck configuration.
- error. % Stop using load checks then.
-
-do_check_overload_3(Interval,ok) ->
- {ok,Interval};
-do_check_overload_3(Interval,{new,NewData}) ->
- {new,NewData,Interval};
-do_check_overload_3(_Interval,{suspend,Reason}) ->
- {suspend,Reason};
-do_check_overload_3(_Interval,ignore) -> % Loadcheck not triggered.
- ignore;
-do_check_overload_3(_Interval,_) -> % Failure or other return value.
- error. % Stop doing loadchecks from now on.
-%% ------------------------------------------------------------------------------
-
-%% Function setting the trace-pattern according to Args and Flags. Note that
-%% Args can contain regexps which must be expanded here.
-%% Returns a list: [Result], where Result can be: int()|{error,Reason}.
-%% Sometimes an error tuple will represent an entire pattern, sometimes the
-%% pattern will expand to a number of error-tuples.
-do_set_trace_patterns(Args,Flags) ->
- Replies=do_set_trace_patterns_2(Args,Flags,[]),
- lists:reverse(Replies).
-
-do_set_trace_patterns_2([{M,F,Arity,MS}|Rest],Flags,Replies) -> % Option-less.
- do_set_trace_patterns_2([{M,F,Arity,MS,[]}|Rest],Flags,Replies);
-do_set_trace_patterns_2(Mlist = [{M,F,Arity,MS,Opts}|Rest],Flags,Replies) when is_atom(M) ->
- case length(Mlist) rem 10 of
- 0 ->
- timer:sleep(100);
- _ ->
- ok
- end,
- %% sleep 100 ms for every 10:th element in the list to let other
- %% processes run since this is a potentially
- %% heavy operation that might result in an unresponsive Erlang VM for
- %% several seconds otherwise
- case load_module_on_option(M,Opts) of
- true -> % Already present, loaded or no option!
- case catch erlang:trace_pattern({M,F,Arity},MS,Flags) of
- No when is_integer(No) ->
- do_set_trace_patterns_2(Rest,Flags,[No|Replies]);
- {'EXIT',Reason} ->
- do_set_trace_patterns_2(Rest,
- Flags,
- [{error,{bad_trace_args,[{M,F,Arity,MS},Reason]}}|
- Replies])
- end;
- false -> % Module not present, or not found!
- do_set_trace_patterns_2(Rest,Flags,[0|Replies])
- end;
-do_set_trace_patterns_2([{M,F,Arity,MS,Opts}|Rest],Flags,Replies) when is_list(M) ->
- do_set_trace_patterns_2([{{void,M},F,Arity,MS,Opts}|Rest],Flags,Replies);
-do_set_trace_patterns_2([{{Dir,M},F,Arity,MS,Opts}|Rest],Flags,Replies)
- when is_list(Dir),is_list(M) ->
- case check_pattern_parameters('_',F,Arity,MS) of % We don't want to repeat bad params.
- true ->
- case inviso_rt_lib:expand_regexp(Dir,M,Opts) of % Get a list of real modulnames.
- Mods when is_list(Mods) ->
- MoreReplies=
- do_set_trace_patterns_2(lists:map(fun(Mod)->
- {Mod,F,Arity,MS,Opts}
- end,
- Mods),
- Flags,
- Replies),
- do_set_trace_patterns_2(Rest,Flags,MoreReplies);
- {error,Reason} ->
- do_set_trace_patterns_2(Rest,Flags,[{error,Reason}|Replies])
- end;
- false -> % Bad pattern parameters.
- do_set_trace_patterns_2(Rest,
- Flags,
- [{error,{bad_trace_args,{M,F,Arity,MS}}}|Replies])
- end;
-do_set_trace_patterns_2([Arg|Rest],Flags,Replies) ->
- do_set_trace_patterns_2(Rest,Flags,[{error,{bad_trace_args,Arg}}|Replies]);
-do_set_trace_patterns_2([],_Flags,Replies) ->
- Replies.
-%% -----------------------------------------------------------------------------
-
-%% Help function which sets the trace flags for all processes specifed in Args.
-%% Args shall be a list of {ProcessSpecification,ProcessTraceFlags}.
-%% Returns {ok,Answers} where Answers is a list of integer and error descriptions.
-%% Note that a process specification may be a particular pid or a {global,Name}.
-%% In the case the process does not exist we will fake a zero instead of an
-%% error.
-do_set_trace_flags(Tracer,Args,How) ->
- Fun=fun({Proc,Flags}) ->
- case check_traceflag_pidspec(Proc) of
- {ok,Proc2} -> % Reg-names converted.
- case check_flags(Flags) of
- Flags2 when is_list(Flags2) -> % No error!
- case (catch
- case How of
- true ->
- erlang:trace(Proc2,
- true,
- [{tracer,Tracer}|Flags2]);
- false -> % No tracer of turning off.
- erlang:trace(Proc2,
- false,
- Flags2)
- end) of
- N when is_integer(N) ->
- N;
- {'EXIT',Reason} ->
- if
- is_pid(Proc2) ->
- 0; % Proc2 not alive or not at this node!
- true -> % Otherwise, just error!
- {error,
- {bad_trace_args,
- [Reason,Proc2,How,Flags2,Tracer]}}
- end
- end;
- FlagError ->
- FlagError
- end;
- false -> % Skip it.
- 0; % Indicate that zero processes matched.
- {error,Reason} -> % Bad process specification.
- {error,{bad_process,[Reason,Proc]}}
- end;
- (Faulty) ->
- {error,{bad_process,Faulty}}
- end,
- {ok,lists:map(Fun,Args)}.
-%% ------------------------------------------------------------------------------
-
-%% Function calling API:s in the trace information server. Note that we have
-%% given the responsibility to form a correct functionsname and argument list
-%% to the caller.
-%% Returns whatever the called function returns.
-do_meta_pattern(MPid,{FuncName,ArgList}) ->
- case catch apply(inviso_rt_meta,FuncName,[MPid|ArgList]) of
- {'EXIT',_Reason} ->
- {error,{badarg,{FuncName,ArgList}}};
- Result ->
- Result
- end;
-do_meta_pattern(_MPid,BadArgs) ->
- {error,{bad_args,BadArgs}}.
-%% ------------------------------------------------------------------------------
-
-%% Function removing *all* patterns. Beaware that the one for local patterns
-%% causes a walkthrough of all loaded modules.
-do_clear_trace_patterns() ->
- erlang:trace_pattern({'_','_','_'},false,[local]), %% inc. meta, call_count
- erlang:trace_pattern({'_','_','_'},false,[global]).
-%% ------------------------------------------------------------------------------
-
-%% Function that takes TracerData and initializes the tracing. That can be
-%% opening appropriate logfiles, starting meta-tracer. There must be one
-%% clause here for every "type" of logging we want to be able to do.
-%% Returns the Reply to be forwarded to the caller.
-do_init_tracing(LoopData,TD,{HandlerFun,Data},TiTD) when is_function(HandlerFun) ->
- {NewLoopData,Reply}=
- case do_init_metatracing(TiTD,self()) of
- {ok,MetaPid} ->
- {LoopData#rt{handler={HandlerFun,Data},
- tracerdata=TD,
- meta_tracer=MetaPid,
- state=tracing},
- {ok,[{trace_log,ok},{ti_log,ok}]}};
- false -> % No meta tracing requested.
- {LoopData#rt{handler={HandlerFun,Data},
- tracerdata=TD,
- state=tracing},
- {ok,[{trace_log,ok}]}};
- {error,Reason} -> % Problems starting meta tracing.
- {LoopData#rt{handler={HandlerFun,Data},
- tracerdata=TD,
- state=tracing},
- {ok,[{trace_log,ok},{ti_log,{error,Reason}}]}}
- end,
- send_event(state_change,NewLoopData), % Send to subscribing processes.
- {NewLoopData,Reply};
-do_init_tracing(LoopData,TD,{Type,Parameters},TiTD) when Type==ip;Type==file ->
- case check_traceport_parameters(Type,Parameters) of
- ok ->
- case catch trace_port(Type,Parameters) of
- Fun when is_function(Fun) ->
- case catch Fun() of
- Port when is_port(Port) -> % Ok, our trace-port is open.
- {NewLoopData,Reply}=
- case do_init_metatracing(TiTD,Port) of
- {ok,MetaPid} ->
- {LoopData#rt{tracer_port=Port,
- tracerdata=TD,
- meta_tracer=MetaPid,
- state=tracing},
- {ok,[{trace_log,ok},{ti_log,ok}]}};
- false -> % No meta tracing requested.
- {LoopData#rt{tracer_port=Port,
- tracerdata=TD,
- state=tracing},
- {ok,[{trace_log,ok}]}};
- {error,Reason} -> % Problems starting meta tracing.
- {LoopData#rt{tracer_port=Port,
- tracerdata=TD,
- state=tracing},
- {ok,[{trace_log,ok},{ti_log,{error,Reason}}]}}
- end,
- send_event(state_change,NewLoopData),
- {NewLoopData,Reply};
- {'EXIT',Reason} ->
- {LoopData,{error,{bad_port_fun,[Parameters,Reason]}}}
- end;
- {'EXIT',Reason} ->
- {LoopData,{error,{bad_port_args,[Parameters,Reason]}}}
- end;
- {error,Reason} -> % Bad traceport parameters.
- {LoopData,{error,Reason}}
- end.
-
-%% Help function that starts the meta-tracing. Note that the runtime component
-%% will becom linked to it.
-%% Currently the meta tracer handles two types, 'file' and 'relay'.
-%% Note that Tracer tells the meta tracer where regular trace messages shall be
-%% sent. This is because the meta tracer is capable of appending a {tracer,Tracer}
-%% action term to meta match specs.
-do_init_metatracing(LogSpec={_Type,_Arg},Tracer) ->
- case inviso_rt_meta:start(LogSpec,Tracer) of
- {ok,MetaPid} ->
- {ok,MetaPid};
- {error,Reason} ->
- {error,Reason}
- end;
-do_init_metatracing({Type,Arg,{InitPublLDmfa,RemovePublLDmf,CleanPublLDmf}},Tracer)->
- case inviso_rt_meta:start({Type,Arg},Tracer,InitPublLDmfa,RemovePublLDmf,CleanPublLDmf) of
- {ok,MetaPid} ->
- {ok,MetaPid};
- {error,Reason} ->
- {error,Reason}
- end;
-do_init_metatracing(void,_) -> % Means no meta tracer.
- false.
-%% -----------------------------------------------------------------------------
-
-%% Function that stops all tracing and closes all open files. This function
-%% can't fail :-) It tries as hard as it can.
-%% This function also kills the autostarter process if one exists. Otherwise it
-%% will not be possible from a control component to end an ongoing autostarted
-%% tracing.
-%% Returns a new loopdata structure since stopping tracing involves updating it.
-do_stop_tracing(LoopData) ->
- do_stop_tracing_kill_autostarter(LoopData#rt.auto_starter),
- do_clear_trace_flags(), % Do not generate any more traces.
- NewLoopData1=do_stop_tracing_tracelog(LoopData),
- NewLoopData2=do_stop_tracing_metatracing(NewLoopData1),
- NewLoopData3=NewLoopData2#rt{state=idle,auto_starter=undefined},
- send_event(state_change,NewLoopData3),
- NewLoopData3.
-
-do_stop_tracing_tracelog(LoopData=#rt{tracer_port=Port}) when is_port(Port) ->
- trace_port_control(Port,flush), % Write buffered trace messages.
- catch port_close(Port),
- LoopData#rt{tracer_port=undefined};
-do_stop_tracing_tracelog(LoopData) ->
- LoopData#rt{handler=undefined}.
-
-do_stop_tracing_metatracing(LoopData=#rt{meta_tracer=MPid}) when is_pid(MPid) ->
- inviso_rt_meta:stop(MPid),
- LoopData#rt{meta_tracer=undefined};
-do_stop_tracing_metatracing(LoopData) -> % No meta tracer running!
- LoopData.
-
-%% Help function killing the autostarter, if one is active.
-do_stop_tracing_kill_autostarter(P) when is_pid(P) ->
- exit(P,stop_tracing);
-do_stop_tracing_kill_autostarter(_) -> % No autostarter, do nothing.
- true.
-%% -----------------------------------------------------------------------------
-
-%% Help function implementing suspending the runtime component.
-%% Returns a new loopdata structure.
-do_suspend(LD,Reason) ->
- do_clear_trace_flags(), % If no process flags, no output!
- do_suspend_metatracer(LD#rt.meta_tracer),
- do_suspend_fetchers(LD#rt.fetchers),
- do_stop_tracing_kill_autostarter(LD#rt.auto_starter),
- NewLD=LD#rt{fetchers=[],status={suspended,Reason},auto_starter=undefined},
- send_event(state_change,NewLD), % Notify subscribers.
- NewLD.
-
-do_suspend_metatracer(MetaTracer) when is_pid(MetaTracer) ->
- inviso_rt_meta:suspend(MetaTracer); % This makes it suspended.
-do_suspend_metatracer(_) ->
- true.
-
-do_suspend_fetchers([FetcherPid|Rest]) ->
- FetcherPid ! {suspend,self()}, % This makes it terminate.
- do_suspend_fetchers(Rest);
-do_suspend_fetchers([]) ->
- true.
-%% ------------------------------------------------------------------------------
-
-%% Function that stops all tracing, removes all trace-patterns and removes all
-%% logfiles. The idea is to return the runtime component to the 'new' state.
-do_clear(LoopData,Opts) when is_list(Opts) ->
- NewLoopData=do_stop_tracing(LoopData), % First stop tracing, if tracing.
- case lists:member(keep_trace_patterns,Opts) of
- false ->
- do_clear_trace_patterns();
- _ ->
- true
- end,
- case lists:member(keep_log_files,Opts) of
- false ->
- if
- NewLoopData#rt.tracerdata/=undefined ->
- do_delete_logs(NewLoopData#rt.tracerdata);
- true -> % If no tracerdata, nothing to remove!
- true % Do nothing then.
- end;
- _ ->
- true
- end,
- NewLoopData#rt{state=new,tracerdata=undefined};
-do_clear(LoopData,_Opts) -> % Faulty Opts.
- do_clear(LoopData,[]). % Then just ignore the options.
-%% -----------------------------------------------------------------------------
-
-%% Function which takes a tracerdata, either our own or a "suggested"
-%% and tries to find the corresponding files. Note that the return value only
-%% contains "types" of logs that the tracerdata is pointing out. Hence
-%% is there no ti-log, no one will be mentioned in the return value.
-do_list_logs(TracerData) -> % Handles both list and tuple.
- case translate_td(TracerData) of
- {ok,LogTD,TiTD} ->
- {TraceDir,TraceLogs}=list_logs_tracelog(LogTD),
- {TiDir,TiLogs}=list_logs_tilog(TiTD),
- case {TraceLogs,TiLogs} of
- {no_log,no_log} -> % Tracerdata not generating logs!
- {ok,no_log};
- {_,no_log} -> % No ti logs.
- {ok,[{trace_log,TraceDir,TraceLogs}]};
- {no_log,_} -> % Only ti-logs, unusual!
- {ok,[{ti_log,TiDir,TiLogs}]};
- _ -> % Both trace and ti logs.
- {ok,[{trace_log,TraceDir,TraceLogs},{ti_log,TiDir,TiLogs}]}
- end;
- {error,Reason} ->
- {error,Reason}
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function implementing fetching logfiles using distributed Erlang.
-%% This function works for both situations, a list of specific files are
-%% requested, or a tracerdata is specified.
-%% Returns {Reply,NewLoopData}.
-do_fetch_log(LD,CollectPid,What) ->
- if
- LD#rt.state/=tracing ->
- case is_list_of_files_or_tracerdata(What) of
- files ->
- FetcherPid=do_fetch_log_listoffiles(CollectPid,What),
- {{ok,FetcherPid},add_fetcher_ld(FetcherPid,LD)};
- tracerdata ->
- case do_fetch_log_tracerdata(CollectPid,What) of
- {Reply,FetcherPid} when is_pid(FetcherPid) ->
- {Reply,add_fetcher_ld(FetcherPid,LD)};
- {Reply,_} -> % No fetch process was started.
- {Reply,LD}
- end;
- false -> % It is an empty list!
- {{complete,no_log},LD};
- error -> % Incorrect parameter.
- {{error,badarg},LD}
- end;
- true -> % No transfere during tracing.
- {{error,tracing},LD}
- end.
-
-%% Function taking tracerdata to find out what files to send over to the RemotePid.
-%% Note that we will not go back to the loop function from here but rather call
-%% the fetch_loop instead, prepresenting the fetch-log state. Unless we encounter
-%% a problem.
-do_fetch_log_tracerdata(CollectPid,TracerData) ->
- case do_list_logs(TracerData) of
- {ok,no_log} ->
- {{complete,no_log},void};
- {ok,Logs} -> % Ok, some trace_log and ti_log.
- FetcherPid=do_fetch_log_listoffiles(CollectPid,Logs),
- {{ok,FetcherPid},FetcherPid};
- {error,Reason} -> % Problem with tracerdata!
- {{error,Reason},void}
- end.
-
-do_fetch_log_listoffiles(CollectPid,FileSpec) ->
- ExpandedFileSpec=do_fetch_log_expand_filespec(FileSpec),
-%% !!! try out different ChunkSizes
-% ChunkSize = 60,
-% ChunkSize = 7*1024,
- ChunkSize=1024,
- _Fetcher=spawn_link(?MODULE,
- fetch_init,
- [self(),ExpandedFileSpec,CollectPid,ChunkSize]).
-
-%% Help function which expands the list of logs to have tags in front of every
-%% file, as required by the fetch_loop.
-do_fetch_log_expand_filespec(Logs) ->
- TraceLogs=
- case lists:keysearch(trace_log,1,Logs) of
- {value,{_,Dir1,Logs1}} -> % There is a list of trace-logs.
- lists:map(fun(File)->{trace_log,Dir1,File} end,Logs1);
- false -> % No trace-logs!
- []
- end,
- TiLogs=
- case lists:keysearch(ti_log,1,Logs) of
- {value,{_,Dir2,Logs2}} ->
- lists:map(fun(File)->{ti_log,Dir2,File} end,Logs2);
- false ->
- []
- end,
- TiLogs++TraceLogs.
-
-%% ------------------------------------------------------------------------------
-
-%% Function that removes all logfiles associated with a certain tracerdata.
-do_delete_logs(TracerDataOrLogList) ->
- case is_list_of_files_or_tracerdata(TracerDataOrLogList) of
- tracerdata ->
- case translate_td(TracerDataOrLogList) of
- {ok,LogTD,TiTD} ->
- case {list_logs_tracelog(LogTD),list_logs_tilog(TiTD)} of
- {{_,no_log},{_,no_log}} -> % No logs nowhere!
- {ok,no_log};
- {{LogDir,LogFiles},{_,no_log}} -> % No ti.
- {ok,[{trace_log,delete_files(LogDir,LogFiles)}]};
- {{_,no_log},{TiDir,TiFiles}} ->
- {ok,[{ti_log,delete_files(TiDir,TiFiles)}]};
- {{LogDir,LogFiles},{TiDir,TiFiles}} ->
- {ok,[{trace_log,delete_files(LogDir,LogFiles)},
- {ti_log,delete_files(TiDir,TiFiles)}]}
- end;
- {error,Reason} ->
- {error,Reason}
- end;
- files -> % It is [{trace_log,Dir,Files},..
- if
- is_list(hd(TracerDataOrLogList)) -> % Just a list of files.
- {ok,delete_files(".",TracerDataOrLogList)};
- is_tuple(hd(TracerDataOrLogList)) -> % A "modern" logspec.
- case {lists:keysearch(trace_log,1,TracerDataOrLogList),
- lists:keysearch(ti_log,1,TracerDataOrLogList)} of
- {false,false} -> % Hmm, no logs specified!
- {ok,[]}; % Easy response!
- {{value,{_,LogDir,LogFiles}},false} ->
- {ok,[{trace_log,delete_files(LogDir,LogFiles)}]};
- {false,{value,{_,TiDir,TiFiles}}} ->
- {ok,[{ti_log,delete_files(TiDir,TiFiles)}]};
- {{value,{_,LogDir,LogFiles}},{value,{_,TiDir,TiFiles}}} ->
- {ok,[{trace_log,delete_files(LogDir,LogFiles)},
- {ti_log,delete_files(TiDir,TiFiles)}]}
- end
- end;
- false -> % Can't tell which!
- {ok,[]};
- error ->
- {error,{badarg,TracerDataOrLogList}}
- end.
-%% -----------------------------------------------------------------------------
-
-%% Function handling the request when a control component wishing to take
-%% control over this already existing control component. It does not matter
-%% what state it is in. It can very well already be tracing.
-%% Returns {Reply,NewLoopData}.
-%% Where the Reply tells the control component wether it took control of it
-%% or not. {node_info,node(),self(),Vsn,State,Status,{tag,Tag}} means that we
-%% can be adopted (and more precisely considers ourselves being adopted now).
-do_try_to_adopt(Tag,if_ref,LoopData=#rt{tag=Tag},_Ctrl) ->
- {{error,{wrong_reference,LoopData#rt.tag}},LoopData};
-do_try_to_adopt(NewTag,_Condition,LoopData,CtrlPid) ->
- case LoopData#rt.timer_ref of % Do we have a running-alone timer?
- undefined -> % No we don't.
- true;
- TimerRef ->
- timer:cancel(TimerRef)
- end,
- CtrlRef=erlang:monitor(process,CtrlPid), % Lets monitor our new "master"!
- {DepVal,_}=LoopData#rt.dependency,
- {node_info,Node,Pid,VSN,State,Status,Tag}=collect_node_info(LoopData),
- NewLoopData=
- LoopData#rt{dependency={DepVal,node(CtrlPid)},
- ctrl=CtrlPid,
- ctrl_ref=CtrlRef, % Monitoring our new master.
- tag=NewTag, % Use this tag from now on.
- timer_ref=undefined},
- {{node_info,Node,Pid,VSN,State,Status,{tag,Tag}},NewLoopData}.
-%% -----------------------------------------------------------------------------
-
-%% Function changing parameters accoring to a new options list. Note that we
-%% can not change control component if the one we have is still working.
-%% We can however of course change how this runtime component will react to
-%% a running alone scenario.
-%% Returns 'stop' or NewLoopData.
-do_change_options(Options,LoopData) ->
- NewLoopData=read_option_list(Options,LoopData),
- if
- NewLoopData/=LoopData -> % Some options changed.
- case do_change_options_ctrl(LoopData,NewLoopData) of
- stop ->
- stop;
- {ok,NewLoopData2} ->
- NewLoopData3=do_change_options_overload(LoopData,NewLoopData2),
- NewLoopData3#rt{next_loadcheck=now()} % Force a load check next.
- end;
- true ->
- LoopData
- end.
-
-%% Help function which sets up the new dependencies. Note that we only do that
-%% if do not have a working control component.
-%% Returns {ok,NewLoopData} or 'stop'.
-do_change_options_ctrl(OldLD,NewLD) ->
- if
- OldLD#rt.timer_ref/=undefined -> % No control and waiting to terminate.
- timer:cancel(OldLD#rt.timer_ref),
- do_down_message(NewLD#rt{timer_ref=undefined});
- OldLD#rt.ctrl==undefiend -> % No control component.
- do_down_message(NewLD);
- true -> % We have a working control component!
- {ok,NewLD}
- end.
-
-do_change_options_overload(OldLD,NewLD) ->
- if
- OldLD#rt.overload/=NewLD#rt.overload ->
- terminate_overload(OldLD),
- NewOverloadData=initialize_overload(NewLD),
- NewLD#rt{overload_data=NewOverloadData};
- true -> % No changes done.
- NewLD
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function handling an incoming DOWN message from our control component.
-%% If the runtime component is not allowed to run without a control component, it
-%% simply terminates which closes the trace-port and process trace flags are
-%% therefore automatically removed.
-%% Returns 'stop' or a {ok,NewLoopData} structure.
-do_down_message(LoopData) ->
- case LoopData#rt.dependency of
- {0,_} -> % Not allowed to run without controller.
- stop;
- {infinity,_} -> % Don't care. Just remove the controller.
- {ok,LoopData#rt{ctrl=undefined,ctrl_ref=undefined}};
- {TimeOut,_} -> % Allowed to run TimeOut ms alone.
- {ok,TimerRef}=timer:exit_after(TimeOut,self(),running_alone),
- {ok,LoopData#rt{timer_ref=TimerRef,ctrl=undefined,ctrl_ref=undefined}}
- end.
-%% -----------------------------------------------------------------------------
-
-%% Function handling incomming exit signals. We can expect exit signals from the
-%% following: Our parent supervisor (runtime_tools_sup), a meta-tracer process,
-%% a logfile fetcher process, or the auto_starter.
-%% A trace-port may also generate an exit signal.
-%% In addition it is possible that an overload mechanism generates exit-signals.
-%% We can also get the running_alone exit signal from our self. This is the
-%% situation if our control component has terminated and this runtime component
-%% is not allowed to exist on its own for ever.
-%% Also note that after we have stopped tracing, for any reason, it is not
-%% impossible that we receive the EXIT signals from still working parts that
-%% we are now shuting down. This is no problem, the code will mearly update
-%% the loopdata structure once again.
-%% Returns 'exit' indicating that the runtime component shall terminate now,
-%% {NewLoopData,NewTimeOut} if the exit-signal resulted in an overload check, or
-%% a new loopdata structure shall we ignore the exit, or it simply resulted in
-%% a state-change.
-act_on_exit(Parent,_Reason,#rt{parent=Parent}) ->
- exit;
-act_on_exit(_Pid,running_alone,_LoopData) ->
- exit;
-act_on_exit(MetaTracer,_Reason,LoopData=#rt{meta_tracer=MetaTracer}) ->
- LoopData#rt{meta_tracer=undefined}; % It does not exit anylonger.
-act_on_exit(Port,Reason,LoopData=#rt{tracer_port=Port}) ->
- send_event({port_down,node(),Reason},LoopData),
- _NewLoopData=do_stop_tracing(LoopData);
-act_on_exit(AutoStarter,_Reason,LoopData=#rt{auto_starter=AutoStarter}) ->
- LoopData#rt{auto_starter=undefined}; % The autostarter has terminated.
-act_on_exit(Pid,Reason,LoopData) ->
- case remove_fetcher_ld(Pid,LoopData) of
- {true,NewLoopData} -> % Yes it really was a fetcher.
- NewLoopData;
- false -> % No it was not a fetcher.
- act_on_exit_overload(Pid,Reason,LoopData)
- end.
-
-%% Help function checking if this exit has anything to do with an overload
-%% mechanism. Note that here we run the overload mechanism regardless of
-%% if we are tracing or not. This because an exit signal from the overload
-%% must most likely always be handled.
-act_on_exit_overload(Pid,Reason,LoopData) ->
- if
- LoopData#rt.overload/=?NO_LOADCHECK ->
- {_NewLD,_NewTimeOut}=
- do_check_overload(LoopData,
- {'EXIT',{Pid,Reason,LoopData#rt.overload_data}});
- true -> % Overload not in use.
- LoopData
- end.
-%% -----------------------------------------------------------------------------
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
-%% ==============================================================================
-%% Various help functions.
-%% ==============================================================================
-
-%% Help function which calculates a new now-tuple by adding Interval milliseconds
-%% to the first argument. Note that Interval may be 'infinity' too.
-%% Returns a new now-tuple or "bigvalue" which is greater than any now-tuple.
-add_to_now({MegSec,Sec,MicroSec},Interval) when is_integer(Interval) ->
- NewSec=Sec+(Interval div 1000),
- if
- NewSec>=1000000 ->
- {MegSec+1,NewSec-1000000,MicroSec};
- true ->
- {MegSec,NewSec,MicroSec}
- end;
-add_to_now(_,infinity) ->
- "bigvalue".
-%% ------------------------------------------------------------------------------
-
-%% Help function calculating the difference in milliseconds between its first
-%% and second argument. This is useful when calculating an after timeout value
-%% from current now() and next_loadcheck value.
-calc_diff_to_now(T1={_,_,_},T2={_,_,_}) ->
- TimeOut1=timer:now_diff(T2,T1), % The difference in microseconds.
- if
- TimeOut1<0 ->
- 0;
- true -> % Make milliseconds out of it.
- TimeOut1 div 1000
- end;
-calc_diff_to_now(_T1,_) -> % Next loadcheck is not activated.
- infinity. % The the after timeout is infinity.
-%% ------------------------------------------------------------------------------
-
-
-%% Help function returning information about this runtime component.
-collect_node_info(#rt{vsn=VSN,state=State,status=Status,tag=Tag}) ->
- {node_info,node(),self(),VSN,State,Status,Tag}.
-%% ------------------------------------------------------------------------------
-
-%% Help function sending information to the control component that state/status
-%% change has occurred. Returns nothing significant.
-send_event(state_change,LoopData=#rt{ctrl=CtrlPid}) when is_pid(CtrlPid) ->
- Event={trace_event,{state_change,node(),{LoopData#rt.state,LoopData#rt.status}}},
- CtrlPid ! Event;
-send_event(Event,#rt{ctrl=CtrlPid}) when is_pid(CtrlPid) ->
- CtrlPid ! {event,Event};
-send_event(_,_) -> % We have no control to send to!
- true. % Maybe tracing alone after autostart.
-%% ------------------------------------------------------------------------------
-
-%% Help function initializing the overload protection mechanism. This may be
-%% necessary if it is a port program or similar. Returns {ok,Data} or 'void'.
-%% The datastructure vill be given to LoadMF as argument whenever loadchecks
-%% are done.
-initialize_overload(#rt{overload={_MF,_Interval,{M,F,Args},_RemoveMFA}}) ->
- case catch apply(M,F,Args) of
- {ok,Data} ->
- Data;
- _ -> % 'EXIT' or other faulty returnvalue.
- void
- end;
-initialize_overload(_) ->
- void.
-%% ------------------------------------------------------------------------------
-
-%% Help function which terminates an overload protection mechanism.
-%% Returns nothing significant.
-terminate_overload(#rt{overload={_MF,_Interval,_InitMFA,{M,F,Args}},
- overload_data=Data}) ->
- catch apply(M,F,[Data|Args]), % Interested in the side-effect.
- true;
-terminate_overload(_) ->
- true.
-%% ------------------------------------------------------------------------------
-
-
-%% Help function which checks that a process specified for trace flags is correct.
-%% Either the built-in "aliases" for groups of processes, a pid, a locally registered
-%% name. This function also works for globally registered names. It must then
-%% first be established that the process is local for this node before setting any
-%% process flags.
-%% Returns {ok,PidSpec}, 'false' or {error,Reason}.
-check_traceflag_pidspec(all) -> {ok,all};
-check_traceflag_pidspec(new) -> {ok,new};
-check_traceflag_pidspec(existing) -> {ok,existing};
-check_traceflag_pidspec(Name) when is_atom(Name) ->
- check_traceflag_pidspec({local,Name});
-check_traceflag_pidspec({local,A}) when is_atom(A) ->
- case whereis(A) of
- undefined -> % Then it is considered faulty.
- {error,{nonexistent_name,A}};
- Pid when is_pid(Pid) ->
- {ok,Pid}
- end;
-check_traceflag_pidspec({global,Name}) when is_atom(Name) ->
- case global:whereis_name(Name) of
- undefined -> % Then the name does not exist at all.
- {error,{nonexistent_name,{global,Name}}};
- Pid when is_pid(Pid) -> % Ok, but must check that it is here.
- if
- node()==node(Pid) ->
- {ok,Pid};
- true -> % Pid is not at this node.
- false % Not an error but cant be used.
- end
- end;
-check_traceflag_pidspec(Pid) when is_pid(Pid) ->
- {ok,Pid};
-check_traceflag_pidspec(Proc) ->
- {error,{faulty,Proc}}.
-%% ------------------------------------------------------------------------------
-
-%% Help function removing all trace flags from all processes. Useful in connection
-%% with suspend. Returns nothing significant.
-do_clear_trace_flags() ->
- erlang:trace(all, false, [all]).
-%% ------------------------------------------------------------------------------
-
-%% Help function which checks that only valid process trace flags are mentioned.
-%% In order to create better fault reports.
-%% Returns a list of the approved flags, or {error,Reason}.
-check_flags(Flags) ->
- check_flags_2(Flags,Flags).
-
-check_flags_2([send|Rest],Flags) -> check_flags_2(Rest,Flags);
-check_flags_2(['receive'|Rest],Flags) -> check_flags_2(Rest,Flags);
-check_flags_2([call|Rest],Flags) -> check_flags_2(Rest,Flags);
-check_flags_2([return_to|Rest],Flags) -> check_flags_2(Rest,Flags);
-check_flags_2([procs|Rest],Flags) -> check_flags_2(Rest,Flags);
-check_flags_2([garbage_collection|Rest],Flags) -> check_flags_2(Rest,Flags);
-check_flags_2([running|Rest],Flags) -> check_flags_2(Rest,Flags);
-check_flags_2([set_on_spawn|Rest],Flags) -> check_flags_2(Rest,Flags);
-check_flags_2([set_on_first_spawn|Rest],Flags) -> check_flags_2(Rest,Flags);
-check_flags_2([set_on_link|Rest],Flags) -> check_flags_2(Rest,Flags);
-check_flags_2([timestamp|Rest],Flags) -> check_flags_2(Rest,Flags);
-check_flags_2([arity|Rest],Flags) -> check_flags_2(Rest,Flags);
-check_flags_2([silent|Rest],Flags) -> check_flags_2(Rest,Flags);
-check_flags_2([],Flags) -> Flags;
-check_flags_2([Faulty|_],_Flags) -> {error,{bad_flag,Faulty}}.
-%% ------------------------------------------------------------------------------
-
-%% Help function which checks parameters to erlang:trace_pattern. The purpose of
-%% the function is to avoid to get multiple error return values in the return
-%% list for a pattern used together with a regexp expanded module name.
-check_pattern_parameters(Mod,Func,Arity,MS) ->
- MSresult = check_MS(MS),
- MFAresult = check_MFA(Mod,Func,Arity),
- MFAresult and MSresult.
-
-check_MS(MS) when is_list(MS) -> true;
-check_MS(true) -> true;
-check_MS(false) -> true.
-
-check_MFA('_','_','_') -> true;
-check_MFA(Mod,'_','_') when is_atom(Mod) -> true;
-check_MFA(Mod,'_',A) when is_atom(Mod), is_integer(A) -> false;
-check_MFA(Mod,F,'_') when is_atom(Mod), is_atom(F) -> true;
-check_MFA(Mod,F,A) when is_atom(Mod), is_atom(F), is_integer(A) -> true.
-
-%% -----------------------------------------------------------------------------
-
-%% Help function finding out if Mod is loaded, and if not, if it can successfully
-%% be loaded. The Opts list can prevent modules from being loaded.
-%% Returns 'true' or 'false'.
-load_module_on_option(Mod,Opts) when is_list(Opts) ->
- case lists:member(no_loadcheck,Opts) of
- true -> % Then just skip this, return true.
- true;
- false ->
- case erlang:module_loaded(Mod) of
- true ->
- true; % It is loaded, do no more.
- false ->
- case lists:member(only_loaded,Opts) of
- true -> % Then, make no attempts to load.
- false;
- false -> % Try to load!
- case code:ensure_loaded(Mod) of
- {module,_Mod} -> % Successfully loaded!
- true;
- {error,_Reason} ->
- false
- end
- end
- end
- end;
-load_module_on_option(Mod,_Opts) -> % Most likely Opts not a list!
- load_module_on_option(Mod,[]). % Call without options.
-%% -----------------------------------------------------------------------------
-
-%% Help function taking a tuplelist of options turning them into a loopdata
-%% structure. Returns the loopdata structure with the new values changed.
-read_option_list([],LD) -> % Done, return loopdata.
- LD;
-read_option_list([{dependency,{Value,Node}}|Rest],LD) ->
- read_option_list(Rest,LD#rt{dependency={Value,Node}});
-read_option_list([{dependency,Value}|Rest],LD) when is_integer(Value);Value==infinity ->
- read_option_list(Rest,LD#rt{dependency={Value,node()}});
-read_option_list([overload|Rest],LD) -> % So that we can remove loadcheck.
- read_option_list(Rest,LD#rt{overload=?NO_LOADCHECK});
-read_option_list([{overload,{MF,Interval}}|Rest],LD)
- when is_integer(Interval);Interval==infinity ->
- read_option_list(Rest,LD#rt{overload={MF,Interval,void,void}});
-read_option_list([{overload,{MF,Interval,InitMFA,RemoveMFA}}|Rest],LD)
- when is_integer(Interval);Interval==infinity ->
- read_option_list(Rest,LD#rt{overload={MF,Interval,InitMFA,RemoveMFA}});
-read_option_list([{overload,Interval}|Rest],LD)
- when is_integer(Interval);Interval==infinity ->
- read_option_list(Rest,LD#rt{overload={fun ?DEFAULT_OVERLOAD_FUNC/1,
- Interval,
- void,
- void}});
-read_option_list([_|Rest],LD) -> % Unknown option.
- read_option_list(Rest,LD).
-%% -----------------------------------------------------------------------------
-
-%% Help function which returns the version number for the runtime_tools
-%% application. Since it is called from within the runtime_tools application
-%% we can be "sure" that it really exists.
-get_application_vsn() ->
- {value,{_,_,VSN}}=lists:keysearch(runtime_tools,1,application:loaded_applications()),
- VSN.
-%% -----------------------------------------------------------------------------
-
-%% Help function that examines an argument to determine if it is a list of files
-%% or tracerdata. This since they are both complex structures, looking alike.
-%% Returns 'tracerdata', 'files', 'false' or 'error'. Error is returned if it
-%% can not be decided which it is.
-is_list_of_files_or_tracerdata(What) ->
- case inviso_rt_lib:is_tracerdata(What) of
- true ->
- tracerdata;
- false ->
- if
- What==[] ->
- false;
- is_list(What),is_list(hd(What)) ->
- files;
- is_list(What) ->
- case lists:keysearch(trace_log,1,What) of
- {value,_} ->
- files;
- false ->
- case lists:keysearch(ti_log,1,What) of
- {value,_} ->
- files;
- false ->
- error % Neither tracerdata nor list of files.
- end
- end;
- true ->
- error
- end
- end.
-%% ------------------------------------------------------------------------------
-
-%% Help function which removes all files in the ListOfFiles, assuming they
-%% are located in Dir.
-%% Returns a list of [{ok,FileName},...{error,Reason},...]
-delete_files(Dir,ListOfFiles) ->
- delete_files_2(Dir,ListOfFiles, []).
-
-delete_files_2(Dir,[File|Tail],Reply) when is_list(Dir),is_list(File) ->
- case catch file:delete(filename:join(Dir,File)) of
- ok ->
- delete_files_2(Dir,Tail,[{ok,File}|Reply]);
- {error,Posix} ->
- delete_files_2(Dir,Tail,[{error,{Posix,File}}|Reply]);
- {'EXIT',_Reason} -> % Probably not proper string.
- delete_files_2(Dir,Tail,[{error,{badarg,[Dir,File]}}|Reply])
- end;
-delete_files_2(Dir,[Faulty|Tail],Reply) ->
- delete_files_2(Dir,Tail,[{error,{badarg,[Dir,Faulty]}}|Reply]);
-delete_files_2(_,[],Reply) ->
- Reply.
-%% -----------------------------------------------------------------------------
-
-%% Help function which lists all trace logs belonging to this tracerdata.
-%% Note that this function operates on internal LogTD structures.
-list_logs_tracelog({file,FileName}) when is_list(FileName) ->
- case file:read_file_info(FileName) of
- {ok,_} -> % The file exists.
- {filename:dirname(FileName),[filename:basename(FileName)]};
- _ -> % The file does not exist
- {filename:dirname(FileName),[]}
- end;
-list_logs_tracelog({file,Wrap}) when is_tuple(Wrap),element(2,Wrap)==wrap ->
- case {element(1,Wrap),element(3,Wrap)} of
- {FileName,Tail} when is_list(FileName),is_list(Tail) ->
- case catch {filename:dirname(FileName),list_wrapset(FileName,Tail)} of
- {'EXIT',_Reason} -> % Garbage in either lists.
- {"",no_log}; % Interpret as no log for tracerdata.
- Tuple ->
- Tuple
- end;
- _ ->
- {"",no_log}
- end;
-list_logs_tracelog(void) -> % Trace log not used.
- {"",no_log};
-list_logs_tracelog(_) -> % Some fun or similar.
- {"",no_log}. % Then there are no files to report.
-%% -----------------------------------------------------------------------------
-
-%% Help function which lists all ti-files belonging to this tracerdata.
-%% Note that this function operates on the internal TiTD structure.
-list_logs_tilog(TiTD)
- when tuple_size(TiTD)>=2,element(1,TiTD)==file,is_list(element(2,TiTD)) ->
- FileName=element(2,TiTD),
- case file:read_file_info(FileName) of
- {ok,_} -> % Yes the file exists.
- {filename:dirname(FileName),[filename:basename(FileName)]};
- _ ->
- {filename:dirname(FileName),[]}
- end;
-list_logs_tilog(void) -> % Internal representation for
- {"",no_log}; % ti-file not in use.
-list_logs_tilog(_) ->
- {"",no_log}.
-%% -----------------------------------------------------------------------------
-
-%% Help function which lists all files belonging to the wrap-set specified by
-%% Prefix and Suffix. Note that there can be a directory in Prefix as well.
-%% Will fail if either of Prefix or Suffix are not proper strings.
-%% Returns a list of files, without dirname.
-list_wrapset(Prefix,Suffix) ->
- Name=filename:basename(Prefix),
- Dirname=filename:dirname(Prefix),
- case file:list_dir(Dirname) of
- {ok,Files} ->
- RegExp="^"++list_wrapset_escapes(Name)++"[0-9]+"++
- list_wrapset_escapes(Suffix)++"$",
- list_wrapset_2(Files,RegExp);
- {error,_Reason} -> % Translate this to no files!
- []
- end.
-
-list_wrapset_2([File|Rest],RegExp) ->
- Length=length(File),
- case re:run(File,RegExp) of
- {match,[{0,Length}]} -> % This is a member of the set.
- [File|list_wrapset_2(Rest,RegExp)];
- _ ->
- list_wrapset_2(Rest,RegExp)
- end;
-list_wrapset_2([],_) ->
- [].
-
-%% Help function which inserts escape characters infront of characters which
-%% will otherwise be missinterpreted by the regexp function as meta rather than
-%% just the character itself.
-list_wrapset_escapes([$.|Rest]) ->
- [$\\,$.|list_wrapset_escapes(Rest)];
-list_wrapset_escapes([Char|Rest]) ->
- [Char|list_wrapset_escapes(Rest)];
-list_wrapset_escapes([]) ->
- [].
-%% -----------------------------------------------------------------------------
-
-
-
-
-
-
-%% ==============================================================================
-%% Handler functions for implementing simple trace-message handlers.
-%% ==============================================================================
-%%
-%% A handler must be a function taking two arguments. The first is the trace-
-%% message. The second is datastructure used by the handler. The handler shall
-%% returns (possibly) new datastructure.
-
-%% ------------------------------------------------------------------------------
-%% Function implementing a relayer. This function is used to creat a fun handler
-%% if the relay option is used in tracer-data.
-%% ------------------------------------------------------------------------------
-relay_handler(Msg,Tracer) ->
- Tracer ! Msg,
- Tracer.
-
-%% ------------------------------------------------------------------------------
-%% Function implementing a default terminal io handler.
-%% ------------------------------------------------------------------------------
-
-dhandler(end_of_trace, Out) ->
- Out;
-dhandler(Trace, Out) when element(1, Trace) == trace,
- tuple_size(Trace) >= 3 ->
- dhandler1(Trace, tuple_size(Trace), Out);
-dhandler(Trace, Out) when element(1, Trace) == trace_ts,
- tuple_size(Trace) >= 4 ->
- dhandler1(Trace, tuple_size(Trace)-1, Out);
-dhandler(Trace, Out) when element(1, Trace) == drop,
- tuple_size(Trace) == 2 ->
- io:format(Out, "*** Dropped ~p messages.~n", [element(2,Trace)]),
- Out;
-dhandler(Trace, Out) when element(1, Trace) == seq_trace,
- tuple_size(Trace) >= 3 ->
- SeqTraceInfo = case Trace of
- {seq_trace, Lbl, STI, TS} ->
- io:format(Out, "SeqTrace ~p [~p]: ",
- [TS, Lbl]),
- STI;
- {seq_trace, Lbl, STI} ->
- io:format(Out, "SeqTrace [~p]: ",
- [Lbl]),
- STI
- end,
- case SeqTraceInfo of
- {send, Ser, Fr, To, Mes} ->
- io:format(Out, "(~p) ~p ! ~p [Serial: ~p]~n",
- [Fr, To, Mes, Ser]);
- {'receive', Ser, Fr, To, Mes} ->
- io:format(Out, "(~p) << ~p [Serial: ~p, From: ~p]~n",
- [To, Mes, Ser, Fr]);
- {print, Ser, Fr, _, Info} ->
- io:format(Out, "-> ~p [Serial: ~p, From: ~p]~n",
- [Info, Ser, Fr]);
- Else ->
- io:format(Out, "~p~n", [Else])
- end,
- Out;
-dhandler(_Trace, Out) ->
- Out.
-
-dhandler1(Trace, Size, Out) ->
-%%%! Self = self(),
- From = element(2, Trace),
- case element(3, Trace) of
- 'receive' ->
- case element(4, Trace) of
- {dbg,ok} -> ok;
- Message -> io:format(Out, "(~p) << ~p~n", [From,Message])
- end;
- 'send' ->
- Message = element(4, Trace),
- case element(5, Trace) of
-%%%! This causes messages to disappear when used by ttb (observer). Tests
-%%%! so far show that there is no difference in results with dbg even if I
-%%%! comment it out, so I hope this is only some old code which isn't
-%%%! needed anymore... /siri
-%%%! Self -> ok;
- To -> io:format(Out, "(~p) ~p ! ~p~n", [From,To,Message])
- end;
- call ->
- case element(4, Trace) of
- MFA when Size == 5 ->
- Message = element(5, Trace),
- io:format(Out, "(~p) call ~s (~p)~n",
- [From,ffunc(MFA),Message]);
- MFA ->
- io:format(Out, "(~p) call ~s~n", [From,ffunc(MFA)])
- end;
- return -> %% To be deleted...
- case element(4, Trace) of
- MFA when Size == 5 ->
- Ret = element(5, Trace),
- io:format(Out, "(~p) old_ret ~s -> ~p~n",
- [From,ffunc(MFA),Ret]);
- MFA ->
- io:format(Out, "(~p) old_ret ~s~n", [From,ffunc(MFA)])
- end;
- return_from ->
- MFA = element(4, Trace),
- Ret = element(5, Trace),
- io:format(Out, "(~p) returned from ~s -> ~p~n",
- [From,ffunc(MFA),Ret]);
- return_to ->
- MFA = element(4, Trace),
- io:format(Out, "(~p) returning to ~s~n", [From,ffunc(MFA)]);
- spawn when Size == 5 ->
- Pid = element(4, Trace),
- MFA = element(5, Trace),
- io:format(Out, "(~p) spawn ~p as ~s~n", [From,Pid,ffunc(MFA)]);
- Op ->
- io:format(Out, "(~p) ~p ~s~n", [From,Op,ftup(Trace,4,Size)])
- end,
- Out.
-
-
-%%% These f* functions returns non-flat strings
-
-%% {M,F,[A1, A2, ..., AN]} -> "M:F(A1, A2, ..., AN)"
-%% {M,F,A} -> "M:F/A"
-ffunc({M,F,Argl}) when is_list(Argl) ->
- io_lib:format("~p:~p(~s)", [M, F, fargs(Argl)]);
-ffunc({M,F,Arity}) ->
- io_lib:format("~p:~p/~p", [M,F,Arity]);
-ffunc(X) -> io_lib:format("~p", [X]).
-
-%% Integer -> "Integer"
-%% [A1, A2, ..., AN] -> "A1, A2, ..., AN"
-fargs(Arity) when is_integer(Arity) -> integer_to_list(Arity);
-fargs([]) -> [];
-fargs([A]) -> io_lib:format("~p", [A]); %% last arg
-fargs([A|Args]) -> [io_lib:format("~p,", [A]) | fargs(Args)];
-fargs(A) -> io_lib:format("~p", [A]). % last or only arg
-
-%% {A_1, A_2, ..., A_N} -> "A_Index A_Index+1 ... A_Size"
-ftup(Trace, Index, Index) ->
- io_lib:format("~p", [element(Index, Trace)]);
-ftup(Trace, Index, Size) ->
- [io_lib:format("~p ", [element(Index, Trace)])
- | ftup(Trace, Index+1, Size)].
-%% ------------------------------------------------------------------------------
-
-%% ==============================================================================
-%% Functions handling the trace-port. Copied from dbg.erl
-%% ==============================================================================
-
-trace_port_control(Port, flush) ->
- case trace_port_control(Port, $f, "") of
- {ok, [0]} -> ok;
- {ok, _} -> {error, not_supported_by_trace_driver};
- Other -> Other
- end.
-
-trace_port_control(Port, Command, Arg) when is_port(Port)->
- case catch port_control(Port, Command, Arg) of
- {'EXIT', _} -> {error, {no_trace_driver, node()}};
- Result -> Result
- end.
-
-
-trace_port(file, {Filename, wrap, Tail}) ->
- trace_port(file, {Filename, wrap, Tail, 128*1024});
-trace_port(file, {Filename, wrap, Tail, WrapSize}) ->
- trace_port(file, {Filename, wrap, Tail, WrapSize, 8});
-trace_port(file, {Filename, wrap, Tail, WrapSize, WrapCnt})
- when is_list(Tail),
- is_integer(WrapSize), WrapSize >= 0, WrapSize < (1 bsl 32),
- is_integer(WrapCnt), WrapCnt >= 1, WrapCnt < (1 bsl 32) ->
- trace_port1(file, Filename, {wrap, Tail, WrapSize, WrapCnt, 0});
-trace_port(file, {Filename, wrap, Tail, {time, WrapTime}, WrapCnt})
- when is_list(Tail),
- is_integer(WrapTime), WrapTime >= 1, WrapTime < (1 bsl 32),
- is_integer(WrapCnt), WrapCnt >= 1, WrapCnt < (1 bsl 32) ->
- trace_port1(file, Filename, {wrap, Tail, 0, WrapCnt, WrapTime});
-trace_port(file, Filename) when is_list(Filename) ->
- trace_port1(file, Filename, nowrap);
-
-trace_port(ip, Portno) when is_integer(Portno) ->
- trace_port(ip,{Portno,50});
-
-trace_port(ip, {Portno, Qsiz}) when is_integer(Portno), is_integer(Qsiz) ->
- fun() ->
- Driver = "trace_ip_drv",
- Dir1 = filename:join(code:priv_dir(runtime_tools), "lib"),
- case catch erl_ddll:load_driver(Dir1, Driver) of
- ok ->
- ok;
- _ ->
- Dir2 = filename:join(
- Dir1,
- erlang:system_info(system_architecture)),
- catch erl_ddll:load_driver(Dir2, Driver)
- end,
- L = lists:flatten(
- io_lib:format("~s ~p ~p 2",
- [Driver, Portno, Qsiz])),
- open_port({spawn, L}, [eof])
- end.
-
-trace_port1(file, Filename, Options) ->
- Driver = "trace_file_drv",
- fun() ->
- Name = filename:absname(Filename),
- %% Absname is needed since the driver uses
- %% the supplied name without further investigations,
- %% and if the name is relative the resulting path
- %% might be too long which can cause a bus error
- %% on vxworks instead of a nice error code return.
- %% Also, the absname must be found inside the fun,
- %% in case the actual node where the port shall be
- %% started is on another node (or even another host)
- {Wrap, Tail} =
- case Options of
- {wrap, T, WrapSize, WrapCnt, WrapTime} ->
- {lists:flatten(
- io_lib:format("w ~p ~p ~p ~p ",
- [WrapSize, WrapCnt, WrapTime,
- length(Name)])),
- T};
- nowrap ->
- {"", ""}
- end,
- Command = Driver ++ " " ++ Wrap ++ "n " ++ Name ++ Tail,
- Dir1 = filename:join(code:priv_dir(runtime_tools), "lib"),
- case catch erl_ddll:load_driver(Dir1, Driver) of
- ok ->
- ok;
- _ ->
- Dir2 = filename:join(
- Dir1,
- erlang:system_info(system_architecture)),
- catch erl_ddll:load_driver(Dir2, Driver)
- end,
- if element(1, Options) == wrap ->
- %% Delete all files from any previous wrap log
- Files = wrap_postsort(wrap_presort(Name, Tail)),
- lists:foreach(
- fun(N) -> file:delete(N) end,
- Files);
- true -> ok
- end,
- open_port({spawn, Command}, [eof])
- end.
-
-%% Find all possible wrap log files.
-%% Returns: a list of sort converted filenames.
-%%
-%% The sort conversion is done by extracting the wrap sequence counter
-%% from the filename, and calling wrap_encode/2.
-wrap_presort(Filename, Tail) ->
- Name = filename:basename(Filename),
- Dirname = filename:dirname(Filename),
- case file:list_dir(Dirname) of
- {ok, Files} ->
- lists:zf(
- fun(N) ->
- case match_front(N, Name) of
- false ->
- false;
- X ->
- case match_rear(X, Tail) of
- false ->
- false;
- C -> % Counter
- case match_0_9(C) of
- true ->
- {true,
-% filename:join(Dirname, N)}
- wrap_encode(
- filename:join(Dirname, N),
- C)};
- false ->
- false
- end
- end
- end
- end,
- Files);
- _ ->
- []
- end.
-
-%% Extract the filenames from a list of sort converted ones.
-wrap_postsort(Files) ->
- lists:map(fun wrap_name/1, Files).
-
-wrap_encode(N, C) ->
- {list_to_integer(C), N}.
-
-wrap_name({_C, N}) ->
- N.
-
-%% Returns what is left of ListA when removing all matching
-%% elements from ListB, or false if some element did not match,
-%% or if ListA runs out of elements before ListB.
-match_front(ListA, []) when is_list(ListA) ->
- ListA;
-match_front([], ListB) when is_list(ListB) ->
- false;
-match_front([Hd|TlA], [Hd|TlB]) ->
- match_front(TlA,TlB);
-match_front([_HdA|_], [_HdB|_]) ->
- false.
-
-%% Reversed version of match_front/2
-match_rear(ListA, ListB) when is_list(ListA), is_list(ListB) ->
- case match_front(lists:reverse(ListA), lists:reverse(ListB)) of
- false ->
- false;
- List ->
- lists:reverse(List)
- end.
-
-%% Returns true if the non-empty list arguments contains all
-%% characters $0 .. $9.
-match_0_9([]) ->
- false;
-match_0_9([H]) when is_integer(H), $0 =< H, H =< $9 ->
- true;
-match_0_9([H|T]) when is_integer(H), $0 =< H, H =< $9 ->
- match_0_9(T);
-match_0_9(L) when is_list(L) ->
- false.
-%% -----------------------------------------------------------------------------
-
-
-%% -----------------------------------------------------------------------------
-%% Functions working on the tracerdata structure.
-%% -----------------------------------------------------------------------------
-
-%% Tracerdata is the structure which specifies to where tracing is logged at this
-%% runtime component. It may now (and in the future specify) several things.
-%% Currently it can consist of:
-%% LogTD: specifying how trace-log data shall be handled.
-%% TiTD : trace information, specifying how trace information shall be handled.
-%%
-%% Tracerdata may also contain quick or standard forms of LogTD and/or TiTD.
-%% For instance if a standard handler-fun shall be used. The handler fun is not
-%% part of the tracerdata but rather specified by a constant.
-
-
-%% Help function that translates an input-tracerdata to useful internal formats.
-%% This since the tracerdata may consist of specifications which shall be
-%% translated into funs or similar.
-%% Returns {ok,LogTD,TiTD} or {error,Reason}.
-%% Note that TiTD may be 'void' since TiTD is not mandatory.
-translate_td(TracerData) when is_list(TracerData) -> % Both log and ti.
- case translate_td_logtd(get_trace_log_tracerdata(TracerData)) of
- {ok,LogTD} ->
- case translate_td_titd(get_ti_log_tracerdata(TracerData)) of
- {ok,TiTD} ->
- {ok,LogTD,TiTD};
- {error,Reason} ->
- {error,Reason}
- end;
- {error,Reason} ->
- {error,Reason}
- end;
-translate_td(TracerData) -> % The it is just LogTD!?
- case translate_td_logtd(TracerData) of
- {ok,LogTD} ->
- {ok,LogTD,void};
- {error,Reason} ->
- {error,Reason}
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function translating trace-log tracerdata.
-translate_td_logtd(collector) -> % This rt will act as receiver.
- {ok,{fun dhandler/2,user}}; % Simple terminal io.
-translate_td_logtd({relayer,Tracer}) when is_pid(Tracer) ->
- {ok,{fun relay_handler/2,Tracer}}; % Relay trace-msg to Tracer-pid.
-translate_td_logtd({HandlerFun,Data}) when is_function(HandlerFun) ->
- {ok,{HandlerFun,Data}}; % Own invented fun.
-translate_td_logtd({Type,Parameters}) when Type==ip;Type==file ->
- {ok,{Type,Parameters}}; % Built in trace-port
-translate_td_logtd(false) -> % Unusual but no trace log.
- {ok,void};
-translate_td_logtd(Arg) ->
- {error,{bad_log_td,Arg}}.
-%% -----------------------------------------------------------------------------
-
-%% Help function translating ti-log tracerdata.
-translate_td_titd(TiTD={file,FileName}) when is_list(FileName) ->
- {ok,TiTD};
-translate_td_titd({file,FileName,
- {InitPublLDmfa={M1,F1,L1},
- RemovePublLDmf={M2,F2},
- CleanPublLDmf={M3,F3}}})
- when is_list(FileName),is_atom(M1),is_atom(F1),is_atom(M2),is_atom(F2),is_list(L1),is_atom(M3),is_atom(F3) ->
- {ok,{file,FileName,{InitPublLDmfa,RemovePublLDmf,CleanPublLDmf}}};
-translate_td_titd({file,FileName,
- {InitPublLDmfa={M1,F1,L1},
- void,
- CleanPublLDmf={M3,F3}}})
- when is_list(FileName),is_atom(M1),is_atom(F1),is_list(L1),is_atom(M3),is_atom(F3) ->
- {ok,{file,FileName,{InitPublLDmfa,void,CleanPublLDmf}}};
-translate_td_titd(false) -> % Means no ti-tracerdata.
- {ok,void};
-translate_td_titd(TiTD) ->
- {error,{bad_ti_td,TiTD}}.
-%% -----------------------------------------------------------------------------
-
-%% This function retrieves the trace-log part of a TracerData list structure.
-%% Returns TraceLogTD or 'false'.
-get_trace_log_tracerdata(TracerData) ->
- case lists:keysearch(trace,1,TracerData) of
- {value,{_,LogTD}} ->
- LogTD;
- false ->
- false
- end.
-%% -----------------------------------------------------------------------------
-
-%% This function retrieves the ti-log part of a TracerData list structure.
-%% Returns TiLogTD or 'false'.
-get_ti_log_tracerdata(TracerData) ->
- case lists:keysearch(ti,1,TracerData) of
- {value,{_,TiTD}} ->
- TiTD;
- false ->
- false
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function which checks that parameters to the built in trace-port are
-%% sane.
-check_traceport_parameters(Type,Args) ->
- case {Type,Args} of
- {file,{FileName,wrap,Tail}} when is_list(FileName),is_list(Tail) ->
- ok;
- {file,{FileName,wrap,Tail,WrapSize}}
- when is_list(FileName),
- is_list(Tail),
- is_integer(WrapSize),WrapSize>=0,WrapSize< (1 bsl 32) ->
- ok;
- {file,{FileName,wrap,Tail,WrapSize,WrapCnt}}
- when is_list(FileName),is_list(Tail),
- is_integer(WrapSize), WrapSize >= 0, WrapSize < (1 bsl 32),
- is_integer(WrapCnt), WrapCnt >= 1, WrapCnt < (1 bsl 32) ->
- ok;
- {file,{FileName,wrap,Tail,{time,WrapTime},WrapCnt}}
- when is_list(FileName),is_list(Tail),
- is_integer(WrapTime), WrapTime >= 1, WrapTime < (1 bsl 32),
- is_integer(WrapCnt), WrapCnt >= 1, WrapCnt < (1 bsl 32) ->
- ok;
- {file,FileName} when is_list(FileName) ->
- ok;
- {ip,Portno} when is_integer(Portno),Portno=<16#FFFF ->
- ok;
- {ip,{Portno,Qsiz}} when is_integer(Portno),Portno=<16#FFFF,is_integer(Qsiz) ->
- ok;
- _ ->
- {error,{trace_port_args,[Type,Args]}}
- end.
-%% -----------------------------------------------------------------------------
-
-
-%% -----------------------------------------------------------------------------
-%% Default overload functionality.
-%% -----------------------------------------------------------------------------
-
-%% A default overload protection function. An overload function must take
-%% one argument and return 'ok' or {suspend,SuspendReason}.
-default_overload_func(_) ->
- case process_info(self(),message_queue_len) of
- {message_queue_len,N} when N > 1000 ->
- {suspend,rt_max_queue_len};
- _ ->
- ok
- end.
-%% -----------------------------------------------------------------------------
-
-%% =============================================================================
-%% Functions working on the internal loopdata structure.
-%% =============================================================================
-
-%% Help function simply adding Fetcher as a fetcher process to the loopdata.
-%% Returns a new loopdata structure.
-add_fetcher_ld(Fetcher,LD) ->
- LD#rt{fetchers=[Fetcher|LD#rt.fetchers]}.
-%% -----------------------------------------------------------------------------
-
-%% Help function investigating if the first argument is a known fetcher process
-%% or not. If it is, it also removed it from the fetchers list in the loopdata
-%% structure.
-%% Returns {true,NewLoopData} or 'false'.
-remove_fetcher_ld(Fetcher,LD) ->
- NewFetchers=lists:delete(Fetcher,LD#rt.fetchers),
- if
- NewFetchers/=LD#rt.fetchers ->
- {true,LD#rt{fetchers=NewFetchers}};
- true -> % No it was not a fetcher process.
- false
- end.
-%% -----------------------------------------------------------------------------
-
-%%% end of file
-
diff --git a/lib/runtime_tools/src/inviso_rt_lib.erl b/lib/runtime_tools/src/inviso_rt_lib.erl
deleted file mode 100644
index 5dfe14068a..0000000000
--- a/lib/runtime_tools/src/inviso_rt_lib.erl
+++ /dev/null
@@ -1,474 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%% ------------------------------------------------------------------------------
-%% File : inviso_rt_lib.erl
-%% Author : Lennart �hman <[email protected]>
-%% Description :
-%%
-%% Created : 27 Sep 2005 by Lennart �hman <[email protected]>
-%% ------------------------------------------------------------------------------
--module(inviso_rt_lib).
-
--export([expand_regexp/2,expand_regexp/3,expand_regexp/4]).
--export([is_tracerdata/1]).
--export([transform/2]).
-
--export([rpc/4,rpc/5,match_modules/2,match_modules/3]).
--export([debug/3]).
-
-%% ------------------------------------------------------------------------------
-
-%% ==============================================================================
-%% Exported API functions.
-%% ==============================================================================
-
-%% ------------------------------------------------------------------------------
-%% expand_regexp(Nodes,RegExpDir,RegExpMod,Opts) = [{Node,Answer},...] | {error,Reason}
-%% expand_regexp(Nodes,RegExpMod,Opts) = [{Node,Answer},...] | {error,Reason}
-%% expand_regexp(RegExpDir,RegExpMod,Opts) = ListOfModules | {error,Reason}
-%% expand_regexp(RegExpMod,Opts) = ListOfModules | {error,Reason}
-%% Nodes=List of all nodes (atoms) where to expand.
-%% RegExpDir=Reg.exp (string) specifying directories.
-%% RegExpMod=Reg.exp (string) specifying module names.
-%% Node=node name (atom).
-%% Opts=[Opt,...]
-%% Opt=only_loaded
-%% Answer=List of modules (atoms) | 'badrpc'
-%%
-%% Expands, concurrently, the regular expression on Nodes and returns a list
-%% of what modules it expanded to on the different nodes. Note that it may
-%% differ between Erlang nodes depending on whether the modules are the same
-%% or not. Also note that all modules becomes loaded as a result.
-%% RegExpDir can further limit the modules. It introduces the requirement that
-%% a module must be loaded from a directory with a path satisfying the RegExpDir.
-%% All regular expression are according to the standard lib regexp module.
-expand_regexp(RegExpMod,Opts) when is_list(RegExpMod),is_list(Opts) ->
- match_modules(RegExpMod,Opts);
-expand_regexp(RegExpMod,Opts) ->
- {error,{badarg,[RegExpMod,Opts]}}.
-expand_regexp(NodesOrRegExpDir,RegExpMod,Opts)
- when is_list(NodesOrRegExpDir),is_list(RegExpMod),is_list(Opts) ->
- case is_list_of_atoms(NodesOrRegExpDir) of
- true -> % Interpret as list of nodes.
- lists:foreach(fun(N)->spawn(?MODULE,rpc,[self(),N,RegExpMod,Opts]) end,
- NodesOrRegExpDir),
- expand_regexp_answers(NodesOrRegExpDir,[]);
- false -> % Interpret as a string.
- match_modules(NodesOrRegExpDir,RegExpMod,Opts)
- end;
-expand_regexp(NodesOrRegExpDir,RegExpMod,Opts) ->
- {error,{badarg,[NodesOrRegExpDir,RegExpMod,Opts]}}.
-expand_regexp(Nodes,RegExpDir,RegExpMod,Opts)
- when is_list(Nodes),is_list(RegExpDir),is_list(RegExpMod),is_list(Opts) ->
- lists:foreach(fun(N)->
- spawn(?MODULE,rpc,[self(),N,RegExpDir,RegExpMod,Opts])
- end,
- Nodes),
- expand_regexp_answers(Nodes,[]);
-expand_regexp(Nodes,RegExpDir,RegExpMod,Opts) ->
- {error,{badarg,[Nodes,RegExpDir,RegExpMod,Opts]}}.
-
-expand_regexp_answers([],Answers) -> Answers; % List of [{Node,Answer},...].
-expand_regexp_answers(Nodes,Answers) ->
- receive
- {?MODULE,Node,Answer} ->
- expand_regexp_answers(lists:delete(Node,Nodes),[{Node,Answer}|Answers])
- end.
-%% ------------------------------------------------------------------------------
-
-%% is_tracerdata(TracerData)=true|false
-%% Answers the question if TracerData is proper tracerdata. Note that true can be
-%% returned if it resembles tracerdata very closely.
-is_tracerdata({Fun,_Data}) when is_function(Fun) -> true;
-is_tracerdata({relayer,To}) when is_pid(To);is_atom(To) -> true;
-is_tracerdata(collector) -> true;
-is_tracerdata({file,Param}) when is_tuple(Param);is_list(Param) -> true;
-is_tracerdata({ip,_Param}) -> true;
-is_tracerdata([{trace,LogTD}|Rest]) ->
- case is_tracerdata(LogTD) of
- true ->
- is_tracerdata(Rest);
- false ->
- false
- end;
-is_tracerdata([{ti,TiData}|Rest]) ->
- case is_tidata(TiData) of
- true ->
- is_tracerdata(Rest);
- false ->
- false
- end;
-is_tracerdata([]) ->
- true;
-is_tracerdata(_) ->
- false.
-
-is_tidata({file,FileName}) when is_list(FileName) -> true;
-is_tidata({file,FileName,{M,F,Args}}) when is_list(FileName),is_atom(M),is_atom(F),is_list(Args) ->
- true;
-is_tidata(_) -> false.
-%% ------------------------------------------------------------------------------
-
-
-%% ==============================================================================
-%% Help functions.
-%% ==============================================================================
-
-%% Help function intended to be run in its own process. Will report with
-%% a message when done.
-%% This function will be spawned on.
-rpc(Parent,Node,RegExpMod,Opts) ->
- case rpc:call(Node,?MODULE,match_modules,[RegExpMod,Opts]) of
- {badrpc,_Reason} -> % The node is probably not healthy.
- Parent ! {?MODULE,Node,badrpc};
- Modules ->
- Parent ! {?MODULE,Node,Modules}
- end.
-
-rpc(Parent,Node,RegExpDir,RegExpMod,Opts) ->
- case rpc:call(Node,?MODULE,match_modules,[RegExpDir,RegExpMod,Opts]) of
- {badrpc,_Reason} -> % The node is probably not healthy.
- Parent ! {?MODULE,Node,badrpc};
- Modules ->
- Parent ! {?MODULE,Node,Modules}
- end.
-%% ------------------------------------------------------------------------------
-
-
-%% ==============================================================================
-%% Exported function which actually shall be in code.erl.
-%% ==============================================================================
-
-%% match_modules(RegExpMod,Actions) = [Module,...] | {error,Reason}
-%% match_modules(RegExpDir,RegExpMod,Actions)=[Module,...] | {error,Reason}
-%% RegExpMod=Erlang regular expression describing module names (string).
-%% RegExpDir=Erlang regular expression describing directory paths(string) |
-%% void
-%% Actions=List of;'only_loaded'.
-%%
-%% Function which matches a regular expresion against module names. The function
-%% can also match the directory from where the module is loaded or will be loaded
-%% against a regular expresion for directory paths.
-%% The function uses the same strategy as code-loading if the same module is
-%% discovered in several places.
-%% (1) An already loaded module shadows all other occurancies.
-%% (2) .beams found in by a path shadows .beams found by paths later in the
-%% code paths.
-%%
-%% Description of actions:
-%% only_loaded: Only consider modules which are loaded.
-match_modules(RegExpMod,Actions) ->
- match_modules(void,RegExpMod,Actions).
-match_modules(RegExpDir,RegExpMod,Actions) ->
- AllLoaded=code:all_loaded(),
- Mods1=handle_expand_regexp_2(AllLoaded,RegExpDir,RegExpMod,[]),
- case lists:member(only_loaded,Actions) of % Shall we do not loaded too?
- false -> % Ok, search all paths too then.
- Paths=code:get_path(),
- handle_expand_regexp_3(Paths,RegExpDir,RegExpMod,AllLoaded,Mods1);
- true -> % Only loaded modules then.
- Mods1
- end.
-
-
-%% Help function which traverses all loaded modules and determines
-%% which shall be returned. First we check that the module satisfies the
-%% module-regexp. Then we, if a dir reg-exp is given, checks that the
-%% module is loaded from an approved path. Note that if it can not be
-%% determined from where it was loaded (like preloaded or cover-compiled
-%% etc), but dir reg-exps are used. That module will be excluded.
-%% Returns a list of modules.
-handle_expand_regexp_2([{Mod,Path}|Rest],RegExpDir,RegExpMod,Result) ->
- ModStr=atom_to_list(Mod),
- ModLen=length(ModStr),
- case re:run(ModStr,RegExpMod) of
- {match,[{0,ModLen}]} -> % Ok, The regexp matches the module.
- if
- is_list(RegExpDir),is_atom(Path) -> % Preloaded or covercompiled...
- handle_expand_regexp_2(Rest,RegExpDir,RegExpMod,Result);
- is_list(RegExpDir),is_list(Path) -> % Dir reg-exp is used!
- PathOnly=filename:dirname(Path), % Must remove beam-file name.
- case re:run(PathOnly,RegExpDir,[{capture,none}]) of
- match -> % Did find a match, that is enough!
- handle_expand_regexp_2(Rest,RegExpDir,RegExpMod,[Mod|Result]);
- _ -> % Either error or nomatch.
- handle_expand_regexp_2(Rest,RegExpDir,RegExpMod,Result)
- end;
- true -> % Otherwise already done!
- handle_expand_regexp_2(Rest,RegExpDir,RegExpMod,[Mod|Result])
- end;
- _ -> % Then Mod is not part of the set.
- handle_expand_regexp_2(Rest,RegExpDir,RegExpMod,Result)
- end;
-handle_expand_regexp_2([],_,_,Result) -> Result.
-
-%% Help function which traverses all paths and looks for modules satisfying
-%% the module reg.exp.
-%% Returns a list of unique module names.
-handle_expand_regexp_3([Path|Rest],RegExpDir,RegExpMod,AllLoaded,Result) ->
- if
- is_list(RegExpDir) -> % We must consider the directory name.
- AbsPath=
- case filename:pathtype(Path) of
- absolute -> % Is already abs.
- Path;
- relative -> % Then it must be made absolute.
- filename:absname(Path);
- volumerelative -> % Only on Windows!?
- filename:absname(Path)
- end,
- case re:run(AbsPath,RegExpDir,[{capture,none}]) of
- match -> % Ok, the directory is allowed.
- NewResult=handle_expand_regexp_3_1(Path,RegExpMod,AllLoaded,Result),
- handle_expand_regexp_3(Rest,RegExpDir,RegExpMod,AllLoaded,NewResult);
- _ -> % This directory does not qualify.
- handle_expand_regexp_3(Rest,RegExpDir,RegExpMod,AllLoaded,Result)
- end;
- true -> % RegExpDir is not used!
- NewResult=handle_expand_regexp_3_1(Path,RegExpMod,AllLoaded,Result),
- handle_expand_regexp_3(Rest,RegExpDir,RegExpMod,AllLoaded,NewResult)
- end;
-handle_expand_regexp_3([],_,_,_,Result) -> Result.
-
-handle_expand_regexp_3_1(Path,RegExpMod,AllLoaded,Result) ->
- case file:list_dir(Path) of
- {ok,FileNames} ->
- handle_expand_regexp_3_2(FileNames,RegExpMod,AllLoaded,Result);
- {error,_Reason} -> % Bad path!? Skip it.
- Result
- end.
-
-handle_expand_regexp_3_2([File|Rest],RegExpMod,AllLoaded,Result) ->
- case filename:extension(File) of
- ".beam" -> % It is a beam-file. Consider it!
- ModStr=filename:basename(File,".beam"),
- Mod=list_to_atom(ModStr),
- case {lists:keysearch(Mod,1,AllLoaded),lists:member(Mod,Result)} of
- {false,false} -> % This module is not tried before.
- ModLen=length(ModStr),
- case re:run(ModStr,RegExpMod) of
- {match,[{0,ModLen}]} -> % This module satisfies the regexp.
- handle_expand_regexp_3_2(Rest,RegExpMod,AllLoaded,[Mod|Result]);
- _ -> % Error or not perfect match.
- handle_expand_regexp_3_2(Rest,RegExpMod,AllLoaded,Result)
- end;
- {_,_} -> % This module is already tested.
- handle_expand_regexp_3_2(Rest,RegExpMod,AllLoaded,Result)
- end;
- _ -> % Not a beam-file, skip it.
- handle_expand_regexp_3_2(Rest,RegExpMod,AllLoaded,Result)
- end;
-handle_expand_regexp_3_2([],_,_,Result) -> Result.
-%% ------------------------------------------------------------------------------
-
-%% Help function which finds out if its argument is a list of zero or more
-%% atoms.
-%% Returns 'true' or 'false'.
-is_list_of_atoms([A|Rest]) when is_atom(A) ->
- is_list_of_atoms(Rest);
-is_list_of_atoms([_|_]) ->
- false;
-is_list_of_atoms([]) ->
- true.
-%% ------------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% Functions transforming function calls in trace-case file.
-%% =============================================================================
-
-%% transform(Exprs,Translations)=NewExprs
-%% Exprs=list(); List of abstract format erlang terms, as returned by
-%% io:parse_erl_exprs/2.
-%% Translations=list(); List of translations from function calls to other
-%% function calls. [{Mod,Func,Arity,{NewMod,NewFunc,ParamTransformMF}},...]
-%% Mod can actually be omitted, ParamTransformMF shall be {M,F} where F is
-%% a function taking one argument (the parameter list), and returning the
-%% new parameter list. It can also be anything else should no transformation
-%% of the parameters be the case.
-%%
-%% Function that transforms function calls in a trace-case file. The transform/2
-%% can only transform shallow function calls. I.e where both module and function
-%% name are specified as atoms. Any binding-environment is not examined.
-transform([Expr|Rest],Translations) ->
- [transform_2(Expr,Translations)|transform(Rest,Translations)];
-transform([],_) ->
- [].
-
-%% Help function handling a single expr.
-transform_2({call,L1,{remote,L2,ModExpr,FuncExpr},Params},Translations) ->
- case transform_2(ModExpr,Translations) of
- {atom,L3,M} ->
- case transform_2(FuncExpr,Translations) of
- {atom,L4,F} -> % Now we have a M:F/Arity!
- case do_call_translation(M,F,Params,Translations) of
- {ok,NewM,NewF,NewP} ->
- NewParams=transform(NewP,Translations),
- {call,L1,{remote,L2,{atom,L3,NewM},{atom,L4,NewF}},NewParams};
- false -> % No translation or faulty.
- NewParams=transform(Params,Translations),
- {call,L1,{remote,L2,ModExpr,FuncExpr},NewParams}
- end;
- NewFuncExpr -> % Not translated to a shallow term.
- NewParams=transform(Params,Translations),
- {call,L1,{remote,L2,ModExpr,NewFuncExpr},NewParams}
- end;
- NewModExpr -> % Not translated to a shallow term.
- NewFuncExpr=transform_2(FuncExpr,Translations),
- NewParams=transform(Params,Translations),
- {call,L1,{remote,L2,NewModExpr,NewFuncExpr},NewParams}
- end;
-transform_2({call,L1,FuncExpr,Params},Translations) ->
- case transform_2(FuncExpr,Translations) of
- {atom,L3,F} -> % Now we have a M:F/Arity!
- case do_call_translation(F,Params,Translations) of
- {ok,NewM,NewF,NewP} -> % It is turned into a global call.
- NewParams=transform(NewP,Translations),
- {call,L1,{remote,L1,{atom,L3,NewM},{atom,L3,NewF}},NewParams};
- false -> % No translation or faulty.
- NewParams=transform(Params,Translations),
- {call,L1,FuncExpr,NewParams}
- end;
- NewFuncExpr -> % Not translated to a shallow term.
- NewParams=transform(Params,Translations),
- {call,L1,NewFuncExpr,NewParams}
- end;
-transform_2({match,L,P,E},Translations) ->
- NewPattern=transform_2(P,Translations),
- NewExpr=transform_2(E,Translations),
- {match,L,NewPattern,NewExpr};
-transform_2({op,L,Op,Arg1,Arg2},Translations) ->
- NewArg1=transform_2(Arg1,Translations),
- NewArg2=transform_2(Arg2,Translations),
- {op,L,Op,NewArg1,NewArg2};
-transform_2({op,L,Op,Arg},Translations) ->
- NewArg=transform_2(Arg,Translations),
- {op,L,Op,NewArg};
-transform_2({block,L,Body},Translations) ->
- NewBody=transform(Body,Translations),
- {block,L,NewBody};
-transform_2({'if',L,Clauses},Translations) ->
- NewClauses=transform_clauses(Clauses,Translations),
- {'if',L,NewClauses};
-transform_2({'case',L,Func,Clauses},Translations) ->
- NewFunc=transform_2(Func,Translations),
- NewClauses=transform_clauses(Clauses,Translations),
- {'case',L,NewFunc,NewClauses};
-transform_2({'fun',L,{clauses,Clauses}},Translations) ->
- NewClauses=transform_clauses(Clauses,Translations),
- {'fun',L,NewClauses};
-transform_2({lc,L,Items,GeneratorsFilters},Translations) ->
- NewItem=transform_2(Items,Translations),
- NewGensAndFilters=transform_gensandfilters(GeneratorsFilters,Translations),
- {lc,L,NewItem,NewGensAndFilters};
-transform_2({'catch',L,Expr},Translations) ->
- NewExpr=transform_2(Expr,Translations),
- {'catch',L,NewExpr};
-transform_2({tuple,L,Elements},Translations) ->
- NewElements=transform(Elements,Translations),
- {tuple,L,NewElements};
-transform_2({cons,L,Element,Tail},Translations) ->
- NewElement=transform_2(Element,Translations),
- NewTail=transform_2(Tail,Translations),
- {cons,L,NewElement,NewTail};
-transform_2({nil,L},_) ->
- {nil,L};
-transform_2({bin,L,Elements},Translations) ->
- NewElements=transform_binary(Elements,Translations),
- {bin,L,NewElements};
-transform_2(Expr,_) -> % Can be a var for instance.
- Expr.
-
-transform_binary([{bin_element,L,Val,Size,TSL}|Rest],Translations) ->
- NewVal=transform_2(Val,Translations),
- NewSize=transform_2(Size,Translations),
- [{bin_element,L,NewVal,NewSize,TSL}|transform_binary(Rest,Translations)];
-transform_binary([],_) ->
- [].
-
-transform_clauses([{clause,L,Pattern,Guards,Body}|Rest],Translations) ->
- NewPattern=transform(Pattern,Translations),
- NewBody=transform(Body,Translations),
- [{clause,L,NewPattern,Guards,NewBody}|transform_clauses(Rest,Translations)];
-transform_clauses([],_Translations) ->
- [].
-
-transform_gensandfilters([{generator,L,Pattern,Exprs}|Rest],Translations) ->
- NewExprs=transform(Exprs,Translations),
- [{generator,L,Pattern,NewExprs}|transform_gensandfilters(Rest,Translations)];
-transform_gensandfilters([Expr|Rest],Translations) ->
- [transform_2(Expr,Translations)|transform_gensandfilters(Rest,Translations)];
-transform_gensandfilters([],_) ->
- [].
-%% ------------------------------------------------------------------------------
-
-%% This is the heart of the translation functionality. Here we actually try to
-%% replace calls to certain functions with other calls. This can include removing
-%% arguments.
-do_call_translation(M,F,Params,Translations) ->
- case lists:keysearch({M,F,length(Params)},1,Translations) of
- {value,{_,{NewM,NewF,ArgFun}}} -> % Lets transform the function.
- do_call_translation_2(Params,NewM,NewF,ArgFun);
- _ ->
- false % No translations at all.
- end.
-do_call_translation(F,Params,Translations) ->
- case lists:keysearch({F,length(Params)},1,Translations) of
- {value,{_,{NewM,NewF,ArgFun}}} -> % Lets transform the function.
- do_call_translation_2(Params,NewM,NewF,ArgFun);
- _ ->
- false % No translations at all.
- end.
-
-do_call_translation_2(Params,NewM,NewF,ArgFun) ->
- case ArgFun of
- {M,F} when is_atom(M),is_atom(F) ->
- case catch M:F(Params) of
- {'EXIT',_Reason} ->
- false; % If it does not work, skipp it.
- MungedParams when is_list(MungedParams) ->
- {ok,NewM,NewF,MungedParams};
- _ ->
- false
- end;
- _ -> % No munging of parameters.
- {ok,NewM,NewF,Params}
- end.
-%% ------------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% Functions for the runtime component internal debugging system.
-%% =============================================================================
-
-%% The debug system is meant to provide tracing of ttb at different levels.
-%%
-%% debug(What,Level,Description) -> nothing significant.
-%% What : controls what kind of event. This can both be certain parts of ttb
-%% as well as certain levels (info to catastrophy).
-%% Level: Determines if What shall be printed or not.
-%% Description: this is what happend.
-debug(off,_What,_Description) ->
- true; % Debug is off, no action.
-debug(On,What,Description) ->
- debug_2(On,What,Description).
-
-debug_2(_,What,Description) ->
- io:format("INVISO DEBUG:~w, ~p~n",[What,Description]).
-%% -----------------------------------------------------------------------------
diff --git a/lib/runtime_tools/src/inviso_rt_meta.erl b/lib/runtime_tools/src/inviso_rt_meta.erl
deleted file mode 100644
index 6865dc2242..0000000000
--- a/lib/runtime_tools/src/inviso_rt_meta.erl
+++ /dev/null
@@ -1,1207 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2006-2009. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%% Author: Lennart �hman, [email protected]
-%%
-%% This module implements the meta tracer process belonging to the
-%% runtime component. Its main purpose is to write the ti-file (traceinformation).
-%% The ti-file contains translations between process id:s and what ever "you"
-%% want to read in the merged and formatted logfile.
-%% This process interacts with the runtime component process.
-%%
-%% Currently it handles the following types of ti-files:
-%% Plain raw, binary log.
-%% Relay to other inviso_rt_meta process on another node.
-%%
-%% The TI file will be on binary format and each entry is:
-%% <<LengthIndicator:32, {Pid,Alias,Op,NowStamp} >>
-%% Pid=pid(), or if OP==unalias pid()|any_other_than_pid()
-%% Op=alias|unalias
-%% -----------------------------------------------------------------------------
--module(inviso_rt_meta).
-
-%% -----------------------------------------------------------------------------
-%% API exports.
-%% -----------------------------------------------------------------------------
-
--export([start/2,start/5]).
--export([stop/1,suspend/1]).
--export([init_tpm/5,init_tpm/8]).
--export([tpm/5,tpm/6,tpm/9,tpm_tracer/5,tpm_tracer/6,tpm_tracer/9]).
--export([tpm_ms/6,tpm_ms_tracer/6,ctpm_ms/5,ctpm/4]).
--export([local_register/1,global_register/1]).
--export([remove_local_register/1,remove_global_register/1]).
-
--export([write_ti/1]).
-
--export([get_tracer/0,tpm_ms/5,tpm_ms_tracer/5,list_tpm_ms/3,ctpm_ms/4]).
-
--export([metacast_call/5,metacast_return_from/6]).
--export([get_state/1]).
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% Internal exports.
-%% -----------------------------------------------------------------------------
-
--export([init/6]).
--export([init_std_publld/2,clean_std_publld/1]).
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% Constants.
-%% -----------------------------------------------------------------------------
-
--define(NAMED_MS_TAB,inviso_rt_meta_named_ms).
-
-%% -----------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% Exported API (Meant to be used by a runtime component).
-%% =============================================================================
-
-%% start(TiData,Tracer)={ok,Pid} | {error,Reason}
-%% start(TiData,Tracer,InitPublLDmfa,RemovePublLDmfa,CleanPublLDmf)=
-%% {ok,Pid} | {error,Reason}
-%% TiData={file,FileName}|{relay,Node}
-%% Tracer=pid()|port()
-%% FileName=string()
-%% InitPublLDmfa={Mod,Func,ArgList}
-%% RemovePublLDmf={Mod,Func} | void
-%% RemovePublLDmf(PublLD)->nothing significant.
-%% These functions are called to create and destroy the public loopdata
-%% structure available to the meta-trace CallFunc and ReturnFunc.
-%% CleanPublLDmf={Mod,Func}
-%% This function will periodically be called to clean the public LD from
-%% pending meta-trace messages waiting for a corresponding return_from
-%% message.
-%%
-%% Starts a meta-tracer process, opening the ti-file specified in TiData. PublLD
-%% is used to communicate data, typically between a call and return_from.
-%% If no special initialization function is specified a standard one is used.
-%% Note that the meta tracer function must know "who" is the regular tracer
-%% (process or port). This because it must be possible to append {tracer,Tracer}
-%% in meta match specs.
-start(TiData,Tracer) ->
- Pid=spawn_link(?MODULE,
- init,
- [self(),
- TiData,
- Tracer,
- {?MODULE,init_std_publld,[2,[]]},
- void,
- {?MODULE,clean_std_publld}]),
- wait_for_reply(Pid).
-start(TiData,Tracer,InitPublLDmfa,RemovePublLDmf,CleanPublLDmf) ->
- Pid=spawn_link(?MODULE,
- init,
- [self(),TiData,Tracer,InitPublLDmfa,RemovePublLDmf,CleanPublLDmf]),
- wait_for_reply(Pid).
-
-wait_for_reply(Pid) ->
- receive
- {Pid,ok} ->
- {ok,Pid};
- {Pid,{error,Reason}} ->
- {error,Reason}
- after
- 10000 -> % After very long time.
- exit(Pid,kill), % It must be hanging.
- {error,time_out}
- end.
-%% -----------------------------------------------------------------------------
-
-%% stop(Pid)=ok
-%% Pid=Adders to the meta tracer, pid().
-%% Shutsdown the metatracer.
-stop(Pid) ->
- Pid ! {stop,self()},
- ok.
-%% -----------------------------------------------------------------------------
-
-%% suspend(Pid)=ok
-%% Pid=Adders to the meta tracer, pid().
-%% Suspends the meta tracer by removing all meta trace patterns.
-suspend(Pid) ->
- Pid ! {suspend,self()},
- ok.
-%% -----------------------------------------------------------------------------
-
-%% init_tpm(Pid,Mod,Func,Arity,CallFunc)=
-%% init_tpm(Pid,Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc)=ok|{error,Reason}.
-%% Pid=Address to meta tracer process, pid().
-%% Mod,Func=Pointing out the function which shall be meta traced, atom().
-%% Arity=As above, integer().
-%% InitFunc,RemoveFunc={Module,Function}|fun(), functions being called when
-%% to initialize the public loopdata structure, and to reset it.
-%% InitFunc(Mod,Func,Arity,PublLD)->{ok,NewPublLD,Output}
-%% Supposed to initialize whatever needs to be done before
-%% handling any incoming meta-trace message for the Mod:Func/Arity.
-%% RemoveFunc(Mod,Func,Arity,PublLD)->{ok,NewPublLD}
-%% Called when meta tracing of Mod:Func/Arity is stopped. It is supposed
-%% to clear datastructures away from the PublLD.
-%% Initializes the public loopdata for this function. Note that we can not use wildcards
-%% here (even if it is perfectly legal in Erlang). It also sets the CallFunc and
-%% ReturnFunc for the meta traced function. The function is hence ready to be
-%% meta traced with either tpm/5 or tpm_ms/5.
-%% This function is synchronous, waiting for a reply from the meta server.
-init_tpm(Pid,Mod,Func,Arity,CallFunc) ->
- init_tpm(Pid,Mod,Func,Arity,void,CallFunc,void,void).
-init_tpm(Pid,Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc) ->
- send_wait(Pid,
- {init_tpm,{Mod,Func,Arity},InitFunc,CallFunc,ReturnFunc,RemoveFunc}).
-%% -----------------------------------------------------------------------------
-
-%% tpm(Pid,Mod,Func,Arity,MatchSpec)={ok,N}|{error,Reason}
-%% tpm(Pid,Mod,Func,Arity,MatchSpec,CallFunc)={ok,N}|{error,Reason}
-%% tpm(Pid,Mod,Func,Arity,MatchSpec,InitFunc,CallFunc,ReturnFunc,RemoveFunc)=
-%% Pid=Address to meta tracer process, pid().
-%% Mod,Func=Pointing out the function which shall be meta traced, atom().
-%% Arity=As above, integer().
-%% MatchSpec=List of match specification, possibly empty. Remember {return_trace}
-%% if expecting return_from messages.
-%% InitFunc,CallFunc,ReturnFunc,RemoveFunc={Module,Function}|fun(),
-%% functions being called when these functions are called by the meta trace
-%% server at certain events.
-%% CallFunc(CallingPid,ActualArgList,PublLD)->{ok,NewPrivLD,Output}
-%% ReturnFunc(CallingPid,ReturnValue,PublLD)->{ok,NewPrivLD,Output}
-%% When a call respectively return_from trace message arrives for the meta
-%% traced function, the corresponding function is called.
-%% The ReturnFunc must handle the fact that a return_from message arrives
-%% for a call which was never noticed. This because the message queue of the
-%% meta tracer may have been emptied.
-%% Reason=badarg |
-%% Output=Characters to be written to the ti-file, bin() | 'void'
-%% The tpm/5 function simply starts meta tracing for the function. It must
-%% previously have been initialized.
-%% tpm/6 & /9 initializes the function and starts meta tracing.
-tpm(Pid,Mod,Func,Arity,MatchSpec)
- when is_atom(Mod),is_atom(Func),is_integer(Arity),is_list(MatchSpec),Mod/='_',Func/='_'->
- send_wait(Pid,{tpm,{Mod,Func,Arity,MatchSpec}});
-tpm(_,_,_,_,_) ->
- {error,badarg}.
-
-tpm(Pid,Mod,Func,Arity,MatchSpec,CallFunc) ->
- tpm(Pid,Mod,Func,Arity,MatchSpec,void,CallFunc,void,void).
-
-tpm(Pid,Mod,Func,Arity,MatchSpec,InitFunc,CallFunc,ReturnFunc,RemoveFunc)
- when is_atom(Mod),is_atom(Func),is_integer(Arity),is_list(MatchSpec),Mod/='_',Func/='_' ->
- send_wait(Pid,{tpm,{Mod,Func,Arity,MatchSpec},InitFunc,CallFunc,ReturnFunc,RemoveFunc});
-tpm(_,_,_,_,_,_,_,_,_) ->
- {error,badarg}.
-%% -----------------------------------------------------------------------------
-
-%% Same as tpm/X but the meta tracer will automatically append {tracer,Tracer}
-%% to the enable list in a {trace,Disable,Enable} match spec action term.
-tpm_tracer(Pid,Mod,Func,Arity,MatchSpec)
- when is_atom(Mod),is_atom(Func),is_integer(Arity),is_list(MatchSpec),Mod/='_',Func/='_'->
- send_wait(Pid,{tpm_tracer,{Mod,Func,Arity,MatchSpec}});
-tpm_tracer(_,_,_,_,_) ->
- {error,badarg}.
-
-tpm_tracer(Pid,Mod,Func,Arity,MatchSpec,CallFunc) ->
- tpm_tracer(Pid,Mod,Func,Arity,MatchSpec,void,CallFunc,void,void).
-
-tpm_tracer(Pid,Mod,Func,Arity,MatchSpec,InitFunc,CallFunc,ReturnFunc,RemoveFunc)
- when is_atom(Mod),is_atom(Func),is_integer(Arity),is_list(MatchSpec),Mod/='_',Func/='_' ->
- send_wait(Pid,{tpm_tracer,
- {Mod,Func,Arity,MatchSpec},
- InitFunc,CallFunc,ReturnFunc,RemoveFunc});
-tpm_tracer(_,_,_,_,_,_,_,_,_) ->
- {error,badarg}.
-%% -----------------------------------------------------------------------------
-
-%% tpm_ms(Pid,Mod,Func,Arity,MSname,MS)={ok,N}|{error,Reason}
-%% Pid=Address to meta tracer process, pid().
-%% Mod,Func=Pointing out the function to which we shall add a match-spec., atom().
-%% Arity=As above, integer().
-%% MSname=A name to be used if this MS shall be removed later. term().
-%% MatchSpec=List of match specification, Remember {return_trace}
-%% if expecting return_from messages.
-%% This function adds a list of match-specs to the already existing ones. It
-%% uses an internal database to keep track of existing match-specs. If the
-%% match-spec does not result in any meta traced functions (for whatever reason),
-%% the MS is not saved in the database. The previously known match-specs are
-%% not removed.
-tpm_ms(Pid,Mod,Func,Arity,MSname,MS) ->
- send_wait(Pid,{tpm_ms,{Mod,Func,Arity},MSname,MS}).
-%% -----------------------------------------------------------------------------
-
-%% Same as tpm_ms/6 but the meta tracer will automatically append {tracer,Tracer}
-%% to the enable list in a {trace,Disable,Enable} match spec action term.
-tpm_ms_tracer(Pid,Mod,Func,Arity,MSname,MS) ->
- send_wait(Pid,{tpm_ms_tracer,{Mod,Func,Arity},MSname,MS}).
-%% -----------------------------------------------------------------------------
-
-%% ctpm_ms(Pid,Mod,Func,Arity)=ok
-%%
-%% Removes a names match-spec from the meta traced function. Note that is never
-%% a fault to remove an MS. Not even from a function which is non existant.
-ctpm_ms(Pid,Mod,Func,Arity,MSname) ->
- send_wait(Pid,{ctpm_ms,{Mod,Func,Arity},MSname}).
-%% -----------------------------------------------------------------------------
-
-%% Quick versions for erlang:register/2 which also uses a default CallFunc
-%% and a default ReturnFunc.
-local_register(Pid) ->
- Res1=tpm(Pid,
- erlang,register,2,[{'_',[],[{exception_trace}]}],
- fun metafunc_init/4,fun local_register_call/3,
- fun local_register_return/3,void),
- Res2=tpm(Pid,
- erlang,unregister,1,[],
- void,fun local_unregister_call/3,void,void),
- {Res1,Res2}.
-%% -----------------------------------------------------------------------------
-
-%% Quick version for global:register_name/2, /3.
-global_register(Pid) ->
- Res1=tpm(Pid,global,handle_call,3,[{[{register,'_','_','_'},'_','_'],[],[]}],
- void,fun global_register_call/3,void,void),
- Res2=tpm(Pid,global,delete_global_name,2,[],
- void,fun global_unregister_call/3,void,void),
- {Res1,Res2}.
-%% -----------------------------------------------------------------------------
-
-%% ctpm(Pid,Mod,Func,Arity)=ok|{error,bad_mfa}
-%%
-%% Removes the meta trace pattern for the function, means stops generating output
-%% for this function. The public LD may be cleared by the previously entered
-%% RemoveFunc.
-ctpm(Pid,Mod,Func,Arity) ->
- send_wait(Pid,{ctpm,{Mod,Func,Arity}}).
-%% -----------------------------------------------------------------------------
-
-%% remove_local_register(Pid)={Res1,Res2}
-%% Res1,Res2=ok|{error,Reason}
-remove_local_register(Pid) ->
- Res1=ctpm(Pid,erlang,register,2),
- Res2=ctpm(Pid,erlang,unregister,1),
- {Res1,Res2}.
-%% -----------------------------------------------------------------------------
-
-%% remove_global_register(Pid)={Res1,Res2}
-%% Res1,Res2=ok|{error,Reason}
-remove_global_register(Pid) ->
- Res1=ctpm(Pid,global,handle_call,3),
- Res2=ctpm(Pid,global,delete_global_name,2),
- {Res1,Res2}.
-%% -----------------------------------------------------------------------------
-
-%% Exported help functions which may be used in programming CallFunc and/or
-%% ReturnFunc. Useful if the call is done on one node but must trigger the
-%% start of something at other nodes.
-metacast_call(Nodes,OrigPid,M,F,Args) ->
- multicast(Nodes,{trace_ts,OrigPid,call,{M,F,Args},void}),
- ok.
-
-metacast_return_from(Nodes,OrigPid,M,F,Arity,Value) ->
- multicast(Nodes,{trace_ts,OrigPid,return_from,{M,F,Arity},Value,void}),
- ok.
-
-multicast([Node|Rest],Msg) ->
- {?MODULE,Node} ! Msg,
- multicast(Rest,Msg);
-multicast([],_) ->
- true.
-%% -----------------------------------------------------------------------------
-
-%% get_states(Pid)={ok,LD,PubLD}.
-get_state(Pid) ->
- send_wait(Pid,get_state).
-%% -----------------------------------------------------------------------------
-
-
-send_wait(To,Msg) ->
- Ref=make_ref(),
- MRef=erlang:monitor(process,To),
- To ! {Msg,Ref,self()},
- receive
- {inviso_rt_meta_reply,Ref,Reply} ->
- erlang:demonitor(MRef),
- Reply;
- {'DOWN',MRef,_,_To,_Reason} ->
- {error,no_metatracer}
- end.
-
-reply(To,Ref,Reply) ->
- To ! {inviso_rt_meta_reply,Ref,Reply}.
-%% -----------------------------------------------------------------------------
-
-%% =============================================================================
-%% Special API.
-%% =============================================================================
-
-%% write_ti(OutPut)=
-%% OutPut=binary()
-%% Makes an extra entry into the trace information file (ti-file). This is useful
-%% if a pid-alias association is learned in another way than through a meta traced
-%% function call. Note that this API can only be used locally at the node in
-%% question.
-write_ti(OutPut) ->
- catch ?MODULE ! {write_ti,OutPut}.
-%% -----------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% API intended to be used on CallFuncs and RemoveFuncs.
-%% =============================================================================
-
-%% The reason there must be a special API for CallFuncs and RemoveFuncs are is
-%% that those functions are executed inside *this* process context. Hence they
-%% can not make function calls requiering this process to receive messages.
-
-%% Returns the tracer used for regular tracing. The reason this is implemented
-%% in this way is that this function is intended to be used in meta trace call-
-%% back functions. And there we can not have message passing API:s to the meta
-%% trace(!).
-get_tracer() ->
- get(tracer).
-%% -----------------------------------------------------------------------------
-
-%% Function equivalent to inviso_rt:tpm_ms/6. This function can *only* be used
-%% inside a CallFunc or a RemoveFunc.
-tpm_ms(Mod,Func,Arity,MSname,MS) ->
- case check_mfarity_exists(Mod,Func,Arity) of
- yes -> % Ok, and args must be ok then also.
- {ok,h_tpm_ms(Mod,Func,Arity,MSname,MS)};
- no ->
- {error,not_initiated}
- end.
-%% -----------------------------------------------------------------------------
-
-tpm_ms_tracer(Mod,Func,Arity,MSname,MS) ->
- case check_mfarity_exists(Mod,Func,Arity) of
- yes -> % Ok, and args must be ok then also.
- NewMS=add_tracer(MS,get_tracer()),
- {ok,h_tpm_ms(Mod,Func,Arity,MSname,NewMS)};
- no ->
- {error,not_initiated}
- end.
-%% -----------------------------------------------------------------------------
-
-%% Function that returns all MSname in use for Mod:Func/Arity
-list_tpm_ms(Mod,Func,Arity) ->
- {ok,h_list_tpm_ms(Mod,Func,Arity)}.
-%% -----------------------------------------------------------------------------
-
-%% Function equivalent to inviso_rt:ctpm_ms/5. This function can *only* be used
-%% inside a CallFunc or a RemoveFunc.
-ctpm_ms(Mod,Func,Arity,MSname) ->
- h_ctpm_ms(Mod,Func,Arity,MSname),
- ok.
-%% -----------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% The server implemenation.
-%% =============================================================================
-
-init(Parent,TiData,Tracer,InitPublLDmfa,RemovePublLDmf,CleanPublLDmf) ->
- process_flag(priority,high), % Since we may receive from many procs.
- register(?MODULE,self()), % So we can act as relay receiver.
- case open_traceinfo_file(TiData) of
- {ok,TI} -> % The ti.-file.
- TId=ets:new(?NAMED_MS_TAB,[named_table,set,protected]),
- PublLD=do_init_publ_ld(InitPublLDmfa),
- Parent ! {self(),ok},
- put(tracer,Tracer), % Uggly quick fix!
- loop(Parent,
- Tracer,
- TI,
- mk_new_ld(InitPublLDmfa,RemovePublLDmf,CleanPublLDmf,TId),
- PublLD,
- now());
- {error,Reason} ->
- Parent ! {self(),{error,Reason}}
- end.
-%% -----------------------------------------------------------------------------
-
-loop(Parent,Tracer,TI,LD,PrevPublLD,PrevCleanTime) ->
- {PublLD,CleanTime}=throw_old_failed(get_cleanpublldmf_ld(LD),PrevPublLD,PrevCleanTime),
- receive
- {{init_tpm,{Mod,Func,Arity},InitFunc,CallFunc,ReturnFunc,RemoveFunc},Ref,Parent} ->
- case check_mfarity_exists(Mod,Func,Arity) of
- no -> % Good then we can add it!
- case check_tpm_args(Mod,Func,Arity) of
- true -> % Args are ok.
- {NewLD,NewPublLD}=
- h_init_tpm(Mod,Func,Arity,
- InitFunc,CallFunc,ReturnFunc,RemoveFunc,
- TI,LD,PublLD),
- reply(Parent,Ref,ok),
- loop(Parent,Tracer,TI,NewLD,NewPublLD,CleanTime);
- false -> % Faulty arguments,
- reply(Parent,Ref,{error,bad_mfa}),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime)
- end;
- yes -> % If it already exists, cant init again.
- reply(Parent,Ref,{error,already_initiated}),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime)
- end;
- {{tpm,{Mod,Func,Arity,MS},InitFunc,CallFunc,ReturnFunc,RemoveFunc},Ref,Parent} ->
- case check_mfarity_exists(Mod,Func,Arity) of
- no -> % Good then we can add it!
- case check_tpm_args(Mod,Func,Arity) of
- true -> % Args are ok.
- {NewLD,NewPublLD,N}=
- h_tpm(Mod,Func,Arity,MS,
- InitFunc,CallFunc,ReturnFunc,RemoveFunc,
- TI,LD,PublLD),
- reply(Parent,Ref,{ok,N}),
- loop(Parent,Tracer,TI,NewLD,NewPublLD,CleanTime);
- false ->
- reply(Parent,Ref,{error,bad_mfa}),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime)
- end;
- yes ->
- reply(Parent,Ref,{error,already_initiated}),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime)
- end;
- {{tpm,{Mod,Func,Arity,MS}},Ref,Parent} ->
- case check_mfarity_exists(Mod,Func,Arity) of
- yes -> % Ok, and args must be ok then also.
- {NewLD,N}=h_tpm(Mod,Func,Arity,MS,LD),
- reply(Parent,Ref,{ok,N}),
- loop(Parent,Tracer,TI,NewLD,PublLD,CleanTime);
- no -> % Must be initiated before.
- reply(Parent,Ref,{error,not_initiated}),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime)
- end;
- {{tpm_tracer,{Mod,Func,Arity,MS},InitFunc,CallFunc,ReturnFunc,RemoveFunc},Ref,Parent} ->
- case check_mfarity_exists(Mod,Func,Arity) of
- no -> % Good then we can add it!
- case check_tpm_args(Mod,Func,Arity) of
- true -> % Args are ok.
- NewMS=add_tracer(MS,Tracer),
- {NewLD,NewPublLD,N}=
- h_tpm(Mod,Func,Arity,NewMS,
- InitFunc,CallFunc,ReturnFunc,RemoveFunc,
- TI,LD,PublLD),
- reply(Parent,Ref,{ok,N}),
- loop(Parent,Tracer,TI,NewLD,NewPublLD,CleanTime);
- false ->
- reply(Parent,Ref,{error,bad_mfa}),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime)
- end;
- yes ->
- reply(Parent,Ref,{error,already_initiated}),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime)
- end;
- {{tpm_tracer,{Mod,Func,Arity,MS}},Ref,Parent} ->
- case check_mfarity_exists(Mod,Func,Arity) of
- yes -> % Ok, and args must be ok then also.
- NewMS=add_tracer(MS,Tracer),
- {NewLD,N}=h_tpm(Mod,Func,Arity,NewMS,LD),
- reply(Parent,Ref,{ok,N}),
- loop(Parent,Tracer,TI,NewLD,PublLD,CleanTime);
- no -> % Must be initiated before.
- reply(Parent,Ref,{error,not_initiated}),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime)
- end;
- {{tpm_ms,{Mod,Func,Arity},MSname,MS},Ref,Parent} ->
- case check_mfarity_exists(Mod,Func,Arity) of
- yes -> % Ok, and args must be ok then also.
- reply(Parent,Ref,{ok,h_tpm_ms(Mod,Func,Arity,MSname,MS)}),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime);
- no ->
- reply(Parent,Ref,{error,not_initiated}),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime)
- end;
- {{tpm_ms_tracer,{Mod,Func,Arity},MSname,MS},Ref,Parent} ->
- case check_mfarity_exists(Mod,Func,Arity) of
- yes -> % Ok, and args must be ok then also.
- NewMS=add_tracer(MS,Tracer),
- reply(Parent,Ref,{ok,h_tpm_ms(Mod,Func,Arity,MSname,NewMS)}),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime);
- no ->
- reply(Parent,Ref,{error,not_initiated}),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime)
- end;
- {{ctpm_ms,{Mod,Func,Arity},MSname},Ref,Parent} ->
- reply(Parent,Ref,ok),
- h_ctpm_ms(Mod,Func,Arity,MSname),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime);
- {{ctpm,{Mod,Func,Arity}},Ref,Parent} ->
- case get_remove_func_ld(Mod,Func,Arity,LD) of
- false -> % Incorrect Mod:Func/Arity!
- reply(Parent,Ref,{error,bad_mfa}),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime); % Do nothing!
- MF -> % {M,F}, Func or 'void'.
- catch erlang:trace_pattern({Mod,Func,Arity},false,[meta]),
- NewPublLD=do_removefunc(MF,Mod,Func,Arity,PublLD),
- NewLD=ctpm_ld(Mod,Func,Arity,LD),
- reply(Parent,Ref,ok),
- loop(Parent,Tracer,TI,NewLD,NewPublLD,CleanTime)
- end;
- {suspend,Parent} -> % Removes all meta trace patterns.
- stop_all_meta_tracing(get_all_meta_funcs_ld(LD),PublLD,LD),
- do_remove_publ_ld(get_removepublldmf_ld(LD),PublLD),
- NewPublLD=do_init_publ_ld(get_initpublldmfa_ld(LD)),
- loop(Parent,Tracer,TI,reset_ld(LD),NewPublLD,CleanTime);
- {stop,Parent} -> % Make a controlled shutdown.
- stop_all_meta_tracing(get_all_meta_funcs_ld(LD),PublLD,LD),
- do_remove_publ_ld(get_removepublldmf_ld(LD),PublLD),
- close_traceinfo_file(TI); % And then simply terminate.
- {trace_ts,Pid,call,{M,F,Args},TS} ->
- case handle_meta(get_call_func_ld(M,F,length(Args),LD),Pid,{call,Args,TS},PublLD) of
- {ok,NewPublLD,Output} when is_binary(Output);is_list(Output) ->
- write_output(TI,Output),
- loop(Parent,Tracer,TI,LD,NewPublLD,CleanTime);
- {ok,NewPublLD,_} -> % No output to the ti-file this time.
- loop(Parent,Tracer,TI,LD,NewPublLD,CleanTime);
- _ -> % Not handled correct, not much to do.
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime)
- end;
- {trace_ts,Pid,TypeTag,{M,F,Arity},Value,TS}
- when TypeTag==return_from;TypeTag==exception_from ->
- case handle_meta(get_return_func_ld(M,F,Arity,LD),Pid,{TypeTag,Value,TS},PublLD) of
- {ok,NewPublLD,Output} when is_binary(Output);is_list(Output) ->
- write_output(TI,Output),
- loop(Parent,Tracer,TI,LD,NewPublLD,CleanTime);
- {ok,NewPublLD,_} -> % No output to the ti-file this time.
- loop(Parent,Tracer,TI,LD,NewPublLD,CleanTime);
- _ -> % Not handled correct, not much to do.
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime)
- end;
- {relayed_meta,Bin} ->
- write_output(TI,Bin),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime);
- {write_ti,OutPut} ->
- write_output(TI,OutPut),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime);
- {get_state,Ref,From} -> % Debug function.
- reply(From,Ref,{ok,LD,PublLD}),
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime);
- _Other ->
- loop(Parent,Tracer,TI,LD,PublLD,CleanTime)
- end.
-
-
-%% =============================================================================
-%% First level help functions.
-%% =============================================================================
-
-%% Function which opens the trace-information file(s). It must understand
-%% the tidata specification which is part of the tracerdata given to the
-%% runtime component during init_tracing.
-%% It must return an internal notation of the time of file open and a
-%% useful descriptor the write_output function can use.
-%% Returns {ok,TiDescriptor} or {error,Reason}.
-open_traceinfo_file({file,FileName}) -> % A plain raw binary file.
- case file:open(FileName,[write,raw,binary]) of
- {ok,FD} ->
- {ok,{file,FD}};
- {error,Reason} ->
- {error,{open,[FileName,Reason]}}
- end;
-open_traceinfo_file({relay,ToNode}) -> % Use distributed Erlang.
- {ok,{relay,ToNode}};
-open_traceinfo_file(IncorrectTI) ->
- {error,{badarg,IncorrectTI}}.
-%% -----------------------------------------------------------------------------
-
-close_traceinfo_file({file,FD}) ->
- file:close(FD);
-close_traceinfo_file(_) ->
- ok.
-%% -----------------------------------------------------------------------------
-
-%% Help function handling initializing meta tracing of a function.
-%% Returns {NewLD,NewPublLD}.
-h_init_tpm(Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc,TI,LD,PublLD) ->
- case do_initfunc(InitFunc,Mod,Func,Arity,PublLD) of
- {NewPublLD,Output} ->
- write_output(TI,Output),
- NewLD=init_tpm_ld(Mod,Func,Arity,CallFunc,ReturnFunc,RemoveFunc,LD),
- {NewLD,NewPublLD};
- false -> % The initfunc did not do anything.
- NewLD=init_tpm_ld(Mod,Func,Arity,CallFunc,ReturnFunc,RemoveFunc,LD),
- {NewLD,PublLD}
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function handling initializing meta tracing of a function and also
-%% set the meta trace pattern as specified.
-%% Returns {NewLD,NewPublLD,N}.
-h_tpm(Mod,Func,Arity,MS,InitFunc,CallFunc,ReturnFunc,RemoveFunc,TI,LD,PublLD) ->
- {NewLD,NewPublLD}=
- h_init_tpm(Mod,Func,Arity,InitFunc,CallFunc,ReturnFunc,RemoveFunc,TI,LD,PublLD),
- case set_meta_tracing(Mod,Func,Arity,MS) of
- true -> % Ok, set one pattern.
- {NewLD,NewPublLD,1};
- false ->
- {NewLD,NewPublLD,0}
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function handling setting meta trace patter for a function which has
-%% already been intialized. Note that we must remove all potentially stored
-%% match-specs, if this function has been given match-specs before with
-%% tpm_ms.
-%% Returns a {NewLD,N}.
-h_tpm(Mod,Func,Arity,MS,LD) ->
- case set_meta_tracing(Mod,Func,Arity,MS) of
- true ->
- {remove_ms_ld(Mod,Func,Arity,LD),1};
- false ->
- {LD,0}
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function that adds a match-spec to Mod:Func/Arity. It is not defined
-%% in which order the match-specs will be given to the BIF.
-%% Note that if an MS with the same name as an exiting is inserted, the previous
-%% match-spec will be removed.
-%% Very important to realise is that the empty meta match spec [] imposes no
-%% restrictions what so ever on the generating of meta trace call messages.
-%% Uncontrolled sending of such messages may quickly drain power from the system.
-%% Since an empty match-spec will "disappear" when added to other match specs,
-%% the empty match is transformed to what it actually is: [{'_',[],[]}].
-%% Returns 0 or 1 indicating failure or success.
-h_tpm_ms(Mod,Func,Arity,MSname,MS) ->
- MSsNames=get_ms_ld(Mod,Func,Arity), % Fetch all previous match-specs.
- TransformedMS=h_tpm_ms_convert_null_ms(MS),
- MSsNames1=lists:keydelete(MSname,1,MSsNames), % If it already existed, it is gone!
- NewMSs=lists:flatten([TransformedMS,lists:map(fun({_Name,MSx})->MSx end,MSsNames1)]),
- case set_meta_tracing(Mod,Func,Arity,NewMSs) of
- true -> % We only save the MS if it was good.
- put_ms_ld(Mod,Func,Arity,MSname,TransformedMS,MSsNames1),
- 1;
- false ->
- 0
- end.
-
-%% Help function converting the null match spec into, still a null match spec,
-%% on a proper match spec format. This because it will otherwise be difficult
-%% to see the difference between no active tpm_ms and all a set of null ms.
-h_tpm_ms_convert_null_ms([]) ->
- [{'_',[],[]}];
-h_tpm_ms_convert_null_ms(MS) ->
- MS.
-%% -----------------------------------------------------------------------------
-
-%% Help function returning a list of all names used for match-functions for
-%% the Mod:Func/Arity in question.
-h_list_tpm_ms(Mod,Func,Arity) ->
- MSsNames=get_ms_ld(Mod,Func,Arity), % A list of {MSname,MS}.
- lists:map(fun({MSname,_})->MSname end,MSsNames).
-%% -----------------------------------------------------------------------------
-
-%% Function that removes a named match-spec. Returns nothing significant.
-%% Note that if we end up with no match-specs, we must remove the meta trace
-%% patten all together. That is bringing the function back to just initiated.
-h_ctpm_ms(Mod,Func,Arity,MSname) ->
- case get_ms_ld(Mod,Func,Arity) of
- [] -> % The name does certainly not exist!
- true; % We don't have to do anything.
- MSsNames ->
- case lists:keysearch(MSname,1,MSsNames) of
- {value,{_,_MS}} -> % Ok, we must do something!
- NewMSsNames=lists:keydelete(MSname,1,MSsNames),
- case lists:flatten(lists:map(fun({_Name,MS})->MS end,NewMSsNames)) of
- [] -> % This means stop meta tracing.
- set_meta_tracing(Mod,Func,Arity,false);
- NewMSs ->
- set_meta_tracing(Mod,Func,Arity,NewMSs)
- end,
- set_ms_ld(Mod,Func,Arity,NewMSsNames);
- false -> % But this name does not exist.
- true % So we do not have to do anything.
- end
- end.
-%% -----------------------------------------------------------------------------
-
-%% Function that checks the arguments to the meta trace pattern. The reason we
-%% must do this is that we can only allow meta tracing on specific functions and
-%% not using wildpatterns. Otherwise the meta trace server will not understand
-%% which callfunc for instance to call when a meta-trace message is generated
-%% for a function.
-%% Returns 'true' or 'false'.
-check_tpm_args(Mod,Func,Arity)
- when is_atom(Mod),is_atom(Func),is_integer(Arity),Mod/='_',Func/='_' ->
- true;
-check_tpm_args(_,_,_) ->
- false.
-%% -----------------------------------------------------------------------------
-
-%% Help function which calls the actual BIF setting meta-trace-patterns.
-%% Returns 'true' or 'false'.
-set_meta_tracing(Mod,Func,Arity,MS) when is_atom(Mod) ->
- case erlang:module_loaded(Mod) of
- true ->
- set_meta_tracing_2(Mod,Func,Arity,MS);
- false -> % The module is not loaded.
- case code:ensure_loaded(Mod) of
- {module,_Mod} ->
- set_meta_tracing_2(Mod,Func,Arity,MS);
- {error,_Reason} -> % Could not load the module.
- false % No use try to trace.
- end
- end;
-set_meta_tracing(_,_,_,_) ->
- false.
-
-set_meta_tracing_2(Mod,Func,Arity,MS) ->
- case catch erlang:trace_pattern({Mod,Func,Arity},MS,[meta]) of
- 0 -> % Hmm, nothing happend :-)
- false;
- N when is_integer(N) -> % The normal case, some functions were hit.
- true;
- {'EXIT',_Reason} ->
- false
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function which removes all meta trace pattern for the functions mentioned
-%% in the list being first argument. It also executes the remove funcs for each
-%% and every no longer meta traced function. This done since some of the remove
-%% functions may do side-effects (like deleteing ETS tables).
-%% Returns nothing significant.
-stop_all_meta_tracing([{M,F,Arity}|Rest],PublLD,LD) ->
- catch erlang:trace_pattern({M,F,Arity},false,[meta]),
- NewPublLD=do_removefunc(get_remove_func_ld(M,F,Arity,LD),M,F,Arity,PublLD),
- stop_all_meta_tracing(Rest,NewPublLD,LD);
-stop_all_meta_tracing([],_,_) ->
- true.
-%% -----------------------------------------------------------------------------
-
-%% This function calls the function registered to be handler for a certain
-%% meta-traced function. Such a function or fun must take three arguments
-%% and return {ok,NewPrivLD,OutPutBinary} or 'false'. OutPutBinary may be
-%% something else, and is then ignored.
-handle_meta({M,F},Pid,Arg1,PrivLD) ->
- (catch M:F(Pid,Arg1,PrivLD));
-handle_meta(Fun,Pid,Arg1,PrivLD) when is_function(Fun) ->
- (catch Fun(Pid,Arg1,PrivLD));
-handle_meta(_,_,_,_) -> % Don't know how to do this.
- false.
-%% -----------------------------------------------------------------------------
-
-%% Help function writing output from a callback function to the ti-file.
-%% Output can be a binary or a list of binaries.
-write_output(TI,[OutPut|Rest]) ->
- write_output(TI,OutPut),
- write_output(TI,Rest);
-write_output({file,FD},Bin) when is_binary(Bin) -> % Plain direct-binary file
- Size=byte_size(Bin),
- file:write(FD,list_to_binary([<<0,Size:32>>,Bin]));
-write_output({relay,ToNode},Bin) when is_atom(ToNode),is_binary(Bin) ->
- {inviso_rt_meta,ToNode} ! {relayed_meta,Bin};
-write_output(_,_) -> % Don't understand, just skip.
- true.
-%% -----------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% Various help functions.
-%% =============================================================================
-
-%% Help function initializing the public loopdata structure. Note that if the
-%% supplied InitPublLDmfa is faulty we let the structure become the error.
-%% The error will most likely turn up in an error report somewhere, eventually.
-do_init_publ_ld({M,F,Args}) when is_atom(M),is_atom(F),is_list(Args) ->
- case catch apply(M,F,Args) of
- {'EXIT',_Reason} ->
- {error,init_publ_ld_func}; % Let the struct be this error!
- InitialPublLD ->
- InitialPublLD
- end;
-do_init_publ_ld(_) ->
- {error,init_publ_ld_func}.
-%% -----------------------------------------------------------------------------
-
-%% Help function which removes the public loopdata structure. The function does
-%% not necessarily have to exist. Returns nothing significant.
-do_remove_publ_ld({M,F},PublLD) when is_atom(M),is_atom(F) ->
- catch M:F(PublLD);
-do_remove_publ_ld(_,_) ->
- true.
-%% -----------------------------------------------------------------------------
-
-%% Hlp function initializing a particular meta traced function into the public
-%% loopdata. Note that the function is not mandatory.
-%% Returns {NewPublLD,Output} or 'false'.
-do_initfunc({M,F},Mod,Func,Arity,PublLD) when is_atom(M),is_atom(F) ->
- case catch M:F(Mod,Func,Arity,PublLD) of
- {ok,NewPublLD,Output} ->
- {NewPublLD,Output};
- _ -> % Everything else is an error.
- false % Act as no initialization function.
- end;
-do_initfunc(Fun,Mod,Func,Arity,PublLD) when is_function(Fun) ->
- case catch Fun(Mod,Func,Arity,PublLD) of
- {ok,NewPublLD,Output} ->
- {NewPublLD,Output};
- _ -> % Everything else is an error.
- false % Act as no initialization function.
- end;
-do_initfunc(_,_,_,_,_) -> % Perhaps too generous, should be 'void' only.
- false.
-%% -----------------------------------------------------------------------------
-
-%% Help function removing a particular meta traced function from the public
-%% loopdata. Note that we do not make much noice should the call back function
-%% be faulty.
-do_removefunc({M,F},Mod,Func,Arity,PublLD) when is_atom(M),is_atom(F) ->
- case catch M:F(Mod,Func,Arity,PublLD) of
- {ok,NewPublLD} ->
- NewPublLD;
- _ -> % Everything else is an error.
- PublLD % Act as no initialization function.
- end;
-do_removefunc(Fun,Mod,Func,Arity,PublLD) when is_function(Fun) ->
- case catch Fun(Mod,Func,Arity,PublLD) of
- {ok,NewPublLD} ->
- NewPublLD;
- _ -> % Everything else is an error.
- PublLD % Act as no initialization function.
- end;
-do_removefunc(_,_,_,_,PublLD) ->
- PublLD.
-%% -----------------------------------------------------------------------------
-
-%% Function that, if the time has come, goes through the priv-ld structure and
-%% cleans away entryn left behind. The usual cause is that the function call
-%% caused an exception and there were therefore no matching return_from.
-%% Returns {NewPrivLD,now()}.
-throw_old_failed({M,F},PrivLD,PrevClean) ->
- case difference_in_now(PrevClean,now(),60) of % We clean once every minute.
- true ->
- case catch apply(M,F,[PrivLD]) of
- {'EXIT',_Reason} -> % Something went wrong, ignore it.
- {PrivLD,now()}; % Just keep the old priv-ld.
- NewPrivLD -> % The function must return a priv-ld.
- {NewPrivLD,now()}
- end;
- false -> % Not time yet!
- {PrivLD,PrevClean}
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function comparing two now timestamps. Returns true or false depending
-%% on if S2 is more than DiffS seconds after S1. Only works for differences
-%% less than 1 million seconds.
-difference_in_now({MegaS1,S1,_},{MegaS2,S2,_},DiffS) ->
- if
- MegaS1+1<MegaS2 -> % More than 1 Mega sec. difference.
- true;
- MegaS1==MegaS2,S1+DiffS<S2 ->
- true;
- MegaS1+1==MegaS2,S1+DiffS<S2+1000000 ->
- true;
- true ->
- false
- end.
-%% -----------------------------------------------------------------------------
-
-%% This help function adds a {tracer,Tracer} to the enable-list in a 'trace'
-%% match spec action. The reason for this is that the author of the a meta
-%% match spec meant to turn tracing on for the process executing the match spec
-%% can not know the tracer. This since the match spec is most likely authored
-%% at the control component's node, and not here.
-%% Note the double tuple necessary to make it just precise a tuple!
-%% Returns a new match spec.
-add_tracer([MS1|Rest],Tracer) ->
- [add_tracer_2(MS1,Tracer)|add_tracer(Rest,Tracer)];
-add_tracer([],_) ->
- [];
-add_tracer(NotList,_Tracer) -> % Can be 'false', but also an error.
- NotList.
-
-add_tracer_2({Head,Cond,Body},Tracer) ->
- {Head,Cond,add_tracer_3(Body,Tracer)};
-add_tracer_2(Faulty,_Tracer) ->
- Faulty.
-
-add_tracer_3([{trace,Disable,Enable}|Rest],Tracer) when is_list(Enable) ->
- [{trace,Disable,Enable++[{{tracer,Tracer}}]}|Rest];
-add_tracer_3([ActionTerm|Rest],Tracer) ->
- [ActionTerm|add_tracer_3(Rest,Tracer)];
-add_tracer_3([],_Tracer) ->
- [];
-add_tracer_3(FaultyBody,_Tracer) ->
- FaultyBody.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% Help functions handling internal loopdata.
-%% -----------------------------------------------------------------------------
-
--record(ld,{init_publ_ld_mfa, % {M,F,Args}
- remove_publ_ld_mf, % {M,F} | void
- clean_publ_ld_mf, % {Mod,Func}
- ms_mfarities=notable, % ETS holding names match functions.
- call_mfarities=[], % [{{M,F,Arity},2-TupleOrFun},...]
- return_mfarities=[], % [{{M,F,Arity},2-TupleOrFun},...]
- remove_mfarities=[]
- }).
-
-mk_new_ld(InitPublLDmfa,RemovePublLDmf,CleanPublLDmf,TId) ->
- #ld{
- init_publ_ld_mfa=InitPublLDmfa,
- remove_publ_ld_mf=RemovePublLDmf,
- clean_publ_ld_mf=CleanPublLDmf,
- ms_mfarities=TId
- }.
-%% -----------------------------------------------------------------------------
-
-%% Function which restores the internal loop data to somekind of initial state.
-%% This is useful when tracing has been suspended.
-reset_ld(#ld{init_publ_ld_mfa=InitPublLDmfa,
- remove_publ_ld_mf=RemovePublLDmf,
- clean_publ_ld_mf=CleanPublLDmf,
- ms_mfarities=TId}) ->
- ets:match_delete(TId,{'_','_'}), % Empty the table.
- #ld{init_publ_ld_mfa=InitPublLDmfa,
- remove_publ_ld_mf=RemovePublLDmf,
- clean_publ_ld_mf=CleanPublLDmf,
- ms_mfarities=TId}.
-%% -----------------------------------------------------------------------------
-
-get_initpublldmfa_ld(#ld{init_publ_ld_mfa=InitPublLDmfa}) ->
- InitPublLDmfa.
-%% -----------------------------------------------------------------------------
-
-get_removepublldmf_ld(#ld{remove_publ_ld_mf=RemovePublLDmf}) ->
- RemovePublLDmf.
-%% -----------------------------------------------------------------------------
-
-get_cleanpublldmf_ld(#ld{clean_publ_ld_mf=CleanPublLDmf}) ->
- CleanPublLDmf.
-%% -----------------------------------------------------------------------------
-
-%% Help function adding data associated with a meta traced function to the
-%% internal loopdata. Called when meta tracing is activated for M:F/Arity.
-init_tpm_ld(M,F,Arity,CallFunc,ReturnFunc,RemoveFunc,LD) ->
- ets:insert(LD#ld.ms_mfarities,{{M,F,Arity},[]}),
- CallFuncs=LD#ld.call_mfarities,
- ReturnFuncs=LD#ld.return_mfarities,
- RemoveFuncs=LD#ld.remove_mfarities,
- LD#ld{call_mfarities=[{{M,F,Arity},CallFunc}|CallFuncs],
- return_mfarities=[{{M,F,Arity},ReturnFunc}|ReturnFuncs],
- remove_mfarities=[{{M,F,Arity},RemoveFunc}|RemoveFuncs]}.
-%% -----------------------------------------------------------------------------
-
-%% Help function which answers the question if we have already initiated the
-%% function. It is done by looking in the ETS-table with named match-functions.
-%% If there is an entry in the set-type table for M:F/Arity, the function is
-%% initiated.
-%% Returns 'yes' or 'no'.
-check_mfarity_exists(M,F,Arity) ->
- case ets:lookup(?NAMED_MS_TAB,{M,F,Arity}) of
- [] ->
- no;
- [_] ->
- yes
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function adding an entry with [{MSname,MSlist}|MSsNames] for M:F/Arity.
-%% Note that any already existing entry is removed.
-%% Returns nothing significant.
-put_ms_ld(M,F,Arity,MSname,MS,MSsNames) ->
- ets:insert(?NAMED_MS_TAB,{{M,F,Arity},[{MSname,MS}|MSsNames]}).
-%% -----------------------------------------------------------------------------
-
-%% Help function taking a list of {MSname,MSs} and storing them in the
-%% internal loop data structure. The storage is actually implemented as an ETS
-%% table. Any previous list of {MSname,MSs} associated with this {M,F,Arity} will
-%% be lost. Returns nothing significant.
-set_ms_ld(M,F,Arity,MSsNames) ->
- ets:insert(?NAMED_MS_TAB,{{M,F,Arity},MSsNames}).
-%% -----------------------------------------------------------------------------
-
-%% Help function fetching a list of {MSname,MatchSpecs} for a M:F/Arity. The
-%% match-functions are stored in an ETS table searchable on {M,F,Arity}.
-get_ms_ld(M,F,Arity) ->
- case ets:lookup(?NAMED_MS_TAB,{M,F,Arity}) of
- [{_MFArity,MSsNames}] ->
- MSsNames;
- [] ->
- []
- end.
-%% -----------------------------------------------------------------------------
-
-%% Help function removing all saved match-specs for a certain M:F/Arity.
-%% Returns a new loopdata structure.
-remove_ms_ld(M,F,Arity,LD) ->
- ets:delete(LD#ld.ms_mfarities,{M,F,Arity}),
- LD.
-%% -----------------------------------------------------------------------------
-
-%% Help function which removes all information about a meta traced function from
-%% the internal loopdata. Returns a new loopdata structure.
-ctpm_ld(M,F,Arity,LD) ->
- ets:delete(LD#ld.ms_mfarities,{M,F,Arity}),
- NewCallFuncs=lists:keydelete({M,F,Arity},1,LD#ld.call_mfarities),
- NewReturnFuncs=lists:keydelete({M,F,Arity},1,LD#ld.return_mfarities),
- NewRemoveFuncs=lists:keydelete({M,F,Arity},1,LD#ld.remove_mfarities),
- LD#ld{call_mfarities=NewCallFuncs,
- return_mfarities=NewReturnFuncs,
- remove_mfarities=NewRemoveFuncs}.
-%% -----------------------------------------------------------------------------
-
-get_call_func_ld(M,F,Arity,#ld{call_mfarities=CallFuncs}) ->
- case lists:keysearch({M,F,Arity},1,CallFuncs) of
- {value,{_,MF}} ->
- MF;
- false ->
- false
- end.
-%% -----------------------------------------------------------------------------
-
-get_return_func_ld(M,F,Arity,#ld{return_mfarities=CallFuncs}) ->
- case lists:keysearch({M,F,Arity},1,CallFuncs) of
- {value,{_,MF}} ->
- MF;
- false ->
- false
- end.
-%% -----------------------------------------------------------------------------
-
-get_remove_func_ld(M,F,Arity,#ld{remove_mfarities=RemoveFuncs}) ->
- case lists:keysearch({M,F,Arity},1,RemoveFuncs) of
- {value,{_,MF}} ->
- MF;
- false ->
- false
- end.
-%% -----------------------------------------------------------------------------
-
-%% Function returning a list of all {Mod,Func,Arity} which are currently meta
-%% traced. It does do by listifying the call_mfarities field in the internal
-%% loopdata.
-get_all_meta_funcs_ld(#ld{call_mfarities=CallFuncs}) ->
- lists:map(fun({MFArity,_})->MFArity end,CallFuncs).
-%% -----------------------------------------------------------------------------
-
-
-%% =============================================================================
-%% Functions for the standard PublLD structure.
-%%
-%% It is tuple {Part1,GlobalData} where Part1 is of length at least 2.
-%% Where each field is a list of tuples. The last item in each tuple shall be
-%% a now tuple, making it possible to clean it away should it be too old to be
-%% relevant (there was no return_from message due to a failure).
-%% Other fields can be used for other functions.
-%% The GlobalData is not cleaned but instead meant to store data must be passed
-%% to each CallFunc when a meta trace message arrives.
-%% =============================================================================
-
-%% Function returning our standard priv-loopdata structure.
-init_std_publld(Size,GlobalData) ->
- {list_to_tuple(lists:duplicate(Size,[])),GlobalData}.
-%% -----------------------------------------------------------------------------
-
-%% Function capable of cleaning out a standard publ-ld. The last element of each
-%% tuple must be the now item.
-%% Returns a new publ-ld structure.
-clean_std_publld({Part1,GlobalData}) ->
- {clean_std_publld_2(Part1,now(),tuple_size(Part1),[]),GlobalData}.
-
-clean_std_publld_2(_,_,0,Accum) ->
- list_to_tuple(Accum);
-clean_std_publld_2(PublLD,Now,Index,Accum) ->
- NewTupleList=clean_std_publld_3(element(Index,PublLD),Now),
- clean_std_publld_2(PublLD,Now,Index-1,[NewTupleList|Accum]).
-
-clean_std_publld_3([Tuple|Rest],Now) ->
- PrevNow=element(tuple_size(Tuple),Tuple), % Last item shall be the now item.
- case difference_in_now(PrevNow,Now,30) of
- true -> % Remove it then!
- clean_std_publld_3(Rest,Now);
- false -> % Keep it!
- [Tuple|clean_std_publld_3(Rest,Now)]
- end;
-clean_std_publld_3([],_) ->
- [].
-%% -----------------------------------------------------------------------------
-
-%% =============================================================================
-%% Functions used as handling functions (as funs) for registered process names.
-%% (Given that we use the standard priv-ld, otherwise you must do your own!).
-%% =============================================================================
-
-%% Call-back for initializing the meta traced functions there are quick functions
-%% for. Returns a new public loop data structure.
-metafunc_init(erlang,register,2,{Part1,GlobalData}) ->
- {setelement(1,Part1,[]),GlobalData}.
-%% -----------------------------------------------------------------------------
-
-%% Call-function for erlang:register/2.
-%% This function adds the call to register/2 to a standard priv-ld structure.
-%% Note that we *must* search for previous entries from the same process. If such
-%% still in structure it means a failed register/2 call. It must first be removed
-%% so it can not be mixed up with this one. Since meta-trace message will arrive
-%% in order, there was no return_from message for that call if we are here now.
-local_register_call(CallingPid,{call,[Alias,Pid],TS},{Part1,GlobalData}) ->
- TupleList=element(1,Part1), % The register/2 entry in a std. priv-ld.
- NewTupleList=lists:keydelete(CallingPid,1,TupleList), % If present, remove previous call.
- {ok,
- {setelement(1,Part1,[{CallingPid,{Alias,Pid},TS}|NewTupleList]),GlobalData},
- void}.
-
-%% Return-function for the erlang:register/2 BIF.
-%% This function formulates the output and removes the corresponding call entry
-%% from the standard priv-ld structure.
-local_register_return(CallingPid,{return_from,_Val,_TS},PublLD={Part1,GlobalData}) ->
- TupleList=element(1,Part1), % The register/2 entry in a std. priv-ld.
- case lists:keysearch(CallingPid,1,TupleList) of
- {value,{_,{Alias,Pid},NowTS}} ->
- NewTupleList=lists:keydelete(CallingPid,1,TupleList),
- {ok,
- {setelement(1,Part1,NewTupleList),GlobalData},
- term_to_binary({Pid,Alias,alias,NowTS})};
- false -> % Strange, then don't know what to do.
- {ok,PublLD,void} % Do nothing seems safe.
- end;
-local_register_return(CallingPid,{exception_from,_Val,_TS},{Part1,GlobalData}) ->
- TupleList=element(1,Part1), % The register/2 entry in a std. priv-ld.
- NewTupleList=lists:keydelete(CallingPid,1,TupleList),
- {ok,{setelement(1,Part1,NewTupleList),GlobalData},void}; % No association then.
-local_register_return(_,_,PublLD) -> % Don't understand this.
- {ok,PublLD,void}.
-
-%% When unregister/1 us called we simply want a unalias entry in the ti-file.
-%% We can unfortunately not connect it with a certain pid.
-local_unregister_call(_CallingPid,{_TypeTag,[Alias],TS},PublLD) ->
- {ok,PublLD,term_to_binary({undefined,Alias,unalias,TS})}.
-%% -----------------------------------------------------------------------------
-
-%% Call-function for global:register_name/2,/3.
-%% This function is actually the call function for the handle_call/3 in the
-%% global server. Note that we must check that we only do this on the node
-%% where Pid actually resides.
-global_register_call(_CallingPid,{call,[{register,Alias,P,_},_,_],TS},PublLD)
- when node(P)==node()->
- {ok,PublLD,term_to_binary({P,{global,Alias},alias,TS})};
-global_register_call(_CallingPid,_,PublLD) ->
- {ok,PublLD,void}.
-
-%% Call-function for global:unregister_name. It acutally checks on the use of
-%% global:delete_global_name/2 which is called when ever a global name is removed.
-global_unregister_call(_CallingPid,{call,[Alias,P],TS},PublLD) when node(P)==node()->
- {ok,PublLD,term_to_binary({P,{global,Alias},unalias,TS})};
-global_unregister_call(_CallingPid,_,PublLD) ->
- {ok,PublLD,void}.
-%% -----------------------------------------------------------------------------
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
diff --git a/lib/runtime_tools/src/observer_backend.erl b/lib/runtime_tools/src/observer_backend.erl
index 2f8ffbcdb6..01e99f3f5e 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -22,7 +22,7 @@
-export([vsn/0]).
%% observer stuff
--export([sys_info/0, get_table/3, get_table_list/2]).
+-export([sys_info/0, get_table/3, get_table_list/2, fetch_stats/2]).
%% etop stuff
-export([etop_collect/1]).
@@ -198,6 +198,22 @@ get_table_list(mnesia, Opts) ->
end,
lists:foldl(Info, [], mnesia:system_info(tables)).
+fetch_stats(Parent, Time) ->
+ erlang:system_flag(scheduler_wall_time, true),
+ process_flag(trap_exit, true),
+ fetch_stats_loop(Parent, Time),
+ erlang:system_flag(scheduler_wall_time, false).
+
+fetch_stats_loop(Parent, Time) ->
+ receive
+ _Msg -> normal
+ after Time ->
+ _M = Parent ! {stats, 1,
+ erlang:statistics(scheduler_wall_time),
+ erlang:statistics(io),
+ erlang:memory()},
+ fetch_stats(Parent, Time)
+ end.
%%
%% etop backend
%%
diff --git a/lib/runtime_tools/src/runtime_tools.app.src b/lib/runtime_tools/src/runtime_tools.app.src
index 76fd998530..60be9ed7c9 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -17,16 +17,13 @@
%% %CopyrightEnd%
%%
{application, runtime_tools,
- [{description, "RUNTIME_TOOLS version 1"},
+ [{description, "RUNTIME_TOOLS"},
{vsn, "%VSN%"},
{modules, [dbg,observer_backend,percept_profile,
- inviso_rt,inviso_rt_lib,inviso_rt_meta,
- inviso_as_lib,inviso_autostart,inviso_autostart_server,
runtime_tools,runtime_tools_sup,erts_alloc_config,
- ttb_autostart]},
- {registered, [runtime_tools_sup,inviso_rt,inviso_rt_meta]},
+ ttb_autostart,dyntrace]},
+ {registered, [runtime_tools_sup]},
{applications, [kernel, stdlib]},
-% {env, [{inviso_autostart_mod,your_own_autostart_module}]},
{env, []},
{mod, {runtime_tools, []}}]}.
diff --git a/lib/runtime_tools/src/runtime_tools_sup.erl b/lib/runtime_tools/src/runtime_tools_sup.erl
index 913719c449..c8dab250dd 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -31,15 +31,11 @@
%% =============================================================================
%% The runtime tools top most supervisor starts:
-%% -The inviso runtime component. This is the only way to get the runtime component
-%% started automatically (if for instance autostart is wanted).
-%% Note that it is not impossible that the runtime component terminates it self
-%% should it discover that no autostart is configured.
+%% -The ttb_autostart component. This is used for tracing at startup
+%% using observer/ttb.
init(AutoModArgs) ->
Flags = {one_for_one, 0, 3600},
- Children = [{inviso_rt, {inviso_rt, start_link_auto, [AutoModArgs]},
- temporary, 3000, worker, [inviso_rt]},
- {ttb_autostart, {ttb_autostart, start_link, []},
+ Children = [{ttb_autostart, {ttb_autostart, start_link, []},
temporary, 3000, worker, [ttb_autostart]}],
{ok, {Flags, Children}}.
%% -----------------------------------------------------------------------------
diff --git a/lib/runtime_tools/test/Makefile b/lib/runtime_tools/test/Makefile
index cfaf420d65..bcabdf13ed 100644
--- a/lib/runtime_tools/test/Makefile
+++ b/lib/runtime_tools/test/Makefile
@@ -3,9 +3,8 @@ include $(ERL_TOP)/make/target.mk
include $(ERL_TOP)/make/$(TARGET)/otp.mk
MODULES = \
+ dyntrace_SUITE \
runtime_tools_SUITE \
- inviso_testmodule1_foo \
- inviso_SUITE \
dbg_SUITE \
erts_alloc_config_SUITE
@@ -56,10 +55,10 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) runtime_tools.spec runtime_tools.cover $(ERL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) $(EMAKEFILE) runtime_tools.cover $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) runtime_tools.spec runtime_tools.cover $(ERL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(EMAKEFILE) runtime_tools.cover "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/runtime_tools/test/dbg_SUITE.erl b/lib/runtime_tools/test/dbg_SUITE.erl
index bd908c1f3a..4071b159a1 100644
--- a/lib/runtime_tools/test/dbg_SUITE.erl
+++ b/lib/runtime_tools/test/dbg_SUITE.erl
@@ -394,41 +394,36 @@ file_port2(suite) ->
file_port2(doc) ->
["Test tracing to file port with 'follow_file'"];
file_port2(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- {skipped, "VxWorks NFS cache ruins it all."};
- _ ->
- ?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]),
- %% Ok, lets try with flush and follow_file, not a chance on VxWorks
- %% with NFS caching...
- ?line Port2 = dbg:trace_port(file, FName),
- ?line {ok, _} = dbg:tracer(port, Port2),
- try
- ?line {ok, [{matched, _node, 1}]} = dbg:p(self(),call),
- ?line {ok, _} = dbg:tp(dbg, ltp,[{'_',[],[{message, {self}}]}]),
- ?line {ok, _} = dbg:tp(dbg, ln, [{'_',[],[{message, hej}]}]),
- ?line ok = dbg:ltp(),
- ?line ok = dbg:flush_trace_port(),
- ?line dbg:trace_client(follow_file, FName,
- {fun myhandler/2, self()}),
- ?line S = self(),
- ?line [{trace,S,call,{dbg,ltp,[]},S}] = flush(),
- ?line ok = dbg:ln(),
- ?line ok = dbg:flush_trace_port(),
- ?line receive after 1000 -> ok end, %% Polls every second...
- ?line [{trace,S,call,{dbg,ln,[]},hej}] = flush(),
- ?line stop(),
- ?line [] = flush()
- after
- ?line stop(),
- ?line file:delete(FName)
- end,
- ok
- end.
+ 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]),
+ %% 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()
+ after
+ stop(),
+ file:delete(FName)
+ end,
+ ok.
file_port_schedfix(suite) ->
[];
diff --git a/lib/runtime_tools/test/dyntrace_SUITE.erl b/lib/runtime_tools/test/dyntrace_SUITE.erl
new file mode 100644
index 0000000000..0e4f369ed0
--- /dev/null
+++ b/lib/runtime_tools/test/dyntrace_SUITE.erl
@@ -0,0 +1,224 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(dyntrace_SUITE).
+-include_lib("test_server/include/test_server.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]).
+
+%% 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]}].
+
+all() ->
+ case erlang:system_info(dynamic_trace) of
+ none ->
+ {skip,"No dynamic trace in this run-time system"};
+ dtrace ->
+ [{group,smoke}];
+ systemtap ->
+ {skip,"SystemTap tests currently not supported"}
+ end.
+
+groups() ->
+ [{smoke,[sequence],[smoke,{group,rest}]},
+ {rest,[],
+ [process]}].
+
+init_per_suite(Config) ->
+ N = "beam" ++
+ case erlang:system_info(debug_compiled) of
+ false -> "";
+ true -> ".debug"
+ end ++
+ case erlang:system_info(smp_support) of
+ false -> "";
+ true -> ".smp"
+ end,
+ [{emu_name,N}|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),
+ BinEmu = list_to_binary(Emu),
+ case erlang:system_info(dynamic_trace) of
+ dtrace ->
+ Probes = os:cmd("sudo /usr/sbin/dtrace -l -m" ++ Emu),
+ io:put_chars(Probes),
+ [_|Lines] = re:split(Probes, "\n", [trim]),
+ [{_,_} = binary:match(L, BinEmu) || L <- Lines],
+ ok
+ end,
+
+ %% Test that the framework for running dtrace/systemtap works
+ %% by executing an empty script.
+ {ok,[]} = dyntrace("", fun() -> ok end),
+ ok.
+
+
+process(_Config) ->
+ Script = [{probe,"process-spawn"},
+ {action,[{printf,["spawn %s %s\n",{arg,0},{arg,1}]}]},
+ {probe,"process-scheduled"},
+ {action,[{printf,["in %s\n",{arg,0}]}]},
+ {probe,"process-unscheduled"},
+ {action,[{printf,["out %s\n",{arg,0}]}]},
+ {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}]}]}
+ ],
+ F = fun() ->
+ {Pid,Ref} = spawn_monitor(fun my_process/0),
+ Pid ! hibernate,
+ Pid ! quit,
+ receive
+ {'DOWN',Ref,process,Pid,{terminated,Pid}} ->
+ ok
+ end,
+ Pid
+ end,
+ {Pid,Output0} = dyntrace(Script, F),
+ Output1 = [termify_line(L) || L <- Output0],
+ PidStr = pid_to_list(Pid),
+ Output = [L || L <- Output1, element(2, L) =:= PidStr],
+ Reason = "{terminated,"++PidStr++"}",
+ io:format("~p\n", [Output]),
+ [{spawn,PidStr,"erlang:apply/2"},
+ {in,PidStr},
+ {hibernate,PidStr,"erlang:apply/2"},
+ {out,PidStr},
+ {in,PidStr},
+ {exit,PidStr,Reason},
+ {out,PidStr}] = Output,
+ ok.
+
+termify_line(L) ->
+ [H|T] = re:split(L, " ", [{return,list}]),
+ list_to_tuple([list_to_atom(H)|T]).
+
+my_process() ->
+ receive
+ hibernate ->
+ erlang:hibernate(erlang, apply, [fun my_process/0,[]]);
+ quit ->
+ exit({terminated,self()})
+ end.
+
+%%%
+%%% Utility functions.
+%%%
+
+dyntrace(Script0, Action) ->
+ Sudo = os:find_executable(sudo),
+ {Termination,Pid} = termination_probe(),
+ Script1 = Script0++Termination,
+ Script = translate_script(Script1),
+ io:format("~s\n", [Script]),
+ SrcFile = "test-dyntrace.d",
+ ok = file:write_file(SrcFile, Script),
+ Args = ["/usr/sbin/dtrace", "-q","-s",SrcFile],
+ Port = open_port({spawn_executable,Sudo},
+ [{args,Args},stream,in,stderr_to_stdout,eof]),
+ receive
+ {Port,{data,Sofar}} ->
+ Res = Action(),
+ Pid ! quit,
+ {Res,get_data(Port, Sofar)}
+ end.
+
+get_data(Port, Sofar) ->
+ receive
+ {Port,{data,Bytes}} ->
+ get_data(Port, [Sofar|Bytes]);
+ {Port,eof} ->
+ port_close(Port),
+ [$\n|T] = lists:flatten(Sofar),
+ re:split(T, "\n", [{return,list},trim])
+ end.
+
+termination_probe() ->
+ Pid = spawn(fun() ->
+ receive
+ _ ->
+ exit(done)
+ end
+ end),
+ S = [{'BEGIN',[{printf,["\n"]}]},
+ {probe,"process-exit"},
+ {pred,{'==',{arg,0},Pid}},
+ {action,[{exit,[0]}]}],
+ {S,Pid}.
+
+translate_script(Script) ->
+ [dtrace_op(Op) || Op <- Script].
+
+dtrace_op({probe,Function}) ->
+ OsPid = os:getpid(),
+ ["erlang",OsPid,":::",Function,$\n];
+dtrace_op({pred,Pred}) ->
+ ["/",dtrace_op(Pred),"/\n"];
+dtrace_op({action,List}) ->
+ ["{ ",action_list(List)," }\n\n"];
+dtrace_op({'BEGIN',List}) ->
+ ["BEGIN { ",action_list(List)," }\n\n"];
+dtrace_op({'==',Op1,Op2}) ->
+ [dtrace_op(Op1)," == ",dtrace_op(Op2)];
+dtrace_op({arg,N}) ->
+ ["copyinstr(arg",integer_to_list(N),")"];
+dtrace_op({Func,List}) when is_atom(Func), is_list(List) ->
+ [atom_to_list(Func),"(",comma_sep_ops(List),")"];
+dtrace_op(Pid) when is_pid(Pid) ->
+ ["\"",pid_to_list(Pid),"\""];
+dtrace_op(Str) when is_integer(hd(Str)) ->
+ io_lib:format("~p", [Str]);
+dtrace_op(Int) when is_integer(Int) ->
+ integer_to_list(Int).
+
+comma_sep_ops([A,B|T]) ->
+ [dtrace_op(A),","|comma_sep_ops([B|T])];
+comma_sep_ops([H]) ->
+ dtrace_op(H);
+comma_sep_ops([]) -> [].
+
+action_list([H|T]) ->
+ [dtrace_op(H),";"|action_list(T)];
+action_list([]) -> [].
diff --git a/lib/runtime_tools/test/inviso_SUITE.erl b/lib/runtime_tools/test/inviso_SUITE.erl
deleted file mode 100644
index 33626ffd9e..0000000000
--- a/lib/runtime_tools/test/inviso_SUITE.erl
+++ /dev/null
@@ -1,2838 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%% Description:
-%% Test suite for inviso (basic parts, i.e not inviso tools). Note that
-%% inviso basic parts have modules in both the runtime_tools and
-%% inviso applications.
-%%
-%% Authors:
-%% Ann-Marie L�f, [email protected]
-%% Lennart �hman, [email protected]
-%% -----------------------------------------------------------------------------
-
--module(inviso_SUITE).
--compile(export_all).
-
--include_lib("common_test/include/ct.hrl").
--include_lib("kernel/include/file.hrl").
-
--define(l,?line).
-
-suite() -> [{ct_hooks,[ts_install_cth]}].
-
-all() ->
- [basic_dist_trace_1, basic_dist_trace_2,
- basic_dist_trace_3, basic_dist_trace_ti_1,
- basic_dist_trace_ti_2, basic_dist_trace_ti_3,
- suspend_dist_trace_ti_1, suspend_dist_trace_ti_2,
- meta_cleanfunc_dist_1, basic_handlerfun_dist_1,
- delete_log_dist_1, autostart_dist_1, autostart_dist_2,
- autostart_dist_3, running_alone_dist_1,
- running_alone_dist_2, running_alone_dist_3,
- running_alone_dist_4, running_alone_dist_5,
- overload_dist_1, overload_dist_2, overload_dist_3,
- overload_dist_4, overload_dist_5, subscribe_dist_1,
- lfm_trace_dist_1, lfm_trace_ti_dist_2,
- handle_logfile_sort_wrapset, fetch_log_dist_trace_1,
- fetch_log_dist_trace_2, fetch_log_dist_trace_3,
- fetch_log_dist_error_1, fetch_log_dist_error_2,
- expand_regexp_dist_1, only_loaded_dist_1].
-
-groups() ->
- [].
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
-
-init_per_suite(Config) ->
- case test_server:is_native(lists) of
- true ->
- {skip,"Native libs -- tracing doesn't work"};
- false ->
- %% We never know who messed up this node before this suite! :-)
- erlang:trace_pattern({'_','_','_'},[],[local]),
- erlang:trace_pattern({'_','_','_'},[],[global]),
- erlang:trace(all,false,[all]),
-
- ok=application:start(runtime_tools),
- Config
- end.
-
-end_per_suite(_Config) ->
- ?l ok=application:stop(runtime_tools).
-
-
-%% For each distributed testcase, we need two other distributed nodes to run the
-%% runtime components on. Since they are freshly started every time there is no
-%% need to clean them up first.
-init_per_testcase(_Case,Config) ->
- ?l TH=test_server:timetrap(100000),
- ?l {ok,Node1}=test_server:start_node(inviso1,peer,[]),
- ?l {ok,Node2}=test_server:start_node(inviso2,peer,[]),
- ?l SuiteDir=filename:dirname(code:which(?MODULE)),
-
- %% Otherwise peer nodes will not find this module!
- ?l true=rpc:call(Node1,code,add_patha,[SuiteDir]),
- ?l true=rpc:call(Node2,code,add_patha,[SuiteDir]),
-
- ?l start_side_effect_logger(node()),
- ?l start_side_effect_logger(Node1),
- ?l start_side_effect_logger(Node2),
-
-
- %% SPECIAL FOR MY PRIVATE TEST ENVIROMENT
-% ?l rpc:call(Node1,code,add_patha,["/clearcase/otp/tools/runtime_tools/ebin"]),
-% ?l rpc:call(Node1,code,add_patha,["/clearcase/otp/tools/inviso/ebin"]),
-% ?l rpc:call(Node2,code,add_patha,["/clearcase/otp/tools/runtime_tools/ebin"]),
-% ?l rpc:call(Node2,code,add_patha,["/clearcase/otp/tools/inviso/ebin"]),
-
-% %% SPECIAL FOR MY PRIVATE TEST ENVIROMENT, windows.
-% ?l rpc:call(Node1,code,add_patha,["Z:/DATA/PROJECTS/inviso_project/runtime_tools/ebin"]),
-% ?l rpc:call(Node1,code,add_patha,["Z:/DATA/PROJECTS/inviso_project/inviso/ebin"]),
-% ?l rpc:call(Node2,code,add_patha,["Z:/DATA/PROJECTS/inviso_project/runtime_tools/ebin"]),
-% ?l rpc:call(Node2,code,add_patha,["Z:/DATA/PROJECTS/inviso_project/inviso/ebin"]),
-
- ?l ok=rpc:call(Node1,application,start,[runtime_tools]),
- ?l ok=rpc:call(Node2,application,start,[runtime_tools]),
- ?l timer:sleep(100), % Problem with autostarted runtime.
- %% The following is a test that the inviso_rt processes which are autostarted
- %% are now gone.
-
- ?l ok=poll(rpc,call,[Node1,erlang,whereis,[inviso_rt]],undefined,20),
- ?l ok=poll(rpc,call,[Node2,erlang,whereis,[inviso_rt]],undefined,20),
-
-% ?l ok=poll(rpc,call,[Node1,supervisor,which_children,[runtime_tools_sup]],[],20),
-% ?l ok=poll(rpc,call,[Node2,supervisor,which_children,[runtime_tools_sup]],[],20),
- NewConfig1=insert_remotenode_config(inviso1,Node1,Config),
- NewConfig2=insert_remotenode_config(inviso2,Node2,NewConfig1),
- insert_timetraphandle_config(TH,NewConfig2).
-%% -----------------------------------------------------------------------------
-
-end_per_testcase(Case,Config) ->
- ?l test_server:stop_node(get_remotenode_config(inviso1,Config)),
- ?l test_server:stop_node(get_remotenode_config(inviso2,Config)),
-
- case whereis(inviso_c) of
- undefined -> % Should not exist.
- true;
- Pid when is_pid(Pid) -> % But if it exists...
- exit(Pid,kill), % Remove it!
- io:format("Had to kill the control component in end_per_testcase,~p.~n",[Case])
- end,
- case whereis(inviso_rt) of
- undefined -> % Should not exist.
- true;
- Pid2 when is_pid(Pid2) -> % But if it exists...
- exit(Pid2,kill), % Remove it!
- io:format("Had to kill local runtime component in end_per_testcase,~p.~n",[Case])
- end,
- ?l process_killer([inviso_test_proc,
- inviso_tab_proc,
- inviso_collector_proc,
- global_inviso_test_proc]),
- ?l test_server:timetrap_cancel(get_timetraphandle_config(Config)),
-
- NewConfig1=remove_remotenode_config(inviso1,Config),
- NewConfig2=remove_remotenode_config(inviso2,NewConfig1),
- remove_timetraphandle_config(NewConfig2).
-%% -----------------------------------------------------------------------------
-
-%% ==============================================================================
-%% Testcases.
-%% ==============================================================================
-
-%% TEST CASE: Basic, distributed, trace only.
-basic_dist_trace_1(suite) -> [];
-basic_dist_trace_1(doc) ->
- ["Basic case, start of distributed tracing, using only trac."];
-basic_dist_trace_1(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataList=lists:map(fun(N)->{N,{file,filename:join([PrivDir,
- "tf1_"++
- atom_to_list(N)
- ])}} end,
- Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok}]}),
- activate_local_tracing(Nodes),
- deactivate_local_tracing(Nodes),
- stop_tracing(Nodes),
- stop(Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-
-%% TEST CASE: Basic, distributed, activate global tracing for functions in modules
-%% pointed out using a regexp. No tracing will be done.
-basic_dist_trace_2(suite) -> [];
-basic_dist_trace_2(doc) ->
- [""];
-basic_dist_trace_2(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataList=lists:map(fun(N)->{N,{file,filename:join([PrivDir,
- "tf1a_"++
- atom_to_list(N)
- ])}} end,
- Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok}]}),
- Funcs1=activate_global_tracing_regexp(Nodes),
- deactivate_global_tracing_regexp(Nodes,Funcs1),
- stop_tracing(Nodes),
- stop(Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: Basic, distributed, activate global tracing for functions in modules
-%% pointed out using a dir-regexp. No tracing will be done.
-basic_dist_trace_3(suite) -> [];
-basic_dist_trace_3(doc) ->
- [""];
-basic_dist_trace_3(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataList=lists:map(fun(N)->{N,{file,filename:join([PrivDir,
- "tf1b_"++
- atom_to_list(N)
- ])}} end,
- Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok}]}),
- Funcs1=activate_global_tracing_regexp_dir(Nodes),
- deactivate_global_tracing_regexp_dir(Nodes,Funcs1),
- stop_tracing(Nodes),
- stop(Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: Basic, distributed, trace and ti.
-basic_dist_trace_ti_1(suite) -> [];
-basic_dist_trace_ti_1(doc) ->
- [""];
-basic_dist_trace_ti_1(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataFun=
- fun(N)->{N,[{trace,{file,filename:join([PrivDir,"tf2_"++atom_to_list(N)])}},
- {ti,{file,filename:join([PrivDir,"tf2_"++atom_to_list(N)++".ti"])}}]}
- end,
- TracerDataList=lists:map(TracerDataFun,Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok},{ti_log,ok}]}),
- activate_local_tracing(Nodes),
- activate_meta_tracing(Nodes),
- ?l true=(is_pid(whereis(inviso_rt))),
- ?l true=(is_pid(whereis(inviso_rt_meta))),
- deactivate_meta_tracing(Nodes),
- deactivate_local_tracing(Nodes),
- stop_tracing(Nodes),
- ?l true=(is_pid(whereis(inviso_rt))), % Shall still be running.
- ?l ok=poll(erlang,whereis,[inviso_rt_meta],undefined,3),
- stop(Nodes),
- timer:sleep(200), % Give it time to terminate.
- ?l ok=poll(erlang,whereis,[inviso_rt],undefined,3),% Shall be gone now.
- ?l undefined=whereis(inviso_rt_meta), % Still gone.
- ok.
-%% -----------------------------------------------------------------------------
-
-%% Test CASE: Testing that the tpm_tracer functionality works. That is appending
-%% {tracer,Tracer} to a meta match spec.
-basic_dist_trace_ti_2(suite) -> [];
-basic_dist_trace_ti_2(doc) ->
- [""];
-basic_dist_trace_ti_2(Config) when is_list(Config) ->
- case erlang:system_info(version) of
- "5.4"++_ -> % Perhaps not perfect, but work now :-)
- {skip,"Old emulator"};
- _ ->
- basic_dist_trace_ti_2_do(Config)
- end.
-
-basic_dist_trace_ti_2_do(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataFun=
- fun(N)->{N,[{trace,{file,filename:join([PrivDir,"tf3_"++atom_to_list(N)])}},
- {ti,{file,filename:join([PrivDir,"tf3_"++atom_to_list(N)++".ti"])}}]}
- end,
- TracerDataList=lists:map(TracerDataFun,Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok},{ti_log,ok}]}),
- activate_deactivate_meta_tracing_tracer(Nodes),
- stop_tracing(Nodes),
- stop(Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: Basic, distributed, trace and ti, where we try to use ctp_all to
-%% check that all global and local patterns are removed but that meta patterns
-%% remain.
-%% This test also checks that if the meta tracer is terminated an error value
-%% is generated when trying to do meta tracing at that node.
-basic_dist_trace_ti_3(suite) -> [];
-basic_dist_trace_ti_3(doc) ->
- [""];
-basic_dist_trace_ti_3(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataFun=
- fun(N)->{N,[{trace,{file,filename:join([PrivDir,"tf4_"++atom_to_list(N)])}},
- {ti,{file,filename:join([PrivDir,"tf4_"++atom_to_list(N)++".ti"])}}]}
- end,
- TracerDataList=lists:map(TracerDataFun,Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok},{ti_log,ok}]}),
- activate_local_tracing(Nodes),
- activate_global_tracing(Nodes),
- activate_meta_tracing(Nodes),
- ?l true=(is_pid(whereis(inviso_rt))),
- ?l true=(is_pid(whereis(inviso_rt_meta))),
- ?l {ok,NodeResults1}=inviso:ctp_all(Nodes), % Removes local and global patterns.
- ?l true=check_noderesults(Nodes,ok,NodeResults1),
- ?l true=check_on_nodes(Nodes,erlang,trace_info,[{code,which,1},traced],{traced,false}),
- ?l true=check_on_nodes(Nodes,erlang,trace_info,[{code,get_path,0},traced],{traced,false}),
- %% But meta patters shall remain.
- ?l true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{lists,module_info,0},meta_match_spec],
- fun({meta_match_spec,L})when length(L)>0 ->true end),
- ?l true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{lists,module_info,0},meta],
- fun({meta,P})when is_pid(P) ->
- P=rpc:call(node(P),erlang,whereis,[inviso_rt_meta]),
- true
- end),
- %% Now kill the meta tracer somewhere and try to activate meta tracing.
- ?l [ANode|_]=Nodes,
- ?l AMetaPid=rpc:call(ANode,erlang,whereis,[inviso_rt_meta]),
- ?l rpc:call(ANode,erlang,exit,[AMetaPid,kill]),
- ?l {ok,NodeResults2}=inviso:tpm(Nodes,math,pi,0,[],void),
- ?l {value,{ANode,{error,_}}}=lists:keysearch(ANode,1,NodeResults2),
-
- ?l stop_tracing(Nodes),
- ?l stop(Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% -----------------------------------------------------------------------------
-%% Test cases for SUSPEND
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: In this test case a trace with ti is started. Trace flags are set,
-%% trace patterns are set and meta trace patterns. We then check that the trace
-%% flags and the meta patterns are removed when tracing suspended.
-%% The suspension is cancelled and we check that it is possible to reactivate
-%% tracing by setting the process flags and meta patterns again.
-suspend_dist_trace_ti_1(suite) -> [];
-suspend_dist_trace_ti_1(doc) ->
- [""];
-suspend_dist_trace_ti_1(Config) when is_list(Config) ->
- ?l RemoteNodes=get_remotenodes_config(Config),
- ?l Nodes=[node()|RemoteNodes],
- ?l PrivDir=filename:join(?config(priv_dir,Config),""),
- ?l TracerDataFun=
- fun(N)->{N,[{trace,{file,filename:join([PrivDir,"tf_suspend1_"++atom_to_list(N)])}},
- {ti,{file,filename:join([PrivDir,"tf_suspend1_"++atom_to_list(N)++".ti"])}}]}
- end,
- ?l TracerDataList=lists:map(TracerDataFun,Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok},{ti_log,ok}]}),
- activate_local_tracing(Nodes),
- activate_meta_tracing(Nodes),
- ?l true=(is_pid(whereis(inviso_rt))),
- ?l true=(is_pid(whereis(inviso_rt_meta))),
- %% Set some trace flags on some newly started test procs.
- activate_traceflags(Nodes),
-
- %% Now suspend the tracing on all nodes. That shall result in the removal
- %% of trace flags and meta trace patterns, but not local trace patterns.
- ?l {ok,NodeResults1}=inviso:suspend(Nodes,test),
- ?l true=check_noderesults(Nodes,ok,NodeResults1),
- %% Trace flags gone?
- ?l TestProcs=lists:map(fun(N)->rpc:call(N,erlang,whereis,[inviso_test_proc]) end,Nodes),
- ?l lists:foreach(fun(P)->
- {flags,[]}=
- rpc:call(node(P),erlang,trace_info,[P,flags])
- end,
- TestProcs),
- %% Meta patterns shall be gone too, but local functions still there.
- ?l lists:foreach(fun(N)->
- {meta,false}=
- rpc:call(N,
- erlang,
- trace_info,
- [{math,module_info,1},meta]),
- {traced,local}=
- rpc:call(N,
- erlang,
- trace_info,
- [{code,which,1},traced])
- end,
- Nodes),
-
- %% Try to activate trace flags, trace patterns and meta tracing while
- %% suspended. Should not succeed of course!
- ?l ThisNode=node(),
- ?l {ok,[{ThisNode,{error,suspended}}]}=
- inviso:tf([ThisNode],inviso_test_proc,[call]),
- ?l {ok,[{ThisNode,{error,suspended}}]}=
- inviso:tpl([ThisNode],math,module_info,1,[]),
- ?l {ok,[{ThisNode,{error,suspended}}]}=
- inviso:init_tpm([ThisNode],
- math,
- module_info,
- 1,
- {?MODULE,tpm_init_func2}, % Does not exist on purpose.
- {?MODULE,tpm_call_func2}, % Does not exist on purpose.
- {?MODULE,tpm_return_func2}, % Does not exist on purpose.
- {?MODULE,tpm_remove_func2}), % Does not exist on purpose.
-
- %% Now we want to cancel suspension and see that we can reactivate tracing.
- ?l {ok,NodeResults2}=inviso:cancel_suspension(Nodes),
- ?l true=check_noderesults(Nodes,ok,NodeResults2),
-
- ?l {ok,NodeResults3}=
- inviso:init_tpm(math,
- module_info,
- 1,
- {?MODULE,tpm_init_func2}, % Does not exist on purpose.
- {?MODULE,tpm_call_func2}, % Does not exist on purpose.
- {?MODULE,tpm_return_func2}, % Does not exist on purpose.
- {?MODULE,tpm_remove_func2}), % Does not exist on purpose.
- ?l true=check_noderesults(Nodes,ok,NodeResults3),
- ?l {ok,NodeResults5}=
- inviso:tpm_ms(math,module_info,1,ms1,[{'_',[],[{return_trace}]}]),
- ?l true=check_noderesults(Nodes,{ok,1},NodeResults5),
- ?l true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{math,module_info,1},meta_match_spec],
- {meta_match_spec,[{'_',[],[{return_trace}]}]}),
- ?l {ok,NodeResults6}=inviso:tf(Nodes,inviso_test_proc,[call]),
- ?l true=check_noderesults(Nodes,{ok,[1]},NodeResults6),
-
- %deactivate_meta_tracing(Nodes),
- %deactivate_local_tracing(Nodes),
- stop_tracing(Nodes),
- ?l true=(is_pid(whereis(inviso_rt))), % Shall still be running.
- ?l ok=poll(erlang,whereis,[inviso_rt_meta],undefined,3),
- stop(Nodes),
- ?l timer:sleep(200), % Give it time to terminate.
- ?l ok=poll(erlang,whereis,[inviso_rt],undefined,3),% Shall be gone now.
- ?l undefined=whereis(inviso_rt_meta), % Still gone.
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: In this test case a trace with ti is started. Trace flags are set,
-%% trace patterns are set and meta trace patterns. We then suspend tracing at
-%% all nodes, then stop tracing which shall be allowed. We then try to initiate
-%% tracing again which shall not be possible.
-suspend_dist_trace_ti_2(suite) -> [];
-suspend_dist_trace_ti_2(doc) ->
- [""];
-suspend_dist_trace_ti_2(Config) when is_list(Config) ->
- ?l RemoteNodes=get_remotenodes_config(Config),
- ?l Nodes=[node()|RemoteNodes],
- ?l PrivDir=filename:join(?config(priv_dir,Config),""),
- ?l TracerDataFun=
- fun(N)->{N,[{trace,{file,filename:join([PrivDir,"tf_suspend2_"++atom_to_list(N)])}},
- {ti,{file,filename:join([PrivDir,"tf_suspend2_"++atom_to_list(N)++".ti"])}}]}
- end,
- ?l TracerDataList=lists:map(TracerDataFun,Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok},{ti_log,ok}]}),
- activate_local_tracing(Nodes),
- activate_meta_tracing(Nodes),
- ?l true=(is_pid(whereis(inviso_rt))),
- ?l true=(is_pid(whereis(inviso_rt_meta))),
- %% Set some trace flags on some newly started test procs.
- activate_traceflags(Nodes),
-
- %% Now suspend the tracing on all nodes. That shall result in the removal
- %% of trace flags and meta trace patterns, but not local trace patterns.
- ?l {ok,NodeResults1}=inviso:suspend(Nodes,test),
- ?l true=check_noderesults(Nodes,ok,NodeResults1),
-
- %% Now stop tracing.
- ?l {ok,NodeResults3}=inviso:stop_tracing(Nodes),
- ?l true=check_noderesults(Nodes,{ok,idle},NodeResults3),
- %% Now try to initiate tracing again.
- ThisNode=node(),
- ?l {ok,[{ThisNode,{error,suspended}}]}=
- inviso:init_tracing([ThisNode],
- [{trace,{file,filename:join([PrivDir,"tf_suspend3_"++
- atom_to_list(ThisNode)])}},
- {ti,{file,{filename:join([PrivDir,"tf_suspend3_"++
- atom_to_list(ThisNode)])}}}]),
-
- %% Cancel the suspension and initiate tracing again.
- ?l {ok,NodeResults2}=inviso:cancel_suspension(Nodes),
- ?l true=check_noderesults(Nodes,ok,NodeResults2),
- ?l TracerDataFun2=
- fun(N)->{N,[{trace,{file,filename:join([PrivDir,"tf_suspend4_"++atom_to_list(N)])}},
- {ti,{file,filename:join([PrivDir,"tf_suspend4_"++atom_to_list(N)++".ti"])}}]}
- end,
- ?l TracerDataList2=lists:map(TracerDataFun2,Nodes),
- ?l {ok,NodeResults4}=inviso:init_tracing(TracerDataList2),
- ?l true=check_noderesults(Nodes,{ok,[{trace_log,ok},{ti_log,ok}]},NodeResults4),
- stop_tracing(Nodes),
- ?l true=(is_pid(whereis(inviso_rt))), % Shall still be running.
- stop(Nodes),
- ?l timer:sleep(200), % Give it time to terminate.
- ?l ok=poll(erlang,whereis,[inviso_rt],undefined,3),% Shall be gone now.
- ok.
-%% -----------------------------------------------------------------------------
-
-
-
-%% TEST CASE: This test case tests that the clean function removes (prosumed)
-%% expired data from the internal public-loopdata structure in the inviso_rt_meta
-%% process.
-meta_cleanfunc_dist_1(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataFun=
- fun(N)->{N,[{trace,{file,filename:join([PrivDir,"mcf1_"++atom_to_list(N)])}},
- {ti,{file,filename:join([PrivDir,"mcf1_"++atom_to_list(N)++".ti"])}}]}
- end,
- TracerDataList=lists:map(TracerDataFun,Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok},{ti_log,ok}]}),
- %% Now initialize meta tracing, but the call_func is a bit "fixed".
- ?l {ok,NodeResults1}=
- inviso:tpm(Nodes,math,module_info,1,[],
- {?MODULE,meta_cleanfunc_initfunc_1},
- {?MODULE,meta_cleanfunc_callfunc_1},
- void,void),
- ?l true=check_noderesults(Nodes,{ok,1},NodeResults1),
- %% Nothing in the "our" part of the public loop data.
- ?l true=check_on_nodes(Nodes,
- inviso_rt_meta,get_state,[inviso_rt_meta],
- fun({ok,_LD,{{_,[]},_}})->true end),
- ?l lists:foreach(fun(N)->rpc:call(N,math,module_info,[exports]) end,Nodes),
- %% Check that it has been added to the public loopdata structure.
- ?l true=check_on_nodes(Nodes,
- ?MODULE,poll,[inviso_rt_meta,
- get_state,
- [inviso_rt_meta],
- fun({ok,_LD,{{_,[{meta_cleanfunc_test1,_Now}]},_}})->
- true;
- (_)->false
- end,
- 20],
- ok),
- %% While we wait for 60 seconds to pass, we test a few other things.
- ?l {ok,NodeResults2}=
- inviso:tpm(Nodes,?MODULE,slowfunction2,0,[{'_',[],[{return_trace}]}],
- {?MODULE,meta_cleanfunc_initfunc_2},
- {?MODULE,meta_cleanfunc_callfunc_2},
- {?MODULE,meta_cleanfunc_returnfunc_2},
- void),
- ?l true=check_noderesults(Nodes,{ok,1},NodeResults2),
- ?l lists:foreach(fun(N)->rpc:call(N,?MODULE,slowfunction,[]) end,Nodes),
- %% Believe it or not but slowfunction is still running, in its own process,
- %% we are therefore free now to examine the meta tracer.
- ?l true=check_on_nodes(Nodes,
- ?MODULE,poll,[inviso_rt_meta,
- get_state,
- [inviso_rt_meta],
- fun({ok,_LD,{{[],Tuples},_}})->
- {value,_}=
- lists:keysearch(meta_cleanfunc_test2,
- 1,
- Tuples),
- {value,_}=
- lists:keysearch(meta_cleanfunc_test1,
- 1,
- Tuples),
- true;
- (_)->
- false
- end,
- 20],
- ok),
- %% Now we wait for slowfunction to return and that the meta_cleanfunc_test2
- %% to be removed from public loopdata strucuture.
- ?l timer:sleep(10000),
- %% The only thing remaining should be the meta_cleanfunc_test1 which will not
- %% go away for less than that the clean functionality removes it.
- ?l true=check_on_nodes(Nodes,
- ?MODULE,poll,[inviso_rt_meta,
- get_state,
- [inviso_rt_meta],
- fun({ok,_LD,{{_,[{meta_cleanfunc_test1,_Now}]},_}})->
- true;
- (_)->
- false
- end,
- 20],
- ok),
- %% Wait for the clean function to clean meta_cleanfunc_test1 away.
- ?l timer:sleep(51000), % Shall be gone after 5 seconds.
- ?l true=check_on_nodes(Nodes,
- ?MODULE,poll,[inviso_rt_meta,
- get_state,
- [inviso_rt_meta],
- fun({ok,_LD,{{_,[]},_}})->true;
- (_)->false
- end,
- 20],
- ok),
- stop_tracing(Nodes),
- stop(Nodes),
- ok.
-
-%% This function acts as tpm initialization function when we are going to test
-%% that the clean function works. Note that we here assume standard public loop
-%% datastructure.
-meta_cleanfunc_initfunc_1(_M,_F,_Arity,{E1,_E2}) ->
- {ok,{E1,[]},void}.
-%% Function that is supposed to be called when the meta traced function is
-%% called.
-meta_cleanfunc_callfunc_1(_Pid,_Args,{{E1,E2},Global}) ->
- {ok,{{E1,[{meta_cleanfunc_test1,now()}|E2]},Global},void}.
-
-meta_cleanfunc_initfunc_2(_M,_F,_Arity,PublLD) ->
- {ok,PublLD,void}.
-meta_cleanfunc_callfunc_2(_Pid,_Args,{{E1,E2},Global}) ->
- {ok,{{E1,[{meta_cleanfunc_test2,now()}|E2]},Global},void}.
-meta_cleanfunc_returnfunc_2(_Pid,_,{{E1,E2},Global}) ->
- {value,_}=lists:keysearch(meta_cleanfunc_test2,1,E2),
- {ok,{{E1,lists:keydelete(meta_cleanfunc_test2,1,E2)},Global},void}.
-
-slowfunction() ->
- spawn(?MODULE,slowfunction1,[]).
-slowfunction1() ->
- slowfunction2(). % Meta trace on this function call.
-slowfunction2() ->
- timer:sleep(2000),
- true.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: Testing that a runtime component can be started instructing it
-%% to use a handler fun. Checks that the handler fun is called if a trace
-%% message comes in.
-basic_handlerfun_dist_1(suite) -> [];
-basic_handlerfun_dist_1(doc) ->
- [""];
-basic_handlerfun_dist_1(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- ?l lists:foreach(fun(N)->rpc:call(N,ets,insert,[inviso_sideeffect_tab,{bhf1,0}]) end,
- Nodes),
- TracerDataFun=
- fun(N)->{N,{fun basic_handlerfun_dist_1_fun/2,inviso_sideeffect_tab}} end,
- TracerDataList=lists:map(TracerDataFun,Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok}]}),
- activate_local_tracing(Nodes),
- activate_traceflags(Nodes),
- ?l lists:foreach(fun(N)->[{bhf1,0}]=
- rpc:call(N,ets,lookup,[inviso_sideeffect_tab,bhf1])
- end,
- Nodes),
- ?l inviso_test_proc ! {apply,code,which,[lists]},
- ok=poll(ets,lookup,[inviso_sideeffect_tab,bhf1],[{bhf1,1}],20),
- deactivate_traceflags(Nodes),
- deactivate_local_tracing(Nodes),
- stop_tracing(Nodes),
- timer:sleep(100),
- ?l [{bhf1,1}]=ets:lookup(inviso_sideeffect_tab,bhf1),
- stop(Nodes),
- ok.
-
-%% Function used as handler fun for testcase above.
-basic_handlerfun_dist_1_fun(_Msg,TId) ->
- ets:update_counter(TId,bhf1,1),
- TId.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: Here we test that delete_log removes the files at the involved
-%% runtime nodes. In this case we test that we remove logs according to last
-%% used tracer data.
-delete_log_dist_1(suite) -> [];
-delete_log_dist_1(doc) -> [""];
-delete_log_dist_1(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataFun=
- fun(N)->{N,[{trace,{file,filename:join([PrivDir,"dl1_"++atom_to_list(N)])}},
- {ti,{file,filename:join([PrivDir,"dl1_"++atom_to_list(N)++".ti"])}}]}
- end,
- TracerDataList=lists:map(TracerDataFun,Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok},{ti_log,ok}]}),
- ?l Files=lists:map(fun({N,TD})->
- ?l {value,{_,{_,TraceFile}}}=lists:keysearch(trace,1,TD),
- ?l {value,{_,{_,TiFile}}}=lists:keysearch(ti,1,TD),
- ?l {N,{TraceFile,TiFile}}
- end,
- TracerDataList),
- io:format("The Files is:~w~n",[Files]),
- ?l {ok,NodeResults1}=inviso:delete_log(Nodes), % Should not work!
- ?l true=check_noderesults(Nodes,{error,tracing},NodeResults1),
- stop_tracing(Nodes),
- %% Files still here.
- ?l lists:foreach(fun({N,{F1,F2}})->
- ?l {ok,_}=rpc:call(N,file,read_file_info,[F1]),
- ?l {ok,_}=rpc:call(N,file,read_file_info,[F2])
- end,
- Files),
- ?l {ok,NodeResults2}=inviso:delete_log(Nodes),
- ?l true=check_noderesults(Nodes,
- fun({_N,{ok,LogInfos}})->
- ?l {value,{_,[{ok,_FName1}]}}=
- lists:keysearch(trace_log,1,LogInfos),
- ?l {value,{_,[{ok,_FName2}]}}=
- lists:keysearch(ti_log,1,LogInfos),
- true
- end,
- NodeResults2),
- %% The files shall be gone now.
- ?l lists:foreach(fun({N,{F1,F2}})->
- ?l {error,enoent}=rpc:call(N,file,read_file_info,[F1]),
- ?l {error,enoent}=rpc:call(N,file,read_file_info,[F2])
- end,
- Files),
- stop(Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-
-%% TEST CASE: Test of the autostart behaviour of the runtime component.
-%% Here we test that a runtime component is started according to the autostart.conf
-%% file. Note that the repeat parameter is set to 2.
-autostart_dist_1(suite) -> [];
-autostart_dist_1(doc) ->
- [""];
-autostart_dist_1(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- PrivDir=filename:join(?config(priv_dir,Config),""),
- AutoConfFile=filename:join(PrivDir,"autostart1.conf"),
- [RNode|_]=RemoteNodes,
- ?l ok=rpc:call(RNode,application,stop,[runtime_tools]),
- ?l ok=rpc:call(RNode,application,set_env,[runtime_tools,
- inviso_autostart_conf,
- AutoConfFile]),
- ?l {ok,FD}=file:open(AutoConfFile,[write]),
- ?l ok=io:format(FD,"~w.~n~w.~n",[{repeat,2},{tag,c_ref}]),
- ?l file:close(FD),
- ?l ok=rpc:call(RNode,application,start,[runtime_tools]),
- timer:sleep(1000),
- ?l P1=rpc:call(RNode,erlang,whereis,[inviso_rt]),
- ?l true=is_pid(P1),
- ?l rpc:call(RNode,erlang,exit,[P1,kill]),
- ?l ok=rpc:call(RNode,application,stop,[runtime_tools]),
- ?l ok=rpc:call(RNode,application,start,[runtime_tools]),
- timer:sleep(1000),
- ?l P2=rpc:call(RNode,erlang,whereis,[inviso_rt]),
- ?l true=is_pid(P2),
- ?l rpc:call(RNode,erlang,exit,[P2,kill]),
- ?l ok=rpc:call(RNode,application,stop,[runtime_tools]),
- ?l ok=rpc:call(RNode,application,start,[runtime_tools]),
- timer:sleep(1000),
- ?l undefined=rpc:call(RNode,erlang,whereis,[inviso_rt]),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: Test of autostart. Here we focus on that an autostarted
-%% runtime component actually follows the trace case command file and
-%% initiates tracing.
-autostart_dist_2(suite) -> [];
-autostart_dist_2(doc) ->
- [""];
-autostart_dist_2(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- PrivDir=filename:join(?config(priv_dir,Config),""),
- AutoConfFile=filename:join(PrivDir,"autostart2.conf"),
- [RNode|_]=RemoteNodes,
- ?l ok=rpc:call(RNode,application,stop,[runtime_tools]),
- ?l ok=rpc:call(RNode,application,set_env,[runtime_tools,
- inviso_autostart_conf,
- AutoConfFile]),
- ?l CmdFileName=filename:join(PrivDir,"autostart_cmd_as1"),
- ?l {ok,FD}=file:open(CmdFileName,[write]),
- ?l ok=io:format(FD,
- "inviso:tpl(Nodes,M,F,Arity,[]).~n"
- "inviso:tf(Nodes,inviso_test_proc,[call]).~n",
- []),
- ?l file:close(FD),
- ?l TraceFileName=filename:join([PrivDir,"as1_"++atom_to_list(RNode)]),
- ?l TiFileName=filename:join([PrivDir,"as1_"++atom_to_list(RNode)++".ti"]),
- ?l inviso_as_lib:setup_autostart(RNode,
- 2,
- [],
- [{trace,{file,TraceFileName}},
- {ti,{file,TiFileName}}],
- [[CmdFileName]],
- [{'M',code},{'F',which},{'Arity',1}],
- [{{inviso,tpl,5},{inviso_rt,tpl,{erlang,tl}}},
- {{inviso,tf,3},{inviso_rt,tf,{erlang,tl}}}]),
- ?l TestP=spawn(RNode,?MODULE,test_proc_init,[]),
- ?l ok=rpc:call(RNode,application,start,[runtime_tools]),
- ?l timer:sleep(1000),
- ?l {ok,_}=file:read_file_info(TraceFileName),
- ?l {ok,_}=file:read_file_info(TiFileName),
- ?l true=is_pid(P=rpc:call(RNode,erlang,whereis,[inviso_rt])),
- ?l ok=poll(rpc,call,[RNode,erlang,trace_info,[{code,which,1},traced]],{traced,local},10),
- ?l {flags,[call]}=rpc:call(RNode,erlang,trace_info,[TestP,flags]),
- ?l rpc:call(RNode,erlang,exit,[P,kill]),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: Here we test that an autostarted runtime component with a dependency
-%% to a specific control component tries to connect to that control component
-%% during its start-up.
-autostart_dist_3(suite) -> [];
-autostart_dist_3(doc) ->
- [""];
-autostart_dist_3(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- PrivDir=filename:join(?config(priv_dir,Config),""),
- AutoConfFile=filename:join(PrivDir,"autostart3.conf"),
- [RNode|_]=RemoteNodes,
- ?l ok=rpc:call(RNode,application,stop,[runtime_tools]),
- ?l ok=rpc:call(RNode,application,set_env,[runtime_tools,
- inviso_autostart_conf,
- AutoConfFile]),
- ?l {ok,FD}=file:open(AutoConfFile,[write]),
- ?l ok=io:format(FD,"~w.~n~w.~n~w.~n",
- [{options,[{dependency,{infinity,node()}}]},{repeat,2},{tag,c_ref}]),
- ?l file:close(FD),
- %% Now start inviso at this node here for the runtime to connect.
- ?l {ok,_Pid}=inviso:start(),
- ?l ok=poll(erlang,whereis,[inviso_c],fun(P) when is_pid(P)->true;(_)->false end,10),
- %% Make the runtime component start.
- ?l ok=rpc:call(RNode,application,start,[runtime_tools]),
- ?l ok=poll(rpc,call,[RNode,erlang,whereis,[inviso_rt]],
- fun(P) when is_pid(P)->true;(_)->false end,10),
- %% Check that the runtime component started.
- ?l ok=poll(inviso,get_status,[[RNode]],{ok,[{RNode,{ok,{new,running}}}]},20),
-% ?l {ok,[{RNode,{ok,{new,running}}}]}=inviso:get_status([RNode]),
- stop([RNode]),
- ok.
-%% -----------------------------------------------------------------------------
-
-
-
-%% TEST CASE: Test of the dependency mechanism in the runtime component.
-%% Default behaviour is dependency=infinity, i.e the runtime components remains.
-%% We also test here that we can reconnect to the runtime.
-running_alone_dist_1(suite) -> [];
-running_alone_dist_1(doc) ->
- [""];
-running_alone_dist_1(Config) when is_list(Config) ->
- ?l {ok,_Pid1}=inviso:start(), % Start a control component.
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- ?l {ok,NodeResults1}=inviso:add_nodes(Nodes,a_ref,[]),
- ?l true=check_noderesults(Nodes,{ok,new},NodeResults1),
- ?l shutdown=inviso:stop(), % Stop the control component!
- ?l undefined=whereis(inviso_c),
- timer:sleep(3000), % How long shall we wait? :-)
- ?l lists:foreach(fun(N)->true=is_pid(rpc:call(N,erlang,whereis,[inviso_rt])) end,
- Nodes),
- ?l {ok,_Pid2}=inviso:start(),
- ?l {ok,NodeResults2}=inviso:add_nodes(Nodes,b_ref,[]),
- ?l true=check_noderesults(Nodes,{ok,{adopted,new,running,a_ref}},NodeResults2),
- stop(Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: Test of the dependency mechanism in the runtime component.
-%% Test that the runtime components terminates after the specified 5000 ms.
-running_alone_dist_2(suite) -> [];
-running_alone_dist_2(doc) ->
- [""];
-running_alone_dist_2(Config) when is_list(Config) ->
- ?l {ok,_Pid1}=inviso:start(), % Start a control component.
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- ?l {ok,NodeResults1}=inviso:add_nodes(Nodes,a_ref,[{dependency,5000}]),
- ?l true=check_noderesults(Nodes,{ok,new},NodeResults1),
- ?l shutdown=inviso:stop(), % Stop the control component!
- ?l undefined=whereis(inviso_c),
- timer:sleep(2000),
- ?l lists:foreach(fun(N)->true=is_pid(rpc:call(N,erlang,whereis,[inviso_rt])) end,
- Nodes),
- timer:sleep(4000), % Now they shall be dead!
- ?l lists:foreach(fun(N)->undefined=rpc:call(N,erlang,whereis,[inviso_rt]) end,
- Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: Test of the dependency mechanism in the runtime component.
-%% Test that the runtime components terminates after the specified 5000 ms.
-running_alone_dist_3(suite) -> [];
-running_alone_dist_3(doc) ->
- [""];
-running_alone_dist_3(Config) when is_list(Config) ->
- ?l {ok,_Pid1}=inviso:start(), % Start a control component.
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- ?l {ok,NodeResults1}=inviso:add_nodes(Nodes,a_ref,[{dependency,1000}]),
- ?l true=check_noderesults(Nodes,{ok,new},NodeResults1),
- ?l {ok,NodeResults2}=inviso:change_options(Nodes,[{dependency,5000}]),
- ?l true=check_noderesults(Nodes,ok,NodeResults2),
- ?l shutdown=inviso:stop(), % Stop the control component!
- ?l undefined=whereis(inviso_c),
- timer:sleep(3000),
- ?l lists:foreach(fun(N)->true=is_pid(rpc:call(N,erlang,whereis,[inviso_rt])) end,
- Nodes),
- timer:sleep(3000), % Now they shall be dead!
- ?l lists:foreach(fun(N)->undefined=rpc:call(N,erlang,whereis,[inviso_rt]) end,
- Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: Test of the dependency mechanism in the runtime component.
-%% Test that the runtime components terminates after the specified 5000 ms,
-%% like we did in running_alone_dist_2. But now we also start tracing and checks
-%% that all inviso processes actually disappears when the time-out is reached.
-running_alone_dist_4(suite) -> [];
-running_alone_dist_4(doc) ->
- [""];
-running_alone_dist_4(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- %% Start some tracing!
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataFun=
- fun(N)->{N,[{trace,{file,filename:join([PrivDir,"tf_ra4"++atom_to_list(N)])}},
- {ti,{file,filename:join([PrivDir,"tf_ra4_"++atom_to_list(N)++".ti"])}}]}
- end,
- TracerDataList=lists:map(TracerDataFun,Nodes),
- start_and_init_tracing2(Nodes,
- [{dependency,5000}],
- TracerDataList,
- {ok,[{trace_log,ok},{ti_log,ok}]}),
-
- ?l lists:foreach(fun(N)->true=is_pid(rpc:call(N,erlang,whereis,[inviso_rt])) end,
- Nodes),
- ?l lists:foreach(fun(N)->true=is_pid(rpc:call(N,erlang,whereis,[inviso_rt_meta])) end,
- Nodes),
- %% Stop control component and wait for the runtimes to terminate after
- %% running alone timer has expired.
- ?l shutdown=inviso:stop(), % Stop the control component!
- ?l undefined=whereis(inviso_c),
- timer:sleep(2000),
- ?l lists:foreach(fun(N)->true=is_pid(rpc:call(N,erlang,whereis,[inviso_rt])) end,
- Nodes),
- ?l lists:foreach(fun(N)->true=is_pid(rpc:call(N,erlang,whereis,[inviso_rt_meta])) end,
- Nodes),
- timer:sleep(4000), % Now they shall be dead!
- ?l lists:foreach(fun(N)->undefined=rpc:call(N,erlang,whereis,[inviso_rt]) end,
- Nodes),
- ?l lists:foreach(fun(N)->undefined=rpc:call(N,erlang,whereis,[inviso_rt_meta]) end,
- Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: Test of the dependency mechanism in the runtime component.
-%% Test that the runtime components terminates imeediately when the control
-%% component is stopped. Check that all processes are gone.
-running_alone_dist_5(suite) -> [];
-running_alone_dist_5(doc) ->
- [""];
-running_alone_dist_5(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- %% Start some tracing!
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataFun=
- fun(N)->{N,[{trace,{file,filename:join([PrivDir,"tf_ra5"++atom_to_list(N)])}},
- {ti,{file,filename:join([PrivDir,"tf_ra5_"++atom_to_list(N)++".ti"])}}]}
- end,
- TracerDataList=lists:map(TracerDataFun,Nodes),
- start_and_init_tracing2(Nodes,
- [{dependency,0}],
- TracerDataList,
- {ok,[{trace_log,ok},{ti_log,ok}]}),
-
- ?l lists:foreach(fun(N)->true=is_pid(rpc:call(N,erlang,whereis,[inviso_rt])) end,
- Nodes),
- ?l lists:foreach(fun(N)->true=is_pid(rpc:call(N,erlang,whereis,[inviso_rt_meta])) end,
- Nodes),
- %% Stop control component and check that all runtime component processes have
- %% terminate more or less immediately afterwards, since dependency==0.
- ?l shutdown=inviso:stop(), % Stop the control component!
- timer:sleep(100),
- ?l undefined=whereis(inviso_c),
- timer:sleep(500),
- ?l lists:foreach(fun(N)->undefined=rpc:call(N,erlang,whereis,[inviso_rt]) end,
- Nodes),
- ?l lists:foreach(fun(N)->undefined=rpc:call(N,erlang,whereis,[inviso_rt_meta]) end,
- Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: Test of the overload protection mechanism. The mechanism checks
-%% for overload using the callback approximately at the interval specified.
-%% Check that it does not start protection until start of tracing.
-overload_dist_1(suite) -> [];
-overload_dist_1(doc) ->
- [""];
-overload_dist_1(Config) when is_list(Config) ->
- ?l {ok,_Pid1}=inviso:start(), % Start a control component.
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- ?l lists:foreach(fun(N)->true=rpc:call(N,ets,insert,[inviso_sideeffect_tab,{ovl1,0}]) end,
- Nodes), % Initiate the counter.
- ?l {ok,NodeResults1}=inviso:add_nodes(Nodes,
- a_ref,
- [{overload,{{?MODULE,overload1},500}}]),
- ?l true=check_noderesults(Nodes,{ok,new},NodeResults1),
- timer:sleep(1000), % Give the loadcheck time to perform.
- ?l [{_,0}]=ets:lookup(inviso_sideeffect_tab,ovl1), % Nothing should have happened.
-
- %% Overload check shall not start until we start tracing.
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataList=lists:map(fun(N)->{N,[{trace,
- {file,filename:join([PrivDir,
- "tf_ovl1."++atom_to_list(N)
- ])}}]}
- end,
- Nodes),
- ?l {ok,NodeResults2}=inviso:init_tracing(TracerDataList),
- ?l true=check_noderesults(Nodes,{ok,[{trace_log,ok}]},NodeResults2),
- timer:sleep(1500), % Give the loadcheck time to perform.
- ?l [{_,N}]=ets:lookup(inviso_sideeffect_tab,ovl1),
- ?l true=(N>=2), % After 1,5 seconds, at least 2 checks.
-
- %% Now change options and remove overload checking!
- ?l {ok,NodeResults3}=inviso:change_options(Nodes,[overload]),
- ?l true=check_noderesults(Nodes,ok,NodeResults3),
- ?l [{_,N2}]=ets:lookup(inviso_sideeffect_tab,ovl1),
- timer:sleep(1000),
- ?l [{_,N2}]=ets:lookup(inviso_sideeffect_tab,ovl1), % No more loadchecks!
-
- stop_tracing(Nodes),
- stop(Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: Test of the overload protection mechanism. In this case we focus
-%% in that the init and remove functions are carried out at change_options and
-%% when starting and stoping the runtime component.
-overload_dist_2(suite) -> [];
-overload_dist_2(doc) ->
- [""];
-overload_dist_2(Config) when is_list(Config) ->
- ?l {ok,_Pid1}=inviso:start(), % Start a control component.
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- ?l {ok,NodeResults1}=inviso:add_nodes(Nodes,
- a_ref,
- [{overload,{{?MODULE,overload2},
- 500,
- {?MODULE,overload2i,[]},
- {?MODULE,overload2r,[]}}}]),
- ?l true=check_noderesults(Nodes,{ok,new},NodeResults1),
- ?l [{_,0}]=ets:lookup(inviso_sideeffect_tab,ovl2),
-
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataList=lists:map(fun(N)->{N,[{trace,
- {file,filename:join([PrivDir,
- "tf_ovl2."++atom_to_list(N)
- ])}}]}
- end,
- Nodes),
- ?l {ok,NodeResults2}=inviso:init_tracing(TracerDataList),
- ?l true=check_noderesults(Nodes,{ok,[{trace_log,ok}]},NodeResults2),
- timer:sleep(1500), % Give the loadcheck time to perform.
- ?l [{_,N}]=ets:lookup(inviso_sideeffect_tab,ovl2),
- io:format("� is:~p~n",[N]),
- ?l true=(N>=2), % After 1,5 seconds, at least 2 checks.
- ?l {ok,NodeResults3}=inviso:change_options(Nodes,[{overload,{{?MODULE,overload3},
- 500,
- {?MODULE,overload3i,[]},
- {?MODULE,overload3r,[]}}}]),
- ?l true=check_noderesults(Nodes,ok,NodeResults3),
- ?l []=ets:lookup(inviso_sideeffect_tab,ovl2),
- timer:sleep(1500),
- ?l [{_,N2}]=ets:lookup(inviso_sideeffect_tab,ovl3),
- ?l true=(N2>=2), % After 1,5 seconds, at least 2 checks.
- stop_tracing(Nodes),
- ?l []=ets:lookup(inviso_sideeffect_tab,ovl3r), % Remove function shall not be called.
- ?l [{_,N3}]=ets:lookup(inviso_sideeffect_tab,ovl3),
- timer:sleep(1000), % Check that overloadchecking has stopped.
- ?l [{_,N3}]=ets:lookup(inviso_sideeffect_tab,ovl3),
- stop(Nodes),
- ?l ok=poll(ets,lookup,[inviso_sideeffect_tab,ovl3r],[{ovl3r,done}],20),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: Test of the overload protections mechanism. Here we focus on testing
-%% that if overload is reached tracing is really suspended.
-overload_dist_3(suite) -> [];
-overload_dist_3(doc) ->
- [""];
-overload_dist_3(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataList=
- lists:map(fun(N)->{N,[{trace,{file,filename:join([PrivDir,
- "tf_ovl3."++atom_to_list(N)])}},
- {ti,{file,filename:join([PrivDir,
- "tf_ovl3_ti."++atom_to_list(N)])}}]}
- end,
- Nodes),
- ?l lists:foreach(fun(N)->
- true=rpc:call(N,ets,insert,[inviso_sideeffect_tab,{ovl4,0}])
- end,
- Nodes),
- start_and_init_tracing2(Nodes,
- [{overload,{{?MODULE,overload4},500}}],
- TracerDataList,
- {ok,[{trace_log,ok},{ti_log,ok}]}),
- activate_local_tracing(Nodes),
- activate_meta_tracing(Nodes),
- activate_traceflags(Nodes),
- timer:sleep(600),
- ?l [{_,N1}]=ets:lookup(inviso_sideeffect_tab,ovl4),
- ?l true=(N1>=1), % Overload check has been done!
- ?l Node=node(),
- ?l {ok,[{Node,{ok,{tracing,running}}}]}=inviso:get_status([node()]),
- ?l true=ets:insert(inviso_sideeffect_tab,{ovl4_suspend,true}),
- timer:sleep(600),
- ?l {ok,[{Node,{ok,{tracing,{suspended,test}}}}]}=inviso:get_status([node()]),
- ?l [{_,N2}]=ets:lookup(inviso_sideeffect_tab,ovl4),
- ?l {flags,[]}=erlang:trace_info(whereis(inviso_test_proc),flags),
- ?l {meta,false}=erlang:trace_info({lists,module_info,0},meta),
- ?l {traced,local}=erlang:trace_info({code,which,1},traced),
- ?l true=(is_pid(whereis(inviso_rt_meta))),
- ?l true=ets:delete(inviso_sideeffect_tab,ovl4_suspend),
- timer:sleep(600),
- ?l [{_,N2}]=ets:lookup(inviso_sideeffect_tab,ovl4), % No checking while suspended!
- ?l {ok,[{Node,ok}]}=inviso:cancel_suspension([node()]),
- ?l {ok,NodeResults1}=inviso:get_status(Nodes),
- ?l true=check_noderesults(Nodes,{ok,{tracing,running}},NodeResults1),
- timer:sleep(600),
- ?l [{_,N3}]=ets:lookup(inviso_sideeffect_tab,ovl4),
- ?l true=(N3>N2),
- ?l deactivate_local_tracing(Nodes),
- ?l stop_tracing(Nodes),
- ?l stop(Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE. Test that the overload mechanism is triggered by to the runtime
-%% component incomming messages, and nothing else.
-overload_dist_4(suite) -> [];
-overload_dist_4(doc) ->
- [""];
-overload_dist_4(Config) when is_list(Config) ->
- ?l {ok,_Pid1}=inviso:start(), % Start a control component.
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- ?l {ok,NodeResults1}=inviso:add_nodes(Nodes,
- a_ref,
- [{overload,{{?MODULE,overload5},
- infinity,
- {?MODULE,overload5i,[]},
- {?MODULE,overload5r,[]}}}]),
- ?l true=check_noderesults(Nodes,{ok,new},NodeResults1),
- ?l [{_,0}]=ets:lookup(inviso_sideeffect_tab,ovl5),
-
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataList=lists:map(fun(N)->{N,[{trace,
- {file,filename:join([PrivDir,
- "tf_ovl4."++atom_to_list(N)
- ])}}]}
- end,
- Nodes),
- ?l {ok,NodeResults2}=inviso:init_tracing(TracerDataList),
- ?l true=check_noderesults(Nodes,{ok,[{trace_log,ok}]},NodeResults2),
- timer:sleep(2000), % Give the loadcheck time to perform.
- ?l [{_,N}]=ets:lookup(inviso_sideeffect_tab,ovl5),
- ?l true=(N==0), % And nothing shall have happend!
- %% Now we send a message to the inviso_rt, then the load check function
- %% shall be called.
- ?l whereis(inviso_rt) ! test_of_loadcheck,
- timer:sleep(200), % Make sure the inviso_rt gets scheduled.
- ?l [{_,1}]=ets:lookup(inviso_sideeffect_tab,ovl5),
- stop_tracing(Nodes),
- ?l []=ets:lookup(inviso_sideeffect_tab,ovl5r), % Remove function shall not be called.
- ?l [{_,N3}]=ets:lookup(inviso_sideeffect_tab,ovl5),
- ?l whereis(inviso_rt) ! test_of_loadcheck,
- timer:sleep(1000), % Check that overloadchecking has stopped.
- ?l [{_,N3}]=ets:lookup(inviso_sideeffect_tab,ovl5),
- stop(Nodes),
- ?l ok=poll(ets,lookup,[inviso_sideeffect_tab,ovl5r],[{ovl5r,done}],20),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE. Test that the overload mechanism correctly calculates remaining time
-%% to next load check if a message comes into the runtime component "interupting"
-%% the waiting for loadcheck timeout. (Loadcheck timeout is implemented as an after
-%% in the receive).
-overload_dist_5(suite) -> [];
-overload_dist_5(doc) ->
- [""];
-overload_dist_5(Config) when is_list(Config) ->
- ?l {ok,_Pid1}=inviso:start(), % Start a control component.
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- ?l lists:foreach(fun(N)->true=rpc:call(N,ets,insert,[inviso_sideeffect_tab,{ovl6,0}]) end,
- Nodes), % Initiate the counter.
- ?l {ok,NodeResults1}=inviso:add_nodes(Nodes,
- a_ref,
- [{overload,{{?MODULE,overload6},1000}}]),
- ?l true=check_noderesults(Nodes,{ok,new},NodeResults1),
- %% Overload check shall not start until we start tracing.
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataList=lists:map(fun(N)->{N,[{trace,
- {file,filename:join([PrivDir,
- "tf_ovl5."++atom_to_list(N)
- ])}}]}
- end,
- Nodes),
- ?l {ok,NodeResults2}=inviso:init_tracing(TracerDataList),
- ?l true=check_noderesults(Nodes,{ok,[{trace_log,ok}]},NodeResults2),
- ?l ok=poll(ets,lookup,[inviso_sideeffect_tab,ovl6],[{ovl6,2}],25),
- %% Now we know that exactly 2 checks have been made. Try to Distract the runtime :-)
- ?l inviso_rt:state(whereis(inviso_rt)), % Make it have to receive a message.
- timer:sleep(500),
- ?l [{_,2}]=ets:lookup(inviso_sideeffect_tab,ovl6), % Should still be 2.
- timer:sleep(600),
- ?l [{_,3}]=ets:lookup(inviso_sideeffect_tab,ovl6), % We expect yet one check.
- timer:sleep(1100),
- ?l [{_,4}]=ets:lookup(inviso_sideeffect_tab,ovl6),
-
- stop_tracing(Nodes),
- stop(Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-
-%% TEST CASE: Test of the subscription mechanism.
-subscribe_dist_1(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- PrivDir=filename:join(?config(priv_dir,Config),""),
- Pid=spawn(?MODULE,inviso_msg_collector,[]),
- CtrlPid=whereis(inviso_c),
-
- ?l {ok,_Pid}=inviso:start(), % Start a control component.
- ?l ok=inviso:subscribe(Pid),
- ?l {ok,NodeResults1}=inviso:add_nodes(Nodes,a_ref,[]),
- ?l true=check_noderesults(Nodes,{ok,new},NodeResults1),
- ?l {ok,NodeResults2}=inviso:get_status(Nodes),
- ?l true=check_noderesults(Nodes,{ok,{new,running}},NodeResults2),
- check_msg_collector(Nodes,
- fun({inviso_event,CP,_,{connected,N,{_Tag,{idle,running}}}})
- when CP==CtrlPid ->
- {true,N};
- (_) ->
- false
- end,
- 13),
- TracerDataList=lists:map(fun(N)->{N,{file,
- filename:join([PrivDir,
- "tf_sub1"++atom_to_list(N)])}}
- end,
- Nodes),
- ?l {ok,NodeResults3}=inviso:init_tracing(TracerDataList),
- ?l true=check_noderesults(Nodes,{ok,[{trace_log,ok}]},NodeResults3),
- check_msg_collector(Nodes,
- fun({inviso_event,CP,_,{state_change,N,{tracing,running}}})
- when CP==CtrlPid ->
- {true,N};
- (_) ->
- false
- end,
- 13),
- ?l {ok,NodeResults4}=inviso:suspend(Nodes,test),
- ?l true=check_noderesults(Nodes,ok,NodeResults4),
- check_msg_collector(Nodes,
- fun({inviso_event,CP,_,{state_change,N,{tracing,{suspended,test}}}})
- when CP==CtrlPid ->
- {true,N};
- (_) ->
- false
- end,
- 13),
- ?l [RNode|_]=RemoteNodes,
- ?l RInvisoPid=rpc:call(RNode,erlang,whereis,[inviso_rt]),
- ?l rpc:call(RNode,erlang,exit,[RInvisoPid,kill]),
- check_msg_collector([RNode],
- fun({inviso_event,CP,_,{disconnected,N,_Info}})
- when CP==CtrlPid ->
- {true,N};
- (_) ->
- false
- end,
- 11),
-
- ?l {ok,_NodeResults5}=inviso:stop_tracing(Nodes),
- ?l {ok,_NodeResults6}=inviso:stop_nodes(Nodes),
- ?l shutdown=inviso:stop(),
- ok.
-%% -----------------------------------------------------------------------------
-
-
-%% TEST CASE: fetch_log test of single straight trace_log file in distributed
-%% environment.
-fetch_log_dist_trace_1(suite) -> [];
-fetch_log_dist_trace_1(doc) ->
- ["fetch_log test of single straight trace_log file in distributed"
- "environment."];
-fetch_log_dist_trace_1(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataList=lists:map(fun(N)->{N,[{trace,{file,filename:join([PrivDir,
- "testfile1."++
- atom_to_list(N)
- ])}}]} end,
- Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok}]}),
-
- %% Put some output in the logs.
- ?l inviso:tp(Nodes,math,module_info,0,[]),
- ?l inviso:tf(Nodes,all,[call]),
- ?l lists:foreach(fun(N)->rpc:call(N,math,module_info,[]) end,Nodes),
-
- stop_tracing(Nodes),
- {H,M,S}=time(),
- FetchToDir=filename:join([PrivDir,
- "fetch_log_test1_"++integer_to_list(H)++"_"++
- integer_to_list(M)++"_"++integer_to_list(S)]),
- ?l ok=file:make_dir(FetchToDir),
- ?l {ok,NodeResults}=inviso:fetch_log(RemoteNodes,FetchToDir,"p1"),
- io:format("~p~n",[NodeResults]),
- ?l true=check_noderesults(RemoteNodes,
- fun({N,{complete,[{trace_log,[{ok,File}]},{ti_log,[]}]}}) ->
- ?l File="p1testfile1."++atom_to_list(N),
- true;
- (_)->
- false
- end,
- NodeResults),
- ?l ON=filename:join(PrivDir,"testfile1."),
- ?l FN=filename:join(FetchToDir,"p1testfile1."),
- ?l lists:foreach(fun(N)->
- {ok,#file_info{size=Size}}=
- file:read_file_info(ON++atom_to_list(N)),
- {ok,#file_info{size=Size}}=
- file:read_file_info(FN++atom_to_list(N))
- end,
- RemoteNodes),
- %% Now we wish to see that we get an incomplete if we try to fetch to a
- %% directory that does not exist.
- ?l FetchToErrorDir=filename:join([PrivDir,nonexistingingdir]),
- ?l {ok,NodeResults2}=inviso:fetch_log(RemoteNodes,FetchToErrorDir,"p1"),
- ?l io:format("NodeResults2:~w~n",[NodeResults2]),
- ?l true=check_noderesults(RemoteNodes,
- fun({_,{incomplete,_}}) ->
- true;
- (_)->
- false
- end,
- NodeResults2),
- stop(Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-fetch_log_dist_trace_2(suite) -> [];
-fetch_log_dist_trace_2(doc) ->
- [""];
-fetch_log_dist_trace_2(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- PrivDir=filename:join(?config(priv_dir,Config),""),
-
- {H,M,S}=time(),
- ?l Name="wrap"++integer_to_list(H)++"_"++integer_to_list(M)++"_"++integer_to_list(S),
- ?l BaseName=filename:join(PrivDir,Name),
- Fun=fun(N)->{N,[{trace,{file,{BaseName++atom_to_list(N),wrap,".log",512,2}}},
- {ti,{file,BaseName++"_ti_"++atom_to_list(N)++".ti"}}]}
- end,
- ?l TracerDataList=lists:map(Fun,Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok},{ti_log,ok}]}),
- fill_and_reach_two_wrapfiles(PrivDir,"^"++Name,Nodes),
-
- stop_tracing(Nodes),
- FetchToDir=filename:join([PrivDir,
- "fetch_log_test2_"++integer_to_list(H)++"_"++
- integer_to_list(M)++"_"++integer_to_list(S)]),
- ?l ok=file:make_dir(FetchToDir),
- ?l {ok,NodeResults}=inviso:fetch_log(RemoteNodes,FetchToDir,"p1"),
- io:format("~p~n",[NodeResults]),
- CheckFun=fun({N,{complete,[{trace_log,FileResults1},{ti_log,[{ok,TiFile}]}]}}) ->
- Fun2=fun({ok,File}) ->
- match=
- re:run(File,
- "^"++"p1"++Name++atom_to_list(N),
- [{capture,none}]),
- true;
- (_) ->
- false
- end,
- ?l true=lists:all(Fun2,FileResults1),
- ?l TiFile="p1"++Name++"_ti_"++atom_to_list(N)++".ti",
- true;
- (_)->
- false
- end,
- ?l true=check_noderesults(RemoteNodes,CheckFun,NodeResults),
- stop(Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-fetch_log_dist_trace_3(suite) -> [];
-fetch_log_dist_trace_3(doc) ->
- [""];
-fetch_log_dist_trace_3(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- PrivDir=filename:join(?config(priv_dir,Config),""),
-
- {H,M,S}=time(),
- ?l Name="wrap2_"++integer_to_list(H)++"_"++integer_to_list(M)++"_"++integer_to_list(S),
- ?l BaseName=filename:join(PrivDir,Name),
- Fun=fun(N)->{N,[{trace,{file,{BaseName++atom_to_list(N),wrap,".log",512,2}}},
- {ti,{file,BaseName++"_ti_"++atom_to_list(N)++".ti"}}]}
- end,
- ?l TracerDataList=lists:map(Fun,Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok},{ti_log,ok}]}),
- fill_and_reach_two_wrapfiles(PrivDir,"^"++Name,Nodes),
-
- stop_tracing(Nodes),
- FetchToDir=filename:join([PrivDir,
- "fetch_log_test3_"++integer_to_list(H)++"_"++
- integer_to_list(M)++"_"++integer_to_list(S)]),
- ?l ok=file:make_dir(FetchToDir),
- ?l {ok,NodeResults1}=inviso:list_logs(Nodes),
- CheckFun=fun({N,{ok,[{trace_log,PrivDir2,[F1,F2]},{ti_log,PrivDir2,[F3]}]}})->
- PrivDir2=PrivDir,
- RegExp="^"++Name++atom_to_list(N)++"[0-9]+"++"\.log",
- match=re:run(F1,RegExp,[{capture,none}]),
- match=re:run(F2,RegExp,[{capture,none}]),
- F3=Name++"_ti_"++atom_to_list(N)++".ti",
- true;
- (_) ->
- false
- end,
- ?l true=check_noderesults(Nodes,CheckFun,NodeResults1),
- ?l NodeFileSpecList=lists:map(fun({N,{ok,L}})->{N,L} end,
- lists:keydelete(node(),1,NodeResults1)),
- ?l {ok,NodeResults2}=inviso:fetch_log(NodeFileSpecList,FetchToDir,"p1"),
-io:format("~p~n",[NodeResults2]),
- CheckFun2=fun({N,{complete,[{trace_log,FileResults1},{ti_log,[{ok,TiFile}]}]}}) ->
- Fun2=fun({ok,File}) ->
- match=
- re:run(File,
- "^"++"p1"++Name++atom_to_list(N),
- [{capture,none}]),
- true;
- (_) ->
- false
- end,
- ?l true=lists:all(Fun2,FileResults1),
- ?l TiFile="p1"++Name++"_ti_"++atom_to_list(N)++".ti",
- true;
- (_)->
- false
- end,
- ?l true=check_noderesults(RemoteNodes,CheckFun2,NodeResults2),
- stop(Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-fetch_log_dist_error_1(suite) -> [];
-fetch_log_dist_error_1(doc) ->
- [""];
-fetch_log_dist_error_1(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- ?l {ok,_Pid}=inviso:start(), % Start a control component.
- ?l {ok,NodeResults1}=inviso:add_nodes(Nodes,a_ref),
- ?l true=check_noderesults(Nodes,{ok,new},NodeResults1),
- ?l {ok,NodeResults2}=inviso:fetch_log(RemoteNodes,"foo","bar"),
-io:format("~p~n",[NodeResults2]),
- ?l true=check_noderesults(RemoteNodes,
- fun({_N,{error,no_tracerdata}})->true;
- (_)->false
- end,
- NodeResults2),
- stop(Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-fetch_log_dist_error_2(suite) -> [];
-fetch_log_dist_error_2(doc) ->
- [""];
-fetch_log_dist_error_2(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- PrivDir=filename:join(?config(priv_dir,Config),""),
- ?l {ok,_Pid}=inviso:start(), % Start a control component.
- ?l {ok,NodeResults1}=inviso:add_nodes(Nodes,a_ref),
- ?l true=check_noderesults(Nodes,{ok,new},NodeResults1),
- ?l NodeLogList=lists:map(fun(N)->{N,[{trace_log,
- PrivDir,
- ["f1,fil","f2.fil"]},
- {ti_log,
- PrivDir,
- ["f.ti"]}]}
- end,
- RemoteNodes),
- ?l {ok,NodeResults2}=inviso:fetch_log(NodeLogList,"foo","bar"),
- io:format("~p~n",[NodeResults2]),
- ?l true=check_noderesults(RemoteNodes,
- fun({_N,{incomplete,_}}) ->
- true;
- (_) ->
- false
- end,
- NodeResults2),
- ?l NodeTracerData=lists:map(fun(N)->{N,
- [{trace,{file,filename:join(PrivDir,"foo")}},
- {ti,{file,filename:join(PrivDir,"bar.ti")}}]}
- end,
- RemoteNodes),
- {ok,NodeResults3}=inviso:fetch_log(NodeTracerData,"foo","bar"),
- io:format("~p~n",[NodeResults3]),
-%% This should work this way. Now it says complete [], which is not entirely
-%% incorrect. But to follow the sematics of when fetching named files should
-%% say incomplete.
-%% Must do some rework to make that work. No real danger leaving it this way
-%% for now.
-% ?l true=check_noderesults(RemoteNodes,
-% fun({_N,{incomplete,_}}) ->
-% true;
-% (_) ->
-% false
-% end,
-% NodeResults3),
- stop(Nodes),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: This case tests that the log file merger merges files in the
-%% correct order, based on the timestamps.
-lfm_trace_dist_1(suite) -> [];
-lfm_trace_dist_1(doc) ->
- [""];
-lfm_trace_dist_1(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- [RNode1,RNode2|_]=RemoteNodes,
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataList=
- lists:map(fun(N)->{N,{file,filename:join([PrivDir,"lfm1_"++atom_to_list(N)])}} end,
- Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok}]}),
- activate_local_tracing(Nodes),
- activate_traceflags(Nodes),
-
- {inviso_test_proc,RNode2} ! {apply,code,which,[lists]},
- timer:sleep(300),
- {inviso_test_proc,RNode1} ! {apply,code,which,[lists]},
- timer:sleep(300),
- {inviso_test_proc,RNode1} ! {apply,code,which,[lists]},
- timer:sleep(300),
- inviso_test_proc ! {apply,code,which,[lists]},
- timer:sleep(300),
- {inviso_test_proc,RNode2} ! {apply,code,which,[lists]},
- timer:sleep(300),
- inviso_test_proc ! {apply,code,which,[lists]},
-
- deactivate_traceflags(Nodes),
- deactivate_local_tracing(Nodes),
- stop_tracing(Nodes),
- stop(Nodes),
-
- DestFile=filename:join(PrivDir,"lfm1_out.txt"),
- ?l {ok,6}=
- inviso_lfm:merge([{node(),
- [{trace_log,
- [filename:join(PrivDir,"lfm1_"++atom_to_list(node()))]}]},
- {RNode1,
- [{trace_log,
- [filename:join(PrivDir,"lfm1_"++atom_to_list(RNode1))]}]},
- {RNode2,
- [{trace_log,
- [filename:join(PrivDir,"lfm1_"++atom_to_list(RNode2))]}]}],
- DestFile),
- ?l {ok,FD}=file:open(DestFile,[read]),
- ?l S1=io:get_line(FD,""),
- ?l true=lists:prefix(atom_to_list(RNode2),S1),
- ?l S2=io:get_line(FD,""),
- ?l true=lists:prefix(atom_to_list(RNode1),S2),
- ?l S3=io:get_line(FD,""),
- ?l true=lists:prefix(atom_to_list(RNode1),S3),
- ?l S4=io:get_line(FD,""),
- ?l true=lists:prefix(atom_to_list(node()),S4),
- ?l S5=io:get_line(FD,""),
- ?l true=lists:prefix(atom_to_list(RNode2),S5),
- ?l S6=io:get_line(FD,""),
- ?l true=lists:prefix(atom_to_list(node()),S6),
- ?l file:close(FD),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: Testing to the full extent that pid-mappings work with both
-%% local and global registration. Also checks that pidmappings can be removed
-%% and that consequently the mappings in the resulting merged file stops.
-lfm_trace_ti_dist_2(suite) -> [];
-lfm_trace_ti_dist_2(doc) ->
- [""];
-lfm_trace_ti_dist_2(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- [RNode1,RNode2|_]=RemoteNodes,
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataList=
- lists:map(fun(N)->{N,[{trace,{file,filename:join(PrivDir,"lfm2_"++atom_to_list(N))}},
- {ti,{file,filename:join(PrivDir,"lfm2_ti_"++atom_to_list(N))}}]}
- end,
- Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok},{ti_log,ok}]}),
- activate_local_tracing(Nodes),
- activate_meta_tracing(Nodes),
- activate_traceflags(Nodes),
-
- {inviso_test_proc,RNode2} ! {apply,code,which,[lists]},
- timer:sleep(300),
- {inviso_test_proc,RNode1} ! {apply,code,which,[lists]},
- timer:sleep(300),
- {inviso_test_proc,RNode1} ! {apply,code,which,[lists]},
- timer:sleep(300),
- inviso_test_proc ! {apply,code,which,[lists]},
- timer:sleep(300),
-
- P2=spawn(RNode2,?MODULE,test_proc_loop,[]),
- P1=spawn(RNode1,?MODULE,test_proc_loop,[]),
- P0=spawn_link(?MODULE,test_proc_loop,[]),
- ThisNode=node(),
- ?l {ok,[{ThisNode,{ok,[1]}}]}=inviso:tf([node()],P0,[call,timestamp]),
- ?l {ok,[{RNode1,{ok,[1]}}]}=inviso:tf([RNode1],P1,[call,timestamp]),
- ?l {ok,[{RNode2,{ok,[1]}}]}=inviso:tf([RNode2],P2,[call,timestamp]),
- P2 ! {apply,code,which,[lists]},
- timer:sleep(300),
- P1 ! {apply,code,which,[lists]},
- timer:sleep(300),
- P0 ! {apply,code,which,[lists]},
- timer:sleep(300),
-
- P3=spawn(RNode2,?MODULE,test_proc_loop,[]),
- ?l yes=global:register_name(inviso_test_proc_globalname,P3),
- ?l {ok,[{RNode2,{ok,[1]}}]}=inviso:tf([RNode2],P3,[call,timestamp]),
- timer:sleep(300),
- P3 ! {apply,code,which,[lists]},
- timer:sleep(300),
-
- P4=rpc:call(RNode1,erlang,whereis,[inviso_test_proc]),
- ?l true=rpc:call(RNode1,erlang,unregister,[inviso_test_proc]),
- timer:sleep(300),
- P4 ! {apply,code,which,[lists]},
- timer:sleep(300),
-
- ?l true=rpc:call(RNode1,erlang,register,[inviso_test_proc,P4]),
-
- ?l global:unregister_name(inviso_test_proc_globalname),
- timer:sleep(300),
- ?l P3 ! {apply,code,which,[lists]},
- timer:sleep(300),
-
- deactivate_traceflags(Nodes),
- deactivate_local_tracing(Nodes),
- stop_tracing(Nodes),
- stop(Nodes),
-
- DestFile=filename:join(PrivDir,"lfm2_out.txt"),
- ?l {ok,10}=
- inviso_lfm:merge([
- {node(),
- [{trace_log,
- [filename:join(PrivDir,"lfm2_"++atom_to_list(node()))]},
- {ti_log,
- [filename:join(PrivDir,"lfm2_ti_"++atom_to_list(node()))]}]},
- {RNode1,
- [{trace_log,
- [filename:join(PrivDir,"lfm2_"++atom_to_list(RNode1))]},
- {ti_log,
- [filename:join(PrivDir,"lfm2_ti_"++atom_to_list(RNode1))]}]},
- {RNode2,
- [{trace_log,
- [filename:join(PrivDir,"lfm2_"++atom_to_list(RNode2))]},
- {ti_log,
- [filename:join(PrivDir,"lfm2_ti_"++atom_to_list(RNode2))]}]}
- ],
- DestFile),
- ?l {ok,FD}=file:open(DestFile,[read]),
- ?l S1=io:get_line(FD,""),
-io:format("S1 is:~p~n",[S1]),
- ?l true=lists:prefix(atom_to_list(RNode2)++" [inviso_test_proc",S1),
- ?l S2=io:get_line(FD,""),
- ?l true=lists:prefix(atom_to_list(RNode1)++" [inviso_test_proc",S2),
- ?l S3=io:get_line(FD,""),
- ?l true=lists:prefix(atom_to_list(RNode1)++" [inviso_test_proc",S3),
- ?l S4=io:get_line(FD,""),
- ?l true=lists:prefix(atom_to_list(node())++" [inviso_test_proc",S4),
- ?l S5=io:get_line(FD,""),
- ?l true=lists:prefix(atom_to_list(RNode2)++" []",S5),
- ?l S6=io:get_line(FD,""),
- ?l true=lists:prefix(atom_to_list(RNode1)++" []",S6),
- ?l S7=io:get_line(FD,""),
- ?l true=lists:prefix(atom_to_list(node())++" []",S7),
- ?l S8=io:get_line(FD,""),
- ?l true=lists:prefix(atom_to_list(RNode2)++" [{global,inviso_test_proc_globalname}]",S8),
- ?l S9=io:get_line(FD,""),
- ?l true=lists:prefix(atom_to_list(RNode1)++" []",S9),
- ?l S10=io:get_line(FD,""),
- ?l true=lists:prefix(atom_to_list(RNode2)++" []",S10),
- ?l file:close(FD),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: This tests that the wrapset sorter works.
-handle_logfile_sort_wrapset(suite) -> [];
-handle_logfile_sort_wrapset(doc) ->
- [""];
-handle_logfile_sort_wrapset(Config) when is_list(Config) ->
- File0="prefix10.fil",
- File1="prefix11.fil",
- File2="prefix12.fil",
- File3="prefix13.fil",
- ?l [File0,File1,File2,File3]=
- inviso_lfm_tpfreader:handle_logfile_sort_wrapset([File2,File1,File0,File3]),
- File5="prefix15.fil",
- ?l [File5,File0,File1,File2,File3]=
- inviso_lfm_tpfreader:handle_logfile_sort_wrapset([File2,File5,File1,File0,File3]),
- ok.
-%% -----------------------------------------------------------------------------
-
-%% TEST CASE: This case tests that the regexp mechanism in the inviso_rt_lib can
-%% find modules using regexps and that its only_loaded mechanism works.
-%% This test case can not be run when using cover because cover will make the
-%% modules no longer loaded from the path containing "runtime_tools".
-expand_regexp_dist_1(suite) -> [];
-expand_regexp_dist_1(doc) ->
- [""];
-expand_regexp_dist_1(Config) when is_list(Config) ->
- case ?t:is_cover() of
- true ->
- {skip,"Cover is running"};
- false ->
- expand_regexp_dist_1_nocover(Config)
- end.
-
-expand_regexp_dist_1_nocover(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- [RNode1|_]=RemoteNodes,
- ?l NodeResults1=inviso_rt_lib:expand_regexp(Nodes,"^inviso_rt.*",[]),
- ?l L1=length(Nodes),
- ?l L1=length(NodeResults1),
- ?l true=lists:all(fun({_,Mods})->
- ?l 3=length(Mods),
- ?l true=lists:member(inviso_rt,Mods),
- ?l true=lists:member(inviso_rt_lib,Mods),
- ?l true=lists:member(inviso_rt_meta,Mods),
- true;
- (_) ->
- false
- end,
- NodeResults1),
- %% Check the dir-option. In the following inviso_tool_lib shall not be found.
- ?l NodeResults2=inviso_rt_lib:expand_regexp(Nodes,"runtime_tools","invi.*lib.*",[]),
-?l io:format("NodeResults2:~w~n",[NodeResults2]),
- ?l L1=length(NodeResults2), % Same number of nodes replying.
- ?l true=lists:all(fun({_,Mods})->
- 2=length(Mods),
- true=lists:member(inviso_as_lib,Mods),
- true=lists:member(inviso_rt_lib,Mods),
- true;
- (_) ->
- false
- end,
- NodeResults2),
- ?l [{RNode1,[]}]=
- inviso_rt_lib:expand_regexp([RNode1],"^inviso_testmodule1.*",[only_loaded]),
- ?l [{RNode1,[inviso_testmodule1_foo]}]=
- inviso_rt_lib:expand_regexp([RNode1],"^inviso_testmodule1.*",[]),
- ok.
-%% -----------------------------------------------------------------------------
-
-
-only_loaded_dist_1(suite) -> [];
-only_loaded_dist_1(doc) ->
- [""];
-only_loaded_dist_1(Config) when is_list(Config) ->
- RemoteNodes=get_remotenodes_config(Config),
- Nodes=[node()|RemoteNodes],
- [RNode1|_]=RemoteNodes,
- PrivDir=filename:join(?config(priv_dir,Config),""),
- TracerDataList=
- lists:map(fun(N)->{N,[{trace,{file,filename:join(PrivDir,"ol_1_"++atom_to_list(N))}}]}
- end,
- Nodes),
- start_and_init_tracing2(Nodes,[],TracerDataList,{ok,[{trace_log,ok}]}),
- ?l false=rpc:call(RNode1,erlang,module_loaded,[inviso_testmodule1_foo]),
- ?l {ok,[{RNode1,{ok,[0]}}]}=
- inviso:tpl([RNode1],inviso_testmodule1_foo,'_','_',[],[only_loaded]),
- ?l false=rpc:call(RNode1,erlang,module_loaded,[inviso_testmodule1_foo]),
- ?l {ok,[{RNode1,{ok,[3]}}]}=
- inviso:tpl([RNode1],inviso_testmodule1_foo,'_','_',[],[]),
- stop_tracing(Nodes),
- stop(Nodes),
- ok.
-
-
-%% ==============================================================================
-%% Common functions setting up inviso.
-%% ==============================================================================
-
-%% Starts controlcomponent and adds runtime components on the nodes specified.
-%% Also initiates tracing on the nodes.
-start_and_init_tracing1(Nodes,Options,TracerData,Reply) when is_list(Nodes) ->
- ?l {ok,_Pid}=inviso:start(), % Start a control component.
- ?l {ok,NodeResults1}=inviso:add_nodes(Nodes,a_ref,Options),
- io:format("~p~n",[NodeResults1]),
- ?l true=check_noderesults(Nodes,{ok,new},NodeResults1),
- ?l {ok,NodeResults2}=inviso:get_status(Nodes),
- ?l true=check_noderesults(Nodes,{ok,{new,running}},NodeResults2),
- ?l {ok,NodeResults3}=inviso:init_tracing(Nodes,TracerData),
- ?l true=check_noderesults(Nodes,Reply,NodeResults3),
- ok.
-start_and_init_tracing2(Nodes,Options,TracerDataList,Reply) ->
- ?l {ok,_Pid}=inviso:start(), % Start a control component.
- ?l {ok,NodeResults1}=inviso:add_nodes(Nodes,a_ref,Options),
- io:format("~p~n",[NodeResults1]),
- ?l true=check_noderesults(Nodes,{ok,new},NodeResults1),
- ?l {ok,NodeResults2}=inviso:get_status(Nodes),
- ?l true=check_noderesults(Nodes,{ok,{new,running}},NodeResults2),
- ?l {ok,NodeResults4}=inviso:get_tracerdata(Nodes),
- ?l true=check_noderesults(Nodes,{ok,no_tracerdata},NodeResults4),
- ?l {ok,NodeResults3}=inviso:init_tracing(TracerDataList),
- io:format("Tracerdatalist:~p~n",[TracerDataList]),
- ?l true=check_noderesults(Nodes,Reply,NodeResults3),
-
- ?l Fun1=fun({N,{ok,TD}}) when is_list(TD)->
- ?l {value,{trace,Trace}}=lists:keysearch(trace,1,TD),
- ?l {value,{N,TD2}}=lists:keysearch(N,1,TracerDataList),
- ?l true=lists:member({trace,Trace},TD2),
- %% Check that the trace file really exists.
- ?l case Trace of % Trace={file,FilePortParameters}
- {file,FileName1} when is_list(FileName1) ->
- ?l {ok,_}=rpc:call(N,file,read_file_info,[FileName1]);
- _ -> % This should be extended with more cases.
- true
- end,
- ?l case lists:keysearch(ti,1,TD2) of
- {value,{_,Ti}} -> % Ok, we have ti too.
- ?l {value,{_,Ti}}=lists:keysearch(ti,1,TD),
- ?l FileName2=element(2,Ti),
- ?l {ok,_}=rpc:call(N,file,read_file_info,[FileName2]),
- true;
- false -> % No ti, we are done now.
- true
- end;
- ({N,{ok,{file,FileName}}}) ->
- ?l {value,{N,{file,FileName}}}=lists:keysearch(N,1,TracerDataList),
- ?l {ok,_}=rpc:call(N,file,read_file_info,[FileName]),
- true;
- ({N,{ok,LogTD}}) -> % The case using a fun.
- ?l {value,{N,LogTD}}=lists:keysearch(N,1,TracerDataList),
- true
- end,
- ?l {ok,NodeResults5}=inviso:get_tracerdata(Nodes),
- ?l true=check_noderesults(Nodes,Fun1,NodeResults5),
- ok.
-%% ------------------------------------------------------------------------------
-
-%% Stops tracing on Nodes.
-stop_tracing(Nodes) when is_list(Nodes) ->
- ?l {ok,NodeResults1}=inviso:stop_tracing(Nodes),
- ?l true=check_noderesults(Nodes,{ok,idle},NodeResults1),
- ?l {ok,NodeResults2}=inviso:get_status(Nodes),
- ?l true=check_noderesults(Nodes,{ok,{idle,running}},NodeResults2),
- %% The implementation says that the meta tracer shall be stopped when
- %% tracing is stopped. Check that.
- ?l lists:foreach(fun(N)->
- ok=poll(erlang,whereis,[inviso_rt_meta],undefined,20)
- end,
- Nodes).
-%% ------------------------------------------------------------------------------
-
-%% Stops the runtime components on Nodes and stops the control component at this
-%% Erlang node.
-stop(Nodes) when is_list(Nodes) ->
- ?l true=check_on_nodes(Nodes,erlang,whereis,[inviso_rt],fun(P) when is_pid(P)->true end),
- ?l {ok,NodeResults}=inviso:stop_nodes(Nodes),
- ?l true=check_noderesults(Nodes,ok,NodeResults),
- ?l true=check_on_nodes(Nodes,erlang,whereis,[inviso_rt],fun(undefined)->true end),
- ?l true=is_pid(whereis(inviso_c)),
- ?l shutdown=inviso:stop(),
- ?l ok=poll(erlang,whereis,[inviso_c],undefined,20).
-%% ------------------------------------------------------------------------------
-
-%% Help function activating local tracing.
-activate_local_tracing(Nodes) when is_list(Nodes) ->
- ?l true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{code,which,1},traced],
- {traced,false}),
- ?l {ok,NodeResults}=inviso:tpl(Nodes,code,which,1,[]),
- ?l true=check_noderesults(Nodes,fun({_,{ok,[1]}})->true end,NodeResults),
- ?l true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{code,which,1},traced],
- {traced,local}).
-%% ------------------------------------------------------------------------------
-
-%% Help function activating global tracing.
-activate_global_tracing(Nodes) when is_list(Nodes) ->
- ?l true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{code,get_path,0},traced],
- {traced,false}),
- ?l {ok,NodeResults}=inviso:tp(Nodes,code,get_path,0,[]),
- ?l true=check_noderesults(Nodes,fun({_,{ok,[1]}})->true end,NodeResults),
- ?l true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{code,get_path,0},traced],
- {traced,global}).
-%% ------------------------------------------------------------------------------
-
-
-%% Help function activating local tracing and using a regexp to point out modules.
-%% Returns the structure of modules and functions that were activated. Must be used
-%% when deactivating.
-activate_global_tracing_regexp(Nodes) when is_list(Nodes) ->
- %% First find out which modules will be effected.
- ?l Mods1=inviso_rt_lib:expand_regexp("application.*",[]),
- ?l true=(length(Mods1)>1), % Should find more than one module!
- ?l Funcs1=lists:foldl(fun(M,Acc)->[{M,M:module_info(exports)}|Acc] end,[],Mods1),
- %% Check that these functions are not traced.
- io:format("Modules:~w~n",[Mods1]),
- ?l {ok,NodeResults}=inviso:tp(Nodes,"application.*",'_','_',[],[]),
- io:format("Here 2~w~n",[NodeResults]),
- ?l N=lists:foldl(fun({_,L1},A1)->lists:foldl(fun(_,A2)->A2+1 end,A1,L1) end,0,Funcs1),
- ?l true=check_noderesults(Nodes,fun({_,{ok,L}})-> N==lists:sum(L) end,NodeResults),
- io:format("Here 3~n",[]),
- %% Check again!
- ?l lists:foreach(fun({M,Funcs})->
- lists:foreach(fun({F,Arity})->
- true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{M,F,Arity},traced],
- {traced,global})
- end,
- Funcs)
- end,
- Funcs1),
- Funcs1.
-%% ------------------------------------------------------------------------------
-
-%% Help function as above but uses the dir feature as well.
-activate_global_tracing_regexp_dir(Nodes) when is_list(Nodes) ->
- %% First find out which modules will be effected.
- ?l Mods1=inviso_rt_lib:expand_regexp(".*kernel.*","application.*",[]),
- ?l true=(length(Mods1)>1), % Should find more than one module!
- ?l Funcs1=lists:foldl(fun(M,Acc)->[{M,M:module_info(exports)}|Acc] end,[],Mods1),
- %% Check that these functions are not traced.
- io:format("Modules:~w~n",[Mods1]),
- ?l {ok,NodeResults}=inviso:tp(Nodes,{".*kernel.*","application.*"},'_','_',[],[]),
- io:format("Here 2~w~n",[NodeResults]),
- ?l N=lists:foldl(fun({_,L1},A1)->lists:foldl(fun(_,A2)->A2+1 end,A1,L1) end,0,Funcs1),
- ?l true=check_noderesults(Nodes,fun({_,{ok,L}})-> N==lists:sum(L) end,NodeResults),
- io:format("Here 3~n",[]),
- %% Check again!
- ?l lists:foreach(fun({M,Funcs})->
- lists:foreach(fun({F,Arity})->
- true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{M,F,Arity},traced],
- {traced,global})
- end,
- Funcs)
- end,
- Funcs1),
- Funcs1.
-%% ------------------------------------------------------------------------------
-
-deactivate_local_tracing(Nodes) when is_list(Nodes) ->
- ?l true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{code,which,1},traced],
- {traced,local}),
- ?l {ok,NodeResults}=inviso:ctpl(Nodes,code,'_','_'),
- ?l true=check_noderesults(Nodes,fun({_,{ok,[N]}})when is_integer(N)->true end,NodeResults),
- ?l true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{code,which,1},traced],
- {traced,false}).
-%% ------------------------------------------------------------------------------
-
-deactivate_global_tracing(Nodes) when is_list(Nodes) ->
- ?l true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{code,get_path,0},traced],
- {traced,global}),
- ?l {ok,NodeResults}=inviso:ctp(Nodes,code,'_','_'),
- ?l true=check_noderesults(Nodes,fun({_,{ok,[N]}})when is_integer(N)->true end,NodeResults),
- ?l true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{code,get_path,0},traced],
- {traced,false}).
-%% ------------------------------------------------------------------------------
-
-
-%% Function deactivating the functions activated by activate_global_tracing_regexp/1.
-deactivate_global_tracing_regexp(Nodes,Funcs1) ->
- ?l lists:foreach(fun({M,Funcs})->
- lists:foreach(fun({F,Arity})->
- true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{M,F,Arity},traced],
- {traced,global})
- end,
- Funcs)
- end,
- Funcs1),
- ?l {ok,NodeResults}=inviso:ctp(Nodes,"application.*",'_','_'),
- ?l N=lists:foldl(fun({_,L1},A1)->lists:foldl(fun(_,A2)->A2+1 end,A1,L1) end,0,Funcs1),
- io:format("Noderesult from deactivate;~w~n",[NodeResults]),
- ?l true=check_noderesults(Nodes,fun({_,{ok,L}})-> N==lists:sum(L) end,NodeResults),
- ?l lists:foreach(fun({M,Funcs})->
- lists:foreach(fun({F,Arity})->
- true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{M,F,Arity},traced],
- {traced,false})
- end,
- Funcs)
- end,
- Funcs1).
-%% ------------------------------------------------------------------------------
-
-%% Function deactivating the functions activated by activate_global_tracing_regexp_dir/1.
-deactivate_global_tracing_regexp_dir(Nodes,Funcs1) ->
- ?l lists:foreach(fun({M,Funcs})->
- lists:foreach(fun({F,Arity})->
- true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{M,F,Arity},traced],
- {traced,global})
- end,
- Funcs)
- end,
- Funcs1),
- ?l {ok,NodeResults}=inviso:ctp(Nodes,{".*kernel.*","application.*"},'_','_'),
- ?l N=lists:foldl(fun({_,L1},A1)->lists:foldl(fun(_,A2)->A2+1 end,A1,L1) end,0,Funcs1),
- io:format("Noderesult from deactivate;~w~n",[NodeResults]),
- ?l true=check_noderesults(Nodes,fun({_,{ok,L}})-> N==lists:sum(L) end,NodeResults),
- ?l lists:foreach(fun({M,Funcs})->
- lists:foreach(fun({F,Arity})->
- true=check_on_nodes(Nodes,
- erlang,
- trace_info,
- [{M,F,Arity},traced],
- {traced,false})
- end,
- Funcs)
- end,
- Funcs1).
-%% ------------------------------------------------------------------------------
-
-%% Help function which starts the inviso_test_proc on all nodes and then sets
-%% the call flag on that process.
-activate_traceflags(Nodes) ->
- ?l lists:foreach(fun(N)->spawn(N,?MODULE,test_proc_init,[]) end,Nodes),
- ?l lists:foreach(fun(N)->
- P=rpc:call(N,erlang,whereis,[inviso_test_proc]),
- {flags,[]}=rpc:call(N,erlang,trace_info,[P,flags])
- end,
- Nodes),
- ?l {ok,NodeResults}=inviso:tf(Nodes,inviso_test_proc,[call,timestamp]),
- ?l true=check_noderesults(Nodes,{ok,[1]},NodeResults),
- ?l lists:foreach(fun(N)->
- P=rpc:call(N,erlang,whereis,[inviso_test_proc]),
- {flags,Flags}=rpc:call(N,erlang,trace_info,[P,flags]),
- true=lists:member(call,Flags),
- true=lists:member(timestamp,Flags)
- end,
- Nodes),
- %% Now try a globally registered process.
- ?l [ANode|_]=Nodes,
- ?l GPid=spawn(ANode,?MODULE,global_test_proc_init,[]),
- ?l ok=poll(global,whereis_name,[global_inviso_test_proc],
- fun(P) when is_pid(P)->true;(_)->false end,
- 10),
- ?l {ok,NodeResults2}=
- inviso:tf(Nodes,{global,global_inviso_test_proc},[call,timestamp]),
- ?l true=check_noderesults(Nodes,
- fun({N,{ok,[1]}}) when N==ANode->true;
- ({_,{ok,[0]}})->true;
- (_)->false
- end,
- NodeResults2),
- ?l {flags,Flags2}=rpc:call(ANode,erlang,trace_info,[GPid,flags]),
- ?l 2=length(Flags2),
- ?l true=lists:member(call,Flags2),
- ?l true=lists:member(timestamp,Flags2),
- true.
-%% ------------------------------------------------------------------------------
-
-deactivate_traceflags(Nodes) ->
- ?l lists:foreach(fun(N)->
- P=rpc:call(N,erlang,whereis,[inviso_test_proc]),
- {flags,Flags}=rpc:call(N,erlang,trace_info,[P,flags]),
- true=lists:member(call,Flags),
- true=lists:member(timestamp,Flags)
- end,
- Nodes),
- ?l {ok,NodeResults}=inviso:ctf(Nodes,inviso_test_proc,[call,timestamp]),
- ?l true=check_noderesults(Nodes,{ok,[1]},NodeResults),
- ?l lists:foreach(fun(N)->
- P=rpc:call(N,erlang,whereis,[inviso_test_proc]),
- {flags,[]}=rpc:call(N,erlang,trace_info,[P,flags])
- end,
- Nodes),
- ?l GPid=global:whereis_name(global_inviso_test_proc),
- ?l ANode=node(GPid),
- ?l {flags,Flags2}=rpc:call(ANode,erlang,trace_info,[GPid,flags]),
- ?l 2=length(Flags2),
- ?l {ok,NodeResults2}=inviso:ctf(Nodes,{global,global_inviso_test_proc},[call,timestamp]),
- ?l true=check_noderesults(Nodes,
- fun({N,{ok,[1]}}) when N==ANode->true;
- ({_,{ok,[0]}})->true;
- (_)->false
- end,
- NodeResults2).
-%% ------------------------------------------------------------------------------
-
-
-activate_meta_tracing(Nodes) ->
- ?l {ok,NodeResults1}=inviso:tpm_localnames(),
- ?l true=check_noderesults(Nodes,{{ok,1},{ok,1}},NodeResults1),
- ?l lists:foreach(fun(N)->P=rpc:call(N,erlang,whereis,[inviso_rt_meta]),
- {meta,P}=rpc:call(N,erlang,trace_info,[{erlang,register,2},meta])
- end,
- Nodes),
- ?l lists:foreach(fun(N)->P=rpc:call(N,erlang,whereis,[inviso_rt_meta]),
- {meta,P}=rpc:call(N,erlang,trace_info,[{erlang,unregister,1},meta])
- end,
- Nodes),
- ?l {ok,NodeResults2}=inviso:tpm_globalnames(),
- ?l true=check_noderesults(Nodes,{{ok,1},{ok,1}},NodeResults2),
- ?l lists:foreach(fun(N)->P=rpc:call(N,erlang,whereis,[inviso_rt_meta]),
- {meta,P}=rpc:call(N,
- erlang,
- trace_info,
- [{global,handle_call,3},meta])
- end,
- Nodes),
- ?l lists:foreach(fun(N)->P=rpc:call(N,erlang,whereis,[inviso_rt_meta]),
- {meta,P}=rpc:call(N,
- erlang,
- trace_info,
- [{global,delete_global_name,2},meta])
- end,
- Nodes),
-
- ?l lists:foreach(fun(N)->true=rpc:call(N,
- ets,
- insert,
- [inviso_sideeffect_tab,{tpm_init_func1,0}]),
- true=rpc:call(N,
- ets,
- insert,
- [inviso_sideeffect_tab,{tpm_call_func1,0}]),
- true=rpc:call(N,
- ets,
- insert,
- [inviso_sideeffect_tab,{tpm_return_func1,0}])
- end,
- Nodes),
- ?l {ok,NodeResults3}=
- inviso:init_tpm(lists,
- module_info,
- 0,
- {?MODULE,tpm_init_func1},
- {?MODULE,tpm_call_func1},
- {?MODULE,tpm_return_func1},
- {?MODULE,tpm_remove_func1}),
- ?l true=check_noderesults(Nodes,ok,NodeResults3),
- ?l [{_,1}]=ets:lookup(inviso_sideeffect_tab,tpm_init_func1),
- ?l {ok,NodeResults3a}=
- inviso:init_tpm(lists,
- module_info,
- 0,
- {?MODULE,tpm_init_func1},
- {?MODULE,tpm_call_func1},
- {?MODULE,tpm_return_func1},
- {?MODULE,tpm_remove_func1}),
- ?l true=check_noderesults(Nodes,{error,already_initiated},NodeResults3a),
-% %% Try more forbidden things. Wildcards not allowed in meta tracing!
-% ?l {ok,NodeResults3b}=inviso:tpm(Nodes,lists,'_',0,[{'_',[],[{return_trace}]}]),
-% io:format("The noderesults3b is:~w~n",[NodeResults3b]),
-% ?l true=check_noderesults(Nodes,{error,bad_mfa},NodeResults3b),
- ?l {ok,NodeResults3c}=inviso:tpm(Nodes,lists,module_info,0,[{'_',[],[{return_trace}]}]),
- ?l true=check_noderesults(Nodes,{ok,1},NodeResults3c),
- ?l lists:foreach(fun(N)->P=rpc:call(N,erlang,whereis,[inviso_rt_meta]),
- {meta,P}=rpc:call(N,erlang,trace_info,[{lists,module_info,0},meta])
- end,
- Nodes),
- ?l lists:foreach(fun(N)->rpc:call(N,lists,module_info,[]) end,Nodes),
- ?l ok=poll(ets,lookup,[inviso_sideeffect_tab,tpm_call_func1],[{tpm_call_func1,1}],20),
- ?l ok=poll(ets,lookup,[inviso_sideeffect_tab,tpm_return_func1],[{tpm_return_func1,1}],20),
- ?l lists:foreach(fun(N)->rpc:call(N,lists,module_info,[]) end,Nodes),
- ?l ok=poll(ets,lookup,[inviso_sideeffect_tab,tpm_call_func1],[{tpm_call_func1,2}],20),
- ?l ok=poll(ets,lookup,[inviso_sideeffect_tab,tpm_return_func1],[{tpm_return_func1,2}],20),
-
- ?l {ok,NodeResults4}=
- inviso:init_tpm(math,
- module_info,
- 1,
- {?MODULE,tpm_init_func2}, % Does not exist on purpose.
- {?MODULE,tpm_call_func2}, % Does not exist on purpose.
- {?MODULE,tpm_return_func2}, % Does not exist on purpose.
- {?MODULE,tpm_remove_func2}), % Does not exist on purpose.
- ?l true=check_noderesults(Nodes,ok,NodeResults4),
- ?l {ok,NodeResults5}=
- inviso:tpm_ms(math,module_info,1,ms1,[{'_',[],[{return_trace}]}]),
- ?l true=check_noderesults(Nodes,{ok,1},NodeResults5),
- ?l lists:foreach(fun(N)->{meta_match_spec,[{'_',[],[{return_trace}]}]}=
- rpc:call(N,erlang,trace_info,[{math,module_info,1},
- meta_match_spec])
- end,
- Nodes),
-
- ?l {ok,NodeResults6}=inviso:tpm_ms(math,module_info,1,ms2,[{[exports],[],[]}]),
- ?l true=check_noderesults(Nodes,{ok,1},NodeResults6),
- ?l lists:foreach(fun(N)->{meta_match_spec,[{[exports],[],[]},{'_',[],[{return_trace}]}]}=
- rpc:call(N,erlang,trace_info,[{math,module_info,1},
- meta_match_spec])
- end,
- Nodes),
- ?l {ok,NodeResults7}=inviso:tpm_ms(math,module_info,1,ms3,[{[attributes],[],[]}]),
- ?l true=check_noderesults(Nodes,{ok,1},NodeResults7),
- ?l lists:foreach(fun(N)->{meta_match_spec,[{[attributes],[],[]},
- {[exports],[],[]},
- {'_',[],[{return_trace}]}]}=
- rpc:call(N,erlang,trace_info,[{math,module_info,1},
- meta_match_spec])
- end,
- Nodes),
- ?l {ok,NodeResults8}=inviso:ctpm_ms(math,module_info,1,ms2),
- ?l true=check_noderesults(Nodes,ok,NodeResults8),
- ?l lists:foreach(fun(N)->{meta_match_spec,[{[attributes],[],[]},
- {'_',[],[{return_trace}]}]}=
- rpc:call(N,erlang,trace_info,[{math,module_info,1},
- meta_match_spec])
- end,
- Nodes),
- ?l io:format("whereis:~w~n",[lists:map(fun(N)->rpc:call(N,erlang,whereis,[inviso_rt_meta]) end,Nodes)]),
- ?l {ok,NodeResults8}=inviso:ctpm_ms(math,module_info,1,ms3),
- ?l io:format("whereis:~w~n",[lists:map(fun(N)->rpc:call(N,erlang,whereis,[inviso_rt_meta]) end,Nodes)]),
- ?l {ok,NodeResults8}=inviso:ctpm_ms(math,module_info,1,ms1),
- ?l lists:foreach(fun(N)->{meta_match_spec,false}=
- rpc:call(N,erlang,trace_info,[{math,module_info,1},
- meta_match_spec])
- end,
- Nodes),
-
- %% Now try to do this with exception tracing instead.
- %% Reset the side effect tables.
- ?l lists:foreach(fun(N)->true=rpc:call(N,
- ets,
- insert,
- [inviso_sideeffect_tab,{tpm_init_func1,0}]),
- true=rpc:call(N,
- ets,
- insert,
- [inviso_sideeffect_tab,{tpm_call_func1,0}]),
- true=rpc:call(N,
- ets,
- insert,
- [inviso_sideeffect_tab,{tpm_return_func1,0}])
- end,
- Nodes),
- ?l {ok,NodeResults9}=
- inviso:init_tpm(?MODULE,
- failing_function,
- 1,
- {?MODULE,tpm_init_func1},
- {?MODULE,tpm_call_func1},
- {?MODULE,tpm_return_func1},
- {?MODULE,tpm_remove_func1}),
- ?l true=check_noderesults(Nodes,ok,NodeResults9),
- ?l [{_,1}]=ets:lookup(inviso_sideeffect_tab,tpm_init_func1),
- ?l {ok,NodeResults10}=inviso:tpm(Nodes,?MODULE,failing_function,1,[{'_',[],[{exception_trace}]}]),
- ?l true=check_noderesults(Nodes,{ok,1},NodeResults10),
- ?l lists:foreach(fun(N)->P=rpc:call(N,erlang,whereis,[inviso_rt_meta]),
- {meta,P}=rpc:call(N,erlang,trace_info,[{?MODULE,failing_function,1},meta])
- end,
- Nodes),
- ?l lists:foreach(fun(N)->rpc:call(N,?MODULE,failing_function,[nofailure]) end,Nodes),
- ?l ok=poll(ets,lookup,[inviso_sideeffect_tab,tpm_call_func1],[{tpm_call_func1,1}],20),
- ?l ok=poll(ets,lookup,[inviso_sideeffect_tab,tpm_return_func1],[{tpm_return_func1,1}],20),
- ?l lists:foreach(fun(N)->rpc:call(N,?MODULE,failing_function,[failure]) end,Nodes),
- ?l ok=poll(ets,lookup,[inviso_sideeffect_tab,tpm_call_func1],[{tpm_call_func1,2}],20),
- ?l ok=poll(ets,lookup,[inviso_sideeffect_tab,tpm_return_func1],[{tpm_return_func1,3}],20),
-
- ok.
-%% ------------------------------------------------------------------------------
-
-%% This function is for testing that appending the tracer to a trace action term
-%% works.
-activate_deactivate_meta_tracing_tracer(Nodes) ->
- ?l {ok,NodeResults}=
- inviso:tpm_tracer(Nodes,lists,module_info,0,[{'_',[],[{trace,[all],[call]}]}],void),
- ?l true=check_noderesults(Nodes,{ok,1},NodeResults),
- ?l lists:foreach(fun(N)->P=rpc:call(N,erlang,whereis,[inviso_rt_meta]),
- {meta,P}=rpc:call(N,erlang,trace_info,[{lists,module_info,0},meta]),
- {meta_match_spec,[{'_',[],[{trace,[all],Enable}]}]}=
- rpc:call(N,erlang,trace_info,[{lists,module_info,0},
- meta_match_spec]),
- true=list_search(Enable,fun({{tracer,P}}) when is_port(P)->true;
- (_) -> false
- end)
- end,
- Nodes),
- ?l {ok,NodeResults2}=
- inviso:ctpm(Nodes,lists,module_info,0),
- ?l true=check_noderesults(Nodes,ok,NodeResults2),
- ?l lists:foreach(fun(N)->{meta,false}=
- rpc:call(N,erlang,trace_info,[{lists,module_info,0},meta])
- end,
- Nodes),
- ok.
-%% ------------------------------------------------------------------------------
-
-deactivate_meta_tracing(Nodes) ->
- ?l lists:foreach(fun(N)->{meta,P}=
- rpc:call(N,erlang,trace_info,[{erlang,register,2},meta]),
- true=is_pid(P)
- end,
- Nodes),
- ?l lists:foreach(fun(N)->{meta,P}=
- rpc:call(N,erlang,trace_info,[{erlang,unregister,1},meta]),
- true=is_pid(P)
- end,
- Nodes),
- ?l {ok,NodeResults1}=inviso:ctpm_localnames(),
- ?l lists:foreach(fun(N)->{meta,false}=
- rpc:call(N,erlang,trace_info,[{erlang,register,2},meta]) end,
- Nodes),
- ?l lists:foreach(fun(N)->{meta,false}=
- rpc:call(N,erlang,trace_info,[{erlang,unregister,1},meta])
- end,
- Nodes),
- ?l true=check_noderesults(Nodes,{ok,ok},NodeResults1),
-
- ?l lists:foreach(fun(N)->P=rpc:call(N,erlang,whereis,[inviso_rt_meta]),
- {meta,P}=rpc:call(N,
- erlang,
- trace_info,
- [{global,handle_call,3},meta])
- end,
- Nodes),
- ?l lists:foreach(fun(N)->P=rpc:call(N,erlang,whereis,[inviso_rt_meta]),
- {meta,P}=rpc:call(N,
- erlang,
- trace_info,
- [{global,delete_global_name,2},meta])
- end,
- Nodes),
- ?l {ok,NodeResults1b}=inviso:ctpm_globalnames(),
- ?l true=check_noderesults(Nodes,{ok,ok},NodeResults1b),
- ?l lists:foreach(fun(N)->
- {meta,false}=rpc:call(N,
- erlang,
- trace_info,
- [{global,handle_call,3},meta])
- end,
- Nodes),
- ?l lists:foreach(fun(N)->
- {meta,false}=rpc:call(N,
- erlang,
- trace_info,
- [{global,delete_global_name,2},meta])
- end,
- Nodes),
-
- ?l lists:foreach(fun(N)->{meta,P}=
- rpc:call(N,erlang,trace_info,[{lists,module_info,0},meta]),
- true=is_pid(P)
- end,
- Nodes),
- ?l {ok,NodeResults2}=inviso:ctpm(lists,module_info,0),
- ?l true=check_noderesults(Nodes,ok,NodeResults2),
- ?l lists:foreach(fun(N)->{meta,false}=
- rpc:call(N,erlang,trace_info,[{lists,module_info,0},meta]) end,
- Nodes),
- ?l [{_,0}]=ets:lookup(inviso_sideeffect_tab,tpm_init_func1),
- ?l {ok,NodeResults3}=inviso:ctpm(math,module_info,1),
- ?l true=check_noderesults(Nodes,ok,NodeResults3),
- ok.
-%% ------------------------------------------------------------------------------
-
-%% Functions acting as callbacks for testing the meta tracing mechanisms.
-tpm_init_func1(_M,_F,_Arity,PublLD) ->
- ets:update_counter(inviso_sideeffect_tab,tpm_init_func1,1),
- {ok,PublLD,void}.
-tpm_call_func1(_Pid,{call,_Args,_TS},PublLD) ->
- ets:update_counter(inviso_sideeffect_tab,tpm_call_func1,1),
- {ok,PublLD,void}.
-tpm_return_func1(_Pid,{return_from,_ReturnVal,_TS},PublLD) ->
- ets:update_counter(inviso_sideeffect_tab,tpm_return_func1,1),
- {ok,PublLD,void};
-tpm_return_func1(_Pid,{exception_from,_ReturnVal,_TS},PublLD) ->
- ets:update_counter(inviso_sideeffect_tab,tpm_return_func1,1),
- ets:update_counter(inviso_sideeffect_tab,tpm_return_func1,1),
- {ok,PublLD,void}.
-tpm_remove_func1(_M,_F,_Arity,PublLD) ->
- ets:update_counter(inviso_sideeffect_tab,tpm_init_func1,-1),
- {ok,PublLD}.
-%% ------------------------------------------------------------------------------
-
-
-%% Help function which traces on a function and makes function calls until there
-%% are two files in the wrap-set.
-fill_and_reach_two_wrapfiles(PrivDir,RegExp,Nodes) ->
- ?l lists:foreach(fun(N)->spawn(N,?MODULE,test_proc_init,[]) end,Nodes),
- ?l {ok,NodeResults1}=inviso:tpl(Nodes,?MODULE,test_function,0,[]),
- ?l true=check_noderesults(Nodes,{ok,[1]},NodeResults1),
- ?l {ok,NodeResults2}=inviso:tf(Nodes,inviso_test_proc,[call]),
- ?l true=check_noderesults(Nodes,{ok,[1]},NodeResults2),
- fill_and_reach_two_wrapfiles_2(PrivDir,RegExp,Nodes),
- ?l {ok,NodeResults3}=inviso:ctf(Nodes,inviso_test_proc,[call]),
- ?l true=check_noderesults(Nodes,{ok,[1]},NodeResults3),
- ?l {ok,NodeResults4}=inviso:ctpl(Nodes,?MODULE,test_function,0),
- ?l true=check_noderesults(Nodes,{ok,[1]},NodeResults4),
- ok.
-
-fill_and_reach_two_wrapfiles_2(PrivDir,RegExp,[Node|Rest]) ->
- ?l ok=rpc:call(Node,?MODULE,fill_and_reach_two_wrapfiles_3,[PrivDir,RegExp]),
- fill_and_reach_two_wrapfiles_2(PrivDir,RegExp,Rest);
-fill_and_reach_two_wrapfiles_2(_,_,[]) ->
- ok.
-
-fill_and_reach_two_wrapfiles_3(Dir,RegExp) ->
- ok=send_to_test_proc({apply,?MODULE,test_function,[]},
- fun reach_two_wraps_stopfun/1,
- {Dir,RegExp++atom_to_list(node())},
- 100).
-
-%% Help function intended to be used as fun in a send_to_test_proc/4 call.
-%% The function lists the content of Dir and looks for occurancies of String.
-%% If two files containing the string String are found, 'done' is returned.
-%% Otherwise 'continue'.
-reach_two_wraps_stopfun({Dir,RegExp}) ->
- case file:list_dir(Dir) of
- {ok,FileNames} ->
- case how_many_files_regexp(FileNames,RegExp,0) of
- {ok,2} ->
- done;
- _ ->
- continue
- end;
- {error,_Reason} ->
- error
- end.
-%% ------------------------------------------------------------------------------
-
-%% ------------------------------------------------------------------------------
-%% Help function for the overload tests. These functions are used as callbacks.
-%% ------------------------------------------------------------------------------
-
-overload1(_) ->
- ets:update_counter(inviso_sideeffect_tab,ovl1,1),
- ok.
-%% This function is used when timeout occurs inside the runtime component.
-%% That is it is time to check for overload.
-overload2({timeout,overload2i_data}) ->
- ets:update_counter(inviso_sideeffect_tab,ovl2,1),
- ok.
-overload2i() ->
- ets:insert(inviso_sideeffect_tab,{ovl2,0}),
- {ok,overload2i_data}.
-overload2r(overload2i_data) ->
- ets:delete(inviso_sideeffect_tab,ovl2).
-
-%% This function is used when timeout occurs inside the runtime component.
-%% That is it is time to check for overload.
-overload3({timeout,overload3i_data}) ->
- ets:update_counter(inviso_sideeffect_tab,ovl3,1),
- ok;
-overload3(_) -> % Must handle garbage too.
- ignore.
-overload3i() ->
- ets:insert(inviso_sideeffect_tab,{ovl3,0}),
- {ok,overload3i_data}.
-overload3r(overload3i_data) ->
- ets:insert(inviso_sideeffect_tab,{ovl3r,done}),
- ets:delete(inviso_sideeffect_tab,ovl3).
-
-overload4(_) ->
- case ets:lookup(inviso_sideeffect_tab,ovl4_suspend) of
- [] -> % We are supposed to be running.
- ets:update_counter(inviso_sideeffect_tab,ovl4,1),
- ok;
- [_] ->
- {suspend,test}
- end.
-
-%% This function is used when overload check is done by icomming message.
-overload5({msg,{test_of_loadcheck,overload5i_data}}) ->
- ets:update_counter(inviso_sideeffect_tab,ovl5,1),
- ok;
-overload5(_) ->
- ignore.
-overload5i() ->
- ets:insert(inviso_sideeffect_tab,{ovl5,0}),
- {ok,overload5i_data}.
-overload5r(overload5i_data) ->
- ets:delete(inviso_sideeffect_tab,ovl5),
- ets:insert(inviso_sideeffect_tab,{ovl5r,done});
-overload5r(X) ->
- erlang:display({'***',overload5r,X}).
-
-overload6(_) ->
- ets:update_counter(inviso_sideeffect_tab,ovl6,1),
- ok.
-%% ------------------------------------------------------------------------------
-
-%% ------------------------------------------------------------------------------
-%% Help function for the subscription tests. These function implements a collector
-%% process which will subscribe to inviso_events from the control component.
-%% ------------------------------------------------------------------------------
-
-%% Function which can be used to check if an inviso_event has arrived. The function
-%% takes a fun which tests the messages.
-check_msg_collector([],_,_) ->
- true;
-check_msg_collector(_,_,0) ->
- false;
-check_msg_collector(Nodes,Fun,T) ->
- Ref=make_ref(),
- inviso_collector_proc ! {fetch_message,self(),Ref,Fun},
- receive
- {inviso,Ref,{true,Node}} ->
- check_msg_collector(lists:delete(Node,Nodes),Fun,T-1);
- {inviso,Ref,false} ->
- timer:sleep(100),
- check_msg_collector(Nodes,Fun,T-1)
- end.
-
-%% Spawn on this function to get a subscriber.
-inviso_msg_collector() ->
- register(inviso_collector_proc,self()),
- inviso_msg_collector_loop([]).
-
-inviso_msg_collector_loop(Msgs) ->
- receive
- {fetch_message,From,Ref,Fun} ->
- {NewMsgs,Reply}=inviso_msg_collector_selector(Msgs,Fun,[]),
- From ! {inviso,Ref,Reply},
- inviso_msg_collector_loop(NewMsgs);
- Msg ->
- inviso_msg_collector_loop([Msg|Msgs])
- end.
-
-inviso_msg_collector_selector([M|Rest],Fun,Accum) ->
- case Fun(M) of
- {true,X} ->
- {Rest++Accum,{true,X}};
- _ ->
- inviso_msg_collector_selector(Rest,Fun,[M|Accum])
- end;
-inviso_msg_collector_selector([],_,Accum) ->
- {Accum,false}.
-%% ------------------------------------------------------------------------------
-
-
-%% ==============================================================================
-%% Help functions
-%% ==============================================================================
-
-list_search([E|Rest],Fun) ->
- case Fun(E) of
- true ->
- true;
- false ->
- list_search(Rest,Fun)
- end;
-list_search([],_Fun) ->
- false.
-%% ------------------------------------------------------------------------------
-
-%% Help function checking that there is a Result for each node in Nodes.
-%% Returns 'true' if successful.
-check_noderesults(Nodes,Fun,[{Node,Result}|Rest]) when is_function(Fun) ->
- case Fun({Node,Result}) of
- true ->
- case lists:member(Node,Nodes) of
- true ->
- check_noderesults(lists:delete(Node,Nodes),Fun,Rest);
- false -> % Not good.
- unknown_node_in_returnvalue
- end;
- _ ->
- illegal_result
- end;
-check_noderesults(Nodes,Result,[{Node,Result}|Rest]) ->
- case lists:member(Node,Nodes) of
- true ->
- check_noderesults(lists:delete(Node,Nodes),Result,Rest);
- false -> % Not good.
- unknown_node_in_returnvalue
- end;
-check_noderesults([],_,[]) ->
- true;
-check_noderesults(X,Y,Z) ->
- io:format("Bad arguments to check noderesults:~w~n~w~n~w~n",[X,Y,Z]),
- false.
-%% ------------------------------------------------------------------------------
-
-%% Help function doing rpc on all nodes in Nodes calling M:F. Returns 'true' if
-%% successful.
-check_on_nodes([Node|Rest],M,F,Args,Result) when Node==node() ->
- if
- is_function(Result) ->
- ?l true=Result(apply(M,F,Args));
- true ->
- ?l Result=apply(M,F,Args)
- end,
- check_on_nodes(Rest,M,F,Args,Result);
-check_on_nodes([Node|Rest],M,F,Args,Result) ->
- if
- is_function(Result) ->
- ?l true=Result(rpc:call(Node,M,F,Args));
- true ->
- ?l Result=rpc:call(Node,M,F,Args)
- end,
- check_on_nodes(Rest,M,F,Args,Result);
-check_on_nodes([],_,_,_,_) ->
- true.
-%% ------------------------------------------------------------------------------
-
-%% Help function which given a list of files searches through it and returns
-%% how many satisfies the RegExp.
-%% Returns {ok,N}.
-how_many_files_regexp([],_,N) ->
- {ok,N};
-how_many_files_regexp([FName|Rest],RegExp,N) ->
- case re:run(FName,RegExp,[{capture,none}]) of
- match ->
- how_many_files_regexp(Rest,RegExp,N+1);
- nomatch ->
- how_many_files_regexp(Rest,RegExp,N);
- {error,Reason} ->
- test_server:fail(Reason)
- end.
-%% ------------------------------------------------------------------------------
-
-%% Help function killing a bunch of registered processes.
-process_killer([RegName|Rest]) ->
- case whereis(RegName) of
- undefined ->
- case global:whereis_name(RegName) of
- undefined ->
- process_killer(Rest);
- P when is_pid(P) ->
- if
- node()==node(P) ->
- exit(P,kill);
- true ->
- true
- end,
- process_killer(Rest)
- end;
- P when is_pid(P) ->
- exit(P,kill),
- process_killer(Rest)
- end;
-process_killer([]) ->
- true.
-%% ------------------------------------------------------------------------------
-
-%% Help function which waits for a function call to become Result. This is useful
-%% if what we are waiting for can happend independantly of indications we have
-%% access to.
-poll(_,_,_,_,0) ->
- error;
-poll(M,F,Args,Result,Times) ->
- try apply(M,F,Args) of
- What when is_function(Result) ->
- case Result(What) of
- true ->
- ok;
- _ ->
- timer:sleep(100),
- poll(M,F,Args,Result,Times-1)
- end;
- Result ->
- ok;
- _ ->
- timer:sleep(100),
- poll(M,F,Args,Result,Times-1)
- catch
- error:Reason ->
- io:format("Apply in suite-function poll/5 failed, ~w~n",[Reason]),
- timer:sleep(100),
- poll(M,F,Args,Result,Times-1)
- end.
-%% ------------------------------------------------------------------------------
-
-insert_remotenode_config(Name,Node,Config) ->
- [{remotenode,{Name,Node}}|Config].
-%% ------------------------------------------------------------------------------
-
-insert_timetraphandle_config(Handle,Config) ->
- [{timetraphandle,Handle}|Config].
-%% ------------------------------------------------------------------------------
-
-get_remotenode_config(Name, [{remotenode, {Name, Node}}| _Cs]) ->
- Node;
-get_remotenode_config(Name, [_ | Cs]) ->
- get_remotenode_config(Name, Cs);
-get_remotenode_config(Name, []) ->
- exit({no_remotenode, Name}).
-
-%% ------------------------------------------------------------------------------
-
-get_timetraphandle_config(Config) ->
- {value,{_,Handle}}=lists:keysearch(timetraphandle,1,Config),
- Handle.
-%% ------------------------------------------------------------------------------
-
-get_remotenodes_config([{remotenode,{_Name,Node}}|Config]) ->
- [Node|get_remotenodes_config(Config)];
-get_remotenodes_config([_|Config]) ->
- get_remotenodes_config(Config);
-get_remotenodes_config([]) ->
- [].
-%% ------------------------------------------------------------------------------
-
-remove_remotenode_config(Name, [{remotenode, {Name, _}} | Cs]) ->
- Cs;
-remove_remotenode_config(Name, [C | Cs]) ->
- [C | remove_remotenode_config(Name, Cs)];
-remove_remotenode_config(_Name, []) ->
- [].
-
-%% ------------------------------------------------------------------------------
-
-remove_timetraphandle_config(Config) ->
- lists:keydelete(timetraphandle,1,Config).
-%% ------------------------------------------------------------------------------
-
-%% This function can be meta traced in order to check that exception_trace works.
-%% Must be exported.
-failing_function(nofailure) ->
- true;
-failing_function(failure) ->
- exit(failure).
-%% ------------------------------------------------------------------------------
-
-%% ==============================================================================
-%% Code for a test process which can be started.
-%% ==============================================================================
-
-test_proc_init() ->
- register(inviso_test_proc,self()),
- test_proc_loop().
-
-test_proc_loop() ->
- receive
- {apply,M,F,Args} ->
- apply(M,F,Args),
- test_proc_loop();
- X ->
- io:format("Got ~w~n",[X]),
- test_proc_loop()
- end.
-
-global_test_proc_init() ->
- global:register_name(global_inviso_test_proc,self()),
- test_proc_loop().
-%% ------------------------------------------------------------------------------
-
-send_to_test_proc(_,_,_,0) ->
- error;
-send_to_test_proc(Msg,Fun,FunArg,N) ->
- inviso_test_proc ! Msg,
- case Fun(FunArg) of
- done ->
- ok;
- error ->
- test_server:fail(send_to_test_proc);
- _ ->
- send_to_test_proc(Msg,Fun,FunArg,N-1)
- end.
-%% ------------------------------------------------------------------------------
-
-
-%% This function is here to be traced on by the inviso_test_proc. Must be exported.
-test_function() ->
- 1+1.
-%% ------------------------------------------------------------------------------
-
-
-%% ==============================================================================
-%% Code for a test side effect table process.
-%% ==============================================================================
-
-%% The side effect logger is a process owning a public ETS table. The idea is that
-%% various callback functions can write in the table when called. In that way
-%% correct calling of the call-backs can be verified.
-start_side_effect_logger(Node) ->
- ?l true=is_pid(spawn(Node,?MODULE,side_effect_logger_proc,[])),
- ?l ok=poll(rpc,call,[Node,ets,lookup,[inviso_sideeffect_tab,foo]],[],20).
-
-%% This one must be exported.
-side_effect_logger_proc() ->
- register(inviso_tab_proc,self()), % So we can kill it later.
- ets:new(inviso_sideeffect_tab,[public,named_table]),
- side_effect_logger_proc_2().
-
-side_effect_logger_proc_2() ->
- receive
- _X -> % This process is not expecting anything!
- side_effect_logger_proc_2()
- end.
-%% ------------------------------------------------------------------------------
diff --git a/lib/runtime_tools/test/inviso_testmodule1_foo.erl b/lib/runtime_tools/test/inviso_testmodule1_foo.erl
deleted file mode 100644
index a7a22cad39..0000000000
--- a/lib/runtime_tools/test/inviso_testmodule1_foo.erl
+++ /dev/null
@@ -1,9 +0,0 @@
--module(inviso_testmodule1_foo).
-
--compile(export_all).
-
-%% The purpose of this module is simply to have a module that is
-%% guaranteed not loaded.
-
-foo() ->
- true.
diff --git a/lib/runtime_tools/test/runtime_tools_SUITE.erl b/lib/runtime_tools/test/runtime_tools_SUITE.erl
index b26f3dd881..62497ab527 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -25,7 +25,7 @@
-export([init_per_testcase/2, end_per_testcase/2]).
%% Test cases
--export([app_file/1]).
+-export([app_file/1, start_stop_app/1]).
%% Default timetrap timeout (set in init_per_testcase)
-define(default_timeout, ?t:minutes(1)).
@@ -42,7 +42,8 @@ end_per_testcase(_Case, Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [app_file].
+ [app_file,
+ start_stop_app].
groups() ->
[].
@@ -60,10 +61,14 @@ end_per_group(_GroupName, Config) ->
Config.
-app_file(suite) ->
- [];
-app_file(doc) ->
- ["Testing .app file"];
-app_file(Config) when is_list(Config) ->
+app_file(_Config) ->
?line ok = ?t:app_test(runtime_tools),
ok.
+
+start_stop_app(_Config) ->
+ ok = application:start(runtime_tools),
+ Sup = whereis(runtime_tools_sup),
+ true = is_pid(Sup),
+ Ref = erlang:monitor(process,Sup),
+ ok = application:stop(runtime_tools),
+ receive {'DOWN', Ref, process, Sup, shutdown} -> ok end.
diff --git a/lib/runtime_tools/vsn.mk b/lib/runtime_tools/vsn.mk
index 3fbc1b3379..534c7508d8 100644
--- a/lib/runtime_tools/vsn.mk
+++ b/lib/runtime_tools/vsn.mk
@@ -1 +1 @@
-RUNTIME_TOOLS_VSN = 1.8.7
+RUNTIME_TOOLS_VSN = 1.8.9
diff --git a/lib/sasl/doc/src/Makefile b/lib/sasl/doc/src/Makefile
index eb880ccb78..b0ec671adc 100644
--- a/lib/sasl/doc/src/Makefile
+++ b/lib/sasl/doc/src/Makefile
@@ -116,18 +116,18 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man4
- $(INSTALL_DATA) $(MAN4_FILES) $(RELEASE_PATH)/man/man4
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man6
- $(INSTALL_DATA) $(MAN6_FILES) $(RELEASE_PATH)/man/man6
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man4"
+ $(INSTALL_DATA) $(MAN4_FILES) "$(RELEASE_PATH)/man/man4"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man6"
+ $(INSTALL_DATA) $(MAN6_FILES) "$(RELEASE_PATH)/man/man6"
release_spec:
diff --git a/lib/sasl/doc/src/appup.xml b/lib/sasl/doc/src/appup.xml
index 770b7c2492..bacfaa76ef 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>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -56,12 +56,20 @@
the application.</p>
</item>
<item>
- <p><c>UpFromVsn = string()</c> is an earlier version of
- the application to upgrade from.</p>
+ <p><c>UpFromVsn = string() | binary()</c> is an earlier
+ version of the application to upgrade from. If it is a
+ string, it will be interpreted as a specific version
+ number. If it is a binary, it will be interpreted as a
+ regular expression which can match multiple version
+ numbers.</p>
</item>
<item>
- <p><c>DownToVsn = string()</c> is an earlier version of
- the application to downgrade to.</p>
+ <p><c>DownToVsn = string() | binary()</c> is an earlier
+ version of the application to downgrade to. If it is a
+ string, it will be interpreted as a specific version
+ number. If it is a binary, it will be interpreted as a
+ regular expression which can match multiple version
+ numbers.</p>
</item>
<item>
<p><c>Instructions</c> is a list of <em>release upgrade instructions</em>, see below. It is recommended to use
@@ -70,6 +78,12 @@
creating the <c>relup</c> file.</p>
</item>
</list>
+ <p>In order to avoid duplication of upgrade instructions it is
+ allowed to use regular expressions to specify the <c>UpFromVsn</c>
+ and <c>DownToVsn</c>. To be considered a regular expression, the
+ version identifier must be specified as a binary, e.g.</p>
+ <code type="none">&lt;&lt;"2\\.1\\.[0-9]+">></code>
+ <p>will match all versions <c>2.1.x</c>, where x is any number.</p>
</section>
<section>
diff --git a/lib/sasl/doc/src/notes.xml b/lib/sasl/doc/src/notes.xml
index 2f22a8ec43..1333e375b1 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,6 +30,102 @@
</header>
<p>This document describes the changes made to the SASL application.</p>
+<section><title>SASL 2.2.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ If sys.config existed, but was not readable or parseable,
+ this would not be detected until after the upgrade and at
+ the next node restart. The possibility for this to happen
+ is now reduced by adding a check to systools:make_tar
+ which fails the creation of the tar file if sys.config or
+ relup does not have reasonable contents. Note that there
+ are no detailed checks, only parsing and erlang term
+ format check.</p>
+ <p>
+ Own Id: OTP-9539</p>
+ </item>
+ <item>
+ <p>
+ systools:make_script would allow {kernel,Vsn,load} in the
+ .rel file, causing a .boot file which only loaded kernel
+ and did not start it. This has been corrected. Only start
+ type 'permanent', which is the default, is now allowed
+ for kernel and stdlib.</p>
+ <p>
+ Own Id: OTP-9652</p>
+ </item>
+ <item>
+ <p>
+ release_handler:remove_release/1 now handles symlinked
+ files properly</p>
+ <p>
+ Own Id: OTP-9864</p>
+ </item>
+ <item>
+ <p>
+ If stdlib was stated with a start type different from
+ <c>permanent</c> in a .rel file, systools would
+ incorrectly say that sasl had faulty start type. This has
+ been corrected.</p>
+ <p>
+ Own Id: OTP-9888</p>
+ </item>
+ <item>
+ <p>
+ Sasl documentation earlier said that the InclApps
+ parameters in a .rel file defaults to the empty list.
+ This is not correct. It defaults to the same value as
+ specified in the .app file. This has been corrected.</p>
+ <p>
+ Own Id: OTP-9980</p>
+ </item>
+ <item>
+ <p>
+ Applications that are listed in
+ <c>{applications,Apps}</c> in the .app file were not
+ sorted correctly by <c>systools:make_script/1,2</c>. They
+ got the reverse order of how they were listed in the .app
+ file. This is corrected so they are now sorted
+ (internally between each other) in the same order as they
+ are listed in the .rel file (i.e. the order they are
+ listed in the .app file does no longer matter).</p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>
+ Own Id: OTP-9984</p>
+ </item>
+ <item>
+ <p>
+ Documentation of .appup files now also states that
+ <c>UpFromVsn</c> and <c>DownToVsn</c> can be specified as
+ regular expressions in order to avoid duplicated upgrade
+ instructions.</p>
+ <p>
+ Own Id: OTP-10001</p>
+ </item>
+ <item>
+ <p>
+ Reltool would sometimes generate a .app file containing
+ <c>{start_phases,undefined}</c>, which would cause an
+ exception in systools at parse time. This has been
+ corrected so reltool now omits the <c>start_phases</c>
+ entry if the value is <c>undefined</c>. (Thanks to Juan
+ Jose Comellas)</p>
+ <p>
+ In order to align with reltool, sasl will also omit
+ <c>start_phases</c> entries with value <c>undefined</c>
+ in .script files.</p>
+ <p>
+ Own Id: OTP-10003</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>SASL 2.2</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/sasl/doc/src/rel.xml b/lib/sasl/doc/src/rel.xml
index 470adf3c03..68ef90330f 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>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -88,7 +88,7 @@
<p>The list must be a subset of the included applications
specified in the application resource file
(<c>Application.app</c>) and overrides this value. Defaults
- to the empty list.</p>
+ to the same value as in the application resource file.</p>
</item>
</list>
<note>
diff --git a/lib/sasl/examples/src/Makefile b/lib/sasl/examples/src/Makefile
index 9cf0d4c25d..c0d73aab1d 100644
--- a/lib/sasl/examples/src/Makefile
+++ b/lib/sasl/examples/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2011. All Rights Reserved.
+# Copyright Ericsson AB 2010-2012. 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
@@ -63,10 +63,10 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/examples/src
- $(INSTALL_DIR) $(RELSYSDIR)/examples/ebin
- (cd ..; tar cf - src ebin | (cd $(RELSYSDIR)/examples; tar xf -))
- chmod -R ug+w $(RELSYSDIR)/examples
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/ebin"
+ (cd ..; tar cf - src ebin | (cd "$(RELSYSDIR)/examples"; tar xf -))
+ chmod -R ug+w "$(RELSYSDIR)/examples"
release_docs_spec:
diff --git a/lib/sasl/src/Makefile b/lib/sasl/src/Makefile
index 9a5d1e42d9..de0c45e6ae 100644
--- a/lib/sasl/src/Makefile
+++ b/lib/sasl/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -91,10 +91,10 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/sasl/src/release_handler.erl b/lib/sasl/src/release_handler.erl
index 522c7b496b..5efd932c92 100644
--- a/lib/sasl/src/release_handler.erl
+++ b/lib/sasl/src/release_handler.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -1572,7 +1572,7 @@ memlib(_Lib, []) -> false.
%% recursively remove file or directory
remove_file(File) ->
- case file:read_file_info(File) of
+ case file:read_link_info(File) of
{ok, Info} when Info#file_info.type==directory ->
case file:list_dir(File) of
{ok, Files} ->
diff --git a/lib/sasl/src/systools.hrl b/lib/sasl/src/systools.hrl
index 9a3e98221c..da531dbee5 100644
--- a/lib/sasl/src/systools.hrl
+++ b/lib/sasl/src/systools.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -60,7 +60,8 @@
%% integer() | infinity.
mod = [], %% [] | {Mod, StartArgs}, Mod= atom(),
%% StartArgs = list().
- start_phases = [], %% [] | {Phase, PhaseArgs}, Phase = atom(),
+ start_phases, %% [{Phase, PhaseArgs}] | undefined,
+ %% Phase = atom(),
%% PhaseArgs = list().
dir = "" %% The directory where the .app file was
%% found (internal use).
diff --git a/lib/sasl/src/systools_make.erl b/lib/sasl/src/systools_make.erl
index 12ba2a5476..e8b28998c1 100644
--- a/lib/sasl/src/systools_make.erl
+++ b/lib/sasl/src/systools_make.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -375,7 +375,7 @@ get_release1(File, Path, ModTestP, Machine) ->
{ok, Release, Warnings1} = read_release(File, Path),
{ok, Appls0} = collect_applications(Release, Path),
{ok, Appls1} = check_applications(Appls0),
- {ok, Appls2} = sort_included_applications(Appls1, Release), % OTP-4121
+ {ok, Appls2} = sort_used_and_incl_appls(Appls1, Release), % OTP-4121, OTP-9984
{ok, Warnings2} = check_modules(Appls2, Path, ModTestP, Machine),
{ok, Appls} = sort_appls(Appls2),
{ok, Release, Appls, Warnings1 ++ Warnings2}.
@@ -482,7 +482,7 @@ mandatory_applications([_|Apps],Kernel,Stdlib,Sasl) ->
mandatory_applications([],Type,_,_) when Type=/=permanent ->
error_mandatory_application(kernel,Type);
mandatory_applications([],_,Type,_) when Type=/=permanent ->
- error_mandatory_application(sasl,Type);
+ error_mandatory_application(stdlib,Type);
mandatory_applications([],_,_,undefined) ->
{ok, [{warning,missing_sasl}]};
mandatory_applications([],_,_,_) ->
@@ -673,7 +673,7 @@ check_item({_,{registered,Regs}},I) ->
_ -> throw({bad_param, I})
end;
check_item({_,{modules,Mods}},I) ->
- case mod_list_p(Mods) of
+ case a_list_p(Mods) of
true -> Mods;
_ -> throw({bad_param, I})
end;
@@ -842,34 +842,45 @@ undefined_applications(Appls) ->
filter(fun(X) -> not member(X, Defined) end, Uses).
%%______________________________________________________________________
-%% sort_included_applications(Applications, Release) -> Applications
+%% sort_used_and_incl_appls(Applications, Release) -> Applications
%% Applications = [{{Name,Vsn},#application}]
%% Release = #release{}
%%
-%% Check that included applications are given in the same order as in
-%% the release resource file (.rel). Otherwise load instructions in
-%% the boot script, and consequently release upgrade instructions in
-%% relup, may end up in the wrong order.
+%% OTP-4121, OTP-9984
+%% Check that used and included applications are given in the same
+%% order as in the release resource file (.rel). Otherwise load and
+%% start instructions in the boot script, and consequently release
+%% upgrade instructions in relup, may end up in the wrong order.
-sort_included_applications(Applications, Release) when is_tuple(Release) ->
+sort_used_and_incl_appls(Applications, Release) when is_tuple(Release) ->
{ok,
- sort_included_applications(Applications, Release#release.applications)};
-
-sort_included_applications([{Tuple,Appl}|Appls], OrderedAppls) ->
- case Appl#application.includes of
- Incls when length(Incls)>1 ->
- IndexedIncls = find_pos(Incls, OrderedAppls),
- SortedIndexedIncls = lists:keysort(1, IndexedIncls),
- Incls2 = lists:map(fun({_Index,Name}) -> Name end,
- SortedIndexedIncls),
- Appl2 = Appl#application{includes=Incls2},
- [{Tuple,Appl2}|sort_included_applications(Appls, OrderedAppls)];
- _Incls ->
- [{Tuple,Appl}|sort_included_applications(Appls, OrderedAppls)]
- end;
-sort_included_applications([], _OrderedAppls) ->
+ sort_used_and_incl_appls(Applications, Release#release.applications)};
+
+sort_used_and_incl_appls([{Tuple,Appl}|Appls], OrderedAppls) ->
+ Incls2 =
+ case Appl#application.includes of
+ Incls when length(Incls)>1 ->
+ sort_appl_list(Incls, OrderedAppls);
+ Incls ->
+ Incls
+ end,
+ Uses2 =
+ case Appl#application.uses of
+ Uses when length(Uses)>1 ->
+ sort_appl_list(Uses, OrderedAppls);
+ Uses ->
+ Uses
+ end,
+ Appl2 = Appl#application{includes=Incls2, uses=Uses2},
+ [{Tuple,Appl2}|sort_used_and_incl_appls(Appls, OrderedAppls)];
+sort_used_and_incl_appls([], _OrderedAppls) ->
[].
+sort_appl_list(List, Order) ->
+ IndexedList = find_pos(List, Order),
+ SortedIndexedList = lists:keysort(1, IndexedList),
+ lists:map(fun({_Index,Name}) -> Name end, SortedIndexedList).
+
find_pos([Name|Incs], OrderedAppls) ->
[find_pos(1, Name, OrderedAppls)|find_pos(Incs, OrderedAppls)];
find_pos([], _OrderedAppls) ->
@@ -889,11 +900,10 @@ find_pos(N, Name, [_OtherAppl|OrderedAppls]) ->
check_modules(Appls, Path, TestP, Machine) ->
%% first check that all the module names are unique
- %% Make a list M1 = [{Mod,Vsn,App,AppVsn,Dir}]
- %% where Vsn = '$$ignore$$' | Specified
- M1 = [{Mod,Vsn,App,Appv,A#application.dir} ||
- {{App,Appv},A} <- Appls,
- {Mod,Vsn} <- get_mod_vsn(A#application.modules)],
+ %% Make a list M1 = [{Mod,App,Dir}]
+ M1 = [{Mod,App,A#application.dir} ||
+ {{App,_Appv},A} <- Appls,
+ Mod <- A#application.modules],
case duplicates(M1) of
[] ->
case check_mods(M1, Appls, Path, TestP, Machine) of
@@ -907,16 +917,8 @@ check_modules(Appls, Path, TestP, Machine) ->
throw({error, {duplicate_modules, Dups}})
end.
-get_mod_vsn([{Mod,Vsn}|Mods]) ->
- [{Mod,Vsn}|get_mod_vsn(Mods)];
-get_mod_vsn([Mod|Mods]) ->
- [{Mod,'$$ignore$$'}|get_mod_vsn(Mods)];
-get_mod_vsn([]) ->
- [].
-
%%______________________________________________________________________
-%% Check that all modules exists and that the specified version
-%% corresponds to the version in the module's source code.
+%% Check that all modules exists.
%% Use the module extension of the running machine as extension for
%% the checked modules.
@@ -941,7 +943,7 @@ check_src(Modules, Appls, Path, true, Machine) ->
Ext = objfile_extension(Machine),
IncPath = create_include_path(Appls, Path),
append(map(fun(ModT) ->
- {Mod,_Vsn,App,_,Dir} = ModT,
+ {Mod,App,Dir} = ModT,
case check_mod(Mod,App,Dir,Ext,IncPath) of
ok ->
[];
@@ -1253,7 +1255,8 @@ sort_appls(Appls) -> {ok, sort_appls(Appls, [], [], [])}.
sort_appls([{N, A}|T], Missing, Circular, Visited) ->
{Name,_Vsn} = N,
- {Uses, T1, NotFnd1} = find_all(Name, A#application.uses, T, Visited, [], []),
+ {Uses, T1, NotFnd1} = find_all(Name, lists:reverse(A#application.uses),
+ T, Visited, [], []),
{Incs, T2, NotFnd2} = find_all(Name, lists:reverse(A#application.includes),
T1, Visited, [], []),
Missing1 = NotFnd1 ++ NotFnd2 ++ Missing,
@@ -1409,10 +1412,7 @@ create_mandatory_path(Appls, PathFlag, Variables) ->
%% Load all modules, except those in Mandatory_modules.
load_appl_mods([{{Name,Vsn},A}|Appls], Mand, PathFlag, Variables) ->
- Mods = map(fun({Mod,_}) -> Mod;
- (Mod) -> Mod
- end,
- A#application.modules),
+ Mods = A#application.modules,
load_commands(filter(fun(Mod) -> not member(Mod, Mand) end, Mods),
cr_path(Name, Vsn, A, PathFlag, Variables)) ++
load_appl_mods(Appls, Mand, PathFlag, Variables);
@@ -1456,15 +1456,18 @@ pack_app(#application{name=Name,vsn=V,id=Id,description=D,modules=M,
{applications, App},
{included_applications, Incs},
{env, Env},
- {start_phases, SF},
{maxT, MaxT},
{maxP, MaxP} |
- behave(Mod)]}.
-
+ behave([{start_phases,SF},{mod,Mod}])]}.
+
+behave([{mod,[]}|T]) ->
+ behave(T);
+behave([{start_phases,undefined}|T]) ->
+ behave(T);
+behave([H|T]) ->
+ [H|behave(T)];
behave([]) ->
- [];
-behave(Mod) ->
- [{mod, Mod}].
+ [].
%%______________________________________________________________________
%% mandatory modules; this modules must be loaded before processes
@@ -1769,9 +1772,7 @@ add_appl(Name, Vsn, App, Tar, Variables, Flags, Var) ->
add_to_tar(Tar,
filename:join(AppDir, Name ++ ".app"),
filename:join(BinDir, Name ++ ".app")),
- add_modules(map(fun({Mod,_}) -> to_list(Mod);
- (Mod) -> to_list(Mod)
- end,
+ add_modules(map(fun(Mod) -> to_list(Mod) end,
App#application.modules),
Tar,
AppDir,
@@ -2011,14 +2012,6 @@ t_list_p([{A,_}|T]) when is_atom(A) -> t_list_p(T);
t_list_p([]) -> true;
t_list_p(_) -> false.
-% check if a term is a list of atoms or two-tuples with the first
-% element as an atom.
-
-mod_list_p([{A,_}|T]) when is_atom(A) -> mod_list_p(T);
-mod_list_p([A|T]) when is_atom(A) -> mod_list_p(T);
-mod_list_p([]) -> true;
-mod_list_p(_) -> false.
-
% check if a term is a list of atoms.
a_list_p([A|T]) when is_atom(A) -> a_list_p(T);
diff --git a/lib/sasl/src/systools_rc.erl b/lib/sasl/src/systools_rc.erl
index c16f6aa845..cf5cca7cb3 100644
--- a/lib/sasl/src/systools_rc.erl
+++ b/lib/sasl/src/systools_rc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -326,8 +326,7 @@ translate_application_instrs(Script, Appls, PreAppls) ->
fun({add_application, Appl, Type}) ->
case lists:keysearch(Appl, #application.name, Appls) of
{value, Application} ->
- Mods =
- remove_vsn(Application#application.modules),
+ Mods = Application#application.modules,
ApplyL = case Type of
none -> [];
load -> [{apply, {application, load, [Appl]}}];
@@ -349,9 +348,11 @@ translate_application_instrs(Script, Appls, PreAppls) ->
end,
case lists:keysearch(Appl, #application.name, PreAppls) of
{value, RemApplication} ->
- Mods = remove_vsn(RemApplication#application.modules),
+ Mods = RemApplication#application.modules,
+
[{apply, {application, stop, [Appl]}}] ++
- [{remove, {M, brutal_purge, brutal_purge}} || M <- Mods] ++
+ [{remove, {M, brutal_purge, brutal_purge}}
+ || M <- Mods] ++
[{purge, Mods},
{apply, {application, unload, [Appl]}}];
false ->
@@ -360,16 +361,14 @@ translate_application_instrs(Script, Appls, PreAppls) ->
({restart_application, Appl}) ->
case lists:keysearch(Appl, #application.name, PreAppls) of
{value, PreApplication} ->
- PreMods =
- remove_vsn(PreApplication#application.modules),
-
+ PreMods = PreApplication#application.modules,
case lists:keysearch(Appl, #application.name, Appls) of
{value, PostApplication} ->
- PostMods =
- remove_vsn(PostApplication#application.modules),
-
+ PostMods = PostApplication#application.modules,
+
[{apply, {application, stop, [Appl]}}] ++
- [{remove, {M, brutal_purge, brutal_purge}} || M <- PreMods] ++
+ [{remove, {M, brutal_purge, brutal_purge}}
+ || M <- PreMods] ++
[{purge, PreMods}] ++
[{add_module, M, []} || M <- PostMods] ++
[{apply, {application, start,
@@ -385,11 +384,6 @@ translate_application_instrs(Script, Appls, PreAppls) ->
end, Script),
lists:flatten(L).
-remove_vsn(Mods) ->
- lists:map(fun({Mod, _Vsn}) -> Mod;
- (Mod) -> Mod
- end, Mods).
-
%%-----------------------------------------------------------------
%% Translates add_module into load_module (high-level transformation)
%%-----------------------------------------------------------------
@@ -654,15 +648,9 @@ translate_dep_to_low(Mode, Instructions, Appls) ->
end.
get_lib(Mod, [#application{name = Name, vsn = Vsn, modules = Modules} | T]) ->
- %% Module = {Mod, Vsn} | Mod
- case lists:keysearch(Mod, 1, Modules) of
- {value, _} ->
- {Name, Vsn};
- false ->
- case lists:member(Mod, Modules) of
- true -> {Name, Vsn};
- false -> get_lib(Mod, T)
- end
+ case lists:member(Mod, Modules) of
+ true -> {Name, Vsn};
+ false -> get_lib(Mod, T)
end;
get_lib(Mod, []) ->
throw({error, {no_such_module, Mod}}).
diff --git a/lib/sasl/test/Makefile b/lib/sasl/test/Makefile
index 91a8c42484..837abf74d4 100644
--- a/lib/sasl/test/Makefile
+++ b/lib/sasl/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2011. All Rights Reserved.
+# Copyright Ericsson AB 2011-2012. 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
@@ -85,10 +85,10 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) sasl.spec sasl.cover $(EMAKEFILE) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cfh - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) sasl.spec sasl.cover $(EMAKEFILE) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cfh - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/sasl/test/installer.erl b/lib/sasl/test/installer.erl
index 6942ec21ea..709269a73c 100644
--- a/lib/sasl/test/installer.erl
+++ b/lib/sasl/test/installer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -876,7 +876,9 @@ trace_disallowed_calls(Node) ->
MasterProc = self(),
rpc:call(Node,dbg,tracer,[process,{fun(T,_) -> MasterProc ! T end,[]}]),
rpc:call(Node,dbg,p,[all,call]),
- rpc:call(Node,dbg,tp,[file,[{'_',[],[{message,{caller}}]}]]).
+ rpc:call(Node,dbg,tp,[file,[{'_',[],[{message,{caller}}]}]]),
+ %% File:native_name_encoding/0 is a BIF and OK to use
+ rpc:call(Node,dbg,ctp,[file,native_name_encoding,0]).
check_disallowed_calls(TestNode,Line) ->
receive
diff --git a/lib/sasl/test/rb_SUITE.erl b/lib/sasl/test/rb_SUITE.erl
index 35a4eb7e7b..b0e43be3a2 100644
--- a/lib/sasl/test/rb_SUITE.erl
+++ b/lib/sasl/test/rb_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -66,23 +66,31 @@ init_per_group(running_error_logger,Config) ->
restart_sasl(),
Config.
-end_per_group(running_error_logger,Config) ->
+end_per_group(running_error_logger,_Config) ->
%% Remove log_mf_h???
ok.
init_per_testcase(_Case,Config) ->
case whereis(?SUP) of
- undefined -> ok;
- Pid -> kill(Pid)
+ undefined ->
+ ok;
+ Sup ->
+ Server = whereis(?MODULE),
+ exit(Sup,kill),
+ wait_for_down([Server,Sup])
end,
empty_error_logs(Config),
Config.
-kill(Pid) ->
+wait_for_down([]) ->
+ ok;
+wait_for_down([undefined|Rest]) ->
+ wait_for_down(Rest);
+wait_for_down([Pid|Rest]) ->
Ref = erlang:monitor(process,Pid),
- exit(Pid,kill),
- receive {'DOWN', Ref, process, Pid, _Info} -> ok end.
+ receive {'DOWN', Ref, process, Pid, _Info} -> ok end,
+ wait_for_down(Rest).
end_per_testcase(Case,Config) ->
try apply(?MODULE,Case,[cleanup,Config])
@@ -96,8 +104,9 @@ end_per_testcase(Case,Config) ->
help(_Config) ->
Help = capture(fun() -> rb:h() end),
- "Report Browser Tool - usage" = hd(Help),
- "rb:stop - stop the rb_server" = lists:last(Help),
+ %% Check that first and last line is there
+ true = lists:member("Report Browser Tool - usage", Help),
+ true = lists:member("rb:stop - stop the rb_server", Help),
ok.
%% Test that all three sasl env vars must be set for a successful start of rb
diff --git a/lib/sasl/test/release_handler_SUITE.erl b/lib/sasl/test/release_handler_SUITE.erl
index ac616dab72..87a755031c 100644
--- a/lib/sasl/test/release_handler_SUITE.erl
+++ b/lib/sasl/test/release_handler_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -63,7 +63,7 @@ cases() ->
instructions, eval_appup, eval_appup_with_restart,
supervisor_which_children_timeout,
release_handler_which_releases, install_release_syntax_check,
- upgrade_supervisor, upgrade_supervisor_fail].
+ upgrade_supervisor, upgrade_supervisor_fail, otp_9864].
groups() ->
[{release,[],
@@ -1205,6 +1205,74 @@ otp_9395_rm_many_mods(Conf) when is_list(Conf) ->
otp_9395_rm_many_mods(cleanup,_Conf) ->
stop_node(node_name(otp_9395_rm_many_mods)).
+otp_9864(Conf) ->
+ case os:type() of
+ {win32,_} ->
+ {skip,"Testing handling of symlinks - skipped on windows"};
+ _ ->
+ do_otp_9864(Conf)
+ end.
+do_otp_9864(Conf) ->
+ %% Set some paths
+ PrivDir = priv_dir(Conf),
+ Dir = filename:join(PrivDir,"otp_9864"),
+ RelDir = filename:join(?config(data_dir, Conf), "app1_app2"),
+
+ %% Copy libs to priv_dir because remove_release will remove some
+ %% of these again, and we don't want to remove anything from
+ %% data_dir
+ copy_tree(Conf,filename:join(RelDir, "lib1"),Dir),
+ copy_tree(Conf,filename:join(RelDir, "lib2"),Dir),
+ LibDir1 = filename:join(Dir, "lib1"),
+ LibDir2 = filename:join(Dir, "lib2"),
+
+ %% Create the releases
+ Rel1 = create_and_install_fake_first_release(Dir,
+ [{app1,"1.0",LibDir1},
+ {app2,"1.0",LibDir1}]),
+ Rel2 = create_fake_upgrade_release(Dir,
+ "2",
+ [{app1,"2.0",LibDir2},
+ {app2,"1.0",LibDir2}],
+ {[Rel1],[Rel1],[LibDir1]}),
+ Rel1Dir = filename:dirname(Rel1),
+ Rel2Dir = filename:dirname(Rel2),
+
+ %% Start a slave node
+ {ok, Node} = t_start_node(otp_9864, Rel1, filename:join(Rel1Dir,"sys.config")),
+
+ %% Unpack rel2 (make sure it does not work if an AppDir is bad)
+ {ok, RelVsn2} =
+ rpc:call(Node, release_handler, set_unpacked,
+ [Rel2++".rel", [{app1,"2.0",LibDir2}, {app2,"1.0",LibDir2}]]),
+ ok = rpc:call(Node, release_handler, install_file,
+ [RelVsn2, filename:join(Rel2Dir, "relup")]),
+ ok = rpc:call(Node, release_handler, install_file,
+ [RelVsn2, filename:join(Rel2Dir, "start.boot")]),
+ ok = rpc:call(Node, release_handler, install_file,
+ [RelVsn2, filename:join(Rel2Dir, "sys.config")]),
+
+ %% Install RelVsn2
+ {ok, RelVsn1, []} =
+ rpc:call(Node, release_handler, install_release, [RelVsn2]),
+
+ %% Create a symlink inside release 2
+ Releases2Dir = filename:join([Dir,"releases","2"]),
+ Link = filename:join(Releases2Dir,"foo_symlink_dir"),
+ file:make_symlink(Releases2Dir,Link),
+
+ %% Back down to RelVsn1
+ {ok, RelVsn1, []} =
+ rpc:call(Node, release_handler, install_release, [RelVsn1]),
+
+ %% This will fail if symlinks are not handled
+ ok = rpc:call(Node, release_handler, remove_release, [RelVsn2]),
+
+ ok.
+
+otp_9864(cleanup,_Conf) ->
+ stop_node(node_name(otp_9864)).
+
upgrade_supervisor(Conf) when is_list(Conf) ->
%% Set some paths
diff --git a/lib/sasl/test/release_handler_SUITE_data/Makefile.src b/lib/sasl/test/release_handler_SUITE_data/Makefile.src
index 55d20aa8b6..b794aa0e6f 100644
--- a/lib/sasl/test/release_handler_SUITE_data/Makefile.src
+++ b/lib/sasl/test/release_handler_SUITE_data/Makefile.src
@@ -1,9 +1,5 @@
EFLAGS=+debug_info
-P2B= \
- P2B/a-2.0/ebin/a.@EMULATOR@ \
- P2B/a-2.0/ebin/a_sup.@EMULATOR@
-
LIB= \
lib/a-9.1/ebin/a.@EMULATOR@ \
lib/a-9.1/ebin/a_sup.@EMULATOR@ \
@@ -80,13 +76,7 @@ SUP= \
release_handler_timeouts/dummy-0.1/ebin/dummy_sup.@EMULATOR@ \
release_handler_timeouts/dummy-0.1/ebin/dummy_sup_2.@EMULATOR@
-all: $(P2B) $(LIB) $(APP) $(OTP2740) $(C) $(SUP)
-
-P2B/a-2.0/ebin/a.@EMULATOR@: P2B/a-2.0/src/a.erl
- erlc $(EFLAGS) -oP2B/a-2.0/ebin P2B/a-2.0/src/a.erl
-P2B/a-2.0/ebin/a_sup.@EMULATOR@: P2B/a-2.0/src/a_sup.erl
- erlc $(EFLAGS) -oP2B/a-2.0/ebin P2B/a-2.0/src/a_sup.erl
-
+all: $(LIB) $(APP) $(OTP2740) $(C) $(SUP)
lib/a-1.0/ebin/a.@EMULATOR@: lib/a-1.0/src/a.erl
erlc $(EFLAGS) -olib/a-1.0/ebin lib/a-1.0/src/a.erl
diff --git a/lib/sasl/test/release_handler_SUITE_data/c/c.app b/lib/sasl/test/release_handler_SUITE_data/c/c.app
index 908a94cf2d..2f56196918 100644
--- a/lib/sasl/test/release_handler_SUITE_data/c/c.app
+++ b/lib/sasl/test/release_handler_SUITE_data/c/c.app
@@ -1,7 +1,7 @@
{application, c,
[{description, "C CXC 138 11"},
{vsn, "1.0"},
- {modules, [b, {aa, 1}, {c_sup,1}]},
+ {modules, [b, aa, c_sup]},
{registered, [cc,bb,c_sup]},
{applications, [kernel, stdlib]},
{env, [{key1, val1}]},
diff --git a/lib/sasl/test/release_handler_SUITE_data/lib/a-1.0/ebin/a.app b/lib/sasl/test/release_handler_SUITE_data/lib/a-1.0/ebin/a.app
index e938137f67..7ae189a36a 100644
--- a/lib/sasl/test/release_handler_SUITE_data/lib/a-1.0/ebin/a.app
+++ b/lib/sasl/test/release_handler_SUITE_data/lib/a-1.0/ebin/a.app
@@ -1,7 +1,7 @@
{application, a,
[{description, "A CXC 138 11"},
{vsn, "1.0"},
- {modules, [{a, 1}, {a_sup,1}]},
+ {modules, [a, a_sup]},
{registered, [a_sup]},
{applications, [kernel, stdlib]},
{env, [{key1, val1}]},
diff --git a/lib/sasl/test/release_handler_SUITE_data/lib/a-1.1/ebin/a.app b/lib/sasl/test/release_handler_SUITE_data/lib/a-1.1/ebin/a.app
index 1c3053b2fa..f8ab31fab9 100644
--- a/lib/sasl/test/release_handler_SUITE_data/lib/a-1.1/ebin/a.app
+++ b/lib/sasl/test/release_handler_SUITE_data/lib/a-1.1/ebin/a.app
@@ -1,7 +1,7 @@
{application, a,
[{description, "A CXC 138 11"},
{vsn, "1.1"},
- {modules, [{a, 2}, {a_sup,1}]},
+ {modules, [a, a_sup]},
{registered, [a_sup]},
{applications, [kernel, stdlib]},
{env, [{key1, val1}]},
diff --git a/lib/sasl/test/release_handler_SUITE_data/lib/a-1.2/ebin/a.app b/lib/sasl/test/release_handler_SUITE_data/lib/a-1.2/ebin/a.app
index b38722f06d..2393af0493 100644
--- a/lib/sasl/test/release_handler_SUITE_data/lib/a-1.2/ebin/a.app
+++ b/lib/sasl/test/release_handler_SUITE_data/lib/a-1.2/ebin/a.app
@@ -1,7 +1,7 @@
{application, a,
[{description, "A CXC 138 11"},
{vsn, "1.2"},
- {modules, [{a, 2}, {a_sup,1}]},
+ {modules, [a, a_sup]},
{registered, [a_sup]},
{applications, [kernel, stdlib]},
{env, [{key1, val1}]},
diff --git a/lib/sasl/test/release_handler_SUITE_data/lib/b-1.0/ebin/b.app b/lib/sasl/test/release_handler_SUITE_data/lib/b-1.0/ebin/b.app
index 00347b2754..e2eada00a4 100644
--- a/lib/sasl/test/release_handler_SUITE_data/lib/b-1.0/ebin/b.app
+++ b/lib/sasl/test/release_handler_SUITE_data/lib/b-1.0/ebin/b.app
@@ -2,6 +2,6 @@
{application, b,
[{description, "B CXC 138 12"},
{vsn, "1.0"},
- {modules, [{b_server, 1},{b_lib, 1}]},
+ {modules, [b_server,b_lib]},
{registered, [b_server]},
{applications, [kernel, stdlib]}]}.
diff --git a/lib/sasl/test/release_handler_SUITE_data/lib/b-2.0/ebin/b.app b/lib/sasl/test/release_handler_SUITE_data/lib/b-2.0/ebin/b.app
index 73c8e42b32..e4f8369ae5 100644
--- a/lib/sasl/test/release_handler_SUITE_data/lib/b-2.0/ebin/b.app
+++ b/lib/sasl/test/release_handler_SUITE_data/lib/b-2.0/ebin/b.app
@@ -2,6 +2,6 @@
{application, b,
[{description, "B CXC 138 12"},
{vsn, "2.0"},
- {modules, [{b_server, 1}]},
+ {modules, [b_server]},
{registered, [b_server]},
{applications, [kernel, stdlib]}]}.
diff --git a/lib/sasl/test/release_handler_SUITE_data/lib/many_mods-1.0/ebin/many_mods.app b/lib/sasl/test/release_handler_SUITE_data/lib/many_mods-1.0/ebin/many_mods.app
index aa39adfffa..5c56c4cd74 100644
--- a/lib/sasl/test/release_handler_SUITE_data/lib/many_mods-1.0/ebin/many_mods.app
+++ b/lib/sasl/test/release_handler_SUITE_data/lib/many_mods-1.0/ebin/many_mods.app
@@ -2,16 +2,6 @@
{application, many_mods,
[{description, "Application with many modules CXC 138 11"},
{vsn, "1.0"},
- {modules, [{m, 1},
- {m1,1},
- {m2,1},
- {m3,1},
- {m4,1},
- {m5,1},
- {m6,1},
- {m7,1},
- {m8,1},
- {m9,1},
- {m10,1}]},
+ {modules, [m,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10]},
{registered, []},
{applications, [kernel, stdlib]}]}.
diff --git a/lib/sasl/test/release_handler_SUITE_data/lib/many_mods-1.1/ebin/many_mods.app b/lib/sasl/test/release_handler_SUITE_data/lib/many_mods-1.1/ebin/many_mods.app
index 36c50caf2f..87fdfe8442 100644
--- a/lib/sasl/test/release_handler_SUITE_data/lib/many_mods-1.1/ebin/many_mods.app
+++ b/lib/sasl/test/release_handler_SUITE_data/lib/many_mods-1.1/ebin/many_mods.app
@@ -2,16 +2,6 @@
{application, many_mods,
[{description, "Application with many modules CXC 138 11"},
{vsn, "1.1"},
- {modules, [{m, 1},
- {m1,1},
- {m2,1},
- {m3,1},
- {m4,1},
- {m5,1},
- {m6,1},
- {m7,1},
- {m8,1},
- {m9,1},
- {m10,1}]},
+ {modules, [m,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10]},
{registered, []},
{applications, [kernel, stdlib]}]}.
diff --git a/lib/sasl/test/release_handler_SUITE_data/lib/many_mods-2.0/ebin/many_mods.app b/lib/sasl/test/release_handler_SUITE_data/lib/many_mods-2.0/ebin/many_mods.app
index 98f6527750..aba906d667 100644
--- a/lib/sasl/test/release_handler_SUITE_data/lib/many_mods-2.0/ebin/many_mods.app
+++ b/lib/sasl/test/release_handler_SUITE_data/lib/many_mods-2.0/ebin/many_mods.app
@@ -2,6 +2,6 @@
{application, many_mods,
[{description, "Application with many modules CXC 138 11"},
{vsn, "2.0"},
- {modules, [{m, 1}]},
+ {modules, [m]},
{registered, []},
{applications, [kernel, stdlib]}]}.
diff --git a/lib/sasl/test/systools_SUITE.erl b/lib/sasl/test/systools_SUITE.erl
index 4cf7364d74..878d582e6b 100644
--- a/lib/sasl/test/systools_SUITE.erl
+++ b/lib/sasl/test/systools_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011. All Rights Reserved.
+%% Copyright Ericsson AB 2012. 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
@@ -45,7 +45,7 @@
abnormal_script/1, src_tests_script/1, crazy_script/1,
included_script/1, included_override_script/1,
included_fail_script/1, included_bug_script/1, exref_script/1,
- otp_3065_circular_dependenies/1]).
+ otp_3065_circular_dependenies/1, included_and_used_sort_script/1]).
-export([tar_options/1, normal_tar/1, no_mod_vsn_tar/1, system_files_tar/1,
system_files_tar/2, invalid_system_files_tar/1,
invalid_system_files_tar/2, variable_tar/1,
@@ -80,7 +80,7 @@ groups() ->
no_sasl_script, src_tests_script, crazy_script,
included_script, included_override_script,
included_fail_script, included_bug_script, exref_script,
- otp_3065_circular_dependenies]},
+ otp_3065_circular_dependenies, included_and_used_sort_script]},
{tar, [],
[tar_options, normal_tar, no_mod_vsn_tar, system_files_tar,
invalid_system_files_tar, variable_tar,
@@ -500,6 +500,22 @@ crazy_script(Config) when is_list(Config) ->
{error, _, {mandatory_app,kernel,load}} =
systools:make_script(LatestName3, [silent,{path,P}]),
+ %% Run with .rel file with non-permanent stdlib
+ {LatestDir4, LatestName4} = create_script(latest_stdlib_start_type, Config),
+ ok = file:set_cwd(LatestDir4),
+
+ error = systools:make_script(LatestName4),
+ {error, _, {mandatory_app,stdlib,load}} =
+ systools:make_script(LatestName4, [silent,{path,P}]),
+
+ %% Run with .rel file lacking stdlib
+ {LatestDir5, LatestName5} = create_script(latest_no_stdlib, Config),
+ ok = file:set_cwd(LatestDir5),
+
+ error = systools:make_script(LatestName5),
+ {error, _, {missing_mandatory_app,stdlib}} =
+ systools:make_script(LatestName5, [silent,{path,P}]),
+
ok = file:set_cwd(OldDir),
ok.
@@ -600,6 +616,24 @@ otp_3065_circular_dependenies(Config) when is_list(Config) ->
ok = file:set_cwd(OldDir),
ok.
+%% Test sorting of included applications and used applications
+included_and_used_sort_script(Config) when is_list(Config) ->
+ {ok, OldDir} = file:get_cwd(),
+ {LatestDir1, LatestName1} = create_include_files(sort_apps, Config),
+ ok = file:set_cwd(LatestDir1),
+ ok = systools:make_script(LatestName1),
+ ok = check_include_script(LatestName1,
+ [t20,t19,t18,t17,t16,t15,t14],[t20,t19,t18,t14]),
+
+ {LatestDir2, LatestName2} = create_include_files(sort_apps_rev, Config),
+ ok = file:set_cwd(LatestDir2),
+ ok = systools:make_script(LatestName2),
+ ok = check_include_script(LatestName2,
+ [t18,t19,t20,t15,t16,t17,t14],[t18,t19,t20,t14]),
+
+ ok = file:set_cwd(OldDir),
+ ok.
+
%% make_script: Check that make_script exref option works.
exref_script(Config) when is_list(Config) ->
@@ -2026,8 +2060,14 @@ create_script(latest_nokernel,Config) ->
Apps = [{db,"2.1"},{fe,"3.1"}],
do_create_script(latest_nokernel,Config,"4.4",Apps);
create_script(latest_kernel_start_type,Config) ->
- Apps = [{kernel,"1.0",load},{db,"2.1"},{fe,"3.1"}],
+ Apps = [{kernel,"1.0",load},{stdlib,"1.0"},{db,"2.1"},{fe,"3.1"}],
do_create_script(latest_kernel_start_type,Config,"4.4",Apps);
+create_script(latest_stdlib_start_type,Config) ->
+ Apps = [{kernel,"1.0"},{stdlib,"1.0",load},{db,"2.1"},{fe,"3.1"}],
+ do_create_script(latest_stdlib_start_type,Config,"4.4",Apps);
+create_script(latest_no_stdlib,Config) ->
+ Apps = [{kernel,"1.0"},{db,"2.1"},{fe,"3.1"}],
+ do_create_script(latest_no_stdlib,Config,"4.4",Apps);
create_script(latest_app_start_type1,Config) ->
Apps = core_apps(current),
do_create_script(latest_app_start_type1,Config,current,Apps);
@@ -2301,8 +2341,53 @@ create_include_files(otp_3065_circular_dependenies, Config) ->
" {chAts, \"1.0\"}, {aa12, \"1.0\"}, \n"
" {chTraffic, \"1.0\"}]}.\n",
file:write_file(Name ++ ".rel", list_to_binary(Rel)),
+ {filename:dirname(Name), filename:basename(Name)};
+
+create_include_files(sort_apps, Config) ->
+ PrivDir = ?privdir,
+ Name = fname(PrivDir, sort_apps),
+ create_sort_apps(PrivDir),
+
+ Apps = application_controller:which_applications(),
+ {value,{_,_,KernelVer}} = lists:keysearch(kernel,1,Apps),
+ {value,{_,_,StdlibVer}} = lists:keysearch(stdlib,1,Apps),
+
+ Rel = "{release, {\"test\",\"R1A\"}, {erts, \"45\"},\n"
+ " [{kernel, \"" ++ KernelVer ++ "\"}, {stdlib, \""
+ ++ StdlibVer ++ "\"},\n"
+ " {t14, \"1.0\"}, \n"
+ " {t20, \"1.0\"}, \n"
+ " {t19, \"1.0\"}, \n"
+ " {t18, \"1.0\"}, \n"
+ " {t17, \"1.0\"}, \n"
+ " {t16, \"1.0\"}, \n"
+ " {t15, \"1.0\"}]}.\n",
+ file:write_file(Name ++ ".rel", list_to_binary(Rel)),
+ {filename:dirname(Name), filename:basename(Name)};
+
+create_include_files(sort_apps_rev, Config) ->
+ PrivDir = ?privdir,
+ Name = fname(PrivDir, sort_apps_rev),
+ create_sort_apps(PrivDir),
+
+ Apps = application_controller:which_applications(),
+ {value,{_,_,KernelVer}} = lists:keysearch(kernel,1,Apps),
+ {value,{_,_,StdlibVer}} = lists:keysearch(stdlib,1,Apps),
+
+ Rel = "{release, {\"test\",\"R1A\"}, {erts, \"45\"},\n"
+ " [{kernel, \"" ++ KernelVer ++ "\"}, {stdlib, \""
+ ++ StdlibVer ++ "\"},\n"
+ " {t14, \"1.0\"}, \n"
+ " {t18, \"1.0\"}, \n"
+ " {t19, \"1.0\"}, \n"
+ " {t20, \"1.0\"}, \n"
+ " {t15, \"1.0\"}, \n"
+ " {t16, \"1.0\"}, \n"
+ " {t17, \"1.0\"}]}.\n",
+ file:write_file(Name ++ ".rel", list_to_binary(Rel)),
{filename:dirname(Name), filename:basename(Name)}.
+
create_apps(Dir) ->
T1 = "{application, t1,\n"
" [{vsn, \"1.0\"},\n"
@@ -2451,6 +2536,70 @@ create_apps_3065(Dir) ->
" {registered, []}]}.\n",
file:write_file(fname(Dir, 'aa12.app'), list_to_binary(T13)).
+create_sort_apps(Dir) ->
+ T14 = "{application, t14,\n"
+ " [{vsn, \"1.0\"},\n"
+ " {description, \"test\"},\n"
+ " {modules, []},\n"
+ " {applications, [t18,t20,t19]},\n"
+ " {included_applications, [t15,t17,t16]},\n"
+ " {registered, []}]}.\n",
+ file:write_file(fname(Dir, 't14.app'), list_to_binary(T14)),
+
+ T15 = "{application, t15,\n"
+ " [{vsn, \"1.0\"},\n"
+ " {description, \"test\"},\n"
+ " {modules, []},\n"
+ " {applications, []},\n"
+ " {included_applications, []},\n"
+ " {registered, []}]}.\n",
+ file:write_file(fname(Dir, 't15.app'), list_to_binary(T15)),
+
+ T16 = "{application, t16,\n"
+ " [{vsn, \"1.0\"},\n"
+ " {description, \"test\"},\n"
+ " {modules, []},\n"
+ " {applications, []},\n"
+ " {included_applications, []},\n"
+ " {registered, []}]}.\n",
+ file:write_file(fname(Dir, 't16.app'), list_to_binary(T16)),
+
+ T17 = "{application, t17,\n"
+ " [{vsn, \"1.0\"},\n"
+ " {description, \"test\"},\n"
+ " {modules, []},\n"
+ " {applications, []},\n"
+ " {included_applications, []},\n"
+ " {registered, []}]}.\n",
+ file:write_file(fname(Dir, 't17.app'), list_to_binary(T17)),
+
+ T18 = "{application, t18,\n"
+ " [{vsn, \"1.0\"},\n"
+ " {description, \"test\"},\n"
+ " {modules, []},\n"
+ " {applications, []},\n"
+ " {included_applications, []},\n"
+ " {registered, []}]}.\n",
+ file:write_file(fname(Dir, 't18.app'), list_to_binary(T18)),
+
+ T19 = "{application, t19,\n"
+ " [{vsn, \"1.0\"},\n"
+ " {description, \"test\"},\n"
+ " {modules, []},\n"
+ " {applications, []},\n"
+ " {included_applications, []},\n"
+ " {registered, []}]}.\n",
+ file:write_file(fname(Dir, 't19.app'), list_to_binary(T19)),
+
+ T20 = "{application, t20,\n"
+ " [{vsn, \"1.0\"},\n"
+ " {description, \"test\"},\n"
+ " {modules, []},\n"
+ " {applications, []},\n"
+ " {included_applications, []},\n"
+ " {registered, []}]}.\n",
+ file:write_file(fname(Dir, 't20.app'), list_to_binary(T20)).
+
fname(N) ->
filename:join(N).
diff --git a/lib/sasl/test/systools_SUITE_data/d_bad_app_vsn/lib/db-2.1/ebin/db.app b/lib/sasl/test/systools_SUITE_data/d_bad_app_vsn/lib/db-2.1/ebin/db.app
index d375768b99..0878b80cb5 100644
--- a/lib/sasl/test/systools_SUITE_data/d_bad_app_vsn/lib/db-2.1/ebin/db.app
+++ b/lib/sasl/test/systools_SUITE_data/d_bad_app_vsn/lib/db-2.1/ebin/db.app
@@ -1,7 +1,7 @@
{application, db,
[{description, "ERICSSON NR FOR DB"},
{vsn, "2.0"},
- {modules, [{db1, "1.0"}, {db2, "1.0"}]},
+ {modules, [db1, db2]},
{registered, []},
{applications, []},
{env, []},
diff --git a/lib/sasl/test/systools_SUITE_data/d_bad_app_vsn/lib/fe-3.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_bad_app_vsn/lib/fe-3.1/ebin/fe.app
index d3bd85cda6..33d44805bd 100644
--- a/lib/sasl/test/systools_SUITE_data/d_bad_app_vsn/lib/fe-3.1/ebin/fe.app
+++ b/lib/sasl/test/systools_SUITE_data/d_bad_app_vsn/lib/fe-3.1/ebin/fe.app
@@ -1,7 +1,7 @@
{application, fe,
[{description, "ERICSSON NR FOR FE"},
{vsn, "3.1"},
- {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]},
+ {modules, [fe1, fe2, fe3]},
{registered, []},
{applications, []},
{env, []},
diff --git a/lib/sasl/test/systools_SUITE_data/d_bad_appup/lib/fe-2.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_bad_appup/lib/fe-2.1/ebin/fe.app
index 3cb0b0c2cf..d7fae9e092 100644
--- a/lib/sasl/test/systools_SUITE_data/d_bad_appup/lib/fe-2.1/ebin/fe.app
+++ b/lib/sasl/test/systools_SUITE_data/d_bad_appup/lib/fe-2.1/ebin/fe.app
@@ -1,7 +1,7 @@
{application, fe,
[{description, "ERICSSON NR FOR FE"},
{vsn, "2.1"},
- {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]},
+ {modules, [fe1, fe2, fe3]},
{registered, []},
{applications, []},
{mod, {fe1, []}}]}.
diff --git a/lib/sasl/test/systools_SUITE_data/d_bad_appup/lib/fe-3.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_bad_appup/lib/fe-3.1/ebin/fe.app
index 0696e2494c..682d40eb12 100644
--- a/lib/sasl/test/systools_SUITE_data/d_bad_appup/lib/fe-3.1/ebin/fe.app
+++ b/lib/sasl/test/systools_SUITE_data/d_bad_appup/lib/fe-3.1/ebin/fe.app
@@ -1,7 +1,7 @@
{application, fe,
[{description, "ERICSSON NR FOR FE"},
{vsn, "3.1"},
- {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]},
+ {modules, [fe1, fe2, fe3]},
{registered, []},
{applications, []},
{mod, {fe1, []}}]}.
diff --git a/lib/sasl/test/systools_SUITE_data/d_bad_mod+warn/lib/db-2.1/ebin/db.app b/lib/sasl/test/systools_SUITE_data/d_bad_mod+warn/lib/db-2.1/ebin/db.app
index 191919f8d3..a1025c306a 100644
--- a/lib/sasl/test/systools_SUITE_data/d_bad_mod+warn/lib/db-2.1/ebin/db.app
+++ b/lib/sasl/test/systools_SUITE_data/d_bad_mod+warn/lib/db-2.1/ebin/db.app
@@ -1,7 +1,7 @@
{application, db,
[{description, "ERICSSON NR FOR DB"},
{vsn, "2.1"},
- {modules, [{db1, "1.0"}, {db2, "1.0"}]},
+ {modules, [db1, db2]},
{registered, []},
{applications, []},
{env, []},
diff --git a/lib/sasl/test/systools_SUITE_data/d_bad_mod+warn/lib/fe-3.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_bad_mod+warn/lib/fe-3.1/ebin/fe.app
index d3bd85cda6..33d44805bd 100644
--- a/lib/sasl/test/systools_SUITE_data/d_bad_mod+warn/lib/fe-3.1/ebin/fe.app
+++ b/lib/sasl/test/systools_SUITE_data/d_bad_mod+warn/lib/fe-3.1/ebin/fe.app
@@ -1,7 +1,7 @@
{application, fe,
[{description, "ERICSSON NR FOR FE"},
{vsn, "3.1"},
- {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]},
+ {modules, [fe1, fe2, fe3]},
{registered, []},
{applications, []},
{env, []},
diff --git a/lib/sasl/test/systools_SUITE_data/d_links/lib/db-2.1/ebin/db.app b/lib/sasl/test/systools_SUITE_data/d_links/lib/db-2.1/ebin/db.app
index 3e0ac3c3c9..28d0f80d34 100644
--- a/lib/sasl/test/systools_SUITE_data/d_links/lib/db-2.1/ebin/db.app
+++ b/lib/sasl/test/systools_SUITE_data/d_links/lib/db-2.1/ebin/db.app
@@ -1,7 +1,7 @@
{application, db,
[{description, "ERICSSON NR FOR DB"},
{vsn, "2.1"},
- {modules, [{db1, "1.0"}, {db2, "1.0"}, {db3, "2.0"}]},
+ {modules, [db1, db2, db3]},
{registered, []},
{applications, []},
{env, []},
diff --git a/lib/sasl/test/systools_SUITE_data/d_missing_src/lib/db-2.1/ebin/db.app b/lib/sasl/test/systools_SUITE_data/d_missing_src/lib/db-2.1/ebin/db.app
index 191919f8d3..a1025c306a 100644
--- a/lib/sasl/test/systools_SUITE_data/d_missing_src/lib/db-2.1/ebin/db.app
+++ b/lib/sasl/test/systools_SUITE_data/d_missing_src/lib/db-2.1/ebin/db.app
@@ -1,7 +1,7 @@
{application, db,
[{description, "ERICSSON NR FOR DB"},
{vsn, "2.1"},
- {modules, [{db1, "1.0"}, {db2, "1.0"}]},
+ {modules, [db1, db2]},
{registered, []},
{applications, []},
{env, []},
diff --git a/lib/sasl/test/systools_SUITE_data/d_missing_src/lib/fe-3.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_missing_src/lib/fe-3.1/ebin/fe.app
index d3bd85cda6..33d44805bd 100644
--- a/lib/sasl/test/systools_SUITE_data/d_missing_src/lib/fe-3.1/ebin/fe.app
+++ b/lib/sasl/test/systools_SUITE_data/d_missing_src/lib/fe-3.1/ebin/fe.app
@@ -1,7 +1,7 @@
{application, fe,
[{description, "ERICSSON NR FOR FE"},
{vsn, "3.1"},
- {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]},
+ {modules, [fe1, fe2, fe3]},
{registered, []},
{applications, []},
{env, []},
diff --git a/lib/sasl/test/systools_SUITE_data/d_no_appup/lib/fe-2.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_no_appup/lib/fe-2.1/ebin/fe.app
index 47ea248720..717d30cf45 100644
--- a/lib/sasl/test/systools_SUITE_data/d_no_appup/lib/fe-2.1/ebin/fe.app
+++ b/lib/sasl/test/systools_SUITE_data/d_no_appup/lib/fe-2.1/ebin/fe.app
@@ -1,7 +1,7 @@
{application, fe,
[{description, "ERICSSON NR FOR FE"},
{vsn, "2.1"},
- {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]},
+ {modules, [fe1, fe2, fe3]},
{registered, []},
{applications, []},
{env, []},
diff --git a/lib/sasl/test/systools_SUITE_data/d_no_appup/lib/fe-3.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_no_appup/lib/fe-3.1/ebin/fe.app
index 0696e2494c..682d40eb12 100644
--- a/lib/sasl/test/systools_SUITE_data/d_no_appup/lib/fe-3.1/ebin/fe.app
+++ b/lib/sasl/test/systools_SUITE_data/d_no_appup/lib/fe-3.1/ebin/fe.app
@@ -1,7 +1,7 @@
{application, fe,
[{description, "ERICSSON NR FOR FE"},
{vsn, "3.1"},
- {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]},
+ {modules, [fe1, fe2, fe3]},
{registered, []},
{applications, []},
{mod, {fe1, []}}]}.
diff --git a/lib/sasl/test/systools_SUITE_data/d_no_appup/lib/fe-500.18.7/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_no_appup/lib/fe-500.18.7/ebin/fe.app
index 3a5c0ddd9b..77b97979cb 100644
--- a/lib/sasl/test/systools_SUITE_data/d_no_appup/lib/fe-500.18.7/ebin/fe.app
+++ b/lib/sasl/test/systools_SUITE_data/d_no_appup/lib/fe-500.18.7/ebin/fe.app
@@ -1,7 +1,7 @@
{application, fe,
[{description, "ERICSSON NR FOR FE"},
{vsn, "500.18.7"},
- {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]},
+ {modules, [fe1, fe2, fe3]},
{registered, []},
{applications, []},
{mod, {fe1, []}}]}.
diff --git a/lib/sasl/test/systools_SUITE_data/d_normal/lib/db-1.0/ebin/db.app b/lib/sasl/test/systools_SUITE_data/d_normal/lib/db-1.0/ebin/db.app
index 22530ee335..3968ce3c32 100644
--- a/lib/sasl/test/systools_SUITE_data/d_normal/lib/db-1.0/ebin/db.app
+++ b/lib/sasl/test/systools_SUITE_data/d_normal/lib/db-1.0/ebin/db.app
@@ -1,7 +1,7 @@
{application, db,
[{description, "ERICSSON NR FOR DB"},
{vsn, "1.0"},
- {modules, [{db1, "1.0"}, {db2, "1.0"}]},
+ {modules, [db1, db2]},
{registered, []},
{applications, []},
{env, []},
diff --git a/lib/sasl/test/systools_SUITE_data/d_normal/lib/db-1.1/ebin/db.app b/lib/sasl/test/systools_SUITE_data/d_normal/lib/db-1.1/ebin/db.app
index 7243a0a96a..0f0c926fbd 100644
--- a/lib/sasl/test/systools_SUITE_data/d_normal/lib/db-1.1/ebin/db.app
+++ b/lib/sasl/test/systools_SUITE_data/d_normal/lib/db-1.1/ebin/db.app
@@ -1,7 +1,7 @@
{application, db,
[{description, "ERICSSON NR FOR DB"},
{vsn, "1.1"},
- {modules, [{db1, "1.0"}, {db2, "1.0"}]},
+ {modules, [db1, db2]},
{registered, []},
{applications, []},
{env, []},
diff --git a/lib/sasl/test/systools_SUITE_data/d_normal/lib/db-2.1/ebin/db.app b/lib/sasl/test/systools_SUITE_data/d_normal/lib/db-2.1/ebin/db.app
index 202d7f1234..6901d225e2 100644
--- a/lib/sasl/test/systools_SUITE_data/d_normal/lib/db-2.1/ebin/db.app
+++ b/lib/sasl/test/systools_SUITE_data/d_normal/lib/db-2.1/ebin/db.app
@@ -1,7 +1,7 @@
{application, db,
[{description, "ERICSSON NR FOR DB"},
{vsn, "2.1"},
- {modules, [{db1, "1.0"}, {db2, "1.0"}]},
+ {modules, [db1, db2]},
{registered, []},
{applications, []},
{mod, {db1, []}}]}.
diff --git a/lib/sasl/test/systools_SUITE_data/d_normal/lib/fe-2.1.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_normal/lib/fe-2.1.1/ebin/fe.app
index c7ba1dfe91..d963a7e7fa 100644
--- a/lib/sasl/test/systools_SUITE_data/d_normal/lib/fe-2.1.1/ebin/fe.app
+++ b/lib/sasl/test/systools_SUITE_data/d_normal/lib/fe-2.1.1/ebin/fe.app
@@ -1,7 +1,7 @@
{application, fe,
[{description, "ERICSSON NR FOR FE"},
{vsn, "2.1.1"},
- {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]},
+ {modules, [fe1, fe2, fe3]},
{registered, []},
{applications, []},
{env, []},
diff --git a/lib/sasl/test/systools_SUITE_data/d_normal/lib/fe-2.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_normal/lib/fe-2.1/ebin/fe.app
index 47ea248720..717d30cf45 100644
--- a/lib/sasl/test/systools_SUITE_data/d_normal/lib/fe-2.1/ebin/fe.app
+++ b/lib/sasl/test/systools_SUITE_data/d_normal/lib/fe-2.1/ebin/fe.app
@@ -1,7 +1,7 @@
{application, fe,
[{description, "ERICSSON NR FOR FE"},
{vsn, "2.1"},
- {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]},
+ {modules, [fe1, fe2, fe3]},
{registered, []},
{applications, []},
{env, []},
diff --git a/lib/sasl/test/systools_SUITE_data/d_normal/lib/fe-3.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_normal/lib/fe-3.1/ebin/fe.app
index 0696e2494c..682d40eb12 100644
--- a/lib/sasl/test/systools_SUITE_data/d_normal/lib/fe-3.1/ebin/fe.app
+++ b/lib/sasl/test/systools_SUITE_data/d_normal/lib/fe-3.1/ebin/fe.app
@@ -1,7 +1,7 @@
{application, fe,
[{description, "ERICSSON NR FOR FE"},
{vsn, "3.1"},
- {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]},
+ {modules, [fe1, fe2, fe3]},
{registered, []},
{applications, []},
{mod, {fe1, []}}]}.
diff --git a/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1.1/ebin/fe.app
index c7ba1dfe91..d963a7e7fa 100644
--- a/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1.1/ebin/fe.app
+++ b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1.1/ebin/fe.app
@@ -1,7 +1,7 @@
{application, fe,
[{description, "ERICSSON NR FOR FE"},
{vsn, "2.1.1"},
- {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]},
+ {modules, [fe1, fe2, fe3]},
{registered, []},
{applications, []},
{env, []},
diff --git a/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1/ebin/fe.app
index 47ea248720..717d30cf45 100644
--- a/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1/ebin/fe.app
+++ b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-2.1/ebin/fe.app
@@ -1,7 +1,7 @@
{application, fe,
[{description, "ERICSSON NR FOR FE"},
{vsn, "2.1"},
- {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]},
+ {modules, [fe1, fe2, fe3]},
{registered, []},
{applications, []},
{env, []},
diff --git a/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.app b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.app
index 0696e2494c..682d40eb12 100644
--- a/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.app
+++ b/lib/sasl/test/systools_SUITE_data/d_regexp_appup/lib/fe-3.1/ebin/fe.app
@@ -1,7 +1,7 @@
{application, fe,
[{description, "ERICSSON NR FOR FE"},
{vsn, "3.1"},
- {modules, [{fe1, "1.0"}, {fe2, "1.0"}, {fe3, "2.0"}]},
+ {modules, [fe1, fe2, fe3]},
{registered, []},
{applications, []},
{mod, {fe1, []}}]}.
diff --git a/lib/sasl/test/systools_rc_SUITE.erl b/lib/sasl/test/systools_rc_SUITE.erl
index bd4aa9e7a7..0cb6e63cf3 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -46,7 +46,7 @@ syntax_check(Config) when is_list(Config) ->
[#application{name = test,
description = "TEST",
vsn = "0.1",
- modules = [{foo,1},{bar,1},{baz,1},{old_mod,1}],
+ modules = [foo,bar,baz,old_mod],
regs = [],
mod = {sasl, []}},
#application{name = snmp,
@@ -59,7 +59,7 @@ syntax_check(Config) when is_list(Config) ->
[#application{name = test,
description = "TEST",
vsn = "1.0",
- modules = [{foo,1},{bar,1},{baz,1},{new_mod,1}],
+ modules = [foo,bar,baz,new_mod],
regs = [],
mod = {sasl, []}}],
S1 = [
@@ -128,8 +128,8 @@ translate(Config) when is_list(Config) ->
[#application{name = test,
description = "TEST",
vsn = "1.0",
- modules = [{foo,1},{bar,1},{baz,1},
- {x,1},{y,1},{z,1}],
+ modules = [foo,bar,baz,
+ x,y,z],
regs = [],
mod = {sasl, []}}],
%% Simple translation (1)
@@ -439,7 +439,7 @@ translate_app(Config) when is_list(Config) ->
[#application{name = test,
description = "TEST",
vsn = "1.0",
- modules = [{foo,1},{bar,1},{baz,1}],
+ modules = [foo,bar,baz],
regs = [],
mod = {sasl, []}},
#application{name = pelle,
@@ -452,7 +452,7 @@ translate_app(Config) when is_list(Config) ->
[#application{name = test,
description = "TEST",
vsn = "1.0",
- modules = [{foo,1},{bar,1},{baz,1}],
+ modules = [foo,bar,baz],
regs = [],
mod = {sasl, []}}],
%% Simple translation (1)
@@ -492,13 +492,13 @@ translate_emulator_restarts(_Config) ->
[#application{name = test,
description = "TEST",
vsn = "1.0",
- modules = [{foo,1},{bar,1},{baz,1}],
+ modules = [foo,bar,baz],
regs = [],
mod = {sasl, []}},
#application{name = test,
description = "TEST2",
vsn = "1.0",
- modules = [{x,1},{y,1},{z,1}],
+ modules = [x,y,z],
regs = [],
mod = {sasl, []}}],
%% restart_new_emulator
diff --git a/lib/sasl/vsn.mk b/lib/sasl/vsn.mk
index 23694f1399..6e9e2c9ff8 100644
--- a/lib/sasl/vsn.mk
+++ b/lib/sasl/vsn.mk
@@ -1 +1 @@
-SASL_VSN = 2.2
+SASL_VSN = 2.2.1
diff --git a/lib/snmp/doc/src/Makefile b/lib/snmp/doc/src/Makefile
index 8645886590..8820565124 100644
--- a/lib/snmp/doc/src/Makefile
+++ b/lib/snmp/doc/src/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -170,20 +170,20 @@ $(MAN1DIR)/snmpc.1: snmpc_cmd.xml
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man1
- $(INSTALL_DATA) $(MAN1DIR)/* $(RELEASE_PATH)/man/man1
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man6
- $(INSTALL_DATA) $(MAN6DIR)/* $(RELEASE_PATH)/man/man6
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man7
- $(INSTALL_DATA) $(MAN7DIR)/* $(RELEASE_PATH)/man/man7
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man1"
+ $(INSTALL_DATA) $(MAN1DIR)/* "$(RELEASE_PATH)/man/man1"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man6"
+ $(INSTALL_DATA) $(MAN6DIR)/* "$(RELEASE_PATH)/man/man6"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man7"
+ $(INSTALL_DATA) $(MAN7DIR)/* "$(RELEASE_PATH)/man/man7"
release_spec:
diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml
index 704ff0a20f..442837d57d 100644
--- a/lib/snmp/doc/src/notes.xml
+++ b/lib/snmp/doc/src/notes.xml
@@ -34,6 +34,180 @@
<section>
+ <title>SNMP Development Toolkit 4.22.1</title>
+ <p>Version 4.22.1 supports code replacement in runtime from/to
+ version 4.22, 4.21.7 4.21.6 4.21.5, 4.21.4, 4.21.3, 4.21.2, 4.21.1 and
+ 4.21. </p>
+
+ <section>
+ <title>Improvements and new features</title>
+<!--
+ <p>-</p>
+-->
+
+ <list type="bulleted">
+ <item>
+ <p>[agent] Sematic fixes to SNMP-USER-BASED-SM-MIB.
+ The semantics allow the <c>usmUserAuthKeyChange</c> and
+ <c>usmUserPrivKeyChange</c> objects to be written to in the
+ same set requests that also creates and clones the user.
+ This was not possible beforehand, causing test tools checking
+ semantic SNMPv3 behaviour to fail on a lot of test cases. </p>
+ <p>Furthermore, once the user has been cloned by writing to an
+ instance of <c>usmUserCloneFrom</c>, further set-operations to
+ the same object will not return an error, but be no-ops.
+ Especially, it must be avoided to copy security parameters
+ again (possibly even from a different user). </p>
+ <p>Stefan Zegenhagen</p>
+ <p>Own Id: OTP-10166</p>
+ </item>
+
+ <item>
+ <p>[agent] Errors in <c>vacmAccessTable</c> RowStatus handling.
+ There are problems with the handling of vacmAccessTableStatus
+ that cause some SNMP test suites to report errors.
+ Most notably, erroneous set operations frequently cause "genErr"
+ errors to be returned. These "genErr" errors are usually caused
+ by badmatch exceptions coming from
+ <c>{ok, Row} = snmpa_vacm:get_row(RowIndex)</c>
+ if the row does not exist. </p>
+ <p>The semantics of the RowStatus handling in that table has
+ been adjusted to be compliant with the RowStatus
+ textual description of SNPMv2-TC MIB. </p>
+ <p>Stefan Zegenhagen</p>
+ <p>Own Id: OTP-10164</p>
+ </item>
+ </list>
+
+ </section>
+
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
+<!--
+ <p>-</p>
+-->
+
+ <list type="bulleted">
+ <item>
+ <p>[agent] Fix walk over vacmAccessTable.
+ Fix the get_next implementation of vacmAccessTable to
+ return all table entries. </p>
+ <p>The get_next implementation of vacmAccessTable did not return
+ all available table data. Instead, it only returned the first
+ column for each row, and all columns for the last row available. </p>
+ <p>Stefan Zegenhagen</p>
+ <p>Own Id: OTP-10165</p>
+ </item>
+
+ <item>
+ <p>[manager]
+ <seealso marker="snmpm#log_to_io">snmpm:log_to_io/6</seealso>
+ did not use the LogName argument. </p>
+ <p>Own Id: OTP-10066</p>
+ </item>
+
+ <item>
+ <p>Incorrect TimeTicks decode. Also bad handling of
+ invalid encode (value outside of value range) for both
+ <c>TimeTicks</c> and <c>Unsigned32</c>. </p>
+ <p>Own Id: OTP-10132</p>
+ </item>
+
+ </list>
+
+ </section>
+
+ <section>
+ <title>Incompatibilities</title>
+ <p>-</p>
+ </section>
+
+ </section> <!-- 4.22.1 -->
+
+
+ <section>
+ <title>SNMP Development Toolkit 4.22</title>
+ <p>Version 4.22 supports code replacement in runtime from/to
+ version 4.21.7 4.21.6 4.21.5, 4.21.4, 4.21.3, 4.21.2, 4.21.1 and 4.21. </p>
+
+ <section>
+ <title>Improvements and new features</title>
+<!--
+ <p>-</p>
+-->
+
+ <list type="bulleted">
+ <item>
+ <p>[compiler] The table information the MIB compiler provides with
+ augmented tables has been extended with <c>nbr_of_cols</c>,
+ <c>first_accessible</c> and <c>not_accessible</c>. </p>
+ <p>Own Id: OTP-9969</p>
+ </item>
+
+ <item>
+ <p>Added the <c>log_to_io</c> audit-trail-log converter function
+ to the api modules of both the
+ <seealso marker="snmpm#log_to_io">manager</seealso>
+ and
+ <seealso marker="snmpa#log_to_io">agent</seealso>. </p>
+ <p>Own Id: OTP-9940</p>
+ </item>
+
+ <item>
+ <p>[manager] Introduced a new transport module,
+ <c>snmpm_net_if_mt</c>,
+ which handles all incomming and outgoing
+ traffic in newly created processes. The message/request is
+ processed and then the process exits. </p>
+ <p>Own Id: OTP-9876</p>
+ </item>
+
+ <item>
+ <p>[agent] Documenting previously existing but undocumented function,
+ <seealso marker="snmp_generic#get_table_info">snmp_generic:get_table_info/2</seealso>. </p>
+ <p>Own Id: OTP-9942</p>
+ </item>
+
+ <item>
+ <p>[agent] Improve error handling while reading agent config files.
+ Some files contain mandatory information and is therefor themself
+ mandatory. </p>
+ <p>Own Id: OTP-9943</p>
+ </item>
+ </list>
+
+ </section>
+
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
+ <p>-</p>
+
+ <!--
+ <list type="bulleted">
+ <item>
+ <p>[agent] Simultaneous
+ <seealso marker="snmpa#backup">snmpa:backup/1,2</seealso>
+ calls can interfere.
+ The master agent did not check if a backup was already in
+ progress when a backup request was accepted. </p>
+ <p>Own Id: OTP-9884</p>
+ <p>Aux Id: Seq 11995</p>
+ </item>
+
+ </list>
+ -->
+
+ </section>
+
+ <section>
+ <title>Incompatibilities</title>
+ <p>-</p>
+ </section>
+
+ </section> <!-- 4.22 -->
+
+
+ <section>
<title>SNMP Development Toolkit 4.21.7</title>
<p>Version 4.21.7 supports code replacement in runtime from/to
version 4.21.6, 4.21.5, 4.21.4, 4.21.3, 4.21.2, 4.21.1, 4.21, 4.20.1 and
@@ -47,14 +221,14 @@
<list type="bulleted">
<item>
<p>[agent] DoS attack using GET-BULK with large value of
- MaxRepetitions.
- A preventive method has been implementing by simply
- limit the number of varbinds that can be included in
- a Get-BULK response message. This is specified by the
- new config option,
- <seealso marker="snmp_app#agent_gb_max_vbs">gb_max_vbs</seealso>.
- </p>
- <p>Own Id: OTP-9700</p>
+ MaxRepetitions.
+ A preventive method has been implementing by simply
+ limit the number of varbinds that can be included in
+ a Get-BULK response message. This is specified by the
+ new config option,
+ <seealso marker="snmp_app#agent_gb_max_vbs">gb_max_vbs</seealso>.
+ </p>
+ <p>Own Id: OTP-9700</p>
</item>
</list>
@@ -63,7 +237,7 @@
</section>
<section>
- <title>Reported Fixed Bugs and Malfunctions</title>
+ <title>Fixed Bugs and Malfunctions</title>
<!--
<p>-</p>
-->
@@ -71,10 +245,10 @@
<list type="bulleted">
<item>
<p>[agent] Simultaneous
- <seealso marker="snmpa#backup">snmpa:backup/1,2</seealso>
- calls can interfere.
- The master agent did not check if a backup was already in
- progress when a backup request was accepted. </p>
+ <seealso marker="snmpa#backup">snmpa:backup/1,2</seealso>
+ calls can interfere.
+ The master agent did not check if a backup was already in
+ progress when a backup request was accepted. </p>
<p>Own Id: OTP-9884</p>
<p>Aux Id: Seq 11995</p>
</item>
@@ -106,14 +280,14 @@
<list type="bulleted">
<item>
<p>[agent] DoS attack using GET-BULK with large value of
- MaxRepetitions.
- A preventive method has been implementing by simply
- limit the number of varbinds that can be included in
- a Get-BULK response message. This is specified by the
- new config option,
- <seealso marker="snmp_app#agent_gb_max_vbs">gb_max_vbs</seealso>.
- </p>
- <p>Own Id: OTP-9700</p>
+ MaxRepetitions.
+ A preventive method has been implementing by simply
+ limit the number of varbinds that can be included in
+ a Get-BULK response message. This is specified by the
+ new config option,
+ <seealso marker="snmp_app#agent_gb_max_vbs">gb_max_vbs</seealso>.
+ </p>
+ <p>Own Id: OTP-9700</p>
</item>
</list>
@@ -121,7 +295,7 @@
</section>
<section>
- <title>Reported Fixed Bugs and Malfunctions</title>
+ <title>Fixed Bugs and Malfunctions</title>
<!--
<p>-</p>
-->
@@ -129,12 +303,12 @@
<list type="bulleted">
<item>
<p>[agent] Mib server cache gclimit update function incorrectly calls
- age update function.
- The gclimit update function,
- <seealso marker="snmpa#update_mibs_cache_gclimit">update_mibs_cache_gclimit/1</seealso>,
- <em>incorrectly</em> called the age update function,
- <seealso marker="snmpa#update_mibs_cache_age">update_mibs_cache_age/2</seealso>. </p>
- <p>Johan Claesson</p>
+ age update function.
+ The gclimit update function,
+ <seealso marker="snmpa#update_mibs_cache_gclimit">update_mibs_cache_gclimit/1</seealso>,
+ <em>incorrectly</em> called the age update function,
+ <seealso marker="snmpa#update_mibs_cache_age">update_mibs_cache_age/2</seealso>. </p>
+ <p>Johan Claesson</p>
<p>Own Id: OTP-9868</p>
</item>
diff --git a/lib/snmp/doc/src/snmp.xml b/lib/snmp/doc/src/snmp.xml
index af0833f005..3e6610891f 100644
--- a/lib/snmp/doc/src/snmp.xml
+++ b/lib/snmp/doc/src/snmp.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1996</year><year>2009</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -391,6 +391,30 @@
version of the protocol data unit. There is a new line
between <c>Vsn</c> and <c>PDU</c>.</p>
+ <marker id="log_to_io"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile, Start) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) -> ok | {error, Reason}</name>
+ <fsummary>Convert an Audit Trail Log to text format</fsummary>
+ <type>
+ <v>LogDir = string()</v>
+ <v>Mibs = [MibName]</v>
+ <v>MibName = string()</v>
+ <v>LogName = string()</v>
+ <v>LogFile = string()</v>
+ <v>Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} </v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Converts an Audit Trail Log to a readable format and
+ prints it on stdio. See
+ <seealso marker="snmp#log_to_txt">log_to_txt</seealso>
+ above for more info.</p>
+
<marker id="change_log_size"></marker>
</desc>
</func>
diff --git a/lib/snmp/doc/src/snmp_app.xml b/lib/snmp/doc/src/snmp_app.xml
index f6abe783b3..62dfa515d1 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>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -35,8 +35,8 @@
<appsummary>The SNMP Application</appsummary>
<description>
<p>This chapter describes the <c>snmp</c>
- application in OTP. The SNMP application provides the following
- services:</p>
+ application in OTP. The SNMP application provides the following
+ services:</p>
<list type="bulleted">
<item>
<p>a multilingual extensible SNMP agent</p>
@@ -589,16 +589,16 @@
{no_reuse, no_reuse()} |
{filter, manager_net_if_filter_options()} </c></p>
<p>These options are actually specific to the used module.
- The ones shown here are applicable to the default
- <c>manager_net_if_module()</c>.</p>
+ The ones shown here are applicable to the default
+ <c>manager_net_if_module()</c>.</p>
<p>For defaults see the options in <c>manager_net_if_option()</c>.</p>
</item>
<marker id="manager_ni_module"></marker>
<tag><c><![CDATA[manager_net_if_module() = atom() <optional>]]></c></tag>
<item>
- <p>Module which handles the network interface part for the
- SNMP manager. Must implement the
+ <p>The module which handles the network interface part for the
+ SNMP manager. It must implement the
<seealso marker="snmpm_network_interface">snmpm_network_interface</seealso> behaviour.</p>
<p>Default is <c>snmpm_net_if</c>.</p>
</item>
diff --git a/lib/snmp/doc/src/snmp_config.xml b/lib/snmp/doc/src/snmp_config.xml
index 0a49b7a62e..eec53162a1 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>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -586,18 +586,18 @@
{no_reuse, no_reuse()} |
{filter, manager_net_if_filter_options()}</c></p>
<p>These options are actually specific to the used module.
- The ones shown here are applicable to the default
- <c>manager_net_if_module()</c>.</p>
+ The ones shown here are applicable to the default
+ <c>manager_net_if_module()</c>. </p>
<p>For defaults see the options in <c>manager_net_if_option()</c>.</p>
</item>
<marker id="manager_ni_module"></marker>
<tag><c><![CDATA[manager_net_if_module() = atom() <optional>]]></c></tag>
<item>
- <p>Module which handles the network interface part for the
- SNMP manager. Must implement the
- <seealso marker="snmpm_network_interface">snmpm_network_interface</seealso> behaviour.</p>
- <p>Default is <c>snmpm_net_if</c>.</p>
+ <p>The module which handles the network interface part for the
+ SNMP manager. It must implement the
+ <seealso marker="snmpm_network_interface">snmpm_network_interface</seealso> behaviour. </p>
+ <p>Default is <c>snmpm_net_if</c>. </p>
</item>
<marker id="manager_ni_filter_opts"></marker>
@@ -963,7 +963,8 @@ Manager snmp config:
7b. User name? hobbes
7c. Security name? [hobbes]
7d. Authentication protocol (no/sha/md5)? [no] sha
-7e Authentication [sha] key (length 0 or 20)? [""] [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
+7e Authentication [sha] key (length 0 or 20)? [""] [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16, \
+ 17,18,19,20]
7d. Priv protocol (no/des/aes)? [no] des
7f Priv [des] key (length 0 or 16)? [""] 10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
7. Configure an usm user handled by this manager (y/n)? [y] n
diff --git a/lib/snmp/doc/src/snmp_generic.xml b/lib/snmp/doc/src/snmp_generic.xml
index 77f3cefaa2..79a22323d9 100644
--- a/lib/snmp/doc/src/snmp_generic.xml
+++ b/lib/snmp/doc/src/snmp_generic.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>1996</year><year>2009</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -34,15 +34,16 @@
<module>snmp_generic</module>
<modulesummary>Generic Functions for Implementing SNMP Objects in a Database</modulesummary>
<description>
- <p>The module <c>snmp_generic</c> contains generic functions for implementing tables
- (and variables) using the SNMP built-in database or Mnesia. These
- default functions are used if no instrumentation function is
- provided for a managed object in a MIB. Sometimes, it might be
- necessary to customize the behaviour of the default functions. For
- example, in some situations a trap should be sent if a row is
- deleted or modified, or some hardware is to be informed, when
- information is changed.
- </p>
+ <marker id="description"></marker>
+ <p>The module <c>snmp_generic</c> contains generic functions for
+ implementing tables (and variables) using the SNMP built-in database
+ or Mnesia. These default functions are used if no instrumentation
+ function is provided for a managed object in a MIB. Sometimes,
+ it might be necessary to customize the behaviour of the default
+ functions. For example, in some situations a trap should be sent
+ if a row is deleted or modified, or some hardware is to be informed,
+ when information is changed. </p>
+
<p>The overall structure is shown in the following figure:</p>
<pre>
+---------------+
@@ -93,6 +94,7 @@
</description>
<section>
+ <marker id="data_types"></marker>
<title>DATA TYPES</title>
<p>In the functions defined below, the following types are used:</p>
<code type="none">
@@ -118,7 +120,10 @@ value() = term()
case of a <c>set</c> operation. </p>
</item>
</taglist>
+
+ <marker id="get_status_col2"></marker>
</section>
+
<funcs>
<func>
<name>get_status_col(Name, Cols)</name>
@@ -136,8 +141,11 @@ value() = term()
<p>This function can be used in instrumentation functions for
<c>is_set_ok</c>, <c>undo</c> or <c>set</c> to check if the
status column of a table is modified.</p>
+
+ <marker id="get_index_types"></marker>
</desc>
</func>
+
<func>
<name>get_index_types(Name)</name>
<fsummary>Get the index types of <c>Name</c></fsummary>
@@ -147,9 +155,36 @@ value() = term()
<desc>
<p>Gets the index types of <c>Name</c></p>
<p>This function can be used in instrumentation functions to
- retrieve the index types part of the table info.</p>
+ retrieve the index types part of the table info.</p>
+
+ <marker id="get_table_info"></marker>
</desc>
</func>
+
+ <func>
+ <name>get_table_info(Name, Item) -> table_info_result()</name>
+ <fsummary>Get table info item of MIB table <c>Name</c></fsummary>
+ <type>
+ <v>Name = name()</v>
+ <v>Item = table_item() | all</v>
+ <v>table_item() = nbr_of_cols | defvals | status_col | not_accessible |
+ index_types | first_accessible | first_own_index</v>
+ <v>table_info_result() = Value | [{table_item(), Value}]</v>
+ <v>Value = term()</v>
+ </type>
+ <desc>
+ <p>Get a specific table info item or, if <c>Item</c> has the
+ value <c>all</c>, a two tuple list (property list) is instead
+ returned with all the items and their respctive values of the
+ given table. </p>
+
+ <p>This function can be used in instrumentation functions to
+ retrieve a given part of the table info.</p>
+
+ <marker id="table_func"></marker>
+ </desc>
+ </func>
+
<func>
<name>table_func(Op1, NameDb)</name>
<name>table_func(Op2, RowIndex, Cols, NameDb) -> Ret</name>
@@ -190,8 +225,11 @@ value() = term()
<p>The function returns according to the specification of an
instrumentation function.
</p>
+
+ <marker id="table_get_elements"></marker>
</desc>
</func>
+
<func>
<name>table_get_elements(NameDb, RowIndex, Cols) -> Values</name>
<fsummary>Get elements in a table row</fsummary>
@@ -204,8 +242,11 @@ value() = term()
<desc>
<p>Returns a list with values for all columns in <c>Cols</c>.
If a column is undefined, its value is <c>noinit</c>.</p>
+
+ <marker id="table_next"></marker>
</desc>
</func>
+
<func>
<name>table_next(NameDb, RestOid) -> RowIndex | endOfTable</name>
<fsummary>Find the next row in the table</fsummary>
@@ -217,8 +258,11 @@ value() = term()
<desc>
<p>Finds the indices of the next row in the table. <c>RestOid</c>
does not have to specify an existing row.</p>
+
+ <marker id="table_row_exists"></marker>
</desc>
</func>
+
<func>
<name>table_row_exists(NameDb, RowIndex) -> bool()</name>
<fsummary>Check if a row in a table exists</fsummary>
@@ -228,8 +272,11 @@ value() = term()
</type>
<desc>
<p>Checks if a row in a table exists.</p>
+
+ <marker id="table_set_elements"></marker>
</desc>
</func>
+
<func>
<name>table_set_elements(NameDb, RowIndex, Cols) -> bool()</name>
<fsummary>Set elements in a table row</fsummary>
@@ -246,8 +293,11 @@ value() = term()
<c>mnesia:write</c> to store the values. This means that
this function must be called from within a transaction
(<c>mnesia:transaction/1</c> or <c>mnesia:dirty/1</c>).</p>
+
+ <marker id="variable_func"></marker>
</desc>
</func>
+
<func>
<name>variable_func(Op1, NameDb)</name>
<name>variable_func(Op2, Val, NameDb) -> Ret</name>
@@ -268,8 +318,11 @@ value() = term()
the database. </p>
<p>The function returns according to the specification of an
instrumentation function. </p>
+
+ <marker id="variable_get"></marker>
</desc>
</func>
+
<func>
<name>variable_get(NameDb) -> {value, Value} | undefined</name>
<fsummary>Get the value of a variable</fsummary>
@@ -279,8 +332,11 @@ value() = term()
</type>
<desc>
<p>Gets the value of a variable.</p>
+
+ <marker id="variable_set"></marker>
</desc>
</func>
+
<func>
<name>variable_set(NameDb, NewVal) -> true | false</name>
<fsummary>Set a value for a variable</fsummary>
@@ -299,6 +355,7 @@ value() = term()
</funcs>
<section>
+ <marker id="example"></marker>
<title>Example</title>
<p>The following example shows an implementation of a table which is
stored in Mnesia, but with some checks performed at set-request
diff --git a/lib/snmp/doc/src/snmp_manager_netif.xml b/lib/snmp/doc/src/snmp_manager_netif.xml
index 2738ca76c1..169e20d10b 100644
--- a/lib/snmp/doc/src/snmp_manager_netif.xml
+++ b/lib/snmp/doc/src/snmp_manager_netif.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -35,31 +35,34 @@
<image file="snmp_manager_netif_1.gif">
<icaption>The Purpose of Manager Net if</icaption>
</image>
+
<p>The Network Interface (Net if) process delivers SNMP PDUs to the
- manager server, and receives SNMP PDUs from the manager server.
- The most common behaviour of a Net if process is that is receives
- request PDU from the manager server, encodes the PDU into bytes
- and transmits the bytes onto the network to an agent. When the
- reply from the agent is received by the Net if process, which it
- decodes into an SNMP PDU, which it sends to the manager server.
- </p>
+ manager server, and receives SNMP PDUs from the manager server.
+ The most common behaviour of a Net if process is that is receives
+ request PDU from the manager server, encodes the PDU into bytes
+ and transmits the bytes onto the network to an agent. When the
+ reply from the agent is received by the Net if process, which it
+ decodes into an SNMP PDU, which it sends to the manager server. </p>
+
<p>However, that simple behaviour can be modified in numerous
- ways. For example, the Net if process can apply some kind of
- encrypting/decrypting scheme on the bytes.
- </p>
- <p>It is also possible to write your own Net if process. The default
- Net if process is implemented in the module <c>snmpm_net_if</c> and
- it uses UDP as the transport protocol.
- </p>
- <p>This section describes how to write a Net if process.
- </p>
+ ways. For example, the Net if process can apply some kind of
+ encrypting/decrypting scheme on the bytes. </p>
+
+ <p>The snmp application provides two different modules,
+ <c>snmpm_net_if</c> (the default) and <c>snmpm_net_if_mt</c>,
+ both uses the UDP as the transport protocol. The difference
+ between the two modules is that the latter is "multi-threaded",
+ i.e. for each message/request a new process is created that
+ process the message/request and then exits. </p>
+
+ <p>It is also possible to write your own Net if process,
+ this section describes how to write a Net if processdo that.</p>
<section>
<marker id="mandatory_functions"></marker>
<title>Mandatory Functions</title>
<p>A Net if process must implement the SNMP manager
- <seealso marker="snmpm_network_interface">network interface behaviour</seealso>.
- </p>
+ <seealso marker="snmpm_network_interface">network interface behaviour</seealso>. </p>
</section>
<section>
diff --git a/lib/snmp/doc/src/snmpa.xml b/lib/snmp/doc/src/snmpa.xml
index 2322af28cc..86fde03205 100644
--- a/lib/snmp/doc/src/snmpa.xml
+++ b/lib/snmp/doc/src/snmpa.xml
@@ -501,6 +501,7 @@ notification_delivery_info() = #snmpa_notification_delivery_info{}
</func>
<func>
+ <name>log_to_txt(LogDir)</name>
<name>log_to_txt(LogDir, Mibs)</name>
<name>log_to_txt(LogDir, Mibs, OutFile) -> ok | {error, Reason}</name>
<name>log_to_txt(LogDir, Mibs, OutFile, LogName) -> ok | {error, Reason}</name>
@@ -528,6 +529,37 @@ notification_delivery_info() = #snmpa_notification_delivery_info{}
See <seealso marker="snmp#log_to_txt">snmp:log_to_txt</seealso>
for more info.</p>
+ <marker id="log_to_io"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>log_to_io(LogDir) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile, Start) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) -> ok | {error, Reason}</name>
+ <fsummary>Convert an Audit Trail Log to text format</fsummary>
+ <type>
+ <v>LogDir = string()</v>
+ <v>Mibs = [MibName]</v>
+ <v>MibName = string()</v>
+ <v>LogName = string()</v>
+ <v>LogFile = string()</v>
+ <v>Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} </v>
+ <v>Reason = disk_log_open_error() | file_open_error() | term()</v>
+ <v>disk_log_open_error() = {LogName, term()}</v>
+ <v>file_open_error() = {OutFile, term()}</v>
+ </type>
+ <desc>
+ <p>Converts an Audit Trail Log to a readable format and
+ prints it on stdio.
+ <c>LogName</c> defaults to "snmpa_log".
+ <c>LogFile</c> defaults to "snmpa.log".
+ See <seealso marker="snmp#log_to_io">snmp:log_to_io</seealso>
+ for more info.</p>
+
<marker id="change_log_size"></marker>
</desc>
</func>
diff --git a/lib/snmp/doc/src/snmpa_network_interface_filter.xml b/lib/snmp/doc/src/snmpa_network_interface_filter.xml
index 10419517dd..bff0a24879 100644
--- a/lib/snmp/doc/src/snmpa_network_interface_filter.xml
+++ b/lib/snmp/doc/src/snmpa_network_interface_filter.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2007</year><year>2010</year>
+ <year>2007</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -84,7 +84,9 @@
<title>DATA TYPES</title>
<code type="none">
port() = integer() > 0
-pdu_type() = 'get-request' | 'get-next-request' | 'get-response' | 'set-request' | trap | 'get-bulk-request' | 'inform-request' | report
+pdu_type() = 'get-request' | 'get-next-request' | 'get-response' |
+ 'set-request' | trap | 'get-bulk-request' | 'inform-request' |
+ report
</code>
<marker id="accept_recv"></marker>
</section>
diff --git a/lib/snmp/doc/src/snmpm.xml b/lib/snmp/doc/src/snmpm.xml
index c36a1b2a24..8ab3be8e18 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -173,16 +173,16 @@ sec_level() = noAuthNoPriv | authNoPriv | authPriv
</type>
<desc>
<p>Register the manager entity (=user) responsible for specific
- agent(s). </p>
+ agent(s). </p>
<p><c>Module</c> is the callback module (snmpm_user behaviour) which
- will be called whenever something happens (detected
- agent, incoming reply or incoming trap/notification).
- Note that this could have already been done as a
- consequence of the node config. (see users.conf).</p>
+ will be called whenever something happens (detected
+ agent, incoming reply or incoming trap/notification).
+ Note that this could have already been done as a
+ consequence of the node config. (see users.conf).</p>
- <p>The argument <c>DefaultAgentConfig</c> is used as default values when
- this user register agents.</p>
+ <p>The argument <c>DefaultAgentConfig</c> is used as default
+ values when this user register agents.</p>
<p>The type of <c>Val</c> depends on <c>Item</c>: </p>
<code type="none"><![CDATA[
@@ -1237,6 +1237,38 @@ priv_key = [integer()] (length is 16 if priv = usmDESPrivProtocol | usmAesCfb1
See <seealso marker="snmp#log_to_txt">snmp:log_to_txt</seealso>
for more info.</p>
+ <marker id="log_to_io"></marker>
+ </desc>
+ </func>
+
+ <func>
+ <name>log_to_io(LogDir) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile, Start) -> ok | {error, Reason}</name>
+ <name>log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) -> ok | {error, Reason}</name>
+ <fsummary>Convert an Audit Trail Log to text format</fsummary>
+ <type>
+ <v>LogDir = string()</v>
+ <v>Mibs = [MibName]</v>
+ <v>MibName = string()</v>
+ <v>LogName = string()</v>
+ <v>LogFile = string()</v>
+ <v>Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} </v>
+ <v>Reason = disk_log_open_error() | file_open_error() | term()</v>
+ <v>disk_log_open_error() = {LogName, term()}</v>
+ <v>file_open_error() = {OutFile, term()}</v>
+ </type>
+ <desc>
+ <p>Converts an Audit Trail Log to a readable format and
+ prints it on stdio.
+ <c>LogName</c> defaults to "snmpm_log".
+ <c>LogFile</c> defaults to "snmpm.log".
+ See <seealso marker="snmp#log_to_io">snmp:log_to_io</seealso>
+ for more info.</p>
+
<marker id="change_log_size"></marker>
</desc>
</func>
diff --git a/lib/snmp/doc/src/snmpm_network_interface_filter.xml b/lib/snmp/doc/src/snmpm_network_interface_filter.xml
index ea1e183848..4dc133dd71 100644
--- a/lib/snmp/doc/src/snmpm_network_interface_filter.xml
+++ b/lib/snmp/doc/src/snmpm_network_interface_filter.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2007</year><year>2009</year>
+ <year>2007</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -72,16 +72,19 @@
</list>
<p>Note that the network interface filter is something which is used
by the network interface implementation provided by the application
- (<c>snmpm_net_if</c>). The default filter accepts all messages.</p>
+ (<c>snmpm_net_if</c> and <c>snmpm_net_if_mt</c>).
+ The default filter accepts all messages.</p>
<p>A network interface filter can e.g. be used during testing or for load
- regulation. </p>
+ regulation. </p>
</description>
<section>
<title>DATA TYPES</title>
<code type="none">
port() = integer() > 0
-pdu_type() = 'get-request' | 'get-next-request' | 'get-response' | 'set-request' | trap | 'get-bulk-request' | 'inform-request' | report | trappdu
+pdu_type() = 'get-request' | 'get-next-request' | 'get-response' |
+ 'set-request' | trap | 'get-bulk-request' | 'inform-request' |
+ report | trappdu
</code>
<marker id="accept_recv"></marker>
</section>
diff --git a/lib/snmp/examples/ex1/Makefile b/lib/snmp/examples/ex1/Makefile
index 1a55ba0470..8d10476b30 100644
--- a/lib/snmp/examples/ex1/Makefile
+++ b/lib/snmp/examples/ex1/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -46,7 +46,7 @@ ERL_COMPILE_FLAGS += -I../include \
# Release directory specification
# ----------------------------------------------------
RELSYSDIR = $(RELEASE_PATH)/lib/snmp-$(VSN)
-EXAMPLE_RELSYSDIR = $(RELSYSDIR)/examples
+EXAMPLE_RELSYSDIR = "$(RELSYSDIR)/examples"
EX1_RELSYSDIR = $(EXAMPLE_RELSYSDIR)/ex1
# ----------------------------------------------------
diff --git a/lib/snmp/examples/ex2/Makefile b/lib/snmp/examples/ex2/Makefile
index 7fbd7f530b..a85ff8e4e2 100644
--- a/lib/snmp/examples/ex2/Makefile
+++ b/lib/snmp/examples/ex2/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2009. All Rights Reserved.
+# Copyright Ericsson AB 2006-2012. 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
@@ -47,7 +47,7 @@ ERL_COMPILE_FLAGS += -I../include \
# Release directory specification
# ----------------------------------------------------
RELSYSDIR = $(RELEASE_PATH)/lib/snmp-$(VSN)
-EXAMPLE_RELSYSDIR = $(RELSYSDIR)/examples
+EXAMPLE_RELSYSDIR = "$(RELSYSDIR)/examples"
EX2_RELSYSDIR = $(EXAMPLE_RELSYSDIR)/ex2
# ----------------------------------------------------
diff --git a/lib/snmp/examples/ex2/snmp_ex2_manager.erl b/lib/snmp/examples/ex2/snmp_ex2_manager.erl
index ff873327bc..1b247d713d 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -39,7 +39,7 @@
%% Manager callback API:
-export([handle_error/3,
- handle_agent/4,
+ handle_agent/5,
handle_pdu/4,
handle_trap/3,
handle_inform/3,
@@ -265,16 +265,17 @@ handle_snmp_callback(handle_error, {ReqId, Reason}) ->
"~n Reason: ~p"
"~n", [ReqId, Reason]),
ok;
-handle_snmp_callback(handle_agent, {Addr, Port, SnmpInfo}) ->
+handle_snmp_callback(handle_agent, {Addr, Port, Type, SnmpInfo}) ->
{ES, EI, VBs} = SnmpInfo,
io:format("*** UNKNOWN AGENT ***"
"~n Address: ~p"
"~n Port: ~p"
+ "~n Type: ~p"
"~n SNMP Info: "
"~n Error Status: ~w"
"~n Error Index: ~w"
"~n Varbinds: ~p"
- "~n", [Addr, Port, ES, EI, VBs]),
+ "~n", [Addr, Port, Type, ES, EI, VBs]),
ok;
handle_snmp_callback(handle_pdu, {TargetName, ReqId, SnmpResponse}) ->
{ES, EI, VBs} = SnmpResponse,
@@ -382,8 +383,8 @@ handle_error(ReqId, Reason, Server) when is_pid(Server) ->
ignore.
-handle_agent(Addr, Port, SnmpInfo, Server) when is_pid(Server) ->
- report_callback(Server, handle_agent, {Addr, Port, SnmpInfo}),
+handle_agent(Addr, Port, Type, SnmpInfo, Server) when is_pid(Server) ->
+ report_callback(Server, handle_agent, {Addr, Port, Type, SnmpInfo}),
ignore.
diff --git a/lib/snmp/include/snmp_types.hrl b/lib/snmp/include/snmp_types.hrl
index 4adb24361c..399379a49b 100644
--- a/lib/snmp/include/snmp_types.hrl
+++ b/lib/snmp/include/snmp_types.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -78,23 +78,36 @@
%%-----------------------------------------------------------------
%% TableInfo - stored in snmp_symbolic_store for use by the
-%% generic table functions.
+%% generic table functions. For an ordinary table, the
+%% types will be the following:
%% nbr_of_cols is an integer
+%% pos_integer()
%% defvals is a list of {Col, Defval}, ordered by column
%% number
+%% [{Col :: integer(), Defval :: term()}]
%% status_col is an integer
+%% pos_integer()
%% not_accessible a sorted list of columns (> first_accessible)
%% that are 'not-accessible'
-%% indextypes is a list of #asn1_type for the index-columns,
-%% ordered by column number
-%% first_accessible is an integer, the first non-accessible
-%% column
+%% [pos_integer()]
+%% index_types is a list of #asn1_type for the index-columns,
+%% ordered by column number or an "augment"-tuple
+%% [asn1_type()]
+%% first_accessible is an integer, the first accessible column
+%% pos_integer()
%% first_own_index is an integer. 0 if there is no such index for
%% this table.
%% This is not the same as the last integer in the oid!
%% Example: If a table has one own index (oid.1), one
%% column (oid.2) and one imported index then
%% first_own_index will be 2.
+%% non_neg_integer()
+%% For a augmented table, it will instead look like this:
+%% index_types {augments, {atom(), asn1_type()}}
+%% nbr_of_cols pos_integer()
+%% not_accessible [pos_integer()]
+%% first_accessible pos_integer()
+%%
%%-----------------------------------------------------------------
-record(table_info,
@@ -192,7 +205,7 @@
%%----------------------------------------------------------------------
-record(mib,
{misc = [],
- mib_format_version = "3.2",
+ mib_format_version = "3.3",
name = "",
module_identity, %% Not in SMIv1, and only with +module_identity
mes = [],
diff --git a/lib/snmp/mibs/Makefile.in b/lib/snmp/mibs/Makefile.in
index 993a67c6f2..5c1f855fad 100644
--- a/lib/snmp/mibs/Makefile.in
+++ b/lib/snmp/mibs/Makefile.in
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -211,7 +211,7 @@ info:
@echo ""
@echo "SNMP_VSN = $(SNMP_VSN)"
@echo "VSN = $(VSN)"
- @echo "RELSYSDIR = $(RELSYSDIR)"
+ @echo "RELSYSDIR = "$(RELSYSDIR)""
v1/%.mib.v1: %.mib $(ERL_TOP)/lib/snmp/bin/snmp-v2tov1
$(ERL_TOP)/lib/snmp/bin/snmp-v2tov1 -o $@ $<
@@ -223,17 +223,17 @@ v1/%.mib.v1: %.mib $(ERL_TOP)/lib/snmp/bin/snmp-v2tov1
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/mibs
- $(INSTALL_DIR) $(RELSYSDIR)/mibs/v1
- $(INSTALL_DATA) $(MIB_FILES) $(RELSYSDIR)/mibs
- $(INSTALL_DATA) $(STD_v2_MIB_FILES) $(RELSYSDIR)/mibs
- $(INSTALL_DATA) $(FUNCS_FILES) $(RELSYSDIR)/mibs
- $(INSTALL_DATA) $(STD_v1_MIB_FILES) $(RELSYSDIR)/mibs/v1
- $(INSTALL_DATA) $(V1_MIB_FILES) $(RELSYSDIR)/mibs/v1
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/priv/mibs
- $(INSTALL_DATA) $(BIN_TARGETS) $(RELSYSDIR)/priv/mibs
+ $(INSTALL_DIR) "$(RELSYSDIR)/mibs"
+ $(INSTALL_DIR) "$(RELSYSDIR)/mibs/v1"
+ $(INSTALL_DATA) $(MIB_FILES) "$(RELSYSDIR)/mibs"
+ $(INSTALL_DATA) $(STD_v2_MIB_FILES) "$(RELSYSDIR)/mibs"
+ $(INSTALL_DATA) $(FUNCS_FILES) "$(RELSYSDIR)/mibs"
+ $(INSTALL_DATA) $(STD_v1_MIB_FILES) "$(RELSYSDIR)/mibs/v1"
+ $(INSTALL_DATA) $(V1_MIB_FILES) "$(RELSYSDIR)/mibs/v1"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/mibs"
+ $(INSTALL_DATA) $(BIN_TARGETS) "$(RELSYSDIR)/priv/mibs"
release_docs_spec:
diff --git a/lib/snmp/priv/conf/agent/Makefile b/lib/snmp/priv/conf/agent/Makefile
index ee3a915c2b..3082889dc8 100644
--- a/lib/snmp/priv/conf/agent/Makefile
+++ b/lib/snmp/priv/conf/agent/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -55,9 +55,9 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/conf
- $(INSTALL_DIR) $(RELSYSDIR)/priv/conf/agent
- $(INSTALL_DATA) $(CONF_FILES) $(RELSYSDIR)/priv/conf/agent
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/conf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/conf/agent"
+ $(INSTALL_DATA) $(CONF_FILES) "$(RELSYSDIR)/priv/conf/agent"
release_docs_spec:
diff --git a/lib/snmp/priv/conf/manager/Makefile b/lib/snmp/priv/conf/manager/Makefile
index 16355f0ff3..a04c227754 100644
--- a/lib/snmp/priv/conf/manager/Makefile
+++ b/lib/snmp/priv/conf/manager/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -55,9 +55,9 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv/conf
- $(INSTALL_DIR) $(RELSYSDIR)/priv/conf/manager
- $(INSTALL_DATA) $(CONF_FILES) $(RELSYSDIR)/priv/conf/manager
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/conf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/conf/manager"
+ $(INSTALL_DATA) $(CONF_FILES) "$(RELSYSDIR)/priv/conf/manager"
release_docs_spec:
diff --git a/lib/snmp/src/agent/Makefile b/lib/snmp/src/agent/Makefile
index a67fe4d17c..beed696648 100644
--- a/lib/snmp/src/agent/Makefile
+++ b/lib/snmp/src/agent/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -128,14 +128,14 @@ info:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/agent
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/src/agent
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/agent"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/src/agent"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) \
- $(RELSYSDIR)/ebin
-# $(INSTALL_DIR) $(RELSYSDIR)/include
-# $(INSTALL_DATA) $(EXT_HRL_FILES) $(RELSYSDIR)/include
+ "$(RELSYSDIR)/ebin"
+# $(INSTALL_DIR) "$(RELSYSDIR)/include"
+# $(INSTALL_DATA) $(EXT_HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/snmp/src/agent/depend.mk b/lib/snmp/src/agent/depend.mk
index 078ef15821..ea9261e266 100644
--- a/lib/snmp/src/agent/depend.mk
+++ b/lib/snmp/src/agent/depend.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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/lib/snmp/src/agent/snmp_community_mib.erl b/lib/snmp/src/agent/snmp_community_mib.erl
index 77307aa7ad..7bdd500727 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -28,6 +28,7 @@
-export([add_community/5, add_community/6, delete_community/1]).
-export([check_community/1]).
+-include("snmpa_internal.hrl").
-include("SNMP-COMMUNITY-MIB.hrl").
-include("SNMP-TARGET-MIB.hrl").
-include("SNMPv2-TC.hrl").
@@ -120,10 +121,17 @@ init_tabs(Comms) ->
read_community_config_files(Dir) ->
?vdebug("read community config file",[]),
- Gen = fun(_) -> ok end,
- Filter = fun(Comms) -> Comms end,
- Check = fun(Entry) -> check_community(Entry) end,
- [Comms] =
+ FileName = "community.conf",
+ Gen = fun(D, Reason) ->
+ warning_msg("failed reading config file ~s"
+ "~n Config Dir: ~s"
+ "~n Reason: ~p",
+ [FileName, D, Reason]),
+ ok
+ end,
+ Filter = fun(Comms) -> Comms end,
+ Check = fun(Entry) -> check_community(Entry) end,
+ [Comms] =
snmp_conf:read_files(Dir, [{Gen, Filter, Check, "community.conf"}]),
Comms.
@@ -601,5 +609,8 @@ set_sname(_) -> %% Keep it, if already set.
error(Reason) ->
throw({error, Reason}).
+warning_msg(F, A) ->
+ ?snmpa_warning("[COMMUNITY-MIB]: " ++ F, A).
+
config_err(F, A) ->
snmpa_error:config_err("[COMMUNITY-MIB]: " ++ F, A).
diff --git a/lib/snmp/src/agent/snmp_framework_mib.erl b/lib/snmp/src/agent/snmp_framework_mib.erl
index 0d7866d94d..cc191bd956 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -115,7 +115,9 @@ do_configure(Dir) ->
read_internal_config_files(Dir) ->
?vdebug("read context config file",[]),
- Gen = fun(D) -> convert_context(D) end,
+ Gen = fun(D, Reason) ->
+ convert_context(D, Reason)
+ end,
Filter = fun(Contexts) -> Contexts end,
Check = fun(Entry) -> check_context(Entry) end,
[Ctxs] = snmp_conf:read_files(Dir, [{Gen, Filter, Check, "context.conf"}]),
@@ -123,10 +125,17 @@ read_internal_config_files(Dir) ->
read_agent(Dir) ->
- ?vdebug("read agent config file",[]),
- Check = fun(Entry) -> check_agent(Entry) end,
- File = filename:join(Dir, "agent.conf"),
- Agent = snmp_conf:read(File, Check),
+ ?vdebug("read agent config file", []),
+ FileName = "agent.conf",
+ Check = fun(Entry) -> check_agent(Entry) end,
+ File = filename:join(Dir, FileName),
+ Agent =
+ try
+ snmp_conf:read(File, Check)
+ catch
+ throw:{error, Reason} ->
+ error({failed_reading_config_file, Dir, FileName, Reason})
+ end,
sort_agent(Agent).
@@ -146,9 +155,9 @@ sort_agent(L) ->
%%-----------------------------------------------------------------
%% Generate a context.conf file.
%%-----------------------------------------------------------------
-convert_context(Dir) ->
+convert_context(Dir, _Reason) ->
config_err("missing context.conf file => generating a default file", []),
- File = filename:join(Dir,"context.conf"),
+ File = filename:join(Dir, "context.conf"),
case file:open(File, [write]) of
{ok, Fid} ->
ok = io:format(Fid, "~s\n", [context_header()]),
@@ -165,7 +174,7 @@ context_header() ->
io_lib:format("%% This file was automatically generated by "
"snmp_config v~s ~w-~2.2.0w-~2.2.0w "
"~2.2.0w:~2.2.0w:~2.2.0w\n",
- [?version,Y,Mo,D,H,Mi,S]).
+ [?version, Y, Mo, D, H, Mi, S]).
%%-----------------------------------------------------------------
diff --git a/lib/snmp/src/agent/snmp_generic_mnesia.erl b/lib/snmp/src/agent/snmp_generic_mnesia.erl
index ce42af404b..7fd6501977 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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/lib/snmp/src/agent/snmp_notification_mib.erl b/lib/snmp/src/agent/snmp_notification_mib.erl
index 720ac749b8..37e09f5d3e 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -27,6 +27,7 @@
-export([add_notify/3, delete_notify/1]).
-export([check_notify/1]).
+-include("snmpa_internal.hrl").
-include("SNMP-NOTIFICATION-MIB.hrl").
-include("SNMPv2-TC.hrl").
-include("snmp_tables.hrl").
@@ -104,7 +105,14 @@ do_reconfigure(Dir) ->
read_notify_config_files(Dir) ->
?vdebug("read notify config file",[]),
- Gen = fun(_) -> ok end,
+ FileName = "notify.conf",
+ Gen = fun(D, Reason) ->
+ info_msg("failed reading config file ~s"
+ "~n Config Dir: ~s"
+ "~n Reason: ~p",
+ [FileName, D, Reason]),
+ ok
+ end,
Filter = fun(Notifs) -> Notifs end,
Check = fun(Entry) -> check_notify(Entry) end,
[Notifs] =
@@ -112,7 +120,7 @@ read_notify_config_files(Dir) ->
Notifs.
check_notify({Name, Tag, Type}) ->
- snmp_conf:check_string(Name,{gt,0}),
+ snmp_conf:check_string(Name, {gt, 0}),
snmp_conf:check_string(Tag),
{ok, Val} = snmp_conf:check_atom(Type, [{trap, 1}, {inform, 2}]),
Notify = {Name, Tag, Val,
@@ -451,12 +459,15 @@ set_sname() ->
set_sname(get(sname)).
set_sname(undefined) ->
- put(sname,conf);
+ put(sname, conf);
set_sname(_) -> %% Keep it, if already set.
ok.
error(Reason) ->
throw({error, Reason}).
+info_msg(F, A) ->
+ ?snmpa_info("[NOTIFICATION-MIB]: " ++ F, A).
+
config_err(F, A) ->
snmpa_error:config_err("[NOTIFICATION-MIB]: " ++ F, A).
diff --git a/lib/snmp/src/agent/snmp_standard_mib.erl b/lib/snmp/src/agent/snmp_standard_mib.erl
index b6834d278c..766b75022b 100644
--- a/lib/snmp/src/agent/snmp_standard_mib.erl
+++ b/lib/snmp/src/agent/snmp_standard_mib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -143,20 +143,35 @@ do_reconfigure(Dir) ->
%% Func: read_standard/1
%% Args: Dir is the directory with trailing dir_separator where
%% the configuration files can be found.
-%% Purpose: Reads th standard configuration file.
+%% Purpose: Reads the standard configuration file.
%% Returns: A list of standard variables
%% Fails: If an error occurs, the process will die with Reason
%% configuration_error.
+%% This file is mandatory, as it contains mandatory
+%% config options for which there are no default values.
%%-----------------------------------------------------------------
read_standard(Dir) ->
?vdebug("check standard config file",[]),
- Gen = fun(_) -> ok end,
- Filter = fun(Standard) -> sort_standard(Standard) end,
- Check = fun(Entry) -> check_standard(Entry) end,
+ FileName = "standard.conf",
+ Gen = fun(D, Reason) ->
+ throw({error, {failed_reading_config_file,
+ D, FileName,
+ list_dir(Dir), Reason}})
+ end,
+ Filter = fun(Standard) -> sort_standard(Standard) end,
+ Check = fun(Entry) -> check_standard(Entry) end,
[Standard] =
- snmp_conf:read_files(Dir, [{Gen, Filter, Check, "standard.conf"}]),
+ snmp_conf:read_files(Dir, [{Gen, Filter, Check, FileName}]),
Standard.
+list_dir(Dir) ->
+ case file:list_dir(Dir) of
+ {ok, Files} ->
+ Files;
+ Error ->
+ Error
+ end.
+
%%-----------------------------------------------------------------
%% Make sure that each mandatory standard attribute is present, and
@@ -548,6 +563,7 @@ snmp_set_serial_no(set, NewVal) ->
snmp_generic:variable_func(set, (NewVal + 1) rem 2147483648,
{snmpSetSerialNo, volatile}).
+
%%-----------------------------------------------------------------
%% This is the instrumentation function for sysOrTable
%%-----------------------------------------------------------------
@@ -588,4 +604,4 @@ error(Reason) ->
throw({error, Reason}).
config_err(F, A) ->
- snmpa_error:config_err("[STANDARD-MIB]: " ++ F, A).
+ snmpa_error:config_err("[STANDARD-MIB] " ++ F, A).
diff --git a/lib/snmp/src/agent/snmp_target_mib.erl b/lib/snmp/src/agent/snmp_target_mib.erl
index a45db89c09..b01d536caa 100644
--- a/lib/snmp/src/agent/snmp_target_mib.erl
+++ b/lib/snmp/src/agent/snmp_target_mib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -132,12 +132,12 @@ do_reconfigure(Dir) ->
read_target_config_files(Dir) ->
- ?vdebug("check target address config file",[]),
- TAGen = fun(_D) -> ok end,
+ ?vdebug("check target address and parameter config file(s)",[]),
+ TAGen = fun(_D, _Reason) -> ok end,
TAFilter = fun(Addr) -> Addr end,
TACheck = fun(Entry) -> check_target_addr(Entry) end,
- TPGen = fun(_D) -> ok end,
+ TPGen = fun(_D, _Reason) -> ok end,
TPFilter = fun(Params) -> Params end,
TPCheck = fun(Entry) -> check_target_params(Entry) end,
diff --git a/lib/snmp/src/agent/snmp_user_based_sm_mib.erl b/lib/snmp/src/agent/snmp_user_based_sm_mib.erl
index 69cebc858b..3c4ba1af66 100644
--- a/lib/snmp/src/agent/snmp_user_based_sm_mib.erl
+++ b/lib/snmp/src/agent/snmp_user_based_sm_mib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -54,6 +54,7 @@
%% Columns not accessible via SNMP
-define(usmUserAuthKey, 14).
-define(usmUserPrivKey, 15).
+-define(is_cloning, 16).
%%%-----------------------------------------------------------------
@@ -136,7 +137,7 @@ do_reconfigure(Dir) ->
read_usm_config_files(Dir) ->
?vdebug("read usm config file",[]),
- Gen = fun(D) -> generate_usm(D) end,
+ Gen = fun(D, Reason) -> generate_usm(D, Reason) end,
Filter = fun(Usms) -> Usms end,
Check = fun(Entry) -> check_usm(Entry) end,
[Usms] =
@@ -144,7 +145,7 @@ read_usm_config_files(Dir) ->
Usms.
-generate_usm(Dir) ->
+generate_usm(Dir, _Reason) ->
info_msg("Incomplete configuration. Generating empty usm.conf.", []),
USMFile = filename:join(Dir, "usm.conf"),
ok = file:write_file(USMFile, list_to_binary([])).
@@ -564,7 +565,9 @@ usmUserTable(set, RowIndex, Cols0) ->
{ok, Cols} ->
?vtrace("usmUserTable(set) -> verified"
"~n Cols: ~p", [Cols]),
- NCols = pre_set(RowIndex, Cols),
+ % check whether we're cloning. if so, get cloned params and add a few
+ % defaults that might be needed.
+ NCols = pre_set(RowIndex, validate_clone_from(RowIndex, Cols)),
?vtrace("usmUserTable(set) -> pre-set: "
"~n NCols: ~p", [NCols]),
%% NOTE: The NCols parameter is sent to snmp_generic, but not to
@@ -730,30 +733,40 @@ validate_is_set_ok(Error, _RowIndex, _Cols) ->
Error.
do_validate_is_set_ok(RowIndex, Cols) ->
- validate_clone_from(RowIndex, Cols),
- validate_auth_protocol(RowIndex, Cols),
- validate_auth_key_change(RowIndex, Cols),
- validate_own_auth_key_change(RowIndex, Cols),
- validate_priv_protocol(RowIndex, Cols),
- validate_priv_key_change(RowIndex, Cols),
- validate_own_priv_key_change(RowIndex, Cols),
+ NCols = validate_clone_from(RowIndex, Cols),
+ validate_auth_protocol(RowIndex, NCols),
+ validate_auth_key_change(RowIndex, NCols),
+ validate_own_auth_key_change(RowIndex, NCols),
+ validate_priv_protocol(RowIndex, NCols),
+ validate_priv_key_change(RowIndex, NCols),
+ validate_own_priv_key_change(RowIndex, NCols),
ok.
pre_set(RowIndex, Cols) ->
+ %% Remove the ?is_cloning member again; it must no longer be
+ %% present.
+ Cols0 = key1delete(?is_cloning, Cols),
%% Possibly initialize the usmUserSecurityName and privacy keys
case snmp_generic:table_row_exists(db(usmUserTable), RowIndex) of
- true -> Cols;
+ true -> Cols0;
false ->
SecName = get_user_name(RowIndex),
- [{?usmUserSecurityName, SecName} | Cols] ++
- [{?usmUserAuthKey, ""},
- {?usmUserPrivKey, ""}]
+ Cols1 = [{?usmUserSecurityName, SecName} | Cols0],
+ case proplists:get_value(?is_cloning, Cols) of
+ true ->
+ % the row is just being cloned. the cloned user's
+ % passwords are already present in Cols and must
+ % not be overwritten.
+ Cols1;
+ _ ->
+ Cols1 ++ [{?usmUserAuthKey, ""},
+ {?usmUserPrivKey, ""}]
+ end
end.
validate_set({noError, 0}, RowIndex, Cols) ->
%% Now, all is_set_ok validation steps have been executed. So
%% everything is ready for the set.
- set_clone_from(RowIndex, Cols),
set_auth_key_change(RowIndex, Cols),
set_own_auth_key_change(RowIndex, Cols),
set_priv_key_change(RowIndex, Cols),
@@ -769,7 +782,7 @@ validate_set(Error, _RowIndex, _Cols) ->
%% no further checks.
%%-----------------------------------------------------------------
validate_clone_from(RowIndex, Cols) ->
- case lists:keysearch(?usmUserCloneFrom, 1, Cols) of
+ case key1search(?usmUserCloneFrom, Cols) of
{value, {_Col, RowPointer}} ->
RowIndex2 = extract_row(RowPointer),
OldCloneFrom = snmp_generic:table_get_element(db(usmUserTable),
@@ -778,35 +791,63 @@ validate_clone_from(RowIndex, Cols) ->
case OldCloneFrom of
{value, Val} when Val /= noinit ->
%% This means that the cloning is already done...
- ok;
+ no_cloning(Cols);
_ ->
- %% Otherwise, we must check the CloneFrom value
- case snmp_generic:table_get_element(db(usmUserTable),
- RowIndex2,
- ?usmUserStatus) of
- {value, ?'RowStatus_active'} -> ok;
- _ -> inconsistentName(?usmUserCloneFrom)
- end
+ %% Otherwise, we must check the CloneFrom value. It
+ %% must relate to a usmUserEntry that exists and is active.
+ case snmp_generic:table_get_row(db(usmUserTable), RowIndex2) of
+ CloneFromRow when is_tuple(CloneFromRow) ->
+ case element(?usmUserStatus, CloneFromRow) of
+ ?'RowStatus_active' ->
+ get_cloned_cols(CloneFromRow, Cols);
+ _ ->
+ inconsistentName(?usmUserCloneFrom)
+ end;
+ undefined ->
+ inconsistentName(?usmUserCloneFrom)
+ end
end;
false ->
- ok
+ % no ?usmUserCloneFrom specified, don't modify columns
+ no_cloning(Cols)
end.
+get_cloned_cols(CloneFromRow, Cols) ->
+ % initialize cloned columns with data from CloneFromRow
+ % and overwrite that again with data found in Cols
+ AuthP = element(?usmUserAuthProtocol, CloneFromRow),
+ PrivP = element(?usmUserPrivProtocol, CloneFromRow),
+ AuthK = element(?usmUserAuthKey, CloneFromRow),
+ PrivK = element(?usmUserPrivKey, CloneFromRow),
+ ClonedCols = [{?usmUserAuthProtocol, AuthP},
+ {?usmUserPrivProtocol, PrivP},
+ {?usmUserAuthKey, AuthK},
+ {?usmUserPrivKey, PrivK},
+ {?is_cloning, true}
+ ],
+ Func = fun({Col, _} = Item, NCols) ->
+ key1store(Col, NCols, Item)
+ end,
+ Cols1 = lists:foldl(Func, ClonedCols, Cols),
+ key1sort(Cols1).
+
+no_cloning(Cols0) ->
+ Cols1 = key1delete(?usmUserCloneFrom, Cols0),
+ key1delete(?is_cloning, Cols1).
+
validate_auth_protocol(RowIndex, Cols) ->
- case lists:keysearch(?usmUserAuthProtocol, 1, Cols) of
+ case key1search(?usmUserAuthProtocol, Cols) of
{value, {_Col, AuthProtocol}} ->
- %% Check if the row has been cloned; we can't check the
+ %% Check if the row is being cloned; we can't check the
%% old value of authProtocol, because if the row was
%% createAndWaited, the default value would have been
%% written (usmNoAuthProtocol).
- OldCloneFrom = snmp_generic:table_get_element(db(usmUserTable),
- RowIndex,
- ?usmUserCloneFrom),
- case OldCloneFrom of
- {value, Val} when Val /= noinit ->
- %% This means that the cloning is already done; set is ok
- %% if new protocol is usmNoAuthProtocol
+ IsCloning = proplists:get_value(?is_cloning, Cols, false),
+ if
+ not IsCloning ->
+ %% This means that the row is not being cloned right
+ %% now; set is ok if new protocol is usmNoAuthProtocol
case AuthProtocol of
?usmNoAuthProtocol ->
%% Check that the Priv protocl is noPriv
@@ -821,7 +862,7 @@ validate_auth_protocol(RowIndex, Cols) ->
_ ->
wrongValue(?usmUserAuthProtocol)
end;
- _ ->
+ true ->
%% Otherwise, check that the new protocol is known,
%% and that the system we're running supports the
%% hash function.
@@ -867,7 +908,7 @@ validate_own_priv_key_change(RowIndex, Cols) ->
%% Check that the requesting user is the same as the modified user
validate_requester(RowIndex, Cols, KeyChangeCol) ->
- case lists:keysearch(KeyChangeCol, 1, Cols) of
+ case key1search(KeyChangeCol, Cols) of
{value, _} ->
case get(sec_model) of % Check the securityModel in the request
?SEC_USM -> ok;
@@ -890,17 +931,14 @@ validate_requester(RowIndex, Cols, KeyChangeCol) ->
end.
validate_key_change(RowIndex, Cols, KeyChangeCol, Type) ->
- case lists:keysearch(KeyChangeCol, 1, Cols) of
+ case key1search(KeyChangeCol, Cols) of
{value, {_Col, KeyC}} ->
%% Check if the row has been cloned; or if it is cloned in
%% this set-operation.
OldCloneFrom = snmp_generic:table_get_element(db(usmUserTable),
RowIndex,
?usmUserCloneFrom),
- IsClonePresent = case lists:keysearch(?usmUserCloneFrom, 1, Cols) of
- {value, _} -> true;
- false -> false
- end,
+ IsClonePresent = proplists:get_value(?is_cloning, Cols, false),
%% Set is ok if 1) the user already is created, 2) this is
%% a new user, which has been cloned, or is about to be
%% cloned.
@@ -912,7 +950,7 @@ validate_key_change(RowIndex, Cols, KeyChangeCol, Type) ->
%% The user is cloned in this operation
ok;
_ ->
- %% The user doen't exist, or hasn't been cloned,
+ %% The user doesn't exist, or hasn't been cloned,
%% and is not cloned in this operation.
inconsistentName(KeyChangeCol)
end,
@@ -939,17 +977,15 @@ validate_key_change(RowIndex, Cols, KeyChangeCol, Type) ->
end.
validate_priv_protocol(RowIndex, Cols) ->
- case lists:keysearch(?usmUserPrivProtocol, 1, Cols) of
+ case key1search(?usmUserPrivProtocol, Cols) of
{value, {_Col, PrivProtocol}} ->
%% Check if the row has been cloned; we can't check the
%% old value of privhProtocol, because if the row was
%% createAndWaited, the default value would have been
%% written (usmNoPrivProtocol).
- OldCloneFrom = snmp_generic:table_get_element(db(usmUserTable),
- RowIndex,
- ?usmUserCloneFrom),
- case OldCloneFrom of
- {value, Val} when Val /= noinit ->
+ IsCloning = proplists:get_value(?is_cloning, Cols, false),
+ if
+ not IsCloning ->
%% This means that the cloning is already done; set is ok
%% if new protocol is usmNoPrivProtocol
case PrivProtocol of
@@ -962,7 +998,7 @@ validate_priv_protocol(RowIndex, Cols) ->
_ ->
wrongValue(?usmUserPrivProtocol)
end;
- _ ->
+ true ->
%% Otherwise, check that the new protocol is known,
%% and that the system we're running supports the
%% crypto function.
@@ -1005,31 +1041,6 @@ validate_priv_protocol(RowIndex, Cols) ->
end.
-set_clone_from(RowIndex, Cols) ->
- %% If CloneFrom is modified, do the cloning.
- case lists:keysearch(?usmUserCloneFrom, 1, Cols) of
- {value, {_Col, RowPointer}} ->
- RowIndex2 = extract_row(RowPointer), % won't fail
- CloneRow = snmp_generic:table_get_row(db(usmUserTable), RowIndex2,
- foi(usmUserTable)),
- AuthP = element(?usmUserAuthProtocol, CloneRow),
- PrivP = element(?usmUserPrivProtocol, CloneRow),
- AuthK = element(?usmUserAuthKey, CloneRow),
- PrivK = element(?usmUserPrivKey, CloneRow),
- SCols = [{?usmUserAuthProtocol, AuthP},
- {?usmUserPrivProtocol, PrivP},
- {?usmUserAuthKey, AuthK},
- {?usmUserPrivKey, PrivK}],
- case snmp_generic:table_set_elements(db(usmUserTable),
- RowIndex,
- SCols) of
- true -> ok;
- false -> {commitFailed, ?usmUserCloneFrom}
- end;
- false ->
- ok
- end.
-
set_auth_key_change(RowIndex, Cols) ->
set_key_change(RowIndex, Cols, ?usmUserAuthKeyChange, auth).
@@ -1043,7 +1054,7 @@ set_own_priv_key_change(RowIndex, Cols) ->
set_key_change(RowIndex, Cols, ?usmUserOwnPrivKeyChange, priv).
set_key_change(RowIndex, Cols, KeyChangeCol, Type) ->
- case lists:keysearch(KeyChangeCol, 1, Cols) of
+ case key1search(KeyChangeCol, Cols) of
{value, {_Col, KeyChange}} ->
KeyCol = case Type of
auth -> ?usmUserAuthKey;
@@ -1071,11 +1082,11 @@ extract_row([H | T], [H | T2]) -> extract_row(T, T2);
extract_row([], [?usmUserSecurityName | T]) -> T;
extract_row(_, _) -> wrongValue(?usmUserCloneFrom).
-%% Pre: the user exixt
+%% Pre: the user exists or is being cloned in this operation
get_auth_proto(RowIndex, Cols) ->
- %% The protocol can be chanegd by the request too, otherwise,
+ %% The protocol can be changed by the request too, otherwise,
%% check the stored protocol.
- case lists:keysearch(?usmUserAuthProtocol, 1, Cols) of
+ case key1search(?usmUserAuthProtocol, Cols) of
{value, {_, Protocol}} ->
Protocol;
false ->
@@ -1090,11 +1101,11 @@ get_auth_proto(RowIndex, Cols) ->
end
end.
-%% Pre: the user exixt
+%% Pre: the user exists or is being cloned in this operation
get_priv_proto(RowIndex, Cols) ->
- %% The protocol can be chanegd by the request too, otherwise,
+ %% The protocol can be changed by the request too, otherwise,
%% check the stored protocol.
- case lists:keysearch(?usmUserPrivProtocol, 1, Cols) of
+ case key1search(?usmUserPrivProtocol, Cols) of
{value, {_, Protocol}} ->
Protocol;
false ->
@@ -1232,6 +1243,27 @@ set_sname(_) -> %% Keep it, if already set.
error(Reason) ->
throw({error, Reason}).
+
+%%-----------------------------------------------------------------
+%% lists key-function(s) wrappers
+
+-compile({inline,key1delete/2}).
+key1delete(Key, List) ->
+ lists:keydelete(Key, 1, List).
+
+-compile({inline,key1search/2}).
+key1search(Key, List) ->
+ lists:keysearch(Key, 1, List).
+
+-compile({inline,key1store/3}).
+key1store(Key, List, Elem) ->
+ lists:keystore(Key, 1, List, Elem).
+
+-compile({inline,key1sort/1}).
+key1sort(List) ->
+ lists:keysort(1, List).
+
+
%%-----------------------------------------------------------------
info_msg(F, A) ->
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 2cee91b081..436f15eb9c 100644
--- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl
+++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl
@@ -115,7 +115,7 @@ do_reconfigure(Dir) ->
read_vacm_config_files(Dir) ->
?vdebug("read vacm config file",[]),
- Gen = fun(_) -> ok end,
+ Gen = fun(_D, _Reason) -> ok end,
Filter = fun(Vacms) ->
Sec2Group = [X || {vacmSecurityToGroup, X} <- Vacms],
Access = [X || {vacmAccess, X} <- Vacms],
@@ -565,45 +565,85 @@ vacmAccessTable(is_set_ok, RowIndex, Cols0) ->
case (catch verify_vacmAccessTable_cols(Cols0, [])) of
{ok, Cols} ->
IsValidKey = is_valid_key(RowIndex),
- case lists:keysearch(?vacmAccessStatus, 1, Cols) of
- %% Ok, if contextMatch is init
- {value, {Col, ?'RowStatus_active'}} ->
- {ok, Row} = snmpa_vacm:get_row(RowIndex),
- case element(?vacmAContextMatch, Row) of
- noinit -> {inconsistentValue, Col};
- _ -> {noError, 0}
+ StatusCol = lists:keyfind(?vacmAccessStatus, 1, Cols),
+ MaybeRow = snmpa_vacm:get_row(RowIndex),
+ case {StatusCol, MaybeRow} of
+ {{Col, ?'RowStatus_active'}, false} ->
+ %% row does not yet exist => inconsistentValue
+ %% (see SNMPv2-TC.mib, RowStatus textual convention)
+ {inconsistentValue, Col};
+ {{Col, ?'RowStatus_active'}, {ok, Row}} ->
+ %% Ok, if contextMatch is init
+ case element(?vacmAContextMatch, Row) of
+ noinit ->
+ %% check whether ContextMatch is being set in
+ %% the same operation
+ case proplists:get_value(?vacmAccessContextMatch,
+ Cols) of
+ undefined ->
+ %% no, we can't make this row active yet
+ {inconsistentValue, Col};
+ _ ->
+ %% ok, activate the row
+ {noError, 0}
+ end;
+ _ ->
+ {noError, 0}
end;
- {value, {Col, ?'RowStatus_notInService'}} -> % Ok, if not notReady
- {ok, Row} = snmpa_vacm:get_row(RowIndex),
+ {{Col, ?'RowStatus_notInService'}, false} ->
+ %% row does not yet exist => inconsistentValue
+ %% (see SNMPv2-TC.mib, RowStatus textual convention)
+ {inconsistentValue, Col};
+ {{Col, ?'RowStatus_notInService'}, {ok, Row}} ->
+ %% Ok, if not notReady
case element(?vacmAStatus, Row) of
- ?'RowStatus_notReady' -> {inconsistentValue, Col};
- _ -> {noError, 0}
+ ?'RowStatus_notReady' ->
+ {inconsistentValue, Col};
+ _ ->
+ {noError, 0}
end;
- {value, {Col, ?'RowStatus_notReady'}} -> % never ok!
+ {{Col, ?'RowStatus_notReady'}, _} ->
+ %% never ok!
{inconsistentValue, Col};
- {value, {Col, ?'RowStatus_createAndGo'}} -> % ok, if it doesn't exist
+ {{Col, ?'RowStatus_createAndGo'}, false} ->
+ %% ok, if it doesn't exist
Res = lists:keysearch(?vacmAccessContextMatch, 1, Cols),
- case snmpa_vacm:get_row(RowIndex) of
- false when (IsValidKey =:= true) andalso
- is_tuple(Res) -> {noError, 0};
- false -> {noCreation, Col}; % Bad RowIndex
- _ -> {inconsistentValue, Col}
+ if
+ IsValidKey =/= true ->
+ %% bad RowIndex => noCreation
+ {noCreation, Col};
+ is_tuple(Res) ->
+ %% required field is present => noError
+ {noError, 0};
+ true ->
+ %% required field is missing => inconsistentValue
+ {inconsistentValue, Col}
end;
- {value, {Col, ?'RowStatus_createAndWait'}} -> % ok, if it doesn't exist
- case snmpa_vacm:get_row(RowIndex) of
- false when (IsValidKey =:= true) -> {noError, 0};
- false -> {noCreation, Col}; % Bad RowIndex
- _ -> {inconsistentValue, Col}
+ {{Col, ?'RowStatus_createAndGo'}, _} ->
+ %% row already exists => inconsistentValue
+ {inconsistentValue, Col};
+ {{Col, ?'RowStatus_createAndWait'}, false} ->
+ %% ok, if it doesn't exist
+ if
+ IsValidKey =:= true ->
+ %% RowIndex is valid => noError
+ {noError, 0};
+ true ->
+ {noCreation, Col}
end;
- {value, {_Col, ?'RowStatus_destroy'}} -> % always ok!
+ {{Col, ?'RowStatus_createAndWait'}, _} ->
+ %% Row already exists => inconsistentValue
+ {inconsistentValue, Col};
+ {value, {_Col, ?'RowStatus_destroy'}} ->
+ %% always ok!
{noError, 0};
- _ -> % otherwise, it's a change; it must exist
- case snmpa_vacm:get_row(RowIndex) of
- {ok, _} ->
- {noError, 0};
- false ->
- {inconsistentName, element(1, hd(Cols))}
- end
+ {_, false} ->
+ %% otherwise, it's a row change;
+ %% row does not exist => inconsistentName
+ {inconsistentName, element(1, hd(Cols))};
+ _ ->
+ %% row change and row exists => noError
+ {noError, 0}
end;
Error ->
Error
@@ -734,10 +774,15 @@ do_vacmAccessTable_set(RowIndex, Cols) ->
%% Cols are sorted, and all columns are > 3.
+do_get_next(_RowIndex, []) ->
+ % Cols can be empty because we're called for each
+ % output of split_cols(); and one of that may well
+ % be empty.
+ [];
do_get_next(RowIndex, Cols) ->
case snmpa_vacm:get_next_row(RowIndex) of
{NextIndex, Row} ->
- F1 = fun(Col) when Col < ?vacmAccessStatus ->
+ F1 = fun(Col) when Col =< ?vacmAccessStatus ->
{[Col | NextIndex], element(Col-3, Row)};
(_) ->
endOfTable
@@ -745,9 +790,9 @@ do_get_next(RowIndex, Cols) ->
lists:map(F1, Cols);
false ->
case snmpa_vacm:get_next_row([]) of
- {_NextIndex, Row} ->
+ {NextIndex2, Row} ->
F2 = fun(Col) when Col < ?vacmAccessStatus ->
- {[Col+1 | RowIndex], element(Col-2, Row)};
+ {[Col+1 | NextIndex2], element(Col-2, Row)};
(_) ->
endOfTable
end,
diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl
index c400aaddf7..b45a47ec6b 100644
--- a/lib/snmp/src/agent/snmpa.erl
+++ b/lib/snmp/src/agent/snmpa.erl
@@ -83,8 +83,11 @@
-export([add_agent_caps/2, del_agent_caps/1, get_agent_caps/0]).
%% Audit Trail Log functions
--export([log_to_txt/2, log_to_txt/3, log_to_txt/4,
+-export([log_to_txt/1,
+ log_to_txt/2, log_to_txt/3, log_to_txt/4,
log_to_txt/5, log_to_txt/6, log_to_txt/7,
+ log_to_io/1, log_to_io/2, log_to_io/3,
+ log_to_io/4, log_to_io/5, log_to_io/6,
log_info/0,
change_log_size/1,
get_log_type/0, get_log_type/1,
@@ -780,6 +783,8 @@ get_agent_caps() ->
%%% Audit Trail Log functions
%%%-----------------------------------------------------------------
+log_to_txt(LogDir) ->
+ log_to_txt(LogDir, []).
log_to_txt(LogDir, Mibs) ->
OutFile = "snmpa_log.txt",
LogName = ?audit_trail_log_name,
@@ -800,6 +805,23 @@ log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop) ->
snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop).
+log_to_io(LogDir) ->
+ log_to_io(LogDir, []).
+log_to_io(LogDir, Mibs) ->
+ LogName = ?audit_trail_log_name,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile).
+log_to_io(LogDir, Mibs, LogName) ->
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile).
+log_to_io(LogDir, Mibs, LogName, LogFile) ->
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile).
+log_to_io(LogDir, Mibs, LogName, LogFile, Start) ->
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Start).
+log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) ->
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop).
+
+
log_info() ->
LogName = ?audit_trail_log_name,
snmp_log:info(LogName).
diff --git a/lib/snmp/src/agent/snmpa_agent.erl b/lib/snmp/src/agent/snmpa_agent.erl
index 9cc986cf47..9d30e332f1 100644
--- a/lib/snmp/src/agent/snmpa_agent.erl
+++ b/lib/snmp/src/agent/snmpa_agent.erl
@@ -1281,7 +1281,7 @@ handle_call({backup, BackupDir}, From, #state{backup = undefined} = S) ->
?vtrace("backup server: ~p", [BackupServer]),
{noreply, S#state{backup = {BackupServer, From}}};
-handle_call({backup, _BackupDir}, From, #state{backup = Backup} = S) ->
+handle_call({backup, _BackupDir}, _From, #state{backup = Backup} = S) ->
?vinfo("backup already in progress: ~p", [Backup]),
{reply, {error, backup_in_progress}, S};
diff --git a/lib/snmp/src/agent/snmpa_internal.hrl b/lib/snmp/src/agent/snmpa_internal.hrl
index c435b519d9..6537562d44 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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/lib/snmp/src/agent/snmpa_local_db.erl b/lib/snmp/src/agent/snmpa_local_db.erl
index 1ec8dd3874..2c0cad807a 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -515,7 +515,7 @@ handle_call({backup, BackupDir}, From,
{reply, Error, State}
end;
-handle_call({backup, _BackupDir}, From, #state{backup = Backup} = S) ->
+handle_call({backup, _BackupDir}, _From, #state{backup = Backup} = S) ->
?vinfo("backup already in progress: ~p", [Backup]),
{reply, {error, backup_in_progress}, S};
diff --git a/lib/snmp/src/agent/snmpa_mib.erl b/lib/snmp/src/agent/snmpa_mib.erl
index 574467d38f..575a018c0c 100644
--- a/lib/snmp/src/agent/snmpa_mib.erl
+++ b/lib/snmp/src/agent/snmpa_mib.erl
@@ -580,7 +580,7 @@ handle_call({backup, BackupDir}, From,
{reply, Error, State}
end;
-handle_call({backup, _BackupDir}, From, #state{backup = Backup} = S) ->
+handle_call({backup, _BackupDir}, _From, #state{backup = Backup} = S) ->
?vinfo("backup already in progress: ~p", [Backup]),
{reply, {error, backup_in_progress}, S};
diff --git a/lib/snmp/src/agent/snmpa_mib_lib.erl b/lib/snmp/src/agent/snmpa_mib_lib.erl
index 3c94cc8095..529a65a1f1 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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/lib/snmp/src/agent/snmpa_supervisor.erl b/lib/snmp/src/agent/snmpa_supervisor.erl
index 7a9c214e0d..886fd074bc 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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/lib/snmp/src/agent/snmpa_trap.erl b/lib/snmp/src/agent/snmpa_trap.erl
index 994d926224..b9a2496341 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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/lib/snmp/src/app/Makefile b/lib/snmp/src/app/Makefile
index d89eb4e723..f7c311b663 100644
--- a/lib/snmp/src/app/Makefile
+++ b/lib/snmp/src/app/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -127,14 +127,14 @@ $(APPUP_TARGET): $(APPUP_SRC) ../../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/app
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/src/app
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/app"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/src/app"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) \
- $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(EXT_HRL_FILES) $(RELSYSDIR)/include
+ "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(EXT_HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/snmp/src/app/snmp.app.src b/lib/snmp/src/app/snmp.app.src
index a880a14696..b11c1ef934 100644
--- a/lib/snmp/src/app/snmp.app.src
+++ b/lib/snmp/src/app/snmp.app.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -91,6 +91,7 @@
snmpm_mpd,
snmpm_net_if,
snmpm_net_if_filter,
+ snmpm_net_if_mt,
snmpm_network_interface,
snmpm_network_interface_filter,
snmpm_server,
diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src
index c8e5eec6db..593ddd82bd 100644
--- a/lib/snmp/src/app/snmp.appup.src
+++ b/lib/snmp/src/app/snmp.appup.src
@@ -22,66 +22,201 @@
%% ----- U p g r a d e -------------------------------------------------------
[
+ {"4.22",
+ [
+ {load_module, snmpm, soft_purge, soft_purge, []},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}
+ ]
+ },
+ {"4.21.7",
+ [
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+
+ {load_module, snmp_config, soft_purge, soft_purge, []},
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_target_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmp_conf]},
+
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
+
+ {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
+ {update, snmpa_mib, soft, soft_purge, soft_purge, []},
+ {update, snmpa_agent, soft, soft_purge, soft_purge, []},
+
+ {add_module, snmpm_net_if_mt}
+ ]
+ },
{"4.21.6",
[
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+
+ {load_module, snmp_config, soft_purge, soft_purge, []},
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_target_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmp_conf]},
+
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
+
{update, snmpa_local_db, soft, soft_purge, soft_purge, []},
{update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []}
+ {update, snmpa_agent, soft, soft_purge, soft_purge, []},
+
+ {add_module, snmpm_net_if_mt}
]
},
{"4.21.5",
[
- {load_module, snmpa, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmpa_mib_lib]},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+
+ {load_module, snmp_config, soft_purge, soft_purge, []},
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmp_conf]},
+
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
+
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_target_mib, soft_purge, soft_purge,
+ [snmp_conf, snmpa_mib_lib]},
{load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
{load_module, snmpa_trap, soft_purge, soft_purge, []},
{load_module, snmpa_vacm, soft_purge, soft_purge, []},
{update, snmpa_local_db, soft, soft_purge, soft_purge, []},
{update, snmpa_mib, soft, soft_purge, soft_purge, []},
{update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []}
+ {update, snmpa_agent, soft, soft_purge, soft_purge, []},
+
+ {add_module, snmpm_net_if_mt}
]
},
{"4.21.4",
[
- {load_module, snmpa, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmpa_mib_lib]},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+
+ {load_module, snmp_config, soft_purge, soft_purge, []},
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
+
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_target_mib, soft_purge, soft_purge,
+ [snmp_conf, snmpa_mib_lib]},
{load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
{load_module, snmpa_trap, soft_purge, soft_purge, []},
{update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
{load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
+ [snmp_conf]},
{load_module, snmpa_vacm, soft_purge, soft_purge, []},
{update, snmpa_local_db, soft, soft_purge, soft_purge, []},
{update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []}
+ {update, snmpa_agent, soft, soft_purge, soft_purge, []},
+
+ {add_module, snmpm_net_if_mt}
]
},
{"4.21.3",
[
- {load_module, snmpa, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmpa_mib_lib]},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+
+ {load_module, snmp_config, soft_purge, soft_purge, []},
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
+
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_target_mib, soft_purge, soft_purge,
+ [snmp_conf, snmpa_mib_lib]},
{load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
{load_module, snmpa_trap, soft_purge, soft_purge, []},
{update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
{load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
+ [snmp_conf]},
{load_module, snmpa_vacm, soft_purge, soft_purge, []},
{update, snmpa_local_db, soft, soft_purge, soft_purge, []},
{update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []}
+ {update, snmpa_agent, soft, soft_purge, soft_purge, []},
+
+ {add_module, snmpm_net_if_mt}
]
},
{"4.21.2",
[
- {load_module, snmpa, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmpa_mib_lib]},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+
+ {load_module, snmp_config, soft_purge, soft_purge, []},
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
+
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_target_mib, soft_purge, soft_purge,
+ [snmp_conf, snmpa_mib_lib]},
{load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
{update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
+ [snmp_conf]},
{load_module, snmpa_vacm, soft_purge, soft_purge, []},
{load_module, snmpa_mpd, soft_purge, soft_purge, []},
{load_module, snmpa_set_lib, soft_purge, soft_purge, []},
@@ -89,17 +224,37 @@
{load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
{update, snmpa_local_db, soft, soft_purge, soft_purge, []},
{update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []}
+ {update, snmpa_agent, soft, soft_purge, soft_purge, []},
+
+ {add_module, snmpm_net_if_mt}
]
},
{"4.21.1",
[
- {load_module, snmpa, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmpa_mib_lib]},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+
+ {load_module, snmp_config, soft_purge, soft_purge, []},
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
+
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_target_mib, soft_purge, soft_purge,
+ [snmp_conf, snmpa_mib_lib]},
{load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
{update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
+ [snmp_conf]},
{load_module, snmpa_vacm, soft_purge, soft_purge, []},
{load_module, snmpa_mpd, soft_purge, soft_purge, []},
{load_module, snmpa_set_lib, soft_purge, soft_purge, []},
@@ -108,158 +263,251 @@
{update, snmpa_local_db, soft, soft_purge, soft_purge, []},
{update, snmpa_mib, soft, soft_purge, soft_purge, []},
{update, snmpa_agent, soft, soft_purge, soft_purge, []},
- {update, snmp_note_store, soft, soft_purge, soft_purge, []}
+ {update, snmp_note_store, soft, soft_purge, soft_purge, []},
+
+ {add_module, snmpm_net_if_mt}
]
},
{"4.21",
[
- {load_module, snmpa, soft_purge, soft_purge, []},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+
+ {load_module, snmp_config, soft_purge, soft_purge, []},
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
+
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
{load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
{update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
+ [snmp_conf]},
{load_module, snmpa_vacm, soft_purge, soft_purge, []},
{load_module, snmpa_mpd, soft_purge, soft_purge, []},
{load_module, snmpa_set_lib, soft_purge, soft_purge, []},
{load_module, snmpa_trap, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmpa_mib_lib]},
+ {load_module, snmp_target_mib, soft_purge, soft_purge,
+ [snmp_conf, snmpa_mib_lib]},
{load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
{update, snmpa_local_db, soft, soft_purge, soft_purge, []},
{update, snmpa_mib, soft, soft_purge, soft_purge, []},
{update, snmpa_agent, soft, soft_purge, soft_purge, []},
- {update, snmp_note_store, soft, soft_purge, soft_purge, []}
+ {update, snmp_note_store, soft, soft_purge, soft_purge, []},
+
+ {add_module, snmpm_net_if_mt}
]
- },
- {"4.20.1",
- [
- {load_module, snmpa, soft_purge, soft_purge, []},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
+ }
+ ],
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {load_module, snmpa_set_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmpa_mib_lib]},
+%% ------D o w n g r a d e ---------------------------------------------------
+
+ [
+ {"4.22",
+ [
+ {load_module, snmpm, soft_purge, soft_purge, []},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
{load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
- {load_module, snmpm, soft_purge, soft_purge,
- [snmpm_server, snmpm_config, snmp_config]},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge,
- [snmp_conf, snmp_config, snmpm_config]},
- {load_module, snmpa_mpd, soft_purge, soft_purge,
- [snmp_conf, snmp_config]},
- {load_module, snmpa_conf, soft_purge, soft_purge, [snmp_config]},
- {update, snmp_note_store, soft, soft_purge, soft_purge, []},
- {load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mpd]},
- {update, snmpm_config, soft, soft_purge, soft_purge, [snmp_conf]},
- {update, snmpm_server, soft, soft_purge, soft_purge,
- [snmpm_net_if, snmpm_mpd, snmpm_config]},
- {update, snmpm_net_if, soft, soft_purge, soft_purge,
- [snmp_conf, snmpm_mpd, snmpm_config]}
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, []}
]
},
- {"4.20",
+ {"4.21.7",
[
- {load_module, snmpa, soft_purge, soft_purge, []},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {load_module, snmpa_set_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge,
- [snmpa_mib_lib, snmp_conf]},
- {load_module, snmpm, soft_purge, soft_purge,
- [snmpm_server, snmpm_config, snmp_config]},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
{load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge,
- [snmp_conf, snmp_config, snmpm_config]},
- {load_module, snmpa_mpd, soft_purge, soft_purge,
- [snmp_conf, snmp_config]},
- {load_module, snmpa_conf, soft_purge, soft_purge, [snmp_config]},
- {update, snmp_note_store, soft, soft_purge, soft_purge, []},
- {load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mpd]},
- {update, snmpm_config, soft, soft_purge, soft_purge, [snmp_conf]},
- {update, snmpm_server, soft, soft_purge, soft_purge,
- [snmpm_net_if, snmpm_mpd, snmpm_config]},
- {update, snmpm_net_if, soft, soft_purge, soft_purge,
- [snmp_conf, snmpm_mpd, snmpm_config]}
- ]
- }
- ],
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_target_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmp_conf]},
-%% ------D o w n g r a d e ---------------------------------------------------
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
- [
+ {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
+ {update, snmpa_mib, soft, soft_purge, soft_purge, []},
+ {update, snmpa_agent, soft, soft_purge, soft_purge, []},
+
+ {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
+ ]
+ },
{"4.21.6",
[
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+
+ {load_module, snmp_config, soft_purge, soft_purge, []},
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_target_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmp_conf]},
+
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
+
{update, snmpa_local_db, soft, soft_purge, soft_purge, []},
{update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []}
+ {update, snmpa_agent, soft, soft_purge, soft_purge, []},
+
+ {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
]
},
{"4.21.5",
[
- {load_module, snmpa, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmpa_mib_lib]},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+
+ {load_module, snmp_config, soft_purge, soft_purge, []},
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmp_conf]},
+
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
+
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_target_mib, soft_purge, soft_purge,
+ [snmp_conf, snmpa_mib_lib]},
{load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
{load_module, snmpa_trap, soft_purge, soft_purge, []},
{load_module, snmpa_vacm, soft_purge, soft_purge, []},
{update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
{update, snmpa_local_db, soft, soft_purge, soft_purge, []},
{update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []}
+ {update, snmpa_agent, soft, soft_purge, soft_purge, []},
+
+ {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
]
},
{"4.21.4",
[
- {load_module, snmpa, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmpa_mib_lib]},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+
+ {load_module, snmp_config, soft_purge, soft_purge, []},
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
+
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_target_mib, soft_purge, soft_purge,
+ [snmp_conf, snmpa_mib_lib]},
{load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
{load_module, snmpa_trap, soft_purge, soft_purge, []},
{update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
{load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
+ [snmp_conf]},
{load_module, snmpa_vacm, soft_purge, soft_purge, []},
{update, snmpa_local_db, soft, soft_purge, soft_purge, []},
{update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []}
+ {update, snmpa_agent, soft, soft_purge, soft_purge, []},
+
+ {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
]
},
{"4.21.3",
[
- {load_module, snmpa, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmpa_mib_lib]},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+
+ {load_module, snmp_config, soft_purge, soft_purge, []},
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
+
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_target_mib, soft_purge, soft_purge,
+ [snmp_conf, snmpa_mib_lib]},
{load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
{load_module, snmpa_trap, soft_purge, soft_purge, []},
{update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
{load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
+ [snmp_conf]},
{load_module, snmpa_vacm, soft_purge, soft_purge, []},
{update, snmpa_local_db, soft, soft_purge, soft_purge, []},
{update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []}
+ {update, snmpa_agent, soft, soft_purge, soft_purge, []},
+
+ {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
]
},
{"4.21.2",
[
- {load_module, snmpa, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmpa_mib_lib]},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+
+ {load_module, snmp_config, soft_purge, soft_purge, []},
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
+
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_target_mib, soft_purge, soft_purge,
+ [snmp_conf, snmpa_mib_lib]},
{load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
{update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
+ [snmp_conf]},
{load_module, snmpa_vacm, soft_purge, soft_purge, []},
{load_module, snmpa_mpd, soft_purge, soft_purge, []},
{load_module, snmpa_set_lib, soft_purge, soft_purge, []},
@@ -267,17 +515,37 @@
{load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
{update, snmpa_local_db, soft, soft_purge, soft_purge, []},
{update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, []}
+ {update, snmpa_agent, soft, soft_purge, soft_purge, []},
+
+ {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
]
},
{"4.21.1",
[
- {load_module, snmpa, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmpa_mib_lib]},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+
+ {load_module, snmp_config, soft_purge, soft_purge, []},
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
+
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_target_mib, soft_purge, soft_purge,
+ [snmp_conf, snmpa_mib_lib]},
{load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
{update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
+ [snmp_conf]},
{load_module, snmpa_vacm, soft_purge, soft_purge, []},
{load_module, snmpa_mpd, soft_purge, soft_purge, []},
{load_module, snmpa_set_lib, soft_purge, soft_purge, []},
@@ -286,90 +554,48 @@
{update, snmpa_local_db, soft, soft_purge, soft_purge, []},
{update, snmpa_mib, soft, soft_purge, soft_purge, []},
{update, snmpa_agent, soft, soft_purge, soft_purge, []},
- {update, snmp_note_store, soft, soft_purge, soft_purge, []}
+ {update, snmp_note_store, soft, soft_purge, soft_purge, []},
+
+ {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
]
},
{"4.21",
[
- {load_module, snmpa, soft_purge, soft_purge, []},
+ {load_module, snmp_pdus, soft_purge, soft_purge, []},
+
+ {load_module, snmp_config, soft_purge, soft_purge, []},
+ {load_module, snmp_conf, soft_purge, soft_purge, []},
+ {load_module, snmp_community_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_framework_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_notification_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_standard_mib, soft_purge, soft_purge, [snmp_conf]},
+ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmp_conf]},
+
+ {load_module, snmp, soft_purge, soft_purge, [snmp_log]},
+ {load_module, snmpm, soft_purge, soft_purge, [snmp]},
+ {load_module, snmp_log, soft_purge, soft_purge, []},
+ {load_module, snmp_verbosity, soft_purge, soft_purge, []},
+ {load_module, snmpm_mpd, soft_purge, soft_purge, []},
+
+ {load_module, snmpa, soft_purge, soft_purge, [snmp]},
{load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
{update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
+ {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge,
+ [snmp_conf]},
{load_module, snmpa_vacm, soft_purge, soft_purge, []},
{load_module, snmpa_mpd, soft_purge, soft_purge, []},
{load_module, snmpa_set_lib, soft_purge, soft_purge, []},
{load_module, snmpa_trap, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge, []},
+ {load_module, snmp_target_mib, soft_purge, soft_purge,
+ [snmp_conf, snmpa_mib_lib]},
{load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
{update, snmpa_local_db, soft, soft_purge, soft_purge, []},
{update, snmpa_mib, soft, soft_purge, soft_purge, []},
{update, snmpa_agent, soft, soft_purge, soft_purge, []},
- {update, snmp_note_store, soft, soft_purge, soft_purge, []}
- ]
- },
- {"4.20.1",
- [
- {load_module, snmpa, soft_purge, soft_purge, []},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
-
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {load_module, snmpa_set_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
- {load_module, snmpm, soft_purge, soft_purge,
- [snmpm_server, snmpm_config, snmp_config]},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge,
- [snmp_conf, snmp_config, snmpm_config]},
- {load_module, snmpa_mpd, soft_purge, soft_purge,
- [snmp_conf, snmp_config]},
- {load_module, snmpa_conf, soft_purge, soft_purge, [snmp_config]},
{update, snmp_note_store, soft, soft_purge, soft_purge, []},
- {load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mpd]},
- {update, snmpm_config, soft, soft_purge, soft_purge, [snmp_conf]},
- {update, snmpm_server, soft, soft_purge, soft_purge,
- [snmpm_net_if, snmpm_mpd, snmpm_config]},
- {update, snmpm_net_if, soft, soft_purge, soft_purge,
- [snmp_conf, snmpm_mpd, snmpm_config]}
- ]
- },
- {"4.20",
- [
- {load_module, snmpa, soft_purge, soft_purge, []},
- {load_module, snmpa_mib_lib, soft_purge, soft_purge, []},
- {update, snmpa_supervisor, soft, soft_purge, soft_purge, []},
- {load_module, snmpa_vacm, soft_purge, soft_purge, []},
- {load_module, snmpa_set_lib, soft_purge, soft_purge, []},
- {load_module, snmpa_trap, soft_purge, soft_purge, []},
- {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
- {load_module, snmp_target_mib, soft_purge, soft_purge, [snmp_conf]},
- {load_module, snmpm, soft_purge, soft_purge,
- [snmpm_server, snmpm_config, snmp_config]},
- {load_module, snmp_conf, soft_purge, soft_purge, []},
- {load_module, snmp_config, soft_purge, soft_purge, []},
- {load_module, snmpm_mpd, soft_purge, soft_purge,
- [snmp_conf, snmp_config, snmpm_config]},
- {load_module, snmpa_mpd, soft_purge, soft_purge,
- [snmp_conf, snmp_config]},
- {load_module, snmpa_conf, soft_purge, soft_purge, [snmp_config]},
- {update, snmp_note_store, soft, soft_purge, soft_purge, []},
- {load_module, snmp_generic_mnesia, soft_purge, soft_purge, []},
- {update, snmpa_local_db, soft, soft_purge, soft_purge, []},
- {update, snmpa_mib, soft, soft_purge, soft_purge, []},
- {update, snmpa_agent, soft, soft_purge, soft_purge, [snmpa_mpd]},
- {update, snmpm_config, soft, soft_purge, soft_purge, [snmp_conf]},
- {update, snmpm_server, soft, soft_purge, soft_purge,
- [snmpm_net_if, snmpm_mpd, snmpm_config]},
- {update, snmpm_net_if, soft, soft_purge, soft_purge,
- [snmp_conf, snmpm_mpd, snmpm_config]}
+ {remove, {snmpm_net_if_mt, soft_purge, soft_purge}}
]
}
]
diff --git a/lib/snmp/src/app/snmp.erl b/lib/snmp/src/app/snmp.erl
index 3e0f05e604..cd3e3a0055 100644
--- a/lib/snmp/src/app/snmp.erl
+++ b/lib/snmp/src/app/snmp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -50,6 +50,7 @@
read_mib/1,
log_to_txt/5, log_to_txt/6, log_to_txt/7,
+ log_to_io/4, log_to_io/5, log_to_io/6,
change_log_size/2,
octet_string_to_bits/1, bits_to_octet_string/1,
@@ -843,6 +844,12 @@ log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start) ->
log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop) ->
snmp_log:log_to_txt(LogName, LogFile, LogDir, Mibs, OutFile, Start, Stop).
+log_to_io(LogDir, Mibs, LogName, LogFile) ->
+ snmp_log:log_to_io(LogName, LogFile, LogDir, Mibs).
+log_to_io(LogDir, Mibs, LogName, LogFile, Start) ->
+ snmp_log:log_to_io(LogName, LogFile, LogDir, Mibs, Start).
+log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) ->
+ snmp_log:log_to_io(LogName, LogFile, LogDir, Mibs, Start, Stop).
change_log_size(LogName, NewSize) ->
snmp_log:change_size(LogName, NewSize).
diff --git a/lib/snmp/src/compile/Makefile b/lib/snmp/src/compile/Makefile
index 627af6f185..f63fc18997 100644
--- a/lib/snmp/src/compile/Makefile
+++ b/lib/snmp/src/compile/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -120,13 +120,13 @@ $(GENERATED_PARSER): $(PARSER_SRC)
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/compiler
- $(INSTALL_DATA) $(ESCRIPT_SRC) $(PARSER_SRC) $(ERL_FILES) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src/compiler
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(EBIN_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/bin
- $(INSTALL_SCRIPT) $(ESCRIPT_BIN) $(RELSYSDIR)/bin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/compiler"
+ $(INSTALL_DATA) $(ESCRIPT_SRC) $(PARSER_SRC) $(ERL_FILES) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src/compiler"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(EBIN_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/bin"
+ $(INSTALL_SCRIPT) $(ESCRIPT_BIN) "$(RELSYSDIR)/bin"
release_docs_spec:
diff --git a/lib/snmp/src/compile/snmpc_lib.erl b/lib/snmp/src/compile/snmpc_lib.erl
index 38bb8f3ac6..c7eae307e8 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -704,23 +704,29 @@ check_trap_name(EnterpriseName, Line, MEs) ->
%% This information is needed to be able to create default instrumentation
%% functions for tables.
%%----------------------------------------------------------------------
-make_table_info(Line, _TableName, {augments,SrcTableEntry}, ColumnMEs) ->
+make_table_info(Line, TableName, {augments, SrcTableEntry}, ColumnMEs) ->
ColMEs = lists:keysort(#me.oid, ColumnMEs),
- %% Nbr_of_Cols = length(ColMEs),
+ Nbr_of_Cols = length(ColMEs),
MEs = ColMEs ++ (get(cdata))#cdata.mes,
- Aug = case lookup(SrcTableEntry,MEs) of
+ Aug = case lookup(SrcTableEntry, MEs) of
false ->
print_error("Cannot AUGMENT the non-existing table entry ~p",
- [SrcTableEntry],Line),
+ [SrcTableEntry], Line),
{augments, error};
- {value,ME} ->
- {augments, {SrcTableEntry,translate_type(ME#me.asn1_type)}}
+ {value, ME} ->
+ {augments, {SrcTableEntry, translate_type(ME#me.asn1_type)}}
end,
- #table_info{index_types = Aug};
-make_table_info(Line, TableName, {indexes,[]}, _ColumnMEs) ->
+ FirstNonIdxCol = augments_first_non_index_column(ColMEs),
+ NoAccs = list_not_accessible(FirstNonIdxCol, ColMEs),
+ FirstAcc = first_accessible(TableName, ColMEs),
+ #table_info{nbr_of_cols = Nbr_of_Cols,
+ first_accessible = FirstAcc,
+ not_accessible = NoAccs,
+ index_types = Aug};
+make_table_info(Line, TableName, {indexes, []}, _ColumnMEs) ->
print_error("Table ~w lacks indexes.", [TableName],Line),
#table_info{};
-make_table_info(Line, TableName, {indexes,Indexes}, ColumnMEs) ->
+make_table_info(Line, TableName, {indexes, Indexes}, ColumnMEs) ->
ColMEs = lists:keysort(#me.oid, ColumnMEs),
NonImpliedIndexes = lists:map(fun non_implied_name/1, Indexes),
test_read_create_access(ColMEs, Line, dummy),
@@ -860,11 +866,17 @@ get_asn1_type(ColumnName, MEs, Line) ->
end.
test_index_positions(Line, Indexes, ColMEs) ->
- TLI = lists:filter(fun (IndexName) ->
- is_table_local_index(IndexName,ColMEs) end,
- Indexes),
+ IsTLI = fun(IndexName) -> is_table_local_index(IndexName, ColMEs) end,
+ TLI = lists:filter(IsTLI, Indexes),
test_index_positions_impl(Line, TLI, ColMEs).
+%% An table that augments another cannot conatin any index,
+%% so the first non-index column is always the first column.
+augments_first_non_index_column([]) ->
+ none;
+augments_first_non_index_column([#me{oid=Col}|_ColMEs]) ->
+ Col.
+
%% Returns the first non-index column | none
test_index_positions_impl(_Line, [], []) -> none;
test_index_positions_impl(_Line, [], [#me{oid=Col}|_ColMEs]) ->
diff --git a/lib/snmp/src/manager/Makefile b/lib/snmp/src/manager/Makefile
index c1d5703300..c76dbacf90 100644
--- a/lib/snmp/src/manager/Makefile
+++ b/lib/snmp/src/manager/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -111,13 +111,13 @@ info:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/manager
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/src/manager
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
-# $(INSTALL_DIR) $(RELSYSDIR)/include
-# $(INSTALL_DATA) $(EXT_HRL_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/manager"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/src/manager"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+# $(INSTALL_DIR) "$(RELSYSDIR)/include"
+# $(INSTALL_DATA) $(EXT_HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/snmp/src/manager/depend.mk b/lib/snmp/src/manager/depend.mk
index 0e7e9e3df7..2e7783c8ed 100644
--- a/lib/snmp/src/manager/depend.mk
+++ b/lib/snmp/src/manager/depend.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -49,6 +49,13 @@ $(EBIN)/snmpm_net_if.$(EMULATOR): \
snmpm_net_if.erl \
snmpm_network_interface.erl
+$(EBIN)/snmpm_net_if_mt.$(EMULATOR): \
+ ../../include/snmp_types.hrl \
+ ../misc/snmp_debug.hrl \
+ ../misc/snmp_verbosity.hrl \
+ snmpm_net_if_mt.erl \
+ snmpm_network_interface.erl
+
$(EBIN)/snmpm_server.$(EMULATOR): \
../../include/snmp_types.hrl \
../../include/STANDARD-MIB.hrl \
diff --git a/lib/snmp/src/manager/modules.mk b/lib/snmp/src/manager/modules.mk
index 79f3dd65d9..d46545ea3f 100644
--- a/lib/snmp/src/manager/modules.mk
+++ b/lib/snmp/src/manager/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2009. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -31,6 +31,7 @@ MODULES = \
snmpm_mpd \
snmpm_misc_sup \
snmpm_net_if \
+ snmpm_net_if_mt \
snmpm_net_if_filter \
snmpm_server \
snmpm_server_sup \
diff --git a/lib/snmp/src/manager/snmpm.erl b/lib/snmp/src/manager/snmpm.erl
index 6d2ac8d747..f590892c66 100644
--- a/lib/snmp/src/manager/snmpm.erl
+++ b/lib/snmp/src/manager/snmpm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -75,8 +75,11 @@
%%
%% Logging
+ log_to_txt/1,
log_to_txt/2, log_to_txt/3, log_to_txt/4,
log_to_txt/5, log_to_txt/6, log_to_txt/7,
+ log_to_io/1, log_to_io/2, log_to_io/3,
+ log_to_io/4, log_to_io/5, log_to_io/6,
change_log_size/1,
get_log_type/0,
set_log_type/1,
@@ -1371,6 +1374,9 @@ cancel_async_request(UserId, ReqId) ->
%%%-----------------------------------------------------------------
%%% Audit Trail Log functions (for backward compatibility)
%%%-----------------------------------------------------------------
+
+log_to_txt(LogDir) ->
+ log_to_txt(LogDir, []).
log_to_txt(LogDir, Mibs) ->
OutFile = "snmpm_log.txt",
LogName = ?audit_trail_log_name,
@@ -1391,6 +1397,23 @@ log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop) ->
snmp:log_to_txt(LogDir, Mibs, OutFile, LogName, LogFile, Start, Stop).
+log_to_io(LogDir) ->
+ log_to_io(LogDir, []).
+log_to_io(LogDir, Mibs) ->
+ LogName = ?audit_trail_log_name,
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile).
+log_to_io(LogDir, Mibs, LogName) ->
+ LogFile = ?audit_trail_log_file,
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile).
+log_to_io(LogDir, Mibs, LogName, LogFile) ->
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile).
+log_to_io(LogDir, Mibs, LogName, LogFile, Start) ->
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Start).
+log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) ->
+ snmp:log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop).
+
+
change_log_size(NewSize) ->
LogName = ?audit_trail_log_name,
snmp:change_log_size(LogName, NewSize).
diff --git a/lib/snmp/src/manager/snmpm_config.erl b/lib/snmp/src/manager/snmpm_config.erl
index c2e57abddb..5bbf9e5542 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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/lib/snmp/src/manager/snmpm_mpd.erl b/lib/snmp/src/manager/snmpm_mpd.erl
index 103c87d32b..d7148bb4a4 100644
--- a/lib/snmp/src/manager/snmpm_mpd.erl
+++ b/lib/snmp/src/manager/snmpm_mpd.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -110,9 +110,9 @@ process_msg(Msg, Domain, Addr, Port, State, NoteStore, Logger) ->
#message{version = 'version-2', vsn_hdr = Community, data = Data}
when State#state.v2c =:= true ->
HS = ?empty_msg_size + length(Community),
- (catch process_v1_v2c_msg('version-2', NoteStore, Msg,
- Domain, Addr, Port,
- Community, Data, HS, Logger));
+ process_v1_v2c_msg('version-2', NoteStore, Msg,
+ Domain, Addr, Port,
+ Community, Data, HS, Logger);
%% Version 3
#message{version = 'version-3', vsn_hdr = H, data = Data}
diff --git a/lib/snmp/src/manager/snmpm_net_if_mt.erl b/lib/snmp/src/manager/snmpm_net_if_mt.erl
new file mode 100644
index 0000000000..3e87f6a7fb
--- /dev/null
+++ b/lib/snmp/src/manager/snmpm_net_if_mt.erl
@@ -0,0 +1,1259 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(snmpm_net_if_mt).
+
+-behaviour(gen_server).
+-behaviour(snmpm_network_interface).
+
+
+%% Network Interface callback functions
+-export([
+ start_link/2,
+ stop/1,
+ send_pdu/6, % Backward compatibillity
+ send_pdu/7, % Backward compatibillity
+ send_pdu/8,
+
+ inform_response/4,
+
+ note_store/2,
+
+ info/1,
+ verbosity/2,
+ %% system_info_updated/2,
+ get_log_type/1, set_log_type/2,
+ filter_reset/1
+ ]).
+
+%% gen_server callbacks
+-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
+ code_change/3, terminate/2]).
+
+-define(SNMP_USE_V3, true).
+-include("snmp_types.hrl").
+-include("snmpm_internal.hrl").
+-include("snmpm_atl.hrl").
+-include("snmp_debug.hrl").
+
+%% -define(VMODULE,"NET_IF").
+-include("snmp_verbosity.hrl").
+
+-record(state,
+ {
+ server,
+ note_store,
+ sock,
+ mpd_state,
+ log,
+ irb = auto, % auto | {user, integer()}
+ irgc,
+ filter
+ }).
+
+
+-define(DEFAULT_FILTER_MODULE, snmpm_net_if_filter).
+-define(DEFAULT_FILTER_OPTS, [{module, ?DEFAULT_FILTER_MODULE}]).
+
+-ifdef(snmp_debug).
+-define(GS_START_LINK(Args),
+ gen_server:start_link(?MODULE, Args, [{debug,[trace]}])).
+-else.
+-define(GS_START_LINK(Args),
+ gen_server:start_link(?MODULE, Args, [])).
+-endif.
+
+
+-define(IRGC_TIMEOUT, timer:minutes(5)).
+
+-define(ATL_SEQNO_INITIAL, 1).
+-define(ATL_SEQNO_MAX, 2147483647).
+
+
+%%%-------------------------------------------------------------------
+%%% API
+%%%-------------------------------------------------------------------
+start_link(Server, NoteStore) ->
+ ?d("start_link -> entry with"
+ "~n Server: ~p"
+ "~n NoteStore: ~p", [Server, NoteStore]),
+ Args = [Server, NoteStore],
+ ?GS_START_LINK(Args).
+
+stop(Pid) ->
+ call(Pid, stop).
+
+send_pdu(Pid, Pdu, Vsn, MsgData, Addr, Port) ->
+ send_pdu(Pid, Pdu, Vsn, MsgData, Addr, Port, ?DEFAULT_EXTRA_INFO).
+
+send_pdu(Pid, Pdu, Vsn, MsgData, Addr, Port, ExtraInfo) ->
+ Domain = snmpm_config:default_transport_domain(),
+ send_pdu(Pid, Pdu, Vsn, MsgData, Domain, Addr, Port, ExtraInfo).
+
+send_pdu(Pid, Pdu, Vsn, MsgData, Domain, Addr, Port, ExtraInfo)
+ when is_record(Pdu, pdu) ->
+ ?d("send_pdu -> entry with"
+ "~n Pid: ~p"
+ "~n Pdu: ~p"
+ "~n Vsn: ~p"
+ "~n MsgData: ~p"
+ "~n Domain: ~p"
+ "~n Addr: ~p"
+ "~n Port: ~p", [Pid, Pdu, Vsn, MsgData, Domain, Addr, Port]),
+ cast(Pid, {send_pdu, Pdu, Vsn, MsgData, Domain, Addr, Port, ExtraInfo}).
+
+note_store(Pid, NoteStore) ->
+ call(Pid, {note_store, NoteStore}).
+
+inform_response(Pid, Ref, Addr, Port) ->
+ cast(Pid, {inform_response, Ref, Addr, Port}).
+
+info(Pid) ->
+ call(Pid, info).
+
+verbosity(Pid, V) ->
+ call(Pid, {verbosity, V}).
+
+%% system_info_updated(Pid, What) ->
+%% call(Pid, {system_info_updated, What}).
+
+get_log_type(Pid) ->
+ call(Pid, get_log_type).
+
+set_log_type(Pid, NewType) ->
+ call(Pid, {set_log_type, NewType}).
+
+filter_reset(Pid) ->
+ cast(Pid, filter_reset).
+
+
+%%%-------------------------------------------------------------------
+%%% Callback functions from gen_server
+%%%-------------------------------------------------------------------
+
+%%--------------------------------------------------------------------
+%% Func: init/1
+%% Returns: {ok, State} |
+%% {ok, State, Timeout} |
+%% ignore |
+%% {stop, Reason}
+%%--------------------------------------------------------------------
+init([Server, NoteStore]) ->
+ ?d("init -> entry with"
+ "~n Server: ~p"
+ "~n NoteStore: ~p", [Server, NoteStore]),
+ case (catch do_init(Server, NoteStore)) of
+ {error, Reason} ->
+ {stop, Reason};
+ {ok, State} ->
+ {ok, State}
+ end.
+
+do_init(Server, NoteStore) ->
+ process_flag(trap_exit, true),
+
+ %% -- Prio --
+ {ok, Prio} = snmpm_config:system_info(prio),
+ process_flag(priority, Prio),
+
+ %% -- Create inform request table --
+ %% This should really be protected, but it also needs to
+ %% be writable for the worker processes, so...
+ ets:new(snmpm_inform_request_table,
+ [set, public, named_table, {keypos, 1}]),
+
+ %% -- Verbosity --
+ {ok, Verbosity} = snmpm_config:system_info(net_if_verbosity),
+ put(sname, mnif),
+ put(verbosity, Verbosity),
+ ?vlog("starting", []),
+
+ %% -- MPD --
+ {ok, Vsns} = snmpm_config:system_info(versions),
+ MpdState = snmpm_mpd:init(Vsns),
+ ?vdebug("MpdState: ~w", [MpdState]),
+
+ %% -- Module dependent options --
+ {ok, Opts} = snmpm_config:system_info(net_if_options),
+
+ %% -- Inform response behaviour --
+ {ok, IRB} = snmpm_config:system_info(net_if_irb),
+ IrGcRef = irgc_start(IRB),
+
+ %% -- Socket --
+ SndBuf = get_opt(Opts, sndbuf, default),
+ RecBuf = get_opt(Opts, recbuf, default),
+ BindTo = get_opt(Opts, bind_to, false),
+ NoReuse = get_opt(Opts, no_reuse, false),
+ {ok, Port} = snmpm_config:system_info(port),
+ {ok, Sock} = do_open_port(Port, SndBuf, RecBuf, BindTo, NoReuse),
+
+ %% Flow control --
+ FilterOpts = get_opt(Opts, filter, []),
+ FilterMod = create_filter(FilterOpts),
+ ?vdebug("FilterMod: ~w", [FilterMod]),
+
+ %% -- Audit trail log ---
+ {ok, ATL} = snmpm_config:system_info(audit_trail_log),
+ Log = do_init_log(ATL),
+ ?vdebug("Log: ~w", [Log]),
+
+ %% -- Initiate counters ---
+ init_counters(),
+
+ %% -- We are done ---
+ State = #state{server = Server,
+ note_store = NoteStore,
+ mpd_state = MpdState,
+ sock = Sock,
+ log = Log,
+ irb = IRB,
+ irgc = IrGcRef,
+ filter = FilterMod},
+ ?vdebug("started", []),
+ {ok, State}.
+
+
+%% Open port
+do_open_port(Port, SendSz, RecvSz, BindTo, NoReuse) ->
+ ?vtrace("do_open_port -> entry with"
+ "~n Port: ~p"
+ "~n SendSz: ~p"
+ "~n RecvSz: ~p"
+ "~n BindTo: ~p"
+ "~n NoReuse: ~p", [Port, SendSz, RecvSz, BindTo, NoReuse]),
+ IpOpts1 = bind_to(BindTo),
+ IpOpts2 = no_reuse(NoReuse),
+ IpOpts3 = recbuf(RecvSz),
+ IpOpts4 = sndbuf(SendSz),
+ IpOpts = [binary | IpOpts1 ++ IpOpts2 ++ IpOpts3 ++ IpOpts4],
+ OpenRes =
+ case init:get_argument(snmpm_fd) of
+ {ok, [[FdStr]]} ->
+ Fd = list_to_integer(FdStr),
+ gen_udp:open(0, [{fd, Fd}|IpOpts]);
+ error ->
+ gen_udp:open(Port, IpOpts)
+ end,
+ case OpenRes of
+ {error, _} = Error ->
+ throw(Error);
+ OK ->
+ OK
+ end.
+
+bind_to(true) ->
+ case snmpm_config:system_info(address) of
+ {ok, Addr} when is_list(Addr) ->
+ [{ip, list_to_tuple(Addr)}];
+ {ok, Addr} ->
+ [{ip, Addr}];
+ _ ->
+ []
+ end;
+bind_to(_) ->
+ [].
+
+no_reuse(false) ->
+ [{reuseaddr, true}];
+no_reuse(_) ->
+ [].
+
+recbuf(default) ->
+ [];
+recbuf(Sz) ->
+ [{recbuf, Sz}].
+
+sndbuf(default) ->
+ [];
+sndbuf(Sz) ->
+ [{sndbuf, Sz}].
+
+
+create_filter(Opts) when is_list(Opts) ->
+ case get_opt(Opts, module, ?DEFAULT_FILTER_MODULE) of
+ ?DEFAULT_FILTER_MODULE = Mod ->
+ Mod;
+ Module ->
+ snmpm_network_interface_filter:verify(Module),
+ Module
+ end;
+create_filter(BadOpts) ->
+ throw({error, {bad_filter_opts, BadOpts}}).
+
+
+%% ----------------------------------------------------------------------
+%% Audit Trail Logger
+%% ----------------------------------------------------------------------
+
+%% Open log
+do_init_log(false) ->
+ ?vtrace("do_init_log(false) -> entry", []),
+ undefined;
+do_init_log(true) ->
+ ?vtrace("do_init_log(true) -> entry", []),
+ {ok, Type} = snmpm_config:system_info(audit_trail_log_type),
+ {ok, Dir} = snmpm_config:system_info(audit_trail_log_dir),
+ {ok, Size} = snmpm_config:system_info(audit_trail_log_size),
+ {ok, Repair} = snmpm_config:system_info(audit_trail_log_repair),
+ Name = ?audit_trail_log_name,
+ File = filename:absname(?audit_trail_log_file, Dir),
+ case snmpm_config:system_info(audit_trail_log_seqno) of
+ {ok, true} ->
+ Initial = ?ATL_SEQNO_INITIAL,
+ Max = ?ATL_SEQNO_MAX,
+ Module = snmpm_config,
+ Function = increment_counter,
+ Args = [atl_seqno, Initial, Max],
+ SeqNoGen = {Module, Function, Args},
+ case snmp_log:create(Name, File, SeqNoGen, Size, Repair, true) of
+ {ok, Log} ->
+ ?vdebug("log created: ~w", [Log]),
+ {Name, Log, Type};
+ {error, Reason} ->
+ throw({error, {failed_create_audit_log, Reason}})
+ end;
+ _ ->
+ case snmp_log:create(Name, File, Size, Repair, true) of
+ {ok, Log} ->
+ ?vdebug("log created: ~w", [Log]),
+ {Name, Log, Type};
+ {error, Reason} ->
+ throw({error, {failed_create_audit_log, Reason}})
+ end
+ end.
+
+
+%% ----------------------------------------------------------------------
+
+%%--------------------------------------------------------------------
+%% Func: handle_call/3
+%% Returns: {reply, Reply, State} |
+%% {reply, Reply, State, Timeout} |
+%% {noreply, State} |
+%% {noreply, State, Timeout} |
+%% {stop, Reason, Reply, State} | (terminate/2 is called)
+%% {stop, Reason, State} (terminate/2 is called)
+%%--------------------------------------------------------------------
+handle_call({verbosity, Verbosity}, _From, State) ->
+ ?vlog("received verbosity request", []),
+ put(verbosity, Verbosity),
+ {reply, ok, State};
+
+%% handle_call({system_info_updated, What}, _From, State) ->
+%% ?vlog("received system_info_updated request with What = ~p", [What]),
+%% {NewState, Reply} = handle_system_info_updated(State, What),
+%% {reply, Reply, NewState};
+
+handle_call(get_log_type, _From, State) ->
+ ?vlog("received get-log-type request", []),
+ Reply = (catch handle_get_log_type(State)),
+ {reply, Reply, State};
+
+handle_call({set_log_type, NewType}, _From, State) ->
+ ?vlog("received set-log-type request with NewType = ~p", [NewType]),
+ {NewState, Reply} = (catch handle_set_log_type(State, NewType)),
+ {reply, Reply, NewState};
+
+handle_call({note_store, Pid}, _From, State) ->
+ ?vlog("received new note_store: ~w", [Pid]),
+ {reply, ok, State#state{note_store = Pid}};
+
+handle_call(stop, _From, State) ->
+ ?vlog("received stop request", []),
+ Reply = ok,
+ {stop, normal, Reply, State};
+
+handle_call(info, _From, State) ->
+ ?vlog("received info request", []),
+ Reply = get_info(State),
+ {reply, Reply, State};
+
+handle_call(Req, From, State) ->
+ warning_msg("received unknown request (from ~p): ~n~p", [Req, From]),
+ {reply, {error, {invalid_request, Req}}, State}.
+
+
+%%--------------------------------------------------------------------
+%% Func: handle_cast/2
+%% Returns: {noreply, State} |
+%% {noreply, State, Timeout} |
+%% {stop, Reason, State} (terminate/2 is called)
+%%--------------------------------------------------------------------
+handle_cast({send_pdu, Pdu, Vsn, MsgData, Domain, Addr, Port, ExtraInfo},
+ State) ->
+ ?vlog("received send_pdu message with"
+ "~n Pdu: ~p"
+ "~n Vsn: ~p"
+ "~n MsgData: ~p"
+ "~n Domain: ~p"
+ "~n Addr: ~p"
+ "~n Port: ~p", [Pdu, Vsn, MsgData, Domain, Addr, Port]),
+ maybe_process_extra_info(ExtraInfo),
+ handle_send_pdu(Pdu, Vsn, MsgData, Domain, Addr, Port, State),
+ {noreply, State};
+
+handle_cast({inform_response, Ref, Addr, Port}, State) ->
+ ?vlog("received inform_response message with"
+ "~n Ref: ~p"
+ "~n Addr: ~p"
+ "~n Port: ~p", [Ref, Addr, Port]),
+ handle_inform_response(Ref, Addr, Port, State),
+ {noreply, State};
+
+handle_cast(filter_reset, State) ->
+ ?vlog("received filter_reset message", []),
+ reset_counters(),
+ {noreply, State};
+
+handle_cast(Msg, State) ->
+ warning_msg("received unknown message: ~n~p", [Msg]),
+ {noreply, State}.
+
+
+%%--------------------------------------------------------------------
+%% Func: handle_info/2
+%% Returns: {noreply, State} |
+%% {noreply, State, Timeout} |
+%% {stop, Reason, State} (terminate/2 is called)
+%%--------------------------------------------------------------------
+handle_info({udp, Sock, Ip, Port, Bytes}, #state{sock = Sock} = State) ->
+ ?vlog("received ~w bytes from ~p:~p", [size(Bytes), Ip, Port]),
+ handle_udp(Ip, Port, Bytes, State),
+ {noreply, State};
+
+handle_info(inform_response_gc, State) ->
+ ?vlog("received inform_response_gc message", []),
+ State2 = handle_inform_response_gc(State),
+ {noreply, State2};
+
+handle_info({disk_log, _Node, Log, Info}, State) ->
+ ?vlog("received disk_log message: "
+ "~n Info: ~p", [Info]),
+ State2 = handle_disk_log(Log, Info, State),
+ {noreply, State2};
+
+handle_info({'DOWN', _MRef, process, Pid, {net_if_worker, ExitStatus}},
+ State) ->
+ ?vdebug("received DOWN message from net_if-worker: "
+ "~n ExitStatus: ~p", [ExitStatus]),
+ handle_worker_exit(Pid, ExitStatus),
+ {noreply, State};
+
+handle_info(Info, State) ->
+ warning_msg("received unknown info: ~n~p", [Info]),
+ {noreply, State}.
+
+
+%%--------------------------------------------------------------------
+%% Func: terminate/2
+%% Purpose: Shutdown the server
+%% Returns: any (ignored by gen_server)
+%%--------------------------------------------------------------------
+terminate(Reason, #state{log = Log, irgc = IrGcRef}) ->
+ ?vdebug("terminate: ~p", [Reason]),
+ irgc_stop(IrGcRef),
+ %% Close logs
+ do_close_log(Log),
+ ok.
+
+
+do_close_log({Log, _Type}) ->
+ (catch snmp_log:sync(Log)),
+ (catch snmp_log:close(Log)),
+ ok;
+do_close_log(_) ->
+ ok.
+
+
+%%----------------------------------------------------------------------
+%% Func: code_change/3
+%% Purpose: Convert process state when code is changed
+%% Returns: {ok, NewState}
+%%----------------------------------------------------------------------
+
+code_change(_Vsn, State, _Extra) ->
+ ?d("code_change -> entry with"
+ "~n Vsn: ~p"
+ "~n State: ~p"
+ "~n Extra: ~p", [_Vsn, State, _Extra]),
+ {ok, State}.
+
+
+%%%-------------------------------------------------------------------
+%%% Internal functions
+%%%-------------------------------------------------------------------
+
+handle_udp(Addr, Port, Bytes, State) ->
+ Verbosity = get(verbosity),
+ spawn_opt(fun() ->
+ Log = worker_init(State, Verbosity),
+ Res = (catch maybe_handle_recv_msg(
+ Addr, Port, Bytes,
+ State#state{log = Log})),
+ worker_exit(udp, {Addr, Port}, Res)
+ end,
+ [monitor]).
+
+
+maybe_handle_recv_msg(Addr, Port, Bytes, #state{filter = FilterMod} = State) ->
+ case (catch FilterMod:accept_recv(Addr, Port)) of
+ false ->
+ %% Drop the received packet
+ inc(netIfMsgInDrops),
+ ok;
+ _ ->
+ handle_recv_msg(Addr, Port, Bytes, State)
+ end.
+
+
+handle_recv_msg(Addr, Port, Bytes, #state{server = Pid})
+ when is_binary(Bytes) andalso (size(Bytes) =:= 0) ->
+ Pid ! {snmp_error, {empty_message, Addr, Port}, Addr, Port},
+ ok;
+
+handle_recv_msg(Addr, Port, Bytes,
+ #state{server = Pid,
+ note_store = NoteStore,
+ mpd_state = MpdState,
+ sock = Sock,
+ log = Log} = State) ->
+ Domain = snmp_conf:which_domain(Addr), % What the ****...
+ Logger = logger(Log, read, Addr, Port),
+ case (catch snmpm_mpd:process_msg(Bytes, Domain, Addr, Port,
+ MpdState, NoteStore, Logger)) of
+
+ {ok, Vsn, Pdu, MS, ACM} ->
+ maybe_handle_recv_pdu(Addr, Port, Vsn, Pdu, MS, ACM,
+ Logger, State);
+
+ {discarded, Reason, Report} ->
+ ?vdebug("discarded: ~p", [Reason]),
+ ErrorInfo = {failed_processing_message, Reason},
+ Pid ! {snmp_error, ErrorInfo, Addr, Port},
+ maybe_udp_send(State#state.filter, Sock, Addr, Port, Report),
+ ok;
+
+ {discarded, Reason} ->
+ ?vdebug("discarded: ~p", [Reason]),
+ ErrorInfo = {failed_processing_message, Reason},
+ Pid ! {snmp_error, ErrorInfo, Addr, Port},
+ ok;
+
+ Error ->
+ error_msg("processing of received message failed: "
+ "~n ~p", [Error]),
+ ok
+ end.
+
+
+maybe_handle_recv_pdu(Addr, Port,
+ Vsn, #pdu{type = Type} = Pdu, PduMS, ACM,
+ Logger,
+ #state{filter = FilterMod} = State) ->
+ case (catch FilterMod:accept_recv_pdu(Addr, Port, Type)) of
+ false ->
+ inc(netIfPduInDrops),
+ ok;
+ _ ->
+ handle_recv_pdu(Addr, Port, Vsn, Pdu, PduMS, ACM, Logger, State)
+ end;
+maybe_handle_recv_pdu(Addr, Port, Vsn, Trap, PduMS, ACM, Logger,
+ #state{filter = FilterMod} = State)
+ when is_record(Trap, trappdu) ->
+ case (catch FilterMod:accept_recv_pdu(Addr, Port, trappdu)) of
+ false ->
+ inc(netIfPduInDrops),
+ ok;
+ _ ->
+ handle_recv_pdu(Addr, Port, Vsn, Trap, PduMS, ACM, Logger, State)
+ end;
+maybe_handle_recv_pdu(Addr, Port, Vsn, Pdu, PduMS, ACM, Logger, State) ->
+ handle_recv_pdu(Addr, Port, Vsn, Pdu, PduMS, ACM, Logger, State).
+
+
+handle_recv_pdu(Addr, Port,
+ Vsn, #pdu{type = 'inform-request'} = Pdu, _PduMS, ACM,
+ Logger, #state{server = Pid, irb = IRB} = State) ->
+ handle_inform_request(IRB, Pid, Vsn, Pdu, ACM,
+ Addr, Port, Logger, State);
+handle_recv_pdu(Addr, Port,
+ _Vsn, #pdu{type = report} = Pdu, _PduMS, ok,
+ _Logger,
+ #state{server = Pid} = _State) ->
+ ?vtrace("received report - ok", []),
+ Pid ! {snmp_report, {ok, Pdu}, Addr, Port},
+ ok;
+handle_recv_pdu(Addr, Port,
+ _Vsn, #pdu{type = report} = Pdu, _PduMS,
+ {error, ReqId, Reason},
+ _Logger,
+ #state{server = Pid} = _State) ->
+ ?vtrace("received report - error", []),
+ Pid ! {snmp_report, {error, ReqId, Reason, Pdu}, Addr, Port},
+ ok;
+handle_recv_pdu(Addr, Port,
+ _Vsn, #pdu{type = 'snmpv2-trap'} = Pdu, _PduMS, _ACM,
+ _Logger,
+ #state{server = Pid} = _State) ->
+ ?vtrace("received snmpv2-trap", []),
+ Pid ! {snmp_trap, Pdu, Addr, Port},
+ ok;
+handle_recv_pdu(Addr, Port,
+ _Vsn, Trap, _PduMS, _ACM,
+ _Logger,
+ #state{server = Pid} = _State) when is_record(Trap, trappdu) ->
+ ?vtrace("received trappdu", []),
+ Pid ! {snmp_trap, Trap, Addr, Port},
+ ok;
+handle_recv_pdu(Addr, Port,
+ _Vsn, Pdu, _PduMS, _ACM,
+ _Logger,
+ #state{server = Pid} = _State) when is_record(Pdu, pdu) ->
+ ?vtrace("received pdu", []),
+ Pid ! {snmp_pdu, Pdu, Addr, Port},
+ ok;
+handle_recv_pdu(_Addr, _Port, _Vsn, Pdu, _PduMS, ACM, _Logger, _State) ->
+ ?vlog("received unexpected pdu: "
+ "~n Pdu: ~p"
+ "~n ACM: ~p", [Pdu, ACM]),
+ ok.
+
+
+handle_inform_request(auto, Pid, Vsn, Pdu, ACM, Addr, Port, Logger, State) ->
+ ?vtrace("received inform-request (true)", []),
+ Pid ! {snmp_inform, ignore, Pdu, Addr, Port},
+ RePdu = make_response_pdu(Pdu),
+ maybe_send_inform_response(RePdu, Vsn, ACM, Addr, Port, Logger, State);
+handle_inform_request({user, To}, Pid, Vsn, #pdu{request_id = ReqId} = Pdu,
+ ACM, Addr, Port, _Logger, _State) ->
+ ?vtrace("received inform-request (false)", []),
+
+ Pid ! {snmp_inform, ReqId, Pdu, Addr, Port},
+
+ %% Before we go any further, we need to check that we have not
+ %% already received this message (possible resend).
+
+ Key = {ReqId, Addr, Port},
+ case ets:lookup(snmpm_inform_request_table, Key) of
+ [_] ->
+ %% OK, we already know about this. We assume this
+ %% is a resend. Either the agent is really eager or
+ %% the user has not answered yet. Bad user!
+ ok;
+ [] ->
+ RePdu = make_response_pdu(Pdu),
+ Expire = t() + To,
+ Rec = {Key, Expire, {Vsn, ACM, RePdu}},
+ ets:insert(snmpm_inform_request_table, Rec)
+ end,
+ ok.
+
+handle_inform_response(Ref, Addr, Port, State) ->
+ Verbosity = get(verbosity),
+ spawn_opt(fun() ->
+ Log = worker_init(State, Verbosity),
+ Res = (catch do_handle_inform_response(
+ Ref,
+ Addr, Port,
+ State#state{log = Log})),
+ worker_exit(inform_reponse, {Addr, Port}, Res)
+ end,
+ [monitor]).
+
+
+
+do_handle_inform_response(Ref, Addr, Port, State) ->
+ Key = {Ref, Addr, Port},
+ case ets:lookup(snmpm_inform_request_table, Key) of
+ [{Key, _, {Vsn, ACM, RePdu}}] ->
+ Logger = logger(State#state.log, read, Addr, Port),
+ ets:delete(snmpm_inform_request_table, Key),
+ maybe_send_inform_response(RePdu, Vsn, ACM, Addr, Port,
+ Logger, State);
+ [] ->
+ %% Already acknowledged, or the user was to slow to reply...
+ ok
+ end,
+ ok.
+
+maybe_send_inform_response(RePdu, Vsn, ACM, Addr, Port, Logger,
+ #state{server = Pid,
+ sock = Sock,
+ filter = FilterMod}) ->
+ case (catch FilterMod:accept_send_pdu(Addr, Port, pdu_type_of(RePdu))) of
+ false ->
+ inc(netIfPduOutDrops),
+ ok;
+ _ ->
+ case snmpm_mpd:generate_response_msg(Vsn, RePdu, ACM, Logger) of
+ {ok, Msg} ->
+ maybe_udp_send(FilterMod, Sock, Addr, Port, Msg);
+ {discarded, Reason} ->
+ ?vlog("failed generating response message:"
+ "~n Reason: ~p", [Reason]),
+ ReqId = RePdu#pdu.request_id,
+ ErrorInfo = {failed_generating_response, {RePdu, Reason}},
+ Pid ! {snmp_error, ReqId, ErrorInfo, Addr, Port},
+ ok
+ end
+ end.
+
+handle_inform_response_gc(#state{irb = IRB} = State) ->
+ ets:safe_fixtable(snmpm_inform_request_table, true),
+ do_irgc(ets:first(snmpm_inform_request_table), t()),
+ ets:safe_fixtable(snmpm_inform_request_table, false),
+ State#state{irgc = irgc_start(IRB)}.
+
+%% We are deleting at the same time as we are traversing the table!!!
+do_irgc('$end_of_table', _) ->
+ ok;
+do_irgc(Key, Now) ->
+ Next = ets:next(snmpm_inform_request_table, Key),
+ case ets:lookup(snmpm_inform_request_table, Key) of
+ [{Key, BestBefore, _}] when BestBefore < Now ->
+ ets:delete(snmpm_inform_request_table, Key);
+ _ ->
+ ok
+ end,
+ do_irgc(Next, Now).
+
+irgc_start(auto) ->
+ undefined;
+irgc_start(_) ->
+ erlang:send_after(?IRGC_TIMEOUT, self(), inform_response_gc).
+
+irgc_stop(undefined) ->
+ ok;
+irgc_stop(Ref) ->
+ (catch erlang:cancel_timer(Ref)).
+
+
+handle_send_pdu(Pdu, Vsn, MsgData, Domain, Addr, Port, State) ->
+ Verbosity = get(verbosity),
+ spawn_opt(fun() ->
+ Log = worker_init(State, Verbosity),
+ Res = (catch maybe_handle_send_pdu(
+ Pdu, Vsn, MsgData,
+ Domain, Addr, Port,
+ State#state{log = Log})),
+ worker_exit(send_pdu, {Domain, Addr, Port}, Res)
+ end,
+ [monitor]).
+
+maybe_handle_send_pdu(Pdu, Vsn, MsgData, Domain, Addr, Port,
+ #state{filter = FilterMod} = State) ->
+ case (catch FilterMod:accept_send_pdu(Addr, Port, pdu_type_of(Pdu))) of
+ false ->
+ inc(netIfPduOutDrops),
+ ok;
+ _ ->
+ do_handle_send_pdu(Pdu, Vsn, MsgData, Domain, Addr, Port, State)
+ end.
+
+do_handle_send_pdu(Pdu, Vsn, MsgData, _Domain, Addr, Port,
+ #state{server = Pid,
+ note_store = NoteStore,
+ sock = Sock,
+ log = Log,
+ filter = FilterMod}) ->
+ Logger = logger(Log, write, Addr, Port),
+ case (catch snmpm_mpd:generate_msg(Vsn, NoteStore,
+ Pdu, MsgData, Logger)) of
+ {ok, Msg} ->
+ ?vtrace("do_handle_send_pdu -> message generated", []),
+ maybe_udp_send(FilterMod, Sock, Addr, Port, Msg);
+ {discarded, Reason} ->
+ ?vlog("PDU not sent: "
+ "~n PDU: ~p"
+ "~n Reason: ~p", [Pdu, Reason]),
+ Pid ! {snmp_error, Pdu, Reason},
+ ok
+ end.
+
+
+maybe_udp_send(FilterMod, Sock, Addr, Port, Msg) ->
+ case (catch FilterMod:accept_send(Addr, Port)) of
+ false ->
+ inc(netIfMsgOutDrops),
+ ok;
+ _ ->
+ udp_send(Sock, Addr, Port, Msg)
+ end.
+
+
+udp_send(Sock, Addr, Port, Msg) ->
+ case (catch gen_udp:send(Sock, Addr, Port, Msg)) of
+ ok ->
+ ?vdebug("sent ~w bytes to ~w:~w [~w]",
+ [sz(Msg), Addr, Port, Sock]),
+ ok;
+ {error, Reason} ->
+ error_msg("failed sending message to ~p:~p: "
+ "~n ~p",[Addr, Port, Reason]),
+ ok;
+ Error ->
+ error_msg("failed sending message to ~p:~p: "
+ "~n ~p",[Addr, Port, Error]),
+ ok
+ end.
+
+sz(B) when is_binary(B) ->
+ size(B);
+sz(L) when is_list(L) ->
+ length(L);
+sz(_) ->
+ undefined.
+
+
+handle_disk_log(_Log, {wrap, NoLostItems}, State) ->
+ ?vlog("Audit Trail Log - wrapped: ~w previously logged items where lost",
+ [NoLostItems]),
+ State;
+handle_disk_log(_Log, {truncated, NoLostItems}, State) ->
+ ?vlog("Audit Trail Log - truncated: ~w items where lost when truncating",
+ [NoLostItems]),
+ State;
+handle_disk_log(_Log, full, State) ->
+ error_msg("Failed to write to Audit Trail Log (full)", []),
+ State;
+handle_disk_log(_Log, {error_status, ok}, State) ->
+ State;
+handle_disk_log(_Log, {error_status, {error, Reason}}, State) ->
+ error_msg("Error status received from Audit Trail Log: "
+ "~n~p", [Reason]),
+ State;
+handle_disk_log(_Log, _Info, State) ->
+ State.
+
+
+%% mk_discovery_msg('version-3', Pdu, _VsnHdr, UserName) ->
+%% ScopedPDU = #scopedPdu{contextEngineID = "",
+%% contextName = "",
+%% data = Pdu},
+%% Bytes = snmp_pdus:enc_scoped_pdu(ScopedPDU),
+%% MsgID = get(msg_id),
+%% put(msg_id,MsgID+1),
+%% UsmSecParams =
+%% #usmSecurityParameters{msgAuthoritativeEngineID = "",
+%% msgAuthoritativeEngineBoots = 0,
+%% msgAuthoritativeEngineTime = 0,
+%% msgUserName = UserName,
+%% msgPrivacyParameters = "",
+%% msgAuthenticationParameters = ""},
+%% SecBytes = snmp_pdus:enc_usm_security_parameters(UsmSecParams),
+%% PduType = Pdu#pdu.type,
+%% Hdr = #v3_hdr{msgID = MsgID,
+%% msgMaxSize = 1000,
+%% msgFlags = snmp_misc:mk_msg_flags(PduType, 0),
+%% msgSecurityModel = ?SEC_USM,
+%% msgSecurityParameters = SecBytes},
+%% Msg = #message{version = 'version-3', vsn_hdr = Hdr, data = Bytes},
+%% case (catch snmp_pdus:enc_message_only(Msg)) of
+%% {'EXIT', Reason} ->
+%% error("Encoding error. Pdu: ~w. Reason: ~w",[Pdu, Reason]),
+%% error;
+%% L when list(L) ->
+%% {Msg, L}
+%% end;
+%% mk_discovery_msg(Version, Pdu, {Com, _, _, _, _}, UserName) ->
+%% Msg = #message{version = Version, vsn_hdr = Com, data = Pdu},
+%% case catch snmp_pdus:enc_message(Msg) of
+%% {'EXIT', Reason} ->
+%% error("Encoding error. Pdu: ~w. Reason: ~w",[Pdu, Reason]),
+%% error;
+%% L when list(L) ->
+%% {Msg, L}
+%% end.
+
+
+%% mk_msg('version-3', Pdu, {Context, User, EngineID, CtxEngineId, SecLevel},
+%% MsgData) ->
+%% %% Code copied from snmp_mpd.erl
+%% {MsgId, SecName, SecData} =
+%% if
+%% tuple(MsgData), Pdu#pdu.type == 'get-response' ->
+%% MsgData;
+%% true ->
+%% Md = get(msg_id),
+%% put(msg_id, Md + 1),
+%% {Md, User, []}
+%% end,
+%% ScopedPDU = #scopedPdu{contextEngineID = CtxEngineId,
+%% contextName = Context,
+%% data = Pdu},
+%% ScopedPDUBytes = snmp_pdus:enc_scoped_pdu(ScopedPDU),
+
+%% PduType = Pdu#pdu.type,
+%% V3Hdr = #v3_hdr{msgID = MsgId,
+%% msgMaxSize = 1000,
+%% msgFlags = snmp_misc:mk_msg_flags(PduType, SecLevel),
+%% msgSecurityModel = ?SEC_USM},
+%% Message = #message{version = 'version-3', vsn_hdr = V3Hdr,
+%% data = ScopedPDUBytes},
+%% SecEngineID = case PduType of
+%% 'get-response' -> snmp_framework_mib:get_engine_id();
+%% _ -> EngineID
+%% end,
+%% case catch snmp_usm:generate_outgoing_msg(Message, SecEngineID,
+%% SecName, SecData, SecLevel) of
+%% {'EXIT', Reason} ->
+%% error("Encoding error. Pdu: ~w. Reason: ~w",[Pdu, Reason]),
+%% error;
+%% {error, Reason} ->
+%% error("Encoding error. Pdu: ~w. Reason: ~w",[Pdu, Reason]),
+%% error;
+%% Packet ->
+%% Packet
+%% end;
+%% mk_msg(Version, Pdu, {Com, _User, _EngineID, _Ctx, _SecLevel}, _SecData) ->
+%% Msg = #message{version = Version, vsn_hdr = Com, data = Pdu},
+%% case catch snmp_pdus:enc_message(Msg) of
+%% {'EXIT', Reason} ->
+%% error("Encoding error. Pdu: ~w. Reason: ~w",[Pdu, Reason]),
+%% error;
+%% B when list(B) ->
+%% B
+%% end.
+
+
+%% handle_system_info_updated(#state{log = {Log, _OldType}} = State,
+%% audit_trail_log_type = _What) ->
+%% %% Just to make sure, check that ATL is actually enabled
+%% case snmpm_config:system_info(audit_trail_log) of
+%% {ok, true} ->
+%% {ok, Type} = snmpm_config:system_info(audit_trail_log_type),
+%% NewState = State#state{log = {Log, Type}},
+%% {NewState, ok};
+%% _ ->
+%% {State, {error, {adt_not_enabled}}}
+%% end;
+%% handle_system_info_updated(_State, _What) ->
+%% ok.
+
+handle_get_log_type(#state{log = {_Log, Value}} = State) ->
+ %% Just to make sure, check that ATL is actually enabled
+ case snmpm_config:system_info(audit_trail_log) of
+ {ok, true} ->
+ Type =
+ case {lists:member(read, Value), lists:member(write, Value)} of
+ {true, true} ->
+ read_write;
+ {true, false} ->
+ read;
+ {false, true} ->
+ write;
+ {false, false} ->
+ throw({State, {error, {bad_atl_type, Value}}})
+ end,
+ {ok, Type};
+ _ ->
+ {error, not_enabled}
+ end;
+handle_get_log_type(_State) ->
+ {error, not_enabled}.
+
+handle_set_log_type(#state{log = {Log, OldValue}} = State, NewType) ->
+ %% Just to make sure, check that ATL is actually enabled
+ case snmpm_config:system_info(audit_trail_log) of
+ {ok, true} ->
+ NewValue =
+ case NewType of
+ read ->
+ [read];
+ write ->
+ [write];
+ read_write ->
+ [read,write];
+ _ ->
+ throw({State, {error, {bad_atl_type, NewType}}})
+ end,
+ NewState = State#state{log = {Log, NewValue}},
+ OldType =
+ case {lists:member(read, OldValue),
+ lists:member(write, OldValue)} of
+ {true, true} ->
+ read_write;
+ {true, false} ->
+ read;
+ {false, true} ->
+ write;
+ {false, false} ->
+ throw({State, {error, {bad_atl_type, OldValue}}})
+ end,
+ {NewState, {ok, OldType}};
+ _ ->
+ {State, {error, not_enabled}}
+ end;
+handle_set_log_type(State, _NewType) ->
+ {State, {error, not_enabled}}.
+
+
+%% -------------------------------------------------------------------
+
+worker_init(#state{log = undefined = Log}, Verbosity) ->
+ worker_init2(Log, Verbosity);
+worker_init(#state{log = {Name, Log, Type}}, Verbosity) ->
+ case snmp_log:open(Name, Log) of
+ {ok, NewLog} ->
+ worker_init2({Name, NewLog, Type}, Verbosity);
+ {error, Reason} ->
+ warning_msg("NetIf worker ~p failed opening ATL: "
+ "~n ~p", [self(), Reason]),
+ NewLog = undefined,
+ worker_init2({Name, NewLog, Type}, Verbosity)
+ end;
+worker_init(State, Verbosity) ->
+ ?vinfo("worker_init -> entry with invalid data: "
+ "~n State: ~p"
+ "~n Verbosity: ~p", [State, Verbosity]),
+ exit({worker_init, State, Verbosity}).
+
+worker_init2(Log, Verbosity) ->
+ put(sname, mnifw),
+ put(verbosity, Verbosity),
+ Log.
+
+
+worker_exit(Tag, Info, Result) ->
+ exit({net_if_worker, {Tag, Info, Result}}).
+
+handle_worker_exit(_, {_, _, ok}) ->
+ ok;
+handle_worker_exit(Pid, {udp, {Addr, Port}, ExitStatus}) ->
+ warning_msg("Worker process (~p) terminated "
+ "while processing (incomming) message from ~w:~w: "
+ "~n~p", [Pid, Addr, Port, ExitStatus]),
+ ok;
+handle_worker_exit(Pid, {send_pdu, {Domain, Addr, Port}, ExitStatus}) ->
+ warning_msg("Worker process (~p) terminated "
+ "while processing (outgoing) pdu for [~w] ~w:~w: "
+ "~n~p", [Pid, Domain, Addr, Port, ExitStatus]),
+ ok;
+handle_worker_exit(Pid, {inform_response, {Addr, Port}, ExitStatus}) ->
+ warning_msg("Worker process (~p) terminated "
+ "while processing (outgoing) inform response for ~w:~w: "
+ "~n~p", [Pid, Addr, Port, ExitStatus]),
+ ok;
+handle_worker_exit(_, _) ->
+ ok.
+
+
+%% -------------------------------------------------------------------
+
+make_response_pdu(#pdu{request_id = ReqId, varbinds = Vbs}) ->
+ #pdu{type = 'get-response',
+ request_id = ReqId,
+ error_status = noError,
+ error_index = 0,
+ varbinds = Vbs}.
+
+
+%% ----------------------------------------------------------------
+
+pdu_type_of(#pdu{type = Type}) ->
+ Type;
+pdu_type_of(TrapPdu) when is_record(TrapPdu, trappdu) ->
+ trap.
+
+
+%% -------------------------------------------------------------------
+
+%% At this point this function is used during testing
+maybe_process_extra_info(?DEFAULT_EXTRA_INFO) ->
+ ok;
+maybe_process_extra_info({?SNMPM_EXTRA_INFO_TAG, Fun})
+ when is_function(Fun, 0) ->
+ (catch Fun()),
+ ok;
+maybe_process_extra_info(_ExtraInfo) ->
+ ok.
+
+
+%% -------------------------------------------------------------------
+
+t() ->
+ {A,B,C} = erlang:now(),
+ A*1000000000+B*1000+(C div 1000).
+
+
+%% -------------------------------------------------------------------
+
+logger(undefined, _Type, _Addr, _Port) ->
+ fun(_) ->
+ ok
+ end;
+logger({_Name, Log, Types}, Type, Addr, Port) ->
+ case lists:member(Type, Types) of
+ true ->
+ fun(Msg) ->
+ snmp_log:log(Log, Msg, Addr, Port)
+ end;
+ false ->
+ fun(_) ->
+ ok
+ end
+ end.
+
+
+%% -------------------------------------------------------------------
+
+%% info_msg(F, A) ->
+%% ?snmpm_info("NET-IF server: " ++ F, A).
+
+warning_msg(F, A) ->
+ ?snmpm_warning("NET-IF server: " ++ F, A).
+
+error_msg(F, A) ->
+ ?snmpm_error("NET-IF server: " ++ F, A).
+
+
+
+%%%-------------------------------------------------------------------
+
+% get_opt(Key, Opts) ->
+% ?vtrace("get option ~w", [Key]),
+% snmp_misc:get_option(Key, Opts).
+
+get_opt(Opts, Key, Def) ->
+ ?vtrace("get option ~w with default ~p", [Key, Def]),
+ snmp_misc:get_option(Key, Opts, Def).
+
+
+%% -------------------------------------------------------------------
+
+get_info(#state{sock = Id}) ->
+ ProcSize = proc_mem(self()),
+ PortInfo = get_port_info(Id),
+ [{process_memory, ProcSize}, {port_info, PortInfo}].
+
+proc_mem(P) when is_pid(P) ->
+ case (catch erlang:process_info(P, memory)) of
+ {memory, Sz} when is_integer(Sz) ->
+ Sz;
+ _ ->
+ undefined
+ end.
+%% proc_mem(_) ->
+%% undefined.
+
+
+get_port_info(Id) ->
+ PortInfo =
+ case (catch erlang:port_info(Id)) of
+ PI when is_list(PI) ->
+ [{port_info, PI}];
+ _ ->
+ []
+ end,
+ PortStatus =
+ case (catch prim_inet:getstatus(Id)) of
+ {ok, PS} ->
+ [{port_status, PS}];
+ _ ->
+ []
+ end,
+ PortAct =
+ case (catch inet:getopts(Id, [active])) of
+ {ok, PA} ->
+ [{port_act, PA}];
+ _ ->
+ []
+ end,
+ PortStats =
+ case (catch inet:getstat(Id)) of
+ {ok, Stat} ->
+ [{port_stats, Stat}];
+ _ ->
+ []
+ end,
+ IfList =
+ case (catch inet:getif(Id)) of
+ {ok, IFs} ->
+ [{interfaces, IFs}];
+ _ ->
+ []
+ end,
+ BufSz =
+ case (catch inet:getopts(Id, [recbuf, sndbuf, buffer])) of
+ {ok, Sz} ->
+ [{buffer_size, Sz}];
+ _ ->
+ []
+ end,
+ [{socket, Id}] ++
+ IfList ++
+ PortStats ++
+ PortInfo ++
+ PortStatus ++
+ PortAct ++
+ BufSz.
+
+
+%%-----------------------------------------------------------------
+%% Counter functions
+%%-----------------------------------------------------------------
+init_counters() ->
+ F = fun(Counter) -> maybe_create_counter(Counter) end,
+ lists:map(F, counters()).
+
+reset_counters() ->
+ F = fun(Counter) -> snmpm_config:reset_stats_counter(Counter) end,
+ lists:map(F, counters()).
+
+maybe_create_counter(Counter) ->
+ snmpm_config:maybe_cre_stats_counter(Counter, 0).
+
+counters() ->
+ [
+ netIfMsgOutDrops,
+ netIfMsgInDrops,
+ netIfPduOutDrops,
+ netIfPduInDrops
+ ].
+
+inc(Name) -> inc(Name, 1).
+inc(Name, N) -> snmpm_config:incr_stats_counter(Name, N).
+
+%% get_counters() ->
+%% Counters = counters(),
+%% get_counters(Counters, []).
+
+%% get_counters([], Acc) ->
+%% lists:reverse(Acc);
+%% get_counters([Counter|Counters], Acc) ->
+%% case snmpm_config:get_stats_counter(Counter) of
+%% {ok, CounterVal} ->
+%% get_counters(Counters, [{Counter, CounterVal}|Acc]);
+%% _ ->
+%% get_counters(Counters, Acc)
+%% end.
+
+
+%% ----------------------------------------------------------------
+
+call(Pid, Req) ->
+ call(Pid, Req, infinity).
+
+call(Pid, Req, Timeout) ->
+ gen_server:call(Pid, Req, Timeout).
+
+cast(Pid, Msg) ->
+ gen_server:cast(Pid, Msg).
+
diff --git a/lib/snmp/src/misc/Makefile b/lib/snmp/src/misc/Makefile
index 48d76bdbed..698c341268 100644
--- a/lib/snmp/src/misc/Makefile
+++ b/lib/snmp/src/misc/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -109,13 +109,13 @@ info:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/misc
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/src/misc
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
-# $(INSTALL_DIR) $(RELSYSDIR)/include
-# $(INSTALL_DATA) $(EXT_HRL_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/misc"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/src/misc"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+# $(INSTALL_DIR) "$(RELSYSDIR)/include"
+# $(INSTALL_DATA) $(EXT_HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/snmp/src/misc/snmp_conf.erl b/lib/snmp/src/misc/snmp_conf.erl
index 7249def24e..e1e7fab57b 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -71,6 +71,18 @@
%%-----------------------------------------------------------------
+%% read_files(Dir, Files) -> Configs
+%% Dir - string() - Full path to the config dir.
+%% Files - [{Gen, Filter, Check, FileName}]
+%% Gen - function/2 - In case of failure when reading the config file,
+%% this function is called to either generate a
+%% default file or issue the error.
+%% Filter - function/1 - Filters all the config entries read from the file
+%% Check - function/1 - Check each entry as they are read from the file.
+%% FileName - string() - Name of the config file.
+%% Configs - [config_entry()]
+%% config_entry() - term()
+
read_files(Dir, Files) when is_list(Dir) andalso is_list(Files) ->
read_files(Dir, Files, []).
@@ -90,7 +102,7 @@ read_files(Dir, [{Gen, Filter, Check, FileName}|Files], Res)
{error, R} ->
?vlog("failed reading file info for ~s: "
"~n ~p", [FileName, R]),
- Gen(Dir),
+ Gen(Dir, R),
read_files(Dir, Files, [Filter([])|Res])
end.
@@ -99,6 +111,7 @@ read_files(Dir, [{Gen, Filter, Check, FileName}|Files], Res)
read(File, Check) when is_function(Check) ->
?vdebug("read -> entry with"
"~n File: ~p", [File]),
+
Fd = open_file(File),
case loop(Fd, [], Check, 1, File) of
diff --git a/lib/snmp/src/misc/snmp_config.erl b/lib/snmp/src/misc/snmp_config.erl
index 6ab20e3e48..0bed097b62 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -90,6 +90,17 @@
]).
+-export_type([void/0,
+ verify_config_entry_function/0,
+ verify_config_function/0,
+ write_config_function/0]).
+
+
+%%----------------------------------------------------------------------
+
+-type void() :: term(). % Any value - ignored
+
+
%%----------------------------------------------------------------------
%% Handy SNMP configuration
%%----------------------------------------------------------------------
@@ -2356,53 +2367,109 @@ write_sys_config_file_manager_atl_opt(Fid, {seqno, SeqNo}) ->
header() ->
- {Y,Mo,D} = date(),
- {H,Mi,S} = time(),
+ {Y, Mo, D} = date(),
+ {H, Mi, S} = time(),
io_lib:format("%% This file was generated by "
- "snmp_config (version-~s) ~w-~2.2.0w-~2.2.0w "
+ "~w (version-~s) ~w-~2.2.0w-~2.2.0w "
"~2.2.0w:~2.2.0w:~2.2.0w\n",
- [?version,Y,Mo,D,H,Mi,S]).
+ [?MODULE, ?version, Y, Mo, D, H, Mi, S]).
+
+%% *If* these functions are successfull, they successfully return anything
+%% (which is ignored), but they fail with either a throw or an exit or
+%% something similar.
+
+%% Verification of one config entry read from a file
+-type(verify_config_entry_function() ::
+ fun((Entry :: term()) -> ok | {error, Reason :: term()})).
+
+%% Verification of config to be written
+-type(verify_config_function() ::
+ fun(() -> void())).
+
+%% Write config to file (as defined by Fd)
+-type(write_config_function() ::
+ fun((Fd :: file:io_device()) -> void())).
+
+-spec write_config_file(Dir :: string(),
+ FileName :: string(),
+ Verify :: verify_config_function(),
+ Write :: write_config_function()) ->
+ ok | {error, Reason :: term()}.
write_config_file(Dir, FileName, Verify, Write)
when (is_list(Dir) andalso
is_list(FileName) andalso
is_function(Verify) andalso
is_function(Write)) ->
- (catch do_write_config_file(Dir, FileName, Verify, Write)).
+ try
+ begin
+ do_write_config_file(Dir, FileName, Verify, Write)
+ end
+ catch
+ throw:Error ->
+ Error;
+ T:E ->
+ {error, {failed_write, Dir, FileName, T, E}}
+ end.
+
do_write_config_file(Dir, FileName, Verify, Write) ->
Verify(),
case file:open(filename:join(Dir, FileName), [write]) of
{ok, Fd} ->
- (catch Write(Fd)),
- file:close(Fd),
- ok;
+ file_write_and_close(Write, Fd, Dir, FileName);
Error ->
Error
end.
-
append_config_file(Dir, FileName, Verify, Write)
when (is_list(Dir) andalso
is_list(FileName) andalso
is_function(Verify) andalso
is_function(Write)) ->
- (catch do_append_config_file(Dir, FileName, Verify, Write)).
+ try
+ begin
+ do_append_config_file(Dir, FileName, Verify, Write)
+ end
+ catch
+ throw:Error ->
+ Error;
+ T:E ->
+ {error, {failed_append, Dir, FileName, T, E}}
+ end.
do_append_config_file(Dir, FileName, Verify, Write) ->
Verify(),
case file:open(filename:join(Dir, FileName), [read, write]) of
{ok, Fd} ->
file:position(Fd, eof),
- (catch Write(Fd)),
- file:close(Fd),
- ok;
+ file_write_and_close(Write, Fd, Dir, FileName);
Error ->
Error
end.
+file_write_and_close(Write, Fd, Dir, FileName) ->
+ ok = Write(Fd),
+ case file:sync(Fd) of
+ ok ->
+ case file:close(Fd) of
+ ok ->
+ ok;
+ {error, Reason} ->
+ {error, {failed_closing, Dir, FileName, Reason}}
+ end;
+ {error, Reason} ->
+ {error, {failed_syncing, Dir, FileName, Reason}}
+ end.
+
+
+-spec read_config_file(Dir :: string(),
+ FileName :: string(),
+ Verify :: verify_config_entry_function()) ->
+ {ok, Config :: list()} | {error, Reason :: term()}.
+
read_config_file(Dir, FileName, Verify)
when is_list(Dir) andalso is_list(FileName) andalso is_function(Verify) ->
(catch do_read_config_file(Dir, FileName, Verify)).
diff --git a/lib/snmp/src/misc/snmp_log.erl b/lib/snmp/src/misc/snmp_log.erl
index 2c781810ef..a8c5df0b64 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -21,7 +21,7 @@
-export([
- create/4, create/5, create/6,
+ create/4, create/5, create/6, open/1, open/2,
change_size/2, close/1, sync/1, info/1,
log/4,
log_to_txt/5, log_to_txt/6, log_to_txt/7,
@@ -109,6 +109,24 @@ create(Name, File, SeqNoGen, Size, Repair, Notify) ->
{error, {bad_args, Name, File, SeqNoGen, Size, Repair, Notify}}.
+%% -- open ---
+
+%% Open an already existing ( = open ) log
+
+open(Name) ->
+ open(Name, #snmp_log{seqno = disabled}).
+open(Name, #snmp_log{seqno = SeqNoGen} = _OldLog) ->
+ %% We include mode in the opts just to be on the safe side
+ case disk_log:open([{name, Name}, {mode, read_write}]) of
+ {ok, Log} ->
+ %% SeqNo must be proprly initiated also
+ {ok, #snmp_log{id = Log, seqno = SeqNoGen}};
+ {repaired, Log, _RecBytes, _BadBytes} ->
+ {ok, #snmp_log{id = Log, seqno = SeqNoGen}};
+ ERROR ->
+ ERROR
+ end.
+
%% -- close ---
@@ -394,6 +412,14 @@ log_to_io(Log, FileName, Dir, Mibs, Start) ->
log_to_io(Log, FileName, Dir, Mibs, Start, Stop)
when is_list(Mibs) ->
+ ?vtrace("log_to_io -> entry with"
+ "~n Log: ~p"
+ "~n FileName: ~p"
+ "~n Dir: ~p"
+ "~n Mibs: ~p"
+ "~n Start: ~p"
+ "~n Stop: ~p",
+ [Log, FileName, Dir, Mibs, Start, Stop]),
File = filename:join(Dir, FileName),
Converter = fun(L) ->
do_log_to_io(L, Mibs, Start, Stop)
@@ -401,28 +427,10 @@ log_to_io(Log, FileName, Dir, Mibs, Start, Stop)
log_convert(Log, File, Converter).
-%% -- log_to_plain ---
-
-%% log_to_plain(Log, FileName, Dir) ->
-%% log_to_plain(Log, FileName, Dir, null, null).
-
-%% log_to_plain(Log, FileName, Dir, Start) ->
-%% log_to_plain(Log, FileName, Dir, Start, null).
-
-%% log_to_plain(Log, FileName, Dir, Start, Stop)
-%% when is_list(Mibs) ->
-%% File = filename:join(Dir, FileName),
-%% Converter = fun(L) ->
-%% do_log_to_plain(L, Start, Stop)
-%% end,
-%% log_convert(Log, File, Converter).
-
-
%% --------------------------------------------------------------------
%% Internal functions
%% --------------------------------------------------------------------
-
%% -- log_convert ---
log_convert(#snmp_log{id = Log}, File, Converter) ->
@@ -431,6 +439,26 @@ log_convert(Log, File, Converter) ->
do_log_convert(Log, File, Converter).
do_log_convert(Log, File, Converter) ->
+ %% ?vtrace("do_log_converter -> entry with"
+ %% "~n Log: ~p"
+ %% "~n File: ~p"
+ %% "~n disk_log:info(Log): ~p", [Log, File, disk_log:info(Log)]),
+ {Pid, Ref} =
+ erlang:spawn_monitor(
+ fun() ->
+ Result = do_log_convert2(Log, File, Converter),
+ exit(Result)
+ end),
+ receive
+ {'DOWN', Ref, process, Pid, Result} ->
+ %% ?vtrace("do_log_converter -> received result"
+ %% "~n Result: ~p"
+ %% "~n disk_log:info(Log): ~p",
+ %% [Result, disk_log:info(Log)]),
+ Result
+ end.
+
+do_log_convert2(Log, File, Converter) ->
%% First check if the caller process has already opened the
%% log, because if we close an already open log we will cause
%% a runtime error.
@@ -439,29 +467,18 @@ do_log_convert(Log, File, Converter) ->
Converter(Log);
false ->
%% Not yet member of the ruling party, apply for membership...
- %% If a log is opened as read_write it is not possible to
- %% open it as read_only. So, to get around this we open
- %% it under a different name...
- Log2 = convert_name(Log),
- case log_open(Log2, File) of
+ case log_open(Log, File) of
{ok, _} ->
- Res = Converter(Log2),
- disk_log:close(Log2),
+ Res = Converter(Log),
+ disk_log:close(Log),
Res;
{error, {name_already_open, _}} ->
- Converter(Log2);
+ Converter(Log);
{error, Reason} ->
{error, {Log, Reason}}
end
end.
-convert_name(Name) when is_list(Name) ->
- Name ++ "_tmp";
-convert_name(Name) when is_atom(Name) ->
- list_to_atom(atom_to_list(Name) ++ "_tmp");
-convert_name(Name) ->
- lists:flatten(io_lib:format("~w_tmp", [Name])).
-
%% -- do_log_to_text ---
@@ -705,21 +722,21 @@ tsf_ge(_Local,Universal,{universal_time,DateTime}) ->
tsf_ge(Local,_Universal,DateTime) ->
tsf_ge(Local,DateTime).
-tsf_ge(TimeStamp,DateTime) ->
+tsf_ge(TimeStamp, DateTime) ->
T1 = calendar:datetime_to_gregorian_seconds(TimeStamp),
T2 = calendar:datetime_to_gregorian_seconds(DateTime),
T1 >= T2.
-tsf_le(_Local,_Universal,null) ->
+tsf_le(_Local, _Universal, null) ->
true;
-tsf_le(Local,_Universal,{local_time,DateTime}) ->
- tsf_le(Local,DateTime);
-tsf_le(_Local,Universal,{universal_time,DateTime}) ->
- tsf_le(Universal,DateTime);
-tsf_le(Local,_Universal,DateTime) ->
+tsf_le(Local, _Universal, {local_time, DateTime}) ->
+ tsf_le(Local, DateTime);
+tsf_le(_Local, Universal, {universal_time, DateTime}) ->
+ tsf_le(Universal, DateTime);
+tsf_le(Local, _Universal, DateTime) ->
tsf_le(Local,DateTime).
-tsf_le(TimeStamp,DateTime) ->
+tsf_le(TimeStamp, DateTime) ->
T1 = calendar:datetime_to_gregorian_seconds(TimeStamp),
T2 = calendar:datetime_to_gregorian_seconds(DateTime),
T1 =< T2.
@@ -864,11 +881,8 @@ do_std_log_open(Name, File, Size, Repair, Notify) ->
log_open(Name, File) ->
- Opts = [{name, Name},
- {file, File},
- {type, ?LOG_TYPE},
- {format, ?LOG_FORMAT},
- {mode, read_only}],
+ Opts = [{name, Name},
+ {file, File}],
case disk_log:open(Opts) of
{error, {badarg, size}} ->
{error, no_such_log};
diff --git a/lib/snmp/src/misc/snmp_pdus.erl b/lib/snmp/src/misc/snmp_pdus.erl
index 0788d86b2d..15156f7467 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -254,68 +254,95 @@ strip(0, _Tail) ->
%%----------------------------------------------------------------------
%% Returns:{Type, Value}
%%----------------------------------------------------------------------
+
+%% OBJECT IDENTIFIER
dec_value([6 | Bytes]) ->
{Value, Rest} = dec_oid_notag(Bytes),
{{'OBJECT IDENTIFIER', Value}, Rest};
dec_value([5,0 | T]) ->
{{'NULL', 'NULL'}, T};
+
+%% INTEGER
dec_value([2 | Bytes]) ->
{Value, Rest} = dec_integer_notag(Bytes),
{{'INTEGER', Value}, Rest};
+
+%% OCTET STRING
dec_value([4 | Bytes]) ->
{Value, Rest} = dec_oct_str_notag(Bytes),
{{'OCTET STRING', Value}, Rest};
+
+%% IpAddress
dec_value([64 | Bytes]) ->
{Value, Rest} = dec_oct_str_notag(Bytes),
{{'IpAddress', Value}, Rest};
+
+%% Counter32
dec_value([65 | Bytes]) ->
%% Counter32 is an unsigned 32 but is actually encoded as
%% a signed integer 32 (INTEGER).
{Value, Rest} = dec_integer_notag(Bytes),
Value2 =
- if
+ if
+ (Value >= 0) andalso (Value =< 16#ffffffff) ->
+ %% We accept value above 16#7fffffff
+ %% in order to be backward bug-compatible
+ Value;
+ (Value < 0) ->
+ 16#ffffffff + Value + 1;
+ true ->
+ exit({error, {bad_counter32, Value}})
+ end,
+ {{'Counter32', Value2}, Rest};
+
+%% Unsigned32
+dec_value([66 | Bytes]) ->
+ {Value, Rest} = dec_integer_notag(Bytes),
+ Value2 =
+ if
(Value >= 0) andalso (Value =< 16#ffffffff) ->
- %% We accept value above 16#7fffffff
- %% in order to be backward bug-compatible
Value;
(Value < 0) ->
16#ffffffff + Value + 1;
true ->
- exit({error, {bad_counter32, Value}})
+ exit({error, {bad_unsigned32, Value}})
end,
- {{'Counter32', Value2}, Rest};
-dec_value([66 | Bytes]) ->
- {Value, Rest} = dec_integer_notag(Bytes),
- if
- (Value >= 0) andalso (Value =< 4294967295) ->
- {{'Unsigned32', Value}, Rest};
- true ->
- exit({error, {bad_unsigned32, Value}})
- end;
+ {{'Unsigned32', Value2}, Rest};
+
+%% TimeTicks
dec_value([67 | Bytes]) ->
{Value, Rest} = dec_integer_notag(Bytes),
- if
- (Value >= 0) andalso (Value =< 4294967295) ->
- {{'TimeTicks', Value}, Rest};
+ Value2 =
+ if
+ (Value >= 0) andalso (Value =< 16#ffffffff) ->
+ Value;
+ (Value < 0) ->
+ 16#ffffffff + Value + 1;
true ->
exit({error, {bad_timeticks, Value}})
- end;
+ end,
+ {{'TimeTicks', Value2}, Rest};
+
+%% Opaque
dec_value([68 | Bytes]) ->
{Value, Rest} = dec_oct_str_notag(Bytes),
{{'Opaque', Value}, Rest};
+
+%% Counter64
dec_value([70 | Bytes]) ->
%% Counter64 is an unsigned 64 but is actually encoded as
%% a signed integer 64.
{Value, Rest} = dec_integer_notag(Bytes),
Value2 =
- if
- (Value >= 0) andalso (Value < 16#8000000000000000) ->
- Value;
- (Value < 0) ->
- 18446744073709551615 + Value + 1;
- true ->
- exit({error, {bad_counter64, Value}}) end,
+ if
+ (Value >= 0) andalso (Value < 16#8000000000000000) ->
+ Value;
+ (Value < 0) ->
+ 16#ffffffffffffffff + Value + 1;
+ true ->
+ exit({error, {bad_counter64, Value}}) end,
{{'Counter64', Value2}, Rest};
+
dec_value([128,0|T]) ->
{{'NULL', noSuchObject}, T};
dec_value([129,0|T]) ->
@@ -629,7 +656,7 @@ enc_VarBind_attributes(#varbind{oid = Oid, variabletype = Type,value = Val}) ->
ValueBytes = enc_value(Type, Val),
lists:append(OidBytes, ValueBytes).
-enc_value('INTEGER',Val) ->
+enc_value('INTEGER', Val) ->
enc_integer_tag(Val);
enc_value('OCTET STRING', Val) ->
enc_oct_str_tag(Val);
@@ -637,7 +664,7 @@ enc_value('BITS', Val) ->
enc_oct_str_tag(bits_to_str(Val));
enc_value('OBJECT IDENTIFIER', Val) ->
enc_oid_tag(Val);
-enc_value('IpAddress',Val) ->
+enc_value('IpAddress', Val) ->
Bytes2 = enc_oct_str_notag(Val),
Len2 = elength(length(Bytes2)),
lists:append([64 | Len2],Bytes2);
@@ -668,6 +695,24 @@ enc_value('Counter32', Val) ->
Bytes2 = enc_integer_notag(Val2),
Len2 = elength(length(Bytes2)),
lists:append([65 | Len2],Bytes2);
+enc_value('Unsigned32', Val) ->
+ if
+ (Val >= 0) andalso (Val =< 4294967295) ->
+ Bytes2 = enc_integer_notag(Val),
+ Len2 = elength(length(Bytes2)),
+ lists:append([66 | Len2], Bytes2);
+ true ->
+ exit({error, {bad_counter32, Val}})
+ end;
+enc_value('TimeTicks', Val) ->
+ if
+ (Val >= 0) andalso (Val =< 4294967295) ->
+ Bytes2 = enc_integer_notag(Val),
+ Len2 = elength(length(Bytes2)),
+ lists:append([67 | Len2], Bytes2);
+ true ->
+ exit({error, {bad_timeticks, Val}})
+ end;
enc_value('Counter64', Val) ->
Val2 =
if
@@ -682,18 +727,7 @@ enc_value('Counter64', Val) ->
end,
Bytes2 = enc_integer_notag(Val2),
Len2 = elength(length(Bytes2)),
- lists:append([70 | Len2],Bytes2);
-enc_value(Type, Val) ->
- Bytes2 = enc_integer_notag(Val),
- Len2 = elength(length(Bytes2)),
- lists:append([enc_val_tag(Type,Val) | Len2],Bytes2).
-
-enc_val_tag('Counter32',Val) when (Val >= 0) andalso (Val =< 4294967295) ->
- 65;
-enc_val_tag('Unsigned32', Val) when (Val >= 0) andalso (Val =< 4294967295) ->
- 66;
-enc_val_tag('TimeTicks', Val) when (Val >= 0) andalso (Val =< 4294967295) ->
- 67.
+ lists:append([70 | Len2],Bytes2).
%%----------------------------------------------------------------------
diff --git a/lib/snmp/src/misc/snmp_verbosity.erl b/lib/snmp/src/misc/snmp_verbosity.erl
index 85037ba2ae..df5986b7bc 100644
--- a/lib/snmp/src/misc/snmp_verbosity.erl
+++ b/lib/snmp/src/misc/snmp_verbosity.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2012. 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
@@ -76,7 +76,7 @@ format_timestamp({_N1, _N2, N3} = Now) ->
{YYYY,MM,DD} = Date,
{Hour,Min,Sec} = Time,
FormatDate =
- io_lib:format("~.4w:~.2.0w:~.2.0w ~.2.0w:~.2.0w:~.2.0w 4~w",
+ io_lib:format("~.4w:~.2.0w:~.2.0w ~.2.0w:~.2.0w:~.2.0w ~w",
[YYYY,MM,DD,Hour,Min,Sec,round(N3/1000)]),
lists:flatten(FormatDate).
@@ -144,6 +144,8 @@ image_of_sname(mse) -> "M-SERVER";
image_of_sname(msew) -> io_lib:format("M-SERVER-worker(~p)", [self()]);
image_of_sname(mns) -> "M-NOTE-STORE";
image_of_sname(mnif) -> "M-NET-IF";
+image_of_sname(mnifl) -> "M-NET-IF-LOGGER";
+image_of_sname(mnifw) -> io_lib:format("M-NET-IF-worker(~p)", [self()]);
image_of_sname(mconf) -> "M-CONF";
image_of_sname(mgr) -> "MGR";
diff --git a/lib/snmp/test/Makefile b/lib/snmp/test/Makefile
index 78ffb1c255..546d46a002 100644
--- a/lib/snmp/test/Makefile
+++ b/lib/snmp/test/Makefile
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -79,7 +79,7 @@ COVER_SPEC_FILE = snmp.cover
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/snmp_test
+RELSYSDIR = $(RELEASE_PATH)/snmp_test
# ----------------------------------------------------
@@ -224,6 +224,9 @@ $(SNMP_BIN_TARGET_DIR)/Klas4.bin: $(SNMP_BIN_TARGET_DIR)/Klas3.bin
$(SNMP_BIN_TARGET_DIR)/SA-MIB.bin: $(SNMP_BIN_TARGET_DIR)/OLD-SNMPEA-MIB.bin
+$(SNMP_BIN_TARGET_DIR)/Test3.bin: $(SNMP_BIN_TARGET_DIR)/Test2.bin
+
+
# ----------------------------------------------------
# Release Target
# ----------------------------------------------------
@@ -232,10 +235,10 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec:
release_tests_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(RELTEST_FILES) $(COVER_SPEC_FILE) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- tar cf - snmp_test_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(RELTEST_FILES) $(COVER_SPEC_FILE) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ tar cf - snmp_test_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
@@ -251,7 +254,7 @@ info:
@echo ""
@echo "ERL_COMPILE_FLAGS = $(ERL_COMPILE_FLAGS)"
@echo ""
- @echo "RELSYSDIR = $(RELSYSDIR)"
+ @echo "RELSYSDIR = "$(RELSYSDIR)""
@echo ""
@echo "SOURCE = $(SOURCE)"
@echo ""
diff --git a/lib/snmp/test/exp/.gitignore b/lib/snmp/test/exp/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/lib/snmp/test/exp/.gitignore
diff --git a/lib/snmp/test/snmp_agent_bl_test.erl b/lib/snmp/test/exp/snmp_agent_bl_test.erl
index b17489a755..263319aa5d 100644
--- a/lib/snmp/test/snmp_agent_bl_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_bl_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -95,24 +95,13 @@ end_per_testcase(_Case, Config) when list(Config) ->
Config.
cases() ->
- case ?OSTYPE() of
- vxworks ->
- %% No crypto app, so skip v3 testcases
- [
- app_info,
- test_v1, test_v2, test_v1_v2,
- test_multi_threaded,
- mib_storage,
- tickets];
- _Else ->
- [
- app_info,
- test_v1, test_v2, test_v1_v2, test_v3,
- test_multi_threaded,
- mib_storage,
- tickets
- ]
- end.
+ [
+ app_info,
+ test_v1, test_v2, test_v1_v2, test_v3,
+ test_multi_threaded,
+ mib_storage,
+ tickets
+ ].
%%%-----------------------------------------------------------------
@@ -1187,21 +1176,16 @@ init_v3(Config) when list(Config) ->
%% and we will be stuck with a bunch of mnesia tables for
%% the rest of this suite...
?DBG("start_agent -> start crypto app",[]),
- case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- case ?CRYPTO_START() of
- ok ->
- case ?CRYPTO_SUPPORT() of
- {no, Reason} ->
- ?SKIP({unsupported_encryption, Reason});
- yes ->
- ok
- end;
- {error, Reason} ->
- ?SKIP({failed_starting_crypto, Reason})
- end
+ case ?CRYPTO_START() of
+ ok ->
+ case ?CRYPTO_SUPPORT() of
+ {no, Reason} ->
+ ?SKIP({unsupported_encryption, Reason});
+ yes ->
+ ok
+ end;
+ {error, Reason} ->
+ ?SKIP({failed_starting_crypto, Reason})
end,
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
@@ -5071,12 +5055,7 @@ run(F, A, Opts) ->
CtxEngineID = snmp_misc:get_option(context_engine_id, Opts, EngineID),
Community = snmp_misc:get_option(community, Opts, "all-rights"),
?DBG("run -> start crypto app",[]),
- Crypto = case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- ?CRYPTO_START()
- end,
+ Crypto = ?CRYPTO_START(),
?DBG("run -> Crypto: ~p",[Crypto]),
catch snmp_test_mgr:stop(), % If we had a running mgr from a failed case
StdM = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
diff --git a/lib/snmp/test/snmp_agent_ms_test.erl b/lib/snmp/test/exp/snmp_agent_ms_test.erl
index 1f34f1c8d1..340b95f512 100644
--- a/lib/snmp/test/snmp_agent_ms_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_ms_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -231,17 +231,13 @@ end_per_testcase(_Case, Config) when list(Config) ->
Config.
cases() ->
-case ?OSTYPE() of
- vxworks ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_multi_threaded},
- {group, mib_storage}, {group, tickets}];
- _Else ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_v3},
- {group, test_multi_threaded}, {group, mib_storage},
- {group, tickets}]
-end.
+ [
+ app_info,
+ {group, test_v1}, {group, test_v2},
+ {group, test_v1_v2}, {group, test_v3},
+ {group, test_multi_threaded}, {group, mib_storage},
+ {group, tickets}
+ ].
%%%-----------------------------------------------------------------
@@ -1221,21 +1217,16 @@ init_v3(Config) when list(Config) ->
%% and we will be stuck with a bunch of mnesia tables for
%% the rest of this suite...
?DBG("start_agent -> start crypto app",[]),
- case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- case ?CRYPTO_START() of
- ok ->
- case ?CRYPTO_SUPPORT() of
- {no, Reason} ->
- ?SKIP({unsupported_encryption, Reason});
- yes ->
- ok
- end;
- {error, Reason} ->
- ?SKIP({failed_starting_crypto, Reason})
- end
+ case ?CRYPTO_START() of
+ ok ->
+ case ?CRYPTO_SUPPORT() of
+ {no, Reason} ->
+ ?SKIP({unsupported_encryption, Reason});
+ yes ->
+ ok
+ end;
+ {error, Reason} ->
+ ?SKIP({failed_starting_crypto, Reason})
end,
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
@@ -5066,12 +5057,7 @@ run(F, A, Opts) ->
CtxEngineID = snmp_misc:get_option(context_engine_id, Opts, EngineID),
Community = snmp_misc:get_option(community, Opts, "all-rights"),
?DBG("run -> start crypto app",[]),
- Crypto = case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- ?CRYPTO_START()
- end,
+ Crypto = ?CRYPTO_START(),
?DBG("run -> Crypto: ~p",[Crypto]),
catch snmp_test_mgr:stop(), % If we had a running mgr from a failed case
StdM = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
diff --git a/lib/snmp/test/snmp_agent_mt_test.erl b/lib/snmp/test/exp/snmp_agent_mt_test.erl
index 4f125c0017..33d104305a 100644
--- a/lib/snmp/test/snmp_agent_mt_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_mt_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -231,17 +231,13 @@ end_per_testcase(_Case, Config) when list(Config) ->
Config.
cases() ->
-case ?OSTYPE() of
- vxworks ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_multi_threaded},
- {group, mib_storage}, {group, tickets}];
- _Else ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_v3},
- {group, test_multi_threaded}, {group, mib_storage},
- {group, tickets}]
-end.
+ [
+ app_info,
+ {group, test_v1}, {group, test_v2},
+ {group, test_v1_v2}, {group, test_v3},
+ {group, test_multi_threaded}, {group, mib_storage},
+ {group, tickets}
+ ].
%%%-----------------------------------------------------------------
@@ -1221,21 +1217,16 @@ init_v3(Config) when list(Config) ->
%% and we will be stuck with a bunch of mnesia tables for
%% the rest of this suite...
?DBG("start_agent -> start crypto app",[]),
- case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- case ?CRYPTO_START() of
- ok ->
- case ?CRYPTO_SUPPORT() of
- {no, Reason} ->
- ?SKIP({unsupported_encryption, Reason});
- yes ->
- ok
- end;
- {error, Reason} ->
- ?SKIP({failed_starting_crypto, Reason})
- end
+ case ?CRYPTO_START() of
+ ok ->
+ case ?CRYPTO_SUPPORT() of
+ {no, Reason} ->
+ ?SKIP({unsupported_encryption, Reason});
+ yes ->
+ ok
+ end;
+ {error, Reason} ->
+ ?SKIP({failed_starting_crypto, Reason})
end,
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
@@ -5066,12 +5057,7 @@ run(F, A, Opts) ->
CtxEngineID = snmp_misc:get_option(context_engine_id, Opts, EngineID),
Community = snmp_misc:get_option(community, Opts, "all-rights"),
?DBG("run -> start crypto app",[]),
- Crypto = case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- ?CRYPTO_START()
- end,
+ Crypto = ?CRYPTO_START(),
?DBG("run -> Crypto: ~p",[Crypto]),
catch snmp_test_mgr:stop(), % If we had a running mgr from a failed case
StdM = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
diff --git a/lib/snmp/test/snmp_agent_v1_test.erl b/lib/snmp/test/exp/snmp_agent_v1_test.erl
index 737bb25cc3..5379d6d8cf 100644
--- a/lib/snmp/test/snmp_agent_v1_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_v1_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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/lib/snmp/test/snmp_agent_v2_test.erl b/lib/snmp/test/exp/snmp_agent_v2_test.erl
index dc94c18ad9..dc3d2efbb3 100644
--- a/lib/snmp/test/snmp_agent_v2_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_v2_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -231,17 +231,13 @@ end_per_testcase(_Case, Config) when list(Config) ->
Config.
cases() ->
-case ?OSTYPE() of
- vxworks ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_multi_threaded},
- {group, mib_storage}, {group, tickets}];
- _Else ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_v3},
- {group, test_multi_threaded}, {group, mib_storage},
- {group, tickets}]
-end.
+ [
+ app_info,
+ {group, test_v1}, {group, test_v2},
+ {group, test_v1_v2}, {group, test_v3},
+ {group, test_multi_threaded}, {group, mib_storage},
+ {group, tickets}
+ ].
%%%-----------------------------------------------------------------
@@ -1221,21 +1217,16 @@ init_v3(Config) when list(Config) ->
%% and we will be stuck with a bunch of mnesia tables for
%% the rest of this suite...
?DBG("start_agent -> start crypto app",[]),
- case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- case ?CRYPTO_START() of
- ok ->
- case ?CRYPTO_SUPPORT() of
- {no, Reason} ->
- ?SKIP({unsupported_encryption, Reason});
- yes ->
- ok
- end;
- {error, Reason} ->
- ?SKIP({failed_starting_crypto, Reason})
- end
+ case ?CRYPTO_START() of
+ ok ->
+ case ?CRYPTO_SUPPORT() of
+ {no, Reason} ->
+ ?SKIP({unsupported_encryption, Reason});
+ yes ->
+ ok
+ end;
+ {error, Reason} ->
+ ?SKIP({failed_starting_crypto, Reason})
end,
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
@@ -5066,12 +5057,7 @@ run(F, A, Opts) ->
CtxEngineID = snmp_misc:get_option(context_engine_id, Opts, EngineID),
Community = snmp_misc:get_option(community, Opts, "all-rights"),
?DBG("run -> start crypto app",[]),
- Crypto = case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- ?CRYPTO_START()
- end,
+ Crypto = ?CRYPTO_START(),
?DBG("run -> Crypto: ~p",[Crypto]),
catch snmp_test_mgr:stop(), % If we had a running mgr from a failed case
StdM = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
diff --git a/lib/snmp/test/snmp_agent_v3_test.erl b/lib/snmp/test/exp/snmp_agent_v3_test.erl
index 266be72878..b0bc6384e8 100644
--- a/lib/snmp/test/snmp_agent_v3_test.erl
+++ b/lib/snmp/test/exp/snmp_agent_v3_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -231,17 +231,12 @@ end_per_testcase(_Case, Config) when list(Config) ->
Config.
cases() ->
-case ?OSTYPE() of
- vxworks ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_multi_threaded},
- {group, mib_storage}, {group, tickets}];
- _Else ->
- [app_info, {group, test_v1}, {group, test_v2},
- {group, test_v1_v2}, {group, test_v3},
- {group, test_multi_threaded}, {group, mib_storage},
- {group, tickets}]
-end.
+ [
+ app_info, {group, test_v1}, {group, test_v2},
+ {group, test_v1_v2}, {group, test_v3},
+ {group, test_multi_threaded}, {group, mib_storage},
+ {group, tickets}
+ ].
%%%-----------------------------------------------------------------
@@ -1221,21 +1216,16 @@ init_v3(Config) when list(Config) ->
%% and we will be stuck with a bunch of mnesia tables for
%% the rest of this suite...
?DBG("start_agent -> start crypto app",[]),
- case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- case ?CRYPTO_START() of
- ok ->
- case ?CRYPTO_SUPPORT() of
- {no, Reason} ->
- ?SKIP({unsupported_encryption, Reason});
- yes ->
- ok
- end;
- {error, Reason} ->
- ?SKIP({failed_starting_crypto, Reason})
- end
+ case ?CRYPTO_START() of
+ ok ->
+ case ?CRYPTO_SUPPORT() of
+ {no, Reason} ->
+ ?SKIP({unsupported_encryption, Reason});
+ yes ->
+ ok
+ end;
+ {error, Reason} ->
+ ?SKIP({failed_starting_crypto, Reason})
end,
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
@@ -5066,12 +5056,7 @@ run(F, A, Opts) ->
CtxEngineID = snmp_misc:get_option(context_engine_id, Opts, EngineID),
Community = snmp_misc:get_option(community, Opts, "all-rights"),
?DBG("run -> start crypto app",[]),
- Crypto = case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- ?CRYPTO_START()
- end,
+ Crypto = ?CRYPTO_START(),
?DBG("run -> Crypto: ~p",[Crypto]),
catch snmp_test_mgr:stop(), % If we had a running mgr from a failed case
StdM = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
diff --git a/lib/snmp/test/modules.mk b/lib/snmp/test/modules.mk
index eacc749b53..3d658bf8e8 100644
--- a/lib/snmp/test/modules.mk
+++ b/lib/snmp/test/modules.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -76,7 +76,8 @@ MIB_FILES = \
TestTrap.mib \
TestTrapv2.mib \
Test1.mib \
- Test2.mib
+ Test2.mib \
+ Test3.mib
-SPECS = snmp.spec snmp.spec.vxworks
+SPECS = snmp.spec
diff --git a/lib/snmp/test/snmp.spec.vxworks b/lib/snmp/test/snmp.spec.vxworks
deleted file mode 100644
index 654aa96d8c..0000000000
--- a/lib/snmp/test/snmp.spec.vxworks
+++ /dev/null
@@ -1,4 +0,0 @@
-{topcase, {dir, "../snmp_test"}}.
-{skip, {snmp_SUITE, test_v3, "Requires crypto"}}.
-
-
diff --git a/lib/snmp/test/snmp_SUITE.erl b/lib/snmp/test/snmp_SUITE.erl
index b6d72da2fa..22b9c64588 100644
--- a/lib/snmp/test/snmp_SUITE.erl
+++ b/lib/snmp/test/snmp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -19,6 +19,8 @@
-module(snmp_SUITE).
+-include("snmp_test_lib.hrl").
+
-export([all/0,
suite/0,
groups/0,
@@ -39,6 +41,21 @@ end_per_testcase(_Case, Config) when is_list(Config) ->
Config.
+init_per_suite(Config) when is_list(Config) ->
+
+ ?DBG("init_per_suite -> entry with"
+ "~n Config: ~p", [Config]),
+
+ Config.
+
+end_per_suite(Config) when is_list(Config) ->
+
+ ?DBG("end_per_suite -> entry with"
+ "~n Config: ~p", [Config]),
+
+ Config.
+
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Top test case
@@ -53,7 +70,8 @@ all() ->
{group, manager}].
groups() ->
- [{app, [], [{group, app_test},
+ [
+ {app, [], [{group, app_test},
{group, appup_test}]},
{compiler, [], [{group, compiler_test}]},
{misc, [], [{group, conf_test},
@@ -66,6 +84,7 @@ groups() ->
{manager, [], [{group, manager_config_test},
{group, manager_user_test},
{group, manager_test}]},
+
{app_test, [], [{snmp_app_test, all}]},
{appup_test, [], [{snmp_appup_test, all}]},
{compiler_test, [], [{snmp_compiler_test, all}]},
@@ -78,17 +97,25 @@ groups() ->
{agent_test, [], [{snmp_agent_test, all}]},
{manager_config_test, [], [{snmp_manager_config_test, all}]},
{manager_user_test, [], [{snmp_manager_user_test, all}]},
- {manager_test, [], [{snmp_manager_test, all}]}].
+ {manager_test, [], [{snmp_manager_test, all}]}
+ ].
-init_per_suite(Config) ->
- Config.
-end_per_suite(_Config) ->
- ok.
+init_per_group(GroupName, Config0) ->
-init_per_group(_GroupName, Config) ->
- Config.
+ ?DBG("init_per_group -> entry with"
+ "~n GroupName: ~p"
+ "~n Config0: ~p", [GroupName, Config0]),
+
+ %% Group name is not really the suite name
+ %% (but it is a good enough approximation),
+ %% but it does not matter since we only need
+ %% it to be unique.
+ snmp_test_lib:init_suite_top_dir(GroupName, Config0).
+
end_per_group(_GroupName, Config) ->
- Config.
+ lists:keydelete(snmp_suite_top_dir, 1, Config).
+
+
diff --git a/lib/snmp/test/snmp_agent_test.erl b/lib/snmp/test/snmp_agent_test.erl
index e968bc65b1..bfe14bc080 100644
--- a/lib/snmp/test/snmp_agent_test.erl
+++ b/lib/snmp/test/snmp_agent_test.erl
@@ -224,52 +224,82 @@ groups() ->
},
{tickets2, [], [otp8395, otp9884]},
{otp_4394, [], [otp_4394_test]},
- {otp_7157, [], [otp_7157_test]
- }
+ {otp_7157, [], [otp_7157_test]}
].
-init_per_group(all_tcs, Config) ->
- init_all(Config);
-init_per_group(otp_7157, Config) ->
- init_otp_7157(Config);
-init_per_group(otp_4394, Config) ->
- init_otp_4394(Config);
-init_per_group(v2_inform, Config) ->
- init_v2_inform(Config);
-init_per_group(multiple_reqs_2, Config) ->
- init_mul(Config);
-init_per_group(multiple_reqs, Config) ->
- init_mul(Config);
-init_per_group(test_multi_threaded, Config) ->
- init_mt(Config);
-init_per_group(test_v3, Config) ->
- init_v3(Config);
-init_per_group(test_v1_v2, Config) ->
- init_v1_v2(Config);
-init_per_group(test_v2, Config) ->
- init_v2(Config);
-init_per_group(test_v1, Config) ->
- init_v1(Config);
-init_per_group(misc, Config) ->
- init_misc(Config);
-init_per_group(mib_storage_varm_mnesia, Config) ->
- init_varm_mib_storage_mnesia(Config);
-init_per_group(mib_storage_varm_dets, Config) ->
- init_varm_mib_storage_dets(Config);
-init_per_group(mib_storage_size_check_mnesia, Config) ->
- init_size_check_msm(Config);
-init_per_group(mib_storage_size_check_dets, Config) ->
- init_size_check_msd(Config);
-init_per_group(mib_storage_size_check_ets, Config) ->
- init_size_check_mse(Config);
-init_per_group(mib_storage_mnesia, Config) ->
- init_mib_storage_mnesia(Config);
-init_per_group(mib_storage_dets, Config) ->
- init_mib_storage_dets(Config);
-init_per_group(mib_storage_ets, Config) ->
- init_mib_storage_ets(Config);
-init_per_group(_GroupName, Config) ->
- Config.
+
+init_per_suite(Config0) when is_list(Config0) ->
+
+ ?DBG("init_per_suite -> entry with"
+ "~n Config0: ~p", [Config0]),
+
+ Config1 = snmp_test_lib:init_suite_top_dir(?MODULE, Config0),
+ Config2 = snmp_test_lib:fix_data_dir(Config1),
+
+ %% Mib-dirs
+ MibDir = snmp_test_lib:lookup(data_dir, Config2),
+ StdMibDir = filename:join([code:priv_dir(snmp), "mibs"]),
+
+ Config3 = [{mib_dir, MibDir}, {std_mib_dir, StdMibDir} | Config2],
+
+ ?DBG("init_per_suite -> end with"
+ "~n Config3: ~p", [Config3]),
+
+ Config3.
+
+end_per_suite(Config) when is_list(Config) ->
+
+ ?DBG("end_per_suite -> entry with"
+ "~n Config: ~p", [Config]),
+
+ Config.
+
+
+init_per_group(all_tcs = GroupName, Config) ->
+ init_all(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(otp_7157 = GroupName, Config) ->
+ init_otp_7157(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(otp_4394 = GroupName, Config) ->
+ init_otp_4394(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(v2_inform = GroupName, Config) ->
+ init_v2_inform(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(multiple_reqs_2 = GroupName, Config) ->
+ init_mul(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(multiple_reqs = GroupName, Config) ->
+ init_mul(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(test_multi_threaded = GroupName, Config) ->
+ init_mt(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(test_v3 = GroupName, Config) ->
+ init_v3(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(test_v1_v2 = GroupName, Config) ->
+ init_v1_v2(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(test_v2 = GroupName, Config) ->
+ init_v2(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(test_v1 = GroupName, Config) ->
+ init_v1(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(misc = GroupName, Config) ->
+ init_misc(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(mib_storage_varm_mnesia = GroupName, Config) ->
+ init_varm_mib_storage_mnesia(snmp_test_lib:init_group_top_dir(GroupName,
+ Config));
+init_per_group(mib_storage_varm_dets = GroupName, Config) ->
+ init_varm_mib_storage_dets(snmp_test_lib:init_group_top_dir(GroupName,
+ Config));
+init_per_group(mib_storage_size_check_mnesia = GroupName, Config) ->
+ init_size_check_msm(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(mib_storage_size_check_dets = GroupName, Config) ->
+ init_size_check_msd(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(mib_storage_size_check_ets = GroupName, Config) ->
+ init_size_check_mse(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(mib_storage_mnesia = GroupName, Config) ->
+ init_mib_storage_mnesia(snmp_test_lib:init_group_top_dir(GroupName,
+ Config));
+init_per_group(mib_storage_dets = GroupName, Config) ->
+ init_mib_storage_dets(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(mib_storage_ets = GroupName, Config) ->
+ init_mib_storage_ets(snmp_test_lib:init_group_top_dir(GroupName, Config));
+init_per_group(GroupName, Config) ->
+ snmp_test_lib:init_group_top_dir(GroupName, Config).
end_per_group(all_tcs, Config) ->
finish_all(Config);
@@ -316,115 +346,86 @@ end_per_group(_GroupName, Config) ->
-init_per_testcase(otp8395 = Case, Config) when is_list(Config) ->
+%% ---- Init Per TestCase ----
+
+init_per_testcase(Case, Config) when is_list(Config) ->
?DBG("init_per_testcase -> entry with"
+ "~n Config: ~p", [Config]),
+
+ p("Agent Info: "
+ "~n ~p", [snmpa:info()]),
+
+ init_per_testcase1(Case, Config).
+
+init_per_testcase1(otp8395 = Case, Config) when is_list(Config) ->
+ ?DBG("init_per_testcase1 -> entry with"
"~n Case: ~p"
"~n Config: ~p", [Case, Config]),
- Config2 = init_per_testcase2(Case, init_per_suite(Config)),
- otp8395({init, Config2});
-init_per_testcase(otp9884 = Case, Config) when is_list(Config) ->
- ?DBG("init_per_testcase -> entry with"
+ otp8395({init, init_per_testcase2(Case, Config)});
+init_per_testcase1(otp9884 = Case, Config) when is_list(Config) ->
+ ?DBG("init_per_testcase1 -> entry with"
"~n Case: ~p"
"~n Config: ~p", [Case, Config]),
- Config2 = init_per_testcase2(Case, init_per_suite(Config)),
- otp9884({init, Config2});
-init_per_testcase(otp_7157_test = _Case, Config) when is_list(Config) ->
- ?DBG("init_per_testcase -> entry with"
+ otp9884({init, init_per_testcase2(Case, Config)});
+init_per_testcase1(otp_7157_test = _Case, Config) when is_list(Config) ->
+ ?DBG("init_per_testcase1 -> entry with"
"~n Case: ~p"
"~n Config: ~p", [_Case, Config]),
Dog = ?WD_START(?MINS(1)),
- [{watchdog, Dog}|Config];
-init_per_testcase(v2_inform_i = _Case, Config) when is_list(Config) ->
- ?DBG("init_per_testcase -> entry with"
+ [{watchdog, Dog} | Config ];
+init_per_testcase1(v2_inform_i = _Case, Config) when is_list(Config) ->
+ ?DBG("init_per_testcase1 -> entry with"
"~n Case: ~p"
"~n Config: ~p", [_Case, Config]),
Dog = ?WD_START(?MINS(10)),
- [{watchdog, Dog}|Config];
-init_per_testcase(v3_inform_i = _Case, Config) when is_list(Config) ->
- ?DBG("init_per_testcase -> entry with"
+ [{watchdog, Dog} | Config ];
+init_per_testcase1(v3_inform_i = _Case, Config) when is_list(Config) ->
+ ?DBG("init_per_testcase1 -> entry with"
"~n Case: ~p"
"~n Config: ~p", [_Case, Config]),
Dog = ?WD_START(?MINS(10)),
- [{watchdog, Dog}|Config];
-init_per_testcase(_Case, Config) when is_list(Config) ->
+ [{watchdog, Dog} | Config ];
+init_per_testcase1(_Case, Config) when is_list(Config) ->
?DBG("init_per_testcase -> entry with"
"~n Case: ~p"
"~n Config: ~p", [_Case, Config]),
Dog = ?WD_START(?MINS(6)),
- [{watchdog, Dog}|Config].
+ [{watchdog, Dog}| Config ].
-end_per_testcase(otp8395, Config) when is_list(Config) ->
- otp8395({fin, Config});
-end_per_testcase(otp9884, Config) when is_list(Config) ->
- otp9884({fin, Config});
-end_per_testcase(_Case, Config) when is_list(Config) ->
- ?DBG("end_per_testcase -> entry with"
- "~n Case: ~p"
- "~n Config: ~p", [_Case, Config]),
- Dog = ?config(watchdog, Config),
- ?WD_STOP(Dog),
- Config.
+%% ---- End Per TestCase ----
-init_per_suite(Config) ->
- ?DBG("init_per_suite -> entry with"
+end_per_testcase(Case, Config) when is_list(Config) ->
+ ?DBG("end_per_testcase -> entry with"
"~n Config: ~p", [Config]),
- %% Suite root dir for test suite
- PrivDir = ?config(priv_dir, Config),
+ p("Agent Info: "
+ "~n ~p", [snmpa:info()]),
- %% Create top-directory for this sub-suite
- SuiteTopDir = filename:join([PrivDir, ?MODULE]),
- case file:make_dir(SuiteTopDir) of
- ok ->
- ok;
- {error, eexist} ->
- %% This can happen since this is not really a
- %% suite-init function.
- ok;
- {error, Reason} ->
- ?FAIL({failed_creating_suite_top_dir, SuiteTopDir, Reason})
- end,
+ display_log(Config),
+ end_per_testcase1(Case, Config).
- %% --
- %% Fix config (data-dir is not correct):
- %%
-
- Config1 = fix_data_dir(Config),
- %% Config1 = Config,
-
- %% Mib-dirs
- MibDir = ?config(data_dir, Config1),
- StdMibDir = filename:join([code:priv_dir(snmp), "mibs"]),
-
- Config2 = [{suite_top_dir, SuiteTopDir},
- {mib_dir, MibDir},
- {std_mib_dir, StdMibDir} | Config1],
-
- ?DBG("init_per_suite -> done when"
- "~n Config2: ~p", [Config2]),
- Config2.
-
-%% end_per_suite(Config) ->
-end_per_suite(Config) ->
+end_per_testcase1(otp8395, Config) when is_list(Config) ->
+ otp8395({fin, Config});
+end_per_testcase1(otp9884, Config) when is_list(Config) ->
+ otp9884({fin, Config});
+end_per_testcase1(_Case, Config) when is_list(Config) ->
+ ?DBG("end_per_testcase1 -> entry with"
+ "~n Case: ~p"
+ "~n Config: ~p", [_Case, Config]),
+ Dog = ?config(watchdog, Config),
+ ?WD_STOP(Dog),
Config.
-fix_data_dir(Config) ->
- DataDir0 = ?config(data_dir, Config),
- DataDir1 = filename:split(filename:absname(DataDir0)),
- [_|DataDir2] = lists:reverse(DataDir1),
- DataDir = filename:join(lists:reverse(DataDir2) ++ [?snmp_test_data]),
- Config1 = lists:keydelete(data_dir, 1, Config),
- [{data_dir, DataDir} | Config1].
-
init_per_testcase2(Case, Config) ->
- SuiteToDir = ?config(suite_top_dir, Config),
-
- %% Create top-directory for this test-case
- CaseTopDir = filename:join([SuiteToDir, Case]),
- ok = file:make_dir(CaseTopDir),
+
+ ?DBG("end_per_testcase2 -> entry with"
+ "~n Case: ~p"
+ "~n Config: ~p", [Case, Config]),
+
+ CaseTopDir = snmp_test_lib:init_testcase_top_dir(Case, Config),
%% Create agent top-dir(s)
AgentTopDir = filename:join([CaseTopDir, agent]),
@@ -457,29 +458,16 @@ end_per_testcase2(_Case, Config) ->
cases() ->
- case ?OSTYPE() of
- vxworks ->
- [
- {group, misc},
- {group, test_v1},
- {group, test_v2},
- {group, test_v1_v2},
- {group, test_multi_threaded},
- {group, mib_storage},
- {group, tickets1}
- ];
- _Else ->
- [
- {group, misc},
- {group, test_v1},
- {group, test_v2},
- {group, test_v1_v2},
- {group, test_v3},
- {group, test_multi_threaded},
- {group, mib_storage},
- {group, tickets1}
- ]
- end.
+ [
+ {group, misc},
+ {group, test_v1},
+ {group, test_v2},
+ {group, test_v1_v2},
+ {group, test_v3},
+ {group, test_multi_threaded},
+ {group, mib_storage},
+ {group, tickets1}
+ ].
%%%-----------------------------------------------------------------
@@ -623,19 +611,19 @@ mib_storage_mnesia_cases() ->
msm_mib_of].
mse_size_check_cases() ->
-[mse_size_check].
+ [mse_size_check].
msd_size_check_cases() ->
-[msd_size_check].
+ [msd_size_check].
msm_size_check_cases() ->
-[msm_size_check].
+ [msm_size_check].
varm_mib_storage_dets_cases() ->
-[msd_varm_mib_start].
+ [msd_varm_mib_start].
varm_mib_storage_mnesia_cases() ->
-[msm_varm_mib_start].
+ [msm_varm_mib_start].
init_mib_storage_ets(Config) when is_list(Config) ->
?LOG("init_mib_storage_ets -> entry", []),
@@ -644,36 +632,37 @@ init_mib_storage_ets(Config) when is_list(Config) ->
init_mib_storage_dets(Config) when is_list(Config) ->
?LOG("init_mib_storage_ets -> entry", []),
- ?line AgentDir = ?GCONF(agent_dir, Config),
- MibStorage = {snmp_mib_storage,{dets,AgentDir}},
+ ?line AgentDbDir = ?GCONF(agent_db_dir, Config),
+ MibStorage = {snmp_mib_storage, {dets, AgentDbDir}},
init_ms(Config, [MibStorage]).
init_mib_storage_mnesia(Config) when is_list(Config) ->
?LOG("init_mib_storage_ets -> entry", []),
- MibStorage = {snmp_mib_storage,{mnesia,[]}},
+ MibStorage = {snmp_mib_storage, {mnesia,[]}},
init_ms(Config, [MibStorage]).
init_ms(Config, Opts) when is_list(Config) ->
?LOG("init_mib_storage_ets -> entry", []),
- ?line SaNode = ?GCONF(snmp_sa, Config),
+ ?line SaNode = ?GCONF(snmp_sa, Config),
?line create_tables(SaNode),
- ?line AgentDir = ?GCONF(agent_dir, Config),
- ?line MgrDir = ?GCONF(mgr_dir, Config),
- ?line Ip = ?GCONF(ip, Config),
- ?line config([v1], MgrDir, AgentDir, tuple_to_list(Ip), tuple_to_list(Ip)),
+ ?line AgentConfDir = ?GCONF(agent_conf_dir, Config),
+ ?line MgrDir = ?GCONF(mgr_dir, Config),
+ ?line Ip = ?GCONF(ip, Config),
+ ?line config([v1], MgrDir, AgentConfDir,
+ tuple_to_list(Ip), tuple_to_list(Ip)),
MasterAgentVerbosity = {snmp_master_agent_verbosity, trace},
MibsVerbosity = {snmp_mibserver_verbosity, trace},
SymStoreVerbosity = {snmp_symbolic_store_verbosity, trace},
- Opts1 = [MasterAgentVerbosity,MibsVerbosity,SymStoreVerbosity|Opts],
- [{vsn, v1} | start_v1_agent(Config,Opts1)].
+ Opts1 = [MasterAgentVerbosity, MibsVerbosity, SymStoreVerbosity | Opts],
+ [{vsn, v1} | start_v1_agent(Config, Opts1)].
init_size_check_mse(Config) when is_list(Config) ->
MibStorage = {snmp_mib_storage, ets},
init_size_check_ms(Config, [MibStorage]).
init_size_check_msd(Config) when is_list(Config) ->
- AgentDir = ?GCONF(agent_dir, Config),
- MibStorage = {snmp_mib_storage, {dets, AgentDir}},
+ AgentDbDir = ?GCONF(agent_db_dir, Config),
+ MibStorage = {snmp_mib_storage, {dets, AgentDbDir}},
init_size_check_ms(Config, [MibStorage]).
init_size_check_msm(Config) when is_list(Config) ->
@@ -695,22 +684,24 @@ init_size_check_ms(Config, Opts) when is_list(Config) ->
?SKIP({failed_starting_crypto, Reason})
end,
create_tables(SaNode),
- AgentDir = ?GCONF(agent_dir, Config),
- MgrDir = ?GCONF(mgr_dir, Config),
- Ip = ?GCONF(ip, Config),
- ?line ok =
- config([v3], MgrDir, AgentDir, tuple_to_list(Ip), tuple_to_list(Ip)),
+ AgentConfDir = ?GCONF(agent_conf_dir, Config),
+ MgrDir = ?GCONF(mgr_dir, Config),
+ Ip = ?GCONF(ip, Config),
+ ?line ok = config([v3], MgrDir, AgentConfDir,
+ tuple_to_list(Ip), tuple_to_list(Ip)),
[{vsn, v3} | start_v3_agent(Config, Opts)].
init_varm_mib_storage_dets(Config) when is_list(Config) ->
?LOG("init_varm_mib_storage_dets -> entry", []),
- ?line SaNode = ?GCONF(snmp_sa, Config),
+ ?line SaNode = ?GCONF(snmp_sa, Config),
?line create_tables(SaNode),
- ?line AgentDir = ?GCONF(agent_dir, Config),
- ?line MgrDir = ?GCONF(mgr_dir, Config),
- ?line Ip = ?GCONF(ip, Config),
- ?line config([v1], MgrDir, AgentDir, tuple_to_list(Ip), tuple_to_list(Ip)),
- MibStorage = {snmp_mib_storage,{dets,AgentDir}},
+ ?line AgentDbDir = ?GCONF(agent_db_dir, Config),
+ ?line AgentConfDir = ?GCONF(agent_conf_dir, Config),
+ ?line MgrDir = ?GCONF(mgr_dir, Config),
+ ?line Ip = ?GCONF(ip, Config),
+ ?line config([v1], MgrDir, AgentConfDir,
+ tuple_to_list(Ip), tuple_to_list(Ip)),
+ MibStorage = {snmp_mib_storage, {dets, AgentDbDir}},
MasterAgentVerbosity = {snmp_master_agent_verbosity, trace},
MibsVerbosity = {snmp_mibserver_verbosity, trace},
SymStoreVerbosity = {snmp_symbolic_store_verbosity, trace},
@@ -719,12 +710,13 @@ init_varm_mib_storage_dets(Config) when is_list(Config) ->
init_varm_mib_storage_mnesia(Config) when is_list(Config) ->
?LOG("init_varm_mib_storage_mnesia -> entry", []),
- ?line SaNode = ?GCONF(snmp_sa, Config),
+ ?line SaNode = ?GCONF(snmp_sa, Config),
?line create_tables(SaNode),
- ?line AgentDir = ?GCONF(agent_dir, Config),
- ?line MgrDir = ?GCONF(mgr_dir, Config),
- ?line Ip = ?GCONF(ip, Config),
- ?line config([v1], MgrDir, AgentDir, tuple_to_list(Ip), tuple_to_list(Ip)),
+ ?line AgentConfDir = ?GCONF(agent_conf_dir, Config),
+ ?line MgrDir = ?GCONF(mgr_dir, Config),
+ ?line Ip = ?GCONF(ip, Config),
+ ?line config([v1], MgrDir, AgentConfDir,
+ tuple_to_list(Ip), tuple_to_list(Ip)),
MibStorage = {snmp_mib_storage,{mnesia,[]}},
MasterAgentVerbosity = {snmp_master_agent_verbosity, trace},
MibsVerbosity = {snmp_mibserver_verbosity, trace},
@@ -1189,10 +1181,11 @@ v1_cases() ->
init_v1(Config) when is_list(Config) ->
?line SaNode = ?config(snmp_sa, Config),
?line create_tables(SaNode),
- ?line AgentDir = ?config(agent_dir, Config),
+ ?line AgentConfDir = ?config(agent_conf_dir, Config),
?line MgrDir = ?config(mgr_dir, Config),
?line Ip = ?config(ip, Config),
- ?line config([v1], MgrDir, AgentDir, tuple_to_list(Ip), tuple_to_list(Ip)),
+ ?line config([v1], MgrDir, AgentConfDir,
+ tuple_to_list(Ip), tuple_to_list(Ip)),
[{vsn, v1} | start_v1_agent(Config)].
finish_v1(Config) when is_list(Config) ->
@@ -1232,10 +1225,11 @@ v2_cases() ->
init_v2(Config) when is_list(Config) ->
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
- AgentDir = ?config(agent_dir, Config),
+ AgentConfDir = ?config(agent_conf_dir, Config),
MgrDir = ?config(mgr_dir, Config),
Ip = ?config(ip, Config),
- config([v2], MgrDir, AgentDir, tuple_to_list(Ip), tuple_to_list(Ip)),
+ config([v2], MgrDir, AgentConfDir,
+ tuple_to_list(Ip), tuple_to_list(Ip)),
[{vsn, v2} | start_v2_agent(Config)].
finish_v2(Config) when is_list(Config) ->
@@ -1251,10 +1245,11 @@ v1_v2_cases() ->
init_v1_v2(Config) when is_list(Config) ->
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
- AgentDir = ?config(agent_dir, Config),
+ AgentConfDir = ?config(agent_conf_dir, Config),
MgrDir = ?config(mgr_dir, Config),
Ip = ?config(ip, Config),
- config([v1,v2], MgrDir, AgentDir, tuple_to_list(Ip), tuple_to_list(Ip)),
+ config([v1,v2], MgrDir, AgentConfDir,
+ tuple_to_list(Ip), tuple_to_list(Ip)),
[{vsn, bilingual} | start_bilingual_agent(Config)].
finish_v1_v2(Config) when is_list(Config) ->
@@ -1297,28 +1292,23 @@ init_v3(Config) when is_list(Config) ->
%% and we will be stuck with a bunch of mnesia tables for
%% the rest of this suite...
?DBG("start_agent -> start crypto app",[]),
- case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- case ?CRYPTO_START() of
- ok ->
- case ?CRYPTO_SUPPORT() of
- {no, Reason} ->
- ?SKIP({unsupported_encryption, Reason});
- yes ->
- ok
- end;
- {error, Reason} ->
- ?SKIP({failed_starting_crypto, Reason})
- end
+ case ?CRYPTO_START() of
+ ok ->
+ case ?CRYPTO_SUPPORT() of
+ {no, Reason} ->
+ ?SKIP({unsupported_encryption, Reason});
+ yes ->
+ ok
+ end;
+ {error, Reason} ->
+ ?SKIP({failed_starting_crypto, Reason})
end,
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
- AgentDir = ?config(agent_dir, Config),
+ AgentConfDir = ?config(agent_conf_dir, Config),
MgrDir = ?config(mgr_dir, Config),
Ip = ?config(ip, Config),
- ?line ok = config([v3], MgrDir, AgentDir,
+ ?line ok = config([v3], MgrDir, AgentConfDir,
tuple_to_list(Ip), tuple_to_list(Ip)),
[{vsn, v3} | start_v3_agent(Config)].
@@ -1338,11 +1328,11 @@ mt_cases() ->
init_mt(Config) when is_list(Config) ->
SaNode = ?config(snmp_sa, Config),
create_tables(SaNode),
- AgentDir = ?config(agent_dir, Config),
+ AgentConfDir = ?config(agent_conf_dir, Config),
MgrDir = ?config(mgr_dir, Config),
Ip = ?config(ip, Config),
- ?line ok =
- config([v2], MgrDir, AgentDir, tuple_to_list(Ip), tuple_to_list(Ip)),
+ ?line ok = config([v2], MgrDir, AgentConfDir,
+ tuple_to_list(Ip), tuple_to_list(Ip)),
[{vsn, v2} | start_multi_threaded_agent(Config)].
finish_mt(Config) when is_list(Config) ->
@@ -1421,7 +1411,10 @@ simple(Config) when is_list(Config) ->
?P(simple),
init_case(Config),
- try_test(simple_standard_test).
+ try_test(simple_standard_test),
+
+ p("done"),
+ ok.
simple_2(X) -> ?P(simple_2), simple(X).
@@ -1601,7 +1594,7 @@ change_target_addr_config(Config) when is_list(Config) ->
try_test(ma_trap1, [MA]),
?LOG("change_target_addr_config -> set silence verbosity for local_db",[]),
- ?line snmpa:verbosity(local_db,silence),
+ ?line snmpa:verbosity(local_db, silence),
%% Start new dummy listener
?LOG("change_target_addr_config -> start dummy manager",[]),
@@ -1609,9 +1602,9 @@ change_target_addr_config(Config) when is_list(Config) ->
%% Reconfigure
?LOG("change_target_addr_config -> reconfigure",[]),
- AgentDir = ?config(agent_dir, Config),
- ?line rewrite_target_addr_conf(AgentDir, NewPort),
- ?line snmp_target_mib:reconfigure(AgentDir),
+ AgentConfDir = ?config(agent_conf_dir, Config),
+ ?line rewrite_target_addr_conf(AgentConfDir, NewPort),
+ ?line snmp_target_mib:reconfigure(AgentConfDir),
%% Send the trap again
?LOG("change_target_addr_config -> send trap again",[]),
@@ -1624,7 +1617,7 @@ change_target_addr_config(Config) when is_list(Config) ->
?line ok = dummy_manager_stop(Pid),
?LOG("change_target_addr_config -> reset target address config",[]),
- ?line reset_target_addr_conf(AgentDir),
+ ?line reset_target_addr_conf(AgentConfDir),
?LOG("change_target_addr_config -> unload TestTrap",[]),
?line unload_master("TestTrap").
@@ -2067,7 +2060,7 @@ v3_inform(_X) ->
{req, [], {conf, init_v3_inform, [v3_inform_i], finish_v3_inform}}.
init_v2_inform(Config) when is_list(Config) ->
- _Dir = ?config(agent_dir, Config),
+ _Dir = ?config(agent_conf_dir, Config),
%% snmp_internal_mib:configure(Dir),
Config.
@@ -2075,7 +2068,7 @@ init_v3_inform(X) ->
init_v2_inform(X).
finish_v2_inform(Config) when is_list(Config) ->
- _Dir = ?config(agent_dir, Config),
+ _Dir = ?config(agent_conf_dir, Config),
%% snmp_internal_mib:configure(Dir),
Config.
@@ -2377,9 +2370,9 @@ v3_md5_auth(Config) when is_list(Config) ->
?P1("Testing MD5 authentication...takes a few seconds..."),
- AgentDir = ?config(agent_dir, Config),
- ?line rewrite_target_params_conf(AgentDir, "authMD5", authNoPriv),
- ?line snmp_target_mib:reconfigure(AgentDir),
+ AgentConfDir = ?config(agent_conf_dir, Config),
+ ?line rewrite_target_params_conf(AgentConfDir, "authMD5", authNoPriv),
+ ?line snmp_target_mib:reconfigure(AgentConfDir),
MA = whereis(snmp_master_agent),
@@ -2388,14 +2381,14 @@ v3_md5_auth(Config) when is_list(Config) ->
?line load_master("TestTrapv2"),
try_test(v3_sync, [[{v2_proc, []},
- {ma_v2_trap1, [MA]},
- {v3_inform_sync, [MA]}]],
- [{sec_level, authNoPriv}, {user, "authMD5"}]),
+ {ma_v2_trap1, [MA]},
+ {v3_inform_sync, [MA]}]],
+ [{sec_level, authNoPriv}, {user, "authMD5"}]),
?line unload_master("TestTrapv2"),
?line unload_master("TestTrap"),
?line unload_master("Test2"),
- ?line reset_target_params_conf(AgentDir).
+ ?line reset_target_params_conf(AgentConfDir).
v3_sha_auth(suite) -> [];
v3_sha_auth(Config) when is_list(Config) ->
@@ -2404,9 +2397,9 @@ v3_sha_auth(Config) when is_list(Config) ->
?P1("Testing SHA authentication...takes a few seconds..."),
- AgentDir = ?config(agent_dir, Config),
- ?line rewrite_target_params_conf(AgentDir, "authSHA", authNoPriv),
- ?line snmp_target_mib:reconfigure(AgentDir),
+ AgentConfDir = ?config(agent_conf_dir, Config),
+ ?line rewrite_target_params_conf(AgentConfDir, "authSHA", authNoPriv),
+ ?line snmp_target_mib:reconfigure(AgentConfDir),
MA = whereis(snmp_master_agent),
@@ -2415,14 +2408,14 @@ v3_sha_auth(Config) when is_list(Config) ->
?line load_master("TestTrapv2"),
try_test(v3_sync, [[{v2_proc, []},
- {ma_v2_trap1, [MA]},
- {v3_inform_sync, [MA]}]],
- [{sec_level, authNoPriv}, {user, "authSHA"}]),
+ {ma_v2_trap1, [MA]},
+ {v3_inform_sync, [MA]}]],
+ [{sec_level, authNoPriv}, {user, "authSHA"}]),
?line unload_master("TestTrapv2"),
?line unload_master("TestTrap"),
?line unload_master("Test2"),
- ?line reset_target_params_conf(AgentDir).
+ ?line reset_target_params_conf(AgentConfDir).
v3_des_priv(suite) -> [];
v3_des_priv(Config) when is_list(Config) ->
@@ -2431,9 +2424,9 @@ v3_des_priv(Config) when is_list(Config) ->
?P1("Testing DES encryption...takes a few seconds..."),
- AgentDir = ?config(agent_dir, Config),
- ?line rewrite_target_params_conf(AgentDir, "privDES", authPriv),
- ?line snmp_target_mib:reconfigure(AgentDir),
+ AgentConfDir = ?config(agent_conf_dir, Config),
+ ?line rewrite_target_params_conf(AgentConfDir, "privDES", authPriv),
+ ?line snmp_target_mib:reconfigure(AgentConfDir),
MA = whereis(snmp_master_agent),
@@ -2444,14 +2437,14 @@ v3_des_priv(Config) when is_list(Config) ->
?line load_master("TestTrapv2"),
try_test(v3_sync, [[{v2_proc, []},
- {ma_v2_trap1, [MA]},
- {v3_inform_sync, [MA]}]],
- [{sec_level, authPriv}, {user, "privDES"}]),
+ {ma_v2_trap1, [MA]},
+ {v3_inform_sync, [MA]}]],
+ [{sec_level, authPriv}, {user, "privDES"}]),
?line unload_master("TestTrapv2"),
?line unload_master("TestTrap"),
?line unload_master("Test2"),
- ?line reset_target_params_conf(AgentDir).
+ ?line reset_target_params_conf(AgentConfDir).
%% -define(usmStatsNotInTimeWindows_instance, [1,3,6,1,6,3,15,1,1,2,0]).
@@ -4795,7 +4788,7 @@ snmp_user_based_sm_mib_3(Config) when is_list(Config) ->
?P(snmp_user_based_sm_mib_3),
init_case(Config),
- _AgentDir = ?config(agent_dir, Config),
+ _AgentDir = ?config(agent_conf_dir, Config),
?line load_master_std("SNMP-USER-BASED-SM-MIB"),
%% The newUser used here already has VACM access.
@@ -5727,28 +5720,28 @@ otp_3725_test(MaNode) ->
init_otp_4394(Config) when is_list(Config) ->
?DBG("init_otp_4394 -> entry with"
"~n Config: ~p", [Config]),
- ?line AgentDir = ?config(agent_dir, Config),
- ?line MgrDir = ?config(mgr_dir, Config),
- ?line Ip = ?config(ip, Config),
- ?line otp_4394_config(AgentDir, MgrDir, Ip),
+ ?line AgentConfDir = ?config(agent_conf_dir, Config),
+ ?line MgrDir = ?config(mgr_dir, Config),
+ ?line Ip = ?config(ip, Config),
+ ?line otp_4394_config(AgentConfDir, MgrDir, Ip),
MasterAgentVerbosity = {master_agent_verbosity, trace},
NetIfVerbosity = {net_if_verbosity, trace},
- Opts = [MasterAgentVerbosity,NetIfVerbosity],
- [{vsn, v1} | start_v1_agent(Config,Opts)].
+ Opts = [MasterAgentVerbosity, NetIfVerbosity],
+ [{vsn, v1} | start_v1_agent(Config, Opts)].
-otp_4394_config(AgentDir, MgrDir, Ip0) ->
+otp_4394_config(AgentConfDir, MgrDir, Ip0) ->
?DBG("otp_4394_config -> entry with"
- "~n AgentDir: ~p"
- "~n MgrDir: ~p"
- "~n Ip0: ~p", [AgentDir, MgrDir, Ip0]),
+ "~n AgentConfDir: ~p"
+ "~n MgrDir: ~p"
+ "~n Ip0: ~p", [AgentConfDir, MgrDir, Ip0]),
Vsn = [v1],
Ip = tuple_to_list(Ip0),
- ?line snmp_config:write_agent_snmp_files(AgentDir, Vsn, Ip,
+ ?line snmp_config:write_agent_snmp_files(AgentConfDir, Vsn, Ip,
?TRAP_UDP, Ip, 4000,
"OTP-4394 test"),
- ?line case update_usm(Vsn, AgentDir) of
+ ?line case update_usm(Vsn, AgentConfDir) of
true ->
- ?line copy_file(filename:join(AgentDir, "usm.conf"),
+ ?line copy_file(filename:join(AgentConfDir, "usm.conf"),
filename:join(MgrDir, "usm.conf")),
?line update_usm_mgr(Vsn, MgrDir);
false ->
@@ -5756,8 +5749,8 @@ otp_4394_config(AgentDir, MgrDir, Ip0) ->
end,
C1 = {"a", "all-rights", "initial", "", "pc"},
C2 = {"c", "secret", "secret_name", "", "secret_tag"},
- ?line write_community_conf(AgentDir, [C1, C2]),
- ?line update_vacm(Vsn, AgentDir),
+ ?line write_community_conf(AgentConfDir, [C1, C2]),
+ ?line update_vacm(Vsn, AgentConfDir),
Ta1 = {"shelob v1",
[134,138,177,177], 5000, 1500, 3, %% Anv�nd Ip och modda
"pc1",
@@ -5771,9 +5764,9 @@ otp_4394_config(AgentDir, MgrDir, Ip0) ->
"target_v1", "",
%% [255,255,255,255,0,0],
[], 2048},
- ?line write_target_addr_conf(AgentDir, [Ta1, Ta2]),
- ?line write_target_params_conf(AgentDir, Vsn),
- ?line write_notify_conf(AgentDir),
+ ?line write_target_addr_conf(AgentConfDir, [Ta1, Ta2]),
+ ?line write_target_params_conf(AgentConfDir, Vsn),
+ ?line write_notify_conf(AgentConfDir),
ok.
@@ -5826,10 +5819,11 @@ init_otp_7157(Config) when is_list(Config) ->
?DBG("init_otp_7157 -> entry with"
"~n Config: ~p", [Config]),
- ?line AgentDir = ?config(agent_dir, Config),
+ ?line AgentConfDir = ?config(agent_conf_dir, Config),
?line MgrDir = ?config(mgr_dir, Config),
?line Ip = ?config(ip, Config),
- ?line config([v2], MgrDir, AgentDir, tuple_to_list(Ip), tuple_to_list(Ip)),
+ ?line config([v2], MgrDir, AgentConfDir,
+ tuple_to_list(Ip), tuple_to_list(Ip)),
MasterAgentVerbosity = {master_agent_verbosity, trace},
NetIfVerbosity = {net_if_verbosity, trace},
Opts = [MasterAgentVerbosity, NetIfVerbosity],
@@ -6562,8 +6556,8 @@ write_community_conf(Dir, Conf) ->
write_target_addr_conf(Dir, Conf) ->
snmp_agent_test_lib:write_target_addr_conf(Dir, Conf).
-write_target_addr_conf(Dir, ManagerIp, UDP, Vsns) ->
- snmp_agent_test_lib:write_target_addr_conf(Dir, ManagerIp, UDP, Vsns).
+%% write_target_addr_conf(Dir, ManagerIp, UDP, Vsns) ->
+%% snmp_agent_test_lib:write_target_addr_conf(Dir, ManagerIp, UDP, Vsns).
rewrite_target_addr_conf(Dir, NewPort) ->
snmp_agent_test_lib:rewrite_target_addr_conf(Dir, NewPort).
@@ -6596,9 +6590,42 @@ copy_file(From, To) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+display_log(Config) ->
+ case lists:keysearch(agent_log_dir, 1, Config) of
+ {value, {_, Dir}} ->
+ case lists:keysearch(snmp_master, 1, Config) of
+ {value, {_, Node}} ->
+ LogDir = Dir,
+ Mibs = [],
+ OutFile = filename:join(LogDir, "snmpa_log.txt"),
+ p("~n"
+ "========================="
+ " < Audit Trail Log > "
+ "========================="
+ "~n"),
+ rcall(Node, snmpa, log_to_txt, [LogDir, Mibs, OutFile]),
+ rcall(Node, snmpa, log_to_io, [LogDir, Mibs]),
+ p("~n"
+ "========================="
+ " < / Audit Trail Log > "
+ "========================="
+ "~n", []);
+ false ->
+ p("display_log -> no agent node found"),
+ ok
+ end;
+ false ->
+ p("display_log -> no agent log dir found: "
+ "~n ~p", [Config]),
+ ok
+ end.
+
+
+%% ------
+
display_memory_usage() ->
Info = snmpa:info(snmp_master_agent),
- AMU = display_agent_memory_uasge(Info),
+ AMU = display_agent_memory_usage(Info),
NIMU = display_net_if_memory_usage(Info),
NSMU = display_note_store_memory_usage(Info),
SSMU = display_symbolic_store_memory_usage(Info),
@@ -6608,7 +6635,7 @@ display_memory_usage() ->
AMU ++ NIMU ++ NSMU ++ SSMU ++ LDBMU ++ MSMU, []),
ok.
-display_agent_memory_uasge(Info) ->
+display_agent_memory_usage(Info) ->
AgentInfo = lists_key1search(agent, Info),
ProcMem =
lists_key1search([process_memory,master_agent], AgentInfo),
@@ -6717,3 +6744,27 @@ lists_key1search(Key, List) when is_atom(Key) ->
regs() ->
lists:sort(registered()).
+
+%% ------
+
+rcall(Node, Mod, Func, Args) ->
+ case rpc:call(Node, Mod, Func, Args) of
+ {badrpc, nodedown} ->
+ ?FAIL({rpc_failure, Node});
+ Else ->
+ Else
+ end.
+
+
+%% ------
+
+p(F) ->
+ p(F, []).
+
+p(F, A) ->
+ io:format("*** [~s] ***"
+ "~n" ++ F ++ "~n", [formated_timestamp()|A]).
+
+formated_timestamp() ->
+ snmp_test_lib:formated_timestamp().
+
diff --git a/lib/snmp/test/snmp_agent_test_lib.erl b/lib/snmp/test/snmp_agent_test_lib.erl
index 084b3ee8da..757aebfa9b 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -119,20 +119,10 @@
%%% didn't undo (since it failed).
%%%-----------------------------------------------------------------
-init_all(Config0) when is_list(Config0) ->
- ?LOG("init_all -> entry with"
- "~n Config0: ~p",[Config0]),
-
- %% --
- %% Fix config:
- %%
+init_all(Config) when is_list(Config) ->
- DataDir0 = ?config(data_dir, Config0),
- DataDir1 = filename:split(filename:absname(DataDir0)),
- [_|DataDir2] = lists:reverse(DataDir1),
- DataDir3 = filename:join(lists:reverse(DataDir2) ++ [?snmp_test_data]),
- Config1 = lists:keydelete(data_dir, 1, Config0),
- Config = [{data_dir, DataDir3 ++ "/"}|Config1],
+ ?LOG("init_all -> entry with"
+ "~n Config: ~p",[Config]),
%% --
%% Start nodes
@@ -143,34 +133,43 @@ init_all(Config0) when is_list(Config0) ->
%% --
- %% Create necessary files
+ %% Create necessary files ( and dirs )
%%
- PrivDir = ?config(priv_dir, Config),
- ?DBG("init_all -> PrivDir ~p", [PrivDir]),
+ SuiteTopDir = ?config(snmp_suite_top_dir, Config),
+ ?DBG("init_all -> SuiteTopDir ~p", [SuiteTopDir]),
- TopDir = filename:join(PrivDir, snmp_agent_test),
- case file:make_dir(TopDir) of
- ok ->
- ok;
- {error, eexist} ->
- ok;
- Error ->
- ?FAIL({failed_creating_subsuite_top_dir, Error})
- end,
+ AgentDir = filename:join(SuiteTopDir, "agent/"),
+ ?line ok = file:make_dir(AgentDir),
+ ?DBG("init_all -> AgentDir ~p", [AgentDir]),
- DataDir = ?config(data_dir, Config),
- ?DBG("init_all -> DataDir ~p", [DataDir]),
+ AgentDbDir = filename:join(AgentDir, "db/"),
+ ?line ok = file:make_dir(AgentDbDir),
+ ?DBG("init_all -> AgentDbDir ~p", [AgentDbDir]),
- ?line ok = file:make_dir(MgrDir = filename:join(TopDir, "mgr_dir/")),
- ?DBG("init_all -> MgrDir ~p", [MgrDir]),
+ AgentLogDir = filename:join(AgentDir, "log/"),
+ ?line ok = file:make_dir(AgentLogDir),
+ ?DBG("init_all -> AgentLogDir ~p", [AgentLogDir]),
- ?line ok = file:make_dir(AgentDir = filename:join(TopDir, "agent_dir/")),
- ?DBG("init_all -> AgentDir ~p", [AgentDir]),
+ AgentConfDir = filename:join(AgentDir, "conf/"),
+ ?line ok = file:make_dir(AgentConfDir),
+ ?DBG("init_all -> AgentConfDir ~p", [AgentConfDir]),
- ?line ok = file:make_dir(SaDir = filename:join(TopDir, "sa_dir/")),
+ MgrDir = filename:join(SuiteTopDir, "mgr/"),
+ ?line ok = file:make_dir(MgrDir),
+ ?DBG("init_all -> MgrDir ~p", [MgrDir]),
+
+ SaDir = filename:join(SuiteTopDir, "sa/"),
+ ?line ok = file:make_dir(SaDir),
?DBG("init_all -> SaDir ~p", [SaDir]),
+ SaDbDir = filename:join(SaDir, "db/"),
+ ?line ok = file:make_dir(SaDbDir),
+ ?DBG("init_all -> SaDbDir ~p", [SaDbDir]),
+
+ %% MibDir = ?config(mib_dir, Config),
+ %% ?DBG("init_all -> MibDir ~p", [DataDir]),
+
%% --
%% Start and initiate mnesia
@@ -184,11 +183,11 @@ init_all(Config0) when is_list(Config0) ->
?DBG("init_all -> application mnesia: set_env dir",[]),
?line application_controller:set_env(mnesia, dir,
- filename:join(TopDir, "Mnesia1")),
+ filename:join(AgentDbDir, "Mnesia1")),
?DBG("init_all -> application mnesia: set_env dir on node ~p",[SaNode]),
- ?line rpc:call(SaNode, application_controller, set_env,
- [mnesia, dir, filename:join(TopDir, "Mnesia2")]),
+ ?line rpc:call(SaNode, application_controller, set_env,
+ [mnesia, dir, filename:join(SaDir, "Mnesia2")]),
?DBG("init_all -> create mnesia schema",[]),
?line ok = mnesia:create_schema([SaNode, node()]),
@@ -199,13 +198,18 @@ init_all(Config0) when is_list(Config0) ->
?DBG("init_all -> start application mnesia on ~p",[SaNode]),
?line ok = rpc:call(SaNode, application, start, [mnesia]),
Ip = ?LOCALHOST(),
- [{snmp_sa, SaNode},
- {snmp_mgr, MgrNode},
- {agent_dir, AgentDir ++ "/"},
- {mgr_dir, MgrDir ++ "/"},
- {sa_dir, SaDir ++ "/"},
- {mib_dir, DataDir},
- {ip, Ip} |
+ [{snmp_sa, SaNode},
+ {snmp_mgr, MgrNode},
+ {snmp_master, node()},
+ {agent_dir, AgentDir ++ "/"},
+ {agent_db_dir, AgentDbDir ++ "/"},
+ {agent_log_dir, AgentLogDir ++ "/"},
+ {agent_conf_dir, AgentConfDir ++ "/"},
+ {sa_dir, SaDir ++ "/"},
+ {sa_db_dir, SaDbDir ++ "/"},
+ {mgr_dir, MgrDir ++ "/"},
+ %% {mib_dir, DataDir},
+ {ip, Ip} |
Config].
@@ -220,11 +224,14 @@ finish_all(Config) when is_list(Config) ->
%% --- This one *must* be run first in each case ---
init_case(Config) when is_list(Config) ->
+
?DBG("init_case -> entry with"
- "~n Config: ~p", [Config]),
- SaNode = ?config(snmp_sa, Config),
- MgrNode = ?config(snmp_mgr, Config),
- MasterNode = node(),
+ "~n Config: ~p", [Config]),
+
+ SaNode = ?config(snmp_sa, Config),
+ MgrNode = ?config(snmp_mgr, Config),
+ MasterNode = ?config(snmp_master, Config),
+ %% MasterNode = node(),
SaHost = ?HOSTNAME(SaNode),
MgrHost = ?HOSTNAME(MgrNode),
@@ -331,12 +338,7 @@ run(Mod, Func, Args, Opts) ->
CtxEngineID = snmp_misc:get_option(context_engine_id, Opts, EngineID),
Community = snmp_misc:get_option(community, Opts, "all-rights"),
?DBG("run -> start crypto app",[]),
- Crypto = case os:type() of
- vxworks ->
- no_crypto;
- _ ->
- ?CRYPTO_START()
- end,
+ Crypto = ?CRYPTO_START(),
?DBG("run -> Crypto: ~p", [Crypto]),
catch snmp_test_mgr:stop(), % If we had a running mgr from a failed case
StdM = filename:join(code:priv_dir(snmp), "mibs") ++ "/",
@@ -411,7 +413,8 @@ start_v3_agent(Config, Opts) when is_list(Config) andalso is_list(Opts) ->
start_bilingual_agent(Config) when is_list(Config) ->
start_agent(Config, [v1,v2]).
-start_bilingual_agent(Config, Opts) when is_list(Config) andalso is_list(Opts) ->
+start_bilingual_agent(Config, Opts)
+ when is_list(Config) andalso is_list(Opts) ->
start_agent(Config, [v1,v2], Opts).
start_mt_agent(Config) when is_list(Config) ->
@@ -423,57 +426,33 @@ start_mt_agent(Config, Opts) when is_list(Config) andalso is_list(Opts) ->
start_agent(Config, Vsns) ->
start_agent(Config, Vsns, []).
start_agent(Config, Vsns, Opts) ->
+
?LOG("start_agent -> entry (~p) with"
"~n Config: ~p"
"~n Vsns: ~p"
"~n Opts: ~p", [node(), Config, Vsns, Opts]),
- ?line AgentDir = ?config(agent_dir, Config),
- ?line SaNode = ?config(snmp_sa, Config),
-
-%% AgentConfig =
-%% [{agent_type, master},
-%% %% {multi_threaded, MultiT},
-%% %% {priority, Prio},
-%% %% {error_report_mod, ErrorReportMod},
-%% {versions, Vsns},
-%% {db_dir, AgentDir},
-%% %% {db_init_error, DbInitError},
-%% %% {set_mechanism, SetModule},
-%% %% {authentication_service, AuthModule},
-%% {audit_trail_log, [{type, read_write},
-%% {dir, AgentDir},
-%% {size, {10240, 10}},
-%% {repair, true}]},
-%% {config, [{verbosity, info},
-%% {dir, AgentDir},
-%% {force_load, false}]},
-%% {mibs, Mibs},
-%% %% {mib_storage, MibStorage},
-%% {local_db, []},
-%% {mib_server, []},
-%% {symbolic_store, []},
-%% {note_store, []},
-%% {net_if, []},
-%% %% {supervisor, SupOpts}
-%% ],
-
+ ?line AgentLogDir = ?config(agent_log_dir, Config),
+ ?line AgentConfDir = ?config(agent_conf_dir, Config),
+ ?line AgentDbDir = ?config(agent_db_dir, Config),
+ ?line SaNode = ?config(snmp_sa, Config),
+
app_env_init(vsn_init(Vsns) ++
- [{audit_trail_log, read_write_log},
- {audit_trail_log_dir, AgentDir},
- {audit_trail_log_size, {10240, 10}},
- {force_config_reload, false},
- {snmp_agent_type, master},
- {snmp_config_dir, AgentDir},
- {snmp_db_dir, AgentDir},
- {snmp_local_db_auto_repair, true},
- {snmp_local_db_verbosity, log},
- {snmp_master_agent_verbosity, trace},
- {snmp_supervisor_verbosity, trace},
- {snmp_mibserver_verbosity, log},
+ [{audit_trail_log, read_write_log},
+ {audit_trail_log_dir, AgentLogDir},
+ {audit_trail_log_size, {10240, 10}},
+ {force_config_reload, false},
+ {snmp_agent_type, master},
+ {snmp_config_dir, AgentConfDir},
+ {snmp_db_dir, AgentDbDir},
+ {snmp_local_db_auto_repair, true},
+ {snmp_local_db_verbosity, log},
+ {snmp_master_agent_verbosity, trace},
+ {snmp_supervisor_verbosity, trace},
+ {snmp_mibserver_verbosity, log},
{snmp_symbolic_store_verbosity, log},
- {snmp_note_store_verbosity, log},
- {snmp_net_if_verbosity, trace}],
+ {snmp_note_store_verbosity, log},
+ {snmp_net_if_verbosity, trace}],
Opts),
@@ -745,7 +724,6 @@ expect2(Id, F) ->
get_timeout() ->
get_timeout(os:type()).
-get_timeout(vxworks) -> 7000;
get_timeout(_) -> 3500.
receive_pdu(To) ->
@@ -1237,30 +1215,44 @@ stop_node(Node) ->
%%% Configuration
%%%-----------------------------------------------------------------
-config(Vsns, MgrDir, AgentDir, MIp, AIp) ->
- ?line snmp_config:write_agent_snmp_files(AgentDir, Vsns, MIp,
- ?TRAP_UDP, AIp, 4000,
+config(Vsns, MgrDir, AgentConfDir, MIp, AIp) ->
+ ?LOG("config -> entry with"
+ "~n Vsns: ~p"
+ "~n MgrDir: ~p"
+ "~n AgentConfDir: ~p"
+ "~n MIp: ~p"
+ "~n AIp: ~p",
+ [Vsns, MgrDir, AgentConfDir, MIp, AIp]),
+ ?line snmp_config:write_agent_snmp_files(AgentConfDir, Vsns,
+ MIp, ?TRAP_UDP, AIp, 4000,
"test"),
- ?line case update_usm(Vsns, AgentDir) of
+ ?line case update_usm(Vsns, AgentConfDir) of
true ->
- ?line copy_file(filename:join(AgentDir, "usm.conf"),
+ ?line copy_file(filename:join(AgentConfDir, "usm.conf"),
filename:join(MgrDir, "usm.conf")),
?line update_usm_mgr(Vsns, MgrDir);
false ->
?line ok
end,
- ?line update_community(Vsns, AgentDir),
- ?line update_vacm(Vsns, AgentDir),
- ?line write_target_addr_conf(AgentDir, MIp, ?TRAP_UDP, Vsns),
- ?line write_target_params_conf(AgentDir, Vsns),
- ?line write_notify_conf(AgentDir),
+ ?line update_community(Vsns, AgentConfDir),
+ ?line update_vacm(Vsns, AgentConfDir),
+ ?line write_target_addr_conf(AgentConfDir, MIp, ?TRAP_UDP, Vsns),
+ ?line write_target_params_conf(AgentConfDir, Vsns),
+ ?line write_notify_conf(AgentConfDir),
ok.
delete_files(Config) ->
- Dir = ?config(agent_dir, Config),
- {ok, List} = file:list_dir(Dir),
+ AgentDir = ?config(agent_dir, Config),
+ delete_files(AgentDir, [db, conf]).
+
+delete_files(_AgentFiles, []) ->
+ ok;
+delete_files(AgentDir, [DirName|DirNames]) ->
+ Dir = filename:join(AgentDir, DirName),
+ {ok, Files} = file:list_dir(Dir),
lists:foreach(fun(FName) -> file:delete(filename:join(Dir, FName)) end,
- List).
+ Files),
+ delete_files(AgentDir, DirNames).
update_usm(Vsns, Dir) ->
case lists:member(v3, Vsns) of
@@ -1418,8 +1410,8 @@ rewrite_target_addr_conf2(_NewPort,O) ->
O.
reset_target_addr_conf(Dir) ->
- ?line ok = file:rename(filename:join(Dir,"target_addr.old"),
- filename:join(Dir,"target_addr.conf")).
+ ?line ok = file:rename(filename:join(Dir, "target_addr.old"),
+ filename:join(Dir, "target_addr.conf")).
write_target_params_conf(Dir, Vsns) ->
F = fun(v1) -> {"target_v1", v1, v1, "all-rights", noAuthNoPriv};
@@ -1458,7 +1450,6 @@ copy_file(From, To) ->
ok = file:write_file(To, Bin).
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
display_memory_usage() ->
@@ -1543,7 +1534,6 @@ rpc(Node, F, A) ->
%% timeout() ->
%% timeout(os:type()).
%%
-%% timeout(vxworks) -> 7000;
%% timeout(_) -> 3500.
diff --git a/lib/snmp/test/snmp_app_test.erl b/lib/snmp/test/snmp_app_test.erl
index bc62c8d530..9b13e7cf1a 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -23,8 +23,9 @@
-module(snmp_app_test).
-export([
- all/0,groups/0,init_per_group/2,end_per_group/2, init_per_suite/1,
- end_per_suite/1,
+ all/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,
fields/1,
@@ -52,33 +53,47 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
all() ->
-Cases = [fields, modules, exportall, app_depend,
- undef_funcs, {group, start_and_stop}],
- Cases.
+ Cases =
+ [
+ fields,
+ modules,
+ exportall,
+ app_depend,
+ undef_funcs,
+ {group, start_and_stop}
+ ],
+ Cases.
groups() ->
[{start_and_stop, [],
- [start_and_stop_empty, start_and_stop_with_agent,
- start_and_stop_with_manager,
- start_and_stop_with_agent_and_manager,
- start_epmty_and_then_agent_and_manager_and_stop,
- start_with_agent_and_then_manager_and_stop,
- start_with_manager_and_then_agent_and_stop]}].
+ [start_and_stop_empty,
+ start_and_stop_with_agent,
+ start_and_stop_with_manager,
+ start_and_stop_with_agent_and_manager,
+ start_epmty_and_then_agent_and_manager_and_stop,
+ start_with_agent_and_then_manager_and_stop,
+ start_with_manager_and_then_agent_and_stop]}].
init_per_group(_GroupName, Config) ->
- Config.
+ Config.
end_per_group(_GroupName, Config) ->
- Config.
+ Config.
init_per_suite(Config) when is_list(Config) ->
?DISPLAY_SUITE_INFO(),
+
+ %% Note that part of this stuff (the suite top dir creation)
+ %% may already be done (if we run the entire snmp suite).
+
PrivDir = ?config(priv_dir, Config),
TopDir = filename:join(PrivDir, app),
case file:make_dir(TopDir) of
ok ->
ok;
+ {error, eexist} ->
+ ok;
Error ->
fail({failed_creating_subsuite_top_dir, Error})
end,
diff --git a/lib/snmp/test/snmp_compiler_test.erl b/lib/snmp/test/snmp_compiler_test.erl
index 0a147130b0..257fc47952 100644
--- a/lib/snmp/test/snmp_compiler_test.erl
+++ b/lib/snmp/test/snmp_compiler_test.erl
@@ -40,6 +40,7 @@
all/0,
groups/0, init_per_group/2, end_per_group/2,
init_per_testcase/2, end_per_testcase/2,
+ init_per_suite/1, end_per_suite/1,
description/1,
oid_conflicts/1,
@@ -48,6 +49,7 @@
agent_capabilities/1,
module_compliance/1,
warnings_as_errors/1,
+ augments_extra_info/1,
otp_6150/1,
otp_8574/1,
@@ -58,6 +60,7 @@
%%----------------------------------------------------------------------
%% Internal exports
%%----------------------------------------------------------------------
+
-export([
]).
@@ -74,19 +77,41 @@
%% External functions
%%======================================================================
-init_per_testcase(_Case, Config) when is_list(Config) ->
- Dir = ?config(priv_dir, Config),
- DataDir = ?config(data_dir, Config),
- [_|RL] = lists:reverse(filename:split(DataDir)),
- MibDir = join(lists:reverse(["snmp_test_data"|RL])),
- CompDir = join(Dir, "comp_dir/"),
- ?line ok = file:make_dir(CompDir),
- [{comp_dir, CompDir}, {mib_dir, MibDir} | Config].
+init_per_suite(Config0) when is_list(Config0) ->
+
+ ?DBG("init_per_suite -> entry with"
+ "~n Config0: ~p", [Config0]),
+
+ Config1 = snmp_test_lib:init_suite_top_dir(?MODULE, Config0),
+ Config2 = snmp_test_lib:fix_data_dir(Config1),
+
+ %% Mib-dirs
+ %% data_dir is trashed by the test-server / common-test
+ %% so there is no point in fixing it...
+ MibDir = snmp_test_lib:lookup(data_dir, Config2),
+ StdMibDir = filename:join([code:priv_dir(snmp), "mibs"]),
+
+ [{mib_dir, MibDir}, {std_mib_dir, StdMibDir} | Config2].
+
+end_per_suite(Config) when is_list(Config) ->
+
+ ?DBG("end_per_suite -> entry with"
+ "~n Config: ~p", [Config]),
+
+ Config.
+
+
+init_per_testcase(Case, Config) when is_list(Config) ->
+
+ ?DBG("init_per_testcase -> entry with"
+ "~n Config: ~p", [Config]),
+
+ CaseTopDir = snmp_test_lib:init_testcase_top_dir(Case, Config),
+
+ [{case_top_dir, CaseTopDir} | Config].
end_per_testcase(_Case, Config) when is_list(Config) ->
- CompDir = ?config(comp_dir, Config),
- ?line ok = ?DEL_DIR(CompDir),
- lists:keydelete(comp_dir, 1, Config).
+ Config.
%%======================================================================
@@ -102,6 +127,7 @@ all() ->
agent_capabilities,
module_compliance,
warnings_as_errors,
+ augments_extra_info,
{group, tickets}
].
@@ -126,7 +152,7 @@ description(Config) when is_list(Config) ->
put(tname,desc),
p("starting with Config: ~p~n", [Config]),
- Dir = ?config(comp_dir, Config),
+ Dir = ?config(case_top_dir, Config),
Filename = join(Dir,"test"),
MibSrcName = Filename ++ ".mib",
MibBinName = Filename ++ ".bin",
@@ -161,7 +187,7 @@ oid_conflicts(Config) when is_list(Config) ->
put(tname,oid_conflicts),
p("starting with Config: ~p~n", [Config]),
- Dir = ?config(comp_dir, Config),
+ Dir = ?config(case_top_dir, Config),
Mib = join(Dir,"TESTv2.mib"),
?line ok = write_oid_conflict_mib(Mib),
?line {error,compilation_failed} =
@@ -278,7 +304,7 @@ warnings_as_errors(suite) ->
warnings_as_errors(Config) when is_list(Config) ->
put(tname,warnings_as_errors),
p("starting with Config: ~p~n", [Config]),
- Dir = ?config(comp_dir, Config),
+ Dir = ?config(case_top_dir, Config),
MibDir = ?config(mib_dir, Config),
MibFile = join(MibDir, "OTP8574-MIB.mib"),
OutFile = join(Dir, "OTP8574-MIB.bin"),
@@ -303,7 +329,7 @@ otp_6150(Config) when is_list(Config) ->
put(tname,otp_6150),
p("starting with Config: ~p~n", [Config]),
- Dir = ?config(comp_dir, Config),
+ Dir = ?config(case_top_dir, Config),
MibDir = ?config(mib_dir, Config),
MibFile = join(MibDir, "ERICSSON-TOP-MIB.mib"),
?line {ok, Mib} = snmpc:compile(MibFile, [{outdir, Dir}, {verbosity, trace}]),
@@ -319,7 +345,7 @@ otp_8574(Config) when is_list(Config) ->
put(tname,otp_8574),
p("starting with Config: ~p~n", [Config]),
- Dir = ?config(comp_dir, Config),
+ Dir = ?config(case_top_dir, Config),
MibDir = ?config(mib_dir, Config),
MibFile = join(MibDir, "OTP8574-MIB.mib"),
@@ -352,7 +378,7 @@ otp_8595(Config) when is_list(Config) ->
put(tname,otp_8595),
p("starting with Config: ~p~n", [Config]),
- Dir = ?config(comp_dir, Config),
+ Dir = ?config(case_top_dir, Config),
MibDir = ?config(mib_dir, Config),
MibFile = join(MibDir, "OTP8595-MIB.mib"),
?line {ok, Mib} =
@@ -364,6 +390,47 @@ otp_8595(Config) when is_list(Config) ->
%%======================================================================
+
+augments_extra_info(suite) ->
+ [];
+augments_extra_info(Config) when is_list(Config) ->
+ put(tname, augments_extra_info),
+ p("starting with Config: ~p~n", [Config]),
+
+ Dir = ?config(case_top_dir, Config),
+ MibDir = ?config(mib_dir, Config),
+ Test2File = join(MibDir, "Test2.mib"),
+ Test3File = join(MibDir, "Test3.mib"),
+ ?line {ok, Test2BinFile} =
+ snmpc:compile(Test2File, [{outdir, Dir},
+ {verbosity, silence},
+ {group_check, false}]),
+ io:format("Test2BinFile: ~n~p~n", [Test2BinFile]),
+ ?line {ok, Test3BinFile} =
+ snmpc:compile(Test3File, [{i, [MibDir]},
+ {outdir, Dir},
+ {verbosity, silence},
+ {group_check, true}]),
+ io:format("Test3BinFile: ~n~p~n", [Test3BinFile]),
+ {ok, Test3Mib} = snmp_misc:read_mib(Test3BinFile),
+ io:format("Test3Mib: ~n~p~n", [Test3Mib]),
+ %% There is only one table in this mib
+ #mib{table_infos = [{TableName, TI}]} = Test3Mib,
+ io:format("TableName: ~p"
+ "~n Table Info: ~p"
+ "~n", [TableName, TI]),
+ #table_info{nbr_of_cols = 4,
+ defvals = DefVals,
+ not_accessible = [2,4],
+ index_types = {augments, {tEntry, undefined}},
+ first_accessible = 1} = TI,
+ io:format("Table info: ~p"
+ "~n DefVals: ~p"
+ "~n", [TableName, DefVals]),
+ ok.
+
+
+%%======================================================================
%% Internal functions
%%======================================================================
@@ -517,11 +584,11 @@ DESCRIPTION \"" ++ Desc ++ "\"
::= { test 1 }
END",
- Message = file:write_file(Filename ,Binary),
+ Message = file:write_file(Filename, Binary),
case Message of
ok -> ok;
{error, Reason} ->
- exit({failed_writing_mib,Reason})
+ exit({failed_writing_mib, Reason})
end.
@@ -546,8 +613,8 @@ check_desc(Desc1, Desc2) ->
exit({'description not equal', Desc1, Desc2}).
-join(Comp) ->
- filename:join(Comp).
+%% join(Comp) ->
+%% filename:join(Comp).
join(A,B) ->
filename:join(A,B).
diff --git a/lib/snmp/test/snmp_log_test.erl b/lib/snmp/test/snmp_log_test.erl
index b692017407..aeac4d1f71 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -42,7 +42,11 @@
-export([
init_per_testcase/2, end_per_testcase/2,
- all/0,groups/0,init_per_group/2,end_per_group/2,
+ all/0,
+ groups/0,
+ init_per_group/2,
+ end_per_group/2,
+
open_and_close/1,
open_write_and_close1/1,
@@ -109,16 +113,21 @@ end_per_testcase(_Case, Config) when is_list(Config) ->
%%======================================================================
%% ?SKIP(not_yet_implemented).
all() ->
-[open_and_close, {group, open_write_and_close},
- {group, log_to_io}, {group, log_to_txt}].
+ [
+ open_and_close,
+ {group, open_write_and_close},
+ {group, log_to_io},
+ {group, log_to_txt}].
groups() ->
- [{open_write_and_close, [],
- [open_write_and_close1, open_write_and_close2,
- open_write_and_close3, open_write_and_close4]},
- {log_to_io, [], [log_to_io1, log_to_io2]},
- {log_to_txt, [],
- [log_to_txt1, log_to_txt2, log_to_txt3]}].
+ [
+ {open_write_and_close, [],
+ [open_write_and_close1, open_write_and_close2,
+ open_write_and_close3, open_write_and_close4]},
+ {log_to_io, [], [log_to_io1, log_to_io2]},
+ {log_to_txt, [],
+ [log_to_txt1, log_to_txt2, log_to_txt3]}
+ ].
init_per_group(_GroupName, Config) ->
Config.
diff --git a/lib/snmp/test/snmp_manager_test.erl b/lib/snmp/test/snmp_manager_test.erl
index 75c9f7b277..c374a2f0a6 100644
--- a/lib/snmp/test/snmp_manager_test.erl
+++ b/lib/snmp/test/snmp_manager_test.erl
@@ -49,6 +49,8 @@
init_per_group/2, end_per_group/2,
init_per_testcase/2, end_per_testcase/2,
+ init_per_suite/1, end_per_suite/1,
+
simple_start_and_stop1/1,
simple_start_and_stop2/1,
@@ -146,36 +148,43 @@
%% External functions
%%======================================================================
+init_per_suite(Config0) when is_list(Config0) ->
+
+ ?DBG("init_per_suite -> entry with"
+ "~n Config0: ~p", [Config0]),
+
+ Config1 = snmp_test_lib:init_suite_top_dir(?MODULE, Config0),
+ Config2 = snmp_test_lib:fix_data_dir(Config1),
+
+ %% Mib-dirs
+ %% data_dir is trashed by the test-server / common-test
+ %% so there is no point in fixing it...
+ MibDir = snmp_test_lib:lookup(data_dir, Config2),
+ StdMibDir = filename:join([code:priv_dir(snmp), "mibs"]),
+
+ [{mib_dir, MibDir}, {std_mib_dir, StdMibDir} | Config2].
+
+end_per_suite(Config) when is_list(Config) ->
+
+ ?DBG("end_per_suite -> entry with"
+ "~n Config: ~p", [Config]),
+
+ Config.
+
+
init_per_testcase(Case, Config) when is_list(Config) ->
io:format(user, "~n~n*** INIT ~w:~w ***~n~n", [?MODULE,Case]),
init_per_testcase2(Case, Config).
init_per_testcase2(Case, Config) ->
- ?DBG("init [~w] Nodes [1]: ~p", [Case, erlang:nodes()]),
-
- %% Fix a correct data dir (points to the wrong location):
- DataDir0 = ?config(data_dir, Config),
- DataDir1 = filename:split(filename:absname(DataDir0)),
- [_|DataDir2] = lists:reverse(DataDir1),
- DataDir = filename:join(lists:reverse(DataDir2) ++ [?snmp_test_data]),
+ ?DBG("init_per_testcase2 -> ~p", [erlang:nodes()]),
- PrivDir = ?config(priv_dir, Config),
+ CaseTopDir = snmp_test_lib:init_testcase_top_dir(Case, Config),
- TopDir = filename:join(PrivDir, ?MODULE),
- case file:make_dir(TopDir) of
- ok ->
- ok;
- {error, eexist} ->
- ok;
- Error ->
- ?FAIL({failed_creating_subsuite_top_dir, Error})
- end,
-
- CaseTopDir = filename:join(TopDir, Case),
- ?line ok = file:make_dir(CaseTopDir),
-
%% -- Manager dirs --
- MgrTopDir = filename:join(CaseTopDir, "manager/"),
+ MgrTopDir = filename:join(CaseTopDir, "manager/"),
+ ?DBG("init_per_testcase2 -> try create manager top dir: ~n~p",
+ [MgrTopDir]),
?line ok = file:make_dir(MgrTopDir),
MgrConfDir = filename:join(MgrTopDir, "conf/"),
@@ -200,10 +209,9 @@ init_per_testcase2(Case, Config) ->
AgLogDir = filename:join(AgTopDir, "log/"),
?line ok = file:make_dir(AgLogDir),
- Conf = [{snmp_data_dir, DataDir},
- {watchdog, ?WD_START(?MINS(5))},
+ Conf = [{watchdog, ?WD_START(?MINS(5))},
{ip, ?LOCALHOST()},
- {top_dir, TopDir},
+ {case_top_dir, CaseTopDir},
{agent_dir, AgTopDir},
{agent_conf_dir, AgConfDir},
{agent_db_dir, AgDbDir},
@@ -388,9 +396,11 @@ all() ->
{group, user_tests},
{group, agent_tests},
{group, request_tests},
+ {group, request_tests_mt},
{group, event_tests},
+ {group, event_tests_mt},
discovery,
- {group, tickets}
+ {group, tickets}
].
groups() ->
@@ -431,6 +441,15 @@ groups() ->
{group, misc_request_tests}
]
},
+ {request_tests_mt, [],
+ [
+ {group, get_tests},
+ {group, get_next_tests},
+ {group, set_tests},
+ {group, bulk_tests},
+ {group, misc_request_tests}
+ ]
+ },
{get_tests, [],
[
simple_sync_get1,
@@ -477,18 +496,30 @@ groups() ->
misc_async2
]
},
- {event_tests, [],
- [
- trap1%% ,
- %% trap2,
- %% inform1,
- %% inform2,
- %% inform3,
- %% inform4,
- %% inform_swarm,
- %% report
- ]
- },
+ {event_tests, [],
+ [
+ trap1,
+ trap2,
+ inform1,
+ inform2,
+ inform3,
+ inform4,
+ inform_swarm,
+ report
+ ]
+ },
+ {event_tests_mt, [],
+ [
+ trap1,
+ trap2,
+ inform1,
+ inform2,
+ inform3,
+ inform4,
+ inform_swarm,
+ report
+ ]
+ },
{tickets, [],
[
{group, otp8015},
@@ -507,11 +538,21 @@ groups() ->
}
].
-init_per_group(_GroupName, Config) ->
- Config.
+init_per_group(request_tests_mt = GroupName, Config) ->
+ snmp_test_lib:init_group_top_dir(
+ GroupName,
+ [{manager_net_if_module, snmpm_net_if_mt} | Config]);
+init_per_group(event_tests_mt = GroupName, Config) ->
+ snmp_test_lib:init_group_top_dir(
+ GroupName,
+ [{manager_net_if_module, snmpm_net_if_mt} | Config]);
+init_per_group(GroupName, Config) ->
+ snmp_test_lib:init_group_top_dir(GroupName, Config).
+
end_per_group(_GroupName, Config) ->
- Config.
+ %% Do we really need to do this?
+ lists:keydelete(snmp_group_top_dir, 1, Config).
%%======================================================================
@@ -1571,6 +1612,11 @@ simple_sync_get1(Config) when is_list(Config) ->
?line ok = mgr_user_load_mib(Node, std_mib()),
Oids2 = [[sysObjectID, 0], [sysDescr, 0], [sysUpTime, 0]],
?line ok = do_simple_sync_get(Node, Addr, Port, Oids2),
+
+ p("Display log"),
+ display_log(Config),
+
+ p("done"),
ok.
do_simple_sync_get(Node, Addr, Port, Oids) ->
@@ -1578,7 +1624,7 @@ do_simple_sync_get(Node, Addr, Port, Oids) ->
?DBG("~n Reply: ~p"
"~n Rem: ~w", [Reply, Rem]),
-
+
%% verify that the operation actually worked:
%% The order should be the same, so no need to seach
?line ok = case Reply of
@@ -1612,7 +1658,9 @@ simple_sync_get2(suite) -> [];
simple_sync_get2(Config) when is_list(Config) ->
process_flag(trap_exit, true),
put(tname, ssg2),
- do_simple_sync_get2(Config).
+ do_simple_sync_get2(Config),
+ display_log(Config),
+ ok.
do_simple_sync_get2(Config) ->
Get = fun(Node, TargetName, Oids) ->
@@ -1677,7 +1725,9 @@ simple_sync_get3(suite) -> [];
simple_sync_get3(Config) when is_list(Config) ->
process_flag(trap_exit, true),
put(tname, ssg3),
- do_simple_sync_get3(Config).
+ do_simple_sync_get3(Config),
+ display_log(Config),
+ ok.
do_simple_sync_get3(Config) ->
Self = self(),
@@ -1703,8 +1753,8 @@ do_simple_sync_get3(Config) ->
%%======================================================================
-simple_async_get1(doc) -> ["Simple (async) get-request - "
- "Old style (Addr & Port)"];
+simple_async_get1(doc) ->
+ ["Simple (async) get-request - Old style (Addr & Port)"];
simple_async_get1(suite) -> [];
simple_async_get1(Config) when is_list(Config) ->
process_flag(trap_exit, true),
@@ -1766,6 +1816,7 @@ simple_async_get1(Config) when is_list(Config) ->
p("manager info when ending test: ~n~p", [mgr_info(MgrNode)]),
p("agent info when ending test: ~n~p", [agent_info(AgentNode)]),
+ display_log(Config),
ok.
async_g_exec1(Node, Addr, Port, Oids) ->
@@ -1816,7 +1867,9 @@ simple_async_get2(Config) when is_list(Config) ->
TargetName = ?config(manager_agent_target_name, Config),
Get = fun(Oids) -> async_g_exec2(MgrNode, TargetName, Oids) end,
PostVerify = fun(Res) -> Res end,
- do_simple_async_sync_get2(Config, MgrNode, AgentNode, Get, PostVerify).
+ do_simple_async_sync_get2(Config, MgrNode, AgentNode, Get, PostVerify),
+ display_log(Config),
+ ok.
do_simple_async_sync_get2(Config, MgrNode, AgentNode, Get, PostVerify) ->
?line ok = mgr_user_load_mib(MgrNode, std_mib()),
@@ -1905,7 +1958,9 @@ simple_async_get3(Config) when is_list(Config) ->
PostVerify = fun(ok) -> receive Msg -> ok end;
(Error) -> Error
end,
- do_simple_async_sync_get2(Config, MgrNode, AgentNode, Get, PostVerify).
+ do_simple_async_sync_get2(Config, MgrNode, AgentNode, Get, PostVerify),
+ display_log(Config),
+ ok.
async_g_exec3(Node, TargetName, Oids, SendOpts) ->
mgr_user_async_get2(Node, TargetName, Oids, SendOpts).
@@ -1999,6 +2054,8 @@ simple_sync_get_next1(Config) when is_list(Config) ->
end,
?line ok = do_simple_get_next(8,
MgrNode, Addr, Port, Oids08, VF08),
+
+ display_log(Config),
ok.
@@ -2062,7 +2119,10 @@ simple_sync_get_next2(Config) when is_list(Config) ->
mgr_user_sync_get_next(Node, TargetName, Oids)
end,
PostVerify = fun(Res) -> Res end,
- do_simple_sync_get_next2(Config, GetNext, PostVerify).
+ do_simple_sync_get_next2(Config, GetNext, PostVerify),
+ display_log(Config),
+ ok.
+
do_simple_sync_get_next2(Config, GetNext, PostVerify)
when is_function(GetNext, 3) andalso is_function(PostVerify, 1) ->
@@ -2193,7 +2253,9 @@ simple_sync_get_next3(Config) when is_list(Config) ->
PostVerify = fun(ok) -> receive Msg -> ok end;
(Error) -> Error
end,
- do_simple_sync_get_next2(Config, GetNext, PostVerify).
+ do_simple_sync_get_next2(Config, GetNext, PostVerify),
+ display_log(Config),
+ ok.
%%======================================================================
@@ -2286,6 +2348,7 @@ simple_async_get_next1(Config) when is_list(Config) ->
p("manager info when ending test: ~n~p", [mgr_info(MgrNode)]),
p("agent info when ending test: ~n~p", [agent_info(AgentNode)]),
+ display_log(Config),
ok.
@@ -2315,7 +2378,9 @@ simple_async_get_next2(Config) when is_list(Config) ->
async_gn_exec2(MgrNode, TargetName, Oids)
end,
PostVerify = fun(Res) -> Res end,
- do_simple_async_get_next2(MgrNode, AgentNode, GetNext, PostVerify).
+ do_simple_async_get_next2(MgrNode, AgentNode, GetNext, PostVerify),
+ display_log(Config),
+ ok.
do_simple_async_get_next2(MgrNode, AgentNode, GetNext, PostVerify)
when is_function(GetNext, 1) andalso is_function(PostVerify, 1) ->
@@ -2437,7 +2502,9 @@ simple_async_get_next3(Config) when is_list(Config) ->
(Error) -> Error
end,
- do_simple_async_get_next2(MgrNode, AgentNode, GetNext, PostVerify).
+ do_simple_async_get_next2(MgrNode, AgentNode, GetNext, PostVerify),
+ display_log(Config),
+ ok.
async_gn_exec3(Node, TargetName, Oids, SendOpts) ->
mgr_user_async_get_next2(Node, TargetName, Oids, SendOpts).
@@ -2475,6 +2542,8 @@ simple_sync_set1(Config) when is_list(Config) ->
{[sysLocation, 0], Val22}
],
?line ok = do_simple_set1(Node, Addr, Port, VAVs2),
+
+ display_log(Config),
ok.
do_simple_set1(Node, Addr, Port, VAVs) ->
@@ -2527,7 +2596,9 @@ simple_sync_set2(Config) when is_list(Config) ->
end,
PostVerify = fun() -> ok end,
- do_simple_sync_set2(Config, Set, PostVerify).
+ do_simple_sync_set2(Config, Set, PostVerify),
+ display_log(Config),
+ ok.
do_simple_sync_set2(Config, Set, PostVerify)
when is_function(Set, 3) andalso is_function(PostVerify, 0) ->
@@ -2604,7 +2675,9 @@ simple_sync_set3(Config) when is_list(Config) ->
end,
PostVerify = fun() -> receive Msg -> ok end end,
- do_simple_sync_set2(Config, Set, PostVerify).
+ do_simple_sync_set2(Config, Set, PostVerify),
+ display_log(Config),
+ ok.
%%======================================================================
@@ -2663,6 +2736,7 @@ simple_async_set1(Config) when is_list(Config) ->
p("manager info when ending test: ~n~p", [mgr_info(MgrNode)]),
p("agent info when ending test: ~n~p", [agent_info(AgentNode)]),
+ display_log(Config),
ok.
@@ -2724,7 +2798,9 @@ simple_async_set2(Config) when is_list(Config) ->
end,
PostVerify = fun(Res) -> Res end,
- do_simple_async_set2(MgrNode, AgentNode, Set, PostVerify).
+ do_simple_async_set2(MgrNode, AgentNode, Set, PostVerify),
+ display_log(Config),
+ ok.
do_simple_async_set2(MgrNode, AgentNode, Set, PostVerify) ->
Requests =
@@ -2806,7 +2882,9 @@ simple_async_set3(Config) when is_list(Config) ->
(Res) -> Res
end,
- do_simple_async_set2(MgrNode, AgentNode, Set, PostVerify).
+ do_simple_async_set2(MgrNode, AgentNode, Set, PostVerify),
+ display_log(Config),
+ ok.
async_s_exec3(Node, TargetName, VAVs, SendOpts) ->
mgr_user_async_set2(Node, TargetName, VAVs, SendOpts).
@@ -2932,6 +3010,7 @@ simple_sync_get_bulk1(Config) when is_list(Config) ->
0, 2,
[[TCnt2, 1]], VF11),
+ display_log(Config),
ok.
fl(L) ->
@@ -3004,7 +3083,9 @@ simple_sync_get_bulk2(Config) when is_list(Config) ->
end,
PostVerify = fun(Res) -> Res end,
- do_simple_sync_get_bulk2(Config, MgrNode, AgentNode, GetBulk, PostVerify).
+ do_simple_sync_get_bulk2(Config, MgrNode, AgentNode, GetBulk, PostVerify),
+ display_log(Config),
+ ok.
do_simple_sync_get_bulk2(Config, MgrNode, AgentNode, GetBulk, PostVerify) ->
%% -- 1 --
@@ -3169,7 +3250,9 @@ simple_sync_get_bulk3(Config) when is_list(Config) ->
(Res) -> Res
end,
- do_simple_sync_get_bulk2(Config, MgrNode, AgentNode, GetBulk, PostVerify).
+ do_simple_sync_get_bulk2(Config, MgrNode, AgentNode, GetBulk, PostVerify),
+ display_log(Config),
+ ok.
%%======================================================================
@@ -3308,6 +3391,7 @@ simple_async_get_bulk1(Config) when is_list(Config) ->
p("manager info when ending test: ~n~p", [mgr_info(MgrNode)]),
p("agent info when ending test: ~n~p", [agent_info(AgentNode)]),
+ display_log(Config),
ok.
@@ -3340,7 +3424,9 @@ simple_async_get_bulk2(Config) when is_list(Config) ->
end,
PostVerify = fun(Res) -> Res end,
- do_simple_async_get_bulk2(MgrNode, AgentNode, GetBulk, PostVerify).
+ do_simple_async_get_bulk2(MgrNode, AgentNode, GetBulk, PostVerify),
+ display_log(Config),
+ ok.
do_simple_async_get_bulk2(MgrNode, AgentNode, GetBulk, PostVerify) ->
%% We re-use the verification functions from the ssgb test-case
@@ -3505,7 +3591,9 @@ simple_async_get_bulk3(Config) when is_list(Config) ->
(Res) -> Res
end,
- do_simple_async_get_bulk2(MgrNode, AgentNode, GetBulk, PostVerify).
+ do_simple_async_get_bulk2(MgrNode, AgentNode, GetBulk, PostVerify),
+ display_log(Config),
+ ok.
async_gb_exec3(Node, TargetName, {NR, MR, Oids}, SendOpts) ->
mgr_user_async_get_bulk2(Node, TargetName, NR, MR, Oids, SendOpts).
@@ -3697,6 +3785,7 @@ misc_async1(Config) when is_list(Config) ->
p("manager info when ending test: ~n~p", [mgr_info(MgrNode)]),
p("agent info when ending test: ~n~p", [agent_info(AgentNode)]),
+ display_log(Config),
ok.
@@ -3885,6 +3974,7 @@ misc_async2(Config) when is_list(Config) ->
p("manager info when ending test: ~n~p", [mgr_info(MgrNode)]),
p("agent info when ending test: ~n~p", [agent_info(AgentNode)]),
+ display_log(Config),
ok.
@@ -4099,7 +4189,9 @@ trap1(Config) when is_list(Config) ->
{5, "Manager and agent info after test completion", Cmd1}
],
- command_handler(Commands).
+ command_handler(Commands),
+ display_log(Config),
+ ok.
%%======================================================================
@@ -4290,7 +4382,9 @@ trap2(Config) when is_list(Config) ->
{7, "Manager and agent info after test completion", Cmd1}
],
- command_handler(Commands).
+ command_handler(Commands),
+ display_log(Config),
+ ok.
%%======================================================================
@@ -4415,7 +4509,9 @@ inform1(Config) when is_list(Config) ->
{6, "Manager and agent info after test completion", Cmd1}
],
- command_handler(Commands).
+ command_handler(Commands),
+ display_log(Config),
+ ok.
%%======================================================================
@@ -4423,7 +4519,7 @@ inform1(Config) when is_list(Config) ->
inform2(suite) -> [];
inform2(Config) when is_list(Config) ->
process_flag(trap_exit, true),
- put(tname,i2),
+ put(tname, i2),
p("starting with Config: ~p~n", [Config]),
MgrNode = ?config(manager_node, Config),
@@ -4577,7 +4673,7 @@ inform2(Config) when is_list(Config) ->
[
{1, "Manager and agent info at start of test", Cmd1},
{2, "Send notifcation [no receiver] from agent", Cmd2},
- {3, "await inform-sent acknowledge from agent", Cmd3},
+ {3, "Await inform-sent acknowledge from agent", Cmd3},
{4, "Await first inform to manager - do not reply", Cmd4},
{5, "Await second inform to manager - reply", Cmd5},
{6, "await inform-acknowledge from agent", Cmd6},
@@ -4585,7 +4681,9 @@ inform2(Config) when is_list(Config) ->
{8, "Manager and agent info after test completion", Cmd1}
],
- command_handler(Commands).
+ command_handler(Commands),
+ display_log(Config),
+ ok.
%%======================================================================
@@ -4719,7 +4817,9 @@ inform3(Config) when is_list(Config) ->
{9, "Manager and agent info after test completion", Cmd1}
],
- command_handler(Commands).
+ command_handler(Commands),
+ display_log(Config),
+ ok.
%%======================================================================
@@ -4835,7 +4935,9 @@ inform4(Config) when is_list(Config) ->
{6, "Manager and agent info after test completion", Cmd1}
],
- command_handler(Commands).
+ command_handler(Commands),
+ display_log(Config),
+ ok.
%%======================================================================
@@ -4923,7 +5025,10 @@ inform_swarm(Config) when is_list(Config) ->
{5, "Manager and agent info after test completion", Cmd1}
],
- command_handler(Commands).
+ command_handler(Commands),
+ display_log(Config),
+ ok.
+
inform_swarm_collector(N) ->
inform_swarm_collector(N, 0, 0, 0, 10000).
@@ -5227,8 +5332,8 @@ init_agent(Config) ->
%% --
%% Retrieve some dir's
%%
- Dir = ?config(top_dir, Config),
- DataDir = ?config(data_dir, Config),
+ Dir = ?config(agent_dir, Config),
+ MibDir = ?config(mib_dir, Config),
%% --
%% Start node
@@ -5259,7 +5364,7 @@ init_agent(Config) ->
?line ok = write_agent_config(Vsns, Config),
Conf = [{agent_node, Node},
- {mib_dir, DataDir} | Config],
+ {mib_dir, MibDir} | Config],
%%
%% Start the agent
@@ -5720,6 +5825,15 @@ start_manager(Node, Vsns, Conf0, Opts) ->
AtlSeqNo = get_opt(manager_atl_seqno, Conf0, false),
+ NetIfConf =
+ case get_opt(manager_net_if_module, Conf0, no_module) of
+ no_module ->
+ [{verbosity, NetIfVerbosity}];
+ NetIfModule ->
+ [{module, NetIfModule},
+ {verbosity, NetIfVerbosity}]
+ end,
+
Env = [{versions, Vsns},
{inform_request_behaviour, IRB},
{audit_trail_log, [{type, read_write},
@@ -5732,7 +5846,7 @@ start_manager(Node, Vsns, Conf0, Opts) ->
{verbosity, ConfigVerbosity}]},
{note_store, [{verbosity, NoteStoreVerbosity}]},
{server, [{verbosity, ServerVerbosity}]},
- {net_if, [{verbosity, NetIfVerbosity}]}],
+ {net_if, NetIfConf}],
?line ok = set_mgr_env(Node, Env),
?line ok = start_snmp(Node),
@@ -6018,6 +6132,38 @@ write_conf_file(Dir, File, Str) ->
%% ------
+display_log(Config) ->
+ case lists:keysearch(manager_log_dir, 1, Config) of
+ {value, {_, Dir}} ->
+ case lists:keysearch(manager_node, 1, Config) of
+ {value, {_, Node}} ->
+ LogDir = Dir,
+ Mibs = [],
+ OutFile = j(LogDir, "snmpm_log.txt"),
+ p("~n"
+ "========================="
+ " < Audit Trail Log > "
+ "========================="
+ "~n"),
+ rcall(Node, snmpm, log_to_txt, [LogDir, Mibs, OutFile]),
+ rcall(Node, snmpm, log_to_io, [LogDir, Mibs]),
+ p("~n"
+ "========================="
+ " < / Audit Trail Log > "
+ "========================="
+ "~n");
+ false ->
+ p("display_log -> no manager node found"),
+ ok
+ end;
+ false ->
+ p("display_log -> no manager log dir found"),
+ ok
+ end.
+
+
+%% ------
+
test2_mib(Config) ->
j(test_mib_dir(Config), "Test2.bin").
@@ -6034,7 +6180,7 @@ snmpv2_mib() ->
j(mib_dir(), "SNMPv2-MIB.bin").
test_mib_dir(Config) ->
- ?config(snmp_data_dir, Config).
+ ?config(mib_dir, Config).
mib_dir() ->
j(code:priv_dir(snmp), "mibs").
diff --git a/lib/snmp/test/snmp_pdus_test.erl b/lib/snmp/test/snmp_pdus_test.erl
index 07b6d6b657..7d649b1dad 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -39,6 +39,7 @@
otp7575/1,
otp8563/1,
otp9022/1,
+ otp10132/1,
init_per_testcase/2, end_per_testcase/2
]).
@@ -74,16 +75,16 @@ end_per_testcase(_Case, Config) when is_list(Config) ->
%% Test case definitions
%%======================================================================
all() ->
-[{group, tickets}].
+ [{group, tickets}].
groups() ->
- [{tickets, [], [otp7575, otp8563, otp9022]}].
+ [{tickets, [], [otp7575, otp8563, otp9022, otp10132]}].
init_per_group(_GroupName, Config) ->
- Config.
+ Config.
end_per_group(_GroupName, Config) ->
- Config.
+ Config.
@@ -94,7 +95,7 @@ end_per_group(_GroupName, Config) ->
%%======================================================================
otp7575(suite) -> [];
-otp7575(doc) -> ["OTP-7575"];
+otp7575(doc) -> ["OTP-7575 - Message version"];
otp7575(Config) when is_list(Config) ->
io:format("attempt to decode message with valid version~n", []),
MsgWithOkVersion = <<48,39,2,1,0,4,6,112,117,98,108,105,99,160,26,2,2,1,49,2,1,0,2,1,0,48,14,48,12,6,8,43,6,1,2,1,1,5,0,5,0>>,
@@ -127,48 +128,55 @@ otp7575(Config) when is_list(Config) ->
otp8563(suite) -> [];
-otp8563(doc) -> ["OTP-8563"];
+otp8563(doc) -> ["OTP-8563 - Counter64"];
otp8563(Config) when is_list(Config) ->
Val1 = 16#7fffffffffffffff,
- io:format("try encode and decode ~w~n", [Val1]),
+ io:format("try encode and decode value 1: ~w (0x~.16b)~n", [Val1, Val1]),
Enc1 = snmp_pdus:enc_value('Counter64', Val1),
+ io:format(" => ~w~n", [Enc1]),
{{'Counter64', Val1}, []} = snmp_pdus:dec_value(Enc1),
Val2 = Val1 + 1,
- io:format("try encode and decode ~w~n", [Val2]),
+ io:format("try encode and decode value 2: ~w (0x~.16b)~n", [Val2, Val2]),
Enc2 = snmp_pdus:enc_value('Counter64', Val2),
+ io:format(" => ~w~n", [Enc2]),
{{'Counter64', Val2}, []} = snmp_pdus:dec_value(Enc2),
Val3 = Val2 + 1,
- io:format("try encode and decode ~w~n", [Val3]),
+ io:format("try encode and decode valule 3: ~w (0x~.16b)~n", [Val3, Val3]),
Enc3 = snmp_pdus:enc_value('Counter64', Val3),
+ io:format(" => ~w~n", [Enc3]),
{{'Counter64', Val3}, []} = snmp_pdus:dec_value(Enc3),
Val4 = 16#fffffffffffffffe,
- io:format("try encode and decode ~w~n", [Val4]),
+ io:format("try encode and decode value 4: ~w (0x~.16b)~n", [Val4, Val4]),
Enc4 = snmp_pdus:enc_value('Counter64', Val4),
+ io:format(" => ~w~n", [Enc4]),
{{'Counter64', Val4}, []} = snmp_pdus:dec_value(Enc4),
Val5 = Val4 + 1,
- io:format("try encode and decode ~w~n", [Val5]),
+ io:format("try encode and decode value 5: ~w (0x~.16b)~n", [Val5, Val5]),
Enc5 = snmp_pdus:enc_value('Counter64', Val5),
+ io:format(" => ~w~n", [Enc5]),
{{'Counter64', Val5}, []} = snmp_pdus:dec_value(Enc5),
Val6 = 16#ffffffffffffffff + 1,
- io:format("try and fail to encode ~w~n", [Val6]),
+ io:format("try and fail to encode value 6: ~w (0x~.16b)~n", [Val6, Val6]),
case (catch snmp_pdus:enc_value('Counter64', Val6)) of
{'EXIT', {error, {bad_counter64, Val6}}} ->
ok;
Unexpected6 ->
+ io:format(" => ~w~n", [Unexpected6]),
exit({unexpected_encode_result, Unexpected6, Val6})
end,
Val7 = -1,
- io:format("try and fail to encode ~w~n", [Val7]),
+ io:format("try and fail to encode value 7: ~w~n", [Val7]),
case (catch snmp_pdus:enc_value('Counter64', Val7)) of
{'EXIT', {error, {bad_counter64, Val7}}} ->
ok;
Unexpected7 ->
+ io:format(" => ~w~n", [Unexpected7]),
exit({unexpected_encode_result, Unexpected7, Val7})
end,
@@ -176,51 +184,151 @@ otp8563(Config) when is_list(Config) ->
otp9022(suite) -> [];
-otp9022(doc) -> ["OTP-9022"];
+otp9022(doc) -> ["OTP-9022 - Counter32"];
otp9022(Config) when is_list(Config) ->
- Val1 = 16#7fffffff,
- io:format("try encode and decode ~w~n", [Val1]),
+ Val0 = 2908389204,
+ io:format("try encode and decode value 0: ~w (0x~.16b)~n", [Val0, Val0]),
+ Enc0 = snmp_pdus:enc_value('Counter32', Val0),
+ io:format(" => ~w~n", [Enc0]),
+ {{'Counter32', Val0}, []} = snmp_pdus:dec_value(Enc0),
+
+ Val1 = 0,
+ io:format("try encode and decode value 1: ~w (0x~.16b)~n", [Val1, Val1]),
Enc1 = snmp_pdus:enc_value('Counter32', Val1),
+ io:format(" => ~w~n", [Enc1]),
{{'Counter32', Val1}, []} = snmp_pdus:dec_value(Enc1),
Val2 = Val1 + 1,
- io:format("try encode and decode ~w~n", [Val2]),
+ io:format("try encode and decode value 2: ~w (0x~.16b)~n", [Val2, Val2]),
Enc2 = snmp_pdus:enc_value('Counter32', Val2),
+ io:format(" => ~w~n", [Enc2]),
{{'Counter32', Val2}, []} = snmp_pdus:dec_value(Enc2),
- Val3 = Val2 + 1,
- io:format("try encode and decode ~w~n", [Val3]),
+ Val3 = 16#7ffffffe,
+ io:format("try encode and decode value 3: ~w (0x~.16b)~n", [Val3, Val3]),
Enc3 = snmp_pdus:enc_value('Counter32', Val3),
+ io:format(" => ~w~n", [Enc3]),
{{'Counter32', Val3}, []} = snmp_pdus:dec_value(Enc3),
- Val4 = 16#fffffffe,
- io:format("try encode and decode ~w~n", [Val4]),
+ Val4 = Val3 + 1,
+ io:format("try encode and decode value 4: ~w (0x~.16b)~n", [Val4, Val4]),
Enc4 = snmp_pdus:enc_value('Counter32', Val4),
+ io:format(" => ~w~n", [Enc4]),
{{'Counter32', Val4}, []} = snmp_pdus:dec_value(Enc4),
Val5 = Val4 + 1,
- io:format("try encode and decode ~w~n", [Val5]),
+ io:format("try encode and decode value 5: ~w (0x~.16b)~n", [Val5, Val5]),
Enc5 = snmp_pdus:enc_value('Counter32', Val5),
+ io:format(" => ~w~n", [Enc5]),
{{'Counter32', Val5}, []} = snmp_pdus:dec_value(Enc5),
- Val6 = 16#ffffffff + 1,
- io:format("try and fail to encode ~w~n", [Val6]),
- case (catch snmp_pdus:enc_value('Counter32', Val6)) of
- {'EXIT', {error, {bad_counter32, Val6}}} ->
+ Val6 = 16#fffffffe,
+ io:format("try encode and decode value 6: ~w (0x~.16b)~n", [Val6, Val6]),
+ Enc6 = snmp_pdus:enc_value('Counter32', Val6),
+ io:format(" => ~w~n", [Enc6]),
+ {{'Counter32', Val6}, []} = snmp_pdus:dec_value(Enc6),
+
+ Val7 = Val6 + 1,
+ io:format("try encode and decode value 7: ~w (0x~.16b)~n", [Val7, Val7]),
+ Enc7 = snmp_pdus:enc_value('Counter32', Val7),
+ io:format(" => ~w~n", [Enc7]),
+ {{'Counter32', Val7}, []} = snmp_pdus:dec_value(Enc7),
+
+ Val8 = 16#ffffffff + 1,
+ io:format("try and fail to encode value 8: ~w (0x~.16b)~n", [Val8, Val8]),
+ case (catch snmp_pdus:enc_value('Counter32', Val8)) of
+ {'EXIT', {error, {bad_counter32, Val8}}} ->
ok;
- Unexpected6 ->
- exit({unexpected_encode_result, Unexpected6, Val6})
+ Unexpected8 ->
+ io:format(" => ~w~n", [Unexpected8]),
+ exit({unexpected_encode_result, Unexpected8, Val8})
end,
- Val7 = -1,
- io:format("try and fail to encode ~w~n", [Val7]),
- case (catch snmp_pdus:enc_value('Counter32', Val7)) of
- {'EXIT', {error, {bad_counter32, Val7}}} ->
+ Val9 = -1,
+ io:format("try and fail to encode value 9: ~w~n", [Val9]),
+ case (catch snmp_pdus:enc_value('Counter32', Val9)) of
+ {'EXIT', {error, {bad_counter32, Val9}}} ->
ok;
- Unexpected7 ->
- exit({unexpected_encode_result, Unexpected7, Val7})
+ Unexpected9 ->
+ io:format(" => ~w~n", [Unexpected9]),
+ exit({unexpected_encode_result, Unexpected9, Val9})
+ end,
+
+ ok.
+
+
+otp10132(suite) -> [];
+otp10132(doc) -> ["OTP-10132 - TimeTicks"];
+otp10132(Config) when is_list(Config) ->
+ Val0 = 2159001034,
+ io:format("try encode and decode value 0: ~w (0x~.16b)~n", [Val0, Val0]),
+ Enc0 = snmp_pdus:enc_value('TimeTicks', Val0),
+ io:format(" => ~w~n", [Enc0]),
+ {{'TimeTicks', Val0}, []} = snmp_pdus:dec_value(Enc0),
+
+ Val1 = 0,
+ io:format("try encode and decode value 1: ~w (0x~.16b)~n", [Val1, Val1]),
+ Enc1 = snmp_pdus:enc_value('TimeTicks', Val1),
+ io:format(" => ~w~n", [Enc1]),
+ {{'TimeTicks', Val1}, []} = snmp_pdus:dec_value(Enc1),
+
+ Val2 = Val1 + 1,
+ io:format("try encode and decode value 2: ~w (0x~.16b)~n", [Val2, Val2]),
+ Enc2 = snmp_pdus:enc_value('TimeTicks', Val2),
+ io:format(" => ~w~n", [Enc2]),
+ {{'TimeTicks', Val2}, []} = snmp_pdus:dec_value(Enc2),
+
+ Val3 = 16#7ffffffe,
+ io:format("try encode and decode value 3: ~w (0x~.16b)~n", [Val3, Val3]),
+ Enc3 = snmp_pdus:enc_value('TimeTicks', Val3),
+ io:format(" => ~w~n", [Enc3]),
+ {{'TimeTicks', Val3}, []} = snmp_pdus:dec_value(Enc3),
+
+ Val4 = Val3 + 1,
+ io:format("try encode and decode value 4: ~w (0x~.16b)~n", [Val4, Val4]),
+ Enc4 = snmp_pdus:enc_value('TimeTicks', Val4),
+ io:format(" => ~w~n", [Enc4]),
+ {{'TimeTicks', Val4}, []} = snmp_pdus:dec_value(Enc4),
+
+ Val5 = Val4 + 1,
+ io:format("try encode and decode value 5: ~w (0x~.16b)~n", [Val5, Val5]),
+ Enc5 = snmp_pdus:enc_value('TimeTicks', Val5),
+ io:format(" => ~w~n", [Enc5]),
+ {{'TimeTicks', Val5}, []} = snmp_pdus:dec_value(Enc5),
+
+ Val6 = 16#fffffffe,
+ io:format("try encode and decode value 6: ~w (0x~.16b)~n", [Val6, Val6]),
+ Enc6 = snmp_pdus:enc_value('TimeTicks', Val6),
+ io:format(" => ~w~n", [Enc6]),
+ {{'TimeTicks', Val6}, []} = snmp_pdus:dec_value(Enc6),
+
+ Val7 = Val6 + 1,
+ io:format("try encode and decode value 7: ~w (0x~.16b)~n", [Val7, Val7]),
+ Enc7 = snmp_pdus:enc_value('TimeTicks', Val7),
+ io:format(" => ~w~n", [Enc7]),
+ {{'TimeTicks', Val7}, []} = snmp_pdus:dec_value(Enc7),
+
+ Val8 = Val7 + 1,
+ io:format("try and fail to encode value 8: ~w (0x~.16b)~n", [Val8, Val8]),
+ case (catch snmp_pdus:enc_value('TimeTicks', Val8)) of
+ {'EXIT', {error, {bad_timeticks, Val8}}} ->
+ ok;
+ Unexpected8 ->
+ io:format(" => ~w~n", [Unexpected8]),
+ exit({unexpected_encode_result, Unexpected8, Val8})
end,
+ Val9 = -1,
+ io:format("try and fail to encode value 9: ~w~n", [Val9]),
+ case (catch snmp_pdus:enc_value('TimeTicks', Val9)) of
+ {'EXIT', {error, {bad_timeticks, Val9}}} ->
+ ok;
+ Unexpected9 ->
+ io:format(" => ~w~n", [Unexpected9]),
+ exit({unexpected_encode_result, Unexpected9, Val9})
+ end,
+
+ io:format("done~n", []),
ok.
diff --git a/lib/snmp/test/snmp_test_data/Test3.mib b/lib/snmp/test/snmp_test_data/Test3.mib
new file mode 100644
index 0000000000..7f76e4dba4
--- /dev/null
+++ b/lib/snmp/test/snmp_test_data/Test3.mib
@@ -0,0 +1,123 @@
+Test3 DEFINITIONS ::= BEGIN
+
+IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE, Integer32, snmpModules, mib-2
+ FROM SNMPv2-SMI
+ MODULE-COMPLIANCE, OBJECT-GROUP
+ FROM SNMPv2-CONF
+ tEntry
+ FROM Test2;
+
+t3MIB MODULE-IDENTITY
+ LAST-UPDATED "1203090000Z"
+ ORGANIZATION ""
+ CONTACT-INFO
+ ""
+ DESCRIPTION
+ "Test mib, used to test processing of requests."
+ ::= { snmpModules 42 }
+
+
+-- Administrative assignments ****************************************
+
+t3MIBObjects OBJECT IDENTIFIER ::= { t3MIB 1 }
+t3MIBConformance OBJECT IDENTIFIER ::= { t3MIB 2 }
+
+
+-- test4 OBJECT IDENTIFIER ::= { mib-2 18 }
+
+tAugTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF TAugEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "This table AUGMENTS tTable of the Test2 MIB."
+ ::= { t3MIBObjects 1 }
+
+tAugEntry OBJECT-TYPE
+ SYNTAX TAugEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An entry (conceptual row) in the sysORTable."
+ AUGMENTS { tEntry }
+ ::= { tAugTable 1 }
+
+TAugEntry ::= SEQUENCE {
+ tFoo1 OCTET STRING,
+ tFoo2 OCTET STRING,
+ tBar1 Integer32,
+ tBar2 Integer32
+}
+
+tFoo1 OBJECT-TYPE
+ SYNTAX OCTET STRING (SIZE (0..255))
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "A string."
+ DEFVAL { "foo 1" }
+ ::= { tAugEntry 1 }
+
+tFoo2 OBJECT-TYPE
+ SYNTAX OCTET STRING (SIZE (0..255))
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A string."
+ DEFVAL { "foo 2" }
+ ::= { tAugEntry 2 }
+
+tBar1 OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "An integer."
+ DEFVAL { 42 }
+ ::= { tAugEntry 3 }
+
+tBar2 OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An integer."
+ DEFVAL { 42 }
+ ::= { tAugEntry 4 }
+
+
+-- Conformance Information *******************************************
+
+t3MIBCompliances OBJECT IDENTIFIER
+ ::= { t3MIBConformance 1 }
+t3MIBGroups OBJECT IDENTIFIER
+ ::= { t3MIBConformance 2 }
+
+-- Compliance statements
+
+t3MIBCompliance MODULE-COMPLIANCE
+ STATUS current
+ DESCRIPTION
+ "The compliance statement for SNMP engines which
+ implement the SNMP-COMMUNITY-MIB."
+
+ MODULE -- this module
+ MANDATORY-GROUPS { t3Group }
+
+ ::= { t3MIBCompliances 1 }
+
+t3Group OBJECT-GROUP
+ OBJECTS {
+ tFoo1,
+ tFoo2,
+ tBar1,
+ tBar2
+ }
+ STATUS current
+ DESCRIPTION
+ "A group."
+ ::= { t3MIBGroups 1 }
+
+
+END
diff --git a/lib/snmp/test/snmp_test_lib.erl b/lib/snmp/test/snmp_test_lib.erl
index e4d58a1253..e327456bc4 100644
--- a/lib/snmp/test/snmp_test_lib.erl
+++ b/lib/snmp/test/snmp_test_lib.erl
@@ -25,7 +25,10 @@
-export([hostname/0, hostname/1, localhost/0, os_type/0, sz/1,
display_suite_info/1]).
-export([non_pc_tc_maybe_skip/4, os_based_skip/1]).
--export([replace_config/3, set_config/3, get_config/2, get_config/3]).
+-export([fix_data_dir/1,
+ init_suite_top_dir/2, init_group_top_dir/2, init_testcase_top_dir/2,
+ lookup/2,
+ replace_config/3, set_config/3, get_config/2, get_config/3]).
-export([fail/3, skip/3]).
-export([millis/0, millis_diff/2, hours/1, minutes/1, seconds/1, sleep/1]).
-export([flush_mqueue/0, trap_exit/0, trap_exit/1]).
@@ -198,6 +201,97 @@ os_based_skip(_Crap) ->
%% Test suite utility functions
%%
+fix_data_dir(Config) ->
+ DataDir0 = lookup(data_dir, Config),
+ DataDir1 = filename:split(filename:absname(DataDir0)),
+ [_|DataDir2] = lists:reverse(DataDir1),
+ DataDir = filename:join(lists:reverse(DataDir2) ++ [?snmp_test_data]),
+ Config1 = lists:keydelete(data_dir, 1, Config),
+ [{data_dir, DataDir ++ "/"} | Config1].
+
+
+init_suite_top_dir(Suite, Config0) ->
+ io:format("~w:init_suite_top_dir -> entry with"
+ "~n Suite: ~p"
+ "~n Config0: ~p"
+ "~n", [?MODULE, Suite, Config0]),
+ Dir = lookup(priv_dir, Config0),
+ SuiteTopDir = filename:join(Dir, Suite),
+ case file:make_dir(SuiteTopDir) of
+ ok ->
+ ok;
+ {error, eexist} ->
+ ok;
+ {error, Reason} ->
+ fail({failed_creating_suite_top_dir, SuiteTopDir, Reason},
+ ?MODULE, ?LINE)
+ end,
+
+ %% This is just in case...
+ Config1 = lists:keydelete(snmp_group_top_dir, 1, Config0),
+ Config2 = lists:keydelete(snmp_suite_top_dir, 1, Config1),
+ [{snmp_suite_top_dir, SuiteTopDir} | Config2].
+
+
+init_group_top_dir(GroupName, Config) ->
+ io:format("~w:init_group_top_dir -> entry with"
+ "~n GroupName: ~p"
+ "~n Config: ~p"
+ "~n", [?MODULE, GroupName, Config]),
+ case lists:keysearch(snmp_group_top_dir, 1, Config) of
+ {value, {_Key, Dir}} ->
+ %% This is a sub-group, so create our dir within Dir
+ GroupTopDir = filename:join(Dir, GroupName),
+ case file:make_dir(GroupTopDir) of
+ ok ->
+ ok;
+ {error, Reason} ->
+ fail({failed_creating_group_top_dir, GroupTopDir, Reason},
+ ?MODULE, ?LINE)
+ end,
+ [{snmp_group_top_dir, GroupTopDir} | Config];
+
+ _ ->
+ case lists:keysearch(snmp_suite_top_dir, 1, Config) of
+ {value, {_Key, Dir}} ->
+ GroupTopDir = filename:join(Dir, GroupName),
+ case file:make_dir(GroupTopDir) of
+ ok ->
+ ok;
+ {error, Reason} ->
+ fail({failed_creating_group_top_dir,
+ GroupTopDir, Reason},
+ ?MODULE, ?LINE)
+ end,
+ [{snmp_group_top_dir, GroupTopDir} | Config];
+ _ ->
+ fail(could_not_find_suite_top_dir, ?MODULE, ?LINE)
+ end
+ end.
+
+
+init_testcase_top_dir(Case, Config) ->
+ io:format("~w:init_testcase_top_dir -> entry with"
+ "~n Case: ~p"
+ "~n Config: ~p"
+ "~n", [?MODULE, Case, Config]),
+ case lists:keysearch(snmp_group_top_dir, 1, Config) of
+ {value, {_Key, Dir}} ->
+ CaseTopDir = filename:join(Dir, Case),
+ ok = file:make_dir(CaseTopDir),
+ CaseTopDir;
+ false ->
+ case lists:keysearch(snmp_suite_top_dir, 1, Config) of
+ {value, {_Key, Dir}} ->
+ CaseTopDir = filename:join(Dir, Case),
+ ok = file:make_dir(CaseTopDir),
+ CaseTopDir;
+ false ->
+ fail(failed_creating_case_top_dir, ?MODULE, ?LINE)
+ end
+ end.
+
+
replace_config(Key, Config, NewValue) ->
lists:keyreplace(Key, 1, Config, {Key, NewValue}).
@@ -220,6 +314,9 @@ get_config(Key,C,Default) ->
Default
end.
+lookup(Key, Config) ->
+ {value, {Key, Value}} = lists:keysearch(Key, 1, Config),
+ Value.
fail(Reason, Mod, Line) ->
exit({suite_failed, Reason, Mod, Line}).
@@ -419,8 +516,6 @@ warning_msg(F, A) ->
timeout(T) ->
trunc(timeout(T, os:type())).
-timeout(T, vxworks) ->
- 5 * T * timetrap_scale_factor();
timeout(T, _) ->
T * timetrap_scale_factor().
diff --git a/lib/snmp/test/snmp_test_mgr.erl b/lib/snmp/test/snmp_test_mgr.erl
index 499cf7abcf..40fcbce8f1 100644
--- a/lib/snmp/test/snmp_test_mgr.erl
+++ b/lib/snmp/test/snmp_test_mgr.erl
@@ -161,7 +161,6 @@ get_timeout() ->
get_timeout(os:type())
end.
-get_timeout(vxworks) -> 7000;
get_timeout(_) -> 3500.
%%----------------------------------------------------------------------
diff --git a/lib/snmp/test/test-mibs/RMON-MIB.mib b/lib/snmp/test/test-mibs/RMON-MIB.mib
index 0824dbde1d..fa5bc82f4a 100644
--- a/lib/snmp/test/test-mibs/RMON-MIB.mib
+++ b/lib/snmp/test/test-mibs/RMON-MIB.mib
@@ -1,3826 +1,3958 @@
- RMON-MIB DEFINITIONS ::= BEGIN
-
- IMPORTS
- Counter FROM RFC1155-SMI
- mib-2,DisplayString FROM RFC1213-MIB
- OBJECT-TYPE FROM RFC-1212
- TRAP-TYPE FROM RFC-1215;
-
- -- Remote Network Monitoring MIB
-
- rmon OBJECT IDENTIFIER ::= { mib-2 16 }
-
-
- -- textual conventions
-
- OwnerString ::= DisplayString
- -- This data type is used to model an administratively
- -- assigned name of the owner of a resource. This
- -- information is taken from the NVT ASCII character
- -- set. It is suggested that this name contain one or
-
-
- -- more of the following: IP address, management station
- -- name, network manager's name, location, or phone
- -- number.
- -- In some cases the agent itself will be the owner of
- -- an entry. In these cases, this string shall be set
- -- to a string starting with 'monitor'.
- --
- -- SNMP access control is articulated entirely in terms
- -- of the contents of MIB views; access to a particular
- -- SNMP object instance depends only upon its presence
- -- or absence in a particular MIB view and never upon
- -- its value or the value of related object instances.
- -- Thus, objects of this type afford resolution of
- -- resource contention only among cooperating managers;
- -- they realize no access control function with respect
- -- to uncooperative parties.
- --
- -- By convention, objects with this syntax are declared as
- -- having
- --
- -- SIZE (0..127)
-
- EntryStatus ::= INTEGER
- { valid(1),
- createRequest(2),
- underCreation(3),
- invalid(4)
- }
- -- The status of a table entry.
- --
- -- Setting this object to the value invalid(4) has the
- -- effect of invalidating the corresponding entry.
- -- That is, it effectively disassociates the mapping
- -- identified with said entry.
- -- It is an implementation-specific matter as to whether
- -- the agent removes an invalidated entry from the table.
- -- Accordingly, management stations must be prepared to
- -- receive tabular information from agents that
- -- corresponds to entries currently not in use. Proper
- -- interpretation of such entries requires examination
- -- of the relevant EntryStatus object.
- --
- -- An existing instance of this object cannot be set to
- -- createRequest(2). This object may only be set to
- -- createRequest(2) when this instance is created. When
- -- this object is created, the agent may wish to create
- -- supplemental object instances with default values
- -- to complete a conceptual row in this table. Because
-
-
- -- the creation of these default objects is entirely at
- -- the option of the agent, the manager must not assume
- -- that any will be created, but may make use of any that
- -- are created. Immediately after completing the create
- -- operation, the agent must set this object to
- -- underCreation(3).
- --
- -- When in the underCreation(3) state, an entry is
- -- allowed to exist in a possibly incomplete, possibly
- -- inconsistent state, usually to allow it to be
- -- modified in mutiple PDUs. When in this state, an
- -- entry is not fully active. Entries shall exist in
- -- the underCreation(3) state until the management
- -- station is finished configuring the entry and sets
- -- this object to valid(1) or aborts, setting this
- -- object to invalid(4). If the agent determines that
- -- an entry has been in the underCreation(3) state for
- -- an abnormally long time, it may decide that the
- -- management station has crashed. If the agent makes
- -- this decision, it may set this object to invalid(4)
- -- to reclaim the entry. A prudent agent will
- -- understand that the management station may need to
- -- wait for human input and will allow for that
- -- possibility in its determination of this abnormally
- -- long period.
- --
- -- An entry in the valid(1) state is fully configured and
- -- consistent and fully represents the configuration or
- -- operation such a row is intended to represent. For
- -- example, it could be a statistical function that is
- -- configured and active, or a filter that is available
- -- in the list of filters processed by the packet capture
- -- process.
- --
- -- A manager is restricted to changing the state of an
- -- entry in the following ways:
- --
- -- create under
- -- To: valid Request Creation invalid
- -- From:
- -- valid OK NO OK OK
- -- createRequest N/A N/A N/A N/A
- -- underCreation OK NO OK OK
- -- invalid NO NO NO OK
- -- nonExistent NO OK NO OK
- --
- -- In the table above, it is not applicable to move the
- -- state from the createRequest state to any other
-
-
- -- state because the manager will never find the
- -- variable in that state. The nonExistent state is
- -- not a value of the enumeration, rather it means that
- -- the entryStatus variable does not exist at all.
- --
- -- An agent may allow an entryStatus variable to change
- -- state in additional ways, so long as the semantics
- -- of the states are followed. This allowance is made
- -- to ease the implementation of the agent and is made
- -- despite the fact that managers should never
- -- excercise these additional state transitions.
-
-
- statistics OBJECT IDENTIFIER ::= { rmon 1 }
- history OBJECT IDENTIFIER ::= { rmon 2 }
- alarm OBJECT IDENTIFIER ::= { rmon 3 }
- hosts OBJECT IDENTIFIER ::= { rmon 4 }
- hostTopN OBJECT IDENTIFIER ::= { rmon 5 }
- matrix OBJECT IDENTIFIER ::= { rmon 6 }
- filter OBJECT IDENTIFIER ::= { rmon 7 }
- capture OBJECT IDENTIFIER ::= { rmon 8 }
- event OBJECT IDENTIFIER ::= { rmon 9 }
-
-
- -- The Ethernet Statistics Group
- --
- -- Implementation of the Ethernet Statistics group is
- -- optional.
- --
- -- The ethernet statistics group contains statistics
- -- measured by the probe for each monitored interface on
- -- this device. These statistics take the form of free
- -- running counters that start from zero when a valid entry
- -- is created.
- --
- -- This group currently has statistics defined only for
- -- Ethernet interfaces. Each etherStatsEntry contains
- -- statistics for one Ethernet interface. The probe must
- -- create one etherStats entry for each monitored Ethernet
- -- interface on the device.
-
- etherStatsTable OBJECT-TYPE
- SYNTAX SEQUENCE OF EtherStatsEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of Ethernet statistics entries."
- ::= { statistics 1 }
-
-
- etherStatsEntry OBJECT-TYPE
- SYNTAX EtherStatsEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A collection of statistics kept for a particular
- Ethernet interface. As an example, an instance of the
- etherStatsPkts object might be named etherStatsPkts.1"
- INDEX { etherStatsIndex }
- ::= { etherStatsTable 1 }
-
- EtherStatsEntry ::= SEQUENCE {
- etherStatsIndex INTEGER (1..65535),
- etherStatsDataSource OBJECT IDENTIFIER,
- etherStatsDropEvents Counter,
- etherStatsOctets Counter,
- etherStatsPkts Counter,
- etherStatsBroadcastPkts Counter,
- etherStatsMulticastPkts Counter,
- etherStatsCRCAlignErrors Counter,
- etherStatsUndersizePkts Counter,
- etherStatsOversizePkts Counter,
- etherStatsFragments Counter,
- etherStatsJabbers Counter,
- etherStatsCollisions Counter,
- etherStatsPkts64Octets Counter,
- etherStatsPkts65to127Octets Counter,
- etherStatsPkts128to255Octets Counter,
- etherStatsPkts256to511Octets Counter,
- etherStatsPkts512to1023Octets Counter,
- etherStatsPkts1024to1518Octets Counter,
- etherStatsOwner OwnerString,
- etherStatsStatus EntryStatus
- }
-
- etherStatsIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The value of this object uniquely identifies this
- etherStats entry."
- ::= { etherStatsEntry 1 }
-
- etherStatsDataSource OBJECT-TYPE
- SYNTAX OBJECT IDENTIFIER
- ACCESS read-write
- STATUS mandatory
-
-
- DESCRIPTION
- "This object identifies the source of the data that
- this etherStats entry is configured to analyze. This
- source can be any ethernet interface on this device.
- In order to identify a particular interface, this
- object shall identify the instance of the ifIndex
- object, defined in RFC 1213 and RFC 1573 [4,6], for
- the desired interface. For example, if an entry
- were to receive data from interface #1, this object
- would be set to ifIndex.1.
-
- The statistics in this group reflect all packets
- on the local network segment attached to the
- identified interface.
-
- An agent may or may not be able to tell if
- fundamental changes to the media of the interface
- have occurred and necessitate an invalidation of
- this entry. For example, a hot-pluggable ethernet
- card could be pulled out and replaced by a
- token-ring card. In such a case, if the agent has
- such knowledge of the change, it is recommended that
- it invalidate this entry.
-
- This object may not be modified if the associated
- etherStatsStatus object is equal to valid(1)."
- ::= { etherStatsEntry 2 }
-
- etherStatsDropEvents OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of events in which packets
- were dropped by the probe due to lack of resources.
- Note that this number is not necessarily the number of
- packets dropped; it is just the number of times this
- condition has been detected."
- ::= { etherStatsEntry 3 }
-
- etherStatsOctets OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of octets of data (including
- those in bad packets) received on the
- network (excluding framing bits but including
-
-
- FCS octets).
-
- This object can be used as a reasonable estimate of
- ethernet utilization. If greater precision is
- desired, the etherStatsPkts and etherStatsOctets
- objects should be sampled before and after a common
- interval. The differences in the sampled values are
- Pkts and Octets, respectively, and the number of
- seconds in the interval is Interval. These values
- are used to calculate the Utilization as follows:
-
- Pkts * (9.6 + 6.4) + (Octets * .8)
- Utilization = -------------------------------------
- Interval * 10,000
-
- The result of this equation is the value Utilization
- which is the percent utilization of the ethernet
- segment on a scale of 0 to 100 percent."
- ::= { etherStatsEntry 4 }
-
- etherStatsPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of packets (including bad packets,
- broadcast packets, and multicast packets) received."
- ::= { etherStatsEntry 5 }
-
- etherStatsBroadcastPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of good packets received that were
- directed to the broadcast address. Note that this
- does not include multicast packets."
- ::= { etherStatsEntry 6 }
-
- etherStatsMulticastPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of good packets received that were
- directed to a multicast address. Note that this
- number does not include packets directed to the
- broadcast address."
-
-
- ::= { etherStatsEntry 7 }
-
- etherStatsCRCAlignErrors OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of packets received that
- had a length (excluding framing bits, but
- including FCS octets) of between 64 and 1518
- octets, inclusive, but but had either a bad
- Frame Check Sequence (FCS) with an integral
- number of octets (FCS Error) or a bad FCS with
- a non-integral number of octets (Alignment Error)."
- ::= { etherStatsEntry 8 }
-
- etherStatsUndersizePkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of packets received that were
- less than 64 octets long (excluding framing bits,
- but including FCS octets) and were otherwise well
- formed."
- ::= { etherStatsEntry 9 }
-
- etherStatsOversizePkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of packets received that were
- longer than 1518 octets (excluding framing bits,
- but including FCS octets) and were otherwise
- well formed."
- ::= { etherStatsEntry 10 }
-
- etherStatsFragments OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of packets received that were less
- than 64 octets in length (excluding framing bits but
- including FCS octets) and had either a bad Frame
- Check Sequence (FCS) with an integral number of
- octets (FCS Error) or a bad FCS with a non-integral
-
-
- number of octets (Alignment Error).
-
- Note that it is entirely normal for
- etherStatsFragments to increment. This is because
- it counts both runts (which are normal occurrences
- due to collisions) and noise hits."
- ::= { etherStatsEntry 11 }
-
- etherStatsJabbers OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of packets received that were
- longer than 1518 octets (excluding framing bits,
- but including FCS octets), and had either a bad
- Frame Check Sequence (FCS) with an integral number
- of octets (FCS Error) or a bad FCS with a
- non-integral number of octets (Alignment Error).
-
- Note that this definition of jabber is different
- than the definition in IEEE-802.3 section 8.2.1.5
- (10BASE5) and section 10.3.1.4 (10BASE2). These
- documents define jabber as the condition where any
- packet exceeds 20 ms. The allowed range to detect
- jabber is between 20 ms and 150 ms."
- ::= { etherStatsEntry 12 }
-
- etherStatsCollisions OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The best estimate of the total number of collisions
- on this Ethernet segment.
-
- The value returned will depend on the location of
- the RMON probe. Section 8.2.1.3 (10BASE-5) and
- section 10.3.1.3 (10BASE-2) of IEEE standard 802.3
- states that a station must detect a collision, in
- the receive mode, if three or more stations are
- transmitting simultaneously. A repeater port must
- detect a collision when two or more stations are
- transmitting simultaneously. Thus a probe placed on
- a repeater port could record more collisions than a
- probe connected to a station on the same segment
- would.
-
-
-
- Probe location plays a much smaller role when
- considering 10BASE-T. 14.2.1.4 (10BASE-T) of IEEE
- standard 802.3 defines a collision as the
- simultaneous presence of signals on the DO and RD
- circuits (transmitting and receiving at the same
- time). A 10BASE-T station can only detect
- collisions when it is transmitting. Thus probes
- placed on a station and a repeater, should report
- the same number of collisions.
-
- Note also that an RMON probe inside a repeater
- should ideally report collisions between the
- repeater and one or more other hosts (transmit
- collisions as defined by IEEE 802.3k) plus receiver
- collisions observed on any coax segments to which
- the repeater is connected."
- ::= { etherStatsEntry 13 }
-
- etherStatsPkts64Octets OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of packets (including bad
- packets) received that were 64 octets in length
- (excluding framing bits but including FCS octets)."
- ::= { etherStatsEntry 14 }
-
- etherStatsPkts65to127Octets OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of packets (including bad
- packets) received that were between
- 65 and 127 octets in length inclusive
- (excluding framing bits but including FCS octets)."
- ::= { etherStatsEntry 15 }
-
- etherStatsPkts128to255Octets OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of packets (including bad
- packets) received that were between
- 128 and 255 octets in length inclusive
- (excluding framing bits but including FCS octets)."
-
-
- ::= { etherStatsEntry 16 }
-
- etherStatsPkts256to511Octets OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of packets (including bad
- packets) received that were between
- 256 and 511 octets in length inclusive
- (excluding framing bits but including FCS octets)."
- ::= { etherStatsEntry 17 }
-
- etherStatsPkts512to1023Octets OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of packets (including bad
- packets) received that were between
- 512 and 1023 octets in length inclusive
- (excluding framing bits but including FCS octets)."
- ::= { etherStatsEntry 18 }
-
- etherStatsPkts1024to1518Octets OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of packets (including bad
- packets) received that were between
- 1024 and 1518 octets in length inclusive
- (excluding framing bits but including FCS octets)."
- ::= { etherStatsEntry 19 }
-
- etherStatsOwner OBJECT-TYPE
- SYNTAX OwnerString
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The entity that configured this entry and is
- therefore using the resources assigned to it."
- ::= { etherStatsEntry 20 }
-
- etherStatsStatus OBJECT-TYPE
- SYNTAX EntryStatus
- ACCESS read-write
- STATUS mandatory
-
-
- DESCRIPTION
- "The status of this etherStats entry."
- ::= { etherStatsEntry 21 }
-
-
- -- The History Control Group
-
- -- Implementation of the History Control group is optional.
- --
- -- The history control group controls the periodic statistical
- -- sampling of data from various types of networks. The
- -- historyControlTable stores configuration entries that each
- -- define an interface, polling period, and other parameters.
- -- Once samples are taken, their data is stored in an entry
- -- in a media-specific table. Each such entry defines one
- -- sample, and is associated with the historyControlEntry that
- -- caused the sample to be taken. Each counter in the
- -- etherHistoryEntry counts the same event as its
- -- similarly-named counterpart in the etherStatsEntry,
- -- except that each value here is a cumulative sum during a
- -- sampling period.
- --
- -- If the probe keeps track of the time of day, it should
- -- start the first sample of the history at a time such that
- -- when the next hour of the day begins, a sample is
- -- started at that instant. This tends to make more
- -- user-friendly reports, and enables comparison of reports
- -- from different probes that have relatively accurate time
- -- of day.
- --
- -- The probe is encouraged to add two history control entries
- -- per monitored interface upon initialization that describe
- -- a short term and a long term polling period. Suggested
- -- parameters are 30 seconds for the short term polling period
- -- and 30 minutes for the long term period.
-
- historyControlTable OBJECT-TYPE
- SYNTAX SEQUENCE OF HistoryControlEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of history control entries."
- ::= { history 1 }
-
- historyControlEntry OBJECT-TYPE
- SYNTAX HistoryControlEntry
- ACCESS not-accessible
- STATUS mandatory
-
-
- DESCRIPTION
- "A list of parameters that set up a periodic sampling
- of statistics. As an example, an instance of the
- historyControlInterval object might be named
- historyControlInterval.2"
- INDEX { historyControlIndex }
- ::= { historyControlTable 1 }
-
- HistoryControlEntry ::= SEQUENCE {
- historyControlIndex INTEGER (1..65535),
- historyControlDataSource OBJECT IDENTIFIER,
- historyControlBucketsRequested INTEGER (1..65535),
- historyControlBucketsGranted INTEGER (1..65535),
- historyControlInterval INTEGER (1..3600),
- historyControlOwner OwnerString,
- historyControlStatus EntryStatus
- }
-
- historyControlIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "An index that uniquely identifies an entry in the
- historyControl table. Each such entry defines a
- set of samples at a particular interval for an
- interface on the device."
- ::= { historyControlEntry 1 }
-
- historyControlDataSource OBJECT-TYPE
- SYNTAX OBJECT IDENTIFIER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "This object identifies the source of the data for
- which historical data was collected and
- placed in a media-specific table on behalf of this
- historyControlEntry. This source can be any
- interface on this device. In order to identify
- a particular interface, this object shall identify
- the instance of the ifIndex object, defined
- in RFC 1213 and RFC 1573 [4,6], for the desired
- interface. For example, if an entry were to receive
- data from interface #1, this object would be set
- to ifIndex.1.
-
- The statistics in this group reflect all packets
- on the local network segment attached to the
-
-
- identified interface.
-
- An agent may or may not be able to tell if fundamental
- changes to the media of the interface have occurred
- and necessitate an invalidation of this entry. For
- example, a hot-pluggable ethernet card could be
- pulled out and replaced by a token-ring card. In
- such a case, if the agent has such knowledge of the
- change, it is recommended that it invalidate this
- entry.
-
- This object may not be modified if the associated
- historyControlStatus object is equal to valid(1)."
- ::= { historyControlEntry 2 }
-
- historyControlBucketsRequested OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The requested number of discrete time intervals
- over which data is to be saved in the part of the
- media-specific table associated with this
- historyControlEntry.
-
- When this object is created or modified, the probe
- should set historyControlBucketsGranted as closely to
- this object as is possible for the particular probe
- implementation and available resources."
- DEFVAL { 50 }
- ::= { historyControlEntry 3 }
-
- historyControlBucketsGranted OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of discrete sampling intervals
- over which data shall be saved in the part of
- the media-specific table associated with this
- historyControlEntry.
-
- When the associated historyControlBucketsRequested
- object is created or modified, the probe
- should set this object as closely to the requested
- value as is possible for the particular
- probe implementation and available resources. The
- probe must not lower this value except as a result
-
-
- of a modification to the associated
- historyControlBucketsRequested object.
-
- There will be times when the actual number of
- buckets associated with this entry is less than
- the value of this object. In this case, at the
- end of each sampling interval, a new bucket will
- be added to the media-specific table.
-
- When the number of buckets reaches the value of
- this object and a new bucket is to be added to the
- media-specific table, the oldest bucket associated
- with this historyControlEntry shall be deleted by
- the agent so that the new bucket can be added.
-
- When the value of this object changes to a value less
- than the current value, entries are deleted
- from the media-specific table associated with this
- historyControlEntry. Enough of the oldest of these
- entries shall be deleted by the agent so that their
- number remains less than or equal to the new value of
- this object.
-
- When the value of this object changes to a value
- greater than the current value, the number of
- associated media- specific entries may be allowed to
- grow."
- ::= { historyControlEntry 4 }
-
- historyControlInterval OBJECT-TYPE
- SYNTAX INTEGER (1..3600)
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The interval in seconds over which the data is
- sampled for each bucket in the part of the
- media-specific table associated with this
- historyControlEntry. This interval can
- be set to any number of seconds between 1 and
- 3600 (1 hour).
-
- Because the counters in a bucket may overflow at their
- maximum value with no indication, a prudent manager
- will take into account the possibility of overflow
- in any of the associated counters. It is important
- to consider the minimum time in which any counter
- could overflow on a particular media type and set
- the historyControlInterval object to a value less
-
-
- than this interval. This is typically most
- important for the 'octets' counter in any
- media-specific table. For example, on an Ethernet
- network, the etherHistoryOctets counter could
- overflow in about one hour at the Ethernet's maximum
- utilization.
-
- This object may not be modified if the associated
- historyControlStatus object is equal to valid(1)."
- DEFVAL { 1800 }
- ::= { historyControlEntry 5 }
-
- historyControlOwner OBJECT-TYPE
- SYNTAX OwnerString
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The entity that configured this entry and is
- therefore using the resources assigned to it."
- ::= { historyControlEntry 6 }
-
- historyControlStatus OBJECT-TYPE
- SYNTAX EntryStatus
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The status of this historyControl entry.
-
- Each instance of the media-specific table associated
- with this historyControlEntry will be deleted by the
- agent if this historyControlEntry is not equal to
- valid(1)."
- ::= { historyControlEntry 7 }
-
-
- -- The Ethernet History Group
-
- -- Implementation of the Ethernet History group is optional.
- --
- -- The Ethernet History group records periodic
- -- statistical samples from a network and stores them
- -- for later retrieval. Once samples are taken, their
- -- data is stored in an entry in a media-specific
- -- table. Each such entry defines one sample, and is
- -- associated with the historyControlEntry that caused
- -- the sample to be taken. This group defines the
- -- etherHistoryTable, for Ethernet networks.
- --
-
-
- etherHistoryTable OBJECT-TYPE
- SYNTAX SEQUENCE OF EtherHistoryEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of Ethernet history entries."
- ::= { history 2 }
-
- etherHistoryEntry OBJECT-TYPE
- SYNTAX EtherHistoryEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "An historical sample of Ethernet statistics on a
- particular Ethernet interface. This sample is
- associated with the historyControlEntry which set up
- the parameters for a regular collection of these
- samples. As an example, an instance of the
- etherHistoryPkts object might be named
- etherHistoryPkts.2.89"
- INDEX { etherHistoryIndex , etherHistorySampleIndex }
- ::= { etherHistoryTable 1 }
-
- EtherHistoryEntry ::= SEQUENCE {
- etherHistoryIndex INTEGER (1..65535),
- etherHistorySampleIndex INTEGER (1..2147483647),
- etherHistoryIntervalStart TimeTicks,
- etherHistoryDropEvents Counter,
- etherHistoryOctets Counter,
- etherHistoryPkts Counter,
- etherHistoryBroadcastPkts Counter,
- etherHistoryMulticastPkts Counter,
- etherHistoryCRCAlignErrors Counter,
- etherHistoryUndersizePkts Counter,
- etherHistoryOversizePkts Counter,
- etherHistoryFragments Counter,
- etherHistoryJabbers Counter,
- etherHistoryCollisions Counter,
- etherHistoryUtilization INTEGER (0..10000)
- }
-
- etherHistoryIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The history of which this entry is a part. The
- history identified by a particular value of this
-
-
- index is the same history as identified
- by the same value of historyControlIndex."
- ::= { etherHistoryEntry 1 }
-
- etherHistorySampleIndex OBJECT-TYPE
- SYNTAX INTEGER (1..2147483647)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "An index that uniquely identifies the particular
- sample this entry represents among all samples
- associated with the same historyControlEntry.
- This index starts at 1 and increases by one
- as each new sample is taken."
- ::= { etherHistoryEntry 2 }
-
- etherHistoryIntervalStart OBJECT-TYPE
- SYNTAX TimeTicks
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The value of sysUpTime at the start of the interval
- over which this sample was measured. If the probe
- keeps track of the time of day, it should start
- the first sample of the history at a time such that
- when the next hour of the day begins, a sample is
- started at that instant. Note that following this
- rule may require the probe to delay collecting the
- first sample of the history, as each sample must be
- of the same interval. Also note that the sample which
- is currently being collected is not accessible in this
- table until the end of its interval."
- ::= { etherHistoryEntry 3 }
-
- etherHistoryDropEvents OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of events in which packets
- were dropped by the probe due to lack of resources
- during this sampling interval. Note that this number
- is not necessarily the number of packets dropped, it
- is just the number of times this condition has been
- detected."
- ::= { etherHistoryEntry 4 }
-
- etherHistoryOctets OBJECT-TYPE
-
-
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of octets of data (including
- those in bad packets) received on the
- network (excluding framing bits but including
- FCS octets)."
- ::= { etherHistoryEntry 5 }
-
- etherHistoryPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of packets (including bad packets)
- received during this sampling interval."
- ::= { etherHistoryEntry 6 }
-
- etherHistoryBroadcastPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of good packets received during this
- sampling interval that were directed to the
- broadcast address."
- ::= { etherHistoryEntry 7 }
-
- etherHistoryMulticastPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of good packets received during this
- sampling interval that were directed to a
- multicast address. Note that this number does not
- include packets addressed to the broadcast address."
- ::= { etherHistoryEntry 8 }
-
- etherHistoryCRCAlignErrors OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of packets received during this sampling
- interval that had a length (excluding framing bits
- but including FCS octets) between 64 and 1518
-
-
- octets, inclusive, but had either a bad Frame Check
- Sequence (FCS) with an integral number of octets
- (FCS Error) or a bad FCS with a non-integral number
- of octets (Alignment Error)."
- ::= { etherHistoryEntry 9 }
-
- etherHistoryUndersizePkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of packets received during this
- sampling interval that were less than 64 octets
- long (excluding framing bits but including FCS
- octets) and were otherwise well formed."
- ::= { etherHistoryEntry 10 }
-
- etherHistoryOversizePkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of packets received during this
- sampling interval that were longer than 1518
- octets (excluding framing bits but including
- FCS octets) but were otherwise well formed."
- ::= { etherHistoryEntry 11 }
-
- etherHistoryFragments OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The total number of packets received during this
- sampling interval that were less than 64 octets in
- length (excluding framing bits but including FCS
- octets) had either a bad Frame Check Sequence (FCS)
- with an integral number of octets (FCS Error) or a bad
- FCS with a non-integral number of octets (Alignment
- Error).
-
- Note that it is entirely normal for
- etherHistoryFragments to increment. This is because
- it counts both runts (which are normal occurrences
- due to collisions) and noise hits."
- ::= { etherHistoryEntry 12 }
-
- etherHistoryJabbers OBJECT-TYPE
-
-
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of packets received during this
- sampling interval that were longer than 1518 octets
- (excluding framing bits but including FCS octets),
- and had either a bad Frame Check Sequence (FCS)
- with an integral number of octets (FCS Error) or
- a bad FCS with a non-integral number of octets
- (Alignment Error).
-
- Note that this definition of jabber is different
- than the definition in IEEE-802.3 section 8.2.1.5
- (10BASE5) and section 10.3.1.4 (10BASE2). These
- documents define jabber as the condition where any
- packet exceeds 20 ms. The allowed range to detect
- jabber is between 20 ms and 150 ms."
- ::= { etherHistoryEntry 13 }
-
- etherHistoryCollisions OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The best estimate of the total number of collisions
- on this Ethernet segment during this sampling
- interval.
-
- The value returned will depend on the location of
- the RMON probe. Section 8.2.1.3 (10BASE-5) and
- section 10.3.1.3 (10BASE-2) of IEEE standard 802.3
- states that a station must detect a collision, in
- the receive mode, if three or more stations are
- transmitting simultaneously. A repeater port must
- detect a collision when two or more stations are
- transmitting simultaneously. Thus a probe placed on
- a repeater port could record more collisions than a
- probe connected to a station on the same segment
- would.
-
- Probe location plays a much smaller role when
- considering 10BASE-T. 14.2.1.4 (10BASE-T) of IEEE
- standard 802.3 defines a collision as the
- simultaneous presence of signals on the DO and RD
- circuits (transmitting and receiving at the same
- time). A 10BASE-T station can only detect
- collisions when it is transmitting. Thus probes
-
-
- placed on a station and a repeater, should report
- the same number of collisions.
-
- Note also that an RMON probe inside a repeater
- should ideally report collisions between the
- repeater and one or more other hosts (transmit
- collisions as defined by IEEE 802.3k) plus receiver
- collisions observed on any coax segments to which
- the repeater is connected."
- ::= { etherHistoryEntry 14 }
-
- etherHistoryUtilization OBJECT-TYPE
- SYNTAX INTEGER (0..10000)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The best estimate of the mean physical layer
- network utilization on this interface during this
- sampling interval, in hundredths of a percent."
- ::= { etherHistoryEntry 15 }
-
-
- -- The Alarm Group
-
- -- Implementation of the Alarm group is optional.
- --
- -- The Alarm Group requires the implementation of the Event
- -- group.
- --
- -- The Alarm group periodically takes
- -- statistical samples from variables in the probe and
- -- compares them to thresholds that have been
- -- configured. The alarm table stores configuration
- -- entries that each define a variable, polling period,
- -- and threshold parameters. If a sample is found to
- -- cross the threshold values, an event is generated.
- -- Only variables that resolve to an ASN.1 primitive
- -- type of INTEGER (INTEGER, Counter, Gauge, or
- -- TimeTicks) may be monitored in this way.
- --
- -- This function has a hysteresis mechanism to limit
- -- the generation of events. This mechanism generates
- -- one event as a threshold is crossed in the
- -- appropriate direction. No more events are generated
- -- for that threshold until the opposite threshold is
- -- crossed.
- --
- -- In the case of a sampling a deltaValue, a probe may
-
-
- -- implement this mechanism with more precision if it
- -- takes a delta sample twice per period, each time
- -- comparing the sum of the latest two samples to the
- -- threshold. This allows the detection of threshold
- -- crossings that span the sampling boundary. Note
- -- that this does not require any special configuration
- -- of the threshold value. It is suggested that probes
- -- implement this more precise algorithm.
-
- alarmTable OBJECT-TYPE
- SYNTAX SEQUENCE OF AlarmEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of alarm entries."
- ::= { alarm 1 }
-
- alarmEntry OBJECT-TYPE
- SYNTAX AlarmEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of parameters that set up a periodic checking
- for alarm conditions. For example, an instance of the
- alarmValue object might be named alarmValue.8"
- INDEX { alarmIndex }
- ::= { alarmTable 1 }
-
- AlarmEntry ::= SEQUENCE {
- alarmIndex INTEGER (1..65535),
- alarmInterval INTEGER,
- alarmVariable OBJECT IDENTIFIER,
- alarmSampleType INTEGER,
- alarmValue INTEGER,
- alarmStartupAlarm INTEGER,
- alarmRisingThreshold INTEGER,
- alarmFallingThreshold INTEGER,
- alarmRisingEventIndex INTEGER (0..65535),
- alarmFallingEventIndex INTEGER (0..65535),
- alarmOwner OwnerString,
- alarmStatus EntryStatus
- }
-
- alarmIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
-
-
- "An index that uniquely identifies an entry in the
- alarm table. Each such entry defines a
- diagnostic sample at a particular interval
- for an object on the device."
- ::= { alarmEntry 1 }
-
- alarmInterval OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The interval in seconds over which the data is
- sampled and compared with the rising and falling
- thresholds. When setting this variable, care
- should be taken in the case of deltaValue
- sampling - the interval should be set short enough
- that the sampled variable is very unlikely to
- increase or decrease by more than 2^31 - 1 during
- a single sampling interval.
-
- This object may not be modified if the associated
- alarmStatus object is equal to valid(1)."
- ::= { alarmEntry 2 }
-
- alarmVariable OBJECT-TYPE
- SYNTAX OBJECT IDENTIFIER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The object identifier of the particular variable to
- be sampled. Only variables that resolve to an ASN.1
- primitive type of INTEGER (INTEGER, Counter, Gauge,
- or TimeTicks) may be sampled.
-
- Because SNMP access control is articulated entirely
- in terms of the contents of MIB views, no access
- control mechanism exists that can restrict the value
- of this object to identify only those objects that
- exist in a particular MIB view. Because there is
- thus no acceptable means of restricting the read
- access that could be obtained through the alarm
- mechanism, the probe must only grant write access to
- this object in those views that have read access to
- all objects on the probe.
-
- During a set operation, if the supplied variable
- name is not available in the selected MIB view, a
- badValue error must be returned. If at any time the
-
-
- variable name of an established alarmEntry is no
- longer available in the selected MIB view, the probe
- must change the status of this alarmEntry to
- invalid(4).
-
- This object may not be modified if the associated
- alarmStatus object is equal to valid(1)."
- ::= { alarmEntry 3 }
-
- alarmSampleType OBJECT-TYPE
- SYNTAX INTEGER {
- absoluteValue(1),
- deltaValue(2)
- }
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The method of sampling the selected variable and
- calculating the value to be compared against the
- thresholds. If the value of this object is
- absoluteValue(1), the value of the selected variable
- will be compared directly with the thresholds at the
- end of the sampling interval. If the value of this
- object is deltaValue(2), the value of the selected
- variable at the last sample will be subtracted from
- the current value, and the difference compared with
- the thresholds.
-
- This object may not be modified if the associated
- alarmStatus object is equal to valid(1)."
- ::= { alarmEntry 4 }
-
- alarmValue OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The value of the statistic during the last sampling
- period. For example, if the sample type is
- deltaValue, this value will be the difference
- between the samples at the beginning and end of the
- period. If the sample type is absoluteValue, this
- value will be the sampled value at the end of the
- period.
-
- This is the value that is compared with the rising and
- falling thresholds.
-
-
-
- The value during the current sampling period is not
- made available until the period is completed and will
- remain available until the next period completes."
- ::= { alarmEntry 5 }
-
- alarmStartupAlarm OBJECT-TYPE
- SYNTAX INTEGER {
- risingAlarm(1),
- fallingAlarm(2),
- risingOrFallingAlarm(3)
- }
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The alarm that may be sent when this entry is first
- set to valid. If the first sample after this entry
- becomes valid is greater than or equal to the
- risingThreshold and alarmStartupAlarm is equal to
- risingAlarm(1) or risingOrFallingAlarm(3), then a
- single rising alarm will be generated. If the first
- sample after this entry becomes valid is less than
- or equal to the fallingThreshold and
- alarmStartupAlarm is equal to fallingAlarm(2) or
- risingOrFallingAlarm(3), then a single falling alarm
- will be generated.
-
- This object may not be modified if the associated
- alarmStatus object is equal to valid(1)."
- ::= { alarmEntry 6 }
-
- alarmRisingThreshold OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "A threshold for the sampled statistic. When the
- current sampled value is greater than or equal to
- this threshold, and the value at the last sampling
- interval was less than this threshold, a single
- event will be generated. A single event will also
- be generated if the first sample after this entry
- becomes valid is greater than or equal to this
- threshold and the associated alarmStartupAlarm is
- equal to risingAlarm(1) or risingOrFallingAlarm(3).
-
- After a rising event is generated, another such event
- will not be generated until the sampled value
- falls below this threshold and reaches the
-
-
- alarmFallingThreshold.
-
- This object may not be modified if the associated
- alarmStatus object is equal to valid(1)."
- ::= { alarmEntry 7 }
-
- alarmFallingThreshold OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "A threshold for the sampled statistic. When the
- current sampled value is less than or equal to this
- threshold, and the value at the last sampling
- interval was greater than this threshold, a single
- event will be generated. A single event will also
- be generated if the first sample after this entry
- becomes valid is less than or equal to this
- threshold and the associated alarmStartupAlarm is
- equal to fallingAlarm(2) or risingOrFallingAlarm(3).
-
- After a falling event is generated, another such event
- will not be generated until the sampled value
- rises above this threshold and reaches the
- alarmRisingThreshold.
-
- This object may not be modified if the associated
- alarmStatus object is equal to valid(1)."
- ::= { alarmEntry 8 }
-
- alarmRisingEventIndex OBJECT-TYPE
- SYNTAX INTEGER (0..65535)
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The index of the eventEntry that is
- used when a rising threshold is crossed. The
- eventEntry identified by a particular value of
- this index is the same as identified by the same value
- of the eventIndex object. If there is no
- corresponding entry in the eventTable, then
- no association exists. In particular, if this value
- is zero, no associated event will be generated, as
- zero is not a valid event index.
-
- This object may not be modified if the associated
- alarmStatus object is equal to valid(1)."
- ::= { alarmEntry 9 }
-
-
- alarmFallingEventIndex OBJECT-TYPE
- SYNTAX INTEGER (0..65535)
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The index of the eventEntry that is
- used when a falling threshold is crossed. The
- eventEntry identified by a particular value of
- this index is the same as identified by the same value
- of the eventIndex object. If there is no
- corresponding entry in the eventTable, then
- no association exists. In particular, if this value
- is zero, no associated event will be generated, as
- zero is not a valid event index.
-
- This object may not be modified if the associated
- alarmStatus object is equal to valid(1)."
- ::= { alarmEntry 10 }
-
- alarmOwner OBJECT-TYPE
- SYNTAX OwnerString
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The entity that configured this entry and is
- therefore using the resources assigned to it."
- ::= { alarmEntry 11 }
-
- alarmStatus OBJECT-TYPE
- SYNTAX EntryStatus
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The status of this alarm entry."
- ::= { alarmEntry 12 }
-
-
- -- The Host Group
-
- -- Implementation of the Host group is optional.
- --
- -- The host group discovers new hosts on the network by
- -- keeping a list of source and destination MAC Addresses seen
- -- in good packets. For each of these addresses, the host
- -- group keeps a set of statistics. The hostControlTable
- -- controls which interfaces this function is performed on,
- -- and contains some information about the process. On
- -- behalf of each hostControlEntry, data is collected on an
-
-
- -- interface and placed in both the hostTable and the
- -- hostTimeTable. If the monitoring device finds itself
- -- short of resources, it may delete entries as needed. It
- -- is suggested that the device delete the least recently
- -- used entries first.
-
- -- The hostTable contains entries for each address
- -- discovered on a particular interface. Each entry
- -- contains statistical data about that host. This table is
- -- indexed by the MAC address of the host, through which a
- -- random access may be achieved.
-
- -- The hostTimeTable contains data in the same format as the
- -- hostTable, and must contain the same set of hosts, but is
- -- indexed using hostTimeCreationOrder rather than
- -- hostAddress.
- -- The hostTimeCreationOrder is an integer which reflects
- -- the relative order in which a particular entry was
- -- discovered and thus inserted into the table. As this
- -- order, and thus the index, is among those entries
- -- currently in the table, the index for a particular entry
- -- may change if an (earlier) entry is deleted. Thus the
- -- association between hostTimeCreationOrder and
- -- hostTimeEntry may be broken at any time.
-
- -- The hostTimeTable has two important uses. The first is the
- -- fast download of this potentially large table. Because the
- -- index of this table runs from 1 to the size of the table,
- -- inclusive, its values are predictable. This allows very
- -- efficient packing of variables into SNMP PDU's and allows
- -- a table transfer to have multiple packets outstanding.
- -- These benefits increase transfer rates tremendously.
-
- -- The second use of the hostTimeTable is the efficient
- -- discovery by the management station of new entries added
- -- to the table. After the management station has downloaded
- -- the entire table, it knows that new entries will be added
- -- immediately after the end of the current table. It can
- -- thus detect new entries there and retrieve them easily.
-
- -- Because the association between hostTimeCreationOrder and
- -- hostTimeEntry may be broken at any time, the management
- -- station must monitor the related hostControlLastDeleteTime
- -- object. When the management station thus detects a
- -- deletion, it must assume that any such associations have
- --- been broken, and invalidate any it has stored locally.
- -- This includes restarting any download of the
- -- hostTimeTable that may have been in progress, as well as
-
-
- -- rediscovering the end of the hostTimeTable so that it may
- -- detect new entries. If the management station does not
- -- detect the broken association, it may continue to refer
- -- to a particular host by its creationOrder while
- -- unwittingly retrieving the data associated with another
- -- host entirely. If this happens while downloading the
- -- host table, the management station may fail to download
- -- all of the entries in the table.
-
- hostControlTable OBJECT-TYPE
- SYNTAX SEQUENCE OF HostControlEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of host table control entries."
- ::= { hosts 1 }
-
- hostControlEntry OBJECT-TYPE
- SYNTAX HostControlEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of parameters that set up the discovery of
- hosts on a particular interface and the collection
- of statistics about these hosts. For example, an
- instance of the hostControlTableSize object might be
- named hostControlTableSize.1"
- INDEX { hostControlIndex }
- ::= { hostControlTable 1 }
-
- HostControlEntry ::= SEQUENCE {
- hostControlIndex INTEGER (1..65535),
- hostControlDataSource OBJECT IDENTIFIER,
- hostControlTableSize INTEGER,
- hostControlLastDeleteTime TimeTicks,
- hostControlOwner OwnerString,
- hostControlStatus EntryStatus
- }
-
- hostControlIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "An index that uniquely identifies an entry in the
- hostControl table. Each such entry defines
- a function that discovers hosts on a particular
- interface and places statistics about them in the
-
-
- hostTable and the hostTimeTable on behalf of this
- hostControlEntry."
- ::= { hostControlEntry 1 }
-
- hostControlDataSource OBJECT-TYPE
- SYNTAX OBJECT IDENTIFIER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "This object identifies the source of the data for
- this instance of the host function. This source
- can be any interface on this device. In order
- to identify a particular interface, this object shall
- identify the instance of the ifIndex object, defined
- in RFC 1213 and RFC 1573 [4,6], for the desired
- interface. For example, if an entry were to receive
- data from interface #1, this object would be set to
- ifIndex.1.
-
- The statistics in this group reflect all packets
- on the local network segment attached to the
- identified interface.
-
- An agent may or may not be able to tell if
- fundamental changes to the media of the interface
- have occurred and necessitate an invalidation of
- this entry. For example, a hot-pluggable ethernet
- card could be pulled out and replaced by a
- token-ring card. In such a case, if the agent has
- such knowledge of the change, it is recommended that
- it invalidate this entry.
-
- This object may not be modified if the associated
- hostControlStatus object is equal to valid(1)."
- ::= { hostControlEntry 2 }
-
- hostControlTableSize OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of hostEntries in the hostTable and the
- hostTimeTable associated with this hostControlEntry."
- ::= { hostControlEntry 3 }
-
- hostControlLastDeleteTime OBJECT-TYPE
- SYNTAX TimeTicks
- ACCESS read-only
-
-
- STATUS mandatory
- DESCRIPTION
- "The value of sysUpTime when the last entry
- was deleted from the portion of the hostTable
- associated with this hostControlEntry. If no
- deletions have occurred, this value shall be zero."
- ::= { hostControlEntry 4 }
-
- hostControlOwner OBJECT-TYPE
- SYNTAX OwnerString
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The entity that configured this entry and is
- therefore using the resources assigned to it."
- ::= { hostControlEntry 5 }
-
- hostControlStatus OBJECT-TYPE
- SYNTAX EntryStatus
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The status of this hostControl entry.
-
- If this object is not equal to valid(1), all
- associated entries in the hostTable, hostTimeTable,
- and the hostTopNTable shall be deleted by the
- agent."
- ::= { hostControlEntry 6 }
-
- hostTable OBJECT-TYPE
- SYNTAX SEQUENCE OF HostEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of host entries."
- ::= { hosts 2 }
-
- hostEntry OBJECT-TYPE
- SYNTAX HostEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A collection of statistics for a particular host
- that has been discovered on an interface of this
- device. For example, an instance of the
- hostOutBroadcastPkts object might be named
- hostOutBroadcastPkts.1.6.8.0.32.27.3.176"
-
-
- INDEX { hostIndex, hostAddress }
- ::= { hostTable 1 }
-
- HostEntry ::= SEQUENCE {
- hostAddress OCTET STRING,
- hostCreationOrder INTEGER (1..65535),
- hostIndex INTEGER (1..65535),
- hostInPkts Counter,
- hostOutPkts Counter,
- hostInOctets Counter,
- hostOutOctets Counter,
- hostOutErrors Counter,
- hostOutBroadcastPkts Counter,
- hostOutMulticastPkts Counter
- }
-
- hostAddress OBJECT-TYPE
- SYNTAX OCTET STRING
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The physical address of this host."
- ::= { hostEntry 1 }
-
- hostCreationOrder OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "An index that defines the relative ordering of
- the creation time of hosts captured for a
- particular hostControlEntry. This index shall
- be between 1 and N, where N is the value of
- the associated hostControlTableSize. The ordering
- of the indexes is based on the order of each entry's
- insertion into the table, in which entries added
- earlier have a lower index value than entries added
- later.
-
- It is important to note that the order for a
- particular entry may change as an (earlier) entry
- is deleted from the table. Because this order may
- change, management stations should make use of the
- hostControlLastDeleteTime variable in the
- hostControlEntry associated with the relevant
- portion of the hostTable. By observing
- this variable, the management station may detect
- the circumstances where a previous association
-
-
- between a value of hostCreationOrder
- and a hostEntry may no longer hold."
- ::= { hostEntry 2 }
-
- hostIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The set of collected host statistics of which
- this entry is a part. The set of hosts
- identified by a particular value of this
- index is associated with the hostControlEntry
- as identified by the same value of hostControlIndex."
- ::= { hostEntry 3 }
-
- hostInPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of good packets transmitted to this
- address since it was added to the hostTable."
- ::= { hostEntry 4 }
-
- hostOutPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of packets, including bad packets,
- transmitted by this address since it was added
- to the hostTable."
- ::= { hostEntry 5 }
-
- hostInOctets OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of octets transmitted to this address
- since it was added to the hostTable (excluding
- framing bits but including FCS octets), except for
- those octets in bad packets."
- ::= { hostEntry 6 }
-
- hostOutOctets OBJECT-TYPE
- SYNTAX Counter
-
-
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of octets transmitted by this address
- since it was added to the hostTable (excluding
- framing bits but including FCS octets), including
- those octets in bad packets."
- ::= { hostEntry 7 }
-
- hostOutErrors OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of bad packets transmitted by this address
- since this host was added to the hostTable."
- ::= { hostEntry 8 }
-
- hostOutBroadcastPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of good packets transmitted by this
- address that were directed to the broadcast address
- since this host was added to the hostTable."
- ::= { hostEntry 9 }
-
- hostOutMulticastPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of good packets transmitted by this
- address that were directed to a multicast address
- since this host was added to the hostTable.
- Note that this number does not include packets
- directed to the broadcast address."
- ::= { hostEntry 10 }
-
- -- host Time Table
-
- hostTimeTable OBJECT-TYPE
- SYNTAX SEQUENCE OF HostTimeEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of time-ordered host table entries."
-
-
- ::= { hosts 3 }
-
- hostTimeEntry OBJECT-TYPE
- SYNTAX HostTimeEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A collection of statistics for a particular host
- that has been discovered on an interface of this
- device. This collection includes the relative
- ordering of the creation time of this object. For
- example, an instance of the hostTimeOutBroadcastPkts
- object might be named
- hostTimeOutBroadcastPkts.1.687"
- INDEX { hostTimeIndex, hostTimeCreationOrder }
- ::= { hostTimeTable 1 }
-
- HostTimeEntry ::= SEQUENCE {
- hostTimeAddress OCTET STRING,
- hostTimeCreationOrder INTEGER (1..65535),
- hostTimeIndex INTEGER (1..65535),
- hostTimeInPkts Counter,
- hostTimeOutPkts Counter,
- hostTimeInOctets Counter,
- hostTimeOutOctets Counter,
- hostTimeOutErrors Counter,
- hostTimeOutBroadcastPkts Counter,
- hostTimeOutMulticastPkts Counter
- }
-
- hostTimeAddress OBJECT-TYPE
- SYNTAX OCTET STRING
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The physical address of this host."
- ::= { hostTimeEntry 1 }
-
- hostTimeCreationOrder OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "An index that uniquely identifies an entry in
- the hostTime table among those entries associated
- with the same hostControlEntry. This index shall
- be between 1 and N, where N is the value of
- the associated hostControlTableSize. The ordering
-
-
- of the indexes is based on the order of each entry's
- insertion into the table, in which entries added
- earlier have a lower index value than entries added
- later. Thus the management station has the ability to
- learn of new entries added to this table without
- downloading the entire table.
-
- It is important to note that the index for a
- particular entry may change as an (earlier) entry
- is deleted from the table. Because this order may
- change, management stations should make use of the
- hostControlLastDeleteTime variable in the
- hostControlEntry associated with the relevant
- portion of the hostTimeTable. By observing
- this variable, the management station may detect
- the circumstances where a download of the table
- may have missed entries, and where a previous
- association between a value of hostTimeCreationOrder
- and a hostTimeEntry may no longer hold."
- ::= { hostTimeEntry 2 }
-
- hostTimeIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The set of collected host statistics of which
- this entry is a part. The set of hosts
- identified by a particular value of this
- index is associated with the hostControlEntry
- as identified by the same value of hostControlIndex."
- ::= { hostTimeEntry 3 }
-
- hostTimeInPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of good packets transmitted to this
- address since it was added to the hostTimeTable."
- ::= { hostTimeEntry 4 }
-
- hostTimeOutPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of god packets transmitted by this
-
-
- address since it was added to the hostTimeTable."
- ::= { hostTimeEntry 5 }
-
- hostTimeInOctets OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of octets transmitted to this address
- since it was added to the hostTimeTable (excluding
- framing bits but including FCS octets), except for
- those octets in bad packets."
- ::= { hostTimeEntry 6 }
-
- hostTimeOutOctets OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of octets transmitted by this address
- since it was added to the hostTimeTable (excluding
- framing bits but including FCS octets), including
- those octets in bad packets."
- ::= { hostTimeEntry 7 }
-
- hostTimeOutErrors OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of bad packets transmitted by this address
- since this host was added to the hostTimeTable."
- ::= { hostTimeEntry 8 }
-
- hostTimeOutBroadcastPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of good packets transmitted by this
- address that were directed to the broadcast address
- since this host was added to the hostTimeTable."
- ::= { hostTimeEntry 9 }
-
- hostTimeOutMulticastPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
-
-
- DESCRIPTION
- "The number of good packets transmitted by this
- address that were directed to a multicast address
- since this host was added to the hostTimeTable.
- Note that this number does not include packets
- directed to the broadcast address."
- ::= { hostTimeEntry 10 }
-
-
- -- The Host Top "N" Group
-
- -- Implementation of the Host Top N group is optional.
- --
- -- The Host Top N group requires the implementation of the
- -- host group.
- --
- -- The Host Top N group is used to prepare reports that
- -- describe the hosts that top a list ordered by one of
- -- their statistics.
- -- The available statistics are samples of one of their
- -- base statistics, over an interval specified by the
- -- management station. Thus, these statistics are rate
- -- based. The management station also selects how many such
- -- hosts are reported.
-
- -- The hostTopNControlTable is used to initiate the
- -- generation of such a report. The management station
- -- may select the parameters of such a report, such as
- -- which interface, which statistic, how many hosts,
- -- and the start and stop times of the sampling. When
- -- the report is prepared, entries are created in the
- -- hostTopNTable associated with the relevant
- -- hostTopNControlEntry. These entries are static for
- -- each report after it has been prepared.
-
- hostTopNControlTable OBJECT-TYPE
- SYNTAX SEQUENCE OF HostTopNControlEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of top N host control entries."
- ::= { hostTopN 1 }
-
- hostTopNControlEntry OBJECT-TYPE
- SYNTAX HostTopNControlEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
-
-
- "A set of parameters that control the creation of a
- report of the top N hosts according to several
- metrics. For example, an instance of the
- hostTopNDuration object might be named
- hostTopNDuration.3"
- INDEX { hostTopNControlIndex }
- ::= { hostTopNControlTable 1 }
-
- HostTopNControlEntry ::= SEQUENCE {
- hostTopNControlIndex INTEGER (1..65535),
- hostTopNHostIndex INTEGER (1..65535),
- hostTopNRateBase INTEGER,
- hostTopNTimeRemaining INTEGER,
- hostTopNDuration INTEGER,
- hostTopNRequestedSize INTEGER,
- hostTopNGrantedSize INTEGER,
- hostTopNStartTime TimeTicks,
- hostTopNOwner OwnerString,
- hostTopNStatus EntryStatus
- }
-
- hostTopNControlIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "An index that uniquely identifies an entry
- in the hostTopNControl table. Each such
- entry defines one top N report prepared for
- one interface."
- ::= { hostTopNControlEntry 1 }
-
- hostTopNHostIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The host table for which a top N report will be
- prepared on behalf of this entry. The host table
- identified by a particular value of this index is
- associated with the same host table as identified by
- the same value of hostIndex.
-
- This object may not be modified if the associated
- hostTopNStatus object is equal to valid(1)."
- ::= { hostTopNControlEntry 2 }
-
- hostTopNRateBase OBJECT-TYPE
-
-
- SYNTAX INTEGER {
- hostTopNInPkts(1),
- hostTopNOutPkts(2),
- hostTopNInOctets(3),
- hostTopNOutOctets(4),
- hostTopNOutErrors(5),
- hostTopNOutBroadcastPkts(6),
- hostTopNOutMulticastPkts(7)
- }
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The variable for each host that the hostTopNRate
- variable is based upon.
-
- This object may not be modified if the associated
- hostTopNStatus object is equal to valid(1)."
- ::= { hostTopNControlEntry 3 }
-
- hostTopNTimeRemaining OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The number of seconds left in the report currently
- being collected. When this object is modified by
- the management station, a new collection is started,
- possibly aborting a currently running report. The
- new value is used as the requested duration of this
- report, which is loaded into the associated
- hostTopNDuration object.
-
- When this object is set to a non-zero value, any
- associated hostTopNEntries shall be made
- inaccessible by the monitor. While the value of
- this object is non-zero, it decrements by one per
- second until it reaches zero. During this time, all
- associated hostTopNEntries shall remain
- inaccessible. At the time that this object
- decrements to zero, the report is made accessible in
- the hostTopNTable. Thus, the hostTopN table needs
- to be created only at the end of the collection
- interval."
- DEFVAL { 0 }
- ::= { hostTopNControlEntry 4 }
-
- hostTopNDuration OBJECT-TYPE
- SYNTAX INTEGER
-
-
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of seconds that this report has collected
- during the last sampling interval, or if this
- report is currently being collected, the number
- of seconds that this report is being collected
- during this sampling interval.
-
- When the associated hostTopNTimeRemaining object is
- set, this object shall be set by the probe to the
- same value and shall not be modified until the next
- time the hostTopNTimeRemaining is set.
-
- This value shall be zero if no reports have been
- requested for this hostTopNControlEntry."
- DEFVAL { 0 }
- ::= { hostTopNControlEntry 5 }
-
- hostTopNRequestedSize OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The maximum number of hosts requested for the top N
- table.
-
- When this object is created or modified, the probe
- should set hostTopNGrantedSize as closely to this
- object as is possible for the particular probe
- implementation and available resources."
- DEFVAL { 10 }
- ::= { hostTopNControlEntry 6 }
-
- hostTopNGrantedSize OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The maximum number of hosts in the top N table.
-
- When the associated hostTopNRequestedSize object is
- created or modified, the probe should set this
- object as closely to the requested value as is
- possible for the particular implementation and
- available resources. The probe must not lower this
- value except as a result of a set to the associated
- hostTopNRequestedSize object.
-
-
- Hosts with the highest value of hostTopNRate shall be
- placed in this table in decreasing order of this rate
- until there is no more room or until there are no more
- hosts."
- ::= { hostTopNControlEntry 7 }
-
- hostTopNStartTime OBJECT-TYPE
- SYNTAX TimeTicks
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The value of sysUpTime when this top N report was
- last started. In other words, this is the time that
- the associated hostTopNTimeRemaining object was
- modified to start the requested report."
- ::= { hostTopNControlEntry 8 }
-
- hostTopNOwner OBJECT-TYPE
- SYNTAX OwnerString
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The entity that configured this entry and is
- therefore using the resources assigned to it."
- ::= { hostTopNControlEntry 9 }
-
- hostTopNStatus OBJECT-TYPE
- SYNTAX EntryStatus
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The status of this hostTopNControl entry.
-
- If this object is not equal to valid(1), all
- associated hostTopNEntries shall be deleted by the
- agent."
- ::= { hostTopNControlEntry 10 }
-
- hostTopNTable OBJECT-TYPE
- SYNTAX SEQUENCE OF HostTopNEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of top N host entries."
- ::= { hostTopN 2 }
-
- hostTopNEntry OBJECT-TYPE
- SYNTAX HostTopNEntry
-
-
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A set of statistics for a host that is part of a
- top N report. For example, an instance of the
- hostTopNRate object might be named
- hostTopNRate.3.10"
- INDEX { hostTopNReport, hostTopNIndex }
- ::= { hostTopNTable 1 }
-
- HostTopNEntry ::= SEQUENCE {
- hostTopNReport INTEGER (1..65535),
- hostTopNIndex INTEGER (1..65535),
- hostTopNAddress OCTET STRING,
- hostTopNRate INTEGER
- }
-
- hostTopNReport OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "This object identifies the top N report of which
- this entry is a part. The set of hosts
- identified by a particular value of this
- object is part of the same report as identified
- by the same value of the hostTopNControlIndex object."
- ::= { hostTopNEntry 1 }
-
- hostTopNIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "An index that uniquely identifies an entry in
- the hostTopN table among those in the same report.
- This index is between 1 and N, where N is the
- number of entries in this table. Increasing values
- of hostTopNIndex shall be assigned to entries with
- decreasing values of hostTopNRate until index N
- is assigned to the entry with the lowest value of
- hostTopNRate or there are no more hostTopNEntries."
- ::= { hostTopNEntry 2 }
-
- hostTopNAddress OBJECT-TYPE
- SYNTAX OCTET STRING
- ACCESS read-only
- STATUS mandatory
-
-
- DESCRIPTION
- "The physical address of this host."
- ::= { hostTopNEntry 3 }
-
- hostTopNRate OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The amount of change in the selected variable
- during this sampling interval. The selected
- variable is this host's instance of the object
- selected by hostTopNRateBase."
- ::= { hostTopNEntry 4 }
-
-
- -- The Matrix Group
-
- -- Implementation of the Matrix group is optional.
- --
- -- The Matrix group consists of the matrixControlTable,
- -- matrixSDTable and the matrixDSTable. These tables
- -- store statistics for a particular conversation
- -- between two addresses. As the device detects a new
- -- conversation, including those to a non-unicast
- -- address, it creates a new entry in both of the
- -- matrix tables. It must only create new entries
- -- based on information received in good packets. If
- -- the monitoring device finds itself short of
- -- resources, it may delete entries as needed. It is
- -- suggested that the device delete the least recently
- -- used entries first.
-
- matrixControlTable OBJECT-TYPE
- SYNTAX SEQUENCE OF MatrixControlEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of information entries for the
- traffic matrix on each interface."
- ::= { matrix 1 }
-
- matrixControlEntry OBJECT-TYPE
- SYNTAX MatrixControlEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "Information about a traffic matrix on a particular
-
-
- interface. For example, an instance of the
- matrixControlLastDeleteTime object might be named
- matrixControlLastDeleteTime.1"
- INDEX { matrixControlIndex }
- ::= { matrixControlTable 1 }
-
- MatrixControlEntry ::= SEQUENCE {
- matrixControlIndex INTEGER (1..65535),
- matrixControlDataSource OBJECT IDENTIFIER,
- matrixControlTableSize INTEGER,
- matrixControlLastDeleteTime TimeTicks,
- matrixControlOwner OwnerString,
- matrixControlStatus EntryStatus
- }
-
- matrixControlIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "An index that uniquely identifies an entry in the
- matrixControl table. Each such entry defines
- a function that discovers conversations on a
- particular interface and places statistics about
- them in the matrixSDTable and the matrixDSTable on
- behalf of this matrixControlEntry."
- ::= { matrixControlEntry 1 }
-
- matrixControlDataSource OBJECT-TYPE
- SYNTAX OBJECT IDENTIFIER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "This object identifies the source of
- the data from which this entry creates a traffic
- matrix. This source can be any interface on this
- device. In order to identify a particular
- interface, this object shall identify the instance
- of the ifIndex object, defined in RFC 1213 and RFC
- 1573 [4,6], for the desired interface. For example,
- if an entry were to receive data from interface #1,
- this object would be set to ifIndex.1.
-
- The statistics in this group reflect all packets
- on the local network segment attached to the
- identified interface.
-
- An agent may or may not be able to tell if
-
-
- fundamental changes to the media of the interface
- have occurred and necessitate an invalidation of
- this entry. For example, a hot-pluggable ethernet
- card could be pulled out and replaced by a
- token-ring card. In such a case, if the agent has
- such knowledge of the change, it is recommended that
- it invalidate this entry.
-
- This object may not be modified if the associated
- matrixControlStatus object is equal to valid(1)."
- ::= { matrixControlEntry 2 }
-
- matrixControlTableSize OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of matrixSDEntries in the matrixSDTable
- for this interface. This must also be the value of
- the number of entries in the matrixDSTable for this
- interface."
- ::= { matrixControlEntry 3 }
-
- matrixControlLastDeleteTime OBJECT-TYPE
- SYNTAX TimeTicks
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The value of sysUpTime when the last entry
- was deleted from the portion of the matrixSDTable
- or matrixDSTable associated with this
- matrixControlEntry. If no deletions have occurred,
- this value shall be zero."
- ::= { matrixControlEntry 4 }
-
- matrixControlOwner OBJECT-TYPE
- SYNTAX OwnerString
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The entity that configured this entry and is
- therefore using the resources assigned to it."
- ::= { matrixControlEntry 5 }
-
- matrixControlStatus OBJECT-TYPE
- SYNTAX EntryStatus
- ACCESS read-write
- STATUS mandatory
-
-
- DESCRIPTION
- "The status of this matrixControl entry.
-
- If this object is not equal to valid(1), all
- associated entries in the matrixSDTable and the
- matrixDSTable shall be deleted by the agent."
- ::= { matrixControlEntry 6 }
-
- matrixSDTable OBJECT-TYPE
- SYNTAX SEQUENCE OF MatrixSDEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of traffic matrix entries indexed by
- source and destination MAC address."
- ::= { matrix 2 }
-
- matrixSDEntry OBJECT-TYPE
- SYNTAX MatrixSDEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A collection of statistics for communications between
- two addresses on a particular interface. For example,
- an instance of the matrixSDPkts object might be named
- matrixSDPkts.1.6.8.0.32.27.3.176.6.8.0.32.10.8.113"
- INDEX { matrixSDIndex,
- matrixSDSourceAddress, matrixSDDestAddress }
- ::= { matrixSDTable 1 }
-
- MatrixSDEntry ::= SEQUENCE {
- matrixSDSourceAddress OCTET STRING,
- matrixSDDestAddress OCTET STRING,
- matrixSDIndex INTEGER (1..65535),
- matrixSDPkts Counter,
- matrixSDOctets Counter,
- matrixSDErrors Counter
- }
-
- matrixSDSourceAddress OBJECT-TYPE
- SYNTAX OCTET STRING
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The source physical address."
- ::= { matrixSDEntry 1 }
-
- matrixSDDestAddress OBJECT-TYPE
-
-
- SYNTAX OCTET STRING
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The destination physical address."
- ::= { matrixSDEntry 2 }
-
- matrixSDIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The set of collected matrix statistics of which
- this entry is a part. The set of matrix statistics
- identified by a particular value of this index
- is associated with the same matrixControlEntry
- as identified by the same value of
- matrixControlIndex."
- ::= { matrixSDEntry 3 }
-
- matrixSDPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of packets transmitted from the source
- address to the destination address (this number
- includes bad packets)."
- ::= { matrixSDEntry 4 }
-
- matrixSDOctets OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of octets (excluding framing bits but
- including FCS octets) contained in all packets
- transmitted from the source address to the
- destination address."
- ::= { matrixSDEntry 5 }
-
- matrixSDErrors OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of bad packets transmitted from
- the source address to the destination address."
-
-
- ::= { matrixSDEntry 6 }
-
-
- -- Traffic matrix tables from destination to source
-
- matrixDSTable OBJECT-TYPE
- SYNTAX SEQUENCE OF MatrixDSEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of traffic matrix entries indexed by
- destination and source MAC address."
- ::= { matrix 3 }
-
- matrixDSEntry OBJECT-TYPE
- SYNTAX MatrixDSEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A collection of statistics for communications between
- two addresses on a particular interface. For example,
- an instance of the matrixSDPkts object might be named
- matrixSDPkts.1.6.8.0.32.10.8.113.6.8.0.32.27.3.176"
- INDEX { matrixDSIndex,
- matrixDSDestAddress, matrixDSSourceAddress }
- ::= { matrixDSTable 1 }
-
- MatrixDSEntry ::= SEQUENCE {
- matrixDSSourceAddress OCTET STRING,
- matrixDSDestAddress OCTET STRING,
- matrixDSIndex INTEGER (1..65535),
- matrixDSPkts Counter,
- matrixDSOctets Counter,
- matrixDSErrors Counter
- }
-
- matrixDSSourceAddress OBJECT-TYPE
- SYNTAX OCTET STRING
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The source physical address."
- ::= { matrixDSEntry 1 }
-
- matrixDSDestAddress OBJECT-TYPE
- SYNTAX OCTET STRING
- ACCESS read-only
- STATUS mandatory
-
-
- DESCRIPTION
- "The destination physical address."
- ::= { matrixDSEntry 2 }
-
- matrixDSIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The set of collected matrix statistics of which
- this entry is a part. The set of matrix statistics
- identified by a particular value of this index
- is associated with the same matrixControlEntry
- as identified by the same value of
- matrixControlIndex."
- ::= { matrixDSEntry 3 }
-
- matrixDSPkts OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of packets transmitted from the source
- address to the destination address (this number
- includes bad packets)."
- ::= { matrixDSEntry 4 }
-
- matrixDSOctets OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of octets (excluding framing bits
- but including FCS octets) contained in all packets
- transmitted from the source address to the
- destination address."
- ::= { matrixDSEntry 5 }
-
- matrixDSErrors OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of bad packets transmitted from
- the source address to the destination address."
- ::= { matrixDSEntry 6 }
-
-
-
-
- -- The Filter Group
-
- -- Implementation of the Filter group is optional.
- --
- -- The Filter group allows packets to be captured with an
- -- arbitrary filter expression. A logical data and
- -- event stream or "channel" is formed by the packets
- -- that match the filter expression.
- --
- -- This filter mechanism allows the creation of an arbitrary
- -- logical expression with which to filter packets. Each
- -- filter associated with a channel is OR'ed with the others.
- -- Within a filter, any bits checked in the data and status
- -- are AND'ed with respect to other bits in the same filter.
- -- The NotMask also allows for checking for inequality.
- -- Finally, the channelAcceptType object allows for
- -- inversion of the whole equation.
- --
- -- If a management station wishes to receive a trap to alert
- -- it that new packets have been captured and are available
- -- for download, it is recommended that it set up an alarm
- -- entry that monitors the value of the relevant
- -- channelMatches instance.
- --
- -- The channel can be turned on or off, and can also
- -- generate events when packets pass through it.
-
- filterTable OBJECT-TYPE
- SYNTAX SEQUENCE OF FilterEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of packet filter entries."
- ::= { filter 1 }
-
- filterEntry OBJECT-TYPE
- SYNTAX FilterEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A set of parameters for a packet filter applied on a
- particular interface. As an example, an instance of
- the filterPktData object might be named
- filterPktData.12"
- INDEX { filterIndex }
- ::= { filterTable 1 }
-
-
-
-
- FilterEntry ::= SEQUENCE {
- filterIndex INTEGER (1..65535),
- filterChannelIndex INTEGER (1..65535),
- filterPktDataOffset INTEGER,
- filterPktData OCTET STRING,
- filterPktDataMask OCTET STRING,
- filterPktDataNotMask OCTET STRING,
- filterPktStatus INTEGER,
- filterPktStatusMask INTEGER,
- filterPktStatusNotMask INTEGER,
- filterOwner OwnerString,
- filterStatus EntryStatus
- }
-
- filterIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "An index that uniquely identifies an entry
- in the filter table. Each such entry defines
- one filter that is to be applied to every packet
- received on an interface."
- ::= { filterEntry 1 }
-
- filterChannelIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "This object identifies the channel of which this
- filter is a part. The filters identified by a
- particular value of this object are associated with
- the same channel as identified by the same value of
- the channelIndex object."
- ::= { filterEntry 2 }
-
- filterPktDataOffset OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The offset from the beginning of each packet where
- a match of packet data will be attempted. This offset
- is measured from the point in the physical layer
- packet after the framing bits, if any. For example,
- in an Ethernet frame, this point is at the beginning
- of the destination MAC address.
-
-
- This object may not be modified if the associated
- filterStatus object is equal to valid(1)."
- DEFVAL { 0 }
- ::= { filterEntry 3 }
-
- filterPktData OBJECT-TYPE
- SYNTAX OCTET STRING
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The data that is to be matched with the input
- packet. For each packet received, this filter and
- the accompanying filterPktDataMask and
- filterPktDataNotMask will be adjusted for the
- offset. The only bits relevant to this match
- algorithm are those that have the corresponding
- filterPktDataMask bit equal to one. The following
- three rules are then applied to every packet:
-
- (1) If the packet is too short and does not have data
- corresponding to part of the filterPktData, the
- packet will fail this data match.
-
- (2) For each relevant bit from the packet with the
- corresponding filterPktDataNotMask bit set to
- zero, if the bit from the packet is not equal to
- the corresponding bit from the filterPktData,
- then the packet will fail this data match.
-
- (3) If for every relevant bit from the packet with the
- corresponding filterPktDataNotMask bit set to one,
- the bit from the packet is equal to the
- corresponding bit from the filterPktData, then
- the packet will fail this data match.
-
- Any packets that have not failed any of the three
- matches above have passed this data match. In
- particular, a zero length filter will match any
- packet.
-
- This object may not be modified if the associated
- filterStatus object is equal to valid(1)."
- ::= { filterEntry 4 }
-
- filterPktDataMask OBJECT-TYPE
- SYNTAX OCTET STRING
- ACCESS read-write
- STATUS mandatory
-
-
- DESCRIPTION
- "The mask that is applied to the match process.
- After adjusting this mask for the offset, only those
- bits in the received packet that correspond to bits
- set in this mask are relevant for further processing
- by the match algorithm. The offset is applied to
- filterPktDataMask in the same way it is applied to the
- filter. For the purposes of the matching algorithm,
- if the associated filterPktData object is longer
- than this mask, this mask is conceptually extended
- with '1' bits until it reaches the length of the
- filterPktData object.
-
- This object may not be modified if the associated
- filterStatus object is equal to valid(1)."
- ::= { filterEntry 5 }
-
- filterPktDataNotMask OBJECT-TYPE
- SYNTAX OCTET STRING
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The inversion mask that is applied to the match
- process. After adjusting this mask for the offset,
- those relevant bits in the received packet that
- correspond to bits cleared in this mask must all be
- equal to their corresponding bits in the
- filterPktData object for the packet to be accepted.
- In addition, at least one of those relevant bits in
- the received packet that correspond to bits set in
- this mask must be different to its corresponding bit
- in the filterPktData object.
-
- For the purposes of the matching algorithm, if the
- associated filterPktData object is longer than this
- mask, this mask is conceptually extended with '0'
- bits until it reaches the length of the
- filterPktData object.
-
- This object may not be modified if the associated
- filterStatus object is equal to valid(1)."
- ::= { filterEntry 6 }
-
- filterPktStatus OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
-
-
- "The status that is to be matched with the input
- packet. The only bits relevant to this match
- algorithm are those that have the corresponding
- filterPktStatusMask bit equal to one. The following
- two rules are then applied to every packet:
-
- (1) For each relevant bit from the packet status
- with the corresponding filterPktStatusNotMask bit
- set to zero, if the bit from the packet status is
- not equal to the corresponding bit from the
- filterPktStatus, then the packet will fail this
- status match.
-
- (2) If for every relevant bit from the packet status
- with the corresponding filterPktStatusNotMask bit
- set to one, the bit from the packet status is
- equal to the corresponding bit from the
- filterPktStatus, then the packet will fail this
- status match.
-
- Any packets that have not failed either of the two
- matches above have passed this status match. In
- particular, a zero length status filter will match any
- packet's status.
-
- The value of the packet status is a sum. This sum
- initially takes the value zero. Then, for each
- error, E, that has been discovered in this packet,
- 2 raised to a value representing E is added to the
- sum. The errors and the bits that represent them are
- dependent on the media type of the interface that
- this channel is receiving packets from.
-
- The errors defined for a packet captured off of an
- Ethernet interface are as follows:
-
- bit # Error
- 0 Packet is longer than 1518 octets
- 1 Packet is shorter than 64 octets
- 2 Packet experienced a CRC or Alignment
- error
-
- For example, an Ethernet fragment would have a
- value of 6 (2^1 + 2^2).
-
- As this MIB is expanded to new media types, this
- object will have other media-specific errors
- defined.
-
-
- For the purposes of this status matching algorithm,
- if the packet status is longer than this
- filterPktStatus object, this object is conceptually
- extended with '0' bits until it reaches the size of
- the packet status.
-
- This object may not be modified if the associated
- filterStatus object is equal to valid(1)."
- ::= { filterEntry 7 }
-
- filterPktStatusMask OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The mask that is applied to the status match
- process. Only those bits in the received packet
- that correspond to bits set in this mask are
- relevant for further processing by the status match
- algorithm. For the purposes of the matching
- algorithm, if the associated filterPktStatus object
- is longer than this mask, this mask is conceptually
- extended with '1' bits until it reaches the size of
- the filterPktStatus. In addition, if a packet
- status is longer than this mask, this mask is
- conceptually extended with '0' bits until it reaches
- the size of the packet status.
-
- This object may not be modified if the associated
- filterStatus object is equal to valid(1)."
- ::= { filterEntry 8 }
-
- filterPktStatusNotMask OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The inversion mask that is applied to the status
- match process. Those relevant bits in the received
- packet status that correspond to bits cleared in
- this mask must all be equal to their corresponding
- bits in the filterPktStatus object for the packet to
- be accepted. In addition, at least one of those
- relevant bits in the received packet status that
- correspond to bits set in this mask must be
- different to its corresponding bit in the
- filterPktStatus object for the packet to be
- accepted.
-
-
- For the purposes of the matching algorithm, if the
- associated filterPktStatus object or a packet status
- is longer than this mask, this mask is conceptually
- extended with '0' bits until it reaches the longer
- of the lengths of the filterPktStatus object and the
- packet status.
-
- This object may not be modified if the associated
- filterStatus object is equal to valid(1)."
- ::= { filterEntry 9 }
-
- filterOwner OBJECT-TYPE
- SYNTAX OwnerString
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The entity that configured this entry and is
- therefore using the resources assigned to it."
- ::= { filterEntry 10 }
-
- filterStatus OBJECT-TYPE
- SYNTAX EntryStatus
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The status of this filter entry."
- ::= { filterEntry 11 }
-
- channelTable OBJECT-TYPE
- SYNTAX SEQUENCE OF ChannelEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of packet channel entries."
- ::= { filter 2 }
-
- channelEntry OBJECT-TYPE
- SYNTAX ChannelEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A set of parameters for a packet channel applied on a
- particular interface. As an example, an instance of
- the channelMatches object might be named
- channelMatches.3"
- INDEX { channelIndex }
- ::= { channelTable 1 }
-
-
-
- ChannelEntry ::= SEQUENCE {
- channelIndex INTEGER (1..65535),
- channelIfIndex INTEGER (1..65535),
- channelAcceptType INTEGER,
- channelDataControl INTEGER,
- channelTurnOnEventIndex INTEGER (0..65535),
- channelTurnOffEventIndex INTEGER (0..65535),
- channelEventIndex INTEGER (0..65535),
- channelEventStatus INTEGER,
- channelMatches Counter,
- channelDescription DisplayString (SIZE (0..127)),
- channelOwner OwnerString,
- channelStatus EntryStatus
- }
-
- channelIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "An index that uniquely identifies an entry in the
- channel table. Each such entry defines one channel,
- a logical data and event stream.
-
- It is suggested that before creating a channel, an
- application should scan all instances of the
- filterChannelIndex object to make sure that there
- are no pre-existing filters that would be
- inadvertently be linked to the channel."
- ::= { channelEntry 1 }
-
- channelIfIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The value of this object uniquely identifies the
- interface on this remote network monitoring device
- to which the associated filters are applied to allow
- data into this channel. The interface identified by
- a particular value of this object is the same
- interface as identified by the same value of the
- ifIndex object, defined in RFC 1213 and RFC 1573
- [4,6].
-
- The filters in this group are applied to all packets
- on the local network segment attached to the
- identified interface.
-
-
- An agent may or may not be able to tell if
- fundamental changes to the media of the interface
- have occurred and necessitate an invalidation of
- this entry. For example, a hot-pluggable ethernet
- card could be pulled out and replaced by a
- token-ring card. In such a case, if the agent has
- such knowledge of the change, it is recommended that
- it invalidate this entry.
-
- This object may not be modified if the associated
- channelStatus object is equal to valid(1)."
- ::= { channelEntry 2 }
-
- channelAcceptType OBJECT-TYPE
- SYNTAX INTEGER {
- acceptMatched(1),
- acceptFailed(2)
- }
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "This object controls the action of the filters
- associated with this channel. If this object is equal
- to acceptMatched(1), packets will be accepted to this
- channel if they are accepted by both the packet data
- and packet status matches of an associated filter. If
- this object is equal to acceptFailed(2), packets will
- be accepted to this channel only if they fail either
- the packet data match or the packet status match of
- each of the associated filters.
-
- In particular, a channel with no associated filters
- will match no packets if set to acceptMatched(1)
- case and will match all packets in the
- acceptFailed(2) case.
-
- This object may not be modified if the associated
- channelStatus object is equal to valid(1)."
- ::= { channelEntry 3 }
-
- channelDataControl OBJECT-TYPE
- SYNTAX INTEGER {
- on(1),
- off(2)
- }
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
-
-
- "This object controls the flow of data through this
- channel. If this object is on(1), data, status and
- events flow through this channel. If this object is
- off(2), data, status and events will not flow
- through this channel."
- DEFVAL { off }
- ::= { channelEntry 4 }
-
- channelTurnOnEventIndex OBJECT-TYPE
- SYNTAX INTEGER (0..65535)
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The value of this object identifies the event
- that is configured to turn the associated
- channelDataControl from off to on when the event is
- generated. The event identified by a particular value
- of this object is the same event as identified by the
- same value of the eventIndex object. If there is no
- corresponding entry in the eventTable, then no
- association exists. In fact, if no event is intended
- for this channel, channelTurnOnEventIndex must be
- set to zero, a non-existent event index.
-
- This object may not be modified if the associated
- channelStatus object is equal to valid(1)."
- ::= { channelEntry 5 }
-
- channelTurnOffEventIndex OBJECT-TYPE
- SYNTAX INTEGER (0..65535)
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The value of this object identifies the event
- that is configured to turn the associated
- channelDataControl from on to off when the event is
- generated. The event identified by a particular value
- of this object is the same event as identified by the
- same value of the eventIndex object. If there is no
- corresponding entry in the eventTable, then no
- association exists. In fact, if no event is intended
- for this channel, channelTurnOffEventIndex must be
- set to zero, a non-existent event index.
-
- This object may not be modified if the associated
- channelStatus object is equal to valid(1)."
- ::= { channelEntry 6 }
-
-
-
- channelEventIndex OBJECT-TYPE
- SYNTAX INTEGER (0..65535)
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The value of this object identifies the event
- that is configured to be generated when the
- associated channelDataControl is on and a packet
- is matched. The event identified by a particular
- value of this object is the same event as identified
- by the same value of the eventIndex object. If
- there is no corresponding entry in the eventTable,
- then no association exists. In fact, if no event is
- intended for this channel, channelEventIndex must be
- set to zero, a non-existent event index.
-
- This object may not be modified if the associated
- channelStatus object is equal to valid(1)."
- ::= { channelEntry 7 }
-
- channelEventStatus OBJECT-TYPE
- SYNTAX INTEGER {
- eventReady(1),
- eventFired(2),
- eventAlwaysReady(3)
- }
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The event status of this channel.
-
- If this channel is configured to generate events
- when packets are matched, a means of controlling
- the flow of those events is often needed. When
- this object is equal to eventReady(1), a single
- event may be generated, after which this object
- will be set by the probe to eventFired(2). While
- in the eventFired(2) state, no events will be
- generated until the object is modified to
- eventReady(1) (or eventAlwaysReady(3)). The
- management station can thus easily respond to a
- notification of an event by re-enabling this object.
-
- If the management station wishes to disable this
- flow control and allow events to be generated
- at will, this object may be set to
- eventAlwaysReady(3). Disabling the flow control
- is discouraged as it can result in high network
-
-
- traffic or other performance problems."
- DEFVAL { eventReady }
- ::= { channelEntry 8 }
-
- channelMatches OBJECT-TYPE
- SYNTAX Counter
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of times this channel has matched a
- packet. Note that this object is updated even when
- channelDataControl is set to off."
- ::= { channelEntry 9 }
-
- channelDescription OBJECT-TYPE
- SYNTAX DisplayString (SIZE (0..127))
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "A comment describing this channel."
- ::= { channelEntry 10 }
-
- channelOwner OBJECT-TYPE
- SYNTAX OwnerString
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The entity that configured this entry and is
- therefore using the resources assigned to it."
- ::= { channelEntry 11 }
-
- channelStatus OBJECT-TYPE
- SYNTAX EntryStatus
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The status of this channel entry."
- ::= { channelEntry 12 }
-
-
- -- The Packet Capture Group
-
- -- Implementation of the Packet Capture group is optional.
- --
- -- The Packet Capture Group requires implementation of the
- -- Filter Group.
- --
- -- The Packet Capture group allows packets to be captured
-
-
- -- upon a filter match. The bufferControlTable controls
- -- the captured packets output from a channel that is
- -- associated with it. The captured packets are placed
- -- in entries in the captureBufferTable. These entries are
- -- associated with the bufferControlEntry on whose behalf they
- -- were stored.
-
- bufferControlTable OBJECT-TYPE
- SYNTAX SEQUENCE OF BufferControlEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of buffers control entries."
- ::= { capture 1 }
-
- bufferControlEntry OBJECT-TYPE
- SYNTAX BufferControlEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A set of parameters that control the collection of
- a stream of packets that have matched filters. As
- an example, an instance of the
- bufferControlCaptureSliceSize object might be named
- bufferControlCaptureSliceSize.3"
- INDEX { bufferControlIndex }
- ::= { bufferControlTable 1 }
-
- BufferControlEntry ::= SEQUENCE {
- bufferControlIndex INTEGER (1..65535),
- bufferControlChannelIndex INTEGER (1..65535),
- bufferControlFullStatus INTEGER,
- bufferControlFullAction INTEGER,
- bufferControlCaptureSliceSize INTEGER,
- bufferControlDownloadSliceSize INTEGER,
- bufferControlDownloadOffset INTEGER,
- bufferControlMaxOctetsRequested INTEGER,
- bufferControlMaxOctetsGranted INTEGER,
- bufferControlCapturedPackets INTEGER,
- bufferControlTurnOnTime TimeTicks,
- bufferControlOwner OwnerString,
- bufferControlStatus EntryStatus
- }
-
- bufferControlIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
-
-
- DESCRIPTION
- "An index that uniquely identifies an entry
- in the bufferControl table. The value of this
- index shall never be zero. Each such
- entry defines one set of packets that is
- captured and controlled by one or more filters."
- ::= { bufferControlEntry 1 }
-
- bufferControlChannelIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "An index that identifies the channel that is the
- source of packets for this bufferControl table.
- The channel identified by a particular value of this
- index is the same as identified by the same value of
- the channelIndex object.
-
- This object may not be modified if the associated
- bufferControlStatus object is equal to valid(1)."
- ::= { bufferControlEntry 2 }
-
- bufferControlFullStatus OBJECT-TYPE
- SYNTAX INTEGER {
- spaceAvailable(1),
- full(2)
- }
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "This object shows whether the buffer has room to
- accept new packets or if it is full.
-
- If the status is spaceAvailable(1), the buffer is
- accepting new packets normally. If the status is
- full(2) and the associated bufferControlFullAction
- object is wrapWhenFull, the buffer is accepting new
- packets by deleting enough of the oldest packets
- to make room for new ones as they arrive. Otherwise,
- if the status is full(2) and the
- bufferControlFullAction object is lockWhenFull,
- then the buffer has stopped collecting packets.
-
- When this object is set to full(2) the probe must
- not later set it to spaceAvailable(1) except in the
- case of a significant gain in resources such as
- an increase of bufferControlOctetsGranted. In
-
-
- particular, the wrap-mode action of deleting old
- packets to make room for newly arrived packets
- must not affect the value of this object."
- ::= { bufferControlEntry 3 }
-
- bufferControlFullAction OBJECT-TYPE
- SYNTAX INTEGER {
- lockWhenFull(1),
- wrapWhenFull(2) -- FIFO
- }
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "Controls the action of the buffer when it
- reaches the full status. When in the lockWhenFull(1)
- state and a packet is added to the buffer that
- fills the buffer, the bufferControlFullStatus will
- be set to full(2) and this buffer will stop capturing
- packets."
- ::= { bufferControlEntry 4 }
-
- bufferControlCaptureSliceSize OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The maximum number of octets of each packet
- that will be saved in this capture buffer.
- For example, if a 1500 octet packet is received by
- the probe and this object is set to 500, then only
- 500 octets of the packet will be stored in the
- associated capture buffer. If this variable is set
- to 0, the capture buffer will save as many octets
- as is possible.
-
- This object may not be modified if the associated
- bufferControlStatus object is equal to valid(1)."
- DEFVAL { 100 }
- ::= { bufferControlEntry 5 }
-
- bufferControlDownloadSliceSize OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The maximum number of octets of each packet
- in this capture buffer that will be returned in
- an SNMP retrieval of that packet. For example,
-
-
- if 500 octets of a packet have been stored in the
- associated capture buffer, the associated
- bufferControlDownloadOffset is 0, and this
- object is set to 100, then the captureBufferPacket
- object that contains the packet will contain only
- the first 100 octets of the packet.
-
- A prudent manager will take into account possible
- interoperability or fragmentation problems that may
- occur if the download slice size is set too large.
- In particular, conformant SNMP implementations are not
- required to accept messages whose length exceeds 484
- octets, although they are encouraged to support larger
- datagrams whenever feasible."
- DEFVAL { 100 }
- ::= { bufferControlEntry 6 }
-
- bufferControlDownloadOffset OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The offset of the first octet of each packet
- in this capture buffer that will be returned in
- an SNMP retrieval of that packet. For example,
- if 500 octets of a packet have been stored in the
- associated capture buffer and this object is set to
- 100, then the captureBufferPacket object that
- contains the packet will contain bytes starting
- 100 octets into the packet."
- DEFVAL { 0 }
- ::= { bufferControlEntry 7 }
-
- bufferControlMaxOctetsRequested OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The requested maximum number of octets to be
- saved in this captureBuffer, including any
- implementation-specific overhead. If this variable
- is set to -1, the capture buffer will save as many
- octets as is possible.
-
- When this object is created or modified, the probe
- should set bufferControlMaxOctetsGranted as closely
- to this object as is possible for the particular probe
- implementation and available resources. However, if
-
-
- the object has the special value of -1, the probe
- must set bufferControlMaxOctetsGranted to -1."
- DEFVAL { -1 }
- ::= { bufferControlEntry 8 }
-
- bufferControlMaxOctetsGranted OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The maximum number of octets that can be
- saved in this captureBuffer, including overhead.
- If this variable is -1, the capture buffer will save
- as many octets as possible.
-
- When the bufferControlMaxOctetsRequested object is
- created or modified, the probe should set this object
- as closely to the requested value as is possible for
- the particular probe implementation and available
- resources.
- However, if the request object has the special value
- of -1, the probe must set this object to -1.
- The probe must not lower this value except as a result
- of a modification to the associated
- bufferControlMaxOctetsRequested object.
-
- When this maximum number of octets is reached
- and a new packet is to be added to this
- capture buffer and the corresponding
- bufferControlFullAction is set to wrapWhenFull(2),
- enough of the oldest packets associated with this
- capture buffer shall be deleted by the agent so
- that the new packet can be added. If the
- corresponding bufferControlFullAction is set to
- lockWhenFull(1), the new packet shall be discarded.
- In either case, the probe must set
- bufferControlFullStatus to full(2).
-
- When the value of this object changes to a value less
- than the current value, entries are deleted from
- the captureBufferTable associated with this
- bufferControlEntry. Enough of the
- oldest of these captureBufferEntries shall be
- deleted by the agent so that the number of octets
- used remains less than or equal to the new value of
- this object.
-
- When the value of this object changes to a value
-
-
- greater than the current value, the number of
- associated captureBufferEntries may be allowed to
- grow."
- ::= { bufferControlEntry 9 }
-
- bufferControlCapturedPackets OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of packets currently in this
- captureBuffer."
- ::= { bufferControlEntry 10 }
-
- bufferControlTurnOnTime OBJECT-TYPE
- SYNTAX TimeTicks
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The value of sysUpTime when this capture buffer was
- first turned on."
- ::= { bufferControlEntry 11 }
-
- bufferControlOwner OBJECT-TYPE
- SYNTAX OwnerString
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The entity that configured this entry and is
- therefore using the resources assigned to it."
- ::= { bufferControlEntry 12 }
-
- bufferControlStatus OBJECT-TYPE
- SYNTAX EntryStatus
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The status of this buffer Control Entry."
- ::= { bufferControlEntry 13 }
-
- captureBufferTable OBJECT-TYPE
- SYNTAX SEQUENCE OF CaptureBufferEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of packets captured off of a channel."
- ::= { capture 2 }
-
-
-
- captureBufferEntry OBJECT-TYPE
- SYNTAX CaptureBufferEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A packet captured off of an attached network. As an
- example, an instance of the captureBufferPacketData
- object might be named captureBufferPacketData.3.1783"
- INDEX { captureBufferControlIndex, captureBufferIndex }
- ::= { captureBufferTable 1 }
-
- CaptureBufferEntry ::= SEQUENCE {
- captureBufferControlIndex INTEGER (1..65535),
- captureBufferIndex INTEGER (1..2147483647),
- captureBufferPacketID INTEGER,
- captureBufferPacketData OCTET STRING,
- captureBufferPacketLength INTEGER,
- captureBufferPacketTime INTEGER,
- captureBufferPacketStatus INTEGER
- }
-
- captureBufferControlIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The index of the bufferControlEntry with which
- this packet is associated."
- ::= { captureBufferEntry 1 }
-
- captureBufferIndex OBJECT-TYPE
- SYNTAX INTEGER (1..2147483647)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "An index that uniquely identifies an entry
- in the captureBuffer table associated with a
- particular bufferControlEntry. This index will
- start at 1 and increase by one for each new packet
- added with the same captureBufferControlIndex.
-
- Should this value reach 2147483647, the next packet
- added with the same captureBufferControlIndex shall
- cause this value to wrap around to 1."
- ::= { captureBufferEntry 2 }
-
- captureBufferPacketID OBJECT-TYPE
- SYNTAX INTEGER
-
-
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "An index that describes the order of packets
- that are received on a particular interface.
- The packetID of a packet captured on an
- interface is defined to be greater than the
- packetID's of all packets captured previously on
- the same interface. As the captureBufferPacketID
- object has a maximum positive value of 2^31 - 1,
- any captureBufferPacketID object shall have the
- value of the associated packet's packetID mod 2^31."
- ::= { captureBufferEntry 3 }
-
- captureBufferPacketData OBJECT-TYPE
- SYNTAX OCTET STRING
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The data inside the packet, starting at the
- beginning of the packet plus any offset specified in
- the associated bufferControlDownloadOffset,
- including any link level headers. The length of the
- data in this object is the minimum of the length of
- the captured packet minus the offset, the length of
- the associated bufferControlCaptureSliceSize minus
- the offset, and the associated
- bufferControlDownloadSliceSize. If this minimum is
- less than zero, this object shall have a length of
- zero."
- ::= { captureBufferEntry 4 }
-
- captureBufferPacketLength OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The actual length (off the wire) of the packet stored
- in this entry, including FCS octets."
- ::= { captureBufferEntry 5 }
-
- captureBufferPacketTime OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The number of milliseconds that had passed since
- this capture buffer was first turned on when this
-
-
- packet was captured."
- ::= { captureBufferEntry 6 }
-
- captureBufferPacketStatus OBJECT-TYPE
- SYNTAX INTEGER
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "A value which indicates the error status of this
- packet.
-
- The value of this object is defined in the same way as
- filterPktStatus. The value is a sum. This sum
- initially takes the value zero. Then, for each
- error, E, that has been discovered in this packet,
- 2 raised to a value representing E is added to the
- sum.
-
- The errors defined for a packet captured off of an
- Ethernet interface are as follows:
-
- bit # Error
- 0 Packet is longer than 1518 octets
- 1 Packet is shorter than 64 octets
- 2 Packet experienced a CRC or Alignment
- error
- 3 First packet in this capture buffer after
- it was detected that some packets were
- not processed correctly.
- 4 Packet's order in buffer is only
- approximate (May only be set for packets
- sent from the probe)
-
- For example, an Ethernet fragment would have a
- value of 6 (2^1 + 2^2).
-
- As this MIB is expanded to new media types, this
- object will have other media-specific errors defined."
- ::= { captureBufferEntry 7 }
-
-
- -- The Event Group
-
- -- Implementation of the Event group is optional.
- --
- -- The Event group controls the generation and notification
- -- of events from this device. Each entry in the eventTable
- -- describes the parameters of the event that can be
-
-
- -- triggered. Each event entry is fired by an associated
- -- condition located elsewhere in the MIB. An event entry
- -- may also be associated- with a function elsewhere in the
- -- MIB that will be executed when the event is generated. For
- -- example, a channel may be turned on or off by the firing
- -- of an event.
- --
- -- Each eventEntry may optionally specify that a log entry
- -- be created on its behalf whenever the event occurs.
- -- Each entry may also specify that notification should
- -- occur by way of SNMP trap messages. In this case, the
- -- community for the trap message is given in the associated
- -- eventCommunity object. The enterprise and specific trap
- -- fields of the trap are determined by the condition that
- -- triggered the event. Two traps are defined: risingAlarm
- -- and fallingAlarm. If the eventTable is triggered by a
- -- condition specified elsewhere, the enterprise and
- -- specific trap fields must be specified for traps
- -- generated for that condition.
-
- eventTable OBJECT-TYPE
- SYNTAX SEQUENCE OF EventEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A list of events to be generated."
- ::= { event 1 }
-
- eventEntry OBJECT-TYPE
- SYNTAX EventEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A set of parameters that describe an event to be
- generated when certain conditions are met. As an
- example, an instance of the eventLastTimeSent object
- might be named eventLastTimeSent.6"
- INDEX { eventIndex }
- ::= { eventTable 1 }
-
- EventEntry ::= SEQUENCE {
- eventIndex INTEGER (1..65535),
- eventDescription DisplayString (SIZE (0..127)),
- eventType INTEGER,
- eventCommunity OCTET STRING (SIZE (0..127)),
- eventLastTimeSent TimeTicks,
- eventOwner OwnerString,
- eventStatus EntryStatus
-
-
- }
-
- eventIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "An index that uniquely identifies an entry in the
- event table. Each such entry defines one event that
- is to be generated when the appropriate conditions
- occur."
- ::= { eventEntry 1 }
-
- eventDescription OBJECT-TYPE
- SYNTAX DisplayString (SIZE (0..127))
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "A comment describing this event entry."
- ::= { eventEntry 2 }
-
- eventType OBJECT-TYPE
- SYNTAX INTEGER {
- none(1),
- log(2),
- snmp-trap(3), -- send an SNMP trap
- log-and-trap(4)
- }
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The type of notification that the probe will make
- about this event. In the case of log, an entry is
- made in the log table for each event. In the case of
- snmp-trap, an SNMP trap is sent to one or more
- management stations."
- ::= { eventEntry 3 }
-
- eventCommunity OBJECT-TYPE
- SYNTAX OCTET STRING (SIZE (0..127))
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "If an SNMP trap is to be sent, it will be sent to
- the SNMP community specified by this octet string.
- In the future this table will be extended to include
- the party security mechanism. This object shall be
- set to a string of length zero if it is intended that
-
-
- that mechanism be used to specify the destination of
- the trap."
- ::= { eventEntry 4 }
-
- eventLastTimeSent OBJECT-TYPE
- SYNTAX TimeTicks
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The value of sysUpTime at the time this event
- entry last generated an event. If this entry has
- not generated any events, this value will be
- zero."
- ::= { eventEntry 5 }
-
- eventOwner OBJECT-TYPE
- SYNTAX OwnerString
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The entity that configured this entry and is
- therefore using the resources assigned to it.
-
- If this object contains a string starting with
- 'monitor' and has associated entries in the log
- table, all connected management stations should
- retrieve those log entries, as they may have
- significance to all management stations connected to
- this device"
- ::= { eventEntry 6 }
-
- eventStatus OBJECT-TYPE
- SYNTAX EntryStatus
- ACCESS read-write
- STATUS mandatory
- DESCRIPTION
- "The status of this event entry.
-
- If this object is not equal to valid(1), all
- associated log entries shall be deleted by the
- agent."
- ::= { eventEntry 7 }
-
- --
- logTable OBJECT-TYPE
- SYNTAX SEQUENCE OF LogEntry
- ACCESS not-accessible
- STATUS mandatory
-
-
- DESCRIPTION
- "A list of events that have been logged."
- ::= { event 2 }
-
- logEntry OBJECT-TYPE
- SYNTAX LogEntry
- ACCESS not-accessible
- STATUS mandatory
- DESCRIPTION
- "A set of data describing an event that has been
- logged. For example, an instance of the
- logDescription object might be named
- logDescription.6.47"
- INDEX { logEventIndex, logIndex }
- ::= { logTable 1 }
-
- LogEntry ::= SEQUENCE {
- logEventIndex INTEGER (1..65535),
- logIndex INTEGER (1..2147483647),
- logTime TimeTicks,
- logDescription DisplayString (SIZE (0..255))
- }
-
- logEventIndex OBJECT-TYPE
- SYNTAX INTEGER (1..65535)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The event entry that generated this log
- entry. The log identified by a particular
- value of this index is associated with the same
- eventEntry as identified by the same value
- of eventIndex."
- ::= { logEntry 1 }
-
- logIndex OBJECT-TYPE
- SYNTAX INTEGER (1..2147483647)
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "An index that uniquely identifies an entry
- in the log table amongst those generated by the
- same eventEntries. These indexes are
- assigned beginning with 1 and increase by one
- with each new log entry. The association
- between values of logIndex and logEntries
- is fixed for the lifetime of each logEntry.
- The agent may choose to delete the oldest
-
-
- instances of logEntry as required because of
- lack of memory. It is an implementation-specific
- matter as to when this deletion may occur."
- ::= { logEntry 2 }
-
- logTime OBJECT-TYPE
- SYNTAX TimeTicks
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "The value of sysUpTime when this log entry was
- created."
- ::= { logEntry 3 }
-
- logDescription OBJECT-TYPE
- SYNTAX DisplayString (SIZE (0..255))
- ACCESS read-only
- STATUS mandatory
- DESCRIPTION
- "An implementation dependent description of the
- event that activated this log entry."
- ::= { logEntry 4 }
-
- -- These definitions use the TRAP-TYPE macro as
- -- defined in RFC 1215 [10]
-
- -- Remote Network Monitoring Traps
-
- risingAlarm TRAP-TYPE
- ENTERPRISE rmon
- VARIABLES { alarmIndex, alarmVariable, alarmSampleType,
- alarmValue, alarmRisingThreshold }
- DESCRIPTION
- "The SNMP trap that is generated when an alarm
- entry crosses its rising threshold and generates
- an event that is configured for sending SNMP
- traps."
- ::= 1
-
- fallingAlarm TRAP-TYPE
- ENTERPRISE rmon
- VARIABLES { alarmIndex, alarmVariable, alarmSampleType,
- alarmValue, alarmFallingThreshold }
- DESCRIPTION
- "The SNMP trap that is generated when an alarm
- entry crosses its falling threshold and generates
- an event that is configured for sending SNMP
- traps."
-
-
- ::= 2
-
- END
+RMON-MIB DEFINITIONS ::= BEGIN
+ IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE, OBJECT-IDENTITY,
+ NOTIFICATION-TYPE, mib-2, Counter32,
+ Integer32, TimeTicks FROM SNMPv2-SMI
+
+ TEXTUAL-CONVENTION, DisplayString FROM SNMPv2-TC
+
+ MODULE-COMPLIANCE, OBJECT-GROUP,
+ NOTIFICATION-GROUP FROM SNMPv2-CONF;
+
+
+-- Remote Network Monitoring MIB
+
+rmonMibModule MODULE-IDENTITY
+ LAST-UPDATED "200005110000Z" -- 11 May, 2000
+ ORGANIZATION "IETF RMON MIB Working Group"
+ CONTACT-INFO
+ "Steve Waldbusser
+ Phone: +1-650-948-6500
+ Fax: +1-650-745-0671
+ DESCRIPTION
+ "Remote network monitoring devices, often called
+ monitors or probes, are instruments that exist for
+ the purpose of managing a network. This MIB defines
+ objects for managing remote network monitoring devices."
+
+ REVISION "200005110000Z" -- 11 May, 2000
+ DESCRIPTION
+ "Reformatted into SMIv2 format.
+
+ This version published as RFC 2819."
+
+ REVISION "199502010000Z" -- 1 Feb, 1995
+ DESCRIPTION
+ "Bug fixes, clarifications and minor changes based on
+ implementation experience, published as RFC1757 [18].
+
+ Two changes were made to object definitions:
+
+ 1) A new status bit has been defined for the
+ captureBufferPacketStatus object, indicating that the
+ packet order within the capture buffer may not be identical to
+ the packet order as received off the wire. This bit may only
+ be used for packets transmitted by the probe. Older NMS
+ applications can safely ignore this status bit, which might be
+ used by newer agents.
+
+ 2) The packetMatch trap has been removed. This trap was never
+ actually 'approved' and was not added to this document along
+ with the risingAlarm and fallingAlarm traps. The packetMatch
+ trap could not be throttled, which could cause disruption of
+ normal network traffic under some circumstances. An NMS should
+ configure a risingAlarm threshold on the appropriate
+ channelMatches instance if a trap is desired for a packetMatch
+ event. Note that logging of packetMatch events is still
+ supported--only trap generation for such events has been
+ removed.
+
+ In addition, several clarifications to individual object
+ definitions have been added to assist agent and NMS
+ implementors:
+
+ - global definition of 'good packets' and 'bad packets'
+
+ - more detailed text governing conceptual row creation and
+ modification
+
+ - instructions for probes relating to interface changes and
+ disruptions
+
+ - clarification of some ethernet counter definitions
+
+ - recommended formula for calculating network utilization
+
+ - clarification of channel and captureBuffer behavior for some
+ unusual conditions
+
+ - examples of proper instance naming for each table"
+
+ REVISION "199111010000Z" -- 1 Nov, 1991
+ DESCRIPTION
+ "The original version of this MIB, published as RFC1271."
+ ::= { rmonConformance 8 }
+
+ rmon OBJECT IDENTIFIER ::= { mib-2 16 }
+
+
+ -- textual conventions
+
+OwnerString ::= TEXTUAL-CONVENTION
+ STATUS current
+
+ DESCRIPTION
+ "This data type is used to model an administratively
+ assigned name of the owner of a resource. Implementations
+ must accept values composed of well-formed NVT ASCII
+ sequences. In addition, implementations should accept
+ values composed of well-formed UTF-8 sequences.
+
+ It is suggested that this name contain one or more of
+ the following: IP address, management station name,
+ network manager's name, location, or phone number.
+ In some cases the agent itself will be the owner of
+ an entry. In these cases, this string shall be set
+ to a string starting with 'monitor'.
+
+ SNMP access control is articulated entirely in terms
+ of the contents of MIB views; access to a particular
+ SNMP object instance depends only upon its presence
+ or absence in a particular MIB view and never upon
+ its value or the value of related object instances.
+ Thus, objects of this type afford resolution of
+ resource contention only among cooperating
+ managers; they realize no access control function
+ with respect to uncooperative parties."
+ SYNTAX OCTET STRING (SIZE (0..127))
+
+EntryStatus ::= TEXTUAL-CONVENTION
+ STATUS current
+ DESCRIPTION
+ "The status of a table entry.
+
+ Setting this object to the value invalid(4) has the
+ effect of invalidating the corresponding entry.
+ That is, it effectively disassociates the mapping
+ identified with said entry.
+ It is an implementation-specific matter as to whether
+ the agent removes an invalidated entry from the table.
+ Accordingly, management stations must be prepared to
+ receive tabular information from agents that corresponds
+ to entries currently not in use. Proper
+ interpretation of such entries requires examination
+ of the relevant EntryStatus object.
+
+ An existing instance of this object cannot be set to
+ createRequest(2). This object may only be set to
+ createRequest(2) when this instance is created. When
+ this object is created, the agent may wish to create
+ supplemental object instances with default values
+ to complete a conceptual row in this table. Because the
+ creation of these default objects is entirely at the option
+ of the agent, the manager must not assume that any will be
+ created, but may make use of any that are created.
+ Immediately after completing the create operation, the agent
+ must set this object to underCreation(3).
+
+ When in the underCreation(3) state, an entry is allowed to
+ exist in a possibly incomplete, possibly inconsistent state,
+ usually to allow it to be modified in multiple PDUs. When in
+ this state, an entry is not fully active.
+ Entries shall exist in the underCreation(3) state until
+ the management station is finished configuring the entry
+ and sets this object to valid(1) or aborts, setting this
+ object to invalid(4). If the agent determines that an
+ entry has been in the underCreation(3) state for an
+ abnormally long time, it may decide that the management
+ station has crashed. If the agent makes this decision,
+ it may set this object to invalid(4) to reclaim the
+ entry. A prudent agent will understand that the
+ management station may need to wait for human input
+ and will allow for that possibility in its
+ determination of this abnormally long period.
+
+ An entry in the valid(1) state is fully configured and
+ consistent and fully represents the configuration or
+ operation such a row is intended to represent. For
+ example, it could be a statistical function that is
+ configured and active, or a filter that is available
+ in the list of filters processed by the packet capture
+ process.
+
+ A manager is restricted to changing the state of an entry in
+ the following ways:
+
+ To: valid createRequest underCreation invalid
+ From:
+ valid OK NO OK OK
+ createRequest N/A N/A N/A N/A
+ underCreation OK NO OK OK
+ invalid NO NO NO OK
+ nonExistent NO OK NO OK
+
+ In the table above, it is not applicable to move the state
+ from the createRequest state to any other state because the
+ manager will never find the variable in that state. The
+ nonExistent state is not a value of the enumeration, rather
+ it means that the entryStatus variable does not exist at all.
+
+ An agent may allow an entryStatus variable to change state in
+ additional ways, so long as the semantics of the states are
+ followed. This allowance is made to ease the implementation of
+ the agent and is made despite the fact that managers should
+ never exercise these additional state transitions."
+ SYNTAX INTEGER {
+ valid(1),
+ createRequest(2),
+ underCreation(3),
+ invalid(4)
+ }
+
+ statistics OBJECT IDENTIFIER ::= { rmon 1 }
+ history OBJECT IDENTIFIER ::= { rmon 2 }
+ alarm OBJECT IDENTIFIER ::= { rmon 3 }
+ hosts OBJECT IDENTIFIER ::= { rmon 4 }
+ hostTopN OBJECT IDENTIFIER ::= { rmon 5 }
+ matrix OBJECT IDENTIFIER ::= { rmon 6 }
+ filter OBJECT IDENTIFIER ::= { rmon 7 }
+ capture OBJECT IDENTIFIER ::= { rmon 8 }
+ event OBJECT IDENTIFIER ::= { rmon 9 }
+ rmonConformance OBJECT IDENTIFIER ::= { rmon 20 }
+
+-- The Ethernet Statistics Group
+--
+-- Implementation of the Ethernet Statistics group is optional.
+-- Consult the MODULE-COMPLIANCE macro for the authoritative
+-- conformance information for this MIB.
+--
+-- The ethernet statistics group contains statistics measured by the
+-- probe for each monitored interface on this device. These
+-- statistics take the form of free running counters that start from
+-- zero when a valid entry is created.
+--
+-- This group currently has statistics defined only for
+-- Ethernet interfaces. Each etherStatsEntry contains statistics
+-- for one Ethernet interface. The probe must create one
+-- etherStats entry for each monitored Ethernet interface
+-- on the device.
+
+etherStatsTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF EtherStatsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of Ethernet statistics entries."
+ ::= { statistics 1 }
+
+etherStatsEntry OBJECT-TYPE
+ SYNTAX EtherStatsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A collection of statistics kept for a particular
+ Ethernet interface. As an example, an instance of the
+ etherStatsPkts object might be named etherStatsPkts.1"
+ INDEX { etherStatsIndex }
+ ::= { etherStatsTable 1 }
+
+EtherStatsEntry ::= SEQUENCE {
+ etherStatsIndex Integer32,
+ etherStatsDataSource OBJECT IDENTIFIER,
+ etherStatsDropEvents Counter32,
+ etherStatsOctets Counter32,
+ etherStatsPkts Counter32,
+ etherStatsBroadcastPkts Counter32,
+ etherStatsMulticastPkts Counter32,
+ etherStatsCRCAlignErrors Counter32,
+ etherStatsUndersizePkts Counter32,
+ etherStatsOversizePkts Counter32,
+ etherStatsFragments Counter32,
+ etherStatsJabbers Counter32,
+ etherStatsCollisions Counter32,
+ etherStatsPkts64Octets Counter32,
+ etherStatsPkts65to127Octets Counter32,
+ etherStatsPkts128to255Octets Counter32,
+ etherStatsPkts256to511Octets Counter32,
+ etherStatsPkts512to1023Octets Counter32,
+ etherStatsPkts1024to1518Octets Counter32,
+ etherStatsOwner OwnerString,
+ etherStatsStatus EntryStatus
+}
+
+etherStatsIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value of this object uniquely identifies this
+ etherStats entry."
+ ::= { etherStatsEntry 1 }
+
+etherStatsDataSource OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS read-create
+ STATUS current
+
+ DESCRIPTION
+ "This object identifies the source of the data that
+ this etherStats entry is configured to analyze. This
+ source can be any ethernet interface on this device.
+ In order to identify a particular interface, this object
+ shall identify the instance of the ifIndex object,
+ defined in RFC 2233 [17], for the desired interface.
+ For example, if an entry were to receive data from
+ interface #1, this object would be set to ifIndex.1.
+
+ The statistics in this group reflect all packets
+ on the local network segment attached to the identified
+ interface.
+
+ An agent may or may not be able to tell if fundamental
+ changes to the media of the interface have occurred and
+ necessitate an invalidation of this entry. For example, a
+ hot-pluggable ethernet card could be pulled out and replaced
+ by a token-ring card. In such a case, if the agent has such
+ knowledge of the change, it is recommended that it
+ invalidate this entry.
+
+ This object may not be modified if the associated
+ etherStatsStatus object is equal to valid(1)."
+ ::= { etherStatsEntry 2 }
+
+etherStatsDropEvents OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of events in which packets
+ were dropped by the probe due to lack of resources.
+ Note that this number is not necessarily the number of
+ packets dropped; it is just the number of times this
+ condition has been detected."
+ ::= { etherStatsEntry 3 }
+
+etherStatsOctets OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Octets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of octets of data (including
+ those in bad packets) received on the
+ network (excluding framing bits but including
+ FCS octets).
+
+ This object can be used as a reasonable estimate of
+ 10-Megabit ethernet utilization. If greater precision is
+ desired, the etherStatsPkts and etherStatsOctets objects
+ should be sampled before and after a common interval. The
+ differences in the sampled values are Pkts and Octets,
+ respectively, and the number of seconds in the interval is
+ Interval. These values are used to calculate the Utilization
+ as follows:
+
+ Pkts * (9.6 + 6.4) + (Octets * .8)
+ Utilization = -------------------------------------
+ Interval * 10,000
+
+ The result of this equation is the value Utilization which
+ is the percent utilization of the ethernet segment on a
+ scale of 0 to 100 percent."
+ ::= { etherStatsEntry 4 }
+
+etherStatsPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of packets (including bad packets,
+ broadcast packets, and multicast packets) received."
+ ::= { etherStatsEntry 5 }
+
+etherStatsBroadcastPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of good packets received that were
+ directed to the broadcast address. Note that this
+ does not include multicast packets."
+ ::= { etherStatsEntry 6 }
+
+etherStatsMulticastPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of good packets received that were
+ directed to a multicast address. Note that this number
+ does not include packets directed to the broadcast
+ address."
+ ::= { etherStatsEntry 7 }
+
+etherStatsCRCAlignErrors OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of packets received that
+ had a length (excluding framing bits, but
+ including FCS octets) of between 64 and 1518
+ octets, inclusive, but had either a bad
+ Frame Check Sequence (FCS) with an integral
+ number of octets (FCS Error) or a bad FCS with
+ a non-integral number of octets (Alignment Error)."
+ ::= { etherStatsEntry 8 }
+
+etherStatsUndersizePkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of packets received that were
+ less than 64 octets long (excluding framing bits,
+ but including FCS octets) and were otherwise well
+ formed."
+ ::= { etherStatsEntry 9 }
+
+etherStatsOversizePkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of packets received that were
+ longer than 1518 octets (excluding framing bits,
+ but including FCS octets) and were otherwise
+ well formed."
+ ::= { etherStatsEntry 10 }
+
+etherStatsFragments OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of packets received that were less than
+ 64 octets in length (excluding framing bits but including
+ FCS octets) and had either a bad Frame Check Sequence
+ (FCS) with an integral number of octets (FCS Error) or a
+ bad FCS with a non-integral number of octets (Alignment
+ Error).
+
+ Note that it is entirely normal for etherStatsFragments to
+ increment. This is because it counts both runts (which are
+ normal occurrences due to collisions) and noise hits."
+ ::= { etherStatsEntry 11 }
+
+etherStatsJabbers OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of packets received that were
+ longer than 1518 octets (excluding framing bits,
+ but including FCS octets), and had either a bad
+ Frame Check Sequence (FCS) with an integral number
+ of octets (FCS Error) or a bad FCS with a non-integral
+ number of octets (Alignment Error).
+
+ Note that this definition of jabber is different
+ than the definition in IEEE-802.3 section 8.2.1.5
+ (10BASE5) and section 10.3.1.4 (10BASE2). These
+ documents define jabber as the condition where any
+ packet exceeds 20 ms. The allowed range to detect
+ jabber is between 20 ms and 150 ms."
+ ::= { etherStatsEntry 12 }
+
+etherStatsCollisions OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Collisions"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The best estimate of the total number of collisions
+ on this Ethernet segment.
+
+ The value returned will depend on the location of the
+ RMON probe. Section 8.2.1.3 (10BASE-5) and section
+ 10.3.1.3 (10BASE-2) of IEEE standard 802.3 states that a
+ station must detect a collision, in the receive mode, if
+ three or more stations are transmitting simultaneously. A
+ repeater port must detect a collision when two or more
+ stations are transmitting simultaneously. Thus a probe
+ placed on a repeater port could record more collisions
+ than a probe connected to a station on the same segment
+ would.
+
+ Probe location plays a much smaller role when considering
+ 10BASE-T. 14.2.1.4 (10BASE-T) of IEEE standard 802.3
+ defines a collision as the simultaneous presence of signals
+ on the DO and RD circuits (transmitting and receiving
+ at the same time). A 10BASE-T station can only detect
+ collisions when it is transmitting. Thus probes placed on
+ a station and a repeater, should report the same number of
+ collisions.
+
+ Note also that an RMON probe inside a repeater should
+ ideally report collisions between the repeater and one or
+ more other hosts (transmit collisions as defined by IEEE
+ 802.3k) plus receiver collisions observed on any coax
+ segments to which the repeater is connected."
+ ::= { etherStatsEntry 13 }
+
+etherStatsPkts64Octets OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of packets (including bad
+ packets) received that were 64 octets in length
+ (excluding framing bits but including FCS octets)."
+ ::= { etherStatsEntry 14 }
+
+etherStatsPkts65to127Octets OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of packets (including bad
+ packets) received that were between
+ 65 and 127 octets in length inclusive
+ (excluding framing bits but including FCS octets)."
+ ::= { etherStatsEntry 15 }
+
+etherStatsPkts128to255Octets OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+
+ STATUS current
+ DESCRIPTION
+ "The total number of packets (including bad
+ packets) received that were between
+ 128 and 255 octets in length inclusive
+ (excluding framing bits but including FCS octets)."
+ ::= { etherStatsEntry 16 }
+
+etherStatsPkts256to511Octets OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of packets (including bad
+ packets) received that were between
+ 256 and 511 octets in length inclusive
+ (excluding framing bits but including FCS octets)."
+ ::= { etherStatsEntry 17 }
+
+etherStatsPkts512to1023Octets OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of packets (including bad
+ packets) received that were between
+ 512 and 1023 octets in length inclusive
+ (excluding framing bits but including FCS octets)."
+ ::= { etherStatsEntry 18 }
+
+etherStatsPkts1024to1518Octets OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of packets (including bad
+ packets) received that were between
+ 1024 and 1518 octets in length inclusive
+ (excluding framing bits but including FCS octets)."
+ ::= { etherStatsEntry 19 }
+
+etherStatsOwner OBJECT-TYPE
+ SYNTAX OwnerString
+ MAX-ACCESS read-create
+ STATUS current
+
+ DESCRIPTION
+ "The entity that configured this entry and is therefore
+ using the resources assigned to it."
+ ::= { etherStatsEntry 20 }
+
+etherStatsStatus OBJECT-TYPE
+ SYNTAX EntryStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The status of this etherStats entry."
+ ::= { etherStatsEntry 21 }
+
+-- The History Control Group
+
+-- Implementation of the History Control group is optional.
+-- Consult the MODULE-COMPLIANCE macro for the authoritative
+-- conformance information for this MIB.
+--
+-- The history control group controls the periodic statistical
+-- sampling of data from various types of networks. The
+-- historyControlTable stores configuration entries that each
+-- define an interface, polling period, and other parameters.
+-- Once samples are taken, their data is stored in an entry
+-- in a media-specific table. Each such entry defines one
+-- sample, and is associated with the historyControlEntry that
+-- caused the sample to be taken. Each counter in the
+-- etherHistoryEntry counts the same event as its similarly-named
+-- counterpart in the etherStatsEntry, except that each value here
+-- is a cumulative sum during a sampling period.
+--
+-- If the probe keeps track of the time of day, it should start
+-- the first sample of the history at a time such that
+-- when the next hour of the day begins, a sample is
+-- started at that instant. This tends to make more
+-- user-friendly reports, and enables comparison of reports
+-- from different probes that have relatively accurate time
+-- of day.
+--
+-- The probe is encouraged to add two history control entries
+-- per monitored interface upon initialization that describe a short
+-- term and a long term polling period. Suggested parameters are 30
+-- seconds for the short term polling period and 30 minutes for
+-- the long term period.
+
+historyControlTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF HistoryControlEntry
+ MAX-ACCESS not-accessible
+
+ STATUS current
+ DESCRIPTION
+ "A list of history control entries."
+ ::= { history 1 }
+
+historyControlEntry OBJECT-TYPE
+ SYNTAX HistoryControlEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of parameters that set up a periodic sampling of
+ statistics. As an example, an instance of the
+ historyControlInterval object might be named
+ historyControlInterval.2"
+ INDEX { historyControlIndex }
+ ::= { historyControlTable 1 }
+
+HistoryControlEntry ::= SEQUENCE {
+ historyControlIndex Integer32,
+ historyControlDataSource OBJECT IDENTIFIER,
+ historyControlBucketsRequested Integer32,
+ historyControlBucketsGranted Integer32,
+ historyControlInterval Integer32,
+ historyControlOwner OwnerString,
+ historyControlStatus EntryStatus
+}
+
+historyControlIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that uniquely identifies an entry in the
+ historyControl table. Each such entry defines a
+ set of samples at a particular interval for an
+ interface on the device."
+ ::= { historyControlEntry 1 }
+
+historyControlDataSource OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "This object identifies the source of the data for
+ which historical data was collected and
+ placed in a media-specific table on behalf of this
+ historyControlEntry. This source can be any
+ interface on this device. In order to identify
+ a particular interface, this object shall identify
+ the instance of the ifIndex object, defined
+ in RFC 2233 [17], for the desired interface.
+ For example, if an entry were to receive data from
+ interface #1, this object would be set to ifIndex.1.
+
+ The statistics in this group reflect all packets
+ on the local network segment attached to the identified
+ interface.
+
+ An agent may or may not be able to tell if fundamental
+ changes to the media of the interface have occurred and
+ necessitate an invalidation of this entry. For example, a
+ hot-pluggable ethernet card could be pulled out and replaced
+ by a token-ring card. In such a case, if the agent has such
+ knowledge of the change, it is recommended that it
+ invalidate this entry.
+
+ This object may not be modified if the associated
+ historyControlStatus object is equal to valid(1)."
+ ::= { historyControlEntry 2 }
+
+historyControlBucketsRequested OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The requested number of discrete time intervals
+ over which data is to be saved in the part of the
+ media-specific table associated with this
+ historyControlEntry.
+
+ When this object is created or modified, the probe
+ should set historyControlBucketsGranted as closely to
+ this object as is possible for the particular probe
+ implementation and available resources."
+ DEFVAL { 50 }
+ ::= { historyControlEntry 3 }
+
+historyControlBucketsGranted OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of discrete sampling intervals
+ over which data shall be saved in the part of
+ the media-specific table associated with this
+ historyControlEntry.
+
+ When the associated historyControlBucketsRequested
+ object is created or modified, the probe
+ should set this object as closely to the requested
+ value as is possible for the particular
+ probe implementation and available resources. The
+ probe must not lower this value except as a result
+ of a modification to the associated
+ historyControlBucketsRequested object.
+
+ There will be times when the actual number of
+ buckets associated with this entry is less than
+ the value of this object. In this case, at the
+ end of each sampling interval, a new bucket will
+ be added to the media-specific table.
+
+ When the number of buckets reaches the value of
+ this object and a new bucket is to be added to the
+ media-specific table, the oldest bucket associated
+ with this historyControlEntry shall be deleted by
+ the agent so that the new bucket can be added.
+
+ When the value of this object changes to a value less
+ than the current value, entries are deleted
+ from the media-specific table associated with this
+ historyControlEntry. Enough of the oldest of these
+ entries shall be deleted by the agent so that their
+ number remains less than or equal to the new value of
+ this object.
+
+ When the value of this object changes to a value greater
+ than the current value, the number of associated media-
+ specific entries may be allowed to grow."
+ ::= { historyControlEntry 4 }
+
+historyControlInterval OBJECT-TYPE
+ SYNTAX Integer32 (1..3600)
+ UNITS "Seconds"
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The interval in seconds over which the data is
+ sampled for each bucket in the part of the
+ media-specific table associated with this
+ historyControlEntry. This interval can
+ be set to any number of seconds between 1 and
+ 3600 (1 hour).
+
+ Because the counters in a bucket may overflow at their
+ maximum value with no indication, a prudent manager will
+ take into account the possibility of overflow in any of
+ the associated counters. It is important to consider the
+ minimum time in which any counter could overflow on a
+ particular media type and set the historyControlInterval
+ object to a value less than this interval. This is
+ typically most important for the 'octets' counter in any
+ media-specific table. For example, on an Ethernet
+ network, the etherHistoryOctets counter could overflow
+ in about one hour at the Ethernet's maximum
+ utilization.
+
+ This object may not be modified if the associated
+ historyControlStatus object is equal to valid(1)."
+ DEFVAL { 1800 }
+ ::= { historyControlEntry 5 }
+
+historyControlOwner OBJECT-TYPE
+ SYNTAX OwnerString
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The entity that configured this entry and is therefore
+ using the resources assigned to it."
+ ::= { historyControlEntry 6 }
+
+historyControlStatus OBJECT-TYPE
+ SYNTAX EntryStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The status of this historyControl entry.
+
+ Each instance of the media-specific table associated
+ with this historyControlEntry will be deleted by the agent
+ if this historyControlEntry is not equal to valid(1)."
+ ::= { historyControlEntry 7 }
+
+-- The Ethernet History Group
+
+-- Implementation of the Ethernet History group is optional.
+-- Consult the MODULE-COMPLIANCE macro for the authoritative
+-- conformance information for this MIB.
+--
+-- The Ethernet History group records periodic statistical samples
+-- from a network and stores them for later retrieval.
+-- Once samples are taken, their data is stored in an entry
+-- in a media-specific table. Each such entry defines one
+-- sample, and is associated with the historyControlEntry that
+-- caused the sample to be taken. This group defines the
+-- etherHistoryTable, for Ethernet networks.
+--
+
+etherHistoryTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF EtherHistoryEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of Ethernet history entries."
+ ::= { history 2 }
+
+etherHistoryEntry OBJECT-TYPE
+ SYNTAX EtherHistoryEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An historical sample of Ethernet statistics on a particular
+ Ethernet interface. This sample is associated with the
+ historyControlEntry which set up the parameters for
+ a regular collection of these samples. As an example, an
+ instance of the etherHistoryPkts object might be named
+ etherHistoryPkts.2.89"
+ INDEX { etherHistoryIndex , etherHistorySampleIndex }
+ ::= { etherHistoryTable 1 }
+
+EtherHistoryEntry ::= SEQUENCE {
+ etherHistoryIndex Integer32,
+ etherHistorySampleIndex Integer32,
+ etherHistoryIntervalStart TimeTicks,
+ etherHistoryDropEvents Counter32,
+ etherHistoryOctets Counter32,
+ etherHistoryPkts Counter32,
+ etherHistoryBroadcastPkts Counter32,
+ etherHistoryMulticastPkts Counter32,
+ etherHistoryCRCAlignErrors Counter32,
+ etherHistoryUndersizePkts Counter32,
+ etherHistoryOversizePkts Counter32,
+ etherHistoryFragments Counter32,
+ etherHistoryJabbers Counter32,
+ etherHistoryCollisions Counter32,
+ etherHistoryUtilization Integer32
+}
+
+etherHistoryIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The history of which this entry is a part. The
+ history identified by a particular value of this
+ index is the same history as identified
+ by the same value of historyControlIndex."
+ ::= { etherHistoryEntry 1 }
+
+etherHistorySampleIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..2147483647)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that uniquely identifies the particular
+ sample this entry represents among all samples
+ associated with the same historyControlEntry.
+ This index starts at 1 and increases by one
+ as each new sample is taken."
+ ::= { etherHistoryEntry 2 }
+
+etherHistoryIntervalStart OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value of sysUpTime at the start of the interval
+ over which this sample was measured. If the probe
+ keeps track of the time of day, it should start
+ the first sample of the history at a time such that
+ when the next hour of the day begins, a sample is
+ started at that instant. Note that following this
+ rule may require the probe to delay collecting the
+ first sample of the history, as each sample must be
+ of the same interval. Also note that the sample which
+ is currently being collected is not accessible in this
+ table until the end of its interval."
+ ::= { etherHistoryEntry 3 }
+
+etherHistoryDropEvents OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of events in which packets
+ were dropped by the probe due to lack of resources
+ during this sampling interval. Note that this number
+ is not necessarily the number of packets dropped, it
+ is just the number of times this condition has been
+ detected."
+ ::= { etherHistoryEntry 4 }
+
+etherHistoryOctets OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Octets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of octets of data (including
+ those in bad packets) received on the
+ network (excluding framing bits but including
+ FCS octets)."
+ ::= { etherHistoryEntry 5 }
+
+etherHistoryPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of packets (including bad packets)
+ received during this sampling interval."
+ ::= { etherHistoryEntry 6 }
+
+etherHistoryBroadcastPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of good packets received during this
+ sampling interval that were directed to the
+ broadcast address."
+ ::= { etherHistoryEntry 7 }
+
+etherHistoryMulticastPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of good packets received during this
+ sampling interval that were directed to a
+ multicast address. Note that this number does not
+ include packets addressed to the broadcast address."
+ ::= { etherHistoryEntry 8 }
+
+etherHistoryCRCAlignErrors OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of packets received during this
+ sampling interval that had a length (excluding
+ framing bits but including FCS octets) between
+ 64 and 1518 octets, inclusive, but had either a bad Frame
+ Check Sequence (FCS) with an integral number of octets
+ (FCS Error) or a bad FCS with a non-integral number
+ of octets (Alignment Error)."
+ ::= { etherHistoryEntry 9 }
+
+etherHistoryUndersizePkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of packets received during this
+ sampling interval that were less than 64 octets
+ long (excluding framing bits but including FCS
+ octets) and were otherwise well formed."
+ ::= { etherHistoryEntry 10 }
+
+etherHistoryOversizePkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of packets received during this
+ sampling interval that were longer than 1518
+ octets (excluding framing bits but including
+ FCS octets) but were otherwise well formed."
+ ::= { etherHistoryEntry 11 }
+
+etherHistoryFragments OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of packets received during this
+ sampling interval that were less than 64 octets in
+ length (excluding framing bits but including FCS
+ octets) had either a bad Frame Check Sequence (FCS)
+ with an integral number of octets (FCS Error) or a bad
+ FCS with a non-integral number of octets (Alignment
+ Error).
+
+ Note that it is entirely normal for etherHistoryFragments to
+ increment. This is because it counts both runts (which are
+ normal occurrences due to collisions) and noise hits."
+ ::= { etherHistoryEntry 12 }
+
+etherHistoryJabbers OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of packets received during this
+ sampling interval that were longer than 1518 octets
+ (excluding framing bits but including FCS octets),
+ and had either a bad Frame Check Sequence (FCS)
+ with an integral number of octets (FCS Error) or
+ a bad FCS with a non-integral number of octets
+ (Alignment Error).
+
+ Note that this definition of jabber is different
+ than the definition in IEEE-802.3 section 8.2.1.5
+ (10BASE5) and section 10.3.1.4 (10BASE2). These
+ documents define jabber as the condition where any
+ packet exceeds 20 ms. The allowed range to detect
+ jabber is between 20 ms and 150 ms."
+ ::= { etherHistoryEntry 13 }
+
+etherHistoryCollisions OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Collisions"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The best estimate of the total number of collisions
+ on this Ethernet segment during this sampling
+ interval.
+
+ The value returned will depend on the location of the
+ RMON probe. Section 8.2.1.3 (10BASE-5) and section
+ 10.3.1.3 (10BASE-2) of IEEE standard 802.3 states that a
+ station must detect a collision, in the receive mode, if
+ three or more stations are transmitting simultaneously. A
+ repeater port must detect a collision when two or more
+ stations are transmitting simultaneously. Thus a probe
+ placed on a repeater port could record more collisions
+ than a probe connected to a station on the same segment
+ would.
+
+ Probe location plays a much smaller role when considering
+ 10BASE-T. 14.2.1.4 (10BASE-T) of IEEE standard 802.3
+ defines a collision as the simultaneous presence of signals
+ on the DO and RD circuits (transmitting and receiving
+ at the same time). A 10BASE-T station can only detect
+ collisions when it is transmitting. Thus probes placed on
+ a station and a repeater, should report the same number of
+ collisions.
+
+ Note also that an RMON probe inside a repeater should
+ ideally report collisions between the repeater and one or
+ more other hosts (transmit collisions as defined by IEEE
+ 802.3k) plus receiver collisions observed on any coax
+ segments to which the repeater is connected."
+ ::= { etherHistoryEntry 14 }
+
+etherHistoryUtilization OBJECT-TYPE
+ SYNTAX Integer32 (0..10000)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The best estimate of the mean physical layer
+ network utilization on this interface during this
+ sampling interval, in hundredths of a percent."
+ ::= { etherHistoryEntry 15 }
+
+-- The Alarm Group
+
+-- Implementation of the Alarm group is optional. The Alarm Group
+-- requires the implementation of the Event group.
+-- Consult the MODULE-COMPLIANCE macro for the authoritative
+-- conformance information for this MIB.
+--
+-- The Alarm group periodically takes statistical samples from
+-- variables in the probe and compares them to thresholds that have
+-- been configured. The alarm table stores configuration
+-- entries that each define a variable, polling period, and
+-- threshold parameters. If a sample is found to cross the
+-- threshold values, an event is generated. Only variables that
+-- resolve to an ASN.1 primitive type of INTEGER (INTEGER, Integer32,
+-- Counter32, Counter64, Gauge32, or TimeTicks) may be monitored in
+-- this way.
+--
+-- This function has a hysteresis mechanism to limit the generation
+-- of events. This mechanism generates one event as a threshold
+-- is crossed in the appropriate direction. No more events are
+-- generated for that threshold until the opposite threshold is
+-- crossed.
+--
+-- In the case of a sampling a deltaValue, a probe may implement
+-- this mechanism with more precision if it takes a delta sample
+-- twice per period, each time comparing the sum of the latest two
+-- samples to the threshold. This allows the detection of threshold
+-- crossings that span the sampling boundary. Note that this does
+-- not require any special configuration of the threshold value.
+-- It is suggested that probes implement this more precise algorithm.
+
+alarmTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF AlarmEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of alarm entries."
+ ::= { alarm 1 }
+
+alarmEntry OBJECT-TYPE
+ SYNTAX AlarmEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of parameters that set up a periodic checking
+ for alarm conditions. For example, an instance of the
+ alarmValue object might be named alarmValue.8"
+ INDEX { alarmIndex }
+ ::= { alarmTable 1 }
+
+AlarmEntry ::= SEQUENCE {
+ alarmIndex Integer32,
+ alarmInterval Integer32,
+ alarmVariable OBJECT IDENTIFIER,
+ alarmSampleType INTEGER,
+ alarmValue Integer32,
+ alarmStartupAlarm INTEGER,
+ alarmRisingThreshold Integer32,
+ alarmFallingThreshold Integer32,
+ alarmRisingEventIndex Integer32,
+ alarmFallingEventIndex Integer32,
+ alarmOwner OwnerString,
+ alarmStatus EntryStatus
+}
+
+alarmIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that uniquely identifies an entry in the
+ alarm table. Each such entry defines a
+ diagnostic sample at a particular interval
+ for an object on the device."
+ ::= { alarmEntry 1 }
+
+alarmInterval OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "Seconds"
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The interval in seconds over which the data is
+ sampled and compared with the rising and falling
+ thresholds. When setting this variable, care
+ should be taken in the case of deltaValue
+ sampling - the interval should be set short enough
+ that the sampled variable is very unlikely to
+ increase or decrease by more than 2^31 - 1 during
+ a single sampling interval.
+
+ This object may not be modified if the associated
+ alarmStatus object is equal to valid(1)."
+ ::= { alarmEntry 2 }
+
+alarmVariable OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The object identifier of the particular variable to be
+ sampled. Only variables that resolve to an ASN.1 primitive
+ type of INTEGER (INTEGER, Integer32, Counter32, Counter64,
+ Gauge, or TimeTicks) may be sampled.
+
+ Because SNMP access control is articulated entirely
+ in terms of the contents of MIB views, no access
+ control mechanism exists that can restrict the value of
+ this object to identify only those objects that exist
+ in a particular MIB view. Because there is thus no
+ acceptable means of restricting the read access that
+ could be obtained through the alarm mechanism, the
+ probe must only grant write access to this object in
+ those views that have read access to all objects on
+ the probe.
+
+ During a set operation, if the supplied variable name is
+ not available in the selected MIB view, a badValue error
+ must be returned. If at any time the variable name of
+ an established alarmEntry is no longer available in the
+ selected MIB view, the probe must change the status of
+ this alarmEntry to invalid(4).
+
+ This object may not be modified if the associated
+ alarmStatus object is equal to valid(1)."
+ ::= { alarmEntry 3 }
+
+alarmSampleType OBJECT-TYPE
+ SYNTAX INTEGER {
+ absoluteValue(1),
+ deltaValue(2)
+ }
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The method of sampling the selected variable and
+ calculating the value to be compared against the
+ thresholds. If the value of this object is
+ absoluteValue(1), the value of the selected variable
+ will be compared directly with the thresholds at the
+ end of the sampling interval. If the value of this
+ object is deltaValue(2), the value of the selected
+ variable at the last sample will be subtracted from
+ the current value, and the difference compared with
+ the thresholds.
+
+ This object may not be modified if the associated
+ alarmStatus object is equal to valid(1)."
+ ::= { alarmEntry 4 }
+
+alarmValue OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value of the statistic during the last sampling
+ period. For example, if the sample type is deltaValue,
+ this value will be the difference between the samples
+ at the beginning and end of the period. If the sample
+ type is absoluteValue, this value will be the sampled
+ value at the end of the period.
+ This is the value that is compared with the rising and
+ falling thresholds.
+
+ The value during the current sampling period is not
+ made available until the period is completed and will
+ remain available until the next period completes."
+ ::= { alarmEntry 5 }
+
+alarmStartupAlarm OBJECT-TYPE
+ SYNTAX INTEGER {
+ risingAlarm(1),
+ fallingAlarm(2),
+ risingOrFallingAlarm(3)
+ }
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The alarm that may be sent when this entry is first
+ set to valid. If the first sample after this entry
+ becomes valid is greater than or equal to the
+ risingThreshold and alarmStartupAlarm is equal to
+ risingAlarm(1) or risingOrFallingAlarm(3), then a single
+ rising alarm will be generated. If the first sample
+ after this entry becomes valid is less than or equal
+ to the fallingThreshold and alarmStartupAlarm is equal
+ to fallingAlarm(2) or risingOrFallingAlarm(3), then a
+ single falling alarm will be generated.
+
+ This object may not be modified if the associated
+ alarmStatus object is equal to valid(1)."
+ ::= { alarmEntry 6 }
+
+alarmRisingThreshold OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "A threshold for the sampled statistic. When the current
+ sampled value is greater than or equal to this threshold,
+ and the value at the last sampling interval was less than
+ this threshold, a single event will be generated.
+ A single event will also be generated if the first
+ sample after this entry becomes valid is greater than or
+ equal to this threshold and the associated
+ alarmStartupAlarm is equal to risingAlarm(1) or
+ risingOrFallingAlarm(3).
+
+ After a rising event is generated, another such event
+ will not be generated until the sampled value
+ falls below this threshold and reaches the
+ alarmFallingThreshold.
+
+ This object may not be modified if the associated
+ alarmStatus object is equal to valid(1)."
+ ::= { alarmEntry 7 }
+
+alarmFallingThreshold OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "A threshold for the sampled statistic. When the current
+ sampled value is less than or equal to this threshold,
+ and the value at the last sampling interval was greater than
+ this threshold, a single event will be generated.
+ A single event will also be generated if the first
+ sample after this entry becomes valid is less than or
+ equal to this threshold and the associated
+ alarmStartupAlarm is equal to fallingAlarm(2) or
+ risingOrFallingAlarm(3).
+
+ After a falling event is generated, another such event
+ will not be generated until the sampled value
+ rises above this threshold and reaches the
+ alarmRisingThreshold.
+
+ This object may not be modified if the associated
+ alarmStatus object is equal to valid(1)."
+ ::= { alarmEntry 8 }
+
+alarmRisingEventIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..65535)
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The index of the eventEntry that is
+ used when a rising threshold is crossed. The
+ eventEntry identified by a particular value of
+ this index is the same as identified by the same value
+ of the eventIndex object. If there is no
+ corresponding entry in the eventTable, then
+ no association exists. In particular, if this value
+ is zero, no associated event will be generated, as
+ zero is not a valid event index.
+
+ This object may not be modified if the associated
+ alarmStatus object is equal to valid(1)."
+ ::= { alarmEntry 9 }
+
+alarmFallingEventIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..65535)
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The index of the eventEntry that is
+ used when a falling threshold is crossed. The
+ eventEntry identified by a particular value of
+ this index is the same as identified by the same value
+ of the eventIndex object. If there is no
+ corresponding entry in the eventTable, then
+ no association exists. In particular, if this value
+ is zero, no associated event will be generated, as
+ zero is not a valid event index.
+
+ This object may not be modified if the associated
+ alarmStatus object is equal to valid(1)."
+ ::= { alarmEntry 10 }
+
+alarmOwner OBJECT-TYPE
+ SYNTAX OwnerString
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The entity that configured this entry and is therefore
+ using the resources assigned to it."
+ ::= { alarmEntry 11 }
+
+alarmStatus OBJECT-TYPE
+ SYNTAX EntryStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The status of this alarm entry."
+ ::= { alarmEntry 12 }
+
+-- The Host Group
+
+-- Implementation of the Host group is optional.
+-- Consult the MODULE-COMPLIANCE macro for the authoritative
+-- conformance information for this MIB.
+--
+-- The host group discovers new hosts on the network by
+-- keeping a list of source and destination MAC Addresses seen
+-- in good packets. For each of these addresses, the host group
+-- keeps a set of statistics. The hostControlTable controls
+-- which interfaces this function is performed on, and contains
+-- some information about the process. On behalf of each
+-- hostControlEntry, data is collected on an interface and placed
+-- in both the hostTable and the hostTimeTable. If the
+-- monitoring device finds itself short of resources, it may
+-- delete entries as needed. It is suggested that the device
+-- delete the least recently used entries first.
+
+-- The hostTable contains entries for each address discovered on
+-- a particular interface. Each entry contains statistical
+-- data about that host. This table is indexed by the
+-- MAC address of the host, through which a random access
+-- may be achieved.
+
+-- The hostTimeTable contains data in the same format as the
+-- hostTable, and must contain the same set of hosts, but is
+-- indexed using hostTimeCreationOrder rather than hostAddress.
+-- The hostTimeCreationOrder is an integer which reflects
+-- the relative order in which a particular entry was discovered
+-- and thus inserted into the table. As this order, and thus
+-- the index, is among those entries currently in the table,
+-- the index for a particular entry may change if an
+-- (earlier) entry is deleted. Thus the association between
+-- hostTimeCreationOrder and hostTimeEntry may be broken at
+-- any time.
+
+-- The hostTimeTable has two important uses. The first is the
+-- fast download of this potentially large table. Because the
+-- index of this table runs from 1 to the size of the table,
+-- inclusive, its values are predictable. This allows very
+-- efficient packing of variables into SNMP PDU's and allows
+-- a table transfer to have multiple packets outstanding.
+-- These benefits increase transfer rates tremendously.
+
+-- The second use of the hostTimeTable is the efficient discovery
+-- by the management station of new entries added to the table.
+-- After the management station has downloaded the entire table,
+-- it knows that new entries will be added immediately after the
+-- end of the current table. It can thus detect new entries there
+-- and retrieve them easily.
+
+-- Because the association between hostTimeCreationOrder and
+-- hostTimeEntry may be broken at any time, the management
+-- station must monitor the related hostControlLastDeleteTime
+-- object. When the management station thus detects a deletion,
+-- it must assume that any such associations have been broken,
+-- and invalidate any it has stored locally. This includes
+-- restarting any download of the hostTimeTable that may have been
+-- in progress, as well as rediscovering the end of the
+-- hostTimeTable so that it may detect new entries. If the
+-- management station does not detect the broken association,
+-- it may continue to refer to a particular host by its
+-- creationOrder while unwittingly retrieving the data associated
+-- with another host entirely. If this happens while downloading
+-- the host table, the management station may fail to download
+-- all of the entries in the table.
+
+
+hostControlTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF HostControlEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of host table control entries."
+ ::= { hosts 1 }
+
+hostControlEntry OBJECT-TYPE
+ SYNTAX HostControlEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of parameters that set up the discovery of hosts
+ on a particular interface and the collection of statistics
+ about these hosts. For example, an instance of the
+ hostControlTableSize object might be named
+ hostControlTableSize.1"
+ INDEX { hostControlIndex }
+ ::= { hostControlTable 1 }
+
+HostControlEntry ::= SEQUENCE {
+
+ hostControlIndex Integer32,
+ hostControlDataSource OBJECT IDENTIFIER,
+ hostControlTableSize Integer32,
+ hostControlLastDeleteTime TimeTicks,
+ hostControlOwner OwnerString,
+ hostControlStatus EntryStatus
+}
+
+hostControlIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that uniquely identifies an entry in the
+ hostControl table. Each such entry defines
+ a function that discovers hosts on a particular interface
+ and places statistics about them in the hostTable and
+ the hostTimeTable on behalf of this hostControlEntry."
+ ::= { hostControlEntry 1 }
+
+hostControlDataSource OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "This object identifies the source of the data for
+ this instance of the host function. This source
+ can be any interface on this device. In order
+ to identify a particular interface, this object shall
+ identify the instance of the ifIndex object, defined
+ in RFC 2233 [17], for the desired interface.
+ For example, if an entry were to receive data from
+ interface #1, this object would be set to ifIndex.1.
+
+ The statistics in this group reflect all packets
+ on the local network segment attached to the identified
+ interface.
+
+ An agent may or may not be able to tell if fundamental
+ changes to the media of the interface have occurred and
+ necessitate an invalidation of this entry. For example, a
+ hot-pluggable ethernet card could be pulled out and replaced
+ by a token-ring card. In such a case, if the agent has such
+ knowledge of the change, it is recommended that it
+ invalidate this entry.
+
+ This object may not be modified if the associated
+ hostControlStatus object is equal to valid(1)."
+ ::= { hostControlEntry 2 }
+
+hostControlTableSize OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of hostEntries in the hostTable and the
+ hostTimeTable associated with this hostControlEntry."
+ ::= { hostControlEntry 3 }
+
+hostControlLastDeleteTime OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value of sysUpTime when the last entry
+ was deleted from the portion of the hostTable
+ associated with this hostControlEntry. If no
+ deletions have occurred, this value shall be zero."
+ ::= { hostControlEntry 4 }
+
+hostControlOwner OBJECT-TYPE
+ SYNTAX OwnerString
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The entity that configured this entry and is therefore
+ using the resources assigned to it."
+ ::= { hostControlEntry 5 }
+
+hostControlStatus OBJECT-TYPE
+ SYNTAX EntryStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The status of this hostControl entry.
+
+ If this object is not equal to valid(1), all associated
+ entries in the hostTable, hostTimeTable, and the
+ hostTopNTable shall be deleted by the agent."
+ ::= { hostControlEntry 6 }
+
+hostTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF HostEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of host entries."
+ ::= { hosts 2 }
+
+hostEntry OBJECT-TYPE
+ SYNTAX HostEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A collection of statistics for a particular host that has
+ been discovered on an interface of this device. For example,
+ an instance of the hostOutBroadcastPkts object might be
+ named hostOutBroadcastPkts.1.6.8.0.32.27.3.176"
+ INDEX { hostIndex, hostAddress }
+ ::= { hostTable 1 }
+
+HostEntry ::= SEQUENCE {
+ hostAddress OCTET STRING,
+ hostCreationOrder Integer32,
+ hostIndex Integer32,
+ hostInPkts Counter32,
+ hostOutPkts Counter32,
+ hostInOctets Counter32,
+ hostOutOctets Counter32,
+ hostOutErrors Counter32,
+ hostOutBroadcastPkts Counter32,
+ hostOutMulticastPkts Counter32
+}
+
+hostAddress OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The physical address of this host."
+ ::= { hostEntry 1 }
+
+hostCreationOrder OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that defines the relative ordering of
+ the creation time of hosts captured for a
+ particular hostControlEntry. This index shall
+ be between 1 and N, where N is the value of
+ the associated hostControlTableSize. The ordering
+ of the indexes is based on the order of each entry's
+ insertion into the table, in which entries added earlier
+ have a lower index value than entries added later.
+
+ It is important to note that the order for a
+ particular entry may change as an (earlier) entry
+ is deleted from the table. Because this order may
+ change, management stations should make use of the
+ hostControlLastDeleteTime variable in the
+ hostControlEntry associated with the relevant
+ portion of the hostTable. By observing
+ this variable, the management station may detect
+ the circumstances where a previous association
+ between a value of hostCreationOrder
+ and a hostEntry may no longer hold."
+ ::= { hostEntry 2 }
+
+hostIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The set of collected host statistics of which
+ this entry is a part. The set of hosts
+ identified by a particular value of this
+ index is associated with the hostControlEntry
+ as identified by the same value of hostControlIndex."
+ ::= { hostEntry 3 }
+
+hostInPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of good packets transmitted to this
+ address since it was added to the hostTable."
+ ::= { hostEntry 4 }
+
+hostOutPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of packets, including bad packets, transmitted
+ by this address since it was added to the hostTable."
+ ::= { hostEntry 5 }
+
+hostInOctets OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Octets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of octets transmitted to this address since
+ it was added to the hostTable (excluding framing
+ bits but including FCS octets), except for those
+ octets in bad packets."
+ ::= { hostEntry 6 }
+
+hostOutOctets OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Octets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of octets transmitted by this address since
+ it was added to the hostTable (excluding framing
+ bits but including FCS octets), including those
+ octets in bad packets."
+ ::= { hostEntry 7 }
+
+hostOutErrors OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of bad packets transmitted by this address
+ since this host was added to the hostTable."
+ ::= { hostEntry 8 }
+
+hostOutBroadcastPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of good packets transmitted by this
+ address that were directed to the broadcast address
+ since this host was added to the hostTable."
+ ::= { hostEntry 9 }
+
+hostOutMulticastPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of good packets transmitted by this
+ address that were directed to a multicast address
+ since this host was added to the hostTable.
+ Note that this number does not include packets
+ directed to the broadcast address."
+ ::= { hostEntry 10 }
+
+-- host Time Table
+
+hostTimeTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF HostTimeEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of time-ordered host table entries."
+ ::= { hosts 3 }
+
+hostTimeEntry OBJECT-TYPE
+ SYNTAX HostTimeEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A collection of statistics for a particular host that has
+ been discovered on an interface of this device. This
+ collection includes the relative ordering of the creation
+ time of this object. For example, an instance of the
+ hostTimeOutBroadcastPkts object might be named
+ hostTimeOutBroadcastPkts.1.687"
+ INDEX { hostTimeIndex, hostTimeCreationOrder }
+ ::= { hostTimeTable 1 }
+
+HostTimeEntry ::= SEQUENCE {
+ hostTimeAddress OCTET STRING,
+ hostTimeCreationOrder Integer32,
+ hostTimeIndex Integer32,
+ hostTimeInPkts Counter32,
+ hostTimeOutPkts Counter32,
+ hostTimeInOctets Counter32,
+ hostTimeOutOctets Counter32,
+ hostTimeOutErrors Counter32,
+ hostTimeOutBroadcastPkts Counter32,
+ hostTimeOutMulticastPkts Counter32
+}
+
+hostTimeAddress OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The physical address of this host."
+ ::= { hostTimeEntry 1 }
+
+hostTimeCreationOrder OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that uniquely identifies an entry in
+ the hostTime table among those entries associated
+ with the same hostControlEntry. This index shall
+ be between 1 and N, where N is the value of
+ the associated hostControlTableSize. The ordering
+ of the indexes is based on the order of each entry's
+ insertion into the table, in which entries added earlier
+ have a lower index value than entries added later.
+ Thus the management station has the ability to
+ learn of new entries added to this table without
+ downloading the entire table.
+
+ It is important to note that the index for a
+ particular entry may change as an (earlier) entry
+ is deleted from the table. Because this order may
+ change, management stations should make use of the
+ hostControlLastDeleteTime variable in the
+ hostControlEntry associated with the relevant
+ portion of the hostTimeTable. By observing
+ this variable, the management station may detect
+ the circumstances where a download of the table
+ may have missed entries, and where a previous
+ association between a value of hostTimeCreationOrder
+ and a hostTimeEntry may no longer hold."
+ ::= { hostTimeEntry 2 }
+
+hostTimeIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The set of collected host statistics of which
+ this entry is a part. The set of hosts
+ identified by a particular value of this
+ index is associated with the hostControlEntry
+ as identified by the same value of hostControlIndex."
+ ::= { hostTimeEntry 3 }
+
+hostTimeInPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of good packets transmitted to this
+ address since it was added to the hostTimeTable."
+ ::= { hostTimeEntry 4 }
+
+hostTimeOutPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of packets, including bad packets, transmitted
+ by this address since it was added to the hostTimeTable."
+ ::= { hostTimeEntry 5 }
+
+hostTimeInOctets OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Octets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of octets transmitted to this address since
+ it was added to the hostTimeTable (excluding framing
+ bits but including FCS octets), except for those
+ octets in bad packets."
+ ::= { hostTimeEntry 6 }
+
+hostTimeOutOctets OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Octets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of octets transmitted by this address since
+ it was added to the hostTimeTable (excluding framing
+ bits but including FCS octets), including those
+ octets in bad packets."
+ ::= { hostTimeEntry 7 }
+
+hostTimeOutErrors OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of bad packets transmitted by this address
+ since this host was added to the hostTimeTable."
+ ::= { hostTimeEntry 8 }
+
+hostTimeOutBroadcastPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of good packets transmitted by this
+ address that were directed to the broadcast address
+ since this host was added to the hostTimeTable."
+ ::= { hostTimeEntry 9 }
+
+hostTimeOutMulticastPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of good packets transmitted by this
+ address that were directed to a multicast address
+ since this host was added to the hostTimeTable.
+ Note that this number does not include packets directed
+ to the broadcast address."
+ ::= { hostTimeEntry 10 }
+
+-- The Host Top "N" Group
+
+-- Implementation of the Host Top N group is optional. The Host Top N
+-- group requires the implementation of the host group.
+-- Consult the MODULE-COMPLIANCE macro for the authoritative
+-- conformance information for this MIB.
+--
+-- The Host Top N group is used to prepare reports that describe
+-- the hosts that top a list ordered by one of their statistics.
+-- The available statistics are samples of one of their
+-- base statistics, over an interval specified by the management
+-- station. Thus, these statistics are rate based. The management
+-- station also selects how many such hosts are reported.
+
+-- The hostTopNControlTable is used to initiate the generation of
+-- such a report. The management station may select the parameters
+-- of such a report, such as which interface, which statistic,
+-- how many hosts, and the start and stop times of the sampling.
+-- When the report is prepared, entries are created in the
+-- hostTopNTable associated with the relevant hostTopNControlEntry.
+-- These entries are static for each report after it has been
+-- prepared.
+
+hostTopNControlTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF HostTopNControlEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of top N host control entries."
+ ::= { hostTopN 1 }
+
+hostTopNControlEntry OBJECT-TYPE
+ SYNTAX HostTopNControlEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A set of parameters that control the creation of a report
+ of the top N hosts according to several metrics. For
+ example, an instance of the hostTopNDuration object might
+ be named hostTopNDuration.3"
+ INDEX { hostTopNControlIndex }
+ ::= { hostTopNControlTable 1 }
+
+HostTopNControlEntry ::= SEQUENCE {
+ hostTopNControlIndex Integer32,
+ hostTopNHostIndex Integer32,
+ hostTopNRateBase INTEGER,
+ hostTopNTimeRemaining Integer32,
+ hostTopNDuration Integer32,
+ hostTopNRequestedSize Integer32,
+ hostTopNGrantedSize Integer32,
+ hostTopNStartTime TimeTicks,
+ hostTopNOwner OwnerString,
+ hostTopNStatus EntryStatus
+}
+
+hostTopNControlIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that uniquely identifies an entry
+ in the hostTopNControl table. Each such
+ entry defines one top N report prepared for
+ one interface."
+ ::= { hostTopNControlEntry 1 }
+
+hostTopNHostIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The host table for which a top N report will be prepared
+ on behalf of this entry. The host table identified by a
+ particular value of this index is associated with the same
+ host table as identified by the same value of
+ hostIndex.
+
+ This object may not be modified if the associated
+ hostTopNStatus object is equal to valid(1)."
+ ::= { hostTopNControlEntry 2 }
+
+hostTopNRateBase OBJECT-TYPE
+ SYNTAX INTEGER {
+ hostTopNInPkts(1),
+ hostTopNOutPkts(2),
+ hostTopNInOctets(3),
+ hostTopNOutOctets(4),
+ hostTopNOutErrors(5),
+ hostTopNOutBroadcastPkts(6),
+ hostTopNOutMulticastPkts(7)
+ }
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The variable for each host that the hostTopNRate
+ variable is based upon.
+
+ This object may not be modified if the associated
+ hostTopNStatus object is equal to valid(1)."
+ ::= { hostTopNControlEntry 3 }
+
+hostTopNTimeRemaining OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "Seconds"
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The number of seconds left in the report currently being
+ collected. When this object is modified by the management
+ station, a new collection is started, possibly aborting
+ a currently running report. The new value is used
+ as the requested duration of this report, which is
+ loaded into the associated hostTopNDuration object.
+
+ When this object is set to a non-zero value, any
+ associated hostTopNEntries shall be made
+ inaccessible by the monitor. While the value of this
+ object is non-zero, it decrements by one per second until
+ it reaches zero. During this time, all associated
+ hostTopNEntries shall remain inaccessible. At the time
+ that this object decrements to zero, the report is made
+ accessible in the hostTopNTable. Thus, the hostTopN
+ table needs to be created only at the end of the collection
+ interval."
+ DEFVAL { 0 }
+ ::= { hostTopNControlEntry 4 }
+
+hostTopNDuration OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "Seconds"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of seconds that this report has collected
+ during the last sampling interval, or if this
+ report is currently being collected, the number
+ of seconds that this report is being collected
+ during this sampling interval.
+
+ When the associated hostTopNTimeRemaining object is set,
+ this object shall be set by the probe to the same value
+ and shall not be modified until the next time
+ the hostTopNTimeRemaining is set.
+
+ This value shall be zero if no reports have been
+ requested for this hostTopNControlEntry."
+ DEFVAL { 0 }
+ ::= { hostTopNControlEntry 5 }
+
+hostTopNRequestedSize OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The maximum number of hosts requested for the top N
+ table.
+
+ When this object is created or modified, the probe
+ should set hostTopNGrantedSize as closely to this
+ object as is possible for the particular probe
+ implementation and available resources."
+ DEFVAL { 10 }
+ ::= { hostTopNControlEntry 6 }
+
+hostTopNGrantedSize OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The maximum number of hosts in the top N table.
+
+ When the associated hostTopNRequestedSize object is
+ created or modified, the probe should set this
+ object as closely to the requested value as is possible
+ for the particular implementation and available
+ resources. The probe must not lower this value except
+ as a result of a set to the associated
+ hostTopNRequestedSize object.
+
+ Hosts with the highest value of hostTopNRate shall be
+ placed in this table in decreasing order of this rate
+ until there is no more room or until there are no more
+ hosts."
+ ::= { hostTopNControlEntry 7 }
+
+hostTopNStartTime OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value of sysUpTime when this top N report was
+ last started. In other words, this is the time that
+ the associated hostTopNTimeRemaining object was
+ modified to start the requested report."
+ ::= { hostTopNControlEntry 8 }
+
+hostTopNOwner OBJECT-TYPE
+ SYNTAX OwnerString
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The entity that configured this entry and is therefore
+ using the resources assigned to it."
+ ::= { hostTopNControlEntry 9 }
+
+hostTopNStatus OBJECT-TYPE
+ SYNTAX EntryStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The status of this hostTopNControl entry.
+
+ If this object is not equal to valid(1), all associated
+ hostTopNEntries shall be deleted by the agent."
+ ::= { hostTopNControlEntry 10 }
+
+hostTopNTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF HostTopNEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of top N host entries."
+ ::= { hostTopN 2 }
+
+hostTopNEntry OBJECT-TYPE
+ SYNTAX HostTopNEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A set of statistics for a host that is part of a top N
+ report. For example, an instance of the hostTopNRate
+ object might be named hostTopNRate.3.10"
+ INDEX { hostTopNReport, hostTopNIndex }
+ ::= { hostTopNTable 1 }
+
+HostTopNEntry ::= SEQUENCE {
+ hostTopNReport Integer32,
+ hostTopNIndex Integer32,
+ hostTopNAddress OCTET STRING,
+ hostTopNRate Integer32
+}
+
+hostTopNReport OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "This object identifies the top N report of which
+ this entry is a part. The set of hosts
+ identified by a particular value of this
+ object is part of the same report as identified
+ by the same value of the hostTopNControlIndex object."
+ ::= { hostTopNEntry 1 }
+
+hostTopNIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that uniquely identifies an entry in
+ the hostTopN table among those in the same report.
+ This index is between 1 and N, where N is the
+ number of entries in this table. Increasing values
+ of hostTopNIndex shall be assigned to entries with
+ decreasing values of hostTopNRate until index N
+ is assigned to the entry with the lowest value of
+ hostTopNRate or there are no more hostTopNEntries."
+ ::= { hostTopNEntry 2 }
+
+hostTopNAddress OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The physical address of this host."
+ ::= { hostTopNEntry 3 }
+
+hostTopNRate OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The amount of change in the selected variable
+ during this sampling interval. The selected
+ variable is this host's instance of the object
+ selected by hostTopNRateBase."
+ ::= { hostTopNEntry 4 }
+
+-- The Matrix Group
+
+-- Implementation of the Matrix group is optional.
+-- Consult the MODULE-COMPLIANCE macro for the authoritative
+-- conformance information for this MIB.
+--
+-- The Matrix group consists of the matrixControlTable, matrixSDTable
+-- and the matrixDSTable. These tables store statistics for a
+-- particular conversation between two addresses. As the device
+-- detects a new conversation, including those to a non-unicast
+-- address, it creates a new entry in both of the matrix tables.
+-- It must only create new entries based on information
+-- received in good packets. If the monitoring device finds
+-- itself short of resources, it may delete entries as needed.
+-- It is suggested that the device delete the least recently used
+-- entries first.
+
+matrixControlTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF MatrixControlEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of information entries for the
+ traffic matrix on each interface."
+ ::= { matrix 1 }
+
+matrixControlEntry OBJECT-TYPE
+ SYNTAX MatrixControlEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Information about a traffic matrix on a particular
+ interface. For example, an instance of the
+ matrixControlLastDeleteTime object might be named
+ matrixControlLastDeleteTime.1"
+ INDEX { matrixControlIndex }
+ ::= { matrixControlTable 1 }
+
+MatrixControlEntry ::= SEQUENCE {
+ matrixControlIndex Integer32,
+ matrixControlDataSource OBJECT IDENTIFIER,
+ matrixControlTableSize Integer32,
+ matrixControlLastDeleteTime TimeTicks,
+ matrixControlOwner OwnerString,
+ matrixControlStatus EntryStatus
+}
+
+matrixControlIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that uniquely identifies an entry in the
+ matrixControl table. Each such entry defines
+ a function that discovers conversations on a particular
+ interface and places statistics about them in the
+ matrixSDTable and the matrixDSTable on behalf of this
+ matrixControlEntry."
+ ::= { matrixControlEntry 1 }
+
+matrixControlDataSource OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "This object identifies the source of
+ the data from which this entry creates a traffic matrix.
+ This source can be any interface on this device. In
+ order to identify a particular interface, this object
+ shall identify the instance of the ifIndex object,
+ defined in RFC 2233 [17], for the desired
+ interface. For example, if an entry were to receive data
+ from interface #1, this object would be set to ifIndex.1.
+
+ The statistics in this group reflect all packets
+ on the local network segment attached to the identified
+ interface.
+
+ An agent may or may not be able to tell if fundamental
+ changes to the media of the interface have occurred and
+ necessitate an invalidation of this entry. For example, a
+ hot-pluggable ethernet card could be pulled out and replaced
+ by a token-ring card. In such a case, if the agent has such
+ knowledge of the change, it is recommended that it
+ invalidate this entry.
+
+ This object may not be modified if the associated
+ matrixControlStatus object is equal to valid(1)."
+ ::= { matrixControlEntry 2 }
+
+matrixControlTableSize OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of matrixSDEntries in the matrixSDTable
+ for this interface. This must also be the value of
+ the number of entries in the matrixDSTable for this
+ interface."
+ ::= { matrixControlEntry 3 }
+
+matrixControlLastDeleteTime OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value of sysUpTime when the last entry
+ was deleted from the portion of the matrixSDTable
+ or matrixDSTable associated with this matrixControlEntry.
+ If no deletions have occurred, this value shall be
+ zero."
+ ::= { matrixControlEntry 4 }
+
+matrixControlOwner OBJECT-TYPE
+ SYNTAX OwnerString
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The entity that configured this entry and is therefore
+ using the resources assigned to it."
+ ::= { matrixControlEntry 5 }
+
+matrixControlStatus OBJECT-TYPE
+ SYNTAX EntryStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The status of this matrixControl entry.
+ If this object is not equal to valid(1), all associated
+ entries in the matrixSDTable and the matrixDSTable
+ shall be deleted by the agent."
+ ::= { matrixControlEntry 6 }
+
+matrixSDTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF MatrixSDEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of traffic matrix entries indexed by
+ source and destination MAC address."
+ ::= { matrix 2 }
+
+matrixSDEntry OBJECT-TYPE
+ SYNTAX MatrixSDEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A collection of statistics for communications between
+ two addresses on a particular interface. For example,
+ an instance of the matrixSDPkts object might be named
+ matrixSDPkts.1.6.8.0.32.27.3.176.6.8.0.32.10.8.113"
+ INDEX { matrixSDIndex,
+ matrixSDSourceAddress, matrixSDDestAddress }
+ ::= { matrixSDTable 1 }
+
+MatrixSDEntry ::= SEQUENCE {
+ matrixSDSourceAddress OCTET STRING,
+ matrixSDDestAddress OCTET STRING,
+ matrixSDIndex Integer32,
+ matrixSDPkts Counter32,
+ matrixSDOctets Counter32,
+ matrixSDErrors Counter32
+}
+
+matrixSDSourceAddress OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The source physical address."
+ ::= { matrixSDEntry 1 }
+
+matrixSDDestAddress OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The destination physical address."
+ ::= { matrixSDEntry 2 }
+
+matrixSDIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The set of collected matrix statistics of which
+ this entry is a part. The set of matrix statistics
+ identified by a particular value of this index
+ is associated with the same matrixControlEntry
+ as identified by the same value of matrixControlIndex."
+ ::= { matrixSDEntry 3 }
+
+matrixSDPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of packets transmitted from the source
+ address to the destination address (this number includes
+ bad packets)."
+ ::= { matrixSDEntry 4 }
+
+matrixSDOctets OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Octets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of octets (excluding framing bits but
+ including FCS octets) contained in all packets
+ transmitted from the source address to the
+ destination address."
+ ::= { matrixSDEntry 5 }
+
+matrixSDErrors OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of bad packets transmitted from
+ the source address to the destination address."
+ ::= { matrixSDEntry 6 }
+
+-- Traffic matrix tables from destination to source
+
+matrixDSTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF MatrixDSEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of traffic matrix entries indexed by
+ destination and source MAC address."
+ ::= { matrix 3 }
+
+matrixDSEntry OBJECT-TYPE
+ SYNTAX MatrixDSEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A collection of statistics for communications between
+ two addresses on a particular interface. For example,
+ an instance of the matrixSDPkts object might be named
+ matrixSDPkts.1.6.8.0.32.10.8.113.6.8.0.32.27.3.176"
+ INDEX { matrixDSIndex,
+ matrixDSDestAddress, matrixDSSourceAddress }
+ ::= { matrixDSTable 1 }
+
+MatrixDSEntry ::= SEQUENCE {
+ matrixDSSourceAddress OCTET STRING,
+ matrixDSDestAddress OCTET STRING,
+ matrixDSIndex Integer32,
+ matrixDSPkts Counter32,
+ matrixDSOctets Counter32,
+ matrixDSErrors Counter32
+}
+
+matrixDSSourceAddress OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The source physical address."
+ ::= { matrixDSEntry 1 }
+
+matrixDSDestAddress OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The destination physical address."
+ ::= { matrixDSEntry 2 }
+
+matrixDSIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The set of collected matrix statistics of which
+ this entry is a part. The set of matrix statistics
+ identified by a particular value of this index
+ is associated with the same matrixControlEntry
+ as identified by the same value of matrixControlIndex."
+ ::= { matrixDSEntry 3 }
+
+matrixDSPkts OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of packets transmitted from the source
+ address to the destination address (this number includes
+ bad packets)."
+ ::= { matrixDSEntry 4 }
+
+matrixDSOctets OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Octets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of octets (excluding framing bits
+ but including FCS octets) contained in all packets
+ transmitted from the source address to the
+ destination address."
+ ::= { matrixDSEntry 5 }
+
+matrixDSErrors OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of bad packets transmitted from
+ the source address to the destination address."
+ ::= { matrixDSEntry 6 }
+
+-- The Filter Group
+
+-- Implementation of the Filter group is optional.
+-- Consult the MODULE-COMPLIANCE macro for the authoritative
+-- conformance information for this MIB.
+--
+-- The Filter group allows packets to be captured with an
+-- arbitrary filter expression. A logical data and
+-- event stream or "channel" is formed by the packets
+-- that match the filter expression.
+--
+-- This filter mechanism allows the creation of an arbitrary
+-- logical expression with which to filter packets. Each
+-- filter associated with a channel is OR'ed with the others.
+-- Within a filter, any bits checked in the data and status are
+-- AND'ed with respect to other bits in the same filter. The
+-- NotMask also allows for checking for inequality. Finally,
+-- the channelAcceptType object allows for inversion of the
+-- whole equation.
+--
+-- If a management station wishes to receive a trap to alert it
+-- that new packets have been captured and are available for
+-- download, it is recommended that it set up an alarm entry that
+-- monitors the value of the relevant channelMatches instance.
+--
+-- The channel can be turned on or off, and can also
+-- generate events when packets pass through it.
+
+filterTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF FilterEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of packet filter entries."
+ ::= { filter 1 }
+
+filterEntry OBJECT-TYPE
+ SYNTAX FilterEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A set of parameters for a packet filter applied on a
+ particular interface. As an example, an instance of the
+ filterPktData object might be named filterPktData.12"
+ INDEX { filterIndex }
+ ::= { filterTable 1 }
+
+FilterEntry ::= SEQUENCE {
+ filterIndex Integer32,
+ filterChannelIndex Integer32,
+ filterPktDataOffset Integer32,
+ filterPktData OCTET STRING,
+ filterPktDataMask OCTET STRING,
+ filterPktDataNotMask OCTET STRING,
+ filterPktStatus Integer32,
+ filterPktStatusMask Integer32,
+ filterPktStatusNotMask Integer32,
+ filterOwner OwnerString,
+ filterStatus EntryStatus
+}
+
+filterIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that uniquely identifies an entry
+ in the filter table. Each such entry defines
+ one filter that is to be applied to every packet
+ received on an interface."
+ ::= { filterEntry 1 }
+
+filterChannelIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "This object identifies the channel of which this filter
+ is a part. The filters identified by a particular value
+ of this object are associated with the same channel as
+ identified by the same value of the channelIndex object."
+ ::= { filterEntry 2 }
+
+filterPktDataOffset OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "Octets"
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The offset from the beginning of each packet where
+ a match of packet data will be attempted. This offset
+ is measured from the point in the physical layer
+ packet after the framing bits, if any. For example,
+ in an Ethernet frame, this point is at the beginning of
+ the destination MAC address.
+
+ This object may not be modified if the associated
+ filterStatus object is equal to valid(1)."
+ DEFVAL { 0 }
+
+ ::= { filterEntry 3 }
+
+filterPktData OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The data that is to be matched with the input packet.
+ For each packet received, this filter and the accompanying
+ filterPktDataMask and filterPktDataNotMask will be
+ adjusted for the offset. The only bits relevant to this
+ match algorithm are those that have the corresponding
+ filterPktDataMask bit equal to one. The following three
+ rules are then applied to every packet:
+
+ (1) If the packet is too short and does not have data
+ corresponding to part of the filterPktData, the packet
+ will fail this data match.
+
+ (2) For each relevant bit from the packet with the
+ corresponding filterPktDataNotMask bit set to zero, if
+ the bit from the packet is not equal to the corresponding
+ bit from the filterPktData, then the packet will fail
+ this data match.
+
+ (3) If for every relevant bit from the packet with the
+ corresponding filterPktDataNotMask bit set to one, the
+ bit from the packet is equal to the corresponding bit
+ from the filterPktData, then the packet will fail this
+ data match.
+
+ Any packets that have not failed any of the three matches
+ above have passed this data match. In particular, a zero
+ length filter will match any packet.
+
+ This object may not be modified if the associated
+ filterStatus object is equal to valid(1)."
+ ::= { filterEntry 4 }
+
+filterPktDataMask OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The mask that is applied to the match process.
+ After adjusting this mask for the offset, only those
+ bits in the received packet that correspond to bits set
+ in this mask are relevant for further processing by the
+ match algorithm. The offset is applied to filterPktDataMask
+ in the same way it is applied to the filter. For the
+ purposes of the matching algorithm, if the associated
+ filterPktData object is longer than this mask, this mask is
+ conceptually extended with '1' bits until it reaches the
+ length of the filterPktData object.
+
+ This object may not be modified if the associated
+ filterStatus object is equal to valid(1)."
+ ::= { filterEntry 5 }
+
+filterPktDataNotMask OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The inversion mask that is applied to the match
+ process. After adjusting this mask for the offset,
+ those relevant bits in the received packet that correspond
+ to bits cleared in this mask must all be equal to their
+ corresponding bits in the filterPktData object for the packet
+ to be accepted. In addition, at least one of those relevant
+ bits in the received packet that correspond to bits set in
+ this mask must be different to its corresponding bit in the
+ filterPktData object.
+
+ For the purposes of the matching algorithm, if the associated
+ filterPktData object is longer than this mask, this mask is
+ conceptually extended with '0' bits until it reaches the
+ length of the filterPktData object.
+
+ This object may not be modified if the associated
+ filterStatus object is equal to valid(1)."
+ ::= { filterEntry 6 }
+
+filterPktStatus OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The status that is to be matched with the input packet.
+ The only bits relevant to this match algorithm are those that
+ have the corresponding filterPktStatusMask bit equal to one.
+ The following two rules are then applied to every packet:
+
+ (1) For each relevant bit from the packet status with the
+ corresponding filterPktStatusNotMask bit set to zero, if
+ the bit from the packet status is not equal to the
+ corresponding bit from the filterPktStatus, then the
+ packet will fail this status match.
+
+ (2) If for every relevant bit from the packet status with the
+ corresponding filterPktStatusNotMask bit set to one, the
+ bit from the packet status is equal to the corresponding
+ bit from the filterPktStatus, then the packet will fail
+ this status match.
+
+ Any packets that have not failed either of the two matches
+ above have passed this status match. In particular, a zero
+ length status filter will match any packet's status.
+
+ The value of the packet status is a sum. This sum
+ initially takes the value zero. Then, for each
+ error, E, that has been discovered in this packet,
+ 2 raised to a value representing E is added to the sum.
+ The errors and the bits that represent them are dependent
+ on the media type of the interface that this channel
+ is receiving packets from.
+
+ The errors defined for a packet captured off of an
+ Ethernet interface are as follows:
+
+ bit # Error
+ 0 Packet is longer than 1518 octets
+ 1 Packet is shorter than 64 octets
+ 2 Packet experienced a CRC or Alignment error
+
+ For example, an Ethernet fragment would have a
+ value of 6 (2^1 + 2^2).
+
+ As this MIB is expanded to new media types, this object
+ will have other media-specific errors defined.
+
+ For the purposes of this status matching algorithm, if the
+ packet status is longer than this filterPktStatus object,
+ this object is conceptually extended with '0' bits until it
+ reaches the size of the packet status.
+
+ This object may not be modified if the associated
+ filterStatus object is equal to valid(1)."
+ ::= { filterEntry 7 }
+
+filterPktStatusMask OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The mask that is applied to the status match process.
+ Only those bits in the received packet that correspond to
+ bits set in this mask are relevant for further processing
+ by the status match algorithm. For the purposes
+ of the matching algorithm, if the associated filterPktStatus
+ object is longer than this mask, this mask is conceptually
+ extended with '1' bits until it reaches the size of the
+ filterPktStatus. In addition, if a packet status is longer
+ than this mask, this mask is conceptually extended with '0'
+ bits until it reaches the size of the packet status.
+
+ This object may not be modified if the associated
+ filterStatus object is equal to valid(1)."
+ ::= { filterEntry 8 }
+
+filterPktStatusNotMask OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The inversion mask that is applied to the status match
+ process. Those relevant bits in the received packet status
+ that correspond to bits cleared in this mask must all be
+ equal to their corresponding bits in the filterPktStatus
+ object for the packet to be accepted. In addition, at least
+ one of those relevant bits in the received packet status
+ that correspond to bits set in this mask must be different
+ to its corresponding bit in the filterPktStatus object for
+ the packet to be accepted.
+
+ For the purposes of the matching algorithm, if the associated
+ filterPktStatus object or a packet status is longer than this
+ mask, this mask is conceptually extended with '0' bits until
+ it reaches the longer of the lengths of the filterPktStatus
+ object and the packet status.
+
+ This object may not be modified if the associated
+ filterStatus object is equal to valid(1)."
+ ::= { filterEntry 9 }
+
+filterOwner OBJECT-TYPE
+ SYNTAX OwnerString
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The entity that configured this entry and is therefore
+ using the resources assigned to it."
+ ::= { filterEntry 10 }
+
+filterStatus OBJECT-TYPE
+ SYNTAX EntryStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The status of this filter entry."
+ ::= { filterEntry 11 }
+
+channelTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF ChannelEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of packet channel entries."
+ ::= { filter 2 }
+
+channelEntry OBJECT-TYPE
+ SYNTAX ChannelEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A set of parameters for a packet channel applied on a
+ particular interface. As an example, an instance of the
+ channelMatches object might be named channelMatches.3"
+ INDEX { channelIndex }
+ ::= { channelTable 1 }
+
+ChannelEntry ::= SEQUENCE {
+ channelIndex Integer32,
+ channelIfIndex Integer32,
+ channelAcceptType INTEGER,
+ channelDataControl INTEGER,
+ channelTurnOnEventIndex Integer32,
+ channelTurnOffEventIndex Integer32,
+ channelEventIndex Integer32,
+ channelEventStatus INTEGER,
+ channelMatches Counter32,
+ channelDescription DisplayString,
+ channelOwner OwnerString,
+ channelStatus EntryStatus
+}
+
+channelIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that uniquely identifies an entry in the channel
+ table. Each such entry defines one channel, a logical
+ data and event stream.
+
+ It is suggested that before creating a channel, an
+ application should scan all instances of the
+ filterChannelIndex object to make sure that there are no
+ pre-existing filters that would be inadvertently be linked
+ to the channel."
+ ::= { channelEntry 1 }
+
+channelIfIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The value of this object uniquely identifies the
+ interface on this remote network monitoring device to which
+ the associated filters are applied to allow data into this
+ channel. The interface identified by a particular value
+ of this object is the same interface as identified by the
+ same value of the ifIndex object, defined in RFC 2233 [17].
+
+ The filters in this group are applied to all packets on
+ the local network segment attached to the identified
+ interface.
+
+ An agent may or may not be able to tell if fundamental
+ changes to the media of the interface have occurred and
+ necessitate an invalidation of this entry. For example, a
+ hot-pluggable ethernet card could be pulled out and replaced
+ by a token-ring card. In such a case, if the agent has such
+ knowledge of the change, it is recommended that it
+ invalidate this entry.
+
+ This object may not be modified if the associated
+ channelStatus object is equal to valid(1)."
+ ::= { channelEntry 2 }
+
+channelAcceptType OBJECT-TYPE
+ SYNTAX INTEGER {
+ acceptMatched(1),
+ acceptFailed(2)
+ }
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "This object controls the action of the filters
+ associated with this channel. If this object is equal
+ to acceptMatched(1), packets will be accepted to this
+ channel if they are accepted by both the packet data and
+ packet status matches of an associated filter. If
+ this object is equal to acceptFailed(2), packets will
+ be accepted to this channel only if they fail either
+ the packet data match or the packet status match of
+ each of the associated filters.
+
+ In particular, a channel with no associated filters will
+ match no packets if set to acceptMatched(1) case and will
+ match all packets in the acceptFailed(2) case.
+
+ This object may not be modified if the associated
+ channelStatus object is equal to valid(1)."
+ ::= { channelEntry 3 }
+
+channelDataControl OBJECT-TYPE
+ SYNTAX INTEGER {
+ on(1),
+ off(2)
+ }
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "This object controls the flow of data through this channel.
+ If this object is on(1), data, status and events flow
+ through this channel. If this object is off(2), data,
+ status and events will not flow through this channel."
+ DEFVAL { off }
+ ::= { channelEntry 4 }
+
+channelTurnOnEventIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..65535)
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The value of this object identifies the event
+ that is configured to turn the associated
+ channelDataControl from off to on when the event is
+ generated. The event identified by a particular value
+ of this object is the same event as identified by the
+ same value of the eventIndex object. If there is no
+ corresponding entry in the eventTable, then no
+ association exists. In fact, if no event is intended
+ for this channel, channelTurnOnEventIndex must be
+ set to zero, a non-existent event index.
+
+ This object may not be modified if the associated
+ channelStatus object is equal to valid(1)."
+ ::= { channelEntry 5 }
+
+channelTurnOffEventIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..65535)
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The value of this object identifies the event
+ that is configured to turn the associated
+ channelDataControl from on to off when the event is
+ generated. The event identified by a particular value
+ of this object is the same event as identified by the
+ same value of the eventIndex object. If there is no
+ corresponding entry in the eventTable, then no
+ association exists. In fact, if no event is intended
+ for this channel, channelTurnOffEventIndex must be
+ set to zero, a non-existent event index.
+
+ This object may not be modified if the associated
+ channelStatus object is equal to valid(1)."
+ ::= { channelEntry 6 }
+
+channelEventIndex OBJECT-TYPE
+ SYNTAX Integer32 (0..65535)
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The value of this object identifies the event
+ that is configured to be generated when the
+ associated channelDataControl is on and a packet
+ is matched. The event identified by a particular value
+ of this object is the same event as identified by the
+ same value of the eventIndex object. If there is no
+ corresponding entry in the eventTable, then no
+ association exists. In fact, if no event is intended
+ for this channel, channelEventIndex must be
+ set to zero, a non-existent event index.
+
+ This object may not be modified if the associated
+ channelStatus object is equal to valid(1)."
+ ::= { channelEntry 7 }
+
+channelEventStatus OBJECT-TYPE
+ SYNTAX INTEGER {
+ eventReady(1),
+ eventFired(2),
+ eventAlwaysReady(3)
+ }
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The event status of this channel.
+
+ If this channel is configured to generate events
+ when packets are matched, a means of controlling
+ the flow of those events is often needed. When
+ this object is equal to eventReady(1), a single
+ event may be generated, after which this object
+ will be set by the probe to eventFired(2). While
+ in the eventFired(2) state, no events will be
+ generated until the object is modified to
+ eventReady(1) (or eventAlwaysReady(3)). The
+ management station can thus easily respond to a
+ notification of an event by re-enabling this object.
+
+ If the management station wishes to disable this
+ flow control and allow events to be generated
+ at will, this object may be set to
+ eventAlwaysReady(3). Disabling the flow control
+ is discouraged as it can result in high network
+ traffic or other performance problems."
+ DEFVAL { eventReady }
+ ::= { channelEntry 8 }
+
+channelMatches OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of times this channel has matched a packet.
+ Note that this object is updated even when
+ channelDataControl is set to off."
+ ::= { channelEntry 9 }
+
+channelDescription OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..127))
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "A comment describing this channel."
+ ::= { channelEntry 10 }
+
+channelOwner OBJECT-TYPE
+ SYNTAX OwnerString
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The entity that configured this entry and is therefore
+ using the resources assigned to it."
+ ::= { channelEntry 11 }
+
+channelStatus OBJECT-TYPE
+ SYNTAX EntryStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The status of this channel entry."
+ ::= { channelEntry 12 }
+
+-- The Packet Capture Group
+
+-- Implementation of the Packet Capture group is optional. The Packet
+-- Capture Group requires implementation of the Filter Group.
+-- Consult the MODULE-COMPLIANCE macro for the authoritative
+-- conformance information for this MIB.
+--
+-- The Packet Capture group allows packets to be captured
+-- upon a filter match. The bufferControlTable controls
+-- the captured packets output from a channel that is
+-- associated with it. The captured packets are placed
+-- in entries in the captureBufferTable. These entries are
+-- associated with the bufferControlEntry on whose behalf they
+-- were stored.
+
+bufferControlTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF BufferControlEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of buffers control entries."
+ ::= { capture 1 }
+
+bufferControlEntry OBJECT-TYPE
+ SYNTAX BufferControlEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A set of parameters that control the collection of a stream
+ of packets that have matched filters. As an example, an
+ instance of the bufferControlCaptureSliceSize object might
+ be named bufferControlCaptureSliceSize.3"
+
+ INDEX { bufferControlIndex }
+ ::= { bufferControlTable 1 }
+
+BufferControlEntry ::= SEQUENCE {
+ bufferControlIndex Integer32,
+ bufferControlChannelIndex Integer32,
+ bufferControlFullStatus INTEGER,
+ bufferControlFullAction INTEGER,
+ bufferControlCaptureSliceSize Integer32,
+ bufferControlDownloadSliceSize Integer32,
+ bufferControlDownloadOffset Integer32,
+ bufferControlMaxOctetsRequested Integer32,
+ bufferControlMaxOctetsGranted Integer32,
+ bufferControlCapturedPackets Integer32,
+ bufferControlTurnOnTime TimeTicks,
+ bufferControlOwner OwnerString,
+ bufferControlStatus EntryStatus
+}
+
+bufferControlIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that uniquely identifies an entry
+ in the bufferControl table. The value of this
+ index shall never be zero. Each such
+ entry defines one set of packets that is
+ captured and controlled by one or more filters."
+ ::= { bufferControlEntry 1 }
+
+bufferControlChannelIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "An index that identifies the channel that is the
+ source of packets for this bufferControl table.
+ The channel identified by a particular value of this
+ index is the same as identified by the same value of
+ the channelIndex object.
+
+ This object may not be modified if the associated
+ bufferControlStatus object is equal to valid(1)."
+ ::= { bufferControlEntry 2 }
+
+bufferControlFullStatus OBJECT-TYPE
+ SYNTAX INTEGER {
+ spaceAvailable(1),
+ full(2)
+ }
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "This object shows whether the buffer has room to
+ accept new packets or if it is full.
+
+ If the status is spaceAvailable(1), the buffer is
+ accepting new packets normally. If the status is
+ full(2) and the associated bufferControlFullAction
+ object is wrapWhenFull, the buffer is accepting new
+ packets by deleting enough of the oldest packets
+ to make room for new ones as they arrive. Otherwise,
+ if the status is full(2) and the
+ bufferControlFullAction object is lockWhenFull,
+ then the buffer has stopped collecting packets.
+
+ When this object is set to full(2) the probe must
+ not later set it to spaceAvailable(1) except in the
+ case of a significant gain in resources such as
+ an increase of bufferControlOctetsGranted. In
+ particular, the wrap-mode action of deleting old
+ packets to make room for newly arrived packets
+ must not affect the value of this object."
+ ::= { bufferControlEntry 3 }
+
+bufferControlFullAction OBJECT-TYPE
+ SYNTAX INTEGER {
+ lockWhenFull(1),
+ wrapWhenFull(2) -- FIFO
+ }
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "Controls the action of the buffer when it
+ reaches the full status. When in the lockWhenFull(1)
+ state and a packet is added to the buffer that
+ fills the buffer, the bufferControlFullStatus will
+ be set to full(2) and this buffer will stop capturing
+ packets."
+ ::= { bufferControlEntry 4 }
+
+bufferControlCaptureSliceSize OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "Octets"
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The maximum number of octets of each packet
+ that will be saved in this capture buffer.
+ For example, if a 1500 octet packet is received by
+ the probe and this object is set to 500, then only
+ 500 octets of the packet will be stored in the
+ associated capture buffer. If this variable is set
+ to 0, the capture buffer will save as many octets
+ as is possible.
+
+ This object may not be modified if the associated
+ bufferControlStatus object is equal to valid(1)."
+ DEFVAL { 100 }
+ ::= { bufferControlEntry 5 }
+
+bufferControlDownloadSliceSize OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "Octets"
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The maximum number of octets of each packet
+ in this capture buffer that will be returned in
+ an SNMP retrieval of that packet. For example,
+ if 500 octets of a packet have been stored in the
+ associated capture buffer, the associated
+ bufferControlDownloadOffset is 0, and this
+ object is set to 100, then the captureBufferPacket
+ object that contains the packet will contain only
+ the first 100 octets of the packet.
+
+ A prudent manager will take into account possible
+ interoperability or fragmentation problems that may
+ occur if the download slice size is set too large.
+ In particular, conformant SNMP implementations are not
+ required to accept messages whose length exceeds 484
+ octets, although they are encouraged to support larger
+ datagrams whenever feasible."
+ DEFVAL { 100 }
+ ::= { bufferControlEntry 6 }
+
+bufferControlDownloadOffset OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "Octets"
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The offset of the first octet of each packet
+ in this capture buffer that will be returned in
+ an SNMP retrieval of that packet. For example,
+ if 500 octets of a packet have been stored in the
+ associated capture buffer and this object is set to
+ 100, then the captureBufferPacket object that
+ contains the packet will contain bytes starting
+ 100 octets into the packet."
+ DEFVAL { 0 }
+ ::= { bufferControlEntry 7 }
+
+bufferControlMaxOctetsRequested OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "Octets"
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The requested maximum number of octets to be
+ saved in this captureBuffer, including any
+ implementation-specific overhead. If this variable
+ is set to -1, the capture buffer will save as many
+ octets as is possible.
+
+ When this object is created or modified, the probe
+ should set bufferControlMaxOctetsGranted as closely
+ to this object as is possible for the particular probe
+ implementation and available resources. However, if
+ the object has the special value of -1, the probe
+ must set bufferControlMaxOctetsGranted to -1."
+ DEFVAL { -1 }
+ ::= { bufferControlEntry 8 }
+
+bufferControlMaxOctetsGranted OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "Octets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The maximum number of octets that can be
+ saved in this captureBuffer, including overhead.
+ If this variable is -1, the capture buffer will save
+ as many octets as possible.
+
+ When the bufferControlMaxOctetsRequested object is
+ created or modified, the probe should set this object
+ as closely to the requested value as is possible for the
+ particular probe implementation and available resources.
+ However, if the request object has the special value
+ of -1, the probe must set this object to -1.
+
+ The probe must not lower this value except as a result of
+ a modification to the associated
+ bufferControlMaxOctetsRequested object.
+
+ When this maximum number of octets is reached
+ and a new packet is to be added to this
+ capture buffer and the corresponding
+ bufferControlFullAction is set to wrapWhenFull(2),
+ enough of the oldest packets associated with this
+ capture buffer shall be deleted by the agent so
+ that the new packet can be added. If the corresponding
+ bufferControlFullAction is set to lockWhenFull(1),
+ the new packet shall be discarded. In either case,
+ the probe must set bufferControlFullStatus to
+ full(2).
+
+ When the value of this object changes to a value less
+ than the current value, entries are deleted from
+ the captureBufferTable associated with this
+ bufferControlEntry. Enough of the
+ oldest of these captureBufferEntries shall be
+ deleted by the agent so that the number of octets
+ used remains less than or equal to the new value of
+ this object.
+
+ When the value of this object changes to a value greater
+ than the current value, the number of associated
+ captureBufferEntries may be allowed to grow."
+ ::= { bufferControlEntry 9 }
+
+bufferControlCapturedPackets OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "Packets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of packets currently in this captureBuffer."
+ ::= { bufferControlEntry 10 }
+
+bufferControlTurnOnTime OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value of sysUpTime when this capture buffer was
+ first turned on."
+ ::= { bufferControlEntry 11 }
+
+bufferControlOwner OBJECT-TYPE
+ SYNTAX OwnerString
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The entity that configured this entry and is therefore
+ using the resources assigned to it."
+ ::= { bufferControlEntry 12 }
+
+bufferControlStatus OBJECT-TYPE
+ SYNTAX EntryStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The status of this buffer Control Entry."
+ ::= { bufferControlEntry 13 }
+
+captureBufferTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF CaptureBufferEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of packets captured off of a channel."
+ ::= { capture 2 }
+
+captureBufferEntry OBJECT-TYPE
+ SYNTAX CaptureBufferEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A packet captured off of an attached network. As an
+ example, an instance of the captureBufferPacketData
+ object might be named captureBufferPacketData.3.1783"
+ INDEX { captureBufferControlIndex, captureBufferIndex }
+ ::= { captureBufferTable 1 }
+
+CaptureBufferEntry ::= SEQUENCE {
+ captureBufferControlIndex Integer32,
+ captureBufferIndex Integer32,
+ captureBufferPacketID Integer32,
+ captureBufferPacketData OCTET STRING,
+ captureBufferPacketLength Integer32,
+ captureBufferPacketTime Integer32,
+ captureBufferPacketStatus Integer32
+}
+
+captureBufferControlIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The index of the bufferControlEntry with which
+ this packet is associated."
+ ::= { captureBufferEntry 1 }
+
+captureBufferIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..2147483647)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that uniquely identifies an entry
+ in the captureBuffer table associated with a
+ particular bufferControlEntry. This index will
+ start at 1 and increase by one for each new packet
+ added with the same captureBufferControlIndex.
+
+ Should this value reach 2147483647, the next packet
+ added with the same captureBufferControlIndex shall
+ cause this value to wrap around to 1."
+ ::= { captureBufferEntry 2 }
+
+captureBufferPacketID OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that describes the order of packets
+ that are received on a particular interface.
+ The packetID of a packet captured on an
+ interface is defined to be greater than the
+ packetID's of all packets captured previously on
+ the same interface. As the captureBufferPacketID
+ object has a maximum positive value of 2^31 - 1,
+ any captureBufferPacketID object shall have the
+ value of the associated packet's packetID mod 2^31."
+ ::= { captureBufferEntry 3 }
+
+captureBufferPacketData OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The data inside the packet, starting at the beginning
+ of the packet plus any offset specified in the
+ associated bufferControlDownloadOffset, including any
+ link level headers. The length of the data in this object
+ is the minimum of the length of the captured packet minus
+ the offset, the length of the associated
+ bufferControlCaptureSliceSize minus the offset, and the
+ associated bufferControlDownloadSliceSize. If this minimum
+ is less than zero, this object shall have a length of zero."
+ ::= { captureBufferEntry 4 }
+
+captureBufferPacketLength OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "Octets"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The actual length (off the wire) of the packet stored
+ in this entry, including FCS octets."
+ ::= { captureBufferEntry 5 }
+
+captureBufferPacketTime OBJECT-TYPE
+ SYNTAX Integer32
+ UNITS "Milliseconds"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of milliseconds that had passed since
+ this capture buffer was first turned on when this
+ packet was captured."
+ ::= { captureBufferEntry 6 }
+
+captureBufferPacketStatus OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "A value which indicates the error status of this packet.
+
+ The value of this object is defined in the same way as
+ filterPktStatus. The value is a sum. This sum
+ initially takes the value zero. Then, for each
+ error, E, that has been discovered in this packet,
+ 2 raised to a value representing E is added to the sum.
+
+ The errors defined for a packet captured off of an
+ Ethernet interface are as follows:
+
+ bit # Error
+ 0 Packet is longer than 1518 octets
+ 1 Packet is shorter than 64 octets
+ 2 Packet experienced a CRC or Alignment error
+ 3 First packet in this capture buffer after
+ it was detected that some packets were
+ not processed correctly.
+ 4 Packet's order in buffer is only approximate
+ (May only be set for packets sent from
+ the probe)
+
+ For example, an Ethernet fragment would have a
+ value of 6 (2^1 + 2^2).
+
+ As this MIB is expanded to new media types, this object
+ will have other media-specific errors defined."
+ ::= { captureBufferEntry 7 }
+
+-- The Event Group
+
+-- Implementation of the Event group is optional.
+-- Consult the MODULE-COMPLIANCE macro for the authoritative
+-- conformance information for this MIB.
+--
+-- The Event group controls the generation and notification
+-- of events from this device. Each entry in the eventTable
+-- describes the parameters of the event that can be triggered.
+-- Each event entry is fired by an associated condition located
+-- elsewhere in the MIB. An event entry may also be associated
+-- with a function elsewhere in the MIB that will be executed
+-- when the event is generated. For example, a channel may
+-- be turned on or off by the firing of an event.
+--
+-- Each eventEntry may optionally specify that a log entry
+-- be created on its behalf whenever the event occurs.
+-- Each entry may also specify that notification should
+-- occur by way of SNMP trap messages. In this case, the
+-- community for the trap message is given in the associated
+-- eventCommunity object. The enterprise and specific trap
+-- fields of the trap are determined by the condition that
+-- triggered the event. Two traps are defined: risingAlarm and
+-- fallingAlarm. If the eventTable is triggered by a condition
+-- specified elsewhere, the enterprise and specific trap fields
+-- must be specified for traps generated for that condition.
+
+eventTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF EventEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of events to be generated."
+ ::= { event 1 }
+
+eventEntry OBJECT-TYPE
+ SYNTAX EventEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A set of parameters that describe an event to be generated
+ when certain conditions are met. As an example, an instance
+ of the eventLastTimeSent object might be named
+ eventLastTimeSent.6"
+ INDEX { eventIndex }
+ ::= { eventTable 1 }
+
+EventEntry ::= SEQUENCE {
+ eventIndex Integer32,
+ eventDescription DisplayString,
+ eventType INTEGER,
+ eventCommunity OCTET STRING,
+ eventLastTimeSent TimeTicks,
+ eventOwner OwnerString,
+ eventStatus EntryStatus
+}
+
+eventIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that uniquely identifies an entry in the
+ event table. Each such entry defines one event that
+ is to be generated when the appropriate conditions
+ occur."
+ ::= { eventEntry 1 }
+
+eventDescription OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..127))
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "A comment describing this event entry."
+ ::= { eventEntry 2 }
+
+eventType OBJECT-TYPE
+ SYNTAX INTEGER {
+ none(1),
+ log(2),
+ snmptrap(3), -- send an SNMP trap
+ logandtrap(4)
+ }
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The type of notification that the probe will make
+ about this event. In the case of log, an entry is
+ made in the log table for each event. In the case of
+ snmp-trap, an SNMP trap is sent to one or more
+ management stations."
+ ::= { eventEntry 3 }
+
+eventCommunity OBJECT-TYPE
+ SYNTAX OCTET STRING (SIZE (0..127))
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "If an SNMP trap is to be sent, it will be sent to
+ the SNMP community specified by this octet string."
+ ::= { eventEntry 4 }
+
+eventLastTimeSent OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value of sysUpTime at the time this event
+ entry last generated an event. If this entry has
+ not generated any events, this value will be
+ zero."
+ ::= { eventEntry 5 }
+
+eventOwner OBJECT-TYPE
+ SYNTAX OwnerString
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The entity that configured this entry and is therefore
+ using the resources assigned to it.
+
+ If this object contains a string starting with 'monitor'
+ and has associated entries in the log table, all connected
+ management stations should retrieve those log entries,
+ as they may have significance to all management stations
+ connected to this device"
+ ::= { eventEntry 6 }
+
+eventStatus OBJECT-TYPE
+ SYNTAX EntryStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The status of this event entry.
+
+ If this object is not equal to valid(1), all associated
+ log entries shall be deleted by the agent."
+ ::= { eventEntry 7 }
+
+--
+logTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF LogEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A list of events that have been logged."
+ ::= { event 2 }
+
+logEntry OBJECT-TYPE
+ SYNTAX LogEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A set of data describing an event that has been
+ logged. For example, an instance of the logDescription
+ object might be named logDescription.6.47"
+ INDEX { logEventIndex, logIndex }
+ ::= { logTable 1 }
+
+LogEntry ::= SEQUENCE {
+ logEventIndex Integer32,
+ logIndex Integer32,
+ logTime TimeTicks,
+ logDescription DisplayString
+}
+
+logEventIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..65535)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The event entry that generated this log
+ entry. The log identified by a particular
+ value of this index is associated with the same
+ eventEntry as identified by the same value
+ of eventIndex."
+ ::= { logEntry 1 }
+
+logIndex OBJECT-TYPE
+ SYNTAX Integer32 (1..2147483647)
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An index that uniquely identifies an entry
+ in the log table amongst those generated by the
+ same eventEntries. These indexes are
+ assigned beginning with 1 and increase by one
+ with each new log entry. The association
+ between values of logIndex and logEntries
+ is fixed for the lifetime of each logEntry.
+ The agent may choose to delete the oldest
+ instances of logEntry as required because of
+ lack of memory. It is an implementation-specific
+ matter as to when this deletion may occur."
+ ::= { logEntry 2 }
+
+logTime OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value of sysUpTime when this log entry was created."
+ ::= { logEntry 3 }
+
+logDescription OBJECT-TYPE
+ SYNTAX DisplayString (SIZE (0..255))
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "An implementation dependent description of the
+ event that activated this log entry."
+ ::= { logEntry 4 }
+
+-- Remote Network Monitoring Traps
+
+rmonEventsV2 OBJECT-IDENTITY
+ STATUS current
+ DESCRIPTION "Definition point for RMON notifications."
+ ::= { rmon 0 }
+
+risingAlarm NOTIFICATION-TYPE
+ OBJECTS { alarmIndex, alarmVariable, alarmSampleType,
+ alarmValue, alarmRisingThreshold }
+ STATUS current
+ DESCRIPTION
+ "The SNMP trap that is generated when an alarm
+ entry crosses its rising threshold and generates
+ an event that is configured for sending SNMP
+ traps."
+ ::= { rmonEventsV2 1 }
+
+fallingAlarm NOTIFICATION-TYPE
+ OBJECTS { alarmIndex, alarmVariable, alarmSampleType,
+ alarmValue, alarmFallingThreshold }
+ STATUS current
+ DESCRIPTION
+ "The SNMP trap that is generated when an alarm
+ entry crosses its falling threshold and generates
+ an event that is configured for sending SNMP
+ traps."
+ ::= { rmonEventsV2 2 }
+
+-- Conformance information
+
+rmonCompliances OBJECT IDENTIFIER ::= { rmonConformance 9 }
+rmonGroups OBJECT IDENTIFIER ::= { rmonConformance 10 }
+
+-- Compliance Statements
+rmonCompliance MODULE-COMPLIANCE
+ STATUS current
+ DESCRIPTION
+ "The requirements for conformance to the RMON MIB. At least
+ one of the groups in this module must be implemented to
+ conform to the RMON MIB. Implementations of this MIB
+ must also implement the system group of MIB-II [16] and the
+ IF-MIB [17]."
+ MODULE -- this module
+
+ GROUP rmonEtherStatsGroup
+ DESCRIPTION
+ "The RMON Ethernet Statistics Group is optional."
+
+ GROUP rmonHistoryControlGroup
+ DESCRIPTION
+ "The RMON History Control Group is optional."
+
+ GROUP rmonEthernetHistoryGroup
+ DESCRIPTION
+ "The RMON Ethernet History Group is optional."
+
+ GROUP rmonAlarmGroup
+ DESCRIPTION
+ "The RMON Alarm Group is optional."
+
+ GROUP rmonHostGroup
+ DESCRIPTION
+ "The RMON Host Group is mandatory when the
+ rmonHostTopNGroup is implemented."
+
+ GROUP rmonHostTopNGroup
+ DESCRIPTION
+ "The RMON Host Top N Group is optional."
+
+ GROUP rmonMatrixGroup
+ DESCRIPTION
+ "The RMON Matrix Group is optional."
+
+ GROUP rmonFilterGroup
+ DESCRIPTION
+ "The RMON Filter Group is mandatory when the
+ rmonPacketCaptureGroup is implemented."
+
+ GROUP rmonPacketCaptureGroup
+ DESCRIPTION
+ "The RMON Packet Capture Group is optional."
+
+ GROUP rmonEventGroup
+ DESCRIPTION
+ "The RMON Event Group is mandatory when the
+ rmonAlarmGroup is implemented."
+ ::= { rmonCompliances 1 }
+
+ rmonEtherStatsGroup OBJECT-GROUP
+ OBJECTS {
+ etherStatsIndex, etherStatsDataSource,
+ etherStatsDropEvents, etherStatsOctets, etherStatsPkts,
+ etherStatsBroadcastPkts, etherStatsMulticastPkts,
+ etherStatsCRCAlignErrors, etherStatsUndersizePkts,
+ etherStatsOversizePkts, etherStatsFragments,
+ etherStatsJabbers, etherStatsCollisions,
+ etherStatsPkts64Octets, etherStatsPkts65to127Octets,
+ etherStatsPkts128to255Octets,
+ etherStatsPkts256to511Octets,
+ etherStatsPkts512to1023Octets,
+ etherStatsPkts1024to1518Octets,
+ etherStatsOwner, etherStatsStatus
+ }
+ STATUS current
+ DESCRIPTION
+ "The RMON Ethernet Statistics Group."
+ ::= { rmonGroups 1 }
+
+ rmonHistoryControlGroup OBJECT-GROUP
+ OBJECTS {
+ historyControlIndex, historyControlDataSource,
+ historyControlBucketsRequested,
+ historyControlBucketsGranted, historyControlInterval,
+ historyControlOwner, historyControlStatus
+ }
+ STATUS current
+ DESCRIPTION
+ "The RMON History Control Group."
+ ::= { rmonGroups 2 }
+
+ rmonEthernetHistoryGroup OBJECT-GROUP
+ OBJECTS {
+ etherHistoryIndex, etherHistorySampleIndex,
+ etherHistoryIntervalStart, etherHistoryDropEvents,
+ etherHistoryOctets, etherHistoryPkts,
+ etherHistoryBroadcastPkts, etherHistoryMulticastPkts,
+ etherHistoryCRCAlignErrors, etherHistoryUndersizePkts,
+ etherHistoryOversizePkts, etherHistoryFragments,
+ etherHistoryJabbers, etherHistoryCollisions,
+ etherHistoryUtilization
+ }
+ STATUS current
+ DESCRIPTION
+ "The RMON Ethernet History Group."
+ ::= { rmonGroups 3 }
+
+ rmonAlarmGroup OBJECT-GROUP
+ OBJECTS {
+ alarmIndex, alarmInterval, alarmVariable,
+ alarmSampleType, alarmValue, alarmStartupAlarm,
+ alarmRisingThreshold, alarmFallingThreshold,
+ alarmRisingEventIndex, alarmFallingEventIndex,
+ alarmOwner, alarmStatus
+ }
+ STATUS current
+ DESCRIPTION
+ "The RMON Alarm Group."
+ ::= { rmonGroups 4 }
+
+ rmonHostGroup OBJECT-GROUP
+ OBJECTS {
+ hostControlIndex, hostControlDataSource,
+ hostControlTableSize, hostControlLastDeleteTime,
+ hostControlOwner, hostControlStatus,
+ hostAddress, hostCreationOrder, hostIndex,
+ hostInPkts, hostOutPkts, hostInOctets,
+ hostOutOctets, hostOutErrors, hostOutBroadcastPkts,
+ hostOutMulticastPkts, hostTimeAddress,
+ hostTimeCreationOrder, hostTimeIndex,
+ hostTimeInPkts, hostTimeOutPkts, hostTimeInOctets,
+ hostTimeOutOctets, hostTimeOutErrors,
+ hostTimeOutBroadcastPkts, hostTimeOutMulticastPkts
+ }
+ STATUS current
+ DESCRIPTION
+ "The RMON Host Group."
+ ::= { rmonGroups 5 }
+
+ rmonHostTopNGroup OBJECT-GROUP
+ OBJECTS {
+ hostTopNControlIndex, hostTopNHostIndex,
+ hostTopNRateBase, hostTopNTimeRemaining,
+ hostTopNDuration, hostTopNRequestedSize,
+ hostTopNGrantedSize, hostTopNStartTime,
+ hostTopNOwner, hostTopNStatus,
+ hostTopNReport, hostTopNIndex,
+ hostTopNAddress, hostTopNRate
+ }
+ STATUS current
+ DESCRIPTION
+ "The RMON Host Top 'N' Group."
+ ::= { rmonGroups 6 }
+
+ rmonMatrixGroup OBJECT-GROUP
+ OBJECTS {
+ matrixControlIndex, matrixControlDataSource,
+ matrixControlTableSize, matrixControlLastDeleteTime,
+ matrixControlOwner, matrixControlStatus,
+ matrixSDSourceAddress, matrixSDDestAddress,
+ matrixSDIndex, matrixSDPkts,
+ matrixSDOctets, matrixSDErrors,
+ matrixDSSourceAddress, matrixDSDestAddress,
+ matrixDSIndex, matrixDSPkts,
+ matrixDSOctets, matrixDSErrors
+ }
+ STATUS current
+ DESCRIPTION
+ "The RMON Matrix Group."
+ ::= { rmonGroups 7 }
+
+ rmonFilterGroup OBJECT-GROUP
+ OBJECTS {
+ filterIndex, filterChannelIndex, filterPktDataOffset,
+ filterPktData, filterPktDataMask,
+ filterPktDataNotMask, filterPktStatus,
+ filterPktStatusMask, filterPktStatusNotMask,
+ filterOwner, filterStatus,
+ channelIndex, channelIfIndex, channelAcceptType,
+ channelDataControl, channelTurnOnEventIndex,
+ channelTurnOffEventIndex, channelEventIndex,
+ channelEventStatus, channelMatches,
+ channelDescription, channelOwner, channelStatus
+ }
+ STATUS current
+ DESCRIPTION
+ "The RMON Filter Group."
+ ::= { rmonGroups 8 }
+
+ rmonPacketCaptureGroup OBJECT-GROUP
+ OBJECTS {
+ bufferControlIndex, bufferControlChannelIndex,
+ bufferControlFullStatus, bufferControlFullAction,
+ bufferControlCaptureSliceSize,
+ bufferControlDownloadSliceSize,
+ bufferControlDownloadOffset,
+ bufferControlMaxOctetsRequested,
+ bufferControlMaxOctetsGranted,
+ bufferControlCapturedPackets,
+ bufferControlTurnOnTime,
+ bufferControlOwner, bufferControlStatus,
+ captureBufferControlIndex, captureBufferIndex,
+ captureBufferPacketID, captureBufferPacketData,
+ captureBufferPacketLength, captureBufferPacketTime,
+ captureBufferPacketStatus
+ }
+ STATUS current
+ DESCRIPTION
+ "The RMON Packet Capture Group."
+ ::= { rmonGroups 9 }
+
+ rmonEventGroup OBJECT-GROUP
+ OBJECTS {
+ eventIndex, eventDescription, eventType,
+ eventCommunity, eventLastTimeSent,
+ eventOwner, eventStatus,
+ logEventIndex, logIndex, logTime,
+ logDescription
+ }
+ STATUS current
+ DESCRIPTION
+ "The RMON Event Group."
+ ::= { rmonGroups 10 }
+
+ rmonNotificationGroup NOTIFICATION-GROUP
+ NOTIFICATIONS { risingAlarm, fallingAlarm }
+ STATUS current
+ DESCRIPTION
+ "The RMON Notification Group."
+ ::= { rmonGroups 11 }
+END
diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk
index fb1dcb6c41..b90dbe4eef 100644
--- a/lib/snmp/vsn.mk
+++ b/lib/snmp/vsn.mk
@@ -18,6 +18,6 @@
# %CopyrightEnd%
APPLICATION = snmp
-SNMP_VSN = 4.21.7
+SNMP_VSN = 4.22.1
PRE_VSN =
APP_VSN = "$(APPLICATION)-$(SNMP_VSN)$(PRE_VSN)"
diff --git a/lib/ssh/doc/src/Makefile b/lib/ssh/doc/src/Makefile
index 125dcf8775..da99c4ea0f 100644
--- a/lib/ssh/doc/src/Makefile
+++ b/lib/ssh/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -109,13 +109,13 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml
index c6c634212f..36010da07a 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,6 +29,178 @@
<file>notes.xml</file>
</header>
+<section><title>Ssh 2.1.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Ssh now only sends one channel close message under all
+ circumstances, before it would sometimes incorrectly send
+ two.</p>
+ <p>
+ Own Id: OTP-10060</p>
+ </item>
+ <item>
+ <p>
+ The options check mistreated the ip_v6_disable-option,
+ and did not handle some, at the moment, undocumented
+ options correctly.</p>
+ <p>
+ Own Id: OTP-10061</p>
+ </item>
+ <item>
+ <p>
+ The channel id in a channel failure message, sent to the
+ peer, is now in all cases the remote channel id</p>
+ <p>
+ Own Id: OTP-10062</p>
+ </item>
+ <item>
+ <p>
+ Improved handling of multiple closes to avoid occasional
+ crashes when a channel is closed more than once.</p>
+ <p>
+ Own Id: OTP-10112</p>
+ </item>
+ <item>
+ <p>
+ Fix lib/src/test/ssh_basic_SUITE.erl to fix IPv6 option
+ typos</p>
+ <p>
+ Fixed incorrect option "ipv6_disable" to "ipv6_disabled"
+ as documented in the ssh manual.</p>
+ <p>
+ Own Id: OTP-10219</p>
+ </item>
+ <item>
+ <p>
+ SSH: Make "auth_methods" server option re-usable</p>
+ <p>
+ The 'auth_methods' option is used by the server side of
+ the SSH code to tell a connecting SSH client about the
+ authentication methods that are supported by the server.
+ The code still extracts and handles the 'auth_methods'
+ option from Opts in appropriate places, but the Opts
+ checking code in ssh.erl didn't allow that option to be
+ specified.</p>
+ <p>
+ Own Id: OTP-10224</p>
+ </item>
+ <item>
+ <p>
+ Use the correct channel id when adjusting the channel
+ window</p>
+ <p>
+ Own Id: OTP-10232</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Ssh 2.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ All keys in authorized_keys are considerd, wrongly only
+ the first one was before.</p>
+ <p>
+ Own Id: OTP-7235</p>
+ </item>
+ <item>
+ <p>
+ ssh daemon now properly handles ras host keys, in
+ previous versions only dsa host keys sufficed to set up a
+ connection.</p>
+ <p>
+ Own Id: OTP-7677</p>
+ </item>
+ <item>
+ <p>
+ ssh:shell/3 and ssh:connect/3 does not hang anymore if
+ connection negotiation fails</p>
+ <p>
+ Own Id: OTP-8111</p>
+ </item>
+ <item>
+ <p>
+ Improve check so that we will not try to read ssh packet
+ length indicator if not sure we have enough data.</p>
+ <p>
+ Own Id: OTP-8380</p>
+ </item>
+ <item>
+ <p>
+ Do not try to use user interaction when it is disabled.</p>
+ <p>
+ Own Id: OTP-9466 Aux Id: seq11886 </p>
+ </item>
+ <item>
+ <p>
+ Improved error handling of internal errors i the ssh
+ connection handling process</p>
+ <p>
+ Own Id: OTP-9905</p>
+ </item>
+ <item>
+ <p>
+ sftp daemon generates file handles correct</p>
+ <p>
+ Own Id: OTP-9948</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Document supported algorithms</p>
+ <p>
+ Own Id: OTP-8109</p>
+ </item>
+ <item>
+ <p>
+ Graceful handling of premature close from an sftp client.</p>
+ <p>
+ Own Id: OTP-9391 Aux Id: seq11838 </p>
+ </item>
+ <item>
+ <p>
+ Changed ssh implementation to use the public_key
+ application for all public key handling. This is also a
+ first step for enabling a callback API for supplying
+ public keys and handling keys protected with password
+ phrases. </p>
+ <p>
+ Additionally the test suites where improved so that they
+ do not copy the users keys to test server directories as
+ this is a security liability. Also ipv6 and file access
+ issues found in the process has been fixed.</p>
+ <p>
+ This change also solves OTP-7677 and OTP-7235</p>
+ <p>
+ This changes also involves some updates to public_keys
+ ssh-functions.</p>
+ <p>
+ Own Id: OTP-9911</p>
+ </item>
+ <item>
+ <p>
+ Added options for the ssh client to support user keys
+ files that are password protected.</p>
+ <p>
+ Own Id: OTP-10036 Aux Id: OTP-6400, Seq10595 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Ssh 2.0.9</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/ssh/doc/src/ssh.xml b/lib/ssh/doc/src/ssh.xml
index 2c5096a25f..0133250979 100644
--- a/lib/ssh/doc/src/ssh.xml
+++ b/lib/ssh/doc/src/ssh.xml
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="latin1" ?>
+<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">
<erlref>
<header>
<copyright>
- <year>2004</year><year>2010</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -33,9 +33,20 @@
<module>ssh</module>
<modulesummary>Main API of the SSH application</modulesummary>
<description>
- <p>Interface module for the SSH application</p>
+ <p>Interface module for the SSH application. </p>
</description>
+ <section>
+ <title>SSH</title>
+
+ <list type="bulleted">
+ <item>ssh requires the crypto and public_key applications.</item>
+ <item>Supported SSH-version is 2.0 </item>
+ <item>Currently supports only a minimum of mac and encryption algorithms i.e.
+ hmac-sha1, and aes128-cb and 3des-cbc.</item>
+ </list>
+
+ </section>
<section>
<title>COMMON DATA TYPES </title>
@@ -86,7 +97,7 @@
by calling ssh_connect:session_channel/2.</p>
<p>Options are:</p>
<taglist>
- <tag><c><![CDATA[{user_dir, String}]]></c></tag>
+ <tag><c><![CDATA[{user_dir, string()}]]></c></tag>
<item>
<p>Sets the user directory e.i. the directory containing
ssh configuration files for the user such as
@@ -94,6 +105,18 @@
<c><![CDATA[authorized_key]]></c>. Defaults to the directory normally
referred to as <c><![CDATA[~/.ssh]]></c> </p>
</item>
+ <tag><c><![CDATA[{dsa_pass_phrase, string()}]]></c></tag>
+ <item>
+ <p>If the user dsa key is protected by a pass phrase it can be
+ supplied with this option.
+ </p>
+ </item>
+ <tag><c><![CDATA[{rsa_pass_phrase, string()}]]></c></tag>
+ <item>
+ <p>If the user rsa key is protected by a pass phrase it can be
+ supplied with this option.
+ </p>
+ </item>
<tag><c><![CDATA[{silently_accept_hosts, boolean()}]]></c></tag>
<item>
<p>When true hosts are added to the
@@ -222,17 +245,31 @@
option <c>shell</c> which is much less work than implementing
your own cli channel.
</item>
+ <tag><c><![CDATA[{user_dir, String}]]></c></tag>
+ <item>
+ <p>Sets the user directory e.i. the directory containing
+ ssh configuration files for the user such as
+ <c><![CDATA[known_hosts]]></c>, <c><![CDATA[id_rsa, id_dsa]]></c> and
+ <c><![CDATA[authorized_key]]></c>. Defaults to the directory normally
+ referred to as <c><![CDATA[~/.ssh]]></c> </p>
+ </item>
<tag><c><![CDATA[{system_dir, string()}]]></c></tag>
<item>
<p>Sets the system directory, containing the host files
that identifies the host for ssh. The default is
<c><![CDATA[/etc/ssh]]></c>, note that SSH normally
requires the host files there to be readable only by
- root.</p>
+ root.</p>
+ </item>
+ <tag><c><![CDATA[{auth_methods, string()}]]></c></tag>
+ <item>
+ <p>Comma separated string that determines which authentication methodes that the server
+ should support and in what order they will be tried. Defaults to
+ <c><![CDATA["publickey,keyboard-interactive,password"]]></c></p>
</item>
- <tag><c><![CDATA[{user_passwords, [{string() = User, string() = Password}]}]]></c></tag>
- <item>
- <p>Provide passwords for password authentication.They will
+ <tag><c><![CDATA[{user_passwords, [{string() = User, string() = Password}]}]]></c></tag>
+ <item>
+ <p>Provide passwords for password authentication.They will
be used when someone tries to connect to the server and
public key user authentication fails. The option provides
a list of valid user names and the corresponding password.
@@ -283,22 +320,6 @@
</func>
<func>
- <name>sign_data(Data, Algorithm) -> Signature | {error, Reason}</name>
- <fsummary> </fsummary>
- <type>
- <v> Data = binary()</v>
- <v> Algorithm = "ssh-rsa"</v>
- <v> Signature = binary()</v>
- <v> Reason = term()</v>
- </type>
- <desc>
- <p>Signs the supplied binary using the SSH key.
- </p>
- </desc>
- </func>
-
-
- <func>
<name>start() -> </name>
<name>start(Type) -> ok | {error, Reason}</name>
<fsummary>Starts the Ssh application. </fsummary>
@@ -356,21 +377,6 @@
</desc>
</func>
- <func>
- <name>verify_data(Data, Signature, Algorithm) -> ok | {error, Reason}</name>
- <fsummary> </fsummary>
- <type>
- <v> Data = binary()</v>
- <v> Algorithm = "ssh-rsa"</v>
- <v> Signature = binary()</v>
- <v> Reason = term()</v>
- </type>
- <desc>
- <p>Verifies the supplied binary against the binary signature.
- </p>
- </desc>
- </func>
-
</funcs>
</erlref>
diff --git a/lib/ssh/examples/Makefile b/lib/ssh/examples/Makefile
index 5f17542fb8..de019f75b5 100644
--- a/lib/ssh/examples/Makefile
+++ b/lib/ssh/examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2005-2010. All Rights Reserved.
+# Copyright Ericsson AB 2005-2012. 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
@@ -69,8 +69,8 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/examples
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/examples
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/examples"
release_docs_spec:
diff --git a/lib/ssh/src/DSS.asn1 b/lib/ssh/src/DSS.asn1
deleted file mode 100644
index 77aca3808b..0000000000
--- a/lib/ssh/src/DSS.asn1
+++ /dev/null
@@ -1,20 +0,0 @@
-DSS DEFINITIONS EXPLICIT TAGS ::=
-
-BEGIN
-
--- EXPORTS ALL
--- All types and values defined in this module are exported for use
--- in other ASN.1 modules.
-
-DSAPrivateKey ::= SEQUENCE {
- version INTEGER,
- p INTEGER, -- p
- q INTEGER, -- q
- g INTEGER, -- q
- y INTEGER, -- y
- x INTEGER -- x
-}
-
-END
-
-
diff --git a/lib/ssh/src/Makefile b/lib/ssh/src/Makefile
index da31d87369..b8eecd3fa2 100644
--- a/lib/ssh/src/Makefile
+++ b/lib/ssh/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -36,16 +36,22 @@ RELSYSDIR = $(RELEASE_PATH)/lib/ssh-$(VSN)
# Common Macros
# ----------------------------------------------------
+# Behaviour (api) modules are first so they are compiled when
+# the compiler reaches a callback module using them.
+BEHAVIOUR_MODULES= \
+ ssh_sftpd_file_api \
+ ssh_channel \
+ ssh_key_api
+
MODULES= \
ssh \
ssh_sup \
sshc_sup \
sshd_sup \
- ssh_channel \
+ ssh_connection_sup \
ssh_connection \
ssh_connection_handler \
ssh_connection_manager \
- ssh_connection_controler \
ssh_shell \
ssh_system_sup \
ssh_subsystem_sup \
@@ -56,27 +62,27 @@ MODULES= \
ssh_auth\
ssh_bits \
ssh_cli \
- ssh_dsa \
ssh_file \
ssh_io \
ssh_math \
ssh_no_io \
- ssh_rsa \
ssh_sftp \
ssh_sftpd \
ssh_sftpd_file\
- ssh_sftpd_file_api \
ssh_transport \
ssh_userreg \
ssh_xfer
PUBLIC_HRL_FILES= ssh.hrl ssh_userauth.hrl ssh_xfer.hrl
-ERL_FILES= $(MODULES:%=%.erl) $(ASN_ERLS)
+ERL_FILES= \
+ $(MODULES:%=%.erl) \
+ $(BEHAVIOUR_MODULES:%=%.erl)
+
-ALL_MODULES= $(MODULES) $(ASN_MODULES)
+TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR))
-TARGET_FILES= $(ALL_MODULES:%=$(EBIN)/%.$(EMULATOR)) $(APP_TARGET) $(APPUP_TARGET)
+BEHAVIOUR_TARGET_FILES= $(BEHAVIOUR_MODULES:%=$(EBIN)/%.$(EMULATOR))
APP_FILE= ssh.app
APPUP_FILE= ssh.appup
@@ -87,50 +93,36 @@ APP_TARGET= $(EBIN)/$(APP_FILE)
APPUP_SRC= $(APPUP_FILE).src
APPUP_TARGET= $(EBIN)/$(APPUP_FILE)
-ASN_MODULES = PKCS-1 DSS
-ASN_ASNS = $(ASN_MODULES:%=%.asn1)
-ASN_ERLS = $(ASN_MODULES:%=%.erl)
-ASN_HRLS = $(ASN_MODULES:%=%.hrl)
-ASN_DBS = $(ASN_MODULES:%=%.asn1db)
-ASN_TABLES = $(ASN_MODULES:%=%.table)
-
-ASN_FLAGS = -bber_bin +der +compact_bit_string +optimize +noobj +inline
-
-INTERNAL_HRL_FILES = $(ASN_HRLS) ssh_auth.hrl ssh_connect.hrl ssh_transport.hrl
+INTERNAL_HRL_FILES = ssh_auth.hrl ssh_connect.hrl ssh_transport.hrl
# ----------------------------------------------------
# FLAGS
# ----------------------------------------------------
-ERL_COMPILE_FLAGS += -pa$(EBIN)
+EXTRA_ERLC_FLAGS = +warn_unused_vars
+ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/kernel/src \
+ -pz $(EBIN) \
+ -pz $(ERL_TOP)/lib/public_key/ebin \
+ $(EXTRA_ERLC_FLAGS)
+
# ----------------------------------------------------
# Targets
# ----------------------------------------------------
-debug opt: $(TARGET_FILES)
+$(TARGET_FILES): $(BEHAVIOUR_TARGET_FILES)
-debug: ERLC_FLAGS += -Ddebug
+debug opt: $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET)
clean:
- rm -f $(TARGET_FILES)
+ rm -f $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET)
rm -f errs core *~
- rm -f $(ASN_ERLS) $(ASN_HRLS) $(ASN_DBS)
-$(TARGET_FILES): ssh.hrl
-
-# $(EBIN)/ssh_sftpd_file.$(EMULATOR): ERLC_FLAGS += -pa$(EBIN)
-# $(EBIN)/ssh_sftpd_file.$(EMULATOR): $(EBIN)/ssh_sftpd_file_api.$(EMULATOR)
-
-$(APP_TARGET): $(APP_SRC) ../vsn.mk
+$(APP_TARGET): $(APP_SRC) ../vsn.mk
sed -e 's;%VSN%;$(VSN);' $< > $@
-$(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
+$(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
sed -e 's;%VSN%;$(VSN);' $< > $@
-%.erl %.hrl: %.asn1
- $(ERLC) $(ASN_FLAGS) $<
-
-$(EBIN)/ssh_file.$(EMULATOR) $(EBIN)/ssh_rsa.$(EMULATOR): $(ASN_HRLS)
docs:
@@ -140,12 +132,13 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(PUBLIC_HRL_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(BEHAVIOUR_TARGET_FILES) $(TARGET_FILES) $(APP_TARGET) \
+ $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(PUBLIC_HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/ssh/src/PKCS-1.asn1 b/lib/ssh/src/PKCS-1.asn1
deleted file mode 100644
index e7d6b18c63..0000000000
--- a/lib/ssh/src/PKCS-1.asn1
+++ /dev/null
@@ -1,116 +0,0 @@
-PKCS-1 {
- iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1)
- modules(0) pkcs-1(1)
-}
-
--- $Revision: 1.1 $
-
-DEFINITIONS EXPLICIT TAGS ::=
-
-BEGIN
-
--- IMPORTS id-sha256, id-sha384, id-sha512
--- FROM NIST-SHA2 {
--- joint-iso-itu-t(2) country(16) us(840) organization(1)
--- gov(101) csor(3) nistalgorithm(4) modules(0) sha2(1)
--- };
-
-pkcs-1 OBJECT IDENTIFIER ::= {
- iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1
-}
-
-rsaEncryption OBJECT IDENTIFIER ::= { pkcs-1 1 }
-
-id-RSAES-OAEP OBJECT IDENTIFIER ::= { pkcs-1 7 }
-
-id-pSpecified OBJECT IDENTIFIER ::= { pkcs-1 9 }
-
-id-RSASSA-PSS OBJECT IDENTIFIER ::= { pkcs-1 10 }
-
-md2WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 2 }
-md5WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 4 }
-sha1WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 5 }
-sha256WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 11 }
-sha384WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 12 }
-sha512WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 13 }
-
-id-sha1 OBJECT IDENTIFIER ::= {
- iso(1) identified-organization(3) oiw(14) secsig(3)
- algorithms(2) 26
-}
-
-id-md2 OBJECT IDENTIFIER ::= {
- iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 2
-}
-
-id-md5 OBJECT IDENTIFIER ::= {
- iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 5
-}
-
-id-mgf1 OBJECT IDENTIFIER ::= { pkcs-1 8 }
-
-
-RSAPublicKey ::= SEQUENCE {
- modulus INTEGER, -- n
- publicExponent INTEGER -- e
-}
-
-RSAPrivateKey ::= SEQUENCE {
- version Version,
- modulus INTEGER, -- n
- publicExponent INTEGER, -- e
- privateExponent INTEGER, -- d
- prime1 INTEGER, -- p
- prime2 INTEGER, -- q
- exponent1 INTEGER, -- d mod (p-1)
- exponent2 INTEGER, -- d mod (q-1)
- coefficient INTEGER, -- (inverse of q) mod p
- otherPrimeInfos OtherPrimeInfos OPTIONAL
-}
-
-Version ::= INTEGER { two-prime(0), multi(1) }
- (CONSTRAINED BY {
- -- version must be multi if otherPrimeInfos present --
- })
-
-OtherPrimeInfos ::= SEQUENCE SIZE(1..MAX) OF OtherPrimeInfo
-
-OtherPrimeInfo ::= SEQUENCE {
- prime INTEGER, -- ri
- exponent INTEGER, -- di
- coefficient INTEGER -- ti
-}
-
-Algorithm ::= SEQUENCE {
- algorithm OBJECT IDENTIFIER,
- parameters ANY DEFINED BY algorithm OPTIONAL
-}
-
-AlgorithmNull ::= SEQUENCE {
- algorithm OBJECT IDENTIFIER,
- parameters NULL
-}
-
-
-RSASSA-PSS-params ::= SEQUENCE {
- hashAlgorithm [0] Algorithm, -- DEFAULT sha1,
- maskGenAlgorithm [1] Algorithm, -- DEFAULT mgf1SHA1,
- saltLength [2] INTEGER DEFAULT 20,
- trailerField [3] TrailerField DEFAULT trailerFieldBC
-}
-
-TrailerField ::= INTEGER { trailerFieldBC(1) }
-
-DigestInfo ::= SEQUENCE {
- digestAlgorithm Algorithm,
- digest OCTET STRING
-}
-
-DigestInfoNull ::= SEQUENCE {
- digestAlgorithm AlgorithmNull,
- digest OCTET STRING
-}
-
-
-END -- PKCS1Definitions
-
diff --git a/lib/ssh/src/prebuild.skip b/lib/ssh/src/prebuild.skip
deleted file mode 100644
index 1d7552d98d..0000000000
--- a/lib/ssh/src/prebuild.skip
+++ /dev/null
@@ -1,2 +0,0 @@
-DSS.asn1db
-PKCS-1.asn1db
diff --git a/lib/ssh/src/ssh.app.src b/lib/ssh/src/ssh.app.src
index 8a3e15841f..316c09eb06 100644
--- a/lib/ssh/src/ssh.app.src
+++ b/lib/ssh/src/ssh.app.src
@@ -3,9 +3,7 @@
{application, ssh,
[{description, "SSH-2 for Erlang/OTP"},
{vsn, "%VSN%"},
- {modules, ['DSS',
- 'PKCS-1',
- ssh,
+ {modules, [ssh,
ssh_app,
ssh_acceptor,
ssh_acceptor_sup,
@@ -17,16 +15,15 @@
ssh_connection,
ssh_connection_handler,
ssh_connection_manager,
- ssh_connection_controler,
+ ssh_connection_sup,
ssh_shell,
sshc_sup,
sshd_sup,
- ssh_dsa,
ssh_file,
ssh_io,
+ ssh_key_api,
ssh_math,
ssh_no_io,
- ssh_rsa,
ssh_sftp,
ssh_sftpd,
ssh_sftpd_file,
diff --git a/lib/ssh/src/ssh.appup.src b/lib/ssh/src/ssh.appup.src
index 21a0582c06..d08dbafc32 100644
--- a/lib/ssh/src/ssh.appup.src
+++ b/lib/ssh/src/ssh.appup.src
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -18,26 +18,26 @@
%%
{"%VSN%",
- [
- {"2.0.8", [{load_module, ssh_sftpd_file_api, soft_purge, soft_purge, []},
- {load_module, ssh_channel, soft_purge, soft_purge, []}]},
- {"2.0.7", [{load_module, ssh_sftp, soft_purge, soft_purge, []}]},
- {"2.0.6", [{load_module, ssh_userreg, soft_purge, soft_purge, []},
- {load_module, ssh_sftp, soft_purge, soft_purge, []}]},
- {"2.0.5", [{load_module, ssh_userreg, soft_purge, soft_purge, []},
- {load_module, ssh_sftp, soft_purge, soft_purge, []},
- {load_module, ssh_connection_handler, soft_purge, soft_purge, [ssh_userreg]}]}
+ [
+ {<<"2.1">>, [{load_module, ssh_sftpd_file_api, soft_purge, soft_purge, []},
+ {load_module, ssh_connection, soft_purge, soft_purge, []},
+ {load_module, ssh_connection_manager, soft_purge, soft_purge, []},
+ {load_module, ssh_auth, soft_purge, soft_purge, []},
+ {load_module, ssh_channel, soft_purge, soft_purge, []},
+ {load_module, ssh_file, soft_purge, soft_purge, []}]},
+ {load_module, ssh, soft_purge, soft_purge, []}]},
+ {<<"2.0\\.*">>, [{restart_application, ssh}]},
+ {<<"1\\.*">>, [{restart_application, ssh}]}
],
[
- {"2.0.8", [{load_module, ssh_sftpd_file_api, soft_purge, soft_purge, []},
- {load_module, ssh_channel, soft_purge, soft_purge, []}]},
- {"2.0.7", [{load_module, ssh_sftp, soft_purge, soft_purge, []}]},
- {"2.0.6", [{load_module, ssh_userreg, soft_purge, soft_purge, []},
- {load_module, ssh_sftp, soft_purge, soft_purge, []}]},
- {"2.0.5", [{load_module, ssh_userreg, soft_purge, soft_purge, []},
- {load_module, ssh_sftp, soft_purge, soft_purge, []},
- {load_module, ssh_connection_handler, soft_purge, soft_purge, [ssh_userreg]}]}
+ {<<"2.1">>,[{load_module, ssh_sftpd_file_api, soft_purge, soft_purge, []},
+ {load_module, ssh_connection, soft_purge, soft_purge, []},
+ {load_module, ssh_connection_manager, soft_purge, soft_purge, []},
+ {load_module, ssh_auth, soft_purge, soft_purge, []},
+ {load_module, ssh_channel, soft_purge, soft_purge, []},
+ {load_module, ssh_file, soft_purge, soft_purge, []}]},
+ {load_module, ssh, soft_purge, soft_purge, []}]},
+ {<<"2.0\\.*">>, [{restart_application, ssh}]},
+ {<<"1\\.*">>, [{restart_application, ssh}]}
]
}.
-
-
diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl
index cada109df0..3395f73884 100644
--- a/lib/ssh/src/ssh.erl
+++ b/lib/ssh/src/ssh.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -23,6 +23,7 @@
-include("ssh.hrl").
-include("ssh_connect.hrl").
+-include_lib("public_key/include/public_key.hrl").
-export([start/0, start/1, stop/0, connect/3, connect/4, close/1, connection_info/2,
channel_info/3,
@@ -30,6 +31,9 @@
stop_listener/1, stop_listener/2, stop_daemon/1, stop_daemon/2,
shell/1, shell/2, shell/3]).
+-deprecated({sign_data, 2, next_major_release}).
+-deprecated({verify_data, 3, next_major_release}).
+
-export([sign_data/2, verify_data/3]).
%%--------------------------------------------------------------------
@@ -68,48 +72,41 @@ stop() ->
connect(Host, Port, Options) ->
connect(Host, Port, Options, infinity).
connect(Host, Port, Options, Timeout) ->
- {SocketOpts, Opts} = handle_options(Options),
- DisableIpv6 = proplists:get_value(ip_v6_disabled, Opts, false),
- Inet = inetopt(DisableIpv6),
+ case handle_options(Options) of
+ {error, _Reason} = Error ->
+ Error;
+ {SocketOptions, SshOptions} ->
+ DisableIpv6 = proplists:get_value(ip_v6_disabled, SshOptions, false),
+ Inet = inetopt(DisableIpv6),
+ do_connect(Host, Port, [Inet | SocketOptions],
+ [{host, Host} | SshOptions], Timeout, DisableIpv6)
+ end.
+
+do_connect(Host, Port, SocketOptions, SshOptions, Timeout, DisableIpv6) ->
try sshc_sup:start_child([[{address, Host}, {port, Port},
- {role, client},
- {channel_pid, self()},
- {socket_opts, [Inet | SocketOpts]},
- {ssh_opts, [{host, Host}| Opts]}]]) of
+ {role, client},
+ {channel_pid, self()},
+ {socket_opts, SocketOptions},
+ {ssh_opts, SshOptions}]]) of
{ok, ConnectionSup} ->
{ok, Manager} =
- ssh_connection_controler:connection_manager(ConnectionSup),
- MRef = erlang:monitor(process, Manager),
+ ssh_connection_sup:connection_manager(ConnectionSup),
receive
{Manager, is_connected} ->
- do_demonitor(MRef, Manager),
{ok, Manager};
%% When the connection fails
%% ssh_connection_sup:connection_manager
%% might return undefined as the connection manager
%% could allready have terminated, so we will not
%% match the Manager in this case
+ {_, not_connected, {error, econnrefused}} when DisableIpv6 == false ->
+ do_connect(Host, Port, proplists:delete(inet6, SocketOptions),
+ SshOptions, Timeout, true);
{_, not_connected, {error, Reason}} ->
- do_demonitor(MRef, Manager),
{error, Reason};
{_, not_connected, Other} ->
- do_demonitor(MRef, Manager),
- {error, Other};
- {'DOWN', MRef, _, Manager, Reason} when is_pid(Manager) ->
- error_logger:warning_report([{ssh, connect},
- {diagnose,
- "Connection was closed before properly set up."},
- {host, Host},
- {port, Port},
- {reason, Reason}]),
- receive %% Clear EXIT message from queue
- {'EXIT', Manager, _What} ->
- {error, channel_closed}
- after 0 ->
- {error, channel_closed}
- end
+ {error, Other}
after Timeout ->
- do_demonitor(MRef, Manager),
ssh_connection_manager:stop(Manager),
{error, timeout}
end
@@ -118,16 +115,6 @@ connect(Host, Port, Options, Timeout) ->
{error, ssh_not_started}
end.
-do_demonitor(MRef, Manager) ->
- erlang:demonitor(MRef),
- receive
- {'DOWN', MRef, _, Manager, _} ->
- ok
- after 0 ->
- ok
- end.
-
-
%%--------------------------------------------------------------------
%% Function: close(ConnectionRef) -> ok
%%
@@ -185,7 +172,7 @@ daemon(HostAddr, Port, Options0) ->
{HostAddr, inet6,
[{ip, HostAddr} | Options1]}
end,
- start_daemon(Host, Port, [{role, server} | Options], Inet).
+ start_daemon(Host, Port, Options, Inet).
%%--------------------------------------------------------------------
%% Function: stop_listener(SysRef) -> ok
@@ -247,48 +234,18 @@ shell(Host, Port, Options) ->
Error
end.
-
-%%--------------------------------------------------------------------
-%% Function: sign_data(Data, Algorithm) -> binary() |
-%% {error, Reason}
-%%
-%% Data = binary()
-%% Algorithm = "ssh-rsa"
-%%
-%% Description: Use SSH key to sign data.
-%%--------------------------------------------------------------------
-sign_data(Data, Algorithm) when is_binary(Data) ->
- case ssh_file:private_identity_key(Algorithm,[]) of
- {ok, Key} when Algorithm == "ssh-rsa" ->
- ssh_rsa:sign(Key, Data);
- Error ->
- Error
- end.
-
-%%--------------------------------------------------------------------
-%% Function: verify_data(Data, Signature, Algorithm) -> ok |
-%% {error, Reason}
-%%
-%% Data = binary()
-%% Signature = binary()
-%% Algorithm = "ssh-rsa"
-%%
-%% Description: Use SSH signature to verify data.
-%%--------------------------------------------------------------------
-verify_data(Data, Signature, Algorithm) when is_binary(Data), is_binary(Signature) ->
- case ssh_file:public_identity_key(Algorithm, []) of
- {ok, Key} when Algorithm == "ssh-rsa" ->
- ssh_rsa:verify(Key, Data, Signature);
- Error ->
- Error
- end.
-
-
%%--------------------------------------------------------------------
%%% Internal functions
%%--------------------------------------------------------------------
start_daemon(Host, Port, Options, Inet) ->
- {SocketOpts, Opts} = handle_options(Options),
+ case handle_options(Options) of
+ {error, _Reason} = Error ->
+ Error;
+ {SocketOptions, SshOptions}->
+ do_start_daemon(Host, Port,[{role, server} |SshOptions] , [Inet | SocketOptions])
+ end.
+
+do_start_daemon(Host, Port, Options, SocketOptions) ->
case ssh_system_sup:system_supervisor(Host, Port) of
undefined ->
%% TODO: It would proably make more sense to call the
@@ -296,8 +253,8 @@ start_daemon(Host, Port, Options, Inet) ->
%% monent. The name is a legacy name!
try sshd_sup:start_child([{address, Host},
{port, Port}, {role, server},
- {socket_opts, [Inet | SocketOpts]},
- {ssh_opts, Opts}]) of
+ {socket_opts, SocketOptions},
+ {ssh_opts, Options}]) of
{ok, SysSup} ->
{ok, SysSup};
{error, {already_started, _}} ->
@@ -316,69 +273,205 @@ start_daemon(Host, Port, Options, Inet) ->
end.
handle_options(Opts) ->
- handle_options(proplists:unfold(Opts), [], []).
-handle_options([], SockOpts, Opts) ->
- {SockOpts, Opts};
-%% TODO: Could do some type checks here on plain ssh-opts
-handle_options([{system_dir, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{user_dir, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{user_dir_fun, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{silently_accept_hosts, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{user_interaction, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{public_key_alg, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{connect_timeout, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{user, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{password, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{user_passwords, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{pwdfun, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{user_auth, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{key_cb, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{role, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{channel, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{compression, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{allow_user_interaction, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{infofun, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{connectfun, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{disconnectfun , _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{failfun, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{ip_v6_disabled, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]);
-handle_options([{ip, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, [Opt |SockOpts], Opts);
-handle_options([{ifaddr, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, [Opt |SockOpts], Opts);
-handle_options([{fd, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, [Opt | SockOpts], Opts);
-handle_options([{nodelay, _} = Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, [Opt | SockOpts], Opts);
-handle_options([Opt | Rest], SockOpts, Opts) ->
- handle_options(Rest, SockOpts, [Opt | Opts]).
+ try handle_option(proplists:unfold(Opts), [], []) of
+ {_,_} = Options ->
+ Options
+ catch
+ throw:Error ->
+ Error
+ end.
+
+handle_option([], SocketOptions, SshOptions) ->
+ {SocketOptions, SshOptions};
+handle_option([{system_dir, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{user_dir, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{user_dir_fun, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{silently_accept_hosts, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{user_interaction, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{public_key_alg, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{connect_timeout, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{user, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{dsa_pass_phrase, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{rsa_pass_phrase, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{password, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{user_passwords, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{pwdfun, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{user_auth, _} = Opt | Rest],SocketOptions, SshOptions ) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{key_cb, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{role, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{compression, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+%%Backwards compatibility
+handle_option([{allow_user_interaction, Value} | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option({user_interaction, Value}) | SshOptions]);
+handle_option([{infofun, _} = Opt | Rest],SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{connectfun, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{disconnectfun, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{failfun, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{ip_v6_disabled, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{transport, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{subsystems, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{ssh_cli, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{shell, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{exec, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{auth_methods, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, [handle_inet_option(Opt) | SocketOptions], SshOptions).
+
+handle_ssh_option({system_dir, Value} = Opt) when is_list(Value) ->
+ Opt;
+handle_ssh_option({user_dir, Value} = Opt) when is_list(Value) ->
+ Opt;
+handle_ssh_option({user_dir_fun, Value} = Opt) when is_function(Value) ->
+ Opt;
+handle_ssh_option({silently_accept_hosts, Value} = Opt) when Value == true; Value == false ->
+ Opt;
+handle_ssh_option({user_interaction, Value} = Opt) when Value == true; Value == false ->
+ Opt;
+handle_ssh_option({public_key_alg, Value} = Opt) when Value == ssh_rsa; Value == ssh_dsa ->
+ Opt;
+handle_ssh_option({connect_timeout, Value} = Opt) when is_integer(Value); Value == infinity ->
+ Opt;
+handle_ssh_option({user, Value} = Opt) when is_list(Value) ->
+ Opt;
+handle_ssh_option({dsa_pass_phrase, Value} = Opt) when is_list(Value) ->
+ Opt;
+handle_ssh_option({rsa_pass_phrase, Value} = Opt) when is_list(Value) ->
+ Opt;
+handle_ssh_option({password, Value} = Opt) when is_list(Value) ->
+ Opt;
+handle_ssh_option({user_passwords, Value} = Opt) when is_list(Value)->
+ Opt;
+handle_ssh_option({pwdfun, Value} = Opt) when is_function(Value) ->
+ Opt;
+handle_ssh_option({user_auth, Value} = Opt) when is_function(Value) ->
+ Opt;
+handle_ssh_option({key_cb, Value} = Opt) when is_atom(Value) ->
+ Opt;
+handle_ssh_option({compression, Value} = Opt) when is_atom(Value) ->
+ Opt;
+handle_ssh_option({exec, {Module, Function, _}} = Opt) when is_atom(Module),
+ is_atom(Function) ->
+
+ Opt;
+handle_ssh_option({auth_methods, Value} = Opt) when is_list(Value) ->
+ Opt;
+handle_ssh_option({infofun, Value} = Opt) when is_function(Value) ->
+ Opt;
+handle_ssh_option({connectfun, Value} = Opt) when is_function(Value) ->
+ Opt;
+handle_ssh_option({disconnectfun , Value} = Opt) when is_function(Value) ->
+ Opt;
+handle_ssh_option({failfun, Value} = Opt) when is_function(Value) ->
+ Opt;
+handle_ssh_option({ip_v6_disabled, Value} = Opt) when Value == true;
+ Value == false ->
+ Opt;
+handle_ssh_option({transport, {Protocol, Cb, ClosTag}} = Opt) when is_atom(Protocol),
+ is_atom(Cb),
+ is_atom(ClosTag) ->
+ Opt;
+handle_ssh_option({subsystems, Value} = Opt) when is_list(Value) ->
+ Opt;
+handle_ssh_option({ssh_cli, {Cb, _}}= Opt) when is_atom(Cb) ->
+ Opt;
+handle_ssh_option({shell, {Module, Function, _}} = Opt) when is_atom(Module),
+ is_atom(Function) ->
+ Opt;
+handle_ssh_option({shell, Value} = Opt) when is_function(Value) ->
+ Opt;
+handle_ssh_option(Opt) ->
+ throw({error, {eoptions, Opt}}).
+
+handle_inet_option({active, _} = Opt) ->
+ throw({error, {{eoptions, Opt}, "Ssh has built in flow control, "
+ "and activ is handled internaly user is not allowd"
+ "to specify this option"}});
+handle_inet_option({inet, _} = Opt) ->
+ throw({error, {{eoptions, Opt},"Is set internaly use ip_v6_disabled to"
+ " enforce iv4 in the server, client will fallback to ipv4 if"
+ " it can not use ipv6"}});
+handle_inet_option({reuseaddr, _} = Opt) ->
+ throw({error, {{eoptions, Opt},"Is set internaly user is not allowd"
+ "to specify this option"}});
+%% Option verified by inet
+handle_inet_option(Opt) ->
+ Opt.
%% Has IPv6 been disabled?
inetopt(true) ->
inet;
inetopt(false) ->
- inet6.
+ case gen_tcp:listen(0, [inet6, {ip, loopback}]) of
+ {ok, Dummyport} ->
+ gen_tcp:close(Dummyport),
+ inet6;
+ _ ->
+ inet
+ end.
+%%%
+%% Deprecated
+%%%
+
+%%--------------------------------------------------------------------
+%% Function: sign_data(Data, Algorithm) -> binary() |
+%% {error, Reason}
+%%
+%% Data = binary()
+%% Algorithm = "ssh-rsa"
+%%
+%% Description: Use SSH key to sign data.
+%%--------------------------------------------------------------------
+sign_data(Data, Algorithm) when is_binary(Data) ->
+ case ssh_file:user_key(Algorithm,[]) of
+ {ok, Key} when Algorithm == "ssh-rsa" ->
+ public_key:sign(Data, sha, Key);
+ Error ->
+ Error
+ end.
+%%--------------------------------------------------------------------
+%% Function: verify_data(Data, Signature, Algorithm) -> ok |
+%% {error, Reason}
+%%
+%% Data = binary()
+%% Signature = binary()
+%% Algorithm = "ssh-rsa"
+%%
+%% Description: Use SSH signature to verify data.
+%%--------------------------------------------------------------------
+verify_data(Data, Signature, Algorithm) when is_binary(Data), is_binary(Signature) ->
+ case ssh_file:user_key(Algorithm, []) of
+ {ok, #'RSAPrivateKey'{publicExponent = E, modulus = N}} when Algorithm == "ssh-rsa" ->
+ public_key:verify(Data, sha, Signature, #'RSAPublicKey'{publicExponent = E, modulus = N});
+ Error ->
+ Error
+ end.
diff --git a/lib/ssh/src/ssh.hrl b/lib/ssh/src/ssh.hrl
index ac249b05e3..da5750b6c3 100644
--- a/lib/ssh/src/ssh.hrl
+++ b/lib/ssh/src/ssh.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -54,18 +54,6 @@
-define(string(X), << ?STRING(list_to_binary(X)) >> ).
-define(binary(X), << ?STRING(X) >>).
--ifdef(debug).
--define(dbg(Debug, Fmt, As),
- case (Debug) of
- true ->
- io:format([$# | (Fmt)], (As));
- _ ->
- ok
- end).
--else.
--define(dbg(Debug, Fmt, As), ok).
--endif.
-
-define(SSH_CIPHER_NONE, 0).
-define(SSH_CIPHER_3DES, 3).
-define(SSH_CIPHER_AUTHFILE, ?SSH_CIPHER_3DES).
@@ -138,7 +126,8 @@
userauth_quiet_mode, % boolean()
userauth_supported_methods , %
userauth_methods,
- userauth_preference
+ userauth_preference,
+ available_host_keys
}).
-record(alg,
diff --git a/lib/ssh/src/ssh_acceptor.erl b/lib/ssh/src/ssh_acceptor.erl
index 59fbd24cf5..d023656c32 100644
--- a/lib/ssh/src/ssh_acceptor.erl
+++ b/lib/ssh/src/ssh_acceptor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -86,11 +86,11 @@ handle_connection(Callback, Address, Port, Options, Socket) ->
{ok, SubSysSup} = ssh_system_sup:start_subsystem(SystemSup, Options),
ConnectionSup = ssh_system_sup:connection_supervisor(SystemSup),
{ok, Pid} =
- ssh_connection_controler:start_manager_child(ConnectionSup,
- [server, Socket, Options, SubSysSup]),
+ ssh_connection_sup:start_manager_child(ConnectionSup,
+ [server, Socket, Options]),
Callback:controlling_process(Socket, Pid),
SshOpts = proplists:get_value(ssh_opts, Options),
- Pid ! {start_connection, server, [Address, Port, Socket, SshOpts]}.
+ Pid ! {start_connection, server, [Address, Port, Socket, SshOpts, SubSysSup]}.
handle_error(timeout) ->
ok;
diff --git a/lib/ssh/src/ssh_auth.erl b/lib/ssh/src/ssh_auth.erl
index 9dbd95886e..aa452a8e09 100644
--- a/lib/ssh/src/ssh_auth.erl
+++ b/lib/ssh/src/ssh_auth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -21,8 +21,9 @@
-module(ssh_auth).
--include("ssh.hrl").
+-include_lib("public_key/include/public_key.hrl").
+-include("ssh.hrl").
-include("ssh_auth.hrl").
-include("ssh_transport.hrl").
@@ -36,18 +37,21 @@
%%--------------------------------------------------------------------
%%% Internal application API
%%--------------------------------------------------------------------
-publickey_msg([Cb, #ssh{user = User,
+publickey_msg([Alg, #ssh{user = User,
session_id = SessionId,
service = Service,
opts = Opts} = Ssh]) ->
+
+ Hash = sha, %% Maybe option?!
ssh_bits:install_messages(userauth_pk_messages()),
- Alg = Cb:alg_name(),
- case ssh_file:private_identity_key(Alg, Opts) of
- {ok, PrivKey} ->
- PubKeyBlob = ssh_file:encode_public_key(PrivKey),
+ KeyCb = proplists:get_value(key_cb, Opts, ssh_file),
+
+ case KeyCb:user_key(Alg, Opts) of
+ {ok, Key} ->
+ PubKeyBlob = encode_public_key(Key),
SigData = build_sig_data(SessionId,
- User, Service, Alg, PubKeyBlob),
- Sig = Cb:sign(PrivKey, SigData),
+ User, Service, PubKeyBlob, Alg),
+ Sig = ssh_transport:sign(SigData, Hash, Key),
SigBlob = list_to_binary([?string(Alg), ?binary(Sig)]),
ssh_transport:ssh_packet(
#ssh_msg_userauth_request{user = User,
@@ -58,8 +62,8 @@ publickey_msg([Cb, #ssh{user = User,
?binary(PubKeyBlob),
?binary(SigBlob)]},
Ssh);
- _Error ->
- not_ok
+ _Error ->
+ not_ok
end.
password_msg([#ssh{opts = Opts, io_cb = IoCb,
@@ -67,29 +71,40 @@ password_msg([#ssh{opts = Opts, io_cb = IoCb,
ssh_bits:install_messages(userauth_passwd_messages()),
Password = case proplists:get_value(password, Opts) of
undefined ->
- IoCb:read_password("ssh password: ");
+ user_interaction(IoCb);
PW ->
PW
end,
- ssh_transport:ssh_packet(
- #ssh_msg_userauth_request{user = User,
- service = Service,
- method = "password",
- data =
- <<?BOOLEAN(?FALSE),
- ?STRING(list_to_binary(Password))>>},
- Ssh).
+ case Password of
+ not_ok ->
+ not_ok;
+ _ ->
+ ssh_transport:ssh_packet(
+ #ssh_msg_userauth_request{user = User,
+ service = Service,
+ method = "password",
+ data =
+ <<?BOOLEAN(?FALSE),
+ ?STRING(list_to_binary(Password))>>},
+ Ssh)
+ end.
+
+user_interaction(ssh_no_io) ->
+ not_ok;
+user_interaction(IoCb) ->
+ IoCb:read_password("ssh password: ").
+
%% See RFC 4256 for info on keyboard-interactive
keyboard_interactive_msg([#ssh{user = User,
- service = Service} = Ssh]) ->
+ service = Service} = Ssh]) ->
ssh_bits:install_messages(userauth_keyboard_interactive_messages()),
ssh_transport:ssh_packet(
#ssh_msg_userauth_request{user = User,
service = Service,
method = "keyboard-interactive",
data = << ?STRING(<<"">>),
- ?STRING(<<>>) >> },
+ ?STRING(<<>>) >> },
Ssh).
service_request_msg(Ssh) ->
@@ -103,12 +118,11 @@ init_userauth_request_msg(#ssh{opts = Opts} = Ssh) ->
service = "ssh-connection",
method = "none",
data = <<>>},
- CbFirst = proplists:get_value(public_key_alg, Opts,
- ?PREFERRED_PK_ALG),
- CbSecond = other_cb(CbFirst),
- AllowUserInt = proplists:get_value(allow_user_interaction, Opts,
- true),
- Prefs = method_preference(CbFirst, CbSecond, AllowUserInt),
+ FirstAlg = algorithm(proplists:get_value(public_key_alg, Opts,
+ ?PREFERRED_PK_ALG)),
+ SecondAlg = other_alg(FirstAlg),
+ AllowUserInt = proplists:get_value(user_interaction, Opts, true),
+ Prefs = method_preference(FirstAlg, SecondAlg, AllowUserInt),
ssh_transport:ssh_packet(Msg, Ssh#ssh{user = User,
userauth_preference = Prefs,
userauth_methods = none,
@@ -192,12 +206,12 @@ handle_userauth_request(#ssh_msg_userauth_request{user = User,
?TRUE ->
case verify_sig(SessionId, User, "ssh-connection", Alg,
KeyBlob, SigWLen, Opts) of
- ok ->
+ true ->
{authorized, User,
ssh_transport:ssh_packet(
#ssh_msg_userauth_success{}, Ssh)};
- {error, Reason} ->
- {not_authorized, {User, {error, Reason}},
+ false ->
+ {not_authorized, {User, {error, "Invalid signature"}},
ssh_transport:ssh_packet(#ssh_msg_userauth_failure{
authentications="publickey,password",
partial_success = false}, Ssh)}
@@ -228,7 +242,6 @@ handle_userauth_info_request(
PromptInfos = decode_keyboard_interactive_prompts(NumPrompts,Data),
Resps = keyboard_interact_get_responses(IoCb, Opts,
Name, Instr, PromptInfos),
- %%?dbg(true, "keyboard_interactive_reply: resps=~n#~p ~n", [Resps]),
RespBin = list_to_binary(
lists:map(fun(S) -> <<?STRING(list_to_binary(S))>> end,
Resps)),
@@ -263,15 +276,15 @@ userauth_messages() ->
%%--------------------------------------------------------------------
%%% Internal functions
%%--------------------------------------------------------------------
-method_preference(Callback1, Callback2, true) ->
- [{"publickey", ?MODULE, publickey_msg, [Callback1]},
- {"publickey", ?MODULE, publickey_msg,[Callback2]},
+method_preference(Alg1, Alg2, true) ->
+ [{"publickey", ?MODULE, publickey_msg, [Alg1]},
+ {"publickey", ?MODULE, publickey_msg,[Alg2]},
{"password", ?MODULE, password_msg, []},
{"keyboard-interactive", ?MODULE, keyboard_interactive_msg, []}
];
-method_preference(Callback1, Callback2, false) ->
- [{"publickey", ?MODULE, publickey_msg, [Callback1]},
- {"publickey", ?MODULE, publickey_msg,[Callback2]},
+method_preference(Alg1, Alg2, false) ->
+ [{"publickey", ?MODULE, publickey_msg, [Alg1]},
+ {"publickey", ?MODULE, publickey_msg,[Alg2]},
{"password", ?MODULE, password_msg, []}
].
@@ -295,7 +308,6 @@ user_name(Opts) ->
end.
check_password(User, Password, Opts) ->
- %%?dbg(true, " ~p ~p ~p ~n", [User, Password, Opts]),
case proplists:get_value(pwdfun, Opts) of
undefined ->
Static = get_password_option(Opts, User),
@@ -312,25 +324,22 @@ get_password_option(Opts, User) ->
end.
verify_sig(SessionId, User, Service, Alg, KeyBlob, SigWLen, Opts) ->
- case ssh_file:lookup_user_key(User, Alg, Opts) of
- {ok, OurKey} ->
- {ok, Key} = ssh_file:decode_public_key_v2(KeyBlob, Alg),
- case OurKey of
- Key ->
- NewSig = build_sig_data(SessionId,
- User, Service, Alg, KeyBlob),
- <<?UINT32(AlgSigLen), AlgSig:AlgSigLen/binary>> = SigWLen,
- <<?UINT32(AlgLen), _Alg:AlgLen/binary,
- ?UINT32(SigLen), Sig:SigLen/binary>> = AlgSig,
- M = alg_to_module(Alg),
- M:verify(OurKey, NewSig, Sig);
- _ ->
- {error, key_unacceptable}
- end;
- Error -> Error
+ {ok, Key} = decode_public_key_v2(KeyBlob, Alg),
+ KeyCb = proplists:get_value(key_cb, Opts, ssh_file),
+
+ case KeyCb:is_auth_key(Key, User, Alg, Opts) of
+ true ->
+ PlainText = build_sig_data(SessionId, User,
+ Service, KeyBlob, Alg),
+ <<?UINT32(AlgSigLen), AlgSig:AlgSigLen/binary>> = SigWLen,
+ <<?UINT32(AlgLen), _Alg:AlgLen/binary,
+ ?UINT32(SigLen), Sig:SigLen/binary>> = AlgSig,
+ ssh_transport:verify(PlainText, sha, Sig, Key);
+ false ->
+ false
end.
-build_sig_data(SessionId, User, Service, Alg, KeyBlob) ->
+build_sig_data(SessionId, User, Service, KeyBlob, Alg) ->
Sig = [?binary(SessionId),
?SSH_MSG_USERAUTH_REQUEST,
?string(User),
@@ -341,6 +350,11 @@ build_sig_data(SessionId, User, Service, Alg, KeyBlob) ->
?binary(KeyBlob)],
list_to_binary(Sig).
+algorithm(ssh_rsa) ->
+ "ssh-rsa";
+algorithm(ssh_dsa) ->
+ "ssh-dss".
+
decode_keyboard_interactive_prompts(NumPrompts, Data) ->
Types = lists:append(lists:duplicate(NumPrompts, [string, boolean])),
pairwise_tuplify(ssh_bits:decode(Data, Types)).
@@ -412,12 +426,28 @@ userauth_pk_messages() ->
binary]} % key blob
].
-alg_to_module("ssh-dss") ->
- ssh_dsa;
-alg_to_module("ssh-rsa") ->
- ssh_rsa.
-
-other_cb(ssh_rsa) ->
- ssh_dsa;
-other_cb(ssh_dsa) ->
- ssh_rsa.
+other_alg("ssh-rsa") ->
+ "ssh-dss";
+other_alg("ssh-dss") ->
+ "ssh-rsa".
+decode_public_key_v2(K_S, "ssh-rsa") ->
+ case ssh_bits:decode(K_S,[string,mpint,mpint]) of
+ ["ssh-rsa", E, N] ->
+ {ok, #'RSAPublicKey'{publicExponent = E, modulus = N}};
+ _ ->
+ {error, bad_format}
+ end;
+decode_public_key_v2(K_S, "ssh-dss") ->
+ case ssh_bits:decode(K_S,[string,mpint,mpint,mpint,mpint]) of
+ ["ssh-dss",P,Q,G,Y] ->
+ {ok, {Y, #'Dss-Parms'{p = P, q = Q, g = G}}};
+ _ ->
+ {error, bad_format}
+ end;
+decode_public_key_v2(_, _) ->
+ {error, bad_format}.
+
+encode_public_key(#'RSAPrivateKey'{publicExponent = E, modulus = N}) ->
+ ssh_bits:encode(["ssh-rsa",E,N], [string,mpint,mpint]);
+encode_public_key(#'DSAPrivateKey'{p = P, q = Q, g = G, y = Y}) ->
+ ssh_bits:encode(["ssh-dss",P,Q,G,Y], [string,mpint,mpint,mpint,mpint]).
diff --git a/lib/ssh/src/ssh_auth.hrl b/lib/ssh/src/ssh_auth.hrl
index 7d7bad4436..e74ee10041 100644
--- a/lib/ssh/src/ssh_auth.hrl
+++ b/lib/ssh/src/ssh_auth.hrl
@@ -21,7 +21,7 @@
%%% Description: Ssh User Authentication Protocol
--define(SUPPORTED_AUTH_METHODS, "publickey,keyboard_interactive,password").
+-define(SUPPORTED_AUTH_METHODS, "publickey,keyboard-interactive,password").
-define(PREFERRED_PK_ALG, ssh_rsa).
diff --git a/lib/ssh/src/ssh_bits.erl b/lib/ssh/src/ssh_bits.erl
index 3f0a06575c..5841f06d70 100644
--- a/lib/ssh/src/ssh_bits.erl
+++ b/lib/ssh/src/ssh_bits.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -105,16 +105,12 @@ bignum(X) ->
install_messages(Codes) ->
foreach(fun({Name, Code, Ts}) ->
- %% ?dbg(true, "install msg: ~s = ~w ~w~n",
-%% [Name,Code,Ts]),
put({msg_name,Code}, {Name,Ts}),
put({msg_code,Name}, {Code,Ts})
end, Codes).
uninstall_messages(Codes) ->
foreach(fun({Name, Code, _Ts}) ->
- %% ?dbg(true, "uninstall msg: ~s = ~w ~w~n",
-%% [Name,Code,_Ts]),
erase({msg_name,Code}),
erase({msg_code,Name})
end, Codes).
diff --git a/lib/ssh/src/ssh_channel.erl b/lib/ssh/src/ssh_channel.erl
index 7b600ed8b2..1938858420 100644
--- a/lib/ssh/src/ssh_channel.erl
+++ b/lib/ssh/src/ssh_channel.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -215,7 +215,7 @@ handle_info({ssh_cm, ConnectionManager, {closed, ChannelId}},
close_sent = false} = State) ->
%% To be on the safe side, i.e. the manager has already been terminated.
(catch ssh_connection:close(ConnectionManager, ChannelId)),
- {stop, normal, State};
+ {stop, normal, State#state{close_sent = true}};
handle_info({ssh_cm, _, _} = Msg, #state{cm = ConnectionManager,
channel_cb = Module,
diff --git a/lib/ssh/src/ssh_connect.hrl b/lib/ssh/src/ssh_connect.hrl
index e06c9ea211..932b0642f1 100644
--- a/lib/ssh/src/ssh_connect.hrl
+++ b/lib/ssh/src/ssh_connect.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -253,7 +253,6 @@
-record(connection, {
requests = [], %% [{ChannelId, Pid}...] awaiting reply on request,
channel_cache,
- channel_pids = [],
port_bindings,
channel_id_seed,
cli_spec,
@@ -261,5 +260,6 @@
port,
options,
exec,
- sub_system_supervisor
+ sub_system_supervisor,
+ connection_supervisor
}).
diff --git a/lib/ssh/src/ssh_connection.erl b/lib/ssh/src/ssh_connection.erl
index 7b9e9185bf..e3b8ebfb79 100644
--- a/lib/ssh/src/ssh_connection.erl
+++ b/lib/ssh/src/ssh_connection.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -436,32 +436,32 @@ handle_msg(#ssh_msg_channel_window_adjust{recipient_channel = ChannelId,
#connection{channel_cache = Cache} = Connection,
ConnectionPid, _) ->
- #channel{send_window_size = Size} =
+ #channel{send_window_size = Size, remote_id = RemoteId} =
Channel0 = ssh_channel:cache_lookup(Cache, ChannelId),
-
+
{SendList, Channel} = %% TODO: Datatype 0 ?
update_send_window(Channel0#channel{send_window_size = Size + Add},
- 0, <<>>, Connection),
+ 0, undefined, Connection),
Replies = lists:map(fun({Type, Data}) ->
{connection_reply, ConnectionPid,
- channel_data_msg(ChannelId, Type, Data)}
+ channel_data_msg(RemoteId, Type, Data)}
end, SendList),
FlowCtrlMsgs = flow_control(Channel, Cache),
{{replies, Replies ++ FlowCtrlMsgs}, Connection};
handle_msg(#ssh_msg_channel_open{channel_type = "session" = Type,
- sender_channel = ChannelId,
+ sender_channel = RemoteId,
initial_window_size = WindowSz,
maximum_packet_size = PacketSz}, Connection0,
ConnectionPid, server) ->
- try setup_session(Connection0, ConnectionPid, ChannelId,
+ try setup_session(Connection0, ConnectionPid, RemoteId,
Type, WindowSz, PacketSz) of
Result ->
Result
catch _:_ ->
- FailMsg = channel_open_failure_msg(ChannelId,
+ FailMsg = channel_open_failure_msg(RemoteId,
?SSH_OPEN_CONNECT_FAILED,
"Connection refused", "en"),
{{replies, [{connection_reply, ConnectionPid, FailMsg}]},
@@ -532,9 +532,9 @@ handle_msg(#ssh_msg_channel_open{channel_type = "forwarded-tcpip",
{{replies, [{connection_reply, ConnectionPid, FailMsg}]}, Connection};
-handle_msg(#ssh_msg_channel_open{sender_channel = ChannelId}, Connection,
+handle_msg(#ssh_msg_channel_open{sender_channel = RemoteId}, Connection,
ConnectionPid, _) ->
- FailMsg = channel_open_failure_msg(ChannelId,
+ FailMsg = channel_open_failure_msg(RemoteId,
?SSH_OPEN_ADMINISTRATIVELY_PROHIBITED,
"Not allowed", "en"),
{{replies, [{connection_reply, ConnectionPid, FailMsg}]}, Connection};
@@ -720,14 +720,17 @@ handle_msg(#ssh_msg_channel_request{request_type = "env"},
handle_msg(#ssh_msg_channel_request{recipient_channel = ChannelId,
request_type = _Other,
- want_reply = WantReply}, Connection,
+ want_reply = WantReply}, #connection{channel_cache = Cache} = Connection,
ConnectionPid, _) ->
- ?dbg(true, "ssh_msg ssh_msg_channel_request: Other=~p\n",
- [_Other]),
if WantReply == true ->
- FailMsg = channel_failure_msg(ChannelId),
- {{replies, [{connection_reply, ConnectionPid, FailMsg}]},
- Connection};
+ case ssh_channel:cache_lookup(Cache, ChannelId) of
+ #channel{remote_id = RemoteId} ->
+ FailMsg = channel_failure_msg(RemoteId),
+ {{replies, [{connection_reply, ConnectionPid, FailMsg}]},
+ Connection};
+ undefined -> %% Chanel has been closed
+ {noreply, Connection}
+ end;
true ->
{noreply, Connection}
end;
@@ -746,8 +749,8 @@ handle_msg(#ssh_msg_global_request{name = _Type,
%%% This transport message will also be handled at the connection level
handle_msg(#ssh_msg_disconnect{code = Code,
- description = Description,
- language = _Lang },
+ description = Description,
+ language = _Lang },
#connection{channel_cache = Cache} = Connection0, _, _) ->
{Connection, Replies} =
ssh_channel:cache_foldl(fun(Channel, {Connection1, Acc}) ->
@@ -781,7 +784,7 @@ handle_cli_msg(#connection{channel_cache = Cache} = Connection0,
handle_cli_msg(Connection0, _, Channel, Reply0) ->
{Reply, Connection} = reply_msg(Channel, Connection0, Reply0),
{{replies, [Reply]}, Connection}.
-
+
channel_eof_msg(ChannelId) ->
#ssh_msg_channel_eof{recipient_channel = ChannelId}.
@@ -1070,14 +1073,15 @@ request_reply_or_data(#channel{local_id = ChannelId, user = ChannelPid},
false ->
{{channel_data, ChannelPid, Reply}, Connection}
end.
+update_send_window(Channel, _, undefined,
+ #connection{channel_cache = Cache}) ->
+ do_update_send_window(Channel, Channel#channel.send_buf, Cache);
+
+update_send_window(Channel, DataType, Data,
+ #connection{channel_cache = Cache}) ->
+ do_update_send_window(Channel, Channel#channel.send_buf ++ [{DataType, Data}], Cache).
-update_send_window(Channel0, DataType, Data,
- #connection{channel_cache = Cache}) ->
- Buf0 = if Data == <<>> ->
- Channel0#channel.send_buf;
- true ->
- Channel0#channel.send_buf ++ [{DataType, Data}]
- end,
+do_update_send_window(Channel0, Buf0, Cache) ->
{Buf1, NewSz, Buf2} = get_window(Buf0,
Channel0#channel.send_packet_size,
Channel0#channel.send_window_size),
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl
index 00b30e5434..5b3d1b8a1b 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -41,7 +41,7 @@
-export([hello/2, kexinit/2, key_exchange/2, new_keys/2,
userauth/2, connected/2]).
--export([init/1, state_name/3, handle_event/3,
+-export([init/1, handle_event/3,
handle_sync_event/4, handle_info/3, terminate/3, code_change/4]).
%% spawn export
@@ -106,22 +106,28 @@ peer_address(ConnectionHandler) ->
%% initialize.
%%--------------------------------------------------------------------
init([Role, Manager, Socket, SshOpts]) ->
+ process_flag(trap_exit, true),
{NumVsn, StrVsn} = ssh_transport:versions(Role, SshOpts),
ssh_bits:install_messages(ssh_transport:transport_messages(NumVsn)),
{Protocol, Callback, CloseTag} =
proplists:get_value(transport, SshOpts, {tcp, gen_tcp, tcp_closed}),
- Ssh = init_ssh(Role, NumVsn, StrVsn, SshOpts, Socket),
- {ok, hello, #state{ssh_params =
- Ssh#ssh{send_sequence = 0, recv_sequence = 0},
- socket = Socket,
- decoded_data_buffer = <<>>,
- encoded_data_buffer = <<>>,
- transport_protocol = Protocol,
- transport_cb = Callback,
- transport_close_tag = CloseTag,
- manager = Manager,
- opts = SshOpts
- }}.
+ try init_ssh(Role, NumVsn, StrVsn, SshOpts, Socket) of
+ Ssh ->
+ {ok, hello, #state{ssh_params =
+ Ssh#ssh{send_sequence = 0, recv_sequence = 0},
+ socket = Socket,
+ decoded_data_buffer = <<>>,
+ encoded_data_buffer = <<>>,
+ transport_protocol = Protocol,
+ transport_cb = Callback,
+ transport_close_tag = CloseTag,
+ manager = Manager,
+ opts = SshOpts
+ }}
+ catch
+ exit:Reason ->
+ {stop, {shutdown, Reason}}
+ end.
%%--------------------------------------------------------------------
%% Function:
%% state_name(Event, State) -> {next_state, NextStateName, NextState}|
@@ -179,7 +185,12 @@ kexinit({#ssh_msg_kexinit{} = Kex, Payload},
next_packet(State#state{ssh_params = Ssh})}
catch
#ssh_msg_disconnect{} = DisconnectMsg ->
- handle_disconnect(DisconnectMsg, State)
+ handle_disconnect(DisconnectMsg, State);
+ _:Error ->
+ Desc = log_error(Error),
+ handle_disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = Desc,
+ language = "en"}, State)
end.
key_exchange(#ssh_msg_kexdh_init{} = Msg,
@@ -192,7 +203,12 @@ key_exchange(#ssh_msg_kexdh_init{} = Msg,
{next_state, new_keys, next_packet(State#state{ssh_params = Ssh})}
catch
#ssh_msg_disconnect{} = DisconnectMsg ->
- handle_disconnect(DisconnectMsg, State)
+ handle_disconnect(DisconnectMsg, State);
+ _:Error ->
+ Desc = log_error(Error),
+ handle_disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = Desc,
+ language = "en"}, State)
end;
key_exchange(#ssh_msg_kexdh_reply{} = Msg,
@@ -203,7 +219,12 @@ key_exchange(#ssh_msg_kexdh_reply{} = Msg,
{next_state, new_keys, next_packet(State#state{ssh_params = Ssh})}
catch
#ssh_msg_disconnect{} = DisconnectMsg ->
- handle_disconnect(DisconnectMsg, State)
+ handle_disconnect(DisconnectMsg, State);
+ _:Error ->
+ Desc = log_error(Error),
+ handle_disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = Desc,
+ language = "en"}, State)
end;
key_exchange(#ssh_msg_kex_dh_gex_group{} = Msg,
@@ -216,7 +237,12 @@ key_exchange(#ssh_msg_kex_dh_gex_group{} = Msg,
{next_state, new_keys, next_packet(State#state{ssh_params = Ssh})}
catch
#ssh_msg_disconnect{} = DisconnectMsg ->
- handle_disconnect(DisconnectMsg, State)
+ handle_disconnect(DisconnectMsg, State);
+ _:Error ->
+ Desc = log_error(Error),
+ handle_disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = Desc,
+ language = "en"}, State)
end;
key_exchange(#ssh_msg_kex_dh_gex_request{} = Msg,
@@ -227,7 +253,12 @@ key_exchange(#ssh_msg_kex_dh_gex_request{} = Msg,
{next_state, new_keys, next_packet(State#state{ssh_params = Ssh})}
catch
#ssh_msg_disconnect{} = DisconnectMsg ->
- handle_disconnect(DisconnectMsg, State)
+ handle_disconnect(DisconnectMsg, State);
+ _:Error ->
+ Desc = log_error(Error),
+ handle_disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = Desc,
+ language = "en"}, State)
end;
key_exchange(#ssh_msg_kex_dh_gex_reply{} = Msg,
#state{ssh_params = #ssh{role = client} = Ssh0} = State) ->
@@ -237,7 +268,12 @@ key_exchange(#ssh_msg_kex_dh_gex_reply{} = Msg,
{next_state, new_keys, next_packet(State#state{ssh_params = Ssh})}
catch
#ssh_msg_disconnect{} = DisconnectMsg ->
- handle_disconnect(DisconnectMsg, State)
+ handle_disconnect(DisconnectMsg, State);
+ _:Error ->
+ Desc = log_error(Error),
+ handle_disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = Desc,
+ language = "en"}, State)
end.
new_keys(#ssh_msg_newkeys{} = Msg, #state{ssh_params = Ssh0} = State0) ->
@@ -248,8 +284,12 @@ new_keys(#ssh_msg_newkeys{} = Msg, #state{ssh_params = Ssh0} = State0) ->
{next_state, NextStateName, next_packet(State)}
catch
#ssh_msg_disconnect{} = DisconnectMsg ->
- handle_disconnect(DisconnectMsg, State0),
- {stop, normal, State0}
+ handle_disconnect(DisconnectMsg, State0);
+ _:Error ->
+ Desc = log_error(Error),
+ handle_disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = Desc,
+ language = "en"}, State0)
end.
userauth(#ssh_msg_service_request{name = "ssh-userauth"} = Msg,
@@ -262,7 +302,12 @@ userauth(#ssh_msg_service_request{name = "ssh-userauth"} = Msg,
{next_state, userauth, next_packet(State#state{ssh_params = Ssh})}
catch
#ssh_msg_disconnect{} = DisconnectMsg ->
- handle_disconnect(DisconnectMsg, State)
+ handle_disconnect(DisconnectMsg, State);
+ _:Error ->
+ Desc = log_error(Error),
+ handle_disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = Desc,
+ language = "en"}, State)
end;
userauth(#ssh_msg_service_accept{name = "ssh-userauth"},
@@ -284,7 +329,12 @@ userauth(#ssh_msg_userauth_request{service = "ssh-connection",
{next_state, userauth, next_packet(State#state{ssh_params = Ssh})}
catch
#ssh_msg_disconnect{} = DisconnectMsg ->
- handle_disconnect(DisconnectMsg, State)
+ handle_disconnect(DisconnectMsg, State);
+ _:Error ->
+ Desc = log_error(Error),
+ handle_disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = Desc,
+ language = "en"}, State)
end;
userauth(#ssh_msg_userauth_request{service = "ssh-connection",
@@ -307,7 +357,12 @@ userauth(#ssh_msg_userauth_request{service = "ssh-connection",
{next_state, userauth, next_packet(State#state{ssh_params = Ssh})}
catch
#ssh_msg_disconnect{} = DisconnectMsg ->
- handle_disconnect(DisconnectMsg, State)
+ handle_disconnect(DisconnectMsg, State);
+ _:Error ->
+ Desc = log_error(Error),
+ handle_disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = Desc,
+ language = "en"}, State)
end;
userauth(#ssh_msg_userauth_info_request{} = Msg,
@@ -319,7 +374,12 @@ userauth(#ssh_msg_userauth_info_request{} = Msg,
{next_state, userauth, next_packet(State#state{ssh_params = Ssh})}
catch
#ssh_msg_disconnect{} = DisconnectMsg ->
- handle_disconnect(DisconnectMsg, State)
+ handle_disconnect(DisconnectMsg, State);
+ _:Error ->
+ Desc = log_error(Error),
+ handle_disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = Desc,
+ language = "en"}, State)
end;
userauth(#ssh_msg_userauth_info_response{} = Msg,
@@ -330,7 +390,12 @@ userauth(#ssh_msg_userauth_info_response{} = Msg,
{next_state, userauth, next_packet(State#state{ssh_params = Ssh})}
catch
#ssh_msg_disconnect{} = DisconnectMsg ->
- handle_disconnect(DisconnectMsg, State)
+ handle_disconnect(DisconnectMsg, State);
+ _:Error ->
+ Desc = log_error(Error),
+ handle_disconnect(#ssh_msg_disconnect{code = ?SSH_DISCONNECT_SERVICE_NOT_AVAILABLE,
+ description = Desc,
+ language = "en"}, State)
end;
userauth(#ssh_msg_userauth_success{}, #state{ssh_params = #ssh{role = client},
@@ -361,24 +426,11 @@ userauth(#ssh_msg_userauth_failure{authentications = Methodes},
%% The prefered authentication method failed try next method
userauth(#ssh_msg_userauth_failure{},
- #state{ssh_params = #ssh{role = client} = Ssh0,
- manager = Pid} = State) ->
+ #state{ssh_params = #ssh{role = client} = Ssh0} = State) ->
case ssh_auth:userauth_request_msg(Ssh0) of
- {disconnect, Event, {Msg, _}} ->
- try
- send_msg(Msg, State),
- ssh_connection_manager:event(Pid, Event)
- catch
- exit:{noproc, _Reason} ->
- Report = io_lib:format("Connection Manager terminated: ~p~n",
- [Pid]),
- error_logger:info_report(Report);
- exit:Exit ->
- Report = io_lib:format("Connection Manager returned:~n~p~n~p~n",
- [Msg, Exit]),
- error_logger:info_report(Report)
- end,
- {stop, normal, State};
+ {disconnect, DisconnectMsg,{Msg, Ssh}} ->
+ send_msg(Msg, State),
+ handle_disconnect(DisconnectMsg, State#state{ssh_params = Ssh});
{Msg, Ssh} ->
send_msg(Msg, State),
{next_state, userauth, next_packet(State#state{ssh_params = Ssh})}
@@ -398,25 +450,6 @@ connected({#ssh_msg_kexinit{}, _Payload} = Event, State) ->
kexinit(Event, State#state{renegotiate = true}).
%%--------------------------------------------------------------------
-%% Function:
-%% state_name(Event, From, State) -> {next_state, NextStateName, NextState} |
-%% {next_state, NextStateName,
-%% NextState, Timeout} |
-%% {reply, Reply, NextStateName, NextState}|
-%% {reply, Reply, NextStateName,
-%% NextState, Timeout} |
-%% {stop, Reason, NewState}|
-%% {stop, Reason, Reply, NewState}
-%% 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:sync_send_event/2,3, the instance of this function with the same
-%% name as the current state name StateName is called to handle the event.
-%%--------------------------------------------------------------------
-state_name(_Event, _From, State) ->
- Reply = ok,
- {reply, Reply, state_name, State}.
-
-%%--------------------------------------------------------------------
%% Function:
%% handle_event(Event, StateName, State) -> {next_state, NextStateName,
%% NextState} |
@@ -566,10 +599,18 @@ handle_info({Protocol, Socket, Data}, Statename,
Statename, State);
handle_info({CloseTag, _Socket}, _StateName,
- #state{transport_close_tag = CloseTag, %%manager = Pid,
+ #state{transport_close_tag = CloseTag,
ssh_params = #ssh{role = _Role, opts = _Opts}} = State) ->
- %%ok = ssh_connection_manager:delivered(Pid),
- {stop, normal, State};
+ DisconnectMsg =
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_CONNECTION_LOST,
+ description = "Connection Lost",
+ language = "en"},
+ {stop, {shutdown, DisconnectMsg}, State};
+
+%%% So that terminate will be run when supervisor is shutdown
+handle_info({'EXIT', _Sup, Reason}, _StateName, State) ->
+ {stop, Reason, State};
+
handle_info(UnexpectedMessage, StateName, #state{ssh_params = SshParams} = State) ->
Msg = lists:flatten(io_lib:format(
"Unexpected message '~p' received in state '~p'\n"
@@ -581,7 +622,6 @@ handle_info(UnexpectedMessage, StateName, #state{ssh_params = SshParams} = State
error_logger:info_report(Msg),
{next_state, StateName, State}.
-
%%--------------------------------------------------------------------
%% Function: terminate(Reason, StateName, State) -> void()
%% Description:This function is called by a gen_fsm when it is about
@@ -596,22 +636,31 @@ terminate(normal, _, #state{transport_cb = Transport,
(catch Transport:close(Socket)),
ok;
-terminate(shutdown, _, State) ->
+%% Terminated as manager terminated
+terminate(shutdown, StateName, #state{ssh_params = Ssh0} = State) ->
DisconnectMsg =
#ssh_msg_disconnect{code = ?SSH_DISCONNECT_BY_APPLICATION,
- description = "Application disconnect",
+ description = "Application shutdown",
language = "en"},
- handle_disconnect(DisconnectMsg, State);
+ {SshPacket, Ssh} = ssh_transport:ssh_packet(DisconnectMsg, Ssh0),
+ send_msg(SshPacket, State),
+ terminate(normal, StateName, State#state{ssh_params = Ssh});
-terminate(Reason, _, State) ->
- Desc = io_lib:format("Erlang ssh connection handler failed with reason: "
- "~p , please report this to [email protected] \n",
- [Reason]),
+terminate({shutdown, #ssh_msg_disconnect{} = Msg}, StateName, #state{ssh_params = Ssh0, manager = Pid} = State) ->
+ {SshPacket, Ssh} = ssh_transport:ssh_packet(Msg, Ssh0),
+ send_msg(SshPacket, State),
+ ssh_connection_manager:event(Pid, Msg),
+ terminate(normal, StateName, State#state{ssh_params = Ssh});
+terminate(Reason, StateName, #state{ssh_params = Ssh0, manager = Pid} = State) ->
+ log_error(Reason),
DisconnectMsg =
- #ssh_msg_disconnect{code = ?SSH_DISCONNECT_CONNECTION_LOST,
- description = Desc,
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_BY_APPLICATION,
+ description = "Internal error",
language = "en"},
- handle_disconnect(DisconnectMsg, State).
+ {SshPacket, Ssh} = ssh_transport:ssh_packet(DisconnectMsg, Ssh0),
+ ssh_connection_manager:event(Pid, DisconnectMsg),
+ send_msg(SshPacket, State),
+ terminate(normal, StateName, State#state{ssh_params = Ssh}).
%%--------------------------------------------------------------------
%% Function:
@@ -637,16 +686,18 @@ init_ssh(client = Role, Vsn, Version, Options, Socket) ->
{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 = proplists:get_value(key_cb, Options, ssh_file),
+ 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}
+ peer = {PeerName, PeerAddr},
+ available_host_keys = supported_host_keys(Role, KeyCb, Options)
};
init_ssh(server = Role, Vsn, Version, Options, Socket) ->
@@ -654,17 +705,48 @@ init_ssh(server = Role, Vsn, Version, Options, Socket) ->
AuthMethods = proplists:get_value(auth_methods, Options,
?SUPPORTED_AUTH_METHODS),
{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 = proplists:get_value(key_cb, Options, ssh_file),
+ key_cb = KeyCb,
io_cb = proplists:get_value(io_cb, Options, ssh_io),
opts = Options,
userauth_supported_methods = AuthMethods,
- peer = {undefined, PeerAddr}
+ peer = {undefined, PeerAddr},
+ available_host_keys = supported_host_keys(Role, KeyCb, Options)
}.
+supported_host_keys(client, _, _) ->
+ ["ssh-rsa", "ssh-dss"];
+supported_host_keys(server, KeyCb, Options) ->
+ lists:foldl(fun(Type, Acc) ->
+ case available_host_key(KeyCb, Type, Options) of
+ {error, _} ->
+ Acc;
+ Alg ->
+ [Alg | Acc]
+ end
+ end, [],
+ %% Prefered alg last so no need to reverse
+ ["ssh-dss", "ssh-rsa"]).
+
+available_host_key(KeyCb, "ssh-dss"= Alg, Opts) ->
+ case KeyCb:host_key('ssh-dss', Opts) of
+ {ok, _} ->
+ Alg;
+ Other ->
+ Other
+ end;
+available_host_key(KeyCb, "ssh-rsa" = Alg, Opts) ->
+ case KeyCb:host_key('ssh-rsa', Opts) of
+ {ok, _} ->
+ Alg;
+ Other ->
+ Other
+ end.
+
send_msg(Msg, #state{socket = Socket, transport_cb = Transport}) ->
Transport:send(Socket, Msg).
@@ -724,11 +806,8 @@ generate_event(<<?BYTE(Byte), _/binary>> = Msg, StateName,
next_packet(State),
{next_state, StateName, State}
catch
- exit:{noproc, _Reason} ->
- Report = io_lib:format("~p Connection Handler terminated: ~p~n",
- [self(), Pid]),
- error_logger:info_report(Report),
- {stop, normal, State0}
+ exit:{noproc, Reason} ->
+ {stop, {shutdown, Reason}, State0}
end;
generate_event(Msg, StateName, State0, EncData) ->
Event = ssh_bits:decode(Msg),
@@ -753,13 +832,18 @@ generate_event_new_state(#state{ssh_params =
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 =/= <<>> andalso size(Buff) >= 8 ->
- %% More data from the next packet has been received
- %% Fake a socket-recive message so that the data will be processed
- inet:setopts(Socket, [{active, once}]),
- self() ! {Protocol, 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) ->
@@ -820,24 +904,8 @@ handle_ssh_packet(Length, StateName, #state{decoded_data_buffer = DecData0,
handle_disconnect(DisconnectMsg, State0)
end.
-handle_disconnect(#ssh_msg_disconnect{} = Msg,
- #state{ssh_params = Ssh0, manager = Pid} = State) ->
- {SshPacket, Ssh} = ssh_transport:ssh_packet(Msg, Ssh0),
- try
- send_msg(SshPacket, State),
- ssh_connection_manager:event(Pid, Msg)
- catch
- exit:{noproc, _Reason} ->
- Report = io_lib:format("~p Connection Manager terminated: ~p~n",
- [self(), Pid]),
- error_logger:info_report(Report);
- exit:Exit ->
- Report = io_lib:format("Connection Manager returned:~n~p~n~p~n",
- [Msg, Exit]),
- error_logger:info_report(Report)
- end,
- (catch ssh_userreg:delete_user(Pid)),
- {stop, normal, State#state{ssh_params = Ssh}}.
+handle_disconnect(#ssh_msg_disconnect{} = Msg, State) ->
+ {stop, {shutdown, Msg}, State}.
counterpart_versions(NumVsn, StrVsn, #ssh{role = server} = Ssh) ->
Ssh#ssh{c_vsn = NumVsn , c_version = StrVsn};
@@ -895,3 +963,11 @@ ssh_info([peer | Rest], #ssh{peer = Peer} = SshParams, Acc) ->
ssh_info([ _ | Rest], SshParams, Acc) ->
ssh_info(Rest, SshParams, Acc).
+
+log_error(Reason) ->
+ Report = io_lib:format("Erlang ssh connection handler failed with reason: "
+ "~p ~n, Stacktace: ~p ~n"
+ "please report this to [email protected] \n",
+ [Reason, erlang:get_stacktrace()]),
+ error_logger:error_report(Report),
+ "Internal error".
diff --git a/lib/ssh/src/ssh_connection_manager.erl b/lib/ssh/src/ssh_connection_manager.erl
index 9bfd5270da..e53cd4f4f7 100644
--- a/lib/ssh/src/ssh_connection_manager.erl
+++ b/lib/ssh/src/ssh_connection_manager.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -144,27 +144,21 @@ adjust_window(ConnectionManager, Channel, Bytes) ->
cast(ConnectionManager, {adjust_window, Channel, Bytes}).
close(ConnectionManager, ChannelId) ->
- try call(ConnectionManager, {close, ChannelId}) of
- ok ->
+ case call(ConnectionManager, {close, ChannelId}) of
+ ok ->
ok;
- {error, channel_closed} ->
- ok
- catch
- exit:{noproc, _} ->
+ {error, channel_closed} ->
ok
- end.
+ end.
stop(ConnectionManager) ->
- try call(ConnectionManager, stop) of
+ case call(ConnectionManager, stop) of
ok ->
ok;
{error, channel_closed} ->
ok
- catch
- exit:{noproc, _} ->
- ok
end.
-
+
send(ConnectionManager, ChannelId, Type, Data, Timeout) ->
call(ConnectionManager, {data, ChannelId, Type, Data}, Timeout).
@@ -182,17 +176,15 @@ send_eof(ConnectionManager, ChannelId) ->
%% {stop, Reason}
%% Description: Initiates the server
%%--------------------------------------------------------------------
-init([server, _Socket, Opts, SubSysSup]) ->
+init([server, _Socket, Opts]) ->
process_flag(trap_exit, true),
ssh_bits:install_messages(ssh_connection:messages()),
- Cache = ssh_channel:cache_create(),
+ Cache = ssh_channel:cache_create(),
{ok, #state{role = server,
connection_state = #connection{channel_cache = Cache,
channel_id_seed = 0,
port_bindings = [],
- requests = [],
- channel_pids = [],
- sub_system_supervisor = SubSysSup},
+ requests = []},
opts = Opts,
connected = false}};
@@ -207,15 +199,14 @@ init([client, Opts]) ->
Options = proplists:get_value(ssh_opts, Opts),
ChannelPid = proplists:get_value(channel_pid, Opts),
self() !
- {start_connection, client, [Parent, Address, Port,
- ChannelPid, SocketOpts, Options]},
+ {start_connection, client, [Parent, Address, Port, SocketOpts, Options]},
{ok, #state{role = client,
client = ChannelPid,
connection_state = #connection{channel_cache = Cache,
channel_id_seed = 0,
port_bindings = [],
- requests = [],
- channel_pids = []},
+ connection_supervisor = Parent,
+ requests = []},
opts = Opts,
connected = false}}.
@@ -269,29 +260,25 @@ handle_call({ssh_msg, Pid, Msg}, From,
when Role == client andalso (not IsConnected) ->
lists:foreach(fun send_msg/1, Replies),
ClientPid ! {self(), not_connected, Reason},
- {stop, normal, State#state{connection = Connection}};
+ {stop, {shutdown, normal}, State#state{connection = Connection}};
{disconnect, Reason, {{replies, Replies}, Connection}} ->
lists:foreach(fun send_msg/1, Replies),
SSHOpts = proplists:get_value(ssh_opts, Opts),
disconnect_fun(Reason, SSHOpts),
- {stop, normal, State#state{connection_state = Connection}}
+ {stop, {shutdown, normal}, State#state{connection_state = Connection}}
catch
- exit:{noproc, Reason} ->
- Report = io_lib:format("Connection probably terminated:~n~p~n~p~n~p~n",
- [ConnectionMsg, Reason, erlang:get_stacktrace()]),
- error_logger:info_report(Report),
- {noreply, State};
- error:Error ->
- Report = io_lib:format("Connection message returned:~n~p~n~p~n~p~n",
- [ConnectionMsg, Error, erlang:get_stacktrace()]),
- error_logger:info_report(Report),
- {noreply, State};
- exit:Exit ->
- Report = io_lib:format("Connection message returned:~n~p~n~p~n~p~n",
- [ConnectionMsg, Exit, erlang:get_stacktrace()]),
- error_logger:info_report(Report),
- {noreply, State}
- end;
+ _:Error ->
+ {disconnect, Reason, {{replies, Replies}, Connection}} =
+ ssh_connection:handle_msg(
+ #ssh_msg_disconnect{code = ?SSH_DISCONNECT_BY_APPLICATION,
+ description = "Internal error",
+ language = "en"}, Connection0, undefined,
+ Role),
+ lists:foreach(fun send_msg/1, Replies),
+ SSHOpts = proplists:get_value(ssh_opts, Opts),
+ disconnect_fun(Reason, SSHOpts),
+ {stop, {shutdown, Error}, State#state{connection_state = Connection}}
+ end;
handle_call({global_request, Pid, _, _, _} = Request, From,
#state{connection_state =
@@ -341,7 +328,8 @@ handle_call({info, ChannelPid}, _From,
handle_call({open, ChannelPid, Type, InitialWindowSize, MaxPacketSize, Data},
From, #state{connection = Pid,
connection_state =
- #connection{channel_cache = Cache}} = State0) ->
+ #connection{channel_cache = Cache}} = State0) ->
+ erlang:monitor(process, ChannelPid),
{ChannelId, State1} = new_channel_id(State0),
Msg = ssh_connection:channel_open_msg(Type, ChannelId,
InitialWindowSize,
@@ -396,26 +384,27 @@ handle_call({close, ChannelId}, _,
#state{connection = Pid, connection_state =
#connection{channel_cache = Cache}} = State) ->
case ssh_channel:cache_lookup(Cache, ChannelId) of
- #channel{remote_id = Id} ->
+ #channel{remote_id = Id} = Channel ->
send_msg({connection_reply, Pid,
ssh_connection:channel_close_msg(Id)}),
+ ssh_channel:cache_update(Cache, Channel#channel{sent_close = true}),
{reply, ok, State};
undefined ->
{reply, ok, State}
end;
-handle_call(stop, _, #state{role = _client,
- client = _ChannelPid,
- connection = Pid} = State) ->
- DisconnectMsg =
- #ssh_msg_disconnect{code = ?SSH_DISCONNECT_BY_APPLICATION,
- description = "Application disconnect",
- language = "en"},
- (catch gen_fsm:send_all_state_event(Pid, DisconnectMsg)),
-% ssh_connection_handler:send(Pid, DisconnectMsg),
- {stop, normal, ok, State};
-handle_call(stop, _, State) ->
- {stop, normal, ok, State};
+handle_call(stop, _, #state{connection_state = Connection0,
+ role = Role,
+ opts = Opts} = State) ->
+ {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, undefined,
+ Role),
+ lists:foreach(fun send_msg/1, Replies),
+ SSHOpts = proplists:get_value(ssh_opts, Opts),
+ disconnect_fun(Reason, SSHOpts),
+ {stop, normal, ok, State#state{connection_state = Connection}};
%% API violation make it the violaters problem
%% by ignoring it. The violating process will get
@@ -493,31 +482,33 @@ handle_cast({failure, ChannelId}, #state{connection = Pid} = State) ->
%% Description: Handling all non call/cast messages
%%--------------------------------------------------------------------
handle_info({start_connection, server,
- [Address, Port, Socket, Options]},
+ [Address, Port, Socket, Options, SubSysSup]},
#state{connection_state = CState} = State) ->
{ok, Connection} = ssh_transport:accept(Address, Port, Socket, Options),
Shell = proplists:get_value(shell, Options),
Exec = proplists:get_value(exec, Options),
CliSpec = proplists:get_value(ssh_cli, Options, {ssh_cli, [Shell]}),
+ ssh_connection_handler:send_event(Connection, socket_control),
{noreply, State#state{connection = Connection,
connection_state =
CState#connection{address = Address,
port = Port,
cli_spec = CliSpec,
options = Options,
- exec = Exec}}};
+ exec = Exec,
+ sub_system_supervisor = SubSysSup
+ }}};
handle_info({start_connection, client,
- [Parent, Address, Port, ChannelPid, SocketOpts, Options]},
- State) ->
+ [Parent, Address, Port, SocketOpts, Options]},
+ #state{client = Pid} = State) ->
case (catch ssh_transport:connect(Parent, Address,
Port, SocketOpts, Options)) of
{ok, Connection} ->
- erlang:monitor(process, ChannelPid),
{noreply, State#state{connection = Connection}};
Reason ->
- ChannelPid ! {self(), not_connected, Reason},
- {stop, normal, State}
+ Pid ! {self(), not_connected, Reason},
+ {stop, {shutdown, normal}, State}
end;
handle_info({ssh_cm, _Sender, Msg}, State0) ->
@@ -537,20 +528,13 @@ handle_info(ssh_connected, #state{role = client, client = Pid}
handle_info(ssh_connected, #state{role = server} = State) ->
{noreply, State#state{connected = true}};
-handle_info({'DOWN', _Ref, process, ChannelPid, normal}, State0) ->
- handle_down(handle_channel_down(ChannelPid, State0));
-
-handle_info({'DOWN', _Ref, process, ChannelPid, shutdown}, State0) ->
- handle_down(handle_channel_down(ChannelPid, State0));
-
-handle_info({'DOWN', _Ref, process, ChannelPid, Reason}, State0) ->
- Report = io_lib:format("Pid ~p DOWN ~p\n", [ChannelPid, Reason]),
- error_logger:error_report(Report),
- handle_down(handle_channel_down(ChannelPid, State0));
+%%% Handle that ssh channels user process goes down
+handle_info({'DOWN', _Ref, process, ChannelPid, _Reason}, State) ->
+ handle_down(handle_channel_down(ChannelPid, State));
-handle_info({'EXIT', _, _}, State) ->
- %% Handled in 'DOWN'
- {noreply, State}.
+%%% So that terminate will be run when supervisor is shutdown
+handle_info({'EXIT', _Sup, Reason}, State) ->
+ {stop, Reason, State}.
%%--------------------------------------------------------------------
%% Function: terminate(Reason, State) -> void()
@@ -559,20 +543,19 @@ handle_info({'EXIT', _, _}, State) ->
%% cleaning up. When it returns, the gen_server terminates with Reason.
%% The return value is ignored.
%%--------------------------------------------------------------------
-terminate(Reason, #state{connection_state =
- #connection{requests = Requests,
- sub_system_supervisor = SubSysSup},
+terminate(_Reason, #state{role = client,
+ connection_state =
+ #connection{connection_supervisor = Supervisor}}) ->
+ sshc_sup:stop_child(Supervisor);
+
+terminate(_Reason, #state{role = server,
+ connection_state =
+ #connection{sub_system_supervisor = SubSysSup},
opts = Opts}) ->
- SSHOpts = proplists:get_value(ssh_opts, Opts),
- disconnect_fun(Reason, SSHOpts),
- (catch lists:foreach(fun({_, From}) ->
- gen_server:reply(From, {error, connection_closed})
- end, Requests)),
Address = proplists:get_value(address, Opts),
Port = proplists:get_value(port, Opts),
SystemSup = ssh_system_sup:system_supervisor(Address, Port),
- ssh_system_sup:stop_subsystem(SystemSup, SubSysSup),
- ok.
+ ssh_system_sup:stop_subsystem(SystemSup, SubSysSup).
%%--------------------------------------------------------------------
%% Func: code_change(OldVsn, State, Extra) -> {ok, NewState}
@@ -604,6 +587,10 @@ call(Pid, Msg, Timeout) ->
exit:{timeout, _} ->
{error, timeout};
exit:{normal, _} ->
+ {error, channel_closed};
+ exit:{{shutdown, _}, _} ->
+ {error, channel_closed};
+ exit:{noproc,_} ->
{error, channel_closed}
end.
@@ -617,16 +604,7 @@ decode_ssh_msg(Msg) ->
send_msg(Msg) ->
- case catch do_send_msg(Msg) of
- {'EXIT', Reason}->
- Report = io_lib:format("Connection Manager fail to send:~n~p~n"
- "Reason why it failed was:~n~p~n",
- [Msg, Reason]),
- error_logger:info_report(Report);
- _ ->
- ok
- end.
-
+ catch do_send_msg(Msg).
do_send_msg({channel_data, Pid, Data}) ->
Pid ! {ssh_cm, self(), Data};
do_send_msg({channel_requst_reply, From, Data}) ->
@@ -674,8 +652,8 @@ handle_down({{replies, Replies}, State}) ->
{noreply, State}.
handle_channel_down(ChannelPid, #state{connection_state =
- #connection{channel_cache = Cache}} =
- State) ->
+ #connection{channel_cache = Cache}} =
+ State) ->
ssh_channel:cache_foldl(
fun(Channel, Acc) when Channel#channel.user == ChannelPid ->
ssh_channel:cache_delete(Cache,
diff --git a/lib/ssh/src/ssh_connection_sup.erl b/lib/ssh/src/ssh_connection_sup.erl
new file mode 100644
index 0000000000..b620056310
--- /dev/null
+++ b/lib/ssh/src/ssh_connection_sup.erl
@@ -0,0 +1,119 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+%%
+%%----------------------------------------------------------------------
+%% Purpose: Ssh connection supervisor.
+%%----------------------------------------------------------------------
+
+-module(ssh_connection_sup).
+
+-behaviour(supervisor).
+
+-export([start_link/1, start_handler_child/2, start_manager_child/2,
+ connection_manager/1]).
+
+%% Supervisor callback
+-export([init/1]).
+
+%%%=========================================================================
+%%% API
+%%%=========================================================================
+start_link(Args) ->
+ supervisor:start_link(?MODULE, [Args]).
+
+%% Will be called from the manager child process
+start_handler_child(Sup, Args) ->
+ [Spec] = child_specs(handler, Args),
+ supervisor:start_child(Sup, Spec).
+
+%% Will be called from the acceptor process
+start_manager_child(Sup, Args) ->
+ [Spec] = child_specs(manager, Args),
+ supervisor:start_child(Sup, Spec).
+
+connection_manager(SupPid) ->
+ try supervisor:which_children(SupPid) of
+ Children ->
+ {ok, ssh_connection_manager(Children)}
+ catch exit:{noproc,_} ->
+ {ok, undefined}
+ end.
+
+%%%=========================================================================
+%%% Supervisor callback
+%%%=========================================================================
+init([Args]) ->
+ RestartStrategy = one_for_all,
+ MaxR = 0,
+ MaxT = 3600,
+ Children = child_specs(Args),
+ {ok, {{RestartStrategy, MaxR, MaxT}, Children}}.
+
+%%%=========================================================================
+%%% Internal functions
+%%%=========================================================================
+child_specs(Opts) ->
+ case proplists:get_value(role, Opts) of
+ client ->
+ child_specs(manager, [client | Opts]);
+ server ->
+ %% Children started by acceptor process
+ []
+ end.
+
+% The manager process starts the handler process
+child_specs(manager, Opts) ->
+ [manager_spec(Opts)];
+child_specs(handler, Opts) ->
+ [handler_spec(Opts)].
+
+manager_spec([server = Role, Socket, Opts]) ->
+ Name = make_ref(),
+ StartFunc = {ssh_connection_manager, start_link, [[Role, Socket, Opts]]},
+ Restart = temporary,
+ Shutdown = 3600,
+ Modules = [ssh_connection_manager],
+ Type = worker,
+ {Name, StartFunc, Restart, Shutdown, Type, Modules};
+
+manager_spec([client = Role | Opts]) ->
+ Name = make_ref(),
+ StartFunc = {ssh_connection_manager, start_link, [[Role, Opts]]},
+ Restart = temporary,
+ Shutdown = 3600,
+ Modules = [ssh_connection_manager],
+ Type = worker,
+ {Name, StartFunc, Restart, Shutdown, Type, Modules}.
+
+handler_spec([Role, Socket, Opts]) ->
+ Name = make_ref(),
+ StartFunc = {ssh_connection_handler,
+ start_link, [Role, self(), Socket, Opts]},
+ Restart = temporary,
+ Shutdown = 3600,
+ Modules = [ssh_connection_handler],
+ Type = worker,
+ {Name, StartFunc, Restart, Shutdown, Type, Modules}.
+
+ssh_connection_manager([]) ->
+ undefined;
+ssh_connection_manager([{_, Child, _, [ssh_connection_manager]} | _]) ->
+ Child;
+ssh_connection_manager([_ | Rest]) ->
+ ssh_connection_manager(Rest).
diff --git a/lib/ssh/src/ssh_dsa.erl b/lib/ssh/src/ssh_dsa.erl
deleted file mode 100644
index cb2632beac..0000000000
--- a/lib/ssh/src/ssh_dsa.erl
+++ /dev/null
@@ -1,95 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-%%
-
-%%% Description: dsa public-key sign and verify
-
--module(ssh_dsa).
-
--export([verify/3]).
--export([sign/2]).
--export([alg_name/0]).
-
--include("ssh.hrl").
-
-%% start() ->
-%% crypto:start().
-
-%% sign_file(File, Opts) ->
-%% start(),
-%% {ok,Bin} = file:read_file(File),
-%% {ok,Key} = ssh_file:private_host_dsa_key(user, Opts),
-%% sign(Key, Bin).
-
-%% verify_file(File, Sig) ->
-%% start(),
-%% {ok,Bin} = file:read_file(File),
-%% {ok,Key} = ssh_file:public_host_key(user, dsa),
-%% verify(Key, Bin, Sig).
-
-sign(_Private=#ssh_key { private={P,Q,G,X} },Mb) ->
- K = ssh_bits:irandom(160) rem Q,
- R = ssh_math:ipow(G, K, P) rem Q,
- Ki = ssh_math:invert(K, Q),
- <<M:160/big-unsigned-integer>> = crypto:sha(Mb),
- S = (Ki * (M + X*R)) rem Q,
- <<R:160/big-unsigned-integer, S:160/big-unsigned-integer>>.
-
-
-%% the paramiko client sends a bad sig sometimes,
-%% instead of crashing, we nicely return error, the
-%% typcally manifests itself as Sb being 39 bytes
-%% instead of 40.
-
-verify(Public, Mb, Sb) ->
- case catch xverify(Public, Mb, Sb) of
- {'EXIT', _Reason} ->
- %store({Public, Mb, Sb, _Reason}),
- {error, inconsistent_key};
- ok ->
- %store({Public, Mb, Sb, ok})
- ok
- end.
-
-%% store(Term) ->
-%% {ok, Fd} = file:open("/tmp/dsa", [append]),
-%% io:format(Fd, "~p~n~n~n", [Term]),
-%% file:close(Fd).
-
-
-xverify(_Public=#ssh_key { public={P,Q,G,Y} },Mb,Sb) ->
- <<R0:160/big-unsigned-integer, S0:160/big-unsigned-integer>> = Sb,
- ?ssh_assert(R0 >= 0 andalso R0 < Q andalso
- S0 >= 0 andalso S0 < Q, out_of_range),
- W = ssh_math:invert(S0,Q),
- <<M0:160/big-unsigned-integer>> = crypto:sha(Mb),
- U1 = (M0*W) rem Q,
- U2 = (R0*W) rem Q,
- T1 = ssh_math:ipow(G,U1,P),
- T2 = ssh_math:ipow(Y,U2,P),
- V = ((T1*T2) rem P) rem Q,
- if V == R0 ->
- ok;
- true ->
- {error, inconsistent_key}
- end.
-
-alg_name() ->
- "ssh-dss".
diff --git a/lib/ssh/src/ssh_file.erl b/lib/ssh/src/ssh_file.erl
index 12180f56bb..a6b82a7a13 100644
--- a/lib/ssh/src/ssh_file.erl
+++ b/lib/ssh/src/ssh_file.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -23,80 +23,98 @@
-module(ssh_file).
--include("ssh.hrl").
--include("PKCS-1.hrl").
--include("DSS.hrl").
+-behaviour(ssh_key_api).
+-include_lib("public_key/include/public_key.hrl").
-include_lib("kernel/include/file.hrl").
--export([public_host_dsa_key/2,private_host_dsa_key/2,
- public_host_rsa_key/2,private_host_rsa_key/2,
- public_host_key/2,private_host_key/2,
- lookup_host_key/3, add_host_key/3, % del_host_key/2,
- lookup_user_key/3, ssh_dir/2, file_name/3]).
-
--export([private_identity_key/2,
- public_identity_key/2]).
-%% identity_keys/2]).
-
--export([encode_public_key/1, decode_public_key_v2/2]).
+-include("ssh.hrl").
--import(lists, [reverse/1, append/1]).
+-export([host_key/2,
+ user_key/2,
+ is_host_key/4,
+ add_host_key/3,
+ is_auth_key/4]).
--define(DBG_PATHS, true).
-define(PERM_700, 8#700).
-define(PERM_644, 8#644).
+
%% API
-public_host_dsa_key(Type, Opts) ->
- File = file_name(Type, "ssh_host_dsa_key.pub", Opts),
- read_public_key_v2(File, "ssh-dss").
-
-private_host_dsa_key(Type, Opts) ->
- File = file_name(Type, "ssh_host_dsa_key", Opts),
- read_private_key_v2(File, "ssh-dss").
-
-public_host_rsa_key(Type, Opts) ->
- File = file_name(Type, "ssh_host_rsa_key.pub", Opts),
- read_public_key_v2(File, "ssh-rsa").
-
-private_host_rsa_key(Type, Opts) ->
- File = file_name(Type, "ssh_host_rsa_key", Opts),
- read_private_key_v2(File, "ssh-rsa").
-
-public_host_key(Type, Opts) ->
- File = file_name(Type, "ssh_host_key", Opts),
- case read_private_key_v1(File,public) of
- {error, enoent} ->
- read_public_key_v1(File++".pub");
- Result ->
- Result
- end.
-
-private_host_key(Type, Opts) ->
- File = file_name(Type, "ssh_host_key", Opts),
- read_private_key_v1(File,private).
+%% Used by server
+host_key(Algorithm, Opts) ->
+ File = file_name(system, file_base_name(Algorithm), Opts),
+ %% We do not expect host keys to have pass phrases
+ %% so probably we could hardcod Password = ignore, but
+ %% we keep it as an undocumented option for now.
+ Password = proplists:get_value(identity_pass_phrase(Algorithm), Opts, ignore),
+ decode(File, Password).
+is_auth_key(Key, User, Alg, Opts) ->
+ case lookup_user_key(Key, User, Alg, Opts) of
+ {ok, Key} ->
+ true;
+ _ ->
+ false
+ end.
-%% in: "host" out: "host,1.2.3.4.
-add_ip(Host) ->
- case inet:getaddr(Host, inet) of
- {ok, Addr} ->
- case ssh_connection:encode_ip(Addr) of
- false -> Host;
- IPString -> Host ++ "," ++ IPString
- end;
- _ -> Host
- end.
-replace_localhost("localhost") ->
- {ok, Hostname} = inet:gethostname(),
- Hostname;
-replace_localhost(Host) ->
- Host.
+%% Used by client
+is_host_key(Key, PeerName, Algorithm, Opts) ->
+ case lookup_host_key(PeerName, Algorithm, Opts) of
+ {ok, Key} ->
+ true;
+ _ ->
+ false
+ end.
+
+user_key(Algorithm, Opts) ->
+ File = file_name(user, identity_key_filename(Algorithm), Opts),
+ Password = proplists:get_value(identity_pass_phrase(Algorithm), Opts, ignore),
+ decode(File, Password).
+
+
+%% Internal functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+file_base_name('ssh-rsa') ->
+ "ssh_host_rsa_key";
+file_base_name('ssh-dss') ->
+ "ssh_host_dsa_key";
+file_base_name(_) ->
+ "ssh_host_key".
+
+decode(File, Password) ->
+ try
+ {ok, decode_ssh_file(read_ssh_file(File), Password)}
+ catch
+ throw:Reason ->
+ {error, Reason};
+ error:Reason ->
+ {error, Reason}
+ end.
+
+read_ssh_file(File) ->
+ {ok, Bin} = file:read_file(File),
+ Bin.
+
+%% Public key
+decode_ssh_file(SshBin, public_key) ->
+ public_key:ssh_decode(SshBin, public_key);
+
+%% Private Key
+decode_ssh_file(Pem, Password) ->
+ case public_key:pem_decode(Pem) of
+ [{_, _, not_encrypted} = Entry] ->
+ public_key:pem_entry_decode(Entry);
+ [Entry] when Password =/= ignore ->
+ public_key:pem_entry_decode(Entry, Password);
+ _ ->
+ throw("No pass phrase provided for private key file")
+ end.
+
%% lookup_host_key
%% return {ok, Key(s)} or {error, not_found}
@@ -106,15 +124,6 @@ lookup_host_key(Host, Alg, Opts) ->
Host1 = replace_localhost(Host),
do_lookup_host_key(Host1, Alg, Opts).
-do_lookup_host_key(Host, Alg, Opts) ->
- case file:open(file_name(user, "known_hosts", Opts), [read]) of
- {ok, Fd} ->
- Res = lookup_host_key_fd(Fd, Host, Alg),
- file:close(Fd),
- Res;
- {error, enoent} -> {error, not_found};
- Error -> Error
- end.
add_host_key(Host, Key, Opts) ->
Host1 = add_ip(replace_localhost(Host)),
@@ -129,418 +138,177 @@ add_host_key(Host, Key, Opts) ->
Error
end.
-%% del_host_key(Host, Opts) ->
-%% Host1 = replace_localhost(Host),
-%% case file:open(file_name(user, "known_hosts", Opts),[write,read]) of
-%% {ok, Fd} ->
-%% Res = del_key_fd(Fd, Host1),
-%% file:close(Fd),
-%% Res;
-%% Error ->
-%% Error
-%% end.
-
-identity_key_filename("ssh-dss") -> "id_dsa";
-identity_key_filename("ssh-rsa") -> "id_rsa".
-
-private_identity_key(Alg, Opts) ->
- Path = file_name(user, identity_key_filename(Alg), Opts),
- read_private_key_v2(Path, Alg).
-
-public_identity_key(Alg, Opts) ->
- Path = file_name(user, identity_key_filename(Alg) ++ ".pub", Opts),
- read_public_key_v2(Path, Alg).
-
-
-read_public_key_v2(File, Type) ->
- case file:read_file(File) of
- {ok,Bin} ->
- List = binary_to_list(Bin),
- case lists:prefix(Type, List) of
- true ->
- List1 = lists:nthtail(length(Type), List),
- K_S = ssh_bits:b64_decode(List1),
- decode_public_key_v2(K_S, Type);
- false ->
- {error, bad_format}
- end;
- Error ->
- Error
- end.
-
-decode_public_key_v2(K_S, "ssh-rsa") ->
- case ssh_bits:decode(K_S,[string,mpint,mpint]) of
- ["ssh-rsa", E, N] ->
- {ok, #ssh_key { type = rsa,
- public = {N,E},
- comment=""}};
+lookup_user_key(Key, User, Alg, Opts) ->
+ SshDir = ssh_dir({remoteuser,User}, Opts),
+ case lookup_user_key_f(Key, User, SshDir, Alg, "authorized_keys", Opts) of
+ {ok, Key} ->
+ {ok, Key};
_ ->
- {error, bad_format}
- end;
-decode_public_key_v2(K_S, "ssh-dss") ->
- case ssh_bits:decode(K_S,[string,mpint,mpint,mpint,mpint]) of
- ["ssh-dss",P,Q,G,Y] ->
- {ok,#ssh_key { type = dsa,
- public = {P,Q,G,Y}
- }};
- _A ->
- {error, bad_format}
- end;
-decode_public_key_v2(_, _) ->
- {error, bad_format}.
-
-
-read_public_key_v1(File) ->
- case file:read_file(File) of
- {ok,Bin} ->
- List = binary_to_list(Bin),
- case io_lib:fread("~d ~d ~d ~s", List) of
- {ok,[_Sz,E,N,Comment],_} ->
- {ok,#ssh_key { type = rsa,
- public ={N,E},
- comment = Comment }};
- _Error ->
- {error, bad_format}
- end;
- Error ->
- Error
+ lookup_user_key_f(Key, User, SshDir, Alg, "authorized_keys2", Opts)
end.
-%% pem_type("ssh-dss") -> "DSA";
-%% pem_type("ssh-rsa") -> "RSA".
-
-read_private_key_v2(File, Type) ->
- case file:read_file(File) of
- {ok, PemBin} ->
- case catch (public_key:pem_decode(PemBin)) of
- [{_, Bin, not_encrypted}] ->
- decode_private_key_v2(Bin, Type);
- Error -> %% Note we do not handle password encrypted keys at the moment
- {error, Error}
- end;
- {error, Reason} ->
- {error, Reason}
- end.
-%% case file:read_file(File) of
-%% {ok,Bin} ->
-%% case read_pem(binary_to_list(Bin), pem_type(Type)) of
-%% {ok,Bin1} ->
-%% decode_private_key_v2(Bin1, Type);
-%% Error ->
-%% Error
-%% end;
-%% Error ->
-%% Error
-%% end.
-
-decode_private_key_v2(Private,"ssh-rsa") ->
- case 'PKCS-1':decode( 'RSAPrivateKey', Private) of
- {ok,RSA} -> %% FIXME Check for two-prime version
- {ok, #ssh_key { type = rsa,
- public = {RSA#'RSAPrivateKey'.modulus,
- RSA#'RSAPrivateKey'.publicExponent},
- private = {RSA#'RSAPrivateKey'.modulus,
- RSA#'RSAPrivateKey'.privateExponent}
- }};
- Error ->
- Error
- end;
-decode_private_key_v2(Private, "ssh-dss") ->
- case 'DSS':decode('DSAPrivateKey', Private) of
- {ok,DSA} -> %% FIXME Check for two-prime version
- {ok, #ssh_key { type = dsa,
- public = {DSA#'DSAPrivateKey'.p,
- DSA#'DSAPrivateKey'.q,
- DSA#'DSAPrivateKey'.g,
- DSA#'DSAPrivateKey'.y},
- private= {DSA#'DSAPrivateKey'.p,
- DSA#'DSAPrivateKey'.q,
- DSA#'DSAPrivateKey'.g,
- DSA#'DSAPrivateKey'.x}
- }};
- _ ->
- {error,bad_format}
- end.
-%% SSH1 private key format
-%% <<"SSH PRIVATE KEY FILE FORMATE 1.1\n" 0:8
-%% CipherNum:8, Reserved:32,
-%% NSz/uint32, N/bignum, E/bignum, Comment/string,
%%
-%% [ R0:8 R1:8 R0:8 R1:8, D/bignum, IQMP/bignum, Q/bignum, P/bignum, Pad(8)]>>
+%% Utils
%%
-%% where [ ] is encrypted using des3 (ssh1 version) and
-%% a posssibly empty pass phrase using md5(passphase) as key
-%%
-
-read_private_key_v1(File, Type) ->
- case file:read_file(File) of
- {ok,<<"SSH PRIVATE KEY FILE FORMAT 1.1\n",0,
- CipherNum,_Resereved:32,Bin/binary>>} ->
- decode_private_key_v1(Bin, CipherNum,Type);
- {ok,_} ->
- {error, bad_format};
- Error ->
- Error
- end.
-decode_private_key_v1(Bin, CipherNum, Type) ->
- case ssh_bits:decode(Bin,0,[uint32, bignum, bignum, string]) of
- {Offset,[_NSz,N,E,Comment]} ->
- if Type == public ->
- {ok,#ssh_key { type=rsa,
- public={N,E},
- comment=Comment}};
- Type == private ->
- <<_:Offset/binary, Encrypted/binary>> = Bin,
- case ssh_bits:decode(decrypt1(Encrypted, CipherNum),0,
- [uint32, bignum, bignum,
- bignum, bignum,{pad,8}]) of
- {_,[_,D,IQMP,Q,P]} ->
- {ok,#ssh_key { type=rsa,
- public={N,E},
- private={D,IQMP,Q,P},
- comment=Comment}};
- _ ->
- {error,bad_format}
- end
+%% server use this to find individual keys for
+%% an individual user when user tries to login
+%% with publickey
+ssh_dir({remoteuser, User}, Opts) ->
+ case proplists:get_value(user_dir_fun, Opts) of
+ undefined ->
+ case proplists:get_value(user_dir, Opts) of
+ undefined ->
+ default_user_dir();
+ Dir ->
+ Dir
end;
- _ ->
- {error,bad_format}
- end.
+ FUN ->
+ FUN(User)
+ end;
+%% client use this to find client ssh keys
+ssh_dir(user, Opts) ->
+ case proplists:get_value(user_dir, Opts, false) of
+ false -> default_user_dir();
+ D -> D
+ end;
-decrypt1(Bin, CipherNum) ->
- decrypt1(Bin, CipherNum,"").
+%% server use this to find server host keys
+ssh_dir(system, Opts) ->
+ proplists:get_value(system_dir, Opts, "/etc/ssh").
-decrypt1(Bin, CipherNum, Phrase) ->
- if CipherNum == ?SSH_CIPHER_NONE; Phrase == "" ->
- Bin;
- CipherNum == ?SSH_CIPHER_3DES ->
- <<K1:8/binary, K2:8/binary>> = erlang:md5(Phrase),
- K3 = K1,
- IV = <<0,0,0,0,0,0,0,0>>,
- Bin1 = crypto:des_cbc_decrypt(K3,IV,Bin),
- Bin2 = crypto:des_cbc_encrypt(K2,IV,Bin1),
- crypto:des_cbc_decrypt(K1,IV,Bin2)
+
+file_name(Type, Name, Opts) ->
+ FN = filename:join(ssh_dir(Type, Opts), Name),
+ FN.
+
+
+
+%% in: "host" out: "host,1.2.3.4.
+add_ip(Host) ->
+ case inet:getaddr(Host, inet) of
+ {ok, Addr} ->
+ case ssh_connection:encode_ip(Addr) of
+ false -> Host;
+ IPString -> Host ++ "," ++ IPString
+ end;
+ _ -> Host
+ end.
+
+replace_localhost("localhost") ->
+ {ok, Hostname} = inet:gethostname(),
+ Hostname;
+replace_localhost(Host) ->
+ Host.
+
+do_lookup_host_key(Host, Alg, Opts) ->
+ case file:open(file_name(user, "known_hosts", Opts), [read, binary]) of
+ {ok, Fd} ->
+ Res = lookup_host_key_fd(Fd, Host, Alg),
+ file:close(Fd),
+ {ok, Res};
+ {error, enoent} -> {error, not_found};
+ Error -> Error
end.
-%% encrypt1(Bin, CipherNum) ->
-%% encrypt1(Bin, CipherNum,"").
-
-%% encrypt1(Bin, CipherNum, Phrase) ->
-%% if CipherNum == ?SSH_CIPHER_NONE; Phrase == "" ->
-%% Bin;
-%% CipherNum == ?SSH_CIPHER_3DES ->
-%% <<K1:8/binary, K2:8/binary>> = erlang:md5(Phrase),
-%% K3 = K1,
-%% IV = <<0,0,0,0,0,0,0,0>>,
-%% Bin1 = crypto:des_cbc_encrypt(K1,IV,Bin),
-%% Bin2 = crypto:des_cbc_decrypt(K2,IV,Bin1),
-%% crypto:des_cbc_encrypt(K3,IV,Bin2)
-%% end.
-
-lookup_host_key_fd(Fd, Host, Alg) ->
+identity_key_filename("ssh-dss") ->
+ "id_dsa";
+identity_key_filename("ssh-rsa") ->
+ "id_rsa".
+
+identity_pass_phrase("ssh-dss") ->
+ dsa_pass_phrase;
+identity_pass_phrase('ssh-dss') ->
+ dsa_pass_phrase;
+identity_pass_phrase('ssh-rsa') ->
+ rsa_pass_phrase;
+identity_pass_phrase("ssh-rsa") ->
+ rsa_pass_phrase.
+
+lookup_host_key_fd(Fd, Host, KeyType) ->
case io:get_line(Fd, '') of
eof ->
{error, not_found};
Line ->
- case string:tokens(Line, " ") of
- [HostList, Alg, KeyData] ->
-%% io:format(" ~p lookup_host_key_fd: HostList ~p Alg ~p KeyData ~p\n",
-%% [Host, HostList, Alg, KeyData]),
- case lists:member(Host, string:tokens(HostList, ",")) of
- true ->
- decode_public_key_v2(ssh_bits:b64_decode(KeyData), Alg);
- false ->
- lookup_host_key_fd(Fd, Host, Alg)
- end;
- _ ->
- lookup_host_key_fd(Fd, Host, Alg)
+ case ssh_decode_line(Line, known_hosts) of
+ [{Key, Attributes}] ->
+ handle_host(Fd, Host, proplists:get_value(hostnames, Attributes), Key, KeyType);
+ [] ->
+ lookup_host_key_fd(Fd, Host, KeyType)
end
end.
+ssh_decode_line(Line, Type) ->
+ try
+ public_key:ssh_decode(Line, Type)
+ catch _:_ ->
+ []
+ end.
-
-%% del_key_fd(Fd, Host) ->
-%% del_key_fd(Fd, Host, 0, 0).
-
-%% del_key_fd(Fd, Host, ReadPos0, WritePos0) ->
-%% case io:get_line(Fd, '') of
-%% eof ->
-%% if ReadPos0 == WritePos0 ->
-%% ok;
-%% true ->
-%% file:truncate(Fd)
-%% end;
-%% Line ->
-%% {ok,ReadPos1} = file:position(Fd, cur),
-%% case string:tokens(Line, " ") of
-%% [HostList, _Type, _KeyData] ->
-%% case lists:member(Host, string:tokens(HostList, ",")) of
-%% true ->
-%% del_key_fd(Fd, Host, ReadPos1, WritePos0);
-%% false ->
-%% if ReadPos0 == WritePos0 ->
-%% del_key_fd(Fd, Host, ReadPos1, ReadPos1);
-%% true ->
-%% file:position(Fd, WritePos0),
-%% file:write(Fd, Line),
-%% {ok,WritePos1} = file:position(Fd,cur),
-%% del_key_fd(Fd, Host, ReadPos1, WritePos1)
-%% end
-%% end;
-%% _ ->
-%% if ReadPos0 == WritePos0 ->
-%% del_key_fd(Fd, Host, ReadPos1, ReadPos1);
-%% true ->
-%% file:position(Fd, WritePos0),
-%% file:write(Fd, Line),
-%% {ok,WritePos1} = file:position(Fd,cur),
-%% del_key_fd(Fd, Host, ReadPos1, WritePos1)
-%% end
-%% end
-%% end.
-
-
-add_key_fd(Fd, Host, Key) ->
- case Key#ssh_key.type of
- rsa ->
- {N,E} = Key#ssh_key.public,
- DK = ssh_bits:b64_encode(
- ssh_bits:encode(["ssh-rsa",E,N],
- [string,mpint,mpint])),
- file:write(Fd, [Host, " ssh-rsa ", DK, "\n"]);
- dsa ->
- {P,Q,G,Y} = Key#ssh_key.public,
- DK = ssh_bits:b64_encode(
- ssh_bits:encode(["ssh-dss",P,Q,G,Y],
- [string,mpint,mpint,mpint,mpint])),
- file:write(Fd, [Host, " ssh-dss ", DK, "\n"])
+handle_host(Fd, Host, HostList, Key, KeyType) ->
+ Host1 = host_name(Host),
+ case lists:member(Host1, HostList) and key_match(Key, KeyType) of
+ true ->
+ Key;
+ false ->
+ lookup_host_key_fd(Fd, Host, KeyType)
end.
+host_name(Atom) when is_atom(Atom) ->
+ atom_to_list(Atom);
+host_name(List) ->
+ List.
-%% read_pem(Cs, Type) ->
-%% case read_line(Cs) of
-%% {"-----BEGIN "++Rest,Cs1} ->
-%% case string:tokens(Rest, " ") of
-%% [Type, "PRIVATE", "KEY-----"] ->
-%% read_pem64(Cs1, [], Type);
-%% _ ->
-%% {error, bad_format}
-%% end;
-%% {"",Cs1} when Cs1 =/= "" ->
-%% read_pem(Cs1,Type);
-%% {_,""} ->
-%% {error, bad_format}
-%% end.
-
-%% read_pem64(Cs, Acc, Type) ->
-%% case read_line(Cs) of
-%% {"-----END "++Rest,_Cs1} ->
-%% case string:tokens(Rest, " ") of
-%% [Type, "PRIVATE", "KEY-----"] ->
-%% {ok,ssh_bits:b64_decode(append(reverse(Acc)))};
-%% Toks ->
-%% error_logger:format("ssh: TOKENS=~p\n", [Toks]),
-%% {error, bad_format}
-%% end;
-%% {B64, Cs1} when Cs1 =/= "" ->
-%% read_pem64(Cs1, [B64|Acc], Type);
-%% _What ->
-%% {error, bad_format}
-%% end.
-
-
-%% read_line(Cs) -> read_line(Cs,[]).
-%% read_line([$\r,$\n|T], Acc) -> {reverse(Acc), T};
-%% read_line([$\n|T], Acc) -> {reverse(Acc), T};
-%% read_line([C|T], Acc) -> read_line(T,[C|Acc]);
-%% read_line([], Acc) -> {reverse(Acc),[]}.
-
-lookup_user_key(User, Alg, Opts) ->
- SshDir = ssh_dir({remoteuser,User}, Opts),
- case lookup_user_key_f(User, SshDir, Alg, "authorized_keys", Opts) of
- {ok, Key} ->
- {ok, Key};
- _ ->
- lookup_user_key_f(User, SshDir, Alg, "authorized_keys2", Opts)
- end.
+key_match(#'RSAPublicKey'{}, "ssh-rsa") ->
+ true;
+key_match({_, #'Dss-Parms'{}}, "ssh-dss") ->
+ true;
+key_match(_, _) ->
+ false.
-lookup_user_key_f(_User, [], _Alg, _F, _Opts) ->
+add_key_fd(Fd, Host,Key) ->
+ SshBin = public_key:ssh_encode([{Key, [{hostnames, [Host]}]}], known_hosts),
+ file:write(Fd, SshBin).
+
+lookup_user_key_f(_, _User, [], _Alg, _F, _Opts) ->
{error, nouserdir};
-lookup_user_key_f(_User, nouserdir, _Alg, _F, _Opts) ->
+lookup_user_key_f(_, _User, nouserdir, _Alg, _F, _Opts) ->
{error, nouserdir};
-lookup_user_key_f(_User, Dir, Alg, F, _Opts) ->
+lookup_user_key_f(Key, _User, Dir, _Alg, F, _Opts) ->
FileName = filename:join(Dir, F),
- case file:open(FileName, [read]) of
+ case file:open(FileName, [read, binary]) of
{ok, Fd} ->
- Res = lookup_user_key_fd(Fd, Alg),
+ Res = lookup_user_key_fd(Fd, Key),
file:close(Fd),
Res;
{error, Reason} ->
{error, {{openerr, Reason}, {file, FileName}}}
end.
-lookup_user_key_fd(Fd, Alg) ->
+lookup_user_key_fd(Fd, Key) ->
case io:get_line(Fd, '') of
eof ->
{error, not_found};
Line ->
- case string:tokens(Line, " ") of
- [Alg, KeyData, _] ->
- %% io:format("lookup_user_key_fd: HostList ~p Alg ~p KeyData ~p\n",
- %% [HostList, Alg, KeyData]),
- decode_public_key_v2(ssh_bits:b64_decode(KeyData), Alg);
- _Other ->
- %%?dbg(false, "key_fd Other: ~w ~w\n", [Alg, _Other]),
- lookup_user_key_fd(Fd, Alg)
+ case ssh_decode_line(Line, auth_keys) of
+ [{AuthKey, _}] ->
+ case is_auth_key(Key, AuthKey) of
+ true ->
+ {ok, Key};
+ false ->
+ lookup_user_key_fd(Fd, Key)
+ end;
+ [] ->
+ lookup_user_key_fd(Fd, Key)
end
end.
-
-encode_public_key(#ssh_key{type = rsa, public = {N, E}}) ->
- ssh_bits:encode(["ssh-rsa",E,N],
- [string,mpint,mpint]);
-encode_public_key(#ssh_key{type = dsa, public = {P,Q,G,Y}}) ->
- ssh_bits:encode(["ssh-dss",P,Q,G,Y],
- [string,mpint,mpint,mpint,mpint]).
-
-%%
-%% Utils
-%%
-
-%% server use this to find individual keys for
-%% an individual user when user tries to login
-%% with publickey
-ssh_dir({remoteuser, User}, Opts) ->
- case proplists:get_value(user_dir_fun, Opts) of
- undefined ->
- case proplists:get_value(user_dir, Opts) of
- undefined ->
- default_user_dir();
- Dir ->
- Dir
- end;
- FUN ->
- FUN(User)
- end;
-
-%% client use this to find client ssh keys
-ssh_dir(user, Opts) ->
- case proplists:get_value(user_dir, Opts, false) of
- false -> default_user_dir();
- D -> D
- end;
-
-%% server use this to find server host keys
-ssh_dir(system, Opts) ->
- proplists:get_value(system_dir, Opts, "/etc/ssh").
-
-file_name(Type, Name, Opts) ->
- FN = filename:join(ssh_dir(Type, Opts), Name),
- %%?dbg(?DBG_PATHS, "file_name: ~p\n", [FN]),
- FN.
+is_auth_key(Key, Key) ->
+ true;
+is_auth_key(_,_) ->
+ false.
default_user_dir()->
{ok,[[Home|_]]} = init:get_argument(home),
diff --git a/lib/ssh/src/ssh_key_api.erl b/lib/ssh/src/ssh_key_api.erl
new file mode 100644
index 0000000000..8085c12e21
--- /dev/null
+++ b/lib/ssh/src/ssh_key_api.erl
@@ -0,0 +1,45 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2011-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+-module(ssh_key_api).
+
+-include_lib("public_key/include/public_key.hrl").
+-include("ssh.hrl").
+
+-type ssh_algorithm() :: string().
+-type file_error() :: file:posix() | badarg | system_limit | terminated.
+
+-callback host_key(Algorithm :: ssh_algorithm(), Options :: list()) ->
+ {ok, [{public_key(), Attributes::list()}]} | public_key()
+ | {error, string()}.
+
+-callback user_key(Algorithm :: ssh_algorithm(), Options :: list()) ->
+ {ok, [{public_key(), Attributes::list()}]} | public_key()
+ | {error, string()}.
+
+-callback is_host_key(Key :: public_key(), PeerName :: string(),
+ Algorithm :: ssh_algorithm(), Options :: list()) ->
+ boolean().
+
+-callback add_host_key(Host :: string(), Key :: public_key(), Options :: list()) ->
+ ok | {error, file_error()}.
+
+-callback is_auth_key(Key :: public_key(), User :: string(),
+ Algorithm :: ssh_algorithm(), Options :: list()) ->
+ boolean().
diff --git a/lib/ssh/src/ssh_rsa.erl b/lib/ssh/src/ssh_rsa.erl
deleted file mode 100644
index 77c411b09f..0000000000
--- a/lib/ssh/src/ssh_rsa.erl
+++ /dev/null
@@ -1,298 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-%%
-
-%%% Description: rsa public-key sign and verify
-
--module(ssh_rsa).
-
--export([verify/3, sign/2]).
--export([alg_name/0]).
-
--include("ssh.hrl").
--include("PKCS-1.hrl").
-
-
--define(MGF(Seed,Len), mgf1((Seed),(Len))).
--define(HASH(X), crypto:sha((X))).
--define(HLen, 20).
-
-%% start() ->
-%% crypto:start().
-
-%% sign_file(File) ->
-%% start(),
-%% {ok,Bin} = file:read_file(File),
-%% {ok,Key} = ssh_file:private_host_rsa_key(user),
-%% sign(Key, Bin).
-
-%% verify_file(File, Sig) ->
-%% start(),
-%% {ok,Bin} = file:read_file(File),
-%% {ok,Key} = ssh_file:public_host_rsa_key(user),
-%% verify(Key, Bin, Sig).
-
-sign(Private,Mb) ->
- rsassa_pkcs1_v1_5_sign(Private,Mb).
-
-verify(Public,Mb,Sb) ->
- rsassa_pkcs1_v1_5_verify(Public,Mb,Sb).
-
-
-
-%% Integer to octet string
-i2osp(X, XLen) ->
- ssh_bits:i2bin(X, XLen).
-
-%% Octet string to Integer
-os2ip(X) ->
- ssh_bits:bin2i(X).
-
-%% decrypt1, M = message representative
-%% rsaep(#ssh_key { public={N,E}}, M) ->
-%% ?ssh_assert(M >= 0 andalso M =< N-1, out_of_range),
-%% ssh_math:ipow(M, E, N).
-
-%% encrypt1, C = cipher representative
-%% rsadp(#ssh_key { public={N,_}, private={_,D}}, C) ->
-%% ?ssh_assert(C >= 0 andalso C =< N-1, out_of_range),
-%% ssh_math:ipow(C, D, N).
-
-%% sign1, M = message representative
-rsasp1(#ssh_key { public={N,_}, private={_,D}}, M) ->
- ?ssh_assert((M >= 0 andalso M =< N-1), out_of_range),
- ssh_math:ipow(M, D, N).
-
-%% verify1, S =signature representative
-rsavp1(#ssh_key { public={N,E}}, S) ->
- ?ssh_assert(S >= 0 andalso S =< N-1, out_of_range),
- ssh_math:ipow(S, E, N).
-
-
-%% M messaage
-%% rsaes_oaep_encrypt(Public, M) ->
-%% rsaes_oaep_encrypt(Public, M, <<>>).
-
-%% rsaes_oaep_encrypt(Public=#ssh_key { public={N,_E}}, M, L) ->
-%% ?ssh_assert(size(L) =< 16#ffffffffffffffff, label_to_long),
-%% K = (ssh_bits:isize(N)+7) div 8,
-%% MLen = size(M),
-%% %% LLen = size(L),
-%% ?ssh_assert(MLen =< K - 2*?HLen - 2, message_to_long),
-%% LHash = ?HASH(L),
-%% PS = ssh_bits:fill_bits(K - MLen - 2*?HLen - 2, 0),
-%% DB = <<LHash/binary, PS/binary, 16#01, M/binary>>,
-%% Seed = ssh_bits:random(?HLen),
-%% DbMask = ?MGF(Seed, K - ?HLen - 1),
-%% MaskedDB = ssh_bits:xor_bits(DB, DbMask),
-%% SeedMask = ?MGF(MaskedDB, ?HLen),
-%% MaskedSeed = ssh_bits:xor_bits(Seed, SeedMask),
-%% EM = <<16#00, MaskedSeed/binary, MaskedDB/binary>>,
-%% Mc = os2ip(EM),
-%% C = rsaep(Public, Mc),
-%% i2osp(C, K).
-
-%% rsaes_oaep_decrypt(Key, C) ->
-%% rsaes_oaep_decrypt(Key, C, <<>>).
-
-%% rsaes_oaep_decrypt(Private=#ssh_key { public={N,_},private={_,_}},Cb,L) ->
-%% ?ssh_assert(size(L) =< 16#ffffffffffffffff, label_to_long),
-%% K = (ssh_bits:isize(N)+7) div 8,
-%% ?ssh_assert(K == 2*?HLen + 2, decryption_error),
-%% C = os2ip(Cb),
-%% M = rsadp(Private, C),
-%% EM = i2osp(M, K),
-%% LHash = ?HASH(L),
-%% MLen = K - ?HLen -1,
-%% case EM of
-%% <<16#00, MaskedSeed:?HLen/binary, MaskedDB:MLen>> ->
-%% SeedMask = ?MGF(MaskedDB, ?HLen),
-%% Seed = ssh_bits:xor_bits(MaskedSeed, SeedMask),
-%% DbMask = ?MGF(Seed, K - ?HLen - 1),
-%% DB = ssh_bits:xor_bits(MaskedDB, DbMask),
-%% PSLen = K - MLen - 2*?HLen - 2,
-%% case DB of
-%% <<LHash:?HLen, _PS:PSLen/binary, 16#01, M/binary>> ->
-%% M;
-%% _ ->
-%% exit(decryption_error)
-%% end;
-%% _ ->
-%% exit(decryption_error)
-%% end.
-
-
-%% rsaes_pkcs1_v1_5_encrypt(Public=#ssh_key { public={N,_}}, M) ->
-%% K = (ssh_bits:isize(N)+7) div 8,
-%% MLen = size(M),
-%% ?ssh_assert(MLen =< K - 11, message_to_long),
-%% PS = ssh_bits:random(K - MLen - 3),
-%% EM = <<16#00,16#02,PS/binary,16#00,M/binary>>,
-%% Mc = os2ip(EM),
-%% C = rsaep(Public, Mc),
-%% i2osp(C, K).
-
-
-%% rsaes_pkcs1_v1_5_decrypt(Private=#ssh_key { public={N,_},private={_,_}},
-%% Cb) ->
-%% K = (ssh_bits:isize(N)+7) div 8,
-%% CLen = size(Cb),
-%% ?ssh_assert(CLen == K andalso K >= 11, decryption_error),
-%% C = os2ip(Cb),
-%% M = rsadp(Private, C),
-%% EM = i2osp(M, K),
-%% PSLen = K - CLen - 3,
-%% case EM of
-%% <<16#00, 16#02, _PS:PSLen/binary, 16#00, M>> ->
-%% M;
-%% _ ->
-%% exit(decryption_error)
-%% end.
-
-%% rsassa_pss_sign(Private=#ssh_key { public={N,_},private={_,_}},Mb) ->
-%% ModBits = ssh_bits:isize(N),
-%% K = (ModBits+7) div 8,
-%% EM = emsa_pss_encode(Mb, ModBits - 1),
-%% M = os2ip(EM),
-%% S = rsasp1(Private, M),
-%% i2osp(S, K).
-
-%% rsassa_pss_verify(Public=#ssh_key { public={N,_E}},Mb,Sb) ->
-%% ModBits = ssh_bits:isize(N),
-%% K = (ModBits+7) div 8,
-%% ?ssh_assert(size(Sb) == K, invalid_signature),
-%% S = os2ip(Sb),
-%% M = rsavp1(Public,S),
-%% EMLen = (ModBits-1+7) div 8,
-%% EM = i2osp(M, EMLen),
-%% emsa_pss_verify(Mb, EM, ModBits-1).
-
-
-rsassa_pkcs1_v1_5_sign(Private=#ssh_key { public={N,_},private={_,_D}},Mb) ->
- K = (ssh_bits:isize(N)+7) div 8,
- EM = emsa_pkcs1_v1_5_encode(Mb, K),
- M = os2ip(EM),
- S = rsasp1(Private, M),
- i2osp(S, K).
-
-rsassa_pkcs1_v1_5_verify(Public=#ssh_key { public={N,_E}}, Mb, Sb) ->
- K = (ssh_bits:isize(N)+7) div 8,
- ?ssh_assert(size(Sb) == K, invalid_signature),
- S = os2ip(Sb),
- M = rsavp1(Public, S),
- EM = i2osp(M, K),
- %?dbg(true, "verify K=~p S=~w ~n#M=~w~n#EM=~w~n", [K, S, M, EM]),
- case emsa_pkcs1_v1_5_encode(Mb, K) of
- EM -> ok;
- _S ->
- {error, invalid_signature}
- end.
-
-
-emsa_pkcs1_v1_5_encode(M, EMLen) ->
- H = ?HASH(M),
- %% Must use speical xxNull types here!
- Alg = #'AlgorithmNull' { algorithm = ?'id-sha1',
- parameters = <<>> },
- {ok,TCode} = 'PKCS-1':encode('DigestInfoNull',
- #'DigestInfoNull'{ digestAlgorithm = Alg,
- digest = H }),
- T = list_to_binary(TCode),
- TLen = size(T),
- ?ssh_assert(EMLen >= TLen + 11, message_to_short),
- PS = ssh_bits:fill_bits(EMLen - TLen - 3, 16#ff),
- <<16#00, 16#01, PS/binary, 16#00, T/binary>>.
-
-
-%% emsa_pss_encode(M, EMBits) ->
-%% emsa_pss_encode(M, EMBits, 0).
-
-%% emsa_pss_encode(M, EMBits, SLen) ->
-%% ?ssh_assert(size(M) =< 16#ffffffffffffffff, message_to_long),
-%% EMLen = (EMBits + 7) div 8,
-%% MHash = ?HASH(M),
-%% ?ssh_assert(EMLen >= ?HLen + SLen + 2, encoding_error),
-%% Salt = ssh_bits:random(SLen),
-%% M1 = [16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,
-%% MHash, Salt],
-%% H = ?HASH(M1),
-%% PS = ssh_bits:fill_bits(EMLen-SLen-?HLen-2, 0),
-%% DB = <<PS/binary, 16#01, Salt/binary>>,
-%% DbMask = ?MGF(H, EMLen - ?HLen -1),
-%% MaskedDB = ssh_bits:xor_bits(DB, DbMask),
-%% ZLen = 8*EMLen - EMBits,
-%% NZLen = (8 - (ZLen rem 8)) rem 8,
-%% <<_:ZLen, NZ:NZLen, MaskedDB1/binary>> = MaskedDB,
-%% MaskedDB2 = <<0:ZLen, NZ:NZLen, MaskedDB1/binary>>,
-%% <<MaskedDB2/binary, H/binary, 16#BC>>.
-
-
-%% emsa_pss_verify(M, EM, EMBits) ->
-%% emsa_pss_verify(M, EM, EMBits, 0).
-
-%% emsa_pss_verify(M, EM, EMBits, SLen) ->
-%% ?ssh_assert(size(M) =< 16#ffffffffffffffff, message_to_long),
-%% EMLen = (EMBits + 7) div 8,
-%% MHash = ?HASH(M),
-%% ?ssh_assert(EMLen >= ?HLen + SLen + 2, inconsistent),
-%% MaskLen = (EMLen - ?HLen - 1)-1,
-%% ZLen = 8*EMLen - EMBits,
-%% NZLen = (8 - (ZLen rem 8)) rem 8,
-%% case EM of
-%% <<0:ZLen,Nz:NZLen,MaskedDB1:MaskLen/binary, H:?HLen/binary, 16#BC>> ->
-%% MaskedDB = <<0:ZLen,Nz:NZLen,MaskedDB1/binary>>,
-%% DbMask = ?MGF(H, EMLen - ?HLen - 1),
-%% DB = ssh_bits:xor_bits(MaskedDB, DbMask),
-%% PSLen1 = (EMLen - SLen - ?HLen - 2) - 1,
-%% PS = ssh_bits:fill_bits(PSLen1, 0),
-%% case DB of
-%% <<_:ZLen,0:NZLen,PS:PSLen1/binary,16#01,Salt:SLen/binary>> ->
-%% M1 = [16#00,16#00,16#00,16#00,16#00,16#00,16#00,16#00,
-%% MHash, Salt],
-%% case ?HASH(M1) of
-%% H -> ok;
-%% _ -> exit(inconsistent)
-%% end;
-%% _ ->
-%% exit(inconsistent)
-%% end;
-%% _ ->
-%% exit(inconsistent)
-%% end.
-
-
-
-%% Mask generating function MGF1
-%% mgf1(MGFSeed, MaskLen) ->
-%% T = mgf1_loop(0, ((MaskLen + ?HLen -1) div ?HLen) - 1, MGFSeed, ""),
-%% <<R:MaskLen/binary, _/binary>> = T,
-%% R.
-
-%% mgf1_loop(Counter, N, _, T) when Counter > N ->
-%% list_to_binary(T);
-%% mgf1_loop(Counter, N, MGFSeed, T) ->
-%% C = i2osp(Counter, 4),
-%% mgf1_loop(Counter+1, N, MGFSeed, [T, ?HASH([MGFSeed, C])]).
-
-
-
-
-alg_name() ->
- "ssh-rsa".
diff --git a/lib/ssh/src/ssh_sftpd.erl b/lib/ssh/src/ssh_sftpd.erl
index da91817fd7..ec7b76b0b3 100644
--- a/lib/ssh/src/ssh_sftpd.erl
+++ b/lib/ssh/src/ssh_sftpd.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -231,8 +231,6 @@ handle_op(?SSH_FXP_REALPATH, ReqId,
case Res of
{ok, AbsPath} ->
NewAbsPath = chroot_filename(AbsPath, State),
- ?dbg(true, "handle_op ?SSH_FXP_REALPATH: RelPath=~p AbsPath=~p\n",
- [RelPath, NewAbsPath]),
XF = State#state.xf,
Attr = #ssh_xfer_attr{type=directory},
ssh_xfer:xf_send_name(XF, ReqId, NewAbsPath, Attr),
@@ -426,18 +424,18 @@ handle_op(?SSH_FXP_RENAME, ReqId,
State0
end;
handle_op(?SSH_FXP_SYMLINK, ReqId,
- <<?UINT32(PLen), BPath:PLen/binary, ?UINT32(PLen2),
- BPath2:PLen2/binary>>,
+ <<?UINT32(PLen), Link:PLen/binary, ?UINT32(PLen2),
+ Target:PLen2/binary>>,
State0 = #state{file_handler = FileMod, file_state = FS0}) ->
- Path = relate_file_name(BPath, State0),
- Path2 = relate_file_name(BPath2, State0),
- {Status, FS1} = FileMod:make_symlink(Path2, Path, FS0),
+ LinkPath = relate_file_name(Link, State0),
+ TargetPath = relate_file_name(Target, State0),
+ {Status, FS1} = FileMod:make_symlink(TargetPath, LinkPath, FS0),
State1 = State0#state{file_state = FS1},
send_status(Status, ReqId, State1).
new_handle([], H) ->
H;
-new_handle([{N, _} | Rest], H) when N > H ->
+new_handle([{N, _,_} | Rest], H) when N =< H ->
new_handle(Rest, N+1);
new_handle([_ | Rest], H) ->
new_handle(Rest, H).
@@ -446,6 +444,8 @@ add_handle(State, XF, ReqId, Type, DirFileTuple) ->
Handles = State#state.handles,
Handle = new_handle(Handles, 0),
ssh_xfer:xf_send_handle(XF, ReqId, integer_to_list(Handle)),
+ %% OBS: If you change handles-tuple also change new_handle!
+ %% Is this this the best way to implement new handle?
State#state{handles = [{Handle, Type, DirFileTuple} | Handles]}.
get_handle(Handles, BinHandle) ->
@@ -463,7 +463,6 @@ get_handle(Handles, BinHandle) ->
read_dir(State0 = #state{file_handler = FileMod, max_files = MaxLength, file_state = FS0},
XF, ReqId, Handle, RelPath, {cache, Files}) ->
AbsPath = relate_file_name(RelPath, State0),
- ?dbg(true, "read_dir: AbsPath=~p\n", [AbsPath]),
if
length(Files) > MaxLength ->
{ToSend, NewCache} = lists:split(MaxLength, Files),
@@ -484,7 +483,6 @@ read_dir(State0 = #state{file_handler = FileMod, max_files = MaxLength, file_sta
read_dir(State0 = #state{file_handler = FileMod, max_files = MaxLength, file_state = FS0},
XF, ReqId, Handle, RelPath, _Status) ->
AbsPath = relate_file_name(RelPath, State0),
- ?dbg(true, "read_dir: AbsPath=~p\n", [AbsPath]),
{Res, FS1} = FileMod:list_dir(AbsPath, FS0),
case Res of
{ok, Files} when MaxLength == 0 orelse MaxLength > length(Files) ->
@@ -516,7 +514,6 @@ get_attrs(_RelPath, [], _FileMod, FS, Acc) ->
{lists:reverse(Acc), FS};
get_attrs(RelPath, [F | Rest], FileMod, FS0, Acc) ->
Path = filename:absname(F, RelPath),
- ?dbg(true, "get_attrs fun: F=~p\n", [F]),
case FileMod:read_link_info(Path, FS0) of
{{ok, Info}, FS1} ->
Attrs = ssh_sftp:info_to_attr(Info),
@@ -560,7 +557,6 @@ stat(ReqId, RelPath, State0=#state{file_handler=FileMod,
file_state=FS0}, F) ->
AbsPath = relate_file_name(RelPath, State0),
XF = State0#state.xf,
- ?dbg(false, "stat: AbsPath=~p\n", [AbsPath]),
{Res, FS1} = FileMod:F(AbsPath, FS0),
State1 = State0#state{file_state = FS1},
case Res of
@@ -605,6 +601,8 @@ decode_4_access_flag(add_subdirectory) ->
[read];
decode_4_access_flag(append_data) ->
[append];
+decode_4_access_flag(write_attributes) ->
+ [write];
decode_4_access_flag(_) ->
[read].
@@ -619,8 +617,7 @@ open(Vsn, ReqId, Data, State) when Vsn =< 3 ->
<<?UINT32(BLen), BPath:BLen/binary, ?UINT32(PFlags),
_Attrs/binary>> = Data,
Path = binary_to_list(BPath),
- Flags = ssh_xfer:decode_open_flags(Vsn, PFlags) -- [creat, excl, trunc],
- ?dbg(true, "open: Flags=~p\n", [Flags]),
+ Flags = ssh_xfer:decode_open_flags(Vsn, PFlags),
do_open(ReqId, State, Path, Flags);
open(Vsn, ReqId, Data, State) when Vsn >= 4 ->
<<?UINT32(BLen), BPath:BLen/binary, ?UINT32(Access),
@@ -628,7 +625,6 @@ open(Vsn, ReqId, Data, State) when Vsn >= 4 ->
Path = binary_to_list(BPath),
FlagBits = ssh_xfer:decode_open_flags(Vsn, PFlags),
AcessBits = ssh_xfer:decode_ace_mask(Access),
- ?dbg(true, "open: Fl=~p\n", [FlagBits]),
%% TODO: This is to make sure the Access flags are not ignored
%% but this should be thought through better. This solution should
%% be considered a hack in order to buy some time. At least
@@ -638,15 +634,12 @@ open(Vsn, ReqId, Data, State) when Vsn >= 4 ->
AcessFlags = decode_4_acess(AcessBits),
Flags = lists:append(lists:umerge(
[[decode_4_flags(FlagBits)] | AcessFlags])),
-
- ?dbg(true, "open: Flags=~p\n", [Flags]),
-
do_open(ReqId, State, Path, Flags).
do_open(ReqId, State0, Path, Flags) ->
#state{file_handler = FileMod, file_state = FS0, root = Root} = State0,
XF = State0#state.xf,
- F = [raw, binary | Flags],
+ F = [binary | Flags],
%% case FileMod:is_dir(Path) of %% This is version 6 we still have 5
%% true ->
%% ssh_xfer:xf_send_status(State#state.xf, ReqId,
@@ -895,14 +888,11 @@ set_stat(Attr, Path,
State0 = #state{file_handler=FileMod, file_state=FS0}) ->
{DecodedAttr, _Rest} =
ssh_xfer:decode_ATTR((State0#state.xf)#ssh_xfer.vsn, Attr),
- ?dbg(true, "set_stat DecodedAttr=~p\n", [DecodedAttr]),
Info = ssh_sftp:attr_to_info(DecodedAttr),
{Res1, FS1} = FileMod:read_link_info(Path, FS0),
case Res1 of
{ok, OldInfo} ->
NewInfo = set_file_info(Info, OldInfo),
- ?dbg(true, "set_stat Path=~p\nInfo=~p\nOldInfo=~p\nNewInfo=~p\n",
- [Path, Info, OldInfo, NewInfo]),
{Res2, FS2} = FileMod:write_file_info(Path, NewInfo, FS1),
State1 = State0#state{file_state = FS2},
{Res2, State1};
diff --git a/lib/ssh/src/ssh_sftpd_file_api.erl b/lib/ssh/src/ssh_sftpd_file_api.erl
index 38371f809d..83d90907f5 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -22,40 +22,40 @@
-module(ssh_sftpd_file_api).
%% To be further specified later
--callback close(IoDevice::term(), State::term()) ->
- ok | {error, Reason::term()}.
--callback delete(Path::term(), State::term()) ->
- ok | {error, Reason::term()}.
--callback del_dir(Path::term(), State::term()) ->
- ok | {error, Reason::term()}.
+-callback close(file:io_device(), State::term()) ->
+ {ok, State::term()} | {{error, Reason::term()}, State::term()}.
+-callback delete(file:name(), State::term()) ->
+ {ok, State::term()} | {{error, Reason::term()}, State::term()}.
+-callback del_dir(file:name(), State::term()) ->
+ {ok, State::term()} | {{error, Reason::term()}, State::term()}.
-callback get_cwd(State::term()) ->
- {ok, Dir::term()} | {error, Reason::term()}.
--callback is_dir(AbsPath::term(), State::term()) ->
- boolean().
--callback list_dir(AbsPath::term(), State::term()) ->
- {ok, Filenames::term()} | {error, Reason::term()}.
+ {{ok, Dir::term()}, State::term()} | {{error, Reason::term()}, State::term()}.
+-callback is_dir(file:name(), State::term()) ->
+ {boolean(), State::term()}.
+-callback list_dir(file:name(), State::term()) ->
+ {{ok, Filenames::term()}, State::term()} | {{error, Reason::term()}, State::term()}.
-callback make_dir(Dir::term(), State::term()) ->
- ok | {error, Reason::term()}.
+ {{ok, State::term()},State::term()} | {{error, Reason::term()}, State::term()}.
-callback make_symlink(Path2::term(), Path::term(), State::term()) ->
- ok | {error, Reason::term()}.
+ {ok, State::term()} | {{error, Reason::term()}, State::term()}.
-callback open(Path::term(), Flags::term(), State::term()) ->
- {ok, IoDevice::term()} | {error, Reason::term()}.
--callback position(IoDevice::term(), Offs::term(), State::term()) ->
- {ok, NewPosition::term()} | {error, Reason::term()}.
--callback read(IoDevice::term(), Len::term(), State::term()) ->
- {ok, Data::term()} | eof | {error, Reason::term()}.
--callback read_link(Path::term(), State::term()) ->
- {ok, FileName::term()} | {error, Reason::term()}.
--callback read_link_info(Path::term(), State::term()) ->
- {ok, FileInfo::term()} | {error, Reason::term()}.
--callback read_file_info(Path::term(), State::term()) ->
- {ok, FileInfo::term()} | {error, Reason::term()}.
--callback rename(Path::term(), Path2::term(), State::term()) ->
- ok | {error, Reason::term()}.
--callback write(IoDevice::term(), Data::term(), State::term()) ->
- ok | {error, Reason::term()}.
--callback write_file_info(Path::term(),Info::term(), State::term()) ->
- ok | {error, Reason::term()}.
+ {{ok, IoDevice::term()}, State::term()} | {{error, Reason::term()}, State::term()}.
+-callback position(file:io_device(), Offs::term(), State::term()) ->
+ {{ok, NewPosition::term()}, State::term()} | {{error, Reason::term()}, State::term()}.
+-callback read(file:io_device(), Len::term(), State::term()) ->
+ {{ok, Data::term()},State::term()} | {eof, State::term()} | {{error, Reason::term()}, State::term()}.
+-callback read_link(file:name(), State::term()) ->
+ {{ok, FileName::term()}, State::term()} | {{error, Reason::term()}, State::term()}.
+-callback read_link_info(file:name(), State::term()) ->
+ {{ok, FileInfo::term()}, State::term()} | {{error, Reason::term()}, State::term()}.
+-callback read_file_info(file:name(), State::term()) ->
+ {{ok, FileInfo::term()}, State::term()} | {{error, Reason::term()},State::term()}.
+-callback rename(file:name(), file:name(), State::term()) ->
+ {ok, State::term()} | {{error, Reason::term()}, State::term()}.
+-callback write(file:io_device(), Data::term(), State::term()) ->
+ {ok, State::term()} | {{error, Reason::term()}, State::term()}.
+-callback write_file_info(file:name(),Info::term(), State::term()) ->
+ {ok, State::term()} | {{error, Reason::term()}, State::term()}.
diff --git a/lib/ssh/src/ssh_subsystem_sup.erl b/lib/ssh/src/ssh_subsystem_sup.erl
index d71b6bbc56..cd6defd535 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -70,13 +70,12 @@ ssh_connectinon_child_spec(Opts) ->
Address = proplists:get_value(address, Opts),
Port = proplists:get_value(port, Opts),
Role = proplists:get_value(role, Opts),
- Name = id(Role, ssh_connection_controler, Address, Port),
- StartFunc = {ssh_connection_controler, start_link, [Opts]},
+ Name = id(Role, ssh_connection_sup, Address, Port),
+ StartFunc = {ssh_connection_sup, start_link, [Opts]},
Restart = transient,
-% Restart = permanent,
Shutdown = 5000,
- Modules = [ssh_connection_controler],
- Type = worker,
+ Modules = [ssh_connection_sup],
+ Type = supervisor,
{Name, StartFunc, Restart, Shutdown, Type, Modules}.
ssh_channel_child_spec(Opts) ->
@@ -86,7 +85,6 @@ ssh_channel_child_spec(Opts) ->
Name = id(Role, ssh_channel_sup, Address, Port),
StartFunc = {ssh_channel_sup, start_link, [Opts]},
Restart = transient,
-% Restart = permanent,
Shutdown = infinity,
Modules = [ssh_channel_sup],
Type = supervisor,
@@ -95,7 +93,7 @@ ssh_channel_child_spec(Opts) ->
id(Role, Sup, Address, Port) ->
{Role, Sup, Address, Port}.
-ssh_connection_sup([{_, Child, _, [ssh_connection_controler]} | _]) ->
+ssh_connection_sup([{_, Child, _, [ssh_connection_sup]} | _]) ->
Child;
ssh_connection_sup([_ | Rest]) ->
ssh_connection_sup(Rest).
diff --git a/lib/ssh/src/ssh_system_sup.erl b/lib/ssh/src/ssh_system_sup.erl
index 920baaadef..36daf3b1ac 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -146,7 +146,7 @@ ssh_acceptor_child_spec(ServerOpts) ->
ssh_subsystem_child_spec(ServerOpts) ->
Name = make_ref(),
StartFunc = {ssh_subsystem_sup, start_link, [ServerOpts]},
- Restart = temporary,
+ Restart = transient,
Shutdown = infinity,
Modules = [ssh_subsystem_sup],
Type = supervisor,
diff --git a/lib/ssh/src/ssh_transport.erl b/lib/ssh/src/ssh_transport.erl
index de3e29e2f1..1f912c9bdf 100644
--- a/lib/ssh/src/ssh_transport.erl
+++ b/lib/ssh/src/ssh_transport.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -23,10 +23,11 @@
-module(ssh_transport).
--include("ssh_transport.hrl").
+-include_lib("public_key/include/public_key.hrl").
+-include_lib("kernel/include/inet.hrl").
+-include("ssh_transport.hrl").
-include("ssh.hrl").
--include_lib("kernel/include/inet.hrl").
-export([connect/5, accept/4]).
-export([versions/2, hello_version_msg/1]).
@@ -38,17 +39,8 @@
handle_kex_dh_gex_group/2, handle_kex_dh_gex_reply/2,
handle_new_keys/2, handle_kex_dh_gex_request/2,
handle_kexdh_reply/2,
- unpack/3, decompress/2, ssh_packet/2, pack/2, msg_data/1]).
-
-%% debug flagso
--define(DBG_ALG, true).
--define(DBG_KEX, true).
--define(DBG_CRYPTO, false).
--define(DBG_PACKET, false).
--define(DBG_MESSAGE, true).
--define(DBG_BIN_MESSAGE, true).
--define(DBG_MAC, false).
--define(DBG_ZLIB, true).
+ unpack/3, decompress/2, ssh_packet/2, pack/2, msg_data/1,
+ sign/3, verify/4]).
versions(client, Options)->
Vsn = proplists:get_value(vsn, Options, ?DEFAULT_CLIENT_VERSION),
@@ -150,7 +142,7 @@ connect(ConnectionSup, Address, Port, SocketOpts, Opts) ->
case do_connect(Callback, Address, Port, SocketOpts, Timeout) of
{ok, Socket} ->
{ok, Pid} =
- ssh_connection_controler:start_handler_child(ConnectionSup,
+ ssh_connection_sup:start_handler_child(ConnectionSup,
[client, Socket,
[{address, Address},
{port, Port} |
@@ -182,12 +174,11 @@ accept(Address, Port, Socket, Options) ->
ssh_system_sup:connection_supervisor(
ssh_system_sup:system_supervisor(Address, Port)),
{ok, Pid} =
- ssh_connection_controler:start_handler_child(ConnectionSup,
+ ssh_connection_sup:start_handler_child(ConnectionSup,
[server, Socket,
[{address, Address},
{port, Port} | Options]]),
Callback:controlling_process(Socket, Pid),
- ssh_connection_handler:send_event(Pid, socket_control),
{ok, Pid}.
format_version({Major,Minor}) ->
@@ -212,24 +203,24 @@ key_exchange_init_msg(Ssh0) ->
{SshPacket, Ssh} = ssh_packet(Msg, Ssh0),
{Msg, SshPacket, Ssh}.
-kex_init(#ssh{role = Role, opts = Opts}) ->
+kex_init(#ssh{role = Role, opts = Opts, available_host_keys = HostKeyAlgs}) ->
Random = ssh_bits:random(16),
Compression = case proplists:get_value(compression, Opts, none) of
zlib -> ["zlib", "none"];
none -> ["none", "zlib"]
end,
- kexinit_messsage(Role, Random, Compression).
+ kexinit_messsage(Role, Random, Compression, HostKeyAlgs).
key_init(client, Ssh, Value) ->
Ssh#ssh{c_keyinit = Value};
key_init(server, Ssh, Value) ->
Ssh#ssh{s_keyinit = Value}.
-kexinit_messsage(client, Random, Compression) ->
+kexinit_messsage(client, Random, Compression, HostKeyAlgs) ->
#ssh_msg_kexinit{
cookie = Random,
kex_algorithms = ["diffie-hellman-group1-sha1"],
- server_host_key_algorithms = ["ssh-rsa", "ssh-dss"],
+ server_host_key_algorithms = HostKeyAlgs,
encryption_algorithms_client_to_server = ["aes128-cbc","3des-cbc"],
encryption_algorithms_server_to_client = ["aes128-cbc","3des-cbc"],
mac_algorithms_client_to_server = ["hmac-sha1"],
@@ -240,11 +231,11 @@ kexinit_messsage(client, Random, Compression) ->
languages_server_to_client = []
};
-kexinit_messsage(server, Random, Compression) ->
+kexinit_messsage(server, Random, Compression, HostKeyAlgs) ->
#ssh_msg_kexinit{
cookie = Random,
kex_algorithms = ["diffie-hellman-group1-sha1"],
- server_host_key_algorithms = ["ssh-dss"],
+ server_host_key_algorithms = HostKeyAlgs,
encryption_algorithms_client_to_server = ["aes128-cbc","3des-cbc"],
encryption_algorithms_server_to_client = ["aes128-cbc","3des-cbc"],
mac_algorithms_client_to_server = ["hmac-sha1"],
@@ -300,7 +291,6 @@ install_messages('diffie-hellman-group-exchange-sha1') ->
key_exchange_first_msg('diffie-hellman-group1-sha1', Ssh0) ->
{G, P} = dh_group1(),
{Private, Public} = dh_gen_key(G, P, 1024),
- %%?dbg(?DBG_KEX, "public: ~p~n", [Public]),
{SshPacket, Ssh1} = ssh_packet(#ssh_msg_kexdh_init{e = Public}, Ssh0),
{ok, SshPacket,
Ssh1#ssh{keyex_key = {{Private, Public}, {G, P}}}};
@@ -320,7 +310,6 @@ key_exchange_first_msg('diffie-hellman-group-exchange-sha1', Ssh0) ->
handle_kexdh_init(#ssh_msg_kexdh_init{e = E}, Ssh0) ->
{G, P} = dh_group1(),
{Private, Public} = dh_gen_key(G, P, 1024),
- %%?dbg(?DBG_KEX, "public: ~p~n", [Public]),
K = ssh_math:ipow(E, Private, P),
{Key, K_S} = get_host_key(Ssh0),
H = kex_h(Ssh0, K_S, E, Public, K),
@@ -329,8 +318,7 @@ handle_kexdh_init(#ssh_msg_kexdh_init{e = E}, Ssh0) ->
f = Public,
h_sig = H_SIG
}, Ssh0),
- %%?dbg(?DBG_KEX, "shared_secret: ~s ~n", [fmt_binary(K, 16, 4)]),
- %%?dbg(?DBG_KEX, "hash: ~s ~n", [fmt_binary(H, 16, 4)]),
+
{ok, SshPacket, Ssh1#ssh{keyex_key = {{Private, Public}, {G, P}},
shared_secret = K,
exchanged_hash = H,
@@ -338,7 +326,6 @@ handle_kexdh_init(#ssh_msg_kexdh_init{e = E}, Ssh0) ->
handle_kex_dh_gex_group(#ssh_msg_kex_dh_gex_group{p = P, g = G}, Ssh0) ->
{Private, Public} = dh_gen_key(G,P,1024),
- %%?dbg(?DBG_KEX, "public: ~p ~n", [Public]),
{SshPacket, Ssh1} =
ssh_packet(#ssh_msg_kex_dh_gex_init{e = Public}, Ssh0),
{ok, SshPacket,
@@ -362,8 +349,7 @@ handle_kexdh_reply(#ssh_msg_kexdh_reply{public_host_key = HostKey, f = F,
#ssh{keyex_key = {{Private, Public}, {_G, P}}} = Ssh0) ->
K = ssh_math:ipow(F, Private, P),
H = kex_h(Ssh0, HostKey, Public, F, K),
- %%?dbg(?DBG_KEX, "shared_secret: ~s ~n", [fmt_binary(K, 16, 4)]),
- %%?dbg(?DBG_KEX, "hash: ~s ~n", [fmt_binary(H, 16, 4)]),
+
case verify_host_key(Ssh0, HostKey, H, H_SIG) of
ok ->
{SshPacket, Ssh} = ssh_packet(#ssh_msg_newkeys{}, Ssh0),
@@ -396,8 +382,7 @@ handle_kex_dh_gex_reply(#ssh_msg_kex_dh_gex_reply{public_host_key = HostKey,
Ssh0) ->
K = ssh_math:ipow(F, Private, P),
H = kex_h(Ssh0, HostKey, Min, NBits, Max, P, G, Public, F, K),
- %%?dbg(?DBG_KEX, "shared_secret: ~s ~n", [fmt_binary(K, 16, 4)]),
- %%?dbg(?DBG_KEX, "hash: ~s ~n", [fmt_binary(H, 16, 4)]),
+
case verify_host_key(Ssh0, HostKey, H, H_SIG) of
ok ->
{SshPacket, Ssh} = ssh_packet(#ssh_msg_newkeys{}, Ssh0),
@@ -423,83 +408,68 @@ sid(#ssh{session_id = Id}, _) ->
%%
get_host_key(SSH) ->
#ssh{key_cb = Mod, opts = Opts, algorithms = ALG} = SSH,
- Scope = proplists:get_value(key_scope, Opts, system),
- case ALG#alg.hkey of
- 'ssh-rsa' ->
- case Mod:private_host_rsa_key(Scope, Opts) of
- {ok,Key=#ssh_key { public={N,E}} } ->
- %%?dbg(true, "x~n", []),
- {Key,
- ssh_bits:encode(["ssh-rsa",E,N],[string,mpint,mpint])};
- Error ->
- %%?dbg(true, "y~n", []),
- exit(Error)
- end;
- 'ssh-dss' ->
- case Mod:private_host_dsa_key(Scope, Opts) of
- {ok,Key=#ssh_key { public={P,Q,G,Y}}} ->
- {Key, ssh_bits:encode(["ssh-dss",P,Q,G,Y],
- [string,mpint,mpint,mpint,mpint])};
- Error ->
- exit(Error)
- end;
- _ ->
- exit({error, bad_key_type})
+
+ case Mod:host_key(ALG#alg.hkey, Opts) of
+ {ok, #'RSAPrivateKey'{modulus = N, publicExponent = E} = Key} ->
+ {Key,
+ ssh_bits:encode(["ssh-rsa",E,N],[string,mpint,mpint])};
+ {ok, #'DSAPrivateKey'{y = Y, p = P, q = Q, g = G} = Key} ->
+ {Key, ssh_bits:encode(["ssh-dss",P,Q,G,Y],
+ [string,mpint,mpint,mpint,mpint])};
+ Result ->
+ exit({error, {Result, unsupported_key_type}})
end.
-sign_host_key(Ssh, Private, H) ->
- ALG = Ssh#ssh.algorithms,
- Module = case ALG#alg.hkey of
- 'ssh-rsa' ->
- ssh_rsa;
- 'ssh-dss' ->
- ssh_dsa
- end,
- case catch Module:sign(Private, H) of
- {'EXIT', Reason} ->
- error_logger:format("SIGN FAILED: ~p\n", [Reason]),
- {error, Reason};
- SIG ->
- ssh_bits:encode([Module:alg_name() ,SIG],[string,binary])
- end.
+sign_host_key(_Ssh, #'RSAPrivateKey'{} = Private, H) ->
+ Hash = sha, %% Option ?!
+ Signature = sign(H, Hash, Private),
+ ssh_bits:encode(["ssh-rsa", Signature],[string, binary]);
+sign_host_key(_Ssh, #'DSAPrivateKey'{} = Private, H) ->
+ Hash = sha, %% Option ?!
+ RawSignature = sign(H, Hash, Private),
+ ssh_bits:encode(["ssh-dss", RawSignature],[string, binary]).
verify_host_key(SSH, K_S, H, H_SIG) ->
ALG = SSH#ssh.algorithms,
case ALG#alg.hkey of
'ssh-rsa' ->
- case ssh_bits:decode(K_S,[string,mpint,mpint]) of
- ["ssh-rsa", E, N] ->
- ["ssh-rsa",SIG] = ssh_bits:decode(H_SIG,[string,binary]),
- Public = #ssh_key { type=rsa, public={N,E} },
- case catch ssh_rsa:verify(Public, H, SIG) of
- {'EXIT', Reason} ->
- error_logger:format("VERIFY FAILED: ~p\n", [Reason]),
- {error, bad_signature};
- ok ->
- known_host_key(SSH, Public, "ssh-rsa")
- end;
- _ ->
- {error, bad_format}
- end;
+ verify_host_key_rsa(SSH, K_S, H, H_SIG);
'ssh-dss' ->
- case ssh_bits:decode(K_S,[string,mpint,mpint,mpint,mpint]) of
- ["ssh-dss",P,Q,G,Y] ->
- ["ssh-dss",SIG] = ssh_bits:decode(H_SIG,[string,binary]),
- Public = #ssh_key { type=dsa, public={P,Q,G,Y} },
- case catch ssh_dsa:verify(Public, H, SIG) of
- {'EXIT', Reason} ->
- error_logger:format("VERIFY FAILED: ~p\n", [Reason]),
- {error, bad_signature};
- ok ->
- known_host_key(SSH, Public, "ssh-dss")
- end;
- _ ->
- {error, bad_host_key_format}
- end;
+ verify_host_key_dss(SSH, K_S, H, H_SIG);
_ ->
{error, bad_host_key_algorithm}
end.
+verify_host_key_rsa(SSH, K_S, H, H_SIG) ->
+ case ssh_bits:decode(K_S,[string,mpint,mpint]) of
+ ["ssh-rsa", E, N] ->
+ ["ssh-rsa",SIG] = ssh_bits:decode(H_SIG,[string,binary]),
+ Public = #'RSAPublicKey'{publicExponent = E, modulus = N},
+ case verify(H, sha, SIG, Public) of
+ false ->
+ {error, bad_signature};
+ true ->
+ known_host_key(SSH, Public, "ssh-rsa")
+ end;
+ _ ->
+ {error, bad_format}
+ end.
+
+verify_host_key_dss(SSH, K_S, H, H_SIG) ->
+ case ssh_bits:decode(K_S,[string,mpint,mpint,mpint,mpint]) of
+ ["ssh-dss",P,Q,G,Y] ->
+ ["ssh-dss",SIG] = ssh_bits:decode(H_SIG,[string,binary]),
+ Public = {Y, #'Dss-Parms'{p = P, q = Q, g = G}},
+ case verify(H, sha, SIG, Public) of
+ false ->
+ {error, bad_signature};
+ true ->
+ known_host_key(SSH, Public, "ssh-dss")
+ end;
+ _ ->
+ {error, bad_host_key_format}
+ end.
+
accepted_host(Ssh, PeerName, Opts) ->
case proplists:get_value(silently_accept_hosts, Opts, false) of
true ->
@@ -511,14 +481,10 @@ accepted_host(Ssh, PeerName, Opts) ->
known_host_key(#ssh{opts = Opts, key_cb = Mod, peer = Peer} = Ssh,
Public, Alg) ->
PeerName = peer_name(Peer),
- case Mod:lookup_host_key(PeerName, Alg, Opts) of
- {ok, Public} ->
+ case Mod:is_host_key(Public, PeerName, Alg, Opts) of
+ true ->
ok;
- {ok, BadPublic} ->
- error_logger:format("known_host_key: Public ~p BadPublic ~p\n",
- [Public, BadPublic]),
- {error, bad_public_key};
- {error, not_found} ->
+ false ->
case accepted_host(Ssh, PeerName, Opts) of
yes ->
Mod:add_host_key(PeerName, Public, Opts);
@@ -621,7 +587,6 @@ install_alg(SSH) ->
alg_setup(SSH) ->
ALG = SSH#ssh.algorithms,
- %%?dbg(?DBG_ALG, "ALG: setup ~p ~n", [ALG]),
SSH#ssh{kex = ALG#alg.kex,
hkey = ALG#alg.hkey,
encrypt = ALG#alg.encrypt,
@@ -638,7 +603,6 @@ alg_setup(SSH) ->
}.
alg_init(SSH0) ->
- %%?dbg(?DBG_ALG, "ALG: init~n", []),
{ok,SSH1} = send_mac_init(SSH0),
{ok,SSH2} = recv_mac_init(SSH1),
{ok,SSH3} = encrypt_init(SSH2),
@@ -648,7 +612,6 @@ alg_init(SSH0) ->
SSH6.
alg_final(SSH0) ->
- %%?dbg(?DBG_ALG, "ALG: final ~n", []),
{ok,SSH1} = send_mac_final(SSH0),
{ok,SSH2} = recv_mac_final(SSH1),
{ok,SSH3} = encrypt_final(SSH2),
@@ -669,19 +632,15 @@ select(CL, SL) ->
[] -> undefined;
[ALG|_] -> ALG
end,
- %%?dbg(?DBG_ALG, "ALG: select: ~p ~p = ~p~n", [CL, SL, C]),
C.
ssh_packet(#ssh_msg_kexinit{} = Msg, Ssh0) ->
BinMsg = ssh_bits:encode(Msg),
Ssh = key_init(Ssh0#ssh.role, Ssh0, BinMsg),
- %%?dbg(?DBG_MESSAGE, "SEND_MSG: ~p~n", [Msg]),
pack(BinMsg, Ssh);
ssh_packet(Msg, Ssh) ->
BinMsg = ssh_bits:encode(Msg),
- %%?dbg(?DBG_MESSAGE, "SEND_MSG: ~p~n", [Msg]),
- %%?dbg(?DBG_BIN_MESSAGE, "Encoded: ~p~n", [BinMsg]),
pack(BinMsg, Ssh).
pack(Data0, #ssh{encrypt_block_size = BlockSize,
@@ -732,17 +691,20 @@ msg_data(PacketData) ->
_:PaddingLen/binary>> = PacketData,
Data.
+sign(SigData, Hash, #'DSAPrivateKey'{} = Key) ->
+ DerSignature = public_key:sign(SigData, Hash, Key),
+ #'Dss-Sig-Value'{r = R, s = S} = public_key:der_decode('Dss-Sig-Value', DerSignature),
+ <<R:160/big-unsigned-integer, S:160/big-unsigned-integer>>;
+sign(SigData, Hash, Key) ->
+ public_key:sign(SigData, Hash, Key).
-%% Send a disconnect message
-%% terminate(S, SSH, Code, Message) ->
-%% M = #ssh_msg_disconnect{code=Code,
-%% description = Message,
-%% language = "en"},
-%% send_msg(S, SSH, M),
-%% gen_tcp:close(S),
-%% {error, M}.
+verify(PlainText, Hash, Sig, {_, #'Dss-Parms'{}} = Key) ->
+ <<R:160/big-unsigned-integer, S:160/big-unsigned-integer>> = Sig,
+ Signature = public_key:der_encode('Dss-Sig-Value', #'Dss-Sig-Value'{r = R, s = S}),
+ public_key:verify(PlainText, Hash, Signature, Key);
+verify(PlainText, Hash, Sig, Key) ->
+ public_key:verify(PlainText, Hash, Sig, Key).
-
%% public key algorithms
%%
%% ssh-dss REQUIRED sign Raw DSS Key
@@ -761,9 +723,6 @@ msg_data(PacketData) ->
%%
%%
-
-
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Encryption
%%
@@ -833,19 +792,13 @@ encrypt(#ssh{encrypt = none} = Ssh, Data) ->
encrypt(#ssh{encrypt = '3des-cbc',
encrypt_keys = {K1,K2,K3},
encrypt_ctx = IV0} = Ssh, Data) ->
- %%?dbg(?DBG_CRYPTO, "encrypt: IV=~p K1=~p, K2=~p, K3=~p ~n",
- %% [IV0,K1,K2,K3]),
Enc = crypto:des3_cbc_encrypt(K1,K2,K3,IV0,Data),
- %%?dbg(?DBG_CRYPTO, "encrypt: ~p -> ~p ~n", [Data, Enc]),
IV = crypto:des_cbc_ivec(Enc),
{Ssh#ssh{encrypt_ctx = IV}, Enc};
encrypt(#ssh{encrypt = 'aes128-cbc',
encrypt_keys = K,
encrypt_ctx = IV0} = Ssh, Data) ->
- %%?dbg(?DBG_CRYPTO, "encrypt: IV=~p K=~p ~n",
- %% [IV0,K]),
Enc = crypto:aes_cbc_128_encrypt(K,IV0,Data),
- %%?dbg(?DBG_CRYPTO, "encrypt: ~p -> ~p ~n", [Data, Enc]),
IV = crypto:aes_cbc_ivec(Enc),
{Ssh#ssh{encrypt_ctx = IV}, Enc}.
@@ -893,18 +846,12 @@ decrypt(#ssh{decrypt = none} = Ssh, Data) ->
decrypt(#ssh{decrypt = '3des-cbc', decrypt_keys = Keys,
decrypt_ctx = IV0} = Ssh, Data) ->
{K1, K2, K3} = Keys,
- %%?dbg(?DBG_CRYPTO, "decrypt: IV=~p K1=~p, K2=~p, K3=~p ~n",
- %%[IV0,K1,K2,K3]),
Dec = crypto:des3_cbc_decrypt(K1,K2,K3,IV0,Data),
- %%?dbg(?DBG_CRYPTO, "decrypt: ~p -> ~p ~n", [Data, Dec]),
IV = crypto:des_cbc_ivec(Data),
{Ssh#ssh{decrypt_ctx = IV}, Dec};
decrypt(#ssh{decrypt = 'aes128-cbc', decrypt_keys = Key,
decrypt_ctx = IV0} = Ssh, Data) ->
- %%?dbg(?DBG_CRYPTO, "decrypt: IV=~p Key=~p ~n",
- %% [IV0,Key]),
Dec = crypto:aes_cbc_128_decrypt(Key,IV0,Data),
- %%?dbg(?DBG_CRYPTO, "decrypt: ~p -> ~p ~n", [Data, Dec]),
IV = crypto:aes_cbc_ivec(Data),
{Ssh#ssh{decrypt_ctx = IV}, Dec}.
@@ -936,7 +883,6 @@ compress(#ssh{compress = none} = Ssh, Data) ->
{Ssh, Data};
compress(#ssh{compress = zlib, compress_ctx = Context} = Ssh, Data) ->
Compressed = zlib:deflate(Context, Data, sync),
- %%?dbg(?DBG_ZLIB, "deflate: ~p -> ~p ~n", [Data, Compressed]),
{Ssh, list_to_binary(Compressed)}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -960,7 +906,6 @@ decompress(#ssh{decompress = none} = Ssh, Data) ->
{Ssh, Data};
decompress(#ssh{decompress = zlib, decompress_ctx = Context} = Ssh, Data) ->
Decompressed = zlib:inflate(Context, Data),
- %%?dbg(?DBG_ZLIB, "inflate: ~p -> ~p ~n", [Data, Decompressed]),
{Ssh, list_to_binary(Decompressed)}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1039,7 +984,6 @@ hash(SSH, Char, N, HASH) ->
K1 = HASH([K, H, Char, SessionID]),
Sz = N div 8,
<<Key:Sz/binary, _/binary>> = hash(K, H, K1, N-128, HASH),
- %%?dbg(?DBG_KEX, "Key ~s: ~s ~n", [Char, fmt_binary(Key, 16, 4)]),
Key.
hash(_K, _H, Ki, N, _HASH) when N =< 0 ->
@@ -1055,6 +999,7 @@ kex_h(SSH, K_S, E, F, K) ->
[string,string,binary,binary,binary,
mpint,mpint,mpint]),
crypto:sha(L).
+
kex_h(SSH, K_S, Min, NBits, Max, Prime, Gen, E, F, K) ->
L = if Min==-1; Max==-1 ->
@@ -1075,7 +1020,7 @@ kex_h(SSH, K_S, Min, NBits, Max, Prime, Gen, E, F, K) ->
Prime, Gen, E,F,K], Ts)
end,
crypto:sha(L).
-
+
mac_key_size('hmac-sha1') -> 20*8;
mac_key_size('hmac-sha1-96') -> 20*8;
mac_key_size('hmac-md5') -> 16*8;
@@ -1105,9 +1050,6 @@ dh_gen_key(G, P, _Bits) ->
Public = ssh_math:ipow(G, Private, P),
{Private,Public}.
-%% trim(Str) ->
-%% lists:reverse(trim_head(lists:reverse(trim_head(Str)))).
-
trim_tail(Str) ->
lists:reverse(trim_head(lists:reverse(Str))).
@@ -1116,48 +1058,3 @@ trim_head([$\t|Cs]) -> trim_head(Cs);
trim_head([$\n|Cs]) -> trim_head(Cs);
trim_head([$\r|Cs]) -> trim_head(Cs);
trim_head(Cs) -> Cs.
-
-%% Retrieve session_id from ssh, needed by public-key auth
-%get_session_id(SSH) ->
-% {ok, SessionID} = call(SSH, get_session_id),
-
-%% DEBUG utils
-%% Format integers and binaries as hex blocks
-%%
-%% -ifdef(debug).
-%% fmt_binary(B, BlockSize, GroupSize) ->
-%% fmt_block(fmt_bin(B), BlockSize, GroupSize).
-
-%% fmt_block(Bin, BlockSize, GroupSize) ->
-%% fmt_block(Bin, BlockSize, 0, GroupSize).
-
-
-%% fmt_block(Bin, 0, _I, _G) ->
-%% binary_to_list(Bin);
-%% fmt_block(Bin, Sz, G, G) when G =/= 0 ->
-%% ["~n#" | fmt_block(Bin, Sz, 0, G)];
-%% fmt_block(Bin, Sz, I, G) ->
-%% case Bin of
-%% <<Block:Sz/binary, Tail/binary>> ->
-%% if Tail == <<>> ->
-%% [binary_to_list(Block)];
-%% true ->
-%% [binary_to_list(Block), " " | fmt_block(Tail, Sz, I+1, G)]
-%% end;
-%% <<>> ->
-%% [];
-%% _ ->
-%% [binary_to_list(Bin)]
-%% end.
-
-%% %% Format integer or binary as hex
-%% fmt_bin(X) when integer(X) ->
-%% list_to_binary(io_lib:format("~p", [X]));
-%% fmt_bin(X) when binary(X) ->
-%% Sz = size(X)*8,
-%% <<Y:Sz/unsigned-big>> = X,
-%% %%Fmt = "~"++integer_to_list(size(X)*2)++"~p",
-%% list_to_binary(io_lib:format("~p", [Y])).
-
-%% -endif.
-
diff --git a/lib/ssh/src/ssh_xfer.erl b/lib/ssh/src/ssh_xfer.erl
index c9631a73b1..d5b6dd03d1 100644
--- a/lib/ssh/src/ssh_xfer.erl
+++ b/lib/ssh/src/ssh_xfer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -298,8 +298,6 @@ xf_send_names(#ssh_xfer{cm = CM, channel = Channel, vsn = Vsn},
Size = 1 + 4 + 4 + Len,
ToSend = [<<?UINT32(Size), ?SSH_FXP_NAME, ?UINT32(ReqId), ?UINT32(Count)>>,
Data],
- %%?dbg(true, "xf_send_names: Size=~p size(ToSend)=~p\n",
- %% [Size, size(list_to_binary(ToSend))]),
ssh_connection:send(CM, Channel, ToSend).
xf_send_status(XF, ReqId, ErrorCode) ->
@@ -353,7 +351,6 @@ xf_reply(_XF, <<?SSH_FXP_DATA, ?UINT32(ReqID),
{data, ReqID, Data};
xf_reply(XF, <<?SSH_FXP_NAME, ?UINT32(ReqID),
?UINT32(Count), AData/binary>>) ->
- %%?dbg(true, "xf_reply ?SSH_FXP_NAME: AData=~p\n", [AData]),
{name, ReqID, decode_names(XF#ssh_xfer.vsn, Count, AData)};
xf_reply(XF, <<?SSH_FXP_ATTRS, ?UINT32(ReqID),
AData/binary>>) ->
@@ -579,7 +576,6 @@ encode_attr_flags(Vsn, Flags) ->
end, Flags).
encode_file_type(Type) ->
- %%?dbg(true, "encode_file_type(~p)\n", [Type]),
case Type of
regular -> ?SSH_FILEXFER_TYPE_REGULAR;
directory -> ?SSH_FILEXFER_TYPE_DIRECTORY;
@@ -660,15 +656,12 @@ encode_ATTR(Vsn, A) ->
{extended, A#ssh_xfer_attr.extensions}],
0, []),
Type = encode_file_type(A#ssh_xfer_attr.type),
- %%?dbg(true, "encode_ATTR: Vsn=~p A=~p As=~p Flags=~p Type=~p",
- %% [Vsn, A, As, Flags, Type]),
Result = list_to_binary([?uint32(Flags),
if Vsn >= 5 ->
?byte(Type);
true ->
(<<>>)
end, As]),
- %% ?dbg(true, " Result=~p\n", [Result]),
Result.
@@ -722,7 +715,6 @@ encode_As(_Vsn, [], Flags, Acc) ->
decode_ATTR(Vsn, <<?UINT32(Flags), Tail/binary>>) ->
- %%?dbg(true, "decode_ATTR: Vsn=~p Flags=~p Tail=~p\n", [Vsn, Flags, Tail]),
{Type,Tail2} =
if Vsn =< 3 ->
{?SSH_FILEXFER_TYPE_UNKNOWN, Tail};
@@ -751,7 +743,6 @@ decode_ATTR(Vsn, <<?UINT32(Flags), Tail/binary>>) ->
Tail2).
decode_As(Vsn, [{AName, AField}|As], R, Flags, Tail) ->
- %%?dbg(false, "decode_As: Vsn=~p AName=~p AField=~p Flags=~p Tail=~p\n", [Vsn, AName, AField, Flags, Tail]),
case AName of
size when ?is_set(?SSH_FILEXFER_ATTR_SIZE, Flags) ->
<<?UINT64(X), Tail2/binary>> = Tail,
@@ -762,7 +753,6 @@ decode_As(Vsn, [{AName, AField}|As], R, Flags, Tail) ->
ownergroup when ?is_set(?SSH_FILEXFER_ATTR_OWNERGROUP, Flags),Vsn>=5 ->
<<?UINT32(Len), Bin:Len/binary, Tail2/binary>> = Tail,
X = binary_to_list(Bin),
- %%?dbg(true, "ownergroup X=~p\n", [X]),
decode_As(Vsn, As, setelement(AField, R, X), Flags, Tail2);
permissions when ?is_set(?SSH_FILEXFER_ATTR_PERMISSIONS,Flags),Vsn>=5->
@@ -824,13 +814,11 @@ decode_names(Vsn, I, <<?UINT32(Len), FileName:Len/binary,
?UINT32(LLen), _LongName:LLen/binary,
Tail/binary>>) when Vsn =< 3 ->
Name = binary_to_list(FileName),
- %%?dbg(true, "decode_names: ~p\n", [Name]),
{A, Tail2} = decode_ATTR(Vsn, Tail),
[{Name, A} | decode_names(Vsn, I-1, Tail2)];
decode_names(Vsn, I, <<?UINT32(Len), FileName:Len/binary,
Tail/binary>>) when Vsn >= 4 ->
Name = binary_to_list(FileName),
- %%?dbg(true, "decode_names: ~p\n", [Name]),
{A, Tail2} = decode_ATTR(Vsn, Tail),
[{Name, A} | decode_names(Vsn, I-1, Tail2)].
@@ -839,8 +827,6 @@ encode_names(Vsn, NamesAndAttrs) ->
encode_name(Vsn, {Name,Attr}, Len) when Vsn =< 3 ->
NLen = length(Name),
- %%?dbg(true, "encode_name: Vsn=~p Name=~p Attr=~p\n",
- %% [Vsn, Name, Attr]),
EncAttr = encode_ATTR(Vsn, Attr),
ALen = size(EncAttr),
NewLen = Len + NLen*2 + 4 + 4 + ALen,
diff --git a/lib/ssh/src/sshc_sup.erl b/lib/ssh/src/sshc_sup.erl
index 7c29c669e4..1d2779de23 100644
--- a/lib/ssh/src/sshc_sup.erl
+++ b/lib/ssh/src/sshc_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -26,7 +26,7 @@
-behaviour(supervisor).
--export([start_link/1, start_child/1]).
+-export([start_link/1, start_child/1, stop_child/1]).
%% Supervisor callback
-export([init/1]).
@@ -40,12 +40,19 @@ start_link(Args) ->
start_child(Args) ->
supervisor:start_child(?MODULE, Args).
+stop_child(Client) ->
+ spawn(fun() ->
+ ClientSup = whereis(?MODULE),
+ supervisor:terminate_child(ClientSup, Client)
+ end),
+ ok.
+
%%%=========================================================================
%%% Supervisor callback
%%%=========================================================================
init(Args) ->
RestartStrategy = simple_one_for_one,
- MaxR = 10,
+ MaxR = 0,
MaxT = 3600,
{ok, {{RestartStrategy, MaxR, MaxT}, [child_spec(Args)]}}.
@@ -54,12 +61,9 @@ init(Args) ->
%%%=========================================================================
child_spec(_) ->
Name = undefined, % As simple_one_for_one is used.
- StartFunc = {ssh_connection_controler, start_link, []},
- Restart = temporary,
-% Shutdown = infinity,
- Shutdown = 5000,
- Modules = [ssh_connection_controler],
-% Type = supervisor,
- Type = worker,
+ StartFunc = {ssh_connection_sup, start_link, []},
+ Restart = temporary,
+ Shutdown = infinity,
+ Modules = [ssh_connection_sup],
+ Type = supervisor,
{Name, StartFunc, Restart, Shutdown, Type, Modules}.
-
diff --git a/lib/ssh/test/Makefile b/lib/ssh/test/Makefile
index 1820924ed6..25072688ad 100644
--- a/lib/ssh/test/Makefile
+++ b/lib/ssh/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -32,7 +32,6 @@ VSN=$(GS_VSN)
MODULES= \
ssh_test_lib \
- ssh_SUITE \
ssh_basic_SUITE \
ssh_to_openssh_SUITE \
ssh_sftp_SUITE \
@@ -111,11 +110,11 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) ssh.spec ssh.cover $(RELSYSDIR)
- $(INSTALL_DATA) $(HRL_FILES_NEEDED_IN_TEST) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) ssh.spec ssh.cover "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(HRL_FILES_NEEDED_IN_TEST) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/ssh/test/ssh.spec.vxworks b/lib/ssh/test/ssh.spec.vxworks
deleted file mode 100644
index 81f665283c..0000000000
--- a/lib/ssh/test/ssh.spec.vxworks
+++ /dev/null
@@ -1,3 +0,0 @@
-{topcase, {dir, "../ssh_test"}}.
-{require_nodenames, 1}.
-%{skip, {M, F, "Not yet implemented"}}.
diff --git a/lib/ssh/test/ssh_SUITE.erl b/lib/ssh/test/ssh_SUITE.erl
deleted file mode 100644
index 953c9080f9..0000000000
--- a/lib/ssh/test/ssh_SUITE.erl
+++ /dev/null
@@ -1,72 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-%%
-%%%----------------------------------------------------------------
-%%% Purpose:ssh application test suite.
-%%%-----------------------------------------------------------------
--module(ssh_SUITE).
--include_lib("common_test/include/ct.hrl").
--include("test_server_line.hrl").
-
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
--define(application, ssh).
-
-% Test server specific exports
--export([all/0,groups/0,init_per_group/2,end_per_group/2]).
--export([init_per_testcase/2, end_per_testcase/2]).
-
-% Test cases must be exported.
--export([app_test/1]).
--define(cases, [app_test]).
-
-%%
-%% all/1
-%%
-all() ->
- [app_test].
-
-groups() ->
- [].
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-
-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.
-%
-% Test cases starts here.
-%
-app_test(suite) ->
- [];
-app_test(doc) ->
- ["Application consistency test."];
-app_test(Config) when is_list(Config) ->
- ?t:app_test(?application),
- ok.
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl
index 73b60057cc..c224e5b800 100644
--- a/lib/ssh/test/ssh_basic_SUITE.erl
+++ b/lib/ssh/test/ssh_basic_SUITE.erl
@@ -41,20 +41,6 @@
init_per_suite(Config) ->
case catch crypto:start() of
ok ->
- DataDir = ?config(data_dir, Config),
- UserDir = ?config(priv_dir, Config),
- ssh_test_lib:copyfile(DataDir, UserDir, "id_rsa"),
- ssh_test_lib:copyfile(DataDir, UserDir, "id_dsa"),
- RSAFile = filename:join(DataDir, "id_rsa.pub"),
- DSAFile = filename:join(DataDir, "id_dsa.pub"),
- {ok, Ssh1} = file:read_file(RSAFile),
- {ok, Ssh2} = file:read_file(DSAFile),
- [{RSA, _}] = public_key:ssh_decode(Ssh1,public_key),
- [{DSA, _}] = public_key:ssh_decode(Ssh2,public_key),
- AuthKeys = public_key:ssh_encode([{RSA, [{comment, "Test"}]},
- {DSA,[{comment, "Test"}]}], auth_keys),
- AuthKeysFile = filename:join(UserDir, "authorized_keys"),
- file:write_file(AuthKeysFile, AuthKeys),
Config;
_Else ->
{skip, "Crypto could not be started!"}
@@ -66,7 +52,8 @@ init_per_suite(Config) ->
%% A list of key/value pairs, holding the test case configuration.
%% Description: Cleanup after the whole suite
%%--------------------------------------------------------------------
-end_per_suite(Config) ->
+end_per_suite(_Config) ->
+ ssh:stop(),
crypto:stop(),
ok.
@@ -99,11 +86,11 @@ init_per_testcase(_TestCase, Config) ->
end_per_testcase(TestCase, Config) when TestCase == server_password_option;
TestCase == server_userpassword_option ->
UserDir = filename:join(?config(priv_dir, Config), nopubkey),
- file:del_dir(UserDir),
+ ssh_test_lib:del_dirs(UserDir),
end_per_testcase(Config);
end_per_testcase(_TestCase, Config) ->
end_per_testcase(Config).
-end_per_testcase(Config) ->
+end_per_testcase(_Config) ->
ssh:stop(),
ok.
@@ -116,31 +103,110 @@ end_per_testcase(Config) ->
%% Description: Returns a list of all test cases in this test suite
%%--------------------------------------------------------------------
all() ->
- [exec, exec_compressed, shell, daemon_already_started,
- server_password_option, server_userpassword_option, known_hosts].
+ [app_test,
+ {group, dsa_key},
+ {group, rsa_key},
+ {group, dsa_pass_key},
+ {group, rsa_pass_key},
+ {group, internal_error},
+ daemon_already_started,
+ server_password_option,
+ server_userpassword_option,
+ close].
groups() ->
- [].
-
-init_per_group(_GroupName, Config) ->
- Config.
+ [{dsa_key, [], [send, exec, exec_compressed, shell, known_hosts]},
+ {rsa_key, [], [send, exec, exec_compressed, shell, known_hosts]},
+ {dsa_pass_key, [], [pass_phrase]},
+ {rsa_pass_key, [], [pass_phrase]},
+ {internal_error, [], [internal_error]}
+ ].
+
+init_per_group(dsa_key, Config) ->
+ DataDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
+ ssh_test_lib:setup_dsa(DataDir, PrivDir),
+ Config;
+init_per_group(rsa_key, Config) ->
+ DataDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
+ ssh_test_lib:setup_rsa(DataDir, PrivDir),
+ Config;
+init_per_group(rsa_pass_key, Config) ->
+ DataDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
+ ssh_test_lib:setup_rsa_pass_pharse(DataDir, PrivDir, "Password"),
+ [{pass_phrase, {rsa_pass_phrase, "Password"}}| Config];
+init_per_group(dsa_pass_key, Config) ->
+ DataDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
+ ssh_test_lib:setup_dsa_pass_pharse(DataDir, PrivDir, "Password"),
+ [{pass_phrase, {dsa_pass_phrase, "Password"}}| Config];
+init_per_group(internal_error, Config) ->
+ DataDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
+ ssh_test_lib:setup_dsa(DataDir, PrivDir),
+ file:delete(filename:join(PrivDir, "system/ssh_host_dsa_key")),
+ Config;
+init_per_group(_, Config) ->
+ Config.
-end_per_group(_GroupName, Config) ->
- Config.
+end_per_group(dsa_key, Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ ssh_test_lib:clean_dsa(PrivDir),
+ Config;
+end_per_group(rsa_key, Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ ssh_test_lib:clean_rsa(PrivDir),
+ Config;
+end_per_group(dsa_pass_key, Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ ssh_test_lib:clean_dsa(PrivDir),
+ Config;
+end_per_group(rsa_pass_key, Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ ssh_test_lib:clean_rsa(PrivDir),
+ Config;
+end_per_group(internal_error, Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ ssh_test_lib:clean_dsa(PrivDir),
+ Config;
+
+end_per_group(_, Config) ->
+ Config.
%% Test cases starts here.
%%--------------------------------------------------------------------
-sign_and_verify_rsa(doc) ->
- ["Test api function ssh:sign_data and ssh:verify_data"];
-
-sign_and_verify_rsa(suite) ->
+app_test(suite) ->
[];
-sign_and_verify_rsa(Config) when is_list(Config) ->
- Data = ssh:sign_data(<<"correct data">>, "ssh-rsa"),
- ok = ssh:verify_data(<<"correct data">>, Data, "ssh-rsa"),
- {error,invalid_signature} = ssh:verify_data(<<"incorrect data">>, Data,"ssh-rsa").
+app_test(doc) ->
+ ["Application consistency test."];
+app_test(Config) when is_list(Config) ->
+ ?t:app_test(ssh),
+ ok.
+%%--------------------------------------------------------------------
+misc_ssh_options(doc) ->
+ ["Test that we can set some misc options not tested elsewhere, "
+ "some options not yet present are not decided if we should support or "
+ "if they need thier own test case."];
+misc_ssh_options(suite) ->
+ [];
+misc_ssh_options(Config) when is_list(Config) ->
+ SystemDir = filename:join(?config(priv_dir, Config), system),
+ UserDir = ?config(priv_dir, Config),
+
+ CMiscOpt0 = [{connecect_timeout, 1000}, {ip_v6_disabled, false}, {user_dir, UserDir}],
+ CMiscOpt1 = [{connecect_timeout, infinity}, {ip_v6_disabled, true}, {user_dir, UserDir}],
+ SMiscOpt0 = [{ip_v6_disabled, false}, {user_dir, UserDir}, {system_dir, SystemDir}],
+ SMiscOpt1 = [{ip_v6_disabled, true}, {user_dir, UserDir}, {system_dir, SystemDir}],
+
+ ClientOpts = ?config(client_opts, Config),
+ ServerOpts = ?config(server_opts, Config),
+ basic_test([{client_opts, CMiscOpt0 ++ ClientOpts}, {server_opts, SMiscOpt0 ++ ServerOpts}]),
+ basic_test([{client_opts, CMiscOpt1 ++ ClientOpts}, {server_opts, SMiscOpt1 ++ ServerOpts}]).
+%%--------------------------------------------------------------------
exec(doc) ->
["Test api function ssh_connection:exec"];
@@ -149,7 +215,7 @@ exec(suite) ->
exec(Config) when is_list(Config) ->
process_flag(trap_exit, true),
- SystemDir = ?config(data_dir, Config),
+ SystemDir = filename:join(?config(priv_dir, Config), system),
UserDir = ?config(priv_dir, Config),
{Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},
@@ -195,8 +261,8 @@ exec_compressed(suite) ->
exec_compressed(Config) when is_list(Config) ->
process_flag(trap_exit, true),
- SystemDir = ?config(data_dir, Config),
- UserDir = ?config(priv_dir, Config),
+ SystemDir = filename:join(?config(priv_dir, Config), system),
+ UserDir = ?config(priv_dir, Config),
{Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},{user_dir, UserDir},
{compression, zlib},
@@ -229,9 +295,9 @@ shell(suite) ->
shell(Config) when is_list(Config) ->
process_flag(trap_exit, true),
- SystemDir = ?config(data_dir, Config),
+ SystemDir = filename:join(?config(priv_dir, Config), system),
UserDir = ?config(priv_dir, Config),
-
+
{_Pid, _Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},{user_dir, UserDir},
{failfun, fun ssh_test_lib:failfun/2}]),
test_server:sleep(500),
@@ -239,9 +305,14 @@ shell(Config) when is_list(Config) ->
IO = ssh_test_lib:start_io_server(),
Shell = ssh_test_lib:start_shell(Port, IO, UserDir),
receive
+ {'EXIT', _, _} ->
+ test_server:fail(no_ssh_connection);
ErlShellStart ->
- test_server:format("Erlang shell start: ~p~n", [ErlShellStart])
- end,
+ test_server:format("Erlang shell start: ~p~n", [ErlShellStart]),
+ do_shell(IO, Shell)
+ end.
+
+do_shell(IO, Shell) ->
receive
ErlPrompt0 ->
test_server:format("Erlang prompt: ~p~n", [ErlPrompt0])
@@ -301,9 +372,13 @@ daemon_already_started(suite) ->
daemon_already_started(Config) when is_list(Config) ->
SystemDir = ?config(data_dir, Config),
+ UserDir = ?config(priv_dir, Config),
+
{Pid, _Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},
+ {user_dir, UserDir},
{failfun, fun ssh_test_lib:failfun/2}]),
{error, eaddrinuse} = ssh_test_lib:daemon(Port, [{system_dir, SystemDir},
+ {user_dir, UserDir},
{failfun,
fun ssh_test_lib:failfun/2}]),
ssh:stop_daemon(Pid).
@@ -314,10 +389,12 @@ server_password_option(doc) ->
server_password_option(suite) ->
[];
server_password_option(Config) when is_list(Config) ->
- UserDir = filename:join(?config(priv_dir, Config), nopubkey), % to make sure we don't use public-key-auth
+ PrivDir = ?config(priv_dir, Config),
+ UserDir = filename:join(PrivDir, nopubkey), % to make sure we don't use public-key-auth
file:make_dir(UserDir),
- SysDir = ?config(data_dir, Config),
+ SysDir = ?config(data_dir, Config),
{Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SysDir},
+ {user_dir, UserDir},
{password, "morot"}]),
ConnectionRef =
@@ -326,12 +403,15 @@ server_password_option(Config) when is_list(Config) ->
{password, "morot"},
{user_interaction, false},
{user_dir, UserDir}]),
+
+ Reason = "Unable to connect using the available authentication methods",
+
{error, Reason} =
- ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true},
- {user, "vego"},
- {password, "foo"},
- {user_interaction, false},
- {user_dir, UserDir}]),
+ ssh:connect(Host, Port, [{silently_accept_hosts, true},
+ {user, "vego"},
+ {password, "foo"},
+ {user_interaction, false},
+ {user_dir, UserDir}]),
test_server:format("Test of wrong password: Error msg: ~p ~n", [Reason]),
@@ -345,10 +425,12 @@ server_userpassword_option(doc) ->
server_userpassword_option(suite) ->
[];
server_userpassword_option(Config) when is_list(Config) ->
- UserDir = filename:join(?config(priv_dir, Config), nopubkey), % to make sure we don't use public-key-auth
+ PrivDir = ?config(priv_dir, Config),
+ UserDir = filename:join(PrivDir, nopubkey), % to make sure we don't use public-key-auth
file:make_dir(UserDir),
SysDir = ?config(data_dir, Config),
{Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SysDir},
+ {user_dir, PrivDir},
{user_passwords, [{"vego", "morot"}]}]),
ConnectionRef =
@@ -359,25 +441,20 @@ server_userpassword_option(Config) when is_list(Config) ->
{user_dir, UserDir}]),
ssh:close(ConnectionRef),
- {error, Reason0} =
- ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true},
- {user, "foo"},
- {password, "morot"},
- {user_interaction, false},
- {user_dir, UserDir}]),
-
- test_server:format("Test of user foo that does not exist. "
- "Error msg: ~p ~n", [Reason0]),
+ Reason = "Unable to connect using the available authentication methods",
- {error, Reason1} =
- ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true},
- {user, "vego"},
- {password, "foo"},
- {user_interaction, false},
- {user_dir, UserDir}]),
- test_server:format("Test of wrong Password. "
- "Error msg: ~p ~n", [Reason1]),
-
+ {error, Reason} =
+ ssh:connect(Host, Port, [{silently_accept_hosts, true},
+ {user, "foo"},
+ {password, "morot"},
+ {user_interaction, false},
+ {user_dir, UserDir}]),
+ {error, Reason} =
+ ssh:connect(Host, Port, [{silently_accept_hosts, true},
+ {user, "vego"},
+ {password, "foo"},
+ {user_interaction, false},
+ {user_dir, UserDir}]),
ssh:stop_daemon(Pid).
%%--------------------------------------------------------------------
@@ -386,17 +463,17 @@ known_hosts(doc) ->
known_hosts(suite) ->
[];
known_hosts(Config) when is_list(Config) ->
- DataDir = ?config(data_dir, Config),
- UserDir = ?config(priv_dir, Config),
+ SystemDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
- {Pid, Host, Port} = ssh_test_lib:daemon([{user_dir, UserDir},{system_dir, DataDir},
+ {Pid, Host, Port} = ssh_test_lib:daemon([{user_dir, PrivDir},{system_dir, SystemDir},
{failfun, fun ssh_test_lib:failfun/2}]),
- KnownHosts = filename:join(UserDir, "known_hosts"),
+ KnownHosts = filename:join(PrivDir, "known_hosts"),
file:delete(KnownHosts),
{error, enoent} = file:read_file(KnownHosts),
ConnectionRef =
- ssh_test_lib:connect(Host, Port, [{user_dir, UserDir},
+ ssh_test_lib:connect(Host, Port, [{user_dir, PrivDir},
{user_interaction, false},
silently_accept_hosts]),
{ok, _Channel} = ssh_connection:session_channel(ConnectionRef, infinity),
@@ -407,8 +484,116 @@ known_hosts(Config) when is_list(Config) ->
[HostAndIp, Alg, _KeyData] = string:tokens(Line, " "),
[Host, _Ip] = string:tokens(HostAndIp, ","),
"ssh-" ++ _ = Alg,
- ssh:stop_daemon(Pid).
+ ssh:stop_daemon(Pid).
+%%--------------------------------------------------------------------
+
+pass_phrase(doc) ->
+ ["Test that we can use keyes protected by pass phrases"];
+
+pass_phrase(suite) ->
+ [];
+
+pass_phrase(Config) when is_list(Config) ->
+ process_flag(trap_exit, true),
+ SystemDir = filename:join(?config(priv_dir, Config), system),
+ UserDir = ?config(priv_dir, Config),
+ PhraseArg = ?config(pass_phrase, Config),
+
+ {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},
+ {user_dir, UserDir},
+ {failfun, fun ssh_test_lib:failfun/2}]),
+ ConnectionRef =
+ ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true},
+ PhraseArg,
+ {user_dir, UserDir},
+ {user_interaction, false}]),
+ {ok, _ChannelId} = ssh_connection:session_channel(ConnectionRef, infinity),
+ ssh:stop_daemon(Pid).
+
+%%--------------------------------------------------------------------
+
+internal_error(doc) ->
+ ["Test that client does not hang if disconnects due to internal error"];
+
+internal_error(suite) ->
+ [];
+
+internal_error(Config) when is_list(Config) ->
+ process_flag(trap_exit, true),
+ SystemDir = filename:join(?config(priv_dir, Config), system),
+ UserDir = ?config(priv_dir, Config),
+
+ {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},
+ {user_dir, UserDir},
+ {failfun, fun ssh_test_lib:failfun/2}]),
+ {error,"Internal error"} =
+ ssh:connect(Host, Port, [{silently_accept_hosts, true},
+ {user_dir, UserDir},
+ {user_interaction, false}]),
+ ssh:stop_daemon(Pid).
+
+%%--------------------------------------------------------------------
+send(doc) ->
+ ["Test ssh_connection:send/3"];
+
+send(suite) ->
+ [];
+
+send(Config) when is_list(Config) ->
+ process_flag(trap_exit, true),
+ SystemDir = filename:join(?config(priv_dir, Config), system),
+ UserDir = ?config(priv_dir, Config),
+
+ {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},
+ {user_dir, UserDir},
+ {failfun, fun ssh_test_lib:failfun/2}]),
+ ConnectionRef =
+ ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true},
+ {user_dir, UserDir},
+ {user_interaction, false}]),
+ {ok, ChannelId} = ssh_connection:session_channel(ConnectionRef, infinity),
+ ok = ssh_connection:send(ConnectionRef, ChannelId, <<"Data">>),
+ ok = ssh_connection:send(ConnectionRef, ChannelId, << >>),
+ ssh:stop_daemon(Pid).
+
+
+%%--------------------------------------------------------------------
+close(doc) ->
+ ["Simulate that we try to close an already closed connection"];
+
+close(suite) ->
+ [];
+
+close(Config) when is_list(Config) ->
+ SystemDir = ?config(data_dir, 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),
+
+ {_Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},
+ {user_dir, UserDir},
+ {user_passwords, [{"vego", "morot"}]},
+ {failfun, fun ssh_test_lib:failfun/2}]),
+ {ok, CM} = ssh:connect(Host, Port, [{silently_accept_hosts, true},
+ {user_dir, UserDir},
+ {user, "vego"},
+ {password, "morot"},
+ {user_interaction, false}]),
+
+ exit(CM, {shutdown, normal}),
+ ok = ssh:close(CM).
+
+
%%--------------------------------------------------------------------
%% Internal functions
%%--------------------------------------------------------------------
+
+basic_test(Config) ->
+ ClientOpts = ?config(client_opts, Config),
+ ServerOpts = ?config(server_opts, Config),
+
+ {Pid, Host, Port} = ssh_test_lib:daemon(ServerOpts),
+ {ok, CM} = ssh:connect(Host, Port, ClientOpts),
+ ok = ssh:close(CM),
+ ssh:stop_daemon(Pid).
diff --git a/lib/ssh/test/ssh_basic_SUITE_data/id_dsa.pub b/lib/ssh/test/ssh_basic_SUITE_data/id_dsa.pub
deleted file mode 100644
index 9406116777..0000000000
--- a/lib/ssh/test/ssh_basic_SUITE_data/id_dsa.pub
+++ /dev/null
@@ -1 +0,0 @@
-ssh-dss AAAAB3NzaC1kc3MAAACBAN+LZ+VJNlmh/BPjJBPQ2KRf8sY1PtQ94H9cRZ7/Gi8RgISV9pAA8WLFe8SBfCiiOZnmSJBErMszf3AE/SM8REtudld844PQ8OfDSFoyHt0PtcpUyh38SKBWAd/+oF0zYzzLPWz+tEXufVSktLKnOIqOTMKbsmhJDbNtYg92YEhfAAAAFQDID5Ka+0qtzu7B3W/A+tNQ0Y6BMQAAAIAw5DEN8HYV3yi7Pob3p/9Q7NEwj8p2/yRhgpYkgZj6lFiss/JjNR4nOfBmt44mCtzMBf6W4ecoVYnYOeTkLJ5eTrtayvukn/gwEwM4p4hLRLyqhIE3z4qunv1+AD7JLch+puQku0u7gQFoJfiYpAhfj76Tjh3hTmVzym372GUQjwAAAIEAznKxx9kyC6bVo7LUYKaGhofRFt0SYFc5PVmT2VUGRs1R6+6DPD+euEO6IhFct7JFSRbP9p0JD4Uk+3zlZF+XX6b2PsZkeV8f/02xlNGUSmEzCSiNg1AXCy/WusYhul0MncWCHMcOZB5rIvU/aP5EJJtn3xrRaz6u0SThF6AnT34= Dsa
diff --git a/lib/ssh/test/ssh_basic_SUITE_data/id_rsa b/lib/ssh/test/ssh_basic_SUITE_data/id_rsa
index 79968bdd7d..9d7e0dd5fb 100644
--- a/lib/ssh/test/ssh_basic_SUITE_data/id_rsa
+++ b/lib/ssh/test/ssh_basic_SUITE_data/id_rsa
@@ -1,16 +1,15 @@
-----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
+MIICXAIBAAKBgQD1OET+3O/Bvj/dtjxDTXmj1oiJt4sIph5kGy0RfjoPrZfaS+CU
+DhakCmS6t2ivxWFgtpKWaoGMZMJqWj6F6ZsumyFl3FPBtujwY/35cgifrI9Ns4Tl
+zR1uuengNBmV+WRQ5cd9F2qS6Z8aDQihzt0r8JUqLcK+VQbrmNzboCCQQwIDAQAB
+AoGAPQEyqPTt8JUT7mRXuaacjFXiweAXhp9NEDpyi9eLOjtFe9lElZCrsUOkq47V
+TGUeRKEm9qSodfTbKPoqc8YaBJGJPhUaTAcha+7QcDdfHBvIsgxvU7ePVnlpXRp3
+CCUEMPhlnx6xBoTYP+fRU0e3+xJIPVyVCqX1jAdUMkzfRoECQQD6ux7B1QJAIWyK
+SGkbDUbBilNmzCFNgIpOP6PA+bwfi5d16diTpra5AX09keQABAo/KaP1PdV8Vg0p
+z4P3A7G3AkEA+l+AKG6m0kQTTBMJDqOdVPYwe+5GxunMaqmhokpEbuGsrZBl5Dvd
+WpcBjR7jmenrhKZRIuA+Fz5HPo/UQJPl1QJBAKxstDkeED8j/S2XoFhPKAJ+6t39
+sUVICVTIZQeXdmzHJXCcUSkw8+WEhakqw/3SyW0oaK2FSWQJFWJUZ+8eJj8CQEh3
+xeduB5kKnS9CvzdeghZqX6QvVosSdtlUmfUYW/BgH5PpHKTP8wTaeld3XldZTpMJ
+dKiMkUw2+XYROVUrubUCQD+Na1LhULlpn4ISEtIEfqpdlUhxDgO15Wg8USmsng+x
+ICliVOSQtwaZjm8kwaFt0W7XnpnDxbRs37vIEbIMWak=
-----END RSA PRIVATE KEY-----
-
diff --git a/lib/ssh/test/ssh_basic_SUITE_data/id_rsa.pub b/lib/ssh/test/ssh_basic_SUITE_data/id_rsa.pub
deleted file mode 100644
index 95bce6bc61..0000000000
--- a/lib/ssh/test/ssh_basic_SUITE_data/id_rsa.pub
+++ /dev/null
@@ -1 +0,0 @@
-ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDCZX+4FBDwZIh9y/Uxee1VJnEXlowpz2yDKwj8semM4q843337zbNfxHmladB1lpz2NqyxI175xMIJuDxogyZdsOxGnFAzAnthR4dqL/RWRWzjaxSB6IAO9SPYVVlrpZ+1hsjLW79fwXK/yc8VdhRuWTeQiRgYY2ek8+OKbOqz4Q== ingela@dain
diff --git a/lib/ssh/test/ssh_basic_SUITE_data/ssh_host_dsa_key b/lib/ssh/test/ssh_basic_SUITE_data/ssh_host_dsa_key
index d306f8b26e..51ab6fbd88 100644
--- a/lib/ssh/test/ssh_basic_SUITE_data/ssh_host_dsa_key
+++ b/lib/ssh/test/ssh_basic_SUITE_data/ssh_host_dsa_key
@@ -1,13 +1,13 @@
-----BEGIN DSA PRIVATE KEY-----
-MIIBvAIBAAKBgQDfi2flSTZZofwT4yQT0NikX/LGNT7UPeB/XEWe/xovEYCElfaQ
-APFixXvEgXwoojmZ5kiQRKzLM39wBP0jPERLbnZXfOOD0PDnw0haMh7dD7XKVMod
-/EigVgHf/qBdM2M8yz1s/rRF7n1UpLSypziKjkzCm7JoSQ2zbWIPdmBIXwIVAMgP
-kpr7Sq3O7sHdb8D601DRjoExAoGAMOQxDfB2Fd8ouz6G96f/UOzRMI/Kdv8kYYKW
-JIGY+pRYrLPyYzUeJznwZreOJgrczAX+luHnKFWJ2Dnk5CyeXk67Wsr7pJ/4MBMD
-OKeIS0S8qoSBN8+Krp79fgA+yS3IfqbkJLtLu4EBaCX4mKQIX4++k44d4U5lc8pt
-+9hlEI8CgYEAznKxx9kyC6bVo7LUYKaGhofRFt0SYFc5PVmT2VUGRs1R6+6DPD+e
-uEO6IhFct7JFSRbP9p0JD4Uk+3zlZF+XX6b2PsZkeV8f/02xlNGUSmEzCSiNg1AX
-Cy/WusYhul0MncWCHMcOZB5rIvU/aP5EJJtn3xrRaz6u0SThF6AnT34CFQC63czE
-ZU8w8Q+H7z0j+a+70x2iAw==
+MIIBuwIBAAKBgQCClaHzE2ul0gKSUxah5W0W8UiJLy4hXngKEqpaUq9SSdVdY2LK
+wVfKH1gt5iuaf1FfzOhsIC9G/GLnjYttXZc92cv/Gfe3gR+s0ni2++MX+T++mE/Q
+diltXv/Hp27PybS67SmiFW7I+RWnT2OKlMPtw2oUuKeztCe5UWjaj/y5FQIVAPLA
+l9RpiU30Z87NRAHY3NTRaqtrAoGANMRxw8UfdtNVR0CrQj3AgPaXOGE4d+G4Gp4X
+skvnCHycSVAjtYxebUkzUzt5Q6f/IabuLUdge3gXrc8BetvrcKbp+XZgM0/Vj2CF
+Ymmy3in6kzGZq7Fw1sZaku6AOU8vLa5woBT2vAcHLLT1bLAzj7viL048T6MfjrOP
+ef8nHvACgYBhDWFQJ1mf99sg92LalVq1dHLmVXb3PTJDfCO/Gz5NFmj9EZbAtdah
+/XcF3DeRF+eEoz48wQF/ExVxSMIhLdL+o+ElpVhlM7Yii+T7dPhkQfEul6zZXu+U
+ykSTXYUbtsfTNRFQGBW2/GfnEc0mnIxfn9v10NEWMzlq5z9wT9P0CgIVAN4wtL5W
+Lv62jKcdskxNyz2NQoBx
-----END DSA PRIVATE KEY-----
diff --git a/lib/ssh/test/ssh_basic_SUITE_data/ssh_host_dsa_key.pub b/lib/ssh/test/ssh_basic_SUITE_data/ssh_host_dsa_key.pub
new file mode 100644
index 0000000000..4dbb1305b0
--- /dev/null
+++ b/lib/ssh/test/ssh_basic_SUITE_data/ssh_host_dsa_key.pub
@@ -0,0 +1,11 @@
+---- BEGIN SSH2 PUBLIC KEY ----
+AAAAB3NzaC1kc3MAAACBAIKVofMTa6XSApJTFqHlbRbxSIkvLiFeeAoSqlpSr1JJ1V1j
+YsrBV8ofWC3mK5p/UV/M6GwgL0b8YueNi21dlz3Zy/8Z97eBH6zSeLb74xf5P76YT9B2
+KW1e/8enbs/JtLrtKaIVbsj5FadPY4qUw+3DahS4p7O0J7lRaNqP/LkVAAAAFQDywJfU
+aYlN9GfOzUQB2NzU0WqrawAAAIA0xHHDxR9201VHQKtCPcCA9pc4YTh34bganheyS+cI
+fJxJUCO1jF5tSTNTO3lDp/8hpu4tR2B7eBetzwF62+twpun5dmAzT9WPYIViabLeKfqT
+MZmrsXDWxlqS7oA5Ty8trnCgFPa8BwcstPVssDOPu+IvTjxPox+Os495/yce8AAAAIBh
+DWFQJ1mf99sg92LalVq1dHLmVXb3PTJDfCO/Gz5NFmj9EZbAtdah/XcF3DeRF+eEoz48
+wQF/ExVxSMIhLdL+o+ElpVhlM7Yii+T7dPhkQfEul6zZXu+UykSTXYUbtsfTNRFQGBW2
+/GfnEc0mnIxfn9v10NEWMzlq5z9wT9P0Cg==
+---- END SSH2 PUBLIC KEY ----
diff --git a/lib/ssh/test/ssh_basic_SUITE_data/ssh_host_rsa_key.pub b/lib/ssh/test/ssh_basic_SUITE_data/ssh_host_rsa_key.pub
new file mode 100644
index 0000000000..75d2025c71
--- /dev/null
+++ b/lib/ssh/test/ssh_basic_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_sftp_SUITE.erl b/lib/ssh/test/ssh_sftp_SUITE.erl
index a9a568ced6..d40b1d544d 100644
--- a/lib/ssh/test/ssh_sftp_SUITE.erl
+++ b/lib/ssh/test/ssh_sftp_SUITE.erl
@@ -24,14 +24,12 @@
-compile(export_all).
-include_lib("common_test/include/ct.hrl").
--include("test_server_line.hrl").
-include_lib("kernel/include/file.hrl").
% Default timetrap timeout
-define(default_timeout, ?t:minutes(1)).
--define(SFPD_PORT, 9999).
-define(USER, "Alladin").
-define(PASSWD, "Sesame").
@@ -46,17 +44,12 @@
%% variable, but should NOT alter/remove any existing entries.
%%--------------------------------------------------------------------
init_per_suite(Config) ->
- case {catch crypto:start(),catch ssh:start()} of
- {ok,ok} ->
- Dir = ?config(priv_dir, Config),
- {ok, _} = ssh_test_lib:get_id_keys(Dir),
+ case (catch crypto:start()) of
+ ok ->
+ ssh:start(),
Config;
- {ok,_} ->
- {skip,"Could not start ssh!"};
- {_,ok} ->
- {skip,"Could not start crypto!"};
- {_,_} ->
- {skip,"Could not start crypto and ssh!"}
+ _ ->
+ {skip,"Could not start crypto!"}
end.
%%--------------------------------------------------------------------
@@ -66,9 +59,8 @@ init_per_suite(Config) ->
%% Description: Cleanup after the whole suite
%%--------------------------------------------------------------------
end_per_suite(Config) ->
+ ssh:stop(),
crypto:stop(),
- Dir = ?config(priv_dir, Config),
- ssh_test_lib:remove_id_keys(Dir),
Config.
%%--------------------------------------------------------------------
@@ -84,40 +76,34 @@ end_per_suite(Config) ->
%% variable, but should NOT alter/remove any existing entries.
%% Description: Initiation before each test case
%%--------------------------------------------------------------------
-init_per_testcase(_Case, Config) ->
+init_per_testcase(Case, Config) ->
prep(Config),
TmpConfig0 = lists:keydelete(watchdog, 1, Config),
TmpConfig = lists:keydelete(sftp, 1, TmpConfig0),
Dog = test_server:timetrap(?default_timeout),
- Dir = ?config(priv_dir, Config),
- SysDir = ?config(data_dir, Config),
- Host = ssh_test_lib:hostname(),
- %% Run test against openssh server if available
- Sftp = case (catch ssh_sftp:start_channel(Host,
- [{user_dir, Dir},
- {user_interaction, false},
- {silently_accept_hosts, true}])) of
- {ok, ChannelPid, Connection} ->
- {ChannelPid, Connection};
- _Error -> %% Start own sftp server
- {_Sftpd, _Host, _Port} =
- ssh_test_lib:daemon(Host, ?SFPD_PORT,
- [{system_dir, SysDir},
- {user_passwords,
- [{?USER, ?PASSWD}]},
- {failfun,
- fun ssh_test_lib:failfun/2}]),
- Result = (catch ssh_sftp:start_channel(Host, ?SFPD_PORT,
- [{user, ?USER},
- {password, ?PASSWD},
- {user_interaction, false},
- {silently_accept_hosts, true}])),
- {ok, ChannelPid, Connection} = Result,
- {ChannelPid, Connection}
- end,
-
- [{sftp, Sftp}, {watchdog, Dog} | TmpConfig].
+ case ?config(group, Config) of
+ erlang_server ->
+ {_,Host, Port} = ?config(sftpd, Config),
+ {ok, ChannelPid, Connection} =
+ ssh_sftp:start_channel(Host, Port,
+ [{user, ?USER},
+ {password, ?PASSWD},
+ {user_interaction, false},
+ {silently_accept_hosts, true}]),
+ Sftp = {ChannelPid, Connection},
+ [{sftp, Sftp}, {watchdog, Dog} | TmpConfig];
+ openssh_server when Case == links ->
+ {skip, "known bug in openssh"};
+ openssh_server ->
+ Host = ssh_test_lib:hostname(),
+ {ok, ChannelPid, Connection} =
+ ssh_sftp:start_channel(Host,
+ [{user_interaction, false},
+ {silently_accept_hosts, true}]),
+ Sftp = {ChannelPid, Connection},
+ [{sftp, Sftp}, {watchdog, Dog} | TmpConfig]
+ end.
%%--------------------------------------------------------------------
%% Function: end_per_testcase(TestCase, Config) -> _
@@ -127,7 +113,15 @@ init_per_testcase(_Case, Config) ->
%% A list of key/value pairs, holding the test case configuration.
%% Description: Cleanup after each test case
%%--------------------------------------------------------------------
-end_per_testcase(_Case, Config) ->
+end_per_testcase(rename_file, Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ NewFileName = filename:join(PrivDir, "test.txt"),
+ file:delete(NewFileName),
+ end_per_testcase(Config);
+end_per_testcase(_, Config) ->
+ end_per_testcase(Config).
+
+end_per_testcase(Config) ->
{Sftp, Connection} = ?config(sftp, Config),
ssh_sftp:stop_channel(Sftp),
ssh:close(Connection),
@@ -144,19 +138,47 @@ end_per_testcase(_Case, Config) ->
%% Description: Returns a list of all test cases in this test suite
%%--------------------------------------------------------------------
all() ->
- [open_close_file, open_close_dir, read_file, read_dir,
- write_file, rename_file, mk_rm_dir, remove_file, links,
- retrieve_attributes, set_attributes, async_read,
- async_write, position, pos_read, pos_write].
+ [{group, erlang_server},
+ {group, openssh_server}].
groups() ->
- [].
-
-init_per_group(_GroupName, Config) ->
- Config.
+ [{erlang_server, [], [open_close_file, open_close_dir, read_file, read_dir,
+ write_file, rename_file, mk_rm_dir, remove_file, links,
+ retrieve_attributes, set_attributes, async_read,
+ async_write, position, pos_read, pos_write]},
+ {openssh_server, [], [open_close_file, open_close_dir, read_file, read_dir,
+ write_file, rename_file, mk_rm_dir, remove_file, links,
+ retrieve_attributes, set_attributes, async_read,
+ async_write, position, pos_read, pos_write]}].
+
+init_per_group(erlang_server, Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ SysDir = ?config(data_dir, Config),
+ Sftpd =
+ ssh_test_lib:daemon([{system_dir, SysDir},
+ {user_dir, PrivDir},
+ {user_passwords,
+ [{?USER, ?PASSWD}]},
+ {failfun,
+ fun ssh_test_lib:failfun/2}]),
+ [{group, erlang_server}, {sftpd, Sftpd} | Config];
+
+init_per_group(openssh_server, Config) ->
+ Host = ssh_test_lib:hostname(),
+ case (catch ssh_sftp:start_channel(Host,
+ [{user_interaction, false},
+ {silently_accept_hosts, true}])) of
+ {ok, _ChannelPid, Connection} ->
+ ssh:close(Connection),
+ [{group, openssh_server} | Config];
+ _ ->
+ {skip, "No openssh server"}
+ end.
-end_per_group(_GroupName, Config) ->
- Config.
+end_per_group(erlang_server, Config) ->
+ Config;
+end_per_group(_, Config) ->
+ Config.
%% Test cases starts here.
@@ -338,7 +360,7 @@ links(Config) when is_list(Config) ->
FileName = filename:join(PrivDir, "sftp.txt"),
LinkFileName = filename:join(PrivDir, "link_test.txt"),
- ok = ssh_sftp:make_symlink(Sftp, FileName, LinkFileName),
+ ok = ssh_sftp:make_symlink(Sftp, LinkFileName, FileName),
{ok, FileName} = ssh_sftp:read_link(Sftp, LinkFileName),
ok
end.
diff --git a/lib/ssh/test/ssh_sftp_SUITE_data/ssh_host_dsa_key b/lib/ssh/test/ssh_sftp_SUITE_data/ssh_host_dsa_key
new file mode 100644
index 0000000000..51ab6fbd88
--- /dev/null
+++ b/lib/ssh/test/ssh_sftp_SUITE_data/ssh_host_dsa_key
@@ -0,0 +1,13 @@
+-----BEGIN DSA PRIVATE KEY-----
+MIIBuwIBAAKBgQCClaHzE2ul0gKSUxah5W0W8UiJLy4hXngKEqpaUq9SSdVdY2LK
+wVfKH1gt5iuaf1FfzOhsIC9G/GLnjYttXZc92cv/Gfe3gR+s0ni2++MX+T++mE/Q
+diltXv/Hp27PybS67SmiFW7I+RWnT2OKlMPtw2oUuKeztCe5UWjaj/y5FQIVAPLA
+l9RpiU30Z87NRAHY3NTRaqtrAoGANMRxw8UfdtNVR0CrQj3AgPaXOGE4d+G4Gp4X
+skvnCHycSVAjtYxebUkzUzt5Q6f/IabuLUdge3gXrc8BetvrcKbp+XZgM0/Vj2CF
+Ymmy3in6kzGZq7Fw1sZaku6AOU8vLa5woBT2vAcHLLT1bLAzj7viL048T6MfjrOP
+ef8nHvACgYBhDWFQJ1mf99sg92LalVq1dHLmVXb3PTJDfCO/Gz5NFmj9EZbAtdah
+/XcF3DeRF+eEoz48wQF/ExVxSMIhLdL+o+ElpVhlM7Yii+T7dPhkQfEul6zZXu+U
+ykSTXYUbtsfTNRFQGBW2/GfnEc0mnIxfn9v10NEWMzlq5z9wT9P0CgIVAN4wtL5W
+Lv62jKcdskxNyz2NQoBx
+-----END DSA PRIVATE KEY-----
+
diff --git a/lib/ssh/test/ssh_sftp_SUITE_data/ssh_host_dsa_key.pub b/lib/ssh/test/ssh_sftp_SUITE_data/ssh_host_dsa_key.pub
new file mode 100644
index 0000000000..4dbb1305b0
--- /dev/null
+++ b/lib/ssh/test/ssh_sftp_SUITE_data/ssh_host_dsa_key.pub
@@ -0,0 +1,11 @@
+---- BEGIN SSH2 PUBLIC KEY ----
+AAAAB3NzaC1kc3MAAACBAIKVofMTa6XSApJTFqHlbRbxSIkvLiFeeAoSqlpSr1JJ1V1j
+YsrBV8ofWC3mK5p/UV/M6GwgL0b8YueNi21dlz3Zy/8Z97eBH6zSeLb74xf5P76YT9B2
+KW1e/8enbs/JtLrtKaIVbsj5FadPY4qUw+3DahS4p7O0J7lRaNqP/LkVAAAAFQDywJfU
+aYlN9GfOzUQB2NzU0WqrawAAAIA0xHHDxR9201VHQKtCPcCA9pc4YTh34bganheyS+cI
+fJxJUCO1jF5tSTNTO3lDp/8hpu4tR2B7eBetzwF62+twpun5dmAzT9WPYIViabLeKfqT
+MZmrsXDWxlqS7oA5Ty8trnCgFPa8BwcstPVssDOPu+IvTjxPox+Os495/yce8AAAAIBh
+DWFQJ1mf99sg92LalVq1dHLmVXb3PTJDfCO/Gz5NFmj9EZbAtdah/XcF3DeRF+eEoz48
+wQF/ExVxSMIhLdL+o+ElpVhlM7Yii+T7dPhkQfEul6zZXu+UykSTXYUbtsfTNRFQGBW2
+/GfnEc0mnIxfn9v10NEWMzlq5z9wT9P0Cg==
+---- END SSH2 PUBLIC KEY ----
diff --git a/lib/ssh/test/ssh_sftpd_SUITE.erl b/lib/ssh/test/ssh_sftpd_SUITE.erl
index 0873348be0..695a7caa7d 100644
--- a/lib/ssh/test/ssh_sftpd_SUITE.erl
+++ b/lib/ssh/test/ssh_sftpd_SUITE.erl
@@ -30,7 +30,6 @@
-include_lib("kernel/include/file.hrl").
--define(SFPD_PORT, 9999).
-define(USER, "Alladin").
-define(PASSWD, "Sesame").
-define(XFER_PACKET_SIZE, 32768).
@@ -55,13 +54,16 @@
init_per_suite(Config) ->
case (catch crypto:start()) of
ok ->
- ssh:start(),
- DataDir = ?config(data_dir, Config),
- UserDir = ?config(priv_dir, Config),
- ssh_test_lib:setup_dsa(UserDir, DataDir),
+ DataDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
+ ssh_test_lib:setup_dsa(DataDir, PrivDir),
+ %% to make sure we don't use public-key-auth
+ %% this should be tested by other test suites
+ UserDir = filename:join(?config(priv_dir, Config), nopubkey),
+ file:make_dir(UserDir),
Config;
_ ->
- {skip,"Could not start ssh!"}
+ {skip,"Could not start crypto!"}
end.
%%--------------------------------------------------------------------
@@ -71,8 +73,10 @@ init_per_suite(Config) ->
%% Description: Cleanup after the whole suite
%%--------------------------------------------------------------------
end_per_suite(Config) ->
- UserDir = ?config(priv_dir, Config),
- ssh_test_lib:clean_dsa(UserDir),
+ SysDir = ?config(priv_dir, Config),
+ ssh_test_lib:clean_dsa(SysDir),
+ UserDir = filename:join(?config(priv_dir, Config), nopubkey),
+ file:del_dir(UserDir),
ssh:stop(),
crypto:stop(),
ok.
@@ -93,15 +97,20 @@ end_per_suite(Config) ->
init_per_testcase(TestCase, Config) ->
ssh:start(),
prep(Config),
- SysDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
+ ClientUserDir = filename:join(PrivDir, nopubkey),
+ SystemDir = filename:join(?config(priv_dir, Config), system),
+
+ Port = ssh_test_lib:inet_port(node()),
+
{ok, Sftpd} =
- ssh_sftpd:listen(?SFPD_PORT, [{system_dir, SysDir},
+ ssh_sftpd:listen(Port, [{system_dir, SystemDir},
+ {user_dir, PrivDir},
{user_passwords,[{?USER, ?PASSWD}]},
{pwdfun, fun(_,_) -> true end}]),
- Cm = ssh_test_lib:connect(?SFPD_PORT,
- [{system_dir, SysDir},
- {user_dir, SysDir},
+ Cm = ssh_test_lib:connect(Port,
+ [{user_dir, ClientUserDir},
{user, ?USER}, {password, ?PASSWD},
{user_interaction, false},
{silently_accept_hosts, true},
@@ -536,56 +545,60 @@ set_attributes(doc) ->
set_attributes(suite) ->
[];
set_attributes(Config) when is_list(Config) ->
- PrivDir = ?config(priv_dir, Config),
- FileName = filename:join(PrivDir, "test.txt"),
- ReqId = 0,
- {Cm, Channel} = ?config(sftp, Config),
+ case test_server:os_type() of
+ {win32, _} ->
+ {skip, "Known error bug in erts file:read_file_info"};
+ _ ->
+ PrivDir = ?config(priv_dir, Config),
+ FileName = filename:join(PrivDir, "test.txt"),
+ ReqId = 0,
+ {Cm, Channel} = ?config(sftp, Config),
- {ok, FileInfo} = file:read_file_info(FileName),
+ {ok, FileInfo} = file:read_file_info(FileName),
- OrigPermissions = FileInfo#file_info.mode,
- Permissions = 8#400, %% User read-only
+ OrigPermissions = FileInfo#file_info.mode,
+ Permissions = not_default_permissions(),
- Flags = ?SSH_FILEXFER_ATTR_PERMISSIONS,
+ Flags = ?SSH_FILEXFER_ATTR_PERMISSIONS,
- Atters = [?uint32(Flags), ?byte(?SSH_FILEXFER_TYPE_REGULAR),
- ?uint32(Permissions)],
+ Atters = [?uint32(Flags), ?byte(?SSH_FILEXFER_TYPE_REGULAR),
+ ?uint32(Permissions)],
- {ok, <<?SSH_FXP_STATUS, ?UINT32(ReqId),
- ?UINT32(?SSH_FX_OK), _/binary>>, _} =
- set_attributes_file(FileName, Atters, Cm, Channel, ReqId),
-
- {ok, NewFileInfo} = file:read_file_info(FileName),
- NewPermissions = NewFileInfo#file_info.mode,
-
- %% Can not test that NewPermissions = Permissions as
- %% on Unix platforms, other bits than those listed in the
- %% API may be set.
- test_server:format("Org: ~p New: ~p~n", [OrigPermissions, NewPermissions]),
- true = OrigPermissions =/= NewPermissions,
-
- test_server:format("Try to open the file"),
- NewReqId = 2,
- {ok, <<?SSH_FXP_HANDLE, ?UINT32(NewReqId), Handle/binary>>, _} =
- open_file(FileName, Cm, Channel, NewReqId,
- ?ACE4_READ_DATA bor ?ACE4_WRITE_ATTRIBUTES,
- ?SSH_FXF_OPEN_EXISTING),
+ {ok, <<?SSH_FXP_STATUS, ?UINT32(ReqId),
+ ?UINT32(?SSH_FX_OK), _/binary>>, _} =
+ set_attributes_file(FileName, Atters, Cm, Channel, ReqId),
- NewAtters = [?uint32(Flags), ?byte(?SSH_FILEXFER_TYPE_REGULAR),
- ?uint32(OrigPermissions)],
+ {ok, NewFileInfo} = file:read_file_info(FileName),
+ NewPermissions = NewFileInfo#file_info.mode,
- NewReqId1 = 3,
+ %% Can not test that NewPermissions = Permissions as
+ %% on Unix platforms, other bits than those listed in the
+ %% API may be set.
+ test_server:format("Org: ~p New: ~p~n", [OrigPermissions, NewPermissions]),
+ true = OrigPermissions =/= NewPermissions,
- test_server:format("Set original permissions on the now open file"),
+ test_server:format("Try to open the file"),
+ NewReqId = 2,
+ {ok, <<?SSH_FXP_HANDLE, ?UINT32(NewReqId), Handle/binary>>, _} =
+ open_file(FileName, Cm, Channel, NewReqId,
+ ?ACE4_READ_DATA bor ?ACE4_WRITE_ATTRIBUTES,
+ ?SSH_FXF_OPEN_EXISTING),
- {ok, <<?SSH_FXP_STATUS, ?UINT32(NewReqId1),
- ?UINT32(?SSH_FX_OK), _/binary>>, _} =
- set_attributes_open_file(Handle, NewAtters, Cm, Channel, NewReqId1),
+ NewAtters = [?uint32(Flags), ?byte(?SSH_FILEXFER_TYPE_REGULAR),
+ ?uint32(OrigPermissions)],
- {ok, NewFileInfo1} = file:read_file_info(FileName),
- OrigPermissions = NewFileInfo1#file_info.mode,
+ NewReqId1 = 3,
- ok.
+ test_server:format("Set original permissions on the now open file"),
+
+ {ok, <<?SSH_FXP_STATUS, ?UINT32(NewReqId1),
+ ?UINT32(?SSH_FX_OK), _/binary>>, _} =
+ set_attributes_open_file(Handle, NewAtters, Cm, Channel, NewReqId1),
+
+ {ok, NewFileInfo1} = file:read_file_info(FileName),
+ OrigPermissions = NewFileInfo1#file_info.mode,
+ ok
+ end.
%%--------------------------------------------------------------------
ver3_rename_OTP_6352(doc) ->
@@ -934,3 +947,6 @@ sshd_read_file(Config) when is_list(Config) ->
{ok, Data} = file:read_file(FileName),
ok.
+
+not_default_permissions() ->
+ 8#600. %% User read-write-only
diff --git a/lib/ssh/test/ssh_sftpd_SUITE_data/id_dsa b/lib/ssh/test/ssh_sftpd_SUITE_data/id_dsa
new file mode 100644
index 0000000000..d306f8b26e
--- /dev/null
+++ b/lib/ssh/test/ssh_sftpd_SUITE_data/id_dsa
@@ -0,0 +1,13 @@
+-----BEGIN DSA PRIVATE KEY-----
+MIIBvAIBAAKBgQDfi2flSTZZofwT4yQT0NikX/LGNT7UPeB/XEWe/xovEYCElfaQ
+APFixXvEgXwoojmZ5kiQRKzLM39wBP0jPERLbnZXfOOD0PDnw0haMh7dD7XKVMod
+/EigVgHf/qBdM2M8yz1s/rRF7n1UpLSypziKjkzCm7JoSQ2zbWIPdmBIXwIVAMgP
+kpr7Sq3O7sHdb8D601DRjoExAoGAMOQxDfB2Fd8ouz6G96f/UOzRMI/Kdv8kYYKW
+JIGY+pRYrLPyYzUeJznwZreOJgrczAX+luHnKFWJ2Dnk5CyeXk67Wsr7pJ/4MBMD
+OKeIS0S8qoSBN8+Krp79fgA+yS3IfqbkJLtLu4EBaCX4mKQIX4++k44d4U5lc8pt
++9hlEI8CgYEAznKxx9kyC6bVo7LUYKaGhofRFt0SYFc5PVmT2VUGRs1R6+6DPD+e
+uEO6IhFct7JFSRbP9p0JD4Uk+3zlZF+XX6b2PsZkeV8f/02xlNGUSmEzCSiNg1AX
+Cy/WusYhul0MncWCHMcOZB5rIvU/aP5EJJtn3xrRaz6u0SThF6AnT34CFQC63czE
+ZU8w8Q+H7z0j+a+70x2iAw==
+-----END DSA PRIVATE KEY-----
+
diff --git a/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl b/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
index c63ad7de73..4c469ed5f7 100644
--- a/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
+++ b/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
@@ -28,7 +28,6 @@
-include_lib("kernel/include/file.hrl").
--define(SSHD_PORT, 9999).
-define(USER, "Alladin").
-define(PASSWD, "Sesame").
-define(SSH_MAX_PACKET_SIZE, 32768).
@@ -48,14 +47,14 @@ init_per_suite(Config) ->
case catch crypto:start() of
ok ->
DataDir = ?config(data_dir, Config),
- UserDir = ?config(priv_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
FileAlt = filename:join(DataDir, "ssh_sftpd_file_alt.erl"),
c:c(FileAlt),
FileName = filename:join(DataDir, "test.txt"),
{ok, FileInfo} = file:read_file_info(FileName),
ok = file:write_file_info(FileName,
FileInfo#file_info{mode = 8#400}),
- ssh_test_lib:setup_dsa(DataDir, UserDir),
+ ssh_test_lib:setup_dsa(DataDir, PrivDir),
Config;
_Else ->
{skip,"Could not start ssh!"}
@@ -67,9 +66,11 @@ init_per_suite(Config) ->
%% A list of key/value pairs, holding the test case configuration.
%% Description: Cleanup after the whole suite
%%--------------------------------------------------------------------
-end_per_suite(Config) ->
- UserDir = ?config(priv_dir, Config),
- ssh_test_lib:clean_dsa(UserDir),
+end_per_suite(Config) ->
+ UserDir = filename:join(?config(priv_dir, Config), nopubkey),
+ file:del_dir(UserDir),
+ SysDir = ?config(priv_dir, Config),
+ ssh_test_lib:clean_dsa(SysDir),
crypto:stop(),
ok.
@@ -89,6 +90,7 @@ end_per_suite(Config) ->
init_per_testcase(TestCase, Config) ->
ssh:start(),
PrivDir = ?config(priv_dir, Config),
+ SystemDir = filename:join(PrivDir, system),
Options =
case atom_to_list(TestCase) of
@@ -96,45 +98,39 @@ init_per_testcase(TestCase, Config) ->
Spec =
ssh_sftpd:subsystem_spec([{file_handler,
ssh_sftpd_file_alt}]),
- [{user_passwords,[{?USER, ?PASSWD}]},
- {pwdfun, fun(_,_) -> true end},
- {system_dir, PrivDir},
+ [{system_dir, SystemDir},
+ {user_dir, PrivDir},
{subsystems, [Spec]}];
"root_dir" ->
Privdir = ?config(priv_dir, Config),
Root = filename:join(Privdir, root),
file:make_dir(Root),
Spec = ssh_sftpd:subsystem_spec([{root,Root}]),
- [{user_passwords,[{?USER, ?PASSWD}]},
- {pwdfun, fun(_,_) -> true end},
- {system_dir, PrivDir},
+ [{system_dir, SystemDir},
+ {user_dir, PrivDir},
{subsystems, [Spec]}];
"list_dir_limited" ->
Spec =
ssh_sftpd:subsystem_spec([{max_files,1}]),
- [{user_passwords,[{?USER, ?PASSWD}]},
- {pwdfun, fun(_,_) -> true end},
- {system_dir, PrivDir},
+ [{system_dir, SystemDir},
+ {user_dir, PrivDir},
{subsystems, [Spec]}];
_ ->
- [{user_passwords,[{?USER, ?PASSWD}]},
- {pwdfun, fun(_,_) -> true end},
- {system_dir, PrivDir}]
+ [{user_dir, PrivDir},
+ {system_dir, SystemDir}]
end,
- {Sftpd, Host, _Port} = ssh_test_lib:daemon(any, ?SSHD_PORT, Options),
+ {Sftpd, Host, Port} = ssh_test_lib:daemon(Options),
{ok, ChannelPid, Connection} =
- ssh_sftp:start_channel(Host, ?SSHD_PORT,
+ ssh_sftp:start_channel(Host, Port,
[{silently_accept_hosts, true},
- {user, ?USER}, {password, ?PASSWD},
- {pwdfun, fun(_,_) -> true end},
{user_dir, PrivDir},
{timeout, 30000}]),
TmpConfig = lists:keydelete(sftp, 1, Config),
NewConfig = lists:keydelete(sftpd, 1, TmpConfig),
- [{sftp, {ChannelPid, Connection}}, {sftpd, Sftpd} | NewConfig].
+ [{port, Port}, {sftp, {ChannelPid, Connection}}, {sftpd, Sftpd} | NewConfig].
%%--------------------------------------------------------------------
%% Function: end_per_testcase(TestCase, Config) -> _
@@ -214,6 +210,8 @@ quit_OTP_6349(suite) ->
quit_OTP_6349(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
FileName = filename:join(DataDir, "test.txt"),
+ UserDir = ?config(priv_dir, Config),
+ Port = ?config(port, Config),
{Sftp, _} = ?config(sftp, Config),
@@ -224,11 +222,10 @@ quit_OTP_6349(Config) when is_list(Config) ->
Host = ssh_test_lib:hostname(),
timer:sleep(5000),
- {ok, NewSftp, _Conn} = ssh_sftp:start_channel(Host, ?SSHD_PORT,
+ {ok, NewSftp, _Conn} = ssh_sftp:start_channel(Host, Port,
[{silently_accept_hosts, true},
{pwdfun, fun(_,_) -> true end},
- {system_dir, DataDir},
- {user_dir, DataDir},
+ {user_dir, UserDir},
{user, ?USER}, {password, ?PASSWD}]),
{ok, <<_/binary>>} = ssh_sftp:read_file(NewSftp, FileName),
diff --git a/lib/ssh/test/ssh_sftpd_erlclient_SUITE_data/id_dsa b/lib/ssh/test/ssh_sftpd_erlclient_SUITE_data/id_dsa
new file mode 100644
index 0000000000..d306f8b26e
--- /dev/null
+++ b/lib/ssh/test/ssh_sftpd_erlclient_SUITE_data/id_dsa
@@ -0,0 +1,13 @@
+-----BEGIN DSA PRIVATE KEY-----
+MIIBvAIBAAKBgQDfi2flSTZZofwT4yQT0NikX/LGNT7UPeB/XEWe/xovEYCElfaQ
+APFixXvEgXwoojmZ5kiQRKzLM39wBP0jPERLbnZXfOOD0PDnw0haMh7dD7XKVMod
+/EigVgHf/qBdM2M8yz1s/rRF7n1UpLSypziKjkzCm7JoSQ2zbWIPdmBIXwIVAMgP
+kpr7Sq3O7sHdb8D601DRjoExAoGAMOQxDfB2Fd8ouz6G96f/UOzRMI/Kdv8kYYKW
+JIGY+pRYrLPyYzUeJznwZreOJgrczAX+luHnKFWJ2Dnk5CyeXk67Wsr7pJ/4MBMD
+OKeIS0S8qoSBN8+Krp79fgA+yS3IfqbkJLtLu4EBaCX4mKQIX4++k44d4U5lc8pt
++9hlEI8CgYEAznKxx9kyC6bVo7LUYKaGhofRFt0SYFc5PVmT2VUGRs1R6+6DPD+e
+uEO6IhFct7JFSRbP9p0JD4Uk+3zlZF+XX6b2PsZkeV8f/02xlNGUSmEzCSiNg1AX
+Cy/WusYhul0MncWCHMcOZB5rIvU/aP5EJJtn3xrRaz6u0SThF6AnT34CFQC63czE
+ZU8w8Q+H7z0j+a+70x2iAw==
+-----END DSA PRIVATE KEY-----
+
diff --git a/lib/ssh/test/ssh_test_lib.erl b/lib/ssh/test/ssh_test_lib.erl
index f4e95f9bfb..609663c87a 100644
--- a/lib/ssh/test/ssh_test_lib.erl
+++ b/lib/ssh/test/ssh_test_lib.erl
@@ -43,12 +43,8 @@ connect(Host, Options) ->
connect(any, Port, Options) ->
connect(hostname(), Port, Options);
connect(Host, Port, Options) ->
- case ssh:connect(Host, Port, Options) of
- {ok, ConnectionRef} ->
- ConnectionRef;
- Error ->
- Error
- end.
+ {ok, ConnectionRef} = ssh:connect(Host, Port, Options),
+ ConnectionRef.
daemon(Options) ->
daemon(any, inet_port(), Options).
@@ -71,6 +67,9 @@ daemon(Host, Port, Options) ->
start_shell(Port, IOServer, UserDir) ->
spawn_link(?MODULE, init_shell, [Port, IOServer, [{user_dir, UserDir}]]).
+start_shell(Port, IOServer) ->
+ spawn_link(?MODULE, init_shell, [Port, IOServer, []]).
+
init_shell(Port, IOServer, UserDir) ->
Host = hostname(),
Options = [{user_interaction, false}, {silently_accept_hosts,
@@ -91,13 +90,10 @@ init_io_server(TestCase) ->
loop_io_server(TestCase, Buff0) ->
receive
{input, TestCase, Line} ->
- %io:format("~p~n",[{input, TestCase, Line}]),
loop_io_server(TestCase, Buff0 ++ [Line]);
{io_request, From, ReplyAs, Request} ->
- %io:format("request -> ~p~n",[Request]),
{ok, Reply, Buff} = io_request(Request, TestCase, From,
ReplyAs, Buff0),
- %io:format("reply -> ~p~n",[Reply]),
io_reply(From, ReplyAs, Reply),
loop_io_server(TestCase, Buff);
{'EXIT',_, _} ->
@@ -183,34 +179,21 @@ inet_port()->
gen_tcp:close(Socket),
Port.
-
-%% copy private keys to given dir from ~/.ssh
-get_id_keys(DstDir) ->
- SrcDir = filename:join(os:getenv("HOME"), ".ssh"),
- RsaOk = copyfile(SrcDir, DstDir, "id_rsa"),
- DsaOk = copyfile(SrcDir, DstDir, "id_dsa"),
- case {RsaOk, DsaOk} of
- {{ok, _}, {ok, _}} -> {ok, both};
- {{ok, _}, _} -> {ok, rsa};
- {_, {ok, _}} -> {ok, dsa};
- {Error, _} -> Error
- end.
-
-remove_id_keys(Dir) ->
- file:delete(filename:join(Dir, "id_rsa")),
- file:delete(filename:join(Dir, "id_dsa")).
-
-copyfile(SrcDir, DstDir, FileName) ->
- Dest = filename:join(DstDir, FileName),
- Result = file:copy(filename:join(SrcDir, FileName), Dest),
- {ok, Pem} = file:read_file(Dest),
- case public_key:pem_decode(Pem) of
- [{_,_, not_encrypted}] ->
- Result;
+setup_ssh_auth_keys(RSAFile, DSAFile, Dir) ->
+ Entries = ssh_file_entry(RSAFile) ++ ssh_file_entry(DSAFile),
+ AuthKeys = public_key:ssh_encode(Entries , auth_keys),
+ AuthKeysFile = filename:join(Dir, "authorized_keys"),
+ file:write_file(AuthKeysFile, AuthKeys).
+
+ssh_file_entry(PubFile) ->
+ case file:read_file(PubFile) of
+ {ok, Ssh} ->
+ [{Key, _}] = public_key:ssh_decode(Ssh, public_key),
+ [{Key, [{comment, "Test"}]}];
_ ->
- {error, "Has pass phrase can not be used by automated test case"}
- end.
-
+ []
+ end.
+
failfun(_User, {authmethod,none}) ->
ok;
failfun(User, Reason) ->
@@ -232,25 +215,132 @@ known_hosts(BR) ->
end.
setup_dsa(DataDir, UserDir) ->
- ssh_test_lib:copyfile(DataDir, UserDir, "ssh_host_dsa_key"),
- ssh_test_lib:copyfile(DataDir, UserDir, "ssh_host_dsa_key.pub"),
- {ok, Pem} = file:read_file(filename:join(UserDir, "ssh_host_dsa_key")),
- DSA = public_key:pem_entry_decode(hd(public_key:pem_decode(Pem))),
- PKey = DSA#'DSAPrivateKey'.y,
- P = DSA#'DSAPrivateKey'.p,
- Q = DSA#'DSAPrivateKey'.q,
- G = DSA#'DSAPrivateKey'.g,
- Dss = #'Dss-Parms'{p=P, q=Q, g=G},
+ file:copy(filename:join(DataDir, "id_dsa"), filename:join(UserDir, "id_dsa")),
+ System = filename:join(UserDir, "system"),
+ file:make_dir(System),
+ file:copy(filename:join(DataDir, "ssh_host_dsa_key"), filename:join(System, "ssh_host_dsa_key")),
+ file:copy(filename:join(DataDir, "ssh_host_dsa_key.pub"), filename:join(System, "ssh_host_dsa_key.pub")),
+ setup_dsa_known_host(DataDir, UserDir),
+ setup_dsa_auth_keys(DataDir, UserDir).
+
+setup_rsa(DataDir, UserDir) ->
+ file:copy(filename:join(DataDir, "id_rsa"), filename:join(UserDir, "id_rsa")),
+ System = filename:join(UserDir, "system"),
+ file:make_dir(System),
+ file:copy(filename:join(DataDir, "ssh_host_rsa_key"), filename:join(System, "ssh_host_rsa_key")),
+ file:copy(filename:join(DataDir, "ssh_host_rsa_key"), filename:join(System, "ssh_host_rsa_key.pub")),
+ setup_rsa_known_host(DataDir, UserDir),
+ setup_rsa_auth_keys(DataDir, UserDir).
+
+clean_dsa(UserDir) ->
+ del_dirs(filename:join(UserDir, "system")),
+ file:delete(filename:join(UserDir,"id_dsa")),
+ file:delete(filename:join(UserDir,"known_hosts")),
+ file:delete(filename:join(UserDir,"authorized_keys")).
+
+clean_rsa(UserDir) ->
+ del_dirs(filename:join(UserDir, "system")),
+ file:delete(filename:join(UserDir,"id_rsa")),
+ file:delete(filename:join(UserDir,"known_hosts")),
+ file:delete(filename:join(UserDir,"authorized_keys")).
+
+setup_dsa_pass_pharse(DataDir, UserDir, Phrase) ->
+ {ok, KeyBin} = file:read_file(filename:join(DataDir, "id_dsa")),
+ setup_pass_pharse(KeyBin, filename:join(UserDir, "id_dsa"), Phrase),
+ System = filename:join(UserDir, "system"),
+ file:make_dir(System),
+ file:copy(filename:join(DataDir, "ssh_host_dsa_key"), filename:join(System, "ssh_host_dsa_key")),
+ file:copy(filename:join(DataDir, "ssh_host_dsa_key.pub"), filename:join(System, "ssh_host_dsa_key.pub")),
+ setup_dsa_known_host(DataDir, UserDir),
+ setup_dsa_auth_keys(DataDir, UserDir).
+
+setup_rsa_pass_pharse(DataDir, UserDir, Phrase) ->
+ {ok, KeyBin} = file:read_file(filename:join(DataDir, "id_rsa")),
+ setup_pass_pharse(KeyBin, filename:join(UserDir, "id_rsa"), Phrase),
+ System = filename:join(UserDir, "system"),
+ file:make_dir(System),
+ file:copy(filename:join(DataDir, "ssh_host_rsa_key"), filename:join(System, "ssh_host_rsa_key")),
+ file:copy(filename:join(DataDir, "ssh_host_rsa_key.pub"), filename:join(System, "ssh_host_rsa_key.pub")),
+ setup_rsa_known_host(DataDir, UserDir),
+ setup_rsa_auth_keys(DataDir, UserDir).
+
+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),
+ Entry = public_key:pem_entry_encode(KeyType, Key,
+ {{"DES-CBC", Salt}, Phrase}),
+ Pem = public_key:pem_encode([Entry]),
+ file:write_file(OutFile, Pem).
+
+setup_dsa_known_host(SystemDir, UserDir) ->
+ {ok, SshBin} = file:read_file(filename:join(SystemDir, "ssh_host_dsa_key.pub")),
+ [{Key, _}] = public_key:ssh_decode(SshBin, public_key),
+ setup_known_hosts(Key, UserDir).
+
+setup_rsa_known_host(SystemDir, UserDir) ->
+ {ok, SshBin} = file:read_file(filename:join(SystemDir, "ssh_host_rsa_key.pub")),
+ [{Key, _}] = public_key:ssh_decode(SshBin, public_key),
+ setup_known_hosts(Key, UserDir).
+
+setup_known_hosts(Key, UserDir) ->
{ok, Hostname} = inet:gethostname(),
{ok, {A, B, C, D}} = inet:getaddr(Hostname, inet),
IP = lists:concat([A, ".", B, ".", C, ".", D]),
- HostNames = [{hostnames,[IP, IP]}],
- KnownHosts = [{{PKey, Dss}, HostNames}],
+ HostNames = [{hostnames,[Hostname, IP]}],
+ KnownHosts = [{Key, HostNames}],
KnownHostsEnc = public_key:ssh_encode(KnownHosts, known_hosts),
KHFile = filename:join(UserDir, "known_hosts"),
file:write_file(KHFile, KnownHostsEnc).
-clean_dsa(UserDir) ->
- file:delete(filename:join(UserDir, "ssh_host_dsa_key")),
- file:delete(filename:join(UserDir, "ssh_host_dsa_key.pub")),
- file:delete(filename:join(UserDir, "known_hosts")).
+setup_dsa_auth_keys(Dir, UserDir) ->
+ {ok, Pem} = file:read_file(filename:join(Dir, "id_dsa")),
+ DSA = public_key:pem_entry_decode(hd(public_key:pem_decode(Pem))),
+ PKey = DSA#'DSAPrivateKey'.y,
+ P = DSA#'DSAPrivateKey'.p,
+ Q = DSA#'DSAPrivateKey'.q,
+ G = DSA#'DSAPrivateKey'.g,
+ Dss = #'Dss-Parms'{p=P, q=Q, g=G},
+ setup_auth_keys([{{PKey, Dss}, [{comment, "Test"}]}], UserDir).
+
+setup_rsa_auth_keys(Dir, UserDir) ->
+ {ok, Pem} = file:read_file(filename:join(Dir, "id_rsa")),
+ RSA = public_key:pem_entry_decode(hd(public_key:pem_decode(Pem))),
+ #'RSAPrivateKey'{publicExponent = E, modulus = N} = RSA,
+ PKey = #'RSAPublicKey'{publicExponent = E, modulus = N},
+ setup_auth_keys([{ PKey, [{comment, "Test"}]}], UserDir).
+
+setup_auth_keys(Keys, Dir) ->
+ AuthKeys = public_key:ssh_encode(Keys, auth_keys),
+ AuthKeysFile = filename:join(Dir, "authorized_keys"),
+ file:write_file(AuthKeysFile, AuthKeys).
+
+
+del_dirs(Dir) ->
+ case file:list_dir(Dir) of
+ {ok, []} ->
+ file:del_dir(Dir);
+ {ok, Files} ->
+ lists:foreach(fun(File) ->
+ FullPath = filename:join(Dir,File),
+ case filelib:is_dir(FullPath) of
+ true ->
+ del_dirs(FullPath),
+ file:del_dir(FullPath);
+ false ->
+ file:delete(FullPath)
+ end
+ end, Files);
+ _ ->
+ ok
+ end.
+
+inet_port(Node) ->
+ {Port, Socket} = do_inet_port(Node),
+ rpc:call(Node, gen_tcp, close, [Socket]),
+ Port.
+
+do_inet_port(Node) ->
+ {ok, Socket} = rpc:call(Node, gen_tcp, listen, [0, [{reuseaddr, true}]]),
+ {ok, Port} = rpc:call(Node, inet, port, [Socket]),
+ {Port, Socket}.
diff --git a/lib/ssh/test/ssh_to_openssh_SUITE.erl b/lib/ssh/test/ssh_to_openssh_SUITE.erl
index 53d04620c5..c337617ee4 100644
--- a/lib/ssh/test/ssh_to_openssh_SUITE.erl
+++ b/lib/ssh/test/ssh_to_openssh_SUITE.erl
@@ -119,18 +119,15 @@ groups() ->
erlang_client_openssh_server_password]},
{erlang_server, [], [erlang_server_openssh_client_exec,
erlang_server_openssh_client_exec_compressed,
- erlang_server_openssh_client_pulic_key_dsa,
- erlang_client_openssh_server_password]}
+ erlang_server_openssh_client_pulic_key_dsa]}
].
init_per_group(erlang_server, Config) ->
DataDir = ?config(data_dir, Config),
UserDir = ?config(priv_dir, Config),
- ssh_test_lib:setup_dsa(DataDir, UserDir),
+ ssh_test_lib:setup_dsa_known_host(DataDir, UserDir),
Config;
init_per_group(_, Config) ->
- Dir = ?config(priv_dir, Config),
- {ok, _} = ssh_test_lib:get_id_keys(Dir),
Config.
end_per_group(erlang_server, Config) ->
@@ -138,8 +135,6 @@ end_per_group(erlang_server, Config) ->
ssh_test_lib:clean_dsa(UserDir),
Config;
end_per_group(_, Config) ->
- Dir = ?config(priv_dir, Config),
- ssh_test_lib:remove_id_keys(Dir),
Config.
%% TEST cases starts here.
@@ -152,9 +147,8 @@ erlang_shell_client_openssh_server(suite) ->
erlang_shell_client_openssh_server(Config) when is_list(Config) ->
process_flag(trap_exit, true),
- UserDir = ?config(priv_dir, Config),
IO = ssh_test_lib:start_io_server(),
- Shell = ssh_test_lib:start_shell(?SSH_DEFAULT_PORT, IO, UserDir),
+ Shell = ssh_test_lib:start_shell(?SSH_DEFAULT_PORT, IO),
IO ! {input, self(), "echo Hej\n"},
receive_hej(),
IO ! {input, self(), "exit\n"},
@@ -250,8 +244,10 @@ erlang_server_openssh_client_exec(suite) ->
[];
erlang_server_openssh_client_exec(Config) when is_list(Config) ->
- SystemDir = ?config(priv_dir, Config),
-
+ 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},
{failfun, fun ssh_test_lib:failfun/2}]),
@@ -259,7 +255,10 @@ erlang_server_openssh_client_exec(Config) when is_list(Config) ->
test_server:sleep(500),
Cmd = "ssh -p " ++ integer_to_list(Port) ++
- " -o StrictHostKeyChecking=no "++ Host ++ " 1+1.",
+ " -o UserKnownHostsFile=" ++ KnownHosts ++ " " ++ Host ++ " 1+1.",
+
+ test_server:format("Cmd: ~p~n", [Cmd]),
+
SshPort = open_port({spawn, Cmd}, [binary]),
receive
@@ -279,7 +278,10 @@ erlang_server_openssh_client_exec_compressed(suite) ->
[];
erlang_server_openssh_client_exec_compressed(Config) when is_list(Config) ->
- SystemDir = ?config(priv_dir, Config),
+ 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},
{compression, zlib},
{failfun, fun ssh_test_lib:failfun/2}]),
@@ -287,7 +289,7 @@ erlang_server_openssh_client_exec_compressed(Config) when is_list(Config) ->
test_server:sleep(500),
Cmd = "ssh -p " ++ integer_to_list(Port) ++
- " -o StrictHostKeyChecking=no -C "++ Host ++ " 1+1.",
+ " -o UserKnownHostsFile=" ++ KnownHosts ++ " -C "++ Host ++ " 1+1.",
SshPort = open_port({spawn, Cmd}, [binary]),
receive
@@ -352,26 +354,27 @@ erlang_client_openssh_server_publickey_rsa(suite) ->
[];
erlang_client_openssh_server_publickey_rsa(Config) when is_list(Config) ->
{ok,[[Home]]} = init:get_argument(home),
- SrcDir = filename:join(Home, ".ssh"),
- UserDir = ?config(priv_dir, Config),
- case ssh_test_lib:copyfile(SrcDir, UserDir, "id_rsa") of
- {ok, _} ->
- ConnectionRef =
- ssh_test_lib:connect(?SSH_DEFAULT_PORT,
- [{user_dir, UserDir},
- {public_key_alg, ssh_rsa},
- {user_interaction, false},
- silently_accept_hosts]),
- {ok, Channel} =
- ssh_connection:session_channel(ConnectionRef, infinity),
- ok = ssh_connection:close(ConnectionRef, Channel),
- ok = ssh:close(ConnectionRef),
- ok = file:delete(filename:join(UserDir, "id_rsa"));
- {error, enoent} ->
- {skip, "no ~/.ssh/id_rsa"};
- {error, Reason} ->
- {skip, Reason}
+ KeyFile = filename:join(Home, ".ssh/id_rsa"),
+ case file:read_file(KeyFile) of
+ {ok, Pem} ->
+ case public_key:pem_decode(Pem) of
+ [{_,_, not_encrypted}] ->
+ ConnectionRef =
+ ssh_test_lib:connect(?SSH_DEFAULT_PORT,
+ [{public_key_alg, ssh_rsa},
+ {user_interaction, false},
+ silently_accept_hosts]),
+ {ok, Channel} =
+ ssh_connection:session_channel(ConnectionRef, infinity),
+ ok = ssh_connection:close(ConnectionRef, Channel),
+ ok = ssh:close(ConnectionRef);
+ _ ->
+ {skip, {error, "Has pass phrase can not be used by automated test case"}}
+ end;
+ _ ->
+ {skip, "no ~/.ssh/id_rsa"}
end.
+
%%--------------------------------------------------------------------
erlang_client_openssh_server_publickey_dsa(doc) ->
@@ -380,27 +383,26 @@ erlang_client_openssh_server_publickey_dsa(suite) ->
[];
erlang_client_openssh_server_publickey_dsa(Config) when is_list(Config) ->
{ok,[[Home]]} = init:get_argument(home),
- SrcDir = filename:join(Home, ".ssh"),
- UserDir = ?config(priv_dir, Config),
- case ssh_test_lib:copyfile(SrcDir, UserDir, "id_dsa") of
- {ok, _} ->
- ConnectionRef =
- ssh_test_lib:connect(?SSH_DEFAULT_PORT,
- [{user_dir, UserDir},
- {public_key_alg, ssh_dsa},
- {user_interaction, false},
- silently_accept_hosts]),
- {ok, Channel} =
- ssh_connection:session_channel(ConnectionRef, infinity),
- ok = ssh_connection:close(ConnectionRef, Channel),
- ok = ssh:close(ConnectionRef),
- ok = file:delete(filename:join(UserDir, "id_dsa"));
- {error, enoent} ->
- {skip, "no ~/.ssh/id_dsa"};
- {error, Reason} ->
- {skip, Reason}
+ KeyFile = filename:join(Home, ".ssh/id_dsa"),
+ case file:read_file(KeyFile) of
+ {ok, Pem} ->
+ case public_key:pem_decode(Pem) of
+ [{_,_, not_encrypted}] ->
+ ConnectionRef =
+ ssh_test_lib:connect(?SSH_DEFAULT_PORT,
+ [{public_key_alg, ssh_dsa},
+ {user_interaction, false},
+ silently_accept_hosts]),
+ {ok, Channel} =
+ ssh_connection:session_channel(ConnectionRef, infinity),
+ ok = ssh_connection:close(ConnectionRef, Channel),
+ ok = ssh:close(ConnectionRef);
+ _ ->
+ {skip, {error, "Has pass phrase can not be used by automated test case"}}
+ end;
+ _ ->
+ {skip, "no ~/.ssh/id_dsa"}
end.
-
%%--------------------------------------------------------------------
erlang_server_openssh_client_pulic_key_dsa(doc) ->
["Validate using dsa publickey."];
@@ -409,7 +411,10 @@ erlang_server_openssh_client_pulic_key_dsa(suite) ->
[];
erlang_server_openssh_client_pulic_key_dsa(Config) when is_list(Config) ->
- SystemDir = ?config(priv_dir, Config),
+ 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},
{failfun, fun ssh_test_lib:failfun/2}]),
@@ -417,7 +422,8 @@ erlang_server_openssh_client_pulic_key_dsa(Config) when is_list(Config) ->
test_server:sleep(500),
Cmd = "ssh -p " ++ integer_to_list(Port) ++
- " -o StrictHostKeyChecking=no "++ Host ++ " 1+1.",
+ " -o UserKnownHostsFile=" ++ KnownHosts ++
+ " " ++ Host ++ " 1+1.",
SshPort = open_port({spawn, Cmd}, [binary]),
receive
@@ -425,7 +431,6 @@ erlang_server_openssh_client_pulic_key_dsa(Config) when is_list(Config) ->
ok
after ?TIMEOUT ->
test_server:fail("Did not receive answer")
-
end,
ssh:stop_daemon(Pid).
@@ -440,7 +445,7 @@ erlang_client_openssh_server_password(Config) when is_list(Config) ->
%% to make sure we don't public-key-auth
UserDir = ?config(data_dir, Config),
{error, Reason0} =
- ssh_test_lib:connect(?SSH_DEFAULT_PORT, [{silently_accept_hosts, true},
+ ssh:connect(any, ?SSH_DEFAULT_PORT, [{silently_accept_hosts, true},
{user, "foo"},
{password, "morot"},
{user_interaction, false},
@@ -454,12 +459,12 @@ erlang_client_openssh_server_password(Config) when is_list(Config) ->
case length(string:tokens(User, " ")) of
1 ->
{error, Reason1} =
- ssh_test_lib:connect(?SSH_DEFAULT_PORT,
- [{silently_accept_hosts, true},
- {user, User},
- {password, "foo"},
- {user_interaction, false},
- {user_dir, UserDir}]),
+ ssh:connect(any, ?SSH_DEFAULT_PORT,
+ [{silently_accept_hosts, true},
+ {user, User},
+ {password, "foo"},
+ {user_interaction, false},
+ {user_dir, UserDir}]),
test_server:format("Test of wrong Pasword. "
"Error msg: ~p~n", [Reason1]);
_ ->
diff --git a/lib/ssh/vsn.mk b/lib/ssh/vsn.mk
index 42f860d6ae..defa47f824 100644
--- a/lib/ssh/vsn.mk
+++ b/lib/ssh/vsn.mk
@@ -1,5 +1,5 @@
#-*-makefile-*- ; force emacs to enter makefile-mode
-SSH_VSN = 2.0.9
+SSH_VSN = 2.1.1
APP_VSN = "ssh-$(SSH_VSN)"
diff --git a/lib/ssl/doc/src/Makefile b/lib/ssl/doc/src/Makefile
index 5d808d6727..fb12499ef7 100644
--- a/lib/ssl/doc/src/Makefile
+++ b/lib/ssl/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -117,15 +117,15 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man6
- $(INSTALL_DATA) $(MAN6_FILES) $(RELEASE_PATH)/man/man6
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man6"
+ $(INSTALL_DATA) $(MAN6_FILES) "$(RELEASE_PATH)/man/man6"
release_spec:
diff --git a/lib/ssl/doc/src/notes.xml b/lib/ssl/doc/src/notes.xml
index 1e1fe0d119..6c01954010 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>2011</year>
+ <year>1999</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,7 +30,116 @@
</header>
<p>This document describes the changes made to the SSL application.</p>
- <section><title>SSL 5.0</title>
+ <section><title>SSL 5.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Sometimes the client process could receive an extra
+ {error, closed} message after ssl:recv had returned
+ {error, closed}.</p>
+ <p>
+ Own Id: OTP-10118</p>
+ </item>
+ <item>
+ <p>
+ ssl v3 alert number 41 (no_certificate_RESERVED) is now
+ recognized</p>
+ <p>
+ Own Id: OTP-10196</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Experimental support for TLS 1.1 is now available, will
+ be officially supported from OTP-R16. Thanks to Andreas
+ Schultz for implementing the first version.</p>
+ <p>
+ Own Id: OTP-8871</p>
+ </item>
+ <item>
+ <p>
+ Experimental support for TLS 1.2 is now available, will
+ be officially supported from OTP-R16. Thanks to Andreas
+ Schultz for implementing the first version.</p>
+ <p>
+ Own Id: OTP-8872</p>
+ </item>
+ <item>
+ <p>
+ Removed some bottlenecks increasing the applications
+ parallelism especially for the client side.</p>
+ <p>
+ Own Id: OTP-10113</p>
+ </item>
+ <item>
+ <p>
+ Workaround for handling certificates that wrongly encode
+ X509countryname in utf-8 when the actual value is a valid
+ ASCCI value of length 2. Such certificates are accepted
+ by many browsers such as Chrome and Fierfox so for
+ interoperability reasons we will too.</p>
+ <p>
+ Own Id: OTP-10222</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>SSL 5.0.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Robustness and improvement to distribution over SSL</p>
+ <p>
+ Fix a bug where ssl_tls_dist_proxy would crash at caller
+ timeout. Fix a bug where a timeout from the SSL layer
+ would block the distribution indefinately. Run the proxy
+ exclusively on the loopback interface. (Thanks to Paul
+ Guyot)</p>
+ <p>
+ Own Id: OTP-9915</p>
+ </item>
+ <item>
+ <p>
+ Fix setup loop of SSL TLS dist proxy</p>
+ <p>
+ Fix potential leak of processes waiting indefinately for
+ data from closed sockets during socket setup phase.
+ (Thanks to Paul Guyot)</p>
+ <p>
+ Own Id: OTP-9916</p>
+ </item>
+ <item>
+ <p>
+ Correct spelling of registered (Thanks to Richard
+ Carlsson)</p>
+ <p>
+ Own Id: OTP-9925</p>
+ </item>
+ <item>
+ <p>
+ Added TLS PRF function to the SSL API for generation of
+ additional key material from a TLS session. (Thanks to
+ Andreas Schultz)</p>
+ <p>
+ Own Id: OTP-10024</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>SSL 5.0</title>
<section><title>Fixed Bugs and Malfunctions</title>
<list>
diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml
index 50268ae206..f0eac76264 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>2011</year>
+ <year>1999</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -36,12 +36,16 @@
<list type="bulleted">
<item>ssl requires the crypto and public_key applications.</item>
- <item>Supported SSL/TLS-versions are SSL-3.0 and TLS-1.0 </item>
+ <item>Supported SSL/TLS-versions are SSL-3.0 and TLS-1.0, experimental
+ support for TLS-1.1 and TLS-1.2 is also available (no support for elliptic curve cipher suites yet).</item>
<item>For security reasons sslv2 is not supported.</item>
<item>Ephemeral Diffie-Hellman cipher suites are supported
but not Diffie Hellman Certificates cipher suites.</item>
<item>Export cipher suites are not supported as the
U.S. lifted its export restrictions in early 2000.</item>
+ <item>IDEA cipher suites are not supported as they have
+ become deprecated by the latest TLS spec so there is not any
+ real motivation to implement them.</item>
<item>CRL and policy certificate
extensions are not supported yet. </item>
</list>
@@ -62,8 +66,8 @@
</c></p>
<p>For valid options
- see <seealso marker="kernel:inet">inet(3) </seealso> and
- <seealso marker="kernel:gen_tcp">gen_tcp(3) </seealso>.
+ see <seealso marker="kernel:inet">inet(3)</seealso> and
+ <seealso marker="kernel:gen_tcp">gen_tcp(3)</seealso>.
</p>
<p> <c>ssloption() = {verify, verify_type()} |
@@ -75,7 +79,9 @@
{keyfile, path()} | {password, string()} |
{cacerts, [der_encoded()]} | {cacertfile, path()} |
|{dh, der_encoded()} | {dhfile, path()} | {ciphers, ciphers()} |
- {ssl_imp, ssl_imp()} | {reuse_sessions, boolean()} | {reuse_session, fun()}
+ {ssl_imp, ssl_imp()} | {reuse_sessions, boolean()} | {reuse_session, fun()}
+ {next_protocols_advertised, list(binary()} |
+ {client_preferred_next_protocols, binary(), client | server, list(binary())}
</c></p>
<p><c>transportoption() = {CallbackModule, DataTag, ClosedTag}
@@ -106,7 +112,7 @@
<p><c>sslsocket() - opaque to the user. </c></p>
- <p><c>protocol() = sslv3 | tlsv1 </c></p>
+ <p><c>protocol() = sslv3 | tlsv1 | 'tlsv1.1' | 'tlsv1.2' </c></p>
<p><c>ciphers() = [ciphersuite()] | string() (according to old API)</c></p>
@@ -122,6 +128,9 @@
<p> <c>hash() = md5 | sha
</c></p>
+ <p><c>prf_random() = client_random | server_random
+ </c></p>
+
</section>
<section>
@@ -190,13 +199,13 @@
</item>
<tag>{depth, integer()}</tag>
- <item>Specifies the maximum
- verification depth, i.e. how far in a chain of certificates the
- verification process can proceed before the verification is
- considered to fail. Peer certificate = 0, CA certificate = 1,
- higher level CA certificate = 2, etc. The value 2 thus means
- that a chain can at most contain peer cert, CA cert, next CA
- cert, and an additional CA cert. The default value is 1.
+ <item>
+ The depth is the maximum number of non-self-issued
+ intermediate certificates that may follow the peer certificate
+ in a valid certification path. So if depth is 0 the PEER must
+ be signed by the trusted ROOT-CA directly, if 1 the path can
+ be PEER, CA, ROOT-CA, if it is 2 PEER, CA, CA, ROOT-CA and so
+ on. The default value is 1.
</item>
<tag>{verify_fun, {Verifyfun :: fun(), InitialUserState :: term()}}</tag>
@@ -294,8 +303,29 @@ fun(OtpCert :: #'OTPCertificate'{}, Event :: {bad_cert, Reason :: atom()} |
when possible.
</item>
+ <tag>{client_preferred_next_protocols, Precedence:: server | client, ClientPrefs::[binary()]}
+ {client_preferred_next_protocols, Precedence:: server | client, ClientPrefs::[binary()] , Default :: binary()}}</tag>
+
+ <item> <p>Indicates the client will try to perform Next Protocol
+ Negotiation.</p>
+
+ <p>If precedence is server the negaotiated protocol will be the
+ first protocol that appears on the server advertised list that is
+ also on the clients preference list.</p>
+
+ <p>If the precedence is client the negaotiated protocol will be the
+ first protocol that appears on the clients preference list that is
+ also on the server advertised list.</p>
+
+ <p> If the client does not support any of the servers advertised
+ protocols or the server does not advertise any protocols the
+ client will fallback to the first protocol in its list or if a
+ default is supplied it will fallback to that instead. If the
+ server does not support next protocol renegotiation the
+ connection will be aborted if no default protocol is supplied.</p>
+ </item>
</taglist>
- </section>
+ </section>
<section>
<title>SSL OPTION DESCRIPTIONS - SERVER SIDE</title>
@@ -346,6 +376,14 @@ fun(OtpCert :: #'OTPCertificate'{}, Event :: {bad_cert, Reason :: atom()} |
SuggestedSessionId is a binary(), PeerCert is a DER encoded
certificate, Compression is an enumeration integer
and CipherSuite is of type ciphersuite().
+ </item>
+
+ <tag>{next_protocols_advertised, Protocols :: list(binary())}</tag>
+ <item>The list of protocols to send to the client if the client indicates
+ it supports the Next Protocol extension. The client may select a protocol
+ that is not on this list. The list of protocols must not contain an empty
+ binary. If the server negotiates a Next Protocol it can be accessed
+ using <c>negotiated_next_protocol/1</c> method.
</item>
</taglist>
@@ -561,6 +599,26 @@ fun(OtpCert :: #'OTPCertificate'{}, Event :: {bad_cert, Reason :: atom()} |
</func>
<func>
+ <name>prf(Socket, Secret, Label, Seed, WantedLength) -> {ok, binary()} | {error, reason()}</name>
+ <fsummary>Use a sessions pseudo random function to generate key material.</fsummary>
+ <type>
+ <v>Socket = sslsocket()</v>
+ <v>Secret = binary() | master_secret</v>
+ <v>Label = binary()</v>
+ <v>Seed = [binary() | prf_random()]</v>
+ <v>WantedLength = non_neg_integer()</v>
+ </type>
+ <desc>
+ <p>Use the pseudo random function (PRF) of a TLS session to generate
+ additional key material. It either takes user generated values for
+ <c>Secret</c> and <c>Seed</c> or atoms directing it use a specific
+ value from the session security parameters.</p>
+ <p>This function can only be used with TLS connections, <c>{error, undefined}</c>
+ is returned for SSLv3 connections.</p>
+ </desc>
+ </func>
+
+ <func>
<name>renegotiate(Socket) -> ok | {error, Reason}</name>
<fsummary> Initiates a new handshake.</fsummary>
<type>
@@ -739,8 +797,23 @@ fun(OtpCert :: #'OTPCertificate'{}, Event :: {bad_cert, Reason :: atom()} |
ssl application.</p>
</desc>
</func>
+ <func>
+ <name>negotiated_next_protocol(Socket) -> {ok, Protocol} | {error, next_protocol_not_negotiated}</name>
+ <fsummary>Returns the Next Protocol negotiated.</fsummary>
+ <type>
+ <v>Socket = sslsocket()</v>
+ <v>Protocol = binary()</v>
+ </type>
+ <desc>
+ <p>
+ Returns the Next Protocol negotiated.
+ </p>
+ </desc>
+ </func>
+
+
</funcs>
-
+
<section>
<title>SEE ALSO</title>
<p><seealso marker="kernel:inet">inet(3) </seealso> and
diff --git a/lib/ssl/examples/certs/Makefile b/lib/ssl/examples/certs/Makefile
index a4f067ade6..be2546fe82 100644
--- a/lib/ssl/examples/certs/Makefile
+++ b/lib/ssl/examples/certs/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2010. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -54,8 +54,8 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/examples/certs
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/certs"
tar cf - etc | \
- (cd $(RELSYSDIR)/examples/certs; tar xf -)
- chmod -R ug+rw $(RELSYSDIR)/examples
+ (cd "$(RELSYSDIR)/examples/certs"; tar xf -)
+ chmod -R ug+rw "$(RELSYSDIR)/examples"
release_docs_spec:
diff --git a/lib/ssl/examples/src/Makefile b/lib/ssl/examples/src/Makefile
index c5f31b689c..3e033c08d9 100644
--- a/lib/ssl/examples/src/Makefile
+++ b/lib/ssl/examples/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2011. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -63,10 +63,10 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/examples/src
- $(INSTALL_DIR) $(RELSYSDIR)/examples/ebin
- (cd ..; tar cf - src ebin | (cd $(RELSYSDIR)/examples; tar xf -))
- chmod -R ug+w $(RELSYSDIR)/examples
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples/ebin"
+ (cd ..; tar cf - src ebin | (cd "$(RELSYSDIR)/examples"; tar xf -))
+ chmod -R ug+w "$(RELSYSDIR)/examples"
release_docs_spec:
diff --git a/lib/ssl/examples/src/client_server.erl b/lib/ssl/examples/src/client_server.erl
index baf5a9185e..133a1764bc 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2012. 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
@@ -21,18 +21,14 @@
-module(client_server).
--export([start/0, start/1, init_connect/1]).
+-export([start/0, init_connect/1]).
start() ->
- start([ssl, subject]).
-
-start(CertOpts) ->
%% Start ssl application
+ application:start(crypto),
+ application:start(public_key),
application:start(ssl),
- %% Always seed
- ssl:seed("ellynatefttidppohjeh"),
-
%% Let the current process be the server that listens and accepts
%% Listen
{ok, LSock} = ssl:listen(0, mk_opts(listen)),
@@ -40,14 +36,14 @@ start(CertOpts) ->
io:fwrite("Listen: port = ~w.~n", [LPort]),
%% Spawn the client process that connects to the server
- spawn(?MODULE, init_connect, [{LPort, CertOpts}]),
+ spawn(?MODULE, init_connect, [LPort]),
%% Accept
{ok, ASock} = ssl:transport_accept(LSock),
ok = ssl:ssl_accept(ASock),
io:fwrite("Accept: accepted.~n"),
- {ok, Cert} = ssl:peercert(ASock, CertOpts),
- io:fwrite("Accept: peer cert:~n~p~n", [Cert]),
+ {ok, Cert} = ssl:peercert(ASock),
+ io:fwrite("Accept: peer cert:~n~p~n", [public_key:pkix_decode_cert(Cert, otp)]),
io:fwrite("Accept: sending \"hello\".~n"),
ssl:send(ASock, "hello"),
{error, closed} = ssl:recv(ASock, 0),
@@ -59,12 +55,12 @@ start(CertOpts) ->
%% Client connect
-init_connect({LPort, CertOpts}) ->
+init_connect(LPort) ->
{ok, Host} = inet:gethostname(),
{ok, CSock} = ssl:connect(Host, LPort, mk_opts(connect)),
io:fwrite("Connect: connected.~n"),
- {ok, Cert} = ssl:peercert(CSock, CertOpts),
- io:fwrite("Connect: peer cert:~n~p~n", [Cert]),
+ {ok, Cert} = ssl:peercert(CSock),
+ io:fwrite("Connect: peer cert:~n~p~n", [public_key:pkix_decode_cert(Cert, otp)]),
{ok, Data} = ssl:recv(CSock, 0),
io:fwrite("Connect: got data: ~p~n", [Data]),
io:fwrite("Connect: closing and terminating.~n"),
diff --git a/lib/ssl/src/Makefile b/lib/ssl/src/Makefile
index dc69b53b28..c5c5bf593a 100644
--- a/lib/ssl/src/Makefile
+++ b/lib/ssl/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -37,6 +37,9 @@ RELSYSDIR = $(RELEASE_PATH)/lib/ssl-$(VSN)
# Common Macros
# ----------------------------------------------------
+BEHAVIOUR_MODULES= \
+ ssl_session_cache_api
+
MODULES= \
ssl \
ssl_alert \
@@ -53,7 +56,6 @@ MODULES= \
ssl_handshake \
ssl_manager \
ssl_session \
- ssl_session_cache_api \
ssl_session_cache \
ssl_record \
ssl_ssl2 \
@@ -66,10 +68,15 @@ INTERNAL_HRL_FILES = \
ssl_alert.hrl ssl_cipher.hrl ssl_handshake.hrl ssl_internal.hrl \
ssl_record.hrl
-ERL_FILES= $(MODULES:%=%.erl)
+ERL_FILES= \
+ $(MODULES:%=%.erl) \
+ $(BEHAVIOUR_MODULES:%=%.erl)
+
TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR))
+BEHAVIOUR_TARGET_FILES= $(BEHAVIOUR_MODULES:%=$(EBIN)/%.$(EMULATOR))
+
APP_FILE= ssl.app
APPUP_FILE= ssl.appup
@@ -83,6 +90,7 @@ APPUP_TARGET= $(EBIN)/$(APPUP_FILE)
# ----------------------------------------------------
EXTRA_ERLC_FLAGS = +warn_unused_vars
ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/kernel/src \
+ -pz $(EBIN) \
-pz $(ERL_TOP)/lib/public_key/ebin \
$(EXTRA_ERLC_FLAGS) -DVSN=\"$(VSN)\"
@@ -91,6 +99,8 @@ ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/kernel/src \
# Targets
# ----------------------------------------------------
+$(TARGET_FILES): $(BEHAVIOUR_TARGET_FILES)
+
debug opt: $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET)
clean:
@@ -105,23 +115,18 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
docs:
+
# ----------------------------------------------------
# Release Target
# ----------------------------------------------------
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) \
- $(APPUP_TARGET) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(BEHAVIOUR_TARGET_FILES) $(TARGET_FILES) $(APP_TARGET) \
+ $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
release_docs_spec:
-
-
-
-
-
-
diff --git a/lib/ssl/src/inet_tls_dist.erl b/lib/ssl/src/inet_tls_dist.erl
index 115527aae0..57c859bf24 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -57,7 +57,7 @@ accept_connection(AcceptPid, Socket, MyNode, Allowed, SetupTime) ->
setup(Node, Type, MyNode, LongOrShortNames,SetupTime) ->
Kernel = self(),
- spawn(fun() -> do_setup(Kernel, Node, Type, MyNode, LongOrShortNames, SetupTime) end).
+ spawn_opt(fun() -> do_setup(Kernel, Node, Type, MyNode, LongOrShortNames, SetupTime) end, [link, {priority, max}]).
do_setup(Kernel, Node, Type, MyNode, LongOrShortNames, SetupTime) ->
[Name, Address] = splitnode(Node, LongOrShortNames),
@@ -229,9 +229,7 @@ connect_hs_data(Kernel, Node, MyNode, Socket, Timer, Version, Ip, TcpPort, Addre
accept_hs_data(Kernel, MyNode, Socket, Timer, Allowed) ->
common_hs_data(Kernel, MyNode, Socket, Timer, #hs_data{
allowed = Allowed,
- f_address = fun(S, N) ->
- ssl_tls_dist_proxy:get_remote_id(S, N)
- end
+ f_address = fun get_remote_id/2
}).
common_hs_data(Kernel, MyNode, Socket, Timer, HsData) ->
@@ -273,3 +271,11 @@ common_hs_data(Kernel, MyNode, Socket, Timer, HsData) ->
P = proplists:get_value(send_pend, Stats, 0),
{ok, R,W,P}
end}.
+
+get_remote_id(Socket, _Node) ->
+ case ssl_tls_dist_proxy:get_tcp_address(Socket) of
+ {ok, Address} ->
+ Address;
+ {error, _Reason} ->
+ ?shutdown(no_node)
+ end.
diff --git a/lib/ssl/src/ssl.appup.src b/lib/ssl/src/ssl.appup.src
index 1b07e76d6a..76550fa04b 100644
--- a/lib/ssl/src/ssl.appup.src
+++ b/lib/ssl/src/ssl.appup.src
@@ -1,23 +1,15 @@
%% -*- erlang -*-
{"%VSN%",
[
- {"4.1.6", [{restart_application, ssl}]},
- {"4.1.5", [{restart_application, ssl}]},
- {"4.1.4", [{restart_application, ssl}]},
- {"4.1.3", [{restart_application, ssl}]},
- {"4.1.2", [{restart_application, ssl}]},
- {"4.1.1", [{restart_application, ssl}]},
- {"4.1", [{restart_application, ssl}]},
- {"4.0.1", [{restart_application, ssl}]}
+ {"5.0.1", [{restart_application, ssl}]},
+ {"5.0", [{restart_application, ssl}]},
+ {<<"4\\.*">>, [{restart_application, ssl}]},
+ {<<"3\\.*">>, [{restart_application, ssl}]}
],
[
- {"4.1.6", [{restart_application, ssl}]},
- {"4.1.5", [{restart_application, ssl}]},
- {"4.1.4", [{restart_application, ssl}]},
- {"4.1.3", [{restart_application, ssl}]},
- {"4.1.2", [{restart_application, ssl}]},
- {"4.1.1", [{restart_application, ssl}]},
- {"4.1", [{restart_application, ssl}]},
- {"4.0.1", [{restart_application, ssl}]}
+ {"5.0.1", [{restart_application, ssl}]},
+ {"5.0", [{restart_application, ssl}]},
+ {<<"4\\.*">>, [{restart_application, ssl}]},
+ {<<"3\\.*">>, [{restart_application, ssl}]}
]}.
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index d0693445e0..9a562aa5a8 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -25,21 +25,30 @@
-export([start/0, start/1, stop/0, transport_accept/1,
transport_accept/2, ssl_accept/1, ssl_accept/2, ssl_accept/3,
- cipher_suites/0, cipher_suites/1, close/1, shutdown/2,
+ cipher_suites/0, cipher_suites/1, suite_definition/1,
+ close/1, shutdown/2,
connect/3, connect/2, connect/4, connection_info/1,
controlling_process/2, listen/2, pid/1, peername/1, peercert/1,
recv/2, recv/3, send/2, getopts/2, setopts/2, sockname/1,
versions/0, session_info/1, format_error/1,
- renegotiate/1]).
+ renegotiate/1, prf/5, clear_pem_cache/0, random_bytes/1, negotiated_next_protocol/1]).
+
-deprecated({pid, 1, next_major_release}).
-include("ssl_internal.hrl").
-include("ssl_record.hrl").
-include("ssl_cipher.hrl").
+-include("ssl_handshake.hrl").
-include_lib("public_key/include/public_key.hrl").
+%% Visible in API
+-export_type([connect_option/0, listen_option/0, ssl_option/0, transport_option/0,
+ erl_cipher_suite/0, %% From ssl_cipher.hrl
+ tls_atom_version/0, %% From ssl_internal.hrl
+ prf_random/0]).
+
-record(config, {ssl, %% SSL parameters
inet_user, %% User set inet options
emulated, %% #socket_option{} emulated
@@ -58,7 +67,9 @@
{keyfile, path()} | {password, string()} | {cacerts, [Der::binary()]} |
{cacertfile, path()} | {dh, Der::binary()} | {dhfile, path()} |
{ciphers, ciphers()} | {ssl_imp, ssl_imp()} | {reuse_sessions, boolean()} |
- {reuse_session, fun()} | {hibernate_after, integer()|undefined}.
+ {reuse_session, fun()} | {hibernate_after, integer()|undefined} |
+ {next_protocols_advertised, list(binary())} |
+ {client_preferred_next_protocols, binary(), client | server, list(binary())}.
-type verify_type() :: verify_none | verify_peer.
-type path() :: string().
@@ -67,7 +78,7 @@
-type ssl_imp() :: new | old.
-type transport_option() :: {cb_info, {CallbackModule::atom(), DataTag::atom(), ClosedTag::atom()}}.
-
+-type prf_random() :: client_random | server_random.
%%--------------------------------------------------------------------
-spec start() -> ok | {error, reason()}.
@@ -298,6 +309,23 @@ peercert(#sslsocket{pid = Pid}) ->
end.
%%--------------------------------------------------------------------
+-spec suite_definition(cipher_suite()) -> erl_cipher_suite().
+%%
+%% Description: Return erlang cipher suite definition.
+%%--------------------------------------------------------------------
+suite_definition(S) ->
+ {KeyExchange, Cipher, Hash, _} = ssl_cipher:suite_definition(S),
+ {KeyExchange, Cipher, Hash}.
+
+%%--------------------------------------------------------------------
+-spec negotiated_next_protocol(#sslsocket{}) -> {ok, binary()} | {error, reason()}.
+%%
+%% Description: Returns the next protocol that has been negotiated. If no
+%% protocol has been negotiated will return {error, next_protocol_not_negotiated}
+%%--------------------------------------------------------------------
+negotiated_next_protocol(#sslsocket{fd = new_ssl, pid = Pid}) ->
+ ssl_connection:negotiated_next_protocol(Pid).
+
-spec cipher_suites() -> [erl_cipher_suite()].
-spec cipher_suites(erlang | openssl) -> [erl_cipher_suite()] | [string()].
@@ -308,7 +336,7 @@ cipher_suites() ->
cipher_suites(erlang) ->
Version = ssl_record:highest_protocol_version([]),
- [ssl_cipher:suite_definition(S) || S <- ssl_cipher:suites(Version)];
+ [suite_definition(S) || S <- ssl_cipher:suites(Version)];
cipher_suites(openssl) ->
Version = ssl_record:highest_protocol_version([]),
@@ -402,7 +430,7 @@ session_info(#sslsocket{pid = Pid, fd = new_ssl}) ->
versions() ->
Vsns = ssl_record:supported_protocol_versions(),
SupportedVsns = [ssl_record:protocol_version(Vsn) || Vsn <- Vsns],
- AvailableVsns = ?DEFAULT_SUPPORTED_VERSIONS,
+ AvailableVsns = ?ALL_SUPPORTED_VERSIONS,
[{ssl_app, ?VSN}, {supported, SupportedVsns}, {available, AvailableVsns}].
@@ -414,6 +442,26 @@ versions() ->
renegotiate(#sslsocket{pid = Pid, fd = new_ssl}) ->
ssl_connection:renegotiation(Pid).
+%%--------------------------------------------------------------------
+-spec prf(#sslsocket{}, binary() | 'master_secret', binary(),
+ binary() | prf_random(), non_neg_integer()) ->
+ {ok, binary()} | {error, reason()}.
+%%
+%% Description: use a ssl sessions TLS PRF to generate key material
+%%--------------------------------------------------------------------
+prf(#sslsocket{pid = Pid, fd = new_ssl},
+ Secret, Label, Seed, WantedLength) ->
+ ssl_connection:prf(Pid, Secret, Label, Seed, WantedLength).
+
+
+%%--------------------------------------------------------------------
+-spec clear_pem_cache() -> ok.
+%%
+%% Description: Clear the PEM cache
+%%--------------------------------------------------------------------
+clear_pem_cache() ->
+ ssl_manager:clear_pem_cache().
+
%%---------------------------------------------------------------
-spec format_error({error, term()}) -> list().
%%
@@ -448,6 +496,23 @@ 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
%%%--------------------------------------------------------------------
@@ -515,7 +580,7 @@ handle_options(Opts0, _Role) ->
throw({error, {eoptions, {verify, Value}}})
end,
- CertFile = handle_option(certfile, Opts, ""),
+ CertFile = handle_option(certfile, Opts, <<>>),
SSLOptions = #ssl_options{
versions = handle_option(versions, Opts, []),
@@ -541,7 +606,9 @@ handle_options(Opts0, _Role) ->
renegotiate_at = handle_option(renegotiate_at, Opts, ?DEFAULT_RENEGOTIATE_AT),
debug = handle_option(debug, Opts, []),
hibernate_after = handle_option(hibernate_after, Opts, undefined),
- erl_dist = handle_option(erl_dist, Opts, false)
+ erl_dist = handle_option(erl_dist, Opts, false),
+ next_protocols_advertised = handle_option(next_protocols_advertised, Opts, undefined),
+ next_protocol_selector = make_next_protocol_selector(handle_option(client_preferred_next_protocols, Opts, undefined))
},
CbInfo = proplists:get_value(cb_info, Opts, {gen_tcp, tcp, tcp_closed, tcp_error}),
@@ -550,7 +617,8 @@ handle_options(Opts0, _Role) ->
depth, cert, certfile, key, keyfile,
password, cacerts, cacertfile, dh, dhfile, ciphers,
debug, reuse_session, reuse_sessions, ssl_imp,
- cb_info, renegotiate_at, secure_renegotiate, hibernate_after, erl_dist],
+ cb_info, renegotiate_at, secure_renegotiate, hibernate_after, erl_dist, next_protocols_advertised,
+ client_preferred_next_protocols],
SockOpts = lists:foldl(fun(Key, PropList) ->
proplists:delete(Key, PropList)
@@ -602,8 +670,12 @@ validate_option(depth, Value) when is_integer(Value),
validate_option(cert, Value) when Value == undefined;
is_binary(Value) ->
Value;
-validate_option(certfile, Value) when Value == undefined; is_list(Value) ->
+validate_option(certfile, undefined = Value) ->
Value;
+validate_option(certfile, Value) when is_binary(Value) ->
+ Value;
+validate_option(certfile, Value) when is_list(Value) ->
+ list_to_binary(Value);
validate_option(key, undefined) ->
undefined;
@@ -614,8 +686,13 @@ validate_option(key, {KeyType, Value}) when is_binary(Value),
KeyType == 'DSAPrivateKey';
KeyType == 'PrivateKeyInfo' ->
{KeyType, Value};
-validate_option(keyfile, Value) when is_list(Value) ->
+
+validate_option(keyfile, undefined) ->
+ <<>>;
+validate_option(keyfile, Value) when is_binary(Value) ->
Value;
+validate_option(keyfile, Value) when is_list(Value), Value =/= "" ->
+ list_to_binary(Value);
validate_option(password, Value) when is_list(Value) ->
Value;
@@ -625,16 +702,20 @@ validate_option(cacerts, Value) when Value == undefined;
%% certfile must be present in some cases otherwhise it can be set
%% to the empty string.
validate_option(cacertfile, undefined) ->
- "";
-validate_option(cacertfile, Value) when is_list(Value), Value =/= "" ->
+ <<>>;
+validate_option(cacertfile, Value) when is_binary(Value) ->
Value;
+validate_option(cacertfile, Value) when is_list(Value), Value =/= ""->
+ list_to_binary(Value);
validate_option(dh, Value) when Value == undefined;
is_binary(Value) ->
Value;
validate_option(dhfile, undefined = Value) ->
Value;
-validate_option(dhfile, Value) when is_list(Value), Value =/= "" ->
+validate_option(dhfile, Value) when is_binary(Value) ->
Value;
+validate_option(dhfile, Value) when is_list(Value), Value =/= "" ->
+ list_to_binary(Value);
validate_option(ciphers, Value) when is_list(Value) ->
Version = ssl_record:highest_protocol_version([]),
try cipher_suites(Version, Value)
@@ -662,15 +743,68 @@ validate_option(hibernate_after, undefined) ->
undefined;
validate_option(hibernate_after, Value) when is_integer(Value), Value >= 0 ->
Value;
-validate_option(erl_dist,Value) when Value == true;
+validate_option(erl_dist,Value) when Value == true;
Value == false ->
Value;
+validate_option(client_preferred_next_protocols = Opt, {Precedence, PreferredProtocols} = Value)
+ when is_list(PreferredProtocols) ->
+ case ssl_record:highest_protocol_version([]) of
+ {3,0} ->
+ throw({error, {eoptions, {not_supported_in_sslv3, {Opt, Value}}}});
+ _ ->
+ validate_binary_list(client_preferred_next_protocols, PreferredProtocols),
+ validate_npn_ordering(Precedence),
+ {Precedence, PreferredProtocols, ?NO_PROTOCOL}
+ end;
+validate_option(client_preferred_next_protocols = Opt, {Precedence, PreferredProtocols, Default} = Value)
+ when is_list(PreferredProtocols), is_binary(Default),
+ byte_size(Default) > 0, byte_size(Default) < 256 ->
+ case ssl_record:highest_protocol_version([]) of
+ {3,0} ->
+ throw({error, {eoptions, {not_supported_in_sslv3, {Opt, Value}}}});
+ _ ->
+ validate_binary_list(client_preferred_next_protocols, PreferredProtocols),
+ validate_npn_ordering(Precedence),
+ Value
+ end;
+
+validate_option(client_preferred_next_protocols, undefined) ->
+ undefined;
+validate_option(next_protocols_advertised = Opt, Value) when is_list(Value) ->
+ case ssl_record:highest_protocol_version([]) of
+ {3,0} ->
+ throw({error, {eoptions, {not_supported_in_sslv3, {Opt, Value}}}});
+ _ ->
+ validate_binary_list(next_protocols_advertised, Value),
+ Value
+ end;
+
+validate_option(next_protocols_advertised, undefined) ->
+ undefined;
validate_option(Opt, Value) ->
throw({error, {eoptions, {Opt, Value}}}).
-
+
+validate_npn_ordering(client) ->
+ ok;
+validate_npn_ordering(server) ->
+ ok;
+validate_npn_ordering(Value) ->
+ throw({error, {eoptions, {client_preferred_next_protocols, {invalid_precedence, Value}}}}).
+
+validate_binary_list(Opt, List) ->
+ lists:foreach(
+ fun(Bin) when is_binary(Bin),
+ byte_size(Bin) > 0,
+ byte_size(Bin) < 256 ->
+ ok;
+ (Bin) ->
+ throw({error, {eoptions, {Opt, {invalid_protocol, Bin}}}})
+ end, List).
+
validate_versions([], Versions) ->
Versions;
-validate_versions([Version | Rest], Versions) when Version == 'tlsv1.1';
+validate_versions([Version | Rest], Versions) when Version == 'tlsv1.2';
+ Version == 'tlsv1.1';
Version == tlsv1;
Version == sslv3 ->
validate_versions(Rest, Versions);
@@ -772,6 +906,34 @@ cipher_suites(Version, Ciphers0) ->
no_format(Error) ->
lists:flatten(io_lib:format("No format string for error: \"~p\" available.", [Error])).
+
+detect(_Pred, []) ->
+ undefined;
+detect(Pred, [H|T]) ->
+ case Pred(H) of
+ true ->
+ H;
+ _ ->
+ detect(Pred, T)
+ end.
+
+make_next_protocol_selector(undefined) ->
+ undefined;
+make_next_protocol_selector({client, AllProtocols, DefaultProtocol}) ->
+ fun(AdvertisedProtocols) ->
+ case detect(fun(PreferredProtocol) -> lists:member(PreferredProtocol, AdvertisedProtocols) end, AllProtocols) of
+ undefined -> DefaultProtocol;
+ PreferredProtocol -> PreferredProtocol
+ end
+ end;
+
+make_next_protocol_selector({server, AllProtocols, DefaultProtocol}) ->
+ fun(AdvertisedProtocols) ->
+ case detect(fun(PreferredProtocol) -> lists:member(PreferredProtocol, AllProtocols) end, AdvertisedProtocols) of
+ undefined -> DefaultProtocol;
+ PreferredProtocol -> PreferredProtocol
+ end
+ end.
%% Only used to remove exit messages from old ssl
%% First is a nonsense clause to provide some
diff --git a/lib/ssl/src/ssl_alert.erl b/lib/ssl/src/ssl_alert.erl
index eb1228afa4..222b3f1ad7 100644
--- a/lib/ssl/src/ssl_alert.erl
+++ b/lib/ssl/src/ssl_alert.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -84,6 +84,8 @@ description_txt(?DECOMPRESSION_FAILURE) ->
"decompression failure";
description_txt(?HANDSHAKE_FAILURE) ->
"handshake failure";
+description_txt(?NO_CERTIFICATE_RESERVED) ->
+ "No certificate reserved";
description_txt(?BAD_CERTIFICATE) ->
"bad certificate";
description_txt(?UNSUPPORTED_CERTIFICATE) ->
diff --git a/lib/ssl/src/ssl_alert.hrl b/lib/ssl/src/ssl_alert.hrl
index 6470b82d50..92548edab7 100644
--- a/lib/ssl/src/ssl_alert.hrl
+++ b/lib/ssl/src/ssl_alert.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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,6 +43,7 @@
%% record_overflow(22),
%% decompression_failure(30),
%% handshake_failure(40),
+%% no_certificate_RESERVED(41), %% Only sslv3
%% bad_certificate(42),
%% unsupported_certificate(43),
%% certificate_revoked(44),
@@ -69,6 +70,7 @@
-define(RECORD_OVERFLOW, 22).
-define(DECOMPRESSION_FAILURE, 30).
-define(HANDSHAKE_FAILURE, 40).
+-define(NO_CERTIFICATE_RESERVED, 41).
-define(BAD_CERTIFICATE, 42).
-define(UNSUPPORTED_CERTIFICATE, 43).
-define(CERTIFICATE_REVOKED, 44).
diff --git a/lib/ssl/src/ssl_certificate.erl b/lib/ssl/src/ssl_certificate.erl
index 61876e1158..86f5617b54 100644
--- a/lib/ssl/src/ssl_certificate.erl
+++ b/lib/ssl/src/ssl_certificate.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -103,7 +103,7 @@ certificate_chain(OwnCert, CertDbHandle, CertsDbRef) ->
ErlCert = public_key:pkix_decode_cert(OwnCert, otp),
certificate_chain(ErlCert, OwnCert, CertDbHandle, CertsDbRef, [OwnCert]).
%%--------------------------------------------------------------------
--spec file_to_certificats(string(), term()) -> [der_cert()].
+-spec file_to_certificats(binary(), term()) -> [der_cert()].
%%
%% Description: Return list of DER encoded certificates.
%%--------------------------------------------------------------------
@@ -111,7 +111,7 @@ file_to_certificats(File, DbHandle) ->
{ok, List} = ssl_manager:cache_pem_file(File, DbHandle),
[Bin || {'Certificate', Bin, not_encrypted} <- List].
%%--------------------------------------------------------------------
--spec validate_extension(term(), #'Extension'{} | {bad_cert, atom()} | valid,
+-spec validate_extension(term(), {extension, #'Extension'{}} | {bad_cert, atom()} | valid,
term()) -> {valid, term()} |
{fail, tuple()} |
{unknown, term()}.
@@ -172,7 +172,12 @@ extensions_list(Extensions) ->
%% Description:
%%--------------------------------------------------------------------
signature_type(RSA) when RSA == ?sha1WithRSAEncryption;
- RSA == ?md5WithRSAEncryption ->
+ RSA == ?md5WithRSAEncryption;
+ RSA == ?sha224WithRSAEncryption;
+ RSA == ?sha256WithRSAEncryption;
+ RSA == ?sha384WithRSAEncryption;
+ RSA == ?sha512WithRSAEncryption
+ ->
rsa;
signature_type(?'id-dsa-with-sha1') ->
dsa.
diff --git a/lib/ssl/src/ssl_certificate_db.erl b/lib/ssl/src/ssl_certificate_db.erl
index cb2473576a..67d00f0da7 100644
--- a/lib/ssl/src/ssl_certificate_db.erl
+++ b/lib/ssl/src/ssl_certificate_db.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -24,12 +24,13 @@
-module(ssl_certificate_db).
-include("ssl_internal.hrl").
-include_lib("public_key/include/public_key.hrl").
+-include_lib("kernel/include/file.hrl").
-export([create/0, remove/1, add_trusted_certs/3,
- remove_trusted_certs/2, lookup_trusted_cert/4, foldl/3,
- lookup_cached_certs/2, cache_pem_file/4, uncache_pem_file/2, lookup/2]).
-
--type time() :: {non_neg_integer(), non_neg_integer(), non_neg_integer()}.
+ remove_trusted_certs/2, insert/3, remove/2, clear/1, db_size/1,
+ ref_count/3, lookup_trusted_cert/4, foldl/3,
+ lookup_cached_pem/2, cache_pem_file/2, cache_pem_file/3,
+ lookup/2]).
%%====================================================================
%% Internal application API
@@ -43,9 +44,14 @@
%% the process that called create may call the other functions.
%%--------------------------------------------------------------------
create() ->
- [ets:new(ssl_otp_certificate_db, [set, protected]),
- ets:new(ssl_file_to_ref, [set, protected]),
- ets:new(ssl_pid_to_file, [bag, private])].
+ [%% Let connection process delete trusted certs
+ %% that can only belong to one connection. (Supplied directly
+ %% on DER format to ssl:connect/listen.)
+ ets:new(ssl_otp_cacertificate_db, [set, public]),
+ %% Let connection processes call ref_count/3 directly
+ ets:new(ssl_otp_ca_file_ref, [set, public]),
+ ets:new(ssl_otp_pem_cache, [set, protected])
+ ].
%%--------------------------------------------------------------------
-spec remove([db_handle()]) -> term().
@@ -53,7 +59,9 @@ create() ->
%% Description: Removes database db
%%--------------------------------------------------------------------
remove(Dbs) ->
- lists:foreach(fun(Db) -> true = ets:delete(Db) end, Dbs).
+ lists:foreach(fun(Db) ->
+ true = ets:delete(Db)
+ end, Dbs).
%%--------------------------------------------------------------------
-spec lookup_trusted_cert(db_handle(), certdb_ref(), serialnumber(), issuer()) ->
@@ -72,11 +80,14 @@ lookup_trusted_cert(DbHandle, Ref, SerialNumber, Issuer) ->
{ok, Certs}
end.
-lookup_cached_certs(DbHandle, File) ->
- ets:lookup(DbHandle, {file, File}).
+lookup_cached_pem([_, _, PemChache], MD5) ->
+ lookup_cached_pem(PemChache, MD5);
+lookup_cached_pem(PemChache, MD5) ->
+ lookup(MD5, PemChache).
%%--------------------------------------------------------------------
--spec add_trusted_certs(pid(), string() | {der, list()}, [db_handle()]) -> {ok, [db_handle()]}.
+-spec add_trusted_certs(pid(), {erlang:timestamp(), string()} |
+ {der, list()}, [db_handle()]) -> {ok, [db_handle()]}.
%%
%% Description: Adds the trusted certificates from file <File> to the
%% runtime database. Returns Ref that should be handed to lookup_trusted_cert
@@ -86,82 +97,55 @@ add_trusted_certs(_Pid, {der, DerList}, [CerDb, _,_]) ->
NewRef = make_ref(),
add_certs_from_der(DerList, NewRef, CerDb),
{ok, NewRef};
-add_trusted_certs(Pid, File, [CertsDb, FileToRefDb, PidToFileDb]) ->
- Ref = case lookup(File, FileToRefDb) of
- undefined ->
- NewRef = make_ref(),
- add_certs_from_file(File, NewRef, CertsDb),
- insert(File, NewRef, 1, FileToRefDb),
- NewRef;
- [OldRef] ->
- ref_count(File,FileToRefDb,1),
- OldRef
- end,
- insert(Pid, File, PidToFileDb),
- {ok, Ref}.
+
+add_trusted_certs(_Pid, File, [CertsDb, RefDb, PemChache] = Db) ->
+ MD5 = crypto:md5(File),
+ case lookup_cached_pem(Db, MD5) of
+ [{_Content, Ref}] ->
+ ref_count(Ref, RefDb, 1),
+ {ok, Ref};
+ [Content] ->
+ Ref = make_ref(),
+ update_counter(Ref, 1, RefDb),
+ insert(MD5, {Content, Ref}, PemChache),
+ add_certs_from_pem(Content, Ref, CertsDb),
+ {ok, Ref};
+ undefined ->
+ new_trusted_cert_entry({MD5, File}, Db)
+ end.
%%--------------------------------------------------------------------
--spec cache_pem_file(pid(), string(), time(), [db_handle()]) -> term().
+-spec cache_pem_file({binary(), binary()}, [db_handle()]) -> term().
+-spec cache_pem_file(reference(), {binary(), binary()}, [db_handle()]) -> term().
%%
%% Description: Cache file as binary in DB
%%--------------------------------------------------------------------
-cache_pem_file(Pid, File, Time, [CertsDb, _FileToRefDb, PidToFileDb]) ->
- {ok, PemBin} = file:read_file(File),
+cache_pem_file({MD5, File}, [_CertsDb, _RefDb, PemChache]) ->
+ {ok, PemBin} = file:read_file(File),
Content = public_key:pem_decode(PemBin),
- insert({file, File}, {Time, Content}, CertsDb),
- insert(Pid, File, PidToFileDb),
+ insert(MD5, Content, PemChache),
{ok, Content}.
-%--------------------------------------------------------------------
--spec uncache_pem_file(string(), [db_handle()]) -> no_return().
-%%
-%% Description: If a cached file is no longer valid (changed on disk)
-%% we must terminate the connections using the old file content, and
-%% when those processes are finish the cache will be cleaned. It is
-%% a rare but possible case a new ssl client/server is started with
-%% a filename with the same name as previously started client/server
-%% but with different content.
-%% --------------------------------------------------------------------
-uncache_pem_file(File, [_CertsDb, _FileToRefDb, PidToFileDb]) ->
- Pids = select(PidToFileDb, [{{'$1', File},[],['$$']}]),
- lists:foreach(fun([Pid]) ->
- exit(Pid, shutdown)
- end, Pids).
-
-%%--------------------------------------------------------------------
--spec remove_trusted_certs(pid(), [db_handle()]) -> term().
-
-%%
-%% Description: Removes trusted certs originating from
-%% the file associated to Pid from the runtime database.
-%%--------------------------------------------------------------------
-remove_trusted_certs(Pid, [CertsDb, FileToRefDb, PidToFileDb]) ->
- Files = lookup(Pid, PidToFileDb),
- delete(Pid, PidToFileDb),
- Clear = fun(File) ->
- delete({file,File}, CertsDb),
- try
- 0 = ref_count(File, FileToRefDb, -1),
- case lookup(File, FileToRefDb) of
- [Ref] when is_reference(Ref) ->
- remove_certs(Ref, CertsDb);
- _ -> ok
- end,
- delete(File, FileToRefDb)
- catch _:_ ->
- ok
- end
- end,
- case Files of
- undefined -> ok;
- _ ->
- [Clear(File) || File <- Files],
- ok
- end.
+cache_pem_file(Ref, {MD5, File}, [_CertsDb, _RefDb, PemChache]) ->
+ {ok, PemBin} = file:read_file(File),
+ Content = public_key:pem_decode(PemBin),
+ insert(MD5, {Content, Ref}, PemChache),
+ {ok, Content}.
+
+remove_trusted_certs(Ref, CertsDb) ->
+ remove_certs(Ref, CertsDb).
+
+%%--------------------------------------------------------------------
+-spec remove(term(), db_handle()) -> term().
+%%
+%% Description: Removes an element in a <Db>.
+%%--------------------------------------------------------------------
+remove(Key, Db) ->
+ _ = ets:delete(Db, Key).
%%--------------------------------------------------------------------
-spec lookup(term(), db_handle()) -> term() | undefined.
%%
-%% Description: Looks up an element in a certificat <Db>.
+%% Description: Looks up an element in a <Db>.
%%--------------------------------------------------------------------
lookup(Key, Db) ->
case ets:lookup(Db, Key) of
@@ -184,24 +168,44 @@ lookup(Key, Db) ->
%%--------------------------------------------------------------------
foldl(Fun, Acc0, Cache) ->
ets:foldl(Fun, Acc0, Cache).
-
+
%%--------------------------------------------------------------------
-%%% Internal functions
+-spec ref_count(term(), db_handle(), integer()) -> integer().
+%%
+%% Description: Updates a reference counter in a <Db>.
%%--------------------------------------------------------------------
-insert(Key, Data, Db) ->
- true = ets:insert(Db, {Key, Data}).
+ref_count(Key, Db, N) ->
+ ets:update_counter(Db,Key,N).
-insert(Key, Data, Count, Db) ->
- true = ets:insert(Db, {Key, Count, Data}).
+%%--------------------------------------------------------------------
+-spec clear(db_handle()) -> term().
+%%
+%% Description: Clears the cache
+%%--------------------------------------------------------------------
+clear(Db) ->
+ ets:delete_all_objects(Db).
-ref_count(Key, Db,N) ->
- ets:update_counter(Db,Key,N).
+%%--------------------------------------------------------------------
+-spec db_size(db_handle()) -> integer().
+%%
+%% Description: Returns the size of the db
+%%--------------------------------------------------------------------
+db_size(Db) ->
+ ets:info(Db, size).
-delete(Key, Db) ->
- _ = ets:delete(Db, Key).
+%%--------------------------------------------------------------------
+%%-spec insert(Key::term(), Data::term(), Db::db_handle()) -> no_return().
+%%
+%% Description: Inserts data into <Db>
+%%--------------------------------------------------------------------
+insert(Key, Data, Db) ->
+ true = ets:insert(Db, {Key, Data}).
-select(Db, MatchSpec)->
- ets:select(Db, MatchSpec).
+%%--------------------------------------------------------------------
+%%% Internal functions
+%%--------------------------------------------------------------------
+update_counter(Key, Count, Db) ->
+ true = ets:insert(Db, {Key, Count}).
remove_certs(Ref, CertsDb) ->
ets:match_delete(CertsDb, {{Ref, '_', '_'}, '_'}).
@@ -210,10 +214,8 @@ add_certs_from_der(DerList, Ref, CertsDb) ->
Add = fun(Cert) -> add_certs(Cert, Ref, CertsDb) end,
[Add(Cert) || Cert <- DerList].
-add_certs_from_file(File, Ref, CertsDb) ->
+add_certs_from_pem(PemEntries, Ref, CertsDb) ->
Add = fun(Cert) -> add_certs(Cert, Ref, CertsDb) end,
- {ok, PemBin} = file:read_file(File),
- PemEntries = public_key:pem_decode(PemBin),
[Add(Cert) || {'Certificate', Cert, not_encrypted} <- PemEntries].
add_certs(Cert, Ref, CertsDb) ->
@@ -229,3 +231,10 @@ add_certs(Cert, Ref, CertsDb) ->
"it could not be correctly decoded.~n", []),
error_logger:info_report(Report)
end.
+
+new_trusted_cert_entry(FileRef, [CertsDb, RefDb, _] = Db) ->
+ Ref = make_ref(),
+ update_counter(Ref, 1, RefDb),
+ {ok, Content} = cache_pem_file(Ref, FileRef, Db),
+ add_certs_from_pem(Content, Ref, CertsDb),
+ {ok, Ref}.
diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl
index d43d312be8..567690a413 100644
--- a/lib/ssl/src/ssl_cipher.erl
+++ b/lib/ssl/src/ssl_cipher.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -28,25 +28,27 @@
-include("ssl_internal.hrl").
-include("ssl_record.hrl").
-include("ssl_cipher.hrl").
+-include("ssl_handshake.hrl").
-include("ssl_alert.hrl").
-include_lib("public_key/include/public_key.hrl").
--export([security_parameters/2, suite_definition/1,
- decipher/5, cipher/4,
+-export([security_parameters/3, suite_definition/1,
+ decipher/5, cipher/5,
suite/1, suites/1, anonymous_suites/0,
- openssl_suite/1, openssl_suite_name/1, filter/2]).
+ openssl_suite/1, openssl_suite_name/1, filter/2,
+ hash_algorithm/1, sign_algorithm/1]).
-compile(inline).
%%--------------------------------------------------------------------
--spec security_parameters(cipher_suite(), #security_parameters{}) ->
+-spec security_parameters(tls_version(), cipher_suite(), #security_parameters{}) ->
#security_parameters{}.
%%
%% Description: Returns a security parameters record where the
%% cipher values has been updated according to <CipherSuite>
%%-------------------------------------------------------------------
-security_parameters(CipherSuite, SecParams) ->
- { _, Cipher, Hash} = suite_definition(CipherSuite),
+security_parameters(Version, CipherSuite, SecParams) ->
+ { _, Cipher, Hash, PrfHashAlg} = suite_definition(CipherSuite),
SecParams#security_parameters{
cipher_suite = CipherSuite,
bulk_cipher_algorithm = bulk_cipher_algorithm(Cipher),
@@ -55,20 +57,21 @@ security_parameters(CipherSuite, SecParams) ->
expanded_key_material_length = expanded_key_material(Cipher),
key_material_length = key_material(Cipher),
iv_size = iv_size(Cipher),
- mac_algorithm = mac_algorithm(Hash),
+ mac_algorithm = hash_algorithm(Hash),
+ prf_algorithm = prf_algorithm(PrfHashAlg, Version),
hash_size = hash_size(Hash)}.
%%--------------------------------------------------------------------
--spec cipher(cipher_enum(), #cipher_state{}, binary(), binary()) ->
+-spec cipher(cipher_enum(), #cipher_state{}, binary(), binary(), tls_version()) ->
{binary(), #cipher_state{}}.
%%
%% Description: Encrypts the data and the MAC using chipher described
%% by cipher_enum() and updating the cipher state
%%-------------------------------------------------------------------
-cipher(?NULL, CipherState, <<>>, Fragment) ->
+cipher(?NULL, CipherState, <<>>, Fragment, _Version) ->
GenStreamCipherList = [Fragment, <<>>],
{GenStreamCipherList, CipherState};
-cipher(?RC4, CipherState, Mac, Fragment) ->
+cipher(?RC4, CipherState, Mac, Fragment, _Version) ->
State0 = case CipherState#cipher_state.state of
undefined -> crypto:rc4_set_key(CipherState#cipher_state.key);
S -> S
@@ -76,32 +79,41 @@ cipher(?RC4, CipherState, Mac, Fragment) ->
GenStreamCipherList = [Fragment, Mac],
{State1, T} = crypto:rc4_encrypt_with_state(State0, GenStreamCipherList),
{T, CipherState#cipher_state{state = State1}};
-cipher(?DES, CipherState, Mac, Fragment) ->
+cipher(?DES, CipherState, Mac, Fragment, Version) ->
block_cipher(fun(Key, IV, T) ->
crypto:des_cbc_encrypt(Key, IV, T)
- end, block_size(des_cbc), CipherState, Mac, Fragment);
-cipher(?'3DES', CipherState, Mac, Fragment) ->
+ end, block_size(des_cbc), CipherState, Mac, Fragment, Version);
+cipher(?'3DES', CipherState, Mac, Fragment, Version) ->
block_cipher(fun(<<K1:8/binary, K2:8/binary, K3:8/binary>>, IV, T) ->
crypto:des3_cbc_encrypt(K1, K2, K3, IV, T)
- end, block_size(des_cbc), CipherState, Mac, Fragment);
-cipher(?AES, CipherState, Mac, Fragment) ->
+ end, block_size(des_cbc), CipherState, Mac, Fragment, Version);
+cipher(?AES, CipherState, Mac, Fragment, Version) ->
block_cipher(fun(Key, IV, T) when byte_size(Key) =:= 16 ->
crypto:aes_cbc_128_encrypt(Key, IV, T);
(Key, IV, T) when byte_size(Key) =:= 32 ->
crypto:aes_cbc_256_encrypt(Key, IV, T)
- end, block_size(aes_128_cbc), CipherState, Mac, Fragment).
-%% cipher(?IDEA, CipherState, Mac, Fragment) ->
-%% block_cipher(fun(Key, IV, T) ->
-%% crypto:idea_cbc_encrypt(Key, IV, T)
-%% end, block_size(idea_cbc), CipherState, Mac, Fragment);
-
-block_cipher(Fun, BlockSz, #cipher_state{key=Key, iv=IV} = CS0,
- Mac, Fragment) ->
+ end, block_size(aes_128_cbc), CipherState, Mac, Fragment, Version).
+
+build_cipher_block(BlockSz, Mac, Fragment) ->
TotSz = byte_size(Mac) + erlang:iolist_size(Fragment) + 1,
{PaddingLength, Padding} = get_padding(TotSz, BlockSz),
- L = [Fragment, Mac, PaddingLength, Padding],
+ [Fragment, Mac, PaddingLength, Padding].
+
+block_cipher(Fun, BlockSz, #cipher_state{key=Key, iv=IV} = CS0,
+ Mac, Fragment, {3, N})
+ when N == 0; N == 1 ->
+ L = build_cipher_block(BlockSz, Mac, Fragment),
T = Fun(Key, IV, L),
NextIV = next_iv(T, IV),
+ {T, CS0#cipher_state{iv=NextIV}};
+
+block_cipher(Fun, BlockSz, #cipher_state{key=Key, iv=IV} = CS0,
+ Mac, Fragment, {3, N})
+ when N == 2; N == 3 ->
+ NextIV = random_iv(IV),
+ L0 = build_cipher_block(BlockSz, Mac, Fragment),
+ L = [NextIV|L0],
+ T = Fun(Key, IV, L),
{T, CS0#cipher_state{iv=NextIV}}.
%%--------------------------------------------------------------------
@@ -147,19 +159,16 @@ decipher(?AES, HashSz, CipherState, Fragment, Version) ->
(Key, IV, T) when byte_size(Key) =:= 32 ->
crypto:aes_cbc_256_decrypt(Key, IV, T)
end, CipherState, HashSz, Fragment, Version).
-%% decipher(?IDEA, HashSz, CipherState, Fragment, Version) ->
-%% block_decipher(fun(Key, IV, T) ->
-%% crypto:idea_cbc_decrypt(Key, IV, T)
-%% end, CipherState, HashSz, Fragment, Version);
block_decipher(Fun, #cipher_state{key=Key, iv=IV} = CipherState0,
HashSz, Fragment, Version) ->
try
Text = Fun(Key, IV, Fragment),
- GBC = generic_block_cipher_from_bin(Text, HashSz),
+ NextIV = next_iv(Fragment, IV),
+ GBC = generic_block_cipher_from_bin(Version, Text, NextIV, HashSz),
Content = GBC#generic_block_cipher.content,
Mac = GBC#generic_block_cipher.mac,
- CipherState1 = CipherState0#cipher_state{iv=next_iv(Fragment, IV)},
+ CipherState1 = CipherState0#cipher_state{iv=GBC#generic_block_cipher.next_iv},
case is_correct_padding(GBC, Version) of
true ->
{Content, Mac, CipherState1};
@@ -187,8 +196,8 @@ block_decipher(Fun, #cipher_state{key=Key, iv=IV} = CipherState0,
%%--------------------------------------------------------------------
suites({3, 0}) ->
ssl_ssl3:suites();
-suites({3, N}) when N == 1; N == 2 ->
- ssl_tls1:suites().
+suites({3, N}) ->
+ ssl_tls1:suites(N).
%%--------------------------------------------------------------------
-spec anonymous_suites() -> [cipher_suite()].
@@ -201,10 +210,12 @@ anonymous_suites() ->
?TLS_DH_anon_WITH_DES_CBC_SHA,
?TLS_DH_anon_WITH_3DES_EDE_CBC_SHA,
?TLS_DH_anon_WITH_AES_128_CBC_SHA,
- ?TLS_DH_anon_WITH_AES_256_CBC_SHA].
+ ?TLS_DH_anon_WITH_AES_256_CBC_SHA,
+ ?TLS_DH_anon_WITH_AES_128_CBC_SHA256,
+ ?TLS_DH_anon_WITH_AES_256_CBC_SHA256].
%%--------------------------------------------------------------------
--spec suite_definition(cipher_suite()) -> erl_cipher_suite().
+-spec suite_definition(cipher_suite()) -> int_cipher_suite().
%%
%% Description: Return erlang cipher suite definition.
%% Note: Currently not supported suites are commented away.
@@ -212,56 +223,81 @@ anonymous_suites() ->
%%-------------------------------------------------------------------
%% TLS v1.1 suites
suite_definition(?TLS_NULL_WITH_NULL_NULL) ->
- {null, null, null};
+ {null, null, null, null};
%% suite_definition(?TLS_RSA_WITH_NULL_MD5) ->
-%% {rsa, null, md5};
+%% {rsa, null, md5, default_prf};
%% suite_definition(?TLS_RSA_WITH_NULL_SHA) ->
-%% {rsa, null, sha};
+%% {rsa, null, sha, default_prf};
suite_definition(?TLS_RSA_WITH_RC4_128_MD5) ->
- {rsa, rc4_128, md5};
-suite_definition(?TLS_RSA_WITH_RC4_128_SHA) ->
- {rsa, rc4_128, sha};
-%% suite_definition(?TLS_RSA_WITH_IDEA_CBC_SHA) ->
-%% {rsa, idea_cbc, sha};
-suite_definition(?TLS_RSA_WITH_DES_CBC_SHA) ->
- {rsa, des_cbc, sha};
+ {rsa, rc4_128, md5, default_prf};
+suite_definition(?TLS_RSA_WITH_RC4_128_SHA) ->
+ {rsa, rc4_128, sha, default_prf};
+suite_definition(?TLS_RSA_WITH_DES_CBC_SHA) ->
+ {rsa, des_cbc, sha, default_prf};
suite_definition(?TLS_RSA_WITH_3DES_EDE_CBC_SHA) ->
- {rsa, '3des_ede_cbc', sha};
+ {rsa, '3des_ede_cbc', sha, default_prf};
suite_definition(?TLS_DHE_DSS_WITH_DES_CBC_SHA) ->
- {dhe_dss, des_cbc, sha};
+ {dhe_dss, des_cbc, sha, default_prf};
suite_definition(?TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA) ->
- {dhe_dss, '3des_ede_cbc', sha};
+ {dhe_dss, '3des_ede_cbc', sha, default_prf};
suite_definition(?TLS_DHE_RSA_WITH_DES_CBC_SHA) ->
- {dhe_rsa, des_cbc, sha};
+ {dhe_rsa, des_cbc, sha, default_prf};
suite_definition(?TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA) ->
- {dhe_rsa, '3des_ede_cbc', sha};
+ {dhe_rsa, '3des_ede_cbc', sha, default_prf};
%%% TSL V1.1 AES suites
suite_definition(?TLS_RSA_WITH_AES_128_CBC_SHA) ->
- {rsa, aes_128_cbc, sha};
+ {rsa, aes_128_cbc, sha, default_prf};
suite_definition(?TLS_DHE_DSS_WITH_AES_128_CBC_SHA) ->
- {dhe_dss, aes_128_cbc, sha};
+ {dhe_dss, aes_128_cbc, sha, default_prf};
suite_definition(?TLS_DHE_RSA_WITH_AES_128_CBC_SHA) ->
- {dhe_rsa, aes_128_cbc, sha};
+ {dhe_rsa, aes_128_cbc, sha, default_prf};
suite_definition(?TLS_RSA_WITH_AES_256_CBC_SHA) ->
- {rsa, aes_256_cbc, sha};
+ {rsa, aes_256_cbc, sha, default_prf};
suite_definition(?TLS_DHE_DSS_WITH_AES_256_CBC_SHA) ->
- {dhe_dss, aes_256_cbc, sha};
+ {dhe_dss, aes_256_cbc, sha, default_prf};
suite_definition(?TLS_DHE_RSA_WITH_AES_256_CBC_SHA) ->
- {dhe_rsa, aes_256_cbc, sha};
+ {dhe_rsa, aes_256_cbc, sha, default_prf};
+
+%% TLS v1.2 suites
+
+%% suite_definition(?TLS_RSA_WITH_NULL_SHA) ->
+%% {rsa, null, sha, default_prf};
+suite_definition(?TLS_RSA_WITH_AES_128_CBC_SHA256) ->
+ {rsa, aes_128_cbc, sha256, default_prf};
+suite_definition(?TLS_RSA_WITH_AES_256_CBC_SHA256) ->
+ {rsa, aes_256_cbc, sha256, default_prf};
+suite_definition(?TLS_DHE_DSS_WITH_AES_128_CBC_SHA256) ->
+ {dhe_dss, aes_128_cbc, sha256, default_prf};
+suite_definition(?TLS_DHE_RSA_WITH_AES_128_CBC_SHA256) ->
+ {dhe_rsa, aes_128_cbc, sha256, default_prf};
+suite_definition(?TLS_DHE_DSS_WITH_AES_256_CBC_SHA256) ->
+ {dhe_dss, aes_256_cbc, sha256, default_prf};
+suite_definition(?TLS_DHE_RSA_WITH_AES_256_CBC_SHA256) ->
+ {dhe_rsa, aes_256_cbc, sha256, default_prf};
+
+%% not defined YET:
+%% TLS_DH_DSS_WITH_AES_128_CBC_SHA256 DH_DSS AES_128_CBC SHA256
+%% TLS_DH_RSA_WITH_AES_128_CBC_SHA256 DH_RSA AES_128_CBC SHA256
+%% TLS_DH_DSS_WITH_AES_256_CBC_SHA256 DH_DSS AES_256_CBC SHA256
+%% TLS_DH_RSA_WITH_AES_256_CBC_SHA256 DH_RSA AES_256_CBC SHA256
%%% DH-ANON deprecated by TLS spec and not available
%%% by default, but good for testing purposes.
suite_definition(?TLS_DH_anon_WITH_RC4_128_MD5) ->
- {dh_anon, rc4_128, md5};
+ {dh_anon, rc4_128, md5, default_prf};
suite_definition(?TLS_DH_anon_WITH_DES_CBC_SHA) ->
- {dh_anon, des_cbc, sha};
+ {dh_anon, des_cbc, sha, default_prf};
suite_definition(?TLS_DH_anon_WITH_3DES_EDE_CBC_SHA) ->
- {dh_anon, '3des_ede_cbc', sha};
+ {dh_anon, '3des_ede_cbc', sha, default_prf};
suite_definition(?TLS_DH_anon_WITH_AES_128_CBC_SHA) ->
- {dh_anon, aes_128_cbc, sha};
+ {dh_anon, aes_128_cbc, sha, default_prf};
suite_definition(?TLS_DH_anon_WITH_AES_256_CBC_SHA) ->
- {dh_anon, aes_256_cbc, sha}.
+ {dh_anon, aes_256_cbc, sha, default_prf};
+suite_definition(?TLS_DH_anon_WITH_AES_128_CBC_SHA256) ->
+ {dh_anon, aes_128_cbc, sha256, default_prf};
+suite_definition(?TLS_DH_anon_WITH_AES_256_CBC_SHA256) ->
+ {dh_anon, aes_256_cbc, sha256, default_prf}.
%%--------------------------------------------------------------------
-spec suite(erl_cipher_suite()) -> cipher_suite().
@@ -278,8 +314,6 @@ suite({rsa, rc4_128, md5}) ->
?TLS_RSA_WITH_RC4_128_MD5;
suite({rsa, rc4_128, sha}) ->
?TLS_RSA_WITH_RC4_128_SHA;
-%% suite({rsa, idea_cbc, sha}) ->
-%% ?TLS_RSA_WITH_IDEA_CBC_SHA;
suite({rsa, des_cbc, sha}) ->
?TLS_RSA_WITH_DES_CBC_SHA;
suite({rsa, '3des_ede_cbc', sha}) ->
@@ -315,7 +349,28 @@ suite({dhe_dss, aes_256_cbc, sha}) ->
suite({dhe_rsa, aes_256_cbc, sha}) ->
?TLS_DHE_RSA_WITH_AES_256_CBC_SHA;
suite({dh_anon, aes_256_cbc, sha}) ->
- ?TLS_DH_anon_WITH_AES_256_CBC_SHA.
+ ?TLS_DH_anon_WITH_AES_256_CBC_SHA;
+
+%% TLS v1.2 suites
+
+%% suite_definition(?TLS_RSA_WITH_NULL_SHA) ->
+%% {rsa, null, sha, sha256};
+suite({rsa, aes_128_cbc, sha256}) ->
+ ?TLS_RSA_WITH_AES_128_CBC_SHA256;
+suite({rsa, aes_256_cbc, sha256}) ->
+ ?TLS_RSA_WITH_AES_256_CBC_SHA256;
+suite({dhe_dss, aes_128_cbc, sha256}) ->
+ ?TLS_DHE_DSS_WITH_AES_128_CBC_SHA256;
+suite({dhe_rsa, aes_128_cbc, sha256}) ->
+ ?TLS_DHE_RSA_WITH_AES_128_CBC_SHA256;
+suite({dhe_dss, aes_256_cbc, sha256}) ->
+ ?TLS_DHE_DSS_WITH_AES_256_CBC_SHA256;
+suite({dhe_rsa, aes_256_cbc, sha256}) ->
+ ?TLS_DHE_RSA_WITH_AES_256_CBC_SHA256;
+suite({dh_anon, aes_128_cbc, sha256}) ->
+ ?TLS_DH_anon_WITH_AES_128_CBC_SHA256;
+suite({dh_anon, aes_256_cbc, sha256}) ->
+ ?TLS_DH_anon_WITH_AES_256_CBC_SHA256.
%%--------------------------------------------------------------------
-spec openssl_suite(openssl_cipher_suite()) -> cipher_suite().
@@ -323,6 +378,18 @@ suite({dh_anon, aes_256_cbc, sha}) ->
%% Description: Return TLS cipher suite definition.
%%--------------------------------------------------------------------
%% translate constants <-> openssl-strings
+openssl_suite("DHE-RSA-AES256-SHA256") ->
+ ?TLS_DHE_RSA_WITH_AES_256_CBC_SHA256;
+openssl_suite("DHE-DSS-AES256-SHA256") ->
+ ?TLS_DHE_DSS_WITH_AES_256_CBC_SHA256;
+openssl_suite("AES256-SHA256") ->
+ ?TLS_RSA_WITH_AES_256_CBC_SHA256;
+openssl_suite("DHE-RSA-AES128-SHA256") ->
+ ?TLS_DHE_RSA_WITH_AES_128_CBC_SHA256;
+openssl_suite("DHE-DSS-AES128-SHA256") ->
+ ?TLS_DHE_DSS_WITH_AES_128_CBC_SHA256;
+openssl_suite("AES128-SHA256") ->
+ ?TLS_RSA_WITH_AES_128_CBC_SHA256;
openssl_suite("DHE-RSA-AES256-SHA") ->
?TLS_DHE_RSA_WITH_AES_256_CBC_SHA;
openssl_suite("DHE-DSS-AES256-SHA") ->
@@ -341,8 +408,6 @@ openssl_suite("DHE-DSS-AES128-SHA") ->
?TLS_DHE_DSS_WITH_AES_128_CBC_SHA;
openssl_suite("AES128-SHA") ->
?TLS_RSA_WITH_AES_128_CBC_SHA;
-%%openssl_suite("IDEA-CBC-SHA") ->
-%% ?TLS_RSA_WITH_IDEA_CBC_SHA;
openssl_suite("RC4-SHA") ->
?TLS_RSA_WITH_RC4_128_SHA;
openssl_suite("RC4-MD5") ->
@@ -374,8 +439,6 @@ openssl_suite_name(?TLS_DHE_DSS_WITH_AES_128_CBC_SHA) ->
"DHE-DSS-AES128-SHA";
openssl_suite_name(?TLS_RSA_WITH_AES_128_CBC_SHA) ->
"AES128-SHA";
-%% openssl_suite_name(?TLS_RSA_WITH_IDEA_CBC_SHA) ->
-%% "IDEA-CBC-SHA";
openssl_suite_name(?TLS_RSA_WITH_RC4_128_SHA) ->
"RC4-SHA";
openssl_suite_name(?TLS_RSA_WITH_RC4_128_MD5) ->
@@ -384,6 +447,28 @@ openssl_suite_name(?TLS_DHE_RSA_WITH_DES_CBC_SHA) ->
"EDH-RSA-DES-CBC-SHA";
openssl_suite_name(?TLS_RSA_WITH_DES_CBC_SHA) ->
"DES-CBC-SHA";
+openssl_suite_name(?TLS_RSA_WITH_NULL_SHA256) ->
+ "NULL-SHA256";
+openssl_suite_name(?TLS_RSA_WITH_AES_128_CBC_SHA256) ->
+ "AES128-SHA256";
+openssl_suite_name(?TLS_RSA_WITH_AES_256_CBC_SHA256) ->
+ "AES256-SHA256";
+openssl_suite_name(?TLS_DH_DSS_WITH_AES_128_CBC_SHA256) ->
+ "DH-DSS-AES128-SHA256";
+openssl_suite_name(?TLS_DH_RSA_WITH_AES_128_CBC_SHA256) ->
+ "DH-RSA-AES128-SHA256";
+openssl_suite_name(?TLS_DHE_DSS_WITH_AES_128_CBC_SHA256) ->
+ "DHE-DSS-AES128-SHA256";
+openssl_suite_name(?TLS_DHE_RSA_WITH_AES_128_CBC_SHA256) ->
+ "DHE-RSA-AES128-SHA256";
+openssl_suite_name(?TLS_DH_DSS_WITH_AES_256_CBC_SHA256) ->
+ "DH-DSS-AES256-SHA256";
+openssl_suite_name(?TLS_DH_RSA_WITH_AES_256_CBC_SHA256) ->
+ "DH-RSA-AES256-SHA256";
+openssl_suite_name(?TLS_DHE_DSS_WITH_AES_256_CBC_SHA256) ->
+ "DHE-DSS-AES256-SHA256";
+openssl_suite_name(?TLS_DHE_RSA_WITH_AES_256_CBC_SHA256) ->
+ "DHE-RSA-AES256-SHA256";
%% No oppenssl name
openssl_suite_name(Cipher) ->
suite_definition(Cipher).
@@ -411,9 +496,6 @@ filter(DerCert, Ciphers) ->
bulk_cipher_algorithm(null) ->
?NULL;
-%% Not supported yet
-%% bulk_cipher_algorithm(idea_cbc) ->
-%% ?IDEA;
bulk_cipher_algorithm(rc4_128) ->
?RC4;
bulk_cipher_algorithm(des_cbc) ->
@@ -428,8 +510,7 @@ type(Cipher) when Cipher == null;
Cipher == rc4_128 ->
?STREAM;
-type(Cipher) when Cipher == idea_cbc;
- Cipher == des_cbc;
+type(Cipher) when Cipher == des_cbc;
Cipher == '3des_ede_cbc';
Cipher == aes_128_cbc;
Cipher == aes_256_cbc ->
@@ -437,8 +518,7 @@ type(Cipher) when Cipher == idea_cbc;
key_material(null) ->
0;
-key_material(Cipher) when Cipher == idea_cbc;
- Cipher == rc4_128 ->
+key_material(rc4_128) ->
16;
key_material(des_cbc) ->
8;
@@ -451,8 +531,7 @@ key_material(aes_256_cbc) ->
expanded_key_material(null) ->
0;
-expanded_key_material(Cipher) when Cipher == idea_cbc;
- Cipher == rc4_128 ->
+expanded_key_material(rc4_128) ->
16;
expanded_key_material(Cipher) when Cipher == des_cbc ->
8;
@@ -467,8 +546,7 @@ effective_key_bits(null) ->
0;
effective_key_bits(des_cbc) ->
56;
-effective_key_bits(Cipher) when Cipher == idea_cbc;
- Cipher == rc4_128;
+effective_key_bits(Cipher) when Cipher == rc4_128;
Cipher == aes_128_cbc ->
128;
effective_key_bits('3des_ede_cbc') ->
@@ -482,8 +560,7 @@ iv_size(Cipher) when Cipher == null;
iv_size(Cipher) ->
block_size(Cipher).
-block_size(Cipher) when Cipher == idea_cbc;
- Cipher == des_cbc;
+block_size(Cipher) when Cipher == des_cbc;
Cipher == '3des_ede_cbc' ->
8;
@@ -491,19 +568,51 @@ block_size(Cipher) when Cipher == aes_128_cbc;
Cipher == aes_256_cbc ->
16.
-mac_algorithm(null) ->
- ?NULL;
-mac_algorithm(md5) ->
- ?MD5;
-mac_algorithm(sha) ->
- ?SHA.
+prf_algorithm(default_prf, {3, N}) when N >= 3 ->
+ ?SHA256;
+prf_algorithm(default_prf, {3, _}) ->
+ ?MD5SHA;
+prf_algorithm(Algo, _) ->
+ hash_algorithm(Algo).
+
+hash_algorithm(null) -> ?NULL;
+hash_algorithm(md5) -> ?MD5;
+hash_algorithm(sha) -> ?SHA; %% Only sha always refers to "SHA-1"
+hash_algorithm(sha224) -> ?SHA224;
+hash_algorithm(sha256) -> ?SHA256;
+hash_algorithm(sha384) -> ?SHA384;
+hash_algorithm(sha512) -> ?SHA512;
+hash_algorithm(?NULL) -> null;
+hash_algorithm(?MD5) -> md5;
+hash_algorithm(?SHA) -> sha;
+hash_algorithm(?SHA224) -> sha224;
+hash_algorithm(?SHA256) -> sha256;
+hash_algorithm(?SHA384) -> sha384;
+hash_algorithm(?SHA512) -> sha512.
+
+sign_algorithm(anon) -> ?ANON;
+sign_algorithm(rsa) -> ?RSA;
+sign_algorithm(dsa) -> ?DSA;
+sign_algorithm(ecdsa) -> ?ECDSA;
+sign_algorithm(?ANON) -> anon;
+sign_algorithm(?RSA) -> rsa;
+sign_algorithm(?DSA) -> dsa;
+sign_algorithm(?ECDSA) -> ecdsa.
hash_size(null) ->
0;
hash_size(md5) ->
16;
hash_size(sha) ->
- 20.
+ 20;
+hash_size(sha256) ->
+ 32.
+%% Currently no supported cipher suites defaults to sha384 or sha512
+%% so these clauses are not needed at the moment.
+%% hash_size(sha384) ->
+%% 48;
+%% hash_size(sha512) ->
+%% 64.
%% RFC 5246: 6.2.3.2. CBC Block Cipher
%%
@@ -525,7 +634,8 @@ hash_size(sha) ->
%% We return the original (possibly invalid) PadLength in any case.
%% An invalid PadLength will be caught by is_correct_padding/2
%%
-generic_block_cipher_from_bin(T, HashSize) ->
+generic_block_cipher_from_bin({3, N}, T, IV, HashSize)
+ when N == 0; N == 1 ->
Sz1 = byte_size(T) - 1,
<<_:Sz1/binary, ?BYTE(PadLength0)>> = T,
PadLength = if
@@ -536,7 +646,20 @@ generic_block_cipher_from_bin(T, HashSize) ->
<<Content:CompressedLength/binary, Mac:HashSize/binary,
Padding:PadLength/binary, ?BYTE(PadLength0)>> = T,
#generic_block_cipher{content=Content, mac=Mac,
- padding=Padding, padding_length=PadLength0}.
+ padding=Padding, padding_length=PadLength0,
+ next_iv = IV};
+
+generic_block_cipher_from_bin({3, N}, T, IV, HashSize)
+ when N == 2; N == 3 ->
+ Sz1 = byte_size(T) - 1,
+ <<_:Sz1/binary, ?BYTE(PadLength)>> = T,
+ IVLength = byte_size(IV),
+ CompressedLength = byte_size(T) - IVLength - PadLength - 1 - HashSize,
+ <<NextIV:IVLength/binary, Content:CompressedLength/binary, Mac:HashSize/binary,
+ Padding:PadLength/binary, ?BYTE(PadLength)>> = T,
+ #generic_block_cipher{content=Content, mac=Mac,
+ padding=Padding, padding_length=PadLength,
+ next_iv = NextIV}.
generic_stream_cipher_from_bin(T, HashSz) ->
Sz = byte_size(T),
@@ -567,6 +690,10 @@ get_padding_aux(BlockSize, PadLength) ->
N = BlockSize - PadLength,
{N, list_to_binary(lists:duplicate(N, N))}.
+random_iv(IV) ->
+ IVSz = byte_size(IV),
+ ssl:random_bytes(IVSz).
+
next_iv(Bin, IV) ->
BinSz = byte_size(Bin),
IVSz = byte_size(IV),
@@ -578,16 +705,19 @@ rsa_signed_suites() ->
dhe_rsa_suites() ++ rsa_suites().
dhe_rsa_suites() ->
- [?TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
+ [?TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,
+ ?TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
?TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA,
+ ?TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,
?TLS_DHE_RSA_WITH_AES_128_CBC_SHA,
?TLS_DHE_RSA_WITH_DES_CBC_SHA].
rsa_suites() ->
- [?TLS_RSA_WITH_AES_256_CBC_SHA,
+ [?TLS_RSA_WITH_AES_256_CBC_SHA256,
+ ?TLS_RSA_WITH_AES_256_CBC_SHA,
?TLS_RSA_WITH_3DES_EDE_CBC_SHA,
+ ?TLS_RSA_WITH_AES_128_CBC_SHA256,
?TLS_RSA_WITH_AES_128_CBC_SHA,
- %%?TLS_RSA_WITH_IDEA_CBC_SHA,
?TLS_RSA_WITH_RC4_128_SHA,
?TLS_RSA_WITH_RC4_128_MD5,
?TLS_RSA_WITH_DES_CBC_SHA].
@@ -596,8 +726,10 @@ dsa_signed_suites() ->
dhe_dss_suites().
dhe_dss_suites() ->
- [?TLS_DHE_DSS_WITH_AES_256_CBC_SHA,
+ [?TLS_DHE_DSS_WITH_AES_256_CBC_SHA256,
+ ?TLS_DHE_DSS_WITH_AES_256_CBC_SHA,
?TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA,
+ ?TLS_DHE_DSS_WITH_AES_128_CBC_SHA256,
?TLS_DHE_DSS_WITH_AES_128_CBC_SHA,
?TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA].
diff --git a/lib/ssl/src/ssl_cipher.hrl b/lib/ssl/src/ssl_cipher.hrl
index 8bd68cc190..0f439f8ed5 100644
--- a/lib/ssl/src/ssl_cipher.hrl
+++ b/lib/ssl/src/ssl_cipher.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -28,8 +28,9 @@
-type cipher() :: null |rc4_128 | idea_cbc | des40_cbc | des_cbc | '3des_ede_cbc'
| aes_128_cbc | aes_256_cbc.
--type hash() :: null | sha | md5.
+-type hash() :: null | sha | md5 | sha256 | sha384 | sha512.
-type erl_cipher_suite() :: {key_algo(), cipher(), hash()}.
+-type int_cipher_suite() :: {key_algo(), cipher(), hash(), hash()}.
-type cipher_suite() :: binary().
-type cipher_enum() :: integer().
-type openssl_cipher_suite() :: string().
@@ -177,6 +178,47 @@
%% TLS_DH_anon_WITH_AES_256_CBC_SHA = { 0x00, 0x3A };
-define(TLS_DH_anon_WITH_AES_256_CBC_SHA, <<?BYTE(16#00), ?BYTE(16#3A)>>).
+%%% TLS 1.2 Cipher Suites RFC 5246
+
+%% TLS_RSA_WITH_NULL_SHA256 = { 0x00,0x3B };
+-define(TLS_RSA_WITH_NULL_SHA256, <<?BYTE(16#00), ?BYTE(16#3B)>>).
+
+%% TLS_RSA_WITH_AES_128_CBC_SHA256 = { 0x00,0x3C };
+-define(TLS_RSA_WITH_AES_128_CBC_SHA256, <<?BYTE(16#00), ?BYTE(16#3C)>>).
+
+%% TLS_RSA_WITH_AES_256_CBC_SHA256 = { 0x00,0x3D };
+-define(TLS_RSA_WITH_AES_256_CBC_SHA256, <<?BYTE(16#00), ?BYTE(16#3D)>>).
+
+%% TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = { 0x00,0x3E };
+-define(TLS_DH_DSS_WITH_AES_128_CBC_SHA256, <<?BYTE(16#00), ?BYTE(16#3E)>>).
+
+%% TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = { 0x00,0x3F };
+-define(TLS_DH_RSA_WITH_AES_128_CBC_SHA256, <<?BYTE(16#00), ?BYTE(16#3F)>>).
+
+%% TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = { 0x00,0x40 };
+-define(TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, <<?BYTE(16#00), ?BYTE(16#40)>>).
+
+%% TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = { 0x00,0x67 };
+-define(TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, <<?BYTE(16#00), ?BYTE(16#67)>>).
+
+%% TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = { 0x00,0x68 };
+-define(TLS_DH_DSS_WITH_AES_256_CBC_SHA256, <<?BYTE(16#00), ?BYTE(16#68)>>).
+
+%% TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = { 0x00,0x69 };
+-define(TLS_DH_RSA_WITH_AES_256_CBC_SHA256, <<?BYTE(16#00), ?BYTE(16#69)>>).
+
+%% TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = { 0x00,0x6A };
+-define(TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, <<?BYTE(16#00), ?BYTE(16#6A)>>).
+
+%% TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = { 0x00,0x6B };
+-define(TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, <<?BYTE(16#00), ?BYTE(16#6B)>>).
+
+%% TLS_DH_anon_WITH_AES_128_CBC_SHA256 = { 0x00,0x6C };
+-define(TLS_DH_anon_WITH_AES_128_CBC_SHA256, <<?BYTE(16#00), ?BYTE(16#6C)>>).
+
+%% TLS_DH_anon_WITH_AES_256_CBC_SHA256 = { 0x00,0x6D };
+-define(TLS_DH_anon_WITH_AES_256_CBC_SHA256, <<?BYTE(16#00), ?BYTE(16#6D)>>).
+
%%% Kerberos Cipher Suites
%% TLS_KRB5_WITH_DES_CBC_SHA = { 0x00,0x1E };
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index 28dd0c85d0..23f22987df 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -40,14 +40,15 @@
-export([send/2, recv/3, connect/7, ssl_accept/6, handshake/2,
socket_control/3, close/1, shutdown/2,
new_user/2, get_opts/2, set_opts/2, info/1, session_info/1,
- peer_certificate/1, sockname/1, peername/1, renegotiation/1]).
+ peer_certificate/1, sockname/1, peername/1, renegotiation/1,
+ negotiated_next_protocol/1, prf/5]).
%% Called by ssl_connection_sup
-export([start_link/7]).
%% gen_fsm callbacks
--export([init/1, hello/2, certify/2, cipher/2, connection/2,
- abbreviated/2, handle_event/3,
+-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]).
-record(state, {
@@ -66,8 +67,7 @@
tls_packets = [], % Not yet handled decode ssl/tls packets.
tls_record_buffer, % binary() buffer of incomplete records
tls_handshake_buffer, % binary() buffer of incomplete handshakes
- %% {{md5_hash, sha_hash}, {prev_md5, prev_sha}} (binary())
- tls_handshake_hashes, % see above
+ tls_handshake_history, % tls_handshake_history()
tls_cipher_texts, % list() received but not deciphered yet
cert_db, %
session, % #session{} from ssl_handshake.hrl
@@ -77,21 +77,24 @@
supported_protocol_versions, % [atom()]
client_certificate_requested = false,
key_algorithm, % atom as defined by cipher_suite
+ hashsign_algorithm, % atom as defined by cipher_suite
public_key_info, % PKIX: {Algorithm, PublicKey, PublicKeyParams}
private_key, % PKIX: #'RSAPrivateKey'{}
diffie_hellman_params, % PKIX: #'DHParameter'{} relevant for server side
diffie_hellman_keys, % {PublicKey, PrivateKey}
premaster_secret, %
- cert_db_ref, % ets_table()
- from, % term(), where to reply
+ file_ref_db, % ets()
+ cert_db_ref, % ref()
bytes_to_read, % integer(), # bytes to read in passive mode
user_data_buffer, % binary()
log_alert, % boolean()
renegotiation, % {boolean(), From | internal | peer}
- recv_from, %
+ start_or_recv_from, % "gen_fsm From"
send_queue, % queue()
terminated = false, %
- allow_renegotiate = true
+ allow_renegotiate = true,
+ expecting_next_protocol_negotiation = false :: boolean(),
+ next_protocol = undefined :: undefined | binary()
}).
-define(DEFAULT_DIFFIE_HELLMAN_PARAMS,
@@ -220,6 +223,13 @@ new_user(ConnectionPid, User) ->
sockname(ConnectionPid) ->
sync_send_all_state_event(ConnectionPid, sockname).
%%--------------------------------------------------------------------
+-spec negotiated_next_protocol(pid()) -> {ok, binary()} | {error, reason()}.
+%%
+%% Description: Returns the negotiated protocol
+%%--------------------------------------------------------------------
+negotiated_next_protocol(ConnectionPid) ->
+ sync_send_all_state_event(ConnectionPid, negotiated_next_protocol).
+%%--------------------------------------------------------------------
-spec peername(pid()) -> {ok, {inet:ip_address(), inet:port_number()}} | {error, reason()}.
%%
%% Description: Same as inet:peername/1
@@ -273,6 +283,16 @@ peer_certificate(ConnectionPid) ->
renegotiation(ConnectionPid) ->
sync_send_all_state_event(ConnectionPid, renegotiate).
+%%--------------------------------------------------------------------
+-spec prf(pid(), binary() | 'master_secret', binary(),
+ binary() | ssl:prf_random(), non_neg_integer()) ->
+ {ok, binary()} | {error, reason()} | {'EXIT', term()}.
+%%
+%% 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}).
+
%%====================================================================
%% ssl_connection_sup API
%%====================================================================
@@ -286,39 +306,31 @@ renegotiation(ConnectionPid) ->
%% does not return until Module:init/1 has returned.
%%--------------------------------------------------------------------
start_link(Role, Host, Port, Socket, Options, User, CbInfo) ->
- gen_fsm:start_link(?MODULE, [Role, Host, Port, Socket, Options,
- User, CbInfo], []).
+ {ok, proc_lib:spawn_link(?MODULE, init, [[Role, Host, Port, Socket, Options, User, CbInfo]])}.
-%%====================================================================
-%% gen_fsm callbacks
-%%====================================================================
-%%--------------------------------------------------------------------
-%% Description:Whenever a gen_fsm is started using gen_fsm:start/[3,4] or
-%% gen_fsm:start_link/3,4, this function is called by the new process to
-%% initialize.
-%%--------------------------------------------------------------------
-init([Role, Host, Port, Socket, {SSLOpts0, _} = Options,
- User, CbInfo]) ->
+init([Role, Host, Port, Socket, {SSLOpts0, _} = Options, User, CbInfo]) ->
State0 = initial_state(Role, Host, Port, Socket, Options, User, CbInfo),
- Hashes0 = ssl_handshake:init_hashes(),
+ Handshake = ssl_handshake:init_handshake_history(),
TimeStamp = calendar:datetime_to_gregorian_seconds({date(), time()}),
try ssl_init(SSLOpts0, Role) of
- {ok, Ref, CertDbHandle, CacheHandle, OwnCert, Key, DHParams} ->
+ {ok, Ref, CertDbHandle, FileRefHandle, CacheHandle, OwnCert, Key, DHParams} ->
Session = State0#state.session,
- State = State0#state{tls_handshake_hashes = Hashes0,
+ 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,
session_cache = CacheHandle,
private_key = Key,
diffie_hellman_params = DHParams},
- {ok, hello, State, get_timeout(State)}
- catch
+ gen_fsm:enter_loop(?MODULE, [], hello, State, get_timeout(State))
+ catch
throw:Error ->
- {stop, Error}
+ gen_fsm:enter_loop(?MODULE, [], error, {Error,State0}, get_timeout(State0))
end.
-
+
%%--------------------------------------------------------------------
%% Description:There should be one instance of this function for each
%% possible state name. Whenever a gen_fsm receives an event sent
@@ -326,6 +338,7 @@ init([Role, Host, Port, Socket, {SSLOpts0, _} = Options,
%% same name as the current state name StateName is called to handle
%% the event. It is also called if a timeout occurs.
%%
+
%%--------------------------------------------------------------------
-spec hello(start | #hello_request{} | #client_hello{} | #server_hello{} | term(),
#state{}) -> gen_fsm_state_return().
@@ -333,23 +346,23 @@ init([Role, Host, Port, Socket, {SSLOpts0, _} = Options,
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 = ConnectionStates,
+ connection_states = ConnectionStates0,
renegotiation = {Renegotiation, _}} = State0) ->
- Hello = ssl_handshake:client_hello(Host, Port,
- ConnectionStates,
- SslOpts, Renegotiation, Cert),
+ Hello = ssl_handshake:client_hello(Host, Port, ConnectionStates0, SslOpts,
+ Cache, CacheCb, Renegotiation, Cert),
Version = Hello#client_hello.client_version,
- Hashes0 = ssl_handshake:init_hashes(),
- {BinMsg, CS2, Hashes1} =
- encode_handshake(Hello, Version, ConnectionStates, Hashes0),
+ Handshake0 = ssl_handshake:init_handshake_history(),
+ {BinMsg, ConnectionStates, Handshake} =
+ encode_handshake(Hello, Version, ConnectionStates0, Handshake0),
Transport:send(Socket, BinMsg),
- State1 = State0#state{connection_states = CS2,
- negotiated_version = Version, %% Requested version
+ State1 = State0#state{connection_states = ConnectionStates,
+ negotiated_version = Version, %% Requested version
session =
Session0#session{session_id = Hello#client_hello.session_id},
- tls_handshake_hashes = Hashes1},
+ tls_handshake_history = Handshake},
{Record, State} = next_record(State1),
next_state(hello, hello, Record, State);
@@ -370,29 +383,41 @@ hello(#server_hello{cipher_suite = CipherSuite,
renegotiation = {Renegotiation, _},
ssl_options = SslOptions} = State0) ->
case ssl_handshake:hello(Hello, SslOptions, ConnectionStates0, Renegotiation) of
- {Version, NewId, ConnectionStates} ->
- {KeyAlgorithm, _, _} =
+ #alert{} = Alert ->
+ handle_own_alert(Alert, ReqVersion, hello, State0),
+ {stop, normal, State0};
+
+ {Version, NewId, ConnectionStates, NextProtocol} ->
+ {KeyAlgorithm, _, _, _} =
ssl_cipher:suite_definition(CipherSuite),
-
+
PremasterSecret = make_premaster_secret(ReqVersion, KeyAlgorithm),
-
+
+ NewNextProtocol = case NextProtocol of
+ undefined ->
+ State0#state.next_protocol;
+ _ ->
+ NextProtocol
+ end,
+
State = State0#state{key_algorithm = KeyAlgorithm,
+ hashsign_algorithm = default_hashsign(Version, KeyAlgorithm),
negotiated_version = Version,
connection_states = ConnectionStates,
- premaster_secret = PremasterSecret},
-
+ premaster_secret = PremasterSecret,
+ expecting_next_protocol_negotiation = NextProtocol =/= undefined,
+ next_protocol = NewNextProtocol},
+
case ssl_session:is_new(OldId, NewId) of
true ->
- handle_new_session(NewId, CipherSuite, Compression, State);
+ handle_new_session(NewId, CipherSuite, Compression,
+ State#state{connection_states = ConnectionStates});
false ->
- handle_resumed_session(NewId, State#state{connection_states = ConnectionStates})
- end;
- #alert{} = Alert ->
- handle_own_alert(Alert, ReqVersion, hello, State0),
- {stop, normal, State0}
+ handle_resumed_session(NewId, State#state{connection_states = ConnectionStates})
+ end
end;
-hello(Hello = #client_hello{client_version = ClientVersion},
+hello(Hello = #client_hello{client_version = ClientVersion},
State = #state{connection_states = ConnectionStates0,
port = Port, session = #session{own_certificate = Cert} = Session0,
renegotiation = {Renegotiation, _},
@@ -401,8 +426,8 @@ hello(Hello = #client_hello{client_version = ClientVersion},
ssl_options = SslOpts}) ->
case ssl_handshake:hello(Hello, SslOpts, {Port, Session0, Cache, CacheCb,
ConnectionStates0, Cert}, Renegotiation) of
- {Version, {Type, Session}, ConnectionStates} ->
- do_server_hello(Type, State#state{connection_states =
+ {Version, {Type, Session}, ConnectionStates, ProtocolsToAdvertise} ->
+ do_server_hello(Type, ProtocolsToAdvertise, State#state{connection_states =
ConnectionStates,
negotiated_version = Version,
session = Session});
@@ -427,12 +452,13 @@ abbreviated(#hello_request{}, State0) ->
abbreviated(#finished{verify_data = Data} = Finished,
#state{role = server,
negotiated_version = Version,
- tls_handshake_hashes = Hashes,
+ tls_handshake_history = Handshake,
session = #session{master_secret = MasterSecret},
connection_states = ConnectionStates0} =
State) ->
case ssl_handshake:verify_connection(Version, Finished, client,
- MasterSecret, Hashes) of
+ get_current_connection_state_prf(ConnectionStates0, write),
+ MasterSecret, Handshake) of
verified ->
ConnectionStates = ssl_record:set_client_verify_data(current_both, Data, ConnectionStates0),
next_state_connection(abbreviated,
@@ -443,18 +469,19 @@ abbreviated(#finished{verify_data = Data} = Finished,
end;
abbreviated(#finished{verify_data = Data} = Finished,
- #state{role = client, tls_handshake_hashes = Hashes0,
+ #state{role = client, tls_handshake_history = Handshake0,
session = #session{master_secret = MasterSecret},
negotiated_version = Version,
connection_states = ConnectionStates0} = State) ->
case ssl_handshake:verify_connection(Version, Finished, server,
- MasterSecret, Hashes0) of
+ get_pending_connection_state_prf(ConnectionStates0, write),
+ MasterSecret, Handshake0) of
verified ->
ConnectionStates1 = ssl_record:set_server_verify_data(current_read, Data, ConnectionStates0),
- {ConnectionStates, Hashes} =
+ {ConnectionStates, Handshake} =
finalize_handshake(State#state{connection_states = ConnectionStates1}, abbreviated),
next_state_connection(abbreviated,
- ack_connection(State#state{tls_handshake_hashes = Hashes,
+ ack_connection(State#state{tls_handshake_history = Handshake,
connection_states =
ConnectionStates}));
#alert{} = Alert ->
@@ -541,8 +568,8 @@ certify(#server_hello_done{},
role = client} = State0) ->
case ssl_handshake:master_secret(Version, Session,
ConnectionStates0, client) of
- {MasterSecret, ConnectionStates1} ->
- State = State0#state{connection_states = ConnectionStates1},
+ {MasterSecret, ConnectionStates} ->
+ State = State0#state{connection_states = ConnectionStates},
client_certify_and_key_exchange(State);
#alert{} = Alert ->
handle_own_alert(Alert, Version, certify, State0),
@@ -558,10 +585,10 @@ certify(#server_hello_done{},
role = client} = State0) ->
case ssl_handshake:master_secret(Version, PremasterSecret,
ConnectionStates0, client) of
- {MasterSecret, ConnectionStates1} ->
+ {MasterSecret, ConnectionStates} ->
Session = Session0#session{master_secret = MasterSecret},
- State = State0#state{connection_states = ConnectionStates1,
- session = Session},
+ State = State0#state{connection_states = ConnectionStates,
+ session = Session},
client_certify_and_key_exchange(State);
#alert{} = Alert ->
handle_own_alert(Alert, Version, certify, State0),
@@ -585,6 +612,7 @@ certify(#client_key_exchange{exchange_keys = Keys},
{stop, normal, State}
end;
+
certify(timeout, State) ->
{ next_state, certify, State, hibernate };
@@ -632,15 +660,20 @@ cipher(#hello_request{}, State0) ->
{Record, State} = next_record(State0),
next_state(cipher, hello, Record, State);
-cipher(#certificate_verify{signature = Signature},
+cipher(#certificate_verify{signature = Signature, hashsign_algorithm = CertHashSign},
#state{role = server,
public_key_info = PublicKeyInfo,
negotiated_version = Version,
session = #session{master_secret = MasterSecret},
- tls_handshake_hashes = Hashes
+ hashsign_algorithm = ConnectionHashSign,
+ tls_handshake_history = Handshake
} = State0) ->
+ HashSign = case CertHashSign of
+ {_, _} -> CertHashSign;
+ _ -> ConnectionHashSign
+ end,
case ssl_handshake:certificate_verify(Signature, PublicKeyInfo,
- Version, MasterSecret, Hashes) of
+ Version, HashSign, MasterSecret, Handshake) of
valid ->
{Record, State} = next_record(State0),
next_state(cipher, cipher, Record, State);
@@ -649,6 +682,12 @@ cipher(#certificate_verify{signature = Signature},
{stop, normal, State0}
end;
+% client must send a next protocol message if we are expecting it
+cipher(#finished{}, #state{role = server, expecting_next_protocol_negotiation = true,
+ next_protocol = undefined, negotiated_version = Version} = State0) ->
+ handle_own_alert(?ALERT_REC(?FATAL,?UNEXPECTED_MESSAGE), Version, cipher, State0),
+ {stop, normal, State0};
+
cipher(#finished{verify_data = Data} = Finished,
#state{negotiated_version = Version,
host = Host,
@@ -656,10 +695,12 @@ cipher(#finished{verify_data = Data} = Finished,
role = Role,
session = #session{master_secret = MasterSecret}
= Session0,
- tls_handshake_hashes = Hashes0} = State) ->
+ connection_states = ConnectionStates0,
+ tls_handshake_history = Handshake0} = State) ->
case ssl_handshake:verify_connection(Version, Finished,
opposite_role(Role),
- MasterSecret, Hashes0) of
+ get_current_connection_state_prf(ConnectionStates0, read),
+ MasterSecret, Handshake0) of
verified ->
Session = register_session(Role, Host, Port, Session0),
cipher_role(Role, Data, Session, State);
@@ -668,6 +709,13 @@ cipher(#finished{verify_data = Data} = Finished,
{stop, normal, 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},
+ #state{role = server, expecting_next_protocol_negotiation = true} = State0) ->
+ {Record, State} = next_record(State0#state{next_protocol = SelectedProtocol}),
+ next_state(cipher, cipher, Record, State);
+
cipher(timeout, State) ->
{ next_state, cipher, State, hibernate };
@@ -680,22 +728,24 @@ cipher(Msg, State) ->
%%--------------------------------------------------------------------
connection(#hello_request{}, #state{host = Host, port = Port,
socket = Socket,
- session = #session{own_certificate = Cert},
+ session = #session{own_certificate = Cert} = Session0,
+ session_cache = Cache, session_cache_cb = CacheCb,
ssl_options = SslOpts,
negotiated_version = Version,
transport_cb = Transport,
connection_states = ConnectionStates0,
renegotiation = {Renegotiation, _},
- tls_handshake_hashes = Hashes0} = State0) ->
- Hello = ssl_handshake:client_hello(Host, Port, ConnectionStates0,
- SslOpts, Renegotiation, Cert),
+ tls_handshake_history = Handshake0} = State0) ->
+ Hello = ssl_handshake:client_hello(Host, Port, ConnectionStates0, SslOpts,
+ Cache, CacheCb, Renegotiation, Cert),
- {BinMsg, ConnectionStates1, Hashes1} =
- encode_handshake(Hello, Version, ConnectionStates0, Hashes0),
+ {BinMsg, ConnectionStates, Handshake} =
+ encode_handshake(Hello, Version, ConnectionStates0, Handshake0),
Transport:send(Socket, BinMsg),
{Record, State} = next_record(State0#state{connection_states =
- ConnectionStates1,
- tls_handshake_hashes = Hashes1}),
+ ConnectionStates,
+ session = Session0#session{session_id = Hello#client_hello.session_id},
+ tls_handshake_history = Handshake}),
next_state(connection, hello, Record, State);
connection(#client_hello{} = Hello, #state{role = server, allow_renegotiate = true} = State) ->
%% Mitigate Computational DoS attack
@@ -721,6 +771,7 @@ connection(timeout, State) ->
connection(Msg, State) ->
handle_unexpected_message(Msg, connection, State).
+
%%--------------------------------------------------------------------
%% Description: Whenever a gen_fsm receives an event sent using
%% gen_fsm:send_all_state_event/2, this function is called to handle
@@ -750,8 +801,8 @@ handle_sync_event({application_data, Data}, From, StateName,
State#state{send_queue = queue:in({From, Data}, Queue)},
get_timeout(State)};
-handle_sync_event(start, From, hello, State) ->
- hello(start, State#state{from = From});
+handle_sync_event(start, StartFrom, hello, State) ->
+ hello(start, State#state{start_or_recv_from = StartFrom});
%% The two clauses below could happen if a server upgrades a socket in
%% active mode. Note that in this case we are lucky that
@@ -763,8 +814,10 @@ handle_sync_event(start, From, hello, State) ->
%% they upgrade a active socket.
handle_sync_event(start, _, connection, State) ->
{reply, connected, connection, State, get_timeout(State)};
-handle_sync_event(start, From, StateName, State) ->
- {next_state, StateName, State#state{from = From}, get_timeout(State)};
+handle_sync_event(start, _From, error, {Error, State = #state{}}) ->
+ {stop, {shutdown, Error}, {error, Error}, State};
+handle_sync_event(start, StartFrom, StateName, State) ->
+ {next_state, StateName, State#state{start_or_recv_from = StartFrom}, get_timeout(State)};
handle_sync_event(close, _, StateName, State) ->
%% Run terminate before returning
@@ -795,13 +848,13 @@ handle_sync_event({shutdown, How0}, _, StateName,
{stop, normal, Error, State}
end;
-handle_sync_event({recv, N}, From, connection = StateName, State0) ->
- passive_receive(State0#state{bytes_to_read = N, recv_from = From}, StateName);
+handle_sync_event({recv, N}, RecvFrom, connection = StateName, State0) ->
+ passive_receive(State0#state{bytes_to_read = N, start_or_recv_from = RecvFrom}, 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}, From, StateName, State) ->
- {next_state, StateName, State#state{bytes_to_read = N, recv_from = From},
+handle_sync_event({recv, N}, RecvFrom, StateName, State) ->
+ {next_state, StateName, State#state{bytes_to_read = N, start_or_recv_from = RecvFrom},
get_timeout(State)};
handle_sync_event({new_user, User}, _From, StateName,
@@ -822,6 +875,10 @@ handle_sync_event(sockname, _From, StateName,
SockNameReply = inet:sockname(Socket),
{reply, SockNameReply, StateName, State, get_timeout(State)};
+handle_sync_event(negotiated_next_protocol, _From, StateName, #state{next_protocol = undefined} = State) ->
+ {reply, {error, next_protocol_not_negotiated}, StateName, State, get_timeout(State)};
+handle_sync_event(negotiated_next_protocol, _From, StateName, #state{next_protocol = NextProtocol} = State) ->
+ {reply, {ok, NextProtocol}, StateName, State, get_timeout(State)};
handle_sync_event(peername, _From, StateName,
#state{socket = Socket} = State) ->
PeerNameReply = inet:peername(Socket),
@@ -868,19 +925,45 @@ handle_sync_event(renegotiate, From, connection, State) ->
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) ->
+ 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,
+ Reply = try
+ SecretToUse = case Secret of
+ _ when is_binary(Secret) -> Secret;
+ master_secret -> MasterSecret
+ end,
+ SeedToUse = lists:reverse(
+ lists:foldl(fun(X, Acc) when is_binary(X) -> [X|Acc];
+ (client_random, Acc) -> [ClientRandom|Acc];
+ (server_random, Acc) -> [ServerRandom|Acc]
+ end, [], Seed)),
+ ssl_handshake:prf(Version, SecretToUse, Label, SeedToUse, WantedLength)
+ catch
+ exit:_ -> {error, badarg};
+ error:Reason -> {error, Reason}
+ end,
+ {reply, Reply, StateName, State, get_timeout(State)};
+
handle_sync_event(info, _, StateName,
#state{negotiated_version = Version,
session = #session{cipher_suite = Suite}} = State) ->
AtomVersion = ssl_record:protocol_version(Version),
- {reply, {ok, {AtomVersion, ssl_cipher:suite_definition(Suite)}},
+ {reply, {ok, {AtomVersion, ssl:suite_definition(Suite)}},
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:suite_definition(Suite)}],
+ {cipher_suite, ssl:suite_definition(Suite)}],
StateName, State, get_timeout(State)};
handle_sync_event(peer_certificate, _, StateName,
@@ -926,9 +1009,9 @@ handle_info({CloseTag, Socket}, StateName,
{stop, normal, State};
handle_info({ErrorTag, Socket, econnaborted}, StateName,
- #state{socket = Socket, from = User, role = Role,
+ #state{socket = Socket, start_or_recv_from = StartFrom, role = Role,
error_tag = ErrorTag} = State) when StateName =/= connection ->
- alert_user(User, ?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE), Role),
+ alert_user(StartFrom, ?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE), Role),
{stop, normal, State};
handle_info({ErrorTag, Socket, Reason}, StateName, #state{socket = Socket,
@@ -965,16 +1048,19 @@ terminate(Reason, connection, #state{negotiated_version = Version,
connection_states = ConnectionStates,
transport_cb = Transport,
socket = Socket, send_queue = SendQueue,
- renegotiation = Renegotiate}) ->
+ renegotiation = Renegotiate} = State) ->
+ handle_trusted_certs_db(State),
notify_senders(SendQueue),
notify_renegotiater(Renegotiate),
BinAlert = terminate_alert(Reason, Version, ConnectionStates),
Transport:send(Socket, BinAlert),
workaround_transport_delivery_problems(Socket, Transport, Reason),
Transport:close(Socket);
+
terminate(Reason, _StateName, #state{transport_cb = Transport,
socket = Socket, send_queue = SendQueue,
- renegotiation = Renegotiate}) ->
+ renegotiation = Renegotiate} = State) ->
+ handle_trusted_certs_db(State),
notify_senders(SendQueue),
notify_renegotiater(Renegotiate),
workaround_transport_delivery_problems(Socket, Transport, Reason),
@@ -1022,12 +1108,12 @@ ssl_init(SslOpts, Role) ->
init_manager_name(SslOpts#ssl_options.erl_dist),
- {ok, CertDbRef, CertDbHandle, CacheHandle, OwnCert} = init_certificates(SslOpts, Role),
+ {ok, CertDbRef, CertDbHandle, FileRefHandle, PemCacheHandle, CacheHandle, OwnCert} = init_certificates(SslOpts, Role),
PrivateKey =
- init_private_key(CertDbHandle, SslOpts#ssl_options.key, SslOpts#ssl_options.keyfile,
+ init_private_key(PemCacheHandle, SslOpts#ssl_options.key, SslOpts#ssl_options.keyfile,
SslOpts#ssl_options.password, Role),
- DHParams = init_diffie_hellman(CertDbHandle, SslOpts#ssl_options.dh, SslOpts#ssl_options.dhfile, Role),
- {ok, CertDbRef, CertDbHandle, CacheHandle, OwnCert, PrivateKey, DHParams}.
+ DHParams = init_diffie_hellman(PemCacheHandle, SslOpts#ssl_options.dh, SslOpts#ssl_options.dhfile, Role),
+ {ok, CertDbRef, CertDbHandle, FileRefHandle, CacheHandle, OwnCert, PrivateKey, DHParams}.
init_manager_name(false) ->
put(ssl_manager, ssl_manager);
@@ -1038,7 +1124,7 @@ init_certificates(#ssl_options{cacerts = CaCerts,
cacertfile = CACertFile,
certfile = CertFile,
cert = Cert}, Role) ->
- {ok, CertDbRef, CertDbHandle, CacheHandle} =
+ {ok, CertDbRef, CertDbHandle, FileRefHandle, PemCacheHandle, CacheHandle} =
try
Certs = case CaCerts of
undefined ->
@@ -1046,38 +1132,38 @@ init_certificates(#ssl_options{cacerts = CaCerts,
_ ->
{der, CaCerts}
end,
- {ok, _, _, _} = ssl_manager:connection_init(Certs, Role)
+ {ok, _, _, _, _, _} = ssl_manager:connection_init(Certs, Role)
catch
Error:Reason ->
handle_file_error(?LINE, Error, Reason, CACertFile, ecacertfile,
erlang:get_stacktrace())
end,
- init_certificates(Cert, CertDbRef, CertDbHandle, CacheHandle, CertFile, Role).
+ init_certificates(Cert, CertDbRef, CertDbHandle, FileRefHandle, PemCacheHandle, CacheHandle, CertFile, Role).
-init_certificates(undefined, CertDbRef, CertDbHandle, CacheHandle, "", _) ->
- {ok, CertDbRef, CertDbHandle, CacheHandle, undefined};
+init_certificates(undefined, CertDbRef, CertDbHandle, FileRefHandle, PemCacheHandle, CacheHandle, <<>>, _) ->
+ {ok, CertDbRef, CertDbHandle, FileRefHandle, PemCacheHandle, CacheHandle, undefined};
-init_certificates(undefined, CertDbRef, CertDbHandle, CacheHandle, CertFile, client) ->
+init_certificates(undefined, CertDbRef, CertDbHandle, FileRefHandle, PemCacheHandle, CacheHandle, CertFile, client) ->
try
- [OwnCert] = ssl_certificate:file_to_certificats(CertFile, CertDbHandle),
- {ok, CertDbRef, CertDbHandle, CacheHandle, OwnCert}
+ [OwnCert] = ssl_certificate:file_to_certificats(CertFile, PemCacheHandle),
+ {ok, CertDbRef, CertDbHandle, FileRefHandle, PemCacheHandle, CacheHandle, OwnCert}
catch _Error:_Reason ->
- {ok, CertDbRef, CertDbHandle, CacheHandle, undefined}
+ {ok, CertDbRef, CertDbHandle, FileRefHandle, PemCacheHandle, CacheHandle, undefined}
end;
-init_certificates(undefined, CertDbRef, CertDbHandle, CacheRef, CertFile, server) ->
+init_certificates(undefined, CertDbRef, CertDbHandle, FileRefHandle, PemCacheHandle, CacheRef, CertFile, server) ->
try
- [OwnCert] = ssl_certificate:file_to_certificats(CertFile, CertDbHandle),
- {ok, CertDbRef, CertDbHandle, CacheRef, OwnCert}
+ [OwnCert] = ssl_certificate:file_to_certificats(CertFile, PemCacheHandle),
+ {ok, CertDbRef, CertDbHandle, FileRefHandle, PemCacheHandle, CacheRef, OwnCert}
catch
Error:Reason ->
handle_file_error(?LINE, Error, Reason, CertFile, ecertfile,
erlang:get_stacktrace())
end;
-init_certificates(Cert, CertDbRef, CertDbHandle, CacheRef, _, _) ->
- {ok, CertDbRef, CertDbHandle, CacheRef, Cert}.
+init_certificates(Cert, CertDbRef, CertDbHandle, FileRefHandle, PemCacheHandle, CacheRef, _, _) ->
+ {ok, CertDbRef, CertDbHandle, FileRefHandle, PemCacheHandle, CacheRef, Cert}.
-init_private_key(_, undefined, "", _Password, _Client) ->
+init_private_key(_, undefined, <<>>, _Password, _Client) ->
undefined;
init_private_key(DbHandle, undefined, KeyFile, Password, _) ->
try
@@ -1186,13 +1272,13 @@ certify_client(#state{client_certificate_requested = true, role = client,
cert_db_ref = CertDbRef,
session = #session{own_certificate = OwnCert},
socket = Socket,
- tls_handshake_hashes = Hashes0} = State) ->
+ tls_handshake_history = Handshake0} = State) ->
Certificate = ssl_handshake:certificate(OwnCert, CertDbHandle, CertDbRef, client),
- {BinCert, ConnectionStates1, Hashes1} =
- encode_handshake(Certificate, Version, ConnectionStates0, Hashes0),
+ {BinCert, ConnectionStates, Handshake} =
+ encode_handshake(Certificate, Version, ConnectionStates0, Handshake0),
Transport:send(Socket, BinCert),
- State#state{connection_states = ConnectionStates1,
- tls_handshake_hashes = Hashes1};
+ State#state{connection_states = ConnectionStates,
+ tls_handshake_history = Handshake};
certify_client(#state{client_certificate_requested = false} = State) ->
State.
@@ -1204,17 +1290,19 @@ verify_client_cert(#state{client_certificate_requested = true, role = client,
private_key = PrivateKey,
session = #session{master_secret = MasterSecret,
own_certificate = OwnCert},
- tls_handshake_hashes = Hashes0} = State) ->
+ hashsign_algorithm = HashSign,
+ tls_handshake_history = Handshake0} = State) ->
+ %%TODO: for TLS 1.2 we can choose a different/stronger HashSign combination for this.
case ssl_handshake:client_certificate_verify(OwnCert, MasterSecret,
- Version, PrivateKey, Hashes0) of
+ Version, HashSign, PrivateKey, Handshake0) of
#certificate_verify{} = Verified ->
- {BinVerified, ConnectionStates1, Hashes1} =
+ {BinVerified, ConnectionStates, Handshake} =
encode_handshake(Verified, Version,
- ConnectionStates0, Hashes0),
+ ConnectionStates0, Handshake0),
Transport:send(Socket, BinVerified),
- State#state{connection_states = ConnectionStates1,
- tls_handshake_hashes = Hashes1};
+ State#state{connection_states = ConnectionStates,
+ tls_handshake_history = Handshake};
ignore ->
State;
#alert{} = Alert ->
@@ -1223,38 +1311,23 @@ verify_client_cert(#state{client_certificate_requested = true, role = client,
verify_client_cert(#state{client_certificate_requested = false} = State) ->
State.
-do_server_hello(Type, #state{negotiated_version = Version,
- session = #session{session_id = SessId} = Session,
- connection_states = ConnectionStates0,
- renegotiation = {Renegotiation, _}}
- = State0) when is_atom(Type) ->
+do_server_hello(Type, NextProtocolsToSend, #state{negotiated_version = Version,
+ session = #session{session_id = SessId},
+ connection_states = ConnectionStates0,
+ renegotiation = {Renegotiation, _}}
+ = State0) when is_atom(Type) ->
ServerHello =
ssl_handshake:server_hello(SessId, Version,
- ConnectionStates0, Renegotiation),
- State1 = server_hello(ServerHello, State0),
-
+ ConnectionStates0, Renegotiation, NextProtocolsToSend),
+ State = server_hello(ServerHello,
+ State0#state{expecting_next_protocol_negotiation =
+ NextProtocolsToSend =/= undefined}),
case Type of
new ->
- new_server_hello(ServerHello, State1);
+ new_server_hello(ServerHello, State);
resumed ->
- ConnectionStates1 = State1#state.connection_states,
- case ssl_handshake:master_secret(Version, Session,
- ConnectionStates1, server) of
- {_, ConnectionStates2} ->
- State2 = State1#state{connection_states=ConnectionStates2,
- session = Session},
- {ConnectionStates, Hashes} =
- finalize_handshake(State2, abbreviated),
- State3 = State2#state{connection_states =
- ConnectionStates,
- tls_handshake_hashes = Hashes},
- {Record, State} = next_record(State3),
- next_state(hello, abbreviated, Record, State);
- #alert{} = Alert ->
- handle_own_alert(Alert, Version, hello, State1),
- {stop, normal, State1}
- end
+ resumed_server_hello(State)
end.
new_server_hello(#server_hello{cipher_suite = CipherSuite,
@@ -1277,6 +1350,27 @@ new_server_hello(#server_hello{cipher_suite = CipherSuite,
{stop, normal, State0}
end.
+resumed_server_hello(#state{session = Session,
+ connection_states = ConnectionStates0,
+ negotiated_version = Version} = State0) ->
+
+ case ssl_handshake:master_secret(Version, Session,
+ ConnectionStates0, server) of
+ {_, ConnectionStates1} ->
+ State1 = State0#state{connection_states = ConnectionStates1,
+ session = Session},
+ {ConnectionStates, Handshake} =
+ finalize_handshake(State1, abbreviated),
+ State2 = State1#state{connection_states =
+ ConnectionStates,
+ tls_handshake_history = Handshake},
+ {Record, State} = next_record(State2),
+ next_state(hello, abbreviated, Record, State);
+ #alert{} = Alert ->
+ handle_own_alert(Alert, Version, hello, State0),
+ {stop, normal, State0}
+ end.
+
handle_new_session(NewId, CipherSuite, Compression, #state{session = Session0} = State0) ->
Session = Session0#session{session_id = NewId,
cipher_suite = CipherSuite,
@@ -1292,10 +1386,10 @@ handle_resumed_session(SessId, #state{connection_states = ConnectionStates0,
Session = CacheCb:lookup(Cache, {{Host, Port}, SessId}),
case ssl_handshake:master_secret(Version, Session,
ConnectionStates0, client) of
- {_, ConnectionStates1} ->
+ {_, ConnectionStates} ->
{Record, State} =
next_record(State0#state{
- connection_states = ConnectionStates1,
+ connection_states = ConnectionStates,
session = Session}),
next_state(hello, abbreviated, Record, State);
#alert{} = Alert ->
@@ -1308,11 +1402,11 @@ client_certify_and_key_exchange(#state{negotiated_version = Version} =
State0) ->
try do_client_certify_and_key_exchange(State0) of
State1 = #state{} ->
- {ConnectionStates, Hashes} = finalize_handshake(State1, certify),
+ {ConnectionStates, Handshake} = finalize_handshake(State1, certify),
State2 = State1#state{connection_states = ConnectionStates,
%% Reinitialize
client_certificate_requested = false,
- tls_handshake_hashes = Hashes},
+ tls_handshake_history = Handshake},
{Record, State} = next_record(State2),
next_state(certify, cipher, Record, State)
catch
@@ -1335,29 +1429,30 @@ server_hello(ServerHello, #state{transport_cb = Transport,
socket = Socket,
negotiated_version = Version,
connection_states = ConnectionStates0,
- tls_handshake_hashes = Hashes0} = State) ->
+ tls_handshake_history = Handshake0} = State) ->
CipherSuite = ServerHello#server_hello.cipher_suite,
- {KeyAlgorithm, _, _} = ssl_cipher:suite_definition(CipherSuite),
- {BinMsg, ConnectionStates1, Hashes1} =
- encode_handshake(ServerHello, Version, ConnectionStates0, Hashes0),
+ {KeyAlgorithm, _, _, _} = ssl_cipher:suite_definition(CipherSuite),
+ {BinMsg, ConnectionStates1, Handshake1} =
+ encode_handshake(ServerHello, Version, ConnectionStates0, Handshake0),
Transport:send(Socket, BinMsg),
State#state{connection_states = ConnectionStates1,
- tls_handshake_hashes = Hashes1,
- key_algorithm = KeyAlgorithm}.
+ tls_handshake_history = Handshake1,
+ key_algorithm = KeyAlgorithm,
+ hashsign_algorithm = default_hashsign(Version, KeyAlgorithm)}.
server_hello_done(#state{transport_cb = Transport,
socket = Socket,
negotiated_version = Version,
- connection_states = ConnectionStates,
- tls_handshake_hashes = Hashes} = State) ->
+ connection_states = ConnectionStates0,
+ tls_handshake_history = Handshake0} = State) ->
HelloDone = ssl_handshake:server_hello_done(),
- {BinHelloDone, NewConnectionStates, NewHashes} =
- encode_handshake(HelloDone, Version, ConnectionStates, Hashes),
+ {BinHelloDone, ConnectionStates, Handshake} =
+ encode_handshake(HelloDone, Version, ConnectionStates0, Handshake0),
Transport:send(Socket, BinHelloDone),
- State#state{connection_states = NewConnectionStates,
- tls_handshake_hashes = NewHashes}.
+ State#state{connection_states = ConnectionStates,
+ tls_handshake_history = Handshake}.
certify_server(#state{key_algorithm = dh_anon} = State) ->
State;
@@ -1365,18 +1460,18 @@ certify_server(#state{key_algorithm = dh_anon} = State) ->
certify_server(#state{transport_cb = Transport,
socket = Socket,
negotiated_version = Version,
- connection_states = ConnectionStates,
- tls_handshake_hashes = Hashes,
+ connection_states = ConnectionStates0,
+ tls_handshake_history = Handshake0,
cert_db = CertDbHandle,
cert_db_ref = CertDbRef,
session = #session{own_certificate = OwnCert}} = State) ->
case ssl_handshake:certificate(OwnCert, CertDbHandle, CertDbRef, server) of
CertMsg = #certificate{} ->
- {BinCertMsg, NewConnectionStates, NewHashes} =
- encode_handshake(CertMsg, Version, ConnectionStates, Hashes),
+ {BinCertMsg, ConnectionStates, Handshake} =
+ encode_handshake(CertMsg, Version, ConnectionStates0, Handshake0),
Transport:send(Socket, BinCertMsg),
- State#state{connection_states = NewConnectionStates,
- tls_handshake_hashes = NewHashes
+ State#state{connection_states = ConnectionStates,
+ tls_handshake_history = Handshake
};
Alert = #alert{} ->
throw(Alert)
@@ -1385,11 +1480,12 @@ certify_server(#state{transport_cb = Transport,
key_exchange(#state{role = server, key_algorithm = rsa} = State) ->
State;
key_exchange(#state{role = server, key_algorithm = Algo,
+ hashsign_algorithm = HashSignAlgo,
diffie_hellman_params = #'DHParameter'{prime = P, base = G} = Params,
private_key = PrivateKey,
connection_states = ConnectionStates0,
negotiated_version = Version,
- tls_handshake_hashes = Hashes0,
+ tls_handshake_history = Handshake0,
socket = Socket,
transport_cb = Transport
} = State)
@@ -1402,16 +1498,16 @@ key_exchange(#state{role = server, key_algorithm = Algo,
SecParams = ConnectionState#connection_state.security_parameters,
#security_parameters{client_random = ClientRandom,
server_random = ServerRandom} = SecParams,
- Msg = ssl_handshake:key_exchange(server, {dh, Keys, Params,
- Algo, ClientRandom,
+ Msg = ssl_handshake:key_exchange(server, Version, {dh, Keys, Params,
+ HashSignAlgo, ClientRandom,
ServerRandom,
PrivateKey}),
- {BinMsg, ConnectionStates, Hashes1} =
- encode_handshake(Msg, Version, ConnectionStates0, Hashes0),
+ {BinMsg, ConnectionStates, Handshake} =
+ encode_handshake(Msg, Version, ConnectionStates0, Handshake0),
Transport:send(Socket, BinMsg),
State#state{connection_states = ConnectionStates,
diffie_hellman_keys = Keys,
- tls_handshake_hashes = Hashes1};
+ tls_handshake_history = Handshake};
key_exchange(#state{role = client,
connection_states = ConnectionStates0,
@@ -1420,67 +1516,93 @@ key_exchange(#state{role = client,
negotiated_version = Version,
premaster_secret = PremasterSecret,
socket = Socket, transport_cb = Transport,
- tls_handshake_hashes = Hashes0} = State) ->
- Msg = rsa_key_exchange(PremasterSecret, PublicKeyInfo),
- {BinMsg, ConnectionStates1, Hashes1} =
- encode_handshake(Msg, Version, ConnectionStates0, Hashes0),
+ tls_handshake_history = Handshake0} = State) ->
+ Msg = rsa_key_exchange(Version, PremasterSecret, PublicKeyInfo),
+ {BinMsg, ConnectionStates, Handshake} =
+ encode_handshake(Msg, Version, ConnectionStates0, Handshake0),
Transport:send(Socket, BinMsg),
- State#state{connection_states = ConnectionStates1,
- tls_handshake_hashes = Hashes1};
+ State#state{connection_states = ConnectionStates,
+ tls_handshake_history = Handshake};
key_exchange(#state{role = client,
connection_states = ConnectionStates0,
key_algorithm = Algorithm,
negotiated_version = Version,
diffie_hellman_keys = {DhPubKey, _},
socket = Socket, transport_cb = Transport,
- tls_handshake_hashes = Hashes0} = State)
+ tls_handshake_history = Handshake0} = State)
when Algorithm == dhe_dss;
Algorithm == dhe_rsa;
Algorithm == dh_anon ->
- Msg = ssl_handshake:key_exchange(client, {dh, DhPubKey}),
- {BinMsg, ConnectionStates1, Hashes1} =
- encode_handshake(Msg, Version, ConnectionStates0, Hashes0),
+ Msg = ssl_handshake:key_exchange(client, Version, {dh, DhPubKey}),
+ {BinMsg, ConnectionStates, Handshake} =
+ encode_handshake(Msg, Version, ConnectionStates0, Handshake0),
Transport:send(Socket, BinMsg),
- State#state{connection_states = ConnectionStates1,
- tls_handshake_hashes = Hashes1}.
+ State#state{connection_states = ConnectionStates,
+ tls_handshake_history = Handshake}.
-rsa_key_exchange(PremasterSecret, PublicKeyInfo = {Algorithm, _, _})
+rsa_key_exchange(Version, PremasterSecret, PublicKeyInfo = {Algorithm, _, _})
when Algorithm == ?rsaEncryption;
Algorithm == ?md2WithRSAEncryption;
Algorithm == ?md5WithRSAEncryption;
- Algorithm == ?sha1WithRSAEncryption ->
- ssl_handshake:key_exchange(client,
+ Algorithm == ?sha1WithRSAEncryption;
+ Algorithm == ?sha224WithRSAEncryption;
+ Algorithm == ?sha256WithRSAEncryption;
+ Algorithm == ?sha384WithRSAEncryption;
+ Algorithm == ?sha512WithRSAEncryption
+ ->
+ ssl_handshake:key_exchange(client, Version,
{premaster_secret, PremasterSecret,
PublicKeyInfo});
-rsa_key_exchange(_, _) ->
+rsa_key_exchange(_, _, _) ->
throw (?ALERT_REC(?FATAL,?HANDSHAKE_FAILURE)).
request_client_cert(#state{ssl_options = #ssl_options{verify = verify_peer},
connection_states = ConnectionStates0,
cert_db = CertDbHandle,
cert_db_ref = CertDbRef,
- tls_handshake_hashes = Hashes0,
+ tls_handshake_history = Handshake0,
negotiated_version = Version,
socket = Socket,
transport_cb = Transport} = State) ->
Msg = ssl_handshake:certificate_request(ConnectionStates0, CertDbHandle, CertDbRef),
- {BinMsg, ConnectionStates1, Hashes1} =
- encode_handshake(Msg, Version, ConnectionStates0, Hashes0),
+ {BinMsg, ConnectionStates, Handshake} =
+ encode_handshake(Msg, Version, ConnectionStates0, Handshake0),
Transport:send(Socket, BinMsg),
State#state{client_certificate_requested = true,
- connection_states = ConnectionStates1,
- tls_handshake_hashes = Hashes1};
+ connection_states = ConnectionStates,
+ tls_handshake_history = Handshake};
request_client_cert(#state{ssl_options = #ssl_options{verify = verify_none}} =
State) ->
State.
finalize_handshake(State, StateName) ->
- ConnectionStates0 = cipher_protocol(State),
+ ConnectionStates0 = cipher_protocol(State),
+
ConnectionStates =
ssl_record:activate_pending_connection_state(ConnectionStates0,
write),
- finished(State#state{connection_states = ConnectionStates}, StateName).
-
+
+ State1 = State#state{connection_states = ConnectionStates},
+ State2 = next_protocol(State1),
+ finished(State2, StateName).
+
+next_protocol(#state{role = server} = State) ->
+ State;
+next_protocol(#state{next_protocol = undefined} = State) ->
+ State;
+next_protocol(#state{expecting_next_protocol_negotiation = false} = State) ->
+ State;
+next_protocol(#state{transport_cb = Transport, socket = Socket,
+ negotiated_version = Version,
+ next_protocol = NextProtocol,
+ connection_states = ConnectionStates0,
+ tls_handshake_history = Handshake0} = State) ->
+ NextProtocolMessage = ssl_handshake:next_protocol(NextProtocol),
+ {BinMsg, ConnectionStates, Handshake} = encode_handshake(NextProtocolMessage, Version, ConnectionStates0, Handshake0),
+ Transport:send(Socket, BinMsg),
+ State#state{connection_states = ConnectionStates,
+ tls_handshake_history = Handshake}.
+
cipher_protocol(#state{connection_states = ConnectionStates0,
socket = Socket,
negotiated_version = Version,
@@ -1495,14 +1617,16 @@ finished(#state{role = Role, socket = Socket, negotiated_version = Version,
transport_cb = Transport,
session = Session,
connection_states = ConnectionStates0,
- tls_handshake_hashes = Hashes0}, StateName) ->
+ tls_handshake_history = Handshake0}, StateName) ->
MasterSecret = Session#session.master_secret,
- Finished = ssl_handshake:finished(Version, Role, MasterSecret, Hashes0),
+ Finished = ssl_handshake:finished(Version, Role,
+ get_current_connection_state_prf(ConnectionStates0, write),
+ MasterSecret, Handshake0),
ConnectionStates1 = save_verify_data(Role, Finished, ConnectionStates0, StateName),
- {BinFinished, ConnectionStates, Hashes} =
- encode_handshake(Finished, Version, ConnectionStates1, Hashes0),
+ {BinFinished, ConnectionStates, Handshake} =
+ encode_handshake(Finished, Version, ConnectionStates1, Handshake0),
Transport:send(Socket, BinFinished),
- {ConnectionStates, Hashes}.
+ {ConnectionStates, Handshake}.
save_verify_data(client, #finished{verify_data = Data}, ConnectionStates, certify) ->
ssl_record:set_client_verify_data(current_write, Data, ConnectionStates);
@@ -1526,36 +1650,41 @@ handle_server_key(
#server_dh_params{dh_p = P,
dh_g = G,
dh_y = ServerPublicDhKey},
- signed_params = Signed},
- #state{public_key_info = PubKeyInfo,
- key_algorithm = KeyAlgo,
+ signed_params = Signed,
+ hashsign = HashSign},
+ #state{negotiated_version = Version,
+ public_key_info = PubKeyInfo,
connection_states = ConnectionStates} = State) ->
PLen = size(P),
GLen = size(G),
YLen = size(ServerPublicDhKey),
+ HashAlgo = connection_hash_algo(HashSign, State),
ConnectionState =
ssl_record:pending_connection_state(ConnectionStates, read),
SecParams = ConnectionState#connection_state.security_parameters,
#security_parameters{client_random = ClientRandom,
server_random = ServerRandom} = SecParams,
- Hash = ssl_handshake:server_key_exchange_hash(KeyAlgo,
+ Hash = ssl_handshake:server_key_exchange_hash(HashAlgo,
<<ClientRandom/binary,
ServerRandom/binary,
?UINT16(PLen), P/binary,
?UINT16(GLen), G/binary,
?UINT16(YLen),
ServerPublicDhKey/binary>>),
-
- case verify_dh_params(Signed, Hash, PubKeyInfo) of
+
+ case verify_dh_params(Version, Signed, Hash, HashAlgo, PubKeyInfo) of
true ->
dh_master_secret(P, G, ServerPublicDhKey, undefined, State);
false ->
?ALERT_REC(?FATAL, ?DECRYPT_ERROR)
end.
-verify_dh_params(Signed, Hashes, {?rsaEncryption, PubKey, _PubKeyParams}) ->
+verify_dh_params({3, Minor}, Signed, Hashes, HashAlgo, {?rsaEncryption, PubKey, _PubKeyParams})
+ when Minor >= 3 ->
+ public_key:verify({digest, Hashes}, HashAlgo, Signed, PubKey);
+verify_dh_params(_Version, Signed, Hashes, _HashAlgo, {?rsaEncryption, PubKey, _PubKeyParams}) ->
case public_key:decrypt_public(Signed, PubKey,
[{rsa_pad, rsa_pkcs1_padding}]) of
Hashes ->
@@ -1563,8 +1692,8 @@ verify_dh_params(Signed, Hashes, {?rsaEncryption, PubKey, _PubKeyParams}) ->
_ ->
false
end;
-verify_dh_params(Signed, Hash, {?'id-dsa', PublicKey, PublicKeyParams}) ->
- public_key:verify(Hash, none, Signed, {PublicKey, PublicKeyParams}).
+verify_dh_params(_Version, Signed, Hash, HashAlgo, {?'id-dsa', PublicKey, PublicKeyParams}) ->
+ public_key:verify({digest, Hash}, HashAlgo, Signed, {PublicKey, PublicKeyParams}).
dh_master_secret(Prime, Base, PublicDhKey, undefined, State) ->
PMpint = mpint_binary(Prime),
@@ -1598,26 +1727,26 @@ cipher_role(client, Data, Session, #state{connection_states = ConnectionStates0}
cipher_role(server, Data, Session, #state{connection_states = ConnectionStates0} = State) ->
ConnectionStates1 = ssl_record:set_client_verify_data(current_read, Data, ConnectionStates0),
- {ConnectionStates, Hashes} =
+ {ConnectionStates, Handshake} =
finalize_handshake(State#state{connection_states = ConnectionStates1,
session = Session}, cipher),
next_state_connection(cipher, ack_connection(State#state{connection_states =
ConnectionStates,
session = Session,
- tls_handshake_hashes =
- Hashes})).
+ tls_handshake_history =
+ Handshake})).
encode_alert(#alert{} = Alert, Version, ConnectionStates) ->
ssl_record:encode_alert_record(Alert, Version, ConnectionStates).
encode_change_cipher(#change_cipher_spec{}, Version, ConnectionStates) ->
ssl_record:encode_change_cipher_spec(Version, ConnectionStates).
-encode_handshake(HandshakeRec, Version, ConnectionStates0, Hashes0) ->
+encode_handshake(HandshakeRec, Version, ConnectionStates0, Handshake0) ->
Frag = ssl_handshake:encode_handshake(HandshakeRec, Version),
- Hashes1 = ssl_handshake:update_hashes(Hashes0, Frag),
+ Handshake1 = ssl_handshake:update_handshake_history(Handshake0, Frag),
{E, ConnectionStates1} =
ssl_record:encode_handshake(Frag, Version, ConnectionStates0),
- {E, ConnectionStates1, Hashes1}.
+ {E, ConnectionStates1, Handshake1}.
encode_packet(Data, #socket_options{packet=Packet}) ->
case Packet of
@@ -1660,7 +1789,7 @@ passive_receive(State0 = #state{user_data_buffer = Buffer}, StateName) ->
read_application_data(Data, #state{user_application = {_Mon, Pid},
socket_options = SOpts,
bytes_to_read = BytesToRead,
- recv_from = From,
+ start_or_recv_from = RecvFrom,
user_data_buffer = Buffer0} = State0) ->
Buffer1 = if
Buffer0 =:= <<>> -> Data;
@@ -1669,9 +1798,9 @@ read_application_data(Data, #state{user_application = {_Mon, Pid},
end,
case get_data(SOpts, BytesToRead, Buffer1) of
{ok, ClientData, Buffer} -> % Send data
- SocketOpt = deliver_app_data(SOpts, ClientData, Pid, From),
+ SocketOpt = deliver_app_data(SOpts, ClientData, Pid, RecvFrom),
State = State0#state{user_data_buffer = Buffer,
- recv_from = undefined,
+ start_or_recv_from = undefined,
bytes_to_read = 0,
socket_options = SocketOpt
},
@@ -1686,7 +1815,7 @@ read_application_data(Data, #state{user_application = {_Mon, Pid},
{more, Buffer} -> % no reply, we need more data
next_record(State0#state{user_data_buffer = Buffer});
{error,_Reason} -> %% Invalid packet in packet mode
- deliver_packet_error(SOpts, Buffer1, Pid, From),
+ deliver_packet_error(SOpts, Buffer1, Pid, RecvFrom),
{stop, normal, State0}
end.
@@ -1806,14 +1935,15 @@ format_reply(binary, _, N, Data) when N > 0 -> % Header mode
format_reply(binary, _, _, Data) ->
Data;
format_reply(list, Packet, _, Data)
- when Packet == http; Packet == {http, headers}; Packet == http_bin; Packet == {http_bin, headers}; Packet == httph;
- Packet == httph_bin->
+ when Packet == http; Packet == {http, headers};
+ Packet == http_bin; Packet == {http_bin, headers};
+ Packet == httph; Packet == httph_bin ->
Data;
format_reply(list, _,_, Data) ->
binary_to_list(Data).
header(0, <<>>) ->
- <<>>;
+ [];
header(_, <<>>) ->
[];
header(0, Binary) ->
@@ -1869,25 +1999,26 @@ next_state(Current, Next, #ssl_tls{type = ?HANDSHAKE, fragment = Data},
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_hashes(),
- ?MODULE:SName(Packet, State#state{tls_handshake_hashes=Hs0,
+ 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}) ->
- Hs0 = ssl_handshake:init_hashes(),
- Hs1 = ssl_handshake:update_hashes(Hs0, Raw),
- ?MODULE:SName(Packet, State#state{tls_handshake_hashes=Hs1,
+ 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_hashes=Hs0}}) ->
- Hs1 = ssl_handshake:update_hashes(Hs0, Raw),
- ?MODULE:SName(Packet, State#state{tls_handshake_hashes=Hs1});
+ ({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} = ssl_handshake:get_tls_handshake(Data,Buf0),
+ {Packets, Buf} = ssl_handshake:get_tls_handshake(Version,Data,Buf0),
State = State0#state{tls_packets = Packets, tls_handshake_buffer = Buf},
handle_tls_handshake(Handle, Next, State)
catch throw:#alert{} = Alert ->
@@ -1967,22 +2098,22 @@ next_state_connection(StateName, #state{send_queue = Queue0,
next_state_is_connection(StateName, State)
end.
-%% In next_state_is_connection/1: clear tls_handshake_hashes,
+%% 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{recv_from = From,
+ #state{start_or_recv_from = RecvFrom,
socket_options =
- #socket_options{active = false}}) when From =/= undefined ->
+ #socket_options{active = false}}) when RecvFrom =/= undefined ->
passive_receive(State#state{premaster_secret = undefined,
public_key_info = undefined,
- tls_handshake_hashes = {<<>>, <<>>}}, connection);
+ 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_hashes = {<<>>, <<>>}}).
+ public_key_info = undefined,
+ tls_handshake_history = ssl_handshake:init_handshake_history()}).
register_session(client, Host, Port, #session{is_resumable = new} = Session0) ->
Session = Session0#session{is_resumable = true},
@@ -2036,7 +2167,7 @@ initial_state(Role, Host, Port, Socket, {SSLOptions, SocketOptions}, User,
log_alert = true,
session_cache_cb = SessionCacheCb,
renegotiation = {false, first},
- recv_from = undefined,
+ start_or_recv_from = undefined,
send_queue = queue:new()
}.
@@ -2140,7 +2271,7 @@ handle_alerts([Alert | Alerts], {next_state, StateName, State, _Timeout}) ->
handle_alerts(Alerts, handle_alert(Alert, StateName, State)).
handle_alert(#alert{level = ?FATAL} = Alert, StateName,
- #state{from = From, host = Host, port = Port, session = Session,
+ #state{start_or_recv_from = From, host = Host, port = Port, session = Session,
user_application = {_Mon, Pid},
log_alert = Log, role = Role, socket_options = Opts} = State) ->
invalidate_session(Role, Host, Port, Session),
@@ -2222,13 +2353,13 @@ handle_own_alert(Alert, Version, StateName,
ok
end.
-handle_normal_shutdown(Alert, _, #state{from = User, role = Role, renegotiation = {false, first}}) ->
- alert_user(User, Alert, Role);
+handle_normal_shutdown(Alert, _, #state{start_or_recv_from = StartFrom, role = Role, renegotiation = {false, first}}) ->
+ alert_user(StartFrom, Alert, Role);
handle_normal_shutdown(Alert, StateName, #state{socket_options = Opts,
user_application = {_Mon, Pid},
- from = User, role = Role}) ->
- alert_user(StateName, Opts, Pid, User, Alert, Role).
+ start_or_recv_from = RecvFrom, role = Role}) ->
+ alert_user(StateName, Opts, Pid, RecvFrom, Alert, Role).
handle_unexpected_message(Msg, Info, #state{negotiated_version = Version} = State) ->
Alert = ?ALERT_REC(?FATAL,?UNEXPECTED_MESSAGE),
@@ -2236,7 +2367,7 @@ handle_unexpected_message(Msg, Info, #state{negotiated_version = Version} = Stat
{stop, normal, State}.
make_premaster_secret({MajVer, MinVer}, rsa) ->
- Rand = crypto:rand_bytes(?NUM_OF_PREMASTERSECRET_BYTES-2),
+ Rand = ssl:random_bytes(?NUM_OF_PREMASTERSECRET_BYTES-2),
<<?BYTE(MajVer), ?BYTE(MinVer), Rand/binary>>;
make_premaster_secret(_, _) ->
undefined.
@@ -2254,17 +2385,17 @@ ack_connection(#state{renegotiation = {true, From}} = State) ->
gen_fsm:reply(From, ok),
State#state{renegotiation = undefined};
ack_connection(#state{renegotiation = {false, first},
- from = From} = State) when From =/= undefined ->
- gen_fsm:reply(From, connected),
- State#state{renegotiation = undefined};
+ start_or_recv_from = StartFrom} = State) when StartFrom =/= undefined ->
+ gen_fsm:reply(StartFrom, connected),
+ State#state{renegotiation = undefined, start_or_recv_from = undefined};
ack_connection(State) ->
State.
renegotiate(#state{role = client} = State) ->
%% Handle same way as if server requested
%% the renegotiation
- Hs0 = ssl_handshake:init_hashes(),
- connection(#hello_request{}, State#state{tls_handshake_hashes = Hs0});
+ Hs0 = ssl_handshake:init_handshake_history(),
+ connection(#hello_request{}, State#state{tls_handshake_history = Hs0});
renegotiate(#state{role = server,
socket = Socket,
transport_cb = Transport,
@@ -2272,13 +2403,13 @@ renegotiate(#state{role = server,
connection_states = ConnectionStates0} = State0) ->
HelloRequest = ssl_handshake:hello_request(),
Frag = ssl_handshake:encode_handshake(HelloRequest, Version),
- Hs0 = ssl_handshake:init_hashes(),
+ 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_hashes = Hs0}),
+ tls_handshake_history = Hs0}),
next_state(connection, hello, Record, State#state{allow_renegotiate = true}).
notify_senders(SendQueue) ->
@@ -2322,7 +2453,74 @@ linux_workaround_transport_delivery_problems(#alert{level = ?FATAL}, Socket) ->
linux_workaround_transport_delivery_problems(_, _) ->
ok.
-get_timeout(#state{ssl_options=#ssl_options{hibernate_after=undefined}}) ->
+get_timeout(#state{ssl_options=#ssl_options{hibernate_after = undefined}}) ->
infinity;
-get_timeout(#state{ssl_options=#ssl_options{hibernate_after=HibernateAfter}}) ->
+get_timeout(#state{ssl_options=#ssl_options{hibernate_after = HibernateAfter}}) ->
HibernateAfter.
+
+handle_trusted_certs_db(#state{ssl_options = #ssl_options{cacertfile = <<>>}}) ->
+ %% No trusted certs specified
+ ok;
+handle_trusted_certs_db(#state{cert_db_ref = Ref,
+ cert_db = CertDb,
+ ssl_options = #ssl_options{cacertfile = undefined}}) ->
+ %% Certs provided as DER directly can not be shared
+ %% with other connections and it is safe to delete them when the connection ends.
+ ssl_certificate_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
+ ok;
+handle_trusted_certs_db(#state{cert_db_ref = Ref,
+ file_ref_db = RefDb,
+ ssl_options = #ssl_options{cacertfile = File}}) ->
+ case ssl_certificate_db:ref_count(Ref, RefDb, -1) of
+ 0 ->
+ ssl_manager:clean_cert_db(Ref, File);
+ _ ->
+ ok
+ end.
+
+get_current_connection_state_prf(CStates, Direction) ->
+ CS = ssl_record:current_connection_state(CStates, Direction),
+ CS#connection_state.security_parameters#security_parameters.prf_algorithm.
+get_pending_connection_state_prf(CStates, Direction) ->
+ CS = ssl_record:pending_connection_state(CStates, Direction),
+ CS#connection_state.security_parameters#security_parameters.prf_algorithm.
+
+connection_hash_algo({HashAlgo, _}, _State) ->
+ HashAlgo;
+connection_hash_algo(_, #state{hashsign_algorithm = {HashAlgo, _}}) ->
+ HashAlgo.
+
+%% RFC 5246, Sect. 7.4.1.4.1. Signature Algorithms
+%% If the client does not send the signature_algorithms extension, the
+%% server MUST do the following:
+%%
+%% - If the negotiated key exchange algorithm is one of (RSA, DHE_RSA,
+%% DH_RSA, RSA_PSK, ECDH_RSA, ECDHE_RSA), behave as if client had
+%% sent the value {sha1,rsa}.
+%%
+%% - If the negotiated key exchange algorithm is one of (DHE_DSS,
+%% DH_DSS), behave as if the client had sent the value {sha1,dsa}.
+%%
+%% - If the negotiated key exchange algorithm is one of (ECDH_ECDSA,
+%% ECDHE_ECDSA), behave as if the client had sent value {sha1,ecdsa}.
+
+default_hashsign(_Version = {Major, Minor}, KeyExchange)
+ when Major == 3 andalso Minor >= 3 andalso
+ (KeyExchange == rsa orelse
+ KeyExchange == dhe_rsa orelse
+ KeyExchange == dh_rsa) ->
+ {sha, rsa};
+default_hashsign(_Version, KeyExchange)
+ when KeyExchange == rsa;
+ KeyExchange == dhe_rsa;
+ KeyExchange == dh_rsa ->
+ {md5sha, rsa};
+default_hashsign(_Version, KeyExchange)
+ when KeyExchange == dhe_dss;
+ KeyExchange == dh_dss ->
+ {sha, dsa};
+default_hashsign(_Version, KeyExchange)
+ when KeyExchange == dh_anon ->
+ {null, anon}.
diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl
index 371f475c85..fa1784714f 100644
--- a/lib/ssl/src/ssl_handshake.erl
+++ b/lib/ssl/src/ssl_handshake.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -30,35 +30,38 @@
-include("ssl_internal.hrl").
-include_lib("public_key/include/public_key.hrl").
--export([master_secret/4, client_hello/6, server_hello/4, hello/4,
+-export([master_secret/4, client_hello/8, server_hello/5, hello/4,
hello_request/0, certify/7, certificate/4,
- client_certificate_verify/5, certificate_verify/5,
- certificate_request/3, key_exchange/2, server_key_exchange_hash/2,
- finished/4, verify_connection/5, get_tls_handshake/2,
+ client_certificate_verify/6, certificate_verify/6,
+ certificate_request/3, key_exchange/3, server_key_exchange_hash/2,
+ finished/5, verify_connection/6, get_tls_handshake/3,
decode_client_key/3, server_hello_done/0,
- encode_handshake/2, init_hashes/0, update_hashes/2,
- decrypt_premaster_secret/2]).
+ encode_handshake/2, init_handshake_history/0, update_handshake_history/2,
+ decrypt_premaster_secret/2, prf/5, next_protocol/1]).
-export([dec_hello_extensions/2]).
-type tls_handshake() :: #client_hello{} | #server_hello{} |
#server_hello_done{} | #certificate{} | #certificate_request{} |
#client_key_exchange{} | #finished{} | #certificate_verify{} |
- #hello_request{}.
+ #hello_request{} | #next_protocol{}.
%%====================================================================
%% Internal application API
%%====================================================================
%%--------------------------------------------------------------------
-spec client_hello(host(), inet:port_number(), #connection_states{},
- #ssl_options{}, boolean(), der_cert()) -> #client_hello{}.
+ #ssl_options{}, integer(), atom(), boolean(), der_cert()) ->
+ #client_hello{}.
%%
%% Description: Creates a client hello message.
%%--------------------------------------------------------------------
-client_hello(Host, Port, ConnectionStates, #ssl_options{versions = Versions,
- ciphers = UserSuites}
- = SslOpts, Renegotiation, OwnCert) ->
-
+client_hello(Host, Port, ConnectionStates,
+ #ssl_options{versions = Versions,
+ ciphers = UserSuites
+ } = SslOpts,
+ Cache, CacheCb, Renegotiation, OwnCert) ->
+
Fun = fun(Version) ->
ssl_record:protocol_version(Version)
end,
@@ -67,24 +70,38 @@ client_hello(Host, Port, ConnectionStates, #ssl_options{versions = Versions,
SecParams = Pending#connection_state.security_parameters,
Ciphers = available_suites(UserSuites, Version),
- Id = ssl_manager:client_session_id(Host, Port, SslOpts, OwnCert),
+ Id = ssl_session:client_id({Host, Port, SslOpts}, Cache, CacheCb, OwnCert),
- #client_hello{session_id = Id,
+ #client_hello{session_id = Id,
client_version = Version,
cipher_suites = cipher_suites(Ciphers, Renegotiation),
compression_methods = ssl_record:compressions(),
random = SecParams#security_parameters.client_random,
- renegotiation_info =
- renegotiation_info(client, ConnectionStates, Renegotiation)
+
+ renegotiation_info =
+ renegotiation_info(client, ConnectionStates, Renegotiation),
+ hash_signs = default_hash_signs(),
+ next_protocol_negotiation =
+ encode_client_protocol_negotiation(SslOpts#ssl_options.next_protocol_selector, Renegotiation)
}.
+encode_protocol(Protocol, Acc) ->
+ Len = byte_size(Protocol),
+ <<Acc/binary, ?BYTE(Len), Protocol/binary>>.
+
+encode_protocols_advertised_on_server(undefined) ->
+ undefined;
+
+encode_protocols_advertised_on_server(Protocols) ->
+ #next_protocol_negotiation{extension_data = lists:foldl(fun encode_protocol/2, <<>>, Protocols)}.
+
%%--------------------------------------------------------------------
-spec server_hello(session_id(), tls_version(), #connection_states{},
- boolean()) -> #server_hello{}.
+ boolean(), [binary()] | undefined) -> #server_hello{}.
%%
%% Description: Creates a server hello message.
%%--------------------------------------------------------------------
-server_hello(SessionId, Version, ConnectionStates, Renegotiation) ->
+server_hello(SessionId, Version, ConnectionStates, Renegotiation, ProtocolsAdvertisedOnServer) ->
Pending = ssl_record:pending_connection_state(ConnectionStates, read),
SecParams = Pending#connection_state.security_parameters,
#server_hello{server_version = Version,
@@ -94,7 +111,8 @@ server_hello(SessionId, Version, ConnectionStates, Renegotiation) ->
random = SecParams#security_parameters.server_random,
session_id = SessionId,
renegotiation_info =
- renegotiation_info(server, ConnectionStates, Renegotiation)
+ renegotiation_info(server, ConnectionStates, Renegotiation),
+ next_protocol_negotiation = encode_protocols_advertised_on_server(ProtocolsAdvertisedOnServer)
}.
%%--------------------------------------------------------------------
@@ -109,28 +127,35 @@ hello_request() ->
%%--------------------------------------------------------------------
-spec hello(#server_hello{} | #client_hello{}, #ssl_options{},
#connection_states{} | {inet:port_number(), #session{}, db_handle(),
- atom(), #connection_states{}, binary()},
- boolean()) -> {tls_version(), session_id(), #connection_states{}}|
- {tls_version(), {resumed | new, #session{}},
- #connection_states{}} | #alert{}.
+ atom(), #connection_states{}, binary()},
+ boolean()) ->
+ {tls_version(), session_id(), #connection_states{}, binary() | undefined}|
+ {tls_version(), {resumed | new, #session{}}, #connection_states{}, list(binary()) | undefined} |
+ #alert{}.
%%
%% Description: Handles a recieved hello message
%%--------------------------------------------------------------------
hello(#server_hello{cipher_suite = CipherSuite, server_version = Version,
compression_method = Compression, random = Random,
- session_id = SessionId, renegotiation_info = Info},
- #ssl_options{secure_renegotiate = SecureRenegotation},
+ session_id = SessionId, renegotiation_info = Info,
+ hash_signs = _HashSigns} = Hello,
+ #ssl_options{secure_renegotiate = SecureRenegotation, next_protocol_selector = NextProtocolSelector},
ConnectionStates0, Renegotiation) ->
-
+ %%TODO: select hash and signature algorigthm
case ssl_record:is_acceptable_version(Version) of
true ->
case handle_renegotiation_info(client, Info, ConnectionStates0,
Renegotiation, SecureRenegotation, []) of
{ok, ConnectionStates1} ->
ConnectionStates =
- hello_pending_connection_states(client, CipherSuite, Random,
+ hello_pending_connection_states(client, Version, CipherSuite, Random,
Compression, ConnectionStates1),
- {Version, SessionId, ConnectionStates};
+ case handle_next_protocol(Hello, NextProtocolSelector, Renegotiation) of
+ #alert{} = Alert ->
+ Alert;
+ Protocol ->
+ {Version, SessionId, ConnectionStates, Protocol}
+ end;
#alert{} = Alert ->
Alert
end;
@@ -141,9 +166,10 @@ hello(#server_hello{cipher_suite = CipherSuite, server_version = Version,
hello(#client_hello{client_version = ClientVersion, random = Random,
cipher_suites = CipherSuites,
renegotiation_info = Info} = Hello,
- #ssl_options{versions = Versions,
+ #ssl_options{versions = Versions,
secure_renegotiate = SecureRenegotation} = SslOpts,
{Port, Session0, Cache, CacheCb, ConnectionStates0, Cert}, Renegotiation) ->
+%% TODO: select hash and signature algorithm
Version = select_version(ClientVersion, Versions),
case ssl_record:is_acceptable_version(Version) of
true ->
@@ -161,11 +187,17 @@ hello(#client_hello{client_version = ClientVersion, random = Random,
{ok, ConnectionStates1} ->
ConnectionStates =
hello_pending_connection_states(server,
+ Version,
CipherSuite,
Random,
Compression,
ConnectionStates1),
- {Version, {Type, Session}, ConnectionStates};
+ case handle_next_protocol_on_server(Hello, Renegotiation, SslOpts) of
+ #alert{} = Alert ->
+ Alert;
+ ProtocolsToAdvertise ->
+ {Version, {Type, Session}, ConnectionStates, ProtocolsToAdvertise}
+ end;
#alert{} = Alert ->
Alert
end
@@ -188,14 +220,14 @@ certify(#certificate{asn1_certificates = ASN1Certs}, CertDbHandle, CertDbRef,
ValidationFunAndState =
case VerifyFunAndState of
undefined ->
- {fun(OtpCert, ExtensionOrError, SslState) ->
+ {fun(OtpCert, ExtensionOrVerifyResult, SslState) ->
ssl_certificate:validate_extension(OtpCert,
- ExtensionOrError, SslState)
+ ExtensionOrVerifyResult, SslState)
end, Role};
{Fun, UserState0} ->
- {fun(OtpCert, ExtensionOrError, {SslState, UserState}) ->
+ {fun(OtpCert, {extension, _} = Extension, {SslState, UserState}) ->
case ssl_certificate:validate_extension(OtpCert,
- ExtensionOrError,
+ Extension,
SslState) of
{valid, NewSslState} ->
{valid, {NewSslState, UserState}};
@@ -204,23 +236,31 @@ certify(#certificate{asn1_certificates = ASN1Certs}, CertDbHandle, CertDbRef,
SslState);
{unknown, _} ->
apply_user_fun(Fun, OtpCert,
- ExtensionOrError, UserState, SslState)
- end
+ Extension, UserState, SslState)
+ end;
+ (OtpCert, VerifyResult, {SslState, UserState}) ->
+ apply_user_fun(Fun, OtpCert, VerifyResult, UserState,
+ SslState)
end, {Role, UserState0}}
end,
- {TrustedErlCert, CertPath} =
- ssl_certificate:trusted_cert_and_path(ASN1Certs, CertDbHandle, CertDbRef),
-
- case public_key:pkix_path_validation(TrustedErlCert,
- CertPath,
- [{max_path_length,
- MaxPathLen},
- {verify_fun, ValidationFunAndState}]) of
- {ok, {PublicKeyInfo,_}} ->
- {PeerCert, PublicKeyInfo};
- {error, Reason} ->
- path_validation_alert(Reason)
+ try
+ {TrustedErlCert, CertPath} =
+ ssl_certificate:trusted_cert_and_path(ASN1Certs, CertDbHandle, CertDbRef),
+ case public_key:pkix_path_validation(TrustedErlCert,
+ CertPath,
+ [{max_path_length,
+ MaxPathLen},
+ {verify_fun, ValidationFunAndState}]) of
+ {ok, {PublicKeyInfo,_}} ->
+ {PeerCert, PublicKeyInfo};
+ {error, Reason} ->
+ path_validation_alert(Reason)
+ end
+ catch
+ error:_ ->
+ %% ASN-1 decode of certificate somehow failed
+ ?ALERT_REC(?FATAL, ?CERTIFICATE_UNKNOWN)
end.
%%--------------------------------------------------------------------
@@ -251,54 +291,51 @@ certificate(OwnCert, CertDbHandle, CertDbRef, server) ->
%%--------------------------------------------------------------------
-spec client_certificate_verify(undefined | der_cert(), binary(),
- tls_version(), private_key(),
- {{binary(), binary()},{binary(), binary()}}) ->
+ tls_version(), term(), private_key(),
+ tls_handshake_history()) ->
#certificate_verify{} | ignore | #alert{}.
%%
%% Description: Creates a certificate_verify message, called by the client.
%%--------------------------------------------------------------------
-client_certificate_verify(undefined, _, _, _, _) ->
+client_certificate_verify(undefined, _, _, _, _, _) ->
ignore;
-client_certificate_verify(_, _, _, undefined, _) ->
+client_certificate_verify(_, _, _, _, undefined, _) ->
ignore;
client_certificate_verify(OwnCert, MasterSecret, Version,
- PrivateKey, {Hashes0, _}) ->
+ {HashAlgo, SignAlgo},
+ PrivateKey, {Handshake, _}) ->
case public_key:pkix_is_fixed_dh_cert(OwnCert) of
true ->
?ALERT_REC(?FATAL, ?UNSUPPORTED_CERTIFICATE);
- false ->
- Hashes =
- calc_certificate_verify(Version, MasterSecret,
- alg_oid(PrivateKey), Hashes0),
- Signed = digitally_signed(Hashes, PrivateKey),
- #certificate_verify{signature = Signed}
+ false ->
+ Hashes =
+ calc_certificate_verify(Version, HashAlgo, MasterSecret, Handshake),
+ Signed = digitally_signed(Version, Hashes, HashAlgo, PrivateKey),
+ #certificate_verify{signature = Signed, hashsign_algorithm = {HashAlgo, SignAlgo}}
end.
%%--------------------------------------------------------------------
--spec certificate_verify(binary(), public_key_info(), tls_version(),
- binary(), {_, {binary(), binary()}}) -> valid | #alert{}.
+-spec certificate_verify(binary(), public_key_info(), tls_version(), term(),
+ binary(), tls_handshake_history()) -> valid | #alert{}.
%%
%% Description: Checks that the certificate_verify message is valid.
%%--------------------------------------------------------------------
-certificate_verify(Signature, {?'rsaEncryption'= Algorithm, PublicKey, _}, Version,
- MasterSecret, {_, Hashes0}) ->
- Hashes = calc_certificate_verify(Version, MasterSecret,
- Algorithm, Hashes0),
- case public_key:decrypt_public(Signature, PublicKey,
- [{rsa_pad, rsa_pkcs1_padding}]) of
- Hashes ->
+certificate_verify(Signature, {?'rsaEncryption', PublicKey, _}, Version,
+ {HashAlgo, _SignAlgo}, MasterSecret, {_, Handshake}) ->
+ Hashes = calc_certificate_verify(Version, HashAlgo, MasterSecret, Handshake),
+ case certificate_verify_rsa(Hashes, HashAlgo, Signature, PublicKey, Version) of
+ true ->
valid;
_ ->
?ALERT_REC(?FATAL, ?BAD_CERTIFICATE)
end;
-certificate_verify(Signature, {?'id-dsa' = Algorithm, PublicKey, PublicKeyParams}, Version,
- MasterSecret, {_, Hashes0}) ->
- Hashes = calc_certificate_verify(Version, MasterSecret,
- Algorithm, Hashes0),
- case public_key:verify(Hashes, none, Signature, {PublicKey, PublicKeyParams}) of
- true ->
- valid;
- false ->
+certificate_verify(Signature, {?'id-dsa', PublicKey, PublicKeyParams}, Version,
+ {HashAlgo, _SignAlgo}, MasterSecret, {_, Handshake}) ->
+ Hashes = calc_certificate_verify(Version, HashAlgo, MasterSecret, Handshake),
+ case public_key:verify({digest, Hashes}, sha, Signature, {PublicKey, PublicKeyParams}) of
+ true ->
+ valid;
+ false ->
?ALERT_REC(?FATAL, ?BAD_CERTIFICATE)
end.
@@ -314,36 +351,38 @@ certificate_request(ConnectionStates, CertDbHandle, CertDbRef) ->
#security_parameters{cipher_suite = CipherSuite}} =
ssl_record:pending_connection_state(ConnectionStates, read),
Types = certificate_types(CipherSuite),
+ HashSigns = default_hash_signs(),
Authorities = certificate_authorities(CertDbHandle, CertDbRef),
#certificate_request{
certificate_types = Types,
+ hashsign_algorithms = HashSigns,
certificate_authorities = Authorities
}.
%%--------------------------------------------------------------------
--spec key_exchange(client | server,
+-spec key_exchange(client | server, tls_version(),
{premaster_secret, binary(), public_key_info()} |
{dh, binary()} |
- {dh, {binary(), binary()}, #'DHParameter'{}, key_algo(),
+ {dh, {binary(), binary()}, #'DHParameter'{}, {HashAlgo::atom(), SignAlgo::atom()},
binary(), binary(), private_key()}) ->
#client_key_exchange{} | #server_key_exchange{}.
%%
%% Description: Creates a keyexchange message.
%%--------------------------------------------------------------------
-key_exchange(client, {premaster_secret, Secret, {_, PublicKey, _}}) ->
+key_exchange(client, _Version, {premaster_secret, Secret, {_, PublicKey, _}}) ->
EncPremasterSecret =
encrypted_premaster_secret(Secret, PublicKey),
#client_key_exchange{exchange_keys = EncPremasterSecret};
-key_exchange(client, {dh, <<?UINT32(Len), PublicKey:Len/binary>>}) ->
+key_exchange(client, _Version, {dh, <<?UINT32(Len), PublicKey:Len/binary>>}) ->
#client_key_exchange{
exchange_keys = #client_diffie_hellman_public{
dh_public = PublicKey}
};
-key_exchange(server, {dh, {<<?UINT32(Len), PublicKey:Len/binary>>, _},
+key_exchange(server, Version, {dh, {<<?UINT32(Len), PublicKey:Len/binary>>, _},
#'DHParameter'{prime = P, base = G},
- KeyAlgo, ClientRandom, ServerRandom, PrivateKey}) ->
+ {HashAlgo, SignAlgo}, ClientRandom, ServerRandom, PrivateKey}) ->
<<?UINT32(_), PBin/binary>> = crypto:mpint(P),
<<?UINT32(_), GBin/binary>> = crypto:mpint(G),
PLen = byte_size(PBin),
@@ -352,20 +391,22 @@ key_exchange(server, {dh, {<<?UINT32(Len), PublicKey:Len/binary>>, _},
ServerDHParams = #server_dh_params{dh_p = PBin,
dh_g = GBin, dh_y = PublicKey},
- case KeyAlgo of
- dh_anon ->
+ case HashAlgo of
+ null ->
#server_key_exchange{params = ServerDHParams,
- signed_params = <<>>};
+ signed_params = <<>>,
+ hashsign = {null, anon}};
_ ->
Hash =
- server_key_exchange_hash(KeyAlgo, <<ClientRandom/binary,
+ server_key_exchange_hash(HashAlgo, <<ClientRandom/binary,
ServerRandom/binary,
?UINT16(PLen), PBin/binary,
?UINT16(GLen), GBin/binary,
?UINT16(YLen), PublicKey/binary>>),
- Signed = digitally_signed(Hash, PrivateKey),
+ Signed = digitally_signed(Version, Hash, HashAlgo, PrivateKey),
#server_key_exchange{params = ServerDHParams,
- signed_params = Signed}
+ signed_params = Signed,
+ hashsign = {HashAlgo, SignAlgo}}
end.
%%--------------------------------------------------------------------
@@ -395,10 +436,11 @@ master_secret(Version, PremasterSecret, ConnectionStates, Role) ->
ConnectionState =
ssl_record:pending_connection_state(ConnectionStates, read),
SecParams = ConnectionState#connection_state.security_parameters,
- #security_parameters{client_random = ClientRandom,
+ #security_parameters{prf_algorithm = PrfAlgo,
+ client_random = ClientRandom,
server_random = ServerRandom} = SecParams,
try master_secret(Version,
- calc_master_secret(Version,PremasterSecret,
+ calc_master_secret(Version,PrfAlgo,PremasterSecret,
ClientRandom, ServerRandom),
SecParams, ConnectionStates, Role)
catch
@@ -409,27 +451,32 @@ master_secret(Version, PremasterSecret, ConnectionStates, Role) ->
?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE)
end.
+-spec next_protocol(binary()) -> #next_protocol{}.
+
+next_protocol(SelectedProtocol) ->
+ #next_protocol{selected_protocol = SelectedProtocol}.
+
%%--------------------------------------------------------------------
--spec finished(tls_version(), client | server, binary(), {{binary(), binary()},_}) ->
+-spec finished(tls_version(), client | server, integer(), binary(), tls_handshake_history()) ->
#finished{}.
%%
%% Description: Creates a handshake finished message
%%-------------------------------------------------------------------
-finished(Version, Role, MasterSecret, {Hashes, _}) -> % use the current hashes
+finished(Version, Role, PrfAlgo, MasterSecret, {Handshake, _}) -> % use the current handshake
#finished{verify_data =
- calc_finished(Version, Role, MasterSecret, Hashes)}.
+ calc_finished(Version, Role, PrfAlgo, MasterSecret, Handshake)}.
%%--------------------------------------------------------------------
--spec verify_connection(tls_version(), #finished{}, client | server, binary(),
- {_, {binary(), binary()}}) -> verified | #alert{}.
+-spec verify_connection(tls_version(), #finished{}, client | server, integer(), binary(),
+ tls_handshake_history()) -> verified | #alert{}.
%%
%% Description: Checks the ssl handshake finished message to verify
%% the connection.
%%-------------------------------------------------------------------
verify_connection(Version, #finished{verify_data = Data},
- Role, MasterSecret, {_, {MD5, SHA}}) ->
+ Role, PrfAlgo, MasterSecret, {_, Handshake}) ->
%% use the previous hashes
- case calc_finished(Version, Role, MasterSecret, {MD5, SHA}) of
+ case calc_finished(Version, Role, PrfAlgo, MasterSecret, Handshake) of
Data ->
verified;
_ ->
@@ -454,17 +501,17 @@ encode_handshake(Package, Version) ->
[MsgType, ?uint24(Len), Bin].
%%--------------------------------------------------------------------
--spec get_tls_handshake(binary(), binary() | iolist()) ->
+-spec get_tls_handshake(tls_version(), binary(), binary() | iolist()) ->
{[tls_handshake()], binary()}.
%%
%% Description: Given buffered and new data from ssl_record, collects
%% and returns it as a list of handshake messages, also returns leftover
%% data.
%%--------------------------------------------------------------------
-get_tls_handshake(Data, <<>>) ->
- get_tls_handshake_aux(Data, []);
-get_tls_handshake(Data, Buffer) ->
- get_tls_handshake_aux(list_to_binary([Buffer, Data]), []).
+get_tls_handshake(Version, Data, <<>>) ->
+ get_tls_handshake_aux(Version, Data, []);
+get_tls_handshake(Version, Data, Buffer) ->
+ get_tls_handshake_aux(Version, list_to_binary([Buffer, Data]), []).
%%--------------------------------------------------------------------
-spec decode_client_key(binary(), key_algo(), tls_version()) ->
@@ -476,39 +523,34 @@ decode_client_key(ClientKey, Type, Version) ->
dec_client_key(ClientKey, key_exchange_alg(Type), Version).
%%--------------------------------------------------------------------
--spec init_hashes() ->{{binary(), binary()}, {binary(), binary()}}.
+-spec init_handshake_history() -> tls_handshake_history().
%%
-%% Description: Calls crypto hash (md5 and sha) init functions to
-%% initalize the hash context.
+%% Description: Initialize the empty handshake history buffer.
%%--------------------------------------------------------------------
-init_hashes() ->
- T = {crypto:md5_init(), crypto:sha_init()},
- {T, T}.
+init_handshake_history() ->
+ {[], []}.
%%--------------------------------------------------------------------
--spec update_hashes({{binary(), binary()}, {binary(), binary()}}, Data ::term()) ->
- {{binary(), binary()}, {binary(), binary()}}.
+-spec update_handshake_history(tls_handshake_history(), Data ::term()) ->
+ tls_handshake_history().
%%
-%% Description: Calls crypto hash (md5 and sha) update functions to
-%% update the hash context with Data.
+%% Description: Update the handshake history buffer with Data.
%%--------------------------------------------------------------------
-update_hashes(Hashes, % special-case SSL2 client hello
- <<?CLIENT_HELLO, ?UINT24(_), ?BYTE(Major), ?BYTE(Minor),
- ?UINT16(CSLength), ?UINT16(0),
- ?UINT16(CDLength),
- CipherSuites:CSLength/binary,
- ChallengeData:CDLength/binary>>) ->
- update_hashes(Hashes,
- <<?CLIENT_HELLO, ?BYTE(Major), ?BYTE(Minor),
- ?UINT16(CSLength), ?UINT16(0),
- ?UINT16(CDLength),
- CipherSuites:CSLength/binary,
- ChallengeData:CDLength/binary>>);
-update_hashes({{MD50, SHA0}, _Prev}, Data) ->
- {MD51, SHA1} = {crypto:md5_update(MD50, Data),
- crypto:sha_update(SHA0, Data)},
- {{MD51, SHA1}, {MD50, SHA0}}.
+update_handshake_history(Handshake, % special-case SSL2 client hello
+ <<?CLIENT_HELLO, ?UINT24(_), ?BYTE(Major), ?BYTE(Minor),
+ ?UINT16(CSLength), ?UINT16(0),
+ ?UINT16(CDLength),
+ CipherSuites:CSLength/binary,
+ ChallengeData:CDLength/binary>>) ->
+ update_handshake_history(Handshake,
+ <<?CLIENT_HELLO, ?BYTE(Major), ?BYTE(Minor),
+ ?UINT16(CSLength), ?UINT16(0),
+ ?UINT16(CDLength),
+ CipherSuites:CSLength/binary,
+ ChallengeData:CDLength/binary>>);
+update_handshake_history({Handshake0, _Prev}, Data) ->
+ {[Data|Handshake0], Handshake0}.
%%--------------------------------------------------------------------
-spec decrypt_premaster_secret(binary(), #'RSAPrivateKey'{}) -> binary().
@@ -521,33 +563,45 @@ decrypt_premaster_secret(Secret, RSAPrivateKey) ->
[{rsa_pad, rsa_pkcs1_padding}])
catch
_:_ ->
+ io:format("decrypt_premaster_secret error"),
throw(?ALERT_REC(?FATAL, ?DECRYPT_ERROR))
end.
%%--------------------------------------------------------------------
--spec server_key_exchange_hash(rsa | dhe_rsa| dhe_dss | dh_anon, binary()) -> binary().
-
+-spec server_key_exchange_hash(md5sha | md5 | sha | sha224 |sha256 | sha384 | sha512, binary()) -> binary().
%%
%% Description: Calculate server key exchange hash
%%--------------------------------------------------------------------
-server_key_exchange_hash(Algorithm, Value) when Algorithm == rsa;
- Algorithm == dhe_rsa ->
+server_key_exchange_hash(md5sha, Value) ->
MD5 = crypto:md5(Value),
- SHA = crypto:sha(Value),
+ SHA = crypto:sha(Value),
<<MD5/binary, SHA/binary>>;
-server_key_exchange_hash(dhe_dss, Value) ->
- crypto:sha(Value).
+server_key_exchange_hash(Hash, Value) ->
+ crypto:hash(Hash, Value).
+
+%%--------------------------------------------------------------------
+-spec prf(tls_version(), binary(), binary(), [binary()], non_neg_integer()) ->
+ {ok, binary()} | {error, undefined}.
+%%
+%% Description: use the TLS PRF to generate key material
+%%--------------------------------------------------------------------
+prf({3,0}, _, _, _, _) ->
+ {error, undefined};
+prf({3,1}, Secret, Label, Seed, WantedLength) ->
+ {ok, ssl_tls1:prf(?MD5SHA, Secret, Label, Seed, WantedLength)};
+prf({3,_N}, Secret, Label, Seed, WantedLength) ->
+ {ok, ssl_tls1:prf(?SHA256, Secret, Label, Seed, WantedLength)}.
%%--------------------------------------------------------------------
%%% Internal functions
%%--------------------------------------------------------------------
-get_tls_handshake_aux(<<?BYTE(Type), ?UINT24(Length),
+get_tls_handshake_aux(Version, <<?BYTE(Type), ?UINT24(Length),
Body:Length/binary,Rest/binary>>, Acc) ->
Raw = <<?BYTE(Type), ?UINT24(Length), Body/binary>>,
- H = dec_hs(Type, Body),
- get_tls_handshake_aux(Rest, [{H,Raw} | Acc]);
-get_tls_handshake_aux(Data, Acc) ->
+ H = dec_hs(Version, Type, Body),
+ get_tls_handshake_aux(Version, Rest, [{H,Raw} | Acc]);
+get_tls_handshake_aux(_Version, Data, Acc) ->
{lists:reverse(Acc), Data}.
path_validation_alert({bad_cert, cert_expired}) ->
@@ -569,24 +623,23 @@ path_validation_alert({bad_cert, unknown_ca}) ->
path_validation_alert(_) ->
?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE).
-select_session(Hello, Port, Session, Version,
+select_session(Hello, Port, Session, Version,
#ssl_options{ciphers = UserSuites} = SslOpts, Cache, CacheCb, Cert) ->
SuggestedSessionId = Hello#client_hello.session_id,
- SessionId = ssl_manager:server_session_id(Port, SuggestedSessionId,
- SslOpts, Cert),
-
- Suites = available_suites(Cert, UserSuites, Version),
- case ssl_session:is_new(SuggestedSessionId, SessionId) of
- true ->
- CipherSuite =
- select_cipher_suite(Hello#client_hello.cipher_suites, Suites),
+ {SessionId, Resumed} = ssl_session:server_id(Port, SuggestedSessionId,
+ SslOpts, Cert,
+ Cache, CacheCb),
+ Suites = available_suites(Cert, UserSuites, Version),
+ case Resumed of
+ undefined ->
+ CipherSuite = select_cipher_suite(Hello#client_hello.cipher_suites, Suites),
Compressions = Hello#client_hello.compression_methods,
Compression = select_compression(Compressions),
{new, Session#session{session_id = SessionId,
cipher_suite = CipherSuite,
compression_method = Compression}};
- false ->
- {resumed, CacheCb:lookup(Cache, {Port, SessionId})}
+ _ ->
+ {resumed, Resumed}
end.
available_suites(UserSuites, Version) ->
@@ -636,6 +689,57 @@ renegotiation_info(server, ConnectionStates, true) ->
#renegotiation_info{renegotiated_connection = undefined}
end.
+decode_next_protocols({next_protocol_negotiation, Protocols}) ->
+ decode_next_protocols(Protocols, []).
+decode_next_protocols(<<>>, Acc) ->
+ lists:reverse(Acc);
+decode_next_protocols(<<?BYTE(Len), Protocol:Len/binary, Rest/binary>>, Acc) ->
+ case Len of
+ 0 ->
+ {error, invalid_next_protocols};
+ _ ->
+ decode_next_protocols(Rest, [Protocol|Acc])
+ end;
+decode_next_protocols(_Bytes, _Acc) ->
+ {error, invalid_next_protocols}.
+
+next_protocol_extension_allowed(NextProtocolSelector, Renegotiating) ->
+ NextProtocolSelector =/= undefined andalso not Renegotiating.
+
+handle_next_protocol_on_server(#client_hello{next_protocol_negotiation = undefined}, _Renegotiation, _SslOpts) ->
+ undefined;
+
+handle_next_protocol_on_server(#client_hello{next_protocol_negotiation = {next_protocol_negotiation, <<>>}},
+ false, #ssl_options{next_protocols_advertised = Protocols}) ->
+ Protocols;
+
+handle_next_protocol_on_server(_Hello, _Renegotiation, _SSLOpts) ->
+ ?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE). % unexpected next protocol extension
+
+handle_next_protocol(#server_hello{next_protocol_negotiation = undefined},
+ _NextProtocolSelector, _Renegotiating) ->
+ undefined;
+
+handle_next_protocol(#server_hello{next_protocol_negotiation = Protocols},
+ NextProtocolSelector, Renegotiating) ->
+
+ case next_protocol_extension_allowed(NextProtocolSelector, Renegotiating) of
+ true ->
+ select_next_protocol(decode_next_protocols(Protocols), NextProtocolSelector);
+ false ->
+ ?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE) % unexpected next protocol extension
+ end.
+
+select_next_protocol({error, _Reason}, _NextProtocolSelector) ->
+ ?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE);
+select_next_protocol(Protocols, NextProtocolSelector) ->
+ case NextProtocolSelector(Protocols) of
+ ?NO_PROTOCOL ->
+ ?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE);
+ Protocol when is_binary(Protocol) ->
+ Protocol
+ end.
+
handle_renegotiation_info(_, #renegotiation_info{renegotiated_connection = ?byte(0)},
ConnectionStates, false, _, _) ->
{ok, ssl_record:set_renegotiation_flag(true, ConnectionStates)};
@@ -705,7 +809,7 @@ handle_renegotiation_info(ConnectionStates, SecureRenegotation) ->
%% hello messages
%% NOTE : Role is the role of the receiver of the hello message
%% currently being processed.
-hello_pending_connection_states(Role, CipherSuite, Random, Compression,
+hello_pending_connection_states(Role, Version, CipherSuite, Random, Compression,
ConnectionStates) ->
ReadState =
ssl_record:pending_connection_state(ConnectionStates, read),
@@ -713,30 +817,30 @@ hello_pending_connection_states(Role, CipherSuite, Random, Compression,
ssl_record:pending_connection_state(ConnectionStates, write),
NewReadSecParams =
- hello_security_parameters(Role, ReadState, CipherSuite,
+ hello_security_parameters(Role, Version, ReadState, CipherSuite,
Random, Compression),
NewWriteSecParams =
- hello_security_parameters(Role, WriteState, CipherSuite,
+ hello_security_parameters(Role, Version, WriteState, CipherSuite,
Random, Compression),
ssl_record:update_security_params(NewReadSecParams,
NewWriteSecParams,
ConnectionStates).
-hello_security_parameters(client, ConnectionState, CipherSuite, Random,
+hello_security_parameters(client, Version, ConnectionState, CipherSuite, Random,
Compression) ->
SecParams = ConnectionState#connection_state.security_parameters,
- NewSecParams = ssl_cipher:security_parameters(CipherSuite, SecParams),
+ NewSecParams = ssl_cipher:security_parameters(Version, CipherSuite, SecParams),
NewSecParams#security_parameters{
server_random = Random,
compression_algorithm = Compression
};
-hello_security_parameters(server, ConnectionState, CipherSuite, Random,
+hello_security_parameters(server, Version, ConnectionState, CipherSuite, Random,
Compression) ->
SecParams = ConnectionState#connection_state.security_parameters,
- NewSecParams = ssl_cipher:security_parameters(CipherSuite, SecParams),
+ NewSecParams = ssl_cipher:security_parameters(Version, CipherSuite, SecParams),
NewSecParams#security_parameters{
client_random = Random,
compression_algorithm = Compression
@@ -770,13 +874,14 @@ master_secret(Version, MasterSecret, #security_parameters{
client_random = ClientRandom,
server_random = ServerRandom,
hash_size = HashSize,
+ prf_algorithm = PrfAlgo,
key_material_length = KML,
expanded_key_material_length = EKML,
iv_size = IVS},
ConnectionStates, Role) ->
{ClientWriteMacSecret, ServerWriteMacSecret, ClientWriteKey,
ServerWriteKey, ClientIV, ServerIV} =
- setup_keys(Version, MasterSecret, ServerRandom,
+ setup_keys(Version, PrfAlgo, MasterSecret, ServerRandom,
ClientRandom, HashSize, KML, EKML, IVS),
ConnStates1 = ssl_record:set_master_secret(MasterSecret, ConnectionStates),
@@ -791,17 +896,21 @@ master_secret(Version, MasterSecret, #security_parameters{
ServerCipherState, Role)}.
-dec_hs(?HELLO_REQUEST, <<>>) ->
+dec_hs(_, ?NEXT_PROTOCOL, <<?BYTE(SelectedProtocolLength), SelectedProtocol:SelectedProtocolLength/binary,
+ ?BYTE(PaddingLength), _Padding:PaddingLength/binary>>) ->
+ #next_protocol{selected_protocol = SelectedProtocol};
+
+dec_hs(_, ?HELLO_REQUEST, <<>>) ->
#hello_request{};
%% Client hello v2.
%% The server must be able to receive such messages, from clients that
%% are willing to use ssl v3 or higher, but have ssl v2 compatibility.
-dec_hs(?CLIENT_HELLO, <<?BYTE(Major), ?BYTE(Minor),
- ?UINT16(CSLength), ?UINT16(0),
- ?UINT16(CDLength),
- CipherSuites:CSLength/binary,
- ChallengeData:CDLength/binary>>) ->
+dec_hs(_Version, ?CLIENT_HELLO, <<?BYTE(Major), ?BYTE(Minor),
+ ?UINT16(CSLength), ?UINT16(0),
+ ?UINT16(CDLength),
+ CipherSuites:CSLength/binary,
+ ChallengeData:CDLength/binary>>) ->
#client_hello{client_version = {Major, Minor},
random = ssl_ssl2:client_random(ChallengeData, CDLength),
session_id = 0,
@@ -809,24 +918,29 @@ dec_hs(?CLIENT_HELLO, <<?BYTE(Major), ?BYTE(Minor),
compression_methods = [?NULL],
renegotiation_info = undefined
};
-dec_hs(?CLIENT_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary,
+dec_hs(_Version, ?CLIENT_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary,
?BYTE(SID_length), Session_ID:SID_length/binary,
?UINT16(Cs_length), CipherSuites:Cs_length/binary,
?BYTE(Cm_length), Comp_methods:Cm_length/binary,
Extensions/binary>>) ->
-
- RenegotiationInfo = proplists:get_value(renegotiation_info, dec_hello_extensions(Extensions),
- undefined),
- #client_hello{
- client_version = {Major,Minor},
- random = Random,
- session_id = Session_ID,
- cipher_suites = from_2bytes(CipherSuites),
- compression_methods = Comp_methods,
- renegotiation_info = RenegotiationInfo
- };
-dec_hs(?SERVER_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary,
+ DecodedExtensions = dec_hello_extensions(Extensions),
+ RenegotiationInfo = proplists:get_value(renegotiation_info, DecodedExtensions, undefined),
+ HashSigns = proplists:get_value(hash_signs, DecodedExtensions, undefined),
+ NextProtocolNegotiation = proplists:get_value(next_protocol_negotiation, DecodedExtensions, undefined),
+
+ #client_hello{
+ client_version = {Major,Minor},
+ random = Random,
+ session_id = Session_ID,
+ cipher_suites = from_2bytes(CipherSuites),
+ compression_methods = Comp_methods,
+ renegotiation_info = RenegotiationInfo,
+ hash_signs = HashSigns,
+ next_protocol_negotiation = NextProtocolNegotiation
+ };
+
+dec_hs(_Version, ?SERVER_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary,
?BYTE(SID_length), Session_ID:SID_length/binary,
Cipher_suite:2/binary, ?BYTE(Comp_method)>>) ->
#server_hello{
@@ -835,53 +949,84 @@ dec_hs(?SERVER_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary,
session_id = Session_ID,
cipher_suite = Cipher_suite,
compression_method = Comp_method,
- renegotiation_info = undefined};
+ renegotiation_info = undefined,
+ hash_signs = undefined};
-dec_hs(?SERVER_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary,
+dec_hs(_Version, ?SERVER_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary,
?BYTE(SID_length), Session_ID:SID_length/binary,
- Cipher_suite:2/binary, ?BYTE(Comp_method),
+ Cipher_suite:2/binary, ?BYTE(Comp_method),
?UINT16(ExtLen), Extensions:ExtLen/binary>>) ->
- RenegotiationInfo = proplists:get_value(renegotiation_info, dec_hello_extensions(Extensions, []),
- undefined),
+ HelloExtensions = dec_hello_extensions(Extensions, []),
+ RenegotiationInfo = proplists:get_value(renegotiation_info, HelloExtensions,
+ undefined),
+ HashSigns = proplists:get_value(hash_signs, HelloExtensions,
+ undefined),
+ NextProtocolNegotiation = proplists:get_value(next_protocol_negotiation, HelloExtensions, undefined),
+
#server_hello{
server_version = {Major,Minor},
random = Random,
session_id = Session_ID,
cipher_suite = Cipher_suite,
compression_method = Comp_method,
- renegotiation_info = RenegotiationInfo};
-dec_hs(?CERTIFICATE, <<?UINT24(ACLen), ASN1Certs:ACLen/binary>>) ->
+ renegotiation_info = RenegotiationInfo,
+ hash_signs = HashSigns,
+ next_protocol_negotiation = NextProtocolNegotiation};
+dec_hs(_Version, ?CERTIFICATE, <<?UINT24(ACLen), ASN1Certs:ACLen/binary>>) ->
#certificate{asn1_certificates = certs_to_list(ASN1Certs)};
-dec_hs(?SERVER_KEY_EXCHANGE, <<?UINT16(PLen), P:PLen/binary,
+dec_hs(_Version, ?SERVER_KEY_EXCHANGE, <<?UINT16(PLen), P:PLen/binary,
?UINT16(GLen), G:GLen/binary,
?UINT16(YLen), Y:YLen/binary,
?UINT16(0)>>) -> %% May happen if key_algorithm is dh_anon
#server_key_exchange{params = #server_dh_params{dh_p = P,dh_g = G,
dh_y = Y},
- signed_params = <<>>};
-dec_hs(?SERVER_KEY_EXCHANGE, <<?UINT16(PLen), P:PLen/binary,
+ signed_params = <<>>, hashsign = {null, anon}};
+dec_hs({Major, Minor}, ?SERVER_KEY_EXCHANGE, <<?UINT16(PLen), P:PLen/binary,
+ ?UINT16(GLen), G:GLen/binary,
+ ?UINT16(YLen), Y:YLen/binary,
+ ?BYTE(HashAlgo), ?BYTE(SignAlgo),
+ ?UINT16(Len), Sig:Len/binary>>)
+ when Major == 3, Minor >= 3 ->
+ #server_key_exchange{params = #server_dh_params{dh_p = P,dh_g = G,
+ dh_y = Y},
+ signed_params = Sig,
+ hashsign = {ssl_cipher:hash_algorithm(HashAlgo), ssl_cipher:sign_algorithm(SignAlgo)}};
+dec_hs(_Version, ?SERVER_KEY_EXCHANGE, <<?UINT16(PLen), P:PLen/binary,
?UINT16(GLen), G:GLen/binary,
?UINT16(YLen), Y:YLen/binary,
?UINT16(Len), Sig:Len/binary>>) ->
#server_key_exchange{params = #server_dh_params{dh_p = P,dh_g = G,
dh_y = Y},
- signed_params = Sig};
-dec_hs(?CERTIFICATE_REQUEST,
+ signed_params = Sig, hashsign = undefined};
+dec_hs({Major, Minor}, ?CERTIFICATE_REQUEST,
+ <<?BYTE(CertTypesLen), CertTypes:CertTypesLen/binary,
+ ?UINT16(HashSignsLen), HashSigns:HashSignsLen/binary,
+ ?UINT16(CertAuthsLen), CertAuths:CertAuthsLen/binary>>)
+ when Major == 3, Minor >= 3 ->
+ HashSignAlgos = [{ssl_cipher:hash_algorithm(Hash), ssl_cipher:sign_algorithm(Sign)} ||
+ <<?BYTE(Hash), ?BYTE(Sign)>> <= HashSigns],
+ #certificate_request{certificate_types = CertTypes,
+ hashsign_algorithms = #hash_sign_algos{hash_sign_algos = HashSignAlgos},
+ certificate_authorities = CertAuths};
+dec_hs(_Version, ?CERTIFICATE_REQUEST,
<<?BYTE(CertTypesLen), CertTypes:CertTypesLen/binary,
?UINT16(CertAuthsLen), CertAuths:CertAuthsLen/binary>>) ->
#certificate_request{certificate_types = CertTypes,
certificate_authorities = CertAuths};
-dec_hs(?SERVER_HELLO_DONE, <<>>) ->
+dec_hs(_Version, ?SERVER_HELLO_DONE, <<>>) ->
#server_hello_done{};
-dec_hs(?CERTIFICATE_VERIFY,<<?UINT16(_), Signature/binary>>)->
+dec_hs({Major, Minor}, ?CERTIFICATE_VERIFY,<<HashSign:2/binary, ?UINT16(SignLen), Signature:SignLen/binary>>)
+ when Major == 3, Minor >= 3 ->
+ #certificate_verify{hashsign_algorithm = hashsign_dec(HashSign), signature = Signature};
+dec_hs(_Version, ?CERTIFICATE_VERIFY,<<?UINT16(SignLen), Signature:SignLen/binary>>)->
#certificate_verify{signature = Signature};
-dec_hs(?CLIENT_KEY_EXCHANGE, PKEPMS) ->
+dec_hs(_Version, ?CLIENT_KEY_EXCHANGE, PKEPMS) ->
#client_key_exchange{exchange_keys = PKEPMS};
-dec_hs(?FINISHED, VerifyData) ->
+dec_hs(_Version, ?FINISHED, VerifyData) ->
#finished{verify_data = VerifyData};
-dec_hs(_, _) ->
+dec_hs(_, _, _) ->
throw(?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE)).
dec_client_key(PKEPMS, ?KEY_EXCHANGE_RSA, {3, 0}) ->
@@ -903,6 +1048,9 @@ dec_hello_extensions(_) ->
dec_hello_extensions(<<>>, Acc) ->
Acc;
+dec_hello_extensions(<<?UINT16(?NEXTPROTONEG_EXT), ?UINT16(Len), ExtensionData:Len/binary, Rest/binary>>, Acc) ->
+ Prop = {next_protocol_negotiation, #next_protocol_negotiation{extension_data = ExtensionData}},
+ dec_hello_extensions(Rest, [Prop | Acc]);
dec_hello_extensions(<<?UINT16(?RENEGOTIATION_EXT), ?UINT16(Len), Info:Len/binary, Rest/binary>>, Acc) ->
RenegotiateInfo = case Len of
1 -> % Initial handshake
@@ -915,8 +1063,18 @@ dec_hello_extensions(<<?UINT16(?RENEGOTIATION_EXT), ?UINT16(Len), Info:Len/binar
dec_hello_extensions(Rest, [{renegotiation_info,
#renegotiation_info{renegotiated_connection = RenegotiateInfo}} | Acc]);
+dec_hello_extensions(<<?UINT16(?SIGNATURE_ALGORITHMS_EXT), ?UINT16(Len),
+ ExtData:Len/binary, Rest/binary>>, Acc) ->
+ SignAlgoListLen = Len - 2,
+ <<?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, [{hash_signs,
+ #hash_sign_algos{hash_sign_algos = HashSignAlgos}} | Acc]);
+
%% Ignore data following the ClientHello (i.e.,
%% extensions) if not understood.
+
dec_hello_extensions(<<?UINT16(_), ?UINT16(Len), _Unknown:Len/binary, Rest/binary>>, Acc) ->
dec_hello_extensions(Rest, Acc);
%% This theoretically should not happen if the protocol is followed, but if it does it is ignored.
@@ -949,6 +1107,11 @@ certs_from_list(ACList) ->
<<?UINT24(CertLen), Cert/binary>>
end || Cert <- ACList]).
+enc_hs(#next_protocol{selected_protocol = SelectedProtocol}, _Version) ->
+ PaddingLength = 32 - ((byte_size(SelectedProtocol) + 2) rem 32),
+
+ {?NEXT_PROTOCOL, <<?BYTE((byte_size(SelectedProtocol))), SelectedProtocol/binary,
+ ?BYTE(PaddingLength), 0:(PaddingLength * 8)>>};
enc_hs(#hello_request{}, _Version) ->
{?HELLO_REQUEST, <<>>};
enc_hs(#client_hello{client_version = {Major, Minor},
@@ -956,15 +1119,22 @@ enc_hs(#client_hello{client_version = {Major, Minor},
session_id = SessionID,
cipher_suites = CipherSuites,
compression_methods = CompMethods,
- renegotiation_info = RenegotiationInfo}, _Version) ->
+ renegotiation_info = RenegotiationInfo,
+ hash_signs = HashSigns,
+ next_protocol_negotiation = NextProtocolNegotiation}, _Version) ->
SIDLength = byte_size(SessionID),
BinCompMethods = list_to_binary(CompMethods),
CmLength = byte_size(BinCompMethods),
BinCipherSuites = list_to_binary(CipherSuites),
CsLength = byte_size(BinCipherSuites),
- Extensions = hello_extensions(RenegotiationInfo),
- ExtensionsBin = enc_hello_extensions(Extensions),
- {?CLIENT_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary,
+ Extensions0 = hello_extensions(RenegotiationInfo, NextProtocolNegotiation),
+ Extensions1 = if
+ Major == 3, Minor >=3 -> Extensions0 ++ hello_extensions(HashSigns);
+ true -> Extensions0
+ end,
+ ExtensionsBin = enc_hello_extensions(Extensions1),
+
+ {?CLIENT_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary,
?BYTE(SIDLength), SessionID/binary,
?UINT16(CsLength), BinCipherSuites/binary,
?BYTE(CmLength), BinCompMethods/binary, ExtensionsBin/binary>>};
@@ -974,9 +1144,10 @@ enc_hs(#server_hello{server_version = {Major, Minor},
session_id = Session_ID,
cipher_suite = Cipher_suite,
compression_method = Comp_method,
- renegotiation_info = RenegotiationInfo}, _Version) ->
+ renegotiation_info = RenegotiationInfo,
+ next_protocol_negotiation = NextProtocolNegotiation}, _Version) ->
SID_length = byte_size(Session_ID),
- Extensions = hello_extensions(RenegotiationInfo),
+ Extensions = hello_extensions(RenegotiationInfo, NextProtocolNegotiation),
ExtensionsBin = enc_hello_extensions(Extensions),
{?SERVER_HELLO, <<?BYTE(Major), ?BYTE(Minor), Random:32/binary,
?BYTE(SID_length), Session_ID/binary,
@@ -987,15 +1158,30 @@ enc_hs(#certificate{asn1_certificates = ASN1CertList}, _Version) ->
{?CERTIFICATE, <<?UINT24(ACLen), ASN1Certs:ACLen/binary>>};
enc_hs(#server_key_exchange{params = #server_dh_params{
dh_p = P, dh_g = G, dh_y = Y},
- signed_params = SignedParams}, _Version) ->
+ signed_params = SignedParams, hashsign = HashSign}, Version) ->
PLen = byte_size(P),
GLen = byte_size(G),
YLen = byte_size(Y),
- SignedLen = byte_size(SignedParams),
+ Signature = enc_sign(HashSign, SignedParams, Version),
{?SERVER_KEY_EXCHANGE, <<?UINT16(PLen), P/binary,
?UINT16(GLen), G/binary,
?UINT16(YLen), Y/binary,
- ?UINT16(SignedLen), SignedParams/binary>>
+ Signature/binary>>
+ };
+enc_hs(#certificate_request{certificate_types = CertTypes,
+ hashsign_algorithms = #hash_sign_algos{hash_sign_algos = HashSignAlgos},
+ certificate_authorities = CertAuths},
+ {Major, Minor})
+ when Major == 3, Minor >= 3 ->
+ HashSigns= << <<(ssl_cipher:hash_algorithm(Hash)):8, (ssl_cipher:sign_algorithm(Sign)):8>> ||
+ {Hash, Sign} <- HashSignAlgos >>,
+ CertTypesLen = byte_size(CertTypes),
+ HashSignsLen = byte_size(HashSigns),
+ CertAuthsLen = byte_size(CertAuths),
+ {?CERTIFICATE_REQUEST,
+ <<?BYTE(CertTypesLen), CertTypes/binary,
+ ?UINT16(HashSignsLen), HashSigns/binary,
+ ?UINT16(CertAuthsLen), CertAuths/binary>>
};
enc_hs(#certificate_request{certificate_types = CertTypes,
certificate_authorities = CertAuths},
@@ -1010,8 +1196,8 @@ enc_hs(#server_hello_done{}, _Version) ->
{?SERVER_HELLO_DONE, <<>>};
enc_hs(#client_key_exchange{exchange_keys = ExchangeKeys}, Version) ->
{?CLIENT_KEY_EXCHANGE, enc_cke(ExchangeKeys, Version)};
-enc_hs(#certificate_verify{signature = BinSig}, _) ->
- EncSig = enc_bin_sig(BinSig),
+enc_hs(#certificate_verify{signature = BinSig, hashsign_algorithm = HashSign}, Version) ->
+ EncSig = enc_sign(HashSign, BinSig, Version),
{?CERTIFICATE_VERIFY, EncSig};
enc_hs(#finished{verify_data = VerifyData}, _Version) ->
{?FINISHED, VerifyData}.
@@ -1025,14 +1211,29 @@ enc_cke(#client_diffie_hellman_public{dh_public = DHPublic}, _) ->
Len = byte_size(DHPublic),
<<?UINT16(Len), DHPublic/binary>>.
-enc_bin_sig(BinSig) ->
- Size = byte_size(BinSig),
- <<?UINT16(Size), BinSig/binary>>.
+enc_sign({HashAlg, SignAlg}, Signature, _Version = {Major, Minor})
+ when Major == 3, Minor >= 3->
+ SignLen = byte_size(Signature),
+ HashSign = hashsign_enc(HashAlg, SignAlg),
+ <<HashSign/binary, ?UINT16(SignLen), Signature/binary>>;
+enc_sign(_HashSign, Sign, _Version) ->
+ SignLen = byte_size(Sign),
+ <<?UINT16(SignLen), Sign/binary>>.
+
+hello_extensions(RenegotiationInfo, NextProtocolNegotiation) ->
+ hello_extensions(RenegotiationInfo) ++ next_protocol_extension(NextProtocolNegotiation).
-%% Renegotiation info, only current extension
+%% Renegotiation info
hello_extensions(#renegotiation_info{renegotiated_connection = undefined}) ->
[];
hello_extensions(#renegotiation_info{} = Info) ->
+ [Info];
+hello_extensions(#hash_sign_algos{} = Info) ->
+ [Info].
+
+next_protocol_extension(undefined) ->
+ [];
+next_protocol_extension(#next_protocol_negotiation{} = Info) ->
[Info].
enc_hello_extensions(Extensions) ->
@@ -1043,6 +1244,9 @@ enc_hello_extensions([], Acc) ->
Size = byte_size(Acc),
<<?UINT16(Size), Acc/binary>>;
+enc_hello_extensions([#next_protocol_negotiation{extension_data = ExtensionData} | Rest], Acc) ->
+ Len = byte_size(ExtensionData),
+ enc_hello_extensions(Rest, <<?UINT16(?NEXTPROTONEG_EXT), ?UINT16(Len), ExtensionData/binary, Acc/binary>>);
enc_hello_extensions([#renegotiation_info{renegotiated_connection = ?byte(0) = Info} | Rest], Acc) ->
Len = byte_size(Info),
enc_hello_extensions(Rest, <<?UINT16(?RENEGOTIATION_EXT), ?UINT16(Len), Info/binary, Acc/binary>>);
@@ -1050,8 +1254,22 @@ enc_hello_extensions([#renegotiation_info{renegotiated_connection = ?byte(0) = I
enc_hello_extensions([#renegotiation_info{renegotiated_connection = Info} | Rest], Acc) ->
InfoLen = byte_size(Info),
Len = InfoLen +1,
- enc_hello_extensions(Rest, <<?UINT16(?RENEGOTIATION_EXT), ?UINT16(Len), ?BYTE(InfoLen), Info/binary, Acc/binary>>).
-
+ enc_hello_extensions(Rest, <<?UINT16(?RENEGOTIATION_EXT), ?UINT16(Len), ?BYTE(InfoLen), Info/binary, Acc/binary>>);
+
+enc_hello_extensions([#hash_sign_algos{hash_sign_algos = HashSignAlgos} | Rest], Acc) ->
+ SignAlgoList = << <<(ssl_cipher:hash_algorithm(Hash)):8, (ssl_cipher:sign_algorithm(Sign)):8>> ||
+ {Hash, Sign} <- HashSignAlgos >>,
+ ListLen = byte_size(SignAlgoList),
+ Len = ListLen + 2,
+ enc_hello_extensions(Rest, <<?UINT16(?SIGNATURE_ALGORITHMS_EXT),
+ ?UINT16(Len), ?UINT16(ListLen), SignAlgoList/binary, Acc/binary>>).
+
+encode_client_protocol_negotiation(undefined, _) ->
+ undefined;
+encode_client_protocol_negotiation(_, false) ->
+ #next_protocol_negotiation{extension_data = <<>>};
+encode_client_protocol_negotiation(_, _) ->
+ undefined.
from_3bytes(Bin3) ->
from_3bytes(Bin3, []).
@@ -1078,6 +1296,14 @@ certificate_types({KeyExchange, _, _, _})
certificate_types(_) ->
<<?BYTE(?RSA_SIGN)>>.
+hashsign_dec(<<?BYTE(HashAlgo), ?BYTE(SignAlgo)>>) ->
+ {ssl_cipher:hash_algorithm(HashAlgo), ssl_cipher:sign_algorithm(SignAlgo)}.
+
+hashsign_enc(HashAlgo, SignAlgo) ->
+ Hash = ssl_cipher:hash_algorithm(HashAlgo),
+ Sign = ssl_cipher:sign_algorithm(SignAlgo),
+ <<?BYTE(Hash), ?BYTE(Sign)>>.
+
certificate_authorities(CertDbHandle, CertDbRef) ->
Authorities = certificate_authorities_from_db(CertDbHandle, CertDbRef),
Enc = fun(#'OTPCertificate'{tbsCertificate=TBSCert}) ->
@@ -1096,43 +1322,43 @@ certificate_authorities_from_db(CertDbHandle, CertDbRef) ->
[Cert | Acc];
(_, Acc) ->
Acc
- end,
+ end,
ssl_certificate_db:foldl(ConnectionCerts, [], CertDbHandle).
-digitally_signed(Hash, #'RSAPrivateKey'{} = Key) ->
+
+digitally_signed({3, Minor}, Hash, HashAlgo, Key) when Minor >= 3 ->
+ public_key:sign({digest, Hash}, HashAlgo, Key);
+digitally_signed(_Version, Hash, _HashAlgo, #'DSAPrivateKey'{} = Key) ->
+ public_key:sign({digest, Hash}, sha, Key);
+digitally_signed(_Version, Hash, _HashAlgo, #'RSAPrivateKey'{} = Key) ->
public_key:encrypt_private(Hash, Key,
- [{rsa_pad, rsa_pkcs1_padding}]);
-digitally_signed(Hash, #'DSAPrivateKey'{} = Key) ->
- public_key:sign(Hash, none, Key).
-
-calc_master_secret({3,0}, PremasterSecret, ClientRandom, ServerRandom) ->
+ [{rsa_pad, rsa_pkcs1_padding}]).
+
+calc_master_secret({3,0}, _PrfAlgo, PremasterSecret, ClientRandom, ServerRandom) ->
ssl_ssl3:master_secret(PremasterSecret, ClientRandom, ServerRandom);
-calc_master_secret({3,N},PremasterSecret, ClientRandom, ServerRandom)
- when N == 1; N == 2 ->
- ssl_tls1:master_secret(PremasterSecret, ClientRandom, ServerRandom).
+calc_master_secret({3,_}, PrfAlgo, PremasterSecret, ClientRandom, ServerRandom) ->
+ ssl_tls1:master_secret(PrfAlgo, PremasterSecret, ClientRandom, ServerRandom).
-setup_keys({3,0}, MasterSecret,
+setup_keys({3,0}, _PrfAlgo, MasterSecret,
ServerRandom, ClientRandom, HashSize, KML, EKML, IVS) ->
- ssl_ssl3:setup_keys(MasterSecret, ServerRandom,
+ ssl_ssl3:setup_keys(MasterSecret, ServerRandom,
ClientRandom, HashSize, KML, EKML, IVS);
-setup_keys({3,1}, MasterSecret,
+setup_keys({3,N}, PrfAlgo, MasterSecret,
ServerRandom, ClientRandom, HashSize, KML, _EKML, IVS) ->
- ssl_tls1:setup_keys(MasterSecret, ServerRandom, ClientRandom, HashSize,
+ ssl_tls1:setup_keys(N, PrfAlgo, MasterSecret, ServerRandom, ClientRandom, HashSize,
KML, IVS).
-calc_finished({3, 0}, Role, MasterSecret, Hashes) ->
- ssl_ssl3:finished(Role, MasterSecret, Hashes);
-calc_finished({3, N}, Role, MasterSecret, Hashes)
- when N == 1; N == 2 ->
- ssl_tls1:finished(Role, MasterSecret, Hashes).
+calc_finished({3, 0}, Role, _PrfAlgo, MasterSecret, Handshake) ->
+ ssl_ssl3:finished(Role, MasterSecret, lists:reverse(Handshake));
+calc_finished({3, N}, Role, PrfAlgo, MasterSecret, Handshake) ->
+ ssl_tls1:finished(Role, N, PrfAlgo, MasterSecret, lists:reverse(Handshake)).
-calc_certificate_verify({3, 0}, MasterSecret, Algorithm, Hashes) ->
- ssl_ssl3:certificate_verify(Algorithm, MasterSecret, Hashes);
-calc_certificate_verify({3, N}, _, Algorithm, Hashes)
- when N == 1; N == 2 ->
- ssl_tls1:certificate_verify(Algorithm, Hashes).
+calc_certificate_verify({3, 0}, HashAlgo, MasterSecret, Handshake) ->
+ ssl_ssl3:certificate_verify(HashAlgo, MasterSecret, lists:reverse(Handshake));
+calc_certificate_verify({3, N}, HashAlgo, _MasterSecret, Handshake) ->
+ ssl_tls1:certificate_verify(HashAlgo, N, lists:reverse(Handshake)).
key_exchange_alg(rsa) ->
?KEY_EXCHANGE_RSA;
@@ -1152,7 +1378,29 @@ apply_user_fun(Fun, OtpCert, ExtensionOrError, UserState0, SslState) ->
{unknown, {SslState, UserState}}
end.
-alg_oid(#'RSAPrivateKey'{}) ->
- ?'rsaEncryption';
-alg_oid(#'DSAPrivateKey'{}) ->
- ?'id-dsa'.
+certificate_verify_rsa(Hashes, sha, Signature, PublicKey, {Major, Minor})
+ when Major == 3, Minor >= 3 ->
+ public_key:verify({digest, Hashes}, sha, Signature, PublicKey);
+certificate_verify_rsa(Hashes, HashAlgo, Signature, PublicKey, {Major, Minor})
+ when Major == 3, Minor >= 3 ->
+ public_key:verify({digest, Hashes}, HashAlgo, Signature, PublicKey);
+certificate_verify_rsa(Hashes, _HashAlgo, Signature, PublicKey, _Version) ->
+ case public_key:decrypt_public(Signature, PublicKey,
+ [{rsa_pad, rsa_pkcs1_padding}]) of
+ Hashes -> true;
+ _ -> false
+ end.
+
+-define(TLSEXT_SIGALG_RSA(MD), {MD, rsa}).
+-define(TLSEXT_SIGALG_DSA(MD), {MD, dsa}).
+
+-define(TLSEXT_SIGALG(MD), ?TLSEXT_SIGALG_RSA(MD)).
+
+default_hash_signs() ->
+ #hash_sign_algos{hash_sign_algos =
+ [?TLSEXT_SIGALG(sha512),
+ ?TLSEXT_SIGALG(sha384),
+ ?TLSEXT_SIGALG(sha256),
+ ?TLSEXT_SIGALG(sha),
+ ?TLSEXT_SIGALG_DSA(sha),
+ ?TLSEXT_SIGALG_RSA(md5)]}.
diff --git a/lib/ssl/src/ssl_handshake.hrl b/lib/ssl/src/ssl_handshake.hrl
index fb0ebac7d1..9af6511d68 100644
--- a/lib/ssl/src/ssl_handshake.hrl
+++ b/lib/ssl/src/ssl_handshake.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -31,6 +31,15 @@
-type algo_oid() :: ?'rsaEncryption' | ?'id-dsa'.
-type public_key_params() :: #'Dss-Parms'{} | term().
-type public_key_info() :: {algo_oid(), #'RSAPublicKey'{} | integer() , public_key_params()}.
+-type tls_handshake_history() :: {[binary()], [binary()]}.
+
+-define(NO_PROTOCOL, <<>>).
+
+%% Signature algorithms
+-define(ANON, 0).
+-define(RSA, 1).
+-define(DSA, 2).
+-define(ECDSA, 3).
-record(session, {
session_id,
@@ -89,7 +98,9 @@
session_id, % opaque SessionID<0..32>
cipher_suites, % cipher_suites<2..2^16-1>
compression_methods, % compression_methods<1..2^8-1>,
- renegotiation_info
+ renegotiation_info,
+ hash_signs, % supported combinations of hashes/signature algos
+ next_protocol_negotiation = undefined % [binary()]
}).
-record(server_hello, {
@@ -98,7 +109,9 @@
session_id, % opaque SessionID<0..32>
cipher_suite, % cipher_suites
compression_method, % compression_method
- renegotiation_info
+ renegotiation_info,
+ hash_signs, % supported combinations of hashes/signature algos
+ next_protocol_negotiation = undefined % [binary()]
}).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -129,7 +142,8 @@
-record(server_key_exchange, {
params, %% #server_rsa_params{} | #server_dh_params{}
- signed_params %% #signature{}
+ signed_params, %% #signature{}
+ hashsign %% term(atom(), atom())
}).
%% enum { anonymous, rsa, dsa } SignatureAlgorithm;
@@ -159,6 +173,7 @@
-record(certificate_request, {
certificate_types, %ClientCertificateType <1..2^8-1>
+ hashsign_algorithms, %%SignatureAndHashAlgorithm <2^16-1>;
certificate_authorities %DistinguishedName <0..2^16-1>
}).
@@ -193,6 +208,7 @@
%%% Certificate verify - RFC 4346 section 7.4.8
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-record(certificate_verify, {
+ hashsign_algorithm,
signature % binary()
}).
@@ -213,6 +229,27 @@
renegotiated_connection
}).
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Signature Algorithms RFC 5746 section 7.4.1.4.1.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-define(SIGNATURE_ALGORITHMS_EXT, 13).
+
+-record(hash_sign_algos, {
+ hash_sign_algos
+ }).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Next Protocol Negotiation
+%% (http://tools.ietf.org/html/draft-agl-tls-nextprotoneg-02)
+%% (http://technotes.googlecode.com/git/nextprotoneg.html)
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+-define(NEXTPROTONEG_EXT, 13172).
+-define(NEXT_PROTOCOL, 67).
+-record(next_protocol_negotiation, {extension_data}).
+
+-record(next_protocol, {selected_protocol}).
+
-endif. % -ifdef(ssl_handshake).
diff --git a/lib/ssl/src/ssl_internal.hrl b/lib/ssl/src/ssl_internal.hrl
index 18cfcdcd68..a5db2dcee7 100644
--- a/lib/ssl/src/ssl_internal.hrl
+++ b/lib/ssl/src/ssl_internal.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -34,7 +34,7 @@
-type host() :: inet:ip_address() | inet:hostname().
-type session_id() :: 0 | binary().
-type tls_version() :: {integer(), integer()}.
--type tls_atom_version() :: sslv3 | tlsv1.
+-type tls_atom_version() :: sslv3 | tlsv1 | 'tlsv1.1' | 'tlsv1.2'.
-type certdb_ref() :: reference().
-type db_handle() :: term().
-type key_algo() :: null | rsa | dhe_rsa | dhe_dss | dh_anon.
@@ -69,11 +69,11 @@
-define(TRUE, 0).
-define(FALSE, 1).
--define(DEFAULT_SUPPORTED_VERSIONS, [tlsv1, sslv3]). % TODO: This is temporary
-%-define(DEFAULT_SUPPORTED_VERSIONS, ['tlsv1.1', tlsv1, sslv3]).
+-define(DEFAULT_SUPPORTED_VERSIONS, [tlsv1, sslv3]). %% Add 'tlsv1.1' in R16
+-define(ALL_SUPPORTED_VERSIONS, ['tlsv1.2', 'tlsv1.1', tlsv1, sslv3]).
-record(ssl_options, {
- versions, % 'tlsv1.1' | tlsv1 | sslv3
+ versions, % 'tlsv1.2' | 'tlsv1.1' | tlsv1 | sslv3
verify, % verify_none | verify_peer
verify_fun, % fun(CertVerifyErrors) -> boolean()
fail_if_no_peer_cert, % boolean()
@@ -106,7 +106,9 @@
% after which ssl_connection will
% go into hibernation
%% This option should only be set to true by inet_tls_dist
- erl_dist = false
+ erl_dist = false,
+ next_protocols_advertised = undefined, %% [binary()],
+ next_protocol_selector = undefined %% fun([binary()]) -> binary())
}).
-record(socket_options,
diff --git a/lib/ssl/src/ssl_manager.erl b/lib/ssl/src/ssl_manager.erl
index 6389ff03f5..0cf4f2ce33 100644
--- a/lib/ssl/src/ssl_manager.erl
+++ b/lib/ssl/src/ssl_manager.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -30,9 +30,9 @@
-export([start_link/1, start_link_dist/1,
connection_init/2, cache_pem_file/2,
lookup_trusted_cert/4,
- client_session_id/4, server_session_id/4,
+ new_session_id/1, clean_cert_db/2,
register_session/2, register_session/3, invalidate_session/2,
- invalidate_session/3]).
+ invalidate_session/3, clear_pem_cache/0]).
% Spawn export
-export([init_session_validator/1]).
@@ -56,9 +56,12 @@
-define('24H_in_msec', 8640000).
-define('24H_in_sec', 8640).
+-define(GEN_UNIQUE_ID_MAX_TRIES, 10).
-define(SESSION_VALIDATION_INTERVAL, 60000).
--define(CERTIFICATE_CACHE_CLEANUP, 30000).
+-define(CLEAR_PEM_CACHE, 120000).
-define(CLEAN_SESSION_DB, 60000).
+-define(CLEAN_CERT_DB, 500).
+-define(NOT_TO_BIG, 10).
%%====================================================================
%% API
@@ -82,26 +85,46 @@ start_link_dist(Opts) ->
gen_server:start_link({local, ssl_manager_dist}, ?MODULE, [ssl_manager_dist, Opts], []).
%%--------------------------------------------------------------------
--spec connection_init(string()| {der, list()}, client | server) ->
- {ok, certdb_ref(), db_handle(), db_handle()}.
+-spec connection_init(binary()| {der, list()}, client | server) ->
+ {ok, certdb_ref(), db_handle(), db_handle(), db_handle(), db_handle()}.
%%
%% Description: Do necessary initializations for a new connection.
%%--------------------------------------------------------------------
+connection_init({der, _} = Trustedcerts, Role) ->
+ call({connection_init, Trustedcerts, Role});
+
+connection_init(<<>> = Trustedcerts, Role) ->
+ call({connection_init, Trustedcerts, Role});
+
connection_init(Trustedcerts, Role) ->
call({connection_init, Trustedcerts, Role}).
+
%%--------------------------------------------------------------------
--spec cache_pem_file(string(), term()) -> {ok, term()} | {error, reason()}.
+-spec cache_pem_file(binary(), term()) -> {ok, term()} | {error, reason()}.
%%
%% Description: Cach a pem file and return its content.
%%--------------------------------------------------------------------
cache_pem_file(File, DbHandle) ->
- try file:read_file_info(File) of
- {ok, #file_info{mtime = LastWrite}} ->
- cache_pem_file(File, LastWrite, DbHandle)
- catch
- _:Reason ->
- {error, Reason}
+ MD5 = crypto:md5(File),
+ case ssl_certificate_db:lookup_cached_pem(DbHandle, MD5) of
+ [{Content,_}] ->
+ {ok, Content};
+ [Content] ->
+ {ok, Content};
+ undefined ->
+ call({cache_pem, {MD5, File}})
end.
+
+%%--------------------------------------------------------------------
+-spec clear_pem_cache() -> ok.
+%%
+%% Description: Clear the PEM cache
+%%--------------------------------------------------------------------
+clear_pem_cache() ->
+ %% Not supported for distribution at the moement, should it be?
+ put(ssl_manager, ssl_manager),
+ call(unconditionally_clear_pem_cache).
+
%%--------------------------------------------------------------------
-spec lookup_trusted_cert(term(), reference(), serialnumber(), issuer()) ->
undefined |
@@ -114,22 +137,15 @@ lookup_trusted_cert(DbHandle, Ref, SerialNumber, Issuer) ->
ssl_certificate_db:lookup_trusted_cert(DbHandle, Ref, SerialNumber, Issuer).
%%--------------------------------------------------------------------
--spec client_session_id(host(), inet:port_number(), #ssl_options{},
- der_cert() | undefined) -> session_id().
+-spec new_session_id(integer()) -> session_id().
%%
-%% Description: Select a session id for the client.
+%% Description: Creates a session id for the server.
%%--------------------------------------------------------------------
-client_session_id(Host, Port, SslOpts, OwnCert) ->
- call({client_session_id, Host, Port, SslOpts, OwnCert}).
+new_session_id(Port) ->
+ call({new_session_id, Port}).
-%%--------------------------------------------------------------------
--spec server_session_id(host(), inet:port_number(), #ssl_options{},
- der_cert()) -> session_id().
-%%
-%% Description: Select a session id for the server.
-%%--------------------------------------------------------------------
-server_session_id(Port, SuggestedSessionId, SslOpts, OwnCert) ->
- call({server_session_id, Port, SuggestedSessionId, SslOpts, OwnCert}).
+clean_cert_db(Ref, File) ->
+ erlang:send_after(?CLEAN_CERT_DB, self(), {clean_cert_db, Ref, File}).
%%--------------------------------------------------------------------
-spec register_session(inet:port_number(), #session{}) -> ok.
@@ -175,8 +191,9 @@ init([Name, Opts]) ->
proplists:get_value(session_lifetime, Opts, ?'24H_in_sec'),
CertDb = ssl_certificate_db:create(),
SessionCache = CacheCb:init(proplists:get_value(session_cb_init_args, Opts, [])),
- Timer = erlang:send_after(SessionLifeTime * 1000,
+ Timer = erlang:send_after(SessionLifeTime * 1000 + 5000,
self(), validate_sessions),
+ erlang:send_after(?CLEAR_PEM_CACHE, self(), clear_pem_cache),
{ok, #state{certificate_db = CertDb,
session_cache = SessionCache,
session_cache_cb = CacheCb,
@@ -194,55 +211,44 @@ init([Name, Opts]) ->
%%
%% Description: Handling call messages
%%--------------------------------------------------------------------
-handle_call({{connection_init, "", _Role}, Pid}, _From,
- #state{certificate_db = [CertDb |_],
+handle_call({{connection_init, <<>>, _Role}, _Pid}, _From,
+ #state{certificate_db = [CertDb, FileRefDb, PemChace],
session_cache = Cache} = State) ->
- erlang:monitor(process, Pid),
- Result = {ok, make_ref(),CertDb, Cache},
+ Result = {ok, make_ref(),CertDb, FileRefDb, PemChace, Cache},
{reply, Result, State};
handle_call({{connection_init, Trustedcerts, _Role}, Pid}, _From,
- #state{certificate_db = [CertDb|_] =Db,
+ #state{certificate_db = [CertDb, FileRefDb, PemChace] = Db,
session_cache = Cache} = State) ->
- erlang:monitor(process, Pid),
Result =
try
{ok, Ref} = ssl_certificate_db:add_trusted_certs(Pid, Trustedcerts, Db),
- {ok, Ref, CertDb, Cache}
+ {ok, Ref, CertDb, FileRefDb, PemChace, Cache}
catch
_:Reason ->
{error, Reason}
end,
{reply, Result, State};
-handle_call({{client_session_id, Host, Port, SslOpts, OwnCert}, _}, _,
- #state{session_cache = Cache,
- session_cache_cb = CacheCb} = State) ->
- Id = ssl_session:id({Host, Port, SslOpts}, Cache, CacheCb, OwnCert),
- {reply, Id, State};
-
-handle_call({{server_session_id, Port, SuggestedSessionId, SslOpts, OwnCert}, _},
+handle_call({{new_session_id,Port}, _},
_, #state{session_cache_cb = CacheCb,
- session_cache = Cache,
- session_lifetime = LifeTime} = State) ->
- Id = ssl_session:id(Port, SuggestedSessionId, SslOpts,
- Cache, CacheCb, LifeTime, OwnCert),
+ session_cache = Cache} = State) ->
+ Id = new_id(Port, ?GEN_UNIQUE_ID_MAX_TRIES, Cache, CacheCb),
{reply, Id, State};
-handle_call({{cache_pem, File, LastWrite}, Pid}, _,
+
+handle_call({{cache_pem, File}, _Pid}, _,
#state{certificate_db = Db} = State) ->
- try ssl_certificate_db:cache_pem_file(Pid, File, LastWrite, Db) of
+ try ssl_certificate_db:cache_pem_file(File, Db) of
Result ->
{reply, Result, State}
catch
_:Reason ->
{reply, {error, Reason}, State}
end;
-handle_call({{recache_pem, File, LastWrite}, Pid}, From,
- #state{certificate_db = Db} = State) ->
- ssl_certificate_db:uncache_pem_file(File, Db),
- cast({recache_pem, File, LastWrite, Pid, From}),
- {noreply, State}.
+handle_call({unconditionally_clear_pem_cache, _},_, #state{certificate_db = [_,_,PemChace]} = State) ->
+ ssl_certificate_db:clear(PemChace),
+ {reply, ok, State}.
%%--------------------------------------------------------------------
-spec handle_cast(msg(), #state{}) -> {noreply, #state{}}.
@@ -278,22 +284,7 @@ handle_cast({invalidate_session, Host, Port,
handle_cast({invalidate_session, Port, #session{session_id = ID} = Session},
#state{session_cache = Cache,
session_cache_cb = CacheCb} = State) ->
- invalidate_session(Cache, CacheCb, {Port, ID}, Session, State);
-
-handle_cast({recache_pem, File, LastWrite, Pid, From},
- #state{certificate_db = [_, FileToRefDb, _]} = State0) ->
- case ssl_certificate_db:lookup(File, FileToRefDb) of
- undefined ->
- {reply, Msg, State} =
- handle_call({{cache_pem, File, LastWrite}, Pid}, From, State0),
- gen_server:reply(From, Msg),
- {noreply, State};
- _ -> %% Send message to self letting cleanup messages be handled
- %% first so that no reference to the old version of file
- %% exists when we cache the new one.
- cast({recache_pem, File, LastWrite, Pid, From}),
- {noreply, State0}
- end.
+ invalidate_session(Cache, CacheCb, {Port, ID}, Session, State).
%%--------------------------------------------------------------------
-spec handle_info(msg(), #state{}) -> {noreply, #state{}}.
@@ -318,23 +309,38 @@ handle_info({delayed_clean_session, Key}, #state{session_cache = Cache,
CacheCb:delete(Cache, Key),
{noreply, State};
-handle_info({'EXIT', _, _}, State) ->
- %% Session validator died!! Do we need to take any action?
- %% maybe error log
+handle_info(clear_pem_cache, #state{certificate_db = [_,_,PemChace]} = State) ->
+ case ssl_certificate_db:db_size(PemChace) of
+ N when N < ?NOT_TO_BIG ->
+ ok;
+ _ ->
+ ssl_certificate_db:clear(PemChace)
+ end,
+ erlang:send_after(?CLEAR_PEM_CACHE, self(), clear_pem_cache),
{noreply, State};
-handle_info({'DOWN', _Ref, _Type, _Pid, ecacertfile}, State) ->
- {noreply, State};
-handle_info({'DOWN', _Ref, _Type, Pid, shutdown}, State) ->
- handle_info({remove_trusted_certs, Pid}, State);
-handle_info({'DOWN', _Ref, _Type, Pid, _Reason}, State) ->
- erlang:send_after(?CERTIFICATE_CACHE_CLEANUP, self(),
- {remove_trusted_certs, Pid}),
+handle_info({clean_cert_db, Ref, File},
+ #state{certificate_db = [CertDb,RefDb, PemCache]} = State) ->
+ case ssl_certificate_db:ref_count(Ref, RefDb, 0) of
+ 0 ->
+ MD5 = crypto:md5(File),
+ case ssl_certificate_db:lookup_cached_pem(PemCache, MD5) of
+ [{Content, Ref}] ->
+ ssl_certificate_db:insert(MD5, Content, PemCache);
+ undefined ->
+ ok
+ end,
+ ssl_certificate_db:remove(Ref, RefDb),
+ ssl_certificate_db:remove_trusted_certs(Ref, CertDb);
+ _ ->
+ ok
+ end,
{noreply, State};
-handle_info({remove_trusted_certs, Pid},
- #state{certificate_db = Db} = State) ->
- ssl_certificate_db:remove_trusted_certs(Pid, Db),
+
+handle_info({'EXIT', _, _}, State) ->
+ %% Session validator died!! Do we need to take any action?
+ %% maybe error log
{noreply, State};
handle_info(_Info, State) ->
@@ -406,19 +412,6 @@ session_validation({{Port, _}, Session}, LifeTime) ->
validate_session(Port, Session, LifeTime),
LifeTime.
-cache_pem_file(File, LastWrite, DbHandle) ->
- case ssl_certificate_db:lookup_cached_certs(DbHandle,File) of
- [{_, {Mtime, Content}}] ->
- case LastWrite of
- Mtime ->
- {ok, Content};
- _ ->
- call({recache_pem, File, LastWrite})
- end;
- [] ->
- call({cache_pem, File, LastWrite})
- end.
-
delay_time() ->
case application:get_env(ssl, session_delay_cleanup_time) of
{ok, Time} when is_integer(Time) ->
@@ -448,3 +441,28 @@ last_delay_timer({{_,_},_}, TRef, {LastServer, _}) ->
{LastServer, TRef};
last_delay_timer({_,_}, TRef, {_, LastClient}) ->
{TRef, LastClient}.
+
+%% If we can not generate a not allready in use session ID in
+%% ?GEN_UNIQUE_ID_MAX_TRIES we make the new session uncacheable The
+%% value of ?GEN_UNIQUE_ID_MAX_TRIES is stolen from open SSL which
+%% states : "If we can not find a session id in
+%% ?GEN_UNIQUE_ID_MAX_TRIES either the RAND code is broken or someone
+%% is trying to open roughly very close to 2^128 (or 2^256) SSL
+%% sessions to our server"
+new_id(_, 0, _, _) ->
+ <<>>;
+new_id(Port, Tries, Cache, CacheCb) ->
+ Id = crypto:rand_bytes(?NUM_OF_SESSION_ID_BYTES),
+ case CacheCb:lookup(Cache, {Port, Id}) of
+ undefined ->
+ Now = calendar:datetime_to_gregorian_seconds({date(), time()}),
+ %% New sessions can not be set to resumable
+ %% until handshake is compleate and the
+ %% other session values are set.
+ CacheCb:update(Cache, {Port, Id}, #session{session_id = Id,
+ is_resumable = false,
+ time_stamp = Now}),
+ Id;
+ _ ->
+ new_id(Port, Tries - 1, Cache, CacheCb)
+ end.
diff --git a/lib/ssl/src/ssl_record.erl b/lib/ssl/src/ssl_record.erl
index 830026c825..8e93ce4634 100644
--- a/lib/ssl/src/ssl_record.erl
+++ b/lib/ssl/src/ssl_record.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -383,6 +383,8 @@ get_tls_records_aux(Data, Acc) ->
%% Description: Creates a protocol version record from a version atom
%% or vice versa.
%%--------------------------------------------------------------------
+protocol_version('tlsv1.2') ->
+ {3, 3};
protocol_version('tlsv1.1') ->
{3, 2};
protocol_version(tlsv1) ->
@@ -391,6 +393,8 @@ protocol_version(sslv3) ->
{3, 0};
protocol_version(sslv2) -> %% Backwards compatibility
{2, 0};
+protocol_version({3, 3}) ->
+ 'tlsv1.2';
protocol_version({3, 2}) ->
'tlsv1.1';
protocol_version({3, 1}) ->
@@ -445,9 +449,9 @@ supported_protocol_versions() ->
end,
case application:get_env(ssl, protocol_version) of
undefined ->
- lists:map(Fun, ?DEFAULT_SUPPORTED_VERSIONS);
+ lists:map(Fun, supported_protocol_versions([]));
{ok, []} ->
- lists:map(Fun, ?DEFAULT_SUPPORTED_VERSIONS);
+ lists:map(Fun, supported_protocol_versions([]));
{ok, Vsns} when is_list(Vsns) ->
Versions = lists:filter(fun is_acceptable_version/1, lists:map(Fun, Vsns)),
supported_protocol_versions(Versions);
@@ -457,7 +461,16 @@ supported_protocol_versions() ->
end.
supported_protocol_versions([]) ->
- ?DEFAULT_SUPPORTED_VERSIONS;
+ Vsns = case sufficient_tlsv1_2_crypto_support() of
+ true ->
+ %%?ALL_SUPPORTED_VERSIONS; %% Add TlS-1.2 as default in R16
+ ?DEFAULT_SUPPORTED_VERSIONS;
+ false ->
+ ?DEFAULT_SUPPORTED_VERSIONS
+ end,
+ application:set_env(ssl, protocol_version, Vsns),
+ Vsns;
+
supported_protocol_versions([_|_] = Vsns) ->
Vsns.
@@ -561,14 +574,14 @@ highest_protocol_version() ->
initial_connection_state(ConnectionEnd) ->
#connection_state{security_parameters =
- initial_security_params(ConnectionEnd),
+ initial_security_params(ConnectionEnd),
sequence_number = 0
}.
initial_security_params(ConnectionEnd) ->
SecParams = #security_parameters{connection_end = ConnectionEnd,
compression_algorithm = ?NULL},
- ssl_cipher:security_parameters(?TLS_NULL_WITH_NULL_NULL,
+ ssl_cipher:security_parameters(highest_protocol_version(), ?TLS_NULL_WITH_NULL_NULL,
SecParams).
empty_connection_state(ConnectionEnd) ->
@@ -633,7 +646,7 @@ cipher(Type, Version, Fragment, CS0) ->
BCA}
}} =
hash_and_bump_seqno(CS0, Type, Version, Length, Fragment),
- {Ciphered, CipherS1} = ssl_cipher:cipher(BCA, CipherS0, MacHash, Fragment),
+ {Ciphered, CipherS1} = ssl_cipher:cipher(BCA, CipherS0, MacHash, Fragment, Version),
CS2 = CS1#connection_state{cipher_state=CipherS1},
{Ciphered, CS2}.
@@ -687,6 +700,17 @@ mac_hash({_,_}, ?NULL, _MacSecret, _SeqNo, _Type,
mac_hash({3, 0}, MacAlg, MacSecret, SeqNo, Type, Length, Fragment) ->
ssl_ssl3:mac_hash(MacAlg, MacSecret, SeqNo, Type, Length, Fragment);
mac_hash({3, N} = Version, MacAlg, MacSecret, SeqNo, Type, Length, Fragment)
- when N =:= 1; N =:= 2 ->
+ when N =:= 1; N =:= 2; N =:= 3 ->
ssl_tls1:mac_hash(MacAlg, MacSecret, SeqNo, Type, Version,
Length, Fragment).
+
+sufficient_tlsv1_2_crypto_support() ->
+ Data = "Sampl",
+ Data2 = "e #1",
+ Key = <<0,1,2,3,16,17,18,19,32,33,34,35,48,49,50,51,4,5,6,7,20,21,22,23,36,37,38,39,
+ 52,53,54,55,8,9,10,11,24,25,26,27,40,41,42,43,56,57,58,59>>,
+ try
+ crypto:sha256_mac(Key, lists:flatten([Data, Data2])),
+ true
+ catch _:_ -> false
+ end.
diff --git a/lib/ssl/src/ssl_record.hrl b/lib/ssl/src/ssl_record.hrl
index 282d642138..f73da92a52 100644
--- a/lib/ssl/src/ssl_record.hrl
+++ b/lib/ssl/src/ssl_record.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -47,6 +47,7 @@
key_material_length, % unit 8
expanded_key_material_length, % unit 8
mac_algorithm, % unit 8
+ prf_algorithm, % unit 8
hash_size, % unit 8
compression_algorithm, % unit 8
master_secret, % opaque 48
@@ -97,10 +98,15 @@
%-define(TRUE, 0). %% Already defined by ssl_internal.hrl
%-define(FALSE, 1). %% Already defined by ssl_internal.hrl
-%% MACAlgorithm
+%% MAC and PRF Algorithms
%-define(NULL, 0). %% Already defined by ssl_internal.hrl
-define(MD5, 1).
-define(SHA, 2).
+-define(MD5SHA, 4711). %% Not defined in protocol used to represent old prf
+-define(SHA224, 3).
+-define(SHA256, 4).
+-define(SHA384, 5).
+-define(SHA512, 6).
%% CompressionMethod
% -define(NULL, 0). %% Already defined by ssl_internal.hrl
@@ -176,7 +182,8 @@
content, % opaque content[TLSCompressed.length];
mac, % opaque MAC[CipherSpec.hash_size];
padding, % unit 8 padding[GenericBlockCipher.padding_length];
- padding_length % uint8 padding_length;
+ padding_length, % uint8 padding_length;
+ next_iv % opaque IV[SecurityParameters.record_iv_length];
}).
-endif. % -ifdef(ssl_record).
diff --git a/lib/ssl/src/ssl_session.erl b/lib/ssl/src/ssl_session.erl
index df5d7e0146..2ad422fc03 100644
--- a/lib/ssl/src/ssl_session.erl
+++ b/lib/ssl/src/ssl_session.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -28,9 +28,9 @@
-include("ssl_internal.hrl").
%% Internal application API
--export([is_new/2, id/4, id/7, valid_session/2]).
+-export([is_new/2, client_id/4, server_id/6, valid_session/2]).
--define(GEN_UNIQUE_ID_MAX_TRIES, 10).
+-define('24H_in_sec', 8640).
-type seconds() :: integer().
@@ -48,13 +48,13 @@ is_new(_ClientSuggestion, _ServerDecision) ->
true.
%%--------------------------------------------------------------------
--spec id({host(), inet:port_number(), #ssl_options{}}, db_handle(), atom(),
+-spec client_id({host(), inet:port_number(), #ssl_options{}}, db_handle(), atom(),
undefined | binary()) -> binary().
%%
-%% Description: Should be called by the client side to get an id
+%% Description: Should be called by the client side to get an id
%% for the client hello message.
%%--------------------------------------------------------------------
-id(ClientInfo, Cache, CacheCb, OwnCert) ->
+client_id(ClientInfo, Cache, CacheCb, OwnCert) ->
case select_session(ClientInfo, Cache, CacheCb, OwnCert) of
no_session ->
<<>>;
@@ -62,27 +62,6 @@ id(ClientInfo, Cache, CacheCb, OwnCert) ->
SessionId
end.
-%%--------------------------------------------------------------------
--spec id(inet:port_number(), binary(), #ssl_options{}, db_handle(),
- atom(), seconds(), binary()) -> binary().
-%%
-%% Description: Should be called by the server side to get an id
-%% for the server hello message.
-%%--------------------------------------------------------------------
-id(Port, <<>>, _, Cache, CacheCb, _, _) ->
- new_id(Port, ?GEN_UNIQUE_ID_MAX_TRIES, Cache, CacheCb);
-
-id(Port, SuggestedSessionId, #ssl_options{reuse_sessions = ReuseEnabled,
- reuse_session = ReuseFun},
- Cache, CacheCb, SecondLifeTime, OwnCert) ->
- case is_resumable(SuggestedSessionId, Port, ReuseEnabled,
- ReuseFun, Cache, CacheCb, SecondLifeTime, OwnCert) of
- true ->
- SuggestedSessionId;
- false ->
- new_id(Port, ?GEN_UNIQUE_ID_MAX_TRIES, Cache, CacheCb)
- end.
-%%--------------------------------------------------------------------
-spec valid_session(#session{}, seconds()) -> boolean().
%%
%% Description: Check that the session has not expired
@@ -91,57 +70,51 @@ valid_session(#session{time_stamp = TimeStamp}, LifeTime) ->
Now = calendar:datetime_to_gregorian_seconds({date(), time()}),
Now - TimeStamp < LifeTime.
+server_id(Port, <<>>, _SslOpts, _Cert, _, _) ->
+ {ssl_manager:new_session_id(Port), undefined};
+server_id(Port, SuggestedId,
+ #ssl_options{reuse_sessions = ReuseEnabled,
+ reuse_session = ReuseFun},
+ Cert, Cache, CacheCb) ->
+ LifeTime = case application:get_env(ssl, session_lifetime) of
+ {ok, Time} when is_integer(Time) -> Time;
+ _ -> ?'24H_in_sec'
+ end,
+ case is_resumable(SuggestedId, Port, ReuseEnabled,ReuseFun,
+ Cache, CacheCb, LifeTime, Cert)
+ of
+ {true, Resumed} ->
+ {SuggestedId, Resumed};
+ {false, undefined} ->
+ {ssl_manager:new_session_id(Port), undefined}
+ end.
+
%%--------------------------------------------------------------------
%%% Internal functions
%%--------------------------------------------------------------------
+select_session({_, _, #ssl_options{reuse_sessions=false}}, _Cache, _CacheCb, _OwnCert) ->
+ no_session;
select_session({HostIP, Port, SslOpts}, Cache, CacheCb, OwnCert) ->
Sessions = CacheCb:select_session(Cache, {HostIP, Port}),
select_session(Sessions, SslOpts, OwnCert).
select_session([], _, _) ->
no_session;
-
-select_session(Sessions, #ssl_options{ciphers = Ciphers,
- reuse_sessions = ReuseSession}, OwnCert) ->
- IsResumable =
- fun(Session) ->
- ReuseSession andalso resumable(Session#session.is_resumable) andalso
- lists:member(Session#session.cipher_suite, Ciphers)
- andalso (OwnCert == Session#session.own_certificate)
+select_session(Sessions, #ssl_options{ciphers = Ciphers}, OwnCert) ->
+ IsNotResumable =
+ fun([_Id, Session]) ->
+ not (resumable(Session#session.is_resumable) andalso
+ lists:member(Session#session.cipher_suite, Ciphers)
+ andalso (OwnCert == Session#session.own_certificate))
end,
- case [Id || [Id, Session] <- Sessions, IsResumable(Session)] of
- [] ->
- no_session;
- List ->
- hd(List)
- end.
-
-%% If we can not generate a not allready in use session ID in
-%% ?GEN_UNIQUE_ID_MAX_TRIES we make the new session uncacheable The
-%% value of ?GEN_UNIQUE_ID_MAX_TRIES is stolen from open SSL which
-%% states : "If we can not find a session id in
-%% ?GEN_UNIQUE_ID_MAX_TRIES either the RAND code is broken or someone
-%% is trying to open roughly very close to 2^128 (or 2^256) SSL
-%% sessions to our server"
-new_id(_, 0, _, _) ->
- <<>>;
-new_id(Port, Tries, Cache, CacheCb) ->
- Id = crypto:rand_bytes(?NUM_OF_SESSION_ID_BYTES),
- case CacheCb:lookup(Cache, {Port, Id}) of
- undefined ->
- Now = calendar:datetime_to_gregorian_seconds({date(), time()}),
- %% New sessions can not be set to resumable
- %% until handshake is compleate and the
- %% other session values are set.
- CacheCb:update(Cache, {Port, Id}, #session{session_id = Id,
- is_resumable = false,
- time_stamp = Now}),
- Id;
- _ ->
- new_id(Port, Tries - 1, Cache, CacheCb)
+ case lists:dropwhile(IsNotResumable, Sessions) of
+ [] -> no_session;
+ [[Id, _]|_] -> Id
end.
-is_resumable(SuggestedSessionId, Port, ReuseEnabled, ReuseFun, Cache,
+is_resumable(_, _, false, _, _, _, _, _) ->
+ {false, undefined};
+is_resumable(SuggestedSessionId, Port, true, ReuseFun, Cache,
CacheCb, SecondLifeTime, OwnCert) ->
case CacheCb:lookup(Cache, {Port, SuggestedSessionId}) of
#session{cipher_suite = CipherSuite,
@@ -149,14 +122,17 @@ is_resumable(SuggestedSessionId, Port, ReuseEnabled, ReuseFun, Cache,
compression_method = Compression,
is_resumable = IsResumable,
peer_certificate = PeerCert} = Session ->
- ReuseEnabled
- andalso resumable(IsResumable)
+ case resumable(IsResumable)
andalso (OwnCert == SessionOwnCert)
- andalso valid_session(Session, SecondLifeTime)
- andalso ReuseFun(SuggestedSessionId, PeerCert,
- Compression, CipherSuite);
+ andalso valid_session(Session, SecondLifeTime)
+ andalso ReuseFun(SuggestedSessionId, PeerCert,
+ Compression, CipherSuite)
+ of
+ true -> {true, Session};
+ false -> {false, undefined}
+ end;
undefined ->
- false
+ {false, undefined}
end.
resumable(new) ->
diff --git a/lib/ssl/src/ssl_session_cache.erl b/lib/ssl/src/ssl_session_cache.erl
index f9bbf905e1..5c6ee3c54c 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -32,7 +32,7 @@
%% Description: Return table reference. Called by ssl_manager process.
%%--------------------------------------------------------------------
init(_) ->
- ets:new(cache_name(), [set, protected]).
+ ets:new(cache_name(), [ordered_set, protected]).
%%--------------------------------------------------------------------
%% Description: Handles cache table at termination of ssl manager.
diff --git a/lib/ssl/src/ssl_ssl3.erl b/lib/ssl/src/ssl_ssl3.erl
index f2926b2d2f..a11c5b8c0c 100644
--- a/lib/ssl/src/ssl_ssl3.erl
+++ b/lib/ssl/src/ssl_ssl3.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -54,9 +54,9 @@ master_secret(PremasterSecret, ClientRandom, ServerRandom) ->
Block = generate_keyblock(PremasterSecret, ClientRandom, ServerRandom, 48),
Block.
--spec finished(client | server, binary(), {binary(), binary()}) -> binary().
+-spec finished(client | server, binary(), [binary()]) -> binary().
-finished(Role, MasterSecret, {MD5Hash, SHAHash}) ->
+finished(Role, MasterSecret, Handshake) ->
%% draft-ietf-tls-ssl-version3-00 - 5.6.9 Finished
%% struct {
%% opaque md5_hash[16];
@@ -70,13 +70,13 @@ finished(Role, MasterSecret, {MD5Hash, SHAHash}) ->
%% SHA(handshake_messages + Sender +
%% master_secret + pad1));
Sender = get_sender(Role),
- MD5 = handshake_hash(?MD5, MasterSecret, Sender, MD5Hash),
- SHA = handshake_hash(?SHA, MasterSecret, Sender, SHAHash),
+ MD5 = handshake_hash(?MD5, MasterSecret, Sender, Handshake),
+ SHA = handshake_hash(?SHA, MasterSecret, Sender, Handshake),
<<MD5/binary, SHA/binary>>.
--spec certificate_verify(OID::tuple(), binary(), {binary(), binary()}) -> binary().
+-spec certificate_verify(md5sha | sha, binary(), [binary()]) -> binary().
-certificate_verify(?'rsaEncryption', MasterSecret, {MD5Hash, SHAHash}) ->
+certificate_verify(md5sha, MasterSecret, Handshake) ->
%% md5_hash
%% MD5(master_secret + pad_2 +
%% MD5(handshake_messages + master_secret + pad_1));
@@ -84,15 +84,16 @@ certificate_verify(?'rsaEncryption', MasterSecret, {MD5Hash, SHAHash}) ->
%% SHA(master_secret + pad_2 +
%% SHA(handshake_messages + master_secret + pad_1));
- MD5 = handshake_hash(?MD5, MasterSecret, undefined, MD5Hash),
- SHA = handshake_hash(?SHA, MasterSecret, undefined, SHAHash),
+ MD5 = handshake_hash(?MD5, MasterSecret, undefined, Handshake),
+ SHA = handshake_hash(?SHA, MasterSecret, undefined, Handshake),
<<MD5/binary, SHA/binary>>;
-certificate_verify(?'id-dsa', MasterSecret, {_, SHAHash}) ->
+certificate_verify(sha, MasterSecret, Handshake) ->
%% sha_hash
%% SHA(master_secret + pad_2 +
%% SHA(handshake_messages + master_secret + pad_1));
- handshake_hash(?SHA, MasterSecret, undefined, SHAHash).
+
+ handshake_hash(?SHA, MasterSecret, undefined, Handshake).
-spec mac_hash(integer(), binary(), integer(), integer(), integer(), binary()) -> binary().
@@ -152,28 +153,17 @@ suites() ->
%%% Internal functions
%%--------------------------------------------------------------------
-hash(?MD5, Data) ->
+hash(?MD5, Data) ->
crypto:md5(Data);
-hash(?SHA, Data) ->
+hash(?SHA, Data) ->
crypto:sha(Data).
-hash_update(?MD5, Context, Data) ->
- crypto:md5_update(Context, Data);
-hash_update(?SHA, Context, Data) ->
- crypto:sha_update(Context, Data).
-
-hash_final(?MD5, Context) ->
- crypto:md5_final(Context);
-hash_final(?SHA, Context) ->
- crypto:sha_final(Context).
-
%%pad_1(?NULL) ->
%% "";
pad_1(?MD5) ->
<<"666666666666666666666666666666666666666666666666">>;
pad_1(?SHA) ->
<<"6666666666666666666666666666666666666666">>.
-
%%pad_2(?NULL) ->
%% "";
pad_2(?MD5) ->
@@ -189,19 +179,11 @@ mac_hash(Method, Secret, Data) ->
InnerHash = hash(Method, [Secret, pad_1(Method), Data]),
hash(Method, [Secret, pad_2(Method), InnerHash]).
-handshake_hash(Method, HandshakeHash, Extra) ->
- HSH = hash_update(Method, HandshakeHash, Extra),
- hash_final(Method, HSH).
-
-handshake_hash(Method, MasterSecret, undefined, HandshakeHash) ->
- InnerHash =
- handshake_hash(Method, HandshakeHash,
- [MasterSecret, pad_1(Method)]),
+handshake_hash(Method, MasterSecret, undefined, Handshake) ->
+ InnerHash = hash(Method, [Handshake, MasterSecret, pad_1(Method)]),
hash(Method, [MasterSecret, pad_2(Method), InnerHash]);
-handshake_hash(Method, MasterSecret, Sender, HandshakeHash) ->
- InnerHash =
- handshake_hash(Method, HandshakeHash,
- [Sender, MasterSecret, pad_1(Method)]),
+handshake_hash(Method, MasterSecret, Sender, Handshake) ->
+ InnerHash = hash(Method, [Handshake, Sender, MasterSecret, pad_1(Method)]),
hash(Method, [MasterSecret, pad_2(Method), InnerHash]).
get_sender(client) -> "CLNT";
diff --git a/lib/ssl/src/ssl_tls1.erl b/lib/ssl/src/ssl_tls1.erl
index 5f9850c386..41dc1bf0dc 100644
--- a/lib/ssl/src/ssl_tls1.erl
+++ b/lib/ssl/src/ssl_tls1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -26,27 +26,29 @@
-include("ssl_cipher.hrl").
-include("ssl_internal.hrl").
--include("ssl_record.hrl").
+-include("ssl_record.hrl").
--export([master_secret/3, finished/3, certificate_verify/2, mac_hash/7,
- setup_keys/6, suites/0]).
+-export([master_secret/4, finished/5, certificate_verify/3, mac_hash/7,
+ setup_keys/8, suites/1, prf/5]).
%%====================================================================
%% Internal application API
%%====================================================================
--spec master_secret(binary(), binary(), binary()) -> binary().
+-spec master_secret(integer(), binary(), binary(), binary()) -> binary().
-master_secret(PreMasterSecret, ClientRandom, ServerRandom) ->
- %% RFC 2246 & 4346 - 8.1 %% master_secret = PRF(pre_master_secret,
- %% "master secret", ClientHello.random +
- %% ServerHello.random)[0..47];
- prf(PreMasterSecret, <<"master secret">>,
+master_secret(PrfAlgo, PreMasterSecret, ClientRandom, ServerRandom) ->
+ %% RFC 2246 & 4346 && RFC 5246 - 8.1 %% master_secret = PRF(pre_master_secret,
+ %% "master secret", ClientHello.random +
+ %% ServerHello.random)[0..47];
+
+ prf(PrfAlgo, PreMasterSecret, <<"master secret">>,
[ClientRandom, ServerRandom], 48).
--spec finished(client | server, binary(), {binary(), binary()}) -> binary().
+-spec finished(client | server, integer(), integer(), binary(), [binary()]) -> binary().
-finished(Role, MasterSecret, {MD5Hash, SHAHash}) ->
+finished(Role, Version, PrfAlgo, MasterSecret, Handshake)
+ when Version == 1; Version == 2; PrfAlgo == ?MD5SHA ->
%% RFC 2246 & 4346 - 7.4.9. Finished
%% struct {
%% opaque verify_data[12];
@@ -55,26 +57,39 @@ finished(Role, MasterSecret, {MD5Hash, SHAHash}) ->
%% verify_data
%% PRF(master_secret, finished_label, MD5(handshake_messages) +
%% SHA-1(handshake_messages)) [0..11];
- MD5 = hash_final(?MD5, MD5Hash),
- SHA = hash_final(?SHA, SHAHash),
- prf(MasterSecret, finished_label(Role), [MD5, SHA], 12).
+ MD5 = crypto:md5(Handshake),
+ SHA = crypto:sha(Handshake),
+ prf(?MD5SHA, MasterSecret, finished_label(Role), [MD5, SHA], 12);
+
+finished(Role, Version, PrfAlgo, MasterSecret, Handshake)
+ when Version == 3 ->
+ %% RFC 5246 - 7.4.9. Finished
+ %% struct {
+ %% opaque verify_data[12];
+ %% } Finished;
+ %%
+ %% verify_data
+ %% PRF(master_secret, finished_label, Hash(handshake_messages)) [0..11];
+ Hash = crypto:hash(mac_algo(PrfAlgo), Handshake),
+ prf(PrfAlgo, MasterSecret, finished_label(Role), Hash, 12).
--spec certificate_verify(OID::tuple(), {binary(), binary()}) -> binary().
+-spec certificate_verify(md5sha | sha, integer(), [binary()]) -> binary().
-certificate_verify(?'rsaEncryption', {MD5Hash, SHAHash}) ->
- MD5 = hash_final(?MD5, MD5Hash),
- SHA = hash_final(?SHA, SHAHash),
+certificate_verify(md5sha, _Version, Handshake) ->
+ MD5 = crypto:md5(Handshake),
+ SHA = crypto:sha(Handshake),
<<MD5/binary, SHA/binary>>;
-certificate_verify(?'id-dsa', {_, SHAHash}) ->
- hash_final(?SHA, SHAHash).
+certificate_verify(HashAlgo, _Version, Handshake) ->
+ crypto:hash(HashAlgo, Handshake).
--spec setup_keys(binary(), binary(), binary(), integer(),
- integer(), integer()) -> {binary(), binary(), binary(),
+-spec setup_keys(integer(), integer(), binary(), binary(), binary(), integer(),
+ integer(), integer()) -> {binary(), binary(), binary(),
binary(), binary(), binary()}.
-setup_keys(MasterSecret, ServerRandom, ClientRandom, HashSize,
- KeyMatLen, IVSize) ->
+setup_keys(Version, _PrfAlgo, MasterSecret, ServerRandom, ClientRandom, HashSize,
+ KeyMatLen, IVSize)
+ when Version == 1 ->
%% RFC 2246 - 6.3. Key calculation
%% key_block = PRF(SecurityParameters.master_secret,
%% "key expansion",
@@ -88,36 +103,67 @@ setup_keys(MasterSecret, ServerRandom, ClientRandom, HashSize,
%% client_write_IV[SecurityParameters.IV_size]
%% server_write_IV[SecurityParameters.IV_size]
WantedLength = 2 * (HashSize + KeyMatLen + IVSize),
- KeyBlock = prf(MasterSecret, "key expansion",
+ KeyBlock = prf(?MD5SHA, MasterSecret, "key expansion",
[ServerRandom, ClientRandom], WantedLength),
<<ClientWriteMacSecret:HashSize/binary,
ServerWriteMacSecret:HashSize/binary,
ClientWriteKey:KeyMatLen/binary, ServerWriteKey:KeyMatLen/binary,
ClientIV:IVSize/binary, ServerIV:IVSize/binary>> = KeyBlock,
{ClientWriteMacSecret, ServerWriteMacSecret, ClientWriteKey,
- ServerWriteKey, ClientIV, ServerIV}.
+ ServerWriteKey, ClientIV, ServerIV};
+
+%% TLS v1.1
+setup_keys(Version, _PrfAlgo, MasterSecret, ServerRandom, ClientRandom, HashSize,
+ KeyMatLen, IVSize)
+ when Version == 2 ->
+ %% RFC 4346 - 6.3. Key calculation
+ %% key_block = PRF(SecurityParameters.master_secret,
+ %% "key expansion",
+ %% SecurityParameters.server_random +
+ %% SecurityParameters.client_random);
+ %% Then the key_block is partitioned as follows:
+ %% client_write_MAC_secret[SecurityParameters.hash_size]
+ %% server_write_MAC_secret[SecurityParameters.hash_size]
+ %% client_write_key[SecurityParameters.key_material_length]
+ %% server_write_key[SecurityParameters.key_material_length]
+ %%
+ %% RFC 4346 is incomplete, the client and server IVs have to
+ %% be generated just like for TLS 1.0
+ WantedLength = 2 * (HashSize + KeyMatLen + IVSize),
+ KeyBlock = prf(?MD5SHA, MasterSecret, "key expansion",
+ [ServerRandom, ClientRandom], WantedLength),
+ <<ClientWriteMacSecret:HashSize/binary,
+ ServerWriteMacSecret:HashSize/binary,
+ ClientWriteKey:KeyMatLen/binary, ServerWriteKey:KeyMatLen/binary,
+ ClientIV:IVSize/binary, ServerIV:IVSize/binary>> = KeyBlock,
+ {ClientWriteMacSecret, ServerWriteMacSecret, ClientWriteKey,
+ ServerWriteKey, ClientIV, ServerIV};
-%% TLS v1.1 uncomment when supported.
-%% setup_keys(MasterSecret, ServerRandom, ClientRandom, HashSize, KeyMatLen) ->
-%% %% RFC 4346 - 6.3. Key calculation
-%% %% key_block = PRF(SecurityParameters.master_secret,
-%% %% "key expansion",
-%% %% SecurityParameters.server_random +
-%% %% SecurityParameters.client_random);
-%% %% Then the key_block is partitioned as follows:
-%% %% client_write_MAC_secret[SecurityParameters.hash_size]
-%% %% server_write_MAC_secret[SecurityParameters.hash_size]
-%% %% client_write_key[SecurityParameters.key_material_length]
-%% %% server_write_key[SecurityParameters.key_material_length]
-%% WantedLength = 2 * (HashSize + KeyMatLen),
-%% KeyBlock = prf(MasterSecret, "key expansion",
-%% [ServerRandom, ClientRandom], WantedLength),
-%% <<ClientWriteMacSecret:HashSize/binary,
-%% ServerWriteMacSecret:HashSize/binary,
-%% ClientWriteKey:KeyMatLen/binary, ServerWriteKey:KeyMatLen/binary>>
-%% = KeyBlock,
-%% {ClientWriteMacSecret, ServerWriteMacSecret, ClientWriteKey,
-%% ServerWriteKey, undefined, undefined}.
+%% TLS v1.2
+setup_keys(Version, PrfAlgo, MasterSecret, ServerRandom, ClientRandom, HashSize,
+ KeyMatLen, IVSize)
+ when Version == 3 ->
+ %% RFC 5246 - 6.3. Key calculation
+ %% key_block = PRF(SecurityParameters.master_secret,
+ %% "key expansion",
+ %% SecurityParameters.server_random +
+ %% SecurityParameters.client_random);
+ %% Then the key_block is partitioned as follows:
+ %% client_write_MAC_secret[SecurityParameters.hash_size]
+ %% server_write_MAC_secret[SecurityParameters.hash_size]
+ %% client_write_key[SecurityParameters.key_material_length]
+ %% server_write_key[SecurityParameters.key_material_length]
+ %% client_write_IV[SecurityParameters.fixed_iv_length]
+ %% server_write_IV[SecurityParameters.fixed_iv_length]
+ WantedLength = 2 * (HashSize + KeyMatLen + IVSize),
+ KeyBlock = prf(PrfAlgo, MasterSecret, "key expansion",
+ [ServerRandom, ClientRandom], WantedLength),
+ <<ClientWriteMacSecret:HashSize/binary,
+ ServerWriteMacSecret:HashSize/binary,
+ ClientWriteKey:KeyMatLen/binary, ServerWriteKey:KeyMatLen/binary,
+ ClientIV:IVSize/binary, ServerIV:IVSize/binary>> = KeyBlock,
+ {ClientWriteMacSecret, ServerWriteMacSecret, ClientWriteKey,
+ ServerWriteKey, ClientIV, ServerIV}.
-spec mac_hash(integer(), binary(), integer(), integer(), tls_version(),
integer(), binary()) -> binary().
@@ -134,9 +180,9 @@ mac_hash(Method, Mac_write_secret, Seq_num, Type, {Major, Minor},
Fragment]),
Mac.
--spec suites() -> [cipher_suite()].
+-spec suites(1|2|3) -> [cipher_suite()].
-suites() ->
+suites(Minor) when Minor == 1; Minor == 2->
[
?TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
?TLS_DHE_DSS_WITH_AES_256_CBC_SHA,
@@ -152,7 +198,19 @@ suites() ->
?TLS_RSA_WITH_RC4_128_MD5,
?TLS_DHE_RSA_WITH_DES_CBC_SHA,
?TLS_RSA_WITH_DES_CBC_SHA
- ].
+ ];
+
+suites(Minor) when Minor == 3 ->
+ [
+ ?TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,
+ ?TLS_DHE_DSS_WITH_AES_256_CBC_SHA256,
+ ?TLS_RSA_WITH_AES_256_CBC_SHA256,
+ ?TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,
+ ?TLS_DHE_DSS_WITH_AES_128_CBC_SHA256,
+ ?TLS_RSA_WITH_AES_128_CBC_SHA256
+ %% ?TLS_DH_anon_WITH_AES_128_CBC_SHA256,
+ %% ?TLS_DH_anon_WITH_AES_256_CBC_SHA256
+ ] ++ suites(2).
%%--------------------------------------------------------------------
%%% Internal functions
@@ -163,7 +221,19 @@ hmac_hash(?NULL, _, _) ->
hmac_hash(?MD5, Key, Value) ->
crypto:md5_mac(Key, Value);
hmac_hash(?SHA, Key, Value) ->
- crypto:sha_mac(Key, Value).
+ crypto:sha_mac(Key, Value);
+hmac_hash(?SHA256, Key, Value) ->
+ crypto:sha256_mac(Key, Value);
+hmac_hash(?SHA384, Key, Value) ->
+ crypto:sha384_mac(Key, Value);
+hmac_hash(?SHA512, Key, Value) ->
+ crypto:sha512_mac(Key, Value).
+
+mac_algo(?MD5) -> md5;
+mac_algo(?SHA) -> sha;
+mac_algo(?SHA256) -> sha256;
+mac_algo(?SHA384) -> sha384;
+mac_algo(?SHA512) -> sha512.
% First, we define a data expansion function, P_hash(secret, data) that
% uses a single hash function to expand a secret and seed into an
@@ -182,7 +252,7 @@ p_hash(_Secret, _Seed, WantedLength, _Method, _N, [Last | Acc])
when WantedLength =< 0 ->
Keep = byte_size(Last) + WantedLength,
<<B:Keep/binary, _/binary>> = Last,
- lists:reverse(Acc, [B]);
+ list_to_binary(lists:reverse(Acc, [B]));
p_hash(Secret, Seed, WantedLength, Method, N, Acc) ->
N1 = N+1,
Bin = hmac_hash(Method, Secret, [a(N1, Secret, Seed, Method), Seed]),
@@ -214,13 +284,18 @@ split_secret(BinSecret) ->
<<_:Div/binary, Secret2:EvenLength/binary>> = BinSecret,
{Secret1, Secret2}.
-prf(Secret, Label, Seed, WantedLength) ->
+prf(?MD5SHA, Secret, Label, Seed, WantedLength) ->
%% PRF(secret, label, seed) = P_MD5(S1, label + seed) XOR
%% P_SHA-1(S2, label + seed);
{S1, S2} = split_secret(Secret),
LS = list_to_binary([Label, Seed]),
crypto:exor(p_hash(S1, LS, WantedLength, ?MD5),
- p_hash(S2, LS, WantedLength, ?SHA)).
+ p_hash(S2, LS, WantedLength, ?SHA));
+
+prf(MAC, Secret, Label, Seed, WantedLength) ->
+ %% PRF(secret, label, seed) = P_SHA256(secret, label + seed);
+ LS = list_to_binary([Label, Seed]),
+ p_hash(Secret, LS, WantedLength, MAC).
%%%% Misc help functions %%%%
@@ -228,8 +303,3 @@ finished_label(client) ->
<<"client finished">>;
finished_label(server) ->
<<"server finished">>.
-
-hash_final(?MD5, Conntext) ->
- crypto:md5_final(Conntext);
-hash_final(?SHA, Conntext) ->
- crypto:sha_final(Conntext).
diff --git a/lib/ssl/src/ssl_tls_dist_proxy.erl b/lib/ssl/src/ssl_tls_dist_proxy.erl
index d63eada571..a8476b104f 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2012. 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
@@ -19,7 +19,7 @@
-module(ssl_tls_dist_proxy).
--export([listen/1, accept/1, connect/2, get_remote_id/2]).
+-export([listen/1, accept/1, connect/2, get_tcp_address/1]).
-export([init/1, start_link/0, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3, ssl_options/2]).
@@ -47,9 +47,6 @@ accept(Listen) ->
connect(Ip, Port) ->
gen_server:call(?MODULE, {connect, Ip, Port}, infinity).
-get_remote_id(Socket, Node) ->
- gen_server:call(?MODULE, {get_remote_id, {Socket,Node}}, infinity).
-
%%====================================================================
%% gen_server callbacks
%%====================================================================
@@ -65,8 +62,8 @@ handle_call({listen, Name}, _From, State) ->
case gen_tcp:listen(0, [{active, false}, {packet,?PPRE}]) of
{ok, Socket} ->
{ok, World} = gen_tcp:listen(0, [{active, false}, binary, {packet,?PPRE}]),
- TcpAddress = get_tcp_address(Socket),
- WorldTcpAddress = get_tcp_address(World),
+ {ok, TcpAddress} = get_tcp_address(Socket),
+ {ok, WorldTcpAddress} = get_tcp_address(World),
{_,Port} = WorldTcpAddress#net_address.address,
{ok, Creation} = erl_epmd:register_node(Name, Port),
{reply, {ok, {Socket, TcpAddress, Creation}},
@@ -87,17 +84,16 @@ handle_call({connect, Ip, Port}, {From, _}, State) ->
receive
{Pid, go_ahead, LPort} ->
Res = {ok, Socket} = try_connect(LPort),
- ok = gen_tcp:controlling_process(Socket, From),
- flush_old_controller(From, Socket),
- {reply, Res, State};
+ case gen_tcp:controlling_process(Socket, From) of
+ {error, badarg} = Error -> {reply, Error, State}; % From is dead anyway.
+ ok ->
+ flush_old_controller(From, Socket),
+ {reply, Res, State}
+ end;
{Pid, Error} ->
{reply, Error, State}
end;
-handle_call({get_remote_id, {Socket,_Node}}, _From, State) ->
- Address = get_tcp_address(Socket),
- {reply, Address, State};
-
handle_call(_What, _From, State) ->
{reply, ok, State}.
@@ -117,14 +113,18 @@ code_change(_OldVsn, St, _Extra) ->
%%% Internal functions
%%--------------------------------------------------------------------
get_tcp_address(Socket) ->
- {ok, Address} = inet:sockname(Socket),
- {ok, Host} = inet:gethostname(),
- #net_address{
+ case inet:sockname(Socket) of
+ {ok, Address} ->
+ {ok, Host} = inet:gethostname(),
+ NetAddress = #net_address{
address = Address,
host = Host,
protocol = proxy,
family = inet
- }.
+ },
+ {ok, NetAddress};
+ {error, _} = Error -> Error
+ end.
accept_loop(Proxy, erts = Type, Listen, Extra) ->
process_flag(priority, max),
@@ -178,8 +178,8 @@ setup_proxy(Ip, Port, Parent) ->
Opts = get_ssl_options(client),
case ssl:connect(Ip, Port, [{active, true}, binary, {packet,?PPRE}] ++ Opts) of
{ok, World} ->
- {ok, ErtsL} = gen_tcp:listen(0, [{active, true}, binary, {packet,?PPRE}]),
- #net_address{address={_,LPort}} = get_tcp_address(ErtsL),
+ {ok, ErtsL} = gen_tcp:listen(0, [{active, true}, {ip, {127,0,0,1}}, binary, {packet,?PPRE}]),
+ {ok, #net_address{address={_,LPort}}} = get_tcp_address(ErtsL),
Parent ! {self(), go_ahead, LPort},
case gen_tcp:accept(ErtsL) of
{ok, Erts} ->
@@ -194,7 +194,7 @@ setup_proxy(Ip, Port, Parent) ->
setup_connection(World, ErtsListen) ->
process_flag(trap_exit, true),
- TcpAddress = get_tcp_address(ErtsListen),
+ {ok, TcpAddress} = get_tcp_address(ErtsListen),
{_Addr,Port} = TcpAddress#net_address.address,
{ok, Erts} = gen_tcp:connect({127,0,0,1}, Port, [{active, true}, binary, {packet,?PPRE}]),
ssl:setopts(World, [{active,true}, {packet,?PPRE}]),
@@ -223,7 +223,11 @@ loop_conn_setup(World, Erts) ->
loop_conn_setup(World, Erts);
{tcp, Erts, Data} ->
ssl:send(World, Data),
- loop_conn_setup(World, Erts)
+ loop_conn_setup(World, Erts);
+ {tcp_closed, Erts} ->
+ ssl:close(World);
+ {ssl_closed, World} ->
+ gen_tcp:close(Erts)
end.
loop_conn(World, Erts) ->
diff --git a/lib/ssl/test/Makefile b/lib/ssl/test/Makefile
index 6b1da63d08..d36dcb588b 100644
--- a/lib/ssl/test/Makefile
+++ b/lib/ssl/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -44,6 +44,8 @@ MODULES = \
ssl_to_openssl_SUITE \
ssl_session_cache_SUITE \
ssl_dist_SUITE \
+ ssl_npn_hello_SUITE \
+ ssl_npn_handshake_SUITE \
make_certs\
erl_make_certs
@@ -120,11 +122,11 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(HRL_FILES_NEEDED_IN_TEST) $(COVER_FILE) $(RELSYSDIR)
- $(INSTALL_DATA) ssl.spec ssl.cover $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(HRL_FILES_NEEDED_IN_TEST) $(COVER_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DATA) ssl.spec ssl.cover "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/ssl/test/make_certs.erl b/lib/ssl/test/make_certs.erl
index 693289990c..4603a9f846 100644
--- a/lib/ssl/test/make_certs.erl
+++ b/lib/ssl/test/make_certs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -121,7 +121,19 @@ create_self_signed_cert(Root, OpenSSLCmd, CAName, Cnf) ->
" -keyout ", KeyFile,
" -out ", CertFile],
Env = [{"ROOTDIR", Root}],
- cmd(Cmd, Env).
+ cmd(Cmd, Env),
+ fix_key_file(OpenSSLCmd, KeyFile).
+
+% openssl 1.0 generates key files in pkcs8 format by default and we don't handle this format
+fix_key_file(OpenSSLCmd, KeyFile) ->
+ KeyFileTmp = KeyFile ++ ".tmp",
+ Cmd = [OpenSSLCmd, " rsa",
+ " -in ",
+ KeyFile,
+ " -out ",
+ KeyFileTmp],
+ cmd(Cmd, []),
+ ok = file:rename(KeyFileTmp, KeyFile).
create_ca_dir(Root, CAName, Cnf) ->
CARoot = filename:join([Root, CAName]),
@@ -139,7 +151,8 @@ create_req(Root, OpenSSLCmd, CnfFile, KeyFile, ReqFile) ->
" -keyout ", KeyFile,
" -out ", ReqFile],
Env = [{"ROOTDIR", Root}],
- cmd(Cmd, Env).
+ cmd(Cmd, Env),
+ fix_key_file(OpenSSLCmd, KeyFile).
sign_req(Root, OpenSSLCmd, CA, CertType, ReqFile, CertFile) ->
CACnfFile = filename:join([Root, CA, "ca.cnf"]),
diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl
index 527263363c..6cf712fa6f 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -27,9 +27,11 @@
-include_lib("common_test/include/ct.hrl").
-include_lib("public_key/include/public_key.hrl").
+-include("ssl_internal.hrl").
-include("ssl_alert.hrl").
-include("ssl_internal.hrl").
-include("ssl_record.hrl").
+-include("ssl_handshake.hrl").
-define('24H_in_sec', 86400).
-define(TIMEOUT, 60000).
@@ -37,6 +39,7 @@
-define(EXPIRE, 10).
-define(SLEEP, 500).
-define(RENEGOTIATION_DISABLE_TIME, 12000).
+-define(CLEAN_SESSION_DB, 60000).
%% Test server callback functions
%%--------------------------------------------------------------------
@@ -50,10 +53,10 @@
%%--------------------------------------------------------------------
init_per_suite(Config0) ->
Dog = ssl_test_lib:timetrap(?LONG_TIMEOUT *2),
+ catch crypto:stop(),
try crypto:start() of
ok ->
application:start(public_key),
- ssl:start(),
%% make rsa certs using oppenssl
Result =
@@ -90,44 +93,26 @@ end_per_suite(_Config) ->
%% variable, but should NOT alter/remove any existing entries.
%% Description: Initialization before each test case
%%--------------------------------------------------------------------
-init_per_testcase(session_cache_process_list, Config) ->
- init_customized_session_cache(list, Config);
-
-init_per_testcase(session_cache_process_mnesia, Config) ->
- mnesia:start(),
- init_customized_session_cache(mnesia, Config);
-
-init_per_testcase(reuse_session_expired, Config0) ->
- Config = lists:keydelete(watchdog, 1, Config0),
- Dog = ssl_test_lib:timetrap(?EXPIRE * 1000 * 5),
- ssl:stop(),
- application:load(ssl),
- application:set_env(ssl, session_lifetime, ?EXPIRE),
- ssl:start(),
- [{watchdog, Dog} | Config];
-
init_per_testcase(no_authority_key_identifier, Config) ->
%% Clear cach so that root cert will not
%% be found.
- ssl:stop(),
- ssl:start(),
+ ssl:clear_pem_cache(),
Config;
-init_per_testcase(TestCase, Config) when TestCase == ciphers_rsa_signed_certs_ssl3;
- TestCase == ciphers_rsa_signed_certs_openssl_names_ssl3;
- TestCase == ciphers_dsa_signed_certs_ssl3;
- TestCase == ciphers_dsa_signed_certs_openssl_names_ssl3 ->
+init_per_testcase(protocol_versions, Config) ->
ssl:stop(),
application:load(ssl),
- application:set_env(ssl, protocol_version, sslv3),
+ %% For backwards compatibility sslv2 should be filtered out.
+ application:set_env(ssl, protocol_version, [sslv2, sslv3, tlsv1]),
ssl:start(),
Config;
-init_per_testcase(protocol_versions, Config) ->
+init_per_testcase(reuse_session_expired, Config0) ->
+ Config = lists:keydelete(watchdog, 1, Config0),
ssl:stop(),
application:load(ssl),
- %% For backwards compatibility sslv2 should be filtered out.
- application:set_env(ssl, protocol_version, [sslv2, sslv3, tlsv1]),
+ application:set_env(ssl, session_lifetime, ?EXPIRE),
+ application:set_env(ssl, session_delay_cleanup_time, 500),
ssl:start(),
Config;
@@ -138,24 +123,15 @@ init_per_testcase(empty_protocol_versions, Config) ->
ssl:start(),
Config;
-init_per_testcase(different_ca_peer_sign, Config0) ->
- ssl_test_lib:make_mix_cert(Config0);
+%% init_per_testcase(different_ca_peer_sign, Config0) ->
+%% ssl_test_lib:make_mix_cert(Config0);
init_per_testcase(_TestCase, Config0) ->
+ test_server:format("TLS/SSL version ~p~n ", [ssl_record:supported_protocol_versions()]),
Config = lists:keydelete(watchdog, 1, Config0),
Dog = test_server:timetrap(?TIMEOUT),
[{watchdog, Dog} | Config].
-init_customized_session_cache(Type, Config0) ->
- Config = lists:keydelete(watchdog, 1, Config0),
- Dog = test_server:timetrap(?TIMEOUT),
- ssl:stop(),
- application:load(ssl),
- application:set_env(ssl, session_cb, ?MODULE),
- application:set_env(ssl, session_cb_init_args, [Type]),
- ssl:start(),
- [{watchdog, Dog} | Config].
-
%%--------------------------------------------------------------------
%% Function: end_per_testcase(TestCase, Config) -> _
%% Case - atom()
@@ -164,27 +140,11 @@ init_customized_session_cache(Type, Config0) ->
%% A list of key/value pairs, holding the test case configuration.
%% Description: Cleanup after each test case
%%--------------------------------------------------------------------
-end_per_testcase(session_cache_process_list, Config) ->
- application:unset_env(ssl, session_cb),
- end_per_testcase(default_action, Config);
-end_per_testcase(session_cache_process_mnesia, Config) ->
- application:unset_env(ssl, session_cb),
- application:unset_env(ssl, session_cb_init_args),
- mnesia:stop(),
- ssl:stop(),
- ssl:start(),
- end_per_testcase(default_action, Config);
end_per_testcase(reuse_session_expired, Config) ->
application:unset_env(ssl, session_lifetime),
+ application:unset_env(ssl, session_delay_cleanup_time),
end_per_testcase(default_action, Config);
-end_per_testcase(TestCase, Config) when TestCase == ciphers_rsa_signed_certs_ssl3;
- TestCase == ciphers_rsa_signed_certs_openssl_names_ssl3;
- TestCase == ciphers_dsa_signed_certs_ssl3;
- TestCase == ciphers_dsa_signed_certs_openssl_names_ssl3;
- TestCase == protocol_versions;
- TestCase == empty_protocol_versions->
- application:unset_env(ssl, protocol_version),
- end_per_testcase(default_action, Config);
+
end_per_testcase(_TestCase, Config) ->
Dog = ?config(watchdog, Config),
case Dog of
@@ -205,71 +165,170 @@ end_per_testcase(_TestCase, Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [app, alerts, connection_info, protocol_versions,
- empty_protocol_versions, controlling_process,
- controller_dies, client_closes_socket,
- connect_dist, peername, peercert, sockname, socket_options,
- invalid_inet_get_option, invalid_inet_get_option_not_list,
+ [
+ {group, basic},
+ {group, options},
+ {group, session},
+ {group, 'tlsv1.2'},
+ {group, 'tlsv1.1'},
+ {group, 'tlsv1'},
+ {group, 'sslv3'}
+ ].
+
+groups() ->
+ [{basic, [], basic_tests()},
+ {options, [], options_tests()},
+ {'tlsv1.2', [], all_versions_groups()},
+ {'tlsv1.1', [], all_versions_groups()},
+ {'tlsv1', [], all_versions_groups() ++ rizzo_tests()},
+ {'sslv3', [], all_versions_groups() ++ rizzo_tests()},
+ {api,[], api_tests()},
+ {certificate_verify, [], certificate_verify_tests()},
+ {session, [], session_tests()},
+ {renegotiate, [], renegotiate_tests()},
+ {ciphers, [], cipher_tests()},
+ {error_handling_tests, [], error_handling_tests()}
+ ].
+
+all_versions_groups ()->
+ [{group, api},
+ {group, certificate_verify},
+ {group, renegotiate},
+ {group, ciphers},
+ {group, error_handling_tests}].
+
+init_per_group(GroupName, Config) ->
+ case ssl_test_lib:is_tls_version(GroupName) of
+ true ->
+ case ssl_test_lib:sufficient_crypto_support(GroupName) of
+ true ->
+ ssl_test_lib:init_tls_version(GroupName),
+ Config;
+ false ->
+ {skip, "Missing crypto support"}
+ end;
+ _ ->
+ ssl:start(),
+ Config
+ end.
+
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+basic_tests() ->
+ [app,
+ alerts,
+ send_close,
+ connect_twice,
+ connect_dist
+ ].
+
+options_tests() ->
+ [der_input,
+ misc_ssl_options,
+ socket_options,
+ invalid_inet_get_option,
+ invalid_inet_get_option_not_list,
invalid_inet_get_option_improper_list,
- invalid_inet_set_option, invalid_inet_set_option_not_list,
+ invalid_inet_set_option,
+ invalid_inet_set_option_not_list,
invalid_inet_set_option_improper_list,
- misc_ssl_options, versions, cipher_suites, upgrade,
- upgrade_with_timeout, tcp_connect, tcp_connect_big, ipv6, ekeyfile,
- ecertfile, ecacertfile, eoptions, shutdown,
- shutdown_write, shutdown_both, shutdown_error,
- ciphers_rsa_signed_certs, ciphers_rsa_signed_certs_ssl3,
- ciphers_rsa_signed_certs_openssl_names,
- ciphers_rsa_signed_certs_openssl_names_ssl3,
- ciphers_dsa_signed_certs, ciphers_dsa_signed_certs_ssl3,
- ciphers_dsa_signed_certs_openssl_names,
- ciphers_dsa_signed_certs_openssl_names_ssl3,
- anonymous_cipher_suites,
- default_reject_anonymous,
- send_close,
- close_transport_accept, dh_params,
- server_verify_peer_passive, server_verify_peer_active,
+ dh_params,
+ ecertfile,
+ ecacertfile,
+ ekeyfile,
+ eoptions,
+ protocol_versions,
+ empty_protocol_versions,
+ ipv6,
+ reuseaddr].
+
+api_tests() ->
+ [connection_info,
+ peername,
+ peercert,
+ sockname,
+ versions,
+ controlling_process,
+ upgrade,
+ upgrade_with_timeout,
+ shutdown,
+ shutdown_write,
+ shutdown_both,
+ shutdown_error,
+ hibernate
+ ].
+
+certificate_verify_tests() ->
+ [server_verify_peer_passive,
+ server_verify_peer_active,
server_verify_peer_active_once,
- server_verify_none_passive, server_verify_none_active,
+ server_verify_none_passive,
+ server_verify_none_active,
server_verify_none_active_once,
- server_verify_no_cacerts, server_require_peer_cert_ok,
+ server_verify_no_cacerts,
+ server_require_peer_cert_ok,
server_require_peer_cert_fail,
server_verify_client_once_passive,
server_verify_client_once_active,
server_verify_client_once_active_once,
- client_verify_none_passive, client_verify_none_active,
+ client_verify_none_passive,
+ client_verify_none_active,
client_verify_none_active_once,
- reuse_session,
- reuse_session_expired,
- server_does_not_want_to_reuse_session,
- client_renegotiate, server_renegotiate,
- client_renegotiate_reused_session,
- server_renegotiate_reused_session,
- client_no_wrap_sequence_number,
- server_no_wrap_sequence_number, extended_key_usage_verify_peer,
+ extended_key_usage_verify_peer,
extended_key_usage_verify_none,
- no_authority_key_identifier, invalid_signature_client,
- invalid_signature_server, cert_expired,
+ invalid_signature_client,
+ invalid_signature_server,
+ cert_expired,
client_with_cert_cipher_suites_handshake,
- unknown_server_ca_fail, der_input,
+ verify_fun_always_run_client,
+ verify_fun_always_run_server,
+ unknown_server_ca_fail,
unknown_server_ca_accept_verify_none,
unknown_server_ca_accept_verify_peer,
unknown_server_ca_accept_backwardscompatibility,
- %%different_ca_peer_sign,
- no_reuses_session_server_restart_new_cert,
- no_reuses_session_server_restart_new_cert_file, reuseaddr,
- hibernate, connect_twice, renegotiate_dos_mitigate_active,
- renegotiate_dos_mitigate_passive,
- tcp_error_propagation_in_active_mode, rizzo, no_rizzo_rc4
+ no_authority_key_identifier
].
-groups() ->
- [].
+session_tests() ->
+ [reuse_session,
+ reuse_session_expired,
+ server_does_not_want_to_reuse_session,
+ no_reuses_session_server_restart_new_cert,
+ no_reuses_session_server_restart_new_cert_file].
-init_per_group(_GroupName, Config) ->
- Config.
+renegotiate_tests() ->
+ [client_renegotiate,
+ server_renegotiate,
+ client_renegotiate_reused_session,
+ server_renegotiate_reused_session,
+ client_no_wrap_sequence_number,
+ server_no_wrap_sequence_number,
+ renegotiate_dos_mitigate_active,
+ renegotiate_dos_mitigate_passive].
-end_per_group(_GroupName, Config) ->
- Config.
+cipher_tests() ->
+ [cipher_suites,
+ ciphers_rsa_signed_certs,
+ ciphers_rsa_signed_certs_openssl_names,
+ ciphers_dsa_signed_certs,
+ ciphers_dsa_signed_certs_openssl_names,
+ anonymous_cipher_suites,
+ default_reject_anonymous].
+
+error_handling_tests()->
+ [controller_dies,
+ client_closes_socket,
+ tcp_error_propagation_in_active_mode,
+ tcp_connect,
+ tcp_connect_big,
+ close_transport_accept
+ ].
+
+rizzo_tests() ->
+ [rizzo,
+ no_rizzo_rc4].
%% Test cases starts here.
%%--------------------------------------------------------------------
@@ -1722,21 +1781,7 @@ ciphers_rsa_signed_certs(Config) when is_list(Config) ->
ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
Ciphers = ssl_test_lib:rsa_suites(),
- test_server:format("tls1 erlang cipher suites ~p~n", [Ciphers]),
- run_suites(Ciphers, Version, Config, rsa).
-
-ciphers_rsa_signed_certs_ssl3(doc) ->
- ["Test all rsa ssl cipher suites in ssl3"];
-
-ciphers_rsa_signed_certs_ssl3(suite) ->
- [];
-
-ciphers_rsa_signed_certs_ssl3(Config) when is_list(Config) ->
- Version =
- ssl_record:protocol_version({3,0}),
-
- Ciphers = ssl_test_lib:rsa_suites(),
- test_server:format("ssl3 erlang cipher suites ~p~n", [Ciphers]),
+ test_server:format("~p erlang cipher suites ~p~n", [Version, Ciphers]),
run_suites(Ciphers, Version, Config, rsa).
ciphers_rsa_signed_certs_openssl_names(doc) ->
@@ -1753,18 +1798,6 @@ ciphers_rsa_signed_certs_openssl_names(Config) when is_list(Config) ->
run_suites(Ciphers, Version, Config, rsa).
-ciphers_rsa_signed_certs_openssl_names_ssl3(doc) ->
- ["Test all dsa ssl cipher suites in ssl3"];
-
-ciphers_rsa_signed_certs_openssl_names_ssl3(suite) ->
- [];
-
-ciphers_rsa_signed_certs_openssl_names_ssl3(Config) when is_list(Config) ->
- Version = ssl_record:protocol_version({3,0}),
- Ciphers = ssl_test_lib:openssl_rsa_suites(),
- run_suites(Ciphers, Version, Config, rsa).
-
-
ciphers_dsa_signed_certs(doc) ->
["Test all dsa ssl cipher suites in highest support ssl/tls version"];
@@ -1776,23 +1809,8 @@ ciphers_dsa_signed_certs(Config) when is_list(Config) ->
ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
Ciphers = ssl_test_lib:dsa_suites(),
- test_server:format("tls1 erlang cipher suites ~p~n", [Ciphers]),
- run_suites(Ciphers, Version, Config, dsa).
-
-ciphers_dsa_signed_certs_ssl3(doc) ->
- ["Test all dsa ssl cipher suites in ssl3"];
-
-ciphers_dsa_signed_certs_ssl3(suite) ->
- [];
-
-ciphers_dsa_signed_certs_ssl3(Config) when is_list(Config) ->
- Version =
- ssl_record:protocol_version({3,0}),
-
- Ciphers = ssl_test_lib:dsa_suites(),
- test_server:format("ssl3 erlang cipher suites ~p~n", [Ciphers]),
+ test_server:format("~p erlang cipher suites ~p~n", [Version, Ciphers]),
run_suites(Ciphers, Version, Config, dsa).
-
ciphers_dsa_signed_certs_openssl_names(doc) ->
["Test all dsa ssl cipher suites in highest support ssl/tls version"];
@@ -1808,18 +1826,6 @@ ciphers_dsa_signed_certs_openssl_names(Config) when is_list(Config) ->
test_server:format("tls1 openssl cipher suites ~p~n", [Ciphers]),
run_suites(Ciphers, Version, Config, dsa).
-
-ciphers_dsa_signed_certs_openssl_names_ssl3(doc) ->
- ["Test all dsa ssl cipher suites in ssl3"];
-
-ciphers_dsa_signed_certs_openssl_names_ssl3(suite) ->
- [];
-
-ciphers_dsa_signed_certs_openssl_names_ssl3(Config) when is_list(Config) ->
- Version = ssl_record:protocol_version({3,0}),
- Ciphers = ssl_test_lib:openssl_dsa_suites(),
- run_suites(Ciphers, Version, Config, dsa).
-
anonymous_cipher_suites(doc)->
["Test the anonymous ciphersuites"];
anonymous_cipher_suites(suite) ->
@@ -1856,7 +1862,7 @@ run_suites(Ciphers, Version, Config, Type) ->
end.
erlang_cipher_suite(Suite) when is_list(Suite)->
- ssl_cipher:suite_definition(ssl_cipher:openssl_suite(Suite));
+ ssl:suite_definition(ssl_cipher:openssl_suite(Suite));
erlang_cipher_suite(Suite) ->
Suite.
@@ -2083,13 +2089,16 @@ reuse_session_expired(Config) when is_list(Config) ->
Server ! listen,
%% Make sure session is unregistered due to expiration
- test_server:sleep((?EXPIRE+1) * 1000),
+ test_server:sleep((?EXPIRE+1)),
+ [{session_id, Id} |_] = SessionInfo,
+
+ make_sure_expired(Hostname, Port, Id),
Client2 =
ssl_test_lib:start_client([{node, ClientNode},
- {port, Port}, {host, Hostname},
+ {port, Port}, {host, Hostname},
{mfa, {ssl_test_lib, session_info_result, []}},
- {from, self()}, {options, ClientOpts}]),
+ {from, self()}, {options, ClientOpts}]),
receive
{Client2, SessionInfo} ->
test_server:fail(session_reused_when_session_expired);
@@ -2102,6 +2111,22 @@ reuse_session_expired(Config) when is_list(Config) ->
ssl_test_lib:close(Client1),
ssl_test_lib:close(Client2).
+make_sure_expired(Host, Port, Id) ->
+ {status, _, _, StatusInfo} = sys:get_status(whereis(ssl_manager)),
+ [_, _,_, _, Prop] = StatusInfo,
+ State = ssl_test_lib:state(Prop),
+ Cache = element(2, State),
+
+ case ssl_session_cache:lookup(Cache, {{Host, Port}, Id}) of
+ undefined ->
+ ok;
+ #session{is_resumable = false} ->
+ ok;
+ _ ->
+ test_server:sleep(?SLEEP),
+ make_sure_expired(Host, Port, Id)
+ end.
+
%%--------------------------------------------------------------------
server_does_not_want_to_reuse_session(doc) ->
["Test reuse of sessions (short handshake)"];
@@ -3217,6 +3242,105 @@ client_with_cert_cipher_suites_handshake(Config) when is_list(Config) ->
ssl_test_lib:check_result(Server, ok, Client, ok),
ssl_test_lib:close(Server),
ssl_test_lib:close(Client).
+
+%%--------------------------------------------------------------------
+verify_fun_always_run_client(doc) ->
+ ["Verify that user verify_fun is always run (for valid and valid_peer not only unknown_extension)"];
+verify_fun_always_run_client(suite) ->
+ [];
+verify_fun_always_run_client(Config) when is_list(Config) ->
+ ClientOpts = ?config(client_verification_opts, Config),
+ ServerOpts = ?config(server_verification_opts, Config),
+ {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+ Server = ssl_test_lib:start_server_error([{node, ServerNode}, {port, 0},
+ {from, self()},
+ {mfa, {ssl_test_lib,
+ no_result, []}},
+ {options, ServerOpts}]),
+ Port = ssl_test_lib:inet_port(Server),
+
+ %% If user verify fun is called correctly we fail the connection.
+ %% otherwise we can not tell this case apart form where we miss
+ %% to call users verify fun
+ FunAndState = {fun(_,{extension, _}, UserState) ->
+ {unknown, UserState};
+ (_, valid, [ChainLen]) ->
+ {valid, [ChainLen + 1]};
+ (_, valid_peer, [2]) ->
+ {fail, "verify_fun_was_always_run"};
+ (_, valid_peer, UserState) ->
+ {valid, UserState}
+ end, [0]},
+
+ Client = ssl_test_lib:start_client_error([{node, ClientNode}, {port, Port},
+ {host, Hostname},
+ {from, self()},
+ {mfa, {ssl_test_lib,
+ no_result, []}},
+ {options,
+ [{verify, verify_peer},
+ {verify_fun, FunAndState}
+ | ClientOpts]}]),
+ %% Server error may be esslaccept or closed depending on timing
+ %% this is not a bug it is a circumstance of how tcp works!
+ receive
+ {Server, ServerError} ->
+ test_server:format("Server Error ~p~n", [ServerError])
+ end,
+
+ ssl_test_lib:check_result(Client, {error, esslconnect}).
+
+%%--------------------------------------------------------------------
+verify_fun_always_run_server(doc) ->
+ ["Verify that user verify_fun is always run (for valid and valid_peer not only unknown_extension)"];
+verify_fun_always_run_server(suite) ->
+ [];
+verify_fun_always_run_server(Config) when is_list(Config) ->
+ ClientOpts = ?config(client_verification_opts, Config),
+ ServerOpts = ?config(server_verification_opts, Config),
+ {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+
+ %% If user verify fun is called correctly we fail the connection.
+ %% otherwise we can not tell this case apart form where we miss
+ %% to call users verify fun
+ FunAndState = {fun(_,{extension, _}, UserState) ->
+ {unknown, UserState};
+ (_, valid, [ChainLen]) ->
+ {valid, [ChainLen + 1]};
+ (_, valid_peer, [2]) ->
+ {fail, "verify_fun_was_always_run"};
+ (_, valid_peer, UserState) ->
+ {valid, UserState}
+ end, [0]},
+
+ Server = ssl_test_lib:start_server_error([{node, ServerNode}, {port, 0},
+ {from, self()},
+ {mfa, {ssl_test_lib,
+ no_result, []}},
+ {options,
+ [{verify, verify_peer},
+ {verify_fun, FunAndState} |
+ ServerOpts]}]),
+ Port = ssl_test_lib:inet_port(Server),
+
+ Client = ssl_test_lib:start_client_error([{node, ClientNode}, {port, Port},
+ {host, Hostname},
+ {from, self()},
+ {mfa, {ssl_test_lib,
+ no_result, []}},
+ {options,
+ [{verify, verify_peer}
+ | ClientOpts]}]),
+
+ %% Client error may be esslconnect or closed depending on timing
+ %% this is not a bug it is a circumstance of how tcp works!
+ receive
+ {Client, ClientError} ->
+ test_server:format("Client Error ~p~n", [ClientError])
+ end,
+
+ ssl_test_lib:check_result(Server, {error, esslaccept}).
+
%%--------------------------------------------------------------------
unknown_server_ca_fail(doc) ->
["Test that the client fails if the ca is unknown in verify_peer mode"];
@@ -3548,6 +3672,8 @@ no_reuses_session_server_restart_new_cert_file(Config) when is_list(Config) ->
ssl_test_lib:close(Server),
ssl_test_lib:close(Client0),
+ ssl:clear_pem_cache(),
+
NewServerOpts = new_config(PrivDir, DsaServerOpts),
Server1 =
@@ -3771,16 +3897,16 @@ tcp_error_propagation_in_active_mode(Config) when is_list(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, no_result, []}},
- {options, ServerOpts}]),
+ {from, self()},
+ {mfa, {ssl_test_lib, no_result, []}},
+ {options, ServerOpts}]),
Port = ssl_test_lib:inet_port(Server),
{Client, #sslsocket{pid=Pid} = SslSocket} = ssl_test_lib:start_client([return_socket,
- {node, ClientNode}, {port, Port},
- {host, Hostname},
- {from, self()},
- {mfa, {?MODULE, receive_msg, []}},
- {options, ClientOpts}]),
+ {node, ClientNode}, {port, Port},
+ {host, Hostname},
+ {from, self()},
+ {mfa, {?MODULE, receive_msg, []}},
+ {options, ClientOpts}]),
{status, _, _, StatusInfo} = sys:get_status(Pid),
[_, _,_, _, Prop] = StatusInfo,
@@ -3791,6 +3917,32 @@ tcp_error_propagation_in_active_mode(Config) when is_list(Config) ->
Pid ! {tcp_error, Socket, etimedout},
ssl_test_lib:check_result(Client, {ssl_closed, SslSocket}).
+
+
+%%--------------------------------------------------------------------
+
+recv_error_handling(doc) ->
+ ["Special case of call error handling"];
+recv_error_handling(Config) when is_list(Config) ->
+ ClientOpts = ?config(client_opts, Config),
+ ServerOpts = ?config(server_opts, Config),
+
+ {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+ Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
+ {from, self()},
+ {mfa, {?MODULE, recv_close, []}},
+ {options, [{active, false} | ServerOpts]}]),
+ Port = ssl_test_lib:inet_port(Server),
+ {_Client, #sslsocket{} = SslSocket} = ssl_test_lib:start_client([return_socket,
+ {node, ClientNode}, {port, Port},
+ {host, Hostname},
+ {from, self()},
+ {mfa, {ssl_test_lib, no_result, []}},
+ {options, ClientOpts}]),
+ ssl:close(SslSocket),
+ ssl_test_lib:check_result(Server, ok).
+
+
%%--------------------------------------------------------------------
rizzo(doc) -> ["Test that there is a 1/n-1-split for non RC4 in 'TLS < 1.1' as it is
@@ -3798,21 +3950,22 @@ rizzo(doc) -> ["Test that there is a 1/n-1-split for non RC4 in 'TLS < 1.1' as i
rizzo(Config) when is_list(Config) ->
Ciphers = [X || X ={_,Y,_} <- ssl:cipher_suites(), Y =/= rc4_128],
- run_send_recv_rizzo(Ciphers, Config, sslv3,
- {?MODULE, send_recv_result_active_rizzo, []}),
- run_send_recv_rizzo(Ciphers, Config, tlsv1,
+ Prop = ?config(tc_group_properties, Config),
+ Version = proplists:get_value(name, Prop),
+ run_send_recv_rizzo(Ciphers, Config, Version,
{?MODULE, send_recv_result_active_rizzo, []}).
-
+%%--------------------------------------------------------------------
no_rizzo_rc4(doc) ->
["Test that there is no 1/n-1-split for RC4 as it is not vunrable to Rizzo/Dungon attack"];
no_rizzo_rc4(Config) when is_list(Config) ->
Ciphers = [X || X ={_,Y,_} <- ssl:cipher_suites(),Y == rc4_128],
- run_send_recv_rizzo(Ciphers, Config, sslv3,
- {?MODULE, send_recv_result_active_no_rizzo, []}),
- run_send_recv_rizzo(Ciphers, Config, tlsv1,
+ Prop = ?config(tc_group_properties, Config),
+ Version = proplists:get_value(name, Prop),
+ run_send_recv_rizzo(Ciphers, Config, Version,
{?MODULE, send_recv_result_active_no_rizzo, []}).
+%%--------------------------------------------------------------------
run_send_recv_rizzo(Ciphers, Config, Version, Mfa) ->
Result = lists:map(fun(Cipher) ->
rizzo_test(Cipher, Config, Version, Mfa) end,
@@ -3866,6 +4019,15 @@ send_recv_result(Socket) ->
{ok,"Hello world"} = ssl:recv(Socket, 11),
ok.
+recv_close(Socket) ->
+ {error, closed} = ssl:recv(Socket, 11),
+ receive
+ {_,{error,closed}} ->
+ error_extra_close_sent_to_user_process
+ after 500 ->
+ ok
+ end.
+
send_recv_result_active(Socket) ->
ssl:send(Socket, "Hello world"),
receive
@@ -3924,7 +4086,7 @@ renegotiate(Socket, Data) ->
end.
renegotiate_reuse_session(Socket, Data) ->
- %% Make sure session is registerd
+ %% Make sure session is registered
test_server:sleep(?SLEEP),
renegotiate(Socket, Data).
diff --git a/lib/ssl/test/ssl_cipher_SUITE.erl b/lib/ssl/test/ssl_cipher_SUITE.erl
index 99bc21e820..ea1d9dc90c 100644
--- a/lib/ssl/test/ssl_cipher_SUITE.erl
+++ b/lib/ssl/test/ssl_cipher_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -27,6 +27,7 @@
-include("ssl_internal.hrl").
-include("ssl_record.hrl").
-include("ssl_cipher.hrl").
+-include("ssl_alert.hrl").
-define(TIMEOUT, 600000).
@@ -103,7 +104,7 @@ end_per_testcase(_TestCase, Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [aes_decipher_good, aes_decipher_fail].
+ [aes_decipher_good, aes_decipher_good_tls11, aes_decipher_fail, aes_decipher_fail_tls11].
groups() ->
[].
@@ -131,10 +132,39 @@ aes_decipher_good(Config) when is_list(Config) ->
190,162,74,31,186,227,119,155,94,74,119,79,169,193,240,160,
198,181,81,19,98,162,213,228,74,224,253,168,156,59,195,122,
108,101,107,242,20,15,169,150,163,107,101,94,93,104,241,165>>,
- Version = {3,3},
- Content = <<183,139,16,132,10,209,67,86,168,100,61,217,145,57,36,56,72,69,76,76,79,10>>,
+ Content = <<183,139,16,132,10,209,67,86,168,100,61,217,145,57,36,56, "HELLO\n">>,
Mac = <<71,136,212,107,223,200,70,232,127,116,148,205,232,35,158,113,237,174,15,217,192,168,35,8,6,107,107,233,25,174,90,111>>,
+ Version = {3,0},
{Content, Mac, _} = ssl_cipher:decipher(?AES, HashSz, CipherState, Fragment, Version),
+ Version1 = {3,1},
+ {Content, Mac, _} = ssl_cipher:decipher(?AES, HashSz, CipherState, Fragment, Version1),
+ ok.
+
+%%--------------------------------------------------------------------
+
+aes_decipher_good_tls11(doc) ->
+ ["Decipher a known TLS 1.1 cryptotext."];
+
+aes_decipher_good_tls11(suite) ->
+ [];
+
+%% the fragment is actuall a TLS 1.1 record, with
+%% Version = TLS 1.1, we get the correct NextIV in #cipher_state
+aes_decipher_good_tls11(Config) when is_list(Config) ->
+ HashSz = 32,
+ CipherState = #cipher_state{iv = <<59,201,85,117,188,206,224,136,5,109,46,70,104,79,4,9>>,
+ key = <<72,196,247,97,62,213,222,109,210,204,217,186,172,184,197,148>>},
+ Fragment = <<220,193,179,139,171,33,143,245,202,47,123,251,13,232,114,8,
+ 190,162,74,31,186,227,119,155,94,74,119,79,169,193,240,160,
+ 198,181,81,19,98,162,213,228,74,224,253,168,156,59,195,122,
+ 108,101,107,242,20,15,169,150,163,107,101,94,93,104,241,165>>,
+ Content = <<"HELLO\n">>,
+ NextIV = <<183,139,16,132,10,209,67,86,168,100,61,217,145,57,36,56>>,
+ Mac = <<71,136,212,107,223,200,70,232,127,116,148,205,232,35,158,113,237,174,15,217,192,168,35,8,6,107,107,233,25,174,90,111>>,
+ Version = {3,2},
+ {Content, Mac, #cipher_state{iv = NextIV}} = ssl_cipher:decipher(?AES, HashSz, CipherState, Fragment, Version),
+ Version1 = {3,2},
+ {Content, Mac, #cipher_state{iv = NextIV}} = ssl_cipher:decipher(?AES, HashSz, CipherState, Fragment, Version1),
ok.
%%--------------------------------------------------------------------
@@ -154,10 +184,38 @@ aes_decipher_fail(Config) when is_list(Config) ->
190,162,74,31,186,227,119,155,94,74,119,79,169,193,240,160,
198,181,81,19,98,162,213,228,74,224,253,168,156,59,195,122,
108,101,107,242,20,15,169,150,163,107,101,94,93,104,241,165>>,
- Version = {3,3},
+ Version = {3,0},
{Content, Mac, _} = ssl_cipher:decipher(?AES, HashSz, CipherState, Fragment, Version),
32 = byte_size(Content),
32 = byte_size(Mac),
+ Version1 = {3,1},
+ {Content1, Mac1, _} = ssl_cipher:decipher(?AES, HashSz, CipherState, Fragment, Version1),
+ 32 = byte_size(Content1),
+ 32 = byte_size(Mac1),
+ ok.
+
+%%--------------------------------------------------------------------
+
+aes_decipher_fail_tls11(doc) ->
+ ["Decipher a known TLS 1.1 cryptotext."];
+
+aes_decipher_fail_tls11(suite) ->
+ [];
+
+%% same as above, last byte of key replaced
+%% stricter padding checks in TLS 1.1 mean we get an alert instead
+aes_decipher_fail_tls11(Config) when is_list(Config) ->
+ HashSz = 32,
+ CipherState = #cipher_state{iv = <<59,201,85,117,188,206,224,136,5,109,46,70,104,79,4,9>>,
+ key = <<72,196,247,97,62,213,222,109,210,204,217,186,172,184,197,254>>},
+ Fragment = <<220,193,179,139,171,33,143,245,202,47,123,251,13,232,114,8,
+ 190,162,74,31,186,227,119,155,94,74,119,79,169,193,240,160,
+ 198,181,81,19,98,162,213,228,74,224,253,168,156,59,195,122,
+ 108,101,107,242,20,15,169,150,163,107,101,94,93,104,241,165>>,
+ Version = {3,2},
+ #alert{level = ?FATAL, description = ?BAD_RECORD_MAC} = ssl_cipher:decipher(?AES, HashSz, CipherState, Fragment, Version),
+ Version1 = {3,3},
+ #alert{level = ?FATAL, description = ?BAD_RECORD_MAC} = ssl_cipher:decipher(?AES, HashSz, CipherState, Fragment, Version1),
ok.
%%--------------------------------------------------------------------
diff --git a/lib/ssl/test/ssl_dist_SUITE.erl b/lib/ssl/test/ssl_dist_SUITE.erl
index 8fe55ee7a4..818f7f1897 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -26,7 +26,7 @@
-define(DEFAULT_TIMETRAP_SECS, 240).
--define(AWAIT_SLL_NODE_UP_TIMEOUT, 30000).
+-define(AWAIT_SSL_NODE_UP_TIMEOUT, 30000).
-record(node_handle,
{connection_handler,
@@ -120,6 +120,12 @@ basic(Config) when is_list(Config) ->
pang = net_adm:ping(Node1),
pang = net_adm:ping(Node2),
+ %% SSL nodes should not be able to communicate with the test_server node
+ %% either (and ping should return eventually).
+ TestServer = node(),
+ pang = apply_on_ssl_node(NH1, fun () -> net_adm:ping(TestServer) end),
+ pang = apply_on_ssl_node(NH2, fun () -> net_adm:ping(TestServer) end),
+
%%
%% Check that we are able to communicate over the erlang
%% distribution between the ssl nodes.
@@ -363,7 +369,7 @@ mk_node_cmdline(ListenPort, Name, Args) ->
_ -> "-name "
end,
{ok, Pwd} = file:get_cwd(),
- Prog ++ " "
+ "\"" ++ Prog ++ "\" "
++ Static ++ " "
++ NameSw ++ " " ++ Name ++ " "
++ "-pa " ++ Pa ++ " "
@@ -380,7 +386,7 @@ mk_node_cmdline(ListenPort, Name, Args) ->
%%
await_ssl_node_up(Name, LSock) ->
- case gen_tcp:accept(LSock, ?AWAIT_SLL_NODE_UP_TIMEOUT) of
+ case gen_tcp:accept(LSock, ?AWAIT_SSL_NODE_UP_TIMEOUT) of
timeout ->
gen_tcp:close(LSock),
?t:format("Timeout waiting for ssl node ~s to come up~n",
@@ -723,7 +729,7 @@ add_ssl_opts_config(Config) ->
[{ssl_opts, "-boot " ++ Script} | Config]
catch
_:_ ->
- [{ssl_opts, "-pa " ++ filename:dirname(code:which(ssl))}
+ [{ssl_opts, "-pa \"" ++ filename:dirname(code:which(ssl))++"\""}
| add_comment_config(
"Bootscript wasn't used since the test wasn't run on an "
"installed OTP system.",
diff --git a/lib/ssl/test/ssl_handshake_SUITE.erl b/lib/ssl/test/ssl_handshake_SUITE.erl
index 08c23b2d47..363a0be594 100644
--- a/lib/ssl/test/ssl_handshake_SUITE.erl
+++ b/lib/ssl/test/ssl_handshake_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -48,7 +48,8 @@ decode_hello_handshake(_Config) ->
16#00, 16#00, 16#33, 16#74, 16#00, 16#07, 16#06, 16#73,
16#70, 16#64, 16#79, 16#2f, 16#32>>,
- {Records, _Buffer} = ssl_handshake:get_tls_handshake(HelloPacket, <<>>),
+ Version = {3, 0},
+ {Records, _Buffer} = ssl_handshake:get_tls_handshake(Version, HelloPacket, <<>>),
{Hello, _Data} = hd(Records),
#renegotiation_info{renegotiated_connection = <<0>>} = Hello#server_hello.renegotiation_info.
diff --git a/lib/ssl/test/ssl_npn_handshake_SUITE.erl b/lib/ssl/test/ssl_npn_handshake_SUITE.erl
new file mode 100644
index 0000000000..8597aa6740
--- /dev/null
+++ b/lib/ssl/test/ssl_npn_handshake_SUITE.erl
@@ -0,0 +1,310 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+-module(ssl_npn_handshake_SUITE).
+
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+-include_lib("common_test/include/ct.hrl").
+
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [{group, 'tlsv1.2'},
+ {group, 'tlsv1.1'},
+ {group, 'tlsv1'},
+ {group, 'sslv3'}].
+
+groups() ->
+ [
+ {'tlsv1.2', [], next_protocol_tests()},
+ {'tlsv1.1', [], next_protocol_tests()},
+ {'tlsv1', [], next_protocol_tests()},
+ {'sslv3', [], next_protocol_not_supported()}
+ ].
+
+next_protocol_tests() ->
+ [validate_empty_protocols_are_not_allowed,
+ validate_empty_advertisement_list_is_allowed,
+ validate_advertisement_must_be_a_binary_list,
+ validate_client_protocols_must_be_a_tuple,
+ normal_npn_handshake_server_preference,
+ normal_npn_handshake_client_preference,
+ fallback_npn_handshake,
+ fallback_npn_handshake_server_preference,
+ client_negotiate_server_does_not_support,
+ no_client_negotiate_but_server_supports_npn,
+ renegotiate_from_client_after_npn_handshake
+ ].
+
+next_protocol_not_supported() ->
+ [npn_not_supported_client,
+ npn_not_supported_server
+ ].
+
+init_per_suite(Config) ->
+ catch crypto:stop(),
+ try crypto:start() of
+ ok ->
+ application:start(public_key),
+ ssl:start(),
+ Result =
+ (catch make_certs:all(?config(data_dir, Config),
+ ?config(priv_dir, Config))),
+ test_server:format("Make certs ~p~n", [Result]),
+ ssl_test_lib:cert_options(Config)
+ catch _:_ ->
+ {skip, "Crypto did not start"}
+ end.
+
+end_per_suite(_Config) ->
+ ssl:stop(),
+ application:stop(crypto).
+
+
+init_per_group(GroupName, Config) ->
+ case ssl_test_lib:is_tls_version(GroupName) of
+ true ->
+ case ssl_test_lib:sufficient_crypto_support(GroupName) of
+ true ->
+ ssl_test_lib:init_tls_version(GroupName),
+ Config;
+ false ->
+ {skip, "Missing crypto support"}
+ end;
+ _ ->
+ ssl:start(),
+ Config
+ end.
+
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+
+%% Test cases starts here.
+%%--------------------------------------------------------------------
+
+validate_empty_protocols_are_not_allowed(Config) when is_list(Config) ->
+ {error, {eoptions, {next_protocols_advertised, {invalid_protocol, <<>>}}}}
+ = (catch ssl:listen(9443,
+ [{next_protocols_advertised, [<<"foo/1">>, <<"">>]}])),
+ {error, {eoptions, {client_preferred_next_protocols, {invalid_protocol, <<>>}}}}
+ = (catch ssl:connect({127,0,0,1}, 9443,
+ [{client_preferred_next_protocols,
+ {client, [<<"foo/1">>, <<"">>], <<"foox/1">>}}], infinity)),
+ Option = {client_preferred_next_protocols, {invalid_protocol, <<"">>}},
+ {error, {eoptions, Option}} = (catch ssl:connect({127,0,0,1}, 9443, [Option], infinity)).
+
+%--------------------------------------------------------------------------------
+
+validate_empty_advertisement_list_is_allowed(Config) when is_list(Config) ->
+ Option = {next_protocols_advertised, []},
+ {ok, Socket} = ssl:listen(0, [Option]),
+ ssl:close(Socket).
+%--------------------------------------------------------------------------------
+
+validate_advertisement_must_be_a_binary_list(Config) when is_list(Config) ->
+ Option = {next_protocols_advertised, blah},
+ {error, {eoptions, Option}} = (catch ssl:listen(9443, [Option])).
+%--------------------------------------------------------------------------------
+
+validate_client_protocols_must_be_a_tuple(Config) when is_list(Config) ->
+ Option = {client_preferred_next_protocols, [<<"foo/1">>]},
+ {error, {eoptions, Option}} = (catch ssl:connect({127,0,0,1}, 9443, [Option])).
+
+%--------------------------------------------------------------------------------
+
+normal_npn_handshake_server_preference(Config) when is_list(Config) ->
+ run_npn_handshake(Config,
+ [{client_preferred_next_protocols,
+ {server, [<<"http/1.0">>, <<"http/1.1">>], <<"http/1.1">>}}],
+ [{next_protocols_advertised, [<<"spdy/2">>, <<"http/1.1">>, <<"http/1.0">>]}],
+ {ok, <<"http/1.1">>}).
+%--------------------------------------------------------------------------------
+
+normal_npn_handshake_client_preference(Config) when is_list(Config) ->
+ run_npn_handshake(Config,
+ [{client_preferred_next_protocols,
+ {client, [<<"http/1.0">>, <<"http/1.1">>], <<"http/1.1">>}}],
+ [{next_protocols_advertised, [<<"spdy/2">>, <<"http/1.1">>, <<"http/1.0">>]}],
+ {ok, <<"http/1.0">>}).
+
+%--------------------------------------------------------------------------------
+
+fallback_npn_handshake(Config) when is_list(Config) ->
+ run_npn_handshake(Config,
+ [{client_preferred_next_protocols, {client, [<<"spdy/2">>], <<"http/1.1">>}}],
+ [{next_protocols_advertised, [<<"spdy/1">>, <<"http/1.1">>, <<"http/1.0">>]}],
+ {ok, <<"http/1.1">>}).
+%--------------------------------------------------------------------------------
+
+fallback_npn_handshake_server_preference(Config) when is_list(Config) ->
+ run_npn_handshake(Config,
+ [{client_preferred_next_protocols, {server, [<<"spdy/2">>], <<"http/1.1">>}}],
+ [{next_protocols_advertised, [<<"spdy/1">>, <<"http/1.1">>, <<"http/1.0">>]}],
+ {ok, <<"http/1.1">>}).
+
+%--------------------------------------------------------------------------------
+
+no_client_negotiate_but_server_supports_npn(Config) when is_list(Config) ->
+ run_npn_handshake(Config,
+ [],
+ [{next_protocols_advertised, [<<"spdy/1">>, <<"http/1.1">>, <<"http/1.0">>]}],
+ {error, next_protocol_not_negotiated}).
+%--------------------------------------------------------------------------------
+
+
+client_negotiate_server_does_not_support(Config) when is_list(Config) ->
+ run_npn_handshake(Config,
+ [{client_preferred_next_protocols, {client, [<<"spdy/2">>], <<"http/1.1">>}}],
+ [],
+ {error, next_protocol_not_negotiated}).
+
+%--------------------------------------------------------------------------------
+renegotiate_from_client_after_npn_handshake(Config) when is_list(Config) ->
+ Data = "hello world",
+
+ ClientOpts0 = ?config(client_opts, Config),
+ ClientOpts = [{client_preferred_next_protocols,
+ {client, [<<"http/1.0">>], <<"http/1.1">>}}] ++ ClientOpts0,
+ ServerOpts0 = ?config(server_opts, Config),
+ ServerOpts = [{next_protocols_advertised,
+ [<<"spdy/2">>, <<"http/1.1">>, <<"http/1.0">>]}] ++ ServerOpts0,
+ ExpectedProtocol = {ok, <<"http/1.0">>},
+
+ {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+ Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
+ {from, self()},
+ {mfa, {?MODULE, ssl_receive_and_assert_npn, [ExpectedProtocol, Data]}},
+ {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, assert_npn_and_renegotiate_and_send_data, [ExpectedProtocol, Data]}},
+ {options, ClientOpts}]),
+
+ ssl_test_lib:check_result(Server, ok, Client, ok).
+
+%--------------------------------------------------------------------------------
+npn_not_supported_client(Config) when is_list(Config) ->
+ ClientOpts0 = ?config(client_opts, Config),
+ PrefProtocols = {client_preferred_next_protocols,
+ {client, [<<"http/1.0">>], <<"http/1.1">>}},
+ ClientOpts = [PrefProtocols] ++ ClientOpts0,
+ {ClientNode, _ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+ Client = ssl_test_lib:start_client_error([{node, ClientNode},
+ {port, 8888}, {host, Hostname},
+ {from, self()}, {options, ClientOpts}]),
+
+ ssl_test_lib:check_result(Client, {error,
+ {eoptions,
+ {not_supported_in_sslv3, PrefProtocols}}}).
+
+%--------------------------------------------------------------------------------
+npn_not_supported_server(Config) when is_list(Config)->
+ ServerOpts0 = ?config(server_opts, Config),
+ AdvProtocols = {next_protocols_advertised, [<<"spdy/2">>, <<"http/1.1">>, <<"http/1.0">>]},
+ ServerOpts = [AdvProtocols] ++ ServerOpts0,
+
+ {error, {eoptions, {not_supported_in_sslv3, AdvProtocols}}} = ssl:listen(0, ServerOpts).
+
+%%--------------------------------------------------------------------
+%%% Internal functions
+%%--------------------------------------------------------------------
+
+run_npn_handshake(Config, ClientExtraOpts, ServerExtraOpts, ExpectedProtocol) ->
+ Data = "hello world",
+
+ ClientOpts0 = ?config(client_opts, Config),
+ ClientOpts = ClientExtraOpts ++ ClientOpts0,
+ ServerOpts0 = ?config(server_opts, Config),
+ ServerOpts = ServerExtraOpts ++ ServerOpts0,
+
+ {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+ Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
+ {from, self()},
+ {mfa, {?MODULE, ssl_receive_and_assert_npn, [ExpectedProtocol, Data]}},
+ {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, ssl_send_and_assert_npn, [ExpectedProtocol, Data]}},
+ {options, ClientOpts}]),
+
+ ssl_test_lib:check_result(Server, ok, Client, ok).
+
+
+assert_npn(Socket, Protocol) ->
+ test_server:format("Negotiated Protocol ~p, Expecting: ~p ~n",
+ [ssl:negotiated_next_protocol(Socket), Protocol]),
+ Protocol = ssl:negotiated_next_protocol(Socket).
+
+assert_npn_and_renegotiate_and_send_data(Socket, Protocol, Data) ->
+ assert_npn(Socket, Protocol),
+ test_server:format("Renegotiating ~n", []),
+ ok = ssl:renegotiate(Socket),
+ ssl:send(Socket, Data),
+ assert_npn(Socket, Protocol),
+ ok.
+
+ssl_send_and_assert_npn(Socket, Protocol, Data) ->
+ assert_npn(Socket, Protocol),
+ ssl_send(Socket, Data).
+
+ssl_receive_and_assert_npn(Socket, Protocol, Data) ->
+ assert_npn(Socket, Protocol),
+ ssl_receive(Socket, Data).
+
+ssl_send(Socket, Data) ->
+ test_server:format("Connection info: ~p~n",
+ [ssl:connection_info(Socket)]),
+ ssl:send(Socket, Data).
+
+ssl_receive(Socket, Data) ->
+ ssl_receive(Socket, Data, []).
+
+ssl_receive(Socket, Data, Buffer) ->
+ test_server:format("Connection info: ~p~n",
+ [ssl:connection_info(Socket)]),
+ receive
+ {ssl, Socket, MoreData} ->
+ test_server:format("Received ~p~n",[MoreData]),
+ NewBuffer = Buffer ++ MoreData,
+ case NewBuffer of
+ Data ->
+ ssl:send(Socket, "Got it"),
+ ok;
+ _ ->
+ ssl_receive(Socket, Data, NewBuffer)
+ end;
+ Other ->
+ test_server:fail({unexpected_message, Other})
+ after 4000 ->
+ test_server:fail({did_not_get, Data})
+ end.
+
+
+connection_info_result(Socket) ->
+ ssl:connection_info(Socket).
diff --git a/lib/ssl/test/ssl_npn_hello_SUITE.erl b/lib/ssl/test/ssl_npn_hello_SUITE.erl
new file mode 100644
index 0000000000..5102c74e87
--- /dev/null
+++ b/lib/ssl/test/ssl_npn_hello_SUITE.erl
@@ -0,0 +1,117 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+
+-module(ssl_npn_hello_SUITE).
+
+%% Note: This directive should only be used in test suites.
+-compile(export_all).
+-include("ssl_handshake.hrl").
+-include("ssl_record.hrl").
+-include_lib("common_test/include/ct.hrl").
+
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [encode_and_decode_npn_client_hello_test,
+ encode_and_decode_npn_server_hello_test,
+ encode_and_decode_client_hello_test,
+ encode_and_decode_server_hello_test,
+ create_server_hello_with_advertised_protocols_test,
+ create_server_hello_with_no_advertised_protocols_test].
+
+
+create_client_handshake(Npn) ->
+ ssl_handshake:encode_handshake(#client_hello{
+ client_version = {1, 2},
+ random = <<1:256>>,
+ session_id = <<>>,
+ cipher_suites = "",
+ compression_methods = "",
+ next_protocol_negotiation = Npn,
+ renegotiation_info = #renegotiation_info{}
+ }, vsn).
+
+
+encode_and_decode_client_hello_test(_Config) ->
+ HandShakeData = create_client_handshake(undefined),
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+ {[{DecodedHandshakeMessage, _Raw}], _} = ssl_handshake:get_tls_handshake(Version, list_to_binary(HandShakeData), <<>>),
+ NextProtocolNegotiation = DecodedHandshakeMessage#client_hello.next_protocol_negotiation,
+ NextProtocolNegotiation = undefined.
+
+encode_and_decode_npn_client_hello_test(_Config) ->
+ HandShakeData = create_client_handshake(#next_protocol_negotiation{extension_data = <<>>}),
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+ {[{DecodedHandshakeMessage, _Raw}], _} = ssl_handshake:get_tls_handshake(Version, list_to_binary(HandShakeData), <<>>),
+ NextProtocolNegotiation = DecodedHandshakeMessage#client_hello.next_protocol_negotiation,
+ NextProtocolNegotiation = #next_protocol_negotiation{extension_data = <<>>}.
+
+create_server_handshake(Npn) ->
+ ssl_handshake:encode_handshake(#server_hello{
+ server_version = {1, 2},
+ random = <<1:256>>,
+ session_id = <<>>,
+ cipher_suite = <<1,2>>,
+ compression_method = 1,
+ next_protocol_negotiation = Npn,
+ renegotiation_info = #renegotiation_info{}
+ }, vsn).
+
+encode_and_decode_server_hello_test(_Config) ->
+ HandShakeData = create_server_handshake(undefined),
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+ {[{DecodedHandshakeMessage, _Raw}], _} =
+ ssl_handshake:get_tls_handshake(Version, list_to_binary(HandShakeData), <<>>),
+ NextProtocolNegotiation = DecodedHandshakeMessage#server_hello.next_protocol_negotiation,
+ NextProtocolNegotiation = undefined.
+
+encode_and_decode_npn_server_hello_test(_Config) ->
+ HandShakeData = create_server_handshake(#next_protocol_negotiation{extension_data = <<6, "spdy/2">>}),
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+ {[{DecodedHandshakeMessage, _Raw}], _} = ssl_handshake:get_tls_handshake(Version, list_to_binary(HandShakeData), <<>>),
+ NextProtocolNegotiation = DecodedHandshakeMessage#server_hello.next_protocol_negotiation,
+ ct:print("~p ~n", [NextProtocolNegotiation]),
+ NextProtocolNegotiation = #next_protocol_negotiation{extension_data = <<6, "spdy/2">>}.
+
+create_connection_states() ->
+ #connection_states{
+ pending_read = #connection_state{
+ security_parameters = #security_parameters{
+ server_random = <<1:256>>,
+ compression_algorithm = 1,
+ cipher_suite = <<1, 2>>
+ }
+ },
+
+ current_read = #connection_state {
+ secure_renegotiation = false
+ }
+ }.
+
+create_server_hello_with_no_advertised_protocols_test(_Config) ->
+ Hello = ssl_handshake:server_hello(<<>>, {3, 0}, create_connection_states(), false, undefined),
+ undefined = Hello#server_hello.next_protocol_negotiation.
+
+create_server_hello_with_advertised_protocols_test(_Config) ->
+ Hello = ssl_handshake:server_hello(<<>>, {3, 0}, create_connection_states(),
+ false, [<<"spdy/1">>, <<"http/1.0">>, <<"http/1.1">>]),
+ #next_protocol_negotiation{extension_data = <<6, "spdy/1", 8, "http/1.0", 8, "http/1.1">>} =
+ Hello#server_hello.next_protocol_negotiation.
diff --git a/lib/ssl/test/ssl_packet_SUITE.erl b/lib/ssl/test/ssl_packet_SUITE.erl
index 4b74f57a60..8ce80cb725 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -53,6 +53,7 @@
%% variable, but should NOT alter/remove any existing entries.
%%--------------------------------------------------------------------
init_per_suite(Config) ->
+ catch crypto:stop(),
try crypto:start() of
ok ->
application:start(public_key),
@@ -121,15 +122,56 @@ end_per_testcase(_TestCase, Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
+ [
+ {group, 'tlsv1.2'},
+ {group, 'tlsv1.1'},
+ {group, 'tlsv1'},
+ {group, 'sslv3'}
+ ].
+
+groups() ->
+ [{'tlsv1.2', [], packet_tests()},
+ {'tlsv1.1', [], packet_tests()},
+ {'tlsv1', [], packet_tests()},
+ {'sslv3', [], packet_tests()}].
+
+packet_tests() ->
+ active_packet_tests() ++ active_once_packet_tests() ++ passive_packet_tests() ++
+ [packet_send_to_large,
+ packet_cdr_decode, packet_cdr_decode_list,
+ packet_http_decode, packet_http_decode_list,
+ packet_http_bin_decode_multi,
+ packet_line_decode, packet_line_decode_list,
+ packet_asn1_decode, packet_asn1_decode_list,
+ packet_tpkt_decode, packet_tpkt_decode_list,
+ packet_sunrm_decode, packet_sunrm_decode_list].
+
+passive_packet_tests() ->
[packet_raw_passive_many_small,
packet_0_passive_many_small,
packet_1_passive_many_small,
packet_2_passive_many_small,
packet_4_passive_many_small,
- packet_raw_passive_some_big, packet_0_passive_some_big,
- packet_1_passive_some_big, packet_2_passive_some_big,
+ packet_raw_passive_some_big,
+ packet_0_passive_some_big,
+ packet_1_passive_some_big,
+ packet_2_passive_some_big,
packet_4_passive_some_big,
- packet_raw_active_once_many_small,
+ packet_httph_passive,
+ packet_httph_bin_passive,
+ packet_http_error_passive,
+ packet_wait_passive,
+ packet_size_passive,
+ packet_baddata_passive,
+ %% inet header option should be deprecated!
+ header_decode_one_byte_passive,
+ header_decode_two_bytes_passive,
+ header_decode_two_bytes_two_sent_passive,
+ header_decode_two_bytes_one_sent_passive
+ ].
+
+active_once_packet_tests() ->
+ [packet_raw_active_once_many_small,
packet_0_active_once_many_small,
packet_1_active_once_many_small,
packet_2_active_once_many_small,
@@ -139,44 +181,49 @@ all() ->
packet_1_active_once_some_big,
packet_2_active_once_some_big,
packet_4_active_once_some_big,
- packet_raw_active_many_small,
- packet_0_active_many_small, packet_1_active_many_small,
- packet_2_active_many_small, packet_4_active_many_small,
- packet_raw_active_some_big, packet_0_active_some_big,
- packet_1_active_some_big, packet_2_active_some_big,
- packet_4_active_some_big, packet_send_to_large,
- packet_wait_passive, packet_wait_active,
- packet_baddata_passive, packet_baddata_active,
- packet_size_passive, packet_size_active,
- packet_cdr_decode, packet_cdr_decode_list,
- packet_http_decode, packet_http_decode_list,
- packet_http_bin_decode_multi, packet_http_error_passive,
- packet_httph_active, packet_httph_bin_active,
- packet_httph_active_once, packet_httph_bin_active_once,
- packet_httph_passive, packet_httph_bin_passive,
- packet_line_decode, packet_line_decode_list,
- packet_asn1_decode, packet_asn1_decode_list,
- packet_tpkt_decode, packet_tpkt_decode_list,
- packet_sunrm_decode, packet_sunrm_decode_list,
- {group, header}
+ packet_httph_active_once,
+ packet_httph_bin_active_once
].
-groups() ->
- [{header, [], [ header_decode_one_byte,
- header_decode_two_bytes,
- header_decode_two_bytes_one_sent,
- header_decode_two_bytes_two_sent]}].
+active_packet_tests() ->
+ [packet_raw_active_many_small,
+ packet_0_active_many_small,
+ packet_1_active_many_small,
+ packet_2_active_many_small,
+ packet_4_active_many_small,
+ packet_raw_active_some_big,
+ packet_0_active_some_big,
+ packet_1_active_some_big,
+ packet_2_active_some_big,
+ packet_4_active_some_big,
+ packet_httph_active,
+ packet_httph_bin_active,
+ packet_wait_active,
+ packet_baddata_active,
+ packet_size_active,
+ %% inet header option should be deprecated!
+ header_decode_one_byte_active,
+ header_decode_two_bytes_active,
+ header_decode_two_bytes_two_sent_active,
+ header_decode_two_bytes_one_sent_active
+ ].
-init_per_group(header, Config) ->
- case ssl_record:highest_protocol_version(ssl_record:supported_protocol_versions()) of
- {3, N} when N < 2 ->
- {skip, ""};
+
+init_per_group(GroupName, Config) ->
+ case ssl_test_lib:is_tls_version(GroupName) of
+ true ->
+ case ssl_test_lib:sufficient_crypto_support(GroupName) of
+ true ->
+ ssl_test_lib:init_tls_version(GroupName),
+ Config;
+ false ->
+ {skip, "Missing crypto support"}
+ end;
_ ->
+ ssl:start(),
Config
- end;
+ end.
-init_per_group(_, Config) ->
- Config.
end_per_group(_GroupName, Config) ->
Config.
@@ -2435,11 +2482,11 @@ packet_sunrm_decode_list(Config) when is_list(Config) ->
ssl_test_lib:close(Client).
%%--------------------------------------------------------------------
-header_decode_one_byte(doc) ->
+header_decode_one_byte_active(doc) ->
["Test setting the packet option {header, 1}"];
-header_decode_one_byte(suite) ->
+header_decode_one_byte_active(suite) ->
[];
-header_decode_one_byte(Config) when is_list(Config) ->
+header_decode_one_byte_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),
@@ -2448,7 +2495,7 @@ header_decode_one_byte(Config) when is_list(Config) ->
Server = ssl_test_lib:start_server([{node, ClientNode}, {port, 0},
{from, self()},
- {mfa, {?MODULE, server_header_decode,
+ {mfa, {?MODULE, server_header_decode_active,
[Data, [11 | <<"Hello world">>]]}},
{options, [{active, true}, binary,
{header,1}|ServerOpts]}]),
@@ -2457,7 +2504,7 @@ header_decode_one_byte(Config) when is_list(Config) ->
Client = ssl_test_lib:start_client([{node, ServerNode}, {port, Port},
{host, Hostname},
{from, self()},
- {mfa, {?MODULE, client_header_decode,
+ {mfa, {?MODULE, client_header_decode_active,
[Data, [11 | <<"Hello world">> ]]}},
{options, [{active, true}, {header, 1},
binary | ClientOpts]}]),
@@ -2469,11 +2516,11 @@ header_decode_one_byte(Config) when is_list(Config) ->
%%--------------------------------------------------------------------
-header_decode_two_bytes(doc) ->
+header_decode_two_bytes_active(doc) ->
["Test setting the packet option {header, 2}"];
-header_decode_two_bytes(suite) ->
+header_decode_two_bytes_active(suite) ->
[];
-header_decode_two_bytes(Config) when is_list(Config) ->
+header_decode_two_bytes_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),
@@ -2482,7 +2529,7 @@ header_decode_two_bytes(Config) when is_list(Config) ->
Server = ssl_test_lib:start_server([{node, ClientNode}, {port, 0},
{from, self()},
- {mfa, {?MODULE, server_header_decode,
+ {mfa, {?MODULE, server_header_decode_active,
[Data, [11, $H | <<"ello world">> ]]}},
{options, [{active, true}, binary,
{header,2}|ServerOpts]}]),
@@ -2491,7 +2538,7 @@ header_decode_two_bytes(Config) when is_list(Config) ->
Client = ssl_test_lib:start_client([{node, ServerNode}, {port, Port},
{host, Hostname},
{from, self()},
- {mfa, {?MODULE, client_header_decode,
+ {mfa, {?MODULE, client_header_decode_active,
[Data, [11, $H | <<"ello world">> ]]}},
{options, [{active, true}, {header, 2},
binary | ClientOpts]}]),
@@ -2504,11 +2551,11 @@ header_decode_two_bytes(Config) when is_list(Config) ->
%%--------------------------------------------------------------------
-header_decode_two_bytes_two_sent(doc) ->
- ["Test setting the packet option {header, 2} and sending on byte"];
-header_decode_two_bytes_two_sent(suite) ->
+header_decode_two_bytes_two_sent_active(doc) ->
+ ["Test setting the packet option {header, 2} and sending two byte"];
+header_decode_two_bytes_two_sent_active(suite) ->
[];
-header_decode_two_bytes_two_sent(Config) when is_list(Config) ->
+header_decode_two_bytes_two_sent_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),
@@ -2517,8 +2564,8 @@ header_decode_two_bytes_two_sent(Config) when is_list(Config) ->
Server = ssl_test_lib:start_server([{node, ClientNode}, {port, 0},
{from, self()},
- {mfa, {?MODULE, server_header_decode,
- [Data, [$H, $e | <<>> ]]}},
+ {mfa, {?MODULE, server_header_decode_active,
+ [Data, [$H, $e]]}},
{options, [{active, true}, binary,
{header,2}|ServerOpts]}]),
@@ -2526,8 +2573,8 @@ header_decode_two_bytes_two_sent(Config) when is_list(Config) ->
Client = ssl_test_lib:start_client([{node, ServerNode}, {port, Port},
{host, Hostname},
{from, self()},
- {mfa, {?MODULE, client_header_decode,
- [Data, [$H, $e | <<>> ]]}},
+ {mfa, {?MODULE, client_header_decode_active,
+ [Data, [$H, $e]]}},
{options, [{active, true}, {header, 2},
binary | ClientOpts]}]),
@@ -2539,11 +2586,11 @@ header_decode_two_bytes_two_sent(Config) when is_list(Config) ->
%%--------------------------------------------------------------------
-header_decode_two_bytes_one_sent(doc) ->
- ["Test setting the packet option {header, 2} and sending on byte"];
-header_decode_two_bytes_one_sent(suite) ->
+header_decode_two_bytes_one_sent_active(doc) ->
+ ["Test setting the packet option {header, 2} and sending one byte"];
+header_decode_two_bytes_one_sent_active(suite) ->
[];
-header_decode_two_bytes_one_sent(Config) when is_list(Config) ->
+header_decode_two_bytes_one_sent_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),
@@ -2552,7 +2599,7 @@ header_decode_two_bytes_one_sent(Config) when is_list(Config) ->
Server = ssl_test_lib:start_server([{node, ClientNode}, {port, 0},
{from, self()},
- {mfa, {?MODULE, server_header_decode,
+ {mfa, {?MODULE, server_header_decode_active,
[Data, "H"]}},
{options, [{active, true}, binary,
{header,2}|ServerOpts]}]),
@@ -2561,7 +2608,7 @@ header_decode_two_bytes_one_sent(Config) when is_list(Config) ->
Client = ssl_test_lib:start_client([{node, ServerNode}, {port, Port},
{host, Hostname},
{from, self()},
- {mfa, {?MODULE, client_header_decode,
+ {mfa, {?MODULE, client_header_decode_active,
[Data, "H"]}},
{options, [{active, true}, {header, 2},
binary | ClientOpts]}]),
@@ -2571,6 +2618,143 @@ header_decode_two_bytes_one_sent(Config) when is_list(Config) ->
ssl_test_lib:close(Server),
ssl_test_lib:close(Client).
+%%--------------------------------------------------------------------
+
+header_decode_one_byte_passive(doc) ->
+ ["Test setting the packet option {header, 1}"];
+header_decode_one_byte_passive(suite) ->
+ [];
+header_decode_one_byte_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),
+
+ Data = <<11:8, "Hello world">>,
+
+ Server = ssl_test_lib:start_server([{node, ClientNode}, {port, 0},
+ {from, self()},
+ {mfa, {?MODULE, server_header_decode_passive,
+ [Data, [11 | <<"Hello world">>]]}},
+ {options, [{active, false}, binary,
+ {header,1}|ServerOpts]}]),
+
+ Port = ssl_test_lib:inet_port(Server),
+ Client = ssl_test_lib:start_client([{node, ServerNode}, {port, Port},
+ {host, Hostname},
+ {from, self()},
+ {mfa, {?MODULE, client_header_decode_passive,
+ [Data, [11 | <<"Hello world">> ]]}},
+ {options, [{active, false}, {header, 1},
+ binary | ClientOpts]}]),
+
+ ssl_test_lib:check_result(Server, ok, Client, ok),
+
+ ssl_test_lib:close(Server),
+ ssl_test_lib:close(Client).
+
+%%--------------------------------------------------------------------
+
+header_decode_two_bytes_passive(doc) ->
+ ["Test setting the packet option {header, 2}"];
+header_decode_two_bytes_passive(suite) ->
+ [];
+header_decode_two_bytes_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),
+
+ Data = <<11:8, "Hello world">>,
+
+ Server = ssl_test_lib:start_server([{node, ClientNode}, {port, 0},
+ {from, self()},
+ {mfa, {?MODULE, server_header_decode_passive,
+ [Data, [11, $H | <<"ello world">> ]]}},
+ {options, [{active, false}, binary,
+ {header,2}|ServerOpts]}]),
+
+ Port = ssl_test_lib:inet_port(Server),
+ Client = ssl_test_lib:start_client([{node, ServerNode}, {port, Port},
+ {host, Hostname},
+ {from, self()},
+ {mfa, {?MODULE, client_header_decode_passive,
+ [Data, [11, $H | <<"ello world">> ]]}},
+ {options, [{active, false}, {header, 2},
+ binary | ClientOpts]}]),
+
+ ssl_test_lib:check_result(Server, ok, Client, ok),
+
+ ssl_test_lib:close(Server),
+ ssl_test_lib:close(Client).
+
+
+%%--------------------------------------------------------------------
+
+header_decode_two_bytes_two_sent_passive(doc) ->
+ ["Test setting the packet option {header, 2} and sending two byte"];
+header_decode_two_bytes_two_sent_passive(suite) ->
+ [];
+header_decode_two_bytes_two_sent_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),
+
+ Data = <<"He">>,
+
+ Server = ssl_test_lib:start_server([{node, ClientNode}, {port, 0},
+ {from, self()},
+ {mfa, {?MODULE, server_header_decode_passive,
+ [Data, [$H, $e]]}},
+ {options, [{active, false}, binary,
+ {header,2}|ServerOpts]}]),
+
+ Port = ssl_test_lib:inet_port(Server),
+ Client = ssl_test_lib:start_client([{node, ServerNode}, {port, Port},
+ {host, Hostname},
+ {from, self()},
+ {mfa, {?MODULE, client_header_decode_passive,
+ [Data, [$H, $e]]}},
+ {options, [{active, false}, {header, 2},
+ binary | ClientOpts]}]),
+
+ ssl_test_lib:check_result(Server, ok, Client, ok),
+
+ ssl_test_lib:close(Server),
+ ssl_test_lib:close(Client).
+
+
+%%--------------------------------------------------------------------
+
+header_decode_two_bytes_one_sent_passive(doc) ->
+ ["Test setting the packet option {header, 2} and sending one byte"];
+header_decode_two_bytes_one_sent_passive(suite) ->
+ [];
+header_decode_two_bytes_one_sent_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),
+
+ Data = <<"H">>,
+
+ Server = ssl_test_lib:start_server([{node, ClientNode}, {port, 0},
+ {from, self()},
+ {mfa, {?MODULE, server_header_decode_passive,
+ [Data, "H"]}},
+ {options, [{active, false}, binary,
+ {header,2}|ServerOpts]}]),
+
+ Port = ssl_test_lib:inet_port(Server),
+ Client = ssl_test_lib:start_client([{node, ServerNode}, {port, Port},
+ {host, Hostname},
+ {from, self()},
+ {mfa, {?MODULE, client_header_decode_passive,
+ [Data, "H"]}},
+ {options, [{active, false}, {header, 2},
+ binary | ClientOpts]}]),
+
+ ssl_test_lib:check_result(Server, ok, Client, ok),
+
+ ssl_test_lib:close(Server),
+ ssl_test_lib:close(Client).
%%--------------------------------------------------------------------
%% Internal functions
@@ -2757,29 +2941,52 @@ client_packet_decode(Socket, P1, P2, Packet) ->
Other2 -> exit({?LINE, Other2})
end.
-server_header_decode(Socket, Packet, Result) ->
+server_header_decode_active(Socket, Packet, Result) ->
receive
- {ssl, Socket, Result} -> ok;
- Other1 -> exit({?LINE, Other1})
- end,
- ok = ssl:send(Socket, Packet),
- receive
- {ssl, Socket, Result} -> ok;
- Other2 -> exit({?LINE, Other2})
+ {ssl, Socket, Result} ->
+ ok;
+ {ssl, Socket, Other1} ->
+ check_header_result(Result, Other1)
end,
ok = ssl:send(Socket, Packet).
-client_header_decode(Socket, Packet, Result) ->
+client_header_decode_active(Socket, Packet, Result) ->
ok = ssl:send(Socket, Packet),
receive
- {ssl, Socket, Result} -> ok;
- Other1 -> exit({?LINE, Other1})
+ {ssl, Socket, Result} ->
+ ok;
+ {ssl, Socket, Other1} ->
+ check_header_result(Result, Other1)
+ end.
+
+server_header_decode_passive(Socket, Packet, Result) ->
+ case ssl:recv(Socket, 0) of
+ {ok, Result} ->
+ ok;
+ {ok, Other} ->
+ check_header_result(Result, Other)
end,
+ ok = ssl:send(Socket, Packet).
+
+client_header_decode_passive(Socket, Packet, Result) ->
ok = ssl:send(Socket, Packet),
- receive
- {ssl, Socket, Result} -> ok;
- Other2 -> exit({?LINE, Other2})
+
+ case ssl:recv(Socket, 0) of
+ {ok, Result} ->
+ ok;
+ {ok, Other} ->
+ check_header_result(Result, Other)
end.
+
+%% The inet header option is a broken option as it does not buffer until it gets enough data.
+%% This check only checks that it has the same behavior as inet, but it is a quite useless
+%% option and the bitsynax makes it obsolete!
+check_header_result([Byte1 | _], [Byte1]) ->
+ ok;
+check_header_result([Byte1, Byte2 | _], [Byte1, Byte2]) ->
+ ok;
+check_header_result(_,Got) ->
+ exit({?LINE, Got}).
server_line_packet_decode(Socket, Packet) when is_binary(Packet) ->
[L1, L2] = string:tokens(binary_to_list(Packet), "\n"),
diff --git a/lib/ssl/test/ssl_payload_SUITE.erl b/lib/ssl/test/ssl_payload_SUITE.erl
index 24e86b3913..c97f97e70b 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,6 +37,7 @@
%% variable, but should NOT alter/remove any existing entries.
%%--------------------------------------------------------------------
init_per_suite(Config) ->
+ catch crypto:stop(),
try crypto:start() of
ok ->
application:start(public_key),
@@ -102,23 +103,56 @@ end_per_testcase(_TestCase, Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
+ [
+ {group, 'tlsv1.2'},
+ {group, 'tlsv1.1'},
+ {group, 'tlsv1'},
+ {group, 'sslv3'}
+ ].
+
+groups() ->
+ [
+ {'tlsv1.2', [], payload_tests()},
+ {'tlsv1.1', [], payload_tests()},
+ {'tlsv1', [], payload_tests()},
+ {'sslv3', [], payload_tests()}
+ ].
+
+payload_tests() ->
[server_echos_passive_small,
server_echos_active_once_small,
- server_echos_active_small, client_echos_passive_small,
+ server_echos_active_small,
+ client_echos_passive_small,
client_echos_active_once_small,
- client_echos_active_small, server_echos_passive_big,
- server_echos_active_once_big, server_echos_active_big,
- client_echos_passive_big, client_echos_active_once_big,
- client_echos_active_big, server_echos_passive_huge,
- server_echos_active_once_huge, server_echos_active_huge,
+ client_echos_active_small,
+ server_echos_passive_big,
+ server_echos_active_once_big,
+ server_echos_active_big,
+ client_echos_passive_big,
+ client_echos_active_once_big,
+ client_echos_active_big,
+ server_echos_passive_huge,
+ server_echos_active_once_huge,
+ server_echos_active_huge,
client_echos_passive_huge,
- client_echos_active_once_huge, client_echos_active_huge].
+ client_echos_active_once_huge,
+ client_echos_active_huge].
-groups() ->
- [].
-init_per_group(_GroupName, Config) ->
- Config.
+init_per_group(GroupName, Config) ->
+ case ssl_test_lib:is_tls_version(GroupName) of
+ true ->
+ case ssl_test_lib:sufficient_crypto_support(GroupName) of
+ true ->
+ ssl_test_lib:init_tls_version(GroupName),
+ Config;
+ false ->
+ {skip, "Missing crypto support"}
+ end;
+ _ ->
+ ssl:start(),
+ Config
+ end.
end_per_group(_GroupName, Config) ->
Config.
diff --git a/lib/ssl/test/ssl_session_cache_SUITE.erl b/lib/ssl/test/ssl_session_cache_SUITE.erl
index 491aa893c2..1d71efd40c 100644
--- a/lib/ssl/test/ssl_session_cache_SUITE.erl
+++ b/lib/ssl/test/ssl_session_cache_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -49,6 +49,7 @@
%%--------------------------------------------------------------------
init_per_suite(Config0) ->
Dog = ssl_test_lib:timetrap(?LONG_TIMEOUT *2),
+ catch crypto:stop(),
try crypto:start() of
ok ->
application:start(public_key),
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl
index fa8a1826f2..63731ee25c 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -150,7 +150,7 @@ run_client(Opts) ->
{ok, Socket} ->
Pid ! { connected, Socket },
test_server:format("Client: connected~n", []),
- %% In specail cases we want to know the client port, it will
+ %% In special cases we want to know the client port, it will
%% be indicated by sending {port, 0} in options list!
send_selected_port(Pid, proplists:get_value(port, Options), Socket),
{Module, Function, Args} = proplists:get_value(mfa, Opts),
@@ -708,3 +708,33 @@ state([{data,[{"StateData", State}]} | _]) ->
State;
state([_ | Rest]) ->
state(Rest).
+
+is_tls_version('tlsv1.2') ->
+ true;
+is_tls_version('tlsv1.1') ->
+ true;
+is_tls_version('tlsv1') ->
+ true;
+is_tls_version('sslv3') ->
+ true;
+is_tls_version(_) ->
+ false.
+
+init_tls_version(Version) ->
+ ssl:stop(),
+ application:load(ssl),
+ application:set_env(ssl, protocol_version, Version),
+ ssl:start().
+
+sufficient_crypto_support('tlsv1.2') ->
+ Data = "Sampl",
+ Data2 = "e #1",
+ Key = <<0,1,2,3,16,17,18,19,32,33,34,35,48,49,50,51,4,5,6,7,20,21,22,23,36,37,38,39,
+ 52,53,54,55,8,9,10,11,24,25,26,27,40,41,42,43,56,57,58,59>>,
+ try
+ crypto:sha256_mac(Key, lists:flatten([Data, Data2])),
+ true
+ catch _:_ -> false
+ end;
+sufficient_crypto_support(_) ->
+ true.
diff --git a/lib/ssl/test/ssl_to_openssl_SUITE.erl b/lib/ssl/test/ssl_to_openssl_SUITE.erl
index f04ab9af50..21797bee08 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,7 +29,7 @@
-define(TIMEOUT, 120000).
-define(LONG_TIMEOUT, 600000).
-define(SLEEP, 1000).
--define(OPENSSL_RENEGOTIATE, "r\n").
+-define(OPENSSL_RENEGOTIATE, "R\n").
-define(OPENSSL_QUIT, "Q\n").
-define(OPENSSL_GARBAGE, "P\n").
-define(EXPIRE, 10).
@@ -50,6 +50,7 @@ init_per_suite(Config0) ->
false ->
{skip, "Openssl not found"};
_ ->
+ catch crypto:stop(),
try crypto:start() of
ok ->
application:start(public_key),
@@ -106,12 +107,24 @@ init_per_testcase(TestCase, Config0) ->
special_init(TestCase, Config)
when TestCase == erlang_client_openssl_server_renegotiate;
TestCase == erlang_client_openssl_server_no_wrap_sequence_number;
- TestCase == erlang_server_openssl_client_no_wrap_sequence_number ->
+ TestCase == erlang_server_openssl_client_no_wrap_sequence_number
+ ->
check_sane_openssl_renegotaite(Config);
special_init(ssl2_erlang_server_openssl_client, Config) ->
check_sane_openssl_sslv2(Config);
+special_init(TestCase, Config)
+ when TestCase == erlang_client_openssl_server_npn;
+ TestCase == erlang_server_openssl_client_npn;
+ TestCase == erlang_server_openssl_client_npn_renegotiate;
+ TestCase == erlang_client_openssl_server_npn_renegotiate;
+ TestCase == erlang_server_openssl_client_npn_only_server;
+ TestCase == erlang_server_openssl_client_npn_only_client;
+ TestCase == erlang_client_openssl_server_npn_only_client;
+ TestCase == erlang_client_openssl_server_npn_only_server ->
+ check_openssl_npn_support(Config);
+
special_init(_, Config) ->
Config.
@@ -149,37 +162,69 @@ end_per_testcase(_, Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [erlang_client_openssl_server,
+ [
+ {group, basic},
+ {group, 'tlsv1.2'},
+ {group, 'tlsv1.1'},
+ {group, 'tlsv1'},
+ {group, 'sslv3'}
+ ].
+
+groups() ->
+ [{basic, [], basic_tests()},
+ {'tlsv1.2', [], all_versions_tests() ++ npn_tests()},
+ {'tlsv1.1', [], all_versions_tests() ++ npn_tests()},
+ {'tlsv1', [], all_versions_tests()++ npn_tests()},
+ {'sslv3', [], all_versions_tests()}].
+
+basic_tests() ->
+ [basic_erlang_client_openssl_server,
+ basic_erlang_server_openssl_client,
+ expired_session].
+
+all_versions_tests() ->
+ [
+ erlang_client_openssl_server,
erlang_server_openssl_client,
- tls1_erlang_client_openssl_server_dsa_cert,
- tls1_erlang_server_openssl_client_dsa_cert,
- ssl3_erlang_client_openssl_server_dsa_cert,
- ssl3_erlang_server_openssl_client_dsa_cert,
+ erlang_client_openssl_server_dsa_cert,
+ erlang_server_openssl_client_dsa_cert,
erlang_server_openssl_client_reuse_session,
erlang_client_openssl_server_renegotiate,
- erlang_client_openssl_server_no_wrap_sequence_number,
- erlang_server_openssl_client_no_wrap_sequence_number,
+ erlang_client_openssl_server_nowrap_seqnum,
+ erlang_server_openssl_client_nowrap_seqnum,
erlang_client_openssl_server_no_server_ca_cert,
- ssl3_erlang_client_openssl_server,
- ssl3_erlang_server_openssl_client,
- ssl3_erlang_client_openssl_server_client_cert,
- ssl3_erlang_server_openssl_client_client_cert,
- ssl3_erlang_server_erlang_client_client_cert,
- tls1_erlang_client_openssl_server,
- tls1_erlang_server_openssl_client,
- tls1_erlang_client_openssl_server_client_cert,
- tls1_erlang_server_openssl_client_client_cert,
- tls1_erlang_server_erlang_client_client_cert,
- ciphers_rsa_signed_certs, ciphers_dsa_signed_certs,
+ erlang_client_openssl_server_client_cert,
+ erlang_server_openssl_client_client_cert,
+ ciphers_rsa_signed_certs,
+ ciphers_dsa_signed_certs,
erlang_client_bad_openssl_server,
expired_session,
ssl2_erlang_server_openssl_client].
-groups() ->
- [].
-
-init_per_group(_GroupName, Config) ->
- Config.
+npn_tests() ->
+ [erlang_client_openssl_server_npn,
+ erlang_server_openssl_client_npn,
+ erlang_server_openssl_client_npn_renegotiate,
+ erlang_client_openssl_server_npn_renegotiate,
+ erlang_server_openssl_client_npn_only_client,
+ erlang_server_openssl_client_npn_only_server,
+ erlang_client_openssl_server_npn_only_client,
+ erlang_client_openssl_server_npn_only_server].
+
+init_per_group(GroupName, Config) ->
+ case ssl_test_lib:is_tls_version(GroupName) of
+ true ->
+ case check_sane_openssl_version(GroupName) of
+ true ->
+ ssl_test_lib:init_tls_version(GroupName),
+ Config;
+ false ->
+ {skip, openssl_does_not_support_version}
+ end;
+ _ ->
+ ssl:start(),
+ Config
+ end.
end_per_group(_GroupName, Config) ->
Config.
@@ -187,12 +232,11 @@ end_per_group(_GroupName, Config) ->
%% Test cases starts here.
%%--------------------------------------------------------------------
-
-erlang_client_openssl_server(doc) ->
+basic_erlang_client_openssl_server(doc) ->
["Test erlang client with openssl server"];
-erlang_client_openssl_server(suite) ->
+basic_erlang_client_openssl_server(suite) ->
[];
-erlang_client_openssl_server(Config) when is_list(Config) ->
+basic_erlang_client_openssl_server(Config) when is_list(Config) ->
process_flag(trap_exit, true),
ServerOpts = ?config(server_opts, Config),
ClientOpts = ?config(client_opts, Config),
@@ -204,8 +248,8 @@ erlang_client_openssl_server(Config) when is_list(Config) ->
Port = ssl_test_lib:inet_port(node()),
CertFile = proplists:get_value(certfile, ServerOpts),
KeyFile = proplists:get_value(keyfile, ServerOpts),
-
- Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++
+
+ Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++
" -cert " ++ CertFile ++ " -key " ++ KeyFile,
test_server:format("openssl cmd: ~p~n", [Cmd]),
@@ -230,13 +274,12 @@ erlang_client_openssl_server(Config) when is_list(Config) ->
process_flag(trap_exit, false),
ok.
-
%%--------------------------------------------------------------------
-erlang_server_openssl_client(doc) ->
+basic_erlang_server_openssl_client(doc) ->
["Test erlang server with openssl client"];
-erlang_server_openssl_client(suite) ->
+basic_erlang_server_openssl_client(suite) ->
[];
-erlang_server_openssl_client(Config) when is_list(Config) ->
+basic_erlang_server_openssl_client(Config) when is_list(Config) ->
process_flag(trap_exit, true),
ServerOpts = ?config(server_opts, Config),
@@ -249,8 +292,8 @@ erlang_server_openssl_client(Config) when is_list(Config) ->
{mfa, {?MODULE, erlang_ssl_receive, [Data]}},
{options, ServerOpts}]),
Port = ssl_test_lib:inet_port(Server),
-
- Cmd = "openssl s_client -port " ++ integer_to_list(Port) ++
+
+ Cmd = "openssl s_client -port " ++ integer_to_list(Port) ++
" -host localhost",
test_server:format("openssl cmd: ~p~n", [Cmd]),
@@ -265,30 +308,26 @@ erlang_server_openssl_client(Config) when is_list(Config) ->
close_port(OpenSslPort),
process_flag(trap_exit, false),
ok.
-
-%%--------------------------------------------------------------------
-
-tls1_erlang_client_openssl_server_dsa_cert(doc) ->
- ["Test erlang server with openssl client"];
-tls1_erlang_client_openssl_server_dsa_cert(suite) ->
+%%--------------------------------------------------------------------
+erlang_client_openssl_server(doc) ->
+ ["Test erlang client with openssl server"];
+erlang_client_openssl_server(suite) ->
[];
-tls1_erlang_client_openssl_server_dsa_cert(Config) when is_list(Config) ->
+erlang_client_openssl_server(Config) when is_list(Config) ->
process_flag(trap_exit, true),
- ClientOpts = ?config(client_dsa_opts, Config),
- ServerOpts = ?config(server_dsa_opts, Config),
+ ServerOpts = ?config(server_opts, Config),
+ ClientOpts = ?config(client_opts, Config),
{ClientNode, _, Hostname} = ssl_test_lib:run_where(Config),
-
+
Data = "From openssl to erlang",
Port = ssl_test_lib:inet_port(node()),
- CaCertFile = proplists:get_value(cacertfile, ServerOpts),
CertFile = proplists:get_value(certfile, ServerOpts),
KeyFile = proplists:get_value(keyfile, ServerOpts),
-
- Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++
- " -cert " ++ CertFile ++ " -CAfile " ++ CaCertFile
- ++ " -key " ++ KeyFile ++ " -Verify 2 -tls1 -msg",
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+ Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++ version_flag(Version) ++
+ " -cert " ++ CertFile ++ " -key " ++ KeyFile,
test_server:format("openssl cmd: ~p~n", [Cmd]),
@@ -302,44 +341,39 @@ tls1_erlang_client_openssl_server_dsa_cert(Config) when is_list(Config) ->
{mfa, {?MODULE,
erlang_ssl_receive, [Data]}},
{options, ClientOpts}]),
-
port_command(OpensslPort, Data),
- ssl_test_lib:check_result(Client, ok),
-
+ ssl_test_lib:check_result(Client, ok),
+
%% Clean close down! Server needs to be closed first !!
close_port(OpensslPort),
ssl_test_lib:close(Client),
process_flag(trap_exit, false),
ok.
-%%--------------------------------------------------------------------
-tls1_erlang_server_openssl_client_dsa_cert(doc) ->
+%%--------------------------------------------------------------------
+erlang_server_openssl_client(doc) ->
["Test erlang server with openssl client"];
-tls1_erlang_server_openssl_client_dsa_cert(suite) ->
+erlang_server_openssl_client(suite) ->
[];
-tls1_erlang_server_openssl_client_dsa_cert(Config) when is_list(Config) ->
+erlang_server_openssl_client(Config) when is_list(Config) ->
process_flag(trap_exit, true),
- ClientOpts = ?config(client_dsa_opts, Config),
- ServerOpts = ?config(server_dsa_verify_opts, Config),
+ ServerOpts = ?config(server_opts, Config),
{_, ServerNode, _} = ssl_test_lib:run_where(Config),
Data = "From openssl to erlang",
- CaCertFile = proplists:get_value(cacertfile, ClientOpts),
- CertFile = proplists:get_value(certfile, ClientOpts),
- KeyFile = proplists:get_value(keyfile, ClientOpts),
-
+
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
{from, self()},
{mfa, {?MODULE, erlang_ssl_receive, [Data]}},
{options, ServerOpts}]),
Port = ssl_test_lib:inet_port(Server),
-
- Cmd = "openssl s_client -port " ++ integer_to_list(Port) ++
- " -host localhost " ++ " -cert " ++ CertFile ++ " -CAfile " ++ CaCertFile
- ++ " -key " ++ KeyFile ++ " -tls1 -msg",
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+
+ Cmd = "openssl s_client -port " ++ integer_to_list(Port) ++ version_flag(Version) ++
+ " -host localhost",
test_server:format("openssl cmd: ~p~n", [Cmd]),
@@ -347,7 +381,7 @@ tls1_erlang_server_openssl_client_dsa_cert(Config) when is_list(Config) ->
port_command(OpenSslPort, Data),
ssl_test_lib:check_result(Server, ok),
-
+
%% Clean close down! Server needs to be closed first !!
ssl_test_lib:close(Server),
close_port(OpenSslPort),
@@ -356,11 +390,11 @@ tls1_erlang_server_openssl_client_dsa_cert(Config) when is_list(Config) ->
%%--------------------------------------------------------------------
-ssl3_erlang_client_openssl_server_dsa_cert(doc) ->
+erlang_client_openssl_server_dsa_cert(doc) ->
["Test erlang server with openssl client"];
-ssl3_erlang_client_openssl_server_dsa_cert(suite) ->
+erlang_client_openssl_server_dsa_cert(suite) ->
[];
-ssl3_erlang_client_openssl_server_dsa_cert(Config) when is_list(Config) ->
+erlang_client_openssl_server_dsa_cert(Config) when is_list(Config) ->
process_flag(trap_exit, true),
ClientOpts = ?config(client_dsa_opts, Config),
ServerOpts = ?config(server_dsa_opts, Config),
@@ -373,10 +407,11 @@ ssl3_erlang_client_openssl_server_dsa_cert(Config) when is_list(Config) ->
CaCertFile = proplists:get_value(cacertfile, ServerOpts),
CertFile = proplists:get_value(certfile, ServerOpts),
KeyFile = proplists:get_value(keyfile, ServerOpts),
-
- Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+
+ Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++ version_flag(Version) ++
" -cert " ++ CertFile ++ " -CAfile " ++ CaCertFile
- ++ " -key " ++ KeyFile ++ " -Verify 2 -ssl3 -msg",
+ ++ " -key " ++ KeyFile ++ " -Verify 2 -msg",
test_server:format("openssl cmd: ~p~n", [Cmd]),
@@ -400,49 +435,46 @@ ssl3_erlang_client_openssl_server_dsa_cert(Config) when is_list(Config) ->
ssl_test_lib:close(Client),
process_flag(trap_exit, false),
ok.
-
-%%--------------------------------------------------------------------
-
-ssl3_erlang_server_openssl_client_dsa_cert(doc) ->
+%%--------------------------------------------------------------------
+erlang_server_openssl_client_dsa_cert(doc) ->
["Test erlang server with openssl client"];
-ssl3_erlang_server_openssl_client_dsa_cert(suite) ->
+erlang_server_openssl_client_dsa_cert(suite) ->
[];
-ssl3_erlang_server_openssl_client_dsa_cert(Config) when is_list(Config) ->
+erlang_server_openssl_client_dsa_cert(Config) when is_list(Config) ->
process_flag(trap_exit, true),
ClientOpts = ?config(client_dsa_opts, Config),
- ServerOpts = ?config(server_dsa_verify_opts, Config),
+ ServerOpts = ?config(server_dsa_verify_opts, Config),
{_, ServerNode, _} = ssl_test_lib:run_where(Config),
-
+
Data = "From openssl to erlang",
CaCertFile = proplists:get_value(cacertfile, ClientOpts),
CertFile = proplists:get_value(certfile, ClientOpts),
KeyFile = proplists:get_value(keyfile, ClientOpts),
-
- Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
- {from, self()},
- {mfa, {?MODULE, erlang_ssl_receive, [Data]}},
- {options, ServerOpts}]),
+
+ Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
+ {from, self()},
+ {mfa, {?MODULE, erlang_ssl_receive, [Data]}},
+ {options, ServerOpts}]),
Port = ssl_test_lib:inet_port(Server),
-
- Cmd = "openssl s_client -port " ++ integer_to_list(Port) ++
- " -host localhost " ++ " -cert " ++ CertFile ++ " -CAfile " ++ CaCertFile
- ++ " -key " ++ KeyFile ++ " -ssl3 -msg",
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+ Cmd = "openssl s_client -port " ++ integer_to_list(Port) ++ version_flag(Version) ++
+ " -host localhost " ++ " -cert " ++ CertFile ++ " -CAfile " ++ CaCertFile
+ ++ " -key " ++ KeyFile ++ " -msg",
test_server:format("openssl cmd: ~p~n", [Cmd]),
-
- OpenSslPort = open_port({spawn, Cmd}, [stderr_to_stdout]),
+
+ OpenSslPort = open_port({spawn, Cmd}, [stderr_to_stdout]),
port_command(OpenSslPort, Data),
-
+
ssl_test_lib:check_result(Server, ok),
-
+
%% Clean close down! Server needs to be closed first !!
ssl_test_lib:close(Server),
close_port(OpenSslPort),
process_flag(trap_exit, false),
ok.
-
%%--------------------------------------------------------------------
erlang_server_openssl_client_reuse_session(doc) ->
@@ -464,8 +496,8 @@ erlang_server_openssl_client_reuse_session(Config) when is_list(Config) ->
{reconnect_times, 5},
{options, ServerOpts}]),
Port = ssl_test_lib:inet_port(Server),
-
- Cmd = "openssl s_client -port " ++ integer_to_list(Port) ++
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+ Cmd = "openssl s_client -port " ++ integer_to_list(Port) ++ version_flag(Version) ++
" -host localhost -reconnect",
test_server:format("openssl cmd: ~p~n", [Cmd]),
@@ -501,8 +533,9 @@ erlang_client_openssl_server_renegotiate(Config) when is_list(Config) ->
Port = ssl_test_lib:inet_port(node()),
CertFile = proplists:get_value(certfile, ServerOpts),
KeyFile = proplists:get_value(keyfile, ServerOpts),
-
- Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+
+ Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++ version_flag(Version) ++
" -cert " ++ CertFile ++ " -key " ++ KeyFile ++ " -msg",
test_server:format("openssl cmd: ~p~n", [Cmd]),
@@ -532,14 +565,14 @@ erlang_client_openssl_server_renegotiate(Config) when is_list(Config) ->
%%--------------------------------------------------------------------
-erlang_client_openssl_server_no_wrap_sequence_number(doc) ->
+erlang_client_openssl_server_nowrap_seqnum(doc) ->
["Test that erlang client will renegotiate session when",
"max sequence number celing is about to be reached. Although"
"in the testcase we use the test option renegotiate_at"
" to lower treashold substantially."];
-erlang_client_openssl_server_no_wrap_sequence_number(suite) ->
+erlang_client_openssl_server_nowrap_seqnum(suite) ->
[];
-erlang_client_openssl_server_no_wrap_sequence_number(Config) when is_list(Config) ->
+erlang_client_openssl_server_nowrap_seqnum(Config) when is_list(Config) ->
process_flag(trap_exit, true),
ServerOpts = ?config(server_opts, Config),
ClientOpts = ?config(client_opts, Config),
@@ -552,8 +585,8 @@ erlang_client_openssl_server_no_wrap_sequence_number(Config) when is_list(Config
Port = ssl_test_lib:inet_port(node()),
CertFile = proplists:get_value(certfile, ServerOpts),
KeyFile = proplists:get_value(keyfile, ServerOpts),
-
- Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+ Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++ version_flag(Version) ++
" -cert " ++ CertFile ++ " -key " ++ KeyFile ++ " -msg",
test_server:format("openssl cmd: ~p~n", [Cmd]),
@@ -578,15 +611,15 @@ erlang_client_openssl_server_no_wrap_sequence_number(Config) when is_list(Config
process_flag(trap_exit, false),
ok.
%%--------------------------------------------------------------------
-erlang_server_openssl_client_no_wrap_sequence_number(doc) ->
+erlang_server_openssl_client_nowrap_seqnum(doc) ->
["Test that erlang client will renegotiate session when",
"max sequence number celing is about to be reached. Although"
"in the testcase we use the test option renegotiate_at"
" to lower treashold substantially."];
-erlang_server_openssl_client_no_wrap_sequence_number(suite) ->
+erlang_server_openssl_client_nowrap_seqnum(suite) ->
[];
-erlang_server_openssl_client_no_wrap_sequence_number(Config) when is_list(Config) ->
+erlang_server_openssl_client_nowrap_seqnum(Config) when is_list(Config) ->
process_flag(trap_exit, true),
ServerOpts = ?config(server_opts, Config),
@@ -600,10 +633,10 @@ erlang_server_openssl_client_no_wrap_sequence_number(Config) when is_list(Config
{from, self()},
{mfa, {ssl_test_lib,
trigger_renegotiate, [[Data, N+2]]}},
- {options, [{renegotiate_at, N} | ServerOpts]}]),
+ {options, [{renegotiate_at, N}, {reuse_sessions, false} | ServerOpts]}]),
Port = ssl_test_lib:inet_port(Server),
-
- Cmd = "openssl s_client -port " ++ integer_to_list(Port) ++
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+ Cmd = "openssl s_client -port " ++ integer_to_list(Port) ++ version_flag(Version) ++
" -host localhost -msg",
test_server:format("openssl cmd: ~p~n", [Cmd]),
@@ -639,8 +672,8 @@ erlang_client_openssl_server_no_server_ca_cert(Config) when is_list(Config) ->
Port = ssl_test_lib:inet_port(node()),
CertFile = proplists:get_value(certfile, ServerOpts),
KeyFile = proplists:get_value(keyfile, ServerOpts),
-
- Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+ Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++ version_flag(Version) ++
" -cert " ++ CertFile ++ " -key " ++ KeyFile ++ " -msg",
test_server:format("openssl cmd: ~p~n", [Cmd]),
@@ -667,85 +700,11 @@ erlang_client_openssl_server_no_server_ca_cert(Config) when is_list(Config) ->
ok.
%%--------------------------------------------------------------------
-ssl3_erlang_client_openssl_server(doc) ->
- ["Test erlang client with openssl server"];
-ssl3_erlang_client_openssl_server(suite) ->
- [];
-ssl3_erlang_client_openssl_server(Config) when is_list(Config) ->
- process_flag(trap_exit, true),
- ServerOpts = ?config(server_opts, Config),
- ClientOpts = ?config(client_opts, Config),
-
- {ClientNode, _, Hostname} = ssl_test_lib:run_where(Config),
-
- Port = ssl_test_lib:inet_port(node()),
- CertFile = proplists:get_value(certfile, ServerOpts),
- KeyFile = proplists:get_value(keyfile, ServerOpts),
-
- Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++
- " -cert " ++ CertFile ++ " -key " ++ KeyFile ++ " -ssl3",
-
- test_server:format("openssl cmd: ~p~n", [Cmd]),
-
- OpensslPort = open_port({spawn, Cmd}, [stderr_to_stdout]),
-
- wait_for_openssl_server(),
-
- Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
- {host, Hostname},
- {from, self()},
- {mfa, {?MODULE,
- connection_info, [sslv3]}},
- {options,
- [{versions, [sslv3]} | ClientOpts]}]),
- ssl_test_lib:check_result(Client, ok),
-
- %% Clean close down! Server needs to be closed first !!
- close_port(OpensslPort),
- ssl_test_lib:close(Client),
- process_flag(trap_exit, false),
- ok.
-
-%%--------------------------------------------------------------------
-
-ssl3_erlang_server_openssl_client(doc) ->
- ["Test erlang server with openssl client"];
-ssl3_erlang_server_openssl_client(suite) ->
- [];
-ssl3_erlang_server_openssl_client(Config) when is_list(Config) ->
- process_flag(trap_exit, true),
- ServerOpts = ?config(server_opts, Config),
-
- {_, ServerNode, _} = ssl_test_lib:run_where(Config),
-
- Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
- {from, self()},
- {mfa,
- {?MODULE, connection_info, [sslv3]}},
- {options,
- [{versions, [sslv3]} | ServerOpts]}]),
- Port = ssl_test_lib:inet_port(Server),
-
- Cmd = "openssl s_client -port " ++ integer_to_list(Port) ++
- " -host localhost -ssl3",
-
- test_server:format("openssl cmd: ~p~n", [Cmd]),
-
- OpenSslPort = open_port({spawn, Cmd}, [stderr_to_stdout]),
-
- ssl_test_lib:check_result(Server, ok),
- %% Clean close down! Server needs to be closed first !!
- ssl_test_lib:close(Server),
- close_port(OpenSslPort),
- process_flag(trap_exit, false),
- ok.
-
-%%--------------------------------------------------------------------
-ssl3_erlang_client_openssl_server_client_cert(doc) ->
+erlang_client_openssl_server_client_cert(doc) ->
["Test erlang client with openssl server when client sends cert"];
-ssl3_erlang_client_openssl_server_client_cert(suite) ->
+erlang_client_openssl_server_client_cert(suite) ->
[];
-ssl3_erlang_client_openssl_server_client_cert(Config) when is_list(Config) ->
+erlang_client_openssl_server_client_cert(Config) when is_list(Config) ->
process_flag(trap_exit, true),
ServerOpts = ?config(server_verification_opts, Config),
ClientOpts = ?config(client_verification_opts, Config),
@@ -758,10 +717,10 @@ ssl3_erlang_client_openssl_server_client_cert(Config) when is_list(Config) ->
CertFile = proplists:get_value(certfile, ServerOpts),
CaCertFile = proplists:get_value(cacertfile, ServerOpts),
KeyFile = proplists:get_value(keyfile, ServerOpts),
-
- Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+ Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++ version_flag(Version) ++
" -cert " ++ CertFile ++ " -CAfile " ++ CaCertFile
- ++ " -key " ++ KeyFile ++ " -Verify 2 -ssl3",
+ ++ " -key " ++ KeyFile ++ " -Verify 2",
test_server:format("openssl cmd: ~p~n", [Cmd]),
@@ -787,11 +746,11 @@ ssl3_erlang_client_openssl_server_client_cert(Config) when is_list(Config) ->
%%--------------------------------------------------------------------
-ssl3_erlang_server_openssl_client_client_cert(doc) ->
+erlang_server_openssl_client_client_cert(doc) ->
["Test erlang server with openssl client when client sends cert"];
-ssl3_erlang_server_openssl_client_client_cert(suite) ->
+erlang_server_openssl_client_client_cert(suite) ->
[];
-ssl3_erlang_server_openssl_client_client_cert(Config) when is_list(Config) ->
+erlang_server_openssl_client_client_cert(Config) when is_list(Config) ->
process_flag(trap_exit, true),
ServerOpts = ?config(server_verification_opts, Config),
ClientOpts = ?config(client_verification_opts, Config),
@@ -812,10 +771,10 @@ ssl3_erlang_server_openssl_client_client_cert(Config) when is_list(Config) ->
CaCertFile = proplists:get_value(cacertfile, ClientOpts),
CertFile = proplists:get_value(certfile, ClientOpts),
KeyFile = proplists:get_value(keyfile, ClientOpts),
-
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
Cmd = "openssl s_client -cert " ++ CertFile ++ " -CAfile " ++ CaCertFile
- ++ " -key " ++ KeyFile ++ " -port " ++ integer_to_list(Port) ++
- " -host localhost -ssl3",
+ ++ " -key " ++ KeyFile ++ " -port " ++ integer_to_list(Port) ++ version_flag(Version) ++
+ " -host localhost",
test_server:format("openssl cmd: ~p~n", [Cmd]),
@@ -833,15 +792,15 @@ ssl3_erlang_server_openssl_client_client_cert(Config) when is_list(Config) ->
%%--------------------------------------------------------------------
-ssl3_erlang_server_erlang_client_client_cert(doc) ->
+erlang_server_erlang_client_client_cert(doc) ->
["Test erlang server with erlang client when client sends cert"];
-ssl3_erlang_server_erlang_client_client_cert(suite) ->
+erlang_server_erlang_client_client_cert(suite) ->
[];
-ssl3_erlang_server_erlang_client_client_cert(Config) when is_list(Config) ->
+erlang_server_erlang_client_client_cert(Config) when is_list(Config) ->
process_flag(trap_exit, true),
ServerOpts = ?config(server_verification_opts, Config),
ClientOpts = ?config(client_verification_opts, Config),
-
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Data = "From erlang to erlang",
@@ -863,7 +822,7 @@ ssl3_erlang_server_erlang_client_client_cert(Config) when is_list(Config) ->
%% Due to 1/n-1 splitting countermeasure Rizzo/Duong-Beast
{mfa, {ssl, send, [Data]}},
{options,
- [{versions, [sslv3]} | ClientOpts]}]),
+ [{versions, [Version]} | ClientOpts]}]),
ssl_test_lib:check_result(Server, ok, Client, ok),
@@ -871,215 +830,8 @@ ssl3_erlang_server_erlang_client_client_cert(Config) when is_list(Config) ->
ssl_test_lib:close(Client),
process_flag(trap_exit, false),
ok.
-
-
-%%--------------------------------------------------------------------
-
-tls1_erlang_client_openssl_server(doc) ->
- ["Test erlang client with openssl server"];
-tls1_erlang_client_openssl_server(suite) ->
- [];
-tls1_erlang_client_openssl_server(Config) when is_list(Config) ->
- process_flag(trap_exit, true),
- ServerOpts = ?config(server_opts, Config),
- ClientOpts = ?config(client_opts, Config),
-
-
- test_server:format("Server Opts", [ServerOpts]),
-
- {ClientNode, _, Hostname} = ssl_test_lib:run_where(Config),
-
- Port = ssl_test_lib:inet_port(node()),
- CertFile = proplists:get_value(certfile, ServerOpts),
- KeyFile = proplists:get_value(keyfile, ServerOpts),
-
- Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++
- " -cert " ++ CertFile ++ " -key " ++ KeyFile ++ " -tls1",
-
- test_server:format("openssl cmd: ~p~n", [Cmd]),
-
- OpensslPort = open_port({spawn, Cmd}, [stderr_to_stdout]),
-
- wait_for_openssl_server(),
-
- Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
- {host, Hostname},
- {from, self()},
- {mfa, {?MODULE,
- connection_info, [tlsv1]}},
- {options,
- [{versions, [tlsv1]} | ClientOpts]}]),
-
- ssl_test_lib:check_result(Client, ok),
-
- %% Clean close down! Server needs to be closed first !!
- close_port(OpensslPort),
- ssl_test_lib:close(Client),
- process_flag(trap_exit, false),
- ok.
-
-%%--------------------------------------------------------------------
-
-tls1_erlang_server_openssl_client(doc) ->
- ["Test erlang server with openssl client"];
-tls1_erlang_server_openssl_client(suite) ->
- [];
-tls1_erlang_server_openssl_client(Config) when is_list(Config) ->
- process_flag(trap_exit, true),
- ServerOpts = ?config(server_opts, Config),
-
- {_, ServerNode, _} = ssl_test_lib:run_where(Config),
-
- Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
- {from, self()},
- {mfa,
- {?MODULE, connection_info, [tlsv1]}},
- {options,
- [{versions, [tlsv1]} | ServerOpts]}]),
- Port = ssl_test_lib:inet_port(Server),
-
- Cmd = "openssl s_client -port " ++ integer_to_list(Port) ++
- " -host localhost -tls1",
-
- test_server:format("openssl cmd: ~p~n", [Cmd]),
-
- OpenSslPort = open_port({spawn, Cmd}, [stderr_to_stdout]),
-
- ssl_test_lib:check_result(Server, ok),
-
- %% Clean close down! Server needs to be closed first !!
- ssl_test_lib:close(Server),
- close_port(OpenSslPort),
- process_flag(trap_exit, false),
- ok.
-
-%%--------------------------------------------------------------------
-
-tls1_erlang_client_openssl_server_client_cert(doc) ->
- ["Test erlang client with openssl server when client sends cert"];
-tls1_erlang_client_openssl_server_client_cert(suite) ->
- [];
-tls1_erlang_client_openssl_server_client_cert(Config) when is_list(Config) ->
- process_flag(trap_exit, true),
- ServerOpts = ?config(server_verification_opts, Config),
- ClientOpts = ?config(client_verification_opts, Config),
-
- {ClientNode, _, Hostname} = ssl_test_lib:run_where(Config),
-
- Data = "From openssl to erlang",
-
- Port = ssl_test_lib:inet_port(node()),
- CaCertFile = proplists:get_value(cacertfile, ServerOpts),
- CertFile = proplists:get_value(certfile, ServerOpts),
- KeyFile = proplists:get_value(keyfile, ServerOpts),
-
- Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++
- " -cert " ++ CertFile ++ " -CAfile " ++ CaCertFile
- ++ " -key " ++ KeyFile ++ " -Verify 2 -tls1",
-
- test_server:format("openssl cmd: ~p~n", [Cmd]),
-
- OpensslPort = open_port({spawn, Cmd}, [stderr_to_stdout]),
-
- wait_for_openssl_server(),
-
- Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
- {host, Hostname},
- {from, self()},
- {mfa, {?MODULE,
- erlang_ssl_receive, [Data]}},
- {options, ClientOpts}]),
- port_command(OpensslPort, Data),
-
- ssl_test_lib:check_result(Client, ok),
-
- %% Clean close down! Server needs to be closed first !!
- close_port(OpensslPort),
- ssl_test_lib:close(Client),
- process_flag(trap_exit, false),
- ok.
-
%%--------------------------------------------------------------------
-tls1_erlang_server_openssl_client_client_cert(doc) ->
- ["Test erlang server with openssl client when client sends cert"];
-tls1_erlang_server_openssl_client_client_cert(suite) ->
- [];
-tls1_erlang_server_openssl_client_client_cert(Config) when is_list(Config) ->
- process_flag(trap_exit, true),
- ServerOpts = ?config(server_verification_opts, Config),
- ClientOpts = ?config(client_verification_opts, Config),
-
- {_, ServerNode, _} = ssl_test_lib:run_where(Config),
-
- Data = "From openssl to erlang",
-
- Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
- {from, self()},
- {mfa, {?MODULE,
- erlang_ssl_receive, [Data]}},
- {options,
- [{verify , verify_peer}
- | ServerOpts]}]),
- Port = ssl_test_lib:inet_port(Server),
-
- CaCertFile = proplists:get_value(cacertfile, ClientOpts),
- CertFile = proplists:get_value(certfile, ClientOpts),
- KeyFile = proplists:get_value(keyfile, ClientOpts),
-
- Cmd = "openssl s_client -cert " ++ CertFile ++ " -CAfile " ++ CaCertFile
- ++ " -key " ++ KeyFile ++ " -port " ++ integer_to_list(Port) ++
- " -host localhost -tls1",
-
- test_server:format("openssl cmd: ~p~n", [Cmd]),
-
- OpenSslPort = open_port({spawn, Cmd}, [stderr_to_stdout]),
- port_command(OpenSslPort, Data),
-
- ssl_test_lib:check_result(Server, ok),
-
- %% Clean close down! Server needs to be closed first !!
- ssl_test_lib:close(Server),
- close_port(OpenSslPort),
- process_flag(trap_exit, false),
- ok.
-
-%%--------------------------------------------------------------------
-tls1_erlang_server_erlang_client_client_cert(doc) ->
- ["Test erlang server with erlang client when client sends cert"];
-tls1_erlang_server_erlang_client_client_cert(suite) ->
- [];
-tls1_erlang_server_erlang_client_client_cert(Config) when is_list(Config) ->
- process_flag(trap_exit, true),
- ServerOpts = ?config(server_verification_opts, Config),
- ClientOpts = ?config(client_verification_opts, Config),
-
- {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
-
- Data = "From erlang to erlang",
-
- Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
- {from, self()},
- {mfa, {?MODULE,
- erlang_ssl_receive, [Data]}},
- {options,
- [{verify , verify_peer}
- | ServerOpts]}]),
- Port = ssl_test_lib:inet_port(Server),
-
- Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
- {host, Hostname},
- {from, self()},
- {mfa, {ssl, send, [Data]}},
- {options,
- [{versions, [tlsv1]} | ClientOpts]}]),
-
- ssl_test_lib:check_result(Server, ok, Client, ok),
- ssl_test_lib:close(Server),
- process_flag(trap_exit, false),
- ok.
-%%--------------------------------------------------------------------
-
ciphers_rsa_signed_certs(doc) ->
["Test cipher suites that uses rsa certs"];
@@ -1186,12 +938,6 @@ cipher(CipherSuite, Version, Config, ClientOpts, ServerOpts) ->
process_flag(trap_exit, false),
Return.
-
-version_flag(tlsv1) ->
- " -tls1 ";
-version_flag(sslv3) ->
- " -ssl3 ".
-
%%--------------------------------------------------------------------
erlang_client_bad_openssl_server(doc) ->
[""];
@@ -1207,8 +953,8 @@ erlang_client_bad_openssl_server(Config) when is_list(Config) ->
Port = ssl_test_lib:inet_port(node()),
CertFile = proplists:get_value(certfile, ServerOpts),
KeyFile = proplists:get_value(keyfile, ServerOpts),
-
- Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+ Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++ version_flag(Version) ++
" -cert " ++ CertFile ++ " -key " ++ KeyFile ++ "",
test_server:format("openssl cmd: ~p~n", [Cmd]),
@@ -1222,7 +968,7 @@ erlang_client_bad_openssl_server(Config) when is_list(Config) ->
{from, self()},
{mfa, {?MODULE, server_sent_garbage, []}},
{options,
- [{versions, [tlsv1]} | ClientOpts]}]),
+ [{versions, [Version]} | ClientOpts]}]),
%% Send garbage
port_command(OpensslPort, ?OPENSSL_GARBAGE),
@@ -1241,7 +987,7 @@ erlang_client_bad_openssl_server(Config) when is_list(Config) ->
{from, self()},
{mfa, {ssl_test_lib, no_result_msg, []}},
{options,
- [{versions, [tlsv1]} | ClientOpts]}]),
+ [{versions, [Version]} | ClientOpts]}]),
%% Clean close down! Server needs to be closed first !!
close_port(OpensslPort),
@@ -1267,8 +1013,8 @@ expired_session(Config) when is_list(Config) ->
Port = ssl_test_lib:inet_port(node()),
CertFile = proplists:get_value(certfile, ServerOpts),
KeyFile = proplists:get_value(keyfile, ServerOpts),
-
- Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++
+
+ Cmd = "openssl s_server -accept " ++ integer_to_list(Port) ++
" -cert " ++ CertFile ++ " -key " ++ KeyFile ++ "",
test_server:format("openssl cmd: ~p~n", [Cmd]),
@@ -1344,6 +1090,248 @@ ssl2_erlang_server_openssl_client(Config) when is_list(Config) ->
ok.
%%--------------------------------------------------------------------
+erlang_client_openssl_server_npn(doc) ->
+ ["Test erlang client with openssl server doing npn negotiation"];
+erlang_client_openssl_server_npn(suite) ->
+ [];
+erlang_client_openssl_server_npn(Config) when is_list(Config) ->
+ Data = "From openssl to erlang",
+ start_erlang_client_and_openssl_server_for_npn_negotiation(Config, Data, fun(Client, OpensslPort) ->
+ port_command(OpensslPort, Data),
+
+ ssl_test_lib:check_result(Client, ok)
+ end),
+
+ ok.
+
+
+%%--------------------------------------------------------------------
+erlang_client_openssl_server_npn_renegotiate(doc) ->
+ ["Test erlang client with openssl server doing npn negotiation and renegotiate"];
+erlang_client_openssl_server_npn_renegotiate(suite) ->
+ [];
+erlang_client_openssl_server_npn_renegotiate(Config) when is_list(Config) ->
+ Data = "From openssl to erlang",
+ start_erlang_client_and_openssl_server_for_npn_negotiation(Config, Data, fun(Client, OpensslPort) ->
+ port_command(OpensslPort, ?OPENSSL_RENEGOTIATE),
+ test_server:sleep(?SLEEP),
+ port_command(OpensslPort, Data),
+ ssl_test_lib:check_result(Client, ok)
+ end),
+ ok.
+
+
+%%--------------------------------------------------------------------------
+
+
+erlang_server_openssl_client_npn(doc) ->
+ ["Test erlang server with openssl client and npn negotiation"];
+erlang_server_openssl_client_npn(suite) ->
+ [];
+erlang_server_openssl_client_npn(Config) when is_list(Config) ->
+
+ Data = "From openssl to erlang",
+ start_erlang_server_and_openssl_client_for_npn_negotiation(Config, Data, fun(Server, OpensslPort) ->
+ port_command(OpensslPort, Data),
+ ssl_test_lib:check_result(Server, ok)
+ end),
+ ok.
+
+%%--------------------------------------------------------------------------
+
+erlang_server_openssl_client_npn_renegotiate(doc) ->
+ ["Test erlang server with openssl client and npn negotiation with renegotiation"];
+erlang_server_openssl_client_npn_renegotiate(suite) ->
+ [];
+erlang_server_openssl_client_npn_renegotiate(Config) when is_list(Config) ->
+ Data = "From openssl to erlang",
+ start_erlang_server_and_openssl_client_for_npn_negotiation(Config, Data, fun(Server, OpensslPort) ->
+ port_command(OpensslPort, ?OPENSSL_RENEGOTIATE),
+ test_server:sleep(?SLEEP),
+ port_command(OpensslPort, Data),
+ ssl_test_lib:check_result(Server, ok)
+ end),
+ ok.
+%%--------------------------------------------------------------------------
+
+erlang_client_openssl_server_npn_only_server(Config) when is_list(Config) ->
+ Data = "From openssl to erlang",
+ start_erlang_client_and_openssl_server_with_opts(Config, [], "-nextprotoneg spdy/2", Data, fun(Server, OpensslPort) ->
+ port_command(OpensslPort, Data),
+ ssl_test_lib:check_result(Server, ok)
+ end),
+ ok.
+
+%%--------------------------------------------------------------------------
+
+erlang_client_openssl_server_npn_only_client(Config) when is_list(Config) ->
+ Data = "From openssl to erlang",
+ start_erlang_client_and_openssl_server_with_opts(Config, [{client_preferred_next_protocols, {client, [<<"spdy/2">>], <<"http/1.1">>}}], "", Data, fun(Server, OpensslPort) ->
+ port_command(OpensslPort, Data),
+ ssl_test_lib:check_result(Server, ok)
+ end),
+ ok.
+
+%%--------------------------------------------------------------------------
+erlang_server_openssl_client_npn_only_server(Config) when is_list(Config) ->
+ Data = "From openssl to erlang",
+ start_erlang_server_and_openssl_client_with_opts(Config, [{next_protocols_advertised, [<<"spdy/2">>]}], "", Data, fun(Server, OpensslPort) ->
+ port_command(OpensslPort, Data),
+ ssl_test_lib:check_result(Server, ok)
+ end),
+ ok.
+
+erlang_server_openssl_client_npn_only_client(Config) when is_list(Config) ->
+ Data = "From openssl to erlang",
+ start_erlang_server_and_openssl_client_with_opts(Config, [], "-nextprotoneg spdy/2", Data, fun(Server, OpensslPort) ->
+ port_command(OpensslPort, Data),
+ ssl_test_lib:check_result(Server, ok)
+ end),
+ ok.
+
+%%--------------------------------------------------------------------------
+
+start_erlang_client_and_openssl_server_with_opts(Config, ErlangClientOpts, OpensslServerOpts, Data, Callback) ->
+ process_flag(trap_exit, true),
+ ServerOpts = ?config(server_opts, Config),
+ ClientOpts0 = ?config(client_opts, Config),
+ ClientOpts = ErlangClientOpts ++ ClientOpts0,
+
+ {ClientNode, _, Hostname} = ssl_test_lib:run_where(Config),
+
+ Data = "From openssl to erlang",
+
+ Port = ssl_test_lib:inet_port(node()),
+ CertFile = proplists:get_value(certfile, ServerOpts),
+ KeyFile = proplists:get_value(keyfile, ServerOpts),
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+
+ Cmd = "openssl s_server " ++ OpensslServerOpts ++ " -accept " ++
+ integer_to_list(Port) ++ version_flag(Version) ++
+ " -cert " ++ CertFile ++ " -key " ++ KeyFile,
+
+ test_server:format("openssl cmd: ~p~n", [Cmd]),
+
+ OpensslPort = open_port({spawn, Cmd}, [stderr_to_stdout]),
+
+ wait_for_openssl_server(),
+
+ Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
+ {host, Hostname},
+ {from, self()},
+ {mfa, {?MODULE,
+ erlang_ssl_receive, [Data]}},
+ {options, ClientOpts}]),
+
+ Callback(Client, OpensslPort),
+
+ %% Clean close down! Server needs to be closed first !!
+ close_port(OpensslPort),
+
+ ssl_test_lib:close(Client),
+ process_flag(trap_exit, false).
+
+start_erlang_client_and_openssl_server_for_npn_negotiation(Config, Data, Callback) ->
+ process_flag(trap_exit, true),
+ ServerOpts = ?config(server_opts, Config),
+ ClientOpts0 = ?config(client_opts, Config),
+ ClientOpts = [{client_preferred_next_protocols, {client, [<<"spdy/2">>], <<"http/1.1">>}} | ClientOpts0],
+
+ {ClientNode, _, Hostname} = ssl_test_lib:run_where(Config),
+
+ Data = "From openssl to erlang",
+
+ Port = ssl_test_lib:inet_port(node()),
+ CertFile = proplists:get_value(certfile, ServerOpts),
+ KeyFile = proplists:get_value(keyfile, ServerOpts),
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+
+ Cmd = "openssl s_server -msg -nextprotoneg http/1.1,spdy/2 -accept " ++ integer_to_list(Port) ++ version_flag(Version) ++
+ " -cert " ++ CertFile ++ " -key " ++ KeyFile,
+
+ test_server:format("openssl cmd: ~p~n", [Cmd]),
+
+ OpensslPort = open_port({spawn, Cmd}, [stderr_to_stdout]),
+
+ wait_for_openssl_server(),
+
+ Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
+ {host, Hostname},
+ {from, self()},
+ {mfa, {?MODULE,
+ erlang_ssl_receive_and_assert_npn, [<<"spdy/2">>, Data]}},
+ {options, ClientOpts}]),
+
+ Callback(Client, OpensslPort),
+
+ %% Clean close down! Server needs to be closed first !!
+ close_port(OpensslPort),
+
+ ssl_test_lib:close(Client),
+ process_flag(trap_exit, false).
+
+start_erlang_server_and_openssl_client_for_npn_negotiation(Config, Data, Callback) ->
+ process_flag(trap_exit, true),
+ ServerOpts0 = ?config(server_opts, Config),
+ ServerOpts = [{next_protocols_advertised, [<<"spdy/2">>]}, ServerOpts0],
+
+ {_, ServerNode, _} = ssl_test_lib:run_where(Config),
+
+
+ Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
+ {from, self()},
+ {mfa, {?MODULE, erlang_ssl_receive_and_assert_npn, [<<"spdy/2">>, Data]}},
+ {options, ServerOpts}]),
+ Port = ssl_test_lib:inet_port(Server),
+ Version = ssl_record:protocol_version(ssl_record:highest_protocol_version([])),
+ Cmd = "openssl s_client -nextprotoneg http/1.0,spdy/2 -msg -port " ++ integer_to_list(Port) ++ version_flag(Version) ++
+ " -host localhost",
+
+ test_server:format("openssl cmd: ~p~n", [Cmd]),
+
+ OpenSslPort = open_port({spawn, Cmd}, [stderr_to_stdout]),
+
+ Callback(Server, OpenSslPort),
+
+ ssl_test_lib:close(Server),
+
+ close_port(OpenSslPort),
+ process_flag(trap_exit, false).
+
+start_erlang_server_and_openssl_client_with_opts(Config, ErlangServerOpts, OpenSSLClientOpts, Data, Callback) ->
+ process_flag(trap_exit, true),
+ ServerOpts0 = ?config(server_opts, Config),
+ ServerOpts = ErlangServerOpts ++ ServerOpts0,
+
+ {_, ServerNode, _} = ssl_test_lib:run_where(Config),
+
+
+ Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
+ {from, self()},
+ {mfa, {?MODULE, erlang_ssl_receive, [Data]}},
+ {options, ServerOpts}]),
+ Port = ssl_test_lib:inet_port(Server),
+
+ Cmd = "openssl s_client " ++ OpenSSLClientOpts ++ " -msg -port " ++ integer_to_list(Port) ++
+ " -host localhost",
+
+ test_server:format("openssl cmd: ~p~n", [Cmd]),
+
+ OpenSslPort = open_port({spawn, Cmd}, [stderr_to_stdout]),
+
+ Callback(Server, OpenSslPort),
+
+ ssl_test_lib:close(Server),
+
+ close_port(OpenSslPort),
+ process_flag(trap_exit, false).
+
+
+erlang_ssl_receive_and_assert_npn(Socket, Protocol, Data) ->
+ {ok, Protocol} = ssl:negotiated_next_protocol(Socket),
+ erlang_ssl_receive(Socket, Data),
+ {ok, Protocol} = ssl:negotiated_next_protocol(Socket),
+ ok.
erlang_ssl_receive(Socket, Data) ->
test_server:format("Connection info: ~p~n",
@@ -1433,21 +1421,55 @@ wait_for_openssl_server() ->
%% more so than sleep!)
test_server:sleep(?SLEEP)
end.
-
+
+version_flag(tlsv1) ->
+ " -tls1 ";
+version_flag('tlsv1.1') ->
+ " -tls1_1 ";
+version_flag('tlsv1.2') ->
+ " -tls1_2 ";
+version_flag(sslv3) ->
+ " -ssl3 ".
+
+check_openssl_npn_support(Config) ->
+ HelpText = os:cmd("openssl s_client --help"),
+ case string:str(HelpText, "nextprotoneg") of
+ 0 ->
+ {skip, "Openssl not compiled with nextprotoneg support"};
+ _ ->
+ Config
+ end.
+
check_sane_openssl_renegotaite(Config) ->
case os:cmd("openssl version") of
"OpenSSL 0.9.8" ++ _ ->
- {skip, "Known renegotiation bug in OppenSSL"};
+ {skip, "Known renegotiation bug in OpenSSL"};
"OpenSSL 0.9.7" ++ _ ->
- {skip, "Known renegotiation bug in OppenSSL"};
+ {skip, "Known renegotiation bug in OpenSSL"};
_ ->
Config
end.
check_sane_openssl_sslv2(Config) ->
case os:cmd("openssl version") of
- "OpenSSL 1.0.0e" ++ _ ->
- {skip, "Known option bug"};
+ "OpenSSL 1." ++ _ ->
+ {skip, "sslv2 by default turned of in 1.*"};
_ ->
Config
end.
+
+check_sane_openssl_version(Version) ->
+ case {Version, os:cmd("openssl version")} of
+ {_, "OpenSSL 1.0.1" ++ _} ->
+ true;
+ {'tlsv1.2', "OpenSSL 1.0" ++ _} ->
+ false;
+ {'tlsv1.1', "OpenSSL 1.0" ++ _} ->
+ false;
+ {'tlsv1.2', "OpenSSL 0" ++ _} ->
+ false;
+ {'tlsv1.1', "OpenSSL 0" ++ _} ->
+ false;
+ {_, _} ->
+ true
+ end.
diff --git a/lib/ssl/vsn.mk b/lib/ssl/vsn.mk
index 2255798f1d..e381b73c27 100644
--- a/lib/ssl/vsn.mk
+++ b/lib/ssl/vsn.mk
@@ -1 +1 @@
-SSL_VSN = 5.0
+SSL_VSN = 5.1
diff --git a/lib/stdlib/doc/src/Makefile b/lib/stdlib/doc/src/Makefile
index 6c92756ae7..50f6427eaa 100644
--- a/lib/stdlib/doc/src/Makefile
+++ b/lib/stdlib/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -173,15 +173,15 @@ $(SPECDIR)/specs_erl_id_trans.xml:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man6
- $(INSTALL_DATA) $(MAN6_FILES) $(RELEASE_PATH)/man/man6
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man6"
+ $(INSTALL_DATA) $(MAN6_FILES) "$(RELEASE_PATH)/man/man6"
release_spec:
diff --git a/lib/stdlib/doc/src/binary.xml b/lib/stdlib/doc/src/binary.xml
index 88ce77e0d0..06cfad0b0b 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>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -77,41 +77,30 @@
</datatypes>
<funcs>
<func>
- <name>at(Subject, Pos) -> byte()</name>
+ <name name="at" arity="2"/>
<fsummary>Returns the byte at a specific position in a binary</fsummary>
- <type>
- <v>Subject = binary()</v>
- <v>Pos = integer() >= 0</v>
- </type>
<desc>
- <p>Returns the byte at position <c>Pos</c> (zero-based) in the binary
- <c>Subject</c> as an integer. If <c>Pos</c> &gt;= <c>byte_size(Subject)</c>,
+ <p>Returns the byte at position <c><anno>Pos</anno></c> (zero-based) in the binary
+ <c><anno>Subject</anno></c> as an integer. If <c><anno>Pos</anno></c> &gt;= <c>byte_size(<anno>Subject</anno>)</c>,
a <c>badarg</c>
exception is raised.</p>
</desc>
</func>
<func>
- <name>bin_to_list(Subject) -> [byte()]</name>
+ <name name="bin_to_list" arity="1"/>
<fsummary>Convert a binary to a list of integers</fsummary>
- <type>
- <v>Subject = binary()</v>
- </type>
<desc>
- <p>The same as <c>bin_to_list(Subject,{0,byte_size(Subject)})</c>.</p>
+ <p>The same as <c>bin_to_list(<anno>Subject</anno>,{0,byte_size(<anno>Subject</anno>)})</c>.</p>
</desc>
</func>
<func>
- <name>bin_to_list(Subject, PosLen) -> [byte()]</name>
+ <name name="bin_to_list" arity="2"/>
<fsummary>Convert a binary to a list of integers</fsummary>
- <type>
- <v>Subject = binary()</v>
- <v>PosLen = part()</v>
- </type>
<desc>
- <p>Converts <c>Subject</c> to a list of <c>byte()</c>s, each representing
+ <p>Converts <c><anno>Subject</anno></c> to a list of <c>byte()</c>s, each representing
the value of one byte. The <c>part()</c> denotes which part of the
<c>binary()</c> to convert. Example:</p>
@@ -120,27 +109,19 @@
"rla"
%% or [114,108,97] in list notation.
</code>
- <p>If <c>PosLen</c> in any way references outside the binary, a <c>badarg</c> exception is raised.</p>
+ <p>If <c><anno>PosLen</anno></c> in any way references outside the binary, a <c>badarg</c> exception is raised.</p>
</desc>
</func>
<func>
- <name>bin_to_list(Subject, Pos, Len) -> [byte()]</name>
+ <name name="bin_to_list" arity="3"/>
<fsummary>Convert a binary to a list of integers</fsummary>
- <type>
- <v>Subject = binary()</v>
- <v>Pos = integer() >= 0</v>
- <v>Len = integer() >= 0</v>
- </type>
<desc>
- <p>The same as<c> bin_to_list(Subject,{Pos,Len})</c>.</p>
+ <p>The same as<c> bin_to_list(<anno>Subject</anno>,{<anno>Pos</anno>,<anno>Len</anno>})</c>.</p>
</desc>
</func>
<func>
- <name>compile_pattern(Pattern) -> cp()</name>
+ <name name="compile_pattern" arity="1"/>
<fsummary>Pre-compiles a binary search pattern</fsummary>
- <type>
- <v>Pattern = binary() | [ binary() ]</v>
- </type>
<desc>
<p>Builds an internal structure representing a compilation of a
@@ -155,7 +136,7 @@
<p>When a list of binaries is given, it denotes a set of
alternative binaries to search for. I.e if
<c>[&lt;&lt;"functional"&gt;&gt;,&lt;&lt;"programming"&gt;&gt;]</c>
- is given as <c>Pattern</c>, this
+ is given as <c><anno>Pattern</anno></c>, this
means "either <c>&lt;&lt;"functional"&gt;&gt;</c> or
<c>&lt;&lt;"programming"&gt;&gt;</c>". The pattern is a set of
alternatives; when only a single binary is given, the set has
@@ -163,32 +144,25 @@
<p>The list of binaries used for search alternatives shall be flat and proper.</p>
- <p>If <c>Pattern</c> is not a binary or a flat proper list of binaries with length &gt; 0,
+ <p>If <c><anno>Pattern</anno></c> is not a binary or a flat proper list of binaries with length &gt; 0,
a <c>badarg</c> exception will be raised.</p>
</desc>
</func>
<func>
- <name>copy(Subject) -> binary()</name>
+ <name name="copy" arity="1"/>
<fsummary>Creates a duplicate of a binary</fsummary>
- <type>
- <v>Subject = binary()</v>
- </type>
<desc>
- <p>The same as <c>copy(Subject, 1)</c>.</p>
+ <p>The same as <c>copy(<anno>Subject</anno>, 1)</c>.</p>
</desc>
</func>
<func>
- <name>copy(Subject,N) -> binary()</name>
+ <name name="copy" arity="2"/>
<fsummary>Duplicates a binary N times and creates a new</fsummary>
- <type>
- <v>Subject = binary()</v>
- <v>N = integer() >= 0</v>
- </type>
<desc>
- <p>Creates a binary with the content of <c>Subject</c> duplicated <c>N</c> times.</p>
+ <p>Creates a binary with the content of <c><anno>Subject</anno></c> duplicated <c><anno>N</anno></c> times.</p>
- <p>This function will always create a new binary, even if <c>N =
+ <p>This function will always create a new binary, even if <c><anno>N</anno> =
1</c>. By using <c>copy/1</c> on a binary referencing a larger binary, one
might free up the larger binary for garbage collection.</p>
@@ -201,32 +175,23 @@
large binaries are no longer used in any process, deliberate
copying might be a good idea.</p> </note>
- <p>If <c>N</c> &lt; <c>0</c>, a <c>badarg</c> exception is raised.</p>
+ <p>If <c><anno>N</anno></c> &lt; <c>0</c>, a <c>badarg</c> exception is raised.</p>
</desc>
</func>
<func>
- <name>decode_unsigned(Subject) -> Unsigned</name>
+ <name name="decode_unsigned" arity="1"/>
<fsummary>Decode a whole binary into an integer of arbitrary size</fsummary>
- <type>
- <v>Subject = binary()</v>
- <v>Unsigned = integer() >= 0</v>
- </type>
<desc>
- <p>The same as <c>decode_unsigned(Subject,big)</c>.</p>
+ <p>The same as <c>decode_unsigned(<anno>Subject</anno>, big)</c>.</p>
</desc>
</func>
<func>
- <name>decode_unsigned(Subject, Endianess) -> Unsigned</name>
+ <name name="decode_unsigned" arity="2"/>
<fsummary>Decode a whole binary into an integer of arbitrary size</fsummary>
- <type>
- <v>Subject = binary()</v>
- <v>Endianess = big | little</v>
- <v>Unsigned = integer() >= 0</v>
- </type>
<desc>
<p>Converts the binary digit representation, in big or little
- endian, of a positive integer in <c>Subject</c> to an Erlang <c>integer()</c>.</p>
+ endian, of a positive integer in <c><anno>Subject</anno></c> to an Erlang <c>integer()</c>.</p>
<p>Example:</p>
@@ -237,22 +202,15 @@
</desc>
</func>
<func>
- <name>encode_unsigned(Unsigned) -> binary()</name>
+ <name name="encode_unsigned" arity="1"/>
<fsummary>Encodes an unsigned integer into the minimal binary</fsummary>
- <type>
- <v>Unsigned = integer() >= 0</v>
- </type>
<desc>
- <p>The same as <c>encode_unsigned(Unsigned,big)</c>.</p>
+ <p>The same as <c>encode_unsigned(<anno>Unsigned</anno>, big)</c>.</p>
</desc>
</func>
<func>
- <name>encode_unsigned(Unsigned,Endianess) -> binary()</name>
+ <name name="encode_unsigned" arity="2"/>
<fsummary>Encodes an unsigned integer into the minimal binary</fsummary>
- <type>
- <v>Unsigned = integer() >= 0</v>
- <v>Endianess = big | little</v>
- </type>
<desc>
<p>Converts a positive integer to the smallest possible
@@ -268,51 +226,39 @@
</desc>
</func>
<func>
- <name>first(Subject) -> byte()</name>
+ <name name="first" arity="1"/>
<fsummary>Returns the first byte of a binary</fsummary>
- <type>
- <v>Subject = binary()</v>
- </type>
<desc>
- <p>Returns the first byte of the binary <c>Subject</c> as an integer. If the
- size of <c>Subject</c> is zero, a <c>badarg</c> exception is raised.</p>
+ <p>Returns the first byte of the binary <c><anno>Subject</anno></c> as an integer. If the
+ size of <c><anno>Subject</anno></c> is zero, a <c>badarg</c> exception is raised.</p>
</desc>
</func>
<func>
- <name>last(Subject) -> byte()</name>
+ <name name="last" arity="1"/>
<fsummary>Returns the last byte of a binary</fsummary>
- <type>
- <v>Subject = binary()</v>
- </type>
<desc>
- <p>Returns the last byte of the binary <c>Subject</c> as an integer. If the
- size of <c>Subject</c> is zero, a <c>badarg</c> exception is raised.</p>
+ <p>Returns the last byte of the binary <c><anno>Subject</anno></c> as an integer. If the
+ size of <c><anno>Subject</anno></c> is zero, a <c>badarg</c> exception is raised.</p>
</desc>
</func>
<func>
- <name>list_to_bin(ByteList) -> binary()</name>
+ <name name="list_to_bin" arity="1"/>
<fsummary>Convert a list of integers and binaries to a binary</fsummary>
- <type>
- <v>ByteList = iodata() (see module erlang)</v>
- </type>
<desc>
<p>Works exactly as <c>erlang:list_to_binary/1</c>, added for completeness.</p>
</desc>
</func>
<func>
- <name>longest_common_prefix(Binaries) -> integer() >= 0</name>
+ <name name="longest_common_prefix" arity="1"/>
<fsummary>Returns length of longest common prefix for a set of binaries</fsummary>
- <type>
- <v>Binaries = [ binary() ]</v>
- </type>
<desc>
<p>Returns the length of the longest common prefix of the
- binaries in the list <c>Binaries</c>. Example:</p>
+ binaries in the list <c><anno>Binaries</anno></c>. Example:</p>
<code>
1> binary:longest_common_prefix([&lt;&lt;"erlang"&gt;&gt;,&lt;&lt;"ergonomy"&gt;&gt;]).
@@ -321,19 +267,16 @@
0
</code>
- <p>If <c>Binaries</c> is not a flat list of binaries, a <c>badarg</c> exception is raised.</p>
+ <p>If <c><anno>Binaries</anno></c> is not a flat list of binaries, a <c>badarg</c> exception is raised.</p>
</desc>
</func>
<func>
- <name>longest_common_suffix(Binaries) -> integer() >= 0</name>
+ <name name="longest_common_suffix" arity="1"/>
<fsummary>Returns length of longest common suffix for a set of binaries</fsummary>
- <type>
- <v>Binaries = [ binary() ]</v>
- </type>
<desc>
<p>Returns the length of the longest common suffix of the
- binaries in the list <c>Binaries</c>. Example:</p>
+ binaries in the list <c><anno>Binaries</anno></c>. Example:</p>
<code>
1> binary:longest_common_suffix([&lt;&lt;"erlang"&gt;&gt;,&lt;&lt;"fang"&gt;&gt;]).
@@ -347,35 +290,24 @@
</desc>
</func>
<func>
- <name>match(Subject, Pattern) -> Found | <c>nomatch</c></name>
+ <name name="match" arity="2"/>
<fsummary>Searches for the first match of a pattern in a binary</fsummary>
- <type>
- <v>Subject = binary()</v>
- <v>Pattern = binary() | [ binary() ] | cp()</v>
- <v>Found = part()</v>
- </type>
<desc>
- <p>The same as <c>match(Subject, Pattern, [])</c>.</p>
+ <p>The same as <c>match(<anno>Subject</anno>, <anno>Pattern</anno>, [])</c>.</p>
</desc>
</func>
<func>
- <name>match(Subject,Pattern,Options) -> Found | <c>nomatch</c></name>
+ <name name="match" arity="3"/>
+ <type name="part"/>
<fsummary>Searches for the first match of a pattern in a binary</fsummary>
- <type>
- <v>Subject = binary()</v>
- <v>Pattern = binary() | [ binary() ] | cp()</v>
- <v>Found = part()</v>
- <v>Options = [ Option ]</v>
- <v>Option = {scope, part()}</v>
- </type>
<desc>
- <p>Searches for the first occurrence of <c>Pattern</c> in <c>Subject</c> and
+ <p>Searches for the first occurrence of <c><anno>Pattern</anno></c> in <c><anno>Subject</anno></c> and
returns the position and length.</p>
- <p>The function will return <c>{Pos,Length}</c> for the binary
- in <c>Pattern</c> starting at the lowest position in
- <c>Subject</c>, Example:</p>
+ <p>The function will return <c>{Pos, Length}</c> for the binary
+ in <c><anno>Pattern</anno></c> starting at the lowest position in
+ <c><anno>Subject</anno></c>, Example:</p>
<code>
1> binary:match(&lt;&lt;"abcde"&gt;&gt;, [&lt;&lt;"bcde"&gt;&gt;,&lt;&lt;"cd"&gt;&gt;],[]).
@@ -391,16 +323,16 @@
<p>Summary of the options:</p>
<taglist>
- <tag>{scope, {Start, Length}}</tag>
+ <tag>{scope, {<anno>Start</anno>, <anno>Length</anno>}}</tag>
<item><p>Only the given part is searched. Return values still have
- offsets from the beginning of <c>Subject</c>. A negative <c>Length</c> is
- allowed as described in the <c>TYPES</c> section of this manual.</p></item>
+ offsets from the beginning of <c><anno>Subject</anno></c>. A negative <c>Length</c> is
+ allowed as described in the <c>DATA TYPES</c> section of this manual.</p></item>
</taglist>
<p>If none of the strings in
- <c>Pattern</c> is found, the atom <c>nomatch</c> is returned.</p>
+ <c><anno>Pattern</anno></c> is found, the atom <c>nomatch</c> is returned.</p>
- <p>For a description of <c>Pattern</c>, see
+ <p>For a description of <c><anno>Pattern</anno></c>, see
<seealso marker="#compile_pattern-1">compile_pattern/1</seealso>.</p>
<p>If <c>{scope, {Start,Length}}</c> is given in the options
@@ -412,32 +344,21 @@
</desc>
</func>
<func>
- <name>matches(Subject, Pattern) -> Found</name>
+ <name name="matches" arity="2"/>
<fsummary>Searches for all matches of a pattern in a binary</fsummary>
- <type>
- <v>Subject = binary()</v>
- <v>Pattern = binary() | [ binary() ] | cp()</v>
- <v>Found = [ part() ] | []</v>
- </type>
<desc>
- <p>The same as <c>matches(Subject, Pattern, [])</c>.</p>
+ <p>The same as <c>matches(<anno>Subject</anno>, <anno>Pattern</anno>, [])</c>.</p>
</desc>
</func>
<func>
- <name>matches(Subject,Pattern,Options) -> Found</name>
+ <name name="matches" arity="3"/>
+ <type name="part"/>
<fsummary>Searches for all matches of a pattern in a binary</fsummary>
- <type>
- <v>Subject = binary()</v>
- <v>Pattern = binary() | [ binary() ] | cp()</v>
- <v>Found = [ part() ] | []</v>
- <v>Options = [ Option ]</v>
- <v>Option = {scope, part()}</v>
- </type>
<desc>
- <p>Works like match, but the <c>Subject</c> is searched until
+ <p>Works like <c>match/2</c>, but the <c><anno>Subject</anno></c> is searched until
exhausted and a list of all non-overlapping parts matching
- <c>Pattern</c> is returned (in order). </p>
+ <c><anno>Pattern</anno></c> is returned (in order). </p>
<p>The first and longest match is preferred to a shorter,
which is illustrated by the following example:</p>
@@ -458,26 +379,22 @@
<p>If none of the strings in pattern is found, an empty list is returned.</p>
- <p>For a description of <c>Pattern</c>, see <seealso marker="#compile_pattern-1">compile_pattern/1</seealso> and for a
+ <p>For a description of <c><anno>Pattern</anno></c>, see <seealso marker="#compile_pattern-1">compile_pattern/1</seealso> and for a
description of available options, see <seealso marker="#match-3">match/3</seealso>.</p>
- <p>If <c>{scope, {Start,Length}}</c> is given in the options such that
- <c>Start</c> is larger than the size of <c>Subject</c>, <c>Start + Length</c> is
- less than zero or <c>Start + Length</c> is larger than the size of
- <c>Subject</c>, a <c>badarg</c> exception is raised.</p>
+ <p>If <c>{scope, {<anno>Start</anno>,<anno>Length</anno>}}</c> is given in the options such that
+ <c><anno>Start</anno></c> is larger than the size of <c><anno>Subject</anno></c>, <c><anno>Start</anno> + <anno>Length</anno></c> is
+ less than zero or <c><anno>Start</anno> + <anno>Length</anno></c> is larger than the size of
+ <c><anno>Subject</anno></c>, a <c>badarg</c> exception is raised.</p>
</desc>
</func>
<func>
- <name>part(Subject, PosLen) -> binary()</name>
+ <name name="part" arity="2"/>
<fsummary>Extracts a part of a binary</fsummary>
- <type>
- <v>Subject = binary()</v>
- <v>PosLen = part()</v>
- </type>
<desc>
- <p>Extracts the part of the binary <c>Subject</c> described by <c>PosLen</c>.</p>
+ <p>Extracts the part of the binary <c><anno>Subject</anno></c> described by <c><anno>PosLen</anno></c>.</p>
<p>Negative length can be used to extract bytes at the end of a binary:</p>
@@ -494,25 +411,20 @@
<c>binary_part/3</c>. Those BIFs are allowed in guard tests.</p>
</note>
- <p>If <c>PosLen</c> in any way references outside the binary, a <c>badarg</c> exception
+ <p>If <c><anno>PosLen</anno></c> in any way references outside the binary, a <c>badarg</c> exception
is raised.</p>
</desc>
</func>
<func>
- <name>part(Subject, Pos, Len) -> binary()</name>
+ <name name="part" arity="3"/>
<fsummary>Extracts a part of a binary</fsummary>
- <type>
- <v>Subject = binary()</v>
- <v>Pos = integer() >= 0</v>
- <v>Len = integer() >= 0</v>
- </type>
<desc>
- <p>The same as <c>part(Subject, {Pos, Len})</c>.</p>
+ <p>The same as <c>part(<anno>Subject</anno>, {<anno>Pos</anno>, <anno>Len</anno>})</c>.</p>
</desc>
</func>
<func>
- <name>referenced_byte_size(binary()) -> integer() >= 0</name>
+ <name name="referenced_byte_size" arity="1"/>
<fsummary>Determines the size of the actual binary pointed out by a sub-binary</fsummary>
<desc>
diff --git a/lib/stdlib/doc/src/digraph_utils.xml b/lib/stdlib/doc/src/digraph_utils.xml
index e44632bfd2..ef6e1cb46f 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>2011</year>
+ <year>2000</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -156,7 +156,7 @@
<p>Creates a digraph where the vertices are
the <seealso marker="#strong_components">strongly connected
components</seealso> of <c><anno>Digraph</anno></c> as returned by
- <c>strong_components/1</c>. If X and Y are strongly
+ <c>strong_components/1</c>. If X and Y are two different strongly
connected components, and there exist vertices x and y in X
and Y respectively such that there is an
edge <seealso marker="#emanate">emanating</seealso> from x
diff --git a/lib/stdlib/doc/src/epp.xml b/lib/stdlib/doc/src/epp.xml
index 488499581f..386ed89fe1 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>2011</year>
+ <year>1996</year><year>2012</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 efd9514db6..abaf64fb91 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>2011</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -128,11 +128,17 @@
<datatypes>
<datatype>
+ <name name="access"/>
+ </datatype>
+ <datatype>
<name><marker id="type-continuation">continuation()</marker></name>
<desc>
<p>Opaque continuation used by <seealso marker="#select/1">
- <c>select/1</c></seealso> and <seealso marker="#select/3">
- <c>select/3</c></seealso>.</p>
+ <c>select/1,3</c></seealso>, <seealso marker="#select_reverse/1">
+ <c>select_reverse/1,3</c></seealso>, <seealso
+ marker="#match/1">
+ <c>match/1,3</c></seealso>, and <seealso marker="#match_object/1">
+ <c>match_object/1,3</c></seealso>.</p>
</desc>
</datatype>
<datatype>
@@ -140,6 +146,10 @@
<desc><p>A match specification, see above.</p></desc>
</datatype>
<datatype>
+ <name name="comp_match_spec"/>
+ <desc><p>A compiled match specification.</p></desc>
+ </datatype>
+ <datatype>
<name name="match_pattern"/>
</datatype>
<datatype>
@@ -149,14 +159,14 @@
<name name="tid"/>
<desc><p>A table identifier, as returned by new/2.</p></desc>
</datatype>
+ <datatype>
+ <name name="type"/>
+ </datatype>
</datatypes>
<funcs>
<func>
- <name>all() -> [Tab]</name>
+ <name name="all" arity="0"/>
<fsummary>Return a list of all ETS tables.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- </type>
<desc>
<p>Returns a list of all tables at the node. Named tables are
given by their names, unnamed tables are given by their
@@ -164,48 +174,34 @@
</desc>
</func>
<func>
- <name>delete(Tab) -> true</name>
+ <name name="delete" arity="1"/>
<fsummary>Delete an entire ETS table.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- </type>
<desc>
- <p>Deletes the entire table <c>Tab</c>.</p>
+ <p>Deletes the entire table <c><anno>Tab</anno></c>.</p>
</desc>
</func>
<func>
- <name>delete(Tab, Key) -> true</name>
+ <name name="delete" arity="2"/>
<fsummary>Delete all objects with a given key from an ETS table.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Key = term()</v>
- </type>
<desc>
- <p>Deletes all objects with the key <c>Key</c> from the table
- <c>Tab</c>.</p>
+ <p>Deletes all objects with the key <c><anno>Key</anno></c> from the table
+ <c><anno>Tab</anno></c>.</p>
</desc>
</func>
<func>
- <name>delete_all_objects(Tab) -> true</name>
+ <name name="delete_all_objects" arity="1"/>
<fsummary>Delete all objects in an ETS table.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- </type>
<desc>
- <p>Delete all objects in the ETS table <c>Tab</c>.
+ <p>Delete all objects in the ETS table <c><anno>Tab</anno></c>.
The operation is guaranteed to be
<seealso marker="#concurrency">atomic and isolated</seealso>.</p>
</desc>
</func>
<func>
- <name>delete_object(Tab,Object) -> true</name>
+ <name name="delete_object" arity="2"/>
<fsummary>Deletes a specific from an ETS table.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Object = tuple()</v>
- </type>
<desc>
- <p>Delete the exact object <c>Object</c> from the ETS table,
+ <p>Delete the exact object <c><anno>Object</anno></c> from the ETS table,
leaving objects with the same key but other differences
(useful for type <c>bag</c>). In a <c>duplicate_bag</c>, all
instances of the object will be deleted.</p>
@@ -257,14 +253,10 @@
</desc>
</func>
<func>
- <name>first(Tab) -> Key | '$end_of_table'</name>
+ <name name="first" arity="1"/>
<fsummary>Return the first key in an ETS table.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Key = term()</v>
- </type>
<desc>
- <p>Returns the first key <c>Key</c> in the table <c>Tab</c>.
+ <p>Returns the first key <c><anno>Key</anno></c> in the table <c><anno>Tab</anno></c>.
If the table is of the <c>ordered_set</c> type, the first key
in Erlang term order will be returned. If the table is of any
other type, the first key according to the table's internal
@@ -336,7 +328,7 @@
the source file.</p>
<p>The fun is very restricted, it can take only a single
parameter (the object to match): a sole variable or a
- tuple. It needs to use the <c>is_</c>XXX guard tests.
+ tuple. It needs to use the <c>is_</c> guard tests.
Language constructs that have no representation
in a match_spec (like <c>if</c>, <c>case</c>, <c>receive</c>
etc) are not allowed.</p>
@@ -386,19 +378,14 @@ Error: fun containing local Erlang function calls
</desc>
</func>
<func>
- <name>give_away(Tab, Pid, GiftData) -> true</name>
+ <name name="give_away" arity="3"/>
<fsummary>Change owner of a table.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Pid = pid()</v>
- <v>GiftData = term()</v>
- </type>
<desc>
- <p>Make process <c>Pid</c> the new owner of table <c>Tab</c>.
+ <p>Make process <c><anno>Pid</anno></c> the new owner of table <c><anno>Tab</anno></c>.
If successful, the message
- <c>{'ETS-TRANSFER',Tab,FromPid,GiftData}</c> will be sent
+ <c>{'ETS-TRANSFER',<anno>Tab</anno>,FromPid,<anno>GiftData</anno>}</c> will be sent
to the new owner.</p>
- <p>The process <c>Pid</c> must be alive, local and not already the
+ <p>The process <c><anno>Pid</anno></c> must be alive, local and not already the
owner of the table. The calling process must be the table owner.</p>
<p>Note that <c>give_away</c> does not at all affect the
<seealso marker="#heir">heir</seealso> option of the table. A table
@@ -421,81 +408,72 @@ Error: fun containing local Erlang function calls
</desc>
</func>
<func>
- <name>info(Tab) -> [{Item, Value}] | undefined</name>
+ <name name="info" arity="1"/>
<fsummary>Return information about an ETS table.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Item = atom(), see below</v>
- <v>Value = term(), see below</v>
- </type>
<desc>
- <p>Returns information about the table <c>Tab</c> as a list of
- <c>{Item, Value}</c> tuples. If <c>Tab</c> has the correct type
+ <p>Returns information about the table <c><anno>Tab</anno></c> as a list of
+ tuples. If <c><anno>Tab</anno></c> has the correct type
for a table identifier, but does not refer to an existing ETS
- table, <c>undefined</c> is returned. If <c>Tab</c> is not of the
+ table, <c>undefined</c> is returned. If <c><anno>Tab</anno></c> is not of the
correct type, this function fails with reason <c>badarg</c>.</p>
<list type="bulleted">
- <item><c>Item=memory, Value=integer()</c> <br></br>
+ <item><c>{compressed, boolean()}</c> <br></br>
- The number of words allocated to the table.</item>
- <item><c>Item=owner, Value=pid()</c> <br></br>
-
- The pid of the owner of the table.</item>
- <item><c>Item=heir, Value=pid()|none</c> <br></br>
+ Indicates if the table is compressed or not.</item>
+ <item><c>{heir, pid() | none}</c> <br></br>
The pid of the heir of the table, or <c>none</c> if no heir is set.</item>
- <item><c>Item=name, Value=atom()</c> <br></br>
+ <item><c>{keypos, integer() >= 1}</c> <br></br>
- The name of the table.</item>
- <item><c>Item=size, Value=integer()</c> <br></br>
+ The key position.</item>
+ <item><c>{memory, integer() >= 0</c> <br></br>
- The number of objects inserted in the table.</item>
- <item><c>Item=node, Value=atom()</c> <br></br>
+ The number of words allocated to the table.</item>
+ <item><c>{name, atom()}</c> <br></br>
- The node where the table is stored. This field is no longer
- meaningful as tables cannot be accessed from other nodes.</item>
- <item><c>Item=named_table, Value=true|false</c> <br></br>
+ The name of the table.</item>
+ <item><c>{named_table, boolean()}</c> <br></br>
Indicates if the table is named or not.</item>
- <item><c>Item=type, Value=set|ordered_set|bag|duplicate_bag</c> <br></br>
+ <item><c>{node, node()}</c> <br></br>
- The table type.</item>
- <item><c>Item=keypos, Value=integer()</c> <br></br>
+ The node where the table is stored. This field is no longer
+ meaningful as tables cannot be accessed from other nodes.</item>
+ <item><c>{owner, pid()}</c> <br></br>
- The key position.</item>
- <item><c>Item=protection, Value=public|protected|private</c> <br></br>
+ The pid of the owner of the table.</item>
+ <item><c>{protection, <seealso marker="#type-access">access()</seealso>}</c> <br></br>
The table access rights.</item>
- <item><c>Item=compressed, Value=true|false</c> <br></br>
+ <item><c>{size, integer() >= 0</c> <br></br>
- Indicates if the table is compressed or not.</item>
+ The number of objects inserted in the table.</item>
+ <item><c>{type, <seealso marker="#type-type">type()</seealso>}</c> <br></br>
+
+ The table type.</item>
</list>
</desc>
</func>
<func>
- <name>info(Tab, Item) -> Value | undefined</name>
+ <name name="info" arity="2"/>
<fsummary>Return the information associated with given item for an ETS table.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Item, Value - see below</v>
- </type>
<desc>
<p>Returns the information associated with <c>Item</c> for
- the table <c>Tab</c>, or returns <c>undefined</c> if <c>Tab</c>
+ the table <c><anno>Tab</anno></c>, or returns <c>undefined</c> if <c>Tab</c>
does not refer an existing ETS table.
- If <c>Tab</c> is not of the correct type, or if <c>Item</c> is not
+ If <c><anno>Tab</anno></c> is not of the correct type, or if <c><anno>Item</anno></c> is not
one of the allowed values, this function fails with reason <c>badarg</c>.</p>
<warning><p>In R11B and earlier, this function would not fail but return
<c>undefined</c> for invalid values for <c>Item</c>.</p>
</warning>
- <p>In addition to the <c>{Item,Value}</c>
+ <p>In addition to the <c>{<anno>Item</anno>,<anno>Value</anno>}</c>
pairs defined for <c>info/1</c>, the following items are
allowed:</p>
<list type="bulleted">
- <item><c>Item=fixed, Value=true|false</c> <br></br>
+ <item><c>Item=fixed, Value=boolean()</c> <br></br>
Indicates if the table is fixed by any process or not.</item>
<item>
@@ -547,15 +525,11 @@ Error: fun containing local Erlang function calls
</desc>
</func>
<func>
- <name>insert(Tab, ObjectOrObjects) -> true</name>
+ <name name="insert" arity="2"/>
<fsummary>Insert an object into an ETS table.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>ObjectOrObjects = tuple() | [tuple()]</v>
- </type>
<desc>
<p>Inserts the object or all of the objects in the list
- <c>ObjectOrObjects</c> into the table <c>Tab</c>.
+ <c><anno>ObjectOrObjects</anno></c> into the table <c><anno>Tab</anno></c>.
If the table is a <c>set</c> and the key of the inserted
objects <em>matches</em> the key of any object in the table,
the old object will be replaced. If the table is an
@@ -572,19 +546,15 @@ Error: fun containing local Erlang function calls
</desc>
</func>
<func>
- <name>insert_new(Tab, ObjectOrObjects) -> boolean()</name>
+ <name name="insert_new" arity="2"/>
<fsummary>Insert an object into an ETS table if the key is not already present.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>ObjectOrObjects = tuple() | [tuple()]</v>
- </type>
<desc>
<p>This function works exactly like <c>insert/2</c>, with the
exception that instead of overwriting objects with the same
key (in the case of <c>set</c> or <c>ordered_set</c>) or
adding more objects with keys already existing in the table
(in the case of <c>bag</c> and <c>duplicate_bag</c>), it
- simply returns <c>false</c>. If <c>ObjectOrObjects</c> is a
+ simply returns <c>false</c>. If <c><anno>ObjectOrObjects</anno></c> is a
list, the function checks <em>every</em> key prior to
inserting anything. Nothing will be inserted if not
<em>all</em> keys present in the list are absent from the
@@ -593,11 +563,8 @@ Error: fun containing local Erlang function calls
</desc>
</func>
<func>
- <name>is_compiled_ms(Term) -> boolean()</name>
+ <name name="is_compiled_ms" arity="1"/>
<fsummary>Checks if an Erlang term is the result of ets:match_spec_compile</fsummary>
- <type>
- <v>Term = term()</v>
- </type>
<desc>
<p>This function is used to check if a term is a valid
compiled <seealso marker="#match_spec">match_spec</seealso>.
@@ -626,14 +593,10 @@ ets:is_compiled_ms(Broken).</code>
</desc>
</func>
<func>
- <name>last(Tab) -> Key | '$end_of_table'</name>
+ <name name="last" arity="1"/>
<fsummary>Return the last key in an ETS table of type<c>ordered_set</c>.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Key = term()</v>
- </type>
<desc>
- <p>Returns the last key <c>Key</c> according to Erlang term
+ <p>Returns the last key <c><anno>Key</anno></c> according to Erlang term
order in the table <c>Tab</c> of the <c>ordered_set</c> type.
If the table is of any other type, the function is synonymous
to <c>first/2</c>. If the table is empty,
@@ -642,16 +605,11 @@ ets:is_compiled_ms(Broken).</code>
</desc>
</func>
<func>
- <name>lookup(Tab, Key) -> [Object]</name>
+ <name name="lookup" arity="2"/>
<fsummary>Return all objects with a given key in an ETS table.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Key = term()</v>
- <v>Object = tuple()</v>
- </type>
<desc>
- <p>Returns a list of all objects with the key <c>Key</c> in
- the table <c>Tab</c>.</p>
+ <p>Returns a list of all objects with the key <c><anno>Key</anno></c> in
+ the table <c><anno>Tab</anno></c>.</p>
<p>In the case of <c>set, bag and duplicate_bag</c>, an object
is returned only if the given key <em>matches</em> the key
of the object in the table. If the table is an
@@ -671,7 +629,7 @@ ets:is_compiled_ms(Broken).</code>
<c>duplicate_bag</c>, the function returns a list of
arbitrary length.</p>
<p>Note that the time order of object insertions is preserved;
- The first object inserted with the given key will be first
+ the first object inserted with the given key will be first
in the resulting list, and so on.</p>
<p>Insert and look-up times in tables of type <c>set</c>,
<c>bag</c> and <c>duplicate_bag</c> are constant, regardless
@@ -681,22 +639,16 @@ ets:is_compiled_ms(Broken).</code>
</desc>
</func>
<func>
- <name>lookup_element(Tab, Key, Pos) -> Elem</name>
+ <name name="lookup_element" arity="3"/>
<fsummary>Return the <c>Pos</c>:th element of all objects with a given key in an ETS table.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Key = term()</v>
- <v>Pos = integer()</v>
- <v>Elem = term() | [term()]</v>
- </type>
<desc>
- <p>If the table <c>Tab</c> is of type <c>set</c> or
- <c>ordered_set</c>, the function returns the <c>Pos</c>:th
- element of the object with the key <c>Key</c>.</p>
+ <p>If the table <c><anno>Tab</anno></c> is of type <c>set</c> or
+ <c>ordered_set</c>, the function returns the <c><anno>Pos</anno></c>:th
+ element of the object with the key <c><anno>Key</anno></c>.</p>
<p>If the table is of type <c>bag</c> or <c>duplicate_bag</c>,
- the functions returns a list with the <c>Pos</c>:th element of
- every object with the key <c>Key</c>.</p>
- <p>If no object with the key <c>Key</c> exists, the function
+ the functions returns a list with the <c><anno>Pos</anno></c>:th element of
+ every object with the key <c><anno>Key</anno></c>.</p>
+ <p>If no object with the key <c><anno>Key</anno></c> exists, the function
will exit with reason <c>badarg</c>.</p>
<p>The difference between <c>set</c>, <c>bag</c> and
<c>duplicate_bag</c> on one hand, and <c>ordered_set</c> on
@@ -708,16 +660,11 @@ ets:is_compiled_ms(Broken).</code>
</desc>
</func>
<func>
- <name>match(Tab, Pattern) -> [Match]</name>
+ <name name="match" arity="2"/>
<fsummary>Match the objects in an ETS table against a pattern.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Pattern = tuple()</v>
- <v>Match = [term()]</v>
- </type>
<desc>
- <p>Matches the objects in the table <c>Tab</c> against the
- pattern <c>Pattern</c>.</p>
+ <p>Matches the objects in the table <c><anno>Tab</anno></c> against the
+ pattern <c><anno>Pattern</anno></c>.</p>
<p>A pattern is a term that may contain:</p>
<list type="bulleted">
<item>bound parts (Erlang terms),</item>
@@ -744,18 +691,12 @@ ets:is_compiled_ms(Broken).</code>
</desc>
</func>
<func>
- <name>match(Tab, Pattern, Limit) -> {[Match],Continuation} | '$end_of_table'</name>
+ <name name="match" arity="3"/>
<fsummary>Match the objects in an ETS table against a pattern and returns part of the answers.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Pattern = tuple()</v>
- <v>Match = [term()]</v>
- <v>Continuation = term()</v>
- </type>
<desc>
<p>Works like <c>ets:match/2</c> but only returns a limited
- (<c>Limit</c>) number of matching objects. The
- <c>Continuation</c> term can then be used in subsequent calls
+ (<c><anno>Limit</anno></c>) number of matching objects. The
+ <c><anno>Continuation</anno></c> term can then be used in subsequent calls
to <c>ets:match/1</c> to get the next chunk of matching
objects. This is a space efficient way to work on objects in a
table which is still faster than traversing the table object
@@ -764,16 +705,12 @@ ets:is_compiled_ms(Broken).</code>
</desc>
</func>
<func>
- <name>match(Continuation) -> {[Match],Continuation} | '$end_of_table'</name>
+ <name name="match" arity="1"/>
<fsummary>Continues matching objects in an ETS table.</fsummary>
- <type>
- <v>Match = [term()]</v>
- <v>Continuation = term()</v>
- </type>
<desc>
<p>Continues a match started with <c>ets:match/3</c>. The next
chunk of the size given in the initial <c>ets:match/3</c>
- call is returned together with a new <c>Continuation</c>
+ call is returned together with a new <c><anno>Continuation</anno></c>
that can be used in subsequent calls to this function.</p>
<p><c>'$end_of_table'</c> is returned when there are no more
objects in the table.</p>
@@ -789,15 +726,11 @@ ets:is_compiled_ms(Broken).</code>
</desc>
</func>
<func>
- <name>match_object(Tab, Pattern) -> [Object]</name>
+ <name name="match_object" arity="2"/>
<fsummary>Match the objects in an ETS table against a pattern.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Pattern = Object = tuple()</v>
- </type>
<desc>
- <p>Matches the objects in the table <c>Tab</c> against the
- pattern <c>Pattern</c>. See <c>match/2</c> for a description
+ <p>Matches the objects in the table <c><anno>Tab</anno></c> against the
+ pattern <c><anno>Pattern</anno></c>. See <c>match/2</c> for a description
of patterns. The function returns a list of all objects which
match the pattern.</p>
<p>If the key is specified in the pattern, the match is very
@@ -809,18 +742,12 @@ ets:is_compiled_ms(Broken).</code>
</desc>
</func>
<func>
- <name>match_object(Tab, Pattern, Limit) -> {[Match],Continuation} | '$end_of_table'</name>
+ <name name="match_object" arity="3"/>
<fsummary>Match the objects in an ETS table against a pattern and returns part of the answers.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Pattern = tuple()</v>
- <v>Match = [term()]</v>
- <v>Continuation = term()</v>
- </type>
<desc>
<p>Works like <c>ets:match_object/2</c> but only returns a
- limited (<c>Limit</c>) number of matching objects. The
- <c>Continuation</c> term can then be used in subsequent calls
+ limited (<c><anno>Limit</anno></c>) number of matching objects. The
+ <c><anno>Continuation</anno></c> term can then be used in subsequent calls
to <c>ets:match_object/1</c> to get the next chunk of matching
objects. This is a space efficient way to work on objects in a
table which is still faster than traversing the table object
@@ -829,29 +756,21 @@ ets:is_compiled_ms(Broken).</code>
</desc>
</func>
<func>
- <name>match_object(Continuation) -> {[Match],Continuation} | '$end_of_table'</name>
+ <name name="match_object" arity="1"/>
<fsummary>Continues matching objects in an ETS table.</fsummary>
- <type>
- <v>Match = [term()]</v>
- <v>Continuation = term()</v>
- </type>
<desc>
<p>Continues a match started with <c>ets:match_object/3</c>.
The next chunk of the size given in the initial
<c>ets:match_object/3</c> call is returned together with a
- new <c>Continuation</c> that can be used in subsequent calls
+ new <c><anno>Continuation</anno></c> that can be used in subsequent calls
to this function.</p>
<p><c>'$end_of_table'</c> is returned when there are no more
objects in the table.</p>
</desc>
</func>
<func>
- <name>match_spec_compile(MatchSpec) -> CompiledMatchSpec</name>
+ <name name="match_spec_compile" arity="1"/>
<fsummary>Compiles a match specification into its internal representation</fsummary>
- <type>
- <v>MatchSpec = match_spec()</v>
- <v>CompiledMatchSpec = comp_match_spec()</v>
- </type>
<desc>
<p>This function transforms a
<seealso marker="#match_spec">match_spec</seealso> into an
@@ -863,7 +782,7 @@ ets:is_compiled_ms(Broken).</code>
valid compiled match_spec, nor can it be stored on disk).
The validity of a compiled match_spec can be checked using
<c>ets:is_compiled_ms/1</c>.</p>
- <p>If the term <c>MatchSpec</c> can not be compiled (does not
+ <p>If the term <c><anno>MatchSpec</anno></c> can not be compiled (does not
represent a valid match_spec), a <c>badarg</c> fault is
thrown.</p>
<note>
@@ -873,25 +792,21 @@ ets:is_compiled_ms(Broken).</code>
</desc>
</func>
<func>
- <name>match_spec_run(List,CompiledMatchSpec) -> list()</name>
+ <name name="match_spec_run" arity="2"/>
<fsummary>Performs matching, using a compiled match_spec, on a list of tuples</fsummary>
- <type>
- <v>List = [ tuple() ]</v>
- <v>CompiledMatchSpec = comp_match_spec()</v>
- </type>
<desc>
<p>This function executes the matching specified in a
compiled <seealso marker="#match_spec">match_spec</seealso> on
- a list of tuples. The <c>CompiledMatchSpec</c> term should be
+ a list of tuples. The <c><anno>CompiledMatchSpec</anno></c> term should be
the result of a call to <c>ets:match_spec_compile/1</c> and
is hence the internal representation of the match_spec one
wants to use.</p>
- <p>The matching will be executed on each element in <c>List</c>
+ <p>The matching will be executed on each element in <c><anno>List</anno></c>
and the function returns a list containing all results. If an
- element in <c>List</c> does not match, nothing is returned
+ element in <c><anno>List</anno></c> does not match, nothing is returned
for that element. The length of the result list is therefore
equal or less than the the length of the parameter
- <c>List</c>. The two calls in the following example will give
+ <c><anno>List</anno></c>. The two calls in the following example will give
the same result (but certainly not the same execution
time...):</p>
<code type="none">
@@ -910,37 +825,23 @@ ets:select(Table,MatchSpec),</code>
</desc>
</func>
<func>
- <name>member(Tab, Key) -> true | false</name>
+ <name name="member" arity="2"/>
<fsummary>Tests for occurrence of a key in an ETS table</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Key = term()</v>
- </type>
<desc>
<p>Works like <c>lookup/2</c>, but does not return the objects.
The function returns <c>true</c> if one or more elements in
- the table has the key <c>Key</c>, <c>false</c> otherwise.</p>
+ the table has the key <c><anno>Key</anno></c>, <c>false</c> otherwise.</p>
</desc>
</func>
<func>
- <name>new(Name, Options) -> tid() | atom()</name>
+ <name name="new" arity="2"/>
<fsummary>Create a new ETS table.</fsummary>
- <type>
- <v>Name = atom()</v>
- <v>Options = [Option]</v>
- <v>&nbsp;Option = Type | Access | named_table | {keypos,Pos} | {heir,pid(),HeirData} | {heir,none} | Tweaks</v>
- <v>&nbsp;&nbsp;Type = set | ordered_set | bag | duplicate_bag</v>
- <v>&nbsp;&nbsp;Access = public | protected | private</v>
- <v>&nbsp;&nbsp;Tweaks = {write_concurrency,boolean()} | {read_concurrency,boolean()} | compressed</v>
- <v>&nbsp;&nbsp;Pos = integer()</v>
- <v>&nbsp;&nbsp;HeirData = term()</v>
- </type>
<desc>
<p>Creates a new table and returns a table identifier which can
be used in subsequent operations. The table identifier can be
sent to other processes so that a table can be shared between
different processes within a node.</p>
- <p>The parameter <c>Options</c> is a list of atoms which
+ <p>The parameter <c><anno>Options</anno></c> is a list of atoms which
specifies table type, access rights, key position and if the
table is named or not. If one or more options are left out,
the default values are used. This means that not specifying
@@ -997,27 +898,27 @@ ets:select(Table,MatchSpec),</code>
</item>
<item>
<p><c>named_table</c>
- If this option is present, the name <c>Name</c> is
+ If this option is present, the name <c><anno>Name</anno></c> is
associated with the table identifier. The name can then
be used instead of the table identifier in subsequent
operations.</p>
</item>
<item>
- <p><c>{keypos,Pos}</c>
+ <p><c>{keypos,<anno>Pos</anno>}</c>
Specfies which element in the stored tuples should be
used as key. By default, it is the first element, i.e.
- <c>Pos=1</c>. However, this is not always appropriate. In
+ <c><anno>Pos</anno>=1</c>. However, this is not always appropriate. In
particular, we do not want the first element to be the
key if we want to store Erlang records in a table.</p>
<p>Note that any tuple stored in the table must have at
- least <c>Pos</c> number of elements.</p>
+ least <c><anno>Pos</anno></c> number of elements.</p>
</item>
<item>
<marker id="heir"></marker>
- <p><c>{heir,Pid,HeirData} | {heir,none}</c><br></br>
+ <p><c>{heir,<anno>Pid</anno>,<anno>HeirData</anno>} | {heir,none}</c><br></br>
Set a process as heir. The heir will inherit the table if
the owner terminates. The message
- <c>{'ETS-TRANSFER',tid(),FromPid,HeirData}</c> will be sent to
+ <c>{'ETS-TRANSFER',tid(),FromPid,<anno>HeirData</anno>}</c> will be sent to
the heir when that happens. The heir must be a local process.
Default heir is <c>none</c>, which will destroy the table when
the owner terminates.</p>
@@ -1082,15 +983,11 @@ ets:select(Table,MatchSpec),</code>
</desc>
</func>
<func>
- <name>next(Tab, Key1) -> Key2 | '$end_of_table'</name>
+ <name name="next" arity="2"/>
<fsummary>Return the next key in an ETS table.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Key1 = Key2 = term()</v>
- </type>
<desc>
- <p>Returns the next key <c>Key2</c>, following the key
- <c>Key1</c> in the table <c>Tab</c>. If the table is of the
+ <p>Returns the next key <c><anno>Key2</anno></c>, following the key
+ <c><anno>Key1</anno></c> in the table <c><anno>Tab</anno></c>. If the table is of the
<c>ordered_set</c> type, the next key in Erlang term order is
returned. If the table is of any other type, the next key
according to the table's internal order is returned. If there
@@ -1105,16 +1002,12 @@ ets:select(Table,MatchSpec),</code>
</desc>
</func>
<func>
- <name>prev(Tab, Key1) -> Key2 | '$end_of_table'</name>
+ <name name="prev" arity="2"/>
<fsummary>Return the previous key in an ETS table of type<c>ordered_set</c>.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Key1 = Key2 = term()</v>
- </type>
<desc>
- <p>Returns the previous key <c>Key2</c>, preceding the key
- <c>Key1</c> according the Erlang term order in the table
- <c>Tab</c> of the <c>ordered_set</c> type. If the table is of
+ <p>Returns the previous key <c><anno>Key2</anno></c>, preceding the key
+ <c><anno>Key1</anno></c> according the Erlang term order in the table
+ <c><anno>Tab</anno></c> of the <c>ordered_set</c> type. If the table is of
any other type, the function is synonymous to <c>next/2</c>.
If there is no previous key, <c>'$end_of_table'</c> is
returned.</p>
@@ -1122,14 +1015,11 @@ ets:select(Table,MatchSpec),</code>
</desc>
</func>
<func>
- <name>rename(Tab, Name) -> Name</name>
+ <name name="rename" arity="2"/>
<fsummary>Rename a named ETS table.</fsummary>
- <type>
- <v>Tab = Name = atom()</v>
- </type>
<desc>
- <p>Renames the named table <c>Tab</c> to the new name
- <c>Name</c>. Afterwards, the old name can not be used to
+ <p>Renames the named table <c><anno>Tab</anno></c> to the new name
+ <c><anno>Name</anno></c>. Afterwards, the old name can not be used to
access the table. Renaming an unnamed table has no effect.</p>
</desc>
</func>
@@ -1186,18 +1076,15 @@ ets:select(ets:repair_continuation(Broken,MS)).</code>
</desc>
</func>
<func>
- <name>safe_fixtable(Tab, true|false) -> true</name>
+ <name name="safe_fixtable" arity="2"/>
<fsummary>Fix an ETS table for safe traversal.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- </type>
<desc>
<p>Fixes a table of the <c>set</c>, <c>bag</c> or
<c>duplicate_bag</c> table type for safe traversal.</p>
<p>A process fixes a table by calling
- <c>safe_fixtable(Tab,true)</c>. The table remains fixed until
+ <c>safe_fixtable(<anno>Tab</anno>, true)</c>. The table remains fixed until
the process releases it by calling
- <c>safe_fixtable(Tab,false)</c>, or until the process
+ <c>safe_fixtable(<anno>Tab</anno>, false)</c>, or until the process
terminates.</p>
<p>If several processes fix a table, the table will remain fixed
until all processes have released it (or terminated).
@@ -1242,15 +1129,10 @@ clean_all_with_value(Tab,X,Key) ->
</desc>
</func>
<func>
- <name>select(Tab, MatchSpec) -> [Match]</name>
+ <name name="select" arity="2"/>
<fsummary>Match the objects in an ETS table against a match_spec.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Match = term()</v>
- <v>MatchSpec = match_spec()</v>
- </type>
<desc>
- <p>Matches the objects in the table <c>Tab</c> using a
+ <p>Matches the objects in the table <c><anno>Tab</anno></c> using a
<seealso marker="#match_spec">match_spec</seealso>. This is a
more general call than the <c>ets:match/2</c> and
<c>ets:match_object/2</c> calls. In its simplest forms the
@@ -1337,18 +1219,12 @@ is_integer(X), is_integer(Y), X + Y < 4711]]></code>
</desc>
</func>
<func>
- <name>select(Tab, MatchSpec, Limit) -> {[Match],Continuation} | '$end_of_table'</name>
+ <name name="select" arity="3"/>
<fsummary>Match the objects in an ETS table against a match_spec and returns part of the answers.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Match = term()</v>
- <v>MatchSpec = match_spec()</v>
- <v>Continuation = term()</v>
- </type>
<desc>
<p>Works like <c>ets:select/2</c> but only returns a limited
- (<c>Limit</c>) number of matching objects. The
- <c>Continuation</c> term can then be used in subsequent calls
+ (<c><anno>Limit</anno></c>) number of matching objects. The
+ <c><anno>Continuation</anno></c> term can then be used in subsequent calls
to <c>ets:select/1</c> to get the next chunk of matching
objects. This is a space efficient way to work on objects in a
table which is still faster than traversing the table object
@@ -1357,33 +1233,23 @@ is_integer(X), is_integer(Y), X + Y < 4711]]></code>
</desc>
</func>
<func>
- <name>select(Continuation) -> {[Match],Continuation} | '$end_of_table'</name>
+ <name name="select" arity="1"/>
<fsummary>Continue matching objects in an ETS table.</fsummary>
- <type>
- <v>Match = term()</v>
- <v>Continuation = term()</v>
- </type>
<desc>
<p>Continues a match started with
<c>ets:select/3</c>. The next
chunk of the size given in the initial <c>ets:select/3</c>
- call is returned together with a new <c>Continuation</c>
+ call is returned together with a new <c><anno>Continuation</anno></c>
that can be used in subsequent calls to this function.</p>
<p><c>'$end_of_table'</c> is returned when there are no more
objects in the table.</p>
</desc>
</func>
<func>
- <name>select_count(Tab, MatchSpec) -> NumMatched</name>
+ <name name="select_count" arity="2"/>
<fsummary>Match the objects in an ETS table against a match_spec and returns the number of objects for which the match_spec returned 'true'</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Object = tuple()</v>
- <v>MatchSpec = match_spec()</v>
- <v>NumMatched = integer()</v>
- </type>
<desc>
- <p>Matches the objects in the table <c>Tab</c> using a
+ <p>Matches the objects in the table <c><anno>Tab</anno></c> using a
<seealso marker="#match_spec">match_spec</seealso>. If the
match_spec returns <c>true</c> for an object, that object
considered a match and is counted. For any other result from
@@ -1396,16 +1262,10 @@ is_integer(X), is_integer(Y), X + Y < 4711]]></code>
</desc>
</func>
<func>
- <name>select_delete(Tab, MatchSpec) -> NumDeleted</name>
+ <name name="select_delete" arity="2"/>
<fsummary>Match the objects in an ETS table against a match_spec and deletes objects where the match_spec returns 'true'</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Object = tuple()</v>
- <v>MatchSpec = match_spec()</v>
- <v>NumDeleted = integer()</v>
- </type>
<desc>
- <p>Matches the objects in the table <c>Tab</c> using a
+ <p>Matches the objects in the table <c><anno>Tab</anno></c> using a
<seealso marker="#match_spec">match_spec</seealso>. If the
match_spec returns <c>true</c> for an object, that object is
removed from the table. For any other result from the
@@ -1422,13 +1282,8 @@ is_integer(X), is_integer(Y), X + Y < 4711]]></code>
</desc>
</func>
<func>
- <name>select_reverse(Tab, MatchSpec) -> [Match]</name>
+ <name name="select_reverse" arity="2"/>
<fsummary>Match the objects in an ETS table against a match_spec.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Match = term()</v>
- <v>MatchSpec = match_spec()</v>
- </type>
<desc>
<p>Works like <c>select/2</c>, but returns the list in reverse
@@ -1438,14 +1293,8 @@ is_integer(X), is_integer(Y), X + Y < 4711]]></code>
</desc>
</func>
<func>
- <name>select_reverse(Tab, MatchSpec, Limit) -> {[Match],Continuation} | '$end_of_table'</name>
+ <name name="select_reverse" arity="3"/>
<fsummary>Match the objects in an ETS table against a match_spec and returns part of the answers.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Match = term()</v>
- <v>MatchSpec = match_spec()</v>
- <v>Continuation = term()</v>
- </type>
<desc>
<p>Works like <c>select/3</c>, but for the <c>ordered_set</c>
@@ -1456,18 +1305,14 @@ is_integer(X), is_integer(Y), X + Y < 4711]]></code>
<p>Note that this is <em>not</em> equivalent to
reversing the result list of a <c>select/3</c> call, as the result list
- is not only reversed, but also contains the last <c>Limit</c>
+ is not only reversed, but also contains the last <c><anno>Limit</anno></c>
matching objects in the table, not the first.</p>
</desc>
</func>
<func>
- <name>select_reverse(Continuation) -> {[Match],Continuation} | '$end_of_table'</name>
+ <name name="select_reverse" arity="1"/>
<fsummary>Continue matching objects in an ETS table.</fsummary>
- <type>
- <v>Match = term()</v>
- <v>Continuation = term()</v>
- </type>
<desc>
<p>Continues a match started with
@@ -1477,7 +1322,7 @@ is_integer(X), is_integer(Y), X + Y < 4711]]></code>
returned list will also contain objects with keys in reverse
order.</p>
- <p>For all other table types, the behaviour is exatly that of <c>select/1</c>.</p>
+ <p>For all other table types, the behaviour is exactly that of <c>select/1</c>.</p>
<p>Example:</p>
<code>
1> T = ets:new(x,[ordered_set]).
@@ -1501,14 +1346,8 @@ is_integer(X), is_integer(Y), X + Y < 4711]]></code>
</desc>
</func>
<func>
- <name>setopts(Tab, Opts) -> true</name>
+ <name name="setopts" arity="2"/>
<fsummary>Set table options.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Opts = Opt | [Opt]</v>
- <v>Opt = {heir,pid(),HeirData} | {heir,none}</v>
- <v>HeirData = term()</v>
- </type>
<desc>
<p>Set table options. The only option that currently is allowed to be
set after the table has been created is
@@ -1517,28 +1356,23 @@ is_integer(X), is_integer(Y), X + Y < 4711]]></code>
</desc>
</func>
<func>
- <name>slot(Tab, I) -> [Object] | '$end_of_table'</name>
+ <name name="slot" arity="2"/>
<fsummary>Return all objects in a given slot of an ETS table.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>I = integer()</v>
- <v>Object = tuple()</v>
- </type>
<desc>
<p>This function is mostly for debugging purposes, Normally
one should use <c>first/next</c> or <c>last/prev</c> instead.</p>
- <p>Returns all objects in the <c>I</c>:th slot of the table
- <c>Tab</c>. A table can be traversed by repeatedly calling
- the function, starting with the first slot <c>I=0</c> and
+ <p>Returns all objects in the <c><anno>I</anno></c>:th slot of the table
+ <c><anno>Tab</anno></c>. A table can be traversed by repeatedly calling
+ the function, starting with the first slot <c><anno>I</anno>=0</c> and
ending when <c>'$end_of_table'</c> is returned.
The function will fail with reason <c>badarg</c> if the
- <c>I</c> argument is out of range.</p>
+ <c><anno>I</anno></c> argument is out of range.</p>
<p>Unless a table of type <c>set</c>, <c>bag</c> or
<c>duplicate_bag</c> is protected using
<c>safe_fixtable/2</c>, see above, a traversal may fail if
concurrent updates are made to the table. If the table is of
type <c>ordered_set</c>, the function returns a list
- containing the <c>I</c>:th object in Erlang term order.</p>
+ containing the <c><anno>I</anno></c>:th object in Erlang term order.</p>
</desc>
</func>
<func>
@@ -1754,16 +1588,16 @@ true</pre>
</desc>
</func>
<func>
- <name>update_counter(Tab, Key, UpdateOp) -> Result</name>
- <name>update_counter(Tab, Key, [UpdateOp]) -> [Result]</name>
- <name>update_counter(Tab, Key, Incr) -> Result</name>
+ <name name="update_counter" arity="3" clause_i="1"/>
+ <name name="update_counter" arity="3" clause_i="2"/>
+ <name name="update_counter" arity="3" clause_i="3"/>
+ <type variable="Tab"/>
+ <type variable="Key"/>
+ <type variable="UpdateOp" name_i="1"/>
+ <type variable="Pos" name_i="1"/>
+ <type variable="Threshold" name_i="1"/>
+ <type variable="SetValue" name_i="1"/>
<fsummary>Update a counter object in an ETS table.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Key = term()</v>
- <v>UpdateOp = {Pos,Incr} | {Pos,Incr,Threshold,SetValue}</v>
- <v>Pos = Incr = Threshold = SetValue = Result = integer()</v>
- </type>
<desc>
<p>This function provides an efficient way to update one or more
counters, without the hassle of having to look up an object, update
@@ -1771,22 +1605,22 @@ true</pre>
into the table again. (The update is done atomically; i.e. no process
can access the ets table in the middle of the operation.)
</p>
- <p>It will destructively update the object with key <c>Key</c>
- in the table <c>Tab</c> by adding <c>Incr</c> to the element
- at the <c>Pos</c>:th position. The new counter value is
+ <p>It will destructively update the object with key <c><anno>Key</anno></c>
+ in the table <c><anno>Tab</anno></c> by adding <c><anno>Incr</anno></c> to the element
+ at the <c><anno>Pos</anno></c>:th position. The new counter value is
returned. If no position is specified, the element directly
following the key (<c><![CDATA[<keypos>+1]]></c>) is updated.</p>
- <p>If a <c>Threshold</c> is specified, the counter will be
- reset to the value <c>SetValue</c> if the following
+ <p>If a <c><anno>Threshold</anno></c> is specified, the counter will be
+ reset to the value <c><anno>SetValue</anno></c> if the following
conditions occur:</p>
<list type="bulleted">
- <item>The <c>Incr</c> is not negative (<c>>= 0</c>) and the
- result would be greater than (<c>></c>) <c>Threshold</c></item>
- <item>The <c>Incr</c> is negative (<c><![CDATA[< 0]]></c>) and the
+ <item>The <c><anno>Incr</anno></c> is not negative (<c>>= 0</c>) and the
+ result would be greater than (<c>></c>) <c><anno>Threshold</anno></c></item>
+ <item>The <c><anno>Incr</anno></c> is negative (<c><![CDATA[< 0]]></c>) and the
result would be less than (<c><![CDATA[<]]></c>)
- <c>Threshold</c></item>
+ <c><anno>Threshold</anno></c></item>
</list>
- <p>A list of <c>UpdateOp</c> can be supplied to do several update
+ <p>A list of <c><anno>UpdateOp</anno></c> can be supplied to do several update
operations within the object. The operations are carried out in the
order specified in the list. If the same counter position occurs
more than one time in the list, the corresponding counter will thus
@@ -1797,7 +1631,7 @@ true</pre>
returned. If the function should fail, no updates will be done at
all.
</p>
- <p>The given Key is used to identify the object by either
+ <p>The given <c><anno>Key</anno></c> is used to identify the object by either
<em>matching</em> the key of an object in a <c>set</c> table,
or <em>compare equal</em> to the key of an object in an
<c>ordered_set</c> table (see
@@ -1812,29 +1646,28 @@ true</pre>
<item>the object has the wrong arity,</item>
<item>the element to update is not an integer,</item>
<item>the element to update is also the key, or,</item>
- <item>any of <c>Pos</c>, <c>Incr</c>, <c>Threshold</c> or
- <c>SetValue</c> is not an integer</item>
+ <item>any of <c><anno>Pos</anno></c>, <c><anno>Incr</anno></c>, <c><anno>Threshold</anno></c> or
+ <c><anno>SetValue</anno></c> is not an integer</item>
</list>
</desc>
</func>
<func>
- <name>update_element(Tab, Key, {Pos,Value}) -> true | false</name>
- <name>update_element(Tab, Key, [{Pos,Value}]) -> true | false</name>
+ <name name="update_element" arity="3" clause_i="1"/>
+ <name name="update_element" arity="3" clause_i="2"/>
+ <type variable="Tab"/>
+ <type variable="Key"/>
+ <type variable="Value"/>
+ <type variable="Pos"/>
<fsummary>Updates the <c>Pos</c>:th element of the object with a given key in an ETS table.</fsummary>
- <type>
- <v>Tab = tid() | atom()</v>
- <v>Key = Value = term()</v>
- <v>Pos = integer()</v>
- </type>
<desc>
<p>This function provides an efficient way to update one or more
elements within an object, without the hassle of having to look up,
update and write back the entire object.
</p>
- <p>It will destructively update the object with key <c>Key</c>
- in the table <c>Tab</c>. The element at the <c>Pos</c>:th position
- will be given the value <c>Value</c>. </p>
- <p>A list of <c>{Pos,Value}</c> can be supplied to update several
+ <p>It will destructively update the object with key <c><anno>Key</anno></c>
+ in the table <c><anno>Tab</anno></c>. The element at the <c><anno>Pos</anno></c>:th position
+ will be given the value <c><anno>Value</anno></c>. </p>
+ <p>A list of <c>{<anno>Pos</anno>,<anno>Value</anno>}</c> can be supplied to update several
elements within the same object. If the same position occurs more
than one in the list, the last value in the list will be written. If
the list is empty or the function fails, no updates will be done at
@@ -1842,9 +1675,9 @@ true</pre>
can never see any intermediate results.
</p>
<p>The function returns <c>true</c> if an object with the key
- <c>Key</c> was found, <c>false</c> otherwise.
+ <c><anno>Key</anno></c> was found, <c>false</c> otherwise.
</p>
- <p>The given Key is used to identify the object by either
+ <p>The given <c><anno>Key</anno></c> is used to identify the object by either
<em>matching</em> the key of an object in a <c>set</c> table,
or <em>compare equal</em> to the key of an object in an
<c>ordered_set</c> table (see
@@ -1855,7 +1688,7 @@ true</pre>
<list type="bulleted">
<item>the table is not of type <c>set</c> or
<c>ordered_set</c>,</item>
- <item><c>Pos</c> is less than 1 or greater than the object
+ <item><c><anno>Pos</anno></c> is less than 1 or greater than the object
arity, or,</item>
<item>the element to update is also the key</item>
</list>
diff --git a/lib/stdlib/doc/src/filelib.xml b/lib/stdlib/doc/src/filelib.xml
index f3079c7337..cec20aee8e 100644
--- a/lib/stdlib/doc/src/filelib.xml
+++ b/lib/stdlib/doc/src/filelib.xml
@@ -150,6 +150,11 @@
<p>Matches any number of characters up to the end of
the filename, the next dot, or the next slash.</p>
</item>
+ <tag>**</tag>
+ <item>
+ <p>Two adjacent <c>*</c>'s used as a single pattern will
+ match all files and zero or more directories and subdirectories.</p>
+ </item>
<tag>[Character1,Character2,...]</tag>
<item>
<p>Matches any of the characters listed. Two characters
@@ -192,6 +197,10 @@
<c>src</c> or <c>include</c> directories, use:</p>
<code type="none">
filelib:wildcard("lib/*/{src,include}/*.{erl,hrl}") </code>
+ <p>To find all <c>.erl</c> or <c>.hrl</c> files in any
+ subdirectory, use:</p>
+ <code type="none">
+ filelib:wildcard("lib/**/*.{erl,hrl}") </code>
</desc>
</func>
<func>
diff --git a/lib/stdlib/doc/src/gb_trees.xml b/lib/stdlib/doc/src/gb_trees.xml
index 65c866efbe..9316d60b1a 100644
--- a/lib/stdlib/doc/src/gb_trees.xml
+++ b/lib/stdlib/doc/src/gb_trees.xml
@@ -132,15 +132,6 @@
</desc>
</func>
<func>
- <name name="lookup" arity="2"/>
- <fsummary>Look up a key in a tree</fsummary>
- <desc>
- <p>Looks up <c><anno>Key</anno></c> in <c><anno>Tree</anno></c>; returns
- <c>{value, <anno>Val</anno>}</c>, or <c>none</c> if <c><anno>Key</anno></c> is not
- present.</p>
- </desc>
- </func>
- <func>
<name name="insert" arity="3"/>
<fsummary>Insert a new key and value in a tree</fsummary>
<desc>
@@ -196,6 +187,15 @@
</desc>
</func>
<func>
+ <name name="lookup" arity="2"/>
+ <fsummary>Look up a key in a tree</fsummary>
+ <desc>
+ <p>Looks up <c><anno>Key</anno></c> in <c><anno>Tree</anno></c>; returns
+ <c>{value, <anno>Val</anno>}</c>, or <c>none</c> if <c><anno>Key</anno></c> is not
+ present.</p>
+ </desc>
+ </func>
+ <func>
<name name="map" arity="2"/>
<fsummary>Return largest key and value</fsummary>
<desc><p>Maps the function F(<anno>K</anno>, <anno>V1</anno>) -> <anno>V2</anno> to all key-value pairs
diff --git a/lib/stdlib/doc/src/gen_event.xml b/lib/stdlib/doc/src/gen_event.xml
index 79a0c8ad89..1601ea9892 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>2011</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -120,8 +120,10 @@ gen_event:stop -----> Module:terminate/2
<name>start_link(EventMgrName) -> Result</name>
<fsummary>Create a generic event manager process in a supervision tree.</fsummary>
<type>
- <v>EventMgrName = {local,Name} | {global,Name}</v>
+ <v>EventMgrName = {local,Name} | {global,GlobalName}
+ | {via,Module,ViaName}</v>
<v>&nbsp;Name = atom()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Result = {ok,Pid} | {error,{already_started,Pid}}</v>
<v>&nbsp;Pid = pid()</v>
</type>
@@ -132,10 +134,17 @@ gen_event:stop -----> Module:terminate/2
the event manager is linked to the supervisor.</p>
<p>If <c>EventMgrName={local,Name}</c>, the event manager is
registered locally as <c>Name</c> using <c>register/2</c>.
- If <c>EventMgrName={global,Name}</c>, the event manager is
- registered globally as <c>Name</c> using
+ If <c>EventMgrName={global,GlobalName}</c>, the event manager is
+ registered globally as <c>GlobalName</c> using
<c>global:register_name/2</c>. If no name is provided,
- the event manager is not registered.</p>
+ the event manager is not registered.
+ If <c>EventMgrName={via,Module,ViaName}</c>, the event manager will
+ register with the registry represented by <c>Module</c>.
+ The <c>Module</c> callback should export the functions
+ <c>register_name/2</c>, <c>unregister_name/1</c>,
+ <c>whereis_name/1</c> and <c>send/2</c>, which should behave like the
+ corresponding functions in <c>global</c>. Thus,
+ <c>{via,global,GlobalName}</c> is a valid reference.</p>
<p>If the event manager is successfully created the function
returns <c>{ok,Pid}</c>, where <c>Pid</c> is the pid of
the event manager. If there already exists a process with
@@ -149,8 +158,10 @@ gen_event:stop -----> Module:terminate/2
<name>start(EventMgrName) -> Result</name>
<fsummary>Create a stand-alone event manager process.</fsummary>
<type>
- <v>EventMgrName = {local,Name} | {global,Name}</v>
+ <v>EventMgrName = {local,Name} | {global,GlobalName}
+ | {via,Module,ViaName}</v>
<v>&nbsp;Name = atom()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Result = {ok,Pid} | {error,{already_started,Pid}}</v>
<v>&nbsp;Pid = pid()</v>
</type>
@@ -166,8 +177,10 @@ gen_event:stop -----> Module:terminate/2
<name>add_handler(EventMgrRef, Handler, Args) -> Result</name>
<fsummary>Add an event handler to a generic event manager.</fsummary>
<type>
- <v>EventMgr = Name | {Name,Node} | {global,Name} | pid()</v>
+ <v>EventMgr = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()</v>
<v>&nbsp;Name = Node = atom()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Handler = Module | {Module,Id}</v>
<v>&nbsp;Module = atom()</v>
<v>&nbsp;Id = term()</v>
@@ -185,8 +198,10 @@ gen_event:stop -----> Module:terminate/2
<item><c>Name</c>, if the event manager is locally registered,</item>
<item><c>{Name,Node}</c>, if the event manager is locally
registered at another node, or</item>
- <item><c>{global,Name}</c>, if the event manager is globally
+ <item><c>{global,GlobalName}</c>, if the event manager is globally
registered.</item>
+ <item><c>{via,Module,ViaName}</c>, if the event manager is registered
+ through an alternative process registry.</item>
</list>
<p><c>Handler</c> is the name of the callback module <c>Module</c> or
a tuple <c>{Module,Id}</c>, where <c>Id</c> is any term.
@@ -208,8 +223,10 @@ gen_event:stop -----> Module:terminate/2
<name>add_sup_handler(EventMgrRef, Handler, Args) -> Result</name>
<fsummary>Add a supervised event handler to a generic event manager.</fsummary>
<type>
- <v>EventMgr = Name | {Name,Node} | {global,Name} | pid()</v>
+ <v>EventMgr = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()</v>
<v>&nbsp;Name = Node = atom()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Handler = Module | {Module,Id}</v>
<v>&nbsp;Module = atom()</v>
<v>&nbsp;Id = term()</v>
@@ -253,8 +270,10 @@ gen_event:stop -----> Module:terminate/2
<name>sync_notify(EventMgrRef, Event) -> ok</name>
<fsummary>Notify an event manager about an event.</fsummary>
<type>
- <v>EventMgrRef = Name | {Name,Node} | {global,Name} | pid()</v>
+ <v>EventMgrRef = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()</v>
<v>&nbsp;Name = Node = atom()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Event = term()</v>
</type>
<desc>
@@ -278,8 +297,10 @@ gen_event:stop -----> Module:terminate/2
<name>call(EventMgrRef, Handler, Request, Timeout) -> Result</name>
<fsummary>Make a synchronous call to a generic event manager.</fsummary>
<type>
- <v>EventMgrRef = Name | {Name,Node} | {global,Name} | pid()</v>
+ <v>EventMgrRef = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()</v>
<v>&nbsp;Name = Node = atom()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Handler = Module | {Module,Id}</v>
<v>&nbsp;Module = atom()</v>
<v>&nbsp;Id = term()</v>
@@ -318,8 +339,10 @@ gen_event:stop -----> Module:terminate/2
<name>delete_handler(EventMgrRef, Handler, Args) -> Result</name>
<fsummary>Delete an event handler from a generic event manager.</fsummary>
<type>
- <v>EventMgrRef = Name | {Name,Node} | {global,Name} | pid()</v>
+ <v>EventMgrRef = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()</v>
<v>&nbsp;Name = Node = atom()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Handler = Module | {Module,Id}</v>
<v>&nbsp;Module = atom()</v>
<v>&nbsp;Id = term()</v>
@@ -346,8 +369,10 @@ gen_event:stop -----> Module:terminate/2
<name>swap_handler(EventMgrRef, {Handler1,Args1}, {Handler2,Args2}) -> Result</name>
<fsummary>Replace an event handler in a generic event manager.</fsummary>
<type>
- <v>EventMgrRef = Name | {Name,Node} | {global,Name} | pid()</v>
+ <v>EventMgrRef = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()</v>
<v>&nbsp;Name = Node = atom()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Handler1 = Handler2 = Module | {Module,Id}</v>
<v>&nbsp;Module = atom()</v>
<v>&nbsp;Id = term()</v>
@@ -390,8 +415,10 @@ gen_event:stop -----> Module:terminate/2
<name>swap_sup_handler(EventMgrRef, {Handler1,Args1}, {Handler2,Args2}) -> Result</name>
<fsummary>Replace an event handler in a generic event manager.</fsummary>
<type>
- <v>EventMgrRef = Name | {Name,Node} | {global,Name} | pid()</v>
+ <v>EventMgrRef = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()</v>
<v>&nbsp;Name = Node = atom()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Handler1 = Handler 2 = Module | {Module,Id}</v>
<v>&nbsp;Module = atom()</v>
<v>&nbsp;Id = term()</v>
@@ -412,8 +439,10 @@ gen_event:stop -----> Module:terminate/2
<name>which_handlers(EventMgrRef) -> [Handler]</name>
<fsummary>Return all event handlers installed in a generic event manager.</fsummary>
<type>
- <v>EventMgrRef = Name | {Name,Node} | {global,Name} | pid()</v>
+ <v>EventMgrRef = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()</v>
<v>&nbsp;Name = Node = atom()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Handler = Module | {Module,Id}</v>
<v>&nbsp;Module = atom()</v>
<v>&nbsp;Id = term()</v>
@@ -429,8 +458,10 @@ gen_event:stop -----> Module:terminate/2
<name>stop(EventMgrRef) -> ok</name>
<fsummary>Terminate a generic event manager.</fsummary>
<type>
- <v>EventMgrRef = Name | {Name,Node} | {global,Name} | pid()</v>
+ <v>EventMgrRef = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()</v>
<v>Name = Node = atom()</v>
+ <v>GlobalName = ViaName = term()</v>
</type>
<desc>
<p>Terminates the event manager <c>EventMgrRef</c>. Before
diff --git a/lib/stdlib/doc/src/gen_fsm.xml b/lib/stdlib/doc/src/gen_fsm.xml
index 421eeb4fd3..73c1911f1e 100644
--- a/lib/stdlib/doc/src/gen_fsm.xml
+++ b/lib/stdlib/doc/src/gen_fsm.xml
@@ -84,9 +84,10 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4
<name>start_link(FsmName, Module, Args, Options) -> Result</name>
<fsummary>Create a gen_fsm process in a supervision tree.</fsummary>
<type>
- <v>FsmName = {local,Name} | {global,GlobalName}</v>
+ <v>FsmName = {local,Name} | {global,GlobalName}
+ | {via,Module,ViaName}</v>
<v>&nbsp;Name = atom()</v>
- <v>&nbsp;GlobalName = term()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Module = atom()</v>
<v>Args = term()</v>
<v>Options = [Option]</v>
@@ -113,8 +114,16 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4
locally as <c>Name</c> using <c>register/2</c>.
If <c>FsmName={global,GlobalName}</c>, the gen_fsm is
registered globally as <c>GlobalName</c> using
- <c>global:register_name/2</c>. If no name is provided,
- the gen_fsm is not registered.</p>
+ <c>global:register_name/2</c>.
+ If <c>EventMgrName={via,Module,ViaName}</c>, the event manager will
+ register with the registry represented by <c>Module</c>.
+ The <c>Module</c> callback should export the functions
+ <c>register_name/2</c>, <c>unregister_name/1</c>,
+ <c>whereis_name/1</c> and <c>send/2</c>, which should behave like the
+ corresponding functions in <c>global</c>. Thus,
+ <c>{via,global,GlobalName}</c> is a valid reference.</p>
+ <p>If no name is provided,
+ the gen_fsm is not registered.</p>
<p><c>Module</c> is the name of the callback module.</p>
<p><c>Args</c> is an arbitrary term which is passed as
the argument to <c>Module:init/1</c>.</p>
@@ -154,9 +163,10 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4
<name>start(FsmName, Module, Args, Options) -> Result</name>
<fsummary>Create a stand-alone gen_fsm process.</fsummary>
<type>
- <v>FsmName = {local,Name} | {global,GlobalName}</v>
+ <v>FsmName = {local,Name} | {global,GlobalName}
+ | {via,Module,ViaName}</v>
<v>&nbsp;Name = atom()</v>
- <v>&nbsp;GlobalName = term()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Module = atom()</v>
<v>Args = term()</v>
<v>Options = [Option]</v>
@@ -180,9 +190,10 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4
<name>send_event(FsmRef, Event) -> ok</name>
<fsummary>Send an event asynchronously to a generic FSM.</fsummary>
<type>
- <v>FsmRef = Name | {Name,Node} | {global,GlobalName} | pid()</v>
+ <v>FsmRef = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()</v>
<v>&nbsp;Name = Node = atom()</v>
- <v>&nbsp;GlobalName = term()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Event = term()</v>
</type>
<desc>
@@ -196,9 +207,11 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4
<item>the pid,</item>
<item><c>Name</c>, if the gen_fsm is locally registered,</item>
<item><c>{Name,Node}</c>, if the gen_fsm is locally
- registered at another node, or</item>
- <item><c>{global,GlobalName}</c>, if the gen_fsm is globally
- registered.</item>
+ registered at another node, or</item>
+ <item><c>{global,GlobalName}</c>, if the gen_fsm is globally
+ registered.</item>
+ <item><c>{via,Module,ViaName}</c>, if the event manager is registered
+ through an alternative process registry.</item>
</list>
<p><c>Event</c> is an arbitrary term which is passed as one of
the arguments to <c>Module:StateName/2</c>.</p>
@@ -208,9 +221,10 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4
<name>send_all_state_event(FsmRef, Event) -> ok</name>
<fsummary>Send an event asynchronously to a generic FSM.</fsummary>
<type>
- <v>FsmRef = Name | {Name,Node} | {global,GlobalName} | pid()</v>
+ <v>FsmRef = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()</v>
<v>&nbsp;Name = Node = atom()</v>
- <v>&nbsp;GlobalName = term()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Event = term()</v>
</type>
<desc>
@@ -232,9 +246,10 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4
<name>sync_send_event(FsmRef, Event, Timeout) -> Reply</name>
<fsummary>Send an event synchronously to a generic FSM.</fsummary>
<type>
- <v>FsmRef = Name | {Name,Node} | {global,GlobalName} | pid()</v>
+ <v>FsmRef = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()</v>
<v>&nbsp;Name = Node = atom()</v>
- <v>&nbsp;GlobalName = term()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Event = term()</v>
<v>Timeout = int()>0 | infinity</v>
<v>Reply = term()</v>
@@ -264,9 +279,10 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4
<name>sync_send_all_state_event(FsmRef, Event, Timeout) -> Reply</name>
<fsummary>Send an event synchronously to a generic FSM.</fsummary>
<type>
- <v>FsmRef = Name | {Name,Node} | {global,GlobalName} | pid()</v>
+ <v>FsmRef = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()</v>
<v>&nbsp;Name = Node = atom()</v>
- <v>&nbsp;GlobalName = term()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Event = term()</v>
<v>Timeout = int()>0 | infinity</v>
<v>Reply = term()</v>
@@ -388,9 +404,10 @@ gen_fsm:sync_send_all_state_event -----> Module:handle_sync_event/4
<v>&nbsp;&nbsp;&nbsp;&nbsp;| {log_to_file,FileName} | {install,{Func,FuncState}}</v>
<v>StateName = atom()</v>
<v>StateData = term()</v>
- <v>FsmName = {local,Name} | {global,GlobalName}</v>
+ <v>FsmName = {local,Name} | {global,GlobalName}
+ | {via,Module,ViaName}</v>
<v>&nbsp;Name = atom()</v>
- <v>&nbsp;GlobalName = term()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Timeout = int() | infinity</v>
</type>
<desc>
diff --git a/lib/stdlib/doc/src/gen_server.xml b/lib/stdlib/doc/src/gen_server.xml
index edeb7dff91..abb4c73c7b 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>2011</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -83,9 +83,10 @@ gen_server:abcast -----> Module:handle_cast/2
<name>start_link(ServerName, Module, Args, Options) -> Result</name>
<fsummary>Create a gen_server process in a supervision tree.</fsummary>
<type>
- <v>ServerName = {local,Name} | {global,GlobalName}</v>
+ <v>ServerName = {local,Name} | {global,GlobalName}
+ | {via,Module,ViaName}</v>
<v>&nbsp;Name = atom()</v>
- <v>&nbsp;GlobalName = term()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Module = atom()</v>
<v>Args = term()</v>
<v>Options = [Option]</v>
@@ -111,14 +112,22 @@ gen_server:abcast -----> Module:handle_cast/2
If <c>ServerName={global,GlobalName}</c> the gen_server is
registered globally as <c>GlobalName</c> using
<c>global:register_name/2</c>. If no name is provided,
- the gen_server is not registered.</p>
+ the gen_server is not registered.
+ If <c>EventMgrName={via,Module,ViaName}</c>, the event manager will
+ register with the registry represented by <c>Module</c>.
+ The <c>Module</c> callback should export the functions
+ <c>register_name/2</c>, <c>unregister_name/1</c>,
+ <c>whereis_name/1</c> and <c>send/2</c>, which should behave like the
+ corresponding functions in <c>global</c>. Thus,
+ <c>{via,global,GlobalName}</c> is a valid reference.</p>
<p><c>Module</c> is the name of the callback module.</p>
<p><c>Args</c> is an arbitrary term which is passed as
the argument to <c>Module:init/1</c>.</p>
<p>If the option <c>{timeout,Time}</c> is present,
the gen_server is allowed to spend <c>Time</c> milliseconds
initializing or it will be terminated and the start function
- will return <c>{error,timeout}</c>.</p>
+ will return <c>{error,timeout}</c>.
+ </p>
<p>If the option <c>{debug,Dbgs}</c> is present,
the corresponding <c>sys</c> function will be called for each
item in <c>Dbgs</c>. See
@@ -151,9 +160,10 @@ gen_server:abcast -----> Module:handle_cast/2
<name>start(ServerName, Module, Args, Options) -> Result</name>
<fsummary>Create a stand-alone gen_server process.</fsummary>
<type>
- <v>ServerName = {local,Name} | {global,GlobalName}</v>
+ <v>ServerName = {local,Name} | {global,GlobalName}
+ | {via,Module,ViaName}</v>
<v>&nbsp;Name = atom()</v>
- <v>&nbsp;GlobalName = term()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Module = atom()</v>
<v>Args = term()</v>
<v>Options = [Option]</v>
@@ -178,9 +188,10 @@ gen_server:abcast -----> Module:handle_cast/2
<name>call(ServerRef, Request, Timeout) -> Reply</name>
<fsummary>Make a synchronous call to a generic server.</fsummary>
<type>
- <v>ServerRef = Name | {Name,Node} | {global,GlobalName} | pid()</v>
+ <v>ServerRef = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()</v>
<v>&nbsp;Node = atom()</v>
- <v>&nbsp;GlobalName = term()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Request = term()</v>
<v>Timeout = int()>0 | infinity</v>
<v>Reply = term()</v>
@@ -198,6 +209,8 @@ gen_server:abcast -----> Module:handle_cast/2
registered at another node, or</item>
<item><c>{global,GlobalName}</c>, if the gen_server is
globally registered.</item>
+ <item><c>{via,Module,ViaName}</c>, if the gen_server is
+ registered through an alternative process registry.</item>
</list>
<p><c>Request</c> is an arbitrary term which is passed as one of
the arguments to <c>Module:handle_call/3</c>.</p>
@@ -281,9 +294,10 @@ gen_server:abcast -----> Module:handle_cast/2
<name>cast(ServerRef, Request) -> ok</name>
<fsummary>Send an asynchronous request to a generic server.</fsummary>
<type>
- <v>ServerRef = Name | {Name,Node} | {global,GlobalName} | pid()</v>
+ <v>ServerRef = Name | {Name,Node} | {global,GlobalName}
+ | {via,Module,ViaName} | pid()</v>
<v>&nbsp;Node = atom()</v>
- <v>&nbsp;GlobalName = term()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Request = term()</v>
</type>
<desc>
@@ -355,9 +369,10 @@ gen_server:abcast -----> Module:handle_cast/2
<v>&nbsp;&nbsp;&nbsp;Dbg = trace | log | statistics</v>
<v>&nbsp;&nbsp;&nbsp;&nbsp;| {log_to_file,FileName} | {install,{Func,FuncState}}</v>
<v>State = term()</v>
- <v>ServerName = {local,Name} | {global,GlobalName}</v>
+ <v>ServerName = {local,Name} | {global,GlobalName}
+ | {via,Module,ViaName}</v>
<v>&nbsp;Name = atom()</v>
- <v>&nbsp;GlobalName = term()</v>
+ <v>&nbsp;GlobalName = ViaName = term()</v>
<v>Timeout = int() | infinity</v>
</type>
<desc>
diff --git a/lib/stdlib/doc/src/lists.xml b/lib/stdlib/doc/src/lists.xml
index 7042c84437..b6c0fa4e05 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>2011</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -248,18 +248,13 @@ flatmap(Fun, List1) ->
</desc>
</func>
<func>
- <name>keyfind(Key, N, TupleList) -> Tuple | false</name>
+ <name name="keyfind" arity="3"/>
+ <type_desc variable="N">1..tuple_size(<anno>Tuple</anno>)</type_desc>
<fsummary>Search for an element in a list of tuples</fsummary>
- <type>
- <v>Key = term()</v>
- <v>N = 1..tuple_size(Tuple)</v>
- <v>TupleList = [Tuple]</v>
- <v>Tuple = tuple()</v>
- </type>
- <desc>
- <p>Searches the list of tuples <c>TupleList</c> for a
- tuple whose <c>N</c>th element compares equal to <c>Key</c>.
- Returns <c>Tuple</c> if such a tuple is found,
+ <desc>
+ <p>Searches the list of tuples <c><anno>TupleList</anno></c> for a
+ tuple whose <c><anno>N</anno></c>th element compares equal to <c><anno>Key</anno></c>.
+ Returns <c><anno>Tuple</anno></c> if such a tuple is found,
otherwise <c>false</c>.</p>
</desc>
</func>
@@ -281,17 +276,12 @@ flatmap(Fun, List1) ->
</desc>
</func>
<func>
- <name>keymember(Key, N, TupleList) -> boolean()</name>
+ <name name="keymember" arity="3"/>
+ <type_desc variable="N">1..tuple_size(<anno>Tuple</anno>)</type_desc>
<fsummary>Test for membership of a list of tuples</fsummary>
- <type>
- <v>Key = term()</v>
- <v>N = 1..tuple_size(Tuple)</v>
- <v>TupleList = [Tuple]</v>
- <v>&nbsp;Tuple = tuple()</v>
- </type>
- <desc>
- <p>Returns <c>true</c> if there is a tuple in <c>TupleList</c>
- whose <c>N</c>th element compares equal to <c>Key</c>, otherwise
+ <desc>
+ <p>Returns <c>true</c> if there is a tuple in <c><anno>TupleList</anno></c>
+ whose <c><anno>N</anno></c>th element compares equal to <c><anno>Key</anno></c>, otherwise
<c>false</c>.</p>
</desc>
</func>
@@ -321,18 +311,13 @@ flatmap(Fun, List1) ->
</desc>
</func>
<func>
- <name>keysearch(Key, N, TupleList) -> {value, Tuple} | false</name>
+ <name name="keysearch" arity="3"/>
+ <type_desc variable="N">1..tuple_size(<anno>Tuple</anno>)</type_desc>
<fsummary>Search for an element in a list of tuples</fsummary>
- <type>
- <v>Key = term()</v>
- <v>N = 1..tuple_size(Tuple)</v>
- <v>TupleList = [Tuple]</v>
- <v>Tuple = tuple()</v>
- </type>
- <desc>
- <p>Searches the list of tuples <c>TupleList</c> for a
- tuple whose <c>N</c>th element compares equal to <c>Key</c>.
- Returns <c>{value, Tuple}</c> if such a tuple is found,
+ <desc>
+ <p>Searches the list of tuples <c><anno>TupleList</anno></c> for a
+ tuple whose <c><anno>N</anno></c>th element compares equal to <c><anno>Key</anno></c>.
+ Returns <c>{value, <anno>Tuple</anno>}</c> if such a tuple is found,
otherwise <c>false</c>.</p>
<note><p>This function is retained for backward compatibility.
The function <c>lists:keyfind/3</c> (introduced in R13A)
@@ -425,15 +410,11 @@ flatmap(Fun, List1) ->
</desc>
</func>
<func>
- <name>member(Elem, List) -> boolean()</name>
+ <name name="member" arity="2"/>
<fsummary>Test for membership of a list</fsummary>
- <type>
- <v>Elem = term()</v>
- <v>List = [term()]</v>
- </type>
<desc>
- <p>Returns <c>true</c> if <c>Elem</c> matches some element of
- <c>List</c>, otherwise <c>false</c>.</p>
+ <p>Returns <c>true</c> if <c><anno>Elem</anno></c> matches some element of
+ <c><anno>List</anno></c>, otherwise <c>false</c>.</p>
</desc>
</func>
<func>
@@ -562,14 +543,11 @@ c</pre>
</desc>
</func>
<func>
- <name>reverse(List1, Tail) -> List2</name>
+ <name name="reverse" arity="2"/>
<fsummary>Reverse a list appending a tail</fsummary>
- <type>
- <v>List1 = Tail = List2 = [term()]</v>
- </type>
<desc>
- <p>Returns a list with the elements in <c>List1</c>
- in reverse order, with the tail <c>Tail</c> appended. For
+ <p>Returns a list with the elements in <c><anno>List1</anno></c>
+ in reverse order, with the tail <c><anno>Tail</anno></c> appended. For
example:</p>
<pre>
> <input>lists:reverse([1, 2, 3, 4], [a, b, c]).</input>
@@ -663,7 +641,7 @@ splitwith(Pred, List) ->
<desc>
<p>Returns the sub-list of <c><anno>List1</anno></c> starting at position 1
and with (max) <c><anno>Len</anno></c> elements. It is not an error for
- <c><anno>Len</anno></c> to exceed the length of the list -- in that case
+ <c><anno>Len</anno></c> to exceed the length of the list, in that case
the whole list is returned.</p>
</desc>
</func>
diff --git a/lib/stdlib/doc/src/math.xml b/lib/stdlib/doc/src/math.xml
index 518457d5d8..0219dcce10 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>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -52,54 +52,47 @@
</desc>
</func>
<func>
- <name>sin(X)</name>
- <name>cos(X)</name>
- <name>tan(X)</name>
- <name>asin(X)</name>
- <name>acos(X)</name>
- <name>atan(X)</name>
- <name>atan2(Y, X)</name>
- <name>sinh(X)</name>
- <name>cosh(X)</name>
- <name>tanh(X)</name>
- <name>asinh(X)</name>
- <name>acosh(X)</name>
- <name>atanh(X)</name>
- <name>exp(X)</name>
- <name>log(X)</name>
- <name>log10(X)</name>
- <name>pow(X, Y)</name>
- <name>sqrt(X)</name>
+ <name name="sin" arity="1"/>
+ <name name="cos" arity="1"/>
+ <name name="tan" arity="1"/>
+ <name name="asin" arity="1"/>
+ <name name="acos" arity="1"/>
+ <name name="atan" arity="1"/>
+ <name name="atan2" arity="2"/>
+ <name name="sinh" arity="1"/>
+ <name name="cosh" arity="1"/>
+ <name name="tanh" arity="1"/>
+ <name name="asinh" arity="1"/>
+ <name name="acosh" arity="1"/>
+ <name name="atanh" arity="1"/>
+ <name name="exp" arity="1"/>
+ <name name="log" arity="1"/>
+ <name name="log10" arity="1"/>
+ <name name="pow" arity="2"/>
+ <name name="sqrt" arity="1"/>
+ <type variable="X" name_i="7"/>
+ <type variable="Y" name_i="7"/>
<fsummary>Diverse math functions</fsummary>
- <type>
- <v>X = Y = number()</v>
- </type>
<desc>
<p>A collection of math functions which return floats. Arguments
are numbers. </p>
</desc>
</func>
<func>
- <name>erf(X) -> float()</name>
+ <name name="erf" arity="1"/>
<fsummary>Error function.</fsummary>
- <type>
- <v>X = number()</v>
- </type>
<desc>
- <p>Returns the error function of <c>X</c>, where</p>
+ <p>Returns the error function of <c><anno>X</anno></c>, where</p>
<pre>
erf(X) = 2/sqrt(pi)*integral from 0 to X of exp(-t*t) dt. </pre>
</desc>
</func>
<func>
- <name>erfc(X) -> float()</name>
+ <name name="erfc" arity="1"/>
<fsummary>Another error function</fsummary>
- <type>
- <v>X = number()</v>
- </type>
<desc>
<p><c>erfc(X)</c> returns <c>1.0 - erf(X)</c>, computed by
- methods that avoid cancellation for large <c>X</c>. </p>
+ methods that avoid cancellation for large <c><anno>X</anno></c>. </p>
</desc>
</func>
</funcs>
diff --git a/lib/stdlib/doc/src/ms_transform.xml b/lib/stdlib/doc/src/ms_transform.xml
index f81f8bda96..ad5f8bd5ac 100644
--- a/lib/stdlib/doc/src/ms_transform.xml
+++ b/lib/stdlib/doc/src/ms_transform.xml
@@ -308,7 +308,7 @@ ets:select(emp_tab, ets:fun2ms(
Erlang code. Also arithmetics is allowed, as well as ordinary guard
bif's. Here's a list of bif's and expressions:</p>
<list type="bulleted">
- <item>The type tests: is_atom, is_constant, is_float, is_integer,
+ <item>The type tests: is_atom, is_float, is_integer,
is_list, is_number, is_pid, is_port, is_reference, is_tuple,
is_binary, is_function, is_record</item>
<item>The boolean operators: not, and, or, andalso, orelse </item>
@@ -318,7 +318,7 @@ ets:select(emp_tab, ets:fun2ms(
<item>The guard bif's: abs, element, hd, length, node, round, size, tl,
trunc, self</item>
<item>The obsolete type test (only in guards):
- atom, constant, float, integer,
+ atom, float, integer,
list, number, pid, port, reference, tuple,
binary, function, record</item>
</list>
diff --git a/lib/stdlib/doc/src/notes.xml b/lib/stdlib/doc/src/notes.xml
index 42a26ee44a..b4d9f9a444 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,6 +30,249 @@
</header>
<p>This document describes the changes made to the STDLIB application.</p>
+<section><title>STDLIB 1.18.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fixed bug where if given an invalid drive letter on
+ windows ensure dir would go into an infinite loop.</p>
+ <p>
+ Own Id: OTP-10104</p>
+ </item>
+ <item>
+ <p>
+ Calls to gen_server:enter_loop/4 where ServerName has a
+ global scope and no timeout is given now works correctly.</p>
+ <p>
+ Thanks to Sam Bobroff for reporting the issue.</p>
+ <p>
+ Own Id: OTP-10130</p>
+ </item>
+ <item>
+ <p>
+ fix escript/primary archive reloading</p>
+ <p>
+ If the mtime of an escript/primary archive file changes
+ after being added to the code path, correctly reload the
+ archive and update the cache. (Thanks to Tuncer Ayaz)</p>
+ <p>
+ Own Id: OTP-10151</p>
+ </item>
+ <item>
+ <p>
+ Fix bug that in some cases could cause corrupted binaries
+ in ETS tables with <c>compressed</c> option.</p>
+ <p>
+ Own Id: OTP-10182</p>
+ </item>
+ <item>
+ <p>
+ Fix filename:nativename/1 on Win32</p>
+ <p>
+ Don't choke on paths given as binary argument on Win32.
+ Thanks to Jan Kl�tzke</p>
+ <p>
+ Own Id: OTP-10188</p>
+ </item>
+ <item>
+ <p>
+ Fix bug in <c>ets:test_ms/2</c> that could cause emulator
+ crash when using <c>'$_'</c> in match spec.</p>
+ <p>
+ Own Id: OTP-10190</p>
+ </item>
+ <item>
+ <p>
+ Fix bug where zip archives wrongly have a first disk
+ number set to 1</p>
+ <p>
+ Own Id: OTP-10223</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p> The message printed by the Erlang shell as an
+ explanation of the <c>badarith</c> error has been
+ corrected. (Thanks to Matthias Lang.) </p>
+ <p>
+ Own Id: OTP-10054</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>STDLIB 1.18.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ References to <c>is_constant/1</c> (which was removed in
+ the R12 release) has been removed from documentation and
+ code.</p>
+ <p>
+ Own Id: OTP-6454 Aux Id: seq10407 </p>
+ </item>
+ <item>
+ <p>
+ Leave control back to gen_server during supervisor's
+ restart loop</p>
+ <p>
+ When an attempt to restart a child failed, supervisor
+ would earlier keep the execution flow and try to restart
+ the child over and over again until it either succeeded
+ or the restart frequency limit was reached. If none of
+ these happened, supervisor would hang forever in this
+ loop.</p>
+ <p>
+ This commit adds a timer of 0 ms where the control is
+ left back to the gen_server which implements the
+ supervisor. This way any incoming request to the
+ supervisor will be handled - which could help breaking
+ the infinite loop - e.g. shutdown request for the
+ supervisor or for the problematic child.</p>
+ <p>
+ This introduces some incompatibilities in stdlib due to
+ new return values from supervisor: <list>
+ <item>restart_child/2 can now return
+ {error,restarting}</item> <item>delete_child/2 can now
+ return {error,restarting}</item> <item>which_children/1
+ returns a list of {Id,Child,Type,Mods}, where Child, in
+ addition to the old pid() or 'undefined', now also can be
+ 'restarting'.</item> </list></p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>
+ Own Id: OTP-9549</p>
+ </item>
+ <item>
+ <p>
+ If a temporary child's start function returned 'ignore',
+ then the supervisor would keep it's child specification.
+ This has been corrected. Child specifications for
+ non-existing temporary children shall never be kept.</p>
+ <p>
+ Own Id: OTP-9782 Aux Id: seq11964 </p>
+ </item>
+ <item>
+ <p> Use universal time as base in error logger
+ <p>
+ Previous conversion used the deprecated
+ calendar:local_time_to_universal_time/1 </p></p>
+ <p>
+ Own Id: OTP-9854</p>
+ </item>
+ <item>
+ <p>Calling a guard test (such as is_list/1) from the
+ top-level in a guard, would cause a compiler crash if
+ there was a local definition with the same name.
+ Corrected to reject the program with an error
+ message.</p>
+ <p>
+ Own Id: OTP-9866</p>
+ </item>
+ <item>
+ <p>
+ Fix the type spec from the doc of binary:part/3 (Thanks
+ to Ricardo Catalinas Jim�nez)</p>
+ <p>
+ Own Id: OTP-9920</p>
+ </item>
+ <item>
+ <p>
+ Correct spelling of registered (Thanks to Richard
+ Carlsson)</p>
+ <p>
+ Own Id: OTP-9925</p>
+ </item>
+ <item>
+ <p>
+ Put gb_trees documentation into alphabetical order
+ (Thanks to Aidan Hobson Sayers)</p>
+ <p>
+ Own Id: OTP-9929</p>
+ </item>
+ <item>
+ <p>
+ Fix bug in ETS with <c>compressed</c> option and
+ insertion of term containing large integers (>2G) on
+ 64-bit machines. Seen to cause emulator crash. (Thanks to
+ Diego Llarrull for excellent bug report)</p>
+ <p>
+ Own Id: OTP-9932</p>
+ </item>
+ <item>
+ <p>
+ Add plugin support for alternative name lookup This patch
+ introduces a new way of locating a behaviour instance:
+ {via, Module, Name}. (Thanks to Ulf Wiger)</p>
+ <p>
+ Own Id: OTP-9945</p>
+ </item>
+ <item>
+ <p> The function <c>digraph_utils:condensation/1</c> used
+ to create a digraph containing loops contradicting the
+ documentation which states that the created digraph is
+ free of cycles. This bug has been fixed. (Thanks to
+ Kostis Sagonas for finding the bug.) </p>
+ <p>
+ Own Id: OTP-9953</p>
+ </item>
+ <item>
+ <p> When an escript ends now all printout to standard
+ output and standard error gets out on the terminal. This
+ bug has been corrected by changing the behaviour of
+ erlang:halt/0,1, which should fix the same problem for
+ other escript-like applications, i.e that data stored in
+ the output port driver buffers got lost when printing on
+ a TTY and exiting through erlang:halt/0,1. </p>
+ <p> The BIF:s erlang:halt/0,1 has gotten improved
+ semantics and there is a new BIF erlang:halt/2 to
+ accomplish something like the old semantics. See the
+ documentation. </p>
+ <p> Now erlang:halt/0 and erlang:halt/1 with an integer
+ argument will close all ports and allow all pending async
+ threads operations to finish before exiting the emulator.
+ Previously erlang:halt/0 and erlang:halt(0) would just
+ wait for pending async threads operations but not close
+ ports. And erlang:halt/1 with a non-zero integer argument
+ would not even wait for pending async threads operations.
+ </p>
+ <p> To roughly the old behaviour, to not wait for ports
+ and async threads operations when you exit the emulator,
+ you use erlang:halt/2 with an integer first argument and
+ an option list containing {flush,false} as the second
+ argument. Note that now is flushing not dependant of the
+ exit code, and you can not only flush async threads
+ operations which we deemed as a strange behaviour anyway.
+ </p>
+ <p>Also, erlang:halt/1,2 has gotten a new feature: If the
+ first argument is the atom 'abort' the emulator is
+ aborted producing a core dump, if the operating system so
+ allows. </p>
+ <p>
+ Own Id: OTP-9985</p>
+ </item>
+ <item>
+ <p>
+ Add escript win32 alternative invocation. escript can now
+ be started as both "escript.exe" and "escript" (Thanks to
+ Pierre Rouleau)</p>
+ <p>
+ Own Id: OTP-9997</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>STDLIB 1.18</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/stdlib/doc/src/re.xml b/lib/stdlib/doc/src/re.xml
index 6d5336796c..2211bfb925 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>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -78,28 +78,15 @@
</datatypes>
<funcs>
<func>
- <name>compile(Regexp) -> {ok, MP} | {error, ErrSpec}</name>
+ <name name="compile" arity="1"/>
<fsummary>Compile a regular expression into a match program</fsummary>
- <type>
- <v>Regexp = iodata()</v>
- </type>
<desc>
- <p>The same as <c>compile(Regexp,[])</c></p>
+ <p>The same as <c>compile(<anno>Regexp</anno>,[])</c></p>
</desc>
</func>
<func>
- <name>compile(Regexp,Options) -> {ok, MP} | {error, ErrSpec}</name>
+ <name name="compile" arity="2"/>
<fsummary>Compile a regular expression into a match program</fsummary>
- <type>
- <v>Regexp = iodata() | <seealso marker="unicode#type-charlist">io:charlist()</seealso></v>
- <v>Options = [ Option ]</v>
- <v>Option = <seealso marker="#type-compile_option">compile_option()</seealso></v>
- <v>NLSpec = <seealso marker="#type-nl_spec">nl_spec()</seealso></v>
- <v>MP = <seealso marker="#type-mp">mp()</seealso></v>
- <v>ErrSpec = {ErrString, Position}</v>
- <v>ErrString = string()</v>
- <v>Position = non_neg_integer()</v>
- </type>
<desc>
<p>This function compiles a regular expression with the syntax
described below into an internal format to be used later as a
@@ -165,44 +152,23 @@ This option makes it possible to include comments inside complicated patterns. N
</func>
<func>
- <name>run(Subject,RE) -> {match, Captured} | nomatch</name>
+ <name name="run" arity="2"/>
<fsummary>Match a subject against regular expression and capture subpatterns</fsummary>
- <type>
- <v>Subject = iodata() | <seealso marker="unicode#type-charlist">io:charlist()</seealso></v>
- <v>RE = <seealso marker="#type-mp">mp()</seealso> | iodata()</v>
- <v>Captured = [ CaptureData ]</v>
- <v>CaptureData = {integer(),integer()}</v>
- </type>
<desc>
- <p>The same as <c>run(Subject,RE,[])</c>.</p>
+ <p>The same as <c>run(<anno>Subject</anno>,<anno>RE</anno>,[])</c>.</p>
</desc>
</func>
<func>
- <name>run(Subject,RE,Options) -> {match, Captured} | match | nomatch</name>
+ <name name="run" arity="3"/>
+ <type_desc variable="CompileOpt">See <seealso marker="#compile_options">compile/2</seealso> above.</type_desc>
<fsummary>Match a subject against regular expression and capture subpatterns</fsummary>
- <type>
- <v>Subject = iodata() | <seealso marker="unicode#type-charlist">io:charlist()</seealso></v>
- <v>RE = <seealso marker="#type-mp">mp()</seealso> | iodata() | <seealso marker="unicode#type-charlist">io:charlist()</seealso></v>
- <v>Options = [ Option ]</v>
- <v>Option = anchored | global | notbol | noteol | notempty | {offset, integer() >= 0} | {newline, NLSpec} | bsr_anycrlf | bsr_unicode | {capture, ValueSpec} | {capture, ValueSpec, Type} | CompileOpt</v>
- <v>Type = index | list | binary</v>
- <v>ValueSpec = all | all_but_first | first | none | ValueList</v>
- <v>ValueList = [ ValueID ]</v>
- <v>ValueID = integer() | string() | atom()</v>
- <v>CompileOpt = <seealso marker="#type-compile_option">compile_option()</seealso></v>
- <d>See <seealso marker="#compile_options">compile/2</seealso> above.</d>
- <v>NLSpec = <seealso marker="#type-nl_spec">nl_spec()</seealso></v>
- <v>Captured = [ CaptureData ] | [ [ CaptureData ] ... ]</v>
- <v>CaptureData = {integer(),integer()} | ListConversionData | binary()</v>
- <v>ListConversionData = string() | {error, string(), binary()} | {incomplete, string(), binary()}</v>
- </type>
<desc>
<p>Executes a regexp matching, returning <c>match/{match,
- Captured}</c> or <c>nomatch</c>. The regular expression can be
+ <anno>Captured</anno>}</c> or <c>nomatch</c>. The regular expression can be
given either as <c>iodata()</c> in which case it is
automatically compiled (as by <c>re:compile/2</c>) and executed,
- or as a pre compiled <c>mp()</c> in which case it is executed
+ or as a pre-compiled <c>mp()</c> in which case it is executed
against the subject directly.</p>
<p>When compilation is involved, the exception <c>badarg</c> is
@@ -214,23 +180,23 @@ This option makes it possible to include comments inside complicated patterns. N
list can only contain the options <c>anchored</c>,
<c>global</c>, <c>notbol</c>, <c>noteol</c>,
<c>notempty</c>, <c>{offset, integer() >= 0}</c>, <c>{newline,
- NLSpec}</c> and <c>{capture, ValueSpec}/{capture, ValueSpec,
- Type}</c>. Otherwise all options valid for the
+ <anno>NLSpec</anno>}</c> and <c>{capture, <anno>ValueSpec</anno>}/{capture, <anno>ValueSpec</anno>,
+ <anno>Type</anno>}</c>. Otherwise all options valid for the
<c>re:compile/2</c> function are allowed as well. Options
allowed both for compilation and execution of a match, namely
- <c>anchored</c> and <c>{newline, NLSpec}</c>, will affect both
+ <c>anchored</c> and <c>{newline, <anno>NLSpec</anno>}</c>, will affect both
the compilation and execution if present together with a non
pre-compiled regular expression.</p>
<p>If the regular expression was previously compiled with the
- option <c>unicode</c>, the <c>Subject</c> should be provided as
+ option <c>unicode</c>, the <c><anno>Subject</anno></c> should be provided as
a valid Unicode <c>charlist()</c>, otherwise any <c>iodata()</c>
will do. If compilation is involved and the option
- <c>unicode</c> is given, both the <c>Subject</c> and the regular
+ <c>unicode</c> is given, both the <c><anno>Subject</anno></c> and the regular
expression should be given as valid Unicode
<c>charlists()</c>.</p>
- <p>The <c>{capture, ValueSpec}/{capture, ValueSpec, Type}</c>
+ <p>The <c>{capture, <anno>ValueSpec</anno>}/{capture, <anno>ValueSpec</anno>, <anno>Type</anno>}</c>
defines what to return from the function upon successful
matching. The <c>capture</c> tuple may contain both a
value specification telling which of the captured
@@ -244,9 +210,9 @@ This option makes it possible to include comments inside complicated patterns. N
at all is to be done (<c>{capture, none}</c>), the function will
return the single atom <c>match</c> upon successful matching,
otherwise the tuple
- <c>{match, ValueList}</c> is returned. Disabling capturing can
+ <c>{match, <anno>ValueList</anno>}</c> is returned. Disabling capturing can
be done either by specifying <c>none</c> or an empty list as
- <c>ValueSpec</c>.</p>
+ <c><anno>ValueSpec</anno></c>.</p>
<p>The options relevant for execution are:</p>
@@ -266,7 +232,7 @@ This option makes it possible to include comments inside complicated patterns. N
Perl). Each match is returned as a separate
<c>list()</c> containing the specific match as well as any
matching subexpressions (or as specified by the <c>capture
- option</c>). The <c>Captured</c> part of the return value will
+ option</c>). The <c><anno>Captured</anno></c> part of the return value will
hence be a <c>list()</c> of <c>list()</c>s when this
option is given.</p>
@@ -362,7 +328,7 @@ This option makes it possible to include comments inside complicated patterns. N
subject string. The offset is zero-based, so that the default is
<c>{offset,0}</c> (all of the subject string).</item>
- <tag><c>{newline, NLSpec}</c></tag>
+ <tag><c>{newline, <anno>NLSpec</anno>}</c></tag>
<item>
<p>Override the default definition of a newline in the subject string, which is LF (ASCII 10) in Erlang.</p>
<taglist>
@@ -383,7 +349,7 @@ This option makes it possible to include comments inside complicated patterns. N
<tag><c>bsr_unicode</c></tag>
<item>Specifies specifically that \R is to match all the Unicode newline characters (including crlf etc, the default).(overrides compilation option)</item>
- <tag><c>{capture, ValueSpec}</c>/<c>{capture, ValueSpec, Type}</c></tag>
+ <tag><c>{capture, <anno>ValueSpec</anno>}</c>/<c>{capture, <anno>ValueSpec</anno>, <anno>Type</anno>}</c></tag>
<item>
<p>Specifies which captured substrings are returned and in what
@@ -392,7 +358,7 @@ This option makes it possible to include comments inside complicated patterns. N
substring as well as all capturing subpatterns (all of the
pattern is automatically captured). The default return type is
(zero-based) indexes of the captured parts of the string, given as
- <c>{Offset,Length}</c> pairs (the <c>index</c> <c>Type</c> of
+ <c>{Offset,Length}</c> pairs (the <c>index</c> <c><anno>Type</anno></c> of
capturing).</p>
<p>As an example of the default behavior, the following call:</p>
@@ -422,8 +388,8 @@ This option makes it possible to include comments inside complicated patterns. N
<p>The capture tuple is built up as follows:</p>
<taglist>
- <tag><c>ValueSpec</c></tag>
- <item><p>Specifies which captured (sub)patterns are to be returned. The ValueSpec can either be an atom describing a predefined set of return values, or a list containing either the indexes or the names of specific subpatterns to return.</p>
+ <tag><c><anno>ValueSpec</anno></c></tag>
+ <item><p>Specifies which captured (sub)patterns are to be returned. The <c><anno>ValueSpec</anno></c> can either be an atom describing a predefined set of return values, or a list containing either the indexes or the names of specific subpatterns to return.</p>
<p>The predefined sets of subpatterns are:</p>
<taglist>
<tag><c>all</c></tag>
@@ -437,7 +403,7 @@ This option makes it possible to include comments inside complicated patterns. N
</taglist>
<p>The value list is a list of indexes for the subpatterns to return, where index 0 is for all of the pattern, and 1 is for the first explicit capturing subpattern in the regular expression, and so forth. When using named captured subpatterns (see below) in the regular expression, one can use <c>atom()</c>s or <c>string()</c>s to specify the subpatterns to be returned. For example, consider the regular expression:</p>
<code> ".*(abcd).*"</code>
- <p>matched against the string ""ABCabcdABC", capturing only the "abcd" part (the first explicit subpattern):</p>
+ <p>matched against the string "ABCabcdABC", capturing only the "abcd" part (the first explicit subpattern):</p>
<code> re:run("ABCabcdABC",".*(abcd).*",[{capture,[1]}]).</code>
<p>The call will yield the following result:</p>
<code> {match,[{3,4}]}</code>
@@ -460,8 +426,8 @@ This option makes it possible to include comments inside complicated patterns. N
or list respectively.</p>
</item>
- <tag><c>Type</c></tag>
- <item><p>Optionally specifies how captured substrings are to be returned. If omitted, the default of <c>index</c> is used. The <c>Type</c> can be one of the following:</p>
+ <tag><c><anno>Type</anno></c></tag>
+ <item><p>Optionally specifies how captured substrings are to be returned. If omitted, the default of <c>index</c> is used. The <c><anno>Type</anno></c> can be one of the following:</p>
<taglist>
<tag><c>index</c></tag>
<item>Return captured substrings as pairs of byte indexes into the subject string and length of the matching string in the subject (as if the subject string was flattened with <c>iolist_to_binary/1</c> or <c>unicode:characters_to_binary/2</c> prior to matching). Note that the <c>unicode</c> option results in <em>byte-oriented</em> indexes in a (possibly virtual) <em>UTF-8 encoded</em> binary. A byte index tuple <c>{0,2}</c> might therefore represent one or two characters when <c>unicode</c> is in effect. This might seem counter-intuitive, but has been deemed the most effective and useful way to way to do it. To return lists instead might result in simpler code if that is desired. This return type is the default.</item>
@@ -478,7 +444,7 @@ This option makes it possible to include comments inside complicated patterns. N
<code> "ABCabcdABC"</code>
<p>the subpattern at index 2 won't match, as "abdd" is not present in the string, but the complete pattern matches (due to the alternative <c>a(..d)</c>. The subpattern at index 2 is therefore unassigned and the default return value will be:</p>
<code> {match,[{0,10},{3,4},{-1,0},{4,3}]}</code>
- <p>Setting the capture <c>Type</c> to <c>binary</c> would give the following:</p>
+ <p>Setting the capture <c><anno>Type</anno></c> to <c>binary</c> would give the following:</p>
<code> {match,[&lt;&lt;"ABCabcdABC"&gt;&gt;,&lt;&lt;"abcd"&gt;&gt;,&lt;&lt;&gt;&gt;,&lt;&lt;"bcd"&gt;&gt;]}</code>
<p>where the empty binary (<c>&lt;&lt;&gt;&gt;</c>) represents the unassigned subpattern. In the <c>binary</c> case, some information about the matching is therefore lost, the <c>&lt;&lt;&gt;&gt;</c> might just as well be an empty string captured.</p>
<p>If differentiation between empty matches and non existing subpatterns is necessary, use the <c>type</c> <c>index</c>
@@ -524,8 +490,8 @@ This option makes it possible to include comments inside complicated patterns. N
<p>The replacement string can contain the special character
<c>&amp;</c>, which inserts the whole matching expression in the
- result, and the special sequence <c>\</c>N (where N is an
- integer &gt; 0), resulting in the subexpression number N will be
+ result, and the special sequence <c>\</c>N (where N is an integer &gt; 0),
+ <c>\g</c>N or <c>\g{</c>N<c>}</c> resulting in the subexpression number N will be
inserted in the result. If no subexpression with that number is
generated by the regular expression, nothing is inserted.</p>
<p>To insert an <c>&amp;</c> or <c>\</c> in the result, precede it
diff --git a/lib/stdlib/doc/src/sofs.xml b/lib/stdlib/doc/src/sofs.xml
index 2e7768a1df..37c41501ae 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>2011</year>
+ <year>2001</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -317,7 +317,7 @@
but is to be preferred since it makes it possible to handle this
case even more efficiently. Examples of SetFuns:</p>
<pre>
-{sofs, union}
+fun sofs:union/1
fun(S) -> sofs:partition(1, S) end
{external, fun(A) -> A end}
{external, fun({A,_,C}) -> {C,A} end}
@@ -711,7 +711,7 @@ fun(S) -> sofs:partition(1, S) end
argument.</p>
<pre>
1> <input>F1 = sofs:from_term([{a,[[1,2],[2,3]]},{b,[[]]}]),</input>
-<input>F2 = sofs:family_projection({sofs, union}, F1),</input>
+<input>F2 = sofs:family_projection(fun sofs:union/1, F1),</input>
<input>sofs:to_external(F2).</input>
[{a,[1,2,3]},{b,[]}]</pre>
</desc>
@@ -821,7 +821,7 @@ fun(S) -> sofs:partition(1, S) end
<input>sofs:to_external(F2).</input>
[{a,[1,2,3]},{b,[]}]</pre>
<p><c>family_union(F)</c> is equivalent to
- <c>family_projection({sofs,union},&nbsp;F)</c>.</p>
+ <c>family_projection(fun sofs:union/1,&nbsp;F)</c>.</p>
</desc>
</func>
<func>
@@ -1438,7 +1438,7 @@ true</pre>
1> <input>R1 = sofs:relation([{a,1},{b,2}]),</input>
<input>R2 = sofs:relation([{x,1},{x,2},{y,3}]),</input>
<input>S1 = sofs:from_sets([R1,R2]),</input>
-<input>S2 = sofs:specification({sofs,is_a_function}, S1),</input>
+<input>S2 = sofs:specification(fun sofs:is_a_function/1, S1),</input>
<input>sofs:to_external(S2).</input>
[[{a,1},{b,2}]]</pre>
</desc>
diff --git a/lib/stdlib/doc/src/string.xml b/lib/stdlib/doc/src/string.xml
index 48867ffe72..549c871aed 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>2011</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -255,18 +255,12 @@ sub_string("Hello World", 4, 8).
</desc>
</func>
<func>
- <name>to_float(String) -> {Float,Rest} | {error,Reason} </name>
+ <name name="to_float" arity="1"/>
<fsummary>Returns a float whose text representation is the integers (ASCII values) in String.</fsummary>
- <type>
- <v>String = string()</v>
- <v>Float = float()</v>
- <v>Rest = string()</v>
- <v>Reason = no_float | not_a_list</v>
- </type>
<desc>
- <p>Argument <c>String</c> is expected to start with a valid text
+ <p>Argument <c><anno>String</anno></c> is expected to start with a valid text
represented float (the digits being ASCII values). Remaining characters
- in the string after the float are returned in <c>Rest</c>.</p>
+ in the string after the float are returned in <c><anno>Rest</anno></c>.</p>
<p>Example:</p>
<code type="none">
> {F1,Fs} = string:to_float("1.0-1.0e-1"),
@@ -280,18 +274,12 @@ sub_string("Hello World", 4, 8).
</desc>
</func>
<func>
- <name>to_integer(String) -> {Int,Rest} | {error,Reason} </name>
+ <name name="to_integer" arity="1"/>
<fsummary>Returns an integer whose text representation is the integers (ASCII values) in String.</fsummary>
- <type>
- <v>String = string()</v>
- <v>Int = integer()</v>
- <v>Rest = string()</v>
- <v>Reason = no_integer | not_a_list</v>
- </type>
<desc>
- <p>Argument <c>String</c> is expected to start with a valid text
+ <p>Argument <c><anno>String</anno></c> is expected to start with a valid text
represented integer (the digits being ASCII values). Remaining characters
- in the string after the integer are returned in <c>Rest</c>.</p>
+ in the string after the integer are returned in <c><anno>Rest</anno></c>.</p>
<p>Example:</p>
<code type="none">
> {I1,Is} = string:to_integer("33+22"),
diff --git a/lib/stdlib/doc/src/supervisor.xml b/lib/stdlib/doc/src/supervisor.xml
index 33a7f5bb6a..f9a5e245b4 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>2011</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -55,7 +55,8 @@
monitoring its child processes. The basic idea of a supervisor is
that it should keep its child processes alive by restarting them
when necessary.</p>
- <p>The children of a supervisor is defined as a list of <em>child specifications</em>. When the supervisor is started, the child
+ <p>The children of a supervisor is defined as a list of
+ <em>child specifications</em>. When the supervisor is started, the child
processes are started in order from left to right according to
this list. When the supervisor terminates, it first terminates
its child processes in reversed start order, from right to left.</p>
@@ -100,7 +101,8 @@
</item>
</list>
<p>To prevent a supervisor from getting into an infinite loop of
- child process terminations and restarts, a <em>maximum restart frequency</em> is defined using two integer values <c>MaxR</c>
+ child process terminations and restarts, a <em>maximum restart frequency</em>
+ is defined using two integer values <c>MaxR</c>
and <c>MaxT</c>. If more than <c>MaxR</c> restarts occur within
<c>MaxT</c> seconds, the supervisor terminates all child
processes and then itself.
@@ -114,7 +116,7 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules}
M = F = atom()
A = [term()]
Restart = permanent | transient | temporary
- Shutdown = brutal_kill | int()>=0 | infinity
+ Shutdown = brutal_kill | int()>0 | infinity
Type = worker | supervisor
Modules = [Module] | dynamic
Module = atom()</pre>
@@ -197,7 +199,8 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules}
the callback module, if the child process is a supervisor,
gen_server or gen_fsm. If the child process is an event
manager (gen_event) with a dynamic set of callback modules,
- <c>Modules</c> should be <c>dynamic</c>. See <em>OTP Design Principles</em> for more information about release handling.</p>
+ <c>Modules</c> should be <c>dynamic</c>. See <em>OTP Design Principles</em>
+ for more information about release handling.</p>
</item>
<item>
<p>Internally, the supervisor also keeps track of the pid
@@ -264,8 +267,14 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules}
<p>If <c><anno>SupName</anno>={local,Name}</c> the supervisor is registered
locally as <c>Name</c> using <c>register/2</c>. If
<c><anno>SupName</anno>={global,Name}</c> the supervisor is registered
- globally as <c>Name</c> using <c>global:register_name/2</c>.
- If no name is provided, the supervisor is not registered.</p>
+ globally as <c>Name</c> using <c>global:register_name/2</c>. If
+ <c><anno>SupName</anno>={via,Module,Name}</c> the supervisor
+ is registered as <c>Name</c> using the registry represented by
+ <c>Module</c>. The <c>Module</c> callback should export the functions
+ <c>register_name/2</c>, <c>unregister_name/1</c> and <c>send/2</c>,
+ which should behave like the corresponding functions in <c>global</c>.
+ Thus, <c>{via,global,Name}</c> is a valid reference.</p>
+ <p>If no name is provided, the supervisor 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 which is passed as
the argument to <c><anno>Module</anno>:init/1</c>.</p>
@@ -308,6 +317,8 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules}
registered at another node, or</item>
<item><c>{global,Name}</c>, if the supervisor is globally
registered.</item>
+ <item><c>{via,Module,Name}</c>, if the supervisor is registered
+ through an alternative process registry.</item>
</list>
<p><c><anno>ChildSpec</anno></c> should be a valid child specification
(unless the supervisor is a <c>simple_one_for_one</c>
@@ -391,10 +402,11 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules}
<c>SupRef</c>.</p>
<p>If successful, the function returns <c>ok</c>. If the child
specification identified by <c><anno>Id</anno></c> exists but
- the corresponding child process is running, the function
- returns <c>{error,running}</c>. If the child specification
- identified by <c><anno>Id</anno></c> does not exist, the function returns
- <c>{error,not_found}</c>.</p>
+ the corresponding child process is running or about to be restarted,
+ the function returns <c>{error,running}</c> or
+ <c>{error,restarting}</c> respectively. If the child specification
+ identified by <c><anno>Id</anno></c> does not exist, the function
+ returns <c>{error,not_found}</c>.</p>
</desc>
</func>
<func>
@@ -434,7 +446,8 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules}
</func>
<func>
<name name="which_children" arity="1"/>
- <fsummary>Return information about all children specifications and child processes belonging to a supervisor.</fsummary>
+ <fsummary>Return information about all children specifications and
+ child processes belonging to a supervisor.</fsummary>
<desc>
<p>Returns a newly created list with information about all child
specifications and child processes belonging to
@@ -454,7 +467,8 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules}
</item>
<item>
<p><c><anno>Child</anno></c> - the pid of the corresponding child
- process, or <c>undefined</c> if there is no such process.</p>
+ process, the atom <c>restarting</c> if the process is about to be
+ restarted or <c>undefined</c> if there is no such process.</p>
</item>
<item>
<p><c><anno>Type</anno></c> - as defined in the child specification.</p>
@@ -467,7 +481,8 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules}
</func>
<func>
<name name="count_children" arity="1"/>
- <fsummary>Return counts for the number of childspecs, active children, supervisors and workers.</fsummary>
+ <fsummary>Return counts for the number of childspecs, active children,
+ supervisors and workers.</fsummary>
<desc>
<p>Returns a property list (see <c>proplists</c>) containing the
counts for each of the following elements of the supervisor's
@@ -517,7 +532,8 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules}
<v>Args = term()</v>
<v>Result = {ok,{{RestartStrategy,MaxR,MaxT},[ChildSpec]}} | ignore</v>
<v>&nbsp;RestartStrategy = <seealso marker="#type-strategy">strategy()</seealso></v>
- <v>&nbsp;MaxR = MaxT = integer()>=0</v>
+ <v>&nbsp;MaxR = integer()>=0</v>
+ <v>&nbsp;MaxT = integer()>0</v>
<v>&nbsp;ChildSpec = <seealso marker="#type-child_spec">child_spec()</seealso></v>
</type>
<desc>
diff --git a/lib/stdlib/doc/src/supervisor_bridge.xml b/lib/stdlib/doc/src/supervisor_bridge.xml
index c1a5e7947f..f6712d6c1d 100644
--- a/lib/stdlib/doc/src/supervisor_bridge.xml
+++ b/lib/stdlib/doc/src/supervisor_bridge.xml
@@ -63,6 +63,13 @@
If <c><anno>SupBridgeName</anno>={global,<anno>Name</anno>}</c> the supervisor_bridge is
registered globally as <c><anno>Name</anno></c> using
<c>global:register_name/2</c>.
+ If <c><anno>SupBridgeName</anno>={via,<anno>Module</anno>,<anno>Name</anno>}</c> the supervisor_bridge is
+ registered as <c><anno>Name</anno></c> using a registry represented
+ by <anno>Module</anno>. The <c>Module</c> callback should export
+ the functions <c>register_name/2</c>, <c>unregister_name/1</c>
+ and <c>send/2</c>, which should behave like the
+ corresponding functions in <c>global</c>. Thus,
+ <c>{via,global,GlobalName}</c> is a valid reference.
If no name is provided, the supervisor_bridge is not registered.
If there already exists a process with the specified
<c><anno>SupBridgeName</anno></c> the function returns
diff --git a/lib/stdlib/doc/src/unicode.xml b/lib/stdlib/doc/src/unicode.xml
index 1001ebbae4..1f6cbaccd7 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>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -130,34 +130,24 @@
</desc>
</func>
<func>
- <name>characters_to_list(Data, InEncoding) -> Result</name>
+ <name name="characters_to_list" arity="2"/>
<fsummary>Convert a collection of characters to list of Unicode characters</fsummary>
- <type>
- <v>Data = <seealso marker="#type-latin1_chardata">latin1_chardata()</seealso>
- | <seealso marker="#type-chardata">chardata()</seealso>
- | <seealso marker="#type-external_chardata">external_chardata()</seealso></v>
- <v>Result = list() | {error, list(), RestData} | {incomplete, list(), binary()}</v>
- <v>RestData = <seealso marker="#type-latin1_chardata">latin1_chardata()</seealso>
- | <seealso marker="#type-chardata">chardata()</seealso>
- | <seealso marker="#type-external_chardata">external_chardata()</seealso></v>
- <v>InEncoding = <seealso marker="#type-encoding">encoding()</seealso></v>
- </type>
<desc>
<p>This function converts a possibly deep list of integers and
binaries into a list of integers representing unicode
characters. The binaries in the input may have characters
encoded as latin1 (0 - 255, one character per byte), in which
- case the <c>InEncoding</c> parameter should be given as
+ case the <c><anno>InEncoding</anno></c> parameter should be given as
<c>latin1</c>, or have characters encoded as one of the
- UTF-encodings, which is given as the <c>InEncoding</c>
- parameter. Only when the <c>InEncoding</c> is one of the UTF
+ UTF-encodings, which is given as the <c><anno>InEncoding</anno></c>
+ parameter. Only when the <c><anno>InEncoding</anno></c> is one of the UTF
encodings, integers in the list are allowed to be grater than
255.</p>
- <p>If <c>InEncoding</c> is <c>latin1</c>, the <c>Data</c> parameter
+ <p>If <c><anno>InEncoding</anno></c> is <c>latin1</c>, the <c><anno>Data</anno></c> parameter
corresponds to the <c>iodata()</c> type, but for <c>unicode</c>,
- the <c>Data</c> parameter can contain integers greater than 255
+ the <c><anno>Data</anno></c> parameter can contain integers greater than 255
(unicode characters beyond the iso-latin-1 range), which would
make it invalid as <c>iodata()</c>.</p>
@@ -188,16 +178,16 @@
depth as the original data. The error occurs when traversing the
list and whatever's left to decode is simply returned as is.</p>
- <p>However, if the input <c>Data</c> is a pure binary, the third
+ <p>However, if the input <c><anno>Data</anno></c> is a pure binary, the third
part of the error tuple is guaranteed to be a binary as
well.</p>
<p>Errors occur for the following reasons:</p>
<list type="bulleted">
- <item>Integers out of range - If <c>InEncoding</c> is
+ <item>Integers out of range - If <c><anno>InEncoding</anno></c> is
<c>latin1</c>, an error occurs whenever an integer greater
- than 255 is found in the lists. If <c>InEncoding</c> is
+ than 255 is found in the lists. If <c><anno>InEncoding</anno></c> is
of a Unicode type, an error occurs whenever an integer
<list type="bulleted">
<item>greater than <c>16#10FFFF</c>
@@ -208,7 +198,7 @@
is found.
</item>
- <item>UTF encoding incorrect - If <c>InEncoding</c> is
+ <item>UTF encoding incorrect - If <c><anno>InEncoding</anno></c> is
one of the UTF types, the bytes in any binaries have to be valid
in that encoding. Errors can occur for various
reasons, including &quot;pure&quot; decoding errors
@@ -220,7 +210,7 @@
number should have been encoded in fewer bytes. The
case of a truncated UTF is handled specially, see the
paragraph about incomplete binaries below. If
- <c>InEncoding</c> is <c>latin1</c>, binaries are always valid
+ <c><anno>InEncoding</anno></c> is <c>latin1</c>, binaries are always valid
as long as they contain whole bytes,
as each byte falls into the valid iso-latin-1 range.</item>
@@ -238,7 +228,7 @@
the first part of a (so far) valid UTF character.</p>
<p>If one UTF characters is split over two consecutive
- binaries in the <c>Data</c>, the conversion succeeds. This means
+ binaries in the <c><anno>Data</anno></c>, the conversion succeeds. This means
that a character can be decoded from a range of binaries as long
as the whole range is given as input without errors
occurring. Example:</p>
@@ -274,21 +264,11 @@
</desc>
</func>
<func>
- <name>characters_to_binary(Data,InEncoding) -> Result</name>
+ <name name="characters_to_binary" arity="2"/>
<fsummary>Convert a collection of characters to an UTF-8 binary</fsummary>
- <type>
- <v>Data = <seealso marker="#type-latin1_chardata">latin1_chardata()</seealso>
- | <seealso marker="#type-chardata">chardata()</seealso>
- | <seealso marker="#type-external_chardata">external_chardata()</seealso></v>
- <v>Result = binary() | {error, binary(), RestData} | {incomplete, binary(), binary()}</v>
- <v>RestData = <seealso marker="#type-latin1_chardata">latin1_chardata()</seealso>
- | <seealso marker="#type-chardata">chardata()</seealso>
- | <seealso marker="#type-external_chardata">external_chardata()</seealso></v>
- <v>InEncoding = <seealso marker="#type-encoding">encoding()</seealso></v>
- </type>
<desc>
- <p>Same as characters_to_binary(Data, InEncoding, unicode).</p>
+ <p>Same as characters_to_binary(<anno>Data</anno>, <anno>InEncoding</anno>, unicode).</p>
</desc>
</func>
<func>
diff --git a/lib/stdlib/doc/src/unicode_usage.xml b/lib/stdlib/doc/src/unicode_usage.xml
index a7e010a05f..bbcd49a934 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>2011</year>
+ <year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -53,7 +53,7 @@
<item>Basically the same as UTF-32, but without some Unicode semantics, defined by IEEE and has little use as a separate encoding standard. For all normal (and possibly abnormal) usages, UTF-32 and UCS-4 are interchangeable.</item>
</taglist>
<p>Certain ranges of characters are left unused and certain ranges are even deemed invalid. The most notable invalid range is 16#D800 - 16#DFFF, as the UTF-16 encoding does not allow for encoding of these numbers. It can be speculated that the UTF-16 encoding standard was, from the beginning, expected to be able to hold all Unicode characters in one 16-bit entity, but then had to be extended, leaving a hole in the Unicode range to cope with backward compatibility.</p>
-<p>Additionally, the codepoint 16#FEFF is used for byte order marks (BOM's) and use of that character is not encouraged in other contexts than that. It actually is valid though, as the character "ZWNBS" (Zero Width Non Breaking Space). BOM's are used to identify encodings and byte order for programs where such parameters are not known in advance. Byte order marks are more seldom used than one could expect, put their use is becoming more widely spread as they provide the means for programs to make educated guesses about the Unicode format of a certain file.</p>
+<p>Additionally, the codepoint 16#FEFF is used for byte order marks (BOM's) and use of that character is not encouraged in other contexts than that. It actually is valid though, as the character "ZWNBS" (Zero Width Non Breaking Space). BOM's are used to identify encodings and byte order for programs where such parameters are not known in advance. Byte order marks are more seldom used than one could expect, but their use is becoming more widely spread as they provide the means for programs to make educated guesses about the Unicode format of a certain file.</p>
</section>
<section>
<title>Standard Unicode representation in Erlang</title>
@@ -210,6 +210,12 @@ Eshell V5.7 (abort with ^G)
</section>
</section>
<section>
+<title>Unicode in environment variables and parameters</title>
+<p>Environment variables and their interpretation is handled much in the same way as file names. If Unicode file names are enabled, environment variables as well as parameters to the Erlang VM are expected to be in Unicode.</p>
+<p>If Unicode file names are enabled, the calls to <seealso marker="kernel:os#getenv/0"><c>os:getenv/0</c></seealso>, <seealso marker="kernel:os#getenv/1"><c>os:getenv/1</c></seealso> and <seealso marker="kernel:os#putenv/2"><c>os:putenv/2</c></seealso> will handle Unicode strings. On Unix-like platforms, the built-in functions will translate environment variables in UTF-8 to/from Unicode strings, possibly with codepoints > 255. On Windows the Unicode versions of the environment system API will be used, also allowing for codepoints > 255.</p>
+<p>On Unix-like operating systems, parameters are expected to be UTF-8 without translation if Unicode file names are enabled.</p>
+</section>
+<section>
<title>Unicode-aware modules</title>
<p>Most of the modules in Erlang/OTP are of course Unicode-unaware in the sense that they have no notion of Unicode and really shouldn't have. Typically they handle non-textual or byte-oriented data (like <c>gen_tcp</c> etc).</p>
<p>Modules that actually handle textual data (like <c>io_lib</c>, <c>string</c> etc) are sometimes subject to conversion or extension to be able to handle Unicode characters.</p>
diff --git a/lib/stdlib/examples/Makefile b/lib/stdlib/examples/Makefile
index 25c88d1de3..198aceb3a9 100644
--- a/lib/stdlib/examples/Makefile
+++ b/lib/stdlib/examples/Makefile
@@ -47,6 +47,6 @@ RELSYSDIR = $(RELEASE_PATH)/lib/stdlib-$(STDLIB_VSN)/examples
EXAMPLES = erl_id_trans.erl
release_spec:
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(EXAMPLES) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(EXAMPLES) "$(RELSYSDIR)"
release_docs_spec:
diff --git a/lib/stdlib/examples/erl_id_trans.erl b/lib/stdlib/examples/erl_id_trans.erl
index 72e41d6473..34c6ecc394 100644
--- a/lib/stdlib/examples/erl_id_trans.erl
+++ b/lib/stdlib/examples/erl_id_trans.erl
@@ -283,15 +283,6 @@ gexpr({call,Line,{remote,La,{atom,Lb,erlang},{atom,Lc,F}},As0}) ->
true -> As1 = gexpr_list(As0),
{call,Line,{remote,La,{atom,Lb,erlang},{atom,Lc,F}},As1}
end;
-% Unfortunately, writing calls as {M,F}(...) is also allowed.
-gexpr({call,Line,{tuple,La,[{atom,Lb,erlang},{atom,Lc,F}]},As0}) ->
- case erl_internal:guard_bif(F, length(As0)) or
- erl_internal:arith_op(F, length(As0)) or
- erl_internal:comp_op(F, length(As0)) or
- erl_internal:bool_op(F, length(As0)) of
- true -> As1 = gexpr_list(As0),
- {call,Line,{tuple,La,[{atom,Lb,erlang},{atom,Lc,F}]},As1}
- end;
gexpr({bin,Line,Fs}) ->
Fs2 = pattern_grp(Fs),
{bin,Line,Fs2};
diff --git a/lib/stdlib/src/Makefile b/lib/stdlib/src/Makefile
index 90e239b00f..14304824d3 100644
--- a/lib/stdlib/src/Makefile
+++ b/lib/stdlib/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -167,6 +167,7 @@ docs:
# This is a trick so that the preloaded files will get the correct type
# specifications.
primary_bootstrap_compiler: \
+ $(BOOTSTRAP_COMPILER)/ebin/epp.beam \
$(BOOTSTRAP_COMPILER)/ebin/erl_scan.beam \
$(BOOTSTRAP_COMPILER)/ebin/erl_parse.beam \
$(BOOTSTRAP_COMPILER)/ebin/erl_lint.beam \
@@ -198,13 +199,13 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) erl_parse.yrl $(RELSYSDIR)/src
- $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) erl_parse.yrl "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/stdlib/src/binary.erl b/lib/stdlib/src/binary.erl
index cb1e12ae46..1ed3422bc5 100644
--- a/lib/stdlib/src/binary.erl
+++ b/lib/stdlib/src/binary.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -18,29 +18,185 @@
%%
-module(binary).
%%
-%% The following functions implemented as BIF's
-%% binary:compile_pattern/1
-%% binary:match/{2,3}
-%% binary:matches/{2,3}
-%% binary:longest_common_prefix/1
-%% binary:longest_common_suffix/1
-%% binary:first/1
-%% binary:last/1
-%% binary:at/2
-%% binary:part/{2,3}
-%% binary:bin_to_list/{1,2,3}
-%% binary:list_to_bin/1
-%% binary:copy/{1,2}
-%% binary:referenced_byte_size/1
-%% binary:decode_unsigned/{1,2}
-%% - Not yet:
-%%
%% Implemented in this module:
-export([split/2,split/3,replace/3,replace/4]).
--opaque cp() :: tuple().
+-opaque cp() :: {'am' | 'bm', binary()}.
-type part() :: {Start :: non_neg_integer(), Length :: integer()}.
+%%% BIFs.
+
+-export([at/2, bin_to_list/1, bin_to_list/2, bin_to_list/3,
+ compile_pattern/1, copy/1, copy/2, decode_unsigned/1,
+ decode_unsigned/2, encode_unsigned/1, encode_unsigned/2,
+ first/1, last/1, list_to_bin/1, longest_common_prefix/1,
+ longest_common_suffix/1, match/2, match/3, matches/2,
+ matches/3, part/2, part/3, referenced_byte_size/1]).
+
+-spec at(Subject, Pos) -> byte() when
+ Subject :: binary(),
+ Pos :: non_neg_integer().
+
+at(_, _) ->
+ erlang:nif_error(undef).
+
+-spec bin_to_list(Subject) -> [byte()] when
+ Subject :: binary().
+
+bin_to_list(_) ->
+ erlang:nif_error(undef).
+
+-spec bin_to_list(Subject, PosLen) -> [byte()] when
+ Subject :: binary(),
+ PosLen :: part().
+
+bin_to_list(_, _) ->
+ erlang:nif_error(undef).
+
+-spec bin_to_list(Subject, Pos, Len) -> [byte()] when
+ Subject :: binary(),
+ Pos :: non_neg_integer(),
+ Len :: non_neg_integer().
+
+bin_to_list(_, _, _) ->
+ erlang:nif_error(undef).
+
+-spec compile_pattern(Pattern) -> cp() when
+ Pattern :: binary() | [binary()].
+
+compile_pattern(_) ->
+ erlang:nif_error(undef).
+
+-spec copy(Subject) -> binary() when
+ Subject :: binary().
+
+copy(_) ->
+ erlang:nif_error(undef).
+
+-spec copy(Subject, N) -> binary() when
+ Subject :: binary(),
+ N :: non_neg_integer().
+
+copy(_, _) ->
+ erlang:nif_error(undef).
+
+-spec decode_unsigned(Subject) -> Unsigned when
+ Subject :: binary(),
+ Unsigned :: non_neg_integer().
+
+decode_unsigned(_) ->
+ erlang:nif_error(undef).
+
+-spec decode_unsigned(Subject, Endianess) -> Unsigned when
+ Subject :: binary(),
+ Endianess :: big | little,
+ Unsigned :: non_neg_integer().
+
+decode_unsigned(_, _) ->
+ erlang:nif_error(undef).
+
+-spec encode_unsigned(Unsigned) -> binary() when
+ Unsigned :: non_neg_integer().
+
+encode_unsigned(_) ->
+ erlang:nif_error(undef).
+
+-spec encode_unsigned(Unsigned, Endianess) -> binary() when
+ Unsigned :: non_neg_integer(),
+ Endianess :: big | little.
+
+encode_unsigned(_, _) ->
+ erlang:nif_error(undef).
+
+-spec first(Subject) -> byte() when
+ Subject :: binary().
+
+first(_) ->
+ erlang:nif_error(undef).
+
+-spec last(Subject) -> byte() when
+ Subject :: binary().
+
+last(_) ->
+ erlang:nif_error(undef).
+
+-spec list_to_bin(ByteList) -> binary() when
+ ByteList :: iodata().
+
+list_to_bin(_) ->
+ erlang:nif_error(undef).
+
+-spec longest_common_prefix(Binaries) -> non_neg_integer() when
+ Binaries :: [binary()].
+
+longest_common_prefix(_) ->
+ erlang:nif_error(undef).
+
+-spec longest_common_suffix(Binaries) -> non_neg_integer() when
+ Binaries :: [binary()].
+
+longest_common_suffix(_) ->
+ erlang:nif_error(undef).
+
+-spec match(Subject, Pattern) -> Found | nomatch when
+ Subject :: binary(),
+ Pattern :: binary() | [binary()] | cp(),
+ Found :: part().
+
+match(_, _) ->
+ erlang:nif_error(undef).
+
+-spec match(Subject, Pattern, Options) -> Found | nomatch when
+ Subject :: binary(),
+ Pattern :: binary() | [binary()] | cp(),
+ Found :: part(),
+ Options :: [Option],
+ Option :: {scope, part()}.
+
+match(_, _, _) ->
+ erlang:nif_error(undef).
+
+-spec matches(Subject, Pattern) -> Found when
+ Subject :: binary(),
+ Pattern :: binary() | [binary()] | cp(),
+ Found :: [part()].
+
+matches(_, _) ->
+ erlang:nif_error(undef).
+
+-spec matches(Subject, Pattern, Options) -> Found when
+ Subject :: binary(),
+ Pattern :: binary() | [binary()] | cp(),
+ Found :: [part()],
+ Options :: [Option],
+ Option :: {scope, part()}.
+
+matches(_, _, _) ->
+ erlang:nif_error(undef).
+
+-spec part(Subject, PosLen) -> binary() when
+ Subject :: binary(),
+ PosLen :: part().
+
+part(_, _) ->
+ erlang:nif_error(undef).
+
+-spec part(Subject, Pos, Len) -> binary() when
+ Subject :: binary(),
+ Pos :: non_neg_integer(),
+ Len :: non_neg_integer().
+
+part(_, _, _) ->
+ erlang:nif_error(undef).
+
+-spec referenced_byte_size(Binary) -> non_neg_integer() when
+ Binary :: binary().
+
+referenced_byte_size(_) ->
+ erlang:nif_error(undef).
+
+%%% End of BIFs.
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% split
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/lib/stdlib/src/dets.erl b/lib/stdlib/src/dets.erl
index c0f9ce34b0..6a937f8fa2 100644
--- a/lib/stdlib/src/dets.erl
+++ b/lib/stdlib/src/dets.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -319,7 +319,7 @@ foldr(Fun, Acc, Tab) ->
foldl(Fun, Acc, Tab) ->
Ref = make_ref(),
- do_traverse(Fun, Acc, Tab, Ref).
+ badarg(do_traverse(Fun, Acc, Tab, Ref), [Fun, Acc, Tab]).
-spec from_ets(Name, EtsTab) -> 'ok' | {'error', Reason} when
Name :: tab_name(),
@@ -515,7 +515,7 @@ match(Tab, Pat) ->
Reason :: term().
match(Tab, Pat, N) ->
- badarg(init_chunk_match(Tab, Pat, bindings, N), [Tab, Pat, N]).
+ badarg(init_chunk_match(Tab, Pat, bindings, N, no_safe), [Tab, Pat, N]).
-spec match(Continuation) ->
{[Match], Continuation2} | '$end_of_table' | {'error', Reason} when
@@ -525,7 +525,7 @@ match(Tab, Pat, N) ->
Reason :: term().
match(State) when State#dets_cont.what =:= bindings ->
- badarg(chunk_match(State), [State]);
+ badarg(chunk_match(State, no_safe), [State]);
match(Term) ->
erlang:error(badarg, [Term]).
@@ -538,26 +538,26 @@ match_delete(Tab, Pat) ->
badarg(match_delete(Tab, Pat, delete), [Tab, Pat]).
match_delete(Tab, Pat, What) ->
- safe_fixtable(Tab, true),
case compile_match_spec(What, Pat) of
{Spec, MP} ->
- Proc = dets_server:get_pid(Tab),
- R = req(Proc, {match_delete_init, MP, Spec}),
- do_match_delete(Tab, Proc, R, What, 0);
+ case catch dets_server:get_pid(Tab) of
+ {'EXIT', _Reason} ->
+ badarg;
+ Proc ->
+ R = req(Proc, {match_delete_init, MP, Spec}),
+ do_match_delete(Proc, R, What, 0)
+ end;
badarg ->
badarg
end.
-do_match_delete(Tab, _Proc, {done, N1}, select, N) ->
- safe_fixtable(Tab, false),
+do_match_delete(_Proc, {done, N1}, select, N) ->
N + N1;
-do_match_delete(Tab, _Proc, {done, _N1}, _What, _N) ->
- safe_fixtable(Tab, false),
+do_match_delete(_Proc, {done, _N1}, _What, _N) ->
ok;
-do_match_delete(Tab, Proc, {cont, State, N1}, What, N) ->
- do_match_delete(Tab, Proc, req(Proc, {match_delete, State}), What, N+N1);
-do_match_delete(Tab, _Proc, Error, _What, _N) ->
- safe_fixtable(Tab, false),
+do_match_delete(Proc, {cont, State, N1}, What, N) ->
+ do_match_delete(Proc, req(Proc, {match_delete, State}), What, N+N1);
+do_match_delete(_Proc, Error, _What, _N) ->
Error.
-spec match_object(Name, Pattern) -> Objects | {'error', Reason} when
@@ -579,7 +579,7 @@ match_object(Tab, Pat) ->
Reason :: term().
match_object(Tab, Pat, N) ->
- badarg(init_chunk_match(Tab, Pat, object, N), [Tab, Pat, N]).
+ badarg(init_chunk_match(Tab, Pat, object, N, no_safe), [Tab, Pat, N]).
-spec match_object(Continuation) ->
{Objects, Continuation2} | '$end_of_table' | {'error', Reason} when
@@ -589,7 +589,7 @@ match_object(Tab, Pat, N) ->
Reason :: term().
match_object(State) when State#dets_cont.what =:= object ->
- badarg(chunk_match(State), [State]);
+ badarg(chunk_match(State, no_safe), [State]);
match_object(Term) ->
erlang:error(badarg, [Term]).
@@ -712,7 +712,7 @@ select(Tab, Pat) ->
Reason :: term().
select(Tab, Pat, N) ->
- badarg(init_chunk_match(Tab, Pat, select, N), [Tab, Pat, N]).
+ badarg(init_chunk_match(Tab, Pat, select, N, no_safe), [Tab, Pat, N]).
-spec select(Continuation) ->
{Selection, Continuation2} | '$end_of_table' | {'error', Reason} when
@@ -722,7 +722,7 @@ select(Tab, Pat, N) ->
Reason :: term().
select(State) when State#dets_cont.what =:= select ->
- badarg(chunk_match(State), [State]);
+ badarg(chunk_match(State, no_safe), [State]);
select(Term) ->
erlang:error(badarg, [Term]).
@@ -898,7 +898,7 @@ traverse(Tab, Fun) ->
throw({Ref, Other})
end
end,
- do_traverse(TFun, [], Tab, Ref).
+ badarg(do_traverse(TFun, [], Tab, Ref), [Tab, Fun]).
-spec update_counter(Name, Key, Increment) -> Result when
Name :: tab_name(),
@@ -929,20 +929,21 @@ where(Tab, Object) ->
badarg(treq(Tab, {where, Object}), [Tab, Object]).
do_traverse(Fun, Acc, Tab, Ref) ->
- safe_fixtable(Tab, true),
- Proc = dets_server:get_pid(Tab),
- try
- do_trav(Proc, Acc, Fun)
- catch {Ref, Result} ->
- Result
- after
- safe_fixtable(Tab, false)
+ case catch dets_server:get_pid(Tab) of
+ {'EXIT', _Reason} ->
+ badarg;
+ Proc ->
+ try
+ do_trav(Proc, Acc, Fun)
+ catch {Ref, Result} ->
+ Result
+ end
end.
do_trav(Proc, Acc, Fun) ->
{Spec, MP} = compile_match_spec(object, '_'),
%% MP not used
- case req(Proc, {match, MP, Spec, default}) of
+ case req(Proc, {match, MP, Spec, default, safe}) of
{cont, State} ->
do_trav(State, Proc, Acc, Fun);
Error ->
@@ -952,7 +953,7 @@ do_trav(Proc, Acc, Fun) ->
do_trav(#dets_cont{bin = eof}, _Proc, Acc, _Fun) ->
Acc;
do_trav(State, Proc, Acc, Fun) ->
- case req(Proc, {match_init, State}) of
+ case req(Proc, {match_init, State, safe}) of
{cont, {Bins, NewState}} ->
do_trav_bins(NewState, Proc, Acc, Fun, lists:reverse(Bins));
Error ->
@@ -972,44 +973,47 @@ do_trav_bins(State, Proc, Acc, Fun, [Bin | Bins]) ->
end.
safe_match(Tab, Pat, What) ->
- safe_fixtable(Tab, true),
- R = do_safe_match(init_chunk_match(Tab, Pat, What, default), []),
- safe_fixtable(Tab, false),
- R.
+ do_safe_match(init_chunk_match(Tab, Pat, What, default, safe), []).
do_safe_match({error, Error}, _L) ->
{error, Error};
do_safe_match({L, C}, LL) ->
- do_safe_match(chunk_match(C), L++LL);
+ do_safe_match(chunk_match(C, safe), L++LL);
do_safe_match('$end_of_table', L) ->
L;
do_safe_match(badarg, _L) ->
badarg.
%% What = object | bindings | select
-init_chunk_match(Tab, Pat, What, N) when is_integer(N), N >= 0;
- N =:= default ->
+init_chunk_match(Tab, Pat, What, N, Safe) when is_integer(N), N >= 0;
+ N =:= default ->
case compile_match_spec(What, Pat) of
{Spec, MP} ->
- Proc = dets_server:get_pid(Tab),
- case req(Proc, {match, MP, Spec, N}) of
- {done, L} ->
- {L, #dets_cont{tab = Tab, proc = Proc, what = What,
- bin = eof}};
- {cont, State} ->
- chunk_match(State#dets_cont{what = What, tab = Tab,
- proc = Proc});
- Error ->
- Error
+ case catch dets_server:get_pid(Tab) of
+ {'EXIT', _Reason} ->
+ badarg;
+ Proc ->
+ case req(Proc, {match, MP, Spec, N, Safe}) of
+ {done, L} ->
+ {L, #dets_cont{tab = Tab, proc = Proc,
+ what = What, bin = eof}};
+ {cont, State} ->
+ chunk_match(State#dets_cont{what = What,
+ tab = Tab,
+ proc = Proc},
+ Safe);
+ Error ->
+ Error
+ end
end;
badarg ->
badarg
end;
-init_chunk_match(_Tab, _Pat, _What, _) ->
+init_chunk_match(_Tab, _Pat, _What, _N, _Safe) ->
badarg.
-chunk_match(#dets_cont{proc = Proc}=State) ->
- case req(Proc, {match_init, State}) of
+chunk_match(#dets_cont{proc = Proc}=State, Safe) ->
+ case req(Proc, {match_init, State, Safe}) of
'$end_of_table'=Reply ->
Reply;
{cont, {Bins, NewState}} ->
@@ -1024,7 +1028,7 @@ chunk_match(#dets_cont{proc = Proc}=State) ->
badarg
end;
[] ->
- chunk_match(NewState);
+ chunk_match(NewState, Safe);
Terms ->
{Terms, NewState}
end;
@@ -1301,7 +1305,7 @@ open_file_loop(Head, N) ->
%% - wait 1 ms after each update.
%% next is normally followed by lookup, but since lookup is also
%% used when not traversing the table, it is not prioritized.
- ?DETS_CALL(From, {match_init, _State} = Op) ->
+ ?DETS_CALL(From, {match_init, _State, _Safe} = Op) ->
do_apply_op(Op, From, Head, N);
?DETS_CALL(From, {bchunk, _State} = Op) ->
do_apply_op(Op, From, Head, N);
@@ -1558,12 +1562,17 @@ apply_op(Op, From, Head, N) ->
H2;
{lookup_keys, _Keys} ->
stream_op(Op, From, [], Head, N);
- {match_init, State} ->
- {H2, Res} = fmatch_init(Head, State),
+ {match_init, State, Safe} ->
+ {H1, Res} = fmatch_init(Head, State),
+ H2 = case Res of
+ {cont,_} -> H1;
+ _ when Safe =:= no_safe-> H1;
+ _ when Safe =:= safe -> do_safe_fixtable(H1, From, false)
+ end,
From ! {self(), Res},
H2;
- {match, MP, Spec, NObjs} ->
- {H2, Res} = fmatch(Head, MP, Spec, NObjs),
+ {match, MP, Spec, NObjs, Safe} ->
+ {H2, Res} = fmatch(Head, MP, Spec, NObjs, Safe, From),
From ! {self(), Res},
H2;
{member, Key} when Head#head.version =:= 8 ->
@@ -1577,11 +1586,15 @@ apply_op(Op, From, Head, N) ->
From ! {self(), Res},
H2;
{match_delete, State} when Head#head.update_mode =:= dirty ->
- {H2, Res} = fmatch_delete(Head, State),
+ {H1, Res} = fmatch_delete(Head, State),
+ H2 = case Res of
+ {cont,_S,_N} -> H1;
+ _ -> do_safe_fixtable(H1, From, false)
+ end,
From ! {self(), Res},
{N + 1, H2};
{match_delete_init, MP, Spec} when Head#head.update_mode =:= dirty ->
- {H2, Res} = fmatch_delete_init(Head, MP, Spec),
+ {H2, Res} = fmatch_delete_init(Head, MP, Spec, From),
From ! {self(), Res},
{N + 1, H2};
{safe_fixtable, Bool} ->
@@ -2229,13 +2242,18 @@ fmatch_init(Head, C) ->
end.
%% -> {NewHead, Result}
-fmatch(Head, MP, Spec, N) ->
+fmatch(Head, MP, Spec, N, Safe, From) ->
KeyPos = Head#head.keypos,
case find_all_keys(Spec, KeyPos, []) of
[] ->
%% Complete match
case catch write_cache(Head) of
- {NewHead, []} ->
+ {Head1, []} ->
+ NewHead =
+ case Safe of
+ safe -> do_safe_fixtable(Head1, From, true);
+ no_safe -> Head1
+ end,
C0 = init_scan(NewHead, N),
{NewHead, {cont, C0#dets_cont{match_program = MP}}};
{NewHead, _} = HeadError when is_record(NewHead, head) ->
@@ -2300,12 +2318,12 @@ contains_variable(_) ->
false.
%% -> {NewHead, Res}
-fmatch_delete_init(Head, MP, Spec) ->
+fmatch_delete_init(Head, MP, Spec, From) ->
KeyPos = Head#head.keypos,
case catch
case find_all_keys(Spec, KeyPos, []) of
[] ->
- do_fmatch_delete_var_keys(Head, MP, Spec);
+ do_fmatch_delete_var_keys(Head, MP, Spec, From);
List ->
Keys = lists:usort(List),
do_fmatch_constant_keys(Head, Keys, MP)
@@ -2336,7 +2354,7 @@ fmatch_delete(Head, C) ->
end
end.
-do_fmatch_delete_var_keys(Head, _MP, ?PATTERN_TO_TRUE_MATCH_SPEC('_'))
+do_fmatch_delete_var_keys(Head, _MP, ?PATTERN_TO_TRUE_MATCH_SPEC('_'), _From)
when Head#head.fixed =:= false ->
%% Handle the case where the file is emptied efficiently.
%% Empty the cache just to get the number of objects right.
@@ -2348,8 +2366,9 @@ do_fmatch_delete_var_keys(Head, _MP, ?PATTERN_TO_TRUE_MATCH_SPEC('_'))
Reply ->
Reply
end;
-do_fmatch_delete_var_keys(Head, MP, _Spec) ->
- {NewHead, []} = write_cache(Head),
+do_fmatch_delete_var_keys(Head, MP, _Spec, From) ->
+ Head1 = do_safe_fixtable(Head, From, true),
+ {NewHead, []} = write_cache(Head1),
C0 = init_scan(NewHead, default),
{NewHead, {cont, C0#dets_cont{match_program = MP}, 0}}.
diff --git a/lib/stdlib/src/digraph_utils.erl b/lib/stdlib/src/digraph_utils.erl
index e221be15a1..807b5c12a1 100644
--- a/lib/stdlib/src/digraph_utils.erl
+++ b/lib/stdlib/src/digraph_utils.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -370,5 +370,5 @@ condense('$end_of_table', _T, _SC, _G, _SCG, _I2C) ->
condense(I, T, SC, G, SCG, I2C) ->
[{_,C}] = ets:lookup(I2C, I),
digraph:add_vertex(SCG, C),
- digraph:add_edge(SCG, SC, C),
+ [digraph:add_edge(SCG, SC, C) || C =/= SC],
condense(ets:next(T, I), T, SC, G, SCG, I2C).
diff --git a/lib/stdlib/src/epp.erl b/lib/stdlib/src/epp.erl
index ccc14610d7..2c8d84a9e1 100644
--- a/lib/stdlib/src/epp.erl
+++ b/lib/stdlib/src/epp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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/lib/stdlib/src/erl_compile.erl b/lib/stdlib/src/erl_compile.erl
index ff032b129c..81bec21a3f 100644
--- a/lib/stdlib/src/erl_compile.erl
+++ b/lib/stdlib/src/erl_compile.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -57,17 +57,7 @@ compile_cmdline(List) ->
end.
my_halt(Reason) ->
- case process_info(group_leader(), status) of
- {_,waiting} ->
- %% Now all output data is down in the driver.
- %% Give the driver some extra time before halting.
- receive after 1 -> ok end,
- halt(Reason);
- _ ->
- %% Probably still processing I/O requests.
- erlang:yield(),
- my_halt(Reason)
- end.
+ erlang:halt(Reason).
%% Run the the compiler in a separate process, trapping EXITs.
diff --git a/lib/stdlib/src/erl_eval.erl b/lib/stdlib/src/erl_eval.erl
index bf3c7b3504..95ba6b1096 100644
--- a/lib/stdlib/src/erl_eval.erl
+++ b/lib/stdlib/src/erl_eval.erl
@@ -947,7 +947,6 @@ type_test(integer) -> is_integer;
type_test(float) -> is_float;
type_test(number) -> is_number;
type_test(atom) -> is_atom;
-type_test(constant) -> is_constant;
type_test(list) -> is_list;
type_test(tuple) -> is_tuple;
type_test(pid) -> is_pid;
diff --git a/lib/stdlib/src/erl_expand_records.erl b/lib/stdlib/src/erl_expand_records.erl
index 1c69a131f9..9759a8f001 100644
--- a/lib/stdlib/src/erl_expand_records.erl
+++ b/lib/stdlib/src/erl_expand_records.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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/lib/stdlib/src/erl_internal.erl b/lib/stdlib/src/erl_internal.erl
index cd3b531d10..3063881890 100644
--- a/lib/stdlib/src/erl_internal.erl
+++ b/lib/stdlib/src/erl_internal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -287,6 +287,7 @@ bif(group_leader, 0) -> true;
bif(group_leader, 2) -> true;
bif(halt, 0) -> true;
bif(halt, 1) -> true;
+bif(halt, 2) -> true;
bif(hd, 1) -> true;
bif(integer_to_list, 1) -> true;
bif(integer_to_list, 2) -> true;
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl
index cfbcf54d95..1e5f962375 100644
--- a/lib/stdlib/src/erl_lint.erl
+++ b/lib/stdlib/src/erl_lint.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -248,6 +248,8 @@ format_error({illegal_guard_local_call, {F,A}}) ->
io_lib:format("call to local/imported function ~w/~w is illegal in guard",
[F,A]);
format_error(illegal_guard_expr) -> "illegal guard expression";
+format_error(deprecated_tuple_fun) ->
+ "tuple funs are deprecated and will be removed in R16";
%% --- exports ---
format_error({explicit_export,F,A}) ->
io_lib:format("in this release, the call to ~w/~w must be written "
@@ -363,6 +365,12 @@ format_error(callback_wrong_arity) ->
format_error({imported_predefined_type, Name}) ->
io_lib:format("referring to built-in type ~w as a remote type; "
"please take out the module name", [Name]);
+format_error({not_exported_opaque, {TypeName, Arity}}) ->
+ io_lib:format("opaque type ~w~s is not exported",
+ [TypeName, gen_type_paren(Arity)]);
+format_error({underspecified_opaque, {TypeName, Arity}}) ->
+ io_lib:format("opaque type ~w~s is underspecified and therefore meaningless",
+ [TypeName, gen_type_paren(Arity)]);
%% --- obsolete? unused? ---
format_error({format_error, {Fmt, Args}}) ->
io_lib:format(Fmt, Args);
@@ -849,7 +857,8 @@ post_traversal_check(Forms, St0) ->
StC = check_untyped_records(Forms, StB),
StD = check_on_load(StC),
StE = check_unused_records(Forms, StD),
- check_callback_information(StE).
+ StF = check_local_opaque_types(StE),
+ check_callback_information(StF).
%% check_behaviour(State0) -> State
%% Check that the behaviour attribute is valid.
@@ -1914,8 +1923,6 @@ gexpr({call,Line,{remote,_Lr,{atom,_Lm,erlang},{atom,_Lf,F}},As}, Vt, St0) ->
true -> {Asvt,St1};
false -> {Asvt,add_error(Line, illegal_guard_expr, St1)}
end;
-gexpr({call,L,{tuple,Lt,[{atom,Lm,erlang},{atom,Lf,F}]},As}, Vt, St) ->
- gexpr({call,L,{remote,Lt,{atom,Lm,erlang},{atom,Lf,F}},As}, Vt, St);
gexpr({op,Line,Op,A}, Vt, St0) ->
{Avt,St1} = gexpr(A, Vt, St0),
case is_gexpr_op(Op, 1) of
@@ -2554,15 +2561,24 @@ find_field(_F, []) -> error.
%% Attr :: 'type' | 'opaque'
%% Checks that a type definition is valid.
+-record(typeinfo, {attr, line}).
+
type_def(_Attr, _Line, {record, _RecName}, Fields, [], St0) ->
%% The record field names and such are checked in the record format.
%% We only need to check the types.
Types = [T || {typed_record_field, _, T} <- Fields],
check_type({type, -1, product, Types}, St0);
-type_def(_Attr, Line, TypeName, ProtoType, Args, St0) ->
+type_def(Attr, Line, TypeName, ProtoType, Args, St0) ->
TypeDefs = St0#lint.types,
Arity = length(Args),
TypePair = {TypeName, Arity},
+ Info = #typeinfo{attr = Attr, line = Line},
+ StoreType =
+ fun(St) ->
+ NewDefs = dict:store(TypePair, Info, TypeDefs),
+ CheckType = {type, -1, product, [ProtoType|Args]},
+ check_type(CheckType, St#lint{types=NewDefs})
+ end,
case (dict:is_key(TypePair, TypeDefs) orelse is_var_arity_type(TypeName)) of
true ->
case dict:is_key(TypePair, default_types()) of
@@ -2572,20 +2588,29 @@ type_def(_Attr, Line, TypeName, ProtoType, Args, St0) ->
true ->
Warn = {new_builtin_type, TypePair},
St1 = add_warning(Line, Warn, St0),
- NewDefs = dict:store(TypePair, Line, TypeDefs),
- CheckType = {type, -1, product, [ProtoType|Args]},
- check_type(CheckType, St1#lint{types=NewDefs});
+ StoreType(St1);
false ->
add_error(Line, {builtin_type, TypePair}, St0)
end;
false -> add_error(Line, {redefine_type, TypePair}, St0)
end;
false ->
- NewDefs = dict:store(TypePair, Line, TypeDefs),
- CheckType = {type, -1, product, [ProtoType|Args]},
- check_type(CheckType, St0#lint{types=NewDefs})
+ St1 = case
+ Attr =:= opaque andalso
+ is_underspecified(ProtoType, Arity)
+ of
+ true ->
+ Warn = {underspecified_opaque, TypePair},
+ add_warning(Line, Warn, St0);
+ false -> St0
+ end,
+ StoreType(St1)
end.
+is_underspecified({type,_,term,[]}, 0) -> true;
+is_underspecified({type,_,any,[]}, 0) -> true;
+is_underspecified(_ProtType, _Arity) -> false.
+
check_type(Types, St) ->
{SeenVars, St1} = check_type(Types, dict:new(), St),
dict:fold(fun(Var, {seen_once, Line}, AccSt) ->
@@ -2895,7 +2920,7 @@ check_unused_types(Forms, #lint{usage=Usage, types=Ts, exp_types=ExpTs}=St) ->
fun(_Type, -1, AccSt) ->
%% Default type
AccSt;
- (Type, FileLine, AccSt) ->
+ (Type, #typeinfo{line = FileLine}, AccSt) ->
case loc(FileLine) of
{FirstFile, _} ->
case gb_sets:is_member(Type, UsedTypes) of
@@ -2914,6 +2939,24 @@ check_unused_types(Forms, #lint{usage=Usage, types=Ts, exp_types=ExpTs}=St) ->
St
end.
+check_local_opaque_types(St) ->
+ #lint{types=Ts, exp_types=ExpTs} = St,
+ FoldFun =
+ fun(_Type, -1, AccSt) ->
+ %% Default type
+ AccSt;
+ (_Type, #typeinfo{attr = type}, AccSt) ->
+ AccSt;
+ (Type, #typeinfo{attr = opaque, line = FileLine}, AccSt) ->
+ case gb_sets:is_element(Type, ExpTs) of
+ true -> AccSt;
+ false ->
+ Warn = {not_exported_opaque,Type},
+ add_warning(FileLine, Warn, AccSt)
+ end
+ end,
+ dict:fold(FoldFun, St, Ts).
+
%% icrt_clauses(Clauses, In, ImportVarTable, State) ->
%% {NewVts,State}.
@@ -3436,17 +3479,11 @@ obsolete_guard({call,Line,{atom,Lr,F},As}, St0) ->
false ->
deprecated_function(Line, erlang, F, As, St0);
true ->
- St1 = case F of
- constant ->
- deprecated_function(Lr, erlang, is_constant, As, St0);
- _ ->
- St0
- end,
- case is_warn_enabled(obsolete_guard, St1) of
+ case is_warn_enabled(obsolete_guard, St0) of
true ->
- add_warning(Lr,{obsolete_guard, {F, Arity}}, St1);
+ add_warning(Lr,{obsolete_guard, {F, Arity}}, St0);
false ->
- St1
+ St0
end
end;
obsolete_guard(_G, St) ->
diff --git a/lib/stdlib/src/erl_scan.erl b/lib/stdlib/src/erl_scan.erl
index 10b2ed2e49..8e59e01f48 100644
--- a/lib/stdlib/src/erl_scan.erl
+++ b/lib/stdlib/src/erl_scan.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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/lib/stdlib/src/error_logger_file_h.erl b/lib/stdlib/src/error_logger_file_h.erl
index 08f1873803..e9364ed787 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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/lib/stdlib/src/error_logger_tty_h.erl b/lib/stdlib/src/error_logger_tty_h.erl
index 48e069a407..ad5891f191 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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/lib/stdlib/src/escript.erl b/lib/stdlib/src/escript.erl
index ad49d89908..498d850df3 100644
--- a/lib/stdlib/src/escript.erl
+++ b/lib/stdlib/src/escript.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -22,7 +22,7 @@
-export([script_name/0, create/2, extract/2]).
%% Internal API.
--export([start/0, start/1]).
+-export([start/0, start/1, parse_file/1]).
%%-----------------------------------------------------------------------
@@ -346,7 +346,8 @@ parse_and_run(File, Args, Options) ->
case Source of
archive ->
{ok, FileInfo} = file:read_file_info(File),
- case code:set_primary_archive(File, FormsOrBin, FileInfo) of
+ case code:set_primary_archive(File, FormsOrBin, FileInfo,
+ fun escript:parse_file/1) of
ok when CheckOnly ->
case code:load_file(Module) of
{module, _} ->
@@ -396,6 +397,19 @@ parse_and_run(File, Args, Options) ->
%% Parse script
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Only used as callback by erl_prim_loader
+parse_file(File) ->
+ try parse_file(File, false) of
+ {_Source, _Module, FormsOrBin, _HasRecs, _Mode}
+ when is_binary(FormsOrBin) ->
+ {ok, FormsOrBin};
+ _ ->
+ {error, no_archive_bin}
+ catch
+ throw:Reason ->
+ {error, Reason}
+ end.
+
parse_file(File, CheckOnly) ->
{HeaderSz, NextLineNo, Fd, Sections} =
parse_header(File, false),
@@ -848,17 +862,7 @@ fatal(Str) ->
throw(Str).
my_halt(Reason) ->
- case process_info(group_leader(), status) of
- {_,waiting} ->
- %% Now all output data is down in the driver.
- %% Give the driver some extra time before halting.
- receive after 1 -> ok end,
- halt(Reason);
- _ ->
- %% Probably still processing I/O requests.
- erlang:yield(),
- my_halt(Reason)
- end.
+ erlang:halt(Reason).
hidden_apply(App, M, F, Args) ->
try
diff --git a/lib/stdlib/src/ets.erl b/lib/stdlib/src/ets.erl
index afa914a456..ee6cff1b75 100644
--- a/lib/stdlib/src/ets.erl
+++ b/lib/stdlib/src/ets.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -42,11 +42,16 @@
-export([i/0, i/1, i/2, i/3]).
--export_type([tab/0, tid/0, match_spec/0]).
+-export_type([tab/0, tid/0, match_spec/0, comp_match_spec/0]).
%%-----------------------------------------------------------------------------
+-type access() :: public | protected | private.
-type tab() :: atom() | tid().
+-type type() :: set | ordered_set | bag | duplicate_bag.
+-type continuation() :: '$end_of_table'
+ | {tab(),integer(),integer(),binary(),list(),integer()}
+ | {tab(),_,_,integer(),binary(),list(),integer(),integer()}.
%% a similar definition is also in erl_types
-opaque tid() :: integer().
@@ -57,59 +62,398 @@
%%-----------------------------------------------------------------------------
-%% The following functions used to be found in this module, but
-%% are now BIFs (i.e. implemented in C).
-%%
-%% all/0
-%% new/2
-%% delete/1
-%% delete/2
-%% first/1
-%% info/1
-%% info/2
-%% safe_fixtable/2
-%% lookup/2
-%% lookup_element/3
-%% insert/2
-%% is_compiled_ms/1
-%% last/1
-%% member/2
-%% next/2
-%% prev/2
-%% rename/2
-%% slot/2
-%% match/1
-%% match/2
-%% match/3
-%% match_object/1
-%% match_object/2
-%% match_object/3
-%% match_spec_compile/1
-%% match_spec_run_r/3
-%% select/1
-%% select/2
-%% select/3
-%% select_count/2
-%% select_reverse/1
-%% select_reverse/2
-%% select_reverse/3
-%% select_delete/2
-%% setopts/2
-%% update_counter/3
-%% update_element/3
-%%
+%%% BIFs
+
+-export([all/0, delete/1, delete/2, delete_all_objects/1,
+ delete_object/2, first/1, give_away/3, info/1, info/2,
+ insert/2, insert_new/2, is_compiled_ms/1, last/1, lookup/2,
+ lookup_element/3, match/1, match/2, match/3, match_object/1,
+ match_object/2, match_object/3, match_spec_compile/1,
+ match_spec_run_r/3, member/2, new/2, next/2, prev/2,
+ rename/2, safe_fixtable/2, select/1, select/2, select/3,
+ select_count/2, select_delete/2, select_reverse/1,
+ select_reverse/2, select_reverse/3, setopts/2, slot/2,
+ update_counter/3, update_element/3]).
+
+-spec all() -> [Tab] when
+ Tab :: tab().
+
+all() ->
+ erlang:nif_error(undef).
+
+-spec delete(Tab) -> true when
+ Tab :: tab().
+
+delete(_) ->
+ erlang:nif_error(undef).
+
+-spec delete(Tab, Key) -> true when
+ Tab :: tab(),
+ Key :: term().
+
+delete(_, _) ->
+ erlang:nif_error(undef).
+
+-spec delete_all_objects(Tab) -> true when
+ Tab :: tab().
+
+delete_all_objects(_) ->
+ erlang:nif_error(undef).
+
+-spec delete_object(Tab, Object) -> true when
+ Tab :: tab(),
+ Object :: tuple().
+
+delete_object(_, _) ->
+ erlang:nif_error(undef).
+
+-spec first(Tab) -> Key | '$end_of_table' when
+ Tab :: tab(),
+ Key :: term().
+
+first(_) ->
+ erlang:nif_error(undef).
+
+-spec give_away(Tab, Pid, GiftData) -> true when
+ Tab :: tab(),
+ Pid :: pid(),
+ GiftData :: term().
+
+give_away(_, _, _) ->
+ erlang:nif_error(undef).
+
+-spec info(Tab) -> InfoList | undefined when
+ Tab :: tab(),
+ InfoList :: [InfoTuple],
+ InfoTuple :: {compressed, boolean()}
+ | {heir, pid() | none}
+ | {keypos, pos_integer()}
+ | {memory, non_neg_integer()}
+ | {name, atom()}
+ | {named_table, boolean()}
+ | {node, node()}
+ | {owner, pid()}
+ | {protection, access()}
+ | {size, non_neg_integer()}
+ | {type, type()}.
+
+info(_) ->
+ erlang:nif_error(undef).
+
+-spec info(Tab, Item) -> Value | undefined when
+ Tab :: tab(),
+ Item :: compressed | fixed | heir | keypos | memory
+ | name | named_table | node | owner | protection
+ | safe_fixed | size | stats | type,
+ Value :: term().
+
+info(_, _) ->
+ erlang:nif_error(undef).
+
+-spec insert(Tab, ObjectOrObjects) -> true when
+ Tab :: tab(),
+ ObjectOrObjects :: tuple() | [tuple()].
+
+insert(_, _) ->
+ erlang:nif_error(undef).
+
+-spec insert_new(Tab, ObjectOrObjects) -> boolean() when
+ Tab :: tab(),
+ ObjectOrObjects :: tuple() | [tuple()].
+
+insert_new(_, _) ->
+ erlang:nif_error(undef).
+
+-spec is_compiled_ms(Term) -> boolean() when
+ Term :: term().
+
+is_compiled_ms(_) ->
+ erlang:nif_error(undef).
+
+-spec last(Tab) -> Key | '$end_of_table' when
+ Tab :: tab(),
+ Key :: term().
+
+last(_) ->
+ erlang:nif_error(undef).
+
+-spec lookup(Tab, Key) -> [Object] when
+ Tab :: tab(),
+ Key :: term(),
+ Object :: tuple().
+
+lookup(_, _) ->
+ erlang:nif_error(undef).
+
+-spec lookup_element(Tab, Key, Pos) -> Elem when
+ Tab :: tab(),
+ Key :: term(),
+ Pos :: pos_integer(),
+ Elem :: term() | [term()].
+
+lookup_element(_, _, _) ->
+ erlang:nif_error(undef).
+
+-spec match(Tab, Pattern) -> [Match] when
+ Tab :: tab(),
+ Pattern :: match_pattern(),
+ Match :: [term()].
+
+match(_, _) ->
+ erlang:nif_error(undef).
+
+-spec match(Tab, Pattern, Limit) -> {[Match], Continuation} |
+ '$end_of_table' when
+ Tab :: tab(),
+ Pattern :: match_pattern(),
+ Limit :: pos_integer(),
+ Match :: [term()],
+ Continuation :: continuation().
+
+match(_, _, _) ->
+ erlang:nif_error(undef).
+
+-spec match(Continuation) -> {[Match], Continuation} |
+ '$end_of_table' when
+ Match :: [term()],
+ Continuation :: continuation().
+
+match(_) ->
+ erlang:nif_error(undef).
+
+-spec match_object(Tab, Pattern) -> [Object] when
+ Tab :: tab(),
+ Pattern :: match_pattern(),
+ Object :: tuple().
+
+match_object(_, _) ->
+ erlang:nif_error(undef).
+
+-spec match_object(Tab, Pattern, Limit) -> {[Match], Continuation} |
+ '$end_of_table' when
+ Tab :: tab(),
+ Pattern :: match_pattern(),
+ Limit :: pos_integer(),
+ Match :: [term()],
+ Continuation :: continuation().
+
+match_object(_, _, _) ->
+ erlang:nif_error(undef).
+
+-spec match_object(Continuation) -> {[Match], Continuation} |
+ '$end_of_table' when
+ Match :: [term()],
+ Continuation :: continuation().
+
+match_object(_) ->
+ erlang:nif_error(undef).
+
+-spec match_spec_compile(MatchSpec) -> CompiledMatchSpec when
+ MatchSpec :: match_spec(),
+ CompiledMatchSpec :: comp_match_spec().
--opaque comp_match_spec() :: any(). %% this one is REALLY opaque
+match_spec_compile(_) ->
+ erlang:nif_error(undef).
--spec match_spec_run([tuple()], comp_match_spec()) -> [term()].
+-spec match_spec_run_r(List, CompiledMatchSpec, list()) -> list() when
+ List :: [tuple()],
+ CompiledMatchSpec :: comp_match_spec().
+
+match_spec_run_r(_, _, _) ->
+ erlang:nif_error(undef).
+
+-spec member(Tab, Key) -> boolean() when
+ Tab :: tab(),
+ Key :: term().
+
+member(_, _) ->
+ erlang:nif_error(undef).
+
+-spec new(Name, Options) -> tid() | atom() when
+ Name :: atom(),
+ Options :: [Option],
+ Option :: Type | Access | named_table | {keypos,Pos}
+ | {heir, Pid :: pid(), HeirData} | {heir, none} | Tweaks,
+ Type :: type(),
+ Access :: access(),
+ Tweaks :: {write_concurrency, boolean()}
+ | {read_concurrency, boolean()}
+ | compressed,
+ Pos :: pos_integer(),
+ HeirData :: term().
+
+new(_, _) ->
+ erlang:nif_error(undef).
+
+-spec next(Tab, Key1) -> Key2 | '$end_of_table' when
+ Tab :: tab(),
+ Key1 :: term(),
+ Key2 :: term().
+
+next(_, _) ->
+ erlang:nif_error(undef).
+
+-spec prev(Tab, Key1) -> Key2 | '$end_of_table' when
+ Tab :: tab(),
+ Key1 :: term(),
+ Key2 :: term().
+
+prev(_, _) ->
+ erlang:nif_error(undef).
+
+%% Shadowed by erl_bif_types: ets:rename/2
+-spec rename(Tab, Name) -> Name when
+ Tab :: tab(),
+ Name :: atom().
+
+rename(_, _) ->
+ erlang:nif_error(undef).
+
+-spec safe_fixtable(Tab, Fix) -> true when
+ Tab :: tab(),
+ Fix :: boolean().
+
+safe_fixtable(_, _) ->
+ erlang:nif_error(undef).
+
+-spec select(Tab, MatchSpec) -> [Match] when
+ Tab :: tab(),
+ MatchSpec :: match_spec(),
+ Match :: term().
+
+select(_, _) ->
+ erlang:nif_error(undef).
+
+-spec select(Tab, MatchSpec, Limit) -> {[Match],Continuation} |
+ '$end_of_table' when
+ Tab :: tab(),
+ MatchSpec :: match_spec(),
+ Limit :: pos_integer(),
+ Match :: term(),
+ Continuation :: continuation().
+
+select(_, _, _) ->
+ erlang:nif_error(undef).
+
+-spec select(Continuation) -> {[Match],Continuation} | '$end_of_table' when
+ Match :: term(),
+ Continuation :: continuation().
+
+select(_) ->
+ erlang:nif_error(undef).
+
+-spec select_count(Tab, MatchSpec) -> NumMatched when
+ Tab :: tab(),
+ MatchSpec :: match_spec(),
+ NumMatched :: non_neg_integer().
+
+select_count(_, _) ->
+ erlang:nif_error(undef).
+
+-spec select_delete(Tab, MatchSpec) -> NumDeleted when
+ Tab :: tab(),
+ MatchSpec :: match_spec(),
+ NumDeleted :: non_neg_integer().
+
+select_delete(_, _) ->
+ erlang:nif_error(undef).
+
+-spec select_reverse(Tab, MatchSpec) -> [Match] when
+ Tab :: tab(),
+ MatchSpec :: match_spec(),
+ Match :: term().
+
+select_reverse(_, _) ->
+ erlang:nif_error(undef).
+
+-spec select_reverse(Tab, MatchSpec, Limit) -> {[Match],Continuation} |
+ '$end_of_table' when
+ Tab :: tab(),
+ MatchSpec :: match_spec(),
+ Limit :: pos_integer(),
+ Match :: term(),
+ Continuation :: continuation().
+
+select_reverse(_, _, _) ->
+ erlang:nif_error(undef).
+
+-spec select_reverse(Continuation) -> {[Match],Continuation} |
+ '$end_of_table' when
+ Continuation :: continuation(),
+ Match :: term().
+
+select_reverse(_) ->
+ erlang:nif_error(undef).
+
+-spec setopts(Tab, Opts) -> true when
+ Tab :: tab(),
+ Opts :: Opt | [Opt],
+ Opt :: {heir, pid(), HeirData} | {heir,none},
+ HeirData :: term().
+
+setopts(_, _) ->
+ erlang:nif_error(undef).
+
+-spec slot(Tab, I) -> [Object] | '$end_of_table' when
+ Tab :: tab(),
+ I :: non_neg_integer(),
+ Object :: tuple().
+
+slot(_, _) ->
+ erlang:nif_error(undef).
+
+-spec update_counter(Tab, Key, UpdateOp) -> Result when
+ Tab :: tab(),
+ Key :: term(),
+ UpdateOp :: {Pos, Incr} | {Pos, Incr, Threshold, SetValue},
+ Pos :: integer(),
+ Incr :: integer(),
+ Threshold :: integer(),
+ SetValue :: integer(),
+ Result :: integer();
+ (Tab, Key, [UpdateOp]) -> [Result] when
+ Tab :: tab(),
+ Key :: term(),
+ UpdateOp :: {Pos, Incr} | {Pos, Incr, Threshold, SetValue},
+ Pos :: integer(),
+ Incr :: integer(),
+ Threshold :: integer(),
+ SetValue :: integer(),
+ Result :: integer();
+ (Tab, Key, Incr) -> Result when
+ Tab :: tab(),
+ Key :: term(),
+ Incr :: integer(),
+ Result :: integer().
+
+update_counter(_, _, _) ->
+ erlang:nif_error(undef).
+
+-spec update_element(Tab, Key, ElementSpec :: {Pos, Value}) -> boolean() when
+ Tab :: tab(),
+ Key :: term(),
+ Pos :: pos_integer(),
+ Value :: term();
+ (Tab, Key, ElementSpec :: [{Pos, Value}]) -> boolean() when
+ Tab :: tab(),
+ Key :: term(),
+ Pos :: pos_integer(),
+ Value :: term().
+
+update_element(_, _, _) ->
+ erlang:nif_error(undef).
+
+%%% End of BIFs
+
+-opaque comp_match_spec() :: binary(). %% this one is REALLY opaque
+
+-spec match_spec_run(List, CompiledMatchSpec) -> list() when
+ List :: [tuple()],
+ CompiledMatchSpec :: comp_match_spec().
match_spec_run(List, CompiledMS) ->
lists:reverse(ets:match_spec_run_r(List, CompiledMS, [])).
--type continuation() :: '$end_of_table'
- | {tab(),integer(),integer(),binary(),list(),integer()}
- | {tab(),_,_,integer(),binary(),list(),integer(),integer()}.
-
-spec repair_continuation(Continuation, MatchSpec) -> Continuation when
Continuation :: continuation(),
MatchSpec :: match_spec().
diff --git a/lib/stdlib/src/filelib.erl b/lib/stdlib/src/filelib.erl
index d532cea187..318f3b87b8 100644
--- a/lib/stdlib/src/filelib.erl
+++ b/lib/stdlib/src/filelib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -132,6 +132,8 @@ do_wildcard_comp({compiled_wildcard,{exists,File}}, Mod) ->
{ok,_} -> [File];
_ -> []
end;
+do_wildcard_comp({compiled_wildcard,[cwd,Base|Rest]}, Mod) ->
+ do_wildcard_1([Base], Rest, Mod);
do_wildcard_comp({compiled_wildcard,[Base|Rest]}, Mod) ->
do_wildcard_1([Base], Rest, Mod).
@@ -143,7 +145,11 @@ do_wildcard_comp({compiled_wildcard,{exists,File}}, Cwd, Mod) ->
{ok,_} -> [File];
_ -> []
end;
-do_wildcard_comp({compiled_wildcard,[current|Rest]}, Cwd0, Mod) ->
+do_wildcard_comp({compiled_wildcard,[cwd|Rest0]}, Cwd0, Mod) ->
+ case Rest0 of
+ [current|Rest] -> ok;
+ Rest -> ok
+ end,
{Cwd,PrefixLen} = case filename:join([Cwd0]) of
Bin when is_binary(Bin) -> {Bin,byte_size(Bin)+1};
Other -> {Other,length(Other)+1}
@@ -264,6 +270,9 @@ ensure_dir(F) ->
case do_is_dir(Dir, file) of
true ->
ok;
+ false when Dir =:= F ->
+ %% Protect against infinite loop
+ {error,einval};
false ->
ensure_dir(Dir),
case file:make_dir(Dir) of
@@ -292,6 +301,8 @@ do_wildcard_2([File|Rest], Pattern, Result, Mod) ->
do_wildcard_2([], _, Result, _Mod) ->
Result.
+do_wildcard_3(Base, [[double_star]|Rest], Result, Mod) ->
+ lists:sort(do_double_star(current, [Base], Rest, Result, Mod, true));
do_wildcard_3(Base, [Pattern|Rest], Result, Mod) ->
case do_list_dir(Base, Mod) of
{ok, Files0} ->
@@ -325,6 +336,8 @@ wildcard_5([question|Rest1], [_|Rest2]) ->
wildcard_5(Rest1, Rest2);
wildcard_5([accept], _) ->
true;
+wildcard_5([double_star], _) ->
+ true;
wildcard_5([star|Rest], File) ->
do_star(Rest, File);
wildcard_5([{one_of, Ordset}|Rest], [C|File]) ->
@@ -345,6 +358,21 @@ wildcard_5([], [_|_]) ->
wildcard_5([_|_], []) ->
false.
+do_double_star(Base, [H|T], Rest, Result, Mod, Root) ->
+ Full = join(Base, H),
+ Result1 = case do_list_dir(Full, Mod) of
+ {ok, Files} ->
+ do_double_star(Full, Files, Rest, Result, Mod, false);
+ _ -> Result
+ end,
+ Result2 = case Root andalso Rest == [] of
+ true -> Result1;
+ false -> do_wildcard_3(Full, Rest, Result1, Mod)
+ end,
+ do_double_star(Base, T, Rest, Result2, Mod, Root);
+do_double_star(_Base, [], _Rest, Result, _Mod, _Root) ->
+ Result.
+
do_star(Pattern, [X|Rest]) ->
case wildcard_5(Pattern, [X|Rest]) of
true -> true;
@@ -380,7 +408,10 @@ compile_wildcard_1(Pattern) ->
[Root|Rest] = filename:split(Pattern),
case filename:pathtype(Root) of
relative ->
- compile_wildcard_2([Root|Rest], current);
+ case compile_wildcard_2([Root|Rest], current) of
+ {exists,_}=Wc -> Wc;
+ [_|_]=Wc -> [cwd|Wc]
+ end;
_ ->
compile_wildcard_2(Rest, [Root])
end.
@@ -413,6 +444,10 @@ compile_part([$}|Rest], true, Result) ->
{ok, $}, lists:reverse(Result), Rest};
compile_part([$?|Rest], Upto, Result) ->
compile_part(Rest, Upto, [question|Result]);
+compile_part([$*,$*], Upto, Result) ->
+ compile_part([], Upto, [double_star|Result]);
+compile_part([$*,$*|Rest], Upto, Result) ->
+ compile_part(Rest, Upto, [star|Result]);
compile_part([$*], Upto, Result) ->
compile_part([], Upto, [accept|Result]);
compile_part([$*|Rest], Upto, Result) ->
diff --git a/lib/stdlib/src/filename.erl b/lib/stdlib/src/filename.erl
index dbfcbea4f7..a6b42cc68c 100644
--- a/lib/stdlib/src/filename.erl
+++ b/lib/stdlib/src/filename.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -726,6 +726,8 @@ nativename(Name0) ->
_ -> Name
end.
+win32_nativename(Name) when is_binary(Name) ->
+ binary:replace(Name, <<"/">>, <<"\\">>, [global]);
win32_nativename([$/|Rest]) ->
[$\\|win32_nativename(Rest)];
win32_nativename([C|Rest]) ->
diff --git a/lib/stdlib/src/gen.erl b/lib/stdlib/src/gen.erl
index 5d803091b6..42555aedd7 100644
--- a/lib/stdlib/src/gen.erl
+++ b/lib/stdlib/src/gen.erl
@@ -36,7 +36,7 @@
%%-----------------------------------------------------------------
-type linkage() :: 'link' | 'nolink'.
--type emgr_name() :: {'local', atom()} | {'global', term()}.
+-type emgr_name() :: {'local', atom()} | {'global', term()} | {via, atom(), term()}.
-type start_ret() :: {'ok', pid()} | 'ignore' | {'error', term()}.
@@ -53,7 +53,7 @@
%% start(GenMod, LinkP, Name, Mod, Args, Options)
%% GenMod = atom(), callback module implementing the 'real' fsm
%% LinkP = link | nolink
-%% Name = {local, atom()} | {global, term()}
+%% Name = {local, atom()} | {global, term()} | {via, atom(), term()}
%% Args = term(), init arguments (to Mod:init/1)
%% Options = [{timeout, Timeout} | {debug, [Flag]} | {spawn_opt, OptionList}]
%% Flag = trace | log | {logfile, File} | statistics | debug
@@ -158,9 +158,12 @@ call(Name, Label, Request, Timeout)
exit(noproc)
end;
%% Global by name
-call({global, _Name}=Process, Label, Request, Timeout)
- when Timeout =:= infinity;
- is_integer(Timeout), Timeout >= 0 ->
+call(Process, Label, Request, Timeout)
+ when ((tuple_size(Process) == 2 andalso element(1, Process) == global)
+ orelse
+ (tuple_size(Process) == 3 andalso element(1, Process) == via))
+ andalso
+ (Timeout =:= infinity orelse (is_integer(Timeout) andalso Timeout >= 0)) ->
case where(Process) of
Pid when is_pid(Pid) ->
Node = node(Pid),
@@ -274,6 +277,7 @@ reply({To, Tag}, Reply) ->
%%% Misc. functions.
%%%-----------------------------------------------------------------
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) ->
@@ -287,8 +291,16 @@ name_register({global, Name} = GN) ->
case global:register_name(Name, self()) of
yes -> true;
no -> {false, where(GN)}
+ end;
+name_register({via, Module, Name} = GN) ->
+ case Module:register_name(Name, self()) of
+ yes ->
+ true;
+ no ->
+ {false, where(GN)}
end.
+
timeout(Options) ->
case opt(timeout, Options) of
{ok, Time} ->
diff --git a/lib/stdlib/src/gen_event.erl b/lib/stdlib/src/gen_event.erl
index 3317b30e5c..2b8ba86909 100644
--- a/lib/stdlib/src/gen_event.erl
+++ b/lib/stdlib/src/gen_event.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -107,8 +107,10 @@
-type add_handler_ret() :: ok | term() | {'EXIT',term()}.
-type del_handler_ret() :: ok | term() | {'EXIT',term()}.
--type emgr_name() :: {'local', atom()} | {'global', atom()}.
--type emgr_ref() :: atom() | {atom(), atom()} | {'global', atom()} | pid().
+-type emgr_name() :: {'local', atom()} | {'global', atom()}
+ | {'via', atom(), term()}.
+-type emgr_ref() :: atom() | {atom(), atom()} | {'global', atom()}
+ | {'via', atom(), term()} | pid().
-type start_ret() :: {'ok', pid()} | {'error', term()}.
%%---------------------------------------------------------------------------
@@ -143,6 +145,7 @@ init_it(Starter, Parent, Name0, _, _, Options) ->
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().
@@ -209,6 +212,9 @@ call1(M, Handler, Query, Timeout) ->
send({global, Name}, Cmd) ->
catch global:send(Name, Cmd),
ok;
+send({via, Mod, Name}, Cmd) ->
+ catch Mod:send(Name, Cmd),
+ ok;
send(M, Cmd) ->
M ! Cmd,
ok.
diff --git a/lib/stdlib/src/gen_fsm.erl b/lib/stdlib/src/gen_fsm.erl
index 57734a075c..e480e2ac11 100644
--- a/lib/stdlib/src/gen_fsm.erl
+++ b/lib/stdlib/src/gen_fsm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -165,7 +165,7 @@
%%% start(Name, Mod, Args, Options)
%%% start_link(Mod, Args, Options)
%%% start_link(Name, Mod, Args, Options) where:
-%%% Name ::= {local, atom()} | {global, atom()}
+%%% Name ::= {local, atom()} | {global, atom()} | {via, atom(), term()}
%%% Mod ::= atom(), callback module implementing the 'real' fsm
%%% Args ::= term(), init arguments (to Mod:init/1)
%%% Options ::= [{debug, [Flag]}]
@@ -191,6 +191,9 @@ start_link(Name, Mod, Args, Options) ->
send_event({global, Name}, Event) ->
catch global:send(Name, {'$gen_event', Event}),
ok;
+send_event({via, Mod, Name}, Event) ->
+ catch Mod:send(Name, {'$gen_event', Event}),
+ ok;
send_event(Name, Event) ->
Name ! {'$gen_event', Event},
ok.
@@ -214,6 +217,9 @@ sync_send_event(Name, Event, Timeout) ->
send_all_state_event({global, Name}, Event) ->
catch global:send(Name, {'$gen_all_state_event', Event}),
ok;
+send_all_state_event({via, Mod, Name}, Event) ->
+ catch Mod:send(Name, {'$gen_all_state_event', Event}),
+ ok;
send_all_state_event(Name, Event) ->
Name ! {'$gen_all_state_event', Event},
ok.
@@ -273,7 +279,10 @@ cancel_timer(Ref) ->
enter_loop(Mod, Options, StateName, StateData) ->
enter_loop(Mod, Options, StateName, StateData, self(), infinity).
-enter_loop(Mod, Options, StateName, StateData, ServerName = {_,_}) ->
+enter_loop(Mod, Options, StateName, StateData, {Scope,_} = ServerName)
+ when Scope == local; Scope == global ->
+ enter_loop(Mod, Options, StateName, StateData, ServerName,infinity);
+enter_loop(Mod, Options, StateName, StateData, {via,_,_} = ServerName) ->
enter_loop(Mod, Options, StateName, StateData, ServerName,infinity);
enter_loop(Mod, Options, StateName, StateData, Timeout) ->
enter_loop(Mod, Options, StateName, StateData, self(), Timeout).
@@ -303,6 +312,15 @@ get_proc_name({global, Name}) ->
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() ->
@@ -320,7 +338,7 @@ name_to_pid(Name) ->
undefined ->
case global:whereis_name(Name) of
undefined ->
- exit(could_not_find_registerd_name);
+ exit(could_not_find_registered_name);
Pid ->
Pid
end;
@@ -367,12 +385,15 @@ init_it(Starter, Parent, Name0, Mod, Args, Options) ->
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.
diff --git a/lib/stdlib/src/gen_server.erl b/lib/stdlib/src/gen_server.erl
index af07bc988a..04308a51b7 100644
--- a/lib/stdlib/src/gen_server.erl
+++ b/lib/stdlib/src/gen_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -142,7 +142,7 @@
%%% start(Name, Mod, Args, Options)
%%% start_link(Mod, Args, Options)
%%% start_link(Name, Mod, Args, Options) where:
-%%% Name ::= {local, atom()} | {global, atom()}
+%%% Name ::= {local, atom()} | {global, atom()} | {via, atom(), term()}
%%% Mod ::= atom(), callback module implementing the 'real' server
%%% Args ::= term(), init arguments (to Mod:init/1)
%%% Options ::= [{timeout, Timeout} | {debug, [Flag]}]
@@ -194,6 +194,9 @@ call(Name, Request, Timeout) ->
cast({global,Name}, Request) ->
catch global:send(Name, cast_msg(Request)),
ok;
+cast({via, Mod, Name}, Request) ->
+ catch Mod:send(Name, cast_msg(Request)),
+ ok;
cast({Name,Node}=Dest, Request) when is_atom(Name), is_atom(Node) ->
do_cast(Dest, Request);
cast(Dest, Request) when is_atom(Dest) ->
@@ -266,7 +269,11 @@ multi_call(Nodes, Name, Req, Timeout)
enter_loop(Mod, Options, State) ->
enter_loop(Mod, Options, State, self(), infinity).
-enter_loop(Mod, Options, State, ServerName = {_, _}) ->
+enter_loop(Mod, Options, State, ServerName = {Scope, _})
+ when Scope == local; Scope == global ->
+ enter_loop(Mod, Options, State, ServerName, infinity);
+
+enter_loop(Mod, Options, State, ServerName = {via, _, _}) ->
enter_loop(Mod, Options, State, ServerName, infinity);
enter_loop(Mod, Options, State, Timeout) ->
@@ -327,12 +334,15 @@ init_it(Starter, Parent, Name0, Mod, Args, Options) ->
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.
@@ -827,6 +837,15 @@ get_proc_name({global, Name}) ->
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() ->
@@ -844,7 +863,7 @@ name_to_pid(Name) ->
undefined ->
case global:whereis_name(Name) of
undefined ->
- exit(could_not_find_registerd_name);
+ exit(could_not_find_registered_name);
Pid ->
Pid
end;
diff --git a/lib/stdlib/src/io_lib.erl b/lib/stdlib/src/io_lib.erl
index 0252cdf742..ab62b72519 100644
--- a/lib/stdlib/src/io_lib.erl
+++ b/lib/stdlib/src/io_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -82,7 +82,10 @@
-type chars() :: [char() | chars()].
-type depth() :: -1 | non_neg_integer().
--opaque continuation() :: {_, _, _, _}. % XXX: refine
+-opaque continuation() :: {Format :: string(),
+ Stack :: chars(),
+ Nchars :: non_neg_integer(),
+ Results :: [term()]}.
%%----------------------------------------------------------------------
diff --git a/lib/stdlib/src/lib.erl b/lib/stdlib/src/lib.erl
index 314fd60903..cf4b87d7eb 100644
--- a/lib/stdlib/src/lib.erl
+++ b/lib/stdlib/src/lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -209,7 +209,7 @@ explain_reason(badarg, error, [], _PF, _S) ->
explain_reason({badarg,V}, error=Cl, [], PF, S) -> % orelse, andalso
format_value(V, <<"bad argument: ">>, Cl, PF, S);
explain_reason(badarith, error, [], _PF, _S) ->
- <<"bad argument in an arithmetic expression">>;
+ <<"an error occurred when evaluating an arithmetic expression">>;
explain_reason({badarity,{Fun,As}}, error, [], _PF, _S)
when is_function(Fun) ->
%% Only the arity is displayed, not the arguments As.
diff --git a/lib/stdlib/src/lists.erl b/lib/stdlib/src/lists.erl
index e73c087753..961c060019 100644
--- a/lib/stdlib/src/lists.erl
+++ b/lib/stdlib/src/lists.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -33,9 +33,6 @@
keysort/2, keymerge/3, rkeymerge/3, rukeymerge/3,
ukeysort/2, ukeymerge/3, keymap/3]).
-%% Bifs: member/2, reverse/2
-%% Bifs: keymember/3, keysearch/3, keyfind/3
-
-export([merge/3, rmerge/3, sort/2, umerge/3, rumerge/3, usort/2]).
-export([all/2,any/2,map/2,flatmap/2,foldl/3,foldr/3,filter/2,
@@ -43,6 +40,60 @@
mapfoldl/3,mapfoldr/3,foreach/2,takewhile/2,dropwhile/2,splitwith/2,
split/2]).
+%%% BIFs
+-export([keyfind/3, keymember/3, keysearch/3, member/2, reverse/2]).
+
+%% Shadowed by erl_bif_types: lists:keyfind/3
+-spec keyfind(Key, N, TupleList) -> Tuple | false when
+ Key :: term(),
+ N :: pos_integer(),
+ TupleList :: [Tuple],
+ Tuple :: tuple().
+
+keyfind(_, _, _) ->
+ erlang:nif_error(undef).
+
+%% Shadowed by erl_bif_types: lists:keymember/3
+-spec keymember(Key, N, TupleList) -> boolean() when
+ Key :: term(),
+ N :: pos_integer(),
+ TupleList :: [Tuple],
+ Tuple :: tuple().
+
+keymember(_, _, _) ->
+ erlang:nif_error(undef).
+
+%% Shadowed by erl_bif_types: lists:keysearch/3
+-spec keysearch(Key, N, TupleList) -> {value, Tuple} | false when
+ Key :: term(),
+ N :: pos_integer(),
+ TupleList :: [Tuple],
+ Tuple :: tuple().
+
+keysearch(_, _, _) ->
+ erlang:nif_error(undef).
+
+%% Shadowed by erl_bif_types: lists:member/2
+-spec member(Elem, List) -> boolean() when
+ Elem :: T,
+ List :: [T],
+ T :: term().
+
+member(_, _) ->
+ erlang:nif_error(undef).
+
+%% Shadowed by erl_bif_types: lists:reverse/2
+-spec reverse(List1, Tail) -> List2 when
+ List1 :: [T],
+ Tail :: term(),
+ List2 :: [T],
+ T :: term().
+
+reverse(_, _) ->
+ erlang:nif_error(undef).
+
+%%% End of BIFs
+
%% member(X, L) -> (true | false)
%% test if X is a member of the list L
%% Now a BIF!
@@ -84,7 +135,7 @@ append([]) -> [].
subtract(L1, L2) -> L1 -- L2.
-%% reverse(L) reverse all elements in the list L. Is now a BIF!
+%% reverse(L) reverse all elements in the list L. reverse/2 is now a BIF!
-spec reverse(List1) -> List2 when
List1 :: [T],
@@ -581,6 +632,7 @@ flatlength([_|T], L) ->
flatlength([], L) -> L.
%% keymember(Key, Index, [Tuple]) Now a BIF!
+%% keyfind(Key, Index, [Tuple]) A BIF!
%% keysearch(Key, Index, [Tuple]) Now a BIF!
%% keydelete(Key, Index, [Tuple])
%% keyreplace(Key, Index, [Tuple], NewTuple)
@@ -1126,8 +1178,7 @@ rumerge(T1, [H2 | T2]) ->
%% takewhile(Predicate, List)
%% dropwhile(Predicate, List)
%% splitwith(Predicate, List)
-%% for list programming. Function here is a 'fun'. For backward compatibility,
-%% {Module,Function} is still accepted.
+%% for list programming. Function here is a 'fun'.
%%
%% The name zf is a joke!
%%
diff --git a/lib/stdlib/src/math.erl b/lib/stdlib/src/math.erl
index b2ea6195c5..c3fb684ec3 100644
--- a/lib/stdlib/src/math.erl
+++ b/lib/stdlib/src/math.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -20,6 +20,116 @@
-export([pi/0]).
+%%% BIFs
+
+-export([sin/1, cos/1, tan/1, asin/1, acos/1, atan/1, atan2/2, sinh/1,
+ cosh/1, tanh/1, asinh/1, acosh/1, atanh/1, exp/1, log/1,
+ log10/1, pow/2, sqrt/1, erf/1, erfc/1]).
+
+-spec acos(X) -> float() when
+ X :: number().
+acos(_) ->
+ erlang:nif_error(undef).
+
+-spec acosh(X) -> float() when
+ X :: number().
+acosh(_) ->
+ erlang:nif_error(undef).
+
+-spec asin(X) -> float() when
+ X :: number().
+asin(_) ->
+ erlang:nif_error(undef).
+
+-spec asinh(X) -> float() when
+ X :: number().
+asinh(_) ->
+ erlang:nif_error(undef).
+
+-spec atan(X) -> float() when
+ X :: number().
+atan(_) ->
+ erlang:nif_error(undef).
+
+-spec atan2(X, Y) -> float() when
+ X :: number(),
+ Y :: number().
+atan2(_, _) ->
+ erlang:nif_error(undef).
+
+-spec atanh(X) -> float() when
+ X :: number().
+atanh(_) ->
+ erlang:nif_error(undef).
+
+-spec cos(X) -> float() when
+ X :: number().
+cos(_) ->
+ erlang:nif_error(undef).
+
+-spec cosh(X) -> float() when
+ X :: number().
+cosh(_) ->
+ erlang:nif_error(undef).
+
+-spec erf(X) -> float() when
+ X :: number().
+erf(_) ->
+ erlang:nif_error(undef).
+
+-spec erfc(X) -> float() when
+ X :: number().
+erfc(_) ->
+ erlang:nif_error(undef).
+
+-spec exp(X) -> float() when
+ X :: number().
+exp(_) ->
+ erlang:nif_error(undef).
+
+-spec log(X) -> float() when
+ X :: number().
+log(_) ->
+ erlang:nif_error(undef).
+
+-spec log10(X) -> float() when
+ X :: number().
+log10(_) ->
+ erlang:nif_error(undef).
+
+-spec pow(X, Y) -> float() when
+ X :: number(),
+ Y :: number().
+pow(_, _) ->
+ erlang:nif_error(undef).
+
+-spec sin(X) -> float() when
+ X :: number().
+sin(_) ->
+ erlang:nif_error(undef).
+
+-spec sinh(X) -> float() when
+ X :: number().
+sinh(_) ->
+ erlang:nif_error(undef).
+
+-spec sqrt(X) -> float() when
+ X :: number().
+sqrt(_) ->
+ erlang:nif_error(undef).
+
+-spec tan(X) -> float() when
+ X :: number().
+tan(_) ->
+ erlang:nif_error(undef).
+
+-spec tanh(X) -> float() when
+ X :: number().
+tanh(_) ->
+ erlang:nif_error(undef).
+
+%%% End of BIFs
+
-spec pi() -> float().
pi() -> 3.1415926535897932.
diff --git a/lib/stdlib/src/ms_transform.erl b/lib/stdlib/src/ms_transform.erl
index 63b397f3a5..4389fd457c 100644
--- a/lib/stdlib/src/ms_transform.erl
+++ b/lib/stdlib/src/ms_transform.erl
@@ -881,7 +881,6 @@ translate_language_element(Atom) ->
end.
old_bool_test(atom,1) -> is_atom;
-old_bool_test(constant,1) -> is_constant;
old_bool_test(float,1) -> is_float;
old_bool_test(integer,1) -> is_integer;
old_bool_test(list,1) -> is_list;
@@ -896,7 +895,6 @@ old_bool_test(record,2) -> is_record;
old_bool_test(_,_) -> undefined.
bool_test(is_atom,1) -> true;
-bool_test(is_constant,1) -> true;
bool_test(is_float,1) -> true;
bool_test(is_integer,1) -> true;
bool_test(is_list,1) -> true;
diff --git a/lib/stdlib/src/otp_internal.erl b/lib/stdlib/src/otp_internal.erl
index 7bacc05ff2..cddf345c76 100644
--- a/lib/stdlib/src/otp_internal.erl
+++ b/lib/stdlib/src/otp_internal.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -337,11 +337,11 @@ obsolete_1(public_key, decode_private_key, A) when A =:= 1; A =:= 2 ->
%% Added in R14B03.
obsolete_1(docb_gen, _, _) ->
- {deprecated,"the DocBuilder application is deprecated (will be removed in R15B)"};
+ {removed,"the DocBuilder application was removed in R15B"};
obsolete_1(docb_transform, _, _) ->
- {deprecated,"the DocBuilder application is deprecated (will be removed in R15B)"};
+ {removed,"the DocBuilder application was removed in R15B"};
obsolete_1(docb_xml_check, _, _) ->
- {deprecated,"the DocBuilder application is deprecated (will be removed in R15B)"};
+ {removed,"the DocBuilder application was removed in R15B"};
%% Added in R15B
obsolete_1(asn1rt, F, _) when F == load_driver; F == unload_driver ->
@@ -349,11 +349,19 @@ obsolete_1(asn1rt, F, _) when F == load_driver; F == unload_driver ->
obsolete_1(ssl, pid, 1) ->
{deprecated,"deprecated (will be removed in R17); is no longer needed"};
obsolete_1(inviso, _, _) ->
- {deprecated,"the inviso application has been deprecated and will be removed in R16"};
+ {removed,"the inviso application was removed in R16"};
+
+%% Added in R15B01.
+obsolete_1(gs, _, _) ->
+ {deprecated,"the gs application has been deprecated and will be removed in R16; use the wx application instead"};
+obsolete_1(ssh, sign_data, 2) ->
+ {deprecated,"deprecated (will be removed in R16A); use public_key:pem_decode/1, public_key:pem_entry_decode/1 "
+ "and public_key:sign/3 instead"};
+obsolete_1(ssh, verify_data, 3) ->
+ {deprecated,"deprecated (will be removed in R16A); use public_key:ssh_decode/1, and public_key:verify/4 instead"};
obsolete_1(_, _, _) ->
no.
-
-spec is_snmp_agent_function(atom(), byte()) -> boolean().
is_snmp_agent_function(c, 1) -> true;
diff --git a/lib/stdlib/src/qlc_pt.erl b/lib/stdlib/src/qlc_pt.erl
index 21504d707b..ad25fd559c 100644
--- a/lib/stdlib/src/qlc_pt.erl
+++ b/lib/stdlib/src/qlc_pt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -2186,7 +2186,7 @@ try_ms(E, P, Fltr, State) ->
{function,L,foo,0,[{clause,L,[],[],[MS0]}]} = lists:last(X),
MS = erl_parse:normalise(var2const(MS0)),
XMS = ets:match_spec_compile(MS),
- true = is_binary(XMS),
+ true = ets:is_compiled_ms(XMS),
{ok, MS, MS0}
end of
{'EXIT', _Reason} ->
diff --git a/lib/stdlib/src/re.erl b/lib/stdlib/src/re.erl
index 246d535943..c5109ec455 100644
--- a/lib/stdlib/src/re.erl
+++ b/lib/stdlib/src/re.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -30,11 +30,65 @@
| {newline, nl_spec()}| bsr_anycrlf
| bsr_unicode.
-%% Emulator builtins in this module:
-%% re:compile/1
-%% re:compile/2
-%% re:run/2
-%% re:run/3
+%%% BIFs
+
+-export([compile/1, compile/2, run/2, run/3]).
+
+-spec compile(Regexp) -> {ok, MP} | {error, ErrSpec} when
+ Regexp :: iodata(),
+ MP :: mp(),
+ ErrSpec :: {ErrString :: string(), Position :: non_neg_integer()}.
+
+compile(_) ->
+ erlang:nif_error(undef).
+
+-spec compile(Regexp, Options) -> {ok, MP} | {error, ErrSpec} when
+ Regexp :: iodata() | unicode:charlist(),
+ Options :: [Option],
+ Option :: compile_option(),
+ MP :: mp(),
+ ErrSpec :: {ErrString :: string(), Position :: non_neg_integer()}.
+
+compile(_, _) ->
+ erlang:nif_error(undef).
+
+-spec run(Subject, RE) -> {match, Captured} | nomatch when
+ Subject :: iodata() | unicode:charlist(),
+ RE :: mp() | iodata(),
+ Captured :: [CaptureData],
+ CaptureData :: {integer(), integer()}.
+
+run(_, _) ->
+ erlang:nif_error(undef).
+
+-spec run(Subject, RE, Options) -> {match, Captured} |
+ match |
+ nomatch when
+ Subject :: iodata() | unicode:charlist(),
+ RE :: mp() | iodata() | unicode:charlist(),
+ Options :: [Option],
+ Option :: anchored | global | notbol | noteol | notempty
+ | {offset, non_neg_integer()} |
+ {newline, NLSpec :: nl_spec()} |
+ bsr_anycrlf | bsr_unicode | {capture, ValueSpec} |
+ {capture, ValueSpec, Type} | CompileOpt,
+ Type :: index | list | binary,
+ ValueSpec :: all | all_but_first | first | none | ValueList,
+ ValueList :: [ValueID],
+ ValueID :: integer() | string() | atom(),
+ CompileOpt :: compile_option(),
+ Captured :: [CaptureData] | [[CaptureData]],
+ CaptureData :: {integer(), integer()}
+ | ListConversionData
+ | binary(),
+ ListConversionData :: string()
+ | {error, string(), binary()}
+ | {incomplete, string(), binary()}.
+
+run(_, _, _) ->
+ erlang:nif_error(undef).
+
+%%% End of BIFs
-spec split(Subject, RE) -> SplitList when
Subject :: iodata() | unicode:charlist(),
@@ -355,6 +409,12 @@ apply_mlist(Subject,Replacement,Mlist) ->
precomp_repl(<<>>) ->
[];
+precomp_repl(<<$\\,$g,${,Rest/binary>>) when byte_size(Rest) > 0 ->
+ {NS, <<$},NRest/binary>>} = pick_int(Rest),
+ [list_to_integer(NS) | precomp_repl(NRest)];
+precomp_repl(<<$\\,$g,Rest/binary>>) when byte_size(Rest) > 0 ->
+ {NS,NRest} = pick_int(Rest),
+ [list_to_integer(NS) | precomp_repl(NRest)];
precomp_repl(<<$\\,X,Rest/binary>>) when X < $1 ; X > $9 ->
%% Escaped character
case precomp_repl(Rest) of
diff --git a/lib/stdlib/src/stdlib.appup.src b/lib/stdlib/src/stdlib.appup.src
index 94e81188b5..55c8087475 100644
--- a/lib/stdlib/src/stdlib.appup.src
+++ b/lib/stdlib/src/stdlib.appup.src
@@ -17,11 +17,11 @@
%% %CopyrightEnd%
{"%VSN%",
%% Up from - max two major revisions back
- [{<<"1\\.18(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15
- {<<"1\\.17(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R14
- {<<"1\\.16(\\.[0-9]+)*">>,[restart_new_emulator]}],%% R13
+ [{<<"1\\.19(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R16
+ {<<"1\\.18(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15
+ {<<"1\\.17(\\.[0-9]+)*">>,[restart_new_emulator]}],%% R14
%% Down to - max two major revisions back
- [{<<"1\\.18(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15
- {<<"1\\.17(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R14
- {<<"1\\.16(\\.[0-9]+)*">>,[restart_new_emulator]}] %% R13
+ [{<<"1\\.19(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R16
+ {<<"1\\.18(\\.[0-9]+)*">>,[restart_new_emulator]}, %% R15
+ {<<"1\\.17(\\.[0-9]+)*">>,[restart_new_emulator]}] %% R14
}.
diff --git a/lib/stdlib/src/string.erl b/lib/stdlib/src/string.erl
index 30eac4f07d..fc029a582f 100644
--- a/lib/stdlib/src/string.erl
+++ b/lib/stdlib/src/string.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -29,6 +29,30 @@
%%---------------------------------------------------------------------------
+%%% BIFs
+
+-export([to_float/1, to_integer/1]).
+
+-spec to_float(String) -> {Float, Rest} | {error, Reason} when
+ String :: string(),
+ Float :: float(),
+ Rest :: string(),
+ Reason :: no_float | not_a_list.
+
+to_float(_) ->
+ erlang:nif_error(undef).
+
+-spec to_integer(String) -> {Int, Rest} | {error, Reason} when
+ String :: string(),
+ Int :: integer(),
+ Rest :: string(),
+ Reason :: no_integer | not_a_list.
+
+to_integer(_) ->
+ erlang:nif_error(undef).
+
+%%% End of BIFs
+
%% Robert's bit
%% len(String)
diff --git a/lib/stdlib/src/supervisor.erl b/lib/stdlib/src/supervisor.erl
index ac5b078c29..7d3c5a0e21 100644
--- a/lib/stdlib/src/supervisor.erl
+++ b/lib/stdlib/src/supervisor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -28,8 +28,9 @@
check_childspecs/1]).
%% Internal exports
--export([init/1, handle_call/3, handle_info/2, terminate/2, code_change/3]).
--export([handle_cast/2]).
+-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
+ terminate/2, code_change/3]).
+-export([try_again_restart/2]).
%%--------------------------------------------------------------------------
@@ -37,7 +38,7 @@
%%--------------------------------------------------------------------------
--type child() :: 'undefined' | pid() | [pid()].
+-type child() :: 'undefined' | pid().
-type child_id() :: term().
-type mfargs() :: {M :: module(), F :: atom(), A :: [term()] | undefined}.
-type modules() :: [module()] | 'dynamic'.
@@ -62,8 +63,8 @@
%%--------------------------------------------------------------------------
-record(child, {% pid is undefined when child is not running
- pid = undefined :: child(),
- name,
+ pid = undefined :: child() | {restarting,pid()} | [pid()],
+ name :: child_id(),
mfargs :: mfargs(),
restart_type :: restart(),
shutdown :: shutdown(),
@@ -95,6 +96,8 @@
[ChildSpec :: child_spec()]}}
| ignore.
+-define(restarting(_Pid_), {restarting,_Pid_}).
+
%%% ---------------------------------------------------
%%% This is a general process supervisor built upon gen_server.erl.
%%% Servers/processes should/could also be built using gen_server.erl.
@@ -139,7 +142,8 @@ start_child(Supervisor, ChildSpec) ->
Result :: {'ok', Child :: child()}
| {'ok', Child :: child(), Info :: term()}
| {'error', Error},
- Error :: 'running' | 'not_found' | 'simple_one_for_one' | term().
+ Error :: 'running' | 'restarting' | 'not_found' | 'simple_one_for_one' |
+ term().
restart_child(Supervisor, Name) ->
call(Supervisor, {restart_child, Name}).
@@ -147,7 +151,7 @@ restart_child(Supervisor, Name) ->
SupRef :: sup_ref(),
Id :: child_id(),
Result :: 'ok' | {'error', Error},
- Error :: 'running' | 'not_found' | 'simple_one_for_one'.
+ Error :: 'running' | 'restarting' | 'not_found' | 'simple_one_for_one'.
delete_child(Supervisor, Name) ->
call(Supervisor, {delete_child, Name}).
@@ -169,7 +173,7 @@ terminate_child(Supervisor, Name) ->
-spec which_children(SupRef) -> [{Id,Child,Type,Modules}] when
SupRef :: sup_ref(),
Id :: child_id() | undefined,
- Child :: child(),
+ Child :: child() | 'restarting',
Type :: worker(),
Modules :: modules().
which_children(Supervisor) ->
@@ -198,6 +202,17 @@ check_childspecs(ChildSpecs) when is_list(ChildSpecs) ->
end;
check_childspecs(X) -> {error, {badarg, X}}.
+%%%-----------------------------------------------------------------
+%%% Called by timer:apply_after from restart/2
+-spec try_again_restart(SupRef, Child) -> ok when
+ SupRef :: sup_ref(),
+ Child :: child_id() | pid().
+try_again_restart(Supervisor, Child) ->
+ cast(Supervisor, {try_again_restart, Child}).
+
+cast(Supervisor, Req) ->
+ gen_server:cast(Supervisor, Req).
+
%%% ---------------------------------------------------
%%%
%%% Initialize the supervisor.
@@ -384,6 +399,8 @@ handle_call({restart_child, Name}, _From, State) ->
Error ->
{reply, Error, State}
end;
+ {value, #child{pid=?restarting(_)}} ->
+ {reply, {error, restarting}, State};
{value, _} ->
{reply, {error, running}, State};
_ ->
@@ -395,6 +412,8 @@ handle_call({delete_child, Name}, _From, State) ->
{value, Child} when Child#child.pid =:= undefined ->
NState = remove_child(Child, State),
{reply, ok, NState};
+ {value, #child{pid=?restarting(_)}} ->
+ {reply, {error, restarting}, State};
{value, _} ->
{reply, {error, running}, State};
_ ->
@@ -413,13 +432,17 @@ handle_call(which_children, _From, #state{children = [#child{restart_type = RTyp
child_type = CT,
modules = Mods}]} =
State) when ?is_simple(State) ->
- Reply = lists:map(fun({Pid, _}) -> {undefined, Pid, CT, Mods} end,
+ Reply = lists:map(fun({?restarting(_),_}) -> {undefined,restarting,CT,Mods};
+ ({Pid, _}) -> {undefined, Pid, CT, Mods} end,
?DICT:to_list(dynamics_db(RType, State#state.dynamics))),
{reply, Reply, State};
handle_call(which_children, _From, State) ->
Resp =
- lists:map(fun(#child{pid = Pid, name = Name,
+ lists:map(fun(#child{pid = ?restarting(_), name = Name,
+ child_type = ChildType, modules = Mods}) ->
+ {Name, restarting, ChildType, Mods};
+ (#child{pid = Pid, name = Name,
child_type = ChildType, modules = Mods}) ->
{Name, Pid, ChildType, Mods}
end,
@@ -432,8 +455,11 @@ handle_call(count_children, _From, #state{children = [#child{restart_type = temp
when ?is_simple(State) ->
{Active, Count} =
?SETS:fold(fun(Pid, {Alive, Tot}) ->
- if is_pid(Pid) -> {Alive+1, Tot +1};
- true -> {Alive, Tot + 1} end
+ case is_pid(Pid) andalso is_process_alive(Pid) of
+ true ->{Alive+1, Tot +1};
+ false ->
+ {Alive, Tot + 1}
+ end
end, {0, 0}, dynamics_db(temporary, State#state.dynamics)),
Reply = case CT of
supervisor -> [{specs, 1}, {active, Active},
@@ -448,8 +474,12 @@ handle_call(count_children, _From, #state{children = [#child{restart_type = RTy
when ?is_simple(State) ->
{Active, Count} =
?DICT:fold(fun(Pid, _Val, {Alive, Tot}) ->
- if is_pid(Pid) -> {Alive+1, Tot +1};
- true -> {Alive, Tot + 1} end
+ case is_pid(Pid) andalso is_process_alive(Pid) of
+ true ->
+ {Alive+1, Tot +1};
+ false ->
+ {Alive, Tot + 1}
+ end
end, {0, 0}, dynamics_db(RType, State#state.dynamics)),
Reply = case CT of
supervisor -> [{specs, 1}, {active, Active},
@@ -486,14 +516,42 @@ count_child(#child{pid = Pid, child_type = supervisor},
end.
-%%% Hopefully cause a function-clause as there is no API function
-%%% that utilizes cast.
--spec handle_cast('null', state()) -> {'noreply', state()}.
+%%% If a restart attempt failed, this message is sent via
+%%% timer:apply_after(0,...) in order to give gen_server the chance to
+%%% check it's inbox before trying again.
+-spec handle_cast({try_again_restart, child_id() | pid()}, state()) ->
+ {'noreply', state()} | {stop, shutdown, state()}.
-handle_cast(null, State) ->
- error_logger:error_msg("ERROR: Supervisor received cast-message 'null'~n",
- []),
- {noreply, State}.
+handle_cast({try_again_restart,Pid}, #state{children=[Child]}=State)
+ when ?is_simple(State) ->
+ RT = Child#child.restart_type,
+ RPid = restarting(Pid),
+ case dynamic_child_args(RPid, dynamics_db(RT, State#state.dynamics)) of
+ {ok, Args} ->
+ {M, F, _} = Child#child.mfargs,
+ NChild = Child#child{pid = RPid, mfargs = {M, F, Args}},
+ case restart(NChild,State) of
+ {ok, State1} ->
+ {noreply, State1};
+ {shutdown, State1} ->
+ {stop, shutdown, State1}
+ end;
+ error ->
+ {noreply, State}
+ end;
+
+handle_cast({try_again_restart,Name}, State) ->
+ case lists:keyfind(Name,#child.name,State#state.children) of
+ Child = #child{pid=?restarting(_)} ->
+ case restart(Child,State) of
+ {ok, State1} ->
+ {noreply, State1};
+ {shutdown, State1} ->
+ {stop, shutdown, State1}
+ end;
+ _ ->
+ {noreply,State}
+ end.
%%
%% Take care of terminated children.
@@ -566,13 +624,12 @@ check_flags(What) ->
{bad_flags, What}.
update_childspec(State, StartSpec) when ?is_simple(State) ->
- case check_startspec(StartSpec) of
- {ok, [Child]} ->
- {ok, State#state{children = [Child]}};
- Error ->
- {error, Error}
- end;
-
+ case check_startspec(StartSpec) of
+ {ok, [Child]} ->
+ {ok, State#state{children = [Child]}};
+ Error ->
+ {error, Error}
+ end;
update_childspec(State, StartSpec) ->
case check_startspec(StartSpec) of
{ok, Children} ->
@@ -592,7 +649,7 @@ update_childspec1([Child|OldC], Children, KeepOld) ->
end;
update_childspec1([], Children, KeepOld) ->
%% Return them in (kept) reverse start order.
- lists:reverse(Children ++ KeepOld).
+ lists:reverse(Children ++ KeepOld).
update_chsp(OldCh, Children) ->
case lists:map(fun(Ch) when OldCh#child.name =:= Ch#child.name ->
@@ -624,7 +681,7 @@ handle_start_child(Child, State) ->
{error, What} ->
{{error, {What, Child}}, State}
end;
- {value, OldChild} when OldChild#child.pid =/= undefined ->
+ {value, OldChild} when is_pid(OldChild#child.pid) ->
{{error, {already_started, OldChild#child.pid}}, State};
{value, _OldChild} ->
{{error, already_present}, State}
@@ -678,7 +735,21 @@ do_restart(temporary, Reason, Child, State) ->
restart(Child, State) ->
case add_restart(State) of
{ok, NState} ->
- restart(NState#state.strategy, Child, NState);
+ case restart(NState#state.strategy, Child, NState) of
+ {try_again,NState2} ->
+ %% Leaving control back to gen_server before
+ %% trying again. This way other incoming requsts
+ %% for the supervisor can be handled - e.g. a
+ %% shutdown request for the supervisor or the
+ %% child.
+ Id = if ?is_simple(State) -> Child#child.pid;
+ true -> Child#child.name
+ end,
+ timer:apply_after(0,?MODULE,try_again_restart,[self(),Id]),
+ {ok,NState2};
+ Other ->
+ Other
+ end;
{terminate, NState} ->
report_error(shutdown, reached_max_restart_intensity,
Child, State#state.name),
@@ -686,9 +757,9 @@ restart(Child, State) ->
end.
restart(simple_one_for_one, Child, State) ->
- #child{mfargs = {M, F, A}} = Child,
- Dynamics = ?DICT:erase(Child#child.pid, dynamics_db(Child#child.restart_type,
- State#state.dynamics)),
+ #child{pid = OldPid, mfargs = {M, F, A}} = Child,
+ Dynamics = ?DICT:erase(OldPid, dynamics_db(Child#child.restart_type,
+ State#state.dynamics)),
case do_start_child_i(M, F, A) of
{ok, Pid} ->
NState = State#state{dynamics = ?DICT:store(Pid, A, Dynamics)},
@@ -697,10 +768,13 @@ restart(simple_one_for_one, Child, State) ->
NState = State#state{dynamics = ?DICT:store(Pid, A, Dynamics)},
{ok, NState};
{error, Error} ->
+ NState = State#state{dynamics = ?DICT:store(restarting(OldPid), A,
+ Dynamics)},
report_error(start_error, Error, Child, State#state.name),
- restart(Child, State)
+ {try_again, NState}
end;
restart(one_for_one, Child, State) ->
+ OldPid = Child#child.pid,
case do_start_child(State#state.name, Child) of
{ok, Pid} ->
NState = replace_child(Child#child{pid = Pid}, State),
@@ -709,8 +783,9 @@ restart(one_for_one, Child, State) ->
NState = replace_child(Child#child{pid = Pid}, State),
{ok, NState};
{error, Reason} ->
+ NState = replace_child(Child#child{pid = restarting(OldPid)}, State),
report_error(start_error, Reason, Child, State#state.name),
- restart(Child, State)
+ {try_again, NState}
end;
restart(rest_for_one, Child, State) ->
{ChAfter, ChBefore} = split_child(Child#child.pid, State#state.children),
@@ -719,7 +794,9 @@ restart(rest_for_one, Child, State) ->
{ok, ChAfter3} ->
{ok, State#state{children = ChAfter3 ++ ChBefore}};
{error, ChAfter3} ->
- restart(Child, State#state{children = ChAfter3 ++ ChBefore})
+ NChild = Child#child{pid=restarting(Child#child.pid)},
+ NState = State#state{children = ChAfter3 ++ ChBefore},
+ {try_again, replace_child(NChild,NState)}
end;
restart(one_for_all, Child, State) ->
Children1 = del_child(Child#child.pid, State#state.children),
@@ -728,9 +805,14 @@ restart(one_for_all, Child, State) ->
{ok, NChs} ->
{ok, State#state{children = NChs}};
{error, NChs} ->
- restart(Child, State#state{children = NChs})
+ NChild = Child#child{pid=restarting(Child#child.pid)},
+ NState = State#state{children = NChs},
+ {try_again, replace_child(NChild,NState)}
end.
+restarting(Pid) when is_pid(Pid) -> ?restarting(Pid);
+restarting(RPid) -> RPid.
+
%%-----------------------------------------------------------------
%% Func: terminate_children/2
%% Args: Children = [child_rec()] in termination order
@@ -754,7 +836,7 @@ terminate_children([Child | Children], SupName, Res) ->
terminate_children([], _SupName, Res) ->
Res.
-do_terminate(Child, SupName) when Child#child.pid =/= undefined ->
+do_terminate(Child, SupName) when is_pid(Child#child.pid) ->
case shutdown(Child#child.pid, Child#child.shutdown) of
ok ->
ok;
@@ -765,7 +847,7 @@ do_terminate(Child, SupName) when Child#child.pid =/= undefined ->
end,
Child#child{pid = undefined};
do_terminate(Child, _SupName) ->
- Child.
+ Child#child{pid = undefined}.
%%-----------------------------------------------------------------
%% Shutdowns a child. We must check the EXIT value
@@ -866,7 +948,7 @@ terminate_dynamic_children(Child, Dynamics, SupName) ->
TRef = erlang:start_timer(Time, self(), kill),
wait_dynamic_children(Child, Pids, Sz, TRef, EStack0)
end,
- %% Unrool stacked errors and report them
+ %% Unroll stacked errors and report them
?DICT:fold(fun(Reason, Ls, _) ->
report_error(shutdown_error, Reason,
Child#child{pid=Ls}, SupName)
@@ -885,7 +967,7 @@ monitor_dynamic_children(#child{restart_type=temporary}, Dynamics) ->
end
end, {?SETS:new(), ?DICT:new()}, Dynamics);
monitor_dynamic_children(#child{restart_type=RType}, Dynamics) ->
- ?DICT:fold(fun(P, _, {Pids, EStack}) ->
+ ?DICT:fold(fun(P, _, {Pids, EStack}) when is_pid(P) ->
case monitor_child(P) of
ok ->
{?SETS:add_element(P, Pids), EStack};
@@ -893,7 +975,9 @@ monitor_dynamic_children(#child{restart_type=RType}, Dynamics) ->
{Pids, EStack};
{error, Reason} ->
{Pids, ?DICT:append(Reason, P, EStack)}
- end
+ end;
+ (?restarting(_), _, {Pids, EStack}) ->
+ {Pids, EStack}
end, {?SETS:new(), ?DICT:new()}, Dynamics).
@@ -1020,13 +1104,20 @@ get_child(Name, State, _) ->
lists:keysearch(Name, #child.name, State#state.children).
get_dynamic_child(Pid, #state{children=[Child], dynamics=Dynamics}) ->
- case is_dynamic_pid(Pid, dynamics_db(Child#child.restart_type, Dynamics)) of
+ DynamicsDb = dynamics_db(Child#child.restart_type, Dynamics),
+ case is_dynamic_pid(Pid, DynamicsDb) of
true ->
{value, Child#child{pid=Pid}};
false ->
- case erlang:is_process_alive(Pid) of
- true -> false;
- false -> {value, Child}
+ RPid = restarting(Pid),
+ case is_dynamic_pid(RPid, DynamicsDb) of
+ true ->
+ {value, Child#child{pid=RPid}};
+ false ->
+ case erlang:is_process_alive(Pid) of
+ true -> false;
+ false -> {value, Child}
+ end
end
end.
@@ -1056,9 +1147,9 @@ remove_child(Child, State) ->
%% Args: SupName = {local, atom()} | {global, atom()} | self
%% Type = {Strategy, MaxIntensity, Period}
%% Strategy = one_for_one | one_for_all | simple_one_for_one |
-%% rest_for_one
-%% MaxIntensity = integer()
-%% Period = integer()
+%% rest_for_one
+%% MaxIntensity = integer() >= 0
+%% Period = integer() > 0
%% Mod :== atom()
%% Args :== term()
%% Purpose: Check that Type is of correct type (!)
@@ -1109,7 +1200,7 @@ supname(N, _) -> N.
%%% where Name is an atom
%%% Func is {Mod, Fun, Args} == {atom(), atom(), list()}
%%% RestartType is permanent | temporary | transient
-%%% Shutdown = integer() | infinity | brutal_kill
+%%% Shutdown = integer() > 0 | infinity | brutal_kill
%%% ChildType = supervisor | worker
%%% Modules = [atom()] | dynamic
%%% Returns: {ok, [child_rec()]} | Error
diff --git a/lib/stdlib/src/unicode.erl b/lib/stdlib/src/unicode.erl
index e9b90befe6..8b9412fb1b 100644
--- a/lib/stdlib/src/unicode.erl
+++ b/lib/stdlib/src/unicode.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -18,13 +18,6 @@
%%
-module(unicode).
-%% Implemented in the emulator:
-%% characters_to_binary/2 (will trap to characters_to_binary_int/2
-%% if InEncoding is not {latin1 | unicode | utf8})
-%% characters_to_list/2 (will trap to characters_to_list_int/2 if
-%% InEncoding is not {latin1 | unicode | utf8})
-%%
-
-export([characters_to_list/1, characters_to_list_int/2,
characters_to_binary/1, characters_to_binary_int/2,
characters_to_binary/3,
@@ -52,6 +45,45 @@
-type latin1_charlist() :: [latin1_char() | latin1_binary()
| latin1_charlist()].
+%%% BIFs
+%%%
+%%% characters_to_binary/2 (will trap to characters_to_binary_int/2
+%%% if InEncoding is not {latin1 | unicode | utf8})
+%%% characters_to_list/2 (will trap to characters_to_list_int/2 if
+%%% InEncoding is not {latin1 | unicode | utf8})
+
+-export([bin_is_7bit/1, characters_to_binary/2, characters_to_list/2]).
+
+-spec bin_is_7bit(Binary) -> boolean() when
+ Binary :: binary().
+
+bin_is_7bit(_) ->
+ erlang:nif_error(undef).
+
+-spec characters_to_binary(Data, InEncoding) -> Result when
+ Data :: latin1_chardata() | chardata() | external_chardata(),
+ InEncoding :: encoding(),
+ Result :: binary()
+ | {error, binary(), RestData}
+ | {incomplete, binary(), binary()},
+ RestData :: latin1_chardata() | chardata() | external_chardata().
+
+characters_to_binary(_, _) ->
+ erlang:nif_error(undef).
+
+-spec characters_to_list(Data, InEncoding) -> Result when
+ Data :: latin1_chardata() | chardata() | external_chardata(),
+ InEncoding :: encoding(),
+ Result :: list()
+ | {error, list(), RestData}
+ | {incomplete, list(), binary()},
+ RestData :: latin1_chardata() | chardata() | external_chardata().
+
+characters_to_list(_, _) ->
+ erlang:nif_error(undef).
+
+%%% End of BIFs
+
-spec characters_to_list(Data) -> Result when
Data :: latin1_chardata() | chardata() | external_chardata(),
Result :: list()
diff --git a/lib/stdlib/src/zip.erl b/lib/stdlib/src/zip.erl
index c82c8159b6..c383540db7 100644
--- a/lib/stdlib/src/zip.erl
+++ b/lib/stdlib/src/zip.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -1017,7 +1017,7 @@ cd_file_header_from_lh_and_pos(LH, Pos) ->
file_name_length = FileNameLength,
extra_field_length = ExtraFieldLength,
file_comment_length = 0, % FileCommentLength,
- disk_num_start = 1, % DiskNumStart,
+ disk_num_start = 0, % DiskNumStart,
internal_attr = 0, % InternalAttr,
external_attr = 0, % ExternalAttr,
local_header_offset = Pos}.
diff --git a/lib/stdlib/test/Makefile b/lib/stdlib/test/Makefile
index aa6a660c34..29b8e28d3a 100644
--- a/lib/stdlib/test/Makefile
+++ b/lib/stdlib/test/Makefile
@@ -20,6 +20,7 @@ MODULES= \
digraph_utils_SUITE \
dummy1_h \
dummy_h \
+ dummy_via \
edlin_expand_SUITE \
epp_SUITE \
erl_eval_helper \
@@ -66,6 +67,7 @@ MODULES= \
string_SUITE \
supervisor_1 \
supervisor_2 \
+ supervisor_deadlock \
naughty_child \
shell_SUITE \
supervisor_SUITE \
@@ -133,10 +135,10 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) stdlib.spec $(EMAKEFILE) \
- $(ERL_FILES) $(COVERFILE) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(ERL_FILES) $(COVERFILE) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/stdlib/test/dets_SUITE.erl b/lib/stdlib/test/dets_SUITE.erl
index 6f77cff2b9..66799f4d05 100644
--- a/lib/stdlib/test/dets_SUITE.erl
+++ b/lib/stdlib/test/dets_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -38,7 +38,7 @@
-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, newly_started/1, basic_v8/1, basic_v9/1,
+ newly_started/1, basic_v8/1, basic_v9/1,
open_v8/1, open_v9/1, sets_v8/1, sets_v9/1, bags_v8/1,
bags_v9/1, duplicate_bags_v8/1, duplicate_bags_v9/1,
access_v8/1, access_v9/1, dirty_mark/1, dirty_mark2/1,
@@ -95,27 +95,25 @@ end_per_testcase(_Case, _Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- case os:type() of
- vxworks -> [not_run];
- _ ->
- [basic_v8, basic_v9, open_v8, open_v9, sets_v8, sets_v9,
- bags_v8, bags_v9, duplicate_bags_v8, duplicate_bags_v9,
- newly_started, open_file_v8, open_file_v9,
- init_table_v8, init_table_v9, repair_v8, repair_v9,
- access_v8, access_v9, oldbugs_v8, oldbugs_v9,
- unsafe_assumptions, truncated_segment_array_v8,
- truncated_segment_array_v9, dirty_mark, dirty_mark2,
- bag_next_v8, bag_next_v9, hash_v8b_v8c, phash, fold_v8,
- fold_v9, fixtable_v8, fixtable_v9, match_v8, match_v9,
- select_v8, select_v9, update_counter, badarg,
- cache_sets_v8, cache_sets_v9, cache_bags_v8,
- cache_bags_v9, cache_duplicate_bags_v8,
- cache_duplicate_bags_v9, otp_4208, otp_4989,
- many_clients, otp_4906, otp_5402, simultaneous_open,
- insert_new, repair_continuation, otp_5487, otp_6206,
- otp_6359, otp_4738, otp_7146, otp_8070, otp_8856, otp_8898,
- otp_8899, otp_8903, otp_8923, otp_9282, otp_9607]
- end.
+ [
+ basic_v8, basic_v9, open_v8, open_v9, sets_v8, sets_v9,
+ bags_v8, bags_v9, duplicate_bags_v8, duplicate_bags_v9,
+ newly_started, open_file_v8, open_file_v9,
+ init_table_v8, init_table_v9, repair_v8, repair_v9,
+ access_v8, access_v9, oldbugs_v8, oldbugs_v9,
+ unsafe_assumptions, truncated_segment_array_v8,
+ truncated_segment_array_v9, dirty_mark, dirty_mark2,
+ bag_next_v8, bag_next_v9, hash_v8b_v8c, phash, fold_v8,
+ fold_v9, fixtable_v8, fixtable_v9, match_v8, match_v9,
+ select_v8, select_v9, update_counter, badarg,
+ cache_sets_v8, cache_sets_v9, cache_bags_v8,
+ cache_bags_v9, cache_duplicate_bags_v8,
+ cache_duplicate_bags_v9, otp_4208, otp_4989,
+ many_clients, otp_4906, otp_5402, simultaneous_open,
+ insert_new, repair_continuation, otp_5487, otp_6206,
+ otp_6359, otp_4738, otp_7146, otp_8070, otp_8856, otp_8898,
+ otp_8899, otp_8903, otp_8923, otp_9282, otp_9607
+ ].
groups() ->
[].
@@ -132,10 +130,6 @@ init_per_group(_GroupName, Config) ->
end_per_group(_GroupName, Config) ->
Config.
-not_run(suite) -> [];
-not_run(Conf) when is_list(Conf) ->
- {comment, "Not runnable VxWorks/NFS"}.
-
newly_started(doc) ->
["OTP-3621"];
newly_started(suite) ->
@@ -1949,7 +1943,7 @@ match(Config, Version) ->
%% match, badarg
MSpec = [{'_',[],['$_']}],
?line check_badarg(catch dets:match(no_table, '_'),
- dets, safe_fixtable, [no_table,true]),
+ dets, match, [no_table,'_']),
?line check_badarg(catch dets:match(T, '_', not_a_number),
dets, match, [T,'_',not_a_number]),
?line {EC1, _} = dets:select(T, MSpec, 1),
@@ -1958,7 +1952,7 @@ match(Config, Version) ->
%% match_object, badarg
?line check_badarg(catch dets:match_object(no_table, '_'),
- dets, safe_fixtable, [no_table,true]),
+ dets, match_object, [no_table,'_']),
?line check_badarg(catch dets:match_object(T, '_', not_a_number),
dets, match_object, [T,'_',not_a_number]),
?line {EC2, _} = dets:select(T, MSpec, 1),
@@ -2127,7 +2121,7 @@ select(Config, Version) ->
%% badarg
MSpec = [{'_',[],['$_']}],
?line check_badarg(catch dets:select(no_table, MSpec),
- dets, safe_fixtable, [no_table,true]),
+ dets, select, [no_table,MSpec]),
?line check_badarg(catch dets:select(T, <<17>>),
dets, select, [T,<<17>>]),
?line check_badarg(catch dets:select(T, []),
@@ -2330,7 +2324,7 @@ badarg(Config) when is_list(Config) ->
%% match_delete
?line check_badarg(catch dets:match_delete(no_table, '_'),
- dets, safe_fixtable, [no_table,true]),
+ dets, match_delete, [no_table,'_']),
%% delete_all_objects
?line check_badarg(catch dets:delete_all_objects(no_table),
@@ -2339,17 +2333,19 @@ badarg(Config) when is_list(Config) ->
%% select_delete
MSpec = [{'_',[],['$_']}],
?line check_badarg(catch dets:select_delete(no_table, MSpec),
- dets, safe_fixtable, [no_table,true]),
+ dets, select_delete, [no_table,MSpec]),
?line check_badarg(catch dets:select_delete(T, <<17>>),
dets, select_delete, [T, <<17>>]),
%% traverse, fold
- ?line check_badarg(catch dets:traverse(no_table, fun(_) -> continue end),
- dets, safe_fixtable, [no_table,true]),
- ?line check_badarg(catch dets:foldl(fun(_, A) -> A end, [], no_table),
- dets, safe_fixtable, [no_table,true]),
- ?line check_badarg(catch dets:foldr(fun(_, A) -> A end, [], no_table),
- dets, safe_fixtable, [no_table,true]),
+ TF = fun(_) -> continue end,
+ ?line check_badarg(catch dets:traverse(no_table, TF),
+ dets, traverse, [no_table,TF]),
+ FF = fun(_, A) -> A end,
+ ?line check_badarg(catch dets:foldl(FF, [], no_table),
+ dets, foldl, [FF,[],no_table]),
+ ?line check_badarg(catch dets:foldr(FF, [], no_table),
+ dets, foldl, [FF,[],no_table]),
%% close
?line ok = dets:close(T),
diff --git a/lib/stdlib/test/digraph_utils_SUITE.erl b/lib/stdlib/test/digraph_utils_SUITE.erl
index 12c486c25f..6b554c2fb7 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2012. 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
@@ -211,8 +211,7 @@ condensation(Config) when is_list(Config) ->
{lists:sort(V1), lists:sort(V2)}
end,
?line Es = lists:map(Fun, digraph:edges(CG)),
- ?line [{[b],[c]},{[b],[d]},{[e,f,g],[e,f,g]},{[h],[h]},{[i,j],[i,j]}] =
- lists:sort(Es),
+ ?line [{[b],[c]},{[b],[d]}] = lists:sort(Es),
?line true = digraph:delete(CG),
?line true = digraph:delete(G),
ok.
diff --git a/lib/stdlib/test/dummy_via.erl b/lib/stdlib/test/dummy_via.erl
new file mode 100644
index 0000000000..e405811cbe
--- /dev/null
+++ b/lib/stdlib/test/dummy_via.erl
@@ -0,0 +1,94 @@
+-module(dummy_via).
+-export([reset/0,
+ register_name/2,
+ whereis_name/1,
+ unregister_name/1,
+ send/2]).
+
+
+reset() ->
+ P = whereis(?MODULE),
+ catch unlink(P),
+ Ref = erlang:monitor(process, P),
+ catch exit(P, kill),
+ receive {'DOWN',Ref,_,_,_} -> ok end,
+ Me = self(),
+ Pid = spawn_link(fun() ->
+ register(?MODULE, self()),
+ Me ! {self(), started},
+ loop([])
+ end),
+ receive
+ {Pid, started} ->
+ Pid
+ after 10000 ->
+ exit(timeout)
+ end.
+
+register_name(Name, Pid) when is_pid(Pid) ->
+ call({register_name, Name, Pid}).
+
+unregister_name(Name) ->
+ call({unregister_name, Name}).
+
+whereis_name(Name) ->
+ call({whereis_name, Name}).
+
+send(Name, Msg) ->
+ case whereis_name(Name) of
+ undefined ->
+ exit({badarg, {Name, Msg}});
+ Pid when is_pid(Pid) ->
+ Pid ! Msg,
+ Pid
+ end.
+
+call(Req) ->
+ MRef = erlang:monitor(process, ?MODULE),
+ ?MODULE ! {self(), MRef, Req},
+ receive
+ {'DOWN', MRef, _, _, _} ->
+ erlang:error(badarg);
+ {MRef, badarg} ->
+ erlang:error(badarg);
+ {MRef, Reply} ->
+ Reply
+ after 5000 ->
+ erlang:error(timeout)
+ end.
+
+loop(Reg) ->
+ receive
+ {'DOWN', _, _, P, _} when is_pid(P) ->
+ loop([X || {_,Pid,_} = X <- Reg, Pid =/= P]);
+ {From, Ref, Request} when is_pid(From), is_reference(Ref) ->
+ {Reply, NewReg} = handle_request(Request, Reg),
+ From ! {Ref, Reply},
+ loop(NewReg)
+ end.
+
+handle_request({register_name, Name, Pid}, Reg) when is_pid(Pid) ->
+ case lists:keyfind(Name, 1, Reg) of
+ false ->
+ Ref = erlang:monitor(process, Pid),
+ {yes, [{Name, Pid, Ref}|Reg]};
+ _ ->
+ {no, Reg}
+ end;
+handle_request({whereis_name, Name}, Reg) ->
+ case lists:keyfind(Name, 1, Reg) of
+ {_, Pid, _} ->
+ {Pid, Reg};
+ false ->
+ {undefined, Reg}
+ end;
+handle_request({unregister_name, Name}, Reg) ->
+ case lists:keyfind(Name, 1, Reg) of
+ {_, _, Ref} ->
+ catch erlang:demonitor(Ref);
+ _ ->
+ ok
+ end,
+ {ok, lists:keydelete(Name, 1, Reg)};
+handle_request(_, Reg) ->
+ {badarg, Reg}.
diff --git a/lib/stdlib/test/edlin_expand_SUITE.erl b/lib/stdlib/test/edlin_expand_SUITE.erl
index a0e198ce09..0cd2688e2e 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -46,10 +46,10 @@ groups() ->
[].
init_per_suite(Config) ->
- true = code:delete(expand_test),
- true = code:delete(expand_test1),
- true = code:delete('ExpandTestCaps'),
- true = code:delete('ExpandTestCaps1'),
+ (catch code:delete(expand_test)),
+ (catch code:delete(expand_test1)),
+ (catch code:delete('ExpandTestCaps')),
+ (catch code:delete('ExpandTestCaps1')),
Config.
end_per_suite(_Config) ->
diff --git a/lib/stdlib/test/erl_eval_SUITE.erl b/lib/stdlib/test/erl_eval_SUITE.erl
index ca2f18a05a..47792d1052 100644
--- a/lib/stdlib/test/erl_eval_SUITE.erl
+++ b/lib/stdlib/test/erl_eval_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -216,13 +216,13 @@ guard_4(doc) ->
guard_4(suite) ->
[];
guard_4(Config) when is_list(Config) ->
- ?line check(fun() -> if {erlang,'+'}(3,a) -> true ; true -> false end end,
- "if {erlang,'+'}(3,a) -> true ; true -> false end.",
- false),
- ?line check(fun() -> if {erlang,is_integer}(3) -> true ; true -> false end
- end,
- "if {erlang,is_integer}(3) -> true ; true -> false end.",
- true),
+ check(fun() -> if erlang:'+'(3,a) -> true ; true -> false end end,
+ "if erlang:'+'(3,a) -> true ; true -> false end.",
+ false),
+ check(fun() -> if erlang:is_integer(3) -> true ; true -> false end
+ 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]),
@@ -230,11 +230,11 @@ guard_4(Config) when is_list(Config) ->
end,
"if is_atom(is_integer(a)) -> true ; true -> false end.",
true),
- ?line 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),
+ 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),
@@ -1077,11 +1077,6 @@ do_funs(LFH, EFH) ->
concat(["begin F1 = fun(F,N) -> apply(", M,
",count_down,[F, N]) end, F1(F1,1000) end."]),
0, ['F1'], LFH, EFH),
- ?line 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() -> F = fun(F,N) when N > 0 -> apply(F,[F,N-1]);
(_F,0) -> ok end,
F(F, 1000)
@@ -1113,11 +1108,11 @@ do_funs(LFH, EFH) ->
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) -> {erlang,'+'}(X,2) end,
- true = 3 == F(1) end,
- "begin F = fun(X) -> {erlang,'+'}(X,2) end,"
- " true = 3 == F(1) end.", true, ['F'],
- LFH, EFH),
+ check(fun() -> F = fun(X) -> erlang:'+'(X,2) end,
+ true = 3 == F(1) end,
+ "begin F = fun(X) -> erlang:'+'(X,2) end,"
+ " true = 3 == F(1) end.", true, ['F'],
+ LFH, EFH),
?line check(fun() -> F = fun(X) -> byte_size(X) end,
?MODULE:do_apply(F,<<"hej">>) end,
concat(["begin F = fun(X) -> size(X) end,",
diff --git a/lib/stdlib/test/erl_expand_records_SUITE.erl b/lib/stdlib/test/erl_expand_records_SUITE.erl
index 8b162cfda0..e248934e10 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -157,7 +157,7 @@ expr(Config) when is_list(Config) ->
One = 1 = fun f/1(1),
2 = fun(X) -> X end(One + One),
3 = fun exprec_test:f/1(3),
- 4 = {exprec_test,f}(4),
+ 4 = exprec_test:f(4),
5 = ''.f(5),
L = receive
{a,message,L0} ->
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl
index 4e93f056ad..90a37f6441 100644
--- a/lib/stdlib/test/erl_lint_SUITE.erl
+++ b/lib/stdlib/test/erl_lint_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2012. 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
@@ -50,7 +50,8 @@
unsafe_vars_try/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, export_all/1,
+ otp_5917/1, otp_6585/1, otp_6885/1, otp_10436/1,
+ export_all/1,
bif_clash/1,
behaviour_basic/1, behaviour_multiple/1,
otp_7550/1,
@@ -80,7 +81,7 @@ all() ->
unsafe_vars, unsafe_vars2, unsafe_vars_try, guard,
otp_4886, otp_4988, otp_5091, otp_5276, otp_5338,
otp_5362, otp_5371, otp_7227, otp_5494, otp_5644,
- otp_5878, otp_5917, otp_6585, otp_6885, export_all,
+ otp_5878, otp_5917, otp_6585, otp_6885, otp_10436, export_all,
bif_clash, behaviour_basic, behaviour_multiple,
otp_7550, otp_8051, format_warn, {group, on_load},
too_many_arguments].
@@ -1307,41 +1308,30 @@ guard(Config) when is_list(Config) ->
foo;
t3(A) when erlang:is_record(A, {apa}) ->
foo;
- t3(A) when {erlang,is_record}(A, {apa}) ->
- foo;
t3(A) when is_record(A, {apa}, 1) ->
foo;
t3(A) when erlang:is_record(A, {apa}, 1) ->
foo;
- t3(A) when {erlang,is_record}(A, {apa}, 1) ->
- foo;
t3(A) when is_record(A, apa, []) ->
foo;
t3(A) when erlang:is_record(A, apa, []) ->
foo;
- t3(A) when {erlang,is_record}(A, apa, []) ->
- foo;
t3(A) when record(A, apa) ->
foo;
t3(A) when is_record(A, apa) ->
foo;
t3(A) when erlang:is_record(A, apa) ->
- foo;
- t3(A) when {erlang,is_record}(A, apa) ->
foo.
">>,
[warn_unused_vars, nowarn_obsolete_guard],
{errors,[{2,erl_lint,illegal_guard_expr},
- {4,erl_lint,illegal_guard_expr},
- {6,erl_lint,illegal_guard_expr},
- {8,erl_lint,illegal_guard_expr},
+ {4,erl_lint,illegal_guard_expr},
+ {6,erl_lint,illegal_guard_expr},
+ {8,erl_lint,illegal_guard_expr},
{10,erl_lint,illegal_guard_expr},
{12,erl_lint,illegal_guard_expr},
- {14,erl_lint,illegal_guard_expr},
- {16,erl_lint,illegal_guard_expr},
- {18,erl_lint,illegal_guard_expr},
- {20,erl_lint,illegal_guard_expr}],
- []}},
+ {14,erl_lint,illegal_guard_expr}],
+ []}},
{guard6,
<<"-record(apa,{a=a,b=foo:bar()}).
apa() ->
@@ -2397,6 +2387,28 @@ otp_6885(Config) when is_list(Config) ->
[]} = run_test2(Config, Ts, []),
ok.
+otp_10436(doc) ->
+ "OTP-6885. Warnings for opaque types.";
+otp_10436(suite) -> [];
+otp_10436(Config) when is_list(Config) ->
+ Ts = <<"-module(otp_10436).
+ -export_type([t1/0]).
+ -opaque t1() :: {i, integer()}.
+ -opaque t2() :: {a, atom()}.
+ ">>,
+ {warnings,[{4,erl_lint,{not_exported_opaque,{t2,0}}},
+ {4,erl_lint,{unused_type,{t2,0}}}]} =
+ run_test2(Config, Ts, []),
+ Ts2 = <<"-module(otp_10436_2).
+ -export_type([t1/0, t2/0]).
+ -opaque t1() :: term().
+ -opaque t2() :: any().
+ ">>,
+ {warnings,[{3,erl_lint,{underspecified_opaque,{t1,0}}},
+ {4,erl_lint,{underspecified_opaque,{t2,0}}}]} =
+ run_test2(Config, Ts2, []),
+ ok.
+
export_all(doc) ->
"OTP-7392. Warning for export_all.";
export_all(Config) when is_list(Config) ->
@@ -2845,10 +2857,10 @@ otp_8051(doc) ->
otp_8051(Config) when is_list(Config) ->
Ts = [{otp_8051,
<<"-opaque foo() :: bar().
+ -export_type([foo/0]).
">>,
[],
- {error,[{1,erl_lint,{undefined_type,{bar,0}}}],
- [{1,erl_lint,{unused_type,{foo,0}}}]}}],
+ {errors,[{1,erl_lint,{undefined_type,{bar,0}}}],[]}}],
?line [] = run(Config, Ts),
ok.
diff --git a/lib/stdlib/test/escript_SUITE.erl b/lib/stdlib/test/escript_SUITE.erl
index 9f95df062b..5b592c65cc 100644
--- a/lib/stdlib/test/escript_SUITE.erl
+++ b/lib/stdlib/test/escript_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2012. 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
@@ -29,6 +29,7 @@
module_script/1,
beam_script/1,
archive_script/1,
+ archive_script_file_access/1,
epp/1,
create_and_extract/1,
foldl/1,
@@ -44,7 +45,8 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[basic, errors, strange_name, emulator_flags,
module_script, beam_script, archive_script, epp,
- create_and_extract, foldl, overflow].
+ create_and_extract, foldl, overflow,
+ archive_script_file_access].
groups() ->
[].
@@ -62,7 +64,7 @@ end_per_group(_GroupName, Config) ->
Config.
init_per_testcase(_Case, Config) ->
- ?line Dog = ?t:timetrap(?t:minutes(1)),
+ ?line Dog = ?t:timetrap(?t:minutes(5)),
[{watchdog,Dog}|Config].
end_per_testcase(_Case, Config) ->
@@ -356,7 +358,7 @@ beam_script(Config) when is_list(Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Create an archive file containing two entire applications plus two
%% alternate main modules. Generate a new escript containing the archive
-%% (with .app and .beam files and ) and the escript header.
+%% (with .app and .beam files and) and the escript header.
archive_script(Config) when is_list(Config) ->
%% Copy the orig files to priv_dir
@@ -464,6 +466,147 @@ archive_script(Config) when is_list(Config) ->
ok.
+%% Test the correction of OTP-10071
+%% The errors identified are
+%%
+%% a) If primary archive was named "xxx", then a file in the same
+%% directory named "xxxyyy" would be interpreted as a file named yyy
+%% inside the archive.
+%%
+%% b) erl_prim_loader did not correctly create and normalize absolute
+%% paths for primary archive and files inside it, so unless given
+%% with exact same path files inside the archive would not be
+%% found. E.g. if escript was started as ./xxx then "xxx/file"
+%% would not be found since erl_prim_loader would try to match
+%% /full/path/to/xxx with /full/path/to/./xxx. Same problem with
+%% ../. Also, the use of symlinks in the path to the archive would
+%% cause problems.
+%%
+%% c) Depending on how the primary archive was built,
+%% erl_prim_loader:list_dir/1 would sometimes return an empty string
+%% inside the file list. This was a virtual element representing the
+%% top directory of the archive. This shall not occur.
+%%
+archive_script_file_access(Config) when is_list(Config) ->
+ %% Copy the orig files to priv_dir
+ DataDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
+
+ MainMod = "archive_script_file_access",
+ MainSrc = MainMod ++ ".erl",
+ MainBeam = MainMod ++ ".beam",
+
+ Archive = filename:join([PrivDir, "archive_script_file_access.zip"]),
+ ?line {ok, _} = zip:create(Archive, ["archive_script_file_access"],
+ [{compress, []}, {cwd, DataDir}]),
+ ?line {ok, _} = zip:extract(Archive, [{cwd, PrivDir}]),
+ TopDir = filename:join([PrivDir, "archive_script_file_access"]),
+
+ %% Compile the code
+ ?line ok = compile_files([MainSrc], TopDir, TopDir),
+
+ %% First, create a file structure which will be included in the archive:
+ %%
+ %% dir1/
+ %% dir1/subdir1/
+ %% dir1/subdir1/file1
+ %%
+ {ok, OldDir} = file:get_cwd(),
+ ok = file:set_cwd(TopDir),
+ DummyDir = "dir1",
+ DummySubDir = filename:join(DummyDir, "subdir1"),
+ RelDummyFile = filename:join(DummySubDir, "file1"),
+ DummyFile = filename:join(TopDir,RelDummyFile),
+ ok = filelib:ensure_dir(DummyFile),
+ ok = file:write_file(DummyFile, ["foo\nbar\nbaz"]),
+
+ %% 1. Create zip archive by adding the dummy file and the beam
+ %% file as binaries to zip.
+ %%
+ %% This used to provoke the following issues when the script was run as
+ %% "./<script_name>":
+ %% a. erl_prim_loader:read_file_info/1 returning 'error'
+ %% b. erl_prim_loader:list_dir/1 returning {ok, ["dir1", [], "file1"]}
+ %% leading to an infinite loop in reltool_target:spec_dir/1
+ Files1 =
+ lists:map(fun(Filename) ->
+ {ok, Bin} = file:read_file(Filename),
+ {Filename,Bin}
+ end,
+ [RelDummyFile,MainBeam]),
+ {ok, {"mem", Bin1}} = zip:create("mem", Files1, [memory]),
+
+ %% Create the escript
+ ScriptName1 = "archive_script_file_access1",
+ Script1 = filename:join([PrivDir, ScriptName1]),
+ Flags = "-escript main " ++ MainMod,
+ ok = escript:create(Script1,[shebang,{emu_args,Flags},{archive,Bin1}]),
+ ok = file:change_mode(Script1,8#00744),
+
+ %% If supported, create a symlink to the script. This is used to
+ %% test error b) described above this test case.
+ SymlinkName1 = "symlink_to_"++ScriptName1,
+ Symlink1 = filename:join([PrivDir, SymlinkName1]),
+ file:make_symlink(ScriptName1,Symlink1), % will fail if not supported
+
+ %% Also add a dummy file in the same directory with the same name
+ %% as the script except is also has an extension. This used to
+ %% test error a) described above this test case.
+ ok = file:write_file(Script1 ++ ".extension",
+ <<"same name as script, but with extension">>),
+
+ %% Change to script's directory and run it as "./<script_name>"
+ ok = file:set_cwd(PrivDir),
+ run(PrivDir, "./" ++ ScriptName1 ++ " " ++ ScriptName1,
+ [<<"ExitCode:0">>]),
+ ok = file:set_cwd(TopDir),
+
+
+ %% 2. Create zip archive by letting zip read the files from the file system
+ %%
+ %% The difference compared to the archive_script_file_access1 is
+ %% that this will have a file element for each directory in the
+ %% archive - while archive_script_file_access1 will only have a
+ %% file element per regular file.
+ Files2 = [DummyDir,MainBeam],
+ {ok, {"mem", Bin2}} = zip:create("mem", Files2, [memory]),
+
+ %% Create the escript
+ ScriptName2 = "archive_script_file_access2",
+ Script2 = filename:join([PrivDir, ScriptName2]),
+ ok = escript:create(Script2,[shebang,{emu_args,Flags},{archive,Bin2}]),
+ ok = file:change_mode(Script2,8#00744),
+
+ %% Also add a dummy file in the same directory with the same name
+ %% as the script except is also has an extension. This used to
+ %% test error a) described above this test case.
+ ok = file:write_file(Script2 ++ ".extension",
+ <<"same name as script, but with extension">>),
+
+ %% If supported, create a symlink to the script. This is used to
+ %% test error b) described above this test case.
+ SymlinkName2 = "symlink_to_"++ScriptName2,
+ Symlink2 = filename:join([PrivDir, SymlinkName2]),
+ file:make_symlink(ScriptName2,Symlink2), % will fail if not supported
+
+ %% Change to script's directory and run it as "./<script_name>"
+ ok = file:set_cwd(PrivDir),
+ run(PrivDir, "./" ++ ScriptName2 ++ " " ++ ScriptName2,
+ [<<"ExitCode:0">>]),
+
+ %% 3. If symlinks are supported, run one of the scripts via a symlink.
+ %%
+ %% This is in order to test error b) described above this test case.
+ case file:read_link(Symlink2) of
+ {ok,_} ->
+ run(PrivDir, "./" ++ SymlinkName2 ++ " " ++ ScriptName2,
+ [<<"ExitCode:0">>]);
+ _ -> % not supported
+ ok
+ end,
+ ok = file:set_cwd(OldDir).
+
+
compile_app(TopDir, AppName) ->
AppDir = filename:join([TopDir, AppName]),
SrcDir = filename:join([AppDir, "src"]),
@@ -475,7 +618,7 @@ compile_files([File | Files], SrcDir, OutDir) ->
case filename:extension(File) of
".erl" ->
AbsFile = filename:join([SrcDir, File]),
- case compile:file(AbsFile, [{outdir, OutDir}]) of
+ case compile:file(AbsFile, [{outdir, OutDir},report_errors]) of
{ok, _Mod} ->
compile_files(Files, SrcDir, OutDir);
Error ->
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 de56579998..1cddef0e3d 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-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -21,6 +21,8 @@
-export([main/1]).
+-include_lib("kernel/include/file.hrl").
+
-define(DUMMY, archive_script_dummy).
-define(DICT, archive_script_dict).
@@ -32,7 +34,7 @@ main(MainArgs) ->
io:format("dummy:~p\n",[[E || E <- ErlArgs, element(1, E) =:= ?DUMMY]]),
%% Start the applications
- {error, {not_started, ?DICT}} = application:start(archive_script_dummy),
+ {error, {not_started, ?DICT}} = application:start(?DUMMY),
ok = application:start(?DICT),
ok = application:start(?DUMMY),
@@ -57,4 +59,17 @@ main(MainArgs) ->
ok = ?DICT:erase(Tab, Key),
error = ?DICT:find(Tab, Key),
ok = ?DICT:erase(Tab),
+
+ %% Check mtime related caching bug with escript/primary archive files
+ Escript = escript:script_name(),
+ {ok, FileInfo} = file:read_file_info(Escript),
+ %% Modify mtime of archive file and try to reload module
+ FileInfo2 = FileInfo#file_info{mtime=calendar:now_to_local_time(now())},
+ ok = file:write_file_info(Escript, FileInfo2),
+ Module = ?DICT,
+ {file, _} = code:is_loaded(Module),
+ true = code:delete(Module),
+ false = code:is_loaded(Module),
+ {module, Module} = code:ensure_loaded(Module),
+
ok.
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
new file mode 100644
index 0000000000..b03c8ba70d
--- /dev/null
+++ b/lib/stdlib/test/escript_SUITE_data/archive_script_file_access/archive_script_file_access.erl
@@ -0,0 +1,105 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(archive_script_file_access).
+-behaviour(escript).
+
+-export([main/1]).
+
+-include_lib("kernel/include/file.hrl").
+
+main([RelArchiveFile]) ->
+
+ AbsArchiveFile = filename:absname(RelArchiveFile),
+ DotSlashArchiveFile = "./" ++ RelArchiveFile,
+
+ Beam = atom_to_list(?MODULE) ++ ".beam",
+ AbsBeam = filename:join(AbsArchiveFile,Beam),
+ RelBeam = filename:join(RelArchiveFile,Beam),
+ DotSlashBeam = filename:join(DotSlashArchiveFile,Beam),
+ Dir = "dir1",
+ AbsDir = filename:join(AbsArchiveFile,Dir),
+ RelDir = filename:join(RelArchiveFile,Dir),
+ DotSlashDir = filename:join(DotSlashArchiveFile,Dir),
+ SubDir = "subdir1",
+ AbsSubDir = filename:join(AbsDir,SubDir),
+ RelSubDir = filename:join(RelDir,SubDir),
+ DotSlashSubDir = filename:join(DotSlashDir,SubDir),
+
+ {ok,List1} = erl_prim_loader:list_dir(AbsArchiveFile),
+ {ok,List1} = erl_prim_loader:list_dir(RelArchiveFile),
+ {ok,List1} = erl_prim_loader:list_dir(DotSlashArchiveFile),
+ {ok,List1} = erl_prim_loader:list_dir(AbsArchiveFile ++ "/"),
+ {ok,List1} = erl_prim_loader:list_dir(AbsArchiveFile ++ "/."),
+ {ok,List1} = erl_prim_loader:list_dir(filename:join([AbsDir,".."])),
+ {ok,List1} = erl_prim_loader:list_dir(filename:join([RelDir,".."])),
+ {ok,List1} = erl_prim_loader:list_dir(filename:join([DotSlashDir,".."])),
+ {ok,List1} = erl_prim_loader:list_dir(filename:join([AbsSubDir,"..",".."])),
+ {ok,List1} = erl_prim_loader:list_dir(filename:join([RelSubDir,"..",".."])),
+ {ok,List1} = erl_prim_loader:list_dir(filename:join([DotSlashSubDir,"..",".."])),
+ false = lists:member([],List1),
+
+ %% If symlinks are supported on this platform...
+ RelSymlinkArchiveFile = "symlink_to_" ++ RelArchiveFile,
+ case file:read_link(RelSymlinkArchiveFile) of
+ {ok,_} ->
+ DotSlashSymlinkArchiveFile = "./" ++ RelSymlinkArchiveFile,
+ AbsSymlinkArchiveFile=filename:join(filename:dirname(AbsArchiveFile),
+ RelSymlinkArchiveFile),
+ {ok,List1} = erl_prim_loader:list_dir(AbsSymlinkArchiveFile),
+ {ok,List1} = erl_prim_loader:list_dir(RelSymlinkArchiveFile),
+ {ok,List1} = erl_prim_loader:list_dir(DotSlashSymlinkArchiveFile);
+ _ -> % not supported
+ ok
+ end,
+
+
+ {ok,List2} = erl_prim_loader:list_dir(AbsDir),
+ {ok,List2} = erl_prim_loader:list_dir(RelDir),
+ {ok,List2} = erl_prim_loader:list_dir(DotSlashDir),
+ false = lists:member([],List2),
+
+ error = erl_prim_loader:list_dir(AbsBeam),
+ error = erl_prim_loader:list_dir(RelBeam),
+ error = erl_prim_loader:list_dir(DotSlashBeam),
+
+ error = erl_prim_loader:get_file(AbsArchiveFile),
+ error = erl_prim_loader:get_file(RelArchiveFile),
+ error = erl_prim_loader:get_file(DotSlashArchiveFile),
+ error = erl_prim_loader:get_file(AbsArchiveFile ++ "/"),
+ error = erl_prim_loader:get_file(AbsArchiveFile ++ "/."),
+ {ok,Bin,AbsBeam} = erl_prim_loader:get_file(AbsBeam),
+ {ok,Bin,RelBeam} = erl_prim_loader:get_file(RelBeam),
+ {ok,Bin,DotSlashBeam} = erl_prim_loader:get_file(DotSlashBeam),
+
+ {ok,#file_info{type=directory}=DFI} =
+ erl_prim_loader:read_file_info(AbsArchiveFile),
+ {ok,DFI} = erl_prim_loader:read_file_info(RelArchiveFile),
+ {ok,DFI} = erl_prim_loader:read_file_info(DotSlashArchiveFile),
+ {ok,DFI} = erl_prim_loader:read_file_info(AbsArchiveFile ++ "/"),
+ {ok,DFI} = erl_prim_loader:read_file_info(AbsArchiveFile ++ "/."),
+ {ok,#file_info{type=regular}=RFI} = erl_prim_loader:read_file_info(AbsBeam),
+ {ok,RFI} = erl_prim_loader:read_file_info(RelBeam),
+ {ok,RFI} = erl_prim_loader:read_file_info(DotSlashBeam),
+
+ F = AbsArchiveFile ++ ".extension",
+ error = erl_prim_loader:list_dir(F),
+ {ok,_,_} = erl_prim_loader:get_file(F),
+ {ok,#file_info{type=regular}} = erl_prim_loader:read_file_info(F),
+
+ ok.
diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl
index 101828fdef..d5c1c5276e 100644
--- a/lib/stdlib/test/ets_SUITE.erl
+++ b/lib/stdlib/test/ets_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -72,7 +72,9 @@
exit_many_many_tables_owner/1]).
-export([write_concurrency/1, heir/1, give_away/1, setopts/1]).
-export([bad_table/1, types/1]).
+-export([otp_9932/1]).
-export([otp_9423/1]).
+-export([otp_10182/1]).
-export([init_per_testcase/2, end_per_testcase/2]).
%% Convenience for manual testing
@@ -145,6 +147,8 @@ all() ->
exit_many_large_table_owner, exit_many_tables_owner,
exit_many_many_tables_owner, write_concurrency, heir,
give_away, setopts, bad_table, types,
+ otp_10182,
+ otp_9932,
otp_9423].
groups() ->
@@ -713,30 +717,17 @@ adjust_xmem([T1,T2,T3,T4], {A0,B0,C0,D0} = _Mem0) ->
TabDiff = ?TAB_STRUCT_SZ,
Mem1 = {A0+TabDiff, B0+TabDiff, C0+TabDiff, D0+TabDiff},
- Mem2 = case {erlang:system_info({wordsize,internal}),erlang:system_info({wordsize,external})} of
- %% Halfword, corrections for regular pointers occupying two internal words.
- {4,8} ->
- {A1,B1,C1,D1} = Mem1,
- {A1+4*ets:info(T1, size)+?DB_TREE_STACK_NEED,
- B1+3*ets:info(T2, size)+?DB_HASH_SIZEOF_EXTSEG,
- C1+3*ets:info(T3, size)+?DB_HASH_SIZEOF_EXTSEG,
- D1+3*ets:info(T4, size)+?DB_HASH_SIZEOF_EXTSEG};
- _ ->
- Mem1
- end,
-
- %% Adjust for hybrid and shared heaps:
- %% Each record is one word smaller.
- %%Mem2 = case erlang:system_info(heap_type) of
- %% private ->
- %% Mem1;
- %% _ ->
- %% {A1,B1,C1,D1} = Mem1,
- %% {A1-ets:info(T1, size),B1-ets:info(T2, size),
- %% C1-ets:info(T3, size),D1-ets:info(T4, size)}
- %% end,
- %%{Mem2,{ets:info(T1,stats),ets:info(T2,stats),ets:info(T3,stats),ets:info(T4,stats)}}.
- Mem2.
+ case {erlang:system_info({wordsize,internal}),erlang:system_info({wordsize,external})} of
+ %% Halfword, corrections for regular pointers occupying two internal words.
+ {4,8} ->
+ {A1,B1,C1,D1} = Mem1,
+ {A1+4*ets:info(T1, size)+?DB_TREE_STACK_NEED,
+ B1+3*ets:info(T2, size)+?DB_HASH_SIZEOF_EXTSEG,
+ C1+3*ets:info(T3, size)+?DB_HASH_SIZEOF_EXTSEG,
+ D1+3*ets:info(T4, size)+?DB_HASH_SIZEOF_EXTSEG};
+ _ ->
+ Mem1
+ end.
t_whitebox(doc) ->
["Diverse whitebox testes"];
@@ -1035,6 +1026,8 @@ t_test_ms(Config) when is_list(Config) ->
[{{'$1','$2'},[{'<','$1','$2'}],['$$']}]),
?line {ok,false} = ets:test_ms({a,b},
[{{'$1','$2'},[{'>','$1','$2'}],['$$']}]),
+ Tpl = {a,gb_sets:new()},
+ ?line {ok,Tpl} = ets:test_ms(Tpl, [{{'_','_'}, [], ['$_']}]), % OTP-10190
?line {error,[{error,String}]} = ets:test_ms({a,b},
[{{'$1','$2'},
[{'flurp','$1','$2'}],
@@ -4215,21 +4208,13 @@ heavy_lookup_element(Config) when is_list(Config) ->
repeat_for_opts(heavy_lookup_element_do).
heavy_lookup_element_do(Opts) ->
- ?line EtsMem = etsmem(),
- ?line Tab = ets_new(foobar_table, [set, protected, {keypos, 2} | Opts]),
- ?line ok = fill_tab2(Tab, 0, 7000),
- case os:type() of
- vxworks ->
- ?line ?t:do_times(5, ?MODULE, do_lookup_element,
- [Tab, 6999, 1]);
- % lookup ALL elements 5 times.
- _ ->
- ?line ?t:do_times(50, ?MODULE, do_lookup_element,
- [Tab, 6999, 1])
- % lookup ALL elements 50 times.
- end,
- ?line true = ets:delete(Tab),
- ?line verify_etsmem(EtsMem).
+ EtsMem = etsmem(),
+ Tab = ets_new(foobar_table, [set, protected, {keypos, 2} | Opts]),
+ ok = fill_tab2(Tab, 0, 7000),
+ % lookup ALL elements 50 times
+ ?t:do_times(50, ?MODULE, do_lookup_element, [Tab, 6999, 1]),
+ true = ets:delete(Tab),
+ verify_etsmem(EtsMem).
do_lookup_element(_Tab, 0, _) -> ok;
do_lookup_element(Tab, N, M) ->
@@ -5434,6 +5419,22 @@ types_do(Opts) ->
?line verify_etsmem(EtsMem).
+%% OTP-9932: Memory overwrite when inserting large integers in compressed bag.
+%% Will crash with segv on 64-bit opt if not fixed.
+otp_9932(Config) when is_list(Config) ->
+ T = ets:new(xxx, [bag, compressed]),
+ Fun = fun(N) ->
+ Key = {1316110174588445 bsl N,1316110174588583 bsl N},
+ S = {Key, Key},
+ true = ets:insert(T, S),
+ [S] = ets:lookup(T, Key),
+ true = ets:insert(T, S),
+ [S] = ets:lookup(T, Key)
+ end,
+ lists:foreach(Fun, lists:seq(0, 16)),
+ ets:delete(T).
+
+
otp_9423(doc) -> ["vm-deadlock caused by race between ets:delete and others on write_concurrency table"];
otp_9423(Config) when is_list(Config) ->
InitF = fun(_) -> {0,0} end,
@@ -5465,6 +5466,20 @@ otp_9423(Config) when is_list(Config) ->
Skipped -> Skipped
end.
+
+%% Corrupted binary in compressed table
+otp_10182(Config) when is_list(Config) ->
+ Bin = <<"aHR0cDovL2hvb3RzdWl0ZS5jb20vYy9wcm8tYWRyb2xsLWFi">>,
+ Key = {test, Bin},
+ Value = base64:decode(Bin),
+ In = {Key,Value},
+ Db = ets:new(undefined, [set, protected, {read_concurrency, true}, compressed]),
+ ets:insert(Db, In),
+ [Out] = ets:lookup(Db, Key),
+ io:format("In : ~p\nOut: ~p\n", [In,Out]),
+ ets:delete(Db),
+ In = Out.
+
diff --git a/lib/stdlib/test/filelib_SUITE.erl b/lib/stdlib/test/filelib_SUITE.erl
index 1de639a166..1fd7518519 100644
--- a/lib/stdlib/test/filelib_SUITE.erl
+++ b/lib/stdlib/test/filelib_SUITE.erl
@@ -176,9 +176,64 @@ do_wildcard_5(Dir, Wcf) ->
%% Cleanup
?line del(Files),
- ?line foreach(fun(D) -> ok = file:del_dir(filename:join(Dir, D)) end, Dirs).
+ ?line foreach(fun(D) -> ok = file:del_dir(filename:join(Dir, D)) end, Dirs),
+ do_wildcard_6(Dir, Wcf).
+
+do_wildcard_6(Dir, Wcf) ->
+ ok = file:make_dir(filename:join(Dir, "xbin")),
+ All = ["xbin/a.x","xbin/b.x","xbin/c.x"],
+ Files = mkfiles(All, Dir),
+ All = Wcf("xbin/*.x"),
+ All = Wcf("xbin/*"),
+ ["xbin"] = Wcf("*"),
+ All = Wcf("*/*"),
+ del(Files),
+ ok = file:del_dir(filename:join(Dir, "xbin")),
+ do_wildcard_7(Dir, Wcf).
+
+do_wildcard_7(Dir, Wcf) ->
+ Dirs = ["blurf","xa","yyy"],
+ SubDirs = ["blurf/nisse"],
+ foreach(fun(D) ->
+ ok = file:make_dir(filename:join(Dir, D))
+ end, Dirs ++ SubDirs),
+ All = ["blurf/nisse/baz","xa/arne","xa/kalle","yyy/arne"],
+ Files = mkfiles(lists:reverse(All), Dir),
+ %% Test.
+ Listing = Wcf("**"),
+ ["blurf","blurf/nisse","blurf/nisse/baz",
+ "xa","xa/arne","xa/kalle","yyy","yyy/arne"] = Listing,
+ Listing = Wcf("**/*"),
+ ["xa/arne","yyy/arne"] = Wcf("**/arne"),
+ ["blurf/nisse"] = Wcf("**/nisse"),
+ [] = Wcf("mountain/**"),
+
+ %% Cleanup
+ del(Files),
+ foreach(fun(D) ->
+ ok = file:del_dir(filename:join(Dir, D))
+ end, SubDirs ++ Dirs),
+ do_wildcard_8(Dir, Wcf).
+
+do_wildcard_8(Dir, Wcf) ->
+ Dirs0 = ["blurf"],
+ Dirs1 = ["blurf/nisse"],
+ Dirs2 = ["blurf/nisse/a", "blurf/nisse/b"],
+ foreach(fun(D) ->
+ ok = file:make_dir(filename:join(Dir, D))
+ end, Dirs0 ++ Dirs1 ++ Dirs2),
+ All = ["blurf/nisse/a/1.txt", "blurf/nisse/b/2.txt", "blurf/nisse/b/3.txt"],
+ Files = mkfiles(lists:reverse(All), Dir),
+ %% Test.
+ All = Wcf("**/blurf/**/*.txt"),
+
+ %% Cleanup
+ del(Files),
+ foreach(fun(D) ->
+ ok = file:del_dir(filename:join(Dir, D))
+ end, Dirs2 ++ Dirs1 ++ Dirs0).
fold_files(Config) when is_list(Config) ->
?line Dir = filename:join(?config(priv_dir, Config), "fold_files"),
diff --git a/lib/stdlib/test/filename_SUITE.erl b/lib/stdlib/test/filename_SUITE.erl
index 4cfa589660..232df6a13f 100644
--- a/lib/stdlib/test/filename_SUITE.erl
+++ b/lib/stdlib/test/filename_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -25,7 +25,7 @@
-export([pathtype/1,rootname/1,split/1,find_src/1]).
-export([absname_bin/1, absname_bin_2/1,
basename_bin_1/1, basename_bin_2/1,
- dirname_bin/1, extension_bin/1, join_bin/1]).
+ dirname_bin/1, extension_bin/1, join_bin/1, t_nativename_bin/1]).
-export([pathtype_bin/1,rootname_bin/1,split_bin/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -38,7 +38,7 @@ all() ->
join, pathtype, rootname, split, t_nativename, find_src,
absname_bin, absname_bin_2, basename_bin_1, basename_bin_2, dirname_bin,
extension_bin,
- join_bin, pathtype_bin, rootname_bin, split_bin].
+ join_bin, pathtype_bin, rootname_bin, split_bin, t_nativename_bin].
groups() ->
[].
@@ -112,19 +112,6 @@ absname(Config) when is_list(Config) ->
?line "/erlang/src" = filename:absname(["/erl",'a','ng',"/",'s',"rc"]),
?line "/erlang/src" = filename:absname("/erlang///src"),
?line "/file_sorter.erl" = filename:absname([file_sorter|'.erl']),
- ok;
- vxworks ->
- Test_dir = ?config(priv_dir, Config),
- Test1 = Test_dir ++ "/foo",
- Test2 = Test_dir ++ "/ebin",
- ?line ok = file:set_cwd(Test_dir),
- ?line Test1 = filename:absname(foo),
- ?line Test1= filename:absname("foo"),
- ?line Test2 = filename:absname("foo/../ebin"),
- ?line "/erlang" = filename:absname("/erlang"),
- ?line "/erlang/src" = filename:absname("/erlang/src"),
- ?line "/erlang/src" = filename:absname(["/erlan",'g/s',"rc"]),
- ?line "/erlang/src" = filename:absname("/erlang///src"),
ok
end.
@@ -179,15 +166,6 @@ absname_2(Config) when is_list(Config) ->
?line "/erlang" = filename:absname("/erlang", "/"),
?line "/erlang/src" = filename:absname("/erlang/src", "/"),
?line "/erlang/src" = filename:absname("/erlang///src", "/"),
- ok;
- vxworks ->
- ?line "/usr/foo" = filename:absname(foo, "/usr"),
- ?line "/usr/foo" = filename:absname("foo", "/usr"),
- ?line "/usr/ebin" = filename:absname("../ebin", "/usr"),
- ?line "/usr/ebin" = filename:absname("../ebin", "/usr/src"),
- ?line "/erlang" = filename:absname("/erlang", "/usr"),
- ?line "/erlang/src" = filename:absname("/erlang/src", "/usr"),
- ?line "/erlang/src" = filename:absname("/erlang///src", "/usr"),
ok
end.
@@ -213,11 +191,7 @@ basename_1(Config) when is_list(Config) ->
?line "foo" = filename:basename("A:foo");
{unix, _} ->
?line "strange\\but\\true" =
- filename:basename("strange\\but\\true");
- vxworks ->
- ?line "foo" = filename:basename(["usr\\foo\\"]),
- ?line "foo" = filename:basename("elrond:usr\\foo\\"),
- ?line "foo" = filename:basename("disk:/foo")
+ filename:basename("strange\\but\\true")
end,
?line test_server:timetrap_cancel(Dog),
ok.
@@ -249,15 +223,7 @@ basename_2(Config) when is_list(Config) ->
?line "strange\\but\\true" =
filename:basename("strange\\but\\true.erl", ".erl"),
?line "strange\\but\\true" =
- filename:basename("strange\\but\\true", ".erl");
- vxworks ->
- ?line "foo" = filename:basename("net:foo", ".erl"),
- ?line "foo.erl" = filename:basename("net:\\usr\\foo.erl",
- ".hrl"),
- ?line "foo.erl" =
- filename:basename("/disk0:\\usr.hrl\\foo.erl",
- ".hrl"),
- ?line "foo" = filename:basename("/home\\usr\\foo", ".hrl")
+ filename:basename("strange\\but\\true", ".erl")
end,
?line test_server:timetrap_cancel(Dog),
ok.
@@ -267,37 +233,25 @@ basename_2(Config) when is_list(Config) ->
dirname(Config) when is_list(Config) ->
case os:type() of
{win32,_} ->
- ?line "A:/usr" = filename:dirname("A:/usr/foo.erl"),
- ?line "A:usr" = filename:dirname("A:usr/foo.erl"),
- ?line "/usr" = filename:dirname("\\usr\\foo.erl"),
- ?line "/" = filename:dirname("\\usr"),
- ?line "A:" = filename:dirname("A:");
- vxworks ->
- ?line "net:/usr" = filename:dirname("net:/usr/foo.erl"),
- ?line "/disk0:/usr" = filename:dirname("/disk0:/usr/foo.erl"),
- ?line "/usr" = filename:dirname("\\usr\\foo.erl"),
- ?line "/usr" = filename:dirname("\\usr"),
- ?line "net:" = filename:dirname("net:");
+ "A:/usr" = filename:dirname("A:/usr/foo.erl"),
+ "A:usr" = filename:dirname("A:usr/foo.erl"),
+ "/usr" = filename:dirname("\\usr\\foo.erl"),
+ "/" = filename:dirname("\\usr"),
+ "A:" = filename:dirname("A:");
_ -> true
end,
- ?line "usr" = filename:dirname("usr///foo.erl"),
- ?line "." = filename:dirname("foo.erl"),
- ?line "." = filename:dirname("."),
- ?line "usr" = filename:dirname('usr/foo.erl'),
- ?line "usr" = filename:dirname(['usr','/foo.erl']),
- ?line "usr" = filename:dirname(['us','r/foo.erl']),
- ?line "usr" = filename:dirname(['usr/','/foo.erl']),
- ?line "usr" = filename:dirname(['usr/','foo.erl']),
- ?line "usr" = filename:dirname(['usr/'|'foo.erl']),
- ?line "usr" = filename:dirname(['usr/f','oo.erl']),
- case os:type() of
- vxworks ->
- ?line "/" = filename:dirname("/"),
- ?line "/usr" = filename:dirname("/usr");
- _ ->
- ?line "/" = filename:dirname("/"),
- ?line "/" = filename:dirname("/usr")
- end,
+ "usr" = filename:dirname("usr///foo.erl"),
+ "." = filename:dirname("foo.erl"),
+ "." = filename:dirname("."),
+ "usr" = filename:dirname('usr/foo.erl'),
+ "usr" = filename:dirname(['usr','/foo.erl']),
+ "usr" = filename:dirname(['us','r/foo.erl']),
+ "usr" = filename:dirname(['usr/','/foo.erl']),
+ "usr" = filename:dirname(['usr/','foo.erl']),
+ "usr" = filename:dirname(['usr/'|'foo.erl']),
+ "usr" = filename:dirname(['usr/f','oo.erl']),
+ "/" = filename:dirname("/"),
+ "/" = filename:dirname("/usr"),
ok.
@@ -319,12 +273,6 @@ extension(Config) when is_list(Config) ->
filename:extension("A:/usr.bar/foo.nisse.erl"),
?line "" = filename:extension("A:/usr.bar/foo"),
ok;
- vxworks ->
- ?line "" = filename:extension("/disk0:\\usr\\foo"),
- ?line ".erl" =
- filename:extension("net:/usr.bar/foo.nisse.erl"),
- ?line "" = filename:extension("net:/usr.bar/foo"),
- ok;
_ -> ok
end.
@@ -369,25 +317,6 @@ join(Config) when is_list(Config) ->
filename:join(["A:","C:usr","foo.erl"]),
?line "d:/foo" = filename:join([$D, $:, $/, []], "foo"),
ok;
- vxworks ->
- ?line "Net:" = filename:join(["Net:/"]),
- ?line "net:" = filename:join(["net:\\"]),
- ?line "net:/abc" = filename:join(["net:/", "abc"]),
- ?line "net:/abc" = filename:join(["net:", "abc"]),
- ?line "a/b/c/d/e/f/g" =
- filename:join(["a//b\\c//\\/\\d/\\e/f\\g"]),
- ?line "net:/usr/foo.erl" =
- filename:join(["net:","usr","foo.erl"]),
- ?line "/usr/foo.erl" =
- filename:join(["net:","/usr","foo.erl"]),
- ?line "/target:usr" = filename:join("net:","/target:usr"),
- ?line "kernel:/usr" = filename:join("net:", "kernel:/usr"),
- ?line "foo:/usr/foo.erl" =
- filename:join(["A:","foo:/usr","foo.erl"]),
- ?line "/disk0:usr/foo.erl" =
- filename:join(["kalle:","/disk0:usr","foo.erl"]),
- ?line "D:/foo" = filename:join([$D, $:, $/, []], "foo"),
- ok;
{unix, _} ->
ok
end.
@@ -406,10 +335,6 @@ pathtype(Config) when is_list(Config) ->
{unix, _} ->
?line absolute = filename:pathtype("/"),
?line absolute = filename:pathtype("/usr/local/bin"),
- ok;
- vxworks ->
- ?line absolute = filename:pathtype("/usr/local/bin"),
- ?line absolute = filename:pathtype("net:usr/local/bin"),
ok
end.
@@ -424,12 +349,7 @@ rootname(Config) when is_list(Config) ->
ok.
split(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- ?line ["/usr","local","bin"] = filename:split("/usr/local/bin");
- _ ->
- ?line ["/","usr","local","bin"] = filename:split("/usr/local/bin")
- end,
+ ?line ["/","usr","local","bin"] = filename:split("/usr/local/bin"),
?line ["foo","bar"]= filename:split("foo/bar"),
?line ["foo", "bar", "hello"]= filename:split("foo////bar//hello"),
?line ["foo", "bar", "hello"]= filename:split(["foo//",'//bar//h',"ello"]),
@@ -447,18 +367,6 @@ split(Config) when is_list(Config) ->
?line ["a:","msdev","include"] =
filename:split("a:msdev\\include"),
ok;
- vxworks ->
- ?line ["net:","msdev","include"] =
- filename:split("net:/msdev/include"),
- ?line ["Target:","msdev","include"] =
- filename:split("Target:/msdev/include"),
- ?line ["msdev","include"] =
- filename:split("msdev\\include"),
- ?line ["/disk0:","msdev","include"] =
- filename:split("/disk0:\\msdev\\include"),
- ?line ["a:","msdev","include"] =
- filename:split("a:msdev\\include"),
- ok;
_ ->
ok
end.
@@ -657,56 +565,38 @@ basename_bin_2(Config) when is_list(Config) ->
dirname_bin(Config) when is_list(Config) ->
case os:type() of
{win32,_} ->
- ?line <<"A:/usr">> = filename:dirname(<<"A:/usr/foo.erl">>),
- ?line <<"A:usr">> = filename:dirname(<<"A:usr/foo.erl">>),
- ?line <<"/usr">> = filename:dirname(<<"\\usr\\foo.erl">>),
- ?line <<"/">> = filename:dirname(<<"\\usr">>),
- ?line <<"A:">> = filename:dirname(<<"A:">>);
- vxworks ->
- ?line <<"net:/usr">> = filename:dirname(<<"net:/usr/foo.erl">>),
- ?line <<"/disk0:/usr">> = filename:dirname(<<"/disk0:/usr/foo.erl">>),
- ?line <<"/usr">> = filename:dirname(<<"\\usr\\foo.erl">>),
- ?line <<"/usr">> = filename:dirname(<<"\\usr">>),
- ?line <<"net:">> = filename:dirname(<<"net:">>);
+ <<"A:/usr">> = filename:dirname(<<"A:/usr/foo.erl">>),
+ <<"A:usr">> = filename:dirname(<<"A:usr/foo.erl">>),
+ <<"/usr">> = filename:dirname(<<"\\usr\\foo.erl">>),
+ <<"/">> = filename:dirname(<<"\\usr">>),
+ <<"A:">> = filename:dirname(<<"A:">>);
_ -> true
end,
- ?line <<"usr">> = filename:dirname(<<"usr///foo.erl">>),
- ?line <<".">> = filename:dirname(<<"foo.erl">>),
- ?line <<".">> = filename:dirname(<<".">>),
- case os:type() of
- vxworks ->
- ?line <<"/">> = filename:dirname(<<"/">>),
- ?line <<"/usr">> = filename:dirname(<<"/usr">>);
- _ ->
- ?line <<"/">> = filename:dirname(<<"/">>),
- ?line <<"/">> = filename:dirname(<<"/usr">>)
- end,
+ <<"usr">> = filename:dirname(<<"usr///foo.erl">>),
+ <<".">> = filename:dirname(<<"foo.erl">>),
+ <<".">> = filename:dirname(<<".">>),
+ <<"/">> = filename:dirname(<<"/">>),
+ <<"/">> = filename:dirname(<<"/usr">>),
ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
extension_bin(Config) when is_list(Config) ->
- ?line <<".erl">> = filename:extension(<<"A:/usr/foo.erl">>),
- ?line <<".erl">> = filename:extension(<<"A:/usr/foo.nisse.erl">>),
- ?line <<".erl">> = filename:extension(<<"A:/usr.bar/foo.nisse.erl">>),
- ?line <<"">> = filename:extension(<<"A:/usr.bar/foo">>),
- ?line <<"">> = filename:extension(<<"A:/usr/foo">>),
- ?line case os:type() of
- {win32, _} ->
- ?line <<"">> = filename:extension(<<"A:\\usr\\foo">>),
- ?line <<".erl">> =
- filename:extension(<<"A:/usr.bar/foo.nisse.erl">>),
- ?line <<"">> = filename:extension(<<"A:/usr.bar/foo">>),
- ok;
- vxworks ->
- ?line <<"">> = filename:extension(<<"/disk0:\\usr\\foo">>),
- ?line <<".erl">> =
- filename:extension(<<"net:/usr.bar/foo.nisse.erl">>),
- ?line <<"">> = filename:extension(<<"net:/usr.bar/foo">>),
- ok;
- _ -> ok
- end.
+ <<".erl">> = filename:extension(<<"A:/usr/foo.erl">>),
+ <<".erl">> = filename:extension(<<"A:/usr/foo.nisse.erl">>),
+ <<".erl">> = filename:extension(<<"A:/usr.bar/foo.nisse.erl">>),
+ <<"">> = filename:extension(<<"A:/usr.bar/foo">>),
+ <<"">> = filename:extension(<<"A:/usr/foo">>),
+ case os:type() of
+ {win32, _} ->
+ ?line <<"">> = filename:extension(<<"A:\\usr\\foo">>),
+ ?line <<".erl">> =
+ filename:extension(<<"A:/usr.bar/foo.nisse.erl">>),
+ ?line <<"">> = filename:extension(<<"A:/usr.bar/foo">>),
+ ok;
+ _ -> ok
+ end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -754,53 +644,58 @@ join_bin(Config) when is_list(Config) ->
end.
pathtype_bin(Config) when is_list(Config) ->
- ?line relative = filename:pathtype(<<"..">>),
- ?line relative = filename:pathtype(<<"foo">>),
- ?line relative = filename:pathtype(<<"foo/bar">>),
- ?line relative = filename:pathtype('foo/bar'),
+ relative = filename:pathtype(<<"..">>),
+ relative = filename:pathtype(<<"foo">>),
+ relative = filename:pathtype(<<"foo/bar">>),
+ relative = filename:pathtype('foo/bar'),
case os:type() of
{win32, _} ->
- ?line volumerelative = filename:pathtype(<<"/usr/local/bin">>),
- ?line volumerelative = filename:pathtype(<<"A:usr/local/bin">>),
+ volumerelative = filename:pathtype(<<"/usr/local/bin">>),
+ volumerelative = filename:pathtype(<<"A:usr/local/bin">>),
ok;
{unix, _} ->
- ?line absolute = filename:pathtype(<<"/">>),
- ?line absolute = filename:pathtype(<<"/usr/local/bin">>),
+ absolute = filename:pathtype(<<"/">>),
+ absolute = filename:pathtype(<<"/usr/local/bin">>),
ok
end.
rootname_bin(Config) when is_list(Config) ->
- ?line <<"/jam.src/kalle">> = filename:rootname(<<"/jam.src/kalle">>),
- ?line <<"/jam.src/foo">> = filename:rootname(<<"/jam.src/foo.erl">>),
- ?line <<"/jam.src/foo">> = filename:rootname(<<"/jam.src/foo.erl">>, <<".erl">>),
- ?line <<"/jam.src/foo.jam">> = filename:rootname(<<"/jam.src/foo.jam">>, <<".erl">>),
- ?line <<"/jam.src/foo.jam">> = filename:rootname(["/jam.sr",'c/foo.j',"am"],<<".erl">>),
- ?line <<"/jam.src/foo.jam">> = filename:rootname(["/jam.sr",'c/foo.j'|am],<<".erl">>),
+ <<"/jam.src/kalle">> = filename:rootname(<<"/jam.src/kalle">>),
+ <<"/jam.src/foo">> = filename:rootname(<<"/jam.src/foo.erl">>),
+ <<"/jam.src/foo">> = filename:rootname(<<"/jam.src/foo.erl">>, <<".erl">>),
+ <<"/jam.src/foo.jam">> = filename:rootname(<<"/jam.src/foo.jam">>, <<".erl">>),
+ <<"/jam.src/foo.jam">> = filename:rootname(["/jam.sr",'c/foo.j',"am"],<<".erl">>),
+ <<"/jam.src/foo.jam">> = filename:rootname(["/jam.sr",'c/foo.j'|am],<<".erl">>),
ok.
split_bin(Config) when is_list(Config) ->
- case os:type() of
- vxworks ->
- ?line [<<"/usr">>,<<"local">>,<<"bin">>] = filename:split(<<"/usr/local/bin">>);
- _ ->
- ?line [<<"/">>,<<"usr">>,<<"local">>,<<"bin">>] = filename:split(<<"/usr/local/bin">>)
- end,
- ?line [<<"foo">>,<<"bar">>]= filename:split(<<"foo/bar">>),
- ?line [<<"foo">>, <<"bar">>, <<"hello">>]= filename:split(<<"foo////bar//hello">>),
+ [<<"/">>,<<"usr">>,<<"local">>,<<"bin">>] = filename:split(<<"/usr/local/bin">>),
+ [<<"foo">>,<<"bar">>]= filename:split(<<"foo/bar">>),
+ [<<"foo">>, <<"bar">>, <<"hello">>]= filename:split(<<"foo////bar//hello">>),
case os:type() of
{win32,_} ->
- ?line [<<"a:/">>,<<"msdev">>,<<"include">>] =
+ [<<"a:/">>,<<"msdev">>,<<"include">>] =
filename:split(<<"a:/msdev/include">>),
- ?line [<<"a:/">>,<<"msdev">>,<<"include">>] =
+ [<<"a:/">>,<<"msdev">>,<<"include">>] =
filename:split(<<"A:/msdev/include">>),
- ?line [<<"msdev">>,<<"include">>] =
+ [<<"msdev">>,<<"include">>] =
filename:split(<<"msdev\\include">>),
- ?line [<<"a:/">>,<<"msdev">>,<<"include">>] =
+ [<<"a:/">>,<<"msdev">>,<<"include">>] =
filename:split(<<"a:\\msdev\\include">>),
- ?line [<<"a:">>,<<"msdev">>,<<"include">>] =
+ [<<"a:">>,<<"msdev">>,<<"include">>] =
filename:split(<<"a:msdev\\include">>),
ok;
_ ->
ok
end.
+t_nativename_bin(Config) when is_list(Config) ->
+ ?line <<"abcedf">> = filename:nativename(<<"abcedf">>),
+ case os:type() of
+ {win32, _} ->
+ ?line <<"a:\\temp\\arne.exe">> =
+ filename:nativename(<<"A:/temp//arne.exe/">>);
+ _ ->
+ ?line <<"/usr/tmp/arne">> =
+ filename:nativename(<<"/usr/tmp//arne/">>)
+ end.
diff --git a/lib/stdlib/test/gen_event_SUITE.erl b/lib/stdlib/test/gen_event_SUITE.erl
index b3a7edc140..5c51e12e35 100644
--- a/lib/stdlib/test/gen_event_SUITE.erl
+++ b/lib/stdlib/test/gen_event_SUITE.erl
@@ -62,6 +62,8 @@ start(suite) -> [];
start(Config) when is_list(Config) ->
OldFl = process_flag(trap_exit, true),
+ ?line dummy_via:reset(),
+
?line {ok, Pid0} = gen_event:start(), %anonymous
?line [] = gen_event:which_handlers(Pid0),
?line ok = gen_event:stop(Pid0),
@@ -85,6 +87,11 @@ start(Config) when is_list(Config) ->
?line [] = gen_event:which_handlers(Pid4),
?line ok = gen_event:stop({global, my_dummy_name}),
+ ?line {ok, Pid5} = gen_event:start_link({via, dummy_via, my_dummy_name}),
+ ?line [] = gen_event:which_handlers({via, dummy_via, my_dummy_name}),
+ ?line [] = gen_event:which_handlers(Pid5),
+ ?line ok = gen_event:stop({via, dummy_via, my_dummy_name}),
+
?line {ok, _} = gen_event:start_link({local, my_dummy_name}),
?line {error, {already_started, _}} =
gen_event:start_link({local, my_dummy_name}),
@@ -92,15 +99,28 @@ start(Config) when is_list(Config) ->
gen_event:start({local, my_dummy_name}),
?line ok = gen_event:stop(my_dummy_name),
- ?line {ok, Pid5} = gen_event:start_link({global, my_dummy_name}),
+ ?line {ok, Pid6} = gen_event:start_link({global, my_dummy_name}),
?line {error, {already_started, _}} =
gen_event:start_link({global, my_dummy_name}),
?line {error, {already_started, _}} =
gen_event:start({global, my_dummy_name}),
- exit(Pid5, shutdown),
+ exit(Pid6, shutdown),
+ receive
+ {'EXIT', Pid6, shutdown} -> ok
+ after 10000 ->
+ ?t:fail(exit_gen_event)
+ end,
+
+ ?line {ok, Pid7} = gen_event:start_link({via, dummy_via, my_dummy_name}),
+ ?line {error, {already_started, _}} =
+ gen_event:start_link({via, dummy_via, my_dummy_name}),
+ ?line {error, {already_started, _}} =
+ gen_event:start({via, dummy_via, my_dummy_name}),
+
+ exit(Pid7, shutdown),
receive
- {'EXIT', Pid5, shutdown} -> ok
+ {'EXIT', Pid7, shutdown} -> ok
after 10000 ->
?t:fail(exit_gen_event)
end,
diff --git a/lib/stdlib/test/gen_fsm_SUITE.erl b/lib/stdlib/test/gen_fsm_SUITE.erl
index d60629d841..22f66a6c14 100644
--- a/lib/stdlib/test/gen_fsm_SUITE.erl
+++ b/lib/stdlib/test/gen_fsm_SUITE.erl
@@ -21,11 +21,11 @@
-include_lib("test_server/include/test_server.hrl").
%% Test cases
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
+-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2]).
--export([ start1/1, start2/1, start3/1, start4/1 , start5/1, start6/1,
- start7/1, start8/1, start9/1, start10/1, start11/1]).
+-export([start1/1, start2/1, start3/1, start4/1, start5/1, start6/1,
+ start7/1, start8/1, start9/1, start10/1, start11/1, start12/1]).
-export([ abnormal1/1, abnormal2/1]).
@@ -56,14 +56,14 @@
suite() -> [{ct_hooks,[ts_install_cth]}].
-all() ->
+all() ->
[{group, start}, {group, abnormal}, shutdown,
{group, sys}, hibernate, enter_loop].
-groups() ->
+groups() ->
[{start, [],
[start1, start2, start3, start4, start5, start6, start7,
- start8, start9, start10, start11]},
+ start8, start9, start10, start11, start12]},
{abnormal, [], [abnormal1, abnormal2]},
{sys, [],
[sys1, call_format_status, error_format_status]}].
@@ -258,25 +258,35 @@ start11(Config) when is_list(Config) ->
test_server:messages_get(),
ok.
+%% Via register linked
+start12(Config) when is_list(Config) ->
+ ?line dummy_via:reset(),
+ ?line {ok, Pid} =
+ gen_fsm:start_link({via, dummy_via, my_fsm}, gen_fsm_SUITE, [], []),
+ ?line {error, {already_started, Pid}} =
+ gen_fsm:start_link({via, dummy_via, my_fsm}, gen_fsm_SUITE, [], []),
+ ?line {error, {already_started, Pid}} =
+ gen_fsm:start({via, dummy_via, my_fsm}, gen_fsm_SUITE, [], []),
+
+ ?line ok = do_func_test(Pid),
+ ?line ok = do_sync_func_test(Pid),
+ ?line ok = do_func_test({via, dummy_via, my_fsm}),
+ ?line ok = do_sync_func_test({via, dummy_via, my_fsm}),
+ ?line stop_it({via, dummy_via, my_fsm}),
+
+ test_server:messages_get(),
+ ok.
+
%% Check that time outs in calls work
abnormal1(suite) -> [];
abnormal1(Config) when is_list(Config) ->
- ?line {ok, _Pid} =
- gen_fsm:start({local, my_fsm}, gen_fsm_SUITE, [], []),
+ {ok, _Pid} = gen_fsm:start({local, my_fsm}, gen_fsm_SUITE, [], []),
%% timeout call.
- case os:type() of
- vxworks ->
- %% timeout call for VxWorks must be in 16ms increments.
- ?line delayed = gen_fsm:sync_send_event(my_fsm, {delayed_answer,1}, 17),
- ?line {'EXIT',{timeout,_}} =
- (catch gen_fsm:sync_send_event(my_fsm, {delayed_answer,17}, 1));
- _ ->
- ?line delayed = gen_fsm:sync_send_event(my_fsm, {delayed_answer,1}, 100),
- ?line {'EXIT',{timeout,_}} =
- (catch gen_fsm:sync_send_event(my_fsm, {delayed_answer,10}, 1))
- end,
+ 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)),
test_server:messages_get(),
ok.
@@ -362,7 +372,25 @@ call_format_status(Config) when is_list(Config) ->
?line Status4 = sys:get_status(GlobalName2),
?line {status, Pid4, _Mod, [_PDict4, running, _, _, Data4]} = Status4,
?line [format_status_called | _] = lists:reverse(Data4),
- ?line stop_it(Pid4).
+ ?line stop_it(Pid4),
+
+ %% check that format_status can handle a name being a term other than a
+ %% pid or atom
+ ?line dummy_via:reset(),
+ ViaName1 = {via, dummy_via, "CallFormatStatus"},
+ ?line {ok, Pid5} = gen_fsm:start(ViaName1, gen_fsm_SUITE, [], []),
+ ?line Status5 = sys:get_status(ViaName1),
+ ?line {status, Pid5, _Mod, [_PDict5, running, _, _, Data5]} = Status5,
+ ?line [format_status_called | _] = lists:reverse(Data5),
+ ?line stop_it(Pid5),
+ ViaName2 = {via, dummy_via, {name, "term"}},
+ ?line {ok, Pid6} = gen_fsm:start(ViaName2, gen_fsm_SUITE, [], []),
+ ?line Status6 = sys:get_status(ViaName2),
+ ?line {status, Pid6, _Mod, [_PDict6, running, _, _, Data6]} = Status6,
+ ?line [format_status_called | _] = lists:reverse(Data6),
+ ?line stop_it(Pid6).
+
+
error_format_status(Config) when is_list(Config) ->
?line error_logger_forwarder:register(),
@@ -520,6 +548,8 @@ enter_loop(doc) ->
enter_loop(Config) when is_list(Config) ->
OldFlag = process_flag(trap_exit, true),
+ ?line dummy_via:reset(),
+
%% Locally registered process + {local, Name}
?line {ok, Pid1a} =
proc_lib:start_link(?MODULE, enter_loop, [local, local]),
@@ -623,10 +653,22 @@ enter_loop(Config) when is_list(Config) ->
{'EXIT', Pid6b, process_not_registered_globally} ->
ok
after 1000 ->
- ?line test_server:fail(gen_server_started)
+ ?line test_server:fail(gen_fsm_started)
end,
global:unregister_name(armitage),
+ dummy_via:register_name(armitage, self()),
+ ?line {ok, Pid6c} =
+ proc_lib:start_link(?MODULE, enter_loop, [anon, via]),
+ receive
+ {'EXIT', Pid6c, {process_not_registered_via, dummy_via}} ->
+ ok
+ after 1000 ->
+ ?line test_server:fail({gen_fsm_started, process_info(self(),
+ messages)})
+ end,
+ dummy_via:unregister_name(armitage),
+
process_flag(trap_exit, OldFlag),
ok.
@@ -635,6 +677,7 @@ enter_loop(Reg1, Reg2) ->
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()}),
@@ -643,6 +686,9 @@ enter_loop(Reg1, Reg2) ->
gen_fsm:enter_loop(?MODULE, [], state0, [], {local,armitage});
global ->
gen_fsm:enter_loop(?MODULE, [], state0, [], {global,armitage});
+ via ->
+ gen_fsm:enter_loop(?MODULE, [], state0, [],
+ {via, dummy_via, armitage});
anon ->
gen_fsm:enter_loop(?MODULE, [], state0, [])
end.
diff --git a/lib/stdlib/test/gen_server_SUITE.erl b/lib/stdlib/test/gen_server_SUITE.erl
index 7fb8d54f2d..2abb01ba24 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -36,8 +36,9 @@
]).
% spawn export
--export([spec_init_local/2, spec_init_global/2,
- spec_init_default_timeout/2, spec_init_anonymous/1,
+-export([spec_init_local/2, spec_init_global/2, spec_init_via/2,
+ spec_init_default_timeout/2, spec_init_global_default_timeout/2,
+ spec_init_anonymous/1,
spec_init_anonymous_default_timeout/1,
spec_init_not_proc_lib/1, cast_fast_messup/0]).
@@ -199,16 +200,37 @@ start(Config) when is_list(Config) ->
test_server:fail(not_stopped)
end,
+ %% via register
+ ?line dummy_via:reset(),
+ ?line {ok, Pid6} =
+ gen_server:start({via, dummy_via, my_test_name},
+ gen_server_SUITE, [], []),
+ ?line ok = gen_server:call({via, dummy_via, my_test_name}, started_p),
+ ?line {error, {already_started, Pid6}} =
+ gen_server:start({via, dummy_via, my_test_name},
+ gen_server_SUITE, [], []),
+ ?line ok = gen_server:call({via, dummy_via, my_test_name}, stop),
+ test_server:sleep(1),
+ ?line {'EXIT', {noproc,_}} = (catch gen_server:call(Pid6, started_p, 10)),
+
+ %% via register linked
+ ?line dummy_via:reset(),
+ ?line {ok, Pid7} =
+ gen_server:start_link({via, dummy_via, my_test_name},
+ gen_server_SUITE, [], []),
+ ?line ok = gen_server:call({via, dummy_via, my_test_name}, started_p),
+ ?line {error, {already_started, Pid7}} =
+ gen_server:start({via, dummy_via, my_test_name},
+ gen_server_SUITE, [], []),
+ ?line ok = gen_server:call({via, dummy_via, my_test_name}, stop),
+ ?line receive
+ {'EXIT', Pid7, stopped} ->
+ ok
+ after 5000 ->
+ test_server:fail(not_stopped)
+ end,
test_server:messages_get(),
- %% Must wait for all error messages before going to next test.
- %% (otherwise it interferes too much with real time characteristics).
- case os:type() of
- vxworks ->
- receive after 5000 -> ok end;
- _ ->
- ok
- end,
process_flag(trap_exit, OldFl),
ok.
@@ -720,7 +742,7 @@ spec_init(suite) ->
spec_init(Config) when is_list(Config) ->
OldFlag = process_flag(trap_exit, true),
-
+
?line {ok, Pid0} = start_link(spec_init_local, [{ok, my_server}, []]),
?line ok = gen_server:call(Pid0, started_p),
?line ok = gen_server:call(Pid0, stop),
@@ -790,6 +812,14 @@ spec_init(Config) when is_list(Config) ->
test_server:fail(gen_server_did_not_die)
end,
+ %% Before the OTP-10130 fix this failed because a timeout message
+ %% was generated as the spawned process crashed because a {global, Name}
+ %% was matched as a timeout value instead of matching on scope.
+ {ok, _PidHurra} =
+ start_link(spec_init_global_default_timeout, [{ok, hurra}, []]),
+ timer:sleep(1000),
+ ok = gen_server:call(_PidHurra, started_p),
+
?line Pid5 =
erlang:spawn_link(?MODULE, spec_init_not_proc_lib, [[]]),
receive
@@ -853,6 +883,8 @@ otp_5854(doc) ->
otp_5854(Config) when is_list(Config) ->
OldFlag = process_flag(trap_exit, true),
+ ?line dummy_via:reset(),
+
%% Make sure gen_server:enter_loop does not accept {local,Name}
%% when it's another process than the calling one which is
%% registered under that name
@@ -881,6 +913,18 @@ otp_5854(Config) when is_list(Config) ->
end,
global:unregister_name(armitage),
+ %% (same for {via, Mod, Name})
+ dummy_via:register_name(armitage, self()),
+ ?line {ok, Pid3} =
+ start_link(spec_init_via, [{not_ok, armitage}, []]),
+ receive
+ {'EXIT', Pid3, {process_not_registered_via, dummy_via}} ->
+ ok
+ after 1000 ->
+ ?line test_server:fail(gen_server_started)
+ end,
+ dummy_via:unregister_name(armitage),
+
process_flag(trap_exit, OldFlag),
ok.
@@ -1060,13 +1104,37 @@ spec_init_global({not_ok, Name}, Options) ->
%% Supervised init can occur here ...
gen_server:enter_loop(?MODULE, Options, {}, {global, Name}, infinity).
-spec_init_default_timeout({ok, Name}, Options) ->
+spec_init_via({ok, Name}, Options) ->
+ process_flag(trap_exit, true),
+ dummy_via:register_name(Name, self()),
+ proc_lib:init_ack({ok, self()}),
+ %% Supervised init can occur here ...
+ gen_server:enter_loop(?MODULE, Options, {},
+ {via, dummy_via, Name}, infinity);
+
+spec_init_via({not_ok, Name}, Options) ->
+ process_flag(trap_exit, true),
+ proc_lib:init_ack({ok, self()}),
+ %% Supervised init can occur here ...
+ gen_server:enter_loop(?MODULE, Options, {},
+ {via, dummy_via, Name}, infinity).
+
+spec_init_default_timeout({ok, Name}, Options) ->
process_flag(trap_exit, true),
register(Name, self()),
proc_lib:init_ack({ok, self()}),
%% Supervised init can occur here ...
gen_server:enter_loop(?MODULE, Options, {}, {local, Name}).
+%% OTP-10130, A bug was introduced where global scope was not matched when
+%% enter_loop/4 was called (no timeout).
+spec_init_global_default_timeout({ok, Name}, Options) ->
+ process_flag(trap_exit, true),
+ global:register_name(Name, self()),
+ proc_lib:init_ack({ok, self()}),
+ %% Supervised init can occur here ...
+ gen_server:enter_loop(?MODULE, Options, {}, {global, Name}).
+
spec_init_anonymous(Options) ->
process_flag(trap_exit, true),
proc_lib:init_ack({ok, self()}),
diff --git a/lib/stdlib/test/id_transform_SUITE.erl b/lib/stdlib/test/id_transform_SUITE.erl
index e1972a100e..233b0d0a78 100644
--- a/lib/stdlib/test/id_transform_SUITE.erl
+++ b/lib/stdlib/test/id_transform_SUITE.erl
@@ -26,7 +26,7 @@
id_transform/1]).
-export([check/2,check2/1,g/0,f/1,t/1,t1/1,t2/1,t3/1,t4/1,
- t5/1,t6/1,apa/1,new_fun/0]).
+ t5/1,apa/1,new_fun/0]).
% Serves as test...
-hej(hopp).
@@ -388,8 +388,6 @@ t3(A) when is_tuple(A) or is_tuple(A) ->
is_tuple;
t3(A) when record(A, apa) ->
foo;
-t3(A) when {erlang,is_record}(A, apa) ->
- foo;
t3(A) when erlang:is_record(A, apa) ->
foo;
t3(A) when is_record(A, apa) ->
@@ -397,13 +395,10 @@ t3(A) when is_record(A, apa) ->
t3(A) when record({apa}, apa) ->
{A,foo}.
-t4(_) when {erlang,is_record}({apa}, apa) ->
- foo.
-
-t5(A) when erlang:is_record({apa}, apa) ->
+t4(A) when erlang:is_record({apa}, apa) ->
{A,foo}.
-t6(A) when is_record({apa}, apa) ->
+t5(A) when is_record({apa}, apa) ->
{A,foo}.
-record(apa2,{a=a,b=foo:bar()}).
diff --git a/lib/stdlib/test/io_proto_SUITE.erl b/lib/stdlib/test/io_proto_SUITE.erl
index b69cd74edb..661d57c85b 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -50,7 +50,7 @@
-define(privdir(Conf), ?config(priv_dir, Conf)).
-endif.
--define(debug, true).
+%%-define(debug, true).
-ifdef(debug).
-define(format(S, A), io:format(S, A)).
@@ -137,7 +137,7 @@ unicode_prompt(Config) when is_list(Config) ->
{putline, "io:get_line('')."},
{putline, "hej"},
{getline, "<<\"hej\\n\">>"}
- ],[],[],"-pa "++ PA),
+ ],[],[],"-pa \""++ PA++"\""),
%% And one with oldshell
?line rtnode([{putline,""},
{putline, "2."},
@@ -153,7 +153,7 @@ unicode_prompt(Config) when is_list(Config) ->
{putline, "io:get_line('')."},
{putline, "hej"},
{getline_re, ".*<<\"hej\\\\n\">>"}
- ],[],[],"-oldshell -pa "++PA),
+ ],[],[],"-oldshell -pa \""++PA++"\""),
ok.
@@ -732,7 +732,7 @@ bc_with_r12_1(Config) ->
PA = filename:dirname(code:which(?MODULE)),
Name1 = io_proto_r12_1,
?line N1 = list_to_atom(atom_to_list(Name1) ++ "@" ++ hostname()),
- ?line ?t:start_node(Name1, peer, [{args, "-pz "++PA},{erl,[{release,"r12b"}]}]),
+ ?line ?t:start_node(Name1, peer, [{args, "-pz \""++PA++"\""},{erl,[{release,"r12b"}]}]),
DataDir = ?config(data_dir,Config),
%PrivDir = ?config(priv_dir,Config),
FileName1 = filename:join([DataDir,"testdata_latin1.dat"]),
@@ -908,7 +908,7 @@ bc_with_r12_gl_1(_Config,Machine) ->
PA = filename:dirname(code:which(?MODULE)),
Name1 = io_proto_r12_gl_1,
?line N1 = list_to_atom(atom_to_list(Name1) ++ "@" ++ hostname()),
- ?line ?t:start_node(Name1, peer, [{args, "-pz "++PA},{erl,[{release,"r12b"}]}]),
+ ?line ?t:start_node(Name1, peer, [{args, "-pz \""++PA++"\""},{erl,[{release,"r12b"}]}]),
TestDataLine1 = [229,228,246],
TestDataLine1BinUtf = unicode:characters_to_binary(TestDataLine1),
TestDataLine1BinLatin = list_to_binary(TestDataLine1),
@@ -1290,7 +1290,7 @@ eof_on_pipe(Config) when is_list(Config) ->
end
end,
CommandLine1 = EchoLine ++
- Erl++" -noshell -eval "
+ "\""++Erl++"\" -noshell -eval "
"'io:format(\"~p\",[io:get_line(\"\")]),"
"io:format(\"~p\",[io:get_line(\"\")]),"
"io:format(\"~p\",[io:get_line(\"\")]).' -run init stop",
@@ -1301,7 +1301,7 @@ eof_on_pipe(Config) when is_list(Config) ->
exit({unexpected1,Other1})
end,
CommandLine2 = EchoLine ++
- Erl++" -noshell -eval "
+ "\""++Erl++"\" -noshell -eval "
"'io:setopts([binary]),io:format(\"~p\",[io:get_line(\"\")]),"
"io:format(\"~p\",[io:get_line(\"\")]),"
"io:format(\"~p\",[io:get_line(\"\")]).' -run init stop",
@@ -1340,7 +1340,8 @@ rtnode(Commands,Nodename,ErlPrefix,Extra) ->
?line {skip, Reason2};
Tempdir ->
?line SPid =
- start_runerl_node(RunErl,ErlPrefix++Erl,
+ start_runerl_node(RunErl,ErlPrefix++
+ "\\\""++Erl++"\\\"",
Tempdir,Nodename, Extra),
?line CPid = start_toerl_server(ToErl,Tempdir),
?line erase(getline_skipped),
@@ -1607,10 +1608,10 @@ start_runerl_node(RunErl,Erl,Tempdir,Nodename,Extra) ->
" "++Extra
end,
spawn(fun() ->
- ?dbg(RunErl++" "++Tempdir++"/ "++Tempdir++" \""++
- Erl++XArg++XXArg++"\""),
- os:cmd(RunErl++" "++Tempdir++"/ "++Tempdir++" \""++
- Erl++XArg++XXArg++"\"")
+ ?dbg("\""++RunErl++"\" "++Tempdir++"/ "++Tempdir++
+ " \""++Erl++XArg++XXArg++"\""),
+ os:cmd("\""++RunErl++"\" "++Tempdir++"/ "++Tempdir++
+ " \""++Erl++XArg++XXArg++"\"")
end).
start_toerl_server(ToErl,Tempdir) ->
@@ -1640,7 +1641,7 @@ try_to_erl(Command, N) ->
end.
toerl_server(Parent,ToErl,Tempdir) ->
- Port = try_to_erl(ToErl++" "++Tempdir++"/ 2>/dev/null",8),
+ Port = try_to_erl("\""++ToErl++"\" "++Tempdir++"/ 2>/dev/null",8),
case Port of
P when is_port(P) ->
Parent ! {self(),started};
diff --git a/lib/stdlib/test/ms_transform_SUITE.erl b/lib/stdlib/test/ms_transform_SUITE.erl
index c9688354b1..a17307b07b 100644
--- a/lib/stdlib/test/ms_transform_SUITE.erl
+++ b/lib/stdlib/test/ms_transform_SUITE.erl
@@ -455,7 +455,6 @@ old_guards(Config) when is_list(Config) ->
?line setup(Config),
Tests = [
{atom,is_atom},
- {constant,is_constant},
{float,is_float},
{integer,is_integer},
{list,is_list},
@@ -490,7 +489,6 @@ old_guards(Config) when is_list(Config) ->
?line [{'$1',[{is_integer,'$1'},
{is_float,'$1'},
{is_atom,'$1'},
- {is_constant,'$1'},
{is_list,'$1'},
{is_number,'$1'},
{is_pid,'$1'},
@@ -502,7 +500,7 @@ old_guards(Config) when is_list(Config) ->
[true]}] =
compile_and_run(RD, <<
"ets:fun2ms(fun(X) when integer(X),"
- "float(X), atom(X), constant(X),"
+ "float(X), atom(X),"
"list(X), number(X), pid(X),"
"port(X), reference(X), tuple(X),"
"binary(X), record(X,a) -> true end)"
@@ -530,7 +528,6 @@ autoimported(Config) when is_list(Config) ->
{self,0},
%{float,1}, see float_1_function/1
{is_atom,1},
- {is_constant,1},
{is_float,1},
{is_integer,1},
{is_list,1},
diff --git a/lib/stdlib/test/qlc_SUITE.erl b/lib/stdlib/test/qlc_SUITE.erl
index 50a76cdfb5..e3090e4a47 100644
--- a/lib/stdlib/test/qlc_SUITE.erl
+++ b/lib/stdlib/test/qlc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -2969,13 +2969,6 @@ lookup1(Config) when is_list(Config) ->
[3] = lookup_keys(Q)
end, [{1,a},{3,3}])">>,
- <<"A = 3,
- etsc(fun(E) ->
- Q = qlc:q([X || X <- ets:table(E), A =:= {erlang,element}(1, X)]),
- [{3,3}] = qlc:e(Q),
- [3] = lookup_keys(Q)
- end, [{1,a},{3,3}])">>,
-
<<"etsc(fun(E) ->
A = 3,
Q = qlc:q([X || X <- ets:table(E),
@@ -3439,12 +3432,6 @@ lookup2(Config) when is_list(Config) ->
[r] = qlc:e(Q),
[r] = lookup_keys(Q)
end, [{keypos,1}], [#r{}])">>,
- <<"etsc(fun(E) ->
- Q = qlc:q([element(1, X) || X <- ets:table(E),
- {erlang,is_record}(X, r, 2)]),
- [r] = qlc:e(Q),
- [r] = lookup_keys(Q)
- end, [{keypos,1}], [#r{}])">>,
{cres,
<<"etsc(fun(E) ->
Q = qlc:q([element(1, X) || X <- ets:table(E),
@@ -3464,12 +3451,6 @@ lookup2(Config) when is_list(Config) ->
is_record(X, r)]),
[r] = qlc:e(Q),
[r] = lookup_keys(Q)
- end, [{keypos,1}], [#r{}])">>,
- <<"etsc(fun(E) ->
- Q = qlc:q([element(1, X) || X <- ets:table(E),
- {erlang,is_record}(X, r)]),
- [r] = qlc:e(Q),
- [r] = lookup_keys(Q)
end, [{keypos,1}], [#r{}])">>
],
@@ -7927,15 +7908,23 @@ run_test(Config, Extra, {cres, Body, Opts, ExpectedCompileReturn}) ->
ok
end,
+ wait_for_expected(R, Before, SourceFile, true),
+ code:purge(Mod);
+run_test(Config, Extra, Body) ->
+ run_test(Config, Extra, {cres,Body,[]}).
+
+wait_for_expected(R, Before, SourceFile, Wait) ->
Ms = erlang:process_info(self(),messages),
After = {get(), pps(), ets:all(), Ms},
- code:purge(Mod),
case {R, After} of
- {ok, Before} -> ok;
- _ -> expected({ok,Before}, {R,After}, SourceFile)
- end;
-run_test(Config, Extra, Body) ->
- run_test(Config, Extra, {cres,Body,[]}).
+ {ok, Before} ->
+ ok;
+ _ when Wait ->
+ timer:sleep(1000),
+ wait_for_expected(R, Before, SourceFile, false);
+ _ ->
+ expected({ok,Before}, {R,After}, SourceFile)
+ end.
unload_pt() ->
erlang:garbage_collect(), % get rid of references to qlc_pt...
diff --git a/lib/stdlib/test/re_SUITE.erl b/lib/stdlib/test/re_SUITE.erl
index d6d946a28f..8ee0a13f4c 100644
--- a/lib/stdlib/test/re_SUITE.erl
+++ b/lib/stdlib/test/re_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -328,6 +328,12 @@ replace_return(Config) when is_list(Config) ->
?line <<"iXk">> = re:replace("abcdefghijk","(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)","\\9X",[{return,binary}]),
?line <<"jXk">> = re:replace("abcdefghijk","(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)","\\10X",[{return,binary}]),
?line <<"Xk">> = re:replace("abcdefghijk","(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)","\\11X",[{return,binary}]),
+ ?line <<"9X1">> = re:replace("12345678901","(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)","\\g9X",[{return,binary}]),
+ ?line <<"0X1">> = re:replace("12345678901","(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)","\\g10X",[{return,binary}]),
+ ?line <<"X1">> = re:replace("12345678901","(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)","\\g11X",[{return,binary}]),
+ ?line <<"971">> = re:replace("12345678901","(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)","\\g{9}7",[{return,binary}]),
+ ?line <<"071">> = re:replace("12345678901","(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)","\\g{10}7",[{return,binary}]),
+ ?line <<"71">> = re:replace("12345678901","(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)","\\g{11}7",[{return,binary}]),
?line "a\x{400}bcX" = re:replace("a\x{400}bcd","d","X",[global,{return,list},unicode]),
?line <<"a",208,128,"bcX">> = re:replace("a\x{400}bcd","d","X",[global,{return,binary},unicode]),
?line "a\x{400}bcd" = re:replace("a\x{400}bcd","Z","X",[global,{return,list},unicode]),
diff --git a/lib/stdlib/test/shell_SUITE.erl b/lib/stdlib/test/shell_SUITE.erl
index a881742f13..d49416c150 100644
--- a/lib/stdlib/test/shell_SUITE.erl
+++ b/lib/stdlib/test/shell_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2012. 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
@@ -153,7 +153,7 @@ start_restricted_from_shell(Config) when is_list(Config) ->
comm_err(<<"begin init:stop() end.">>),
?line "exception exit: restricted shell does not allow init:stop()" =
comm_err(<<"begin F = fun() -> init:stop() end, F() end.">>),
- ?line "exception error: bad argument in an arithmetic expression" =
+ ?line "exception error: an error occurred when evaluating an arithmetic expression" =
comm_err(<<"begin +a end.">>),
?line "exception exit: restricted shell does not allow a + b" =
comm_err(<<"begin a+b end.">>),
@@ -817,9 +817,6 @@ otp_5916(Config) when is_list(Config) ->
true = if is_record(#r1{},r1,3) -> true; true -> false end,
false = if is_record(#r2{},r1,3) -> true; true -> false end,
- true = if {erlang,is_record}(#r1{},r1,3) -> true; true -> false end,
- false = if {erlang,is_record}(#r2{},r1,3) -> true; true -> false end,
-
ok.">>,
[ok] = scan(C),
ok.
@@ -2282,12 +2279,6 @@ otp_5990(doc) ->
otp_5990(suite) -> [];
otp_5990(Config) when is_list(Config) ->
?line [true] =
- scan(<<"rd(foo,{bar}), {erlang,is_record}(#foo{}, foo).">>),
- ?line [3] =
- scan(<<"rd(foo,{bar}), A = #foo{}, "
- "{if {erlang,is_record}(A, foo) -> erlang; "
- "true -> not_a_module end, length}([1,2,3]).">>),
- ?line [true] =
scan(<<"rd('OrdSet', {orddata = {},ordtype = type}), "
"S = #'OrdSet'{ordtype = {}}, "
"if tuple(S#'OrdSet'.ordtype) -> true; true -> false end.">>),
@@ -2359,7 +2350,7 @@ otp_6554(Config) when is_list(Config) ->
comm_err(<<"fun(X) -> not X end(a).">>),
?line "exception error: bad argument: a" =
comm_err(<<"fun(A, B) -> A orelse B end(a, b).">>),
- ?line "exception error: bad argument in an arithmetic expression" =
+ ?line "exception error: an error occurred when evaluating an arithmetic expression" =
comm_err(<<"math:sqrt(2)/round(math:sqrt(0)).">>),
?line "exception error: interpreted function with arity 1 called with no arguments" =
comm_err(<<"fun(V) -> V end().">>),
@@ -2478,9 +2469,9 @@ otp_6554(Config) when is_list(Config) ->
" receive {'EXIT', Pid, {{nocatch,foo},_}} -> ok end "
"end.">>),
- ?line "exception error: bad argument in an arithmetic expression" =
+ ?line "exception error: an error occurred when evaluating an arithmetic expression" =
comm_err(<<"begin catch_exception(true), 1/0 end.">>),
- ?line "exception error: bad argument in an arithmetic expression" =
+ ?line "exception error: an error occurred when evaluating an arithmetic expression" =
comm_err(<<"begin catch_exception(false), 1/0 end.">>),
?line "exception error: no function clause matching call to catch_exception/1" =
comm_err(<<"catch_exception(1).">>),
@@ -2637,7 +2628,7 @@ otp_8393(Config) when is_list(Config) ->
prompt_err(<<"shell:prompt_func('> ').">>),
?line _ = shell:prompt_func(default),
- ?line "exception error: bad argument in an arithmetic expression"++_ =
+ ?line "exception error: an error occurred when evaluating an arithmetic expression"++_ =
prompt_err(<<"shell:prompt_func({shell_SUITE,prompt4}).">>),
?line _ = shell:prompt_func(default),
@@ -2710,7 +2701,7 @@ prompt3(L) ->
integer_to_list(N).
prompt4(_L) ->
- erlang:apply({erlang,'/'}, [1,0]).
+ erlang:apply(fun erlang:'/'/2, [1,0]).
prompt5(_L) ->
[1050,1072,1082,1074,1086,32,1077,32,85,110,105,99,111,100,101,32,63].
diff --git a/lib/stdlib/test/sofs_SUITE.erl b/lib/stdlib/test/sofs_SUITE.erl
index c8dca9a6e6..f11c6ec4d6 100644
--- a/lib/stdlib/test/sofs_SUITE.erl
+++ b/lib/stdlib/test/sofs_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -536,7 +536,7 @@ projection(Conf) when is_list(Conf) ->
from_term([], [[atom]]))),
?line {'EXIT', {badarg, _}} =
(catch projection({external, fun(X) -> X end}, from_term([[a]]))),
- ?line eval(projection({sofs,union},
+ ?line eval(projection(fun sofs:union/1,
from_term([[[1,2],[2,3]], [[a,b],[b,c]]])),
from_term([[1,2,3], [a,b,c]])),
?line eval(projection(fun(_) -> from_term([a]) end,
@@ -628,7 +628,7 @@ substitution(Conf) when is_list(Conf) ->
?line {'EXIT', {badarg, _}} =
(catch substitution({external, fun(X) -> X end}, from_term([[a]]))),
?line eval(substitution(fun(X) -> X end, from_term([], [[atom]])), E),
- ?line eval(substitution({sofs,union},
+ ?line eval(substitution(fun sofs:union/1,
from_term([[[1,2],[2,3]], [[a,b],[b,c]]])),
from_term([{[[1,2],[2,3]],[1,2,3]}, {[[a,b],[b,c]],[a,b,c]}])),
?line eval(substitution(fun(_) -> from_term([a]) end,
@@ -745,7 +745,7 @@ restriction(Conf) when is_list(Conf) ->
?line eval(restriction(Id, S3, E), E),
?line eval(restriction(Id, from_term([], [[atom]]), set([a])),
from_term([], [[atom]])),
- ?line eval(restriction({sofs,union},
+ ?line eval(restriction(fun sofs:union/1,
from_term([[[a],[b]], [[b],[c]],
[[], [a,b]], [[1],[2]]]),
from_term([[a,b],[1,2,3],[b,c]])),
@@ -862,7 +862,7 @@ drestriction(Conf) when is_list(Conf) ->
?line eval(drestriction(Id, S3, E), S3),
?line eval(drestriction(Id, from_term([], [[atom]]), set([a])),
from_term([], [[atom]])),
- ?line eval(drestriction({sofs,union},
+ ?line eval(drestriction(fun sofs:union/1,
from_term([[[a],[b]], [[b],[c]],
[[], [a,b]], [[1],[2]]]),
from_term([[a,b],[1,2,3],[b,c]])),
@@ -1028,7 +1028,7 @@ specification(Conf) when is_list(Conf) ->
end,
?line eval(specification({external,Fun2x}, S2), from_term([[1],[3]])),
- Fun3 = fun(_) -> neither_true_or_false end,
+ Fun3 = fun(_) -> neither_true_nor_false end,
?line {'EXIT', {badarg, _}} =
(catch specification(Fun3, set([a]))),
?line {'EXIT', {badarg, _}} =
@@ -1810,8 +1810,8 @@ partition_3(Conf) when is_list(Conf) ->
S12a = from_term([[[a],[b]], [[b],[c]], [[], [a,b]], [[1],[2]]]),
S12b = from_term([[a,b],[1,2,3],[b,c]]),
- ?line eval(partition({sofs,union}, S12a, S12b),
- lpartition({sofs,union}, S12a, S12b)),
+ ?line eval(partition(fun sofs:union/1, S12a, S12b),
+ lpartition(fun sofs:union/1, S12a, S12b)),
Fun13 = fun(_) -> from_term([a]) end,
S13a = from_term([], [[atom]]),
@@ -1956,21 +1956,8 @@ misc(Conf) when is_list(Conf) ->
% the "functional" part:
?line eval(union(intersection(partition(1,S), partition(Id,S))),
difference(S, RR)),
-
- %% The function external:foo/1 is undefined.
- case test_server:is_native(sofs) of
- true ->
- %% Create an export entry for external:foo/1 to work
- %% around a bug in the native code. If there is no
- %% export entry, the exception will be
- %% {badfun,{external,foo}}. Remove in R16 when tuple
- %% funs are removed.
- (catch external:foo([]));
- false ->
- ok
- end,
?line {'EXIT', {undef, _}} =
- (catch projection({external,foo}, set([a,b,c]))),
+ (catch projection(fun external:foo/1, set([a,b,c]))),
ok.
relational_restriction(R) ->
@@ -1983,19 +1970,19 @@ family_specification(doc) -> [""];
family_specification(Conf) when is_list(Conf) ->
E = empty_set(),
%% internal
- ?line eval(family_specification({sofs, is_set}, E), E),
+ ?line eval(family_specification(fun sofs:is_set/1, E), E),
?line {'EXIT', {badarg, _}} =
- (catch family_specification({sofs,is_set}, set([]))),
+ (catch family_specification(fun sofs:is_set/1, set([]))),
?line F1 = from_term([{1,[1]}]),
- ?line eval(family_specification({sofs,is_set}, F1), F1),
+ ?line eval(family_specification(fun sofs:is_set/1, F1), F1),
Fun = fun(S) -> is_subset(S, set([0,1,2,3,4])) end,
?line F2 = family([{a,[1,2]},{b,[3,4,5]}]),
?line eval(family_specification(Fun, F2), family([{a,[1,2]}])),
?line F3 = from_term([{a,[]},{b,[]}]),
- ?line eval(family_specification({sofs,is_set}, F3), F3),
+ ?line eval(family_specification(fun sofs:is_set/1, F3), F3),
Fun2 = fun(_) -> throw(fippla) end,
?line fippla = (catch family_specification(Fun2, family([{a,[1]}]))),
- Fun3 = fun(_) -> neither_true_or_false end,
+ Fun3 = fun(_) -> neither_true_nor_false end,
?line {'EXIT', {badarg, _}} =
(catch family_specification(Fun3, F3)),
@@ -2110,22 +2097,22 @@ family_projection(Conf) when is_list(Conf) ->
?line eval(family_projection(fun(X) -> X end, family([])), E),
?line L1 = [{a,[]}],
- ?line eval(family_projection({sofs,union}, E), E),
- ?line eval(family_projection({sofs,union}, from_term(L1, SSType)),
+ ?line eval(family_projection(fun sofs:union/1, E), E),
+ ?line eval(family_projection(fun sofs:union/1, from_term(L1, SSType)),
family(L1)),
?line {'EXIT', {badarg, _}} =
- (catch family_projection({sofs,union}, set([]))),
+ (catch family_projection(fun sofs:union/1, set([]))),
?line {'EXIT', {badarg, _}} =
- (catch family_projection({sofs,union}, from_term([{1,[1]}]))),
+ (catch family_projection(fun sofs:union/1, from_term([{1,[1]}]))),
?line F2 = from_term([{a,[[1],[2]]},{b,[[3,4],[5]]}], SSType),
- ?line eval(family_projection({sofs,union}, F2),
+ ?line eval(family_projection(fun sofs:union/1, F2),
family_union(F2)),
?line F3 = from_term([{1,[{a,b},{b,c},{c,d}]},{3,[]},{5,[{3,5}]}],
SRType),
- ?line eval(family_projection({sofs,domain}, F3), family_domain(F3)),
- ?line eval(family_projection({sofs,range}, F3), family_range(F3)),
+ ?line eval(family_projection(fun sofs:domain/1, F3), family_domain(F3)),
+ ?line eval(family_projection(fun sofs:range/1, F3), family_range(F3)),
?line eval(family_projection(fun(_) -> E end, family([{a,[b,c]}])),
from_term([{a,[]}])),
@@ -2305,7 +2292,7 @@ partition_family(Conf) when is_list(Conf) ->
?line eval(partition_family(1, E), E),
?line eval(partition_family(2, E), E),
- ?line eval(partition_family({sofs,union}, E), E),
+ ?line eval(partition_family(fun sofs:union/1, E), E),
?line eval(partition_family(1, ER), EF),
?line eval(partition_family(2, ER), EF),
?line {'EXIT', {badarg, _}} = (catch partition_family(1, set([]))),
@@ -2369,7 +2356,7 @@ partition_family(Conf) when is_list(Conf) ->
?line {'EXIT', {badarg, _}} =
(catch partition_family({external, fun(X) -> X end},
from_term([[a]]))),
- ?line eval(partition_family({sofs,union},
+ ?line eval(partition_family(fun sofs:union/1,
from_term([[[1],[1,2]], [[1,2]]])),
from_term([{[1,2], [[[1],[1,2]],[[1,2]]]}])),
?line eval(partition_family(fun(X) -> X end,
diff --git a/lib/stdlib/test/stdlib.spec.vxworks b/lib/stdlib/test/stdlib.spec.vxworks
deleted file mode 100644
index ddc804b831..0000000000
--- a/lib/stdlib/test/stdlib.spec.vxworks
+++ /dev/null
@@ -1,8 +0,0 @@
-{topcase, {dir, "../stdlib_test"}}.
-{skip,{dets_SUITE,"Not runnable VxWorks/NFS"}}.
-{skip,{slave_SUITE,"VxWorks: slave nodes are not supported"}}.
-{skip,{tar_SUITE,errors,"VxWorks filesystem too primitive"}}.
-{skip,{tar_SUITE,create_long_names,"VxWorks names too short"}}.
-{skip,{epp_SUITE,"Test not adopted to VxWorks"}}.
-{skip,{select_SUITE,"Test too memory consuming for VxWorks"}}.
-{skip,{beam_lib_SUITE,error,"All sections not present in stripped beam files"}}.
diff --git a/lib/stdlib/test/supervisor_SUITE.erl b/lib/stdlib/test/supervisor_SUITE.erl
index 71b76c093f..767ae3d62c 100644
--- a/lib/stdlib/test/supervisor_SUITE.erl
+++ b/lib/stdlib/test/supervisor_SUITE.erl
@@ -21,7 +21,7 @@
-module(supervisor_SUITE).
-include_lib("common_test/include/ct.hrl").
--define(TIMEOUT, 1000).
+-define(TIMEOUT, ?t:minutes(1)).
%% Testserver specific export
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
@@ -62,7 +62,8 @@
do_not_save_start_parameters_for_temporary_children/1,
do_not_save_child_specs_for_temporary_children/1,
simple_one_for_one_scale_many_temporary_children/1,
- simple_global_supervisor/1]).
+ simple_global_supervisor/1, hanging_restart_loop/1,
+ hanging_restart_loop_simple/1]).
%%-------------------------------------------------------------------------
@@ -82,7 +83,7 @@ all() ->
count_children_memory, do_not_save_start_parameters_for_temporary_children,
do_not_save_child_specs_for_temporary_children,
simple_one_for_one_scale_many_temporary_children, temporary_bystander,
- simple_global_supervisor].
+ simple_global_supervisor, hanging_restart_loop, hanging_restart_loop_simple].
groups() ->
[{sup_start, [],
@@ -111,10 +112,8 @@ groups() ->
{restart_rest_for_one, [],
[rest_for_one, rest_for_one_escalation]}].
-init_per_suite(Config0) ->
- Config = lists:keydelete(watchdog, 1, Config0),
- Dog = test_server:timetrap(?TIMEOUT),
- [{watchdog, Dog} | Config].
+init_per_suite(Config) ->
+ Config.
end_per_suite(_Config) ->
ok.
@@ -129,18 +128,21 @@ init_per_testcase(count_children_memory, Config) ->
try erlang:memory() of
_ ->
erts_debug:set_internal_state(available_internal_state, true),
- Config
+ Dog = ?t:timetrap(?TIMEOUT),
+ [{watchdog,Dog}|Config]
catch error:notsup ->
{skip, "+Meamin used during test; erlang:memory/1 not available"}
end;
init_per_testcase(_Case, Config) ->
- erlang:display(_Case),
- Config.
+ Dog = ?t:timetrap(?TIMEOUT),
+ [{watchdog,Dog}|Config].
-end_per_testcase(count_children_memory, _Config) ->
+end_per_testcase(count_children_memory, Config) ->
catch erts_debug:set_internal_state(available_internal_state, false),
+ ?t:timetrap_cancel(?config(watchdog,Config)),
ok;
-end_per_testcase(_Case, _Config) ->
+end_per_testcase(_Case, Config) ->
+ ?t:timetrap_cancel(?config(watchdog,Config)),
ok.
start_link(InitResult) ->
@@ -1455,6 +1457,102 @@ gen_server9212() ->
%%-------------------------------------------------------------------------
+%% Test that child and supervisor can be shutdown while hanging in restart loop.
+%% See OTP-9549.
+hanging_restart_loop(Config) when is_list(Config) ->
+ process_flag(trap_exit, true),
+ {ok, Pid} = start_link({ok, {{one_for_one, 8, 10}, []}}),
+ Child1 = {child1, {supervisor_deadlock, start_child, []},
+ permanent, brutal_kill, worker, []},
+
+ %% Ets table with state read by supervisor_deadlock.erl
+ ets:new(supervisor_deadlock,[set,named_table,public]),
+ ets:insert(supervisor_deadlock,{fail_start,false}),
+
+ {ok, CPid1} = supervisor:start_child(sup_test, Child1),
+ link(CPid1),
+
+ ets:insert(supervisor_deadlock,{fail_start,true}),
+ supervisor_deadlock:restart_child(),
+ timer:sleep(2000), % allow restart to happen before proceeding
+
+ {error, already_present} = supervisor:start_child(sup_test, Child1),
+ {error, restarting} = supervisor:restart_child(sup_test, child1),
+ {error, restarting} = supervisor:delete_child(sup_test, child1),
+ [{child1,restarting,worker,[]}] = supervisor:which_children(sup_test),
+ [1,0,0,1] = get_child_counts(sup_test),
+
+ ok = supervisor:terminate_child(sup_test, child1),
+ check_exit_reason(CPid1, error),
+ [{child1,undefined,worker,[]}] = supervisor:which_children(sup_test),
+
+ ets:insert(supervisor_deadlock,{fail_start,false}),
+ {ok, CPid2} = supervisor:restart_child(sup_test, child1),
+ link(CPid2),
+
+ ets:insert(supervisor_deadlock,{fail_start,true}),
+ supervisor_deadlock:restart_child(),
+ timer:sleep(2000), % allow restart to happen before proceeding
+
+ %% Terminating supervisor.
+ %% OTP-9549 fixes so this does not give a timetrap timeout -
+ %% i.e. that supervisor does not hang in restart loop.
+ terminate(Pid,shutdown),
+
+ %% Check that child died with reason from 'restart' request above
+ check_exit_reason(CPid2, error),
+ undefined = whereis(sup_test),
+ ok.
+
+%%-------------------------------------------------------------------------
+%% Test that child and supervisor can be shutdown while hanging in
+%% restart loop, simple_one_for_one.
+%% See OTP-9549.
+hanging_restart_loop_simple(Config) when is_list(Config) ->
+ process_flag(trap_exit, true),
+ Child1 = {child1, {supervisor_deadlock, start_child, []},
+ permanent, brutal_kill, worker, []},
+ {ok, Pid} = start_link({ok, {{simple_one_for_one, 8, 10}, [Child1]}}),
+
+ %% Ets table with state read by supervisor_deadlock.erl
+ ets:new(supervisor_deadlock,[set,named_table,public]),
+ ets:insert(supervisor_deadlock,{fail_start,false}),
+
+ {ok, CPid1} = supervisor:start_child(sup_test, []),
+ link(CPid1),
+
+ ets:insert(supervisor_deadlock,{fail_start,true}),
+ supervisor_deadlock:restart_child(),
+ timer:sleep(2000), % allow restart to happen before proceeding
+
+ {error, simple_one_for_one} = supervisor:restart_child(sup_test, child1),
+ {error, simple_one_for_one} = supervisor:delete_child(sup_test, child1),
+ [{undefined,restarting,worker,[]}] = supervisor:which_children(sup_test),
+ [1,0,0,1] = get_child_counts(sup_test),
+
+ ok = supervisor:terminate_child(sup_test, CPid1),
+ check_exit_reason(CPid1, error),
+ [] = supervisor:which_children(sup_test),
+
+ ets:insert(supervisor_deadlock,{fail_start,false}),
+ {ok, CPid2} = supervisor:start_child(sup_test, []),
+ link(CPid2),
+
+ ets:insert(supervisor_deadlock,{fail_start,true}),
+ supervisor_deadlock:restart_child(),
+ timer:sleep(2000), % allow restart to happen before proceeding
+
+ %% Terminating supervisor.
+ %% OTP-9549 fixes so this does not give a timetrap timeout -
+ %% i.e. that supervisor does not hang in restart loop.
+ terminate(Pid,shutdown),
+
+ %% Check that child died with reason from 'restart' request above
+ check_exit_reason(CPid2, error),
+ undefined = whereis(sup_test),
+ ok.
+
+%%-------------------------------------------------------------------------
terminate(Pid, Reason) when Reason =/= supervisor ->
terminate(dummy, Pid, dummy, Reason).
diff --git a/lib/stdlib/test/supervisor_deadlock.erl b/lib/stdlib/test/supervisor_deadlock.erl
new file mode 100644
index 0000000000..288547a972
--- /dev/null
+++ b/lib/stdlib/test/supervisor_deadlock.erl
@@ -0,0 +1,45 @@
+-module(supervisor_deadlock).
+-compile(export_all).
+
+
+%%%-----------------------------------------------------------------
+%%% gen_server callbacks
+init([child]) ->
+ case ets:lookup(supervisor_deadlock,fail_start) of
+ [{fail_start, false}] ->
+ %% we must not fail on the first init, otherwise supervisor
+ %% terminates immediately
+ {ok, []};
+ [{fail_start, true}] ->
+ %% Restart frequency is MaxR=8, MaxT=10, so this will
+ %% ensure that restart intensity is not reached -> restart
+ %% loop
+ timer:sleep(2000), % NOTE: this could be a gen_server call timeout
+
+ {stop, error}
+ end.
+
+handle_call(_Req, _From, State) ->
+ {reply, ok, State}.
+
+%% Force a restart
+handle_cast(restart, State) ->
+ {stop, error, State}.
+
+handle_info(_Msg, State) ->
+ {noreply, State}.
+
+terminate(_Reason, _State) ->
+ ok.
+
+code_change(_OldVsn, State, _Extra) ->
+ {ok, State}.
+
+
+%%%-----------------------------------------------------------------
+%%% Start child
+start_child() ->
+ gen_server:start_link({local, ?MODULE}, ?MODULE, [child], []).
+
+restart_child() ->
+ gen_server:cast(supervisor_deadlock, restart).
diff --git a/lib/stdlib/test/sys_SUITE.erl b/lib/stdlib/test/sys_SUITE.erl
index fe039e8bcc..b2e1d12b2a 100644
--- a/lib/stdlib/test/sys_SUITE.erl
+++ b/lib/stdlib/test/sys_SUITE.erl
@@ -56,70 +56,60 @@ end_per_group(_GroupName, Config) ->
log(suite) -> [];
log(Config) when is_list(Config) ->
- ?line {ok,_Server} = start(),
- ?line ok = sys:log(?server,true),
- ?line {ok,-44} = public_call(44),
- ?line ok = sys:log(?server,false),
- ?line ok = sys:log(?server,print),
- ?line stop(),
+ {ok,_Server} = start(),
+ ok = sys:log(?server,true),
+ {ok,-44} = public_call(44),
+ ok = sys:log(?server,false),
+ ok = sys:log(?server,print),
+ stop(),
ok.
log_to_file(suite) -> [];
log_to_file(Config) when is_list(Config) ->
TempName = test_server:temp_name(?config(priv_dir,Config) ++ "sys."),
- ?line {ok,_Server} = start(),
- ?line ok = sys:log_to_file(?server,TempName),
- ?line {ok,-44} = public_call(44),
- ?line ok = sys:log_to_file(?server,false),
- ?line {ok,Fd} = file:open(TempName,[read]),
- ?line Msg1 = io:get_line(Fd,''),
- ?line Msg2 = io:get_line(Fd,''),
- ?line file:close(Fd),
- ?line lists:prefix("*DBG* sys_SUITE_server got call {req,44} from ",Msg1),
- ?line lists:prefix("*DBG* sys_SUITE_server sent {ok,-44} to ",Msg2),
- ?line stop(),
+ {ok,_Server} = start(),
+ ok = sys:log_to_file(?server,TempName),
+ {ok,-44} = public_call(44),
+ ok = sys:log_to_file(?server,false),
+ {ok,Fd} = file:open(TempName,[read]),
+ Msg1 = io:get_line(Fd,''),
+ Msg2 = io:get_line(Fd,''),
+ file:close(Fd),
+ lists:prefix("*DBG* sys_SUITE_server got call {req,44} from ",Msg1),
+ lists:prefix("*DBG* sys_SUITE_server sent {ok,-44} to ",Msg2),
+ stop(),
ok.
stats(suite) -> [];
stats(Config) when is_list(Config) ->
- ?line Self = self(),
- ?line {ok,_Server} = start(),
- ?line ok = sys:statistics(?server,true),
- ?line {ok,-44} = public_call(44),
- ?line {ok,Stats} = sys:statistics(?server,get),
- ?line lists:member({messages_in,1},Stats),
- ?line lists:member({messages_out,1},Stats),
- ?line ok = sys:statistics(?server,false),
- ?line {status,_Pid,{module,_Mod},[_PDict,running,Self,_,_]} =
+ Self = self(),
+ {ok,_Server} = start(),
+ ok = sys:statistics(?server,true),
+ {ok,-44} = public_call(44),
+ {ok,Stats} = sys:statistics(?server,get),
+ lists:member({messages_in,1},Stats),
+ lists:member({messages_out,1},Stats),
+ ok = sys:statistics(?server,false),
+ {status,_Pid,{module,_Mod},[_PDict,running,Self,_,_]} =
sys:get_status(?server),
- ?line {ok,no_statistics} = sys:statistics(?server,get),
- ?line stop(),
+ {ok,no_statistics} = sys:statistics(?server,get),
+ stop(),
ok.
trace(suite) -> [];
trace(Config) when is_list(Config) ->
- ?line {ok,_Server} = start(),
- case os:type() of
- vxworks ->
- ?line test_server:sleep(20000);
- _ ->
- ?line test_server:sleep(2000)
- end,
- ?line test_server:capture_start(),
- ?line sys:trace(?server,true),
- ?line {ok,-44} = public_call(44),
+ {ok,_Server} = start(),
+ test_server:sleep(2000),
+ test_server:capture_start(),
+ sys:trace(?server,true),
+ {ok,-44} = public_call(44),
%% ho, hum, allow for the io to reach us..
- case os:type() of
- vxworks ->
- ?line test_server:sleep(10000);
- _ ->
- ?line test_server:sleep(1000)
- end,
- ?line test_server:capture_stop(),
- ?line [Msg1,Msg2] = test_server:capture_get(),
- ?line lists:prefix("*DBG* sys_SUITE_server got call {req,44} from ",Msg1),
- ?line lists:prefix("*DBG* sys_SUITE_server sent {ok,-44} to ",Msg2),
- ?line stop(),
+ test_server:sleep(1000),
+ test_server:capture_stop(),
+ [Msg1,Msg2] = test_server:capture_get(),
+ lists:prefix("*DBG* sys_SUITE_server got call {req,44} from ",Msg1),
+ lists:prefix("*DBG* sys_SUITE_server sent {ok,-44} to ",Msg2),
+ stop(),
ok.
suspend(suite) -> [];
diff --git a/lib/stdlib/test/timer_SUITE.erl b/lib/stdlib/test/timer_SUITE.erl
index f84c72b0f8..1110891ab8 100644
--- a/lib/stdlib/test/timer_SUITE.erl
+++ b/lib/stdlib/test/timer_SUITE.erl
@@ -32,7 +32,6 @@
%% functions I guess. But I don't have time for that now.
%%
%% Expect it to run for at least 5-10 minutes!
-%% Except for VxWorks of course, where a couple of hours is more apropriate...
%% The main test case in this module is "do_big_test", which
@@ -77,12 +76,7 @@ end_per_group(_GroupName, Config) ->
do_big_test(TConfig) when is_list(TConfig) ->
Dog = ?t:timetrap(?t:minutes(20)),
Save = process_flag(trap_exit, true),
- Result = case os:type() of
- vxworks ->
- big_test(10);
- _ ->
- big_test(200)
- end,
+ Result = big_test(200),
process_flag(trap_exit, Save),
?t:timetrap_cancel(Dog),
report_result(Result).
diff --git a/lib/stdlib/vsn.mk b/lib/stdlib/vsn.mk
index 694d39ce9c..33d7a57cc3 100644
--- a/lib/stdlib/vsn.mk
+++ b/lib/stdlib/vsn.mk
@@ -1 +1 @@
-STDLIB_VSN = 1.18.1
+STDLIB_VSN = 1.19
diff --git a/lib/syntax_tools/doc/overview.edoc b/lib/syntax_tools/doc/overview.edoc
index 23eadce8fe..df02ad0b3a 100644
--- a/lib/syntax_tools/doc/overview.edoc
+++ b/lib/syntax_tools/doc/overview.edoc
@@ -1,5 +1,9 @@
+ -*- html -*-
-@author Richard Carlsson <[email protected]>
+ Syntax Tools overview page
+
+
+@author Richard Carlsson <[email protected]>
@copyright 1997-2004 Richard Carlsson
@version {@version}
@title Erlang Syntax Tools
diff --git a/lib/syntax_tools/doc/src/Makefile b/lib/syntax_tools/doc/src/Makefile
index 291b3e3047..2502bf877a 100644
--- a/lib/syntax_tools/doc/src/Makefile
+++ b/lib/syntax_tools/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2010. All Rights Reserved.
+# Copyright Ericsson AB 2006-2012. 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
@@ -125,13 +125,13 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/syntax_tools/doc/src/notes.xml b/lib/syntax_tools/doc/src/notes.xml
index b9ac587043..fdfa414ad2 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>2011</year>
+ <year>2007</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -31,6 +31,39 @@
<p>This document describes the changes made to the Syntax_Tools
application.</p>
+<section><title>Syntax_Tools 1.6.9</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Syntax Tools 1.6.9</p>
+ <p>
+ Minor bugfixes, spec annotations and documentation
+ cleanup. Thanks to Richard Carlsson</p>
+ <p>
+ Own Id: OTP-10208</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Syntax_Tools 1.6.8</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>Minor suppressions and fixes of compilation
+ warnings</p>
+ <p>
+ Own Id: OTP-10016</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Syntax_Tools 1.6.7.2</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/syntax_tools/examples/Makefile b/lib/syntax_tools/examples/Makefile
index 7cfe9185c2..2724b0899b 100644
--- a/lib/syntax_tools/examples/Makefile
+++ b/lib/syntax_tools/examples/Makefile
@@ -49,8 +49,8 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec:
- $(INSTALL_DIR) $(RELSYSDIR)/examples
- $(INSTALL_DATA) $(EXAMPLE_FILES) $(RELSYSDIR)/examples
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples"
+ $(INSTALL_DATA) $(EXAMPLE_FILES) "$(RELSYSDIR)/examples"
release_docs_spec:
diff --git a/lib/syntax_tools/src/Makefile b/lib/syntax_tools/src/Makefile
index bac138e95a..dca5e78be9 100644
--- a/lib/syntax_tools/src/Makefile
+++ b/lib/syntax_tools/src/Makefile
@@ -80,10 +80,10 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(OBJECTS) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(SOURCES) $(RELSYSDIR)/src
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(OBJECTS) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(SOURCES) "$(RELSYSDIR)/src"
release_docs_spec:
diff --git a/lib/syntax_tools/src/epp_dodger.erl b/lib/syntax_tools/src/epp_dodger.erl
index 9f6f7d815e..b3ced34c14 100644
--- a/lib/syntax_tools/src/epp_dodger.erl
+++ b/lib/syntax_tools/src/epp_dodger.erl
@@ -14,10 +14,8 @@
%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
%% USA
%%
-%% $Id$
-%%
%% @copyright 2001-2006 Richard Carlsson
-%% @author Richard Carlsson <[email protected]>
+%% @author Richard Carlsson <[email protected]>
%% @end
%% =====================================================================
diff --git a/lib/syntax_tools/src/erl_comment_scan.erl b/lib/syntax_tools/src/erl_comment_scan.erl
index 108ab3bffd..b833e1c069 100644
--- a/lib/syntax_tools/src/erl_comment_scan.erl
+++ b/lib/syntax_tools/src/erl_comment_scan.erl
@@ -16,7 +16,7 @@
%%
%% =====================================================================
%% @copyright 1997-2006 Richard Carlsson
-%% @author Richard Carlsson <[email protected]>
+%% @author Richard Carlsson <[email protected]>
%% @end
%% =====================================================================
diff --git a/lib/syntax_tools/src/erl_prettypr.erl b/lib/syntax_tools/src/erl_prettypr.erl
index 7caf0b3db6..f4bbf975c3 100644
--- a/lib/syntax_tools/src/erl_prettypr.erl
+++ b/lib/syntax_tools/src/erl_prettypr.erl
@@ -14,10 +14,8 @@
%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
%% USA
%%
-%% $Id$
-%%
%% @copyright 1997-2006 Richard Carlsson
-%% @author Richard Carlsson <[email protected]>
+%% @author Richard Carlsson <[email protected]>
%% @end
%% =====================================================================
diff --git a/lib/syntax_tools/src/erl_recomment.erl b/lib/syntax_tools/src/erl_recomment.erl
index fc7c515700..7b2f9f7adb 100644
--- a/lib/syntax_tools/src/erl_recomment.erl
+++ b/lib/syntax_tools/src/erl_recomment.erl
@@ -14,10 +14,8 @@
%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
%% USA
%%
-%% $Id$
-%%
%% @copyright 1997-2006 Richard Carlsson
-%% @author Richard Carlsson <[email protected]>
+%% @author Richard Carlsson <[email protected]>
%% @end
%% =====================================================================
diff --git a/lib/syntax_tools/src/erl_syntax.erl b/lib/syntax_tools/src/erl_syntax.erl
index 32fd3722d6..151f04b03b 100644
--- a/lib/syntax_tools/src/erl_syntax.erl
+++ b/lib/syntax_tools/src/erl_syntax.erl
@@ -14,10 +14,8 @@
%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
%% USA
%%
-%% $Id$
-%%
%% @copyright 1997-2006 Richard Carlsson
-%% @author Richard Carlsson <[email protected]>
+%% @author Richard Carlsson <[email protected]>
%% @end
%% =====================================================================
@@ -26,23 +24,20 @@
%% This module defines an abstract data type for representing Erlang
%% source code as syntax trees, in a way that is backwards compatible
%% with the data structures created by the Erlang standard library
-%% parser module <code>erl_parse</code> (often referred to as "parse
+%% parser module `erl_parse' (often referred to as "parse
%% trees", which is a bit of a misnomer). This means that all
-%% <code>erl_parse</code> trees are valid abstract syntax trees, but the
+%% `erl_parse' trees are valid abstract syntax trees, but the
%% reverse is not true: abstract syntax trees can in general not be used
-%% as input to functions expecting an <code>erl_parse</code> tree.
+%% as input to functions expecting an `erl_parse' tree.
%% However, as long as an abstract syntax tree represents a correct
-%% Erlang program, the function <a
-%% href="#revert-1"><code>revert/1</code></a> should be able to
-%% transform it to the corresponding <code>erl_parse</code>
+%% Erlang program, the function {@link revert/1} should be able to
+%% transform it to the corresponding `erl_parse'
%% representation.
%%
-%% A recommended starting point for the first-time user is the
-%% documentation of the <a
-%% href="#type-syntaxTree"><code>syntaxTree()</code></a> data type, and
-%% the function <a href="#type-1"><code>type/1</code></a>.
+%% A recommended starting point for the first-time user is the documentation
+%% of the {@link syntaxTree()} data type, and the function {@link type/1}.
%%
-%% <h3><b>NOTES:</b></h3>
+%% == NOTES: ==
%%
%% This module deals with the composition and decomposition of
%% <em>syntactic</em> entities (as opposed to semantic ones); its
@@ -52,36 +47,31 @@
%% in general, the user is assumed to pass type-correct arguments - if
%% this is not done, the effects are not defined.
%%
-%% With the exception of the <code>erl_parse</code> data structures,
+%% With the exception of the {@link erl_parse()} data structures,
%% the internal representations of abstract syntax trees are subject to
%% change without notice, and should not be documented outside this
%% module. Furthermore, we do not give any guarantees on how an abstract
%% syntax tree may or may not be represented, <em>with the following
%% exceptions</em>: no syntax tree is represented by a single atom, such
-%% as <code>none</code>, by a list constructor <code>[X | Y]</code>, or
-%% by the empty list <code>[]</code>. This can be relied on when writing
+%% as `none', by a list constructor `[X | Y]', or
+%% by the empty list `[]'. This can be relied on when writing
%% functions that operate on syntax trees.
-%% @type syntaxTree(). An abstract syntax tree. The
-%% <code>erl_parse</code> "parse tree" representation is a subset of the
-%% <code>syntaxTree()</code> representation.
+%% @type syntaxTree(). An abstract syntax tree. The {@link erl_parse()}
+%% "parse tree" representation is a proper subset of the `syntaxTree()'
+%% representation.
%%
%% Every abstract syntax tree node has a <em>type</em>, given by the
-%% function <a href="#type-1"><code>type/1</code></a>. Each node also
-%% has associated <em>attributes</em>; see <a
-%% href="#get_attrs-1"><code>get_attrs/1</code></a> for details. The
-%% functions <a href="#make_tree-2"><code>make_tree/2</code></a> and <a
-%% href="#subtrees-1"><code>subtrees/1</code></a> are generic
+%% function {@link type/1}. Each node also has associated
+%% <em>attributes</em>; see {@link get_attrs/1} for details. The functions
+%% {@link make_tree/2} and {@link subtrees/1} are generic
%% constructor/decomposition functions for abstract syntax trees. The
-%% functions <a href="#abstract-1"><code>abstract/1</code></a> and <a
-%% href="#concrete-1"><code>concrete/1</code></a> convert between
+%% functions {@link abstract/1} and {@link concrete/1} convert between
%% constant Erlang terms and their syntactic representations. The set of
-%% syntax tree nodes is extensible through the <a
-%% href="#tree-2"><code>tree/2</code></a> function.
+%% syntax tree nodes is extensible through the {@link tree/2} function.
%%
-%% A syntax tree can be transformed to the <code>erl_parse</code>
-%% representation with the <a href="#revert-1"><code>revert/1</code></a>
-%% function.
+%% A syntax tree can be transformed to the {@link erl_parse()}
+%% representation with the {@link revert/1} function.
-module(erl_syntax).
@@ -309,7 +299,7 @@
data/1,
is_tree/1]).
--export_type([forms/0, syntaxTree/0, syntaxTreeAttributes/0]).
+-export_type([forms/0, syntaxTree/0, syntaxTreeAttributes/0, padding/0]).
%% =====================================================================
%% IMPLEMENTATION NOTES:
@@ -390,11 +380,15 @@
-record(wrapper, {type :: atom(),
attr = #attr{} :: #attr{},
- tree :: term()}).
+ tree :: erl_parse()}).
%% =====================================================================
--type syntaxTree() :: #tree{} | #wrapper{} | tuple(). % XXX: refine
+-type syntaxTree() :: #tree{} | #wrapper{} | erl_parse().
+
+-type erl_parse() :: erl_parse:abstract_form() | erl_parse:abstract_expr().
+%% The representation built by the Erlang standard library parser
+%% `erl_parse'. This is a subset of the {@link syntaxTree()} type.
%% =====================================================================
%%
@@ -404,12 +398,11 @@
%% =====================================================================
-%% @spec type(Node::syntaxTree()) -> atom()
-%%
-%% @doc Returns the type tag of <code>Node</code>. If <code>Node</code>
+%% @doc Returns the type tag of `Node'. If `Node'
%% does not represent a syntax tree, evaluation fails with reason
-%% <code>badarg</code>. Node types currently defined by this module are:
-%% <p><center><table border="1">
+%% `badarg'. Node types currently defined by this module are:
+%%
+%% <center><table border="1">
%% <tr>
%% <td>application</td>
%% <td>arity_qualifier</td>
@@ -476,12 +469,13 @@
%% <td>variable</td>
%% <td>warning_marker</td>
%% </tr>
-%% </table></center></p>
-%% <p>The user may (for special purposes) create additional nodes
-%% with other type tags, using the <code>tree/2</code> function.</p>
+%% </table></center>
+%%
+%% The user may (for special purposes) create additional nodes
+%% with other type tags, using the {@link tree/2} function.
%%
-%% <p>Note: The primary constructor functions for a node type should
-%% always have the same name as the node type itself.</p>
+%% Note: The primary constructor functions for a node type should
+%% always have the same name as the node type itself.
%%
%% @see tree/2
%% @see application/3
@@ -606,39 +600,38 @@ type(Node) ->
%% =====================================================================
-%% @spec is_leaf(Node::syntaxTree()) -> boolean()
-%%
-%% @doc Returns <code>true</code> if <code>Node</code> is a leaf node,
-%% otherwise <code>false</code>. The currently recognised leaf node
+%% @doc Returns `true' if `Node' is a leaf node,
+%% otherwise `false'. The currently recognised leaf node
%% types are:
-%% <p><center><table border="1">
+%%
+%% <center><table border="1">
%% <tr>
-%% <td><code>atom</code></td>
-%% <td><code>char</code></td>
-%% <td><code>comment</code></td>
-%% <td><code>eof_marker</code></td>
-%% <td><code>error_marker</code></td>
+%% <td>`atom'</td>
+%% <td>`char'</td>
+%% <td>`comment'</td>
+%% <td>`eof_marker'</td>
+%% <td>`error_marker'</td>
%% </tr><tr>
-%% <td><code>float</code></td>
-%% <td><code>integer</code></td>
-%% <td><code>nil</code></td>
-%% <td><code>operator</code></td>
-%% <td><code>string</code></td>
+%% <td>`float'</td>
+%% <td>`integer'</td>
+%% <td>`nil'</td>
+%% <td>`operator'</td>
+%% <td>`string'</td>
%% </tr><tr>
-%% <td><code>text</code></td>
-%% <td><code>underscore</code></td>
-%% <td><code>variable</code></td>
-%% <td><code>warning_marker</code></td>
+%% <td>`text'</td>
+%% <td>`underscore'</td>
+%% <td>`variable'</td>
+%% <td>`warning_marker'</td>
%% </tr>
-%% </table></center></p>
-%% <p>A node of type <code>tuple</code> is a leaf node if and only if
-%% its arity is zero.</p>
+%% </table></center>
%%
-%% <p>Note: not all literals are leaf nodes, and vice versa. E.g.,
+%% A node of type `tuple' is a leaf node if and only if its arity is zero.
+%%
+%% Note: not all literals are leaf nodes, and vice versa. E.g.,
%% tuples with nonzero arity and nonempty lists may be literals, but are
%% not leaf nodes. Variables, on the other hand, are leaf nodes but not
-%% literals.</p>
-%%
+%% literals.
+%%
%% @see type/1
%% @see is_literal/1
@@ -666,29 +659,29 @@ is_leaf(Node) ->
%% =====================================================================
-%% @spec is_form(Node::syntaxTree()) -> boolean()
-%%
-%% @doc Returns <code>true</code> if <code>Node</code> is a syntax tree
+%% @doc Returns `true' if `Node' is a syntax tree
%% representing a so-called "source code form", otherwise
-%% <code>false</code>. Forms are the Erlang source code units which,
+%% `false'. Forms are the Erlang source code units which,
%% placed in sequence, constitute an Erlang program. Current form types
%% are:
-%% <p><center><table border="1">
+%%
+%% <center><table border="1">
%% <tr>
-%% <td><code>attribute</code></td>
-%% <td><code>comment</code></td>
-%% <td><code>error_marker</code></td>
-%% <td><code>eof_marker</code></td>
-%% <td><code>form_list</code></td>
+%% <td>`attribute'</td>
+%% <td>`comment'</td>
+%% <td>`error_marker'</td>
+%% <td>`eof_marker'</td>
+%% <td>`form_list'</td>
%% </tr><tr>
-%% <td><code>function</code></td>
-%% <td><code>rule</code></td>
-%% <td><code>warning_marker</code></td>
-%% <td><code>text</code></td>
+%% <td>`function'</td>
+%% <td>`rule'</td>
+%% <td>`warning_marker'</td>
+%% <td>`text'</td>
%% </tr>
-%% </table></center></p>
+%% </table></center>
+%%
%% @see type/1
-%% @see attribute/2
+%% @see attribute/2
%% @see comment/2
%% @see eof_marker/0
%% @see error_marker/1
@@ -715,10 +708,8 @@ is_form(Node) ->
%% =====================================================================
-%% @spec get_pos(Node::syntaxTree()) -> term()
-%%
%% @doc Returns the position information associated with
-%% <code>Node</code>. This is usually a nonnegative integer (indicating
+%% `Node'. This is usually a nonnegative integer (indicating
%% the source code line number), but may be any term. By default, all
%% new tree nodes have their associated position information set to the
%% integer zero.
@@ -750,10 +741,7 @@ get_pos(Node) ->
%% =====================================================================
-%% @spec set_pos(Node::syntaxTree(), Pos::term()) -> syntaxTree()
-%%
-%% @doc Sets the position information of <code>Node</code> to
-%% <code>Pos</code>.
+%% @doc Sets the position information of `Node' to `Pos'.
%%
%% @see get_pos/1
%% @see copy_pos/2
@@ -774,14 +762,10 @@ set_pos(Node, Pos) ->
%% =====================================================================
-%% @spec copy_pos(Source::syntaxTree(), Target::syntaxTree()) ->
-%% syntaxTree()
-%%
-%% @doc Copies the position information from <code>Source</code> to
-%% <code>Target</code>.
+%% @doc Copies the position information from `Source' to `Target'.
%%
-%% <p>This is equivalent to <code>set_pos(Target,
-%% get_pos(Source))</code>, but potentially more efficient.</p>
+%% This is equivalent to `set_pos(Target,
+%% get_pos(Source))', but potentially more efficient.
%%
%% @see get_pos/1
%% @see set_pos/2
@@ -811,24 +795,20 @@ set_com(Node, Com) ->
%% =====================================================================
-%% @spec get_precomments(syntaxTree()) -> [syntaxTree()]
-%%
%% @doc Returns the associated pre-comments of a node. This is a
%% possibly empty list of abstract comments, in top-down textual order.
%% When the code is formatted, pre-comments are typically displayed
%% directly above the node. For example:
-%% <pre>
-%% % Pre-comment of function
-%% foo(X) -> {bar, X}.</pre>
+%% ```% Pre-comment of function
+%% foo(X) -> {bar, X}.'''
%%
-%% <p>If possible, the comment should be moved before any preceding
+%% If possible, the comment should be moved before any preceding
%% separator characters on the same line. E.g.:
-%% <pre>
-%% foo([X | Xs]) ->
-%% % Pre-comment of 'bar(X)' node
-%% [bar(X) | foo(Xs)];
-%% ...</pre>
-%% (where the comment is moved before the "<code>[</code>").</p>
+%% ```foo([X | Xs]) ->
+%% % Pre-comment of 'bar(X)' node
+%% [bar(X) | foo(Xs)];
+%% ...'''
+%% (where the comment is moved before the "`['").
%%
%% @see comment/2
%% @see set_precomments/2
@@ -846,11 +826,8 @@ get_precomments_1(#attr{com = #com{pre = Cs}}) -> Cs.
%% =====================================================================
-%% @spec set_precomments(Node::syntaxTree(),
-%% Comments::[syntaxTree()]) -> syntaxTree()
-%%
-%% @doc Sets the pre-comments of <code>Node</code> to
-%% <code>Comments</code>. <code>Comments</code> should be a possibly
+%% @doc Sets the pre-comments of `Node' to
+%% `Comments'. `Comments' should be a possibly
%% empty list of abstract comments, in top-down textual order.
%%
%% @see comment/2
@@ -880,15 +857,11 @@ set_precomments_1(#attr{com = Com} = Attr, Cs) ->
%% =====================================================================
-%% @spec add_precomments(Comments::[syntaxTree()],
-%% Node::syntaxTree()) -> syntaxTree()
+%% @doc Appends `Comments' to the pre-comments of `Node'.
%%
-%% @doc Appends <code>Comments</code> to the pre-comments of
-%% <code>Node</code>.
-%%
-%% <p>Note: This is equivalent to <code>set_precomments(Node,
-%% get_precomments(Node) ++ Comments)</code>, but potentially more
-%% efficient.</p>
+%% Note: This is equivalent to `set_precomments(Node,
+%% get_precomments(Node) ++ Comments)', but potentially more
+%% efficient.
%%
%% @see comment/2
%% @see get_precomments/1
@@ -915,24 +888,20 @@ add_precomments_1(Cs, #attr{com = Com} = Attr) ->
%% =====================================================================
-%% @spec get_postcomments(syntaxTree()) -> [syntaxTree()]
-%%
%% @doc Returns the associated post-comments of a node. This is a
%% possibly empty list of abstract comments, in top-down textual order.
%% When the code is formatted, post-comments are typically displayed to
%% the right of and/or below the node. For example:
-%% <pre>
-%% {foo, X, Y} % Post-comment of tuple</pre>
+%% ```{foo, X, Y} % Post-comment of tuple'''
%%
-%% <p>If possible, the comment should be moved past any following
+%% If possible, the comment should be moved past any following
%% separator characters on the same line, rather than placing the
%% separators on the following line. E.g.:
-%% <pre>
-%% foo([X | Xs], Y) ->
-%% foo(Xs, bar(X)); % Post-comment of 'bar(X)' node
-%% ...</pre>
-%% (where the comment is moved past the rightmost "<code>)</code>" and
-%% the "<code>;</code>").</p>
+%% ```foo([X | Xs], Y) ->
+%% foo(Xs, bar(X)); % Post-comment of 'bar(X)' node
+%% ...'''
+%% (where the comment is moved past the rightmost "`)'" and
+%% the "`;'").
%%
%% @see comment/2
%% @see set_postcomments/2
@@ -950,11 +919,8 @@ get_postcomments_1(#attr{com = #com{post = Cs}}) -> Cs.
%% =====================================================================
-%% @spec set_postcomments(Node::syntaxTree(),
-%% Comments::[syntaxTree()]) -> syntaxTree()
-%%
-%% @doc Sets the post-comments of <code>Node</code> to
-%% <code>Comments</code>. <code>Comments</code> should be a possibly
+%% @doc Sets the post-comments of `Node' to
+%% `Comments'. `Comments' should be a possibly
%% empty list of abstract comments, in top-down textual order
%%
%% @see comment/2
@@ -984,15 +950,11 @@ set_postcomments_1(#attr{com = Com} = Attr, Cs) ->
%% =====================================================================
-%% @spec add_postcomments(Comments::[syntaxTree()],
-%% Node::syntaxTree()) -> syntaxTree()
-%%
-%% @doc Appends <code>Comments</code> to the post-comments of
-%% <code>Node</code>.
+%% @doc Appends `Comments' to the post-comments of `Node'.
%%
-%% <p>Note: This is equivalent to <code>set_postcomments(Node,
-%% get_postcomments(Node) ++ Comments)</code>, but potentially more
-%% efficient.</p>
+%% Note: This is equivalent to `set_postcomments(Node,
+%% get_postcomments(Node) ++ Comments)', but potentially more
+%% efficient.
%%
%% @see comment/2
%% @see get_postcomments/1
@@ -1019,14 +981,12 @@ add_postcomments_1(Cs, #attr{com = Com} = Attr) ->
%% =====================================================================
-%% @spec has_comments(Node::syntaxTree()) -> boolean()
+%% @doc Yields `false' if the node has no associated
+%% comments, and `true' otherwise.
%%
-%% @doc Yields <code>false</code> if the node has no associated
-%% comments, and <code>true</code> otherwise.
-%%
-%% <p>Note: This is equivalent to <code>(get_precomments(Node) == [])
-%% and (get_postcomments(Node) == [])</code>, but potentially more
-%% efficient.</p>
+%% Note: This is equivalent to `(get_precomments(Node) == [])
+%% and (get_postcomments(Node) == [])', but potentially more
+%% efficient.
%%
%% @see get_precomments/1
%% @see get_postcomments/1
@@ -1050,13 +1010,11 @@ has_comments(_) -> false.
%% =====================================================================
-%% @spec remove_comments(Node::syntaxTree()) -> syntaxTree()
-%%
-%% @doc Clears the associated comments of <code>Node</code>.
+%% @doc Clears the associated comments of `Node'.
%%
-%% <p>Note: This is equivalent to
-%% <code>set_precomments(set_postcomments(Node, []), [])</code>, but
-%% potentially more efficient.</p>
+%% Note: This is equivalent to
+%% `set_precomments(set_postcomments(Node, []), [])', but
+%% potentially more efficient.
%%
%% @see set_precomments/2
%% @see set_postcomments/2
@@ -1075,16 +1033,12 @@ remove_comments(Node) ->
%% =====================================================================
-%% @spec copy_comments(Source::syntaxTree(), Target::syntaxTree()) ->
-%% syntaxTree()
-%%
-%% @doc Copies the pre- and postcomments from <code>Source</code> to
-%% <code>Target</code>.
+%% @doc Copies the pre- and postcomments from `Source' to `Target'.
%%
-%% <p>Note: This is equivalent to
-%% <code>set_postcomments(set_precomments(Target,
-%% get_precomments(Source)), get_postcomments(Source))</code>, but
-%% potentially more efficient.</p>
+%% Note: This is equivalent to
+%% `set_postcomments(set_precomments(Target,
+%% get_precomments(Source)), get_postcomments(Source))', but
+%% potentially more efficient.
%%
%% @see comment/2
%% @see get_precomments/1
@@ -1099,16 +1053,13 @@ copy_comments(Source, Target) ->
%% =====================================================================
-%% @spec join_comments(Source::syntaxTree(), Target::syntaxTree()) ->
-%% syntaxTree()
+%% @doc Appends the comments of `Source' to the current
+%% comments of `Target'.
%%
-%% @doc Appends the comments of <code>Source</code> to the current
-%% comments of <code>Target</code>.
-%%
-%% <p>Note: This is equivalent to
-%% <code>add_postcomments(get_postcomments(Source),
-%% add_precomments(get_precomments(Source), Target))</code>, but
-%% potentially more efficient.</p>
+%% Note: This is equivalent to
+%% `add_postcomments(get_postcomments(Source),
+%% add_precomments(get_precomments(Source), Target))', but
+%% potentially more efficient.
%%
%% @see comment/2
%% @see get_precomments/1
@@ -1125,8 +1076,6 @@ join_comments(Source, Target) ->
%% =====================================================================
-%% @spec get_ann(syntaxTree()) -> [term()]
-%%
%% @doc Returns the list of user annotations associated with a syntax
%% tree node. For a newly created node, this is the empty list. The
%% annotations may be any terms.
@@ -1142,11 +1091,7 @@ get_ann(_) -> [].
%% =====================================================================
-%% @spec set_ann(Node::syntaxTree(), Annotations::[term()]) ->
-%% syntaxTree()
-%%
-%% @doc Sets the list of user annotations of <code>Node</code> to
-%% <code>Annotations</code>.
+%% @doc Sets the list of user annotations of `Node' to `Annotations'.
%%
%% @see get_ann/1
%% @see add_ann/2
@@ -1168,13 +1113,11 @@ set_ann(Node, As) ->
%% =====================================================================
-%% @spec add_ann(Annotation::term(), Node::syntaxTree()) -> syntaxTree()
-%%
-%% @doc Appends the term <code>Annotation</code> to the list of user
-%% annotations of <code>Node</code>.
+%% @doc Appends the term `Annotation' to the list of user
+%% annotations of `Node'.
%%
-%% <p>Note: this is equivalent to <code>set_ann(Node, [Annotation |
-%% get_ann(Node)])</code>, but potentially more efficient.</p>
+%% Note: this is equivalent to `set_ann(Node, [Annotation |
+%% get_ann(Node)])', but potentially more efficient.
%%
%% @see get_ann/1
%% @see set_ann/2
@@ -1195,14 +1138,10 @@ add_ann(A, Node) ->
%% =====================================================================
-%% @spec copy_ann(Source::syntaxTree(), Target::syntaxTree()) ->
-%% syntaxTree()
+%% @doc Copies the list of user annotations from `Source' to `Target'.
%%
-%% @doc Copies the list of user annotations from <code>Source</code> to
-%% <code>Target</code>.
-%%
-%% <p>Note: this is equivalent to <code>set_ann(Target,
-%% get_ann(Source))</code>, but potentially more efficient.</p>
+%% Note: this is equivalent to `set_ann(Target,
+%% get_ann(Source))', but potentially more efficient.
%%
%% @see get_ann/1
%% @see set_ann/2
@@ -1214,23 +1153,20 @@ copy_ann(Source, Target) ->
%% =====================================================================
-%% @spec get_attrs(syntaxTree()) -> syntaxTreeAttributes()
-%%
%% @doc Returns a representation of the attributes associated with a
%% syntax tree node. The attributes are all the extra information that
%% can be attached to a node. Currently, this includes position
%% information, source code comments, and user annotations. The result
%% of this function cannot be inspected directly; only attached to
-%% another node (cf. <code>set_attrs/2</code>).
+%% another node (see {@link set_attrs/2}).
%%
-%% <p>For accessing individual attributes, see <code>get_pos/1</code>,
-%% <code>get_ann/1</code>, <code>get_precomments/1</code> and
-%% <code>get_postcomments/1</code>.</p>
+%% For accessing individual attributes, see {@link get_pos/1},
+%% {@link get_ann/1}, {@link get_precomments/1} and
+%% {@link get_postcomments/1}.
%%
%% @type syntaxTreeAttributes(). This is an abstract representation of
-%% syntax tree node attributes; see the function <a
-%% href="#get_attrs-1"><code>get_attrs/1</code></a>.
-%%
+%% syntax tree node attributes; see the function {@link get_attrs/1}.
+%%
%% @see set_attrs/2
%% @see get_pos/1
%% @see get_ann/1
@@ -1247,11 +1183,7 @@ get_attrs(Node) -> #attr{pos = get_pos(Node),
%% =====================================================================
-%% @spec set_attrs(Node::syntaxTree(),
-%% Attributes::syntaxTreeAttributes()) -> syntaxTree()
-%%
-%% @doc Sets the attributes of <code>Node</code> to
-%% <code>Attributes</code>.
+%% @doc Sets the attributes of `Node' to `Attributes'.
%%
%% @see get_attrs/1
%% @see copy_attrs/2
@@ -1270,14 +1202,10 @@ set_attrs(Node, Attr) ->
%% =====================================================================
-%% @spec copy_attrs(Source::syntaxTree(), Target::syntaxTree()) ->
-%% syntaxTree()
+%% @doc Copies the attributes from `Source' to `Target'.
%%
-%% @doc Copies the attributes from <code>Source</code> to
-%% <code>Target</code>.
-%%
-%% <p>Note: this is equivalent to <code>set_attrs(Target,
-%% get_attrs(Source))</code>, but potentially more efficient.</p>
+%% Note: this is equivalent to `set_attrs(Target,
+%% get_attrs(Source))', but potentially more efficient.
%%
%% @see get_attrs/1
%% @see set_attrs/2
@@ -1289,7 +1217,6 @@ copy_attrs(S, T) ->
%% =====================================================================
-%% @spec comment(Strings) -> syntaxTree()
%% @equiv comment(none, Strings)
-spec comment([string()]) -> syntaxTree().
@@ -1299,22 +1226,19 @@ comment(Strings) ->
%% =====================================================================
-%% @spec comment(Padding, Strings::[string()]) -> syntaxTree()
-%% Padding = none | integer()
-%%
%% @doc Creates an abstract comment with the given padding and text. If
-%% <code>Strings</code> is a (possibly empty) list
+%% `Strings' is a (possibly empty) list
%% <code>["<em>Txt1</em>", ..., "<em>TxtN</em>"]</code>, the result
%% represents the source code text
%% <pre>
-%% %<em>Txt1</em>
-%% ...
-%% %<em>TxtN</em></pre>
-%% <code>Padding</code> states the number of empty character positions
+%% %<em>Txt1</em>
+%% ...
+%% %<em>TxtN</em></pre>
+%% `Padding' states the number of empty character positions
%% to the left of the comment separating it horizontally from
-%% source code on the same line (if any). If <code>Padding</code> is
-%% <code>none</code>, a default positive number is used. If
-%% <code>Padding</code> is an integer less than 1, there should be no
+%% source code on the same line (if any). If `Padding' is
+%% `none', a default positive number is used. If
+%% `Padding' is an integer less than 1, there should be no
%% separating space. Comments are in themselves regarded as source
%% program forms.
%%
@@ -1338,8 +1262,6 @@ comment(Pad, Strings) ->
%% =====================================================================
-%% @spec comment_text(syntaxTree()) -> [string()]
-%%
%% @doc Returns the lines of text of the abstract comment.
%%
%% @see comment/2
@@ -1351,11 +1273,8 @@ comment_text(Node) ->
%% =====================================================================
-%% @spec comment_padding(syntaxTree()) -> none | integer()
-%%
%% @doc Returns the amount of padding before the comment, or
-%% <code>none</code>. The latter means that a default padding may be
-%% used.
+%% `none'. The latter means that a default padding may be used.
%%
%% @see comment/2
@@ -1366,23 +1285,21 @@ comment_padding(Node) ->
%% =====================================================================
-%% @spec form_list(Forms::[syntaxTree()]) -> syntaxTree()
-%%
%% @doc Creates an abstract sequence of "source code forms". If
-%% <code>Forms</code> is <code>[F1, ..., Fn]</code>, where each
-%% <code>Fi</code> is a form (cf. <code>is_form/1</code>, the result
+%% `Forms' is `[F1, ..., Fn]', where each
+%% `Fi' is a form (see {@link is_form/1}, the result
%% represents
%% <pre>
-%% <em>F1</em>
-%% ...
-%% <em>Fn</em></pre>
-%% where the <code>Fi</code> are separated by one or more line breaks. A
-%% node of type <code>form_list</code> is itself regarded as a source
-%% code form; cf. <code>flatten_form_list/1</code>.
-%%
-%% <p>Note: this is simply a way of grouping source code forms as a
+%% <em>F1</em>
+%% ...
+%% <em>Fn</em></pre>
+%% where the `Fi' are separated by one or more line breaks. A
+%% node of type `form_list' is itself regarded as a source
+%% code form; see {@link flatten_form_list/1}.
+%%
+%% Note: this is simply a way of grouping source code forms as a
%% single syntax tree, usually in order to form an Erlang module
-%% definition.</p>
+%% definition.
%%
%% @see form_list_elements/1
%% @see is_form/1
@@ -1401,9 +1318,7 @@ form_list(Forms) ->
%% =====================================================================
-%% @spec form_list_elements(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the list of subnodes of a <code>form_list</code> node.
+%% @doc Returns the list of subnodes of a `form_list' node.
%%
%% @see form_list/1
@@ -1414,10 +1329,8 @@ form_list_elements(Node) ->
%% =====================================================================
-%% @spec flatten_form_list(Node::syntaxTree()) -> syntaxTree()
-%%
-%% @doc Flattens sublists of a <code>form_list</code> node. Returns
-%% <code>Node</code> with all subtrees of type <code>form_list</code>
+%% @doc Flattens sublists of a `form_list' node. Returns
+%% `Node' with all subtrees of type `form_list'
%% recursively expanded, yielding a single "flat" abstract form
%% sequence.
%%
@@ -1443,10 +1356,8 @@ flatten_form_list_1([], As) ->
%% =====================================================================
-%% @spec text(String::string()) -> syntaxTree()
-%%
%% @doc Creates an abstract piece of source code text. The result
-%% represents exactly the sequence of characters in <code>String</code>.
+%% represents exactly the sequence of characters in `String'.
%% This is useful in cases when one wants full control of the resulting
%% output, e.g., for the appearance of floating-point numbers or macro
%% definitions.
@@ -1463,10 +1374,7 @@ text(String) ->
%% =====================================================================
-%% @spec text_string(syntaxTree()) -> string()
-%%
-%% @doc Returns the character sequence represented by a
-%% <code>text</code> node.
+%% @doc Returns the character sequence represented by a `text' node.
%%
%% @see text/1
@@ -1477,18 +1385,15 @@ text_string(Node) ->
%% =====================================================================
-%% @spec variable(Name) -> syntaxTree()
-%% Name = atom() | string()
-%%
%% @doc Creates an abstract variable with the given name.
-%% <code>Name</code> may be any atom or string that represents a
+%% `Name' may be any atom or string that represents a
%% lexically valid variable name, but <em>not</em> a single underscore
-%% character; cf. <code>underscore/0</code>.
+%% character; see {@link underscore/0}.
%%
-%% <p>Note: no checking is done whether the character sequence
+%% Note: no checking is done whether the character sequence
%% represents a proper variable name, i.e., whether or not its first
%% character is an uppercase Erlang character, or whether it does not
-%% contain control characters, whitespace, etc.</p>
+%% contain control characters, whitespace, etc.
%%
%% @see variable_name/1
%% @see variable_literal/1
@@ -1517,9 +1422,7 @@ revert_variable(Node) ->
%% =====================================================================
-%% @spec variable_name(syntaxTree()) -> atom()
-%%
-%% @doc Returns the name of a <code>variable</code> node as an atom.
+%% @doc Returns the name of a `variable' node as an atom.
%%
%% @see variable/1
@@ -1535,9 +1438,7 @@ variable_name(Node) ->
%% =====================================================================
-%% @spec variable_literal(syntaxTree()) -> string()
-%%
-%% @doc Returns the name of a <code>variable</code> node as a string.
+%% @doc Returns the name of a `variable' node as a string.
%%
%% @see variable/1
@@ -1553,9 +1454,7 @@ variable_literal(Node) ->
%% =====================================================================
-%% @spec underscore() -> syntaxTree()
-%%
-%% @doc Creates an abstract universal pattern ("<code>_</code>"). The
+%% @doc Creates an abstract universal pattern ("`_'"). The
%% lexical representation is a single underscore character. Note that
%% this is <em>not</em> a variable, lexically speaking.
%%
@@ -1579,10 +1478,8 @@ revert_underscore(Node) ->
%% =====================================================================
-%% @spec integer(Value::integer()) -> syntaxTree()
-%%
%% @doc Creates an abstract integer literal. The lexical representation
-%% is the canonical decimal numeral of <code>Value</code>.
+%% is the canonical decimal numeral of `Value'.
%%
%% @see integer_value/1
%% @see integer_literal/1
@@ -1608,11 +1505,8 @@ revert_integer(Node) ->
%% =====================================================================
-%% @spec is_integer(Node::syntaxTree(), Value::integer()) -> boolean()
-%%
-%% @doc Returns <code>true</code> if <code>Node</code> has type
-%% <code>integer</code> and represents <code>Value</code>, otherwise
-%% <code>false</code>.
+%% @doc Returns `true' if `Node' has type
+%% `integer' and represents `Value', otherwise `false'.
%%
%% @see integer/1
@@ -1630,9 +1524,7 @@ is_integer(Node, Value) ->
%% =====================================================================
-%% @spec integer_value(syntaxTree()) -> integer()
-%%
-%% @doc Returns the value represented by an <code>integer</code> node.
+%% @doc Returns the value represented by an `integer' node.
%%
%% @see integer/1
@@ -1648,10 +1540,7 @@ integer_value(Node) ->
%% =====================================================================
-%% @spec integer_literal(syntaxTree()) -> string()
-%%
-%% @doc Returns the numeral string represented by an
-%% <code>integer</code> node.
+%% @doc Returns the numeral string represented by an `integer' node.
%%
%% @see integer/1
@@ -1662,11 +1551,8 @@ integer_literal(Node) ->
%% =====================================================================
-%% @spec float(Value::float()) -> syntaxTree()
-%%
%% @doc Creates an abstract floating-point literal. The lexical
-%% representation is the decimal floating-point numeral of
-%% <code>Value</code>.
+%% representation is the decimal floating-point numeral of `Value'.
%%
%% @see float_value/1
%% @see float_literal/1
@@ -1701,9 +1587,7 @@ revert_float(Node) ->
%% =====================================================================
-%% @spec float_value(syntaxTree()) -> float()
-%%
-%% @doc Returns the value represented by a <code>float</code> node. Note
+%% @doc Returns the value represented by a `float' node. Note
%% that floating-point values should usually not be compared for
%% equality.
%%
@@ -1721,10 +1605,7 @@ float_value(Node) ->
%% =====================================================================
-%% @spec float_literal(syntaxTree()) -> string()
-%%
-%% @doc Returns the numeral string represented by a <code>float</code>
-%% node.
+%% @doc Returns the numeral string represented by a `float' node.
%%
%% @see float/1
@@ -1735,17 +1616,15 @@ float_literal(Node) ->
%% =====================================================================
-%% @spec char(Value::char()) -> syntaxTree()
-%%
%% @doc Creates an abstract character literal. The result represents
-%% "<code>$<em>Name</em></code>", where <code>Name</code> corresponds to
-%% <code>Value</code>.
+%% "<code>$<em>Name</em></code>", where `Name' corresponds to
+%% `Value'.
%%
-%% <p>Note: the literal corresponding to a particular character value is
-%% not uniquely defined. E.g., the character "<code>a</code>" can be
-%% written both as "<code>$a</code>" and "<code>$\141</code>", and a Tab
-%% character can be written as "<code>$\11</code>", "<code>$\011</code>"
-%% or "<code>$\t</code>".</p>
+%% Note: the literal corresponding to a particular character value is
+%% not uniquely defined. E.g., the character "`a'" can be
+%% written both as "`$a'" and "`$\141'", and a Tab
+%% character can be written as "`$\11'", "`$\011'"
+%% or "`$\t'".
%%
%% @see char_value/1
%% @see char_literal/1
@@ -1771,11 +1650,8 @@ revert_char(Node) ->
%% =====================================================================
-%% @spec is_char(Node::syntaxTree(), Value::char()) -> boolean()
-%%
-%% @doc Returns <code>true</code> if <code>Node</code> has type
-%% <code>char</code> and represents <code>Value</code>, otherwise
-%% <code>false</code>.
+%% @doc Returns `true' if `Node' has type
+%% `char' and represents `Value', otherwise `false'.
%%
%% @see char/1
@@ -1793,9 +1669,7 @@ is_char(Node, Value) ->
%% =====================================================================
-%% @spec char_value(syntaxTree()) -> char()
-%%
-%% @doc Returns the value represented by a <code>char</code> node.
+%% @doc Returns the value represented by a `char' node.
%%
%% @see char/1
@@ -1811,10 +1685,8 @@ char_value(Node) ->
%% =====================================================================
-%% @spec char_literal(syntaxTree()) -> string()
-%%
-%% @doc Returns the literal string represented by a <code>char</code>
-%% node. This includes the leading "<code>$</code>" character.
+%% @doc Returns the literal string represented by a `char'
+%% node. This includes the leading "`$'" character.
%%
%% @see char/1
@@ -1825,16 +1697,14 @@ char_literal(Node) ->
%% =====================================================================
-%% @spec string(Value::string()) -> syntaxTree()
-%%
%% @doc Creates an abstract string literal. The result represents
%% <code>"<em>Text</em>"</code> (including the surrounding
-%% double-quotes), where <code>Text</code> corresponds to the sequence
-%% of characters in <code>Value</code>, but not representing a
-%% <em>specific</em> string literal. E.g., the result of
-%% <code>string("x\ny")</code> represents any and all of
-%% <code>"x\ny"</code>, <code>"x\12y"</code>, <code>"x\012y"</code> and
-%% <code>"x\^Jy"</code>; cf. <code>char/1</code>.
+%% double-quotes), where `Text' corresponds to the sequence
+%% of characters in `Value', but not representing a
+%% <em>specific</em> string literal.
+%%
+%% For example, the result of `string("x\ny")' represents any and all of
+%% `"x\ny"', `"x\12y"', `"x\012y"' and `"x\^Jy"'; see {@link char/1}.
%%
%% @see string_value/1
%% @see string_literal/1
@@ -1861,11 +1731,8 @@ revert_string(Node) ->
%% =====================================================================
-%% @spec is_string(Node::syntaxTree(), Value::string()) -> boolean()
-%%
-%% @doc Returns <code>true</code> if <code>Node</code> has type
-%% <code>string</code> and represents <code>Value</code>, otherwise
-%% <code>false</code>.
+%% @doc Returns `true' if `Node' has type
+%% `string' and represents `Value', otherwise `false'.
%%
%% @see string/1
@@ -1883,9 +1750,7 @@ is_string(Node, Value) ->
%% =====================================================================
-%% @spec string_value(syntaxTree()) -> string()
-%%
-%% @doc Returns the value represented by a <code>string</code> node.
+%% @doc Returns the value represented by a `string' node.
%%
%% @see string/1
@@ -1901,9 +1766,7 @@ string_value(Node) ->
%% =====================================================================
-%% @spec string_literal(syntaxTree()) -> string()
-%%
-%% @doc Returns the literal string represented by a <code>string</code>
+%% @doc Returns the literal string represented by a `string'
%% node. This includes surrounding double-quote characters.
%%
%% @see string/1
@@ -1915,11 +1778,8 @@ string_literal(Node) ->
%% =====================================================================
-%% @spec atom(Name) -> syntaxTree()
-%% Name = atom() | string()
-%%
%% @doc Creates an abstract atom literal. The print name of the atom is
-%% the character sequence represented by <code>Name</code>.
+%% the character sequence represented by `Name'.
%%
%% @see atom_value/1
%% @see atom_name/1
@@ -1948,11 +1808,8 @@ revert_atom(Node) ->
%% =====================================================================
-%% @spec is_atom(Node::syntaxTree(), Value::atom()) -> boolean()
-%%
-%% @doc Returns <code>true</code> if <code>Node</code> has type
-%% <code>atom</code> and represents <code>Value</code>, otherwise
-%% <code>false</code>.
+%% @doc Returns `true' if `Node' has type
+%% `atom' and represents `Value', otherwise `false'.
%%
%% @see atom/1
@@ -1970,9 +1827,7 @@ is_atom(Node, Value) ->
%% =====================================================================
-%% @spec atom_value(syntaxTree()) -> atom()
-%%
-%% @doc Returns the value represented by an <code>atom</code> node.
+%% @doc Returns the value represented by an `atom' node.
%%
%% @see atom/1
@@ -1988,9 +1843,7 @@ atom_value(Node) ->
%% =====================================================================
-%% @spec atom_name(syntaxTree()) -> string()
-%%
-%% @doc Returns the printname of an <code>atom</code> node.
+%% @doc Returns the printname of an `atom' node.
%%
%% @see atom/1
@@ -2001,15 +1854,12 @@ atom_name(Node) ->
%% =====================================================================
-%% @spec atom_literal(syntaxTree()) -> string()
-%%
-%% @doc Returns the literal string represented by an <code>atom</code>
+%% @doc Returns the literal string represented by an `atom'
%% node. This includes surrounding single-quote characters if necessary.
%%
-%% <p>Note that e.g. the result of <code>atom("x\ny")</code> represents
-%% any and all of <code>'x\ny'</code>, <code>'x\12y'</code>,
-%% <code>'x\012y'</code> and <code>'x\^Jy\'</code>; cf.
-%% <code>string/1</code>.</p>
+%% Note that e.g. the result of `atom("x\ny")' represents
+%% any and all of `'x\ny'', `'x\12y'',
+%% `'x\012y'' and `'x\^Jy\''; see {@link string/1}.
%%
%% @see atom/1
%% @see string/1
@@ -2021,14 +1871,12 @@ atom_literal(Node) ->
%% =====================================================================
-%% @spec tuple(Elements::[syntaxTree()]) -> syntaxTree()
-%%
-%% @doc Creates an abstract tuple. If <code>Elements</code> is
-%% <code>[X1, ..., Xn]</code>, the result represents
+%% @doc Creates an abstract tuple. If `Elements' is
+%% `[X1, ..., Xn]', the result represents
%% "<code>{<em>X1</em>, ..., <em>Xn</em>}</code>".
%%
-%% <p>Note: The Erlang language has distinct 1-tuples, i.e.,
-%% <code>{X}</code> is always distinct from <code>X</code> itself.</p>
+%% Note: The Erlang language has distinct 1-tuples, i.e.,
+%% `{X}' is always distinct from `X' itself.
%%
%% @see tuple_elements/1
%% @see tuple_size/1
@@ -2055,10 +1903,7 @@ revert_tuple(Node) ->
%% =====================================================================
-%% @spec tuple_elements(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the list of element subtrees of a <code>tuple</code>
-%% node.
+%% @doc Returns the list of element subtrees of a `tuple' node.
%%
%% @see tuple/1
@@ -2074,13 +1919,11 @@ tuple_elements(Node) ->
%% =====================================================================
-%% @spec tuple_size(syntaxTree()) -> integer()
-%%
-%% @doc Returns the number of elements of a <code>tuple</code> node.
+%% @doc Returns the number of elements of a `tuple' node.
%%
-%% <p>Note: this is equivalent to
-%% <code>length(tuple_elements(Node))</code>, but potentially more
-%% efficient.</p>
+%% Note: this is equivalent to
+%% `length(tuple_elements(Node))', but potentially more
+%% efficient.
%%
%% @see tuple/1
%% @see tuple_elements/1
@@ -2092,7 +1935,6 @@ tuple_size(Node) ->
%% =====================================================================
-%% @spec list(List) -> syntaxTree()
%% @equiv list(List, none)
-spec list([syntaxTree()]) -> syntaxTree().
@@ -2102,35 +1944,31 @@ list(List) ->
%% =====================================================================
-%% @spec list(List, Tail) -> syntaxTree()
-%% List = [syntaxTree()]
-%% Tail = none | syntaxTree()
-%%
%% @doc Constructs an abstract list skeleton. The result has type
-%% <code>list</code> or <code>nil</code>. If <code>List</code> is a
-%% nonempty list <code>[E1, ..., En]</code>, the result has type
-%% <code>list</code> and represents either "<code>[<em>E1</em>, ...,
-%% <em>En</em>]</code>", if <code>Tail</code> is <code>none</code>, or
+%% `list' or `nil'. If `List' is a
+%% nonempty list `[E1, ..., En]', the result has type
+%% `list' and represents either "<code>[<em>E1</em>, ...,
+%% <em>En</em>]</code>", if `Tail' is `none', or
%% otherwise "<code>[<em>E1</em>, ..., <em>En</em> |
-%% <em>Tail</em>]</code>". If <code>List</code> is the empty list,
-%% <code>Tail</code> <em>must</em> be <code>none</code>, and in that
-%% case the result has type <code>nil</code> and represents
-%% "<code>[]</code>" (cf. <code>nil/0</code>).
+%% <em>Tail</em>]</code>". If `List' is the empty list,
+%% `Tail' <em>must</em> be `none', and in that
+%% case the result has type `nil' and represents
+%% "`[]'" (see {@link nil/0}).
%%
-%% <p>The difference between lists as semantic objects (built up of
+%% The difference between lists as semantic objects (built up of
%% individual "cons" and "nil" terms) and the various syntactic forms
%% for denoting lists may be bewildering at first. This module provides
%% functions both for exact control of the syntactic representation as
%% well as for the simple composition and deconstruction in terms of
-%% cons and head/tail operations.</p>
+%% cons and head/tail operations.
%%
-%% <p>Note: in <code>list(Elements, none)</code>, the "nil" list
-%% terminator is implicit and has no associated information (cf.
-%% <code>get_attrs/1</code>), while in the seemingly equivalent
-%% <code>list(Elements, Tail)</code> when <code>Tail</code> has type
-%% <code>nil</code>, the list terminator subtree <code>Tail</code> may
+%% Note: in `list(Elements, none)', the "nil" list
+%% terminator is implicit and has no associated information (see
+%% {@link get_attrs/1}), while in the seemingly equivalent
+%% `list(Elements, Tail)' when `Tail' has type
+%% `nil', the list terminator subtree `Tail' may
%% have attached attributes such as position, comments, and annotations,
-%% which will be preserved in the result.</p>
+%% which will be preserved in the result.
%%
%% @see nil/0
%% @see list/1
@@ -2187,10 +2025,8 @@ revert_list(Node) ->
S, P).
%% =====================================================================
-%% @spec nil() -> syntaxTree()
-%%
%% @doc Creates an abstract empty list. The result represents
-%% "<code>[]</code>". The empty list is traditionally called "nil".
+%% "`[]'". The empty list is traditionally called "nil".
%%
%% @see list/2
%% @see is_list_skeleton/1
@@ -2213,13 +2049,11 @@ revert_nil(Node) ->
%% =====================================================================
-%% @spec list_prefix(Node::syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the prefix element subtrees of a <code>list</code> node.
-%% If <code>Node</code> represents "<code>[<em>E1</em>, ...,
+%% @doc Returns the prefix element subtrees of a `list' node.
+%% If `Node' represents "<code>[<em>E1</em>, ...,
%% <em>En</em>]</code>" or "<code>[<em>E1</em>, ..., <em>En</em> |
-%% <em>Tail</em>]</code>", the returned value is <code>[E1, ...,
-%% En]</code>.
+%% <em>Tail</em>]</code>", the returned value is `[E1, ...,
+%% En]'.
%%
%% @see list/2
@@ -2227,28 +2061,31 @@ revert_nil(Node) ->
list_prefix(Node) ->
case unwrap(Node) of
- {cons, _, Head, _} ->
- [Head];
+ {cons, _, Head, Tail} ->
+ [Head | cons_prefix(Tail)];
Node1 ->
(data(Node1))#list.prefix
end.
+%% collects sequences of conses; cf. cons_suffix/1 below
+cons_prefix({cons, _, Head, Tail}) ->
+ [Head | cons_prefix(Tail)];
+cons_prefix(_) ->
+ [].
+
%% =====================================================================
-%% @spec list_suffix(Node::syntaxTree()) -> none | syntaxTree()
-%%
-%% @doc Returns the suffix subtree of a <code>list</code> node, if one
-%% exists. If <code>Node</code> represents "<code>[<em>E1</em>, ...,
+%% @doc Returns the suffix subtree of a `list' node, if one
+%% exists. If `Node' represents "<code>[<em>E1</em>, ...,
%% <em>En</em> | <em>Tail</em>]</code>", the returned value is
-%% <code>Tail</code>, otherwise, i.e., if <code>Node</code> represents
-%% "<code>[<em>E1</em>, ..., <em>En</em>]</code>", <code>none</code> is
+%% `Tail', otherwise, i.e., if `Node' represents
+%% "<code>[<em>E1</em>, ..., <em>En</em>]</code>", `none' is
%% returned.
%%
-%% <p>Note that even if this function returns some <code>Tail</code>
-%% that is not <code>none</code>, the type of <code>Tail</code> can be
-%% <code>nil</code>, if the tail has been given explicitly, and the list
-%% skeleton has not been compacted (cf.
-%% <code>compact_list/1</code>).</p>
+%% Note that even if this function returns some `Tail'
+%% that is not `none', the type of `Tail' can be
+%% `nil', if the tail has been given explicitly, and the list
+%% skeleton has not been compacted (see {@link compact_list/1}).
%%
%% @see list/2
%% @see nil/0
@@ -2259,34 +2096,36 @@ list_prefix(Node) ->
list_suffix(Node) ->
case unwrap(Node) of
{cons, _, _, Tail} ->
- %% If there could be comments/annotations on the tail node,
- %% we should not return `none' even if it has type `nil'.
- case Tail of
+ case cons_suffix(Tail) of
{nil, _} ->
- none; % no interesting information is lost
- _ ->
- Tail
+ none;
+ Tail1 ->
+ Tail1
end;
Node1 ->
(data(Node1))#list.suffix
end.
+%% skips sequences of conses; cf. cons_prefix/1 above
+cons_suffix({cons, _, _, Tail}) ->
+ cons_suffix(Tail);
+cons_suffix(Tail) ->
+ Tail.
+
%% =====================================================================
-%% @spec cons(Head::syntaxTree(), Tail::syntaxTree()) -> syntaxTree()
-%%
%% @doc "Optimising" list skeleton cons operation. Creates an abstract
-%% list skeleton whose first element is <code>Head</code> and whose tail
-%% corresponds to <code>Tail</code>. This is similar to
-%% <code>list([Head], Tail)</code>, except that <code>Tail</code> may
-%% not be <code>none</code>, and that the result does not necessarily
+%% list skeleton whose first element is `Head' and whose tail
+%% corresponds to `Tail'. This is similar to
+%% `list([Head], Tail)', except that `Tail' may
+%% not be `none', and that the result does not necessarily
%% represent exactly "<code>[<em>Head</em> | <em>Tail</em>]</code>", but
-%% may depend on the <code>Tail</code> subtree. E.g., if
-%% <code>Tail</code> represents <code>[X, Y]</code>, the result may
+%% may depend on the `Tail' subtree. E.g., if
+%% `Tail' represents `[X, Y]', the result may
%% represent "<code>[<em>Head</em>, X, Y]</code>", rather than
%% "<code>[<em>Head</em> | [X, Y]]</code>". Annotations on
-%% <code>Tail</code> itself may be lost if <code>Tail</code> represents
-%% a list skeleton, but comments on <code>Tail</code> are propagated to
+%% `Tail' itself may be lost if `Tail' represents
+%% a list skeleton, but comments on `Tail' are propagated to
%% the result.
%%
%% @see list/2
@@ -2308,10 +2147,8 @@ cons(Head, Tail) ->
%% =====================================================================
-%% @spec list_head(Node::syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the head element subtree of a <code>list</code> node. If
-%% <code>Node</code> represents "<code>[<em>Head</em> ...]</code>", the
+%% @doc Returns the head element subtree of a `list' node. If
+%% `Node' represents "<code>[<em>Head</em> ...]</code>", the
%% result will represent "<code><em>Head</em></code>".
%%
%% @see list/2
@@ -2325,15 +2162,13 @@ list_head(Node) ->
%% =====================================================================
-%% @spec list_tail(Node::syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the tail of a <code>list</code> node. If
-%% <code>Node</code> represents a single-element list
+%% @doc Returns the tail of a `list' node. If
+%% `Node' represents a single-element list
%% "<code>[<em>E</em>]</code>", then the result has type
-%% <code>nil</code>, representing "<code>[]</code>". If
-%% <code>Node</code> represents "<code>[<em>E1</em>, <em>E2</em>
+%% `nil', representing "`[]'". If
+%% `Node' represents "<code>[<em>E1</em>, <em>E2</em>
%% ...]</code>", the result will represent "<code>[<em>E2</em>
-%% ...]</code>", and if <code>Node</code> represents
+%% ...]</code>", and if `Node' represents
%% "<code>[<em>Head</em> | <em>Tail</em>]</code>", the result will
%% represent "<code><em>Tail</em></code>".
%%
@@ -2358,10 +2193,8 @@ list_tail(Node) ->
%% =====================================================================
-%% @spec is_list_skeleton(syntaxTree()) -> boolean()
-%%
-%% @doc Returns <code>true</code> if <code>Node</code> has type
-%% <code>list</code> or <code>nil</code>, otherwise <code>false</code>.
+%% @doc Returns `true' if `Node' has type
+%% `list' or `nil', otherwise `false'.
%%
%% @see list/2
%% @see nil/0
@@ -2377,24 +2210,22 @@ is_list_skeleton(Node) ->
%% =====================================================================
-%% @spec is_proper_list(Node::syntaxTree()) -> boolean()
-%%
-%% @doc Returns <code>true</code> if <code>Node</code> represents a
-%% proper list, and <code>false</code> otherwise. A proper list is a
-%% list skeleton either on the form "<code>[]</code>" or
+%% @doc Returns `true' if `Node' represents a
+%% proper list, and `false' otherwise. A proper list is a
+%% list skeleton either on the form "`[]'" or
%% "<code>[<em>E1</em>, ..., <em>En</em>]</code>", or "<code>[... |
-%% <em>Tail</em>]</code>" where recursively <code>Tail</code> also
+%% <em>Tail</em>]</code>" where recursively `Tail' also
%% represents a proper list.
%%
-%% <p>Note: Since <code>Node</code> is a syntax tree, the actual
+%% Note: Since `Node' is a syntax tree, the actual
%% run-time values corresponding to its subtrees may often be partially
-%% or completely unknown. Thus, if <code>Node</code> represents e.g.
-%% "<code>[... | Ns]</code>" (where <code>Ns</code> is a variable), then
-%% the function will return <code>false</code>, because it is not known
-%% whether <code>Ns</code> will be bound to a list at run-time. If
-%% <code>Node</code> instead represents e.g. "<code>[1, 2, 3]</code>" or
-%% "<code>[A | []]</code>", then the function will return
-%% <code>true</code>.</p>
+%% or completely unknown. Thus, if `Node' represents e.g.
+%% "`[... | Ns]'" (where `Ns' is a variable), then
+%% the function will return `false', because it is not known
+%% whether `Ns' will be bound to a list at run-time. If
+%% `Node' instead represents e.g. "`[1, 2, 3]'" or
+%% "`[A | []]'", then the function will return
+%% `true'.
%%
%% @see list/2
@@ -2417,14 +2248,11 @@ is_proper_list(Node) ->
%% =====================================================================
-%% @spec list_elements(Node::syntaxTree()) -> [syntaxTree()]
-%%
%% @doc Returns the list of element subtrees of a list skeleton.
-%% <code>Node</code> must represent a proper list. E.g., if
-%% <code>Node</code> represents "<code>[<em>X1</em>, <em>X2</em> |
+%% `Node' must represent a proper list. E.g., if
+%% `Node' represents "<code>[<em>X1</em>, <em>X2</em> |
%% [<em>X3</em>, <em>X4</em> | []]</code>", then
-%% <code>list_elements(Node)</code> yields the list <code>[X1, X2, X3,
-%% X4]</code>.
+%% `list_elements(Node)' yields the list `[X1, X2, X3, X4]'.
%%
%% @see list/2
%% @see is_proper_list/1
@@ -2450,17 +2278,15 @@ list_elements(Node, As) ->
%% =====================================================================
-%% @spec list_length(Node::syntaxTree()) -> integer()
-%%
%% @doc Returns the number of element subtrees of a list skeleton.
-%% <code>Node</code> must represent a proper list. E.g., if
-%% <code>Node</code> represents "<code>[X1 | [X2, X3 | [X4, X5,
-%% X6]]]</code>", then <code>list_length(Node)</code> returns the
+%% `Node' must represent a proper list. E.g., if
+%% `Node' represents "`[X1 | [X2, X3 | [X4, X5,
+%% X6]]]'", then `list_length(Node)' returns the
%% integer 6.
%%
-%% <p>Note: this is equivalent to
-%% <code>length(list_elements(Node))</code>, but potentially more
-%% efficient.</p>
+%% Note: this is equivalent to
+%% `length(list_elements(Node))', but potentially more
+%% efficient.
%%
%% @see list/2
%% @see is_proper_list/1
@@ -2487,18 +2313,16 @@ list_length(Node, A) ->
%% =====================================================================
-%% @spec normalize_list(Node::syntaxTree()) -> syntaxTree()
-%%
%% @doc Expands an abstract list skeleton to its most explicit form. If
-%% <code>Node</code> represents "<code>[<em>E1</em>, ..., <em>En</em> |
+%% `Node' represents "<code>[<em>E1</em>, ..., <em>En</em> |
%% <em>Tail</em>]</code>", the result represents "<code>[<em>E1</em> |
%% ... [<em>En</em> | <em>Tail1</em>] ... ]</code>", where
-%% <code>Tail1</code> is the result of
-%% <code>normalize_list(Tail)</code>. If <code>Node</code> represents
+%% `Tail1' is the result of
+%% `normalize_list(Tail)'. If `Node' represents
%% "<code>[<em>E1</em>, ..., <em>En</em>]</code>", the result simply
%% represents "<code>[<em>E1</em> | ... [<em>En</em> | []] ...
-%% ]</code>". If <code>Node</code> does not represent a list skeleton,
-%% <code>Node</code> itself is returned.
+%% ]</code>". If `Node' does not represent a list skeleton,
+%% `Node' itself is returned.
%%
%% @see list/2
%% @see compact_list/1
@@ -2528,16 +2352,14 @@ normalize_list_1(Es, Tail) ->
%% =====================================================================
-%% @spec compact_list(Node::syntaxTree()) -> syntaxTree()
-%%
%% @doc Yields the most compact form for an abstract list skeleton. The
%% result either represents "<code>[<em>E1</em>, ..., <em>En</em> |
-%% <em>Tail</em>]</code>", where <code>Tail</code> is not a list
+%% <em>Tail</em>]</code>", where `Tail' is not a list
%% skeleton, or otherwise simply "<code>[<em>E1</em>, ...,
-%% <em>En</em>]</code>". Annotations on subtrees of <code>Node</code>
+%% <em>En</em>]</code>". Annotations on subtrees of `Node'
%% that represent list skeletons may be lost, but comments will be
-%% propagated to the result. Returns <code>Node</code> itself if
-%% <code>Node</code> does not represent a list skeleton.
+%% propagated to the result. Returns `Node' itself if
+%% `Node' does not represent a list skeleton.
%%
%% @see list/2
%% @see normalize_list/1
@@ -2575,10 +2397,8 @@ compact_list(Node) ->
%% =====================================================================
-%% @spec binary(Fields::[syntaxTree()]) -> syntaxTree()
-%%
%% @doc Creates an abstract binary-object template. If
-%% <code>Fields</code> is <code>[F1, ..., Fn]</code>, the result
+%% `Fields' is `[F1, ..., Fn]', the result
%% represents "<code>&lt;&lt;<em>F1</em>, ...,
%% <em>Fn</em>&gt;&gt;</code>".
%%
@@ -2611,10 +2431,7 @@ revert_binary(Node) ->
%% =====================================================================
-%% @spec binary_fields(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the list of field subtrees of a <code>binary</code>
-%% node.
+%% @doc Returns the list of field subtrees of a `binary' node.
%%
%% @see binary/1
%% @see binary_field/2
@@ -2631,7 +2448,6 @@ binary_fields(Node) ->
%% =====================================================================
-%% @spec binary_field(Body) -> syntaxTree()
%% @equiv binary_field(Body, [])
-spec binary_field(syntaxTree()) -> syntaxTree().
@@ -2641,15 +2457,11 @@ binary_field(Body) ->
%% =====================================================================
-%% @spec binary_field(Body::syntaxTree(), Size,
-%% Types::[syntaxTree()]) -> syntaxTree()
-%% Size = none | syntaxTree()
-%%
%% @doc Creates an abstract binary template field.
-%% If <code>Size</code> is <code>none</code>, this is equivalent to
-%% "<code>binary_field(Body, Types)</code>", otherwise it is
-%% equivalent to "<code>binary_field(size_qualifier(Body, Size),
-%% Types)</code>".
+%% If `Size' is `none', this is equivalent to
+%% "`binary_field(Body, Types)'", otherwise it is
+%% equivalent to "`binary_field(size_qualifier(Body, Size),
+%% Types)'".
%%
%% (This is a utility function.)
%%
@@ -2667,13 +2479,10 @@ binary_field(Body, Size, Types) ->
%% =====================================================================
-%% @spec binary_field(Body::syntaxTree(), Types::[syntaxTree()]) ->
-%% syntaxTree()
-%%
%% @doc Creates an abstract binary template field. If
-%% <code>Types</code> is the empty list, the result simply represents
-%% "<code><em>Body</em></code>", otherwise, if <code>Types</code> is
-%% <code>[T1, ..., Tn]</code>, the result represents
+%% `Types' is the empty list, the result simply represents
+%% "<code><em>Body</em></code>", otherwise, if `Types' is
+%% `[T1, ..., Tn]', the result represents
%% "<code><em>Body</em>/<em>T1</em>-...-<em>Tn</em></code>".
%%
%% @see binary/1
@@ -2727,9 +2536,7 @@ revert_binary_field(Node) ->
%% =====================================================================
-%% @spec binary_field_body(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the body subtree of a <code>binary_field</code>.
+%% @doc Returns the body subtree of a `binary_field'.
%%
%% @see binary_field/2
@@ -2749,12 +2556,10 @@ binary_field_body(Node) ->
%% =====================================================================
-%% @spec binary_field_types(Node::syntaxTree()) -> [syntaxTree()]
-%%
%% @doc Returns the list of type-specifier subtrees of a
-%% <code>binary_field</code> node. If <code>Node</code> represents
+%% `binary_field' node. If `Node' represents
%% "<code>.../<em>T1</em>, ..., <em>Tn</em></code>", the result is
-%% <code>[T1, ..., Tn]</code>, otherwise the result is the empty list.
+%% `[T1, ..., Tn]', otherwise the result is the empty list.
%%
%% @see binary_field/2
@@ -2774,14 +2579,12 @@ binary_field_types(Node) ->
%% =====================================================================
-%% @spec binary_field_size(Node::syntaxTree()) -> none | syntaxTree()
-%%
%% @doc Returns the size specifier subtree of a
-%% <code>binary_field</code> node, if any. If <code>Node</code>
+%% `binary_field' node, if any. If `Node'
%% represents "<code><em>Body</em>:<em>Size</em></code>" or
%% "<code><em>Body</em>:<em>Size</em>/<em>T1</em>, ...,
-%% <em>Tn</em></code>", the result is <code>Size</code>, otherwise
-%% <code>none</code> is returned.
+%% <em>Tn</em></code>", the result is `Size', otherwise
+%% `none' is returned.
%%
%% (This is a utility function.)
%%
@@ -2810,9 +2613,6 @@ binary_field_size(Node) ->
%% =====================================================================
-%% @spec size_qualifier(Body::syntaxTree(), Size::syntaxTree()) ->
-%% syntaxTree()
-%%
%% @doc Creates an abstract size qualifier. The result represents
%% "<code><em>Body</em>:<em>Size</em></code>".
%%
@@ -2834,10 +2634,7 @@ size_qualifier(Body, Size) ->
%% =====================================================================
-%% @spec size_qualifier_body(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the body subtree of a <code>size_qualifier</code>
-%% node.
+%% @doc Returns the body subtree of a `size_qualifier' node.
%%
%% @see size_qualifier/2
@@ -2848,10 +2645,8 @@ size_qualifier_body(Node) ->
%% =====================================================================
-%% @spec size_qualifier_argument(syntaxTree()) -> syntaxTree()
-%%
%% @doc Returns the argument subtree (the size) of a
-%% <code>size_qualifier</code> node.
+%% `size_qualifier' node.
%%
%% @see size_qualifier/2
@@ -2862,16 +2657,14 @@ size_qualifier_argument(Node) ->
%% =====================================================================
-%% @spec error_marker(Error::term()) -> syntaxTree()
-%%
%% @doc Creates an abstract error marker. The result represents an
%% occurrence of an error in the source code, with an associated Erlang
-%% I/O ErrorInfo structure given by <code>Error</code> (see module
+%% I/O ErrorInfo structure given by `Error' (see module
%% {@link //stdlib/io} for details). Error markers are regarded as source
%% code forms, but have no defined lexical form.
%%
-%% <p>Note: this is supported only for backwards compatibility with
-%% existing parsers and tools.</p>
+%% Note: this is supported only for backwards compatibility with
+%% existing parsers and tools.
%%
%% @see error_marker_info/1
%% @see warning_marker/1
@@ -2902,10 +2695,7 @@ revert_error_marker(Node) ->
%% =====================================================================
-%% @spec error_marker_info(syntaxTree()) -> term()
-%%
-%% @doc Returns the ErrorInfo structure of an <code>error_marker</code>
-%% node.
+%% @doc Returns the ErrorInfo structure of an `error_marker' node.
%%
%% @see error_marker/1
@@ -2921,16 +2711,14 @@ error_marker_info(Node) ->
%% =====================================================================
-%% @spec warning_marker(Error::term()) -> syntaxTree()
-%%
%% @doc Creates an abstract warning marker. The result represents an
%% occurrence of a possible problem in the source code, with an
-%% associated Erlang I/O ErrorInfo structure given by <code>Error</code>
+%% associated Erlang I/O ErrorInfo structure given by `Error'
%% (see module {@link //stdlib/io} for details). Warning markers are
%% regarded as source code forms, but have no defined lexical form.
%%
-%% <p>Note: this is supported only for backwards compatibility with
-%% existing parsers and tools.</p>
+%% Note: this is supported only for backwards compatibility with
+%% existing parsers and tools.
%%
%% @see warning_marker_info/1
%% @see error_marker/1
@@ -2961,10 +2749,7 @@ revert_warning_marker(Node) ->
%% =====================================================================
-%% @spec warning_marker_info(syntaxTree()) -> term()
-%%
-%% @doc Returns the ErrorInfo structure of a <code>warning_marker</code>
-%% node.
+%% @doc Returns the ErrorInfo structure of a `warning_marker' node.
%%
%% @see warning_marker/1
@@ -2980,16 +2765,14 @@ warning_marker_info(Node) ->
%% =====================================================================
-%% @spec eof_marker() -> syntaxTree()
-%%
%% @doc Creates an abstract end-of-file marker. This represents the
%% end of input when reading a sequence of source code forms. An
%% end-of-file marker is itself regarded as a source code form
%% (namely, the last in any sequence in which it occurs). It has no
%% defined lexical form.
%%
-%% <p>Note: this is retained only for backwards compatibility with
-%% existing parsers and tools.</p>
+%% Note: this is retained only for backwards compatibility with
+%% existing parsers and tools.
%%
%% @see error_marker/1
%% @see warning_marker/1
@@ -3013,7 +2796,6 @@ revert_eof_marker(Node) ->
%% =====================================================================
-%% @spec attribute(Name) -> syntaxTree()
%% @equiv attribute(Name, none)
-spec attribute(syntaxTree()) -> syntaxTree().
@@ -3023,23 +2805,20 @@ attribute(Name) ->
%% =====================================================================
-%% @spec attribute(Name::syntaxTree(), Arguments) -> syntaxTree()
-%% Arguments = none | [syntaxTree()]
-%%
%% @doc Creates an abstract program attribute. If
-%% <code>Arguments</code> is <code>[A1, ..., An]</code>, the result
+%% `Arguments' is `[A1, ..., An]', the result
%% represents "<code>-<em>Name</em>(<em>A1</em>, ...,
-%% <em>An</em>).</code>". Otherwise, if <code>Arguments</code> is
-%% <code>none</code>, the result represents
+%% <em>An</em>).</code>". Otherwise, if `Arguments' is
+%% `none', the result represents
%% "<code>-<em>Name</em>.</code>". The latter form makes it possible
%% to represent preprocessor directives such as
-%% "<code>-endif.</code>". Attributes are source code forms.
+%% "`-endif.'". Attributes are source code forms.
%%
-%% <p>Note: The preprocessor macro definition directive
+%% Note: The preprocessor macro definition directive
%% "<code>-define(<em>Name</em>, <em>Body</em>).</code>" has relatively
-%% few requirements on the syntactical form of <code>Body</code> (viewed
-%% as a sequence of tokens). The <code>text</code> node type can be used
-%% for a <code>Body</code> that is not a normal Erlang construct.</p>
+%% few requirements on the syntactical form of `Body' (viewed
+%% as a sequence of tokens). The `text' node type can be used
+%% for a `Body' that is not a normal Erlang construct.
%%
%% @see attribute/1
%% @see attribute_name/1
@@ -3233,9 +3012,7 @@ revert_module_name(A) ->
%% =====================================================================
-%% @spec attribute_name(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the name subtree of an <code>attribute</code> node.
+%% @doc Returns the name subtree of an `attribute' node.
%%
%% @see attribute/1
@@ -3251,15 +3028,12 @@ attribute_name(Node) ->
%% =====================================================================
-%% @spec attribute_arguments(Node::syntaxTree()) ->
-%% none | [syntaxTree()]
-%%
%% @doc Returns the list of argument subtrees of an
-%% <code>attribute</code> node, if any. If <code>Node</code>
+%% `attribute' node, if any. If `Node'
%% represents "<code>-<em>Name</em>.</code>", the result is
-%% <code>none</code>. Otherwise, if <code>Node</code> represents
+%% `none'. Otherwise, if `Node' represents
%% "<code>-<em>Name</em>(<em>E1</em>, ..., <em>En</em>).</code>",
-%% <code>[E1, ..., E1]</code> is returned.
+%% `[E1, ..., E1]' is returned.
%%
%% @see attribute/1
@@ -3326,9 +3100,6 @@ attribute_arguments(Node) ->
%% =====================================================================
-%% @spec arity_qualifier(Body::syntaxTree(), Arity::syntaxTree()) ->
-%% syntaxTree()
-%%
%% @doc Creates an abstract arity qualifier. The result represents
%% "<code><em>Body</em>/<em>Arity</em></code>".
%%
@@ -3350,10 +3121,7 @@ arity_qualifier(Body, Arity) ->
%% =====================================================================
-%% @spec arity_qualifier_body(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the body subtree of an <code>arity_qualifier</code>
-%% node.
+%% @doc Returns the body subtree of an `arity_qualifier' node.
%%
%% @see arity_qualifier/2
@@ -3364,10 +3132,8 @@ arity_qualifier_body(Node) ->
%% =====================================================================
-%% @spec arity_qualifier_argument(syntaxTree()) -> syntaxTree()
-%%
%% @doc Returns the argument (the arity) subtree of an
-%% <code>arity_qualifier</code> node.
+%% `arity_qualifier' node.
%%
%% @see arity_qualifier/2
@@ -3378,9 +3144,6 @@ arity_qualifier_argument(Node) ->
%% =====================================================================
-%% @spec module_qualifier(Module::syntaxTree(), Body::syntaxTree()) ->
-%% syntaxTree()
-%%
%% @doc Creates an abstract module qualifier. The result represents
%% "<code><em>Module</em>:<em>Body</em></code>".
%%
@@ -3414,10 +3177,8 @@ revert_module_qualifier(Node) ->
%% =====================================================================
-%% @spec module_qualifier_argument(syntaxTree()) -> syntaxTree()
-%%
%% @doc Returns the argument (the module) subtree of a
-%% <code>module_qualifier</code> node.
+%% `module_qualifier' node.
%%
%% @see module_qualifier/2
@@ -3433,10 +3194,7 @@ module_qualifier_argument(Node) ->
%% =====================================================================
-%% @spec module_qualifier_body(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the body subtree of a <code>module_qualifier</code>
-%% node.
+%% @doc Returns the body subtree of a `module_qualifier' node.
%%
%% @see module_qualifier/2
@@ -3452,11 +3210,9 @@ module_qualifier_body(Node) ->
%% =====================================================================
-%% @spec qualified_name(Segments::[syntaxTree()]) -> syntaxTree()
-%%
%% @doc Creates an abstract qualified name. The result represents
%% "<code><em>S1</em>.<em>S2</em>. ... .<em>Sn</em></code>", if
-%% <code>Segments</code> is <code>[S1, S2, ..., Sn]</code>.
+%% `Segments' is `[S1, S2, ..., Sn]'.
%%
%% @see qualified_name_segments/1
@@ -3484,10 +3240,8 @@ revert_qualified_name(Node) ->
%% =====================================================================
-%% @spec qualified_name_segments(syntaxTree()) -> [syntaxTree()]
-%%
%% @doc Returns the list of name segments of a
-%% <code>qualified_name</code> node.
+%% `qualified_name' node.
%%
%% @see qualified_name/1
@@ -3503,13 +3257,10 @@ qualified_name_segments(Node) ->
%% =====================================================================
-%% @spec function(Name::syntaxTree(), Clauses::[syntaxTree()]) ->
-%% syntaxTree()
-%%
-%% @doc Creates an abstract function definition. If <code>Clauses</code>
-%% is <code>[C1, ..., Cn]</code>, the result represents
+%% @doc Creates an abstract function definition. If `Clauses'
+%% is `[C1, ..., Cn]', the result represents
%% "<code><em>Name</em> <em>C1</em>; ...; <em>Name</em>
-%% <em>Cn</em>.</code>". More exactly, if each <code>Ci</code>
+%% <em>Cn</em>.</code>". More exactly, if each `Ci'
%% represents "<code>(<em>Pi1</em>, ..., <em>Pim</em>) <em>Gi</em> ->
%% <em>Bi</em></code>", then the result represents
%% "<code><em>Name</em>(<em>P11</em>, ..., <em>P1m</em>) <em>G1</em> ->
@@ -3523,13 +3274,12 @@ qualified_name_segments(Node) ->
%% @see is_form/1
%% @see rule/2
--record(function, {name, clauses}).
-%% XXX: This one is problematic because there is a tuple with the same
-%% tag and size that comes from 'erl_parse'
-%% -record(function, {name :: syntaxTree(), clauses :: [syntaxTree()]}).
+%% Don't use the name 'function' for this record, to avoid confusion with
+%% the tuples on the form {function,Name,Arity} used by erl_parse.
+-record(func, {name :: syntaxTree(), clauses :: [syntaxTree()]}).
%% type(Node) = function
-%% data(Node) = #function{name :: Name, clauses :: Clauses}
+%% data(Node) = #func{name :: Name, clauses :: Clauses}
%%
%% Name = syntaxTree()
%% Clauses = [syntaxTree()]
@@ -3556,7 +3306,7 @@ qualified_name_segments(Node) ->
-spec function(syntaxTree(), [syntaxTree()]) -> syntaxTree().
function(Name, Clauses) ->
- tree(function, #function{name = Name, clauses = Clauses}).
+ tree(function, #func{name = Name, clauses = Clauses}).
revert_function(Node) ->
Name = function_name(Node),
@@ -3572,9 +3322,7 @@ revert_function(Node) ->
%% =====================================================================
-%% @spec function_name(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the name subtree of a <code>function</code> node.
+%% @doc Returns the name subtree of a `function' node.
%%
%% @see function/2
@@ -3585,15 +3333,12 @@ function_name(Node) ->
{function, Pos, Name, _, _} ->
set_pos(atom(Name), Pos);
Node1 ->
- (data(Node1))#function.name
+ (data(Node1))#func.name
end.
%% =====================================================================
-%% @spec function_clauses(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the list of clause subtrees of a <code>function</code>
-%% node.
+%% @doc Returns the list of clause subtrees of a `function' node.
%%
%% @see function/2
@@ -3604,21 +3349,19 @@ function_clauses(Node) ->
{function, _, _, _, Clauses} ->
Clauses;
Node1 ->
- (data(Node1))#function.clauses
+ (data(Node1))#func.clauses
end.
%% =====================================================================
-%% @spec function_arity(Node::syntaxTree()) -> integer()
-%%
-%% @doc Returns the arity of a <code>function</code> node. The result
+%% @doc Returns the arity of a `function' node. The result
%% is the number of parameter patterns in the first clause of the
%% function; subsequent clauses are ignored.
%%
-%% <p>An exception is thrown if <code>function_clauses(Node)</code>
+%% An exception is thrown if `function_clauses(Node)'
%% returns an empty list, or if the first element of that list is not
-%% a syntax tree <code>C</code> of type <code>clause</code> such that
-%% <code>clause_patterns(C)</code> is a nonempty list.</p>
+%% a syntax tree `C' of type `clause' such that
+%% `clause_patterns(C)' is a nonempty list.
%%
%% @see function/2
%% @see function_clauses/1
@@ -3634,7 +3377,6 @@ function_arity(Node) ->
%% =====================================================================
-%% @spec clause(Guard, Body) -> syntaxTree()
%% @equiv clause([], Guard, Body)
-type guard() :: 'none' | syntaxTree() | [syntaxTree()] | [[syntaxTree()]].
@@ -3646,34 +3388,28 @@ clause(Guard, Body) ->
%% =====================================================================
-%% @spec clause(Patterns::[syntaxTree()], Guard,
-%% Body::[syntaxTree()]) -> syntaxTree()
-%% Guard = none | syntaxTree()
-%% | [syntaxTree()] | [[syntaxTree()]]
-%%
-%% @doc Creates an abstract clause. If <code>Patterns</code> is
-%% <code>[P1, ..., Pn]</code> and <code>Body</code> is <code>[B1, ...,
-%% Bm]</code>, then if <code>Guard</code> is <code>none</code>, the
+%% @doc Creates an abstract clause. If `Patterns' is
+%% `[P1, ..., Pn]' and `Body' is `[B1, ...,
+%% Bm]', then if `Guard' is `none', the
%% result represents "<code>(<em>P1</em>, ..., <em>Pn</em>) ->
%% <em>B1</em>, ..., <em>Bm</em></code>", otherwise, unless
-%% <code>Guard</code> is a list, the result represents
+%% `Guard' is a list, the result represents
%% "<code>(<em>P1</em>, ..., <em>Pn</em>) when <em>Guard</em> ->
%% <em>B1</em>, ..., <em>Bm</em></code>".
%%
-%% <p>For simplicity, the <code>Guard</code> argument may also be any
+%% For simplicity, the `Guard' argument may also be any
%% of the following:
%% <ul>
-%% <li>An empty list <code>[]</code>. This is equivalent to passing
-%% <code>none</code>.</li>
-%% <li>A nonempty list <code>[E1, ..., Ej]</code> of syntax trees.
-%% This is equivalent to passing <code>conjunction([E1, ...,
-%% Ej])</code>.</li>
-%% <li>A nonempty list of lists of syntax trees <code>[[E1_1, ...,
-%% E1_k1], ..., [Ej_1, ..., Ej_kj]]</code>, which is equivalent
-%% to passing <code>disjunction([conjunction([E1_1, ...,
-%% E1_k1]), ..., conjunction([Ej_1, ..., Ej_kj])])</code>.</li>
+%% <li>An empty list `[]'. This is equivalent to passing
+%% `none'.</li>
+%% <li>A nonempty list `[E1, ..., Ej]' of syntax trees.
+%% This is equivalent to passing `conjunction([E1, ...,
+%% Ej])'.</li>
+%% <li>A nonempty list of lists of syntax trees `[[E1_1, ...,
+%% E1_k1], ..., [Ej_1, ..., Ej_kj]]', which is equivalent
+%% to passing `disjunction([conjunction([E1_1, ...,
+%% E1_k1]), ..., conjunction([Ej_1, ..., Ej_kj])])'.</li>
%% </ul>
-%% </p>
%%
%% @see clause/2
%% @see clause_patterns/1
@@ -3789,10 +3525,7 @@ unfold_try_clause({clause, Pos, [{tuple, _, [C, V, _]}],
%% =====================================================================
-%% @spec clause_patterns(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the list of pattern subtrees of a <code>clause</code>
-%% node.
+%% @doc Returns the list of pattern subtrees of a `clause' node.
%%
%% @see clause/3
@@ -3808,13 +3541,11 @@ clause_patterns(Node) ->
%% =====================================================================
-%% @spec clause_guard(Node::syntaxTree()) -> none | syntaxTree()
-%%
-%% @doc Returns the guard subtree of a <code>clause</code> node, if
-%% any. If <code>Node</code> represents "<code>(<em>P1</em>, ...,
+%% @doc Returns the guard subtree of a `clause' node, if
+%% any. If `Node' represents "<code>(<em>P1</em>, ...,
%% <em>Pn</em>) when <em>Guard</em> -> <em>B1</em>, ...,
-%% <em>Bm</em></code>", <code>Guard</code> is returned. Otherwise, the
-%% result is <code>none</code>.
+%% <em>Bm</em></code>", `Guard' is returned. Otherwise, the
+%% result is `none'.
%%
%% @see clause/3
@@ -3836,10 +3567,7 @@ clause_guard(Node) ->
%% =====================================================================
-%% @spec clause_body(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Return the list of body subtrees of a <code>clause</code>
-%% node.
+%% @doc Return the list of body subtrees of a `clause' node.
%%
%% @see clause/3
@@ -3855,10 +3583,8 @@ clause_body(Node) ->
%% =====================================================================
-%% @spec disjunction(List::[syntaxTree()]) -> syntaxTree()
-%%
-%% @doc Creates an abstract disjunction. If <code>List</code> is
-%% <code>[E1, ..., En]</code>, the result represents
+%% @doc Creates an abstract disjunction. If `List' is
+%% `[E1, ..., En]', the result represents
%% "<code><em>E1</em>; ...; <em>En</em></code>".
%%
%% @see disjunction_body/1
@@ -3874,10 +3600,8 @@ disjunction(Tests) ->
%% =====================================================================
-%% @spec disjunction_body(syntaxTree()) -> [syntaxTree()]
-%%
%% @doc Returns the list of body subtrees of a
-%% <code>disjunction</code> node.
+%% `disjunction' node.
%%
%% @see disjunction/1
@@ -3888,10 +3612,8 @@ disjunction_body(Node) ->
%% =====================================================================
-%% @spec conjunction(List::[syntaxTree()]) -> syntaxTree()
-%%
-%% @doc Creates an abstract conjunction. If <code>List</code> is
-%% <code>[E1, ..., En]</code>, the result represents
+%% @doc Creates an abstract conjunction. If `List' is
+%% `[E1, ..., En]', the result represents
%% "<code><em>E1</em>, ..., <em>En</em></code>".
%%
%% @see conjunction_body/1
@@ -3907,10 +3629,8 @@ conjunction(Tests) ->
%% =====================================================================
-%% @spec conjunction_body(syntaxTree()) -> [syntaxTree()]
-%%
%% @doc Returns the list of body subtrees of a
-%% <code>conjunction</code> node.
+%% `conjunction' node.
%%
%% @see conjunction/1
@@ -3921,8 +3641,6 @@ conjunction_body(Node) ->
%% =====================================================================
-%% @spec catch_expr(Expr::syntaxTree()) -> syntaxTree()
-%%
%% @doc Creates an abstract catch-expression. The result represents
%% "<code>catch <em>Expr</em></code>".
%%
@@ -3949,9 +3667,7 @@ revert_catch_expr(Node) ->
%% =====================================================================
-%% @spec catch_expr_body(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the body subtree of a <code>catch_expr</code> node.
+%% @doc Returns the body subtree of a `catch_expr' node.
%%
%% @see catch_expr/1
@@ -3967,9 +3683,6 @@ catch_expr_body(Node) ->
%% =====================================================================
-%% @spec match_expr(Pattern::syntaxTree(), Body::syntaxTree()) ->
-%% syntaxTree()
-%%
%% @doc Creates an abstract match-expression. The result represents
%% "<code><em>Pattern</em> = <em>Body</em></code>".
%%
@@ -4002,9 +3715,7 @@ revert_match_expr(Node) ->
%% =====================================================================
-%% @spec match_expr_pattern(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the pattern subtree of a <code>match_expr</code> node.
+%% @doc Returns the pattern subtree of a `match_expr' node.
%%
%% @see match_expr/2
@@ -4020,9 +3731,7 @@ match_expr_pattern(Node) ->
%% =====================================================================
-%% @spec match_expr_body(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the body subtree of a <code>match_expr</code> node.
+%% @doc Returns the body subtree of a `match_expr' node.
%%
%% @see match_expr/2
@@ -4038,15 +3747,12 @@ match_expr_body(Node) ->
%% =====================================================================
-%% @spec operator(Name) -> syntaxTree()
-%% Name = atom() | string()
-%%
%% @doc Creates an abstract operator. The name of the operator is the
-%% character sequence represented by <code>Name</code>. This is
+%% character sequence represented by `Name'. This is
%% analogous to the print name of an atom, but an operator is never
%% written within single-quotes; e.g., the result of
-%% <code>operator('++')</code> represents "<code>++</code>" rather
-%% than "<code>'++'</code>".
+%% `operator('++')' represents "`++'" rather
+%% than "`'++''".
%%
%% @see operator_name/1
%% @see operator_literal/1
@@ -4064,9 +3770,7 @@ operator(Name) ->
%% =====================================================================
-%% @spec operator_name(syntaxTree()) -> atom()
-%%
-%% @doc Returns the name of an <code>operator</code> node. Note that
+%% @doc Returns the name of an `operator' node. Note that
%% the name is returned as an atom.
%%
%% @see operator/1
@@ -4078,11 +3782,8 @@ operator_name(Node) ->
%% =====================================================================
-%% @spec operator_literal(syntaxTree()) -> string()
-%%
%% @doc Returns the literal string represented by an
-%% <code>operator</code> node. This is simply the operator name as a
-%% string.
+%% `operator' node. This is simply the operator name as a string.
%%
%% @see operator/1
@@ -4093,9 +3794,6 @@ operator_literal(Node) ->
%% =====================================================================
-%% @spec infix_expr(Left::syntaxTree(), Operator::syntaxTree(),
-%% Right::syntaxTree()) -> syntaxTree()
-%%
%% @doc Creates an abstract infix operator expression. The result
%% represents "<code><em>Left</em> <em>Operator</em>
%% <em>Right</em></code>".
@@ -4144,10 +3842,8 @@ revert_infix_expr(Node) ->
%% =====================================================================
-%% @spec infix_expr_left(syntaxTree()) -> syntaxTree()
-%%
%% @doc Returns the left argument subtree of an
-%% <code>infix_expr</code> node.
+%% `infix_expr' node.
%%
%% @see infix_expr/3
@@ -4163,10 +3859,7 @@ infix_expr_left(Node) ->
%% =====================================================================
-%% @spec infix_expr_operator(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the operator subtree of an <code>infix_expr</code>
-%% node.
+%% @doc Returns the operator subtree of an `infix_expr' node.
%%
%% @see infix_expr/3
@@ -4182,10 +3875,8 @@ infix_expr_operator(Node) ->
%% =====================================================================
-%% @spec infix_expr_right(syntaxTree()) -> syntaxTree()
-%%
%% @doc Returns the right argument subtree of an
-%% <code>infix_expr</code> node.
+%% `infix_expr' node.
%%
%% @see infix_expr/3
@@ -4201,9 +3892,6 @@ infix_expr_right(Node) ->
%% =====================================================================
-%% @spec prefix_expr(Operator::syntaxTree(), Argument::syntaxTree()) ->
-%% syntaxTree()
-%%
%% @doc Creates an abstract prefix operator expression. The result
%% represents "<code><em>Operator</em> <em>Argument</em></code>".
%%
@@ -4247,10 +3935,7 @@ revert_prefix_expr(Node) ->
%% =====================================================================
-%% @spec prefix_expr_operator(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the operator subtree of a <code>prefix_expr</code>
-%% node.
+%% @doc Returns the operator subtree of a `prefix_expr' node.
%%
%% @see prefix_expr/2
@@ -4266,10 +3951,7 @@ prefix_expr_operator(Node) ->
%% =====================================================================
-%% @spec prefix_expr_argument(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the argument subtree of a <code>prefix_expr</code>
-%% node.
+%% @doc Returns the argument subtree of a `prefix_expr' node.
%%
%% @see prefix_expr/2
@@ -4285,7 +3967,6 @@ prefix_expr_argument(Node) ->
%% =====================================================================
-%% @spec record_field(Name) -> syntaxTree()
%% @equiv record_field(Name, none)
-spec record_field(syntaxTree()) -> syntaxTree().
@@ -4295,11 +3976,8 @@ record_field(Name) ->
%% =====================================================================
-%% @spec record_field(Name::syntaxTree(), Value) -> syntaxTree()
-%% Value = none | syntaxTree()
-%%
%% @doc Creates an abstract record field specification. If
-%% <code>Value</code> is <code>none</code>, the result represents
+%% `Value' is `none', the result represents
%% simply "<code><em>Name</em></code>", otherwise it represents
%% "<code><em>Name</em> = <em>Value</em></code>".
%%
@@ -4321,9 +3999,7 @@ record_field(Name, Value) ->
%% =====================================================================
-%% @spec record_field_name(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the name subtree of a <code>record_field</code> node.
+%% @doc Returns the name subtree of a `record_field' node.
%%
%% @see record_field/2
@@ -4334,13 +4010,11 @@ record_field_name(Node) ->
%% =====================================================================
-%% @spec record_field_value(syntaxTree()) -> none | syntaxTree()
-%%
-%% @doc Returns the value subtree of a <code>record_field</code> node,
-%% if any. If <code>Node</code> represents
-%% "<code><em>Name</em></code>", <code>none</code> is
-%% returned. Otherwise, if <code>Node</code> represents
-%% "<code><em>Name</em> = <em>Value</em></code>", <code>Value</code>
+%% @doc Returns the value subtree of a `record_field' node,
+%% if any. If `Node' represents
+%% "<code><em>Name</em></code>", `none' is
+%% returned. Otherwise, if `Node' represents
+%% "<code><em>Name</em> = <em>Value</em></code>", `Value'
%% is returned.
%%
%% @see record_field/2
@@ -4352,15 +4026,12 @@ record_field_value(Node) ->
%% =====================================================================
-%% @spec record_index_expr(Type::syntaxTree(), Field::syntaxTree()) ->
-%% syntaxTree()
-%%
%% @doc Creates an abstract record field index expression. The result
%% represents "<code>#<em>Type</em>.<em>Field</em></code>".
%%
-%% <p>(Note: the function name <code>record_index/2</code> is reserved
+%% (Note: the function name `record_index/2' is reserved
%% by the Erlang compiler, which is why that name could not be used
-%% for this constructor.)</p>
+%% for this constructor.)
%%
%% @see record_index_expr_type/1
%% @see record_index_expr_field/1
@@ -4399,10 +4070,7 @@ revert_record_index_expr(Node) ->
%% =====================================================================
-%% @spec record_index_expr_type(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the type subtree of a <code>record_index_expr</code>
-%% node.
+%% @doc Returns the type subtree of a `record_index_expr' node.
%%
%% @see record_index_expr/2
@@ -4418,10 +4086,7 @@ record_index_expr_type(Node) ->
%% =====================================================================
-%% @spec record_index_expr_field(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the field subtree of a <code>record_index_expr</code>
-%% node.
+%% @doc Returns the field subtree of a `record_index_expr' node.
%%
%% @see record_index_expr/2
@@ -4437,7 +4102,6 @@ record_index_expr_field(Node) ->
%% =====================================================================
-%% @spec record_access(Argument, Field) -> syntaxTree()
%% @equiv record_access(Argument, none, Field)
-spec record_access(syntaxTree(), syntaxTree()) -> syntaxTree().
@@ -4447,17 +4111,13 @@ record_access(Argument, Field) ->
%% =====================================================================
-%% @spec record_access(Argument::syntaxTree(), Type,
-%% Field::syntaxTree()) -> syntaxTree()
-%% Type = none | syntaxTree()
-%%
%% @doc Creates an abstract record field access expression. If
-%% <code>Type</code> is not <code>none</code>, the result represents
+%% `Type' is not `none', the result represents
%% "<code><em>Argument</em>#<em>Type</em>.<em>Field</em></code>".
%%
-%% <p>If <code>Type</code> is <code>none</code>, the result represents
+%% If `Type' is `none', the result represents
%% "<code><em>Argument</em>.<em>Field</em></code>". This is a special
-%% form only allowed within Mnemosyne queries.</p>
+%% form only allowed within Mnemosyne queries.
%%
%% @see record_access/2
%% @see record_access_argument/1
@@ -4512,10 +4172,7 @@ revert_record_access(Node) ->
%% =====================================================================
-%% @spec record_access_argument(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the argument subtree of a <code>record_access</code>
-%% node.
+%% @doc Returns the argument subtree of a `record_access' node.
%%
%% @see record_access/3
@@ -4533,14 +4190,12 @@ record_access_argument(Node) ->
%% =====================================================================
-%% @spec record_access_type(syntaxTree()) -> none | syntaxTree()
-%%
-%% @doc Returns the type subtree of a <code>record_access</code> node,
-%% if any. If <code>Node</code> represents
-%% "<code><em>Argument</em>.<em>Field</em></code>", <code>none</code>
-%% is returned, otherwise if <code>Node</code> represents
+%% @doc Returns the type subtree of a `record_access' node,
+%% if any. If `Node' represents
+%% "<code><em>Argument</em>.<em>Field</em></code>", `none'
+%% is returned, otherwise if `Node' represents
%% "<code><em>Argument</em>#<em>Type</em>.<em>Field</em></code>",
-%% <code>Type</code> is returned.
+%% `Type' is returned.
%%
%% @see record_access/3
@@ -4558,10 +4213,7 @@ record_access_type(Node) ->
%% =====================================================================
-%% @spec record_access_field(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the field subtree of a <code>record_access</code>
-%% node.
+%% @doc Returns the field subtree of a `record_access' node.
%%
%% @see record_access/3
@@ -4579,7 +4231,6 @@ record_access_field(Node) ->
%% =====================================================================
-%% @spec record_expr(Type, Fields) -> syntaxTree()
%% @equiv record_expr(none, Type, Fields)
-spec record_expr(syntaxTree(), [syntaxTree()]) -> syntaxTree().
@@ -4589,13 +4240,9 @@ record_expr(Type, Fields) ->
%% =====================================================================
-%% @spec record_expr(Argument, Type::syntaxTree(),
-%% Fields::[syntaxTree()]) -> syntaxTree()
-%% Argument = none | syntaxTree()
-%%
-%% @doc Creates an abstract record expression. If <code>Fields</code> is
-%% <code>[F1, ..., Fn]</code>, then if <code>Argument</code> is
-%% <code>none</code>, the result represents
+%% @doc Creates an abstract record expression. If `Fields' is
+%% `[F1, ..., Fn]', then if `Argument' is
+%% `none', the result represents
%% "<code>#<em>Type</em>{<em>F1</em>, ..., <em>Fn</em>}</code>",
%% otherwise it represents
%% "<code><em>Argument</em>#<em>Type</em>{<em>F1</em>, ...,
@@ -4661,14 +4308,12 @@ revert_record_expr(Node) ->
%% =====================================================================
-%% @spec record_expr_argument(syntaxTree()) -> none | syntaxTree()
-%%
-%% @doc Returns the argument subtree of a <code>record_expr</code> node,
-%% if any. If <code>Node</code> represents
-%% "<code>#<em>Type</em>{...}</code>", <code>none</code> is returned.
-%% Otherwise, if <code>Node</code> represents
+%% @doc Returns the argument subtree of a `record_expr' node,
+%% if any. If `Node' represents
+%% "<code>#<em>Type</em>{...}</code>", `none' is returned.
+%% Otherwise, if `Node' represents
%% "<code><em>Argument</em>#<em>Type</em>{...}</code>",
-%% <code>Argument</code> is returned.
+%% `Argument' is returned.
%%
%% @see record_expr/3
@@ -4686,9 +4331,7 @@ record_expr_argument(Node) ->
%% =====================================================================
-%% @spec record_expr_type(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the type subtree of a <code>record_expr</code> node.
+%% @doc Returns the type subtree of a `record_expr' node.
%%
%% @see record_expr/3
@@ -4706,10 +4349,8 @@ record_expr_type(Node) ->
%% =====================================================================
-%% @spec record_expr_fields(syntaxTree()) -> [syntaxTree()]
-%%
%% @doc Returns the list of field subtrees of a
-%% <code>record_expr</code> node.
+%% `record_expr' node.
%%
%% @see record_expr/3
@@ -4727,15 +4368,11 @@ record_expr_fields(Node) ->
%% =====================================================================
-%% @spec application(Module, Function::syntaxTree(),
-%% Arguments::[syntaxTree()]) -> syntaxTree()
-%% Module = none | syntaxTree()
-%%
%% @doc Creates an abstract function application expression. If
-%% <code>Module</code> is <code>none</code>, this is call is equivalent
-%% to <code>application(Function, Arguments)</code>, otherwise it is
-%% equivalent to <code>application(module_qualifier(Module, Function),
-%% Arguments)</code>.
+%% `Module' is `none', this is call is equivalent
+%% to `application(Function, Arguments)', otherwise it is
+%% equivalent to `application(module_qualifier(Module, Function),
+%% Arguments)'.
%%
%% (This is a utility function.)
%%
@@ -4752,11 +4389,8 @@ application(Module, Name, Arguments) ->
%% =====================================================================
-%% @spec application(Operator::syntaxTree(),
-%% Arguments::[syntaxTree()]) -> syntaxTree()
-%%
%% @doc Creates an abstract function application expression. If
-%% <code>Arguments</code> is <code>[A1, ..., An]</code>, the result
+%% `Arguments' is `[A1, ..., An]', the result
%% represents "<code><em>Operator</em>(<em>A1</em>, ...,
%% <em>An</em>)</code>".
%%
@@ -4794,14 +4428,11 @@ revert_application(Node) ->
%% =====================================================================
-%% @spec application_operator(syntaxTree()) -> syntaxTree()
+%% @doc Returns the operator subtree of an `application' node.
%%
-%% @doc Returns the operator subtree of an <code>application</code>
-%% node.
-%%
-%% <p>Note: if <code>Node</code> represents
+%% Note: if `Node' represents
%% "<code><em>M</em>:<em>F</em>(...)</code>", then the result is the
-%% subtree representing "<code><em>M</em>:<em>F</em></code>".</p>
+%% subtree representing "<code><em>M</em>:<em>F</em></code>".
%%
%% @see application/2
%% @see module_qualifier/2
@@ -4818,10 +4449,8 @@ application_operator(Node) ->
%% =====================================================================
-%% @spec application_arguments(syntaxTree()) -> [syntaxTree()]
-%%
%% @doc Returns the list of argument subtrees of an
-%% <code>application</code> node.
+%% `application' node.
%%
%% @see application/2
@@ -4837,11 +4466,8 @@ application_arguments(Node) ->
%% =====================================================================
-%% @spec list_comp(Template::syntaxTree(), Body::[syntaxTree()]) ->
-%% syntaxTree()
-%%
-%% @doc Creates an abstract list comprehension. If <code>Body</code> is
-%% <code>[E1, ..., En]</code>, the result represents
+%% @doc Creates an abstract list comprehension. If `Body' is
+%% `[E1, ..., En]', the result represents
%% "<code>[<em>Template</em> || <em>E1</em>, ..., <em>En</em>]</code>".
%%
%% @see list_comp_template/1
@@ -4876,9 +4502,7 @@ revert_list_comp(Node) ->
%% =====================================================================
-%% @spec list_comp_template(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the template subtree of a <code>list_comp</code> node.
+%% @doc Returns the template subtree of a `list_comp' node.
%%
%% @see list_comp/2
@@ -4894,10 +4518,7 @@ list_comp_template(Node) ->
%% =====================================================================
-%% @spec list_comp_body(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the list of body subtrees of a <code>list_comp</code>
-%% node.
+%% @doc Returns the list of body subtrees of a `list_comp' node.
%%
%% @see list_comp/2
@@ -4912,11 +4533,8 @@ list_comp_body(Node) ->
end.
%% =====================================================================
-%% @spec binary_comp(Template::syntaxTree(), Body::[syntaxTree()]) ->
-%% syntaxTree()
-%%
-%% @doc Creates an abstract binary comprehension. If <code>Body</code> is
-%% <code>[E1, ..., En]</code>, the result represents
+%% @doc Creates an abstract binary comprehension. If `Body' is
+%% `[E1, ..., En]', the result represents
%% "<code>&lt;&lt;<em>Template</em> || <em>E1</em>, ..., <em>En</em>&gt;&gt;</code>".
%%
%% @see binary_comp_template/1
@@ -4951,9 +4569,7 @@ revert_binary_comp(Node) ->
%% =====================================================================
-%% @spec binary_comp_template(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the template subtree of a <code>binary_comp</code> node.
+%% @doc Returns the template subtree of a `binary_comp' node.
%%
%% @see binary_comp/2
@@ -4969,10 +4585,7 @@ binary_comp_template(Node) ->
%% =====================================================================
-%% @spec binary_comp_body(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the list of body subtrees of a <code>binary_comp</code>
-%% node.
+%% @doc Returns the list of body subtrees of a `binary_comp' node.
%%
%% @see binary_comp/2
@@ -4988,8 +4601,6 @@ binary_comp_body(Node) ->
%% =====================================================================
-%% @spec query_expr(Body::syntaxTree()) -> syntaxTree()
-%%
%% @doc Creates an abstract Mnemosyne query expression. The result
%% represents "<code>query <em>Body</em> end</code>".
%%
@@ -5018,9 +4629,7 @@ revert_query_expr(Node) ->
%% =====================================================================
-%% @spec query_expr_body(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the body subtree of a <code>query_expr</code> node.
+%% @doc Returns the body subtree of a `query_expr' node.
%%
%% @see query_expr/1
@@ -5036,13 +4645,10 @@ query_expr_body(Node) ->
%% =====================================================================
-%% @spec rule(Name::syntaxTree(), Clauses::[syntaxTree()]) ->
-%% syntaxTree()
-%%
-%% @doc Creates an abstract Mnemosyne rule. If <code>Clauses</code> is
-%% <code>[C1, ..., Cn]</code>, the results represents
+%% @doc Creates an abstract Mnemosyne rule. If `Clauses' is
+%% `[C1, ..., Cn]', the results represents
%% "<code><em>Name</em> <em>C1</em>; ...; <em>Name</em>
-%% <em>Cn</em>.</code>". More exactly, if each <code>Ci</code>
+%% <em>Cn</em>.</code>". More exactly, if each `Ci'
%% represents "<code>(<em>Pi1</em>, ..., <em>Pim</em>) <em>Gi</em> ->
%% <em>Bi</em></code>", then the result represents
%% "<code><em>Name</em>(<em>P11</em>, ..., <em>P1m</em>) <em>G1</em> :-
@@ -5097,9 +4703,7 @@ revert_rule(Node) ->
%% =====================================================================
-%% @spec rule_name(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the name subtree of a <code>rule</code> node.
+%% @doc Returns the name subtree of a `rule' node.
%%
%% @see rule/2
@@ -5114,9 +4718,7 @@ rule_name(Node) ->
end.
%% =====================================================================
-%% @spec rule_clauses(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the list of clause subtrees of a <code>rule</code> node.
+%% @doc Returns the list of clause subtrees of a `rule' node.
%%
%% @see rule/2
@@ -5131,16 +4733,14 @@ rule_clauses(Node) ->
end.
%% =====================================================================
-%% @spec rule_arity(Node::syntaxTree()) -> integer()
-%%
-%% @doc Returns the arity of a <code>rule</code> node. The result is the
+%% @doc Returns the arity of a `rule' node. The result is the
%% number of parameter patterns in the first clause of the rule;
%% subsequent clauses are ignored.
%%
-%% <p>An exception is thrown if <code>rule_clauses(Node)</code> returns
+%% An exception is thrown if `rule_clauses(Node)' returns
%% an empty list, or if the first element of that list is not a syntax
-%% tree <code>C</code> of type <code>clause</code> such that
-%% <code>clause_patterns(C)</code> is a nonempty list.</p>
+%% tree `C' of type `clause' such that
+%% `clause_patterns(C)' is a nonempty list.
%%
%% @see rule/2
%% @see rule_clauses/1
@@ -5156,9 +4756,6 @@ rule_arity(Node) ->
%% =====================================================================
-%% @spec generator(Pattern::syntaxTree(), Body::syntaxTree()) ->
-%% syntaxTree()
-%%
%% @doc Creates an abstract generator. The result represents
%% "<code><em>Pattern</em> &lt;- <em>Body</em></code>".
%%
@@ -5193,9 +4790,7 @@ revert_generator(Node) ->
%% =====================================================================
-%% @spec generator_pattern(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the pattern subtree of a <code>generator</code> node.
+%% @doc Returns the pattern subtree of a `generator' node.
%%
%% @see generator/2
@@ -5211,9 +4806,7 @@ generator_pattern(Node) ->
%% =====================================================================
-%% @spec generator_body(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the body subtree of a <code>generator</code> node.
+%% @doc Returns the body subtree of a `generator' node.
%%
%% @see generator/2
@@ -5229,9 +4822,6 @@ generator_body(Node) ->
%% =====================================================================
-%% @spec binary_generator(Pattern::syntaxTree(), Body::syntaxTree()) ->
-%% syntaxTree()
-%%
%% @doc Creates an abstract binary_generator. The result represents
%% "<code><em>Pattern</em> &lt;- <em>Body</em></code>".
%%
@@ -5266,9 +4856,7 @@ revert_binary_generator(Node) ->
%% =====================================================================
-%% @spec binary_generator_pattern(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the pattern subtree of a <code>generator</code> node.
+%% @doc Returns the pattern subtree of a `generator' node.
%%
%% @see binary_generator/2
@@ -5284,9 +4872,7 @@ binary_generator_pattern(Node) ->
%% =====================================================================
-%% @spec binary_generator_body(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the body subtree of a <code>generator</code> node.
+%% @doc Returns the body subtree of a `generator' node.
%%
%% @see binary_generator/2
@@ -5302,10 +4888,8 @@ binary_generator_body(Node) ->
%% =====================================================================
-%% @spec block_expr(Body::[syntaxTree()]) -> syntaxTree()
-%%
-%% @doc Creates an abstract block expression. If <code>Body</code> is
-%% <code>[B1, ..., Bn]</code>, the result represents "<code>begin
+%% @doc Creates an abstract block expression. If `Body' is
+%% `[B1, ..., Bn]', the result represents "<code>begin
%% <em>B1</em>, ..., <em>Bn</em> end</code>".
%%
%% @see block_expr_body/1
@@ -5321,7 +4905,7 @@ binary_generator_body(Node) ->
%%
%% Body = [erl_parse()] \ []
--spec block_expr(Body::[syntaxTree()]) -> syntaxTree().
+-spec block_expr([syntaxTree()]) -> syntaxTree().
block_expr(Body) ->
tree(block_expr, Body).
@@ -5333,10 +4917,7 @@ revert_block_expr(Node) ->
%% =====================================================================
-%% @spec block_expr_body(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the list of body subtrees of a <code>block_expr</code>
-%% node.
+%% @doc Returns the list of body subtrees of a `block_expr' node.
%%
%% @see block_expr/1
@@ -5352,12 +4933,10 @@ block_expr_body(Node) ->
%% =====================================================================
-%% @spec if_expr(Clauses::[syntaxTree()]) -> syntaxTree()
-%%
-%% @doc Creates an abstract if-expression. If <code>Clauses</code> is
-%% <code>[C1, ..., Cn]</code>, the result represents "<code>if
+%% @doc Creates an abstract if-expression. If `Clauses' is
+%% `[C1, ..., Cn]', the result represents "<code>if
%% <em>C1</em>; ...; <em>Cn</em> end</code>". More exactly, if each
-%% <code>Ci</code> represents "<code>() <em>Gi</em> ->
+%% `Ci' represents "<code>() <em>Gi</em> ->
%% <em>Bi</em></code>", then the result represents "<code>if
%% <em>G1</em> -> <em>B1</em>; ...; <em>Gn</em> -> <em>Bn</em>
%% end</code>".
@@ -5392,10 +4971,7 @@ revert_if_expr(Node) ->
%% =====================================================================
-%% @spec if_expr_clauses(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the list of clause subtrees of an <code>if_expr</code>
-%% node.
+%% @doc Returns the list of clause subtrees of an `if_expr' node.
%%
%% @see if_expr/1
@@ -5411,13 +4987,10 @@ if_expr_clauses(Node) ->
%% =====================================================================
-%% @spec case_expr(Argument::syntaxTree(), Clauses::[syntaxTree()]) ->
-%% syntaxTree()
-%%
-%% @doc Creates an abstract case-expression. If <code>Clauses</code> is
-%% <code>[C1, ..., Cn]</code>, the result represents "<code>case
+%% @doc Creates an abstract case-expression. If `Clauses' is
+%% `[C1, ..., Cn]', the result represents "<code>case
%% <em>Argument</em> of <em>C1</em>; ...; <em>Cn</em> end</code>". More
-%% exactly, if each <code>Ci</code> represents "<code>(<em>Pi</em>)
+%% exactly, if each `Ci' represents "<code>(<em>Pi</em>)
%% <em>Gi</em> -> <em>Bi</em></code>", then the result represents
%% "<code>case <em>Argument</em> of <em>P1</em> <em>G1</em> ->
%% <em>B1</em>; ...; <em>Pn</em> <em>Gn</em> -> <em>Bn</em> end</code>".
@@ -5461,9 +5034,7 @@ revert_case_expr(Node) ->
%% =====================================================================
-%% @spec case_expr_argument(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the argument subtree of a <code>case_expr</code> node.
+%% @doc Returns the argument subtree of a `case_expr' node.
%%
%% @see case_expr/2
@@ -5479,10 +5050,7 @@ case_expr_argument(Node) ->
%% =====================================================================
-%% @spec case_expr_clauses(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the list of clause subtrees of a <code>case_expr</code>
-%% node.
+%% @doc Returns the list of clause subtrees of a `case_expr' node.
%%
%% @see case_expr/2
@@ -5498,12 +5066,10 @@ case_expr_clauses(Node) ->
%% =====================================================================
-%% @spec cond_expr(Clauses::[syntaxTree()]) -> syntaxTree()
-%%
-%% @doc Creates an abstract cond-expression. If <code>Clauses</code> is
-%% <code>[C1, ..., Cn]</code>, the result represents "<code>cond
+%% @doc Creates an abstract cond-expression. If `Clauses' is
+%% `[C1, ..., Cn]', the result represents "<code>cond
%% <em>C1</em>; ...; <em>Cn</em> end</code>". More exactly, if each
-%% <code>Ci</code> represents "<code>() <em>Ei</em> ->
+%% `Ci' represents "<code>() <em>Ei</em> ->
%% <em>Bi</em></code>", then the result represents "<code>cond
%% <em>E1</em> -> <em>B1</em>; ...; <em>En</em> -> <em>Bn</em>
%% end</code>".
@@ -5538,10 +5104,7 @@ revert_cond_expr(Node) ->
%% =====================================================================
-%% @spec cond_expr_clauses(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the list of clause subtrees of a <code>cond_expr</code>
-%% node.
+%% @doc Returns the list of clause subtrees of a `cond_expr' node.
%%
%% @see cond_expr/1
@@ -5557,7 +5120,6 @@ cond_expr_clauses(Node) ->
%% =====================================================================
-%% @spec receive_expr(Clauses) -> syntaxTree()
%% @equiv receive_expr(Clauses, none, [])
-spec receive_expr([syntaxTree()]) -> syntaxTree().
@@ -5567,25 +5129,21 @@ receive_expr(Clauses) ->
%% =====================================================================
-%% @spec receive_expr(Clauses::[syntaxTree()], Timeout,
-%% Action::[syntaxTree()]) -> syntaxTree()
-%% Timeout = none | syntaxTree()
-%%
-%% @doc Creates an abstract receive-expression. If <code>Timeout</code>
-%% is <code>none</code>, the result represents "<code>receive
-%% <em>C1</em>; ...; <em>Cn</em> end</code>" (the <code>Action</code>
-%% argument is ignored). Otherwise, if <code>Clauses</code> is
-%% <code>[C1, ..., Cn]</code> and <code>Action</code> is <code>[A1, ...,
-%% Am]</code>, the result represents "<code>receive <em>C1</em>; ...;
+%% @doc Creates an abstract receive-expression. If `Timeout'
+%% is `none', the result represents "<code>receive
+%% <em>C1</em>; ...; <em>Cn</em> end</code>" (the `Action'
+%% argument is ignored). Otherwise, if `Clauses' is
+%% `[C1, ..., Cn]' and `Action' is `[A1, ...,
+%% Am]', the result represents "<code>receive <em>C1</em>; ...;
%% <em>Cn</em> after <em>Timeout</em> -> <em>A1</em>, ..., <em>Am</em>
-%% end</code>". More exactly, if each <code>Ci</code> represents
+%% end</code>". More exactly, if each `Ci' represents
%% "<code>(<em>Pi</em>) <em>Gi</em> -> <em>Bi</em></code>", then the
%% result represents "<code>receive <em>P1</em> <em>G1</em> ->
%% <em>B1</em>; ...; <em>Pn</em> <em>Gn</em> -> <em>Bn</em> ...
%% end</code>".
%%
-%% <p>Note that in Erlang, a receive-expression must have at least one
-%% clause if no timeout part is specified.</p>
+%% Note that in Erlang, a receive-expression must have at least one
+%% clause if no timeout part is specified.
%%
%% @see receive_expr_clauses/1
%% @see receive_expr_timeout/1
@@ -5649,11 +5207,8 @@ revert_receive_expr(Node) ->
%% =====================================================================
-%% @spec receive_expr_clauses(syntaxTree()) -> [syntaxTree()]
-%% type(Node) = receive_expr
-%%
%% @doc Returns the list of clause subtrees of a
-%% <code>receive_expr</code> node.
+%% `receive_expr' node.
%%
%% @see receive_expr/3
@@ -5671,15 +5226,12 @@ receive_expr_clauses(Node) ->
%% =====================================================================
-%% @spec receive_expr_timeout(Node::syntaxTree()) -> Timeout
-%% Timeout = none | syntaxTree()
-%%
-%% @doc Returns the timeout subtree of a <code>receive_expr</code> node,
-%% if any. If <code>Node</code> represents "<code>receive <em>C1</em>;
-%% ...; <em>Cn</em> end</code>", <code>none</code> is returned.
-%% Otherwise, if <code>Node</code> represents "<code>receive
+%% @doc Returns the timeout subtree of a `receive_expr' node,
+%% if any. If `Node' represents "<code>receive <em>C1</em>;
+%% ...; <em>Cn</em> end</code>", `none' is returned.
+%% Otherwise, if `Node' represents "<code>receive
%% <em>C1</em>; ...; <em>Cn</em> after <em>Timeout</em> -> ... end</code>",
-%% <code>Timeout</code> is returned.
+%% `Timeout' is returned.
%%
%% @see receive_expr/3
@@ -5697,10 +5249,8 @@ receive_expr_timeout(Node) ->
%% =====================================================================
-%% @spec receive_expr_action(Node::syntaxTree()) -> [syntaxTree()]
-%%
%% @doc Returns the list of action body subtrees of a
-%% <code>receive_expr</code> node. If <code>Node</code> represents
+%% `receive_expr' node. If `Node' represents
%% "<code>receive <em>C1</em>; ...; <em>Cn</em> end</code>", this is the
%% empty list.
%%
@@ -5720,8 +5270,6 @@ receive_expr_action(Node) ->
%% =====================================================================
-%% @spec try_expr(Body::syntaxTree(), Handlers::[syntaxTree()]) ->
-%% syntaxTree()
%% @equiv try_expr(Body, [], Handlers)
-spec try_expr([syntaxTree()], [syntaxTree()]) -> syntaxTree().
@@ -5731,8 +5279,6 @@ try_expr(Body, Handlers) ->
%% =====================================================================
-%% @spec try_expr(Body::syntaxTree(), Clauses::[syntaxTree()],
-%% Handlers::[syntaxTree()]) -> syntaxTree()
%% @equiv try_expr(Body, Clauses, Handlers, [])
-spec try_expr([syntaxTree()], [syntaxTree()], [syntaxTree()]) -> syntaxTree().
@@ -5742,8 +5288,6 @@ try_expr(Body, Clauses, Handlers) ->
%% =====================================================================
-%% @spec try_after_expr(Body::syntaxTree(), After::[syntaxTree()]) ->
-%% syntaxTree()
%% @equiv try_expr(Body, [], [], After)
-spec try_after_expr([syntaxTree()], [syntaxTree()]) -> syntaxTree().
@@ -5753,30 +5297,26 @@ try_after_expr(Body, After) ->
%% =====================================================================
-%% @spec try_expr(Body::[syntaxTree()], Clauses::[syntaxTree()],
-%% Handlers::[syntaxTree()], After::[syntaxTree()]) ->
-%% syntaxTree()
-%%
-%% @doc Creates an abstract try-expression. If <code>Body</code> is
-%% <code>[B1, ..., Bn]</code>, <code>Clauses</code> is <code>[C1, ...,
-%% Cj]</code>, <code>Handlers</code> is <code>[H1, ..., Hk]</code>, and
-%% <code>After</code> is <code>[A1, ..., Am]</code>, the result
+%% @doc Creates an abstract try-expression. If `Body' is
+%% `[B1, ..., Bn]', `Clauses' is `[C1, ...,
+%% Cj]', `Handlers' is `[H1, ..., Hk]', and
+%% `After' is `[A1, ..., Am]', the result
%% represents "<code>try <em>B1</em>, ..., <em>Bn</em> of <em>C1</em>;
%% ...; <em>Cj</em> catch <em>H1</em>; ...; <em>Hk</em> after
%% <em>A1</em>, ..., <em>Am</em> end</code>". More exactly, if each
-%% <code>Ci</code> represents "<code>(<em>CPi</em>) <em>CGi</em> ->
-%% <em>CBi</em></code>", and each <code>Hi</code> represents
+%% `Ci' represents "<code>(<em>CPi</em>) <em>CGi</em> ->
+%% <em>CBi</em></code>", and each `Hi' represents
%% "<code>(<em>HPi</em>) <em>HGi</em> -> <em>HBi</em></code>", then the
%% result represents "<code>try <em>B1</em>, ..., <em>Bn</em> of
%% <em>CP1</em> <em>CG1</em> -> <em>CB1</em>; ...; <em>CPj</em>
%% <em>CGj</em> -> <em>CBj</em> catch <em>HP1</em> <em>HG1</em> ->
%% <em>HB1</em>; ...; <em>HPk</em> <em>HGk</em> -> <em>HBk</em> after
-%% <em>A1</em>, ..., <em>Am</em> end</code>"; cf.
-%% <code>case_expr/2</code>. If <code>Clauses</code> is the empty list,
-%% the <code>of ...</code> section is left out. If <code>After</code> is
-%% the empty list, the <code>after ...</code> section is left out. If
-%% <code>Handlers</code> is the empty list, and <code>After</code> is
-%% nonempty, the <code>catch ...</code> section is left out.
+%% <em>A1</em>, ..., <em>Am</em> end</code>"; see
+%% {@link case_expr/2}. If `Clauses' is the empty list,
+%% the `of ...' section is left out. If `After' is
+%% the empty list, the `after ...' section is left out. If
+%% `Handlers' is the empty list, and `After' is
+%% nonempty, the `catch ...' section is left out.
%%
%% @see try_expr_body/1
%% @see try_expr_clauses/1
@@ -5834,10 +5374,7 @@ revert_try_expr(Node) ->
%% =====================================================================
-%% @spec try_expr_body(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the list of body subtrees of a <code>try_expr</code>
-%% node.
+%% @doc Returns the list of body subtrees of a `try_expr' node.
%%
%% @see try_expr/4
@@ -5853,10 +5390,8 @@ try_expr_body(Node) ->
%% =====================================================================
-%% @spec try_expr_clauses(Node::syntaxTree()) -> [syntaxTree()]
-%%
%% @doc Returns the list of case-clause subtrees of a
-%% <code>try_expr</code> node. If <code>Node</code> represents
+%% `try_expr' node. If `Node' represents
%% "<code>try <em>Body</em> catch <em>H1</em>; ...; <em>Hn</em>
%% end</code>", the result is the empty list.
%%
@@ -5874,10 +5409,8 @@ try_expr_clauses(Node) ->
%% =====================================================================
-%% @spec try_expr_handlers(syntaxTree()) -> [syntaxTree()]
-%%
%% @doc Returns the list of handler-clause subtrees of a
-%% <code>try_expr</code> node.
+%% `try_expr' node.
%%
%% @see try_expr/4
@@ -5893,10 +5426,7 @@ try_expr_handlers(Node) ->
%% =====================================================================
-%% @spec try_expr_after(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the list of "after" subtrees of a <code>try_expr</code>
-%% node.
+%% @doc Returns the list of "after" subtrees of a `try_expr' node.
%%
%% @see try_expr/4
@@ -5912,9 +5442,6 @@ try_expr_after(Node) ->
%% =====================================================================
-%% @spec class_qualifier(Class::syntaxTree(), Body::syntaxTree()) ->
-%% syntaxTree()
-%%
%% @doc Creates an abstract class qualifier. The result represents
%% "<code><em>Class</em>:<em>Body</em></code>".
%%
@@ -5937,10 +5464,8 @@ class_qualifier(Class, Body) ->
%% =====================================================================
-%% @spec class_qualifier_argument(syntaxTree()) -> syntaxTree()
-%%
%% @doc Returns the argument (the class) subtree of a
-%% <code>class_qualifier</code> node.
+%% `class_qualifier' node.
%%
%% @see class_qualifier/2
@@ -5951,9 +5476,7 @@ class_qualifier_argument(Node) ->
%% =====================================================================
-%% @spec class_qualifier_body(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the body subtree of a <code>class_qualifier</code> node.
+%% @doc Returns the body subtree of a `class_qualifier' node.
%%
%% @see class_qualifier/2
@@ -5964,13 +5487,10 @@ class_qualifier_body(Node) ->
%% =====================================================================
-%% @spec implicit_fun(Name::syntaxTree(), Arity::syntaxTree()) ->
-%% syntaxTree()
-%%
%% @doc Creates an abstract "implicit fun" expression. If
-%% <code>Arity</code> is <code>none</code>, this is equivalent to
-%% <code>implicit_fun(Name)</code>, otherwise it is equivalent to
-%% <code>implicit_fun(arity_qualifier(Name, Arity))</code>.
+%% `Arity' is `none', this is equivalent to
+%% `implicit_fun(Name)', otherwise it is equivalent to
+%% `implicit_fun(arity_qualifier(Name, Arity))'.
%%
%% (This is a utility function.)
%%
@@ -5986,14 +5506,11 @@ implicit_fun(Name, Arity) ->
%% =====================================================================
-%% @spec implicit_fun(Module::syntaxTree(), Name::syntaxTree(),
-%% Arity::syntaxTree()) -> syntaxTree()
-%%
%% @doc Creates an abstract module-qualified "implicit fun" expression.
-%% If <code>Module</code> is <code>none</code>, this is equivalent to
-%% <code>implicit_fun(Name, Arity)</code>, otherwise it is equivalent to
-%% <code>implicit_fun(module_qualifier(Module, arity_qualifier(Name,
-%% Arity))</code>.
+%% If `Module' is `none', this is equivalent to
+%% `implicit_fun(Name, Arity)', otherwise it is equivalent to
+%% `implicit_fun(module_qualifier(Module, arity_qualifier(Name,
+%% Arity))'.
%%
%% (This is a utility function.)
%%
@@ -6010,10 +5527,8 @@ implicit_fun(Module, Name, Arity) ->
%% =====================================================================
-%% @spec implicit_fun(Name::syntaxTree()) -> syntaxTree()
-%%
%% @doc Creates an abstract "implicit fun" expression. The result
-%% represents "<code>fun <em>Name</em></code>". <code>Name</code> should
+%% represents "<code>fun <em>Name</em></code>". `Name' should
%% represent either <code><em>F</em>/<em>A</em></code> or
%% <code><em>M</em>:<em>F</em>/<em>A</em></code>
%%
@@ -6072,15 +5587,13 @@ revert_implicit_fun(Node) ->
%% =====================================================================
-%% @spec implicit_fun_name(Node::syntaxTree()) -> syntaxTree()
+%% @doc Returns the name subtree of an `implicit_fun' node.
%%
-%% @doc Returns the name subtree of an <code>implicit_fun</code> node.
-%%
-%% <p>Note: if <code>Node</code> represents "<code>fun
+%% Note: if `Node' represents "<code>fun
%% <em>N</em>/<em>A</em></code>" or "<code>fun
%% <em>M</em>:<em>N</em>/<em>A</em></code>", then the result is the
%% subtree representing "<code><em>N</em>/<em>A</em></code>" or
-%% "<code><em>M</em>:<em>N</em>/<em>A</em></code>", respectively.</p>
+%% "<code><em>M</em>:<em>N</em>/<em>A</em></code>", respectively.
%%
%% @see implicit_fun/1
%% @see arity_qualifier/2
@@ -6110,12 +5623,10 @@ implicit_fun_name(Node) ->
%% =====================================================================
-%% @spec fun_expr(Clauses::[syntaxTree()]) -> syntaxTree()
-%%
-%% @doc Creates an abstract fun-expression. If <code>Clauses</code> is
-%% <code>[C1, ..., Cn]</code>, the result represents "<code>fun
+%% @doc Creates an abstract fun-expression. If `Clauses' is
+%% `[C1, ..., Cn]', the result represents "<code>fun
%% <em>C1</em>; ...; <em>Cn</em> end</code>". More exactly, if each
-%% <code>Ci</code> represents "<code>(<em>Pi1</em>, ..., <em>Pim</em>)
+%% `Ci' represents "<code>(<em>Pi1</em>, ..., <em>Pim</em>)
%% <em>Gi</em> -> <em>Bi</em></code>", then the result represents
%% "<code>fun (<em>P11</em>, ..., <em>P1m</em>) <em>G1</em> ->
%% <em>B1</em>; ...; (<em>Pn1</em>, ..., <em>Pnm</em>) <em>Gn</em> ->
@@ -6152,10 +5663,7 @@ revert_fun_expr(Node) ->
%% =====================================================================
-%% @spec fun_expr_clauses(syntaxTree()) -> [syntaxTree()]
-%%
-%% @doc Returns the list of clause subtrees of a <code>fun_expr</code>
-%% node.
+%% @doc Returns the list of clause subtrees of a `fun_expr' node.
%%
%% @see fun_expr/1
@@ -6171,16 +5679,14 @@ fun_expr_clauses(Node) ->
%% =====================================================================
-%% @spec fun_expr_arity(syntaxTree()) -> integer()
-%%
-%% @doc Returns the arity of a <code>fun_expr</code> node. The result is
+%% @doc Returns the arity of a `fun_expr' node. The result is
%% the number of parameter patterns in the first clause of the
%% fun-expression; subsequent clauses are ignored.
%%
-%% <p>An exception is thrown if <code>fun_expr_clauses(Node)</code>
+%% An exception is thrown if `fun_expr_clauses(Node)'
%% returns an empty list, or if the first element of that list is not a
-%% syntax tree <code>C</code> of type <code>clause</code> such that
-%% <code>clause_patterns(C)</code> is a nonempty list.</p>
+%% syntax tree `C' of type `clause' such that
+%% `clause_patterns(C)' is a nonempty list.
%%
%% @see fun_expr/1
%% @see fun_expr_clauses/1
@@ -6194,8 +5700,6 @@ fun_expr_arity(Node) ->
%% =====================================================================
-%% @spec parentheses(Body::syntaxTree()) -> syntaxTree()
-%%
%% @doc Creates an abstract parenthesised expression. The result
%% represents "<code>(<em>Body</em>)</code>", independently of the
%% context.
@@ -6215,9 +5719,7 @@ revert_parentheses(Node) ->
%% =====================================================================
-%% @spec parentheses_body(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the body subtree of a <code>parentheses</code> node.
+%% @doc Returns the body subtree of a `parentheses' node.
%%
%% @see parentheses/1
@@ -6228,7 +5730,6 @@ parentheses_body(Node) ->
%% =====================================================================
-%% @spec macro(Name) -> syntaxTree()
%% @equiv macro(Name, none)
-spec macro(syntaxTree()) -> syntaxTree().
@@ -6238,25 +5739,22 @@ macro(Name) ->
%% =====================================================================
-%% @spec macro(Name::syntaxTree(), Arguments) -> syntaxTree()
-%% Arguments = none | [syntaxTree()]
-%%
-%% @doc Creates an abstract macro application. If <code>Arguments</code>
-%% is <code>none</code>, the result represents
-%% "<code>?<em>Name</em></code>", otherwise, if <code>Arguments</code>
-%% is <code>[A1, ..., An]</code>, the result represents
+%% @doc Creates an abstract macro application. If `Arguments'
+%% is `none', the result represents
+%% "<code>?<em>Name</em></code>", otherwise, if `Arguments'
+%% is `[A1, ..., An]', the result represents
%% "<code>?<em>Name</em>(<em>A1</em>, ..., <em>An</em>)</code>".
%%
-%% <p>Notes: if <code>Arguments</code> is the empty list, the result
+%% Notes: if `Arguments' is the empty list, the result
%% will thus represent "<code>?<em>Name</em>()</code>", including a pair
-%% of matching parentheses.</p>
+%% of matching parentheses.
%%
-%% <p>The only syntactical limitation imposed by the preprocessor on the
+%% The only syntactical limitation imposed by the preprocessor on the
%% arguments to a macro application (viewed as sequences of tokens) is
%% that they must be balanced with respect to parentheses, brackets,
-%% <code>begin ... end</code>, <code>case ... end</code>, etc. The
-%% <code>text</code> node type can be used to represent arguments which
-%% are not regular Erlang constructs.</p>
+%% `begin ... end', `case ... end', etc. The
+%% `text' node type can be used to represent arguments which
+%% are not regular Erlang constructs.
%%
%% @see macro_name/1
%% @see macro_arguments/1
@@ -6278,9 +5776,7 @@ macro(Name, Arguments) ->
%% =====================================================================
-%% @spec macro_name(syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns the name subtree of a <code>macro</code> node.
+%% @doc Returns the name subtree of a `macro' node.
%%
%% @see macro/2
@@ -6291,14 +5787,12 @@ macro_name(Node) ->
%% =====================================================================
-%% @spec macro_arguments(Node::syntaxTree()) -> none | [syntaxTree()]
-%%
-%% @doc Returns the list of argument subtrees of a <code>macro</code>
-%% node, if any. If <code>Node</code> represents
-%% "<code>?<em>Name</em></code>", <code>none</code> is returned.
-%% Otherwise, if <code>Node</code> represents
+%% @doc Returns the list of argument subtrees of a `macro'
+%% node, if any. If `Node' represents
+%% "<code>?<em>Name</em></code>", `none' is returned.
+%% Otherwise, if `Node' represents
%% "<code>?<em>Name</em>(<em>A1</em>, ..., <em>An</em>)</code>",
-%% <code>[A1, ..., An]</code> is returned.
+%% `[A1, ..., An]' is returned.
%%
%% @see macro/2
@@ -6309,15 +5803,13 @@ macro_arguments(Node) ->
%% =====================================================================
-%% @spec abstract(Term::term()) -> syntaxTree()
-%%
%% @doc Returns the syntax tree corresponding to an Erlang term.
-%% <code>Term</code> must be a literal term, i.e., one that can be
+%% `Term' must be a literal term, i.e., one that can be
%% represented as a source code literal. Thus, it may not contain a
%% process identifier, port, reference, binary or function value as a
%% subterm. The function recognises printable strings, in order to get a
%% compact and readable representation. Evaluation fails with reason
-%% <code>badarg</code> if <code>Term</code> is not a literal term.
+%% `badarg' if `Term' is not a literal term.
%%
%% @see concrete/1
%% @see is_literal/1
@@ -6367,19 +5859,17 @@ abstract_tail(H, T) ->
%% =====================================================================
-%% @spec concrete(Node::syntaxTree()) -> term()
-%%
%% @doc Returns the Erlang term represented by a syntax tree. Evaluation
-%% fails with reason <code>badarg</code> if <code>Node</code> does not
+%% fails with reason `badarg' if `Node' does not
%% represent a literal term.
%%
-%% <p>Note: Currently, the set of syntax trees which have a concrete
+%% Note: Currently, the set of syntax trees which have a concrete
%% representation is larger than the set of trees which can be built
-%% using the function <code>abstract/1</code>. An abstract character
-%% will be concretised as an integer, while <code>abstract/1</code> does
+%% using the function {@link abstract/1}. An abstract character
+%% will be concretised as an integer, while {@link abstract/1} does
%% not at present yield an abstract character for any input. (Use the
-%% <code>char/1</code> function to explicitly create an abstract
-%% character.)</p>
+%% {@link char/1} function to explicitly create an abstract
+%% character.)
%%
%% @see abstract/1
%% @see is_literal/1
@@ -6422,7 +5912,7 @@ concrete(Node) ->
{value, concrete(F), []}
end, [], true),
B;
- _ ->
+ _ ->
erlang:error({badarg, Node})
end.
@@ -6433,12 +5923,10 @@ concrete_list([]) ->
%% =====================================================================
-%% @spec is_literal(Node::syntaxTree()) -> boolean()
-%%
-%% @doc Returns <code>true</code> if <code>Node</code> represents a
-%% literal term, otherwise <code>false</code>. This function returns
-%% <code>true</code> if and only if the value of
-%% <code>concrete(Node)</code> is defined.
+%% @doc Returns `true' if `Node' represents a
+%% literal term, otherwise `false'. This function returns
+%% `true' if and only if the value of
+%% `concrete(Node)' is defined.
%%
%% @see abstract/1
%% @see concrete/1
@@ -6469,21 +5957,19 @@ is_literal(T) ->
%% =====================================================================
-%% @spec revert(Tree::syntaxTree()) -> syntaxTree()
-%%
-%% @doc Returns an <code>erl_parse</code>-compatible representation of a
-%% syntax tree, if possible. If <code>Tree</code> represents a
+%% @doc Returns an `erl_parse'-compatible representation of a
+%% syntax tree, if possible. If `Tree' represents a
%% well-formed Erlang program or expression, the conversion should work
-%% without problems. Typically, <code>is_tree/1</code> yields
-%% <code>true</code> if conversion failed (i.e., the result is still an
-%% abstract syntax tree), and <code>false</code> otherwise.
+%% without problems. Typically, {@link is_tree/1} yields
+%% `true' if conversion failed (i.e., the result is still an
+%% abstract syntax tree), and `false' otherwise.
%%
-%% <p>The <code>is_tree/1</code> test is not completely foolproof. For a
-%% few special node types (e.g. <code>arity_qualifier</code>), if such a
+%% The {@link is_tree/1} test is not completely foolproof. For a
+%% few special node types (e.g. `arity_qualifier'), if such a
%% node occurs in a context where it is not expected, it will be left
%% unchanged as a non-reverted subtree of the result. This can only
-%% happen if <code>Tree</code> does not actually represent legal Erlang
-%% code.</p>
+%% happen if `Tree' does not actually represent legal Erlang
+%% code.
%%
%% @see revert_forms/1
%% @see //stdlib/erl_parse
@@ -6615,16 +6101,12 @@ revert_root(Node) ->
%% =====================================================================
-%% @spec revert_forms(Forms) -> [erl_parse()]
-%%
-%% Forms = syntaxTree() | [syntaxTree()]
-%%
%% @doc Reverts a sequence of Erlang source code forms. The sequence can
-%% be given either as a <code>form_list</code> syntax tree (possibly
+%% be given either as a `form_list' syntax tree (possibly
%% nested), or as a list of "program form" syntax trees. If successful,
-%% the corresponding flat list of <code>erl_parse</code>-compatible
-%% syntax trees is returned (cf. <code>revert/1</code>). If some program
-%% form could not be reverted, <code>{error, Form}</code> is thrown.
+%% the corresponding flat list of `erl_parse'-compatible
+%% syntax trees is returned (see {@link revert/1}). If some program
+%% form could not be reverted, `{error, Form}' is thrown.
%% Standalone comments in the form sequence are discarded.
%%
%% @see revert/1
@@ -6633,10 +6115,10 @@ revert_root(Node) ->
-type forms() :: syntaxTree() | [syntaxTree()].
-%% -spec revert_forms(forms()) -> [erl_parse()].
+-spec revert_forms(forms()) -> [erl_parse()].
-revert_forms(L) when is_list(L) ->
- revert_forms(form_list(L));
+revert_forms(Forms) when is_list(Forms) ->
+ revert_forms(form_list(Forms));
revert_forms(T) ->
case type(T) of
form_list ->
@@ -6673,60 +6155,54 @@ revert_forms_1([]) ->
%% =====================================================================
-%% @spec subtrees(Node::syntaxTree()) -> [[syntaxTree()]]
-%%
%% @doc Returns the grouped list of all subtrees of a syntax tree. If
-%% <code>Node</code> is a leaf node (cf. <code>is_leaf/1</code>), this
+%% `Node' is a leaf node (see {@link is_leaf/1}), this
%% is the empty list, otherwise the result is always a nonempty list,
-%% containing the lists of subtrees of <code>Node</code>, in
+%% containing the lists of subtrees of `Node', in
%% left-to-right order as they occur in the printed program text, and
%% grouped by category. Often, each group contains only a single
%% subtree.
%%
-%% <p>Depending on the type of <code>Node</code>, the size of some
+%% Depending on the type of `Node', the size of some
%% groups may be variable (e.g., the group consisting of all the
%% elements of a tuple), while others always contain the same number of
%% elements - usually exactly one (e.g., the group containing the
%% argument expression of a case-expression). Note, however, that the
%% exact structure of the returned list (for a given node type) should
%% in general not be depended upon, since it might be subject to change
-%% without notice.</p>
+%% without notice.
%%
-%% <p>The function <code>subtrees/1</code> and the constructor functions
-%% <code>make_tree/2</code> and <code>update_tree/2</code> can be a
+%% The function {@link subtrees/1} and the constructor functions
+%% {@link make_tree/2} and {@link update_tree/2} can be a
%% great help if one wants to traverse a syntax tree, visiting all its
%% subtrees, but treat nodes of the tree in a uniform way in most or all
%% cases. Using these functions makes this simple, and also assures that
%% your code is not overly sensitive to extensions of the syntax tree
%% data type, because any node types not explicitly handled by your code
-%% can be left to a default case.</p>
+%% can be left to a default case.
%%
-%% <p>For example:
-%% <pre>
-%% postorder(F, Tree) ->
+%% For example:
+%% ```postorder(F, Tree) ->
%% F(case subtrees(Tree) of
%% [] -> Tree;
%% List -> update_tree(Tree,
%% [[postorder(F, Subtree)
%% || Subtree &lt;- Group]
%% || Group &lt;- List])
-%% end).
-%% </pre>
-%% maps the function <code>F</code> on <code>Tree</code> and all its
+%% end).'''
+%% maps the function `F' on `Tree' and all its
%% subtrees, doing a post-order traversal of the syntax tree. (Note the
-%% use of <code>update_tree/2</code> to preserve node attributes.) For a
+%% use of {@link update_tree/2} to preserve node attributes.) For a
%% simple function like:
-%% <pre>
-%% f(Node) ->
+%% ```f(Node) ->
%% case type(Node) of
%% atom -> atom("a_" ++ atom_name(Node));
%% _ -> Node
-%% end.
-%% </pre>
-%% the call <code>postorder(fun f/1, Tree)</code> will yield a new
-%% representation of <code>Tree</code> in which all atom names have been
+%% end.'''
+%% the call `postorder(fun f/1, Tree)' will yield a new
+%% representation of `Tree' in which all atom names have been
%% extended with the prefix "a_", but nothing else (including comments,
-%% annotations and line numbers) has been changed.</p>
+%% annotations and line numbers) has been changed.
%%
%% @see make_tree/2
%% @see type/1
@@ -6896,12 +6372,9 @@ subtrees(T) ->
%% =====================================================================
-%% @spec update_tree(Node::syntaxTree(), Groups::[[syntaxTree()]]) ->
-%% syntaxTree()
-%%
%% @doc Creates a syntax tree with the same type and attributes as the
-%% given tree. This is equivalent to <code>copy_attrs(Node,
-%% make_tree(type(Node), Groups))</code>.
+%% given tree. This is equivalent to `copy_attrs(Node,
+%% make_tree(type(Node), Groups))'.
%%
%% @see make_tree/2
%% @see copy_attrs/2
@@ -6914,23 +6387,20 @@ update_tree(Node, Groups) ->
%% =====================================================================
-%% @spec make_tree(Type::atom(), Groups::[[syntaxTree()]]) ->
-%% syntaxTree()
-%%
%% @doc Creates a syntax tree with the given type and subtrees.
-%% <code>Type</code> must be a node type name (cf. <code>type/1</code>)
-%% that does not denote a leaf node type (cf. <code>is_leaf/1</code>).
-%% <code>Groups</code> must be a <em>nonempty</em> list of groups of
+%% `Type' must be a node type name (see {@link type/1})
+%% that does not denote a leaf node type (see {@link is_leaf/1}).
+%% `Groups' must be a <em>nonempty</em> list of groups of
%% syntax trees, representing the subtrees of a node of the given type,
%% in left-to-right order as they would occur in the printed program
-%% text, grouped by category as done by <code>subtrees/1</code>.
+%% text, grouped by category as done by {@link subtrees/1}.
%%
-%% <p>The result of <code>copy_attrs(Node, make_tree(type(Node),
-%% subtrees(Node)))</code> (cf. <code>update_tree/2</code>) represents
-%% the same source code text as the original <code>Node</code>, assuming
-%% that <code>subtrees(Node)</code> yields a nonempty list. However, it
+%% The result of `copy_attrs(Node, make_tree(type(Node),
+%% subtrees(Node)))' (see {@link update_tree/2}) represents
+%% the same source code text as the original `Node', assuming
+%% that `subtrees(Node)' yields a nonempty list. However, it
%% does not necessarily have the same data representation as
-%% <code>Node</code>.</p>
+%% `Node'.
%%
%% @see update_tree/2
%% @see subtrees/1
@@ -6995,42 +6465,40 @@ make_tree(tuple, [E]) -> tuple(E).
%% =====================================================================
-%% @spec meta(Tree::syntaxTree()) -> syntaxTree()
-%%
%% @doc Creates a meta-representation of a syntax tree. The result
%% represents an Erlang expression "<code><em>MetaTree</em></code>"
%% which, if evaluated, will yield a new syntax tree representing the
-%% same source code text as <code>Tree</code> (although the actual data
+%% same source code text as `Tree' (although the actual data
%% representation may be different). The expression represented by
-%% <code>MetaTree</code> is <em>implementation independent</em> with
+%% `MetaTree' is <em>implementation independent</em> with
%% regard to the data structures used by the abstract syntax tree
-%% implementation. Comments attached to nodes of <code>Tree</code> will
+%% implementation. Comments attached to nodes of `Tree' will
%% be preserved, but other attributes are lost.
%%
-%% <p>Any node in <code>Tree</code> whose node type is
-%% <code>variable</code> (cf. <code>type/1</code>), and whose list of
-%% annotations (cf. <code>get_ann/1</code>) contains the atom
-%% <code>meta_var</code>, will remain unchanged in the resulting tree,
-%% except that exactly one occurrence of <code>meta_var</code> is
-%% removed from its annotation list.</p>
+%% Any node in `Tree' whose node type is
+%% `variable' (see {@link type/1}), and whose list of
+%% annotations (see {@link get_ann/1}) contains the atom
+%% `meta_var', will remain unchanged in the resulting tree,
+%% except that exactly one occurrence of `meta_var' is
+%% removed from its annotation list.
%%
-%% <p>The main use of the function <code>meta/1</code> is to transform a
-%% data structure <code>Tree</code>, which represents a piece of program
+%% The main use of the function `meta/1' is to transform a
+%% data structure `Tree', which represents a piece of program
%% code, into a form that is <em>representation independent when
-%% printed</em>. E.g., suppose <code>Tree</code> represents a variable
-%% named "V". Then (assuming a function <code>print/1</code> for
-%% printing syntax trees), evaluating <code>print(abstract(Tree))</code>
-%% - simply using <code>abstract/1</code> to map the actual data
+%% printed</em>. E.g., suppose `Tree' represents a variable
+%% named "V". Then (assuming a function `print/1' for
+%% printing syntax trees), evaluating `print(abstract(Tree))'
+%% - simply using {@link abstract/1} to map the actual data
%% structure onto a syntax tree representation - would output a string
-%% that might look something like "<code>{tree, variable, ..., "V",
-%% ...}</code>", which is obviously dependent on the implementation of
+%% that might look something like "`{tree, variable, ..., "V",
+%% ...}'", which is obviously dependent on the implementation of
%% the abstract syntax trees. This could e.g. be useful for caching a
%% syntax tree in a file. However, in some situations like in a program
%% generator generator (with two "generator"), it may be unacceptable.
-%% Using <code>print(meta(Tree))</code> instead would output a
+%% Using `print(meta(Tree))' instead would output a
%% <em>representation independent</em> syntax tree generating
%% expression; in the above case, something like
-%% "<code>erl_syntax:variable("V")</code>".</p>
+%% "`erl_syntax:variable("V")'".
%%
%% @see abstract/1
%% @see type/1
@@ -7161,60 +6629,56 @@ meta_call(F, As) ->
%% =====================================================================
-%% @spec tree(Type) -> syntaxTree()
%% @equiv tree(Type, [])
--spec tree(atom()) -> syntaxTree().
+-spec tree(atom()) -> #tree{}.
tree(Type) ->
tree(Type, []).
%% =====================================================================
-%% @spec tree(Type::atom(), Data::term()) -> syntaxTree()
-%%
%% @doc <em>For special purposes only</em>. Creates an abstract syntax
-%% tree node with type tag <code>Type</code> and associated data
-%% <code>Data</code>.
+%% tree node with type tag `Type' and associated data
+%% `Data'.
%%
-%% <p>This function and the related <code>is_tree/1</code> and
-%% <code>data/1</code> provide a uniform way to extend the set of
-%% <code>erl_parse</code> node types. The associated data is any term,
-%% whose format may depend on the type tag.</p>
+%% This function and the related {@link is_tree/1} and
+%% {@link data/1} provide a uniform way to extend the set of
+%% `erl_parse' node types. The associated data is any term,
+%% whose format may depend on the type tag.
%%
-%% <h4>Notes:</h4>
+%% === Notes: ===
%% <ul>
%% <li>Any nodes created outside of this module must have type tags
%% distinct from those currently defined by this module; see
-%% <code>type/1</code> for a complete list.</li>
+%% {@link type/1} for a complete list.</li>
%% <li>The type tag of a syntax tree node may also be used
-%% as a primary tag by the <code>erl_parse</code> representation;
+%% as a primary tag by the `erl_parse' representation;
%% in that case, the selector functions for that node type
%% <em>must</em> handle both the abstract syntax tree and the
-%% <code>erl_parse</code> form. The function <code>type(T)</code>
+%% `erl_parse' form. The function `type(T)'
%% should return the correct type tag regardless of the
-%% representation of <code>T</code>, so that the user sees no
-%% difference between <code>erl_syntax</code> and
-%% <code>erl_parse</code> nodes.</li>
+%% representation of `T', so that the user sees no
+%% difference between `erl_syntax' and
+%% `erl_parse' nodes.</li>
%% </ul>
+%%
%% @see is_tree/1
%% @see data/1
%% @see type/1
--spec tree(atom(), term()) -> syntaxTree().
+-spec tree(atom(), term()) -> #tree{}.
tree(Type, Data) ->
#tree{type = Type, data = Data}.
%% =====================================================================
-%% @spec is_tree(Tree::syntaxTree()) -> boolean()
-%%
-%% @doc <em>For special purposes only</em>. Returns <code>true</code> if
-%% <code>Tree</code> is an abstract syntax tree and <code>false</code>
+%% @doc <em>For special purposes only</em>. Returns `true' if
+%% `Tree' is an abstract syntax tree and `false'
%% otherwise.
%%
-%% <p><em>Note</em>: this function yields <code>false</code> for all
-%% "old-style" <code>erl_parse</code>-compatible "parse trees".</p>
+%% <em>Note</em>: this function yields `false' for all
+%% "old-style" `erl_parse'-compatible "parse trees".
%%
%% @see tree/2
@@ -7227,12 +6691,10 @@ is_tree(_) ->
%% =====================================================================
-%% @spec data(Tree::syntaxTree()) -> term()
-%%
%% @doc <em>For special purposes only</em>. Returns the associated data
%% of a syntax tree node. Evaluation fails with reason
-%% <code>badarg</code> if <code>is_tree(Node)</code> does not yield
-%% <code>true</code>.
+%% `badarg' if `is_tree(Node)' does not yield
+%% `true'.
%%
%% @see tree/2
@@ -7248,26 +6710,19 @@ data(T) -> erlang:error({badarg, T}).
%% =====================================================================
-%% @spec wrap(Node::erl_parse()) -> syntaxTree()
-%%
-%% @type erl_parse() = erl_parse:parse_tree(). The "parse tree"
-%% representation built by the Erlang standard library parser
-%% <code>erl_parse</code>. This is a subset of the
-%% <a href="#type-syntaxTree"><code>syntaxTree</code></a> type.
-%%
-%% @doc Creates a wrapper structure around an <code>erl_parse</code>
+%% @doc Creates a wrapper structure around an `erl_parse'
%% "parse tree".
%%
-%% <p>This function and the related <code>unwrap/1</code> and
-%% <code>is_wrapper/1</code> provide a uniform way to attach arbitrary
-%% information to an <code>erl_parse</code> tree. Some information about
+%% This function and the related {@link unwrap/1} and
+%% {@link is_wrapper/1} provide a uniform way to attach arbitrary
+%% information to an `erl_parse' tree. Some information about
%% the encapsuled tree may be cached in the wrapper, such as the node
%% type. All functions on syntax trees must behave so that the user sees
-%% no difference between wrapped and non-wrapped <code>erl_parse</code>
+%% no difference between wrapped and non-wrapped `erl_parse'
%% trees. <em>Attaching a wrapper onto another wrapper structure is an
-%% error</em>.</p>
+%% error</em>.
-%%-spec wrap(erl_parse:parse_tree()) -> syntaxTree().
+-spec wrap(erl_parse()) -> #wrapper{}.
wrap(Node) ->
%% We assume that Node is an old-school `erl_parse' tree.
@@ -7276,24 +6731,20 @@ wrap(Node) ->
%% =====================================================================
-%% @spec unwrap(Node::syntaxTree()) -> syntaxTree()
-%%
-%% @doc Removes any wrapper structure, if present. If <code>Node</code>
+%% @doc Removes any wrapper structure, if present. If `Node'
%% is a wrapper structure, this function returns the wrapped
-%% <code>erl_parse</code> tree; otherwise it returns <code>Node</code>
+%% `erl_parse' tree; otherwise it returns `Node'
%% itself.
--spec unwrap(syntaxTree()) -> syntaxTree().
+-spec unwrap(syntaxTree()) -> #tree{} | erl_parse().
unwrap(#wrapper{tree = Node}) -> Node;
unwrap(Node) -> Node. % This could also be a new-form node.
%% =====================================================================
-%% @spec is_wrapper(Term::term()) -> boolean()
-%%
-%% @doc Returns <code>true</code> if the argument is a wrapper
-%% structure, otherwise <code>false</code>.
+%% @doc Returns `true' if the argument is a wrapper
+%% structure, otherwise `false'.
-ifndef(NO_UNUSED).
-spec is_wrapper(term()) -> boolean().
diff --git a/lib/syntax_tools/src/erl_syntax_lib.erl b/lib/syntax_tools/src/erl_syntax_lib.erl
index 97dfbfd7cd..36cd35f15d 100644
--- a/lib/syntax_tools/src/erl_syntax_lib.erl
+++ b/lib/syntax_tools/src/erl_syntax_lib.erl
@@ -14,10 +14,8 @@
%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
%% USA
%%
-%% $Id$
-%%
%% @copyright 1997-2006 Richard Carlsson
-%% @author Richard Carlsson <[email protected]>
+%% @author Richard Carlsson <[email protected]>
%% @end
%% =====================================================================
diff --git a/lib/syntax_tools/src/erl_tidy.erl b/lib/syntax_tools/src/erl_tidy.erl
index 09efc9c392..59cf6c0a92 100644
--- a/lib/syntax_tools/src/erl_tidy.erl
+++ b/lib/syntax_tools/src/erl_tidy.erl
@@ -14,10 +14,8 @@
%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
%% USA
%%
-%% $Id$
-%%
%% @copyright 1999-2006 Richard Carlsson
-%% @author Richard Carlsson <[email protected]>
+%% @author Richard Carlsson <[email protected]>
%% @end
%% =====================================================================
diff --git a/lib/syntax_tools/src/igor.erl b/lib/syntax_tools/src/igor.erl
index aa933eb54b..37e561cbbe 100644
--- a/lib/syntax_tools/src/igor.erl
+++ b/lib/syntax_tools/src/igor.erl
@@ -14,10 +14,8 @@
%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
%% USA
%%
-%% $Id$
-%%
%% @copyright 1998-2006 Richard Carlsson
-%% @author Richard Carlsson <[email protected]>
+%% @author Richard Carlsson <[email protected]>
%% @end
%% =====================================================================
diff --git a/lib/syntax_tools/src/prettypr.erl b/lib/syntax_tools/src/prettypr.erl
index c13fa30998..1b5ba6b05a 100644
--- a/lib/syntax_tools/src/prettypr.erl
+++ b/lib/syntax_tools/src/prettypr.erl
@@ -14,10 +14,8 @@
%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
%% USA
%%
-%% $Id$
-%%
%% @copyright 2000-2006 Richard Carlsson
-%% @author Richard Carlsson <[email protected]>
+%% @author Richard Carlsson <[email protected]>
%% @end
%% =====================================================================
diff --git a/lib/syntax_tools/test/Makefile b/lib/syntax_tools/test/Makefile
index 3e31bdbd50..d4733b9a42 100644
--- a/lib/syntax_tools/test/Makefile
+++ b/lib/syntax_tools/test/Makefile
@@ -57,9 +57,9 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(EMAKEFILE) $(ERL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) syntax_tools.spec syntax_tools.cover $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(EMAKEFILE) $(ERL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) syntax_tools.spec syntax_tools.cover "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
release_docs_spec:
diff --git a/lib/syntax_tools/vsn.mk b/lib/syntax_tools/vsn.mk
index 962492befd..8f774c5d75 100644
--- a/lib/syntax_tools/vsn.mk
+++ b/lib/syntax_tools/vsn.mk
@@ -1 +1 @@
-SYNTAX_TOOLS_VSN = 1.6.7.2
+SYNTAX_TOOLS_VSN = 1.6.9
diff --git a/lib/test_server/doc/src/Makefile b/lib/test_server/doc/src/Makefile
index b32f3d3c59..8c7fa99886 100644
--- a/lib/test_server/doc/src/Makefile
+++ b/lib/test_server/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2012. 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
@@ -119,16 +119,16 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3_FILES) $(RELEASE_PATH)/man/man3
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man6
- $(INSTALL_DATA) $(MAN6_FILES) $(RELEASE_PATH)/man/man6
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3_FILES) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man6"
+ $(INSTALL_DATA) $(MAN6_FILES) "$(RELEASE_PATH)/man/man6"
release_spec:
diff --git a/lib/test_server/doc/src/notes.xml b/lib/test_server/doc/src/notes.xml
index d90ad2c4ed..3b109193a0 100644
--- a/lib/test_server/doc/src/notes.xml
+++ b/lib/test_server/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -32,6 +32,227 @@
<file>notes.xml</file>
</header>
+<section><title>Test_Server 3.5.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ The documentation has been updated with the latest
+ changes for the test_server_ctrl:report/2 function.</p>
+ <p>
+ Own Id: OTP-10086 Aux Id: seq12066 </p>
+ </item>
+ <item>
+ <p>
+ The ct:get_status/0 function failed to report status if a
+ parallel test case group was running at the time of the
+ call. This has been fixed and the return value for the
+ function has been updated. Please see the ct reference
+ manual for details.</p>
+ <p>
+ Own Id: OTP-10172</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ It is now possible to sort the HTML tables by clicking on
+ the header elements. In order to reset a sorted table,
+ the browser window should simply be refreshed. This
+ feature requires that the browser supports javascript,
+ and has javascript execution enabled. If the 'ct_run
+ -basic_html' flag is used, no javascript code is included
+ in the generated HTML code.</p>
+ <p>
+ Own Id: OTP-9896 Aux Id: seq12034, OTP-9835 </p>
+ </item>
+ <item>
+ <p>
+ Verbosity levels for log printouts has been added. This
+ makes it possible to specify preferred verbosity for
+ different categories of log printouts, as well as general
+ printouts (such as standard IO), to allow control over
+ which strings get printed and which get ignored. New
+ versions of the Common Test logging functions, ct:log,
+ ct:pal and ct:print, have been introduced, with a new
+ Importance argument added. The Importance value is
+ compared to the verbosity level at runtime. More
+ information can be found in the chapter about Logging in
+ the Common Test User's Guide.</p>
+ <p>
+ Own Id: OTP-10067 Aux Id: seq12050 </p>
+ </item>
+ <item>
+ <p>
+ The Erlang/OTP test runner ts has been extended to allow
+ cross compilation of test suites. To cross compile the
+ test suites first follow the normal cross compilation
+ procedures and release the tests on the build host. Then
+ install ts using an xcomp specification file and compile
+ test suites using ts:compile_testcases/0. For more
+ details see $ERL_TOP/xcomp/README.md.</p>
+ <p>
+ Own Id: OTP-10074</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Test_Server 3.5.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ After a test case timeout or abortion, the
+ end_per_testcase function executes on a new dedicated
+ process. The group leader for this process should be set
+ to the IO server for the test case, which was not done
+ properly. The result of this error was that no warnings
+ about end_per_testcase failing or timing out were ever
+ printed in the test case log. Also, help functions such
+ as e.g. test_server:stop_node/1, attempting to
+ synchronize with the IO server, would hang. The fault has
+ been corrected.</p>
+ <p>
+ Own Id: OTP-9666</p>
+ </item>
+ <item>
+ <p>
+ A deadlock situation could occur if Common Test is
+ forwarding error_handler printouts to Test Server at the
+ same time a new test case is starting. This error has
+ been fixed.</p>
+ <p>
+ Own Id: OTP-9894</p>
+ </item>
+ <item>
+ <p>
+ When a test case was killed because of a timetrap
+ timeout, the current location (suite, case and line) was
+ not printed correctly in the log files. This has been
+ corrected.</p>
+ <p>
+ Own Id: OTP-9930 Aux Id: seq12002 </p>
+ </item>
+ <item>
+ <p>
+ Test Server and Common Test would add new error handlers
+ with each test run and fail to remove previously added
+ ones. In the case of Test Server, this would only happen
+ if SASL was not running on the test node. This has been
+ fixed.</p>
+ <p>
+ Own Id: OTP-9941 Aux Id: seq12009 </p>
+ </item>
+ <item>
+ <p>
+ If a test case process was terminated due to an exit
+ signal from a linked process, Test Server failed to
+ report the correct name of the suite and case to the
+ framework. This has been corrected.</p>
+ <p>
+ Own Id: OTP-9958 Aux Id: OTP-9855 </p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ A new optional feature has been introduced that enables
+ Common Test to generate priv_dir directory names that are
+ unique for each test case or config function. The name of
+ the option/flag is 'create_priv_dir' and it can be set to
+ value 'auto_per_run' (which is the default, existing,
+ behaviour), or 'auto_per_tc' or 'manual_per_tc'. If
+ 'auto_per_tc' is used, Test Server creates a dedicated
+ priv_dir automatically for each test case (which can be
+ very expensive in case of many and/or repeated cases). If
+ 'manual_per_tc' is used, the user needs to create the
+ priv_dir explicitly by calling the new function
+ ct:make_priv_dir/0.</p>
+ <p>
+ Own Id: OTP-9659 Aux Id: seq11930 </p>
+ </item>
+ <item>
+ <p>
+ A column for test case group name has been added to the
+ suite overview HTML log file.</p>
+ <p>
+ Own Id: OTP-9730 Aux Id: seq11952 </p>
+ </item>
+ <item>
+ <p>
+ It is now possible to use the post_end_per_testcase CT
+ hook function to print a comment for a test case in the
+ overview log file, even if the test case gets killed by a
+ timetrap or unknown exit signal, or if the
+ end_per_testcase function times out.</p>
+ <p>
+ Own Id: OTP-9855 Aux Id: seq11979 </p>
+ </item>
+ <item>
+ <p>
+ Common Test will now print error information (with a time
+ stamp) in the test case log file immediately when a test
+ case fails. This makes it easier to see when, in time,
+ the fault actually occured, and aid the job of locating
+ relevant trace and debug printouts in the log.</p>
+ <p>
+ Own Id: OTP-9904 Aux Id: seq11985, OTP-9900 </p>
+ </item>
+ <item>
+ <p>
+ Test Server has been modified to check the SASL
+ errlog_type parameter when receiving an error logger
+ event, so that it doesn't print reports of type that the
+ user has disabled.</p>
+ <p>
+ Own Id: OTP-9955 Aux Id: seq12013 </p>
+ </item>
+ <item>
+ <p>
+ If an application cannot be found by ts it is
+ automatically skipped when testing.</p>
+ <p>
+ Own Id: OTP-9971</p>
+ </item>
+ <item>
+ <p>
+ By specifying a user defined function ({M,F,A} or fun) as
+ timetrap value, either by means of an info function or by
+ calling ct:timetrap/1, it is now possible to set a
+ timetrap that will be triggered when the user function
+ returns.</p>
+ <p>
+ Own Id: OTP-9988 Aux Id: OTP-9501, seq11894 </p>
+ </item>
+ <item>
+ <p>
+ If the optional configuration functions init_per_suite/1
+ and end_per_suite/1 are not implemented in the test
+ suite, local Common Test versions of these functions are
+ called instead, and will be displayed in the overview log
+ file. Any printouts made by the pre- or
+ post_init_per_suite and pre- or post_end_per_suite hook
+ functions are saved in the log files for these functions.</p>
+ <p>
+ Own Id: OTP-9992</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Test_Server 3.5</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/test_server/doc/src/test_server_ctrl.xml b/lib/test_server/doc/src/test_server_ctrl.xml
index 9028a67ecb..41bc0bcc75 100644
--- a/lib/test_server/doc/src/test_server_ctrl.xml
+++ b/lib/test_server/doc/src/test_server_ctrl.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2007</year>
- <year>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -769,11 +769,13 @@ Optional, if not given the test server controller node
constantly updated. The following can be reported:
</p>
<p><c>What = tests_start, Data = {Name,NumCases}</c><br></br>
+ <c>What = loginfo, Data = [{topdir,TestRootDir},{rundir,CurrLogDir}]</c><br></br>
<c>What = tests_done, Data = {Ok,Failed,{UserSkipped,AutoSkipped}}</c><br></br>
- <c>What = tc_start, Data = {Mod,Func}</c><br></br>
+ <c>What = tc_start, Data = {{Mod,Func},TCLogFile}</c><br></br>
<c>What = tc_done, Data = {Mod,Func,Result}</c><br></br>
<c>What = tc_user_skip, Data = {Mod,Func,Comment}</c><br></br>
- <c>What = tc_auto_skip, Data = {Mod,Func,Comment}</c></p>
+ <c>What = tc_auto_skip, Data = {Mod,Func,Comment}</c><br></br>
+ <c>What = framework_error, Data = {{FWMod,FWFunc},Error}</c></p>
</desc>
</func>
<func>
diff --git a/lib/test_server/doc/src/ts.xml b/lib/test_server/doc/src/ts.xml
index f9b48d8372..4a2c536e96 100644
--- a/lib/test_server/doc/src/ts.xml
+++ b/lib/test_server/doc/src/ts.xml
@@ -85,8 +85,7 @@
<p><c>ts:install/1</c> or <c>ts:install/2</c> is used if the
target platform is different from the controller host, i.e. if
you run on "remote target" or if special options are required
- for your system. VxWorks is currently supported
- as remote target platform.
+ for your system.
</p>
<p>See the reference manual for detailed information about
<c>ts:install/0/1/2</c>.
@@ -249,9 +248,8 @@
<p>Installs and configures the Test Server Framework for
running test suites. If a remote host is to be used, the
<c>TargetSystem</c> argument must be given so that "cross
- installation" can be done. This should be used for testing on
- VxWorks. Installation is required for any of the
- functions in <c>ts</c> to work.
+ installation" can be done. Installation is required for
+ any of the functions in <c>ts</c> to work.
</p>
<p>Opts may be one or more of
</p>
@@ -500,29 +498,6 @@ This option is mandatory for remote targets
</desc>
</func>
<func>
- <name>index() -> ok | {error, Reason}</name>
- <fsummary>Updates local index page</fsummary>
- <type>
- <v>Reason = term()</v>
- </type>
- <desc>
- <p>This function updates the local index page. This can be
- useful if a previous test run was not completed and the index
- is incomplete.</p>
- </desc>
- </func>
- <func>
- <name>clean() -> ok</name>
- <name>clean(all) -> ok</name>
- <fsummary>Cleans up the log directories created when running tests. </fsummary>
- <desc>
- <p>This function cleans up log directories created when
- running test cases. <c>clean/0</c> cleans up all but the last
- run of each application. <c>clean/1</c> cleans up all test
- runs found.</p>
- </desc>
- </func>
- <func>
<name>estone() -> ok | {error, Reason}</name>
<name>estone(Opts) -> ok</name>
<fsummary>Runs the EStone test</fsummary>
diff --git a/lib/test_server/src/Makefile b/lib/test_server/src/Makefile
index 4bc51873c2..bb0b4e55b8 100644
--- a/lib/test_server/src/Makefile
+++ b/lib/test_server/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -44,20 +44,18 @@ MODULES= test_server_ctrl \
test_server \
test_server_sup \
test_server_h \
- erl2html2 \
- vxworks_client
+ erl2html2
TS_MODULES= \
ts \
ts_run \
- ts_reports \
ts_lib \
ts_make \
ts_erl_config \
ts_autoconf_win32 \
- ts_autoconf_vxworks \
ts_install \
- ts_install_cth
+ ts_install_cth \
+ ts_benchmark
TARGET_MODULES= $(MODULES:%=$(EBIN)/%)
TS_TARGET_MODULES= $(TS_MODULES:%=$(EBIN)/%)
@@ -124,22 +122,22 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_tests_spec: opt
- $(INSTALL_DIR) $(RELEASE_PATH)/test_server
+ $(INSTALL_DIR) "$(RELEASE_PATH)/test_server"
$(INSTALL_DATA) $(ERL_FILES) $(TS_ERL_FILES) \
$(HRL_FILES) $(INTERNAL_HRL_FILES) $(TS_HRL_FILES) \
$(TS_TARGET_FILES) \
$(AUTOCONF_FILES) $(C_FILES) $(COVER_FILES) $(CONFIG) \
- $(RELEASE_PATH)/test_server
- $(INSTALL_SCRIPT) $(PROGRAMS) $(RELEASE_PATH)/test_server
+ "$(RELEASE_PATH)/test_server"
+ $(INSTALL_SCRIPT) $(PROGRAMS) "$(RELEASE_PATH)/test_server"
release_docs_spec:
diff --git a/lib/test_server/src/configure.in b/lib/test_server/src/configure.in
index 097853bcfc..785bab395c 100644
--- a/lib/test_server/src/configure.in
+++ b/lib/test_server/src/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-2011. All Rights Reserved.
+dnl Copyright Ericsson AB 1997-2012. All Rights Reserved.
dnl
dnl The contents of this file are subject to the Erlang Public License,
dnl Version 1.1, (the "License"); you may not use this file except in
@@ -108,7 +108,7 @@ AC_CHECK_HEADER(poll.h, AC_DEFINE(HAVE_POLL_H))
# for the system.
AC_MSG_CHECKING([system version (for dynamic loading)])
-system=`uname -s`-`uname -r`
+system=`./config.sub $host`
AC_MSG_RESULT($system)
# Step 2: check for existence of -ldl library. This is needed because
@@ -119,10 +119,9 @@ AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
# Step 3: set configuration options based on system name and version.
SHLIB_LDLIBS=
-
fullSrcDir=`cd $srcdir; pwd`
case $system in
- Linux*)
+ *-linux-*)
SHLIB_CFLAGS="-fPIC"
SHLIB_SUFFIX=".so"
if test "$have_dl" = yes; then
@@ -136,7 +135,7 @@ case $system in
fi
SHLIB_EXTRACT_ALL=""
;;
- NetBSD-*|FreeBSD-*|OpenBSD-*|DragonFly*)
+ *-netbsd*|*-freebsd*|*-openbsd*|*-dragonfly*)
# Not available on all versions: check for include file.
AC_CHECK_HEADER(dlfcn.h, [
SHLIB_CFLAGS="-fpic"
@@ -153,28 +152,21 @@ case $system in
])
SHLIB_EXTRACT_ALL=""
;;
- SunOS-4*)
- SHLIB_CFLAGS="-PIC"
- SHLIB_LD="ld"
- SHLIB_LDFLAGS="$LDFLAGS"
- SHLIB_SUFFIX=".so"
- SHLIB_EXTRACT_ALL=""
- ;;
- SunOS-5*|UNIX_SV-4.2*)
+ *-solaris2*|*-sysv4*)
SHLIB_CFLAGS="-KPIC"
SHLIB_LD="/usr/ccs/bin/ld"
SHLIB_LDFLAGS="$LDFLAGS -G -z text"
SHLIB_SUFFIX=".so"
SHLIB_EXTRACT_ALL="-z allextract"
;;
- Darwin*)
+ *darwin*)
SHLIB_CFLAGS="-fno-common"
SHLIB_LD="cc"
SHLIB_LDFLAGS="$LDFLAGS -bundle -flat_namespace -undefined suppress"
SHLIB_SUFFIX=".so"
SHLIB_EXTRACT_ALL=""
;;
- OSF1*)
+ *osf1*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld"
SHLIB_LDFLAGS="$LDFLAGS -shared"
@@ -206,19 +198,19 @@ esac
if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
case $system in
- AIX-*)
+ *-aix)
;;
- BSD/OS*)
+ *-bsd*)
;;
- IRIX*)
+ *-irix)
;;
- NetBSD-*|FreeBSD-*|OpenBSD-*)
+ *-netbsd|*-freebsd|*-openbsd)
;;
- RISCos-*)
+ *-riscos)
;;
- ULTRIX-4.*)
+ *ultrix4.*)
;;
- Darwin*)
+ *darwin*)
;;
*)
SHLIB_CFLAGS="-fPIC"
diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl
index 51754cb3b4..8beed9bd3e 100644
--- a/lib/test_server/src/test_server.erl
+++ b/lib/test_server/src/test_server.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -35,6 +35,7 @@
-export([fail/0,fail/1,format/1,format/2,format/3]).
-export([capture_start/0,capture_stop/0,capture_get/0]).
-export([messages_get/0]).
+-export([permit_io/2]).
-export([hours/1,minutes/1,seconds/1,sleep/1,adjusted_sleep/1,timecall/3]).
-export([timetrap_scale_factor/0,timetrap/1,get_timetrap_info/0,
timetrap_cancel/1,timetrap_cancel/0]).
@@ -44,12 +45,12 @@
-export([start_node/3, stop_node/1, wait_for_node/1, is_release_available/1]).
-export([app_test/1, app_test/2]).
-export([is_native/1]).
--export([comment/1]).
+-export([comment/1, make_priv_dir/0]).
-export([os_type/0]).
-export([run_on_shielded_node/2]).
-export([is_cover/0,is_debug/0,is_commercial/0]).
--export([break/1,continue/0]).
+-export([break/1,break/2,break/3,continue/0,continue/1]).
%%% DEBUGGER INTERFACE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-export([purify_new_leaks/0, purify_format/2, purify_new_fds_inuse/0,
@@ -523,7 +524,7 @@ stick_all_sticky(Node,Sticky) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% run_test_case_apply(Mod,Func,Args,Name,RunInit,TimetrapData) ->
+%% run_test_case_apply(Mod,Func,Args,Name,RunInit,TimetrapData,RejectIoReqs) ->
%% {Time,Value,Loc,Opts,Comment} | {died,Reason,unknown,Comment}
%%
%% Time = float() (seconds)
@@ -558,8 +559,12 @@ stick_all_sticky(Node,Sticky) ->
%% ScaleTimetrap indicates if test_server should attemp to automatically
%% compensate timetraps for runtime delays introduced by e.g. tools like
%% cover.
+%%
+%% RejectIoReqs (bool) is information about whether printouts to stdout
+%% should be visible in the minor log file or not.
-run_test_case_apply({CaseNum,Mod,Func,Args,Name,RunInit,TimetrapData}) ->
+run_test_case_apply({CaseNum,Mod,Func,Args,Name,
+ RunInit,TimetrapData,RejectIoReqs}) ->
purify_format("Test case #~w ~w:~w/1", [CaseNum, Mod, Func]),
case os:getenv("TS_RUN_VALGRIND") of
false ->
@@ -570,17 +575,19 @@ run_test_case_apply({CaseNum,Mod,Func,Args,Name,RunInit,TimetrapData}) ->
end,
test_server_h:testcase({Mod,Func,1}),
ProcBef = erlang:system_info(process_count),
- Result = run_test_case_apply(Mod, Func, Args, Name, RunInit, TimetrapData),
+ Result = run_test_case_apply(Mod, Func, Args, Name, RunInit,
+ TimetrapData, RejectIoReqs),
ProcAft = erlang:system_info(process_count),
purify_new_leaks(),
DetFail = get(test_server_detected_fail),
{Result,DetFail,ProcBef,ProcAft}.
-run_test_case_apply(Mod, Func, Args, Name, RunInit, TimetrapData) ->
+run_test_case_apply(Mod, Func, Args, Name, RunInit, TimetrapData, RejectIoReqs) ->
case get(test_server_job_dir) of
undefined ->
%% i'm a local target
- do_run_test_case_apply(Mod, Func, Args, Name, RunInit, TimetrapData);
+ do_run_test_case_apply(Mod, Func, Args, Name, RunInit,
+ TimetrapData, RejectIoReqs);
JobDir ->
%% i'm a remote target
case Args of
@@ -595,13 +602,14 @@ run_test_case_apply(Mod, Func, Args, Name, RunInit, TimetrapData) ->
Config2 = lists:keyreplace(priv_dir, 1, Config1,
{priv_dir,TargetPrivDir}),
do_run_test_case_apply(Mod, Func, [Config2], Name, RunInit,
- TimetrapData);
+ TimetrapData, RejectIoReqs);
_other ->
do_run_test_case_apply(Mod, Func, Args, Name, RunInit,
- TimetrapData)
+ TimetrapData, RejectIoReqs)
end
end.
-do_run_test_case_apply(Mod, Func, Args, Name, RunInit, TimetrapData) ->
+do_run_test_case_apply(Mod, Func, Args, Name, RunInit,
+ TimetrapData, RejectIoReqs) ->
{ok,Cwd} = file:get_cwd(),
Args2Print = case Args of
[Args1] when is_list(Args1) ->
@@ -628,7 +636,8 @@ do_run_test_case_apply(Mod, Func, Args, Name, RunInit, TimetrapData) ->
end),
group_leader(OldGLeader, self()),
put(test_server_detected_fail, []),
- run_test_case_msgloop(Ref, Pid, false, false, "", undefined).
+ run_test_case_msgloop(Ref, Pid, false, RejectIoReqs, false, "",
+ undefined, starting).
%% Ugly bug (pre R5A):
%% If this process (group leader of the test case) terminates before
@@ -639,19 +648,37 @@ do_run_test_case_apply(Mod, Func, Args, Name, RunInit, TimetrapData) ->
%% A test case is known to have failed if it returns {'EXIT', _} tuple,
%% or sends a message {failed, File, Line} to it's group_leader
%%
-run_test_case_msgloop(Ref, Pid, CaptureStdout, Terminate, Comment, CurrConf) ->
+run_test_case_msgloop(Ref, Pid, CaptureStdout, RejectIoReqs, Terminate,
+ Comment, CurrConf, Status) ->
%% NOTE: Keep job_proxy_msgloop/0 up to date when changes
%% are made in this function!
{Timeout,ReturnValue} =
case Terminate of
{true, ReturnVal} ->
+ %% stop any timetrap timers for the test case
+ %% that have been started by this process
+ timetrap_cancel_all(Pid, false),
{20, ReturnVal};
false ->
{infinity, should_never_appear}
end,
receive
+ {test_case_initialized,Pid} ->
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,running);
+ Abort = {abort_current_testcase,_,_} when Status == starting ->
+ %% we're in init phase, must must postpone this operation
+ %% until test case execution is in progress (or FW:init_tc
+ %% gets killed)
+ self() ! Abort,
+ erlang:yield(),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{abort_current_testcase,Reason,From} ->
- Line = get_loc(Pid),
+ Line = case is_process_alive(Pid) of
+ true -> get_loc(Pid);
+ false -> unknown
+ end,
Mon = erlang:monitor(process, Pid),
exit(Pid,{testcase_aborted,Reason,Line}),
erlang:yield(),
@@ -665,76 +692,104 @@ run_test_case_msgloop(Ref, Pid, CaptureStdout, Terminate, Comment, CurrConf) ->
exit(Pid, kill),
%% here's the only place we know Reason, so we save
%% it as a comment, potentially replacing user data
- Error = lists:flatten(io_lib:format("Aborted: ~p",[Reason])),
+ Error = lists:flatten(io_lib:format("Aborted: ~p",
+ [Reason])),
Error1 = lists:flatten([string:strip(S,left) ||
- S <- string:tokens(Error,[$\n])]),
+ S <- string:tokens(Error,
+ [$\n])]),
if length(Error1) > 63 ->
string:substr(Error1,1,60) ++ "...";
true ->
Error1
end
end,
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,NewComment,CurrConf);
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ NewComment,CurrConf,Status);
+ {permit_io,FromPid} ->
+ put({permit_io,FromPid},true),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{io_request,From,ReplyAs,{put_chars,io_lib,Func,[Format,Args]}}
when is_list(Format) ->
Msg = (catch io_lib:Func(Format,Args)),
- run_test_case_msgloop_io(ReplyAs,CaptureStdout,Msg,From,Func),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop_io(From,ReplyAs,CaptureStdout,RejectIoReqs,
+ Msg,From,Func),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{io_request,From,ReplyAs,{put_chars,io_lib,Func,[Format,Args]}}
when is_atom(Format) ->
Msg = (catch io_lib:Func(Format,Args)),
- run_test_case_msgloop_io(ReplyAs,CaptureStdout,Msg,From,Func),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop_io(From,ReplyAs,CaptureStdout,RejectIoReqs,
+ Msg,From,Func),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{io_request,From,ReplyAs,{put_chars,Bytes}} ->
- run_test_case_msgloop_io(
- ReplyAs,CaptureStdout,Bytes,From,put_chars),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop_io(From,ReplyAs,CaptureStdout,RejectIoReqs,
+ Bytes,From,put_chars),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{io_request,From,ReplyAs,{put_chars,unicode,io_lib,Func,[Format,Args]}}
when is_list(Format) ->
Msg = unicode_to_latin1(catch io_lib:Func(Format,Args)),
- run_test_case_msgloop_io(ReplyAs,CaptureStdout,Msg,From,Func),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop_io(From,ReplyAs,CaptureStdout,RejectIoReqs,
+ Msg,From,Func),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{io_request,From,ReplyAs,{put_chars,latin1,io_lib,Func,[Format,Args]}}
when is_list(Format) ->
Msg = (catch io_lib:Func(Format,Args)),
- run_test_case_msgloop_io(ReplyAs,CaptureStdout,Msg,From,Func),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop_io(From,ReplyAs,CaptureStdout,RejectIoReqs,
+ Msg,From,Func),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{io_request,From,ReplyAs,{put_chars,unicode,io_lib,Func,[Format,Args]}}
when is_atom(Format) ->
Msg = unicode_to_latin1(catch io_lib:Func(Format,Args)),
- run_test_case_msgloop_io(ReplyAs,CaptureStdout,Msg,From,Func),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop_io(From,ReplyAs,CaptureStdout,RejectIoReqs,
+ Msg,From,Func),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{io_request,From,ReplyAs,{put_chars,latin1,io_lib,Func,[Format,Args]}}
when is_atom(Format) ->
Msg = (catch io_lib:Func(Format,Args)),
- run_test_case_msgloop_io(ReplyAs,CaptureStdout,Msg,From,Func),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop_io(From,ReplyAs,CaptureStdout,RejectIoReqs,
+ Msg,From,Func),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{io_request,From,ReplyAs,{put_chars,unicode,Bytes}} ->
- run_test_case_msgloop_io(
- ReplyAs,CaptureStdout,unicode_to_latin1(Bytes),From,put_chars),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop_io(From,ReplyAs,CaptureStdout,RejectIoReqs,
+ unicode_to_latin1(Bytes),From,put_chars),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{io_request,From,ReplyAs,{put_chars,latin1,Bytes}} ->
- run_test_case_msgloop_io(
- ReplyAs,CaptureStdout,Bytes,From,put_chars),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop_io(From,ReplyAs,CaptureStdout,RejectIoReqs,
+ Bytes,From,put_chars),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
IoReq when element(1, IoReq) == io_request ->
%% something else, just pass it on
group_leader() ! IoReq,
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{structured_io,ClientPid,Msg} ->
output(Msg, ClientPid),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{capture,NewCapture} ->
- run_test_case_msgloop(Ref,Pid,NewCapture,Terminate,Comment,CurrConf);
+ run_test_case_msgloop(Ref,Pid,NewCapture,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{sync_apply,From,MFA} ->
sync_local_or_remote_apply(false,From,MFA),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{sync_apply_proxy,Proxy,From,MFA} ->
sync_local_or_remote_apply(Proxy,From,MFA),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{printout,Detail,Format,Args} ->
print(Detail,Format,Args),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{comment,NewComment} ->
NewComment1 = test_server_ctrl:to_string(NewComment),
NewComment2 = test_server_sup:framework_call(format_comment,
@@ -747,16 +802,42 @@ run_test_case_msgloop(Ref, Pid, CaptureStdout, Terminate, Comment, CurrConf) ->
Other ->
Other
end,
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate1,NewComment2,CurrConf);
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate1,
+ NewComment2,CurrConf,Status);
{read_comment,From} ->
From ! {self(),read_comment,Comment},
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{set_curr_conf,From,NewCurrConf} ->
From ! {self(),set_curr_conf,ok},
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,NewCurrConf);
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,NewCurrConf,Status);
+ {make_priv_dir,From} when CurrConf == undefined ->
+ From ! {self(),make_priv_dir,{error,no_priv_dir_in_config}},
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
+ {make_priv_dir,From} ->
+ Result =
+ case proplists:get_value(priv_dir, element(2, CurrConf)) of
+ undefined ->
+ {error,no_priv_dir_in_config};
+ PrivDir ->
+ case file:make_dir(PrivDir) of
+ ok ->
+ ok;
+ {error, eexist} ->
+ ok;
+ MkDirError ->
+ {error,{MkDirError,PrivDir}}
+ end
+ end,
+ From ! {self(),make_priv_dir,Result},
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,Terminate,
+ Comment,CurrConf,Status);
{'EXIT',Pid,{Ref,Time,Value,Loc,Opts}} ->
RetVal = {Time/1000000,Value,mod_loc(Loc),Opts,Comment},
- run_test_case_msgloop(Ref,Pid,CaptureStdout,{true,RetVal},Comment,undefined);
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ {true,RetVal},Comment,undefined,Status);
{'EXIT',Pid,Reason} ->
case Reason of
{timetrap_timeout,TVal,Loc} ->
@@ -766,37 +847,45 @@ run_test_case_msgloop(Ref, Pid, CaptureStdout, Terminate, Comment, CurrConf) ->
%% timout during framework call
spawn_fw_call(FwMod,FwFunc,CurrConf,Pid,
{framework_error,{timetrap,TVal}},
- unknown,self(),Comment),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,
- Comment,undefined);
+ unknown,self()),
+ run_test_case_msgloop(Ref,Pid,
+ CaptureStdout,RejectIoReqs,
+ Terminate,Comment,
+ undefined,Status);
Loc1 ->
%% call end_per_testcase on a separate process,
- %% only so that the user has a chance to clean up
- %% after init_per_testcase, even after a timetrap timeout
+ %% only so that the user has a chance to
+ %% clean up after init_per_testcase, even after
+ %% a timetrap timeout
NewCurrConf =
case CurrConf of
{{Mod,Func},Conf} ->
EndConfPid =
- call_end_conf(Mod,Func,Pid,
- {timetrap_timeout,TVal},
- Loc1,[{tc_status,
- {failed,
- timetrap_timeout}}|Conf],
- TVal),
+ call_end_conf(
+ Mod,Func,Pid,
+ {timetrap_timeout,TVal},
+ Loc1,[{tc_status,
+ {failed,
+ timetrap_timeout}}|Conf],
+ TVal),
{EndConfPid,{Mod,Func},Conf};
_ ->
{Mod,Func} = get_mf(Loc1),
- %% The framework functions mustn't execute on this
- %% group leader process or io will cause deadlock,
- %% so we spawn a dedicated process for the operation
- %% and let the group leader go back to handle io.
+ %% The framework functions mustn't
+ %% execute on this group leader process
+ %% or io will cause deadlock, so we
+ %% spawn a dedicated process for the
+ %% operation and let the group leader
+ %% go back to handle io.
spawn_fw_call(Mod,Func,CurrConf,Pid,
{timetrap_timeout,TVal},
- Loc1,self(),Comment),
+ Loc1,self()),
undefined
end,
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,
- Comment,NewCurrConf)
+ run_test_case_msgloop(Ref,Pid,
+ CaptureStdout,RejectIoReqs,
+ Terminate,Comment,
+ NewCurrConf,Status)
end;
{timetrap_timeout,TVal,Loc,InitOrEnd} ->
case mod_loc(Loc) of
@@ -804,14 +893,25 @@ run_test_case_msgloop(Ref, Pid, CaptureStdout, Terminate, Comment, CurrConf) ->
%% timout during framework call
spawn_fw_call(FwMod,FwFunc,CurrConf,Pid,
{framework_error,{timetrap,TVal}},
- unknown,self(),Comment);
+ unknown,self());
Loc1 ->
{Mod,_Func} = get_mf(Loc1),
spawn_fw_call(Mod,InitOrEnd,CurrConf,Pid,
{timetrap_timeout,TVal},
- Loc1,self(),Comment)
+ Loc1,self())
end,
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ Terminate,Comment,CurrConf,Status);
+ {testcase_aborted,ErrorMsg={user_timetrap_error,_},AbortLoc} ->
+ %% user timetrap function caused exit
+ %% during start of test case
+ {Mod,Func} = get_mf(mod_loc(AbortLoc)),
+ spawn_fw_call(Mod,Func,CurrConf,Pid,
+ ErrorMsg,unknown,self()),
+ run_test_case_msgloop(Ref,Pid,
+ CaptureStdout,RejectIoReqs,
+ Terminate,Comment,
+ undefined,Status);
{testcase_aborted,AbortReason,AbortLoc} ->
ErrorMsg = {testcase_aborted,AbortReason},
case mod_loc(AbortLoc) of
@@ -819,66 +919,108 @@ run_test_case_msgloop(Ref, Pid, CaptureStdout, Terminate, Comment, CurrConf) ->
%% abort during framework call
spawn_fw_call(FwMod,FwFunc,CurrConf,Pid,
{framework_error,ErrorMsg},
- unknown,self(),Comment),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,
- Comment,undefined);
+ unknown,self()),
+ run_test_case_msgloop(Ref,Pid,
+ CaptureStdout,RejectIoReqs,
+ Terminate,Comment,
+ undefined,Status);
Loc1 ->
- %% call end_per_testcase on a separate process, only so
- %% that the user has a chance to clean up after init_per_testcase,
- %% even after abortion
+ %% call end_per_testcase on a separate process,
+ %% only so that the user has a chance to clean up
+ %% after init_per_testcase, even after abortion
NewCurrConf =
case CurrConf of
{{Mod,Func},Conf} ->
- TVal = case lists:keysearch(default_timeout,1,Conf) of
- {value,{default_timeout,Tmo}} -> Tmo;
- _ -> ?DEFAULT_TIMETRAP_SECS*1000
- end,
+ TVal =
+ case lists:keysearch(default_timeout,
+ 1,
+ Conf) of
+ {value,{default_timeout,Tmo}} ->
+ Tmo;
+ _ ->
+ ?DEFAULT_TIMETRAP_SECS*1000
+ end,
EndConfPid =
- call_end_conf(Mod,Func,Pid,ErrorMsg,
- Loc1,
- [{tc_status,{failed,ErrorMsg}}|Conf],
- TVal),
+ call_end_conf(
+ Mod,Func,Pid,
+ ErrorMsg,Loc1,
+ [{tc_status,
+ {failed,ErrorMsg}}|Conf],TVal),
{EndConfPid,{Mod,Func},Conf};
_ ->
{Mod,Func} = get_mf(Loc1),
- spawn_fw_call(Mod,Func,CurrConf,Pid,ErrorMsg,
- Loc1,self(),Comment),
+ spawn_fw_call(Mod,Func,CurrConf,Pid,
+ ErrorMsg,Loc1,self()),
undefined
end,
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,
- Comment,NewCurrConf)
+ run_test_case_msgloop(Ref,Pid,
+ CaptureStdout,RejectIoReqs,
+ Terminate,Comment,
+ NewCurrConf,Status)
end;
killed ->
%% result of an exit(TestCase,kill) call, which is the
%% only way to abort a testcase process that traps exits
%% (see abort_current_testcase)
- spawn_fw_call(undefined,undefined,CurrConf,Pid,
+ {Mod,Func} = case CurrConf of
+ {MF,_} -> MF;
+ _ -> {undefined,undefined}
+ end,
+ spawn_fw_call(Mod,Func,CurrConf,Pid,
testcase_aborted_or_killed,
- unknown,self(),Comment),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ unknown,self()),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ Terminate,Comment,CurrConf,Status);
{fw_error,{FwMod,FwFunc,FwError}} ->
- spawn_fw_call(FwMod,FwFunc,CurrConf,Pid,{framework_error,FwError},
- unknown,self(),Comment),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ spawn_fw_call(FwMod,FwFunc,CurrConf,Pid,
+ {framework_error,FwError},
+ unknown,self()),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ Terminate,Comment,CurrConf,Status);
_Other ->
%% the testcase has terminated because of Reason (e.g. an exit
%% because a linked process failed)
- spawn_fw_call(undefined,undefined,CurrConf,Pid,Reason,
- unknown,self(),Comment),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf)
+ {Mod,Func} = case CurrConf of
+ {MF,_} -> MF;
+ _ -> {undefined,undefined}
+ end,
+ spawn_fw_call(Mod,Func,CurrConf,Pid,
+ Reason,unknown,self()),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ Terminate,Comment,CurrConf,Status)
end;
{EndConfPid,{call_end_conf,Data,_Result}} ->
case CurrConf of
{EndConfPid,{Mod,Func},_Conf} ->
{_Mod,_Func,TCPid,TCExitReason,Loc} = Data,
- spawn_fw_call(Mod,Func,CurrConf,TCPid,TCExitReason,Loc,self(),Comment),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,undefined);
+ spawn_fw_call(Mod,Func,CurrConf,TCPid,
+ TCExitReason,Loc,self()),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ Terminate,Comment,undefined,Status);
_ ->
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf)
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ Terminate,Comment,CurrConf,Status)
end;
- {_FwCallPid,fw_notify_done,RetVal} ->
+ {_FwCallPid,fw_notify_done,{T,Value,Loc,Opts,AddToComment}} ->
%% the framework has been notified, we're finished
- run_test_case_msgloop(Ref,Pid,CaptureStdout,{true,RetVal},Comment,undefined);
+ RetVal =
+ case AddToComment of
+ undefined ->
+ {T,Value,Loc,Opts,Comment};
+ _ ->
+ Comment1 =
+ if Comment == "" ->
+ AddToComment;
+ true ->
+ Comment ++
+ test_server_ctrl:xhtml("<br>",
+ "<br />") ++
+ AddToComment
+ end,
+ {T,Value,Loc,Opts,Comment1}
+ end,
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ {true,RetVal},Comment,undefined,Status);
{'EXIT',_FwCallPid,{fw_notify_done,Func,Error}} ->
%% a framework function failed
CB = os:getenv("TEST_SERVER_FRAMEWORK"),
@@ -889,53 +1031,108 @@ run_test_case_msgloop(Ref, Pid, CaptureStdout, Terminate, Comment, CurrConf) ->
{list_to_atom(CB),Func}
end,
RetVal = {died,{framework_error,Loc,Error},Loc,"Framework error"},
- run_test_case_msgloop(Ref,Pid,CaptureStdout,{true,RetVal},Comment,undefined);
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ {true,RetVal},Comment,undefined,Status);
{failed,File,Line} ->
put(test_server_detected_fail,
[{File, Line}| get(test_server_detected_fail)]),
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ Terminate,Comment,CurrConf,Status);
+
+ {user_timetrap,Pid,_TrapTime,StartTime,E={user_timetrap_error,_},_} ->
+ case update_user_timetraps(Pid, StartTime) of
+ proceed ->
+ self() ! {abort_current_testcase,E,Pid};
+ ignore ->
+ ok
+ end,
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ Terminate,Comment,CurrConf,Status);
+ {user_timetrap,Pid,TrapTime,StartTime,ElapsedTime,Scale} ->
+ %% a user timetrap is triggered, ignore it if new
+ %% timetrap has been started since
+ case update_user_timetraps(Pid, StartTime) of
+ proceed ->
+ TotalTime = if is_integer(TrapTime) ->
+ TrapTime + ElapsedTime;
+ true ->
+ TrapTime
+ end,
+ timetrap(TrapTime, TotalTime, Pid, Scale);
+ ignore ->
+ ok
+ end,
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ Terminate,Comment,CurrConf,Status);
+ {timetrap_cancel_one,Handle,_From} ->
+ timetrap_cancel_one(Handle, false),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ Terminate,Comment,CurrConf,Status);
+ {timetrap_cancel_all,TCPid,_From} ->
+ timetrap_cancel_all(TCPid, false),
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ Terminate,Comment,CurrConf,Status);
+ {get_timetrap_info,TCPid,From} ->
+ Info = get_timetrap_info(TCPid, false),
+ From ! {self(),get_timetrap_info,Info},
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ Terminate,Comment,CurrConf,Status);
_Other when not is_tuple(_Other) ->
%% ignore anything not generated by test server
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf);
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ Terminate,Comment,CurrConf,Status);
_Other when element(1, _Other) /= 'EXIT',
element(1, _Other) /= started,
element(1, _Other) /= finished,
element(1, _Other) /= print ->
%% ignore anything not generated by test server
- run_test_case_msgloop(Ref,Pid,CaptureStdout,Terminate,Comment,CurrConf)
+ run_test_case_msgloop(Ref,Pid,CaptureStdout,RejectIoReqs,
+ Terminate,Comment,CurrConf,Status)
after Timeout ->
ReturnValue
end.
-run_test_case_msgloop_io(ReplyAs,CaptureStdout,Msg,From,Func) ->
+run_test_case_msgloop_io(From,ReplyAs,CaptureStdout,RejectIoReqs,
+ Msg,From,Func) ->
case Msg of
{'EXIT',_} ->
From ! {io_reply,ReplyAs,{error,Func}};
_ ->
From ! {io_reply,ReplyAs,ok}
end,
- if CaptureStdout /= false ->
- CaptureStdout ! {captured,Msg};
- true ->
+ Proceed = if RejectIoReqs -> get({permit_io,From});
+ true -> true
+ end,
+ if Proceed ->
+ if CaptureStdout /= false ->
+ CaptureStdout ! {captured,Msg};
+ true ->
+ ok
+ end,
+ output({minor,Msg},From);
+ true ->
ok
- end,
- output({minor,Msg},From).
+ end.
output(Msg,Sender) ->
local_or_remote_apply({test_server_ctrl,output,[Msg,Sender]}).
call_end_conf(Mod,Func,TCPid,TCExitReason,Loc,Conf,TVal) ->
+ %% Starter is also the group leader process
Starter = self(),
Data = {Mod,Func,TCPid,TCExitReason,Loc},
EndConfProc =
fun() ->
+ group_leader(Starter, self()),
Supervisor = self(),
EndConfApply =
fun() ->
case catch apply(Mod,end_per_testcase,[Func,Conf]) of
{'EXIT',Why} ->
+ timer:sleep(1),
group_leader() ! {printout,12,
- "ERROR! ~p:end_per_testcase(~p, ~p)"
+ "WARNING! "
+ "~p:end_per_testcase(~p, ~p)"
" crashed!\n\tReason: ~p\n",
[Mod,Func,Conf,Why]};
_ ->
@@ -950,15 +1147,23 @@ call_end_conf(Mod,Func,TCPid,TCExitReason,Loc,Conf,TVal) ->
{'EXIT',Pid,Reason} ->
Starter ! {self(),{call_end_conf,Data,{error,Reason}}}
after TVal ->
+ exit(Pid, kill),
+ group_leader() ! {printout,12,
+ "WARNING! ~p:end_per_testcase(~p, ~p)"
+ " failed!\n\tReason: timetrap timeout"
+ " after ~w ms!\n", [Mod,Func,Conf,TVal]},
Starter ! {self(),{call_end_conf,Data,{error,timeout}}}
end
end,
spawn_link(EndConfProc).
spawn_fw_call(Mod,{init_per_testcase,Func},_,Pid,{timetrap_timeout,TVal}=Why,
- Loc,SendTo,Comment) ->
+ Loc,SendTo) ->
FwCall =
fun() ->
+ %% set group leader so that printouts/comments
+ %% from the framework get printed in the logs
+ group_leader(SendTo, self()),
Skip = {skip,{failed,{Mod,init_per_testcase,Why}}},
%% if init_per_testcase fails, the test case
%% should be skipped
@@ -970,12 +1175,12 @@ spawn_fw_call(Mod,{init_per_testcase,Func},_,Pid,{timetrap_timeout,TVal}=Why,
end,
%% finished, report back
SendTo ! {self(),fw_notify_done,
- {TVal/1000,Skip,Loc,[],Comment}}
+ {TVal/1000,Skip,Loc,[],undefined}}
end,
spawn_link(FwCall);
spawn_fw_call(Mod,{end_per_testcase,Func},EndConf,Pid,
- {timetrap_timeout,TVal}=Why,_Loc,SendTo,Comment) ->
+ {timetrap_timeout,TVal}=Why,_Loc,SendTo) ->
%%! This is a temporary fix that keeps Test Server alive during
%%! execution of a parallel test case group, when sometimes
%%! this clause gets called with EndConf == undefined. See OTP-9594
@@ -987,6 +1192,9 @@ spawn_fw_call(Mod,{end_per_testcase,Func},EndConf,Pid,
end,
FwCall =
fun() ->
+ %% set group leader so that printouts/comments
+ %% from the framework get printed in the logs
+ group_leader(SendTo, self()),
{RetVal,Report} =
case proplists:get_value(tc_status, EndConf1) of
undefined ->
@@ -998,6 +1206,10 @@ spawn_fw_call(Mod,{end_per_testcase,Func},EndConf,Pid,
E = {failed,{Mod,end_per_testcase,Why}},
{Result,E}
end,
+ group_leader() ! {printout,12,
+ "WARNING! ~p:end_per_testcase(~p, ~p)"
+ " failed!\n\tReason: timetrap timeout"
+ " after ~w ms!\n", [Mod,Func,EndConf,TVal]},
FailLoc = proplists:get_value(tc_fail_loc, EndConf1),
case catch do_end_tc_call(Mod,Func, FailLoc,
{Pid,Report,[EndConf1]}, Why) of
@@ -1006,42 +1218,48 @@ spawn_fw_call(Mod,{end_per_testcase,Func},EndConf,Pid,
_ ->
ok
end,
- %% if end_per_testcase fails a warning should be
- %% printed as comment
- Comment1 = if Comment == "" ->
- "";
- true ->
- Comment ++ test_server_ctrl:xhtml("<br>",
- "<br />")
- end,
- %% finished, report back
+ Warn = "<font color=\"red\">"
+ "WARNING: end_per_testcase timed out!</font>",
+ %% finished, report back (if end_per_testcase fails, a warning
+ %% should be printed as part of the comment)
SendTo ! {self(),fw_notify_done,
- {TVal/1000,RetVal,FailLoc,[],
- [Comment1,"<font color=\"red\">"
- "WARNING: end_per_testcase timed out!"
- "</font>"]}}
+ {TVal/1000,RetVal,FailLoc,[],Warn}}
end,
spawn_link(FwCall);
-spawn_fw_call(FwMod,FwFunc,_,_Pid,{framework_error,FwError},_,SendTo,_Comment) ->
+spawn_fw_call(FwMod,FwFunc,_,_Pid,{framework_error,FwError},_,SendTo) ->
FwCall =
fun() ->
+ %% set group leader so that printouts/comments
+ %% from the framework get printed in the logs
+ group_leader(SendTo, self()),
test_server_sup:framework_call(report, [framework_error,
- {{FwMod,FwFunc},FwError}]),
+ {{FwMod,FwFunc},
+ FwError}]),
Comment =
lists:flatten(
io_lib:format("<font color=\"red\">"
- "WARNING! ~w:~w failed!</font>", [FwMod,FwFunc])),
+ "WARNING! ~w:~w failed!</font>",
+ [FwMod,FwFunc])),
%% finished, report back
SendTo ! {self(),fw_notify_done,
- {died,{error,{FwMod,FwFunc,FwError}},{FwMod,FwFunc},[],Comment}}
+ {died,{error,{FwMod,FwFunc,FwError}},
+ {FwMod,FwFunc},[],Comment}}
end,
spawn_link(FwCall);
-spawn_fw_call(Mod,Func,_,Pid,Error,Loc,SendTo,Comment) ->
+spawn_fw_call(Mod,Func,CurrConf,Pid,Error,Loc,SendTo) ->
+ {Mod1,Func1} =
+ case {Mod,Func,CurrConf} of
+ {undefined,undefined,{{M,F},_}} -> {M,F};
+ _ -> {Mod,Func}
+ end,
FwCall =
fun() ->
- case catch fw_error_notify(Mod,Func,[],
+ %% set group leader so that printouts/comments
+ %% from the framework get printed in the logs
+ group_leader(SendTo, self()),
+ case catch fw_error_notify(Mod1,Func1,[],
Error,Loc) of
{'EXIT',FwErrorNotifyErr} ->
exit({fw_notify_done,error_notification,
@@ -1050,7 +1268,7 @@ spawn_fw_call(Mod,Func,_,Pid,Error,Loc,SendTo,Comment) ->
ok
end,
Conf = [{tc_status,{failed,timetrap_timeout}}],
- case catch do_end_tc_call(Mod,Func, Loc,
+ case catch do_end_tc_call(Mod1,Func1, Loc,
{Pid,Error,[Conf]},Error) of
{'EXIT',FwEndTCErr} ->
exit({fw_notify_done,end_tc,FwEndTCErr});
@@ -1058,7 +1276,7 @@ spawn_fw_call(Mod,Func,_,Pid,Error,Loc,SendTo,Comment) ->
ok
end,
%% finished, report back
- SendTo ! {self(),fw_notify_done,{died,Error,Loc,Comment}}
+ SendTo ! {self(),fw_notify_done,{died,Error,Loc,[],undefined}}
end,
spawn_link(FwCall).
@@ -1115,10 +1333,11 @@ run_test_case_eval(Mod, Func, Args0, Name, Ref, RunInit,
TimetrapData, LogOpts, TCCallback) ->
put(test_server_multiply_timetraps, TimetrapData),
put(test_server_logopts, LogOpts),
-
+ FWInitResult = test_server_sup:framework_call(init_tc,[?pl2a(Mod),Func,Args0],
+ {ok,Args0}),
+ group_leader() ! {test_case_initialized,self()},
{{Time,Value},Loc,Opts} =
- case test_server_sup:framework_call(init_tc,[?pl2a(Mod),Func,Args0],
- {ok,Args0}) of
+ case FWInitResult of
{ok,Args} ->
run_test_case_eval1(Mod, Func, Args, Name, RunInit, TCCallback);
Error = {error,_Reason} ->
@@ -1146,6 +1365,9 @@ run_test_case_eval(Mod, Func, Args0, Name, Ref, RunInit,
exit({Ref,Time,Value,Loc,Opts}).
run_test_case_eval1(Mod, Func, Args, Name, RunInit, TCCallback) ->
+ %% save current state in controller loop
+ sync_send(group_leader(),set_curr_conf,{{Mod,Func},hd(Args)},
+ 5000, fun() -> exit(no_answer_from_group_leader) end),
case RunInit of
run_init ->
put(test_server_init_or_end_conf,{init_per_testcase,Func}),
@@ -1204,8 +1426,8 @@ run_test_case_eval1(Mod, Func, Args, Name, RunInit, TCCallback) ->
%% call user callback function if defined
EndConf1 = user_callback(TCCallback, Mod, Func, 'end', EndConf),
%% update current state in controller loop
- sync_send(group_leader(),set_curr_conf,EndConf1,
- 5000, fun() -> exit(no_answer_from_group_leader) end),
+ sync_send(group_leader(),set_curr_conf,EndConf1, 5000,
+ fun() -> exit(no_answer_from_group_leader) end),
{FWReturn1,TSReturn1,EndConf2} =
case end_per_testcase(Mod, Func, EndConf1) of
SaveCfg1={save_config,_} ->
@@ -1530,8 +1752,18 @@ get_loc(Pid) ->
lists:foreach(fun({Key,Val}) -> put(Key, Val) end, Dict),
Stk = [rewrite_loc_item(Loc) || Loc <- Stk0],
case get(test_server_loc) of
- undefined -> put(test_server_loc, Stk);
- _ -> ok
+ undefined ->
+ put(test_server_loc, Stk);
+ {Suite,Case} ->
+ %% location info unknown, check if {Suite,Case,Line}
+ %% is available in stacktrace. and if so, use stacktrace
+ %% instead of currect test_server_loc
+ case [match || {S,C,_L} <- Stk, S == Suite, C == Case] of
+ [match|_] -> put(test_server_loc, Stk);
+ _ -> ok
+ end;
+ _ ->
+ ok
end,
get_loc().
@@ -1561,13 +1793,20 @@ mod_loc(Loc) ->
%% handle diff line num versions
case Loc of
[{{_M,_F},_L}|_] ->
- [{?pl2a(M),F,L} || {{M,F},L} <- Loc];
+ [begin if L /= 0 -> {?pl2a(M),F,L};
+ true -> {?pl2a(M),F} end end || {{M,F},L} <- Loc];
[{_M,_F}|_] ->
[{?pl2a(M),F} || {M,F} <- Loc];
+ {{M,F},0} ->
+ [{?pl2a(M),F}];
{{M,F},L} ->
[{?pl2a(M),F,L}];
{M,ForL} ->
[{?pl2a(M),ForL}];
+ {M,F,0} ->
+ [{M,F}];
+ [{M,F,0}|Stack] ->
+ [{M,F}|Stack];
_ ->
Loc
end.
@@ -1760,6 +1999,13 @@ messages_get() ->
test_server_sup:messages_get([]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% permit_io(GroupLeader, FromPid) -> ok
+%%
+%% Make sure proceeding IO from FromPid won't get rejected
+permit_io(GroupLeader, FromPid) ->
+ GroupLeader ! {permit_io,FromPid}.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% sleep(Time) -> ok
%% Time = integer() | float() | infinity
%%
@@ -1862,31 +2108,40 @@ fail() ->
%% Break a test case so part of the test can be done manually.
%% Use continue/0 to continue.
break(Comment) ->
- case erase(test_server_timetraps) of
- undefined -> ok;
- List -> lists:foreach(fun({Ref,_,_}) ->
- timetrap_cancel(Ref)
- end, List)
- end,
+ break(?MODULE, Comment).
+
+break(CBM, Comment) ->
+ break(CBM, '', Comment).
+
+break(CBM, TestCase, Comment) ->
+ timetrap_cancel(),
+ {TCName,CntArg,PName} =
+ if TestCase == '' ->
+ {"", "", test_server_break_process};
+ true ->
+ Str = atom_to_list(TestCase),
+ {[32 | Str], Str,
+ list_to_atom("test_server_break_process_" ++ Str)}
+ end,
io:format(user,
"\n\n\n--- SEMIAUTOMATIC TESTING ---"
- "\nThe test case executes on process ~w"
+ "\nThe test case~s executes on process ~w"
"\n\n\n~s"
"\n\n\n-----------------------------\n\n"
- "Continue with --> test_server:continue().\n",
- [self(),Comment]),
- case whereis(test_server_break_process) of
+ "Continue with --> ~w:continue(~s).\n",
+ [TCName,self(),Comment,CBM,CntArg]),
+ case whereis(PName) of
undefined ->
- spawn_break_process(self());
+ spawn_break_process(self(), PName);
OldBreakProcess ->
OldBreakProcess ! cancel,
- spawn_break_process(self())
+ spawn_break_process(self(), PName)
end,
receive continue -> ok end.
-spawn_break_process(Pid) ->
+spawn_break_process(Pid, PName) ->
spawn(fun() ->
- register(test_server_break_process,self()),
+ register(PName, self()),
receive
continue -> continue(Pid);
cancel -> ok
@@ -1895,13 +2150,19 @@ spawn_break_process(Pid) ->
continue() ->
case whereis(test_server_break_process) of
- undefined ->
- ok;
- BreakProcess ->
- BreakProcess ! continue
+ undefined -> ok;
+ BreakProcess -> BreakProcess ! continue
end.
-continue(Pid) ->
+continue(TestCase) when is_atom(TestCase) ->
+ PName = list_to_atom("test_server_break_process_" ++
+ atom_to_list(TestCase)),
+ case whereis(PName) of
+ undefined -> ok;
+ BreakProcess -> BreakProcess ! continue
+ end;
+
+continue(Pid) when is_pid(Pid) ->
Pid ! continue.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1919,14 +2180,10 @@ timetrap_scale_factor() ->
{false,true} -> 2 * F0;
{false,false} -> F0
end,
- F2 = case has_superfluous_schedulers() of
+ F = case has_superfluous_schedulers() of
true -> 3*F1;
false -> F1
end,
- F = case test_server_sup:get_os_family() of
- vxworks -> 5 * F2;
- _ -> F2
- end,
case test_server:is_cover() of
true -> 10 * F;
false -> F
@@ -1939,26 +2196,56 @@ timetrap_scale_factor() ->
%%
%% Creates a time trap, that will kill the calling process if the
%% trap is not cancelled with timetrap_cancel/1, within Timeout milliseconds.
-timetrap(Timeout0) ->
- Timeout = time_ms(Timeout0),
- cancel_default_timetrap(),
- case get(test_server_multiply_timetraps) of
- undefined -> timetrap1(Timeout, true);
- {undefined,false} -> timetrap1(Timeout, false);
- {undefined,_} -> timetrap1(Timeout, true);
- {infinity,_} -> infinity;
- {_Int,_Scale} when Timeout == infinity -> infinity;
- {Int,Scale} -> timetrap1(Timeout*Int, Scale)
- end.
+timetrap(Timeout) ->
+ MultAndScale =
+ case get(test_server_multiply_timetraps) of
+ undefined -> {fun(T) -> T end, true};
+ {undefined,false} -> {fun(T) -> T end, false};
+ {undefined,_} -> {fun(T) -> T end, true};
+ {infinity,_} -> {fun(_) -> infinity end, false};
+ {Int,Scale} -> {fun(infinity) -> infinity;
+ (T) -> T*Int end, Scale}
+ end,
+ timetrap(Timeout, Timeout, self(), MultAndScale).
+
+%% when the function is called from different process than
+%% the test case, the test_server_multiply_timetraps data
+%% is unknown and must be passed as argument
+timetrap(Timeout, TCPid, MultAndScale) ->
+ timetrap(Timeout, Timeout, TCPid, MultAndScale).
+
+timetrap(Timeout0, TimeToReport0, TCPid, MultAndScale = {Multiplier,Scale}) ->
+ %% the time_ms call will either convert Timeout to ms or spawn a
+ %% user timetrap which sends the result to the IO server process
+ Timeout = time_ms(Timeout0, TCPid, MultAndScale),
+ Timeout1 = Multiplier(Timeout),
+ TimeToReport = if Timeout0 == TimeToReport0 ->
+ Timeout1;
+ true ->
+ %% only convert to ms, don't start a
+ %% user timetrap
+ time_ms_check(TimeToReport0)
+ end,
+ cancel_default_timetrap(self() == TCPid),
+ Handle = case Timeout1 of
+ infinity ->
+ infinity;
+ _ ->
+ spawn_link(test_server_sup,timetrap,[Timeout1,TimeToReport,
+ Scale,TCPid])
+ end,
+
+ %% ERROR! This sets dict on IO process instead of testcase process
+ %% if Timeout is return value from previous user timetrap!!
-timetrap1(Timeout, Scale) ->
- TCPid = self(),
- Ref = spawn_link(test_server_sup,timetrap,[Timeout,Scale,TCPid]),
case get(test_server_timetraps) of
- undefined -> put(test_server_timetraps,[{Ref,TCPid,{Timeout,Scale}}]);
- List -> put(test_server_timetraps,[{Ref,TCPid,{Timeout,Scale}}|List])
+ undefined ->
+ put(test_server_timetraps,[{Handle,TCPid,{TimeToReport,Scale}}]);
+ List ->
+ List1 = lists:delete({infinity,TCPid,{infinity,false}}, List),
+ put(test_server_timetraps,[{Handle,TCPid,{TimeToReport,Scale}}|List1])
end,
- Ref.
+ Handle.
ensure_timetrap(Config) ->
case get(test_server_timetraps) of
@@ -1983,7 +2270,10 @@ ensure_timetrap(Config) ->
put(test_server_default_timetrap, timetrap(seconds(DTmo)))
end.
-cancel_default_timetrap() ->
+%% executing on IO process, no default timetrap ever set here
+cancel_default_timetrap(false) ->
+ ok;
+cancel_default_timetrap(true) ->
case get(test_server_default_timetrap) of
undefined ->
ok;
@@ -2001,75 +2291,175 @@ cancel_default_timetrap() ->
error
end.
-
-time_ms({hours,N}) -> hours(N);
-time_ms({minutes,N}) -> minutes(N);
-time_ms({seconds,N}) -> seconds(N);
-time_ms({Other,_N}) ->
+time_ms({hours,N}, _, _) -> hours(N);
+time_ms({minutes,N}, _, _) -> minutes(N);
+time_ms({seconds,N}, _, _) -> seconds(N);
+time_ms({Other,_N}, _, _) ->
format("=== ERROR: Invalid time specification: ~p. "
"Should be seconds, minutes, or hours.~n", [Other]),
exit({invalid_time_format,Other});
-time_ms(Ms) when is_integer(Ms) -> Ms;
-time_ms(infinity) -> infinity;
-time_ms(Fun) when is_function(Fun) ->
- time_ms_apply(Fun);
-time_ms({M,F,A}=MFA) when is_atom(M), is_atom(F), is_list(A) ->
- time_ms_apply(MFA);
-time_ms(Other) -> exit({invalid_time_format,Other}).
-
-time_ms_apply(Func) ->
- time_ms_apply(Func, [5000,30000,60000,infinity]).
-
-time_ms_apply(Func, TOs) ->
- Apply = fun() ->
- case Func of
- {M,F,A} ->
- exit({self(),apply(M, F, A)});
- Fun ->
- exit({self(),Fun()})
- end
- end,
- Pid = spawn(Apply),
- Ref = monitor(process, Pid),
- time_ms_wait(Func, Pid, Ref, TOs).
-
-time_ms_wait(Func, Pid, Ref, [TO|TOs]) ->
- receive
- {'DOWN',Ref,process,Pid,{Pid,Result}} ->
- time_ms_check(Result);
- {'DOWN',Ref,process,Pid,Error} ->
- exit({timetrap_error,Error})
- after
- TO ->
- format("=== WARNING: No return from timetrap function ~p~n", [Func]),
- time_ms_wait(Func, Pid, Ref, TOs)
- end;
-%% this clause will never execute if 'infinity' is in TOs list, that's ok!
-time_ms_wait(Func, Pid, Ref, []) ->
- demonitor(Ref),
- exit(Pid, kill),
- exit({timetrap_error,{no_return_from_timetrap_function,Func}}).
+time_ms(Ms, _, _) when is_integer(Ms) -> Ms;
+time_ms(infinity, _, _) -> infinity;
+time_ms(Fun, TCPid, MultAndScale) when is_function(Fun) ->
+ time_ms_apply(Fun, TCPid, MultAndScale);
+time_ms({M,F,A}=MFA, TCPid, MultAndScale) when is_atom(M), is_atom(F), is_list(A) ->
+ time_ms_apply(MFA, TCPid, MultAndScale);
+time_ms(Other, _, _) -> exit({invalid_time_format,Other}).
time_ms_check(MFA = {M,F,A}) when is_atom(M), is_atom(F), is_list(A) ->
- exit({invalid_time_format,MFA});
+ MFA;
time_ms_check(Fun) when is_function(Fun) ->
- exit({invalid_time_format,Fun});
+ Fun;
time_ms_check(Other) ->
- time_ms(Other).
+ time_ms(Other, undefined, undefined).
+
+time_ms_apply(Func, TCPid, MultAndScale) ->
+ {_,GL} = process_info(TCPid, group_leader),
+ WhoAmI = self(), % either TC or IO server
+ T0 = now(),
+ UserTTSup =
+ spawn(fun() ->
+ user_timetrap_supervisor(Func, WhoAmI, TCPid,
+ GL, T0, MultAndScale)
+ end),
+ receive
+ {UserTTSup,infinity} ->
+ %% remember the user timetrap so that it can be cancelled
+ save_user_timetrap(TCPid, UserTTSup, T0),
+ %% we need to make sure the user timetrap function
+ %% gets time to execute and return
+ timetrap(infinity, TCPid, MultAndScale)
+ after 5000 ->
+ exit(UserTTSup, kill),
+ if WhoAmI /= GL ->
+ exit({user_timetrap_error,time_ms_apply});
+ true ->
+ format("=== ERROR: User timetrap execution failed!", []),
+ ignore
+ end
+ end.
+
+user_timetrap_supervisor(Func, Spawner, TCPid, GL, T0, MultAndScale) ->
+ process_flag(trap_exit, true),
+ Spawner ! {self(),infinity},
+ MonRef = monitor(process, TCPid),
+ UserTTSup = self(),
+ group_leader(GL, UserTTSup),
+ UserTT = spawn_link(fun() -> call_user_timetrap(Func, UserTTSup) end),
+ receive
+ {UserTT,Result} ->
+ demonitor(MonRef, [flush]),
+ Elapsed = trunc(timer:now_diff(now(), T0) / 1000),
+ try time_ms_check(Result) of
+ TimeVal ->
+ %% this is the new timetrap value to set (return value
+ %% from a fun or an MFA)
+ GL ! {user_timetrap,TCPid,TimeVal,T0,Elapsed,MultAndScale}
+ catch _:_ ->
+ %% when other than a legal timetrap value is returned
+ %% which will be the normal case for user timetraps
+ GL ! {user_timetrap,TCPid,0,T0,Elapsed,MultAndScale}
+ end;
+ {'EXIT',UserTT,Error} when Error /= normal ->
+ demonitor(MonRef, [flush]),
+ GL ! {user_timetrap,TCPid,0,T0,{user_timetrap_error,Error},
+ MultAndScale};
+ {'DOWN',MonRef,_,_,_} ->
+ demonitor(MonRef, [flush]),
+ exit(UserTT, kill)
+ end.
+
+call_user_timetrap(Func, Sup) when is_function(Func) ->
+ try Func() of
+ Result ->
+ Sup ! {self(),Result}
+ catch _:Error ->
+ exit({Error,erlang:get_stacktrace()})
+ end;
+call_user_timetrap({M,F,A}, Sup) ->
+ try apply(M,F,A) of
+ Result ->
+ Sup ! {self(),Result}
+ catch _:Error ->
+ exit({Error,erlang:get_stacktrace()})
+ end.
+
+save_user_timetrap(TCPid, UserTTSup, StartTime) ->
+ %% save pid of user timetrap supervisor process so that
+ %% it may be stopped even before the timetrap func has returned
+ NewUserTT = {TCPid,{UserTTSup,StartTime}},
+ case get(test_server_user_timetrap) of
+ undefined ->
+ put(test_server_user_timetrap, [NewUserTT]);
+ UserTTSups ->
+ case proplists:get_value(TCPid, UserTTSups) of
+ undefined ->
+ put(test_server_user_timetrap,
+ [NewUserTT | UserTTSups]);
+ PrevTTSup ->
+ %% remove prev user timetrap
+ remove_user_timetrap(PrevTTSup),
+ put(test_server_user_timetrap,
+ [NewUserTT | proplists:delete(TCPid,
+ UserTTSups)])
+ end
+ end.
+
+update_user_timetraps(TCPid, StartTime) ->
+ %% called when a user timetrap is triggered
+ case get(test_server_user_timetrap) of
+ undefined ->
+ proceed;
+ UserTTs ->
+ case proplists:get_value(TCPid, UserTTs) of
+ {_UserTTSup,StartTime} -> % same timetrap
+ put(test_server_user_timetrap,
+ proplists:delete(TCPid, UserTTs)),
+ proceed;
+ {OtherUserTTSup,OtherStartTime} ->
+ case timer:now_diff(OtherStartTime, StartTime) of
+ Diff when Diff >= 0 ->
+ ignore;
+ _ ->
+ exit(OtherUserTTSup, kill),
+ put(test_server_user_timetrap,
+ proplists:delete(TCPid, UserTTs)),
+ proceed
+ end;
+ undefined ->
+ proceed
+ end
+ end.
+
+remove_user_timetrap(TTSup) ->
+ exit(TTSup, kill).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% timetrap_cancel(Handle) -> ok
%% Handle = term()
%%
%% Cancels a time trap.
-timetrap_cancel(infinity) ->
- ok;
timetrap_cancel(Handle) ->
+ timetrap_cancel_one(Handle, true).
+
+timetrap_cancel_one(infinity, _SendToServer) ->
+ ok;
+timetrap_cancel_one(Handle, SendToServer) ->
case get(test_server_timetraps) of
- undefined -> ok;
- [{Handle,_,_}] -> erase(test_server_timetraps);
- Timers -> put(test_server_timetraps,
- lists:keydelete(Handle, 1, Timers))
+ undefined ->
+ ok;
+ [{Handle,_,_}] ->
+ erase(test_server_timetraps);
+ Timers ->
+ case lists:keysearch(Handle, 1, Timers) of
+ {value,_} ->
+ put(test_server_timetraps,
+ lists:keydelete(Handle, 1, Timers));
+ false when SendToServer == true ->
+ group_leader() ! {timetrap_cancel_one,Handle,self()};
+ false ->
+ ok
+ end
end,
test_server_sup:timetrap_cancel(Handle).
@@ -2078,31 +2468,59 @@ timetrap_cancel(Handle) ->
%%
%% Cancels timetrap for current test case.
timetrap_cancel() ->
+ timetrap_cancel_all(self(), true).
+
+timetrap_cancel_all(TCPid, SendToServer) ->
case get(test_server_timetraps) of
undefined ->
ok;
Timers ->
- case lists:keysearch(self(), 2, Timers) of
- {value,{Handle,_,_}} ->
- timetrap_cancel(Handle);
- _ ->
+ [timetrap_cancel_one(Handle, false) ||
+ {Handle,Pid,_} <- Timers, Pid == TCPid]
+ end,
+ case get(test_server_user_timetrap) of
+ undefined ->
+ ok;
+ UserTTs ->
+ case proplists:get_value(TCPid, UserTTs) of
+ {UserTTSup,_StartTime} ->
+ remove_user_timetrap(UserTTSup),
+ put(test_server_user_timetrap,
+ proplists:delete(TCPid, UserTTs));
+ undefined ->
ok
end
- end.
+ end,
+ if SendToServer == true ->
+ group_leader() ! {timetrap_cancel_all,TCPid,self()};
+ true ->
+ ok
+ end,
+ ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% get_timetrap_info() -> {Timeout,Scale} | undefined
%%
%% Read timetrap info for current test case
get_timetrap_info() ->
+ get_timetrap_info(self(), true).
+
+get_timetrap_info(TCPid, SendToServer) ->
case get(test_server_timetraps) of
undefined ->
undefined;
Timers ->
- case lists:keysearch(self(), 2, Timers) of
- {value,{_,_,Info}} ->
- Info;
- _ ->
+ case [Info || {Handle,Pid,Info} <- Timers,
+ Pid == TCPid, Handle /= infinity] of
+ [I|_] ->
+ I;
+ [] when SendToServer == true ->
+ MsgLooper = group_leader(),
+ MsgLooper ! {get_timetrap_info,TCPid,self()},
+ receive
+ {MsgLooper,get_timetrap_info,I} -> I
+ end;
+ [] ->
undefined
end
end.
@@ -2528,11 +2946,23 @@ read_comment() ->
MsgLooper = group_leader(),
MsgLooper ! {read_comment,self()},
receive
- {MsgLooper,read_comment,Comment} ->
- Comment
+ {MsgLooper,read_comment,Comment} -> Comment
+ after
+ 5000 -> ""
+ end.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% make_priv_dir() -> ok
+%%
+%% Order test server to create the private directory
+%% for the current test case.
+make_priv_dir() ->
+ MsgLooper = group_leader(),
+ group_leader() ! {make_priv_dir,self()},
+ receive
+ {MsgLooper,make_priv_dir,Result} -> Result
after
- 5000 ->
- ""
+ 5000 -> error
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl
index 3432b3bc8e..88d86285d5 100644
--- a/lib/test_server/src/test_server_ctrl.erl
+++ b/lib/test_server/src/test_server_ctrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -162,8 +162,9 @@
-export([jobs/0, run_test/1, wait_finish/0, idle_notify/1,
abort_current_testcase/1, abort/0]).
-export([start_get_totals/1, stop_get_totals/0]).
--export([get_levels/0, set_levels/3]).
+-export([reject_io_reqs/1, get_levels/0, set_levels/3]).
-export([multiply_timetraps/1, scale_timetraps/1, get_timetrap_parameters/0]).
+-export([create_priv_dir/1]).
-export([cover/2, cover/3, cover/7,
cross_cover_analyse/1, cross_cover_analyse/2, trc/1, stop_trace/0]).
-export([testcase_callback/1]).
@@ -217,10 +218,11 @@
-define(auto_skip_color, "#FFA64D").
-define(user_skip_color, "#FF8000").
+-define(sortable_table_name, "SortableTable").
--record(state,{jobs=[],levels={1,19,10},
- multiply_timetraps=1,scale_timetraps=true,
- finish=false,
+-record(state,{jobs=[], levels={1,19,10}, reject_io_reqs=false,
+ multiply_timetraps=1, scale_timetraps=true,
+ create_priv_dir=auto_per_run, finish=false,
target_info, trc=false, cover=false, wait_for_node=[],
testcase_callback=undefined, idle_notify=[],
get_totals=false, random_seed=undefined}).
@@ -428,14 +430,6 @@ run_test(CommandLine) ->
testcase_callback(TCCB),
add_job(Name, {command_line,SpecList}),
- %% adding of jobs involves file i/o which may take long time
- %% when running a nfs mounted file system (VxWorks).
- case controller_call(get_target_info) of
- #target_info{os_family=vxworks} ->
- receive after 30000 -> ready_to_wait end;
- _ ->
- wait_now
- end,
wait_finish().
%% Converted CoverFile to a string unless it is 'none'
@@ -497,6 +491,9 @@ get_levels() ->
set_levels(Show, Major, Minor) ->
controller_call({set_levels,Show,Major,Minor}).
+reject_io_reqs(Bool) ->
+ controller_call({reject_io_reqs,Bool}).
+
multiply_timetraps(N) ->
controller_call({multiply_timetraps,N}).
@@ -506,6 +503,9 @@ scale_timetraps(Bool) ->
get_timetrap_parameters() ->
controller_call(get_timetrap_parameters).
+create_priv_dir(Value) ->
+ controller_call({create_priv_dir,Value}).
+
trc(TraceFile) ->
controller_call({trace,TraceFile}, 2*?ACCEPT_TIMEOUT).
@@ -646,8 +646,8 @@ init([Param]) ->
contact_main_target(local) ->
%% When used by a general framework, global registration of
%% test_server should not be required.
- case os:getenv("TEST_SERVER_FRAMEWORK") of
- FW when FW =:= false; FW =:= "undefined" ->
+ case get_fw_mod(undefined) of
+ undefined ->
%% Local target! The global test_server process implemented by
%% test_server.erl will not be started, so we simulate it by
%% globally registering this process instead.
@@ -811,6 +811,8 @@ handle_call({add_job,Dir,Name,TopCase,Skip}, _From, State) ->
[SpecName,{State#state.multiply_timetraps,
State#state.scale_timetraps}],
LogDir, Name, State#state.levels,
+ State#state.reject_io_reqs,
+ State#state.create_priv_dir,
State#state.testcase_callback, ExtraTools1),
NewJobs = [{Name,Pid}|State#state.jobs],
{reply, ok, State#state{jobs=NewJobs}};
@@ -820,6 +822,8 @@ handle_call({add_job,Dir,Name,TopCase,Skip}, _From, State) ->
[SpecList,{State#state.multiply_timetraps,
State#state.scale_timetraps}],
LogDir, Name, State#state.levels,
+ State#state.reject_io_reqs,
+ State#state.create_priv_dir,
State#state.testcase_callback, ExtraTools1),
NewJobs = [{Name,Pid}|State#state.jobs],
{reply, ok, State#state{jobs=NewJobs}};
@@ -837,6 +841,8 @@ handle_call({add_job,Dir,Name,TopCase,Skip}, _From, State) ->
{State#state.multiply_timetraps,
State#state.scale_timetraps}],
LogDir, Name, State#state.levels,
+ State#state.reject_io_reqs,
+ State#state.create_priv_dir,
State#state.testcase_callback, ExtraTools1),
NewJobs = [{Name,Pid}|State#state.jobs],
{reply, ok, State#state{jobs=NewJobs}}
@@ -968,6 +974,15 @@ handle_call({set_levels,Show,Major,Minor}, _From, State) ->
{reply,ok,State#state{levels={Show,Major,Minor}}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% handle_call({reject_io_reqs,Bool}, _, State) -> ok
+%% Bool = bool()
+%%
+%% May be used to switch off stdout printouts to the minor log file
+
+handle_call({reject_io_reqs,Bool}, _From, State) ->
+ {reply,ok,State#state{reject_io_reqs=Bool}};
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% handle_call({multiply_timetraps,N}, _, State) -> ok
%% N = integer() | infinity
%%
@@ -1045,6 +1060,18 @@ handle_call({cover,App,Analyse}, _From, State) ->
{reply,ok,State#state{cover={App,Analyse}}};
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% handle_call({create_priv_dir,Value}, _, State) -> ok | {error,Reason}
+%%
+%% Set create_priv_dir to either auto_per_run (create common priv dir once
+%% per test run), manual_per_tc (the priv dir name will be unique for each
+%% test case, but the user has to call test_server:make_priv_dir/0 to create
+%% it), or auto_per_tc (unique priv dir created automatically for each test
+%% case).
+
+handle_call({create_priv_dir,Value}, _From, State) ->
+ {reply,ok,State#state{create_priv_dir=Value}};
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% handle_call({testcase_callback,{Mod,Func}}, _, State) -> ok | {error,Reason}
%%
%% Add a callback function that will be called before and after every
@@ -1301,7 +1328,12 @@ terminate(_Reason, State) ->
end,
kill_all_jobs(State#state.jobs),
test_server_node:stop(State#state.target_info),
- test_server_h:restore(),
+ case lists:keysearch(sasl, 1, application:which_applications()) of
+ {value,_} ->
+ test_server_h:restore();
+ _ ->
+ ok
+ end,
ok.
kill_all_jobs([{_Name,JobPid}|Jobs]) ->
@@ -1316,14 +1348,16 @@ kill_all_jobs([]) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% spawn_tester(Mod, Func, Args, Dir, Name, Levels,
-%% TestCaseCallback, ExtraTools) -> Pid
+%% spawn_tester(Mod, Func, Args, Dir, Name, Levels, RejectIoReqs,
+%% CreatePrivDir, TestCaseCallback, ExtraTools) -> Pid
%% Mod = atom()
%% Func = atom()
%% Args = [term(),...]
%% Dir = string()
%% Name = string()
%% Levels = {integer(),integer(),integer()}
+%% RejectIoReqs = bool()
+%% CreatePrivDir = auto_per_run | manual_per_tc | auto_per_tc
%% TestCaseCallback = {CBMod,CBFunc} | undefined
%% ExtraTools = [ExtraTool,...]
%% ExtraTool = CoverInfo | TraceInfo | RandomSeed
@@ -1334,14 +1368,15 @@ kill_all_jobs([]) ->
%% When the named function is done executing, a summary of the results
%% is printed to the log files.
-spawn_tester(Mod, Func, Args, Dir, Name, Levels, TCCallback, ExtraTools) ->
+spawn_tester(Mod, Func, Args, Dir, Name, Levels, RejectIoReqs,
+ CreatePrivDir, TCCallback, ExtraTools) ->
spawn_link(
- fun() -> init_tester(Mod, Func, Args, Dir, Name, Levels,
- TCCallback, ExtraTools)
+ fun() -> init_tester(Mod, Func, Args, Dir, Name, Levels, RejectIoReqs,
+ CreatePrivDir, TCCallback, ExtraTools)
end).
-init_tester(Mod, Func, Args, Dir, Name, {SumLev,MajLev,MinLev},
- TCCallback, ExtraTools) ->
+init_tester(Mod, Func, Args, Dir, Name, {SumLev,MajLev,MinLev}, RejectIoReqs,
+ CreatePrivDir, TCCallback, ExtraTools) ->
process_flag(trap_exit, true),
put(test_server_name, Name),
put(test_server_dir, Dir),
@@ -1352,8 +1387,22 @@ init_tester(Mod, Func, Args, Dir, Name, {SumLev,MajLev,MinLev},
put(test_server_summary_level, SumLev),
put(test_server_major_level, MajLev),
put(test_server_minor_level, MinLev),
+ put(test_server_reject_io_reqs, RejectIoReqs),
+ put(test_server_create_priv_dir, CreatePrivDir),
put(test_server_random_seed, proplists:get_value(random_seed, ExtraTools)),
put(test_server_testcase_callback, TCCallback),
+ case os:getenv("TEST_SERVER_FRAMEWORK") of
+ FW when FW =:= false; FW =:= "undefined" ->
+ put(test_server_framework, '$none');
+ FW ->
+ put(test_server_framework_name, list_to_atom(FW)),
+ case os:getenv("TEST_SERVER_FRAMEWORK_NAME") of
+ FWName when FWName =:= false; FWName =:= "undefined" ->
+ put(test_server_framework_name, '$none');
+ FWName ->
+ put(test_server_framework_name, list_to_atom(FWName))
+ end
+ end,
%% before first print, read and set logging options
LogOpts = test_server_sup:framework_call(get_logopts, [], []),
put(test_server_logopts, LogOpts),
@@ -1361,13 +1410,14 @@ init_tester(Mod, Func, Args, Dir, Name, {SumLev,MajLev,MinLev},
StartedExtraTools = start_extra_tools(ExtraTools),
{TimeMy,Result} = ts_tc(Mod, Func, Args),
put(test_server_common_io_handler, undefined),
- stop_extra_tools(StartedExtraTools),
+ catch stop_extra_tools(StartedExtraTools),
case Result of
{'EXIT',test_suites_done} ->
print(25, "DONE, normal exit", []);
{'EXIT',_Pid,Reason} ->
print(1, "EXIT, reason ~p", [Reason]);
{'EXIT',Reason} ->
+ report_severe_error(Reason),
print(1, "EXIT, reason ~p", [Reason]);
_Other ->
print(25, "DONE", [])
@@ -1385,10 +1435,15 @@ init_tester(Mod, Func, Args, Dir, Name, {SumLev,MajLev,MinLev},
end,
OkN = get(test_server_ok),
FailedN = get(test_server_failed),
- print(html,"<tr><td></td><td><b>TOTAL</b></td><td></td><td></td>"
- "<td>~.3fs</td><td><b>~s</b></td><td>~p Ok, ~p Failed~s of ~p</td></tr>\n",
+ print(html,"\n</tbody>\n<tfoot>\n"
+ "<tr><td></td><td><b>TOTAL</b></td><td></td><td></td><td></td>"
+ "<td>~.3fs</td><td><b>~s</b></td><td>~p Ok, ~p Failed~s of ~p</td></tr>\n"
+ "</tfoot>\n",
[Time,SuccessStr,OkN,FailedN,SkipStr,OkN+FailedN+SkippedN]).
+report_severe_error(Reason) ->
+ test_server_sup:framework_call(report, [severe_error,Reason]).
+
%% timer:tc/3
ts_tc(M, F, A) ->
Before = ?now,
@@ -1447,7 +1502,7 @@ stop_extra_tools([], _) ->
%% Reads the named test suite specification file, and executes it.
%%
%% This function is meant to be called by a process created by
-%% spawn_tester/7, which sets up some necessary dictionary values.
+%% spawn_tester/10, which sets up some necessary dictionary values.
do_spec(SpecName, TimetrapSpec) when is_list(SpecName) ->
case file:consult(SpecName) of
@@ -1496,7 +1551,7 @@ do_spec(SpecName, TimetrapSpec) when is_list(SpecName) ->
%% should not be used. Use a configuration test case instead.
%%
%% This function is meant to be called by a process created by
-%% spawn_tester/7, which sets up some necessary dictionary values.
+%% spawn_tester/10, which sets up some necessary dictionary values.
do_spec_list(TermList0, TimetrapSpec) ->
Nodes = [],
@@ -1663,7 +1718,7 @@ add_mod(Mod, Mods) ->
%% configuration information into the log files.
%%
%% This function is meant to be called by a process created by
-%% spawn_tester/7, which sets up some necessary dictionary values.
+%% spawn_tester/10, which sets up some necessary dictionary values.
do_test_cases(TopCases, SkipCases,
Config, MultiplyTimetrap) when is_integer(MultiplyTimetrap);
MultiplyTimetrap == infinity ->
@@ -1673,11 +1728,7 @@ do_test_cases(TopCases, SkipCases,
Config, TimetrapData) when is_list(TopCases),
is_tuple(TimetrapData) ->
{ok,TestDir} = start_log_file(),
- FwMod =
- case os:getenv("TEST_SERVER_FRAMEWORK") of
- FW when FW =:= false; FW =:= "undefined" -> ?MODULE;
- FW -> list_to_atom(FW)
- end,
+ FwMod = get_fw_mod(?MODULE),
case collect_all_cases(TopCases, SkipCases) of
{error,Why} ->
print(1, "Error starting: ~p", [Why]),
@@ -1706,7 +1757,8 @@ do_test_cases(TopCases, SkipCases,
test_server_sup:framework_call(report, [tests_start,{Test,N}]),
{Header,Footer} =
case test_server_sup:framework_call(get_html_wrapper,
- [TestDescr,true,TestDir], "") of
+ [TestDescr,true,TestDir,
+ {[],[2,3,4,7,8],[1,6]}], "") of
Empty when (Empty == "") ; (element(2,Empty) == "") ->
put(basic_html, true),
{["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n",
@@ -1768,13 +1820,15 @@ do_test_cases(TopCases, SkipCases,
[?suitelog_name,?coverlog_name]),
print(html,
"<p>~s</p>\n" ++
- xhtml("<table bgcolor=\"white\" border=\"3\" cellpadding=\"5\">",
- "<table>") ++
- "<tr><th>Num</th><th>Module</th><th>Case</th><th>Log</th>"
- "<th>Time</th><th>Result</th><th>Comment</th></tr>\n",
- [print_if_known(N, {"<i>Executing <b>~p</b> test cases...</i>\n",[N]},
+ xhtml("<table bgcolor=\"white\" border=\"3\" cellpadding=\"5\">",
+ ["<table id=\"",?sortable_table_name,"\">\n",
+ "<thead>\n"]) ++
+ "<tr><th>Num</th><th>Module</th><th>Group</th>" ++
+ "<th>Case</th><th>Log</th><th>Time</th><th>Result</th>" ++
+ "<th>Comment</th></tr>\n</thead>\n<tbody>\n",
+ [print_if_known(N, {"<i>Executing <b>~p</b> test cases...</i>" ++
+ xhtml("\n<br>\n", "\n<br />\n"),[N]},
{"",[]})]),
- print(html, xhtml("<br>", "<br />")),
print(major, "=cases ~p", [get(test_server_cases)]),
print(major, "=user ~s", [TI#target_info.username]),
@@ -1812,7 +1866,7 @@ do_test_cases(TopCase, SkipCases, Config, TimetrapSpec) ->
%% Creates the log directories, the major log file and the html log file.
%% The log files are initialized with some header information.
%%
-%% The name of the log directory will be <Name>.LOGS/run.<Date>/ where
+%% The name of the log directory will be <Name>.logs/run.<Date>/ where
%% Name is the test suite name and Date is the current date and time.
start_log_file() ->
@@ -1823,7 +1877,7 @@ start_log_file() ->
{error, eexist} ->
ok;
MkDirError ->
- exit({cant_create_log_dir,{MkDirError,Dir}})
+ log_file_error(MkDirError, Dir)
end,
TestDir = timestamp_filename_get(filename:join(Dir, "run.")),
TestDir1 =
@@ -1838,10 +1892,10 @@ start_log_file() ->
ok ->
TestDirX;
MkDirError2 ->
- exit({cant_create_log_dir,{MkDirError2,TestDirX}})
+ log_file_error(MkDirError2, TestDirX)
end;
MkDirError2 ->
- exit({cant_create_log_dir,{MkDirError2,TestDir}})
+ log_file_error(MkDirError2, TestDir)
end,
ok = file:write_file(filename:join(Dir, ?last_file), TestDir1 ++ "\n"),
ok = file:write_file(?last_file, TestDir1 ++ "\n"),
@@ -1868,6 +1922,9 @@ start_log_file() ->
test_server_sup:framework_call(report, [loginfo,LogInfo]),
{ok,TestDir1}.
+log_file_error(Error, Dir) ->
+ exit({cannot_create_log_dir,{Error,lists:flatten(Dir)}}).
+
make_html_link(LinkName, Target, Explanation) ->
%% if possible use a relative reference to Target.
TargetL = filename:split(Target),
@@ -1928,7 +1985,8 @@ start_minor_log_file1(Mod, Func, LogDir, AbsName) ->
{Header,Footer} =
case test_server_sup:framework_call(get_html_wrapper,
[TestDescr,false,
- filename:dirname(AbsName)], "") of
+ filename:dirname(AbsName),
+ undefined], "") of
Empty when (Empty == "") ; (element(2,Empty) == "") ->
put(basic_html, true),
{["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n",
@@ -2058,7 +2116,7 @@ html_possibly_convert(Src, SrcInfo, Dest) ->
Header =
case test_server_sup:framework_call(get_html_wrapper,
["Module "++Src,false,
- OutDir], "") of
+ OutDir,undefined], "") of
Empty when (Empty == "") ; (element(2,Empty) == "") ->
["<!DOCTYPE HTML PUBLIC",
"\"-//W3C//DTD HTML 3.2 Final//EN\">\n",
@@ -2101,17 +2159,17 @@ add_init_and_end_per_suite([{make,_,_}=Case|Cases], LastMod, LastRef, FwMod) ->
add_init_and_end_per_suite([{skip_case,{{Mod,all},_}}=Case|Cases], LastMod,
LastRef, FwMod) when Mod =/= LastMod ->
{PreCases, NextMod, NextRef} =
- do_add_end_per_suite_and_skip(LastMod, LastRef, Mod),
+ do_add_end_per_suite_and_skip(LastMod, LastRef, Mod, FwMod),
PreCases ++ [Case|add_init_and_end_per_suite(Cases, NextMod, NextRef, FwMod)];
add_init_and_end_per_suite([{skip_case,{{Mod,_},_}}=Case|Cases], LastMod,
LastRef, FwMod) when Mod =/= LastMod ->
{PreCases, NextMod, NextRef} =
- do_add_init_and_end_per_suite(LastMod, LastRef, Mod),
+ do_add_init_and_end_per_suite(LastMod, LastRef, Mod, FwMod),
PreCases ++ [Case|add_init_and_end_per_suite(Cases, NextMod, NextRef, FwMod)];
add_init_and_end_per_suite([{skip_case,{conf,_,{Mod,_},_}}=Case|Cases], LastMod,
LastRef, FwMod) when Mod =/= LastMod ->
{PreCases, NextMod, NextRef} =
- do_add_init_and_end_per_suite(LastMod, LastRef, Mod),
+ do_add_init_and_end_per_suite(LastMod, LastRef, Mod, FwMod),
PreCases ++ [Case|add_init_and_end_per_suite(Cases, NextMod, NextRef, FwMod)];
add_init_and_end_per_suite([{skip_case,_}=Case|Cases], LastMod, LastRef, FwMod) ->
[Case|add_init_and_end_per_suite(Cases, LastMod, LastRef, FwMod)];
@@ -2123,7 +2181,7 @@ add_init_and_end_per_suite([{conf,Ref,Props,{FwMod,Func}}=Case|Cases], LastMod,
case proplists:get_value(suite, Props) of
Suite when Suite =/= undefined, Suite =/= LastMod ->
{PreCases, NextMod, NextRef} =
- do_add_init_and_end_per_suite(LastMod, LastRef, Suite),
+ do_add_init_and_end_per_suite(LastMod, LastRef, Suite, FwMod),
Case1 = {conf,Ref,proplists:delete(suite,Props),{FwMod,Func}},
PreCases ++ [Case1|add_init_and_end_per_suite(Cases, NextMod,
NextRef, FwMod)];
@@ -2133,19 +2191,19 @@ add_init_and_end_per_suite([{conf,Ref,Props,{FwMod,Func}}=Case|Cases], LastMod,
add_init_and_end_per_suite([{conf,_,_,{Mod,_}}=Case|Cases], LastMod,
LastRef, FwMod) when Mod =/= LastMod, Mod =/= FwMod ->
{PreCases, NextMod, NextRef} =
- do_add_init_and_end_per_suite(LastMod, LastRef, Mod),
+ do_add_init_and_end_per_suite(LastMod, LastRef, Mod, FwMod),
PreCases ++ [Case|add_init_and_end_per_suite(Cases, NextMod, NextRef, FwMod)];
add_init_and_end_per_suite([{conf,_,_,_}=Case|Cases], LastMod, LastRef, FwMod) ->
[Case|add_init_and_end_per_suite(Cases, LastMod, LastRef, FwMod)];
add_init_and_end_per_suite([{Mod,_}=Case|Cases], LastMod, LastRef, FwMod)
when Mod =/= LastMod, Mod =/= FwMod ->
{PreCases, NextMod, NextRef} =
- do_add_init_and_end_per_suite(LastMod, LastRef, Mod),
+ do_add_init_and_end_per_suite(LastMod, LastRef, Mod, FwMod),
PreCases ++ [Case|add_init_and_end_per_suite(Cases, NextMod, NextRef, FwMod)];
add_init_and_end_per_suite([{Mod,_,_}=Case|Cases], LastMod, LastRef, FwMod)
when Mod =/= LastMod, Mod =/= FwMod ->
{PreCases, NextMod, NextRef} =
- do_add_init_and_end_per_suite(LastMod, LastRef, Mod),
+ do_add_init_and_end_per_suite(LastMod, LastRef, Mod, FwMod),
PreCases ++ [Case|add_init_and_end_per_suite(Cases, NextMod, NextRef, FwMod)];
add_init_and_end_per_suite([Case|Cases], LastMod, LastRef, FwMod)->
[Case|add_init_and_end_per_suite(Cases, LastMod, LastRef, FwMod)];
@@ -2153,10 +2211,23 @@ add_init_and_end_per_suite([], _LastMod, undefined, _FwMod) ->
[];
add_init_and_end_per_suite([], _LastMod, skipped_suite, _FwMod) ->
[];
-add_init_and_end_per_suite([], LastMod, LastRef, _FwMod) ->
- [{conf,LastRef,[],{LastMod,end_per_suite}}].
+add_init_and_end_per_suite([], LastMod, LastRef, FwMod) ->
+ %% we'll add end_per_suite here even if it's not exported
+ %% (and simply let the call fail if it's missing)
+ case erlang:function_exported(LastMod, end_per_suite, 1) of
+ true ->
+ [{conf,LastRef,[],{LastMod,end_per_suite}}];
+ false ->
+ %% let's call a "fake" end_per_suite if it exists
+ case erlang:function_exported(FwMod, end_per_suite, 1) of
+ true ->
+ [{conf,LastRef,[{suite,LastMod}],{FwMod,end_per_suite}}];
+ false ->
+ [{conf,LastRef,[],{LastMod,end_per_suite}}]
+ end
+ end.
-do_add_init_and_end_per_suite(LastMod, LastRef, Mod) ->
+do_add_init_and_end_per_suite(LastMod, LastRef, Mod, FwMod) ->
case code:is_loaded(Mod) of
false -> code:load_file(Mod);
_ -> ok
@@ -2167,7 +2238,16 @@ do_add_init_and_end_per_suite(LastMod, LastRef, Mod) ->
Ref = make_ref(),
{[{conf,Ref,[],{Mod,init_per_suite}}],Mod,Ref};
false ->
- {[],Mod,undefined}
+ %% let's call a "fake" init_per_suite if it exists
+ case erlang:function_exported(FwMod, init_per_suite, 1) of
+ true ->
+ Ref = make_ref(),
+ {[{conf,Ref,[{suite,Mod}],
+ {FwMod,init_per_suite}}],Mod,Ref};
+ false ->
+ {[],Mod,undefined}
+ end
+
end,
Cases =
if LastRef==undefined ->
@@ -2175,20 +2255,44 @@ do_add_init_and_end_per_suite(LastMod, LastRef, Mod) ->
LastRef==skipped_suite ->
Init;
true ->
- %% Adding end_per_suite here without checking if the
- %% function is actually exported. This is because a
- %% conf case must have an end case - so if it doesn't
- %% exist, it will only fail...
- [{conf,LastRef,[],{LastMod,end_per_suite}}|Init]
+ %% we'll add end_per_suite here even if it's not exported
+ %% (and simply let the call fail if it's missing)
+ case erlang:function_exported(LastMod, end_per_suite, 1) of
+ true ->
+ [{conf,LastRef,[],{LastMod,end_per_suite}}|Init];
+ false ->
+ %% let's call a "fake" end_per_suite if it exists
+ case erlang:function_exported(FwMod, end_per_suite, 1) of
+ true ->
+ [{conf,LastRef,[{suite,Mod}],
+ {FwMod,end_per_suite}}|Init];
+ false ->
+ [{conf,LastRef,[],{LastMod,end_per_suite}}|Init]
+ end
+ end
end,
{Cases,NextMod,NextRef}.
-do_add_end_per_suite_and_skip(LastMod, LastRef, Mod) ->
+do_add_end_per_suite_and_skip(LastMod, LastRef, Mod, FwMod) ->
case LastRef of
No when No==undefined ; No==skipped_suite ->
{[],Mod,skipped_suite};
_Ref ->
- {[{conf,LastRef,[],{LastMod,end_per_suite}}],Mod,skipped_suite}
+ case erlang:function_exported(LastMod, end_per_suite, 1) of
+ true ->
+ {[{conf,LastRef,[],{LastMod,end_per_suite}}],
+ Mod,skipped_suite};
+ false ->
+ case erlang:function_exported(FwMod, end_per_suite, 1) of
+ true ->
+ %% let's call "fake" end_per_suite if it exists
+ {[{conf,LastRef,[],{FwMod,end_per_suite}}],
+ Mod,skipped_suite};
+ false ->
+ {[{conf,LastRef,[],{LastMod,end_per_suite}}],
+ Mod,skipped_suite}
+ end
+ end
end.
@@ -2748,7 +2852,16 @@ run_test_cases_loop([{conf,Ref,Props,{Mod,Func}}|_Cases]=Cs0,
{skipped,TcSkip},
{failed,TcFail}]}]
end,
- TSDirs = [{priv_dir,get(test_server_priv_dir)},{data_dir,get_data_dir(Mod)}],
+
+ SuiteName = proplists:get_value(suite, Props),
+ case get(test_server_create_priv_dir) of
+ auto_per_run -> % use common priv_dir
+ TSDirs = [{priv_dir,get(test_server_priv_dir)},
+ {data_dir,get_data_dir(Mod, SuiteName)}];
+ _ ->
+ TSDirs = [{data_dir,get_data_dir(Mod, SuiteName)}]
+ end,
+
ActualCfg =
if not StartConf ->
update_config(hd(Config), TSDirs ++ CfgProps);
@@ -2758,7 +2871,8 @@ run_test_cases_loop([{conf,Ref,Props,{Mod,Func}}|_Cases]=Cs0,
end, Mode0),
update_config(hd(Config),
TSDirs ++ [{tc_group_path,GroupPath} | CfgProps])
- end,
+ end,
+
CurrMode = curr_mode(Ref, Mode0, Mode),
ConfCaseResult = run_test_case(Ref, 0, Mod, Func, [ActualCfg], skip_init, target,
TimetrapData, CurrMode),
@@ -2910,8 +3024,13 @@ run_test_cases_loop([{conf,_Ref,_Props,_X}=Conf|_Cases0],
run_test_cases_loop([{Mod,Case}|Cases], Config, TimetrapData, Mode, Status) ->
ActualCfg =
- update_config(hd(Config), [{priv_dir,get(test_server_priv_dir)},
- {data_dir,get_data_dir(Mod)}]),
+ case get(test_server_create_priv_dir) of
+ auto_per_run ->
+ update_config(hd(Config), [{priv_dir,get(test_server_priv_dir)},
+ {data_dir,get_data_dir(Mod)}]);
+ _ ->
+ update_config(hd(Config), [{data_dir,get_data_dir(Mod)}])
+ end,
run_test_cases_loop([{Mod,Case,[ActualCfg]}|Cases], Config,
TimetrapData, Mode, Status);
@@ -3076,13 +3195,20 @@ conf_start(Ref, Mode) ->
false -> 0
end.
+
get_data_dir(Mod) ->
- case code:which(Mod) of
+ get_data_dir(Mod, undefined).
+
+get_data_dir(Mod, Suite) ->
+ UseMod = if Suite == undefined -> Mod;
+ true -> Suite
+ end,
+ case code:which(UseMod) of
non_existing ->
print(12, "The module ~p is not loaded", [Mod]),
[];
FullPath ->
- filename:dirname(FullPath) ++ "/" ++ cast_to_list(Mod) ++
+ filename:dirname(FullPath) ++ "/" ++ cast_to_list(UseMod) ++
?data_dir_suffix
end.
@@ -3248,16 +3374,21 @@ skip_case1(Type, CaseNum, Mod, Func, Comment, Mode) ->
print(major, "=started ~s", [lists:flatten(timestamp_get(""))]),
print(major, "=result skipped: ~s", [Comment1]),
print(2,"*** Skipping test case #~w ~p ***", [CaseNum,{Mod,Func}]),
- TR = xhtml("<tr valign=\"top\">", ["<tr class=\"",odd_or_even(),"\">"]),
+ TR = xhtml("<tr valign=\"top\">", ["<tr class=\"",odd_or_even(),"\">"]),
+ GroupName = case get_name(Mode) of
+ undefined -> "";
+ Name -> cast_to_list(Name)
+ end,
print(html,
TR ++ "<td>" ++ Col0 ++ "~s" ++ Col1 ++ "</td>"
"<td>" ++ Col0 ++ "~p" ++ Col1 ++ "</td>"
+ "<td>" ++ Col0 ++ "~s" ++ Col1 ++ "</td>"
"<td>" ++ Col0 ++ "~p" ++ Col1 ++ "</td>"
"<td>" ++ Col0 ++ "< >" ++ Col1 ++ "</td>"
"<td>" ++ Col0 ++ "0.000s" ++ Col1 ++ "</td>"
"<td><font color=\"~s\">SKIPPED</font></td>"
"<td>~s</td></tr>\n",
- [num2str(CaseNum),Mod,Func,ResultCol,Comment1]),
+ [num2str(CaseNum),fw_name(Mod),GroupName,Func,ResultCol,Comment1]),
if CaseNum > 0 ->
{US,AS} = get(test_server_skipped),
case Type of
@@ -3627,9 +3758,14 @@ run_test_case1(Ref, Num, Mod, Func, Args, RunInit, Where,
%% if this runs on a parallel test case process,
%% copy the dictionary from the main process
do_if_parallel(Main, fun() -> process_flag(trap_exit, true) end, ok),
- CopyDict = fun() -> lists:foreach(fun({Key,Val}) -> put(Key, Val) end, State) end,
+ CopyDict = fun() -> lists:foreach(fun({Key,Val}) ->
+ put(Key, Val)
+ end, State)
+ end,
do_if_parallel(Main, CopyDict, ok),
- do_if_parallel(Main, fun() -> put(test_server_common_io_handler, {tc,Main}) end, ok),
+ do_if_parallel(Main, fun() ->
+ put(test_server_common_io_handler, {tc,Main})
+ end, ok),
%% if io is being buffered, send start io session message
%% (no matter if case runs on parallel or main process)
case get(test_server_common_io_handler) of
@@ -3649,24 +3785,58 @@ run_test_case1(Ref, Num, Mod, Func, Args, RunInit, Where,
MinorBase = filename:basename(MinorName),
print(major, "=logfile ~s", [filename:basename(MinorName)]),
- Args1 = [[{tc_logfile,MinorName} | proplists:delete(tc_logfile,hd(Args))]],
- test_server_sup:framework_call(report, [tc_start,{{?pl2a(Mod),Func},MinorName}]),
+ UpdatedArgs =
+ %% maybe create unique private directory for test case or config func
+ case get(test_server_create_priv_dir) of
+ auto_per_run ->
+ update_config(hd(Args), [{tc_logfile,MinorName}]);
+ PrivDirMode ->
+ RunDir = filename:dirname(MinorName),
+ Ext =
+ if Num == 0 ->
+ {_,S,Us} = now(),
+ lists:flatten(io_lib:format(".~w.~w", [S,Us]));
+ true ->
+ %% create unique private directory for test case
+ RunDir = filename:dirname(MinorName),
+ lists:flatten(io_lib:format(".~w", [Num]))
+ end,
+ PrivDir = filename:join(RunDir, ?priv_dir) ++ Ext,
+ if PrivDirMode == auto_per_tc ->
+ ok = file:make_dir(PrivDir);
+ PrivDirMode == manual_per_tc ->
+ ok
+ end,
+ update_config(hd(Args), [{priv_dir,PrivDir++"/"},
+ {tc_logfile,MinorName}])
+ end,
+
+ test_server_sup:framework_call(report,
+ [tc_start,{{?pl2a(Mod),Func},MinorName}]),
print_props((RunInit==skip_init), get_props(Mode)),
+ GroupName = case get_name(Mode) of
+ undefined -> "";
+ Name -> cast_to_list(Name)
+ end,
print(major, "=started ~s", [lists:flatten(timestamp_get(""))]),
{{Col0,Col1},Style} = get_font_style((RunInit==run_init), Mode),
TR = xhtml("<tr valign=\"top\">", ["<tr class=\"",odd_or_even(),"\">"]),
print(html, TR ++ "<td>" ++ Col0 ++ "~s" ++ Col1 ++ "</td>"
"<td>" ++ Col0 ++ "~p" ++ Col1 ++ "</td>"
+ "<td>" ++ Col0 ++ "~s" ++ Col1 ++ "</td>"
"<td><a href=\"~s\">~p</a></td>"
"<td><a href=\"~s#top\"><</a> <a href=\"~s#end\">></a></td>",
- [num2str(Num),Mod,MinorBase,Func,MinorBase,MinorBase]),
+ [num2str(Num),fw_name(Mod),GroupName,MinorBase,Func,
+ MinorBase,MinorBase]),
do_if_parallel(Main, ok, fun erlang:yield/0),
+
+ RejectIoReqs = get(test_server_reject_io_reqs),
%% run the test case
{Result,DetectedFail,ProcsBefore,ProcsAfter} =
- run_test_case_apply(Num, Mod, Func, Args1, get_name(Mode),
- RunInit, Where, TimetrapData),
+ run_test_case_apply(Num, Mod, Func, [UpdatedArgs], get_name(Mode),
+ RunInit, Where, TimetrapData, RejectIoReqs),
{Time,RetVal,Loc,Opts,Comment} =
case Result of
Normal={_Time,_RetVal,_Loc,_Opts,_Comment} -> Normal;
@@ -4107,6 +4277,46 @@ progress(ok, _CaseNum, Mod, Func, _Loc, RetVal, Time,
%%--------------------------------------------------------------------
%% various help functions
+get_fw_mod(Mod) ->
+ case get(test_server_framework) of
+ undefined ->
+ case os:getenv("TEST_SERVER_FRAMEWORK") of
+ FW when FW =:= false; FW =:= "undefined" ->
+ Mod;
+ FW ->
+ list_to_atom(FW)
+ end;
+ '$none' -> Mod;
+ FW -> FW
+ end.
+
+fw_name(?MODULE) ->
+ test_server;
+fw_name(Mod) ->
+ case get(test_server_framework_name) of
+ undefined ->
+ case get_fw_mod(undefined) of
+ undefined ->
+ Mod;
+ Mod ->
+ case os:getenv("TEST_SERVER_FRAMEWORK_NAME") of
+ FWName when FWName =:= false; FWName =:= "undefined" ->
+ Mod;
+ FWName ->
+ list_to_atom(FWName)
+ end;
+ _ ->
+ Mod
+ end;
+ '$none' ->
+ Mod;
+ FWName ->
+ case get_fw_mod(Mod) of
+ Mod -> FWName;
+ _ -> Mod
+ end
+ end.
+
if_auto_skip(Reason={failed,{_,init_per_testcase,_}}, True, _False) ->
{Reason,True()};
if_auto_skip({_T,{skip,Reason={failed,{_,init_per_testcase,_}}},_Opts}, True, _False) ->
@@ -4210,8 +4420,8 @@ get_font_style1(default) ->
%% set to false.
format_exception(Reason={_Error,Stack}) when is_list(Stack) ->
- case os:getenv("TEST_SERVER_FRAMEWORK") of
- FW when FW =:= false; FW =:= "undefined" ->
+ case get_fw_mod(undefined) of
+ undefined ->
case application:get_env(test_server, format_exception) of
{ok,false} ->
{"~p",Reason};
@@ -4219,7 +4429,7 @@ format_exception(Reason={_Error,Stack}) when is_list(Stack) ->
do_format_exception(Reason)
end;
FW ->
- case application:get_env(list_to_atom(FW), format_exception) of
+ case application:get_env(FW, format_exception) of
{ok,false} ->
{"~p",Reason};
_ ->
@@ -4245,7 +4455,7 @@ do_format_exception(Reason={Error,Stack}) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% run_test_case_apply(CaseNum, Mod, Func, Args, Name, RunInit,
-%% Where, TimetrapData) ->
+%% Where, TimetrapData, RejectIoReqs) ->
%% {{Time,RetVal,Loc,Opts,Comment},DetectedFail,ProcessesBefore,ProcessesAfter} |
%% {{died,Reason,unknown,Comment},DetectedFail,ProcessesBefore,ProcessesAfter}
%% Name = atom()
@@ -4264,19 +4474,21 @@ do_format_exception(Reason={Error,Stack}) ->
%% sent over socket to target, and test_server runs the case and sends the
%% result back over the socket. Else test_server runs the case directly on host.
-run_test_case_apply(CaseNum, Mod, Func, Args, Name, RunInit, host, TimetrapData) ->
+run_test_case_apply(CaseNum, Mod, Func, Args, Name, RunInit, host,
+ TimetrapData, RejectIoReqs) ->
test_server:run_test_case_apply({CaseNum,Mod,Func,Args,Name,RunInit,
- TimetrapData});
-run_test_case_apply(CaseNum, Mod, Func, Args, Name, RunInit, target, TimetrapData) ->
+ TimetrapData,RejectIoReqs});
+run_test_case_apply(CaseNum, Mod, Func, Args, Name, RunInit, target,
+ TimetrapData, RejectIoReqs) ->
case get(test_server_ctrl_job_sock) of
undefined ->
%% local target
test_server:run_test_case_apply({CaseNum,Mod,Func,Args,Name,RunInit,
- TimetrapData});
+ TimetrapData,RejectIoReqs});
JobSock ->
%% remote target
request(JobSock, {test_case,{CaseNum,Mod,Func,Args,Name,RunInit,
- TimetrapData}}),
+ TimetrapData,RejectIoReqs}}),
read_job_sock_loop(JobSock)
end.
@@ -4474,21 +4686,16 @@ output_to_fd(stdout, Msg, Sender) ->
io:format("Testing ~s: ~s\n", [Name, lists:flatten(Msg)]);
output_to_fd(undefined, _Msg, _Sender) ->
ok;
-output_to_fd(Fd, [$=|Msg], internal) ->
- io:put_chars(Fd, [$=]),
- io:put_chars(Fd, Msg),
- io:put_chars(Fd, "\n");
+output_to_fd(Fd, Msg=[$=|_], internal) ->
+ io:put_chars(Fd, [Msg,"\n"]);
output_to_fd(Fd, Msg, internal) ->
- io:put_chars(Fd, [$=,$=,$=,$ ]),
- io:put_chars(Fd, Msg),
- io:put_chars(Fd, "\n");
+ io:put_chars(Fd, [$=,$=,$=,$ , Msg, "\n"]);
output_to_fd(Fd, Msg, _Sender) ->
- io:put_chars(Fd, Msg),
case get(test_server_log_nl) of
- false -> ok;
- _ -> io:put_chars(Fd, "\n")
+ false -> io:put_chars(Fd, Msg);
+ _ -> io:put_chars(Fd, [Msg,"\n"])
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -4815,8 +5022,8 @@ collect_case([Case | Cases], St, Acc) ->
collect_case(Cases, NewSt, Acc ++ FlatCases).
collect_case_invoke(Mod, Case, MFA, St) ->
- case os:getenv("TEST_SERVER_FRAMEWORK") of
- FW when FW =:= false; FW =:= "undefined" ->
+ case get_fw_mod(undefined) of
+ undefined ->
case catch apply(Mod, Case, [suite]) of
{'EXIT',_} ->
{ok,[MFA],St};
@@ -4824,7 +5031,9 @@ collect_case_invoke(Mod, Case, MFA, St) ->
collect_subcases(Mod, Case, MFA, St, Suite)
end;
_ ->
- Suite = test_server_sup:framework_call(get_suite, [?pl2a(Mod),Case], []),
+ Suite = test_server_sup:framework_call(get_suite,
+ [?pl2a(Mod),Case],
+ []),
collect_subcases(Mod, Case, MFA, St, Suite)
end.
@@ -4978,7 +5187,9 @@ init_props(Props) ->
end.
keep_name(Props) ->
- lists:filter(fun({name,_}) -> true; (_) -> false end, Props).
+ lists:filter(fun({name,_}) -> true;
+ ({suite,_}) -> true;
+ (_) -> false end, Props).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Target node handling functions %%
@@ -5618,11 +5829,11 @@ write_default_cross_coverlog(TestDir) ->
{ok,CrossCoverLog} =
file:open(filename:join(TestDir,?cross_coverlog_name), [write]),
write_coverlog_header(CrossCoverLog),
- io:fwrite(CrossCoverLog,
- ["No cross cover modules exist for this application,",
- xhtml("<br>","<br />"),
- "or cross cover analysis is not completed.\n"
- "</body></html>\n"], []),
+ io:put_chars(CrossCoverLog,
+ ["No cross cover modules exist for this application,",
+ xhtml("<br>","<br />"),
+ "or cross cover analysis is not completed.\n"
+ "</body></html>\n"]),
file:close(CrossCoverLog).
write_cover_result_table(CoverLog,Coverage) ->
diff --git a/lib/test_server/src/test_server_h.erl b/lib/test_server/src/test_server_h.erl
index e423863b99..fdeee59326 100644
--- a/lib/test_server/src/test_server_h.erl
+++ b/lib/test_server/src/test_server_h.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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
@@ -79,10 +79,21 @@ set_group_leader() ->
handle_event({_Type, GL, _Msg}, State) when node(GL)/=node() ->
{ok, State};
handle_event({Tag, _GL, {_Pid, Type, _Report}} = Event, State) ->
- case report(Tag, Type) of
- sasl ->
- tag(State#state.testcase),
- sasl_report_tty_h:handle_event(Event, State#state.sasl);
+ SASL = lists:keyfind(sasl, 1, application:which_applications()),
+ case report_receiver(Tag, Type) of
+ sasl when SASL /= false ->
+ {ok,ErrLogType} = application:get_env(sasl, errlog_type),
+ SReport = sasl_report:format_report(group_leader(), ErrLogType,
+ tag_event(Event)),
+ if is_list(SReport) ->
+ tag(State#state.testcase),
+ sasl_report_tty_h:handle_event(Event,
+ State#state.sasl);
+ true -> %% Report is an atom if no logging is to be done
+ ignore
+ end;
+ sasl -> %% SASL not running
+ ignore;
kernel ->
tag(State#state.testcase),
error_logger_tty_h:handle_event(Event, State#state.kernel);
@@ -111,19 +122,22 @@ terminate(_Reason, _State) ->
code_change(_OldVsn, State, _Extra) ->
{ok, State}.
-report(error_report, supervisor_report) -> sasl;
-report(error_report, crash_report) -> sasl;
-report(info_report, progress) -> sasl;
-report(error, _) -> kernel;
-report(error_report, _) -> kernel;
-report(warning_msg, _) -> kernel;
-report(warning_report, _) -> kernel;
-report(info, _) -> kernel;
-report(info_msg, _) -> kernel;
-report(info_report, _) -> kernel;
-report(_, _) -> none.
+report_receiver(error_report, supervisor_report) -> sasl;
+report_receiver(error_report, crash_report) -> sasl;
+report_receiver(info_report, progress) -> sasl;
+report_receiver(error, _) -> kernel;
+report_receiver(error_report, _) -> kernel;
+report_receiver(warning_msg, _) -> kernel;
+report_receiver(warning_report, _) -> kernel;
+report_receiver(info, _) -> kernel;
+report_receiver(info_msg, _) -> kernel;
+report_receiver(info_report, _) -> kernel;
+report_receiver(_, _) -> none.
tag({M,F,A}) when is_atom(M), is_atom(F), is_integer(A) ->
io:format(user, "~n=TESTCASE: ~p:~p/~p", [M,F,A]);
tag(Testcase) ->
io:format(user, "~n=TESTCASE: ~p", [Testcase]).
+
+tag_event(Event) ->
+ {calendar:local_time(), Event}.
diff --git a/lib/test_server/src/test_server_internal.hrl b/lib/test_server/src/test_server_internal.hrl
index c9c52854e3..b58b42805e 100644
--- a/lib/test_server/src/test_server_internal.hrl
+++ b/lib/test_server/src/test_server_internal.hrl
@@ -25,7 +25,7 @@
%% test_server_ctrl:contact_main_target/2
%% Once initiated, this information will never change!!
-record(target_info, {where, % local | Socket
- os_family, % atom(); win32 | unix | vxworks | ose
+ os_family, % atom(); win32 | unix
os_type, % result of os:type()
host, % string(); the name of the target machine
version, % string()
diff --git a/lib/test_server/src/test_server_node.erl b/lib/test_server/src/test_server_node.erl
index 1fd40d1dd9..17c02dfbe5 100644
--- a/lib/test_server/src/test_server_node.erl
+++ b/lib/test_server/src/test_server_node.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2012. 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
@@ -35,7 +35,6 @@
-include("test_server_internal.hrl").
-record(slave_info, {name,socket,client}).
--define(VXWORKS_ACCEPT_TIMEOUT,?ACCEPT_TIMEOUT).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% %%%
@@ -72,14 +71,6 @@ start_remote_main_target(Parameters) ->
lists:foreach(fun(T) -> maybe_reboot_target({TargetType,T}) end,
[list_to_atom(TargetHost)|SlaveTargets]),
- % Must give the targets a chance to reboot...
- case TargetType of
- vxworks ->
- receive after 15000 -> ok end;
- _ ->
- ok
- end,
-
Cmd0 = get_main_target_start_command(TargetType,TargetHost,Naming,
MasterNode,MasterCookie),
Cmd =
@@ -407,7 +398,7 @@ start_node_peer(SlaveName, OptList, From, TI) ->
% Support for erl_crash_dump files..
CrashFile = filename:join([TI#target_info.test_server_dir,
"erl_crash_dump."++cast_to_list(SlaveName)]),
- CrashArgs = lists:concat([" -env ERL_CRASH_DUMP ",CrashFile," "]),
+ CrashArgs = lists:concat([" -env ERL_CRASH_DUMP \"",CrashFile,"\" "]),
FailOnError = start_node_get_option_value(fail_on_error, OptList, true),
Pa = TI#target_info.test_server_dir,
Prog0 = start_node_get_option_value(erl, OptList, default),
@@ -420,7 +411,7 @@ start_node_peer(SlaveName, OptList, From, TI) ->
Cmd = lists:concat([Prog,
" -detached ",
TI#target_info.naming, " ", SlaveName,
- " -pa ", Pa,
+ " -pa \"", Pa,"\"",
NodeStarted,
CrashArgs,
" ", Args]),
@@ -462,9 +453,6 @@ start_node_peer(SlaveName, OptList, From, TI) ->
%%
%% Slave nodes are started on a remote host if
%% - the option remote is given when calling test_server:start_node/3
-%% or
-%% - the target type is vxworks, since only one erlang node
-%% can be started on each vxworks host.
%%
start_node_slave(SlaveName, OptList, From, TI) ->
SuppliedArgs = start_node_get_option_value(args, OptList, []),
@@ -472,9 +460,9 @@ start_node_slave(SlaveName, OptList, From, TI) ->
CrashFile = filename:join([TI#target_info.test_server_dir,
"erl_crash_dump."++cast_to_list(SlaveName)]),
- CrashArgs = lists:concat([" -env ERL_CRASH_DUMP ",CrashFile," "]),
+ CrashArgs = lists:concat([" -env ERL_CRASH_DUMP \"",CrashFile,"\" "]),
Pa = TI#target_info.test_server_dir,
- Args = lists:concat([" -pa ", Pa, " ", SuppliedArgs, CrashArgs]),
+ Args = lists:concat([" -pa \"", Pa, "\" ", SuppliedArgs, CrashArgs]),
Prog0 = start_node_get_option_value(erl, OptList, default),
Prog = pick_erl_program(Prog0),
@@ -787,19 +775,6 @@ kill_node(SI,TI) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Platform specific code
-start_target(vxworks,TargetHost,Cmd) ->
- case vxworks_client:open(TargetHost) of
- {ok,P} ->
- case vxworks_client:send_data(P,Cmd,"start_erl called") of
- {ok,_} ->
- {ok,{vxworks,P},?VXWORKS_ACCEPT_TIMEOUT};
- Error ->
- Error
- end;
- Error ->
- Error
- end;
-
start_target(unix,TargetHost,Cmd0) ->
Cmd =
case test_server_sup:hoststr() of
@@ -809,19 +784,9 @@ start_target(unix,TargetHost,Cmd0) ->
open_port({spawn, Cmd}, [stream]),
{ok,undefined,?ACCEPT_TIMEOUT}.
-maybe_reboot_target({vxworks,P}) when is_pid(P) ->
- %% Reboot the vxworks card.
- %% Client is also closed after this, even if reboot fails
- vxworks_client:send_data_wait_for_close(P,"q");
-maybe_reboot_target({vxworks,T}) when is_atom(T) ->
- %% Reboot the vxworks card.
- %% Client is also closed after this, even if reboot fails
- vxworks_client:reboot(T);
maybe_reboot_target(_) ->
{error, cannot_reboot_target}.
-close_target_client({vxworks,P}) ->
- vxworks_client:close(P);
close_target_client(undefined) ->
ok.
@@ -830,11 +795,6 @@ close_target_client(undefined) ->
%%
%% Command for starting main target
%%
-get_main_target_start_command(vxworks,_TargetHost,Naming,
- _MasterNode,_MasterCookie) ->
- "e" ++ Naming ++ " test_server -boot start_sasl"
- " -sasl errlog_type error"
- " -s test_server start " ++ test_server_sup:hoststr();
get_main_target_start_command(unix,_TargetHost,Naming,
_MasterNode,_MasterCookie) ->
Prog = pick_erl_program(default),
@@ -845,9 +805,6 @@ get_main_target_start_command(unix,_TargetHost,Naming,
%%
%% Command for starting slave nodes
%%
-get_slave_node_start_command(vxworks, _Prog, _MasterNode) ->
- "e";
- %"e-noinput -master " ++ MasterNode;
get_slave_node_start_command(unix, Prog, MasterNode) ->
cast_to_list(Prog) ++ " -detached -master " ++ MasterNode.
@@ -943,12 +900,23 @@ find_rel_suse_1(Rel, RootWc) ->
end.
find_rel_suse_2(Rel, RootWc) ->
- Wc = RootWc ++ "_" ++ Rel,
- case filelib:wildcard(Wc) of
- [] ->
- [];
- [R|_] ->
- [filename:join([R,"bin","erl"])]
+ RelDir = filename:dirname(RootWc),
+ Pat = filename:basename(RootWc ++ "_" ++ Rel) ++ ".*",
+ case file:list_dir(RelDir) of
+ {ok,Dirs} ->
+ case lists:filter(fun(Dir) ->
+ case re:run(Dir, Pat) of
+ nomatch -> false;
+ _ -> true
+ end
+ end, Dirs) of
+ [] ->
+ [];
+ [R|_] ->
+ [filename:join([RelDir,R,"bin","erl"])]
+ end;
+ _ ->
+ []
end.
%% suse_release() -> VersionString | none.
diff --git a/lib/test_server/src/test_server_sup.erl b/lib/test_server/src/test_server_sup.erl
index 875f45eea6..4a27c1ebae 100644
--- a/lib/test_server/src/test_server_sup.erl
+++ b/lib/test_server/src/test_server_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -21,7 +21,8 @@
%%% Purpose: Test server support functions.
%%%-------------------------------------------------------------------
-module(test_server_sup).
--export([timetrap/2, timetrap/3, timetrap_cancel/1, capture_get/1, messages_get/1,
+-export([timetrap/2, timetrap/3, timetrap/4,
+ timetrap_cancel/1, capture_get/1, messages_get/1,
timecall/3, call_crash/5, app_test/2, check_new_crash_dumps/0,
cleanup_crash_dumps/0, crash_dump_dir/0, tar_crash_dumps/0,
get_username/0, get_os_family/0,
@@ -44,9 +45,12 @@
%% delays during the test (e.g. if cover is running).
timetrap(Timeout0, Pid) ->
- timetrap(Timeout0, true, Pid).
+ timetrap(Timeout0, Timeout0, true, Pid).
timetrap(Timeout0, Scale, Pid) ->
+ timetrap(Timeout0, Timeout0, Scale, Pid).
+
+timetrap(Timeout0, ReportTVal, Scale, Pid) ->
process_flag(priority, max),
Timeout = if not Scale -> Timeout0;
true -> test_server:timetrap_scale_factor() * Timeout0
@@ -54,28 +58,36 @@ timetrap(Timeout0, Scale, Pid) ->
TruncTO = trunc(Timeout),
receive
after TruncTO ->
- MFLs = test_server:get_loc(Pid),
- Mon = erlang:monitor(process, Pid),
- Trap =
- case get(test_server_init_or_end_conf) of
- undefined ->
- {timetrap_timeout,TruncTO,MFLs};
- InitOrEnd ->
- {timetrap_timeout,TruncTO,MFLs,InitOrEnd}
- end,
- exit(Pid, Trap),
- receive
- {'DOWN', Mon, process, Pid, _} ->
+ case is_process_alive(Pid) of
+ true ->
+ TimeToReport = if Timeout0 == ReportTVal -> TruncTO;
+ true -> ReportTVal end,
+ MFLs = test_server:get_loc(Pid),
+ Mon = erlang:monitor(process, Pid),
+ Trap =
+ case get(test_server_init_or_end_conf) of
+ undefined ->
+ {timetrap_timeout,TimeToReport,MFLs};
+ InitOrEnd ->
+ {timetrap_timeout,TimeToReport,MFLs,InitOrEnd}
+ end,
+ exit(Pid, Trap),
+ receive
+ {'DOWN', Mon, process, Pid, _} ->
+ ok
+ after 10000 ->
+ %% Pid is probably trapping exits, hit it harder...
+ catch error_logger:warning_msg(
+ "Testcase process ~p not "
+ "responding to timetrap "
+ "timeout:~n"
+ " ~p.~n"
+ "Killing testcase...~n",
+ [Pid, Trap]),
+ exit(Pid, kill)
+ end;
+ false ->
ok
- after 10000 ->
- %% Pid is probably trapping exits, hit it harder...
- catch error_logger:warning_msg("Testcase process ~p not "
- "responding to timetrap "
- "timeout:~n"
- " ~p.~n"
- "Killing testcase...~n",
- [Pid, Trap]),
- exit(Pid, kill)
end
end.
@@ -88,8 +100,12 @@ timetrap_cancel(Handle) ->
unlink(Handle),
MonRef = erlang:monitor(process, Handle),
exit(Handle, kill),
- receive {'DOWN',MonRef,_,_,_} -> ok after 2000 -> ok end.
-
+ receive {'DOWN',MonRef,_,_,_} -> ok
+ after
+ 2000 ->
+ erlang:demonitor(MonRef, [flush]),
+ ok
+ end.
capture_get(Msgs) ->
receive
@@ -99,7 +115,6 @@ capture_get(Msgs) ->
lists:reverse(Msgs)
end.
-
messages_get(Msgs) ->
receive
Msg ->
@@ -108,7 +123,6 @@ messages_get(Msgs) ->
lists:reverse(Msgs)
end.
-
timecall(M, F, A) ->
Befor = erlang:now(),
Val = apply(M, F, A),
@@ -459,10 +473,8 @@ getenv_any([]) -> "".
%%
%% Returns the OS family
get_os_family() ->
- case os:type() of
- {OsFamily,_OsName} -> OsFamily;
- OsFamily -> OsFamily
- end.
+ {OsFamily,_OsName} = os:type(),
+ OsFamily.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/lib/test_server/src/ts.erl b/lib/test_server/src/ts.erl
index 729a2b11fc..db16b6ecd2 100644
--- a/lib/test_server/src/ts.erl
+++ b/lib/test_server/src/ts.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -25,11 +25,12 @@
-module(ts).
-export([run/0, run/1, run/2, run/3, run/4,
- clean/0, clean/1,
tests/0, tests/1,
- install/0, install/1, install/2, index/0,
+ install/0, install/1,
+ bench/0, bench/1, bench/2, benchmarks/0,
estone/0, estone/1,
cross_cover_analyse/1,
+ compile_testcases/0, compile_testcases/1,
help/0]).
-export([i/0, l/1, r/0, r/1, r/2, r/3]).
@@ -39,20 +40,14 @@
%%% the modules:
%%%
%%% +-- ts_install --+------ ts_autoconf_win32
-%%% | |
-%%% | +------ ts_autoconf_vxworks
%%% |
%%% ts ---+ +------ ts_erl_config
%%% | | ts_lib
-%%% | +------ ts_make
-%%% | |
-%%% +-- ts_run -----+
-%%% | ts_filelib
-%%% +------ ts_make_erl
-%%% |
-%%% +------ ts_reports (indirectly)
-%%%
-%%%
+%%% +-- ts_run -----+------ ts_make
+%%% | | ts_filelib
+%%% | +------ ts_make_erl
+%%% |
+%%% +-- ts_benchmark
%%%
%%% The modules ts_lib and ts_filelib contains utilities used by
%%% the other modules.
@@ -62,8 +57,7 @@
%%% ts Frontend to the test server framework. Contains all
%%% interface functions.
%%% ts_install Installs the test suite. On Unix, `autoconf' is
-%%% is used; on Windows, ts_autoconf_win32 is used,
-%%% on VxWorks, ts_autoconf_vxworks is used.
+%%% is used; on Windows, ts_autoconf_win32 is used.
%%% The result is written to the file `variables'.
%%% ts_run Supervises running of the tests.
%%% ts_autconf_win32 An `autoconf' for Windows.
@@ -76,10 +70,9 @@
%%% and other platforms.
%%% ts_make_erl A corrected version of the standar Erlang module
%%% make (used for rebuilding test suites).
-%%% ts_reports Generates index pages in HTML, providing a summary
-%%% of the tests run.
%%% ts_lib Miscellanous utility functions, each used by several
%%% other modules.
+%%% ts_benchmark Supervises otp benchmarks and collects results.
%%%----------------------------------------------------------------------
-include_lib("kernel/include/file.hrl").
@@ -88,35 +81,25 @@
-define(
install_help,
[
- " ts:install() - Install TS for local target with no Options.\n"
- " ts:install([Options])\n",
- " - Install TS for local target with Options\n"
- " ts:install({Architecture, Target_name})\n",
- " - Install TS for a remote target architecture.\n",
- " and target network name (e.g. {vxworks_cpu32, sauron}).\n",
- " ts:install({Architecture, Target_name}, [Options])\n",
- " - Install TS as above, and with Options.\n",
+ " ts:install() - Install TS with no Options.\n"
+ " ts:install([Options]) - Install TS with Options\n"
"\n",
"Installation options supported:\n",
" {longnames, true} - Use fully qualified hostnames\n",
- " {hosts, [HostList]}\n"
- " - Use theese hosts for distributed testing.\n"
" {verbose, Level} - Sets verbosity level for TS output (0,1,2), 0 is\n"
" quiet(default).\n"
- " {slavetargets, SlaveTarges}\n"
- " - Available hosts for starting slave nodes for\n"
- " platforms which cannot have more than one erlang\n"
- " node per host.\n"
- " {crossroot, TargetErlRoot}\n"
- " - Erlang root directory on target host\n"
- " Mandatory for remote targets\n"
- " {master, {MasterHost, MasterCookie}}\n"
- " - Master host and cookie for targets which are\n"
- " started as slave nodes.\n"
- " erl_boot_server must be started on master before\n"
- " test is run.\n"
- " Optional, default is controller host and then\n"
- " erl_boot_server is started autmatically\n"
+ " {crossroot, ErlTop}\n"
+ " - Erlang root directory on build host, ~n"
+ " normally same value as $ERL_TOP\n"
+ " {crossenv, [{Key,Val}]}\n"
+ " - Environmentals used by test configure on build host\n"
+ " {crossflags, FlagsString}\n"
+ " - Flags used by test configure on build host\n"
+ " {xcomp, XCompFile}\n"
+ " - The xcomp file to use for cross compiling the~n"
+ " testcases. Using this option will override any~n"
+ " cross* configurations given to ts. Note that you~n"
+ " have to have a correct ERL_TOP as well.~n"
]).
help() ->
@@ -137,7 +120,7 @@ help(installed) ->
" ts:run(Spec, Mod) - Run a single test suite.\n",
" ts:run(Spec, Mod, Case)\n",
" - Run a single test case.\n",
- " All above run functions can have the additional Options argument\n",
+ " All above run functions can have an additional Options argument\n",
" which is a list of options.\n",
"\n",
"Run options supported:\n",
@@ -167,13 +150,10 @@ help(installed) ->
" {ctp | ctpl, Mod, Func}\n",
" {ctp | ctpl, Mod, Func, Arity}\n",
"\n",
- "Support functions\n",
+ "Support functions:\n",
" ts:tests() - Shows all available families of tests.\n",
" ts:tests(Spec) - Shows all available test modules in Spec,\n",
" i.e. ../Spec_test/*_SUITE.erl\n",
- " ts:index() - Updates local index page.\n",
- " ts:clean() - Cleans up all but the last tests run.\n",
- " ts:clean(all) - Cleans up all test runs found.\n",
" ts:estone() - Run estone_SUITE in kernel application with\n"
" no run options\n",
" ts:estone(Opts) - Run estone_SUITE in kernel application with\n"
@@ -183,53 +163,31 @@ help(installed) ->
" cover_details. Analyses modules specified in\n"
" cross.cover.\n"
" Level can be 'overview' or 'details'.\n",
+ " ts:compile_testcases()~n"
+ " ts:compile_testcases(Apps)~n"
+ " - Compile all testcases for usage in a cross ~n"
+ " compile environment."
" \n"
+ "Benchmark functions:\n"
+ " ts:benchmarks() - Get all available families of benchmarks\n"
+ " ts:bench() - Runs all benchmarks\n"
+ " ts:bench(Spec) - Runs all benchmarks in the given spec file.\n"
+ " The spec file is actually ../*_test/Spec_bench.spec\n\n"
+ " ts:bench can take the same Options argument as ts:run.\n"
+ "\n"
"Installation (already done):\n"
],
show_help([H,?install_help]).
show_help(H) ->
- io:put_chars(lists:flatten(H)).
+ io:format(lists:flatten(H)).
%% Installs tests.
install() ->
ts_install:install(install_local,[]).
-install({Architecture, Target_name}) ->
- ts_install:install({ts_lib:maybe_atom_to_list(Architecture),
- ts_lib:maybe_atom_to_list(Target_name)}, []);
install(Options) when is_list(Options) ->
ts_install:install(install_local,Options).
-install({Architecture, Target_name}, Options) when is_list(Options)->
- ts_install:install({ts_lib:maybe_atom_to_list(Architecture),
- ts_lib:maybe_atom_to_list(Target_name)}, Options).
-
-%% Updates the local index page.
-
-index() ->
- check_and_run(fun(_Vars) -> ts_reports:make_index(), ok end).
-
-%%
-%% clean(all)
-%% Deletes all logfiles.
-%%
-clean(all) ->
- delete_files(filelib:wildcard("*" ++ ?logdir_ext)).
-
-%% clean/0
-%%
-%% Cleans up run logfiles, all but the last run.
-clean() ->
- clean1(filelib:wildcard("*" ++ ?logdir_ext)).
-
-clean1([Dir|Dirs]) ->
- List0 = filelib:wildcard(filename:join(Dir, "run.*")),
- case lists:reverse(lists:sort(List0)) of
- [] -> ok;
- [_Last|Rest] -> delete_files(Rest)
- end,
- clean1(Dirs);
-clean1([]) -> ok.
%% run/0
%% Runs all specs found by ts:tests(), if any, or returns
@@ -301,7 +259,15 @@ run(List, Opts) when is_list(List), is_list(Opts) ->
run(Testspec, Config) when is_atom(Testspec), is_list(Config) ->
Options=check_test_get_opts(Testspec, Config),
File=atom_to_list(Testspec),
- run_test(File, [{spec,[File++".spec"]}], Options);
+ Spec = case code:lib_dir(Testspec) of
+ {error, bad_name} when Testspec /= emulator,
+ Testspec /= system,
+ Testspec /= epmd ->
+ create_skip_spec(Testspec, tests(Testspec));
+ _ ->
+ File++".spec"
+ end,
+ run_test(File, [{spec,[Spec]}], Options);
%% Runs one module in a spec (interactive)
run(Testspec, Mod) when is_atom(Testspec), is_atom(Mod) ->
run_test({atom_to_list(Testspec), Mod},
@@ -332,6 +298,21 @@ run(Testspec, Mod, Case, Config) when is_atom(Testspec),
Args = [{suite,atom_to_list(Mod)}, {testcase,atom_to_list(Case)}],
run_test(atom_to_list(Testspec), Args, Options).
+%% Create a spec to skip all SUITES, this is used when the application
+%% to be tested is not part of the OTP release to be tested.
+create_skip_spec(Testspec, SuitesToSkip) ->
+ {ok,Cwd} = file:get_cwd(),
+ TestspecString = atom_to_list(Testspec),
+ Specname = TestspecString++"_skip.spec",
+ {ok,D} = file:open(filename:join([filename:dirname(Cwd),
+ TestspecString++"_test",Specname]),
+ [write]),
+ TestDir = "\"../"++TestspecString++"_test\"",
+ io:format(D,"{suites, "++TestDir++", all}.~n",[]),
+ io:format(D,"{skip_suites, "++TestDir++", ~w, \"Skipped as application"
+ " is not in path!\"}.",[SuitesToSkip]),
+ Specname.
+
%% Check testspec to be valid and get possible Options
%% from the config.
check_test_get_opts(Testspec, Config) ->
@@ -479,6 +460,25 @@ tests(Spec) ->
{ok, Cwd} = file:get_cwd(),
ts_lib:suites(Cwd, atom_to_list(Spec)).
+%% Benchmark related functions
+
+bench() ->
+ bench([]).
+
+bench(Opts) when is_list(Opts) ->
+ bench(benchmarks(),Opts);
+bench(Spec) ->
+ bench([Spec],[]).
+
+bench(Spec, Opts) when is_atom(Spec) ->
+ bench([Spec],Opts);
+bench(Specs, Opts) ->
+ check_and_run(fun(Vars) -> ts_benchmark:run(Specs, Opts, Vars) end).
+
+benchmarks() ->
+ ts_benchmark:benchmarks().
+
+
%%
%% estone/0, estone/1
@@ -540,32 +540,6 @@ run_test(File, Args, Options) ->
run_test(File, Args, Options, Vars) ->
ts_run:run(File, Args, Options, Vars).
-
-delete_files([]) -> ok;
-delete_files([Item|Rest]) ->
- case file:delete(Item) of
- ok ->
- delete_files(Rest);
- {error,eperm} ->
- file:change_mode(Item, 8#777),
- delete_files(filelib:wildcard(filename:join(Item, "*"))),
- file:del_dir(Item),
- ok;
- {error,eacces} ->
- %% We'll see about that!
- file:change_mode(Item, 8#777),
- case file:delete(Item) of
- ok -> ok;
- {error,_} ->
- erlang:yield(),
- file:change_mode(Item, 8#777),
- file:delete(Item),
- ok
- end;
- {error,_} -> ok
- end,
- delete_files(Rest).
-
%% This module provides some convenient shortcuts to running
%% the test server from within a started Erlang shell.
@@ -705,3 +679,23 @@ cover_type(cover_details) -> details.
do_load(Mod) ->
code:purge(Mod),
code:load_file(Mod).
+
+
+compile_testcases() ->
+ compile_datadirs("../*/*_data").
+
+compile_testcases(App) when is_atom(App) ->
+ compile_testcases([App]);
+compile_testcases([App | T]) ->
+ compile_datadirs(io_lib:format("../~s_test/*_data", [App])),
+ compile_testcases(T);
+compile_testcases([]) ->
+ ok.
+
+compile_datadirs(DataDirs) ->
+ {ok,Variables} = file:consult("variables"),
+
+ lists:foreach(fun(Dir) ->
+ ts_lib:make_non_erlang(Dir, Variables)
+ end,
+ filelib:wildcard(DataDirs)).
diff --git a/lib/test_server/src/ts.hrl b/lib/test_server/src/ts.hrl
index 885a726c54..5e829f3575 100644
--- a/lib/test_server/src/ts.hrl
+++ b/lib/test_server/src/ts.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -28,6 +28,7 @@
-define(run_summary, "suite.summary").
-define(cover_total,"total_cover.log").
-define(variables, "variables").
+-define(cross_variables, "variables-cross").
-define(LF, [10]). % Newline in VxWorks script
-define(CHAR_PER_LINE, 60). % Characters per VxWorks script building line
-define(CROSS_COOKIE, "cross"). % cookie used when cross platform testing
diff --git a/lib/test_server/src/ts_autoconf_vxworks.erl b/lib/test_server/src/ts_autoconf_vxworks.erl
deleted file mode 100644
index f4535cd89a..0000000000
--- a/lib/test_server/src/ts_autoconf_vxworks.erl
+++ /dev/null
@@ -1,191 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-%%% Purpose : Autoconf for cross environments.
-
--module(ts_autoconf_vxworks).
--export([configure/1]).
-%%% Supported cross platforms:
--define(PLATFORMS, ["vxworks_cpu32", "vxworks_ppc860", "vxworks_ppc603",
- "vxworks_sparc", "vxworks_ppc750", "vxworks_simso"]).
--include("ts.hrl").
-
-%% takes an argument {Target_arch, Target_host} (e.g. {vxworks_ppc860, thorin}).
-configure({Target_arch, Target_host}) ->
- case variables({Target_arch, Target_host}) of
- {ok, Vars} ->
- ts_lib:subst_file("conf_vars.in", "conf_vars", Vars);
- Error ->
- Error
- end.
-
-variables(Cross_spec) ->
- run_tests(Cross_spec, tests(), []).
-
-run_tests(Cross_spec, [{Prompt, Tester}|Rest], Vars) ->
- io:format("checking ~s... ", [Prompt]),
- case catch Tester(Cross_spec, Vars) of
- {'EXIT', Reason} ->
- io:format("FAILED~nExit status: ~p~n", [Reason]),
- {error, auto_conf_failed};
- {Result, NewVars} ->
- io:format("~s~n", [lists:concat([Result])]),
- run_tests(Cross_spec, Rest, NewVars)
- end;
-run_tests(_Cross_spec, [], Vars) ->
- {ok, Vars}.
-
-
-%%% The tests.
-
-tests() ->
- [{"supported target architecture", fun target_architecture/2},
- {"cross target host to run tests on", fun target_host/2},
- {"CPU type", fun cpu/2},
- {"for cross-compiling gcc", fun find_gcc/2},
- {"for cross-linker", fun find_ld/2},
- {"for object extension", fun find_obj/2},
- {"for shared libraries extension", fun find_dll/2},
- {"for executables extension", fun find_exe/2},
- {"for make", fun find_make/2}].
-
-target_architecture({Architecture, _Target_host}, Vars) ->
- case lists:member(Architecture, ?PLATFORMS) of
- true ->
- {Architecture, [{host_os, os_type(Architecture)}, {host, Architecture}|Vars]};
- false ->
- {"unsupported_platform", Vars}
- end.
-
-target_host({_Architecture, Target_host}, Vars) ->
- {Target_host, [{target_host, Target_host} | Vars]}.
-
-cpu({Arch, _Target_host}, Vars) ->
- Cpu = processor(Arch),
- {Cpu, [{host_cpu, Cpu}|Vars]}.
-
-find_gcc({Arch, _Target_host}, Vars) ->
- Gcc = "cc" ++ gnu_suffix(Arch),
- case os:find_executable(Gcc) of
- false ->
- {no, Vars};
- Path when is_list(Path) ->
- Cflags = cflags(Arch),
- {Path, [{'CC', Gcc},
- {'CFLAGS', Cflags},
- {'EI_CFLAGS', Cflags},
- {'ERTS_CFLAGS', Cflags},
- {'DEFS', ""},
- {'ERTS_LIBS', ""},
- {'LIBS', ""},
- {'SHLIB_CFLAGS', Cflags},
- {test_c_compiler, "{gnuc, undefined}"} | Vars]}
- end.
-
-find_ld({Arch, _Target_host}, Vars) ->
- Linker = "ld" ++ gnu_suffix(Arch),
- case os:find_executable(Linker) of
- false ->
- {no, Vars};
- Path when is_list(Path) ->
- {Path, [{'LD', Linker},
- {'CROSSLDFLAGS', ldflags(Arch)},
- {'SHLIB_EXTRACT_ALL', ""},
- {'SHLIB_LD', Linker},
- {'SHLIB_LDFLAGS', ""},
- {'SHLIB_LDLIBS', ""} | Vars]}
- end.
-
-find_obj({Arch, _Target_host}, Vars) ->
- Obj = obj_ext(Arch),
- {Obj, [{obj, Obj}|Vars]}.
-
-find_dll({Arch, _Target_host}, Vars) ->
- Dll = dll_ext(Arch),
- {Dll, [{'SHLIB_SUFFIX', Dll}|Vars]}.
-
-find_exe({Arch, _Target_host}, Vars) ->
- Exe = exe_ext(Arch),
- {Exe, [{exe, Exe}|Vars]}.
-
-find_make(_, Vars) ->
- {"make", [{make_command, "make"} | Vars]}.
-
-%%% some utility functions
-gnu_suffix(Arch) ->
- {_, _, _, _, Suffix, _Cpu, _Cflags, _} = cross_data(Arch),
- Suffix.
-
-processor(Arch) ->
- {_, _, _, _, _Suffix, Cpu, _Cflags, _} = cross_data(Arch),
- Cpu.
-
-cflags(Arch) ->
- {_, _, _, _, _Suffix, _Cpu, Cflags, _} = cross_data(Arch),
- Cflags.
-
-ldflags(Arch) ->
- {_, _, _, _, _Suffix, _Cpu, _Cflags, Ldflags} = cross_data(Arch),
- Ldflags.
-
-os_type(Arch) ->
- {Os_type, _, _, _, _, _, _, _} = cross_data(Arch),
- Os_type.
-
-obj_ext(Arch) ->
- {_, _, Obj, _, _, _, _, _} = cross_data(Arch),
- Obj.
-
-dll_ext(Arch) ->
- {_, _, _, Dll, _, _, _, _} = cross_data(Arch),
- Dll.
-
-exe_ext(Arch) ->
- {_, Exe, _, _, _, _, _, _} = cross_data(Arch),
- Exe.
-
-cross_data(Arch) ->
- case Arch of
- "vxworks_cpu32" ->
- {"VxWorks", "", ".o", ".eld", "68k", "cpu32",
- "-DCPU=CPU32 -DVXWORKS -I$(WIND_BASE)/target/h -mnobitfield -fno-builtin -nostdinc -fvolatile -msoft-float",
- "-r -d"};
- "vxworks_ppc860" ->
- {"VxWorks", "", ".o", ".eld", "ppc", "ppc860",
- "-DCPU=PPC860 -DVXWORKS -I$(WIND_BASE)/target/h -mcpu=860 -fno-builtin -fno-for-scope -msoft-float -D_GNU_TOOL -nostdinc",
- "-r -d"};
- "vxworks_ppc603" ->
- {"VxWorks", "", ".o", ".eld", "ppc", "ppc603",
- "-DCPU=PPC603 -DVXWORKS -I$(WIND_BASE)/target/h -fno-builtin -fno-for-scope -D_GNU_TOOL -nostdinc",
- "-r -d"};
- "vxworks_sparc" ->
- %%% The Sparc Architecture is included for private use (i.e. not Tornado 1.0.1 compatible).
- {"VxWorks", "", ".o", ".eld", "sparc", "sparc",
- "-DCPU=SPARC -DVXWORKS -I/home/gandalf/bsproj/BS.2/UOS/vw/5.2/h -fno-builtin -nostdinc",
- "-r -d"};
- "vxworks_ppc750" ->
- {"VxWorks", "", ".o", ".eld", "ppc", "ppc604",
- "-DCPU=PPC604 -DVXWORKS -DTOOL_FAMILY=gnu -DTOOL=gnu -I$(WIND_BASE)/target/h -fno-builtin -fno-for-scope -D_GNU_TOOL",
- "-r -d"};
- "vxworks_simso" ->
- {"VxWorks", "", ".o", ".eld", "simso", "simso",
- "-DCPU=SIMSPARCSOLARIS -DVXWORKS -DTOOL_FAMILY=gnu -DTOOL=gnu -I$(WIND_BASE)/target/h -I$(WIND_GCC_INCLUDE) -fno-builtin -fno-for-scope -D_GNU_TOOL",
- "-r -d"}
-
- end.
diff --git a/lib/test_server/src/ts_autoconf_win32.erl b/lib/test_server/src/ts_autoconf_win32.erl
index 9103542fd2..4a5c5c7603 100644
--- a/lib/test_server/src/ts_autoconf_win32.erl
+++ b/lib/test_server/src/ts_autoconf_win32.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -67,6 +67,7 @@ system_type(Vars) ->
{5,1,_} -> "Windows XP";
{5,2,_} -> "Windows 2003";
{6,0,_} -> "Windows Vista";
+ {6,1,_} -> "Windows 7";
{_,_,_} -> "Windows NCC-1701-D"
end;
{win32, windows} ->
diff --git a/lib/test_server/src/ts_benchmark.erl b/lib/test_server/src/ts_benchmark.erl
new file mode 100644
index 0000000000..516d22fd2d
--- /dev/null
+++ b/lib/test_server/src/ts_benchmark.erl
@@ -0,0 +1,91 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(ts_benchmark).
+
+-include_lib("common_test/include/ct_event.hrl").
+-include_lib("kernel/include/file.hrl").
+-include("ts.hrl").
+
+-export([benchmarks/0,
+ run/3]).
+
+%% gen_event callbacks
+-export([init/1, handle_event/2]).
+
+benchmarks() ->
+ {ok, Cwd} = file:get_cwd(),
+ Benches = filelib:wildcard(
+ filename:join([Cwd,"..","*_test","*_bench.spec"])),
+ [begin
+ Base = filename:basename(N),
+ list_to_atom(string:substr(Base,1,string:rstr(Base,"_")-1))
+ end || N <- Benches].
+
+run(Specs, Opts, Vars) ->
+ {ok, Cwd} = file:get_cwd(),
+ {{YY,MM,DD},{HH,Mi,SS}} = calendar:local_time(),
+ BName = lists:concat([YY,"_",MM,"_",DD,"T",HH,"_",Mi,"_",SS]),
+ BDir = filename:join([Cwd,BName]),
+ file:make_dir(BDir),
+ [ts_run:run(atom_to_list(Spec),
+ [{spec, [atom_to_list(Spec)++"_bench.spec"]}],
+ [{event_handler, {ts_benchmark, [Spec,BDir]}}|Opts],Vars)
+ || Spec <- Specs],
+ file:delete(filename:join(Cwd,"latest_benchmark")),
+ {ok,D} = file:open(filename:join(Cwd,"latest_benchmark"),[write]),
+ io:format(D,BDir,[]),
+ file:close(D).
+
+
+%%%===================================================================
+%%% gen_event callbacks
+%%%===================================================================
+
+-record(state, { spec, suite, tc, stats_dir}).
+
+init([Spec,Dir]) ->
+ {ok, #state{ spec = Spec, stats_dir = Dir }}.
+
+handle_event(#event{name = tc_start, data = {Suite,Tc}}, State) ->
+ {ok,State#state{ suite = Suite, tc = Tc}};
+handle_event(#event{name = benchmark_data, data = Data}, State) ->
+ Spec = proplists:get_value(application, Data, State#state.spec),
+ Suite = proplists:get_value(suite, Data, State#state.suite),
+ Tc = proplists:get_value(name, Data, State#state.tc),
+ Value = proplists:get_value(value, Data),
+ {ok, D} = file:open(filename:join(
+ [State#state.stats_dir,
+ lists:concat([e(Spec),"-",e(Suite),"-",
+ e(Tc),".ebench"])]),
+ [append]),
+ io:format(D, "~p~n",[Value]),
+ file:close(D),
+ {ok, State};
+handle_event(_Event, State) ->
+ {ok, State}.
+
+
+e(Atom) when is_atom(Atom) ->
+ Atom;
+e(Str) when is_list(Str) ->
+ lists:map(fun($/) ->
+ $\\;
+ (C) ->
+ C
+ end,Str).
diff --git a/lib/test_server/src/ts_erl_config.erl b/lib/test_server/src/ts_erl_config.erl
index 5585e8ccd3..73abe86e11 100644
--- a/lib/test_server/src/ts_erl_config.erl
+++ b/lib/test_server/src/ts_erl_config.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -128,15 +128,15 @@ erts_lib(Vars,OsType) ->
ErtsLibInternal}
end,
[{erts_lib_include,
- filename:nativename(ErtsLibInclude)},
+ quote(filename:nativename(ErtsLibInclude))},
{erts_lib_include_generated,
- filename:nativename(ErtsLibIncludeGenerated)},
+ quote(filename:nativename(ErtsLibIncludeGenerated))},
{erts_lib_include_internal,
- filename:nativename(ErtsLibIncludeInternal)},
+ quote(filename:nativename(ErtsLibIncludeInternal))},
{erts_lib_include_internal_generated,
- filename:nativename(ErtsLibIncludeInternalGenerated)},
- {erts_lib_path, filename:nativename(ErtsLibPath)},
- {erts_lib_internal_path, filename:nativename(ErtsLibInternalPath)},
+ quote(filename:nativename(ErtsLibIncludeInternalGenerated))},
+ {erts_lib_path, quote(filename:nativename(ErtsLibPath))},
+ {erts_lib_internal_path, quote(filename:nativename(ErtsLibInternalPath))},
{erts_lib_multi_threaded, erts_lib_name(multi_threaded, OsType)},
{erts_lib_single_threaded, erts_lib_name(single_threaded, OsType)}
| Vars].
@@ -145,13 +145,13 @@ erl_include(Vars) ->
Include =
case erl_root(Vars) of
{installed, Root} ->
- filename:join([Root, "usr", "include"]);
+ quote(filename:join([Root, "usr", "include"]));
{srctree, Root, Target} ->
- filename:join([Root, "erts", "emulator", "beam"])
- ++ " -I" ++ filename:join([Root, "erts", "emulator"])
+ quote(filename:join([Root, "erts", "emulator", "beam"]))
+ ++ " -I" ++ quote(filename:join([Root, "erts", "emulator"]))
++ system_include(Root, Vars)
- ++ " -I" ++ filename:join([Root, "erts", "include"])
- ++ " -I" ++ filename:join([Root, "erts", "include", Target])
+ ++ " -I" ++ quote(filename:join([Root, "erts", "include"]))
+ ++ " -I" ++ quote(filename:join([Root, "erts", "include", Target]))
end,
[{erl_include, filename:nativename(Include)}|Vars].
@@ -160,10 +160,9 @@ system_include(Root, Vars) ->
SysDir =
case ts_lib:var(os, Vars) of
"Windows" ++ _T -> "sys/win32";
- "VxWorks" -> "sys.vxworks";
_ -> "sys/unix"
end,
- " -I" ++ filename:nativename(filename:join([Root, "erts", "emulator", SysDir])).
+ " -I" ++ quote(filename:nativename(filename:join([Root, "erts", "emulator", SysDir]))).
erl_interface(Vars,OsType) ->
{Incl, {LibPath, MkIncl}} =
@@ -176,9 +175,6 @@ erl_interface(Vars,OsType) ->
{installed, _Root} ->
{filename:join(Dir, "lib"),
filename:join(Dir, "src")};
- {srctree, _Root, _Target} when OsType =:= vxworks ->
- {filename:join(Dir, "lib"),
- filename:join([Dir, "src"])};
{srctree, _Root, Target} ->
{filename:join([Dir, "obj", Target]),
filename:join([Dir, "src", Target])}
@@ -218,22 +214,18 @@ erl_interface(Vars,OsType) ->
{unix,_} ->
"-lpthread";
_ ->
- "" % VxWorks
+ ""
end,
- CrossCompile = case OsType of
- vxworks -> "true";
- _ -> "false"
- end,
- [{erl_interface_libpath, filename:nativename(LibPath)},
+ [{erl_interface_libpath, quote(filename:nativename(LibPath))},
{erl_interface_sock_libs, sock_libraries(OsType)},
{erl_interface_lib, Lib},
{erl_interface_eilib, Lib1},
{erl_interface_lib_drv, LibDrv},
{erl_interface_eilib_drv, Lib1Drv},
{erl_interface_threadlib, ThreadLib},
- {erl_interface_include, filename:nativename(Incl)},
- {erl_interface_mk_include, filename:nativename(MkIncl)},
- {erl_interface_cross_compile, CrossCompile} | Vars].
+ {erl_interface_include, quote(filename:nativename(Incl))},
+ {erl_interface_mk_include, quote(filename:nativename(MkIncl))}
+ | Vars].
ic(Vars, OsType) ->
{ClassPath, LibPath, Incl} =
@@ -250,10 +242,10 @@ ic(Vars, OsType) ->
end,
filename:join(Dir, "include")}
end,
- [{ic_classpath, filename:nativename(ClassPath)},
- {ic_libpath, filename:nativename(LibPath)},
+ [{ic_classpath, quote(filename:nativename(ClassPath))},
+ {ic_libpath, quote(filename:nativename(LibPath))},
{ic_lib, link_library("ic", OsType)},
- {ic_include_path, filename:nativename(Incl)}|Vars].
+ {ic_include_path, quote(filename:nativename(Incl))}|Vars].
jinterface(Vars, _OsType) ->
ClassPath =
@@ -263,7 +255,7 @@ jinterface(Vars, _OsType) ->
Dir ->
filename:join([Dir, "priv", "OtpErlang.jar"])
end,
- [{jinterface_classpath, filename:nativename(ClassPath)}|Vars].
+ [{jinterface_classpath, quote(filename:nativename(ClassPath))}|Vars].
lib_dir(Vars, Lib) ->
LibLibDir = case Lib of
@@ -276,8 +268,6 @@ lib_dir(Vars, Lib) ->
case {get_var(crossroot, Vars), LibLibDir} of
{{error, _}, _} -> %no crossroot
LibLibDir;
- {_, {error, _}} -> %no lib
- LibLibDir;
{CrossRoot, _} ->
%% XXX: Ugly. So ugly I won't comment it
%% /Patrik
@@ -299,18 +289,16 @@ lib_dir(Vars, Lib) ->
end.
erl_root(Vars) ->
- Root = code:root_dir(),
- case ts_lib:erlang_type() of
+ Root = case get_var(crossroot,Vars) of
+ {error, notfound} -> code:root_dir();
+ CrossRoot -> CrossRoot
+ end,
+ case ts_lib:erlang_type(Root) of
{srctree, _Version} ->
Target = get_var(target, Vars),
{srctree, Root, Target};
{_, _Version} ->
- case get_var(crossroot,Vars) of
- {error, notfound} ->
- {installed, Root};
- CrossRoot ->
- {installed, CrossRoot}
- end
+ {installed, Root}
end.
@@ -326,16 +314,12 @@ get_var(Key, Vars) ->
sock_libraries({win32, _}) ->
"ws2_32.lib";
sock_libraries({unix, _}) ->
- ""; % Included in general libraries if needed.
-sock_libraries(vxworks) ->
- "".
+ "". % Included in general libraries if needed.
link_library(LibName,{win32, _}) ->
LibName ++ ".lib";
link_library(LibName,{unix, _}) ->
"lib" ++ LibName ++ ".a";
-link_library(LibName,vxworks) ->
- "lib" ++ LibName ++ ".a";
link_library(_LibName,_Other) ->
exit({link_library, not_supported}).
@@ -362,10 +346,17 @@ ssl(Vars, _OsType) ->
{error, bad_name} ->
throw({cannot_find_app, ssl});
Dir ->
- [{ssl_libdir, filename:nativename(Dir)}| Vars]
+ [{ssl_libdir, quote(filename:nativename(Dir))}| Vars]
end.
separators(Vars, {win32,_}) ->
[{'DS',"\\"},{'PS',";"}|Vars];
separators(Vars, _) ->
[{'DS',"/"},{'PS',":"}|Vars].
+
+quote([$ |R]) ->
+ "\\ "++quote(R);
+quote([C|R]) ->
+ [C|quote(R)];
+quote([]) ->
+ [].
diff --git a/lib/test_server/src/ts_install.erl b/lib/test_server/src/ts_install.erl
index 9703478f20..ba8952f10f 100644
--- a/lib/test_server/src/ts_install.erl
+++ b/lib/test_server/src/ts_install.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -28,12 +28,25 @@ install(install_local, Options) ->
install(os:type(), Options);
install(TargetSystem, Options) ->
- io:format("Running configure for cross architecture, network target name~n"
- "~p~n", [TargetSystem]),
- case autoconf(TargetSystem) of
+ case file:consult(?variables) of
+ {ok, Vars} ->
+ case proplists:get_value(cross,Vars) of
+ "yes" when Options == []->
+ target_install(Vars);
+ _ ->
+ build_install(TargetSystem, Options)
+ end;
+ _ ->
+ build_install(TargetSystem, Options)
+ end.
+
+
+build_install(TargetSystem, Options) ->
+ XComp = parse_xcomp_file(proplists:get_value(xcomp,Options)),
+ case autoconf(TargetSystem, XComp++Options) of
{ok, Vars0} ->
OsType = os_type(TargetSystem),
- Vars1 = ts_erl_config:variables(merge(Vars0,Options),OsType),
+ Vars1 = ts_erl_config:variables(Vars0++XComp++Options,OsType),
{Options1, Vars2} = add_vars(Vars1, Options),
Vars3 = lists:flatten([Options1|Vars2]),
write_terms(?variables, Vars3);
@@ -42,35 +55,42 @@ install(TargetSystem, Options) ->
end.
os_type({unix,_}=OsType) -> OsType;
-os_type({win32,_}=OsType) -> OsType;
-os_type(_Other) -> vxworks.
+os_type({win32,_}=OsType) -> OsType.
-merge(Vars,[]) ->
- Vars;
-merge(Vars,[{crossroot,X}| Tail]) ->
- merge([{crossroot, X} | Vars], Tail);
-merge(Vars,[_X | Tail]) ->
- merge(Vars,Tail).
+target_install(CrossVars) ->
+ io:format("Cross installation detected, skipping configure and data_dir make~n"),
+ case file:rename(?variables,?cross_variables) of
+ ok ->
+ ok;
+ _ ->
+ io:format("Could not find variables file from cross make~n"),
+ throw(cross_installation_failed)
+ end,
+ CPU = proplists:get_value('CPU',CrossVars),
+ OS = proplists:get_value(os,CrossVars),
+ {Options,Vars} = add_vars([{cross,"yes"},{'CPU',CPU},{os,OS}],[]),
+ Variables = lists:flatten([Options|Vars]),
+ write_terms(?variables, Variables).
%% Autoconf for various platforms.
%% unix uses the configure script
%% win32 uses ts_autoconf_win32
-%% VxWorks uses ts_autoconf_vxworks.
-autoconf(TargetSystem) ->
- case autoconf1(TargetSystem) of
+autoconf(TargetSystem, XComp) ->
+ case autoconf1(TargetSystem, XComp) of
ok ->
autoconf2(file:read_file("conf_vars"));
Error ->
Error
end.
-autoconf1({win32, _}) ->
+autoconf1({win32, _},[{cross,"no"}]) ->
ts_autoconf_win32:configure();
-autoconf1({unix, _}) ->
- unix_autoconf();
-autoconf1(Other) ->
- ts_autoconf_vxworks:configure(Other).
+autoconf1({unix, _},XCompFile) ->
+ unix_autoconf(XCompFile);
+autoconf1(_,_) ->
+ io:format("cross compilation not supported for that this platform~n"),
+ throw(cross_installation_failed).
autoconf2({ok, Bin}) ->
get_vars(binary_to_list(Bin), name, [], []);
@@ -92,27 +112,40 @@ get_vars([], name, [], Result) ->
get_vars(_, _, _, _) ->
{error, fatal_bad_conf_vars}.
-unix_autoconf() ->
+unix_autoconf(XConf) ->
Configure = filename:absname("configure"),
- Args = case catch erlang:system_info(threads) of
- false -> "";
- _ -> " --enable-shlib-thread-safety"
- end
- ++ case catch string:str(erlang:system_info(system_version),
- "debug") > 0 of
- false -> "";
- _ -> " --enable-debug-mode"
- end,
+ Flags = proplists:get_value(crossflags,XConf,[]),
+ Env = proplists:get_value(crossenv,XConf,[]),
+ Host = get_xcomp_flag("host", Flags),
+ Build = get_xcomp_flag("build", Flags),
+ Threads = [" --enable-shlib-thread-safety" ||
+ erlang:system_info(threads) /= false],
+ Debug = [" --enable-debug-mode" ||
+ string:str(erlang:system_info(system_version),"debug") > 0],
+ Args = Host ++ Build ++ Threads ++ Debug,
case filelib:is_file(Configure) of
true ->
- Env = macosx_cflags(),
- Port = open_port({spawn, Configure ++ Args},
- [stream, eof, {env,Env}]),
+ OSXEnv = macosx_cflags(),
+ io:format("Running ~sEnv: ~p~n",
+ [lists:flatten(Configure ++ Args),Env++OSXEnv]),
+ Port = open_port({spawn, lists:flatten(["\"",Configure,"\"",Args])},
+ [stream, eof, {env,Env++OSXEnv}]),
ts_lib:print_data(Port);
false ->
{error, no_configure_script}
end.
+
+get_xcomp_flag(Flag, Flags) ->
+ get_xcomp_flag(Flag, Flag, Flags).
+get_xcomp_flag(Flag, Tag, Flags) ->
+ case proplists:get_value(Flag,Flags) of
+ undefined -> "";
+ "guess" -> [" --",Tag,"=",os:cmd("$ERL_TOP/erts/autoconf/config.guess")];
+ HostVal -> [" --",Tag,"=",HostVal]
+ end.
+
+
macosx_cflags() ->
case os:type() of
{unix, darwin} ->
@@ -125,10 +158,33 @@ macosx_cflags() ->
[]
end.
+parse_xcomp_file(undefined) ->
+ [{cross,"no"}];
+parse_xcomp_file(Filepath) ->
+ {ok,Bin} = file:read_file(Filepath),
+ Lines = binary:split(Bin,<<"\n">>,[global,trim]),
+ {Envs,Flags} = parse_xcomp_file(Lines,[],[]),
+ [{cross,"yes"},{crossroot,os:getenv("ERL_TOP")},
+ {crossenv,Envs},{crossflags,Flags}].
+
+parse_xcomp_file([<<A:8,_/binary>> = Line|R],Envs,Flags)
+ when $A =< A, A =< $Z ->
+ [Var,Value] = binary:split(Line,<<"=">>),
+ parse_xcomp_file(R,[{binary_to_list(Var),
+ binary_to_list(Value)}|Envs],Flags);
+parse_xcomp_file([<<"erl_xcomp_",Line/binary>>|R],Envs,Flags) ->
+ [Var,Value] = binary:split(Line,<<"=">>),
+ parse_xcomp_file(R,Envs,[{binary_to_list(Var),
+ binary_to_list(Value)}|Flags]);
+parse_xcomp_file([_|R],Envs,Flags) ->
+ parse_xcomp_file(R,Envs,Flags);
+parse_xcomp_file([],Envs,Flags) ->
+ {lists:reverse(Envs),lists:reverse(Flags)}.
+
write_terms(Name, Terms) ->
case file:open(Name, [write]) of
{ok, Fd} ->
- Result = write_terms1(Fd, Terms),
+ Result = write_terms1(Fd, remove_duplicates(Terms)),
file:close(Fd),
Result;
{error, Reason} ->
@@ -141,6 +197,17 @@ write_terms1(Fd, [Term|Rest]) ->
write_terms1(_, []) ->
ok.
+remove_duplicates(List) ->
+ lists:reverse(
+ lists:foldl(fun({Key,Val},Acc) ->
+ R = make_ref(),
+ case proplists:get_value(Key,Acc,R) of
+ R -> [{Key,Val}|Acc];
+ _Else ->
+ Acc
+ end
+ end,[],List)).
+
add_vars(Vars0, Opts0) ->
{Opts,LongNames} =
case lists:keymember(longnames, 1, Opts0) of
@@ -209,12 +276,11 @@ platform(Vars) ->
LC = lock_checking(),
MT = modified_timing(),
AsyncThreads = async_threads(),
- HeapType = heap_type_label(),
Debug = debug(),
CpuBits = word_size(),
Common = lists:concat([Hostname,"/",OsType,"/",CpuType,CpuBits,LinuxDist,
Schedulers,BindType,KP,IOTHR,LC,MT,AsyncThreads,
- HeapType,Debug,ExtraLabel]),
+ Debug,ExtraLabel]),
PlatformId = lists:concat([ErlType, " ", Version, Common]),
PlatformLabel = ErlType ++ Common,
PlatformFilename = platform_as_filename(PlatformId),
@@ -272,12 +338,6 @@ hostname() ->
"/localhost"
end.
-heap_type_label() ->
- case catch erlang:system_info(heap_type) of
- hybrid -> "/Hybrid";
- _ -> "" %private
- end.
-
async_threads() ->
case catch erlang:system_info(threads) of
true -> "/A"++integer_to_list(erlang:system_info(thread_pool_size));
diff --git a/lib/test_server/src/ts_install_cth.erl b/lib/test_server/src/ts_install_cth.erl
index a41916fd0a..9b6e10e7e2 100644
--- a/lib/test_server/src/ts_install_cth.erl
+++ b/lib/test_server/src/ts_install_cth.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2012. 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
@@ -95,17 +95,12 @@ pre_init_per_suite(_Suite,Config,State) ->
try
{ok,Variables} =
file:consult(filename:join(State#state.ts_conf_dir,"variables")),
-
- %% Make the stuff in all_SUITE_data if it exists
- AllDir = filename:join(DataDir,"../all_SUITE_data"),
- case filelib:is_dir(AllDir) of
- true ->
- make_non_erlang(AllDir,Variables);
- false ->
- ok
+ case proplists:get_value(cross,Variables) of
+ "yes" ->
+ ct:log("Not making data dir as tests have been cross compiled");
+ _ ->
+ ts_lib:make_non_erlang(DataDir, Variables)
end,
-
- make_non_erlang(DataDir, Variables),
{add_node_name(Config, State), State}
catch Error:Reason ->
@@ -219,39 +214,6 @@ terminate(_State) ->
%%% ============================================================================
%%% Local functions
%%% ============================================================================
-%% Configure and run all the Makefiles in the data dirs of the suite
-%% in question
-make_non_erlang(DataDir, Variables) ->
- {ok,CurrWD} = file:get_cwd(),
- try
- file:set_cwd(DataDir),
- MakeCommand = proplists:get_value(make_command,Variables),
-
- FirstMakefile = filename:join(DataDir,"Makefile.first"),
- case filelib:is_regular(FirstMakefile) of
- true ->
- ct:log("Making ~p",[FirstMakefile]),
- ok = ts_make:make(
- MakeCommand, DataDir, filename:basename(FirstMakefile));
- false ->
- ok
- end,
-
- MakefileSrc = filename:join(DataDir,"Makefile.src"),
- MakefileDest = filename:join(DataDir,"Makefile"),
- case filelib:is_regular(MakefileSrc) of
- true ->
- ok = ts_lib:subst_file(MakefileSrc,MakefileDest,Variables),
- ct:log("Making ~p",[MakefileDest]),
- ok = ts_make:make([{makefile,"Makefile"},{data_dir,DataDir}
- | Variables]);
- false ->
- ok
- end
- after
- file:set_cwd(CurrWD),
- timer:sleep(100)
- end.
%% Add a nodename to config if it does not exist
add_node_name(Config, State) ->
diff --git a/lib/test_server/src/ts_lib.erl b/lib/test_server/src/ts_lib.erl
index 2f0a4ea8c0..d9a699ca9f 100644
--- a/lib/test_server/src/ts_lib.erl
+++ b/lib/test_server/src/ts_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -24,10 +24,11 @@
%% Avoid warning for local function error/1 clashing with autoimported BIF.
-compile({no_auto_import,[error/1]}).
-export([error/1, var/2, erlang_type/0,
- initial_capital/1, interesting_logs/1,
- specs/1, suites/2, last_test/1,
- force_write_file/2, force_delete/1,
+ erlang_type/1,
+ initial_capital/1,
+ specs/1, suites/2,
subst_file/3, subst/2, print_data/1,
+ make_non_erlang/2,
maybe_atom_to_list/1, progress/4
]).
@@ -73,8 +74,10 @@ progress(Vars, Level, Format, Args) ->
%% Returns: {Type, Version} where Type is otp|src
erlang_type() ->
+ erlang_type(code:root_dir()).
+erlang_type(RootDir) ->
{_, Version} = init:script_id(),
- RelDir = filename:join(code:root_dir(), "releases"), % Only in installed
+ RelDir = filename:join(RootDir, "releases"), % Only in installed
case filelib:is_file(RelDir) of
true -> {otp,Version}; % installed OTP
false -> {srctree,Version} % source code tree
@@ -87,25 +90,18 @@ initial_capital([C|Rest]) when $a =< C, C =< $z ->
initial_capital(String) ->
String.
-%% Returns a list of the "interesting logs" in a directory,
-%% i.e. those that correspond to spec files.
-
-interesting_logs(Dir) ->
- Logs = filelib:wildcard(filename:join(Dir, [$*|?logdir_ext])),
- Interesting =
- case specs(Dir) of
- [] ->
- Logs;
- Specs0 ->
- Specs = ordsets:from_list(Specs0),
- [L || L <- Logs, ordsets:is_element(filename_to_atom(L), Specs)]
- end,
- sort_tests(Interesting).
-
specs(Dir) ->
Specs = filelib:wildcard(filename:join([filename:dirname(Dir),
- "*_test", "*.{dyn,}spec"])),
- sort_tests([filename_to_atom(Name) || Name <- Specs]).
+ "*_test", "*.{dyn,}spec"])),
+ % Filter away all spec which end with _bench.spec
+ NoBench = fun(SpecName) ->
+ case lists:reverse(SpecName) of
+ "ceps.hcneb_"++_ -> false;
+ _ -> true
+ end
+ end,
+
+ sort_tests([filename_to_atom(Name) || Name <- Specs, NoBench(Name)]).
suites(Dir, Spec) ->
Glob=filename:join([filename:dirname(Dir), Spec++"_test",
@@ -153,42 +149,6 @@ suite_order(mnesia) -> 44;
suite_order(system) -> 999; %% IMPORTANT: system SHOULD always be last!
suite_order(_) -> 200.
-last_test(Dir) ->
- last_test(filelib:wildcard(filename:join(Dir, "run.[1-2]*")), false).
-
-last_test([Run|Rest], false) ->
- last_test(Rest, Run);
-last_test([Run|Rest], Latest) when Run > Latest ->
- last_test(Rest, Run);
-last_test([_|Rest], Latest) ->
- last_test(Rest, Latest);
-last_test([], Latest) ->
- Latest.
-
-%% Do the utmost to ensure that the file is written, by deleting or
-%% renaming an old file with the same name.
-
-force_write_file(Name, Contents) ->
- force_delete(Name),
- file:write_file(Name, Contents).
-
-force_delete(Name) ->
- case file:delete(Name) of
- {error, eacces} ->
- force_rename(Name, Name ++ ".old.", 0);
- Other ->
- Other
- end.
-
-force_rename(From, To, Number) ->
- Dest = [To|integer_to_list(Number)],
- case file:read_file_info(Dest) of
- {ok, _} ->
- force_rename(From, To, Number+1);
- {error, _} ->
- file:rename(From, Dest)
- end.
-
%% Substitute all occurrences of @var@ in the In file, using
%% the list of variables in Vars, producing the output file Out.
%% Returns: ok | {error, Reason}
@@ -333,3 +293,45 @@ maybe_atom_to_list(To_list) when is_list(To_list) ->
maybe_atom_to_list(To_list) when is_atom(To_list)->
atom_to_list(To_list).
+
+%% Configure and run all the Makefiles in the data dir of the suite
+%% in question
+make_non_erlang(DataDir, Variables) ->
+ %% Make the stuff in all_SUITE_data if it exists
+ AllDir = filename:join(DataDir,"../all_SUITE_data"),
+ case filelib:is_dir(AllDir) of
+ true ->
+ make_non_erlang_do(AllDir,Variables);
+ false ->
+ ok
+ end,
+ make_non_erlang_do(DataDir, Variables).
+
+make_non_erlang_do(DataDir, Variables) ->
+ try
+ MakeCommand = proplists:get_value(make_command,Variables),
+
+ FirstMakefile = filename:join(DataDir,"Makefile.first"),
+ case filelib:is_regular(FirstMakefile) of
+ true ->
+ io:format("Making ~p",[FirstMakefile]),
+ ok = ts_make:make(
+ MakeCommand, DataDir, filename:basename(FirstMakefile));
+ false ->
+ ok
+ end,
+
+ MakefileSrc = filename:join(DataDir,"Makefile.src"),
+ MakefileDest = filename:join(DataDir,"Makefile"),
+ case filelib:is_regular(MakefileSrc) of
+ true ->
+ ok = ts_lib:subst_file(MakefileSrc,MakefileDest,Variables),
+ io:format("Making ~p",[MakefileDest]),
+ ok = ts_make:make([{makefile,"Makefile"},{data_dir,DataDir}
+ | Variables]);
+ false ->
+ ok
+ end
+ after
+ timer:sleep(100) %% maybe unnecessary now when we don't do set_cwd anymore
+ end.
diff --git a/lib/test_server/src/ts_make.erl b/lib/test_server/src/ts_make.erl
index 3df66111a3..f3266f5836 100644
--- a/lib/test_server/src/ts_make.erl
+++ b/lib/test_server/src/ts_make.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -25,12 +25,12 @@
%% Functions to be called from make test cases.
make(Config) when is_list(Config) ->
- DataDir = ?config(data_dir, Config),
- Makefile = ?config(makefile, Config),
- Make = ?config(make_command, Config),
+ DataDir = proplists:get_value(data_dir, Config),
+ Makefile = proplists:get_value(makefile, Config),
+ Make = proplists:get_value(make_command, Config),
case make(Make, DataDir, Makefile) of
ok -> ok;
- {error,Reason} -> ?t:fail({make_failed,Reason})
+ {error,Reason} -> exit({make_failed,Reason})
end.
unmake(Config) when is_list(Config) ->
@@ -85,7 +85,7 @@ run_make_script({win32, _}, Make, Dir, Makefile) ->
{"run_make.bat",
".\\run_make",
["@echo off\r\n",
- "cd ", filename:nativename(Dir), "\r\n",
+ "cd \"", filename:nativename(Dir), "\"\r\n",
Make, " -f ", Makefile, " \r\n",
"if errorlevel 1 echo *error*\r\n",
"if not errorlevel 1 echo *ok*\r\n"]};
@@ -93,7 +93,7 @@ run_make_script({unix, _}, Make, Dir, Makefile) ->
{"run_make",
"/bin/sh ./run_make",
["#!/bin/sh\n",
- "cd ", Dir, "\n",
+ "cd \"", Dir, "\"\n",
Make, " -f ", Makefile, " 2>&1\n",
"case $? in\n",
" 0) echo '*ok*';;\n",
diff --git a/lib/test_server/src/ts_reports.erl b/lib/test_server/src/ts_reports.erl
deleted file mode 100644
index f981a77ae4..0000000000
--- a/lib/test_server/src/ts_reports.erl
+++ /dev/null
@@ -1,545 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-%%% Purpose : Produces reports in HTML from the outcome of test suite runs.
-
--module(ts_reports).
-
--export([make_index/0, make_master_index/2, make_progress_index/2]).
--export([count_cases/1, year/0, current_time/0]).
-
--include_lib("kernel/include/file.hrl").
--include("ts.hrl").
-
--compile({no_auto_import,[error/1]}).
-
--import(filename, [basename/1, rootname/1]).
--import(ts_lib, [error/1]).
-
-
-%% Make master index page which points out index pages for all platforms.
-
-make_master_index(Dir, Vars) ->
- IndexName = filename:join(Dir, "index.html"),
- {ok, Index0} = make_master_index1(directories(Dir), master_header(Vars)),
- Index = [Index0|master_footer()],
- io:put_chars("Updating " ++ IndexName ++ "... "),
- ok = ts_lib:force_write_file(IndexName, Index),
- io:put_chars("done\n").
-
-make_master_index1([Dir|Rest], Result) ->
- NewResult =
- case catch read_variables(Dir) of
- {'EXIT',{{bad_installation,Reason},_}} ->
- io:put_chars("Failed to read " ++ filename:join(Dir,?variables)++
- ": " ++ Reason ++ " - Ignoring this directory\n"),
- Result;
- Vars ->
- Platform = ts_lib:var(platform_label, Vars),
- case make_index(Dir, Vars, false) of
- {ok, Summary} ->
- make_master_index(Platform, Dir, Summary, Result);
- {error, _} ->
- Result
- end
- end,
- make_master_index1(Rest, NewResult);
-make_master_index1([], Result) ->
- {ok, Result}.
-
-make_progress_index(Dir, Vars) ->
- IndexName = filename:join(Dir, "index.html"),
- io:put_chars("Updating " ++ IndexName ++ "... "),
- Index0=progress_header(Vars),
- ts_lib:force_delete(IndexName),
- Dirs=find_progress_runs(Dir),
- Index1=[Index0|make_progress_links(Dirs, [])],
- IndexF=[Index1|progress_footer()],
- ok = ts_lib:force_write_file(IndexName, IndexF),
- io:put_chars("done\n").
-
-find_progress_runs(Dir) ->
- case file:list_dir(Dir) of
- {ok, Dirs0} ->
- Dirs1= [filename:join(Dir,X) || X <- Dirs0,
- filelib:is_dir(filename:join(Dir,X))],
- lists:sort(Dirs1);
- _ ->
- []
- end.
-
-name_from_vars(Dir, Platform) ->
- VarFile=filename:join([Dir, Platform, "variables"]),
- case file:consult(VarFile) of
- {ok, Vars} ->
- ts_lib:var(platform_id, Vars);
- _Other ->
- Platform
- end.
-
-make_progress_links([], Acc) ->
- Acc;
-make_progress_links([RDir|Rest], Acc) ->
- Dir=filename:basename(RDir),
- Platforms=[filename:basename(X) ||
- X <- find_progress_runs(RDir)],
- PlatformLinks=["<A HREF=\""++filename:join([Dir,X,"index.html"])
- ++"\">"++name_from_vars(RDir, X)++"</A><BR>" ||
- X <- Platforms],
- LinkName=Dir++"/index.html",
- Link =
- [
- "<TR valign=top>\n",
- "<TD><A HREF=\"", LinkName, "\">", Dir, "</A></TD>", "\n",
- "<TD>", PlatformLinks, "</TD>", "\n"
- ],
- make_progress_links(Rest, [Link|Acc]).
-
-read_variables(Dir) ->
- case file:consult(filename:join(Dir, ?variables)) of
- {ok, Vars} -> Vars;
- {error, Reason} ->
- erlang:error({bad_installation,file:format_error(Reason)}, [Dir])
- end.
-
-make_master_index(Platform, Dirname, {Succ, Fail, UserSkip,AutoSkip}, Result) ->
- Link = filename:join(filename:basename(Dirname), "index.html"),
- FailStr =
- if Fail > 0 ->
- ["<FONT color=\"red\">",
- integer_to_list(Fail),"</FONT>"];
- true ->
- integer_to_list(Fail)
- end,
- AutoSkipStr =
- if AutoSkip > 0 ->
- ["<FONT color=\"brown\">",
- integer_to_list(AutoSkip),"</FONT>"];
- true -> integer_to_list(AutoSkip)
- end,
- [Result,
- "<TR valign=top>\n",
- "<TD><A HREF=\"", Link, "\">", Platform, "</A></TD>", "\n",
- make_row(integer_to_list(Succ), false),
- make_row(FailStr, false),
- make_row(integer_to_list(UserSkip), false),
- make_row(AutoSkipStr, false),
- "</TR>\n"].
-
-%% Make index page which points out individual test suites for a single platform.
-
-make_index() ->
- {ok, Pwd} = file:get_cwd(),
- Vars = read_variables(Pwd),
- make_index(Pwd, Vars, true).
-
-make_index(Dir, Vars, IncludeLast) ->
- IndexName = filename:absname("index.html", Dir),
- io:put_chars("Updating " ++ IndexName ++ "... "),
- case catch make_index1(Dir, IndexName, Vars, IncludeLast) of
- {'EXIT', Reason} ->
- io:put_chars("CRASHED!\n"),
- io:format("~p~n", [Reason]),
- {error, Reason};
- {error, Reason} ->
- io:put_chars("FAILED\n"),
- io:format("~p~n", [Reason]),
- {error, Reason};
- {ok, Summary} ->
- io:put_chars("done\n"),
- {ok, Summary};
- Err ->
- io:format("Unknown internal error. Please report.\n(Err: ~p, ID: 1)",
- [Err]),
- {error, Err}
- end.
-
-make_index1(Dir, IndexName, Vars, IncludeLast) ->
- Logs0 = ts_lib:interesting_logs(Dir),
- Logs =
- case IncludeLast of
- true -> add_last_name(Logs0);
- false -> Logs0
- end,
- {ok, {Index0, Summary}} = make_index(Logs, header(Vars), 0, 0, 0, 0, 0),
- Index = [Index0|footer()],
- case ts_lib:force_write_file(IndexName, Index) of
- ok ->
- {ok, Summary};
- {error, Reason} ->
- error({index_write_error, Reason})
- end.
-
-make_index([Name|Rest], Result, TotSucc, TotFail, UserSkip, AutoSkip, TotNotBuilt) ->
- case ts_lib:last_test(Name) of
- false ->
- %% Silently skip.
- make_index(Rest, Result, TotSucc, TotFail, UserSkip, AutoSkip, TotNotBuilt);
- Last ->
- case count_cases(Last) of
- {Succ, Fail, USkip, ASkip} ->
- Cov =
- case file:read_file(filename:join(Last,?cover_total)) of
- {ok,Bin} ->
- TotCoverage = binary_to_term(Bin),
- io_lib:format("~w %",[TotCoverage]);
- _error ->
- ""
- end,
- Link = filename:join(basename(Name), basename(Last)),
- JustTheName = rootname(basename(Name)),
- NotBuilt = not_built(JustTheName),
- NewResult = [Result, make_index1(JustTheName,
- Link, Succ, Fail, USkip, ASkip,
- NotBuilt, Cov, false)],
- make_index(Rest, NewResult, TotSucc+Succ, TotFail+Fail,
- UserSkip+USkip, AutoSkip+ASkip, TotNotBuilt+NotBuilt);
- error ->
- make_index(Rest, Result, TotSucc, TotFail, UserSkip, AutoSkip,
- TotNotBuilt)
- end
- end;
-make_index([], Result, TotSucc, TotFail, UserSkip, AutoSkip, TotNotBuilt) ->
- {ok, {[Result|make_index1("Total", no_link,
- TotSucc, TotFail, UserSkip, AutoSkip,
- TotNotBuilt, "", true)],
- {TotSucc, TotFail, UserSkip, AutoSkip}}}.
-
-make_index1(SuiteName, Link, Success, Fail, UserSkip, AutoSkip, NotBuilt, Coverage, Bold) ->
- Name = test_suite_name(SuiteName),
- FailStr =
- if Fail > 0 ->
- ["<FONT color=\"red\">",
- integer_to_list(Fail),"</FONT>"];
- true ->
- integer_to_list(Fail)
- end,
- AutoSkipStr =
- if AutoSkip > 0 ->
- ["<FONT color=\"brown\">",
- integer_to_list(AutoSkip),"</FONT>"];
- true -> integer_to_list(AutoSkip)
- end,
- ["<TR valign=top>\n",
- "<TD>",
- case Link of
- no_link ->
- ["<B>", Name|"</B>"];
- _Other ->
- CrashDumpName = SuiteName ++ "_erl_crash.dump",
- CrashDumpLink =
- case filelib:is_file(CrashDumpName) of
- true ->
- ["&nbsp;<A HREF=\"", CrashDumpName,
- "\">(CrashDump)</A>"];
- false ->
- ""
- end,
- LogFile = filename:join(Link, ?suitelog_name ++ ".html"),
- ["<A HREF=\"", LogFile, "\">", Name, "</A>\n", CrashDumpLink,
- "</TD>\n"]
- end,
- make_row(integer_to_list(Success), Bold),
- make_row(FailStr, Bold),
- make_row(integer_to_list(UserSkip), Bold),
- make_row(AutoSkipStr, Bold),
- make_row(integer_to_list(NotBuilt), Bold),
- make_row(Coverage, Bold),
- "</TR>\n"].
-
-make_row(Row, true) ->
- ["<TD ALIGN=right><B>", Row|"</B></TD>"];
-make_row(Row, false) ->
- ["<TD ALIGN=right>", Row|"</TD>"].
-
-not_built(BaseName) ->
- Dir = filename:join("..", BaseName++"_test"),
- Erl = length(filelib:wildcard(filename:join(Dir,"*_SUITE.erl"))),
- Beam = length(filelib:wildcard(filename:join(Dir,"*_SUITE.beam"))),
- Erl-Beam.
-
-
-%% Add the log file directory for the very last test run (according to
-%% last_name).
-
-add_last_name(Logs) ->
- case file:read_file("last_name") of
- {ok, Bin} ->
- Name = filename:dirname(lib:nonl(binary_to_list(Bin))),
- case lists:member(Name, Logs) of
- true -> Logs;
- false -> [Name|Logs]
- end;
- _ ->
- Logs
- end.
-
-term_to_text(Term) ->
- lists:flatten(io_lib:format("~p.\n", [Term])).
-
-test_suite_name(Name) ->
- ts_lib:initial_capital(Name) ++ " suite".
-
-directories(Dir) ->
- {ok, Files} = file:list_dir(Dir),
- [filename:join(Dir, X) || X <- Files,
- filelib:is_dir(filename:join(Dir, X))].
-
-
-%%% Headers and footers.
-
-header(Vars) ->
- Platform = ts_lib:var(platform_id, Vars),
- ["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n"
- "<!-- autogenerated by '"++atom_to_list(?MODULE)++"'. -->\n"
- "<HTML>\n",
- "<HEAD>\n",
- "<TITLE>Test Results for ", Platform, "</TITLE>\n",
- "</HEAD>\n",
-
- body_tag(),
-
- "<!-- ---- DOCUMENT TITLE ---- -->\n",
-
- "<CENTER>\n",
- "<H1>Test Results for ", Platform, "</H1>\n",
- "</CENTER>\n",
-
- "<!-- ---- CONTENT ---- -->\n",
- "<CENTER>\n",
-
- "<TABLE border=3 cellpadding=5>\n",
- "<th><B>Family</B></th>\n",
- "<th>Successful</th>\n",
- "<th>Failed</th>\n",
- "<th>User Skipped</th>\n"
- "<th>Auto Skipped</th>\n"
- "<th>Missing Suites</th>\n"
- "<th>Coverage</th>\n"
- "\n"].
-
-footer() ->
- ["</TABLE>\n"
- "</CENTER>\n"
- "<P><CENTER>\n"
- "<HR>\n"
- "<P><FONT SIZE=-1>\n"
- "Copyright &copy; ", year(),
- " <A HREF=\"http://erlang.ericsson.se\">Open Telecom Platform</A><BR>\n"
- "Updated: <!date>", current_time(), "<!/date><BR>\n"
- "</FONT>\n"
- "</CENTER>\n"
- "</body>\n"
- "</HTML>\n"].
-
-progress_header(Vars) ->
- Release = ts_lib:var(erl_release, Vars),
- ["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n"
- "<!-- autogenerated by '"++atom_to_list(?MODULE)++"'. -->\n"
- "<HTML>\n",
- "<HEAD>\n",
- "<TITLE>", Release, " Progress Test Results</TITLE>\n",
- "</HEAD>\n",
-
- body_tag(),
-
- "<!-- ---- DOCUMENT TITLE ---- -->\n",
-
- "<CENTER>\n",
- "<H1>", Release, " Progress Test Results</H1>\n",
- "<TABLE border=3 cellpadding=5>\n",
- "<th><b>Test Run</b></th><th>Platforms</th>\n"].
-
-progress_footer() ->
- ["</TABLE>\n",
- "</CENTER>\n",
- "<P><CENTER>\n",
- "<HR>\n",
- "<P><FONT SIZE=-1>\n",
- "Copyright &copy; ", year(),
- " <A HREF=\"http://erlang.ericsson.se\">Open Telecom Platform</A><BR>\n",
- "Updated: <!date>", current_time(), "<!/date><BR>\n",
- "</FONT>\n",
- "</CENTER>\n",
- "</body>\n",
- "</HTML>\n"].
-
-master_header(Vars) ->
- Release = ts_lib:var(erl_release, Vars),
- Vsn = erlang:system_info(version),
- ["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n"
- "<!-- autogenerated by '"++atom_to_list(?MODULE)++"'. -->\n"
- "<HTML>\n",
- "<HEAD>\n",
- "<TITLE>", Release, " Test Results (", Vsn, ")</TITLE>\n",
- "</HEAD>\n",
-
- body_tag(),
-
- "<!-- ---- DOCUMENT TITLE ---- -->\n",
-
- "<CENTER>\n",
- "<H1>", Release, " Test Results (", Vsn, ")</H1>\n",
- "</CENTER>\n",
-
- "<!-- ---- CONTENT ---- -->\n",
-
- "<CENTER>\n",
-
- "<TABLE border=3 cellpadding=5>\n",
- "<th><b>Platform</b></th>\n",
- "<th>Successful</th>\n",
- "<th>Failed</th>\n",
- "<th>User Skipped</th>\n"
- "<th>Auto Skipped</th>\n"
- "\n"].
-
-master_footer() ->
- ["</TABLE>\n",
- "</CENTER>\n",
- "<P><CENTER>\n",
- "<HR>\n",
- "<P><FONT SIZE=-1>\n",
- "Copyright &copy; ", year(),
- " <A HREF=\"http://erlang.ericsson.se\">Open Telecom Platform</A><BR>\n",
- "Updated: <!date>", current_time(), "<!/date><BR>\n",
- "</FONT>\n",
- "</CENTER>\n",
- "</body>\n",
- "</HTML>\n"].
-
-body_tag() ->
- "<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\""
- "vlink=\"#800080\" alink=\"#FF0000\">".
-
-year() ->
- {Y, _, _} = date(),
- integer_to_list(Y).
-
-current_time() ->
- {{Y, Mon, D}, {H, Min, S}} = calendar:local_time(),
- Weekday = weekday(calendar:day_of_the_week(Y, Mon, D)),
- lists:flatten(io_lib:format("~s ~s ~p ~2.2.0w:~2.2.0w:~2.2.0w ~w",
- [Weekday, month(Mon), D, H, Min, S, Y])).
-
-weekday(1) -> "Mon";
-weekday(2) -> "Tue";
-weekday(3) -> "Wed";
-weekday(4) -> "Thu";
-weekday(5) -> "Fri";
-weekday(6) -> "Sat";
-weekday(7) -> "Sun".
-
-month(1) -> "Jan";
-month(2) -> "Feb";
-month(3) -> "Mar";
-month(4) -> "Apr";
-month(5) -> "May";
-month(6) -> "Jun";
-month(7) -> "Jul";
-month(8) -> "Aug";
-month(9) -> "Sep";
-month(10) -> "Oct";
-month(11) -> "Nov";
-month(12) -> "Dec".
-
-%% Count test cases in the given directory (a directory of the type
-%% run.1997-08-04_09.58.52).
-
-count_cases(Dir) ->
- SumFile = filename:join(Dir, ?run_summary),
- case read_summary(SumFile, [summary]) of
- {ok, [{Succ,Fail,Skip}]} ->
- {Succ,Fail,Skip,0};
- {ok, [Summary]} ->
- Summary;
- {error, _} ->
- LogFile = filename:join(Dir, ?suitelog_name),
- case file:read_file(LogFile) of
- {ok, Bin} ->
- Summary = count_cases1(binary_to_list(Bin), {0, 0, 0, 0}),
- write_summary(SumFile, Summary),
- Summary;
- {error, _Reason} ->
- io:format("\nFailed to read ~p (skipped)\n", [LogFile]),
- error
- end
- end.
-
-write_summary(Name, Summary) ->
- File = [term_to_text({summary, Summary})],
- ts_lib:force_write_file(Name, File).
-
-% XXX: This function doesn't do what the writer expect. It can't handle
-% the case if there are several different keys and I had to add a special
-% case for the empty file. The caller also expect just one tuple as
-% a result so this function is written way to general for no reason.
-% But it works sort of. /kgb
-
-read_summary(Name, Keys) ->
- case file:consult(Name) of
- {ok, []} ->
- {error, "Empty summary file"};
- {ok, Terms} ->
- {ok, lists:map(fun(Key) -> {value, {_, Value}} =
- lists:keysearch(Key, 1, Terms),
- Value end,
- Keys)};
- {error, Reason} ->
- {error, Reason}
- end.
-
-count_cases1("=failed" ++ Rest, {Success, _Fail, UserSkip,AutoSkip}) ->
- {NextLine, Count} = get_number(Rest),
- count_cases1(NextLine, {Success, Count, UserSkip,AutoSkip});
-count_cases1("=successful" ++ Rest, {_Success, Fail, UserSkip,AutoSkip}) ->
- {NextLine, Count} = get_number(Rest),
- count_cases1(NextLine, {Count, Fail, UserSkip,AutoSkip});
-count_cases1("=skipped" ++ Rest, {Success, Fail, _UserSkip,AutoSkip}) ->
- {NextLine, Count} = get_number(Rest),
- count_cases1(NextLine, {Success, Fail, Count,AutoSkip});
-count_cases1("=user_skipped" ++ Rest, {Success, Fail, _UserSkip,AutoSkip}) ->
- {NextLine, Count} = get_number(Rest),
- count_cases1(NextLine, {Success, Fail, Count,AutoSkip});
-count_cases1("=auto_skipped" ++ Rest, {Success, Fail, UserSkip,_AutoSkip}) ->
- {NextLine, Count} = get_number(Rest),
- count_cases1(NextLine, {Success, Fail, UserSkip,Count});
-count_cases1([], Counters) ->
- Counters;
-count_cases1(Other, Counters) ->
- count_cases1(skip_to_nl(Other), Counters).
-
-get_number([$\s|Rest]) ->
- get_number(Rest);
-get_number([Digit|Rest]) when $0 =< Digit, Digit =< $9 ->
- get_number(Rest, Digit-$0).
-
-get_number([Digit|Rest], Acc) when $0 =< Digit, Digit =< $9 ->
- get_number(Rest, Acc*10+Digit-$0);
-get_number([$\n|Rest], Acc) ->
- {Rest, Acc};
-get_number([_|Rest], Acc) ->
- get_number(Rest, Acc).
-
-skip_to_nl([$\n|Rest]) ->
- Rest;
-skip_to_nl([_|Rest]) ->
- skip_to_nl(Rest);
-skip_to_nl([]) ->
- [].
diff --git a/lib/test_server/src/ts_run.erl b/lib/test_server/src/ts_run.erl
index 885a3c9b96..f4d5b3e3b1 100644
--- a/lib/test_server/src/ts_run.erl
+++ b/lib/test_server/src/ts_run.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -21,7 +21,7 @@
-module(ts_run).
--export([run/4]).
+-export([run/4,ct_run_test/2]).
-define(DEFAULT_MAKE_TIMETRAP_MINUTES, 60).
-define(DEFAULT_UNMAKE_TIMETRAP_MINUTES, 15).
@@ -87,6 +87,24 @@ execute([Hook|Rest], Vars0, Spec0, St0) ->
execute([], Vars, Spec, St) ->
{ok, Vars, Spec, St}.
+%% Wrapper to run tests using ct:run_test/1 and handle any errors.
+
+ct_run_test(Dir, CommonTestArgs) ->
+ try
+ ok = file:set_cwd(Dir),
+ case ct:run_test(CommonTestArgs) of
+ {_,_,_} ->
+ ok;
+ {error,Error} ->
+ io:format("ERROR: ~P\n", [Error,20]);
+ Other ->
+ io:format("~P\n", [Other,20])
+ end
+ catch
+ _:Crash ->
+ io:format("CRASH: ~P\n", [Crash,20])
+ end.
+
%%
%% Deletes File from Files when File is on the form .../<SUITE>_data/<file>
%% when all of <SUITE> has been skipped in Spec, i.e. there
@@ -157,7 +175,6 @@ get_config_files() ->
[TSConfig | case os:type() of
{unix,_} -> ["ts.unix.config"];
{win32,_} -> ["ts.win32.config"];
- vxworks -> ["ts.vxworks.config"];
_ -> []
end].
@@ -229,10 +246,9 @@ make_command(Vars, Spec, State) ->
%% uncomment the line below to disable exception formatting
%% " -test_server_format_exception false",
" -boot start_sasl -sasl errlog_type error",
- " -pz ",Cwd,
+ " -pz \"",Cwd,"\"",
" -ct_test_vars ",TestVars,
- " -eval \"file:set_cwd(\\\"",TestDir,"\\\")\" "
- " -eval \"ct:run_test(",
+ " -eval \"ts_run:ct_run_test(\\\"",TestDir,"\\\", ",
backslashify(lists:flatten(State#state.test_server_args)),")\""
" ",
ExtraArgs],
@@ -329,14 +345,13 @@ start_xterm(Command) ->
path_separator() ->
case os:type() of
{win32, _} -> ";";
- {unix, _} -> ":";
- vxworks -> ":"
+ {unix, _} -> ":"
end.
-make_common_test_args(Args0, Options, _Vars) ->
+make_common_test_args(Args0, Options0, _Vars) ->
Trace =
- case lists:keysearch(trace,1,Options) of
+ case lists:keysearch(trace,1,Options0) of
{value,{trace,TI}} when is_tuple(TI); is_tuple(hd(TI)) ->
ok = file:write_file(?tracefile,io_lib:format("~p.~n",[TI])),
[{ct_trace,?tracefile}];
@@ -348,7 +363,7 @@ make_common_test_args(Args0, Options, _Vars) ->
[]
end,
Cover =
- case lists:keysearch(cover,1,Options) of
+ case lists:keysearch(cover,1,Options0) of
{value,{cover, App, none, _Analyse}} ->
io:format("No cover file found for ~p~n",[App]),
[];
@@ -358,7 +373,7 @@ make_common_test_args(Args0, Options, _Vars) ->
[]
end,
- Logdir = case lists:keysearch(logdir, 1, Options) of
+ Logdir = case lists:keysearch(logdir, 1, Options0) of
{value,{logdir, _}} ->
[];
false ->
@@ -373,15 +388,16 @@ make_common_test_args(Args0, Options, _Vars) ->
{scale_timetraps, true}]
end,
- ConfigPath = case {os:getenv("TEST_CONFIG_PATH"),
- lists:keysearch(config, 1, Options)} of
- {false,{value, {config, Path}}} ->
- Path;
- {false,false} ->
- "../test_server";
- {Path,_} ->
- Path
- end,
+ {ConfigPath,
+ Options} = case {os:getenv("TEST_CONFIG_PATH"),
+ lists:keysearch(config, 1, Options0)} of
+ {_,{value, {config, Path}}} ->
+ {Path,lists:keydelete(config, 1, Options0)};
+ {false,false} ->
+ {"../test_server",Options0};
+ {Path,_} ->
+ {Path,Options0}
+ end,
ConfigFiles = [{config,[filename:join(ConfigPath,File)
|| File <- get_config_files()]}],
io_lib:format("~100000p",[Args0++Trace++Cover++Logdir++
diff --git a/lib/test_server/src/ts_selftest.erl b/lib/test_server/src/ts_selftest.erl
deleted file mode 100644
index 655aa4bab3..0000000000
--- a/lib/test_server/src/ts_selftest.erl
+++ /dev/null
@@ -1,120 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(ts_selftest).
--export([selftest/0]).
-
-selftest() ->
- case node() of
- nonode@nohost ->
- io:format("Sorry, you have to start this node distributed.~n"),
- exit({error, node_not_distributed});
- _ ->
- ok
- end,
- case catch ts:tests(test_server) of
- {'EXIT', _} ->
- io:format("Test Server self test not availiable.");
- Other ->
- selftest1()
- end.
-
-selftest1() ->
- % Batch starts
- io:format("Selftest #1: Whole spec, batch mode:~n"),
- io:format("------------------------------------~n"),
- ts:run(test_server, [batch]),
- ok=check_result(1, "test_server.logs", 2),
-
- io:format("Selftest #2: One module, batch mode:~n"),
- io:format("------------------------------------~n"),
- ts:run(test_server, test_server_SUITE, [batch]),
- ok=check_result(2, "test_server_SUITE.logs", 2),
-
- io:format("Selftest #3: One testcase, batch mode:~n"),
- io:format("--------------------------------------~n"),
- ts:run(test_server, test_server_SUITE, msgs, [batch]),
- ok=check_result(3, "test_server_SUITE.logs", 0),
-
- % Interactive starts
- io:format("Selftest #4: Whole spec, interactive mode:~n"),
- io:format("------------------------------------------~n"),
- ts:run(test_server),
- kill_test_server(),
- ok=check_result(4, "test_server.logs", 2),
-
- io:format("Selftest #5: One module, interactive mode:~n"),
- io:format("------------------------------------------~n"),
- ts:run(test_server, test_server_SUITE),
- kill_test_server(),
- ok=check_result(5, "test_server_SUITE.logs", 2),
-
- io:format("Selftest #6: One testcase, interactive mode:~n"),
- io:format("--------------------------------------------~n"),
- ts:run(test_server, test_server_SUITE, msgs),
- kill_test_server(),
- ok=check_result(6, "test_server_SUITE.logs", 0),
-
- ok.
-
-check_result(Test, TDir, ExpSkip) ->
- Dir=ts_lib:last_test(TDir),
- {Total, Failed, Skipped}=ts_reports:count_cases(Dir),
- io:format("Selftest #~p:",[Test]),
- case {Total, Failed, Skipped} of
- {_, 0, ExpSkip} -> % 2 test cases should be skipped.
- io:format("All ok.~n~n"),
- ok;
- {_, _, _} ->
- io:format("Not completely successful.~n~n"),
- error
- end.
-
-
-%% Wait for test server to get started.
-kill_test_server() ->
- Node=list_to_atom("test_server@"++atom_to_list(hostname())),
- net_adm:ping(Node),
- case whereis(test_server_ctrl) of
- undefined ->
- kill_test_server();
- Pid ->
- kill_test_server(0, Pid)
- end.
-
-%% Wait for test server to finish.
-kill_test_server(30, Pid) ->
- exit(self(), test_server_is_dead);
-kill_test_server(Num, Pid) ->
- case whereis(test_server_ctrl) of
- undefined ->
- slave:stop(node(Pid));
- Pid ->
- receive
- after
- 1000 ->
- kill_test_server(Num+1, Pid)
- end
- end.
-
-
-hostname() ->
- list_to_atom(from($@, atom_to_list(node()))).
-from(H, [H | T]) -> T;
-from(H, [_ | T]) -> from(H, T);
-from(H, []) -> [].
diff --git a/lib/test_server/src/vxworks_client.erl b/lib/test_server/src/vxworks_client.erl
deleted file mode 100644
index ca65eca02a..0000000000
--- a/lib/test_server/src/vxworks_client.erl
+++ /dev/null
@@ -1,243 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2002-2009. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(vxworks_client).
-
--export([open/1, close/1, send_data/2, send_data/3, send_data_wait_for_close/2, reboot/1]).
--export([init/2]).
-
--include("ts.hrl").
-
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% This is a client talking to a test server daemon on a VxWorks card.
-%%%
-%%% User interface:
-%%%
-%%% open/1
-%%% Start a client and establish the connection with the test server daemon
-%%%
-%%% send_data/2
-%%% Send data/command to the test server daemon, don't wait for any return
-%%%
-%%% send_data/3
-%%% Send data/command to the test server daemon and wait for the given
-%%% return value.
-%%%
-%%% send_data_wait_for_close/2
-%%% Send data/command to the test server daemon and wait for the daemon to
-%%% close the connection.
-%%%
-%%% close/1
-%%% Close the client.
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
-%%
-%% User interface
-%%
-
-reboot(Target) ->
- {ok, {_,_,_,_,_,[Addr|_]}} = inet:gethostbyname(Target),
- Fun = fun({ok, Socket}) ->
- gen_tcp:send(Socket, "q\n"),
- receive
- {tcp_closed, Socket} ->
- gen_tcp:close(Socket),
- {ok, socket_closed}
- after 5000 ->
- exit({timeout, tryagain})
- end
- end,
- io:format("Stopping (rebooting) ~p ",[Target]),
- case fun_target(Addr, Fun) of
- {ok, socket_closed} ->
- ok;
- _Else ->
- io:format("No contact with ts daemon - exiting ...~n"),
- exit({stop, no_ts_daemon_contact})
- end.
-
-
-%% open(Target) -> {ok,Client} | {error, Reason}
-open(Target) ->
- {ok, {_,_,_,_,_,[Addr|_]}} = inet:gethostbyname(Target),
- Fun = fun({ok, Socket}) ->
- P = spawn(?MODULE,init,[Target,Socket]),
- inet_tcp:controlling_process(Socket,P),
- {ok,P}
- end,
- case fun_target(Addr,Fun) of
- {ok, Pid} ->
- {ok, Pid};
- {error,Reason} ->
- {error, Reason}
- end.
-
-%% send_data(Client,Data) -> ok
-send_data(Pid,Data) ->
- Pid ! {send_data,Data++"\n"},
- ok.
-
-%% send_data(Client,Data,ExpectedReturn) -> {ok,ExpectedReturn} | {error,Reason}
-send_data(Pid,Data,Return) ->
- Pid ! {send_data,Data++"\n",Return,self()},
- receive {Pid,Result} -> Result end.
-
-%% send_data_wait_for_close(Client,Data) -> ok | {error,Reason}
-send_data_wait_for_close(Pid,Data) ->
- send_data(Pid,Data,tcp_closed).
-
-%% close(Client) -> ok
-close(Pid) ->
- Pid ! close,
- ok.
-
-
-%%
-%% Internal
-%%
-
-init(Target,Socket) ->
- process_flag(trap_exit,true),
- loop(Target,Socket).
-
-loop(Target,Socket) ->
- receive
- {send_data,Data} ->
- %% io:format("vx client sending: ~p~n", [Data]),
- gen_tcp:send(Socket, Data),
- loop(Socket,Target);
- {send_data,Data,tcp_closed,From} ->
- %% io:format("vx client sending: ~p~n", [Data]),
- gen_tcp:send(Socket, Data),
- receive
- {tcp_closed, Socket} ->
- From ! {self(),ok}
- after 5000 ->
- From ! {self(),{error,timeout}}
- end,
- closed(Socket,normal);
- {send_data,Data,Return,From} ->
- %% io:format("vx client sending: ~p~n", [Data]),
- gen_tcp:send(Socket, Data),
- case receive_line(Socket,[],Return,200) of
- {tcp_closed, Socket} ->
- From ! {self(),{error,{socket_closed,Target}}},
- closed(Socket,{socket_closed,Target});
- {tcp,Socket,_Rest} ->
- From ! {self(),{ok,Data}},
- got_data(Target,Socket,Data);
- error ->
- From ! {self(),{error,{catatonic,Target}}}
- end;
- close ->
- closed(Socket,normal);
- {tcp_closed, Socket} ->
- closed(Socket,{socket_closed,Target});
- {tcp,Socket,Data} ->
- got_data(Target,Socket,Data)
- end.
-
-
-
-closed(Socket,Reason) ->
- gen_tcp:close(Socket),
- exit(Reason).
-
-got_data(Target,Socket,Data) ->
- if is_atom(Target) ->
- io:format("~w: ~s",[Target,uncr(Data)]);
- true ->
- io:format("~s: ~s",[Target,uncr(Data)])
- end,
- loop(Target,Socket).
-
-uncr([]) ->
- [];
-uncr([$\r | T]) ->
- uncr(T);
-uncr([H | T]) ->
- [H | uncr(T)].
-
-strip_line(Line) ->
- RPos = string:rchr(Line, $\n),
- string:substr(Line,RPos+1).
-
-maybe_done_receive(Socket,Ack,Match,C) ->
- case string:str(Ack,Match) of
- 0 ->
- receive_line(Socket,strip_line(Ack),Match,C);
- _ ->
- {tcp,Socket,strip_line(Ack)}
- end.
-
-
-receive_line(_Socket,_Ack,_Match,0) ->
- error;
-receive_line(Socket,Ack,Match,Counter) ->
- receive
- {tcp_closed, Socket} ->
- {tcp_closed, Socket};
- {tcp,Socket,Data} ->
- NewAck = Ack ++ Data,
- case {string:str(NewAck,"\r") > 0,
- string:str(NewAck,"\n") > 0} of
- {true,_} ->
- maybe_done_receive(Socket,NewAck,Match,Counter-1);
- {_,true} ->
- maybe_done_receive(Socket,NewAck,Match,Counter-1);
- _ ->
- receive_line(Socket,NewAck,Match,Counter)
- end
- after 20000 ->
- error
- end.
-
-
-%% Misc functions
-fun_target(Addr, Fun) ->
- io:format("["),
- fun_target(Addr, Fun, 60). %Vx-cards need plenty of time.
-
-fun_target(_Addr, _Fun, 0) ->
- io:format(" no contact with ts daemon]~n"),
- {error,failed_to_connect};
-fun_target(Addr, Fun, Tries_left) ->
- receive after 1 -> ok end,
- case do_connect(Addr, Fun) of
- {ok, Value} ->
- io:format(" ok]~n"),
- {ok, Value};
- _Error -> % typical {error, econnrefused}
- io:format("."),
- receive after 10000 -> ok end,
- fun_target(Addr, Fun, Tries_left-1)
- end.
-
-do_connect(Addr, Fun) ->
- case gen_tcp:connect(Addr, ?TS_PORT, [{reuseaddr, true}], 60000) of
- {ok, Socket} ->
- Fun({ok, Socket});
- Error ->
- Error
- end.
-
-
-
diff --git a/lib/test_server/test/Makefile b/lib/test_server/test/Makefile
index 198440bb17..a3f9820d7f 100644
--- a/lib/test_server/test/Makefile
+++ b/lib/test_server/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -26,7 +26,6 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk
MODULES= \
test_server_SUITE \
- test_server_line_SUITE \
test_server_test_lib
ERL_FILES= $(MODULES:%=%.erl)
@@ -65,7 +64,6 @@ make_emakefile:
>> $(EMAKEFILE)
tests debug opt: make_emakefile
- cd ../src && $(MAKE) ../ebin/test_server_line.beam
erl $(ERL_MAKE_FLAGS) -make
clean:
@@ -83,10 +81,10 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(EMAKEFILE) $(ERL_FILES) $(COVERFILE) $(RELSYSDIR)
- $(INSTALL_DATA) test_server_test_lib.hrl test_server.spec test_server.cover $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(EMAKEFILE) $(ERL_FILES) $(COVERFILE) "$(RELSYSDIR)"
+ $(INSTALL_DATA) test_server_test_lib.hrl test_server.spec test_server.cover "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/test_server/test/test_server.cover b/lib/test_server/test/test_server.cover
index 5c59bab494..c16212567e 100644
--- a/lib/test_server/test/test_server.cover
+++ b/lib/test_server/test/test_server.cover
@@ -11,12 +11,11 @@
test_server_node,
test_server_sup,
ts,
- ts_autoconf_vxworks,
ts_autoconf_win32,
ts_erl_config,
ts_install,
ts_lib,
ts_make,
- ts_run,
- vxworks_client]}.
+ ts_run
+ ]}.
diff --git a/lib/test_server/test/test_server_SUITE.erl b/lib/test_server/test/test_server_SUITE.erl
index a8532b08ab..cb8cb9da31 100644
--- a/lib/test_server/test/test_server_SUITE.erl
+++ b/lib/test_server/test/test_server_SUITE.erl
@@ -92,8 +92,8 @@ test_server_SUITE(Config) ->
% rpc:call(Node,dbg, tracer,[]),
% rpc:call(Node,dbg, p,[all,c]),
% rpc:call(Node,dbg, tpl,[test_server_ctrl,x]),
- run_test_server_tests("test_server_SUITE", 39, 1, 31,
- 20, 9, 1, 11, 2, 26, Config).
+ run_test_server_tests("test_server_SUITE", 38, 1, 30,
+ 19, 9, 1, 11, 2, 25, Config).
test_server_parallel01_SUITE(Config) ->
run_test_server_tests("test_server_parallel01_SUITE", 37, 0, 19,
@@ -120,7 +120,7 @@ run_test_server_tests(SuiteName, NCases, NFail, NExpected, NSucc,
NUsrSkip, NAutoSkip,
NActualSkip, NActualFail, NActualSucc, Config) ->
- ct:log("See test case log files under:~n~p~n",
+ ct:log("<a href=\"file://~s\">Test case log files</a>\n",
[filename:join([proplists:get_value(priv_dir, Config),
SuiteName++".logs"])]),
@@ -138,17 +138,16 @@ run_test_server_tests(SuiteName, NCases, NFail, NExpected, NSucc,
rpc:call(Node,test_server_ctrl, stop, []),
- {ok,#suite{ n_cases = NCases,
- n_cases_failed = NFail,
- n_cases_expected = NExpected,
- n_cases_succ = NSucc,
- n_cases_user_skip = NUsrSkip,
- n_cases_auto_skip = NAutoSkip,
- cases = Cases }} = Data =
- test_server_test_lib:parse_suite(
- hd(filelib:wildcard(
- filename:join([proplists:get_value(priv_dir, Config),
- SuiteName++".logs","run*","suite.log"])))),
+ {ok,Data} = test_server_test_lib:parse_suite(
+ hd(filelib:wildcard(
+ filename:join([proplists:get_value(priv_dir, Config),
+ SuiteName++".logs","run*","suite.log"])))),
+ check([{"Number of cases",NCases,Data#suite.n_cases},
+ {"Number failed",NFail,Data#suite.n_cases_failed},
+ {"Number expected",NExpected,Data#suite.n_cases_expected},
+ {"Number successful",NSucc,Data#suite.n_cases_succ},
+ {"Number user skipped",NUsrSkip,Data#suite.n_cases_user_skip},
+ {"Number auto skipped",NAutoSkip,Data#suite.n_cases_auto_skip}], ok),
{NActualSkip,NActualFail,NActualSucc} =
lists:foldl(fun(#tc{ result = skip },{S,F,Su}) ->
{S+1,F,Su};
@@ -156,9 +155,18 @@ run_test_server_tests(SuiteName, NCases, NFail, NExpected, NSucc,
{S,F,Su+1};
(#tc{ result = failed },{S,F,Su}) ->
{S,F+1,Su}
- end,{0,0,0},Cases),
+ end,{0,0,0},Data#suite.cases),
Data.
+check([{Str,Same,Same}|T], Status) ->
+ io:format("~s: ~p\n", [Str,Same]),
+ check(T, Status);
+check([{Str,Expected,Actual}|T], _) ->
+ io:format("~s: expected ~p, actual ~p\n", [Str,Expected,Actual]),
+ check(T, error);
+check([], ok) -> ok;
+check([], error) -> ?t:fail().
+
until(Fun) ->
case Fun() of
true ->
diff --git a/lib/test_server/test/test_server_SUITE_data/test_server_SUITE.erl b/lib/test_server/test/test_server_SUITE_data/test_server_SUITE.erl
index dfcdff0c3e..ab25e4ad2f 100644
--- a/lib/test_server/test/test_server_SUITE_data/test_server_SUITE.erl
+++ b/lib/test_server/test/test_server_SUITE_data/test_server_SUITE.erl
@@ -34,7 +34,7 @@
do_times/1, do_times_mfa/1, do_times_fun/1,
skip_cases/1, skip_case1/1, skip_case2/1, skip_case3/1,
skip_case4/1, skip_case5/1, skip_case6/1, skip_case7/1,
- skip_case8/1, skip_case9/1, undefined_functions/1,
+ skip_case8/1, skip_case9/1,
conf_init/1, check_new_conf/1, conf_cleanup/1,
check_old_conf/1, conf_init_fail/1, start_stop_node/1,
cleanup_nodes_init/1, check_survive_nodes/1, cleanup_nodes_fin/1,
@@ -47,7 +47,7 @@ all(suite) ->
[config, comment, timetrap, timetrap_cancel, multiply_timetrap,
init_per_s, init_per_tc, end_per_tc,
timeconv, msgs, capture, timecall, do_times, skip_cases,
- undefined_functions, commercial,
+ commercial,
{conf, conf_init, [check_new_conf], conf_cleanup},
check_old_conf,
{conf, conf_init_fail,[conf_member_skip],conf_cleanup_skip},
@@ -386,50 +386,6 @@ skip_case9(Config) when is_list(Config) ->
%% returning {skip, Reason} from init_per_testcase/2 for this case.
?t:fail("This case should have been Skipped by init_per_testcase/2").
-undefined_functions(suite) -> [];
-undefined_functions(doc) -> ["Check for calls to undefined functions in"
- " test_server."
- "Skip if cover is running"];
-undefined_functions(Config) when is_list(Config) ->
- case whereis(cover_server) of
- Pid when is_pid(Pid) ->
- {skip,"Cover is running"};
- undefined ->
- undefined_functions()
- end.
-
-undefined_functions() ->
- TestServerDir = filename:dirname(code:which(test_server)),
- Res = xref:d(TestServerDir),
-
- {value,{unused,Unused}} = lists:keysearch(unused, 1, Res),
- case Unused of
- [] -> ok;
- _ ->
- lists:foreach(fun (MFA) ->
- io:format("~s unused", [format_mfa(MFA)])
- end, Unused)
- end,
-
- {value,{undefined,Undef0}} = lists:keysearch(undefined, 1, Res),
- Undef = [U || U <- Undef0, not unresolved(U)],
- case Undef of
- [] -> ok;
- _ ->
- lists:foreach(fun ({MFA1,MFA2}) ->
- io:format("~s calls undefined ~s",
- [format_mfa(MFA1),format_mfa(MFA2)])
- end, Undef),
- ?t:fail({length(Undef),undefined_functions_in_otp})
- end,
- ok.
-
-unresolved({_,{_,'$F_EXPR',_}}) -> true;
-unresolved(_) -> false.
-
-format_mfa({M,F,A}) ->
- lists:flatten(io_lib:format("~s:~s/~p", [M,F,A])).
-
conf_init(doc) -> ["Test successful conf case: Change Config parameter"];
conf_init(Config) when is_list(Config) ->
[{conf_init_var,1389}|Config].
diff --git a/lib/test_server/test/test_server_line_SUITE.erl b/lib/test_server/test/test_server_line_SUITE.erl
deleted file mode 100644
index 0aba54f6b5..0000000000
--- a/lib/test_server/test/test_server_line_SUITE.erl
+++ /dev/null
@@ -1,131 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-
-%%%------------------------------------------------------------------
-%%% Test Server self test.
-%%%------------------------------------------------------------------
--module(test_server_line_SUITE).
--include_lib("test_server/include/test_server.hrl").
-
--export([all/0,suite/0]).
--export([init_per_suite/1,end_per_suite/1,
- init_per_testcase/2, end_per_testcase/2]).
--export([parse_transform/1, lines/1]).
-
-suite() ->
- [{ct_hooks,[ts_install_cth]},
- {doc,["Test of parse transform for collection line numbers"]}].
-
-all() -> [parse_transform,lines].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_testcase(_Case, Config) ->
- ?line test_server_line:clear(),
- Dog = ?t:timetrap(?t:minutes(2)),
- [{watchdog, Dog}|Config].
-
-end_per_testcase(_Case, Config) ->
- ?line test_server_line:clear(),
- Dog=?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
- ok.
-
-parse_transform(suite) -> [];
-parse_transform(doc) -> [];
-parse_transform(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir,Config),
- code:add_pathz(DataDir),
-
- ?line ok = parse_transform_test:excluded(),
- ?line [] = test_server_line:get_lines(),
-
- ?line test_server_line:clear(),
- ?line ok = parse_transform_test:func(),
-
- ?line [{parse_transform_test,func4,58},
- {parse_transform_test,func,49},
- {parse_transform_test,func3,56},
- {parse_transform_test,func,39},
- {parse_transform_test,func2,54},
- {parse_transform_test,func,36},
- {parse_transform_test,func1,52},
- {parse_transform_test,func,35}] = test_server_line:get_lines(),
-
- code:del_path(DataDir),
- ok.
-
-lines(suite) -> [];
-lines(doc) -> ["Test parse transform for collection line numbers"];
-lines(Config) when is_list(Config) ->
- ?line L0 = [{mod,func,1},{mod,func,2},{mod,func,3},
- {m,f,4},{m,f,5},{m,f,6},
- {mo,fu,7},{mo,fu,8},{mo,fu,9}],
- ?line LL = string:copies(L0, 1000),
- ?line T1 = erlang:now(),
- ?line lists:foreach(fun ({M,F,L}) ->
- test_server_line:'$test_server_line'(M, F, L)
- end, LL),
- ?line T2 = erlang:now(),
- ?line Long = test_server_line:get_lines(),
- ?line test_server_line:clear(),
-
- ?line T3 = erlang:now(),
- ?line lists:foreach(fun ({M,F,L}) ->
- test_server_line:'$test_server_lineQ'(M, F, L)
- end, LL),
- ?line T4 = erlang:now(),
- ?line LongQ = test_server_line:get_lines(),
-
- ?line io:format("'$test_server_line': ~f~n'$test_server_lineQ': ~f~n",
- [timer:now_diff(T2, T1)/1000, timer:now_diff(T4, T3)/1000]),
- ?line io:format("'$test_server_line' result long:~p~n", [Long]),
- ?line io:format("'$test_server_lineQ' result long:~p~n", [LongQ]),
-
- if Long =:= LongQ ->
- ?line ok;
- true ->
- ?line ?t:fail("The two methods did not produce same result for"
- " long lists of lines")
- end,
-
- ?line test_server_line:clear(),
- ?line lists:foreach(fun ({M,F,L}) ->
- test_server_line:'$test_server_line'(M, F, L)
- end, L0),
- ?line Short = test_server_line:get_lines(),
- ?line test_server_line:clear(),
- ?line lists:foreach(fun ({M,F,L}) ->
- test_server_line:'$test_server_lineQ'(M, F, L)
- end, L0),
- ?line ShortQ = test_server_line:get_lines(),
-
- ?line io:format("'$test_server_line' result short:~p~n", [Short]),
- ?line io:format("'$test_server_lineQ' result short:~p~n", [ShortQ]),
-
- if Short =:= ShortQ ->
- ?line ok;
- true ->
- ?line ?t:fail("The two methods did not produce same result for"
- " shot lists of lines\n")
- end.
diff --git a/lib/test_server/test/test_server_line_SUITE_data/Makefile.src b/lib/test_server/test/test_server_line_SUITE_data/Makefile.src
deleted file mode 100644
index a077648934..0000000000
--- a/lib/test_server/test/test_server_line_SUITE_data/Makefile.src
+++ /dev/null
@@ -1,6 +0,0 @@
-EFLAGS=+debug_info -pa ../../test_server -I../../test_server
-
-all: parse_transform_test.@EMULATOR@
-
-parse_transform_test.@EMULATOR@: parse_transform_test.erl
- erlc $(EFLAGS) parse_transform_test.erl
diff --git a/lib/test_server/test/test_server_line_SUITE_data/parse_transform_test.erl b/lib/test_server/test/test_server_line_SUITE_data/parse_transform_test.erl
deleted file mode 100644
index 8f3477d3ac..0000000000
--- a/lib/test_server/test/test_server_line_SUITE_data/parse_transform_test.erl
+++ /dev/null
@@ -1,59 +0,0 @@
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(parse_transform_test).
-
--include("test_server_line.hrl").
--no_lines([{excluded,0}]).
-
--export([excluded/0, func/0]).
-
-
-excluded() ->
- line1,
- line2,
- ok.
-
-
-func() ->
- hello,
- func1(),
- case func2() of
- ok ->
- helloagain,
- case func3() of
- ok ->
- ok;
- error ->
- error
- end;
- error ->
- error
- end,
- excluded(),
- func4().
-
-func1() ->
- ok.
-func2() ->
- ok.
-func3() ->
- error.
-func4() ->
- ok.
-
diff --git a/lib/test_server/vsn.mk b/lib/test_server/vsn.mk
index 88e3856cf4..aecf595f3f 100644
--- a/lib/test_server/vsn.mk
+++ b/lib/test_server/vsn.mk
@@ -1 +1 @@
-TEST_SERVER_VSN = 3.5
+TEST_SERVER_VSN = 3.5.2
diff --git a/lib/toolbar/doc/src/Makefile b/lib/toolbar/doc/src/Makefile
index 76147c111e..2239421556 100644
--- a/lib/toolbar/doc/src/Makefile
+++ b/lib/toolbar/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -102,14 +102,14 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/toolbar/doc/src/notes.xml b/lib/toolbar/doc/src/notes.xml
index ac6ad533fc..f3ed41bd82 100644
--- a/lib/toolbar/doc/src/notes.xml
+++ b/lib/toolbar/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -31,6 +31,26 @@
<p>This document describes the changes made to the Toolbar
application.</p>
+<section><title>Toolbar 1.4.2.2</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>The GS applications is now deprecated and will be
+ removed in the R16 release. The following GS-based
+ applications have been superseded by the Observer
+ application and will removed in R16: Appmon, Pman,
+ Tv.</p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>
+ Own Id: OTP-9907</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Toolbar 1.4.2.1</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/toolbar/doc/src/toolbar.xml b/lib/toolbar/doc/src/toolbar.xml
index ad379438fe..2580de2242 100644
--- a/lib/toolbar/doc/src/toolbar.xml
+++ b/lib/toolbar/doc/src/toolbar.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1996</year>
- <year>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -33,6 +33,11 @@
<module>toolbar</module>
<modulesummary>GUI for Starting Tools and User Contributions</modulesummary>
<description>
+ <warning>
+ <p>
+ The Toolbar application is deprecated and will be removed in R16.
+ </p>
+ </warning>
<p>Toolbar makes it easier to use
the different Erlang tools - and the user contributions - which are provided.
It has a graphical user interface with an icon for each tool.
diff --git a/lib/toolbar/doc/src/toolbar_chapter.xml b/lib/toolbar/doc/src/toolbar_chapter.xml
index a80dc5bd3e..ebd47ef2fe 100644
--- a/lib/toolbar/doc/src/toolbar_chapter.xml
+++ b/lib/toolbar/doc/src/toolbar_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1996</year><year>2009</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -28,6 +28,11 @@
<rev>A</rev>
<file>toolbar_chapter.xml</file>
</header>
+ <warning>
+ <p>
+ The Toolbar application is deprecated and will be removed in R16.
+ </p>
+ </warning>
<p>Toolbar provides an interface to the various Erlang tools which are available. Toolbar can also provide access to user supplied tools which are included with the Erlang software release. These tools are called GS Contributions.</p>
<p>All tools included in Toolbar must have a configuration file which contains information about the tool, such as its start function and the location of help information. The name of a configuration file must include the suffix <c>.tool</c>.
</p>
diff --git a/lib/toolbar/src/Makefile b/lib/toolbar/src/Makefile
index 14e1451609..102970a59a 100644
--- a/lib/toolbar/src/Makefile
+++ b/lib/toolbar/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2009. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -84,10 +84,10 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/toolbar/src/canvasbutton.erl b/lib/toolbar/src/canvasbutton.erl
index 38fce537bb..81e0ed43bb 100644
--- a/lib/toolbar/src/canvasbutton.erl
+++ b/lib/toolbar/src/canvasbutton.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -17,6 +17,9 @@
%% %CopyrightEnd%
%%
-module(canvasbutton).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,read,2}}]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
diff --git a/lib/toolbar/src/toolbar.erl b/lib/toolbar/src/toolbar.erl
index 67967172fe..b37c323008 100644
--- a/lib/toolbar/src/toolbar.erl
+++ b/lib/toolbar/src/toolbar.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -17,6 +17,7 @@
%% %CopyrightEnd%
%%
-module(toolbar).
+-compile([{nowarn_deprecated_function,{gs,start,1}}]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
diff --git a/lib/toolbar/src/toolbar_graphics.erl b/lib/toolbar/src/toolbar_graphics.erl
index ad390440e3..c4c4273c63 100644
--- a/lib/toolbar/src/toolbar_graphics.erl
+++ b/lib/toolbar/src/toolbar_graphics.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -17,6 +17,9 @@
%% %CopyrightEnd%
%%
-module(toolbar_graphics).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,read,2}}]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
diff --git a/lib/toolbar/src/toolbar_toolconfig.erl b/lib/toolbar/src/toolbar_toolconfig.erl
index 6dccb7ba72..479033fa22 100644
--- a/lib/toolbar/src/toolbar_toolconfig.erl
+++ b/lib/toolbar/src/toolbar_toolconfig.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2012. 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
@@ -17,6 +17,11 @@
%% %CopyrightEnd%
%%
-module(toolbar_toolconfig).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}}]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
diff --git a/lib/toolbar/vsn.mk b/lib/toolbar/vsn.mk
index b2b0764877..9fbfec871f 100644
--- a/lib/toolbar/vsn.mk
+++ b/lib/toolbar/vsn.mk
@@ -1,4 +1,4 @@
-TOOLBAR_VSN = 1.4.2.1
+TOOLBAR_VSN = 1.4.2.2
diff --git a/lib/tools/c_src/Makefile.in b/lib/tools/c_src/Makefile.in
index b8c4aed6e2..0382d3228d 100644
--- a/lib/tools/c_src/Makefile.in
+++ b/lib/tools/c_src/Makefile.in
@@ -188,11 +188,11 @@ include ../vsn.mk
RELSYSDIR = $(RELEASE_PATH)/lib/tools-$(TOOLS_VSN)
release_spec: all
- $(INSTALL_DIR) $(RELSYSDIR)/c_src
- $(INSTALL_DATA) $(EMEM_SRCS) $(EMEM_HEADERS) $(RELSYSDIR)/c_src
+ $(INSTALL_DIR) "$(RELSYSDIR)/c_src"
+ $(INSTALL_DATA) $(EMEM_SRCS) $(EMEM_HEADERS) "$(RELSYSDIR)/c_src"
ifneq ($(PROGS),)
- $(INSTALL_DIR) $(RELSYSDIR)/bin
- $(INSTALL_PROGRAM) $(PROGS) $(RELSYSDIR)/bin
+ $(INSTALL_DIR) "$(RELSYSDIR)/bin"
+ $(INSTALL_PROGRAM) $(PROGS) "$(RELSYSDIR)/bin"
endif
release_docs_spec:
diff --git a/lib/tools/c_src/erl_memory.c b/lib/tools/c_src/erl_memory.c
index 5239176d03..86e84723b1 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-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2012. 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/lib/tools/doc/src/Makefile b/lib/tools/doc/src/Makefile
index 433f123ae5..e3a2d64041 100644
--- a/lib/tools/doc/src/Makefile
+++ b/lib/tools/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2010. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -121,14 +121,14 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/tools/doc/src/eprof.xml b/lib/tools/doc/src/eprof.xml
index 8b614d8860..82eb8dd284 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>2011</year>
+ <year>1996</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -67,9 +67,9 @@
<p><c>Rootset</c> is a list of pids and registered names.</p>
<p>The function returns <c>profiling</c> if tracing could be enabled
for all processes in <c>Rootset</c>, or <c>error</c> otherwise.</p>
- <p>A pattern can be selected to narrow the profiling. For instance ca a specific
- module be selected and only the code processes executes in that module will be
- profiled.</p>
+ <p>A pattern can be selected to narrow the profiling. For instance a
+ specific module can be selected, and only the code executed in that
+ module will be profiled.</p>
</desc>
</func>
<func>
@@ -147,8 +147,8 @@
</type>
<desc>
<p>This function ensures that the results displayed by
- <c>analyze/0,1,2</c> are printed both to
- the file <c>File</c> and the screen.</p>
+ <c>analyze/0,1,2</c> are printed both to the file
+ <c>File</c> and the screen.</p>
</desc>
</func>
<func>
diff --git a/lib/tools/doc/src/notes.xml b/lib/tools/doc/src/notes.xml
index e24e1c5977..5d7bd464ce 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,6 +30,94 @@
</header>
<p>This document describes the changes made to the Tools application.</p>
+<section><title>Tools 2.6.8</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ The last tuple fun call has been removed from fprof.</p>
+ <p>
+ Own Id: OTP-10091 Aux Id: seq12067 </p>
+ </item>
+ <item>
+ <p>
+ Fix indentation of record fields in Emacs (Thanks to
+ Tomas Abrahamsson)</p>
+ <p>
+ Own Id: OTP-10120</p>
+ </item>
+ <item>
+ <p>
+ Documentation fixes (Thanks to Ricardo Catalinas Jim�nez
+ )</p>
+ <p>
+ Own Id: OTP-10121</p>
+ </item>
+ <item>
+ <p>
+ Remove Erlang-specific compilation error regexp in
+ erlang.el</p>
+ <p>
+ Own Id: OTP-10168</p>
+ </item>
+ <item>
+ <p>
+ Fix highlighting of atoms ending with a dollar sign</p>
+ <p>
+ Like this: 'atom$'. In that example, the last single
+ quote should be recognised as ending the atom. This needs
+ a font-lock workaround similar to the one for strings.
+ Thanks to Magnus Henoch</p>
+ <p>
+ Own Id: OTP-10178</p>
+ </item>
+ <item>
+ <p> Xref now accepts filenames with character codes
+ greater than 126. (Thanks to Emile Joubert for reporting
+ the issue.) </p>
+ <p>
+ Own Id: OTP-10192</p>
+ </item>
+ <item>
+ <p>
+ Add test_indentation target to lib/tools/emacs/Makefile</p>
+ <p>
+ Automatically indent test.erl.orig, save to test.erl, and
+ compare to test.erl.intended. Thanks to Magnus Henoch.</p>
+ <p>
+ Own Id: OTP-10226</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Tools 2.6.7</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Makefiles in erts, hipe and tools have been corrected to
+ enable parallel make, i.e MAKEFLAGS=-jX where X is the
+ parallelity number. As a result of this dependencies were
+ corrected since that is what is needed for parallel make
+ to work.</p>
+ <p>
+ Own Id: OTP-9857 Aux Id: OTP-9451 </p>
+ </item>
+ <item>
+ <p>Minor suppressions and fixes of compilation
+ warnings</p>
+ <p>
+ Own Id: OTP-10016</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Tools 2.6.6.6</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/tools/doc/src/xref_chapter.xml b/lib/tools/doc/src/xref_chapter.xml
index 39c5545af9..566776eab0 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>2009</year>
+ <year>2000</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -301,7 +301,7 @@
and <c>|||</c>) are the only operators that accept both
representations. This means that in order to analyze indirect
calls using restriction, the <c>closure</c> operator (which creates the
- <c>digraph</c> representation of graphs) has to been
+ <c>digraph</c> representation of graphs) has to be
applied explicitly.
</p>
<p>As an example of analyzing indirect calls, the following Erlang
diff --git a/lib/tools/emacs/Makefile b/lib/tools/emacs/Makefile
index 8533488463..69946be24a 100644
--- a/lib/tools/emacs/Makefile
+++ b/lib/tools/emacs/Makefile
@@ -71,9 +71,9 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/emacs
+ $(INSTALL_DIR) "$(RELSYSDIR)/emacs"
$(INSTALL_DATA) $(EL_FILES) $(README_FILES) $(TEST_FILES) \
- $(RELSYSDIR)/emacs
+ "$(RELSYSDIR)/emacs"
ifeq ($(DOCTYPE),pdf)
release_docs_spec:
@@ -82,7 +82,23 @@ ifeq ($(DOCTYPE),ps)
release_docs_spec:
else
release_docs_spec: docs
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN_FILES) $(RELEASE_PATH)/man/man3
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN_FILES) "$(RELEASE_PATH)/man/man3"
endif
endif
+
+EMACS ?= emacs
+
+test_indentation:
+ @rm -f test.erl
+ @rm -f test_indent.el
+ @echo '(load "erlang-start")' >> test_indent.el
+ @echo '(find-file "test.erl.orig")' >> test_indent.el
+ @echo "(require 'cl) ; required with Emacs < 23 for ignore-errors" >> test_indent.el
+ @echo '(erlang-mode)' >> test_indent.el
+ @echo '(toggle-debug-on-error)' >> test_indent.el
+ @echo '(erlang-indent-current-buffer)' >> test_indent.el
+ @echo '(write-file "test.erl")' >> test_indent.el
+ $(EMACS) --batch -Q -L . -l test_indent.el
+ diff -u test.erl.indented test.erl
+ @echo "No differences between expected and actual indentation"
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el
index a1c4931cca..e2bcd37def 100644
--- a/lib/tools/emacs/erlang.el
+++ b/lib/tools/emacs/erlang.el
@@ -7,7 +7,7 @@
;; %CopyrightBegin%
;;
-;; Copyright Ericsson AB 1996-2011. All Rights Reserved.
+;; Copyright Ericsson AB 1996-2012. 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
@@ -486,10 +486,6 @@ function.")
"*Non-nil means TAB in Erlang mode should always re-indent the current line,
regardless of where in the line point is when the TAB command is used.")
-(defvar erlang-error-regexp-alist
- '(("^\\([^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)[:) \t]" . (1 2)))
- "*Patterns for matching Erlang errors.")
-
(defvar erlang-man-inhibit (eq system-type 'windows-nt)
"Inhibit the creation of the Erlang Manual Pages menu.
@@ -1330,7 +1326,6 @@ Other commands:
(erlang-menu-init)
(erlang-mode-variables)
(erlang-check-module-name-init)
- (erlang-add-compilation-alist erlang-error-regexp-alist)
(erlang-man-init)
(erlang-tags-init)
(erlang-font-lock-init)
@@ -1446,31 +1441,6 @@ Other commands:
(set (make-local-variable 'outline-level) (lambda () 1))
(set (make-local-variable 'add-log-current-defun-function)
'erlang-current-defun))
-
-
-;; Compilation.
-;;
-;; The following code is compatible with the standard package `compilation',
-;; making it possible to go to errors using `erlang-next-error' (or just
-;; `next-error' in Emacs 21).
-;;
-;; The normal `compile' command works of course. For best result, please
-;; execute `make' with the `-w' flag.
-;;
-;; Please see the variables named `compiling-..' above.
-
-(defun erlang-add-compilation-alist (alist)
- (require 'compile)
- (cond ((boundp 'compilation-error-regexp-alist) ; Emacs 19
- (while alist
- (or (assoc (car (car alist)) compilation-error-regexp-alist)
- (setq compilation-error-regexp-alist
- (cons (car alist) compilation-error-regexp-alist)))
- (setq alist (cdr alist))))
- ((boundp 'compilation-error-regexp)
- ;; Emacs 18, Only one regexp is allowed.
- (funcall (symbol-function 'set)
- 'compilation-error-regexp (car (car alist))))))
(defun erlang-font-lock-init ()
"Initialize Font Lock for Erlang mode."
@@ -1519,7 +1489,7 @@ Other commands:
;; A dollar sign right before the double quote that ends a
;; string is not a character escape.
;;
- ;; And a "string" has with a double quote not escaped by a
+ ;; And a "string" consists of a double quote not escaped by a
;; dollar sign, any number of non-backslash non-newline
;; characters or escaped backslashes, a dollar sign
;; (otherwise we wouldn't care) and a double quote. This
@@ -1528,6 +1498,8 @@ Other commands:
;; know whether matching started inside a string: limiting
;; search to a single line keeps things sane.
. (("\\(?:^\\|[^$]\\)\"\\(?:[^\"\n]\\|\\\\\"\\)*\\(\\$\\)\"" 1 "w")
+ ;; Likewise for atoms
+ ("\\(?:^\\|[^$]\\)'\\(?:[^'\n]\\|\\\\'\\)*\\(\\$\\)'" 1 "w")
;; And the dollar sign in $\" escapes two characters, not
;; just one.
("\\(\\$\\)\\\\\\\"" 1 "'"))))))
@@ -2989,18 +2961,52 @@ This assumes that the preceding expression is either simple
(forward-sexp (- arg))
(let ((col (current-column)))
(skip-chars-backward " \t")
- ;; Needed to match the colon in "'foo':'bar'".
- (if (not (memq (preceding-char) '(?# ?:)))
- col
- ;; Special hack to handle: (note line break)
- ;; [#myrecord{
- ;; foo = foo}]
- (or
- (ignore-errors
- (backward-char 1)
- (forward-sexp -1)
- (current-column))
- col)))))
+ ;; Special hack to handle: (note line break)
+ ;; [#myrecord{
+ ;; foo = foo}]
+ ;; where the call (forward-sexp -1) will fail when point is at the `#'.
+ (or
+ (ignore-errors
+ ;; Needed to match the colon in "'foo':'bar'".
+ (cond ((eq (preceding-char) ?:)
+ (backward-char 1)
+ (forward-sexp -1)
+ (current-column))
+ ((eq (preceding-char) ?#)
+ ;; We may now be at:
+ ;; - either a construction of a new record
+ ;; - or update of a record, in which case we want
+ ;; the column of the expression to be updated.
+ ;;
+ ;; To see which of the two cases we are at, we first
+ ;; move an expression backwards, check for keywords,
+ ;; then immediately an expression forwards. Moving
+ ;; backwards skips past tokens like `,' or `->', but
+ ;; when moving forwards again, we won't skip past such
+ ;; tokens. We use this: if, after having moved
+ ;; forwards, we're back where we started, then it was
+ ;; a record update.
+ ;; The check for keywords is to detect cases like:
+ ;; case Something of #record_construction{...}
+ (backward-char 1)
+ (let ((record-start (point))
+ (record-start-col (current-column)))
+ (forward-sexp -1)
+ (let ((preceding-expr-col (current-column))
+ ;; white space definition according to erl_scan
+ (white-space "\000-\040\200-\240"))
+ (if (erlang-at-keyword)
+ ;; The (forward-sexp -1) call moved past a keyword
+ (1+ record-start-col)
+ (forward-sexp 1)
+ (skip-chars-forward white-space record-start)
+ ;; Are we back where we started? If so, it was an update.
+ (if (= (point) record-start)
+ preceding-expr-col
+ (goto-char record-start)
+ (1+ (current-column)))))))
+ (t col)))
+ col))))
(defun erlang-indent-parenthesis (stack-position)
(let ((previous (erlang-indent-find-preceding-expr)))
@@ -4863,7 +4869,6 @@ The following special commands are available:
(set (make-local-variable 'compilation-old-error-list) nil))
;; Needed when compiling directly from the Erlang shell.
(setq compilation-last-buffer (current-buffer))
- (erlang-add-compilation-alist erlang-error-regexp-alist)
(setq comint-prompt-regexp "^[^>=]*> *")
(setq comint-eol-on-send t)
(setq comint-input-ignoredups t)
diff --git a/lib/tools/emacs/test.erl.indented b/lib/tools/emacs/test.erl.indented
index 2948ccf1b5..6c9343f6cb 100644
--- a/lib/tools/emacs/test.erl.indented
+++ b/lib/tools/emacs/test.erl.indented
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -215,6 +215,11 @@ highlighting(X) % Function definitions should be highlighted
"char $in string", atom,
+ 'atom$', atom, 'atom$', atom,
+ 'atom\$', atom,
+
+ 'char $in atom', atom,
+
$[, ${, $\\, atom,
?MACRO_1,
?MACRO_2(foo),
@@ -657,3 +662,41 @@ indent_comprehensions() ->
foo() ->
[#foo{
foo = foo}].
+
+%% Record indentation
+some_function_with_a_very_long_name() ->
+ #'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
+ field1=a,
+ field2=b},
+ case dummy_function_with_a_very_very_long_name(x) of
+ #'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
+ field1=a,
+ field2=b} ->
+ ok;
+ Var = #'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
+ field1=a,
+ field2=b} ->
+ Var#'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
+ field1=a,
+ field2=b};
+ #xyz{
+ a=1,
+ b=2} ->
+ ok
+ end.
+
+another_function_with_a_very_very_long_name() ->
+ #rec{
+ field1=1,
+ field2=1}.
+
+some_function_name_xyz(xyzzy, #some_record{
+ field1=Field1,
+ field2=Field2}) ->
+ SomeVariable = f(#'Some-long-record-name'{
+ field_a = 1,
+ 'inter-xyz-parameters' =
+ #'Some-other-very-long-record-name'{
+ field2 = Field1,
+ field2 = Field2}}),
+ {ok, SomeVariable}.
diff --git a/lib/tools/emacs/test.erl.orig b/lib/tools/emacs/test.erl.orig
index 1221c5655e..0f8c4a9175 100644
--- a/lib/tools/emacs/test.erl.orig
+++ b/lib/tools/emacs/test.erl.orig
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -215,6 +215,11 @@ highlighting(X) % Function definitions should be highlighted
"char $in string", atom,
+ 'atom$', atom, 'atom$', atom,
+ 'atom\$', atom,
+
+ 'char $in atom', atom,
+
$[, ${, $\\, atom,
?MACRO_1,
?MACRO_2(foo),
@@ -657,3 +662,41 @@ ok.
foo() ->
[#foo{
foo = foo}].
+
+%% Record indentation
+some_function_with_a_very_long_name() ->
+ #'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
+ field1=a,
+ field2=b},
+ case dummy_function_with_a_very_very_long_name(x) of
+ #'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
+ field1=a,
+ field2=b} ->
+ ok;
+ Var = #'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
+ field1=a,
+ field2=b} ->
+ Var#'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
+ field1=a,
+ field2=b};
+ #xyz{
+ a=1,
+ b=2} ->
+ ok
+ end.
+
+another_function_with_a_very_very_long_name() ->
+ #rec{
+ field1=1,
+ field2=1}.
+
+some_function_name_xyz(xyzzy, #some_record{
+ field1=Field1,
+ field2=Field2}) ->
+ SomeVariable = f(#'Some-long-record-name'{
+ field_a = 1,
+ 'inter-xyz-parameters' =
+ #'Some-other-very-long-record-name'{
+ field2 = Field1,
+ field2 = Field2}}),
+ {ok, SomeVariable}.
diff --git a/lib/tools/examples/Makefile b/lib/tools/examples/Makefile
index 9fb8434633..fc14ee54d6 100644
--- a/lib/tools/examples/Makefile
+++ b/lib/tools/examples/Makefile
@@ -50,7 +50,7 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/examples
- $(INSTALL_DATA) $(EXAMPLE_FILES) $(RELSYSDIR)/examples
+ $(INSTALL_DIR) "$(RELSYSDIR)/examples"
+ $(INSTALL_DATA) $(EXAMPLE_FILES) "$(RELSYSDIR)/examples"
release_docs_spec:
diff --git a/lib/tools/priv/Makefile b/lib/tools/priv/Makefile
index 6fea580c00..b32ba5820d 100644
--- a/lib/tools/priv/Makefile
+++ b/lib/tools/priv/Makefile
@@ -58,9 +58,9 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DATA) $(HTDOCS_FILES) $(RELSYSDIR)/priv
- $(INSTALL_DATA) $(TOOL_FILES) $(RELSYSDIR)/priv
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) $(HTDOCS_FILES) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) $(TOOL_FILES) "$(RELSYSDIR)/priv"
release_docs_spec:
diff --git a/lib/tools/src/Makefile b/lib/tools/src/Makefile
index 360f4f8f29..abe1389771 100644
--- a/lib/tools/src/Makefile
+++ b/lib/tools/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2010. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -105,10 +105,10 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(YRL_FILE) $(HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(YRL_FILE) $(HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) \
- $(RELSYSDIR)/ebin
+ "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/tools/src/fprof.erl b/lib/tools/src/fprof.erl
index 8165a6c13a..4cbb910f11 100644
--- a/lib/tools/src/fprof.erl
+++ b/lib/tools/src/fprof.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -89,9 +89,7 @@ dbg(_, _, _) ->
apply({M, F}, Args)
when is_atom(M), is_atom(F), is_list(Args) ->
- Arity = length(Args),
- Function = fun M:F/Arity,
- apply_1(Function, Args, []);
+ apply_1(M, F, Args, []);
apply(Fun, Args)
when is_function(Fun), is_list(Args) ->
apply_1(Fun, Args, []);
@@ -99,26 +97,25 @@ apply(A, B) ->
erlang:error(badarg, [A, B]).
apply(M, F, Args) when is_atom(M), is_atom(F), is_list(Args) ->
- apply_1({M, F}, Args, []);
+ apply_1(M, F, Args, []);
apply({M, F}, Args, Options)
when is_atom(M), is_atom(F), is_list(Args), is_list(Options) ->
- Arity = length(Args),
- Function = fun M:F/Arity,
- apply_1(Function, Args, Options);
+ apply_1(M, F, Args, Options);
apply(Fun, Args, Options)
when is_function(Fun), is_list(Args), is_list(Options) ->
apply_1(Fun, Args, Options);
apply(A, B, C) ->
erlang:error(badarg, [A, B, C]).
-apply(Module, Function, Args, Options)
- when is_atom(Module), is_atom(Function), is_list(Args), is_list(Options) ->
- Arity = length(Args),
- Fun = fun Module:Function/Arity,
- apply_1(Fun, Args, Options);
+apply(M, F, Args, Options)
+ when is_atom(M), is_atom(F), is_list(Args), is_list(Options) ->
+ apply_1(M, F, Args, Options);
apply(A, B, C, D) ->
erlang:error(badarg, [A, B, C, D]).
+apply_1(M, F, Args, Options) ->
+ Arity = length(Args),
+ apply_1(fun M:F/Arity, Args, Options).
apply_1(Function, Args, Options) ->
{[_, Procs, Continue], Options_1} =
diff --git a/lib/tools/src/tools.app.src b/lib/tools/src/tools.app.src
index cd9b622f15..94998fb763 100644
--- a/lib/tools/src/tools.app.src
+++ b/lib/tools/src/tools.app.src
@@ -24,6 +24,7 @@
eprof,
fprof,
instrument,
+ lcnt,
make,
xref,
xref_base,
diff --git a/lib/tools/src/xref_utils.erl b/lib/tools/src/xref_utils.erl
index 9d4a175d88..680563e9df 100644
--- a/lib/tools/src/xref_utils.erl
+++ b/lib/tools/src/xref_utils.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2012. 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
@@ -141,7 +141,7 @@ is_string([], _) ->
is_string(Term, C) ->
is_string1(Term, C).
-is_string1([H | T], C) when H > C, H < 127 ->
+is_string1([H | T], C) when H > C ->
is_string1(T, C);
is_string1([], _) ->
true;
diff --git a/lib/tools/test/Makefile b/lib/tools/test/Makefile
index 8019b7269f..86c81217b6 100644
--- a/lib/tools/test/Makefile
+++ b/lib/tools/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -84,11 +84,11 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: make_emakefile
- $(INSTALL_DIR) $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
$(INSTALL_DATA) $(SPEC_FILES) $(COVER_FILE) $(EMAKEFILE) \
- $(ERL_FILES) $(RELSYSDIR)
- chmod -R u+w $(RELSYSDIR)
- @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -)
+ $(ERL_FILES) "$(RELSYSDIR)"
+ chmod -R u+w "$(RELSYSDIR)"
+ @tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
release_docs_spec:
diff --git a/lib/tools/test/cover_SUITE.erl b/lib/tools/test/cover_SUITE.erl
index 576d7e261c..c2c708d806 100644
--- a/lib/tools/test/cover_SUITE.erl
+++ b/lib/tools/test/cover_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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
@@ -574,14 +574,7 @@ otp_5418(Config) when is_list(Config) ->
ok.
-otp_6115(suite) -> [];
otp_6115(Config) when is_list(Config) ->
- case erlang:system_info(heap_type) of
- hybrid -> {skip,"Hybrid-heap emulator doesn't keep track of funs"};
- _ -> otp_6115_1(Config)
- end.
-
-otp_6115_1(Config) ->
?line {ok, CWD} = file:get_cwd(),
?line Dir = filename:join(?config(data_dir, Config), otp_6115),
?line ok = file:set_cwd(Dir),
diff --git a/lib/tools/test/fprof_SUITE.erl b/lib/tools/test/fprof_SUITE.erl
index f491c1e227..1bc4c11b5d 100644
--- a/lib/tools/test/fprof_SUITE.erl
+++ b/lib/tools/test/fprof_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2012. 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/lib/tools/test/xref_SUITE.erl b/lib/tools/test/xref_SUITE.erl
index e0876381ca..fd3e111d8d 100644
--- a/lib/tools/test/xref_SUITE.erl
+++ b/lib/tools/test/xref_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2012. 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
@@ -53,7 +53,7 @@
analyze/1, basic/1, md/1, q/1, variables/1, unused_locals/1]).
-export([
- format_error/1, otp_7423/1, otp_7831/1]).
+ 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]).
@@ -86,7 +86,7 @@ groups() ->
fun_mfa_r14, fun_mfa_vars, qlc]},
{analyses, [],
[analyze, basic, md, q, variables, unused_locals]},
- {misc, [], [format_error, otp_7423, otp_7831]}].
+ {misc, [], [format_error, otp_7423, otp_7831, otp_10192]}].
init_per_suite(Config) ->
init(Config).
@@ -2141,17 +2141,17 @@ basic(Conf) when is_list(Conf) ->
?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],[m1,m2,m3]},{[m1,m2,m3],[m17]}], S),
+ [{[m1,m2,m3],[m17]}], S),
?line {ok, _} = eval("condensation closure (Mod) E",
- [{[m1,m2,m3],[m1,m2,m3]},{[m1,m2,m3],[m17]}], S),
+ [{[m1,m2,m3],[m17]}], S),
?line {ok, _} = eval("condensation closure closure closure (Mod) E",
- [{[m1,m2,m3],[m1,m2,m3]},{[m1,m2,m3],[m17]}], S),
+ [{[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",
- [[m1,m2,m3],[m17]], S),
+ [[m17]], S),
?line {ok, _} = eval("domain condensation (Mod) E",
[[m1,m2,m3]], S),
@@ -2515,6 +2515,18 @@ otp_7831(Conf) when is_list(Conf) ->
?line xref:stop(Pid2),
ok.
+otp_10192(suite) -> [];
+otp_10192(doc) ->
+ ["OTP-10192. Allow filenames with character codes greater than 126."];
+otp_10192(Conf) when is_list(Conf) ->
+ PrivDir = ?privdir,
+ {ok, _Pid} = xref:start(s),
+ Dir = filename:join(PrivDir, "�"),
+ ok = file:make_dir(Dir),
+ {ok, []} = xref:add_directory(s, Dir),
+ xref:stop(s),
+ ok.
+
%%%
%%% Utilities
%%%
diff --git a/lib/tools/vsn.mk b/lib/tools/vsn.mk
index 269d3d7773..788ee12900 100644
--- a/lib/tools/vsn.mk
+++ b/lib/tools/vsn.mk
@@ -1 +1 @@
-TOOLS_VSN = 2.6.6.6
+TOOLS_VSN = 2.6.8
diff --git a/lib/tv/doc/src/Makefile b/lib/tv/doc/src/Makefile
index 21478d0931..413eb8f634 100644
--- a/lib/tv/doc/src/Makefile
+++ b/lib/tv/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -125,14 +125,14 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3_FILES) $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3_FILES) "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/tv/doc/src/notes.xml b/lib/tv/doc/src/notes.xml
index 97c99e6202..fa72dd23a9 100644
--- a/lib/tv/doc/src/notes.xml
+++ b/lib/tv/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -30,6 +30,26 @@
</header>
<p>This document describes the changes made to the TV application.</p>
+<section><title>TV 2.1.4.9</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>The GS applications is now deprecated and will be
+ removed in the R16 release. The following GS-based
+ applications have been superseded by the Observer
+ application and will removed in R16: Appmon, Pman,
+ Tv.</p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>
+ Own Id: OTP-9907</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>TV 2.1.4.8</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/tv/doc/src/table_visualizer_chapter.xml b/lib/tv/doc/src/table_visualizer_chapter.xml
index 12efbe643c..8b757f82f3 100644
--- a/lib/tv/doc/src/table_visualizer_chapter.xml
+++ b/lib/tv/doc/src/table_visualizer_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2009</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -31,6 +31,12 @@
<rev>C</rev>
<file>table_visualizer.xml</file>
</header>
+ <warning>
+ <p>
+ The TV application has been superseded by the Observer application.
+ TV will be removed in R16.
+ </p>
+ </warning>
<p>The TV, TV, is a tool that enables the user to examine
ETS and Mnesia tables on any (connected) node in the currently running Erlang
system. Once a certain table has been opened in the tool, the content may be
diff --git a/lib/tv/doc/src/tv.xml b/lib/tv/doc/src/tv.xml
index 84b9f8c33d..05dd60b34a 100644
--- a/lib/tv/doc/src/tv.xml
+++ b/lib/tv/doc/src/tv.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>1997</year>
- <year>2011</year>
+ <year>2012</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -36,6 +36,12 @@
<module>tv</module>
<modulesummary>TV graphically examines ETS and Mnesia tables. </modulesummary>
<description>
+ <warning>
+ <p>
+ The TV application has been superseded by the Observer application.
+ TV will be removed in R16.
+ </p>
+ </warning>
<p>TV enables the user to examine ETS and Mnesia tables. Once
a certain table has been opened in the tool, the content may be viewed at
various levels of detail. The content viewed may also be sorted, using any
diff --git a/lib/tv/priv/Makefile b/lib/tv/priv/Makefile
index 69e3e32c8a..679a76fe88 100644
--- a/lib/tv/priv/Makefile
+++ b/lib/tv/priv/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -64,8 +64,8 @@ clean:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DATA) $(TOOLBAR_FILES) $(RELSYSDIR)/priv
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) $(TOOLBAR_FILES) "$(RELSYSDIR)/priv"
release_docs_spec:
diff --git a/lib/tv/src/Makefile b/lib/tv/src/Makefile
index 457b9d38c4..da1713e156 100644
--- a/lib/tv/src/Makefile
+++ b/lib/tv/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -126,10 +126,10 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/tv/src/tv_db.erl b/lib/tv/src/tv_db.erl
index 201b4c0e6b..75537418b3 100644
--- a/lib/tv/src/tv_db.erl
+++ b/lib/tv/src/tv_db.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -22,6 +22,10 @@
%%%*********************************************************************
-module(tv_db).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
diff --git a/lib/tv/src/tv_db_search.erl b/lib/tv/src/tv_db_search.erl
index 7bf5c4c048..edfa57df04 100644
--- a/lib/tv/src/tv_db_search.erl
+++ b/lib/tv/src/tv_db_search.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -21,6 +21,18 @@
%%%
%%%*********************************************************************
-module(tv_db_search).
+-compile([{nowarn_deprecated_function,{gs,button,3}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,entry,3}},
+ {nowarn_deprecated_function,{gs,frame,2}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,label,3}},
+ {nowarn_deprecated_function,{gs,listbox,3}},
+ {nowarn_deprecated_function,{gs,radiobutton,3}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
diff --git a/lib/tv/src/tv_etsread.erl b/lib/tv/src/tv_etsread.erl
index d3240ef513..32f111c9a1 100644
--- a/lib/tv/src/tv_etsread.erl
+++ b/lib/tv/src/tv_etsread.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -25,6 +25,9 @@
-module(tv_etsread).
+-compile([{nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
diff --git a/lib/tv/src/tv_info.erl b/lib/tv/src/tv_info.erl
index 7bc31e35cd..c744888c38 100644
--- a/lib/tv/src/tv_info.erl
+++ b/lib/tv/src/tv_info.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -16,6 +16,14 @@
%%
%% %CopyrightEnd%
-module(tv_info).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,frame,2}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,listbox,2}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
diff --git a/lib/tv/src/tv_ip.erl b/lib/tv/src/tv_ip.erl
index aeec4e8f6d..9f66917362 100644
--- a/lib/tv/src/tv_ip.erl
+++ b/lib/tv/src/tv_ip.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -16,6 +16,12 @@
%%
%% %CopyrightEnd%
-module(tv_ip).
+-compile([{nowarn_deprecated_function,{gs,canvas,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
diff --git a/lib/tv/src/tv_main.erl b/lib/tv/src/tv_main.erl
index 36cf92bee3..b6ffbd7c49 100644
--- a/lib/tv/src/tv_main.erl
+++ b/lib/tv/src/tv_main.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -16,6 +16,20 @@
%%
%% %CopyrightEnd%
-module(tv_main).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,frame,3}},
+ {nowarn_deprecated_function,{gs,grid,3}},
+ {nowarn_deprecated_function,{gs,gridline,2}},
+ {nowarn_deprecated_function,{gs,label,3}},
+ {nowarn_deprecated_function,{gs,menu,2}},
+ {nowarn_deprecated_function,{gs,menubar,3}},
+ {nowarn_deprecated_function,{gs,menubutton,2}},
+ {nowarn_deprecated_function,{gs,menuitem,2}},
+ {nowarn_deprecated_function,{gs,menuitem,3}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
diff --git a/lib/tv/src/tv_new_table.erl b/lib/tv/src/tv_new_table.erl
index 3d62b0548b..779835d78a 100644
--- a/lib/tv/src/tv_new_table.erl
+++ b/lib/tv/src/tv_new_table.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -16,6 +16,16 @@
%%
%% %CopyrightEnd%k
-module(tv_new_table).
+-compile([{nowarn_deprecated_function,{gs,button,3}},
+ {nowarn_deprecated_function,{gs,checkbutton,3}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,entry,3}},
+ {nowarn_deprecated_function,{gs,frame,3}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,radiobutton,3}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
diff --git a/lib/tv/src/tv_nodewin.erl b/lib/tv/src/tv_nodewin.erl
index 3999d201d8..8376c4a7aa 100644
--- a/lib/tv/src/tv_nodewin.erl
+++ b/lib/tv/src/tv_nodewin.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -16,6 +16,15 @@
%%
%% %CopyrightEnd%
-module(tv_nodewin).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,listbox,3}},
+ {nowarn_deprecated_function,{gs,menu,3}},
+ {nowarn_deprecated_function,{gs,menubar,3}},
+ {nowarn_deprecated_function,{gs,menubutton,3}},
+ {nowarn_deprecated_function,{gs,menuitem,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
diff --git a/lib/tv/src/tv_pb.erl b/lib/tv/src/tv_pb.erl
index 78a27185dc..81e7e7e2d1 100644
--- a/lib/tv/src/tv_pb.erl
+++ b/lib/tv/src/tv_pb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -16,6 +16,9 @@
%%
%% %CopyrightEnd%
-module(tv_pb).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,frame,2}}]).
diff --git a/lib/tv/src/tv_pb_funcs.erl b/lib/tv/src/tv_pb_funcs.erl
index 87a4719bbd..24d1120597 100644
--- a/lib/tv/src/tv_pb_funcs.erl
+++ b/lib/tv/src/tv_pb_funcs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -16,6 +16,12 @@
%%
%% %CopyrightEnd%
-module(tv_pb_funcs).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,canvas,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,read,2}}]).
diff --git a/lib/tv/src/tv_pc.erl b/lib/tv/src/tv_pc.erl
index 50214fe06a..e0612e13eb 100644
--- a/lib/tv/src/tv_pc.erl
+++ b/lib/tv/src/tv_pc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -25,6 +25,7 @@
-module(tv_pc).
+-compile([{nowarn_deprecated_function,{gs,config,2}}]).
diff --git a/lib/tv/src/tv_pc_menu_handling.erl b/lib/tv/src/tv_pc_menu_handling.erl
index 16195bf91f..64a06743b7 100644
--- a/lib/tv/src/tv_pc_menu_handling.erl
+++ b/lib/tv/src/tv_pc_menu_handling.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -25,6 +25,10 @@
-module(tv_pc_menu_handling).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
diff --git a/lib/tv/src/tv_pd.erl b/lib/tv/src/tv_pd.erl
index ea14bf67b1..6c38148fdd 100644
--- a/lib/tv/src/tv_pd.erl
+++ b/lib/tv/src/tv_pd.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -24,6 +24,11 @@
-module(tv_pd).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,destroy,1}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
diff --git a/lib/tv/src/tv_pd_display.erl b/lib/tv/src/tv_pd_display.erl
index f5a30cb640..804180da16 100644
--- a/lib/tv/src/tv_pd_display.erl
+++ b/lib/tv/src/tv_pd_display.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -22,6 +22,13 @@
%%%*********************************************************************
-module(tv_pd_display).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,editor,2}},
+ {nowarn_deprecated_function,{gs,entry,3}},
+ {nowarn_deprecated_function,{gs,frame,2}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,read,2}}]).
diff --git a/lib/tv/src/tv_pd_frames.erl b/lib/tv/src/tv_pd_frames.erl
index 4e091ac9f0..aab40e2bba 100644
--- a/lib/tv/src/tv_pd_frames.erl
+++ b/lib/tv/src/tv_pd_frames.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -16,6 +16,8 @@
%%
%% %CopyrightEnd%
-module(tv_pd_frames).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,frame,2}}]).
diff --git a/lib/tv/src/tv_pd_scale.erl b/lib/tv/src/tv_pd_scale.erl
index c94e57f468..04af2bb981 100644
--- a/lib/tv/src/tv_pd_scale.erl
+++ b/lib/tv/src/tv_pd_scale.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -24,6 +24,8 @@
-module(tv_pd_scale).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,scale,2}}]).
diff --git a/lib/tv/src/tv_pg.erl b/lib/tv/src/tv_pg.erl
index ba8782392b..7194cfb756 100644
--- a/lib/tv/src/tv_pg.erl
+++ b/lib/tv/src/tv_pg.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -16,6 +16,7 @@
%%
%% %CopyrightEnd%
-module(tv_pg).
+-compile([{nowarn_deprecated_function,{gs,config,2}}]).
diff --git a/lib/tv/src/tv_pg_gridfcns.erl b/lib/tv/src/tv_pg_gridfcns.erl
index 3d23c8a69f..d037b42294 100644
--- a/lib/tv/src/tv_pg_gridfcns.erl
+++ b/lib/tv/src/tv_pg_gridfcns.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -16,6 +16,10 @@
%%
%% %CopyrightEnd%
-module(tv_pg_gridfcns).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,frame,2}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,read,2}}]).
diff --git a/lib/tv/src/tv_poll_dialog.erl b/lib/tv/src/tv_poll_dialog.erl
index 8d41251266..e33d398898 100644
--- a/lib/tv/src/tv_poll_dialog.erl
+++ b/lib/tv/src/tv_poll_dialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -22,7 +22,13 @@
%%%*********************************************************************
-module(tv_poll_dialog).
-
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,radiobutton,2}},
+ {nowarn_deprecated_function,{gs,scale,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,2}}]).
-export([start/1, init/2]).
diff --git a/lib/tv/src/tv_pw.erl b/lib/tv/src/tv_pw.erl
index 8b3186e090..5f88c9f1fd 100644
--- a/lib/tv/src/tv_pw.erl
+++ b/lib/tv/src/tv_pw.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -23,6 +23,7 @@
-module(tv_pw).
+-compile([{nowarn_deprecated_function,{gs,config,2}}]).
diff --git a/lib/tv/src/tv_pw_window.erl b/lib/tv/src/tv_pw_window.erl
index 9cb5c879c0..81f29dc41c 100644
--- a/lib/tv/src/tv_pw_window.erl
+++ b/lib/tv/src/tv_pw_window.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2012. 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
@@ -23,6 +23,10 @@
-module(tv_pw_window).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,menuitem,3}},
+ {nowarn_deprecated_function,{gs,start,0}}]).
diff --git a/lib/tv/src/tv_rec_edit.erl b/lib/tv/src/tv_rec_edit.erl
index e8f663073e..3f9ea8b5f5 100644
--- a/lib/tv/src/tv_rec_edit.erl
+++ b/lib/tv/src/tv_rec_edit.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -16,6 +16,16 @@
%%
%% %CopyrightEnd%
-module(tv_rec_edit).
+-compile([{nowarn_deprecated_function,{gs,button,2}},
+ {nowarn_deprecated_function,{gs,button,3}},
+ {nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,entry,3}},
+ {nowarn_deprecated_function,{gs,frame,2}},
+ {nowarn_deprecated_function,{gs,frame,3}},
+ {nowarn_deprecated_function,{gs,label,2}},
+ {nowarn_deprecated_function,{gs,read,2}},
+ {nowarn_deprecated_function,{gs,start,0}},
+ {nowarn_deprecated_function,{gs,window,3}}]).
diff --git a/lib/tv/src/tv_utils.erl b/lib/tv/src/tv_utils.erl
index fd232bde69..799e3994cb 100644
--- a/lib/tv/src/tv_utils.erl
+++ b/lib/tv/src/tv_utils.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2012. 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
@@ -16,6 +16,9 @@
%%
%% %CopyrightEnd%
-module(tv_utils).
+-compile([{nowarn_deprecated_function,{gs,config,2}},
+ {nowarn_deprecated_function,{gs,create,3}},
+ {nowarn_deprecated_function,{gs,destroy,1}}]).
diff --git a/lib/tv/vsn.mk b/lib/tv/vsn.mk
index 756aae2096..1bb8ca30f8 100644
--- a/lib/tv/vsn.mk
+++ b/lib/tv/vsn.mk
@@ -1 +1 @@
-TV_VSN = 2.1.4.8
+TV_VSN = 2.1.4.9
diff --git a/lib/typer/src/Makefile b/lib/typer/src/Makefile
index 620b3ebb69..1f94d8fdc8 100644
--- a/lib/typer/src/Makefile
+++ b/lib/typer/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2006-2011. All Rights Reserved.
+# Copyright Ericsson AB 2006-2012. 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
@@ -101,10 +101,10 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
$(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(YRL_FILES) \
- $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(INSTALL_FILES) $(RELSYSDIR)/ebin
+ "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(INSTALL_FILES) "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/typer/src/typer.erl b/lib/typer/src/typer.erl
index 6392f5765f..0ace1d5fb8 100644
--- a/lib/typer/src/typer.erl
+++ b/lib/typer/src/typer.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -83,6 +83,7 @@ start() ->
{Args, Analysis} = process_cl_args(),
%% io:format("Args: ~p\n", [Args]),
%% io:format("Analysis: ~p\n", [Analysis]),
+ Timer = dialyzer_timing:init(false),
TrustedFiles = filter_fd(Args#args.trusted, [], fun is_erl_file/1),
Analysis2 = extract(Analysis, TrustedFiles),
All_Files = get_all_files(Args),
@@ -91,6 +92,7 @@ start() ->
Analysis4 = collect_info(Analysis3),
%% io:format("Final: ~p\n", [Analysis4#analysis.fms]),
TypeInfo = get_type_info(Analysis4),
+ dialyzer_timing:stop(Timer),
show_or_annotate(TypeInfo),
%% io:format("\nTyper analysis finished\n"),
erlang:halt(0).
@@ -181,7 +183,6 @@ get_type_info(#analysis{callgraph = CallGraph,
remove_external(CallGraph, PLT) ->
{StrippedCG0, Ext} = dialyzer_callgraph:remove_external(CallGraph),
- StrippedCG = dialyzer_callgraph:finalize(StrippedCG0),
case get_external(Ext, PLT) of
[] -> ok;
Externals ->
@@ -192,7 +193,7 @@ remove_external(CallGraph, PLT) ->
_ -> msg(io_lib:format(" Unknown types: ~p\n", [ExtTypes]))
end
end,
- StrippedCG.
+ StrippedCG0.
-spec get_external([{mfa(), mfa()}], plt()) -> [mfa()].
@@ -901,8 +902,9 @@ analyze_core_tree(Core, Records, SpecInfo, CbInfo, ExpTypes, Analysis, File) ->
MergedExpTypes = sets:union(ExpTypes, OldExpTypes),
CS6 = dialyzer_codeserver:insert_temp_exported_types(MergedExpTypes, CS5),
Ex_Funcs = [{0,F,A} || {_,_,{F,A}} <- cerl:module_exports(Tree)],
- TmpCG = Analysis#analysis.callgraph,
- CG = dialyzer_callgraph:scan_core_tree(Tree, TmpCG),
+ CG = Analysis#analysis.callgraph,
+ {V, E} = dialyzer_callgraph:scan_core_tree(Tree, CG),
+ dialyzer_callgraph:add_edges(E, V, CG),
Fun = fun analyze_one_function/2,
All_Defs = cerl:module_defs(Tree),
Acc = lists:foldl(Fun, #tmpAcc{file = File, module = Module}, All_Defs),
@@ -1005,7 +1007,7 @@ msg(Msg) ->
port_command(P, Msg),
true = port_close(P),
ok;
- _ -> % win32, vxworks
+ _ -> % win32
io:format("~s", [Msg])
end.
diff --git a/lib/typer/vsn.mk b/lib/typer/vsn.mk
index 85a7c01424..18e328afc1 100644
--- a/lib/typer/vsn.mk
+++ b/lib/typer/vsn.mk
@@ -1 +1 @@
-TYPER_VSN = 0.9.3
+TYPER_VSN = 0.9.4
diff --git a/lib/webtool/doc/src/Makefile b/lib/webtool/doc/src/Makefile
index 7b86752738..32269e9424 100644
--- a/lib/webtool/doc/src/Makefile
+++ b/lib/webtool/doc/src/Makefile
@@ -112,16 +112,16 @@ debug opt:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man1
- $(INSTALL_DATA) $(MAN1_FILES) $(RELEASE_PATH)/man/man1
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3_FILES) $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man1"
+ $(INSTALL_DATA) $(MAN1_FILES) "$(RELEASE_PATH)/man/man1"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3_FILES) "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/webtool/priv/Makefile b/lib/webtool/priv/Makefile
index 6e1c6606fe..6af997c2bb 100644
--- a/lib/webtool/priv/Makefile
+++ b/lib/webtool/priv/Makefile
@@ -67,14 +67,14 @@ docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DIR) $(RELSYSDIR)/priv/root
- $(INSTALL_DIR) $(RELSYSDIR)/priv/root/conf
- $(INSTALL_DIR) $(RELSYSDIR)/priv/root/doc
- $(INSTALL_DATA) $(HTDOCS_FILES) $(RELSYSDIR)/priv/root/doc
- $(INSTALL_DATA) $(WEBSERVER_CONFIG_FILES) $(RELSYSDIR)/priv/root/conf
- $(INSTALL_DIR) $(RELSYSDIR)/priv/bin
- $(INSTALL_SCRIPT) $(SCRIPTS) $(RELSYSDIR)/priv/bin
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/root"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/root/conf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/root/doc"
+ $(INSTALL_DATA) $(HTDOCS_FILES) "$(RELSYSDIR)/priv/root/doc"
+ $(INSTALL_DATA) $(WEBSERVER_CONFIG_FILES) "$(RELSYSDIR)/priv/root/conf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv/bin"
+ $(INSTALL_SCRIPT) $(SCRIPTS) "$(RELSYSDIR)/priv/bin"
release_docs_spec:
diff --git a/lib/webtool/src/Makefile b/lib/webtool/src/Makefile
index 62845cd370..783ffad79a 100644
--- a/lib/webtool/src/Makefile
+++ b/lib/webtool/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2009. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -87,11 +87,11 @@ $(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
$(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(APPUP_TARGET) \
- $(RELSYSDIR)/ebin
+ "$(RELSYSDIR)/ebin"
release_docs_spec:
diff --git a/lib/wx/.gitignore b/lib/wx/.gitignore
index fd76f078d7..0fa427bfe5 100644
--- a/lib/wx/.gitignore
+++ b/lib/wx/.gitignore
@@ -1,2 +1,4 @@
test_log_*
wx_test_case_info
+api_gen/gl_man?
+doc/html/* \ No newline at end of file
diff --git a/lib/wx/Makefile b/lib/wx/Makefile
index 9a75b2e36e..1ec225930e 100644
--- a/lib/wx/Makefile
+++ b/lib/wx/Makefile
@@ -1,19 +1,19 @@
#
# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2008-2011. All Rights Reserved.
-#
+#
+# Copyright Ericsson AB 2008-2012. All Rights Reserved.
+#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
-#
+#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
-#
+#
# %CopyrightEnd%
#
@@ -33,53 +33,9 @@ endif #TERTIARY_BOOTSTRAP
CLEANDIRS = $(SUBDIRS) api_gen
-ifeq ($(INSIDE_ERLSRC),true)
-# we are inside erl src
# ----------------------------------------------------
# Default Subdir Targets
# ----------------------------------------------------
SUB_DIRECTORIES=$(SUBDIRS)
include $(ERL_TOP)/make/otp_subdir.mk
-else
-# we are building standalone wxErlang
-all: opt
-
-opt:
- @mkdir -p ebin
- @mkdir -p priv
- @mkdir -p c_src/$(SYS_TYPE)
- @for d in $(SUBDIRS); do \
- if test ! -d $$d ; then \
- echo "=== Skipping subdir $$d" ; \
- else \
- (cd $$d && $(MAKE) $@) ; \
- fi ; \
- done
-
-# clean, removes beam, object and target files
-
-clean:
- rm -f *~
- @for d in $(CLEANDIRS); do \
- if test ! -d $$d ; then \
- echo "=== Skipping subdir $$d" ; \
- else \
- (cd $$d && $(MAKE) $@) ; \
- fi ; \
- done
-
-docs:
- (cd doc/src/ && $(MAKE) $@)
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-
-install:
- escript ./install.es $(INSTALLDIR)
-
-release:
- escript ./install.es --create_release
-
-endif
diff --git a/lib/wx/Notes b/lib/wx/Notes
deleted file mode 100644
index 3f48a3d4fb..0000000000
--- a/lib/wx/Notes
+++ /dev/null
@@ -1,60 +0,0 @@
-- [Dgud] Added wx_object implementation so user can create callback api
- as gen_server like process/objects which gets destroyed
- when the real objects are destroyed.
-- [Dgud] Added clienData to controlWithItems functions
-- [Dgud] Improved error handling, i.e. if 'This' is NULL gives a badarg
- and connect to non existing event type gives badarg.
-- [Dgud] Added wxCalendarEvent, wx*PickerEvents, wxTreeEvent wxNotebookEvent
-- [Dgud] Added wxStaticLine wxArtProvider wxClipboard
-- [Dgud] Reworked test directory
-- [RichardC] Fixed documentation Makefile
-- [Dgud] Fixed dialyzer warnings (Thanks Kostis)
- Fixed Bugs in wxBitmap and wxCursor
-- [RichardC] Fixed a lot of warnings in the demos and examples.
-- [Dgud] Fixed the internal event handling so that callbacks,
- and batch functions can not deadlock by using wxwidgets.
-- [Dgud] **Changed** backwards incompatible:
- Changed code generator so that enum and defines will be more
- stable in the future. This requires that your code will have
- to be recompiled.
-- [HarryH] wxMenuItem:GetBitmap/SetBitmap.
-- [HarryH] Started with the samples, menu.erl
-
-Old: 2008-05-26
-- [Dgud] **Changed** backwards incompatible:
- wxListBox, wxComboBox wxChoice wxCheckListBox
- function 'new': to use more optional values.
-- [Dgud] Added Notebook class
-- [Dgud] Added missing append/insert to ctrlWithItems
-- [Dgud] Added CalenderCtrl class
-- [Dgud] Added SizerItem functions
-- [Dgud] Add wxMDI* classes and wxLayoutAlgorithm
-- [Dgud] Added wxWindow:getHandle() -> integer() to be able to
- use platform dependent 3party libs
-- [Dgud] **Changed** backwards incompatible:
- #wx.user_data to #wx.userData to conform with wx api.
-- [Dgud] Fixed array of string bugs (in several functions).
-- [Dgud] Added data to command events
-- [Dgud] Added wxList(Ctrl) events
-
-- [Dgud] Fixed installer
-- [Dgud] **Changed** the wxEvtHandler:connect api
-- [Dgud] Fixed an event callback glitch.
-- [Dgud] Removed a memory leak, and optimized the object pointers.
-- [Dgud] Added wxMiniFrame and wxSash classes
-- [Dgud] Added wxStyledTextControl, requires larger binary but is nice
- for code viewing and editors.
-
-- [Dgud] Printing functionality, test implementation see sudoku demo
-- [Dgud] Added wxHtmlEasyPrinting, and classless functions to module wx_misc
-- [Dgud] Fixed Colors to actually work
-- [Dgud] Fixed enum guard tests
-
-
-- [Dgud] Fixed defines and added some global vars, incompatible
-- [Dgud] Fixed Colors to be {R,G,B,A} everywhere (optional in args)
-- [Dgud] Fixed memory cleaning and xrc (external dialog editor) support
-- [Dgud] Reworked event handling
-- [Dgud] Added GLU module and some functions
-- [Dgud] Fixed statusbar functions.
-- [Dgud] Prefix all records in wx.hrl with wx. \ No newline at end of file
diff --git a/lib/wx/README b/lib/wx/README
index e81f16681a..77cf6c6bda 100644
--- a/lib/wx/README
+++ b/lib/wx/README
@@ -1,4 +1,3 @@
-
REQUIREMENTS:
At least Erlang-R13B with smp enabled. It Requires unicode support.
@@ -10,17 +9,11 @@ REQUIREMENTS:
And I have given up on Solaris-8|9, wxWidgets on my old gtk version
doesn't run well, 7 of 10 wxWidgets examples seg fault.
Some early tests show that Solaris 10 works, though.
-
-INSTALLING:
- The prebuilt (windows and mac) version can be installed by invoking:
- install.es
- or
- /PATH/TO/ERL/bin/escript install.es
BUILDING:
You will need wxWidgets-2.8.*
- On mac I built wxwidgets with:
+ On mac (snow leopard) I built wxwidgets with:
mkdir MYBUILD; cd MYBUILD
../configure --with-opengl --enable-unicode --enable-graphics_ctx \
@@ -30,6 +23,8 @@ BUILDING:
cd contrib/src/stc/
make && make install
+ Or grab them prebuilt from macports.
+
On linux I have used the wxwidgets-libraries that came with
the distribution. It requires wxStyledTextControl which was
prebuilt on my linux, otherwise you have to build wxWidgets
@@ -48,30 +43,6 @@ BUILDING:
I havn't tested on cygwin at all.
You need to use werl on windows, erl (non-gui) hangs wxwidgets startup.
- make
- should work if erl, gcc and g++ and wx-config is found in path.
-
-
-HELPING:
- See TODO list.
- Use it, i.e. write code which tests the library, submit tests.
- See api_gen/Readme for improving the code generation.
- My C++ knowledge isn't the best, send patches and explain why
- so I can learn something.
-
-STATUS:
- Testing I havn't done more testing than the code in test directory.
- So please help by testing and writing test suites.
- Most classes needs some argument tweaking (in wxapi.conf) to
- work as expected, but I havn't read all the documentation and
- gone through every argument on every function.
-
- See (and run) the demo in the examples directory.
-
- This library is (currently) a driver, so if the you (or I) make errors,
- such as accessing deleted objects or other things wxWidgets didn't
- expect you to do, erlang will crash hard.
-
Cheers
Dan Gudmundsson
diff --git a/lib/wx/TODO b/lib/wx/TODO
deleted file mode 100644
index bf5553b9be..0000000000
--- a/lib/wx/TODO
+++ /dev/null
@@ -1,30 +0,0 @@
-
-Improve documentation.
-
-Fix all fixme's :-)
-
-Makefiles and configure tests
- Can always be improved, especially mine.
-
-Port programs instead of drivers.
- Another backend which doesn't crash the emulator during
- developing/testing or at customer site,
- Option to wx:new().
-
-Cleanup the code!!!!
-
-Platform specific classes/functions
- wxPrinterDC for example is mac and windows only.
-
-Add user_data now that erl_driver can unpack term_binaries.
-
-Add missing clases, especially the ones used in the api:
- wxDropTarget wxXmlResourceHandler wxGLContext
-
-Testing and debugging.
-
-API stuff: (Stuff I've or others have seen that I don't have time to fix right now)
-
-================
-
-Patch wxMac with CGwarpMouseCursorPosition \ No newline at end of file
diff --git a/lib/wx/aclocal.m4 b/lib/wx/aclocal.m4
index 339a15a2bb..b1cf1fe404 100644
--- a/lib/wx/aclocal.m4
+++ b/lib/wx/aclocal.m4
@@ -1,7 +1,7 @@
dnl
dnl %CopyrightBegin%
dnl
-dnl Copyright Ericsson AB 1998-2011. All Rights Reserved.
+dnl Copyright Ericsson AB 1998-2012. All Rights Reserved.
dnl
dnl The contents of this file are subject to the Erlang Public License,
dnl Version 1.1, (the "License"); you may not use this file except in
@@ -59,6 +59,7 @@ AC_ARG_VAR(erl_xcomp_isysroot, [Absolute cross system root include path (only us
dnl Cross compilation variables
AC_ARG_VAR(erl_xcomp_bigendian, [big endian system: yes|no (only used when cross compiling)])
+AC_ARG_VAR(erl_xcomp_double_middle_endian, [double-middle-endian system: yes|no (only used when cross compiling)])
AC_ARG_VAR(erl_xcomp_linux_clock_gettime_correction, [clock_gettime() can be used for time correction: yes|no (only used when cross compiling)])
AC_ARG_VAR(erl_xcomp_linux_nptl, [have Native POSIX Thread Library: yes|no (only used when cross compiling)])
AC_ARG_VAR(erl_xcomp_linux_usable_sigusrx, [SIGUSR1 and SIGUSR2 can be used: yes|no (only used when cross compiling)])
@@ -606,6 +607,103 @@ ifelse([$5], , , [$5
fi
])
+dnl ----------------------------------------------------------------------
+dnl
+dnl AC_DOUBLE_MIDDLE_ENDIAN
+dnl
+dnl Checks whether doubles are represented in "middle-endian" format.
+dnl Sets ac_cv_double_middle_endian={no,yes,unknown} accordingly,
+dnl as well as DOUBLE_MIDDLE_ENDIAN.
+dnl
+dnl
+
+AC_DEFUN([AC_C_DOUBLE_MIDDLE_ENDIAN],
+[AC_CACHE_CHECK(whether double word ordering is middle-endian, ac_cv_c_double_middle_endian,
+[# It does not; compile a test program.
+AC_RUN_IFELSE(
+[AC_LANG_SOURCE([[#include <stdlib.h>
+
+int
+main(void)
+{
+ int i = 0;
+ int zero = 0;
+ int bigendian;
+ int zero_index = 0;
+
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+
+ /* we'll use the one with 32-bit words */
+ union
+ {
+ double d;
+ unsigned int c[2];
+ } vint;
+
+ union
+ {
+ double d;
+ unsigned long c[2];
+ } vlong;
+
+ union
+ {
+ double d;
+ unsigned short c[2];
+ } vshort;
+
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ u.l = 1;
+ bigendian = (u.c[sizeof (long int) - 1] == 1);
+
+ zero_index = bigendian ? 1 : 0;
+
+ vint.d = 1.0;
+ vlong.d = 1.0;
+ vshort.d = 1.0;
+
+ if (sizeof(unsigned int) == 4)
+ {
+ if (vint.c[zero_index] != 0)
+ zero = 1;
+ }
+ else if (sizeof(unsigned long) == 4)
+ {
+ if (vlong.c[zero_index] != 0)
+ zero = 1;
+ }
+ else if (sizeof(unsigned short) == 4)
+ {
+ if (vshort.c[zero_index] != 0)
+ zero = 1;
+ }
+
+ exit (zero);
+}
+]])],
+ [ac_cv_c_double_middle_endian=no],
+ [ac_cv_c_double_middle_endian=yes],
+ [ac_cv_c_double_middle=unknown])])
+case $ac_cv_c_double_middle_endian in
+ yes)
+ m4_default([$1],
+ [AC_DEFINE([DOUBLE_MIDDLE_ENDIAN], 1,
+ [Define to 1 if your processor stores the words in a double in
+ middle-endian format (like some ARMs).])]) ;;
+ no)
+ $2 ;;
+ *)
+ m4_default([$3],
+ [AC_MSG_WARN([unknown double endianness
+presetting ac_cv_c_double_middle_endian=no (or yes) will help])]) ;;
+esac
+])# AC_C_DOUBLE_MIDDLE_ENDIAN
+
dnl ----------------------------------------------------------------------
dnl
@@ -1337,6 +1435,14 @@ if test "$ac_cv_c_bigendian" = "yes"; then
AC_DEFINE(ETHR_BIGENDIAN, 1, [Define if bigendian])
fi
+case X$erl_xcomp_double_middle_endian in
+ X) ;;
+ Xyes|Xno|Xunknown) ac_cv_c_double_middle_endian=$erl_xcomp_double_middle_endian;;
+ *) AC_MSG_ERROR([Bad erl_xcomp_double_middle_endian value: $erl_xcomp_double_middle_endian]);;
+esac
+
+AC_C_DOUBLE_MIDDLE_ENDIAN
+
AC_ARG_ENABLE(native-ethr-impls,
AS_HELP_STRING([--disable-native-ethr-impls],
[disable native ethread implementations]),
diff --git a/lib/wx/api_gen/Makefile b/lib/wx/api_gen/Makefile
index 756ec598ce..8adb485ba9 100644
--- a/lib/wx/api_gen/Makefile
+++ b/lib/wx/api_gen/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2010. All Rights Reserved.
+# Copyright Ericsson AB 2008-2012. 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
@@ -30,7 +30,7 @@ ERL_COMPILE_FLAGS=+debug_info +warn_unused_vars
COMPILER = gen_util wx_gen wx_gen_erl wx_gen_cpp
COMPILER_T = $(COMPILER:%=$(EBIN)/%.beam)
-GL_COMP = gl_gen gl_gen_erl gl_gen_c
+GL_COMP = gl_gen gl_gen_erl gl_gen_c gl_scan_doc
GL_COMP_T = $(GL_COMP:%=$(EBIN)/%.beam)
TARGET_EDIR = ../src/gen
diff --git a/lib/wx/api_gen/README b/lib/wx/api_gen/README
index 10b5209789..dd0c49d227 100644
--- a/lib/wx/api_gen/README
+++ b/lib/wx/api_gen/README
@@ -1,6 +1,6 @@
API GENERATION:
- Most of the code in wx is generated.
- Users of wxErlang should not normally need to regenerate the generated code,
+ Most of the code in wx is generated.
+ Users of wxErlang should not normally need to regenerate the generated code,
as it is checked in by wxErlang developers, when changes are made.
Code checked in is currently generated from wxwidgets 2.8.10.
@@ -10,6 +10,8 @@ REQUIREMENTS:
used to parse wxWidgets c++ headers and generate xml files (in
wx_xml/).
+ 2012-02-09 doxygen 1.7.4 is working fine
+
2008-09-29 doxygen 1.4.6 is required.
Later versions of Doxygen - up to 1.5.6 at least - have a bug in the xml generation
which causes us problems. This has been logged and we are waiting for a fix.
@@ -32,5 +34,12 @@ RUNNING:
I keep the opengl headers separate so I don't go backwards in version when generating the code
from another machine.
+ Also gl.h from different vendors differ so keep it consistent,
+ I have used mesa's gl.h and the glext.h from opengl.org
+ (version see GL_GLEXT_VERSION in gl.hrl)
+
+ I also get the xml documentation from opengl.org (subversion) and place it in
+ api_gen/gl_man2 (all old functions) and api_gen/gl_man4 (all the new functions).
+
CONTRIBUTION:
- Send me patches or update the svn version.
+ Send me patches
diff --git a/lib/wx/api_gen/gen_util.erl b/lib/wx/api_gen/gen_util.erl
index df5b4c3405..4638d4c7ea 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -96,8 +96,8 @@ check_diff(Diff) ->
[<<>>] -> ok;
_ -> throw(diff)
end,
- <<_, _, "%% Copyright", _/binary>> = D1,
- <<_, _, "%% Copyright", _/binary>> = D2,
+ copyright(D1),
+ copyright(D2),
copyright
catch
throw:_ -> diff;
@@ -108,6 +108,10 @@ check_diff(Diff) ->
diff
end.
+copyright(<<_, _, "%% Copyright", _/binary>>) -> ok;
+copyright(<<_, _, " * Copyright", _/binary>>) -> ok;
+copyright(_) -> throw(diff).
+
w(Str) ->
w(Str, []).
w(Str,Args) ->
@@ -217,7 +221,7 @@ erl_copyright() ->
w("%%~n",[]),
w("%% %CopyrightBegin%~n",[]),
w("%%~n",[]),
- w("%% Copyright Ericsson AB ~p-2011. All Rights Reserved.~n",
+ w("%% Copyright Ericsson AB ~p-2012. All Rights Reserved.~n",
[StartYear]),
w("%%~n",[]),
w("%% The contents of this file are subject to the Erlang Public License,~n",[]),
@@ -237,7 +241,7 @@ c_copyright() ->
w("/*~n",[]),
w(" * %CopyrightBegin%~n",[]),
w(" *~n",[]),
- w(" * Copyright Ericsson AB 2008-2011. All Rights Reserved.~n",[]),
+ w(" * Copyright Ericsson AB 2008-2012. All Rights Reserved.~n",[]),
w(" *~n",[]),
w(" * The contents of this file are subject to the Erlang Public License,~n",[]),
w(" * Version 1.1, (the \"License\"); you may not use this file except in~n",[]),
diff --git a/lib/wx/api_gen/gl_gen.erl b/lib/wx/api_gen/gl_gen.erl
index 8998d341e7..331ba32ba4 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -62,11 +62,11 @@ gen_code() ->
GLDefs = parse_gl_defs(Opts),
{GLUDefines,GLUFuncs} = setup(GLUDefs, Opts),
{GLDefines,GLFuncs} = setup(GLDefs, Opts),
+ gl_gen_erl:gl_defines(GLDefines),
+ gl_gen_erl:gl_api(GLFuncs),
gl_gen_erl:glu_defines(GLUDefines),
gl_gen_erl:glu_api(GLUFuncs),
- gl_gen_erl:gl_defines(GLDefines),
- gl_gen_erl:gl_api(GLFuncs),
%%gl_gen_erl:gen_debug(GLFuncs,GLUFuncs),
gl_gen_c:gen(GLFuncs,GLUFuncs),
ok.
@@ -190,14 +190,17 @@ parse_define([#xmlElement{name=initializer,content=[#xmlText{value=V}]}|_],Def,_
try
case Val0 of
"0x" ++ Val1 ->
- Val = http_util:hexlist_to_integer(Val1),
- Def#def{val=Val, type=hex};
+ _ = http_util:hexlist_to_integer(Val1),
+ Def#def{val=Val1, type=hex};
_ ->
Val = list_to_integer(Val0),
Def#def{val=Val, type=int}
end
- catch _:_ ->
- Def#def{val=Val0, type=string}
+ catch _:_ ->
+ case catch list_to_float(Val0) of
+ {'EXIT', _} -> Def#def{val=Val0, type=string};
+ _ -> Def#def{val=Val0, type=float_str}
+ end
end;
parse_define([_|R], D, Opts) ->
parse_define(R, D, Opts);
@@ -360,7 +363,9 @@ extract_type_info2("**", Acc) -> [{by_ref,{pointer,2}}|Acc];
extract_type_info2(Type, Acc) -> [Type|Acc].
parse_type2(["void"], _T, _Opts) -> void;
-parse_type2([N="void"|R], T, Opts) ->
+parse_type2([N="void", const|R], T, Opts) ->
+ parse_type2([const|R],T#type{name=N, base=idx_binary},Opts);
+parse_type2([N="void"|R], T, Opts) ->
parse_type2(R,T#type{name=N},Opts);
parse_type2([const|R],T=#type{mod=Mod},Opts) ->
parse_type2(R,T#type{mod=[const|Mod]},Opts);
@@ -676,6 +681,7 @@ get_extension(ExtName,_Opts) ->
"IGP" ++ Name -> {reverse(Name),"PGI"};
"PH" ++ Name -> {reverse(Name),"HP"};
"YDEMERG" ++ Name -> {reverse(Name),"GREMEDY"};
+ "SEO" ++ Name -> {reverse(Name),"OES"};
%%["" ++ Name] -> {Name; %%
_ -> {ExtName, ""}
end.
diff --git a/lib/wx/api_gen/gl_gen_erl.erl b/lib/wx/api_gen/gl_gen_erl.erl
index f292c8723e..25f89e4ad4 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-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -19,7 +19,7 @@
%%%-------------------------------------------------------------------
%%% File : gl_gen_erl.erl
%%% Author : Dan Gudmundsson <[email protected]>
-%%% Description :
+%%% Description :
%%%
%%% Created : 18 Apr 2007 by Dan Gudmundsson <[email protected]>
%%%-------------------------------------------------------------------
@@ -31,7 +31,7 @@
-import(lists, [foldl/3,foldr/3,reverse/1, keysearch/3, map/2, filter/2, max/1]).
-import(gen_util, [lowercase/1, lowercase_all/1, uppercase/1, uppercase_all/1,
- open_write/1, close/0, erl_copyright/0, w/2,
+ open_write/1, close/0, erl_copyright/0, w/2,
args/3, args/4, strip_name/2]).
gl_defines(Defs) ->
@@ -40,7 +40,7 @@ gl_defines(Defs) ->
w("~n%% OPENGL DEFINITIONS~n~n", []),
w("%% This file is generated DO NOT EDIT~n~n", []),
[gen_define(Def) || Def=#def{} <- Defs],
- close(),
+ close(),
ok.
glu_defines(Defs) ->
@@ -50,36 +50,40 @@ glu_defines(Defs) ->
w("%% This file is generated DO NOT EDIT~n~n", []),
[gen_define(Def) || Def=#def{} <- Defs],
close(),
- ok.
+ ok.
gen_define(#def{name=N, val=Val, type=int}) ->
w("-define(~s, ~p).~n", [N,Val]);
+gen_define(#def{name=N, val=Val, type=float_str}) ->
+ w("-define(~s, ~s).~n", [N,Val]);
gen_define(#def{name=N, val=Val, type=hex}) ->
- w("-define(~s, ~.16#).~n", [N,Val]);
+ w("-define(~s, 16#~s).~n", [N,Val]);
gen_define(#def{name=N, val=Val, type=string}) ->
- w("-define(~s, ?~s).~n", [N,Val]).
+ w("-define(~s, ?~s).~n", [N,Val]);
+gen_define(#def{name="GLEXT_64_TYPES"++_, val=undefined, type=undefined}) ->
+ ok.
types() ->
[{"GLenum", "32/native-unsigned"},
{"GLboolean", "8/native-unsigned"},
{"GLbitfield","32/native-unsigned"}, %
%%{"GLvoid",":void "},%
- {"GLbyte", "8/native-signed"}, % 1-byte signed
- {"GLshort", "16/native-signed"}, % 2-byte signed
- {"GLint", "32/native-signed"}, % 4-byte signed
- {"GLubyte", "8/native-unsigned"}, % 1-byte unsigned
- {"GLushort", "16/native-unsigned"}, % 2-byte unsigned
- {"GLuint", "32/native-unsigned"}, % 4-byte unsigned
- {"GLsizei", "32/native-signed"}, % 4-byte signed
- {"GLfloat", "32/native-float"}, % single precision float
- {"GLclampf", "32/native-float"}, % single precision float in [0,1]
- {"GLdouble", "64/native-float"}, % double precision float
- {"GLclampd", "64/native-float"}, % double precision float in [0,1]
+ {"GLbyte", "8/native-signed"}, % 1-byte signed
+ {"GLshort", "16/native-signed"}, % 2-byte signed
+ {"GLint", "32/native-signed"}, % 4-byte signed
+ {"GLubyte", "8/native-unsigned"}, % 1-byte unsigned
+ {"GLushort", "16/native-unsigned"}, % 2-byte unsigned
+ {"GLuint", "32/native-unsigned"}, % 4-byte unsigned
+ {"GLsizei", "32/native-signed"}, % 4-byte signed
+ {"GLfloat", "32/native-float"}, % single precision float
+ {"GLclampf", "32/native-float"}, % single precision float in [0,1]
+ {"GLdouble", "64/native-float"}, % double precision float
+ {"GLclampd", "64/native-float"}, % double precision float in [0,1]
{"GLsizeiptr","64/native-unsigned"}, % 64 bits int, convert on c-side
{"GLintptr", "64/native-unsigned"}, % 64 bits int, convert on c-sidew
{"GLUquadric", "64/native-unsigned"},% Handle 32bits aargh 64bits on mac64
{"GLhandleARB","64/native-unsigned"},% Handle 32bits aargh 64bits on mac64
-
+
{"GLsync", "64/native-unsigned"}, % Pointer to record
{"GLuint64", "64/native-unsigned"},
{"GLint64", "64/native-signed"}
@@ -94,20 +98,17 @@ gl_api(Fs) ->
w("%% See <a href=\"http://www.opengl.org/sdk/docs/man/\">www.opengl.org</a>~n",[]),
w("%%~n", []),
w("%% Booleans are represented by integers 0 and 1.~n~n", []),
- w("%% @type mem(). memory block~n", []),
- w("%% @type enum(). An integer defined in gl.hrl~n", []),
- w("%% @type offset(). An integer which is an offset in an array~n", []),
- w("%% @type clamp(). A float clamped between 0.0 - 1.0~n", []),
-
- w("-module(gl).~n~n",[]),
+
+ w("-module(gl).~n~n",[]),
w("-compile(inline).~n", []),
%% w("-include(\"wxe.hrl\").~n", []),
[w("-define(~s,~s).~n", [GL,Erl]) || {GL,Erl} <- types()],
gen_types(gl),
-
+
Exp = fun(F) -> gen_export(F) end,
ExportList = lists:map(Exp,Fs),
+
w("~n-export([~s]).~n~n", [args(fun(EF) -> EF end, ",", ExportList, 60)]),
w("-export([call/2, cast/2, send_bin/1]).~n",[]),
w("%% @hidden~n", []),
@@ -140,10 +141,10 @@ gl_api(Fs) ->
w(" erlang:port_command(Port,Bin)~n", []),
w(" end.~n", []),
w("~n", []),
-
+
w("~n%% API~n~n", []),
[gen_funcs(F) || F <- Fs],
- close(),
+ close(),
ok.
glu_api(Fs) ->
@@ -155,28 +156,24 @@ glu_api(Fs) ->
w("%% See <a href=\"http://www.opengl.org/sdk/docs/man/\">www.opengl.org</a>~n",[]),
w("%%~n", []),
w("%% Booleans are represented by integers 0 and 1.~n~n", []),
- w("%% @type mem(). memory block~n", []),
- w("%% @type enum(). An integer defined in gl.hrl~n", []),
- w("%% @type offset(). An integer which is an offset in an array~n", []),
- w("%% @type clamp(). A float clamped between 0.0 - 1.0~n~n", []),
- w("-module(glu).~n",[]),
+ w("-module(glu).~n",[]),
w("-compile(inline).~n", []),
%%w("-include(\"wxe.hrl\").~n", []),
[w("-define(~s,~s).~n", [GL,Erl]) || {GL,Erl} <- types()],
gen_types(glu),
-
+
Exp = fun(F) -> gen_export(F) end,
ExportList = ["tesselate/2" | lists:map(Exp,Fs)],
w("~n-export([~s]).~n~n", [args(fun(EF) -> EF end, ",", ExportList, 60)]),
w("-import(gl, [call/2,cast/2,send_bin/1]).", []),
w("~n%% API~n~n", []),
- w("%% @spec (Vec3, [Vec3]) -> {Triangles, VertexPos}~n",[]),
- w("%% Vec3 = {float(),float(),float()}~n",[]),
- w("%% Triangles = [VertexIndex::integer()]~n",[]),
- w("%% VertexPos = binary()~n",[]),
+ %% w("%% @spec (Vec3, [Vec3]) -> {Triangles, VertexPos}~n",[]),
+ %% w("%% Vec3 = {float(),float(),float()}~n",[]),
+ %% w("%% Triangles = [VertexIndex::integer()]~n",[]),
+ %% w("%% VertexPos = binary()~n",[]),
w("%% @doc General purpose polygon triangulation.~n",[]),
w("%% The first argument is the normal and the second a list of~n"
"%% vertex positions. Returned is a list of indecies of the vertices~n"
@@ -184,6 +181,9 @@ glu_api(Fs) ->
"%% vertex positions, it starts with the vertices in Vs and~n"
"%% may contain newly created vertices in the end.~n", []),
+ w("-spec tesselate(Normal, [Vs]) -> {Triangles, VertexPos}~n", []),
+ w(" when Normal :: vertex(), Vs :: vertex(),~n", []),
+ w(" Triangles :: [integer()], VertexPos :: binary().~n", []),
w("tesselate({Nx,Ny,Nz}, Vs) ->~n",[]),
w(" call(5000, <<(length(Vs)):32/native,0:32,~n"
" Nx:?GLdouble,Ny:?GLdouble,Nz:?GLdouble,~n"
@@ -215,15 +215,21 @@ gen_funcs(F) ->
erase(current_func),
w(".~n~n",[]).
-gen_types(Where) ->
+gen_types(Where) ->
case Where of
- glu -> ignore;
+ glu ->
+ w("-type vertex() :: {float(), float(), float()}.~n", []),
+ w("-type enum() :: non_neg_integer(). %% See wx/include/gl.hrl or glu.hrl~n", []);
gl ->
- w("-type clamp() :: float().~n", []),
- w("-type offset() :: non_neg_integer().~n", [])
+ w("-type enum() :: non_neg_integer(). %% See wx/include/gl.hrl~n", []),
+ w("-type clamp() :: float(). %% 0.0..1.0~n", []),
+ w("-type offset() :: non_neg_integer(). %% Offset in memory block~n", [])
end,
- w("-type enum() :: non_neg_integer().~n", []),
- w("-type mem() :: binary() | tuple().~n", []),
+ w("-type matrix() :: {float(),float(),float(),float(),~n", []),
+ w(" float(),float(),float(),float(),~n", []),
+ w(" float(),float(),float(),float(),~n", []),
+ w(" float(),float(),float(),float()}.~n", []),
+ w("-type mem() :: binary() | tuple(). %% Memory block~n", []),
ok.
gen_export(F) ->
@@ -238,43 +244,182 @@ gen_export_1([F|_]) when is_list(F) ->
gen_export_1(F) when is_list(F) ->
gen_export2(get(F)).
-gen_export2(#func{name=Name,alt={vector,VecPos,Vec}}) ->
- #func{params=As0} = get(Vec),
+gen_export2(#func{name=Name,alt=Alt={vector,VecPos,Vec}}) ->
+ #func{params=As0} = get(Vec),
{As1,_As2} = lists:split(VecPos, As0),
Args = lists:filter(fun(Arg) -> func_arg(Arg) =/= skip end, As1),
- erl_func_name(Name) ++ "/" ++ integer_to_list(length(Args) +1);
-gen_export2(#func{name=Name,params=As0}) ->
+ Export = erl_func_name(Name) ++ "/" ++ integer_to_list(length(Args) +1),
+ DocN = doc_name(Name,Alt),
+ (get({export_arg,DocN}) == undefined) andalso put({export_arg, DocN}, Export),
+ Export;
+gen_export2(#func{name=Name,params=As0, alt=Alt}) ->
Args = lists:filter(fun(Arg) -> func_arg(Arg) =/= skip end, As0),
- erl_func_name(Name) ++ "/" ++ integer_to_list(length(Args)).
+ Export = erl_func_name(Name) ++ "/" ++ integer_to_list(length(Args)),
+ DocN = doc_name(Name,Alt),
+ (get({export_arg,DocN}) == undefined) andalso put({export_arg, DocN}, Export),
+ Export.
-gen_doc([#func{name=Name, alt={vector,VecPos,Vec}}]) ->
- #func{type=T,params=As} = get(Vec),
+gen_doc([#func{name=Name, params=Orig, alt={vector,VecPos,Vec}}]) ->
+ #func{type=T,params=As} = get(Vec),
{As1,As2} = lists:split(VecPos, As),
+ #arg{name=OrigName} = lists:last(Orig),
Args1 = case args(fun func_arg/1, ",", As1) of [] -> []; Else -> Else++"," end,
Args2 = args(fun func_arg/1, ",", As2),
- w("%% @spec (~s{~s}) -> ~s~n",[Args1,Args2,doc_return_types(T,As, doc)]),
w("%% @equiv ~s(~s)~n",[erl_func_name(Vec), Args1++Args2]),
- SA1 = case doc_arg_types(As1, spec) of [] -> []; E -> E++"," end,
- SA2 = doc_arg_types(As2, spec),
- w("-spec ~s(~s{~s}) -> ~s.~n",
- [erl_func_name(Name), SA1, SA2,
- doc_return_types(T,As, spec)]);
-
-gen_doc([#func{name=Name,type=T,params=As,alt=Alt}|_]) ->
- w("%% @spec (~s) -> ~s~n", [doc_arg_types(As, doc),doc_return_types(T,As, doc)]),
- GLDoc = "http://www.opengl.org/sdk/docs/man/xhtml/",
- w("%% @doc See <a href=\"~s~s.xml\">external</a> documentation.~n",
- [GLDoc, doc_name(Name,Alt)]),
- w("-spec ~s(~s) -> ~s.~n",
- [erl_func_name(Name), doc_arg_types(As, spec), doc_return_types(T,As, spec)]).
+ SA1 = case doc_arg_types(As1) of [] -> []; E -> E++"," end,
+ SA2 = doc_arg_types(As2),
+ w("-spec ~s(~s~s) -> ~s when ~s :: {~s}.~n",
+ [erl_func_name(Name), SA1, erl_arg_name(OrigName),
+ doc_return_types(T,As), erl_arg_name(OrigName), SA2]);
+
+gen_doc([F=#func{name=Name,type=T,params=As, alt=Alt}|_]) ->
+ gen_doc(Name, Alt, gen_export2(F)),
+ Ps = [Arg || #arg{name=Arg, in=In, where=Where} <- As,
+ In =/= false, Where =/= c],
+ Args = args(fun erl_arg_name/1, ", ", Ps),
+ case Args of
+ [] ->
+ w("-spec ~s(~s) -> ~s.~n",
+ [erl_func_name(Name), Args, doc_return_types(T,As)]);
+ _ -> w("-spec ~s(~s) -> ~s when ~s.~n",
+ [erl_func_name(Name), Args, doc_return_types(T,As), doc_arg_types(As)])
+ end.
+
+-define(LINE_LEN, 90).
+
+gen_doc(Name0, Alt, Export) ->
+ Name = doc_name(Name0, Alt),
+ case get({doc, Name}) of
+ undefined ->
+ GLDoc = "http://www.opengl.org/sdk/docs/man/xhtml/",
+ case parse_doc(Name, _Dir1 ="gl_man4", _Dir2="gl_man2") of
+ {error, _} ->
+ case reverse(Name) of
+ "BRA" ++ _ -> ok;
+ "TXE" ++ _ -> ok;
+ _ ->
+ %% io:format("Missing doc: no ~s.xml (~s) found in ~s or ~s~n",
+ %% [Name, Name0, Dir1, Dir2]),
+ ok
+ end,
+ w("%% @doc ~s~n%%~n%% See <a href=\"~s~s.xml\">external</a> documentation.~n",
+ [Name, GLDoc, Name]);
+ Doc ->
+ put({doc, Name}, Export),
+ format_doc(Doc, ?LINE_LEN),
+ w("~n%%~n%% See <a href=\"~s~s.xml\">external</a> documentation.~n",
+ [GLDoc, Name])
+ end;
+ Where ->
+ w("%% @doc ~n", []),
+ w("%% See {@link ~s}~n", [Where])
+ end.
+parse_doc(Name, Dir1, Dir2) ->
+ case gl_scan_doc:file(filename:join(Dir1, Name++".xml"), []) of
+ {error, {_, "no such" ++ _}} ->
+ gl_scan_doc:file(filename:join(Dir2, Name++".xml"), []);
+ Doc ->
+ Doc
+ end.
+
+format_doc(Strs, Count) when Count < 0 ->
+ w("~n%% ", []),
+ format_doc(Strs, ?LINE_LEN);
+format_doc([{constant, Const}|Rest], Count) ->
+ w("`?~s'", [Const]),
+ format_doc(Rest, Count-length(Const)-8);
+format_doc([{emphasis, Const}|Rest], Count) ->
+ w("`~s'", [Const]),
+ format_doc(Rest, Count-length(Const)-7);
+format_doc([{function, Func}|Rest], Count) ->
+ case Func of
+ "glu" ++ _ ->
+ w("``glu:~s''", [erl_func_name(Func)]);
+ "gl" ++ _ ->
+ w("``gl:~s''", [erl_func_name(Func)]);
+ _ ->
+ w("`~s'", [Func])
+ end,
+ format_doc(Rest, Count-length(Func)-7);
+format_doc([{reffunc, Func}|Rest], Count) ->
+ Out = fun(Export) ->
+ case Func of
+ "glu" ++ _ -> w(" {@link glu:~s} ", [Export]);
+ "gl" ++ _ -> w(" {@link gl:~s} ", [Export])
+ end
+ end,
+ case get({export_arg, Func}) of
+ undefined ->
+ case get({export_arg, doc_name(Func, undefined)}) of
+ undefined ->
+ %% io:format("Func ~p undefined (~p) ~n",
+ %% [Func, doc_name(Func, undef)]),
+ w("see `~s'", [Func]);
+ Export -> Out(Export)
+ end;
+ Export ->
+ Out(Export)
+ end,
+ format_doc(Rest, Count-length(Func)-10);
+format_doc([{parameter, Param}|Rest], Count) ->
+ w(" `~s' ", [erl_arg_name(Param)]),
+ format_doc(Rest, Count-length(Param)-7);
+format_doc([{equation, Eq}|Rest], Count) ->
+%% w("```", []),
+ format_doc([Eq], Count),
+%% w("'''", []),
+ format_doc(Rest, Count);
+format_doc([{fenced, Open, Close, Eq}|Rest], Count) ->
+ w(Open, []),
+ format_doc(Eq, Count),
+ w(Close, []),
+ format_doc(Rest, Count);
+
+format_doc([{code, Code}|Rest], Count) ->
+ w("``~s''", [Code]),
+ format_doc(Rest, Count-length(Code)-7);
+
+format_doc([para|Rest], _Count) ->
+ w("~n%%~n%% ", []),
+ format_doc(Rest, ?LINE_LEN);
+format_doc([break|Rest], _Count) ->
+ w("<br />~n%% ", []),
+ format_doc(Rest, ?LINE_LEN);
+format_doc([{purpose, Purpose}, para | Doc], _Count) ->
+ w("%% @doc ~s~n%%~n%% ", [uppercase(Purpose)]),
+ format_doc(Doc, ?LINE_LEN);
+format_doc([{purpose, Purpose} | Doc], _Count) ->
+ w("%% @doc ~s~n%%~n%% ", [Purpose]),
+ format_doc(Doc, ?LINE_LEN);
+format_doc([listentry|Rest], _Count) ->
+ w("~n%%~n%% ", []),
+ format_doc(Rest, ?LINE_LEN);
+format_doc([Str|Rest], Count) ->
+ case length(Str) of
+ Len when Len < Count ->
+ w("~s", [Str]),
+ format_doc(Rest, Count-Len);
+ _ ->
+ {Str1, Str2} = split(Str, Count, []),
+ w("~s~n%% ", [Str1]),
+ format_doc([Str2|Rest], ?LINE_LEN)
+ end;
+format_doc([], _) -> ok.
+
+split([$ |Str], Count, Acc) when Count =< 5 ->
+ {reverse(Acc), Str};
+split([Chr|Str], Count, Acc) ->
+ split(Str, Count-1, [Chr|Acc]);
+split([], _, Acc) ->
+ {reverse(Acc), []}.
gen_func(#func{name=Name,alt={vector,VecPos,Vec}}) ->
- #func{params=As} = get(Vec),
+ #func{params=As} = get(Vec),
{As1,As2} = lists:split(VecPos, As),
Args1 = case args(fun func_arg/1, ",", As1) of [] -> []; Else -> Else++"," end,
Args2 = args(fun func_arg/1, ",", As2),
-
+
w("~s(~s{~s}) ->", [erl_func_name(Name),Args1,Args2]),
w(" ~s(~s)", [erl_func_name(Vec), Args1++Args2]);
gen_func(_F=#func{name=Name,type=T,params=As,id=MId}) ->
@@ -290,7 +435,7 @@ gen_func(_F=#func{name=Name,type=T,params=As,id=MId}) ->
w(" cast(~p, <<~s>>)", [MId, StrArgs])
end.
-func_arg(#arg{in=In,where=W,name=Name,type=Type})
+func_arg(#arg{in=In,where=W,name=Name,type=Type})
when In =/= false, W =/= c ->
case Type of
#type{single={tuple,TSz0}} when TSz0 =/= undefined ->
@@ -305,45 +450,39 @@ func_arg(#arg{in=In,where=W,name=Name,type=Type})
end;
func_arg(_) -> skip.
-doc_arg_types(Ps0, Type) ->
+doc_arg_types(Ps0) ->
Ps = [P || P=#arg{in=In, where=Where} <- Ps0,In =/= false, Where =/= c],
- args(fun(Arg) -> doc_arg_type(Arg, Type) end, ",", Ps).
+ args(fun(Arg) -> doc_arg_type(Arg) end, ",", Ps).
-doc_return_types(T, Ps0, Type) ->
+doc_return_types(T, Ps0) ->
Ps = [P || P=#arg{in=In, where=Where} <- Ps0,In =/= true, Where =/= c],
- doc_return_types2(T, Ps, Type).
-
-doc_return_types2(void, [], _) -> "ok";
-doc_return_types2(void, [#arg{type=T}], _) -> doc_arg_type2(T);
-doc_return_types2(T, [], _) -> doc_arg_type2(T);
-doc_return_types2(void, Ps, Type) ->
- "{" ++ args(fun(Arg) -> doc_arg_type(Arg, Type) end,",",Ps) ++ "}";
-doc_return_types2(T, Ps, Type) ->
- "{" ++ doc_arg_type2(T) ++ "," ++
- args(fun(Arg) -> doc_arg_type(Arg, Type) end,",",Ps) ++ "}".
-
-doc_arg_type(#arg{name=Name,type=T}, doc) ->
- try
- erl_arg_name(Name) ++ "::" ++ doc_arg_type2(T)
- catch _:Error ->
- io:format("Error: ~p ~p~n~p~n",[Name, Error, erlang:get_stacktrace()]),
- exit(error)
- end;
-doc_arg_type(#arg{name=Name,type=T}, spec) ->
- try
- doc_arg_type2(T)
+ doc_return_types2(T, Ps).
+
+doc_return_types2(void, []) -> "ok";
+doc_return_types2(void, [#arg{type=T}]) -> doc_arg_type2(T);
+doc_return_types2(T, []) -> doc_arg_type2(T);
+doc_return_types2(void, Ps) ->
+ "{" ++ args(fun(Arg) -> doc_arg_type(Arg) end,",",Ps) ++ "}";
+doc_return_types2(T, Ps) ->
+ "{" ++ doc_arg_type2(T) ++ "," ++
+ args(fun(Arg) -> doc_arg_type(Arg) end,",",Ps) ++ "}".
+
+doc_arg_type(#arg{name=Name,type=T}) ->
+ try
+ erl_arg_name(Name) ++ " :: " ++ doc_arg_type2(T)
catch _:Error ->
io:format("Error spec: ~p ~p~n~p~n",[Name, Error, erlang:get_stacktrace()]),
exit(error)
end.
-
doc_arg_type2(T=#type{single=true}) ->
doc_arg_type3(T);
doc_arg_type2(T=#type{single=undefined}) ->
doc_arg_type3(T);
doc_arg_type2(T=#type{single={tuple,undefined}}) ->
"{" ++ doc_arg_type3(T) ++ "}";
+doc_arg_type2(#type{base=float, single={tuple,16}}) ->
+ "matrix()";
doc_arg_type2(T=#type{single={tuple,Sz}}) ->
"{" ++ args(fun doc_arg_type3/1, ",", lists:duplicate(Sz,T)) ++ "}";
doc_arg_type2(T=#type{single=list}) ->
@@ -365,21 +504,21 @@ doc_arg_type3(#type{base=bool}) -> "0|1";
doc_arg_type3(#type{base=binary}) -> "binary()";
doc_arg_type3(#type{base=memory}) -> "mem()".
-guard_test(As) ->
- Str = args(fun(#arg{name=N,type=#type{base=guard_int}}) ->
- " is_integer("++erl_arg_name(N)++")";
- (_) ->
+guard_test(As) ->
+ Str = args(fun(#arg{name=N,type=#type{base=guard_int}}) ->
+ " is_integer("++erl_arg_name(N)++")";
+ (_) ->
skip
end, ",", As),
case Str of
[] -> [];
Other -> " when " ++ Other
- end.
+ end.
-pre_marshal([#arg{name=N,in=true,type=#type{base=binary}}|R]) ->
+pre_marshal([#arg{name=N,in=true,type=#type{base=binary}}|R]) ->
w(" send_bin(~s),~n", [erl_arg_name(N)]),
pre_marshal(R);
-pre_marshal([#arg{name=N,type=#type{base=memory}}|R]) ->
+pre_marshal([#arg{name=N,type=#type{base=memory}}|R]) ->
w(" send_bin(~s),~n", [erl_arg_name(N)]),
pre_marshal(R);
pre_marshal([A=#arg{name=N,type=#type{base=string,single=list}}|R]) ->
@@ -412,14 +551,14 @@ marshal_arg(#type{size=Sz,name=Type,single={tuple,undefined}},Name,A0) ->
" (<< <<C:?"++Type++ ">> ||"
"C <- tuple_to_list("++Name++")>>)/binary",
case Sz of
- 4 ->
+ 4 ->
{Str,Align} = align(4,A0,Str0),
{Str++",0:((("++integer_to_list(Align div 4)++
"+size("++Name++")) rem 2)*32)",0};
- 8 ->
+ 8 ->
align(8,A0,Str0)
end;
-marshal_arg(#type{size=BSz,name=Type,single={tuple,TSz}},Name,A0)
+marshal_arg(#type{size=BSz,name=Type,single={tuple,TSz}},Name,A0)
when is_integer(TSz) ->
NameId = hd(Name),
Names = [[NameId|integer_to_list(Id)] || Id <- lists:seq(1,TSz)],
@@ -427,7 +566,7 @@ marshal_arg(#type{size=BSz,name=Type,single={tuple,TSz}},Name,A0)
align(BSz,TSz,A0,All);
marshal_arg(#type{size=BSz,name=Type,single={tuple,matrix12}},Name,A0) ->
- NameId = hd(Name),
+ NameId = hd(Name),
Ns0 = [[NameId|integer_to_list(Id)] || Id <- lists:seq(1,3)],
Ns1 = [[NameId|integer_to_list(Id)] || Id <- lists:seq(4,6)],
Ns2 = [[NameId|integer_to_list(Id)] || Id <- lists:seq(7,9)],
@@ -436,7 +575,7 @@ marshal_arg(#type{size=BSz,name=Type,single={tuple,matrix12}},Name,A0) ->
Ns0 ++ ["0"] ++ Ns1 ++ ["0"] ++ Ns2 ++ ["0"] ++ Ns3 ++ ["1"]),
align(BSz,16,A0,All);
-marshal_arg(#type{size=Sz,name=Type,base=Base,single=list},Name,A0)
+marshal_arg(#type{size=Sz,name=Type,base=Base,single=list},Name,A0)
when Base =:= float; Base =:= int ->
KeepA = case Sz of 8 -> "0:32,"; _ -> "" end,
Str0 = "(length("++Name++")):?GLuint,"++KeepA++"\n"
@@ -459,14 +598,14 @@ marshal_arg(#type{base=string,single=true,ref={pointer,1}},Name,A0) ->
align_after(1,A0,1,1,Name,Str);
marshal_arg(#type{base=string,single=list,ref={pointer,2}},Name,A0) ->
- Str0 =
+ Str0 =
"(length("++Name++")):?GLuint,"
"(size("++Name ++ "Temp)):?GLuint,"
"(" ++ Name ++ "Temp)/binary",
{Str,A} = align(4,A0,Str0),
- {Str ++ ",0:((8-((size("++Name++"Temp)+"++
+ {Str ++ ",0:((8-((size("++Name++"Temp)+"++
integer_to_list(A) ++") rem 8)) rem 8)", 0};
-
+
marshal_arg(#type{size=Sz,name=Type,single={tuple_list,TSz}},Name,A0) ->
NameId = hd(Name),
Names = [[NameId|integer_to_list(Id)] || Id <- lists:seq(1,TSz)],
@@ -508,11 +647,11 @@ align(8,_,6,Str) -> {"0:16,"++Str, 0};
align(8,_,7,Str) -> {"0:8," ++Str, 0}.
align_after(8,0,_Add,_Multiplier,_Name,Str) -> {Str,0};
-align_after(4,0,Add,Mult,Name,Str) ->
+align_after(4,0,Add,Mult,Name,Str) ->
Extra = extra_align(Add,Mult),
Align = ",0:(((length("++Name++")"++Extra++") rem 2)*32)",
{Str ++ Align,0};
-align_after(4,4,Add,Mult,Name,Str) ->
+align_after(4,4,Add,Mult,Name,Str) ->
Extra = extra_align(Add,Mult),
Align = ",0:(((1+length("++Name++")"++Extra++") rem 2)*32)",
{Str ++ Align,0};
@@ -531,14 +670,14 @@ align_after(Sz,A,Add,Mult,Name,Str) ->
extra_align(0,1) -> "";
extra_align(0,M) when M > 1 -> "* " ++ integer_to_list(M);
extra_align(A,1) when A > 0 -> "+ " ++ integer_to_list(A);
-extra_align(A,M) when A > 0,M>1 ->
+extra_align(A,M) when A > 0,M>1 ->
"* " ++ integer_to_list(M) ++ "+ " ++ integer_to_list(A).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
have_return_vals(void, Ps) ->
- lists:any(fun(#arg{in=In, type=#type{base=B}}) ->
- In =/= true orelse B =:= memory
+ lists:any(fun(#arg{in=In, type=#type{base=B}}) ->
+ In =/= true orelse B =:= memory
end, Ps);
have_return_vals(#type{}, _) -> true.
@@ -550,21 +689,28 @@ erl_arg_name(Name) -> uppercase(Name).
check_name("begin") -> "'begin'";
check_name("end") -> "'end'";
check_name(Other) -> Other.
-
-
-doc_name(Name0, Alt) ->
- Name = doc_name2(Name0,Alt),
-%% case lists:member(lists:last(Name0), "uvbisdf987654312") of
-%% true -> io:format("~s ~s~n", [Name0,Name]);
-%% false -> ignore
-%% end,
- Name.
-
-doc_name2(N="glGetBufferParameteriv", _) -> N;
-doc_name2(N="glEnd", _) -> N;
-doc_name2(Name, {has_vector,_,_}) ->
+
+doc_name(N="glGetBufferParameteriv", _) -> N;
+doc_name("glEnd"++What, _) -> "glBegin"++What;
+doc_name("glDisable" ++ What, _) -> "glEnable" ++ What;
+doc_name("glPop" ++ What, _) -> "glPush" ++ What;
+doc_name("glGetBooleanv", _) -> "glGet";
+doc_name("glGetBooleani_v", _) -> "glGet";
+doc_name("glGetIntegerv", _) -> "glGet";
+doc_name("glGetIntegeri_v", _) -> "glGet";
+doc_name("glGetInteger64v", _) -> "glGet";
+doc_name("glGetInteger64i_v", _) -> "glGet";
+doc_name("glGetFloatv", _) -> "glGet";
+doc_name("glGetDoublev", _) -> "glGet";
+doc_name("glGetFloati_v", _) -> "glGet";
+doc_name("glGetDoublei_v", _) -> "glGet";
+doc_name("glUniformMatr" ++ _, _) -> "glUniform";
+doc_name("glTexSubImage" ++ _, _) -> "glTexSubImage";
+doc_name("glFramebufferText" ++ _, _) -> "glFramebufferTexture";
+doc_name("glProgramUniformMatr" ++ _, _) -> "glProgramUniform";
+doc_name(Name, {has_vector,_,_}) ->
strip_hard(reverse(Name));
-doc_name2(Name, _) ->
+doc_name(Name, _) ->
reverse(strip(reverse(Name))).
strip_hard(Rev) ->
@@ -583,6 +729,21 @@ strip([$v,$s,$N,N|R]) when N > 47, N < 58 -> R;
strip([$v,$d,$N,N|R]) when N > 47, N < 58 -> R;
strip([$v,$f,$N,N|R]) when N > 47, N < 58 -> R;
strip([$b,$u,$N,N|R]) when N > 47, N < 58 -> R;
+strip([$v,$b,$I,N|R]) when N > 47, N < 58 -> R;
+strip([$v,$i,$I,N|R]) when N > 47, N < 58 -> R;
+strip([$v,$s,$I,N|R]) when N > 47, N < 58 -> R;
+strip([$v,$d,$I,N|R]) when N > 47, N < 58 -> R;
+strip([$v,$f,$I,N|R]) when N > 47, N < 58 -> R;
+strip([$b,$u,$I,N|R]) when N > 47, N < 58 -> R;
+
+strip([$v,$b,$u,N,$I|R]) when N > 47, N < 58 ->R;
+strip([$v,$i,$u,N,$I|R]) when N > 47, N < 58 ->R;
+strip([$v,$s,$u,N,$I|R]) when N > 47, N < 58 ->R;
+strip([$v,$b,N,$I|R]) when N > 47, N < 58 -> R;
+strip([$v,$i,N,$I|R]) when N > 47, N < 58 -> R;
+strip([$v,$s,N,$I|R]) when N > 47, N < 58 -> R;
+strip([$v,$d,N,$I|R]) when N > 47, N < 58 -> R;
+strip([$v,$f,N,$I|R]) when N > 47, N < 58 -> R;
strip([$v,$b,$u,N|R]) when N > 47, N < 58 ->R;
strip([$v,$i,$u,N|R]) when N > 47, N < 58 ->R;
@@ -593,6 +754,15 @@ strip([$v,$s,N|R]) when N > 47, N < 58 -> R;
strip([$v,$d,N|R]) when N > 47, N < 58 -> R;
strip([$v,$f,N|R]) when N > 47, N < 58 -> R;
+strip([$b,$u,N,$I|R]) when N > 47, N < 58 ->R;
+strip([$i,$u,N,$I|R]) when N > 47, N < 58 ->R;
+strip([$s,$u,N,$I|R]) when N > 47, N < 58 ->R;
+strip([$b,N,$I|R]) when N > 47, N < 58 -> R;
+strip([$i,N,$I|R]) when N > 47, N < 58 -> R;
+strip([$s,N,$I|R]) when N > 47, N < 58 -> R;
+strip([$d,N,$I|R]) when N > 47, N < 58 -> R;
+strip([$f,N,$I|R]) when N > 47, N < 58 -> R;
+
strip([$b,$u,N|R]) when N > 47, N < 58 ->R;
strip([$i,$u,N|R]) when N > 47, N < 58 ->R;
strip([$s,$u,N|R]) when N > 47, N < 58 ->R;
@@ -606,6 +776,7 @@ strip([$v,$b,$u|R]) -> R;
strip([$v,$i,$u|R]) -> R;
strip([$v,$s,$u|R]) -> R;
strip([$v,$b|R]) -> R;
+strip([$v,$i,$I|R]) -> R;
strip([$v,$i|R]) -> R;
strip([$v,$s|R]) -> R;
strip([$v,$d|R]) -> R;
@@ -629,6 +800,12 @@ strip([$i,$n|R]) -> [$n|R];
strip([$f,$n|R]) -> [$n|R];
strip([$d,$n|R]) -> [$n|R];
+%% strip([$D,$3|R]) -> R;
+%% strip([$D,$2|R]) -> R;
+%% strip([$D,$1|R]) -> R;
+
+strip([$I|R]) -> R;
+strip([$L|R]) -> R;
strip([$v,R]) -> R;
strip([N|R]) when N > 47, N < 58 -> R;
strip([_|R="tceRlg"]) -> R;
@@ -656,7 +833,6 @@ gen_debug(GL, GLU) ->
w("].~n~n", []),
close().
-
printd([F|R],Mod) when is_list(F) ->
printd(F,Mod),
printd(R,Mod);
@@ -667,6 +843,6 @@ printd(F,Mod) ->
#func{where=erl} -> ok;
#func{id=Id, name=Method} ->
w(" {~p, {~s, ~s, 0}},~n", [Id, Mod, erl_func_name(Method)]);
- _Other ->
- io:format("F= ~p => ~p~n", [F, _Other])
+ _Other ->
+ io:format("F= ~p => ~p~n", [F, _Other])
end.
diff --git a/lib/wx/api_gen/gl_scan_doc.erl b/lib/wx/api_gen/gl_scan_doc.erl
new file mode 100644
index 0000000000..fc7b7cf275
--- /dev/null
+++ b/lib/wx/api_gen/gl_scan_doc.erl
@@ -0,0 +1,286 @@
+%%-*-erlang-*-
+%%--------------------------------------------------------------------
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%----------------------------------------------------------------------
+-module(gl_scan_doc).
+
+-export([file/2]).
+-export([event/3]).
+
+-compile(export_all).
+
+-define(error(Reason),
+ throw({gl_output_error, Reason})).
+
+-record(state, {type=undefined, gen_output=false, str=[]}).
+
+file(FileName, Options0) ->
+ {Options2, State} = parse_options(Options0),
+ Options = [skip_external_dtd, {event_fun, fun event/3}, {event_state, State}|Options2],
+ case xmerl_sax_parser:file(FileName, Options) of
+ {ok, #state{str=Str}, _} -> lists:reverse(Str);
+ Else -> Else
+ end.
+
+event(Event, _LineNo, State) ->
+ gen_output(Event, State).
+
+parse_options(Options) ->
+ parse_options(Options, #state{}).
+
+parse_options(Options, State) ->
+ {Options, State}.
+
+%% Element
+%%----------------------------------------------------------------------
+gen_output({characters, String0}, #state{gen_output=true, type=Type, str=Str} = State) ->
+ case fix_str(strip_white_space(String0)) of
+ [] -> State;
+ String ->
+ Add = case Type of
+ mi -> case hd(Str) of
+ "/" -> String;
+ "*" -> String;
+ "+" -> String;
+ "-" -> String;
+ {fenced,_,_} -> String;
+ _ ->
+ [$ |String]
+ end;
+ constant -> {constant, String};
+ emphasis -> {emphasis, String};
+ function -> {function, String};
+ reffunc -> {reffunc, String};
+ purpose -> {purpose, String};
+ parameter -> {parameter, String};
+ equation -> {equation, String};
+ _ -> String
+ end,
+ State#state{str=[Add|Str]}
+ end;
+
+gen_output({startElement, _Uri, "function", _QName, _Attributes}, #state{gen_output=true} = State) ->
+ State#state{type=function};
+gen_output({endElement, _Uri, "function", _QName}, #state{gen_output=true} = State) ->
+ State#state{type=undefined};
+
+gen_output({startElement, _Uri, "constant", _QName, _Attributes}, #state{gen_output=true} = State) ->
+ State#state{type=constant};
+gen_output({endElement, _Uri, "constant", _QName}, #state{gen_output=true} = State) ->
+ State#state{type=undefined};
+
+gen_output({startElement, _Uri, "parameter", _QName, _Attributes}, #state{gen_output=true} = State) ->
+ State#state{type=parameter};
+gen_output({endElement, _Uri, "parameter", _QName}, #state{gen_output=true} = State) ->
+ State#state{type=undefined};
+
+gen_output({startElement, _Uri, "emphasis", _QName, _Attributes}, #state{gen_output=true} = State) ->
+ State#state{type=emphasis};
+gen_output({endElement, _Uri, "emphasis", _QName}, #state{gen_output=true} = State) ->
+ State#state{type=undefined};
+
+gen_output(startDocument, State) ->
+ State;
+gen_output(endDocument, State) ->
+ State;
+
+gen_output({startElement, _Uri, "refentrytitle", _QName, _Attributes}, #state{gen_output=true} = State) ->
+ State#state{type=reffunc};
+gen_output({endElement, _Uri, "refentrytitle", _QName}, #state{gen_output=true} = State) ->
+ State#state{type=undefined};
+
+gen_output({startElement, _Uri, "refpurpose", _QName, _Attributes}, State) ->
+ State#state{gen_output=true, type=purpose};
+gen_output({endElement, _Uri, "refpurpose", _QName}, State) ->
+ State#state{gen_output=false, type=undefined};
+
+gen_output({startElement, _Uri, "refsect1", _QName, [{_, _, "id", "description"}]}, State) ->
+ State#state{gen_output=true};
+gen_output({endElement, _Uri, "refsect1", _QName}, State) ->
+ State#state{gen_output=false};
+
+gen_output({startElement, _Uri, "title", _QName, _Attributes}, #state{gen_output=true} = State) ->
+ State#state{gen_output=skip};
+gen_output({endElement, _Uri, "title", _QName}, #state{gen_output=skip} = State) ->
+ State#state{gen_output=true};
+
+%% gen_output({startElement, _Uri, "inlineequation", _QName, _Attributes}, #state{gen_output=true} = State) ->
+%% State#state{type=equation};
+%% gen_output({endElement, _Uri, "inlineequation", _QName}, #state{gen_output=skip} = State) ->
+%% State#state{type=undefined};
+%% gen_output({startElement, _Uri, "informalequation", _QName, _Attributes}, #state{gen_output=true} = State) ->
+%% State#state{type=equation};
+%% gen_output({endElement, _Uri, "informalequation", _QName}, #state{gen_output=skip} = State) ->
+%% State#state{type=undefined};
+gen_output({startElement, _Uri, "mfenced", _QName, Attributes}, #state{gen_output=true, str=Str} = State) ->
+ Fenc = get_fenc(Attributes, "(", ")"),
+ State#state{str=[Fenc|Str]};
+gen_output({endElement, _Uri, "mfenced", _QName}, #state{gen_output=true, str=Str0} = State) ->
+ Check = fun(What) -> case What of {fenced,_,_} ->false; _ -> true end end,
+ {Fenced, [{fenced, Open, Close}|Str]} = lists:splitwith(Check, Str0),
+ State#state{str=[{fenced, Open, Close, lists:reverse(Fenced)}| Str]};
+
+%% gen_output({startElement, _Uri, "tgroup", _QName, Attributes}, #state{gen_output=true, str=Str} = State) ->
+%% {_, _, _, ValueStr} = lists:keyfind(3, "cols", Attributes),
+%% ColSz = list_to_integer(ValueStr),
+%% State#state{str=[{tgroup, ColSz}|Str]};
+%% gen_output({endElement, _Uri, "tgroup", _QName}, #state{gen_output=true, str=Str0} = State) ->
+%% Check = fun(What) -> case What of {tgroup, _} ->false; _ -> true end end,
+%% {Rows, [{tgroup, ColSize}|Str]} = lists:splitwith(Check, Str0),
+%% State#state{str=[{tgroup, ColSize, lists:reverse(Rows)}| Str]};
+
+%% gen_output({endElement, _Uri, "row", _QName}, #state{gen_output=true, str=Str} = State) ->
+%% State#state{type=undefined, str=[break|Str]};
+gen_output({startElement, _Uri, "informaltable", _QName, _Attributes}, #state{gen_output=true, str=Str} = State) ->
+ State#state{str=["<table>"|Str]};
+gen_output({endElement, _Uri, "informaltable", _QName}, #state{gen_output=true, str=Str} = State) ->
+ State#state{str=["</table>"|Str]};
+gen_output({startElement, _Uri, "table", _QName, _Attributes}, #state{gen_output=true, str=Str} = State) ->
+ State#state{str=["<table>"|Str]};
+gen_output({endElement, _Uri, "table", _QName}, #state{gen_output=true, str=Str} = State) ->
+ State#state{str=["</table>"|Str]};
+
+gen_output({startElement, _Uri, "tbody", _QName, _Attributes}, #state{gen_output=true, str=Str} = State) ->
+ State#state{str=["<tbody>"|Str]};
+gen_output({endElement, _Uri, "tbody", _QName}, #state{gen_output=true, str=Str} = State) ->
+ State#state{str=["</tbody>"|Str]};
+
+gen_output({startElement, _Uri, "thead", _QName, _Attributes}, #state{gen_output=true, str=Str} = State) ->
+ State#state{str=["<tbody>"|Str]};
+gen_output({endElement, _Uri, "thead", _QName}, #state{gen_output=true, str=Str} = State) ->
+ State#state{str=["</tbody>"|Str]};
+gen_output({startElement, _Uri, "row", _QName, _Attributes}, #state{gen_output=true, str=Str} = State) ->
+ State#state{str=["<tr>"|Str]};
+gen_output({endElement, _Uri, "row", _QName}, #state{gen_output=true, str=Str} = State) ->
+ State#state{str=["</tr>"|Str]};
+gen_output({startElement, _Uri, "entry", _QName, _Attributes}, #state{gen_output=true, str=Str} = State) ->
+ State#state{str=["<td>"|Str]};
+gen_output({endElement, _Uri, "entry", _QName}, #state{gen_output=true, str=Str} = State) ->
+ State#state{str=["</td>"|Str]};
+
+gen_output({startElement, _Uri, "mi", _QName, _Attributes}, #state{gen_output=true} = State) ->
+ State#state{type=mi};
+gen_output({endElement, _Uri, "mi", _QName}, #state{gen_output=true} = State) ->
+ State#state{type=undefined};
+gen_output({startElement, _Uri, "mn", _QName, _Attributes}, #state{gen_output=true} = State) ->
+ State#state{type=mi};
+gen_output({endElement, _Uri, "mn", _QName}, #state{gen_output=true} = State) ->
+ State#state{type=undefined};
+
+
+
+gen_output({startElement, _Uri, "varlistentry", _QName, _Attributes}, #state{gen_output=true, str=Str} = State) ->
+ State#state{str=[listentry|Str]};
+
+gen_output({endElement, _Uri, "mfrac", _QName}, #state{gen_output=true, str=[A0,B|Str]} = State) ->
+ A = case A0 of
+ [$ |A1] -> A1;
+ A1 -> A1
+ end,
+ State#state{str=[A,"/",B|Str]};
+
+gen_output({startElement, _Uri, "para", _QName, _Attributes}, #state{gen_output=true, str=Str} = State) ->
+ case Str of
+ [para|_] -> State;
+ [": "|_] -> State;
+ [Const, listentry | Rest] ->
+ State#state{str=[": ",Const,para|Rest]};
+ [Mod, Const, listentry | Rest] ->
+ State#state{str=[": ",Mod,Const,para|Rest]};
+ _ ->
+ State#state{str=[para|Str]}
+ end;
+
+%% gen_output({startElement, _Uri, What, _QName, _Attributes}, State) ->
+%% io:format("Skipped ~s~n",[What]),
+%% State;
+
+gen_output(_E, State) ->
+ State.
+
+%%----------------------------------------------------------------------
+%% Function : parse_attributes(Attributes) -> Result
+%% Parameters:
+%% Result :
+%% Description:
+%%----------------------------------------------------------------------
+print_attributes([]) ->
+ ok;
+print_attributes([{_Uri, _Prefix, LocalName, AttrValue} |Attributes]) ->
+ io:format(" ~s=\"~s\"",[LocalName, AttrValue]),
+ print_attributes(Attributes).
+
+get_fenc([{_Uri, _Prefix, "open", AttrValue} |Attributes], _Open, Close)
+ when AttrValue /= "" ->
+ get_fenc(Attributes, fenc(AttrValue), Close);
+get_fenc([{_Uri, _Prefix, "close", AttrValue} |Attributes], Open, _Close)
+ when AttrValue /= "" ->
+ get_fenc(Attributes, Open, fenc(AttrValue));
+get_fenc([_|Attributes], Open, Close) ->
+ get_fenc(Attributes, Open, Close);
+get_fenc([], Open, Close) ->
+ {fenced,Open,Close}.
+
+fenc("&DoubleVerticalBar;") -> "||";
+fenc("&VerticalBar;") -> "|";
+fenc("&LeftCeiling;") -> "|";
+fenc("&RightCeiling;") -> "|";
+fenc("&lceil;") -> "|";
+fenc("&rceil;") -> "|";
+fenc("&LeftFloor;") -> "|";
+fenc("&RightFloor;") -> "|";
+fenc("&lfloor;") -> "|";
+fenc("&rfloor;") -> "|";
+fenc("[") -> "[";
+fenc("]") -> "]";
+fenc(Else = [_]) -> Else.
+
+strip_white_space([$ | Str = [$ |_]]) ->
+ strip_white_space(Str);
+strip_white_space([$\n| Str]) ->
+ strip_white_space([$ |Str]);
+strip_white_space([$\t| Str]) ->
+ strip_white_space([$ |Str]);
+strip_white_space([$\\| Str]) ->
+ strip_white_space(Str);
+
+strip_white_space([Char|Str]) ->
+ [Char|strip_white_space(Str)];
+strip_white_space([]) -> [].
+
+fix_str([$<|Str]) ->
+ [$&,$l,$t,$;|fix_str(Str)];
+fix_str([$>|Str]) ->
+ [$&,$g,$t,$;|fix_str(Str)];
+fix_str("&times;"++Str) ->
+ [$*|fix_str(Str)];
+fix_str("&Prime;"++Str) ->
+ [$"|fix_str(Str)];
+fix_str("&CenterDot;"++Str) ->
+ [$.|fix_str(Str)];
+fix_str("&af;"++Str) ->
+ fix_str(Str);
+fix_str("&it;"++Str) ->
+ [$ |fix_str(Str)];
+fix_str([$&|Str]) ->
+ [$&,$a,$m,$p,$; |fix_str(Str)];
+fix_str([C|Str]) when C > 255 ->
+ fix_str(Str);
+fix_str([C|Str]) ->
+ [C|fix_str(Str)];
+fix_str([]) -> [].
diff --git a/lib/wx/api_gen/glapi.conf b/lib/wx/api_gen/glapi.conf
index 525ccf8b68..59fa8f7727 100644
--- a/lib/wx/api_gen/glapi.conf
+++ b/lib/wx/api_gen/glapi.conf
@@ -57,11 +57,13 @@
"glVertexAttribP3", %*
"glVertexAttribP4", %*
- "glGetActiveSubroutineUniformiv", %% Bad API don't know what to allocate needs to ask
+ %% Bad API don't know what to allocate needs to ask
+ "glGetActiveSubroutineUniformiv",
+ "glGetActiveAtomicCounterBufferiv",
%% EXT
%% By default skip these extensions
- "SGIX","SGIS","NV","ATI","AMD","SUN","SUNX","GREMEDY",
+ "SGIX","SGIS","NV","ATI","AMD","SUN","SUNX","GREMEDY","OES","MESA",
"HP","IBM","INTEL","APPLE","3DFX","PGI","EXT"]}.
%% Exceptions to the above
@@ -336,7 +338,6 @@
{"length", [skip, {single, true}]},
{"name", {string,"bufSize","length"}}]}.
-
{"glGenRenderbuffers", {"renderbuffers", {single,{list,"n","n"}}}}.
{"glGenFramebuffers", {"framebuffers",{single,{list,"n","n"}}}}.
{"glGetRenderbufferParameteriv", {"params", {single,true}}}.
@@ -491,4 +492,5 @@
{"glScissorIndexedv", {"v", {single,{tuple,4}}}}.
{"glDepthRangeArrayv", [{"count",{c_only,{length,"v"}}}, {"v", [{single,{tuple_list,2}}]}]}.
+{"glGetInternalformativ", {"params", [out, {single, {list, "bufSize", "bufSize"}}]}}.
diff --git a/lib/wx/api_gen/wx_extra/wxEvtHandler.erl b/lib/wx/api_gen/wx_extra/wxEvtHandler.erl
index 080ebfa49f..c5802af679 100644
--- a/lib/wx/api_gen/wx_extra/wxEvtHandler.erl
+++ b/lib/wx/api_gen/wx_extra/wxEvtHandler.erl
@@ -18,10 +18,7 @@
%% <a href="http://www.wxwidgets.org/manuals/stable/wx_wxevthandler.html">
%% The orginal documentation</a>.
%%
-%% @headerfile "../../include/wx.hrl"
%%
-%%@type wxEvtHandler(). An object reference
-
-module(wxEvtHandler).
-include("wxe.hrl").
-include("../include/wx.hrl").
@@ -34,17 +31,16 @@
new_evt_listener/0, destroy_evt_listener/1,
get_callback/1, replace_fun_with_id/2]).
--record(evh, {et=null,id=?wxID_ANY,lastId=?wxID_ANY,skip=undefined,userdata=[],cb=0}).
-
+-export_type([wxEvtHandler/0, wx/0, event/0]).
+-type wxEvtHandler() :: wx:wx_object().
+-record(evh, {et=null,id=?wxID_ANY,lastId=?wxID_ANY,skip=undefined,userdata=[],cb=0}).
-%% @spec (This::wxEvtHandler(), EventType::wxEventType()) -> ok
%% @doc Equivalent to {@link connect/3. connect(This, EventType, [])}
-
+-spec connect(This::wxEvtHandler(), EventType::wxEventType()) -> ok.
connect(This, EventType) ->
connect(This, EventType, []).
-%% @spec (This::wxEvtHandler(), EventType::wxEventType(), [Options]) -> ok
%% @doc This function subscribes the to events of EventType,
%% in the range id, lastId. The events will be received as messages
%% if no callback is supplied.
@@ -63,6 +59,9 @@ connect(This, EventType) ->
%% to process the event. Default not specfied i.e. a message will
%% be delivered to the process calling this function.
%% {userData, term()} An erlang term that will be sent with the event. Default: [].
+-spec connect(This::wxEvtHandler(), EventType::wxEventType(), [Option]) -> ok when
+ Option :: {id, integer()} | {lastId, integer()} | {skip, boolean()} |
+ callback | {callback, function()} | {userData, term()}.
connect(This=#wx_ref{type=ThisT}, EventType, Options) ->
EvH = parse_opts(Options, #evh{et=EventType}),
?CLASS(ThisT,wxEvtHandler),
@@ -99,26 +98,27 @@ parse_opts([], Opts = #evh{id=Id,lastId=Lid,skip=Skip, cb=CB}) ->
Opts
end.
-%% @spec (This::wxEvtHandler()) -> true | false
+
%% @doc Equivalent to {@link disconnect/3. disconnect(This, null, [])}
%% Can also have an optional callback Fun() as an additional last argument.
-
+-spec disconnect(This::wxEvtHandler()) -> boolean().
disconnect(This=#wx_ref{type=ThisT,ref=_ThisRef}) ->
?CLASS(ThisT,wxEvtHandler),
disconnect(This, null, []).
-%% @spec (This::wxEvtHandler(), EventType::wxEventType()) -> true | false
%% @doc Equivalent to {@link disconnect/3. disconnect(This, EventType, [])}
+-spec disconnect(This::wxEvtHandler(), EventType::wxEventType()) -> boolean().
disconnect(This=#wx_ref{type=ThisT,ref=_ThisRef}, EventType) when is_atom(EventType) ->
?CLASS(ThisT,wxEvtHandler),
disconnect(This, EventType, []).
-%% @spec (This::wxEvtHandler(), EventType::wxEventType(), Opts) -> true | false
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxevthandler.html#wxevthandlerdisconnect">external documentation</a>
%% This function unsubscribes the process or callback fun from the event handler.
%% EventType may be the atom 'null' to match any eventtype.
%% Notice that the options skip and userdata is not used to match the eventhandler.
-disconnect(This=#wx_ref{type=ThisT,ref=_ThisRef}, EventType, Opts) ->
+-spec disconnect(This::wxEvtHandler(), EventType::wxEventType(), [Option]) -> boolean() when
+ Option :: {id, integer()} | {lastId, integer()} | {callback, function()}.
+disconnect(This=#wx_ref{type=ThisT,ref=_ThisRef}, EventType, Opts) ->
?CLASS(ThisT,wxEvtHandler),
EvH = parse_opts(Opts, #evh{et=EventType}),
case wxe_util:disconnect_cb(This, EvH) of
diff --git a/lib/wx/api_gen/wx_gen.erl b/lib/wx/api_gen/wx_gen.erl
index 209de48496..7f85151d03 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -665,7 +665,11 @@ extract_type_info2("&", Acc) -> [{by_ref,reference}|Acc];
extract_type_info2("WXDLLIMP" ++ _, Acc) -> Acc;
extract_type_info2(Type, Acc) -> [Type|Acc].
-parse_type2(["void"], _Info, _Opts, _T) -> void;
+parse_type2(["void"], _Info, _Opts, #type{by_val=ByVal}) ->
+ case ByVal of
+ true -> void;
+ false -> voidp
+ end;
parse_type2(["virtual"|R], _Info, _Opts, _T) ->
[] = R,
%% Bug in old doxygen virtual destructors have type virtual
@@ -1106,6 +1110,7 @@ type_foot_print(#type{base={enum,_}}) -> int;
type_foot_print(#type{base={ref,_}}) -> ref;
type_foot_print(#type{base={term,_}}) -> term;
type_foot_print(#type{base=eventType}) -> atom;
+type_foot_print(voidp) -> int;
%% type_foot_print({Type,Str}) when is_list(Str) ->
%% type_foot_print(Type);
type_foot_print(#type{base={comp,_,R={record,_}}}) ->
diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl
index 1b4c32db24..2209e4a53b 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -64,11 +64,16 @@ gen_derived_dest(Defs) ->
[gen_derived_dest_2(Class) || Class <- Defs],
ok.
-gen_derived_dest_2(C=#class{name=Class}) ->
+gen_derived_dest_2(C=#class{name=Class, options=Opts}) ->
?WTC("gen_derived_dest_2"),
Derived = is_derived(C),
TaylorMade = taylormade_class(C),
+
if Derived andalso (TaylorMade =:= false) ->
+ case lists:keysearch(ifdef,1,Opts) of
+ {value, {ifdef, What}} -> w("#if ~p~n",[What]);
+ _ -> ok
+ end,
w("class E~s : public ~s {~n",[Class,Class]),
case Class of
"wxGLCanvas" -> %% Special for cleaning up gl context
@@ -78,7 +83,13 @@ gen_derived_dest_2(C=#class{name=Class}) ->
w(" public: ~~E~s() {((WxeApp *)wxTheApp)->clearPtr(this);};~n", [Class])
end,
gen_constructors(C),
- w("};~n~n", []);
+ case lists:keysearch(ifdef,1,Opts) of
+ {value, {ifdef, Endif}} ->
+ w("};~n", []),
+ w("#endif // ~p~n~n",[Endif]);
+ _ ->
+ w("};~n~n", [])
+ end;
TaylorMade /= false ->
w("~s~n", [TaylorMade]);
true ->
@@ -324,6 +335,8 @@ declare_var(P = #param{name=Name,in=In,def=Def,type=Type}) ->
declare_type(N,false,_,#type{name="wxArrayInt"}) ->
w(" wxArrayInt ~s;~n", [N]);
+declare_type(N,false,_,#type{name="wxArrayDouble"}) ->
+ w(" wxArrayDouble ~s;~n", [N]);
declare_type(N,false,_,#type{name="wxArrayString"}) ->
w(" wxArrayString ~s;~n", [N]);
declare_type(N,false,_,#type{base=Base,single=true,name=Type,by_val=false,mod=Mod})
@@ -335,8 +348,14 @@ declare_type(N,false,_,#type{name="wxArrayTreeItemIds",ref=reference}) ->
w(" wxArrayTreeItemIds ~s;~n", [N]);
declare_type(N,false,_,#type{name="wxDateTime"}) ->
w(" wxDateTime ~s;~n", [N]);
+declare_type(N,false,_,#type{name="wxColour"}) ->
+ w(" wxColour ~s;~n", [N]);
+declare_type(N,false,_,#type{name=Type, base=int, ref=reference}) ->
+ w(" ~s ~s;~n", [Type,N]);
declare_type(N,false,_,#type{name=Type, base=int64, ref=reference}) ->
w(" ~s ~s;~n", [Type,N]);
+declare_type(N,false,_,#type{base={comp,_,_},single=true,name=Type,ref=reference}) ->
+ w(" ~s ~s;~n", [Type,N]);
declare_type(N,true,Def,#type{base=Base,single=true,name=Type,by_val=true})
when Base =:= int; Base =:= long; Base =:= float; Base =:= double; Base =:= bool ->
w(" ~s ~s=~s;~n", [Type,N,Def]);
@@ -363,6 +382,8 @@ declare_type(N,true,Def,#type{base=binary, name=char}) ->
w(" char ~sD[] = {~s}, * ~s = ~sD;~n", [N,Def,N,N]);
declare_type(_N,true,_Def,void) ->
skip;
+declare_type(_N,true,_Def,voidp) ->
+ skip;
declare_type(N,true,Def,#type{name=Type, ref={pointer,2}}) ->
%% xxxx
w(" ~s ** ~s = ~s;~n", [Type,N,Def]);
@@ -645,6 +666,16 @@ decode_arg(N,#type{name=Type,single=list,base={class,Class}},arg,A0) ->
w(" ~s.Append(*(~s *) getPtr(bp,memenv)); bp += 4;}~n", [N,Class]),
w(" bp += ((~p+ *~sLen)%2 )*4;~n", [A,N]),
0;
+decode_arg(N,#type{single=array,base={comp,Class="wxPoint2DDouble",_}},arg,A0) ->
+ w(" int * ~sLen = (int *) bp; bp += 4;~n", [N]),
+ w(" ~s *~s;~n",[Class,N]),
+ w(" ~s = (~s *) driver_alloc(sizeof(~s) * *~sLen);~n",[N,Class,Class,N]),
+ store_free(N),
+ align(A0+1,64),
+ w(" for(int i=0; i < *~sLen; i++) {~n", [N]),
+ w(" double x = * (double *) bp; bp += 8;~n double y = * (double *) bp; bp += 8;~n", []),
+ w(" ~s[i] = wxPoint2DDouble(x,y);}~n", [N]),
+ 0;
decode_arg(Name,T, Arg,_A) ->
?error({unhandled_type, {Name,T, Arg}}).
@@ -785,6 +816,7 @@ call_arg(#param{name=N,in=false,type=#type{by_val=false, single=true}}) -> "&" +
call_arg(#param{name=N,def=Def,type=#type{base={comp,_,_},ref={pointer,1},single=true}})
when Def =:= none ->
"&" ++N;
+call_arg(#param{name=N,type=#type{base=int, ref=reference, single=true}}) -> "*" ++ N;
call_arg(#param{name=N,type=#type{by_val=false}}) -> N;
call_arg(#param{name=N,type={merged,_,#type{base={class,_},single=true,
by_val=ByVal,
@@ -792,6 +824,7 @@ call_arg(#param{name=N,type={merged,_,#type{base={class,_},single=true,
when ByVal =:= true; Ref =:= reference ->
"*" ++ N;
call_arg(#param{def=Def, type=void}) when Def =/= none -> Def;
+call_arg(#param{def=Def, type=voidp}) when Def =/= none -> Def;
call_arg(#param{name=N,type=#type{base={ref,_},by_val=true,single=true}}) -> N;
call_arg(#param{name=N,type={merged,_,_,_,_,_,_}}) -> N.
@@ -860,7 +893,7 @@ build_return_vals(Type,Ps) ->
build_ret_types(void,Ps) ->
Calc = fun(#param{name=N,in=False,type=T}, Free) when False =/= true ->
- case build_ret(N, False, T) of
+ case build_ret(N, {arg, False}, T) of
ok -> Free;
Other -> [Other|Free]
end;
@@ -868,12 +901,12 @@ build_ret_types(void,Ps) ->
end,
lists:foldl(Calc, [], Ps);
build_ret_types(Type,Ps) ->
- Free = case build_ret("Result", out, Type) of
+ Free = case build_ret("Result", {ret, out}, Type) of
ok -> [];
FreeStr -> [FreeStr]
end,
Calc = fun(#param{name=N,in=False,type=T}, FreeAcc) when False =/= true ->
- case build_ret(N, False, T) of
+ case build_ret(N, {arg, False}, T) of
ok -> FreeAcc;
FreeMe -> [FreeMe|FreeAcc]
end;
@@ -899,13 +932,13 @@ build_ret(Name,_,#type{base={enum,_Type},single=true}) ->
w(" rt.addInt(~s);~n",[Name]);
build_ret(Name,_,#type{base={comp,_,{record, _}},single=true}) ->
w(" rt.add(~s);~n", [Name]);
-build_ret(Name,_,#type{base={comp,_,_},single=true, ref=reference}) ->
+build_ret(Name,{ret,_},#type{base={comp,_,_},single=true, ref=reference}) ->
w(" rt.add((*~s));~n",[Name]);
build_ret(Name,_,#type{base={comp,_,_},single=true}) ->
w(" rt.add(~s);~n",[Name]);
build_ret(Name,_,#type{base=bool,single=true,by_val=true}) ->
w(" rt.addBool(~s);~n",[Name]);
-build_ret(Name,both,#type{base=int,single=true,mod=M}) ->
+build_ret(Name,{arg, both},#type{base=int,single=true,mod=M}) ->
case lists:member(unsigned, M) of
true -> w(" rt.addUint(*~s);~n",[Name]);
false -> w(" rt.addInt(*~s);~n",[Name])
@@ -917,6 +950,8 @@ build_ret(Name,_,#type{base=int,single=true,mod=M}) ->
end;
build_ret(Name,_,#type{name="wxArrayInt"}) ->
w(" rt.add(~s);~n", [Name]);
+build_ret(Name,_,#type{name="wxArrayDouble"}) ->
+ w(" rt.add(~s);~n", [Name]);
build_ret(Name,_,#type{base={comp,_,_},single=array}) ->
w(" for(unsigned int i=0; i < ~s.GetCount(); i++) {~n", [Name]),
w(" rt.add(~s[i]);~n }~n",[Name]),
@@ -1031,6 +1066,7 @@ gen_macros() ->
w("#include <wx/toolbook.h>~n"),
w("#include <wx/listbook.h>~n"),
w("#include <wx/treebook.h>~n"),
+ w("#include <wx/taskbar.h>~n"),
w("#include <wx/html/htmlwin.h>~n"),
w("#include <wx/html/htmlcell.h>~n"),
w("#include <wx/filename.h>~n"),
diff --git a/lib/wx/api_gen/wx_gen_erl.erl b/lib/wx/api_gen/wx_gen_erl.erl
index 5d73d93ead..a8f23575f3 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -28,12 +28,16 @@
-include("wx_gen.hrl").
--compile(export_all).
+%%-compile(export_all).
+-export([gen/1]).
+-export([parents/1, get_unique_names/0, get_unique_name/1,
+ event_type_name/1, event_rec_name/1, filter_attrs/1]).
--import(lists, [foldl/3,foldr/3,reverse/1, keysearch/3, map/2, filter/2]).
--import(gen_util, [lowercase/1, lowercase_all/1, uppercase/1, uppercase_all/1,
+
+-import(lists, [foldl/3,reverse/1, filter/2]).
+-import(gen_util, [lowercase/1, lowercase_all/1, uppercase/1,
open_write/1, close/0, erl_copyright/0, w/2,
- args/3, args/4, strip_name/2]).
+ args/3, args/4]).
gen(Defs) ->
[put({class,N},C) || C=#class{name=N} <- Defs],
@@ -128,8 +132,6 @@ gen_class1(C=#class{name=Name,parent=Parent,methods=Ms,options=Opts}) ->
w("%% stored on disc or distributed for use on other nodes.~n~n", []),
w("-module(~s).~n", [Name]),
w("-include(\"wxe.hrl\").~n",[]),
- %% w("-compile(export_all).~n~n", []), %% XXXX remove ???
- %% w("-compile(nowarn_unused_vars).~n~n", []), %% XXXX remove ???
Exp = fun(M) -> gen_export(C,M) end,
ExportList = lists:usort(lists:append(lists:map(Exp,reverse(Ms)))),
w("-export([~s]).~n~n", [args(fun(EF) -> EF end, ",", ExportList, 60)]),
@@ -140,10 +142,10 @@ gen_class1(C=#class{name=Name,parent=Parent,methods=Ms,options=Opts}) ->
w("-export([~s]).~n~n", [args(fun(EF) -> EF end, ",",
lists:usort(["parent_class/1"|InExported]),
60)]),
-
+ w("-export_type([~s/0]).~n", [Name]),
w("%% @hidden~n", []),
parents_check(Parents),
-
+ w("-type ~s() :: wx:wx_object().~n", [Name]),
Gen = fun(M) -> gen_method(Name,M) end,
NewMs = lists:map(Gen,reverse(Ms)),
gen_dest(C, Ms),
@@ -175,7 +177,18 @@ parents_check([Parent|Ps]) ->
w("parent_class(~s) -> true;~n",[Parent]),
parents_check(Ps).
-check_class(#type{base={class,"wx"}}) -> ok;
+check_class(#type{name="wxObject", base={class,"wx"}}) ->
+ "wx:wx_object()";
+check_class(#type{name="wxIconLocation", base={class,"wx"}}) ->
+ "wx:wx_object()";
+check_class(#type{name="wxToolBarToolBase", base={class,"wx"}, mod=Mod}) ->
+ %% Implement this some day
+ "wx:wx_object()";
+check_class(#type{name="wxValidator", base={class,"wx"}, mod=Mod}) ->
+ %% Implement this some day
+ "wx:wx_object()";
+check_class(#type{name=Name, base={class,"wx"}}) ->
+ exit({class, Name});
check_class(#type{base={class,Name},xml=Xml}) ->
case get({class,Name}) of
undefined ->
@@ -188,12 +201,15 @@ check_class(#type{base={class,Name},xml=Xml}) ->
_ ->
?warning("~s:~s: Class ~p used but not defined~n (see ~p)~n",
[get(current_class),get(current_func),Name, Xml])
- end;
+ end,
+ "wx:wx_object()";
_ ->
?warning("~s:~s: Class ~p used is enum~n",
- [get(current_class),get(current_func),Name])
+ [get(current_class),get(current_func),Name]),
+ exit(class_enum)
end;
- _ -> ok
+ _ ->
+ Name ++ ":" ++ Name ++ "()"
end.
gen_export(#class{name=Class,abstract=Abs},Ms0) ->
@@ -317,8 +333,8 @@ gen_dest(#class{name=CName,abstract=Abs}, Ms) ->
end.
gen_dest2(Class, Id) ->
- w("%% @spec (This::~s()) -> ok~n", [Class]),
w("%% @doc Destroys this object, do not use object again~n", []),
+ w("-spec destroy(This::~s()) -> ok.~n", [Class]),
w("destroy(Obj=#wx_ref{type=Type}) ->~n", []),
w(" ?CLASS(Type,~s),~n",[Class]),
case Id of
@@ -601,9 +617,9 @@ guard_test(#param{name=N,type=#type{base=int64}}) ->
guard_test(#param{name=N,type=#type{base=long}}) ->
"is_integer(" ++ erl_arg_name(N) ++ ")";
guard_test(#param{name=N,type=#type{base=float}}) ->
- "is_float(" ++ erl_arg_name(N) ++ ")";
+ "is_number(" ++ erl_arg_name(N) ++ ")";
guard_test(#param{name=N,type=#type{base=double}}) ->
- "is_float(" ++ erl_arg_name(N) ++ ")";
+ "is_number(" ++ erl_arg_name(N) ++ ")";
guard_test(#param{name=N,type=#type{base=bool}}) ->
"is_boolean(" ++ erl_arg_name(N) ++ ")";
guard_test(#param{name=N,type=#type{name="wxDateTime"}}) ->
@@ -635,245 +651,200 @@ guard_test(#param{name=N,type={class,ignore}}) ->
guard_test(T) -> ?error({unknown_type,T}).
gen_doc(_Class, [#method{method_type=destructor}]) -> skip;
-gen_doc(_Class,[#method{name=N,alias=A,params=Ps,type=T,where=erl_no_opt,method_type=MT}])->
- w("%% @spec (~s~s) -> ~s~n",[doc_arg_types(Ps),"",doc_return_types(T,Ps)]),
+gen_doc(_Class,Ms=[#method{name=N,alias=A,params=Ps,where=erl_no_opt,method_type=MT}])->
w("%% @equiv ", []),
- gen_function_clause(erl_func_name(N,A),MT,Ps,empty_list,[no_guards,name_only]);
-gen_doc(Class,[#method{name=N,params=Ps,type=T}])->
- {_, Optional} = split_optional(Ps),
- NonDef = [Arg || Arg = #param{def=Def,in=In, where=Where} <- Ps,
- Def =:= none, In =/= false, Where =/= c],
- OptsType = case Optional of
- [] -> "";
- _ when NonDef =:= [] -> "[Option]";
- _ -> ", [Option]"
- end,
- w("%% @spec (~s~s) -> ~s~n",
- [doc_arg_types(Ps),OptsType,doc_return_types(T,Ps)]),
- doc_optional(Optional, normal),
- DocEnum = doc_enum(T,Ps, normal),
- case Class of
- "utils" ->
- w("%% @doc See <a href=\"http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#~s\">"
- "external documentation</a>.~n",
- [lowercase_all(N)]);
- _ ->
- w("%% @doc See <a href=\"http://www.wxwidgets.org/manuals/stable/wx_~s.html#~s~s\">"
- "external documentation</a>.~n",
- [lowercase_all(Class),lowercase_all(Class),lowercase_all(N)])
- end,
- doc_enum_desc(DocEnum);
-gen_doc(Class, Cs = [#method{name=N, alias=A,method_type=MT}|_]) ->
- GetRet = fun(#method{params=Ps,type=T}) ->
- doc_return_types(T,Ps)
- end,
- GetArgs = fun(#method{params=Ps, where=Where}) ->
- Opt = case Where of
- erl_no_opt -> [];
- _ ->
- case split_optional(Ps) of
- {_, []} -> [];
- _ -> ["[Option]"]
- end
- end,
- [doc_arg_type(P) ||
- P=#param{in=In,def=none,where=W} <- Ps,
- In =/= false, W =/= c] ++ Opt
- end,
- Args = zip(lists:map(GetArgs, Cs)),
- Ret = lists:map(GetRet, Cs),
- w("%% @spec (~s) -> ~s~n",[args(fun doc_arg/1,",",Args),doc_ret(Ret)]),
- case Class of
- "utils" ->
- w("%% @doc See <a href=\"http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#~s\">"
- "external documentation</a>.~n",
- [lowercase_all(N)]);
- _ ->
- w("%% @doc See <a href=\"http://www.wxwidgets.org/manuals/stable/wx_~s.html#~s~s\">"
- "external documentation</a>.~n",
- [lowercase_all(Class),lowercase_all(Class),lowercase_all(N)])
- end,
- Name = case MT of constructor -> "new"; _ -> erl_func_name(N,A) end,
- w("%% <br /> Alternatives:~n",[]),
- [gen_doc2(Name, Clause) || Clause <- Cs],
+ gen_function_clause(erl_func_name(N,A),MT,Ps,empty_list,[no_guards,name_only]),
+ w("~n-spec ",[]),
+ write_specs(Ms, "\n");
+gen_doc(Class,Ms=[#method{name=N, type=T}|Rest])->
+ %%doc_optional(Optional, normal),
+ doc_link(Class, N),
+ gen_overload_doc(Rest),
+ Ps = lists:foldl(fun(#method{params=Ps}, Acc) -> Ps ++ Acc end,[],Ms),
+ doc_enum_desc(lists:usort(doc_enum(T,Ps))),
+ w("-spec ",[]),
+ write_specs(Ms, "\n"),
ok.
-gen_doc2(Name,#method{params=Ps,where=erl_no_opt,method_type=MT}) ->
- w("%% <p><c>~n",[]),
- w("%% ~s(~s) -> ", [Name,doc_arg_types(Ps)]),
- gen_function_clause(Name,MT,Ps,empty_list,[no_guards,name_only]),
- w(" </c></p>~n",[]);
-gen_doc2(Name,#method{params=Ps,type=T}) ->
+gen_overload_doc([]) -> ok;
+%%gen_overload_doc(_) -> ok;
+gen_overload_doc(Cs) ->
+ w("%% <br /> Also:<br />~n%% ",[]),
+ write_specs(Cs, "<br />\n%% "),
+ w("~n", []).
+
+write_specs(M=[#method{method_type=constructor}|_], Eol) ->
+ w("new", []),
+ write_specs1(M, Eol);
+write_specs(M=[#method{name=N, alias=A}|_], Eol) ->
+ w("~s", [erl_func_name(N,A)]),
+ write_specs1(M, Eol).
+
+write_specs1([M], Eol) ->
+ write_spec(M, Eol),
+ w(".~s", [Eol]);
+write_specs1([M|Next], Eol) ->
+ write_spec(M, Eol),
+ w(";~s ", [Eol]),
+ write_specs1(Next, Eol).
+
+write_spec(#method{params=Ps,type=T,where=erl_no_opt}, Eol) ->
+ {NonDef, _Optional} = split_optional(Ps),
+ Res = doc_return_types(T,Ps),
+ write_spec(NonDef, [], Res, Eol);
+write_spec(#method{params=Ps,type=T}, Eol) ->
{NonDef, Optional} = split_optional(Ps),
- OptsType = case Optional of
- [] -> "";
- _ when NonDef =:= [] -> "[Option]";
- _ -> ", [Option]"
- end,
- w("%% <p><c>~n",[]),
- w("%% ~s(~s~s) -> ~s </c>~n",
- [Name,doc_arg_types(Ps),OptsType,doc_return_types(T,Ps)]),
- doc_optional(Optional, xhtml),
- DocEnum = doc_enum(T,Ps, xhtml),
- doc_enum_desc(DocEnum),
- w("%% </p>~n",[]).
-
-doc_arg(ArgList) ->
- case all_eq(ArgList) of
- true -> hd(ArgList);
- false ->
- Get = fun(Str) ->
- [_Name|Types] = string:tokens(Str, ":"),
- case Types of
- [Type] -> Type;
- _ ->
- "term()"
- end
- end,
- Args0 = lists:map(Get, ArgList),
- Args = unique(Args0, []),
- "X::" ++ args(fun(A) -> A end, "|", Args)
- end.
-
-doc_ret(ArgList) ->
- case all_eq(ArgList) of
- true -> hd(ArgList);
- false ->
- args(fun(A) -> A end, "|", ArgList)
- end.
-
-unique([], U) -> reverse(U);
-unique([H|R], U) ->
- case lists:member(H,U) of
- false -> unique(R,[H|U]);
- true -> unique(R,U)
- end.
-
-all_eq([H|R]) -> all_eq(R,H).
-
-all_eq([H|R],H) -> all_eq(R,H);
-all_eq([],_) -> true;
-all_eq(_,_) -> false.
-
-zip(List) ->
- zip(List, [], [], []).
-
-zip([[F|L1]|List], Rest, AccL, Acc) ->
- zip(List, [L1|Rest], [F|AccL], Acc);
-zip(Empty, Rest, AccL, Acc) ->
- true = empty(Empty),
- case empty(Rest) andalso empty(AccL) of
- true -> reverse(Acc);
- false ->
- zip(reverse(Rest), [], [], [reverse(AccL)|Acc])
- end.
-
-empty([[]|R]) -> empty(R);
-empty([]) -> true;
-empty(_) -> false.
+ Res = doc_return_types(T,Ps),
+ write_spec(NonDef, Optional, Res, Eol).
+
+write_spec([], [], {simple, Res}, _Eol) ->
+ w("() -> ~s", [Res]);
+write_spec([], [], {complex, Res}, Eol) ->
+ w("() -> Resultwhen~s\tResult ::~s", [Eol,Res]);
+write_spec(Args, [], {simple, Res}, Eol) ->
+ w("(~s) -> ~s when~s\t~s",
+ [erl_arg_names(Args), Res, Eol, doc_arg_types(Args)]);
+write_spec(Args, [], {complex, Res}, Eol) ->
+ w("(~s) -> Result when~s\tResult ::~s,~s\t~s",
+ [erl_arg_names(Args), Eol, Res, Eol, doc_arg_types(Args)]);
+write_spec([], Optional, {simple, Res}, Eol) ->
+ w("([Option]) -> ~s when~s\t~s",
+ [Res, Eol, optional_type(Optional, Eol)]);
+write_spec([], Optional, {complex, Res}, Eol) ->
+ w("([Option]) -> Result when~s\tResult :: ~s,~s\t~s",
+ [Eol, Res, Eol, optional_type(Optional, Eol)]);
+write_spec(Args, Optional, {simple, Res}, Eol) ->
+ w("(~s, [Option]) -> ~s when~s\t~s,~s\t~s",
+ [erl_arg_names(Args), Res, Eol, doc_arg_types(Args), Eol, optional_type(Optional, Eol)]);
+write_spec(Args, Optional, {complex, Res}, Eol) ->
+ w("(~s, [Option]) -> Result when~s\tResult :: ~s,~s\t~s,~s\t~s",
+ [erl_arg_names(Args), Eol, Res, Eol, doc_arg_types(Args), Eol, optional_type(Optional, Eol)]).
+
+optional_type(Opts, Eol) ->
+ "Option :: " ++ args(fun optional_type2/1, Eol++"\t\t | ", Opts).
+optional_type2(#param{name=Name, def=Def, type=T}) ->
+ "{" ++ erl_option_name(Name) ++ ", " ++ doc_arg_type2(T) ++ "}". %% %% Default: " ++ Def.
+
+doc_link("utils", Func) ->
+ w("%% @doc See <a href=\"http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#~s\">"
+ "external documentation</a>.~n",
+ [lowercase_all(Func)]);
+doc_link(Class, Func) ->
+ w("%% @doc See <a href=\"http://www.wxwidgets.org/manuals/stable/wx_~s.html#~s~s\">"
+ "external documentation</a>.~n",
+ [lowercase_all(Class),lowercase_all(Class),lowercase_all(Func)]).
+
+erl_arg_names(Ps0) ->
+ Ps = [Name || #param{name=Name, in=In, where=Where} <- Ps0,In =/= false, Where =/= c],
+ args(fun erl_arg_name/1, ", ", Ps).
doc_arg_types(Ps0) ->
Ps = [P || P=#param{in=In, where=Where} <- Ps0,In =/= false, Where =/= c],
args(fun doc_arg_type/1, ", ", Ps).
-doc_arg_type(#param{name=Name,def=none,type=T}) ->
- erl_arg_name(Name) ++ "::" ++ doc_arg_type2(T);
-doc_arg_type(#param{name=Name,in=false,type=T}) ->
- erl_arg_name(Name) ++ "::" ++ doc_arg_type2(T);
-doc_arg_type(_) -> skip.
-
-doc_arg_type2(T=#type{single=Single}) when Single =:= array; Single =:= list ->
- "[" ++ doc_arg_type3(T) ++ "]";
+
+doc_arg_type(T) ->
+ doc_arg_type(T, in).
+
+doc_arg_type(#param{name=Name,def=none,type=T}, Out) ->
+ erl_arg_name(Name) ++ "::" ++ doc_arg_type2(T, Out);
+doc_arg_type(#param{name=Name,in=false,type=T}, Out) ->
+ erl_arg_name(Name) ++ "::" ++ doc_arg_type2(T, Out);
+doc_arg_type(_, _) -> skip.
+
doc_arg_type2(T) ->
- doc_arg_type3(T).
-
-doc_arg_type3(#type{base=string}) -> "string()";
-doc_arg_type3(#type{name="wxChar", single=S}) when S =/= true -> "string()";
-doc_arg_type3(#type{name="wxArrayString"}) -> "[string()]";
-doc_arg_type3(#type{name="wxDateTime"}) -> "wx:datetime()";
-doc_arg_type3(#type{name="wxArtClient"}) -> "string()";
-doc_arg_type3(#type{base=int}) -> "integer()";
-doc_arg_type3(#type{base=int64}) -> "integer()";
-doc_arg_type3(#type{base=long}) -> "integer()";
-doc_arg_type3(#type{name="wxTreeItemId"}) -> "wxTreeCtrl:treeItemId()";
-doc_arg_type3(#type{base=bool}) -> "bool()";
-doc_arg_type3(#type{base=float}) -> "float()";
-doc_arg_type3(#type{base=double}) -> "float()";
-doc_arg_type3(#type{base=binary}) -> "binary()";
-doc_arg_type3(#type{base={binary,_}}) -> "binary()";
-doc_arg_type3(#type{base=eventType}) -> "atom()";
-doc_arg_type3(#type{base={ref,N}}) -> N++"()";
-doc_arg_type3(#type{base={term,_N}}) -> "term()";
-doc_arg_type3(T=#type{base={class,N}}) ->
- check_class(T),
- case get(current_class) of
- N -> N ++ "()";
- _ -> N++":" ++ N++"()"
+ doc_arg_type2(T, in).
+
+doc_arg_type2(T=#type{single=Single}, Out) when Single =:= array; Single =:= list ->
+ "[" ++ doc_arg_type3(T, Out) ++ "]";
+doc_arg_type2(T, Out) ->
+ doc_arg_type3(T, Out).
+
+doc_arg_type3(#type{base=string}, in) -> "unicode:chardata()";
+doc_arg_type3(#type{base=string}, out) -> "unicode:charlist()";
+doc_arg_type3(#type{name="wxChar", single=S},in) when S =/= true -> "unicode:chardata()";
+doc_arg_type3(#type{name="wxChar", single=S},out) when S =/= true -> "unicode:charlist()";
+doc_arg_type3(#type{name="wxArrayString"},in) -> "unicode:chardata()";
+doc_arg_type3(#type{name="wxArrayString"},out) -> "unicode:charlist()";
+doc_arg_type3(#type{name="wxDateTime"}, _) -> "wx:wx_datetime()";
+doc_arg_type3(#type{name="wxArtClient"}, _) -> "unicode:chardata()";
+doc_arg_type3(#type{base=int}, _) -> "integer()";
+doc_arg_type3(#type{base=int64}, _) -> "integer()";
+doc_arg_type3(#type{base=long}, _) -> "integer()";
+doc_arg_type3(#type{name="wxTreeItemId"}, _) -> "wxTreeCtrl:treeItemId()";
+doc_arg_type3(#type{base=bool}, _) -> "boolean()";
+doc_arg_type3(#type{base=float}, _) -> "number()";
+doc_arg_type3(#type{base=double}, _) -> "number()";
+doc_arg_type3(#type{base=binary}, _) -> "binary()";
+doc_arg_type3(#type{base={binary,_}}, _) -> "binary()";
+doc_arg_type3(#type{base=eventType}, _) -> "atom()";
+doc_arg_type3(#type{base={ref,N}}, _) -> N++"()";
+doc_arg_type3(#type{base={term,_N}}, _) -> "term()";
+doc_arg_type3(T=#type{base={class,N}}, _) ->
+ ClassType = check_class(T),
+ Current = get(current_class),
+ if N =:= Current -> N ++ "()";
+ true -> ClassType
end;
-doc_arg_type3({merged,_,T1=#type{base={class,N1}},_,_,T2=#type{base={class,N2}},_}) ->
- check_class(T1),
- check_class(T2),
+doc_arg_type3({merged,_,T1=#type{base={class,N1}},_,_,T2=#type{base={class,N2}},_}, _) ->
+ CT1 = check_class(T1),
+ CT2 = check_class(T2),
Curr = get(current_class),
if
- N1 =:= Curr, N2 =:= Curr -> N1++"() | "++ N2++"()";
- N1 =:= Curr -> N1++"() | "++ N2++":" ++ N2++"()";
- N2 =:= Curr -> N1++":" ++ N1++"() | "++ N2++"()";
+ N1 =:= Curr, N2 =:= Curr -> N1++"()";
+ N1 =:= Curr -> N1++"() | "++ CT2;
+ N2 =:= Curr -> CT1 ++ " | "++ N2++"()";
true ->
- N1++":" ++ N1++"() | "++ N2++":" ++ N2++"()"
+ CT1 ++ " | " ++ CT2
end;
-doc_arg_type3(#type{base={enum,{_,N}}}) -> uppercase(N);
-doc_arg_type3(#type{base={enum,N}}) -> uppercase(N);
-doc_arg_type3(#type{base={comp,"wxColour",_Tup}}) ->
- "wx:colour()";
-doc_arg_type3(#type{base={comp,_,{record,Name}}}) ->
- "wx:" ++ atom_to_list(Name) ++ "()";
-doc_arg_type3(#type{base={comp,_,Tup}}) ->
+%% doc_arg_type3(#type{base={enum,{_,N}}}, _) -> uppercase(N);
+%% doc_arg_type3(#type{base={enum,N}}, _) -> uppercase(N);
+doc_arg_type3(#type{base={enum,_N}}, _) -> "wx:wx_enum()";
+doc_arg_type3(#type{base={comp,"wxColour",_Tup}}, in) ->
+ "wx:wx_colour()";
+doc_arg_type3(#type{base={comp,"wxColour",_Tup}}, out) ->
+ "wx:wx_colour4()";
+doc_arg_type3(#type{base={comp,_,{record,Name}}}, _) ->
+ "wx:wx_" ++ atom_to_list(Name) ++ "()";
+doc_arg_type3(#type{base={comp,_,Tup}}, _) ->
Doc = fun({int,V}) -> V ++ "::integer()";
({double,V}) -> V ++ "::float()"
end,
"{" ++ args(Doc, ", ", Tup) ++ "}";
-doc_arg_type3(T) -> ?error({unknown_type,T}).
+doc_arg_type3(T, _) -> ?error({unknown_type,T}).
doc_return_types(T, Ps) ->
doc_return_types2(T, [P || P=#param{in=In} <- Ps,In =/= true]).
-doc_return_types2(void, []) -> "ok";
-doc_return_types2(void, [#param{type=T}]) -> doc_arg_type2(T);
-doc_return_types2(T, []) -> doc_arg_type2(T);
+doc_return_types2(void, []) -> {simple, "ok"};
+doc_return_types2(void, [#param{type=T}]) -> {simple, doc_arg_type2(T, out)};
+doc_return_types2(T, []) -> {simple, doc_arg_type2(T, out)};
+doc_return_types2(void, Ps) when length(Ps) < 4 ->
+ {simple, "{" ++ args(fun(Arg) -> doc_arg_type(Arg, out) end,", ",Ps) ++ "}"};
doc_return_types2(void, Ps) ->
- "{" ++ args(fun doc_arg_type/1,", ",Ps) ++ "}";
+ {complex, "{" ++ args(fun(Arg) -> doc_arg_type(Arg, out) end,", ",Ps) ++ "}"};
doc_return_types2(T, Ps) ->
- "{" ++ doc_arg_type2(T) ++ ", " ++ args(fun doc_arg_type/1,", ",Ps) ++ "}".
-
-break(xhtml) -> "<br />";
-break(_) -> "".
-
-doc_optional([],_) -> ok;
-doc_optional(Opts,Type) ->
- w("%%~s Option = ~s~n", [break(Type),args(fun doc_optional2/1, " | ", Opts)]).
+ {complex, "{Res ::" ++ doc_arg_type2(T, out) ++ ", " ++
+ args(fun(Arg) -> doc_arg_type(Arg, out) end,", ",Ps) ++ "}"}.
-doc_optional2(#param{name=Name, def=_Def, type=T}) ->
- "{" ++ erl_option_name(Name) ++ ", " ++ doc_arg_type2(T) ++ "}".
+doc_enum(#type{base={enum,Enum}},Ps) ->
+ [doc_enum_type(Enum, "res") |
+ [doc_enum_type(Type,Name) || #param{name=Name, type=#type{base={enum,Type}}} <- Ps]];
+doc_enum(_,Ps) ->
+ [doc_enum_type(Type,Name) || #param{name=Name, type=#type{base={enum,Type}}} <- Ps].
-doc_enum(#type{base={enum,Enum}},Ps,Break) ->
- [doc_enum_type(Enum,Break) |
- [doc_enum_type(Type,Break) || #param{type=#type{base={enum,Type}}} <- Ps]];
-doc_enum(_,Ps,Break) ->
- [doc_enum_type(Type,Break) || #param{type=#type{base={enum,Type}}} <- Ps].
-
-doc_enum_type(Type,Break) ->
+doc_enum_type(Type, Name) ->
{Enum0, #enum{vals=Vals}} = wx_gen:get_enum(Type),
- case Enum0 of {_, Enum} -> Enum; Enum -> Enum end,
+ Enum = case Enum0 of {_, E} -> E; E -> E end,
Consts = get(consts),
- Format = fun({Name,_What}) ->
- #const{name=Name} = gb_trees:get(Name, Consts),
- "?" ++ enum_name(Name)
+ Format = fun({N,_What}) ->
+ #const{name=N} = gb_trees:get(N, Consts),
+ "?" ++ enum_name(N)
end,
Vs = args(Format, " | ", Vals),
- w("%%~s ~s = integer()~n", [break(Break),uppercase(Enum)]),
- {uppercase(Enum),Vs}.
+ {uppercase(Enum),Name, Vs}.
doc_enum_desc([]) -> ok;
-doc_enum_desc([{Enum,Vs}|R]) ->
- w("%%<br /> ~s is one of ~s~n", [Enum,Vs]),
+doc_enum_desc([{_Enum,Name,Vs}|R]) ->
+ w("%%<br /> ~s = ~s~n", [erl_arg_name(Name),Vs]),
doc_enum_desc(R).
%% Misc functions prefixed with wx
@@ -993,7 +964,7 @@ marshal_arg(#type{single=true,base={comp,_,Comp}}, Name, Align0) ->
Str = args(fun(Str) -> Str end, ",", A),
{Str,(Align0 + length(Comp)) rem 2};
{double,_} ->
- A = [Name++Spec++":64/float" || {double,Spec} <- Comp],
+ A = [Name++Spec++":64/?F" || {double,Spec} <- Comp],
Str = args(fun(Str) -> Str end, ",", A),
align(64,Align0,Str)
end;
@@ -1019,9 +990,14 @@ marshal_arg(#type{base=Base, single=Single}, Name, Align0)
Str0 = "(length("++Name++")):32/?UI,\n"
" (<< <<X:32/?I,Y:32/?I>> || {X,Y} <- "++Name++">>)/binary",
align(32,Align0, Str0);
+ {comp, "wxPoint2DDouble", _} ->
+ Str0 = "(length("++Name++")):32/?UI,\n",
+ Str1 = " (<< <<X:64/?F,Y:64/?F>> || {X,Y} <- "++Name++">>)/binary",
+ {Str,_Align} = align(64,Align0+1, Str1),
+ {Str0 ++ Str, 0};
double ->
Str0 = "(length("++Name++")):32/?UI,\n",
- Str1 = " (<< <<C:64/float>> || C <- "++Name++">>)/binary",
+ Str1 = " (<< <<C:64/?F>> || C <- "++Name++">>)/binary",
{Str,_Align} = align(64,Align0+1, Str1),
{Str0 ++ Str, 0};
_ ->
@@ -1048,12 +1024,13 @@ enum_name(Name) ->
gen_enums_ints() ->
%% open_write("../include/wx.hrl"), opened in gen_event_recs
w("~n%% Hardcoded Records~n", []),
- w("-record(wxMouseState, {x, y, %% integer()~n"
- " leftDown, middleDown, rightDown, %% bool()~n"
- " controlDown, shiftDown, altDown, metaDown, cmdDown %% bool()~n"
+ w("-record(wxMouseState, {x :: integer(), y :: integer(),~n"
+ " leftDown :: boolean(), middleDown :: boolean, rightDown :: boolean, ~n"
+ " controlDown :: boolean(), shiftDown :: boolean(),~n"
+ " altDown :: boolean(), metaDown :: boolean(), cmdDown :: boolean()~n"
" }).~n", []),
w("-record(wxHtmlLinkInfo, {~n"
- " href, target %% string()~n"
+ " href :: unicode:chardata(), target :: unicode:chardata()~n"
" }).~n", []),
w("~n%% Hardcoded Defines~n", []),
Enums = [E || {{enum,_},E = #enum{as_atom=false}} <- get()],
@@ -1083,16 +1060,16 @@ build_enum_ints(#enum{from=From, vals=Vals},Done) ->
Format = fun(#const{name="wxEVT_" ++ _}) ->
ignore; %% Ignore event macros they are not valid in our event model
- (#const{name=Name,val=Value,is_const=true}) when is_integer(Value) ->
+ (#const{name=Name,val=Value,is_const=true}) when is_number(Value) ->
w("-define(~s, ~p).~n", [enum_name(Name),Value]);
- (#const{name=Name,val=Value,is_const=false}) when is_integer(Value) ->
+ (#const{name=Name,val=Value,is_const=false}) when is_number(Value) ->
w("-define(~s, wxe_util:get_const(~s)).~n", [enum_name(Name),enum_name(Name)]);
(#const{name=Name,val={Str,0}}) ->
case string:tokens(Str, " |()") of
[Token] ->
- w("-define(~s, ?~s).~n", [enum_name(Name),Token]);
+ w("-define(~s, ~s).~n", [enum_name(Name),const_value(Token)]);
Tokens ->
- Def = args(fun(T) -> [$?|T] end, " bor ", Tokens),
+ Def = args(fun(T) -> const_value(T) end, " bor ", Tokens),
w("-define(~s, (~s)).~n", [enum_name(Name),Def])
end;
(#const{name=Name,val={Str,N}}) ->
@@ -1117,6 +1094,17 @@ build_enum_ints(#enum{from=From, vals=Vals},Done) ->
end,
lists:foldl(Write, Done, Vals).
+const_value(V) when is_integer(V) -> integer_to_list(V);
+const_value(V = "16#" ++ IntList) ->
+ _ = http_util:hexlist_to_integer(IntList), %% ASSERT
+ V;
+const_value(V0) ->
+ try
+ _ = list_to_integer(V0),
+ V0
+ catch _:_ -> [$?|V0]
+ end.
+
gen_event_recs() ->
open_write("../include/wx.hrl"),
erl_copyright(),
@@ -1126,82 +1114,53 @@ gen_event_recs() ->
"%% they contain the widget id and a specialized event record.~n"
"%% Each event record may be sent for one or more event types.~n"
"%% The mapping to wxWidgets is one record per class.~n~n",[]),
- w("%% @type wx() = #wx{id=integer(), obj=wx:wxObject(), userData=term(), event=Rec}. Rec is a event record.~n",[]),
- w("-record(wx, {id, %% Integer Identity of object.~n"
- " obj, %% Object reference that was used in the connect call.~n"
- " userData, %% User data specified in the connect call.~n"
- " event}).%% The event record~n~n",[]),
+ w("-record(wx, {id :: integer(), %% Integer Identity of object.~n"
+ " obj :: wx:wx_object(), %% Object reference that was used in the connect call.~n"
+ " userData :: term(), %% User data specified in the connect call.~n"
+ " event :: event() %% The event record~n"
+ " }).~n~n", []),
+ w("-type wx() :: #wx{}. %% wx event record ~n",[]),
w("%% Here comes the definitions of all event records.~n"
"%% they contain the event type and possible some extra information.~n~n",[]),
- Types = [build_event_rec(C) || {_,C=#class{event=Evs}} <- get(), Evs =/= false],
- w("%% @type wxEventType() = ~s.~n",
- [args(fun(Ev) -> Ev end, " | ", lists:sort(lists:append(Types)))]),
+ Events = [build_event_rec(C) || {_,C=#class{event=Evs}} <- get(), Evs =/= false],
+ EventSubTypes = [Type || {_Rec, Type} <- Events],
+ EventRecs = [Rec || {Rec, _Type} <- Events],
+ w("-type event() :: ~s.~n",
+ [args(fun(Ev) -> Ev++"()" end, " | ", lists:sort(EventRecs))]),
+
+ w("-type wxEventType() :: ~s.~n",
+ [args(fun(Ev) -> Ev++"()" end, " | ", lists:sort(EventSubTypes))]),
%% close(), closed in gen_enums_ints
ok.
-find_inherited_attr(Param = {PName,_}, Name) ->
- #class{parent=Parent, attributes=Attrs} = get({class, Name}),
- case lists:keysearch(atom_to_list(PName), #param.name, Attrs) of
- {value, P=#param{}} ->
- P;
- _ ->
- find_inherited_attr(Param, Parent)
- end.
-
-filter_attrs(#class{name=Name, parent=Parent,attributes=Attrs}) ->
- Attr1 = lists:foldl(fun(#param{acc=skip},Acc) -> Acc;
- (P=#param{prot=public},Acc) -> [P|Acc];
- (#param{acc=undefined},Acc) -> Acc;
- ({inherited, PName},Acc) ->
- case find_inherited_attr(PName, Parent) of
- undefined ->
- io:format("~p:~p: Missing Event Attr ~p in ~p~n",
- [?MODULE,?LINE, PName, Name]),
- Acc;
- P ->
- [P|Acc]
- end;
- (P, Acc) -> [P|Acc]
- end, [], Attrs),
- lists:reverse(Attr1).
-
build_event_rec(Class=#class{name=Name, event=Evs}) ->
EvTypes = [event_type_name(Ev) || Ev <- Evs],
- Str = args(fun(Ev) -> "<em>"++Ev++"</em>" end, ", ", EvTypes),
+ Str = args(fun(Ev) -> Ev end, " | ", EvTypes),
Attr = filter_attrs(Class),
Rec = event_rec_name(Name),
- GetName = fun(#param{name=N}) ->event_attr_name(N) end,
+ %%GetName = fun(#param{name=N}) ->event_attr_name(N) end,
GetType = fun(#param{name=N,type=T}) ->
- event_attr_name(N) ++ "=" ++ doc_arg_type2(T)
+ event_attr_name(N) ++ " :: " ++ doc_arg_type2(T)
end,
+ EventType = Name ++ "Type",
case Attr =:= [] of
true ->
- w("%% @type ~s() = #~s{type=wxEventType()}.~n", [Rec,Rec]),
- w("%% <dl><dt>EventType:</dt> <dd>~s</dd></dl>~n",[Str]),
-%% case is_command_event(Name) of
-%% true -> w("%% This event skips other event handlers.~n",[]);
-%% false -> w("%% This event will be handled by other handlers~n",[])
-%% end,
- w("%% Callback event: {@link ~s}~n", [Name]),
- w("-record(~s, {type}).~n~n", [Rec]);
+ %% w("%% <dl><dt>EventType:</dt> <dd>~s</dd></dl>~n",[Str]),
+ %% w("%% Callback event: {@link ~s}~n", [Name]),
+ w("-record(~s, {type :: ~s()}). %% Callback event: {@link ~s}~n",
+ [Rec, EventType, Name]),
+ w("-type ~s() :: ~s.~n", [EventType, Str]);
false ->
- w("%% @type ~s() = #~s{type=wxEventType(),~s}.~n",
- [Rec,Rec,args(GetType,",",Attr)]),
- w("%% <dl><dt>EventType:</dt> <dd>~s</dd></dl>~n",[Str]),
-%% case is_command_event(Name) of
-%% true -> w("%% This event skips other event handlers.~n",[]);
-%% false -> w("%% This event will be handled by other handlers~n",[])
-%% end,
- w("%% Callback event: {@link ~s}~n", [Name]),
- w("-record(~s,{type, ~s}).~n~n", [Rec,args(GetName,",",Attr)])
+ %% w("%% @type ~s() = #~s{type=wxEventType(),~s}.~n",
+ %% [Rec,Rec,args(GetType,",",Attr)]),
+ %% w("%% <dl><dt>EventType:</dt> <dd>~s</dd></dl>~n",[Str]),
+ %% w("%% Callback event: {@link ~s}~n", [Name]),
+ w("-record(~s,{type :: ~s(), %% Callback event: {@link ~s}~n\t~s}).~n",
+ [Rec,EventType, Name, args(GetType,",\n\t",Attr)]),
+ w("-type ~s() :: ~s.~n", [EventType, Str])
end,
- EvTypes.
-
-is_command_event(Name) ->
- case lists:member("wxCommandEvent", parents(Name)) of
- true -> true;
- false -> false
- end.
+ w("-type ~s() :: #~s{}. %% Callback event: {@link ~s}~n~n", [Rec,Rec,Name]),
+ {Rec, EventType}.
event_rec_name(Name0 = "wx" ++ _) ->
"tnevE" ++ Name1 = reverse(Name0),
@@ -1218,6 +1177,31 @@ event_attr_name("m_" ++ Attr) ->
event_attr_name(Attr) ->
lowercase(Attr).
+find_inherited_attr(Param = {PName,_}, Name) ->
+ #class{parent=Parent, attributes=Attrs} = get({class, Name}),
+ case lists:keysearch(atom_to_list(PName), #param.name, Attrs) of
+ {value, P=#param{}} ->
+ P;
+ _ ->
+ find_inherited_attr(Param, Parent)
+ end.
+
+filter_attrs(#class{name=Name, parent=Parent,attributes=Attrs}) ->
+ Attr1 = lists:foldl(fun(#param{acc=skip},Acc) -> Acc;
+ (P=#param{prot=public},Acc) -> [P|Acc];
+ (#param{acc=undefined},Acc) -> Acc;
+ ({inherited, PName},Acc) ->
+ case find_inherited_attr(PName, Parent) of
+ undefined ->
+ io:format("~p:~p: Missing Event Attr ~p in ~p~n",
+ [?MODULE,?LINE, PName, Name]),
+ Acc;
+ P ->
+ [P|Acc]
+ end;
+ (P, Acc) -> [P|Acc]
+ end, [], Attrs),
+ lists:reverse(Attr1).
gen_funcnames() ->
open_write("../src/gen/wxe_debug.hrl"),
diff --git a/lib/wx/api_gen/wxapi.conf b/lib/wx/api_gen/wxapi.conf
index ff618faf04..1f6225ce60 100644
--- a/lib/wx/api_gen/wxapi.conf
+++ b/lib/wx/api_gen/wxapi.conf
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -330,9 +330,11 @@
{'DrawRotatedText',3}, 'DrawRoundedRectangle',%'DrawSpline',
{'DrawText',2},
'EndDoc','EndPage',{'FloodFill',3},'GetBackground','GetBackgroundMode',
- 'GetBrush','GetCharHeight','GetCharWidth',{'GetClippingBox',1},'GetFont',
- 'GetLayoutDirection','GetLogicalFunction','GetMapMode','GetMultiLineTextExtent',
- 'GetPartialTextExtents','GetPen',{'GetPixel',2},'GetPPI','GetSize','GetSizeMM',
+ 'GetBrush','GetCharHeight','GetCharWidth',{'GetClippingBox',[{"rect", skip_member}]},
+ 'GetFont','GetLayoutDirection','GetLogicalFunction','GetMapMode','GetMultiLineTextExtent',
+ {'GetPartialTextExtents', [{"widths", out}]},
+ 'GetPen',{'GetPixel', [{"col", out}, {"x", skip_member}]},
+ 'GetPPI','GetSize','GetSizeMM',
'GetTextBackground','GetTextExtent','GetTextForeground',
'GetUserScale','GradientFillConcentric','GradientFillLinear',
'LogicalToDeviceX','LogicalToDeviceXRel','LogicalToDeviceY','LogicalToDeviceYRel',
@@ -355,20 +357,28 @@
%%{class,wxAutoBufferedPaintDC,wxBufferedPaintDC,[],['wxAutoBufferedPaintDC']}.
{class, wxGraphicsObject, object, [{ifdef, wxUSE_GRAPHICS_CONTEXT}],
- ['GetRenderer','IsNull']}.
-{class, wxGraphicsContext, wxGraphicsObject, [{ifdef, wxUSE_GRAPHICS_CONTEXT}],
- ['Create', %%CreateFromNative CreateFromNativeWindow
+ ['~wxGraphicsObject', 'GetRenderer','IsNull']}.
+{class, wxGraphicsContext, wxGraphicsObject,
+ [{ifdef, wxUSE_GRAPHICS_CONTEXT}, {skip, [{'StrokeLines',4}]}],
+ ['~wxGraphicsContext',
+ 'Create', %%CreateFromNative CreateFromNativeWindow
'CreatePen','CreateBrush','CreateRadialGradientBrush',
'CreateLinearGradientBrush','CreateFont','CreateMatrix',
'CreatePath','Clip','ResetClip',
- 'DrawBitmap','DrawEllipse','DrawIcon','DrawLines','DrawPath',
+ 'DrawBitmap','DrawEllipse','DrawIcon',
+ {'DrawLines', [{"n",{c_only,{length,"points"}}}, {"points", {single,array}}]},
+ 'DrawPath',
'DrawRectangle','DrawRoundedRectangle','DrawText','FillPath',
- 'StrokePath','GetNativeContext','GetPartialTextExtents',
+ 'StrokePath', %% 'GetNativeContext',
+ {'GetPartialTextExtents', [{"widths", out}]},
'GetTextExtent','Rotate','Scale','Translate',
'GetTransform','SetTransform','ConcatTransform',
- 'SetBrush','SetFont','SetPen','StrokeLine','StrokeLines']}.
+ 'SetBrush','SetFont','SetPen','StrokeLine',
+ {'StrokeLines', [{"n",{c_only,{length,"points"}}}, {"points", {single,array}}]}
+ ]}.
{class, wxGraphicsMatrix, wxGraphicsObject, [{ifdef, wxUSE_GRAPHICS_CONTEXT}],
- ['Concat','Get','GetNativeMatrix','Invert','IsEqual','IsIdentity',
+ ['Concat','Get',%%'GetNativeMatrix',
+ 'Invert','IsEqual','IsIdentity',
'Rotate','Scale','Translate','Set','TransformPoint','TransformDistance']}.
{class, wxGraphicsPath, wxGraphicsObject, [{ifdef, wxUSE_GRAPHICS_CONTEXT}],
['MoveToPoint','AddArc','AddArcToPoint','AddCircle','AddCurveToPoint',
@@ -400,17 +410,17 @@
{class, wxControl, wxWindow, [], [% 'Command','GetLabelText',
'GetLabel','SetLabel']}.
-{class, wxControlWithItems, wxControl,
- [{skip, [{'GetClientObject',1},{'SetClientObject',2}]}],
+{class, wxControlWithItems, wxControl,
+ [{skip, [{'GetClientObject',1},{'SetClientObject',2}]}],
[
- {'Append',[{"clientData",[{skip_member, void}]},
- {"strings", [{erl_func, "appendStrings"}]}]},
+ {'Append',[{"clientData",[{skip_member, voidp}]},
+ {"strings", [{erl_func, "appendStrings"}]}]},
'Clear','Delete','FindString',
%% 'GetClientData','SetClientData',
{'GetClientObject', [{"n", [{erl_func, "getClientData"}]}]},
{'SetClientObject', [{"n", [{erl_func, "setClientData"}]}]},
'GetCount','GetSelection','GetString','GetStringSelection',
- {'Insert',[{"clientData",[{skip_member, void}]}]},%'Number',
+ {'Insert',[{"clientData",[{skip_member, voidp}]}]},%'Number',
'IsEmpty','Select','SetSelection','SetString','SetStringSelection'
]}.
@@ -766,10 +776,12 @@
'GetEditControl',
'GetImageList','GetItem','GetItemBackgroundColour',
'GetItemCount',{'GetItemData', [{return, {base,int}}]},
- 'GetItemFont','GetItemPosition','GetItemRect',
- 'GetItemSpacing','GetItemState','GetItemText','GetItemTextColour',
+ 'GetItemFont', {'GetItemPosition', [{"pos", out}]},{'GetItemRect',[{"rect", out}]},
+ 'GetItemSpacing','GetItemState',
+ 'GetItemText','GetItemTextColour',
'GetNextItem','GetSelectedItemCount','GetTextColour','GetTopItem',
- 'GetViewRect',{'HitTest',[{"pSubItem",nowhere}]},'InsertColumn','InsertItem',
+ 'GetViewRect',{'HitTest',[{"pSubItem",nowhere}, {"flags", in}]},
+ 'InsertColumn','InsertItem',
%%'OnGetItemAttr', 'OnGetItemImage','OnGetItemText',
'RefreshItem','RefreshItems','ScrollList',
'SetBackgroundColour','SetColumn','SetColumnWidth','SetImageList','SetItem',
@@ -1592,9 +1604,9 @@
'HomeWrapExtend', 'LineEndWrap', 'LineEndWrapExtend', 'VCHomeWrap', 'VCHomeWrapExtend', 'LineCopy',
'MoveCaretInsideView', 'LineLength', 'BraceHighlight', 'BraceBadLight', 'BraceMatch', 'GetViewEOL',
'SetViewEOL', %'GetDocPointer', 'SetDocPointer', Hmm void pointers
- 'SetModEventMask', 'GetEdgeColumn', 'SetEdgeColumn',
- 'GetEdgeMode', 'GetEdgeColour', 'SetEdgeColour', 'SearchAnchor', 'SearchNext',
- 'SearchPrev', 'LinesOnScreen',
+ 'SetModEventMask', 'GetEdgeColumn', 'SetEdgeColumn',
+ 'SetEdgeMode', 'GetEdgeMode', 'GetEdgeColour', 'SetEdgeColour', 'SearchAnchor', 'SearchNext',
+ 'SearchPrev', 'LinesOnScreen',
'UsePopUp', 'SelectionIsRectangle', 'SetZoom', 'GetZoom',
%%'CreateDocument', 'AddRefDocument', 'ReleaseDocument', Hmm void pointers
'GetModEventMask', 'SetSTCFocus', 'GetSTCFocus', 'SetStatus', 'GetStatus',
@@ -1803,4 +1815,14 @@
{class, wxLogNull, root, [],
[wxLogNull, '~wxLogNull']}.
-
+
+{class, wxTaskBarIcon, wxEvtHandler, [],
+ [wxTaskBarIcon,'~wxTaskBarIcon',
+ %%'CreatePopupMenu', virtual overrided is a callback
+ %% 'IsIconInstalled', 'IsOk', not available on mac
+ 'PopupMenu','RemoveIcon','SetIcon']}.
+
+{class, wxTaskBarIconEvent, wxEvent,
+ [{event,[wxEVT_TASKBAR_MOVE,wxEVT_TASKBAR_LEFT_DOWN,wxEVT_TASKBAR_LEFT_UP,
+ wxEVT_TASKBAR_RIGHT_DOWN,wxEVT_TASKBAR_RIGHT_UP,
+ wxEVT_TASKBAR_LEFT_DCLICK,wxEVT_TASKBAR_RIGHT_DCLICK]}],[]}.
diff --git a/lib/wx/c_src/Makefile.in b/lib/wx/c_src/Makefile.in
index d40ce88e99..1497ac4d16 100644
--- a/lib/wx/c_src/Makefile.in
+++ b/lib/wx/c_src/Makefile.in
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2011. All Rights Reserved.
+# Copyright Ericsson AB 2008-2012. 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
@@ -45,20 +45,11 @@ GL_H = egl_impl.h gen/glu_finit.h gen/gl_finit.h gen/gl_fdefs.h
HAVE_OPENGL = true
OPENGL_F = gl_funcs egl_impl
-ifneq ($(INSIDE_ERLSRC),true)
-
-ERL_DIR = @ERLANG_ROOT_DIR@
-ERL_INCS = -I$(ERL_DIR)/usr/include
-
-else
-
include $(ERL_TOP)/make/target.mk
include $(ERL_TOP)/make/$(TARGET)/otp_ded.mk
ERL_INCS= $(DED_INCLUDES)
-endif
-
SYS_TYPE = @WXERL_SYS_TYPE@
GENERAL_O = $(GENERAL:%=$(SYS_TYPE)/%.o)
@@ -183,15 +174,12 @@ $(TARGET_DIR)/erl_gl$(SO_EXT): $(GL_OBJECTS)
# ----------------------------------------------------
# Release Target
# ----------------------------------------------------
-ifeq ($(INSIDE_ERLSRC),true)
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/priv
- $(INSTALL_DATA) ../priv/erlang-logo32.png $(RELSYSDIR)/priv/
- $(INSTALL_DATA) ../priv/erlang-logo64.png $(RELSYSDIR)/priv/
- $(INSTALL_PROGRAM) $(TARGET_DIR)/wxe_driver$(SO_EXT) $(RELSYSDIR)/priv/
- $(INSTALL_PROGRAM) $(TARGET_DIR)/erl_gl$(SO_EXT) $(RELSYSDIR)/priv/
+ $(INSTALL_DIR) "$(RELSYSDIR)/priv"
+ $(INSTALL_DATA) ../priv/erlang-logo32.png "$(RELSYSDIR)/priv/"
+ $(INSTALL_DATA) ../priv/erlang-logo64.png "$(RELSYSDIR)/priv/"
+ $(INSTALL_PROGRAM) $(TARGET_DIR)/wxe_driver$(SO_EXT) "$(RELSYSDIR)/priv/"
+ $(INSTALL_PROGRAM) $(TARGET_DIR)/erl_gl$(SO_EXT) "$(RELSYSDIR)/priv/"
release_docs_spec:
-
-endif
diff --git a/lib/wx/c_src/gen/gl_fdefs.h b/lib/wx/c_src/gen/gl_fdefs.h
index a45896d30d..3e742724aa 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-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2012. 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
@@ -31,308 +31,180 @@ typedef struct {
} gl_fns_t;
#define GLE_GL_FUNC_START 5037
-typedef void (APIENTRY * WXEGLACCUM)(GLenum,GLfloat);
-WXE_EXTERN WXEGLACCUM weglAccum;
-typedef void (APIENTRY * WXEGLALPHAFUNC)(GLenum,GLclampf);
-WXE_EXTERN WXEGLALPHAFUNC weglAlphaFunc;
-typedef GLboolean (APIENTRY * WXEGLARETEXTURESRESIDENT)(GLsizei,const GLuint *,GLboolean *);
-WXE_EXTERN WXEGLARETEXTURESRESIDENT weglAreTexturesResident;
-typedef void (APIENTRY * WXEGLARRAYELEMENT)(GLint);
-WXE_EXTERN WXEGLARRAYELEMENT weglArrayElement;
-typedef void (APIENTRY * WXEGLBEGIN)(GLenum);
-WXE_EXTERN WXEGLBEGIN weglBegin;
-typedef void (APIENTRY * WXEGLBINDTEXTURE)(GLenum,GLuint);
-WXE_EXTERN WXEGLBINDTEXTURE weglBindTexture;
-typedef void (APIENTRY * WXEGLBITMAP)(GLsizei,GLsizei,GLfloat,GLfloat,GLfloat,GLfloat,const GLubyte *);
-WXE_EXTERN WXEGLBITMAP weglBitmap;
-typedef void (APIENTRY * WXEGLBLENDFUNC)(GLenum,GLenum);
-WXE_EXTERN WXEGLBLENDFUNC weglBlendFunc;
-typedef void (APIENTRY * WXEGLCALLLIST)(GLuint);
-WXE_EXTERN WXEGLCALLLIST weglCallList;
-typedef void (APIENTRY * WXEGLCALLLISTS)(GLsizei,GLenum,const GLuint *);
-WXE_EXTERN WXEGLCALLLISTS weglCallLists;
-typedef void (APIENTRY * WXEGLCLEAR)(GLbitfield);
-WXE_EXTERN WXEGLCLEAR weglClear;
-typedef void (APIENTRY * WXEGLCLEARACCUM)(GLfloat,GLfloat,GLfloat,GLfloat);
-WXE_EXTERN WXEGLCLEARACCUM weglClearAccum;
-typedef void (APIENTRY * WXEGLCLEARCOLOR)(GLclampf,GLclampf,GLclampf,GLclampf);
-WXE_EXTERN WXEGLCLEARCOLOR weglClearColor;
-typedef void (APIENTRY * WXEGLCLEARDEPTH)(GLclampd);
-WXE_EXTERN WXEGLCLEARDEPTH weglClearDepth;
typedef void (APIENTRY * WXEGLCLEARINDEX)(GLfloat);
WXE_EXTERN WXEGLCLEARINDEX weglClearIndex;
-typedef void (APIENTRY * WXEGLCLEARSTENCIL)(GLint);
-WXE_EXTERN WXEGLCLEARSTENCIL weglClearStencil;
-typedef void (APIENTRY * WXEGLCLIPPLANE)(GLenum,const GLdouble *);
-WXE_EXTERN WXEGLCLIPPLANE weglClipPlane;
-typedef void (APIENTRY * WXEGLCOLOR3BV)(const GLbyte *);
-WXE_EXTERN WXEGLCOLOR3BV weglColor3bv;
-typedef void (APIENTRY * WXEGLCOLOR3DV)(const GLdouble *);
-WXE_EXTERN WXEGLCOLOR3DV weglColor3dv;
-typedef void (APIENTRY * WXEGLCOLOR3FV)(const GLfloat *);
-WXE_EXTERN WXEGLCOLOR3FV weglColor3fv;
-typedef void (APIENTRY * WXEGLCOLOR3IV)(const GLint *);
-WXE_EXTERN WXEGLCOLOR3IV weglColor3iv;
-typedef void (APIENTRY * WXEGLCOLOR3SV)(const GLshort *);
-WXE_EXTERN WXEGLCOLOR3SV weglColor3sv;
-typedef void (APIENTRY * WXEGLCOLOR3UBV)(const GLubyte *);
-WXE_EXTERN WXEGLCOLOR3UBV weglColor3ubv;
-typedef void (APIENTRY * WXEGLCOLOR3UIV)(const GLuint *);
-WXE_EXTERN WXEGLCOLOR3UIV weglColor3uiv;
-typedef void (APIENTRY * WXEGLCOLOR3USV)(const GLushort *);
-WXE_EXTERN WXEGLCOLOR3USV weglColor3usv;
-typedef void (APIENTRY * WXEGLCOLOR4BV)(const GLbyte *);
-WXE_EXTERN WXEGLCOLOR4BV weglColor4bv;
-typedef void (APIENTRY * WXEGLCOLOR4DV)(const GLdouble *);
-WXE_EXTERN WXEGLCOLOR4DV weglColor4dv;
-typedef void (APIENTRY * WXEGLCOLOR4FV)(const GLfloat *);
-WXE_EXTERN WXEGLCOLOR4FV weglColor4fv;
-typedef void (APIENTRY * WXEGLCOLOR4IV)(const GLint *);
-WXE_EXTERN WXEGLCOLOR4IV weglColor4iv;
-typedef void (APIENTRY * WXEGLCOLOR4SV)(const GLshort *);
-WXE_EXTERN WXEGLCOLOR4SV weglColor4sv;
-typedef void (APIENTRY * WXEGLCOLOR4UBV)(const GLubyte *);
-WXE_EXTERN WXEGLCOLOR4UBV weglColor4ubv;
-typedef void (APIENTRY * WXEGLCOLOR4UIV)(const GLuint *);
-WXE_EXTERN WXEGLCOLOR4UIV weglColor4uiv;
-typedef void (APIENTRY * WXEGLCOLOR4USV)(const GLushort *);
-WXE_EXTERN WXEGLCOLOR4USV weglColor4usv;
+typedef void (APIENTRY * WXEGLCLEARCOLOR)(GLclampf,GLclampf,GLclampf,GLclampf);
+WXE_EXTERN WXEGLCLEARCOLOR weglClearColor;
+typedef void (APIENTRY * WXEGLCLEAR)(GLbitfield);
+WXE_EXTERN WXEGLCLEAR weglClear;
+typedef void (APIENTRY * WXEGLINDEXMASK)(GLuint);
+WXE_EXTERN WXEGLINDEXMASK weglIndexMask;
typedef void (APIENTRY * WXEGLCOLORMASK)(GLboolean,GLboolean,GLboolean,GLboolean);
WXE_EXTERN WXEGLCOLORMASK weglColorMask;
-typedef void (APIENTRY * WXEGLCOLORMATERIAL)(GLenum,GLenum);
-WXE_EXTERN WXEGLCOLORMATERIAL weglColorMaterial;
-typedef void (APIENTRY * WXEGLCOLORPOINTER)(GLint,GLenum,GLsizei,const GLvoid *);
-WXE_EXTERN WXEGLCOLORPOINTER weglColorPointer;
-typedef void (APIENTRY * WXEGLCOPYPIXELS)(GLint,GLint,GLsizei,GLsizei,GLenum);
-WXE_EXTERN WXEGLCOPYPIXELS weglCopyPixels;
-typedef void (APIENTRY * WXEGLCOPYTEXIMAGE1D)(GLenum,GLint,GLenum,GLint,GLint,GLsizei,GLint);
-WXE_EXTERN WXEGLCOPYTEXIMAGE1D weglCopyTexImage1D;
-typedef void (APIENTRY * WXEGLCOPYTEXIMAGE2D)(GLenum,GLint,GLenum,GLint,GLint,GLsizei,GLsizei,GLint);
-WXE_EXTERN WXEGLCOPYTEXIMAGE2D weglCopyTexImage2D;
-typedef void (APIENTRY * WXEGLCOPYTEXSUBIMAGE1D)(GLenum,GLint,GLint,GLint,GLint,GLsizei);
-WXE_EXTERN WXEGLCOPYTEXSUBIMAGE1D weglCopyTexSubImage1D;
-typedef void (APIENTRY * WXEGLCOPYTEXSUBIMAGE2D)(GLenum,GLint,GLint,GLint,GLint,GLint,GLsizei,GLsizei);
-WXE_EXTERN WXEGLCOPYTEXSUBIMAGE2D weglCopyTexSubImage2D;
+typedef void (APIENTRY * WXEGLALPHAFUNC)(GLenum,GLclampf);
+WXE_EXTERN WXEGLALPHAFUNC weglAlphaFunc;
+typedef void (APIENTRY * WXEGLBLENDFUNC)(GLenum,GLenum);
+WXE_EXTERN WXEGLBLENDFUNC weglBlendFunc;
+typedef void (APIENTRY * WXEGLLOGICOP)(GLenum);
+WXE_EXTERN WXEGLLOGICOP weglLogicOp;
typedef void (APIENTRY * WXEGLCULLFACE)(GLenum);
WXE_EXTERN WXEGLCULLFACE weglCullFace;
-typedef void (APIENTRY * WXEGLDELETELISTS)(GLuint,GLsizei);
-WXE_EXTERN WXEGLDELETELISTS weglDeleteLists;
-typedef void (APIENTRY * WXEGLDELETETEXTURES)(GLsizei,const GLuint *);
-WXE_EXTERN WXEGLDELETETEXTURES weglDeleteTextures;
-typedef void (APIENTRY * WXEGLDEPTHFUNC)(GLenum);
-WXE_EXTERN WXEGLDEPTHFUNC weglDepthFunc;
-typedef void (APIENTRY * WXEGLDEPTHMASK)(GLboolean);
-WXE_EXTERN WXEGLDEPTHMASK weglDepthMask;
-typedef void (APIENTRY * WXEGLDEPTHRANGE)(GLclampd,GLclampd);
-WXE_EXTERN WXEGLDEPTHRANGE weglDepthRange;
-typedef void (APIENTRY * WXEGLDISABLE)(GLenum);
-WXE_EXTERN WXEGLDISABLE weglDisable;
-typedef void (APIENTRY * WXEGLDISABLECLIENTSTATE)(GLenum);
-WXE_EXTERN WXEGLDISABLECLIENTSTATE weglDisableClientState;
-typedef void (APIENTRY * WXEGLDRAWARRAYS)(GLenum,GLint,GLsizei);
-WXE_EXTERN WXEGLDRAWARRAYS weglDrawArrays;
-typedef void (APIENTRY * WXEGLDRAWBUFFER)(GLenum);
-WXE_EXTERN WXEGLDRAWBUFFER weglDrawBuffer;
-typedef void (APIENTRY * WXEGLDRAWELEMENTS)(GLenum,GLsizei,GLenum,const GLvoid *);
-WXE_EXTERN WXEGLDRAWELEMENTS weglDrawElements;
-typedef void (APIENTRY * WXEGLDRAWPIXELS)(GLsizei,GLsizei,GLenum,GLenum,const GLvoid *);
-WXE_EXTERN WXEGLDRAWPIXELS weglDrawPixels;
+typedef void (APIENTRY * WXEGLFRONTFACE)(GLenum);
+WXE_EXTERN WXEGLFRONTFACE weglFrontFace;
+typedef void (APIENTRY * WXEGLPOINTSIZE)(GLfloat);
+WXE_EXTERN WXEGLPOINTSIZE weglPointSize;
+typedef void (APIENTRY * WXEGLLINEWIDTH)(GLfloat);
+WXE_EXTERN WXEGLLINEWIDTH weglLineWidth;
+typedef void (APIENTRY * WXEGLLINESTIPPLE)(GLint,GLushort);
+WXE_EXTERN WXEGLLINESTIPPLE weglLineStipple;
+typedef void (APIENTRY * WXEGLPOLYGONMODE)(GLenum,GLenum);
+WXE_EXTERN WXEGLPOLYGONMODE weglPolygonMode;
+typedef void (APIENTRY * WXEGLPOLYGONOFFSET)(GLfloat,GLfloat);
+WXE_EXTERN WXEGLPOLYGONOFFSET weglPolygonOffset;
+typedef void (APIENTRY * WXEGLPOLYGONSTIPPLE)(const GLubyte *);
+WXE_EXTERN WXEGLPOLYGONSTIPPLE weglPolygonStipple;
+typedef void (APIENTRY * WXEGLGETPOLYGONSTIPPLE)(GLubyte *);
+WXE_EXTERN WXEGLGETPOLYGONSTIPPLE weglGetPolygonStipple;
typedef void (APIENTRY * WXEGLEDGEFLAGV)(const GLboolean *);
WXE_EXTERN WXEGLEDGEFLAGV weglEdgeFlagv;
-typedef void (APIENTRY * WXEGLEDGEFLAGPOINTER)(GLsizei,const GLvoid *);
-WXE_EXTERN WXEGLEDGEFLAGPOINTER weglEdgeFlagPointer;
+typedef void (APIENTRY * WXEGLSCISSOR)(GLint,GLint,GLsizei,GLsizei);
+WXE_EXTERN WXEGLSCISSOR weglScissor;
+typedef void (APIENTRY * WXEGLCLIPPLANE)(GLenum,const GLdouble *);
+WXE_EXTERN WXEGLCLIPPLANE weglClipPlane;
+typedef void (APIENTRY * WXEGLGETCLIPPLANE)(GLenum,GLdouble *);
+WXE_EXTERN WXEGLGETCLIPPLANE weglGetClipPlane;
+typedef void (APIENTRY * WXEGLDRAWBUFFER)(GLenum);
+WXE_EXTERN WXEGLDRAWBUFFER weglDrawBuffer;
+typedef void (APIENTRY * WXEGLREADBUFFER)(GLenum);
+WXE_EXTERN WXEGLREADBUFFER weglReadBuffer;
typedef void (APIENTRY * WXEGLENABLE)(GLenum);
WXE_EXTERN WXEGLENABLE weglEnable;
+typedef void (APIENTRY * WXEGLDISABLE)(GLenum);
+WXE_EXTERN WXEGLDISABLE weglDisable;
+typedef GLboolean (APIENTRY * WXEGLISENABLED)(GLenum);
+WXE_EXTERN WXEGLISENABLED weglIsEnabled;
typedef void (APIENTRY * WXEGLENABLECLIENTSTATE)(GLenum);
WXE_EXTERN WXEGLENABLECLIENTSTATE weglEnableClientState;
-typedef void (APIENTRY * WXEGLEND)();
-WXE_EXTERN WXEGLEND weglEnd;
-typedef void (APIENTRY * WXEGLENDLIST)();
-WXE_EXTERN WXEGLENDLIST weglEndList;
-typedef void (APIENTRY * WXEGLEVALCOORD1DV)(const GLdouble *);
-WXE_EXTERN WXEGLEVALCOORD1DV weglEvalCoord1dv;
-typedef void (APIENTRY * WXEGLEVALCOORD1FV)(const GLfloat *);
-WXE_EXTERN WXEGLEVALCOORD1FV weglEvalCoord1fv;
-typedef void (APIENTRY * WXEGLEVALCOORD2DV)(const GLdouble *);
-WXE_EXTERN WXEGLEVALCOORD2DV weglEvalCoord2dv;
-typedef void (APIENTRY * WXEGLEVALCOORD2FV)(const GLfloat *);
-WXE_EXTERN WXEGLEVALCOORD2FV weglEvalCoord2fv;
-typedef void (APIENTRY * WXEGLEVALMESH1)(GLenum,GLint,GLint);
-WXE_EXTERN WXEGLEVALMESH1 weglEvalMesh1;
-typedef void (APIENTRY * WXEGLEVALMESH2)(GLenum,GLint,GLint,GLint,GLint);
-WXE_EXTERN WXEGLEVALMESH2 weglEvalMesh2;
-typedef void (APIENTRY * WXEGLEVALPOINT1)(GLint);
-WXE_EXTERN WXEGLEVALPOINT1 weglEvalPoint1;
-typedef void (APIENTRY * WXEGLEVALPOINT2)(GLint,GLint);
-WXE_EXTERN WXEGLEVALPOINT2 weglEvalPoint2;
-typedef void (APIENTRY * WXEGLFEEDBACKBUFFER)(GLsizei,GLenum,GLfloat *);
-WXE_EXTERN WXEGLFEEDBACKBUFFER weglFeedbackBuffer;
-typedef void (APIENTRY * WXEGLFINISH)();
-WXE_EXTERN WXEGLFINISH weglFinish;
-typedef void (APIENTRY * WXEGLFLUSH)();
-WXE_EXTERN WXEGLFLUSH weglFlush;
-typedef void (APIENTRY * WXEGLFOGF)(GLenum,GLfloat);
-WXE_EXTERN WXEGLFOGF weglFogf;
-typedef void (APIENTRY * WXEGLFOGFV)(GLenum,const GLfloat *);
-WXE_EXTERN WXEGLFOGFV weglFogfv;
-typedef void (APIENTRY * WXEGLFOGI)(GLenum,GLint);
-WXE_EXTERN WXEGLFOGI weglFogi;
-typedef void (APIENTRY * WXEGLFOGIV)(GLenum,const GLint *);
-WXE_EXTERN WXEGLFOGIV weglFogiv;
-typedef void (APIENTRY * WXEGLFRONTFACE)(GLenum);
-WXE_EXTERN WXEGLFRONTFACE weglFrontFace;
-typedef void (APIENTRY * WXEGLFRUSTUM)(GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble);
-WXE_EXTERN WXEGLFRUSTUM weglFrustum;
-typedef GLuint (APIENTRY * WXEGLGENLISTS)(GLsizei);
-WXE_EXTERN WXEGLGENLISTS weglGenLists;
-typedef void (APIENTRY * WXEGLGENTEXTURES)(GLsizei,GLuint *);
-WXE_EXTERN WXEGLGENTEXTURES weglGenTextures;
+typedef void (APIENTRY * WXEGLDISABLECLIENTSTATE)(GLenum);
+WXE_EXTERN WXEGLDISABLECLIENTSTATE weglDisableClientState;
typedef void (APIENTRY * WXEGLGETBOOLEANV)(GLenum,GLboolean *);
WXE_EXTERN WXEGLGETBOOLEANV weglGetBooleanv;
-typedef void (APIENTRY * WXEGLGETCLIPPLANE)(GLenum,GLdouble *);
-WXE_EXTERN WXEGLGETCLIPPLANE weglGetClipPlane;
typedef void (APIENTRY * WXEGLGETDOUBLEV)(GLenum,GLdouble *);
WXE_EXTERN WXEGLGETDOUBLEV weglGetDoublev;
-typedef GLenum (APIENTRY * WXEGLGETERROR)();
-WXE_EXTERN WXEGLGETERROR weglGetError;
typedef void (APIENTRY * WXEGLGETFLOATV)(GLenum,GLfloat *);
WXE_EXTERN WXEGLGETFLOATV weglGetFloatv;
typedef void (APIENTRY * WXEGLGETINTEGERV)(GLenum,GLint *);
WXE_EXTERN WXEGLGETINTEGERV weglGetIntegerv;
-typedef void (APIENTRY * WXEGLGETLIGHTFV)(GLenum,GLenum,GLfloat *);
-WXE_EXTERN WXEGLGETLIGHTFV weglGetLightfv;
-typedef void (APIENTRY * WXEGLGETLIGHTIV)(GLenum,GLenum,GLint *);
-WXE_EXTERN WXEGLGETLIGHTIV weglGetLightiv;
-typedef void (APIENTRY * WXEGLGETMAPDV)(GLenum,GLenum,GLdouble *);
-WXE_EXTERN WXEGLGETMAPDV weglGetMapdv;
-typedef void (APIENTRY * WXEGLGETMAPFV)(GLenum,GLenum,GLfloat *);
-WXE_EXTERN WXEGLGETMAPFV weglGetMapfv;
-typedef void (APIENTRY * WXEGLGETMAPIV)(GLenum,GLenum,GLint *);
-WXE_EXTERN WXEGLGETMAPIV weglGetMapiv;
-typedef void (APIENTRY * WXEGLGETMATERIALFV)(GLenum,GLenum,GLfloat *);
-WXE_EXTERN WXEGLGETMATERIALFV weglGetMaterialfv;
-typedef void (APIENTRY * WXEGLGETMATERIALIV)(GLenum,GLenum,GLint *);
-WXE_EXTERN WXEGLGETMATERIALIV weglGetMaterialiv;
-typedef void (APIENTRY * WXEGLGETPIXELMAPFV)(GLenum,GLfloat *);
-WXE_EXTERN WXEGLGETPIXELMAPFV weglGetPixelMapfv;
-typedef void (APIENTRY * WXEGLGETPIXELMAPUIV)(GLenum,GLuint *);
-WXE_EXTERN WXEGLGETPIXELMAPUIV weglGetPixelMapuiv;
-typedef void (APIENTRY * WXEGLGETPIXELMAPUSV)(GLenum,GLushort *);
-WXE_EXTERN WXEGLGETPIXELMAPUSV weglGetPixelMapusv;
-typedef void (APIENTRY * WXEGLGETPOLYGONSTIPPLE)(GLubyte *);
-WXE_EXTERN WXEGLGETPOLYGONSTIPPLE weglGetPolygonStipple;
+typedef void (APIENTRY * WXEGLPUSHATTRIB)(GLbitfield);
+WXE_EXTERN WXEGLPUSHATTRIB weglPushAttrib;
+typedef void (APIENTRY * WXEGLPOPATTRIB)();
+WXE_EXTERN WXEGLPOPATTRIB weglPopAttrib;
+typedef void (APIENTRY * WXEGLPUSHCLIENTATTRIB)(GLbitfield);
+WXE_EXTERN WXEGLPUSHCLIENTATTRIB weglPushClientAttrib;
+typedef void (APIENTRY * WXEGLPOPCLIENTATTRIB)();
+WXE_EXTERN WXEGLPOPCLIENTATTRIB weglPopClientAttrib;
+typedef GLint (APIENTRY * WXEGLRENDERMODE)(GLenum);
+WXE_EXTERN WXEGLRENDERMODE weglRenderMode;
+typedef GLenum (APIENTRY * WXEGLGETERROR)();
+WXE_EXTERN WXEGLGETERROR weglGetError;
typedef const GLubyte * (APIENTRY * WXEGLGETSTRING)(GLenum);
WXE_EXTERN WXEGLGETSTRING weglGetString;
-typedef void (APIENTRY * WXEGLGETTEXENVFV)(GLenum,GLenum,GLfloat *);
-WXE_EXTERN WXEGLGETTEXENVFV weglGetTexEnvfv;
-typedef void (APIENTRY * WXEGLGETTEXENVIV)(GLenum,GLenum,GLint *);
-WXE_EXTERN WXEGLGETTEXENVIV weglGetTexEnviv;
-typedef void (APIENTRY * WXEGLGETTEXGENDV)(GLenum,GLenum,GLdouble *);
-WXE_EXTERN WXEGLGETTEXGENDV weglGetTexGendv;
-typedef void (APIENTRY * WXEGLGETTEXGENFV)(GLenum,GLenum,GLfloat *);
-WXE_EXTERN WXEGLGETTEXGENFV weglGetTexGenfv;
-typedef void (APIENTRY * WXEGLGETTEXGENIV)(GLenum,GLenum,GLint *);
-WXE_EXTERN WXEGLGETTEXGENIV weglGetTexGeniv;
-typedef void (APIENTRY * WXEGLGETTEXIMAGE)(GLenum,GLint,GLenum,GLenum,GLvoid *);
-WXE_EXTERN WXEGLGETTEXIMAGE weglGetTexImage;
-typedef void (APIENTRY * WXEGLGETTEXLEVELPARAMETERFV)(GLenum,GLint,GLenum,GLfloat *);
-WXE_EXTERN WXEGLGETTEXLEVELPARAMETERFV weglGetTexLevelParameterfv;
-typedef void (APIENTRY * WXEGLGETTEXLEVELPARAMETERIV)(GLenum,GLint,GLenum,GLint *);
-WXE_EXTERN WXEGLGETTEXLEVELPARAMETERIV weglGetTexLevelParameteriv;
-typedef void (APIENTRY * WXEGLGETTEXPARAMETERFV)(GLenum,GLenum,GLfloat *);
-WXE_EXTERN WXEGLGETTEXPARAMETERFV weglGetTexParameterfv;
-typedef void (APIENTRY * WXEGLGETTEXPARAMETERIV)(GLenum,GLenum,GLint *);
-WXE_EXTERN WXEGLGETTEXPARAMETERIV weglGetTexParameteriv;
+typedef void (APIENTRY * WXEGLFINISH)();
+WXE_EXTERN WXEGLFINISH weglFinish;
+typedef void (APIENTRY * WXEGLFLUSH)();
+WXE_EXTERN WXEGLFLUSH weglFlush;
typedef void (APIENTRY * WXEGLHINT)(GLenum,GLenum);
WXE_EXTERN WXEGLHINT weglHint;
-typedef void (APIENTRY * WXEGLINDEXMASK)(GLuint);
-WXE_EXTERN WXEGLINDEXMASK weglIndexMask;
-typedef void (APIENTRY * WXEGLINDEXPOINTER)(GLenum,GLsizei,const GLvoid *);
-WXE_EXTERN WXEGLINDEXPOINTER weglIndexPointer;
-typedef void (APIENTRY * WXEGLINDEXDV)(const GLdouble *);
-WXE_EXTERN WXEGLINDEXDV weglIndexdv;
-typedef void (APIENTRY * WXEGLINDEXFV)(const GLfloat *);
-WXE_EXTERN WXEGLINDEXFV weglIndexfv;
-typedef void (APIENTRY * WXEGLINDEXIV)(const GLint *);
-WXE_EXTERN WXEGLINDEXIV weglIndexiv;
-typedef void (APIENTRY * WXEGLINDEXSV)(const GLshort *);
-WXE_EXTERN WXEGLINDEXSV weglIndexsv;
-typedef void (APIENTRY * WXEGLINDEXUBV)(const GLubyte *);
-WXE_EXTERN WXEGLINDEXUBV weglIndexubv;
-typedef void (APIENTRY * WXEGLINITNAMES)();
-WXE_EXTERN WXEGLINITNAMES weglInitNames;
-typedef void (APIENTRY * WXEGLINTERLEAVEDARRAYS)(GLenum,GLsizei,const GLvoid *);
-WXE_EXTERN WXEGLINTERLEAVEDARRAYS weglInterleavedArrays;
-typedef GLboolean (APIENTRY * WXEGLISENABLED)(GLenum);
-WXE_EXTERN WXEGLISENABLED weglIsEnabled;
-typedef GLboolean (APIENTRY * WXEGLISLIST)(GLuint);
-WXE_EXTERN WXEGLISLIST weglIsList;
-typedef GLboolean (APIENTRY * WXEGLISTEXTURE)(GLuint);
-WXE_EXTERN WXEGLISTEXTURE weglIsTexture;
-typedef void (APIENTRY * WXEGLLIGHTMODELF)(GLenum,GLfloat);
-WXE_EXTERN WXEGLLIGHTMODELF weglLightModelf;
-typedef void (APIENTRY * WXEGLLIGHTMODELFV)(GLenum,const GLfloat *);
-WXE_EXTERN WXEGLLIGHTMODELFV weglLightModelfv;
-typedef void (APIENTRY * WXEGLLIGHTMODELI)(GLenum,GLint);
-WXE_EXTERN WXEGLLIGHTMODELI weglLightModeli;
-typedef void (APIENTRY * WXEGLLIGHTMODELIV)(GLenum,const GLint *);
-WXE_EXTERN WXEGLLIGHTMODELIV weglLightModeliv;
-typedef void (APIENTRY * WXEGLLIGHTF)(GLenum,GLenum,GLfloat);
-WXE_EXTERN WXEGLLIGHTF weglLightf;
-typedef void (APIENTRY * WXEGLLIGHTFV)(GLenum,GLenum,const GLfloat *);
-WXE_EXTERN WXEGLLIGHTFV weglLightfv;
-typedef void (APIENTRY * WXEGLLIGHTI)(GLenum,GLenum,GLint);
-WXE_EXTERN WXEGLLIGHTI weglLighti;
-typedef void (APIENTRY * WXEGLLIGHTIV)(GLenum,GLenum,const GLint *);
-WXE_EXTERN WXEGLLIGHTIV weglLightiv;
-typedef void (APIENTRY * WXEGLLINESTIPPLE)(GLint,GLushort);
-WXE_EXTERN WXEGLLINESTIPPLE weglLineStipple;
-typedef void (APIENTRY * WXEGLLINEWIDTH)(GLfloat);
-WXE_EXTERN WXEGLLINEWIDTH weglLineWidth;
-typedef void (APIENTRY * WXEGLLISTBASE)(GLuint);
-WXE_EXTERN WXEGLLISTBASE weglListBase;
+typedef void (APIENTRY * WXEGLCLEARDEPTH)(GLclampd);
+WXE_EXTERN WXEGLCLEARDEPTH weglClearDepth;
+typedef void (APIENTRY * WXEGLDEPTHFUNC)(GLenum);
+WXE_EXTERN WXEGLDEPTHFUNC weglDepthFunc;
+typedef void (APIENTRY * WXEGLDEPTHMASK)(GLboolean);
+WXE_EXTERN WXEGLDEPTHMASK weglDepthMask;
+typedef void (APIENTRY * WXEGLDEPTHRANGE)(GLclampd,GLclampd);
+WXE_EXTERN WXEGLDEPTHRANGE weglDepthRange;
+typedef void (APIENTRY * WXEGLCLEARACCUM)(GLfloat,GLfloat,GLfloat,GLfloat);
+WXE_EXTERN WXEGLCLEARACCUM weglClearAccum;
+typedef void (APIENTRY * WXEGLACCUM)(GLenum,GLfloat);
+WXE_EXTERN WXEGLACCUM weglAccum;
+typedef void (APIENTRY * WXEGLMATRIXMODE)(GLenum);
+WXE_EXTERN WXEGLMATRIXMODE weglMatrixMode;
+typedef void (APIENTRY * WXEGLORTHO)(GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble);
+WXE_EXTERN WXEGLORTHO weglOrtho;
+typedef void (APIENTRY * WXEGLFRUSTUM)(GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble);
+WXE_EXTERN WXEGLFRUSTUM weglFrustum;
+typedef void (APIENTRY * WXEGLVIEWPORT)(GLint,GLint,GLsizei,GLsizei);
+WXE_EXTERN WXEGLVIEWPORT weglViewport;
+typedef void (APIENTRY * WXEGLPUSHMATRIX)();
+WXE_EXTERN WXEGLPUSHMATRIX weglPushMatrix;
+typedef void (APIENTRY * WXEGLPOPMATRIX)();
+WXE_EXTERN WXEGLPOPMATRIX weglPopMatrix;
typedef void (APIENTRY * WXEGLLOADIDENTITY)();
WXE_EXTERN WXEGLLOADIDENTITY weglLoadIdentity;
typedef void (APIENTRY * WXEGLLOADMATRIXD)(const GLdouble *);
WXE_EXTERN WXEGLLOADMATRIXD weglLoadMatrixd;
typedef void (APIENTRY * WXEGLLOADMATRIXF)(const GLfloat *);
WXE_EXTERN WXEGLLOADMATRIXF weglLoadMatrixf;
-typedef void (APIENTRY * WXEGLLOADNAME)(GLuint);
-WXE_EXTERN WXEGLLOADNAME weglLoadName;
-typedef void (APIENTRY * WXEGLLOGICOP)(GLenum);
-WXE_EXTERN WXEGLLOGICOP weglLogicOp;
-typedef void (APIENTRY * WXEGLMAP1D)(GLenum,GLdouble,GLdouble,GLint,GLint,const GLdouble *);
-WXE_EXTERN WXEGLMAP1D weglMap1d;
-typedef void (APIENTRY * WXEGLMAP1F)(GLenum,GLfloat,GLfloat,GLint,GLint,const GLfloat *);
-WXE_EXTERN WXEGLMAP1F weglMap1f;
-typedef void (APIENTRY * WXEGLMAP2D)(GLenum,GLdouble,GLdouble,GLint,GLint,GLdouble,GLdouble,GLint,GLint,const GLdouble *);
-WXE_EXTERN WXEGLMAP2D weglMap2d;
-typedef void (APIENTRY * WXEGLMAP2F)(GLenum,GLfloat,GLfloat,GLint,GLint,GLfloat,GLfloat,GLint,GLint,const GLfloat *);
-WXE_EXTERN WXEGLMAP2F weglMap2f;
-typedef void (APIENTRY * WXEGLMAPGRID1D)(GLint,GLdouble,GLdouble);
-WXE_EXTERN WXEGLMAPGRID1D weglMapGrid1d;
-typedef void (APIENTRY * WXEGLMAPGRID1F)(GLint,GLfloat,GLfloat);
-WXE_EXTERN WXEGLMAPGRID1F weglMapGrid1f;
-typedef void (APIENTRY * WXEGLMAPGRID2D)(GLint,GLdouble,GLdouble,GLint,GLdouble,GLdouble);
-WXE_EXTERN WXEGLMAPGRID2D weglMapGrid2d;
-typedef void (APIENTRY * WXEGLMAPGRID2F)(GLint,GLfloat,GLfloat,GLint,GLfloat,GLfloat);
-WXE_EXTERN WXEGLMAPGRID2F weglMapGrid2f;
-typedef void (APIENTRY * WXEGLMATERIALF)(GLenum,GLenum,GLfloat);
-WXE_EXTERN WXEGLMATERIALF weglMaterialf;
-typedef void (APIENTRY * WXEGLMATERIALFV)(GLenum,GLenum,const GLfloat *);
-WXE_EXTERN WXEGLMATERIALFV weglMaterialfv;
-typedef void (APIENTRY * WXEGLMATERIALI)(GLenum,GLenum,GLint);
-WXE_EXTERN WXEGLMATERIALI weglMateriali;
-typedef void (APIENTRY * WXEGLMATERIALIV)(GLenum,GLenum,const GLint *);
-WXE_EXTERN WXEGLMATERIALIV weglMaterialiv;
-typedef void (APIENTRY * WXEGLMATRIXMODE)(GLenum);
-WXE_EXTERN WXEGLMATRIXMODE weglMatrixMode;
typedef void (APIENTRY * WXEGLMULTMATRIXD)(const GLdouble *);
WXE_EXTERN WXEGLMULTMATRIXD weglMultMatrixd;
typedef void (APIENTRY * WXEGLMULTMATRIXF)(const GLfloat *);
WXE_EXTERN WXEGLMULTMATRIXF weglMultMatrixf;
+typedef void (APIENTRY * WXEGLROTATED)(GLdouble,GLdouble,GLdouble,GLdouble);
+WXE_EXTERN WXEGLROTATED weglRotated;
+typedef void (APIENTRY * WXEGLROTATEF)(GLfloat,GLfloat,GLfloat,GLfloat);
+WXE_EXTERN WXEGLROTATEF weglRotatef;
+typedef void (APIENTRY * WXEGLSCALED)(GLdouble,GLdouble,GLdouble);
+WXE_EXTERN WXEGLSCALED weglScaled;
+typedef void (APIENTRY * WXEGLSCALEF)(GLfloat,GLfloat,GLfloat);
+WXE_EXTERN WXEGLSCALEF weglScalef;
+typedef void (APIENTRY * WXEGLTRANSLATED)(GLdouble,GLdouble,GLdouble);
+WXE_EXTERN WXEGLTRANSLATED weglTranslated;
+typedef void (APIENTRY * WXEGLTRANSLATEF)(GLfloat,GLfloat,GLfloat);
+WXE_EXTERN WXEGLTRANSLATEF weglTranslatef;
+typedef GLboolean (APIENTRY * WXEGLISLIST)(GLuint);
+WXE_EXTERN WXEGLISLIST weglIsList;
+typedef void (APIENTRY * WXEGLDELETELISTS)(GLuint,GLsizei);
+WXE_EXTERN WXEGLDELETELISTS weglDeleteLists;
+typedef GLuint (APIENTRY * WXEGLGENLISTS)(GLsizei);
+WXE_EXTERN WXEGLGENLISTS weglGenLists;
typedef void (APIENTRY * WXEGLNEWLIST)(GLuint,GLenum);
WXE_EXTERN WXEGLNEWLIST weglNewList;
+typedef void (APIENTRY * WXEGLENDLIST)();
+WXE_EXTERN WXEGLENDLIST weglEndList;
+typedef void (APIENTRY * WXEGLCALLLIST)(GLuint);
+WXE_EXTERN WXEGLCALLLIST weglCallList;
+typedef void (APIENTRY * WXEGLCALLLISTS)(GLsizei,GLenum,const GLuint *);
+WXE_EXTERN WXEGLCALLLISTS weglCallLists;
+typedef void (APIENTRY * WXEGLLISTBASE)(GLuint);
+WXE_EXTERN WXEGLLISTBASE weglListBase;
+typedef void (APIENTRY * WXEGLBEGIN)(GLenum);
+WXE_EXTERN WXEGLBEGIN weglBegin;
+typedef void (APIENTRY * WXEGLEND)();
+WXE_EXTERN WXEGLEND weglEnd;
+typedef void (APIENTRY * WXEGLVERTEX2DV)(const GLdouble *);
+WXE_EXTERN WXEGLVERTEX2DV weglVertex2dv;
+typedef void (APIENTRY * WXEGLVERTEX2FV)(const GLfloat *);
+WXE_EXTERN WXEGLVERTEX2FV weglVertex2fv;
+typedef void (APIENTRY * WXEGLVERTEX2IV)(const GLint *);
+WXE_EXTERN WXEGLVERTEX2IV weglVertex2iv;
+typedef void (APIENTRY * WXEGLVERTEX2SV)(const GLshort *);
+WXE_EXTERN WXEGLVERTEX2SV weglVertex2sv;
+typedef void (APIENTRY * WXEGLVERTEX3DV)(const GLdouble *);
+WXE_EXTERN WXEGLVERTEX3DV weglVertex3dv;
+typedef void (APIENTRY * WXEGLVERTEX3FV)(const GLfloat *);
+WXE_EXTERN WXEGLVERTEX3FV weglVertex3fv;
+typedef void (APIENTRY * WXEGLVERTEX3IV)(const GLint *);
+WXE_EXTERN WXEGLVERTEX3IV weglVertex3iv;
+typedef void (APIENTRY * WXEGLVERTEX3SV)(const GLshort *);
+WXE_EXTERN WXEGLVERTEX3SV weglVertex3sv;
+typedef void (APIENTRY * WXEGLVERTEX4DV)(const GLdouble *);
+WXE_EXTERN WXEGLVERTEX4DV weglVertex4dv;
+typedef void (APIENTRY * WXEGLVERTEX4FV)(const GLfloat *);
+WXE_EXTERN WXEGLVERTEX4FV weglVertex4fv;
+typedef void (APIENTRY * WXEGLVERTEX4IV)(const GLint *);
+WXE_EXTERN WXEGLVERTEX4IV weglVertex4iv;
+typedef void (APIENTRY * WXEGLVERTEX4SV)(const GLshort *);
+WXE_EXTERN WXEGLVERTEX4SV weglVertex4sv;
typedef void (APIENTRY * WXEGLNORMAL3BV)(const GLbyte *);
WXE_EXTERN WXEGLNORMAL3BV weglNormal3bv;
typedef void (APIENTRY * WXEGLNORMAL3DV)(const GLdouble *);
@@ -343,54 +215,80 @@ typedef void (APIENTRY * WXEGLNORMAL3IV)(const GLint *);
WXE_EXTERN WXEGLNORMAL3IV weglNormal3iv;
typedef void (APIENTRY * WXEGLNORMAL3SV)(const GLshort *);
WXE_EXTERN WXEGLNORMAL3SV weglNormal3sv;
-typedef void (APIENTRY * WXEGLNORMALPOINTER)(GLenum,GLsizei,const GLvoid *);
-WXE_EXTERN WXEGLNORMALPOINTER weglNormalPointer;
-typedef void (APIENTRY * WXEGLORTHO)(GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble);
-WXE_EXTERN WXEGLORTHO weglOrtho;
-typedef void (APIENTRY * WXEGLPASSTHROUGH)(GLfloat);
-WXE_EXTERN WXEGLPASSTHROUGH weglPassThrough;
-typedef void (APIENTRY * WXEGLPIXELMAPFV)(GLenum,GLsizei,const GLfloat *);
-WXE_EXTERN WXEGLPIXELMAPFV weglPixelMapfv;
-typedef void (APIENTRY * WXEGLPIXELMAPUIV)(GLenum,GLsizei,const GLuint *);
-WXE_EXTERN WXEGLPIXELMAPUIV weglPixelMapuiv;
-typedef void (APIENTRY * WXEGLPIXELMAPUSV)(GLenum,GLsizei,const GLushort *);
-WXE_EXTERN WXEGLPIXELMAPUSV weglPixelMapusv;
-typedef void (APIENTRY * WXEGLPIXELSTOREF)(GLenum,GLfloat);
-WXE_EXTERN WXEGLPIXELSTOREF weglPixelStoref;
-typedef void (APIENTRY * WXEGLPIXELSTOREI)(GLenum,GLint);
-WXE_EXTERN WXEGLPIXELSTOREI weglPixelStorei;
-typedef void (APIENTRY * WXEGLPIXELTRANSFERF)(GLenum,GLfloat);
-WXE_EXTERN WXEGLPIXELTRANSFERF weglPixelTransferf;
-typedef void (APIENTRY * WXEGLPIXELTRANSFERI)(GLenum,GLint);
-WXE_EXTERN WXEGLPIXELTRANSFERI weglPixelTransferi;
-typedef void (APIENTRY * WXEGLPIXELZOOM)(GLfloat,GLfloat);
-WXE_EXTERN WXEGLPIXELZOOM weglPixelZoom;
-typedef void (APIENTRY * WXEGLPOINTSIZE)(GLfloat);
-WXE_EXTERN WXEGLPOINTSIZE weglPointSize;
-typedef void (APIENTRY * WXEGLPOLYGONMODE)(GLenum,GLenum);
-WXE_EXTERN WXEGLPOLYGONMODE weglPolygonMode;
-typedef void (APIENTRY * WXEGLPOLYGONOFFSET)(GLfloat,GLfloat);
-WXE_EXTERN WXEGLPOLYGONOFFSET weglPolygonOffset;
-typedef void (APIENTRY * WXEGLPOLYGONSTIPPLE)(const GLubyte *);
-WXE_EXTERN WXEGLPOLYGONSTIPPLE weglPolygonStipple;
-typedef void (APIENTRY * WXEGLPOPATTRIB)();
-WXE_EXTERN WXEGLPOPATTRIB weglPopAttrib;
-typedef void (APIENTRY * WXEGLPOPCLIENTATTRIB)();
-WXE_EXTERN WXEGLPOPCLIENTATTRIB weglPopClientAttrib;
-typedef void (APIENTRY * WXEGLPOPMATRIX)();
-WXE_EXTERN WXEGLPOPMATRIX weglPopMatrix;
-typedef void (APIENTRY * WXEGLPOPNAME)();
-WXE_EXTERN WXEGLPOPNAME weglPopName;
-typedef void (APIENTRY * WXEGLPRIORITIZETEXTURES)(GLsizei,const GLuint *,const GLclampf *);
-WXE_EXTERN WXEGLPRIORITIZETEXTURES weglPrioritizeTextures;
-typedef void (APIENTRY * WXEGLPUSHATTRIB)(GLbitfield);
-WXE_EXTERN WXEGLPUSHATTRIB weglPushAttrib;
-typedef void (APIENTRY * WXEGLPUSHCLIENTATTRIB)(GLbitfield);
-WXE_EXTERN WXEGLPUSHCLIENTATTRIB weglPushClientAttrib;
-typedef void (APIENTRY * WXEGLPUSHMATRIX)();
-WXE_EXTERN WXEGLPUSHMATRIX weglPushMatrix;
-typedef void (APIENTRY * WXEGLPUSHNAME)(GLuint);
-WXE_EXTERN WXEGLPUSHNAME weglPushName;
+typedef void (APIENTRY * WXEGLINDEXDV)(const GLdouble *);
+WXE_EXTERN WXEGLINDEXDV weglIndexdv;
+typedef void (APIENTRY * WXEGLINDEXFV)(const GLfloat *);
+WXE_EXTERN WXEGLINDEXFV weglIndexfv;
+typedef void (APIENTRY * WXEGLINDEXIV)(const GLint *);
+WXE_EXTERN WXEGLINDEXIV weglIndexiv;
+typedef void (APIENTRY * WXEGLINDEXSV)(const GLshort *);
+WXE_EXTERN WXEGLINDEXSV weglIndexsv;
+typedef void (APIENTRY * WXEGLINDEXUBV)(const GLubyte *);
+WXE_EXTERN WXEGLINDEXUBV weglIndexubv;
+typedef void (APIENTRY * WXEGLCOLOR3BV)(const GLbyte *);
+WXE_EXTERN WXEGLCOLOR3BV weglColor3bv;
+typedef void (APIENTRY * WXEGLCOLOR3DV)(const GLdouble *);
+WXE_EXTERN WXEGLCOLOR3DV weglColor3dv;
+typedef void (APIENTRY * WXEGLCOLOR3FV)(const GLfloat *);
+WXE_EXTERN WXEGLCOLOR3FV weglColor3fv;
+typedef void (APIENTRY * WXEGLCOLOR3IV)(const GLint *);
+WXE_EXTERN WXEGLCOLOR3IV weglColor3iv;
+typedef void (APIENTRY * WXEGLCOLOR3SV)(const GLshort *);
+WXE_EXTERN WXEGLCOLOR3SV weglColor3sv;
+typedef void (APIENTRY * WXEGLCOLOR3UBV)(const GLubyte *);
+WXE_EXTERN WXEGLCOLOR3UBV weglColor3ubv;
+typedef void (APIENTRY * WXEGLCOLOR3UIV)(const GLuint *);
+WXE_EXTERN WXEGLCOLOR3UIV weglColor3uiv;
+typedef void (APIENTRY * WXEGLCOLOR3USV)(const GLushort *);
+WXE_EXTERN WXEGLCOLOR3USV weglColor3usv;
+typedef void (APIENTRY * WXEGLCOLOR4BV)(const GLbyte *);
+WXE_EXTERN WXEGLCOLOR4BV weglColor4bv;
+typedef void (APIENTRY * WXEGLCOLOR4DV)(const GLdouble *);
+WXE_EXTERN WXEGLCOLOR4DV weglColor4dv;
+typedef void (APIENTRY * WXEGLCOLOR4FV)(const GLfloat *);
+WXE_EXTERN WXEGLCOLOR4FV weglColor4fv;
+typedef void (APIENTRY * WXEGLCOLOR4IV)(const GLint *);
+WXE_EXTERN WXEGLCOLOR4IV weglColor4iv;
+typedef void (APIENTRY * WXEGLCOLOR4SV)(const GLshort *);
+WXE_EXTERN WXEGLCOLOR4SV weglColor4sv;
+typedef void (APIENTRY * WXEGLCOLOR4UBV)(const GLubyte *);
+WXE_EXTERN WXEGLCOLOR4UBV weglColor4ubv;
+typedef void (APIENTRY * WXEGLCOLOR4UIV)(const GLuint *);
+WXE_EXTERN WXEGLCOLOR4UIV weglColor4uiv;
+typedef void (APIENTRY * WXEGLCOLOR4USV)(const GLushort *);
+WXE_EXTERN WXEGLCOLOR4USV weglColor4usv;
+typedef void (APIENTRY * WXEGLTEXCOORD1DV)(const GLdouble *);
+WXE_EXTERN WXEGLTEXCOORD1DV weglTexCoord1dv;
+typedef void (APIENTRY * WXEGLTEXCOORD1FV)(const GLfloat *);
+WXE_EXTERN WXEGLTEXCOORD1FV weglTexCoord1fv;
+typedef void (APIENTRY * WXEGLTEXCOORD1IV)(const GLint *);
+WXE_EXTERN WXEGLTEXCOORD1IV weglTexCoord1iv;
+typedef void (APIENTRY * WXEGLTEXCOORD1SV)(const GLshort *);
+WXE_EXTERN WXEGLTEXCOORD1SV weglTexCoord1sv;
+typedef void (APIENTRY * WXEGLTEXCOORD2DV)(const GLdouble *);
+WXE_EXTERN WXEGLTEXCOORD2DV weglTexCoord2dv;
+typedef void (APIENTRY * WXEGLTEXCOORD2FV)(const GLfloat *);
+WXE_EXTERN WXEGLTEXCOORD2FV weglTexCoord2fv;
+typedef void (APIENTRY * WXEGLTEXCOORD2IV)(const GLint *);
+WXE_EXTERN WXEGLTEXCOORD2IV weglTexCoord2iv;
+typedef void (APIENTRY * WXEGLTEXCOORD2SV)(const GLshort *);
+WXE_EXTERN WXEGLTEXCOORD2SV weglTexCoord2sv;
+typedef void (APIENTRY * WXEGLTEXCOORD3DV)(const GLdouble *);
+WXE_EXTERN WXEGLTEXCOORD3DV weglTexCoord3dv;
+typedef void (APIENTRY * WXEGLTEXCOORD3FV)(const GLfloat *);
+WXE_EXTERN WXEGLTEXCOORD3FV weglTexCoord3fv;
+typedef void (APIENTRY * WXEGLTEXCOORD3IV)(const GLint *);
+WXE_EXTERN WXEGLTEXCOORD3IV weglTexCoord3iv;
+typedef void (APIENTRY * WXEGLTEXCOORD3SV)(const GLshort *);
+WXE_EXTERN WXEGLTEXCOORD3SV weglTexCoord3sv;
+typedef void (APIENTRY * WXEGLTEXCOORD4DV)(const GLdouble *);
+WXE_EXTERN WXEGLTEXCOORD4DV weglTexCoord4dv;
+typedef void (APIENTRY * WXEGLTEXCOORD4FV)(const GLfloat *);
+WXE_EXTERN WXEGLTEXCOORD4FV weglTexCoord4fv;
+typedef void (APIENTRY * WXEGLTEXCOORD4IV)(const GLint *);
+WXE_EXTERN WXEGLTEXCOORD4IV weglTexCoord4iv;
+typedef void (APIENTRY * WXEGLTEXCOORD4SV)(const GLshort *);
+WXE_EXTERN WXEGLTEXCOORD4SV weglTexCoord4sv;
typedef void (APIENTRY * WXEGLRASTERPOS2DV)(const GLdouble *);
WXE_EXTERN WXEGLRASTERPOS2DV weglRasterPos2dv;
typedef void (APIENTRY * WXEGLRASTERPOS2FV)(const GLfloat *);
@@ -415,150 +313,252 @@ typedef void (APIENTRY * WXEGLRASTERPOS4IV)(const GLint *);
WXE_EXTERN WXEGLRASTERPOS4IV weglRasterPos4iv;
typedef void (APIENTRY * WXEGLRASTERPOS4SV)(const GLshort *);
WXE_EXTERN WXEGLRASTERPOS4SV weglRasterPos4sv;
-typedef void (APIENTRY * WXEGLREADBUFFER)(GLenum);
-WXE_EXTERN WXEGLREADBUFFER weglReadBuffer;
-typedef void (APIENTRY * WXEGLREADPIXELS)(GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,GLvoid *);
-WXE_EXTERN WXEGLREADPIXELS weglReadPixels;
typedef void (APIENTRY * WXEGLRECTD)(GLdouble,GLdouble,GLdouble,GLdouble);
WXE_EXTERN WXEGLRECTD weglRectd;
-typedef void (APIENTRY * WXEGLRECTDV)(const GLdouble *,const GLdouble *);
-WXE_EXTERN WXEGLRECTDV weglRectdv;
typedef void (APIENTRY * WXEGLRECTF)(GLfloat,GLfloat,GLfloat,GLfloat);
WXE_EXTERN WXEGLRECTF weglRectf;
-typedef void (APIENTRY * WXEGLRECTFV)(const GLfloat *,const GLfloat *);
-WXE_EXTERN WXEGLRECTFV weglRectfv;
typedef void (APIENTRY * WXEGLRECTI)(GLint,GLint,GLint,GLint);
WXE_EXTERN WXEGLRECTI weglRecti;
-typedef void (APIENTRY * WXEGLRECTIV)(const GLint *,const GLint *);
-WXE_EXTERN WXEGLRECTIV weglRectiv;
typedef void (APIENTRY * WXEGLRECTS)(GLshort,GLshort,GLshort,GLshort);
WXE_EXTERN WXEGLRECTS weglRects;
+typedef void (APIENTRY * WXEGLRECTDV)(const GLdouble *,const GLdouble *);
+WXE_EXTERN WXEGLRECTDV weglRectdv;
+typedef void (APIENTRY * WXEGLRECTFV)(const GLfloat *,const GLfloat *);
+WXE_EXTERN WXEGLRECTFV weglRectfv;
+typedef void (APIENTRY * WXEGLRECTIV)(const GLint *,const GLint *);
+WXE_EXTERN WXEGLRECTIV weglRectiv;
typedef void (APIENTRY * WXEGLRECTSV)(const GLshort *,const GLshort *);
WXE_EXTERN WXEGLRECTSV weglRectsv;
-typedef GLint (APIENTRY * WXEGLRENDERMODE)(GLenum);
-WXE_EXTERN WXEGLRENDERMODE weglRenderMode;
-typedef void (APIENTRY * WXEGLROTATED)(GLdouble,GLdouble,GLdouble,GLdouble);
-WXE_EXTERN WXEGLROTATED weglRotated;
-typedef void (APIENTRY * WXEGLROTATEF)(GLfloat,GLfloat,GLfloat,GLfloat);
-WXE_EXTERN WXEGLROTATEF weglRotatef;
-typedef void (APIENTRY * WXEGLSCALED)(GLdouble,GLdouble,GLdouble);
-WXE_EXTERN WXEGLSCALED weglScaled;
-typedef void (APIENTRY * WXEGLSCALEF)(GLfloat,GLfloat,GLfloat);
-WXE_EXTERN WXEGLSCALEF weglScalef;
-typedef void (APIENTRY * WXEGLSCISSOR)(GLint,GLint,GLsizei,GLsizei);
-WXE_EXTERN WXEGLSCISSOR weglScissor;
-typedef void (APIENTRY * WXEGLSELECTBUFFER)(GLsizei,GLuint *);
-WXE_EXTERN WXEGLSELECTBUFFER weglSelectBuffer;
+typedef void (APIENTRY * WXEGLVERTEXPOINTER)(GLint,GLenum,GLsizei,const GLvoid *);
+WXE_EXTERN WXEGLVERTEXPOINTER weglVertexPointer;
+typedef void (APIENTRY * WXEGLNORMALPOINTER)(GLenum,GLsizei,const GLvoid *);
+WXE_EXTERN WXEGLNORMALPOINTER weglNormalPointer;
+typedef void (APIENTRY * WXEGLCOLORPOINTER)(GLint,GLenum,GLsizei,const GLvoid *);
+WXE_EXTERN WXEGLCOLORPOINTER weglColorPointer;
+typedef void (APIENTRY * WXEGLINDEXPOINTER)(GLenum,GLsizei,const GLvoid *);
+WXE_EXTERN WXEGLINDEXPOINTER weglIndexPointer;
+typedef void (APIENTRY * WXEGLTEXCOORDPOINTER)(GLint,GLenum,GLsizei,const GLvoid *);
+WXE_EXTERN WXEGLTEXCOORDPOINTER weglTexCoordPointer;
+typedef void (APIENTRY * WXEGLEDGEFLAGPOINTER)(GLsizei,const GLvoid *);
+WXE_EXTERN WXEGLEDGEFLAGPOINTER weglEdgeFlagPointer;
+typedef void (APIENTRY * WXEGLARRAYELEMENT)(GLint);
+WXE_EXTERN WXEGLARRAYELEMENT weglArrayElement;
+typedef void (APIENTRY * WXEGLDRAWARRAYS)(GLenum,GLint,GLsizei);
+WXE_EXTERN WXEGLDRAWARRAYS weglDrawArrays;
+typedef void (APIENTRY * WXEGLDRAWELEMENTS)(GLenum,GLsizei,GLenum,const GLvoid *);
+WXE_EXTERN WXEGLDRAWELEMENTS weglDrawElements;
+typedef void (APIENTRY * WXEGLINTERLEAVEDARRAYS)(GLenum,GLsizei,const GLvoid *);
+WXE_EXTERN WXEGLINTERLEAVEDARRAYS weglInterleavedArrays;
typedef void (APIENTRY * WXEGLSHADEMODEL)(GLenum);
WXE_EXTERN WXEGLSHADEMODEL weglShadeModel;
+typedef void (APIENTRY * WXEGLLIGHTF)(GLenum,GLenum,GLfloat);
+WXE_EXTERN WXEGLLIGHTF weglLightf;
+typedef void (APIENTRY * WXEGLLIGHTI)(GLenum,GLenum,GLint);
+WXE_EXTERN WXEGLLIGHTI weglLighti;
+typedef void (APIENTRY * WXEGLLIGHTFV)(GLenum,GLenum,const GLfloat *);
+WXE_EXTERN WXEGLLIGHTFV weglLightfv;
+typedef void (APIENTRY * WXEGLLIGHTIV)(GLenum,GLenum,const GLint *);
+WXE_EXTERN WXEGLLIGHTIV weglLightiv;
+typedef void (APIENTRY * WXEGLGETLIGHTFV)(GLenum,GLenum,GLfloat *);
+WXE_EXTERN WXEGLGETLIGHTFV weglGetLightfv;
+typedef void (APIENTRY * WXEGLGETLIGHTIV)(GLenum,GLenum,GLint *);
+WXE_EXTERN WXEGLGETLIGHTIV weglGetLightiv;
+typedef void (APIENTRY * WXEGLLIGHTMODELF)(GLenum,GLfloat);
+WXE_EXTERN WXEGLLIGHTMODELF weglLightModelf;
+typedef void (APIENTRY * WXEGLLIGHTMODELI)(GLenum,GLint);
+WXE_EXTERN WXEGLLIGHTMODELI weglLightModeli;
+typedef void (APIENTRY * WXEGLLIGHTMODELFV)(GLenum,const GLfloat *);
+WXE_EXTERN WXEGLLIGHTMODELFV weglLightModelfv;
+typedef void (APIENTRY * WXEGLLIGHTMODELIV)(GLenum,const GLint *);
+WXE_EXTERN WXEGLLIGHTMODELIV weglLightModeliv;
+typedef void (APIENTRY * WXEGLMATERIALF)(GLenum,GLenum,GLfloat);
+WXE_EXTERN WXEGLMATERIALF weglMaterialf;
+typedef void (APIENTRY * WXEGLMATERIALI)(GLenum,GLenum,GLint);
+WXE_EXTERN WXEGLMATERIALI weglMateriali;
+typedef void (APIENTRY * WXEGLMATERIALFV)(GLenum,GLenum,const GLfloat *);
+WXE_EXTERN WXEGLMATERIALFV weglMaterialfv;
+typedef void (APIENTRY * WXEGLMATERIALIV)(GLenum,GLenum,const GLint *);
+WXE_EXTERN WXEGLMATERIALIV weglMaterialiv;
+typedef void (APIENTRY * WXEGLGETMATERIALFV)(GLenum,GLenum,GLfloat *);
+WXE_EXTERN WXEGLGETMATERIALFV weglGetMaterialfv;
+typedef void (APIENTRY * WXEGLGETMATERIALIV)(GLenum,GLenum,GLint *);
+WXE_EXTERN WXEGLGETMATERIALIV weglGetMaterialiv;
+typedef void (APIENTRY * WXEGLCOLORMATERIAL)(GLenum,GLenum);
+WXE_EXTERN WXEGLCOLORMATERIAL weglColorMaterial;
+typedef void (APIENTRY * WXEGLPIXELZOOM)(GLfloat,GLfloat);
+WXE_EXTERN WXEGLPIXELZOOM weglPixelZoom;
+typedef void (APIENTRY * WXEGLPIXELSTOREF)(GLenum,GLfloat);
+WXE_EXTERN WXEGLPIXELSTOREF weglPixelStoref;
+typedef void (APIENTRY * WXEGLPIXELSTOREI)(GLenum,GLint);
+WXE_EXTERN WXEGLPIXELSTOREI weglPixelStorei;
+typedef void (APIENTRY * WXEGLPIXELTRANSFERF)(GLenum,GLfloat);
+WXE_EXTERN WXEGLPIXELTRANSFERF weglPixelTransferf;
+typedef void (APIENTRY * WXEGLPIXELTRANSFERI)(GLenum,GLint);
+WXE_EXTERN WXEGLPIXELTRANSFERI weglPixelTransferi;
+typedef void (APIENTRY * WXEGLPIXELMAPFV)(GLenum,GLsizei,const GLfloat *);
+WXE_EXTERN WXEGLPIXELMAPFV weglPixelMapfv;
+typedef void (APIENTRY * WXEGLPIXELMAPUIV)(GLenum,GLsizei,const GLuint *);
+WXE_EXTERN WXEGLPIXELMAPUIV weglPixelMapuiv;
+typedef void (APIENTRY * WXEGLPIXELMAPUSV)(GLenum,GLsizei,const GLushort *);
+WXE_EXTERN WXEGLPIXELMAPUSV weglPixelMapusv;
+typedef void (APIENTRY * WXEGLGETPIXELMAPFV)(GLenum,GLfloat *);
+WXE_EXTERN WXEGLGETPIXELMAPFV weglGetPixelMapfv;
+typedef void (APIENTRY * WXEGLGETPIXELMAPUIV)(GLenum,GLuint *);
+WXE_EXTERN WXEGLGETPIXELMAPUIV weglGetPixelMapuiv;
+typedef void (APIENTRY * WXEGLGETPIXELMAPUSV)(GLenum,GLushort *);
+WXE_EXTERN WXEGLGETPIXELMAPUSV weglGetPixelMapusv;
+typedef void (APIENTRY * WXEGLBITMAP)(GLsizei,GLsizei,GLfloat,GLfloat,GLfloat,GLfloat,const GLubyte *);
+WXE_EXTERN WXEGLBITMAP weglBitmap;
+typedef void (APIENTRY * WXEGLREADPIXELS)(GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,GLvoid *);
+WXE_EXTERN WXEGLREADPIXELS weglReadPixels;
+typedef void (APIENTRY * WXEGLDRAWPIXELS)(GLsizei,GLsizei,GLenum,GLenum,const GLvoid *);
+WXE_EXTERN WXEGLDRAWPIXELS weglDrawPixels;
+typedef void (APIENTRY * WXEGLCOPYPIXELS)(GLint,GLint,GLsizei,GLsizei,GLenum);
+WXE_EXTERN WXEGLCOPYPIXELS weglCopyPixels;
typedef void (APIENTRY * WXEGLSTENCILFUNC)(GLenum,GLint,GLuint);
WXE_EXTERN WXEGLSTENCILFUNC weglStencilFunc;
typedef void (APIENTRY * WXEGLSTENCILMASK)(GLuint);
WXE_EXTERN WXEGLSTENCILMASK weglStencilMask;
typedef void (APIENTRY * WXEGLSTENCILOP)(GLenum,GLenum,GLenum);
WXE_EXTERN WXEGLSTENCILOP weglStencilOp;
-typedef void (APIENTRY * WXEGLTEXCOORD1DV)(const GLdouble *);
-WXE_EXTERN WXEGLTEXCOORD1DV weglTexCoord1dv;
-typedef void (APIENTRY * WXEGLTEXCOORD1FV)(const GLfloat *);
-WXE_EXTERN WXEGLTEXCOORD1FV weglTexCoord1fv;
-typedef void (APIENTRY * WXEGLTEXCOORD1IV)(const GLint *);
-WXE_EXTERN WXEGLTEXCOORD1IV weglTexCoord1iv;
-typedef void (APIENTRY * WXEGLTEXCOORD1SV)(const GLshort *);
-WXE_EXTERN WXEGLTEXCOORD1SV weglTexCoord1sv;
-typedef void (APIENTRY * WXEGLTEXCOORD2DV)(const GLdouble *);
-WXE_EXTERN WXEGLTEXCOORD2DV weglTexCoord2dv;
-typedef void (APIENTRY * WXEGLTEXCOORD2FV)(const GLfloat *);
-WXE_EXTERN WXEGLTEXCOORD2FV weglTexCoord2fv;
-typedef void (APIENTRY * WXEGLTEXCOORD2IV)(const GLint *);
-WXE_EXTERN WXEGLTEXCOORD2IV weglTexCoord2iv;
-typedef void (APIENTRY * WXEGLTEXCOORD2SV)(const GLshort *);
-WXE_EXTERN WXEGLTEXCOORD2SV weglTexCoord2sv;
-typedef void (APIENTRY * WXEGLTEXCOORD3DV)(const GLdouble *);
-WXE_EXTERN WXEGLTEXCOORD3DV weglTexCoord3dv;
-typedef void (APIENTRY * WXEGLTEXCOORD3FV)(const GLfloat *);
-WXE_EXTERN WXEGLTEXCOORD3FV weglTexCoord3fv;
-typedef void (APIENTRY * WXEGLTEXCOORD3IV)(const GLint *);
-WXE_EXTERN WXEGLTEXCOORD3IV weglTexCoord3iv;
-typedef void (APIENTRY * WXEGLTEXCOORD3SV)(const GLshort *);
-WXE_EXTERN WXEGLTEXCOORD3SV weglTexCoord3sv;
-typedef void (APIENTRY * WXEGLTEXCOORD4DV)(const GLdouble *);
-WXE_EXTERN WXEGLTEXCOORD4DV weglTexCoord4dv;
-typedef void (APIENTRY * WXEGLTEXCOORD4FV)(const GLfloat *);
-WXE_EXTERN WXEGLTEXCOORD4FV weglTexCoord4fv;
-typedef void (APIENTRY * WXEGLTEXCOORD4IV)(const GLint *);
-WXE_EXTERN WXEGLTEXCOORD4IV weglTexCoord4iv;
-typedef void (APIENTRY * WXEGLTEXCOORD4SV)(const GLshort *);
-WXE_EXTERN WXEGLTEXCOORD4SV weglTexCoord4sv;
-typedef void (APIENTRY * WXEGLTEXCOORDPOINTER)(GLint,GLenum,GLsizei,const GLvoid *);
-WXE_EXTERN WXEGLTEXCOORDPOINTER weglTexCoordPointer;
-typedef void (APIENTRY * WXEGLTEXENVF)(GLenum,GLenum,GLfloat);
-WXE_EXTERN WXEGLTEXENVF weglTexEnvf;
-typedef void (APIENTRY * WXEGLTEXENVFV)(GLenum,GLenum,const GLfloat *);
-WXE_EXTERN WXEGLTEXENVFV weglTexEnvfv;
-typedef void (APIENTRY * WXEGLTEXENVI)(GLenum,GLenum,GLint);
-WXE_EXTERN WXEGLTEXENVI weglTexEnvi;
-typedef void (APIENTRY * WXEGLTEXENVIV)(GLenum,GLenum,const GLint *);
-WXE_EXTERN WXEGLTEXENVIV weglTexEnviv;
+typedef void (APIENTRY * WXEGLCLEARSTENCIL)(GLint);
+WXE_EXTERN WXEGLCLEARSTENCIL weglClearStencil;
typedef void (APIENTRY * WXEGLTEXGEND)(GLenum,GLenum,GLdouble);
WXE_EXTERN WXEGLTEXGEND weglTexGend;
-typedef void (APIENTRY * WXEGLTEXGENDV)(GLenum,GLenum,const GLdouble *);
-WXE_EXTERN WXEGLTEXGENDV weglTexGendv;
typedef void (APIENTRY * WXEGLTEXGENF)(GLenum,GLenum,GLfloat);
WXE_EXTERN WXEGLTEXGENF weglTexGenf;
-typedef void (APIENTRY * WXEGLTEXGENFV)(GLenum,GLenum,const GLfloat *);
-WXE_EXTERN WXEGLTEXGENFV weglTexGenfv;
typedef void (APIENTRY * WXEGLTEXGENI)(GLenum,GLenum,GLint);
WXE_EXTERN WXEGLTEXGENI weglTexGeni;
+typedef void (APIENTRY * WXEGLTEXGENDV)(GLenum,GLenum,const GLdouble *);
+WXE_EXTERN WXEGLTEXGENDV weglTexGendv;
+typedef void (APIENTRY * WXEGLTEXGENFV)(GLenum,GLenum,const GLfloat *);
+WXE_EXTERN WXEGLTEXGENFV weglTexGenfv;
typedef void (APIENTRY * WXEGLTEXGENIV)(GLenum,GLenum,const GLint *);
WXE_EXTERN WXEGLTEXGENIV weglTexGeniv;
-typedef void (APIENTRY * WXEGLTEXIMAGE1D)(GLenum,GLint,GLint,GLsizei,GLint,GLenum,GLenum,const GLvoid *);
-WXE_EXTERN WXEGLTEXIMAGE1D weglTexImage1D;
-typedef void (APIENTRY * WXEGLTEXIMAGE2D)(GLenum,GLint,GLint,GLsizei,GLsizei,GLint,GLenum,GLenum,const GLvoid *);
-WXE_EXTERN WXEGLTEXIMAGE2D weglTexImage2D;
+typedef void (APIENTRY * WXEGLGETTEXGENDV)(GLenum,GLenum,GLdouble *);
+WXE_EXTERN WXEGLGETTEXGENDV weglGetTexGendv;
+typedef void (APIENTRY * WXEGLGETTEXGENFV)(GLenum,GLenum,GLfloat *);
+WXE_EXTERN WXEGLGETTEXGENFV weglGetTexGenfv;
+typedef void (APIENTRY * WXEGLGETTEXGENIV)(GLenum,GLenum,GLint *);
+WXE_EXTERN WXEGLGETTEXGENIV weglGetTexGeniv;
+typedef void (APIENTRY * WXEGLTEXENVF)(GLenum,GLenum,GLfloat);
+WXE_EXTERN WXEGLTEXENVF weglTexEnvf;
+typedef void (APIENTRY * WXEGLTEXENVI)(GLenum,GLenum,GLint);
+WXE_EXTERN WXEGLTEXENVI weglTexEnvi;
+typedef void (APIENTRY * WXEGLTEXENVFV)(GLenum,GLenum,const GLfloat *);
+WXE_EXTERN WXEGLTEXENVFV weglTexEnvfv;
+typedef void (APIENTRY * WXEGLTEXENVIV)(GLenum,GLenum,const GLint *);
+WXE_EXTERN WXEGLTEXENVIV weglTexEnviv;
+typedef void (APIENTRY * WXEGLGETTEXENVFV)(GLenum,GLenum,GLfloat *);
+WXE_EXTERN WXEGLGETTEXENVFV weglGetTexEnvfv;
+typedef void (APIENTRY * WXEGLGETTEXENVIV)(GLenum,GLenum,GLint *);
+WXE_EXTERN WXEGLGETTEXENVIV weglGetTexEnviv;
typedef void (APIENTRY * WXEGLTEXPARAMETERF)(GLenum,GLenum,GLfloat);
WXE_EXTERN WXEGLTEXPARAMETERF weglTexParameterf;
-typedef void (APIENTRY * WXEGLTEXPARAMETERFV)(GLenum,GLenum,const GLfloat *);
-WXE_EXTERN WXEGLTEXPARAMETERFV weglTexParameterfv;
typedef void (APIENTRY * WXEGLTEXPARAMETERI)(GLenum,GLenum,GLint);
WXE_EXTERN WXEGLTEXPARAMETERI weglTexParameteri;
+typedef void (APIENTRY * WXEGLTEXPARAMETERFV)(GLenum,GLenum,const GLfloat *);
+WXE_EXTERN WXEGLTEXPARAMETERFV weglTexParameterfv;
typedef void (APIENTRY * WXEGLTEXPARAMETERIV)(GLenum,GLenum,const GLint *);
WXE_EXTERN WXEGLTEXPARAMETERIV weglTexParameteriv;
+typedef void (APIENTRY * WXEGLGETTEXPARAMETERFV)(GLenum,GLenum,GLfloat *);
+WXE_EXTERN WXEGLGETTEXPARAMETERFV weglGetTexParameterfv;
+typedef void (APIENTRY * WXEGLGETTEXPARAMETERIV)(GLenum,GLenum,GLint *);
+WXE_EXTERN WXEGLGETTEXPARAMETERIV weglGetTexParameteriv;
+typedef void (APIENTRY * WXEGLGETTEXLEVELPARAMETERFV)(GLenum,GLint,GLenum,GLfloat *);
+WXE_EXTERN WXEGLGETTEXLEVELPARAMETERFV weglGetTexLevelParameterfv;
+typedef void (APIENTRY * WXEGLGETTEXLEVELPARAMETERIV)(GLenum,GLint,GLenum,GLint *);
+WXE_EXTERN WXEGLGETTEXLEVELPARAMETERIV weglGetTexLevelParameteriv;
+typedef void (APIENTRY * WXEGLTEXIMAGE1D)(GLenum,GLint,GLint,GLsizei,GLint,GLenum,GLenum,const GLvoid *);
+WXE_EXTERN WXEGLTEXIMAGE1D weglTexImage1D;
+typedef void (APIENTRY * WXEGLTEXIMAGE2D)(GLenum,GLint,GLint,GLsizei,GLsizei,GLint,GLenum,GLenum,const GLvoid *);
+WXE_EXTERN WXEGLTEXIMAGE2D weglTexImage2D;
+typedef void (APIENTRY * WXEGLGETTEXIMAGE)(GLenum,GLint,GLenum,GLenum,GLvoid *);
+WXE_EXTERN WXEGLGETTEXIMAGE weglGetTexImage;
+typedef void (APIENTRY * WXEGLGENTEXTURES)(GLsizei,GLuint *);
+WXE_EXTERN WXEGLGENTEXTURES weglGenTextures;
+typedef void (APIENTRY * WXEGLDELETETEXTURES)(GLsizei,const GLuint *);
+WXE_EXTERN WXEGLDELETETEXTURES weglDeleteTextures;
+typedef void (APIENTRY * WXEGLBINDTEXTURE)(GLenum,GLuint);
+WXE_EXTERN WXEGLBINDTEXTURE weglBindTexture;
+typedef void (APIENTRY * WXEGLPRIORITIZETEXTURES)(GLsizei,const GLuint *,const GLclampf *);
+WXE_EXTERN WXEGLPRIORITIZETEXTURES weglPrioritizeTextures;
+typedef GLboolean (APIENTRY * WXEGLARETEXTURESRESIDENT)(GLsizei,const GLuint *,GLboolean *);
+WXE_EXTERN WXEGLARETEXTURESRESIDENT weglAreTexturesResident;
+typedef GLboolean (APIENTRY * WXEGLISTEXTURE)(GLuint);
+WXE_EXTERN WXEGLISTEXTURE weglIsTexture;
typedef void (APIENTRY * WXEGLTEXSUBIMAGE1D)(GLenum,GLint,GLint,GLsizei,GLenum,GLenum,const GLvoid *);
WXE_EXTERN WXEGLTEXSUBIMAGE1D weglTexSubImage1D;
typedef void (APIENTRY * WXEGLTEXSUBIMAGE2D)(GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,const GLvoid *);
WXE_EXTERN WXEGLTEXSUBIMAGE2D weglTexSubImage2D;
-typedef void (APIENTRY * WXEGLTRANSLATED)(GLdouble,GLdouble,GLdouble);
-WXE_EXTERN WXEGLTRANSLATED weglTranslated;
-typedef void (APIENTRY * WXEGLTRANSLATEF)(GLfloat,GLfloat,GLfloat);
-WXE_EXTERN WXEGLTRANSLATEF weglTranslatef;
-typedef void (APIENTRY * WXEGLVERTEX2DV)(const GLdouble *);
-WXE_EXTERN WXEGLVERTEX2DV weglVertex2dv;
-typedef void (APIENTRY * WXEGLVERTEX2FV)(const GLfloat *);
-WXE_EXTERN WXEGLVERTEX2FV weglVertex2fv;
-typedef void (APIENTRY * WXEGLVERTEX2IV)(const GLint *);
-WXE_EXTERN WXEGLVERTEX2IV weglVertex2iv;
-typedef void (APIENTRY * WXEGLVERTEX2SV)(const GLshort *);
-WXE_EXTERN WXEGLVERTEX2SV weglVertex2sv;
-typedef void (APIENTRY * WXEGLVERTEX3DV)(const GLdouble *);
-WXE_EXTERN WXEGLVERTEX3DV weglVertex3dv;
-typedef void (APIENTRY * WXEGLVERTEX3FV)(const GLfloat *);
-WXE_EXTERN WXEGLVERTEX3FV weglVertex3fv;
-typedef void (APIENTRY * WXEGLVERTEX3IV)(const GLint *);
-WXE_EXTERN WXEGLVERTEX3IV weglVertex3iv;
-typedef void (APIENTRY * WXEGLVERTEX3SV)(const GLshort *);
-WXE_EXTERN WXEGLVERTEX3SV weglVertex3sv;
-typedef void (APIENTRY * WXEGLVERTEX4DV)(const GLdouble *);
-WXE_EXTERN WXEGLVERTEX4DV weglVertex4dv;
-typedef void (APIENTRY * WXEGLVERTEX4FV)(const GLfloat *);
-WXE_EXTERN WXEGLVERTEX4FV weglVertex4fv;
-typedef void (APIENTRY * WXEGLVERTEX4IV)(const GLint *);
-WXE_EXTERN WXEGLVERTEX4IV weglVertex4iv;
-typedef void (APIENTRY * WXEGLVERTEX4SV)(const GLshort *);
-WXE_EXTERN WXEGLVERTEX4SV weglVertex4sv;
-typedef void (APIENTRY * WXEGLVERTEXPOINTER)(GLint,GLenum,GLsizei,const GLvoid *);
-WXE_EXTERN WXEGLVERTEXPOINTER weglVertexPointer;
-typedef void (APIENTRY * WXEGLVIEWPORT)(GLint,GLint,GLsizei,GLsizei);
-WXE_EXTERN WXEGLVIEWPORT weglViewport;
+typedef void (APIENTRY * WXEGLCOPYTEXIMAGE1D)(GLenum,GLint,GLenum,GLint,GLint,GLsizei,GLint);
+WXE_EXTERN WXEGLCOPYTEXIMAGE1D weglCopyTexImage1D;
+typedef void (APIENTRY * WXEGLCOPYTEXIMAGE2D)(GLenum,GLint,GLenum,GLint,GLint,GLsizei,GLsizei,GLint);
+WXE_EXTERN WXEGLCOPYTEXIMAGE2D weglCopyTexImage2D;
+typedef void (APIENTRY * WXEGLCOPYTEXSUBIMAGE1D)(GLenum,GLint,GLint,GLint,GLint,GLsizei);
+WXE_EXTERN WXEGLCOPYTEXSUBIMAGE1D weglCopyTexSubImage1D;
+typedef void (APIENTRY * WXEGLCOPYTEXSUBIMAGE2D)(GLenum,GLint,GLint,GLint,GLint,GLint,GLsizei,GLsizei);
+WXE_EXTERN WXEGLCOPYTEXSUBIMAGE2D weglCopyTexSubImage2D;
+typedef void (APIENTRY * WXEGLMAP1D)(GLenum,GLdouble,GLdouble,GLint,GLint,const GLdouble *);
+WXE_EXTERN WXEGLMAP1D weglMap1d;
+typedef void (APIENTRY * WXEGLMAP1F)(GLenum,GLfloat,GLfloat,GLint,GLint,const GLfloat *);
+WXE_EXTERN WXEGLMAP1F weglMap1f;
+typedef void (APIENTRY * WXEGLMAP2D)(GLenum,GLdouble,GLdouble,GLint,GLint,GLdouble,GLdouble,GLint,GLint,const GLdouble *);
+WXE_EXTERN WXEGLMAP2D weglMap2d;
+typedef void (APIENTRY * WXEGLMAP2F)(GLenum,GLfloat,GLfloat,GLint,GLint,GLfloat,GLfloat,GLint,GLint,const GLfloat *);
+WXE_EXTERN WXEGLMAP2F weglMap2f;
+typedef void (APIENTRY * WXEGLGETMAPDV)(GLenum,GLenum,GLdouble *);
+WXE_EXTERN WXEGLGETMAPDV weglGetMapdv;
+typedef void (APIENTRY * WXEGLGETMAPFV)(GLenum,GLenum,GLfloat *);
+WXE_EXTERN WXEGLGETMAPFV weglGetMapfv;
+typedef void (APIENTRY * WXEGLGETMAPIV)(GLenum,GLenum,GLint *);
+WXE_EXTERN WXEGLGETMAPIV weglGetMapiv;
+typedef void (APIENTRY * WXEGLEVALCOORD1DV)(const GLdouble *);
+WXE_EXTERN WXEGLEVALCOORD1DV weglEvalCoord1dv;
+typedef void (APIENTRY * WXEGLEVALCOORD1FV)(const GLfloat *);
+WXE_EXTERN WXEGLEVALCOORD1FV weglEvalCoord1fv;
+typedef void (APIENTRY * WXEGLEVALCOORD2DV)(const GLdouble *);
+WXE_EXTERN WXEGLEVALCOORD2DV weglEvalCoord2dv;
+typedef void (APIENTRY * WXEGLEVALCOORD2FV)(const GLfloat *);
+WXE_EXTERN WXEGLEVALCOORD2FV weglEvalCoord2fv;
+typedef void (APIENTRY * WXEGLMAPGRID1D)(GLint,GLdouble,GLdouble);
+WXE_EXTERN WXEGLMAPGRID1D weglMapGrid1d;
+typedef void (APIENTRY * WXEGLMAPGRID1F)(GLint,GLfloat,GLfloat);
+WXE_EXTERN WXEGLMAPGRID1F weglMapGrid1f;
+typedef void (APIENTRY * WXEGLMAPGRID2D)(GLint,GLdouble,GLdouble,GLint,GLdouble,GLdouble);
+WXE_EXTERN WXEGLMAPGRID2D weglMapGrid2d;
+typedef void (APIENTRY * WXEGLMAPGRID2F)(GLint,GLfloat,GLfloat,GLint,GLfloat,GLfloat);
+WXE_EXTERN WXEGLMAPGRID2F weglMapGrid2f;
+typedef void (APIENTRY * WXEGLEVALPOINT1)(GLint);
+WXE_EXTERN WXEGLEVALPOINT1 weglEvalPoint1;
+typedef void (APIENTRY * WXEGLEVALPOINT2)(GLint,GLint);
+WXE_EXTERN WXEGLEVALPOINT2 weglEvalPoint2;
+typedef void (APIENTRY * WXEGLEVALMESH1)(GLenum,GLint,GLint);
+WXE_EXTERN WXEGLEVALMESH1 weglEvalMesh1;
+typedef void (APIENTRY * WXEGLEVALMESH2)(GLenum,GLint,GLint,GLint,GLint);
+WXE_EXTERN WXEGLEVALMESH2 weglEvalMesh2;
+typedef void (APIENTRY * WXEGLFOGF)(GLenum,GLfloat);
+WXE_EXTERN WXEGLFOGF weglFogf;
+typedef void (APIENTRY * WXEGLFOGI)(GLenum,GLint);
+WXE_EXTERN WXEGLFOGI weglFogi;
+typedef void (APIENTRY * WXEGLFOGFV)(GLenum,const GLfloat *);
+WXE_EXTERN WXEGLFOGFV weglFogfv;
+typedef void (APIENTRY * WXEGLFOGIV)(GLenum,const GLint *);
+WXE_EXTERN WXEGLFOGIV weglFogiv;
+typedef void (APIENTRY * WXEGLFEEDBACKBUFFER)(GLsizei,GLenum,GLfloat *);
+WXE_EXTERN WXEGLFEEDBACKBUFFER weglFeedbackBuffer;
+typedef void (APIENTRY * WXEGLPASSTHROUGH)(GLfloat);
+WXE_EXTERN WXEGLPASSTHROUGH weglPassThrough;
+typedef void (APIENTRY * WXEGLSELECTBUFFER)(GLsizei,GLuint *);
+WXE_EXTERN WXEGLSELECTBUFFER weglSelectBuffer;
+typedef void (APIENTRY * WXEGLINITNAMES)();
+WXE_EXTERN WXEGLINITNAMES weglInitNames;
+typedef void (APIENTRY * WXEGLLOADNAME)(GLuint);
+WXE_EXTERN WXEGLLOADNAME weglLoadName;
+typedef void (APIENTRY * WXEGLPUSHNAME)(GLuint);
+WXE_EXTERN WXEGLPUSHNAME weglPushName;
+typedef void (APIENTRY * WXEGLPOPNAME)();
+WXE_EXTERN WXEGLPOPNAME weglPopName;
typedef void (APIENTRY * WXEGLBLENDCOLOR)(GLclampf,GLclampf,GLclampf,GLclampf);
WXE_EXTERN WXEGLBLENDCOLOR weglBlendColor;
typedef void (APIENTRY * WXEGLBLENDEQUATION)(GLenum);
@@ -681,13 +681,13 @@ typedef void (APIENTRY * WXEGLMULTITEXCOORD4IV)(GLenum,const GLint *);
WXE_EXTERN WXEGLMULTITEXCOORD4IV weglMultiTexCoord4iv;
typedef void (APIENTRY * WXEGLMULTITEXCOORD4SV)(GLenum,const GLshort *);
WXE_EXTERN WXEGLMULTITEXCOORD4SV weglMultiTexCoord4sv;
-typedef void (APIENTRY * WXEGLLOADTRANSPOSEMATRIXF)(const GLfloat *);
+typedef void (APIENTRY * WXEGLLOADTRANSPOSEMATRIXF)(const GLfloat m[16]);
WXE_EXTERN WXEGLLOADTRANSPOSEMATRIXF weglLoadTransposeMatrixf;
-typedef void (APIENTRY * WXEGLLOADTRANSPOSEMATRIXD)(const GLdouble *);
+typedef void (APIENTRY * WXEGLLOADTRANSPOSEMATRIXD)(const GLdouble m[16]);
WXE_EXTERN WXEGLLOADTRANSPOSEMATRIXD weglLoadTransposeMatrixd;
-typedef void (APIENTRY * WXEGLMULTTRANSPOSEMATRIXF)(const GLfloat *);
+typedef void (APIENTRY * WXEGLMULTTRANSPOSEMATRIXF)(const GLfloat m[16]);
WXE_EXTERN WXEGLMULTTRANSPOSEMATRIXF weglMultTransposeMatrixf;
-typedef void (APIENTRY * WXEGLMULTTRANSPOSEMATRIXD)(const GLdouble *);
+typedef void (APIENTRY * WXEGLMULTTRANSPOSEMATRIXD)(const GLdouble m[16]);
WXE_EXTERN WXEGLMULTTRANSPOSEMATRIXD weglMultTransposeMatrixd;
typedef void (APIENTRY * WXEGLBLENDFUNCSEPARATE)(GLenum,GLenum,GLenum,GLenum);
WXE_EXTERN WXEGLBLENDFUNCSEPARATE weglBlendFuncSeparate;
@@ -1589,16 +1589,28 @@ typedef GLuint (APIENTRY * WXEGLGETDEBUGMESSAGELOGARB)(GLuint,GLsizei,GLenum *,G
WXE_EXTERN WXEGLGETDEBUGMESSAGELOGARB weglGetDebugMessageLogARB;
typedef GLenum (APIENTRY * WXEGLGETGRAPHICSRESETSTATUSARB)();
WXE_EXTERN WXEGLGETGRAPHICSRESETSTATUSARB weglGetGraphicsResetStatusARB;
-typedef void (APIENTRY * WXEGLRESIZEBUFFERSMESA)();
-WXE_EXTERN WXEGLRESIZEBUFFERSMESA weglResizeBuffersMESA;
-typedef void (APIENTRY * WXEGLWINDOWPOS4DVMESA)(const GLdouble *);
-WXE_EXTERN WXEGLWINDOWPOS4DVMESA weglWindowPos4dvMESA;
-typedef void (APIENTRY * WXEGLWINDOWPOS4FVMESA)(const GLfloat *);
-WXE_EXTERN WXEGLWINDOWPOS4FVMESA weglWindowPos4fvMESA;
-typedef void (APIENTRY * WXEGLWINDOWPOS4IVMESA)(const GLint *);
-WXE_EXTERN WXEGLWINDOWPOS4IVMESA weglWindowPos4ivMESA;
-typedef void (APIENTRY * WXEGLWINDOWPOS4SVMESA)(const GLshort *);
-WXE_EXTERN WXEGLWINDOWPOS4SVMESA weglWindowPos4svMESA;
+typedef void (APIENTRY * WXEGLDRAWARRAYSINSTANCEDBASEINSTANCE)(GLenum,GLint,GLsizei,GLsizei,GLuint);
+WXE_EXTERN WXEGLDRAWARRAYSINSTANCEDBASEINSTANCE weglDrawArraysInstancedBaseInstance;
+typedef void (APIENTRY * WXEGLDRAWELEMENTSINSTANCEDBASEINSTANCE)(GLenum,GLsizei,GLenum,const void *,GLsizei,GLuint);
+WXE_EXTERN WXEGLDRAWELEMENTSINSTANCEDBASEINSTANCE weglDrawElementsInstancedBaseInstance;
+typedef void (APIENTRY * WXEGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCE)(GLenum,GLsizei,GLenum,const void *,GLsizei,GLint,GLuint);
+WXE_EXTERN WXEGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCE weglDrawElementsInstancedBaseVertexBaseInstance;
+typedef void (APIENTRY * WXEGLDRAWTRANSFORMFEEDBACKINSTANCED)(GLenum,GLuint,GLsizei);
+WXE_EXTERN WXEGLDRAWTRANSFORMFEEDBACKINSTANCED weglDrawTransformFeedbackInstanced;
+typedef void (APIENTRY * WXEGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCED)(GLenum,GLuint,GLuint,GLsizei);
+WXE_EXTERN WXEGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCED weglDrawTransformFeedbackStreamInstanced;
+typedef void (APIENTRY * WXEGLGETINTERNALFORMATIV)(GLenum,GLenum,GLenum,GLsizei,GLint *);
+WXE_EXTERN WXEGLGETINTERNALFORMATIV weglGetInternalformativ;
+typedef void (APIENTRY * WXEGLBINDIMAGETEXTURE)(GLuint,GLuint,GLint,GLboolean,GLint,GLenum,GLenum);
+WXE_EXTERN WXEGLBINDIMAGETEXTURE weglBindImageTexture;
+typedef void (APIENTRY * WXEGLMEMORYBARRIER)(GLbitfield);
+WXE_EXTERN WXEGLMEMORYBARRIER weglMemoryBarrier;
+typedef void (APIENTRY * WXEGLTEXSTORAGE1D)(GLenum,GLsizei,GLenum,GLsizei);
+WXE_EXTERN WXEGLTEXSTORAGE1D weglTexStorage1D;
+typedef void (APIENTRY * WXEGLTEXSTORAGE2D)(GLenum,GLsizei,GLenum,GLsizei,GLsizei);
+WXE_EXTERN WXEGLTEXSTORAGE2D weglTexStorage2D;
+typedef void (APIENTRY * WXEGLTEXSTORAGE3D)(GLenum,GLsizei,GLenum,GLsizei,GLsizei,GLsizei);
+WXE_EXTERN WXEGLTEXSTORAGE3D weglTexStorage3D;
typedef void (APIENTRY * WXEGLDEPTHBOUNDSEXT)(GLclampd,GLclampd);
WXE_EXTERN WXEGLDEPTHBOUNDSEXT weglDepthBoundsEXT;
typedef void (APIENTRY * WXEGLSTENCILCLEARTAGEXT)(GLsizei,GLuint);
diff --git a/lib/wx/c_src/gen/gl_finit.h b/lib/wx/c_src/gen/gl_finit.h
index 583e36faf7..afe947ed80 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-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2012. 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
@@ -20,186 +20,135 @@
gl_fns_t gl_fns[] =
{
- {"glAccum", NULL, &weglAccum},
- {"glAlphaFunc", NULL, &weglAlphaFunc},
- {"glAreTexturesResident", NULL, &weglAreTexturesResident},
- {"glArrayElement", NULL, &weglArrayElement},
- {"glBegin", NULL, &weglBegin},
- {"glBindTexture", NULL, &weglBindTexture},
- {"glBitmap", NULL, &weglBitmap},
- {"glBlendFunc", NULL, &weglBlendFunc},
- {"glCallList", NULL, &weglCallList},
- {"glCallLists", NULL, &weglCallLists},
- {"glClear", NULL, &weglClear},
- {"glClearAccum", NULL, &weglClearAccum},
- {"glClearColor", NULL, &weglClearColor},
- {"glClearDepth", NULL, &weglClearDepth},
{"glClearIndex", NULL, &weglClearIndex},
- {"glClearStencil", NULL, &weglClearStencil},
- {"glClipPlane", NULL, &weglClipPlane},
- {"glColor3bv", NULL, &weglColor3bv},
- {"glColor3dv", NULL, &weglColor3dv},
- {"glColor3fv", NULL, &weglColor3fv},
- {"glColor3iv", NULL, &weglColor3iv},
- {"glColor3sv", NULL, &weglColor3sv},
- {"glColor3ubv", NULL, &weglColor3ubv},
- {"glColor3uiv", NULL, &weglColor3uiv},
- {"glColor3usv", NULL, &weglColor3usv},
- {"glColor4bv", NULL, &weglColor4bv},
- {"glColor4dv", NULL, &weglColor4dv},
- {"glColor4fv", NULL, &weglColor4fv},
- {"glColor4iv", NULL, &weglColor4iv},
- {"glColor4sv", NULL, &weglColor4sv},
- {"glColor4ubv", NULL, &weglColor4ubv},
- {"glColor4uiv", NULL, &weglColor4uiv},
- {"glColor4usv", NULL, &weglColor4usv},
+ {"glClearColor", NULL, &weglClearColor},
+ {"glClear", NULL, &weglClear},
+ {"glIndexMask", NULL, &weglIndexMask},
{"glColorMask", NULL, &weglColorMask},
- {"glColorMaterial", NULL, &weglColorMaterial},
- {"glColorPointer", NULL, &weglColorPointer},
- {"glCopyPixels", NULL, &weglCopyPixels},
- {"glCopyTexImage1D", NULL, &weglCopyTexImage1D},
- {"glCopyTexImage2D", NULL, &weglCopyTexImage2D},
- {"glCopyTexSubImage1D", NULL, &weglCopyTexSubImage1D},
- {"glCopyTexSubImage2D", NULL, &weglCopyTexSubImage2D},
+ {"glAlphaFunc", NULL, &weglAlphaFunc},
+ {"glBlendFunc", NULL, &weglBlendFunc},
+ {"glLogicOp", NULL, &weglLogicOp},
{"glCullFace", NULL, &weglCullFace},
- {"glDeleteLists", NULL, &weglDeleteLists},
- {"glDeleteTextures", NULL, &weglDeleteTextures},
- {"glDepthFunc", NULL, &weglDepthFunc},
- {"glDepthMask", NULL, &weglDepthMask},
- {"glDepthRange", NULL, &weglDepthRange},
- {"glDisable", NULL, &weglDisable},
- {"glDisableClientState", NULL, &weglDisableClientState},
- {"glDrawArrays", NULL, &weglDrawArrays},
- {"glDrawBuffer", NULL, &weglDrawBuffer},
- {"glDrawElements", NULL, &weglDrawElements},
- {"glDrawPixels", NULL, &weglDrawPixels},
+ {"glFrontFace", NULL, &weglFrontFace},
+ {"glPointSize", NULL, &weglPointSize},
+ {"glLineWidth", NULL, &weglLineWidth},
+ {"glLineStipple", NULL, &weglLineStipple},
+ {"glPolygonMode", NULL, &weglPolygonMode},
+ {"glPolygonOffset", NULL, &weglPolygonOffset},
+ {"glPolygonStipple", NULL, &weglPolygonStipple},
+ {"glGetPolygonStipple", NULL, &weglGetPolygonStipple},
{"glEdgeFlagv", NULL, &weglEdgeFlagv},
- {"glEdgeFlagPointer", NULL, &weglEdgeFlagPointer},
+ {"glScissor", NULL, &weglScissor},
+ {"glClipPlane", NULL, &weglClipPlane},
+ {"glGetClipPlane", NULL, &weglGetClipPlane},
+ {"glDrawBuffer", NULL, &weglDrawBuffer},
+ {"glReadBuffer", NULL, &weglReadBuffer},
{"glEnable", NULL, &weglEnable},
+ {"glDisable", NULL, &weglDisable},
+ {"glIsEnabled", NULL, &weglIsEnabled},
{"glEnableClientState", NULL, &weglEnableClientState},
- {"glEnd", NULL, &weglEnd},
- {"glEndList", NULL, &weglEndList},
- {"glEvalCoord1dv", NULL, &weglEvalCoord1dv},
- {"glEvalCoord1fv", NULL, &weglEvalCoord1fv},
- {"glEvalCoord2dv", NULL, &weglEvalCoord2dv},
- {"glEvalCoord2fv", NULL, &weglEvalCoord2fv},
- {"glEvalMesh1", NULL, &weglEvalMesh1},
- {"glEvalMesh2", NULL, &weglEvalMesh2},
- {"glEvalPoint1", NULL, &weglEvalPoint1},
- {"glEvalPoint2", NULL, &weglEvalPoint2},
- {"glFeedbackBuffer", NULL, &weglFeedbackBuffer},
- {"glFinish", NULL, &weglFinish},
- {"glFlush", NULL, &weglFlush},
- {"glFogf", NULL, &weglFogf},
- {"glFogfv", NULL, &weglFogfv},
- {"glFogi", NULL, &weglFogi},
- {"glFogiv", NULL, &weglFogiv},
- {"glFrontFace", NULL, &weglFrontFace},
- {"glFrustum", NULL, &weglFrustum},
- {"glGenLists", NULL, &weglGenLists},
- {"glGenTextures", NULL, &weglGenTextures},
+ {"glDisableClientState", NULL, &weglDisableClientState},
{"glGetBooleanv", NULL, &weglGetBooleanv},
- {"glGetClipPlane", NULL, &weglGetClipPlane},
{"glGetDoublev", NULL, &weglGetDoublev},
- {"glGetError", NULL, &weglGetError},
{"glGetFloatv", NULL, &weglGetFloatv},
{"glGetIntegerv", NULL, &weglGetIntegerv},
- {"glGetLightfv", NULL, &weglGetLightfv},
- {"glGetLightiv", NULL, &weglGetLightiv},
- {"glGetMapdv", NULL, &weglGetMapdv},
- {"glGetMapfv", NULL, &weglGetMapfv},
- {"glGetMapiv", NULL, &weglGetMapiv},
- {"glGetMaterialfv", NULL, &weglGetMaterialfv},
- {"glGetMaterialiv", NULL, &weglGetMaterialiv},
- {"glGetPixelMapfv", NULL, &weglGetPixelMapfv},
- {"glGetPixelMapuiv", NULL, &weglGetPixelMapuiv},
- {"glGetPixelMapusv", NULL, &weglGetPixelMapusv},
- {"glGetPolygonStipple", NULL, &weglGetPolygonStipple},
+ {"glPushAttrib", NULL, &weglPushAttrib},
+ {"glPopAttrib", NULL, &weglPopAttrib},
+ {"glPushClientAttrib", NULL, &weglPushClientAttrib},
+ {"glPopClientAttrib", NULL, &weglPopClientAttrib},
+ {"glRenderMode", NULL, &weglRenderMode},
+ {"glGetError", NULL, &weglGetError},
{"glGetString", NULL, &weglGetString},
- {"glGetTexEnvfv", NULL, &weglGetTexEnvfv},
- {"glGetTexEnviv", NULL, &weglGetTexEnviv},
- {"glGetTexGendv", NULL, &weglGetTexGendv},
- {"glGetTexGenfv", NULL, &weglGetTexGenfv},
- {"glGetTexGeniv", NULL, &weglGetTexGeniv},
- {"glGetTexImage", NULL, &weglGetTexImage},
- {"glGetTexLevelParameterfv", NULL, &weglGetTexLevelParameterfv},
- {"glGetTexLevelParameteriv", NULL, &weglGetTexLevelParameteriv},
- {"glGetTexParameterfv", NULL, &weglGetTexParameterfv},
- {"glGetTexParameteriv", NULL, &weglGetTexParameteriv},
+ {"glFinish", NULL, &weglFinish},
+ {"glFlush", NULL, &weglFlush},
{"glHint", NULL, &weglHint},
- {"glIndexMask", NULL, &weglIndexMask},
- {"glIndexPointer", NULL, &weglIndexPointer},
- {"glIndexdv", NULL, &weglIndexdv},
- {"glIndexfv", NULL, &weglIndexfv},
- {"glIndexiv", NULL, &weglIndexiv},
- {"glIndexsv", NULL, &weglIndexsv},
- {"glIndexubv", NULL, &weglIndexubv},
- {"glInitNames", NULL, &weglInitNames},
- {"glInterleavedArrays", NULL, &weglInterleavedArrays},
- {"glIsEnabled", NULL, &weglIsEnabled},
- {"glIsList", NULL, &weglIsList},
- {"glIsTexture", NULL, &weglIsTexture},
- {"glLightModelf", NULL, &weglLightModelf},
- {"glLightModelfv", NULL, &weglLightModelfv},
- {"glLightModeli", NULL, &weglLightModeli},
- {"glLightModeliv", NULL, &weglLightModeliv},
- {"glLightf", NULL, &weglLightf},
- {"glLightfv", NULL, &weglLightfv},
- {"glLighti", NULL, &weglLighti},
- {"glLightiv", NULL, &weglLightiv},
- {"glLineStipple", NULL, &weglLineStipple},
- {"glLineWidth", NULL, &weglLineWidth},
- {"glListBase", NULL, &weglListBase},
+ {"glClearDepth", NULL, &weglClearDepth},
+ {"glDepthFunc", NULL, &weglDepthFunc},
+ {"glDepthMask", NULL, &weglDepthMask},
+ {"glDepthRange", NULL, &weglDepthRange},
+ {"glClearAccum", NULL, &weglClearAccum},
+ {"glAccum", NULL, &weglAccum},
+ {"glMatrixMode", NULL, &weglMatrixMode},
+ {"glOrtho", NULL, &weglOrtho},
+ {"glFrustum", NULL, &weglFrustum},
+ {"glViewport", NULL, &weglViewport},
+ {"glPushMatrix", NULL, &weglPushMatrix},
+ {"glPopMatrix", NULL, &weglPopMatrix},
{"glLoadIdentity", NULL, &weglLoadIdentity},
{"glLoadMatrixd", NULL, &weglLoadMatrixd},
{"glLoadMatrixf", NULL, &weglLoadMatrixf},
- {"glLoadName", NULL, &weglLoadName},
- {"glLogicOp", NULL, &weglLogicOp},
- {"glMap1d", NULL, &weglMap1d},
- {"glMap1f", NULL, &weglMap1f},
- {"glMap2d", NULL, &weglMap2d},
- {"glMap2f", NULL, &weglMap2f},
- {"glMapGrid1d", NULL, &weglMapGrid1d},
- {"glMapGrid1f", NULL, &weglMapGrid1f},
- {"glMapGrid2d", NULL, &weglMapGrid2d},
- {"glMapGrid2f", NULL, &weglMapGrid2f},
- {"glMaterialf", NULL, &weglMaterialf},
- {"glMaterialfv", NULL, &weglMaterialfv},
- {"glMateriali", NULL, &weglMateriali},
- {"glMaterialiv", NULL, &weglMaterialiv},
- {"glMatrixMode", NULL, &weglMatrixMode},
{"glMultMatrixd", NULL, &weglMultMatrixd},
{"glMultMatrixf", NULL, &weglMultMatrixf},
+ {"glRotated", NULL, &weglRotated},
+ {"glRotatef", NULL, &weglRotatef},
+ {"glScaled", NULL, &weglScaled},
+ {"glScalef", NULL, &weglScalef},
+ {"glTranslated", NULL, &weglTranslated},
+ {"glTranslatef", NULL, &weglTranslatef},
+ {"glIsList", NULL, &weglIsList},
+ {"glDeleteLists", NULL, &weglDeleteLists},
+ {"glGenLists", NULL, &weglGenLists},
{"glNewList", NULL, &weglNewList},
+ {"glEndList", NULL, &weglEndList},
+ {"glCallList", NULL, &weglCallList},
+ {"glCallLists", NULL, &weglCallLists},
+ {"glListBase", NULL, &weglListBase},
+ {"glBegin", NULL, &weglBegin},
+ {"glEnd", NULL, &weglEnd},
+ {"glVertex2dv", NULL, &weglVertex2dv},
+ {"glVertex2fv", NULL, &weglVertex2fv},
+ {"glVertex2iv", NULL, &weglVertex2iv},
+ {"glVertex2sv", NULL, &weglVertex2sv},
+ {"glVertex3dv", NULL, &weglVertex3dv},
+ {"glVertex3fv", NULL, &weglVertex3fv},
+ {"glVertex3iv", NULL, &weglVertex3iv},
+ {"glVertex3sv", NULL, &weglVertex3sv},
+ {"glVertex4dv", NULL, &weglVertex4dv},
+ {"glVertex4fv", NULL, &weglVertex4fv},
+ {"glVertex4iv", NULL, &weglVertex4iv},
+ {"glVertex4sv", NULL, &weglVertex4sv},
{"glNormal3bv", NULL, &weglNormal3bv},
{"glNormal3dv", NULL, &weglNormal3dv},
{"glNormal3fv", NULL, &weglNormal3fv},
{"glNormal3iv", NULL, &weglNormal3iv},
{"glNormal3sv", NULL, &weglNormal3sv},
- {"glNormalPointer", NULL, &weglNormalPointer},
- {"glOrtho", NULL, &weglOrtho},
- {"glPassThrough", NULL, &weglPassThrough},
- {"glPixelMapfv", NULL, &weglPixelMapfv},
- {"glPixelMapuiv", NULL, &weglPixelMapuiv},
- {"glPixelMapusv", NULL, &weglPixelMapusv},
- {"glPixelStoref", NULL, &weglPixelStoref},
- {"glPixelStorei", NULL, &weglPixelStorei},
- {"glPixelTransferf", NULL, &weglPixelTransferf},
- {"glPixelTransferi", NULL, &weglPixelTransferi},
- {"glPixelZoom", NULL, &weglPixelZoom},
- {"glPointSize", NULL, &weglPointSize},
- {"glPolygonMode", NULL, &weglPolygonMode},
- {"glPolygonOffset", NULL, &weglPolygonOffset},
- {"glPolygonStipple", NULL, &weglPolygonStipple},
- {"glPopAttrib", NULL, &weglPopAttrib},
- {"glPopClientAttrib", NULL, &weglPopClientAttrib},
- {"glPopMatrix", NULL, &weglPopMatrix},
- {"glPopName", NULL, &weglPopName},
- {"glPrioritizeTextures", NULL, &weglPrioritizeTextures},
- {"glPushAttrib", NULL, &weglPushAttrib},
- {"glPushClientAttrib", NULL, &weglPushClientAttrib},
- {"glPushMatrix", NULL, &weglPushMatrix},
- {"glPushName", NULL, &weglPushName},
+ {"glIndexdv", NULL, &weglIndexdv},
+ {"glIndexfv", NULL, &weglIndexfv},
+ {"glIndexiv", NULL, &weglIndexiv},
+ {"glIndexsv", NULL, &weglIndexsv},
+ {"glIndexubv", NULL, &weglIndexubv},
+ {"glColor3bv", NULL, &weglColor3bv},
+ {"glColor3dv", NULL, &weglColor3dv},
+ {"glColor3fv", NULL, &weglColor3fv},
+ {"glColor3iv", NULL, &weglColor3iv},
+ {"glColor3sv", NULL, &weglColor3sv},
+ {"glColor3ubv", NULL, &weglColor3ubv},
+ {"glColor3uiv", NULL, &weglColor3uiv},
+ {"glColor3usv", NULL, &weglColor3usv},
+ {"glColor4bv", NULL, &weglColor4bv},
+ {"glColor4dv", NULL, &weglColor4dv},
+ {"glColor4fv", NULL, &weglColor4fv},
+ {"glColor4iv", NULL, &weglColor4iv},
+ {"glColor4sv", NULL, &weglColor4sv},
+ {"glColor4ubv", NULL, &weglColor4ubv},
+ {"glColor4uiv", NULL, &weglColor4uiv},
+ {"glColor4usv", NULL, &weglColor4usv},
+ {"glTexCoord1dv", NULL, &weglTexCoord1dv},
+ {"glTexCoord1fv", NULL, &weglTexCoord1fv},
+ {"glTexCoord1iv", NULL, &weglTexCoord1iv},
+ {"glTexCoord1sv", NULL, &weglTexCoord1sv},
+ {"glTexCoord2dv", NULL, &weglTexCoord2dv},
+ {"glTexCoord2fv", NULL, &weglTexCoord2fv},
+ {"glTexCoord2iv", NULL, &weglTexCoord2iv},
+ {"glTexCoord2sv", NULL, &weglTexCoord2sv},
+ {"glTexCoord3dv", NULL, &weglTexCoord3dv},
+ {"glTexCoord3fv", NULL, &weglTexCoord3fv},
+ {"glTexCoord3iv", NULL, &weglTexCoord3iv},
+ {"glTexCoord3sv", NULL, &weglTexCoord3sv},
+ {"glTexCoord4dv", NULL, &weglTexCoord4dv},
+ {"glTexCoord4fv", NULL, &weglTexCoord4fv},
+ {"glTexCoord4iv", NULL, &weglTexCoord4iv},
+ {"glTexCoord4sv", NULL, &weglTexCoord4sv},
{"glRasterPos2dv", NULL, &weglRasterPos2dv},
{"glRasterPos2fv", NULL, &weglRasterPos2fv},
{"glRasterPos2iv", NULL, &weglRasterPos2iv},
@@ -212,78 +161,129 @@ gl_fns_t gl_fns[] =
{"glRasterPos4fv", NULL, &weglRasterPos4fv},
{"glRasterPos4iv", NULL, &weglRasterPos4iv},
{"glRasterPos4sv", NULL, &weglRasterPos4sv},
- {"glReadBuffer", NULL, &weglReadBuffer},
- {"glReadPixels", NULL, &weglReadPixels},
{"glRectd", NULL, &weglRectd},
- {"glRectdv", NULL, &weglRectdv},
{"glRectf", NULL, &weglRectf},
- {"glRectfv", NULL, &weglRectfv},
{"glRecti", NULL, &weglRecti},
- {"glRectiv", NULL, &weglRectiv},
{"glRects", NULL, &weglRects},
+ {"glRectdv", NULL, &weglRectdv},
+ {"glRectfv", NULL, &weglRectfv},
+ {"glRectiv", NULL, &weglRectiv},
{"glRectsv", NULL, &weglRectsv},
- {"glRenderMode", NULL, &weglRenderMode},
- {"glRotated", NULL, &weglRotated},
- {"glRotatef", NULL, &weglRotatef},
- {"glScaled", NULL, &weglScaled},
- {"glScalef", NULL, &weglScalef},
- {"glScissor", NULL, &weglScissor},
- {"glSelectBuffer", NULL, &weglSelectBuffer},
+ {"glVertexPointer", NULL, &weglVertexPointer},
+ {"glNormalPointer", NULL, &weglNormalPointer},
+ {"glColorPointer", NULL, &weglColorPointer},
+ {"glIndexPointer", NULL, &weglIndexPointer},
+ {"glTexCoordPointer", NULL, &weglTexCoordPointer},
+ {"glEdgeFlagPointer", NULL, &weglEdgeFlagPointer},
+ {"glArrayElement", NULL, &weglArrayElement},
+ {"glDrawArrays", NULL, &weglDrawArrays},
+ {"glDrawElements", NULL, &weglDrawElements},
+ {"glInterleavedArrays", NULL, &weglInterleavedArrays},
{"glShadeModel", NULL, &weglShadeModel},
+ {"glLightf", NULL, &weglLightf},
+ {"glLighti", NULL, &weglLighti},
+ {"glLightfv", NULL, &weglLightfv},
+ {"glLightiv", NULL, &weglLightiv},
+ {"glGetLightfv", NULL, &weglGetLightfv},
+ {"glGetLightiv", NULL, &weglGetLightiv},
+ {"glLightModelf", NULL, &weglLightModelf},
+ {"glLightModeli", NULL, &weglLightModeli},
+ {"glLightModelfv", NULL, &weglLightModelfv},
+ {"glLightModeliv", NULL, &weglLightModeliv},
+ {"glMaterialf", NULL, &weglMaterialf},
+ {"glMateriali", NULL, &weglMateriali},
+ {"glMaterialfv", NULL, &weglMaterialfv},
+ {"glMaterialiv", NULL, &weglMaterialiv},
+ {"glGetMaterialfv", NULL, &weglGetMaterialfv},
+ {"glGetMaterialiv", NULL, &weglGetMaterialiv},
+ {"glColorMaterial", NULL, &weglColorMaterial},
+ {"glPixelZoom", NULL, &weglPixelZoom},
+ {"glPixelStoref", NULL, &weglPixelStoref},
+ {"glPixelStorei", NULL, &weglPixelStorei},
+ {"glPixelTransferf", NULL, &weglPixelTransferf},
+ {"glPixelTransferi", NULL, &weglPixelTransferi},
+ {"glPixelMapfv", NULL, &weglPixelMapfv},
+ {"glPixelMapuiv", NULL, &weglPixelMapuiv},
+ {"glPixelMapusv", NULL, &weglPixelMapusv},
+ {"glGetPixelMapfv", NULL, &weglGetPixelMapfv},
+ {"glGetPixelMapuiv", NULL, &weglGetPixelMapuiv},
+ {"glGetPixelMapusv", NULL, &weglGetPixelMapusv},
+ {"glBitmap", NULL, &weglBitmap},
+ {"glReadPixels", NULL, &weglReadPixels},
+ {"glDrawPixels", NULL, &weglDrawPixels},
+ {"glCopyPixels", NULL, &weglCopyPixels},
{"glStencilFunc", NULL, &weglStencilFunc},
{"glStencilMask", NULL, &weglStencilMask},
{"glStencilOp", NULL, &weglStencilOp},
- {"glTexCoord1dv", NULL, &weglTexCoord1dv},
- {"glTexCoord1fv", NULL, &weglTexCoord1fv},
- {"glTexCoord1iv", NULL, &weglTexCoord1iv},
- {"glTexCoord1sv", NULL, &weglTexCoord1sv},
- {"glTexCoord2dv", NULL, &weglTexCoord2dv},
- {"glTexCoord2fv", NULL, &weglTexCoord2fv},
- {"glTexCoord2iv", NULL, &weglTexCoord2iv},
- {"glTexCoord2sv", NULL, &weglTexCoord2sv},
- {"glTexCoord3dv", NULL, &weglTexCoord3dv},
- {"glTexCoord3fv", NULL, &weglTexCoord3fv},
- {"glTexCoord3iv", NULL, &weglTexCoord3iv},
- {"glTexCoord3sv", NULL, &weglTexCoord3sv},
- {"glTexCoord4dv", NULL, &weglTexCoord4dv},
- {"glTexCoord4fv", NULL, &weglTexCoord4fv},
- {"glTexCoord4iv", NULL, &weglTexCoord4iv},
- {"glTexCoord4sv", NULL, &weglTexCoord4sv},
- {"glTexCoordPointer", NULL, &weglTexCoordPointer},
- {"glTexEnvf", NULL, &weglTexEnvf},
- {"glTexEnvfv", NULL, &weglTexEnvfv},
- {"glTexEnvi", NULL, &weglTexEnvi},
- {"glTexEnviv", NULL, &weglTexEnviv},
+ {"glClearStencil", NULL, &weglClearStencil},
{"glTexGend", NULL, &weglTexGend},
- {"glTexGendv", NULL, &weglTexGendv},
{"glTexGenf", NULL, &weglTexGenf},
- {"glTexGenfv", NULL, &weglTexGenfv},
{"glTexGeni", NULL, &weglTexGeni},
+ {"glTexGendv", NULL, &weglTexGendv},
+ {"glTexGenfv", NULL, &weglTexGenfv},
{"glTexGeniv", NULL, &weglTexGeniv},
- {"glTexImage1D", NULL, &weglTexImage1D},
- {"glTexImage2D", NULL, &weglTexImage2D},
+ {"glGetTexGendv", NULL, &weglGetTexGendv},
+ {"glGetTexGenfv", NULL, &weglGetTexGenfv},
+ {"glGetTexGeniv", NULL, &weglGetTexGeniv},
+ {"glTexEnvf", NULL, &weglTexEnvf},
+ {"glTexEnvi", NULL, &weglTexEnvi},
+ {"glTexEnvfv", NULL, &weglTexEnvfv},
+ {"glTexEnviv", NULL, &weglTexEnviv},
+ {"glGetTexEnvfv", NULL, &weglGetTexEnvfv},
+ {"glGetTexEnviv", NULL, &weglGetTexEnviv},
{"glTexParameterf", NULL, &weglTexParameterf},
- {"glTexParameterfv", NULL, &weglTexParameterfv},
{"glTexParameteri", NULL, &weglTexParameteri},
+ {"glTexParameterfv", NULL, &weglTexParameterfv},
{"glTexParameteriv", NULL, &weglTexParameteriv},
+ {"glGetTexParameterfv", NULL, &weglGetTexParameterfv},
+ {"glGetTexParameteriv", NULL, &weglGetTexParameteriv},
+ {"glGetTexLevelParameterfv", NULL, &weglGetTexLevelParameterfv},
+ {"glGetTexLevelParameteriv", NULL, &weglGetTexLevelParameteriv},
+ {"glTexImage1D", NULL, &weglTexImage1D},
+ {"glTexImage2D", NULL, &weglTexImage2D},
+ {"glGetTexImage", NULL, &weglGetTexImage},
+ {"glGenTextures", NULL, &weglGenTextures},
+ {"glDeleteTextures", NULL, &weglDeleteTextures},
+ {"glBindTexture", NULL, &weglBindTexture},
+ {"glPrioritizeTextures", NULL, &weglPrioritizeTextures},
+ {"glAreTexturesResident", NULL, &weglAreTexturesResident},
+ {"glIsTexture", NULL, &weglIsTexture},
{"glTexSubImage1D", NULL, &weglTexSubImage1D},
{"glTexSubImage2D", NULL, &weglTexSubImage2D},
- {"glTranslated", NULL, &weglTranslated},
- {"glTranslatef", NULL, &weglTranslatef},
- {"glVertex2dv", NULL, &weglVertex2dv},
- {"glVertex2fv", NULL, &weglVertex2fv},
- {"glVertex2iv", NULL, &weglVertex2iv},
- {"glVertex2sv", NULL, &weglVertex2sv},
- {"glVertex3dv", NULL, &weglVertex3dv},
- {"glVertex3fv", NULL, &weglVertex3fv},
- {"glVertex3iv", NULL, &weglVertex3iv},
- {"glVertex3sv", NULL, &weglVertex3sv},
- {"glVertex4dv", NULL, &weglVertex4dv},
- {"glVertex4fv", NULL, &weglVertex4fv},
- {"glVertex4iv", NULL, &weglVertex4iv},
- {"glVertex4sv", NULL, &weglVertex4sv},
- {"glVertexPointer", NULL, &weglVertexPointer},
- {"glViewport", NULL, &weglViewport},
+ {"glCopyTexImage1D", NULL, &weglCopyTexImage1D},
+ {"glCopyTexImage2D", NULL, &weglCopyTexImage2D},
+ {"glCopyTexSubImage1D", NULL, &weglCopyTexSubImage1D},
+ {"glCopyTexSubImage2D", NULL, &weglCopyTexSubImage2D},
+ {"glMap1d", NULL, &weglMap1d},
+ {"glMap1f", NULL, &weglMap1f},
+ {"glMap2d", NULL, &weglMap2d},
+ {"glMap2f", NULL, &weglMap2f},
+ {"glGetMapdv", NULL, &weglGetMapdv},
+ {"glGetMapfv", NULL, &weglGetMapfv},
+ {"glGetMapiv", NULL, &weglGetMapiv},
+ {"glEvalCoord1dv", NULL, &weglEvalCoord1dv},
+ {"glEvalCoord1fv", NULL, &weglEvalCoord1fv},
+ {"glEvalCoord2dv", NULL, &weglEvalCoord2dv},
+ {"glEvalCoord2fv", NULL, &weglEvalCoord2fv},
+ {"glMapGrid1d", NULL, &weglMapGrid1d},
+ {"glMapGrid1f", NULL, &weglMapGrid1f},
+ {"glMapGrid2d", NULL, &weglMapGrid2d},
+ {"glMapGrid2f", NULL, &weglMapGrid2f},
+ {"glEvalPoint1", NULL, &weglEvalPoint1},
+ {"glEvalPoint2", NULL, &weglEvalPoint2},
+ {"glEvalMesh1", NULL, &weglEvalMesh1},
+ {"glEvalMesh2", NULL, &weglEvalMesh2},
+ {"glFogf", NULL, &weglFogf},
+ {"glFogi", NULL, &weglFogi},
+ {"glFogfv", NULL, &weglFogfv},
+ {"glFogiv", NULL, &weglFogiv},
+ {"glFeedbackBuffer", NULL, &weglFeedbackBuffer},
+ {"glPassThrough", NULL, &weglPassThrough},
+ {"glSelectBuffer", NULL, &weglSelectBuffer},
+ {"glInitNames", NULL, &weglInitNames},
+ {"glLoadName", NULL, &weglLoadName},
+ {"glPushName", NULL, &weglPushName},
+ {"glPopName", NULL, &weglPopName},
{"glBlendColor", NULL, &weglBlendColor},
{"glBlendEquation", NULL, &weglBlendEquation},
{"glDrawRangeElements", NULL, &weglDrawRangeElements},
@@ -367,14 +367,14 @@ gl_fns_t gl_fns[] =
{"glSecondaryColor3uiv", NULL, &weglSecondaryColor3uiv},
{"glSecondaryColor3usv", NULL, &weglSecondaryColor3usv},
{"glSecondaryColorPointer", NULL, &weglSecondaryColorPointer},
- {"glWindowPos2dv", "glWindowPos2dvMESA", &weglWindowPos2dv},
- {"glWindowPos2fv", "glWindowPos2fvMESA", &weglWindowPos2fv},
- {"glWindowPos2iv", "glWindowPos2ivMESA", &weglWindowPos2iv},
- {"glWindowPos2sv", "glWindowPos2svMESA", &weglWindowPos2sv},
- {"glWindowPos3dv", "glWindowPos3dvMESA", &weglWindowPos3dv},
- {"glWindowPos3fv", "glWindowPos3fvMESA", &weglWindowPos3fv},
- {"glWindowPos3iv", "glWindowPos3ivMESA", &weglWindowPos3iv},
- {"glWindowPos3sv", "glWindowPos3svMESA", &weglWindowPos3sv},
+ {"glWindowPos2dv", "glWindowPos2dvARB", &weglWindowPos2dv},
+ {"glWindowPos2fv", "glWindowPos2fvARB", &weglWindowPos2fv},
+ {"glWindowPos2iv", "glWindowPos2ivARB", &weglWindowPos2iv},
+ {"glWindowPos2sv", "glWindowPos2svARB", &weglWindowPos2sv},
+ {"glWindowPos3dv", "glWindowPos3dvARB", &weglWindowPos3dv},
+ {"glWindowPos3fv", "glWindowPos3fvARB", &weglWindowPos3fv},
+ {"glWindowPos3iv", "glWindowPos3ivARB", &weglWindowPos3iv},
+ {"glWindowPos3sv", "glWindowPos3svARB", &weglWindowPos3sv},
{"glGenQueries", "glGenQueriesARB", &weglGenQueries},
{"glDeleteQueries", "glDeleteQueriesARB", &weglDeleteQueries},
{"glIsQuery", "glIsQueryARB", &weglIsQuery},
@@ -799,11 +799,17 @@ gl_fns_t gl_fns[] =
{"glDebugMessageInsertARB", NULL, &weglDebugMessageInsertARB},
{"glGetDebugMessageLogARB", NULL, &weglGetDebugMessageLogARB},
{"glGetGraphicsResetStatusARB", NULL, &weglGetGraphicsResetStatusARB},
- {"glResizeBuffersMESA", NULL, &weglResizeBuffersMESA},
- {"glWindowPos4dvMESA", NULL, &weglWindowPos4dvMESA},
- {"glWindowPos4fvMESA", NULL, &weglWindowPos4fvMESA},
- {"glWindowPos4ivMESA", NULL, &weglWindowPos4ivMESA},
- {"glWindowPos4svMESA", NULL, &weglWindowPos4svMESA},
+ {"glDrawArraysInstancedBaseInstance", NULL, &weglDrawArraysInstancedBaseInstance},
+ {"glDrawElementsInstancedBaseInstance", NULL, &weglDrawElementsInstancedBaseInstance},
+ {"glDrawElementsInstancedBaseVertexBaseInstance", NULL, &weglDrawElementsInstancedBaseVertexBaseInstance},
+ {"glDrawTransformFeedbackInstanced", NULL, &weglDrawTransformFeedbackInstanced},
+ {"glDrawTransformFeedbackStreamInstanced", NULL, &weglDrawTransformFeedbackStreamInstanced},
+ {"glGetInternalformativ", NULL, &weglGetInternalformativ},
+ {"glBindImageTexture", NULL, &weglBindImageTexture},
+ {"glMemoryBarrier", NULL, &weglMemoryBarrier},
+ {"glTexStorage1D", NULL, &weglTexStorage1D},
+ {"glTexStorage2D", NULL, &weglTexStorage2D},
+ {"glTexStorage3D", NULL, &weglTexStorage3D},
{"glDepthBoundsEXT", NULL, &weglDepthBoundsEXT},
{"glStencilClearTagEXT", NULL, &weglStencilClearTagEXT},
{ NULL, NULL, NULL}};
diff --git a/lib/wx/c_src/gen/gl_funcs.cpp b/lib/wx/c_src/gen/gl_funcs.cpp
index fa1476dba5..e1bd920e71 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-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2012. 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
@@ -346,477 +346,157 @@ case 5036: { // gluUnProject4
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
driver_send_term(port,caller,rt,AP);
}; break;
-case 5037: { // glAccum
- GLenum *op = (GLenum *) bp; bp += 4;
- GLfloat *value = (GLfloat *) bp; bp += 4;
- weglAccum(*op,*value);
-}; break;
-case 5038: { // glAlphaFunc
- GLenum *func = (GLenum *) bp; bp += 4;
- GLclampf *ref = (GLclampf *) bp; bp += 4;
- weglAlphaFunc(*func,*ref);
-}; break;
-case 5039: { // glAreTexturesResident
- int * texturesLen = (int *) bp; bp += 4;
- GLuint * textures = (GLuint *) bp; bp += (8-((*texturesLen*4+4)%8))%8;
- GLboolean *residences;
- residences = (GLboolean *) driver_alloc(sizeof(GLboolean) * *texturesLen);
- GLboolean result = weglAreTexturesResident(*texturesLen,textures,residences);
- int AP = 0; ErlDrvTermData *rt;
- rt = (ErlDrvTermData *) driver_alloc(sizeof(ErlDrvTermData)*(11 + (*texturesLen)*2));
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
- for(int i=0; i < *texturesLen; i++) {
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) residences[i];}
- rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = (*texturesLen)+1;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
- driver_free(rt);
- driver_free(residences);
-}; break;
-case 5040: { // glArrayElement
- GLint *i = (GLint *) bp; bp += 4;
- weglArrayElement(*i);
-}; break;
-case 5041: { // glBegin
- GLenum *mode = (GLenum *) bp; bp += 4;
- weglBegin(*mode);
-}; break;
-case 5042: { // glBindTexture
- GLenum *target = (GLenum *) bp; bp += 4;
- GLuint *texture = (GLuint *) bp; bp += 4;
- weglBindTexture(*target,*texture);
-}; break;
-case 5043: { // glBitmap
- GLsizei *width = (GLsizei *) bp; bp += 4;
- GLsizei *height = (GLsizei *) bp; bp += 4;
- GLfloat *xorig = (GLfloat *) bp; bp += 4;
- GLfloat *yorig = (GLfloat *) bp; bp += 4;
- GLfloat *xmove = (GLfloat *) bp; bp += 4;
- GLfloat *ymove = (GLfloat *) bp; bp += 4;
- GLubyte *bitmap = (GLubyte *) (ErlDrvSInt) * (int *) bp; bp += 4;
- weglBitmap(*width,*height,*xorig,*yorig,*xmove,*ymove,bitmap);
-}; break;
-case 5044: { // glBitmap
- GLsizei *width = (GLsizei *) bp; bp += 4;
- GLsizei *height = (GLsizei *) bp; bp += 4;
- GLfloat *xorig = (GLfloat *) bp; bp += 4;
- GLfloat *yorig = (GLfloat *) bp; bp += 4;
- GLfloat *xmove = (GLfloat *) bp; bp += 4;
- GLfloat *ymove = (GLfloat *) bp; bp += 4;
- GLubyte *bitmap = (GLubyte *) bins[0];
- weglBitmap(*width,*height,*xorig,*yorig,*xmove,*ymove,bitmap);
-}; break;
-case 5045: { // glBlendFunc
- GLenum *sfactor = (GLenum *) bp; bp += 4;
- GLenum *dfactor = (GLenum *) bp; bp += 4;
- weglBlendFunc(*sfactor,*dfactor);
-}; break;
-case 5046: { // glCallList
- GLuint *list = (GLuint *) bp; bp += 4;
- weglCallList(*list);
-}; break;
-case 5047: { // glCallLists
- int * listsLen = (int *) bp; bp += 4;
- GLuint * lists = (GLuint *) bp; bp += (8-((*listsLen*4+4)%8))%8;
- weglCallLists(*listsLen,GL_UNSIGNED_INT,lists);
-}; break;
-case 5048: { // glClear
- GLbitfield *mask = (GLbitfield *) bp; bp += 4;
- weglClear(*mask);
-}; break;
-case 5049: { // glClearAccum
- GLfloat *red = (GLfloat *) bp; bp += 4;
- GLfloat *green = (GLfloat *) bp; bp += 4;
- GLfloat *blue = (GLfloat *) bp; bp += 4;
- GLfloat *alpha = (GLfloat *) bp; bp += 4;
- weglClearAccum(*red,*green,*blue,*alpha);
+case 5037: { // glClearIndex
+ GLfloat *c = (GLfloat *) bp; bp += 4;
+ weglClearIndex(*c);
}; break;
-case 5050: { // glClearColor
+case 5038: { // glClearColor
GLclampf *red = (GLclampf *) bp; bp += 4;
GLclampf *green = (GLclampf *) bp; bp += 4;
GLclampf *blue = (GLclampf *) bp; bp += 4;
GLclampf *alpha = (GLclampf *) bp; bp += 4;
weglClearColor(*red,*green,*blue,*alpha);
}; break;
-case 5051: { // glClearDepth
- GLclampd *depth = (GLclampd *) bp; bp += 8;
- weglClearDepth(*depth);
-}; break;
-case 5052: { // glClearIndex
- GLfloat *c = (GLfloat *) bp; bp += 4;
- weglClearIndex(*c);
-}; break;
-case 5053: { // glClearStencil
- GLint *s = (GLint *) bp; bp += 4;
- weglClearStencil(*s);
-}; break;
-case 5054: { // glClipPlane
- GLenum *plane = (GLenum *) bp; bp += 4;
- bp += 4;
- GLdouble * equation = (GLdouble *) bp; bp += 32;
- weglClipPlane(*plane,equation);
-}; break;
-case 5055: { // glColor3bv
- GLbyte *v = (GLbyte *) bp; bp += 1;
- weglColor3bv(v);
-}; break;
-case 5056: { // glColor3dv
- GLdouble *v = (GLdouble *) bp; bp += 8;
- weglColor3dv(v);
-}; break;
-case 5057: { // glColor3fv
- GLfloat *v = (GLfloat *) bp; bp += 4;
- weglColor3fv(v);
-}; break;
-case 5058: { // glColor3iv
- GLint *v = (GLint *) bp; bp += 4;
- weglColor3iv(v);
-}; break;
-case 5059: { // glColor3sv
- GLshort *v = (GLshort *) bp; bp += 2;
- weglColor3sv(v);
-}; break;
-case 5060: { // glColor3ubv
- GLubyte *v = (GLubyte *) bp; bp += 1;
- weglColor3ubv(v);
-}; break;
-case 5061: { // glColor3uiv
- GLuint *v = (GLuint *) bp; bp += 4;
- weglColor3uiv(v);
-}; break;
-case 5062: { // glColor3usv
- GLushort *v = (GLushort *) bp; bp += 2;
- weglColor3usv(v);
-}; break;
-case 5063: { // glColor4bv
- GLbyte *v = (GLbyte *) bp; bp += 1;
- weglColor4bv(v);
-}; break;
-case 5064: { // glColor4dv
- GLdouble *v = (GLdouble *) bp; bp += 8;
- weglColor4dv(v);
-}; break;
-case 5065: { // glColor4fv
- GLfloat *v = (GLfloat *) bp; bp += 4;
- weglColor4fv(v);
-}; break;
-case 5066: { // glColor4iv
- GLint *v = (GLint *) bp; bp += 4;
- weglColor4iv(v);
-}; break;
-case 5067: { // glColor4sv
- GLshort *v = (GLshort *) bp; bp += 2;
- weglColor4sv(v);
-}; break;
-case 5068: { // glColor4ubv
- GLubyte *v = (GLubyte *) bp; bp += 1;
- weglColor4ubv(v);
-}; break;
-case 5069: { // glColor4uiv
- GLuint *v = (GLuint *) bp; bp += 4;
- weglColor4uiv(v);
+case 5039: { // glClear
+ GLbitfield *mask = (GLbitfield *) bp; bp += 4;
+ weglClear(*mask);
}; break;
-case 5070: { // glColor4usv
- GLushort *v = (GLushort *) bp; bp += 2;
- weglColor4usv(v);
+case 5040: { // glIndexMask
+ GLuint *mask = (GLuint *) bp; bp += 4;
+ weglIndexMask(*mask);
}; break;
-case 5071: { // glColorMask
+case 5041: { // glColorMask
GLboolean *red = (GLboolean *) bp; bp += 1;
GLboolean *green = (GLboolean *) bp; bp += 1;
GLboolean *blue = (GLboolean *) bp; bp += 1;
GLboolean *alpha = (GLboolean *) bp; bp += 1;
weglColorMask(*red,*green,*blue,*alpha);
}; break;
-case 5072: { // glColorMaterial
- GLenum *face = (GLenum *) bp; bp += 4;
- GLenum *mode = (GLenum *) bp; bp += 4;
- weglColorMaterial(*face,*mode);
-}; break;
-case 5073: { // glColorPointer
- GLint *size = (GLint *) bp; bp += 4;
- GLenum *type = (GLenum *) bp; bp += 4;
- GLsizei *stride = (GLsizei *) bp; bp += 4;
- GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
- weglColorPointer(*size,*type,*stride,pointer);
-}; break;
-case 5074: { // glColorPointer
- GLint *size = (GLint *) bp; bp += 4;
- GLenum *type = (GLenum *) bp; bp += 4;
- GLsizei *stride = (GLsizei *) bp; bp += 4;
- GLvoid *pointer = (GLvoid *) bins[0];
- weglColorPointer(*size,*type,*stride,pointer);
-}; break;
-case 5075: { // glCopyPixels
- GLint *x = (GLint *) bp; bp += 4;
- GLint *y = (GLint *) bp; bp += 4;
- GLsizei *width = (GLsizei *) bp; bp += 4;
- GLsizei *height = (GLsizei *) bp; bp += 4;
- GLenum *type = (GLenum *) bp; bp += 4;
- weglCopyPixels(*x,*y,*width,*height,*type);
-}; break;
-case 5076: { // glCopyTexImage1D
- GLenum *target = (GLenum *) bp; bp += 4;
- GLint *level = (GLint *) bp; bp += 4;
- GLenum *internalFormat = (GLenum *) bp; bp += 4;
- GLint *x = (GLint *) bp; bp += 4;
- GLint *y = (GLint *) bp; bp += 4;
- GLsizei *width = (GLsizei *) bp; bp += 4;
- GLint *border = (GLint *) bp; bp += 4;
- weglCopyTexImage1D(*target,*level,*internalFormat,*x,*y,*width,*border);
-}; break;
-case 5077: { // glCopyTexImage2D
- GLenum *target = (GLenum *) bp; bp += 4;
- GLint *level = (GLint *) bp; bp += 4;
- GLenum *internalFormat = (GLenum *) bp; bp += 4;
- GLint *x = (GLint *) bp; bp += 4;
- GLint *y = (GLint *) bp; bp += 4;
- GLsizei *width = (GLsizei *) bp; bp += 4;
- GLsizei *height = (GLsizei *) bp; bp += 4;
- GLint *border = (GLint *) bp; bp += 4;
- weglCopyTexImage2D(*target,*level,*internalFormat,*x,*y,*width,*height,*border);
+case 5042: { // glAlphaFunc
+ GLenum *func = (GLenum *) bp; bp += 4;
+ GLclampf *ref = (GLclampf *) bp; bp += 4;
+ weglAlphaFunc(*func,*ref);
}; break;
-case 5078: { // glCopyTexSubImage1D
- GLenum *target = (GLenum *) bp; bp += 4;
- GLint *level = (GLint *) bp; bp += 4;
- GLint *xoffset = (GLint *) bp; bp += 4;
- GLint *x = (GLint *) bp; bp += 4;
- GLint *y = (GLint *) bp; bp += 4;
- GLsizei *width = (GLsizei *) bp; bp += 4;
- weglCopyTexSubImage1D(*target,*level,*xoffset,*x,*y,*width);
+case 5043: { // glBlendFunc
+ GLenum *sfactor = (GLenum *) bp; bp += 4;
+ GLenum *dfactor = (GLenum *) bp; bp += 4;
+ weglBlendFunc(*sfactor,*dfactor);
}; break;
-case 5079: { // glCopyTexSubImage2D
- GLenum *target = (GLenum *) bp; bp += 4;
- GLint *level = (GLint *) bp; bp += 4;
- GLint *xoffset = (GLint *) bp; bp += 4;
- GLint *yoffset = (GLint *) bp; bp += 4;
- GLint *x = (GLint *) bp; bp += 4;
- GLint *y = (GLint *) bp; bp += 4;
- GLsizei *width = (GLsizei *) bp; bp += 4;
- GLsizei *height = (GLsizei *) bp; bp += 4;
- weglCopyTexSubImage2D(*target,*level,*xoffset,*yoffset,*x,*y,*width,*height);
+case 5044: { // glLogicOp
+ GLenum *opcode = (GLenum *) bp; bp += 4;
+ weglLogicOp(*opcode);
}; break;
-case 5080: { // glCullFace
+case 5045: { // glCullFace
GLenum *mode = (GLenum *) bp; bp += 4;
weglCullFace(*mode);
}; break;
-case 5081: { // glDeleteLists
- GLuint *list = (GLuint *) bp; bp += 4;
- GLsizei *range = (GLsizei *) bp; bp += 4;
- weglDeleteLists(*list,*range);
-}; break;
-case 5082: { // glDeleteTextures
- int * texturesLen = (int *) bp; bp += 4;
- GLuint * textures = (GLuint *) bp; bp += (8-((*texturesLen*4+4)%8))%8;
- weglDeleteTextures(*texturesLen,textures);
-}; break;
-case 5083: { // glDepthFunc
- GLenum *func = (GLenum *) bp; bp += 4;
- weglDepthFunc(*func);
-}; break;
-case 5084: { // glDepthMask
- GLboolean *flag = (GLboolean *) bp; bp += 1;
- weglDepthMask(*flag);
-}; break;
-case 5085: { // glDepthRange
- GLclampd *zNear = (GLclampd *) bp; bp += 8;
- GLclampd *zFar = (GLclampd *) bp; bp += 8;
- weglDepthRange(*zNear,*zFar);
-}; break;
-case 5086: { // glDisable
- GLenum *cap = (GLenum *) bp; bp += 4;
- weglDisable(*cap);
+case 5046: { // glFrontFace
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ weglFrontFace(*mode);
}; break;
-case 5087: { // glDisableClientState
- GLenum *array = (GLenum *) bp; bp += 4;
- weglDisableClientState(*array);
+case 5047: { // glPointSize
+ GLfloat *size = (GLfloat *) bp; bp += 4;
+ weglPointSize(*size);
}; break;
-case 5088: { // glDrawArrays
- GLenum *mode = (GLenum *) bp; bp += 4;
- GLint *first = (GLint *) bp; bp += 4;
- GLsizei *count = (GLsizei *) bp; bp += 4;
- weglDrawArrays(*mode,*first,*count);
+case 5048: { // glLineWidth
+ GLfloat *width = (GLfloat *) bp; bp += 4;
+ weglLineWidth(*width);
}; break;
-case 5089: { // glDrawBuffer
- GLenum *mode = (GLenum *) bp; bp += 4;
- weglDrawBuffer(*mode);
+case 5049: { // glLineStipple
+ GLint *factor = (GLint *) bp; bp += 4;
+ GLushort *pattern = (GLushort *) bp; bp += 2;
+ weglLineStipple(*factor,*pattern);
}; break;
-case 5090: { // glDrawElements
+case 5050: { // glPolygonMode
+ GLenum *face = (GLenum *) bp; bp += 4;
GLenum *mode = (GLenum *) bp; bp += 4;
- GLsizei *count = (GLsizei *) bp; bp += 4;
- GLenum *type = (GLenum *) bp; bp += 4;
- GLvoid *indices = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
- weglDrawElements(*mode,*count,*type,indices);
+ weglPolygonMode(*face,*mode);
}; break;
-case 5091: { // glDrawElements
- GLenum *mode = (GLenum *) bp; bp += 4;
- GLsizei *count = (GLsizei *) bp; bp += 4;
- GLenum *type = (GLenum *) bp; bp += 4;
- GLvoid *indices = (GLvoid *) bins[0];
- weglDrawElements(*mode,*count,*type,indices);
+case 5051: { // glPolygonOffset
+ GLfloat *factor = (GLfloat *) bp; bp += 4;
+ GLfloat *units = (GLfloat *) bp; bp += 4;
+ weglPolygonOffset(*factor,*units);
}; break;
-case 5092: { // glDrawPixels
- GLsizei *width = (GLsizei *) bp; bp += 4;
- GLsizei *height = (GLsizei *) bp; bp += 4;
- GLenum *format = (GLenum *) bp; bp += 4;
- GLenum *type = (GLenum *) bp; bp += 4;
- GLvoid *pixels = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
- weglDrawPixels(*width,*height,*format,*type,pixels);
+case 5052: { // glPolygonStipple
+ GLubyte *mask = (GLubyte *) bins[0];
+ weglPolygonStipple(mask);
}; break;
-case 5093: { // glDrawPixels
- GLsizei *width = (GLsizei *) bp; bp += 4;
- GLsizei *height = (GLsizei *) bp; bp += 4;
- GLenum *format = (GLenum *) bp; bp += 4;
- GLenum *type = (GLenum *) bp; bp += 4;
- GLvoid *pixels = (GLvoid *) bins[0];
- weglDrawPixels(*width,*height,*format,*type,pixels);
+case 5053: { // glGetPolygonStipple
+ ErlDrvBinary *mask = driver_alloc_binary(128);
+ weglGetPolygonStipple((GLubyte*) mask->orig_bytes);
+ int AP = 0; ErlDrvTermData rt[8];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ rt[AP++] = ERL_DRV_BINARY; rt[AP++] = (ErlDrvTermData) mask; rt[AP++] = 128; rt[AP++] = 0;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
+ driver_free_binary(mask);
}; break;
-case 5094: { // glEdgeFlagv
+case 5054: { // glEdgeFlagv
GLboolean *flag = (GLboolean *) bp; bp += 1;
weglEdgeFlagv(flag);
}; break;
-case 5095: { // glEdgeFlagPointer
- GLsizei *stride = (GLsizei *) bp; bp += 4;
- GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
- weglEdgeFlagPointer(*stride,pointer);
-}; break;
-case 5096: { // glEdgeFlagPointer
- GLsizei *stride = (GLsizei *) bp; bp += 4;
- GLvoid *pointer = (GLvoid *) bins[0];
- weglEdgeFlagPointer(*stride,pointer);
-}; break;
-case 5097: { // glEnable
- GLenum *cap = (GLenum *) bp; bp += 4;
- weglEnable(*cap);
-}; break;
-case 5098: { // glEnableClientState
- GLenum *array = (GLenum *) bp; bp += 4;
- weglEnableClientState(*array);
-}; break;
-case 5099: { // glEnd
- weglEnd();
-}; break;
-case 5100: { // glEndList
- weglEndList();
-}; break;
-case 5101: { // glEvalCoord1dv
- GLdouble *u = (GLdouble *) bp; bp += 8;
- weglEvalCoord1dv(u);
-}; break;
-case 5102: { // glEvalCoord1fv
- GLfloat *u = (GLfloat *) bp; bp += 4;
- weglEvalCoord1fv(u);
-}; break;
-case 5103: { // glEvalCoord2dv
- GLdouble *u = (GLdouble *) bp; bp += 8;
- weglEvalCoord2dv(u);
-}; break;
-case 5104: { // glEvalCoord2fv
- GLfloat *u = (GLfloat *) bp; bp += 4;
- weglEvalCoord2fv(u);
-}; break;
-case 5105: { // glEvalMesh1
- GLenum *mode = (GLenum *) bp; bp += 4;
- GLint *i1 = (GLint *) bp; bp += 4;
- GLint *i2 = (GLint *) bp; bp += 4;
- weglEvalMesh1(*mode,*i1,*i2);
-}; break;
-case 5106: { // glEvalMesh2
- GLenum *mode = (GLenum *) bp; bp += 4;
- GLint *i1 = (GLint *) bp; bp += 4;
- GLint *i2 = (GLint *) bp; bp += 4;
- GLint *j1 = (GLint *) bp; bp += 4;
- GLint *j2 = (GLint *) bp; bp += 4;
- weglEvalMesh2(*mode,*i1,*i2,*j1,*j2);
-}; break;
-case 5107: { // glEvalPoint1
- GLint *i = (GLint *) bp; bp += 4;
- weglEvalPoint1(*i);
+case 5055: { // glScissor
+ GLint *x = (GLint *) bp; bp += 4;
+ GLint *y = (GLint *) bp; bp += 4;
+ GLsizei *width = (GLsizei *) bp; bp += 4;
+ GLsizei *height = (GLsizei *) bp; bp += 4;
+ weglScissor(*x,*y,*width,*height);
}; break;
-case 5108: { // glEvalPoint2
- GLint *i = (GLint *) bp; bp += 4;
- GLint *j = (GLint *) bp; bp += 4;
- weglEvalPoint2(*i,*j);
+case 5056: { // glClipPlane
+ GLenum *plane = (GLenum *) bp; bp += 4;
+ bp += 4;
+ GLdouble * equation = (GLdouble *) bp; bp += 32;
+ weglClipPlane(*plane,equation);
}; break;
-case 5109: { // glFeedbackBuffer
- GLsizei *size = (GLsizei *) bp; bp += 4;
- GLenum *type = (GLenum *) bp; bp += 4;
- GLfloat *buffer = (GLfloat *) bins[0];
- weglFeedbackBuffer(*size,*type,buffer);
- int AP = 0; ErlDrvTermData rt[6];
+case 5057: { // glGetClipPlane
+ GLenum *plane = (GLenum *) bp; bp += 4;
+ GLdouble equation[4] = {0.0,0.0,0.0,0.0};
+ weglGetClipPlane(*plane,equation);
+ int AP = 0; ErlDrvTermData rt[14];
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
+ GLdouble *equationTmp = equation;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) equationTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) equationTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) equationTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) equationTmp++;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
driver_send_term(port,caller,rt,AP);
}; break;
-case 5110: { // glFinish
- weglFinish();
-}; break;
-case 5111: { // glFlush
- weglFlush();
-}; break;
-case 5112: { // glFogf
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLfloat *param = (GLfloat *) bp; bp += 4;
- weglFogf(*pname,*param);
-}; break;
-case 5113: { // glFogfv
- GLenum *pname = (GLenum *) bp; bp += 4;
- int *paramsLen = (int *) bp; bp += 4;
- GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+0)%2*4;
- weglFogfv(*pname,params);
-}; break;
-case 5114: { // glFogi
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLint *param = (GLint *) bp; bp += 4;
- weglFogi(*pname,*param);
-}; break;
-case 5115: { // glFogiv
- GLenum *pname = (GLenum *) bp; bp += 4;
- int *paramsLen = (int *) bp; bp += 4;
- GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+0)%2*4;
- weglFogiv(*pname,params);
+case 5058: { // glDrawBuffer
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ weglDrawBuffer(*mode);
}; break;
-case 5116: { // glFrontFace
+case 5059: { // glReadBuffer
GLenum *mode = (GLenum *) bp; bp += 4;
- weglFrontFace(*mode);
+ weglReadBuffer(*mode);
}; break;
-case 5117: { // glFrustum
- GLdouble *left = (GLdouble *) bp; bp += 8;
- GLdouble *right = (GLdouble *) bp; bp += 8;
- GLdouble *bottom = (GLdouble *) bp; bp += 8;
- GLdouble *top = (GLdouble *) bp; bp += 8;
- GLdouble *zNear = (GLdouble *) bp; bp += 8;
- GLdouble *zFar = (GLdouble *) bp; bp += 8;
- weglFrustum(*left,*right,*bottom,*top,*zNear,*zFar);
+case 5060: { // glEnable
+ GLenum *cap = (GLenum *) bp; bp += 4;
+ weglEnable(*cap);
}; break;
-case 5118: { // glGenLists
- GLsizei *range = (GLsizei *) bp; bp += 4;
- GLuint result = weglGenLists(*range);
+case 5061: { // glDisable
+ GLenum *cap = (GLenum *) bp; bp += 4;
+ weglDisable(*cap);
+}; break;
+case 5062: { // glIsEnabled
+ GLenum *cap = (GLenum *) bp; bp += 4;
+ GLboolean result = weglIsEnabled(*cap);
int AP = 0; ErlDrvTermData rt[6];
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
driver_send_term(port,caller,rt,AP);
}; break;
-case 5119: { // glGenTextures
- GLsizei *n = (GLsizei *) bp; bp += 4;
- GLuint *textures;
- textures = (GLuint *) driver_alloc(sizeof(GLuint) * *n);
- weglGenTextures(*n,textures);
- int AP = 0; ErlDrvTermData *rt;
- rt = (ErlDrvTermData *) driver_alloc(sizeof(ErlDrvTermData)*(7 + (*n)*2));
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- for(int i=0; i < *n; i++) {
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) textures[i];}
- rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = (*n)+1;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
- driver_free(rt);
- driver_free(textures);
+case 5063: { // glEnableClientState
+ GLenum *cap = (GLenum *) bp; bp += 4;
+ weglEnableClientState(*cap);
}; break;
-case 5120: { // glGetBooleanv
+case 5064: { // glDisableClientState
+ GLenum *cap = (GLenum *) bp; bp += 4;
+ weglDisableClientState(*cap);
+}; break;
+case 5065: { // glGetBooleanv
GLenum *pname = (GLenum *) bp; bp += 4;
GLboolean params[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
weglGetBooleanv(*pname,params);
@@ -843,22 +523,7 @@ case 5120: { // glGetBooleanv
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
driver_send_term(port,caller,rt,AP);
}; break;
-case 5121: { // glGetClipPlane
- GLenum *plane = (GLenum *) bp; bp += 4;
- GLdouble equation[4] = {0.0,0.0,0.0,0.0};
- weglGetClipPlane(*plane,equation);
- int AP = 0; ErlDrvTermData rt[14];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- GLdouble *equationTmp = equation;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) equationTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) equationTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) equationTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) equationTmp++;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
-}; break;
-case 5122: { // glGetDoublev
+case 5066: { // glGetDoublev
GLenum *pname = (GLenum *) bp; bp += 4;
GLdouble params[16] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
weglGetDoublev(*pname,params);
@@ -885,15 +550,7 @@ case 5122: { // glGetDoublev
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
driver_send_term(port,caller,rt,AP);
}; break;
-case 5123: { // glGetError
- GLenum result = weglGetError();
- int AP = 0; ErlDrvTermData rt[6];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
-}; break;
-case 5124: { // glGetFloatv
+case 5067: { // glGetFloatv
GLenum *pname = (GLenum *) bp; bp += 4;
GLfloat params[16] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
weglGetFloatv(*pname,params);
@@ -921,7 +578,7 @@ case 5124: { // glGetFloatv
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
driver_send_term(port,caller,rt,AP);
}; break;
-case 5125: { // glGetIntegerv
+case 5068: { // glGetIntegerv
GLenum *pname = (GLenum *) bp; bp += 4;
GLint params[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
weglGetIntegerv(*pname,params);
@@ -948,146 +605,38 @@ case 5125: { // glGetIntegerv
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
driver_send_term(port,caller,rt,AP);
}; break;
-case 5126: { // glGetLightfv
- GLenum *light = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLfloat params[4] = {0.0,0.0,0.0,0.0};
- weglGetLightfv(*light,*pname,params);
- int AP = 0; ErlDrvTermData rt[14];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- GLdouble paramsConv[4], *paramsTmp = paramsConv;
- for(int i=0; i < 4; i++) paramsConv[i] = (GLdouble) params[i];
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
-}; break;
-case 5127: { // glGetLightiv
- GLenum *light = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLint params[4] = {0,0,0,0};
- weglGetLightiv(*light,*pname,params);
- int AP = 0; ErlDrvTermData rt[14];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- GLint *paramsTmp = params;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
-}; break;
-case 5128: { // glGetMapdv
- GLenum *target = (GLenum *) bp; bp += 4;
- GLenum *query = (GLenum *) bp; bp += 4;
- GLdouble *v = (GLdouble *) bins[0];
- weglGetMapdv(*target,*query,v);
- int AP = 0; ErlDrvTermData rt[6];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
-}; break;
-case 5129: { // glGetMapfv
- GLenum *target = (GLenum *) bp; bp += 4;
- GLenum *query = (GLenum *) bp; bp += 4;
- GLfloat *v = (GLfloat *) bins[0];
- weglGetMapfv(*target,*query,v);
- int AP = 0; ErlDrvTermData rt[6];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
-}; break;
-case 5130: { // glGetMapiv
- GLenum *target = (GLenum *) bp; bp += 4;
- GLenum *query = (GLenum *) bp; bp += 4;
- GLint *v = (GLint *) bins[0];
- weglGetMapiv(*target,*query,v);
- int AP = 0; ErlDrvTermData rt[6];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
+case 5069: { // glPushAttrib
+ GLbitfield *mask = (GLbitfield *) bp; bp += 4;
+ weglPushAttrib(*mask);
}; break;
-case 5131: { // glGetMaterialfv
- GLenum *face = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLfloat params[4] = {0.0,0.0,0.0,0.0};
- weglGetMaterialfv(*face,*pname,params);
- int AP = 0; ErlDrvTermData rt[14];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- GLdouble paramsConv[4], *paramsTmp = paramsConv;
- for(int i=0; i < 4; i++) paramsConv[i] = (GLdouble) params[i];
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
+case 5070: { // glPopAttrib
+ weglPopAttrib();
}; break;
-case 5132: { // glGetMaterialiv
- GLenum *face = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLint params[4] = {0,0,0,0};
- weglGetMaterialiv(*face,*pname,params);
- int AP = 0; ErlDrvTermData rt[14];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- GLint *paramsTmp = params;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
+case 5071: { // glPushClientAttrib
+ GLbitfield *mask = (GLbitfield *) bp; bp += 4;
+ weglPushClientAttrib(*mask);
}; break;
-case 5133: { // glGetPixelMapfv
- GLenum *map = (GLenum *) bp; bp += 4;
- GLfloat *values = (GLfloat *) bins[0];
- weglGetPixelMapfv(*map,values);
- int AP = 0; ErlDrvTermData rt[6];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
+case 5072: { // glPopClientAttrib
+ weglPopClientAttrib();
}; break;
-case 5134: { // glGetPixelMapuiv
- GLenum *map = (GLenum *) bp; bp += 4;
- GLuint *values = (GLuint *) bins[0];
- weglGetPixelMapuiv(*map,values);
+case 5073: { // glRenderMode
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ GLint result = weglRenderMode(*mode);
int AP = 0; ErlDrvTermData rt[6];
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
driver_send_term(port,caller,rt,AP);
}; break;
-case 5135: { // glGetPixelMapusv
- GLenum *map = (GLenum *) bp; bp += 4;
- GLushort *values = (GLushort *) bins[0];
- weglGetPixelMapusv(*map,values);
+case 5074: { // glGetError
+ GLenum result = weglGetError();
int AP = 0; ErlDrvTermData rt[6];
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
-}; break;
-case 5136: { // glGetPolygonStipple
- ErlDrvBinary *mask = driver_alloc_binary(128);
- weglGetPolygonStipple((GLubyte*) mask->orig_bytes);
- int AP = 0; ErlDrvTermData rt[8];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- rt[AP++] = ERL_DRV_BINARY; rt[AP++] = (ErlDrvTermData) mask; rt[AP++] = 128; rt[AP++] = 0;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
driver_send_term(port,caller,rt,AP);
- driver_free_binary(mask);
}; break;
-case 5137: { // glGetString
+case 5075: { // glGetString
GLenum *name = (GLenum *) bp; bp += 4;
const GLubyte * result = weglGetString(*name);
int AP = 0; ErlDrvTermData rt[7];
@@ -1096,229 +645,139 @@ case 5137: { // glGetString
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
driver_send_term(port,caller,rt,AP);
}; break;
-case 5138: { // glGetTexEnvfv
- GLenum *target = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLfloat params[4] = {0.0,0.0,0.0,0.0};
- weglGetTexEnvfv(*target,*pname,params);
- int AP = 0; ErlDrvTermData rt[14];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- GLdouble paramsConv[4], *paramsTmp = paramsConv;
- for(int i=0; i < 4; i++) paramsConv[i] = (GLdouble) params[i];
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
+case 5076: { // glFinish
+ weglFinish();
}; break;
-case 5139: { // glGetTexEnviv
+case 5077: { // glFlush
+ weglFlush();
+}; break;
+case 5078: { // glHint
GLenum *target = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLint params[4] = {0,0,0,0};
- weglGetTexEnviv(*target,*pname,params);
- int AP = 0; ErlDrvTermData rt[14];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- GLint *paramsTmp = params;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ weglHint(*target,*mode);
}; break;
-case 5140: { // glGetTexGendv
- GLenum *coord = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLdouble params[4] = {0.0,0.0,0.0,0.0};
- weglGetTexGendv(*coord,*pname,params);
- int AP = 0; ErlDrvTermData rt[14];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- GLdouble *paramsTmp = params;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
+case 5079: { // glClearDepth
+ GLclampd *depth = (GLclampd *) bp; bp += 8;
+ weglClearDepth(*depth);
}; break;
-case 5141: { // glGetTexGenfv
- GLenum *coord = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLfloat params[4] = {0.0,0.0,0.0,0.0};
- weglGetTexGenfv(*coord,*pname,params);
- int AP = 0; ErlDrvTermData rt[14];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- GLdouble paramsConv[4], *paramsTmp = paramsConv;
- for(int i=0; i < 4; i++) paramsConv[i] = (GLdouble) params[i];
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
+case 5080: { // glDepthFunc
+ GLenum *func = (GLenum *) bp; bp += 4;
+ weglDepthFunc(*func);
}; break;
-case 5142: { // glGetTexGeniv
- GLenum *coord = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLint params[4] = {0,0,0,0};
- weglGetTexGeniv(*coord,*pname,params);
- int AP = 0; ErlDrvTermData rt[14];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- GLint *paramsTmp = params;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
+case 5081: { // glDepthMask
+ GLboolean *flag = (GLboolean *) bp; bp += 1;
+ weglDepthMask(*flag);
}; break;
-case 5143: { // glGetTexImage
- GLenum *target = (GLenum *) bp; bp += 4;
- GLint *level = (GLint *) bp; bp += 4;
- GLenum *format = (GLenum *) bp; bp += 4;
- GLenum *type = (GLenum *) bp; bp += 4;
- GLvoid *pixels = (GLvoid *) bins[0];
- weglGetTexImage(*target,*level,*format,*type,pixels);
- int AP = 0; ErlDrvTermData rt[6];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
+case 5082: { // glDepthRange
+ GLclampd *near_val = (GLclampd *) bp; bp += 8;
+ GLclampd *far_val = (GLclampd *) bp; bp += 8;
+ weglDepthRange(*near_val,*far_val);
}; break;
-case 5144: { // glGetTexLevelParameterfv
- GLenum *target = (GLenum *) bp; bp += 4;
- GLint *level = (GLint *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLfloat params[1] = {0.0};
- weglGetTexLevelParameterfv(*target,*level,*pname,params);
- int AP = 0; ErlDrvTermData rt[8];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- GLdouble paramsConv[1], *paramsTmp = paramsConv;
- for(int i=0; i < 1; i++) paramsConv[i] = (GLdouble) params[i];
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 1;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
+case 5083: { // glClearAccum
+ GLfloat *red = (GLfloat *) bp; bp += 4;
+ GLfloat *green = (GLfloat *) bp; bp += 4;
+ GLfloat *blue = (GLfloat *) bp; bp += 4;
+ GLfloat *alpha = (GLfloat *) bp; bp += 4;
+ weglClearAccum(*red,*green,*blue,*alpha);
}; break;
-case 5145: { // glGetTexLevelParameteriv
- GLenum *target = (GLenum *) bp; bp += 4;
- GLint *level = (GLint *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLint params[1] = {0};
- weglGetTexLevelParameteriv(*target,*level,*pname,params);
- int AP = 0; ErlDrvTermData rt[8];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- GLint *paramsTmp = params;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 1;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
+case 5084: { // glAccum
+ GLenum *op = (GLenum *) bp; bp += 4;
+ GLfloat *value = (GLfloat *) bp; bp += 4;
+ weglAccum(*op,*value);
}; break;
-case 5146: { // glGetTexParameterfv
- GLenum *target = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLfloat params[4] = {0.0,0.0,0.0,0.0};
- weglGetTexParameterfv(*target,*pname,params);
- int AP = 0; ErlDrvTermData rt[14];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- GLdouble paramsConv[4], *paramsTmp = paramsConv;
- for(int i=0; i < 4; i++) paramsConv[i] = (GLdouble) params[i];
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
+case 5085: { // glMatrixMode
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ weglMatrixMode(*mode);
}; break;
-case 5147: { // glGetTexParameteriv
- GLenum *target = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLint params[4] = {0,0,0,0};
- weglGetTexParameteriv(*target,*pname,params);
- int AP = 0; ErlDrvTermData rt[14];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- GLint *paramsTmp = params;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
+case 5086: { // glOrtho
+ GLdouble *left = (GLdouble *) bp; bp += 8;
+ GLdouble *right = (GLdouble *) bp; bp += 8;
+ GLdouble *bottom = (GLdouble *) bp; bp += 8;
+ GLdouble *top = (GLdouble *) bp; bp += 8;
+ GLdouble *near_val = (GLdouble *) bp; bp += 8;
+ GLdouble *far_val = (GLdouble *) bp; bp += 8;
+ weglOrtho(*left,*right,*bottom,*top,*near_val,*far_val);
}; break;
-case 5148: { // glHint
- GLenum *target = (GLenum *) bp; bp += 4;
- GLenum *mode = (GLenum *) bp; bp += 4;
- weglHint(*target,*mode);
+case 5087: { // glFrustum
+ GLdouble *left = (GLdouble *) bp; bp += 8;
+ GLdouble *right = (GLdouble *) bp; bp += 8;
+ GLdouble *bottom = (GLdouble *) bp; bp += 8;
+ GLdouble *top = (GLdouble *) bp; bp += 8;
+ GLdouble *near_val = (GLdouble *) bp; bp += 8;
+ GLdouble *far_val = (GLdouble *) bp; bp += 8;
+ weglFrustum(*left,*right,*bottom,*top,*near_val,*far_val);
}; break;
-case 5149: { // glIndexMask
- GLuint *mask = (GLuint *) bp; bp += 4;
- weglIndexMask(*mask);
+case 5088: { // glViewport
+ GLint *x = (GLint *) bp; bp += 4;
+ GLint *y = (GLint *) bp; bp += 4;
+ GLsizei *width = (GLsizei *) bp; bp += 4;
+ GLsizei *height = (GLsizei *) bp; bp += 4;
+ weglViewport(*x,*y,*width,*height);
}; break;
-case 5150: { // glIndexPointer
- GLenum *type = (GLenum *) bp; bp += 4;
- GLsizei *stride = (GLsizei *) bp; bp += 4;
- GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
- weglIndexPointer(*type,*stride,pointer);
+case 5089: { // glPushMatrix
+ weglPushMatrix();
}; break;
-case 5151: { // glIndexPointer
- GLenum *type = (GLenum *) bp; bp += 4;
- GLsizei *stride = (GLsizei *) bp; bp += 4;
- GLvoid *pointer = (GLvoid *) bins[0];
- weglIndexPointer(*type,*stride,pointer);
+case 5090: { // glPopMatrix
+ weglPopMatrix();
}; break;
-case 5152: { // glIndexdv
- GLdouble *c = (GLdouble *) bp; bp += 8;
- weglIndexdv(c);
+case 5091: { // glLoadIdentity
+ weglLoadIdentity();
}; break;
-case 5153: { // glIndexfv
- GLfloat *c = (GLfloat *) bp; bp += 4;
- weglIndexfv(c);
+case 5092: { // glLoadMatrixd
+ GLdouble * m = (GLdouble *) bp; bp += 128;
+ weglLoadMatrixd(m);
}; break;
-case 5154: { // glIndexiv
- GLint *c = (GLint *) bp; bp += 4;
- weglIndexiv(c);
+case 5093: { // glLoadMatrixf
+ GLfloat * m = (GLfloat *) bp; bp += 64;
+ weglLoadMatrixf(m);
}; break;
-case 5155: { // glIndexsv
- GLshort *c = (GLshort *) bp; bp += 2;
- weglIndexsv(c);
+case 5094: { // glMultMatrixd
+ GLdouble * m = (GLdouble *) bp; bp += 128;
+ weglMultMatrixd(m);
}; break;
-case 5156: { // glIndexubv
- GLubyte *c = (GLubyte *) bp; bp += 1;
- weglIndexubv(c);
+case 5095: { // glMultMatrixf
+ GLfloat * m = (GLfloat *) bp; bp += 64;
+ weglMultMatrixf(m);
}; break;
-case 5157: { // glInitNames
- weglInitNames();
+case 5096: { // glRotated
+ GLdouble *angle = (GLdouble *) bp; bp += 8;
+ GLdouble *x = (GLdouble *) bp; bp += 8;
+ GLdouble *y = (GLdouble *) bp; bp += 8;
+ GLdouble *z = (GLdouble *) bp; bp += 8;
+ weglRotated(*angle,*x,*y,*z);
}; break;
-case 5158: { // glInterleavedArrays
- GLenum *format = (GLenum *) bp; bp += 4;
- GLsizei *stride = (GLsizei *) bp; bp += 4;
- GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
- weglInterleavedArrays(*format,*stride,pointer);
+case 5097: { // glRotatef
+ GLfloat *angle = (GLfloat *) bp; bp += 4;
+ GLfloat *x = (GLfloat *) bp; bp += 4;
+ GLfloat *y = (GLfloat *) bp; bp += 4;
+ GLfloat *z = (GLfloat *) bp; bp += 4;
+ weglRotatef(*angle,*x,*y,*z);
}; break;
-case 5159: { // glInterleavedArrays
- GLenum *format = (GLenum *) bp; bp += 4;
- GLsizei *stride = (GLsizei *) bp; bp += 4;
- GLvoid *pointer = (GLvoid *) bins[0];
- weglInterleavedArrays(*format,*stride,pointer);
+case 5098: { // glScaled
+ GLdouble *x = (GLdouble *) bp; bp += 8;
+ GLdouble *y = (GLdouble *) bp; bp += 8;
+ GLdouble *z = (GLdouble *) bp; bp += 8;
+ weglScaled(*x,*y,*z);
}; break;
-case 5160: { // glIsEnabled
- GLenum *cap = (GLenum *) bp; bp += 4;
- GLboolean result = weglIsEnabled(*cap);
- int AP = 0; ErlDrvTermData rt[6];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
+case 5099: { // glScalef
+ GLfloat *x = (GLfloat *) bp; bp += 4;
+ GLfloat *y = (GLfloat *) bp; bp += 4;
+ GLfloat *z = (GLfloat *) bp; bp += 4;
+ weglScalef(*x,*y,*z);
}; break;
-case 5161: { // glIsList
+case 5100: { // glTranslated
+ GLdouble *x = (GLdouble *) bp; bp += 8;
+ GLdouble *y = (GLdouble *) bp; bp += 8;
+ GLdouble *z = (GLdouble *) bp; bp += 8;
+ weglTranslated(*x,*y,*z);
+}; break;
+case 5101: { // glTranslatef
+ GLfloat *x = (GLfloat *) bp; bp += 4;
+ GLfloat *y = (GLfloat *) bp; bp += 4;
+ GLfloat *z = (GLfloat *) bp; bp += 4;
+ weglTranslatef(*x,*y,*z);
+}; break;
+case 5102: { // glIsList
GLuint *list = (GLuint *) bp; bp += 4;
GLboolean result = weglIsList(*list);
int AP = 0; ErlDrvTermData rt[6];
@@ -1327,760 +786,1129 @@ case 5161: { // glIsList
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
driver_send_term(port,caller,rt,AP);
}; break;
-case 5162: { // glIsTexture
- GLuint *texture = (GLuint *) bp; bp += 4;
- GLboolean result = weglIsTexture(*texture);
+case 5103: { // glDeleteLists
+ GLuint *list = (GLuint *) bp; bp += 4;
+ GLsizei *range = (GLsizei *) bp; bp += 4;
+ weglDeleteLists(*list,*range);
+}; break;
+case 5104: { // glGenLists
+ GLsizei *range = (GLsizei *) bp; bp += 4;
+ GLuint result = weglGenLists(*range);
int AP = 0; ErlDrvTermData rt[6];
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
driver_send_term(port,caller,rt,AP);
}; break;
-case 5163: { // glLightModelf
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLfloat *param = (GLfloat *) bp; bp += 4;
- weglLightModelf(*pname,*param);
-}; break;
-case 5164: { // glLightModelfv
- GLenum *pname = (GLenum *) bp; bp += 4;
- int *paramsLen = (int *) bp; bp += 4;
- GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+0)%2*4;
- weglLightModelfv(*pname,params);
-}; break;
-case 5165: { // glLightModeli
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLint *param = (GLint *) bp; bp += 4;
- weglLightModeli(*pname,*param);
-}; break;
-case 5166: { // glLightModeliv
- GLenum *pname = (GLenum *) bp; bp += 4;
- int *paramsLen = (int *) bp; bp += 4;
- GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+0)%2*4;
- weglLightModeliv(*pname,params);
+case 5105: { // glNewList
+ GLuint *list = (GLuint *) bp; bp += 4;
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ weglNewList(*list,*mode);
}; break;
-case 5167: { // glLightf
- GLenum *light = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLfloat *param = (GLfloat *) bp; bp += 4;
- weglLightf(*light,*pname,*param);
+case 5106: { // glEndList
+ weglEndList();
}; break;
-case 5168: { // glLightfv
- GLenum *light = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- int *paramsLen = (int *) bp; bp += 4;
- GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
- weglLightfv(*light,*pname,params);
+case 5107: { // glCallList
+ GLuint *list = (GLuint *) bp; bp += 4;
+ weglCallList(*list);
}; break;
-case 5169: { // glLighti
- GLenum *light = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLint *param = (GLint *) bp; bp += 4;
- weglLighti(*light,*pname,*param);
+case 5108: { // glCallLists
+ int * listsLen = (int *) bp; bp += 4;
+ GLuint * lists = (GLuint *) bp; bp += (8-((*listsLen*4+4)%8))%8;
+ weglCallLists(*listsLen,GL_UNSIGNED_INT,lists);
}; break;
-case 5170: { // glLightiv
- GLenum *light = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- int *paramsLen = (int *) bp; bp += 4;
- GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
- weglLightiv(*light,*pname,params);
+case 5109: { // glListBase
+ GLuint *base = (GLuint *) bp; bp += 4;
+ weglListBase(*base);
}; break;
-case 5171: { // glLineStipple
- GLint *factor = (GLint *) bp; bp += 4;
- GLushort *pattern = (GLushort *) bp; bp += 2;
- weglLineStipple(*factor,*pattern);
+case 5110: { // glBegin
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ weglBegin(*mode);
}; break;
-case 5172: { // glLineWidth
- GLfloat *width = (GLfloat *) bp; bp += 4;
- weglLineWidth(*width);
+case 5111: { // glEnd
+ weglEnd();
}; break;
-case 5173: { // glListBase
- GLuint *base = (GLuint *) bp; bp += 4;
- weglListBase(*base);
+case 5112: { // glVertex2dv
+ GLdouble *v = (GLdouble *) bp; bp += 8;
+ weglVertex2dv(v);
}; break;
-case 5174: { // glLoadIdentity
- weglLoadIdentity();
+case 5113: { // glVertex2fv
+ GLfloat *v = (GLfloat *) bp; bp += 4;
+ weglVertex2fv(v);
}; break;
-case 5175: { // glLoadMatrixd
- GLdouble * m = (GLdouble *) bp; bp += 128;
- weglLoadMatrixd(m);
+case 5114: { // glVertex2iv
+ GLint *v = (GLint *) bp; bp += 4;
+ weglVertex2iv(v);
}; break;
-case 5176: { // glLoadMatrixf
- GLfloat * m = (GLfloat *) bp; bp += 64;
- weglLoadMatrixf(m);
+case 5115: { // glVertex2sv
+ GLshort *v = (GLshort *) bp; bp += 2;
+ weglVertex2sv(v);
}; break;
-case 5177: { // glLoadName
- GLuint *name = (GLuint *) bp; bp += 4;
- weglLoadName(*name);
+case 5116: { // glVertex3dv
+ GLdouble *v = (GLdouble *) bp; bp += 8;
+ weglVertex3dv(v);
}; break;
-case 5178: { // glLogicOp
- GLenum *opcode = (GLenum *) bp; bp += 4;
- weglLogicOp(*opcode);
+case 5117: { // glVertex3fv
+ GLfloat *v = (GLfloat *) bp; bp += 4;
+ weglVertex3fv(v);
}; break;
-case 5179: { // glMap1d
- GLenum *target = (GLenum *) bp; bp += 4;
- bp += 4;
- GLdouble *u1 = (GLdouble *) bp; bp += 8;
- GLdouble *u2 = (GLdouble *) bp; bp += 8;
- GLint *stride = (GLint *) bp; bp += 4;
- GLint *order = (GLint *) bp; bp += 4;
- GLdouble *points = (GLdouble *) bins[0];
- weglMap1d(*target,*u1,*u2,*stride,*order,points);
+case 5118: { // glVertex3iv
+ GLint *v = (GLint *) bp; bp += 4;
+ weglVertex3iv(v);
}; break;
-case 5180: { // glMap1f
- GLenum *target = (GLenum *) bp; bp += 4;
- GLfloat *u1 = (GLfloat *) bp; bp += 4;
- GLfloat *u2 = (GLfloat *) bp; bp += 4;
- GLint *stride = (GLint *) bp; bp += 4;
- GLint *order = (GLint *) bp; bp += 4;
- GLfloat *points = (GLfloat *) bins[0];
- weglMap1f(*target,*u1,*u2,*stride,*order,points);
+case 5119: { // glVertex3sv
+ GLshort *v = (GLshort *) bp; bp += 2;
+ weglVertex3sv(v);
}; break;
-case 5181: { // glMap2d
- GLenum *target = (GLenum *) bp; bp += 4;
- bp += 4;
- GLdouble *u1 = (GLdouble *) bp; bp += 8;
- GLdouble *u2 = (GLdouble *) bp; bp += 8;
- GLint *ustride = (GLint *) bp; bp += 4;
- GLint *uorder = (GLint *) bp; bp += 4;
- GLdouble *v1 = (GLdouble *) bp; bp += 8;
- GLdouble *v2 = (GLdouble *) bp; bp += 8;
- GLint *vstride = (GLint *) bp; bp += 4;
- GLint *vorder = (GLint *) bp; bp += 4;
- GLdouble *points = (GLdouble *) bins[0];
- weglMap2d(*target,*u1,*u2,*ustride,*uorder,*v1,*v2,*vstride,*vorder,points);
+case 5120: { // glVertex4dv
+ GLdouble *v = (GLdouble *) bp; bp += 8;
+ weglVertex4dv(v);
}; break;
-case 5182: { // glMap2f
- GLenum *target = (GLenum *) bp; bp += 4;
- GLfloat *u1 = (GLfloat *) bp; bp += 4;
- GLfloat *u2 = (GLfloat *) bp; bp += 4;
- GLint *ustride = (GLint *) bp; bp += 4;
- GLint *uorder = (GLint *) bp; bp += 4;
- GLfloat *v1 = (GLfloat *) bp; bp += 4;
- GLfloat *v2 = (GLfloat *) bp; bp += 4;
- GLint *vstride = (GLint *) bp; bp += 4;
- GLint *vorder = (GLint *) bp; bp += 4;
- GLfloat *points = (GLfloat *) bins[0];
- weglMap2f(*target,*u1,*u2,*ustride,*uorder,*v1,*v2,*vstride,*vorder,points);
+case 5121: { // glVertex4fv
+ GLfloat *v = (GLfloat *) bp; bp += 4;
+ weglVertex4fv(v);
}; break;
-case 5183: { // glMapGrid1d
- GLint *un = (GLint *) bp; bp += 4;
- bp += 4;
- GLdouble *u1 = (GLdouble *) bp; bp += 8;
- GLdouble *u2 = (GLdouble *) bp; bp += 8;
- weglMapGrid1d(*un,*u1,*u2);
+case 5122: { // glVertex4iv
+ GLint *v = (GLint *) bp; bp += 4;
+ weglVertex4iv(v);
}; break;
-case 5184: { // glMapGrid1f
- GLint *un = (GLint *) bp; bp += 4;
- GLfloat *u1 = (GLfloat *) bp; bp += 4;
- GLfloat *u2 = (GLfloat *) bp; bp += 4;
- weglMapGrid1f(*un,*u1,*u2);
+case 5123: { // glVertex4sv
+ GLshort *v = (GLshort *) bp; bp += 2;
+ weglVertex4sv(v);
}; break;
-case 5185: { // glMapGrid2d
- GLint *un = (GLint *) bp; bp += 4;
- bp += 4;
- GLdouble *u1 = (GLdouble *) bp; bp += 8;
- GLdouble *u2 = (GLdouble *) bp; bp += 8;
- GLint *vn = (GLint *) bp; bp += 4;
- bp += 4;
- GLdouble *v1 = (GLdouble *) bp; bp += 8;
- GLdouble *v2 = (GLdouble *) bp; bp += 8;
- weglMapGrid2d(*un,*u1,*u2,*vn,*v1,*v2);
+case 5124: { // glNormal3bv
+ GLbyte *v = (GLbyte *) bp; bp += 1;
+ weglNormal3bv(v);
}; break;
-case 5186: { // glMapGrid2f
- GLint *un = (GLint *) bp; bp += 4;
- GLfloat *u1 = (GLfloat *) bp; bp += 4;
- GLfloat *u2 = (GLfloat *) bp; bp += 4;
- GLint *vn = (GLint *) bp; bp += 4;
- GLfloat *v1 = (GLfloat *) bp; bp += 4;
- GLfloat *v2 = (GLfloat *) bp; bp += 4;
- weglMapGrid2f(*un,*u1,*u2,*vn,*v1,*v2);
+case 5125: { // glNormal3dv
+ GLdouble *v = (GLdouble *) bp; bp += 8;
+ weglNormal3dv(v);
}; break;
-case 5187: { // glMaterialf
- GLenum *face = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLfloat *param = (GLfloat *) bp; bp += 4;
- weglMaterialf(*face,*pname,*param);
+case 5126: { // glNormal3fv
+ GLfloat *v = (GLfloat *) bp; bp += 4;
+ weglNormal3fv(v);
}; break;
-case 5188: { // glMaterialfv
- GLenum *face = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- int *paramsLen = (int *) bp; bp += 4;
- GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
- weglMaterialfv(*face,*pname,params);
+case 5127: { // glNormal3iv
+ GLint *v = (GLint *) bp; bp += 4;
+ weglNormal3iv(v);
}; break;
-case 5189: { // glMateriali
- GLenum *face = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLint *param = (GLint *) bp; bp += 4;
- weglMateriali(*face,*pname,*param);
+case 5128: { // glNormal3sv
+ GLshort *v = (GLshort *) bp; bp += 2;
+ weglNormal3sv(v);
}; break;
-case 5190: { // glMaterialiv
- GLenum *face = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- int *paramsLen = (int *) bp; bp += 4;
- GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
- weglMaterialiv(*face,*pname,params);
+case 5129: { // glIndexdv
+ GLdouble *c = (GLdouble *) bp; bp += 8;
+ weglIndexdv(c);
}; break;
-case 5191: { // glMatrixMode
- GLenum *mode = (GLenum *) bp; bp += 4;
- weglMatrixMode(*mode);
+case 5130: { // glIndexfv
+ GLfloat *c = (GLfloat *) bp; bp += 4;
+ weglIndexfv(c);
}; break;
-case 5192: { // glMultMatrixd
- GLdouble * m = (GLdouble *) bp; bp += 128;
- weglMultMatrixd(m);
+case 5131: { // glIndexiv
+ GLint *c = (GLint *) bp; bp += 4;
+ weglIndexiv(c);
}; break;
-case 5193: { // glMultMatrixf
- GLfloat * m = (GLfloat *) bp; bp += 64;
- weglMultMatrixf(m);
+case 5132: { // glIndexsv
+ GLshort *c = (GLshort *) bp; bp += 2;
+ weglIndexsv(c);
}; break;
-case 5194: { // glNewList
- GLuint *list = (GLuint *) bp; bp += 4;
- GLenum *mode = (GLenum *) bp; bp += 4;
- weglNewList(*list,*mode);
+case 5133: { // glIndexubv
+ GLubyte *c = (GLubyte *) bp; bp += 1;
+ weglIndexubv(c);
}; break;
-case 5195: { // glNormal3bv
+case 5134: { // glColor3bv
GLbyte *v = (GLbyte *) bp; bp += 1;
- weglNormal3bv(v);
+ weglColor3bv(v);
}; break;
-case 5196: { // glNormal3dv
+case 5135: { // glColor3dv
GLdouble *v = (GLdouble *) bp; bp += 8;
- weglNormal3dv(v);
+ weglColor3dv(v);
}; break;
-case 5197: { // glNormal3fv
+case 5136: { // glColor3fv
GLfloat *v = (GLfloat *) bp; bp += 4;
- weglNormal3fv(v);
+ weglColor3fv(v);
}; break;
-case 5198: { // glNormal3iv
+case 5137: { // glColor3iv
GLint *v = (GLint *) bp; bp += 4;
- weglNormal3iv(v);
+ weglColor3iv(v);
}; break;
-case 5199: { // glNormal3sv
+case 5138: { // glColor3sv
GLshort *v = (GLshort *) bp; bp += 2;
- weglNormal3sv(v);
+ weglColor3sv(v);
}; break;
-case 5200: { // glNormalPointer
- GLenum *type = (GLenum *) bp; bp += 4;
- GLsizei *stride = (GLsizei *) bp; bp += 4;
- GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
- weglNormalPointer(*type,*stride,pointer);
+case 5139: { // glColor3ubv
+ GLubyte *v = (GLubyte *) bp; bp += 1;
+ weglColor3ubv(v);
}; break;
-case 5201: { // glNormalPointer
- GLenum *type = (GLenum *) bp; bp += 4;
- GLsizei *stride = (GLsizei *) bp; bp += 4;
- GLvoid *pointer = (GLvoid *) bins[0];
- weglNormalPointer(*type,*stride,pointer);
+case 5140: { // glColor3uiv
+ GLuint *v = (GLuint *) bp; bp += 4;
+ weglColor3uiv(v);
}; break;
-case 5202: { // glOrtho
- GLdouble *left = (GLdouble *) bp; bp += 8;
- GLdouble *right = (GLdouble *) bp; bp += 8;
- GLdouble *bottom = (GLdouble *) bp; bp += 8;
- GLdouble *top = (GLdouble *) bp; bp += 8;
- GLdouble *zNear = (GLdouble *) bp; bp += 8;
- GLdouble *zFar = (GLdouble *) bp; bp += 8;
- weglOrtho(*left,*right,*bottom,*top,*zNear,*zFar);
+case 5141: { // glColor3usv
+ GLushort *v = (GLushort *) bp; bp += 2;
+ weglColor3usv(v);
}; break;
-case 5203: { // glPassThrough
- GLfloat *token = (GLfloat *) bp; bp += 4;
- weglPassThrough(*token);
+case 5142: { // glColor4bv
+ GLbyte *v = (GLbyte *) bp; bp += 1;
+ weglColor4bv(v);
}; break;
-case 5204: { // glPixelMapfv
- GLenum *map = (GLenum *) bp; bp += 4;
- GLsizei *mapsize = (GLsizei *) bp; bp += 4;
- GLfloat *values = (GLfloat *) bins[0];
- weglPixelMapfv(*map,*mapsize,values);
+case 5143: { // glColor4dv
+ GLdouble *v = (GLdouble *) bp; bp += 8;
+ weglColor4dv(v);
}; break;
-case 5205: { // glPixelMapuiv
- GLenum *map = (GLenum *) bp; bp += 4;
- GLsizei *mapsize = (GLsizei *) bp; bp += 4;
- GLuint *values = (GLuint *) bins[0];
- weglPixelMapuiv(*map,*mapsize,values);
+case 5144: { // glColor4fv
+ GLfloat *v = (GLfloat *) bp; bp += 4;
+ weglColor4fv(v);
}; break;
-case 5206: { // glPixelMapusv
- GLenum *map = (GLenum *) bp; bp += 4;
- GLsizei *mapsize = (GLsizei *) bp; bp += 4;
- GLushort *values = (GLushort *) bins[0];
- weglPixelMapusv(*map,*mapsize,values);
+case 5145: { // glColor4iv
+ GLint *v = (GLint *) bp; bp += 4;
+ weglColor4iv(v);
}; break;
-case 5207: { // glPixelStoref
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLfloat *param = (GLfloat *) bp; bp += 4;
- weglPixelStoref(*pname,*param);
+case 5146: { // glColor4sv
+ GLshort *v = (GLshort *) bp; bp += 2;
+ weglColor4sv(v);
}; break;
-case 5208: { // glPixelStorei
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLint *param = (GLint *) bp; bp += 4;
- weglPixelStorei(*pname,*param);
+case 5147: { // glColor4ubv
+ GLubyte *v = (GLubyte *) bp; bp += 1;
+ weglColor4ubv(v);
}; break;
-case 5209: { // glPixelTransferf
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLfloat *param = (GLfloat *) bp; bp += 4;
- weglPixelTransferf(*pname,*param);
+case 5148: { // glColor4uiv
+ GLuint *v = (GLuint *) bp; bp += 4;
+ weglColor4uiv(v);
}; break;
-case 5210: { // glPixelTransferi
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLint *param = (GLint *) bp; bp += 4;
- weglPixelTransferi(*pname,*param);
+case 5149: { // glColor4usv
+ GLushort *v = (GLushort *) bp; bp += 2;
+ weglColor4usv(v);
}; break;
-case 5211: { // glPixelZoom
- GLfloat *xfactor = (GLfloat *) bp; bp += 4;
- GLfloat *yfactor = (GLfloat *) bp; bp += 4;
- weglPixelZoom(*xfactor,*yfactor);
+case 5150: { // glTexCoord1dv
+ GLdouble *v = (GLdouble *) bp; bp += 8;
+ weglTexCoord1dv(v);
}; break;
-case 5212: { // glPointSize
- GLfloat *size = (GLfloat *) bp; bp += 4;
- weglPointSize(*size);
+case 5151: { // glTexCoord1fv
+ GLfloat *v = (GLfloat *) bp; bp += 4;
+ weglTexCoord1fv(v);
}; break;
-case 5213: { // glPolygonMode
- GLenum *face = (GLenum *) bp; bp += 4;
- GLenum *mode = (GLenum *) bp; bp += 4;
- weglPolygonMode(*face,*mode);
+case 5152: { // glTexCoord1iv
+ GLint *v = (GLint *) bp; bp += 4;
+ weglTexCoord1iv(v);
}; break;
-case 5214: { // glPolygonOffset
- GLfloat *factor = (GLfloat *) bp; bp += 4;
- GLfloat *units = (GLfloat *) bp; bp += 4;
- weglPolygonOffset(*factor,*units);
+case 5153: { // glTexCoord1sv
+ GLshort *v = (GLshort *) bp; bp += 2;
+ weglTexCoord1sv(v);
}; break;
-case 5215: { // glPolygonStipple
- GLubyte *mask = (GLubyte *) bins[0];
- weglPolygonStipple(mask);
+case 5154: { // glTexCoord2dv
+ GLdouble *v = (GLdouble *) bp; bp += 8;
+ weglTexCoord2dv(v);
}; break;
-case 5216: { // glPopAttrib
- weglPopAttrib();
+case 5155: { // glTexCoord2fv
+ GLfloat *v = (GLfloat *) bp; bp += 4;
+ weglTexCoord2fv(v);
}; break;
-case 5217: { // glPopClientAttrib
- weglPopClientAttrib();
+case 5156: { // glTexCoord2iv
+ GLint *v = (GLint *) bp; bp += 4;
+ weglTexCoord2iv(v);
}; break;
-case 5218: { // glPopMatrix
- weglPopMatrix();
+case 5157: { // glTexCoord2sv
+ GLshort *v = (GLshort *) bp; bp += 2;
+ weglTexCoord2sv(v);
}; break;
-case 5219: { // glPopName
- weglPopName();
+case 5158: { // glTexCoord3dv
+ GLdouble *v = (GLdouble *) bp; bp += 8;
+ weglTexCoord3dv(v);
}; break;
-case 5220: { // glPrioritizeTextures
- int * texturesLen = (int *) bp; bp += 4;
- GLuint * textures = (GLuint *) bp; bp += (8-((*texturesLen*4+4)%8))%8;
- int * prioritiesLen = (int *) bp; bp += 4;
- GLclampf * priorities = (GLclampf *) bp; bp += (8-((*prioritiesLen*4+4)%8))%8;
- weglPrioritizeTextures(*texturesLen,textures,priorities);
+case 5159: { // glTexCoord3fv
+ GLfloat *v = (GLfloat *) bp; bp += 4;
+ weglTexCoord3fv(v);
}; break;
-case 5221: { // glPushAttrib
- GLbitfield *mask = (GLbitfield *) bp; bp += 4;
- weglPushAttrib(*mask);
+case 5160: { // glTexCoord3iv
+ GLint *v = (GLint *) bp; bp += 4;
+ weglTexCoord3iv(v);
}; break;
-case 5222: { // glPushClientAttrib
- GLbitfield *mask = (GLbitfield *) bp; bp += 4;
- weglPushClientAttrib(*mask);
+case 5161: { // glTexCoord3sv
+ GLshort *v = (GLshort *) bp; bp += 2;
+ weglTexCoord3sv(v);
}; break;
-case 5223: { // glPushMatrix
- weglPushMatrix();
+case 5162: { // glTexCoord4dv
+ GLdouble *v = (GLdouble *) bp; bp += 8;
+ weglTexCoord4dv(v);
}; break;
-case 5224: { // glPushName
- GLuint *name = (GLuint *) bp; bp += 4;
- weglPushName(*name);
+case 5163: { // glTexCoord4fv
+ GLfloat *v = (GLfloat *) bp; bp += 4;
+ weglTexCoord4fv(v);
}; break;
-case 5225: { // glRasterPos2dv
+case 5164: { // glTexCoord4iv
+ GLint *v = (GLint *) bp; bp += 4;
+ weglTexCoord4iv(v);
+}; break;
+case 5165: { // glTexCoord4sv
+ GLshort *v = (GLshort *) bp; bp += 2;
+ weglTexCoord4sv(v);
+}; break;
+case 5166: { // glRasterPos2dv
GLdouble *v = (GLdouble *) bp; bp += 8;
weglRasterPos2dv(v);
}; break;
-case 5226: { // glRasterPos2fv
+case 5167: { // glRasterPos2fv
GLfloat *v = (GLfloat *) bp; bp += 4;
weglRasterPos2fv(v);
}; break;
-case 5227: { // glRasterPos2iv
+case 5168: { // glRasterPos2iv
GLint *v = (GLint *) bp; bp += 4;
weglRasterPos2iv(v);
}; break;
-case 5228: { // glRasterPos2sv
+case 5169: { // glRasterPos2sv
GLshort *v = (GLshort *) bp; bp += 2;
weglRasterPos2sv(v);
}; break;
-case 5229: { // glRasterPos3dv
+case 5170: { // glRasterPos3dv
GLdouble *v = (GLdouble *) bp; bp += 8;
weglRasterPos3dv(v);
}; break;
-case 5230: { // glRasterPos3fv
+case 5171: { // glRasterPos3fv
GLfloat *v = (GLfloat *) bp; bp += 4;
weglRasterPos3fv(v);
}; break;
-case 5231: { // glRasterPos3iv
+case 5172: { // glRasterPos3iv
GLint *v = (GLint *) bp; bp += 4;
weglRasterPos3iv(v);
}; break;
-case 5232: { // glRasterPos3sv
+case 5173: { // glRasterPos3sv
GLshort *v = (GLshort *) bp; bp += 2;
weglRasterPos3sv(v);
}; break;
-case 5233: { // glRasterPos4dv
+case 5174: { // glRasterPos4dv
GLdouble *v = (GLdouble *) bp; bp += 8;
weglRasterPos4dv(v);
}; break;
-case 5234: { // glRasterPos4fv
+case 5175: { // glRasterPos4fv
GLfloat *v = (GLfloat *) bp; bp += 4;
weglRasterPos4fv(v);
}; break;
-case 5235: { // glRasterPos4iv
+case 5176: { // glRasterPos4iv
GLint *v = (GLint *) bp; bp += 4;
weglRasterPos4iv(v);
}; break;
-case 5236: { // glRasterPos4sv
+case 5177: { // glRasterPos4sv
GLshort *v = (GLshort *) bp; bp += 2;
weglRasterPos4sv(v);
}; break;
-case 5237: { // glReadBuffer
- GLenum *mode = (GLenum *) bp; bp += 4;
- weglReadBuffer(*mode);
-}; break;
-case 5238: { // glReadPixels
- GLint *x = (GLint *) bp; bp += 4;
- GLint *y = (GLint *) bp; bp += 4;
- GLsizei *width = (GLsizei *) bp; bp += 4;
- GLsizei *height = (GLsizei *) bp; bp += 4;
- GLenum *format = (GLenum *) bp; bp += 4;
- GLenum *type = (GLenum *) bp; bp += 4;
- GLvoid *pixels = (GLvoid *) bins[0];
- weglReadPixels(*x,*y,*width,*height,*format,*type,pixels);
- int AP = 0; ErlDrvTermData rt[6];
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
- rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
- driver_send_term(port,caller,rt,AP);
-}; break;
-case 5239: { // glRectd
+case 5178: { // glRectd
GLdouble *x1 = (GLdouble *) bp; bp += 8;
GLdouble *y1 = (GLdouble *) bp; bp += 8;
GLdouble *x2 = (GLdouble *) bp; bp += 8;
GLdouble *y2 = (GLdouble *) bp; bp += 8;
weglRectd(*x1,*y1,*x2,*y2);
}; break;
-case 5240: { // glRectdv
- GLdouble * v1 = (GLdouble *) bp; bp += 16;
- GLdouble * v2 = (GLdouble *) bp; bp += 16;
- weglRectdv(v1,v2);
-}; break;
-case 5241: { // glRectf
+case 5179: { // glRectf
GLfloat *x1 = (GLfloat *) bp; bp += 4;
GLfloat *y1 = (GLfloat *) bp; bp += 4;
GLfloat *x2 = (GLfloat *) bp; bp += 4;
GLfloat *y2 = (GLfloat *) bp; bp += 4;
weglRectf(*x1,*y1,*x2,*y2);
}; break;
-case 5242: { // glRectfv
- GLfloat * v1 = (GLfloat *) bp; bp += 8;
- GLfloat * v2 = (GLfloat *) bp; bp += 8;
- weglRectfv(v1,v2);
-}; break;
-case 5243: { // glRecti
+case 5180: { // glRecti
GLint *x1 = (GLint *) bp; bp += 4;
GLint *y1 = (GLint *) bp; bp += 4;
GLint *x2 = (GLint *) bp; bp += 4;
GLint *y2 = (GLint *) bp; bp += 4;
weglRecti(*x1,*y1,*x2,*y2);
}; break;
-case 5244: { // glRectiv
- GLint * v1 = (GLint *) bp; bp += 8;
- GLint * v2 = (GLint *) bp; bp += 8;
- weglRectiv(v1,v2);
-}; break;
-case 5245: { // glRects
+case 5181: { // glRects
GLshort *x1 = (GLshort *) bp; bp += 2;
GLshort *y1 = (GLshort *) bp; bp += 2;
GLshort *x2 = (GLshort *) bp; bp += 2;
GLshort *y2 = (GLshort *) bp; bp += 2;
weglRects(*x1,*y1,*x2,*y2);
}; break;
-case 5246: { // glRectsv
+case 5182: { // glRectdv
+ GLdouble * v1 = (GLdouble *) bp; bp += 16;
+ GLdouble * v2 = (GLdouble *) bp; bp += 16;
+ weglRectdv(v1,v2);
+}; break;
+case 5183: { // glRectfv
+ GLfloat * v1 = (GLfloat *) bp; bp += 8;
+ GLfloat * v2 = (GLfloat *) bp; bp += 8;
+ weglRectfv(v1,v2);
+}; break;
+case 5184: { // glRectiv
+ GLint * v1 = (GLint *) bp; bp += 8;
+ GLint * v2 = (GLint *) bp; bp += 8;
+ weglRectiv(v1,v2);
+}; break;
+case 5185: { // glRectsv
GLshort * v1 = (GLshort *) bp; bp += 4;
GLshort * v2 = (GLshort *) bp; bp += 4;
weglRectsv(v1,v2);
}; break;
-case 5247: { // glRenderMode
+case 5186: { // glVertexPointer
+ GLint *size = (GLint *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLsizei *stride = (GLsizei *) bp; bp += 4;
+ GLvoid *ptr = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
+ weglVertexPointer(*size,*type,*stride,ptr);
+}; break;
+case 5187: { // glVertexPointer
+ GLint *size = (GLint *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLsizei *stride = (GLsizei *) bp; bp += 4;
+ GLvoid *ptr = (GLvoid *) bins[0];
+ weglVertexPointer(*size,*type,*stride,ptr);
+}; break;
+case 5188: { // glNormalPointer
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLsizei *stride = (GLsizei *) bp; bp += 4;
+ GLvoid *ptr = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
+ weglNormalPointer(*type,*stride,ptr);
+}; break;
+case 5189: { // glNormalPointer
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLsizei *stride = (GLsizei *) bp; bp += 4;
+ GLvoid *ptr = (GLvoid *) bins[0];
+ weglNormalPointer(*type,*stride,ptr);
+}; break;
+case 5190: { // glColorPointer
+ GLint *size = (GLint *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLsizei *stride = (GLsizei *) bp; bp += 4;
+ GLvoid *ptr = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
+ weglColorPointer(*size,*type,*stride,ptr);
+}; break;
+case 5191: { // glColorPointer
+ GLint *size = (GLint *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLsizei *stride = (GLsizei *) bp; bp += 4;
+ GLvoid *ptr = (GLvoid *) bins[0];
+ weglColorPointer(*size,*type,*stride,ptr);
+}; break;
+case 5192: { // glIndexPointer
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLsizei *stride = (GLsizei *) bp; bp += 4;
+ GLvoid *ptr = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
+ weglIndexPointer(*type,*stride,ptr);
+}; break;
+case 5193: { // glIndexPointer
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLsizei *stride = (GLsizei *) bp; bp += 4;
+ GLvoid *ptr = (GLvoid *) bins[0];
+ weglIndexPointer(*type,*stride,ptr);
+}; break;
+case 5194: { // glTexCoordPointer
+ GLint *size = (GLint *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLsizei *stride = (GLsizei *) bp; bp += 4;
+ GLvoid *ptr = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
+ weglTexCoordPointer(*size,*type,*stride,ptr);
+}; break;
+case 5195: { // glTexCoordPointer
+ GLint *size = (GLint *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLsizei *stride = (GLsizei *) bp; bp += 4;
+ GLvoid *ptr = (GLvoid *) bins[0];
+ weglTexCoordPointer(*size,*type,*stride,ptr);
+}; break;
+case 5196: { // glEdgeFlagPointer
+ GLsizei *stride = (GLsizei *) bp; bp += 4;
+ GLvoid *ptr = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
+ weglEdgeFlagPointer(*stride,ptr);
+}; break;
+case 5197: { // glEdgeFlagPointer
+ GLsizei *stride = (GLsizei *) bp; bp += 4;
+ GLvoid *ptr = (GLvoid *) bins[0];
+ weglEdgeFlagPointer(*stride,ptr);
+}; break;
+case 5198: { // glArrayElement
+ GLint *i = (GLint *) bp; bp += 4;
+ weglArrayElement(*i);
+}; break;
+case 5199: { // glDrawArrays
GLenum *mode = (GLenum *) bp; bp += 4;
- GLint result = weglRenderMode(*mode);
+ GLint *first = (GLint *) bp; bp += 4;
+ GLsizei *count = (GLsizei *) bp; bp += 4;
+ weglDrawArrays(*mode,*first,*count);
+}; break;
+case 5200: { // glDrawElements
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ GLsizei *count = (GLsizei *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLvoid *indices = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
+ weglDrawElements(*mode,*count,*type,indices);
+}; break;
+case 5201: { // glDrawElements
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ GLsizei *count = (GLsizei *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLvoid *indices = (GLvoid *) bins[0];
+ weglDrawElements(*mode,*count,*type,indices);
+}; break;
+case 5202: { // glInterleavedArrays
+ GLenum *format = (GLenum *) bp; bp += 4;
+ GLsizei *stride = (GLsizei *) bp; bp += 4;
+ GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
+ weglInterleavedArrays(*format,*stride,pointer);
+}; break;
+case 5203: { // glInterleavedArrays
+ GLenum *format = (GLenum *) bp; bp += 4;
+ GLsizei *stride = (GLsizei *) bp; bp += 4;
+ GLvoid *pointer = (GLvoid *) bins[0];
+ weglInterleavedArrays(*format,*stride,pointer);
+}; break;
+case 5204: { // glShadeModel
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ weglShadeModel(*mode);
+}; break;
+case 5205: { // glLightf
+ GLenum *light = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLfloat *param = (GLfloat *) bp; bp += 4;
+ weglLightf(*light,*pname,*param);
+}; break;
+case 5206: { // glLighti
+ GLenum *light = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLint *param = (GLint *) bp; bp += 4;
+ weglLighti(*light,*pname,*param);
+}; break;
+case 5207: { // glLightfv
+ GLenum *light = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ int *paramsLen = (int *) bp; bp += 4;
+ GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
+ weglLightfv(*light,*pname,params);
+}; break;
+case 5208: { // glLightiv
+ GLenum *light = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ int *paramsLen = (int *) bp; bp += 4;
+ GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
+ weglLightiv(*light,*pname,params);
+}; break;
+case 5209: { // glGetLightfv
+ GLenum *light = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLfloat params[4] = {0.0,0.0,0.0,0.0};
+ weglGetLightfv(*light,*pname,params);
+ int AP = 0; ErlDrvTermData rt[14];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ GLdouble paramsConv[4], *paramsTmp = paramsConv;
+ for(int i=0; i < 4; i++) paramsConv[i] = (GLdouble) params[i];
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
+}; break;
+case 5210: { // glGetLightiv
+ GLenum *light = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLint params[4] = {0,0,0,0};
+ weglGetLightiv(*light,*pname,params);
+ int AP = 0; ErlDrvTermData rt[14];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ GLint *paramsTmp = params;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
+}; break;
+case 5211: { // glLightModelf
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLfloat *param = (GLfloat *) bp; bp += 4;
+ weglLightModelf(*pname,*param);
+}; break;
+case 5212: { // glLightModeli
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLint *param = (GLint *) bp; bp += 4;
+ weglLightModeli(*pname,*param);
+}; break;
+case 5213: { // glLightModelfv
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ int *paramsLen = (int *) bp; bp += 4;
+ GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+0)%2*4;
+ weglLightModelfv(*pname,params);
+}; break;
+case 5214: { // glLightModeliv
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ int *paramsLen = (int *) bp; bp += 4;
+ GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+0)%2*4;
+ weglLightModeliv(*pname,params);
+}; break;
+case 5215: { // glMaterialf
+ GLenum *face = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLfloat *param = (GLfloat *) bp; bp += 4;
+ weglMaterialf(*face,*pname,*param);
+}; break;
+case 5216: { // glMateriali
+ GLenum *face = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLint *param = (GLint *) bp; bp += 4;
+ weglMateriali(*face,*pname,*param);
+}; break;
+case 5217: { // glMaterialfv
+ GLenum *face = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ int *paramsLen = (int *) bp; bp += 4;
+ GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
+ weglMaterialfv(*face,*pname,params);
+}; break;
+case 5218: { // glMaterialiv
+ GLenum *face = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ int *paramsLen = (int *) bp; bp += 4;
+ GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
+ weglMaterialiv(*face,*pname,params);
+}; break;
+case 5219: { // glGetMaterialfv
+ GLenum *face = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLfloat params[4] = {0.0,0.0,0.0,0.0};
+ weglGetMaterialfv(*face,*pname,params);
+ int AP = 0; ErlDrvTermData rt[14];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ GLdouble paramsConv[4], *paramsTmp = paramsConv;
+ for(int i=0; i < 4; i++) paramsConv[i] = (GLdouble) params[i];
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
+}; break;
+case 5220: { // glGetMaterialiv
+ GLenum *face = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLint params[4] = {0,0,0,0};
+ weglGetMaterialiv(*face,*pname,params);
+ int AP = 0; ErlDrvTermData rt[14];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ GLint *paramsTmp = params;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
+}; break;
+case 5221: { // glColorMaterial
+ GLenum *face = (GLenum *) bp; bp += 4;
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ weglColorMaterial(*face,*mode);
+}; break;
+case 5222: { // glPixelZoom
+ GLfloat *xfactor = (GLfloat *) bp; bp += 4;
+ GLfloat *yfactor = (GLfloat *) bp; bp += 4;
+ weglPixelZoom(*xfactor,*yfactor);
+}; break;
+case 5223: { // glPixelStoref
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLfloat *param = (GLfloat *) bp; bp += 4;
+ weglPixelStoref(*pname,*param);
+}; break;
+case 5224: { // glPixelStorei
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLint *param = (GLint *) bp; bp += 4;
+ weglPixelStorei(*pname,*param);
+}; break;
+case 5225: { // glPixelTransferf
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLfloat *param = (GLfloat *) bp; bp += 4;
+ weglPixelTransferf(*pname,*param);
+}; break;
+case 5226: { // glPixelTransferi
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLint *param = (GLint *) bp; bp += 4;
+ weglPixelTransferi(*pname,*param);
+}; break;
+case 5227: { // glPixelMapfv
+ GLenum *map = (GLenum *) bp; bp += 4;
+ GLsizei *mapsize = (GLsizei *) bp; bp += 4;
+ GLfloat *values = (GLfloat *) bins[0];
+ weglPixelMapfv(*map,*mapsize,values);
+}; break;
+case 5228: { // glPixelMapuiv
+ GLenum *map = (GLenum *) bp; bp += 4;
+ GLsizei *mapsize = (GLsizei *) bp; bp += 4;
+ GLuint *values = (GLuint *) bins[0];
+ weglPixelMapuiv(*map,*mapsize,values);
+}; break;
+case 5229: { // glPixelMapusv
+ GLenum *map = (GLenum *) bp; bp += 4;
+ GLsizei *mapsize = (GLsizei *) bp; bp += 4;
+ GLushort *values = (GLushort *) bins[0];
+ weglPixelMapusv(*map,*mapsize,values);
+}; break;
+case 5230: { // glGetPixelMapfv
+ GLenum *map = (GLenum *) bp; bp += 4;
+ GLfloat *values = (GLfloat *) bins[0];
+ weglGetPixelMapfv(*map,values);
int AP = 0; ErlDrvTermData rt[6];
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
- rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
driver_send_term(port,caller,rt,AP);
}; break;
-case 5248: { // glRotated
- GLdouble *angle = (GLdouble *) bp; bp += 8;
- GLdouble *x = (GLdouble *) bp; bp += 8;
- GLdouble *y = (GLdouble *) bp; bp += 8;
- GLdouble *z = (GLdouble *) bp; bp += 8;
- weglRotated(*angle,*x,*y,*z);
+case 5231: { // glGetPixelMapuiv
+ GLenum *map = (GLenum *) bp; bp += 4;
+ GLuint *values = (GLuint *) bins[0];
+ weglGetPixelMapuiv(*map,values);
+ int AP = 0; ErlDrvTermData rt[6];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
}; break;
-case 5249: { // glRotatef
- GLfloat *angle = (GLfloat *) bp; bp += 4;
- GLfloat *x = (GLfloat *) bp; bp += 4;
- GLfloat *y = (GLfloat *) bp; bp += 4;
- GLfloat *z = (GLfloat *) bp; bp += 4;
- weglRotatef(*angle,*x,*y,*z);
+case 5232: { // glGetPixelMapusv
+ GLenum *map = (GLenum *) bp; bp += 4;
+ GLushort *values = (GLushort *) bins[0];
+ weglGetPixelMapusv(*map,values);
+ int AP = 0; ErlDrvTermData rt[6];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
}; break;
-case 5250: { // glScaled
- GLdouble *x = (GLdouble *) bp; bp += 8;
- GLdouble *y = (GLdouble *) bp; bp += 8;
- GLdouble *z = (GLdouble *) bp; bp += 8;
- weglScaled(*x,*y,*z);
+case 5233: { // glBitmap
+ GLsizei *width = (GLsizei *) bp; bp += 4;
+ GLsizei *height = (GLsizei *) bp; bp += 4;
+ GLfloat *xorig = (GLfloat *) bp; bp += 4;
+ GLfloat *yorig = (GLfloat *) bp; bp += 4;
+ GLfloat *xmove = (GLfloat *) bp; bp += 4;
+ GLfloat *ymove = (GLfloat *) bp; bp += 4;
+ GLubyte *bitmap = (GLubyte *) (ErlDrvSInt) * (int *) bp; bp += 4;
+ weglBitmap(*width,*height,*xorig,*yorig,*xmove,*ymove,bitmap);
}; break;
-case 5251: { // glScalef
- GLfloat *x = (GLfloat *) bp; bp += 4;
- GLfloat *y = (GLfloat *) bp; bp += 4;
- GLfloat *z = (GLfloat *) bp; bp += 4;
- weglScalef(*x,*y,*z);
+case 5234: { // glBitmap
+ GLsizei *width = (GLsizei *) bp; bp += 4;
+ GLsizei *height = (GLsizei *) bp; bp += 4;
+ GLfloat *xorig = (GLfloat *) bp; bp += 4;
+ GLfloat *yorig = (GLfloat *) bp; bp += 4;
+ GLfloat *xmove = (GLfloat *) bp; bp += 4;
+ GLfloat *ymove = (GLfloat *) bp; bp += 4;
+ GLubyte *bitmap = (GLubyte *) bins[0];
+ weglBitmap(*width,*height,*xorig,*yorig,*xmove,*ymove,bitmap);
}; break;
-case 5252: { // glScissor
+case 5235: { // glReadPixels
GLint *x = (GLint *) bp; bp += 4;
GLint *y = (GLint *) bp; bp += 4;
GLsizei *width = (GLsizei *) bp; bp += 4;
GLsizei *height = (GLsizei *) bp; bp += 4;
- weglScissor(*x,*y,*width,*height);
-}; break;
-case 5253: { // glSelectBuffer
- GLsizei *size = (GLsizei *) bp; bp += 4;
- GLuint *buffer = (GLuint *) bins[0];
- weglSelectBuffer(*size,buffer);
+ GLenum *format = (GLenum *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLvoid *pixels = (GLvoid *) bins[0];
+ weglReadPixels(*x,*y,*width,*height,*format,*type,pixels);
int AP = 0; ErlDrvTermData rt[6];
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
driver_send_term(port,caller,rt,AP);
}; break;
-case 5254: { // glShadeModel
- GLenum *mode = (GLenum *) bp; bp += 4;
- weglShadeModel(*mode);
+case 5236: { // glDrawPixels
+ GLsizei *width = (GLsizei *) bp; bp += 4;
+ GLsizei *height = (GLsizei *) bp; bp += 4;
+ GLenum *format = (GLenum *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLvoid *pixels = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
+ weglDrawPixels(*width,*height,*format,*type,pixels);
+}; break;
+case 5237: { // glDrawPixels
+ GLsizei *width = (GLsizei *) bp; bp += 4;
+ GLsizei *height = (GLsizei *) bp; bp += 4;
+ GLenum *format = (GLenum *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLvoid *pixels = (GLvoid *) bins[0];
+ weglDrawPixels(*width,*height,*format,*type,pixels);
+}; break;
+case 5238: { // glCopyPixels
+ GLint *x = (GLint *) bp; bp += 4;
+ GLint *y = (GLint *) bp; bp += 4;
+ GLsizei *width = (GLsizei *) bp; bp += 4;
+ GLsizei *height = (GLsizei *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ weglCopyPixels(*x,*y,*width,*height,*type);
}; break;
-case 5255: { // glStencilFunc
+case 5239: { // glStencilFunc
GLenum *func = (GLenum *) bp; bp += 4;
GLint *ref = (GLint *) bp; bp += 4;
GLuint *mask = (GLuint *) bp; bp += 4;
weglStencilFunc(*func,*ref,*mask);
}; break;
-case 5256: { // glStencilMask
+case 5240: { // glStencilMask
GLuint *mask = (GLuint *) bp; bp += 4;
weglStencilMask(*mask);
}; break;
-case 5257: { // glStencilOp
+case 5241: { // glStencilOp
GLenum *fail = (GLenum *) bp; bp += 4;
GLenum *zfail = (GLenum *) bp; bp += 4;
GLenum *zpass = (GLenum *) bp; bp += 4;
weglStencilOp(*fail,*zfail,*zpass);
}; break;
-case 5258: { // glTexCoord1dv
- GLdouble *v = (GLdouble *) bp; bp += 8;
- weglTexCoord1dv(v);
-}; break;
-case 5259: { // glTexCoord1fv
- GLfloat *v = (GLfloat *) bp; bp += 4;
- weglTexCoord1fv(v);
-}; break;
-case 5260: { // glTexCoord1iv
- GLint *v = (GLint *) bp; bp += 4;
- weglTexCoord1iv(v);
-}; break;
-case 5261: { // glTexCoord1sv
- GLshort *v = (GLshort *) bp; bp += 2;
- weglTexCoord1sv(v);
-}; break;
-case 5262: { // glTexCoord2dv
- GLdouble *v = (GLdouble *) bp; bp += 8;
- weglTexCoord2dv(v);
-}; break;
-case 5263: { // glTexCoord2fv
- GLfloat *v = (GLfloat *) bp; bp += 4;
- weglTexCoord2fv(v);
-}; break;
-case 5264: { // glTexCoord2iv
- GLint *v = (GLint *) bp; bp += 4;
- weglTexCoord2iv(v);
-}; break;
-case 5265: { // glTexCoord2sv
- GLshort *v = (GLshort *) bp; bp += 2;
- weglTexCoord2sv(v);
-}; break;
-case 5266: { // glTexCoord3dv
- GLdouble *v = (GLdouble *) bp; bp += 8;
- weglTexCoord3dv(v);
+case 5242: { // glClearStencil
+ GLint *s = (GLint *) bp; bp += 4;
+ weglClearStencil(*s);
}; break;
-case 5267: { // glTexCoord3fv
- GLfloat *v = (GLfloat *) bp; bp += 4;
- weglTexCoord3fv(v);
+case 5243: { // glTexGend
+ GLenum *coord = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLdouble *param = (GLdouble *) bp; bp += 8;
+ weglTexGend(*coord,*pname,*param);
}; break;
-case 5268: { // glTexCoord3iv
- GLint *v = (GLint *) bp; bp += 4;
- weglTexCoord3iv(v);
+case 5244: { // glTexGenf
+ GLenum *coord = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLfloat *param = (GLfloat *) bp; bp += 4;
+ weglTexGenf(*coord,*pname,*param);
}; break;
-case 5269: { // glTexCoord3sv
- GLshort *v = (GLshort *) bp; bp += 2;
- weglTexCoord3sv(v);
+case 5245: { // glTexGeni
+ GLenum *coord = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLint *param = (GLint *) bp; bp += 4;
+ weglTexGeni(*coord,*pname,*param);
}; break;
-case 5270: { // glTexCoord4dv
- GLdouble *v = (GLdouble *) bp; bp += 8;
- weglTexCoord4dv(v);
+case 5246: { // glTexGendv
+ GLenum *coord = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ int *paramsLen = (int *) bp; bp += 8;
+ GLdouble *params = (GLdouble *) bp; bp += *paramsLen*8;
+ weglTexGendv(*coord,*pname,params);
}; break;
-case 5271: { // glTexCoord4fv
- GLfloat *v = (GLfloat *) bp; bp += 4;
- weglTexCoord4fv(v);
+case 5247: { // glTexGenfv
+ GLenum *coord = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ int *paramsLen = (int *) bp; bp += 4;
+ GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
+ weglTexGenfv(*coord,*pname,params);
}; break;
-case 5272: { // glTexCoord4iv
- GLint *v = (GLint *) bp; bp += 4;
- weglTexCoord4iv(v);
+case 5248: { // glTexGeniv
+ GLenum *coord = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ int *paramsLen = (int *) bp; bp += 4;
+ GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
+ weglTexGeniv(*coord,*pname,params);
}; break;
-case 5273: { // glTexCoord4sv
- GLshort *v = (GLshort *) bp; bp += 2;
- weglTexCoord4sv(v);
+case 5249: { // glGetTexGendv
+ GLenum *coord = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLdouble params[4] = {0.0,0.0,0.0,0.0};
+ weglGetTexGendv(*coord,*pname,params);
+ int AP = 0; ErlDrvTermData rt[14];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ GLdouble *paramsTmp = params;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
}; break;
-case 5274: { // glTexCoordPointer
- GLint *size = (GLint *) bp; bp += 4;
- GLenum *type = (GLenum *) bp; bp += 4;
- GLsizei *stride = (GLsizei *) bp; bp += 4;
- GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
- weglTexCoordPointer(*size,*type,*stride,pointer);
+case 5250: { // glGetTexGenfv
+ GLenum *coord = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLfloat params[4] = {0.0,0.0,0.0,0.0};
+ weglGetTexGenfv(*coord,*pname,params);
+ int AP = 0; ErlDrvTermData rt[14];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ GLdouble paramsConv[4], *paramsTmp = paramsConv;
+ for(int i=0; i < 4; i++) paramsConv[i] = (GLdouble) params[i];
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
}; break;
-case 5275: { // glTexCoordPointer
- GLint *size = (GLint *) bp; bp += 4;
- GLenum *type = (GLenum *) bp; bp += 4;
- GLsizei *stride = (GLsizei *) bp; bp += 4;
- GLvoid *pointer = (GLvoid *) bins[0];
- weglTexCoordPointer(*size,*type,*stride,pointer);
+case 5251: { // glGetTexGeniv
+ GLenum *coord = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLint params[4] = {0,0,0,0};
+ weglGetTexGeniv(*coord,*pname,params);
+ int AP = 0; ErlDrvTermData rt[14];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ GLint *paramsTmp = params;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
}; break;
-case 5276: { // glTexEnvf
+case 5252: { // glTexEnvf
GLenum *target = (GLenum *) bp; bp += 4;
GLenum *pname = (GLenum *) bp; bp += 4;
GLfloat *param = (GLfloat *) bp; bp += 4;
weglTexEnvf(*target,*pname,*param);
}; break;
-case 5277: { // glTexEnvfv
+case 5253: { // glTexEnvi
GLenum *target = (GLenum *) bp; bp += 4;
GLenum *pname = (GLenum *) bp; bp += 4;
- int *paramsLen = (int *) bp; bp += 4;
- GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
- weglTexEnvfv(*target,*pname,params);
+ GLint *param = (GLint *) bp; bp += 4;
+ weglTexEnvi(*target,*pname,*param);
}; break;
-case 5278: { // glTexEnvi
+case 5254: { // glTexEnvfv
GLenum *target = (GLenum *) bp; bp += 4;
GLenum *pname = (GLenum *) bp; bp += 4;
- GLint *param = (GLint *) bp; bp += 4;
- weglTexEnvi(*target,*pname,*param);
+ int *paramsLen = (int *) bp; bp += 4;
+ GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
+ weglTexEnvfv(*target,*pname,params);
}; break;
-case 5279: { // glTexEnviv
+case 5255: { // glTexEnviv
GLenum *target = (GLenum *) bp; bp += 4;
GLenum *pname = (GLenum *) bp; bp += 4;
int *paramsLen = (int *) bp; bp += 4;
GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
weglTexEnviv(*target,*pname,params);
}; break;
-case 5280: { // glTexGend
- GLenum *coord = (GLenum *) bp; bp += 4;
+case 5256: { // glGetTexEnvfv
+ GLenum *target = (GLenum *) bp; bp += 4;
GLenum *pname = (GLenum *) bp; bp += 4;
- GLdouble *param = (GLdouble *) bp; bp += 8;
- weglTexGend(*coord,*pname,*param);
+ GLfloat params[4] = {0.0,0.0,0.0,0.0};
+ weglGetTexEnvfv(*target,*pname,params);
+ int AP = 0; ErlDrvTermData rt[14];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ GLdouble paramsConv[4], *paramsTmp = paramsConv;
+ for(int i=0; i < 4; i++) paramsConv[i] = (GLdouble) params[i];
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
}; break;
-case 5281: { // glTexGendv
- GLenum *coord = (GLenum *) bp; bp += 4;
+case 5257: { // glGetTexEnviv
+ GLenum *target = (GLenum *) bp; bp += 4;
GLenum *pname = (GLenum *) bp; bp += 4;
- int *paramsLen = (int *) bp; bp += 8;
- GLdouble *params = (GLdouble *) bp; bp += *paramsLen*8;
- weglTexGendv(*coord,*pname,params);
+ GLint params[4] = {0,0,0,0};
+ weglGetTexEnviv(*target,*pname,params);
+ int AP = 0; ErlDrvTermData rt[14];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ GLint *paramsTmp = params;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
}; break;
-case 5282: { // glTexGenf
- GLenum *coord = (GLenum *) bp; bp += 4;
+case 5258: { // glTexParameterf
+ GLenum *target = (GLenum *) bp; bp += 4;
GLenum *pname = (GLenum *) bp; bp += 4;
GLfloat *param = (GLfloat *) bp; bp += 4;
- weglTexGenf(*coord,*pname,*param);
+ weglTexParameterf(*target,*pname,*param);
}; break;
-case 5283: { // glTexGenfv
- GLenum *coord = (GLenum *) bp; bp += 4;
+case 5259: { // glTexParameteri
+ GLenum *target = (GLenum *) bp; bp += 4;
GLenum *pname = (GLenum *) bp; bp += 4;
- int *paramsLen = (int *) bp; bp += 4;
- GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
- weglTexGenfv(*coord,*pname,params);
+ GLint *param = (GLint *) bp; bp += 4;
+ weglTexParameteri(*target,*pname,*param);
}; break;
-case 5284: { // glTexGeni
- GLenum *coord = (GLenum *) bp; bp += 4;
+case 5260: { // glTexParameterfv
+ GLenum *target = (GLenum *) bp; bp += 4;
GLenum *pname = (GLenum *) bp; bp += 4;
- GLint *param = (GLint *) bp; bp += 4;
- weglTexGeni(*coord,*pname,*param);
+ int *paramsLen = (int *) bp; bp += 4;
+ GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
+ weglTexParameterfv(*target,*pname,params);
}; break;
-case 5285: { // glTexGeniv
- GLenum *coord = (GLenum *) bp; bp += 4;
+case 5261: { // glTexParameteriv
+ GLenum *target = (GLenum *) bp; bp += 4;
GLenum *pname = (GLenum *) bp; bp += 4;
int *paramsLen = (int *) bp; bp += 4;
GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
- weglTexGeniv(*coord,*pname,params);
+ weglTexParameteriv(*target,*pname,params);
+}; break;
+case 5262: { // glGetTexParameterfv
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLfloat params[4] = {0.0,0.0,0.0,0.0};
+ weglGetTexParameterfv(*target,*pname,params);
+ int AP = 0; ErlDrvTermData rt[14];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ GLdouble paramsConv[4], *paramsTmp = paramsConv;
+ for(int i=0; i < 4; i++) paramsConv[i] = (GLdouble) params[i];
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
+}; break;
+case 5263: { // glGetTexParameteriv
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLint params[4] = {0,0,0,0};
+ weglGetTexParameteriv(*target,*pname,params);
+ int AP = 0; ErlDrvTermData rt[14];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ GLint *paramsTmp = params;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
}; break;
-case 5286: { // glTexImage1D
+case 5264: { // glGetTexLevelParameterfv
GLenum *target = (GLenum *) bp; bp += 4;
GLint *level = (GLint *) bp; bp += 4;
- GLint *internalformat = (GLint *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLfloat params[1] = {0.0};
+ weglGetTexLevelParameterfv(*target,*level,*pname,params);
+ int AP = 0; ErlDrvTermData rt[8];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ GLdouble paramsConv[1], *paramsTmp = paramsConv;
+ for(int i=0; i < 1; i++) paramsConv[i] = (GLdouble) params[i];
+ rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 1;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
+}; break;
+case 5265: { // glGetTexLevelParameteriv
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLint *level = (GLint *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLint params[1] = {0};
+ weglGetTexLevelParameteriv(*target,*level,*pname,params);
+ int AP = 0; ErlDrvTermData rt[8];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ GLint *paramsTmp = params;
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 1;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
+}; break;
+case 5266: { // glTexImage1D
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLint *level = (GLint *) bp; bp += 4;
+ GLint *internalFormat = (GLint *) bp; bp += 4;
GLsizei *width = (GLsizei *) bp; bp += 4;
GLint *border = (GLint *) bp; bp += 4;
GLenum *format = (GLenum *) bp; bp += 4;
GLenum *type = (GLenum *) bp; bp += 4;
GLvoid *pixels = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
- weglTexImage1D(*target,*level,*internalformat,*width,*border,*format,*type,pixels);
+ weglTexImage1D(*target,*level,*internalFormat,*width,*border,*format,*type,pixels);
}; break;
-case 5287: { // glTexImage1D
+case 5267: { // glTexImage1D
GLenum *target = (GLenum *) bp; bp += 4;
GLint *level = (GLint *) bp; bp += 4;
- GLint *internalformat = (GLint *) bp; bp += 4;
+ GLint *internalFormat = (GLint *) bp; bp += 4;
GLsizei *width = (GLsizei *) bp; bp += 4;
GLint *border = (GLint *) bp; bp += 4;
GLenum *format = (GLenum *) bp; bp += 4;
GLenum *type = (GLenum *) bp; bp += 4;
GLvoid *pixels = (GLvoid *) bins[0];
- weglTexImage1D(*target,*level,*internalformat,*width,*border,*format,*type,pixels);
+ weglTexImage1D(*target,*level,*internalFormat,*width,*border,*format,*type,pixels);
}; break;
-case 5288: { // glTexImage2D
+case 5268: { // glTexImage2D
GLenum *target = (GLenum *) bp; bp += 4;
GLint *level = (GLint *) bp; bp += 4;
- GLint *internalformat = (GLint *) bp; bp += 4;
+ GLint *internalFormat = (GLint *) bp; bp += 4;
GLsizei *width = (GLsizei *) bp; bp += 4;
GLsizei *height = (GLsizei *) bp; bp += 4;
GLint *border = (GLint *) bp; bp += 4;
GLenum *format = (GLenum *) bp; bp += 4;
GLenum *type = (GLenum *) bp; bp += 4;
GLvoid *pixels = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
- weglTexImage2D(*target,*level,*internalformat,*width,*height,*border,*format,*type,pixels);
+ weglTexImage2D(*target,*level,*internalFormat,*width,*height,*border,*format,*type,pixels);
}; break;
-case 5289: { // glTexImage2D
+case 5269: { // glTexImage2D
GLenum *target = (GLenum *) bp; bp += 4;
GLint *level = (GLint *) bp; bp += 4;
- GLint *internalformat = (GLint *) bp; bp += 4;
+ GLint *internalFormat = (GLint *) bp; bp += 4;
GLsizei *width = (GLsizei *) bp; bp += 4;
GLsizei *height = (GLsizei *) bp; bp += 4;
GLint *border = (GLint *) bp; bp += 4;
GLenum *format = (GLenum *) bp; bp += 4;
GLenum *type = (GLenum *) bp; bp += 4;
GLvoid *pixels = (GLvoid *) bins[0];
- weglTexImage2D(*target,*level,*internalformat,*width,*height,*border,*format,*type,pixels);
+ weglTexImage2D(*target,*level,*internalFormat,*width,*height,*border,*format,*type,pixels);
}; break;
-case 5290: { // glTexParameterf
+case 5270: { // glGetTexImage
GLenum *target = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLfloat *param = (GLfloat *) bp; bp += 4;
- weglTexParameterf(*target,*pname,*param);
+ GLint *level = (GLint *) bp; bp += 4;
+ GLenum *format = (GLenum *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ GLvoid *pixels = (GLvoid *) bins[0];
+ weglGetTexImage(*target,*level,*format,*type,pixels);
+ int AP = 0; ErlDrvTermData rt[6];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
}; break;
-case 5291: { // glTexParameterfv
- GLenum *target = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- int *paramsLen = (int *) bp; bp += 4;
- GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
- weglTexParameterfv(*target,*pname,params);
+case 5271: { // glGenTextures
+ GLsizei *n = (GLsizei *) bp; bp += 4;
+ GLuint *textures;
+ textures = (GLuint *) driver_alloc(sizeof(GLuint) * *n);
+ weglGenTextures(*n,textures);
+ int AP = 0; ErlDrvTermData *rt;
+ rt = (ErlDrvTermData *) driver_alloc(sizeof(ErlDrvTermData)*(7 + (*n)*2));
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ for(int i=0; i < *n; i++) {
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) textures[i];}
+ rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = (*n)+1;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
+ driver_free(rt);
+ driver_free(textures);
}; break;
-case 5292: { // glTexParameteri
- GLenum *target = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- GLint *param = (GLint *) bp; bp += 4;
- weglTexParameteri(*target,*pname,*param);
+case 5272: { // glDeleteTextures
+ int * texturesLen = (int *) bp; bp += 4;
+ GLuint * textures = (GLuint *) bp; bp += (8-((*texturesLen*4+4)%8))%8;
+ weglDeleteTextures(*texturesLen,textures);
}; break;
-case 5293: { // glTexParameteriv
+case 5273: { // glBindTexture
GLenum *target = (GLenum *) bp; bp += 4;
- GLenum *pname = (GLenum *) bp; bp += 4;
- int *paramsLen = (int *) bp; bp += 4;
- GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
- weglTexParameteriv(*target,*pname,params);
+ GLuint *texture = (GLuint *) bp; bp += 4;
+ weglBindTexture(*target,*texture);
}; break;
-case 5294: { // glTexSubImage1D
+case 5274: { // glPrioritizeTextures
+ int * texturesLen = (int *) bp; bp += 4;
+ GLuint * textures = (GLuint *) bp; bp += (8-((*texturesLen*4+4)%8))%8;
+ int * prioritiesLen = (int *) bp; bp += 4;
+ GLclampf * priorities = (GLclampf *) bp; bp += (8-((*prioritiesLen*4+4)%8))%8;
+ weglPrioritizeTextures(*texturesLen,textures,priorities);
+}; break;
+case 5275: { // glAreTexturesResident
+ int * texturesLen = (int *) bp; bp += 4;
+ GLuint * textures = (GLuint *) bp; bp += (8-((*texturesLen*4+4)%8))%8;
+ GLboolean *residences;
+ residences = (GLboolean *) driver_alloc(sizeof(GLboolean) * *texturesLen);
+ GLboolean result = weglAreTexturesResident(*texturesLen,textures,residences);
+ int AP = 0; ErlDrvTermData *rt;
+ rt = (ErlDrvTermData *) driver_alloc(sizeof(ErlDrvTermData)*(11 + (*texturesLen)*2));
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
+ for(int i=0; i < *texturesLen; i++) {
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) residences[i];}
+ rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = (*texturesLen)+1;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
+ driver_free(rt);
+ driver_free(residences);
+}; break;
+case 5276: { // glIsTexture
+ GLuint *texture = (GLuint *) bp; bp += 4;
+ GLboolean result = weglIsTexture(*texture);
+ int AP = 0; ErlDrvTermData rt[6];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
+}; break;
+case 5277: { // glTexSubImage1D
GLenum *target = (GLenum *) bp; bp += 4;
GLint *level = (GLint *) bp; bp += 4;
GLint *xoffset = (GLint *) bp; bp += 4;
@@ -2090,7 +1918,7 @@ case 5294: { // glTexSubImage1D
GLvoid *pixels = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
weglTexSubImage1D(*target,*level,*xoffset,*width,*format,*type,pixels);
}; break;
-case 5295: { // glTexSubImage1D
+case 5278: { // glTexSubImage1D
GLenum *target = (GLenum *) bp; bp += 4;
GLint *level = (GLint *) bp; bp += 4;
GLint *xoffset = (GLint *) bp; bp += 4;
@@ -2100,7 +1928,7 @@ case 5295: { // glTexSubImage1D
GLvoid *pixels = (GLvoid *) bins[0];
weglTexSubImage1D(*target,*level,*xoffset,*width,*format,*type,pixels);
}; break;
-case 5296: { // glTexSubImage2D
+case 5279: { // glTexSubImage2D
GLenum *target = (GLenum *) bp; bp += 4;
GLint *level = (GLint *) bp; bp += 4;
GLint *xoffset = (GLint *) bp; bp += 4;
@@ -2112,7 +1940,7 @@ case 5296: { // glTexSubImage2D
GLvoid *pixels = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
weglTexSubImage2D(*target,*level,*xoffset,*yoffset,*width,*height,*format,*type,pixels);
}; break;
-case 5297: { // glTexSubImage2D
+case 5280: { // glTexSubImage2D
GLenum *target = (GLenum *) bp; bp += 4;
GLint *level = (GLint *) bp; bp += 4;
GLint *xoffset = (GLint *) bp; bp += 4;
@@ -2124,86 +1952,258 @@ case 5297: { // glTexSubImage2D
GLvoid *pixels = (GLvoid *) bins[0];
weglTexSubImage2D(*target,*level,*xoffset,*yoffset,*width,*height,*format,*type,pixels);
}; break;
-case 5298: { // glTranslated
- GLdouble *x = (GLdouble *) bp; bp += 8;
- GLdouble *y = (GLdouble *) bp; bp += 8;
- GLdouble *z = (GLdouble *) bp; bp += 8;
- weglTranslated(*x,*y,*z);
+case 5281: { // glCopyTexImage1D
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLint *level = (GLint *) bp; bp += 4;
+ GLenum *internalformat = (GLenum *) bp; bp += 4;
+ GLint *x = (GLint *) bp; bp += 4;
+ GLint *y = (GLint *) bp; bp += 4;
+ GLsizei *width = (GLsizei *) bp; bp += 4;
+ GLint *border = (GLint *) bp; bp += 4;
+ weglCopyTexImage1D(*target,*level,*internalformat,*x,*y,*width,*border);
}; break;
-case 5299: { // glTranslatef
- GLfloat *x = (GLfloat *) bp; bp += 4;
- GLfloat *y = (GLfloat *) bp; bp += 4;
- GLfloat *z = (GLfloat *) bp; bp += 4;
- weglTranslatef(*x,*y,*z);
+case 5282: { // glCopyTexImage2D
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLint *level = (GLint *) bp; bp += 4;
+ GLenum *internalformat = (GLenum *) bp; bp += 4;
+ GLint *x = (GLint *) bp; bp += 4;
+ GLint *y = (GLint *) bp; bp += 4;
+ GLsizei *width = (GLsizei *) bp; bp += 4;
+ GLsizei *height = (GLsizei *) bp; bp += 4;
+ GLint *border = (GLint *) bp; bp += 4;
+ weglCopyTexImage2D(*target,*level,*internalformat,*x,*y,*width,*height,*border);
}; break;
-case 5300: { // glVertex2dv
- GLdouble *v = (GLdouble *) bp; bp += 8;
- weglVertex2dv(v);
+case 5283: { // glCopyTexSubImage1D
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLint *level = (GLint *) bp; bp += 4;
+ GLint *xoffset = (GLint *) bp; bp += 4;
+ GLint *x = (GLint *) bp; bp += 4;
+ GLint *y = (GLint *) bp; bp += 4;
+ GLsizei *width = (GLsizei *) bp; bp += 4;
+ weglCopyTexSubImage1D(*target,*level,*xoffset,*x,*y,*width);
}; break;
-case 5301: { // glVertex2fv
- GLfloat *v = (GLfloat *) bp; bp += 4;
- weglVertex2fv(v);
+case 5284: { // glCopyTexSubImage2D
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLint *level = (GLint *) bp; bp += 4;
+ GLint *xoffset = (GLint *) bp; bp += 4;
+ GLint *yoffset = (GLint *) bp; bp += 4;
+ GLint *x = (GLint *) bp; bp += 4;
+ GLint *y = (GLint *) bp; bp += 4;
+ GLsizei *width = (GLsizei *) bp; bp += 4;
+ GLsizei *height = (GLsizei *) bp; bp += 4;
+ weglCopyTexSubImage2D(*target,*level,*xoffset,*yoffset,*x,*y,*width,*height);
}; break;
-case 5302: { // glVertex2iv
- GLint *v = (GLint *) bp; bp += 4;
- weglVertex2iv(v);
+case 5285: { // glMap1d
+ GLenum *target = (GLenum *) bp; bp += 4;
+ bp += 4;
+ GLdouble *u1 = (GLdouble *) bp; bp += 8;
+ GLdouble *u2 = (GLdouble *) bp; bp += 8;
+ GLint *stride = (GLint *) bp; bp += 4;
+ GLint *order = (GLint *) bp; bp += 4;
+ GLdouble *points = (GLdouble *) bins[0];
+ weglMap1d(*target,*u1,*u2,*stride,*order,points);
}; break;
-case 5303: { // glVertex2sv
- GLshort *v = (GLshort *) bp; bp += 2;
- weglVertex2sv(v);
+case 5286: { // glMap1f
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLfloat *u1 = (GLfloat *) bp; bp += 4;
+ GLfloat *u2 = (GLfloat *) bp; bp += 4;
+ GLint *stride = (GLint *) bp; bp += 4;
+ GLint *order = (GLint *) bp; bp += 4;
+ GLfloat *points = (GLfloat *) bins[0];
+ weglMap1f(*target,*u1,*u2,*stride,*order,points);
}; break;
-case 5304: { // glVertex3dv
- GLdouble *v = (GLdouble *) bp; bp += 8;
- weglVertex3dv(v);
+case 5287: { // glMap2d
+ GLenum *target = (GLenum *) bp; bp += 4;
+ bp += 4;
+ GLdouble *u1 = (GLdouble *) bp; bp += 8;
+ GLdouble *u2 = (GLdouble *) bp; bp += 8;
+ GLint *ustride = (GLint *) bp; bp += 4;
+ GLint *uorder = (GLint *) bp; bp += 4;
+ GLdouble *v1 = (GLdouble *) bp; bp += 8;
+ GLdouble *v2 = (GLdouble *) bp; bp += 8;
+ GLint *vstride = (GLint *) bp; bp += 4;
+ GLint *vorder = (GLint *) bp; bp += 4;
+ GLdouble *points = (GLdouble *) bins[0];
+ weglMap2d(*target,*u1,*u2,*ustride,*uorder,*v1,*v2,*vstride,*vorder,points);
}; break;
-case 5305: { // glVertex3fv
- GLfloat *v = (GLfloat *) bp; bp += 4;
- weglVertex3fv(v);
+case 5288: { // glMap2f
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLfloat *u1 = (GLfloat *) bp; bp += 4;
+ GLfloat *u2 = (GLfloat *) bp; bp += 4;
+ GLint *ustride = (GLint *) bp; bp += 4;
+ GLint *uorder = (GLint *) bp; bp += 4;
+ GLfloat *v1 = (GLfloat *) bp; bp += 4;
+ GLfloat *v2 = (GLfloat *) bp; bp += 4;
+ GLint *vstride = (GLint *) bp; bp += 4;
+ GLint *vorder = (GLint *) bp; bp += 4;
+ GLfloat *points = (GLfloat *) bins[0];
+ weglMap2f(*target,*u1,*u2,*ustride,*uorder,*v1,*v2,*vstride,*vorder,points);
}; break;
-case 5306: { // glVertex3iv
- GLint *v = (GLint *) bp; bp += 4;
- weglVertex3iv(v);
+case 5289: { // glGetMapdv
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLenum *query = (GLenum *) bp; bp += 4;
+ GLdouble *v = (GLdouble *) bins[0];
+ weglGetMapdv(*target,*query,v);
+ int AP = 0; ErlDrvTermData rt[6];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
}; break;
-case 5307: { // glVertex3sv
- GLshort *v = (GLshort *) bp; bp += 2;
- weglVertex3sv(v);
+case 5290: { // glGetMapfv
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLenum *query = (GLenum *) bp; bp += 4;
+ GLfloat *v = (GLfloat *) bins[0];
+ weglGetMapfv(*target,*query,v);
+ int AP = 0; ErlDrvTermData rt[6];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
}; break;
-case 5308: { // glVertex4dv
- GLdouble *v = (GLdouble *) bp; bp += 8;
- weglVertex4dv(v);
+case 5291: { // glGetMapiv
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLenum *query = (GLenum *) bp; bp += 4;
+ GLint *v = (GLint *) bins[0];
+ weglGetMapiv(*target,*query,v);
+ int AP = 0; ErlDrvTermData rt[6];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
}; break;
-case 5309: { // glVertex4fv
- GLfloat *v = (GLfloat *) bp; bp += 4;
- weglVertex4fv(v);
+case 5292: { // glEvalCoord1dv
+ GLdouble *u = (GLdouble *) bp; bp += 8;
+ weglEvalCoord1dv(u);
}; break;
-case 5310: { // glVertex4iv
- GLint *v = (GLint *) bp; bp += 4;
- weglVertex4iv(v);
+case 5293: { // glEvalCoord1fv
+ GLfloat *u = (GLfloat *) bp; bp += 4;
+ weglEvalCoord1fv(u);
}; break;
-case 5311: { // glVertex4sv
- GLshort *v = (GLshort *) bp; bp += 2;
- weglVertex4sv(v);
+case 5294: { // glEvalCoord2dv
+ GLdouble *u = (GLdouble *) bp; bp += 8;
+ weglEvalCoord2dv(u);
}; break;
-case 5312: { // glVertexPointer
- GLint *size = (GLint *) bp; bp += 4;
- GLenum *type = (GLenum *) bp; bp += 4;
- GLsizei *stride = (GLsizei *) bp; bp += 4;
- GLvoid *pointer = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
- weglVertexPointer(*size,*type,*stride,pointer);
+case 5295: { // glEvalCoord2fv
+ GLfloat *u = (GLfloat *) bp; bp += 4;
+ weglEvalCoord2fv(u);
}; break;
-case 5313: { // glVertexPointer
- GLint *size = (GLint *) bp; bp += 4;
+case 5296: { // glMapGrid1d
+ GLint *un = (GLint *) bp; bp += 4;
+ bp += 4;
+ GLdouble *u1 = (GLdouble *) bp; bp += 8;
+ GLdouble *u2 = (GLdouble *) bp; bp += 8;
+ weglMapGrid1d(*un,*u1,*u2);
+}; break;
+case 5297: { // glMapGrid1f
+ GLint *un = (GLint *) bp; bp += 4;
+ GLfloat *u1 = (GLfloat *) bp; bp += 4;
+ GLfloat *u2 = (GLfloat *) bp; bp += 4;
+ weglMapGrid1f(*un,*u1,*u2);
+}; break;
+case 5298: { // glMapGrid2d
+ GLint *un = (GLint *) bp; bp += 4;
+ bp += 4;
+ GLdouble *u1 = (GLdouble *) bp; bp += 8;
+ GLdouble *u2 = (GLdouble *) bp; bp += 8;
+ GLint *vn = (GLint *) bp; bp += 4;
+ bp += 4;
+ GLdouble *v1 = (GLdouble *) bp; bp += 8;
+ GLdouble *v2 = (GLdouble *) bp; bp += 8;
+ weglMapGrid2d(*un,*u1,*u2,*vn,*v1,*v2);
+}; break;
+case 5299: { // glMapGrid2f
+ GLint *un = (GLint *) bp; bp += 4;
+ GLfloat *u1 = (GLfloat *) bp; bp += 4;
+ GLfloat *u2 = (GLfloat *) bp; bp += 4;
+ GLint *vn = (GLint *) bp; bp += 4;
+ GLfloat *v1 = (GLfloat *) bp; bp += 4;
+ GLfloat *v2 = (GLfloat *) bp; bp += 4;
+ weglMapGrid2f(*un,*u1,*u2,*vn,*v1,*v2);
+}; break;
+case 5300: { // glEvalPoint1
+ GLint *i = (GLint *) bp; bp += 4;
+ weglEvalPoint1(*i);
+}; break;
+case 5301: { // glEvalPoint2
+ GLint *i = (GLint *) bp; bp += 4;
+ GLint *j = (GLint *) bp; bp += 4;
+ weglEvalPoint2(*i,*j);
+}; break;
+case 5302: { // glEvalMesh1
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ GLint *i1 = (GLint *) bp; bp += 4;
+ GLint *i2 = (GLint *) bp; bp += 4;
+ weglEvalMesh1(*mode,*i1,*i2);
+}; break;
+case 5303: { // glEvalMesh2
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ GLint *i1 = (GLint *) bp; bp += 4;
+ GLint *i2 = (GLint *) bp; bp += 4;
+ GLint *j1 = (GLint *) bp; bp += 4;
+ GLint *j2 = (GLint *) bp; bp += 4;
+ weglEvalMesh2(*mode,*i1,*i2,*j1,*j2);
+}; break;
+case 5304: { // glFogf
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLfloat *param = (GLfloat *) bp; bp += 4;
+ weglFogf(*pname,*param);
+}; break;
+case 5305: { // glFogi
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLint *param = (GLint *) bp; bp += 4;
+ weglFogi(*pname,*param);
+}; break;
+case 5306: { // glFogfv
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ int *paramsLen = (int *) bp; bp += 4;
+ GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+0)%2*4;
+ weglFogfv(*pname,params);
+}; break;
+case 5307: { // glFogiv
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ int *paramsLen = (int *) bp; bp += 4;
+ GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+0)%2*4;
+ weglFogiv(*pname,params);
+}; break;
+case 5308: { // glFeedbackBuffer
+ GLsizei *size = (GLsizei *) bp; bp += 4;
GLenum *type = (GLenum *) bp; bp += 4;
- GLsizei *stride = (GLsizei *) bp; bp += 4;
- GLvoid *pointer = (GLvoid *) bins[0];
- weglVertexPointer(*size,*type,*stride,pointer);
+ GLfloat *buffer = (GLfloat *) bins[0];
+ weglFeedbackBuffer(*size,*type,buffer);
+ int AP = 0; ErlDrvTermData rt[6];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
}; break;
-case 5314: { // glViewport
- GLint *x = (GLint *) bp; bp += 4;
- GLint *y = (GLint *) bp; bp += 4;
- GLsizei *width = (GLsizei *) bp; bp += 4;
- GLsizei *height = (GLsizei *) bp; bp += 4;
- weglViewport(*x,*y,*width,*height);
+case 5309: { // glPassThrough
+ GLfloat *token = (GLfloat *) bp; bp += 4;
+ weglPassThrough(*token);
+}; break;
+case 5310: { // glSelectBuffer
+ GLsizei *size = (GLsizei *) bp; bp += 4;
+ GLuint *buffer = (GLuint *) bins[0];
+ weglSelectBuffer(*size,buffer);
+ int AP = 0; ErlDrvTermData rt[6];
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
+}; break;
+case 5311: { // glInitNames
+ weglInitNames();
+}; break;
+case 5312: { // glLoadName
+ GLuint *name = (GLuint *) bp; bp += 4;
+ weglLoadName(*name);
+}; break;
+case 5313: { // glPushName
+ GLuint *name = (GLuint *) bp; bp += 4;
+ weglPushName(*name);
+}; break;
+case 5314: { // glPopName
+ weglPopName();
}; break;
case 5315: { // glBlendColor
GLclampf *red = (GLclampf *) bp; bp += 4;
@@ -2237,7 +2237,7 @@ case 5318: { // glDrawRangeElements
case 5319: { // glTexImage3D
GLenum *target = (GLenum *) bp; bp += 4;
GLint *level = (GLint *) bp; bp += 4;
- GLint *internalformat = (GLint *) bp; bp += 4;
+ GLint *internalFormat = (GLint *) bp; bp += 4;
GLsizei *width = (GLsizei *) bp; bp += 4;
GLsizei *height = (GLsizei *) bp; bp += 4;
GLsizei *depth = (GLsizei *) bp; bp += 4;
@@ -2245,12 +2245,12 @@ case 5319: { // glTexImage3D
GLenum *format = (GLenum *) bp; bp += 4;
GLenum *type = (GLenum *) bp; bp += 4;
GLvoid *pixels = (GLvoid *) (ErlDrvSInt) * (int *) bp; bp += 4;
- weglTexImage3D(*target,*level,*internalformat,*width,*height,*depth,*border,*format,*type,pixels);
+ weglTexImage3D(*target,*level,*internalFormat,*width,*height,*depth,*border,*format,*type,pixels);
}; break;
case 5320: { // glTexImage3D
GLenum *target = (GLenum *) bp; bp += 4;
GLint *level = (GLint *) bp; bp += 4;
- GLint *internalformat = (GLint *) bp; bp += 4;
+ GLint *internalFormat = (GLint *) bp; bp += 4;
GLsizei *width = (GLsizei *) bp; bp += 4;
GLsizei *height = (GLsizei *) bp; bp += 4;
GLsizei *depth = (GLsizei *) bp; bp += 4;
@@ -2258,7 +2258,7 @@ case 5320: { // glTexImage3D
GLenum *format = (GLenum *) bp; bp += 4;
GLenum *type = (GLenum *) bp; bp += 4;
GLvoid *pixels = (GLvoid *) bins[0];
- weglTexImage3D(*target,*level,*internalformat,*width,*height,*depth,*border,*format,*type,pixels);
+ weglTexImage3D(*target,*level,*internalFormat,*width,*height,*depth,*border,*format,*type,pixels);
}; break;
case 5321: { // glTexSubImage3D
GLenum *target = (GLenum *) bp; bp += 4;
@@ -2591,9 +2591,9 @@ case 5351: { // glGetMinmax
GLboolean *reset = (GLboolean *) bp; bp += 1;
bp += 3;
GLenum *format = (GLenum *) bp; bp += 4;
- GLenum *type = (GLenum *) bp; bp += 4;
+ GLenum *types = (GLenum *) bp; bp += 4;
GLvoid *values = (GLvoid *) bins[0];
- weglGetMinmax(*target,*reset,*format,*type,values);
+ weglGetMinmax(*target,*reset,*format,*types,values);
int AP = 0; ErlDrvTermData rt[6];
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
@@ -2797,9 +2797,9 @@ case 5371: { // glCompressedTexSubImage1D
}; break;
case 5372: { // glGetCompressedTexImage
GLenum *target = (GLenum *) bp; bp += 4;
- GLint *level = (GLint *) bp; bp += 4;
+ GLint *lod = (GLint *) bp; bp += 4;
GLvoid *img = (GLvoid *) bins[0];
- weglGetCompressedTexImage(*target,*level,img);
+ weglGetCompressedTexImage(*target,*lod,img);
int AP = 0; ErlDrvTermData rt[6];
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
@@ -6927,31 +6927,129 @@ case 5856: { // glGetGraphicsResetStatusARB
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
driver_send_term(port,caller,rt,AP);
}; break;
-case 5857: { // glResizeBuffersMESA
- weglResizeBuffersMESA();
+case 5857: { // glDrawArraysInstancedBaseInstance
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ GLint *first = (GLint *) bp; bp += 4;
+ GLsizei *count = (GLsizei *) bp; bp += 4;
+ GLsizei *primcount = (GLsizei *) bp; bp += 4;
+ GLuint *baseinstance = (GLuint *) bp; bp += 4;
+ weglDrawArraysInstancedBaseInstance(*mode,*first,*count,*primcount,*baseinstance);
}; break;
-case 5858: { // glWindowPos4dvMESA
- GLdouble *v = (GLdouble *) bp; bp += 8;
- weglWindowPos4dvMESA(v);
+case 5858: { // glDrawElementsInstancedBaseInstance
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ GLsizei *count = (GLsizei *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ void *indices = (void *) (ErlDrvSInt) * (int *) bp; bp += 4;
+ GLsizei *primcount = (GLsizei *) bp; bp += 4;
+ GLuint *baseinstance = (GLuint *) bp; bp += 4;
+ weglDrawElementsInstancedBaseInstance(*mode,*count,*type,indices,*primcount,*baseinstance);
}; break;
-case 5859: { // glWindowPos4fvMESA
- GLfloat *v = (GLfloat *) bp; bp += 4;
- weglWindowPos4fvMESA(v);
+case 5859: { // glDrawElementsInstancedBaseInstance
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ GLsizei *count = (GLsizei *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ void *indices = (void *) bins[0];
+ GLsizei *primcount = (GLsizei *) bp; bp += 4;
+ GLuint *baseinstance = (GLuint *) bp; bp += 4;
+ weglDrawElementsInstancedBaseInstance(*mode,*count,*type,indices,*primcount,*baseinstance);
}; break;
-case 5860: { // glWindowPos4ivMESA
- GLint *v = (GLint *) bp; bp += 4;
- weglWindowPos4ivMESA(v);
+case 5860: { // glDrawElementsInstancedBaseVertexBaseInstance
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ GLsizei *count = (GLsizei *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ void *indices = (void *) (ErlDrvSInt) * (int *) bp; bp += 4;
+ GLsizei *primcount = (GLsizei *) bp; bp += 4;
+ GLint *basevertex = (GLint *) bp; bp += 4;
+ GLuint *baseinstance = (GLuint *) bp; bp += 4;
+ weglDrawElementsInstancedBaseVertexBaseInstance(*mode,*count,*type,indices,*primcount,*basevertex,*baseinstance);
}; break;
-case 5861: { // glWindowPos4svMESA
- GLshort *v = (GLshort *) bp; bp += 2;
- weglWindowPos4svMESA(v);
+case 5861: { // glDrawElementsInstancedBaseVertexBaseInstance
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ GLsizei *count = (GLsizei *) bp; bp += 4;
+ GLenum *type = (GLenum *) bp; bp += 4;
+ void *indices = (void *) bins[0];
+ GLsizei *primcount = (GLsizei *) bp; bp += 4;
+ GLint *basevertex = (GLint *) bp; bp += 4;
+ GLuint *baseinstance = (GLuint *) bp; bp += 4;
+ weglDrawElementsInstancedBaseVertexBaseInstance(*mode,*count,*type,indices,*primcount,*basevertex,*baseinstance);
+}; break;
+case 5862: { // glDrawTransformFeedbackInstanced
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ GLuint *id = (GLuint *) bp; bp += 4;
+ GLsizei *primcount = (GLsizei *) bp; bp += 4;
+ weglDrawTransformFeedbackInstanced(*mode,*id,*primcount);
+}; break;
+case 5863: { // glDrawTransformFeedbackStreamInstanced
+ GLenum *mode = (GLenum *) bp; bp += 4;
+ GLuint *id = (GLuint *) bp; bp += 4;
+ GLuint *stream = (GLuint *) bp; bp += 4;
+ GLsizei *primcount = (GLsizei *) bp; bp += 4;
+ weglDrawTransformFeedbackStreamInstanced(*mode,*id,*stream,*primcount);
+}; break;
+case 5864: { // glGetInternalformativ
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLenum *internalformat = (GLenum *) bp; bp += 4;
+ GLenum *pname = (GLenum *) bp; bp += 4;
+ GLsizei *bufSize = (GLsizei *) bp; bp += 4;
+ GLint *params;
+ params = (GLint *) driver_alloc(sizeof(GLint) * *bufSize);
+ weglGetInternalformativ(*target,*internalformat,*pname,*bufSize,params);
+ int AP = 0; ErlDrvTermData *rt;
+ rt = (ErlDrvTermData *) driver_alloc(sizeof(ErlDrvTermData)*(7 + (*bufSize)*2));
+ rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
+ for(int i=0; i < *bufSize; i++) {
+ rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) params[i];}
+ rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = (*bufSize)+1;
+ rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
+ driver_send_term(port,caller,rt,AP);
+ driver_free(rt);
+ driver_free(params);
+}; break;
+case 5865: { // glBindImageTexture
+ GLuint *unit = (GLuint *) bp; bp += 4;
+ GLuint *texture = (GLuint *) bp; bp += 4;
+ GLint *level = (GLint *) bp; bp += 4;
+ GLboolean *layered = (GLboolean *) bp; bp += 1;
+ bp += 3;
+ GLint *layer = (GLint *) bp; bp += 4;
+ GLenum *access = (GLenum *) bp; bp += 4;
+ GLenum *format = (GLenum *) bp; bp += 4;
+ weglBindImageTexture(*unit,*texture,*level,*layered,*layer,*access,*format);
+}; break;
+case 5866: { // glMemoryBarrier
+ GLbitfield *barriers = (GLbitfield *) bp; bp += 4;
+ weglMemoryBarrier(*barriers);
+}; break;
+case 5867: { // glTexStorage1D
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLsizei *levels = (GLsizei *) bp; bp += 4;
+ GLenum *internalformat = (GLenum *) bp; bp += 4;
+ GLsizei *width = (GLsizei *) bp; bp += 4;
+ weglTexStorage1D(*target,*levels,*internalformat,*width);
+}; break;
+case 5868: { // glTexStorage2D
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLsizei *levels = (GLsizei *) bp; bp += 4;
+ GLenum *internalformat = (GLenum *) bp; bp += 4;
+ GLsizei *width = (GLsizei *) bp; bp += 4;
+ GLsizei *height = (GLsizei *) bp; bp += 4;
+ weglTexStorage2D(*target,*levels,*internalformat,*width,*height);
+}; break;
+case 5869: { // glTexStorage3D
+ GLenum *target = (GLenum *) bp; bp += 4;
+ GLsizei *levels = (GLsizei *) bp; bp += 4;
+ GLenum *internalformat = (GLenum *) bp; bp += 4;
+ GLsizei *width = (GLsizei *) bp; bp += 4;
+ GLsizei *height = (GLsizei *) bp; bp += 4;
+ GLsizei *depth = (GLsizei *) bp; bp += 4;
+ weglTexStorage3D(*target,*levels,*internalformat,*width,*height,*depth);
}; break;
-case 5862: { // glDepthBoundsEXT
+case 5870: { // glDepthBoundsEXT
GLclampd *zmin = (GLclampd *) bp; bp += 8;
GLclampd *zmax = (GLclampd *) bp; bp += 8;
weglDepthBoundsEXT(*zmin,*zmax);
}; break;
-case 5863: { // glStencilClearTagEXT
+case 5871: { // glStencilClearTagEXT
GLsizei *stencilTagBits = (GLsizei *) bp; bp += 4;
GLuint *stencilClearTag = (GLuint *) bp; bp += 4;
weglStencilClearTagEXT(*stencilTagBits,*stencilClearTag);
diff --git a/lib/wx/c_src/gen/glu_finit.h b/lib/wx/c_src/gen/glu_finit.h
index 63e9c2fc78..0e55d48a2a 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-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2012. 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/lib/wx/c_src/gen/wxe_derived_dest.h b/lib/wx/c_src/gen/wxe_derived_dest.h
index 4e4aea098d..6b7a5378cb 100644
--- a/lib/wx/c_src/gen/wxe_derived_dest.h
+++ b/lib/wx/c_src/gen/wxe_derived_dest.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2012. 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
@@ -129,6 +129,18 @@ class EwxBufferedPaintDC : public wxBufferedPaintDC {
EwxBufferedPaintDC(wxWindow * window,int style) : wxBufferedPaintDC(window,style) {};
};
+#if wxUSE_GRAPHICS_CONTEXT
+class EwxGraphicsObject : public wxGraphicsObject {
+ public: ~EwxGraphicsObject() {((WxeApp *)wxTheApp)->clearPtr(this);};
+};
+#endif // wxUSE_GRAPHICS_CONTEXT
+
+#if wxUSE_GRAPHICS_CONTEXT
+class EwxGraphicsContext : public wxGraphicsContext {
+ public: ~EwxGraphicsContext() {((WxeApp *)wxTheApp)->clearPtr(this);};
+};
+#endif // wxUSE_GRAPHICS_CONTEXT
+
class EwxMenuBar : public wxMenuBar {
public: ~EwxMenuBar() {((WxeApp *)wxTheApp)->clearPtr(this);};
EwxMenuBar(long style) : wxMenuBar(style) {};
@@ -671,16 +683,20 @@ class EwxGLCanvas : public wxGLCanvas {
EwxGLCanvas(wxWindow * parent,wxWindowID id,const wxPoint& pos,const wxSize& size,long style,const wxString& name,int * attribList,const wxPalette& palette) : wxGLCanvas(parent,id,pos,size,style,name,attribList,palette) {};
};
+#if wxUSE_AUI
class EwxAuiManager : public wxAuiManager {
public: ~EwxAuiManager() {((WxeApp *)wxTheApp)->clearPtr(this);};
EwxAuiManager(wxWindow * managed_wnd,unsigned int flags) : wxAuiManager(managed_wnd,flags) {};
};
+#endif // wxUSE_AUI
+#if wxUSE_AUI
class EwxAuiNotebook : public wxAuiNotebook {
public: ~EwxAuiNotebook() {((WxeApp *)wxTheApp)->clearPtr(this);};
EwxAuiNotebook(wxWindow * parent,wxWindowID id,const wxPoint& pos,const wxSize& size,long style) : wxAuiNotebook(parent,id,pos,size,style) {};
EwxAuiNotebook() : wxAuiNotebook() {};
};
+#endif // wxUSE_AUI
class EwxMDIParentFrame : public wxMDIParentFrame {
public: ~EwxMDIParentFrame() {((WxeApp *)wxTheApp)->clearPtr(this);};
@@ -727,3 +743,8 @@ class EwxHtmlWindow : public wxHtmlWindow {
EwxHtmlWindow() : wxHtmlWindow() {};
};
+class EwxTaskBarIcon : public wxTaskBarIcon {
+ public: ~EwxTaskBarIcon() {((WxeApp *)wxTheApp)->clearPtr(this);};
+ EwxTaskBarIcon() : wxTaskBarIcon() {};
+};
+
diff --git a/lib/wx/c_src/gen/wxe_events.cpp b/lib/wx/c_src/gen/wxe_events.cpp
index cda98bfc3f..0afb02150a 100644
--- a/lib/wx/c_src/gen/wxe_events.cpp
+++ b/lib/wx/c_src/gen/wxe_events.cpp
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2012. 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
@@ -301,6 +301,13 @@ void initEventTable()
{wxEVT_AUI_PANE_RESTORE, 224, "aui_pane_restore"},
{wxEVT_AUI_RENDER, 224, "aui_render"},
{wxEVT_AUI_FIND_MANAGER, 224, "aui_find_manager"},
+ {wxEVT_TASKBAR_MOVE, 227, "taskbar_move"},
+ {wxEVT_TASKBAR_LEFT_DOWN, 227, "taskbar_left_down"},
+ {wxEVT_TASKBAR_LEFT_UP, 227, "taskbar_left_up"},
+ {wxEVT_TASKBAR_RIGHT_DOWN, 227, "taskbar_right_down"},
+ {wxEVT_TASKBAR_RIGHT_UP, 227, "taskbar_right_up"},
+ {wxEVT_TASKBAR_LEFT_DCLICK, 227, "taskbar_left_dclick"},
+ {wxEVT_TASKBAR_RIGHT_DCLICK, 227, "taskbar_right_dclick"},
{-1, 0, }
};
for(int i=0; event_types[i].ev_type != -1; i++) {
@@ -807,6 +814,13 @@ case 224: {// wxAuiManagerEvent
rt.addTupleCount(8);
break;
}
+case 227: {// wxTaskBarIconEvent
+ evClass = (char*)"wxTaskBarIconEvent";
+ rt.addAtom((char*)"wxTaskBarIcon");
+ rt.addAtom(Etype->eName);
+ rt.addTupleCount(2);
+ break;
+}
}
rt.addTupleCount(5);
diff --git a/lib/wx/c_src/gen/wxe_funcs.cpp b/lib/wx/c_src/gen/wxe_funcs.cpp
index f456bd3287..15012011ed 100644
--- a/lib/wx/c_src/gen/wxe_funcs.cpp
+++ b/lib/wx/c_src/gen/wxe_funcs.cpp
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2012. 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
@@ -5334,14 +5334,18 @@ case wxDC_GetCharWidth: { // wxDC::GetCharWidth
break;
}
case wxDC_GetClippingBox: { // wxDC::GetClippingBox
+ wxCoord x;
+ wxCoord y;
+ wxCoord w;
+ wxCoord h;
wxDC *This = (wxDC *) getPtr(bp,memenv); bp += 4;
- int * rectX = (int *) bp; bp += 4;
- int * rectY = (int *) bp; bp += 4;
- int * rectW = (int *) bp; bp += 4;
- int * rectH = (int *) bp; bp += 4;
- wxRect rect = wxRect(*rectX,*rectY,*rectW,*rectH);
if(!This) throw wxe_badarg(0);
- This->GetClippingBox(rect);
+ This->GetClippingBox(&x,&y,&w,&h);
+ rt.addInt(x);
+ rt.addInt(y);
+ rt.addInt(w);
+ rt.addInt(h);
+ rt.addTupleCount(4);
break;
}
case wxDC_GetFont: { // wxDC::GetFont
@@ -5405,17 +5409,16 @@ case wxDC_GetMultiLineTextExtent_1: { // wxDC::GetMultiLineTextExtent
break;
}
case wxDC_GetPartialTextExtents: { // wxDC::GetPartialTextExtents
+ wxArrayInt widths;
wxDC *This = (wxDC *) getPtr(bp,memenv); bp += 4;
int * textLen = (int *) bp; bp += 4;
wxString text = wxString(bp, wxConvUTF8);
bp += *textLen+((8-((0+ *textLen) & 7)) & 7);
- int * widthsLen = (int *) bp; bp += 4;
- wxArrayInt widths;
- for(int i=0; i < *widthsLen; i++) { widths.Add(*(int *) bp); bp += 4;}
- bp += ((*widthsLen + 1) % 2 )*4;
if(!This) throw wxe_badarg(0);
bool Result = This->GetPartialTextExtents(text,widths);
rt.addBool(Result);
+ rt.add(widths);
+ rt.addTupleCount(2);
break;
}
case wxDC_GetPen: { // wxDC::GetPen
@@ -5426,18 +5429,16 @@ case wxDC_GetPen: { // wxDC::GetPen
break;
}
case wxDC_GetPixel: { // wxDC::GetPixel
+ wxColour col;
wxDC *This = (wxDC *) getPtr(bp,memenv); bp += 4;
int * ptX = (int *) bp; bp += 4;
int * ptY = (int *) bp; bp += 4;
wxPoint pt = wxPoint(*ptX,*ptY);
- int * colR = (int *) bp; bp += 4;
- int * colG = (int *) bp; bp += 4;
- int * colB = (int *) bp; bp += 4;
- int * colA = (int *) bp; bp += 4;
- wxColour col = wxColour(*colR,*colG,*colB,*colA);
if(!This) throw wxe_badarg(0);
bool Result = This->GetPixel(pt,&col);
rt.addBool(Result);
+ rt.add(col);
+ rt.addTupleCount(2);
break;
}
case wxDC_GetPPI: { // wxDC::GetPPI
@@ -6255,17 +6256,21 @@ case wxGraphicsContext_DrawIcon: { // wxGraphicsContext::DrawIcon
case wxGraphicsContext_DrawLines: { // wxGraphicsContext::DrawLines
int fillStyle=wxODDEVEN_RULE;
wxGraphicsContext *This = (wxGraphicsContext *) getPtr(bp,memenv); bp += 4;
- int * n = (int *) bp; bp += 4;
- wxDouble * pointsX = (wxDouble *) bp; bp += 8;
- wxDouble * pointsY = (wxDouble *) bp; bp += 8;
- wxPoint2DDouble points = wxPoint2DDouble(*pointsX,*pointsY);
+ int * pointsLen = (int *) bp; bp += 4;
+ wxPoint2DDouble *points;
+ points = (wxPoint2DDouble *) driver_alloc(sizeof(wxPoint2DDouble) * *pointsLen);
+ for(int i=0; i < *pointsLen; i++) {
+ double x = * (double *) bp; bp += 8;
+ double y = * (double *) bp; bp += 8;
+ points[i] = wxPoint2DDouble(x,y);}
while( * (int*) bp) { switch (* (int*) bp) {
case 1: {bp += 4;
fillStyle = (int)*(int *) bp; bp += 4;
} break;
}};
if(!This) throw wxe_badarg(0);
- This->DrawLines((size_t) *n,&points,fillStyle);
+ This->DrawLines(*pointsLen,points,fillStyle);
+ driver_free(points);
break;
}
case wxGraphicsContext_DrawPath: { // wxGraphicsContext::DrawPath
@@ -6372,23 +6377,15 @@ case wxGraphicsContext_StrokePath: { // wxGraphicsContext::StrokePath
This->StrokePath(*path);
break;
}
-case wxGraphicsContext_GetNativeContext: { // wxGraphicsContext::GetNativeContext
- wxGraphicsContext *This = (wxGraphicsContext *) getPtr(bp,memenv); bp += 4;
- if(!This) throw wxe_badarg(0);
- This->GetNativeContext();
- break;
-}
case wxGraphicsContext_GetPartialTextExtents: { // wxGraphicsContext::GetPartialTextExtents
+ wxArrayDouble widths;
wxGraphicsContext *This = (wxGraphicsContext *) getPtr(bp,memenv); bp += 4;
int * textLen = (int *) bp; bp += 4;
wxString text = wxString(bp, wxConvUTF8);
bp += *textLen+((8-((0+ *textLen) & 7)) & 7);
- int * widthsLen = (int *) bp; bp += 4;
- bp += 4; /* Align */
- wxArrayDouble widths;
- for(int i=0; i < *widthsLen; i++) { widths.Add(*(int *) bp); bp += 4;}
if(!This) throw wxe_badarg(0);
This->GetPartialTextExtents(text,widths);
+ rt.add(widths);
break;
}
case wxGraphicsContext_GetTextExtent: { // wxGraphicsContext::GetTextExtent
@@ -6514,27 +6511,18 @@ case wxGraphicsContext_StrokeLine: { // wxGraphicsContext::StrokeLine
This->StrokeLine((wxDouble) *x1,(wxDouble) *y1,(wxDouble) *x2,(wxDouble) *y2);
break;
}
-case wxGraphicsContext_StrokeLines_2: { // wxGraphicsContext::StrokeLines
+case wxGraphicsContext_StrokeLines: { // wxGraphicsContext::StrokeLines
wxGraphicsContext *This = (wxGraphicsContext *) getPtr(bp,memenv); bp += 4;
- int * n = (int *) bp; bp += 4;
- wxDouble * pointsX = (wxDouble *) bp; bp += 8;
- wxDouble * pointsY = (wxDouble *) bp; bp += 8;
- wxPoint2DDouble points = wxPoint2DDouble(*pointsX,*pointsY);
- if(!This) throw wxe_badarg(0);
- This->StrokeLines((size_t) *n,&points);
- break;
-}
-case wxGraphicsContext_StrokeLines_3: { // wxGraphicsContext::StrokeLines
- wxGraphicsContext *This = (wxGraphicsContext *) getPtr(bp,memenv); bp += 4;
- int * n = (int *) bp; bp += 4;
- wxDouble * beginPointsX = (wxDouble *) bp; bp += 8;
- wxDouble * beginPointsY = (wxDouble *) bp; bp += 8;
- wxPoint2DDouble beginPoints = wxPoint2DDouble(*beginPointsX,*beginPointsY);
- wxDouble * endPointsX = (wxDouble *) bp; bp += 8;
- wxDouble * endPointsY = (wxDouble *) bp; bp += 8;
- wxPoint2DDouble endPoints = wxPoint2DDouble(*endPointsX,*endPointsY);
+ int * pointsLen = (int *) bp; bp += 4;
+ wxPoint2DDouble *points;
+ points = (wxPoint2DDouble *) driver_alloc(sizeof(wxPoint2DDouble) * *pointsLen);
+ for(int i=0; i < *pointsLen; i++) {
+ double x = * (double *) bp; bp += 8;
+ double y = * (double *) bp; bp += 8;
+ points[i] = wxPoint2DDouble(x,y);}
if(!This) throw wxe_badarg(0);
- This->StrokeLines((size_t) *n,&beginPoints,&endPoints);
+ This->StrokeLines(*pointsLen,points);
+ driver_free(points);
break;
}
#endif // wxUSE_GRAPHICS_CONTEXT
@@ -6565,12 +6553,6 @@ case wxGraphicsMatrix_Get: { // wxGraphicsMatrix::Get
rt.addTupleCount(6);
break;
}
-case wxGraphicsMatrix_GetNativeMatrix: { // wxGraphicsMatrix::GetNativeMatrix
- wxGraphicsMatrix *This = (wxGraphicsMatrix *) getPtr(bp,memenv); bp += 4;
- if(!This) throw wxe_badarg(0);
- This->GetNativeMatrix();
- break;
-}
case wxGraphicsMatrix_Invert: { // wxGraphicsMatrix::Invert
wxGraphicsMatrix *This = (wxGraphicsMatrix *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
@@ -15438,25 +15420,21 @@ case wxListCtrl_GetItemFont: { // wxListCtrl::GetItemFont
break;
}
case wxListCtrl_GetItemPosition: { // wxListCtrl::GetItemPosition
+ wxPoint pos;
wxListCtrl *This = (wxListCtrl *) getPtr(bp,memenv); bp += 4;
int * item = (int *) bp; bp += 4;
- int * posX = (int *) bp; bp += 4;
- int * posY = (int *) bp; bp += 4;
- wxPoint pos = wxPoint(*posX,*posY);
if(!This) throw wxe_badarg(0);
bool Result = This->GetItemPosition((long) *item,pos);
rt.addBool(Result);
+ rt.add(pos);
+ rt.addTupleCount(2);
break;
}
case wxListCtrl_GetItemRect: { // wxListCtrl::GetItemRect
+ wxRect rect;
int code=wxLIST_RECT_BOUNDS;
wxListCtrl *This = (wxListCtrl *) getPtr(bp,memenv); bp += 4;
int * item = (int *) bp; bp += 4;
- int * rectX = (int *) bp; bp += 4;
- int * rectY = (int *) bp; bp += 4;
- int * rectW = (int *) bp; bp += 4;
- int * rectH = (int *) bp; bp += 4;
- wxRect rect = wxRect(*rectX,*rectY,*rectW,*rectH);
while( * (int*) bp) { switch (* (int*) bp) {
case 1: {bp += 4;
code = (int)*(int *) bp; bp += 4;
@@ -15465,6 +15443,8 @@ case wxListCtrl_GetItemRect: { // wxListCtrl::GetItemRect
if(!This) throw wxe_badarg(0);
bool Result = This->GetItemRect((long) *item,rect,code);
rt.addBool(Result);
+ rt.add(rect);
+ rt.addTupleCount(2);
break;
}
case wxListCtrl_GetItemSpacing: { // wxListCtrl::GetItemSpacing
@@ -15546,16 +15526,14 @@ case wxListCtrl_GetViewRect: { // wxListCtrl::GetViewRect
break;
}
case wxListCtrl_HitTest: { // wxListCtrl::HitTest
- int flags;
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);
rt.addInt(Result);
- rt.addInt(flags);
- rt.addTupleCount(2);
break;
}
case wxListCtrl_InsertColumn_2: { // wxListCtrl::InsertColumn
@@ -29383,6 +29361,13 @@ case wxStyledTextCtrl_SetEdgeColumn: { // wxStyledTextCtrl::SetEdgeColumn
This->SetEdgeColumn((int) *column);
break;
}
+case wxStyledTextCtrl_SetEdgeMode: { // wxStyledTextCtrl::SetEdgeMode
+ wxStyledTextCtrl *This = (wxStyledTextCtrl *) getPtr(bp,memenv); bp += 4;
+ int * mode = (int *) bp; bp += 4;
+ if(!This) throw wxe_badarg(0);
+ This->SetEdgeMode((int) *mode);
+ break;
+}
case wxStyledTextCtrl_GetEdgeMode: { // wxStyledTextCtrl::GetEdgeMode
wxStyledTextCtrl *This = (wxStyledTextCtrl *) getPtr(bp,memenv); bp += 4;
if(!This) throw wxe_badarg(0);
@@ -31354,6 +31339,43 @@ case wxLogNull_destroy: { // wxLogNull::destroy
delete This;}
break;
}
+case wxTaskBarIcon_new: { // wxTaskBarIcon::wxTaskBarIcon
+ wxTaskBarIcon * Result = new EwxTaskBarIcon();
+ newPtr((void *) Result, 1, memenv);
+ rt.addRef(getRef((void *)Result,memenv), "wxTaskBarIcon");
+ break;
+}
+case wxTaskBarIcon_PopupMenu: { // wxTaskBarIcon::PopupMenu
+ wxTaskBarIcon *This = (wxTaskBarIcon *) getPtr(bp,memenv); bp += 4;
+ wxMenu *menu = (wxMenu *) getPtr(bp,memenv); bp += 4;
+ if(!This) throw wxe_badarg(0);
+ bool Result = This->PopupMenu(menu);
+ rt.addBool(Result);
+ break;
+}
+case wxTaskBarIcon_RemoveIcon: { // wxTaskBarIcon::RemoveIcon
+ wxTaskBarIcon *This = (wxTaskBarIcon *) getPtr(bp,memenv); bp += 4;
+ if(!This) throw wxe_badarg(0);
+ bool Result = This->RemoveIcon();
+ rt.addBool(Result);
+ break;
+}
+case wxTaskBarIcon_SetIcon: { // wxTaskBarIcon::SetIcon
+ wxString tooltip= wxEmptyString;
+ wxTaskBarIcon *This = (wxTaskBarIcon *) getPtr(bp,memenv); bp += 4;
+ wxIcon *icon = (wxIcon *) getPtr(bp,memenv); bp += 4;
+ while( * (int*) bp) { switch (* (int*) bp) {
+ case 1: {bp += 4;
+ int * tooltipLen = (int *) bp; bp += 4;
+ tooltip = wxString(bp, wxConvUTF8);
+ bp += *tooltipLen+((8-((0+ *tooltipLen) & 7)) & 7);
+ } break;
+ }};
+ if(!This) throw wxe_badarg(0);
+ bool Result = This->SetIcon(*icon,tooltip);
+ rt.addBool(Result);
+ break;
+}
default: {
wxeReturn error = wxeReturn(WXE_DRV_PORT, Ecmd.caller, false); error.addAtom("_wxe_error_");
error.addInt((int) Ecmd.op);
diff --git a/lib/wx/c_src/gen/wxe_macros.h b/lib/wx/c_src/gen/wxe_macros.h
index ddc7c0155f..b24becae06 100644
--- a/lib/wx/c_src/gen/wxe_macros.h
+++ b/lib/wx/c_src/gen/wxe_macros.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2011. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2012. 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
@@ -57,6 +57,7 @@
#include <wx/toolbook.h>
#include <wx/listbook.h>
#include <wx/treebook.h>
+#include <wx/taskbar.h>
#include <wx/html/htmlwin.h>
#include <wx/html/htmlcell.h>
#include <wx/filename.h>
@@ -610,2740 +611,2745 @@
#define wxDC_GetCharHeight 663
#define wxDC_GetCharWidth 664
#define wxDC_GetClippingBox 665
-#define wxDC_GetFont 666
-#define wxDC_GetLayoutDirection 667
-#define wxDC_GetLogicalFunction 668
-#define wxDC_GetMapMode 669
-#define wxDC_GetMultiLineTextExtent_4 670
-#define wxDC_GetMultiLineTextExtent_1 671
-#define wxDC_GetPartialTextExtents 672
-#define wxDC_GetPen 673
-#define wxDC_GetPixel 674
-#define wxDC_GetPPI 675
-#define wxDC_GetSize 677
-#define wxDC_GetSizeMM 679
-#define wxDC_GetTextBackground 680
-#define wxDC_GetTextExtent_4 681
-#define wxDC_GetTextExtent_1 682
-#define wxDC_GetTextForeground 684
-#define wxDC_GetUserScale 685
-#define wxDC_GradientFillConcentric_3 686
-#define wxDC_GradientFillConcentric_4 687
-#define wxDC_GradientFillLinear 688
-#define wxDC_LogicalToDeviceX 689
-#define wxDC_LogicalToDeviceXRel 690
-#define wxDC_LogicalToDeviceY 691
-#define wxDC_LogicalToDeviceYRel 692
-#define wxDC_MaxX 693
-#define wxDC_MaxY 694
-#define wxDC_MinX 695
-#define wxDC_MinY 696
-#define wxDC_IsOk 697
-#define wxDC_ResetBoundingBox 698
-#define wxDC_SetAxisOrientation 699
-#define wxDC_SetBackground 700
-#define wxDC_SetBackgroundMode 701
-#define wxDC_SetBrush 702
-#define wxDC_SetClippingRegion_2 704
-#define wxDC_SetClippingRegion_1_1 705
-#define wxDC_SetClippingRegion_1_0 706
-#define wxDC_SetDeviceOrigin 707
-#define wxDC_SetFont 708
-#define wxDC_SetLayoutDirection 709
-#define wxDC_SetLogicalFunction 710
-#define wxDC_SetMapMode 711
-#define wxDC_SetPalette 712
-#define wxDC_SetPen 713
-#define wxDC_SetTextBackground 714
-#define wxDC_SetTextForeground 715
-#define wxDC_SetUserScale 716
-#define wxDC_StartDoc 717
-#define wxDC_StartPage 718
-#define wxMirrorDC_new 719
-#define wxMirrorDC_destroy 720
-#define wxScreenDC_new 721
-#define wxScreenDC_destruct 722
-#define wxPostScriptDC_new_0 723
-#define wxPostScriptDC_new_1 724
-#define wxPostScriptDC_destruct 725
-#define wxPostScriptDC_SetResolution 726
-#define wxPostScriptDC_GetResolution 727
-#define wxWindowDC_new_0 728
-#define wxWindowDC_new_1 729
-#define wxWindowDC_destruct 730
-#define wxClientDC_new_0 731
-#define wxClientDC_new_1 732
-#define wxClientDC_destroy 733
-#define wxPaintDC_new_0 734
-#define wxPaintDC_new_1 735
-#define wxPaintDC_destroy 736
-#define wxMemoryDC_new_1_0 738
-#define wxMemoryDC_new_1_1 739
-#define wxMemoryDC_new_0 740
-#define wxMemoryDC_destruct 742
-#define wxMemoryDC_SelectObject 743
-#define wxMemoryDC_SelectObjectAsSource 744
-#define wxBufferedDC_new_0 745
-#define wxBufferedDC_new_2 746
-#define wxBufferedDC_new_3 747
-#define wxBufferedDC_destruct 748
-#define wxBufferedDC_Init_2 749
-#define wxBufferedDC_Init_3 750
-#define wxBufferedPaintDC_new_3 751
-#define wxBufferedPaintDC_new_2 752
-#define wxBufferedPaintDC_destruct 753
-#define wxGraphicsObject_GetRenderer 754
-#define wxGraphicsObject_IsNull 755
-#define wxGraphicsContext_Create_1_1 756
-#define wxGraphicsContext_Create_1_0 757
-#define wxGraphicsContext_Create_0 758
-#define wxGraphicsContext_CreatePen 759
-#define wxGraphicsContext_CreateBrush 760
-#define wxGraphicsContext_CreateRadialGradientBrush 761
-#define wxGraphicsContext_CreateLinearGradientBrush 762
-#define wxGraphicsContext_CreateFont 763
-#define wxGraphicsContext_CreateMatrix 764
-#define wxGraphicsContext_CreatePath 765
-#define wxGraphicsContext_Clip_1 766
-#define wxGraphicsContext_Clip_4 767
-#define wxGraphicsContext_ResetClip 768
-#define wxGraphicsContext_DrawBitmap 769
-#define wxGraphicsContext_DrawEllipse 770
-#define wxGraphicsContext_DrawIcon 771
-#define wxGraphicsContext_DrawLines 772
-#define wxGraphicsContext_DrawPath 773
-#define wxGraphicsContext_DrawRectangle 774
-#define wxGraphicsContext_DrawRoundedRectangle 775
-#define wxGraphicsContext_DrawText_3 776
-#define wxGraphicsContext_DrawText_4_0 777
-#define wxGraphicsContext_DrawText_4_1 778
-#define wxGraphicsContext_DrawText_5 779
-#define wxGraphicsContext_FillPath 780
-#define wxGraphicsContext_StrokePath 781
-#define wxGraphicsContext_GetNativeContext 782
-#define wxGraphicsContext_GetPartialTextExtents 783
-#define wxGraphicsContext_GetTextExtent 784
-#define wxGraphicsContext_Rotate 785
-#define wxGraphicsContext_Scale 786
-#define wxGraphicsContext_Translate 787
-#define wxGraphicsContext_GetTransform 788
-#define wxGraphicsContext_SetTransform 789
-#define wxGraphicsContext_ConcatTransform 790
-#define wxGraphicsContext_SetBrush_1_1 791
-#define wxGraphicsContext_SetBrush_1_0 792
-#define wxGraphicsContext_SetFont_1 793
-#define wxGraphicsContext_SetFont_2 794
-#define wxGraphicsContext_SetPen_1_0 795
-#define wxGraphicsContext_SetPen_1_1 796
-#define wxGraphicsContext_StrokeLine 797
-#define wxGraphicsContext_StrokeLines_2 798
-#define wxGraphicsContext_StrokeLines_3 799
-#define wxGraphicsMatrix_Concat 800
-#define wxGraphicsMatrix_Get 802
-#define wxGraphicsMatrix_GetNativeMatrix 803
-#define wxGraphicsMatrix_Invert 804
-#define wxGraphicsMatrix_IsEqual 805
-#define wxGraphicsMatrix_IsIdentity 807
-#define wxGraphicsMatrix_Rotate 808
-#define wxGraphicsMatrix_Scale 809
-#define wxGraphicsMatrix_Translate 810
-#define wxGraphicsMatrix_Set 811
-#define wxGraphicsMatrix_TransformPoint 812
-#define wxGraphicsMatrix_TransformDistance 813
-#define wxGraphicsPath_MoveToPoint_2 814
-#define wxGraphicsPath_MoveToPoint_1 815
-#define wxGraphicsPath_AddArc_6 816
-#define wxGraphicsPath_AddArc_5 817
-#define wxGraphicsPath_AddArcToPoint 818
-#define wxGraphicsPath_AddCircle 819
-#define wxGraphicsPath_AddCurveToPoint_6 820
-#define wxGraphicsPath_AddCurveToPoint_3 821
-#define wxGraphicsPath_AddEllipse 822
-#define wxGraphicsPath_AddLineToPoint_2 823
-#define wxGraphicsPath_AddLineToPoint_1 824
-#define wxGraphicsPath_AddPath 825
-#define wxGraphicsPath_AddQuadCurveToPoint 826
-#define wxGraphicsPath_AddRectangle 827
-#define wxGraphicsPath_AddRoundedRectangle 828
-#define wxGraphicsPath_CloseSubpath 829
-#define wxGraphicsPath_Contains_3 830
-#define wxGraphicsPath_Contains_2 831
-#define wxGraphicsPath_GetBox 833
-#define wxGraphicsPath_GetCurrentPoint 835
-#define wxGraphicsPath_Transform 836
-#define wxGraphicsRenderer_GetDefaultRenderer 837
-#define wxGraphicsRenderer_CreateContext_1_1 838
-#define wxGraphicsRenderer_CreateContext_1_0 839
-#define wxGraphicsRenderer_CreatePen 840
-#define wxGraphicsRenderer_CreateBrush 841
-#define wxGraphicsRenderer_CreateLinearGradientBrush 842
-#define wxGraphicsRenderer_CreateRadialGradientBrush 843
-#define wxGraphicsRenderer_CreateFont 844
-#define wxGraphicsRenderer_CreateMatrix 845
-#define wxGraphicsRenderer_CreatePath 846
-#define wxMenuBar_new_1 848
-#define wxMenuBar_new_0 850
-#define wxMenuBar_destruct 852
-#define wxMenuBar_Append 853
-#define wxMenuBar_Check 854
-#define wxMenuBar_Enable_2 855
-#define wxMenuBar_Enable_1 856
-#define wxMenuBar_EnableTop 857
-#define wxMenuBar_FindMenu 858
-#define wxMenuBar_FindMenuItem 859
-#define wxMenuBar_FindItem 860
-#define wxMenuBar_GetHelpString 861
-#define wxMenuBar_GetLabel_1 862
-#define wxMenuBar_GetLabel_0 863
-#define wxMenuBar_GetLabelTop 864
-#define wxMenuBar_GetMenu 865
-#define wxMenuBar_GetMenuCount 866
-#define wxMenuBar_Insert 867
-#define wxMenuBar_IsChecked 868
-#define wxMenuBar_IsEnabled_1 869
-#define wxMenuBar_IsEnabled_0 870
-#define wxMenuBar_Remove 871
-#define wxMenuBar_Replace 872
-#define wxMenuBar_SetHelpString 873
-#define wxMenuBar_SetLabel_2 874
-#define wxMenuBar_SetLabel_1 875
-#define wxMenuBar_SetLabelTop 876
-#define wxControl_GetLabel 877
-#define wxControl_SetLabel 878
-#define wxControlWithItems_Append_1 879
-#define wxControlWithItems_Append_2 880
-#define wxControlWithItems_appendStrings_1 881
-#define wxControlWithItems_Clear 882
-#define wxControlWithItems_Delete 883
-#define wxControlWithItems_FindString 884
-#define wxControlWithItems_getClientData 885
-#define wxControlWithItems_setClientData 886
-#define wxControlWithItems_GetCount 887
-#define wxControlWithItems_GetSelection 888
-#define wxControlWithItems_GetString 889
-#define wxControlWithItems_GetStringSelection 890
-#define wxControlWithItems_Insert_2 891
-#define wxControlWithItems_Insert_3 892
-#define wxControlWithItems_IsEmpty 893
-#define wxControlWithItems_Select 894
-#define wxControlWithItems_SetSelection 895
-#define wxControlWithItems_SetString 896
-#define wxControlWithItems_SetStringSelection 897
-#define wxMenu_new_2 900
-#define wxMenu_new_1 901
-#define wxMenu_destruct 903
-#define wxMenu_Append_3 904
-#define wxMenu_Append_1 905
-#define wxMenu_Append_4_0 906
-#define wxMenu_Append_4_1 907
-#define wxMenu_AppendCheckItem 908
-#define wxMenu_AppendRadioItem 909
-#define wxMenu_AppendSeparator 910
-#define wxMenu_Break 911
-#define wxMenu_Check 912
-#define wxMenu_Delete_1_0 913
-#define wxMenu_Delete_1_1 914
-#define wxMenu_Destroy_1_0 915
-#define wxMenu_Destroy_1_1 916
-#define wxMenu_Enable 917
-#define wxMenu_FindItem_1 918
-#define wxMenu_FindItem_2 919
-#define wxMenu_FindItemByPosition 920
-#define wxMenu_GetHelpString 921
-#define wxMenu_GetLabel 922
-#define wxMenu_GetMenuItemCount 923
-#define wxMenu_GetMenuItems 924
-#define wxMenu_GetTitle 926
-#define wxMenu_Insert_2 927
-#define wxMenu_Insert_3 928
-#define wxMenu_Insert_5_1 929
-#define wxMenu_Insert_5_0 930
-#define wxMenu_InsertCheckItem 931
-#define wxMenu_InsertRadioItem 932
-#define wxMenu_InsertSeparator 933
-#define wxMenu_IsChecked 934
-#define wxMenu_IsEnabled 935
-#define wxMenu_Prepend_1 936
-#define wxMenu_Prepend_2 937
-#define wxMenu_Prepend_4_1 938
-#define wxMenu_Prepend_4_0 939
-#define wxMenu_PrependCheckItem 940
-#define wxMenu_PrependRadioItem 941
-#define wxMenu_PrependSeparator 942
-#define wxMenu_Remove_1_0 943
-#define wxMenu_Remove_1_1 944
-#define wxMenu_SetHelpString 945
-#define wxMenu_SetLabel 946
-#define wxMenu_SetTitle 947
-#define wxMenuItem_new 948
-#define wxMenuItem_destruct 950
-#define wxMenuItem_Check 951
-#define wxMenuItem_Enable 952
-#define wxMenuItem_GetBitmap 953
-#define wxMenuItem_GetHelp 954
-#define wxMenuItem_GetId 955
-#define wxMenuItem_GetKind 956
-#define wxMenuItem_GetLabel 957
-#define wxMenuItem_GetLabelFromText 958
-#define wxMenuItem_GetMenu 959
-#define wxMenuItem_GetText 960
-#define wxMenuItem_GetSubMenu 961
-#define wxMenuItem_IsCheckable 962
-#define wxMenuItem_IsChecked 963
-#define wxMenuItem_IsEnabled 964
-#define wxMenuItem_IsSeparator 965
-#define wxMenuItem_IsSubMenu 966
-#define wxMenuItem_SetBitmap 967
-#define wxMenuItem_SetHelp 968
-#define wxMenuItem_SetMenu 969
-#define wxMenuItem_SetSubMenu 970
-#define wxMenuItem_SetText 971
-#define wxToolBar_AddControl 972
-#define wxToolBar_AddSeparator 973
-#define wxToolBar_AddTool_5 974
-#define wxToolBar_AddTool_4_0 975
-#define wxToolBar_AddTool_1 976
-#define wxToolBar_AddTool_4_1 977
-#define wxToolBar_AddTool_3 978
-#define wxToolBar_AddTool_6 979
-#define wxToolBar_AddCheckTool 980
-#define wxToolBar_AddRadioTool 981
-#define wxToolBar_DeleteTool 982
-#define wxToolBar_DeleteToolByPos 983
-#define wxToolBar_EnableTool 984
-#define wxToolBar_FindById 985
-#define wxToolBar_FindControl 986
-#define wxToolBar_FindToolForPosition 987
-#define wxToolBar_GetToolSize 988
-#define wxToolBar_GetToolBitmapSize 989
-#define wxToolBar_GetMargins 990
-#define wxToolBar_GetToolEnabled 991
-#define wxToolBar_GetToolLongHelp 992
-#define wxToolBar_GetToolPacking 993
-#define wxToolBar_GetToolPos 994
-#define wxToolBar_GetToolSeparation 995
-#define wxToolBar_GetToolShortHelp 996
-#define wxToolBar_GetToolState 997
-#define wxToolBar_InsertControl 998
-#define wxToolBar_InsertSeparator 999
-#define wxToolBar_InsertTool_5 1000
-#define wxToolBar_InsertTool_2 1001
-#define wxToolBar_InsertTool_4 1002
-#define wxToolBar_Realize 1003
-#define wxToolBar_RemoveTool 1004
-#define wxToolBar_SetMargins 1005
-#define wxToolBar_SetToolBitmapSize 1006
-#define wxToolBar_SetToolLongHelp 1007
-#define wxToolBar_SetToolPacking 1008
-#define wxToolBar_SetToolShortHelp 1009
-#define wxToolBar_SetToolSeparation 1010
-#define wxToolBar_ToggleTool 1011
-#define wxStatusBar_new_0 1013
-#define wxStatusBar_new_2 1014
-#define wxStatusBar_destruct 1016
-#define wxStatusBar_Create 1017
-#define wxStatusBar_GetFieldRect 1018
-#define wxStatusBar_GetFieldsCount 1019
-#define wxStatusBar_GetStatusText 1020
-#define wxStatusBar_PopStatusText 1021
-#define wxStatusBar_PushStatusText 1022
-#define wxStatusBar_SetFieldsCount 1023
-#define wxStatusBar_SetMinHeight 1024
-#define wxStatusBar_SetStatusText 1025
-#define wxStatusBar_SetStatusWidths 1026
-#define wxStatusBar_SetStatusStyles 1027
-#define wxBitmap_new_0 1028
-#define wxBitmap_new_3 1029
-#define wxBitmap_new_4 1030
-#define wxBitmap_new_2_0 1031
-#define wxBitmap_new_2_1 1032
-#define wxBitmap_destruct 1033
-#define wxBitmap_ConvertToImage 1034
-#define wxBitmap_CopyFromIcon 1035
-#define wxBitmap_Create 1036
-#define wxBitmap_GetDepth 1037
-#define wxBitmap_GetHeight 1038
-#define wxBitmap_GetPalette 1039
-#define wxBitmap_GetMask 1040
-#define wxBitmap_GetWidth 1041
-#define wxBitmap_GetSubBitmap 1042
-#define wxBitmap_LoadFile 1043
-#define wxBitmap_Ok 1044
-#define wxBitmap_SaveFile 1045
-#define wxBitmap_SetDepth 1046
-#define wxBitmap_SetHeight 1047
-#define wxBitmap_SetMask 1048
-#define wxBitmap_SetPalette 1049
-#define wxBitmap_SetWidth 1050
-#define wxIcon_new_0 1051
-#define wxIcon_new_2 1052
-#define wxIcon_new_1 1053
-#define wxIcon_CopyFromBitmap 1054
-#define wxIcon_destroy 1055
-#define wxIconBundle_new_0 1056
-#define wxIconBundle_new_2 1057
-#define wxIconBundle_new_1_0 1058
-#define wxIconBundle_new_1_1 1059
-#define wxIconBundle_destruct 1060
-#define wxIconBundle_AddIcon_2 1061
-#define wxIconBundle_AddIcon_1 1062
-#define wxIconBundle_GetIcon_1_1 1063
-#define wxIconBundle_GetIcon_1_0 1064
-#define wxCursor_new_0 1065
-#define wxCursor_new_1_0 1066
-#define wxCursor_new_1_1 1067
-#define wxCursor_new_4 1068
-#define wxCursor_destruct 1069
-#define wxCursor_Ok 1070
-#define wxMask_new_0 1071
-#define wxMask_new_2_1 1072
-#define wxMask_new_2_0 1073
-#define wxMask_new_1 1074
-#define wxMask_destruct 1075
-#define wxMask_Create_2_1 1076
-#define wxMask_Create_2_0 1077
-#define wxMask_Create_1 1078
-#define wxImage_new_0 1079
-#define wxImage_new_3_0 1080
-#define wxImage_new_4 1081
-#define wxImage_new_5 1082
-#define wxImage_new_2 1083
-#define wxImage_new_3_1 1084
-#define wxImage_Blur 1085
-#define wxImage_BlurHorizontal 1086
-#define wxImage_BlurVertical 1087
-#define wxImage_ConvertAlphaToMask 1088
-#define wxImage_ConvertToGreyscale 1089
-#define wxImage_ConvertToMono 1090
-#define wxImage_Copy 1091
-#define wxImage_Create_3 1092
-#define wxImage_Create_4 1093
-#define wxImage_Create_5 1094
-#define wxImage_Destroy 1095
-#define wxImage_FindFirstUnusedColour 1096
-#define wxImage_GetImageExtWildcard 1097
-#define wxImage_GetAlpha_2 1098
-#define wxImage_GetAlpha_0 1099
-#define wxImage_GetBlue 1100
-#define wxImage_GetData 1101
-#define wxImage_GetGreen 1102
-#define wxImage_GetImageCount 1103
-#define wxImage_GetHeight 1104
-#define wxImage_GetMaskBlue 1105
-#define wxImage_GetMaskGreen 1106
-#define wxImage_GetMaskRed 1107
-#define wxImage_GetOrFindMaskColour 1108
-#define wxImage_GetPalette 1109
-#define wxImage_GetRed 1110
-#define wxImage_GetSubImage 1111
-#define wxImage_GetWidth 1112
-#define wxImage_HasAlpha 1113
-#define wxImage_HasMask 1114
-#define wxImage_GetOption 1115
-#define wxImage_GetOptionInt 1116
-#define wxImage_HasOption 1117
-#define wxImage_InitAlpha 1118
-#define wxImage_InitStandardHandlers 1119
-#define wxImage_IsTransparent 1120
-#define wxImage_LoadFile_2 1121
-#define wxImage_LoadFile_3 1122
-#define wxImage_Ok 1123
-#define wxImage_RemoveHandler 1124
-#define wxImage_Mirror 1125
-#define wxImage_Replace 1126
-#define wxImage_Rescale 1127
-#define wxImage_Resize 1128
-#define wxImage_Rotate 1129
-#define wxImage_RotateHue 1130
-#define wxImage_Rotate90 1131
-#define wxImage_SaveFile_1 1132
-#define wxImage_SaveFile_2_0 1133
-#define wxImage_SaveFile_2_1 1134
-#define wxImage_Scale 1135
-#define wxImage_Size 1136
-#define wxImage_SetAlpha_3 1137
-#define wxImage_SetAlpha_2 1138
-#define wxImage_SetData_2 1139
-#define wxImage_SetData_4 1140
-#define wxImage_SetMask 1141
-#define wxImage_SetMaskColour 1142
-#define wxImage_SetMaskFromImage 1143
-#define wxImage_SetOption_2_1 1144
-#define wxImage_SetOption_2_0 1145
-#define wxImage_SetPalette 1146
-#define wxImage_SetRGB_5 1147
-#define wxImage_SetRGB_4 1148
-#define wxImage_destroy 1149
-#define wxBrush_new_0 1150
-#define wxBrush_new_2 1151
-#define wxBrush_new_1 1152
-#define wxBrush_destruct 1154
-#define wxBrush_GetColour 1155
-#define wxBrush_GetStipple 1156
-#define wxBrush_GetStyle 1157
-#define wxBrush_IsHatch 1158
-#define wxBrush_IsOk 1159
-#define wxBrush_SetColour_1 1160
-#define wxBrush_SetColour_3 1161
-#define wxBrush_SetStipple 1162
-#define wxBrush_SetStyle 1163
-#define wxPen_new_0 1164
-#define wxPen_new_2 1165
-#define wxPen_destruct 1166
-#define wxPen_GetCap 1167
-#define wxPen_GetColour 1168
-#define wxPen_GetJoin 1169
-#define wxPen_GetStyle 1170
-#define wxPen_GetWidth 1171
-#define wxPen_IsOk 1172
-#define wxPen_SetCap 1173
-#define wxPen_SetColour_1 1174
-#define wxPen_SetColour_3 1175
-#define wxPen_SetJoin 1176
-#define wxPen_SetStyle 1177
-#define wxPen_SetWidth 1178
-#define wxRegion_new_0 1179
-#define wxRegion_new_4 1180
-#define wxRegion_new_2 1181
-#define wxRegion_new_1_1 1182
-#define wxRegion_new_1_0 1184
-#define wxRegion_destruct 1186
-#define wxRegion_Clear 1187
-#define wxRegion_Contains_2 1188
-#define wxRegion_Contains_1_0 1189
-#define wxRegion_Contains_4 1190
-#define wxRegion_Contains_1_1 1191
-#define wxRegion_ConvertToBitmap 1192
-#define wxRegion_GetBox 1193
-#define wxRegion_Intersect_4 1194
-#define wxRegion_Intersect_1_1 1195
-#define wxRegion_Intersect_1_0 1196
-#define wxRegion_IsEmpty 1197
-#define wxRegion_Subtract_4 1198
-#define wxRegion_Subtract_1_1 1199
-#define wxRegion_Subtract_1_0 1200
-#define wxRegion_Offset_2 1201
-#define wxRegion_Offset_1 1202
-#define wxRegion_Union_4 1203
-#define wxRegion_Union_1_2 1204
-#define wxRegion_Union_1_1 1205
-#define wxRegion_Union_1_0 1206
-#define wxRegion_Union_3 1207
-#define wxRegion_Xor_4 1208
-#define wxRegion_Xor_1_1 1209
-#define wxRegion_Xor_1_0 1210
-#define wxAcceleratorTable_new_0 1211
-#define wxAcceleratorTable_new_2 1212
-#define wxAcceleratorTable_destruct 1213
-#define wxAcceleratorTable_Ok 1214
-#define wxAcceleratorEntry_new_1_0 1215
-#define wxAcceleratorEntry_new_1_1 1216
-#define wxAcceleratorEntry_GetCommand 1217
-#define wxAcceleratorEntry_GetFlags 1218
-#define wxAcceleratorEntry_GetKeyCode 1219
-#define wxAcceleratorEntry_Set 1220
-#define wxAcceleratorEntry_destroy 1221
-#define wxCaret_new_3 1226
-#define wxCaret_new_2 1227
-#define wxCaret_destruct 1229
-#define wxCaret_Create_3 1230
-#define wxCaret_Create_2 1231
-#define wxCaret_GetBlinkTime 1232
-#define wxCaret_GetPosition 1234
-#define wxCaret_GetSize 1236
-#define wxCaret_GetWindow 1237
-#define wxCaret_Hide 1238
-#define wxCaret_IsOk 1239
-#define wxCaret_IsVisible 1240
-#define wxCaret_Move_2 1241
-#define wxCaret_Move_1 1242
-#define wxCaret_SetBlinkTime 1243
-#define wxCaret_SetSize_2 1244
-#define wxCaret_SetSize_1 1245
-#define wxCaret_Show 1246
-#define wxSizer_Add_2_1 1247
-#define wxSizer_Add_2_0 1248
-#define wxSizer_Add_3 1249
-#define wxSizer_Add_2_3 1250
-#define wxSizer_Add_2_2 1251
-#define wxSizer_AddSpacer 1252
-#define wxSizer_AddStretchSpacer 1253
-#define wxSizer_CalcMin 1254
-#define wxSizer_Clear 1255
-#define wxSizer_Detach_1_2 1256
-#define wxSizer_Detach_1_1 1257
-#define wxSizer_Detach_1_0 1258
-#define wxSizer_Fit 1259
-#define wxSizer_FitInside 1260
-#define wxSizer_GetChildren 1261
-#define wxSizer_GetItem_2_1 1262
-#define wxSizer_GetItem_2_0 1263
-#define wxSizer_GetItem_1 1264
-#define wxSizer_GetSize 1265
-#define wxSizer_GetPosition 1266
-#define wxSizer_GetMinSize 1267
-#define wxSizer_Hide_2_0 1268
-#define wxSizer_Hide_2_1 1269
-#define wxSizer_Hide_1 1270
-#define wxSizer_Insert_3_1 1271
-#define wxSizer_Insert_3_0 1272
-#define wxSizer_Insert_4 1273
-#define wxSizer_Insert_3_3 1274
-#define wxSizer_Insert_3_2 1275
-#define wxSizer_Insert_2 1276
-#define wxSizer_InsertSpacer 1277
-#define wxSizer_InsertStretchSpacer 1278
-#define wxSizer_IsShown_1_2 1279
-#define wxSizer_IsShown_1_1 1280
-#define wxSizer_IsShown_1_0 1281
-#define wxSizer_Layout 1282
-#define wxSizer_Prepend_2_1 1283
-#define wxSizer_Prepend_2_0 1284
-#define wxSizer_Prepend_3 1285
-#define wxSizer_Prepend_2_3 1286
-#define wxSizer_Prepend_2_2 1287
-#define wxSizer_Prepend_1 1288
-#define wxSizer_PrependSpacer 1289
-#define wxSizer_PrependStretchSpacer 1290
-#define wxSizer_RecalcSizes 1291
-#define wxSizer_Remove_1_1 1292
-#define wxSizer_Remove_1_0 1293
-#define wxSizer_Replace_3_1 1294
-#define wxSizer_Replace_3_0 1295
-#define wxSizer_Replace_2 1296
-#define wxSizer_SetDimension 1297
-#define wxSizer_SetMinSize_2 1298
-#define wxSizer_SetMinSize_1 1299
-#define wxSizer_SetItemMinSize_3_2 1300
-#define wxSizer_SetItemMinSize_2_2 1301
-#define wxSizer_SetItemMinSize_3_1 1302
-#define wxSizer_SetItemMinSize_2_1 1303
-#define wxSizer_SetItemMinSize_3_0 1304
-#define wxSizer_SetItemMinSize_2_0 1305
-#define wxSizer_SetSizeHints 1306
-#define wxSizer_SetVirtualSizeHints 1307
-#define wxSizer_Show_2_2 1308
-#define wxSizer_Show_2_1 1309
-#define wxSizer_Show_2_0 1310
-#define wxSizer_Show_1 1311
-#define wxSizerFlags_new 1312
-#define wxSizerFlags_Align 1313
-#define wxSizerFlags_Border_2 1314
-#define wxSizerFlags_Border_1 1315
-#define wxSizerFlags_Center 1316
-#define wxSizerFlags_Centre 1317
-#define wxSizerFlags_Expand 1318
-#define wxSizerFlags_Left 1319
-#define wxSizerFlags_Proportion 1320
-#define wxSizerFlags_Right 1321
-#define wxSizerFlags_destroy 1322
-#define wxSizerItem_new_5_1 1323
-#define wxSizerItem_new_2_1 1324
-#define wxSizerItem_new_5_0 1325
-#define wxSizerItem_new_2_0 1326
-#define wxSizerItem_new_6 1327
-#define wxSizerItem_new_3 1328
-#define wxSizerItem_new_0 1329
-#define wxSizerItem_destruct 1330
-#define wxSizerItem_CalcMin 1331
-#define wxSizerItem_DeleteWindows 1332
-#define wxSizerItem_DetachSizer 1333
-#define wxSizerItem_GetBorder 1334
-#define wxSizerItem_GetFlag 1335
-#define wxSizerItem_GetMinSize 1336
-#define wxSizerItem_GetPosition 1337
-#define wxSizerItem_GetProportion 1338
-#define wxSizerItem_GetRatio 1339
-#define wxSizerItem_GetRect 1340
-#define wxSizerItem_GetSize 1341
-#define wxSizerItem_GetSizer 1342
-#define wxSizerItem_GetSpacer 1343
-#define wxSizerItem_GetUserData 1344
-#define wxSizerItem_GetWindow 1345
-#define wxSizerItem_IsSizer 1346
-#define wxSizerItem_IsShown 1347
-#define wxSizerItem_IsSpacer 1348
-#define wxSizerItem_IsWindow 1349
-#define wxSizerItem_SetBorder 1350
-#define wxSizerItem_SetDimension 1351
-#define wxSizerItem_SetFlag 1352
-#define wxSizerItem_SetInitSize 1353
-#define wxSizerItem_SetMinSize_1 1354
-#define wxSizerItem_SetMinSize_2 1355
-#define wxSizerItem_SetProportion 1356
-#define wxSizerItem_SetRatio_2 1357
-#define wxSizerItem_SetRatio_1_1 1358
-#define wxSizerItem_SetRatio_1_0 1359
-#define wxSizerItem_SetSizer 1360
-#define wxSizerItem_SetSpacer_1 1361
-#define wxSizerItem_SetSpacer_2 1362
-#define wxSizerItem_SetWindow 1363
-#define wxSizerItem_Show 1364
-#define wxBoxSizer_new 1365
-#define wxBoxSizer_GetOrientation 1366
-#define wxBoxSizer_destroy 1367
-#define wxStaticBoxSizer_new_2 1368
-#define wxStaticBoxSizer_new_3 1369
-#define wxStaticBoxSizer_GetStaticBox 1370
-#define wxStaticBoxSizer_destroy 1371
-#define wxGridSizer_new_4 1372
-#define wxGridSizer_new_2 1373
-#define wxGridSizer_GetCols 1374
-#define wxGridSizer_GetHGap 1375
-#define wxGridSizer_GetRows 1376
-#define wxGridSizer_GetVGap 1377
-#define wxGridSizer_SetCols 1378
-#define wxGridSizer_SetHGap 1379
-#define wxGridSizer_SetRows 1380
-#define wxGridSizer_SetVGap 1381
-#define wxGridSizer_destroy 1382
-#define wxFlexGridSizer_new_4 1383
-#define wxFlexGridSizer_new_2 1384
-#define wxFlexGridSizer_AddGrowableCol 1385
-#define wxFlexGridSizer_AddGrowableRow 1386
-#define wxFlexGridSizer_GetFlexibleDirection 1387
-#define wxFlexGridSizer_GetNonFlexibleGrowMode 1388
-#define wxFlexGridSizer_RemoveGrowableCol 1389
-#define wxFlexGridSizer_RemoveGrowableRow 1390
-#define wxFlexGridSizer_SetFlexibleDirection 1391
-#define wxFlexGridSizer_SetNonFlexibleGrowMode 1392
-#define wxFlexGridSizer_destroy 1393
-#define wxGridBagSizer_new 1394
-#define wxGridBagSizer_Add_3_2 1395
-#define wxGridBagSizer_Add_3_1 1396
-#define wxGridBagSizer_Add_4 1397
-#define wxGridBagSizer_Add_1_0 1398
-#define wxGridBagSizer_Add_2_1 1399
-#define wxGridBagSizer_Add_2_0 1400
-#define wxGridBagSizer_Add_3_0 1401
-#define wxGridBagSizer_Add_1_1 1402
-#define wxGridBagSizer_CalcMin 1403
-#define wxGridBagSizer_CheckForIntersection_2 1404
-#define wxGridBagSizer_CheckForIntersection_3 1405
-#define wxGridBagSizer_FindItem_1_1 1406
-#define wxGridBagSizer_FindItem_1_0 1407
-#define wxGridBagSizer_FindItemAtPoint 1408
-#define wxGridBagSizer_FindItemAtPosition 1409
-#define wxGridBagSizer_FindItemWithData 1410
-#define wxGridBagSizer_GetCellSize 1411
-#define wxGridBagSizer_GetEmptyCellSize 1412
-#define wxGridBagSizer_GetItemPosition_1_2 1413
-#define wxGridBagSizer_GetItemPosition_1_1 1414
-#define wxGridBagSizer_GetItemPosition_1_0 1415
-#define wxGridBagSizer_GetItemSpan_1_2 1416
-#define wxGridBagSizer_GetItemSpan_1_1 1417
-#define wxGridBagSizer_GetItemSpan_1_0 1418
-#define wxGridBagSizer_SetEmptyCellSize 1419
-#define wxGridBagSizer_SetItemPosition_2_2 1420
-#define wxGridBagSizer_SetItemPosition_2_1 1421
-#define wxGridBagSizer_SetItemPosition_2_0 1422
-#define wxGridBagSizer_SetItemSpan_2_2 1423
-#define wxGridBagSizer_SetItemSpan_2_1 1424
-#define wxGridBagSizer_SetItemSpan_2_0 1425
-#define wxGridBagSizer_destroy 1426
-#define wxStdDialogButtonSizer_new 1427
-#define wxStdDialogButtonSizer_AddButton 1428
-#define wxStdDialogButtonSizer_Realize 1429
-#define wxStdDialogButtonSizer_SetAffirmativeButton 1430
-#define wxStdDialogButtonSizer_SetCancelButton 1431
-#define wxStdDialogButtonSizer_SetNegativeButton 1432
-#define wxStdDialogButtonSizer_destroy 1433
-#define wxFont_new_0 1434
-#define wxFont_new_1 1435
-#define wxFont_new_5 1436
-#define wxFont_destruct 1438
-#define wxFont_IsFixedWidth 1439
-#define wxFont_GetDefaultEncoding 1440
-#define wxFont_GetFaceName 1441
-#define wxFont_GetFamily 1442
-#define wxFont_GetNativeFontInfoDesc 1443
-#define wxFont_GetNativeFontInfoUserDesc 1444
-#define wxFont_GetPointSize 1445
-#define wxFont_GetStyle 1446
-#define wxFont_GetUnderlined 1447
-#define wxFont_GetWeight 1448
-#define wxFont_Ok 1449
-#define wxFont_SetDefaultEncoding 1450
-#define wxFont_SetFaceName 1451
-#define wxFont_SetFamily 1452
-#define wxFont_SetPointSize 1453
-#define wxFont_SetStyle 1454
-#define wxFont_SetUnderlined 1455
-#define wxFont_SetWeight 1456
-#define wxToolTip_Enable 1457
-#define wxToolTip_SetDelay 1458
-#define wxToolTip_new 1459
-#define wxToolTip_SetTip 1460
-#define wxToolTip_GetTip 1461
-#define wxToolTip_GetWindow 1462
-#define wxToolTip_destroy 1463
-#define wxButton_new_3 1465
-#define wxButton_new_0 1466
-#define wxButton_destruct 1467
-#define wxButton_Create 1468
-#define wxButton_GetDefaultSize 1469
-#define wxButton_SetDefault 1470
-#define wxButton_SetLabel 1471
-#define wxBitmapButton_new_4 1473
-#define wxBitmapButton_new_0 1474
-#define wxBitmapButton_Create 1475
-#define wxBitmapButton_GetBitmapDisabled 1476
-#define wxBitmapButton_GetBitmapFocus 1478
-#define wxBitmapButton_GetBitmapLabel 1480
-#define wxBitmapButton_GetBitmapSelected 1482
-#define wxBitmapButton_SetBitmapDisabled 1484
-#define wxBitmapButton_SetBitmapFocus 1485
-#define wxBitmapButton_SetBitmapLabel 1486
-#define wxBitmapButton_SetBitmapSelected 1487
-#define wxBitmapButton_destroy 1488
-#define wxToggleButton_new_0 1489
-#define wxToggleButton_new_4 1490
-#define wxToggleButton_Create 1491
-#define wxToggleButton_GetValue 1492
-#define wxToggleButton_SetValue 1493
-#define wxToggleButton_destroy 1494
-#define wxCalendarCtrl_new_0 1495
-#define wxCalendarCtrl_new_3 1496
-#define wxCalendarCtrl_Create 1497
-#define wxCalendarCtrl_destruct 1498
-#define wxCalendarCtrl_SetDate 1499
-#define wxCalendarCtrl_GetDate 1500
-#define wxCalendarCtrl_EnableYearChange 1501
-#define wxCalendarCtrl_EnableMonthChange 1502
-#define wxCalendarCtrl_EnableHolidayDisplay 1503
-#define wxCalendarCtrl_SetHeaderColours 1504
-#define wxCalendarCtrl_GetHeaderColourFg 1505
-#define wxCalendarCtrl_GetHeaderColourBg 1506
-#define wxCalendarCtrl_SetHighlightColours 1507
-#define wxCalendarCtrl_GetHighlightColourFg 1508
-#define wxCalendarCtrl_GetHighlightColourBg 1509
-#define wxCalendarCtrl_SetHolidayColours 1510
-#define wxCalendarCtrl_GetHolidayColourFg 1511
-#define wxCalendarCtrl_GetHolidayColourBg 1512
-#define wxCalendarCtrl_GetAttr 1513
-#define wxCalendarCtrl_SetAttr 1514
-#define wxCalendarCtrl_SetHoliday 1515
-#define wxCalendarCtrl_ResetAttr 1516
-#define wxCalendarCtrl_HitTest 1517
-#define wxCalendarDateAttr_new_0 1518
-#define wxCalendarDateAttr_new_2_1 1519
-#define wxCalendarDateAttr_new_2_0 1520
-#define wxCalendarDateAttr_SetTextColour 1521
-#define wxCalendarDateAttr_SetBackgroundColour 1522
-#define wxCalendarDateAttr_SetBorderColour 1523
-#define wxCalendarDateAttr_SetFont 1524
-#define wxCalendarDateAttr_SetBorder 1525
-#define wxCalendarDateAttr_SetHoliday 1526
-#define wxCalendarDateAttr_HasTextColour 1527
-#define wxCalendarDateAttr_HasBackgroundColour 1528
-#define wxCalendarDateAttr_HasBorderColour 1529
-#define wxCalendarDateAttr_HasFont 1530
-#define wxCalendarDateAttr_HasBorder 1531
-#define wxCalendarDateAttr_IsHoliday 1532
-#define wxCalendarDateAttr_GetTextColour 1533
-#define wxCalendarDateAttr_GetBackgroundColour 1534
-#define wxCalendarDateAttr_GetBorderColour 1535
-#define wxCalendarDateAttr_GetFont 1536
-#define wxCalendarDateAttr_GetBorder 1537
-#define wxCalendarDateAttr_destroy 1538
-#define wxCheckBox_new_4 1540
-#define wxCheckBox_new_0 1541
-#define wxCheckBox_Create 1542
-#define wxCheckBox_GetValue 1543
-#define wxCheckBox_Get3StateValue 1544
-#define wxCheckBox_Is3rdStateAllowedForUser 1545
-#define wxCheckBox_Is3State 1546
-#define wxCheckBox_IsChecked 1547
-#define wxCheckBox_SetValue 1548
-#define wxCheckBox_Set3StateValue 1549
-#define wxCheckBox_destroy 1550
-#define wxCheckListBox_new_0 1551
-#define wxCheckListBox_new_3 1553
-#define wxCheckListBox_Check 1554
-#define wxCheckListBox_IsChecked 1555
-#define wxCheckListBox_destroy 1556
-#define wxChoice_new_3 1559
-#define wxChoice_new_0 1560
-#define wxChoice_destruct 1562
-#define wxChoice_Create 1564
-#define wxChoice_Delete 1565
-#define wxChoice_GetColumns 1566
-#define wxChoice_SetColumns 1567
-#define wxComboBox_new_0 1568
-#define wxComboBox_new_3 1570
-#define wxComboBox_destruct 1571
-#define wxComboBox_Create 1573
-#define wxComboBox_CanCopy 1574
-#define wxComboBox_CanCut 1575
-#define wxComboBox_CanPaste 1576
-#define wxComboBox_CanRedo 1577
-#define wxComboBox_CanUndo 1578
-#define wxComboBox_Copy 1579
-#define wxComboBox_Cut 1580
-#define wxComboBox_GetInsertionPoint 1581
-#define wxComboBox_GetLastPosition 1582
-#define wxComboBox_GetValue 1583
-#define wxComboBox_Paste 1584
-#define wxComboBox_Redo 1585
-#define wxComboBox_Replace 1586
-#define wxComboBox_Remove 1587
-#define wxComboBox_SetInsertionPoint 1588
-#define wxComboBox_SetInsertionPointEnd 1589
-#define wxComboBox_SetSelection_1 1590
-#define wxComboBox_SetSelection_2 1591
-#define wxComboBox_SetValue 1592
-#define wxComboBox_Undo 1593
-#define wxGauge_new_0 1594
-#define wxGauge_new_4 1595
-#define wxGauge_Create 1596
-#define wxGauge_GetBezelFace 1597
-#define wxGauge_GetRange 1598
-#define wxGauge_GetShadowWidth 1599
-#define wxGauge_GetValue 1600
-#define wxGauge_IsVertical 1601
-#define wxGauge_SetBezelFace 1602
-#define wxGauge_SetRange 1603
-#define wxGauge_SetShadowWidth 1604
-#define wxGauge_SetValue 1605
-#define wxGauge_Pulse 1606
-#define wxGauge_destroy 1607
-#define wxGenericDirCtrl_new_0 1608
-#define wxGenericDirCtrl_new_2 1609
-#define wxGenericDirCtrl_destruct 1610
-#define wxGenericDirCtrl_Create 1611
-#define wxGenericDirCtrl_Init 1612
-#define wxGenericDirCtrl_CollapseTree 1613
-#define wxGenericDirCtrl_ExpandPath 1614
-#define wxGenericDirCtrl_GetDefaultPath 1615
-#define wxGenericDirCtrl_GetPath 1616
-#define wxGenericDirCtrl_GetFilePath 1617
-#define wxGenericDirCtrl_GetFilter 1618
-#define wxGenericDirCtrl_GetFilterIndex 1619
-#define wxGenericDirCtrl_GetRootId 1620
-#define wxGenericDirCtrl_GetTreeCtrl 1621
-#define wxGenericDirCtrl_ReCreateTree 1622
-#define wxGenericDirCtrl_SetDefaultPath 1623
-#define wxGenericDirCtrl_SetFilter 1624
-#define wxGenericDirCtrl_SetFilterIndex 1625
-#define wxGenericDirCtrl_SetPath 1626
-#define wxStaticBox_new_4 1628
-#define wxStaticBox_new_0 1629
-#define wxStaticBox_Create 1630
-#define wxStaticBox_destroy 1631
-#define wxStaticLine_new_2 1633
-#define wxStaticLine_new_0 1634
-#define wxStaticLine_Create 1635
-#define wxStaticLine_IsVertical 1636
-#define wxStaticLine_GetDefaultSize 1637
-#define wxStaticLine_destroy 1638
-#define wxListBox_new_3 1641
-#define wxListBox_new_0 1642
-#define wxListBox_destruct 1644
-#define wxListBox_Create 1646
-#define wxListBox_Deselect 1647
-#define wxListBox_GetSelections 1648
-#define wxListBox_InsertItems 1649
-#define wxListBox_IsSelected 1650
-#define wxListBox_Set 1652
-#define wxListBox_HitTest 1653
-#define wxListBox_SetFirstItem_1_0 1654
-#define wxListBox_SetFirstItem_1_1 1655
-#define wxListCtrl_new_0 1656
-#define wxListCtrl_new_2 1657
-#define wxListCtrl_Arrange 1658
-#define wxListCtrl_AssignImageList 1659
-#define wxListCtrl_ClearAll 1660
-#define wxListCtrl_Create 1661
-#define wxListCtrl_DeleteAllItems 1662
-#define wxListCtrl_DeleteColumn 1663
-#define wxListCtrl_DeleteItem 1664
-#define wxListCtrl_EditLabel 1665
-#define wxListCtrl_EnsureVisible 1666
-#define wxListCtrl_FindItem_3_0 1667
-#define wxListCtrl_FindItem_3_1 1668
-#define wxListCtrl_GetColumn 1669
-#define wxListCtrl_GetColumnCount 1670
-#define wxListCtrl_GetColumnWidth 1671
-#define wxListCtrl_GetCountPerPage 1672
-#define wxListCtrl_GetEditControl 1673
-#define wxListCtrl_GetImageList 1674
-#define wxListCtrl_GetItem 1675
-#define wxListCtrl_GetItemBackgroundColour 1676
-#define wxListCtrl_GetItemCount 1677
-#define wxListCtrl_GetItemData 1678
-#define wxListCtrl_GetItemFont 1679
-#define wxListCtrl_GetItemPosition 1680
-#define wxListCtrl_GetItemRect 1681
-#define wxListCtrl_GetItemSpacing 1682
-#define wxListCtrl_GetItemState 1683
-#define wxListCtrl_GetItemText 1684
-#define wxListCtrl_GetItemTextColour 1685
-#define wxListCtrl_GetNextItem 1686
-#define wxListCtrl_GetSelectedItemCount 1687
-#define wxListCtrl_GetTextColour 1688
-#define wxListCtrl_GetTopItem 1689
-#define wxListCtrl_GetViewRect 1690
-#define wxListCtrl_HitTest 1691
-#define wxListCtrl_InsertColumn_2 1692
-#define wxListCtrl_InsertColumn_3 1693
-#define wxListCtrl_InsertItem_1 1694
-#define wxListCtrl_InsertItem_2_1 1695
-#define wxListCtrl_InsertItem_2_0 1696
-#define wxListCtrl_InsertItem_3 1697
-#define wxListCtrl_RefreshItem 1698
-#define wxListCtrl_RefreshItems 1699
-#define wxListCtrl_ScrollList 1700
-#define wxListCtrl_SetBackgroundColour 1701
-#define wxListCtrl_SetColumn 1702
-#define wxListCtrl_SetColumnWidth 1703
-#define wxListCtrl_SetImageList 1704
-#define wxListCtrl_SetItem_1 1705
-#define wxListCtrl_SetItem_4 1706
-#define wxListCtrl_SetItemBackgroundColour 1707
-#define wxListCtrl_SetItemCount 1708
-#define wxListCtrl_SetItemData 1709
-#define wxListCtrl_SetItemFont 1710
-#define wxListCtrl_SetItemImage 1711
-#define wxListCtrl_SetItemColumnImage 1712
-#define wxListCtrl_SetItemPosition 1713
-#define wxListCtrl_SetItemState 1714
-#define wxListCtrl_SetItemText 1715
-#define wxListCtrl_SetItemTextColour 1716
-#define wxListCtrl_SetSingleStyle 1717
-#define wxListCtrl_SetTextColour 1718
-#define wxListCtrl_SetWindowStyleFlag 1719
-#define wxListCtrl_SortItems 1720
-#define wxListCtrl_destroy 1721
-#define wxListView_ClearColumnImage 1722
-#define wxListView_Focus 1723
-#define wxListView_GetFirstSelected 1724
-#define wxListView_GetFocusedItem 1725
-#define wxListView_GetNextSelected 1726
-#define wxListView_IsSelected 1727
-#define wxListView_Select 1728
-#define wxListView_SetColumnImage 1729
-#define wxListItem_new_0 1730
-#define wxListItem_new_1 1731
-#define wxListItem_destruct 1732
-#define wxListItem_Clear 1733
-#define wxListItem_GetAlign 1734
-#define wxListItem_GetBackgroundColour 1735
-#define wxListItem_GetColumn 1736
-#define wxListItem_GetFont 1737
-#define wxListItem_GetId 1738
-#define wxListItem_GetImage 1739
-#define wxListItem_GetMask 1740
-#define wxListItem_GetState 1741
-#define wxListItem_GetText 1742
-#define wxListItem_GetTextColour 1743
-#define wxListItem_GetWidth 1744
-#define wxListItem_SetAlign 1745
-#define wxListItem_SetBackgroundColour 1746
-#define wxListItem_SetColumn 1747
-#define wxListItem_SetFont 1748
-#define wxListItem_SetId 1749
-#define wxListItem_SetImage 1750
-#define wxListItem_SetMask 1751
-#define wxListItem_SetState 1752
-#define wxListItem_SetStateMask 1753
-#define wxListItem_SetText 1754
-#define wxListItem_SetTextColour 1755
-#define wxListItem_SetWidth 1756
-#define wxListItemAttr_new_0 1757
-#define wxListItemAttr_new_3 1758
-#define wxListItemAttr_GetBackgroundColour 1759
-#define wxListItemAttr_GetFont 1760
-#define wxListItemAttr_GetTextColour 1761
-#define wxListItemAttr_HasBackgroundColour 1762
-#define wxListItemAttr_HasFont 1763
-#define wxListItemAttr_HasTextColour 1764
-#define wxListItemAttr_SetBackgroundColour 1765
-#define wxListItemAttr_SetFont 1766
-#define wxListItemAttr_SetTextColour 1767
-#define wxListItemAttr_destroy 1768
-#define wxImageList_new_0 1769
-#define wxImageList_new_3 1770
-#define wxImageList_Add_1 1771
-#define wxImageList_Add_2_0 1772
-#define wxImageList_Add_2_1 1773
-#define wxImageList_Create 1774
-#define wxImageList_Draw 1776
-#define wxImageList_GetBitmap 1777
-#define wxImageList_GetIcon 1778
-#define wxImageList_GetImageCount 1779
-#define wxImageList_GetSize 1780
-#define wxImageList_Remove 1781
-#define wxImageList_RemoveAll 1782
-#define wxImageList_Replace_2 1783
-#define wxImageList_Replace_3 1784
-#define wxImageList_destroy 1785
-#define wxTextAttr_new_0 1786
-#define wxTextAttr_new_2 1787
-#define wxTextAttr_GetAlignment 1788
-#define wxTextAttr_GetBackgroundColour 1789
-#define wxTextAttr_GetFont 1790
-#define wxTextAttr_GetLeftIndent 1791
-#define wxTextAttr_GetLeftSubIndent 1792
-#define wxTextAttr_GetRightIndent 1793
-#define wxTextAttr_GetTabs 1794
-#define wxTextAttr_GetTextColour 1795
-#define wxTextAttr_HasBackgroundColour 1796
-#define wxTextAttr_HasFont 1797
-#define wxTextAttr_HasTextColour 1798
-#define wxTextAttr_GetFlags 1799
-#define wxTextAttr_IsDefault 1800
-#define wxTextAttr_SetAlignment 1801
-#define wxTextAttr_SetBackgroundColour 1802
-#define wxTextAttr_SetFlags 1803
-#define wxTextAttr_SetFont 1804
-#define wxTextAttr_SetLeftIndent 1805
-#define wxTextAttr_SetRightIndent 1806
-#define wxTextAttr_SetTabs 1807
-#define wxTextAttr_SetTextColour 1808
-#define wxTextAttr_destroy 1809
-#define wxTextCtrl_new_3 1811
-#define wxTextCtrl_new_0 1812
-#define wxTextCtrl_destruct 1814
-#define wxTextCtrl_AppendText 1815
-#define wxTextCtrl_CanCopy 1816
-#define wxTextCtrl_CanCut 1817
-#define wxTextCtrl_CanPaste 1818
-#define wxTextCtrl_CanRedo 1819
-#define wxTextCtrl_CanUndo 1820
-#define wxTextCtrl_Clear 1821
-#define wxTextCtrl_Copy 1822
-#define wxTextCtrl_Create 1823
-#define wxTextCtrl_Cut 1824
-#define wxTextCtrl_DiscardEdits 1825
-#define wxTextCtrl_EmulateKeyPress 1826
-#define wxTextCtrl_GetDefaultStyle 1827
-#define wxTextCtrl_GetInsertionPoint 1828
-#define wxTextCtrl_GetLastPosition 1829
-#define wxTextCtrl_GetLineLength 1830
-#define wxTextCtrl_GetLineText 1831
-#define wxTextCtrl_GetNumberOfLines 1832
-#define wxTextCtrl_GetRange 1833
-#define wxTextCtrl_GetSelection 1834
-#define wxTextCtrl_GetStringSelection 1835
-#define wxTextCtrl_GetStyle 1836
-#define wxTextCtrl_GetValue 1837
-#define wxTextCtrl_IsEditable 1838
-#define wxTextCtrl_IsModified 1839
-#define wxTextCtrl_IsMultiLine 1840
-#define wxTextCtrl_IsSingleLine 1841
-#define wxTextCtrl_LoadFile 1842
-#define wxTextCtrl_MarkDirty 1843
-#define wxTextCtrl_Paste 1844
-#define wxTextCtrl_PositionToXY 1845
-#define wxTextCtrl_Redo 1846
-#define wxTextCtrl_Remove 1847
-#define wxTextCtrl_Replace 1848
-#define wxTextCtrl_SaveFile 1849
-#define wxTextCtrl_SetDefaultStyle 1850
-#define wxTextCtrl_SetEditable 1851
-#define wxTextCtrl_SetInsertionPoint 1852
-#define wxTextCtrl_SetInsertionPointEnd 1853
-#define wxTextCtrl_SetMaxLength 1855
-#define wxTextCtrl_SetSelection 1856
-#define wxTextCtrl_SetStyle 1857
-#define wxTextCtrl_SetValue 1858
-#define wxTextCtrl_ShowPosition 1859
-#define wxTextCtrl_Undo 1860
-#define wxTextCtrl_WriteText 1861
-#define wxTextCtrl_XYToPosition 1862
-#define wxNotebook_new_0 1865
-#define wxNotebook_new_3 1866
-#define wxNotebook_destruct 1867
-#define wxNotebook_AddPage 1868
-#define wxNotebook_AdvanceSelection 1869
-#define wxNotebook_AssignImageList 1870
-#define wxNotebook_Create 1871
-#define wxNotebook_DeleteAllPages 1872
-#define wxNotebook_DeletePage 1873
-#define wxNotebook_RemovePage 1874
-#define wxNotebook_GetCurrentPage 1875
-#define wxNotebook_GetImageList 1876
-#define wxNotebook_GetPage 1878
-#define wxNotebook_GetPageCount 1879
-#define wxNotebook_GetPageImage 1880
-#define wxNotebook_GetPageText 1881
-#define wxNotebook_GetRowCount 1882
-#define wxNotebook_GetSelection 1883
-#define wxNotebook_GetThemeBackgroundColour 1884
-#define wxNotebook_HitTest 1886
-#define wxNotebook_InsertPage 1888
-#define wxNotebook_SetImageList 1889
-#define wxNotebook_SetPadding 1890
-#define wxNotebook_SetPageSize 1891
-#define wxNotebook_SetPageImage 1892
-#define wxNotebook_SetPageText 1893
-#define wxNotebook_SetSelection 1894
-#define wxNotebook_ChangeSelection 1895
-#define wxChoicebook_new_0 1896
-#define wxChoicebook_new_3 1897
-#define wxChoicebook_AddPage 1898
-#define wxChoicebook_AdvanceSelection 1899
-#define wxChoicebook_AssignImageList 1900
-#define wxChoicebook_Create 1901
-#define wxChoicebook_DeleteAllPages 1902
-#define wxChoicebook_DeletePage 1903
-#define wxChoicebook_RemovePage 1904
-#define wxChoicebook_GetCurrentPage 1905
-#define wxChoicebook_GetImageList 1906
-#define wxChoicebook_GetPage 1908
-#define wxChoicebook_GetPageCount 1909
-#define wxChoicebook_GetPageImage 1910
-#define wxChoicebook_GetPageText 1911
-#define wxChoicebook_GetSelection 1912
-#define wxChoicebook_HitTest 1913
-#define wxChoicebook_InsertPage 1914
-#define wxChoicebook_SetImageList 1915
-#define wxChoicebook_SetPageSize 1916
-#define wxChoicebook_SetPageImage 1917
-#define wxChoicebook_SetPageText 1918
-#define wxChoicebook_SetSelection 1919
-#define wxChoicebook_ChangeSelection 1920
-#define wxChoicebook_destroy 1921
-#define wxToolbook_new_0 1922
-#define wxToolbook_new_3 1923
-#define wxToolbook_AddPage 1924
-#define wxToolbook_AdvanceSelection 1925
-#define wxToolbook_AssignImageList 1926
-#define wxToolbook_Create 1927
-#define wxToolbook_DeleteAllPages 1928
-#define wxToolbook_DeletePage 1929
-#define wxToolbook_RemovePage 1930
-#define wxToolbook_GetCurrentPage 1931
-#define wxToolbook_GetImageList 1932
-#define wxToolbook_GetPage 1934
-#define wxToolbook_GetPageCount 1935
-#define wxToolbook_GetPageImage 1936
-#define wxToolbook_GetPageText 1937
-#define wxToolbook_GetSelection 1938
-#define wxToolbook_HitTest 1940
-#define wxToolbook_InsertPage 1941
-#define wxToolbook_SetImageList 1942
-#define wxToolbook_SetPageSize 1943
-#define wxToolbook_SetPageImage 1944
-#define wxToolbook_SetPageText 1945
-#define wxToolbook_SetSelection 1946
-#define wxToolbook_ChangeSelection 1947
-#define wxToolbook_destroy 1948
-#define wxListbook_new_0 1949
-#define wxListbook_new_3 1950
-#define wxListbook_AddPage 1951
-#define wxListbook_AdvanceSelection 1952
-#define wxListbook_AssignImageList 1953
-#define wxListbook_Create 1954
-#define wxListbook_DeleteAllPages 1955
-#define wxListbook_DeletePage 1956
-#define wxListbook_RemovePage 1957
-#define wxListbook_GetCurrentPage 1958
-#define wxListbook_GetImageList 1959
-#define wxListbook_GetPage 1961
-#define wxListbook_GetPageCount 1962
-#define wxListbook_GetPageImage 1963
-#define wxListbook_GetPageText 1964
-#define wxListbook_GetSelection 1965
-#define wxListbook_HitTest 1967
-#define wxListbook_InsertPage 1968
-#define wxListbook_SetImageList 1969
-#define wxListbook_SetPageSize 1970
-#define wxListbook_SetPageImage 1971
-#define wxListbook_SetPageText 1972
-#define wxListbook_SetSelection 1973
-#define wxListbook_ChangeSelection 1974
-#define wxListbook_destroy 1975
-#define wxTreebook_new_0 1976
-#define wxTreebook_new_3 1977
-#define wxTreebook_AddPage 1978
-#define wxTreebook_AdvanceSelection 1979
-#define wxTreebook_AssignImageList 1980
-#define wxTreebook_Create 1981
-#define wxTreebook_DeleteAllPages 1982
-#define wxTreebook_DeletePage 1983
-#define wxTreebook_RemovePage 1984
-#define wxTreebook_GetCurrentPage 1985
-#define wxTreebook_GetImageList 1986
-#define wxTreebook_GetPage 1988
-#define wxTreebook_GetPageCount 1989
-#define wxTreebook_GetPageImage 1990
-#define wxTreebook_GetPageText 1991
-#define wxTreebook_GetSelection 1992
-#define wxTreebook_ExpandNode 1993
-#define wxTreebook_IsNodeExpanded 1994
-#define wxTreebook_HitTest 1996
-#define wxTreebook_InsertPage 1997
-#define wxTreebook_InsertSubPage 1998
-#define wxTreebook_SetImageList 1999
-#define wxTreebook_SetPageSize 2000
-#define wxTreebook_SetPageImage 2001
-#define wxTreebook_SetPageText 2002
-#define wxTreebook_SetSelection 2003
-#define wxTreebook_ChangeSelection 2004
-#define wxTreebook_destroy 2005
-#define wxTreeCtrl_new_2 2008
-#define wxTreeCtrl_new_0 2009
-#define wxTreeCtrl_destruct 2011
-#define wxTreeCtrl_AddRoot 2012
-#define wxTreeCtrl_AppendItem 2013
-#define wxTreeCtrl_AssignImageList 2014
-#define wxTreeCtrl_AssignStateImageList 2015
-#define wxTreeCtrl_Collapse 2016
-#define wxTreeCtrl_CollapseAndReset 2017
-#define wxTreeCtrl_Create 2018
-#define wxTreeCtrl_Delete 2019
-#define wxTreeCtrl_DeleteAllItems 2020
-#define wxTreeCtrl_DeleteChildren 2021
-#define wxTreeCtrl_EditLabel 2022
-#define wxTreeCtrl_EnsureVisible 2023
-#define wxTreeCtrl_Expand 2024
-#define wxTreeCtrl_GetBoundingRect 2025
-#define wxTreeCtrl_GetChildrenCount 2027
-#define wxTreeCtrl_GetCount 2028
-#define wxTreeCtrl_GetEditControl 2029
-#define wxTreeCtrl_GetFirstChild 2030
-#define wxTreeCtrl_GetNextChild 2031
-#define wxTreeCtrl_GetFirstVisibleItem 2032
-#define wxTreeCtrl_GetImageList 2033
-#define wxTreeCtrl_GetIndent 2034
-#define wxTreeCtrl_GetItemBackgroundColour 2035
-#define wxTreeCtrl_GetItemData 2036
-#define wxTreeCtrl_GetItemFont 2037
-#define wxTreeCtrl_GetItemImage_1 2038
-#define wxTreeCtrl_GetItemImage_2 2039
-#define wxTreeCtrl_GetItemText 2040
-#define wxTreeCtrl_GetItemTextColour 2041
-#define wxTreeCtrl_GetLastChild 2042
-#define wxTreeCtrl_GetNextSibling 2043
-#define wxTreeCtrl_GetNextVisible 2044
-#define wxTreeCtrl_GetItemParent 2045
-#define wxTreeCtrl_GetPrevSibling 2046
-#define wxTreeCtrl_GetPrevVisible 2047
-#define wxTreeCtrl_GetRootItem 2048
-#define wxTreeCtrl_GetSelection 2049
-#define wxTreeCtrl_GetSelections 2050
-#define wxTreeCtrl_GetStateImageList 2051
-#define wxTreeCtrl_HitTest 2052
-#define wxTreeCtrl_InsertItem 2054
-#define wxTreeCtrl_IsBold 2055
-#define wxTreeCtrl_IsExpanded 2056
-#define wxTreeCtrl_IsSelected 2057
-#define wxTreeCtrl_IsVisible 2058
-#define wxTreeCtrl_ItemHasChildren 2059
-#define wxTreeCtrl_PrependItem 2060
-#define wxTreeCtrl_ScrollTo 2061
-#define wxTreeCtrl_SelectItem_1 2062
-#define wxTreeCtrl_SelectItem_2 2063
-#define wxTreeCtrl_SetIndent 2064
-#define wxTreeCtrl_SetImageList 2065
-#define wxTreeCtrl_SetItemBackgroundColour 2066
-#define wxTreeCtrl_SetItemBold 2067
-#define wxTreeCtrl_SetItemData 2068
-#define wxTreeCtrl_SetItemDropHighlight 2069
-#define wxTreeCtrl_SetItemFont 2070
-#define wxTreeCtrl_SetItemHasChildren 2071
-#define wxTreeCtrl_SetItemImage_2 2072
-#define wxTreeCtrl_SetItemImage_3 2073
-#define wxTreeCtrl_SetItemText 2074
-#define wxTreeCtrl_SetItemTextColour 2075
-#define wxTreeCtrl_SetStateImageList 2076
-#define wxTreeCtrl_SetWindowStyle 2077
-#define wxTreeCtrl_SortChildren 2078
-#define wxTreeCtrl_Toggle 2079
-#define wxTreeCtrl_ToggleItemSelection 2080
-#define wxTreeCtrl_Unselect 2081
-#define wxTreeCtrl_UnselectAll 2082
-#define wxTreeCtrl_UnselectItem 2083
-#define wxScrollBar_new_0 2084
-#define wxScrollBar_new_3 2085
-#define wxScrollBar_destruct 2086
-#define wxScrollBar_Create 2087
-#define wxScrollBar_GetRange 2088
-#define wxScrollBar_GetPageSize 2089
-#define wxScrollBar_GetThumbPosition 2090
-#define wxScrollBar_GetThumbSize 2091
-#define wxScrollBar_SetThumbPosition 2092
-#define wxScrollBar_SetScrollbar 2093
-#define wxSpinButton_new_2 2095
-#define wxSpinButton_new_0 2096
-#define wxSpinButton_Create 2097
-#define wxSpinButton_GetMax 2098
-#define wxSpinButton_GetMin 2099
-#define wxSpinButton_GetValue 2100
-#define wxSpinButton_SetRange 2101
-#define wxSpinButton_SetValue 2102
-#define wxSpinButton_destroy 2103
-#define wxSpinCtrl_new_0 2104
-#define wxSpinCtrl_new_2 2105
-#define wxSpinCtrl_Create 2107
-#define wxSpinCtrl_SetValue_1_1 2110
-#define wxSpinCtrl_SetValue_1_0 2111
-#define wxSpinCtrl_GetValue 2113
-#define wxSpinCtrl_SetRange 2115
-#define wxSpinCtrl_SetSelection 2116
-#define wxSpinCtrl_GetMin 2118
-#define wxSpinCtrl_GetMax 2120
-#define wxSpinCtrl_destroy 2121
-#define wxStaticText_new_0 2122
-#define wxStaticText_new_4 2123
-#define wxStaticText_Create 2124
-#define wxStaticText_GetLabel 2125
-#define wxStaticText_SetLabel 2126
-#define wxStaticText_Wrap 2127
-#define wxStaticText_destroy 2128
-#define wxStaticBitmap_new_0 2129
-#define wxStaticBitmap_new_4 2130
-#define wxStaticBitmap_Create 2131
-#define wxStaticBitmap_GetBitmap 2132
-#define wxStaticBitmap_SetBitmap 2133
-#define wxStaticBitmap_destroy 2134
-#define wxRadioBox_new 2135
-#define wxRadioBox_destruct 2137
-#define wxRadioBox_Create 2138
-#define wxRadioBox_Enable_2 2139
-#define wxRadioBox_Enable_1 2140
-#define wxRadioBox_GetSelection 2141
-#define wxRadioBox_GetString 2142
-#define wxRadioBox_SetSelection 2143
-#define wxRadioBox_Show_2 2144
-#define wxRadioBox_Show_1 2145
-#define wxRadioBox_GetColumnCount 2146
-#define wxRadioBox_GetItemHelpText 2147
-#define wxRadioBox_GetItemToolTip 2148
-#define wxRadioBox_GetItemFromPoint 2150
-#define wxRadioBox_GetRowCount 2151
-#define wxRadioBox_IsItemEnabled 2152
-#define wxRadioBox_IsItemShown 2153
-#define wxRadioBox_SetItemHelpText 2154
-#define wxRadioBox_SetItemToolTip 2155
-#define wxRadioButton_new_0 2156
-#define wxRadioButton_new_4 2157
-#define wxRadioButton_Create 2158
-#define wxRadioButton_GetValue 2159
-#define wxRadioButton_SetValue 2160
-#define wxRadioButton_destroy 2161
-#define wxSlider_new_6 2163
-#define wxSlider_new_0 2164
-#define wxSlider_Create 2165
-#define wxSlider_GetLineSize 2166
-#define wxSlider_GetMax 2167
-#define wxSlider_GetMin 2168
-#define wxSlider_GetPageSize 2169
-#define wxSlider_GetThumbLength 2170
-#define wxSlider_GetValue 2171
-#define wxSlider_SetLineSize 2172
-#define wxSlider_SetPageSize 2173
-#define wxSlider_SetRange 2174
-#define wxSlider_SetThumbLength 2175
-#define wxSlider_SetValue 2176
-#define wxSlider_destroy 2177
-#define wxDialog_new_4 2179
-#define wxDialog_new_0 2180
-#define wxDialog_destruct 2182
-#define wxDialog_Create 2183
-#define wxDialog_CreateButtonSizer 2184
-#define wxDialog_CreateStdDialogButtonSizer 2185
-#define wxDialog_EndModal 2186
-#define wxDialog_GetAffirmativeId 2187
-#define wxDialog_GetReturnCode 2188
-#define wxDialog_IsModal 2189
-#define wxDialog_SetAffirmativeId 2190
-#define wxDialog_SetReturnCode 2191
-#define wxDialog_Show 2192
-#define wxDialog_ShowModal 2193
-#define wxColourDialog_new_0 2194
-#define wxColourDialog_new_2 2195
-#define wxColourDialog_destruct 2196
-#define wxColourDialog_Create 2197
-#define wxColourDialog_GetColourData 2198
-#define wxColourData_new_0 2199
-#define wxColourData_new_1 2200
-#define wxColourData_destruct 2201
-#define wxColourData_GetChooseFull 2202
-#define wxColourData_GetColour 2203
-#define wxColourData_GetCustomColour 2205
-#define wxColourData_SetChooseFull 2206
-#define wxColourData_SetColour 2207
-#define wxColourData_SetCustomColour 2208
-#define wxPalette_new_0 2209
-#define wxPalette_new_4 2210
-#define wxPalette_destruct 2212
-#define wxPalette_Create 2213
-#define wxPalette_GetColoursCount 2214
-#define wxPalette_GetPixel 2215
-#define wxPalette_GetRGB 2216
-#define wxPalette_IsOk 2217
-#define wxDirDialog_new 2221
-#define wxDirDialog_destruct 2222
-#define wxDirDialog_GetPath 2223
-#define wxDirDialog_GetMessage 2224
-#define wxDirDialog_SetMessage 2225
-#define wxDirDialog_SetPath 2226
-#define wxFileDialog_new 2230
-#define wxFileDialog_destruct 2231
-#define wxFileDialog_GetDirectory 2232
-#define wxFileDialog_GetFilename 2233
-#define wxFileDialog_GetFilenames 2234
-#define wxFileDialog_GetFilterIndex 2235
-#define wxFileDialog_GetMessage 2236
-#define wxFileDialog_GetPath 2237
-#define wxFileDialog_GetPaths 2238
-#define wxFileDialog_GetWildcard 2239
-#define wxFileDialog_SetDirectory 2240
-#define wxFileDialog_SetFilename 2241
-#define wxFileDialog_SetFilterIndex 2242
-#define wxFileDialog_SetMessage 2243
-#define wxFileDialog_SetPath 2244
-#define wxFileDialog_SetWildcard 2245
-#define wxPickerBase_SetInternalMargin 2246
-#define wxPickerBase_GetInternalMargin 2247
-#define wxPickerBase_SetTextCtrlProportion 2248
-#define wxPickerBase_SetPickerCtrlProportion 2249
-#define wxPickerBase_GetTextCtrlProportion 2250
-#define wxPickerBase_GetPickerCtrlProportion 2251
-#define wxPickerBase_HasTextCtrl 2252
-#define wxPickerBase_GetTextCtrl 2253
-#define wxPickerBase_IsTextCtrlGrowable 2254
-#define wxPickerBase_SetPickerCtrlGrowable 2255
-#define wxPickerBase_SetTextCtrlGrowable 2256
-#define wxPickerBase_IsPickerCtrlGrowable 2257
-#define wxFilePickerCtrl_new_0 2258
-#define wxFilePickerCtrl_new_3 2259
-#define wxFilePickerCtrl_Create 2260
-#define wxFilePickerCtrl_GetPath 2261
-#define wxFilePickerCtrl_SetPath 2262
-#define wxFilePickerCtrl_destroy 2263
-#define wxDirPickerCtrl_new_0 2264
-#define wxDirPickerCtrl_new_3 2265
-#define wxDirPickerCtrl_Create 2266
-#define wxDirPickerCtrl_GetPath 2267
-#define wxDirPickerCtrl_SetPath 2268
-#define wxDirPickerCtrl_destroy 2269
-#define wxColourPickerCtrl_new_0 2270
-#define wxColourPickerCtrl_new_3 2271
-#define wxColourPickerCtrl_Create 2272
-#define wxColourPickerCtrl_GetColour 2273
-#define wxColourPickerCtrl_SetColour_1_1 2274
-#define wxColourPickerCtrl_SetColour_1_0 2275
-#define wxColourPickerCtrl_destroy 2276
-#define wxDatePickerCtrl_new_0 2277
-#define wxDatePickerCtrl_new_3 2278
-#define wxDatePickerCtrl_GetRange 2279
-#define wxDatePickerCtrl_GetValue 2280
-#define wxDatePickerCtrl_SetRange 2281
-#define wxDatePickerCtrl_SetValue 2282
-#define wxDatePickerCtrl_destroy 2283
-#define wxFontPickerCtrl_new_0 2284
-#define wxFontPickerCtrl_new_3 2285
-#define wxFontPickerCtrl_Create 2286
-#define wxFontPickerCtrl_GetSelectedFont 2287
-#define wxFontPickerCtrl_SetSelectedFont 2288
-#define wxFontPickerCtrl_GetMaxPointSize 2289
-#define wxFontPickerCtrl_SetMaxPointSize 2290
-#define wxFontPickerCtrl_destroy 2291
-#define wxFindReplaceDialog_new_0 2294
-#define wxFindReplaceDialog_new_4 2295
-#define wxFindReplaceDialog_destruct 2296
-#define wxFindReplaceDialog_Create 2297
-#define wxFindReplaceDialog_GetData 2298
-#define wxFindReplaceData_new_0 2299
-#define wxFindReplaceData_new_1 2300
-#define wxFindReplaceData_GetFindString 2301
-#define wxFindReplaceData_GetReplaceString 2302
-#define wxFindReplaceData_GetFlags 2303
-#define wxFindReplaceData_SetFlags 2304
-#define wxFindReplaceData_SetFindString 2305
-#define wxFindReplaceData_SetReplaceString 2306
-#define wxFindReplaceData_destroy 2307
-#define wxMultiChoiceDialog_new_0 2308
-#define wxMultiChoiceDialog_new_5 2310
-#define wxMultiChoiceDialog_GetSelections 2311
-#define wxMultiChoiceDialog_SetSelections 2312
-#define wxMultiChoiceDialog_destroy 2313
-#define wxSingleChoiceDialog_new_0 2314
-#define wxSingleChoiceDialog_new_5 2316
-#define wxSingleChoiceDialog_GetSelection 2317
-#define wxSingleChoiceDialog_GetStringSelection 2318
-#define wxSingleChoiceDialog_SetSelection 2319
-#define wxSingleChoiceDialog_destroy 2320
-#define wxTextEntryDialog_new 2321
-#define wxTextEntryDialog_GetValue 2322
-#define wxTextEntryDialog_SetValue 2323
-#define wxTextEntryDialog_destroy 2324
-#define wxPasswordEntryDialog_new 2325
-#define wxPasswordEntryDialog_destroy 2326
-#define wxFontData_new_0 2327
-#define wxFontData_new_1 2328
-#define wxFontData_destruct 2329
-#define wxFontData_EnableEffects 2330
-#define wxFontData_GetAllowSymbols 2331
-#define wxFontData_GetColour 2332
-#define wxFontData_GetChosenFont 2333
-#define wxFontData_GetEnableEffects 2334
-#define wxFontData_GetInitialFont 2335
-#define wxFontData_GetShowHelp 2336
-#define wxFontData_SetAllowSymbols 2337
-#define wxFontData_SetChosenFont 2338
-#define wxFontData_SetColour 2339
-#define wxFontData_SetInitialFont 2340
-#define wxFontData_SetRange 2341
-#define wxFontData_SetShowHelp 2342
-#define wxFontDialog_new_0 2346
-#define wxFontDialog_new_2 2348
-#define wxFontDialog_Create 2350
-#define wxFontDialog_GetFontData 2351
-#define wxFontDialog_destroy 2353
-#define wxProgressDialog_new 2354
-#define wxProgressDialog_destruct 2355
-#define wxProgressDialog_Resume 2356
-#define wxProgressDialog_Update_2 2357
-#define wxProgressDialog_Update_0 2358
-#define wxMessageDialog_new 2359
-#define wxMessageDialog_destruct 2360
-#define wxPageSetupDialog_new 2361
-#define wxPageSetupDialog_destruct 2362
-#define wxPageSetupDialog_GetPageSetupData 2363
-#define wxPageSetupDialog_ShowModal 2364
-#define wxPageSetupDialogData_new_0 2365
-#define wxPageSetupDialogData_new_1_0 2366
-#define wxPageSetupDialogData_new_1_1 2367
-#define wxPageSetupDialogData_destruct 2368
-#define wxPageSetupDialogData_EnableHelp 2369
-#define wxPageSetupDialogData_EnableMargins 2370
-#define wxPageSetupDialogData_EnableOrientation 2371
-#define wxPageSetupDialogData_EnablePaper 2372
-#define wxPageSetupDialogData_EnablePrinter 2373
-#define wxPageSetupDialogData_GetDefaultMinMargins 2374
-#define wxPageSetupDialogData_GetEnableMargins 2375
-#define wxPageSetupDialogData_GetEnableOrientation 2376
-#define wxPageSetupDialogData_GetEnablePaper 2377
-#define wxPageSetupDialogData_GetEnablePrinter 2378
-#define wxPageSetupDialogData_GetEnableHelp 2379
-#define wxPageSetupDialogData_GetDefaultInfo 2380
-#define wxPageSetupDialogData_GetMarginTopLeft 2381
-#define wxPageSetupDialogData_GetMarginBottomRight 2382
-#define wxPageSetupDialogData_GetMinMarginTopLeft 2383
-#define wxPageSetupDialogData_GetMinMarginBottomRight 2384
-#define wxPageSetupDialogData_GetPaperId 2385
-#define wxPageSetupDialogData_GetPaperSize 2386
-#define wxPageSetupDialogData_GetPrintData 2388
-#define wxPageSetupDialogData_IsOk 2389
-#define wxPageSetupDialogData_SetDefaultInfo 2390
-#define wxPageSetupDialogData_SetDefaultMinMargins 2391
-#define wxPageSetupDialogData_SetMarginTopLeft 2392
-#define wxPageSetupDialogData_SetMarginBottomRight 2393
-#define wxPageSetupDialogData_SetMinMarginTopLeft 2394
-#define wxPageSetupDialogData_SetMinMarginBottomRight 2395
-#define wxPageSetupDialogData_SetPaperId 2396
-#define wxPageSetupDialogData_SetPaperSize_1_1 2397
-#define wxPageSetupDialogData_SetPaperSize_1_0 2398
-#define wxPageSetupDialogData_SetPrintData 2399
-#define wxPrintDialog_new_2_0 2400
-#define wxPrintDialog_new_2_1 2401
-#define wxPrintDialog_destruct 2402
-#define wxPrintDialog_GetPrintDialogData 2403
-#define wxPrintDialog_GetPrintDC 2404
-#define wxPrintDialogData_new_0 2405
-#define wxPrintDialogData_new_1_1 2406
-#define wxPrintDialogData_new_1_0 2407
-#define wxPrintDialogData_destruct 2408
-#define wxPrintDialogData_EnableHelp 2409
-#define wxPrintDialogData_EnablePageNumbers 2410
-#define wxPrintDialogData_EnablePrintToFile 2411
-#define wxPrintDialogData_EnableSelection 2412
-#define wxPrintDialogData_GetAllPages 2413
-#define wxPrintDialogData_GetCollate 2414
-#define wxPrintDialogData_GetFromPage 2415
-#define wxPrintDialogData_GetMaxPage 2416
-#define wxPrintDialogData_GetMinPage 2417
-#define wxPrintDialogData_GetNoCopies 2418
-#define wxPrintDialogData_GetPrintData 2419
-#define wxPrintDialogData_GetPrintToFile 2420
-#define wxPrintDialogData_GetSelection 2421
-#define wxPrintDialogData_GetToPage 2422
-#define wxPrintDialogData_IsOk 2423
-#define wxPrintDialogData_SetCollate 2424
-#define wxPrintDialogData_SetFromPage 2425
-#define wxPrintDialogData_SetMaxPage 2426
-#define wxPrintDialogData_SetMinPage 2427
-#define wxPrintDialogData_SetNoCopies 2428
-#define wxPrintDialogData_SetPrintData 2429
-#define wxPrintDialogData_SetPrintToFile 2430
-#define wxPrintDialogData_SetSelection 2431
-#define wxPrintDialogData_SetToPage 2432
-#define wxPrintData_new_0 2433
-#define wxPrintData_new_1 2434
-#define wxPrintData_destruct 2435
-#define wxPrintData_GetCollate 2436
-#define wxPrintData_GetBin 2437
-#define wxPrintData_GetColour 2438
-#define wxPrintData_GetDuplex 2439
-#define wxPrintData_GetNoCopies 2440
-#define wxPrintData_GetOrientation 2441
-#define wxPrintData_GetPaperId 2442
-#define wxPrintData_GetPrinterName 2443
-#define wxPrintData_GetQuality 2444
-#define wxPrintData_IsOk 2445
-#define wxPrintData_SetBin 2446
-#define wxPrintData_SetCollate 2447
-#define wxPrintData_SetColour 2448
-#define wxPrintData_SetDuplex 2449
-#define wxPrintData_SetNoCopies 2450
-#define wxPrintData_SetOrientation 2451
-#define wxPrintData_SetPaperId 2452
-#define wxPrintData_SetPrinterName 2453
-#define wxPrintData_SetQuality 2454
-#define wxPrintPreview_new_2 2457
-#define wxPrintPreview_new_3 2458
-#define wxPrintPreview_destruct 2460
-#define wxPrintPreview_GetCanvas 2461
-#define wxPrintPreview_GetCurrentPage 2462
-#define wxPrintPreview_GetFrame 2463
-#define wxPrintPreview_GetMaxPage 2464
-#define wxPrintPreview_GetMinPage 2465
-#define wxPrintPreview_GetPrintout 2466
-#define wxPrintPreview_GetPrintoutForPrinting 2467
-#define wxPrintPreview_IsOk 2468
-#define wxPrintPreview_PaintPage 2469
-#define wxPrintPreview_Print 2470
-#define wxPrintPreview_RenderPage 2471
-#define wxPrintPreview_SetCanvas 2472
-#define wxPrintPreview_SetCurrentPage 2473
-#define wxPrintPreview_SetFrame 2474
-#define wxPrintPreview_SetPrintout 2475
-#define wxPrintPreview_SetZoom 2476
-#define wxPreviewFrame_new 2477
-#define wxPreviewFrame_destruct 2478
-#define wxPreviewFrame_CreateControlBar 2479
-#define wxPreviewFrame_CreateCanvas 2480
-#define wxPreviewFrame_Initialize 2481
-#define wxPreviewFrame_OnCloseWindow 2482
-#define wxPreviewControlBar_new 2483
-#define wxPreviewControlBar_destruct 2484
-#define wxPreviewControlBar_CreateButtons 2485
-#define wxPreviewControlBar_GetPrintPreview 2486
-#define wxPreviewControlBar_GetZoomControl 2487
-#define wxPreviewControlBar_SetZoomControl 2488
-#define wxPrinter_new 2490
-#define wxPrinter_CreateAbortWindow 2491
-#define wxPrinter_GetAbort 2492
-#define wxPrinter_GetLastError 2493
-#define wxPrinter_GetPrintDialogData 2494
-#define wxPrinter_Print 2495
-#define wxPrinter_PrintDialog 2496
-#define wxPrinter_ReportError 2497
-#define wxPrinter_Setup 2498
-#define wxPrinter_destroy 2499
-#define wxXmlResource_new_1 2500
-#define wxXmlResource_new_2 2501
-#define wxXmlResource_destruct 2502
-#define wxXmlResource_AttachUnknownControl 2503
-#define wxXmlResource_ClearHandlers 2504
-#define wxXmlResource_CompareVersion 2505
-#define wxXmlResource_Get 2506
-#define wxXmlResource_GetFlags 2507
-#define wxXmlResource_GetVersion 2508
-#define wxXmlResource_GetXRCID 2509
-#define wxXmlResource_InitAllHandlers 2510
-#define wxXmlResource_Load 2511
-#define wxXmlResource_LoadBitmap 2512
-#define wxXmlResource_LoadDialog_2 2513
-#define wxXmlResource_LoadDialog_3 2514
-#define wxXmlResource_LoadFrame_2 2515
-#define wxXmlResource_LoadFrame_3 2516
-#define wxXmlResource_LoadIcon 2517
-#define wxXmlResource_LoadMenu 2518
-#define wxXmlResource_LoadMenuBar_2 2519
-#define wxXmlResource_LoadMenuBar_1 2520
-#define wxXmlResource_LoadPanel_2 2521
-#define wxXmlResource_LoadPanel_3 2522
-#define wxXmlResource_LoadToolBar 2523
-#define wxXmlResource_Set 2524
-#define wxXmlResource_SetFlags 2525
-#define wxXmlResource_Unload 2526
-#define wxXmlResource_xrcctrl 2527
-#define wxHtmlEasyPrinting_new 2528
-#define wxHtmlEasyPrinting_destruct 2529
-#define wxHtmlEasyPrinting_GetPrintData 2530
-#define wxHtmlEasyPrinting_GetPageSetupData 2531
-#define wxHtmlEasyPrinting_PreviewFile 2532
-#define wxHtmlEasyPrinting_PreviewText 2533
-#define wxHtmlEasyPrinting_PrintFile 2534
-#define wxHtmlEasyPrinting_PrintText 2535
-#define wxHtmlEasyPrinting_PageSetup 2536
-#define wxHtmlEasyPrinting_SetFonts 2537
-#define wxHtmlEasyPrinting_SetHeader 2538
-#define wxHtmlEasyPrinting_SetFooter 2539
-#define wxGLCanvas_new_2 2541
-#define wxGLCanvas_new_3_1 2542
-#define wxGLCanvas_new_3_0 2543
-#define wxGLCanvas_GetContext 2544
-#define wxGLCanvas_SetCurrent 2546
-#define wxGLCanvas_SwapBuffers 2547
-#define wxGLCanvas_destroy 2548
-#define wxAuiManager_new 2549
-#define wxAuiManager_destruct 2550
-#define wxAuiManager_AddPane_2_1 2551
-#define wxAuiManager_AddPane_3 2552
-#define wxAuiManager_AddPane_2_0 2553
-#define wxAuiManager_DetachPane 2554
-#define wxAuiManager_GetAllPanes 2555
-#define wxAuiManager_GetArtProvider 2556
-#define wxAuiManager_GetDockSizeConstraint 2557
-#define wxAuiManager_GetFlags 2558
-#define wxAuiManager_GetManagedWindow 2559
-#define wxAuiManager_GetManager 2560
-#define wxAuiManager_GetPane_1_1 2561
-#define wxAuiManager_GetPane_1_0 2562
-#define wxAuiManager_HideHint 2563
-#define wxAuiManager_InsertPane 2564
-#define wxAuiManager_LoadPaneInfo 2565
-#define wxAuiManager_LoadPerspective 2566
-#define wxAuiManager_SavePaneInfo 2567
-#define wxAuiManager_SavePerspective 2568
-#define wxAuiManager_SetArtProvider 2569
-#define wxAuiManager_SetDockSizeConstraint 2570
-#define wxAuiManager_SetFlags 2571
-#define wxAuiManager_SetManagedWindow 2572
-#define wxAuiManager_ShowHint 2573
-#define wxAuiManager_UnInit 2574
-#define wxAuiManager_Update 2575
-#define wxAuiPaneInfo_new_0 2576
-#define wxAuiPaneInfo_new_1 2577
-#define wxAuiPaneInfo_destruct 2578
-#define wxAuiPaneInfo_BestSize_1 2579
-#define wxAuiPaneInfo_BestSize_2 2580
-#define wxAuiPaneInfo_Bottom 2581
-#define wxAuiPaneInfo_BottomDockable 2582
-#define wxAuiPaneInfo_Caption 2583
-#define wxAuiPaneInfo_CaptionVisible 2584
-#define wxAuiPaneInfo_Centre 2585
-#define wxAuiPaneInfo_CentrePane 2586
-#define wxAuiPaneInfo_CloseButton 2587
-#define wxAuiPaneInfo_DefaultPane 2588
-#define wxAuiPaneInfo_DestroyOnClose 2589
-#define wxAuiPaneInfo_Direction 2590
-#define wxAuiPaneInfo_Dock 2591
-#define wxAuiPaneInfo_Dockable 2592
-#define wxAuiPaneInfo_Fixed 2593
-#define wxAuiPaneInfo_Float 2594
-#define wxAuiPaneInfo_Floatable 2595
-#define wxAuiPaneInfo_FloatingPosition_1 2596
-#define wxAuiPaneInfo_FloatingPosition_2 2597
-#define wxAuiPaneInfo_FloatingSize_1 2598
-#define wxAuiPaneInfo_FloatingSize_2 2599
-#define wxAuiPaneInfo_Gripper 2600
-#define wxAuiPaneInfo_GripperTop 2601
-#define wxAuiPaneInfo_HasBorder 2602
-#define wxAuiPaneInfo_HasCaption 2603
-#define wxAuiPaneInfo_HasCloseButton 2604
-#define wxAuiPaneInfo_HasFlag 2605
-#define wxAuiPaneInfo_HasGripper 2606
-#define wxAuiPaneInfo_HasGripperTop 2607
-#define wxAuiPaneInfo_HasMaximizeButton 2608
-#define wxAuiPaneInfo_HasMinimizeButton 2609
-#define wxAuiPaneInfo_HasPinButton 2610
-#define wxAuiPaneInfo_Hide 2611
-#define wxAuiPaneInfo_IsBottomDockable 2612
-#define wxAuiPaneInfo_IsDocked 2613
-#define wxAuiPaneInfo_IsFixed 2614
-#define wxAuiPaneInfo_IsFloatable 2615
-#define wxAuiPaneInfo_IsFloating 2616
-#define wxAuiPaneInfo_IsLeftDockable 2617
-#define wxAuiPaneInfo_IsMovable 2618
-#define wxAuiPaneInfo_IsOk 2619
-#define wxAuiPaneInfo_IsResizable 2620
-#define wxAuiPaneInfo_IsRightDockable 2621
-#define wxAuiPaneInfo_IsShown 2622
-#define wxAuiPaneInfo_IsToolbar 2623
-#define wxAuiPaneInfo_IsTopDockable 2624
-#define wxAuiPaneInfo_Layer 2625
-#define wxAuiPaneInfo_Left 2626
-#define wxAuiPaneInfo_LeftDockable 2627
-#define wxAuiPaneInfo_MaxSize_1 2628
-#define wxAuiPaneInfo_MaxSize_2 2629
-#define wxAuiPaneInfo_MaximizeButton 2630
-#define wxAuiPaneInfo_MinSize_1 2631
-#define wxAuiPaneInfo_MinSize_2 2632
-#define wxAuiPaneInfo_MinimizeButton 2633
-#define wxAuiPaneInfo_Movable 2634
-#define wxAuiPaneInfo_Name 2635
-#define wxAuiPaneInfo_PaneBorder 2636
-#define wxAuiPaneInfo_PinButton 2637
-#define wxAuiPaneInfo_Position 2638
-#define wxAuiPaneInfo_Resizable 2639
-#define wxAuiPaneInfo_Right 2640
-#define wxAuiPaneInfo_RightDockable 2641
-#define wxAuiPaneInfo_Row 2642
-#define wxAuiPaneInfo_SafeSet 2643
-#define wxAuiPaneInfo_SetFlag 2644
-#define wxAuiPaneInfo_Show 2645
-#define wxAuiPaneInfo_ToolbarPane 2646
-#define wxAuiPaneInfo_Top 2647
-#define wxAuiPaneInfo_TopDockable 2648
-#define wxAuiPaneInfo_Window 2649
-#define wxAuiNotebook_new_0 2650
-#define wxAuiNotebook_new_2 2651
-#define wxAuiNotebook_AddPage 2652
-#define wxAuiNotebook_Create 2653
-#define wxAuiNotebook_DeletePage 2654
-#define wxAuiNotebook_GetArtProvider 2655
-#define wxAuiNotebook_GetPage 2656
-#define wxAuiNotebook_GetPageBitmap 2657
-#define wxAuiNotebook_GetPageCount 2658
-#define wxAuiNotebook_GetPageIndex 2659
-#define wxAuiNotebook_GetPageText 2660
-#define wxAuiNotebook_GetSelection 2661
-#define wxAuiNotebook_InsertPage 2662
-#define wxAuiNotebook_RemovePage 2663
-#define wxAuiNotebook_SetArtProvider 2664
-#define wxAuiNotebook_SetFont 2665
-#define wxAuiNotebook_SetPageBitmap 2666
-#define wxAuiNotebook_SetPageText 2667
-#define wxAuiNotebook_SetSelection 2668
-#define wxAuiNotebook_SetTabCtrlHeight 2669
-#define wxAuiNotebook_SetUniformBitmapSize 2670
-#define wxAuiNotebook_destroy 2671
-#define wxMDIParentFrame_new_0 2672
-#define wxMDIParentFrame_new_4 2673
-#define wxMDIParentFrame_destruct 2674
-#define wxMDIParentFrame_ActivateNext 2675
-#define wxMDIParentFrame_ActivatePrevious 2676
-#define wxMDIParentFrame_ArrangeIcons 2677
-#define wxMDIParentFrame_Cascade 2678
-#define wxMDIParentFrame_Create 2679
-#define wxMDIParentFrame_GetActiveChild 2680
-#define wxMDIParentFrame_GetClientWindow 2681
-#define wxMDIParentFrame_Tile 2682
-#define wxMDIChildFrame_new_0 2683
-#define wxMDIChildFrame_new_4 2684
-#define wxMDIChildFrame_destruct 2685
-#define wxMDIChildFrame_Activate 2686
-#define wxMDIChildFrame_Create 2687
-#define wxMDIChildFrame_Maximize 2688
-#define wxMDIChildFrame_Restore 2689
-#define wxMDIClientWindow_new_0 2690
-#define wxMDIClientWindow_new_2 2691
-#define wxMDIClientWindow_destruct 2692
-#define wxMDIClientWindow_CreateClient 2693
-#define wxLayoutAlgorithm_new 2694
-#define wxLayoutAlgorithm_LayoutFrame 2695
-#define wxLayoutAlgorithm_LayoutMDIFrame 2696
-#define wxLayoutAlgorithm_LayoutWindow 2697
-#define wxLayoutAlgorithm_destroy 2698
-#define wxEvent_GetId 2699
-#define wxEvent_GetSkipped 2700
-#define wxEvent_GetTimestamp 2701
-#define wxEvent_IsCommandEvent 2702
-#define wxEvent_ResumePropagation 2703
-#define wxEvent_ShouldPropagate 2704
-#define wxEvent_Skip 2705
-#define wxEvent_StopPropagation 2706
-#define wxCommandEvent_getClientData 2707
-#define wxCommandEvent_GetExtraLong 2708
-#define wxCommandEvent_GetInt 2709
-#define wxCommandEvent_GetSelection 2710
-#define wxCommandEvent_GetString 2711
-#define wxCommandEvent_IsChecked 2712
-#define wxCommandEvent_IsSelection 2713
-#define wxCommandEvent_SetInt 2714
-#define wxCommandEvent_SetString 2715
-#define wxScrollEvent_GetOrientation 2716
-#define wxScrollEvent_GetPosition 2717
-#define wxScrollWinEvent_GetOrientation 2718
-#define wxScrollWinEvent_GetPosition 2719
-#define wxMouseEvent_AltDown 2720
-#define wxMouseEvent_Button 2721
-#define wxMouseEvent_ButtonDClick 2722
-#define wxMouseEvent_ButtonDown 2723
-#define wxMouseEvent_ButtonUp 2724
-#define wxMouseEvent_CmdDown 2725
-#define wxMouseEvent_ControlDown 2726
-#define wxMouseEvent_Dragging 2727
-#define wxMouseEvent_Entering 2728
-#define wxMouseEvent_GetButton 2729
-#define wxMouseEvent_GetPosition 2732
-#define wxMouseEvent_GetLogicalPosition 2733
-#define wxMouseEvent_GetLinesPerAction 2734
-#define wxMouseEvent_GetWheelRotation 2735
-#define wxMouseEvent_GetWheelDelta 2736
-#define wxMouseEvent_GetX 2737
-#define wxMouseEvent_GetY 2738
-#define wxMouseEvent_IsButton 2739
-#define wxMouseEvent_IsPageScroll 2740
-#define wxMouseEvent_Leaving 2741
-#define wxMouseEvent_LeftDClick 2742
-#define wxMouseEvent_LeftDown 2743
-#define wxMouseEvent_LeftIsDown 2744
-#define wxMouseEvent_LeftUp 2745
-#define wxMouseEvent_MetaDown 2746
-#define wxMouseEvent_MiddleDClick 2747
-#define wxMouseEvent_MiddleDown 2748
-#define wxMouseEvent_MiddleIsDown 2749
-#define wxMouseEvent_MiddleUp 2750
-#define wxMouseEvent_Moving 2751
-#define wxMouseEvent_RightDClick 2752
-#define wxMouseEvent_RightDown 2753
-#define wxMouseEvent_RightIsDown 2754
-#define wxMouseEvent_RightUp 2755
-#define wxMouseEvent_ShiftDown 2756
-#define wxSetCursorEvent_GetCursor 2757
-#define wxSetCursorEvent_GetX 2758
-#define wxSetCursorEvent_GetY 2759
-#define wxSetCursorEvent_HasCursor 2760
-#define wxSetCursorEvent_SetCursor 2761
-#define wxKeyEvent_AltDown 2762
-#define wxKeyEvent_CmdDown 2763
-#define wxKeyEvent_ControlDown 2764
-#define wxKeyEvent_GetKeyCode 2765
-#define wxKeyEvent_GetModifiers 2766
-#define wxKeyEvent_GetPosition 2769
-#define wxKeyEvent_GetRawKeyCode 2770
-#define wxKeyEvent_GetRawKeyFlags 2771
-#define wxKeyEvent_GetUnicodeKey 2772
-#define wxKeyEvent_GetX 2773
-#define wxKeyEvent_GetY 2774
-#define wxKeyEvent_HasModifiers 2775
-#define wxKeyEvent_MetaDown 2776
-#define wxKeyEvent_ShiftDown 2777
-#define wxSizeEvent_GetSize 2778
-#define wxMoveEvent_GetPosition 2779
-#define wxEraseEvent_GetDC 2780
-#define wxFocusEvent_GetWindow 2781
-#define wxChildFocusEvent_GetWindow 2782
-#define wxMenuEvent_GetMenu 2783
-#define wxMenuEvent_GetMenuId 2784
-#define wxMenuEvent_IsPopup 2785
-#define wxCloseEvent_CanVeto 2786
-#define wxCloseEvent_GetLoggingOff 2787
-#define wxCloseEvent_SetCanVeto 2788
-#define wxCloseEvent_SetLoggingOff 2789
-#define wxCloseEvent_Veto 2790
-#define wxShowEvent_SetShow 2791
-#define wxShowEvent_GetShow 2792
-#define wxIconizeEvent_Iconized 2793
-#define wxJoystickEvent_ButtonDown 2794
-#define wxJoystickEvent_ButtonIsDown 2795
-#define wxJoystickEvent_ButtonUp 2796
-#define wxJoystickEvent_GetButtonChange 2797
-#define wxJoystickEvent_GetButtonState 2798
-#define wxJoystickEvent_GetJoystick 2799
-#define wxJoystickEvent_GetPosition 2800
-#define wxJoystickEvent_GetZPosition 2801
-#define wxJoystickEvent_IsButton 2802
-#define wxJoystickEvent_IsMove 2803
-#define wxJoystickEvent_IsZMove 2804
-#define wxUpdateUIEvent_CanUpdate 2805
-#define wxUpdateUIEvent_Check 2806
-#define wxUpdateUIEvent_Enable 2807
-#define wxUpdateUIEvent_Show 2808
-#define wxUpdateUIEvent_GetChecked 2809
-#define wxUpdateUIEvent_GetEnabled 2810
-#define wxUpdateUIEvent_GetShown 2811
-#define wxUpdateUIEvent_GetSetChecked 2812
-#define wxUpdateUIEvent_GetSetEnabled 2813
-#define wxUpdateUIEvent_GetSetShown 2814
-#define wxUpdateUIEvent_GetSetText 2815
-#define wxUpdateUIEvent_GetText 2816
-#define wxUpdateUIEvent_GetMode 2817
-#define wxUpdateUIEvent_GetUpdateInterval 2818
-#define wxUpdateUIEvent_ResetUpdateTime 2819
-#define wxUpdateUIEvent_SetMode 2820
-#define wxUpdateUIEvent_SetText 2821
-#define wxUpdateUIEvent_SetUpdateInterval 2822
-#define wxMouseCaptureChangedEvent_GetCapturedWindow 2823
-#define wxPaletteChangedEvent_SetChangedWindow 2824
-#define wxPaletteChangedEvent_GetChangedWindow 2825
-#define wxQueryNewPaletteEvent_SetPaletteRealized 2826
-#define wxQueryNewPaletteEvent_GetPaletteRealized 2827
-#define wxNavigationKeyEvent_GetDirection 2828
-#define wxNavigationKeyEvent_SetDirection 2829
-#define wxNavigationKeyEvent_IsWindowChange 2830
-#define wxNavigationKeyEvent_SetWindowChange 2831
-#define wxNavigationKeyEvent_IsFromTab 2832
-#define wxNavigationKeyEvent_SetFromTab 2833
-#define wxNavigationKeyEvent_GetCurrentFocus 2834
-#define wxNavigationKeyEvent_SetCurrentFocus 2835
-#define wxHelpEvent_GetOrigin 2836
-#define wxHelpEvent_GetPosition 2837
-#define wxHelpEvent_SetOrigin 2838
-#define wxHelpEvent_SetPosition 2839
-#define wxContextMenuEvent_GetPosition 2840
-#define wxContextMenuEvent_SetPosition 2841
-#define wxIdleEvent_CanSend 2842
-#define wxIdleEvent_GetMode 2843
-#define wxIdleEvent_RequestMore 2844
-#define wxIdleEvent_MoreRequested 2845
-#define wxIdleEvent_SetMode 2846
-#define wxGridEvent_AltDown 2847
-#define wxGridEvent_ControlDown 2848
-#define wxGridEvent_GetCol 2849
-#define wxGridEvent_GetPosition 2850
-#define wxGridEvent_GetRow 2851
-#define wxGridEvent_MetaDown 2852
-#define wxGridEvent_Selecting 2853
-#define wxGridEvent_ShiftDown 2854
-#define wxNotifyEvent_Allow 2855
-#define wxNotifyEvent_IsAllowed 2856
-#define wxNotifyEvent_Veto 2857
-#define wxSashEvent_GetEdge 2858
-#define wxSashEvent_GetDragRect 2859
-#define wxSashEvent_GetDragStatus 2860
-#define wxListEvent_GetCacheFrom 2861
-#define wxListEvent_GetCacheTo 2862
-#define wxListEvent_GetKeyCode 2863
-#define wxListEvent_GetIndex 2864
-#define wxListEvent_GetColumn 2865
-#define wxListEvent_GetPoint 2866
-#define wxListEvent_GetLabel 2867
-#define wxListEvent_GetText 2868
-#define wxListEvent_GetImage 2869
-#define wxListEvent_GetData 2870
-#define wxListEvent_GetMask 2871
-#define wxListEvent_GetItem 2872
-#define wxListEvent_IsEditCancelled 2873
-#define wxDateEvent_GetDate 2874
-#define wxCalendarEvent_GetWeekDay 2875
-#define wxFileDirPickerEvent_GetPath 2876
-#define wxColourPickerEvent_GetColour 2877
-#define wxFontPickerEvent_GetFont 2878
-#define wxStyledTextEvent_GetPosition 2879
-#define wxStyledTextEvent_GetKey 2880
-#define wxStyledTextEvent_GetModifiers 2881
-#define wxStyledTextEvent_GetModificationType 2882
-#define wxStyledTextEvent_GetText 2883
-#define wxStyledTextEvent_GetLength 2884
-#define wxStyledTextEvent_GetLinesAdded 2885
-#define wxStyledTextEvent_GetLine 2886
-#define wxStyledTextEvent_GetFoldLevelNow 2887
-#define wxStyledTextEvent_GetFoldLevelPrev 2888
-#define wxStyledTextEvent_GetMargin 2889
-#define wxStyledTextEvent_GetMessage 2890
-#define wxStyledTextEvent_GetWParam 2891
-#define wxStyledTextEvent_GetLParam 2892
-#define wxStyledTextEvent_GetListType 2893
-#define wxStyledTextEvent_GetX 2894
-#define wxStyledTextEvent_GetY 2895
-#define wxStyledTextEvent_GetDragText 2896
-#define wxStyledTextEvent_GetDragAllowMove 2897
-#define wxStyledTextEvent_GetDragResult 2898
-#define wxStyledTextEvent_GetShift 2899
-#define wxStyledTextEvent_GetControl 2900
-#define wxStyledTextEvent_GetAlt 2901
-#define utils_wxGetKeyState 2902
-#define utils_wxGetMousePosition 2903
-#define utils_wxGetMouseState 2904
-#define utils_wxSetDetectableAutoRepeat 2905
-#define utils_wxBell 2906
-#define utils_wxFindMenuItemId 2907
-#define utils_wxGenericFindWindowAtPoint 2908
-#define utils_wxFindWindowAtPoint 2909
-#define utils_wxBeginBusyCursor 2910
-#define utils_wxEndBusyCursor 2911
-#define utils_wxIsBusy 2912
-#define utils_wxShutdown 2913
-#define utils_wxShell 2914
-#define utils_wxLaunchDefaultBrowser 2915
-#define utils_wxGetEmailAddress 2916
-#define utils_wxGetUserId 2917
-#define utils_wxGetHomeDir 2918
-#define utils_wxNewId 2919
-#define utils_wxRegisterId 2920
-#define utils_wxGetCurrentId 2921
-#define utils_wxGetOsDescription 2922
-#define utils_wxIsPlatformLittleEndian 2923
-#define utils_wxIsPlatform64Bit 2924
-#define wxPrintout_new 2925
-#define wxPrintout_destruct 2926
-#define wxPrintout_GetDC 2927
-#define wxPrintout_GetPageSizeMM 2928
-#define wxPrintout_GetPageSizePixels 2929
-#define wxPrintout_GetPaperRectPixels 2930
-#define wxPrintout_GetPPIPrinter 2931
-#define wxPrintout_GetPPIScreen 2932
-#define wxPrintout_GetTitle 2933
-#define wxPrintout_IsPreview 2934
-#define wxPrintout_FitThisSizeToPaper 2935
-#define wxPrintout_FitThisSizeToPage 2936
-#define wxPrintout_FitThisSizeToPageMargins 2937
-#define wxPrintout_MapScreenSizeToPaper 2938
-#define wxPrintout_MapScreenSizeToPage 2939
-#define wxPrintout_MapScreenSizeToPageMargins 2940
-#define wxPrintout_MapScreenSizeToDevice 2941
-#define wxPrintout_GetLogicalPaperRect 2942
-#define wxPrintout_GetLogicalPageRect 2943
-#define wxPrintout_GetLogicalPageMarginsRect 2944
-#define wxPrintout_SetLogicalOrigin 2945
-#define wxPrintout_OffsetLogicalOrigin 2946
-#define wxStyledTextCtrl_new_2 2947
-#define wxStyledTextCtrl_new_0 2948
-#define wxStyledTextCtrl_destruct 2949
-#define wxStyledTextCtrl_Create 2950
-#define wxStyledTextCtrl_AddText 2951
-#define wxStyledTextCtrl_AddStyledText 2952
-#define wxStyledTextCtrl_InsertText 2953
-#define wxStyledTextCtrl_ClearAll 2954
-#define wxStyledTextCtrl_ClearDocumentStyle 2955
-#define wxStyledTextCtrl_GetLength 2956
-#define wxStyledTextCtrl_GetCharAt 2957
-#define wxStyledTextCtrl_GetCurrentPos 2958
-#define wxStyledTextCtrl_GetAnchor 2959
-#define wxStyledTextCtrl_GetStyleAt 2960
-#define wxStyledTextCtrl_Redo 2961
-#define wxStyledTextCtrl_SetUndoCollection 2962
-#define wxStyledTextCtrl_SelectAll 2963
-#define wxStyledTextCtrl_SetSavePoint 2964
-#define wxStyledTextCtrl_GetStyledText 2965
-#define wxStyledTextCtrl_CanRedo 2966
-#define wxStyledTextCtrl_MarkerLineFromHandle 2967
-#define wxStyledTextCtrl_MarkerDeleteHandle 2968
-#define wxStyledTextCtrl_GetUndoCollection 2969
-#define wxStyledTextCtrl_GetViewWhiteSpace 2970
-#define wxStyledTextCtrl_SetViewWhiteSpace 2971
-#define wxStyledTextCtrl_PositionFromPoint 2972
-#define wxStyledTextCtrl_PositionFromPointClose 2973
-#define wxStyledTextCtrl_GotoLine 2974
-#define wxStyledTextCtrl_GotoPos 2975
-#define wxStyledTextCtrl_SetAnchor 2976
-#define wxStyledTextCtrl_GetCurLine 2977
-#define wxStyledTextCtrl_GetEndStyled 2978
-#define wxStyledTextCtrl_ConvertEOLs 2979
-#define wxStyledTextCtrl_GetEOLMode 2980
-#define wxStyledTextCtrl_SetEOLMode 2981
-#define wxStyledTextCtrl_StartStyling 2982
-#define wxStyledTextCtrl_SetStyling 2983
-#define wxStyledTextCtrl_GetBufferedDraw 2984
-#define wxStyledTextCtrl_SetBufferedDraw 2985
-#define wxStyledTextCtrl_SetTabWidth 2986
-#define wxStyledTextCtrl_GetTabWidth 2987
-#define wxStyledTextCtrl_SetCodePage 2988
-#define wxStyledTextCtrl_MarkerDefine 2989
-#define wxStyledTextCtrl_MarkerSetForeground 2990
-#define wxStyledTextCtrl_MarkerSetBackground 2991
-#define wxStyledTextCtrl_MarkerAdd 2992
-#define wxStyledTextCtrl_MarkerDelete 2993
-#define wxStyledTextCtrl_MarkerDeleteAll 2994
-#define wxStyledTextCtrl_MarkerGet 2995
-#define wxStyledTextCtrl_MarkerNext 2996
-#define wxStyledTextCtrl_MarkerPrevious 2997
-#define wxStyledTextCtrl_MarkerDefineBitmap 2998
-#define wxStyledTextCtrl_MarkerAddSet 2999
-#define wxStyledTextCtrl_MarkerSetAlpha 3000
-#define wxStyledTextCtrl_SetMarginType 3001
-#define wxStyledTextCtrl_GetMarginType 3002
-#define wxStyledTextCtrl_SetMarginWidth 3003
-#define wxStyledTextCtrl_GetMarginWidth 3004
-#define wxStyledTextCtrl_SetMarginMask 3005
-#define wxStyledTextCtrl_GetMarginMask 3006
-#define wxStyledTextCtrl_SetMarginSensitive 3007
-#define wxStyledTextCtrl_GetMarginSensitive 3008
-#define wxStyledTextCtrl_StyleClearAll 3009
-#define wxStyledTextCtrl_StyleSetForeground 3010
-#define wxStyledTextCtrl_StyleSetBackground 3011
-#define wxStyledTextCtrl_StyleSetBold 3012
-#define wxStyledTextCtrl_StyleSetItalic 3013
-#define wxStyledTextCtrl_StyleSetSize 3014
-#define wxStyledTextCtrl_StyleSetFaceName 3015
-#define wxStyledTextCtrl_StyleSetEOLFilled 3016
-#define wxStyledTextCtrl_StyleResetDefault 3017
-#define wxStyledTextCtrl_StyleSetUnderline 3018
-#define wxStyledTextCtrl_StyleSetCase 3019
-#define wxStyledTextCtrl_StyleSetHotSpot 3020
-#define wxStyledTextCtrl_SetSelForeground 3021
-#define wxStyledTextCtrl_SetSelBackground 3022
-#define wxStyledTextCtrl_GetSelAlpha 3023
-#define wxStyledTextCtrl_SetSelAlpha 3024
-#define wxStyledTextCtrl_SetCaretForeground 3025
-#define wxStyledTextCtrl_CmdKeyAssign 3026
-#define wxStyledTextCtrl_CmdKeyClear 3027
-#define wxStyledTextCtrl_CmdKeyClearAll 3028
-#define wxStyledTextCtrl_SetStyleBytes 3029
-#define wxStyledTextCtrl_StyleSetVisible 3030
-#define wxStyledTextCtrl_GetCaretPeriod 3031
-#define wxStyledTextCtrl_SetCaretPeriod 3032
-#define wxStyledTextCtrl_SetWordChars 3033
-#define wxStyledTextCtrl_BeginUndoAction 3034
-#define wxStyledTextCtrl_EndUndoAction 3035
-#define wxStyledTextCtrl_IndicatorSetStyle 3036
-#define wxStyledTextCtrl_IndicatorGetStyle 3037
-#define wxStyledTextCtrl_IndicatorSetForeground 3038
-#define wxStyledTextCtrl_IndicatorGetForeground 3039
-#define wxStyledTextCtrl_SetWhitespaceForeground 3040
-#define wxStyledTextCtrl_SetWhitespaceBackground 3041
-#define wxStyledTextCtrl_GetStyleBits 3042
-#define wxStyledTextCtrl_SetLineState 3043
-#define wxStyledTextCtrl_GetLineState 3044
-#define wxStyledTextCtrl_GetMaxLineState 3045
-#define wxStyledTextCtrl_GetCaretLineVisible 3046
-#define wxStyledTextCtrl_SetCaretLineVisible 3047
-#define wxStyledTextCtrl_GetCaretLineBackground 3048
-#define wxStyledTextCtrl_SetCaretLineBackground 3049
-#define wxStyledTextCtrl_AutoCompShow 3050
-#define wxStyledTextCtrl_AutoCompCancel 3051
-#define wxStyledTextCtrl_AutoCompActive 3052
-#define wxStyledTextCtrl_AutoCompPosStart 3053
-#define wxStyledTextCtrl_AutoCompComplete 3054
-#define wxStyledTextCtrl_AutoCompStops 3055
-#define wxStyledTextCtrl_AutoCompSetSeparator 3056
-#define wxStyledTextCtrl_AutoCompGetSeparator 3057
-#define wxStyledTextCtrl_AutoCompSelect 3058
-#define wxStyledTextCtrl_AutoCompSetCancelAtStart 3059
-#define wxStyledTextCtrl_AutoCompGetCancelAtStart 3060
-#define wxStyledTextCtrl_AutoCompSetFillUps 3061
-#define wxStyledTextCtrl_AutoCompSetChooseSingle 3062
-#define wxStyledTextCtrl_AutoCompGetChooseSingle 3063
-#define wxStyledTextCtrl_AutoCompSetIgnoreCase 3064
-#define wxStyledTextCtrl_AutoCompGetIgnoreCase 3065
-#define wxStyledTextCtrl_UserListShow 3066
-#define wxStyledTextCtrl_AutoCompSetAutoHide 3067
-#define wxStyledTextCtrl_AutoCompGetAutoHide 3068
-#define wxStyledTextCtrl_AutoCompSetDropRestOfWord 3069
-#define wxStyledTextCtrl_AutoCompGetDropRestOfWord 3070
-#define wxStyledTextCtrl_RegisterImage 3071
-#define wxStyledTextCtrl_ClearRegisteredImages 3072
-#define wxStyledTextCtrl_AutoCompGetTypeSeparator 3073
-#define wxStyledTextCtrl_AutoCompSetTypeSeparator 3074
-#define wxStyledTextCtrl_AutoCompSetMaxWidth 3075
-#define wxStyledTextCtrl_AutoCompGetMaxWidth 3076
-#define wxStyledTextCtrl_AutoCompSetMaxHeight 3077
-#define wxStyledTextCtrl_AutoCompGetMaxHeight 3078
-#define wxStyledTextCtrl_SetIndent 3079
-#define wxStyledTextCtrl_GetIndent 3080
-#define wxStyledTextCtrl_SetUseTabs 3081
-#define wxStyledTextCtrl_GetUseTabs 3082
-#define wxStyledTextCtrl_SetLineIndentation 3083
-#define wxStyledTextCtrl_GetLineIndentation 3084
-#define wxStyledTextCtrl_GetLineIndentPosition 3085
-#define wxStyledTextCtrl_GetColumn 3086
-#define wxStyledTextCtrl_SetUseHorizontalScrollBar 3087
-#define wxStyledTextCtrl_GetUseHorizontalScrollBar 3088
-#define wxStyledTextCtrl_SetIndentationGuides 3089
-#define wxStyledTextCtrl_GetIndentationGuides 3090
-#define wxStyledTextCtrl_SetHighlightGuide 3091
-#define wxStyledTextCtrl_GetHighlightGuide 3092
-#define wxStyledTextCtrl_GetLineEndPosition 3093
-#define wxStyledTextCtrl_GetCodePage 3094
-#define wxStyledTextCtrl_GetCaretForeground 3095
-#define wxStyledTextCtrl_GetReadOnly 3096
-#define wxStyledTextCtrl_SetCurrentPos 3097
-#define wxStyledTextCtrl_SetSelectionStart 3098
-#define wxStyledTextCtrl_GetSelectionStart 3099
-#define wxStyledTextCtrl_SetSelectionEnd 3100
-#define wxStyledTextCtrl_GetSelectionEnd 3101
-#define wxStyledTextCtrl_SetPrintMagnification 3102
-#define wxStyledTextCtrl_GetPrintMagnification 3103
-#define wxStyledTextCtrl_SetPrintColourMode 3104
-#define wxStyledTextCtrl_GetPrintColourMode 3105
-#define wxStyledTextCtrl_FindText 3106
-#define wxStyledTextCtrl_FormatRange 3107
-#define wxStyledTextCtrl_GetFirstVisibleLine 3108
-#define wxStyledTextCtrl_GetLine 3109
-#define wxStyledTextCtrl_GetLineCount 3110
-#define wxStyledTextCtrl_SetMarginLeft 3111
-#define wxStyledTextCtrl_GetMarginLeft 3112
-#define wxStyledTextCtrl_SetMarginRight 3113
-#define wxStyledTextCtrl_GetMarginRight 3114
-#define wxStyledTextCtrl_GetModify 3115
-#define wxStyledTextCtrl_SetSelection 3116
-#define wxStyledTextCtrl_GetSelectedText 3117
-#define wxStyledTextCtrl_GetTextRange 3118
-#define wxStyledTextCtrl_HideSelection 3119
-#define wxStyledTextCtrl_LineFromPosition 3120
-#define wxStyledTextCtrl_PositionFromLine 3121
-#define wxStyledTextCtrl_LineScroll 3122
-#define wxStyledTextCtrl_EnsureCaretVisible 3123
-#define wxStyledTextCtrl_ReplaceSelection 3124
-#define wxStyledTextCtrl_SetReadOnly 3125
-#define wxStyledTextCtrl_CanPaste 3126
-#define wxStyledTextCtrl_CanUndo 3127
-#define wxStyledTextCtrl_EmptyUndoBuffer 3128
-#define wxStyledTextCtrl_Undo 3129
-#define wxStyledTextCtrl_Cut 3130
-#define wxStyledTextCtrl_Copy 3131
-#define wxStyledTextCtrl_Paste 3132
-#define wxStyledTextCtrl_Clear 3133
-#define wxStyledTextCtrl_SetText 3134
-#define wxStyledTextCtrl_GetText 3135
-#define wxStyledTextCtrl_GetTextLength 3136
-#define wxStyledTextCtrl_GetOvertype 3137
-#define wxStyledTextCtrl_SetCaretWidth 3138
-#define wxStyledTextCtrl_GetCaretWidth 3139
-#define wxStyledTextCtrl_SetTargetStart 3140
-#define wxStyledTextCtrl_GetTargetStart 3141
-#define wxStyledTextCtrl_SetTargetEnd 3142
-#define wxStyledTextCtrl_GetTargetEnd 3143
-#define wxStyledTextCtrl_ReplaceTarget 3144
-#define wxStyledTextCtrl_SearchInTarget 3145
-#define wxStyledTextCtrl_SetSearchFlags 3146
-#define wxStyledTextCtrl_GetSearchFlags 3147
-#define wxStyledTextCtrl_CallTipShow 3148
-#define wxStyledTextCtrl_CallTipCancel 3149
-#define wxStyledTextCtrl_CallTipActive 3150
-#define wxStyledTextCtrl_CallTipPosAtStart 3151
-#define wxStyledTextCtrl_CallTipSetHighlight 3152
-#define wxStyledTextCtrl_CallTipSetBackground 3153
-#define wxStyledTextCtrl_CallTipSetForeground 3154
-#define wxStyledTextCtrl_CallTipSetForegroundHighlight 3155
-#define wxStyledTextCtrl_CallTipUseStyle 3156
-#define wxStyledTextCtrl_VisibleFromDocLine 3157
-#define wxStyledTextCtrl_DocLineFromVisible 3158
-#define wxStyledTextCtrl_WrapCount 3159
-#define wxStyledTextCtrl_SetFoldLevel 3160
-#define wxStyledTextCtrl_GetFoldLevel 3161
-#define wxStyledTextCtrl_GetLastChild 3162
-#define wxStyledTextCtrl_GetFoldParent 3163
-#define wxStyledTextCtrl_ShowLines 3164
-#define wxStyledTextCtrl_HideLines 3165
-#define wxStyledTextCtrl_GetLineVisible 3166
-#define wxStyledTextCtrl_SetFoldExpanded 3167
-#define wxStyledTextCtrl_GetFoldExpanded 3168
-#define wxStyledTextCtrl_ToggleFold 3169
-#define wxStyledTextCtrl_EnsureVisible 3170
-#define wxStyledTextCtrl_SetFoldFlags 3171
-#define wxStyledTextCtrl_EnsureVisibleEnforcePolicy 3172
-#define wxStyledTextCtrl_SetTabIndents 3173
-#define wxStyledTextCtrl_GetTabIndents 3174
-#define wxStyledTextCtrl_SetBackSpaceUnIndents 3175
-#define wxStyledTextCtrl_GetBackSpaceUnIndents 3176
-#define wxStyledTextCtrl_SetMouseDwellTime 3177
-#define wxStyledTextCtrl_GetMouseDwellTime 3178
-#define wxStyledTextCtrl_WordStartPosition 3179
-#define wxStyledTextCtrl_WordEndPosition 3180
-#define wxStyledTextCtrl_SetWrapMode 3181
-#define wxStyledTextCtrl_GetWrapMode 3182
-#define wxStyledTextCtrl_SetWrapVisualFlags 3183
-#define wxStyledTextCtrl_GetWrapVisualFlags 3184
-#define wxStyledTextCtrl_SetWrapVisualFlagsLocation 3185
-#define wxStyledTextCtrl_GetWrapVisualFlagsLocation 3186
-#define wxStyledTextCtrl_SetWrapStartIndent 3187
-#define wxStyledTextCtrl_GetWrapStartIndent 3188
-#define wxStyledTextCtrl_SetLayoutCache 3189
-#define wxStyledTextCtrl_GetLayoutCache 3190
-#define wxStyledTextCtrl_SetScrollWidth 3191
-#define wxStyledTextCtrl_GetScrollWidth 3192
-#define wxStyledTextCtrl_TextWidth 3193
-#define wxStyledTextCtrl_GetEndAtLastLine 3194
-#define wxStyledTextCtrl_TextHeight 3195
-#define wxStyledTextCtrl_SetUseVerticalScrollBar 3196
-#define wxStyledTextCtrl_GetUseVerticalScrollBar 3197
-#define wxStyledTextCtrl_AppendText 3198
-#define wxStyledTextCtrl_GetTwoPhaseDraw 3199
-#define wxStyledTextCtrl_SetTwoPhaseDraw 3200
-#define wxStyledTextCtrl_TargetFromSelection 3201
-#define wxStyledTextCtrl_LinesJoin 3202
-#define wxStyledTextCtrl_LinesSplit 3203
-#define wxStyledTextCtrl_SetFoldMarginColour 3204
-#define wxStyledTextCtrl_SetFoldMarginHiColour 3205
-#define wxStyledTextCtrl_LineDown 3206
-#define wxStyledTextCtrl_LineDownExtend 3207
-#define wxStyledTextCtrl_LineUp 3208
-#define wxStyledTextCtrl_LineUpExtend 3209
-#define wxStyledTextCtrl_CharLeft 3210
-#define wxStyledTextCtrl_CharLeftExtend 3211
-#define wxStyledTextCtrl_CharRight 3212
-#define wxStyledTextCtrl_CharRightExtend 3213
-#define wxStyledTextCtrl_WordLeft 3214
-#define wxStyledTextCtrl_WordLeftExtend 3215
-#define wxStyledTextCtrl_WordRight 3216
-#define wxStyledTextCtrl_WordRightExtend 3217
-#define wxStyledTextCtrl_Home 3218
-#define wxStyledTextCtrl_HomeExtend 3219
-#define wxStyledTextCtrl_LineEnd 3220
-#define wxStyledTextCtrl_LineEndExtend 3221
-#define wxStyledTextCtrl_DocumentStart 3222
-#define wxStyledTextCtrl_DocumentStartExtend 3223
-#define wxStyledTextCtrl_DocumentEnd 3224
-#define wxStyledTextCtrl_DocumentEndExtend 3225
-#define wxStyledTextCtrl_PageUp 3226
-#define wxStyledTextCtrl_PageUpExtend 3227
-#define wxStyledTextCtrl_PageDown 3228
-#define wxStyledTextCtrl_PageDownExtend 3229
-#define wxStyledTextCtrl_EditToggleOvertype 3230
-#define wxStyledTextCtrl_Cancel 3231
-#define wxStyledTextCtrl_DeleteBack 3232
-#define wxStyledTextCtrl_Tab 3233
-#define wxStyledTextCtrl_BackTab 3234
-#define wxStyledTextCtrl_NewLine 3235
-#define wxStyledTextCtrl_FormFeed 3236
-#define wxStyledTextCtrl_VCHome 3237
-#define wxStyledTextCtrl_VCHomeExtend 3238
-#define wxStyledTextCtrl_ZoomIn 3239
-#define wxStyledTextCtrl_ZoomOut 3240
-#define wxStyledTextCtrl_DelWordLeft 3241
-#define wxStyledTextCtrl_DelWordRight 3242
-#define wxStyledTextCtrl_LineCut 3243
-#define wxStyledTextCtrl_LineDelete 3244
-#define wxStyledTextCtrl_LineTranspose 3245
-#define wxStyledTextCtrl_LineDuplicate 3246
-#define wxStyledTextCtrl_LowerCase 3247
-#define wxStyledTextCtrl_UpperCase 3248
-#define wxStyledTextCtrl_LineScrollDown 3249
-#define wxStyledTextCtrl_LineScrollUp 3250
-#define wxStyledTextCtrl_DeleteBackNotLine 3251
-#define wxStyledTextCtrl_HomeDisplay 3252
-#define wxStyledTextCtrl_HomeDisplayExtend 3253
-#define wxStyledTextCtrl_LineEndDisplay 3254
-#define wxStyledTextCtrl_LineEndDisplayExtend 3255
-#define wxStyledTextCtrl_HomeWrapExtend 3256
-#define wxStyledTextCtrl_LineEndWrap 3257
-#define wxStyledTextCtrl_LineEndWrapExtend 3258
-#define wxStyledTextCtrl_VCHomeWrap 3259
-#define wxStyledTextCtrl_VCHomeWrapExtend 3260
-#define wxStyledTextCtrl_LineCopy 3261
-#define wxStyledTextCtrl_MoveCaretInsideView 3262
-#define wxStyledTextCtrl_LineLength 3263
-#define wxStyledTextCtrl_BraceHighlight 3264
-#define wxStyledTextCtrl_BraceBadLight 3265
-#define wxStyledTextCtrl_BraceMatch 3266
-#define wxStyledTextCtrl_GetViewEOL 3267
-#define wxStyledTextCtrl_SetViewEOL 3268
-#define wxStyledTextCtrl_SetModEventMask 3269
-#define wxStyledTextCtrl_GetEdgeColumn 3270
-#define wxStyledTextCtrl_SetEdgeColumn 3271
-#define wxStyledTextCtrl_GetEdgeMode 3272
-#define wxStyledTextCtrl_GetEdgeColour 3273
-#define wxStyledTextCtrl_SetEdgeColour 3274
-#define wxStyledTextCtrl_SearchAnchor 3275
-#define wxStyledTextCtrl_SearchNext 3276
-#define wxStyledTextCtrl_SearchPrev 3277
-#define wxStyledTextCtrl_LinesOnScreen 3278
-#define wxStyledTextCtrl_UsePopUp 3279
-#define wxStyledTextCtrl_SelectionIsRectangle 3280
-#define wxStyledTextCtrl_SetZoom 3281
-#define wxStyledTextCtrl_GetZoom 3282
-#define wxStyledTextCtrl_GetModEventMask 3283
-#define wxStyledTextCtrl_SetSTCFocus 3284
-#define wxStyledTextCtrl_GetSTCFocus 3285
-#define wxStyledTextCtrl_SetStatus 3286
-#define wxStyledTextCtrl_GetStatus 3287
-#define wxStyledTextCtrl_SetMouseDownCaptures 3288
-#define wxStyledTextCtrl_GetMouseDownCaptures 3289
-#define wxStyledTextCtrl_SetSTCCursor 3290
-#define wxStyledTextCtrl_GetSTCCursor 3291
-#define wxStyledTextCtrl_SetControlCharSymbol 3292
-#define wxStyledTextCtrl_GetControlCharSymbol 3293
-#define wxStyledTextCtrl_WordPartLeft 3294
-#define wxStyledTextCtrl_WordPartLeftExtend 3295
-#define wxStyledTextCtrl_WordPartRight 3296
-#define wxStyledTextCtrl_WordPartRightExtend 3297
-#define wxStyledTextCtrl_SetVisiblePolicy 3298
-#define wxStyledTextCtrl_DelLineLeft 3299
-#define wxStyledTextCtrl_DelLineRight 3300
-#define wxStyledTextCtrl_GetXOffset 3301
-#define wxStyledTextCtrl_ChooseCaretX 3302
-#define wxStyledTextCtrl_SetXCaretPolicy 3303
-#define wxStyledTextCtrl_SetYCaretPolicy 3304
-#define wxStyledTextCtrl_GetPrintWrapMode 3305
-#define wxStyledTextCtrl_SetHotspotActiveForeground 3306
-#define wxStyledTextCtrl_SetHotspotActiveBackground 3307
-#define wxStyledTextCtrl_SetHotspotActiveUnderline 3308
-#define wxStyledTextCtrl_SetHotspotSingleLine 3309
-#define wxStyledTextCtrl_ParaDownExtend 3310
-#define wxStyledTextCtrl_ParaUp 3311
-#define wxStyledTextCtrl_ParaUpExtend 3312
-#define wxStyledTextCtrl_PositionBefore 3313
-#define wxStyledTextCtrl_PositionAfter 3314
-#define wxStyledTextCtrl_CopyRange 3315
-#define wxStyledTextCtrl_CopyText 3316
-#define wxStyledTextCtrl_SetSelectionMode 3317
-#define wxStyledTextCtrl_GetSelectionMode 3318
-#define wxStyledTextCtrl_LineDownRectExtend 3319
-#define wxStyledTextCtrl_LineUpRectExtend 3320
-#define wxStyledTextCtrl_CharLeftRectExtend 3321
-#define wxStyledTextCtrl_CharRightRectExtend 3322
-#define wxStyledTextCtrl_HomeRectExtend 3323
-#define wxStyledTextCtrl_VCHomeRectExtend 3324
-#define wxStyledTextCtrl_LineEndRectExtend 3325
-#define wxStyledTextCtrl_PageUpRectExtend 3326
-#define wxStyledTextCtrl_PageDownRectExtend 3327
-#define wxStyledTextCtrl_StutteredPageUp 3328
-#define wxStyledTextCtrl_StutteredPageUpExtend 3329
-#define wxStyledTextCtrl_StutteredPageDown 3330
-#define wxStyledTextCtrl_StutteredPageDownExtend 3331
-#define wxStyledTextCtrl_WordLeftEnd 3332
-#define wxStyledTextCtrl_WordLeftEndExtend 3333
-#define wxStyledTextCtrl_WordRightEnd 3334
-#define wxStyledTextCtrl_WordRightEndExtend 3335
-#define wxStyledTextCtrl_SetWhitespaceChars 3336
-#define wxStyledTextCtrl_SetCharsDefault 3337
-#define wxStyledTextCtrl_AutoCompGetCurrent 3338
-#define wxStyledTextCtrl_Allocate 3339
-#define wxStyledTextCtrl_FindColumn 3340
-#define wxStyledTextCtrl_GetCaretSticky 3341
-#define wxStyledTextCtrl_SetCaretSticky 3342
-#define wxStyledTextCtrl_ToggleCaretSticky 3343
-#define wxStyledTextCtrl_SetPasteConvertEndings 3344
-#define wxStyledTextCtrl_GetPasteConvertEndings 3345
-#define wxStyledTextCtrl_SelectionDuplicate 3346
-#define wxStyledTextCtrl_SetCaretLineBackAlpha 3347
-#define wxStyledTextCtrl_GetCaretLineBackAlpha 3348
-#define wxStyledTextCtrl_StartRecord 3349
-#define wxStyledTextCtrl_StopRecord 3350
-#define wxStyledTextCtrl_SetLexer 3351
-#define wxStyledTextCtrl_GetLexer 3352
-#define wxStyledTextCtrl_Colourise 3353
-#define wxStyledTextCtrl_SetProperty 3354
-#define wxStyledTextCtrl_SetKeyWords 3355
-#define wxStyledTextCtrl_SetLexerLanguage 3356
-#define wxStyledTextCtrl_GetProperty 3357
-#define wxStyledTextCtrl_GetStyleBitsNeeded 3358
-#define wxStyledTextCtrl_GetCurrentLine 3359
-#define wxStyledTextCtrl_StyleSetSpec 3360
-#define wxStyledTextCtrl_StyleSetFont 3361
-#define wxStyledTextCtrl_StyleSetFontAttr 3362
-#define wxStyledTextCtrl_StyleSetCharacterSet 3363
-#define wxStyledTextCtrl_StyleSetFontEncoding 3364
-#define wxStyledTextCtrl_CmdKeyExecute 3365
-#define wxStyledTextCtrl_SetMargins 3366
-#define wxStyledTextCtrl_GetSelection 3367
-#define wxStyledTextCtrl_PointFromPosition 3368
-#define wxStyledTextCtrl_ScrollToLine 3369
-#define wxStyledTextCtrl_ScrollToColumn 3370
-#define wxStyledTextCtrl_SendMsg 3371
-#define wxStyledTextCtrl_SetVScrollBar 3372
-#define wxStyledTextCtrl_SetHScrollBar 3373
-#define wxStyledTextCtrl_GetLastKeydownProcessed 3374
-#define wxStyledTextCtrl_SetLastKeydownProcessed 3375
-#define wxStyledTextCtrl_SaveFile 3376
-#define wxStyledTextCtrl_LoadFile 3377
-#define wxStyledTextCtrl_DoDragOver 3378
-#define wxStyledTextCtrl_DoDropText 3379
-#define wxStyledTextCtrl_GetUseAntiAliasing 3380
-#define wxStyledTextCtrl_AddTextRaw 3381
-#define wxStyledTextCtrl_InsertTextRaw 3382
-#define wxStyledTextCtrl_GetCurLineRaw 3383
-#define wxStyledTextCtrl_GetLineRaw 3384
-#define wxStyledTextCtrl_GetSelectedTextRaw 3385
-#define wxStyledTextCtrl_GetTextRangeRaw 3386
-#define wxStyledTextCtrl_SetTextRaw 3387
-#define wxStyledTextCtrl_GetTextRaw 3388
-#define wxStyledTextCtrl_AppendTextRaw 3389
-#define wxArtProvider_GetBitmap 3390
-#define wxArtProvider_GetIcon 3391
-#define wxTreeEvent_GetKeyCode 3392
-#define wxTreeEvent_GetItem 3393
-#define wxTreeEvent_GetKeyEvent 3394
-#define wxTreeEvent_GetLabel 3395
-#define wxTreeEvent_GetOldItem 3396
-#define wxTreeEvent_GetPoint 3397
-#define wxTreeEvent_IsEditCancelled 3398
-#define wxTreeEvent_SetToolTip 3399
-#define wxNotebookEvent_GetOldSelection 3400
-#define wxNotebookEvent_GetSelection 3401
-#define wxNotebookEvent_SetOldSelection 3402
-#define wxNotebookEvent_SetSelection 3403
-#define wxFileDataObject_new 3404
-#define wxFileDataObject_AddFile 3405
-#define wxFileDataObject_GetFilenames 3406
-#define wxFileDataObject_destroy 3407
-#define wxTextDataObject_new 3408
-#define wxTextDataObject_GetTextLength 3409
-#define wxTextDataObject_GetText 3410
-#define wxTextDataObject_SetText 3411
-#define wxTextDataObject_destroy 3412
-#define wxBitmapDataObject_new_1_1 3413
-#define wxBitmapDataObject_new_1_0 3414
-#define wxBitmapDataObject_GetBitmap 3415
-#define wxBitmapDataObject_SetBitmap 3416
-#define wxBitmapDataObject_destroy 3417
-#define wxClipboard_new 3419
-#define wxClipboard_destruct 3420
-#define wxClipboard_AddData 3421
-#define wxClipboard_Clear 3422
-#define wxClipboard_Close 3423
-#define wxClipboard_Flush 3424
-#define wxClipboard_GetData 3425
-#define wxClipboard_IsOpened 3426
-#define wxClipboard_Open 3427
-#define wxClipboard_SetData 3428
-#define wxClipboard_UsePrimarySelection 3430
-#define wxClipboard_IsSupported 3431
-#define wxClipboard_Get 3432
-#define wxSpinEvent_GetPosition 3433
-#define wxSpinEvent_SetPosition 3434
-#define wxSplitterWindow_new_0 3435
-#define wxSplitterWindow_new_2 3436
-#define wxSplitterWindow_destruct 3437
-#define wxSplitterWindow_Create 3438
-#define wxSplitterWindow_GetMinimumPaneSize 3439
-#define wxSplitterWindow_GetSashGravity 3440
-#define wxSplitterWindow_GetSashPosition 3441
-#define wxSplitterWindow_GetSplitMode 3442
-#define wxSplitterWindow_GetWindow1 3443
-#define wxSplitterWindow_GetWindow2 3444
-#define wxSplitterWindow_Initialize 3445
-#define wxSplitterWindow_IsSplit 3446
-#define wxSplitterWindow_ReplaceWindow 3447
-#define wxSplitterWindow_SetSashGravity 3448
-#define wxSplitterWindow_SetSashPosition 3449
-#define wxSplitterWindow_SetSashSize 3450
-#define wxSplitterWindow_SetMinimumPaneSize 3451
-#define wxSplitterWindow_SetSplitMode 3452
-#define wxSplitterWindow_SplitHorizontally 3453
-#define wxSplitterWindow_SplitVertically 3454
-#define wxSplitterWindow_Unsplit 3455
-#define wxSplitterWindow_UpdateSize 3456
-#define wxSplitterEvent_GetSashPosition 3457
-#define wxSplitterEvent_GetX 3458
-#define wxSplitterEvent_GetY 3459
-#define wxSplitterEvent_GetWindowBeingRemoved 3460
-#define wxSplitterEvent_SetSashPosition 3461
-#define wxHtmlWindow_new_0 3462
-#define wxHtmlWindow_new_2 3463
-#define wxHtmlWindow_AppendToPage 3464
-#define wxHtmlWindow_GetOpenedAnchor 3465
-#define wxHtmlWindow_GetOpenedPage 3466
-#define wxHtmlWindow_GetOpenedPageTitle 3467
-#define wxHtmlWindow_GetRelatedFrame 3468
-#define wxHtmlWindow_HistoryBack 3469
-#define wxHtmlWindow_HistoryCanBack 3470
-#define wxHtmlWindow_HistoryCanForward 3471
-#define wxHtmlWindow_HistoryClear 3472
-#define wxHtmlWindow_HistoryForward 3473
-#define wxHtmlWindow_LoadFile 3474
-#define wxHtmlWindow_LoadPage 3475
-#define wxHtmlWindow_SelectAll 3476
-#define wxHtmlWindow_SelectionToText 3477
-#define wxHtmlWindow_SelectLine 3478
-#define wxHtmlWindow_SelectWord 3479
-#define wxHtmlWindow_SetBorders 3480
-#define wxHtmlWindow_SetFonts 3481
-#define wxHtmlWindow_SetPage 3482
-#define wxHtmlWindow_SetRelatedFrame 3483
-#define wxHtmlWindow_SetRelatedStatusBar 3484
-#define wxHtmlWindow_ToText 3485
-#define wxHtmlWindow_destroy 3486
-#define wxHtmlLinkEvent_GetLinkInfo 3487
-#define wxSystemSettings_GetColour 3488
-#define wxSystemSettings_GetFont 3489
-#define wxSystemSettings_GetMetric 3490
-#define wxSystemSettings_GetScreenType 3491
-#define wxSystemOptions_GetOption 3492
-#define wxSystemOptions_GetOptionInt 3493
-#define wxSystemOptions_HasOption 3494
-#define wxSystemOptions_IsFalse 3495
-#define wxSystemOptions_SetOption_2_1 3496
-#define wxSystemOptions_SetOption_2_0 3497
-#define wxAuiNotebookEvent_SetSelection 3498
-#define wxAuiNotebookEvent_GetSelection 3499
-#define wxAuiNotebookEvent_SetOldSelection 3500
-#define wxAuiNotebookEvent_GetOldSelection 3501
-#define wxAuiNotebookEvent_SetDragSource 3502
-#define wxAuiNotebookEvent_GetDragSource 3503
-#define wxAuiManagerEvent_SetManager 3504
-#define wxAuiManagerEvent_GetManager 3505
-#define wxAuiManagerEvent_SetPane 3506
-#define wxAuiManagerEvent_GetPane 3507
-#define wxAuiManagerEvent_SetButton 3508
-#define wxAuiManagerEvent_GetButton 3509
-#define wxAuiManagerEvent_SetDC 3510
-#define wxAuiManagerEvent_GetDC 3511
-#define wxAuiManagerEvent_Veto 3512
-#define wxAuiManagerEvent_GetVeto 3513
-#define wxAuiManagerEvent_SetCanVeto 3514
-#define wxAuiManagerEvent_CanVeto 3515
-#define wxLogNull_new 3516
-#define wxLogNull_destroy 3517
+#define wxDC_GetFont 667
+#define wxDC_GetLayoutDirection 668
+#define wxDC_GetLogicalFunction 669
+#define wxDC_GetMapMode 670
+#define wxDC_GetMultiLineTextExtent_4 671
+#define wxDC_GetMultiLineTextExtent_1 672
+#define wxDC_GetPartialTextExtents 673
+#define wxDC_GetPen 674
+#define wxDC_GetPixel 675
+#define wxDC_GetPPI 676
+#define wxDC_GetSize 678
+#define wxDC_GetSizeMM 680
+#define wxDC_GetTextBackground 681
+#define wxDC_GetTextExtent_4 682
+#define wxDC_GetTextExtent_1 683
+#define wxDC_GetTextForeground 685
+#define wxDC_GetUserScale 686
+#define wxDC_GradientFillConcentric_3 687
+#define wxDC_GradientFillConcentric_4 688
+#define wxDC_GradientFillLinear 689
+#define wxDC_LogicalToDeviceX 690
+#define wxDC_LogicalToDeviceXRel 691
+#define wxDC_LogicalToDeviceY 692
+#define wxDC_LogicalToDeviceYRel 693
+#define wxDC_MaxX 694
+#define wxDC_MaxY 695
+#define wxDC_MinX 696
+#define wxDC_MinY 697
+#define wxDC_IsOk 698
+#define wxDC_ResetBoundingBox 699
+#define wxDC_SetAxisOrientation 700
+#define wxDC_SetBackground 701
+#define wxDC_SetBackgroundMode 702
+#define wxDC_SetBrush 703
+#define wxDC_SetClippingRegion_2 705
+#define wxDC_SetClippingRegion_1_1 706
+#define wxDC_SetClippingRegion_1_0 707
+#define wxDC_SetDeviceOrigin 708
+#define wxDC_SetFont 709
+#define wxDC_SetLayoutDirection 710
+#define wxDC_SetLogicalFunction 711
+#define wxDC_SetMapMode 712
+#define wxDC_SetPalette 713
+#define wxDC_SetPen 714
+#define wxDC_SetTextBackground 715
+#define wxDC_SetTextForeground 716
+#define wxDC_SetUserScale 717
+#define wxDC_StartDoc 718
+#define wxDC_StartPage 719
+#define wxMirrorDC_new 720
+#define wxMirrorDC_destroy 721
+#define wxScreenDC_new 722
+#define wxScreenDC_destruct 723
+#define wxPostScriptDC_new_0 724
+#define wxPostScriptDC_new_1 725
+#define wxPostScriptDC_destruct 726
+#define wxPostScriptDC_SetResolution 727
+#define wxPostScriptDC_GetResolution 728
+#define wxWindowDC_new_0 729
+#define wxWindowDC_new_1 730
+#define wxWindowDC_destruct 731
+#define wxClientDC_new_0 732
+#define wxClientDC_new_1 733
+#define wxClientDC_destroy 734
+#define wxPaintDC_new_0 735
+#define wxPaintDC_new_1 736
+#define wxPaintDC_destroy 737
+#define wxMemoryDC_new_1_0 739
+#define wxMemoryDC_new_1_1 740
+#define wxMemoryDC_new_0 741
+#define wxMemoryDC_destruct 743
+#define wxMemoryDC_SelectObject 744
+#define wxMemoryDC_SelectObjectAsSource 745
+#define wxBufferedDC_new_0 746
+#define wxBufferedDC_new_2 747
+#define wxBufferedDC_new_3 748
+#define wxBufferedDC_destruct 749
+#define wxBufferedDC_Init_2 750
+#define wxBufferedDC_Init_3 751
+#define wxBufferedPaintDC_new_3 752
+#define wxBufferedPaintDC_new_2 753
+#define wxBufferedPaintDC_destruct 754
+#define wxGraphicsObject_destruct 755
+#define wxGraphicsObject_GetRenderer 756
+#define wxGraphicsObject_IsNull 757
+#define wxGraphicsContext_destruct 758
+#define wxGraphicsContext_Create_1_1 759
+#define wxGraphicsContext_Create_1_0 760
+#define wxGraphicsContext_Create_0 761
+#define wxGraphicsContext_CreatePen 762
+#define wxGraphicsContext_CreateBrush 763
+#define wxGraphicsContext_CreateRadialGradientBrush 764
+#define wxGraphicsContext_CreateLinearGradientBrush 765
+#define wxGraphicsContext_CreateFont 766
+#define wxGraphicsContext_CreateMatrix 767
+#define wxGraphicsContext_CreatePath 768
+#define wxGraphicsContext_Clip_1 769
+#define wxGraphicsContext_Clip_4 770
+#define wxGraphicsContext_ResetClip 771
+#define wxGraphicsContext_DrawBitmap 772
+#define wxGraphicsContext_DrawEllipse 773
+#define wxGraphicsContext_DrawIcon 774
+#define wxGraphicsContext_DrawLines 775
+#define wxGraphicsContext_DrawPath 776
+#define wxGraphicsContext_DrawRectangle 777
+#define wxGraphicsContext_DrawRoundedRectangle 778
+#define wxGraphicsContext_DrawText_3 779
+#define wxGraphicsContext_DrawText_4_0 780
+#define wxGraphicsContext_DrawText_4_1 781
+#define wxGraphicsContext_DrawText_5 782
+#define wxGraphicsContext_FillPath 783
+#define wxGraphicsContext_StrokePath 784
+#define wxGraphicsContext_GetPartialTextExtents 785
+#define wxGraphicsContext_GetTextExtent 786
+#define wxGraphicsContext_Rotate 787
+#define wxGraphicsContext_Scale 788
+#define wxGraphicsContext_Translate 789
+#define wxGraphicsContext_GetTransform 790
+#define wxGraphicsContext_SetTransform 791
+#define wxGraphicsContext_ConcatTransform 792
+#define wxGraphicsContext_SetBrush_1_1 793
+#define wxGraphicsContext_SetBrush_1_0 794
+#define wxGraphicsContext_SetFont_1 795
+#define wxGraphicsContext_SetFont_2 796
+#define wxGraphicsContext_SetPen_1_0 797
+#define wxGraphicsContext_SetPen_1_1 798
+#define wxGraphicsContext_StrokeLine 799
+#define wxGraphicsContext_StrokeLines 800
+#define wxGraphicsMatrix_Concat 802
+#define wxGraphicsMatrix_Get 804
+#define wxGraphicsMatrix_Invert 805
+#define wxGraphicsMatrix_IsEqual 806
+#define wxGraphicsMatrix_IsIdentity 808
+#define wxGraphicsMatrix_Rotate 809
+#define wxGraphicsMatrix_Scale 810
+#define wxGraphicsMatrix_Translate 811
+#define wxGraphicsMatrix_Set 812
+#define wxGraphicsMatrix_TransformPoint 813
+#define wxGraphicsMatrix_TransformDistance 814
+#define wxGraphicsPath_MoveToPoint_2 815
+#define wxGraphicsPath_MoveToPoint_1 816
+#define wxGraphicsPath_AddArc_6 817
+#define wxGraphicsPath_AddArc_5 818
+#define wxGraphicsPath_AddArcToPoint 819
+#define wxGraphicsPath_AddCircle 820
+#define wxGraphicsPath_AddCurveToPoint_6 821
+#define wxGraphicsPath_AddCurveToPoint_3 822
+#define wxGraphicsPath_AddEllipse 823
+#define wxGraphicsPath_AddLineToPoint_2 824
+#define wxGraphicsPath_AddLineToPoint_1 825
+#define wxGraphicsPath_AddPath 826
+#define wxGraphicsPath_AddQuadCurveToPoint 827
+#define wxGraphicsPath_AddRectangle 828
+#define wxGraphicsPath_AddRoundedRectangle 829
+#define wxGraphicsPath_CloseSubpath 830
+#define wxGraphicsPath_Contains_3 831
+#define wxGraphicsPath_Contains_2 832
+#define wxGraphicsPath_GetBox 834
+#define wxGraphicsPath_GetCurrentPoint 836
+#define wxGraphicsPath_Transform 837
+#define wxGraphicsRenderer_GetDefaultRenderer 838
+#define wxGraphicsRenderer_CreateContext_1_1 839
+#define wxGraphicsRenderer_CreateContext_1_0 840
+#define wxGraphicsRenderer_CreatePen 841
+#define wxGraphicsRenderer_CreateBrush 842
+#define wxGraphicsRenderer_CreateLinearGradientBrush 843
+#define wxGraphicsRenderer_CreateRadialGradientBrush 844
+#define wxGraphicsRenderer_CreateFont 845
+#define wxGraphicsRenderer_CreateMatrix 846
+#define wxGraphicsRenderer_CreatePath 847
+#define wxMenuBar_new_1 849
+#define wxMenuBar_new_0 851
+#define wxMenuBar_destruct 853
+#define wxMenuBar_Append 854
+#define wxMenuBar_Check 855
+#define wxMenuBar_Enable_2 856
+#define wxMenuBar_Enable_1 857
+#define wxMenuBar_EnableTop 858
+#define wxMenuBar_FindMenu 859
+#define wxMenuBar_FindMenuItem 860
+#define wxMenuBar_FindItem 861
+#define wxMenuBar_GetHelpString 862
+#define wxMenuBar_GetLabel_1 863
+#define wxMenuBar_GetLabel_0 864
+#define wxMenuBar_GetLabelTop 865
+#define wxMenuBar_GetMenu 866
+#define wxMenuBar_GetMenuCount 867
+#define wxMenuBar_Insert 868
+#define wxMenuBar_IsChecked 869
+#define wxMenuBar_IsEnabled_1 870
+#define wxMenuBar_IsEnabled_0 871
+#define wxMenuBar_Remove 872
+#define wxMenuBar_Replace 873
+#define wxMenuBar_SetHelpString 874
+#define wxMenuBar_SetLabel_2 875
+#define wxMenuBar_SetLabel_1 876
+#define wxMenuBar_SetLabelTop 877
+#define wxControl_GetLabel 878
+#define wxControl_SetLabel 879
+#define wxControlWithItems_Append_1 880
+#define wxControlWithItems_Append_2 881
+#define wxControlWithItems_appendStrings_1 882
+#define wxControlWithItems_Clear 883
+#define wxControlWithItems_Delete 884
+#define wxControlWithItems_FindString 885
+#define wxControlWithItems_getClientData 886
+#define wxControlWithItems_setClientData 887
+#define wxControlWithItems_GetCount 888
+#define wxControlWithItems_GetSelection 889
+#define wxControlWithItems_GetString 890
+#define wxControlWithItems_GetStringSelection 891
+#define wxControlWithItems_Insert_2 892
+#define wxControlWithItems_Insert_3 893
+#define wxControlWithItems_IsEmpty 894
+#define wxControlWithItems_Select 895
+#define wxControlWithItems_SetSelection 896
+#define wxControlWithItems_SetString 897
+#define wxControlWithItems_SetStringSelection 898
+#define wxMenu_new_2 901
+#define wxMenu_new_1 902
+#define wxMenu_destruct 904
+#define wxMenu_Append_3 905
+#define wxMenu_Append_1 906
+#define wxMenu_Append_4_0 907
+#define wxMenu_Append_4_1 908
+#define wxMenu_AppendCheckItem 909
+#define wxMenu_AppendRadioItem 910
+#define wxMenu_AppendSeparator 911
+#define wxMenu_Break 912
+#define wxMenu_Check 913
+#define wxMenu_Delete_1_0 914
+#define wxMenu_Delete_1_1 915
+#define wxMenu_Destroy_1_0 916
+#define wxMenu_Destroy_1_1 917
+#define wxMenu_Enable 918
+#define wxMenu_FindItem_1 919
+#define wxMenu_FindItem_2 920
+#define wxMenu_FindItemByPosition 921
+#define wxMenu_GetHelpString 922
+#define wxMenu_GetLabel 923
+#define wxMenu_GetMenuItemCount 924
+#define wxMenu_GetMenuItems 925
+#define wxMenu_GetTitle 927
+#define wxMenu_Insert_2 928
+#define wxMenu_Insert_3 929
+#define wxMenu_Insert_5_1 930
+#define wxMenu_Insert_5_0 931
+#define wxMenu_InsertCheckItem 932
+#define wxMenu_InsertRadioItem 933
+#define wxMenu_InsertSeparator 934
+#define wxMenu_IsChecked 935
+#define wxMenu_IsEnabled 936
+#define wxMenu_Prepend_1 937
+#define wxMenu_Prepend_2 938
+#define wxMenu_Prepend_4_1 939
+#define wxMenu_Prepend_4_0 940
+#define wxMenu_PrependCheckItem 941
+#define wxMenu_PrependRadioItem 942
+#define wxMenu_PrependSeparator 943
+#define wxMenu_Remove_1_0 944
+#define wxMenu_Remove_1_1 945
+#define wxMenu_SetHelpString 946
+#define wxMenu_SetLabel 947
+#define wxMenu_SetTitle 948
+#define wxMenuItem_new 949
+#define wxMenuItem_destruct 951
+#define wxMenuItem_Check 952
+#define wxMenuItem_Enable 953
+#define wxMenuItem_GetBitmap 954
+#define wxMenuItem_GetHelp 955
+#define wxMenuItem_GetId 956
+#define wxMenuItem_GetKind 957
+#define wxMenuItem_GetLabel 958
+#define wxMenuItem_GetLabelFromText 959
+#define wxMenuItem_GetMenu 960
+#define wxMenuItem_GetText 961
+#define wxMenuItem_GetSubMenu 962
+#define wxMenuItem_IsCheckable 963
+#define wxMenuItem_IsChecked 964
+#define wxMenuItem_IsEnabled 965
+#define wxMenuItem_IsSeparator 966
+#define wxMenuItem_IsSubMenu 967
+#define wxMenuItem_SetBitmap 968
+#define wxMenuItem_SetHelp 969
+#define wxMenuItem_SetMenu 970
+#define wxMenuItem_SetSubMenu 971
+#define wxMenuItem_SetText 972
+#define wxToolBar_AddControl 973
+#define wxToolBar_AddSeparator 974
+#define wxToolBar_AddTool_5 975
+#define wxToolBar_AddTool_4_0 976
+#define wxToolBar_AddTool_1 977
+#define wxToolBar_AddTool_4_1 978
+#define wxToolBar_AddTool_3 979
+#define wxToolBar_AddTool_6 980
+#define wxToolBar_AddCheckTool 981
+#define wxToolBar_AddRadioTool 982
+#define wxToolBar_DeleteTool 983
+#define wxToolBar_DeleteToolByPos 984
+#define wxToolBar_EnableTool 985
+#define wxToolBar_FindById 986
+#define wxToolBar_FindControl 987
+#define wxToolBar_FindToolForPosition 988
+#define wxToolBar_GetToolSize 989
+#define wxToolBar_GetToolBitmapSize 990
+#define wxToolBar_GetMargins 991
+#define wxToolBar_GetToolEnabled 992
+#define wxToolBar_GetToolLongHelp 993
+#define wxToolBar_GetToolPacking 994
+#define wxToolBar_GetToolPos 995
+#define wxToolBar_GetToolSeparation 996
+#define wxToolBar_GetToolShortHelp 997
+#define wxToolBar_GetToolState 998
+#define wxToolBar_InsertControl 999
+#define wxToolBar_InsertSeparator 1000
+#define wxToolBar_InsertTool_5 1001
+#define wxToolBar_InsertTool_2 1002
+#define wxToolBar_InsertTool_4 1003
+#define wxToolBar_Realize 1004
+#define wxToolBar_RemoveTool 1005
+#define wxToolBar_SetMargins 1006
+#define wxToolBar_SetToolBitmapSize 1007
+#define wxToolBar_SetToolLongHelp 1008
+#define wxToolBar_SetToolPacking 1009
+#define wxToolBar_SetToolShortHelp 1010
+#define wxToolBar_SetToolSeparation 1011
+#define wxToolBar_ToggleTool 1012
+#define wxStatusBar_new_0 1014
+#define wxStatusBar_new_2 1015
+#define wxStatusBar_destruct 1017
+#define wxStatusBar_Create 1018
+#define wxStatusBar_GetFieldRect 1019
+#define wxStatusBar_GetFieldsCount 1020
+#define wxStatusBar_GetStatusText 1021
+#define wxStatusBar_PopStatusText 1022
+#define wxStatusBar_PushStatusText 1023
+#define wxStatusBar_SetFieldsCount 1024
+#define wxStatusBar_SetMinHeight 1025
+#define wxStatusBar_SetStatusText 1026
+#define wxStatusBar_SetStatusWidths 1027
+#define wxStatusBar_SetStatusStyles 1028
+#define wxBitmap_new_0 1029
+#define wxBitmap_new_3 1030
+#define wxBitmap_new_4 1031
+#define wxBitmap_new_2_0 1032
+#define wxBitmap_new_2_1 1033
+#define wxBitmap_destruct 1034
+#define wxBitmap_ConvertToImage 1035
+#define wxBitmap_CopyFromIcon 1036
+#define wxBitmap_Create 1037
+#define wxBitmap_GetDepth 1038
+#define wxBitmap_GetHeight 1039
+#define wxBitmap_GetPalette 1040
+#define wxBitmap_GetMask 1041
+#define wxBitmap_GetWidth 1042
+#define wxBitmap_GetSubBitmap 1043
+#define wxBitmap_LoadFile 1044
+#define wxBitmap_Ok 1045
+#define wxBitmap_SaveFile 1046
+#define wxBitmap_SetDepth 1047
+#define wxBitmap_SetHeight 1048
+#define wxBitmap_SetMask 1049
+#define wxBitmap_SetPalette 1050
+#define wxBitmap_SetWidth 1051
+#define wxIcon_new_0 1052
+#define wxIcon_new_2 1053
+#define wxIcon_new_1 1054
+#define wxIcon_CopyFromBitmap 1055
+#define wxIcon_destroy 1056
+#define wxIconBundle_new_0 1057
+#define wxIconBundle_new_2 1058
+#define wxIconBundle_new_1_0 1059
+#define wxIconBundle_new_1_1 1060
+#define wxIconBundle_destruct 1061
+#define wxIconBundle_AddIcon_2 1062
+#define wxIconBundle_AddIcon_1 1063
+#define wxIconBundle_GetIcon_1_1 1064
+#define wxIconBundle_GetIcon_1_0 1065
+#define wxCursor_new_0 1066
+#define wxCursor_new_1_0 1067
+#define wxCursor_new_1_1 1068
+#define wxCursor_new_4 1069
+#define wxCursor_destruct 1070
+#define wxCursor_Ok 1071
+#define wxMask_new_0 1072
+#define wxMask_new_2_1 1073
+#define wxMask_new_2_0 1074
+#define wxMask_new_1 1075
+#define wxMask_destruct 1076
+#define wxMask_Create_2_1 1077
+#define wxMask_Create_2_0 1078
+#define wxMask_Create_1 1079
+#define wxImage_new_0 1080
+#define wxImage_new_3_0 1081
+#define wxImage_new_4 1082
+#define wxImage_new_5 1083
+#define wxImage_new_2 1084
+#define wxImage_new_3_1 1085
+#define wxImage_Blur 1086
+#define wxImage_BlurHorizontal 1087
+#define wxImage_BlurVertical 1088
+#define wxImage_ConvertAlphaToMask 1089
+#define wxImage_ConvertToGreyscale 1090
+#define wxImage_ConvertToMono 1091
+#define wxImage_Copy 1092
+#define wxImage_Create_3 1093
+#define wxImage_Create_4 1094
+#define wxImage_Create_5 1095
+#define wxImage_Destroy 1096
+#define wxImage_FindFirstUnusedColour 1097
+#define wxImage_GetImageExtWildcard 1098
+#define wxImage_GetAlpha_2 1099
+#define wxImage_GetAlpha_0 1100
+#define wxImage_GetBlue 1101
+#define wxImage_GetData 1102
+#define wxImage_GetGreen 1103
+#define wxImage_GetImageCount 1104
+#define wxImage_GetHeight 1105
+#define wxImage_GetMaskBlue 1106
+#define wxImage_GetMaskGreen 1107
+#define wxImage_GetMaskRed 1108
+#define wxImage_GetOrFindMaskColour 1109
+#define wxImage_GetPalette 1110
+#define wxImage_GetRed 1111
+#define wxImage_GetSubImage 1112
+#define wxImage_GetWidth 1113
+#define wxImage_HasAlpha 1114
+#define wxImage_HasMask 1115
+#define wxImage_GetOption 1116
+#define wxImage_GetOptionInt 1117
+#define wxImage_HasOption 1118
+#define wxImage_InitAlpha 1119
+#define wxImage_InitStandardHandlers 1120
+#define wxImage_IsTransparent 1121
+#define wxImage_LoadFile_2 1122
+#define wxImage_LoadFile_3 1123
+#define wxImage_Ok 1124
+#define wxImage_RemoveHandler 1125
+#define wxImage_Mirror 1126
+#define wxImage_Replace 1127
+#define wxImage_Rescale 1128
+#define wxImage_Resize 1129
+#define wxImage_Rotate 1130
+#define wxImage_RotateHue 1131
+#define wxImage_Rotate90 1132
+#define wxImage_SaveFile_1 1133
+#define wxImage_SaveFile_2_0 1134
+#define wxImage_SaveFile_2_1 1135
+#define wxImage_Scale 1136
+#define wxImage_Size 1137
+#define wxImage_SetAlpha_3 1138
+#define wxImage_SetAlpha_2 1139
+#define wxImage_SetData_2 1140
+#define wxImage_SetData_4 1141
+#define wxImage_SetMask 1142
+#define wxImage_SetMaskColour 1143
+#define wxImage_SetMaskFromImage 1144
+#define wxImage_SetOption_2_1 1145
+#define wxImage_SetOption_2_0 1146
+#define wxImage_SetPalette 1147
+#define wxImage_SetRGB_5 1148
+#define wxImage_SetRGB_4 1149
+#define wxImage_destroy 1150
+#define wxBrush_new_0 1151
+#define wxBrush_new_2 1152
+#define wxBrush_new_1 1153
+#define wxBrush_destruct 1155
+#define wxBrush_GetColour 1156
+#define wxBrush_GetStipple 1157
+#define wxBrush_GetStyle 1158
+#define wxBrush_IsHatch 1159
+#define wxBrush_IsOk 1160
+#define wxBrush_SetColour_1 1161
+#define wxBrush_SetColour_3 1162
+#define wxBrush_SetStipple 1163
+#define wxBrush_SetStyle 1164
+#define wxPen_new_0 1165
+#define wxPen_new_2 1166
+#define wxPen_destruct 1167
+#define wxPen_GetCap 1168
+#define wxPen_GetColour 1169
+#define wxPen_GetJoin 1170
+#define wxPen_GetStyle 1171
+#define wxPen_GetWidth 1172
+#define wxPen_IsOk 1173
+#define wxPen_SetCap 1174
+#define wxPen_SetColour_1 1175
+#define wxPen_SetColour_3 1176
+#define wxPen_SetJoin 1177
+#define wxPen_SetStyle 1178
+#define wxPen_SetWidth 1179
+#define wxRegion_new_0 1180
+#define wxRegion_new_4 1181
+#define wxRegion_new_2 1182
+#define wxRegion_new_1_1 1183
+#define wxRegion_new_1_0 1185
+#define wxRegion_destruct 1187
+#define wxRegion_Clear 1188
+#define wxRegion_Contains_2 1189
+#define wxRegion_Contains_1_0 1190
+#define wxRegion_Contains_4 1191
+#define wxRegion_Contains_1_1 1192
+#define wxRegion_ConvertToBitmap 1193
+#define wxRegion_GetBox 1194
+#define wxRegion_Intersect_4 1195
+#define wxRegion_Intersect_1_1 1196
+#define wxRegion_Intersect_1_0 1197
+#define wxRegion_IsEmpty 1198
+#define wxRegion_Subtract_4 1199
+#define wxRegion_Subtract_1_1 1200
+#define wxRegion_Subtract_1_0 1201
+#define wxRegion_Offset_2 1202
+#define wxRegion_Offset_1 1203
+#define wxRegion_Union_4 1204
+#define wxRegion_Union_1_2 1205
+#define wxRegion_Union_1_1 1206
+#define wxRegion_Union_1_0 1207
+#define wxRegion_Union_3 1208
+#define wxRegion_Xor_4 1209
+#define wxRegion_Xor_1_1 1210
+#define wxRegion_Xor_1_0 1211
+#define wxAcceleratorTable_new_0 1212
+#define wxAcceleratorTable_new_2 1213
+#define wxAcceleratorTable_destruct 1214
+#define wxAcceleratorTable_Ok 1215
+#define wxAcceleratorEntry_new_1_0 1216
+#define wxAcceleratorEntry_new_1_1 1217
+#define wxAcceleratorEntry_GetCommand 1218
+#define wxAcceleratorEntry_GetFlags 1219
+#define wxAcceleratorEntry_GetKeyCode 1220
+#define wxAcceleratorEntry_Set 1221
+#define wxAcceleratorEntry_destroy 1222
+#define wxCaret_new_3 1227
+#define wxCaret_new_2 1228
+#define wxCaret_destruct 1230
+#define wxCaret_Create_3 1231
+#define wxCaret_Create_2 1232
+#define wxCaret_GetBlinkTime 1233
+#define wxCaret_GetPosition 1235
+#define wxCaret_GetSize 1237
+#define wxCaret_GetWindow 1238
+#define wxCaret_Hide 1239
+#define wxCaret_IsOk 1240
+#define wxCaret_IsVisible 1241
+#define wxCaret_Move_2 1242
+#define wxCaret_Move_1 1243
+#define wxCaret_SetBlinkTime 1244
+#define wxCaret_SetSize_2 1245
+#define wxCaret_SetSize_1 1246
+#define wxCaret_Show 1247
+#define wxSizer_Add_2_1 1248
+#define wxSizer_Add_2_0 1249
+#define wxSizer_Add_3 1250
+#define wxSizer_Add_2_3 1251
+#define wxSizer_Add_2_2 1252
+#define wxSizer_AddSpacer 1253
+#define wxSizer_AddStretchSpacer 1254
+#define wxSizer_CalcMin 1255
+#define wxSizer_Clear 1256
+#define wxSizer_Detach_1_2 1257
+#define wxSizer_Detach_1_1 1258
+#define wxSizer_Detach_1_0 1259
+#define wxSizer_Fit 1260
+#define wxSizer_FitInside 1261
+#define wxSizer_GetChildren 1262
+#define wxSizer_GetItem_2_1 1263
+#define wxSizer_GetItem_2_0 1264
+#define wxSizer_GetItem_1 1265
+#define wxSizer_GetSize 1266
+#define wxSizer_GetPosition 1267
+#define wxSizer_GetMinSize 1268
+#define wxSizer_Hide_2_0 1269
+#define wxSizer_Hide_2_1 1270
+#define wxSizer_Hide_1 1271
+#define wxSizer_Insert_3_1 1272
+#define wxSizer_Insert_3_0 1273
+#define wxSizer_Insert_4 1274
+#define wxSizer_Insert_3_3 1275
+#define wxSizer_Insert_3_2 1276
+#define wxSizer_Insert_2 1277
+#define wxSizer_InsertSpacer 1278
+#define wxSizer_InsertStretchSpacer 1279
+#define wxSizer_IsShown_1_2 1280
+#define wxSizer_IsShown_1_1 1281
+#define wxSizer_IsShown_1_0 1282
+#define wxSizer_Layout 1283
+#define wxSizer_Prepend_2_1 1284
+#define wxSizer_Prepend_2_0 1285
+#define wxSizer_Prepend_3 1286
+#define wxSizer_Prepend_2_3 1287
+#define wxSizer_Prepend_2_2 1288
+#define wxSizer_Prepend_1 1289
+#define wxSizer_PrependSpacer 1290
+#define wxSizer_PrependStretchSpacer 1291
+#define wxSizer_RecalcSizes 1292
+#define wxSizer_Remove_1_1 1293
+#define wxSizer_Remove_1_0 1294
+#define wxSizer_Replace_3_1 1295
+#define wxSizer_Replace_3_0 1296
+#define wxSizer_Replace_2 1297
+#define wxSizer_SetDimension 1298
+#define wxSizer_SetMinSize_2 1299
+#define wxSizer_SetMinSize_1 1300
+#define wxSizer_SetItemMinSize_3_2 1301
+#define wxSizer_SetItemMinSize_2_2 1302
+#define wxSizer_SetItemMinSize_3_1 1303
+#define wxSizer_SetItemMinSize_2_1 1304
+#define wxSizer_SetItemMinSize_3_0 1305
+#define wxSizer_SetItemMinSize_2_0 1306
+#define wxSizer_SetSizeHints 1307
+#define wxSizer_SetVirtualSizeHints 1308
+#define wxSizer_Show_2_2 1309
+#define wxSizer_Show_2_1 1310
+#define wxSizer_Show_2_0 1311
+#define wxSizer_Show_1 1312
+#define wxSizerFlags_new 1313
+#define wxSizerFlags_Align 1314
+#define wxSizerFlags_Border_2 1315
+#define wxSizerFlags_Border_1 1316
+#define wxSizerFlags_Center 1317
+#define wxSizerFlags_Centre 1318
+#define wxSizerFlags_Expand 1319
+#define wxSizerFlags_Left 1320
+#define wxSizerFlags_Proportion 1321
+#define wxSizerFlags_Right 1322
+#define wxSizerFlags_destroy 1323
+#define wxSizerItem_new_5_1 1324
+#define wxSizerItem_new_2_1 1325
+#define wxSizerItem_new_5_0 1326
+#define wxSizerItem_new_2_0 1327
+#define wxSizerItem_new_6 1328
+#define wxSizerItem_new_3 1329
+#define wxSizerItem_new_0 1330
+#define wxSizerItem_destruct 1331
+#define wxSizerItem_CalcMin 1332
+#define wxSizerItem_DeleteWindows 1333
+#define wxSizerItem_DetachSizer 1334
+#define wxSizerItem_GetBorder 1335
+#define wxSizerItem_GetFlag 1336
+#define wxSizerItem_GetMinSize 1337
+#define wxSizerItem_GetPosition 1338
+#define wxSizerItem_GetProportion 1339
+#define wxSizerItem_GetRatio 1340
+#define wxSizerItem_GetRect 1341
+#define wxSizerItem_GetSize 1342
+#define wxSizerItem_GetSizer 1343
+#define wxSizerItem_GetSpacer 1344
+#define wxSizerItem_GetUserData 1345
+#define wxSizerItem_GetWindow 1346
+#define wxSizerItem_IsSizer 1347
+#define wxSizerItem_IsShown 1348
+#define wxSizerItem_IsSpacer 1349
+#define wxSizerItem_IsWindow 1350
+#define wxSizerItem_SetBorder 1351
+#define wxSizerItem_SetDimension 1352
+#define wxSizerItem_SetFlag 1353
+#define wxSizerItem_SetInitSize 1354
+#define wxSizerItem_SetMinSize_1 1355
+#define wxSizerItem_SetMinSize_2 1356
+#define wxSizerItem_SetProportion 1357
+#define wxSizerItem_SetRatio_2 1358
+#define wxSizerItem_SetRatio_1_1 1359
+#define wxSizerItem_SetRatio_1_0 1360
+#define wxSizerItem_SetSizer 1361
+#define wxSizerItem_SetSpacer_1 1362
+#define wxSizerItem_SetSpacer_2 1363
+#define wxSizerItem_SetWindow 1364
+#define wxSizerItem_Show 1365
+#define wxBoxSizer_new 1366
+#define wxBoxSizer_GetOrientation 1367
+#define wxBoxSizer_destroy 1368
+#define wxStaticBoxSizer_new_2 1369
+#define wxStaticBoxSizer_new_3 1370
+#define wxStaticBoxSizer_GetStaticBox 1371
+#define wxStaticBoxSizer_destroy 1372
+#define wxGridSizer_new_4 1373
+#define wxGridSizer_new_2 1374
+#define wxGridSizer_GetCols 1375
+#define wxGridSizer_GetHGap 1376
+#define wxGridSizer_GetRows 1377
+#define wxGridSizer_GetVGap 1378
+#define wxGridSizer_SetCols 1379
+#define wxGridSizer_SetHGap 1380
+#define wxGridSizer_SetRows 1381
+#define wxGridSizer_SetVGap 1382
+#define wxGridSizer_destroy 1383
+#define wxFlexGridSizer_new_4 1384
+#define wxFlexGridSizer_new_2 1385
+#define wxFlexGridSizer_AddGrowableCol 1386
+#define wxFlexGridSizer_AddGrowableRow 1387
+#define wxFlexGridSizer_GetFlexibleDirection 1388
+#define wxFlexGridSizer_GetNonFlexibleGrowMode 1389
+#define wxFlexGridSizer_RemoveGrowableCol 1390
+#define wxFlexGridSizer_RemoveGrowableRow 1391
+#define wxFlexGridSizer_SetFlexibleDirection 1392
+#define wxFlexGridSizer_SetNonFlexibleGrowMode 1393
+#define wxFlexGridSizer_destroy 1394
+#define wxGridBagSizer_new 1395
+#define wxGridBagSizer_Add_3_2 1396
+#define wxGridBagSizer_Add_3_1 1397
+#define wxGridBagSizer_Add_4 1398
+#define wxGridBagSizer_Add_1_0 1399
+#define wxGridBagSizer_Add_2_1 1400
+#define wxGridBagSizer_Add_2_0 1401
+#define wxGridBagSizer_Add_3_0 1402
+#define wxGridBagSizer_Add_1_1 1403
+#define wxGridBagSizer_CalcMin 1404
+#define wxGridBagSizer_CheckForIntersection_2 1405
+#define wxGridBagSizer_CheckForIntersection_3 1406
+#define wxGridBagSizer_FindItem_1_1 1407
+#define wxGridBagSizer_FindItem_1_0 1408
+#define wxGridBagSizer_FindItemAtPoint 1409
+#define wxGridBagSizer_FindItemAtPosition 1410
+#define wxGridBagSizer_FindItemWithData 1411
+#define wxGridBagSizer_GetCellSize 1412
+#define wxGridBagSizer_GetEmptyCellSize 1413
+#define wxGridBagSizer_GetItemPosition_1_2 1414
+#define wxGridBagSizer_GetItemPosition_1_1 1415
+#define wxGridBagSizer_GetItemPosition_1_0 1416
+#define wxGridBagSizer_GetItemSpan_1_2 1417
+#define wxGridBagSizer_GetItemSpan_1_1 1418
+#define wxGridBagSizer_GetItemSpan_1_0 1419
+#define wxGridBagSizer_SetEmptyCellSize 1420
+#define wxGridBagSizer_SetItemPosition_2_2 1421
+#define wxGridBagSizer_SetItemPosition_2_1 1422
+#define wxGridBagSizer_SetItemPosition_2_0 1423
+#define wxGridBagSizer_SetItemSpan_2_2 1424
+#define wxGridBagSizer_SetItemSpan_2_1 1425
+#define wxGridBagSizer_SetItemSpan_2_0 1426
+#define wxGridBagSizer_destroy 1427
+#define wxStdDialogButtonSizer_new 1428
+#define wxStdDialogButtonSizer_AddButton 1429
+#define wxStdDialogButtonSizer_Realize 1430
+#define wxStdDialogButtonSizer_SetAffirmativeButton 1431
+#define wxStdDialogButtonSizer_SetCancelButton 1432
+#define wxStdDialogButtonSizer_SetNegativeButton 1433
+#define wxStdDialogButtonSizer_destroy 1434
+#define wxFont_new_0 1435
+#define wxFont_new_1 1436
+#define wxFont_new_5 1437
+#define wxFont_destruct 1439
+#define wxFont_IsFixedWidth 1440
+#define wxFont_GetDefaultEncoding 1441
+#define wxFont_GetFaceName 1442
+#define wxFont_GetFamily 1443
+#define wxFont_GetNativeFontInfoDesc 1444
+#define wxFont_GetNativeFontInfoUserDesc 1445
+#define wxFont_GetPointSize 1446
+#define wxFont_GetStyle 1447
+#define wxFont_GetUnderlined 1448
+#define wxFont_GetWeight 1449
+#define wxFont_Ok 1450
+#define wxFont_SetDefaultEncoding 1451
+#define wxFont_SetFaceName 1452
+#define wxFont_SetFamily 1453
+#define wxFont_SetPointSize 1454
+#define wxFont_SetStyle 1455
+#define wxFont_SetUnderlined 1456
+#define wxFont_SetWeight 1457
+#define wxToolTip_Enable 1458
+#define wxToolTip_SetDelay 1459
+#define wxToolTip_new 1460
+#define wxToolTip_SetTip 1461
+#define wxToolTip_GetTip 1462
+#define wxToolTip_GetWindow 1463
+#define wxToolTip_destroy 1464
+#define wxButton_new_3 1466
+#define wxButton_new_0 1467
+#define wxButton_destruct 1468
+#define wxButton_Create 1469
+#define wxButton_GetDefaultSize 1470
+#define wxButton_SetDefault 1471
+#define wxButton_SetLabel 1472
+#define wxBitmapButton_new_4 1474
+#define wxBitmapButton_new_0 1475
+#define wxBitmapButton_Create 1476
+#define wxBitmapButton_GetBitmapDisabled 1477
+#define wxBitmapButton_GetBitmapFocus 1479
+#define wxBitmapButton_GetBitmapLabel 1481
+#define wxBitmapButton_GetBitmapSelected 1483
+#define wxBitmapButton_SetBitmapDisabled 1485
+#define wxBitmapButton_SetBitmapFocus 1486
+#define wxBitmapButton_SetBitmapLabel 1487
+#define wxBitmapButton_SetBitmapSelected 1488
+#define wxBitmapButton_destroy 1489
+#define wxToggleButton_new_0 1490
+#define wxToggleButton_new_4 1491
+#define wxToggleButton_Create 1492
+#define wxToggleButton_GetValue 1493
+#define wxToggleButton_SetValue 1494
+#define wxToggleButton_destroy 1495
+#define wxCalendarCtrl_new_0 1496
+#define wxCalendarCtrl_new_3 1497
+#define wxCalendarCtrl_Create 1498
+#define wxCalendarCtrl_destruct 1499
+#define wxCalendarCtrl_SetDate 1500
+#define wxCalendarCtrl_GetDate 1501
+#define wxCalendarCtrl_EnableYearChange 1502
+#define wxCalendarCtrl_EnableMonthChange 1503
+#define wxCalendarCtrl_EnableHolidayDisplay 1504
+#define wxCalendarCtrl_SetHeaderColours 1505
+#define wxCalendarCtrl_GetHeaderColourFg 1506
+#define wxCalendarCtrl_GetHeaderColourBg 1507
+#define wxCalendarCtrl_SetHighlightColours 1508
+#define wxCalendarCtrl_GetHighlightColourFg 1509
+#define wxCalendarCtrl_GetHighlightColourBg 1510
+#define wxCalendarCtrl_SetHolidayColours 1511
+#define wxCalendarCtrl_GetHolidayColourFg 1512
+#define wxCalendarCtrl_GetHolidayColourBg 1513
+#define wxCalendarCtrl_GetAttr 1514
+#define wxCalendarCtrl_SetAttr 1515
+#define wxCalendarCtrl_SetHoliday 1516
+#define wxCalendarCtrl_ResetAttr 1517
+#define wxCalendarCtrl_HitTest 1518
+#define wxCalendarDateAttr_new_0 1519
+#define wxCalendarDateAttr_new_2_1 1520
+#define wxCalendarDateAttr_new_2_0 1521
+#define wxCalendarDateAttr_SetTextColour 1522
+#define wxCalendarDateAttr_SetBackgroundColour 1523
+#define wxCalendarDateAttr_SetBorderColour 1524
+#define wxCalendarDateAttr_SetFont 1525
+#define wxCalendarDateAttr_SetBorder 1526
+#define wxCalendarDateAttr_SetHoliday 1527
+#define wxCalendarDateAttr_HasTextColour 1528
+#define wxCalendarDateAttr_HasBackgroundColour 1529
+#define wxCalendarDateAttr_HasBorderColour 1530
+#define wxCalendarDateAttr_HasFont 1531
+#define wxCalendarDateAttr_HasBorder 1532
+#define wxCalendarDateAttr_IsHoliday 1533
+#define wxCalendarDateAttr_GetTextColour 1534
+#define wxCalendarDateAttr_GetBackgroundColour 1535
+#define wxCalendarDateAttr_GetBorderColour 1536
+#define wxCalendarDateAttr_GetFont 1537
+#define wxCalendarDateAttr_GetBorder 1538
+#define wxCalendarDateAttr_destroy 1539
+#define wxCheckBox_new_4 1541
+#define wxCheckBox_new_0 1542
+#define wxCheckBox_Create 1543
+#define wxCheckBox_GetValue 1544
+#define wxCheckBox_Get3StateValue 1545
+#define wxCheckBox_Is3rdStateAllowedForUser 1546
+#define wxCheckBox_Is3State 1547
+#define wxCheckBox_IsChecked 1548
+#define wxCheckBox_SetValue 1549
+#define wxCheckBox_Set3StateValue 1550
+#define wxCheckBox_destroy 1551
+#define wxCheckListBox_new_0 1552
+#define wxCheckListBox_new_3 1554
+#define wxCheckListBox_Check 1555
+#define wxCheckListBox_IsChecked 1556
+#define wxCheckListBox_destroy 1557
+#define wxChoice_new_3 1560
+#define wxChoice_new_0 1561
+#define wxChoice_destruct 1563
+#define wxChoice_Create 1565
+#define wxChoice_Delete 1566
+#define wxChoice_GetColumns 1567
+#define wxChoice_SetColumns 1568
+#define wxComboBox_new_0 1569
+#define wxComboBox_new_3 1571
+#define wxComboBox_destruct 1572
+#define wxComboBox_Create 1574
+#define wxComboBox_CanCopy 1575
+#define wxComboBox_CanCut 1576
+#define wxComboBox_CanPaste 1577
+#define wxComboBox_CanRedo 1578
+#define wxComboBox_CanUndo 1579
+#define wxComboBox_Copy 1580
+#define wxComboBox_Cut 1581
+#define wxComboBox_GetInsertionPoint 1582
+#define wxComboBox_GetLastPosition 1583
+#define wxComboBox_GetValue 1584
+#define wxComboBox_Paste 1585
+#define wxComboBox_Redo 1586
+#define wxComboBox_Replace 1587
+#define wxComboBox_Remove 1588
+#define wxComboBox_SetInsertionPoint 1589
+#define wxComboBox_SetInsertionPointEnd 1590
+#define wxComboBox_SetSelection_1 1591
+#define wxComboBox_SetSelection_2 1592
+#define wxComboBox_SetValue 1593
+#define wxComboBox_Undo 1594
+#define wxGauge_new_0 1595
+#define wxGauge_new_4 1596
+#define wxGauge_Create 1597
+#define wxGauge_GetBezelFace 1598
+#define wxGauge_GetRange 1599
+#define wxGauge_GetShadowWidth 1600
+#define wxGauge_GetValue 1601
+#define wxGauge_IsVertical 1602
+#define wxGauge_SetBezelFace 1603
+#define wxGauge_SetRange 1604
+#define wxGauge_SetShadowWidth 1605
+#define wxGauge_SetValue 1606
+#define wxGauge_Pulse 1607
+#define wxGauge_destroy 1608
+#define wxGenericDirCtrl_new_0 1609
+#define wxGenericDirCtrl_new_2 1610
+#define wxGenericDirCtrl_destruct 1611
+#define wxGenericDirCtrl_Create 1612
+#define wxGenericDirCtrl_Init 1613
+#define wxGenericDirCtrl_CollapseTree 1614
+#define wxGenericDirCtrl_ExpandPath 1615
+#define wxGenericDirCtrl_GetDefaultPath 1616
+#define wxGenericDirCtrl_GetPath 1617
+#define wxGenericDirCtrl_GetFilePath 1618
+#define wxGenericDirCtrl_GetFilter 1619
+#define wxGenericDirCtrl_GetFilterIndex 1620
+#define wxGenericDirCtrl_GetRootId 1621
+#define wxGenericDirCtrl_GetTreeCtrl 1622
+#define wxGenericDirCtrl_ReCreateTree 1623
+#define wxGenericDirCtrl_SetDefaultPath 1624
+#define wxGenericDirCtrl_SetFilter 1625
+#define wxGenericDirCtrl_SetFilterIndex 1626
+#define wxGenericDirCtrl_SetPath 1627
+#define wxStaticBox_new_4 1629
+#define wxStaticBox_new_0 1630
+#define wxStaticBox_Create 1631
+#define wxStaticBox_destroy 1632
+#define wxStaticLine_new_2 1634
+#define wxStaticLine_new_0 1635
+#define wxStaticLine_Create 1636
+#define wxStaticLine_IsVertical 1637
+#define wxStaticLine_GetDefaultSize 1638
+#define wxStaticLine_destroy 1639
+#define wxListBox_new_3 1642
+#define wxListBox_new_0 1643
+#define wxListBox_destruct 1645
+#define wxListBox_Create 1647
+#define wxListBox_Deselect 1648
+#define wxListBox_GetSelections 1649
+#define wxListBox_InsertItems 1650
+#define wxListBox_IsSelected 1651
+#define wxListBox_Set 1653
+#define wxListBox_HitTest 1654
+#define wxListBox_SetFirstItem_1_0 1655
+#define wxListBox_SetFirstItem_1_1 1656
+#define wxListCtrl_new_0 1657
+#define wxListCtrl_new_2 1658
+#define wxListCtrl_Arrange 1659
+#define wxListCtrl_AssignImageList 1660
+#define wxListCtrl_ClearAll 1661
+#define wxListCtrl_Create 1662
+#define wxListCtrl_DeleteAllItems 1663
+#define wxListCtrl_DeleteColumn 1664
+#define wxListCtrl_DeleteItem 1665
+#define wxListCtrl_EditLabel 1666
+#define wxListCtrl_EnsureVisible 1667
+#define wxListCtrl_FindItem_3_0 1668
+#define wxListCtrl_FindItem_3_1 1669
+#define wxListCtrl_GetColumn 1670
+#define wxListCtrl_GetColumnCount 1671
+#define wxListCtrl_GetColumnWidth 1672
+#define wxListCtrl_GetCountPerPage 1673
+#define wxListCtrl_GetEditControl 1674
+#define wxListCtrl_GetImageList 1675
+#define wxListCtrl_GetItem 1676
+#define wxListCtrl_GetItemBackgroundColour 1677
+#define wxListCtrl_GetItemCount 1678
+#define wxListCtrl_GetItemData 1679
+#define wxListCtrl_GetItemFont 1680
+#define wxListCtrl_GetItemPosition 1681
+#define wxListCtrl_GetItemRect 1682
+#define wxListCtrl_GetItemSpacing 1683
+#define wxListCtrl_GetItemState 1684
+#define wxListCtrl_GetItemText 1685
+#define wxListCtrl_GetItemTextColour 1686
+#define wxListCtrl_GetNextItem 1687
+#define wxListCtrl_GetSelectedItemCount 1688
+#define wxListCtrl_GetTextColour 1689
+#define wxListCtrl_GetTopItem 1690
+#define wxListCtrl_GetViewRect 1691
+#define wxListCtrl_HitTest 1692
+#define wxListCtrl_InsertColumn_2 1693
+#define wxListCtrl_InsertColumn_3 1694
+#define wxListCtrl_InsertItem_1 1695
+#define wxListCtrl_InsertItem_2_1 1696
+#define wxListCtrl_InsertItem_2_0 1697
+#define wxListCtrl_InsertItem_3 1698
+#define wxListCtrl_RefreshItem 1699
+#define wxListCtrl_RefreshItems 1700
+#define wxListCtrl_ScrollList 1701
+#define wxListCtrl_SetBackgroundColour 1702
+#define wxListCtrl_SetColumn 1703
+#define wxListCtrl_SetColumnWidth 1704
+#define wxListCtrl_SetImageList 1705
+#define wxListCtrl_SetItem_1 1706
+#define wxListCtrl_SetItem_4 1707
+#define wxListCtrl_SetItemBackgroundColour 1708
+#define wxListCtrl_SetItemCount 1709
+#define wxListCtrl_SetItemData 1710
+#define wxListCtrl_SetItemFont 1711
+#define wxListCtrl_SetItemImage 1712
+#define wxListCtrl_SetItemColumnImage 1713
+#define wxListCtrl_SetItemPosition 1714
+#define wxListCtrl_SetItemState 1715
+#define wxListCtrl_SetItemText 1716
+#define wxListCtrl_SetItemTextColour 1717
+#define wxListCtrl_SetSingleStyle 1718
+#define wxListCtrl_SetTextColour 1719
+#define wxListCtrl_SetWindowStyleFlag 1720
+#define wxListCtrl_SortItems 1721
+#define wxListCtrl_destroy 1722
+#define wxListView_ClearColumnImage 1723
+#define wxListView_Focus 1724
+#define wxListView_GetFirstSelected 1725
+#define wxListView_GetFocusedItem 1726
+#define wxListView_GetNextSelected 1727
+#define wxListView_IsSelected 1728
+#define wxListView_Select 1729
+#define wxListView_SetColumnImage 1730
+#define wxListItem_new_0 1731
+#define wxListItem_new_1 1732
+#define wxListItem_destruct 1733
+#define wxListItem_Clear 1734
+#define wxListItem_GetAlign 1735
+#define wxListItem_GetBackgroundColour 1736
+#define wxListItem_GetColumn 1737
+#define wxListItem_GetFont 1738
+#define wxListItem_GetId 1739
+#define wxListItem_GetImage 1740
+#define wxListItem_GetMask 1741
+#define wxListItem_GetState 1742
+#define wxListItem_GetText 1743
+#define wxListItem_GetTextColour 1744
+#define wxListItem_GetWidth 1745
+#define wxListItem_SetAlign 1746
+#define wxListItem_SetBackgroundColour 1747
+#define wxListItem_SetColumn 1748
+#define wxListItem_SetFont 1749
+#define wxListItem_SetId 1750
+#define wxListItem_SetImage 1751
+#define wxListItem_SetMask 1752
+#define wxListItem_SetState 1753
+#define wxListItem_SetStateMask 1754
+#define wxListItem_SetText 1755
+#define wxListItem_SetTextColour 1756
+#define wxListItem_SetWidth 1757
+#define wxListItemAttr_new_0 1758
+#define wxListItemAttr_new_3 1759
+#define wxListItemAttr_GetBackgroundColour 1760
+#define wxListItemAttr_GetFont 1761
+#define wxListItemAttr_GetTextColour 1762
+#define wxListItemAttr_HasBackgroundColour 1763
+#define wxListItemAttr_HasFont 1764
+#define wxListItemAttr_HasTextColour 1765
+#define wxListItemAttr_SetBackgroundColour 1766
+#define wxListItemAttr_SetFont 1767
+#define wxListItemAttr_SetTextColour 1768
+#define wxListItemAttr_destroy 1769
+#define wxImageList_new_0 1770
+#define wxImageList_new_3 1771
+#define wxImageList_Add_1 1772
+#define wxImageList_Add_2_0 1773
+#define wxImageList_Add_2_1 1774
+#define wxImageList_Create 1775
+#define wxImageList_Draw 1777
+#define wxImageList_GetBitmap 1778
+#define wxImageList_GetIcon 1779
+#define wxImageList_GetImageCount 1780
+#define wxImageList_GetSize 1781
+#define wxImageList_Remove 1782
+#define wxImageList_RemoveAll 1783
+#define wxImageList_Replace_2 1784
+#define wxImageList_Replace_3 1785
+#define wxImageList_destroy 1786
+#define wxTextAttr_new_0 1787
+#define wxTextAttr_new_2 1788
+#define wxTextAttr_GetAlignment 1789
+#define wxTextAttr_GetBackgroundColour 1790
+#define wxTextAttr_GetFont 1791
+#define wxTextAttr_GetLeftIndent 1792
+#define wxTextAttr_GetLeftSubIndent 1793
+#define wxTextAttr_GetRightIndent 1794
+#define wxTextAttr_GetTabs 1795
+#define wxTextAttr_GetTextColour 1796
+#define wxTextAttr_HasBackgroundColour 1797
+#define wxTextAttr_HasFont 1798
+#define wxTextAttr_HasTextColour 1799
+#define wxTextAttr_GetFlags 1800
+#define wxTextAttr_IsDefault 1801
+#define wxTextAttr_SetAlignment 1802
+#define wxTextAttr_SetBackgroundColour 1803
+#define wxTextAttr_SetFlags 1804
+#define wxTextAttr_SetFont 1805
+#define wxTextAttr_SetLeftIndent 1806
+#define wxTextAttr_SetRightIndent 1807
+#define wxTextAttr_SetTabs 1808
+#define wxTextAttr_SetTextColour 1809
+#define wxTextAttr_destroy 1810
+#define wxTextCtrl_new_3 1812
+#define wxTextCtrl_new_0 1813
+#define wxTextCtrl_destruct 1815
+#define wxTextCtrl_AppendText 1816
+#define wxTextCtrl_CanCopy 1817
+#define wxTextCtrl_CanCut 1818
+#define wxTextCtrl_CanPaste 1819
+#define wxTextCtrl_CanRedo 1820
+#define wxTextCtrl_CanUndo 1821
+#define wxTextCtrl_Clear 1822
+#define wxTextCtrl_Copy 1823
+#define wxTextCtrl_Create 1824
+#define wxTextCtrl_Cut 1825
+#define wxTextCtrl_DiscardEdits 1826
+#define wxTextCtrl_EmulateKeyPress 1827
+#define wxTextCtrl_GetDefaultStyle 1828
+#define wxTextCtrl_GetInsertionPoint 1829
+#define wxTextCtrl_GetLastPosition 1830
+#define wxTextCtrl_GetLineLength 1831
+#define wxTextCtrl_GetLineText 1832
+#define wxTextCtrl_GetNumberOfLines 1833
+#define wxTextCtrl_GetRange 1834
+#define wxTextCtrl_GetSelection 1835
+#define wxTextCtrl_GetStringSelection 1836
+#define wxTextCtrl_GetStyle 1837
+#define wxTextCtrl_GetValue 1838
+#define wxTextCtrl_IsEditable 1839
+#define wxTextCtrl_IsModified 1840
+#define wxTextCtrl_IsMultiLine 1841
+#define wxTextCtrl_IsSingleLine 1842
+#define wxTextCtrl_LoadFile 1843
+#define wxTextCtrl_MarkDirty 1844
+#define wxTextCtrl_Paste 1845
+#define wxTextCtrl_PositionToXY 1846
+#define wxTextCtrl_Redo 1847
+#define wxTextCtrl_Remove 1848
+#define wxTextCtrl_Replace 1849
+#define wxTextCtrl_SaveFile 1850
+#define wxTextCtrl_SetDefaultStyle 1851
+#define wxTextCtrl_SetEditable 1852
+#define wxTextCtrl_SetInsertionPoint 1853
+#define wxTextCtrl_SetInsertionPointEnd 1854
+#define wxTextCtrl_SetMaxLength 1856
+#define wxTextCtrl_SetSelection 1857
+#define wxTextCtrl_SetStyle 1858
+#define wxTextCtrl_SetValue 1859
+#define wxTextCtrl_ShowPosition 1860
+#define wxTextCtrl_Undo 1861
+#define wxTextCtrl_WriteText 1862
+#define wxTextCtrl_XYToPosition 1863
+#define wxNotebook_new_0 1866
+#define wxNotebook_new_3 1867
+#define wxNotebook_destruct 1868
+#define wxNotebook_AddPage 1869
+#define wxNotebook_AdvanceSelection 1870
+#define wxNotebook_AssignImageList 1871
+#define wxNotebook_Create 1872
+#define wxNotebook_DeleteAllPages 1873
+#define wxNotebook_DeletePage 1874
+#define wxNotebook_RemovePage 1875
+#define wxNotebook_GetCurrentPage 1876
+#define wxNotebook_GetImageList 1877
+#define wxNotebook_GetPage 1879
+#define wxNotebook_GetPageCount 1880
+#define wxNotebook_GetPageImage 1881
+#define wxNotebook_GetPageText 1882
+#define wxNotebook_GetRowCount 1883
+#define wxNotebook_GetSelection 1884
+#define wxNotebook_GetThemeBackgroundColour 1885
+#define wxNotebook_HitTest 1887
+#define wxNotebook_InsertPage 1889
+#define wxNotebook_SetImageList 1890
+#define wxNotebook_SetPadding 1891
+#define wxNotebook_SetPageSize 1892
+#define wxNotebook_SetPageImage 1893
+#define wxNotebook_SetPageText 1894
+#define wxNotebook_SetSelection 1895
+#define wxNotebook_ChangeSelection 1896
+#define wxChoicebook_new_0 1897
+#define wxChoicebook_new_3 1898
+#define wxChoicebook_AddPage 1899
+#define wxChoicebook_AdvanceSelection 1900
+#define wxChoicebook_AssignImageList 1901
+#define wxChoicebook_Create 1902
+#define wxChoicebook_DeleteAllPages 1903
+#define wxChoicebook_DeletePage 1904
+#define wxChoicebook_RemovePage 1905
+#define wxChoicebook_GetCurrentPage 1906
+#define wxChoicebook_GetImageList 1907
+#define wxChoicebook_GetPage 1909
+#define wxChoicebook_GetPageCount 1910
+#define wxChoicebook_GetPageImage 1911
+#define wxChoicebook_GetPageText 1912
+#define wxChoicebook_GetSelection 1913
+#define wxChoicebook_HitTest 1914
+#define wxChoicebook_InsertPage 1915
+#define wxChoicebook_SetImageList 1916
+#define wxChoicebook_SetPageSize 1917
+#define wxChoicebook_SetPageImage 1918
+#define wxChoicebook_SetPageText 1919
+#define wxChoicebook_SetSelection 1920
+#define wxChoicebook_ChangeSelection 1921
+#define wxChoicebook_destroy 1922
+#define wxToolbook_new_0 1923
+#define wxToolbook_new_3 1924
+#define wxToolbook_AddPage 1925
+#define wxToolbook_AdvanceSelection 1926
+#define wxToolbook_AssignImageList 1927
+#define wxToolbook_Create 1928
+#define wxToolbook_DeleteAllPages 1929
+#define wxToolbook_DeletePage 1930
+#define wxToolbook_RemovePage 1931
+#define wxToolbook_GetCurrentPage 1932
+#define wxToolbook_GetImageList 1933
+#define wxToolbook_GetPage 1935
+#define wxToolbook_GetPageCount 1936
+#define wxToolbook_GetPageImage 1937
+#define wxToolbook_GetPageText 1938
+#define wxToolbook_GetSelection 1939
+#define wxToolbook_HitTest 1941
+#define wxToolbook_InsertPage 1942
+#define wxToolbook_SetImageList 1943
+#define wxToolbook_SetPageSize 1944
+#define wxToolbook_SetPageImage 1945
+#define wxToolbook_SetPageText 1946
+#define wxToolbook_SetSelection 1947
+#define wxToolbook_ChangeSelection 1948
+#define wxToolbook_destroy 1949
+#define wxListbook_new_0 1950
+#define wxListbook_new_3 1951
+#define wxListbook_AddPage 1952
+#define wxListbook_AdvanceSelection 1953
+#define wxListbook_AssignImageList 1954
+#define wxListbook_Create 1955
+#define wxListbook_DeleteAllPages 1956
+#define wxListbook_DeletePage 1957
+#define wxListbook_RemovePage 1958
+#define wxListbook_GetCurrentPage 1959
+#define wxListbook_GetImageList 1960
+#define wxListbook_GetPage 1962
+#define wxListbook_GetPageCount 1963
+#define wxListbook_GetPageImage 1964
+#define wxListbook_GetPageText 1965
+#define wxListbook_GetSelection 1966
+#define wxListbook_HitTest 1968
+#define wxListbook_InsertPage 1969
+#define wxListbook_SetImageList 1970
+#define wxListbook_SetPageSize 1971
+#define wxListbook_SetPageImage 1972
+#define wxListbook_SetPageText 1973
+#define wxListbook_SetSelection 1974
+#define wxListbook_ChangeSelection 1975
+#define wxListbook_destroy 1976
+#define wxTreebook_new_0 1977
+#define wxTreebook_new_3 1978
+#define wxTreebook_AddPage 1979
+#define wxTreebook_AdvanceSelection 1980
+#define wxTreebook_AssignImageList 1981
+#define wxTreebook_Create 1982
+#define wxTreebook_DeleteAllPages 1983
+#define wxTreebook_DeletePage 1984
+#define wxTreebook_RemovePage 1985
+#define wxTreebook_GetCurrentPage 1986
+#define wxTreebook_GetImageList 1987
+#define wxTreebook_GetPage 1989
+#define wxTreebook_GetPageCount 1990
+#define wxTreebook_GetPageImage 1991
+#define wxTreebook_GetPageText 1992
+#define wxTreebook_GetSelection 1993
+#define wxTreebook_ExpandNode 1994
+#define wxTreebook_IsNodeExpanded 1995
+#define wxTreebook_HitTest 1997
+#define wxTreebook_InsertPage 1998
+#define wxTreebook_InsertSubPage 1999
+#define wxTreebook_SetImageList 2000
+#define wxTreebook_SetPageSize 2001
+#define wxTreebook_SetPageImage 2002
+#define wxTreebook_SetPageText 2003
+#define wxTreebook_SetSelection 2004
+#define wxTreebook_ChangeSelection 2005
+#define wxTreebook_destroy 2006
+#define wxTreeCtrl_new_2 2009
+#define wxTreeCtrl_new_0 2010
+#define wxTreeCtrl_destruct 2012
+#define wxTreeCtrl_AddRoot 2013
+#define wxTreeCtrl_AppendItem 2014
+#define wxTreeCtrl_AssignImageList 2015
+#define wxTreeCtrl_AssignStateImageList 2016
+#define wxTreeCtrl_Collapse 2017
+#define wxTreeCtrl_CollapseAndReset 2018
+#define wxTreeCtrl_Create 2019
+#define wxTreeCtrl_Delete 2020
+#define wxTreeCtrl_DeleteAllItems 2021
+#define wxTreeCtrl_DeleteChildren 2022
+#define wxTreeCtrl_EditLabel 2023
+#define wxTreeCtrl_EnsureVisible 2024
+#define wxTreeCtrl_Expand 2025
+#define wxTreeCtrl_GetBoundingRect 2026
+#define wxTreeCtrl_GetChildrenCount 2028
+#define wxTreeCtrl_GetCount 2029
+#define wxTreeCtrl_GetEditControl 2030
+#define wxTreeCtrl_GetFirstChild 2031
+#define wxTreeCtrl_GetNextChild 2032
+#define wxTreeCtrl_GetFirstVisibleItem 2033
+#define wxTreeCtrl_GetImageList 2034
+#define wxTreeCtrl_GetIndent 2035
+#define wxTreeCtrl_GetItemBackgroundColour 2036
+#define wxTreeCtrl_GetItemData 2037
+#define wxTreeCtrl_GetItemFont 2038
+#define wxTreeCtrl_GetItemImage_1 2039
+#define wxTreeCtrl_GetItemImage_2 2040
+#define wxTreeCtrl_GetItemText 2041
+#define wxTreeCtrl_GetItemTextColour 2042
+#define wxTreeCtrl_GetLastChild 2043
+#define wxTreeCtrl_GetNextSibling 2044
+#define wxTreeCtrl_GetNextVisible 2045
+#define wxTreeCtrl_GetItemParent 2046
+#define wxTreeCtrl_GetPrevSibling 2047
+#define wxTreeCtrl_GetPrevVisible 2048
+#define wxTreeCtrl_GetRootItem 2049
+#define wxTreeCtrl_GetSelection 2050
+#define wxTreeCtrl_GetSelections 2051
+#define wxTreeCtrl_GetStateImageList 2052
+#define wxTreeCtrl_HitTest 2053
+#define wxTreeCtrl_InsertItem 2055
+#define wxTreeCtrl_IsBold 2056
+#define wxTreeCtrl_IsExpanded 2057
+#define wxTreeCtrl_IsSelected 2058
+#define wxTreeCtrl_IsVisible 2059
+#define wxTreeCtrl_ItemHasChildren 2060
+#define wxTreeCtrl_PrependItem 2061
+#define wxTreeCtrl_ScrollTo 2062
+#define wxTreeCtrl_SelectItem_1 2063
+#define wxTreeCtrl_SelectItem_2 2064
+#define wxTreeCtrl_SetIndent 2065
+#define wxTreeCtrl_SetImageList 2066
+#define wxTreeCtrl_SetItemBackgroundColour 2067
+#define wxTreeCtrl_SetItemBold 2068
+#define wxTreeCtrl_SetItemData 2069
+#define wxTreeCtrl_SetItemDropHighlight 2070
+#define wxTreeCtrl_SetItemFont 2071
+#define wxTreeCtrl_SetItemHasChildren 2072
+#define wxTreeCtrl_SetItemImage_2 2073
+#define wxTreeCtrl_SetItemImage_3 2074
+#define wxTreeCtrl_SetItemText 2075
+#define wxTreeCtrl_SetItemTextColour 2076
+#define wxTreeCtrl_SetStateImageList 2077
+#define wxTreeCtrl_SetWindowStyle 2078
+#define wxTreeCtrl_SortChildren 2079
+#define wxTreeCtrl_Toggle 2080
+#define wxTreeCtrl_ToggleItemSelection 2081
+#define wxTreeCtrl_Unselect 2082
+#define wxTreeCtrl_UnselectAll 2083
+#define wxTreeCtrl_UnselectItem 2084
+#define wxScrollBar_new_0 2085
+#define wxScrollBar_new_3 2086
+#define wxScrollBar_destruct 2087
+#define wxScrollBar_Create 2088
+#define wxScrollBar_GetRange 2089
+#define wxScrollBar_GetPageSize 2090
+#define wxScrollBar_GetThumbPosition 2091
+#define wxScrollBar_GetThumbSize 2092
+#define wxScrollBar_SetThumbPosition 2093
+#define wxScrollBar_SetScrollbar 2094
+#define wxSpinButton_new_2 2096
+#define wxSpinButton_new_0 2097
+#define wxSpinButton_Create 2098
+#define wxSpinButton_GetMax 2099
+#define wxSpinButton_GetMin 2100
+#define wxSpinButton_GetValue 2101
+#define wxSpinButton_SetRange 2102
+#define wxSpinButton_SetValue 2103
+#define wxSpinButton_destroy 2104
+#define wxSpinCtrl_new_0 2105
+#define wxSpinCtrl_new_2 2106
+#define wxSpinCtrl_Create 2108
+#define wxSpinCtrl_SetValue_1_1 2111
+#define wxSpinCtrl_SetValue_1_0 2112
+#define wxSpinCtrl_GetValue 2114
+#define wxSpinCtrl_SetRange 2116
+#define wxSpinCtrl_SetSelection 2117
+#define wxSpinCtrl_GetMin 2119
+#define wxSpinCtrl_GetMax 2121
+#define wxSpinCtrl_destroy 2122
+#define wxStaticText_new_0 2123
+#define wxStaticText_new_4 2124
+#define wxStaticText_Create 2125
+#define wxStaticText_GetLabel 2126
+#define wxStaticText_SetLabel 2127
+#define wxStaticText_Wrap 2128
+#define wxStaticText_destroy 2129
+#define wxStaticBitmap_new_0 2130
+#define wxStaticBitmap_new_4 2131
+#define wxStaticBitmap_Create 2132
+#define wxStaticBitmap_GetBitmap 2133
+#define wxStaticBitmap_SetBitmap 2134
+#define wxStaticBitmap_destroy 2135
+#define wxRadioBox_new 2136
+#define wxRadioBox_destruct 2138
+#define wxRadioBox_Create 2139
+#define wxRadioBox_Enable_2 2140
+#define wxRadioBox_Enable_1 2141
+#define wxRadioBox_GetSelection 2142
+#define wxRadioBox_GetString 2143
+#define wxRadioBox_SetSelection 2144
+#define wxRadioBox_Show_2 2145
+#define wxRadioBox_Show_1 2146
+#define wxRadioBox_GetColumnCount 2147
+#define wxRadioBox_GetItemHelpText 2148
+#define wxRadioBox_GetItemToolTip 2149
+#define wxRadioBox_GetItemFromPoint 2151
+#define wxRadioBox_GetRowCount 2152
+#define wxRadioBox_IsItemEnabled 2153
+#define wxRadioBox_IsItemShown 2154
+#define wxRadioBox_SetItemHelpText 2155
+#define wxRadioBox_SetItemToolTip 2156
+#define wxRadioButton_new_0 2157
+#define wxRadioButton_new_4 2158
+#define wxRadioButton_Create 2159
+#define wxRadioButton_GetValue 2160
+#define wxRadioButton_SetValue 2161
+#define wxRadioButton_destroy 2162
+#define wxSlider_new_6 2164
+#define wxSlider_new_0 2165
+#define wxSlider_Create 2166
+#define wxSlider_GetLineSize 2167
+#define wxSlider_GetMax 2168
+#define wxSlider_GetMin 2169
+#define wxSlider_GetPageSize 2170
+#define wxSlider_GetThumbLength 2171
+#define wxSlider_GetValue 2172
+#define wxSlider_SetLineSize 2173
+#define wxSlider_SetPageSize 2174
+#define wxSlider_SetRange 2175
+#define wxSlider_SetThumbLength 2176
+#define wxSlider_SetValue 2177
+#define wxSlider_destroy 2178
+#define wxDialog_new_4 2180
+#define wxDialog_new_0 2181
+#define wxDialog_destruct 2183
+#define wxDialog_Create 2184
+#define wxDialog_CreateButtonSizer 2185
+#define wxDialog_CreateStdDialogButtonSizer 2186
+#define wxDialog_EndModal 2187
+#define wxDialog_GetAffirmativeId 2188
+#define wxDialog_GetReturnCode 2189
+#define wxDialog_IsModal 2190
+#define wxDialog_SetAffirmativeId 2191
+#define wxDialog_SetReturnCode 2192
+#define wxDialog_Show 2193
+#define wxDialog_ShowModal 2194
+#define wxColourDialog_new_0 2195
+#define wxColourDialog_new_2 2196
+#define wxColourDialog_destruct 2197
+#define wxColourDialog_Create 2198
+#define wxColourDialog_GetColourData 2199
+#define wxColourData_new_0 2200
+#define wxColourData_new_1 2201
+#define wxColourData_destruct 2202
+#define wxColourData_GetChooseFull 2203
+#define wxColourData_GetColour 2204
+#define wxColourData_GetCustomColour 2206
+#define wxColourData_SetChooseFull 2207
+#define wxColourData_SetColour 2208
+#define wxColourData_SetCustomColour 2209
+#define wxPalette_new_0 2210
+#define wxPalette_new_4 2211
+#define wxPalette_destruct 2213
+#define wxPalette_Create 2214
+#define wxPalette_GetColoursCount 2215
+#define wxPalette_GetPixel 2216
+#define wxPalette_GetRGB 2217
+#define wxPalette_IsOk 2218
+#define wxDirDialog_new 2222
+#define wxDirDialog_destruct 2223
+#define wxDirDialog_GetPath 2224
+#define wxDirDialog_GetMessage 2225
+#define wxDirDialog_SetMessage 2226
+#define wxDirDialog_SetPath 2227
+#define wxFileDialog_new 2231
+#define wxFileDialog_destruct 2232
+#define wxFileDialog_GetDirectory 2233
+#define wxFileDialog_GetFilename 2234
+#define wxFileDialog_GetFilenames 2235
+#define wxFileDialog_GetFilterIndex 2236
+#define wxFileDialog_GetMessage 2237
+#define wxFileDialog_GetPath 2238
+#define wxFileDialog_GetPaths 2239
+#define wxFileDialog_GetWildcard 2240
+#define wxFileDialog_SetDirectory 2241
+#define wxFileDialog_SetFilename 2242
+#define wxFileDialog_SetFilterIndex 2243
+#define wxFileDialog_SetMessage 2244
+#define wxFileDialog_SetPath 2245
+#define wxFileDialog_SetWildcard 2246
+#define wxPickerBase_SetInternalMargin 2247
+#define wxPickerBase_GetInternalMargin 2248
+#define wxPickerBase_SetTextCtrlProportion 2249
+#define wxPickerBase_SetPickerCtrlProportion 2250
+#define wxPickerBase_GetTextCtrlProportion 2251
+#define wxPickerBase_GetPickerCtrlProportion 2252
+#define wxPickerBase_HasTextCtrl 2253
+#define wxPickerBase_GetTextCtrl 2254
+#define wxPickerBase_IsTextCtrlGrowable 2255
+#define wxPickerBase_SetPickerCtrlGrowable 2256
+#define wxPickerBase_SetTextCtrlGrowable 2257
+#define wxPickerBase_IsPickerCtrlGrowable 2258
+#define wxFilePickerCtrl_new_0 2259
+#define wxFilePickerCtrl_new_3 2260
+#define wxFilePickerCtrl_Create 2261
+#define wxFilePickerCtrl_GetPath 2262
+#define wxFilePickerCtrl_SetPath 2263
+#define wxFilePickerCtrl_destroy 2264
+#define wxDirPickerCtrl_new_0 2265
+#define wxDirPickerCtrl_new_3 2266
+#define wxDirPickerCtrl_Create 2267
+#define wxDirPickerCtrl_GetPath 2268
+#define wxDirPickerCtrl_SetPath 2269
+#define wxDirPickerCtrl_destroy 2270
+#define wxColourPickerCtrl_new_0 2271
+#define wxColourPickerCtrl_new_3 2272
+#define wxColourPickerCtrl_Create 2273
+#define wxColourPickerCtrl_GetColour 2274
+#define wxColourPickerCtrl_SetColour_1_1 2275
+#define wxColourPickerCtrl_SetColour_1_0 2276
+#define wxColourPickerCtrl_destroy 2277
+#define wxDatePickerCtrl_new_0 2278
+#define wxDatePickerCtrl_new_3 2279
+#define wxDatePickerCtrl_GetRange 2280
+#define wxDatePickerCtrl_GetValue 2281
+#define wxDatePickerCtrl_SetRange 2282
+#define wxDatePickerCtrl_SetValue 2283
+#define wxDatePickerCtrl_destroy 2284
+#define wxFontPickerCtrl_new_0 2285
+#define wxFontPickerCtrl_new_3 2286
+#define wxFontPickerCtrl_Create 2287
+#define wxFontPickerCtrl_GetSelectedFont 2288
+#define wxFontPickerCtrl_SetSelectedFont 2289
+#define wxFontPickerCtrl_GetMaxPointSize 2290
+#define wxFontPickerCtrl_SetMaxPointSize 2291
+#define wxFontPickerCtrl_destroy 2292
+#define wxFindReplaceDialog_new_0 2295
+#define wxFindReplaceDialog_new_4 2296
+#define wxFindReplaceDialog_destruct 2297
+#define wxFindReplaceDialog_Create 2298
+#define wxFindReplaceDialog_GetData 2299
+#define wxFindReplaceData_new_0 2300
+#define wxFindReplaceData_new_1 2301
+#define wxFindReplaceData_GetFindString 2302
+#define wxFindReplaceData_GetReplaceString 2303
+#define wxFindReplaceData_GetFlags 2304
+#define wxFindReplaceData_SetFlags 2305
+#define wxFindReplaceData_SetFindString 2306
+#define wxFindReplaceData_SetReplaceString 2307
+#define wxFindReplaceData_destroy 2308
+#define wxMultiChoiceDialog_new_0 2309
+#define wxMultiChoiceDialog_new_5 2311
+#define wxMultiChoiceDialog_GetSelections 2312
+#define wxMultiChoiceDialog_SetSelections 2313
+#define wxMultiChoiceDialog_destroy 2314
+#define wxSingleChoiceDialog_new_0 2315
+#define wxSingleChoiceDialog_new_5 2317
+#define wxSingleChoiceDialog_GetSelection 2318
+#define wxSingleChoiceDialog_GetStringSelection 2319
+#define wxSingleChoiceDialog_SetSelection 2320
+#define wxSingleChoiceDialog_destroy 2321
+#define wxTextEntryDialog_new 2322
+#define wxTextEntryDialog_GetValue 2323
+#define wxTextEntryDialog_SetValue 2324
+#define wxTextEntryDialog_destroy 2325
+#define wxPasswordEntryDialog_new 2326
+#define wxPasswordEntryDialog_destroy 2327
+#define wxFontData_new_0 2328
+#define wxFontData_new_1 2329
+#define wxFontData_destruct 2330
+#define wxFontData_EnableEffects 2331
+#define wxFontData_GetAllowSymbols 2332
+#define wxFontData_GetColour 2333
+#define wxFontData_GetChosenFont 2334
+#define wxFontData_GetEnableEffects 2335
+#define wxFontData_GetInitialFont 2336
+#define wxFontData_GetShowHelp 2337
+#define wxFontData_SetAllowSymbols 2338
+#define wxFontData_SetChosenFont 2339
+#define wxFontData_SetColour 2340
+#define wxFontData_SetInitialFont 2341
+#define wxFontData_SetRange 2342
+#define wxFontData_SetShowHelp 2343
+#define wxFontDialog_new_0 2347
+#define wxFontDialog_new_2 2349
+#define wxFontDialog_Create 2351
+#define wxFontDialog_GetFontData 2352
+#define wxFontDialog_destroy 2354
+#define wxProgressDialog_new 2355
+#define wxProgressDialog_destruct 2356
+#define wxProgressDialog_Resume 2357
+#define wxProgressDialog_Update_2 2358
+#define wxProgressDialog_Update_0 2359
+#define wxMessageDialog_new 2360
+#define wxMessageDialog_destruct 2361
+#define wxPageSetupDialog_new 2362
+#define wxPageSetupDialog_destruct 2363
+#define wxPageSetupDialog_GetPageSetupData 2364
+#define wxPageSetupDialog_ShowModal 2365
+#define wxPageSetupDialogData_new_0 2366
+#define wxPageSetupDialogData_new_1_0 2367
+#define wxPageSetupDialogData_new_1_1 2368
+#define wxPageSetupDialogData_destruct 2369
+#define wxPageSetupDialogData_EnableHelp 2370
+#define wxPageSetupDialogData_EnableMargins 2371
+#define wxPageSetupDialogData_EnableOrientation 2372
+#define wxPageSetupDialogData_EnablePaper 2373
+#define wxPageSetupDialogData_EnablePrinter 2374
+#define wxPageSetupDialogData_GetDefaultMinMargins 2375
+#define wxPageSetupDialogData_GetEnableMargins 2376
+#define wxPageSetupDialogData_GetEnableOrientation 2377
+#define wxPageSetupDialogData_GetEnablePaper 2378
+#define wxPageSetupDialogData_GetEnablePrinter 2379
+#define wxPageSetupDialogData_GetEnableHelp 2380
+#define wxPageSetupDialogData_GetDefaultInfo 2381
+#define wxPageSetupDialogData_GetMarginTopLeft 2382
+#define wxPageSetupDialogData_GetMarginBottomRight 2383
+#define wxPageSetupDialogData_GetMinMarginTopLeft 2384
+#define wxPageSetupDialogData_GetMinMarginBottomRight 2385
+#define wxPageSetupDialogData_GetPaperId 2386
+#define wxPageSetupDialogData_GetPaperSize 2387
+#define wxPageSetupDialogData_GetPrintData 2389
+#define wxPageSetupDialogData_IsOk 2390
+#define wxPageSetupDialogData_SetDefaultInfo 2391
+#define wxPageSetupDialogData_SetDefaultMinMargins 2392
+#define wxPageSetupDialogData_SetMarginTopLeft 2393
+#define wxPageSetupDialogData_SetMarginBottomRight 2394
+#define wxPageSetupDialogData_SetMinMarginTopLeft 2395
+#define wxPageSetupDialogData_SetMinMarginBottomRight 2396
+#define wxPageSetupDialogData_SetPaperId 2397
+#define wxPageSetupDialogData_SetPaperSize_1_1 2398
+#define wxPageSetupDialogData_SetPaperSize_1_0 2399
+#define wxPageSetupDialogData_SetPrintData 2400
+#define wxPrintDialog_new_2_0 2401
+#define wxPrintDialog_new_2_1 2402
+#define wxPrintDialog_destruct 2403
+#define wxPrintDialog_GetPrintDialogData 2404
+#define wxPrintDialog_GetPrintDC 2405
+#define wxPrintDialogData_new_0 2406
+#define wxPrintDialogData_new_1_1 2407
+#define wxPrintDialogData_new_1_0 2408
+#define wxPrintDialogData_destruct 2409
+#define wxPrintDialogData_EnableHelp 2410
+#define wxPrintDialogData_EnablePageNumbers 2411
+#define wxPrintDialogData_EnablePrintToFile 2412
+#define wxPrintDialogData_EnableSelection 2413
+#define wxPrintDialogData_GetAllPages 2414
+#define wxPrintDialogData_GetCollate 2415
+#define wxPrintDialogData_GetFromPage 2416
+#define wxPrintDialogData_GetMaxPage 2417
+#define wxPrintDialogData_GetMinPage 2418
+#define wxPrintDialogData_GetNoCopies 2419
+#define wxPrintDialogData_GetPrintData 2420
+#define wxPrintDialogData_GetPrintToFile 2421
+#define wxPrintDialogData_GetSelection 2422
+#define wxPrintDialogData_GetToPage 2423
+#define wxPrintDialogData_IsOk 2424
+#define wxPrintDialogData_SetCollate 2425
+#define wxPrintDialogData_SetFromPage 2426
+#define wxPrintDialogData_SetMaxPage 2427
+#define wxPrintDialogData_SetMinPage 2428
+#define wxPrintDialogData_SetNoCopies 2429
+#define wxPrintDialogData_SetPrintData 2430
+#define wxPrintDialogData_SetPrintToFile 2431
+#define wxPrintDialogData_SetSelection 2432
+#define wxPrintDialogData_SetToPage 2433
+#define wxPrintData_new_0 2434
+#define wxPrintData_new_1 2435
+#define wxPrintData_destruct 2436
+#define wxPrintData_GetCollate 2437
+#define wxPrintData_GetBin 2438
+#define wxPrintData_GetColour 2439
+#define wxPrintData_GetDuplex 2440
+#define wxPrintData_GetNoCopies 2441
+#define wxPrintData_GetOrientation 2442
+#define wxPrintData_GetPaperId 2443
+#define wxPrintData_GetPrinterName 2444
+#define wxPrintData_GetQuality 2445
+#define wxPrintData_IsOk 2446
+#define wxPrintData_SetBin 2447
+#define wxPrintData_SetCollate 2448
+#define wxPrintData_SetColour 2449
+#define wxPrintData_SetDuplex 2450
+#define wxPrintData_SetNoCopies 2451
+#define wxPrintData_SetOrientation 2452
+#define wxPrintData_SetPaperId 2453
+#define wxPrintData_SetPrinterName 2454
+#define wxPrintData_SetQuality 2455
+#define wxPrintPreview_new_2 2458
+#define wxPrintPreview_new_3 2459
+#define wxPrintPreview_destruct 2461
+#define wxPrintPreview_GetCanvas 2462
+#define wxPrintPreview_GetCurrentPage 2463
+#define wxPrintPreview_GetFrame 2464
+#define wxPrintPreview_GetMaxPage 2465
+#define wxPrintPreview_GetMinPage 2466
+#define wxPrintPreview_GetPrintout 2467
+#define wxPrintPreview_GetPrintoutForPrinting 2468
+#define wxPrintPreview_IsOk 2469
+#define wxPrintPreview_PaintPage 2470
+#define wxPrintPreview_Print 2471
+#define wxPrintPreview_RenderPage 2472
+#define wxPrintPreview_SetCanvas 2473
+#define wxPrintPreview_SetCurrentPage 2474
+#define wxPrintPreview_SetFrame 2475
+#define wxPrintPreview_SetPrintout 2476
+#define wxPrintPreview_SetZoom 2477
+#define wxPreviewFrame_new 2478
+#define wxPreviewFrame_destruct 2479
+#define wxPreviewFrame_CreateControlBar 2480
+#define wxPreviewFrame_CreateCanvas 2481
+#define wxPreviewFrame_Initialize 2482
+#define wxPreviewFrame_OnCloseWindow 2483
+#define wxPreviewControlBar_new 2484
+#define wxPreviewControlBar_destruct 2485
+#define wxPreviewControlBar_CreateButtons 2486
+#define wxPreviewControlBar_GetPrintPreview 2487
+#define wxPreviewControlBar_GetZoomControl 2488
+#define wxPreviewControlBar_SetZoomControl 2489
+#define wxPrinter_new 2491
+#define wxPrinter_CreateAbortWindow 2492
+#define wxPrinter_GetAbort 2493
+#define wxPrinter_GetLastError 2494
+#define wxPrinter_GetPrintDialogData 2495
+#define wxPrinter_Print 2496
+#define wxPrinter_PrintDialog 2497
+#define wxPrinter_ReportError 2498
+#define wxPrinter_Setup 2499
+#define wxPrinter_destroy 2500
+#define wxXmlResource_new_1 2501
+#define wxXmlResource_new_2 2502
+#define wxXmlResource_destruct 2503
+#define wxXmlResource_AttachUnknownControl 2504
+#define wxXmlResource_ClearHandlers 2505
+#define wxXmlResource_CompareVersion 2506
+#define wxXmlResource_Get 2507
+#define wxXmlResource_GetFlags 2508
+#define wxXmlResource_GetVersion 2509
+#define wxXmlResource_GetXRCID 2510
+#define wxXmlResource_InitAllHandlers 2511
+#define wxXmlResource_Load 2512
+#define wxXmlResource_LoadBitmap 2513
+#define wxXmlResource_LoadDialog_2 2514
+#define wxXmlResource_LoadDialog_3 2515
+#define wxXmlResource_LoadFrame_2 2516
+#define wxXmlResource_LoadFrame_3 2517
+#define wxXmlResource_LoadIcon 2518
+#define wxXmlResource_LoadMenu 2519
+#define wxXmlResource_LoadMenuBar_2 2520
+#define wxXmlResource_LoadMenuBar_1 2521
+#define wxXmlResource_LoadPanel_2 2522
+#define wxXmlResource_LoadPanel_3 2523
+#define wxXmlResource_LoadToolBar 2524
+#define wxXmlResource_Set 2525
+#define wxXmlResource_SetFlags 2526
+#define wxXmlResource_Unload 2527
+#define wxXmlResource_xrcctrl 2528
+#define wxHtmlEasyPrinting_new 2529
+#define wxHtmlEasyPrinting_destruct 2530
+#define wxHtmlEasyPrinting_GetPrintData 2531
+#define wxHtmlEasyPrinting_GetPageSetupData 2532
+#define wxHtmlEasyPrinting_PreviewFile 2533
+#define wxHtmlEasyPrinting_PreviewText 2534
+#define wxHtmlEasyPrinting_PrintFile 2535
+#define wxHtmlEasyPrinting_PrintText 2536
+#define wxHtmlEasyPrinting_PageSetup 2537
+#define wxHtmlEasyPrinting_SetFonts 2538
+#define wxHtmlEasyPrinting_SetHeader 2539
+#define wxHtmlEasyPrinting_SetFooter 2540
+#define wxGLCanvas_new_2 2542
+#define wxGLCanvas_new_3_1 2543
+#define wxGLCanvas_new_3_0 2544
+#define wxGLCanvas_GetContext 2545
+#define wxGLCanvas_SetCurrent 2547
+#define wxGLCanvas_SwapBuffers 2548
+#define wxGLCanvas_destroy 2549
+#define wxAuiManager_new 2550
+#define wxAuiManager_destruct 2551
+#define wxAuiManager_AddPane_2_1 2552
+#define wxAuiManager_AddPane_3 2553
+#define wxAuiManager_AddPane_2_0 2554
+#define wxAuiManager_DetachPane 2555
+#define wxAuiManager_GetAllPanes 2556
+#define wxAuiManager_GetArtProvider 2557
+#define wxAuiManager_GetDockSizeConstraint 2558
+#define wxAuiManager_GetFlags 2559
+#define wxAuiManager_GetManagedWindow 2560
+#define wxAuiManager_GetManager 2561
+#define wxAuiManager_GetPane_1_1 2562
+#define wxAuiManager_GetPane_1_0 2563
+#define wxAuiManager_HideHint 2564
+#define wxAuiManager_InsertPane 2565
+#define wxAuiManager_LoadPaneInfo 2566
+#define wxAuiManager_LoadPerspective 2567
+#define wxAuiManager_SavePaneInfo 2568
+#define wxAuiManager_SavePerspective 2569
+#define wxAuiManager_SetArtProvider 2570
+#define wxAuiManager_SetDockSizeConstraint 2571
+#define wxAuiManager_SetFlags 2572
+#define wxAuiManager_SetManagedWindow 2573
+#define wxAuiManager_ShowHint 2574
+#define wxAuiManager_UnInit 2575
+#define wxAuiManager_Update 2576
+#define wxAuiPaneInfo_new_0 2577
+#define wxAuiPaneInfo_new_1 2578
+#define wxAuiPaneInfo_destruct 2579
+#define wxAuiPaneInfo_BestSize_1 2580
+#define wxAuiPaneInfo_BestSize_2 2581
+#define wxAuiPaneInfo_Bottom 2582
+#define wxAuiPaneInfo_BottomDockable 2583
+#define wxAuiPaneInfo_Caption 2584
+#define wxAuiPaneInfo_CaptionVisible 2585
+#define wxAuiPaneInfo_Centre 2586
+#define wxAuiPaneInfo_CentrePane 2587
+#define wxAuiPaneInfo_CloseButton 2588
+#define wxAuiPaneInfo_DefaultPane 2589
+#define wxAuiPaneInfo_DestroyOnClose 2590
+#define wxAuiPaneInfo_Direction 2591
+#define wxAuiPaneInfo_Dock 2592
+#define wxAuiPaneInfo_Dockable 2593
+#define wxAuiPaneInfo_Fixed 2594
+#define wxAuiPaneInfo_Float 2595
+#define wxAuiPaneInfo_Floatable 2596
+#define wxAuiPaneInfo_FloatingPosition_1 2597
+#define wxAuiPaneInfo_FloatingPosition_2 2598
+#define wxAuiPaneInfo_FloatingSize_1 2599
+#define wxAuiPaneInfo_FloatingSize_2 2600
+#define wxAuiPaneInfo_Gripper 2601
+#define wxAuiPaneInfo_GripperTop 2602
+#define wxAuiPaneInfo_HasBorder 2603
+#define wxAuiPaneInfo_HasCaption 2604
+#define wxAuiPaneInfo_HasCloseButton 2605
+#define wxAuiPaneInfo_HasFlag 2606
+#define wxAuiPaneInfo_HasGripper 2607
+#define wxAuiPaneInfo_HasGripperTop 2608
+#define wxAuiPaneInfo_HasMaximizeButton 2609
+#define wxAuiPaneInfo_HasMinimizeButton 2610
+#define wxAuiPaneInfo_HasPinButton 2611
+#define wxAuiPaneInfo_Hide 2612
+#define wxAuiPaneInfo_IsBottomDockable 2613
+#define wxAuiPaneInfo_IsDocked 2614
+#define wxAuiPaneInfo_IsFixed 2615
+#define wxAuiPaneInfo_IsFloatable 2616
+#define wxAuiPaneInfo_IsFloating 2617
+#define wxAuiPaneInfo_IsLeftDockable 2618
+#define wxAuiPaneInfo_IsMovable 2619
+#define wxAuiPaneInfo_IsOk 2620
+#define wxAuiPaneInfo_IsResizable 2621
+#define wxAuiPaneInfo_IsRightDockable 2622
+#define wxAuiPaneInfo_IsShown 2623
+#define wxAuiPaneInfo_IsToolbar 2624
+#define wxAuiPaneInfo_IsTopDockable 2625
+#define wxAuiPaneInfo_Layer 2626
+#define wxAuiPaneInfo_Left 2627
+#define wxAuiPaneInfo_LeftDockable 2628
+#define wxAuiPaneInfo_MaxSize_1 2629
+#define wxAuiPaneInfo_MaxSize_2 2630
+#define wxAuiPaneInfo_MaximizeButton 2631
+#define wxAuiPaneInfo_MinSize_1 2632
+#define wxAuiPaneInfo_MinSize_2 2633
+#define wxAuiPaneInfo_MinimizeButton 2634
+#define wxAuiPaneInfo_Movable 2635
+#define wxAuiPaneInfo_Name 2636
+#define wxAuiPaneInfo_PaneBorder 2637
+#define wxAuiPaneInfo_PinButton 2638
+#define wxAuiPaneInfo_Position 2639
+#define wxAuiPaneInfo_Resizable 2640
+#define wxAuiPaneInfo_Right 2641
+#define wxAuiPaneInfo_RightDockable 2642
+#define wxAuiPaneInfo_Row 2643
+#define wxAuiPaneInfo_SafeSet 2644
+#define wxAuiPaneInfo_SetFlag 2645
+#define wxAuiPaneInfo_Show 2646
+#define wxAuiPaneInfo_ToolbarPane 2647
+#define wxAuiPaneInfo_Top 2648
+#define wxAuiPaneInfo_TopDockable 2649
+#define wxAuiPaneInfo_Window 2650
+#define wxAuiNotebook_new_0 2651
+#define wxAuiNotebook_new_2 2652
+#define wxAuiNotebook_AddPage 2653
+#define wxAuiNotebook_Create 2654
+#define wxAuiNotebook_DeletePage 2655
+#define wxAuiNotebook_GetArtProvider 2656
+#define wxAuiNotebook_GetPage 2657
+#define wxAuiNotebook_GetPageBitmap 2658
+#define wxAuiNotebook_GetPageCount 2659
+#define wxAuiNotebook_GetPageIndex 2660
+#define wxAuiNotebook_GetPageText 2661
+#define wxAuiNotebook_GetSelection 2662
+#define wxAuiNotebook_InsertPage 2663
+#define wxAuiNotebook_RemovePage 2664
+#define wxAuiNotebook_SetArtProvider 2665
+#define wxAuiNotebook_SetFont 2666
+#define wxAuiNotebook_SetPageBitmap 2667
+#define wxAuiNotebook_SetPageText 2668
+#define wxAuiNotebook_SetSelection 2669
+#define wxAuiNotebook_SetTabCtrlHeight 2670
+#define wxAuiNotebook_SetUniformBitmapSize 2671
+#define wxAuiNotebook_destroy 2672
+#define wxMDIParentFrame_new_0 2673
+#define wxMDIParentFrame_new_4 2674
+#define wxMDIParentFrame_destruct 2675
+#define wxMDIParentFrame_ActivateNext 2676
+#define wxMDIParentFrame_ActivatePrevious 2677
+#define wxMDIParentFrame_ArrangeIcons 2678
+#define wxMDIParentFrame_Cascade 2679
+#define wxMDIParentFrame_Create 2680
+#define wxMDIParentFrame_GetActiveChild 2681
+#define wxMDIParentFrame_GetClientWindow 2682
+#define wxMDIParentFrame_Tile 2683
+#define wxMDIChildFrame_new_0 2684
+#define wxMDIChildFrame_new_4 2685
+#define wxMDIChildFrame_destruct 2686
+#define wxMDIChildFrame_Activate 2687
+#define wxMDIChildFrame_Create 2688
+#define wxMDIChildFrame_Maximize 2689
+#define wxMDIChildFrame_Restore 2690
+#define wxMDIClientWindow_new_0 2691
+#define wxMDIClientWindow_new_2 2692
+#define wxMDIClientWindow_destruct 2693
+#define wxMDIClientWindow_CreateClient 2694
+#define wxLayoutAlgorithm_new 2695
+#define wxLayoutAlgorithm_LayoutFrame 2696
+#define wxLayoutAlgorithm_LayoutMDIFrame 2697
+#define wxLayoutAlgorithm_LayoutWindow 2698
+#define wxLayoutAlgorithm_destroy 2699
+#define wxEvent_GetId 2700
+#define wxEvent_GetSkipped 2701
+#define wxEvent_GetTimestamp 2702
+#define wxEvent_IsCommandEvent 2703
+#define wxEvent_ResumePropagation 2704
+#define wxEvent_ShouldPropagate 2705
+#define wxEvent_Skip 2706
+#define wxEvent_StopPropagation 2707
+#define wxCommandEvent_getClientData 2708
+#define wxCommandEvent_GetExtraLong 2709
+#define wxCommandEvent_GetInt 2710
+#define wxCommandEvent_GetSelection 2711
+#define wxCommandEvent_GetString 2712
+#define wxCommandEvent_IsChecked 2713
+#define wxCommandEvent_IsSelection 2714
+#define wxCommandEvent_SetInt 2715
+#define wxCommandEvent_SetString 2716
+#define wxScrollEvent_GetOrientation 2717
+#define wxScrollEvent_GetPosition 2718
+#define wxScrollWinEvent_GetOrientation 2719
+#define wxScrollWinEvent_GetPosition 2720
+#define wxMouseEvent_AltDown 2721
+#define wxMouseEvent_Button 2722
+#define wxMouseEvent_ButtonDClick 2723
+#define wxMouseEvent_ButtonDown 2724
+#define wxMouseEvent_ButtonUp 2725
+#define wxMouseEvent_CmdDown 2726
+#define wxMouseEvent_ControlDown 2727
+#define wxMouseEvent_Dragging 2728
+#define wxMouseEvent_Entering 2729
+#define wxMouseEvent_GetButton 2730
+#define wxMouseEvent_GetPosition 2733
+#define wxMouseEvent_GetLogicalPosition 2734
+#define wxMouseEvent_GetLinesPerAction 2735
+#define wxMouseEvent_GetWheelRotation 2736
+#define wxMouseEvent_GetWheelDelta 2737
+#define wxMouseEvent_GetX 2738
+#define wxMouseEvent_GetY 2739
+#define wxMouseEvent_IsButton 2740
+#define wxMouseEvent_IsPageScroll 2741
+#define wxMouseEvent_Leaving 2742
+#define wxMouseEvent_LeftDClick 2743
+#define wxMouseEvent_LeftDown 2744
+#define wxMouseEvent_LeftIsDown 2745
+#define wxMouseEvent_LeftUp 2746
+#define wxMouseEvent_MetaDown 2747
+#define wxMouseEvent_MiddleDClick 2748
+#define wxMouseEvent_MiddleDown 2749
+#define wxMouseEvent_MiddleIsDown 2750
+#define wxMouseEvent_MiddleUp 2751
+#define wxMouseEvent_Moving 2752
+#define wxMouseEvent_RightDClick 2753
+#define wxMouseEvent_RightDown 2754
+#define wxMouseEvent_RightIsDown 2755
+#define wxMouseEvent_RightUp 2756
+#define wxMouseEvent_ShiftDown 2757
+#define wxSetCursorEvent_GetCursor 2758
+#define wxSetCursorEvent_GetX 2759
+#define wxSetCursorEvent_GetY 2760
+#define wxSetCursorEvent_HasCursor 2761
+#define wxSetCursorEvent_SetCursor 2762
+#define wxKeyEvent_AltDown 2763
+#define wxKeyEvent_CmdDown 2764
+#define wxKeyEvent_ControlDown 2765
+#define wxKeyEvent_GetKeyCode 2766
+#define wxKeyEvent_GetModifiers 2767
+#define wxKeyEvent_GetPosition 2770
+#define wxKeyEvent_GetRawKeyCode 2771
+#define wxKeyEvent_GetRawKeyFlags 2772
+#define wxKeyEvent_GetUnicodeKey 2773
+#define wxKeyEvent_GetX 2774
+#define wxKeyEvent_GetY 2775
+#define wxKeyEvent_HasModifiers 2776
+#define wxKeyEvent_MetaDown 2777
+#define wxKeyEvent_ShiftDown 2778
+#define wxSizeEvent_GetSize 2779
+#define wxMoveEvent_GetPosition 2780
+#define wxEraseEvent_GetDC 2781
+#define wxFocusEvent_GetWindow 2782
+#define wxChildFocusEvent_GetWindow 2783
+#define wxMenuEvent_GetMenu 2784
+#define wxMenuEvent_GetMenuId 2785
+#define wxMenuEvent_IsPopup 2786
+#define wxCloseEvent_CanVeto 2787
+#define wxCloseEvent_GetLoggingOff 2788
+#define wxCloseEvent_SetCanVeto 2789
+#define wxCloseEvent_SetLoggingOff 2790
+#define wxCloseEvent_Veto 2791
+#define wxShowEvent_SetShow 2792
+#define wxShowEvent_GetShow 2793
+#define wxIconizeEvent_Iconized 2794
+#define wxJoystickEvent_ButtonDown 2795
+#define wxJoystickEvent_ButtonIsDown 2796
+#define wxJoystickEvent_ButtonUp 2797
+#define wxJoystickEvent_GetButtonChange 2798
+#define wxJoystickEvent_GetButtonState 2799
+#define wxJoystickEvent_GetJoystick 2800
+#define wxJoystickEvent_GetPosition 2801
+#define wxJoystickEvent_GetZPosition 2802
+#define wxJoystickEvent_IsButton 2803
+#define wxJoystickEvent_IsMove 2804
+#define wxJoystickEvent_IsZMove 2805
+#define wxUpdateUIEvent_CanUpdate 2806
+#define wxUpdateUIEvent_Check 2807
+#define wxUpdateUIEvent_Enable 2808
+#define wxUpdateUIEvent_Show 2809
+#define wxUpdateUIEvent_GetChecked 2810
+#define wxUpdateUIEvent_GetEnabled 2811
+#define wxUpdateUIEvent_GetShown 2812
+#define wxUpdateUIEvent_GetSetChecked 2813
+#define wxUpdateUIEvent_GetSetEnabled 2814
+#define wxUpdateUIEvent_GetSetShown 2815
+#define wxUpdateUIEvent_GetSetText 2816
+#define wxUpdateUIEvent_GetText 2817
+#define wxUpdateUIEvent_GetMode 2818
+#define wxUpdateUIEvent_GetUpdateInterval 2819
+#define wxUpdateUIEvent_ResetUpdateTime 2820
+#define wxUpdateUIEvent_SetMode 2821
+#define wxUpdateUIEvent_SetText 2822
+#define wxUpdateUIEvent_SetUpdateInterval 2823
+#define wxMouseCaptureChangedEvent_GetCapturedWindow 2824
+#define wxPaletteChangedEvent_SetChangedWindow 2825
+#define wxPaletteChangedEvent_GetChangedWindow 2826
+#define wxQueryNewPaletteEvent_SetPaletteRealized 2827
+#define wxQueryNewPaletteEvent_GetPaletteRealized 2828
+#define wxNavigationKeyEvent_GetDirection 2829
+#define wxNavigationKeyEvent_SetDirection 2830
+#define wxNavigationKeyEvent_IsWindowChange 2831
+#define wxNavigationKeyEvent_SetWindowChange 2832
+#define wxNavigationKeyEvent_IsFromTab 2833
+#define wxNavigationKeyEvent_SetFromTab 2834
+#define wxNavigationKeyEvent_GetCurrentFocus 2835
+#define wxNavigationKeyEvent_SetCurrentFocus 2836
+#define wxHelpEvent_GetOrigin 2837
+#define wxHelpEvent_GetPosition 2838
+#define wxHelpEvent_SetOrigin 2839
+#define wxHelpEvent_SetPosition 2840
+#define wxContextMenuEvent_GetPosition 2841
+#define wxContextMenuEvent_SetPosition 2842
+#define wxIdleEvent_CanSend 2843
+#define wxIdleEvent_GetMode 2844
+#define wxIdleEvent_RequestMore 2845
+#define wxIdleEvent_MoreRequested 2846
+#define wxIdleEvent_SetMode 2847
+#define wxGridEvent_AltDown 2848
+#define wxGridEvent_ControlDown 2849
+#define wxGridEvent_GetCol 2850
+#define wxGridEvent_GetPosition 2851
+#define wxGridEvent_GetRow 2852
+#define wxGridEvent_MetaDown 2853
+#define wxGridEvent_Selecting 2854
+#define wxGridEvent_ShiftDown 2855
+#define wxNotifyEvent_Allow 2856
+#define wxNotifyEvent_IsAllowed 2857
+#define wxNotifyEvent_Veto 2858
+#define wxSashEvent_GetEdge 2859
+#define wxSashEvent_GetDragRect 2860
+#define wxSashEvent_GetDragStatus 2861
+#define wxListEvent_GetCacheFrom 2862
+#define wxListEvent_GetCacheTo 2863
+#define wxListEvent_GetKeyCode 2864
+#define wxListEvent_GetIndex 2865
+#define wxListEvent_GetColumn 2866
+#define wxListEvent_GetPoint 2867
+#define wxListEvent_GetLabel 2868
+#define wxListEvent_GetText 2869
+#define wxListEvent_GetImage 2870
+#define wxListEvent_GetData 2871
+#define wxListEvent_GetMask 2872
+#define wxListEvent_GetItem 2873
+#define wxListEvent_IsEditCancelled 2874
+#define wxDateEvent_GetDate 2875
+#define wxCalendarEvent_GetWeekDay 2876
+#define wxFileDirPickerEvent_GetPath 2877
+#define wxColourPickerEvent_GetColour 2878
+#define wxFontPickerEvent_GetFont 2879
+#define wxStyledTextEvent_GetPosition 2880
+#define wxStyledTextEvent_GetKey 2881
+#define wxStyledTextEvent_GetModifiers 2882
+#define wxStyledTextEvent_GetModificationType 2883
+#define wxStyledTextEvent_GetText 2884
+#define wxStyledTextEvent_GetLength 2885
+#define wxStyledTextEvent_GetLinesAdded 2886
+#define wxStyledTextEvent_GetLine 2887
+#define wxStyledTextEvent_GetFoldLevelNow 2888
+#define wxStyledTextEvent_GetFoldLevelPrev 2889
+#define wxStyledTextEvent_GetMargin 2890
+#define wxStyledTextEvent_GetMessage 2891
+#define wxStyledTextEvent_GetWParam 2892
+#define wxStyledTextEvent_GetLParam 2893
+#define wxStyledTextEvent_GetListType 2894
+#define wxStyledTextEvent_GetX 2895
+#define wxStyledTextEvent_GetY 2896
+#define wxStyledTextEvent_GetDragText 2897
+#define wxStyledTextEvent_GetDragAllowMove 2898
+#define wxStyledTextEvent_GetDragResult 2899
+#define wxStyledTextEvent_GetShift 2900
+#define wxStyledTextEvent_GetControl 2901
+#define wxStyledTextEvent_GetAlt 2902
+#define utils_wxGetKeyState 2903
+#define utils_wxGetMousePosition 2904
+#define utils_wxGetMouseState 2905
+#define utils_wxSetDetectableAutoRepeat 2906
+#define utils_wxBell 2907
+#define utils_wxFindMenuItemId 2908
+#define utils_wxGenericFindWindowAtPoint 2909
+#define utils_wxFindWindowAtPoint 2910
+#define utils_wxBeginBusyCursor 2911
+#define utils_wxEndBusyCursor 2912
+#define utils_wxIsBusy 2913
+#define utils_wxShutdown 2914
+#define utils_wxShell 2915
+#define utils_wxLaunchDefaultBrowser 2916
+#define utils_wxGetEmailAddress 2917
+#define utils_wxGetUserId 2918
+#define utils_wxGetHomeDir 2919
+#define utils_wxNewId 2920
+#define utils_wxRegisterId 2921
+#define utils_wxGetCurrentId 2922
+#define utils_wxGetOsDescription 2923
+#define utils_wxIsPlatformLittleEndian 2924
+#define utils_wxIsPlatform64Bit 2925
+#define wxPrintout_new 2926
+#define wxPrintout_destruct 2927
+#define wxPrintout_GetDC 2928
+#define wxPrintout_GetPageSizeMM 2929
+#define wxPrintout_GetPageSizePixels 2930
+#define wxPrintout_GetPaperRectPixels 2931
+#define wxPrintout_GetPPIPrinter 2932
+#define wxPrintout_GetPPIScreen 2933
+#define wxPrintout_GetTitle 2934
+#define wxPrintout_IsPreview 2935
+#define wxPrintout_FitThisSizeToPaper 2936
+#define wxPrintout_FitThisSizeToPage 2937
+#define wxPrintout_FitThisSizeToPageMargins 2938
+#define wxPrintout_MapScreenSizeToPaper 2939
+#define wxPrintout_MapScreenSizeToPage 2940
+#define wxPrintout_MapScreenSizeToPageMargins 2941
+#define wxPrintout_MapScreenSizeToDevice 2942
+#define wxPrintout_GetLogicalPaperRect 2943
+#define wxPrintout_GetLogicalPageRect 2944
+#define wxPrintout_GetLogicalPageMarginsRect 2945
+#define wxPrintout_SetLogicalOrigin 2946
+#define wxPrintout_OffsetLogicalOrigin 2947
+#define wxStyledTextCtrl_new_2 2948
+#define wxStyledTextCtrl_new_0 2949
+#define wxStyledTextCtrl_destruct 2950
+#define wxStyledTextCtrl_Create 2951
+#define wxStyledTextCtrl_AddText 2952
+#define wxStyledTextCtrl_AddStyledText 2953
+#define wxStyledTextCtrl_InsertText 2954
+#define wxStyledTextCtrl_ClearAll 2955
+#define wxStyledTextCtrl_ClearDocumentStyle 2956
+#define wxStyledTextCtrl_GetLength 2957
+#define wxStyledTextCtrl_GetCharAt 2958
+#define wxStyledTextCtrl_GetCurrentPos 2959
+#define wxStyledTextCtrl_GetAnchor 2960
+#define wxStyledTextCtrl_GetStyleAt 2961
+#define wxStyledTextCtrl_Redo 2962
+#define wxStyledTextCtrl_SetUndoCollection 2963
+#define wxStyledTextCtrl_SelectAll 2964
+#define wxStyledTextCtrl_SetSavePoint 2965
+#define wxStyledTextCtrl_GetStyledText 2966
+#define wxStyledTextCtrl_CanRedo 2967
+#define wxStyledTextCtrl_MarkerLineFromHandle 2968
+#define wxStyledTextCtrl_MarkerDeleteHandle 2969
+#define wxStyledTextCtrl_GetUndoCollection 2970
+#define wxStyledTextCtrl_GetViewWhiteSpace 2971
+#define wxStyledTextCtrl_SetViewWhiteSpace 2972
+#define wxStyledTextCtrl_PositionFromPoint 2973
+#define wxStyledTextCtrl_PositionFromPointClose 2974
+#define wxStyledTextCtrl_GotoLine 2975
+#define wxStyledTextCtrl_GotoPos 2976
+#define wxStyledTextCtrl_SetAnchor 2977
+#define wxStyledTextCtrl_GetCurLine 2978
+#define wxStyledTextCtrl_GetEndStyled 2979
+#define wxStyledTextCtrl_ConvertEOLs 2980
+#define wxStyledTextCtrl_GetEOLMode 2981
+#define wxStyledTextCtrl_SetEOLMode 2982
+#define wxStyledTextCtrl_StartStyling 2983
+#define wxStyledTextCtrl_SetStyling 2984
+#define wxStyledTextCtrl_GetBufferedDraw 2985
+#define wxStyledTextCtrl_SetBufferedDraw 2986
+#define wxStyledTextCtrl_SetTabWidth 2987
+#define wxStyledTextCtrl_GetTabWidth 2988
+#define wxStyledTextCtrl_SetCodePage 2989
+#define wxStyledTextCtrl_MarkerDefine 2990
+#define wxStyledTextCtrl_MarkerSetForeground 2991
+#define wxStyledTextCtrl_MarkerSetBackground 2992
+#define wxStyledTextCtrl_MarkerAdd 2993
+#define wxStyledTextCtrl_MarkerDelete 2994
+#define wxStyledTextCtrl_MarkerDeleteAll 2995
+#define wxStyledTextCtrl_MarkerGet 2996
+#define wxStyledTextCtrl_MarkerNext 2997
+#define wxStyledTextCtrl_MarkerPrevious 2998
+#define wxStyledTextCtrl_MarkerDefineBitmap 2999
+#define wxStyledTextCtrl_MarkerAddSet 3000
+#define wxStyledTextCtrl_MarkerSetAlpha 3001
+#define wxStyledTextCtrl_SetMarginType 3002
+#define wxStyledTextCtrl_GetMarginType 3003
+#define wxStyledTextCtrl_SetMarginWidth 3004
+#define wxStyledTextCtrl_GetMarginWidth 3005
+#define wxStyledTextCtrl_SetMarginMask 3006
+#define wxStyledTextCtrl_GetMarginMask 3007
+#define wxStyledTextCtrl_SetMarginSensitive 3008
+#define wxStyledTextCtrl_GetMarginSensitive 3009
+#define wxStyledTextCtrl_StyleClearAll 3010
+#define wxStyledTextCtrl_StyleSetForeground 3011
+#define wxStyledTextCtrl_StyleSetBackground 3012
+#define wxStyledTextCtrl_StyleSetBold 3013
+#define wxStyledTextCtrl_StyleSetItalic 3014
+#define wxStyledTextCtrl_StyleSetSize 3015
+#define wxStyledTextCtrl_StyleSetFaceName 3016
+#define wxStyledTextCtrl_StyleSetEOLFilled 3017
+#define wxStyledTextCtrl_StyleResetDefault 3018
+#define wxStyledTextCtrl_StyleSetUnderline 3019
+#define wxStyledTextCtrl_StyleSetCase 3020
+#define wxStyledTextCtrl_StyleSetHotSpot 3021
+#define wxStyledTextCtrl_SetSelForeground 3022
+#define wxStyledTextCtrl_SetSelBackground 3023
+#define wxStyledTextCtrl_GetSelAlpha 3024
+#define wxStyledTextCtrl_SetSelAlpha 3025
+#define wxStyledTextCtrl_SetCaretForeground 3026
+#define wxStyledTextCtrl_CmdKeyAssign 3027
+#define wxStyledTextCtrl_CmdKeyClear 3028
+#define wxStyledTextCtrl_CmdKeyClearAll 3029
+#define wxStyledTextCtrl_SetStyleBytes 3030
+#define wxStyledTextCtrl_StyleSetVisible 3031
+#define wxStyledTextCtrl_GetCaretPeriod 3032
+#define wxStyledTextCtrl_SetCaretPeriod 3033
+#define wxStyledTextCtrl_SetWordChars 3034
+#define wxStyledTextCtrl_BeginUndoAction 3035
+#define wxStyledTextCtrl_EndUndoAction 3036
+#define wxStyledTextCtrl_IndicatorSetStyle 3037
+#define wxStyledTextCtrl_IndicatorGetStyle 3038
+#define wxStyledTextCtrl_IndicatorSetForeground 3039
+#define wxStyledTextCtrl_IndicatorGetForeground 3040
+#define wxStyledTextCtrl_SetWhitespaceForeground 3041
+#define wxStyledTextCtrl_SetWhitespaceBackground 3042
+#define wxStyledTextCtrl_GetStyleBits 3043
+#define wxStyledTextCtrl_SetLineState 3044
+#define wxStyledTextCtrl_GetLineState 3045
+#define wxStyledTextCtrl_GetMaxLineState 3046
+#define wxStyledTextCtrl_GetCaretLineVisible 3047
+#define wxStyledTextCtrl_SetCaretLineVisible 3048
+#define wxStyledTextCtrl_GetCaretLineBackground 3049
+#define wxStyledTextCtrl_SetCaretLineBackground 3050
+#define wxStyledTextCtrl_AutoCompShow 3051
+#define wxStyledTextCtrl_AutoCompCancel 3052
+#define wxStyledTextCtrl_AutoCompActive 3053
+#define wxStyledTextCtrl_AutoCompPosStart 3054
+#define wxStyledTextCtrl_AutoCompComplete 3055
+#define wxStyledTextCtrl_AutoCompStops 3056
+#define wxStyledTextCtrl_AutoCompSetSeparator 3057
+#define wxStyledTextCtrl_AutoCompGetSeparator 3058
+#define wxStyledTextCtrl_AutoCompSelect 3059
+#define wxStyledTextCtrl_AutoCompSetCancelAtStart 3060
+#define wxStyledTextCtrl_AutoCompGetCancelAtStart 3061
+#define wxStyledTextCtrl_AutoCompSetFillUps 3062
+#define wxStyledTextCtrl_AutoCompSetChooseSingle 3063
+#define wxStyledTextCtrl_AutoCompGetChooseSingle 3064
+#define wxStyledTextCtrl_AutoCompSetIgnoreCase 3065
+#define wxStyledTextCtrl_AutoCompGetIgnoreCase 3066
+#define wxStyledTextCtrl_UserListShow 3067
+#define wxStyledTextCtrl_AutoCompSetAutoHide 3068
+#define wxStyledTextCtrl_AutoCompGetAutoHide 3069
+#define wxStyledTextCtrl_AutoCompSetDropRestOfWord 3070
+#define wxStyledTextCtrl_AutoCompGetDropRestOfWord 3071
+#define wxStyledTextCtrl_RegisterImage 3072
+#define wxStyledTextCtrl_ClearRegisteredImages 3073
+#define wxStyledTextCtrl_AutoCompGetTypeSeparator 3074
+#define wxStyledTextCtrl_AutoCompSetTypeSeparator 3075
+#define wxStyledTextCtrl_AutoCompSetMaxWidth 3076
+#define wxStyledTextCtrl_AutoCompGetMaxWidth 3077
+#define wxStyledTextCtrl_AutoCompSetMaxHeight 3078
+#define wxStyledTextCtrl_AutoCompGetMaxHeight 3079
+#define wxStyledTextCtrl_SetIndent 3080
+#define wxStyledTextCtrl_GetIndent 3081
+#define wxStyledTextCtrl_SetUseTabs 3082
+#define wxStyledTextCtrl_GetUseTabs 3083
+#define wxStyledTextCtrl_SetLineIndentation 3084
+#define wxStyledTextCtrl_GetLineIndentation 3085
+#define wxStyledTextCtrl_GetLineIndentPosition 3086
+#define wxStyledTextCtrl_GetColumn 3087
+#define wxStyledTextCtrl_SetUseHorizontalScrollBar 3088
+#define wxStyledTextCtrl_GetUseHorizontalScrollBar 3089
+#define wxStyledTextCtrl_SetIndentationGuides 3090
+#define wxStyledTextCtrl_GetIndentationGuides 3091
+#define wxStyledTextCtrl_SetHighlightGuide 3092
+#define wxStyledTextCtrl_GetHighlightGuide 3093
+#define wxStyledTextCtrl_GetLineEndPosition 3094
+#define wxStyledTextCtrl_GetCodePage 3095
+#define wxStyledTextCtrl_GetCaretForeground 3096
+#define wxStyledTextCtrl_GetReadOnly 3097
+#define wxStyledTextCtrl_SetCurrentPos 3098
+#define wxStyledTextCtrl_SetSelectionStart 3099
+#define wxStyledTextCtrl_GetSelectionStart 3100
+#define wxStyledTextCtrl_SetSelectionEnd 3101
+#define wxStyledTextCtrl_GetSelectionEnd 3102
+#define wxStyledTextCtrl_SetPrintMagnification 3103
+#define wxStyledTextCtrl_GetPrintMagnification 3104
+#define wxStyledTextCtrl_SetPrintColourMode 3105
+#define wxStyledTextCtrl_GetPrintColourMode 3106
+#define wxStyledTextCtrl_FindText 3107
+#define wxStyledTextCtrl_FormatRange 3108
+#define wxStyledTextCtrl_GetFirstVisibleLine 3109
+#define wxStyledTextCtrl_GetLine 3110
+#define wxStyledTextCtrl_GetLineCount 3111
+#define wxStyledTextCtrl_SetMarginLeft 3112
+#define wxStyledTextCtrl_GetMarginLeft 3113
+#define wxStyledTextCtrl_SetMarginRight 3114
+#define wxStyledTextCtrl_GetMarginRight 3115
+#define wxStyledTextCtrl_GetModify 3116
+#define wxStyledTextCtrl_SetSelection 3117
+#define wxStyledTextCtrl_GetSelectedText 3118
+#define wxStyledTextCtrl_GetTextRange 3119
+#define wxStyledTextCtrl_HideSelection 3120
+#define wxStyledTextCtrl_LineFromPosition 3121
+#define wxStyledTextCtrl_PositionFromLine 3122
+#define wxStyledTextCtrl_LineScroll 3123
+#define wxStyledTextCtrl_EnsureCaretVisible 3124
+#define wxStyledTextCtrl_ReplaceSelection 3125
+#define wxStyledTextCtrl_SetReadOnly 3126
+#define wxStyledTextCtrl_CanPaste 3127
+#define wxStyledTextCtrl_CanUndo 3128
+#define wxStyledTextCtrl_EmptyUndoBuffer 3129
+#define wxStyledTextCtrl_Undo 3130
+#define wxStyledTextCtrl_Cut 3131
+#define wxStyledTextCtrl_Copy 3132
+#define wxStyledTextCtrl_Paste 3133
+#define wxStyledTextCtrl_Clear 3134
+#define wxStyledTextCtrl_SetText 3135
+#define wxStyledTextCtrl_GetText 3136
+#define wxStyledTextCtrl_GetTextLength 3137
+#define wxStyledTextCtrl_GetOvertype 3138
+#define wxStyledTextCtrl_SetCaretWidth 3139
+#define wxStyledTextCtrl_GetCaretWidth 3140
+#define wxStyledTextCtrl_SetTargetStart 3141
+#define wxStyledTextCtrl_GetTargetStart 3142
+#define wxStyledTextCtrl_SetTargetEnd 3143
+#define wxStyledTextCtrl_GetTargetEnd 3144
+#define wxStyledTextCtrl_ReplaceTarget 3145
+#define wxStyledTextCtrl_SearchInTarget 3146
+#define wxStyledTextCtrl_SetSearchFlags 3147
+#define wxStyledTextCtrl_GetSearchFlags 3148
+#define wxStyledTextCtrl_CallTipShow 3149
+#define wxStyledTextCtrl_CallTipCancel 3150
+#define wxStyledTextCtrl_CallTipActive 3151
+#define wxStyledTextCtrl_CallTipPosAtStart 3152
+#define wxStyledTextCtrl_CallTipSetHighlight 3153
+#define wxStyledTextCtrl_CallTipSetBackground 3154
+#define wxStyledTextCtrl_CallTipSetForeground 3155
+#define wxStyledTextCtrl_CallTipSetForegroundHighlight 3156
+#define wxStyledTextCtrl_CallTipUseStyle 3157
+#define wxStyledTextCtrl_VisibleFromDocLine 3158
+#define wxStyledTextCtrl_DocLineFromVisible 3159
+#define wxStyledTextCtrl_WrapCount 3160
+#define wxStyledTextCtrl_SetFoldLevel 3161
+#define wxStyledTextCtrl_GetFoldLevel 3162
+#define wxStyledTextCtrl_GetLastChild 3163
+#define wxStyledTextCtrl_GetFoldParent 3164
+#define wxStyledTextCtrl_ShowLines 3165
+#define wxStyledTextCtrl_HideLines 3166
+#define wxStyledTextCtrl_GetLineVisible 3167
+#define wxStyledTextCtrl_SetFoldExpanded 3168
+#define wxStyledTextCtrl_GetFoldExpanded 3169
+#define wxStyledTextCtrl_ToggleFold 3170
+#define wxStyledTextCtrl_EnsureVisible 3171
+#define wxStyledTextCtrl_SetFoldFlags 3172
+#define wxStyledTextCtrl_EnsureVisibleEnforcePolicy 3173
+#define wxStyledTextCtrl_SetTabIndents 3174
+#define wxStyledTextCtrl_GetTabIndents 3175
+#define wxStyledTextCtrl_SetBackSpaceUnIndents 3176
+#define wxStyledTextCtrl_GetBackSpaceUnIndents 3177
+#define wxStyledTextCtrl_SetMouseDwellTime 3178
+#define wxStyledTextCtrl_GetMouseDwellTime 3179
+#define wxStyledTextCtrl_WordStartPosition 3180
+#define wxStyledTextCtrl_WordEndPosition 3181
+#define wxStyledTextCtrl_SetWrapMode 3182
+#define wxStyledTextCtrl_GetWrapMode 3183
+#define wxStyledTextCtrl_SetWrapVisualFlags 3184
+#define wxStyledTextCtrl_GetWrapVisualFlags 3185
+#define wxStyledTextCtrl_SetWrapVisualFlagsLocation 3186
+#define wxStyledTextCtrl_GetWrapVisualFlagsLocation 3187
+#define wxStyledTextCtrl_SetWrapStartIndent 3188
+#define wxStyledTextCtrl_GetWrapStartIndent 3189
+#define wxStyledTextCtrl_SetLayoutCache 3190
+#define wxStyledTextCtrl_GetLayoutCache 3191
+#define wxStyledTextCtrl_SetScrollWidth 3192
+#define wxStyledTextCtrl_GetScrollWidth 3193
+#define wxStyledTextCtrl_TextWidth 3194
+#define wxStyledTextCtrl_GetEndAtLastLine 3195
+#define wxStyledTextCtrl_TextHeight 3196
+#define wxStyledTextCtrl_SetUseVerticalScrollBar 3197
+#define wxStyledTextCtrl_GetUseVerticalScrollBar 3198
+#define wxStyledTextCtrl_AppendText 3199
+#define wxStyledTextCtrl_GetTwoPhaseDraw 3200
+#define wxStyledTextCtrl_SetTwoPhaseDraw 3201
+#define wxStyledTextCtrl_TargetFromSelection 3202
+#define wxStyledTextCtrl_LinesJoin 3203
+#define wxStyledTextCtrl_LinesSplit 3204
+#define wxStyledTextCtrl_SetFoldMarginColour 3205
+#define wxStyledTextCtrl_SetFoldMarginHiColour 3206
+#define wxStyledTextCtrl_LineDown 3207
+#define wxStyledTextCtrl_LineDownExtend 3208
+#define wxStyledTextCtrl_LineUp 3209
+#define wxStyledTextCtrl_LineUpExtend 3210
+#define wxStyledTextCtrl_CharLeft 3211
+#define wxStyledTextCtrl_CharLeftExtend 3212
+#define wxStyledTextCtrl_CharRight 3213
+#define wxStyledTextCtrl_CharRightExtend 3214
+#define wxStyledTextCtrl_WordLeft 3215
+#define wxStyledTextCtrl_WordLeftExtend 3216
+#define wxStyledTextCtrl_WordRight 3217
+#define wxStyledTextCtrl_WordRightExtend 3218
+#define wxStyledTextCtrl_Home 3219
+#define wxStyledTextCtrl_HomeExtend 3220
+#define wxStyledTextCtrl_LineEnd 3221
+#define wxStyledTextCtrl_LineEndExtend 3222
+#define wxStyledTextCtrl_DocumentStart 3223
+#define wxStyledTextCtrl_DocumentStartExtend 3224
+#define wxStyledTextCtrl_DocumentEnd 3225
+#define wxStyledTextCtrl_DocumentEndExtend 3226
+#define wxStyledTextCtrl_PageUp 3227
+#define wxStyledTextCtrl_PageUpExtend 3228
+#define wxStyledTextCtrl_PageDown 3229
+#define wxStyledTextCtrl_PageDownExtend 3230
+#define wxStyledTextCtrl_EditToggleOvertype 3231
+#define wxStyledTextCtrl_Cancel 3232
+#define wxStyledTextCtrl_DeleteBack 3233
+#define wxStyledTextCtrl_Tab 3234
+#define wxStyledTextCtrl_BackTab 3235
+#define wxStyledTextCtrl_NewLine 3236
+#define wxStyledTextCtrl_FormFeed 3237
+#define wxStyledTextCtrl_VCHome 3238
+#define wxStyledTextCtrl_VCHomeExtend 3239
+#define wxStyledTextCtrl_ZoomIn 3240
+#define wxStyledTextCtrl_ZoomOut 3241
+#define wxStyledTextCtrl_DelWordLeft 3242
+#define wxStyledTextCtrl_DelWordRight 3243
+#define wxStyledTextCtrl_LineCut 3244
+#define wxStyledTextCtrl_LineDelete 3245
+#define wxStyledTextCtrl_LineTranspose 3246
+#define wxStyledTextCtrl_LineDuplicate 3247
+#define wxStyledTextCtrl_LowerCase 3248
+#define wxStyledTextCtrl_UpperCase 3249
+#define wxStyledTextCtrl_LineScrollDown 3250
+#define wxStyledTextCtrl_LineScrollUp 3251
+#define wxStyledTextCtrl_DeleteBackNotLine 3252
+#define wxStyledTextCtrl_HomeDisplay 3253
+#define wxStyledTextCtrl_HomeDisplayExtend 3254
+#define wxStyledTextCtrl_LineEndDisplay 3255
+#define wxStyledTextCtrl_LineEndDisplayExtend 3256
+#define wxStyledTextCtrl_HomeWrapExtend 3257
+#define wxStyledTextCtrl_LineEndWrap 3258
+#define wxStyledTextCtrl_LineEndWrapExtend 3259
+#define wxStyledTextCtrl_VCHomeWrap 3260
+#define wxStyledTextCtrl_VCHomeWrapExtend 3261
+#define wxStyledTextCtrl_LineCopy 3262
+#define wxStyledTextCtrl_MoveCaretInsideView 3263
+#define wxStyledTextCtrl_LineLength 3264
+#define wxStyledTextCtrl_BraceHighlight 3265
+#define wxStyledTextCtrl_BraceBadLight 3266
+#define wxStyledTextCtrl_BraceMatch 3267
+#define wxStyledTextCtrl_GetViewEOL 3268
+#define wxStyledTextCtrl_SetViewEOL 3269
+#define wxStyledTextCtrl_SetModEventMask 3270
+#define wxStyledTextCtrl_GetEdgeColumn 3271
+#define wxStyledTextCtrl_SetEdgeColumn 3272
+#define wxStyledTextCtrl_SetEdgeMode 3273
+#define wxStyledTextCtrl_GetEdgeMode 3274
+#define wxStyledTextCtrl_GetEdgeColour 3275
+#define wxStyledTextCtrl_SetEdgeColour 3276
+#define wxStyledTextCtrl_SearchAnchor 3277
+#define wxStyledTextCtrl_SearchNext 3278
+#define wxStyledTextCtrl_SearchPrev 3279
+#define wxStyledTextCtrl_LinesOnScreen 3280
+#define wxStyledTextCtrl_UsePopUp 3281
+#define wxStyledTextCtrl_SelectionIsRectangle 3282
+#define wxStyledTextCtrl_SetZoom 3283
+#define wxStyledTextCtrl_GetZoom 3284
+#define wxStyledTextCtrl_GetModEventMask 3285
+#define wxStyledTextCtrl_SetSTCFocus 3286
+#define wxStyledTextCtrl_GetSTCFocus 3287
+#define wxStyledTextCtrl_SetStatus 3288
+#define wxStyledTextCtrl_GetStatus 3289
+#define wxStyledTextCtrl_SetMouseDownCaptures 3290
+#define wxStyledTextCtrl_GetMouseDownCaptures 3291
+#define wxStyledTextCtrl_SetSTCCursor 3292
+#define wxStyledTextCtrl_GetSTCCursor 3293
+#define wxStyledTextCtrl_SetControlCharSymbol 3294
+#define wxStyledTextCtrl_GetControlCharSymbol 3295
+#define wxStyledTextCtrl_WordPartLeft 3296
+#define wxStyledTextCtrl_WordPartLeftExtend 3297
+#define wxStyledTextCtrl_WordPartRight 3298
+#define wxStyledTextCtrl_WordPartRightExtend 3299
+#define wxStyledTextCtrl_SetVisiblePolicy 3300
+#define wxStyledTextCtrl_DelLineLeft 3301
+#define wxStyledTextCtrl_DelLineRight 3302
+#define wxStyledTextCtrl_GetXOffset 3303
+#define wxStyledTextCtrl_ChooseCaretX 3304
+#define wxStyledTextCtrl_SetXCaretPolicy 3305
+#define wxStyledTextCtrl_SetYCaretPolicy 3306
+#define wxStyledTextCtrl_GetPrintWrapMode 3307
+#define wxStyledTextCtrl_SetHotspotActiveForeground 3308
+#define wxStyledTextCtrl_SetHotspotActiveBackground 3309
+#define wxStyledTextCtrl_SetHotspotActiveUnderline 3310
+#define wxStyledTextCtrl_SetHotspotSingleLine 3311
+#define wxStyledTextCtrl_ParaDownExtend 3312
+#define wxStyledTextCtrl_ParaUp 3313
+#define wxStyledTextCtrl_ParaUpExtend 3314
+#define wxStyledTextCtrl_PositionBefore 3315
+#define wxStyledTextCtrl_PositionAfter 3316
+#define wxStyledTextCtrl_CopyRange 3317
+#define wxStyledTextCtrl_CopyText 3318
+#define wxStyledTextCtrl_SetSelectionMode 3319
+#define wxStyledTextCtrl_GetSelectionMode 3320
+#define wxStyledTextCtrl_LineDownRectExtend 3321
+#define wxStyledTextCtrl_LineUpRectExtend 3322
+#define wxStyledTextCtrl_CharLeftRectExtend 3323
+#define wxStyledTextCtrl_CharRightRectExtend 3324
+#define wxStyledTextCtrl_HomeRectExtend 3325
+#define wxStyledTextCtrl_VCHomeRectExtend 3326
+#define wxStyledTextCtrl_LineEndRectExtend 3327
+#define wxStyledTextCtrl_PageUpRectExtend 3328
+#define wxStyledTextCtrl_PageDownRectExtend 3329
+#define wxStyledTextCtrl_StutteredPageUp 3330
+#define wxStyledTextCtrl_StutteredPageUpExtend 3331
+#define wxStyledTextCtrl_StutteredPageDown 3332
+#define wxStyledTextCtrl_StutteredPageDownExtend 3333
+#define wxStyledTextCtrl_WordLeftEnd 3334
+#define wxStyledTextCtrl_WordLeftEndExtend 3335
+#define wxStyledTextCtrl_WordRightEnd 3336
+#define wxStyledTextCtrl_WordRightEndExtend 3337
+#define wxStyledTextCtrl_SetWhitespaceChars 3338
+#define wxStyledTextCtrl_SetCharsDefault 3339
+#define wxStyledTextCtrl_AutoCompGetCurrent 3340
+#define wxStyledTextCtrl_Allocate 3341
+#define wxStyledTextCtrl_FindColumn 3342
+#define wxStyledTextCtrl_GetCaretSticky 3343
+#define wxStyledTextCtrl_SetCaretSticky 3344
+#define wxStyledTextCtrl_ToggleCaretSticky 3345
+#define wxStyledTextCtrl_SetPasteConvertEndings 3346
+#define wxStyledTextCtrl_GetPasteConvertEndings 3347
+#define wxStyledTextCtrl_SelectionDuplicate 3348
+#define wxStyledTextCtrl_SetCaretLineBackAlpha 3349
+#define wxStyledTextCtrl_GetCaretLineBackAlpha 3350
+#define wxStyledTextCtrl_StartRecord 3351
+#define wxStyledTextCtrl_StopRecord 3352
+#define wxStyledTextCtrl_SetLexer 3353
+#define wxStyledTextCtrl_GetLexer 3354
+#define wxStyledTextCtrl_Colourise 3355
+#define wxStyledTextCtrl_SetProperty 3356
+#define wxStyledTextCtrl_SetKeyWords 3357
+#define wxStyledTextCtrl_SetLexerLanguage 3358
+#define wxStyledTextCtrl_GetProperty 3359
+#define wxStyledTextCtrl_GetStyleBitsNeeded 3360
+#define wxStyledTextCtrl_GetCurrentLine 3361
+#define wxStyledTextCtrl_StyleSetSpec 3362
+#define wxStyledTextCtrl_StyleSetFont 3363
+#define wxStyledTextCtrl_StyleSetFontAttr 3364
+#define wxStyledTextCtrl_StyleSetCharacterSet 3365
+#define wxStyledTextCtrl_StyleSetFontEncoding 3366
+#define wxStyledTextCtrl_CmdKeyExecute 3367
+#define wxStyledTextCtrl_SetMargins 3368
+#define wxStyledTextCtrl_GetSelection 3369
+#define wxStyledTextCtrl_PointFromPosition 3370
+#define wxStyledTextCtrl_ScrollToLine 3371
+#define wxStyledTextCtrl_ScrollToColumn 3372
+#define wxStyledTextCtrl_SendMsg 3373
+#define wxStyledTextCtrl_SetVScrollBar 3374
+#define wxStyledTextCtrl_SetHScrollBar 3375
+#define wxStyledTextCtrl_GetLastKeydownProcessed 3376
+#define wxStyledTextCtrl_SetLastKeydownProcessed 3377
+#define wxStyledTextCtrl_SaveFile 3378
+#define wxStyledTextCtrl_LoadFile 3379
+#define wxStyledTextCtrl_DoDragOver 3380
+#define wxStyledTextCtrl_DoDropText 3381
+#define wxStyledTextCtrl_GetUseAntiAliasing 3382
+#define wxStyledTextCtrl_AddTextRaw 3383
+#define wxStyledTextCtrl_InsertTextRaw 3384
+#define wxStyledTextCtrl_GetCurLineRaw 3385
+#define wxStyledTextCtrl_GetLineRaw 3386
+#define wxStyledTextCtrl_GetSelectedTextRaw 3387
+#define wxStyledTextCtrl_GetTextRangeRaw 3388
+#define wxStyledTextCtrl_SetTextRaw 3389
+#define wxStyledTextCtrl_GetTextRaw 3390
+#define wxStyledTextCtrl_AppendTextRaw 3391
+#define wxArtProvider_GetBitmap 3392
+#define wxArtProvider_GetIcon 3393
+#define wxTreeEvent_GetKeyCode 3394
+#define wxTreeEvent_GetItem 3395
+#define wxTreeEvent_GetKeyEvent 3396
+#define wxTreeEvent_GetLabel 3397
+#define wxTreeEvent_GetOldItem 3398
+#define wxTreeEvent_GetPoint 3399
+#define wxTreeEvent_IsEditCancelled 3400
+#define wxTreeEvent_SetToolTip 3401
+#define wxNotebookEvent_GetOldSelection 3402
+#define wxNotebookEvent_GetSelection 3403
+#define wxNotebookEvent_SetOldSelection 3404
+#define wxNotebookEvent_SetSelection 3405
+#define wxFileDataObject_new 3406
+#define wxFileDataObject_AddFile 3407
+#define wxFileDataObject_GetFilenames 3408
+#define wxFileDataObject_destroy 3409
+#define wxTextDataObject_new 3410
+#define wxTextDataObject_GetTextLength 3411
+#define wxTextDataObject_GetText 3412
+#define wxTextDataObject_SetText 3413
+#define wxTextDataObject_destroy 3414
+#define wxBitmapDataObject_new_1_1 3415
+#define wxBitmapDataObject_new_1_0 3416
+#define wxBitmapDataObject_GetBitmap 3417
+#define wxBitmapDataObject_SetBitmap 3418
+#define wxBitmapDataObject_destroy 3419
+#define wxClipboard_new 3421
+#define wxClipboard_destruct 3422
+#define wxClipboard_AddData 3423
+#define wxClipboard_Clear 3424
+#define wxClipboard_Close 3425
+#define wxClipboard_Flush 3426
+#define wxClipboard_GetData 3427
+#define wxClipboard_IsOpened 3428
+#define wxClipboard_Open 3429
+#define wxClipboard_SetData 3430
+#define wxClipboard_UsePrimarySelection 3432
+#define wxClipboard_IsSupported 3433
+#define wxClipboard_Get 3434
+#define wxSpinEvent_GetPosition 3435
+#define wxSpinEvent_SetPosition 3436
+#define wxSplitterWindow_new_0 3437
+#define wxSplitterWindow_new_2 3438
+#define wxSplitterWindow_destruct 3439
+#define wxSplitterWindow_Create 3440
+#define wxSplitterWindow_GetMinimumPaneSize 3441
+#define wxSplitterWindow_GetSashGravity 3442
+#define wxSplitterWindow_GetSashPosition 3443
+#define wxSplitterWindow_GetSplitMode 3444
+#define wxSplitterWindow_GetWindow1 3445
+#define wxSplitterWindow_GetWindow2 3446
+#define wxSplitterWindow_Initialize 3447
+#define wxSplitterWindow_IsSplit 3448
+#define wxSplitterWindow_ReplaceWindow 3449
+#define wxSplitterWindow_SetSashGravity 3450
+#define wxSplitterWindow_SetSashPosition 3451
+#define wxSplitterWindow_SetSashSize 3452
+#define wxSplitterWindow_SetMinimumPaneSize 3453
+#define wxSplitterWindow_SetSplitMode 3454
+#define wxSplitterWindow_SplitHorizontally 3455
+#define wxSplitterWindow_SplitVertically 3456
+#define wxSplitterWindow_Unsplit 3457
+#define wxSplitterWindow_UpdateSize 3458
+#define wxSplitterEvent_GetSashPosition 3459
+#define wxSplitterEvent_GetX 3460
+#define wxSplitterEvent_GetY 3461
+#define wxSplitterEvent_GetWindowBeingRemoved 3462
+#define wxSplitterEvent_SetSashPosition 3463
+#define wxHtmlWindow_new_0 3464
+#define wxHtmlWindow_new_2 3465
+#define wxHtmlWindow_AppendToPage 3466
+#define wxHtmlWindow_GetOpenedAnchor 3467
+#define wxHtmlWindow_GetOpenedPage 3468
+#define wxHtmlWindow_GetOpenedPageTitle 3469
+#define wxHtmlWindow_GetRelatedFrame 3470
+#define wxHtmlWindow_HistoryBack 3471
+#define wxHtmlWindow_HistoryCanBack 3472
+#define wxHtmlWindow_HistoryCanForward 3473
+#define wxHtmlWindow_HistoryClear 3474
+#define wxHtmlWindow_HistoryForward 3475
+#define wxHtmlWindow_LoadFile 3476
+#define wxHtmlWindow_LoadPage 3477
+#define wxHtmlWindow_SelectAll 3478
+#define wxHtmlWindow_SelectionToText 3479
+#define wxHtmlWindow_SelectLine 3480
+#define wxHtmlWindow_SelectWord 3481
+#define wxHtmlWindow_SetBorders 3482
+#define wxHtmlWindow_SetFonts 3483
+#define wxHtmlWindow_SetPage 3484
+#define wxHtmlWindow_SetRelatedFrame 3485
+#define wxHtmlWindow_SetRelatedStatusBar 3486
+#define wxHtmlWindow_ToText 3487
+#define wxHtmlWindow_destroy 3488
+#define wxHtmlLinkEvent_GetLinkInfo 3489
+#define wxSystemSettings_GetColour 3490
+#define wxSystemSettings_GetFont 3491
+#define wxSystemSettings_GetMetric 3492
+#define wxSystemSettings_GetScreenType 3493
+#define wxSystemOptions_GetOption 3494
+#define wxSystemOptions_GetOptionInt 3495
+#define wxSystemOptions_HasOption 3496
+#define wxSystemOptions_IsFalse 3497
+#define wxSystemOptions_SetOption_2_1 3498
+#define wxSystemOptions_SetOption_2_0 3499
+#define wxAuiNotebookEvent_SetSelection 3500
+#define wxAuiNotebookEvent_GetSelection 3501
+#define wxAuiNotebookEvent_SetOldSelection 3502
+#define wxAuiNotebookEvent_GetOldSelection 3503
+#define wxAuiNotebookEvent_SetDragSource 3504
+#define wxAuiNotebookEvent_GetDragSource 3505
+#define wxAuiManagerEvent_SetManager 3506
+#define wxAuiManagerEvent_GetManager 3507
+#define wxAuiManagerEvent_SetPane 3508
+#define wxAuiManagerEvent_GetPane 3509
+#define wxAuiManagerEvent_SetButton 3510
+#define wxAuiManagerEvent_GetButton 3511
+#define wxAuiManagerEvent_SetDC 3512
+#define wxAuiManagerEvent_GetDC 3513
+#define wxAuiManagerEvent_Veto 3514
+#define wxAuiManagerEvent_GetVeto 3515
+#define wxAuiManagerEvent_SetCanVeto 3516
+#define wxAuiManagerEvent_CanVeto 3517
+#define wxLogNull_new 3518
+#define wxLogNull_destroy 3519
+#define wxTaskBarIcon_new 3520
+#define wxTaskBarIcon_destruct 3521
+#define wxTaskBarIcon_PopupMenu 3522
+#define wxTaskBarIcon_RemoveIcon 3523
+#define wxTaskBarIcon_SetIcon 3524
diff --git a/lib/wx/c_src/wxe_return.cpp b/lib/wx/c_src/wxe_return.cpp
index 9fd627829e..0f3eb40efc 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-2010. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2012. 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
@@ -220,6 +220,16 @@ void wxeReturn::add(wxArrayInt val) {
endList(len);
}
+INLINE
+void wxeReturn::add(wxArrayDouble val) {
+ unsigned int len = val.GetCount();
+
+ for (unsigned int i = 0; i< len; i++) {
+ addFloat(val[i]);
+ }
+ endList(len);
+}
+
INLINE
void wxeReturn::add(wxUIntPtr *val) {
add(ERL_DRV_UINT, (ErlDrvTermData) val);
diff --git a/lib/wx/c_src/wxe_return.h b/lib/wx/c_src/wxe_return.h
index 0daf12eab2..b6bfa85e63 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-2009. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2012. All Rights Reserved.
*
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
@@ -108,6 +108,8 @@ public:
void add(wxArrayInt val);
+ void add(wxArrayDouble val);
+
void add(wxUIntPtr *val);
void add(const wxHtmlLinkInfo *val);
diff --git a/lib/wx/configure.in b/lib/wx/configure.in
index b27e114a3d..7b35fed672 100755
--- 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-2011. All Rights Reserved.
+dnl Copyright Ericsson AB 2008-2012. All Rights Reserved.
dnl
dnl The contents of this file are subject to the Erlang Public License,
dnl Version 1.1, (the "License"); you may not use this file except in
@@ -571,7 +571,7 @@ if test X"$WX_HAVE_STATIC_LIBS" = X"true" ; then
LIBS=$WX_LIBS_STATIC
fi
-AC_LINK_IFELSE([
+AC_LINK_IFELSE([AC_LANG_SOURCE([
#ifdef WIN32
# include <windows.h>
# include <gl/gl.h>
@@ -583,6 +583,7 @@ AC_LINK_IFELSE([
#include "wx/wx.h"
#include "wx/stc/stc.h"
#include "wx/glcanvas.h"
+ ])
class MyApp : public wxApp
{
diff --git a/lib/wx/doc/src/Makefile b/lib/wx/doc/src/Makefile
index 03e9f1e1bb..4e6727b6a6 100644
--- a/lib/wx/doc/src/Makefile
+++ b/lib/wx/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2010. All Rights Reserved.
+# Copyright Ericsson AB 2008-2012. 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
@@ -33,40 +33,7 @@ GenMods = $(shell ls ../../src/gen | grep 'wx[A-Z].*\.erl') \
ModsNoExt = $(ErlMods:%.erl=%) $(GenMods:%.erl=%)
-ifneq ($(INSIDE_ERLSRC),true)
-# ----------------------------------------------------
-# Standalone release
-# ----------------------------------------------------
-Mods = $(ErlMods:%=../../src/%) $(GenMods:%=../../src/gen/%)
-HTML_FILES = $(ErlMods:%.erl=../html/%.html) $(GenMods:%.erl=../html/%.html)
-
-GIF_FILES = ../html/erlang.png
-EXTRA_FILES = ../html/index.html \
- ../html/modules-frame.html \
- ../html/overview-summary.html \
- ../html/packages-frame.html
-
-HTML_STYLESHEET_FILES = ../html/stylesheet.css
-
-html: ../html/edoc-info
-
-docs: ../html/edoc-info
-
-../html/edoc-info: $(Mods)
- @echo "Building documentation."
- -mkdir -p ../html
- erl -noshell -pa doc -run edoc_run application "wx" '"../.."' '[{private,true},no_packages,{dir,"../html"}, {sort_functions,false}]'
-
-clean:
- rm -f *~
- (cd ../html; rm -f *.html *.css erlang.png edoc-info)
-
-opt debug:
-else
# Release directory specification
-# ----------------------------------------------------
-# Inside the erlang src
-# ----------------------------------------------------
XML_APPLICATION_FILES = ref_man.xml
XML_REF3_FILES = $(ErlMods:%.erl=%.xml) $(GenMods:%.erl=%.xml)
@@ -96,10 +63,10 @@ HTML_REF_MAN_FILE = $(HTMLDIR)/index.html
TOP_PDF_FILE = $(PDFDIR)/$(APPLICATION)-$(VSN).pdf
# ----------------------------------------------------
-# FLAGS
+# FLAGS
# ----------------------------------------------------
-XML_FLAGS +=
-DVIPS_FLAGS +=
+XML_FLAGS +=
+DVIPS_FLAGS +=
# ----------------------------------------------------
# Targets
@@ -117,30 +84,30 @@ man: $(MAN3_FILES)
gifs: $(GIF_FILES:%=$(HTMLDIR)/%)
-xml: $(XML_REF3_FILES) $(XML_CHAPTER_FILES)
+xml: $(XML_REF3_FILES) $(XML_CHAPTER_FILES)
-ref_man.xml: ref_man.xml.src
+ref_man.xml: ref_man.xml.src
@echo Preparing ref_man.xml
@cat ref_man.xml.src > ref_man.xml
@for d in $(ModsNoExt); do \
echo " <xi:include href=\"$$d.xml\"/>" >> ref_man.xml ; \
done
@echo "</application>" >> ref_man.xml
- @echo
+ @echo
-$(ErlMods:%.erl=%.xml):
- escript $(DOCGEN)/priv/bin/xml_from_edoc.escript -def vsn $(VSN) -sort_functions false ../../src/$(@:%.xml=%.erl)
+$(ErlMods:%.erl=%.xml): ../../src/$(@:%.xml=%.erl)
+ escript $(DOCGEN)/priv/bin/xml_from_edoc.escript -def vsn $(VSN) -preprocess true -sort_functions false ../../src/$(@:%.xml=%.erl)
-$(GenMods:%.erl=%.xml):
- escript $(DOCGEN)/priv/bin/xml_from_edoc.escript -def vsn $(VSN) -sort_functions false ../../src/gen/$(@:%.xml=%.erl)
+$(GenMods:%.erl=%.xml): ../../src/gen/$(@:%.xml=%.erl)
+ escript $(DOCGEN)/priv/bin/xml_from_edoc.escript -def vsn $(VSN) -i ../../src -preprocess true -sort_functions false ../../src/gen/$(@:%.xml=%.erl)
-$(XML_CHAPTER_FILES):
- escript $(DOCGEN)/priv/bin/xml_from_edoc.escript -def vsn $(VSN) -chapter ../overview.edoc
+$(XML_CHAPTER_FILES): ../overview.edoc
+ escript $(DOCGEN)/priv/bin/xml_from_edoc.escript -def vsn $(VSN) -chapter ../overview.edoc
-debug opt:
+debug opt:
clean clean_docs:
- rm -rf $(HTMLDIR)/*
+ rm -rf $(HTMLDIR)/*
rm -f $(MAN3DIR)/*
rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
rm -f errs core *~ ../html/edoc-info
@@ -148,22 +115,20 @@ clean clean_docs:
# ----------------------------------------------------
# Release Target
-# ----------------------------------------------------
+# ----------------------------------------------------
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3_FILES) $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3_FILES) "$(RELEASE_PATH)/man/man3"
-release_spec:
+release_spec:
release_tests_spec:
-
-endif
diff --git a/lib/wx/doc/src/notes.xml b/lib/wx/doc/src/notes.xml
index 4a94227a55..95036bd7f0 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>2011</year>
+ <year>2009</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -31,6 +31,23 @@
<p>This document describes the changes made to the wxErlang
application.</p>
+<section><title>Wx 0.99.2</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>Fix errors in wxDC and wxGraphicsContext api.</p>
+ <p>Add wxTaskBarIcon.</p> <p>Add
+ wxStyledTextControl:setEdgeMode/2.</p> <p>Add type and
+ specs for all functions and records.</p>
+ <p>
+ Own Id: OTP-9947</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Wx 0.99.1</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/wx/examples/Makefile b/lib/wx/examples/Makefile
index ae0ed687eb..48fccc88f7 100644
--- a/lib/wx/examples/Makefile
+++ b/lib/wx/examples/Makefile
@@ -1,19 +1,19 @@
#
# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2009. All Rights Reserved.
-#
+#
+# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
-#
+#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
-#
+#
# %CopyrightEnd%
#
@@ -22,24 +22,8 @@ include ../config.mk
SUBDIRS = demo sudoku simple xrc
-ifeq ($(INSIDE_ERLSRC),true)
SUB_DIRECTORIES=$(SUBDIRS)
# ----------------------------------------------------
# Default Subdir Targets
# ----------------------------------------------------
include $(ERL_TOP)/make/otp_subdir.mk
-
-else
-# standalone build
-opt debug clean:
- @for d in $(SUBDIRS); do \
- if test ! -d $$d ; then \
- echo "=== Skipping subdir $$d" ; \
- else \
- (cd $$d && $(MAKE) $@) ; \
- fi ; \
- done
-
-docs:
-
-endif
diff --git a/lib/wx/examples/demo/Makefile b/lib/wx/examples/demo/Makefile
index 3f054ec75f..c60e9c3d50 100644
--- a/lib/wx/examples/demo/Makefile
+++ b/lib/wx/examples/demo/Makefile
@@ -1,19 +1,19 @@
#
# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2009-2011. All Rights Reserved.
-#
+#
+# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
-#
+#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
-#
+#
# %CopyrightEnd%
#
@@ -52,7 +52,7 @@ TESTMODS = \
ex_static \
ex_textCtrl \
ex_treeCtrl \
- ex_graphicsContext
+ ex_graphicsContext
TESTTARGETS = $(TESTMODS:%=%.beam)
@@ -64,21 +64,15 @@ clean:
rm -f $(TESTTARGETS)
rm -f *~ core erl_crash.dump
-docs:
+docs:
run: opt
- erl -smp -detached -pa $(TOPDIR)/ebin -s demo
-
-ifneq ($(INSIDE_ERLSRC),true)
+ erl -smp -detached -pa $(TOPDIR)/ebin -s demo
-%.beam: %.erl
- $(ERLC) -W -I$(ERLINC) -bbeam -o$(BIN) $<
-
-else
-EXRELSYSDIR = $(RELSYSDIR)/examples/demo
+EXRELSYSDIR = "$(RELSYSDIR)/examples/demo"
include $(ERL_TOP)/make/otp_release_targets.mk
-docs:
+docs:
release_spec: opt
$(INSTALL_DIR) $(EXRELSYSDIR)
@@ -89,8 +83,3 @@ release_spec: opt
release_tests_spec:
release_docs_spec:
-
-endif
-
-
-
diff --git a/lib/wx/examples/simple/Makefile b/lib/wx/examples/simple/Makefile
index 295e739202..3f2bf01556 100644
--- a/lib/wx/examples/simple/Makefile
+++ b/lib/wx/examples/simple/Makefile
@@ -1,19 +1,19 @@
#
# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2009-2011. All Rights Reserved.
-#
+#
+# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
-#
+#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
-#
+#
# %CopyrightEnd%
#
@@ -35,21 +35,15 @@ clean:
rm -f $(TESTTARGETS)
rm -f *~ core erl_crash.dump
-docs:
+docs:
run: opt
- erl -smp -detached -pa $(TOPDIR)/ebin -s hello
-
-ifneq ($(INSIDE_ERLSRC),true)
+ erl -smp -detached -pa $(TOPDIR)/ebin -s hello
-%.beam: %.erl
- $(ERLC) -W -I$(ERLINC) -bbeam -o$(BIN) $<
-
-else
-EXRELSYSDIR = $(RELSYSDIR)/examples/simple
+EXRELSYSDIR = "$(RELSYSDIR)/examples/simple"
include $(ERL_TOP)/make/otp_release_targets.mk
-docs:
+docs:
release_spec: opt
$(INSTALL_DIR) $(EXRELSYSDIR)
@@ -59,7 +53,3 @@ release_spec: opt
release_tests_spec:
release_docs_spec:
-
-endif
-
-
diff --git a/lib/wx/examples/sudoku/Makefile b/lib/wx/examples/sudoku/Makefile
index a7cbf85e03..ec900f37e2 100644
--- a/lib/wx/examples/sudoku/Makefile
+++ b/lib/wx/examples/sudoku/Makefile
@@ -1,19 +1,19 @@
#
# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2009-2011. All Rights Reserved.
-#
+#
+# Copyright Ericsson AB 2009-2012. All Rights Reserved.
+#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
-#
+#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
-#
+#
# %CopyrightEnd%
#
@@ -25,7 +25,7 @@ SRC = .
BIN = .
ERLINC = $(TOPDIR)/include
ERLC = erlc
-TESTMODS = sudoku sudoku_board sudoku_game sudoku_gui
+TESTMODS = sudoku sudoku_board sudoku_game sudoku_gui
TESTTARGETS = $(TESTMODS:%=%.beam)
TESTSRC = $(TESTMODS:%=%.erl)
@@ -35,21 +35,15 @@ clean:
rm -f $(TESTTARGETS)
rm -f *~ core erl_crash.dump
-docs:
+docs:
run: opt
- erl -smp -detached -pa $(TOPDIR)/ebin -s sudoku
-
-ifneq ($(INSIDE_ERLSRC),true)
+ erl -smp -detached -pa $(TOPDIR)/ebin -s sudoku
-%.beam: %.erl
- $(ERLC) -W -I$(ERLINC) -bbeam -o$(BIN) $<
-
-else
-EXRELSYSDIR = $(RELSYSDIR)/examples/sudoku
+EXRELSYSDIR = "$(RELSYSDIR)/examples/sudoku"
include $(ERL_TOP)/make/otp_release_targets.mk
-docs:
+docs:
release_spec: opt
$(INSTALL_DIR) $(EXRELSYSDIR)
@@ -59,8 +53,3 @@ release_spec: opt
release_tests_spec:
release_docs_spec:
-
-endif
-
-
-
diff --git a/lib/wx/examples/xrc/Makefile b/lib/wx/examples/xrc/Makefile
index 79d86ac1b9..9a976628a7 100644
--- a/lib/wx/examples/xrc/Makefile
+++ b/lib/wx/examples/xrc/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2009-2011. All Rights Reserved.
+# Copyright Ericsson AB 2009-2012. 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
@@ -49,13 +49,7 @@ docs:
run: opt
erl -smp -detached -pa $(TOPDIR)/ebin -s xrc
-ifneq ($(INSIDE_ERLSRC),true)
-
-%.beam: %.erl
- $(ERLC) -W -I$(ERLINC) -bbeam -o$(BIN) $<
-
-else
-EXRELSYSDIR = $(RELSYSDIR)/examples/xrc
+EXRELSYSDIR = "$(RELSYSDIR)/examples/xrc"
include $(ERL_TOP)/make/otp_release_targets.mk
docs:
@@ -71,7 +65,5 @@ release_tests_spec:
release_docs_spec:
-endif
-
diff --git a/lib/wx/include/gl.hrl b/lib/wx/include/gl.hrl
index 54eb551285..9004a8aa31 100644
--- a/lib/wx/include/gl.hrl
+++ b/lib/wx/include/gl.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,16 +37,16 @@
-define(GL_3_BYTES, 16#1408).
-define(GL_4_BYTES, 16#1409).
-define(GL_DOUBLE, 16#140A).
--define(GL_POINTS, 16#0).
--define(GL_LINES, 16#1).
--define(GL_LINE_LOOP, 16#2).
--define(GL_LINE_STRIP, 16#3).
--define(GL_TRIANGLES, 16#4).
--define(GL_TRIANGLE_STRIP, 16#5).
--define(GL_TRIANGLE_FAN, 16#6).
--define(GL_QUADS, 16#7).
--define(GL_QUAD_STRIP, 16#8).
--define(GL_POLYGON, 16#9).
+-define(GL_POINTS, 16#0000).
+-define(GL_LINES, 16#0001).
+-define(GL_LINE_LOOP, 16#0002).
+-define(GL_LINE_STRIP, 16#0003).
+-define(GL_TRIANGLES, 16#0004).
+-define(GL_TRIANGLE_STRIP, 16#0005).
+-define(GL_TRIANGLE_FAN, 16#0006).
+-define(GL_QUADS, 16#0007).
+-define(GL_QUAD_STRIP, 16#0008).
+-define(GL_POLYGON, 16#0009).
-define(GL_VERTEX_ARRAY, 16#8074).
-define(GL_NORMAL_ARRAY, 16#8075).
-define(GL_COLOR_ARRAY, 16#8076).
@@ -87,35 +87,35 @@
-define(GL_T2F_N3F_V3F, 16#2A2B).
-define(GL_T2F_C4F_N3F_V3F, 16#2A2C).
-define(GL_T4F_C4F_N3F_V4F, 16#2A2D).
--define(GL_MATRIX_MODE, 16#BA0).
+-define(GL_MATRIX_MODE, 16#0BA0).
-define(GL_MODELVIEW, 16#1700).
-define(GL_PROJECTION, 16#1701).
-define(GL_TEXTURE, 16#1702).
--define(GL_POINT_SMOOTH, 16#B10).
--define(GL_POINT_SIZE, 16#B11).
--define(GL_POINT_SIZE_GRANULARITY, 16#B13).
--define(GL_POINT_SIZE_RANGE, 16#B12).
--define(GL_LINE_SMOOTH, 16#B20).
--define(GL_LINE_STIPPLE, 16#B24).
--define(GL_LINE_STIPPLE_PATTERN, 16#B25).
--define(GL_LINE_STIPPLE_REPEAT, 16#B26).
--define(GL_LINE_WIDTH, 16#B21).
--define(GL_LINE_WIDTH_GRANULARITY, 16#B23).
--define(GL_LINE_WIDTH_RANGE, 16#B22).
+-define(GL_POINT_SMOOTH, 16#0B10).
+-define(GL_POINT_SIZE, 16#0B11).
+-define(GL_POINT_SIZE_GRANULARITY, 16#0B13).
+-define(GL_POINT_SIZE_RANGE, 16#0B12).
+-define(GL_LINE_SMOOTH, 16#0B20).
+-define(GL_LINE_STIPPLE, 16#0B24).
+-define(GL_LINE_STIPPLE_PATTERN, 16#0B25).
+-define(GL_LINE_STIPPLE_REPEAT, 16#0B26).
+-define(GL_LINE_WIDTH, 16#0B21).
+-define(GL_LINE_WIDTH_GRANULARITY, 16#0B23).
+-define(GL_LINE_WIDTH_RANGE, 16#0B22).
-define(GL_POINT, 16#1B00).
-define(GL_LINE, 16#1B01).
-define(GL_FILL, 16#1B02).
--define(GL_CW, 16#900).
--define(GL_CCW, 16#901).
--define(GL_FRONT, 16#404).
--define(GL_BACK, 16#405).
--define(GL_POLYGON_MODE, 16#B40).
--define(GL_POLYGON_SMOOTH, 16#B41).
--define(GL_POLYGON_STIPPLE, 16#B42).
--define(GL_EDGE_FLAG, 16#B43).
--define(GL_CULL_FACE, 16#B44).
--define(GL_CULL_FACE_MODE, 16#B45).
--define(GL_FRONT_FACE, 16#B46).
+-define(GL_CW, 16#0900).
+-define(GL_CCW, 16#0901).
+-define(GL_FRONT, 16#0404).
+-define(GL_BACK, 16#0405).
+-define(GL_POLYGON_MODE, 16#0B40).
+-define(GL_POLYGON_SMOOTH, 16#0B41).
+-define(GL_POLYGON_STIPPLE, 16#0B42).
+-define(GL_EDGE_FLAG, 16#0B43).
+-define(GL_CULL_FACE, 16#0B44).
+-define(GL_CULL_FACE_MODE, 16#0B45).
+-define(GL_FRONT_FACE, 16#0B46).
-define(GL_POLYGON_OFFSET_FACTOR, 16#8038).
-define(GL_POLYGON_OFFSET_UNITS, 16#2A00).
-define(GL_POLYGON_OFFSET_POINT, 16#2A01).
@@ -123,25 +123,25 @@
-define(GL_POLYGON_OFFSET_FILL, 16#8037).
-define(GL_COMPILE, 16#1300).
-define(GL_COMPILE_AND_EXECUTE, 16#1301).
--define(GL_LIST_BASE, 16#B32).
--define(GL_LIST_INDEX, 16#B33).
--define(GL_LIST_MODE, 16#B30).
--define(GL_NEVER, 16#200).
--define(GL_LESS, 16#201).
--define(GL_EQUAL, 16#202).
--define(GL_LEQUAL, 16#203).
--define(GL_GREATER, 16#204).
--define(GL_NOTEQUAL, 16#205).
--define(GL_GEQUAL, 16#206).
--define(GL_ALWAYS, 16#207).
--define(GL_DEPTH_TEST, 16#B71).
--define(GL_DEPTH_BITS, 16#D56).
--define(GL_DEPTH_CLEAR_VALUE, 16#B73).
--define(GL_DEPTH_FUNC, 16#B74).
--define(GL_DEPTH_RANGE, 16#B70).
--define(GL_DEPTH_WRITEMASK, 16#B72).
+-define(GL_LIST_BASE, 16#0B32).
+-define(GL_LIST_INDEX, 16#0B33).
+-define(GL_LIST_MODE, 16#0B30).
+-define(GL_NEVER, 16#0200).
+-define(GL_LESS, 16#0201).
+-define(GL_EQUAL, 16#0202).
+-define(GL_LEQUAL, 16#0203).
+-define(GL_GREATER, 16#0204).
+-define(GL_NOTEQUAL, 16#0205).
+-define(GL_GEQUAL, 16#0206).
+-define(GL_ALWAYS, 16#0207).
+-define(GL_DEPTH_TEST, 16#0B71).
+-define(GL_DEPTH_BITS, 16#0D56).
+-define(GL_DEPTH_CLEAR_VALUE, 16#0B73).
+-define(GL_DEPTH_FUNC, 16#0B74).
+-define(GL_DEPTH_RANGE, 16#0B70).
+-define(GL_DEPTH_WRITEMASK, 16#0B72).
-define(GL_DEPTH_COMPONENT, 16#1902).
--define(GL_LIGHTING, 16#B50).
+-define(GL_LIGHTING, 16#0B50).
-define(GL_LIGHT0, 16#4000).
-define(GL_LIGHT1, 16#4001).
-define(GL_LIGHT2, 16#4002).
@@ -164,85 +164,85 @@
-define(GL_SPOT_DIRECTION, 16#1204).
-define(GL_AMBIENT_AND_DIFFUSE, 16#1602).
-define(GL_COLOR_INDEXES, 16#1603).
--define(GL_LIGHT_MODEL_TWO_SIDE, 16#B52).
--define(GL_LIGHT_MODEL_LOCAL_VIEWER, 16#B51).
--define(GL_LIGHT_MODEL_AMBIENT, 16#B53).
--define(GL_FRONT_AND_BACK, 16#408).
--define(GL_SHADE_MODEL, 16#B54).
+-define(GL_LIGHT_MODEL_TWO_SIDE, 16#0B52).
+-define(GL_LIGHT_MODEL_LOCAL_VIEWER, 16#0B51).
+-define(GL_LIGHT_MODEL_AMBIENT, 16#0B53).
+-define(GL_FRONT_AND_BACK, 16#0408).
+-define(GL_SHADE_MODEL, 16#0B54).
-define(GL_FLAT, 16#1D00).
-define(GL_SMOOTH, 16#1D01).
--define(GL_COLOR_MATERIAL, 16#B57).
--define(GL_COLOR_MATERIAL_FACE, 16#B55).
--define(GL_COLOR_MATERIAL_PARAMETER, 16#B56).
--define(GL_NORMALIZE, 16#BA1).
+-define(GL_COLOR_MATERIAL, 16#0B57).
+-define(GL_COLOR_MATERIAL_FACE, 16#0B55).
+-define(GL_COLOR_MATERIAL_PARAMETER, 16#0B56).
+-define(GL_NORMALIZE, 16#0BA1).
-define(GL_CLIP_PLANE0, 16#3000).
-define(GL_CLIP_PLANE1, 16#3001).
-define(GL_CLIP_PLANE2, 16#3002).
-define(GL_CLIP_PLANE3, 16#3003).
-define(GL_CLIP_PLANE4, 16#3004).
-define(GL_CLIP_PLANE5, 16#3005).
--define(GL_ACCUM_RED_BITS, 16#D58).
--define(GL_ACCUM_GREEN_BITS, 16#D59).
--define(GL_ACCUM_BLUE_BITS, 16#D5A).
--define(GL_ACCUM_ALPHA_BITS, 16#D5B).
--define(GL_ACCUM_CLEAR_VALUE, 16#B80).
--define(GL_ACCUM, 16#100).
--define(GL_ADD, 16#104).
--define(GL_LOAD, 16#101).
--define(GL_MULT, 16#103).
--define(GL_RETURN, 16#102).
--define(GL_ALPHA_TEST, 16#BC0).
--define(GL_ALPHA_TEST_REF, 16#BC2).
--define(GL_ALPHA_TEST_FUNC, 16#BC1).
--define(GL_BLEND, 16#BE2).
--define(GL_BLEND_SRC, 16#BE1).
--define(GL_BLEND_DST, 16#BE0).
+-define(GL_ACCUM_RED_BITS, 16#0D58).
+-define(GL_ACCUM_GREEN_BITS, 16#0D59).
+-define(GL_ACCUM_BLUE_BITS, 16#0D5A).
+-define(GL_ACCUM_ALPHA_BITS, 16#0D5B).
+-define(GL_ACCUM_CLEAR_VALUE, 16#0B80).
+-define(GL_ACCUM, 16#0100).
+-define(GL_ADD, 16#0104).
+-define(GL_LOAD, 16#0101).
+-define(GL_MULT, 16#0103).
+-define(GL_RETURN, 16#0102).
+-define(GL_ALPHA_TEST, 16#0BC0).
+-define(GL_ALPHA_TEST_REF, 16#0BC2).
+-define(GL_ALPHA_TEST_FUNC, 16#0BC1).
+-define(GL_BLEND, 16#0BE2).
+-define(GL_BLEND_SRC, 16#0BE1).
+-define(GL_BLEND_DST, 16#0BE0).
-define(GL_ZERO, 16#0).
-define(GL_ONE, 16#1).
--define(GL_SRC_COLOR, 16#300).
--define(GL_ONE_MINUS_SRC_COLOR, 16#301).
--define(GL_SRC_ALPHA, 16#302).
--define(GL_ONE_MINUS_SRC_ALPHA, 16#303).
--define(GL_DST_ALPHA, 16#304).
--define(GL_ONE_MINUS_DST_ALPHA, 16#305).
--define(GL_DST_COLOR, 16#306).
--define(GL_ONE_MINUS_DST_COLOR, 16#307).
--define(GL_SRC_ALPHA_SATURATE, 16#308).
+-define(GL_SRC_COLOR, 16#0300).
+-define(GL_ONE_MINUS_SRC_COLOR, 16#0301).
+-define(GL_SRC_ALPHA, 16#0302).
+-define(GL_ONE_MINUS_SRC_ALPHA, 16#0303).
+-define(GL_DST_ALPHA, 16#0304).
+-define(GL_ONE_MINUS_DST_ALPHA, 16#0305).
+-define(GL_DST_COLOR, 16#0306).
+-define(GL_ONE_MINUS_DST_COLOR, 16#0307).
+-define(GL_SRC_ALPHA_SATURATE, 16#0308).
-define(GL_FEEDBACK, 16#1C01).
-define(GL_RENDER, 16#1C00).
-define(GL_SELECT, 16#1C02).
--define(GL_2D, 16#600).
--define(GL_3D, 16#601).
--define(GL_3D_COLOR, 16#602).
--define(GL_3D_COLOR_TEXTURE, 16#603).
--define(GL_4D_COLOR_TEXTURE, 16#604).
--define(GL_POINT_TOKEN, 16#701).
--define(GL_LINE_TOKEN, 16#702).
--define(GL_LINE_RESET_TOKEN, 16#707).
--define(GL_POLYGON_TOKEN, 16#703).
--define(GL_BITMAP_TOKEN, 16#704).
--define(GL_DRAW_PIXEL_TOKEN, 16#705).
--define(GL_COPY_PIXEL_TOKEN, 16#706).
--define(GL_PASS_THROUGH_TOKEN, 16#700).
--define(GL_FEEDBACK_BUFFER_POINTER, 16#DF0).
--define(GL_FEEDBACK_BUFFER_SIZE, 16#DF1).
--define(GL_FEEDBACK_BUFFER_TYPE, 16#DF2).
--define(GL_SELECTION_BUFFER_POINTER, 16#DF3).
--define(GL_SELECTION_BUFFER_SIZE, 16#DF4).
--define(GL_FOG, 16#B60).
--define(GL_FOG_MODE, 16#B65).
--define(GL_FOG_DENSITY, 16#B62).
--define(GL_FOG_COLOR, 16#B66).
--define(GL_FOG_INDEX, 16#B61).
--define(GL_FOG_START, 16#B63).
--define(GL_FOG_END, 16#B64).
+-define(GL_2D, 16#0600).
+-define(GL_3D, 16#0601).
+-define(GL_3D_COLOR, 16#0602).
+-define(GL_3D_COLOR_TEXTURE, 16#0603).
+-define(GL_4D_COLOR_TEXTURE, 16#0604).
+-define(GL_POINT_TOKEN, 16#0701).
+-define(GL_LINE_TOKEN, 16#0702).
+-define(GL_LINE_RESET_TOKEN, 16#0707).
+-define(GL_POLYGON_TOKEN, 16#0703).
+-define(GL_BITMAP_TOKEN, 16#0704).
+-define(GL_DRAW_PIXEL_TOKEN, 16#0705).
+-define(GL_COPY_PIXEL_TOKEN, 16#0706).
+-define(GL_PASS_THROUGH_TOKEN, 16#0700).
+-define(GL_FEEDBACK_BUFFER_POINTER, 16#0DF0).
+-define(GL_FEEDBACK_BUFFER_SIZE, 16#0DF1).
+-define(GL_FEEDBACK_BUFFER_TYPE, 16#0DF2).
+-define(GL_SELECTION_BUFFER_POINTER, 16#0DF3).
+-define(GL_SELECTION_BUFFER_SIZE, 16#0DF4).
+-define(GL_FOG, 16#0B60).
+-define(GL_FOG_MODE, 16#0B65).
+-define(GL_FOG_DENSITY, 16#0B62).
+-define(GL_FOG_COLOR, 16#0B66).
+-define(GL_FOG_INDEX, 16#0B61).
+-define(GL_FOG_START, 16#0B63).
+-define(GL_FOG_END, 16#0B64).
-define(GL_LINEAR, 16#2601).
--define(GL_EXP, 16#800).
--define(GL_EXP2, 16#801).
--define(GL_LOGIC_OP, 16#BF1).
--define(GL_INDEX_LOGIC_OP, 16#BF1).
--define(GL_COLOR_LOGIC_OP, 16#BF2).
--define(GL_LOGIC_OP_MODE, 16#BF0).
+-define(GL_EXP, 16#0800).
+-define(GL_EXP2, 16#0801).
+-define(GL_LOGIC_OP, 16#0BF1).
+-define(GL_INDEX_LOGIC_OP, 16#0BF1).
+-define(GL_COLOR_LOGIC_OP, 16#0BF2).
+-define(GL_LOGIC_OP_MODE, 16#0BF0).
-define(GL_CLEAR, 16#1500).
-define(GL_SET, 16#150F).
-define(GL_COPY, 16#1503).
@@ -259,32 +259,32 @@
-define(GL_AND_INVERTED, 16#1504).
-define(GL_OR_REVERSE, 16#150B).
-define(GL_OR_INVERTED, 16#150D).
--define(GL_STENCIL_BITS, 16#D57).
--define(GL_STENCIL_TEST, 16#B90).
--define(GL_STENCIL_CLEAR_VALUE, 16#B91).
--define(GL_STENCIL_FUNC, 16#B92).
--define(GL_STENCIL_VALUE_MASK, 16#B93).
--define(GL_STENCIL_FAIL, 16#B94).
--define(GL_STENCIL_PASS_DEPTH_FAIL, 16#B95).
--define(GL_STENCIL_PASS_DEPTH_PASS, 16#B96).
--define(GL_STENCIL_REF, 16#B97).
--define(GL_STENCIL_WRITEMASK, 16#B98).
+-define(GL_STENCIL_BITS, 16#0D57).
+-define(GL_STENCIL_TEST, 16#0B90).
+-define(GL_STENCIL_CLEAR_VALUE, 16#0B91).
+-define(GL_STENCIL_FUNC, 16#0B92).
+-define(GL_STENCIL_VALUE_MASK, 16#0B93).
+-define(GL_STENCIL_FAIL, 16#0B94).
+-define(GL_STENCIL_PASS_DEPTH_FAIL, 16#0B95).
+-define(GL_STENCIL_PASS_DEPTH_PASS, 16#0B96).
+-define(GL_STENCIL_REF, 16#0B97).
+-define(GL_STENCIL_WRITEMASK, 16#0B98).
-define(GL_STENCIL_INDEX, 16#1901).
-define(GL_KEEP, 16#1E00).
-define(GL_REPLACE, 16#1E01).
-define(GL_INCR, 16#1E02).
-define(GL_DECR, 16#1E03).
-define(GL_NONE, 16#0).
--define(GL_LEFT, 16#406).
--define(GL_RIGHT, 16#407).
--define(GL_FRONT_LEFT, 16#400).
--define(GL_FRONT_RIGHT, 16#401).
--define(GL_BACK_LEFT, 16#402).
--define(GL_BACK_RIGHT, 16#403).
--define(GL_AUX0, 16#409).
--define(GL_AUX1, 16#40A).
--define(GL_AUX2, 16#40B).
--define(GL_AUX3, 16#40C).
+-define(GL_LEFT, 16#0406).
+-define(GL_RIGHT, 16#0407).
+-define(GL_FRONT_LEFT, 16#0400).
+-define(GL_FRONT_RIGHT, 16#0401).
+-define(GL_BACK_LEFT, 16#0402).
+-define(GL_BACK_RIGHT, 16#0403).
+-define(GL_AUX0, 16#0409).
+-define(GL_AUX1, 16#040A).
+-define(GL_AUX2, 16#040B).
+-define(GL_AUX3, 16#040C).
-define(GL_COLOR_INDEX, 16#1900).
-define(GL_RED, 16#1903).
-define(GL_GREEN, 16#1904).
@@ -292,159 +292,161 @@
-define(GL_ALPHA, 16#1906).
-define(GL_LUMINANCE, 16#1909).
-define(GL_LUMINANCE_ALPHA, 16#190A).
--define(GL_ALPHA_BITS, 16#D55).
--define(GL_RED_BITS, 16#D52).
--define(GL_GREEN_BITS, 16#D53).
--define(GL_BLUE_BITS, 16#D54).
--define(GL_INDEX_BITS, 16#D51).
--define(GL_SUBPIXEL_BITS, 16#D50).
--define(GL_AUX_BUFFERS, 16#C00).
--define(GL_READ_BUFFER, 16#C02).
--define(GL_DRAW_BUFFER, 16#C01).
--define(GL_DOUBLEBUFFER, 16#C32).
--define(GL_STEREO, 16#C33).
+-define(GL_ALPHA_BITS, 16#0D55).
+-define(GL_RED_BITS, 16#0D52).
+-define(GL_GREEN_BITS, 16#0D53).
+-define(GL_BLUE_BITS, 16#0D54).
+-define(GL_INDEX_BITS, 16#0D51).
+-define(GL_SUBPIXEL_BITS, 16#0D50).
+-define(GL_AUX_BUFFERS, 16#0C00).
+-define(GL_READ_BUFFER, 16#0C02).
+-define(GL_DRAW_BUFFER, 16#0C01).
+-define(GL_DOUBLEBUFFER, 16#0C32).
+-define(GL_STEREO, 16#0C33).
-define(GL_BITMAP, 16#1A00).
-define(GL_COLOR, 16#1800).
-define(GL_DEPTH, 16#1801).
-define(GL_STENCIL, 16#1802).
--define(GL_DITHER, 16#BD0).
+-define(GL_DITHER, 16#0BD0).
-define(GL_RGB, 16#1907).
-define(GL_RGBA, 16#1908).
--define(GL_MAX_LIST_NESTING, 16#B31).
--define(GL_MAX_EVAL_ORDER, 16#D30).
--define(GL_MAX_LIGHTS, 16#D31).
--define(GL_MAX_CLIP_PLANES, 16#D32).
--define(GL_MAX_TEXTURE_SIZE, 16#D33).
--define(GL_MAX_PIXEL_MAP_TABLE, 16#D34).
--define(GL_MAX_ATTRIB_STACK_DEPTH, 16#D35).
--define(GL_MAX_MODELVIEW_STACK_DEPTH, 16#D36).
--define(GL_MAX_NAME_STACK_DEPTH, 16#D37).
--define(GL_MAX_PROJECTION_STACK_DEPTH, 16#D38).
--define(GL_MAX_TEXTURE_STACK_DEPTH, 16#D39).
--define(GL_MAX_VIEWPORT_DIMS, 16#D3A).
--define(GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, 16#D3B).
--define(GL_ATTRIB_STACK_DEPTH, 16#BB0).
--define(GL_CLIENT_ATTRIB_STACK_DEPTH, 16#BB1).
--define(GL_COLOR_CLEAR_VALUE, 16#C22).
--define(GL_COLOR_WRITEMASK, 16#C23).
--define(GL_CURRENT_INDEX, 16#B01).
--define(GL_CURRENT_COLOR, 16#B00).
--define(GL_CURRENT_NORMAL, 16#B02).
--define(GL_CURRENT_RASTER_COLOR, 16#B04).
--define(GL_CURRENT_RASTER_DISTANCE, 16#B09).
--define(GL_CURRENT_RASTER_INDEX, 16#B05).
--define(GL_CURRENT_RASTER_POSITION, 16#B07).
--define(GL_CURRENT_RASTER_TEXTURE_COORDS, 16#B06).
--define(GL_CURRENT_RASTER_POSITION_VALID, 16#B08).
--define(GL_CURRENT_TEXTURE_COORDS, 16#B03).
--define(GL_INDEX_CLEAR_VALUE, 16#C20).
--define(GL_INDEX_MODE, 16#C30).
--define(GL_INDEX_WRITEMASK, 16#C21).
--define(GL_MODELVIEW_MATRIX, 16#BA6).
--define(GL_MODELVIEW_STACK_DEPTH, 16#BA3).
--define(GL_NAME_STACK_DEPTH, 16#D70).
--define(GL_PROJECTION_MATRIX, 16#BA7).
--define(GL_PROJECTION_STACK_DEPTH, 16#BA4).
--define(GL_RENDER_MODE, 16#C40).
--define(GL_RGBA_MODE, 16#C31).
--define(GL_TEXTURE_MATRIX, 16#BA8).
--define(GL_TEXTURE_STACK_DEPTH, 16#BA5).
--define(GL_VIEWPORT, 16#BA2).
--define(GL_AUTO_NORMAL, 16#D80).
--define(GL_MAP1_COLOR_4, 16#D90).
--define(GL_MAP1_INDEX, 16#D91).
--define(GL_MAP1_NORMAL, 16#D92).
--define(GL_MAP1_TEXTURE_COORD_1, 16#D93).
--define(GL_MAP1_TEXTURE_COORD_2, 16#D94).
--define(GL_MAP1_TEXTURE_COORD_3, 16#D95).
--define(GL_MAP1_TEXTURE_COORD_4, 16#D96).
--define(GL_MAP1_VERTEX_3, 16#D97).
--define(GL_MAP1_VERTEX_4, 16#D98).
--define(GL_MAP2_COLOR_4, 16#DB0).
--define(GL_MAP2_INDEX, 16#DB1).
--define(GL_MAP2_NORMAL, 16#DB2).
--define(GL_MAP2_TEXTURE_COORD_1, 16#DB3).
--define(GL_MAP2_TEXTURE_COORD_2, 16#DB4).
--define(GL_MAP2_TEXTURE_COORD_3, 16#DB5).
--define(GL_MAP2_TEXTURE_COORD_4, 16#DB6).
--define(GL_MAP2_VERTEX_3, 16#DB7).
--define(GL_MAP2_VERTEX_4, 16#DB8).
--define(GL_MAP1_GRID_DOMAIN, 16#DD0).
--define(GL_MAP1_GRID_SEGMENTS, 16#DD1).
--define(GL_MAP2_GRID_DOMAIN, 16#DD2).
--define(GL_MAP2_GRID_SEGMENTS, 16#DD3).
--define(GL_COEFF, 16#A00).
--define(GL_ORDER, 16#A01).
--define(GL_DOMAIN, 16#A02).
--define(GL_PERSPECTIVE_CORRECTION_HINT, 16#C50).
--define(GL_POINT_SMOOTH_HINT, 16#C51).
--define(GL_LINE_SMOOTH_HINT, 16#C52).
--define(GL_POLYGON_SMOOTH_HINT, 16#C53).
--define(GL_FOG_HINT, 16#C54).
+-define(GL_MAX_LIST_NESTING, 16#0B31).
+-define(GL_MAX_EVAL_ORDER, 16#0D30).
+-define(GL_MAX_LIGHTS, 16#0D31).
+-define(GL_MAX_CLIP_PLANES, 16#0D32).
+-define(GL_MAX_TEXTURE_SIZE, 16#0D33).
+-define(GL_MAX_PIXEL_MAP_TABLE, 16#0D34).
+-define(GL_MAX_ATTRIB_STACK_DEPTH, 16#0D35).
+-define(GL_MAX_MODELVIEW_STACK_DEPTH, 16#0D36).
+-define(GL_MAX_NAME_STACK_DEPTH, 16#0D37).
+-define(GL_MAX_PROJECTION_STACK_DEPTH, 16#0D38).
+-define(GL_MAX_TEXTURE_STACK_DEPTH, 16#0D39).
+-define(GL_MAX_VIEWPORT_DIMS, 16#0D3A).
+-define(GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, 16#0D3B).
+-define(GL_ATTRIB_STACK_DEPTH, 16#0BB0).
+-define(GL_CLIENT_ATTRIB_STACK_DEPTH, 16#0BB1).
+-define(GL_COLOR_CLEAR_VALUE, 16#0C22).
+-define(GL_COLOR_WRITEMASK, 16#0C23).
+-define(GL_CURRENT_INDEX, 16#0B01).
+-define(GL_CURRENT_COLOR, 16#0B00).
+-define(GL_CURRENT_NORMAL, 16#0B02).
+-define(GL_CURRENT_RASTER_COLOR, 16#0B04).
+-define(GL_CURRENT_RASTER_DISTANCE, 16#0B09).
+-define(GL_CURRENT_RASTER_INDEX, 16#0B05).
+-define(GL_CURRENT_RASTER_POSITION, 16#0B07).
+-define(GL_CURRENT_RASTER_TEXTURE_COORDS, 16#0B06).
+-define(GL_CURRENT_RASTER_POSITION_VALID, 16#0B08).
+-define(GL_CURRENT_TEXTURE_COORDS, 16#0B03).
+-define(GL_INDEX_CLEAR_VALUE, 16#0C20).
+-define(GL_INDEX_MODE, 16#0C30).
+-define(GL_INDEX_WRITEMASK, 16#0C21).
+-define(GL_MODELVIEW_MATRIX, 16#0BA6).
+-define(GL_MODELVIEW_STACK_DEPTH, 16#0BA3).
+-define(GL_NAME_STACK_DEPTH, 16#0D70).
+-define(GL_PROJECTION_MATRIX, 16#0BA7).
+-define(GL_PROJECTION_STACK_DEPTH, 16#0BA4).
+-define(GL_RENDER_MODE, 16#0C40).
+-define(GL_RGBA_MODE, 16#0C31).
+-define(GL_TEXTURE_MATRIX, 16#0BA8).
+-define(GL_TEXTURE_STACK_DEPTH, 16#0BA5).
+-define(GL_VIEWPORT, 16#0BA2).
+-define(GL_AUTO_NORMAL, 16#0D80).
+-define(GL_MAP1_COLOR_4, 16#0D90).
+-define(GL_MAP1_INDEX, 16#0D91).
+-define(GL_MAP1_NORMAL, 16#0D92).
+-define(GL_MAP1_TEXTURE_COORD_1, 16#0D93).
+-define(GL_MAP1_TEXTURE_COORD_2, 16#0D94).
+-define(GL_MAP1_TEXTURE_COORD_3, 16#0D95).
+-define(GL_MAP1_TEXTURE_COORD_4, 16#0D96).
+-define(GL_MAP1_VERTEX_3, 16#0D97).
+-define(GL_MAP1_VERTEX_4, 16#0D98).
+-define(GL_MAP2_COLOR_4, 16#0DB0).
+-define(GL_MAP2_INDEX, 16#0DB1).
+-define(GL_MAP2_NORMAL, 16#0DB2).
+-define(GL_MAP2_TEXTURE_COORD_1, 16#0DB3).
+-define(GL_MAP2_TEXTURE_COORD_2, 16#0DB4).
+-define(GL_MAP2_TEXTURE_COORD_3, 16#0DB5).
+-define(GL_MAP2_TEXTURE_COORD_4, 16#0DB6).
+-define(GL_MAP2_VERTEX_3, 16#0DB7).
+-define(GL_MAP2_VERTEX_4, 16#0DB8).
+-define(GL_MAP1_GRID_DOMAIN, 16#0DD0).
+-define(GL_MAP1_GRID_SEGMENTS, 16#0DD1).
+-define(GL_MAP2_GRID_DOMAIN, 16#0DD2).
+-define(GL_MAP2_GRID_SEGMENTS, 16#0DD3).
+-define(GL_COEFF, 16#0A00).
+-define(GL_ORDER, 16#0A01).
+-define(GL_DOMAIN, 16#0A02).
+-define(GL_PERSPECTIVE_CORRECTION_HINT, 16#0C50).
+-define(GL_POINT_SMOOTH_HINT, 16#0C51).
+-define(GL_LINE_SMOOTH_HINT, 16#0C52).
+-define(GL_POLYGON_SMOOTH_HINT, 16#0C53).
+-define(GL_FOG_HINT, 16#0C54).
-define(GL_DONT_CARE, 16#1100).
-define(GL_FASTEST, 16#1101).
-define(GL_NICEST, 16#1102).
--define(GL_SCISSOR_BOX, 16#C10).
--define(GL_SCISSOR_TEST, 16#C11).
--define(GL_MAP_COLOR, 16#D10).
--define(GL_MAP_STENCIL, 16#D11).
--define(GL_INDEX_SHIFT, 16#D12).
--define(GL_INDEX_OFFSET, 16#D13).
--define(GL_RED_SCALE, 16#D14).
--define(GL_RED_BIAS, 16#D15).
--define(GL_GREEN_SCALE, 16#D18).
--define(GL_GREEN_BIAS, 16#D19).
--define(GL_BLUE_SCALE, 16#D1A).
--define(GL_BLUE_BIAS, 16#D1B).
--define(GL_ALPHA_SCALE, 16#D1C).
--define(GL_ALPHA_BIAS, 16#D1D).
--define(GL_DEPTH_SCALE, 16#D1E).
--define(GL_DEPTH_BIAS, 16#D1F).
--define(GL_PIXEL_MAP_S_TO_S_SIZE, 16#CB1).
--define(GL_PIXEL_MAP_I_TO_I_SIZE, 16#CB0).
--define(GL_PIXEL_MAP_I_TO_R_SIZE, 16#CB2).
--define(GL_PIXEL_MAP_I_TO_G_SIZE, 16#CB3).
--define(GL_PIXEL_MAP_I_TO_B_SIZE, 16#CB4).
--define(GL_PIXEL_MAP_I_TO_A_SIZE, 16#CB5).
--define(GL_PIXEL_MAP_R_TO_R_SIZE, 16#CB6).
--define(GL_PIXEL_MAP_G_TO_G_SIZE, 16#CB7).
--define(GL_PIXEL_MAP_B_TO_B_SIZE, 16#CB8).
--define(GL_PIXEL_MAP_A_TO_A_SIZE, 16#CB9).
--define(GL_PIXEL_MAP_S_TO_S, 16#C71).
--define(GL_PIXEL_MAP_I_TO_I, 16#C70).
--define(GL_PIXEL_MAP_I_TO_R, 16#C72).
--define(GL_PIXEL_MAP_I_TO_G, 16#C73).
--define(GL_PIXEL_MAP_I_TO_B, 16#C74).
--define(GL_PIXEL_MAP_I_TO_A, 16#C75).
--define(GL_PIXEL_MAP_R_TO_R, 16#C76).
--define(GL_PIXEL_MAP_G_TO_G, 16#C77).
--define(GL_PIXEL_MAP_B_TO_B, 16#C78).
--define(GL_PIXEL_MAP_A_TO_A, 16#C79).
--define(GL_PACK_ALIGNMENT, 16#D05).
--define(GL_PACK_LSB_FIRST, 16#D01).
--define(GL_PACK_ROW_LENGTH, 16#D02).
--define(GL_PACK_SKIP_PIXELS, 16#D04).
--define(GL_PACK_SKIP_ROWS, 16#D03).
--define(GL_PACK_SWAP_BYTES, 16#D00).
--define(GL_UNPACK_ALIGNMENT, 16#CF5).
--define(GL_UNPACK_LSB_FIRST, 16#CF1).
--define(GL_UNPACK_ROW_LENGTH, 16#CF2).
--define(GL_UNPACK_SKIP_PIXELS, 16#CF4).
--define(GL_UNPACK_SKIP_ROWS, 16#CF3).
--define(GL_UNPACK_SWAP_BYTES, 16#CF0).
--define(GL_ZOOM_X, 16#D16).
--define(GL_ZOOM_Y, 16#D17).
+-define(GL_SCISSOR_BOX, 16#0C10).
+-define(GL_SCISSOR_TEST, 16#0C11).
+-define(GL_MAP_COLOR, 16#0D10).
+-define(GL_MAP_STENCIL, 16#0D11).
+-define(GL_INDEX_SHIFT, 16#0D12).
+-define(GL_INDEX_OFFSET, 16#0D13).
+-define(GL_RED_SCALE, 16#0D14).
+-define(GL_RED_BIAS, 16#0D15).
+-define(GL_GREEN_SCALE, 16#0D18).
+-define(GL_GREEN_BIAS, 16#0D19).
+-define(GL_BLUE_SCALE, 16#0D1A).
+-define(GL_BLUE_BIAS, 16#0D1B).
+-define(GL_ALPHA_SCALE, 16#0D1C).
+-define(GL_ALPHA_BIAS, 16#0D1D).
+-define(GL_DEPTH_SCALE, 16#0D1E).
+-define(GL_DEPTH_BIAS, 16#0D1F).
+-define(GL_PIXEL_MAP_S_TO_S_SIZE, 16#0CB1).
+-define(GL_PIXEL_MAP_I_TO_I_SIZE, 16#0CB0).
+-define(GL_PIXEL_MAP_I_TO_R_SIZE, 16#0CB2).
+-define(GL_PIXEL_MAP_I_TO_G_SIZE, 16#0CB3).
+-define(GL_PIXEL_MAP_I_TO_B_SIZE, 16#0CB4).
+-define(GL_PIXEL_MAP_I_TO_A_SIZE, 16#0CB5).
+-define(GL_PIXEL_MAP_R_TO_R_SIZE, 16#0CB6).
+-define(GL_PIXEL_MAP_G_TO_G_SIZE, 16#0CB7).
+-define(GL_PIXEL_MAP_B_TO_B_SIZE, 16#0CB8).
+-define(GL_PIXEL_MAP_A_TO_A_SIZE, 16#0CB9).
+-define(GL_PIXEL_MAP_S_TO_S, 16#0C71).
+-define(GL_PIXEL_MAP_I_TO_I, 16#0C70).
+-define(GL_PIXEL_MAP_I_TO_R, 16#0C72).
+-define(GL_PIXEL_MAP_I_TO_G, 16#0C73).
+-define(GL_PIXEL_MAP_I_TO_B, 16#0C74).
+-define(GL_PIXEL_MAP_I_TO_A, 16#0C75).
+-define(GL_PIXEL_MAP_R_TO_R, 16#0C76).
+-define(GL_PIXEL_MAP_G_TO_G, 16#0C77).
+-define(GL_PIXEL_MAP_B_TO_B, 16#0C78).
+-define(GL_PIXEL_MAP_A_TO_A, 16#0C79).
+-define(GL_PACK_ALIGNMENT, 16#0D05).
+-define(GL_PACK_LSB_FIRST, 16#0D01).
+-define(GL_PACK_ROW_LENGTH, 16#0D02).
+-define(GL_PACK_SKIP_PIXELS, 16#0D04).
+-define(GL_PACK_SKIP_ROWS, 16#0D03).
+-define(GL_PACK_SWAP_BYTES, 16#0D00).
+-define(GL_UNPACK_ALIGNMENT, 16#0CF5).
+-define(GL_UNPACK_LSB_FIRST, 16#0CF1).
+-define(GL_UNPACK_ROW_LENGTH, 16#0CF2).
+-define(GL_UNPACK_SKIP_PIXELS, 16#0CF4).
+-define(GL_UNPACK_SKIP_ROWS, 16#0CF3).
+-define(GL_UNPACK_SWAP_BYTES, 16#0CF0).
+-define(GL_ZOOM_X, 16#0D16).
+-define(GL_ZOOM_Y, 16#0D17).
-define(GL_TEXTURE_ENV, 16#2300).
-define(GL_TEXTURE_ENV_MODE, 16#2200).
--define(GL_TEXTURE_1D, 16#DE0).
--define(GL_TEXTURE_2D, 16#DE1).
+-define(GL_TEXTURE_1D, 16#0DE0).
+-define(GL_TEXTURE_2D, 16#0DE1).
-define(GL_TEXTURE_WRAP_S, 16#2802).
-define(GL_TEXTURE_WRAP_T, 16#2803).
-define(GL_TEXTURE_MAG_FILTER, 16#2800).
-define(GL_TEXTURE_MIN_FILTER, 16#2801).
-define(GL_TEXTURE_ENV_COLOR, 16#2201).
--define(GL_TEXTURE_GEN_S, 16#C60).
--define(GL_TEXTURE_GEN_T, 16#C61).
+-define(GL_TEXTURE_GEN_S, 16#0C60).
+-define(GL_TEXTURE_GEN_T, 16#0C61).
+-define(GL_TEXTURE_GEN_R, 16#0C62).
+-define(GL_TEXTURE_GEN_Q, 16#0C63).
-define(GL_TEXTURE_GEN_MODE, 16#2500).
-define(GL_TEXTURE_BORDER_COLOR, 16#1004).
-define(GL_TEXTURE_WIDTH, 16#1000).
@@ -475,40 +477,38 @@
-define(GL_T, 16#2001).
-define(GL_R, 16#2002).
-define(GL_Q, 16#2003).
--define(GL_TEXTURE_GEN_R, 16#C62).
--define(GL_TEXTURE_GEN_Q, 16#C63).
-define(GL_VENDOR, 16#1F00).
-define(GL_RENDERER, 16#1F01).
-define(GL_VERSION, 16#1F02).
-define(GL_EXTENSIONS, 16#1F03).
-define(GL_NO_ERROR, 16#0).
--define(GL_INVALID_ENUM, 16#500).
--define(GL_INVALID_VALUE, 16#501).
--define(GL_INVALID_OPERATION, 16#502).
--define(GL_STACK_OVERFLOW, 16#503).
--define(GL_STACK_UNDERFLOW, 16#504).
--define(GL_OUT_OF_MEMORY, 16#505).
--define(GL_CURRENT_BIT, 16#1).
--define(GL_POINT_BIT, 16#2).
--define(GL_LINE_BIT, 16#4).
--define(GL_POLYGON_BIT, 16#8).
--define(GL_POLYGON_STIPPLE_BIT, 16#10).
--define(GL_PIXEL_MODE_BIT, 16#20).
--define(GL_LIGHTING_BIT, 16#40).
--define(GL_FOG_BIT, 16#80).
--define(GL_DEPTH_BUFFER_BIT, 16#100).
--define(GL_ACCUM_BUFFER_BIT, 16#200).
--define(GL_STENCIL_BUFFER_BIT, 16#400).
--define(GL_VIEWPORT_BIT, 16#800).
--define(GL_TRANSFORM_BIT, 16#1000).
--define(GL_ENABLE_BIT, 16#2000).
--define(GL_COLOR_BUFFER_BIT, 16#4000).
--define(GL_HINT_BIT, 16#8000).
--define(GL_EVAL_BIT, 16#10000).
--define(GL_LIST_BIT, 16#20000).
--define(GL_TEXTURE_BIT, 16#40000).
--define(GL_SCISSOR_BIT, 16#80000).
--define(GL_ALL_ATTRIB_BITS, 16#FFFFF).
+-define(GL_INVALID_ENUM, 16#0500).
+-define(GL_INVALID_VALUE, 16#0501).
+-define(GL_INVALID_OPERATION, 16#0502).
+-define(GL_STACK_OVERFLOW, 16#0503).
+-define(GL_STACK_UNDERFLOW, 16#0504).
+-define(GL_OUT_OF_MEMORY, 16#0505).
+-define(GL_CURRENT_BIT, 16#00000001).
+-define(GL_POINT_BIT, 16#00000002).
+-define(GL_LINE_BIT, 16#00000004).
+-define(GL_POLYGON_BIT, 16#00000008).
+-define(GL_POLYGON_STIPPLE_BIT, 16#00000010).
+-define(GL_PIXEL_MODE_BIT, 16#00000020).
+-define(GL_LIGHTING_BIT, 16#00000040).
+-define(GL_FOG_BIT, 16#00000080).
+-define(GL_DEPTH_BUFFER_BIT, 16#00000100).
+-define(GL_ACCUM_BUFFER_BIT, 16#00000200).
+-define(GL_STENCIL_BUFFER_BIT, 16#00000400).
+-define(GL_VIEWPORT_BIT, 16#00000800).
+-define(GL_TRANSFORM_BIT, 16#00001000).
+-define(GL_ENABLE_BIT, 16#00002000).
+-define(GL_COLOR_BUFFER_BIT, 16#00004000).
+-define(GL_HINT_BIT, 16#00008000).
+-define(GL_EVAL_BIT, 16#00010000).
+-define(GL_LIST_BIT, 16#00020000).
+-define(GL_TEXTURE_BIT, 16#00040000).
+-define(GL_SCISSOR_BIT, 16#00080000).
+-define(GL_ALL_ATTRIB_BITS, 16#000FFFFF).
-define(GL_PROXY_TEXTURE_1D, 16#8063).
-define(GL_PROXY_TEXTURE_2D, 16#8064).
-define(GL_TEXTURE_PRIORITY, 16#8066).
@@ -549,8 +549,8 @@
-define(GL_RGB10_A2, 16#8059).
-define(GL_RGBA12, 16#805A).
-define(GL_RGBA16, 16#805B).
--define(GL_CLIENT_PIXEL_STORE_BIT, 16#1).
--define(GL_CLIENT_VERTEX_ARRAY_BIT, 16#2).
+-define(GL_CLIENT_PIXEL_STORE_BIT, 16#00000001).
+-define(GL_CLIENT_VERTEX_ARRAY_BIT, 16#00000002).
-define(GL_ALL_CLIENT_ATTRIB_BITS, 16#FFFFFFFF).
-define(GL_CLIENT_ALL_ATTRIB_BITS, 16#FFFFFFFF).
-define(GL_RESCALE_NORMAL, 16#803A).
@@ -578,10 +578,10 @@
-define(GL_TEXTURE_MAX_LOD, 16#813B).
-define(GL_TEXTURE_BASE_LEVEL, 16#813C).
-define(GL_TEXTURE_MAX_LEVEL, 16#813D).
--define(GL_SMOOTH_POINT_SIZE_RANGE, 16#B12).
--define(GL_SMOOTH_POINT_SIZE_GRANULARITY, 16#B13).
--define(GL_SMOOTH_LINE_WIDTH_RANGE, 16#B22).
--define(GL_SMOOTH_LINE_WIDTH_GRANULARITY, 16#B23).
+-define(GL_SMOOTH_POINT_SIZE_RANGE, 16#0B12).
+-define(GL_SMOOTH_POINT_SIZE_GRANULARITY, 16#0B13).
+-define(GL_SMOOTH_LINE_WIDTH_RANGE, 16#0B22).
+-define(GL_SMOOTH_LINE_WIDTH_GRANULARITY, 16#0B23).
-define(GL_ALIASED_POINT_SIZE_RANGE, 16#846D).
-define(GL_ALIASED_LINE_WIDTH_RANGE, 16#846E).
-define(GL_PACK_SKIP_IMAGES, 16#806B).
@@ -808,14 +808,14 @@
-define(GL_UNSIGNED_SHORT_15_1_MESA, 16#8753).
-define(GL_UNSIGNED_SHORT_1_15_REV_MESA, 16#8754).
-define(GL_MESA_program_debug, 1).
--define(GL_FRAGMENT_PROGRAM_POSITION_MESA, 16#8BB0).
--define(GL_FRAGMENT_PROGRAM_CALLBACK_MESA, 16#8BB1).
--define(GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA, 16#8BB2).
--define(GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA, 16#8BB3).
--define(GL_VERTEX_PROGRAM_POSITION_MESA, 16#8BB4).
--define(GL_VERTEX_PROGRAM_CALLBACK_MESA, 16#8BB5).
--define(GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA, 16#8BB6).
--define(GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA, 16#8BB7).
+-define(GL_FRAGMENT_PROGRAM_POSITION_MESA, 16#8bb0).
+-define(GL_FRAGMENT_PROGRAM_CALLBACK_MESA, 16#8bb1).
+-define(GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA, 16#8bb2).
+-define(GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA, 16#8bb3).
+-define(GL_VERTEX_PROGRAM_POSITION_MESA, 16#8bb4).
+-define(GL_VERTEX_PROGRAM_CALLBACK_MESA, 16#8bb5).
+-define(GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA, 16#8bb6).
+-define(GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA, 16#8bb7).
-define(GL_MESA_texture_array, 1).
-define(GL_TEXTURE_1D_ARRAY_EXT, 16#8C18).
-define(GL_PROXY_TEXTURE_1D_ARRAY_EXT, 16#8C19).
@@ -828,7 +828,7 @@
-define(GL_ATI_blend_equation_separate, 1).
-define(GL_ALPHA_BLEND_EQUATION_ATI, 16#883D).
-define(GL_OES_EGL_image, 1).
--define(GL_GLEXT_VERSION, 66).
+-define(GL_GLEXT_VERSION, 75).
-define(GL_BLEND_DST_RGB, 16#80C8).
-define(GL_BLEND_SRC_RGB, 16#80C9).
-define(GL_BLEND_DST_ALPHA, 16#80CA).
@@ -1034,16 +1034,14 @@
-define(GL_CLIP_DISTANCE5, 16#3005).
-define(GL_CLIP_DISTANCE6, 16#3006).
-define(GL_CLIP_DISTANCE7, 16#3007).
--define(GL_MAX_CLIP_DISTANCES, 16#D32).
+-define(GL_MAX_CLIP_DISTANCES, 16#0D32).
-define(GL_MAJOR_VERSION, 16#821B).
-define(GL_MINOR_VERSION, 16#821C).
-define(GL_NUM_EXTENSIONS, 16#821D).
-define(GL_CONTEXT_FLAGS, 16#821E).
--define(GL_DEPTH_BUFFER, 16#8223).
--define(GL_STENCIL_BUFFER, 16#8224).
-define(GL_COMPRESSED_RED, 16#8225).
-define(GL_COMPRESSED_RG, 16#8226).
--define(GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT, 16#1).
+-define(GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT, 16#0001).
-define(GL_RGBA32F, 16#8814).
-define(GL_RGB32F, 16#8815).
-define(GL_RGBA16F, 16#881A).
@@ -1161,12 +1159,12 @@
-define(GL_SIGNED_NORMALIZED, 16#8F9C).
-define(GL_PRIMITIVE_RESTART, 16#8F9D).
-define(GL_PRIMITIVE_RESTART_INDEX, 16#8F9E).
--define(GL_CONTEXT_CORE_PROFILE_BIT, 16#1).
--define(GL_CONTEXT_COMPATIBILITY_PROFILE_BIT, 16#2).
--define(GL_LINES_ADJACENCY, 16#A).
--define(GL_LINE_STRIP_ADJACENCY, 16#B).
--define(GL_TRIANGLES_ADJACENCY, 16#C).
--define(GL_TRIANGLE_STRIP_ADJACENCY, 16#D).
+-define(GL_CONTEXT_CORE_PROFILE_BIT, 16#00000001).
+-define(GL_CONTEXT_COMPATIBILITY_PROFILE_BIT, 16#00000002).
+-define(GL_LINES_ADJACENCY, 16#000A).
+-define(GL_LINE_STRIP_ADJACENCY, 16#000B).
+-define(GL_TRIANGLES_ADJACENCY, 16#000C).
+-define(GL_TRIANGLE_STRIP_ADJACENCY, 16#000D).
-define(GL_PROGRAM_POINT_SIZE, 16#8642).
-define(GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS, 16#8C29).
-define(GL_FRAMEBUFFER_ATTACHMENT_LAYERED, 16#8DA7).
@@ -1553,7 +1551,7 @@
-define(GL_DEPTH_COMPONENT32F, 16#8CAC).
-define(GL_DEPTH32F_STENCIL8, 16#8CAD).
-define(GL_FLOAT_32_UNSIGNED_INT_24_8_REV, 16#8DAD).
--define(GL_INVALID_FRAMEBUFFER_OPERATION, 16#506).
+-define(GL_INVALID_FRAMEBUFFER_OPERATION, 16#0506).
-define(GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, 16#8210).
-define(GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, 16#8211).
-define(GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, 16#8212).
@@ -1634,10 +1632,10 @@
-define(GL_TEXTURE_LUMINANCE_TYPE, 16#8C14).
-define(GL_TEXTURE_INTENSITY_TYPE, 16#8C15).
-define(GL_FRAMEBUFFER_SRGB, 16#8DB9).
--define(GL_LINES_ADJACENCY_ARB, 16#A).
--define(GL_LINE_STRIP_ADJACENCY_ARB, 16#B).
--define(GL_TRIANGLES_ADJACENCY_ARB, 16#C).
--define(GL_TRIANGLE_STRIP_ADJACENCY_ARB, 16#D).
+-define(GL_LINES_ADJACENCY_ARB, 16#000A).
+-define(GL_LINE_STRIP_ADJACENCY_ARB, 16#000B).
+-define(GL_TRIANGLES_ADJACENCY_ARB, 16#000C).
+-define(GL_TRIANGLE_STRIP_ADJACENCY_ARB, 16#000D).
-define(GL_PROGRAM_POINT_SIZE_ARB, 16#8642).
-define(GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB, 16#8C29).
-define(GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB, 16#8DA7).
@@ -1654,12 +1652,12 @@
-define(GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB, 16#8DE1).
-define(GL_HALF_FLOAT, 16#140B).
-define(GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB, 16#88FE).
--define(GL_MAP_READ_BIT, 16#1).
--define(GL_MAP_WRITE_BIT, 16#2).
--define(GL_MAP_INVALIDATE_RANGE_BIT, 16#4).
--define(GL_MAP_INVALIDATE_BUFFER_BIT, 16#8).
--define(GL_MAP_FLUSH_EXPLICIT_BIT, 16#10).
--define(GL_MAP_UNSYNCHRONIZED_BIT, 16#20).
+-define(GL_MAP_READ_BIT, 16#0001).
+-define(GL_MAP_WRITE_BIT, 16#0002).
+-define(GL_MAP_INVALIDATE_RANGE_BIT, 16#0004).
+-define(GL_MAP_INVALIDATE_BUFFER_BIT, 16#0008).
+-define(GL_MAP_FLUSH_EXPLICIT_BIT, 16#0010).
+-define(GL_MAP_UNSYNCHRONIZED_BIT, 16#0020).
-define(GL_TEXTURE_BUFFER_ARB, 16#8C2A).
-define(GL_MAX_TEXTURE_BUFFER_SIZE_ARB, 16#8C2B).
-define(GL_TEXTURE_BINDING_BUFFER_ARB, 16#8C2C).
@@ -1724,7 +1722,7 @@
-define(GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER, 16#8A44).
-define(GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER, 16#8A45).
-define(GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER, 16#8A46).
--define(GL_INVALID_INDEX, 16#FFFFFFFF).
+-define(GL_INVALID_INDEX, 16#FFFFFFFFu).
-define(GL_COPY_READ_BUFFER, 16#8F36).
-define(GL_COPY_WRITE_BUFFER, 16#8F37).
-define(GL_DEPTH_CLAMP, 16#864F).
@@ -1746,8 +1744,8 @@
-define(GL_TIMEOUT_EXPIRED, 16#911B).
-define(GL_CONDITION_SATISFIED, 16#911C).
-define(GL_WAIT_FAILED, 16#911D).
--define(GL_SYNC_FLUSH_COMMANDS_BIT, 16#1).
--define(GL_TIMEOUT_IGNORED, 16#FFFFFFFFFFFFFFFF).
+-define(GL_SYNC_FLUSH_COMMANDS_BIT, 16#00000001).
+-define(GL_TIMEOUT_IGNORED, 16#FFFFFFFFFFFFFFFFull).
-define(GL_SAMPLE_POSITION, 16#8E50).
-define(GL_SAMPLE_MASK, 16#8E51).
-define(GL_SAMPLE_MASK_VALUE, 16#8E52).
@@ -1830,7 +1828,7 @@
-define(GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS, 16#8DE8).
-define(GL_NUM_COMPATIBLE_SUBROUTINES, 16#8E4A).
-define(GL_COMPATIBLE_SUBROUTINES, 16#8E4B).
--define(GL_PATCHES, 16#E).
+-define(GL_PATCHES, 16#000E).
-define(GL_PATCH_VERTICES, 16#8E72).
-define(GL_PATCH_DEFAULT_INNER_LEVEL, 16#8E73).
-define(GL_PATCH_DEFAULT_OUTER_LEVEL, 16#8E74).
@@ -1886,11 +1884,11 @@
-define(GL_PROGRAM_BINARY_LENGTH, 16#8741).
-define(GL_NUM_PROGRAM_BINARY_FORMATS, 16#87FE).
-define(GL_PROGRAM_BINARY_FORMATS, 16#87FF).
--define(GL_VERTEX_SHADER_BIT, 16#1).
--define(GL_FRAGMENT_SHADER_BIT, 16#2).
--define(GL_GEOMETRY_SHADER_BIT, 16#4).
--define(GL_TESS_CONTROL_SHADER_BIT, 16#8).
--define(GL_TESS_EVALUATION_SHADER_BIT, 16#10).
+-define(GL_VERTEX_SHADER_BIT, 16#00000001).
+-define(GL_FRAGMENT_SHADER_BIT, 16#00000002).
+-define(GL_GEOMETRY_SHADER_BIT, 16#00000004).
+-define(GL_TESS_CONTROL_SHADER_BIT, 16#00000008).
+-define(GL_TESS_EVALUATION_SHADER_BIT, 16#00000010).
-define(GL_ALL_SHADER_BITS, 16#FFFFFFFF).
-define(GL_PROGRAM_SEPARABLE, 16#8258).
-define(GL_ACTIVE_PROGRAM, 16#8259).
@@ -1925,13 +1923,117 @@
-define(GL_DEBUG_SEVERITY_HIGH_ARB, 16#9146).
-define(GL_DEBUG_SEVERITY_MEDIUM_ARB, 16#9147).
-define(GL_DEBUG_SEVERITY_LOW_ARB, 16#9148).
--define(GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB, 16#4).
+-define(GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB, 16#00000004).
-define(GL_LOSE_CONTEXT_ON_RESET_ARB, 16#8252).
-define(GL_GUILTY_CONTEXT_RESET_ARB, 16#8253).
-define(GL_INNOCENT_CONTEXT_RESET_ARB, 16#8254).
-define(GL_UNKNOWN_CONTEXT_RESET_ARB, 16#8255).
-define(GL_RESET_NOTIFICATION_STRATEGY_ARB, 16#8256).
-define(GL_NO_RESET_NOTIFICATION_ARB, 16#8261).
+-define(GL_UNPACK_COMPRESSED_BLOCK_WIDTH, 16#9127).
+-define(GL_UNPACK_COMPRESSED_BLOCK_HEIGHT, 16#9128).
+-define(GL_UNPACK_COMPRESSED_BLOCK_DEPTH, 16#9129).
+-define(GL_UNPACK_COMPRESSED_BLOCK_SIZE, 16#912A).
+-define(GL_PACK_COMPRESSED_BLOCK_WIDTH, 16#912B).
+-define(GL_PACK_COMPRESSED_BLOCK_HEIGHT, 16#912C).
+-define(GL_PACK_COMPRESSED_BLOCK_DEPTH, 16#912D).
+-define(GL_PACK_COMPRESSED_BLOCK_SIZE, 16#912E).
+-define(GL_NUM_SAMPLE_COUNTS, 16#9380).
+-define(GL_MIN_MAP_BUFFER_ALIGNMENT, 16#90BC).
+-define(GL_ATOMIC_COUNTER_BUFFER, 16#92C0).
+-define(GL_ATOMIC_COUNTER_BUFFER_BINDING, 16#92C1).
+-define(GL_ATOMIC_COUNTER_BUFFER_START, 16#92C2).
+-define(GL_ATOMIC_COUNTER_BUFFER_SIZE, 16#92C3).
+-define(GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE, 16#92C4).
+-define(GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS, 16#92C5).
+-define(GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES, 16#92C6).
+-define(GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER, 16#92C7).
+-define(GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER, 16#92C8).
+-define(GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER, 16#92C9).
+-define(GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER, 16#92CA).
+-define(GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER, 16#92CB).
+-define(GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS, 16#92CC).
+-define(GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS, 16#92CD).
+-define(GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS, 16#92CE).
+-define(GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS, 16#92CF).
+-define(GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS, 16#92D0).
+-define(GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS, 16#92D1).
+-define(GL_MAX_VERTEX_ATOMIC_COUNTERS, 16#92D2).
+-define(GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS, 16#92D3).
+-define(GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS, 16#92D4).
+-define(GL_MAX_GEOMETRY_ATOMIC_COUNTERS, 16#92D5).
+-define(GL_MAX_FRAGMENT_ATOMIC_COUNTERS, 16#92D6).
+-define(GL_MAX_COMBINED_ATOMIC_COUNTERS, 16#92D7).
+-define(GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE, 16#92D8).
+-define(GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, 16#92DC).
+-define(GL_ACTIVE_ATOMIC_COUNTER_BUFFERS, 16#92D9).
+-define(GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX, 16#92DA).
+-define(GL_UNSIGNED_INT_ATOMIC_COUNTER, 16#92DB).
+-define(GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT, 16#00000001).
+-define(GL_ELEMENT_ARRAY_BARRIER_BIT, 16#00000002).
+-define(GL_UNIFORM_BARRIER_BIT, 16#00000004).
+-define(GL_TEXTURE_FETCH_BARRIER_BIT, 16#00000008).
+-define(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT, 16#00000020).
+-define(GL_COMMAND_BARRIER_BIT, 16#00000040).
+-define(GL_PIXEL_BUFFER_BARRIER_BIT, 16#00000080).
+-define(GL_TEXTURE_UPDATE_BARRIER_BIT, 16#00000100).
+-define(GL_BUFFER_UPDATE_BARRIER_BIT, 16#00000200).
+-define(GL_FRAMEBUFFER_BARRIER_BIT, 16#00000400).
+-define(GL_TRANSFORM_FEEDBACK_BARRIER_BIT, 16#00000800).
+-define(GL_ATOMIC_COUNTER_BARRIER_BIT, 16#00001000).
+-define(GL_ALL_BARRIER_BITS, 16#FFFFFFFF).
+-define(GL_MAX_IMAGE_UNITS, 16#8F38).
+-define(GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS, 16#8F39).
+-define(GL_IMAGE_BINDING_NAME, 16#8F3A).
+-define(GL_IMAGE_BINDING_LEVEL, 16#8F3B).
+-define(GL_IMAGE_BINDING_LAYERED, 16#8F3C).
+-define(GL_IMAGE_BINDING_LAYER, 16#8F3D).
+-define(GL_IMAGE_BINDING_ACCESS, 16#8F3E).
+-define(GL_IMAGE_1D, 16#904C).
+-define(GL_IMAGE_2D, 16#904D).
+-define(GL_IMAGE_3D, 16#904E).
+-define(GL_IMAGE_2D_RECT, 16#904F).
+-define(GL_IMAGE_CUBE, 16#9050).
+-define(GL_IMAGE_BUFFER, 16#9051).
+-define(GL_IMAGE_1D_ARRAY, 16#9052).
+-define(GL_IMAGE_2D_ARRAY, 16#9053).
+-define(GL_IMAGE_CUBE_MAP_ARRAY, 16#9054).
+-define(GL_IMAGE_2D_MULTISAMPLE, 16#9055).
+-define(GL_IMAGE_2D_MULTISAMPLE_ARRAY, 16#9056).
+-define(GL_INT_IMAGE_1D, 16#9057).
+-define(GL_INT_IMAGE_2D, 16#9058).
+-define(GL_INT_IMAGE_3D, 16#9059).
+-define(GL_INT_IMAGE_2D_RECT, 16#905A).
+-define(GL_INT_IMAGE_CUBE, 16#905B).
+-define(GL_INT_IMAGE_BUFFER, 16#905C).
+-define(GL_INT_IMAGE_1D_ARRAY, 16#905D).
+-define(GL_INT_IMAGE_2D_ARRAY, 16#905E).
+-define(GL_INT_IMAGE_CUBE_MAP_ARRAY, 16#905F).
+-define(GL_INT_IMAGE_2D_MULTISAMPLE, 16#9060).
+-define(GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY, 16#9061).
+-define(GL_UNSIGNED_INT_IMAGE_1D, 16#9062).
+-define(GL_UNSIGNED_INT_IMAGE_2D, 16#9063).
+-define(GL_UNSIGNED_INT_IMAGE_3D, 16#9064).
+-define(GL_UNSIGNED_INT_IMAGE_2D_RECT, 16#9065).
+-define(GL_UNSIGNED_INT_IMAGE_CUBE, 16#9066).
+-define(GL_UNSIGNED_INT_IMAGE_BUFFER, 16#9067).
+-define(GL_UNSIGNED_INT_IMAGE_1D_ARRAY, 16#9068).
+-define(GL_UNSIGNED_INT_IMAGE_2D_ARRAY, 16#9069).
+-define(GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY, 16#906A).
+-define(GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE, 16#906B).
+-define(GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY, 16#906C).
+-define(GL_MAX_IMAGE_SAMPLES, 16#906D).
+-define(GL_IMAGE_BINDING_FORMAT, 16#906E).
+-define(GL_IMAGE_FORMAT_COMPATIBILITY_TYPE, 16#90C7).
+-define(GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE, 16#90C8).
+-define(GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS, 16#90C9).
+-define(GL_MAX_VERTEX_IMAGE_UNIFORMS, 16#90CA).
+-define(GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS, 16#90CB).
+-define(GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS, 16#90CC).
+-define(GL_MAX_GEOMETRY_IMAGE_UNIFORMS, 16#90CD).
+-define(GL_MAX_FRAGMENT_IMAGE_UNIFORMS, 16#90CE).
+-define(GL_MAX_COMBINED_IMAGE_UNIFORMS, 16#90CF).
+-define(GL_TEXTURE_IMMUTABLE_FORMAT, 16#912F).
-define(GL_ABGR_EXT, 16#8000).
-define(GL_CONSTANT_COLOR_EXT, 16#8001).
-define(GL_ONE_MINUS_CONSTANT_COLOR_EXT, 16#8002).
@@ -2235,8 +2337,8 @@
-define(GL_FRAMEZOOM_SGIX, 16#818B).
-define(GL_FRAMEZOOM_FACTOR_SGIX, 16#818C).
-define(GL_MAX_FRAMEZOOM_FACTOR_SGIX, 16#818D).
--define(GL_TEXTURE_DEFORMATION_BIT_SGIX, 16#1).
--define(GL_GEOMETRY_DEFORMATION_BIT_SGIX, 16#2).
+-define(GL_TEXTURE_DEFORMATION_BIT_SGIX, 16#00000001).
+-define(GL_GEOMETRY_DEFORMATION_BIT_SGIX, 16#00000002).
-define(GL_GEOMETRY_DEFORMATION_SGIX, 16#8194).
-define(GL_TEXTURE_DEFORMATION_SGIX, 16#8195).
-define(GL_DEFORMATIONS_MASK_SGIX, 16#8196).
@@ -2275,24 +2377,24 @@
-define(GL_VERTEX_CONSISTENT_HINT_PGI, 16#1A22B).
-define(GL_MATERIAL_SIDE_HINT_PGI, 16#1A22C).
-define(GL_MAX_VERTEX_HINT_PGI, 16#1A22D).
--define(GL_COLOR3_BIT_PGI, 16#10000).
--define(GL_COLOR4_BIT_PGI, 16#20000).
--define(GL_EDGEFLAG_BIT_PGI, 16#40000).
--define(GL_INDEX_BIT_PGI, 16#80000).
--define(GL_MAT_AMBIENT_BIT_PGI, 16#100000).
--define(GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI, 16#200000).
--define(GL_MAT_DIFFUSE_BIT_PGI, 16#400000).
--define(GL_MAT_EMISSION_BIT_PGI, 16#800000).
--define(GL_MAT_COLOR_INDEXES_BIT_PGI, 16#1000000).
--define(GL_MAT_SHININESS_BIT_PGI, 16#2000000).
--define(GL_MAT_SPECULAR_BIT_PGI, 16#4000000).
--define(GL_NORMAL_BIT_PGI, 16#8000000).
+-define(GL_COLOR3_BIT_PGI, 16#00010000).
+-define(GL_COLOR4_BIT_PGI, 16#00020000).
+-define(GL_EDGEFLAG_BIT_PGI, 16#00040000).
+-define(GL_INDEX_BIT_PGI, 16#00080000).
+-define(GL_MAT_AMBIENT_BIT_PGI, 16#00100000).
+-define(GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI, 16#00200000).
+-define(GL_MAT_DIFFUSE_BIT_PGI, 16#00400000).
+-define(GL_MAT_EMISSION_BIT_PGI, 16#00800000).
+-define(GL_MAT_COLOR_INDEXES_BIT_PGI, 16#01000000).
+-define(GL_MAT_SHININESS_BIT_PGI, 16#02000000).
+-define(GL_MAT_SPECULAR_BIT_PGI, 16#04000000).
+-define(GL_NORMAL_BIT_PGI, 16#08000000).
-define(GL_TEXCOORD1_BIT_PGI, 16#10000000).
-define(GL_TEXCOORD2_BIT_PGI, 16#20000000).
-define(GL_TEXCOORD3_BIT_PGI, 16#40000000).
-define(GL_TEXCOORD4_BIT_PGI, 16#80000000).
--define(GL_VERTEX23_BIT_PGI, 16#4).
--define(GL_VERTEX4_BIT_PGI, 16#8).
+-define(GL_VERTEX23_BIT_PGI, 16#00000004).
+-define(GL_VERTEX4_BIT_PGI, 16#00000008).
-define(GL_PREFER_DOUBLEBUFFER_HINT_PGI, 16#1A1F8).
-define(GL_CONSERVE_MEMORY_HINT_PGI, 16#1A1FD).
-define(GL_RECLAIM_MEMORY_HINT_PGI, 16#1A1FE).
@@ -2489,9 +2591,9 @@
-define(GL_TEXTURE_CONSTANT_DATA_SUNX, 16#81D6).
-define(GL_GLOBAL_ALPHA_SUN, 16#81D9).
-define(GL_GLOBAL_ALPHA_FACTOR_SUN, 16#81DA).
--define(GL_RESTART_SUN, 16#1).
--define(GL_REPLACE_MIDDLE_SUN, 16#2).
--define(GL_REPLACE_OLDEST_SUN, 16#3).
+-define(GL_RESTART_SUN, 16#0001).
+-define(GL_REPLACE_MIDDLE_SUN, 16#0002).
+-define(GL_REPLACE_OLDEST_SUN, 16#0003).
-define(GL_TRIANGLE_LIST_SUN, 16#81D7).
-define(GL_REPLACEMENT_CODE_SUN, 16#81D8).
-define(GL_REPLACEMENT_CODE_ARRAY_SUN, 16#85C0).
@@ -3010,19 +3112,19 @@
-define(GL_SWIZZLE_STQ_DQ_ATI, 16#8979).
-define(GL_SWIZZLE_STRQ_ATI, 16#897A).
-define(GL_SWIZZLE_STRQ_DQ_ATI, 16#897B).
--define(GL_RED_BIT_ATI, 16#1).
--define(GL_GREEN_BIT_ATI, 16#2).
--define(GL_BLUE_BIT_ATI, 16#4).
--define(GL_2X_BIT_ATI, 16#1).
--define(GL_4X_BIT_ATI, 16#2).
--define(GL_8X_BIT_ATI, 16#4).
--define(GL_HALF_BIT_ATI, 16#8).
--define(GL_QUARTER_BIT_ATI, 16#10).
--define(GL_EIGHTH_BIT_ATI, 16#20).
--define(GL_SATURATE_BIT_ATI, 16#40).
--define(GL_COMP_BIT_ATI, 16#2).
--define(GL_NEGATE_BIT_ATI, 16#4).
--define(GL_BIAS_BIT_ATI, 16#8).
+-define(GL_RED_BIT_ATI, 16#00000001).
+-define(GL_GREEN_BIT_ATI, 16#00000002).
+-define(GL_BLUE_BIT_ATI, 16#00000004).
+-define(GL_2X_BIT_ATI, 16#00000001).
+-define(GL_4X_BIT_ATI, 16#00000002).
+-define(GL_8X_BIT_ATI, 16#00000004).
+-define(GL_HALF_BIT_ATI, 16#00000008).
+-define(GL_QUARTER_BIT_ATI, 16#00000010).
+-define(GL_EIGHTH_BIT_ATI, 16#00000020).
+-define(GL_SATURATE_BIT_ATI, 16#00000040).
+-define(GL_COMP_BIT_ATI, 16#00000002).
+-define(GL_NEGATE_BIT_ATI, 16#00000004).
+-define(GL_BIAS_BIT_ATI, 16#00000008).
-define(GL_PN_TRIANGLES_ATI, 16#87F0).
-define(GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI, 16#87F1).
-define(GL_PN_TRIANGLES_POINT_MODE_ATI, 16#87F2).
@@ -3307,7 +3409,7 @@
-define(GL_MAX_PROGRAM_IF_DEPTH_NV, 16#88F6).
-define(GL_MAX_PROGRAM_LOOP_DEPTH_NV, 16#88F7).
-define(GL_MAX_PROGRAM_LOOP_COUNT_NV, 16#88F8).
--define(GL_INVALID_FRAMEBUFFER_OPERATION_EXT, 16#506).
+-define(GL_INVALID_FRAMEBUFFER_OPERATION_EXT, 16#0506).
-define(GL_MAX_RENDERBUFFER_SIZE_EXT, 16#84E8).
-define(GL_FRAMEBUFFER_BINDING_EXT, 16#8CA6).
-define(GL_RENDERBUFFER_BINDING_EXT, 16#8CA7).
@@ -3404,10 +3506,10 @@
-define(GL_MAX_PROGRAM_RESULT_COMPONENTS_NV, 16#8909).
-define(GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV, 16#8DA5).
-define(GL_MAX_PROGRAM_GENERIC_RESULTS_NV, 16#8DA6).
--define(GL_LINES_ADJACENCY_EXT, 16#A).
--define(GL_LINE_STRIP_ADJACENCY_EXT, 16#B).
--define(GL_TRIANGLES_ADJACENCY_EXT, 16#C).
--define(GL_TRIANGLE_STRIP_ADJACENCY_EXT, 16#D).
+-define(GL_LINES_ADJACENCY_EXT, 16#000A).
+-define(GL_LINE_STRIP_ADJACENCY_EXT, 16#000B).
+-define(GL_TRIANGLES_ADJACENCY_EXT, 16#000C).
+-define(GL_TRIANGLE_STRIP_ADJACENCY_EXT, 16#000D).
-define(GL_GEOMETRY_PROGRAM_NV, 16#8C26).
-define(GL_MAX_PROGRAM_OUTPUT_VERTICES_NV, 16#8C27).
-define(GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV, 16#8C28).
@@ -3789,18 +3891,18 @@
-define(GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT, 16#906C).
-define(GL_MAX_IMAGE_SAMPLES_EXT, 16#906D).
-define(GL_IMAGE_BINDING_FORMAT_EXT, 16#906E).
--define(GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT, 16#1).
--define(GL_ELEMENT_ARRAY_BARRIER_BIT_EXT, 16#2).
--define(GL_UNIFORM_BARRIER_BIT_EXT, 16#4).
--define(GL_TEXTURE_FETCH_BARRIER_BIT_EXT, 16#8).
--define(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT, 16#20).
--define(GL_COMMAND_BARRIER_BIT_EXT, 16#40).
--define(GL_PIXEL_BUFFER_BARRIER_BIT_EXT, 16#80).
--define(GL_TEXTURE_UPDATE_BARRIER_BIT_EXT, 16#100).
--define(GL_BUFFER_UPDATE_BARRIER_BIT_EXT, 16#200).
--define(GL_FRAMEBUFFER_BARRIER_BIT_EXT, 16#400).
--define(GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT, 16#800).
--define(GL_ATOMIC_COUNTER_BARRIER_BIT_EXT, 16#1000).
+-define(GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT, 16#00000001).
+-define(GL_ELEMENT_ARRAY_BARRIER_BIT_EXT, 16#00000002).
+-define(GL_UNIFORM_BARRIER_BIT_EXT, 16#00000004).
+-define(GL_TEXTURE_FETCH_BARRIER_BIT_EXT, 16#00000008).
+-define(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT, 16#00000020).
+-define(GL_COMMAND_BARRIER_BIT_EXT, 16#00000040).
+-define(GL_PIXEL_BUFFER_BARRIER_BIT_EXT, 16#00000080).
+-define(GL_TEXTURE_UPDATE_BARRIER_BIT_EXT, 16#00000100).
+-define(GL_BUFFER_UPDATE_BARRIER_BIT_EXT, 16#00000200).
+-define(GL_FRAMEBUFFER_BARRIER_BIT_EXT, 16#00000400).
+-define(GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT, 16#00000800).
+-define(GL_ATOMIC_COUNTER_BARRIER_BIT_EXT, 16#00001000).
-define(GL_ALL_BARRIER_BITS_EXT, 16#FFFFFFFF).
-define(GL_DOUBLE_VEC2_EXT, 16#8FFC).
-define(GL_DOUBLE_VEC3_EXT, 16#8FFD).
@@ -3850,7 +3952,7 @@
-define(GL_FLOAT16_VEC2_NV, 16#8FF9).
-define(GL_FLOAT16_VEC3_NV, 16#8FFA).
-define(GL_FLOAT16_VEC4_NV, 16#8FFB).
--define(GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV, 16#10).
+-define(GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV, 16#00000010).
-define(GL_MAX_PROGRAM_PATCH_ATTRIBS_NV, 16#86D8).
-define(GL_TESS_CONTROL_PROGRAM_NV, 16#891E).
-define(GL_TESS_EVALUATION_PROGRAM_NV, 16#891F).
@@ -3882,3 +3984,432 @@
-define(GL_WRITE_DISCARD_NV, 16#88BE).
-define(GL_DEPTH_CLAMP_NEAR_AMD, 16#901E).
-define(GL_DEPTH_CLAMP_FAR_AMD, 16#901F).
+-define(GL_TEXTURE_SRGB_DECODE_EXT, 16#8A48).
+-define(GL_DECODE_EXT, 16#8A49).
+-define(GL_SKIP_DECODE_EXT, 16#8A4A).
+-define(GL_TEXTURE_COVERAGE_SAMPLES_NV, 16#9045).
+-define(GL_TEXTURE_COLOR_SAMPLES_NV, 16#9046).
+-define(GL_FACTOR_MIN_AMD, 16#901C).
+-define(GL_FACTOR_MAX_AMD, 16#901D).
+-define(GL_SUBSAMPLE_DISTANCE_AMD, 16#883F).
+-define(GL_SYNC_X11_FENCE_EXT, 16#90E1).
+-define(GL_SCALED_RESOLVE_FASTEST_EXT, 16#90BA).
+-define(GL_SCALED_RESOLVE_NICEST_EXT, 16#90BB).
+-define(GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, 16#9160).
+-define(GL_SET_AMD, 16#874A).
+-define(GL_REPLACE_VALUE_AMD, 16#874B).
+-define(GL_STENCIL_OP_VALUE_AMD, 16#874C).
+-define(GL_STENCIL_BACK_OP_VALUE_AMD, 16#874D).
+-define(GL_VERSION_1_2_DEPRECATED, 1).
+-define(GL_VERSION_1_3_DEPRECATED, 1).
+-define(GL_VERSION_1_4, 1).
+-define(GL_VERSION_1_4_DEPRECATED, 1).
+-define(GL_VERSION_1_5, 1).
+-define(GL_VERSION_2_0, 1).
+-define(GL_VERSION_2_1, 1).
+-define(GL_VERSION_3_0, 1).
+-define(GL_VERSION_3_1, 1).
+-define(GL_VERSION_3_2, 1).
+-define(GL_VERSION_3_3, 1).
+-define(GL_VERSION_4_0, 1).
+-define(GL_VERSION_4_1, 1).
+-define(GL_VERSION_4_2, 1).
+-define(GL_ARB_transpose_matrix, 1).
+-define(GL_ARB_multisample, 1).
+-define(GL_ARB_texture_env_add, 1).
+-define(GL_ARB_texture_cube_map, 1).
+-define(GL_ARB_texture_compression, 1).
+-define(GL_ARB_texture_border_clamp, 1).
+-define(GL_ARB_point_parameters, 1).
+-define(GL_ARB_vertex_blend, 1).
+-define(GL_ARB_matrix_palette, 1).
+-define(GL_ARB_texture_env_combine, 1).
+-define(GL_ARB_texture_env_crossbar, 1).
+-define(GL_ARB_texture_env_dot3, 1).
+-define(GL_ARB_texture_mirrored_repeat, 1).
+-define(GL_ARB_depth_texture, 1).
+-define(GL_ARB_shadow, 1).
+-define(GL_ARB_shadow_ambient, 1).
+-define(GL_ARB_window_pos, 1).
+-define(GL_ARB_vertex_program, 1).
+-define(GL_ARB_fragment_program, 1).
+-define(GL_ARB_vertex_buffer_object, 1).
+-define(GL_ARB_occlusion_query, 1).
+-define(GL_ARB_shader_objects, 1).
+-define(GL_ARB_vertex_shader, 1).
+-define(GL_ARB_fragment_shader, 1).
+-define(GL_ARB_shading_language_100, 1).
+-define(GL_ARB_texture_non_power_of_two, 1).
+-define(GL_ARB_point_sprite, 1).
+-define(GL_ARB_fragment_program_shadow, 1).
+-define(GL_ARB_draw_buffers, 1).
+-define(GL_ARB_texture_rectangle, 1).
+-define(GL_ARB_color_buffer_float, 1).
+-define(GL_ARB_half_float_pixel, 1).
+-define(GL_ARB_texture_float, 1).
+-define(GL_ARB_pixel_buffer_object, 1).
+-define(GL_ARB_depth_buffer_float, 1).
+-define(GL_ARB_draw_instanced, 1).
+-define(GL_ARB_framebuffer_object, 1).
+-define(GL_ARB_framebuffer_sRGB, 1).
+-define(GL_ARB_geometry_shader4, 1).
+-define(GL_ARB_half_float_vertex, 1).
+-define(GL_ARB_instanced_arrays, 1).
+-define(GL_ARB_map_buffer_range, 1).
+-define(GL_ARB_texture_buffer_object, 1).
+-define(GL_ARB_texture_compression_rgtc, 1).
+-define(GL_ARB_texture_rg, 1).
+-define(GL_ARB_vertex_array_object, 1).
+-define(GL_ARB_uniform_buffer_object, 1).
+-define(GL_ARB_compatibility, 1).
+-define(GL_ARB_copy_buffer, 1).
+-define(GL_ARB_shader_texture_lod, 1).
+-define(GL_ARB_depth_clamp, 1).
+-define(GL_ARB_draw_elements_base_vertex, 1).
+-define(GL_ARB_fragment_coord_conventions, 1).
+-define(GL_ARB_provoking_vertex, 1).
+-define(GL_ARB_seamless_cube_map, 1).
+-define(GL_ARB_sync, 1).
+-define(GL_ARB_texture_multisample, 1).
+-define(GL_ARB_vertex_array_bgra, 1).
+-define(GL_ARB_draw_buffers_blend, 1).
+-define(GL_ARB_sample_shading, 1).
+-define(GL_ARB_texture_cube_map_array, 1).
+-define(GL_ARB_texture_gather, 1).
+-define(GL_ARB_texture_query_lod, 1).
+-define(GL_ARB_shading_language_include, 1).
+-define(GL_ARB_texture_compression_bptc, 1).
+-define(GL_ARB_blend_func_extended, 1).
+-define(GL_ARB_explicit_attrib_location, 1).
+-define(GL_ARB_occlusion_query2, 1).
+-define(GL_ARB_sampler_objects, 1).
+-define(GL_ARB_shader_bit_encoding, 1).
+-define(GL_ARB_texture_rgb10_a2ui, 1).
+-define(GL_ARB_texture_swizzle, 1).
+-define(GL_ARB_timer_query, 1).
+-define(GL_ARB_vertex_type_2_10_10_10_rev, 1).
+-define(GL_ARB_draw_indirect, 1).
+-define(GL_ARB_gpu_shader5, 1).
+-define(GL_ARB_gpu_shader_fp64, 1).
+-define(GL_ARB_shader_subroutine, 1).
+-define(GL_ARB_tessellation_shader, 1).
+-define(GL_ARB_texture_buffer_object_rgb32, 1).
+-define(GL_ARB_transform_feedback2, 1).
+-define(GL_ARB_transform_feedback3, 1).
+-define(GL_ARB_ES2_compatibility, 1).
+-define(GL_ARB_get_program_binary, 1).
+-define(GL_ARB_separate_shader_objects, 1).
+-define(GL_ARB_vertex_attrib_64bit, 1).
+-define(GL_ARB_viewport_array, 1).
+-define(GL_ARB_cl_event, 1).
+-define(GL_ARB_debug_output, 1).
+-define(GL_ARB_robustness, 1).
+-define(GL_ARB_shader_stencil_export, 1).
+-define(GL_ARB_base_instance, 1).
+-define(GL_ARB_shading_language_420pack, 1).
+-define(GL_ARB_transform_feedback_instanced, 1).
+-define(GL_ARB_compressed_texture_pixel_storage, 1).
+-define(GL_ARB_conservative_depth, 1).
+-define(GL_ARB_internalformat_query, 1).
+-define(GL_ARB_map_buffer_alignment, 1).
+-define(GL_ARB_shader_atomic_counters, 1).
+-define(GL_ARB_shader_image_load_store, 1).
+-define(GL_ARB_shading_language_packing, 1).
+-define(GL_ARB_texture_storage, 1).
+-define(GL_EXT_abgr, 1).
+-define(GL_EXT_blend_color, 1).
+-define(GL_EXT_polygon_offset, 1).
+-define(GL_EXT_texture, 1).
+-define(GL_EXT_texture3D, 1).
+-define(GL_SGIS_texture_filter4, 1).
+-define(GL_EXT_subtexture, 1).
+-define(GL_EXT_copy_texture, 1).
+-define(GL_EXT_histogram, 1).
+-define(GL_EXT_convolution, 1).
+-define(GL_SGI_color_matrix, 1).
+-define(GL_SGI_color_table, 1).
+-define(GL_SGIX_pixel_texture, 1).
+-define(GL_SGIS_pixel_texture, 1).
+-define(GL_SGIS_texture4D, 1).
+-define(GL_SGI_texture_color_table, 1).
+-define(GL_EXT_cmyka, 1).
+-define(GL_EXT_texture_object, 1).
+-define(GL_SGIS_detail_texture, 1).
+-define(GL_SGIS_sharpen_texture, 1).
+-define(GL_EXT_packed_pixels, 1).
+-define(GL_SGIS_texture_lod, 1).
+-define(GL_SGIS_multisample, 1).
+-define(GL_EXT_rescale_normal, 1).
+-define(GL_EXT_vertex_array, 1).
+-define(GL_EXT_misc_attribute, 1).
+-define(GL_SGIS_generate_mipmap, 1).
+-define(GL_SGIX_clipmap, 1).
+-define(GL_SGIX_shadow, 1).
+-define(GL_SGIS_texture_edge_clamp, 1).
+-define(GL_SGIS_texture_border_clamp, 1).
+-define(GL_EXT_blend_minmax, 1).
+-define(GL_EXT_blend_subtract, 1).
+-define(GL_EXT_blend_logic_op, 1).
+-define(GL_SGIX_interlace, 1).
+-define(GL_SGIX_pixel_tiles, 1).
+-define(GL_SGIX_texture_select, 1).
+-define(GL_SGIX_sprite, 1).
+-define(GL_SGIX_texture_multi_buffer, 1).
+-define(GL_EXT_point_parameters, 1).
+-define(GL_SGIS_point_parameters, 1).
+-define(GL_SGIX_instruments, 1).
+-define(GL_SGIX_texture_scale_bias, 1).
+-define(GL_SGIX_framezoom, 1).
+-define(GL_SGIX_tag_sample_buffer, 1).
+-define(GL_SGIX_polynomial_ffd, 1).
+-define(GL_SGIX_reference_plane, 1).
+-define(GL_SGIX_flush_raster, 1).
+-define(GL_SGIX_depth_texture, 1).
+-define(GL_SGIS_fog_function, 1).
+-define(GL_SGIX_fog_offset, 1).
+-define(GL_HP_image_transform, 1).
+-define(GL_HP_convolution_border_modes, 1).
+-define(GL_SGIX_texture_add_env, 1).
+-define(GL_EXT_color_subtable, 1).
+-define(GL_PGI_vertex_hints, 1).
+-define(GL_PGI_misc_hints, 1).
+-define(GL_EXT_paletted_texture, 1).
+-define(GL_EXT_clip_volume_hint, 1).
+-define(GL_SGIX_list_priority, 1).
+-define(GL_SGIX_ir_instrument1, 1).
+-define(GL_SGIX_calligraphic_fragment, 1).
+-define(GL_SGIX_texture_lod_bias, 1).
+-define(GL_SGIX_shadow_ambient, 1).
+-define(GL_EXT_index_texture, 1).
+-define(GL_EXT_index_material, 1).
+-define(GL_EXT_index_func, 1).
+-define(GL_EXT_index_array_formats, 1).
+-define(GL_EXT_compiled_vertex_array, 1).
+-define(GL_EXT_cull_vertex, 1).
+-define(GL_SGIX_ycrcb, 1).
+-define(GL_SGIX_fragment_lighting, 1).
+-define(GL_IBM_rasterpos_clip, 1).
+-define(GL_HP_texture_lighting, 1).
+-define(GL_EXT_draw_range_elements, 1).
+-define(GL_WIN_phong_shading, 1).
+-define(GL_WIN_specular_fog, 1).
+-define(GL_EXT_light_texture, 1).
+-define(GL_SGIX_blend_alpha_minmax, 1).
+-define(GL_EXT_bgra, 1).
+-define(GL_SGIX_async, 1).
+-define(GL_SGIX_async_pixel, 1).
+-define(GL_SGIX_async_histogram, 1).
+-define(GL_INTEL_parallel_arrays, 1).
+-define(GL_HP_occlusion_test, 1).
+-define(GL_EXT_pixel_transform, 1).
+-define(GL_EXT_pixel_transform_color_table, 1).
+-define(GL_EXT_shared_texture_palette, 1).
+-define(GL_EXT_separate_specular_color, 1).
+-define(GL_EXT_secondary_color, 1).
+-define(GL_EXT_texture_perturb_normal, 1).
+-define(GL_EXT_multi_draw_arrays, 1).
+-define(GL_EXT_fog_coord, 1).
+-define(GL_REND_screen_coordinates, 1).
+-define(GL_EXT_coordinate_frame, 1).
+-define(GL_EXT_texture_env_combine, 1).
+-define(GL_APPLE_specular_vector, 1).
+-define(GL_APPLE_transform_hint, 1).
+-define(GL_SGIX_fog_scale, 1).
+-define(GL_SUNX_constant_data, 1).
+-define(GL_SUN_global_alpha, 1).
+-define(GL_SUN_triangle_list, 1).
+-define(GL_SUN_vertex, 1).
+-define(GL_EXT_blend_func_separate, 1).
+-define(GL_INGR_blend_func_separate, 1).
+-define(GL_INGR_color_clamp, 1).
+-define(GL_INGR_interlace_read, 1).
+-define(GL_EXT_stencil_wrap, 1).
+-define(GL_EXT_422_pixels, 1).
+-define(GL_NV_texgen_reflection, 1).
+-define(GL_SUN_convolution_border_modes, 1).
+-define(GL_EXT_texture_env_add, 1).
+-define(GL_EXT_texture_lod_bias, 1).
+-define(GL_EXT_texture_filter_anisotropic, 1).
+-define(GL_EXT_vertex_weighting, 1).
+-define(GL_NV_light_max_exponent, 1).
+-define(GL_NV_vertex_array_range, 1).
+-define(GL_NV_register_combiners, 1).
+-define(GL_NV_fog_distance, 1).
+-define(GL_NV_texgen_emboss, 1).
+-define(GL_NV_blend_square, 1).
+-define(GL_NV_texture_env_combine4, 1).
+-define(GL_MESA_resize_buffers, 1).
+-define(GL_MESA_window_pos, 1).
+-define(GL_IBM_cull_vertex, 1).
+-define(GL_IBM_multimode_draw_arrays, 1).
+-define(GL_IBM_vertex_array_lists, 1).
+-define(GL_SGIX_subsample, 1).
+-define(GL_SGIX_ycrcba, 1).
+-define(GL_SGIX_ycrcb_subsample, 1).
+-define(GL_SGIX_depth_pass_instrument, 1).
+-define(GL_3DFX_texture_compression_FXT1, 1).
+-define(GL_3DFX_multisample, 1).
+-define(GL_3DFX_tbuffer, 1).
+-define(GL_EXT_multisample, 1).
+-define(GL_SGIX_vertex_preclip, 1).
+-define(GL_SGIX_convolution_accuracy, 1).
+-define(GL_SGIX_resample, 1).
+-define(GL_SGIS_point_line_texgen, 1).
+-define(GL_SGIS_texture_color_mask, 1).
+-define(GL_SGIX_igloo_interface, 1).
+-define(GL_EXT_texture_env_dot3, 1).
+-define(GL_ATI_texture_mirror_once, 1).
+-define(GL_NV_fence, 1).
+-define(GL_NV_evaluators, 1).
+-define(GL_NV_packed_depth_stencil, 1).
+-define(GL_NV_register_combiners2, 1).
+-define(GL_NV_texture_compression_vtc, 1).
+-define(GL_NV_texture_rectangle, 1).
+-define(GL_NV_texture_shader, 1).
+-define(GL_NV_texture_shader2, 1).
+-define(GL_NV_vertex_array_range2, 1).
+-define(GL_NV_vertex_program, 1).
+-define(GL_SGIX_texture_coordinate_clamp, 1).
+-define(GL_SGIX_scalebias_hint, 1).
+-define(GL_OML_interlace, 1).
+-define(GL_OML_subsample, 1).
+-define(GL_OML_resample, 1).
+-define(GL_NV_copy_depth_to_color, 1).
+-define(GL_ATI_envmap_bumpmap, 1).
+-define(GL_ATI_fragment_shader, 1).
+-define(GL_ATI_pn_triangles, 1).
+-define(GL_ATI_vertex_array_object, 1).
+-define(GL_EXT_vertex_shader, 1).
+-define(GL_ATI_vertex_streams, 1).
+-define(GL_ATI_element_array, 1).
+-define(GL_SUN_mesh_array, 1).
+-define(GL_SUN_slice_accum, 1).
+-define(GL_NV_multisample_filter_hint, 1).
+-define(GL_NV_depth_clamp, 1).
+-define(GL_NV_occlusion_query, 1).
+-define(GL_NV_point_sprite, 1).
+-define(GL_NV_texture_shader3, 1).
+-define(GL_NV_vertex_program1_1, 1).
+-define(GL_EXT_shadow_funcs, 1).
+-define(GL_EXT_stencil_two_side, 1).
+-define(GL_ATI_text_fragment_shader, 1).
+-define(GL_APPLE_client_storage, 1).
+-define(GL_APPLE_element_array, 1).
+-define(GL_APPLE_fence, 1).
+-define(GL_APPLE_vertex_array_object, 1).
+-define(GL_APPLE_vertex_array_range, 1).
+-define(GL_APPLE_ycbcr_422, 1).
+-define(GL_S3_s3tc, 1).
+-define(GL_ATI_draw_buffers, 1).
+-define(GL_ATI_pixel_format_float, 1).
+-define(GL_ATI_texture_env_combine3, 1).
+-define(GL_ATI_texture_float, 1).
+-define(GL_NV_float_buffer, 1).
+-define(GL_NV_fragment_program, 1).
+-define(GL_NV_half_float, 1).
+-define(GL_NV_pixel_data_range, 1).
+-define(GL_NV_primitive_restart, 1).
+-define(GL_NV_texture_expand_normal, 1).
+-define(GL_NV_vertex_program2, 1).
+-define(GL_ATI_map_object_buffer, 1).
+-define(GL_ATI_separate_stencil, 1).
+-define(GL_ATI_vertex_attrib_array_object, 1).
+-define(GL_OES_read_format, 1).
+-define(GL_EXT_depth_bounds_test, 1).
+-define(GL_EXT_texture_mirror_clamp, 1).
+-define(GL_EXT_blend_equation_separate, 1).
+-define(GL_MESA_pack_invert, 1).
+-define(GL_MESA_ycbcr_texture, 1).
+-define(GL_EXT_pixel_buffer_object, 1).
+-define(GL_NV_fragment_program_option, 1).
+-define(GL_NV_fragment_program2, 1).
+-define(GL_NV_vertex_program2_option, 1).
+-define(GL_NV_vertex_program3, 1).
+-define(GL_EXT_framebuffer_object, 1).
+-define(GL_GREMEDY_string_marker, 1).
+-define(GL_EXT_packed_depth_stencil, 1).
+-define(GL_EXT_stencil_clear_tag, 1).
+-define(GL_EXT_texture_sRGB, 1).
+-define(GL_EXT_framebuffer_blit, 1).
+-define(GL_EXT_framebuffer_multisample, 1).
+-define(GL_MESAX_texture_stack, 1).
+-define(GL_EXT_timer_query, 1).
+-define(GL_EXT_gpu_program_parameters, 1).
+-define(GL_APPLE_flush_buffer_range, 1).
+-define(GL_NV_gpu_program4, 1).
+-define(GL_NV_geometry_program4, 1).
+-define(GL_EXT_geometry_shader4, 1).
+-define(GL_NV_vertex_program4, 1).
+-define(GL_EXT_gpu_shader4, 1).
+-define(GL_EXT_draw_instanced, 1).
+-define(GL_EXT_packed_float, 1).
+-define(GL_EXT_texture_array, 1).
+-define(GL_EXT_texture_buffer_object, 1).
+-define(GL_EXT_texture_compression_latc, 1).
+-define(GL_EXT_texture_compression_rgtc, 1).
+-define(GL_EXT_texture_shared_exponent, 1).
+-define(GL_NV_depth_buffer_float, 1).
+-define(GL_NV_fragment_program4, 1).
+-define(GL_NV_framebuffer_multisample_coverage, 1).
+-define(GL_EXT_framebuffer_sRGB, 1).
+-define(GL_NV_geometry_shader4, 1).
+-define(GL_NV_parameter_buffer_object, 1).
+-define(GL_EXT_draw_buffers2, 1).
+-define(GL_NV_transform_feedback, 1).
+-define(GL_EXT_bindable_uniform, 1).
+-define(GL_EXT_texture_integer, 1).
+-define(GL_GREMEDY_frame_terminator, 1).
+-define(GL_NV_conditional_render, 1).
+-define(GL_NV_present_video, 1).
+-define(GL_EXT_transform_feedback, 1).
+-define(GL_EXT_direct_state_access, 1).
+-define(GL_EXT_vertex_array_bgra, 1).
+-define(GL_EXT_texture_swizzle, 1).
+-define(GL_NV_explicit_multisample, 1).
+-define(GL_NV_transform_feedback2, 1).
+-define(GL_ATI_meminfo, 1).
+-define(GL_AMD_performance_monitor, 1).
+-define(GL_AMD_texture_texture4, 1).
+-define(GL_AMD_vertex_shader_tesselator, 1).
+-define(GL_EXT_provoking_vertex, 1).
+-define(GL_EXT_texture_snorm, 1).
+-define(GL_AMD_draw_buffers_blend, 1).
+-define(GL_APPLE_texture_range, 1).
+-define(GL_APPLE_float_pixels, 1).
+-define(GL_APPLE_vertex_program_evaluators, 1).
+-define(GL_APPLE_aux_depth_stencil, 1).
+-define(GL_APPLE_object_purgeable, 1).
+-define(GL_APPLE_row_bytes, 1).
+-define(GL_APPLE_rgb_422, 1).
+-define(GL_NV_video_capture, 1).
+-define(GL_NV_copy_image, 1).
+-define(GL_EXT_separate_shader_objects, 1).
+-define(GL_NV_parameter_buffer_object2, 1).
+-define(GL_NV_shader_buffer_load, 1).
+-define(GL_NV_vertex_buffer_unified_memory, 1).
+-define(GL_NV_texture_barrier, 1).
+-define(GL_AMD_shader_stencil_export, 1).
+-define(GL_AMD_seamless_cubemap_per_texture, 1).
+-define(GL_AMD_conservative_depth, 1).
+-define(GL_EXT_shader_image_load_store, 1).
+-define(GL_EXT_vertex_attrib_64bit, 1).
+-define(GL_NV_gpu_program5, 1).
+-define(GL_NV_gpu_shader5, 1).
+-define(GL_NV_shader_buffer_store, 1).
+-define(GL_NV_tessellation_program5, 1).
+-define(GL_NV_vertex_attrib_integer_64bit, 1).
+-define(GL_NV_multisample_coverage, 1).
+-define(GL_AMD_name_gen_delete, 1).
+-define(GL_AMD_debug_output, 1).
+-define(GL_NV_vdpau_interop, 1).
+-define(GL_AMD_transform_feedback3_lines_triangles, 1).
+-define(GL_AMD_depth_clamp_separate, 1).
+-define(GL_EXT_texture_sRGB_decode, 1).
+-define(GL_NV_texture_multisample, 1).
+-define(GL_AMD_blend_minmax_factor, 1).
+-define(GL_AMD_sample_positions, 1).
+-define(GL_EXT_x11_sync_object, 1).
+-define(GL_AMD_multi_draw_indirect, 1).
+-define(GL_EXT_framebuffer_multisample_blit_scaled, 1).
+-define(GL_AMD_pinned_memory, 1).
+-define(GL_AMD_stencil_operation_extended, 1).
diff --git a/lib/wx/include/glu.hrl b/lib/wx/include/glu.hrl
index a2ab55d054..dc55c5bb96 100644
--- a/lib/wx/include/glu.hrl
+++ b/lib/wx/include/glu.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -174,4 +174,4 @@
-define(GLU_TESS_WINDING_POSITIVE, 100132).
-define(GLU_TESS_WINDING_NEGATIVE, 100133).
-define(GLU_TESS_WINDING_ABS_GEQ_TWO, 100134).
--define(GLU_TESS_MAX_COORD, ?1.0e150).
+-define(GLU_TESS_MAX_COORD, 1.0e150).
diff --git a/lib/wx/include/wx.hrl b/lib/wx/include/wx.hrl
index 029b9a88df..62979908a6 100644
--- a/lib/wx/include/wx.hrl
+++ b/lib/wx/include/wx.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -22,259 +22,307 @@
%% Each event record may be sent for one or more event types.
%% The mapping to wxWidgets is one record per class.
-%% @type wx() = #wx{id=integer(), obj=wx:wxObject(), userData=term(), event=Rec}. Rec is a event record.
--record(wx, {id, %% Integer Identity of object.
- obj, %% Object reference that was used in the connect call.
- userData, %% User data specified in the connect call.
- event}).%% The event record
+-record(wx, {id :: integer(), %% Integer Identity of object.
+ obj :: wx:wx_object(), %% Object reference that was used in the connect call.
+ userData :: term(), %% User data specified in the connect call.
+ event :: event() %% The event record
+ }).
+-type wx() :: #wx{}. %% wx event record
%% Here comes the definitions of all event records.
%% they contain the event type and possible some extra information.
-%% @type wxNavigationKey() = #wxNavigationKey{type=wxEventType(),flags=integer(),focus=wxWindow:wxWindow()}.
-%% <dl><dt>EventType:</dt> <dd><em>navigation_key</em></dd></dl>
-%% Callback event: {@link wxNavigationKeyEvent}
--record(wxNavigationKey,{type, flags,focus}).
+-record(wxNavigationKey,{type :: wxNavigationKeyEventType(), %% Callback event: {@link wxNavigationKeyEvent}
+ flags :: integer(),
+ focus :: wxWindow:wxWindow()}).
+-type wxNavigationKeyEventType() :: navigation_key.
+-type wxNavigationKey() :: #wxNavigationKey{}. %% Callback event: {@link wxNavigationKeyEvent}
-%% @type wxSash() = #wxSash{type=wxEventType(),edge=WxSashEdgePosition,dragRect={X::integer(), Y::integer(), W::integer(), H::integer()},dragStatus=WxSashDragStatus}.
-%% <dl><dt>EventType:</dt> <dd><em>sash_dragged</em></dd></dl>
-%% Callback event: {@link wxSashEvent}
--record(wxSash,{type, edge,dragRect,dragStatus}).
+-record(wxSash,{type :: wxSashEventType(), %% Callback event: {@link wxSashEvent}
+ edge :: wx:wx_enum(),
+ dragRect :: {X::integer(), Y::integer(), W::integer(), H::integer()},
+ dragStatus :: wx:wx_enum()}).
+-type wxSashEventType() :: sash_dragged.
+-type wxSash() :: #wxSash{}. %% Callback event: {@link wxSashEvent}
-%% @type wxList() = #wxList{type=wxEventType(),code=integer(),oldItemIndex=integer(),itemIndex=integer(),col=integer(),pointDrag={X::integer(), Y::integer()}}.
-%% <dl><dt>EventType:</dt> <dd><em>command_list_begin_drag</em>, <em>command_list_begin_rdrag</em>, <em>command_list_begin_label_edit</em>, <em>command_list_end_label_edit</em>, <em>command_list_delete_item</em>, <em>command_list_delete_all_items</em>, <em>command_list_key_down</em>, <em>command_list_insert_item</em>, <em>command_list_col_click</em>, <em>command_list_col_right_click</em>, <em>command_list_col_begin_drag</em>, <em>command_list_col_dragging</em>, <em>command_list_col_end_drag</em>, <em>command_list_item_selected</em>, <em>command_list_item_deselected</em>, <em>command_list_item_right_click</em>, <em>command_list_item_middle_click</em>, <em>command_list_item_activated</em>, <em>command_list_item_focused</em>, <em>command_list_cache_hint</em></dd></dl>
-%% Callback event: {@link wxListEvent}
--record(wxList,{type, code,oldItemIndex,itemIndex,col,pointDrag}).
+-record(wxList,{type :: wxListEventType(), %% Callback event: {@link wxListEvent}
+ code :: integer(),
+ oldItemIndex :: integer(),
+ itemIndex :: integer(),
+ col :: integer(),
+ pointDrag :: {X::integer(), Y::integer()}}).
+-type wxListEventType() :: command_list_begin_drag | command_list_begin_rdrag | command_list_begin_label_edit | command_list_end_label_edit | command_list_delete_item | command_list_delete_all_items | command_list_key_down | command_list_insert_item | command_list_col_click | command_list_col_right_click | command_list_col_begin_drag | command_list_col_dragging | command_list_col_end_drag | command_list_item_selected | command_list_item_deselected | command_list_item_right_click | command_list_item_middle_click | command_list_item_activated | command_list_item_focused | command_list_cache_hint.
+-type wxList() :: #wxList{}. %% Callback event: {@link wxListEvent}
-%% @type wxNotebook() = #wxNotebook{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>command_notebook_page_changed</em>, <em>command_notebook_page_changing</em></dd></dl>
-%% Callback event: {@link wxNotebookEvent}
--record(wxNotebook, {type}).
+-record(wxNotebook, {type :: wxNotebookEventType()}). %% Callback event: {@link wxNotebookEvent}
+-type wxNotebookEventType() :: command_notebook_page_changed | command_notebook_page_changing.
+-type wxNotebook() :: #wxNotebook{}. %% Callback event: {@link wxNotebookEvent}
-%% @type wxDisplayChanged() = #wxDisplayChanged{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>display_changed</em></dd></dl>
-%% Callback event: {@link wxDisplayChangedEvent}
--record(wxDisplayChanged, {type}).
+-record(wxDisplayChanged, {type :: wxDisplayChangedEventType()}). %% Callback event: {@link wxDisplayChangedEvent}
+-type wxDisplayChangedEventType() :: display_changed.
+-type wxDisplayChanged() :: #wxDisplayChanged{}. %% Callback event: {@link wxDisplayChangedEvent}
-%% @type wxErase() = #wxErase{type=wxEventType(),dc=wxDC:wxDC()}.
-%% <dl><dt>EventType:</dt> <dd><em>erase_background</em></dd></dl>
-%% Callback event: {@link wxEraseEvent}
--record(wxErase,{type, dc}).
+-record(wxErase,{type :: wxEraseEventType(), %% Callback event: {@link wxEraseEvent}
+ dc :: wxDC:wxDC()}).
+-type wxEraseEventType() :: erase_background.
+-type wxErase() :: #wxErase{}. %% Callback event: {@link wxEraseEvent}
-%% @type wxKey() = #wxKey{type=wxEventType(),x=integer(),y=integer(),keyCode=integer(),controlDown=bool(),shiftDown=bool(),altDown=bool(),metaDown=bool(),scanCode=bool(),uniChar=integer(),rawCode=integer(),rawFlags=integer()}.
-%% <dl><dt>EventType:</dt> <dd><em>char</em>, <em>char_hook</em>, <em>key_down</em>, <em>key_up</em></dd></dl>
-%% Callback event: {@link wxKeyEvent}
--record(wxKey,{type, x,y,keyCode,controlDown,shiftDown,altDown,metaDown,scanCode,uniChar,rawCode,rawFlags}).
+-record(wxKey,{type :: wxKeyEventType(), %% Callback event: {@link wxKeyEvent}
+ x :: integer(),
+ y :: integer(),
+ keyCode :: integer(),
+ controlDown :: boolean(),
+ shiftDown :: boolean(),
+ altDown :: boolean(),
+ metaDown :: boolean(),
+ scanCode :: boolean(),
+ uniChar :: integer(),
+ rawCode :: integer(),
+ rawFlags :: integer()}).
+-type wxKeyEventType() :: char | char_hook | key_down | key_up.
+-type wxKey() :: #wxKey{}. %% Callback event: {@link wxKeyEvent}
-%% @type wxWindowDestroy() = #wxWindowDestroy{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>destroy</em></dd></dl>
-%% Callback event: {@link wxWindowDestroyEvent}
--record(wxWindowDestroy, {type}).
+-record(wxWindowDestroy, {type :: wxWindowDestroyEventType()}). %% Callback event: {@link wxWindowDestroyEvent}
+-type wxWindowDestroyEventType() :: destroy.
+-type wxWindowDestroy() :: #wxWindowDestroy{}. %% Callback event: {@link wxWindowDestroyEvent}
-%% @type wxCalendar() = #wxCalendar{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>calendar_sel_changed</em>, <em>calendar_day_changed</em>, <em>calendar_month_changed</em>, <em>calendar_year_changed</em>, <em>calendar_doubleclicked</em>, <em>calendar_weekday_clicked</em></dd></dl>
-%% Callback event: {@link wxCalendarEvent}
--record(wxCalendar, {type}).
+-record(wxCalendar, {type :: wxCalendarEventType()}). %% Callback event: {@link wxCalendarEvent}
+-type wxCalendarEventType() :: calendar_sel_changed | calendar_day_changed | calendar_month_changed | calendar_year_changed | calendar_doubleclicked | calendar_weekday_clicked.
+-type wxCalendar() :: #wxCalendar{}. %% Callback event: {@link wxCalendarEvent}
-%% @type wxSplitter() = #wxSplitter{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>command_splitter_sash_pos_changed</em>, <em>command_splitter_sash_pos_changing</em>, <em>command_splitter_doubleclicked</em>, <em>command_splitter_unsplit</em></dd></dl>
-%% Callback event: {@link wxSplitterEvent}
--record(wxSplitter, {type}).
+-record(wxSplitter, {type :: wxSplitterEventType()}). %% Callback event: {@link wxSplitterEvent}
+-type wxSplitterEventType() :: command_splitter_sash_pos_changed | command_splitter_sash_pos_changing | command_splitter_doubleclicked | command_splitter_unsplit.
+-type wxSplitter() :: #wxSplitter{}. %% Callback event: {@link wxSplitterEvent}
-%% @type wxScroll() = #wxScroll{type=wxEventType(),commandInt=integer(),extraLong=integer()}.
-%% <dl><dt>EventType:</dt> <dd><em>scroll_top</em>, <em>scroll_bottom</em>, <em>scroll_lineup</em>, <em>scroll_linedown</em>, <em>scroll_pageup</em>, <em>scroll_pagedown</em>, <em>scroll_thumbtrack</em>, <em>scroll_thumbrelease</em>, <em>scroll_changed</em></dd></dl>
-%% Callback event: {@link wxScrollEvent}
--record(wxScroll,{type, commandInt,extraLong}).
+-record(wxScroll,{type :: wxScrollEventType(), %% Callback event: {@link wxScrollEvent}
+ commandInt :: integer(),
+ extraLong :: integer()}).
+-type wxScrollEventType() :: scroll_top | scroll_bottom | scroll_lineup | scroll_linedown | scroll_pageup | scroll_pagedown | scroll_thumbtrack | scroll_thumbrelease | scroll_changed.
+-type wxScroll() :: #wxScroll{}. %% Callback event: {@link wxScrollEvent}
-%% @type wxMenu() = #wxMenu{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>menu_open</em>, <em>menu_close</em>, <em>menu_highlight</em></dd></dl>
-%% Callback event: {@link wxMenuEvent}
--record(wxMenu, {type}).
+-record(wxMenu, {type :: wxMenuEventType()}). %% Callback event: {@link wxMenuEvent}
+-type wxMenuEventType() :: menu_open | menu_close | menu_highlight.
+-type wxMenu() :: #wxMenu{}. %% Callback event: {@link wxMenuEvent}
-%% @type wxContextMenu() = #wxContextMenu{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>context_menu</em></dd></dl>
-%% Callback event: {@link wxContextMenuEvent}
--record(wxContextMenu, {type}).
+-record(wxContextMenu, {type :: wxContextMenuEventType()}). %% Callback event: {@link wxContextMenuEvent}
+-type wxContextMenuEventType() :: context_menu.
+-type wxContextMenu() :: #wxContextMenu{}. %% Callback event: {@link wxContextMenuEvent}
-%% @type wxShow() = #wxShow{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>show</em></dd></dl>
-%% Callback event: {@link wxShowEvent}
--record(wxShow, {type}).
+-record(wxShow, {type :: wxShowEventType()}). %% Callback event: {@link wxShowEvent}
+-type wxShowEventType() :: show.
+-type wxShow() :: #wxShow{}. %% Callback event: {@link wxShowEvent}
-%% @type wxSpin() = #wxSpin{type=wxEventType(),commandInt=integer()}.
-%% <dl><dt>EventType:</dt> <dd><em>command_spinctrl_updated</em>, <em>spin_up</em>, <em>spin_down</em>, <em>spin</em></dd></dl>
-%% Callback event: {@link wxSpinEvent}
--record(wxSpin,{type, commandInt}).
+-record(wxSpin,{type :: wxSpinEventType(), %% Callback event: {@link wxSpinEvent}
+ commandInt :: integer()}).
+-type wxSpinEventType() :: command_spinctrl_updated | spin_up | spin_down | spin.
+-type wxSpin() :: #wxSpin{}. %% Callback event: {@link wxSpinEvent}
-%% @type wxSetCursor() = #wxSetCursor{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>set_cursor</em></dd></dl>
-%% Callback event: {@link wxSetCursorEvent}
--record(wxSetCursor, {type}).
+-record(wxSetCursor, {type :: wxSetCursorEventType()}). %% Callback event: {@link wxSetCursorEvent}
+-type wxSetCursorEventType() :: set_cursor.
+-type wxSetCursor() :: #wxSetCursor{}. %% Callback event: {@link wxSetCursorEvent}
-%% @type wxFontPicker() = #wxFontPicker{type=wxEventType(),font=wxFont:wxFont()}.
-%% <dl><dt>EventType:</dt> <dd><em>command_fontpicker_changed</em></dd></dl>
-%% Callback event: {@link wxFontPickerEvent}
--record(wxFontPicker,{type, font}).
+-record(wxFontPicker,{type :: wxFontPickerEventType(), %% Callback event: {@link wxFontPickerEvent}
+ font :: wxFont:wxFont()}).
+-type wxFontPickerEventType() :: command_fontpicker_changed.
+-type wxFontPicker() :: #wxFontPicker{}. %% Callback event: {@link wxFontPickerEvent}
-%% @type wxScrollWin() = #wxScrollWin{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>scrollwin_top</em>, <em>scrollwin_bottom</em>, <em>scrollwin_lineup</em>, <em>scrollwin_linedown</em>, <em>scrollwin_pageup</em>, <em>scrollwin_pagedown</em>, <em>scrollwin_thumbtrack</em>, <em>scrollwin_thumbrelease</em></dd></dl>
-%% Callback event: {@link wxScrollWinEvent}
--record(wxScrollWin, {type}).
+-record(wxScrollWin, {type :: wxScrollWinEventType()}). %% Callback event: {@link wxScrollWinEvent}
+-type wxScrollWinEventType() :: scrollwin_top | scrollwin_bottom | scrollwin_lineup | scrollwin_linedown | scrollwin_pageup | scrollwin_pagedown | scrollwin_thumbtrack | scrollwin_thumbrelease.
+-type wxScrollWin() :: #wxScrollWin{}. %% Callback event: {@link wxScrollWinEvent}
-%% @type wxPaint() = #wxPaint{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>paint</em>, <em>paint_icon</em></dd></dl>
-%% Callback event: {@link wxPaintEvent}
--record(wxPaint, {type}).
+-record(wxPaint, {type :: wxPaintEventType()}). %% Callback event: {@link wxPaintEvent}
+-type wxPaintEventType() :: paint | paint_icon.
+-type wxPaint() :: #wxPaint{}. %% Callback event: {@link wxPaintEvent}
-%% @type wxChildFocus() = #wxChildFocus{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>child_focus</em></dd></dl>
-%% Callback event: {@link wxChildFocusEvent}
--record(wxChildFocus, {type}).
+-record(wxChildFocus, {type :: wxChildFocusEventType()}). %% Callback event: {@link wxChildFocusEvent}
+-type wxChildFocusEventType() :: child_focus.
+-type wxChildFocus() :: #wxChildFocus{}. %% Callback event: {@link wxChildFocusEvent}
-%% @type wxMaximize() = #wxMaximize{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>maximize</em></dd></dl>
-%% Callback event: {@link wxMaximizeEvent}
--record(wxMaximize, {type}).
+-record(wxMaximize, {type :: wxMaximizeEventType()}). %% Callback event: {@link wxMaximizeEvent}
+-type wxMaximizeEventType() :: maximize.
+-type wxMaximize() :: #wxMaximize{}. %% Callback event: {@link wxMaximizeEvent}
-%% @type wxFileDirPicker() = #wxFileDirPicker{type=wxEventType(),path=string()}.
-%% <dl><dt>EventType:</dt> <dd><em>command_filepicker_changed</em>, <em>command_dirpicker_changed</em></dd></dl>
-%% Callback event: {@link wxFileDirPickerEvent}
--record(wxFileDirPicker,{type, path}).
+-record(wxFileDirPicker,{type :: wxFileDirPickerEventType(), %% Callback event: {@link wxFileDirPickerEvent}
+ path :: unicode:chardata()}).
+-type wxFileDirPickerEventType() :: command_filepicker_changed | command_dirpicker_changed.
+-type wxFileDirPicker() :: #wxFileDirPicker{}. %% Callback event: {@link wxFileDirPickerEvent}
-%% @type wxFocus() = #wxFocus{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>set_focus</em>, <em>kill_focus</em></dd></dl>
-%% Callback event: {@link wxFocusEvent}
--record(wxFocus, {type}).
+-record(wxFocus, {type :: wxFocusEventType()}). %% Callback event: {@link wxFocusEvent}
+-type wxFocusEventType() :: set_focus | kill_focus.
+-type wxFocus() :: #wxFocus{}. %% Callback event: {@link wxFocusEvent}
-%% @type wxDate() = #wxDate{type=wxEventType(),date=wx:datetime()}.
-%% <dl><dt>EventType:</dt> <dd><em>date_changed</em></dd></dl>
-%% Callback event: {@link wxDateEvent}
--record(wxDate,{type, date}).
+-record(wxDate,{type :: wxDateEventType(), %% Callback event: {@link wxDateEvent}
+ date :: wx:wx_datetime()}).
+-type wxDateEventType() :: date_changed.
+-type wxDate() :: #wxDate{}. %% Callback event: {@link wxDateEvent}
-%% @type wxHtmlLink() = #wxHtmlLink{type=wxEventType(),linkInfo=wx:wxHtmlLinkInfo()}.
-%% <dl><dt>EventType:</dt> <dd><em>command_html_link_clicked</em></dd></dl>
-%% Callback event: {@link wxHtmlLinkEvent}
--record(wxHtmlLink,{type, linkInfo}).
+-record(wxHtmlLink,{type :: wxHtmlLinkEventType(), %% Callback event: {@link wxHtmlLinkEvent}
+ linkInfo :: wx:wx_wxHtmlLinkInfo()}).
+-type wxHtmlLinkEventType() :: command_html_link_clicked.
+-type wxHtmlLink() :: #wxHtmlLink{}. %% Callback event: {@link wxHtmlLinkEvent}
-%% @type wxHelp() = #wxHelp{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>help</em>, <em>detailed_help</em></dd></dl>
-%% Callback event: {@link wxHelpEvent}
--record(wxHelp, {type}).
+-record(wxHelp, {type :: wxHelpEventType()}). %% Callback event: {@link wxHelpEvent}
+-type wxHelpEventType() :: help | detailed_help.
+-type wxHelp() :: #wxHelp{}. %% Callback event: {@link wxHelpEvent}
-%% @type wxStyledText() = #wxStyledText{type=wxEventType(),position=integer(),key=integer(),modifiers=integer(),modificationType=integer(),text=string(),length=integer(),linesAdded=integer(),line=integer(),foldLevelNow=integer(),foldLevelPrev=integer(),margin=integer(),message=integer(),wParam=integer(),lParam=integer(),listType=integer(),x=integer(),y=integer(),dragText=string(),dragAllowMove=bool(),dragResult=WxDragResult}.
-%% <dl><dt>EventType:</dt> <dd><em>stc_change</em>, <em>stc_styleneeded</em>, <em>stc_charadded</em>, <em>stc_savepointreached</em>, <em>stc_savepointleft</em>, <em>stc_romodifyattempt</em>, <em>stc_key</em>, <em>stc_doubleclick</em>, <em>stc_updateui</em>, <em>stc_modified</em>, <em>stc_macrorecord</em>, <em>stc_marginclick</em>, <em>stc_needshown</em>, <em>stc_painted</em>, <em>stc_userlistselection</em>, <em>stc_uridropped</em>, <em>stc_dwellstart</em>, <em>stc_dwellend</em>, <em>stc_start_drag</em>, <em>stc_drag_over</em>, <em>stc_do_drop</em>, <em>stc_zoom</em>, <em>stc_hotspot_click</em>, <em>stc_hotspot_dclick</em>, <em>stc_calltip_click</em>, <em>stc_autocomp_selection</em></dd></dl>
-%% Callback event: {@link wxStyledTextEvent}
--record(wxStyledText,{type, position,key,modifiers,modificationType,text,length,linesAdded,line,foldLevelNow,foldLevelPrev,margin,message,wParam,lParam,listType,x,y,dragText,dragAllowMove,dragResult}).
+-record(wxStyledText,{type :: wxStyledTextEventType(), %% Callback event: {@link wxStyledTextEvent}
+ position :: integer(),
+ key :: integer(),
+ modifiers :: integer(),
+ modificationType :: integer(),
+ text :: unicode:chardata(),
+ length :: integer(),
+ linesAdded :: integer(),
+ line :: integer(),
+ foldLevelNow :: integer(),
+ foldLevelPrev :: integer(),
+ margin :: integer(),
+ message :: integer(),
+ wParam :: integer(),
+ lParam :: integer(),
+ listType :: integer(),
+ x :: integer(),
+ y :: integer(),
+ dragText :: unicode:chardata(),
+ dragAllowMove :: boolean(),
+ dragResult :: wx:wx_enum()}).
+-type wxStyledTextEventType() :: stc_change | stc_styleneeded | stc_charadded | stc_savepointreached | stc_savepointleft | stc_romodifyattempt | stc_key | stc_doubleclick | stc_updateui | stc_modified | stc_macrorecord | stc_marginclick | stc_needshown | stc_painted | stc_userlistselection | stc_uridropped | stc_dwellstart | stc_dwellend | stc_start_drag | stc_drag_over | stc_do_drop | stc_zoom | stc_hotspot_click | stc_hotspot_dclick | stc_calltip_click | stc_autocomp_selection.
+-type wxStyledText() :: #wxStyledText{}. %% Callback event: {@link wxStyledTextEvent}
-%% @type wxSysColourChanged() = #wxSysColourChanged{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>sys_colour_changed</em></dd></dl>
-%% Callback event: {@link wxSysColourChangedEvent}
--record(wxSysColourChanged, {type}).
+-record(wxSysColourChanged, {type :: wxSysColourChangedEventType()}). %% Callback event: {@link wxSysColourChangedEvent}
+-type wxSysColourChangedEventType() :: sys_colour_changed.
+-type wxSysColourChanged() :: #wxSysColourChanged{}. %% Callback event: {@link wxSysColourChangedEvent}
-%% @type wxGrid() = #wxGrid{type=wxEventType(),row=integer(),col=integer(),x=integer(),y=integer(),selecting=bool(),control=bool(),meta=bool(),shift=bool(),alt=bool()}.
-%% <dl><dt>EventType:</dt> <dd><em>grid_cell_left_click</em>, <em>grid_cell_right_click</em>, <em>grid_cell_left_dclick</em>, <em>grid_cell_right_dclick</em>, <em>grid_label_left_click</em>, <em>grid_label_right_click</em>, <em>grid_label_left_dclick</em>, <em>grid_label_right_dclick</em>, <em>grid_row_size</em>, <em>grid_col_size</em>, <em>grid_range_select</em>, <em>grid_cell_change</em>, <em>grid_select_cell</em>, <em>grid_editor_shown</em>, <em>grid_editor_hidden</em>, <em>grid_editor_created</em>, <em>grid_cell_begin_drag</em></dd></dl>
-%% Callback event: {@link wxGridEvent}
--record(wxGrid,{type, row,col,x,y,selecting,control,meta,shift,alt}).
+-record(wxGrid,{type :: wxGridEventType(), %% Callback event: {@link wxGridEvent}
+ row :: integer(),
+ col :: integer(),
+ x :: integer(),
+ y :: integer(),
+ selecting :: boolean(),
+ control :: boolean(),
+ meta :: boolean(),
+ shift :: boolean(),
+ alt :: boolean()}).
+-type wxGridEventType() :: grid_cell_left_click | grid_cell_right_click | grid_cell_left_dclick | grid_cell_right_dclick | grid_label_left_click | grid_label_right_click | grid_label_left_dclick | grid_label_right_dclick | grid_row_size | grid_col_size | grid_range_select | grid_cell_change | grid_select_cell | grid_editor_shown | grid_editor_hidden | grid_editor_created | grid_cell_begin_drag.
+-type wxGrid() :: #wxGrid{}. %% Callback event: {@link wxGridEvent}
-%% @type wxPaletteChanged() = #wxPaletteChanged{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>palette_changed</em></dd></dl>
-%% Callback event: {@link wxPaletteChangedEvent}
--record(wxPaletteChanged, {type}).
+-record(wxPaletteChanged, {type :: wxPaletteChangedEventType()}). %% Callback event: {@link wxPaletteChangedEvent}
+-type wxPaletteChangedEventType() :: palette_changed.
+-type wxPaletteChanged() :: #wxPaletteChanged{}. %% Callback event: {@link wxPaletteChangedEvent}
-%% @type wxUpdateUI() = #wxUpdateUI{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>update_ui</em></dd></dl>
-%% Callback event: {@link wxUpdateUIEvent}
--record(wxUpdateUI, {type}).
+-record(wxUpdateUI, {type :: wxUpdateUIEventType()}). %% Callback event: {@link wxUpdateUIEvent}
+-type wxUpdateUIEventType() :: update_ui.
+-type wxUpdateUI() :: #wxUpdateUI{}. %% Callback event: {@link wxUpdateUIEvent}
-%% @type wxSize() = #wxSize{type=wxEventType(),size={W::integer(), H::integer()},rect={X::integer(), Y::integer(), W::integer(), H::integer()}}.
-%% <dl><dt>EventType:</dt> <dd><em>size</em></dd></dl>
-%% Callback event: {@link wxSizeEvent}
--record(wxSize,{type, size,rect}).
+-record(wxSize,{type :: wxSizeEventType(), %% Callback event: {@link wxSizeEvent}
+ size :: {W::integer(), H::integer()},
+ rect :: {X::integer(), Y::integer(), W::integer(), H::integer()}}).
+-type wxSizeEventType() :: size.
+-type wxSize() :: #wxSize{}. %% Callback event: {@link wxSizeEvent}
-%% @type wxIconize() = #wxIconize{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>iconize</em></dd></dl>
-%% Callback event: {@link wxIconizeEvent}
--record(wxIconize, {type}).
+-record(wxIconize, {type :: wxIconizeEventType()}). %% Callback event: {@link wxIconizeEvent}
+-type wxIconizeEventType() :: iconize.
+-type wxIconize() :: #wxIconize{}. %% Callback event: {@link wxIconizeEvent}
-%% @type wxAuiNotebook() = #wxAuiNotebook{type=wxEventType(),old_selection=integer(),selection=integer(),drag_source=wxAuiNotebook:wxAuiNotebook()}.
-%% <dl><dt>EventType:</dt> <dd><em>command_auinotebook_page_close</em>, <em>command_auinotebook_page_changed</em>, <em>command_auinotebook_page_changing</em>, <em>command_auinotebook_button</em>, <em>command_auinotebook_begin_drag</em>, <em>command_auinotebook_end_drag</em>, <em>command_auinotebook_drag_motion</em>, <em>command_auinotebook_allow_dnd</em>, <em>command_auinotebook_tab_middle_down</em>, <em>command_auinotebook_tab_middle_up</em>, <em>command_auinotebook_tab_right_down</em>, <em>command_auinotebook_tab_right_up</em>, <em>command_auinotebook_page_closed</em>, <em>command_auinotebook_drag_done</em>, <em>command_auinotebook_bg_dclick</em></dd></dl>
-%% Callback event: {@link wxAuiNotebookEvent}
--record(wxAuiNotebook,{type, old_selection,selection,drag_source}).
+-record(wxAuiNotebook,{type :: wxAuiNotebookEventType(), %% Callback event: {@link wxAuiNotebookEvent}
+ old_selection :: integer(),
+ selection :: integer(),
+ drag_source :: wxAuiNotebook:wxAuiNotebook()}).
+-type wxAuiNotebookEventType() :: command_auinotebook_page_close | command_auinotebook_page_changed | command_auinotebook_page_changing | command_auinotebook_button | command_auinotebook_begin_drag | command_auinotebook_end_drag | command_auinotebook_drag_motion | command_auinotebook_allow_dnd | command_auinotebook_tab_middle_down | command_auinotebook_tab_middle_up | command_auinotebook_tab_right_down | command_auinotebook_tab_right_up | command_auinotebook_page_closed | command_auinotebook_drag_done | command_auinotebook_bg_dclick.
+-type wxAuiNotebook() :: #wxAuiNotebook{}. %% Callback event: {@link wxAuiNotebookEvent}
-%% @type wxClose() = #wxClose{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>close_window</em>, <em>end_session</em>, <em>query_end_session</em></dd></dl>
-%% Callback event: {@link wxCloseEvent}
--record(wxClose, {type}).
+-record(wxClose, {type :: wxCloseEventType()}). %% Callback event: {@link wxCloseEvent}
+-type wxCloseEventType() :: close_window | end_session | query_end_session.
+-type wxClose() :: #wxClose{}. %% Callback event: {@link wxCloseEvent}
-%% @type wxMouseCaptureChanged() = #wxMouseCaptureChanged{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>mouse_capture_changed</em></dd></dl>
-%% Callback event: {@link wxMouseCaptureChangedEvent}
--record(wxMouseCaptureChanged, {type}).
+-record(wxMouseCaptureChanged, {type :: wxMouseCaptureChangedEventType()}). %% Callback event: {@link wxMouseCaptureChangedEvent}
+-type wxMouseCaptureChangedEventType() :: mouse_capture_changed.
+-type wxMouseCaptureChanged() :: #wxMouseCaptureChanged{}. %% Callback event: {@link wxMouseCaptureChangedEvent}
-%% @type wxMouse() = #wxMouse{type=wxEventType(),x=integer(),y=integer(),leftDown=bool(),middleDown=bool(),rightDown=bool(),controlDown=bool(),shiftDown=bool(),altDown=bool(),metaDown=bool(),wheelRotation=integer(),wheelDelta=integer(),linesPerAction=integer()}.
-%% <dl><dt>EventType:</dt> <dd><em>left_down</em>, <em>left_up</em>, <em>middle_down</em>, <em>middle_up</em>, <em>right_down</em>, <em>right_up</em>, <em>motion</em>, <em>enter_window</em>, <em>leave_window</em>, <em>left_dclick</em>, <em>middle_dclick</em>, <em>right_dclick</em>, <em>mousewheel</em>, <em>nc_left_down</em>, <em>nc_left_up</em>, <em>nc_middle_down</em>, <em>nc_middle_up</em>, <em>nc_right_down</em>, <em>nc_right_up</em>, <em>nc_motion</em>, <em>nc_enter_window</em>, <em>nc_leave_window</em>, <em>nc_left_dclick</em>, <em>nc_middle_dclick</em>, <em>nc_right_dclick</em></dd></dl>
-%% Callback event: {@link wxMouseEvent}
--record(wxMouse,{type, x,y,leftDown,middleDown,rightDown,controlDown,shiftDown,altDown,metaDown,wheelRotation,wheelDelta,linesPerAction}).
+-record(wxMouse,{type :: wxMouseEventType(), %% Callback event: {@link wxMouseEvent}
+ x :: integer(),
+ y :: integer(),
+ leftDown :: boolean(),
+ middleDown :: boolean(),
+ rightDown :: boolean(),
+ controlDown :: boolean(),
+ shiftDown :: boolean(),
+ altDown :: boolean(),
+ metaDown :: boolean(),
+ wheelRotation :: integer(),
+ wheelDelta :: integer(),
+ linesPerAction :: integer()}).
+-type wxMouseEventType() :: left_down | left_up | middle_down | middle_up | right_down | right_up | motion | enter_window | leave_window | left_dclick | middle_dclick | right_dclick | mousewheel | nc_left_down | nc_left_up | nc_middle_down | nc_middle_up | nc_right_down | nc_right_up | nc_motion | nc_enter_window | nc_leave_window | nc_left_dclick | nc_middle_dclick | nc_right_dclick.
+-type wxMouse() :: #wxMouse{}. %% Callback event: {@link wxMouseEvent}
-%% @type wxWindowCreate() = #wxWindowCreate{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>create</em></dd></dl>
-%% Callback event: {@link wxWindowCreateEvent}
--record(wxWindowCreate, {type}).
+-record(wxWindowCreate, {type :: wxWindowCreateEventType()}). %% Callback event: {@link wxWindowCreateEvent}
+-type wxWindowCreateEventType() :: create.
+-type wxWindowCreate() :: #wxWindowCreate{}. %% Callback event: {@link wxWindowCreateEvent}
-%% @type wxAuiManager() = #wxAuiManager{type=wxEventType(),manager=wxAuiManager:wxAuiManager(),pane=wxAuiPaneInfo:wxAuiPaneInfo(),button=integer(),veto_flag=bool(),canveto_flag=bool(),dc=wxDC:wxDC()}.
-%% <dl><dt>EventType:</dt> <dd><em>aui_pane_button</em>, <em>aui_pane_close</em>, <em>aui_pane_maximize</em>, <em>aui_pane_restore</em>, <em>aui_render</em>, <em>aui_find_manager</em></dd></dl>
-%% Callback event: {@link wxAuiManagerEvent}
--record(wxAuiManager,{type, manager,pane,button,veto_flag,canveto_flag,dc}).
+-record(wxAuiManager,{type :: wxAuiManagerEventType(), %% Callback event: {@link wxAuiManagerEvent}
+ manager :: wxAuiManager:wxAuiManager(),
+ pane :: wxAuiPaneInfo:wxAuiPaneInfo(),
+ button :: integer(),
+ veto_flag :: boolean(),
+ canveto_flag :: boolean(),
+ dc :: wxDC:wxDC()}).
+-type wxAuiManagerEventType() :: aui_pane_button | aui_pane_close | aui_pane_maximize | aui_pane_restore | aui_render | aui_find_manager.
+-type wxAuiManager() :: #wxAuiManager{}. %% Callback event: {@link wxAuiManagerEvent}
-%% @type wxCommand() = #wxCommand{type=wxEventType(),cmdString=string(),commandInt=integer(),extraLong=integer()}.
-%% <dl><dt>EventType:</dt> <dd><em>command_button_clicked</em>, <em>command_checkbox_clicked</em>, <em>command_choice_selected</em>, <em>command_listbox_selected</em>, <em>command_listbox_doubleclicked</em>, <em>command_text_updated</em>, <em>command_text_enter</em>, <em>command_menu_selected</em>, <em>command_slider_updated</em>, <em>command_radiobox_selected</em>, <em>command_radiobutton_selected</em>, <em>command_scrollbar_updated</em>, <em>command_vlbox_selected</em>, <em>command_combobox_selected</em>, <em>command_tool_rclicked</em>, <em>command_tool_enter</em>, <em>command_checklistbox_toggled</em>, <em>command_togglebutton_clicked</em>, <em>command_left_click</em>, <em>command_left_dclick</em>, <em>command_right_click</em>, <em>command_set_focus</em>, <em>command_kill_focus</em>, <em>command_enter</em></dd></dl>
-%% Callback event: {@link wxCommandEvent}
--record(wxCommand,{type, cmdString,commandInt,extraLong}).
+-record(wxCommand,{type :: wxCommandEventType(), %% Callback event: {@link wxCommandEvent}
+ cmdString :: unicode:chardata(),
+ commandInt :: integer(),
+ extraLong :: integer()}).
+-type wxCommandEventType() :: command_button_clicked | command_checkbox_clicked | command_choice_selected | command_listbox_selected | command_listbox_doubleclicked | command_text_updated | command_text_enter | command_menu_selected | command_slider_updated | command_radiobox_selected | command_radiobutton_selected | command_scrollbar_updated | command_vlbox_selected | command_combobox_selected | command_tool_rclicked | command_tool_enter | command_checklistbox_toggled | command_togglebutton_clicked | command_left_click | command_left_dclick | command_right_click | command_set_focus | command_kill_focus | command_enter.
+-type wxCommand() :: #wxCommand{}. %% Callback event: {@link wxCommandEvent}
-%% @type wxJoystick() = #wxJoystick{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>joy_button_down</em>, <em>joy_button_up</em>, <em>joy_move</em>, <em>joy_zmove</em></dd></dl>
-%% Callback event: {@link wxJoystickEvent}
--record(wxJoystick, {type}).
+-record(wxJoystick, {type :: wxJoystickEventType()}). %% Callback event: {@link wxJoystickEvent}
+-type wxJoystickEventType() :: joy_button_down | joy_button_up | joy_move | joy_zmove.
+-type wxJoystick() :: #wxJoystick{}. %% Callback event: {@link wxJoystickEvent}
-%% @type wxQueryNewPalette() = #wxQueryNewPalette{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>query_new_palette</em></dd></dl>
-%% Callback event: {@link wxQueryNewPaletteEvent}
--record(wxQueryNewPalette, {type}).
+-record(wxQueryNewPalette, {type :: wxQueryNewPaletteEventType()}). %% Callback event: {@link wxQueryNewPaletteEvent}
+-type wxQueryNewPaletteEventType() :: query_new_palette.
+-type wxQueryNewPalette() :: #wxQueryNewPalette{}. %% Callback event: {@link wxQueryNewPaletteEvent}
-%% @type wxMove() = #wxMove{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>move</em></dd></dl>
-%% Callback event: {@link wxMoveEvent}
--record(wxMove, {type}).
+-record(wxMove, {type :: wxMoveEventType()}). %% Callback event: {@link wxMoveEvent}
+-type wxMoveEventType() :: move.
+-type wxMove() :: #wxMove{}. %% Callback event: {@link wxMoveEvent}
-%% @type wxIdle() = #wxIdle{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>idle</em></dd></dl>
-%% Callback event: {@link wxIdleEvent}
--record(wxIdle, {type}).
+-record(wxIdle, {type :: wxIdleEventType()}). %% Callback event: {@link wxIdleEvent}
+-type wxIdleEventType() :: idle.
+-type wxIdle() :: #wxIdle{}. %% Callback event: {@link wxIdleEvent}
-%% @type wxNcPaint() = #wxNcPaint{type=wxEventType()}.
-%% <dl><dt>EventType:</dt> <dd><em>nc_paint</em></dd></dl>
-%% Callback event: {@link wxNcPaintEvent}
--record(wxNcPaint, {type}).
+-record(wxNcPaint, {type :: wxNcPaintEventType()}). %% Callback event: {@link wxNcPaintEvent}
+-type wxNcPaintEventType() :: nc_paint.
+-type wxNcPaint() :: #wxNcPaint{}. %% Callback event: {@link wxNcPaintEvent}
-%% @type wxColourPicker() = #wxColourPicker{type=wxEventType(),colour=wx:colour()}.
-%% <dl><dt>EventType:</dt> <dd><em>command_colourpicker_changed</em></dd></dl>
-%% Callback event: {@link wxColourPickerEvent}
--record(wxColourPicker,{type, colour}).
+-record(wxColourPicker,{type :: wxColourPickerEventType(), %% Callback event: {@link wxColourPickerEvent}
+ colour :: wx:wx_colour()}).
+-type wxColourPickerEventType() :: command_colourpicker_changed.
+-type wxColourPicker() :: #wxColourPicker{}. %% Callback event: {@link wxColourPickerEvent}
-%% @type wxTree() = #wxTree{type=wxEventType(),item=integer(),itemOld=integer(),pointDrag={X::integer(), Y::integer()}}.
-%% <dl><dt>EventType:</dt> <dd><em>command_tree_begin_drag</em>, <em>command_tree_begin_rdrag</em>, <em>command_tree_begin_label_edit</em>, <em>command_tree_end_label_edit</em>, <em>command_tree_delete_item</em>, <em>command_tree_get_info</em>, <em>command_tree_set_info</em>, <em>command_tree_item_expanded</em>, <em>command_tree_item_expanding</em>, <em>command_tree_item_collapsed</em>, <em>command_tree_item_collapsing</em>, <em>command_tree_sel_changed</em>, <em>command_tree_sel_changing</em>, <em>command_tree_key_down</em>, <em>command_tree_item_activated</em>, <em>command_tree_item_right_click</em>, <em>command_tree_item_middle_click</em>, <em>command_tree_end_drag</em>, <em>command_tree_state_image_click</em>, <em>command_tree_item_gettooltip</em>, <em>command_tree_item_menu</em></dd></dl>
-%% Callback event: {@link wxTreeEvent}
--record(wxTree,{type, item,itemOld,pointDrag}).
+-record(wxTaskBarIcon, {type :: wxTaskBarIconEventType()}). %% Callback event: {@link wxTaskBarIconEvent}
+-type wxTaskBarIconEventType() :: taskbar_move | taskbar_left_down | taskbar_left_up | taskbar_right_down | taskbar_right_up | taskbar_left_dclick | taskbar_right_dclick.
+-type wxTaskBarIcon() :: #wxTaskBarIcon{}. %% Callback event: {@link wxTaskBarIconEvent}
-%% @type wxEventType() = aui_find_manager | aui_pane_button | aui_pane_close | aui_pane_maximize | aui_pane_restore | aui_render | calendar_day_changed | calendar_doubleclicked | calendar_month_changed | calendar_sel_changed | calendar_weekday_clicked | calendar_year_changed | char | char_hook | child_focus | close_window | command_auinotebook_allow_dnd | command_auinotebook_begin_drag | command_auinotebook_bg_dclick | command_auinotebook_button | command_auinotebook_drag_done | command_auinotebook_drag_motion | command_auinotebook_end_drag | command_auinotebook_page_changed | command_auinotebook_page_changing | command_auinotebook_page_close | command_auinotebook_page_closed | command_auinotebook_tab_middle_down | command_auinotebook_tab_middle_up | command_auinotebook_tab_right_down | command_auinotebook_tab_right_up | command_button_clicked | command_checkbox_clicked | command_checklistbox_toggled | command_choice_selected | command_colourpicker_changed | command_combobox_selected | command_dirpicker_changed | command_enter | command_filepicker_changed | command_fontpicker_changed | command_html_link_clicked | command_kill_focus | command_left_click | command_left_dclick | command_list_begin_drag | command_list_begin_label_edit | command_list_begin_rdrag | command_list_cache_hint | command_list_col_begin_drag | command_list_col_click | command_list_col_dragging | command_list_col_end_drag | command_list_col_right_click | command_list_delete_all_items | command_list_delete_item | command_list_end_label_edit | command_list_insert_item | command_list_item_activated | command_list_item_deselected | command_list_item_focused | command_list_item_middle_click | command_list_item_right_click | command_list_item_selected | command_list_key_down | command_listbox_doubleclicked | command_listbox_selected | command_menu_selected | command_notebook_page_changed | command_notebook_page_changing | command_radiobox_selected | command_radiobutton_selected | command_right_click | command_scrollbar_updated | command_set_focus | command_slider_updated | command_spinctrl_updated | command_splitter_doubleclicked | command_splitter_sash_pos_changed | command_splitter_sash_pos_changing | command_splitter_unsplit | command_text_enter | command_text_updated | command_togglebutton_clicked | command_tool_enter | command_tool_rclicked | command_tree_begin_drag | command_tree_begin_label_edit | command_tree_begin_rdrag | command_tree_delete_item | command_tree_end_drag | command_tree_end_label_edit | command_tree_get_info | command_tree_item_activated | command_tree_item_collapsed | command_tree_item_collapsing | command_tree_item_expanded | command_tree_item_expanding | command_tree_item_gettooltip | command_tree_item_menu | command_tree_item_middle_click | command_tree_item_right_click | command_tree_key_down | command_tree_sel_changed | command_tree_sel_changing | command_tree_set_info | command_tree_state_image_click | command_vlbox_selected | context_menu | create | date_changed | destroy | detailed_help | display_changed | end_session | enter_window | erase_background | grid_cell_begin_drag | grid_cell_change | grid_cell_left_click | grid_cell_left_dclick | grid_cell_right_click | grid_cell_right_dclick | grid_col_size | grid_editor_created | grid_editor_hidden | grid_editor_shown | grid_label_left_click | grid_label_left_dclick | grid_label_right_click | grid_label_right_dclick | grid_range_select | grid_row_size | grid_select_cell | help | iconize | idle | joy_button_down | joy_button_up | joy_move | joy_zmove | key_down | key_up | kill_focus | leave_window | left_dclick | left_down | left_up | maximize | menu_close | menu_highlight | menu_open | middle_dclick | middle_down | middle_up | motion | mouse_capture_changed | mousewheel | move | navigation_key | nc_enter_window | nc_leave_window | nc_left_dclick | nc_left_down | nc_left_up | nc_middle_dclick | nc_middle_down | nc_middle_up | nc_motion | nc_paint | nc_right_dclick | nc_right_down | nc_right_up | paint | paint_icon | palette_changed | query_end_session | query_new_palette | right_dclick | right_down | right_up | sash_dragged | scroll_bottom | scroll_changed | scroll_linedown | scroll_lineup | scroll_pagedown | scroll_pageup | scroll_thumbrelease | scroll_thumbtrack | scroll_top | scrollwin_bottom | scrollwin_linedown | scrollwin_lineup | scrollwin_pagedown | scrollwin_pageup | scrollwin_thumbrelease | scrollwin_thumbtrack | scrollwin_top | set_cursor | set_focus | show | size | spin | spin_down | spin_up | stc_autocomp_selection | stc_calltip_click | stc_change | stc_charadded | stc_do_drop | stc_doubleclick | stc_drag_over | stc_dwellend | stc_dwellstart | stc_hotspot_click | stc_hotspot_dclick | stc_key | stc_macrorecord | stc_marginclick | stc_modified | stc_needshown | stc_painted | stc_romodifyattempt | stc_savepointleft | stc_savepointreached | stc_start_drag | stc_styleneeded | stc_updateui | stc_uridropped | stc_userlistselection | stc_zoom | sys_colour_changed | update_ui.
+-record(wxTree,{type :: wxTreeEventType(), %% Callback event: {@link wxTreeEvent}
+ item :: integer(),
+ itemOld :: integer(),
+ pointDrag :: {X::integer(), Y::integer()}}).
+-type wxTreeEventType() :: command_tree_begin_drag | command_tree_begin_rdrag | command_tree_begin_label_edit | command_tree_end_label_edit | command_tree_delete_item | command_tree_get_info | command_tree_set_info | command_tree_item_expanded | command_tree_item_expanding | command_tree_item_collapsed | command_tree_item_collapsing | command_tree_sel_changed | command_tree_sel_changing | command_tree_key_down | command_tree_item_activated | command_tree_item_right_click | command_tree_item_middle_click | command_tree_end_drag | command_tree_state_image_click | command_tree_item_gettooltip | command_tree_item_menu.
+-type wxTree() :: #wxTree{}. %% Callback event: {@link wxTreeEvent}
+
+-type event() :: wxAuiManager() | wxAuiNotebook() | wxCalendar() | wxChildFocus() | wxClose() | wxColourPicker() | wxCommand() | wxContextMenu() | wxDate() | wxDisplayChanged() | wxErase() | wxFileDirPicker() | wxFocus() | wxFontPicker() | wxGrid() | wxHelp() | wxHtmlLink() | wxIconize() | wxIdle() | wxJoystick() | wxKey() | wxList() | wxMaximize() | wxMenu() | wxMouse() | wxMouseCaptureChanged() | wxMove() | wxNavigationKey() | wxNcPaint() | wxNotebook() | wxPaint() | wxPaletteChanged() | wxQueryNewPalette() | wxSash() | wxScroll() | wxScrollWin() | wxSetCursor() | wxShow() | wxSize() | wxSpin() | wxSplitter() | wxStyledText() | wxSysColourChanged() | wxTaskBarIcon() | wxTree() | wxUpdateUI() | wxWindowCreate() | wxWindowDestroy().
+-type wxEventType() :: wxAuiManagerEventType() | wxAuiNotebookEventType() | wxCalendarEventType() | wxChildFocusEventType() | wxCloseEventType() | wxColourPickerEventType() | wxCommandEventType() | wxContextMenuEventType() | wxDateEventType() | wxDisplayChangedEventType() | wxEraseEventType() | wxFileDirPickerEventType() | wxFocusEventType() | wxFontPickerEventType() | wxGridEventType() | wxHelpEventType() | wxHtmlLinkEventType() | wxIconizeEventType() | wxIdleEventType() | wxJoystickEventType() | wxKeyEventType() | wxListEventType() | wxMaximizeEventType() | wxMenuEventType() | wxMouseCaptureChangedEventType() | wxMouseEventType() | wxMoveEventType() | wxNavigationKeyEventType() | wxNcPaintEventType() | wxNotebookEventType() | wxPaintEventType() | wxPaletteChangedEventType() | wxQueryNewPaletteEventType() | wxSashEventType() | wxScrollEventType() | wxScrollWinEventType() | wxSetCursorEventType() | wxShowEventType() | wxSizeEventType() | wxSpinEventType() | wxSplitterEventType() | wxStyledTextEventType() | wxSysColourChangedEventType() | wxTaskBarIconEventType() | wxTreeEventType() | wxUpdateUIEventType() | wxWindowCreateEventType() | wxWindowDestroyEventType().
%% Hardcoded Records
--record(wxMouseState, {x, y, %% integer()
- leftDown, middleDown, rightDown, %% bool()
- controlDown, shiftDown, altDown, metaDown, cmdDown %% bool()
+-record(wxMouseState, {x :: integer(), y :: integer(),
+ leftDown :: boolean(), middleDown :: boolean, rightDown :: boolean,
+ controlDown :: boolean(), shiftDown :: boolean(),
+ altDown :: boolean(), metaDown :: boolean(), cmdDown :: boolean()
}).
-record(wxHtmlLinkInfo, {
- href, target %% string()
+ href :: unicode:chardata(), target :: unicode:chardata()
}).
%% Hardcoded Defines
@@ -937,7 +985,7 @@
-define(wxRESET, 16384).
-define(wxBACKWARD, 8192).
-define(wxFORWARD, 4096).
--define(wxICON_MASK, (?16#00000100 bor ?16#00000200 bor ?16#00000400 bor ?16#00000800)).
+-define(wxICON_MASK, (16#00000100 bor 16#00000200 bor 16#00000400 bor 16#00000800)).
-define(wxICON_ASTERISK, ?wxICON_INFORMATION).
-define(wxICON_STOP, ?wxICON_HAND).
-define(wxICON_INFORMATION, 2048).
diff --git a/lib/wx/install.es b/lib/wx/install.es
deleted file mode 100755
index 2811c7728c..0000000000
--- a/lib/wx/install.es
+++ /dev/null
@@ -1,302 +0,0 @@
-#!/usr/bin/env escript
-%% -*- erlang -*-
-%%
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
-%%
-%% The contents of this file are subject to the Erlang Public License,
-%% Version 1.1, (the "License"); you may not use this file except in
-%% compliance with the License. You should have received a copy of the
-%% Erlang Public License along with this software. If not, it can be
-%% retrieved online at http://www.erlang.org/.
-%%
-%% Software distributed under the License is distributed on an "AS IS"
-%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
-%% the License for the specific language governing rights and limitations
-%% under the License.
-%%
-%% %CopyrightEnd%
-%%
-%% Install wx to an erlang distribution.
-%%
-
--module('install_es'). %% Temp workaround for buggy escript
--mode(compile).
-
-usage() ->
- io:format("install [Opts] [InstallDir]~n",[]),
- io:format(" -v verbose~n",[]),
- io:format(" -q quiet and direct no questions~n",[]),
- io:format(" --create_release To create a release~n~n",[]),
- ok.
-
-main([]) ->
- IDir = filename:join(code:root_dir(),"lib"),
- install(IDir),
- ok;
-main(Opts) ->
- IDir = options(Opts),
- install(IDir),
- ok.
-
-install_files() ->
- [{[], {files, ["README","TODO", "Notes", "license.terms"]}},
- {[src], {list, "*.?rl"}},
- {[include], {list, "*.hrl"}},
- {[src,gen], {list, "*.?rl"}},
- {[test], {list, "*.?rl"}},
- {[test], {list, "*.bmp"}},
- {[test], {files, ["wxt", "Readme"]}},
- {[samples], {files, ["sample.xpm"]}},
- {[samples,menu], {files, ["copy.xpm"]}},
- {[samples,'*'], {list, "*.?rl"}},
- {[demos,'*'], {list, "*.?rl"}},
- {[demos,xrc,rc], {list, "*"}},
- {[doc,html], {files, ["edoc-info", "erlang.png", "stylesheet.css"]}}
- ].
-
-built_files(SrcDir, Type) ->
- Dirs = [{[doc], {list, "*.html"}},
- {[ebin], {list, "*"}},
- {[test], {list, "*.beam"}},
- {[demos,'*'], {list, "*.beam"}},
- {[samples,'*'], {list, "*.beam"}}],
- case Type of
- install ->
- [{[priv,'*'], {list, "*"}}|Dirs];
- _ -> %% Create Rel
- Win32 = [{[priv,win32], {list, "*"}}| Dirs],
- case filelib:wildcard("i386-apple*",
- filename:join(SrcDir, "priv")) of
- [Mac] ->
- [{[priv,list_to_atom(Mac)], {list, "*"}}|Win32];
- [] ->
- io:format("WARNING: Missing Mac driver!~n",[]),
- Win32
- end
- end.
-
-release_files() ->
- [{[], {files, ["configure.in","Makefile","wxwin.m4", "config.mk.in", "vsn.mk"]}},
- {[], {files, ["configure", "install.es"]}},
- {[autoconf], {files, ["config.guess","config.sub","install-sh"]}},
- {[src], {files, ["Makefile"]}},
- {[c_src], {files, ["Makefile.in"]}},
- {[c_src], {list, "*.c*"}},
- {[c_src], {list, "*.h"}},
- {[c_src,gen], {list, "*.cpp"}},
- {[c_src,gen], {list, "*.h"}},
- {[doc], {files, ["overview.edoc"]}},
- {[doc,src], {files, ["Makefile"]}},
- {[test], {files, ["Makefile"]}},
-%% {[demos], {files, ["Makefile"]}},
-%% {[demos,'*'], {files, ["Makefile"]}},
-%% {[samples], {files, ["Makefile"]}},
-%% {[samples,'*'], {files, ["Makefile"]}},
- {[api_gen], {list, "*.?rl"}},
- {[api_gen], {list, "*.conf"}},
- {[api_gen], {files, ["Makefile", "README"]}},
- {[api_gen, wx_extra], {list, "*"}}
- ].
-
-options(["-v"|Os]) ->
- put(verbose,true),
- options(Os);
-options(["-q"|Os]) ->
- put(quiet,true),
- options(Os);
-options(["--help"|_]) ->
- usage(),
- halt(0);
-options(["-h"|_]) ->
- usage(),
- halt(0);
-options(["--create_release"|Os]) ->
- put(create_release,true),
- options(Os);
-options(["-" ++_ |_Os]) ->
- usage(),
- halt(1);
-options([Dir]) -> Dir;
-options([]) ->
- filename:join(code:root_dir(),"lib").
-
-install(Dir) ->
- try
- case get(create_release) of
- true -> create_release();
- _ -> install2(Dir)
- end
- catch E:R ->
- io:format("Error ~p:~p in ~n ~p~n",[E,R, erlang:get_stacktrace()])
- end.
-
-install2(IDir) ->
- SrcD = get_src_dir(),
- Ver = get_version(SrcD),
- case get(quiet) of
- true ->
- copy_files(SrcD, filename:append(IDir,Ver)),
- ok;
- _ ->
- io:format("Installing ~p~n From ~p to ~p ~n",[Ver,SrcD,IDir]),
- case is_ok('ok [y|n]? ',[y,n]) of
- y ->
- copy_files(SrcD, filename:append(IDir,Ver)),
- io:format("Install complete~n",[]),
- ok;
- n ->
- usage(),
- halt(1)
- end
- end.
-
-copy_files(FromD, ToD) ->
- Fs = install_files() ++ built_files(FromD, install),
- Copy = fun(File, From, To, Acc) ->
- ensure_dir(To),
- case file:copy(filename:join(From,File),
- filename:join(To,File)) of
- {ok, _Bytes} ->
- [File|Acc];
- {error,_} ->
- io:format("ERROR Could not install file: ~p in~n ~p~n",
- [filename:join(From,File),
- filename:join(To,File)]),
- Acc
- end
- end,
- [expand_dirs(Dir,Files,FromD,ToD,Copy,[]) || {Dir,Files} <- Fs].
-
-expand_dirs(['*'|Ds],Fs,From,To,Fun,Acc) ->
- All = filelib:wildcard("[A-Za-z]*", From),
- Filter = fun(F) -> filelib:is_dir(filename:join(From,F)) end,
- Dirs = lists:filter(Filter, All),
- lists:foldl(fun(Dir,Nacc) ->
- expand_dirs([Dir|Ds],Fs,From,To,Fun,Nacc)
- end,
- Acc, Dirs);
-expand_dirs([Dir|Ds],Fs,From,To,Fun,Acc) ->
- expand_dirs(Ds,Fs,filename:join(From,Dir),filename:join(To,Dir),Fun,Acc);
-expand_dirs([],Fs,From,To,Fun,Acc) ->
- expand_files(Fs,From,To,Fun,Acc).
-
-expand_files({files,Fs},From,To,Fun,Acc) ->
- case get(verbose) of
- true -> io:format(" Check dir ~p to ~p~n", [From,To]);
- _ -> ok
- end,
- expand_files2(Fs,From,To,Fun,Acc);
-expand_files({list,WildCard},From,To,Fun,Acc) ->
- All = filelib:wildcard(WildCard, From),
- Filter = fun(F) -> filelib:is_regular(filename:join(From,F)) end,
- Fs = lists:filter(Filter, All),
- case get(verbose) of
- true -> io:format(" Check dir ~p to ~p~n", [From,To]);
- _ -> ok
- end,
- expand_files2(Fs,From,To,Fun,Acc).
-
-expand_files2(Fs,From,To,Fun,PrevAcc) ->
- lists:foldl(fun(File, Acc) -> Fun(File, From, To, Acc) end, PrevAcc, Fs).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-create_release() ->
- All = release_files() ++ install_files(),
- SrcD = get_src_dir(),
- Ver = "wx-" ++ get_version(SrcD),
- io:format("Create release ~p~n From ~p ~n",[Ver,SrcD]),
- case is_ok('ok [y|n]? ',[y,n]) of
- y ->
- List = fun(File, From, To, Acc) ->
- case filelib:is_regular(filename:join(From,File)) of
- true ->
- [{filename:join(To, File),
- filename:join(From,File)}|Acc];
- false ->
- io:format("Warning: File ~s/~s is missing~n",[From,File]),
- Acc
- end
- end,
- Expand = fun({Dir,Fs},Acc) ->
- expand_dirs(Dir,Fs,SrcD,Ver,List,Acc)
- end,
- Files = lists:foldl(Expand,[], All),
- ok = erl_tar:create(Ver ++ ".src.tar.gz", Files, [compressed]),
- BuiltDir = built_files(SrcD, create_release),
- BuiltFs = lists:foldl(Expand,[], BuiltDir),
- ok = erl_tar:create(Ver ++ ".built.tar.gz",
- Files ++ BuiltFs,
- [compressed]),
- ok;
- n ->
- usage()
- end.
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-is_ok(Str, Answers) ->
- {ok, [Ans]} = io:fread(Str, "~a"),
- case lists:member(Ans, Answers) of
- true -> Ans;
- false ->
- io:format("Please answer ~p~n",[Answers]),
- is_ok(Str,Answers)
- end.
-
-
-ensure_dir(To) ->
- case filelib:ensure_dir(filename:join(To, "dummy")) of
- ok -> ok;
- Error ->
- io:format("Error ~p in ~p ~n",[Error, To]),
- halt(1)
- end.
-
-get_version(Dir) ->
- %% Have we installed this from a release
- %% get the directory name
- DateVariant =
- fun() ->
- {_,Month,Day} = erlang:date(),
- Date = io_lib:format("~.2.0w~.2.0w",[Month,Day]),
- {ok, Bin} = file:read_file("vsn.mk"),
- Opt = [{capture, all_but_first, list}],
- case re:run(Bin, "WX_VSN\s*=\s*(.*)", Opt) of
- {match, [Ver]} ->
- lists:flatten([Ver,"."|Date]);
- _ ->
- lists:flatten(["wx-0.98."|Date])
- end
- end,
- case Dir of
- "." ->
- %% Installing from src without a release
- DateVariant();
- Dir ->
- Base = filename:basename(Dir),
- case string:tokens(Base, "-.") of
- ["wx", Ma, Mi|_]
- when is_integer(Ma),is_integer(Mi) ->
- Base;
- _ ->
- DateVariant()
- end
- end.
-
-%% Get src dir of installation
-get_src_dir() ->
- Escript = escript:script_name(),
- Abs = filename:dirname(filename:absname(Escript)),
- Test = filename:join(Abs, "README"),
- case file:read_file(Test) of
- {ok, _} -> ok;
- {error, enoent} ->
- io:format("Error couldn't read ~s ~n",[Test]),
- halt(1)
- end,
- Abs.
-
-
diff --git a/lib/wx/src/Makefile b/lib/wx/src/Makefile
index 4e5971de03..777fb7d998 100644
--- a/lib/wx/src/Makefile
+++ b/lib/wx/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2011. All Rights Reserved.
+# Copyright Ericsson AB 2008-2012. 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
@@ -20,7 +20,6 @@
include ../vsn.mk
ifdef TERTIARY_BOOTSTRAP
VSN = $(WX_VSN)
- INSIDE_ERLSRC = true
include $(ERL_TOP)/make/target.mk
include $(ERL_TOP)/make/$(TARGET)/otp.mk
RELSYSDIR = $(RELEASE_PATH)/lib/wx-$(VSN)
@@ -119,19 +118,17 @@ $(EBIN)/%.beam: $(EGEN)/%.erl $(HEADER_FILES)
# ----------------------------------------------------
# Release Target
# ----------------------------------------------------
-ifeq ($(INSIDE_ERLSRC), true)
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/src/gen
- $(INSTALL_DATA) $(GEN_HRL) $(GEN_FILES) $(RELSYSDIR)/src/gen
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(EXT_HRL) $(RELSYSDIR)/include
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(APP_TARGET) $(APPUP_TARGET) $(RELSYSDIR)/ebin
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(HRL_FILES) $(ERL_FILES) "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src/gen"
+ $(INSTALL_DATA) $(GEN_HRL) $(GEN_FILES) "$(RELSYSDIR)/src/gen"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(EXT_HRL) "$(RELSYSDIR)/include"
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(APP_TARGET) $(APPUP_TARGET) "$(RELSYSDIR)/ebin"
# $(INSTALL_DATA) ../$(ARCHIVE) $(RELEASE_PATH)/lib
release_docs_spec:
-endif
diff --git a/lib/wx/src/gen/gl.erl b/lib/wx/src/gen/gl.erl
index 0ebf51d28a..ff381683ee 100644
--- a/lib/wx/src/gen/gl.erl
+++ b/lib/wx/src/gen/gl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -25,10 +25,6 @@
%%
%% Booleans are represented by integers 0 and 1.
-%% @type mem(). memory block
-%% @type enum(). An integer defined in gl.hrl
-%% @type offset(). An integer which is an offset in an array
-%% @type clamp(). A float clamped between 0.0 - 1.0
-module(gl).
-compile(inline).
@@ -53,71 +49,75 @@
-define(GLsync,64/native-unsigned).
-define(GLuint64,64/native-unsigned).
-define(GLint64,64/native-signed).
--type clamp() :: float().
--type offset() :: non_neg_integer().
--type enum() :: non_neg_integer().
--type mem() :: binary() | tuple().
-
--export([accum/2,alphaFunc/2,areTexturesResident/1,arrayElement/1,'begin'/1,
- bindTexture/2,bitmap/7,blendFunc/2,callList/1,callLists/1,clear/1,clearAccum/4,
- clearColor/4,clearDepth/1,clearIndex/1,clearStencil/1,clipPlane/2,
- color3b/3,color3bv/1,color3d/3,color3dv/1,color3f/3,color3fv/1,color3i/3,
- color3iv/1,color3s/3,color3sv/1,color3ub/3,color3ubv/1,color3ui/3,color3uiv/1,
- color3us/3,color3usv/1,color4b/4,color4bv/1,color4d/4,color4dv/1,color4f/4,
- color4fv/1,color4i/4,color4iv/1,color4s/4,color4sv/1,color4ub/4,color4ubv/1,
- color4ui/4,color4uiv/1,color4us/4,color4usv/1,colorMask/4,colorMaterial/2,
- colorPointer/4,copyPixels/5,copyTexImage1D/7,copyTexImage2D/8,copyTexSubImage1D/6,
- copyTexSubImage2D/8,cullFace/1,deleteLists/2,deleteTextures/1,depthFunc/1,
- depthMask/1,depthRange/2,disable/1,disableClientState/1,drawArrays/3,
- drawBuffer/1,drawElements/4,drawPixels/5,edgeFlag/1,edgeFlagPointer/2,
- edgeFlagv/1,enable/1,enableClientState/1,'end'/0,endList/0,evalCoord1d/1,
- evalCoord1dv/1,evalCoord1f/1,evalCoord1fv/1,evalCoord2d/2,evalCoord2dv/1,
- evalCoord2f/2,evalCoord2fv/1,evalMesh1/3,evalMesh2/5,evalPoint1/1,
- evalPoint2/2,feedbackBuffer/3,finish/0,flush/0,fogf/2,fogfv/2,fogi/2,
- fogiv/2,frontFace/1,frustum/6,genLists/1,genTextures/1,getBooleanv/1,
- getClipPlane/1,getDoublev/1,getError/0,getFloatv/1,getIntegerv/1,getLightfv/2,
- getLightiv/2,getMapdv/3,getMapfv/3,getMapiv/3,getMaterialfv/2,getMaterialiv/2,
- getPixelMapfv/2,getPixelMapuiv/2,getPixelMapusv/2,getPolygonStipple/0,
- getString/1,getTexEnvfv/2,getTexEnviv/2,getTexGendv/2,getTexGenfv/2,
- getTexGeniv/2,getTexImage/5,getTexLevelParameterfv/3,getTexLevelParameteriv/3,
- getTexParameterfv/2,getTexParameteriv/2,hint/2,indexMask/1,indexPointer/3,
- indexd/1,indexdv/1,indexf/1,indexfv/1,indexi/1,indexiv/1,indexs/1,indexsv/1,
- indexub/1,indexubv/1,initNames/0,interleavedArrays/3,isEnabled/1,isList/1,
- isTexture/1,lightModelf/2,lightModelfv/2,lightModeli/2,lightModeliv/2,
- lightf/3,lightfv/3,lighti/3,lightiv/3,lineStipple/2,lineWidth/1,listBase/1,
- loadIdentity/0,loadMatrixd/1,loadMatrixf/1,loadName/1,logicOp/1,map1d/6,
- map1f/6,map2d/10,map2f/10,mapGrid1d/3,mapGrid1f/3,mapGrid2d/6,mapGrid2f/6,
- materialf/3,materialfv/3,materiali/3,materialiv/3,matrixMode/1,multMatrixd/1,
- multMatrixf/1,newList/2,normal3b/3,normal3bv/1,normal3d/3,normal3dv/1,
- normal3f/3,normal3fv/1,normal3i/3,normal3iv/1,normal3s/3,normal3sv/1,
- normalPointer/3,ortho/6,passThrough/1,pixelMapfv/3,pixelMapuiv/3,pixelMapusv/3,
- pixelStoref/2,pixelStorei/2,pixelTransferf/2,pixelTransferi/2,pixelZoom/2,
- pointSize/1,polygonMode/2,polygonOffset/2,polygonStipple/1,popAttrib/0,
- popClientAttrib/0,popMatrix/0,popName/0,prioritizeTextures/2,pushAttrib/1,
- pushClientAttrib/1,pushMatrix/0,pushName/1,rasterPos2d/2,rasterPos2dv/1,
- rasterPos2f/2,rasterPos2fv/1,rasterPos2i/2,rasterPos2iv/1,rasterPos2s/2,
- rasterPos2sv/1,rasterPos3d/3,rasterPos3dv/1,rasterPos3f/3,rasterPos3fv/1,
- rasterPos3i/3,rasterPos3iv/1,rasterPos3s/3,rasterPos3sv/1,rasterPos4d/4,
- rasterPos4dv/1,rasterPos4f/4,rasterPos4fv/1,rasterPos4i/4,rasterPos4iv/1,
- rasterPos4s/4,rasterPos4sv/1,readBuffer/1,readPixels/7,rectd/4,rectdv/2,
- rectf/4,rectfv/2,recti/4,rectiv/2,rects/4,rectsv/2,renderMode/1,rotated/4,
- rotatef/4,scaled/3,scalef/3,scissor/4,selectBuffer/2,shadeModel/1,stencilFunc/3,
- stencilMask/1,stencilOp/3,texCoord1d/1,texCoord1dv/1,texCoord1f/1,
- texCoord1fv/1,texCoord1i/1,texCoord1iv/1,texCoord1s/1,texCoord1sv/1,
- texCoord2d/2,texCoord2dv/1,texCoord2f/2,texCoord2fv/1,texCoord2i/2,
- texCoord2iv/1,texCoord2s/2,texCoord2sv/1,texCoord3d/3,texCoord3dv/1,
- texCoord3f/3,texCoord3fv/1,texCoord3i/3,texCoord3iv/1,texCoord3s/3,
- texCoord3sv/1,texCoord4d/4,texCoord4dv/1,texCoord4f/4,texCoord4fv/1,
- texCoord4i/4,texCoord4iv/1,texCoord4s/4,texCoord4sv/1,texCoordPointer/4,
- texEnvf/3,texEnvfv/3,texEnvi/3,texEnviv/3,texGend/3,texGendv/3,texGenf/3,
- texGenfv/3,texGeni/3,texGeniv/3,texImage1D/8,texImage2D/9,texParameterf/3,
- texParameterfv/3,texParameteri/3,texParameteriv/3,texSubImage1D/7,
- texSubImage2D/9,translated/3,translatef/3,vertex2d/2,vertex2dv/1,vertex2f/2,
- vertex2fv/1,vertex2i/2,vertex2iv/1,vertex2s/2,vertex2sv/1,vertex3d/3,
- vertex3dv/1,vertex3f/3,vertex3fv/1,vertex3i/3,vertex3iv/1,vertex3s/3,
- vertex3sv/1,vertex4d/4,vertex4dv/1,vertex4f/4,vertex4fv/1,vertex4i/4,
- vertex4iv/1,vertex4s/4,vertex4sv/1,vertexPointer/4,viewport/4,blendColor/4,
- blendEquation/1,drawRangeElements/6,texImage3D/10,texSubImage3D/11,
+-type enum() :: non_neg_integer(). %% See wx/include/gl.hrl
+-type clamp() :: float(). %% 0.0..1.0
+-type offset() :: non_neg_integer(). %% Offset in memory block
+-type matrix() :: {float(),float(),float(),float(),
+ float(),float(),float(),float(),
+ float(),float(),float(),float(),
+ float(),float(),float(),float()}.
+-type mem() :: binary() | tuple(). %% Memory block
+
+-export([clearIndex/1,clearColor/4,clear/1,indexMask/1,colorMask/4,alphaFunc/2,
+ blendFunc/2,logicOp/1,cullFace/1,frontFace/1,pointSize/1,lineWidth/1,
+ lineStipple/2,polygonMode/2,polygonOffset/2,polygonStipple/1,getPolygonStipple/0,
+ edgeFlag/1,edgeFlagv/1,scissor/4,clipPlane/2,getClipPlane/1,drawBuffer/1,
+ readBuffer/1,enable/1,disable/1,isEnabled/1,enableClientState/1,disableClientState/1,
+ getBooleanv/1,getDoublev/1,getFloatv/1,getIntegerv/1,pushAttrib/1,
+ popAttrib/0,pushClientAttrib/1,popClientAttrib/0,renderMode/1,getError/0,
+ getString/1,finish/0,flush/0,hint/2,clearDepth/1,depthFunc/1,depthMask/1,
+ depthRange/2,clearAccum/4,accum/2,matrixMode/1,ortho/6,frustum/6,viewport/4,
+ pushMatrix/0,popMatrix/0,loadIdentity/0,loadMatrixd/1,loadMatrixf/1,
+ multMatrixd/1,multMatrixf/1,rotated/4,rotatef/4,scaled/3,scalef/3,translated/3,
+ translatef/3,isList/1,deleteLists/2,genLists/1,newList/2,endList/0,
+ callList/1,callLists/1,listBase/1,'begin'/1,'end'/0,vertex2d/2,vertex2f/2,
+ vertex2i/2,vertex2s/2,vertex3d/3,vertex3f/3,vertex3i/3,vertex3s/3,vertex4d/4,
+ vertex4f/4,vertex4i/4,vertex4s/4,vertex2dv/1,vertex2fv/1,vertex2iv/1,
+ vertex2sv/1,vertex3dv/1,vertex3fv/1,vertex3iv/1,vertex3sv/1,vertex4dv/1,
+ vertex4fv/1,vertex4iv/1,vertex4sv/1,normal3b/3,normal3d/3,normal3f/3,
+ normal3i/3,normal3s/3,normal3bv/1,normal3dv/1,normal3fv/1,normal3iv/1,
+ normal3sv/1,indexd/1,indexf/1,indexi/1,indexs/1,indexub/1,indexdv/1,
+ indexfv/1,indexiv/1,indexsv/1,indexubv/1,color3b/3,color3d/3,color3f/3,
+ color3i/3,color3s/3,color3ub/3,color3ui/3,color3us/3,color4b/4,color4d/4,
+ color4f/4,color4i/4,color4s/4,color4ub/4,color4ui/4,color4us/4,color3bv/1,
+ color3dv/1,color3fv/1,color3iv/1,color3sv/1,color3ubv/1,color3uiv/1,
+ color3usv/1,color4bv/1,color4dv/1,color4fv/1,color4iv/1,color4sv/1,
+ color4ubv/1,color4uiv/1,color4usv/1,texCoord1d/1,texCoord1f/1,texCoord1i/1,
+ texCoord1s/1,texCoord2d/2,texCoord2f/2,texCoord2i/2,texCoord2s/2,texCoord3d/3,
+ texCoord3f/3,texCoord3i/3,texCoord3s/3,texCoord4d/4,texCoord4f/4,texCoord4i/4,
+ texCoord4s/4,texCoord1dv/1,texCoord1fv/1,texCoord1iv/1,texCoord1sv/1,
+ texCoord2dv/1,texCoord2fv/1,texCoord2iv/1,texCoord2sv/1,texCoord3dv/1,
+ texCoord3fv/1,texCoord3iv/1,texCoord3sv/1,texCoord4dv/1,texCoord4fv/1,
+ texCoord4iv/1,texCoord4sv/1,rasterPos2d/2,rasterPos2f/2,rasterPos2i/2,
+ rasterPos2s/2,rasterPos3d/3,rasterPos3f/3,rasterPos3i/3,rasterPos3s/3,
+ rasterPos4d/4,rasterPos4f/4,rasterPos4i/4,rasterPos4s/4,rasterPos2dv/1,
+ rasterPos2fv/1,rasterPos2iv/1,rasterPos2sv/1,rasterPos3dv/1,rasterPos3fv/1,
+ rasterPos3iv/1,rasterPos3sv/1,rasterPos4dv/1,rasterPos4fv/1,rasterPos4iv/1,
+ rasterPos4sv/1,rectd/4,rectf/4,recti/4,rects/4,rectdv/2,rectfv/2,rectiv/2,
+ rectsv/2,vertexPointer/4,normalPointer/3,colorPointer/4,indexPointer/3,
+ texCoordPointer/4,edgeFlagPointer/2,arrayElement/1,drawArrays/3,drawElements/4,
+ interleavedArrays/3,shadeModel/1,lightf/3,lighti/3,lightfv/3,lightiv/3,
+ getLightfv/2,getLightiv/2,lightModelf/2,lightModeli/2,lightModelfv/2,
+ lightModeliv/2,materialf/3,materiali/3,materialfv/3,materialiv/3,getMaterialfv/2,
+ getMaterialiv/2,colorMaterial/2,pixelZoom/2,pixelStoref/2,pixelStorei/2,
+ pixelTransferf/2,pixelTransferi/2,pixelMapfv/3,pixelMapuiv/3,pixelMapusv/3,
+ getPixelMapfv/2,getPixelMapuiv/2,getPixelMapusv/2,bitmap/7,readPixels/7,
+ drawPixels/5,copyPixels/5,stencilFunc/3,stencilMask/1,stencilOp/3,
+ clearStencil/1,texGend/3,texGenf/3,texGeni/3,texGendv/3,texGenfv/3,
+ texGeniv/3,getTexGendv/2,getTexGenfv/2,getTexGeniv/2,texEnvf/3,texEnvi/3,
+ texEnvfv/3,texEnviv/3,getTexEnvfv/2,getTexEnviv/2,texParameterf/3,
+ texParameteri/3,texParameterfv/3,texParameteriv/3,getTexParameterfv/2,
+ getTexParameteriv/2,getTexLevelParameterfv/3,getTexLevelParameteriv/3,
+ texImage1D/8,texImage2D/9,getTexImage/5,genTextures/1,deleteTextures/1,
+ bindTexture/2,prioritizeTextures/2,areTexturesResident/1,isTexture/1,
+ texSubImage1D/7,texSubImage2D/9,copyTexImage1D/7,copyTexImage2D/8,
+ copyTexSubImage1D/6,copyTexSubImage2D/8,map1d/6,map1f/6,map2d/10,map2f/10,
+ getMapdv/3,getMapfv/3,getMapiv/3,evalCoord1d/1,evalCoord1f/1,evalCoord1dv/1,
+ evalCoord1fv/1,evalCoord2d/2,evalCoord2f/2,evalCoord2dv/1,evalCoord2fv/1,
+ mapGrid1d/3,mapGrid1f/3,mapGrid2d/6,mapGrid2f/6,evalPoint1/1,evalPoint2/2,
+ evalMesh1/3,evalMesh2/5,fogf/2,fogi/2,fogfv/2,fogiv/2,feedbackBuffer/3,
+ passThrough/1,selectBuffer/2,initNames/0,loadName/1,pushName/1,popName/0,
+ blendColor/4,blendEquation/1,drawRangeElements/6,texImage3D/10,texSubImage3D/11,
copyTexSubImage3D/9,colorTable/6,colorTableParameterfv/3,colorTableParameteriv/3,
copyColorTable/5,getColorTable/4,getColorTableParameterfv/2,getColorTableParameteriv/2,
colorSubTable/6,copyColorSubTable/5,convolutionFilter1D/6,convolutionFilter2D/7,
@@ -267,9 +267,10 @@
viewportIndexedfv/2,scissorArrayv/2,scissorIndexed/5,scissorIndexedv/2,
depthRangeArrayv/2,depthRangeIndexed/3,getFloati_v/2,getDoublei_v/2,
debugMessageControlARB/5,debugMessageInsertARB/5,getDebugMessageLogARB/2,
- getGraphicsResetStatusARB/0,resizeBuffersMESA/0,windowPos4dMESA/4,
- windowPos4dvMESA/1,windowPos4fMESA/4,windowPos4fvMESA/1,windowPos4iMESA/4,
- windowPos4ivMESA/1,windowPos4sMESA/4,windowPos4svMESA/1,depthBoundsEXT/2,
+ getGraphicsResetStatusARB/0,drawArraysInstancedBaseInstance/5,drawElementsInstancedBaseInstance/6,
+ drawElementsInstancedBaseVertexBaseInstance/7,drawTransformFeedbackInstanced/3,
+ drawTransformFeedbackStreamInstanced/4,getInternalformativ/4,bindImageTexture/7,
+ memoryBarrier/1,texStorage1D/4,texStorage2D/5,texStorage3D/6,depthBoundsEXT/2,
stencilClearTagEXT/2]).
-export([call/2, cast/2, send_bin/1]).
@@ -306,2215 +307,8470 @@ send_bin(Tuple) when is_tuple(Tuple) ->
%% API
-%% @spec (Op::enum(),Value::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glAccum.xml">external</a> documentation.
--spec accum(enum(),float()) -> ok.
-accum(Op,Value) ->
- cast(5037, <<Op:?GLenum,Value:?GLfloat>>).
-
-%% @spec (Func::enum(),Ref::clamp()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glAlphaFunc.xml">external</a> documentation.
--spec alphaFunc(enum(),clamp()) -> ok.
-alphaFunc(Func,Ref) ->
- cast(5038, <<Func:?GLenum,Ref:?GLclampf>>).
+%% @doc Specify the clear value for the color index buffers
+%%
+%% ``gl:clearIndex'' specifies the index used by {@link gl:clear/1} to clear the color index
+%% buffers. `C' is not clamped. Rather, `C' is converted to a fixed-point value
+%% with unspecified precision to the right of the binary point. The integer part of this
+%% value is then masked with 2 m-1, where m is the number of bits in a color index stored
+%% in the frame buffer.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearIndex.xml">external</a> documentation.
+-spec clearIndex(C) -> ok when C :: float().
+clearIndex(C) ->
+ cast(5037, <<C:?GLfloat>>).
-%% @spec (Textures::[integer()]) -> {0|1,Residences::[0|1]}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glAreTexturesResident.xml">external</a> documentation.
--spec areTexturesResident([integer()]) -> {0|1,[0|1]}.
-areTexturesResident(Textures) ->
- call(5039, <<(length(Textures)):?GLuint,
- (<< <<C:?GLuint>> || C <- Textures>>)/binary,0:(((1+length(Textures)) rem 2)*32)>>).
+%% @doc Specify clear values for the color buffers
+%%
+%% ``gl:clearColor'' specifies the red, green, blue, and alpha values used by {@link gl:clear/1}
+%% to clear the color buffers. Values specified by ``gl:clearColor'' are clamped to the
+%% range [0 1].
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearColor.xml">external</a> documentation.
+-spec clearColor(Red, Green, Blue, Alpha) -> ok when Red :: clamp(),Green :: clamp(),Blue :: clamp(),Alpha :: clamp().
+clearColor(Red,Green,Blue,Alpha) ->
+ cast(5038, <<Red:?GLclampf,Green:?GLclampf,Blue:?GLclampf,Alpha:?GLclampf>>).
-%% @spec (I::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glArrayElement.xml">external</a> documentation.
--spec arrayElement(integer()) -> ok.
-arrayElement(I) ->
- cast(5040, <<I:?GLint>>).
+%% @doc Clear buffers to preset values
+%%
+%% ``gl:clear'' sets the bitplane area of the window to values previously selected by ``gl:clearColor''
+%% , ``gl:clearDepth'', and ``gl:clearStencil''. Multiple color buffers can be cleared
+%% simultaneously by selecting more than one buffer at a time using {@link gl:drawBuffer/1} .
+%%
+%% The pixel ownership test, the scissor test, dithering, and the buffer writemasks affect
+%% the operation of ``gl:clear''. The scissor box bounds the cleared region. Alpha function,
+%% blend function, logical operation, stenciling, texture mapping, and depth-buffering are
+%% ignored by ``gl:clear''.
+%%
+%% ``gl:clear'' takes a single argument that is the bitwise OR of several values indicating
+%% which buffer is to be cleared.
+%%
+%% The values are as follows:
+%%
+%% `?GL_COLOR_BUFFER_BIT': Indicates the buffers currently enabled for color writing.
+%%
+%% `?GL_DEPTH_BUFFER_BIT': Indicates the depth buffer.
+%%
+%% `?GL_STENCIL_BUFFER_BIT': Indicates the stencil buffer.
+%%
+%% The value to which each buffer is cleared depends on the setting of the clear value for
+%% that buffer.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClear.xml">external</a> documentation.
+-spec clear(Mask) -> ok when Mask :: integer().
+clear(Mask) ->
+ cast(5039, <<Mask:?GLbitfield>>).
-%% @spec (Mode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBegin.xml">external</a> documentation.
--spec 'begin'(enum()) -> ok.
-'begin'(Mode) ->
- cast(5041, <<Mode:?GLenum>>).
+%% @doc Control the writing of individual bits in the color index buffers
+%%
+%% ``gl:indexMask'' controls the writing of individual bits in the color index buffers.
+%% The least significant n bits of `Mask' , where n is the number of bits in a color
+%% index buffer, specify a mask. Where a 1 (one) appears in the mask, it's possible to write
+%% to the corresponding bit in the color index buffer (or buffers). Where a 0 (zero) appears,
+%% the corresponding bit is write-protected.
+%%
+%% This mask is used only in color index mode, and it affects only the buffers currently
+%% selected for writing (see {@link gl:drawBuffer/1} ). Initially, all bits are enabled for
+%% writing.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIndexMask.xml">external</a> documentation.
+-spec indexMask(Mask) -> ok when Mask :: integer().
+indexMask(Mask) ->
+ cast(5040, <<Mask:?GLuint>>).
-%% @spec (Target::enum(),Texture::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindTexture.xml">external</a> documentation.
--spec bindTexture(enum(),integer()) -> ok.
-bindTexture(Target,Texture) ->
- cast(5042, <<Target:?GLenum,Texture:?GLuint>>).
+%% @doc Enable and disable writing of frame buffer color components
+%%
+%% ``gl:colorMask'' and ``gl:colorMaski'' specify whether the individual color components
+%% in the frame buffer can or cannot be written. ``gl:colorMaski'' sets the mask for a
+%% specific draw buffer, whereas ``gl:colorMask'' sets the mask for all draw buffers. If `Red'
+%% is `?GL_FALSE', for example, no change is made to the red component of any pixel
+%% in any of the color buffers, regardless of the drawing operation attempted.
+%%
+%% Changes to individual bits of components cannot be controlled. Rather, changes are either
+%% enabled or disabled for entire color components.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColorMask.xml">external</a> documentation.
+-spec colorMask(Red, Green, Blue, Alpha) -> ok when Red :: 0|1,Green :: 0|1,Blue :: 0|1,Alpha :: 0|1.
+colorMask(Red,Green,Blue,Alpha) ->
+ cast(5041, <<Red:?GLboolean,Green:?GLboolean,Blue:?GLboolean,Alpha:?GLboolean>>).
-%% @spec (Width::integer(),Height::integer(),Xorig::float(),Yorig::float(),Xmove::float(),Ymove::float(),Bitmap::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBitmap.xml">external</a> documentation.
--spec bitmap(integer(),integer(),float(),float(),float(),float(),offset()|mem()) -> ok.
-bitmap(Width,Height,Xorig,Yorig,Xmove,Ymove,Bitmap) when is_integer(Bitmap) ->
- cast(5043, <<Width:?GLsizei,Height:?GLsizei,Xorig:?GLfloat,Yorig:?GLfloat,Xmove:?GLfloat,Ymove:?GLfloat,Bitmap:?GLuint>>);
-bitmap(Width,Height,Xorig,Yorig,Xmove,Ymove,Bitmap) ->
- send_bin(Bitmap),
- cast(5044, <<Width:?GLsizei,Height:?GLsizei,Xorig:?GLfloat,Yorig:?GLfloat,Xmove:?GLfloat,Ymove:?GLfloat>>).
+%% @doc Specify the alpha test function
+%%
+%% The alpha test discards fragments depending on the outcome of a comparison between an
+%% incoming fragment's alpha value and a constant reference value. ``gl:alphaFunc'' specifies
+%% the reference value and the comparison function. The comparison is performed only if alpha
+%% testing is enabled. By default, it is not enabled. (See {@link gl:enable/1} and {@link gl:enable/1}
+%% of `?GL_ALPHA_TEST'.)
+%%
+%% `Func' and `Ref' specify the conditions under which the pixel is drawn. The
+%% incoming alpha value is compared to `Ref' using the function specified by `Func' .
+%% If the value passes the comparison, the incoming fragment is drawn if it also passes subsequent
+%% stencil and depth buffer tests. If the value fails the comparison, no change is made to
+%% the frame buffer at that pixel location. The comparison functions are as follows:
+%%
+%% `?GL_NEVER': Never passes.
+%%
+%% `?GL_LESS': Passes if the incoming alpha value is less than the reference value.
+%%
+%% `?GL_EQUAL': Passes if the incoming alpha value is equal to the reference value.
+%%
+%% `?GL_LEQUAL': Passes if the incoming alpha value is less than or equal to the reference
+%% value.
+%%
+%% `?GL_GREATER': Passes if the incoming alpha value is greater than the reference
+%% value.
+%%
+%% `?GL_NOTEQUAL': Passes if the incoming alpha value is not equal to the reference
+%% value.
+%%
+%% `?GL_GEQUAL': Passes if the incoming alpha value is greater than or equal to the
+%% reference value.
+%%
+%% `?GL_ALWAYS': Always passes (initial value).
+%%
+%% ``gl:alphaFunc'' operates on all pixel write operations, including those resulting from
+%% the scan conversion of points, lines, polygons, and bitmaps, and from pixel draw and copy
+%% operations. ``gl:alphaFunc'' does not affect screen clear operations.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glAlphaFunc.xml">external</a> documentation.
+-spec alphaFunc(Func, Ref) -> ok when Func :: enum(),Ref :: clamp().
+alphaFunc(Func,Ref) ->
+ cast(5042, <<Func:?GLenum,Ref:?GLclampf>>).
-%% @spec (Sfactor::enum(),Dfactor::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlendFunc.xml">external</a> documentation.
--spec blendFunc(enum(),enum()) -> ok.
+%% @doc Specify pixel arithmetic
+%%
+%% Pixels can be drawn using a function that blends the incoming (source) RGBA values with
+%% the RGBA values that are already in the frame buffer (the destination values). Blending
+%% is initially disabled. Use {@link gl:enable/1} and {@link gl:enable/1} with argument `?GL_BLEND'
+%% to enable and disable blending.
+%%
+%% ``gl:blendFunc'' defines the operation of blending for all draw buffers when it is enabled.
+%% ``gl:blendFunci'' defines the operation of blending for a single draw buffer specified
+%% by `Buf' when enabled for that draw buffer. `Sfactor' specifies which method
+%% is used to scale the source color components. `Dfactor' specifies which method is
+%% used to scale the destination color components. Both parameters must be one of the following
+%% symbolic constants: `?GL_ZERO', `?GL_ONE', `?GL_SRC_COLOR', `?GL_ONE_MINUS_SRC_COLOR'
+%% , `?GL_DST_COLOR', `?GL_ONE_MINUS_DST_COLOR', `?GL_SRC_ALPHA', `?GL_ONE_MINUS_SRC_ALPHA'
+%% , `?GL_DST_ALPHA', `?GL_ONE_MINUS_DST_ALPHA', `?GL_CONSTANT_COLOR', `?GL_ONE_MINUS_CONSTANT_COLOR'
+%% , `?GL_CONSTANT_ALPHA', `?GL_ONE_MINUS_CONSTANT_ALPHA', `?GL_SRC_ALPHA_SATURATE'
+%% , `?GL_SRC1_COLOR', `?GL_ONE_MINUS_SRC1_COLOR', `?GL_SRC1_ALPHA', and `?GL_ONE_MINUS_SRC1_ALPHA'
+%% . The possible methods are described in the following table. Each method defines four
+%% scale factors, one each for red, green, blue, and alpha. In the table and in subsequent
+%% equations, first source, second source and destination color components are referred to
+%% as (R s0 G s0 B s0 A s0), (R s1 G s1 B s1 A s1) and (R d G d B d A d), respectively. The color specified by {@link gl:blendColor/4} is referred to
+%% as (R c G c B c A c). They are understood to have integer values between 0 and (k R k G k B k A), where
+%%
+%% k c= 2(m c)-1
+%%
+%% and (m R m G m B m A) is the number of red, green, blue, and alpha bitplanes.
+%%
+%% Source and destination scale factors are referred to as (s R s G s B s A) and (d R d G d B d A). The scale factors described
+%% in the table, denoted (f R f G f B f A), represent either source or destination factors. All scale factors
+%% have range [0 1].
+%%
+%% <table><tbody><tr><td>` Parameter '</td><td>(f R f G f B f A)</td></tr></tbody><tbody><tr><td>`?GL_ZERO'
+%% </td><td>(0 0 0 0)</td></tr><tr><td>`?GL_ONE'</td><td>(1 1 1 1)</td></tr><tr><td>`?GL_SRC_COLOR'</td>
+%% <td>(R s0 k/R G s0 k/G B s0 k/B A s0 k/A)</td></tr><tr><td>`?GL_ONE_MINUS_SRC_COLOR'</td><td>(1 1 1 1)-(R s0 k/R G s0 k/G B s0 k/B
+%% A s0 k/A)</td></tr><tr><td>`?GL_DST_COLOR'
+%% </td><td>(R d k/R G d k/G B d k/B A d k/A)</td></tr><tr><td>`?GL_ONE_MINUS_DST_COLOR'</td><td>(1 1 1 1)-(R d k/R G d k/G B d k/B
+%% A d k/A)</td></tr><tr><td>`?GL_SRC_ALPHA'
+%% </td><td>(A s0 k/A A s0 k/A A s0 k/A A s0 k/A)</td></tr><tr><td>`?GL_ONE_MINUS_SRC_ALPHA'</td><td>(1 1 1 1)-(A s0 k/A A s0 k/A A s0
+%% k/A A s0 k/A)</td></tr><tr><td>`?GL_DST_ALPHA'
+%% </td><td>(A d k/A A d k/A A d k/A A d k/A)</td></tr><tr><td>`?GL_ONE_MINUS_DST_ALPHA'</td><td>(1 1 1 1)-(A d k/A A d k/A A d k/A
+%% A d k/A)</td></tr><tr><td>`?GL_CONSTANT_COLOR'
+%% </td><td>(R c G c B c A c)</td></tr><tr><td>`?GL_ONE_MINUS_CONSTANT_COLOR'</td><td>(1 1 1 1)-(R c G c B c A c)</td></tr><tr><td>
+%% `?GL_CONSTANT_ALPHA'</td><td>(A c A c A c A c)</td></tr><tr><td>`?GL_ONE_MINUS_CONSTANT_ALPHA'</td>
+%% <td>(1 1 1 1)-(A c A c A c A c)</td></tr><tr><td>`?GL_SRC_ALPHA_SATURATE'</td><td>(i i i 1)</td></tr><tr><td>`?GL_SRC1_COLOR'
+%% </td><td>(R s1 k/R G s1 k/G B s1 k/B A s1 k/A)</td></tr><tr><td>`?GL_ONE_MINUS_SRC1_COLOR'</td><td>(1 1 1 1)-(R s1 k/R G s1 k/G B
+%% s1 k/B A s1 k/A)</td></tr><tr><td>`?GL_SRC1_ALPHA'
+%% </td><td>(A s1 k/A A s1 k/A A s1 k/A A s1 k/A)</td></tr><tr><td>`?GL_ONE_MINUS_SRC1_ALPHA'</td><td>(1 1 1 1)-(A s1 k/A A s1 k/A A
+%% s1 k/A A s1 k/A)</td></tr></tbody></table>
+%%
+%%
+%% In the table,
+%%
+%% i= min(A s k A-A d) k/A
+%%
+%% To determine the blended RGBA values of a pixel, the system uses the following equations:
+%%
+%%
+%% R d= min(k R R s s R+R d d R) G d= min(k G G s s G+G d d G) B d= min(k B B s s B+B d d B) A d= min(k A A s s A+A d d A)
+%%
+%% Despite the apparent precision of the above equations, blending arithmetic is not exactly
+%% specified, because blending operates with imprecise integer color values. However, a blend
+%% factor that should be equal to 1 is guaranteed not to modify its multiplicand, and a blend
+%% factor equal to 0 reduces its multiplicand to 0. For example, when `Sfactor' is `?GL_SRC_ALPHA'
+%% , `Dfactor' is `?GL_ONE_MINUS_SRC_ALPHA', and A s is equal to k A, the equations
+%% reduce to simple replacement:
+%%
+%% R d= R s G d= G s B d= B s A d= A s
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlendFunc.xml">external</a> documentation.
+-spec blendFunc(Sfactor, Dfactor) -> ok when Sfactor :: enum(),Dfactor :: enum().
blendFunc(Sfactor,Dfactor) ->
- cast(5045, <<Sfactor:?GLenum,Dfactor:?GLenum>>).
+ cast(5043, <<Sfactor:?GLenum,Dfactor:?GLenum>>).
-%% @spec (List::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCallList.xml">external</a> documentation.
--spec callList(integer()) -> ok.
-callList(List) ->
- cast(5046, <<List:?GLuint>>).
-
-%% @spec (Lists::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCallLists.xml">external</a> documentation.
--spec callLists([integer()]) -> ok.
-callLists(Lists) ->
- cast(5047, <<(length(Lists)):?GLuint,
- (<< <<C:?GLuint>> || C <- Lists>>)/binary,0:(((1+length(Lists)) rem 2)*32)>>).
+%% @doc Specify a logical pixel operation for rendering
+%%
+%% ``gl:logicOp'' specifies a logical operation that, when enabled, is applied between
+%% the incoming RGBA color and the RGBA color at the corresponding location in the frame
+%% buffer. To enable or disable the logical operation, call {@link gl:enable/1} and {@link gl:enable/1}
+%% using the symbolic constant `?GL_COLOR_LOGIC_OP'. The initial value is disabled.
+%%
+%% <table><tbody><tr><td>` Opcode '</td><td>` Resulting Operation '</td></tr></tbody>
+%% <tbody><tr><td>`?GL_CLEAR'</td><td> 0 </td></tr><tr><td>`?GL_SET'</td><td> 1 </td>
+%% </tr><tr><td>`?GL_COPY'</td><td> s </td></tr><tr><td>`?GL_COPY_INVERTED'</td><td>
+%% ~s </td></tr><tr><td>`?GL_NOOP'</td><td> d </td></tr><tr><td>`?GL_INVERT'</td><td>
+%% ~d </td></tr><tr><td>`?GL_AND'</td><td> s &amp; d </td></tr><tr><td>`?GL_NAND'</td>
+%% <td> ~(s &amp; d) </td></tr><tr><td>`?GL_OR'</td><td> s | d </td></tr><tr><td>`?GL_NOR'
+%% </td><td> ~(s | d) </td></tr><tr><td>`?GL_XOR'</td><td> s ^ d </td></tr><tr><td>`?GL_EQUIV'
+%% </td><td> ~(s ^ d) </td></tr><tr><td>`?GL_AND_REVERSE'</td><td> s &amp; ~d </td></tr>
+%% <tr><td>`?GL_AND_INVERTED'</td><td> ~s &amp; d </td></tr><tr><td>`?GL_OR_REVERSE'
+%% </td><td> s | ~d </td></tr><tr><td>`?GL_OR_INVERTED'</td><td> ~s | d </td></tr></tbody>
+%% </table>
+%%
+%% `Opcode' is a symbolic constant chosen from the list above. In the explanation of
+%% the logical operations, `s' represents the incoming color and `d' represents
+%% the color in the frame buffer. Standard C-language operators are used. As these bitwise
+%% operators suggest, the logical operation is applied independently to each bit pair of
+%% the source and destination colors.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLogicOp.xml">external</a> documentation.
+-spec logicOp(Opcode) -> ok when Opcode :: enum().
+logicOp(Opcode) ->
+ cast(5044, <<Opcode:?GLenum>>).
-%% @spec (Mask::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClear.xml">external</a> documentation.
--spec clear(integer()) -> ok.
-clear(Mask) ->
- cast(5048, <<Mask:?GLbitfield>>).
+%% @doc Specify whether front- or back-facing facets can be culled
+%%
+%% ``gl:cullFace'' specifies whether front- or back-facing facets are culled (as specified
+%% by `mode') when facet culling is enabled. Facet culling is initially disabled. To
+%% enable and disable facet culling, call the {@link gl:enable/1} and {@link gl:enable/1}
+%% commands with the argument `?GL_CULL_FACE'. Facets include triangles, quadrilaterals,
+%% polygons, and rectangles.
+%%
+%% {@link gl:frontFace/1} specifies which of the clockwise and counterclockwise facets are
+%% front-facing and back-facing. See {@link gl:frontFace/1} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCullFace.xml">external</a> documentation.
+-spec cullFace(Mode) -> ok when Mode :: enum().
+cullFace(Mode) ->
+ cast(5045, <<Mode:?GLenum>>).
-%% @spec (Red::float(),Green::float(),Blue::float(),Alpha::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearAccum.xml">external</a> documentation.
--spec clearAccum(float(),float(),float(),float()) -> ok.
-clearAccum(Red,Green,Blue,Alpha) ->
- cast(5049, <<Red:?GLfloat,Green:?GLfloat,Blue:?GLfloat,Alpha:?GLfloat>>).
+%% @doc Define front- and back-facing polygons
+%%
+%% In a scene composed entirely of opaque closed surfaces, back-facing polygons are never
+%% visible. Eliminating these invisible polygons has the obvious benefit of speeding up the
+%% rendering of the image. To enable and disable elimination of back-facing polygons, call {@link gl:enable/1}
+%% and {@link gl:enable/1} with argument `?GL_CULL_FACE'.
+%%
+%% The projection of a polygon to window coordinates is said to have clockwise winding if
+%% an imaginary object following the path from its first vertex, its second vertex, and so
+%% on, to its last vertex, and finally back to its first vertex, moves in a clockwise direction
+%% about the interior of the polygon. The polygon's winding is said to be counterclockwise
+%% if the imaginary object following the same path moves in a counterclockwise direction
+%% about the interior of the polygon. ``gl:frontFace'' specifies whether polygons with
+%% clockwise winding in window coordinates, or counterclockwise winding in window coordinates,
+%% are taken to be front-facing. Passing `?GL_CCW' to `Mode' selects counterclockwise
+%% polygons as front-facing; `?GL_CW' selects clockwise polygons as front-facing. By
+%% default, counterclockwise polygons are taken to be front-facing.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFrontFace.xml">external</a> documentation.
+-spec frontFace(Mode) -> ok when Mode :: enum().
+frontFace(Mode) ->
+ cast(5046, <<Mode:?GLenum>>).
-%% @spec (Red::clamp(),Green::clamp(),Blue::clamp(),Alpha::clamp()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearColor.xml">external</a> documentation.
--spec clearColor(clamp(),clamp(),clamp(),clamp()) -> ok.
-clearColor(Red,Green,Blue,Alpha) ->
- cast(5050, <<Red:?GLclampf,Green:?GLclampf,Blue:?GLclampf,Alpha:?GLclampf>>).
+%% @doc Specify the diameter of rasterized points
+%%
+%% ``gl:pointSize'' specifies the rasterized diameter of points. If point size mode is
+%% disabled (see {@link gl:enable/1} with parameter `?GL_PROGRAM_POINT_SIZE'), this value
+%% will be used to rasterize points. Otherwise, the value written to the shading language
+%% built-in variable gl_PointSize will be used.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPointSize.xml">external</a> documentation.
+-spec pointSize(Size) -> ok when Size :: float().
+pointSize(Size) ->
+ cast(5047, <<Size:?GLfloat>>).
-%% @spec (Depth::clamp()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearDepth.xml">external</a> documentation.
--spec clearDepth(clamp()) -> ok.
-clearDepth(Depth) ->
- cast(5051, <<Depth:?GLclampd>>).
+%% @doc Specify the width of rasterized lines
+%%
+%% ``gl:lineWidth'' specifies the rasterized width of both aliased and antialiased lines.
+%% Using a line width other than 1 has different effects, depending on whether line antialiasing
+%% is enabled. To enable and disable line antialiasing, call {@link gl:enable/1} and {@link gl:enable/1}
+%% with argument `?GL_LINE_SMOOTH'. Line antialiasing is initially disabled.
+%%
+%% If line antialiasing is disabled, the actual width is determined by rounding the supplied
+%% width to the nearest integer. (If the rounding results in the value 0, it is as if the
+%% line width were 1.) If |&amp;Delta; x|&gt;=|&amp;Delta; y|, `i' pixels are filled in each column that is rasterized,
+%% where `i' is the rounded value of `Width' . Otherwise, `i' pixels are filled
+%% in each row that is rasterized.
+%%
+%% If antialiasing is enabled, line rasterization produces a fragment for each pixel square
+%% that intersects the region lying within the rectangle having width equal to the current
+%% line width, length equal to the actual length of the line, and centered on the mathematical
+%% line segment. The coverage value for each fragment is the window coordinate area of the
+%% intersection of the rectangular region with the corresponding pixel square. This value
+%% is saved and used in the final rasterization step.
+%%
+%% Not all widths can be supported when line antialiasing is enabled. If an unsupported
+%% width is requested, the nearest supported width is used. Only width 1 is guaranteed to
+%% be supported; others depend on the implementation. Likewise, there is a range for aliased
+%% line widths as well. To query the range of supported widths and the size difference between
+%% supported widths within the range, call {@link gl:getBooleanv/1} with arguments `?GL_ALIASED_LINE_WIDTH_RANGE'
+%% , `?GL_SMOOTH_LINE_WIDTH_RANGE', and `?GL_SMOOTH_LINE_WIDTH_GRANULARITY'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLineWidth.xml">external</a> documentation.
+-spec lineWidth(Width) -> ok when Width :: float().
+lineWidth(Width) ->
+ cast(5048, <<Width:?GLfloat>>).
-%% @spec (C::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearIndex.xml">external</a> documentation.
--spec clearIndex(float()) -> ok.
-clearIndex(C) ->
- cast(5052, <<C:?GLfloat>>).
+%% @doc Specify the line stipple pattern
+%%
+%% Line stippling masks out certain fragments produced by rasterization; those fragments
+%% will not be drawn. The masking is achieved by using three parameters: the 16-bit line
+%% stipple pattern `Pattern' , the repeat count `Factor' , and an integer stipple
+%% counter s.
+%%
+%% Counter s is reset to 0 whenever {@link gl:'begin'/1} is called and before each line segment
+%% of a {@link gl:'begin'/1} (`?GL_LINES')/ {@link gl:'begin'/1} sequence is generated. It is
+%% incremented after each fragment of a unit width aliased line segment is generated or after
+%% each i fragments of an i width line segment are generated. The i fragments associated
+%% with count s are masked out if
+%%
+%% `Pattern' bit (s/factor)% 16
+%%
+%% is 0, otherwise these fragments are sent to the frame buffer. Bit zero of `Pattern'
+%% is the least significant bit.
+%%
+%% Antialiased lines are treated as a sequence of 1*width rectangles for purposes of stippling.
+%% Whether rectangle s is rasterized or not depends on the fragment rule described for
+%% aliased lines, counting rectangles rather than groups of fragments.
+%%
+%% To enable and disable line stippling, call {@link gl:enable/1} and {@link gl:enable/1}
+%% with argument `?GL_LINE_STIPPLE'. When enabled, the line stipple pattern is applied
+%% as described above. When disabled, it is as if the pattern were all 1's. Initially, line
+%% stippling is disabled.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLineStipple.xml">external</a> documentation.
+-spec lineStipple(Factor, Pattern) -> ok when Factor :: integer(),Pattern :: integer().
+lineStipple(Factor,Pattern) ->
+ cast(5049, <<Factor:?GLint,Pattern:?GLushort>>).
-%% @spec (S::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearStencil.xml">external</a> documentation.
--spec clearStencil(integer()) -> ok.
-clearStencil(S) ->
- cast(5053, <<S:?GLint>>).
+%% @doc Select a polygon rasterization mode
+%%
+%% ``gl:polygonMode'' controls the interpretation of polygons for rasterization. `Face'
+%% describes which polygons `Mode' applies to: both front and back-facing polygons (`?GL_FRONT_AND_BACK'
+%% ). The polygon mode affects only the final rasterization of polygons. In particular, a
+%% polygon's vertices are lit and the polygon is clipped and possibly culled before these
+%% modes are applied.
+%%
+%% Three modes are defined and can be specified in `Mode' :
+%%
+%% `?GL_POINT': Polygon vertices that are marked as the start of a boundary edge are
+%% drawn as points. Point attributes such as `?GL_POINT_SIZE' and `?GL_POINT_SMOOTH'
+%% control the rasterization of the points. Polygon rasterization attributes other than `?GL_POLYGON_MODE'
+%% have no effect.
+%%
+%% `?GL_LINE': Boundary edges of the polygon are drawn as line segments. Line attributes
+%% such as `?GL_LINE_WIDTH' and `?GL_LINE_SMOOTH' control the rasterization of
+%% the lines. Polygon rasterization attributes other than `?GL_POLYGON_MODE' have no
+%% effect.
+%%
+%% `?GL_FILL': The interior of the polygon is filled. Polygon attributes such as `?GL_POLYGON_SMOOTH'
+%% control the rasterization of the polygon.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPolygonMode.xml">external</a> documentation.
+-spec polygonMode(Face, Mode) -> ok when Face :: enum(),Mode :: enum().
+polygonMode(Face,Mode) ->
+ cast(5050, <<Face:?GLenum,Mode:?GLenum>>).
-%% @spec (Plane::enum(),Equation::{float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClipPlane.xml">external</a> documentation.
--spec clipPlane(enum(),{float(),float(),float(),float()}) -> ok.
-clipPlane(Plane,{E1,E2,E3,E4}) ->
- cast(5054, <<Plane:?GLenum,0:32,E1:?GLdouble,E2:?GLdouble,E3:?GLdouble,E4:?GLdouble>>).
+%% @doc Set the scale and units used to calculate depth values
+%%
+%% When `?GL_POLYGON_OFFSET_FILL', `?GL_POLYGON_OFFSET_LINE', or `?GL_POLYGON_OFFSET_POINT'
+%% is enabled, each fragment's `depth' value will be offset after it is interpolated
+%% from the `depth' values of the appropriate vertices. The value of the offset is
+%% factor*DZ+r*units, where DZ is a measurement of the change in depth relative to the
+%% screen area of the polygon, and r is the smallest value that is guaranteed to produce
+%% a resolvable offset for a given implementation. The offset is added before the depth test
+%% is performed and before the value is written into the depth buffer.
+%%
+%% ``gl:polygonOffset'' is useful for rendering hidden-line images, for applying decals
+%% to surfaces, and for rendering solids with highlighted edges.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPolygonOffset.xml">external</a> documentation.
+-spec polygonOffset(Factor, Units) -> ok when Factor :: float(),Units :: float().
+polygonOffset(Factor,Units) ->
+ cast(5051, <<Factor:?GLfloat,Units:?GLfloat>>).
-%% @spec (Red::integer(),Green::integer(),Blue::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color3b(integer(),integer(),integer()) -> ok.
-color3b(Red,Green,Blue) ->
- cast(5055, <<Red:?GLbyte,Green:?GLbyte,Blue:?GLbyte>>).
+%% @doc Set the polygon stippling pattern
+%%
+%% Polygon stippling, like line stippling (see {@link gl:lineStipple/2} ), masks out certain
+%% fragments produced by rasterization, creating a pattern. Stippling is independent of polygon
+%% antialiasing.
+%%
+%% `Pattern' is a pointer to a 32*32 stipple pattern that is stored in memory just
+%% like the pixel data supplied to a {@link gl:drawPixels/5} call with height and `width'
+%% both equal to 32, a pixel format of `?GL_COLOR_INDEX', and data type of `?GL_BITMAP'
+%% . That is, the stipple pattern is represented as a 32*32 array of 1-bit color indices
+%% packed in unsigned bytes. {@link gl:pixelStoref/2} parameters like `?GL_UNPACK_SWAP_BYTES'
+%% and `?GL_UNPACK_LSB_FIRST' affect the assembling of the bits into a stipple pattern.
+%% Pixel transfer operations (shift, offset, pixel map) are not applied to the stipple image,
+%% however.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a stipple pattern is specified, `Pattern' is
+%% treated as a byte offset into the buffer object's data store.
+%%
+%% To enable and disable polygon stippling, call {@link gl:enable/1} and {@link gl:enable/1}
+%% with argument `?GL_POLYGON_STIPPLE'. Polygon stippling is initially disabled. If
+%% it's enabled, a rasterized polygon fragment with window coordinates x w and y w is
+%% sent to the next stage of the GL if and only if the ( x w% 32)th bit in the ( y w% 32)th
+%% row of the stipple pattern is 1 (one). When polygon stippling is disabled, it is as if
+%% the stipple pattern consists of all 1's.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPolygonStipple.xml">external</a> documentation.
+-spec polygonStipple(Mask) -> ok when Mask :: binary().
+polygonStipple(Mask) ->
+ send_bin(Mask),
+ cast(5052, <<>>).
-%% @spec ({Red,Green,Blue}) -> ok
-%% @equiv color3b(Red,Green,Blue)
--spec color3bv({integer(),integer(),integer()}) -> ok.
-color3bv({Red,Green,Blue}) -> color3b(Red,Green,Blue).
+%% @doc Return the polygon stipple pattern
+%%
+%% ``gl:getPolygonStipple'' returns to `Pattern' a 32*32 polygon stipple pattern.
+%% The pattern is packed into memory as if {@link gl:readPixels/7} with both `height'
+%% and `width' of 32, `type' of `?GL_BITMAP', and `format' of `?GL_COLOR_INDEX'
+%% were called, and the stipple pattern were stored in an internal 32*32 color index buffer.
+%% Unlike {@link gl:readPixels/7} , however, pixel transfer operations (shift, offset, pixel
+%% map) are not applied to the returned stipple image.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_PACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a polygon stipple pattern is requested, `Pattern'
+%% is treated as a byte offset into the buffer object's data store.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetPolygonStipple.xml">external</a> documentation.
+-spec getPolygonStipple() -> binary().
+getPolygonStipple() ->
+ call(5053, <<>>).
-%% @spec (Red::float(),Green::float(),Blue::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color3d(float(),float(),float()) -> ok.
-color3d(Red,Green,Blue) ->
- cast(5056, <<Red:?GLdouble,Green:?GLdouble,Blue:?GLdouble>>).
+%% @doc Flag edges as either boundary or nonboundary
+%%
+%% Each vertex of a polygon, separate triangle, or separate quadrilateral specified between
+%% a {@link gl:'begin'/1} / {@link gl:'begin'/1} pair is marked as the start of either a boundary or
+%% nonboundary edge. If the current edge flag is true when the vertex is specified, the vertex
+%% is marked as the start of a boundary edge. Otherwise, the vertex is marked as the start
+%% of a nonboundary edge. ``gl:edgeFlag'' sets the edge flag bit to `?GL_TRUE' if `Flag'
+%% is `?GL_TRUE' and to `?GL_FALSE' otherwise.
+%%
+%% The vertices of connected triangles and connected quadrilaterals are always marked as
+%% boundary, regardless of the value of the edge flag.
+%%
+%% Boundary and nonboundary edge flags on vertices are significant only if `?GL_POLYGON_MODE'
+%% is set to `?GL_POINT' or `?GL_LINE'. See {@link gl:polygonMode/2} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEdgeFlag.xml">external</a> documentation.
+-spec edgeFlag(Flag) -> ok when Flag :: 0|1.
+edgeFlag(Flag) ->
+ cast(5054, <<Flag:?GLboolean>>).
-%% @spec ({Red,Green,Blue}) -> ok
-%% @equiv color3d(Red,Green,Blue)
--spec color3dv({float(),float(),float()}) -> ok.
-color3dv({Red,Green,Blue}) -> color3d(Red,Green,Blue).
+%% @equiv edgeFlag(Flag)
+-spec edgeFlagv(Flag) -> ok when Flag :: {Flag :: 0|1}.
+edgeFlagv({Flag}) -> edgeFlag(Flag).
-%% @spec (Red::float(),Green::float(),Blue::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color3f(float(),float(),float()) -> ok.
-color3f(Red,Green,Blue) ->
- cast(5057, <<Red:?GLfloat,Green:?GLfloat,Blue:?GLfloat>>).
+%% @doc Define the scissor box
+%%
+%% ``gl:scissor'' defines a rectangle, called the scissor box, in window coordinates. The
+%% first two arguments, `X' and `Y' , specify the lower left corner of the box. `Width'
+%% and `Height' specify the width and height of the box.
+%%
+%% To enable and disable the scissor test, call {@link gl:enable/1} and {@link gl:enable/1}
+%% with argument `?GL_SCISSOR_TEST'. The test is initially disabled. While the test
+%% is enabled, only pixels that lie within the scissor box can be modified by drawing commands.
+%% Window coordinates have integer values at the shared corners of frame buffer pixels. glScissor(0,0,1,1)
+%% allows modification of only the lower left pixel in the window, and glScissor(0,0,0,0)
+%% doesn't allow modification of any pixels in the window.
+%%
+%% When the scissor test is disabled, it is as though the scissor box includes the entire
+%% window.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glScissor.xml">external</a> documentation.
+-spec scissor(X, Y, Width, Height) -> ok when X :: integer(),Y :: integer(),Width :: integer(),Height :: integer().
+scissor(X,Y,Width,Height) ->
+ cast(5055, <<X:?GLint,Y:?GLint,Width:?GLsizei,Height:?GLsizei>>).
-%% @spec ({Red,Green,Blue}) -> ok
-%% @equiv color3f(Red,Green,Blue)
--spec color3fv({float(),float(),float()}) -> ok.
-color3fv({Red,Green,Blue}) -> color3f(Red,Green,Blue).
+%% @doc Specify a plane against which all geometry is clipped
+%%
+%% Geometry is always clipped against the boundaries of a six-plane frustum in `x', `y'
+%% , and `z'. ``gl:clipPlane'' allows the specification of additional planes, not
+%% necessarily perpendicular to the `x', `y', or `z' axis, against which all
+%% geometry is clipped. To determine the maximum number of additional clipping planes, call {@link gl:getBooleanv/1}
+%% with argument `?GL_MAX_CLIP_PLANES'. All implementations support at least six such
+%% clipping planes. Because the resulting clipping region is the intersection of the defined
+%% half-spaces, it is always convex.
+%%
+%% ``gl:clipPlane'' specifies a half-space using a four-component plane equation. When ``gl:clipPlane''
+%% is called, `Equation' is transformed by the inverse of the modelview matrix and
+%% stored in the resulting eye coordinates. Subsequent changes to the modelview matrix have
+%% no effect on the stored plane-equation components. If the dot product of the eye coordinates
+%% of a vertex with the stored plane equation components is positive or zero, the vertex is `in'
+%% with respect to that clipping plane. Otherwise, it is `out'.
+%%
+%% To enable and disable clipping planes, call {@link gl:enable/1} and {@link gl:enable/1}
+%% with the argument `?GL_CLIP_PLANE'`i', where `i' is the plane number.
+%%
+%% All clipping planes are initially defined as (0, 0, 0, 0) in eye coordinates and are
+%% disabled.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClipPlane.xml">external</a> documentation.
+-spec clipPlane(Plane, Equation) -> ok when Plane :: enum(),Equation :: {float(),float(),float(),float()}.
+clipPlane(Plane,{E1,E2,E3,E4}) ->
+ cast(5056, <<Plane:?GLenum,0:32,E1:?GLdouble,E2:?GLdouble,E3:?GLdouble,E4:?GLdouble>>).
-%% @spec (Red::integer(),Green::integer(),Blue::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color3i(integer(),integer(),integer()) -> ok.
-color3i(Red,Green,Blue) ->
- cast(5058, <<Red:?GLint,Green:?GLint,Blue:?GLint>>).
+%% @doc Return the coefficients of the specified clipping plane
+%%
+%% ``gl:getClipPlane'' returns in `Equation' the four coefficients of the plane equation
+%% for `Plane' .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetClipPlane.xml">external</a> documentation.
+-spec getClipPlane(Plane) -> {float(),float(),float(),float()} when Plane :: enum().
+getClipPlane(Plane) ->
+ call(5057, <<Plane:?GLenum>>).
-%% @spec ({Red,Green,Blue}) -> ok
-%% @equiv color3i(Red,Green,Blue)
--spec color3iv({integer(),integer(),integer()}) -> ok.
-color3iv({Red,Green,Blue}) -> color3i(Red,Green,Blue).
+%% @doc Specify which color buffers are to be drawn into
+%%
+%% When colors are written to the frame buffer, they are written into the color buffers
+%% specified by ``gl:drawBuffer''. The specifications are as follows:
+%%
+%% `?GL_NONE': No color buffers are written.
+%%
+%% `?GL_FRONT_LEFT': Only the front left color buffer is written.
+%%
+%% `?GL_FRONT_RIGHT': Only the front right color buffer is written.
+%%
+%% `?GL_BACK_LEFT': Only the back left color buffer is written.
+%%
+%% `?GL_BACK_RIGHT': Only the back right color buffer is written.
+%%
+%% `?GL_FRONT': Only the front left and front right color buffers are written. If there
+%% is no front right color buffer, only the front left color buffer is written.
+%%
+%% `?GL_BACK': Only the back left and back right color buffers are written. If there
+%% is no back right color buffer, only the back left color buffer is written.
+%%
+%% `?GL_LEFT': Only the front left and back left color buffers are written. If there
+%% is no back left color buffer, only the front left color buffer is written.
+%%
+%% `?GL_RIGHT': Only the front right and back right color buffers are written. If there
+%% is no back right color buffer, only the front right color buffer is written.
+%%
+%% `?GL_FRONT_AND_BACK': All the front and back color buffers (front left, front right,
+%% back left, back right) are written. If there are no back color buffers, only the front
+%% left and front right color buffers are written. If there are no right color buffers, only
+%% the front left and back left color buffers are written. If there are no right or back
+%% color buffers, only the front left color buffer is written.
+%%
+%% If more than one color buffer is selected for drawing, then blending or logical operations
+%% are computed and applied independently for each color buffer and can produce different
+%% results in each buffer.
+%%
+%% Monoscopic contexts include only `left' buffers, and stereoscopic contexts include
+%% both `left' and `right' buffers. Likewise, single-buffered contexts include
+%% only `front' buffers, and double-buffered contexts include both `front' and `back'
+%% buffers. The context is selected at GL initialization.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawBuffer.xml">external</a> documentation.
+-spec drawBuffer(Mode) -> ok when Mode :: enum().
+drawBuffer(Mode) ->
+ cast(5058, <<Mode:?GLenum>>).
-%% @spec (Red::integer(),Green::integer(),Blue::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color3s(integer(),integer(),integer()) -> ok.
-color3s(Red,Green,Blue) ->
- cast(5059, <<Red:?GLshort,Green:?GLshort,Blue:?GLshort>>).
+%% @doc Select a color buffer source for pixels
+%%
+%% ``gl:readBuffer'' specifies a color buffer as the source for subsequent {@link gl:readPixels/7}
+%% , {@link gl:copyTexImage1D/7} , {@link gl:copyTexImage2D/8} , {@link gl:copyTexSubImage1D/6} , {@link gl:copyTexSubImage2D/8}
+%% , and {@link gl:copyTexSubImage3D/9} commands. `Mode' accepts one of twelve or more
+%% predefined values. In a fully configured system, `?GL_FRONT', `?GL_LEFT', and `?GL_FRONT_LEFT'
+%% all name the front left buffer, `?GL_FRONT_RIGHT' and `?GL_RIGHT' name the
+%% front right buffer, and `?GL_BACK_LEFT' and `?GL_BACK' name the back left buffer.
+%% Further more, the constants `?GL_COLOR_ATTACHMENT'`i' may be used to indicate
+%% the `i'th color attachment where `i' ranges from zero to the value of `?GL_MAX_COLOR_ATTACHMENTS'
+%% minus one.
+%%
+%% Nonstereo double-buffered configurations have only a front left and a back left buffer.
+%% Single-buffered configurations have a front left and a front right buffer if stereo, and
+%% only a front left buffer if nonstereo. It is an error to specify a nonexistent buffer to ``gl:readBuffer''
+%% .
+%%
+%% `Mode' is initially `?GL_FRONT' in single-buffered configurations and `?GL_BACK'
+%% in double-buffered configurations.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glReadBuffer.xml">external</a> documentation.
+-spec readBuffer(Mode) -> ok when Mode :: enum().
+readBuffer(Mode) ->
+ cast(5059, <<Mode:?GLenum>>).
-%% @spec ({Red,Green,Blue}) -> ok
-%% @equiv color3s(Red,Green,Blue)
--spec color3sv({integer(),integer(),integer()}) -> ok.
-color3sv({Red,Green,Blue}) -> color3s(Red,Green,Blue).
+%% @doc Enable or disable server-side GL capabilities
+%%
+%% ``gl:enable'' and {@link gl:enable/1} enable and disable various capabilities. Use {@link gl:isEnabled/1}
+%% or {@link gl:getBooleanv/1} to determine the current setting of any capability. The initial value
+%% for each capability with the exception of `?GL_DITHER' and `?GL_MULTISAMPLE'
+%% is `?GL_FALSE'. The initial value for `?GL_DITHER' and `?GL_MULTISAMPLE'
+%% is `?GL_TRUE'.
+%%
+%% Both ``gl:enable'' and {@link gl:enable/1} take a single argument, `Cap' , which
+%% can assume one of the following values:
+%%
+%% Some of the GL's capabilities are indexed. ``gl:enablei'' and ``gl:disablei'' enable
+%% and disable indexed capabilities.
+%%
+%% `?GL_BLEND': If enabled, blend the computed fragment color values with the values
+%% in the color buffers. See {@link gl:blendFunc/2} .
+%%
+%% `?GL_CLIP_DISTANCE'`i': If enabled, clip geometry against user-defined half
+%% space `i'.
+%%
+%% `?GL_COLOR_LOGIC_OP': If enabled, apply the currently selected logical operation
+%% to the computed fragment color and color buffer values. See {@link gl:logicOp/1} .
+%%
+%% `?GL_CULL_FACE': If enabled, cull polygons based on their winding in window coordinates.
+%% See {@link gl:cullFace/1} .
+%%
+%% `?GL_DEPTH_CLAMP': If enabled, the -w c&amp;le; z c&amp;le; w c plane equation is
+%% ignored by view volume clipping (effectively, there is no near or far plane clipping).
+%% See {@link gl:depthRange/2} .
+%%
+%% `?GL_DEPTH_TEST': If enabled, do depth comparisons and update the depth buffer.
+%% Note that even if the depth buffer exists and the depth mask is non-zero, the depth buffer
+%% is not updated if the depth test is disabled. See {@link gl:depthFunc/1} and {@link gl:depthRange/2}
+%% .
+%%
+%% `?GL_DITHER': If enabled, dither color components or indices before they are written
+%% to the color buffer.
+%%
+%% `?GL_FRAMEBUFFER_SRGB': If enabled and the value of `?GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING'
+%% for the framebuffer attachment corresponding to the destination buffer is `?GL_SRGB',
+%% the R, G, and B destination color values (after conversion from fixed-point to floating-point)
+%% are considered to be encoded for the sRGB color space and hence are linearized prior to
+%% their use in blending.
+%%
+%% `?GL_LINE_SMOOTH': If enabled, draw lines with correct filtering. Otherwise, draw
+%% aliased lines. See {@link gl:lineWidth/1} .
+%%
+%% `?GL_MULTISAMPLE': If enabled, use multiple fragment samples in computing the final
+%% color of a pixel. See {@link gl:sampleCoverage/2} .
+%%
+%% `?GL_POLYGON_OFFSET_FILL': If enabled, and if the polygon is rendered in `?GL_FILL'
+%% mode, an offset is added to depth values of a polygon's fragments before the depth comparison
+%% is performed. See {@link gl:polygonOffset/2} .
+%%
+%% `?GL_POLYGON_OFFSET_LINE': If enabled, and if the polygon is rendered in `?GL_LINE'
+%% mode, an offset is added to depth values of a polygon's fragments before the depth comparison
+%% is performed. See {@link gl:polygonOffset/2} .
+%%
+%% `?GL_POLYGON_OFFSET_POINT': If enabled, an offset is added to depth values of a
+%% polygon's fragments before the depth comparison is performed, if the polygon is rendered
+%% in `?GL_POINT' mode. See {@link gl:polygonOffset/2} .
+%%
+%% `?GL_POLYGON_SMOOTH': If enabled, draw polygons with proper filtering. Otherwise,
+%% draw aliased polygons. For correct antialiased polygons, an alpha buffer is needed and
+%% the polygons must be sorted front to back.
+%%
+%% `?GL_PRIMITIVE_RESTART': Enables primitive restarting. If enabled, any one of the
+%% draw commands which transfers a set of generic attribute array elements to the GL will
+%% restart the primitive when the index of the vertex is equal to the primitive restart
+%% index. See {@link gl:primitiveRestartIndex/1} .
+%%
+%% `?GL_SAMPLE_ALPHA_TO_COVERAGE': If enabled, compute a temporary coverage value where
+%% each bit is determined by the alpha value at the corresponding sample location. The temporary
+%% coverage value is then ANDed with the fragment coverage value.
+%%
+%% `?GL_SAMPLE_ALPHA_TO_ONE': If enabled, each sample alpha value is replaced by the
+%% maximum representable alpha value.
+%%
+%% `?GL_SAMPLE_COVERAGE': If enabled, the fragment's coverage is ANDed with the temporary
+%% coverage value. If `?GL_SAMPLE_COVERAGE_INVERT' is set to `?GL_TRUE', invert
+%% the coverage value. See {@link gl:sampleCoverage/2} .
+%%
+%% `?GL_SAMPLE_SHADING': If enabled, the active fragment shader is run once for each
+%% covered sample, or at fraction of this rate as determined by the current value of `?GL_MIN_SAMPLE_SHADING_VALUE'
+%% . See {@link gl:minSampleShading/1} .
+%%
+%% `?GL_SAMPLE_MASK': If enabled, the sample coverage mask generated for a fragment
+%% during rasterization will be ANDed with the value of `?GL_SAMPLE_MASK_VALUE' before
+%% shading occurs. See {@link gl:sampleMaski/2} .
+%%
+%% `?GL_SCISSOR_TEST': If enabled, discard fragments that are outside the scissor rectangle.
+%% See {@link gl:scissor/4} .
+%%
+%% `?GL_STENCIL_TEST': If enabled, do stencil testing and update the stencil buffer.
+%% See {@link gl:stencilFunc/3} and {@link gl:stencilOp/3} .
+%%
+%% `?GL_TEXTURE_CUBE_MAP_SEAMLESS': If enabled, cubemap textures are sampled such that
+%% when linearly sampling from the border between two adjacent faces, texels from both faces
+%% are used to generate the final sample value. When disabled, texels from only a single
+%% face are used to construct the final sample value.
+%%
+%% `?GL_PROGRAM_POINT_SIZE': If enabled and a vertex or geometry shader is active,
+%% then the derived point size is taken from the (potentially clipped) shader builtin `?gl_PointSize'
+%% and clamped to the implementation-dependent point size range.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEnable.xml">external</a> documentation.
+-spec enable(Cap) -> ok when Cap :: enum().
+enable(Cap) ->
+ cast(5060, <<Cap:?GLenum>>).
-%% @spec (Red::integer(),Green::integer(),Blue::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color3ub(integer(),integer(),integer()) -> ok.
-color3ub(Red,Green,Blue) ->
- cast(5060, <<Red:?GLubyte,Green:?GLubyte,Blue:?GLubyte>>).
+%% @doc
+%% See {@link enable/1}
+-spec disable(Cap) -> ok when Cap :: enum().
+disable(Cap) ->
+ cast(5061, <<Cap:?GLenum>>).
-%% @spec ({Red,Green,Blue}) -> ok
-%% @equiv color3ub(Red,Green,Blue)
--spec color3ubv({integer(),integer(),integer()}) -> ok.
-color3ubv({Red,Green,Blue}) -> color3ub(Red,Green,Blue).
+%% @doc Test whether a capability is enabled
+%%
+%% ``gl:isEnabled'' returns `?GL_TRUE' if `Cap' is an enabled capability and
+%% returns `?GL_FALSE' otherwise. Boolean states that are indexed may be tested with ``gl:isEnabledi''
+%% . For ``gl:isEnabledi'', `Index' specifies the index of the capability to test. `Index'
+%% must be between zero and the count of indexed capabilities for `Cap' . Initially
+%% all capabilities except `?GL_DITHER' are disabled; `?GL_DITHER' is initially
+%% enabled.
+%%
+%% The following capabilities are accepted for `Cap' : <table><tbody><tr><td>` Constant '
+%% </td><td>` See '</td></tr></tbody><tbody><tr><td>`?GL_BLEND'</td><td> {@link gl:blendFunc/2}
+%% , {@link gl:logicOp/1} </td></tr><tr><td>`?GL_CLIP_DISTANCE'`i'</td><td> {@link gl:enable/1}
+%% </td></tr><tr><td>`?GL_COLOR_LOGIC_OP'</td><td> {@link gl:logicOp/1} </td></tr><tr><td>`?GL_CULL_FACE'
+%% </td><td> {@link gl:cullFace/1} </td></tr><tr><td>`?GL_DEPTH_CLAMP'</td><td> {@link gl:enable/1}
+%% </td></tr><tr><td>`?GL_DEPTH_TEST'</td><td> {@link gl:depthFunc/1} , {@link gl:depthRange/2}
+%% </td></tr><tr><td>`?GL_DITHER'</td><td> {@link gl:enable/1} </td></tr><tr><td>`?GL_FRAMEBUFFER_SRGB'
+%% </td><td> {@link gl:enable/1} </td></tr><tr><td>`?GL_LINE_SMOOTH'</td><td> {@link gl:lineWidth/1}
+%% </td></tr><tr><td>`?GL_MULTISAMPLE'</td><td> {@link gl:sampleCoverage/2} </td></tr><tr><td>
+%% `?GL_POLYGON_SMOOTH'</td><td> {@link gl:polygonMode/2} </td></tr><tr><td>`?GL_POLYGON_OFFSET_FILL'
+%% </td><td> {@link gl:polygonOffset/2} </td></tr><tr><td>`?GL_POLYGON_OFFSET_LINE'</td><td>
+%% {@link gl:polygonOffset/2} </td></tr><tr><td>`?GL_POLYGON_OFFSET_POINT'</td><td> {@link gl:polygonOffset/2}
+%% </td></tr><tr><td>`?GL_PROGRAM_POINT_SIZE'</td><td> {@link gl:enable/1} </td></tr><tr><td>
+%% `?GL_PRIMITIVE_RESTART'</td><td> {@link gl:enable/1} , {@link gl:primitiveRestartIndex/1} </td>
+%% </tr><tr><td>`?GL_SAMPLE_ALPHA_TO_COVERAGE'</td><td> {@link gl:sampleCoverage/2} </td></tr>
+%% <tr><td>`?GL_SAMPLE_ALPHA_TO_ONE'</td><td> {@link gl:sampleCoverage/2} </td></tr><tr><td>
+%% `?GL_SAMPLE_COVERAGE'</td><td> {@link gl:sampleCoverage/2} </td></tr><tr><td>`?GL_SAMPLE_MASK'
+%% </td><td> {@link gl:enable/1} </td></tr><tr><td>`?GL_SCISSOR_TEST'</td><td> {@link gl:scissor/4}
+%% </td></tr><tr><td>`?GL_STENCIL_TEST'</td><td> {@link gl:stencilFunc/3} , {@link gl:stencilOp/3}
+%% </td></tr><tr><td>`?GL_TEXTURE_CUBEMAP_SEAMLESS'</td><td> {@link gl:enable/1} </td></tr>
+%% </tbody></table>
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsEnabled.xml">external</a> documentation.
+-spec isEnabled(Cap) -> 0|1 when Cap :: enum().
+isEnabled(Cap) ->
+ call(5062, <<Cap:?GLenum>>).
-%% @spec (Red::integer(),Green::integer(),Blue::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color3ui(integer(),integer(),integer()) -> ok.
-color3ui(Red,Green,Blue) ->
- cast(5061, <<Red:?GLuint,Green:?GLuint,Blue:?GLuint>>).
+%% @doc Enable or disable client-side capability
+%%
+%% ``gl:enableClientState'' and {@link gl:enableClientState/1} enable or disable individual
+%% client-side capabilities. By default, all client-side capabilities are disabled. Both ``gl:enableClientState''
+%% and {@link gl:enableClientState/1} take a single argument, `Cap' , which can assume
+%% one of the following values:
+%%
+%% `?GL_COLOR_ARRAY': If enabled, the color array is enabled for writing and used during
+%% rendering when {@link gl:arrayElement/1} , {@link gl:drawArrays/3} , {@link gl:drawElements/4} ,
+%% {@link gl:drawRangeElements/6} {@link gl:multiDrawArrays/3} , or see `glMultiDrawElements'
+%% is called. See {@link gl:colorPointer/4} .
+%%
+%% `?GL_EDGE_FLAG_ARRAY': If enabled, the edge flag array is enabled for writing and
+%% used during rendering when {@link gl:arrayElement/1} , {@link gl:drawArrays/3} , {@link gl:drawElements/4}
+%% , {@link gl:drawRangeElements/6} {@link gl:multiDrawArrays/3} , or see `glMultiDrawElements'
+%% is called. See {@link gl:edgeFlagPointer/2} .
+%%
+%% `?GL_FOG_COORD_ARRAY': If enabled, the fog coordinate array is enabled for writing
+%% and used during rendering when {@link gl:arrayElement/1} , {@link gl:drawArrays/3} , {@link gl:drawElements/4}
+%% , {@link gl:drawRangeElements/6} {@link gl:multiDrawArrays/3} , or see `glMultiDrawElements'
+%% is called. See {@link gl:fogCoordPointer/3} .
+%%
+%% `?GL_INDEX_ARRAY': If enabled, the index array is enabled for writing and used during
+%% rendering when {@link gl:arrayElement/1} , {@link gl:drawArrays/3} , {@link gl:drawElements/4} ,
+%% {@link gl:drawRangeElements/6} {@link gl:multiDrawArrays/3} , or see `glMultiDrawElements'
+%% is called. See {@link gl:indexPointer/3} .
+%%
+%% `?GL_NORMAL_ARRAY': If enabled, the normal array is enabled for writing and used
+%% during rendering when {@link gl:arrayElement/1} , {@link gl:drawArrays/3} , {@link gl:drawElements/4}
+%% , {@link gl:drawRangeElements/6} {@link gl:multiDrawArrays/3} , or see `glMultiDrawElements'
+%% is called. See {@link gl:normalPointer/3} .
+%%
+%% `?GL_SECONDARY_COLOR_ARRAY': If enabled, the secondary color array is enabled for
+%% writing and used during rendering when {@link gl:arrayElement/1} , {@link gl:drawArrays/3} , {@link gl:drawElements/4}
+%% , {@link gl:drawRangeElements/6} {@link gl:multiDrawArrays/3} , or see `glMultiDrawElements'
+%% is called. See {@link gl:colorPointer/4} .
+%%
+%% `?GL_TEXTURE_COORD_ARRAY': If enabled, the texture coordinate array is enabled for
+%% writing and used during rendering when {@link gl:arrayElement/1} , {@link gl:drawArrays/3} , {@link gl:drawElements/4}
+%% , {@link gl:drawRangeElements/6} {@link gl:multiDrawArrays/3} , or see `glMultiDrawElements'
+%% is called. See {@link gl:texCoordPointer/4} .
+%%
+%% `?GL_VERTEX_ARRAY': If enabled, the vertex array is enabled for writing and used
+%% during rendering when {@link gl:arrayElement/1} , {@link gl:drawArrays/3} , {@link gl:drawElements/4}
+%% , {@link gl:drawRangeElements/6} {@link gl:multiDrawArrays/3} , or see `glMultiDrawElements'
+%% is called. See {@link gl:vertexPointer/4} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEnableClientState.xml">external</a> documentation.
+-spec enableClientState(Cap) -> ok when Cap :: enum().
+enableClientState(Cap) ->
+ cast(5063, <<Cap:?GLenum>>).
+
+%% @doc
+%% See {@link enableClientState/1}
+-spec disableClientState(Cap) -> ok when Cap :: enum().
+disableClientState(Cap) ->
+ cast(5064, <<Cap:?GLenum>>).
+
+%% @doc Return the value or values of a selected parameter
+%%
+%% These four commands return values for simple state variables in GL. `Pname' is a
+%% symbolic constant indicating the state variable to be returned, and `Params' is a
+%% pointer to an array of the indicated type in which to place the returned data.
+%%
+%% Type conversion is performed if `Params' has a different type than the state variable
+%% value being requested. If ``gl:getBooleanv'' is called, a floating-point (or integer)
+%% value is converted to `?GL_FALSE' if and only if it is 0.0 (or 0). Otherwise, it
+%% is converted to `?GL_TRUE'. If ``gl:getIntegerv'' is called, boolean values are
+%% returned as `?GL_TRUE' or `?GL_FALSE', and most floating-point values are rounded
+%% to the nearest integer value. Floating-point colors and normals, however, are returned
+%% with a linear mapping that maps 1.0 to the most positive representable integer value and
+%% -1.0 to the most negative representable integer value. If ``gl:getFloatv'' or ``gl:getDoublev''
+%% is called, boolean values are returned as `?GL_TRUE' or `?GL_FALSE', and integer
+%% values are converted to floating-point values.
+%%
+%% The following symbolic constants are accepted by `Pname' :
+%%
+%% `?GL_ACTIVE_TEXTURE': `Params' returns a single value indicating the active
+%% multitexture unit. The initial value is `?GL_TEXTURE0'. See {@link gl:activeTexture/1} .
+%%
+%%
+%% `?GL_ALIASED_LINE_WIDTH_RANGE': `Params' returns a pair of values indicating
+%% the range of widths supported for aliased lines. See {@link gl:lineWidth/1} .
+%%
+%% `?GL_ARRAY_BUFFER_BINDING': `Params' returns a single value, the name of the
+%% buffer object currently bound to the target `?GL_ARRAY_BUFFER'. If no buffer object
+%% is bound to this target, 0 is returned. The initial value is 0. See {@link gl:bindBuffer/2} .
+%%
+%%
+%% `?GL_BLEND': `Params' returns a single boolean value indicating whether blending
+%% is enabled. The initial value is `?GL_FALSE'. See {@link gl:blendFunc/2} .
+%%
+%% `?GL_BLEND_COLOR': `Params' returns four values, the red, green, blue, and alpha
+%% values which are the components of the blend color. See {@link gl:blendColor/4} .
+%%
+%% `?GL_BLEND_DST_ALPHA': `Params' returns one value, the symbolic constant identifying
+%% the alpha destination blend function. The initial value is `?GL_ZERO'. See {@link gl:blendFunc/2}
+%% and {@link gl:blendFuncSeparate/4} .
+%%
+%% `?GL_BLEND_DST_RGB': `Params' returns one value, the symbolic constant identifying
+%% the RGB destination blend function. The initial value is `?GL_ZERO'. See {@link gl:blendFunc/2}
+%% and {@link gl:blendFuncSeparate/4} .
+%%
+%% `?GL_BLEND_EQUATION_RGB': `Params' returns one value, a symbolic constant indicating
+%% whether the RGB blend equation is `?GL_FUNC_ADD', `?GL_FUNC_SUBTRACT', `?GL_FUNC_REVERSE_SUBTRACT'
+%% , `?GL_MIN' or `?GL_MAX'. See {@link gl:blendEquationSeparate/2} .
+%%
+%% `?GL_BLEND_EQUATION_ALPHA': `Params' returns one value, a symbolic constant
+%% indicating whether the Alpha blend equation is `?GL_FUNC_ADD', `?GL_FUNC_SUBTRACT'
+%% , `?GL_FUNC_REVERSE_SUBTRACT', `?GL_MIN' or `?GL_MAX'. See {@link gl:blendEquationSeparate/2}
+%% .
+%%
+%% `?GL_BLEND_SRC_ALPHA': `Params' returns one value, the symbolic constant identifying
+%% the alpha source blend function. The initial value is `?GL_ONE'. See {@link gl:blendFunc/2}
+%% and {@link gl:blendFuncSeparate/4} .
+%%
+%% `?GL_BLEND_SRC_RGB': `Params' returns one value, the symbolic constant identifying
+%% the RGB source blend function. The initial value is `?GL_ONE'. See {@link gl:blendFunc/2}
+%% and {@link gl:blendFuncSeparate/4} .
+%%
+%% `?GL_COLOR_CLEAR_VALUE': `Params' returns four values: the red, green, blue,
+%% and alpha values used to clear the color buffers. Integer values, if requested, are linearly
+%% mapped from the internal floating-point representation such that 1.0 returns the most
+%% positive representable integer value, and -1.0 returns the most negative representable
+%% integer value. The initial value is (0, 0, 0, 0). See {@link gl:clearColor/4} .
+%%
+%% `?GL_COLOR_LOGIC_OP': `Params' returns a single boolean value indicating whether
+%% a fragment's RGBA color values are merged into the framebuffer using a logical operation.
+%% The initial value is `?GL_FALSE'. See {@link gl:logicOp/1} .
+%%
+%% `?GL_COLOR_WRITEMASK': `Params' returns four boolean values: the red, green,
+%% blue, and alpha write enables for the color buffers. The initial value is (`?GL_TRUE',
+%% `?GL_TRUE', `?GL_TRUE', `?GL_TRUE'). See {@link gl:colorMask/4} .
+%%
+%% `?GL_COMPRESSED_TEXTURE_FORMATS': `Params' returns a list of symbolic constants
+%% of length `?GL_NUM_COMPRESSED_TEXTURE_FORMATS' indicating which compressed texture
+%% formats are available. See {@link gl:compressedTexImage2D/8} .
+%%
+%% `?GL_CONTEXT_FLAGS': `Params' returns one value, the flags with which the context
+%% was created (such as debugging functionality).
+%%
+%% `?GL_CULL_FACE': `Params' returns a single boolean value indicating whether
+%% polygon culling is enabled. The initial value is `?GL_FALSE'. See {@link gl:cullFace/1}
+%% .
+%%
+%% `?GL_CURRENT_PROGRAM': `Params' returns one value, the name of the program object
+%% that is currently active, or 0 if no program object is active. See {@link gl:useProgram/1} .
+%%
+%%
+%% `?GL_DEPTH_CLEAR_VALUE': `Params' returns one value, the value that is used
+%% to clear the depth buffer. Integer values, if requested, are linearly mapped from the
+%% internal floating-point representation such that 1.0 returns the most positive representable
+%% integer value, and -1.0 returns the most negative representable integer value. The initial
+%% value is 1. See {@link gl:clearDepth/1} .
+%%
+%% `?GL_DEPTH_FUNC': `Params' returns one value, the symbolic constant that indicates
+%% the depth comparison function. The initial value is `?GL_LESS'. See {@link gl:depthFunc/1}
+%% .
+%%
+%% `?GL_DEPTH_RANGE': `Params' returns two values: the near and far mapping limits
+%% for the depth buffer. Integer values, if requested, are linearly mapped from the internal
+%% floating-point representation such that 1.0 returns the most positive representable integer
+%% value, and -1.0 returns the most negative representable integer value. The initial value
+%% is (0, 1). See {@link gl:depthRange/2} .
+%%
+%% `?GL_DEPTH_TEST': `Params' returns a single boolean value indicating whether
+%% depth testing of fragments is enabled. The initial value is `?GL_FALSE'. See {@link gl:depthFunc/1}
+%% and {@link gl:depthRange/2} .
+%%
+%% `?GL_DEPTH_WRITEMASK': `Params' returns a single boolean value indicating if
+%% the depth buffer is enabled for writing. The initial value is `?GL_TRUE'. See {@link gl:depthMask/1}
+%% .
+%%
+%% `?GL_DITHER': `Params' returns a single boolean value indicating whether dithering
+%% of fragment colors and indices is enabled. The initial value is `?GL_TRUE'.
+%%
+%% `?GL_DOUBLEBUFFER': `Params' returns a single boolean value indicating whether
+%% double buffering is supported.
+%%
+%% `?GL_DRAW_BUFFER': `Params' returns one value, a symbolic constant indicating
+%% which buffers are being drawn to. See {@link gl:drawBuffer/1} . The initial value is `?GL_BACK'
+%% if there are back buffers, otherwise it is `?GL_FRONT'.
+%%
+%% `?GL_DRAW_BUFFER'`i': `Params' returns one value, a symbolic constant indicating
+%% which buffers are being drawn to by the corresponding output color. See {@link gl:drawBuffers/1}
+%% . The initial value of `?GL_DRAW_BUFFER0' is `?GL_BACK' if there are back buffers,
+%% otherwise it is `?GL_FRONT'. The initial values of draw buffers for all other output
+%% colors is `?GL_NONE'.
+%%
+%% `?GL_DRAW_FRAMEBUFFER_BINDING': `Params' returns one value, the name of the
+%% framebuffer object currently bound to the `?GL_DRAW_FRAMEBUFFER' target. If the default
+%% framebuffer is bound, this value will be zero. The initial value is zero. See {@link gl:bindFramebuffer/2}
+%% .
+%%
+%% `?GL_READ_FRAMEBUFFER_BINDING': `Params' returns one value, the name of the
+%% framebuffer object currently bound to the `?GL_READ_FRAMEBUFFER' target. If the default
+%% framebuffer is bound, this value will be zero. The initial value is zero. See {@link gl:bindFramebuffer/2}
+%% .
+%%
+%% `?GL_ELEMENT_ARRAY_BUFFER_BINDING': `Params' returns a single value, the name
+%% of the buffer object currently bound to the target `?GL_ELEMENT_ARRAY_BUFFER'. If
+%% no buffer object is bound to this target, 0 is returned. The initial value is 0. See {@link gl:bindBuffer/2}
+%% .
+%%
+%% `?GL_FRAGMENT_SHADER_DERIVATIVE_HINT': `Params' returns one value, a symbolic
+%% constant indicating the mode of the derivative accuracy hint for fragment shaders. The
+%% initial value is `?GL_DONT_CARE'. See {@link gl:hint/2} .
+%%
+%% `?GL_IMPLEMENTATION_COLOR_READ_FORMAT': `Params' returns a single GLenum value
+%% indicating the implementation's preferred pixel data format. See {@link gl:readPixels/7} .
+%%
+%% `?GL_IMPLEMENTATION_COLOR_READ_TYPE': `Params' returns a single GLenum value
+%% indicating the implementation's preferred pixel data type. See {@link gl:readPixels/7} .
+%%
+%% `?GL_LINE_SMOOTH': `Params' returns a single boolean value indicating whether
+%% antialiasing of lines is enabled. The initial value is `?GL_FALSE'. See {@link gl:lineWidth/1}
+%% .
+%%
+%% `?GL_LINE_SMOOTH_HINT': `Params' returns one value, a symbolic constant indicating
+%% the mode of the line antialiasing hint. The initial value is `?GL_DONT_CARE'. See {@link gl:hint/2}
+%% .
+%%
+%% `?GL_LINE_WIDTH': `Params' returns one value, the line width as specified with {@link gl:lineWidth/1}
+%% . The initial value is 1.
+%%
+%% `?GL_LAYER_PROVOKING_VERTEX': `Params' returns one value, the implementation
+%% dependent specifc vertex of a primitive that is used to select the rendering layer. If
+%% the value returned is equivalent to `?GL_PROVOKING_VERTEX', then the vertex selection
+%% follows the convention specified by {@link gl:provokingVertex/1} . If the value returned
+%% is equivalent to `?GL_FIRST_VERTEX_CONVENTION', then the selection is always taken
+%% from the first vertex in the primitive. If the value returned is equivalent to `?GL_LAST_VERTEX_CONVENTION'
+%% , then the selection is always taken from the last vertex in the primitive. If the value
+%% returned is equivalent to `?GL_UNDEFINED_VERTEX', then the selection is not guaranteed
+%% to be taken from any specific vertex in the primitive.
+%%
+%% `?GL_LINE_WIDTH_GRANULARITY': `Params' returns one value, the width difference
+%% between adjacent supported widths for antialiased lines. See {@link gl:lineWidth/1} .
+%%
+%% `?GL_LINE_WIDTH_RANGE': `Params' returns two values: the smallest and largest
+%% supported widths for antialiased lines. See {@link gl:lineWidth/1} .
+%%
+%% `?GL_LOGIC_OP_MODE': `Params' returns one value, a symbolic constant indicating
+%% the selected logic operation mode. The initial value is `?GL_COPY'. See {@link gl:logicOp/1}
+%% .
+%%
+%% `?GL_MAJOR_VERSION': `Params' returns one value, the major version number of
+%% the OpenGL API supported by the current context.
+%%
+%% `?GL_MAX_3D_TEXTURE_SIZE': `Params' returns one value, a rough estimate of the
+%% largest 3D texture that the GL can handle. The value must be at least 64. Use `?GL_PROXY_TEXTURE_3D'
+%% to determine if a texture is too large. See {@link gl:texImage3D/10} .
+%%
+%% `?GL_MAX_ARRAY_TEXTURE_LAYERS': `Params' returns one value. The value indicates
+%% the maximum number of layers allowed in an array texture, and must be at least 256. See {@link gl:texImage2D/9}
+%% .
+%%
+%% `?GL_MAX_CLIP_DISTANCES': `Params' returns one value, the maximum number of
+%% application-defined clipping distances. The value must be at least 8.
+%%
+%% `?GL_MAX_COLOR_TEXTURE_SAMPLES': `Params' returns one value, the maximum number
+%% of samples in a color multisample texture.
+%%
+%% `?GL_MAX_COMBINED_ATOMIC_COUNTERS': `Params' returns a single value, the maximum
+%% number of atomic counters available to all active shaders.
+%%
+%% `?GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS': `Params' returns one value,
+%% the number of words for fragment shader uniform variables in all uniform blocks (including
+%% default). The value must be at least 1. See {@link gl:uniform1f/2} .
+%%
+%% `?GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS': `Params' returns one value,
+%% the number of words for geometry shader uniform variables in all uniform blocks (including
+%% default). The value must be at least 1. See {@link gl:uniform1f/2} .
+%%
+%% `?GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS': `Params' returns one value, the maximum
+%% supported texture image units that can be used to access texture maps from the vertex
+%% shader and the fragment processor combined. If both the vertex shader and the fragment
+%% processing stage access the same texture image unit, then that counts as using two texture
+%% image units against this limit. The value must be at least 48. See {@link gl:activeTexture/1}
+%% .
+%%
+%% `?GL_MAX_COMBINED_UNIFORM_BLOCKS': `Params' returns one value, the maximum number
+%% of uniform blocks per program. The value must be at least 36. See {@link gl:uniformBlockBinding/3}
+%% .
+%%
+%% `?GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS': `Params' returns one value, the
+%% number of words for vertex shader uniform variables in all uniform blocks (including default).
+%% The value must be at least 1. See {@link gl:uniform1f/2} .
+%%
+%% `?GL_MAX_CUBE_MAP_TEXTURE_SIZE': `Params' returns one value. The value gives
+%% a rough estimate of the largest cube-map texture that the GL can handle. The value must
+%% be at least 1024. Use `?GL_PROXY_TEXTURE_CUBE_MAP' to determine if a texture is too
+%% large. See {@link gl:texImage2D/9} .
+%%
+%% `?GL_MAX_DEPTH_TEXTURE_SAMPLES': `Params' returns one value, the maximum number
+%% of samples in a multisample depth or depth-stencil texture.
+%%
+%% `?GL_MAX_DRAW_BUFFERS': `Params' returns one value, the maximum number of simultaneous
+%% outputs that may be written in a fragment shader. The value must be at least 8. See {@link gl:drawBuffers/1}
+%% .
+%%
+%% `?GL_MAX_DUALSOURCE_DRAW_BUFFERS': `Params' returns one value, the maximum number
+%% of active draw buffers when using dual-source blending. The value must be at least 1.
+%% See {@link gl:blendFunc/2} and {@link gl:blendFuncSeparate/4} .
+%%
+%% `?GL_MAX_ELEMENTS_INDICES': `Params' returns one value, the recommended maximum
+%% number of vertex array indices. See {@link gl:drawRangeElements/6} .
+%%
+%% `?GL_MAX_ELEMENTS_VERTICES': `Params' returns one value, the recommended maximum
+%% number of vertex array vertices. See {@link gl:drawRangeElements/6} .
+%%
+%% `?GL_MAX_FRAGMENT_ATOMIC_COUNTERS': `Params' returns a single value, the maximum
+%% number of atomic counters available to fragment shaders.
+%%
+%% `?GL_MAX_FRAGMENT_INPUT_COMPONENTS': `Params' returns one value, the maximum
+%% number of components of the inputs read by the fragment shader, which must be at least
+%% 128.
+%%
+%% `?GL_MAX_FRAGMENT_UNIFORM_COMPONENTS': `Params' returns one value, the maximum
+%% number of individual floating-point, integer, or boolean values that can be held in uniform
+%% variable storage for a fragment shader. The value must be at least 1024. See {@link gl:uniform1f/2}
+%% .
+%%
+%% `?GL_MAX_FRAGMENT_UNIFORM_VECTORS': `Params' returns one value, the maximum
+%% number of individual 4-vectors of floating-point, integer, or boolean values that can
+%% be held in uniform variable storage for a fragment shader. The value is equal to the value
+%% of `?GL_MAX_FRAGMENT_UNIFORM_COMPONENTS' divided by 4 and must be at least 256. See {@link gl:uniform1f/2}
+%% .
+%%
+%% `?GL_MAX_FRAGMENT_UNIFORM_BLOCKS': `Params' returns one value, the maximum number
+%% of uniform blocks per fragment shader. The value must be at least 12. See {@link gl:uniformBlockBinding/3}
+%% .
+%%
+%% `?GL_MAX_GEOMETRY_ATOMIC_COUNTERS': `Params' returns a single value, the maximum
+%% number of atomic counters available to geometry shaders.
+%%
+%% `?GL_MAX_GEOMETRY_INPUT_COMPONENTS': `Params' returns one value, the maximum
+%% number of components of inputs read by a geometry shader, which must be at least 64.
+%%
+%% `?GL_MAX_GEOMETRY_OUTPUT_COMPONENTS': `Params' returns one value, the maximum
+%% number of components of outputs written by a geometry shader, which must be at least 128.
+%%
+%%
+%% `?GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS': `Params' returns one value, the maximum
+%% supported texture image units that can be used to access texture maps from the geometry
+%% shader. The value must be at least 16. See {@link gl:activeTexture/1} .
+%%
+%% `?GL_MAX_GEOMETRY_UNIFORM_BLOCKS': `Params' returns one value, the maximum number
+%% of uniform blocks per geometry shader. The value must be at least 12. See {@link gl:uniformBlockBinding/3}
+%% .
+%%
+%% `?GL_MAX_GEOMETRY_UNIFORM_COMPONENTS': `Params' returns one value, the maximum
+%% number of individual floating-point, integer, or boolean values that can be held in uniform
+%% variable storage for a geometry shader. The value must be at least 1024. See {@link gl:uniform1f/2}
+%% .
+%%
+%% `?GL_MAX_INTEGER_SAMPLES': `Params' returns one value, the maximum number of
+%% samples supported in integer format multisample buffers.
+%%
+%% `?GL_MIN_MAP_BUFFER_ALIGNMENT': `Params' returns one value, the minimum alignment
+%% in basic machine units of pointers returned fromsee `glMapBuffer' and see `glMapBufferRange'
+%% . This value must be a power of two and must be at least 64.
+%%
+%% `?GL_MAX_PROGRAM_TEXEL_OFFSET': `Params' returns one value, the maximum texel
+%% offset allowed in a texture lookup, which must be at least 7.
+%%
+%% `?GL_MIN_PROGRAM_TEXEL_OFFSET': `Params' returns one value, the minimum texel
+%% offset allowed in a texture lookup, which must be at most -8.
+%%
+%% `?GL_MAX_RECTANGLE_TEXTURE_SIZE': `Params' returns one value. The value gives
+%% a rough estimate of the largest rectangular texture that the GL can handle. The value
+%% must be at least 1024. Use `?GL_PROXY_RECTANGLE_TEXTURE' to determine if a texture
+%% is too large. See {@link gl:texImage2D/9} .
+%%
+%% `?GL_MAX_RENDERBUFFER_SIZE': `Params' returns one value. The value indicates
+%% the maximum supported size for renderbuffers. See {@link gl:framebufferRenderbuffer/4} .
+%%
+%% `?GL_MAX_SAMPLE_MASK_WORDS': `Params' returns one value, the maximum number
+%% of sample mask words.
+%%
+%% `?GL_MAX_SERVER_WAIT_TIMEOUT': `Params' returns one value, the maximum {@link gl:waitSync/3}
+%% timeout interval.
+%%
+%% `?GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS': `Params' returns a single value, the
+%% maximum number of atomic counters available to tessellation control shaders.
+%%
+%% `?GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS': `Params' returns a single value,
+%% the maximum number of atomic counters available to tessellation evaluation shaders.
+%%
+%% `?GL_MAX_TEXTURE_BUFFER_SIZE': `Params' returns one value. The value gives the
+%% maximum number of texels allowed in the texel array of a texture buffer object. Value
+%% must be at least 65536.
+%%
+%% `?GL_MAX_TEXTURE_IMAGE_UNITS': `Params' returns one value, the maximum supported
+%% texture image units that can be used to access texture maps from the fragment shader.
+%% The value must be at least 16. See {@link gl:activeTexture/1} .
+%%
+%% `?GL_MAX_TEXTURE_LOD_BIAS': `Params' returns one value, the maximum, absolute
+%% value of the texture level-of-detail bias. The value must be at least 2.0.
+%%
+%% `?GL_MAX_TEXTURE_SIZE': `Params' returns one value. The value gives a rough
+%% estimate of the largest texture that the GL can handle. The value must be at least 1024.
+%% Use a proxy texture target such as `?GL_PROXY_TEXTURE_1D' or `?GL_PROXY_TEXTURE_2D'
+%% to determine if a texture is too large. See {@link gl:texImage1D/8} and {@link gl:texImage2D/9}
+%% .
+%%
+%% `?GL_MAX_UNIFORM_BUFFER_BINDINGS': `Params' returns one value, the maximum number
+%% of uniform buffer binding points on the context, which must be at least 36.
+%%
+%% `?GL_MAX_UNIFORM_BLOCK_SIZE': `Params' returns one value, the maximum size in
+%% basic machine units of a uniform block, which must be at least 16384.
+%%
+%% `?GL_MAX_VARYING_COMPONENTS': `Params' returns one value, the number components
+%% for varying variables, which must be at least 60.
+%%
+%% `?GL_MAX_VARYING_VECTORS': `Params' returns one value, the number 4-vectors
+%% for varying variables, which is equal to the value of `?GL_MAX_VARYING_COMPONENTS'
+%% and must be at least 15.
+%%
+%% `?GL_MAX_VARYING_FLOATS': `Params' returns one value, the maximum number of
+%% interpolators available for processing varying variables used by vertex and fragment shaders.
+%% This value represents the number of individual floating-point values that can be interpolated;
+%% varying variables declared as vectors, matrices, and arrays will all consume multiple
+%% interpolators. The value must be at least 32.
+%%
+%% `?GL_MAX_VERTEX_ATOMIC_COUNTERS': `Params' returns a single value, the maximum
+%% number of atomic counters available to vertex shaders.
+%%
+%% `?GL_MAX_VERTEX_ATTRIBS': `Params' returns one value, the maximum number of
+%% 4-component generic vertex attributes accessible to a vertex shader. The value must be
+%% at least 16. See {@link gl:vertexAttrib1d/2} .
+%%
+%% `?GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS': `Params' returns one value, the maximum
+%% supported texture image units that can be used to access texture maps from the vertex
+%% shader. The value may be at least 16. See {@link gl:activeTexture/1} .
+%%
+%% `?GL_MAX_VERTEX_UNIFORM_COMPONENTS': `Params' returns one value, the maximum
+%% number of individual floating-point, integer, or boolean values that can be held in uniform
+%% variable storage for a vertex shader. The value must be at least 1024. See {@link gl:uniform1f/2}
+%% .
+%%
+%% `?GL_MAX_VERTEX_UNIFORM_VECTORS': `Params' returns one value, the maximum number
+%% of 4-vectors that may be held in uniform variable storage for the vertex shader. The value
+%% of `?GL_MAX_VERTEX_UNIFORM_VECTORS' is equal to the value of `?GL_MAX_VERTEX_UNIFORM_COMPONENTS'
+%% and must be at least 256.
+%%
+%% `?GL_MAX_VERTEX_OUTPUT_COMPONENTS': `Params' returns one value, the maximum
+%% number of components of output written by a vertex shader, which must be at least 64.
+%%
+%% `?GL_MAX_VERTEX_UNIFORM_BLOCKS': `Params' returns one value, the maximum number
+%% of uniform blocks per vertex shader. The value must be at least 12. See {@link gl:uniformBlockBinding/3}
+%% .
+%%
+%% `?GL_MAX_VIEWPORT_DIMS': `Params' returns two values: the maximum supported
+%% width and height of the viewport. These must be at least as large as the visible dimensions
+%% of the display being rendered to. See {@link gl:viewport/4} .
+%%
+%% `?GL_MAX_VIEWPORTS': `Params' returns one value, the maximum number of simultaneous
+%% viewports that are supported. The value must be at least 16. See {@link gl:viewportIndexedf/5}
+%% .
+%%
+%% `?GL_MINOR_VERSION': `Params' returns one value, the minor version number of
+%% the OpenGL API supported by the current context.
+%%
+%% `?GL_NUM_COMPRESSED_TEXTURE_FORMATS': `Params' returns a single integer value
+%% indicating the number of available compressed texture formats. The minimum value is 4.
+%% See {@link gl:compressedTexImage2D/8} .
+%%
+%% `?GL_NUM_EXTENSIONS': `Params' returns one value, the number of extensions supported
+%% by the GL implementation for the current context. See {@link gl:getString/1} .
+%%
+%% `?GL_NUM_PROGRAM_BINARY_FORMATS': `Params' returns one value, the number of
+%% program binary formats supported by the implementation.
+%%
+%% `?GL_NUM_SHADER_BINARY_FORMATS': `Params' returns one value, the number of binary
+%% shader formats supported by the implementation. If this value is greater than zero, then
+%% the implementation supports loading binary shaders. If it is zero, then the loading of
+%% binary shaders by the implementation is not supported.
+%%
+%% `?GL_PACK_ALIGNMENT': `Params' returns one value, the byte alignment used for
+%% writing pixel data to memory. The initial value is 4. See {@link gl:pixelStoref/2} .
+%%
+%% `?GL_PACK_IMAGE_HEIGHT': `Params' returns one value, the image height used for
+%% writing pixel data to memory. The initial value is 0. See {@link gl:pixelStoref/2} .
+%%
+%% `?GL_PACK_LSB_FIRST': `Params' returns a single boolean value indicating whether
+%% single-bit pixels being written to memory are written first to the least significant bit
+%% of each unsigned byte. The initial value is `?GL_FALSE'. See {@link gl:pixelStoref/2} .
+%%
+%%
+%% `?GL_PACK_ROW_LENGTH': `Params' returns one value, the row length used for writing
+%% pixel data to memory. The initial value is 0. See {@link gl:pixelStoref/2} .
+%%
+%% `?GL_PACK_SKIP_IMAGES': `Params' returns one value, the number of pixel images
+%% skipped before the first pixel is written into memory. The initial value is 0. See {@link gl:pixelStoref/2}
+%% .
+%%
+%% `?GL_PACK_SKIP_PIXELS': `Params' returns one value, the number of pixel locations
+%% skipped before the first pixel is written into memory. The initial value is 0. See {@link gl:pixelStoref/2}
+%% .
+%%
+%% `?GL_PACK_SKIP_ROWS': `Params' returns one value, the number of rows of pixel
+%% locations skipped before the first pixel is written into memory. The initial value is
+%% 0. See {@link gl:pixelStoref/2} .
+%%
+%% `?GL_PACK_SWAP_BYTES': `Params' returns a single boolean value indicating whether
+%% the bytes of two-byte and four-byte pixel indices and components are swapped before being
+%% written to memory. The initial value is `?GL_FALSE'. See {@link gl:pixelStoref/2} .
+%%
+%% `?GL_PIXEL_PACK_BUFFER_BINDING': `Params' returns a single value, the name of
+%% the buffer object currently bound to the target `?GL_PIXEL_PACK_BUFFER'. If no buffer
+%% object is bound to this target, 0 is returned. The initial value is 0. See {@link gl:bindBuffer/2}
+%% .
+%%
+%% `?GL_PIXEL_UNPACK_BUFFER_BINDING': `Params' returns a single value, the name
+%% of the buffer object currently bound to the target `?GL_PIXEL_UNPACK_BUFFER'. If
+%% no buffer object is bound to this target, 0 is returned. The initial value is 0. See {@link gl:bindBuffer/2}
+%% .
+%%
+%% `?GL_POINT_FADE_THRESHOLD_SIZE': `Params' returns one value, the point size
+%% threshold for determining the point size. See {@link gl:pointParameterf/2} .
+%%
+%% `?GL_PRIMITIVE_RESTART_INDEX': `Params' returns one value, the current primitive
+%% restart index. The initial value is 0. See {@link gl:primitiveRestartIndex/1} .
+%%
+%% `?GL_PROGRAM_BINARY_FORMATS': `Params' an array of `?GL_NUM_PROGRAM_BINARY_FORMATS'
+%% values, indicating the proram binary formats supported by the implementation.
+%%
+%% `?GL_PROGRAM_PIPELINE_BINDING': `Params' a single value, the name of the currently
+%% bound program pipeline object, or zero if no program pipeline object is bound. See {@link gl:bindProgramPipeline/1}
+%% .
+%%
+%% `?GL_PROVOKING_VERTEX': `Params' returns one value, the currently selected provoking
+%% vertex convention. The initial value is `?GL_LAST_VERTEX_CONVENTION'. See {@link gl:provokingVertex/1}
+%% .
+%%
+%% `?GL_POINT_SIZE': `Params' returns one value, the point size as specified by {@link gl:pointSize/1}
+%% . The initial value is 1.
+%%
+%% `?GL_POINT_SIZE_GRANULARITY': `Params' returns one value, the size difference
+%% between adjacent supported sizes for antialiased points. See {@link gl:pointSize/1} .
+%%
+%% `?GL_POINT_SIZE_RANGE': `Params' returns two values: the smallest and largest
+%% supported sizes for antialiased points. The smallest size must be at most 1, and the largest
+%% size must be at least 1. See {@link gl:pointSize/1} .
+%%
+%% `?GL_POLYGON_OFFSET_FACTOR': `Params' returns one value, the scaling factor
+%% used to determine the variable offset that is added to the depth value of each fragment
+%% generated when a polygon is rasterized. The initial value is 0. See {@link gl:polygonOffset/2}
+%% .
+%%
+%% `?GL_POLYGON_OFFSET_UNITS': `Params' returns one value. This value is multiplied
+%% by an implementation-specific value and then added to the depth value of each fragment
+%% generated when a polygon is rasterized. The initial value is 0. See {@link gl:polygonOffset/2}
+%% .
+%%
+%% `?GL_POLYGON_OFFSET_FILL': `Params' returns a single boolean value indicating
+%% whether polygon offset is enabled for polygons in fill mode. The initial value is `?GL_FALSE'
+%% . See {@link gl:polygonOffset/2} .
+%%
+%% `?GL_POLYGON_OFFSET_LINE': `Params' returns a single boolean value indicating
+%% whether polygon offset is enabled for polygons in line mode. The initial value is `?GL_FALSE'
+%% . See {@link gl:polygonOffset/2} .
+%%
+%% `?GL_POLYGON_OFFSET_POINT': `Params' returns a single boolean value indicating
+%% whether polygon offset is enabled for polygons in point mode. The initial value is `?GL_FALSE'
+%% . See {@link gl:polygonOffset/2} .
+%%
+%% `?GL_POLYGON_SMOOTH': `Params' returns a single boolean value indicating whether
+%% antialiasing of polygons is enabled. The initial value is `?GL_FALSE'. See {@link gl:polygonMode/2}
+%% .
+%%
+%% `?GL_POLYGON_SMOOTH_HINT': `Params' returns one value, a symbolic constant indicating
+%% the mode of the polygon antialiasing hint. The initial value is `?GL_DONT_CARE'.
+%% See {@link gl:hint/2} .
+%%
+%% `?GL_READ_BUFFER': `Params' returns one value, a symbolic constant indicating
+%% which color buffer is selected for reading. The initial value is `?GL_BACK' if there
+%% is a back buffer, otherwise it is `?GL_FRONT'. See {@link gl:readPixels/7} .
+%%
+%% `?GL_RENDERBUFFER_BINDING': `Params' returns a single value, the name of the
+%% renderbuffer object currently bound to the target `?GL_RENDERBUFFER'. If no renderbuffer
+%% object is bound to this target, 0 is returned. The initial value is 0. See {@link gl:bindRenderbuffer/2}
+%% .
+%%
+%% `?GL_SAMPLE_BUFFERS': `Params' returns a single integer value indicating the
+%% number of sample buffers associated with the framebuffer. See {@link gl:sampleCoverage/2} .
+%%
+%%
+%% `?GL_SAMPLE_COVERAGE_VALUE': `Params' returns a single positive floating-point
+%% value indicating the current sample coverage value. See {@link gl:sampleCoverage/2} .
+%%
+%% `?GL_SAMPLE_COVERAGE_INVERT': `Params' returns a single boolean value indicating
+%% if the temporary coverage value should be inverted. See {@link gl:sampleCoverage/2} .
+%%
+%% `?GL_SAMPLER_BINDING': `Params' returns a single value, the name of the sampler
+%% object currently bound to the active texture unit. The initial value is 0. See {@link gl:bindSampler/2}
+%% .
+%%
+%% `?GL_SAMPLES': `Params' returns a single integer value indicating the coverage
+%% mask size. See {@link gl:sampleCoverage/2} .
+%%
+%% `?GL_SCISSOR_BOX': `Params' returns four values: the x and y window coordinates
+%% of the scissor box, followed by its width and height. Initially the x and y window
+%% coordinates are both 0 and the width and height are set to the size of the window. See {@link gl:scissor/4}
+%% .
+%%
+%% `?GL_SCISSOR_TEST': `Params' returns a single boolean value indicating whether
+%% scissoring is enabled. The initial value is `?GL_FALSE'. See {@link gl:scissor/4} .
+%%
+%% `?GL_SHADER_COMPILER': `Params' returns a single boolean value indicating whether
+%% an online shader compiler is present in the implementation. All desktop OpenGL implementations
+%% must support online shader compilations, and therefore the value of `?GL_SHADER_COMPILER'
+%% will always be `?GL_TRUE'.
+%%
+%% `?GL_SMOOTH_LINE_WIDTH_RANGE': `Params' returns a pair of values indicating
+%% the range of widths supported for smooth (antialiased) lines. See {@link gl:lineWidth/1} .
+%%
+%% `?GL_SMOOTH_LINE_WIDTH_GRANULARITY': `Params' returns a single value indicating
+%% the level of quantization applied to smooth line width parameters.
+%%
+%% `?GL_STENCIL_BACK_FAIL': `Params' returns one value, a symbolic constant indicating
+%% what action is taken for back-facing polygons when the stencil test fails. The initial
+%% value is `?GL_KEEP'. See {@link gl:stencilOpSeparate/4} .
+%%
+%% `?GL_STENCIL_BACK_FUNC': `Params' returns one value, a symbolic constant indicating
+%% what function is used for back-facing polygons to compare the stencil reference value
+%% with the stencil buffer value. The initial value is `?GL_ALWAYS'. See {@link gl:stencilFuncSeparate/4}
+%% .
+%%
+%% `?GL_STENCIL_BACK_PASS_DEPTH_FAIL': `Params' returns one value, a symbolic constant
+%% indicating what action is taken for back-facing polygons when the stencil test passes,
+%% but the depth test fails. The initial value is `?GL_KEEP'. See {@link gl:stencilOpSeparate/4}
+%% .
+%%
+%% `?GL_STENCIL_BACK_PASS_DEPTH_PASS': `Params' returns one value, a symbolic constant
+%% indicating what action is taken for back-facing polygons when the stencil test passes
+%% and the depth test passes. The initial value is `?GL_KEEP'. See {@link gl:stencilOpSeparate/4}
+%% .
+%%
+%% `?GL_STENCIL_BACK_REF': `Params' returns one value, the reference value that
+%% is compared with the contents of the stencil buffer for back-facing polygons. The initial
+%% value is 0. See {@link gl:stencilFuncSeparate/4} .
+%%
+%% `?GL_STENCIL_BACK_VALUE_MASK': `Params' returns one value, the mask that is
+%% used for back-facing polygons to mask both the stencil reference value and the stencil
+%% buffer value before they are compared. The initial value is all 1's. See {@link gl:stencilFuncSeparate/4}
+%% .
+%%
+%% `?GL_STENCIL_BACK_WRITEMASK': `Params' returns one value, the mask that controls
+%% writing of the stencil bitplanes for back-facing polygons. The initial value is all 1's.
+%% See {@link gl:stencilMaskSeparate/2} .
+%%
+%% `?GL_STENCIL_CLEAR_VALUE': `Params' returns one value, the index to which the
+%% stencil bitplanes are cleared. The initial value is 0. See {@link gl:clearStencil/1} .
+%%
+%% `?GL_STENCIL_FAIL': `Params' returns one value, a symbolic constant indicating
+%% what action is taken when the stencil test fails. The initial value is `?GL_KEEP'.
+%% See {@link gl:stencilOp/3} . This stencil state only affects non-polygons and front-facing
+%% polygons. Back-facing polygons use separate stencil state. See {@link gl:stencilOpSeparate/4}
+%% .
+%%
+%% `?GL_STENCIL_FUNC': `Params' returns one value, a symbolic constant indicating
+%% what function is used to compare the stencil reference value with the stencil buffer value.
+%% The initial value is `?GL_ALWAYS'. See {@link gl:stencilFunc/3} . This stencil state
+%% only affects non-polygons and front-facing polygons. Back-facing polygons use separate
+%% stencil state. See {@link gl:stencilFuncSeparate/4} .
+%%
+%% `?GL_STENCIL_PASS_DEPTH_FAIL': `Params' returns one value, a symbolic constant
+%% indicating what action is taken when the stencil test passes, but the depth test fails.
+%% The initial value is `?GL_KEEP'. See {@link gl:stencilOp/3} . This stencil state only
+%% affects non-polygons and front-facing polygons. Back-facing polygons use separate stencil
+%% state. See {@link gl:stencilOpSeparate/4} .
+%%
+%% `?GL_STENCIL_PASS_DEPTH_PASS': `Params' returns one value, a symbolic constant
+%% indicating what action is taken when the stencil test passes and the depth test passes.
+%% The initial value is `?GL_KEEP'. See {@link gl:stencilOp/3} . This stencil state only
+%% affects non-polygons and front-facing polygons. Back-facing polygons use separate stencil
+%% state. See {@link gl:stencilOpSeparate/4} .
+%%
+%% `?GL_STENCIL_REF': `Params' returns one value, the reference value that is compared
+%% with the contents of the stencil buffer. The initial value is 0. See {@link gl:stencilFunc/3}
+%% . This stencil state only affects non-polygons and front-facing polygons. Back-facing
+%% polygons use separate stencil state. See {@link gl:stencilFuncSeparate/4} .
+%%
+%% `?GL_STENCIL_TEST': `Params' returns a single boolean value indicating whether
+%% stencil testing of fragments is enabled. The initial value is `?GL_FALSE'. See {@link gl:stencilFunc/3}
+%% and {@link gl:stencilOp/3} .
+%%
+%% `?GL_STENCIL_VALUE_MASK': `Params' returns one value, the mask that is used
+%% to mask both the stencil reference value and the stencil buffer value before they are
+%% compared. The initial value is all 1's. See {@link gl:stencilFunc/3} . This stencil state
+%% only affects non-polygons and front-facing polygons. Back-facing polygons use separate
+%% stencil state. See {@link gl:stencilFuncSeparate/4} .
+%%
+%% `?GL_STENCIL_WRITEMASK': `Params' returns one value, the mask that controls
+%% writing of the stencil bitplanes. The initial value is all 1's. See {@link gl:stencilMask/1}
+%% . This stencil state only affects non-polygons and front-facing polygons. Back-facing
+%% polygons use separate stencil state. See {@link gl:stencilMaskSeparate/2} .
+%%
+%% `?GL_STEREO': `Params' returns a single boolean value indicating whether stereo
+%% buffers (left and right) are supported.
+%%
+%% `?GL_SUBPIXEL_BITS': `Params' returns one value, an estimate of the number of
+%% bits of subpixel resolution that are used to position rasterized geometry in window coordinates.
+%% The value must be at least 4.
+%%
+%% `?GL_TEXTURE_BINDING_1D': `Params' returns a single value, the name of the texture
+%% currently bound to the target `?GL_TEXTURE_1D'. The initial value is 0. See {@link gl:bindTexture/2}
+%% .
+%%
+%% `?GL_TEXTURE_BINDING_1D_ARRAY': `Params' returns a single value, the name of
+%% the texture currently bound to the target `?GL_TEXTURE_1D_ARRAY'. The initial value
+%% is 0. See {@link gl:bindTexture/2} .
+%%
+%% `?GL_TEXTURE_BINDING_2D': `Params' returns a single value, the name of the texture
+%% currently bound to the target `?GL_TEXTURE_2D'. The initial value is 0. See {@link gl:bindTexture/2}
+%% .
+%%
+%% `?GL_TEXTURE_BINDING_2D_ARRAY': `Params' returns a single value, the name of
+%% the texture currently bound to the target `?GL_TEXTURE_2D_ARRAY'. The initial value
+%% is 0. See {@link gl:bindTexture/2} .
+%%
+%% `?GL_TEXTURE_BINDING_2D_MULTISAMPLE': `Params' returns a single value, the name
+%% of the texture currently bound to the target `?GL_TEXTURE_2D_MULTISAMPLE'. The initial
+%% value is 0. See {@link gl:bindTexture/2} .
+%%
+%% `?GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY': `Params' returns a single value,
+%% the name of the texture currently bound to the target `?GL_TEXTURE_2D_MULTISAMPLE_ARRAY'
+%% . The initial value is 0. See {@link gl:bindTexture/2} .
+%%
+%% `?GL_TEXTURE_BINDING_3D': `Params' returns a single value, the name of the texture
+%% currently bound to the target `?GL_TEXTURE_3D'. The initial value is 0. See {@link gl:bindTexture/2}
+%% .
+%%
+%% `?GL_TEXTURE_BINDING_BUFFER': `Params' returns a single value, the name of the
+%% texture currently bound to the target `?GL_TEXTURE_BUFFER'. The initial value is
+%% 0. See {@link gl:bindTexture/2} .
+%%
+%% `?GL_TEXTURE_BINDING_CUBE_MAP': `Params' returns a single value, the name of
+%% the texture currently bound to the target `?GL_TEXTURE_CUBE_MAP'. The initial value
+%% is 0. See {@link gl:bindTexture/2} .
+%%
+%% `?GL_TEXTURE_BINDING_RECTANGLE': `Params' returns a single value, the name of
+%% the texture currently bound to the target `?GL_TEXTURE_RECTANGLE'. The initial value
+%% is 0. See {@link gl:bindTexture/2} .
+%%
+%% `?GL_TEXTURE_COMPRESSION_HINT': `Params' returns a single value indicating the
+%% mode of the texture compression hint. The initial value is `?GL_DONT_CARE'.
+%%
+%% `?GL_TEXTURE_BUFFER_BINDING': `Params' returns a single value, the name of the
+%% texture buffer object currently bound. The initial value is 0. See {@link gl:bindBuffer/2} .
+%%
+%%
+%% `?GL_TIMESTAMP': `Params' returns a single value, the 64-bit value of the current
+%% GL time. See {@link gl:queryCounter/2} .
+%%
+%% `?GL_TRANSFORM_FEEDBACK_BUFFER_BINDING': When used with non-indexed variants of ``gl:get''
+%% (such as ``gl:getIntegerv''), `Params' returns a single value, the name of the
+%% buffer object currently bound to the target `?GL_TRANSFORM_FEEDBACK_BUFFER'. If no
+%% buffer object is bound to this target, 0 is returned. When used with indexed variants of ``gl:get''
+%% (such as ``gl:getIntegeri_v''), `Params' returns a single value, the name of the
+%% buffer object bound to the indexed transform feedback attribute stream. The initial value
+%% is 0 for all targets. See {@link gl:bindBuffer/2} , {@link gl:bindBufferBase/3} , and {@link gl:bindBufferRange/5}
+%% .
+%%
+%% `?GL_TRANSFORM_FEEDBACK_BUFFER_START': When used with indexed variants of ``gl:get''
+%% (such as ``gl:getInteger64i_v''), `Params' returns a single value, the start offset
+%% of the binding range for each transform feedback attribute stream. The initial value is
+%% 0 for all streams. See {@link gl:bindBufferRange/5} .
+%%
+%% `?GL_TRANSFORM_FEEDBACK_BUFFER_SIZE': When used with indexed variants of ``gl:get''
+%% (such as ``gl:getInteger64i_v''), `Params' returns a single value, the size of
+%% the binding range for each transform feedback attribute stream. The initial value is 0
+%% for all streams. See {@link gl:bindBufferRange/5} .
+%%
+%% `?GL_UNIFORM_BUFFER_BINDING': When used with non-indexed variants of ``gl:get''
+%% (such as ``gl:getIntegerv''), `Params' returns a single value, the name of the
+%% buffer object currently bound to the target `?GL_UNIFORM_BUFFER'. If no buffer object
+%% is bound to this target, 0 is returned. When used with indexed variants of ``gl:get''
+%% (such as ``gl:getIntegeri_v''), `Params' returns a single value, the name of the
+%% buffer object bound to the indexed uniform buffer binding point. The initial value is
+%% 0 for all targets. See {@link gl:bindBuffer/2} , {@link gl:bindBufferBase/3} , and {@link gl:bindBufferRange/5}
+%% .
+%%
+%% `?GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT': `Params' returns a single value, the
+%% minimum required alignment for uniform buffer sizes and offset. The initial value is 1.
+%% See {@link gl:uniformBlockBinding/3} .
+%%
+%% `?GL_UNIFORM_BUFFER_SIZE': When used with indexed variants of ``gl:get'' (such
+%% as ``gl:getInteger64i_v''), `Params' returns a single value, the size of the binding
+%% range for each indexed uniform buffer binding. The initial value is 0 for all bindings.
+%% See {@link gl:bindBufferRange/5} .
+%%
+%% `?GL_UNIFORM_BUFFER_START': When used with indexed variants of ``gl:get'' (such
+%% as ``gl:getInteger64i_v''), `Params' returns a single value, the start offset of
+%% the binding range for each indexed uniform buffer binding. The initial value is 0 for
+%% all bindings. See {@link gl:bindBufferRange/5} .
+%%
+%% `?GL_UNPACK_ALIGNMENT': `Params' returns one value, the byte alignment used
+%% for reading pixel data from memory. The initial value is 4. See {@link gl:pixelStoref/2} .
+%%
+%% `?GL_UNPACK_IMAGE_HEIGHT': `Params' returns one value, the image height used
+%% for reading pixel data from memory. The initial is 0. See {@link gl:pixelStoref/2} .
+%%
+%% `?GL_UNPACK_LSB_FIRST': `Params' returns a single boolean value indicating whether
+%% single-bit pixels being read from memory are read first from the least significant bit
+%% of each unsigned byte. The initial value is `?GL_FALSE'. See {@link gl:pixelStoref/2} .
+%%
+%%
+%% `?GL_UNPACK_ROW_LENGTH': `Params' returns one value, the row length used for
+%% reading pixel data from memory. The initial value is 0. See {@link gl:pixelStoref/2} .
+%%
+%% `?GL_UNPACK_SKIP_IMAGES': `Params' returns one value, the number of pixel images
+%% skipped before the first pixel is read from memory. The initial value is 0. See {@link gl:pixelStoref/2}
+%% .
+%%
+%% `?GL_UNPACK_SKIP_PIXELS': `Params' returns one value, the number of pixel locations
+%% skipped before the first pixel is read from memory. The initial value is 0. See {@link gl:pixelStoref/2}
+%% .
+%%
+%% `?GL_UNPACK_SKIP_ROWS': `Params' returns one value, the number of rows of pixel
+%% locations skipped before the first pixel is read from memory. The initial value is 0.
+%% See {@link gl:pixelStoref/2} .
+%%
+%% `?GL_UNPACK_SWAP_BYTES': `Params' returns a single boolean value indicating
+%% whether the bytes of two-byte and four-byte pixel indices and components are swapped after
+%% being read from memory. The initial value is `?GL_FALSE'. See {@link gl:pixelStoref/2} .
+%%
+%%
+%% `?GL_VERTEX_PROGRAM_POINT_SIZE': `Params' returns a single boolean value indicating
+%% whether vertex program point size mode is enabled. If enabled, and a vertex shader is
+%% active, then the point size is taken from the shader built-in gl_PointSize. If disabled,
+%% and a vertex shader is active, then the point size is taken from the point state as specified
+%% by {@link gl:pointSize/1} . The initial value is `?GL_FALSE'.
+%%
+%% `?GL_VIEWPORT': When used with non-indexed variants of ``gl:get'' (such as ``gl:getIntegerv''
+%% ), `Params' returns four values: the x and y window coordinates of the viewport,
+%% followed by its width and height. Initially the x and y window coordinates are both
+%% set to 0, and the width and height are set to the width and height of the window into
+%% which the GL will do its rendering. See {@link gl:viewport/4} . When used with indexed
+%% variants of ``gl:get'' (such as ``gl:getIntegeri_v''), `Params' returns four
+%% values: the x and y window coordinates of the indexed viewport, followed by its width
+%% and height. Initially the x and y window coordinates are both set to 0, and the width
+%% and height are set to the width and height of the window into which the GL will do its
+%% rendering. See {@link gl:viewportIndexedf/5} .
+%%
+%% `?GL_VIEWPORT_BOUNDS_RANGE': `Params' returns two values, the minimum and maximum
+%% viewport bounds range. The minimum range should be at least [-32768, 32767].
+%%
+%% `?GL_VIEWPORT_INDEX_PROVOKING_VERTEX': `Params' returns one value, the implementation
+%% dependent specifc vertex of a primitive that is used to select the viewport index. If
+%% the value returned is equivalent to `?GL_PROVOKING_VERTEX', then the vertex selection
+%% follows the convention specified by {@link gl:provokingVertex/1} . If the value returned
+%% is equivalent to `?GL_FIRST_VERTEX_CONVENTION', then the selection is always taken
+%% from the first vertex in the primitive. If the value returned is equivalent to `?GL_LAST_VERTEX_CONVENTION'
+%% , then the selection is always taken from the last vertex in the primitive. If the value
+%% returned is equivalent to `?GL_UNDEFINED_VERTEX', then the selection is not guaranteed
+%% to be taken from any specific vertex in the primitive.
+%%
+%% `?GL_VIEWPORT_SUBPIXEL_BITS': `Params' returns a single value, the number of
+%% bits of sub-pixel precision which the GL uses to interpret the floating point viewport
+%% bounds. The minimum value is 0.
+%%
+%% Many of the boolean parameters can also be queried more easily using {@link gl:isEnabled/1}
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGet.xml">external</a> documentation.
+-spec getBooleanv(Pname) -> [0|1] when Pname :: enum().
+getBooleanv(Pname) ->
+ call(5065, <<Pname:?GLenum>>).
-%% @spec ({Red,Green,Blue}) -> ok
-%% @equiv color3ui(Red,Green,Blue)
--spec color3uiv({integer(),integer(),integer()}) -> ok.
-color3uiv({Red,Green,Blue}) -> color3ui(Red,Green,Blue).
+%% @doc
+%% See {@link getBooleanv/1}
+-spec getDoublev(Pname) -> [float()] when Pname :: enum().
+getDoublev(Pname) ->
+ call(5066, <<Pname:?GLenum>>).
-%% @spec (Red::integer(),Green::integer(),Blue::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color3us(integer(),integer(),integer()) -> ok.
-color3us(Red,Green,Blue) ->
- cast(5062, <<Red:?GLushort,Green:?GLushort,Blue:?GLushort>>).
+%% @doc
+%% See {@link getBooleanv/1}
+-spec getFloatv(Pname) -> [float()] when Pname :: enum().
+getFloatv(Pname) ->
+ call(5067, <<Pname:?GLenum>>).
-%% @spec ({Red,Green,Blue}) -> ok
-%% @equiv color3us(Red,Green,Blue)
--spec color3usv({integer(),integer(),integer()}) -> ok.
-color3usv({Red,Green,Blue}) -> color3us(Red,Green,Blue).
+%% @doc
+%% See {@link getBooleanv/1}
+-spec getIntegerv(Pname) -> [integer()] when Pname :: enum().
+getIntegerv(Pname) ->
+ call(5068, <<Pname:?GLenum>>).
-%% @spec (Red::integer(),Green::integer(),Blue::integer(),Alpha::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color4b(integer(),integer(),integer(),integer()) -> ok.
-color4b(Red,Green,Blue,Alpha) ->
- cast(5063, <<Red:?GLbyte,Green:?GLbyte,Blue:?GLbyte,Alpha:?GLbyte>>).
+%% @doc Push and pop the server attribute stack
+%%
+%% ``gl:pushAttrib'' takes one argument, a mask that indicates which groups of state variables
+%% to save on the attribute stack. Symbolic constants are used to set bits in the mask. `Mask'
+%% is typically constructed by specifying the bitwise-or of several of these constants
+%% together. The special mask `?GL_ALL_ATTRIB_BITS' can be used to save all stackable
+%% states.
+%%
+%% The symbolic mask constants and their associated GL state are as follows (the second
+%% column lists which attributes are saved):
+%%
+%% <table><tbody><tr><td>`?GL_ACCUM_BUFFER_BIT'</td><td> Accumulation buffer clear value
+%% </td></tr><tr><td>`?GL_COLOR_BUFFER_BIT'</td><td>`?GL_ALPHA_TEST' enable bit </td>
+%% </tr><tr><td></td><td> Alpha test function and reference value </td></tr><tr><td></td><td>
+%% `?GL_BLEND' enable bit </td></tr><tr><td></td><td> Blending source and destination
+%% functions </td></tr><tr><td></td><td> Constant blend color </td></tr><tr><td></td><td>
+%% Blending equation </td></tr><tr><td></td><td>`?GL_DITHER' enable bit </td></tr><tr><td>
+%% </td><td>`?GL_DRAW_BUFFER' setting </td></tr><tr><td></td><td>`?GL_COLOR_LOGIC_OP'
+%% enable bit </td></tr><tr><td></td><td>`?GL_INDEX_LOGIC_OP' enable bit </td></tr><tr>
+%% <td></td><td> Logic op function </td></tr><tr><td></td><td> Color mode and index mode
+%% clear values </td></tr><tr><td></td><td> Color mode and index mode writemasks </td></tr><tr>
+%% <td>`?GL_CURRENT_BIT'</td><td> Current RGBA color </td></tr><tr><td></td><td> Current
+%% color index </td></tr><tr><td></td><td> Current normal vector </td></tr><tr><td></td><td>
+%% Current texture coordinates </td></tr><tr><td></td><td> Current raster position </td></tr>
+%% <tr><td></td><td>`?GL_CURRENT_RASTER_POSITION_VALID' flag </td></tr><tr><td></td><td>
+%% RGBA color associated with current raster position </td></tr><tr><td></td><td> Color
+%% index associated with current raster position </td></tr><tr><td></td><td> Texture coordinates
+%% associated with current raster position </td></tr><tr><td></td><td>`?GL_EDGE_FLAG'
+%% flag </td></tr><tr><td>`?GL_DEPTH_BUFFER_BIT'</td><td>`?GL_DEPTH_TEST' enable
+%% bit </td></tr><tr><td></td><td> Depth buffer test function </td></tr><tr><td></td><td>
+%% Depth buffer clear value </td></tr><tr><td></td><td>`?GL_DEPTH_WRITEMASK' enable
+%% bit </td></tr><tr><td>`?GL_ENABLE_BIT'</td><td>`?GL_ALPHA_TEST' flag </td></tr><tr>
+%% <td></td><td>`?GL_AUTO_NORMAL' flag </td></tr><tr><td></td><td>`?GL_BLEND' flag
+%% </td></tr><tr><td></td><td> Enable bits for the user-definable clipping planes </td></tr><tr>
+%% <td></td><td>`?GL_COLOR_MATERIAL'</td></tr><tr><td></td><td>`?GL_CULL_FACE'
+%% flag </td></tr><tr><td></td><td>`?GL_DEPTH_TEST' flag </td></tr><tr><td></td><td>`?GL_DITHER'
+%% flag </td></tr><tr><td></td><td>`?GL_FOG' flag </td></tr><tr><td></td><td>`?GL_LIGHT'
+%% `i' where `?0' &lt;= `i' &lt; `?GL_MAX_LIGHTS'</td></tr>
+%% <tr><td></td><td>`?GL_LIGHTING' flag </td></tr><tr><td></td><td>`?GL_LINE_SMOOTH'
+%% flag </td></tr><tr><td></td><td>`?GL_LINE_STIPPLE' flag </td></tr><tr><td></td><td>`?GL_COLOR_LOGIC_OP'
+%% flag </td></tr><tr><td></td><td>`?GL_INDEX_LOGIC_OP' flag </td></tr><tr><td></td><td>
+%% `?GL_MAP1_'`x' where `x' is a map type </td></tr><tr><td></td><td>`?GL_MAP2_'
+%% `x' where `x' is a map type </td></tr><tr><td></td><td>`?GL_MULTISAMPLE'
+%% flag </td></tr><tr><td></td><td>`?GL_NORMALIZE' flag </td></tr><tr><td></td><td>`?GL_POINT_SMOOTH'
+%% flag </td></tr><tr><td></td><td>`?GL_POLYGON_OFFSET_LINE' flag </td></tr><tr><td></td>
+%% <td>`?GL_POLYGON_OFFSET_FILL' flag </td></tr><tr><td></td><td>`?GL_POLYGON_OFFSET_POINT'
+%% flag </td></tr><tr><td></td><td>`?GL_POLYGON_SMOOTH' flag </td></tr><tr><td></td><td>
+%% `?GL_POLYGON_STIPPLE' flag </td></tr><tr><td></td><td>`?GL_SAMPLE_ALPHA_TO_COVERAGE'
+%% flag </td></tr><tr><td></td><td>`?GL_SAMPLE_ALPHA_TO_ONE' flag </td></tr><tr><td></td>
+%% <td>`?GL_SAMPLE_COVERAGE' flag </td></tr><tr><td></td><td>`?GL_SCISSOR_TEST'
+%% flag </td></tr><tr><td></td><td>`?GL_STENCIL_TEST' flag </td></tr><tr><td></td><td>`?GL_TEXTURE_1D'
+%% flag </td></tr><tr><td></td><td>`?GL_TEXTURE_2D' flag </td></tr><tr><td></td><td>`?GL_TEXTURE_3D'
+%% flag </td></tr><tr><td></td><td> Flags `?GL_TEXTURE_GEN_'`x' where `x'
+%% is S, T, R, or Q </td></tr><tr><td>`?GL_EVAL_BIT'</td><td>`?GL_MAP1_'`x'
+%% enable bits, where `x' is a map type </td></tr><tr><td></td><td>`?GL_MAP2_'`x'
+%% enable bits, where `x' is a map type </td></tr><tr><td></td><td> 1D grid endpoints
+%% and divisions </td></tr><tr><td></td><td> 2D grid endpoints and divisions </td></tr><tr><td>
+%% </td><td>`?GL_AUTO_NORMAL' enable bit </td></tr><tr><td>`?GL_FOG_BIT'</td><td>`?GL_FOG'
+%% enable bit </td></tr><tr><td></td><td> Fog color </td></tr><tr><td></td><td> Fog density
+%% </td></tr><tr><td></td><td> Linear fog start </td></tr><tr><td></td><td> Linear fog end </td>
+%% </tr><tr><td></td><td> Fog index </td></tr><tr><td></td><td>`?GL_FOG_MODE' value </td>
+%% </tr><tr><td>`?GL_HINT_BIT'</td><td>`?GL_PERSPECTIVE_CORRECTION_HINT' setting </td>
+%% </tr><tr><td></td><td>`?GL_POINT_SMOOTH_HINT' setting </td></tr><tr><td></td><td>`?GL_LINE_SMOOTH_HINT'
+%% setting </td></tr><tr><td></td><td>`?GL_POLYGON_SMOOTH_HINT' setting </td></tr><tr><td>
+%% </td><td>`?GL_FOG_HINT' setting </td></tr><tr><td></td><td>`?GL_GENERATE_MIPMAP_HINT'
+%% setting </td></tr><tr><td></td><td>`?GL_TEXTURE_COMPRESSION_HINT' setting </td></tr>
+%% <tr><td>`?GL_LIGHTING_BIT'</td><td>`?GL_COLOR_MATERIAL' enable bit </td></tr><tr>
+%% <td></td><td>`?GL_COLOR_MATERIAL_FACE' value </td></tr><tr><td></td><td> Color material
+%% parameters that are tracking the current color </td></tr><tr><td></td><td> Ambient scene
+%% color </td></tr><tr><td></td><td>`?GL_LIGHT_MODEL_LOCAL_VIEWER' value </td></tr><tr><td>
+%% </td><td>`?GL_LIGHT_MODEL_TWO_SIDE' setting </td></tr><tr><td></td><td>`?GL_LIGHTING'
+%% enable bit </td></tr><tr><td></td><td> Enable bit for each light </td></tr><tr><td></td><td>
+%% Ambient, diffuse, and specular intensity for each light </td></tr><tr><td></td><td> Direction,
+%% position, exponent, and cutoff angle for each light </td></tr><tr><td></td><td> Constant,
+%% linear, and quadratic attenuation factors for each light </td></tr><tr><td></td><td> Ambient,
+%% diffuse, specular, and emissive color for each material </td></tr><tr><td></td><td> Ambient,
+%% diffuse, and specular color indices for each material </td></tr><tr><td></td><td> Specular
+%% exponent for each material </td></tr><tr><td></td><td>`?GL_SHADE_MODEL' setting </td>
+%% </tr><tr><td>`?GL_LINE_BIT'</td><td>`?GL_LINE_SMOOTH' flag </td></tr><tr><td></td>
+%% <td>`?GL_LINE_STIPPLE' enable bit </td></tr><tr><td></td><td> Line stipple pattern
+%% and repeat counter </td></tr><tr><td></td><td> Line width </td></tr><tr><td>`?GL_LIST_BIT'
+%% </td><td>`?GL_LIST_BASE' setting </td></tr><tr><td>`?GL_MULTISAMPLE_BIT'</td><td>
+%% `?GL_MULTISAMPLE' flag </td></tr><tr><td></td><td>`?GL_SAMPLE_ALPHA_TO_COVERAGE'
+%% flag </td></tr><tr><td></td><td>`?GL_SAMPLE_ALPHA_TO_ONE' flag </td></tr><tr><td></td>
+%% <td>`?GL_SAMPLE_COVERAGE' flag </td></tr><tr><td></td><td>`?GL_SAMPLE_COVERAGE_VALUE'
+%% value </td></tr><tr><td></td><td>`?GL_SAMPLE_COVERAGE_INVERT' value </td></tr><tr><td>
+%% `?GL_PIXEL_MODE_BIT'</td><td>`?GL_RED_BIAS' and `?GL_RED_SCALE' settings </td>
+%% </tr><tr><td></td><td>`?GL_GREEN_BIAS' and `?GL_GREEN_SCALE' values </td></tr><tr>
+%% <td></td><td>`?GL_BLUE_BIAS' and `?GL_BLUE_SCALE'</td></tr><tr><td></td><td>`?GL_ALPHA_BIAS'
+%% and `?GL_ALPHA_SCALE'</td></tr><tr><td></td><td>`?GL_DEPTH_BIAS' and `?GL_DEPTH_SCALE'
+%% </td></tr><tr><td></td><td>`?GL_INDEX_OFFSET' and `?GL_INDEX_SHIFT' values </td>
+%% </tr><tr><td></td><td>`?GL_MAP_COLOR' and `?GL_MAP_STENCIL' flags </td></tr><tr>
+%% <td></td><td>`?GL_ZOOM_X' and `?GL_ZOOM_Y' factors </td></tr><tr><td></td><td>`?GL_READ_BUFFER'
+%% setting </td></tr><tr><td>`?GL_POINT_BIT'</td><td>`?GL_POINT_SMOOTH' flag </td>
+%% </tr><tr><td></td><td> Point size </td></tr><tr><td>`?GL_POLYGON_BIT'</td><td>`?GL_CULL_FACE'
+%% enable bit </td></tr><tr><td></td><td>`?GL_CULL_FACE_MODE' value </td></tr><tr><td></td>
+%% <td>`?GL_FRONT_FACE' indicator </td></tr><tr><td></td><td>`?GL_POLYGON_MODE'
+%% setting </td></tr><tr><td></td><td>`?GL_POLYGON_SMOOTH' flag </td></tr><tr><td></td><td>
+%% `?GL_POLYGON_STIPPLE' enable bit </td></tr><tr><td></td><td>`?GL_POLYGON_OFFSET_FILL'
+%% flag </td></tr><tr><td></td><td>`?GL_POLYGON_OFFSET_LINE' flag </td></tr><tr><td></td>
+%% <td>`?GL_POLYGON_OFFSET_POINT' flag </td></tr><tr><td></td><td>`?GL_POLYGON_OFFSET_FACTOR'
+%% </td></tr><tr><td></td><td>`?GL_POLYGON_OFFSET_UNITS'</td></tr><tr><td>`?GL_POLYGON_STIPPLE_BIT'
+%% </td><td> Polygon stipple image </td></tr><tr><td>`?GL_SCISSOR_BIT'</td><td>`?GL_SCISSOR_TEST'
+%% flag </td></tr><tr><td></td><td> Scissor box </td></tr><tr><td>`?GL_STENCIL_BUFFER_BIT'
+%% </td><td>`?GL_STENCIL_TEST' enable bit </td></tr><tr><td></td><td> Stencil function
+%% and reference value </td></tr><tr><td></td><td> Stencil value mask </td></tr><tr><td></td>
+%% <td> Stencil fail, pass, and depth buffer pass actions </td></tr><tr><td></td><td> Stencil
+%% buffer clear value </td></tr><tr><td></td><td> Stencil buffer writemask </td></tr><tr><td>
+%% `?GL_TEXTURE_BIT'</td><td> Enable bits for the four texture coordinates </td></tr><tr>
+%% <td></td><td> Border color for each texture image </td></tr><tr><td></td><td> Minification
+%% function for each texture image </td></tr><tr><td></td><td> Magnification function for
+%% each texture image </td></tr><tr><td></td><td> Texture coordinates and wrap mode for each
+%% texture image </td></tr><tr><td></td><td> Color and mode for each texture environment </td>
+%% </tr><tr><td></td><td> Enable bits `?GL_TEXTURE_GEN_'`x', `x' is S, T,
+%% R, and Q </td></tr><tr><td></td><td>`?GL_TEXTURE_GEN_MODE' setting for S, T, R, and
+%% Q </td></tr><tr><td></td><td> {@link gl:texGend/3} plane equations for S, T, R, and Q </td></tr>
+%% <tr><td></td><td> Current texture bindings (for example, `?GL_TEXTURE_BINDING_2D') </td>
+%% </tr><tr><td>`?GL_TRANSFORM_BIT'</td><td> Coefficients of the six clipping planes </td>
+%% </tr><tr><td></td><td> Enable bits for the user-definable clipping planes </td></tr><tr><td>
+%% </td><td>`?GL_MATRIX_MODE' value </td></tr><tr><td></td><td>`?GL_NORMALIZE'
+%% flag </td></tr><tr><td></td><td>`?GL_RESCALE_NORMAL' flag </td></tr><tr><td>`?GL_VIEWPORT_BIT'
+%% </td><td> Depth range (near and far) </td></tr><tr><td></td><td> Viewport origin and extent
+%% </td></tr></tbody></table>
+%%
+%% {@link gl:pushAttrib/1} restores the values of the state variables saved with the last ``gl:pushAttrib''
+%% command. Those not saved are left unchanged.
+%%
+%% It is an error to push attributes onto a full stack or to pop attributes off an empty
+%% stack. In either case, the error flag is set and no other change is made to GL state.
+%%
+%% Initially, the attribute stack is empty.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPushAttrib.xml">external</a> documentation.
+-spec pushAttrib(Mask) -> ok when Mask :: integer().
+pushAttrib(Mask) ->
+ cast(5069, <<Mask:?GLbitfield>>).
-%% @spec ({Red,Green,Blue,Alpha}) -> ok
-%% @equiv color4b(Red,Green,Blue,Alpha)
--spec color4bv({integer(),integer(),integer(),integer()}) -> ok.
-color4bv({Red,Green,Blue,Alpha}) -> color4b(Red,Green,Blue,Alpha).
+%% @doc
+%% See {@link pushAttrib/1}
+-spec popAttrib() -> ok.
+popAttrib() ->
+ cast(5070, <<>>).
-%% @spec (Red::float(),Green::float(),Blue::float(),Alpha::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color4d(float(),float(),float(),float()) -> ok.
-color4d(Red,Green,Blue,Alpha) ->
- cast(5064, <<Red:?GLdouble,Green:?GLdouble,Blue:?GLdouble,Alpha:?GLdouble>>).
+%% @doc Push and pop the client attribute stack
+%%
+%% ``gl:pushClientAttrib'' takes one argument, a mask that indicates which groups of client-state
+%% variables to save on the client attribute stack. Symbolic constants are used to set bits
+%% in the mask. `Mask' is typically constructed by specifying the bitwise-or of several
+%% of these constants together. The special mask `?GL_CLIENT_ALL_ATTRIB_BITS' can
+%% be used to save all stackable client state.
+%%
+%% The symbolic mask constants and their associated GL client state are as follows (the
+%% second column lists which attributes are saved):
+%%
+%% `?GL_CLIENT_PIXEL_STORE_BIT' Pixel storage modes `?GL_CLIENT_VERTEX_ARRAY_BIT'
+%% Vertex arrays (and enables)
+%%
+%% {@link gl:pushClientAttrib/1} restores the values of the client-state variables saved with
+%% the last ``gl:pushClientAttrib''. Those not saved are left unchanged.
+%%
+%% It is an error to push attributes onto a full client attribute stack or to pop attributes
+%% off an empty stack. In either case, the error flag is set, and no other change is made
+%% to GL state.
+%%
+%% Initially, the client attribute stack is empty.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPushClientAttrib.xml">external</a> documentation.
+-spec pushClientAttrib(Mask) -> ok when Mask :: integer().
+pushClientAttrib(Mask) ->
+ cast(5071, <<Mask:?GLbitfield>>).
-%% @spec ({Red,Green,Blue,Alpha}) -> ok
-%% @equiv color4d(Red,Green,Blue,Alpha)
--spec color4dv({float(),float(),float(),float()}) -> ok.
-color4dv({Red,Green,Blue,Alpha}) -> color4d(Red,Green,Blue,Alpha).
+%% @doc
+%% See {@link pushClientAttrib/1}
+-spec popClientAttrib() -> ok.
+popClientAttrib() ->
+ cast(5072, <<>>).
-%% @spec (Red::float(),Green::float(),Blue::float(),Alpha::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color4f(float(),float(),float(),float()) -> ok.
-color4f(Red,Green,Blue,Alpha) ->
- cast(5065, <<Red:?GLfloat,Green:?GLfloat,Blue:?GLfloat,Alpha:?GLfloat>>).
+%% @doc Set rasterization mode
+%%
+%% ``gl:renderMode'' sets the rasterization mode. It takes one argument, `Mode' , which
+%% can assume one of three predefined values:
+%%
+%% `?GL_RENDER': Render mode. Primitives are rasterized, producing pixel fragments,
+%% which are written into the frame buffer. This is the normal mode and also the default
+%% mode.
+%%
+%% `?GL_SELECT': Selection mode. No pixel fragments are produced, and no change to
+%% the frame buffer contents is made. Instead, a record of the names of primitives that would
+%% have been drawn if the render mode had been `?GL_RENDER' is returned in a select
+%% buffer, which must be created (see {@link gl:selectBuffer/2} ) before selection mode is
+%% entered.
+%%
+%% `?GL_FEEDBACK': Feedback mode. No pixel fragments are produced, and no change to
+%% the frame buffer contents is made. Instead, the coordinates and attributes of vertices
+%% that would have been drawn if the render mode had been `?GL_RENDER' is returned in
+%% a feedback buffer, which must be created (see {@link gl:feedbackBuffer/3} ) before feedback
+%% mode is entered.
+%%
+%% The return value of ``gl:renderMode'' is determined by the render mode at the time ``gl:renderMode''
+%% is called, rather than by `Mode' . The values returned for the three render modes
+%% are as follows:
+%%
+%% `?GL_RENDER': 0.
+%%
+%% `?GL_SELECT': The number of hit records transferred to the select buffer.
+%%
+%% `?GL_FEEDBACK': The number of values (not vertices) transferred to the feedback
+%% buffer.
+%%
+%% See the {@link gl:selectBuffer/2} and {@link gl:feedbackBuffer/3} reference pages for more
+%% details concerning selection and feedback operation.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRenderMode.xml">external</a> documentation.
+-spec renderMode(Mode) -> integer() when Mode :: enum().
+renderMode(Mode) ->
+ call(5073, <<Mode:?GLenum>>).
-%% @spec ({Red,Green,Blue,Alpha}) -> ok
-%% @equiv color4f(Red,Green,Blue,Alpha)
--spec color4fv({float(),float(),float(),float()}) -> ok.
-color4fv({Red,Green,Blue,Alpha}) -> color4f(Red,Green,Blue,Alpha).
+%% @doc Return error information
+%%
+%% ``gl:getError'' returns the value of the error flag. Each detectable error is assigned
+%% a numeric code and symbolic name. When an error occurs, the error flag is set to the appropriate
+%% error code value. No other errors are recorded until ``gl:getError'' is called, the
+%% error code is returned, and the flag is reset to `?GL_NO_ERROR'. If a call to ``gl:getError''
+%% returns `?GL_NO_ERROR', there has been no detectable error since the last call to ``gl:getError''
+%% , or since the GL was initialized.
+%%
+%% To allow for distributed implementations, there may be several error flags. If any single
+%% error flag has recorded an error, the value of that flag is returned and that flag is
+%% reset to `?GL_NO_ERROR' when ``gl:getError'' is called. If more than one flag has
+%% recorded an error, ``gl:getError'' returns and clears an arbitrary error flag value.
+%% Thus, ``gl:getError'' should always be called in a loop, until it returns `?GL_NO_ERROR'
+%% , if all error flags are to be reset.
+%%
+%% Initially, all error flags are set to `?GL_NO_ERROR'.
+%%
+%% The following errors are currently defined:
+%%
+%% `?GL_NO_ERROR': No error has been recorded. The value of this symbolic constant
+%% is guaranteed to be 0.
+%%
+%% `?GL_INVALID_ENUM': An unacceptable value is specified for an enumerated argument.
+%% The offending command is ignored and has no other side effect than to set the error flag.
+%%
+%%
+%% `?GL_INVALID_VALUE': A numeric argument is out of range. The offending command is
+%% ignored and has no other side effect than to set the error flag.
+%%
+%% `?GL_INVALID_OPERATION': The specified operation is not allowed in the current state.
+%% The offending command is ignored and has no other side effect than to set the error flag.
+%%
+%%
+%% `?GL_INVALID_FRAMEBUFFER_OPERATION': The framebuffer object is not complete. The
+%% offending command is ignored and has no other side effect than to set the error flag.
+%%
+%% `?GL_OUT_OF_MEMORY': There is not enough memory left to execute the command. The
+%% state of the GL is undefined, except for the state of the error flags, after this error
+%% is recorded.
+%%
+%% When an error flag is set, results of a GL operation are undefined only if `?GL_OUT_OF_MEMORY'
+%% has occurred. In all other cases, the command generating the error is ignored and has
+%% no effect on the GL state or frame buffer contents. If the generating command returns
+%% a value, it returns 0. If ``gl:getError'' itself generates an error, it returns 0.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetError.xml">external</a> documentation.
+-spec getError() -> enum().
+getError() ->
+ call(5074, <<>>).
-%% @spec (Red::integer(),Green::integer(),Blue::integer(),Alpha::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color4i(integer(),integer(),integer(),integer()) -> ok.
-color4i(Red,Green,Blue,Alpha) ->
- cast(5066, <<Red:?GLint,Green:?GLint,Blue:?GLint,Alpha:?GLint>>).
+%% @doc Return a string describing the current GL connection
+%%
+%% ``gl:getString'' returns a pointer to a static string describing some aspect of the
+%% current GL connection. `Name' can be one of the following:
+%%
+%% `?GL_VENDOR': Returns the company responsible for this GL implementation. This name
+%% does not change from release to release.
+%%
+%% `?GL_RENDERER': Returns the name of the renderer. This name is typically specific
+%% to a particular configuration of a hardware platform. It does not change from release
+%% to release.
+%%
+%% `?GL_VERSION': Returns a version or release number.
+%%
+%% `?GL_SHADING_LANGUAGE_VERSION': Returns a version or release number for the shading
+%% language.
+%%
+%% ``gl:getStringi'' returns a pointer to a static string indexed by `Index' . `Name'
+%% can be one of the following:
+%%
+%% `?GL_EXTENSIONS': For ``gl:getStringi'' only, returns the extension string supported
+%% by the implementation at `Index' .
+%%
+%% Strings `?GL_VENDOR' and `?GL_RENDERER' together uniquely specify a platform.
+%% They do not change from release to release and should be used by platform-recognition
+%% algorithms.
+%%
+%% The `?GL_VERSION' and `?GL_SHADING_LANGUAGE_VERSION' strings begin with a version
+%% number. The version number uses one of these forms:
+%%
+%% `major_number.minor_number'`major_number.minor_number.release_number'
+%%
+%% Vendor-specific information may follow the version number. Its format depends on the
+%% implementation, but a space always separates the version number and the vendor-specific
+%% information.
+%%
+%% All strings are null-terminated.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetString.xml">external</a> documentation.
+-spec getString(Name) -> string() when Name :: enum().
+getString(Name) ->
+ call(5075, <<Name:?GLenum>>).
-%% @spec ({Red,Green,Blue,Alpha}) -> ok
-%% @equiv color4i(Red,Green,Blue,Alpha)
--spec color4iv({integer(),integer(),integer(),integer()}) -> ok.
-color4iv({Red,Green,Blue,Alpha}) -> color4i(Red,Green,Blue,Alpha).
+%% @doc Block until all GL execution is complete
+%%
+%% ``gl:finish'' does not return until the effects of all previously called GL commands
+%% are complete. Such effects include all changes to GL state, all changes to connection
+%% state, and all changes to the frame buffer contents.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFinish.xml">external</a> documentation.
+-spec finish() -> ok.
+finish() ->
+ cast(5076, <<>>).
-%% @spec (Red::integer(),Green::integer(),Blue::integer(),Alpha::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color4s(integer(),integer(),integer(),integer()) -> ok.
-color4s(Red,Green,Blue,Alpha) ->
- cast(5067, <<Red:?GLshort,Green:?GLshort,Blue:?GLshort,Alpha:?GLshort>>).
+%% @doc Force execution of GL commands in finite time
+%%
+%% Different GL implementations buffer commands in several different locations, including
+%% network buffers and the graphics accelerator itself. ``gl:flush'' empties all of these
+%% buffers, causing all issued commands to be executed as quickly as they are accepted by
+%% the actual rendering engine. Though this execution may not be completed in any particular
+%% time period, it does complete in finite time.
+%%
+%% Because any GL program might be executed over a network, or on an accelerator that buffers
+%% commands, all programs should call ``gl:flush'' whenever they count on having all of
+%% their previously issued commands completed. For example, call ``gl:flush'' before waiting
+%% for user input that depends on the generated image.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFlush.xml">external</a> documentation.
+-spec flush() -> ok.
+flush() ->
+ cast(5077, <<>>).
-%% @spec ({Red,Green,Blue,Alpha}) -> ok
-%% @equiv color4s(Red,Green,Blue,Alpha)
--spec color4sv({integer(),integer(),integer(),integer()}) -> ok.
-color4sv({Red,Green,Blue,Alpha}) -> color4s(Red,Green,Blue,Alpha).
+%% @doc Specify implementation-specific hints
+%%
+%% Certain aspects of GL behavior, when there is room for interpretation, can be controlled
+%% with hints. A hint is specified with two arguments. `Target' is a symbolic constant
+%% indicating the behavior to be controlled, and `Mode' is another symbolic constant
+%% indicating the desired behavior. The initial value for each `Target' is `?GL_DONT_CARE'
+%% . `Mode' can be one of the following:
+%%
+%% `?GL_FASTEST': The most efficient option should be chosen.
+%%
+%% `?GL_NICEST': The most correct, or highest quality, option should be chosen.
+%%
+%% `?GL_DONT_CARE': No preference.
+%%
+%% Though the implementation aspects that can be hinted are well defined, the interpretation
+%% of the hints depends on the implementation. The hint aspects that can be specified with `Target'
+%% , along with suggested semantics, are as follows:
+%%
+%% `?GL_FRAGMENT_SHADER_DERIVATIVE_HINT': Indicates the accuracy of the derivative
+%% calculation for the GL shading language fragment processing built-in functions: `?dFdx'
+%% , `?dFdy', and `?fwidth'.
+%%
+%% `?GL_LINE_SMOOTH_HINT': Indicates the sampling quality of antialiased lines. If
+%% a larger filter function is applied, hinting `?GL_NICEST' can result in more pixel
+%% fragments being generated during rasterization.
+%%
+%% `?GL_POLYGON_SMOOTH_HINT': Indicates the sampling quality of antialiased polygons.
+%% Hinting `?GL_NICEST' can result in more pixel fragments being generated during rasterization,
+%% if a larger filter function is applied.
+%%
+%% `?GL_TEXTURE_COMPRESSION_HINT': Indicates the quality and performance of the compressing
+%% texture images. Hinting `?GL_FASTEST' indicates that texture images should be compressed
+%% as quickly as possible, while `?GL_NICEST' indicates that texture images should be
+%% compressed with as little image quality loss as possible. `?GL_NICEST' should be
+%% selected if the texture is to be retrieved by {@link gl:getCompressedTexImage/3} for reuse.
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glHint.xml">external</a> documentation.
+-spec hint(Target, Mode) -> ok when Target :: enum(),Mode :: enum().
+hint(Target,Mode) ->
+ cast(5078, <<Target:?GLenum,Mode:?GLenum>>).
-%% @spec (Red::integer(),Green::integer(),Blue::integer(),Alpha::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color4ub(integer(),integer(),integer(),integer()) -> ok.
-color4ub(Red,Green,Blue,Alpha) ->
- cast(5068, <<Red:?GLubyte,Green:?GLubyte,Blue:?GLubyte,Alpha:?GLubyte>>).
+%% @doc Specify the clear value for the depth buffer
+%%
+%% ``gl:clearDepth'' specifies the depth value used by {@link gl:clear/1} to clear the depth
+%% buffer. Values specified by ``gl:clearDepth'' are clamped to the range [0 1].
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearDepth.xml">external</a> documentation.
+-spec clearDepth(Depth) -> ok when Depth :: clamp().
+clearDepth(Depth) ->
+ cast(5079, <<Depth:?GLclampd>>).
-%% @spec ({Red,Green,Blue,Alpha}) -> ok
-%% @equiv color4ub(Red,Green,Blue,Alpha)
--spec color4ubv({integer(),integer(),integer(),integer()}) -> ok.
-color4ubv({Red,Green,Blue,Alpha}) -> color4ub(Red,Green,Blue,Alpha).
+%% @doc Specify the value used for depth buffer comparisons
+%%
+%% ``gl:depthFunc'' specifies the function used to compare each incoming pixel depth value
+%% with the depth value present in the depth buffer. The comparison is performed only if
+%% depth testing is enabled. (See {@link gl:enable/1} and {@link gl:enable/1} of `?GL_DEPTH_TEST'
+%% .)
+%%
+%% `Func' specifies the conditions under which the pixel will be drawn. The comparison
+%% functions are as follows:
+%%
+%% `?GL_NEVER': Never passes.
+%%
+%% `?GL_LESS': Passes if the incoming depth value is less than the stored depth value.
+%%
+%%
+%% `?GL_EQUAL': Passes if the incoming depth value is equal to the stored depth value.
+%%
+%%
+%% `?GL_LEQUAL': Passes if the incoming depth value is less than or equal to the stored
+%% depth value.
+%%
+%% `?GL_GREATER': Passes if the incoming depth value is greater than the stored depth
+%% value.
+%%
+%% `?GL_NOTEQUAL': Passes if the incoming depth value is not equal to the stored depth
+%% value.
+%%
+%% `?GL_GEQUAL': Passes if the incoming depth value is greater than or equal to the
+%% stored depth value.
+%%
+%% `?GL_ALWAYS': Always passes.
+%%
+%% The initial value of `Func' is `?GL_LESS'. Initially, depth testing is disabled.
+%% If depth testing is disabled or if no depth buffer exists, it is as if the depth test
+%% always passes.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDepthFunc.xml">external</a> documentation.
+-spec depthFunc(Func) -> ok when Func :: enum().
+depthFunc(Func) ->
+ cast(5080, <<Func:?GLenum>>).
-%% @spec (Red::integer(),Green::integer(),Blue::integer(),Alpha::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color4ui(integer(),integer(),integer(),integer()) -> ok.
-color4ui(Red,Green,Blue,Alpha) ->
- cast(5069, <<Red:?GLuint,Green:?GLuint,Blue:?GLuint,Alpha:?GLuint>>).
+%% @doc Enable or disable writing into the depth buffer
+%%
+%% ``gl:depthMask'' specifies whether the depth buffer is enabled for writing. If `Flag'
+%% is `?GL_FALSE', depth buffer writing is disabled. Otherwise, it is enabled. Initially,
+%% depth buffer writing is enabled.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDepthMask.xml">external</a> documentation.
+-spec depthMask(Flag) -> ok when Flag :: 0|1.
+depthMask(Flag) ->
+ cast(5081, <<Flag:?GLboolean>>).
-%% @spec ({Red,Green,Blue,Alpha}) -> ok
-%% @equiv color4ui(Red,Green,Blue,Alpha)
--spec color4uiv({integer(),integer(),integer(),integer()}) -> ok.
-color4uiv({Red,Green,Blue,Alpha}) -> color4ui(Red,Green,Blue,Alpha).
+%% @doc Specify mapping of depth values from normalized device coordinates to window coordinates
+%%
+%% After clipping and division by `w', depth coordinates range from -1 to 1, corresponding
+%% to the near and far clipping planes. ``gl:depthRange'' specifies a linear mapping of
+%% the normalized depth coordinates in this range to window depth coordinates. Regardless
+%% of the actual depth buffer implementation, window coordinate depth values are treated
+%% as though they range from 0 through 1 (like color components). Thus, the values accepted
+%% by ``gl:depthRange'' are both clamped to this range before they are accepted.
+%%
+%% The setting of (0,1) maps the near plane to 0 and the far plane to 1. With this mapping,
+%% the depth buffer range is fully utilized.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDepthRange.xml">external</a> documentation.
+-spec depthRange(Near_val, Far_val) -> ok when Near_val :: clamp(),Far_val :: clamp().
+depthRange(Near_val,Far_val) ->
+ cast(5082, <<Near_val:?GLclampd,Far_val:?GLclampd>>).
-%% @spec (Red::integer(),Green::integer(),Blue::integer(),Alpha::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
--spec color4us(integer(),integer(),integer(),integer()) -> ok.
-color4us(Red,Green,Blue,Alpha) ->
- cast(5070, <<Red:?GLushort,Green:?GLushort,Blue:?GLushort,Alpha:?GLushort>>).
+%% @doc Specify clear values for the accumulation buffer
+%%
+%% ``gl:clearAccum'' specifies the red, green, blue, and alpha values used by {@link gl:clear/1}
+%% to clear the accumulation buffer.
+%%
+%% Values specified by ``gl:clearAccum'' are clamped to the range [-1 1].
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearAccum.xml">external</a> documentation.
+-spec clearAccum(Red, Green, Blue, Alpha) -> ok when Red :: float(),Green :: float(),Blue :: float(),Alpha :: float().
+clearAccum(Red,Green,Blue,Alpha) ->
+ cast(5083, <<Red:?GLfloat,Green:?GLfloat,Blue:?GLfloat,Alpha:?GLfloat>>).
-%% @spec ({Red,Green,Blue,Alpha}) -> ok
-%% @equiv color4us(Red,Green,Blue,Alpha)
--spec color4usv({integer(),integer(),integer(),integer()}) -> ok.
-color4usv({Red,Green,Blue,Alpha}) -> color4us(Red,Green,Blue,Alpha).
+%% @doc Operate on the accumulation buffer
+%%
+%% The accumulation buffer is an extended-range color buffer. Images are not rendered into
+%% it. Rather, images rendered into one of the color buffers are added to the contents of
+%% the accumulation buffer after rendering. Effects such as antialiasing (of points, lines,
+%% and polygons), motion blur, and depth of field can be created by accumulating images generated
+%% with different transformation matrices.
+%%
+%% Each pixel in the accumulation buffer consists of red, green, blue, and alpha values.
+%% The number of bits per component in the accumulation buffer depends on the implementation.
+%% You can examine this number by calling {@link gl:getBooleanv/1} four times, with arguments
+%% `?GL_ACCUM_RED_BITS', `?GL_ACCUM_GREEN_BITS', `?GL_ACCUM_BLUE_BITS', and `?GL_ACCUM_ALPHA_BITS'
+%% . Regardless of the number of bits per component, the range of values stored by each component
+%% is [-1 1]. The accumulation buffer pixels are mapped one-to-one with frame buffer pixels.
+%%
+%% ``gl:accum'' operates on the accumulation buffer. The first argument, `Op' , is
+%% a symbolic constant that selects an accumulation buffer operation. The second argument, `Value'
+%% , is a floating-point value to be used in that operation. Five operations are specified: `?GL_ACCUM'
+%% , `?GL_LOAD', `?GL_ADD', `?GL_MULT', and `?GL_RETURN'.
+%%
+%% All accumulation buffer operations are limited to the area of the current scissor box
+%% and applied identically to the red, green, blue, and alpha components of each pixel. If
+%% a ``gl:accum'' operation results in a value outside the range [-1 1], the contents of an
+%% accumulation buffer pixel component are undefined.
+%%
+%% The operations are as follows:
+%%
+%% `?GL_ACCUM': Obtains R, G, B, and A values from the buffer currently selected for
+%% reading (see {@link gl:readBuffer/1} ). Each component value is divided by 2 n-1, where
+%% n is the number of bits allocated to each color component in the currently selected buffer.
+%% The result is a floating-point value in the range [0 1], which is multiplied by `Value'
+%% and added to the corresponding pixel component in the accumulation buffer, thereby updating
+%% the accumulation buffer.
+%%
+%% `?GL_LOAD': Similar to `?GL_ACCUM', except that the current value in the accumulation
+%% buffer is not used in the calculation of the new value. That is, the R, G, B, and A values
+%% from the currently selected buffer are divided by 2 n-1, multiplied by `Value' ,
+%% and then stored in the corresponding accumulation buffer cell, overwriting the current
+%% value.
+%%
+%% `?GL_ADD': Adds `Value' to each R, G, B, and A in the accumulation buffer.
+%%
+%% `?GL_MULT': Multiplies each R, G, B, and A in the accumulation buffer by `Value'
+%% and returns the scaled component to its corresponding accumulation buffer location.
+%%
+%% `?GL_RETURN': Transfers accumulation buffer values to the color buffer or buffers
+%% currently selected for writing. Each R, G, B, and A component is multiplied by `Value'
+%% , then multiplied by 2 n-1, clamped to the range [0 2 n-1], and stored in the corresponding
+%% display buffer cell. The only fragment operations that are applied to this transfer are
+%% pixel ownership, scissor, dithering, and color writemasks.
+%%
+%% To clear the accumulation buffer, call {@link gl:clearAccum/4} with R, G, B, and A values
+%% to set it to, then call {@link gl:clear/1} with the accumulation buffer enabled.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glAccum.xml">external</a> documentation.
+-spec accum(Op, Value) -> ok when Op :: enum(),Value :: float().
+accum(Op,Value) ->
+ cast(5084, <<Op:?GLenum,Value:?GLfloat>>).
-%% @spec (Red::0|1,Green::0|1,Blue::0|1,Alpha::0|1) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColorMask.xml">external</a> documentation.
--spec colorMask(0|1,0|1,0|1,0|1) -> ok.
-colorMask(Red,Green,Blue,Alpha) ->
- cast(5071, <<Red:?GLboolean,Green:?GLboolean,Blue:?GLboolean,Alpha:?GLboolean>>).
+%% @doc Specify which matrix is the current matrix
+%%
+%% ``gl:matrixMode'' sets the current matrix mode. `Mode' can assume one of four values:
+%%
+%%
+%% `?GL_MODELVIEW': Applies subsequent matrix operations to the modelview matrix stack.
+%%
+%%
+%% `?GL_PROJECTION': Applies subsequent matrix operations to the projection matrix
+%% stack.
+%%
+%% `?GL_TEXTURE': Applies subsequent matrix operations to the texture matrix stack.
+%%
+%% `?GL_COLOR': Applies subsequent matrix operations to the color matrix stack.
+%%
+%% To find out which matrix stack is currently the target of all matrix operations, call {@link gl:getBooleanv/1}
+%% with argument `?GL_MATRIX_MODE'. The initial value is `?GL_MODELVIEW'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMatrixMode.xml">external</a> documentation.
+-spec matrixMode(Mode) -> ok when Mode :: enum().
+matrixMode(Mode) ->
+ cast(5085, <<Mode:?GLenum>>).
-%% @spec (Face::enum(),Mode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColorMaterial.xml">external</a> documentation.
--spec colorMaterial(enum(),enum()) -> ok.
-colorMaterial(Face,Mode) ->
- cast(5072, <<Face:?GLenum,Mode:?GLenum>>).
-
-%% @spec (Size::integer(),Type::enum(),Stride::integer(),Pointer::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColorPointer.xml">external</a> documentation.
--spec colorPointer(integer(),enum(),integer(),offset()|mem()) -> ok.
-colorPointer(Size,Type,Stride,Pointer) when is_integer(Pointer) ->
- cast(5073, <<Size:?GLint,Type:?GLenum,Stride:?GLsizei,Pointer:?GLuint>>);
-colorPointer(Size,Type,Stride,Pointer) ->
- send_bin(Pointer),
- cast(5074, <<Size:?GLint,Type:?GLenum,Stride:?GLsizei>>).
+%% @doc Multiply the current matrix with an orthographic matrix
+%%
+%% ``gl:ortho'' describes a transformation that produces a parallel projection. The current
+%% matrix (see {@link gl:matrixMode/1} ) is multiplied by this matrix and the result replaces
+%% the current matrix, as if {@link gl:multMatrixd/1} were called with the following matrix
+%% as its argument:
+%%
+%% ((2/(right-left)) 0 0(t x) 0(2/(top-bottom)) 0(t y) 0 0(-2/(farVal-nearVal))(t z) 0 0 0 1)
+%%
+%% where t x=-((right+left)/(right-left)) t y=-((top+bottom)/(top-bottom)) t z=-((farVal+nearVal)/(farVal-nearVal))
+%%
+%% Typically, the matrix mode is `?GL_PROJECTION', and (left bottom-nearVal) and (right top-nearVal) specify the points on
+%% the near clipping plane that are mapped to the lower left and upper right corners of the
+%% window, respectively, assuming that the eye is located at (0, 0, 0). -farVal specifies
+%% the location of the far clipping plane. Both `NearVal' and `FarVal' can be either
+%% positive or negative.
+%%
+%% Use {@link gl:pushMatrix/0} and {@link gl:pushMatrix/0} to save and restore the current
+%% matrix stack.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glOrtho.xml">external</a> documentation.
+-spec ortho(Left, Right, Bottom, Top, Near_val, Far_val) -> ok when Left :: float(),Right :: float(),Bottom :: float(),Top :: float(),Near_val :: float(),Far_val :: float().
+ortho(Left,Right,Bottom,Top,Near_val,Far_val) ->
+ cast(5086, <<Left:?GLdouble,Right:?GLdouble,Bottom:?GLdouble,Top:?GLdouble,Near_val:?GLdouble,Far_val:?GLdouble>>).
-%% @spec (X::integer(),Y::integer(),Width::integer(),Height::integer(),Type::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyPixels.xml">external</a> documentation.
--spec copyPixels(integer(),integer(),integer(),integer(),enum()) -> ok.
-copyPixels(X,Y,Width,Height,Type) ->
- cast(5075, <<X:?GLint,Y:?GLint,Width:?GLsizei,Height:?GLsizei,Type:?GLenum>>).
-
-%% @spec (Target::enum(),Level::integer(),InternalFormat::enum(),X::integer(),Y::integer(),Width::integer(),Border::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyTexImage1D.xml">external</a> documentation.
--spec copyTexImage1D(enum(),integer(),enum(),integer(),integer(),integer(),integer()) -> ok.
-copyTexImage1D(Target,Level,InternalFormat,X,Y,Width,Border) ->
- cast(5076, <<Target:?GLenum,Level:?GLint,InternalFormat:?GLenum,X:?GLint,Y:?GLint,Width:?GLsizei,Border:?GLint>>).
-
-%% @spec (Target::enum(),Level::integer(),InternalFormat::enum(),X::integer(),Y::integer(),Width::integer(),Height::integer(),Border::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyTexImage2D.xml">external</a> documentation.
--spec copyTexImage2D(enum(),integer(),enum(),integer(),integer(),integer(),integer(),integer()) -> ok.
-copyTexImage2D(Target,Level,InternalFormat,X,Y,Width,Height,Border) ->
- cast(5077, <<Target:?GLenum,Level:?GLint,InternalFormat:?GLenum,X:?GLint,Y:?GLint,Width:?GLsizei,Height:?GLsizei,Border:?GLint>>).
-
-%% @spec (Target::enum(),Level::integer(),Xoffset::integer(),X::integer(),Y::integer(),Width::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyTexSubImage1D.xml">external</a> documentation.
--spec copyTexSubImage1D(enum(),integer(),integer(),integer(),integer(),integer()) -> ok.
-copyTexSubImage1D(Target,Level,Xoffset,X,Y,Width) ->
- cast(5078, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,X:?GLint,Y:?GLint,Width:?GLsizei>>).
+%% @doc Multiply the current matrix by a perspective matrix
+%%
+%% ``gl:frustum'' describes a perspective matrix that produces a perspective projection.
+%% The current matrix (see {@link gl:matrixMode/1} ) is multiplied by this matrix and the result
+%% replaces the current matrix, as if {@link gl:multMatrixd/1} were called with the following
+%% matrix as its argument:
+%%
+%% [((2 nearVal)/(right-left)) 0 A 0 0((2 nearVal)/(top-bottom)) B 0 0 0 C D 0 0 -1 0]
+%%
+%% A=(right+left)/(right-left)
+%%
+%% B=(top+bottom)/(top-bottom)
+%%
+%% C=-((farVal+nearVal)/(farVal-nearVal))
+%%
+%% D=-((2 farVal nearVal)/(farVal-nearVal))
+%%
+%% Typically, the matrix mode is `?GL_PROJECTION', and (left bottom-nearVal) and (right top-nearVal) specify the points on
+%% the near clipping plane that are mapped to the lower left and upper right corners of the
+%% window, assuming that the eye is located at (0, 0, 0). -farVal specifies the location
+%% of the far clipping plane. Both `NearVal' and `FarVal' must be positive.
+%%
+%% Use {@link gl:pushMatrix/0} and {@link gl:pushMatrix/0} to save and restore the current
+%% matrix stack.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFrustum.xml">external</a> documentation.
+-spec frustum(Left, Right, Bottom, Top, Near_val, Far_val) -> ok when Left :: float(),Right :: float(),Bottom :: float(),Top :: float(),Near_val :: float(),Far_val :: float().
+frustum(Left,Right,Bottom,Top,Near_val,Far_val) ->
+ cast(5087, <<Left:?GLdouble,Right:?GLdouble,Bottom:?GLdouble,Top:?GLdouble,Near_val:?GLdouble,Far_val:?GLdouble>>).
-%% @spec (Target::enum(),Level::integer(),Xoffset::integer(),Yoffset::integer(),X::integer(),Y::integer(),Width::integer(),Height::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyTexSubImage2D.xml">external</a> documentation.
--spec copyTexSubImage2D(enum(),integer(),integer(),integer(),integer(),integer(),integer(),integer()) -> ok.
-copyTexSubImage2D(Target,Level,Xoffset,Yoffset,X,Y,Width,Height) ->
- cast(5079, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Yoffset:?GLint,X:?GLint,Y:?GLint,Width:?GLsizei,Height:?GLsizei>>).
+%% @doc Set the viewport
+%%
+%% ``gl:viewport'' specifies the affine transformation of x and y from normalized device
+%% coordinates to window coordinates. Let (x nd y nd) be normalized device coordinates. Then the window
+%% coordinates (x w y w) are computed as follows:
+%%
+%% x w=(x nd+1) (width/2)+x
+%%
+%% y w=(y nd+1) (height/2)+y
+%%
+%% Viewport width and height are silently clamped to a range that depends on the implementation.
+%% To query this range, call {@link gl:getBooleanv/1} with argument `?GL_MAX_VIEWPORT_DIMS'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glViewport.xml">external</a> documentation.
+-spec viewport(X, Y, Width, Height) -> ok when X :: integer(),Y :: integer(),Width :: integer(),Height :: integer().
+viewport(X,Y,Width,Height) ->
+ cast(5088, <<X:?GLint,Y:?GLint,Width:?GLsizei,Height:?GLsizei>>).
-%% @spec (Mode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCullFace.xml">external</a> documentation.
--spec cullFace(enum()) -> ok.
-cullFace(Mode) ->
- cast(5080, <<Mode:?GLenum>>).
+%% @doc Push and pop the current matrix stack
+%%
+%% There is a stack of matrices for each of the matrix modes. In `?GL_MODELVIEW' mode,
+%% the stack depth is at least 32. In the other modes, `?GL_COLOR', `?GL_PROJECTION'
+%% , and `?GL_TEXTURE', the depth is at least 2. The current matrix in any mode is the
+%% matrix on the top of the stack for that mode.
+%%
+%% ``gl:pushMatrix'' pushes the current matrix stack down by one, duplicating the current
+%% matrix. That is, after a ``gl:pushMatrix'' call, the matrix on top of the stack is identical
+%% to the one below it.
+%%
+%% {@link gl:pushMatrix/0} pops the current matrix stack, replacing the current matrix with
+%% the one below it on the stack.
+%%
+%% Initially, each of the stacks contains one matrix, an identity matrix.
+%%
+%% It is an error to push a full matrix stack or to pop a matrix stack that contains only
+%% a single matrix. In either case, the error flag is set and no other change is made to
+%% GL state.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPushMatrix.xml">external</a> documentation.
+-spec pushMatrix() -> ok.
+pushMatrix() ->
+ cast(5089, <<>>).
-%% @spec (List::integer(),Range::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteLists.xml">external</a> documentation.
--spec deleteLists(integer(),integer()) -> ok.
-deleteLists(List,Range) ->
- cast(5081, <<List:?GLuint,Range:?GLsizei>>).
+%% @doc
+%% See {@link pushMatrix/0}
+-spec popMatrix() -> ok.
+popMatrix() ->
+ cast(5090, <<>>).
-%% @spec (Textures::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteTextures.xml">external</a> documentation.
--spec deleteTextures([integer()]) -> ok.
-deleteTextures(Textures) ->
- cast(5082, <<(length(Textures)):?GLuint,
- (<< <<C:?GLuint>> || C <- Textures>>)/binary,0:(((1+length(Textures)) rem 2)*32)>>).
+%% @doc Replace the current matrix with the identity matrix
+%%
+%% ``gl:loadIdentity'' replaces the current matrix with the identity matrix. It is semantically
+%% equivalent to calling {@link gl:loadMatrixd/1} with the identity matrix
+%%
+%% ((1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1))
+%%
+%% but in some cases it is more efficient.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLoadIdentity.xml">external</a> documentation.
+-spec loadIdentity() -> ok.
+loadIdentity() ->
+ cast(5091, <<>>).
-%% @spec (Func::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDepthFunc.xml">external</a> documentation.
--spec depthFunc(enum()) -> ok.
-depthFunc(Func) ->
- cast(5083, <<Func:?GLenum>>).
+%% @doc Replace the current matrix with the specified matrix
+%%
+%% ``gl:loadMatrix'' replaces the current matrix with the one whose elements are specified
+%% by `M' . The current matrix is the projection matrix, modelview matrix, or texture
+%% matrix, depending on the current matrix mode (see {@link gl:matrixMode/1} ).
+%%
+%% The current matrix, M, defines a transformation of coordinates. For instance, assume
+%% M refers to the modelview matrix. If v=(v[0] v[1] v[2] v[3]) is the set of object coordinates of a vertex,
+%% and `M' points to an array of 16 single- or double-precision floating-point values
+%% m={m[0] m[1] ... m[15]}, then the modelview transformation M(v) does the following:
+%%
+%% M(v)=(m[0] m[4] m[8] m[12] m[1] m[5] m[9] m[13] m[2] m[6] m[10] m[14] m[3] m[7] m[11] m[15])*(v[0] v[1] v[2] v[3])
+%%
+%% Projection and texture transformations are similarly defined.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLoadMatrix.xml">external</a> documentation.
+-spec loadMatrixd(M) -> ok when M :: matrix().
+loadMatrixd({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
+ cast(5092, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,M13:?GLdouble,M14:?GLdouble,M15:?GLdouble,M16:?GLdouble>>);
+loadMatrixd({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
+ cast(5092, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,0:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,0:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,0:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,1:?GLdouble>>).
-%% @spec (Flag::0|1) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDepthMask.xml">external</a> documentation.
--spec depthMask(0|1) -> ok.
-depthMask(Flag) ->
- cast(5084, <<Flag:?GLboolean>>).
+%% @doc
+%% See {@link loadMatrixd/1}
+-spec loadMatrixf(M) -> ok when M :: matrix().
+loadMatrixf({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
+ cast(5093, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,M13:?GLfloat,M14:?GLfloat,M15:?GLfloat,M16:?GLfloat>>);
+loadMatrixf({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
+ cast(5093, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,0:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,0:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,0:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,1:?GLfloat>>).
-%% @spec (ZNear::clamp(),ZFar::clamp()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDepthRange.xml">external</a> documentation.
--spec depthRange(clamp(),clamp()) -> ok.
-depthRange(ZNear,ZFar) ->
- cast(5085, <<ZNear:?GLclampd,ZFar:?GLclampd>>).
+%% @doc Multiply the current matrix with the specified matrix
+%%
+%% ``gl:multMatrix'' multiplies the current matrix with the one specified using `M' ,
+%% and replaces the current matrix with the product.
+%%
+%% The current matrix is determined by the current matrix mode (see {@link gl:matrixMode/1} ).
+%% It is either the projection matrix, modelview matrix, or the texture matrix.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultMatrix.xml">external</a> documentation.
+-spec multMatrixd(M) -> ok when M :: matrix().
+multMatrixd({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
+ cast(5094, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,M13:?GLdouble,M14:?GLdouble,M15:?GLdouble,M16:?GLdouble>>);
+multMatrixd({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
+ cast(5094, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,0:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,0:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,0:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,1:?GLdouble>>).
-%% @spec (Cap::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDisable.xml">external</a> documentation.
--spec disable(enum()) -> ok.
-disable(Cap) ->
- cast(5086, <<Cap:?GLenum>>).
+%% @doc
+%% See {@link multMatrixd/1}
+-spec multMatrixf(M) -> ok when M :: matrix().
+multMatrixf({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
+ cast(5095, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,M13:?GLfloat,M14:?GLfloat,M15:?GLfloat,M16:?GLfloat>>);
+multMatrixf({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
+ cast(5095, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,0:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,0:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,0:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,1:?GLfloat>>).
-%% @spec (Array::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDisableClientState.xml">external</a> documentation.
--spec disableClientState(enum()) -> ok.
-disableClientState(Array) ->
- cast(5087, <<Array:?GLenum>>).
+%% @doc Multiply the current matrix by a rotation matrix
+%%
+%% ``gl:rotate'' produces a rotation of `Angle' degrees around the vector (x y z). The current
+%% matrix (see {@link gl:matrixMode/1} ) is multiplied by a rotation matrix with the product
+%% replacing the current matrix, as if {@link gl:multMatrixd/1} were called with the following
+%% matrix as its argument:
+%%
+%% (x 2(1-c)+c x y(1-c)-z s x z(1-c)+y s 0 y x(1-c)+z s y 2(1-c)+c y z(1-c)-x s 0 x z(1-c)-y s y z(1-c)+x s z 2(1-c)+c 0 0 0 0
+%% 1)
+%%
+%% Where c= cos(angle), s= sin(angle), and ||(x y z)||= 1 (if not, the GL will normalize this vector).
+%%
+%% If the matrix mode is either `?GL_MODELVIEW' or `?GL_PROJECTION', all objects
+%% drawn after ``gl:rotate'' is called are rotated. Use {@link gl:pushMatrix/0} and {@link gl:pushMatrix/0}
+%% to save and restore the unrotated coordinate system.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRotate.xml">external</a> documentation.
+-spec rotated(Angle, X, Y, Z) -> ok when Angle :: float(),X :: float(),Y :: float(),Z :: float().
+rotated(Angle,X,Y,Z) ->
+ cast(5096, <<Angle:?GLdouble,X:?GLdouble,Y:?GLdouble,Z:?GLdouble>>).
-%% @spec (Mode::enum(),First::integer(),Count::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawArrays.xml">external</a> documentation.
--spec drawArrays(enum(),integer(),integer()) -> ok.
-drawArrays(Mode,First,Count) ->
- cast(5088, <<Mode:?GLenum,First:?GLint,Count:?GLsizei>>).
+%% @doc
+%% See {@link rotated/4}
+-spec rotatef(Angle, X, Y, Z) -> ok when Angle :: float(),X :: float(),Y :: float(),Z :: float().
+rotatef(Angle,X,Y,Z) ->
+ cast(5097, <<Angle:?GLfloat,X:?GLfloat,Y:?GLfloat,Z:?GLfloat>>).
-%% @spec (Mode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawBuffer.xml">external</a> documentation.
--spec drawBuffer(enum()) -> ok.
-drawBuffer(Mode) ->
- cast(5089, <<Mode:?GLenum>>).
+%% @doc Multiply the current matrix by a general scaling matrix
+%%
+%% ``gl:scale'' produces a nonuniform scaling along the `x', `y', and `z'
+%% axes. The three parameters indicate the desired scale factor along each of the three axes.
+%%
+%%
+%% The current matrix (see {@link gl:matrixMode/1} ) is multiplied by this scale matrix, and
+%% the product replaces the current matrix as if {@link gl:multMatrixd/1} were called with
+%% the following matrix as its argument:
+%%
+%% (x 0 0 0 0 y 0 0 0 0 z 0 0 0 0 1)
+%%
+%% If the matrix mode is either `?GL_MODELVIEW' or `?GL_PROJECTION', all objects
+%% drawn after ``gl:scale'' is called are scaled.
+%%
+%% Use {@link gl:pushMatrix/0} and {@link gl:pushMatrix/0} to save and restore the unscaled
+%% coordinate system.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glScale.xml">external</a> documentation.
+-spec scaled(X, Y, Z) -> ok when X :: float(),Y :: float(),Z :: float().
+scaled(X,Y,Z) ->
+ cast(5098, <<X:?GLdouble,Y:?GLdouble,Z:?GLdouble>>).
-%% @spec (Mode::enum(),Count::integer(),Type::enum(),Indices::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawElements.xml">external</a> documentation.
--spec drawElements(enum(),integer(),enum(),offset()|mem()) -> ok.
-drawElements(Mode,Count,Type,Indices) when is_integer(Indices) ->
- cast(5090, <<Mode:?GLenum,Count:?GLsizei,Type:?GLenum,Indices:?GLuint>>);
-drawElements(Mode,Count,Type,Indices) ->
- send_bin(Indices),
- cast(5091, <<Mode:?GLenum,Count:?GLsizei,Type:?GLenum>>).
+%% @doc
+%% See {@link scaled/3}
+-spec scalef(X, Y, Z) -> ok when X :: float(),Y :: float(),Z :: float().
+scalef(X,Y,Z) ->
+ cast(5099, <<X:?GLfloat,Y:?GLfloat,Z:?GLfloat>>).
-%% @spec (Width::integer(),Height::integer(),Format::enum(),Type::enum(),Pixels::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawPixels.xml">external</a> documentation.
--spec drawPixels(integer(),integer(),enum(),enum(),offset()|mem()) -> ok.
-drawPixels(Width,Height,Format,Type,Pixels) when is_integer(Pixels) ->
- cast(5092, <<Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum,Pixels:?GLuint>>);
-drawPixels(Width,Height,Format,Type,Pixels) ->
- send_bin(Pixels),
- cast(5093, <<Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum>>).
+%% @doc Multiply the current matrix by a translation matrix
+%%
+%% ``gl:translate'' produces a translation by (x y z). The current matrix (see {@link gl:matrixMode/1}
+%% ) is multiplied by this translation matrix, with the product replacing the current matrix,
+%% as if {@link gl:multMatrixd/1} were called with the following matrix for its argument:
+%%
+%% (1 0 0 x 0 1 0 y 0 0 1 z 0 0 0 1)
+%%
+%% If the matrix mode is either `?GL_MODELVIEW' or `?GL_PROJECTION', all objects
+%% drawn after a call to ``gl:translate'' are translated.
+%%
+%% Use {@link gl:pushMatrix/0} and {@link gl:pushMatrix/0} to save and restore the untranslated
+%% coordinate system.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTranslate.xml">external</a> documentation.
+-spec translated(X, Y, Z) -> ok when X :: float(),Y :: float(),Z :: float().
+translated(X,Y,Z) ->
+ cast(5100, <<X:?GLdouble,Y:?GLdouble,Z:?GLdouble>>).
-%% @spec (Flag::0|1) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEdgeFlag.xml">external</a> documentation.
--spec edgeFlag(0|1) -> ok.
-edgeFlag(Flag) ->
- cast(5094, <<Flag:?GLboolean>>).
-
-%% @spec (Stride::integer(),Pointer::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEdgeFlagPointer.xml">external</a> documentation.
--spec edgeFlagPointer(integer(),offset()|mem()) -> ok.
-edgeFlagPointer(Stride,Pointer) when is_integer(Pointer) ->
- cast(5095, <<Stride:?GLsizei,Pointer:?GLuint>>);
-edgeFlagPointer(Stride,Pointer) ->
- send_bin(Pointer),
- cast(5096, <<Stride:?GLsizei>>).
+%% @doc
+%% See {@link translated/3}
+-spec translatef(X, Y, Z) -> ok when X :: float(),Y :: float(),Z :: float().
+translatef(X,Y,Z) ->
+ cast(5101, <<X:?GLfloat,Y:?GLfloat,Z:?GLfloat>>).
-%% @spec ({Flag}) -> ok
-%% @equiv edgeFlag(Flag)
--spec edgeFlagv({0|1}) -> ok.
-edgeFlagv({Flag}) -> edgeFlag(Flag).
+%% @doc Determine if a name corresponds to a display list
+%%
+%% ``gl:isList'' returns `?GL_TRUE' if `List' is the name of a display list and
+%% returns `?GL_FALSE' if it is not, or if an error occurs.
+%%
+%% A name returned by {@link gl:genLists/1} , but not yet associated with a display list by
+%% calling {@link gl:newList/2} , is not the name of a display list.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsList.xml">external</a> documentation.
+-spec isList(List) -> 0|1 when List :: integer().
+isList(List) ->
+ call(5102, <<List:?GLuint>>).
-%% @spec (Cap::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEnable.xml">external</a> documentation.
--spec enable(enum()) -> ok.
-enable(Cap) ->
- cast(5097, <<Cap:?GLenum>>).
+%% @doc Delete a contiguous group of display lists
+%%
+%% ``gl:deleteLists'' causes a contiguous group of display lists to be deleted. `List'
+%% is the name of the first display list to be deleted, and `Range' is the number of
+%% display lists to delete. All display lists d with list&lt;= d&lt;= list+range-1 are
+%% deleted.
+%%
+%% All storage locations allocated to the specified display lists are freed, and the names
+%% are available for reuse at a later time. Names within the range that do not have an associated
+%% display list are ignored. If `Range' is 0, nothing happens.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteLists.xml">external</a> documentation.
+-spec deleteLists(List, Range) -> ok when List :: integer(),Range :: integer().
+deleteLists(List,Range) ->
+ cast(5103, <<List:?GLuint,Range:?GLsizei>>).
-%% @spec (Array::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEnableClientState.xml">external</a> documentation.
--spec enableClientState(enum()) -> ok.
-enableClientState(Array) ->
- cast(5098, <<Array:?GLenum>>).
+%% @doc Generate a contiguous set of empty display lists
+%%
+%% ``gl:genLists'' has one argument, `Range' . It returns an integer `n' such
+%% that `Range' contiguous empty display lists, named n, n+1, ..., n+range-1,
+%% are created. If `Range' is 0, if there is no group of `Range' contiguous names
+%% available, or if any error is generated, no display lists are generated, and 0 is returned.
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenLists.xml">external</a> documentation.
+-spec genLists(Range) -> integer() when Range :: integer().
+genLists(Range) ->
+ call(5104, <<Range:?GLsizei>>).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEnd.xml">external</a> documentation.
--spec 'end'() -> ok.
-'end'() ->
- cast(5099, <<>>).
+%% @doc Create or replace a display list
+%%
+%% Display lists are groups of GL commands that have been stored for subsequent execution.
+%% Display lists are created with ``gl:newList''. All subsequent commands are placed in
+%% the display list, in the order issued, until {@link gl:endList/0} is called.
+%%
+%% ``gl:newList'' has two arguments. The first argument, `List' , is a positive integer
+%% that becomes the unique name for the display list. Names can be created and reserved with
+%% {@link gl:genLists/1} and tested for uniqueness with {@link gl:isList/1} . The second argument,
+%% `Mode' , is a symbolic constant that can assume one of two values:
+%%
+%% `?GL_COMPILE': Commands are merely compiled.
+%%
+%% `?GL_COMPILE_AND_EXECUTE': Commands are executed as they are compiled into the display
+%% list.
+%%
+%% Certain commands are not compiled into the display list but are executed immediately,
+%% regardless of the display-list mode. These commands are {@link gl:areTexturesResident/1} , {@link gl:colorPointer/4}
+%% , {@link gl:deleteLists/2} , {@link gl:deleteTextures/1} , {@link gl:enableClientState/1} , {@link gl:edgeFlagPointer/2}
+%% , {@link gl:enableClientState/1} , {@link gl:feedbackBuffer/3} , {@link gl:finish/0} , {@link gl:flush/0}
+%% , {@link gl:genLists/1} , {@link gl:genTextures/1} , {@link gl:indexPointer/3} , {@link gl:interleavedArrays/3}
+%% , {@link gl:isEnabled/1} , {@link gl:isList/1} , {@link gl:isTexture/1} , {@link gl:normalPointer/3}
+%% , {@link gl:pushClientAttrib/1} , {@link gl:pixelStoref/2} , {@link gl:pushClientAttrib/1} , {@link gl:readPixels/7}
+%% , {@link gl:renderMode/1} , {@link gl:selectBuffer/2} , {@link gl:texCoordPointer/4} , {@link gl:vertexPointer/4}
+%% , and all of the {@link gl:getBooleanv/1} commands.
+%%
+%% Similarly, {@link gl:texImage1D/8} , {@link gl:texImage2D/9} , and {@link gl:texImage3D/10}
+%% are executed immediately and not compiled into the display list when their first argument
+%% is `?GL_PROXY_TEXTURE_1D', `?GL_PROXY_TEXTURE_1D', or `?GL_PROXY_TEXTURE_3D'
+%% , respectively.
+%%
+%% When the ARB_imaging extension is supported, {@link gl:histogram/4} executes immediately
+%% when its argument is `?GL_PROXY_HISTOGRAM'. Similarly, {@link gl:colorTable/6} executes
+%% immediately when its first argument is `?GL_PROXY_COLOR_TABLE', `?GL_PROXY_POST_CONVOLUTION_COLOR_TABLE'
+%% , or `?GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
+%%
+%% For OpenGL versions 1.3 and greater, or when the ARB_multitexture extension is supported,
+%% {@link gl:clientActiveTexture/1} is not compiled into display lists, but executed immediately.
+%%
+%%
+%% When {@link gl:endList/0} is encountered, the display-list definition is completed by
+%% associating the list with the unique name `List' (specified in the ``gl:newList''
+%% command). If a display list with name `List' already exists, it is replaced only
+%% when {@link gl:endList/0} is called.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glNewList.xml">external</a> documentation.
+-spec newList(List, Mode) -> ok when List :: integer(),Mode :: enum().
+newList(List,Mode) ->
+ cast(5105, <<List:?GLuint,Mode:?GLenum>>).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEndList.xml">external</a> documentation.
+%% @doc glBeginList
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBeginList.xml">external</a> documentation.
-spec endList() -> ok.
endList() ->
- cast(5100, <<>>).
-
-%% @spec (U::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEvalCoord.xml">external</a> documentation.
--spec evalCoord1d(float()) -> ok.
-evalCoord1d(U) ->
- cast(5101, <<U:?GLdouble>>).
-
-%% @spec ({U}) -> ok
-%% @equiv evalCoord1d(U)
--spec evalCoord1dv({float()}) -> ok.
-evalCoord1dv({U}) -> evalCoord1d(U).
-
-%% @spec (U::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEvalCoord.xml">external</a> documentation.
--spec evalCoord1f(float()) -> ok.
-evalCoord1f(U) ->
- cast(5102, <<U:?GLfloat>>).
-
-%% @spec ({U}) -> ok
-%% @equiv evalCoord1f(U)
--spec evalCoord1fv({float()}) -> ok.
-evalCoord1fv({U}) -> evalCoord1f(U).
-
-%% @spec (U::float(),V::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEvalCoord.xml">external</a> documentation.
--spec evalCoord2d(float(),float()) -> ok.
-evalCoord2d(U,V) ->
- cast(5103, <<U:?GLdouble,V:?GLdouble>>).
+ cast(5106, <<>>).
-%% @spec ({U,V}) -> ok
-%% @equiv evalCoord2d(U,V)
--spec evalCoord2dv({float(),float()}) -> ok.
-evalCoord2dv({U,V}) -> evalCoord2d(U,V).
-
-%% @spec (U::float(),V::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEvalCoord.xml">external</a> documentation.
--spec evalCoord2f(float(),float()) -> ok.
-evalCoord2f(U,V) ->
- cast(5104, <<U:?GLfloat,V:?GLfloat>>).
-
-%% @spec ({U,V}) -> ok
-%% @equiv evalCoord2f(U,V)
--spec evalCoord2fv({float(),float()}) -> ok.
-evalCoord2fv({U,V}) -> evalCoord2f(U,V).
-
-%% @spec (Mode::enum(),I1::integer(),I2::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEvalMesh.xml">external</a> documentation.
--spec evalMesh1(enum(),integer(),integer()) -> ok.
-evalMesh1(Mode,I1,I2) ->
- cast(5105, <<Mode:?GLenum,I1:?GLint,I2:?GLint>>).
-
-%% @spec (Mode::enum(),I1::integer(),I2::integer(),J1::integer(),J2::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEvalMesh.xml">external</a> documentation.
--spec evalMesh2(enum(),integer(),integer(),integer(),integer()) -> ok.
-evalMesh2(Mode,I1,I2,J1,J2) ->
- cast(5106, <<Mode:?GLenum,I1:?GLint,I2:?GLint,J1:?GLint,J2:?GLint>>).
-
-%% @spec (I::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEvalPoint.xml">external</a> documentation.
--spec evalPoint1(integer()) -> ok.
-evalPoint1(I) ->
- cast(5107, <<I:?GLint>>).
+%% @doc Execute a display list
+%%
+%% ``gl:callList'' causes the named display list to be executed. The commands saved in
+%% the display list are executed in order, just as if they were called without using a display
+%% list. If `List' has not been defined as a display list, ``gl:callList'' is ignored.
+%%
+%%
+%% ``gl:callList'' can appear inside a display list. To avoid the possibility of infinite
+%% recursion resulting from display lists calling one another, a limit is placed on the nesting
+%% level of display lists during display-list execution. This limit is at least 64, and it
+%% depends on the implementation.
+%%
+%% GL state is not saved and restored across a call to ``gl:callList''. Thus, changes
+%% made to GL state during the execution of a display list remain after execution of the
+%% display list is completed. Use {@link gl:pushAttrib/1} , {@link gl:pushAttrib/1} , {@link gl:pushMatrix/0}
+%% , and {@link gl:pushMatrix/0} to preserve GL state across ``gl:callList'' calls.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCallList.xml">external</a> documentation.
+-spec callList(List) -> ok when List :: integer().
+callList(List) ->
+ cast(5107, <<List:?GLuint>>).
-%% @spec (I::integer(),J::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEvalPoint.xml">external</a> documentation.
--spec evalPoint2(integer(),integer()) -> ok.
-evalPoint2(I,J) ->
- cast(5108, <<I:?GLint,J:?GLint>>).
+%% @doc Execute a list of display lists
+%%
+%% ``gl:callLists'' causes each display list in the list of names passed as `Lists'
+%% to be executed. As a result, the commands saved in each display list are executed in order,
+%% just as if they were called without using a display list. Names of display lists that
+%% have not been defined are ignored.
+%%
+%% ``gl:callLists'' provides an efficient means for executing more than one display list. `Type'
+%% allows lists with various name formats to be accepted. The formats are as follows:
+%%
+%% `?GL_BYTE': `Lists' is treated as an array of signed bytes, each in the range
+%% -128 through 127.
+%%
+%% `?GL_UNSIGNED_BYTE': `Lists' is treated as an array of unsigned bytes, each
+%% in the range 0 through 255.
+%%
+%% `?GL_SHORT': `Lists' is treated as an array of signed two-byte integers, each
+%% in the range -32768 through 32767.
+%%
+%% `?GL_UNSIGNED_SHORT': `Lists' is treated as an array of unsigned two-byte integers,
+%% each in the range 0 through 65535.
+%%
+%% `?GL_INT': `Lists' is treated as an array of signed four-byte integers.
+%%
+%% `?GL_UNSIGNED_INT': `Lists' is treated as an array of unsigned four-byte integers.
+%%
+%%
+%% `?GL_FLOAT': `Lists' is treated as an array of four-byte floating-point values.
+%%
+%%
+%% `?GL_2_BYTES': `Lists' is treated as an array of unsigned bytes. Each pair of
+%% bytes specifies a single display-list name. The value of the pair is computed as 256 times
+%% the unsigned value of the first byte plus the unsigned value of the second byte.
+%%
+%% `?GL_3_BYTES': `Lists' is treated as an array of unsigned bytes. Each triplet
+%% of bytes specifies a single display-list name. The value of the triplet is computed as
+%% 65536 times the unsigned value of the first byte, plus 256 times the unsigned value of
+%% the second byte, plus the unsigned value of the third byte.
+%%
+%% `?GL_4_BYTES': `Lists' is treated as an array of unsigned bytes. Each quadruplet
+%% of bytes specifies a single display-list name. The value of the quadruplet is computed
+%% as 16777216 times the unsigned value of the first byte, plus 65536 times the unsigned
+%% value of the second byte, plus 256 times the unsigned value of the third byte, plus the
+%% unsigned value of the fourth byte.
+%%
+%% The list of display-list names is not null-terminated. Rather, `N' specifies how
+%% many names are to be taken from `Lists' .
+%%
+%% An additional level of indirection is made available with the {@link gl:listBase/1} command,
+%% which specifies an unsigned offset that is added to each display-list name specified in `Lists'
+%% before that display list is executed.
+%%
+%% ``gl:callLists'' can appear inside a display list. To avoid the possibility of infinite
+%% recursion resulting from display lists calling one another, a limit is placed on the nesting
+%% level of display lists during display-list execution. This limit must be at least 64,
+%% and it depends on the implementation.
+%%
+%% GL state is not saved and restored across a call to ``gl:callLists''. Thus, changes
+%% made to GL state during the execution of the display lists remain after execution is completed.
+%% Use {@link gl:pushAttrib/1} , {@link gl:pushAttrib/1} , {@link gl:pushMatrix/0} , and {@link gl:pushMatrix/0}
+%% to preserve GL state across ``gl:callLists'' calls.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCallLists.xml">external</a> documentation.
+-spec callLists(Lists) -> ok when Lists :: [integer()].
+callLists(Lists) ->
+ cast(5108, <<(length(Lists)):?GLuint,
+ (<< <<C:?GLuint>> || C <- Lists>>)/binary,0:(((1+length(Lists)) rem 2)*32)>>).
-%% @spec (Size::integer(),Type::enum(),Buffer::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFeedbackBuffer.xml">external</a> documentation.
--spec feedbackBuffer(integer(),enum(),mem()) -> ok.
-feedbackBuffer(Size,Type,Buffer) ->
- send_bin(Buffer),
- call(5109, <<Size:?GLsizei,Type:?GLenum>>).
+%% @doc set the display-list base for
+%%
+%% {@link gl:callLists/1}
+%%
+%% {@link gl:callLists/1} specifies an array of offsets. Display-list names are generated
+%% by adding `Base' to each offset. Names that reference valid display lists are executed;
+%% the others are ignored.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glListBase.xml">external</a> documentation.
+-spec listBase(Base) -> ok when Base :: integer().
+listBase(Base) ->
+ cast(5109, <<Base:?GLuint>>).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFinish.xml">external</a> documentation.
--spec finish() -> ok.
-finish() ->
- cast(5110, <<>>).
+%% @doc Delimit the vertices of a primitive or a group of like primitives
+%%
+%% ``gl:'begin''' and {@link gl:'begin'/1} delimit the vertices that define a primitive or a group
+%% of like primitives. ``gl:'begin''' accepts a single argument that specifies in which of
+%% ten ways the vertices are interpreted. Taking n as an integer count starting at one,
+%% and N as the total number of vertices specified, the interpretations are as follows:
+%%
+%% `?GL_POINTS': Treats each vertex as a single point. Vertex n defines point n.
+%% N points are drawn.
+%%
+%% `?GL_LINES': Treats each pair of vertices as an independent line segment. Vertices
+%% 2 n-1 and 2 n define line n. N/2 lines are drawn.
+%%
+%% `?GL_LINE_STRIP': Draws a connected group of line segments from the first vertex
+%% to the last. Vertices n and n+1 define line n. N-1 lines are drawn.
+%%
+%% `?GL_LINE_LOOP': Draws a connected group of line segments from the first vertex
+%% to the last, then back to the first. Vertices n and n+1 define line n. The last
+%% line, however, is defined by vertices N and 1. N lines are drawn.
+%%
+%% `?GL_TRIANGLES': Treats each triplet of vertices as an independent triangle. Vertices
+%% 3 n-2, 3 n-1, and 3 n define triangle n. N/3 triangles are drawn.
+%%
+%% `?GL_TRIANGLE_STRIP': Draws a connected group of triangles. One triangle is defined
+%% for each vertex presented after the first two vertices. For odd n, vertices n, n+1,
+%% and n+2 define triangle n. For even n, vertices n+1, n, and n+2 define triangle
+%% n. N-2 triangles are drawn.
+%%
+%% `?GL_TRIANGLE_FAN': Draws a connected group of triangles. One triangle is defined
+%% for each vertex presented after the first two vertices. Vertices 1, n+1, and n+2
+%% define triangle n. N-2 triangles are drawn.
+%%
+%% `?GL_QUADS': Treats each group of four vertices as an independent quadrilateral.
+%% Vertices 4 n-3, 4 n-2, 4 n-1, and 4 n define quadrilateral n. N/4 quadrilaterals
+%% are drawn.
+%%
+%% `?GL_QUAD_STRIP': Draws a connected group of quadrilaterals. One quadrilateral is
+%% defined for each pair of vertices presented after the first pair. Vertices 2 n-1, 2
+%% n, 2 n+2, and 2 n+1 define quadrilateral n. N/2-1 quadrilaterals are drawn. Note
+%% that the order in which vertices are used to construct a quadrilateral from strip data
+%% is different from that used with independent data.
+%%
+%% `?GL_POLYGON': Draws a single, convex polygon. Vertices 1 through N define this
+%% polygon.
+%%
+%% Only a subset of GL commands can be used between ``gl:'begin''' and {@link gl:'begin'/1} .
+%% The commands are {@link gl:vertex2d/2} , {@link gl:color3b/3} , {@link gl:secondaryColor3b/3} , {@link gl:indexd/1}
+%% , {@link gl:normal3b/3} , {@link gl:fogCoordf/1} , {@link gl:texCoord1d/1} , {@link gl:multiTexCoord1d/2}
+%% , {@link gl:vertexAttrib1d/2} , {@link gl:evalCoord1d/1} , {@link gl:evalPoint1/1} , {@link gl:arrayElement/1}
+%% , {@link gl:materialf/3} , and {@link gl:edgeFlag/1} . Also, it is acceptable to use {@link gl:callList/1}
+%% or {@link gl:callLists/1} to execute display lists that include only the preceding commands.
+%% If any other GL command is executed between ``gl:'begin''' and {@link gl:'begin'/1} , the error
+%% flag is set and the command is ignored.
+%%
+%% Regardless of the value chosen for `Mode' , there is no limit to the number of vertices
+%% that can be defined between ``gl:'begin''' and {@link gl:'begin'/1} . Lines, triangles, quadrilaterals,
+%% and polygons that are incompletely specified are not drawn. Incomplete specification results
+%% when either too few vertices are provided to specify even a single primitive or when an
+%% incorrect multiple of vertices is specified. The incomplete primitive is ignored; the
+%% rest are drawn.
+%%
+%% The minimum specification of vertices for each primitive is as follows: 1 for a point,
+%% 2 for a line, 3 for a triangle, 4 for a quadrilateral, and 3 for a polygon. Modes that
+%% require a certain multiple of vertices are `?GL_LINES' (2), `?GL_TRIANGLES'
+%% (3), `?GL_QUADS' (4), and `?GL_QUAD_STRIP' (2).
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBegin.xml">external</a> documentation.
+-spec 'begin'(Mode) -> ok when Mode :: enum().
+'begin'(Mode) ->
+ cast(5110, <<Mode:?GLenum>>).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFlush.xml">external</a> documentation.
--spec flush() -> ok.
-flush() ->
+%% @doc
+%% See {@link 'begin'/1}
+-spec 'end'() -> ok.
+'end'() ->
cast(5111, <<>>).
-%% @spec (Pname::enum(),Param::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFog.xml">external</a> documentation.
--spec fogf(enum(),float()) -> ok.
-fogf(Pname,Param) ->
- cast(5112, <<Pname:?GLenum,Param:?GLfloat>>).
+%% @doc Specify a vertex
+%%
+%% ``gl:vertex'' commands are used within {@link gl:'begin'/1} / {@link gl:'begin'/1} pairs to specify
+%% point, line, and polygon vertices. The current color, normal, texture coordinates, and
+%% fog coordinate are associated with the vertex when ``gl:vertex'' is called.
+%%
+%% When only x and y are specified, z defaults to 0 and w defaults to 1. When x,
+%% y, and z are specified, w defaults to 1.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertex.xml">external</a> documentation.
+-spec vertex2d(X, Y) -> ok when X :: float(),Y :: float().
+vertex2d(X,Y) ->
+ cast(5112, <<X:?GLdouble,Y:?GLdouble>>).
-%% @spec (Pname::enum(),Params::{float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFog.xml">external</a> documentation.
--spec fogfv(enum(),{float()}) -> ok.
-fogfv(Pname,Params) ->
- cast(5113, <<Pname:?GLenum,(size(Params)):?GLuint,
- (<< <<C:?GLfloat>> ||C <- tuple_to_list(Params)>>)/binary,0:(((0+size(Params)) rem 2)*32)>>).
+%% @doc
+%% See {@link vertex2d/2}
+-spec vertex2f(X, Y) -> ok when X :: float(),Y :: float().
+vertex2f(X,Y) ->
+ cast(5113, <<X:?GLfloat,Y:?GLfloat>>).
-%% @spec (Pname::enum(),Param::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFog.xml">external</a> documentation.
--spec fogi(enum(),integer()) -> ok.
-fogi(Pname,Param) ->
- cast(5114, <<Pname:?GLenum,Param:?GLint>>).
+%% @doc
+%% See {@link vertex2d/2}
+-spec vertex2i(X, Y) -> ok when X :: integer(),Y :: integer().
+vertex2i(X,Y) ->
+ cast(5114, <<X:?GLint,Y:?GLint>>).
-%% @spec (Pname::enum(),Params::{integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFog.xml">external</a> documentation.
--spec fogiv(enum(),{integer()}) -> ok.
-fogiv(Pname,Params) ->
- cast(5115, <<Pname:?GLenum,(size(Params)):?GLuint,
- (<< <<C:?GLint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((0+size(Params)) rem 2)*32)>>).
+%% @doc
+%% See {@link vertex2d/2}
+-spec vertex2s(X, Y) -> ok when X :: integer(),Y :: integer().
+vertex2s(X,Y) ->
+ cast(5115, <<X:?GLshort,Y:?GLshort>>).
-%% @spec (Mode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFrontFace.xml">external</a> documentation.
--spec frontFace(enum()) -> ok.
-frontFace(Mode) ->
- cast(5116, <<Mode:?GLenum>>).
+%% @doc
+%% See {@link vertex2d/2}
+-spec vertex3d(X, Y, Z) -> ok when X :: float(),Y :: float(),Z :: float().
+vertex3d(X,Y,Z) ->
+ cast(5116, <<X:?GLdouble,Y:?GLdouble,Z:?GLdouble>>).
-%% @spec (Left::float(),Right::float(),Bottom::float(),Top::float(),ZNear::float(),ZFar::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFrustum.xml">external</a> documentation.
--spec frustum(float(),float(),float(),float(),float(),float()) -> ok.
-frustum(Left,Right,Bottom,Top,ZNear,ZFar) ->
- cast(5117, <<Left:?GLdouble,Right:?GLdouble,Bottom:?GLdouble,Top:?GLdouble,ZNear:?GLdouble,ZFar:?GLdouble>>).
+%% @doc
+%% See {@link vertex2d/2}
+-spec vertex3f(X, Y, Z) -> ok when X :: float(),Y :: float(),Z :: float().
+vertex3f(X,Y,Z) ->
+ cast(5117, <<X:?GLfloat,Y:?GLfloat,Z:?GLfloat>>).
-%% @spec (Range::integer()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenLists.xml">external</a> documentation.
--spec genLists(integer()) -> integer().
-genLists(Range) ->
- call(5118, <<Range:?GLsizei>>).
+%% @doc
+%% See {@link vertex2d/2}
+-spec vertex3i(X, Y, Z) -> ok when X :: integer(),Y :: integer(),Z :: integer().
+vertex3i(X,Y,Z) ->
+ cast(5118, <<X:?GLint,Y:?GLint,Z:?GLint>>).
-%% @spec (N::integer()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenTextures.xml">external</a> documentation.
--spec genTextures(integer()) -> [integer()].
-genTextures(N) ->
- call(5119, <<N:?GLsizei>>).
+%% @doc
+%% See {@link vertex2d/2}
+-spec vertex3s(X, Y, Z) -> ok when X :: integer(),Y :: integer(),Z :: integer().
+vertex3s(X,Y,Z) ->
+ cast(5119, <<X:?GLshort,Y:?GLshort,Z:?GLshort>>).
-%% @spec (Pname::enum()) -> [0|1]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetBooleanv.xml">external</a> documentation.
--spec getBooleanv(enum()) -> [0|1].
-getBooleanv(Pname) ->
- call(5120, <<Pname:?GLenum>>).
+%% @doc
+%% See {@link vertex2d/2}
+-spec vertex4d(X, Y, Z, W) -> ok when X :: float(),Y :: float(),Z :: float(),W :: float().
+vertex4d(X,Y,Z,W) ->
+ cast(5120, <<X:?GLdouble,Y:?GLdouble,Z:?GLdouble,W:?GLdouble>>).
-%% @spec (Plane::enum()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetClipPlane.xml">external</a> documentation.
--spec getClipPlane(enum()) -> {float(),float(),float(),float()}.
-getClipPlane(Plane) ->
- call(5121, <<Plane:?GLenum>>).
+%% @doc
+%% See {@link vertex2d/2}
+-spec vertex4f(X, Y, Z, W) -> ok when X :: float(),Y :: float(),Z :: float(),W :: float().
+vertex4f(X,Y,Z,W) ->
+ cast(5121, <<X:?GLfloat,Y:?GLfloat,Z:?GLfloat,W:?GLfloat>>).
-%% @spec (Pname::enum()) -> [float()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetDoublev.xml">external</a> documentation.
--spec getDoublev(enum()) -> [float()].
-getDoublev(Pname) ->
- call(5122, <<Pname:?GLenum>>).
+%% @doc
+%% See {@link vertex2d/2}
+-spec vertex4i(X, Y, Z, W) -> ok when X :: integer(),Y :: integer(),Z :: integer(),W :: integer().
+vertex4i(X,Y,Z,W) ->
+ cast(5122, <<X:?GLint,Y:?GLint,Z:?GLint,W:?GLint>>).
-%% @spec () -> enum()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetError.xml">external</a> documentation.
--spec getError() -> enum().
-getError() ->
- call(5123, <<>>).
+%% @doc
+%% See {@link vertex2d/2}
+-spec vertex4s(X, Y, Z, W) -> ok when X :: integer(),Y :: integer(),Z :: integer(),W :: integer().
+vertex4s(X,Y,Z,W) ->
+ cast(5123, <<X:?GLshort,Y:?GLshort,Z:?GLshort,W:?GLshort>>).
-%% @spec (Pname::enum()) -> [float()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetFloatv.xml">external</a> documentation.
--spec getFloatv(enum()) -> [float()].
-getFloatv(Pname) ->
- call(5124, <<Pname:?GLenum>>).
+%% @equiv vertex2d(X,Y)
+-spec vertex2dv(V) -> ok when V :: {X :: float(),Y :: float()}.
+vertex2dv({X,Y}) -> vertex2d(X,Y).
-%% @spec (Pname::enum()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetIntegerv.xml">external</a> documentation.
--spec getIntegerv(enum()) -> [integer()].
-getIntegerv(Pname) ->
- call(5125, <<Pname:?GLenum>>).
+%% @equiv vertex2f(X,Y)
+-spec vertex2fv(V) -> ok when V :: {X :: float(),Y :: float()}.
+vertex2fv({X,Y}) -> vertex2f(X,Y).
-%% @spec (Light::enum(),Pname::enum()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetLight.xml">external</a> documentation.
--spec getLightfv(enum(),enum()) -> {float(),float(),float(),float()}.
-getLightfv(Light,Pname) ->
- call(5126, <<Light:?GLenum,Pname:?GLenum>>).
+%% @equiv vertex2i(X,Y)
+-spec vertex2iv(V) -> ok when V :: {X :: integer(),Y :: integer()}.
+vertex2iv({X,Y}) -> vertex2i(X,Y).
-%% @spec (Light::enum(),Pname::enum()) -> {integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetLight.xml">external</a> documentation.
--spec getLightiv(enum(),enum()) -> {integer(),integer(),integer(),integer()}.
-getLightiv(Light,Pname) ->
- call(5127, <<Light:?GLenum,Pname:?GLenum>>).
+%% @equiv vertex2s(X,Y)
+-spec vertex2sv(V) -> ok when V :: {X :: integer(),Y :: integer()}.
+vertex2sv({X,Y}) -> vertex2s(X,Y).
-%% @spec (Target::enum(),Query::enum(),V::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetMap.xml">external</a> documentation.
--spec getMapdv(enum(),enum(),mem()) -> ok.
-getMapdv(Target,Query,V) ->
- send_bin(V),
- call(5128, <<Target:?GLenum,Query:?GLenum>>).
+%% @equiv vertex3d(X,Y,Z)
+-spec vertex3dv(V) -> ok when V :: {X :: float(),Y :: float(),Z :: float()}.
+vertex3dv({X,Y,Z}) -> vertex3d(X,Y,Z).
-%% @spec (Target::enum(),Query::enum(),V::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetMap.xml">external</a> documentation.
--spec getMapfv(enum(),enum(),mem()) -> ok.
-getMapfv(Target,Query,V) ->
- send_bin(V),
- call(5129, <<Target:?GLenum,Query:?GLenum>>).
+%% @equiv vertex3f(X,Y,Z)
+-spec vertex3fv(V) -> ok when V :: {X :: float(),Y :: float(),Z :: float()}.
+vertex3fv({X,Y,Z}) -> vertex3f(X,Y,Z).
-%% @spec (Target::enum(),Query::enum(),V::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetMap.xml">external</a> documentation.
--spec getMapiv(enum(),enum(),mem()) -> ok.
-getMapiv(Target,Query,V) ->
- send_bin(V),
- call(5130, <<Target:?GLenum,Query:?GLenum>>).
+%% @equiv vertex3i(X,Y,Z)
+-spec vertex3iv(V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer()}.
+vertex3iv({X,Y,Z}) -> vertex3i(X,Y,Z).
-%% @spec (Face::enum(),Pname::enum()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetMaterial.xml">external</a> documentation.
--spec getMaterialfv(enum(),enum()) -> {float(),float(),float(),float()}.
-getMaterialfv(Face,Pname) ->
- call(5131, <<Face:?GLenum,Pname:?GLenum>>).
+%% @equiv vertex3s(X,Y,Z)
+-spec vertex3sv(V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer()}.
+vertex3sv({X,Y,Z}) -> vertex3s(X,Y,Z).
-%% @spec (Face::enum(),Pname::enum()) -> {integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetMaterial.xml">external</a> documentation.
--spec getMaterialiv(enum(),enum()) -> {integer(),integer(),integer(),integer()}.
-getMaterialiv(Face,Pname) ->
- call(5132, <<Face:?GLenum,Pname:?GLenum>>).
+%% @equiv vertex4d(X,Y,Z,W)
+-spec vertex4dv(V) -> ok when V :: {X :: float(),Y :: float(),Z :: float(),W :: float()}.
+vertex4dv({X,Y,Z,W}) -> vertex4d(X,Y,Z,W).
-%% @spec (Map::enum(),Values::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetPixelMap.xml">external</a> documentation.
--spec getPixelMapfv(enum(),mem()) -> ok.
-getPixelMapfv(Map,Values) ->
- send_bin(Values),
- call(5133, <<Map:?GLenum>>).
+%% @equiv vertex4f(X,Y,Z,W)
+-spec vertex4fv(V) -> ok when V :: {X :: float(),Y :: float(),Z :: float(),W :: float()}.
+vertex4fv({X,Y,Z,W}) -> vertex4f(X,Y,Z,W).
-%% @spec (Map::enum(),Values::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetPixelMap.xml">external</a> documentation.
--spec getPixelMapuiv(enum(),mem()) -> ok.
-getPixelMapuiv(Map,Values) ->
- send_bin(Values),
- call(5134, <<Map:?GLenum>>).
+%% @equiv vertex4i(X,Y,Z,W)
+-spec vertex4iv(V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer(),W :: integer()}.
+vertex4iv({X,Y,Z,W}) -> vertex4i(X,Y,Z,W).
-%% @spec (Map::enum(),Values::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetPixelMap.xml">external</a> documentation.
--spec getPixelMapusv(enum(),mem()) -> ok.
-getPixelMapusv(Map,Values) ->
- send_bin(Values),
- call(5135, <<Map:?GLenum>>).
+%% @equiv vertex4s(X,Y,Z,W)
+-spec vertex4sv(V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer(),W :: integer()}.
+vertex4sv({X,Y,Z,W}) -> vertex4s(X,Y,Z,W).
-%% @spec () -> binary()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetPolygonStipple.xml">external</a> documentation.
--spec getPolygonStipple() -> binary().
-getPolygonStipple() ->
- call(5136, <<>>).
+%% @doc Set the current normal vector
+%%
+%% The current normal is set to the given coordinates whenever ``gl:normal'' is issued.
+%% Byte, short, or integer arguments are converted to floating-point format with a linear
+%% mapping that maps the most positive representable integer value to 1.0 and the most negative
+%% representable integer value to -1.0.
+%%
+%% Normals specified with ``gl:normal'' need not have unit length. If `?GL_NORMALIZE'
+%% is enabled, then normals of any length specified with ``gl:normal'' are normalized after
+%% transformation. If `?GL_RESCALE_NORMAL' is enabled, normals are scaled by a scaling
+%% factor derived from the modelview matrix. `?GL_RESCALE_NORMAL' requires that the
+%% originally specified normals were of unit length, and that the modelview matrix contain
+%% only uniform scales for proper results. To enable and disable normalization, call {@link gl:enable/1}
+%% and {@link gl:enable/1} with either `?GL_NORMALIZE' or `?GL_RESCALE_NORMAL'.
+%% Normalization is initially disabled.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glNormal.xml">external</a> documentation.
+-spec normal3b(Nx, Ny, Nz) -> ok when Nx :: integer(),Ny :: integer(),Nz :: integer().
+normal3b(Nx,Ny,Nz) ->
+ cast(5124, <<Nx:?GLbyte,Ny:?GLbyte,Nz:?GLbyte>>).
-%% @spec (Name::enum()) -> string()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetString.xml">external</a> documentation.
--spec getString(enum()) -> string().
-getString(Name) ->
- call(5137, <<Name:?GLenum>>).
+%% @doc
+%% See {@link normal3b/3}
+-spec normal3d(Nx, Ny, Nz) -> ok when Nx :: float(),Ny :: float(),Nz :: float().
+normal3d(Nx,Ny,Nz) ->
+ cast(5125, <<Nx:?GLdouble,Ny:?GLdouble,Nz:?GLdouble>>).
-%% @spec (Target::enum(),Pname::enum()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexEnv.xml">external</a> documentation.
--spec getTexEnvfv(enum(),enum()) -> {float(),float(),float(),float()}.
-getTexEnvfv(Target,Pname) ->
- call(5138, <<Target:?GLenum,Pname:?GLenum>>).
+%% @doc
+%% See {@link normal3b/3}
+-spec normal3f(Nx, Ny, Nz) -> ok when Nx :: float(),Ny :: float(),Nz :: float().
+normal3f(Nx,Ny,Nz) ->
+ cast(5126, <<Nx:?GLfloat,Ny:?GLfloat,Nz:?GLfloat>>).
-%% @spec (Target::enum(),Pname::enum()) -> {integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexEnv.xml">external</a> documentation.
--spec getTexEnviv(enum(),enum()) -> {integer(),integer(),integer(),integer()}.
-getTexEnviv(Target,Pname) ->
- call(5139, <<Target:?GLenum,Pname:?GLenum>>).
+%% @doc
+%% See {@link normal3b/3}
+-spec normal3i(Nx, Ny, Nz) -> ok when Nx :: integer(),Ny :: integer(),Nz :: integer().
+normal3i(Nx,Ny,Nz) ->
+ cast(5127, <<Nx:?GLint,Ny:?GLint,Nz:?GLint>>).
-%% @spec (Coord::enum(),Pname::enum()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexGen.xml">external</a> documentation.
--spec getTexGendv(enum(),enum()) -> {float(),float(),float(),float()}.
-getTexGendv(Coord,Pname) ->
- call(5140, <<Coord:?GLenum,Pname:?GLenum>>).
+%% @doc
+%% See {@link normal3b/3}
+-spec normal3s(Nx, Ny, Nz) -> ok when Nx :: integer(),Ny :: integer(),Nz :: integer().
+normal3s(Nx,Ny,Nz) ->
+ cast(5128, <<Nx:?GLshort,Ny:?GLshort,Nz:?GLshort>>).
-%% @spec (Coord::enum(),Pname::enum()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexGen.xml">external</a> documentation.
--spec getTexGenfv(enum(),enum()) -> {float(),float(),float(),float()}.
-getTexGenfv(Coord,Pname) ->
- call(5141, <<Coord:?GLenum,Pname:?GLenum>>).
+%% @equiv normal3b(Nx,Ny,Nz)
+-spec normal3bv(V) -> ok when V :: {Nx :: integer(),Ny :: integer(),Nz :: integer()}.
+normal3bv({Nx,Ny,Nz}) -> normal3b(Nx,Ny,Nz).
-%% @spec (Coord::enum(),Pname::enum()) -> {integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexGen.xml">external</a> documentation.
--spec getTexGeniv(enum(),enum()) -> {integer(),integer(),integer(),integer()}.
-getTexGeniv(Coord,Pname) ->
- call(5142, <<Coord:?GLenum,Pname:?GLenum>>).
+%% @equiv normal3d(Nx,Ny,Nz)
+-spec normal3dv(V) -> ok when V :: {Nx :: float(),Ny :: float(),Nz :: float()}.
+normal3dv({Nx,Ny,Nz}) -> normal3d(Nx,Ny,Nz).
-%% @spec (Target::enum(),Level::integer(),Format::enum(),Type::enum(),Pixels::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexImage.xml">external</a> documentation.
--spec getTexImage(enum(),integer(),enum(),enum(),mem()) -> ok.
-getTexImage(Target,Level,Format,Type,Pixels) ->
- send_bin(Pixels),
- call(5143, <<Target:?GLenum,Level:?GLint,Format:?GLenum,Type:?GLenum>>).
+%% @equiv normal3f(Nx,Ny,Nz)
+-spec normal3fv(V) -> ok when V :: {Nx :: float(),Ny :: float(),Nz :: float()}.
+normal3fv({Nx,Ny,Nz}) -> normal3f(Nx,Ny,Nz).
-%% @spec (Target::enum(),Level::integer(),Pname::enum()) -> {float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexLevelParameter.xml">external</a> documentation.
--spec getTexLevelParameterfv(enum(),integer(),enum()) -> {float()}.
-getTexLevelParameterfv(Target,Level,Pname) ->
- call(5144, <<Target:?GLenum,Level:?GLint,Pname:?GLenum>>).
+%% @equiv normal3i(Nx,Ny,Nz)
+-spec normal3iv(V) -> ok when V :: {Nx :: integer(),Ny :: integer(),Nz :: integer()}.
+normal3iv({Nx,Ny,Nz}) -> normal3i(Nx,Ny,Nz).
-%% @spec (Target::enum(),Level::integer(),Pname::enum()) -> {integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexLevelParameter.xml">external</a> documentation.
--spec getTexLevelParameteriv(enum(),integer(),enum()) -> {integer()}.
-getTexLevelParameteriv(Target,Level,Pname) ->
- call(5145, <<Target:?GLenum,Level:?GLint,Pname:?GLenum>>).
+%% @equiv normal3s(Nx,Ny,Nz)
+-spec normal3sv(V) -> ok when V :: {Nx :: integer(),Ny :: integer(),Nz :: integer()}.
+normal3sv({Nx,Ny,Nz}) -> normal3s(Nx,Ny,Nz).
-%% @spec (Target::enum(),Pname::enum()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexParameter.xml">external</a> documentation.
--spec getTexParameterfv(enum(),enum()) -> {float(),float(),float(),float()}.
-getTexParameterfv(Target,Pname) ->
- call(5146, <<Target:?GLenum,Pname:?GLenum>>).
+%% @doc Set the current color index
+%%
+%% ``gl:index'' updates the current (single-valued) color index. It takes one argument,
+%% the new value for the current color index.
+%%
+%% The current index is stored as a floating-point value. Integer values are converted directly
+%% to floating-point values, with no special mapping. The initial value is 1.
+%%
+%% Index values outside the representable range of the color index buffer are not clamped.
+%% However, before an index is dithered (if enabled) and written to the frame buffer, it
+%% is converted to fixed-point format. Any bits in the integer portion of the resulting fixed-point
+%% value that do not correspond to bits in the frame buffer are masked out.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIndex.xml">external</a> documentation.
+-spec indexd(C) -> ok when C :: float().
+indexd(C) ->
+ cast(5129, <<C:?GLdouble>>).
-%% @spec (Target::enum(),Pname::enum()) -> {integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexParameter.xml">external</a> documentation.
--spec getTexParameteriv(enum(),enum()) -> {integer(),integer(),integer(),integer()}.
-getTexParameteriv(Target,Pname) ->
- call(5147, <<Target:?GLenum,Pname:?GLenum>>).
+%% @doc
+%% See {@link indexd/1}
+-spec indexf(C) -> ok when C :: float().
+indexf(C) ->
+ cast(5130, <<C:?GLfloat>>).
-%% @spec (Target::enum(),Mode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glHint.xml">external</a> documentation.
--spec hint(enum(),enum()) -> ok.
-hint(Target,Mode) ->
- cast(5148, <<Target:?GLenum,Mode:?GLenum>>).
+%% @doc
+%% See {@link indexd/1}
+-spec indexi(C) -> ok when C :: integer().
+indexi(C) ->
+ cast(5131, <<C:?GLint>>).
-%% @spec (Mask::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIndexMask.xml">external</a> documentation.
--spec indexMask(integer()) -> ok.
-indexMask(Mask) ->
- cast(5149, <<Mask:?GLuint>>).
-
-%% @spec (Type::enum(),Stride::integer(),Pointer::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIndexPointer.xml">external</a> documentation.
--spec indexPointer(enum(),integer(),offset()|mem()) -> ok.
-indexPointer(Type,Stride,Pointer) when is_integer(Pointer) ->
- cast(5150, <<Type:?GLenum,Stride:?GLsizei,Pointer:?GLuint>>);
-indexPointer(Type,Stride,Pointer) ->
- send_bin(Pointer),
- cast(5151, <<Type:?GLenum,Stride:?GLsizei>>).
+%% @doc
+%% See {@link indexd/1}
+-spec indexs(C) -> ok when C :: integer().
+indexs(C) ->
+ cast(5132, <<C:?GLshort>>).
-%% @spec (C::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIndex.xml">external</a> documentation.
--spec indexd(float()) -> ok.
-indexd(C) ->
- cast(5152, <<C:?GLdouble>>).
+%% @doc
+%% See {@link indexd/1}
+-spec indexub(C) -> ok when C :: integer().
+indexub(C) ->
+ cast(5133, <<C:?GLubyte>>).
-%% @spec ({C}) -> ok
%% @equiv indexd(C)
--spec indexdv({float()}) -> ok.
+-spec indexdv(C) -> ok when C :: {C :: float()}.
indexdv({C}) -> indexd(C).
-%% @spec (C::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIndex.xml">external</a> documentation.
--spec indexf(float()) -> ok.
-indexf(C) ->
- cast(5153, <<C:?GLfloat>>).
-
-%% @spec ({C}) -> ok
%% @equiv indexf(C)
--spec indexfv({float()}) -> ok.
+-spec indexfv(C) -> ok when C :: {C :: float()}.
indexfv({C}) -> indexf(C).
-%% @spec (C::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIndex.xml">external</a> documentation.
--spec indexi(integer()) -> ok.
-indexi(C) ->
- cast(5154, <<C:?GLint>>).
-
-%% @spec ({C}) -> ok
%% @equiv indexi(C)
--spec indexiv({integer()}) -> ok.
+-spec indexiv(C) -> ok when C :: {C :: integer()}.
indexiv({C}) -> indexi(C).
-%% @spec (C::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIndex.xml">external</a> documentation.
--spec indexs(integer()) -> ok.
-indexs(C) ->
- cast(5155, <<C:?GLshort>>).
-
-%% @spec ({C}) -> ok
%% @equiv indexs(C)
--spec indexsv({integer()}) -> ok.
+-spec indexsv(C) -> ok when C :: {C :: integer()}.
indexsv({C}) -> indexs(C).
-%% @spec (C::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIndex.xml">external</a> documentation.
--spec indexub(integer()) -> ok.
-indexub(C) ->
- cast(5156, <<C:?GLubyte>>).
-
-%% @spec ({C}) -> ok
%% @equiv indexub(C)
--spec indexubv({integer()}) -> ok.
+-spec indexubv(C) -> ok when C :: {C :: integer()}.
indexubv({C}) -> indexub(C).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glInitNames.xml">external</a> documentation.
--spec initNames() -> ok.
-initNames() ->
- cast(5157, <<>>).
+%% @doc Set the current color
+%%
+%% The GL stores both a current single-valued color index and a current four-valued RGBA
+%% color. ``gl:color'' sets a new four-valued RGBA color. ``gl:color'' has two major
+%% variants: ``gl:color3'' and ``gl:color4''. ``gl:color3'' variants specify new red,
+%% green, and blue values explicitly and set the current alpha value to 1.0 (full intensity)
+%% implicitly. ``gl:color4'' variants specify all four color components explicitly.
+%%
+%% ``gl:color3b'', ``gl:color4b'', ``gl:color3s'', ``gl:color4s'', ``gl:color3i'',
+%% and ``gl:color4i'' take three or four signed byte, short, or long integers as arguments.
+%% When `v' is appended to the name, the color commands can take a pointer to an array
+%% of such values.
+%%
+%% Current color values are stored in floating-point format, with unspecified mantissa and
+%% exponent sizes. Unsigned integer color components, when specified, are linearly mapped
+%% to floating-point values such that the largest representable value maps to 1.0 (full intensity),
+%% and 0 maps to 0.0 (zero intensity). Signed integer color components, when specified, are
+%% linearly mapped to floating-point values such that the most positive representable value
+%% maps to 1.0, and the most negative representable value maps to -1.0. (Note that this
+%% mapping does not convert 0 precisely to 0.0.) Floating-point values are mapped directly.
+%%
+%% Neither floating-point nor signed integer values are clamped to the range [0 1] before the
+%% current color is updated. However, color components are clamped to this range before they
+%% are interpolated or written into a color buffer.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColor.xml">external</a> documentation.
+-spec color3b(Red, Green, Blue) -> ok when Red :: integer(),Green :: integer(),Blue :: integer().
+color3b(Red,Green,Blue) ->
+ cast(5134, <<Red:?GLbyte,Green:?GLbyte,Blue:?GLbyte>>).
-%% @spec (Format::enum(),Stride::integer(),Pointer::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glInterleavedArrays.xml">external</a> documentation.
--spec interleavedArrays(enum(),integer(),offset()|mem()) -> ok.
-interleavedArrays(Format,Stride,Pointer) when is_integer(Pointer) ->
- cast(5158, <<Format:?GLenum,Stride:?GLsizei,Pointer:?GLuint>>);
-interleavedArrays(Format,Stride,Pointer) ->
- send_bin(Pointer),
- cast(5159, <<Format:?GLenum,Stride:?GLsizei>>).
+%% @doc
+%% See {@link color3b/3}
+-spec color3d(Red, Green, Blue) -> ok when Red :: float(),Green :: float(),Blue :: float().
+color3d(Red,Green,Blue) ->
+ cast(5135, <<Red:?GLdouble,Green:?GLdouble,Blue:?GLdouble>>).
-%% @spec (Cap::enum()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsEnabled.xml">external</a> documentation.
--spec isEnabled(enum()) -> 0|1.
-isEnabled(Cap) ->
- call(5160, <<Cap:?GLenum>>).
+%% @doc
+%% See {@link color3b/3}
+-spec color3f(Red, Green, Blue) -> ok when Red :: float(),Green :: float(),Blue :: float().
+color3f(Red,Green,Blue) ->
+ cast(5136, <<Red:?GLfloat,Green:?GLfloat,Blue:?GLfloat>>).
-%% @spec (List::integer()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsList.xml">external</a> documentation.
--spec isList(integer()) -> 0|1.
-isList(List) ->
- call(5161, <<List:?GLuint>>).
+%% @doc
+%% See {@link color3b/3}
+-spec color3i(Red, Green, Blue) -> ok when Red :: integer(),Green :: integer(),Blue :: integer().
+color3i(Red,Green,Blue) ->
+ cast(5137, <<Red:?GLint,Green:?GLint,Blue:?GLint>>).
-%% @spec (Texture::integer()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsTexture.xml">external</a> documentation.
--spec isTexture(integer()) -> 0|1.
-isTexture(Texture) ->
- call(5162, <<Texture:?GLuint>>).
+%% @doc
+%% See {@link color3b/3}
+-spec color3s(Red, Green, Blue) -> ok when Red :: integer(),Green :: integer(),Blue :: integer().
+color3s(Red,Green,Blue) ->
+ cast(5138, <<Red:?GLshort,Green:?GLshort,Blue:?GLshort>>).
-%% @spec (Pname::enum(),Param::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLightModel.xml">external</a> documentation.
--spec lightModelf(enum(),float()) -> ok.
-lightModelf(Pname,Param) ->
- cast(5163, <<Pname:?GLenum,Param:?GLfloat>>).
+%% @doc
+%% See {@link color3b/3}
+-spec color3ub(Red, Green, Blue) -> ok when Red :: integer(),Green :: integer(),Blue :: integer().
+color3ub(Red,Green,Blue) ->
+ cast(5139, <<Red:?GLubyte,Green:?GLubyte,Blue:?GLubyte>>).
-%% @spec (Pname::enum(),Params::{float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLightModel.xml">external</a> documentation.
--spec lightModelfv(enum(),{float()}) -> ok.
-lightModelfv(Pname,Params) ->
- cast(5164, <<Pname:?GLenum,(size(Params)):?GLuint,
- (<< <<C:?GLfloat>> ||C <- tuple_to_list(Params)>>)/binary,0:(((0+size(Params)) rem 2)*32)>>).
+%% @doc
+%% See {@link color3b/3}
+-spec color3ui(Red, Green, Blue) -> ok when Red :: integer(),Green :: integer(),Blue :: integer().
+color3ui(Red,Green,Blue) ->
+ cast(5140, <<Red:?GLuint,Green:?GLuint,Blue:?GLuint>>).
-%% @spec (Pname::enum(),Param::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLightModel.xml">external</a> documentation.
--spec lightModeli(enum(),integer()) -> ok.
-lightModeli(Pname,Param) ->
- cast(5165, <<Pname:?GLenum,Param:?GLint>>).
+%% @doc
+%% See {@link color3b/3}
+-spec color3us(Red, Green, Blue) -> ok when Red :: integer(),Green :: integer(),Blue :: integer().
+color3us(Red,Green,Blue) ->
+ cast(5141, <<Red:?GLushort,Green:?GLushort,Blue:?GLushort>>).
-%% @spec (Pname::enum(),Params::{integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLightModel.xml">external</a> documentation.
--spec lightModeliv(enum(),{integer()}) -> ok.
-lightModeliv(Pname,Params) ->
- cast(5166, <<Pname:?GLenum,(size(Params)):?GLuint,
- (<< <<C:?GLint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((0+size(Params)) rem 2)*32)>>).
+%% @doc
+%% See {@link color3b/3}
+-spec color4b(Red, Green, Blue, Alpha) -> ok when Red :: integer(),Green :: integer(),Blue :: integer(),Alpha :: integer().
+color4b(Red,Green,Blue,Alpha) ->
+ cast(5142, <<Red:?GLbyte,Green:?GLbyte,Blue:?GLbyte,Alpha:?GLbyte>>).
-%% @spec (Light::enum(),Pname::enum(),Param::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLight.xml">external</a> documentation.
--spec lightf(enum(),enum(),float()) -> ok.
-lightf(Light,Pname,Param) ->
- cast(5167, <<Light:?GLenum,Pname:?GLenum,Param:?GLfloat>>).
+%% @doc
+%% See {@link color3b/3}
+-spec color4d(Red, Green, Blue, Alpha) -> ok when Red :: float(),Green :: float(),Blue :: float(),Alpha :: float().
+color4d(Red,Green,Blue,Alpha) ->
+ cast(5143, <<Red:?GLdouble,Green:?GLdouble,Blue:?GLdouble,Alpha:?GLdouble>>).
-%% @spec (Light::enum(),Pname::enum(),Params::{float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLight.xml">external</a> documentation.
--spec lightfv(enum(),enum(),{float()}) -> ok.
-lightfv(Light,Pname,Params) ->
- cast(5168, <<Light:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
- (<< <<C:?GLfloat>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
+%% @doc
+%% See {@link color3b/3}
+-spec color4f(Red, Green, Blue, Alpha) -> ok when Red :: float(),Green :: float(),Blue :: float(),Alpha :: float().
+color4f(Red,Green,Blue,Alpha) ->
+ cast(5144, <<Red:?GLfloat,Green:?GLfloat,Blue:?GLfloat,Alpha:?GLfloat>>).
-%% @spec (Light::enum(),Pname::enum(),Param::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLight.xml">external</a> documentation.
--spec lighti(enum(),enum(),integer()) -> ok.
-lighti(Light,Pname,Param) ->
- cast(5169, <<Light:?GLenum,Pname:?GLenum,Param:?GLint>>).
+%% @doc
+%% See {@link color3b/3}
+-spec color4i(Red, Green, Blue, Alpha) -> ok when Red :: integer(),Green :: integer(),Blue :: integer(),Alpha :: integer().
+color4i(Red,Green,Blue,Alpha) ->
+ cast(5145, <<Red:?GLint,Green:?GLint,Blue:?GLint,Alpha:?GLint>>).
-%% @spec (Light::enum(),Pname::enum(),Params::{integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLight.xml">external</a> documentation.
--spec lightiv(enum(),enum(),{integer()}) -> ok.
-lightiv(Light,Pname,Params) ->
- cast(5170, <<Light:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
- (<< <<C:?GLint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
+%% @doc
+%% See {@link color3b/3}
+-spec color4s(Red, Green, Blue, Alpha) -> ok when Red :: integer(),Green :: integer(),Blue :: integer(),Alpha :: integer().
+color4s(Red,Green,Blue,Alpha) ->
+ cast(5146, <<Red:?GLshort,Green:?GLshort,Blue:?GLshort,Alpha:?GLshort>>).
-%% @spec (Factor::integer(),Pattern::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLineStipple.xml">external</a> documentation.
--spec lineStipple(integer(),integer()) -> ok.
-lineStipple(Factor,Pattern) ->
- cast(5171, <<Factor:?GLint,Pattern:?GLushort>>).
+%% @doc
+%% See {@link color3b/3}
+-spec color4ub(Red, Green, Blue, Alpha) -> ok when Red :: integer(),Green :: integer(),Blue :: integer(),Alpha :: integer().
+color4ub(Red,Green,Blue,Alpha) ->
+ cast(5147, <<Red:?GLubyte,Green:?GLubyte,Blue:?GLubyte,Alpha:?GLubyte>>).
-%% @spec (Width::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLineWidth.xml">external</a> documentation.
--spec lineWidth(float()) -> ok.
-lineWidth(Width) ->
- cast(5172, <<Width:?GLfloat>>).
+%% @doc
+%% See {@link color3b/3}
+-spec color4ui(Red, Green, Blue, Alpha) -> ok when Red :: integer(),Green :: integer(),Blue :: integer(),Alpha :: integer().
+color4ui(Red,Green,Blue,Alpha) ->
+ cast(5148, <<Red:?GLuint,Green:?GLuint,Blue:?GLuint,Alpha:?GLuint>>).
-%% @spec (Base::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glListBase.xml">external</a> documentation.
--spec listBase(integer()) -> ok.
-listBase(Base) ->
- cast(5173, <<Base:?GLuint>>).
+%% @doc
+%% See {@link color3b/3}
+-spec color4us(Red, Green, Blue, Alpha) -> ok when Red :: integer(),Green :: integer(),Blue :: integer(),Alpha :: integer().
+color4us(Red,Green,Blue,Alpha) ->
+ cast(5149, <<Red:?GLushort,Green:?GLushort,Blue:?GLushort,Alpha:?GLushort>>).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLoadIdentity.xml">external</a> documentation.
--spec loadIdentity() -> ok.
-loadIdentity() ->
- cast(5174, <<>>).
+%% @equiv color3b(Red,Green,Blue)
+-spec color3bv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer()}.
+color3bv({Red,Green,Blue}) -> color3b(Red,Green,Blue).
-%% @spec (M::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLoadMatrix.xml">external</a> documentation.
--spec loadMatrixd({float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok.
-loadMatrixd({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
- cast(5175, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,M13:?GLdouble,M14:?GLdouble,M15:?GLdouble,M16:?GLdouble>>);
-loadMatrixd({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
- cast(5175, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,0:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,0:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,0:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,1:?GLdouble>>).
+%% @equiv color3d(Red,Green,Blue)
+-spec color3dv(V) -> ok when V :: {Red :: float(),Green :: float(),Blue :: float()}.
+color3dv({Red,Green,Blue}) -> color3d(Red,Green,Blue).
-%% @spec (M::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLoadMatrix.xml">external</a> documentation.
--spec loadMatrixf({float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok.
-loadMatrixf({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
- cast(5176, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,M13:?GLfloat,M14:?GLfloat,M15:?GLfloat,M16:?GLfloat>>);
-loadMatrixf({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
- cast(5176, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,0:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,0:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,0:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,1:?GLfloat>>).
+%% @equiv color3f(Red,Green,Blue)
+-spec color3fv(V) -> ok when V :: {Red :: float(),Green :: float(),Blue :: float()}.
+color3fv({Red,Green,Blue}) -> color3f(Red,Green,Blue).
-%% @spec (Name::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLoadName.xml">external</a> documentation.
--spec loadName(integer()) -> ok.
-loadName(Name) ->
- cast(5177, <<Name:?GLuint>>).
+%% @equiv color3i(Red,Green,Blue)
+-spec color3iv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer()}.
+color3iv({Red,Green,Blue}) -> color3i(Red,Green,Blue).
-%% @spec (Opcode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLogicOp.xml">external</a> documentation.
--spec logicOp(enum()) -> ok.
-logicOp(Opcode) ->
- cast(5178, <<Opcode:?GLenum>>).
+%% @equiv color3s(Red,Green,Blue)
+-spec color3sv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer()}.
+color3sv({Red,Green,Blue}) -> color3s(Red,Green,Blue).
-%% @spec (Target::enum(),U1::float(),U2::float(),Stride::integer(),Order::integer(),Points::binary()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMap.xml">external</a> documentation.
--spec map1d(enum(),float(),float(),integer(),integer(),binary()) -> ok.
-map1d(Target,U1,U2,Stride,Order,Points) ->
- send_bin(Points),
- cast(5179, <<Target:?GLenum,0:32,U1:?GLdouble,U2:?GLdouble,Stride:?GLint,Order:?GLint>>).
+%% @equiv color3ub(Red,Green,Blue)
+-spec color3ubv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer()}.
+color3ubv({Red,Green,Blue}) -> color3ub(Red,Green,Blue).
-%% @spec (Target::enum(),U1::float(),U2::float(),Stride::integer(),Order::integer(),Points::binary()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMap.xml">external</a> documentation.
--spec map1f(enum(),float(),float(),integer(),integer(),binary()) -> ok.
-map1f(Target,U1,U2,Stride,Order,Points) ->
- send_bin(Points),
- cast(5180, <<Target:?GLenum,U1:?GLfloat,U2:?GLfloat,Stride:?GLint,Order:?GLint>>).
+%% @equiv color3ui(Red,Green,Blue)
+-spec color3uiv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer()}.
+color3uiv({Red,Green,Blue}) -> color3ui(Red,Green,Blue).
-%% @spec (Target::enum(),U1::float(),U2::float(),Ustride::integer(),Uorder::integer(),V1::float(),V2::float(),Vstride::integer(),Vorder::integer(),Points::binary()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMap.xml">external</a> documentation.
--spec map2d(enum(),float(),float(),integer(),integer(),float(),float(),integer(),integer(),binary()) -> ok.
-map2d(Target,U1,U2,Ustride,Uorder,V1,V2,Vstride,Vorder,Points) ->
- send_bin(Points),
- cast(5181, <<Target:?GLenum,0:32,U1:?GLdouble,U2:?GLdouble,Ustride:?GLint,Uorder:?GLint,V1:?GLdouble,V2:?GLdouble,Vstride:?GLint,Vorder:?GLint>>).
+%% @equiv color3us(Red,Green,Blue)
+-spec color3usv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer()}.
+color3usv({Red,Green,Blue}) -> color3us(Red,Green,Blue).
-%% @spec (Target::enum(),U1::float(),U2::float(),Ustride::integer(),Uorder::integer(),V1::float(),V2::float(),Vstride::integer(),Vorder::integer(),Points::binary()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMap.xml">external</a> documentation.
--spec map2f(enum(),float(),float(),integer(),integer(),float(),float(),integer(),integer(),binary()) -> ok.
-map2f(Target,U1,U2,Ustride,Uorder,V1,V2,Vstride,Vorder,Points) ->
- send_bin(Points),
- cast(5182, <<Target:?GLenum,U1:?GLfloat,U2:?GLfloat,Ustride:?GLint,Uorder:?GLint,V1:?GLfloat,V2:?GLfloat,Vstride:?GLint,Vorder:?GLint>>).
+%% @equiv color4b(Red,Green,Blue,Alpha)
+-spec color4bv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer(),Alpha :: integer()}.
+color4bv({Red,Green,Blue,Alpha}) -> color4b(Red,Green,Blue,Alpha).
-%% @spec (Un::integer(),U1::float(),U2::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMapGrid.xml">external</a> documentation.
--spec mapGrid1d(integer(),float(),float()) -> ok.
-mapGrid1d(Un,U1,U2) ->
- cast(5183, <<Un:?GLint,0:32,U1:?GLdouble,U2:?GLdouble>>).
+%% @equiv color4d(Red,Green,Blue,Alpha)
+-spec color4dv(V) -> ok when V :: {Red :: float(),Green :: float(),Blue :: float(),Alpha :: float()}.
+color4dv({Red,Green,Blue,Alpha}) -> color4d(Red,Green,Blue,Alpha).
-%% @spec (Un::integer(),U1::float(),U2::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMapGrid.xml">external</a> documentation.
--spec mapGrid1f(integer(),float(),float()) -> ok.
-mapGrid1f(Un,U1,U2) ->
- cast(5184, <<Un:?GLint,U1:?GLfloat,U2:?GLfloat>>).
+%% @equiv color4f(Red,Green,Blue,Alpha)
+-spec color4fv(V) -> ok when V :: {Red :: float(),Green :: float(),Blue :: float(),Alpha :: float()}.
+color4fv({Red,Green,Blue,Alpha}) -> color4f(Red,Green,Blue,Alpha).
-%% @spec (Un::integer(),U1::float(),U2::float(),Vn::integer(),V1::float(),V2::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMapGrid.xml">external</a> documentation.
--spec mapGrid2d(integer(),float(),float(),integer(),float(),float()) -> ok.
-mapGrid2d(Un,U1,U2,Vn,V1,V2) ->
- cast(5185, <<Un:?GLint,0:32,U1:?GLdouble,U2:?GLdouble,Vn:?GLint,0:32,V1:?GLdouble,V2:?GLdouble>>).
+%% @equiv color4i(Red,Green,Blue,Alpha)
+-spec color4iv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer(),Alpha :: integer()}.
+color4iv({Red,Green,Blue,Alpha}) -> color4i(Red,Green,Blue,Alpha).
-%% @spec (Un::integer(),U1::float(),U2::float(),Vn::integer(),V1::float(),V2::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMapGrid.xml">external</a> documentation.
--spec mapGrid2f(integer(),float(),float(),integer(),float(),float()) -> ok.
-mapGrid2f(Un,U1,U2,Vn,V1,V2) ->
- cast(5186, <<Un:?GLint,U1:?GLfloat,U2:?GLfloat,Vn:?GLint,V1:?GLfloat,V2:?GLfloat>>).
+%% @equiv color4s(Red,Green,Blue,Alpha)
+-spec color4sv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer(),Alpha :: integer()}.
+color4sv({Red,Green,Blue,Alpha}) -> color4s(Red,Green,Blue,Alpha).
-%% @spec (Face::enum(),Pname::enum(),Param::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMaterial.xml">external</a> documentation.
--spec materialf(enum(),enum(),float()) -> ok.
-materialf(Face,Pname,Param) ->
- cast(5187, <<Face:?GLenum,Pname:?GLenum,Param:?GLfloat>>).
+%% @equiv color4ub(Red,Green,Blue,Alpha)
+-spec color4ubv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer(),Alpha :: integer()}.
+color4ubv({Red,Green,Blue,Alpha}) -> color4ub(Red,Green,Blue,Alpha).
-%% @spec (Face::enum(),Pname::enum(),Params::{float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMaterial.xml">external</a> documentation.
--spec materialfv(enum(),enum(),{float()}) -> ok.
-materialfv(Face,Pname,Params) ->
- cast(5188, <<Face:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
- (<< <<C:?GLfloat>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
+%% @equiv color4ui(Red,Green,Blue,Alpha)
+-spec color4uiv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer(),Alpha :: integer()}.
+color4uiv({Red,Green,Blue,Alpha}) -> color4ui(Red,Green,Blue,Alpha).
-%% @spec (Face::enum(),Pname::enum(),Param::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMaterial.xml">external</a> documentation.
--spec materiali(enum(),enum(),integer()) -> ok.
-materiali(Face,Pname,Param) ->
- cast(5189, <<Face:?GLenum,Pname:?GLenum,Param:?GLint>>).
+%% @equiv color4us(Red,Green,Blue,Alpha)
+-spec color4usv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer(),Alpha :: integer()}.
+color4usv({Red,Green,Blue,Alpha}) -> color4us(Red,Green,Blue,Alpha).
-%% @spec (Face::enum(),Pname::enum(),Params::{integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMaterial.xml">external</a> documentation.
--spec materialiv(enum(),enum(),{integer()}) -> ok.
-materialiv(Face,Pname,Params) ->
- cast(5190, <<Face:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
- (<< <<C:?GLint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
+%% @doc Set the current texture coordinates
+%%
+%% ``gl:texCoord'' specifies texture coordinates in one, two, three, or four dimensions. ``gl:texCoord1''
+%% sets the current texture coordinates to (s 0 0 1); a call to ``gl:texCoord2'' sets them to (s t
+%% 0 1).
+%% Similarly, ``gl:texCoord3'' specifies the texture coordinates as (s t r 1), and ``gl:texCoord4''
+%% defines all four components explicitly as (s t r q).
+%%
+%% The current texture coordinates are part of the data that is associated with each vertex
+%% and with the current raster position. Initially, the values for `s', `t', `r'
+%% , and `q' are (0, 0, 0, 1).
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
+-spec texCoord1d(S) -> ok when S :: float().
+texCoord1d(S) ->
+ cast(5150, <<S:?GLdouble>>).
-%% @spec (Mode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMatrixMode.xml">external</a> documentation.
--spec matrixMode(enum()) -> ok.
-matrixMode(Mode) ->
- cast(5191, <<Mode:?GLenum>>).
+%% @doc
+%% See {@link texCoord1d/1}
+-spec texCoord1f(S) -> ok when S :: float().
+texCoord1f(S) ->
+ cast(5151, <<S:?GLfloat>>).
-%% @spec (M::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultMatrix.xml">external</a> documentation.
--spec multMatrixd({float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok.
-multMatrixd({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
- cast(5192, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,M13:?GLdouble,M14:?GLdouble,M15:?GLdouble,M16:?GLdouble>>);
-multMatrixd({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
- cast(5192, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,0:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,0:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,0:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,1:?GLdouble>>).
+%% @doc
+%% See {@link texCoord1d/1}
+-spec texCoord1i(S) -> ok when S :: integer().
+texCoord1i(S) ->
+ cast(5152, <<S:?GLint>>).
-%% @spec (M::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultMatrix.xml">external</a> documentation.
--spec multMatrixf({float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok.
-multMatrixf({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
- cast(5193, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,M13:?GLfloat,M14:?GLfloat,M15:?GLfloat,M16:?GLfloat>>);
-multMatrixf({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
- cast(5193, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,0:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,0:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,0:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,1:?GLfloat>>).
+%% @doc
+%% See {@link texCoord1d/1}
+-spec texCoord1s(S) -> ok when S :: integer().
+texCoord1s(S) ->
+ cast(5153, <<S:?GLshort>>).
-%% @spec (List::integer(),Mode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glNewList.xml">external</a> documentation.
--spec newList(integer(),enum()) -> ok.
-newList(List,Mode) ->
- cast(5194, <<List:?GLuint,Mode:?GLenum>>).
+%% @doc
+%% See {@link texCoord1d/1}
+-spec texCoord2d(S, T) -> ok when S :: float(),T :: float().
+texCoord2d(S,T) ->
+ cast(5154, <<S:?GLdouble,T:?GLdouble>>).
-%% @spec (Nx::integer(),Ny::integer(),Nz::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glNormal.xml">external</a> documentation.
--spec normal3b(integer(),integer(),integer()) -> ok.
-normal3b(Nx,Ny,Nz) ->
- cast(5195, <<Nx:?GLbyte,Ny:?GLbyte,Nz:?GLbyte>>).
+%% @doc
+%% See {@link texCoord1d/1}
+-spec texCoord2f(S, T) -> ok when S :: float(),T :: float().
+texCoord2f(S,T) ->
+ cast(5155, <<S:?GLfloat,T:?GLfloat>>).
-%% @spec ({Nx,Ny,Nz}) -> ok
-%% @equiv normal3b(Nx,Ny,Nz)
--spec normal3bv({integer(),integer(),integer()}) -> ok.
-normal3bv({Nx,Ny,Nz}) -> normal3b(Nx,Ny,Nz).
+%% @doc
+%% See {@link texCoord1d/1}
+-spec texCoord2i(S, T) -> ok when S :: integer(),T :: integer().
+texCoord2i(S,T) ->
+ cast(5156, <<S:?GLint,T:?GLint>>).
-%% @spec (Nx::float(),Ny::float(),Nz::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glNormal.xml">external</a> documentation.
--spec normal3d(float(),float(),float()) -> ok.
-normal3d(Nx,Ny,Nz) ->
- cast(5196, <<Nx:?GLdouble,Ny:?GLdouble,Nz:?GLdouble>>).
+%% @doc
+%% See {@link texCoord1d/1}
+-spec texCoord2s(S, T) -> ok when S :: integer(),T :: integer().
+texCoord2s(S,T) ->
+ cast(5157, <<S:?GLshort,T:?GLshort>>).
-%% @spec ({Nx,Ny,Nz}) -> ok
-%% @equiv normal3d(Nx,Ny,Nz)
--spec normal3dv({float(),float(),float()}) -> ok.
-normal3dv({Nx,Ny,Nz}) -> normal3d(Nx,Ny,Nz).
+%% @doc
+%% See {@link texCoord1d/1}
+-spec texCoord3d(S, T, R) -> ok when S :: float(),T :: float(),R :: float().
+texCoord3d(S,T,R) ->
+ cast(5158, <<S:?GLdouble,T:?GLdouble,R:?GLdouble>>).
-%% @spec (Nx::float(),Ny::float(),Nz::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glNormal.xml">external</a> documentation.
--spec normal3f(float(),float(),float()) -> ok.
-normal3f(Nx,Ny,Nz) ->
- cast(5197, <<Nx:?GLfloat,Ny:?GLfloat,Nz:?GLfloat>>).
+%% @doc
+%% See {@link texCoord1d/1}
+-spec texCoord3f(S, T, R) -> ok when S :: float(),T :: float(),R :: float().
+texCoord3f(S,T,R) ->
+ cast(5159, <<S:?GLfloat,T:?GLfloat,R:?GLfloat>>).
-%% @spec ({Nx,Ny,Nz}) -> ok
-%% @equiv normal3f(Nx,Ny,Nz)
--spec normal3fv({float(),float(),float()}) -> ok.
-normal3fv({Nx,Ny,Nz}) -> normal3f(Nx,Ny,Nz).
+%% @doc
+%% See {@link texCoord1d/1}
+-spec texCoord3i(S, T, R) -> ok when S :: integer(),T :: integer(),R :: integer().
+texCoord3i(S,T,R) ->
+ cast(5160, <<S:?GLint,T:?GLint,R:?GLint>>).
-%% @spec (Nx::integer(),Ny::integer(),Nz::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glNormal.xml">external</a> documentation.
--spec normal3i(integer(),integer(),integer()) -> ok.
-normal3i(Nx,Ny,Nz) ->
- cast(5198, <<Nx:?GLint,Ny:?GLint,Nz:?GLint>>).
+%% @doc
+%% See {@link texCoord1d/1}
+-spec texCoord3s(S, T, R) -> ok when S :: integer(),T :: integer(),R :: integer().
+texCoord3s(S,T,R) ->
+ cast(5161, <<S:?GLshort,T:?GLshort,R:?GLshort>>).
-%% @spec ({Nx,Ny,Nz}) -> ok
-%% @equiv normal3i(Nx,Ny,Nz)
--spec normal3iv({integer(),integer(),integer()}) -> ok.
-normal3iv({Nx,Ny,Nz}) -> normal3i(Nx,Ny,Nz).
+%% @doc
+%% See {@link texCoord1d/1}
+-spec texCoord4d(S, T, R, Q) -> ok when S :: float(),T :: float(),R :: float(),Q :: float().
+texCoord4d(S,T,R,Q) ->
+ cast(5162, <<S:?GLdouble,T:?GLdouble,R:?GLdouble,Q:?GLdouble>>).
-%% @spec (Nx::integer(),Ny::integer(),Nz::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glNormal.xml">external</a> documentation.
--spec normal3s(integer(),integer(),integer()) -> ok.
-normal3s(Nx,Ny,Nz) ->
- cast(5199, <<Nx:?GLshort,Ny:?GLshort,Nz:?GLshort>>).
+%% @doc
+%% See {@link texCoord1d/1}
+-spec texCoord4f(S, T, R, Q) -> ok when S :: float(),T :: float(),R :: float(),Q :: float().
+texCoord4f(S,T,R,Q) ->
+ cast(5163, <<S:?GLfloat,T:?GLfloat,R:?GLfloat,Q:?GLfloat>>).
-%% @spec ({Nx,Ny,Nz}) -> ok
-%% @equiv normal3s(Nx,Ny,Nz)
--spec normal3sv({integer(),integer(),integer()}) -> ok.
-normal3sv({Nx,Ny,Nz}) -> normal3s(Nx,Ny,Nz).
+%% @doc
+%% See {@link texCoord1d/1}
+-spec texCoord4i(S, T, R, Q) -> ok when S :: integer(),T :: integer(),R :: integer(),Q :: integer().
+texCoord4i(S,T,R,Q) ->
+ cast(5164, <<S:?GLint,T:?GLint,R:?GLint,Q:?GLint>>).
-%% @spec (Type::enum(),Stride::integer(),Pointer::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glNormalPointer.xml">external</a> documentation.
--spec normalPointer(enum(),integer(),offset()|mem()) -> ok.
-normalPointer(Type,Stride,Pointer) when is_integer(Pointer) ->
- cast(5200, <<Type:?GLenum,Stride:?GLsizei,Pointer:?GLuint>>);
-normalPointer(Type,Stride,Pointer) ->
- send_bin(Pointer),
- cast(5201, <<Type:?GLenum,Stride:?GLsizei>>).
+%% @doc
+%% See {@link texCoord1d/1}
+-spec texCoord4s(S, T, R, Q) -> ok when S :: integer(),T :: integer(),R :: integer(),Q :: integer().
+texCoord4s(S,T,R,Q) ->
+ cast(5165, <<S:?GLshort,T:?GLshort,R:?GLshort,Q:?GLshort>>).
-%% @spec (Left::float(),Right::float(),Bottom::float(),Top::float(),ZNear::float(),ZFar::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glOrtho.xml">external</a> documentation.
--spec ortho(float(),float(),float(),float(),float(),float()) -> ok.
-ortho(Left,Right,Bottom,Top,ZNear,ZFar) ->
- cast(5202, <<Left:?GLdouble,Right:?GLdouble,Bottom:?GLdouble,Top:?GLdouble,ZNear:?GLdouble,ZFar:?GLdouble>>).
+%% @equiv texCoord1d(S)
+-spec texCoord1dv(V) -> ok when V :: {S :: float()}.
+texCoord1dv({S}) -> texCoord1d(S).
-%% @spec (Token::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPassThrough.xml">external</a> documentation.
--spec passThrough(float()) -> ok.
-passThrough(Token) ->
- cast(5203, <<Token:?GLfloat>>).
+%% @equiv texCoord1f(S)
+-spec texCoord1fv(V) -> ok when V :: {S :: float()}.
+texCoord1fv({S}) -> texCoord1f(S).
-%% @spec (Map::enum(),Mapsize::integer(),Values::binary()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPixelMap.xml">external</a> documentation.
--spec pixelMapfv(enum(),integer(),binary()) -> ok.
-pixelMapfv(Map,Mapsize,Values) ->
- send_bin(Values),
- cast(5204, <<Map:?GLenum,Mapsize:?GLsizei>>).
+%% @equiv texCoord1i(S)
+-spec texCoord1iv(V) -> ok when V :: {S :: integer()}.
+texCoord1iv({S}) -> texCoord1i(S).
-%% @spec (Map::enum(),Mapsize::integer(),Values::binary()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPixelMap.xml">external</a> documentation.
--spec pixelMapuiv(enum(),integer(),binary()) -> ok.
-pixelMapuiv(Map,Mapsize,Values) ->
- send_bin(Values),
- cast(5205, <<Map:?GLenum,Mapsize:?GLsizei>>).
+%% @equiv texCoord1s(S)
+-spec texCoord1sv(V) -> ok when V :: {S :: integer()}.
+texCoord1sv({S}) -> texCoord1s(S).
-%% @spec (Map::enum(),Mapsize::integer(),Values::binary()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPixelMap.xml">external</a> documentation.
--spec pixelMapusv(enum(),integer(),binary()) -> ok.
-pixelMapusv(Map,Mapsize,Values) ->
- send_bin(Values),
- cast(5206, <<Map:?GLenum,Mapsize:?GLsizei>>).
+%% @equiv texCoord2d(S,T)
+-spec texCoord2dv(V) -> ok when V :: {S :: float(),T :: float()}.
+texCoord2dv({S,T}) -> texCoord2d(S,T).
-%% @spec (Pname::enum(),Param::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPixelStore.xml">external</a> documentation.
--spec pixelStoref(enum(),float()) -> ok.
-pixelStoref(Pname,Param) ->
- cast(5207, <<Pname:?GLenum,Param:?GLfloat>>).
+%% @equiv texCoord2f(S,T)
+-spec texCoord2fv(V) -> ok when V :: {S :: float(),T :: float()}.
+texCoord2fv({S,T}) -> texCoord2f(S,T).
-%% @spec (Pname::enum(),Param::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPixelStore.xml">external</a> documentation.
--spec pixelStorei(enum(),integer()) -> ok.
-pixelStorei(Pname,Param) ->
- cast(5208, <<Pname:?GLenum,Param:?GLint>>).
+%% @equiv texCoord2i(S,T)
+-spec texCoord2iv(V) -> ok when V :: {S :: integer(),T :: integer()}.
+texCoord2iv({S,T}) -> texCoord2i(S,T).
-%% @spec (Pname::enum(),Param::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPixelTransfer.xml">external</a> documentation.
--spec pixelTransferf(enum(),float()) -> ok.
-pixelTransferf(Pname,Param) ->
- cast(5209, <<Pname:?GLenum,Param:?GLfloat>>).
+%% @equiv texCoord2s(S,T)
+-spec texCoord2sv(V) -> ok when V :: {S :: integer(),T :: integer()}.
+texCoord2sv({S,T}) -> texCoord2s(S,T).
-%% @spec (Pname::enum(),Param::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPixelTransfer.xml">external</a> documentation.
--spec pixelTransferi(enum(),integer()) -> ok.
-pixelTransferi(Pname,Param) ->
- cast(5210, <<Pname:?GLenum,Param:?GLint>>).
+%% @equiv texCoord3d(S,T,R)
+-spec texCoord3dv(V) -> ok when V :: {S :: float(),T :: float(),R :: float()}.
+texCoord3dv({S,T,R}) -> texCoord3d(S,T,R).
-%% @spec (Xfactor::float(),Yfactor::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPixelZoom.xml">external</a> documentation.
--spec pixelZoom(float(),float()) -> ok.
-pixelZoom(Xfactor,Yfactor) ->
- cast(5211, <<Xfactor:?GLfloat,Yfactor:?GLfloat>>).
+%% @equiv texCoord3f(S,T,R)
+-spec texCoord3fv(V) -> ok when V :: {S :: float(),T :: float(),R :: float()}.
+texCoord3fv({S,T,R}) -> texCoord3f(S,T,R).
-%% @spec (Size::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPointSize.xml">external</a> documentation.
--spec pointSize(float()) -> ok.
-pointSize(Size) ->
- cast(5212, <<Size:?GLfloat>>).
+%% @equiv texCoord3i(S,T,R)
+-spec texCoord3iv(V) -> ok when V :: {S :: integer(),T :: integer(),R :: integer()}.
+texCoord3iv({S,T,R}) -> texCoord3i(S,T,R).
-%% @spec (Face::enum(),Mode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPolygonMode.xml">external</a> documentation.
--spec polygonMode(enum(),enum()) -> ok.
-polygonMode(Face,Mode) ->
- cast(5213, <<Face:?GLenum,Mode:?GLenum>>).
+%% @equiv texCoord3s(S,T,R)
+-spec texCoord3sv(V) -> ok when V :: {S :: integer(),T :: integer(),R :: integer()}.
+texCoord3sv({S,T,R}) -> texCoord3s(S,T,R).
-%% @spec (Factor::float(),Units::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPolygonOffset.xml">external</a> documentation.
--spec polygonOffset(float(),float()) -> ok.
-polygonOffset(Factor,Units) ->
- cast(5214, <<Factor:?GLfloat,Units:?GLfloat>>).
+%% @equiv texCoord4d(S,T,R,Q)
+-spec texCoord4dv(V) -> ok when V :: {S :: float(),T :: float(),R :: float(),Q :: float()}.
+texCoord4dv({S,T,R,Q}) -> texCoord4d(S,T,R,Q).
-%% @spec (Mask::binary()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPolygonStipple.xml">external</a> documentation.
--spec polygonStipple(binary()) -> ok.
-polygonStipple(Mask) ->
- send_bin(Mask),
- cast(5215, <<>>).
+%% @equiv texCoord4f(S,T,R,Q)
+-spec texCoord4fv(V) -> ok when V :: {S :: float(),T :: float(),R :: float(),Q :: float()}.
+texCoord4fv({S,T,R,Q}) -> texCoord4f(S,T,R,Q).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPopAttrib.xml">external</a> documentation.
--spec popAttrib() -> ok.
-popAttrib() ->
- cast(5216, <<>>).
+%% @equiv texCoord4i(S,T,R,Q)
+-spec texCoord4iv(V) -> ok when V :: {S :: integer(),T :: integer(),R :: integer(),Q :: integer()}.
+texCoord4iv({S,T,R,Q}) -> texCoord4i(S,T,R,Q).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPopClientAttrib.xml">external</a> documentation.
--spec popClientAttrib() -> ok.
-popClientAttrib() ->
- cast(5217, <<>>).
+%% @equiv texCoord4s(S,T,R,Q)
+-spec texCoord4sv(V) -> ok when V :: {S :: integer(),T :: integer(),R :: integer(),Q :: integer()}.
+texCoord4sv({S,T,R,Q}) -> texCoord4s(S,T,R,Q).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPopMatrix.xml">external</a> documentation.
--spec popMatrix() -> ok.
-popMatrix() ->
- cast(5218, <<>>).
+%% @doc Specify the raster position for pixel operations
+%%
+%% The GL maintains a 3D position in window coordinates. This position, called the raster
+%% position, is used to position pixel and bitmap write operations. It is maintained with
+%% subpixel accuracy. See {@link gl:bitmap/7} , {@link gl:drawPixels/5} , and {@link gl:copyPixels/5}
+%% .
+%%
+%% The current raster position consists of three window coordinates ( x, y, z), a clip
+%% coordinate value ( w), an eye coordinate distance, a valid bit, and associated color
+%% data and texture coordinates. The w coordinate is a clip coordinate, because w is
+%% not projected to window coordinates. ``gl:rasterPos4'' specifies object coordinates x,
+%% y, z, and w explicitly. ``gl:rasterPos3'' specifies object coordinate x, y, and
+%% z explicitly, while w is implicitly set to 1. ``gl:rasterPos2'' uses the argument
+%% values for x and y while implicitly setting z and w to 0 and 1.
+%%
+%% The object coordinates presented by ``gl:rasterPos'' are treated just like those of a {@link gl:vertex2d/2}
+%% command: They are transformed by the current modelview and projection matrices and passed
+%% to the clipping stage. If the vertex is not culled, then it is projected and scaled to
+%% window coordinates, which become the new current raster position, and the `?GL_CURRENT_RASTER_POSITION_VALID'
+%% flag is set. If the vertex `is' culled, then the valid bit is cleared and the current
+%% raster position and associated color and texture coordinates are undefined.
+%%
+%% The current raster position also includes some associated color data and texture coordinates.
+%% If lighting is enabled, then `?GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `?GL_CURRENT_RASTER_INDEX'
+%% (in color index mode) is set to the color produced by the lighting calculation (see {@link gl:lightf/3}
+%% , {@link gl:lightModelf/2} , and {@link gl:shadeModel/1} ). If lighting is disabled, current
+%% color (in RGBA mode, state variable `?GL_CURRENT_COLOR') or color index (in color
+%% index mode, state variable `?GL_CURRENT_INDEX') is used to update the current raster
+%% color. `?GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
+%%
+%% Likewise, `?GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of `?GL_CURRENT_TEXTURE_COORDS'
+%% , based on the texture matrix and the texture generation functions (see {@link gl:texGend/3} ).
+%% Finally, the distance from the origin of the eye coordinate system to the vertex as transformed
+%% by only the modelview matrix replaces `?GL_CURRENT_RASTER_DISTANCE'.
+%%
+%% Initially, the current raster position is (0, 0, 0, 1), the current raster distance is
+%% 0, the valid bit is set, the associated RGBA color is (1, 1, 1, 1), the associated color
+%% index is 1, and the associated texture coordinates are (0, 0, 0, 1). In RGBA mode, `?GL_CURRENT_RASTER_INDEX'
+%% is always 1; in color index mode, the current raster RGBA color always maintains its
+%% initial value.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRasterPos.xml">external</a> documentation.
+-spec rasterPos2d(X, Y) -> ok when X :: float(),Y :: float().
+rasterPos2d(X,Y) ->
+ cast(5166, <<X:?GLdouble,Y:?GLdouble>>).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPopName.xml">external</a> documentation.
--spec popName() -> ok.
-popName() ->
- cast(5219, <<>>).
+%% @doc
+%% See {@link rasterPos2d/2}
+-spec rasterPos2f(X, Y) -> ok when X :: float(),Y :: float().
+rasterPos2f(X,Y) ->
+ cast(5167, <<X:?GLfloat,Y:?GLfloat>>).
-%% @spec (Textures::[integer()],Priorities::[clamp()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPrioritizeTextures.xml">external</a> documentation.
--spec prioritizeTextures([integer()],[clamp()]) -> ok.
-prioritizeTextures(Textures,Priorities) ->
- cast(5220, <<(length(Textures)):?GLuint,
- (<< <<C:?GLuint>> || C <- Textures>>)/binary,0:(((1+length(Textures)) rem 2)*32),(length(Priorities)):?GLuint,
- (<< <<C:?GLclampf>> || C <- Priorities>>)/binary,0:(((1+length(Priorities)) rem 2)*32)>>).
+%% @doc
+%% See {@link rasterPos2d/2}
+-spec rasterPos2i(X, Y) -> ok when X :: integer(),Y :: integer().
+rasterPos2i(X,Y) ->
+ cast(5168, <<X:?GLint,Y:?GLint>>).
-%% @spec (Mask::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPushAttrib.xml">external</a> documentation.
--spec pushAttrib(integer()) -> ok.
-pushAttrib(Mask) ->
- cast(5221, <<Mask:?GLbitfield>>).
+%% @doc
+%% See {@link rasterPos2d/2}
+-spec rasterPos2s(X, Y) -> ok when X :: integer(),Y :: integer().
+rasterPos2s(X,Y) ->
+ cast(5169, <<X:?GLshort,Y:?GLshort>>).
-%% @spec (Mask::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPushClientAttrib.xml">external</a> documentation.
--spec pushClientAttrib(integer()) -> ok.
-pushClientAttrib(Mask) ->
- cast(5222, <<Mask:?GLbitfield>>).
+%% @doc
+%% See {@link rasterPos2d/2}
+-spec rasterPos3d(X, Y, Z) -> ok when X :: float(),Y :: float(),Z :: float().
+rasterPos3d(X,Y,Z) ->
+ cast(5170, <<X:?GLdouble,Y:?GLdouble,Z:?GLdouble>>).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPushMatrix.xml">external</a> documentation.
--spec pushMatrix() -> ok.
-pushMatrix() ->
- cast(5223, <<>>).
+%% @doc
+%% See {@link rasterPos2d/2}
+-spec rasterPos3f(X, Y, Z) -> ok when X :: float(),Y :: float(),Z :: float().
+rasterPos3f(X,Y,Z) ->
+ cast(5171, <<X:?GLfloat,Y:?GLfloat,Z:?GLfloat>>).
-%% @spec (Name::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPushName.xml">external</a> documentation.
--spec pushName(integer()) -> ok.
-pushName(Name) ->
- cast(5224, <<Name:?GLuint>>).
+%% @doc
+%% See {@link rasterPos2d/2}
+-spec rasterPos3i(X, Y, Z) -> ok when X :: integer(),Y :: integer(),Z :: integer().
+rasterPos3i(X,Y,Z) ->
+ cast(5172, <<X:?GLint,Y:?GLint,Z:?GLint>>).
-%% @spec (X::float(),Y::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRasterPos.xml">external</a> documentation.
--spec rasterPos2d(float(),float()) -> ok.
-rasterPos2d(X,Y) ->
- cast(5225, <<X:?GLdouble,Y:?GLdouble>>).
+%% @doc
+%% See {@link rasterPos2d/2}
+-spec rasterPos3s(X, Y, Z) -> ok when X :: integer(),Y :: integer(),Z :: integer().
+rasterPos3s(X,Y,Z) ->
+ cast(5173, <<X:?GLshort,Y:?GLshort,Z:?GLshort>>).
+
+%% @doc
+%% See {@link rasterPos2d/2}
+-spec rasterPos4d(X, Y, Z, W) -> ok when X :: float(),Y :: float(),Z :: float(),W :: float().
+rasterPos4d(X,Y,Z,W) ->
+ cast(5174, <<X:?GLdouble,Y:?GLdouble,Z:?GLdouble,W:?GLdouble>>).
+
+%% @doc
+%% See {@link rasterPos2d/2}
+-spec rasterPos4f(X, Y, Z, W) -> ok when X :: float(),Y :: float(),Z :: float(),W :: float().
+rasterPos4f(X,Y,Z,W) ->
+ cast(5175, <<X:?GLfloat,Y:?GLfloat,Z:?GLfloat,W:?GLfloat>>).
+
+%% @doc
+%% See {@link rasterPos2d/2}
+-spec rasterPos4i(X, Y, Z, W) -> ok when X :: integer(),Y :: integer(),Z :: integer(),W :: integer().
+rasterPos4i(X,Y,Z,W) ->
+ cast(5176, <<X:?GLint,Y:?GLint,Z:?GLint,W:?GLint>>).
+
+%% @doc
+%% See {@link rasterPos2d/2}
+-spec rasterPos4s(X, Y, Z, W) -> ok when X :: integer(),Y :: integer(),Z :: integer(),W :: integer().
+rasterPos4s(X,Y,Z,W) ->
+ cast(5177, <<X:?GLshort,Y:?GLshort,Z:?GLshort,W:?GLshort>>).
-%% @spec ({X,Y}) -> ok
%% @equiv rasterPos2d(X,Y)
--spec rasterPos2dv({float(),float()}) -> ok.
+-spec rasterPos2dv(V) -> ok when V :: {X :: float(),Y :: float()}.
rasterPos2dv({X,Y}) -> rasterPos2d(X,Y).
-%% @spec (X::float(),Y::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRasterPos.xml">external</a> documentation.
--spec rasterPos2f(float(),float()) -> ok.
-rasterPos2f(X,Y) ->
- cast(5226, <<X:?GLfloat,Y:?GLfloat>>).
-
-%% @spec ({X,Y}) -> ok
%% @equiv rasterPos2f(X,Y)
--spec rasterPos2fv({float(),float()}) -> ok.
+-spec rasterPos2fv(V) -> ok when V :: {X :: float(),Y :: float()}.
rasterPos2fv({X,Y}) -> rasterPos2f(X,Y).
-%% @spec (X::integer(),Y::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRasterPos.xml">external</a> documentation.
--spec rasterPos2i(integer(),integer()) -> ok.
-rasterPos2i(X,Y) ->
- cast(5227, <<X:?GLint,Y:?GLint>>).
-
-%% @spec ({X,Y}) -> ok
%% @equiv rasterPos2i(X,Y)
--spec rasterPos2iv({integer(),integer()}) -> ok.
+-spec rasterPos2iv(V) -> ok when V :: {X :: integer(),Y :: integer()}.
rasterPos2iv({X,Y}) -> rasterPos2i(X,Y).
-%% @spec (X::integer(),Y::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRasterPos.xml">external</a> documentation.
--spec rasterPos2s(integer(),integer()) -> ok.
-rasterPos2s(X,Y) ->
- cast(5228, <<X:?GLshort,Y:?GLshort>>).
-
-%% @spec ({X,Y}) -> ok
%% @equiv rasterPos2s(X,Y)
--spec rasterPos2sv({integer(),integer()}) -> ok.
+-spec rasterPos2sv(V) -> ok when V :: {X :: integer(),Y :: integer()}.
rasterPos2sv({X,Y}) -> rasterPos2s(X,Y).
-%% @spec (X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRasterPos.xml">external</a> documentation.
--spec rasterPos3d(float(),float(),float()) -> ok.
-rasterPos3d(X,Y,Z) ->
- cast(5229, <<X:?GLdouble,Y:?GLdouble,Z:?GLdouble>>).
-
-%% @spec ({X,Y,Z}) -> ok
%% @equiv rasterPos3d(X,Y,Z)
--spec rasterPos3dv({float(),float(),float()}) -> ok.
+-spec rasterPos3dv(V) -> ok when V :: {X :: float(),Y :: float(),Z :: float()}.
rasterPos3dv({X,Y,Z}) -> rasterPos3d(X,Y,Z).
-%% @spec (X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRasterPos.xml">external</a> documentation.
--spec rasterPos3f(float(),float(),float()) -> ok.
-rasterPos3f(X,Y,Z) ->
- cast(5230, <<X:?GLfloat,Y:?GLfloat,Z:?GLfloat>>).
-
-%% @spec ({X,Y,Z}) -> ok
%% @equiv rasterPos3f(X,Y,Z)
--spec rasterPos3fv({float(),float(),float()}) -> ok.
+-spec rasterPos3fv(V) -> ok when V :: {X :: float(),Y :: float(),Z :: float()}.
rasterPos3fv({X,Y,Z}) -> rasterPos3f(X,Y,Z).
-%% @spec (X::integer(),Y::integer(),Z::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRasterPos.xml">external</a> documentation.
--spec rasterPos3i(integer(),integer(),integer()) -> ok.
-rasterPos3i(X,Y,Z) ->
- cast(5231, <<X:?GLint,Y:?GLint,Z:?GLint>>).
-
-%% @spec ({X,Y,Z}) -> ok
%% @equiv rasterPos3i(X,Y,Z)
--spec rasterPos3iv({integer(),integer(),integer()}) -> ok.
+-spec rasterPos3iv(V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer()}.
rasterPos3iv({X,Y,Z}) -> rasterPos3i(X,Y,Z).
-%% @spec (X::integer(),Y::integer(),Z::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRasterPos.xml">external</a> documentation.
--spec rasterPos3s(integer(),integer(),integer()) -> ok.
-rasterPos3s(X,Y,Z) ->
- cast(5232, <<X:?GLshort,Y:?GLshort,Z:?GLshort>>).
-
-%% @spec ({X,Y,Z}) -> ok
%% @equiv rasterPos3s(X,Y,Z)
--spec rasterPos3sv({integer(),integer(),integer()}) -> ok.
+-spec rasterPos3sv(V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer()}.
rasterPos3sv({X,Y,Z}) -> rasterPos3s(X,Y,Z).
-%% @spec (X::float(),Y::float(),Z::float(),W::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRasterPos.xml">external</a> documentation.
--spec rasterPos4d(float(),float(),float(),float()) -> ok.
-rasterPos4d(X,Y,Z,W) ->
- cast(5233, <<X:?GLdouble,Y:?GLdouble,Z:?GLdouble,W:?GLdouble>>).
-
-%% @spec ({X,Y,Z,W}) -> ok
%% @equiv rasterPos4d(X,Y,Z,W)
--spec rasterPos4dv({float(),float(),float(),float()}) -> ok.
+-spec rasterPos4dv(V) -> ok when V :: {X :: float(),Y :: float(),Z :: float(),W :: float()}.
rasterPos4dv({X,Y,Z,W}) -> rasterPos4d(X,Y,Z,W).
-%% @spec (X::float(),Y::float(),Z::float(),W::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRasterPos.xml">external</a> documentation.
--spec rasterPos4f(float(),float(),float(),float()) -> ok.
-rasterPos4f(X,Y,Z,W) ->
- cast(5234, <<X:?GLfloat,Y:?GLfloat,Z:?GLfloat,W:?GLfloat>>).
-
-%% @spec ({X,Y,Z,W}) -> ok
%% @equiv rasterPos4f(X,Y,Z,W)
--spec rasterPos4fv({float(),float(),float(),float()}) -> ok.
+-spec rasterPos4fv(V) -> ok when V :: {X :: float(),Y :: float(),Z :: float(),W :: float()}.
rasterPos4fv({X,Y,Z,W}) -> rasterPos4f(X,Y,Z,W).
-%% @spec (X::integer(),Y::integer(),Z::integer(),W::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRasterPos.xml">external</a> documentation.
--spec rasterPos4i(integer(),integer(),integer(),integer()) -> ok.
-rasterPos4i(X,Y,Z,W) ->
- cast(5235, <<X:?GLint,Y:?GLint,Z:?GLint,W:?GLint>>).
-
-%% @spec ({X,Y,Z,W}) -> ok
%% @equiv rasterPos4i(X,Y,Z,W)
--spec rasterPos4iv({integer(),integer(),integer(),integer()}) -> ok.
+-spec rasterPos4iv(V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer(),W :: integer()}.
rasterPos4iv({X,Y,Z,W}) -> rasterPos4i(X,Y,Z,W).
-%% @spec (X::integer(),Y::integer(),Z::integer(),W::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRasterPos.xml">external</a> documentation.
--spec rasterPos4s(integer(),integer(),integer(),integer()) -> ok.
-rasterPos4s(X,Y,Z,W) ->
- cast(5236, <<X:?GLshort,Y:?GLshort,Z:?GLshort,W:?GLshort>>).
-
-%% @spec ({X,Y,Z,W}) -> ok
%% @equiv rasterPos4s(X,Y,Z,W)
--spec rasterPos4sv({integer(),integer(),integer(),integer()}) -> ok.
+-spec rasterPos4sv(V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer(),W :: integer()}.
rasterPos4sv({X,Y,Z,W}) -> rasterPos4s(X,Y,Z,W).
-%% @spec (Mode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glReadBuffer.xml">external</a> documentation.
--spec readBuffer(enum()) -> ok.
-readBuffer(Mode) ->
- cast(5237, <<Mode:?GLenum>>).
+%% @doc Draw a rectangle
+%%
+%% ``gl:rect'' supports efficient specification of rectangles as two corner points. Each
+%% rectangle command takes four arguments, organized either as two consecutive pairs of (x y)
+%% coordinates or as two pointers to arrays, each containing an (x y) pair. The resulting rectangle
+%% is defined in the z= 0 plane.
+%%
+%% ``gl:rect''( `X1' , `Y1' , `X2' , `Y2' ) is exactly equivalent to the
+%% following sequence: glBegin(`?GL_POLYGON'); glVertex2( `X1' , `Y1' ); glVertex2(
+%% `X2' , `Y1' ); glVertex2( `X2' , `Y2' ); glVertex2( `X1' , `Y2' );
+%% glEnd(); Note that if the second vertex is above and to the right of the first vertex,
+%% the rectangle is constructed with a counterclockwise winding.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRect.xml">external</a> documentation.
+-spec rectd(X1, Y1, X2, Y2) -> ok when X1 :: float(),Y1 :: float(),X2 :: float(),Y2 :: float().
+rectd(X1,Y1,X2,Y2) ->
+ cast(5178, <<X1:?GLdouble,Y1:?GLdouble,X2:?GLdouble,Y2:?GLdouble>>).
-%% @spec (X::integer(),Y::integer(),Width::integer(),Height::integer(),Format::enum(),Type::enum(),Pixels::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glReadPixels.xml">external</a> documentation.
--spec readPixels(integer(),integer(),integer(),integer(),enum(),enum(),mem()) -> ok.
-readPixels(X,Y,Width,Height,Format,Type,Pixels) ->
- send_bin(Pixels),
- call(5238, <<X:?GLint,Y:?GLint,Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum>>).
+%% @doc
+%% See {@link rectd/4}
+-spec rectf(X1, Y1, X2, Y2) -> ok when X1 :: float(),Y1 :: float(),X2 :: float(),Y2 :: float().
+rectf(X1,Y1,X2,Y2) ->
+ cast(5179, <<X1:?GLfloat,Y1:?GLfloat,X2:?GLfloat,Y2:?GLfloat>>).
-%% @spec (X1::float(),Y1::float(),X2::float(),Y2::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRect.xml">external</a> documentation.
--spec rectd(float(),float(),float(),float()) -> ok.
-rectd(X1,Y1,X2,Y2) ->
- cast(5239, <<X1:?GLdouble,Y1:?GLdouble,X2:?GLdouble,Y2:?GLdouble>>).
+%% @doc
+%% See {@link rectd/4}
+-spec recti(X1, Y1, X2, Y2) -> ok when X1 :: integer(),Y1 :: integer(),X2 :: integer(),Y2 :: integer().
+recti(X1,Y1,X2,Y2) ->
+ cast(5180, <<X1:?GLint,Y1:?GLint,X2:?GLint,Y2:?GLint>>).
-%% @spec (V1::{float(),float()},V2::{float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRect.xml">external</a> documentation.
--spec rectdv({float(),float()},{float(),float()}) -> ok.
-rectdv({V1,V2},{V1,V2}) ->
- cast(5240, <<V1:?GLdouble,V2:?GLdouble,V1:?GLdouble,V2:?GLdouble>>).
+%% @doc
+%% See {@link rectd/4}
+-spec rects(X1, Y1, X2, Y2) -> ok when X1 :: integer(),Y1 :: integer(),X2 :: integer(),Y2 :: integer().
+rects(X1,Y1,X2,Y2) ->
+ cast(5181, <<X1:?GLshort,Y1:?GLshort,X2:?GLshort,Y2:?GLshort>>).
-%% @spec (X1::float(),Y1::float(),X2::float(),Y2::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRect.xml">external</a> documentation.
--spec rectf(float(),float(),float(),float()) -> ok.
-rectf(X1,Y1,X2,Y2) ->
- cast(5241, <<X1:?GLfloat,Y1:?GLfloat,X2:?GLfloat,Y2:?GLfloat>>).
+%% @doc
+%% See {@link rectd/4}
+-spec rectdv(V1, V2) -> ok when V1 :: {float(),float()},V2 :: {float(),float()}.
+rectdv({V1,V2},{V1,V2}) ->
+ cast(5182, <<V1:?GLdouble,V2:?GLdouble,V1:?GLdouble,V2:?GLdouble>>).
-%% @spec (V1::{float(),float()},V2::{float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRect.xml">external</a> documentation.
--spec rectfv({float(),float()},{float(),float()}) -> ok.
+%% @doc
+%% See {@link rectd/4}
+-spec rectfv(V1, V2) -> ok when V1 :: {float(),float()},V2 :: {float(),float()}.
rectfv({V1,V2},{V1,V2}) ->
- cast(5242, <<V1:?GLfloat,V2:?GLfloat,V1:?GLfloat,V2:?GLfloat>>).
+ cast(5183, <<V1:?GLfloat,V2:?GLfloat,V1:?GLfloat,V2:?GLfloat>>).
-%% @spec (X1::integer(),Y1::integer(),X2::integer(),Y2::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRect.xml">external</a> documentation.
--spec recti(integer(),integer(),integer(),integer()) -> ok.
-recti(X1,Y1,X2,Y2) ->
- cast(5243, <<X1:?GLint,Y1:?GLint,X2:?GLint,Y2:?GLint>>).
-
-%% @spec (V1::{integer(),integer()},V2::{integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRect.xml">external</a> documentation.
--spec rectiv({integer(),integer()},{integer(),integer()}) -> ok.
+%% @doc
+%% See {@link rectd/4}
+-spec rectiv(V1, V2) -> ok when V1 :: {integer(),integer()},V2 :: {integer(),integer()}.
rectiv({V1,V2},{V1,V2}) ->
- cast(5244, <<V1:?GLint,V2:?GLint,V1:?GLint,V2:?GLint>>).
+ cast(5184, <<V1:?GLint,V2:?GLint,V1:?GLint,V2:?GLint>>).
-%% @spec (X1::integer(),Y1::integer(),X2::integer(),Y2::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRect.xml">external</a> documentation.
--spec rects(integer(),integer(),integer(),integer()) -> ok.
-rects(X1,Y1,X2,Y2) ->
- cast(5245, <<X1:?GLshort,Y1:?GLshort,X2:?GLshort,Y2:?GLshort>>).
-
-%% @spec (V1::{integer(),integer()},V2::{integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRect.xml">external</a> documentation.
--spec rectsv({integer(),integer()},{integer(),integer()}) -> ok.
+%% @doc
+%% See {@link rectd/4}
+-spec rectsv(V1, V2) -> ok when V1 :: {integer(),integer()},V2 :: {integer(),integer()}.
rectsv({V1,V2},{V1,V2}) ->
- cast(5246, <<V1:?GLshort,V2:?GLshort,V1:?GLshort,V2:?GLshort>>).
+ cast(5185, <<V1:?GLshort,V2:?GLshort,V1:?GLshort,V2:?GLshort>>).
-%% @spec (Mode::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRenderMode.xml">external</a> documentation.
--spec renderMode(enum()) -> integer().
-renderMode(Mode) ->
- call(5247, <<Mode:?GLenum>>).
+%% @doc Define an array of vertex data
+%%
+%% ``gl:vertexPointer'' specifies the location and data format of an array of vertex coordinates
+%% to use when rendering. `Size' specifies the number of coordinates per vertex, and
+%% must be 2, 3, or 4. `Type' specifies the data type of each coordinate, and `Stride'
+%% specifies the byte stride from one vertex to the next, allowing vertices and attributes
+%% to be packed into a single array or stored in separate arrays. (Single-array storage may
+%% be more efficient on some implementations; see {@link gl:interleavedArrays/3} .)
+%%
+%% If a non-zero named buffer object is bound to the `?GL_ARRAY_BUFFER' target (see {@link gl:bindBuffer/2}
+%% ) while a vertex array is specified, `Pointer' is treated as a byte offset into the
+%% buffer object's data store. Also, the buffer object binding (`?GL_ARRAY_BUFFER_BINDING'
+%% ) is saved as vertex array client-side state (`?GL_VERTEX_ARRAY_BUFFER_BINDING').
+%%
+%% When a vertex array is specified, `Size' , `Type' , `Stride' , and `Pointer'
+%% are saved as client-side state, in addition to the current vertex array buffer object
+%% binding.
+%%
+%% To enable and disable the vertex array, call {@link gl:enableClientState/1} and {@link gl:enableClientState/1}
+%% with the argument `?GL_VERTEX_ARRAY'. If enabled, the vertex array is used when {@link gl:arrayElement/1}
+%% , {@link gl:drawArrays/3} , {@link gl:multiDrawArrays/3} , {@link gl:drawElements/4} , see `glMultiDrawElements'
+%% , or {@link gl:drawRangeElements/6} is called.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexPointer.xml">external</a> documentation.
+-spec vertexPointer(Size, Type, Stride, Ptr) -> ok when Size :: integer(),Type :: enum(),Stride :: integer(),Ptr :: offset()|mem().
+vertexPointer(Size,Type,Stride,Ptr) when is_integer(Ptr) ->
+ cast(5186, <<Size:?GLint,Type:?GLenum,Stride:?GLsizei,Ptr:?GLuint>>);
+vertexPointer(Size,Type,Stride,Ptr) ->
+ send_bin(Ptr),
+ cast(5187, <<Size:?GLint,Type:?GLenum,Stride:?GLsizei>>).
+
+%% @doc Define an array of normals
+%%
+%% ``gl:normalPointer'' specifies the location and data format of an array of normals to
+%% use when rendering. `Type' specifies the data type of each normal coordinate, and `Stride'
+%% specifies the byte stride from one normal to the next, allowing vertices and attributes
+%% to be packed into a single array or stored in separate arrays. (Single-array storage may
+%% be more efficient on some implementations; see {@link gl:interleavedArrays/3} .)
+%%
+%% If a non-zero named buffer object is bound to the `?GL_ARRAY_BUFFER' target (see {@link gl:bindBuffer/2}
+%% ) while a normal array is specified, `Pointer' is treated as a byte offset into the
+%% buffer object's data store. Also, the buffer object binding (`?GL_ARRAY_BUFFER_BINDING'
+%% ) is saved as normal vertex array client-side state (`?GL_NORMAL_ARRAY_BUFFER_BINDING'
+%% ).
+%%
+%% When a normal array is specified, `Type' , `Stride' , and `Pointer' are
+%% saved as client-side state, in addition to the current vertex array buffer object binding.
+%%
+%%
+%% To enable and disable the normal array, call {@link gl:enableClientState/1} and {@link gl:enableClientState/1}
+%% with the argument `?GL_NORMAL_ARRAY'. If enabled, the normal array is used when {@link gl:drawArrays/3}
+%% , {@link gl:multiDrawArrays/3} , {@link gl:drawElements/4} , see `glMultiDrawElements', {@link gl:drawRangeElements/6}
+%% , or {@link gl:arrayElement/1} is called.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glNormalPointer.xml">external</a> documentation.
+-spec normalPointer(Type, Stride, Ptr) -> ok when Type :: enum(),Stride :: integer(),Ptr :: offset()|mem().
+normalPointer(Type,Stride,Ptr) when is_integer(Ptr) ->
+ cast(5188, <<Type:?GLenum,Stride:?GLsizei,Ptr:?GLuint>>);
+normalPointer(Type,Stride,Ptr) ->
+ send_bin(Ptr),
+ cast(5189, <<Type:?GLenum,Stride:?GLsizei>>).
+
+%% @doc Define an array of colors
+%%
+%% ``gl:colorPointer'' specifies the location and data format of an array of color components
+%% to use when rendering. `Size' specifies the number of components per color, and must
+%% be 3 or 4. `Type' specifies the data type of each color component, and `Stride'
+%% specifies the byte stride from one color to the next, allowing vertices and attributes
+%% to be packed into a single array or stored in separate arrays. (Single-array storage may
+%% be more efficient on some implementations; see {@link gl:interleavedArrays/3} .)
+%%
+%% If a non-zero named buffer object is bound to the `?GL_ARRAY_BUFFER' target (see {@link gl:bindBuffer/2}
+%% ) while a color array is specified, `Pointer' is treated as a byte offset into the
+%% buffer object's data store. Also, the buffer object binding (`?GL_ARRAY_BUFFER_BINDING'
+%% ) is saved as color vertex array client-side state (`?GL_COLOR_ARRAY_BUFFER_BINDING').
+%%
+%%
+%% When a color array is specified, `Size' , `Type' , `Stride' , and `Pointer'
+%% are saved as client-side state, in addition to the current vertex array buffer object
+%% binding.
+%%
+%% To enable and disable the color array, call {@link gl:enableClientState/1} and {@link gl:enableClientState/1}
+%% with the argument `?GL_COLOR_ARRAY'. If enabled, the color array is used when {@link gl:drawArrays/3}
+%% , {@link gl:multiDrawArrays/3} , {@link gl:drawElements/4} , see `glMultiDrawElements', {@link gl:drawRangeElements/6}
+%% , or {@link gl:arrayElement/1} is called.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColorPointer.xml">external</a> documentation.
+-spec colorPointer(Size, Type, Stride, Ptr) -> ok when Size :: integer(),Type :: enum(),Stride :: integer(),Ptr :: offset()|mem().
+colorPointer(Size,Type,Stride,Ptr) when is_integer(Ptr) ->
+ cast(5190, <<Size:?GLint,Type:?GLenum,Stride:?GLsizei,Ptr:?GLuint>>);
+colorPointer(Size,Type,Stride,Ptr) ->
+ send_bin(Ptr),
+ cast(5191, <<Size:?GLint,Type:?GLenum,Stride:?GLsizei>>).
+
+%% @doc Define an array of color indexes
+%%
+%% ``gl:indexPointer'' specifies the location and data format of an array of color indexes
+%% to use when rendering. `Type' specifies the data type of each color index and `Stride'
+%% specifies the byte stride from one color index to the next, allowing vertices and attributes
+%% to be packed into a single array or stored in separate arrays.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_ARRAY_BUFFER' target (see {@link gl:bindBuffer/2}
+%% ) while a color index array is specified, `Pointer' is treated as a byte offset into
+%% the buffer object's data store. Also, the buffer object binding (`?GL_ARRAY_BUFFER_BINDING'
+%% ) is saved as color index vertex array client-side state (`?GL_INDEX_ARRAY_BUFFER_BINDING'
+%% ).
+%%
+%% When a color index array is specified, `Type' , `Stride' , and `Pointer'
+%% are saved as client-side state, in addition to the current vertex array buffer object
+%% binding.
+%%
+%% To enable and disable the color index array, call {@link gl:enableClientState/1} and {@link gl:enableClientState/1}
+%% with the argument `?GL_INDEX_ARRAY'. If enabled, the color index array is used when
+%% {@link gl:drawArrays/3} , {@link gl:multiDrawArrays/3} , {@link gl:drawElements/4} , see `glMultiDrawElements'
+%% , {@link gl:drawRangeElements/6} , or {@link gl:arrayElement/1} is called.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIndexPointer.xml">external</a> documentation.
+-spec indexPointer(Type, Stride, Ptr) -> ok when Type :: enum(),Stride :: integer(),Ptr :: offset()|mem().
+indexPointer(Type,Stride,Ptr) when is_integer(Ptr) ->
+ cast(5192, <<Type:?GLenum,Stride:?GLsizei,Ptr:?GLuint>>);
+indexPointer(Type,Stride,Ptr) ->
+ send_bin(Ptr),
+ cast(5193, <<Type:?GLenum,Stride:?GLsizei>>).
+
+%% @doc Define an array of texture coordinates
+%%
+%% ``gl:texCoordPointer'' specifies the location and data format of an array of texture
+%% coordinates to use when rendering. `Size' specifies the number of coordinates per
+%% texture coordinate set, and must be 1, 2, 3, or 4. `Type' specifies the data type
+%% of each texture coordinate, and `Stride' specifies the byte stride from one texture
+%% coordinate set to the next, allowing vertices and attributes to be packed into a single
+%% array or stored in separate arrays. (Single-array storage may be more efficient on some
+%% implementations; see {@link gl:interleavedArrays/3} .)
+%%
+%% If a non-zero named buffer object is bound to the `?GL_ARRAY_BUFFER' target (see {@link gl:bindBuffer/2}
+%% ) while a texture coordinate array is specified, `Pointer' is treated as a byte offset
+%% into the buffer object's data store. Also, the buffer object binding (`?GL_ARRAY_BUFFER_BINDING'
+%% ) is saved as texture coordinate vertex array client-side state (`?GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING'
+%% ).
+%%
+%% When a texture coordinate array is specified, `Size' , `Type' , `Stride' ,
+%% and `Pointer' are saved as client-side state, in addition to the current vertex array
+%% buffer object binding.
+%%
+%% To enable and disable a texture coordinate array, call {@link gl:enableClientState/1}
+%% and {@link gl:enableClientState/1} with the argument `?GL_TEXTURE_COORD_ARRAY'. If
+%% enabled, the texture coordinate array is used when {@link gl:arrayElement/1} , {@link gl:drawArrays/3}
+%% , {@link gl:multiDrawArrays/3} , {@link gl:drawElements/4} , see `glMultiDrawElements',
+%% or {@link gl:drawRangeElements/6} is called.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoordPointer.xml">external</a> documentation.
+-spec texCoordPointer(Size, Type, Stride, Ptr) -> ok when Size :: integer(),Type :: enum(),Stride :: integer(),Ptr :: offset()|mem().
+texCoordPointer(Size,Type,Stride,Ptr) when is_integer(Ptr) ->
+ cast(5194, <<Size:?GLint,Type:?GLenum,Stride:?GLsizei,Ptr:?GLuint>>);
+texCoordPointer(Size,Type,Stride,Ptr) ->
+ send_bin(Ptr),
+ cast(5195, <<Size:?GLint,Type:?GLenum,Stride:?GLsizei>>).
+
+%% @doc Define an array of edge flags
+%%
+%% ``gl:edgeFlagPointer'' specifies the location and data format of an array of boolean
+%% edge flags to use when rendering. `Stride' specifies the byte stride from one edge
+%% flag to the next, allowing vertices and attributes to be packed into a single array or
+%% stored in separate arrays.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_ARRAY_BUFFER' target (see {@link gl:bindBuffer/2}
+%% ) while an edge flag array is specified, `Pointer' is treated as a byte offset into
+%% the buffer object's data store. Also, the buffer object binding (`?GL_ARRAY_BUFFER_BINDING'
+%% ) is saved as edge flag vertex array client-side state (`?GL_EDGE_FLAG_ARRAY_BUFFER_BINDING'
+%% ).
+%%
+%% When an edge flag array is specified, `Stride' and `Pointer' are saved as client-side
+%% state, in addition to the current vertex array buffer object binding.
+%%
+%% To enable and disable the edge flag array, call {@link gl:enableClientState/1} and {@link gl:enableClientState/1}
+%% with the argument `?GL_EDGE_FLAG_ARRAY'. If enabled, the edge flag array is used
+%% when {@link gl:drawArrays/3} , {@link gl:multiDrawArrays/3} , {@link gl:drawElements/4} , see `glMultiDrawElements'
+%% , {@link gl:drawRangeElements/6} , or {@link gl:arrayElement/1} is called.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEdgeFlagPointer.xml">external</a> documentation.
+-spec edgeFlagPointer(Stride, Ptr) -> ok when Stride :: integer(),Ptr :: offset()|mem().
+edgeFlagPointer(Stride,Ptr) when is_integer(Ptr) ->
+ cast(5196, <<Stride:?GLsizei,Ptr:?GLuint>>);
+edgeFlagPointer(Stride,Ptr) ->
+ send_bin(Ptr),
+ cast(5197, <<Stride:?GLsizei>>).
+
+%% @doc Render a vertex using the specified vertex array element
+%%
+%% ``gl:arrayElement'' commands are used within {@link gl:'begin'/1} / {@link gl:'begin'/1} pairs
+%% to specify vertex and attribute data for point, line, and polygon primitives. If `?GL_VERTEX_ARRAY'
+%% is enabled when ``gl:arrayElement'' is called, a single vertex is drawn, using vertex
+%% and attribute data taken from location `I' of the enabled arrays. If `?GL_VERTEX_ARRAY'
+%% is not enabled, no drawing occurs but the attributes corresponding to the enabled arrays
+%% are modified.
+%%
+%% Use ``gl:arrayElement'' to construct primitives by indexing vertex data, rather than
+%% by streaming through arrays of data in first-to-last order. Because each call specifies
+%% only a single vertex, it is possible to explicitly specify per-primitive attributes such
+%% as a single normal for each triangle.
+%%
+%% Changes made to array data between the execution of {@link gl:'begin'/1} and the corresponding
+%% execution of {@link gl:'begin'/1} may affect calls to ``gl:arrayElement'' that are made within
+%% the same {@link gl:'begin'/1} / {@link gl:'begin'/1} period in nonsequential ways. That is, a call
+%% to ``gl:arrayElement'' that precedes a change to array data may access the changed data,
+%% and a call that follows a change to array data may access original data.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glArrayElement.xml">external</a> documentation.
+-spec arrayElement(I) -> ok when I :: integer().
+arrayElement(I) ->
+ cast(5198, <<I:?GLint>>).
-%% @spec (Angle::float(),X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRotate.xml">external</a> documentation.
--spec rotated(float(),float(),float(),float()) -> ok.
-rotated(Angle,X,Y,Z) ->
- cast(5248, <<Angle:?GLdouble,X:?GLdouble,Y:?GLdouble,Z:?GLdouble>>).
+%% @doc Render primitives from array data
+%%
+%% ``gl:drawArrays'' specifies multiple geometric primitives with very few subroutine calls.
+%% Instead of calling a GL procedure to pass each individual vertex, normal, texture coordinate,
+%% edge flag, or color, you can prespecify separate arrays of vertices, normals, and colors
+%% and use them to construct a sequence of primitives with a single call to ``gl:drawArrays''
+%% .
+%%
+%% When ``gl:drawArrays'' is called, it uses `Count' sequential elements from each
+%% enabled array to construct a sequence of geometric primitives, beginning with element `First'
+%% . `Mode' specifies what kind of primitives are constructed and how the array elements
+%% construct those primitives.
+%%
+%% Vertex attributes that are modified by ``gl:drawArrays'' have an unspecified value
+%% after ``gl:drawArrays'' returns. Attributes that aren't modified remain well defined.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawArrays.xml">external</a> documentation.
+-spec drawArrays(Mode, First, Count) -> ok when Mode :: enum(),First :: integer(),Count :: integer().
+drawArrays(Mode,First,Count) ->
+ cast(5199, <<Mode:?GLenum,First:?GLint,Count:?GLsizei>>).
-%% @spec (Angle::float(),X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRotate.xml">external</a> documentation.
--spec rotatef(float(),float(),float(),float()) -> ok.
-rotatef(Angle,X,Y,Z) ->
- cast(5249, <<Angle:?GLfloat,X:?GLfloat,Y:?GLfloat,Z:?GLfloat>>).
+%% @doc Render primitives from array data
+%%
+%% ``gl:drawElements'' specifies multiple geometric primitives with very few subroutine
+%% calls. Instead of calling a GL function to pass each individual vertex, normal, texture
+%% coordinate, edge flag, or color, you can prespecify separate arrays of vertices, normals,
+%% and so on, and use them to construct a sequence of primitives with a single call to ``gl:drawElements''
+%% .
+%%
+%% When ``gl:drawElements'' is called, it uses `Count' sequential elements from an
+%% enabled array, starting at `Indices' to construct a sequence of geometric primitives.
+%% `Mode' specifies what kind of primitives are constructed and how the array elements
+%% construct these primitives. If more than one array is enabled, each is used.
+%%
+%% Vertex attributes that are modified by ``gl:drawElements'' have an unspecified value
+%% after ``gl:drawElements'' returns. Attributes that aren't modified maintain their previous
+%% values.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawElements.xml">external</a> documentation.
+-spec drawElements(Mode, Count, Type, Indices) -> ok when Mode :: enum(),Count :: integer(),Type :: enum(),Indices :: offset()|mem().
+drawElements(Mode,Count,Type,Indices) when is_integer(Indices) ->
+ cast(5200, <<Mode:?GLenum,Count:?GLsizei,Type:?GLenum,Indices:?GLuint>>);
+drawElements(Mode,Count,Type,Indices) ->
+ send_bin(Indices),
+ cast(5201, <<Mode:?GLenum,Count:?GLsizei,Type:?GLenum>>).
-%% @spec (X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glScale.xml">external</a> documentation.
--spec scaled(float(),float(),float()) -> ok.
-scaled(X,Y,Z) ->
- cast(5250, <<X:?GLdouble,Y:?GLdouble,Z:?GLdouble>>).
+%% @doc Simultaneously specify and enable several interleaved arrays
+%%
+%% ``gl:interleavedArrays'' lets you specify and enable individual color, normal, texture
+%% and vertex arrays whose elements are part of a larger aggregate array element. For some
+%% implementations, this is more efficient than specifying the arrays separately.
+%%
+%% If `Stride' is 0, the aggregate elements are stored consecutively. Otherwise, `Stride'
+%% bytes occur between the beginning of one aggregate array element and the beginning of
+%% the next aggregate array element.
+%%
+%% `Format' serves as a ``key'' describing the extraction of individual arrays from
+%% the aggregate array. If `Format' contains a T, then texture coordinates are extracted
+%% from the interleaved array. If C is present, color values are extracted. If N is present,
+%% normal coordinates are extracted. Vertex coordinates are always extracted.
+%%
+%% The digits 2, 3, and 4 denote how many values are extracted. F indicates that values
+%% are extracted as floating-point values. Colors may also be extracted as 4 unsigned bytes
+%% if 4UB follows the C. If a color is extracted as 4 unsigned bytes, the vertex array element
+%% which follows is located at the first possible floating-point aligned address.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glInterleavedArrays.xml">external</a> documentation.
+-spec interleavedArrays(Format, Stride, Pointer) -> ok when Format :: enum(),Stride :: integer(),Pointer :: offset()|mem().
+interleavedArrays(Format,Stride,Pointer) when is_integer(Pointer) ->
+ cast(5202, <<Format:?GLenum,Stride:?GLsizei,Pointer:?GLuint>>);
+interleavedArrays(Format,Stride,Pointer) ->
+ send_bin(Pointer),
+ cast(5203, <<Format:?GLenum,Stride:?GLsizei>>).
-%% @spec (X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glScale.xml">external</a> documentation.
--spec scalef(float(),float(),float()) -> ok.
-scalef(X,Y,Z) ->
- cast(5251, <<X:?GLfloat,Y:?GLfloat,Z:?GLfloat>>).
+%% @doc Select flat or smooth shading
+%%
+%% GL primitives can have either flat or smooth shading. Smooth shading, the default, causes
+%% the computed colors of vertices to be interpolated as the primitive is rasterized, typically
+%% assigning different colors to each resulting pixel fragment. Flat shading selects the
+%% computed color of just one vertex and assigns it to all the pixel fragments generated
+%% by rasterizing a single primitive. In either case, the computed color of a vertex is the
+%% result of lighting if lighting is enabled, or it is the current color at the time the
+%% vertex was specified if lighting is disabled.
+%%
+%% Flat and smooth shading are indistinguishable for points. Starting when {@link gl:'begin'/1}
+%% is issued and counting vertices and primitives from 1, the GL gives each flat-shaded line
+%% segment i the computed color of vertex i+1, its second vertex. Counting similarly
+%% from 1, the GL gives each flat-shaded polygon the computed color of the vertex listed
+%% in the following table. This is the last vertex to specify the polygon in all cases except
+%% single polygons, where the first vertex specifies the flat-shaded color.
+%%
+%% <table><tbody><tr><td>` Primitive Type of Polygon ' i</td><td>` Vertex '</td></tr>
+%% </tbody><tbody><tr><td> Single polygon ( i== 1) </td><td> 1 </td></tr><tr><td> Triangle
+%% strip </td><td> i+2</td></tr><tr><td> Triangle fan </td><td> i+2</td></tr><tr><td> Independent
+%% triangle </td><td> 3 i</td></tr><tr><td> Quad strip </td><td> 2 i+2</td></tr><tr><td>
+%% Independent quad </td><td> 4 i</td></tr></tbody></table>
+%%
+%% Flat and smooth shading are specified by ``gl:shadeModel'' with `Mode' set to `?GL_FLAT'
+%% and `?GL_SMOOTH', respectively.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glShadeModel.xml">external</a> documentation.
+-spec shadeModel(Mode) -> ok when Mode :: enum().
+shadeModel(Mode) ->
+ cast(5204, <<Mode:?GLenum>>).
-%% @spec (X::integer(),Y::integer(),Width::integer(),Height::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glScissor.xml">external</a> documentation.
--spec scissor(integer(),integer(),integer(),integer()) -> ok.
-scissor(X,Y,Width,Height) ->
- cast(5252, <<X:?GLint,Y:?GLint,Width:?GLsizei,Height:?GLsizei>>).
+%% @doc Set light source parameters
+%%
+%% ``gl:light'' sets the values of individual light source parameters. `Light' names
+%% the light and is a symbolic name of the form `?GL_LIGHT' i, where i ranges from 0
+%% to the value of `?GL_MAX_LIGHTS' - 1. `Pname' specifies one of ten light source
+%% parameters, again by symbolic name. `Params' is either a single value or a pointer
+%% to an array that contains the new values.
+%%
+%% To enable and disable lighting calculation, call {@link gl:enable/1} and {@link gl:enable/1}
+%% with argument `?GL_LIGHTING'. Lighting is initially disabled. When it is enabled,
+%% light sources that are enabled contribute to the lighting calculation. Light source i
+%% is enabled and disabled using {@link gl:enable/1} and {@link gl:enable/1} with argument `?GL_LIGHT'
+%% i.
+%%
+%% The ten light parameters are as follows:
+%%
+%% `?GL_AMBIENT': `Params' contains four integer or floating-point values that
+%% specify the ambient RGBA intensity of the light. Integer values are mapped linearly such
+%% that the most positive representable value maps to 1.0, and the most negative representable
+%% value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point
+%% values are clamped. The initial ambient light intensity is (0, 0, 0, 1).
+%%
+%% `?GL_DIFFUSE': `Params' contains four integer or floating-point values that
+%% specify the diffuse RGBA intensity of the light. Integer values are mapped linearly such
+%% that the most positive representable value maps to 1.0, and the most negative representable
+%% value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point
+%% values are clamped. The initial value for `?GL_LIGHT0' is (1, 1, 1, 1); for other
+%% lights, the initial value is (0, 0, 0, 1).
+%%
+%% `?GL_SPECULAR': `Params' contains four integer or floating-point values that
+%% specify the specular RGBA intensity of the light. Integer values are mapped linearly such
+%% that the most positive representable value maps to 1.0, and the most negative representable
+%% value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point
+%% values are clamped. The initial value for `?GL_LIGHT0' is (1, 1, 1, 1); for other
+%% lights, the initial value is (0, 0, 0, 1).
+%%
+%% `?GL_POSITION': `Params' contains four integer or floating-point values that
+%% specify the position of the light in homogeneous object coordinates. Both integer and
+%% floating-point values are mapped directly. Neither integer nor floating-point values are
+%% clamped.
+%%
+%% The position is transformed by the modelview matrix when ``gl:light'' is called (just
+%% as if it were a point), and it is stored in eye coordinates. If the w component of the
+%% position is 0, the light is treated as a directional source. Diffuse and specular lighting
+%% calculations take the light's direction, but not its actual position, into account, and
+%% attenuation is disabled. Otherwise, diffuse and specular lighting calculations are based
+%% on the actual location of the light in eye coordinates, and attenuation is enabled. The
+%% initial position is (0, 0, 1, 0); thus, the initial light source is directional, parallel
+%% to, and in the direction of the -z axis.
+%%
+%% `?GL_SPOT_DIRECTION': `Params' contains three integer or floating-point values
+%% that specify the direction of the light in homogeneous object coordinates. Both integer
+%% and floating-point values are mapped directly. Neither integer nor floating-point values
+%% are clamped.
+%%
+%% The spot direction is transformed by the upper 3x3 of the modelview matrix when ``gl:light''
+%% is called, and it is stored in eye coordinates. It is significant only when `?GL_SPOT_CUTOFF'
+%% is not 180, which it is initially. The initial direction is (0 0 -1).
+%%
+%% `?GL_SPOT_EXPONENT': `Params' is a single integer or floating-point value that
+%% specifies the intensity distribution of the light. Integer and floating-point values are
+%% mapped directly. Only values in the range [0 128] are accepted.
+%%
+%% Effective light intensity is attenuated by the cosine of the angle between the direction
+%% of the light and the direction from the light to the vertex being lighted, raised to the
+%% power of the spot exponent. Thus, higher spot exponents result in a more focused light
+%% source, regardless of the spot cutoff angle (see `?GL_SPOT_CUTOFF', next paragraph).
+%% The initial spot exponent is 0, resulting in uniform light distribution.
+%%
+%% `?GL_SPOT_CUTOFF': `Params' is a single integer or floating-point value that
+%% specifies the maximum spread angle of a light source. Integer and floating-point values
+%% are mapped directly. Only values in the range [0 90] and the special value 180 are accepted.
+%% If the angle between the direction of the light and the direction from the light to the
+%% vertex being lighted is greater than the spot cutoff angle, the light is completely masked.
+%% Otherwise, its intensity is controlled by the spot exponent and the attenuation factors.
+%% The initial spot cutoff is 180, resulting in uniform light distribution.
+%%
+%% `?GL_CONSTANT_ATTENUATION'
+%%
+%% `?GL_LINEAR_ATTENUATION'
+%%
+%% `?GL_QUADRATIC_ATTENUATION': `Params' is a single integer or floating-point
+%% value that specifies one of the three light attenuation factors. Integer and floating-point
+%% values are mapped directly. Only nonnegative values are accepted. If the light is positional,
+%% rather than directional, its intensity is attenuated by the reciprocal of the sum of the
+%% constant factor, the linear factor times the distance between the light and the vertex
+%% being lighted, and the quadratic factor times the square of the same distance. The initial
+%% attenuation factors are (1, 0, 0), resulting in no attenuation.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLight.xml">external</a> documentation.
+-spec lightf(Light, Pname, Param) -> ok when Light :: enum(),Pname :: enum(),Param :: float().
+lightf(Light,Pname,Param) ->
+ cast(5205, <<Light:?GLenum,Pname:?GLenum,Param:?GLfloat>>).
-%% @spec (Size::integer(),Buffer::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSelectBuffer.xml">external</a> documentation.
--spec selectBuffer(integer(),mem()) -> ok.
-selectBuffer(Size,Buffer) ->
- send_bin(Buffer),
- call(5253, <<Size:?GLsizei>>).
+%% @doc
+%% See {@link lightf/3}
+-spec lighti(Light, Pname, Param) -> ok when Light :: enum(),Pname :: enum(),Param :: integer().
+lighti(Light,Pname,Param) ->
+ cast(5206, <<Light:?GLenum,Pname:?GLenum,Param:?GLint>>).
-%% @spec (Mode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glShadeModel.xml">external</a> documentation.
--spec shadeModel(enum()) -> ok.
-shadeModel(Mode) ->
- cast(5254, <<Mode:?GLenum>>).
+%% @doc
+%% See {@link lightf/3}
+-spec lightfv(Light, Pname, Params) -> ok when Light :: enum(),Pname :: enum(),Params :: {float()}.
+lightfv(Light,Pname,Params) ->
+ cast(5207, <<Light:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
+ (<< <<C:?GLfloat>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
-%% @spec (Func::enum(),Ref::integer(),Mask::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glStencilFunc.xml">external</a> documentation.
--spec stencilFunc(enum(),integer(),integer()) -> ok.
-stencilFunc(Func,Ref,Mask) ->
- cast(5255, <<Func:?GLenum,Ref:?GLint,Mask:?GLuint>>).
+%% @doc
+%% See {@link lightf/3}
+-spec lightiv(Light, Pname, Params) -> ok when Light :: enum(),Pname :: enum(),Params :: {integer()}.
+lightiv(Light,Pname,Params) ->
+ cast(5208, <<Light:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
+ (<< <<C:?GLint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
-%% @spec (Mask::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glStencilMask.xml">external</a> documentation.
--spec stencilMask(integer()) -> ok.
-stencilMask(Mask) ->
- cast(5256, <<Mask:?GLuint>>).
+%% @doc Return light source parameter values
+%%
+%% ``gl:getLight'' returns in `Params' the value or values of a light source parameter.
+%% `Light' names the light and is a symbolic name of the form `?GL_LIGHT' i where
+%% i ranges from 0 to the value of `?GL_MAX_LIGHTS' - 1. `?GL_MAX_LIGHTS' is an
+%% implementation dependent constant that is greater than or equal to eight. `Pname'
+%% specifies one of ten light source parameters, again by symbolic name.
+%%
+%% The following parameters are defined:
+%%
+%% `?GL_AMBIENT': `Params' returns four integer or floating-point values representing
+%% the ambient intensity of the light source. Integer values, when requested, are linearly
+%% mapped from the internal floating-point representation such that 1.0 maps to the most
+%% positive representable integer value, and -1.0 maps to the most negative representable
+%% integer value. If the internal value is outside the range [-1 1], the corresponding integer
+%% return value is undefined. The initial value is (0, 0, 0, 1).
+%%
+%% `?GL_DIFFUSE': `Params' returns four integer or floating-point values representing
+%% the diffuse intensity of the light source. Integer values, when requested, are linearly
+%% mapped from the internal floating-point representation such that 1.0 maps to the most
+%% positive representable integer value, and -1.0 maps to the most negative representable
+%% integer value. If the internal value is outside the range [-1 1], the corresponding integer
+%% return value is undefined. The initial value for `?GL_LIGHT0' is (1, 1, 1, 1); for
+%% other lights, the initial value is (0, 0, 0, 0).
+%%
+%% `?GL_SPECULAR': `Params' returns four integer or floating-point values representing
+%% the specular intensity of the light source. Integer values, when requested, are linearly
+%% mapped from the internal floating-point representation such that 1.0 maps to the most
+%% positive representable integer value, and -1.0 maps to the most negative representable
+%% integer value. If the internal value is outside the range [-1 1], the corresponding integer
+%% return value is undefined. The initial value for `?GL_LIGHT0' is (1, 1, 1, 1); for
+%% other lights, the initial value is (0, 0, 0, 0).
+%%
+%% `?GL_POSITION': `Params' returns four integer or floating-point values representing
+%% the position of the light source. Integer values, when requested, are computed by rounding
+%% the internal floating-point values to the nearest integer value. The returned values are
+%% those maintained in eye coordinates. They will not be equal to the values specified using
+%% {@link gl:lightf/3} , unless the modelview matrix was identity at the time {@link gl:lightf/3}
+%% was called. The initial value is (0, 0, 1, 0).
+%%
+%% `?GL_SPOT_DIRECTION': `Params' returns three integer or floating-point values
+%% representing the direction of the light source. Integer values, when requested, are computed
+%% by rounding the internal floating-point values to the nearest integer value. The returned
+%% values are those maintained in eye coordinates. They will not be equal to the values specified
+%% using {@link gl:lightf/3} , unless the modelview matrix was identity at the time {@link gl:lightf/3}
+%% was called. Although spot direction is normalized before being used in the lighting equation,
+%% the returned values are the transformed versions of the specified values prior to normalization.
+%% The initial value is (0 0 -1).
+%%
+%% `?GL_SPOT_EXPONENT': `Params' returns a single integer or floating-point value
+%% representing the spot exponent of the light. An integer value, when requested, is computed
+%% by rounding the internal floating-point representation to the nearest integer. The initial
+%% value is 0.
+%%
+%% `?GL_SPOT_CUTOFF': `Params' returns a single integer or floating-point value
+%% representing the spot cutoff angle of the light. An integer value, when requested, is
+%% computed by rounding the internal floating-point representation to the nearest integer.
+%% The initial value is 180.
+%%
+%% `?GL_CONSTANT_ATTENUATION': `Params' returns a single integer or floating-point
+%% value representing the constant (not distance-related) attenuation of the light. An integer
+%% value, when requested, is computed by rounding the internal floating-point representation
+%% to the nearest integer. The initial value is 1.
+%%
+%% `?GL_LINEAR_ATTENUATION': `Params' returns a single integer or floating-point
+%% value representing the linear attenuation of the light. An integer value, when requested,
+%% is computed by rounding the internal floating-point representation to the nearest integer.
+%% The initial value is 0.
+%%
+%% `?GL_QUADRATIC_ATTENUATION': `Params' returns a single integer or floating-point
+%% value representing the quadratic attenuation of the light. An integer value, when requested,
+%% is computed by rounding the internal floating-point representation to the nearest integer.
+%% The initial value is 0.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetLight.xml">external</a> documentation.
+-spec getLightfv(Light, Pname) -> {float(),float(),float(),float()} when Light :: enum(),Pname :: enum().
+getLightfv(Light,Pname) ->
+ call(5209, <<Light:?GLenum,Pname:?GLenum>>).
-%% @spec (Fail::enum(),Zfail::enum(),Zpass::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glStencilOp.xml">external</a> documentation.
--spec stencilOp(enum(),enum(),enum()) -> ok.
-stencilOp(Fail,Zfail,Zpass) ->
- cast(5257, <<Fail:?GLenum,Zfail:?GLenum,Zpass:?GLenum>>).
+%% @doc
+%% See {@link getLightfv/2}
+-spec getLightiv(Light, Pname) -> {integer(),integer(),integer(),integer()} when Light :: enum(),Pname :: enum().
+getLightiv(Light,Pname) ->
+ call(5210, <<Light:?GLenum,Pname:?GLenum>>).
-%% @spec (S::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord1d(float()) -> ok.
-texCoord1d(S) ->
- cast(5258, <<S:?GLdouble>>).
+%% @doc Set the lighting model parameters
+%%
+%% ``gl:lightModel'' sets the lighting model parameter. `Pname' names a parameter
+%% and `Params' gives the new value. There are three lighting model parameters:
+%%
+%% `?GL_LIGHT_MODEL_AMBIENT': `Params' contains four integer or floating-point
+%% values that specify the ambient RGBA intensity of the entire scene. Integer values are
+%% mapped linearly such that the most positive representable value maps to 1.0, and the most
+%% negative representable value maps to -1.0. Floating-point values are mapped directly.
+%% Neither integer nor floating-point values are clamped. The initial ambient scene intensity
+%% is (0.2, 0.2, 0.2, 1.0).
+%%
+%% `?GL_LIGHT_MODEL_COLOR_CONTROL': `Params' must be either `?GL_SEPARATE_SPECULAR_COLOR'
+%% or `?GL_SINGLE_COLOR'. `?GL_SINGLE_COLOR' specifies that a single color is
+%% generated from the lighting computation for a vertex. `?GL_SEPARATE_SPECULAR_COLOR'
+%% specifies that the specular color computation of lighting be stored separately from the
+%% remainder of the lighting computation. The specular color is summed into the generated
+%% fragment's color after the application of texture mapping (if enabled). The initial value
+%% is `?GL_SINGLE_COLOR'.
+%%
+%% `?GL_LIGHT_MODEL_LOCAL_VIEWER': `Params' is a single integer or floating-point
+%% value that specifies how specular reflection angles are computed. If `Params' is
+%% 0 (or 0.0), specular reflection angles take the view direction to be parallel to and in
+%% the direction of the -`z' axis, regardless of the location of the vertex in eye coordinates.
+%% Otherwise, specular reflections are computed from the origin of the eye coordinate system.
+%% The initial value is 0.
+%%
+%% `?GL_LIGHT_MODEL_TWO_SIDE': `Params' is a single integer or floating-point value
+%% that specifies whether one- or two-sided lighting calculations are done for polygons.
+%% It has no effect on the lighting calculations for points, lines, or bitmaps. If `Params'
+%% is 0 (or 0.0), one-sided lighting is specified, and only the `front' material parameters
+%% are used in the lighting equation. Otherwise, two-sided lighting is specified. In this
+%% case, vertices of back-facing polygons are lighted using the `back' material parameters
+%% and have their normals reversed before the lighting equation is evaluated. Vertices of
+%% front-facing polygons are always lighted using the `front' material parameters, with
+%% no change to their normals. The initial value is 0.
+%%
+%% In RGBA mode, the lighted color of a vertex is the sum of the material emission intensity,
+%% the product of the material ambient reflectance and the lighting model full-scene ambient
+%% intensity, and the contribution of each enabled light source. Each light source contributes
+%% the sum of three terms: ambient, diffuse, and specular. The ambient light source contribution
+%% is the product of the material ambient reflectance and the light's ambient intensity.
+%% The diffuse light source contribution is the product of the material diffuse reflectance,
+%% the light's diffuse intensity, and the dot product of the vertex's normal with the normalized
+%% vector from the vertex to the light source. The specular light source contribution is
+%% the product of the material specular reflectance, the light's specular intensity, and
+%% the dot product of the normalized vertex-to-eye and vertex-to-light vectors, raised to
+%% the power of the shininess of the material. All three light source contributions are attenuated
+%% equally based on the distance from the vertex to the light source and on light source
+%% direction, spread exponent, and spread cutoff angle. All dot products are replaced with
+%% 0 if they evaluate to a negative value.
+%%
+%% The alpha component of the resulting lighted color is set to the alpha value of the material
+%% diffuse reflectance.
+%%
+%% In color index mode, the value of the lighted index of a vertex ranges from the ambient
+%% to the specular values passed to {@link gl:materialf/3} using `?GL_COLOR_INDEXES'.
+%% Diffuse and specular coefficients, computed with a (.30, .59, .11) weighting of the lights'
+%% colors, the shininess of the material, and the same reflection and attenuation equations
+%% as in the RGBA case, determine how much above ambient the resulting index is.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLightModel.xml">external</a> documentation.
+-spec lightModelf(Pname, Param) -> ok when Pname :: enum(),Param :: float().
+lightModelf(Pname,Param) ->
+ cast(5211, <<Pname:?GLenum,Param:?GLfloat>>).
-%% @spec ({S}) -> ok
-%% @equiv texCoord1d(S)
--spec texCoord1dv({float()}) -> ok.
-texCoord1dv({S}) -> texCoord1d(S).
+%% @doc
+%% See {@link lightModelf/2}
+-spec lightModeli(Pname, Param) -> ok when Pname :: enum(),Param :: integer().
+lightModeli(Pname,Param) ->
+ cast(5212, <<Pname:?GLenum,Param:?GLint>>).
-%% @spec (S::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord1f(float()) -> ok.
-texCoord1f(S) ->
- cast(5259, <<S:?GLfloat>>).
+%% @doc
+%% See {@link lightModelf/2}
+-spec lightModelfv(Pname, Params) -> ok when Pname :: enum(),Params :: {float()}.
+lightModelfv(Pname,Params) ->
+ cast(5213, <<Pname:?GLenum,(size(Params)):?GLuint,
+ (<< <<C:?GLfloat>> ||C <- tuple_to_list(Params)>>)/binary,0:(((0+size(Params)) rem 2)*32)>>).
-%% @spec ({S}) -> ok
-%% @equiv texCoord1f(S)
--spec texCoord1fv({float()}) -> ok.
-texCoord1fv({S}) -> texCoord1f(S).
+%% @doc
+%% See {@link lightModelf/2}
+-spec lightModeliv(Pname, Params) -> ok when Pname :: enum(),Params :: {integer()}.
+lightModeliv(Pname,Params) ->
+ cast(5214, <<Pname:?GLenum,(size(Params)):?GLuint,
+ (<< <<C:?GLint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((0+size(Params)) rem 2)*32)>>).
-%% @spec (S::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord1i(integer()) -> ok.
-texCoord1i(S) ->
- cast(5260, <<S:?GLint>>).
+%% @doc Specify material parameters for the lighting model
+%%
+%% ``gl:material'' assigns values to material parameters. There are two matched sets of
+%% material parameters. One, the `front-facing' set, is used to shade points, lines,
+%% bitmaps, and all polygons (when two-sided lighting is disabled), or just front-facing
+%% polygons (when two-sided lighting is enabled). The other set, `back-facing', is used
+%% to shade back-facing polygons only when two-sided lighting is enabled. Refer to the {@link gl:lightModelf/2}
+%% reference page for details concerning one- and two-sided lighting calculations.
+%%
+%% ``gl:material'' takes three arguments. The first, `Face' , specifies whether the `?GL_FRONT'
+%% materials, the `?GL_BACK' materials, or both `?GL_FRONT_AND_BACK' materials
+%% will be modified. The second, `Pname' , specifies which of several parameters in one
+%% or both sets will be modified. The third, `Params' , specifies what value or values
+%% will be assigned to the specified parameter.
+%%
+%% Material parameters are used in the lighting equation that is optionally applied to each
+%% vertex. The equation is discussed in the {@link gl:lightModelf/2} reference page. The parameters
+%% that can be specified using ``gl:material'', and their interpretations by the lighting
+%% equation, are as follows:
+%%
+%% `?GL_AMBIENT': `Params' contains four integer or floating-point values that
+%% specify the ambient RGBA reflectance of the material. Integer values are mapped linearly
+%% such that the most positive representable value maps to 1.0, and the most negative representable
+%% value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point
+%% values are clamped. The initial ambient reflectance for both front- and back-facing materials
+%% is (0.2, 0.2, 0.2, 1.0).
+%%
+%% `?GL_DIFFUSE': `Params' contains four integer or floating-point values that
+%% specify the diffuse RGBA reflectance of the material. Integer values are mapped linearly
+%% such that the most positive representable value maps to 1.0, and the most negative representable
+%% value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point
+%% values are clamped. The initial diffuse reflectance for both front- and back-facing materials
+%% is (0.8, 0.8, 0.8, 1.0).
+%%
+%% `?GL_SPECULAR': `Params' contains four integer or floating-point values that
+%% specify the specular RGBA reflectance of the material. Integer values are mapped linearly
+%% such that the most positive representable value maps to 1.0, and the most negative representable
+%% value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point
+%% values are clamped. The initial specular reflectance for both front- and back-facing materials
+%% is (0, 0, 0, 1).
+%%
+%% `?GL_EMISSION': `Params' contains four integer or floating-point values that
+%% specify the RGBA emitted light intensity of the material. Integer values are mapped linearly
+%% such that the most positive representable value maps to 1.0, and the most negative representable
+%% value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point
+%% values are clamped. The initial emission intensity for both front- and back-facing materials
+%% is (0, 0, 0, 1).
+%%
+%% `?GL_SHININESS': `Params' is a single integer or floating-point value that specifies
+%% the RGBA specular exponent of the material. Integer and floating-point values are mapped
+%% directly. Only values in the range [0 128] are accepted. The initial specular exponent for both
+%% front- and back-facing materials is 0.
+%%
+%% `?GL_AMBIENT_AND_DIFFUSE': Equivalent to calling ``gl:material'' twice with the
+%% same parameter values, once with `?GL_AMBIENT' and once with `?GL_DIFFUSE'.
+%%
+%% `?GL_COLOR_INDEXES': `Params' contains three integer or floating-point values
+%% specifying the color indices for ambient, diffuse, and specular lighting. These three
+%% values, and `?GL_SHININESS', are the only material values used by the color index
+%% mode lighting equation. Refer to the {@link gl:lightModelf/2} reference page for a discussion
+%% of color index lighting.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMaterial.xml">external</a> documentation.
+-spec materialf(Face, Pname, Param) -> ok when Face :: enum(),Pname :: enum(),Param :: float().
+materialf(Face,Pname,Param) ->
+ cast(5215, <<Face:?GLenum,Pname:?GLenum,Param:?GLfloat>>).
-%% @spec ({S}) -> ok
-%% @equiv texCoord1i(S)
--spec texCoord1iv({integer()}) -> ok.
-texCoord1iv({S}) -> texCoord1i(S).
+%% @doc
+%% See {@link materialf/3}
+-spec materiali(Face, Pname, Param) -> ok when Face :: enum(),Pname :: enum(),Param :: integer().
+materiali(Face,Pname,Param) ->
+ cast(5216, <<Face:?GLenum,Pname:?GLenum,Param:?GLint>>).
-%% @spec (S::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord1s(integer()) -> ok.
-texCoord1s(S) ->
- cast(5261, <<S:?GLshort>>).
+%% @doc
+%% See {@link materialf/3}
+-spec materialfv(Face, Pname, Params) -> ok when Face :: enum(),Pname :: enum(),Params :: {float()}.
+materialfv(Face,Pname,Params) ->
+ cast(5217, <<Face:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
+ (<< <<C:?GLfloat>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
-%% @spec ({S}) -> ok
-%% @equiv texCoord1s(S)
--spec texCoord1sv({integer()}) -> ok.
-texCoord1sv({S}) -> texCoord1s(S).
+%% @doc
+%% See {@link materialf/3}
+-spec materialiv(Face, Pname, Params) -> ok when Face :: enum(),Pname :: enum(),Params :: {integer()}.
+materialiv(Face,Pname,Params) ->
+ cast(5218, <<Face:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
+ (<< <<C:?GLint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
-%% @spec (S::float(),T::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord2d(float(),float()) -> ok.
-texCoord2d(S,T) ->
- cast(5262, <<S:?GLdouble,T:?GLdouble>>).
+%% @doc Return material parameters
+%%
+%% ``gl:getMaterial'' returns in `Params' the value or values of parameter `Pname'
+%% of material `Face' . Six parameters are defined:
+%%
+%% `?GL_AMBIENT': `Params' returns four integer or floating-point values representing
+%% the ambient reflectance of the material. Integer values, when requested, are linearly
+%% mapped from the internal floating-point representation such that 1.0 maps to the most
+%% positive representable integer value, and -1.0 maps to the most negative representable
+%% integer value. If the internal value is outside the range [-1 1], the corresponding integer
+%% return value is undefined. The initial value is (0.2, 0.2, 0.2, 1.0)
+%%
+%% `?GL_DIFFUSE': `Params' returns four integer or floating-point values representing
+%% the diffuse reflectance of the material. Integer values, when requested, are linearly
+%% mapped from the internal floating-point representation such that 1.0 maps to the most
+%% positive representable integer value, and -1.0 maps to the most negative representable
+%% integer value. If the internal value is outside the range [-1 1], the corresponding integer
+%% return value is undefined. The initial value is (0.8, 0.8, 0.8, 1.0).
+%%
+%% `?GL_SPECULAR': `Params' returns four integer or floating-point values representing
+%% the specular reflectance of the material. Integer values, when requested, are linearly
+%% mapped from the internal floating-point representation such that 1.0 maps to the most
+%% positive representable integer value, and -1.0 maps to the most negative representable
+%% integer value. If the internal value is outside the range [-1 1], the corresponding integer
+%% return value is undefined. The initial value is (0, 0, 0, 1).
+%%
+%% `?GL_EMISSION': `Params' returns four integer or floating-point values representing
+%% the emitted light intensity of the material. Integer values, when requested, are linearly
+%% mapped from the internal floating-point representation such that 1.0 maps to the most
+%% positive representable integer value, and -1.0 maps to the most negative representable
+%% integer value. If the internal value is outside the range [-1 1], the corresponding integer
+%% return value is undefined. The initial value is (0, 0, 0, 1).
+%%
+%% `?GL_SHININESS': `Params' returns one integer or floating-point value representing
+%% the specular exponent of the material. Integer values, when requested, are computed by
+%% rounding the internal floating-point value to the nearest integer value. The initial value
+%% is 0.
+%%
+%% `?GL_COLOR_INDEXES': `Params' returns three integer or floating-point values
+%% representing the ambient, diffuse, and specular indices of the material. These indices
+%% are used only for color index lighting. (All the other parameters are used only for RGBA
+%% lighting.) Integer values, when requested, are computed by rounding the internal floating-point
+%% values to the nearest integer values.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetMaterial.xml">external</a> documentation.
+-spec getMaterialfv(Face, Pname) -> {float(),float(),float(),float()} when Face :: enum(),Pname :: enum().
+getMaterialfv(Face,Pname) ->
+ call(5219, <<Face:?GLenum,Pname:?GLenum>>).
-%% @spec ({S,T}) -> ok
-%% @equiv texCoord2d(S,T)
--spec texCoord2dv({float(),float()}) -> ok.
-texCoord2dv({S,T}) -> texCoord2d(S,T).
+%% @doc
+%% See {@link getMaterialfv/2}
+-spec getMaterialiv(Face, Pname) -> {integer(),integer(),integer(),integer()} when Face :: enum(),Pname :: enum().
+getMaterialiv(Face,Pname) ->
+ call(5220, <<Face:?GLenum,Pname:?GLenum>>).
-%% @spec (S::float(),T::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord2f(float(),float()) -> ok.
-texCoord2f(S,T) ->
- cast(5263, <<S:?GLfloat,T:?GLfloat>>).
+%% @doc Cause a material color to track the current color
+%%
+%% ``gl:colorMaterial'' specifies which material parameters track the current color. When `?GL_COLOR_MATERIAL'
+%% is enabled, the material parameter or parameters specified by `Mode' , of the material
+%% or materials specified by `Face' , track the current color at all times.
+%%
+%% To enable and disable `?GL_COLOR_MATERIAL', call {@link gl:enable/1} and {@link gl:enable/1}
+%% with argument `?GL_COLOR_MATERIAL'. `?GL_COLOR_MATERIAL' is initially disabled.
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColorMaterial.xml">external</a> documentation.
+-spec colorMaterial(Face, Mode) -> ok when Face :: enum(),Mode :: enum().
+colorMaterial(Face,Mode) ->
+ cast(5221, <<Face:?GLenum,Mode:?GLenum>>).
-%% @spec ({S,T}) -> ok
-%% @equiv texCoord2f(S,T)
--spec texCoord2fv({float(),float()}) -> ok.
-texCoord2fv({S,T}) -> texCoord2f(S,T).
+%% @doc Specify the pixel zoom factors
+%%
+%% ``gl:pixelZoom'' specifies values for the x and y zoom factors. During the execution
+%% of {@link gl:drawPixels/5} or {@link gl:copyPixels/5} , if ( xr, yr) is the current raster
+%% position, and a given element is in the mth row and nth column of the pixel rectangle,
+%% then pixels whose centers are in the rectangle with corners at
+%%
+%% ( xr+n. xfactor, yr+m. yfactor)
+%%
+%% ( xr+(n+1). xfactor, yr+(m+1). yfactor)
+%%
+%% are candidates for replacement. Any pixel whose center lies on the bottom or left edge
+%% of this rectangular region is also modified.
+%%
+%% Pixel zoom factors are not limited to positive values. Negative zoom factors reflect
+%% the resulting image about the current raster position.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPixelZoom.xml">external</a> documentation.
+-spec pixelZoom(Xfactor, Yfactor) -> ok when Xfactor :: float(),Yfactor :: float().
+pixelZoom(Xfactor,Yfactor) ->
+ cast(5222, <<Xfactor:?GLfloat,Yfactor:?GLfloat>>).
-%% @spec (S::integer(),T::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord2i(integer(),integer()) -> ok.
-texCoord2i(S,T) ->
- cast(5264, <<S:?GLint,T:?GLint>>).
+%% @doc Set pixel storage modes
+%%
+%% ``gl:pixelStore'' sets pixel storage modes that affect the operation of subsequent {@link gl:readPixels/7}
+%% as well as the unpacking of texture patterns (see {@link gl:texImage1D/8} , {@link gl:texImage2D/9}
+%% , {@link gl:texImage3D/10} , {@link gl:texSubImage1D/7} , {@link gl:texSubImage1D/7} , {@link gl:texSubImage1D/7}
+%% ), {@link gl:compressedTexImage1D/7} , {@link gl:compressedTexImage2D/8} , {@link gl:compressedTexImage3D/9}
+%% , {@link gl:compressedTexSubImage1D/7} , {@link gl:compressedTexSubImage2D/9} or {@link gl:compressedTexSubImage1D/7}
+%% .
+%%
+%% `Pname' is a symbolic constant indicating the parameter to be set, and `Param'
+%% is the new value. Six of the twelve storage parameters affect how pixel data is returned
+%% to client memory. They are as follows:
+%%
+%% `?GL_PACK_SWAP_BYTES': If true, byte ordering for multibyte color components, depth
+%% components, or stencil indices is reversed. That is, if a four-byte component consists
+%% of bytes b 0, b 1, b 2, b 3, it is stored in memory as b 3, b 2, b 1, b 0 if `?GL_PACK_SWAP_BYTES'
+%% is true. `?GL_PACK_SWAP_BYTES' has no effect on the memory order of components within
+%% a pixel, only on the order of bytes within components or indices. For example, the three
+%% components of a `?GL_RGB' format pixel are always stored with red first, green second,
+%% and blue third, regardless of the value of `?GL_PACK_SWAP_BYTES'.
+%%
+%% `?GL_PACK_LSB_FIRST': If true, bits are ordered within a byte from least significant
+%% to most significant; otherwise, the first bit in each byte is the most significant one.
+%%
+%% `?GL_PACK_ROW_LENGTH': If greater than 0, `?GL_PACK_ROW_LENGTH' defines the
+%% number of pixels in a row. If the first pixel of a row is placed at location p in memory,
+%% then the location of the first pixel of the next row is obtained by skipping
+%%
+%% k={n l(a/s) |(s n l)/a| s&gt;= a s&lt; a)
+%%
+%% components or indices, where n is the number of components or indices in a pixel, l
+%% is the number of pixels in a row (`?GL_PACK_ROW_LENGTH' if it is greater than 0,
+%% the width argument to the pixel routine otherwise), a is the value of `?GL_PACK_ALIGNMENT'
+%% , and s is the size, in bytes, of a single component (if a&lt; s, then it is as if a=
+%% s). In the case of 1-bit values, the location of the next row is obtained by skipping
+%%
+%% k= 8 a |(n l)/(8 a)|
+%%
+%% components or indices.
+%%
+%% The word `component' in this description refers to the nonindex values red, green,
+%% blue, alpha, and depth. Storage format `?GL_RGB', for example, has three components
+%% per pixel: first red, then green, and finally blue.
+%%
+%% `?GL_PACK_IMAGE_HEIGHT': If greater than 0, `?GL_PACK_IMAGE_HEIGHT' defines
+%% the number of pixels in an image three-dimensional texture volume, where ``image'' is
+%% defined by all pixels sharing the same third dimension index. If the first pixel of a
+%% row is placed at location p in memory, then the location of the first pixel of the next
+%% row is obtained by skipping
+%%
+%% k={n l h(a/s) |(s n l h)/a| s&gt;= a s&lt; a)
+%%
+%% components or indices, where n is the number of components or indices in a pixel, l
+%% is the number of pixels in a row (`?GL_PACK_ROW_LENGTH' if it is greater than 0,
+%% the width argument to {@link gl:texImage3D/10} otherwise), h is the number of rows in
+%% a pixel image (`?GL_PACK_IMAGE_HEIGHT' if it is greater than 0, the height argument
+%% to the {@link gl:texImage3D/10} routine otherwise), a is the value of `?GL_PACK_ALIGNMENT'
+%% , and s is the size, in bytes, of a single component (if a&lt; s, then it is as if
+%% a= s).
+%%
+%% The word `component' in this description refers to the nonindex values red, green,
+%% blue, alpha, and depth. Storage format `?GL_RGB', for example, has three components
+%% per pixel: first red, then green, and finally blue.
+%%
+%% `?GL_PACK_SKIP_PIXELS', `?GL_PACK_SKIP_ROWS', and `?GL_PACK_SKIP_IMAGES'
+%%
+%% These values are provided as a convenience to the programmer; they provide no functionality
+%% that cannot be duplicated simply by incrementing the pointer passed to {@link gl:readPixels/7}
+%% . Setting `?GL_PACK_SKIP_PIXELS' to i is equivalent to incrementing the pointer
+%% by i n components or indices, where n is the number of components or indices in each
+%% pixel. Setting `?GL_PACK_SKIP_ROWS' to j is equivalent to incrementing the pointer
+%% by j m components or indices, where m is the number of components or indices per
+%% row, as just computed in the `?GL_PACK_ROW_LENGTH' section. Setting `?GL_PACK_SKIP_IMAGES'
+%% to k is equivalent to incrementing the pointer by k p, where p is the number of
+%% components or indices per image, as computed in the `?GL_PACK_IMAGE_HEIGHT' section.
+%%
+%%
+%% `?GL_PACK_ALIGNMENT': Specifies the alignment requirements for the start of each
+%% pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered
+%% bytes), 4 (word-alignment), and 8 (rows start on double-word boundaries).
+%%
+%% The other six of the twelve storage parameters affect how pixel data is read from client
+%% memory. These values are significant for {@link gl:texImage1D/8} , {@link gl:texImage2D/9} , {@link gl:texImage3D/10}
+%% , {@link gl:texSubImage1D/7} , {@link gl:texSubImage1D/7} , and {@link gl:texSubImage1D/7}
+%%
+%% They are as follows:
+%%
+%% `?GL_UNPACK_SWAP_BYTES': If true, byte ordering for multibyte color components,
+%% depth components, or stencil indices is reversed. That is, if a four-byte component consists
+%% of bytes b 0, b 1, b 2, b 3, it is taken from memory as b 3, b 2, b 1, b 0 if `?GL_UNPACK_SWAP_BYTES'
+%% is true. `?GL_UNPACK_SWAP_BYTES' has no effect on the memory order of components
+%% within a pixel, only on the order of bytes within components or indices. For example,
+%% the three components of a `?GL_RGB' format pixel are always stored with red first,
+%% green second, and blue third, regardless of the value of `?GL_UNPACK_SWAP_BYTES'.
+%%
+%% `?GL_UNPACK_LSB_FIRST': If true, bits are ordered within a byte from least significant
+%% to most significant; otherwise, the first bit in each byte is the most significant one.
+%%
+%% `?GL_UNPACK_ROW_LENGTH': If greater than 0, `?GL_UNPACK_ROW_LENGTH' defines
+%% the number of pixels in a row. If the first pixel of a row is placed at location p in
+%% memory, then the location of the first pixel of the next row is obtained by skipping
+%%
+%% k={n l(a/s) |(s n l)/a| s&gt;= a s&lt; a)
+%%
+%% components or indices, where n is the number of components or indices in a pixel, l
+%% is the number of pixels in a row (`?GL_UNPACK_ROW_LENGTH' if it is greater than 0,
+%% the width argument to the pixel routine otherwise), a is the value of `?GL_UNPACK_ALIGNMENT'
+%% , and s is the size, in bytes, of a single component (if a&lt; s, then it is as if a=
+%% s). In the case of 1-bit values, the location of the next row is obtained by skipping
+%%
+%% k= 8 a |(n l)/(8 a)|
+%%
+%% components or indices.
+%%
+%% The word `component' in this description refers to the nonindex values red, green,
+%% blue, alpha, and depth. Storage format `?GL_RGB', for example, has three components
+%% per pixel: first red, then green, and finally blue.
+%%
+%% `?GL_UNPACK_IMAGE_HEIGHT': If greater than 0, `?GL_UNPACK_IMAGE_HEIGHT' defines
+%% the number of pixels in an image of a three-dimensional texture volume. Where ``image''
+%% is defined by all pixel sharing the same third dimension index. If the first pixel of
+%% a row is placed at location p in memory, then the location of the first pixel of the
+%% next row is obtained by skipping
+%%
+%% k={n l h(a/s) |(s n l h)/a| s&gt;= a s&lt; a)
+%%
+%% components or indices, where n is the number of components or indices in a pixel, l
+%% is the number of pixels in a row (`?GL_UNPACK_ROW_LENGTH' if it is greater than 0,
+%% the width argument to {@link gl:texImage3D/10} otherwise), h is the number of rows in
+%% an image (`?GL_UNPACK_IMAGE_HEIGHT' if it is greater than 0, the height argument
+%% to {@link gl:texImage3D/10} otherwise), a is the value of `?GL_UNPACK_ALIGNMENT',
+%% and s is the size, in bytes, of a single component (if a&lt; s, then it is as if a=
+%% s).
+%%
+%% The word `component' in this description refers to the nonindex values red, green,
+%% blue, alpha, and depth. Storage format `?GL_RGB', for example, has three components
+%% per pixel: first red, then green, and finally blue.
+%%
+%% `?GL_UNPACK_SKIP_PIXELS' and `?GL_UNPACK_SKIP_ROWS'
+%%
+%% These values are provided as a convenience to the programmer; they provide no functionality
+%% that cannot be duplicated by incrementing the pointer passed to {@link gl:texImage1D/8} , {@link gl:texImage2D/9}
+%% , {@link gl:texSubImage1D/7} or {@link gl:texSubImage1D/7} . Setting `?GL_UNPACK_SKIP_PIXELS'
+%% to i is equivalent to incrementing the pointer by i n components or indices, where
+%% n is the number of components or indices in each pixel. Setting `?GL_UNPACK_SKIP_ROWS'
+%% to j is equivalent to incrementing the pointer by j k components or indices, where
+%% k is the number of components or indices per row, as just computed in the `?GL_UNPACK_ROW_LENGTH'
+%% section.
+%%
+%% `?GL_UNPACK_ALIGNMENT': Specifies the alignment requirements for the start of each
+%% pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered
+%% bytes), 4 (word-alignment), and 8 (rows start on double-word boundaries).
+%%
+%% The following table gives the type, initial value, and range of valid values for each
+%% storage parameter that can be set with ``gl:pixelStore''.
+%%
+%% <table><tbody><tr><td> `Pname' </td><td>` Type '</td><td>` Initial Value '</td>
+%% <td>` Valid Range '</td></tr></tbody><tbody><tr><td>`?GL_PACK_SWAP_BYTES'</td><td>
+%% boolean </td><td> false </td><td> true or false </td></tr><tr><td>`?GL_PACK_LSB_FIRST'
+%% </td><td> boolean </td><td> false </td><td> true or false </td></tr><tr><td>`?GL_PACK_ROW_LENGTH'
+%% </td><td> integer </td><td> 0 </td><td>[0)</td></tr><tr><td>`?GL_PACK_IMAGE_HEIGHT'</td>
+%% <td> integer </td><td> 0 </td><td>[0)</td></tr><tr><td>`?GL_PACK_SKIP_ROWS'</td><td>
+%% integer </td><td> 0 </td><td>[0)</td></tr><tr><td>`?GL_PACK_SKIP_PIXELS'</td><td> integer
+%% </td><td> 0 </td><td>[0)</td></tr><tr><td>`?GL_PACK_SKIP_IMAGES'</td><td> integer </td><td>
+%% 0 </td><td>[0)</td></tr><tr><td>`?GL_PACK_ALIGNMENT'</td><td> integer </td><td> 4 </td>
+%% <td> 1, 2, 4, or 8 </td></tr><tr><td>`?GL_UNPACK_SWAP_BYTES'</td><td> boolean </td><td>
+%% false </td><td> true or false </td></tr><tr><td>`?GL_UNPACK_LSB_FIRST'</td><td>
+%% boolean </td><td> false </td><td> true or false </td></tr><tr><td>`?GL_UNPACK_ROW_LENGTH'
+%% </td><td> integer </td><td> 0 </td><td>[0)</td></tr><tr><td>`?GL_UNPACK_IMAGE_HEIGHT'</td>
+%% <td> integer </td><td> 0 </td><td>[0)</td></tr><tr><td>`?GL_UNPACK_SKIP_ROWS'</td><td>
+%% integer </td><td> 0 </td><td>[0)</td></tr><tr><td>`?GL_UNPACK_SKIP_PIXELS'</td><td>
+%% integer </td><td> 0 </td><td>[0)</td></tr><tr><td>`?GL_UNPACK_SKIP_IMAGES'</td><td>
+%% integer </td><td> 0 </td><td>[0)</td></tr><tr><td>`?GL_UNPACK_ALIGNMENT'</td><td> integer
+%% </td><td> 4 </td><td> 1, 2, 4, or 8 </td></tr></tbody></table>
+%%
+%% ``gl:pixelStoref'' can be used to set any pixel store parameter. If the parameter type
+%% is boolean, then if `Param' is 0, the parameter is false; otherwise it is set to
+%% true. If `Pname' is a integer type parameter, `Param' is rounded to the nearest
+%% integer.
+%%
+%% Likewise, ``gl:pixelStorei'' can also be used to set any of the pixel store parameters.
+%% Boolean parameters are set to false if `Param' is 0 and true otherwise.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPixelStore.xml">external</a> documentation.
+-spec pixelStoref(Pname, Param) -> ok when Pname :: enum(),Param :: float().
+pixelStoref(Pname,Param) ->
+ cast(5223, <<Pname:?GLenum,Param:?GLfloat>>).
-%% @spec ({S,T}) -> ok
-%% @equiv texCoord2i(S,T)
--spec texCoord2iv({integer(),integer()}) -> ok.
-texCoord2iv({S,T}) -> texCoord2i(S,T).
+%% @doc
+%% See {@link pixelStoref/2}
+-spec pixelStorei(Pname, Param) -> ok when Pname :: enum(),Param :: integer().
+pixelStorei(Pname,Param) ->
+ cast(5224, <<Pname:?GLenum,Param:?GLint>>).
-%% @spec (S::integer(),T::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord2s(integer(),integer()) -> ok.
-texCoord2s(S,T) ->
- cast(5265, <<S:?GLshort,T:?GLshort>>).
+%% @doc Set pixel transfer modes
+%%
+%% ``gl:pixelTransfer'' sets pixel transfer modes that affect the operation of subsequent {@link gl:copyPixels/5}
+%% , {@link gl:copyTexImage1D/7} , {@link gl:copyTexImage2D/8} , {@link gl:copyTexSubImage1D/6} , {@link gl:copyTexSubImage2D/8}
+%% , {@link gl:copyTexSubImage3D/9} , {@link gl:drawPixels/5} , {@link gl:readPixels/7} , {@link gl:texImage1D/8}
+%% , {@link gl:texImage2D/9} , {@link gl:texImage3D/10} , {@link gl:texSubImage1D/7} , {@link gl:texSubImage1D/7}
+%% , and {@link gl:texSubImage1D/7} commands. Additionally, if the ARB_imaging subset is supported,
+%% the routines {@link gl:colorTable/6} , {@link gl:colorSubTable/6} , {@link gl:convolutionFilter1D/6}
+%% , {@link gl:convolutionFilter2D/7} , {@link gl:histogram/4} , {@link gl:minmax/3} , and {@link gl:separableFilter2D/8}
+%% are also affected. The algorithms that are specified by pixel transfer modes operate
+%% on pixels after they are read from the frame buffer ( {@link gl:copyPixels/5} {@link gl:copyTexImage1D/7}
+%% , {@link gl:copyTexImage2D/8} , {@link gl:copyTexSubImage1D/6} , {@link gl:copyTexSubImage2D/8} ,
+%% {@link gl:copyTexSubImage3D/9} , and {@link gl:readPixels/7} ), or unpacked from client memory
+%% ( {@link gl:drawPixels/5} , {@link gl:texImage1D/8} , {@link gl:texImage2D/9} , {@link gl:texImage3D/10}
+%% , {@link gl:texSubImage1D/7} , {@link gl:texSubImage1D/7} , and {@link gl:texSubImage1D/7} ).
+%% Pixel transfer operations happen in the same order, and in the same manner, regardless
+%% of the command that resulted in the pixel operation. Pixel storage modes (see {@link gl:pixelStoref/2}
+%% ) control the unpacking of pixels being read from client memory and the packing of pixels
+%% being written back into client memory.
+%%
+%% Pixel transfer operations handle four fundamental pixel types: `color', `color index'
+%% , `depth', and `stencil'. `Color' pixels consist of four floating-point
+%% values with unspecified mantissa and exponent sizes, scaled such that 0 represents zero
+%% intensity and 1 represents full intensity. `Color indices' comprise a single fixed-point
+%% value, with unspecified precision to the right of the binary point. `Depth' pixels
+%% comprise a single floating-point value, with unspecified mantissa and exponent sizes,
+%% scaled such that 0.0 represents the minimum depth buffer value, and 1.0 represents the
+%% maximum depth buffer value. Finally, `stencil' pixels comprise a single fixed-point
+%% value, with unspecified precision to the right of the binary point.
+%%
+%% The pixel transfer operations performed on the four basic pixel types are as follows:
+%%
+%% `Color': Each of the four color components is multiplied by a scale factor, then
+%% added to a bias factor. That is, the red component is multiplied by `?GL_RED_SCALE',
+%% then added to `?GL_RED_BIAS'; the green component is multiplied by `?GL_GREEN_SCALE'
+%% , then added to `?GL_GREEN_BIAS'; the blue component is multiplied by `?GL_BLUE_SCALE'
+%% , then added to `?GL_BLUE_BIAS'; and the alpha component is multiplied by `?GL_ALPHA_SCALE'
+%% , then added to `?GL_ALPHA_BIAS'. After all four color components are scaled and
+%% biased, each is clamped to the range [0 1]. All color, scale, and bias values are specified
+%% with ``gl:pixelTransfer''.
+%%
+%% If `?GL_MAP_COLOR' is true, each color component is scaled by the size of the corresponding
+%% color-to-color map, then replaced by the contents of that map indexed by the scaled component.
+%% That is, the red component is scaled by `?GL_PIXEL_MAP_R_TO_R_SIZE', then replaced
+%% by the contents of `?GL_PIXEL_MAP_R_TO_R' indexed by itself. The green component
+%% is scaled by `?GL_PIXEL_MAP_G_TO_G_SIZE', then replaced by the contents of `?GL_PIXEL_MAP_G_TO_G'
+%% indexed by itself. The blue component is scaled by `?GL_PIXEL_MAP_B_TO_B_SIZE',
+%% then replaced by the contents of `?GL_PIXEL_MAP_B_TO_B' indexed by itself. And the
+%% alpha component is scaled by `?GL_PIXEL_MAP_A_TO_A_SIZE', then replaced by the contents
+%% of `?GL_PIXEL_MAP_A_TO_A' indexed by itself. All components taken from the maps are
+%% then clamped to the range [0 1]. `?GL_MAP_COLOR' is specified with ``gl:pixelTransfer''.
+%% The contents of the various maps are specified with {@link gl:pixelMapfv/3} .
+%%
+%% If the ARB_imaging extension is supported, each of the four color components may be scaled
+%% and biased after transformation by the color matrix. That is, the red component is multiplied
+%% by `?GL_POST_COLOR_MATRIX_RED_SCALE', then added to `?GL_POST_COLOR_MATRIX_RED_BIAS'
+%% ; the green component is multiplied by `?GL_POST_COLOR_MATRIX_GREEN_SCALE', then
+%% added to `?GL_POST_COLOR_MATRIX_GREEN_BIAS'; the blue component is multiplied by `?GL_POST_COLOR_MATRIX_BLUE_SCALE'
+%% , then added to `?GL_POST_COLOR_MATRIX_BLUE_BIAS'; and the alpha component is multiplied
+%% by `?GL_POST_COLOR_MATRIX_ALPHA_SCALE', then added to `?GL_POST_COLOR_MATRIX_ALPHA_BIAS'
+%% . After all four color components are scaled and biased, each is clamped to the range [0
+%% 1].
+%%
+%% Similarly, if the ARB_imaging extension is supported, each of the four color components
+%% may be scaled and biased after processing by the enabled convolution filter. That is,
+%% the red component is multiplied by `?GL_POST_CONVOLUTION_RED_SCALE', then added to `?GL_POST_CONVOLUTION_RED_BIAS'
+%% ; the green component is multiplied by `?GL_POST_CONVOLUTION_GREEN_SCALE', then added
+%% to `?GL_POST_CONVOLUTION_GREEN_BIAS'; the blue component is multiplied by `?GL_POST_CONVOLUTION_BLUE_SCALE'
+%% , then added to `?GL_POST_CONVOLUTION_BLUE_BIAS'; and the alpha component is multiplied
+%% by `?GL_POST_CONVOLUTION_ALPHA_SCALE', then added to `?GL_POST_CONVOLUTION_ALPHA_BIAS'
+%% . After all four color components are scaled and biased, each is clamped to the range [0
+%% 1].
+%%
+%% `Color index': Each color index is shifted left by `?GL_INDEX_SHIFT' bits;
+%% any bits beyond the number of fraction bits carried by the fixed-point index are filled
+%% with zeros. If `?GL_INDEX_SHIFT' is negative, the shift is to the right, again zero
+%% filled. Then `?GL_INDEX_OFFSET' is added to the index. `?GL_INDEX_SHIFT' and `?GL_INDEX_OFFSET'
+%% are specified with ``gl:pixelTransfer''.
+%%
+%% From this point, operation diverges depending on the required format of the resulting
+%% pixels. If the resulting pixels are to be written to a color index buffer, or if they
+%% are being read back to client memory in `?GL_COLOR_INDEX' format, the pixels continue
+%% to be treated as indices. If `?GL_MAP_COLOR' is true, each index is masked by 2 n-1
+%% , where n is `?GL_PIXEL_MAP_I_TO_I_SIZE', then replaced by the contents of `?GL_PIXEL_MAP_I_TO_I'
+%% indexed by the masked value. `?GL_MAP_COLOR' is specified with ``gl:pixelTransfer''
+%% . The contents of the index map is specified with {@link gl:pixelMapfv/3} .
+%%
+%% If the resulting pixels are to be written to an RGBA color buffer, or if they are read
+%% back to client memory in a format other than `?GL_COLOR_INDEX', the pixels are converted
+%% from indices to colors by referencing the four maps `?GL_PIXEL_MAP_I_TO_R', `?GL_PIXEL_MAP_I_TO_G'
+%% , `?GL_PIXEL_MAP_I_TO_B', and `?GL_PIXEL_MAP_I_TO_A'. Before being dereferenced,
+%% the index is masked by 2 n-1, where n is `?GL_PIXEL_MAP_I_TO_R_SIZE' for the
+%% red map, `?GL_PIXEL_MAP_I_TO_G_SIZE' for the green map, `?GL_PIXEL_MAP_I_TO_B_SIZE'
+%% for the blue map, and `?GL_PIXEL_MAP_I_TO_A_SIZE' for the alpha map. All components
+%% taken from the maps are then clamped to the range [0 1]. The contents of the four maps is
+%% specified with {@link gl:pixelMapfv/3} .
+%%
+%% `Depth': Each depth value is multiplied by `?GL_DEPTH_SCALE', added to `?GL_DEPTH_BIAS'
+%% , then clamped to the range [0 1].
+%%
+%% `Stencil': Each index is shifted `?GL_INDEX_SHIFT' bits just as a color index
+%% is, then added to `?GL_INDEX_OFFSET'. If `?GL_MAP_STENCIL' is true, each index
+%% is masked by 2 n-1, where n is `?GL_PIXEL_MAP_S_TO_S_SIZE', then replaced by
+%% the contents of `?GL_PIXEL_MAP_S_TO_S' indexed by the masked value.
+%%
+%% The following table gives the type, initial value, and range of valid values for each
+%% of the pixel transfer parameters that are set with ``gl:pixelTransfer''.
+%%
+%% <table><tbody><tr><td> `Pname' </td><td>` Type '</td><td>` Initial Value '</td>
+%% <td>` Valid Range '</td></tr></tbody><tbody><tr><td>`?GL_MAP_COLOR'</td><td>
+%% boolean </td><td> false </td><td> true/false </td></tr><tr><td>`?GL_MAP_STENCIL'</td>
+%% <td> boolean </td><td> false </td><td> true/false </td></tr><tr><td>`?GL_INDEX_SHIFT'</td>
+%% <td> integer </td><td> 0 </td><td>(-)</td></tr><tr><td>`?GL_INDEX_OFFSET'</td><td> integer
+%% </td><td> 0 </td><td>(-)</td></tr><tr><td>`?GL_RED_SCALE'</td><td> float </td><td> 1 </td>
+%% <td>(-)</td></tr><tr><td>`?GL_GREEN_SCALE'</td><td> float </td><td> 1 </td><td>(-)</td></tr>
+%% <tr><td>`?GL_BLUE_SCALE'</td><td> float </td><td> 1 </td><td>(-)</td></tr><tr><td>`?GL_ALPHA_SCALE'
+%% </td><td> float </td><td> 1 </td><td>(-)</td></tr><tr><td>`?GL_DEPTH_SCALE'</td><td>
+%% float </td><td> 1 </td><td>(-)</td></tr><tr><td>`?GL_RED_BIAS'</td><td> float </td><td>
+%% 0 </td><td>(-)</td></tr><tr><td>`?GL_GREEN_BIAS'</td><td> float </td><td> 0 </td><td>(-)</td>
+%% </tr><tr><td>`?GL_BLUE_BIAS'</td><td> float </td><td> 0 </td><td>(-)</td></tr><tr><td>`?GL_ALPHA_BIAS'
+%% </td><td> float </td><td> 0 </td><td>(-)</td></tr><tr><td>`?GL_DEPTH_BIAS'</td><td>
+%% float </td><td> 0 </td><td>(-)</td></tr><tr><td>`?GL_POST_COLOR_MATRIX_RED_SCALE'</td><td>
+%% float </td><td> 1 </td><td>(-)</td></tr><tr><td>`?GL_POST_COLOR_MATRIX_GREEN_SCALE'</td>
+%% <td> float </td><td> 1 </td><td>(-)</td></tr><tr><td>`?GL_POST_COLOR_MATRIX_BLUE_SCALE'</td>
+%% <td> float </td><td> 1 </td><td>(-)</td></tr><tr><td>`?GL_POST_COLOR_MATRIX_ALPHA_SCALE'</td>
+%% <td> float </td><td> 1 </td><td>(-)</td></tr><tr><td>`?GL_POST_COLOR_MATRIX_RED_BIAS'</td>
+%% <td> float </td><td> 0 </td><td>(-)</td></tr><tr><td>`?GL_POST_COLOR_MATRIX_GREEN_BIAS'</td>
+%% <td> float </td><td> 0 </td><td>(-)</td></tr><tr><td>`?GL_POST_COLOR_MATRIX_BLUE_BIAS'</td>
+%% <td> float </td><td> 0 </td><td>(-)</td></tr><tr><td>`?GL_POST_COLOR_MATRIX_ALPHA_BIAS'</td>
+%% <td> float </td><td> 0 </td><td>(-)</td></tr><tr><td>`?GL_POST_CONVOLUTION_RED_SCALE'</td>
+%% <td> float </td><td> 1 </td><td>(-)</td></tr><tr><td>`?GL_POST_CONVOLUTION_GREEN_SCALE'</td>
+%% <td> float </td><td> 1 </td><td>(-)</td></tr><tr><td>`?GL_POST_CONVOLUTION_BLUE_SCALE'</td>
+%% <td> float </td><td> 1 </td><td>(-)</td></tr><tr><td>`?GL_POST_CONVOLUTION_ALPHA_SCALE'</td>
+%% <td> float </td><td> 1 </td><td>(-)</td></tr><tr><td>`?GL_POST_CONVOLUTION_RED_BIAS'</td>
+%% <td> float </td><td> 0 </td><td>(-)</td></tr><tr><td>`?GL_POST_CONVOLUTION_GREEN_BIAS'</td>
+%% <td> float </td><td> 0 </td><td>(-)</td></tr><tr><td>`?GL_POST_CONVOLUTION_BLUE_BIAS'</td>
+%% <td> float </td><td> 0 </td><td>(-)</td></tr><tr><td>`?GL_POST_CONVOLUTION_ALPHA_BIAS'</td>
+%% <td> float </td><td> 0 </td><td>(-)</td></tr></tbody></table>
+%%
+%% ``gl:pixelTransferf'' can be used to set any pixel transfer parameter. If the parameter
+%% type is boolean, 0 implies false and any other value implies true. If `Pname' is
+%% an integer parameter, `Param' is rounded to the nearest integer.
+%%
+%% Likewise, ``gl:pixelTransferi'' can be used to set any of the pixel transfer parameters.
+%% Boolean parameters are set to false if `Param' is 0 and to true otherwise. `Param'
+%% is converted to floating point before being assigned to real-valued parameters.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPixelTransfer.xml">external</a> documentation.
+-spec pixelTransferf(Pname, Param) -> ok when Pname :: enum(),Param :: float().
+pixelTransferf(Pname,Param) ->
+ cast(5225, <<Pname:?GLenum,Param:?GLfloat>>).
-%% @spec ({S,T}) -> ok
-%% @equiv texCoord2s(S,T)
--spec texCoord2sv({integer(),integer()}) -> ok.
-texCoord2sv({S,T}) -> texCoord2s(S,T).
+%% @doc
+%% See {@link pixelTransferf/2}
+-spec pixelTransferi(Pname, Param) -> ok when Pname :: enum(),Param :: integer().
+pixelTransferi(Pname,Param) ->
+ cast(5226, <<Pname:?GLenum,Param:?GLint>>).
-%% @spec (S::float(),T::float(),R::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord3d(float(),float(),float()) -> ok.
-texCoord3d(S,T,R) ->
- cast(5266, <<S:?GLdouble,T:?GLdouble,R:?GLdouble>>).
+%% @doc Set up pixel transfer maps
+%%
+%% ``gl:pixelMap'' sets up translation tables, or `maps', used by {@link gl:copyPixels/5}
+%% , {@link gl:copyTexImage1D/7} , {@link gl:copyTexImage2D/8} , {@link gl:copyTexSubImage1D/6} , {@link gl:copyTexSubImage2D/8}
+%% , {@link gl:copyTexSubImage3D/9} , {@link gl:drawPixels/5} , {@link gl:readPixels/7} , {@link gl:texImage1D/8}
+%% , {@link gl:texImage2D/9} , {@link gl:texImage3D/10} , {@link gl:texSubImage1D/7} , {@link gl:texSubImage1D/7}
+%% , and {@link gl:texSubImage1D/7} . Additionally, if the ARB_imaging subset is supported,
+%% the routines {@link gl:colorTable/6} , {@link gl:colorSubTable/6} , {@link gl:convolutionFilter1D/6}
+%% , {@link gl:convolutionFilter2D/7} , {@link gl:histogram/4} , {@link gl:minmax/3} , and {@link gl:separableFilter2D/8}
+%% . Use of these maps is described completely in the {@link gl:pixelTransferf/2} reference
+%% page, and partly in the reference pages for the pixel and texture image commands. Only
+%% the specification of the maps is described in this reference page.
+%%
+%% `Map' is a symbolic map name, indicating one of ten maps to set. `Mapsize' specifies
+%% the number of entries in the map, and `Values' is a pointer to an array of `Mapsize'
+%% map values.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a pixel transfer map is specified, `Values' is
+%% treated as a byte offset into the buffer object's data store.
+%%
+%% The ten maps are as follows:
+%%
+%% `?GL_PIXEL_MAP_I_TO_I': Maps color indices to color indices.
+%%
+%% `?GL_PIXEL_MAP_S_TO_S': Maps stencil indices to stencil indices.
+%%
+%% `?GL_PIXEL_MAP_I_TO_R': Maps color indices to red components.
+%%
+%% `?GL_PIXEL_MAP_I_TO_G': Maps color indices to green components.
+%%
+%% `?GL_PIXEL_MAP_I_TO_B': Maps color indices to blue components.
+%%
+%% `?GL_PIXEL_MAP_I_TO_A': Maps color indices to alpha components.
+%%
+%% `?GL_PIXEL_MAP_R_TO_R': Maps red components to red components.
+%%
+%% `?GL_PIXEL_MAP_G_TO_G': Maps green components to green components.
+%%
+%% `?GL_PIXEL_MAP_B_TO_B': Maps blue components to blue components.
+%%
+%% `?GL_PIXEL_MAP_A_TO_A': Maps alpha components to alpha components.
+%%
+%% The entries in a map can be specified as single-precision floating-point numbers, unsigned
+%% short integers, or unsigned int integers. Maps that store color component values (all
+%% but `?GL_PIXEL_MAP_I_TO_I' and `?GL_PIXEL_MAP_S_TO_S') retain their values in
+%% floating-point format, with unspecified mantissa and exponent sizes. Floating-point values
+%% specified by ``gl:pixelMapfv'' are converted directly to the internal floating-point
+%% format of these maps, then clamped to the range [0,1]. Unsigned integer values specified
+%% by ``gl:pixelMapusv'' and ``gl:pixelMapuiv'' are converted linearly such that the
+%% largest representable integer maps to 1.0, and 0 maps to 0.0.
+%%
+%% Maps that store indices, `?GL_PIXEL_MAP_I_TO_I' and `?GL_PIXEL_MAP_S_TO_S',
+%% retain their values in fixed-point format, with an unspecified number of bits to the right
+%% of the binary point. Floating-point values specified by ``gl:pixelMapfv'' are converted
+%% directly to the internal fixed-point format of these maps. Unsigned integer values specified
+%% by ``gl:pixelMapusv'' and ``gl:pixelMapuiv'' specify integer values, with all 0's
+%% to the right of the binary point.
+%%
+%% The following table shows the initial sizes and values for each of the maps. Maps that
+%% are indexed by either color or stencil indices must have `Mapsize' = 2 n for some
+%% n or the results are undefined. The maximum allowable size for each map depends on the
+%% implementation and can be determined by calling {@link gl:getBooleanv/1} with argument `?GL_MAX_PIXEL_MAP_TABLE'
+%% . The single maximum applies to all maps; it is at least 32. <table><tbody><tr><td> `Map'
+%% </td><td>` Lookup Index '</td><td>` Lookup Value '</td><td>` Initial Size '</td>
+%% <td>` Initial Value '</td></tr></tbody><tbody><tr><td>`?GL_PIXEL_MAP_I_TO_I'</td>
+%% <td> color index </td><td> color index </td><td> 1 </td><td> 0 </td></tr><tr><td>`?GL_PIXEL_MAP_S_TO_S'
+%% </td><td> stencil index </td><td> stencil index </td><td> 1 </td><td> 0 </td></tr><tr><td>
+%% `?GL_PIXEL_MAP_I_TO_R'</td><td> color index </td><td> R </td><td> 1 </td><td> 0 </td>
+%% </tr><tr><td>`?GL_PIXEL_MAP_I_TO_G'</td><td> color index </td><td> G </td><td> 1 </td>
+%% <td> 0 </td></tr><tr><td>`?GL_PIXEL_MAP_I_TO_B'</td><td> color index </td><td> B </td>
+%% <td> 1 </td><td> 0 </td></tr><tr><td>`?GL_PIXEL_MAP_I_TO_A'</td><td> color index </td>
+%% <td> A </td><td> 1 </td><td> 0 </td></tr><tr><td>`?GL_PIXEL_MAP_R_TO_R'</td><td> R </td>
+%% <td> R </td><td> 1 </td><td> 0 </td></tr><tr><td>`?GL_PIXEL_MAP_G_TO_G'</td><td> G </td>
+%% <td> G </td><td> 1 </td><td> 0 </td></tr><tr><td>`?GL_PIXEL_MAP_B_TO_B'</td><td> B </td>
+%% <td> B </td><td> 1 </td><td> 0 </td></tr><tr><td>`?GL_PIXEL_MAP_A_TO_A'</td><td> A </td>
+%% <td> A </td><td> 1 </td><td> 0 </td></tr></tbody></table>
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPixelMap.xml">external</a> documentation.
+-spec pixelMapfv(Map, Mapsize, Values) -> ok when Map :: enum(),Mapsize :: integer(),Values :: binary().
+pixelMapfv(Map,Mapsize,Values) ->
+ send_bin(Values),
+ cast(5227, <<Map:?GLenum,Mapsize:?GLsizei>>).
-%% @spec ({S,T,R}) -> ok
-%% @equiv texCoord3d(S,T,R)
--spec texCoord3dv({float(),float(),float()}) -> ok.
-texCoord3dv({S,T,R}) -> texCoord3d(S,T,R).
+%% @doc
+%% See {@link pixelMapfv/3}
+-spec pixelMapuiv(Map, Mapsize, Values) -> ok when Map :: enum(),Mapsize :: integer(),Values :: binary().
+pixelMapuiv(Map,Mapsize,Values) ->
+ send_bin(Values),
+ cast(5228, <<Map:?GLenum,Mapsize:?GLsizei>>).
-%% @spec (S::float(),T::float(),R::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord3f(float(),float(),float()) -> ok.
-texCoord3f(S,T,R) ->
- cast(5267, <<S:?GLfloat,T:?GLfloat,R:?GLfloat>>).
+%% @doc
+%% See {@link pixelMapfv/3}
+-spec pixelMapusv(Map, Mapsize, Values) -> ok when Map :: enum(),Mapsize :: integer(),Values :: binary().
+pixelMapusv(Map,Mapsize,Values) ->
+ send_bin(Values),
+ cast(5229, <<Map:?GLenum,Mapsize:?GLsizei>>).
-%% @spec ({S,T,R}) -> ok
-%% @equiv texCoord3f(S,T,R)
--spec texCoord3fv({float(),float(),float()}) -> ok.
-texCoord3fv({S,T,R}) -> texCoord3f(S,T,R).
+%% @doc Return the specified pixel map
+%%
+%% See the {@link gl:pixelMapfv/3} reference page for a description of the acceptable values
+%% for the `Map' parameter. ``gl:getPixelMap'' returns in `Data' the contents
+%% of the pixel map specified in `Map' . Pixel maps are used during the execution of {@link gl:readPixels/7}
+%% , {@link gl:drawPixels/5} , {@link gl:copyPixels/5} , {@link gl:texImage1D/8} , {@link gl:texImage2D/9}
+%% , {@link gl:texImage3D/10} , {@link gl:texSubImage1D/7} , {@link gl:texSubImage1D/7} , {@link gl:texSubImage1D/7}
+%% , {@link gl:copyTexImage1D/7} , {@link gl:copyTexImage2D/8} , {@link gl:copyTexSubImage1D/6} , {@link gl:copyTexSubImage2D/8}
+%% , and {@link gl:copyTexSubImage3D/9} . to map color indices, stencil indices, color components,
+%% and depth components to other values.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_PACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a pixel map is requested, `Data' is treated as
+%% a byte offset into the buffer object's data store.
+%%
+%% Unsigned integer values, if requested, are linearly mapped from the internal fixed or
+%% floating-point representation such that 1.0 maps to the largest representable integer
+%% value, and 0.0 maps to 0. Return unsigned integer values are undefined if the map value
+%% was not in the range [0,1].
+%%
+%% To determine the required size of `Map' , call {@link gl:getBooleanv/1} with the appropriate
+%% symbolic constant.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetPixelMap.xml">external</a> documentation.
+-spec getPixelMapfv(Map, Values) -> ok when Map :: enum(),Values :: mem().
+getPixelMapfv(Map,Values) ->
+ send_bin(Values),
+ call(5230, <<Map:?GLenum>>).
-%% @spec (S::integer(),T::integer(),R::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord3i(integer(),integer(),integer()) -> ok.
-texCoord3i(S,T,R) ->
- cast(5268, <<S:?GLint,T:?GLint,R:?GLint>>).
+%% @doc
+%% See {@link getPixelMapfv/2}
+-spec getPixelMapuiv(Map, Values) -> ok when Map :: enum(),Values :: mem().
+getPixelMapuiv(Map,Values) ->
+ send_bin(Values),
+ call(5231, <<Map:?GLenum>>).
-%% @spec ({S,T,R}) -> ok
-%% @equiv texCoord3i(S,T,R)
--spec texCoord3iv({integer(),integer(),integer()}) -> ok.
-texCoord3iv({S,T,R}) -> texCoord3i(S,T,R).
+%% @doc
+%% See {@link getPixelMapfv/2}
+-spec getPixelMapusv(Map, Values) -> ok when Map :: enum(),Values :: mem().
+getPixelMapusv(Map,Values) ->
+ send_bin(Values),
+ call(5232, <<Map:?GLenum>>).
-%% @spec (S::integer(),T::integer(),R::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord3s(integer(),integer(),integer()) -> ok.
-texCoord3s(S,T,R) ->
- cast(5269, <<S:?GLshort,T:?GLshort,R:?GLshort>>).
+%% @doc Draw a bitmap
+%%
+%% A bitmap is a binary image. When drawn, the bitmap is positioned relative to the current
+%% raster position, and frame buffer pixels corresponding to 1's in the bitmap are written
+%% using the current raster color or index. Frame buffer pixels corresponding to 0's in the
+%% bitmap are not modified.
+%%
+%% ``gl:bitmap'' takes seven arguments. The first pair specifies the width and height of
+%% the bitmap image. The second pair specifies the location of the bitmap origin relative
+%% to the lower left corner of the bitmap image. The third pair of arguments specifies `x'
+%% and `y' offsets to be added to the current raster position after the bitmap has
+%% been drawn. The final argument is a pointer to the bitmap image itself.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a bitmap image is specified, `Bitmap' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% The bitmap image is interpreted like image data for the {@link gl:drawPixels/5} command,
+%% with `Width' and `Height' corresponding to the width and height arguments of
+%% that command, and with `type' set to `?GL_BITMAP' and `format' set to `?GL_COLOR_INDEX'
+%% . Modes specified using {@link gl:pixelStoref/2} affect the interpretation of bitmap image
+%% data; modes specified using {@link gl:pixelTransferf/2} do not.
+%%
+%% If the current raster position is invalid, ``gl:bitmap'' is ignored. Otherwise, the
+%% lower left corner of the bitmap image is positioned at the window coordinates
+%%
+%% x w=|x r-x o|
+%%
+%% y w=|y r-y o|
+%%
+%% where (x r y r) is the raster position and (x o y o) is the bitmap origin. Fragments are then generated
+%% for each pixel corresponding to a 1 (one) in the bitmap image. These fragments are generated
+%% using the current raster `z' coordinate, color or color index, and current raster
+%% texture coordinates. They are then treated just as if they had been generated by a point,
+%% line, or polygon, including texture mapping, fogging, and all per-fragment operations
+%% such as alpha and depth testing.
+%%
+%% After the bitmap has been drawn, the `x' and `y' coordinates of the current
+%% raster position are offset by `Xmove' and `Ymove' . No change is made to the `z'
+%% coordinate of the current raster position, or to the current raster color, texture coordinates,
+%% or index.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBitmap.xml">external</a> documentation.
+-spec bitmap(Width, Height, Xorig, Yorig, Xmove, Ymove, Bitmap) -> ok when Width :: integer(),Height :: integer(),Xorig :: float(),Yorig :: float(),Xmove :: float(),Ymove :: float(),Bitmap :: offset()|mem().
+bitmap(Width,Height,Xorig,Yorig,Xmove,Ymove,Bitmap) when is_integer(Bitmap) ->
+ cast(5233, <<Width:?GLsizei,Height:?GLsizei,Xorig:?GLfloat,Yorig:?GLfloat,Xmove:?GLfloat,Ymove:?GLfloat,Bitmap:?GLuint>>);
+bitmap(Width,Height,Xorig,Yorig,Xmove,Ymove,Bitmap) ->
+ send_bin(Bitmap),
+ cast(5234, <<Width:?GLsizei,Height:?GLsizei,Xorig:?GLfloat,Yorig:?GLfloat,Xmove:?GLfloat,Ymove:?GLfloat>>).
-%% @spec ({S,T,R}) -> ok
-%% @equiv texCoord3s(S,T,R)
--spec texCoord3sv({integer(),integer(),integer()}) -> ok.
-texCoord3sv({S,T,R}) -> texCoord3s(S,T,R).
+%% @doc Read a block of pixels from the frame buffer
+%%
+%% ``gl:readPixels'' returns pixel data from the frame buffer, starting with the pixel
+%% whose lower left corner is at location ( `X' , `Y' ), into client memory starting
+%% at location `Data' . Several parameters control the processing of the pixel data before
+%% it is placed into client memory. These parameters are set with {@link gl:pixelStoref/2} .
+%% This reference page describes the effects on ``gl:readPixels'' of most, but not all
+%% of the parameters specified by these three commands.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_PACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a block of pixels is requested, `Data' is treated
+%% as a byte offset into the buffer object's data store rather than a pointer to client memory.
+%%
+%%
+%% ``gl:readPixels'' returns values from each pixel with lower left corner at (x+i y+j) for 0&lt;=
+%% i&lt; width and 0&lt;= j&lt; height. This pixel is said to be the ith pixel in the
+%% jth row. Pixels are returned in row order from the lowest to the highest row, left to
+%% right in each row.
+%%
+%% `Format' specifies the format for the returned pixel values; accepted values are:
+%%
+%% `?GL_STENCIL_INDEX': Stencil values are read from the stencil buffer. Each index
+%% is converted to fixed point, shifted left or right depending on the value and sign of `?GL_INDEX_SHIFT'
+%% , and added to `?GL_INDEX_OFFSET'. If `?GL_MAP_STENCIL' is `?GL_TRUE',
+%% indices are replaced by their mappings in the table `?GL_PIXEL_MAP_S_TO_S'.
+%%
+%% `?GL_DEPTH_COMPONENT': Depth values are read from the depth buffer. Each component
+%% is converted to floating point such that the minimum depth value maps to 0 and the maximum
+%% value maps to 1. Each component is then multiplied by `?GL_DEPTH_SCALE', added to `?GL_DEPTH_BIAS'
+%% , and finally clamped to the range [0 1].
+%%
+%% `?GL_DEPTH_STENCIL': Values are taken from both the depth and stencil buffers. The `Type'
+%% parameter must be `?GL_UNSIGNED_INT_24_8' or `?GL_FLOAT_32_UNSIGNED_INT_24_8_REV'
+%% .
+%%
+%% `?GL_RED'
+%%
+%% `?GL_GREEN'
+%%
+%% `?GL_BLUE'
+%%
+%% `?GL_RGB'
+%%
+%% `?GL_BGR'
+%%
+%% `?GL_RGBA'
+%%
+%% `?GL_BGRA': Finally, the indices or components are converted to the proper format,
+%% as specified by `Type' . If `Format' is `?GL_STENCIL_INDEX' and `Type'
+%% is not `?GL_FLOAT', each index is masked with the mask value given in the following
+%% table. If `Type' is `?GL_FLOAT', then each integer index is converted to single-precision
+%% floating-point format.
+%%
+%% If `Format' is `?GL_RED', `?GL_GREEN', `?GL_BLUE', `?GL_RGB', `?GL_BGR'
+%% , `?GL_RGBA', or `?GL_BGRA' and `Type' is not `?GL_FLOAT', each component
+%% is multiplied by the multiplier shown in the following table. If type is `?GL_FLOAT',
+%% then each component is passed as is (or converted to the client's single-precision floating-point
+%% format if it is different from the one used by the GL).
+%%
+%% <table><tbody><tr><td> `Type' </td><td>` Index Mask '</td><td>` Component Conversion '
+%% </td></tr></tbody><tbody><tr><td>`?GL_UNSIGNED_BYTE'</td><td> 2 8-1</td><td>(2 8-1) c</td></tr>
+%% <tr><td>`?GL_BYTE'</td><td> 2 7-1</td><td>((2 8-1) c-1)/2</td></tr><tr><td>`?GL_UNSIGNED_SHORT'
+%% </td><td> 2 16-1</td><td>(2 16-1) c</td></tr><tr><td>`?GL_SHORT'</td><td> 2 15-1</td><td>((2
+%% 16-1)
+%% c-1)/2</td>
+%% </tr><tr><td>`?GL_UNSIGNED_INT'</td><td> 2 32-1</td><td>(2 32-1) c</td></tr><tr><td>`?GL_INT'
+%% </td><td> 2 31-1</td><td>((2 32-1) c-1)/2</td></tr><tr><td>`?GL_HALF_FLOAT'</td><td> none </td><td>
+%% c</td></tr><tr><td>`?GL_FLOAT'</td><td> none </td><td> c</td></tr><tr><td>`?GL_UNSIGNED_BYTE_3_3_2'
+%% </td><td> 2 N-1</td><td>(2 N-1) c</td></tr><tr><td>`?GL_UNSIGNED_BYTE_2_3_3_REV'</td><td>
+%% 2 N-1</td><td>(2 N-1) c</td></tr><tr><td>`?GL_UNSIGNED_SHORT_5_6_5'</td><td> 2 N-1</td><td>
+%% (2 N-1) c</td></tr><tr><td>`?GL_UNSIGNED_SHORT_5_6_5_REV'</td><td> 2 N-1</td><td>(2 N-1) c</td></tr>
+%% <tr><td>`?GL_UNSIGNED_SHORT_4_4_4_4'</td><td> 2 N-1</td><td>(2 N-1) c</td></tr><tr><td>`?GL_UNSIGNED_SHORT_4_4_4_4_REV'
+%% </td><td> 2 N-1</td><td>(2 N-1) c</td></tr><tr><td>`?GL_UNSIGNED_SHORT_5_5_5_1'</td><td> 2
+%% N-1</td><td>(2 N-1) c</td></tr><tr><td>`?GL_UNSIGNED_SHORT_1_5_5_5_REV'</td><td> 2 N-1</td>
+%% <td>(2 N-1) c</td></tr><tr><td>`?GL_UNSIGNED_INT_8_8_8_8'</td><td> 2 N-1</td><td>(2 N-1) c</td></tr>
+%% <tr><td>`?GL_UNSIGNED_INT_8_8_8_8_REV'</td><td> 2 N-1</td><td>(2 N-1) c</td></tr><tr><td>`?GL_UNSIGNED_INT_10_10_10_2'
+%% </td><td> 2 N-1</td><td>(2 N-1) c</td></tr><tr><td>`?GL_UNSIGNED_INT_2_10_10_10_REV'</td><td>
+%% 2 N-1</td><td>(2 N-1) c</td></tr><tr><td>`?GL_UNSIGNED_INT_24_8'</td><td> 2 N-1</td><td>(2
+%% N-1)
+%% c</td></tr><tr><td>`?GL_UNSIGNED_INT_10F_11F_11F_REV'</td><td> -- </td><td> Special </td>
+%% </tr><tr><td>`?GL_UNSIGNED_INT_5_9_9_9_REV'</td><td> -- </td><td> Special </td></tr><tr>
+%% <td>`?GL_FLOAT_32_UNSIGNED_INT_24_8_REV'</td><td> none </td><td> c (Depth Only) </td>
+%% </tr></tbody></table>
+%%
+%% Return values are placed in memory as follows. If `Format' is `?GL_STENCIL_INDEX'
+%% , `?GL_DEPTH_COMPONENT', `?GL_RED', `?GL_GREEN', or `?GL_BLUE', a
+%% single value is returned and the data for the ith pixel in the jth row is placed in
+%% location (j) width+i. `?GL_RGB' and `?GL_BGR' return three values, `?GL_RGBA'
+%% and `?GL_BGRA' return four values for each pixel, with all values corresponding
+%% to a single pixel occupying contiguous space in `Data' . Storage parameters set by {@link gl:pixelStoref/2}
+%% , such as `?GL_PACK_LSB_FIRST' and `?GL_PACK_SWAP_BYTES', affect the way that
+%% data is written into memory. See {@link gl:pixelStoref/2} for a description.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glReadPixels.xml">external</a> documentation.
+-spec readPixels(X, Y, Width, Height, Format, Type, Pixels) -> ok when X :: integer(),Y :: integer(),Width :: integer(),Height :: integer(),Format :: enum(),Type :: enum(),Pixels :: mem().
+readPixels(X,Y,Width,Height,Format,Type,Pixels) ->
+ send_bin(Pixels),
+ call(5235, <<X:?GLint,Y:?GLint,Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum>>).
-%% @spec (S::float(),T::float(),R::float(),Q::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord4d(float(),float(),float(),float()) -> ok.
-texCoord4d(S,T,R,Q) ->
- cast(5270, <<S:?GLdouble,T:?GLdouble,R:?GLdouble,Q:?GLdouble>>).
+%% @doc Write a block of pixels to the frame buffer
+%%
+%% ``gl:drawPixels'' reads pixel data from memory and writes it into the frame buffer relative
+%% to the current raster position, provided that the raster position is valid. Use {@link gl:rasterPos2d/2}
+%% or {@link gl:windowPos2d/2} to set the current raster position; use {@link gl:getBooleanv/1} with
+%% argument `?GL_CURRENT_RASTER_POSITION_VALID' to determine if the specified raster
+%% position is valid, and {@link gl:getBooleanv/1} with argument `?GL_CURRENT_RASTER_POSITION'
+%% to query the raster position.
+%%
+%% Several parameters define the encoding of pixel data in memory and control the processing
+%% of the pixel data before it is placed in the frame buffer. These parameters are set with
+%% four commands: {@link gl:pixelStoref/2} , {@link gl:pixelTransferf/2} , {@link gl:pixelMapfv/3} ,
+%% and {@link gl:pixelZoom/2} . This reference page describes the effects on ``gl:drawPixels''
+%% of many, but not all, of the parameters specified by these four commands.
+%%
+%% Data is read from `Data' as a sequence of signed or unsigned bytes, signed or unsigned
+%% shorts, signed or unsigned integers, or single-precision floating-point values, depending
+%% on `Type' . When `Type' is one of `?GL_UNSIGNED_BYTE', `?GL_BYTE', `?GL_UNSIGNED_SHORT'
+%% , `?GL_SHORT', `?GL_UNSIGNED_INT', `?GL_INT', or `?GL_FLOAT' each
+%% of these bytes, shorts, integers, or floating-point values is interpreted as one color
+%% or depth component, or one index, depending on `Format' . When `Type' is one of `?GL_UNSIGNED_BYTE_3_3_2'
+%% , `?GL_UNSIGNED_SHORT_5_6_5', `?GL_UNSIGNED_SHORT_4_4_4_4', `?GL_UNSIGNED_SHORT_5_5_5_1'
+%% , `?GL_UNSIGNED_INT_8_8_8_8', or `?GL_UNSIGNED_INT_10_10_10_2', each unsigned
+%% value is interpreted as containing all the components for a single pixel, with the color
+%% components arranged according to `Format' . When `Type' is one of `?GL_UNSIGNED_BYTE_2_3_3_REV'
+%% , `?GL_UNSIGNED_SHORT_5_6_5_REV', `?GL_UNSIGNED_SHORT_4_4_4_4_REV', `?GL_UNSIGNED_SHORT_1_5_5_5_REV'
+%% , `?GL_UNSIGNED_INT_8_8_8_8_REV', or `?GL_UNSIGNED_INT_2_10_10_10_REV', each
+%% unsigned value is interpreted as containing all color components, specified by `Format'
+%% , for a single pixel in a reversed order. Indices are always treated individually. Color
+%% components are treated as groups of one, two, three, or four values, again based on `Format'
+%% . Both individual indices and groups of components are referred to as pixels. If `Type'
+%% is `?GL_BITMAP', the data must be unsigned bytes, and `Format' must be either `?GL_COLOR_INDEX'
+%% or `?GL_STENCIL_INDEX'. Each unsigned byte is treated as eight 1-bit pixels, with
+%% bit ordering determined by `?GL_UNPACK_LSB_FIRST' (see {@link gl:pixelStoref/2} ).
+%%
+%% width*height pixels are read from memory, starting at location `Data' . By default,
+%% these pixels are taken from adjacent memory locations, except that after all `Width'
+%% pixels are read, the read pointer is advanced to the next four-byte boundary. The four-byte
+%% row alignment is specified by {@link gl:pixelStoref/2} with argument `?GL_UNPACK_ALIGNMENT'
+%% , and it can be set to one, two, four, or eight bytes. Other pixel store parameters specify
+%% different read pointer advancements, both before the first pixel is read and after all `Width'
+%% pixels are read. See the {@link gl:pixelStoref/2} reference page for details on these options.
+%%
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a block of pixels is specified, `Data' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% The width*height pixels that are read from memory are each operated on in the same
+%% way, based on the values of several parameters specified by {@link gl:pixelTransferf/2}
+%% and {@link gl:pixelMapfv/3} . The details of these operations, as well as the target buffer
+%% into which the pixels are drawn, are specific to the format of the pixels, as specified
+%% by `Format' . `Format' can assume one of 13 symbolic values:
+%%
+%% `?GL_COLOR_INDEX': Each pixel is a single value, a color index. It is converted
+%% to fixed-point format, with an unspecified number of bits to the right of the binary point,
+%% regardless of the memory data type. Floating-point values convert to true fixed-point
+%% values. Signed and unsigned integer data is converted with all fraction bits set to 0.
+%% Bitmap data convert to either 0 or 1.
+%%
+%% Each fixed-point index is then shifted left by `?GL_INDEX_SHIFT' bits and added to `?GL_INDEX_OFFSET'
+%% . If `?GL_INDEX_SHIFT' is negative, the shift is to the right. In either case, zero
+%% bits fill otherwise unspecified bit locations in the result.
+%%
+%% If the GL is in RGBA mode, the resulting index is converted to an RGBA pixel with the
+%% help of the `?GL_PIXEL_MAP_I_TO_R', `?GL_PIXEL_MAP_I_TO_G', `?GL_PIXEL_MAP_I_TO_B'
+%% , and `?GL_PIXEL_MAP_I_TO_A' tables. If the GL is in color index mode, and if `?GL_MAP_COLOR'
+%% is true, the index is replaced with the value that it references in lookup table `?GL_PIXEL_MAP_I_TO_I'
+%% . Whether the lookup replacement of the index is done or not, the integer part of the
+%% index is then ANDed with 2 b-1, where b is the number of bits in a color index buffer.
+%%
+%%
+%% The GL then converts the resulting indices or RGBA colors to fragments by attaching the
+%% current raster position `z' coordinate and texture coordinates to each pixel, then
+%% assigning x and y window coordinates to the nth fragment such that x n= x r+n%
+%% width
+%%
+%% y n= y r+|n/width|
+%%
+%% where (x r y r) is the current raster position. These pixel fragments are then treated just like
+%% the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog,
+%% and all the fragment operations are applied before the fragments are written to the frame
+%% buffer.
+%%
+%% `?GL_STENCIL_INDEX': Each pixel is a single value, a stencil index. It is converted
+%% to fixed-point format, with an unspecified number of bits to the right of the binary point,
+%% regardless of the memory data type. Floating-point values convert to true fixed-point
+%% values. Signed and unsigned integer data is converted with all fraction bits set to 0.
+%% Bitmap data convert to either 0 or 1.
+%%
+%% Each fixed-point index is then shifted left by `?GL_INDEX_SHIFT' bits, and added
+%% to `?GL_INDEX_OFFSET'. If `?GL_INDEX_SHIFT' is negative, the shift is to the
+%% right. In either case, zero bits fill otherwise unspecified bit locations in the result.
+%% If `?GL_MAP_STENCIL' is true, the index is replaced with the value that it references
+%% in lookup table `?GL_PIXEL_MAP_S_TO_S'. Whether the lookup replacement of the index
+%% is done or not, the integer part of the index is then ANDed with 2 b-1, where b is
+%% the number of bits in the stencil buffer. The resulting stencil indices are then written
+%% to the stencil buffer such that the nth index is written to location
+%%
+%% x n= x r+n% width
+%%
+%% y n= y r+|n/width|
+%%
+%% where (x r y r) is the current raster position. Only the pixel ownership test, the scissor test,
+%% and the stencil writemask affect these write operations.
+%%
+%% `?GL_DEPTH_COMPONENT': Each pixel is a single-depth component. Floating-point data
+%% is converted directly to an internal floating-point format with unspecified precision.
+%% Signed integer data is mapped linearly to the internal floating-point format such that
+%% the most positive representable integer value maps to 1.0, and the most negative representable
+%% value maps to -1.0. Unsigned integer data is mapped similarly: the largest integer value
+%% maps to 1.0, and 0 maps to 0.0. The resulting floating-point depth value is then multiplied
+%% by `?GL_DEPTH_SCALE' and added to `?GL_DEPTH_BIAS'. The result is clamped to
+%% the range [0 1].
+%%
+%% The GL then converts the resulting depth components to fragments by attaching the current
+%% raster position color or color index and texture coordinates to each pixel, then assigning
+%% x and y window coordinates to the nth fragment such that
+%%
+%% x n= x r+n% width
+%%
+%% y n= y r+|n/width|
+%%
+%% where (x r y r) is the current raster position. These pixel fragments are then treated just like
+%% the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog,
+%% and all the fragment operations are applied before the fragments are written to the frame
+%% buffer.
+%%
+%% `?GL_RGBA'
+%%
+%% `?GL_BGRA': Each pixel is a four-component group: For `?GL_RGBA', the red component
+%% is first, followed by green, followed by blue, followed by alpha; for `?GL_BGRA'
+%% the order is blue, green, red and then alpha. Floating-point values are converted directly
+%% to an internal floating-point format with unspecified precision. Signed integer values
+%% are mapped linearly to the internal floating-point format such that the most positive
+%% representable integer value maps to 1.0, and the most negative representable value maps
+%% to -1.0. (Note that this mapping does not convert 0 precisely to 0.0.) Unsigned integer
+%% data is mapped similarly: The largest integer value maps to 1.0, and 0 maps to 0.0. The
+%% resulting floating-point color values are then multiplied by `?GL_c_SCALE' and added
+%% to `?GL_c_BIAS', where `c' is RED, GREEN, BLUE, and ALPHA for the respective
+%% color components. The results are clamped to the range [0 1].
+%%
+%% If `?GL_MAP_COLOR' is true, each color component is scaled by the size of lookup
+%% table `?GL_PIXEL_MAP_c_TO_c', then replaced by the value that it references in that
+%% table. `c' is R, G, B, or A respectively.
+%%
+%% The GL then converts the resulting RGBA colors to fragments by attaching the current
+%% raster position `z' coordinate and texture coordinates to each pixel, then assigning
+%% x and y window coordinates to the nth fragment such that
+%%
+%% x n= x r+n% width
+%%
+%% y n= y r+|n/width|
+%%
+%% where (x r y r) is the current raster position. These pixel fragments are then treated just like
+%% the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog,
+%% and all the fragment operations are applied before the fragments are written to the frame
+%% buffer.
+%%
+%% `?GL_RED': Each pixel is a single red component. This component is converted to
+%% the internal floating-point format in the same way the red component of an RGBA pixel
+%% is. It is then converted to an RGBA pixel with green and blue set to 0, and alpha set
+%% to 1. After this conversion, the pixel is treated as if it had been read as an RGBA pixel.
+%%
+%%
+%% `?GL_GREEN': Each pixel is a single green component. This component is converted
+%% to the internal floating-point format in the same way the green component of an RGBA pixel
+%% is. It is then converted to an RGBA pixel with red and blue set to 0, and alpha set to
+%% 1. After this conversion, the pixel is treated as if it had been read as an RGBA pixel.
+%%
+%% `?GL_BLUE': Each pixel is a single blue component. This component is converted to
+%% the internal floating-point format in the same way the blue component of an RGBA pixel
+%% is. It is then converted to an RGBA pixel with red and green set to 0, and alpha set to
+%% 1. After this conversion, the pixel is treated as if it had been read as an RGBA pixel.
+%%
+%% `?GL_ALPHA': Each pixel is a single alpha component. This component is converted
+%% to the internal floating-point format in the same way the alpha component of an RGBA pixel
+%% is. It is then converted to an RGBA pixel with red, green, and blue set to 0. After this
+%% conversion, the pixel is treated as if it had been read as an RGBA pixel.
+%%
+%% `?GL_RGB'
+%%
+%% `?GL_BGR': Each pixel is a three-component group: red first, followed by green,
+%% followed by blue; for `?GL_BGR', the first component is blue, followed by green and
+%% then red. Each component is converted to the internal floating-point format in the same
+%% way the red, green, and blue components of an RGBA pixel are. The color triple is converted
+%% to an RGBA pixel with alpha set to 1. After this conversion, the pixel is treated as if
+%% it had been read as an RGBA pixel.
+%%
+%% `?GL_LUMINANCE': Each pixel is a single luminance component. This component is converted
+%% to the internal floating-point format in the same way the red component of an RGBA pixel
+%% is. It is then converted to an RGBA pixel with red, green, and blue set to the converted
+%% luminance value, and alpha set to 1. After this conversion, the pixel is treated as if
+%% it had been read as an RGBA pixel.
+%%
+%% `?GL_LUMINANCE_ALPHA': Each pixel is a two-component group: luminance first, followed
+%% by alpha. The two components are converted to the internal floating-point format in the
+%% same way the red component of an RGBA pixel is. They are then converted to an RGBA pixel
+%% with red, green, and blue set to the converted luminance value, and alpha set to the converted
+%% alpha value. After this conversion, the pixel is treated as if it had been read as an
+%% RGBA pixel.
+%%
+%% The following table summarizes the meaning of the valid constants for the `type'
+%% parameter:
+%%
+%% <table><tbody><tr><td>` Type '</td><td>` Corresponding Type '</td></tr></tbody><tbody>
+%% <tr><td>`?GL_UNSIGNED_BYTE'</td><td> unsigned 8-bit integer </td></tr><tr><td>`?GL_BYTE'
+%% </td><td> signed 8-bit integer </td></tr><tr><td>`?GL_BITMAP'</td><td> single bits
+%% in unsigned 8-bit integers </td></tr><tr><td>`?GL_UNSIGNED_SHORT'</td><td> unsigned
+%% 16-bit integer </td></tr><tr><td>`?GL_SHORT'</td><td> signed 16-bit integer </td></tr>
+%% <tr><td>`?GL_UNSIGNED_INT'</td><td> unsigned 32-bit integer </td></tr><tr><td>`?GL_INT'
+%% </td><td> 32-bit integer </td></tr><tr><td>`?GL_FLOAT'</td><td> single-precision
+%% floating-point </td></tr><tr><td>`?GL_UNSIGNED_BYTE_3_3_2'</td><td> unsigned 8-bit
+%% integer </td></tr><tr><td>`?GL_UNSIGNED_BYTE_2_3_3_REV'</td><td> unsigned 8-bit
+%% integer with reversed component ordering </td></tr><tr><td>`?GL_UNSIGNED_SHORT_5_6_5'</td>
+%% <td> unsigned 16-bit integer </td></tr><tr><td>`?GL_UNSIGNED_SHORT_5_6_5_REV'</td><td>
+%% unsigned 16-bit integer with reversed component ordering </td></tr><tr><td>`?GL_UNSIGNED_SHORT_4_4_4_4'
+%% </td><td> unsigned 16-bit integer </td></tr><tr><td>`?GL_UNSIGNED_SHORT_4_4_4_4_REV'</td>
+%% <td> unsigned 16-bit integer with reversed component ordering </td></tr><tr><td>`?GL_UNSIGNED_SHORT_5_5_5_1'
+%% </td><td> unsigned 16-bit integer </td></tr><tr><td>`?GL_UNSIGNED_SHORT_1_5_5_5_REV'</td>
+%% <td> unsigned 16-bit integer with reversed component ordering </td></tr><tr><td>`?GL_UNSIGNED_INT_8_8_8_8'
+%% </td><td> unsigned 32-bit integer </td></tr><tr><td>`?GL_UNSIGNED_INT_8_8_8_8_REV'</td>
+%% <td> unsigned 32-bit integer with reversed component ordering </td></tr><tr><td>`?GL_UNSIGNED_INT_10_10_10_2'
+%% </td><td> unsigned 32-bit integer </td></tr><tr><td>`?GL_UNSIGNED_INT_2_10_10_10_REV'</td>
+%% <td> unsigned 32-bit integer with reversed component ordering </td></tr></tbody></table>
+%%
+%% The rasterization described so far assumes pixel zoom factors of 1. If {@link gl:pixelZoom/2}
+%% is used to change the x and y pixel zoom factors, pixels are converted to fragments
+%% as follows. If (x r y r) is the current raster position, and a given pixel is in the nth column
+%% and mth row of the pixel rectangle, then fragments are generated for pixels whose centers
+%% are in the rectangle with corners at
+%%
+%% (x r+(zoom x) n y r+(zoom y) m)
+%%
+%% (x r+(zoom x)(n+1) y r+(zoom y)(m+1))
+%%
+%% where zoom x is the value of `?GL_ZOOM_X' and zoom y is the value of `?GL_ZOOM_Y'
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawPixels.xml">external</a> documentation.
+-spec drawPixels(Width, Height, Format, Type, Pixels) -> ok when Width :: integer(),Height :: integer(),Format :: enum(),Type :: enum(),Pixels :: offset()|mem().
+drawPixels(Width,Height,Format,Type,Pixels) when is_integer(Pixels) ->
+ cast(5236, <<Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum,Pixels:?GLuint>>);
+drawPixels(Width,Height,Format,Type,Pixels) ->
+ send_bin(Pixels),
+ cast(5237, <<Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum>>).
-%% @spec ({S,T,R,Q}) -> ok
-%% @equiv texCoord4d(S,T,R,Q)
--spec texCoord4dv({float(),float(),float(),float()}) -> ok.
-texCoord4dv({S,T,R,Q}) -> texCoord4d(S,T,R,Q).
+%% @doc Copy pixels in the frame buffer
+%%
+%% ``gl:copyPixels'' copies a screen-aligned rectangle of pixels from the specified frame
+%% buffer location to a region relative to the current raster position. Its operation is
+%% well defined only if the entire pixel source region is within the exposed portion of the
+%% window. Results of copies from outside the window, or from regions of the window that
+%% are not exposed, are hardware dependent and undefined.
+%%
+%% `X' and `Y' specify the window coordinates of the lower left corner of the rectangular
+%% region to be copied. `Width' and `Height' specify the dimensions of the rectangular
+%% region to be copied. Both `Width' and `Height' must not be negative.
+%%
+%% Several parameters control the processing of the pixel data while it is being copied.
+%% These parameters are set with three commands: {@link gl:pixelTransferf/2} , {@link gl:pixelMapfv/3}
+%% , and {@link gl:pixelZoom/2} . This reference page describes the effects on ``gl:copyPixels''
+%% of most, but not all, of the parameters specified by these three commands.
+%%
+%% ``gl:copyPixels'' copies values from each pixel with the lower left-hand corner at (x+i
+%% y+j)
+%% for 0&lt;= i&lt; width and 0&lt;= j&lt; height. This pixel is said to be the ith
+%% pixel in the jth row. Pixels are copied in row order from the lowest to the highest
+%% row, left to right in each row.
+%%
+%% `Type' specifies whether color, depth, or stencil data is to be copied. The details
+%% of the transfer for each data type are as follows:
+%%
+%% `?GL_COLOR': Indices or RGBA colors are read from the buffer currently specified
+%% as the read source buffer (see {@link gl:readBuffer/1} ). If the GL is in color index mode,
+%% each index that is read from this buffer is converted to a fixed-point format with an
+%% unspecified number of bits to the right of the binary point. Each index is then shifted
+%% left by `?GL_INDEX_SHIFT' bits, and added to `?GL_INDEX_OFFSET'. If `?GL_INDEX_SHIFT'
+%% is negative, the shift is to the right. In either case, zero bits fill otherwise unspecified
+%% bit locations in the result. If `?GL_MAP_COLOR' is true, the index is replaced with
+%% the value that it references in lookup table `?GL_PIXEL_MAP_I_TO_I'. Whether the
+%% lookup replacement of the index is done or not, the integer part of the index is then
+%% ANDed with 2 b-1, where b is the number of bits in a color index buffer.
+%%
+%% If the GL is in RGBA mode, the red, green, blue, and alpha components of each pixel that
+%% is read are converted to an internal floating-point format with unspecified precision.
+%% The conversion maps the largest representable component value to 1.0, and component value
+%% 0 to 0.0. The resulting floating-point color values are then multiplied by `?GL_c_SCALE'
+%% and added to `?GL_c_BIAS', where `c' is RED, GREEN, BLUE, and ALPHA for the
+%% respective color components. The results are clamped to the range [0,1]. If `?GL_MAP_COLOR'
+%% is true, each color component is scaled by the size of lookup table `?GL_PIXEL_MAP_c_TO_c'
+%% , then replaced by the value that it references in that table. `c' is R, G, B, or
+%% A.
+%%
+%% If the ARB_imaging extension is supported, the color values may be additionally processed
+%% by color-table lookups, color-matrix transformations, and convolution filters.
+%%
+%% The GL then converts the resulting indices or RGBA colors to fragments by attaching the
+%% current raster position `z' coordinate and texture coordinates to each pixel, then
+%% assigning window coordinates (x r+i y r+j), where (x r y r) is the current raster position, and the pixel was
+%% the ith pixel in the jth row. These pixel fragments are then treated just like the
+%% fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and
+%% all the fragment operations are applied before the fragments are written to the frame
+%% buffer.
+%%
+%% `?GL_DEPTH': Depth values are read from the depth buffer and converted directly
+%% to an internal floating-point format with unspecified precision. The resulting floating-point
+%% depth value is then multiplied by `?GL_DEPTH_SCALE' and added to `?GL_DEPTH_BIAS'
+%% . The result is clamped to the range [0,1].
+%%
+%% The GL then converts the resulting depth components to fragments by attaching the current
+%% raster position color or color index and texture coordinates to each pixel, then assigning
+%% window coordinates (x r+i y r+j), where (x r y r) is the current raster position, and the pixel was the ith
+%% pixel in the jth row. These pixel fragments are then treated just like the fragments
+%% generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the
+%% fragment operations are applied before the fragments are written to the frame buffer.
+%%
+%% `?GL_STENCIL': Stencil indices are read from the stencil buffer and converted to
+%% an internal fixed-point format with an unspecified number of bits to the right of the
+%% binary point. Each fixed-point index is then shifted left by `?GL_INDEX_SHIFT' bits,
+%% and added to `?GL_INDEX_OFFSET'. If `?GL_INDEX_SHIFT' is negative, the shift
+%% is to the right. In either case, zero bits fill otherwise unspecified bit locations in
+%% the result. If `?GL_MAP_STENCIL' is true, the index is replaced with the value that
+%% it references in lookup table `?GL_PIXEL_MAP_S_TO_S'. Whether the lookup replacement
+%% of the index is done or not, the integer part of the index is then ANDed with 2 b-1,
+%% where b is the number of bits in the stencil buffer. The resulting stencil indices are
+%% then written to the stencil buffer such that the index read from the ith location of
+%% the jth row is written to location (x r+i y r+j), where (x r y r) is the current raster position. Only the
+%% pixel ownership test, the scissor test, and the stencil writemask affect these write operations.
+%%
+%%
+%% The rasterization described thus far assumes pixel zoom factors of 1.0. If {@link gl:pixelZoom/2}
+%% is used to change the x and y pixel zoom factors, pixels are converted to fragments
+%% as follows. If (x r y r) is the current raster position, and a given pixel is in the ith location
+%% in the jth row of the source pixel rectangle, then fragments are generated for pixels
+%% whose centers are in the rectangle with corners at
+%%
+%% (x r+(zoom x) i y r+(zoom y) j)
+%%
+%% and
+%%
+%% (x r+(zoom x)(i+1) y r+(zoom y)(j+1))
+%%
+%% where zoom x is the value of `?GL_ZOOM_X' and zoom y is the value of `?GL_ZOOM_Y'
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyPixels.xml">external</a> documentation.
+-spec copyPixels(X, Y, Width, Height, Type) -> ok when X :: integer(),Y :: integer(),Width :: integer(),Height :: integer(),Type :: enum().
+copyPixels(X,Y,Width,Height,Type) ->
+ cast(5238, <<X:?GLint,Y:?GLint,Width:?GLsizei,Height:?GLsizei,Type:?GLenum>>).
-%% @spec (S::float(),T::float(),R::float(),Q::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord4f(float(),float(),float(),float()) -> ok.
-texCoord4f(S,T,R,Q) ->
- cast(5271, <<S:?GLfloat,T:?GLfloat,R:?GLfloat,Q:?GLfloat>>).
+%% @doc Set front and back function and reference value for stencil testing
+%%
+%% Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis.
+%% Stencil planes are first drawn into using GL drawing primitives, then geometry and images
+%% are rendered using the stencil planes to mask out portions of the screen. Stenciling is
+%% typically used in multipass rendering algorithms to achieve special effects, such as decals,
+%% outlining, and constructive solid geometry rendering.
+%%
+%% The stencil test conditionally eliminates a pixel based on the outcome of a comparison
+%% between the reference value and the value in the stencil buffer. To enable and disable
+%% the test, call {@link gl:enable/1} and {@link gl:enable/1} with argument `?GL_STENCIL_TEST'
+%% . To specify actions based on the outcome of the stencil test, call {@link gl:stencilOp/3}
+%% or {@link gl:stencilOpSeparate/4} .
+%%
+%% There can be two separate sets of `Func' , `Ref' , and `Mask' parameters;
+%% one affects back-facing polygons, and the other affects front-facing polygons as well
+%% as other non-polygon primitives. {@link gl:stencilFunc/3} sets both front and back stencil
+%% state to the same values. Use {@link gl:stencilFuncSeparate/4} to set front and back stencil
+%% state to different values.
+%%
+%% `Func' is a symbolic constant that determines the stencil comparison function. It
+%% accepts one of eight values, shown in the following list. `Ref' is an integer reference
+%% value that is used in the stencil comparison. It is clamped to the range [0 2 n-1], where n
+%% is the number of bitplanes in the stencil buffer. `Mask' is bitwise ANDed with both
+%% the reference value and the stored stencil value, with the ANDed values participating
+%% in the comparison.
+%%
+%% If `stencil' represents the value stored in the corresponding stencil buffer location,
+%% the following list shows the effect of each comparison function that can be specified by `Func'
+%% . Only if the comparison succeeds is the pixel passed through to the next stage in the
+%% rasterization process (see {@link gl:stencilOp/3} ). All tests treat `stencil' values
+%% as unsigned integers in the range [0 2 n-1], where n is the number of bitplanes in the stencil
+%% buffer.
+%%
+%% The following values are accepted by `Func' :
+%%
+%% `?GL_NEVER': Always fails.
+%%
+%% `?GL_LESS': Passes if ( `Ref' &amp; `Mask' ) &lt; ( `stencil' &amp; `Mask'
+%% ).
+%%
+%% `?GL_LEQUAL': Passes if ( `Ref' &amp; `Mask' ) &lt;= ( `stencil'
+%% &amp; `Mask' ).
+%%
+%% `?GL_GREATER': Passes if ( `Ref' &amp; `Mask' ) &gt; ( `stencil'
+%% &amp; `Mask' ).
+%%
+%% `?GL_GEQUAL': Passes if ( `Ref' &amp; `Mask' ) &gt;= ( `stencil'
+%% &amp; `Mask' ).
+%%
+%% `?GL_EQUAL': Passes if ( `Ref' &amp; `Mask' ) = ( `stencil' &amp; `Mask'
+%% ).
+%%
+%% `?GL_NOTEQUAL': Passes if ( `Ref' &amp; `Mask' ) != ( `stencil' &amp;
+%% `Mask' ).
+%%
+%% `?GL_ALWAYS': Always passes.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glStencilFunc.xml">external</a> documentation.
+-spec stencilFunc(Func, Ref, Mask) -> ok when Func :: enum(),Ref :: integer(),Mask :: integer().
+stencilFunc(Func,Ref,Mask) ->
+ cast(5239, <<Func:?GLenum,Ref:?GLint,Mask:?GLuint>>).
-%% @spec ({S,T,R,Q}) -> ok
-%% @equiv texCoord4f(S,T,R,Q)
--spec texCoord4fv({float(),float(),float(),float()}) -> ok.
-texCoord4fv({S,T,R,Q}) -> texCoord4f(S,T,R,Q).
+%% @doc Control the front and back writing of individual bits in the stencil planes
+%%
+%% ``gl:stencilMask'' controls the writing of individual bits in the stencil planes. The
+%% least significant n bits of `Mask' , where n is the number of bits in the stencil
+%% buffer, specify a mask. Where a 1 appears in the mask, it's possible to write to the corresponding
+%% bit in the stencil buffer. Where a 0 appears, the corresponding bit is write-protected.
+%% Initially, all bits are enabled for writing.
+%%
+%% There can be two separate `Mask' writemasks; one affects back-facing polygons, and
+%% the other affects front-facing polygons as well as other non-polygon primitives. {@link gl:stencilMask/1}
+%% sets both front and back stencil writemasks to the same values. Use {@link gl:stencilMaskSeparate/2}
+%% to set front and back stencil writemasks to different values.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glStencilMask.xml">external</a> documentation.
+-spec stencilMask(Mask) -> ok when Mask :: integer().
+stencilMask(Mask) ->
+ cast(5240, <<Mask:?GLuint>>).
-%% @spec (S::integer(),T::integer(),R::integer(),Q::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord4i(integer(),integer(),integer(),integer()) -> ok.
-texCoord4i(S,T,R,Q) ->
- cast(5272, <<S:?GLint,T:?GLint,R:?GLint,Q:?GLint>>).
+%% @doc Set front and back stencil test actions
+%%
+%% Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis.
+%% You draw into the stencil planes using GL drawing primitives, then render geometry and
+%% images, using the stencil planes to mask out portions of the screen. Stenciling is typically
+%% used in multipass rendering algorithms to achieve special effects, such as decals, outlining,
+%% and constructive solid geometry rendering.
+%%
+%% The stencil test conditionally eliminates a pixel based on the outcome of a comparison
+%% between the value in the stencil buffer and a reference value. To enable and disable the
+%% test, call {@link gl:enable/1} and {@link gl:enable/1} with argument `?GL_STENCIL_TEST'
+%% ; to control it, call {@link gl:stencilFunc/3} or {@link gl:stencilFuncSeparate/4} .
+%%
+%% There can be two separate sets of `Sfail' , `Dpfail' , and `Dppass' parameters;
+%% one affects back-facing polygons, and the other affects front-facing polygons as well
+%% as other non-polygon primitives. {@link gl:stencilOp/3} sets both front and back stencil
+%% state to the same values. Use {@link gl:stencilOpSeparate/4} to set front and back stencil
+%% state to different values.
+%%
+%% ``gl:stencilOp'' takes three arguments that indicate what happens to the stored stencil
+%% value while stenciling is enabled. If the stencil test fails, no change is made to the
+%% pixel's color or depth buffers, and `Sfail' specifies what happens to the stencil
+%% buffer contents. The following eight actions are possible.
+%%
+%% `?GL_KEEP': Keeps the current value.
+%%
+%% `?GL_ZERO': Sets the stencil buffer value to 0.
+%%
+%% `?GL_REPLACE': Sets the stencil buffer value to `ref', as specified by {@link gl:stencilFunc/3}
+%% .
+%%
+%% `?GL_INCR': Increments the current stencil buffer value. Clamps to the maximum representable
+%% unsigned value.
+%%
+%% `?GL_INCR_WRAP': Increments the current stencil buffer value. Wraps stencil buffer
+%% value to zero when incrementing the maximum representable unsigned value.
+%%
+%% `?GL_DECR': Decrements the current stencil buffer value. Clamps to 0.
+%%
+%% `?GL_DECR_WRAP': Decrements the current stencil buffer value. Wraps stencil buffer
+%% value to the maximum representable unsigned value when decrementing a stencil buffer value
+%% of zero.
+%%
+%% `?GL_INVERT': Bitwise inverts the current stencil buffer value.
+%%
+%% Stencil buffer values are treated as unsigned integers. When incremented and decremented,
+%% values are clamped to 0 and 2 n-1, where n is the value returned by querying `?GL_STENCIL_BITS'
+%% .
+%%
+%% The other two arguments to ``gl:stencilOp'' specify stencil buffer actions that depend
+%% on whether subsequent depth buffer tests succeed ( `Dppass' ) or fail ( `Dpfail' )
+%% (see {@link gl:depthFunc/1} ). The actions are specified using the same eight symbolic constants
+%% as `Sfail' . Note that `Dpfail' is ignored when there is no depth buffer, or
+%% when the depth buffer is not enabled. In these cases, `Sfail' and `Dppass' specify
+%% stencil action when the stencil test fails and passes, respectively.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glStencilOp.xml">external</a> documentation.
+-spec stencilOp(Fail, Zfail, Zpass) -> ok when Fail :: enum(),Zfail :: enum(),Zpass :: enum().
+stencilOp(Fail,Zfail,Zpass) ->
+ cast(5241, <<Fail:?GLenum,Zfail:?GLenum,Zpass:?GLenum>>).
-%% @spec ({S,T,R,Q}) -> ok
-%% @equiv texCoord4i(S,T,R,Q)
--spec texCoord4iv({integer(),integer(),integer(),integer()}) -> ok.
-texCoord4iv({S,T,R,Q}) -> texCoord4i(S,T,R,Q).
+%% @doc Specify the clear value for the stencil buffer
+%%
+%% ``gl:clearStencil'' specifies the index used by {@link gl:clear/1} to clear the stencil
+%% buffer. `S' is masked with 2 m-1, where m is the number of bits in the stencil
+%% buffer.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearStencil.xml">external</a> documentation.
+-spec clearStencil(S) -> ok when S :: integer().
+clearStencil(S) ->
+ cast(5242, <<S:?GLint>>).
-%% @spec (S::integer(),T::integer(),R::integer(),Q::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml">external</a> documentation.
--spec texCoord4s(integer(),integer(),integer(),integer()) -> ok.
-texCoord4s(S,T,R,Q) ->
- cast(5273, <<S:?GLshort,T:?GLshort,R:?GLshort,Q:?GLshort>>).
+%% @doc Control the generation of texture coordinates
+%%
+%% ``gl:texGen'' selects a texture-coordinate generation function or supplies coefficients
+%% for one of the functions. `Coord' names one of the (`s', `t', `r', `q'
+%% ) texture coordinates; it must be one of the symbols `?GL_S', `?GL_T', `?GL_R'
+%% , or `?GL_Q'. `Pname' must be one of three symbolic constants: `?GL_TEXTURE_GEN_MODE'
+%% , `?GL_OBJECT_PLANE', or `?GL_EYE_PLANE'. If `Pname' is `?GL_TEXTURE_GEN_MODE'
+%% , then `Params' chooses a mode, one of `?GL_OBJECT_LINEAR', `?GL_EYE_LINEAR'
+%% , `?GL_SPHERE_MAP', `?GL_NORMAL_MAP', or `?GL_REFLECTION_MAP'. If `Pname'
+%% is either `?GL_OBJECT_PLANE' or `?GL_EYE_PLANE', `Params' contains coefficients
+%% for the corresponding texture generation function.
+%%
+%% If the texture generation function is `?GL_OBJECT_LINEAR', the function
+%%
+%% g= p 1*x o+p 2*y o+p 3*z o+p 4*w o
+%%
+%% is used, where g is the value computed for the coordinate named in `Coord' , p 1,
+%% p 2, p 3, and p 4 are the four values supplied in `Params' , and x o, y o, z o,
+%% and w o are the object coordinates of the vertex. This function can be used, for example,
+%% to texture-map terrain using sea level as a reference plane (defined by p 1, p 2, p
+%% 3, and p 4). The altitude of a terrain vertex is computed by the `?GL_OBJECT_LINEAR'
+%% coordinate generation function as its distance from sea level; that altitude can then
+%% be used to index the texture image to map white snow onto peaks and green grass onto foothills.
+%%
+%%
+%% If the texture generation function is `?GL_EYE_LINEAR', the function
+%%
+%% g=(p 1)"*x e+(p 2)"*y e+(p 3)"*z e+(p 4)"*w e
+%%
+%% is used, where
+%%
+%% ((p 1)" (p 2)" (p 3)" (p 4)")=(p 1 p 2 p 3 p 4) M -1
+%%
+%% and x e, y e, z e, and w e are the eye coordinates of the vertex, p 1, p 2, p 3,
+%% and p 4 are the values supplied in `Params' , and M is the modelview matrix when ``gl:texGen''
+%% is invoked. If M is poorly conditioned or singular, texture coordinates generated by
+%% the resulting function may be inaccurate or undefined.
+%%
+%% Note that the values in `Params' define a reference plane in eye coordinates. The
+%% modelview matrix that is applied to them may not be the same one in effect when the polygon
+%% vertices are transformed. This function establishes a field of texture coordinates that
+%% can produce dynamic contour lines on moving objects.
+%%
+%% If the texture generation function is `?GL_SPHERE_MAP' and `Coord' is either `?GL_S'
+%% or `?GL_T', s and t texture coordinates are generated as follows. Let `u'
+%% be the unit vector pointing from the origin to the polygon vertex (in eye coordinates).
+%% Let `n' sup prime be the current normal, after transformation to eye coordinates.
+%% Let
+%%
+%% f=(f x f y f z) T be the reflection vector such that
+%%
+%% f= u-2 n" (n") T u
+%%
+%% Finally, let m= 2 ((f x) 2+(f y) 2+(f z+1) 2). Then the values assigned to the s and t texture coordinates
+%% are
+%%
+%% s= f x/m+1/2
+%%
+%% t= f y/m+1/2
+%%
+%% To enable or disable a texture-coordinate generation function, call {@link gl:enable/1}
+%% or {@link gl:enable/1} with one of the symbolic texture-coordinate names (`?GL_TEXTURE_GEN_S'
+%% , `?GL_TEXTURE_GEN_T', `?GL_TEXTURE_GEN_R', or `?GL_TEXTURE_GEN_Q') as
+%% the argument. When enabled, the specified texture coordinate is computed according to
+%% the generating function associated with that coordinate. When disabled, subsequent vertices
+%% take the specified texture coordinate from the current set of texture coordinates. Initially,
+%% all texture generation functions are set to `?GL_EYE_LINEAR' and are disabled. Both
+%% s plane equations are (1, 0, 0, 0), both t plane equations are (0, 1, 0, 0), and all
+%% r and q plane equations are (0, 0, 0, 0).
+%%
+%% When the ARB_multitexture extension is supported, ``gl:texGen'' sets the texture generation
+%% parameters for the currently active texture unit, selected with {@link gl:activeTexture/1} .
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexGen.xml">external</a> documentation.
+-spec texGend(Coord, Pname, Param) -> ok when Coord :: enum(),Pname :: enum(),Param :: float().
+texGend(Coord,Pname,Param) ->
+ cast(5243, <<Coord:?GLenum,Pname:?GLenum,Param:?GLdouble>>).
-%% @spec ({S,T,R,Q}) -> ok
-%% @equiv texCoord4s(S,T,R,Q)
--spec texCoord4sv({integer(),integer(),integer(),integer()}) -> ok.
-texCoord4sv({S,T,R,Q}) -> texCoord4s(S,T,R,Q).
+%% @doc
+%% See {@link texGend/3}
+-spec texGenf(Coord, Pname, Param) -> ok when Coord :: enum(),Pname :: enum(),Param :: float().
+texGenf(Coord,Pname,Param) ->
+ cast(5244, <<Coord:?GLenum,Pname:?GLenum,Param:?GLfloat>>).
-%% @spec (Size::integer(),Type::enum(),Stride::integer(),Pointer::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoordPointer.xml">external</a> documentation.
--spec texCoordPointer(integer(),enum(),integer(),offset()|mem()) -> ok.
-texCoordPointer(Size,Type,Stride,Pointer) when is_integer(Pointer) ->
- cast(5274, <<Size:?GLint,Type:?GLenum,Stride:?GLsizei,Pointer:?GLuint>>);
-texCoordPointer(Size,Type,Stride,Pointer) ->
- send_bin(Pointer),
- cast(5275, <<Size:?GLint,Type:?GLenum,Stride:?GLsizei>>).
+%% @doc
+%% See {@link texGend/3}
+-spec texGeni(Coord, Pname, Param) -> ok when Coord :: enum(),Pname :: enum(),Param :: integer().
+texGeni(Coord,Pname,Param) ->
+ cast(5245, <<Coord:?GLenum,Pname:?GLenum,Param:?GLint>>).
-%% @spec (Target::enum(),Pname::enum(),Param::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexEnvf.xml">external</a> documentation.
--spec texEnvf(enum(),enum(),float()) -> ok.
-texEnvf(Target,Pname,Param) ->
- cast(5276, <<Target:?GLenum,Pname:?GLenum,Param:?GLfloat>>).
+%% @doc
+%% See {@link texGend/3}
+-spec texGendv(Coord, Pname, Params) -> ok when Coord :: enum(),Pname :: enum(),Params :: {float()}.
+texGendv(Coord,Pname,Params) ->
+ cast(5246, <<Coord:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,0:32,
+ (<< <<C:?GLdouble>> ||C <- tuple_to_list(Params)>>)/binary>>).
-%% @spec (Target::enum(),Pname::enum(),Params::{float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexEnv.xml">external</a> documentation.
--spec texEnvfv(enum(),enum(),{float()}) -> ok.
-texEnvfv(Target,Pname,Params) ->
- cast(5277, <<Target:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
+%% @doc
+%% See {@link texGend/3}
+-spec texGenfv(Coord, Pname, Params) -> ok when Coord :: enum(),Pname :: enum(),Params :: {float()}.
+texGenfv(Coord,Pname,Params) ->
+ cast(5247, <<Coord:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
(<< <<C:?GLfloat>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
-%% @spec (Target::enum(),Pname::enum(),Param::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexEnvi.xml">external</a> documentation.
--spec texEnvi(enum(),enum(),integer()) -> ok.
+%% @doc
+%% See {@link texGend/3}
+-spec texGeniv(Coord, Pname, Params) -> ok when Coord :: enum(),Pname :: enum(),Params :: {integer()}.
+texGeniv(Coord,Pname,Params) ->
+ cast(5248, <<Coord:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
+ (<< <<C:?GLint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
+
+%% @doc Return texture coordinate generation parameters
+%%
+%% ``gl:getTexGen'' returns in `Params' selected parameters of a texture coordinate
+%% generation function that was specified using {@link gl:texGend/3} . `Coord' names one
+%% of the (`s', `t', `r', `q') texture coordinates, using the symbolic
+%% constant `?GL_S', `?GL_T', `?GL_R', or `?GL_Q'.
+%%
+%% `Pname' specifies one of three symbolic names:
+%%
+%% `?GL_TEXTURE_GEN_MODE': `Params' returns the single-valued texture generation
+%% function, a symbolic constant. The initial value is `?GL_EYE_LINEAR'.
+%%
+%% `?GL_OBJECT_PLANE': `Params' returns the four plane equation coefficients that
+%% specify object linear-coordinate generation. Integer values, when requested, are mapped
+%% directly from the internal floating-point representation.
+%%
+%% `?GL_EYE_PLANE': `Params' returns the four plane equation coefficients that
+%% specify eye linear-coordinate generation. Integer values, when requested, are mapped directly
+%% from the internal floating-point representation. The returned values are those maintained
+%% in eye coordinates. They are not equal to the values specified using {@link gl:texGend/3} ,
+%% unless the modelview matrix was identity when {@link gl:texGend/3} was called.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexGen.xml">external</a> documentation.
+-spec getTexGendv(Coord, Pname) -> {float(),float(),float(),float()} when Coord :: enum(),Pname :: enum().
+getTexGendv(Coord,Pname) ->
+ call(5249, <<Coord:?GLenum,Pname:?GLenum>>).
+
+%% @doc
+%% See {@link getTexGendv/2}
+-spec getTexGenfv(Coord, Pname) -> {float(),float(),float(),float()} when Coord :: enum(),Pname :: enum().
+getTexGenfv(Coord,Pname) ->
+ call(5250, <<Coord:?GLenum,Pname:?GLenum>>).
+
+%% @doc
+%% See {@link getTexGendv/2}
+-spec getTexGeniv(Coord, Pname) -> {integer(),integer(),integer(),integer()} when Coord :: enum(),Pname :: enum().
+getTexGeniv(Coord,Pname) ->
+ call(5251, <<Coord:?GLenum,Pname:?GLenum>>).
+
+%% @doc glTexEnvf
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexEnvf.xml">external</a> documentation.
+-spec texEnvf(Target, Pname, Param) -> ok when Target :: enum(),Pname :: enum(),Param :: float().
+texEnvf(Target,Pname,Param) ->
+ cast(5252, <<Target:?GLenum,Pname:?GLenum,Param:?GLfloat>>).
+
+%% @doc glTexEnvi
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexEnvi.xml">external</a> documentation.
+-spec texEnvi(Target, Pname, Param) -> ok when Target :: enum(),Pname :: enum(),Param :: integer().
texEnvi(Target,Pname,Param) ->
- cast(5278, <<Target:?GLenum,Pname:?GLenum,Param:?GLint>>).
+ cast(5253, <<Target:?GLenum,Pname:?GLenum,Param:?GLint>>).
+
+%% @doc Set texture environment parameters
+%%
+%% A texture environment specifies how texture values are interpreted when a fragment is
+%% textured. When `Target' is `?GL_TEXTURE_FILTER_CONTROL', `Pname' must be `?GL_TEXTURE_LOD_BIAS'
+%% . When `Target' is `?GL_TEXTURE_ENV', `Pname' can be `?GL_TEXTURE_ENV_MODE'
+%% , `?GL_TEXTURE_ENV_COLOR', `?GL_COMBINE_RGB', `?GL_COMBINE_ALPHA', `?GL_RGB_SCALE'
+%% , `?GL_ALPHA_SCALE', `?GL_SRC0_RGB', `?GL_SRC1_RGB', `?GL_SRC2_RGB', `?GL_SRC0_ALPHA'
+%% , `?GL_SRC1_ALPHA', or `?GL_SRC2_ALPHA'.
+%%
+%% If `Pname' is `?GL_TEXTURE_ENV_MODE', then `Params' is (or points to)
+%% the symbolic name of a texture function. Six texture functions may be specified: `?GL_ADD'
+%% , `?GL_MODULATE', `?GL_DECAL', `?GL_BLEND', `?GL_REPLACE', or `?GL_COMBINE'
+%% .
+%%
+%% The following table shows the correspondence of filtered texture values R t, G t, B t,
+%% A t, L t, I t to texture source components. C s and A s are used by the texture functions
+%% described below.
+%%
+%% <table><tbody><tr><td> Texture Base Internal Format </td><td> C s</td><td> A s</td></tr></tbody>
+%% <tbody><tr><td>`?GL_ALPHA'</td><td> (0, 0, 0) </td><td> A t</td></tr><tr><td>`?GL_LUMINANCE'
+%% </td><td> ( L t, L t, L t ) </td><td> 1 </td></tr><tr><td>`?GL_LUMINANCE_ALPHA'</td>
+%% <td> ( L t, L t, L t ) </td><td> A t</td></tr><tr><td>`?GL_INTENSITY'</td><td> (
+%% I t, I t, I t ) </td><td> I t</td></tr><tr><td>`?GL_RGB'</td><td> ( R t, G t, B
+%% t ) </td><td> 1 </td></tr><tr><td>`?GL_RGBA'</td><td> ( R t, G t, B t ) </td><td>
+%% A t</td></tr></tbody></table>
+%%
+%% A texture function acts on the fragment to be textured using the texture image value
+%% that applies to the fragment (see {@link gl:texParameterf/3} ) and produces an RGBA color
+%% for that fragment. The following table shows how the RGBA color is produced for each of
+%% the first five texture functions that can be chosen. C is a triple of color values (RGB)
+%% and A is the associated alpha value. RGBA values extracted from a texture image are in
+%% the range [0,1]. The subscript p refers to the color computed from the previous texture
+%% stage (or the incoming fragment if processing texture stage 0), the subscript s to the
+%% texture source color, the subscript c to the texture environment color, and the subscript
+%% v indicates a value produced by the texture function.
+%%
+%% <table><tbody><tr><td> Texture Base Internal Format </td><td>`?Value'</td><td>`?GL_REPLACE'
+%% Function </td><td>`?GL_MODULATE' Function </td><td>`?GL_DECAL' Function </td><td>
+%% `?GL_BLEND' Function </td><td>`?GL_ADD' Function </td></tr></tbody><tbody><tr><td>
+%% `?GL_ALPHA'</td><td> C v=</td><td> C p</td><td> C p</td><td> undefined </td><td> C p</td>
+%% <td> C p</td></tr><tr><td></td><td> A v=</td><td> A s</td><td> A p A s</td><td></td><td>
+%% A v= A p A s</td><td> A p A s</td></tr><tr><td>`?GL_LUMINANCE'</td><td> C v=</td><td>
+%% C s</td><td> C p C s</td><td> undefined </td><td> C p (1-C s)+C c C s</td><td> C p+C s</td></tr>
+%% <tr><td> (or 1) </td><td> A v=</td><td> A p</td><td> A p</td><td></td><td> A p</td><td> A
+%% p</td></tr><tr><td>`?GL_LUMINANCE_ALPHA'</td><td> C v=</td><td> C s</td><td> C p C
+%% s</td><td> undefined </td><td> C p (1-C s)+C c C s</td><td> C p+C s</td></tr><tr><td> (or 2) </td>
+%% <td> A v=</td><td> A s</td><td> A p A s</td><td></td><td> A p A s</td><td> A p A s</td>
+%% </tr><tr><td>`?GL_INTENSITY'</td><td> C v=</td><td> C s</td><td> C p C s</td><td>
+%% undefined </td><td> C p (1-C s)+C c C s</td><td> C p+C s</td></tr><tr><td></td><td> A v=</td><td>
+%% A s</td><td> A p A s</td><td></td><td> A p (1-A s)+A c A s</td><td> A p+A s</td></tr><tr><td>`?GL_RGB'
+%% </td><td> C v=</td><td> C s</td><td> C p C s</td><td> C s</td><td> C p (1-C s)+C c C s</td><td>
+%% C p+C s</td></tr><tr><td> (or 3) </td><td> A v=</td><td> A p</td><td> A p</td><td> A p</td>
+%% <td> A p</td><td> A p</td></tr><tr><td>`?GL_RGBA'</td><td> C v=</td><td> C s</td><td>
+%% C p C s</td><td> C p (1-A s)+C s A s</td><td> C p (1-C s)+C c C s</td><td> C p+C s</td></tr><tr><td>
+%% (or 4) </td><td> A v=</td><td> A s</td><td> A p A s</td><td> A p</td><td> A p A s</td><td>
+%% A p A s</td></tr></tbody></table>
+%%
+%% If `Pname' is `?GL_TEXTURE_ENV_MODE', and `Params' is `?GL_COMBINE',
+%% the form of the texture function depends on the values of `?GL_COMBINE_RGB' and `?GL_COMBINE_ALPHA'
+%% .
+%%
+%% The following describes how the texture sources, as specified by `?GL_SRC0_RGB', `?GL_SRC1_RGB'
+%% , `?GL_SRC2_RGB', `?GL_SRC0_ALPHA', `?GL_SRC1_ALPHA', and `?GL_SRC2_ALPHA'
+%% , are combined to produce a final texture color. In the following tables, `?GL_SRC0_c'
+%% is represented by Arg0, `?GL_SRC1_c' is represented by Arg1, and `?GL_SRC2_c'
+%% is represented by Arg2.
+%%
+%% `?GL_COMBINE_RGB' accepts any of `?GL_REPLACE', `?GL_MODULATE', `?GL_ADD'
+%% , `?GL_ADD_SIGNED', `?GL_INTERPOLATE', `?GL_SUBTRACT', `?GL_DOT3_RGB',
+%% or `?GL_DOT3_RGBA'.
+%%
+%% <table><tbody><tr><td>`?GL_COMBINE_RGB'</td><td>` Texture Function '</td></tr></tbody>
+%% <tbody><tr><td>`?GL_REPLACE'</td><td> Arg0</td></tr><tr><td>`?GL_MODULATE'</td><td>
+%% Arg0*Arg1</td></tr><tr><td>`?GL_ADD'</td><td> Arg0+Arg1</td></tr><tr><td>`?GL_ADD_SIGNED'
+%% </td><td> Arg0+Arg1-0.5</td></tr><tr><td>`?GL_INTERPOLATE'</td><td> Arg0*Arg2+Arg1*(1-
+%% Arg2)</td>
+%% </tr><tr><td>`?GL_SUBTRACT'</td><td> Arg0-Arg1</td></tr><tr><td>`?GL_DOT3_RGB'
+%% or `?GL_DOT3_RGBA'</td><td> 4*((((Arg0 r)-0.5)*((Arg1 r)-0.5))+(((Arg0 g)-0.5)*((Arg1 g)-0.5))+(((Arg0 b)-0.5)*((Arg1 b)-0.5)))</td></tr></tbody></table>
+%%
+%% The scalar results for `?GL_DOT3_RGB' and `?GL_DOT3_RGBA' are placed into each
+%% of the 3 (RGB) or 4 (RGBA) components on output.
+%%
+%% Likewise, `?GL_COMBINE_ALPHA' accepts any of `?GL_REPLACE', `?GL_MODULATE',
+%% `?GL_ADD', `?GL_ADD_SIGNED', `?GL_INTERPOLATE', or `?GL_SUBTRACT'.
+%% The following table describes how alpha values are combined:
+%%
+%% <table><tbody><tr><td>`?GL_COMBINE_ALPHA'</td><td>` Texture Function '</td></tr>
+%% </tbody><tbody><tr><td>`?GL_REPLACE'</td><td> Arg0</td></tr><tr><td>`?GL_MODULATE'
+%% </td><td> Arg0*Arg1</td></tr><tr><td>`?GL_ADD'</td><td> Arg0+Arg1</td></tr><tr><td>`?GL_ADD_SIGNED'
+%% </td><td> Arg0+Arg1-0.5</td></tr><tr><td>`?GL_INTERPOLATE'</td><td> Arg0*Arg2+Arg1*(1-
+%% Arg2)</td>
+%% </tr><tr><td>`?GL_SUBTRACT'</td><td> Arg0-Arg1</td></tr></tbody></table>
+%%
+%% In the following tables, the value C s represents the color sampled from the currently
+%% bound texture, C c represents the constant texture-environment color, C f represents
+%% the primary color of the incoming fragment, and C p represents the color computed from
+%% the previous texture stage or C f if processing texture stage 0. Likewise, A s, A c,
+%% A f, and A p represent the respective alpha values.
+%%
+%% The following table describes the values assigned to Arg0, Arg1, and Arg2 based upon
+%% the RGB sources and operands:
+%%
+%% <table><tbody><tr><td>`?GL_SRCn_RGB'</td><td>`?GL_OPERANDn_RGB'</td><td>` Argument Value '
+%% </td></tr></tbody><tbody><tr><td>`?GL_TEXTURE'</td><td>`?GL_SRC_COLOR'</td><td>(C
+%% s)</td>
+%% </tr><tr><td></td><td>`?GL_ONE_MINUS_SRC_COLOR'</td><td> 1-(C s)</td></tr><tr><td></td><td>
+%% `?GL_SRC_ALPHA'</td><td>(A s)</td></tr><tr><td></td><td>`?GL_ONE_MINUS_SRC_ALPHA'</td>
+%% <td> 1-(A s)</td></tr><tr><td>`?GL_TEXTUREn'</td><td>`?GL_SRC_COLOR'</td><td>(C s)</td></tr>
+%% <tr><td></td><td>`?GL_ONE_MINUS_SRC_COLOR'</td><td> 1-(C s)</td></tr><tr><td></td><td>`?GL_SRC_ALPHA'
+%% </td><td>(A s)</td></tr><tr><td></td><td>`?GL_ONE_MINUS_SRC_ALPHA'</td><td> 1-(A s)</td></tr><tr>
+%% <td>`?GL_CONSTANT'</td><td>`?GL_SRC_COLOR'</td><td>(C c)</td></tr><tr><td></td><td>`?GL_ONE_MINUS_SRC_COLOR'
+%% </td><td> 1-(C c)</td></tr><tr><td></td><td>`?GL_SRC_ALPHA'</td><td>(A c)</td></tr><tr><td></td>
+%% <td>`?GL_ONE_MINUS_SRC_ALPHA'</td><td> 1-(A c)</td></tr><tr><td>`?GL_PRIMARY_COLOR'</td>
+%% <td>`?GL_SRC_COLOR'</td><td>(C f)</td></tr><tr><td></td><td>`?GL_ONE_MINUS_SRC_COLOR'</td>
+%% <td> 1-(C f)</td></tr><tr><td></td><td>`?GL_SRC_ALPHA'</td><td>(A f)</td></tr><tr><td></td><td>
+%% `?GL_ONE_MINUS_SRC_ALPHA'</td><td> 1-(A f)</td></tr><tr><td>`?GL_PREVIOUS'</td><td>`?GL_SRC_COLOR'
+%% </td><td>(C p)</td></tr><tr><td></td><td>`?GL_ONE_MINUS_SRC_COLOR'</td><td> 1-(C p)</td></tr><tr>
+%% <td></td><td>`?GL_SRC_ALPHA'</td><td>(A p)</td></tr><tr><td></td><td>`?GL_ONE_MINUS_SRC_ALPHA'
+%% </td><td> 1-(A p)</td></tr></tbody></table>
+%%
+%% For `?GL_TEXTUREn' sources, C s and A s represent the color and alpha, respectively,
+%% produced from texture stage n.
+%%
+%% The follow table describes the values assigned to Arg0, Arg1, and Arg2 based upon
+%% the alpha sources and operands:
+%%
+%% <table><tbody><tr><td>`?GL_SRCn_ALPHA'</td><td>`?GL_OPERANDn_ALPHA'</td><td>` Argument Value '
+%% </td></tr></tbody><tbody><tr><td>`?GL_TEXTURE'</td><td>`?GL_SRC_ALPHA'</td><td>(A
+%% s)</td>
+%% </tr><tr><td></td><td>`?GL_ONE_MINUS_SRC_ALPHA'</td><td> 1-(A s)</td></tr><tr><td>`?GL_TEXTUREn'
+%% </td><td>`?GL_SRC_ALPHA'</td><td>(A s)</td></tr><tr><td></td><td>`?GL_ONE_MINUS_SRC_ALPHA'
+%% </td><td> 1-(A s)</td></tr><tr><td>`?GL_CONSTANT'</td><td>`?GL_SRC_ALPHA'</td><td>(A
+%% c)</td>
+%% </tr><tr><td></td><td>`?GL_ONE_MINUS_SRC_ALPHA'</td><td> 1-(A c)</td></tr><tr><td>`?GL_PRIMARY_COLOR'
+%% </td><td>`?GL_SRC_ALPHA'</td><td>(A f)</td></tr><tr><td></td><td>`?GL_ONE_MINUS_SRC_ALPHA'
+%% </td><td> 1-(A f)</td></tr><tr><td>`?GL_PREVIOUS'</td><td>`?GL_SRC_ALPHA'</td><td>(A
+%% p)</td>
+%% </tr><tr><td></td><td>`?GL_ONE_MINUS_SRC_ALPHA'</td><td> 1-(A p)</td></tr></tbody></table>
+%%
+%%
+%% The RGB and alpha results of the texture function are multipled by the values of `?GL_RGB_SCALE'
+%% and `?GL_ALPHA_SCALE', respectively, and clamped to the range [0 1].
+%%
+%% If `Pname' is `?GL_TEXTURE_ENV_COLOR', `Params' is a pointer to an array
+%% that holds an RGBA color consisting of four values. Integer color components are interpreted
+%% linearly such that the most positive integer maps to 1.0, and the most negative integer
+%% maps to -1.0. The values are clamped to the range [0,1] when they are specified. C c
+%% takes these four values.
+%%
+%% If `Pname' is `?GL_TEXTURE_LOD_BIAS', the value specified is added to the texture
+%% level-of-detail parameter, that selects which mipmap, or mipmaps depending upon the selected
+%% `?GL_TEXTURE_MIN_FILTER', will be sampled.
+%%
+%% `?GL_TEXTURE_ENV_MODE' defaults to `?GL_MODULATE' and `?GL_TEXTURE_ENV_COLOR'
+%% defaults to (0, 0, 0, 0).
+%%
+%% If `Target' is `?GL_POINT_SPRITE' and `Pname' is `?GL_COORD_REPLACE',
+%% the boolean value specified is used to either enable or disable point sprite texture coordinate
+%% replacement. The default value is `?GL_FALSE'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexEnv.xml">external</a> documentation.
+-spec texEnvfv(Target, Pname, Params) -> ok when Target :: enum(),Pname :: enum(),Params :: {float()}.
+texEnvfv(Target,Pname,Params) ->
+ cast(5254, <<Target:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
+ (<< <<C:?GLfloat>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
-%% @spec (Target::enum(),Pname::enum(),Params::{integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexEnv.xml">external</a> documentation.
--spec texEnviv(enum(),enum(),{integer()}) -> ok.
+%% @doc
+%% See {@link texEnvfv/3}
+-spec texEnviv(Target, Pname, Params) -> ok when Target :: enum(),Pname :: enum(),Params :: {integer()}.
texEnviv(Target,Pname,Params) ->
- cast(5279, <<Target:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
+ cast(5255, <<Target:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
(<< <<C:?GLint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
-%% @spec (Coord::enum(),Pname::enum(),Param::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexGen.xml">external</a> documentation.
--spec texGend(enum(),enum(),float()) -> ok.
-texGend(Coord,Pname,Param) ->
- cast(5280, <<Coord:?GLenum,Pname:?GLenum,Param:?GLdouble>>).
+%% @doc Return texture environment parameters
+%%
+%% ``gl:getTexEnv'' returns in `Params' selected values of a texture environment that
+%% was specified with {@link gl:texEnvfv/3} . `Target' specifies a texture environment.
+%%
+%% When `Target' is `?GL_TEXTURE_FILTER_CONTROL', `Pname' must be `?GL_TEXTURE_LOD_BIAS'
+%% . When `Target' is `?GL_POINT_SPRITE', `Pname' must be `?GL_COORD_REPLACE'
+%% . When `Target' is `?GL_TEXTURE_ENV', `Pname' can be `?GL_TEXTURE_ENV_MODE'
+%% , `?GL_TEXTURE_ENV_COLOR', `?GL_COMBINE_RGB', `?GL_COMBINE_ALPHA', `?GL_RGB_SCALE'
+%% , `?GL_ALPHA_SCALE', `?GL_SRC0_RGB', `?GL_SRC1_RGB', `?GL_SRC2_RGB',
+%% `?GL_SRC0_ALPHA', `?GL_SRC1_ALPHA', or `?GL_SRC2_ALPHA'.
+%%
+%% `Pname' names a specific texture environment parameter, as follows:
+%%
+%% `?GL_TEXTURE_ENV_MODE': `Params' returns the single-valued texture environment
+%% mode, a symbolic constant. The initial value is `?GL_MODULATE'.
+%%
+%% `?GL_TEXTURE_ENV_COLOR': `Params' returns four integer or floating-point values
+%% that are the texture environment color. Integer values, when requested, are linearly mapped
+%% from the internal floating-point representation such that 1.0 maps to the most positive
+%% representable integer, and -1.0 maps to the most negative representable integer. The
+%% initial value is (0, 0, 0, 0).
+%%
+%% `?GL_TEXTURE_LOD_BIAS': `Params' returns a single floating-point value that
+%% is the texture level-of-detail bias. The initial value is 0.
+%%
+%% `?GL_COMBINE_RGB': `Params' returns a single symbolic constant value representing
+%% the current RGB combine mode. The initial value is `?GL_MODULATE'.
+%%
+%% `?GL_COMBINE_ALPHA': `Params' returns a single symbolic constant value representing
+%% the current alpha combine mode. The initial value is `?GL_MODULATE'.
+%%
+%% `?GL_SRC0_RGB': `Params' returns a single symbolic constant value representing
+%% the texture combiner zero's RGB source. The initial value is `?GL_TEXTURE'.
+%%
+%% `?GL_SRC1_RGB': `Params' returns a single symbolic constant value representing
+%% the texture combiner one's RGB source. The initial value is `?GL_PREVIOUS'.
+%%
+%% `?GL_SRC2_RGB': `Params' returns a single symbolic constant value representing
+%% the texture combiner two's RGB source. The initial value is `?GL_CONSTANT'.
+%%
+%% `?GL_SRC0_ALPHA': `Params' returns a single symbolic constant value representing
+%% the texture combiner zero's alpha source. The initial value is `?GL_TEXTURE'.
+%%
+%% `?GL_SRC1_ALPHA': `Params' returns a single symbolic constant value representing
+%% the texture combiner one's alpha source. The initial value is `?GL_PREVIOUS'.
+%%
+%% `?GL_SRC2_ALPHA': `Params' returns a single symbolic constant value representing
+%% the texture combiner two's alpha source. The initial value is `?GL_CONSTANT'.
+%%
+%% `?GL_OPERAND0_RGB': `Params' returns a single symbolic constant value representing
+%% the texture combiner zero's RGB operand. The initial value is `?GL_SRC_COLOR'.
+%%
+%% `?GL_OPERAND1_RGB': `Params' returns a single symbolic constant value representing
+%% the texture combiner one's RGB operand. The initial value is `?GL_SRC_COLOR'.
+%%
+%% `?GL_OPERAND2_RGB': `Params' returns a single symbolic constant value representing
+%% the texture combiner two's RGB operand. The initial value is `?GL_SRC_ALPHA'.
+%%
+%% `?GL_OPERAND0_ALPHA': `Params' returns a single symbolic constant value representing
+%% the texture combiner zero's alpha operand. The initial value is `?GL_SRC_ALPHA'.
+%%
+%% `?GL_OPERAND1_ALPHA': `Params' returns a single symbolic constant value representing
+%% the texture combiner one's alpha operand. The initial value is `?GL_SRC_ALPHA'.
+%%
+%% `?GL_OPERAND2_ALPHA': `Params' returns a single symbolic constant value representing
+%% the texture combiner two's alpha operand. The initial value is `?GL_SRC_ALPHA'.
+%%
+%% `?GL_RGB_SCALE': `Params' returns a single floating-point value representing
+%% the current RGB texture combiner scaling factor. The initial value is 1.0.
+%%
+%% `?GL_ALPHA_SCALE': `Params' returns a single floating-point value representing
+%% the current alpha texture combiner scaling factor. The initial value is 1.0.
+%%
+%% `?GL_COORD_REPLACE': `Params' returns a single boolean value representing the
+%% current point sprite texture coordinate replacement enable state. The initial value is `?GL_FALSE'
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexEnv.xml">external</a> documentation.
+-spec getTexEnvfv(Target, Pname) -> {float(),float(),float(),float()} when Target :: enum(),Pname :: enum().
+getTexEnvfv(Target,Pname) ->
+ call(5256, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Coord::enum(),Pname::enum(),Params::{float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexGen.xml">external</a> documentation.
--spec texGendv(enum(),enum(),{float()}) -> ok.
-texGendv(Coord,Pname,Params) ->
- cast(5281, <<Coord:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,0:32,
- (<< <<C:?GLdouble>> ||C <- tuple_to_list(Params)>>)/binary>>).
+%% @doc
+%% See {@link getTexEnvfv/2}
+-spec getTexEnviv(Target, Pname) -> {integer(),integer(),integer(),integer()} when Target :: enum(),Pname :: enum().
+getTexEnviv(Target,Pname) ->
+ call(5257, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Coord::enum(),Pname::enum(),Param::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexGen.xml">external</a> documentation.
--spec texGenf(enum(),enum(),float()) -> ok.
-texGenf(Coord,Pname,Param) ->
- cast(5282, <<Coord:?GLenum,Pname:?GLenum,Param:?GLfloat>>).
+%% @doc Set texture parameters
+%%
+%% ``gl:texParameter'' assigns the value or values in `Params' to the texture parameter
+%% specified as `Pname' . `Target' defines the target texture, either `?GL_TEXTURE_1D'
+%% , `?GL_TEXTURE_2D', `?GL_TEXTURE_1D_ARRAY', `?GL_TEXTURE_2D_ARRAY', `?GL_TEXTURE_RECTANGLE'
+%% , or `?GL_TEXTURE_3D'. The following symbols are accepted in `Pname' :
+%%
+%% `?GL_TEXTURE_BASE_LEVEL': Specifies the index of the lowest defined mipmap level.
+%% This is an integer value. The initial value is 0.
+%%
+%%
+%%
+%% `?GL_TEXTURE_BORDER_COLOR': The data in `Params' specifies four values that
+%% define the border values that should be used for border texels. If a texel is sampled
+%% from the border of the texture, the values of `?GL_TEXTURE_BORDER_COLOR' are interpreted
+%% as an RGBA color to match the texture's internal format and substituted for the non-existent
+%% texel data. If the texture contains depth components, the first component of `?GL_TEXTURE_BORDER_COLOR'
+%% is interpreted as a depth value. The initial value is ( 0.0, 0.0, 0.0, 0.0 ).
+%%
+%% If the values for `?GL_TEXTURE_BORDER_COLOR' are specified with ``gl:texParameterIiv''
+%% or ``gl:texParameterIuiv'', the values are stored unmodified with an internal data
+%% type of integer. If specified with ``gl:texParameteriv'', they are converted to floating
+%% point with the following equation: f= 2 c+1 2 b-/1. If specified with ``gl:texParameterfv''
+%% , they are stored unmodified as floating-point values.
+%%
+%% `?GL_TEXTURE_COMPARE_FUNC': Specifies the comparison operator used when `?GL_TEXTURE_COMPARE_MODE'
+%% is set to `?GL_COMPARE_REF_TO_TEXTURE'. Permissible values are: <table><tbody><tr><td>
+%% ` Texture Comparison Function '</td><td>` Computed result '</td></tr></tbody><tbody>
+%% <tr><td>`?GL_LEQUAL'</td><td> result={1.0 0.0 &amp;nbsp;&amp;nbsp; r&lt;=(D t) r&gt;(D t))</td></tr><tr><td>`?GL_GEQUAL'</td><td>
+%% result={1.0 0.0 &amp;nbsp;&amp;nbsp; r&gt;=(D t) r&lt;(D t))</td></tr><tr><td>`?GL_LESS'</td><td> result={1.0 0.0 &amp;nbsp;&amp;nbsp; r&lt;
+%% (D t) r&gt;=(D t))</td></tr><tr><td>`?GL_GREATER'
+%% </td><td> result={1.0 0.0 &amp;nbsp;&amp;nbsp; r&gt;(D t) r&lt;=(D t))</td></tr><tr><td>`?GL_EQUAL'</td><td> result={1.0 0.0 &amp;nbsp;&amp;nbsp;
+%% r=(D t) r&amp;ne;(D t))</td></tr><tr><td>`?GL_NOTEQUAL'
+%% </td><td> result={1.0 0.0 &amp;nbsp;&amp;nbsp; r&amp;ne;(D t) r=(D t))</td></tr><tr><td>`?GL_ALWAYS'</td><td> result= 1.0</td></tr><tr><td>
+%% `?GL_NEVER'</td><td> result= 0.0</td></tr></tbody></table> where r is the current
+%% interpolated texture coordinate, and D t is the depth texture value sampled from the
+%% currently bound depth texture. result is assigned to the the red channel.
+%%
+%% `?GL_TEXTURE_COMPARE_MODE': Specifies the texture comparison mode for currently
+%% bound depth textures. That is, a texture whose internal format is `?GL_DEPTH_COMPONENT_*'
+%% ; see {@link gl:texImage2D/9} ) Permissible values are:
+%%
+%% `?GL_COMPARE_REF_TO_TEXTURE': Specifies that the interpolated and clamped r texture
+%% coordinate should be compared to the value in the currently bound depth texture. See the
+%% discussion of `?GL_TEXTURE_COMPARE_FUNC' for details of how the comparison is evaluated.
+%% The result of the comparison is assigned to the red channel.
+%%
+%% `?GL_NONE': Specifies that the red channel should be assigned the appropriate value
+%% from the currently bound depth texture.
+%%
+%% `?GL_TEXTURE_LOD_BIAS': `Params' specifies a fixed bias value that is to be
+%% added to the level-of-detail parameter for the texture before texture sampling. The specified
+%% value is added to the shader-supplied bias value (if any) and subsequently clamped into
+%% the implementation-defined range [( - bias max)(bias max)], where bias max is the value of the implementation
+%% defined constant `?GL_MAX_TEXTURE_LOD_BIAS'. The initial value is 0.0.
+%%
+%% `?GL_TEXTURE_MIN_FILTER': The texture minifying function is used whenever the level-of-detail
+%% function used when sampling from the texture determines that the texture should be minified.
+%% There are six defined minifying functions. Two of them use either the nearest texture
+%% elements or a weighted average of multiple texture elements to compute the texture value.
+%% The other four use mipmaps.
+%%
+%% A mipmap is an ordered set of arrays representing the same image at progressively lower
+%% resolutions. If the texture has dimensions 2 n*2 m, there are max(n m)+1 mipmaps. The first
+%% mipmap is the original texture, with dimensions 2 n*2 m. Each subsequent mipmap has
+%% dimensions 2(k-1)*2(l-1), where 2 k*2 l are the dimensions of the previous mipmap, until either
+%% k= 0 or l= 0. At that point, subsequent mipmaps have dimension 1*2(l-1) or 2(k-1)*1 until
+%% the final mipmap, which has dimension 1*1. To define the mipmaps, call {@link gl:texImage1D/8}
+%% , {@link gl:texImage2D/9} , {@link gl:texImage3D/10} , {@link gl:copyTexImage1D/7} , or {@link gl:copyTexImage2D/8}
+%% with the `level' argument indicating the order of the mipmaps. Level 0 is the original
+%% texture; level max(n m) is the final 1*1 mipmap.
+%%
+%% `Params' supplies a function for minifying the texture as one of the following:
+%%
+%% `?GL_NEAREST': Returns the value of the texture element that is nearest (in Manhattan
+%% distance) to the specified texture coordinates.
+%%
+%% `?GL_LINEAR': Returns the weighted average of the four texture elements that are
+%% closest to the specified texture coordinates. These can include items wrapped or repeated
+%% from other parts of a texture, depending on the values of `?GL_TEXTURE_WRAP_S' and `?GL_TEXTURE_WRAP_T'
+%% , and on the exact mapping.
+%%
+%% `?GL_NEAREST_MIPMAP_NEAREST': Chooses the mipmap that most closely matches the size
+%% of the pixel being textured and uses the `?GL_NEAREST' criterion (the texture element
+%% closest to the specified texture coordinates) to produce a texture value.
+%%
+%% `?GL_LINEAR_MIPMAP_NEAREST': Chooses the mipmap that most closely matches the size
+%% of the pixel being textured and uses the `?GL_LINEAR' criterion (a weighted average
+%% of the four texture elements that are closest to the specified texture coordinates) to
+%% produce a texture value.
+%%
+%% `?GL_NEAREST_MIPMAP_LINEAR': Chooses the two mipmaps that most closely match the
+%% size of the pixel being textured and uses the `?GL_NEAREST' criterion (the texture
+%% element closest to the specified texture coordinates ) to produce a texture value from
+%% each mipmap. The final texture value is a weighted average of those two values.
+%%
+%% `?GL_LINEAR_MIPMAP_LINEAR': Chooses the two mipmaps that most closely match the
+%% size of the pixel being textured and uses the `?GL_LINEAR' criterion (a weighted
+%% average of the texture elements that are closest to the specified texture coordinates)
+%% to produce a texture value from each mipmap. The final texture value is a weighted average
+%% of those two values.
+%%
+%% As more texture elements are sampled in the minification process, fewer aliasing artifacts
+%% will be apparent. While the `?GL_NEAREST' and `?GL_LINEAR' minification functions
+%% can be faster than the other four, they sample only one or multiple texture elements to
+%% determine the texture value of the pixel being rendered and can produce moire patterns
+%% or ragged transitions. The initial value of `?GL_TEXTURE_MIN_FILTER' is `?GL_NEAREST_MIPMAP_LINEAR'
+%% .
+%%
+%%
+%%
+%% `?GL_TEXTURE_MAG_FILTER': The texture magnification function is used whenever the
+%% level-of-detail function used when sampling from the texture determines that the texture
+%% should be magified. It sets the texture magnification function to either `?GL_NEAREST'
+%% or `?GL_LINEAR' (see below). `?GL_NEAREST' is generally faster than `?GL_LINEAR'
+%% , but it can produce textured images with sharper edges because the transition between
+%% texture elements is not as smooth. The initial value of `?GL_TEXTURE_MAG_FILTER' is `?GL_LINEAR'
+%% .
+%%
+%% `?GL_NEAREST': Returns the value of the texture element that is nearest (in Manhattan
+%% distance) to the specified texture coordinates.
+%%
+%% `?GL_LINEAR': Returns the weighted average of the texture elements that are closest
+%% to the specified texture coordinates. These can include items wrapped or repeated from
+%% other parts of a texture, depending on the values of `?GL_TEXTURE_WRAP_S' and `?GL_TEXTURE_WRAP_T'
+%% , and on the exact mapping.
+%%
+%%
+%%
+%% `?GL_TEXTURE_MIN_LOD': Sets the minimum level-of-detail parameter. This floating-point
+%% value limits the selection of highest resolution mipmap (lowest mipmap level). The initial
+%% value is -1000.
+%%
+%%
+%%
+%% `?GL_TEXTURE_MAX_LOD': Sets the maximum level-of-detail parameter. This floating-point
+%% value limits the selection of the lowest resolution mipmap (highest mipmap level). The
+%% initial value is 1000.
+%%
+%%
+%%
+%% `?GL_TEXTURE_MAX_LEVEL': Sets the index of the highest defined mipmap level. This
+%% is an integer value. The initial value is 1000.
+%%
+%%
+%%
+%% `?GL_TEXTURE_SWIZZLE_R': Sets the swizzle that will be applied to the r component
+%% of a texel before it is returned to the shader. Valid values for `Param' are `?GL_RED'
+%% , `?GL_GREEN', `?GL_BLUE', `?GL_ALPHA', `?GL_ZERO' and `?GL_ONE'.
+%% If `?GL_TEXTURE_SWIZZLE_R' is `?GL_RED', the value for r will be taken from
+%% the first channel of the fetched texel. If `?GL_TEXTURE_SWIZZLE_R' is `?GL_GREEN'
+%% , the value for r will be taken from the second channel of the fetched texel. If `?GL_TEXTURE_SWIZZLE_R'
+%% is `?GL_BLUE', the value for r will be taken from the third channel of the fetched
+%% texel. If `?GL_TEXTURE_SWIZZLE_R' is `?GL_ALPHA', the value for r will be taken
+%% from the fourth channel of the fetched texel. If `?GL_TEXTURE_SWIZZLE_R' is `?GL_ZERO'
+%% , the value for r will be subtituted with 0.0. If `?GL_TEXTURE_SWIZZLE_R' is `?GL_ONE'
+%% , the value for r will be subtituted with 1.0. The initial value is `?GL_RED'.
+%%
+%%
+%%
+%% `?GL_TEXTURE_SWIZZLE_G': Sets the swizzle that will be applied to the g component
+%% of a texel before it is returned to the shader. Valid values for `Param' and their
+%% effects are similar to those of `?GL_TEXTURE_SWIZZLE_R'. The initial value is `?GL_GREEN'
+%% .
+%%
+%%
+%%
+%% `?GL_TEXTURE_SWIZZLE_B': Sets the swizzle that will be applied to the b component
+%% of a texel before it is returned to the shader. Valid values for `Param' and their
+%% effects are similar to those of `?GL_TEXTURE_SWIZZLE_R'. The initial value is `?GL_BLUE'
+%% .
+%%
+%%
+%%
+%% `?GL_TEXTURE_SWIZZLE_A': Sets the swizzle that will be applied to the a component
+%% of a texel before it is returned to the shader. Valid values for `Param' and their
+%% effects are similar to those of `?GL_TEXTURE_SWIZZLE_R'. The initial value is `?GL_ALPHA'
+%% .
+%%
+%%
+%%
+%% `?GL_TEXTURE_SWIZZLE_RGBA': Sets the swizzles that will be applied to the r, g,
+%% b, and a components of a texel before they are returned to the shader. Valid values for `Params'
+%% and their effects are similar to those of `?GL_TEXTURE_SWIZZLE_R', except that all
+%% channels are specified simultaneously. Setting the value of `?GL_TEXTURE_SWIZZLE_RGBA'
+%% is equivalent (assuming no errors are generated) to setting the parameters of each of `?GL_TEXTURE_SWIZZLE_R'
+%% , `?GL_TEXTURE_SWIZZLE_G', `?GL_TEXTURE_SWIZZLE_B', and `?GL_TEXTURE_SWIZZLE_A'
+%% successively.
+%%
+%%
+%%
+%% `?GL_TEXTURE_WRAP_S': Sets the wrap parameter for texture coordinate s to either `?GL_CLAMP_TO_EDGE'
+%% , `?GL_CLAMP_TO_BORDER', `?GL_MIRRORED_REPEAT', or `?GL_REPEAT'. `?GL_CLAMP_TO_EDGE'
+%% causes s coordinates to be clamped to the range [(1 2/N) 1-(1 2/N)], where N is the size of the texture
+%% in the direction of clamping. `?GL_CLAMP_TO_BORDER' evaluates s coordinates in a
+%% similar manner to `?GL_CLAMP_TO_EDGE'. However, in cases where clamping would have
+%% occurred in `?GL_CLAMP_TO_EDGE' mode, the fetched texel data is substituted with
+%% the values specified by `?GL_TEXTURE_BORDER_COLOR'. `?GL_REPEAT' causes the
+%% integer part of the s coordinate to be ignored; the GL uses only the fractional part,
+%% thereby creating a repeating pattern. `?GL_MIRRORED_REPEAT' causes the s coordinate
+%% to be set to the fractional part of the texture coordinate if the integer part of s
+%% is even; if the integer part of s is odd, then the s texture coordinate is set to 1-
+%% frac(s), where frac(s) represents the fractional part of s. Initially, `?GL_TEXTURE_WRAP_S'
+%% is set to `?GL_REPEAT'.
+%%
+%%
+%%
+%% `?GL_TEXTURE_WRAP_T': Sets the wrap parameter for texture coordinate t to either `?GL_CLAMP_TO_EDGE'
+%% , `?GL_CLAMP_TO_BORDER', `?GL_MIRRORED_REPEAT', or `?GL_REPEAT'. See the
+%% discussion under `?GL_TEXTURE_WRAP_S'. Initially, `?GL_TEXTURE_WRAP_T' is set
+%% to `?GL_REPEAT'.
+%%
+%%
+%%
+%% `?GL_TEXTURE_WRAP_R': Sets the wrap parameter for texture coordinate r to either `?GL_CLAMP_TO_EDGE'
+%% , `?GL_CLAMP_TO_BORDER', `?GL_MIRRORED_REPEAT', or `?GL_REPEAT'. See the
+%% discussion under `?GL_TEXTURE_WRAP_S'. Initially, `?GL_TEXTURE_WRAP_R' is set
+%% to `?GL_REPEAT'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexParameter.xml">external</a> documentation.
+-spec texParameterf(Target, Pname, Param) -> ok when Target :: enum(),Pname :: enum(),Param :: float().
+texParameterf(Target,Pname,Param) ->
+ cast(5258, <<Target:?GLenum,Pname:?GLenum,Param:?GLfloat>>).
-%% @spec (Coord::enum(),Pname::enum(),Params::{float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexGen.xml">external</a> documentation.
--spec texGenfv(enum(),enum(),{float()}) -> ok.
-texGenfv(Coord,Pname,Params) ->
- cast(5283, <<Coord:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
- (<< <<C:?GLfloat>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
+%% @doc
+%% See {@link texParameterf/3}
+-spec texParameteri(Target, Pname, Param) -> ok when Target :: enum(),Pname :: enum(),Param :: integer().
+texParameteri(Target,Pname,Param) ->
+ cast(5259, <<Target:?GLenum,Pname:?GLenum,Param:?GLint>>).
-%% @spec (Coord::enum(),Pname::enum(),Param::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexGen.xml">external</a> documentation.
--spec texGeni(enum(),enum(),integer()) -> ok.
-texGeni(Coord,Pname,Param) ->
- cast(5284, <<Coord:?GLenum,Pname:?GLenum,Param:?GLint>>).
+%% @doc
+%% See {@link texParameterf/3}
+-spec texParameterfv(Target, Pname, Params) -> ok when Target :: enum(),Pname :: enum(),Params :: {float()}.
+texParameterfv(Target,Pname,Params) ->
+ cast(5260, <<Target:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
+ (<< <<C:?GLfloat>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
-%% @spec (Coord::enum(),Pname::enum(),Params::{integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexGen.xml">external</a> documentation.
--spec texGeniv(enum(),enum(),{integer()}) -> ok.
-texGeniv(Coord,Pname,Params) ->
- cast(5285, <<Coord:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
+%% @doc
+%% See {@link texParameterf/3}
+-spec texParameteriv(Target, Pname, Params) -> ok when Target :: enum(),Pname :: enum(),Params :: {integer()}.
+texParameteriv(Target,Pname,Params) ->
+ cast(5261, <<Target:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
(<< <<C:?GLint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
-%% @spec (Target::enum(),Level::integer(),Internalformat::integer(),Width::integer(),Border::integer(),Format::enum(),Type::enum(),Pixels::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexImage1D.xml">external</a> documentation.
--spec texImage1D(enum(),integer(),integer(),integer(),integer(),enum(),enum(),offset()|mem()) -> ok.
-texImage1D(Target,Level,Internalformat,Width,Border,Format,Type,Pixels) when is_integer(Pixels) ->
- cast(5286, <<Target:?GLenum,Level:?GLint,Internalformat:?GLint,Width:?GLsizei,Border:?GLint,Format:?GLenum,Type:?GLenum,Pixels:?GLuint>>);
-texImage1D(Target,Level,Internalformat,Width,Border,Format,Type,Pixels) ->
+%% @doc Return texture parameter values
+%%
+%% ``gl:getTexParameter'' returns in `Params' the value or values of the texture parameter
+%% specified as `Pname' . `Target' defines the target texture. `?GL_TEXTURE_1D',
+%% `?GL_TEXTURE_2D', `?GL_TEXTURE_3D', `?GL_TEXTURE_1D_ARRAY', `?GL_TEXTURE_2D_ARRAY'
+%% , `?GL_TEXTURE_RECTANGLE', `?GL_TEXTURE_CUBE_MAP', `?GL_TEXTURE_CUBE_MAP_ARRAY'
+%% specify one-, two-, or three-dimensional, one-dimensional array, two-dimensional array,
+%% rectangle, cube-mapped or cube-mapped array texturing, respectively. `Pname' accepts
+%% the same symbols as {@link gl:texParameterf/3} , with the same interpretations:
+%%
+%% `?GL_TEXTURE_MAG_FILTER': Returns the single-valued texture magnification filter,
+%% a symbolic constant. The initial value is `?GL_LINEAR'.
+%%
+%% `?GL_TEXTURE_MIN_FILTER': Returns the single-valued texture minification filter,
+%% a symbolic constant. The initial value is `?GL_NEAREST_MIPMAP_LINEAR'.
+%%
+%% `?GL_TEXTURE_MIN_LOD': Returns the single-valued texture minimum level-of-detail
+%% value. The initial value is -1000.
+%%
+%% `?GL_TEXTURE_MAX_LOD': Returns the single-valued texture maximum level-of-detail
+%% value. The initial value is 1000.
+%%
+%% `?GL_TEXTURE_BASE_LEVEL': Returns the single-valued base texture mipmap level. The
+%% initial value is 0.
+%%
+%% `?GL_TEXTURE_MAX_LEVEL': Returns the single-valued maximum texture mipmap array
+%% level. The initial value is 1000.
+%%
+%% `?GL_TEXTURE_SWIZZLE_R': Returns the red component swizzle. The initial value is `?GL_RED'
+%% .
+%%
+%% `?GL_TEXTURE_SWIZZLE_G': Returns the green component swizzle. The initial value is `?GL_GREEN'
+%% .
+%%
+%% `?GL_TEXTURE_SWIZZLE_B': Returns the blue component swizzle. The initial value is `?GL_BLUE'
+%% .
+%%
+%% `?GL_TEXTURE_SWIZZLE_A': Returns the alpha component swizzle. The initial value is `?GL_ALPHA'
+%% .
+%%
+%% `?GL_TEXTURE_SWIZZLE_RGBA': Returns the component swizzle for all channels in a
+%% single query.
+%%
+%% `?GL_TEXTURE_WRAP_S': Returns the single-valued wrapping function for texture coordinate
+%% s, a symbolic constant. The initial value is `?GL_REPEAT'.
+%%
+%% `?GL_TEXTURE_WRAP_T': Returns the single-valued wrapping function for texture coordinate
+%% t, a symbolic constant. The initial value is `?GL_REPEAT'.
+%%
+%% `?GL_TEXTURE_WRAP_R': Returns the single-valued wrapping function for texture coordinate
+%% r, a symbolic constant. The initial value is `?GL_REPEAT'.
+%%
+%% `?GL_TEXTURE_BORDER_COLOR': Returns four integer or floating-point numbers that
+%% comprise the RGBA color of the texture border. Floating-point values are returned in the
+%% range [0 1]. Integer values are returned as a linear mapping of the internal floating-point
+%% representation such that 1.0 maps to the most positive representable integer and -1.0
+%% maps to the most negative representable integer. The initial value is (0, 0, 0, 0).
+%%
+%% `?GL_TEXTURE_COMPARE_MODE': Returns a single-valued texture comparison mode, a symbolic
+%% constant. The initial value is `?GL_NONE'. See {@link gl:texParameterf/3} .
+%%
+%% `?GL_TEXTURE_COMPARE_FUNC': Returns a single-valued texture comparison function,
+%% a symbolic constant. The initial value is `?GL_LEQUAL'. See {@link gl:texParameterf/3} .
+%%
+%%
+%% In addition to the parameters that may be set with {@link gl:texParameterf/3} , ``gl:getTexParameter''
+%% accepts the following read-only parameters:
+%%
+%% `?GL_TEXTURE_IMMUTABLE_FORMAT': Returns non-zero if the texture has an immutable
+%% format. Textures become immutable if their storage is specified with {@link gl:texStorage1D/4}
+%% , {@link gl:texStorage2D/5} or {@link gl:texStorage3D/6} . The initial value is `?GL_FALSE'
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexParameter.xml">external</a> documentation.
+-spec getTexParameterfv(Target, Pname) -> {float(),float(),float(),float()} when Target :: enum(),Pname :: enum().
+getTexParameterfv(Target,Pname) ->
+ call(5262, <<Target:?GLenum,Pname:?GLenum>>).
+
+%% @doc
+%% See {@link getTexParameterfv/2}
+-spec getTexParameteriv(Target, Pname) -> {integer(),integer(),integer(),integer()} when Target :: enum(),Pname :: enum().
+getTexParameteriv(Target,Pname) ->
+ call(5263, <<Target:?GLenum,Pname:?GLenum>>).
+
+%% @doc Return texture parameter values for a specific level of detail
+%%
+%% ``gl:getTexLevelParameter'' returns in `Params' texture parameter values for a
+%% specific level-of-detail value, specified as `Level' . `Target' defines the target
+%% texture, either `?GL_TEXTURE_1D', `?GL_TEXTURE_2D', `?GL_TEXTURE_3D', `?GL_PROXY_TEXTURE_1D'
+%% , `?GL_PROXY_TEXTURE_2D', `?GL_PROXY_TEXTURE_3D', `?GL_TEXTURE_CUBE_MAP_POSITIVE_X'
+%% , `?GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `?GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `?GL_TEXTURE_CUBE_MAP_NEGATIVE_Y'
+%% , `?GL_TEXTURE_CUBE_MAP_POSITIVE_Z', `?GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `?GL_PROXY_TEXTURE_CUBE_MAP'
+%% .
+%%
+%% `?GL_MAX_TEXTURE_SIZE', and `?GL_MAX_3D_TEXTURE_SIZE' are not really descriptive
+%% enough. It has to report the largest square texture image that can be accommodated with
+%% mipmaps and borders, but a long skinny texture, or a texture without mipmaps and borders,
+%% may easily fit in texture memory. The proxy targets allow the user to more accurately
+%% query whether the GL can accommodate a texture of a given configuration. If the texture
+%% cannot be accommodated, the texture state variables, which may be queried with ``gl:getTexLevelParameter''
+%% , are set to 0. If the texture can be accommodated, the texture state values will be set
+%% as they would be set for a non-proxy target.
+%%
+%% `Pname' specifies the texture parameter whose value or values will be returned.
+%%
+%% The accepted parameter names are as follows:
+%%
+%% `?GL_TEXTURE_WIDTH': `Params' returns a single value, the width of the texture
+%% image. This value includes the border of the texture image. The initial value is 0.
+%%
+%% `?GL_TEXTURE_HEIGHT': `Params' returns a single value, the height of the texture
+%% image. This value includes the border of the texture image. The initial value is 0.
+%%
+%% `?GL_TEXTURE_DEPTH': `Params' returns a single value, the depth of the texture
+%% image. This value includes the border of the texture image. The initial value is 0.
+%%
+%% `?GL_TEXTURE_INTERNAL_FORMAT': `Params' returns a single value, the internal
+%% format of the texture image.
+%%
+%% `?GL_TEXTURE_RED_TYPE',
+%%
+%% `?GL_TEXTURE_GREEN_TYPE',
+%%
+%% `?GL_TEXTURE_BLUE_TYPE',
+%%
+%% `?GL_TEXTURE_ALPHA_TYPE',
+%%
+%% `?GL_TEXTURE_DEPTH_TYPE': The data type used to store the component. The types `?GL_NONE'
+%% , `?GL_SIGNED_NORMALIZED', `?GL_UNSIGNED_NORMALIZED', `?GL_FLOAT', `?GL_INT'
+%% , and `?GL_UNSIGNED_INT' may be returned to indicate signed normalized fixed-point,
+%% unsigned normalized fixed-point, floating-point, integer unnormalized, and unsigned integer
+%% unnormalized components, respectively.
+%%
+%% `?GL_TEXTURE_RED_SIZE',
+%%
+%% `?GL_TEXTURE_GREEN_SIZE',
+%%
+%% `?GL_TEXTURE_BLUE_SIZE',
+%%
+%% `?GL_TEXTURE_ALPHA_SIZE',
+%%
+%% `?GL_TEXTURE_DEPTH_SIZE': The internal storage resolution of an individual component.
+%% The resolution chosen by the GL will be a close match for the resolution requested by
+%% the user with the component argument of {@link gl:texImage1D/8} , {@link gl:texImage2D/9} , {@link gl:texImage3D/10}
+%% , {@link gl:copyTexImage1D/7} , and {@link gl:copyTexImage2D/8} . The initial value is 0.
+%%
+%% `?GL_TEXTURE_COMPRESSED': `Params' returns a single boolean value indicating
+%% if the texture image is stored in a compressed internal format. The initiali value is `?GL_FALSE'
+%% .
+%%
+%% `?GL_TEXTURE_COMPRESSED_IMAGE_SIZE': `Params' returns a single integer value,
+%% the number of unsigned bytes of the compressed texture image that would be returned from {@link gl:getCompressedTexImage/3}
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexLevelParameter.xml">external</a> documentation.
+-spec getTexLevelParameterfv(Target, Level, Pname) -> {float()} when Target :: enum(),Level :: integer(),Pname :: enum().
+getTexLevelParameterfv(Target,Level,Pname) ->
+ call(5264, <<Target:?GLenum,Level:?GLint,Pname:?GLenum>>).
+
+%% @doc
+%% See {@link getTexLevelParameterfv/3}
+-spec getTexLevelParameteriv(Target, Level, Pname) -> {integer()} when Target :: enum(),Level :: integer(),Pname :: enum().
+getTexLevelParameteriv(Target,Level,Pname) ->
+ call(5265, <<Target:?GLenum,Level:?GLint,Pname:?GLenum>>).
+
+%% @doc Specify a one-dimensional texture image
+%%
+%% Texturing maps a portion of a specified texture image onto each graphical primitive for
+%% which texturing is enabled. To enable and disable one-dimensional texturing, call {@link gl:enable/1}
+%% and {@link gl:enable/1} with argument `?GL_TEXTURE_1D'.
+%%
+%% Texture images are defined with ``gl:texImage1D''. The arguments describe the parameters
+%% of the texture image, such as width, width of the border, level-of-detail number (see {@link gl:texParameterf/3}
+%% ), and the internal resolution and format used to store the image. The last three arguments
+%% describe how the image is represented in memory.
+%%
+%% If `Target' is `?GL_PROXY_TEXTURE_1D', no data is read from `Data' , but
+%% all of the texture image state is recalculated, checked for consistency, and checked against
+%% the implementation's capabilities. If the implementation cannot handle a texture of the
+%% requested texture size, it sets all of the image state to 0, but does not generate an
+%% error (see {@link gl:getError/0} ). To query for an entire mipmap array, use an image array
+%% level greater than or equal to 1.
+%%
+%% If `Target' is `?GL_TEXTURE_1D', data is read from `Data' as a sequence
+%% of signed or unsigned bytes, shorts, or longs, or single-precision floating-point values,
+%% depending on `Type' . These values are grouped into sets of one, two, three, or four
+%% values, depending on `Format' , to form elements. Each data byte is treated as eight
+%% 1-bit elements, with bit ordering determined by `?GL_UNPACK_LSB_FIRST' (see {@link gl:pixelStoref/2}
+%% ).
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a texture image is specified, `Data' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% The first element corresponds to the left end of the texture array. Subsequent elements
+%% progress left-to-right through the remaining texels in the texture array. The final element
+%% corresponds to the right end of the texture array.
+%%
+%% `Format' determines the composition of each element in `Data' . It can assume
+%% one of these symbolic values:
+%%
+%% `?GL_RED': Each element is a single red component. The GL converts it to floating
+%% point and assembles it into an RGBA element by attaching 0 for green and blue, and 1 for
+%% alpha. Each component is then multiplied by the signed scale factor `?GL_c_SCALE',
+%% added to the signed bias `?GL_c_BIAS', and clamped to the range [0,1].
+%%
+%% `?GL_RG': Each element is a single red/green double The GL converts it to floating
+%% point and assembles it into an RGBA element by attaching 0 for blue, and 1 for alpha.
+%% Each component is then multiplied by the signed scale factor `?GL_c_SCALE', added
+%% to the signed bias `?GL_c_BIAS', and clamped to the range [0,1].
+%%
+%% `?GL_RGB'
+%%
+%% `?GL_BGR': Each element is an RGB triple. The GL converts it to floating point and
+%% assembles it into an RGBA element by attaching 1 for alpha. Each component is then multiplied
+%% by the signed scale factor `?GL_c_SCALE', added to the signed bias `?GL_c_BIAS',
+%% and clamped to the range [0,1].
+%%
+%% `?GL_RGBA'
+%%
+%% `?GL_BGRA': Each element contains all four components. Each component is multiplied
+%% by the signed scale factor `?GL_c_SCALE', added to the signed bias `?GL_c_BIAS',
+%% and clamped to the range [0,1].
+%%
+%% `?GL_DEPTH_COMPONENT': Each element is a single depth value. The GL converts it
+%% to floating point, multiplies by the signed scale factor `?GL_DEPTH_SCALE', adds
+%% the signed bias `?GL_DEPTH_BIAS', and clamps to the range [0,1].
+%%
+%% If an application wants to store the texture at a certain resolution or in a certain
+%% format, it can request the resolution and format with `InternalFormat' . The GL will
+%% choose an internal representation that closely approximates that requested by `InternalFormat'
+%% , but it may not match exactly. (The representations specified by `?GL_RED', `?GL_RG'
+%% , `?GL_RGB' and `?GL_RGBA' must match exactly.)
+%%
+%% `InternalFormat' may be one of the base internal formats shown in Table 1, below
+%%
+%% `InternalFormat' may also be one of the sized internal formats shown in Table 2,
+%% below
+%%
+%% Finally, `InternalFormat' may also be one of the generic or compressed compressed
+%% texture formats shown in Table 3 below
+%%
+%% If the `InternalFormat' parameter is one of the generic compressed formats, `?GL_COMPRESSED_RED'
+%% , `?GL_COMPRESSED_RG', `?GL_COMPRESSED_RGB', or `?GL_COMPRESSED_RGBA',
+%% the GL will replace the internal format with the symbolic constant for a specific internal
+%% format and compress the texture before storage. If no corresponding internal format is
+%% available, or the GL can not compress that image for any reason, the internal format is
+%% instead replaced with a corresponding base internal format.
+%%
+%% If the `InternalFormat' parameter is `?GL_SRGB', `?GL_SRGB8', `?GL_SRGB_ALPHA'
+%% or `?GL_SRGB8_ALPHA8', the texture is treated as if the red, green, or blue components
+%% are encoded in the sRGB color space. Any alpha component is left unchanged. The conversion
+%% from the sRGB encoded component c s to a linear component c l is:
+%%
+%% c l={ c s/12.92if c s&amp;le; 0.04045( c s+0.055/1.055) 2.4if c s&gt; 0.04045
+%%
+%% Assume c s is the sRGB component in the range [0,1].
+%%
+%% Use the `?GL_PROXY_TEXTURE_1D' target to try out a resolution and format. The implementation
+%% will update and recompute its best match for the requested storage resolution and format.
+%% To then query this state, call {@link gl:getTexLevelParameterfv/3} . If the texture cannot
+%% be accommodated, texture state is set to 0.
+%%
+%% A one-component texture image uses only the red component of the RGBA color from `Data'
+%% . A two-component image uses the R and A values. A three-component image uses the R, G,
+%% and B values. A four-component image uses all of the RGBA components.
+%%
+%% Image-based shadowing can be enabled by comparing texture r coordinates to depth texture
+%% values to generate a boolean result. See {@link gl:texParameterf/3} for details on texture
+%% comparison.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexImage1D.xml">external</a> documentation.
+-spec texImage1D(Target, Level, InternalFormat, Width, Border, Format, Type, Pixels) -> ok when Target :: enum(),Level :: integer(),InternalFormat :: integer(),Width :: integer(),Border :: integer(),Format :: enum(),Type :: enum(),Pixels :: offset()|mem().
+texImage1D(Target,Level,InternalFormat,Width,Border,Format,Type,Pixels) when is_integer(Pixels) ->
+ cast(5266, <<Target:?GLenum,Level:?GLint,InternalFormat:?GLint,Width:?GLsizei,Border:?GLint,Format:?GLenum,Type:?GLenum,Pixels:?GLuint>>);
+texImage1D(Target,Level,InternalFormat,Width,Border,Format,Type,Pixels) ->
+ send_bin(Pixels),
+ cast(5267, <<Target:?GLenum,Level:?GLint,InternalFormat:?GLint,Width:?GLsizei,Border:?GLint,Format:?GLenum,Type:?GLenum>>).
+
+%% @doc Specify a two-dimensional texture image
+%%
+%% Texturing allows elements of an image array to be read by shaders.
+%%
+%% To define texture images, call ``gl:texImage2D''. The arguments describe the parameters
+%% of the texture image, such as height, width, width of the border, level-of-detail number
+%% (see {@link gl:texParameterf/3} ), and number of color components provided. The last three
+%% arguments describe how the image is represented in memory.
+%%
+%% If `Target' is `?GL_PROXY_TEXTURE_2D', `?GL_PROXY_TEXTURE_1D_ARRAY', `?GL_PROXY_TEXTURE_CUBE_MAP'
+%% , or `?GL_PROXY_TEXTURE_RECTANGLE', no data is read from `Data' , but all of
+%% the texture image state is recalculated, checked for consistency, and checked against
+%% the implementation's capabilities. If the implementation cannot handle a texture of the
+%% requested texture size, it sets all of the image state to 0, but does not generate an
+%% error (see {@link gl:getError/0} ). To query for an entire mipmap array, use an image array
+%% level greater than or equal to 1.
+%%
+%% If `Target' is `?GL_TEXTURE_2D', `?GL_TEXTURE_RECTANGLE' or one of the `?GL_TEXTURE_CUBE_MAP'
+%% targets, data is read from `Data' as a sequence of signed or unsigned bytes, shorts,
+%% or longs, or single-precision floating-point values, depending on `Type' . These values
+%% are grouped into sets of one, two, three, or four values, depending on `Format' ,
+%% to form elements. Each data byte is treated as eight 1-bit elements, with bit ordering
+%% determined by `?GL_UNPACK_LSB_FIRST' (see {@link gl:pixelStoref/2} ).
+%%
+%% If `Target' is `?GL_TEXTURE_1D_ARRAY', data is interpreted as an array of one-dimensional
+%% images.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a texture image is specified, `Data' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% The first element corresponds to the lower left corner of the texture image. Subsequent
+%% elements progress left-to-right through the remaining texels in the lowest row of the
+%% texture image, and then in successively higher rows of the texture image. The final element
+%% corresponds to the upper right corner of the texture image.
+%%
+%% `Format' determines the composition of each element in `Data' . It can assume
+%% one of these symbolic values:
+%%
+%% `?GL_RED': Each element is a single red component. The GL converts it to floating
+%% point and assembles it into an RGBA element by attaching 0 for green and blue, and 1 for
+%% alpha. Each component is then multiplied by the signed scale factor `?GL_c_SCALE',
+%% added to the signed bias `?GL_c_BIAS', and clamped to the range [0,1].
+%%
+%% `?GL_RG': Each element is a red/green double. The GL converts it to floating point
+%% and assembles it into an RGBA element by attaching 0 for blue, and 1 for alpha. Each component
+%% is then multiplied by the signed scale factor `?GL_c_SCALE', added to the signed
+%% bias `?GL_c_BIAS', and clamped to the range [0,1].
+%%
+%% `?GL_RGB'
+%%
+%% `?GL_BGR': Each element is an RGB triple. The GL converts it to floating point and
+%% assembles it into an RGBA element by attaching 1 for alpha. Each component is then multiplied
+%% by the signed scale factor `?GL_c_SCALE', added to the signed bias `?GL_c_BIAS',
+%% and clamped to the range [0,1].
+%%
+%% `?GL_RGBA'
+%%
+%% `?GL_BGRA': Each element contains all four components. Each component is multiplied
+%% by the signed scale factor `?GL_c_SCALE', added to the signed bias `?GL_c_BIAS',
+%% and clamped to the range [0,1].
+%%
+%% `?GL_DEPTH_COMPONENT': Each element is a single depth value. The GL converts it
+%% to floating point, multiplies by the signed scale factor `?GL_DEPTH_SCALE', adds
+%% the signed bias `?GL_DEPTH_BIAS', and clamps to the range [0,1].
+%%
+%% `?GL_DEPTH_STENCIL': Each element is a pair of depth and stencil values. The depth
+%% component of the pair is interpreted as in `?GL_DEPTH_COMPONENT'. The stencil component
+%% is interpreted based on specified the depth + stencil internal format.
+%%
+%% If an application wants to store the texture at a certain resolution or in a certain
+%% format, it can request the resolution and format with `InternalFormat' . The GL will
+%% choose an internal representation that closely approximates that requested by `InternalFormat'
+%% , but it may not match exactly. (The representations specified by `?GL_RED', `?GL_RG'
+%% , `?GL_RGB', and `?GL_RGBA' must match exactly.)
+%%
+%% `InternalFormat' may be one of the base internal formats shown in Table 1, below
+%%
+%% `InternalFormat' may also be one of the sized internal formats shown in Table 2,
+%% below
+%%
+%% Finally, `InternalFormat' may also be one of the generic or compressed compressed
+%% texture formats shown in Table 3 below
+%%
+%% If the `InternalFormat' parameter is one of the generic compressed formats, `?GL_COMPRESSED_RED'
+%% , `?GL_COMPRESSED_RG', `?GL_COMPRESSED_RGB', or `?GL_COMPRESSED_RGBA',
+%% the GL will replace the internal format with the symbolic constant for a specific internal
+%% format and compress the texture before storage. If no corresponding internal format is
+%% available, or the GL can not compress that image for any reason, the internal format is
+%% instead replaced with a corresponding base internal format.
+%%
+%% If the `InternalFormat' parameter is `?GL_SRGB', `?GL_SRGB8', `?GL_SRGB_ALPHA'
+%% , or `?GL_SRGB8_ALPHA8', the texture is treated as if the red, green, or blue components
+%% are encoded in the sRGB color space. Any alpha component is left unchanged. The conversion
+%% from the sRGB encoded component c s to a linear component c l is:
+%%
+%% c l={ c s/12.92if c s&amp;le; 0.04045( c s+0.055/1.055) 2.4if c s&gt; 0.04045
+%%
+%% Assume c s is the sRGB component in the range [0,1].
+%%
+%% Use the `?GL_PROXY_TEXTURE_2D', `?GL_PROXY_TEXTURE_1D_ARRAY', `?GL_PROXY_TEXTURE_RECTANGLE'
+%% , or `?GL_PROXY_TEXTURE_CUBE_MAP' target to try out a resolution and format. The
+%% implementation will update and recompute its best match for the requested storage resolution
+%% and format. To then query this state, call {@link gl:getTexLevelParameterfv/3} . If the texture
+%% cannot be accommodated, texture state is set to 0.
+%%
+%% A one-component texture image uses only the red component of the RGBA color extracted
+%% from `Data' . A two-component image uses the R and G values. A three-component image
+%% uses the R, G, and B values. A four-component image uses all of the RGBA components.
+%%
+%% Image-based shadowing can be enabled by comparing texture r coordinates to depth texture
+%% values to generate a boolean result. See {@link gl:texParameterf/3} for details on texture
+%% comparison.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexImage2D.xml">external</a> documentation.
+-spec texImage2D(Target, Level, InternalFormat, Width, Height, Border, Format, Type, Pixels) -> ok when Target :: enum(),Level :: integer(),InternalFormat :: integer(),Width :: integer(),Height :: integer(),Border :: integer(),Format :: enum(),Type :: enum(),Pixels :: offset()|mem().
+texImage2D(Target,Level,InternalFormat,Width,Height,Border,Format,Type,Pixels) when is_integer(Pixels) ->
+ cast(5268, <<Target:?GLenum,Level:?GLint,InternalFormat:?GLint,Width:?GLsizei,Height:?GLsizei,Border:?GLint,Format:?GLenum,Type:?GLenum,Pixels:?GLuint>>);
+texImage2D(Target,Level,InternalFormat,Width,Height,Border,Format,Type,Pixels) ->
send_bin(Pixels),
- cast(5287, <<Target:?GLenum,Level:?GLint,Internalformat:?GLint,Width:?GLsizei,Border:?GLint,Format:?GLenum,Type:?GLenum>>).
-
-%% @spec (Target::enum(),Level::integer(),Internalformat::integer(),Width::integer(),Height::integer(),Border::integer(),Format::enum(),Type::enum(),Pixels::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexImage2D.xml">external</a> documentation.
--spec texImage2D(enum(),integer(),integer(),integer(),integer(),integer(),enum(),enum(),offset()|mem()) -> ok.
-texImage2D(Target,Level,Internalformat,Width,Height,Border,Format,Type,Pixels) when is_integer(Pixels) ->
- cast(5288, <<Target:?GLenum,Level:?GLint,Internalformat:?GLint,Width:?GLsizei,Height:?GLsizei,Border:?GLint,Format:?GLenum,Type:?GLenum,Pixels:?GLuint>>);
-texImage2D(Target,Level,Internalformat,Width,Height,Border,Format,Type,Pixels) ->
+ cast(5269, <<Target:?GLenum,Level:?GLint,InternalFormat:?GLint,Width:?GLsizei,Height:?GLsizei,Border:?GLint,Format:?GLenum,Type:?GLenum>>).
+
+%% @doc Return a texture image
+%%
+%% ``gl:getTexImage'' returns a texture image into `Img' . `Target' specifies
+%% whether the desired texture image is one specified by {@link gl:texImage1D/8} (`?GL_TEXTURE_1D'
+%% ), {@link gl:texImage2D/9} (`?GL_TEXTURE_1D_ARRAY', `?GL_TEXTURE_RECTANGLE', `?GL_TEXTURE_2D'
+%% or any of `?GL_TEXTURE_CUBE_MAP_*'), or {@link gl:texImage3D/10} (`?GL_TEXTURE_2D_ARRAY'
+%% , `?GL_TEXTURE_3D'). `Level' specifies the level-of-detail number of the desired
+%% image. `Format' and `Type' specify the format and type of the desired image
+%% array. See the reference page for {@link gl:texImage1D/8} for a description of the acceptable
+%% values for the `Format' and `Type' parameters, respectively.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_PACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a texture image is requested, `Img' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% To understand the operation of ``gl:getTexImage'', consider the selected internal four-component
+%% texture image to be an RGBA color buffer the size of the image. The semantics of ``gl:getTexImage''
+%% are then identical to those of {@link gl:readPixels/7} , with the exception that no pixel
+%% transfer operations are performed, when called with the same `Format' and `Type' ,
+%% with `x' and `y' set to 0, `width' set to the width of the texture image
+%% and `height' set to 1 for 1D images, or to the height of the texture image for 2D
+%% images.
+%%
+%% If the selected texture image does not contain four components, the following mappings
+%% are applied. Single-component textures are treated as RGBA buffers with red set to the
+%% single-component value, green set to 0, blue set to 0, and alpha set to 1. Two-component
+%% textures are treated as RGBA buffers with red set to the value of component zero, alpha
+%% set to the value of component one, and green and blue set to 0. Finally, three-component
+%% textures are treated as RGBA buffers with red set to component zero, green set to component
+%% one, blue set to component two, and alpha set to 1.
+%%
+%% To determine the required size of `Img' , use {@link gl:getTexLevelParameterfv/3} to
+%% determine the dimensions of the internal texture image, then scale the required number
+%% of pixels by the storage required for each pixel, based on `Format' and `Type' .
+%% Be sure to take the pixel storage parameters into account, especially `?GL_PACK_ALIGNMENT'
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexImage.xml">external</a> documentation.
+-spec getTexImage(Target, Level, Format, Type, Pixels) -> ok when Target :: enum(),Level :: integer(),Format :: enum(),Type :: enum(),Pixels :: mem().
+getTexImage(Target,Level,Format,Type,Pixels) ->
send_bin(Pixels),
- cast(5289, <<Target:?GLenum,Level:?GLint,Internalformat:?GLint,Width:?GLsizei,Height:?GLsizei,Border:?GLint,Format:?GLenum,Type:?GLenum>>).
+ call(5270, <<Target:?GLenum,Level:?GLint,Format:?GLenum,Type:?GLenum>>).
-%% @spec (Target::enum(),Pname::enum(),Param::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexParameter.xml">external</a> documentation.
--spec texParameterf(enum(),enum(),float()) -> ok.
-texParameterf(Target,Pname,Param) ->
- cast(5290, <<Target:?GLenum,Pname:?GLenum,Param:?GLfloat>>).
+%% @doc Generate texture names
+%%
+%% ``gl:genTextures'' returns `N' texture names in `Textures' . There is no guarantee
+%% that the names form a contiguous set of integers; however, it is guaranteed that none
+%% of the returned names was in use immediately before the call to ``gl:genTextures''.
+%%
+%% The generated textures have no dimensionality; they assume the dimensionality of the
+%% texture target to which they are first bound (see {@link gl:bindTexture/2} ).
+%%
+%% Texture names returned by a call to ``gl:genTextures'' are not returned by subsequent
+%% calls, unless they are first deleted with {@link gl:deleteTextures/1} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenTextures.xml">external</a> documentation.
+-spec genTextures(N) -> [integer()] when N :: integer().
+genTextures(N) ->
+ call(5271, <<N:?GLsizei>>).
-%% @spec (Target::enum(),Pname::enum(),Params::{float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexParameter.xml">external</a> documentation.
--spec texParameterfv(enum(),enum(),{float()}) -> ok.
-texParameterfv(Target,Pname,Params) ->
- cast(5291, <<Target:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
- (<< <<C:?GLfloat>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
+%% @doc Delete named textures
+%%
+%% ``gl:deleteTextures'' deletes `N' textures named by the elements of the array `Textures'
+%% . After a texture is deleted, it has no contents or dimensionality, and its name is free
+%% for reuse (for example by {@link gl:genTextures/1} ). If a texture that is currently bound
+%% is deleted, the binding reverts to 0 (the default texture).
+%%
+%% ``gl:deleteTextures'' silently ignores 0's and names that do not correspond to existing
+%% textures.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteTextures.xml">external</a> documentation.
+-spec deleteTextures(Textures) -> ok when Textures :: [integer()].
+deleteTextures(Textures) ->
+ cast(5272, <<(length(Textures)):?GLuint,
+ (<< <<C:?GLuint>> || C <- Textures>>)/binary,0:(((1+length(Textures)) rem 2)*32)>>).
-%% @spec (Target::enum(),Pname::enum(),Param::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexParameter.xml">external</a> documentation.
--spec texParameteri(enum(),enum(),integer()) -> ok.
-texParameteri(Target,Pname,Param) ->
- cast(5292, <<Target:?GLenum,Pname:?GLenum,Param:?GLint>>).
+%% @doc Bind a named texture to a texturing target
+%%
+%% ``gl:bindTexture'' lets you create or use a named texture. Calling ``gl:bindTexture''
+%% with `Target' set to `?GL_TEXTURE_1D', `?GL_TEXTURE_2D', `?GL_TEXTURE_3D'
+%% , or `?GL_TEXTURE_1D_ARRAY', `?GL_TEXTURE_2D_ARRAY', `?GL_TEXTURE_RECTANGLE'
+%% , `?GL_TEXTURE_CUBE_MAP', `?GL_TEXTURE_2D_MULTISAMPLE' or `?GL_TEXTURE_2D_MULTISAMPLE_ARRAY'
+%% and `Texture' set to the name of the new texture binds the texture name to the target.
+%% When a texture is bound to a target, the previous binding for that target is automatically
+%% broken.
+%%
+%% Texture names are unsigned integers. The value zero is reserved to represent the default
+%% texture for each texture target. Texture names and the corresponding texture contents
+%% are local to the shared object space of the current GL rendering context; two rendering
+%% contexts share texture names only if they explicitly enable sharing between contexts through
+%% the appropriate GL windows interfaces functions.
+%%
+%% You must use {@link gl:genTextures/1} to generate a set of new texture names.
+%%
+%% When a texture is first bound, it assumes the specified target: A texture first bound
+%% to `?GL_TEXTURE_1D' becomes one-dimensional texture, a texture first bound to `?GL_TEXTURE_2D'
+%% becomes two-dimensional texture, a texture first bound to `?GL_TEXTURE_3D' becomes
+%% three-dimensional texture, a texture first bound to `?GL_TEXTURE_1D_ARRAY' becomes
+%% one-dimensional array texture, a texture first bound to `?GL_TEXTURE_2D_ARRAY' becomes
+%% two-dimensional arary texture, a texture first bound to `?GL_TEXTURE_RECTANGLE' becomes
+%% rectangle texture, a, texture first bound to `?GL_TEXTURE_CUBE_MAP' becomes a cube-mapped
+%% texture, a texture first bound to `?GL_TEXTURE_2D_MULTISAMPLE' becomes a two-dimensional
+%% multisampled texture, and a texture first bound to `?GL_TEXTURE_2D_MULTISAMPLE_ARRAY'
+%% becomes a two-dimensional multisampled array texture. The state of a one-dimensional texture
+%% immediately after it is first bound is equivalent to the state of the default `?GL_TEXTURE_1D'
+%% at GL initialization, and similarly for the other texture types.
+%%
+%% While a texture is bound, GL operations on the target to which it is bound affect the
+%% bound texture, and queries of the target to which it is bound return state from the bound
+%% texture. In effect, the texture targets become aliases for the textures currently bound
+%% to them, and the texture name zero refers to the default textures that were bound to them
+%% at initialization.
+%%
+%% A texture binding created with ``gl:bindTexture'' remains active until a different
+%% texture is bound to the same target, or until the bound texture is deleted with {@link gl:deleteTextures/1}
+%% .
+%%
+%% Once created, a named texture may be re-bound to its same original target as often as
+%% needed. It is usually much faster to use ``gl:bindTexture'' to bind an existing named
+%% texture to one of the texture targets than it is to reload the texture image using {@link gl:texImage1D/8}
+%% , {@link gl:texImage2D/9} , {@link gl:texImage3D/10} or another similar function.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindTexture.xml">external</a> documentation.
+-spec bindTexture(Target, Texture) -> ok when Target :: enum(),Texture :: integer().
+bindTexture(Target,Texture) ->
+ cast(5273, <<Target:?GLenum,Texture:?GLuint>>).
-%% @spec (Target::enum(),Pname::enum(),Params::{integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexParameter.xml">external</a> documentation.
--spec texParameteriv(enum(),enum(),{integer()}) -> ok.
-texParameteriv(Target,Pname,Params) ->
- cast(5293, <<Target:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
- (<< <<C:?GLint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
+%% @doc Set texture residence priority
+%%
+%% ``gl:prioritizeTextures'' assigns the `N' texture priorities given in `Priorities'
+%% to the `N' textures named in `Textures' .
+%%
+%% The GL establishes a ``working set'' of textures that are resident in texture memory.
+%% These textures may be bound to a texture target much more efficiently than textures that
+%% are not resident. By specifying a priority for each texture, ``gl:prioritizeTextures''
+%% allows applications to guide the GL implementation in determining which textures should
+%% be resident.
+%%
+%% The priorities given in `Priorities' are clamped to the range [0 1] before they are
+%% assigned. 0 indicates the lowest priority; textures with priority 0 are least likely to
+%% be resident. 1 indicates the highest priority; textures with priority 1 are most likely
+%% to be resident. However, textures are not guaranteed to be resident until they are used.
+%%
+%% ``gl:prioritizeTextures'' silently ignores attempts to prioritize texture 0 or any texture
+%% name that does not correspond to an existing texture.
+%%
+%% ``gl:prioritizeTextures'' does not require that any of the textures named by `Textures'
+%% be bound to a texture target. {@link gl:texParameterf/3} may also be used to set a texture's
+%% priority, but only if the texture is currently bound. This is the only way to set the
+%% priority of a default texture.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPrioritizeTextures.xml">external</a> documentation.
+-spec prioritizeTextures(Textures, Priorities) -> ok when Textures :: [integer()],Priorities :: [clamp()].
+prioritizeTextures(Textures,Priorities) ->
+ cast(5274, <<(length(Textures)):?GLuint,
+ (<< <<C:?GLuint>> || C <- Textures>>)/binary,0:(((1+length(Textures)) rem 2)*32),(length(Priorities)):?GLuint,
+ (<< <<C:?GLclampf>> || C <- Priorities>>)/binary,0:(((1+length(Priorities)) rem 2)*32)>>).
-%% @spec (Target::enum(),Level::integer(),Xoffset::integer(),Width::integer(),Format::enum(),Type::enum(),Pixels::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexSubImage1D.xml">external</a> documentation.
--spec texSubImage1D(enum(),integer(),integer(),integer(),enum(),enum(),offset()|mem()) -> ok.
+%% @doc Determine if textures are loaded in texture memory
+%%
+%% GL establishes a ``working set'' of textures that are resident in texture memory. These
+%% textures can be bound to a texture target much more efficiently than textures that are
+%% not resident.
+%%
+%% ``gl:areTexturesResident'' queries the texture residence status of the `N' textures
+%% named by the elements of `Textures' . If all the named textures are resident, ``gl:areTexturesResident''
+%% returns `?GL_TRUE', and the contents of `Residences' are undisturbed. If not
+%% all the named textures are resident, ``gl:areTexturesResident'' returns `?GL_FALSE',
+%% and detailed status is returned in the `N' elements of `Residences' . If an element
+%% of `Residences' is `?GL_TRUE', then the texture named by the corresponding element
+%% of `Textures' is resident.
+%%
+%% The residence status of a single bound texture may also be queried by calling {@link gl:getTexParameterfv/2}
+%% with the `target' argument set to the target to which the texture is bound, and
+%% the `pname' argument set to `?GL_TEXTURE_RESIDENT'. This is the only way that
+%% the residence status of a default texture can be queried.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glAreTexturesResident.xml">external</a> documentation.
+-spec areTexturesResident(Textures) -> {0|1,Residences :: [0|1]} when Textures :: [integer()].
+areTexturesResident(Textures) ->
+ call(5275, <<(length(Textures)):?GLuint,
+ (<< <<C:?GLuint>> || C <- Textures>>)/binary,0:(((1+length(Textures)) rem 2)*32)>>).
+
+%% @doc Determine if a name corresponds to a texture
+%%
+%% ``gl:isTexture'' returns `?GL_TRUE' if `Texture' is currently the name of
+%% a texture. If `Texture' is zero, or is a non-zero value that is not currently the
+%% name of a texture, or if an error occurs, ``gl:isTexture'' returns `?GL_FALSE'.
+%%
+%% A name returned by {@link gl:genTextures/1} , but not yet associated with a texture by
+%% calling {@link gl:bindTexture/2} , is not the name of a texture.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsTexture.xml">external</a> documentation.
+-spec isTexture(Texture) -> 0|1 when Texture :: integer().
+isTexture(Texture) ->
+ call(5276, <<Texture:?GLuint>>).
+
+%% @doc glTexSubImage
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexSubImage.xml">external</a> documentation.
+-spec texSubImage1D(Target, Level, Xoffset, Width, Format, Type, Pixels) -> ok when Target :: enum(),Level :: integer(),Xoffset :: integer(),Width :: integer(),Format :: enum(),Type :: enum(),Pixels :: offset()|mem().
texSubImage1D(Target,Level,Xoffset,Width,Format,Type,Pixels) when is_integer(Pixels) ->
- cast(5294, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Width:?GLsizei,Format:?GLenum,Type:?GLenum,Pixels:?GLuint>>);
+ cast(5277, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Width:?GLsizei,Format:?GLenum,Type:?GLenum,Pixels:?GLuint>>);
texSubImage1D(Target,Level,Xoffset,Width,Format,Type,Pixels) ->
send_bin(Pixels),
- cast(5295, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Width:?GLsizei,Format:?GLenum,Type:?GLenum>>).
+ cast(5278, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Width:?GLsizei,Format:?GLenum,Type:?GLenum>>).
-%% @spec (Target::enum(),Level::integer(),Xoffset::integer(),Yoffset::integer(),Width::integer(),Height::integer(),Format::enum(),Type::enum(),Pixels::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexSubImage2D.xml">external</a> documentation.
--spec texSubImage2D(enum(),integer(),integer(),integer(),integer(),integer(),enum(),enum(),offset()|mem()) -> ok.
+%% @doc glTexSubImage
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexSubImage.xml">external</a> documentation.
+-spec texSubImage2D(Target, Level, Xoffset, Yoffset, Width, Height, Format, Type, Pixels) -> ok when Target :: enum(),Level :: integer(),Xoffset :: integer(),Yoffset :: integer(),Width :: integer(),Height :: integer(),Format :: enum(),Type :: enum(),Pixels :: offset()|mem().
texSubImage2D(Target,Level,Xoffset,Yoffset,Width,Height,Format,Type,Pixels) when is_integer(Pixels) ->
- cast(5296, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Yoffset:?GLint,Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum,Pixels:?GLuint>>);
+ cast(5279, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Yoffset:?GLint,Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum,Pixels:?GLuint>>);
texSubImage2D(Target,Level,Xoffset,Yoffset,Width,Height,Format,Type,Pixels) ->
send_bin(Pixels),
- cast(5297, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Yoffset:?GLint,Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum>>).
+ cast(5280, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Yoffset:?GLint,Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum>>).
-%% @spec (X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTranslate.xml">external</a> documentation.
--spec translated(float(),float(),float()) -> ok.
-translated(X,Y,Z) ->
- cast(5298, <<X:?GLdouble,Y:?GLdouble,Z:?GLdouble>>).
+%% @doc Copy pixels into a 1D texture image
+%%
+%% ``gl:copyTexImage1D'' defines a one-dimensional texture image with pixels from the current
+%% `?GL_READ_BUFFER'.
+%%
+%% The screen-aligned pixel row with left corner at (x y) and with a length of width+2(border) defines
+%% the texture array at the mipmap level specified by `Level' . `Internalformat'
+%% specifies the internal format of the texture array.
+%%
+%% The pixels in the row are processed exactly as if {@link gl:readPixels/7} had been called,
+%% but the process stops just before final conversion. At this point all pixel component
+%% values are clamped to the range [0 1] and then converted to the texture's internal format
+%% for storage in the texel array.
+%%
+%% Pixel ordering is such that lower x screen coordinates correspond to lower texture
+%% coordinates.
+%%
+%% If any of the pixels within the specified row of the current `?GL_READ_BUFFER' are
+%% outside the window associated with the current rendering context, then the values obtained
+%% for those pixels are undefined.
+%%
+%% ``gl:copyTexImage1D'' defines a one-dimensional texture image with pixels from the current
+%% `?GL_READ_BUFFER'.
+%%
+%% When `Internalformat' is one of the sRGB types, the GL does not automatically convert
+%% the source pixels to the sRGB color space. In this case, the ``gl:pixelMap'' function
+%% can be used to accomplish the conversion.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyTexImage1D.xml">external</a> documentation.
+-spec copyTexImage1D(Target, Level, Internalformat, X, Y, Width, Border) -> ok when Target :: enum(),Level :: integer(),Internalformat :: enum(),X :: integer(),Y :: integer(),Width :: integer(),Border :: integer().
+copyTexImage1D(Target,Level,Internalformat,X,Y,Width,Border) ->
+ cast(5281, <<Target:?GLenum,Level:?GLint,Internalformat:?GLenum,X:?GLint,Y:?GLint,Width:?GLsizei,Border:?GLint>>).
-%% @spec (X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTranslate.xml">external</a> documentation.
--spec translatef(float(),float(),float()) -> ok.
-translatef(X,Y,Z) ->
- cast(5299, <<X:?GLfloat,Y:?GLfloat,Z:?GLfloat>>).
+%% @doc Copy pixels into a 2D texture image
+%%
+%% ``gl:copyTexImage2D'' defines a two-dimensional texture image, or cube-map texture image
+%% with pixels from the current `?GL_READ_BUFFER'.
+%%
+%% The screen-aligned pixel rectangle with lower left corner at ( `X' , `Y' ) and
+%% with a width of width+2(border) and a height of height+2(border) defines the texture array at the mipmap
+%% level specified by `Level' . `Internalformat' specifies the internal format of
+%% the texture array.
+%%
+%% The pixels in the rectangle are processed exactly as if {@link gl:readPixels/7} had been
+%% called, but the process stops just before final conversion. At this point all pixel component
+%% values are clamped to the range [0 1] and then converted to the texture's internal format
+%% for storage in the texel array.
+%%
+%% Pixel ordering is such that lower x and y screen coordinates correspond to lower s
+%% and t texture coordinates.
+%%
+%% If any of the pixels within the specified rectangle of the current `?GL_READ_BUFFER'
+%% are outside the window associated with the current rendering context, then the values
+%% obtained for those pixels are undefined.
+%%
+%% When `Internalformat' is one of the sRGB types, the GL does not automatically convert
+%% the source pixels to the sRGB color space. In this case, the ``gl:pixelMap'' function
+%% can be used to accomplish the conversion.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyTexImage2D.xml">external</a> documentation.
+-spec copyTexImage2D(Target, Level, Internalformat, X, Y, Width, Height, Border) -> ok when Target :: enum(),Level :: integer(),Internalformat :: enum(),X :: integer(),Y :: integer(),Width :: integer(),Height :: integer(),Border :: integer().
+copyTexImage2D(Target,Level,Internalformat,X,Y,Width,Height,Border) ->
+ cast(5282, <<Target:?GLenum,Level:?GLint,Internalformat:?GLenum,X:?GLint,Y:?GLint,Width:?GLsizei,Height:?GLsizei,Border:?GLint>>).
-%% @spec (X::float(),Y::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertex.xml">external</a> documentation.
--spec vertex2d(float(),float()) -> ok.
-vertex2d(X,Y) ->
- cast(5300, <<X:?GLdouble,Y:?GLdouble>>).
+%% @doc Copy a one-dimensional texture subimage
+%%
+%% ``gl:copyTexSubImage1D'' replaces a portion of a one-dimensional texture image with
+%% pixels from the current `?GL_READ_BUFFER' (rather than from main memory, as is the
+%% case for {@link gl:texSubImage1D/7} ).
+%%
+%% The screen-aligned pixel row with left corner at ( `X' , `Y' ), and with length `Width'
+%% replaces the portion of the texture array with x indices `Xoffset' through xoffset
+%% +width-1, inclusive. The destination in the texture array may not include any texels outside
+%% the texture array as it was originally specified.
+%%
+%% The pixels in the row are processed exactly as if {@link gl:readPixels/7} had been called,
+%% but the process stops just before final conversion. At this point, all pixel component
+%% values are clamped to the range [0 1] and then converted to the texture's internal format
+%% for storage in the texel array.
+%%
+%% It is not an error to specify a subtexture with zero width, but such a specification
+%% has no effect. If any of the pixels within the specified row of the current `?GL_READ_BUFFER'
+%% are outside the read window associated with the current rendering context, then the values
+%% obtained for those pixels are undefined.
+%%
+%% No change is made to the `internalformat', `width', or `border' parameters
+%% of the specified texture array or to texel values outside the specified subregion.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyTexSubImage1D.xml">external</a> documentation.
+-spec copyTexSubImage1D(Target, Level, Xoffset, X, Y, Width) -> ok when Target :: enum(),Level :: integer(),Xoffset :: integer(),X :: integer(),Y :: integer(),Width :: integer().
+copyTexSubImage1D(Target,Level,Xoffset,X,Y,Width) ->
+ cast(5283, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,X:?GLint,Y:?GLint,Width:?GLsizei>>).
-%% @spec ({X,Y}) -> ok
-%% @equiv vertex2d(X,Y)
--spec vertex2dv({float(),float()}) -> ok.
-vertex2dv({X,Y}) -> vertex2d(X,Y).
+%% @doc Copy a two-dimensional texture subimage
+%%
+%% ``gl:copyTexSubImage2D'' replaces a rectangular portion of a two-dimensional texture
+%% image or cube-map texture image with pixels from the current `?GL_READ_BUFFER' (rather
+%% than from main memory, as is the case for {@link gl:texSubImage1D/7} ).
+%%
+%% The screen-aligned pixel rectangle with lower left corner at (x y) and with width `Width'
+%% and height `Height' replaces the portion of the texture array with x indices `Xoffset'
+%% through xoffset+width-1, inclusive, and y indices `Yoffset' through yoffset+height
+%% -1, inclusive, at the mipmap level specified by `Level' .
+%%
+%% The pixels in the rectangle are processed exactly as if {@link gl:readPixels/7} had been
+%% called, but the process stops just before final conversion. At this point, all pixel component
+%% values are clamped to the range [0 1] and then converted to the texture's internal format
+%% for storage in the texel array.
+%%
+%% The destination rectangle in the texture array may not include any texels outside the
+%% texture array as it was originally specified. It is not an error to specify a subtexture
+%% with zero width or height, but such a specification has no effect.
+%%
+%% If any of the pixels within the specified rectangle of the current `?GL_READ_BUFFER'
+%% are outside the read window associated with the current rendering context, then the values
+%% obtained for those pixels are undefined.
+%%
+%% No change is made to the `internalformat', `width', `height', or `border'
+%% parameters of the specified texture array or to texel values outside the specified subregion.
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyTexSubImage2D.xml">external</a> documentation.
+-spec copyTexSubImage2D(Target, Level, Xoffset, Yoffset, X, Y, Width, Height) -> ok when Target :: enum(),Level :: integer(),Xoffset :: integer(),Yoffset :: integer(),X :: integer(),Y :: integer(),Width :: integer(),Height :: integer().
+copyTexSubImage2D(Target,Level,Xoffset,Yoffset,X,Y,Width,Height) ->
+ cast(5284, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Yoffset:?GLint,X:?GLint,Y:?GLint,Width:?GLsizei,Height:?GLsizei>>).
-%% @spec (X::float(),Y::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertex.xml">external</a> documentation.
--spec vertex2f(float(),float()) -> ok.
-vertex2f(X,Y) ->
- cast(5301, <<X:?GLfloat,Y:?GLfloat>>).
+%% @doc glMap
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMap.xml">external</a> documentation.
+-spec map1d(Target, U1, U2, Stride, Order, Points) -> ok when Target :: enum(),U1 :: float(),U2 :: float(),Stride :: integer(),Order :: integer(),Points :: binary().
+map1d(Target,U1,U2,Stride,Order,Points) ->
+ send_bin(Points),
+ cast(5285, <<Target:?GLenum,0:32,U1:?GLdouble,U2:?GLdouble,Stride:?GLint,Order:?GLint>>).
-%% @spec ({X,Y}) -> ok
-%% @equiv vertex2f(X,Y)
--spec vertex2fv({float(),float()}) -> ok.
-vertex2fv({X,Y}) -> vertex2f(X,Y).
+%% @doc glMap
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMap.xml">external</a> documentation.
+-spec map1f(Target, U1, U2, Stride, Order, Points) -> ok when Target :: enum(),U1 :: float(),U2 :: float(),Stride :: integer(),Order :: integer(),Points :: binary().
+map1f(Target,U1,U2,Stride,Order,Points) ->
+ send_bin(Points),
+ cast(5286, <<Target:?GLenum,U1:?GLfloat,U2:?GLfloat,Stride:?GLint,Order:?GLint>>).
-%% @spec (X::integer(),Y::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertex.xml">external</a> documentation.
--spec vertex2i(integer(),integer()) -> ok.
-vertex2i(X,Y) ->
- cast(5302, <<X:?GLint,Y:?GLint>>).
+%% @doc glMap
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMap.xml">external</a> documentation.
+-spec map2d(Target, U1, U2, Ustride, Uorder, V1, V2, Vstride, Vorder, Points) -> ok when Target :: enum(),U1 :: float(),U2 :: float(),Ustride :: integer(),Uorder :: integer(),V1 :: float(),V2 :: float(),Vstride :: integer(),Vorder :: integer(),Points :: binary().
+map2d(Target,U1,U2,Ustride,Uorder,V1,V2,Vstride,Vorder,Points) ->
+ send_bin(Points),
+ cast(5287, <<Target:?GLenum,0:32,U1:?GLdouble,U2:?GLdouble,Ustride:?GLint,Uorder:?GLint,V1:?GLdouble,V2:?GLdouble,Vstride:?GLint,Vorder:?GLint>>).
-%% @spec ({X,Y}) -> ok
-%% @equiv vertex2i(X,Y)
--spec vertex2iv({integer(),integer()}) -> ok.
-vertex2iv({X,Y}) -> vertex2i(X,Y).
+%% @doc glMap
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMap.xml">external</a> documentation.
+-spec map2f(Target, U1, U2, Ustride, Uorder, V1, V2, Vstride, Vorder, Points) -> ok when Target :: enum(),U1 :: float(),U2 :: float(),Ustride :: integer(),Uorder :: integer(),V1 :: float(),V2 :: float(),Vstride :: integer(),Vorder :: integer(),Points :: binary().
+map2f(Target,U1,U2,Ustride,Uorder,V1,V2,Vstride,Vorder,Points) ->
+ send_bin(Points),
+ cast(5288, <<Target:?GLenum,U1:?GLfloat,U2:?GLfloat,Ustride:?GLint,Uorder:?GLint,V1:?GLfloat,V2:?GLfloat,Vstride:?GLint,Vorder:?GLint>>).
-%% @spec (X::integer(),Y::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertex.xml">external</a> documentation.
--spec vertex2s(integer(),integer()) -> ok.
-vertex2s(X,Y) ->
- cast(5303, <<X:?GLshort,Y:?GLshort>>).
+%% @doc Return evaluator parameters
+%%
+%% {@link gl:map1d/6} and {@link gl:map1d/6} define evaluators. ``gl:getMap'' returns evaluator
+%% parameters. `Target' chooses a map, `Query' selects a specific parameter, and `V'
+%% points to storage where the values will be returned.
+%%
+%% The acceptable values for the `Target' parameter are described in the {@link gl:map1d/6}
+%% and {@link gl:map1d/6} reference pages.
+%%
+%% `Query' can assume the following values:
+%%
+%% `?GL_COEFF': `V' returns the control points for the evaluator function. One-dimensional
+%% evaluators return order control points, and two-dimensional evaluators return uorder*vorder
+%% control points. Each control point consists of one, two, three, or four integer, single-precision
+%% floating-point, or double-precision floating-point values, depending on the type of the
+%% evaluator. The GL returns two-dimensional control points in row-major order, incrementing
+%% the uorder index quickly and the vorder index after each row. Integer values, when
+%% requested, are computed by rounding the internal floating-point values to the nearest
+%% integer values.
+%%
+%% `?GL_ORDER': `V' returns the order of the evaluator function. One-dimensional
+%% evaluators return a single value, order. The initial value is 1. Two-dimensional evaluators
+%% return two values, uorder and vorder. The initial value is 1,1.
+%%
+%% `?GL_DOMAIN': `V' returns the linear u and v mapping parameters. One-dimensional
+%% evaluators return two values, u1 and u2, as specified by {@link gl:map1d/6} . Two-dimensional
+%% evaluators return four values ( u1, u2, v1, and v2) as specified by {@link gl:map1d/6} .
+%% Integer values, when requested, are computed by rounding the internal floating-point values
+%% to the nearest integer values.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetMap.xml">external</a> documentation.
+-spec getMapdv(Target, Query, V) -> ok when Target :: enum(),Query :: enum(),V :: mem().
+getMapdv(Target,Query,V) ->
+ send_bin(V),
+ call(5289, <<Target:?GLenum,Query:?GLenum>>).
-%% @spec ({X,Y}) -> ok
-%% @equiv vertex2s(X,Y)
--spec vertex2sv({integer(),integer()}) -> ok.
-vertex2sv({X,Y}) -> vertex2s(X,Y).
+%% @doc
+%% See {@link getMapdv/3}
+-spec getMapfv(Target, Query, V) -> ok when Target :: enum(),Query :: enum(),V :: mem().
+getMapfv(Target,Query,V) ->
+ send_bin(V),
+ call(5290, <<Target:?GLenum,Query:?GLenum>>).
-%% @spec (X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertex.xml">external</a> documentation.
--spec vertex3d(float(),float(),float()) -> ok.
-vertex3d(X,Y,Z) ->
- cast(5304, <<X:?GLdouble,Y:?GLdouble,Z:?GLdouble>>).
+%% @doc
+%% See {@link getMapdv/3}
+-spec getMapiv(Target, Query, V) -> ok when Target :: enum(),Query :: enum(),V :: mem().
+getMapiv(Target,Query,V) ->
+ send_bin(V),
+ call(5291, <<Target:?GLenum,Query:?GLenum>>).
-%% @spec ({X,Y,Z}) -> ok
-%% @equiv vertex3d(X,Y,Z)
--spec vertex3dv({float(),float(),float()}) -> ok.
-vertex3dv({X,Y,Z}) -> vertex3d(X,Y,Z).
+%% @doc Evaluate enabled one- and two-dimensional maps
+%%
+%% ``gl:evalCoord1'' evaluates enabled one-dimensional maps at argument `U' . ``gl:evalCoord2''
+%% does the same for two-dimensional maps using two domain values, `U' and `V' .
+%% To define a map, call {@link gl:map1d/6} and {@link gl:map1d/6} ; to enable and disable it,
+%% call {@link gl:enable/1} and {@link gl:enable/1} .
+%%
+%% When one of the ``gl:evalCoord'' commands is issued, all currently enabled maps of
+%% the indicated dimension are evaluated. Then, for each enabled map, it is as if the corresponding
+%% GL command had been issued with the computed value. That is, if `?GL_MAP1_INDEX' or `?GL_MAP2_INDEX'
+%% is enabled, a {@link gl:indexd/1} command is simulated. If `?GL_MAP1_COLOR_4' or `?GL_MAP2_COLOR_4'
+%% is enabled, a {@link gl:color3b/3} command is simulated. If `?GL_MAP1_NORMAL' or `?GL_MAP2_NORMAL'
+%% is enabled, a normal vector is produced, and if any of `?GL_MAP1_TEXTURE_COORD_1', `?GL_MAP1_TEXTURE_COORD_2'
+%% , `?GL_MAP1_TEXTURE_COORD_3', `?GL_MAP1_TEXTURE_COORD_4', `?GL_MAP2_TEXTURE_COORD_1'
+%% , `?GL_MAP2_TEXTURE_COORD_2', `?GL_MAP2_TEXTURE_COORD_3', or `?GL_MAP2_TEXTURE_COORD_4'
+%% is enabled, then an appropriate {@link gl:texCoord1d/1} command is simulated.
+%%
+%% For color, color index, normal, and texture coordinates the GL uses evaluated values
+%% instead of current values for those evaluations that are enabled, and current values otherwise,
+%% However, the evaluated values do not update the current values. Thus, if {@link gl:vertex2d/2}
+%% commands are interspersed with ``gl:evalCoord'' commands, the color, normal, and texture
+%% coordinates associated with the {@link gl:vertex2d/2} commands are not affected by the values
+%% generated by the ``gl:evalCoord'' commands, but only by the most recent {@link gl:color3b/3}
+%% , {@link gl:indexd/1} , {@link gl:normal3b/3} , and {@link gl:texCoord1d/1} commands.
+%%
+%% No commands are issued for maps that are not enabled. If more than one texture evaluation
+%% is enabled for a particular dimension (for example, `?GL_MAP2_TEXTURE_COORD_1' and `?GL_MAP2_TEXTURE_COORD_2'
+%% ), then only the evaluation of the map that produces the larger number of coordinates
+%% (in this case, `?GL_MAP2_TEXTURE_COORD_2') is carried out. `?GL_MAP1_VERTEX_4'
+%% overrides `?GL_MAP1_VERTEX_3', and `?GL_MAP2_VERTEX_4' overrides `?GL_MAP2_VERTEX_3'
+%% , in the same manner. If neither a three- nor a four-component vertex map is enabled for
+%% the specified dimension, the ``gl:evalCoord'' command is ignored.
+%%
+%% If you have enabled automatic normal generation, by calling {@link gl:enable/1} with argument
+%% `?GL_AUTO_NORMAL', ``gl:evalCoord2'' generates surface normals analytically, regardless
+%% of the contents or enabling of the `?GL_MAP2_NORMAL' map. Let
+%%
+%% m=((&amp;PartialD; p)/(&amp;PartialD; u))*((&amp;PartialD; p)/(&amp;PartialD; v))
+%%
+%% Then the generated normal n is n= m/(||m||)
+%%
+%% If automatic normal generation is disabled, the corresponding normal map `?GL_MAP2_NORMAL'
+%% , if enabled, is used to produce a normal. If neither automatic normal generation nor
+%% a normal map is enabled, no normal is generated for ``gl:evalCoord2'' commands.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEvalCoord.xml">external</a> documentation.
+-spec evalCoord1d(U) -> ok when U :: float().
+evalCoord1d(U) ->
+ cast(5292, <<U:?GLdouble>>).
-%% @spec (X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertex.xml">external</a> documentation.
--spec vertex3f(float(),float(),float()) -> ok.
-vertex3f(X,Y,Z) ->
- cast(5305, <<X:?GLfloat,Y:?GLfloat,Z:?GLfloat>>).
+%% @doc
+%% See {@link evalCoord1d/1}
+-spec evalCoord1f(U) -> ok when U :: float().
+evalCoord1f(U) ->
+ cast(5293, <<U:?GLfloat>>).
-%% @spec ({X,Y,Z}) -> ok
-%% @equiv vertex3f(X,Y,Z)
--spec vertex3fv({float(),float(),float()}) -> ok.
-vertex3fv({X,Y,Z}) -> vertex3f(X,Y,Z).
+%% @equiv evalCoord1d(U)
+-spec evalCoord1dv(U) -> ok when U :: {U :: float()}.
+evalCoord1dv({U}) -> evalCoord1d(U).
-%% @spec (X::integer(),Y::integer(),Z::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertex.xml">external</a> documentation.
--spec vertex3i(integer(),integer(),integer()) -> ok.
-vertex3i(X,Y,Z) ->
- cast(5306, <<X:?GLint,Y:?GLint,Z:?GLint>>).
+%% @equiv evalCoord1f(U)
+-spec evalCoord1fv(U) -> ok when U :: {U :: float()}.
+evalCoord1fv({U}) -> evalCoord1f(U).
-%% @spec ({X,Y,Z}) -> ok
-%% @equiv vertex3i(X,Y,Z)
--spec vertex3iv({integer(),integer(),integer()}) -> ok.
-vertex3iv({X,Y,Z}) -> vertex3i(X,Y,Z).
+%% @doc
+%% See {@link evalCoord1d/1}
+-spec evalCoord2d(U, V) -> ok when U :: float(),V :: float().
+evalCoord2d(U,V) ->
+ cast(5294, <<U:?GLdouble,V:?GLdouble>>).
-%% @spec (X::integer(),Y::integer(),Z::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertex.xml">external</a> documentation.
--spec vertex3s(integer(),integer(),integer()) -> ok.
-vertex3s(X,Y,Z) ->
- cast(5307, <<X:?GLshort,Y:?GLshort,Z:?GLshort>>).
+%% @doc
+%% See {@link evalCoord1d/1}
+-spec evalCoord2f(U, V) -> ok when U :: float(),V :: float().
+evalCoord2f(U,V) ->
+ cast(5295, <<U:?GLfloat,V:?GLfloat>>).
-%% @spec ({X,Y,Z}) -> ok
-%% @equiv vertex3s(X,Y,Z)
--spec vertex3sv({integer(),integer(),integer()}) -> ok.
-vertex3sv({X,Y,Z}) -> vertex3s(X,Y,Z).
+%% @equiv evalCoord2d(U,V)
+-spec evalCoord2dv(U) -> ok when U :: {U :: float(),V :: float()}.
+evalCoord2dv({U,V}) -> evalCoord2d(U,V).
-%% @spec (X::float(),Y::float(),Z::float(),W::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertex.xml">external</a> documentation.
--spec vertex4d(float(),float(),float(),float()) -> ok.
-vertex4d(X,Y,Z,W) ->
- cast(5308, <<X:?GLdouble,Y:?GLdouble,Z:?GLdouble,W:?GLdouble>>).
+%% @equiv evalCoord2f(U,V)
+-spec evalCoord2fv(U) -> ok when U :: {U :: float(),V :: float()}.
+evalCoord2fv({U,V}) -> evalCoord2f(U,V).
-%% @spec ({X,Y,Z,W}) -> ok
-%% @equiv vertex4d(X,Y,Z,W)
--spec vertex4dv({float(),float(),float(),float()}) -> ok.
-vertex4dv({X,Y,Z,W}) -> vertex4d(X,Y,Z,W).
+%% @doc Define a one- or two-dimensional mesh
+%%
+%% ``gl:mapGrid'' and {@link gl:evalMesh1/3} are used together to efficiently generate and
+%% evaluate a series of evenly-spaced map domain values. {@link gl:evalMesh1/3} steps through
+%% the integer domain of a one- or two-dimensional grid, whose range is the domain of the
+%% evaluation maps specified by {@link gl:map1d/6} and {@link gl:map1d/6} .
+%%
+%% ``gl:mapGrid1'' and ``gl:mapGrid2'' specify the linear grid mappings between the i
+%% (or i and j) integer grid coordinates, to the u (or u and v) floating-point
+%% evaluation map coordinates. See {@link gl:map1d/6} and {@link gl:map1d/6} for details of how
+%% u and v coordinates are evaluated.
+%%
+%% ``gl:mapGrid1'' specifies a single linear mapping such that integer grid coordinate
+%% 0 maps exactly to `U1' , and integer grid coordinate `Un' maps exactly to `U2'
+%% . All other integer grid coordinates i are mapped so that
+%%
+%% u= i(u2-u1)/un+u1
+%%
+%% ``gl:mapGrid2'' specifies two such linear mappings. One maps integer grid coordinate
+%% i= 0 exactly to `U1' , and integer grid coordinate i= un exactly to `U2' . The
+%% other maps integer grid coordinate j= 0 exactly to `V1' , and integer grid coordinate
+%% j= vn exactly to `V2' . Other integer grid coordinates i and j are mapped such
+%% that
+%%
+%% u= i(u2-u1)/un+u1
+%%
+%% v= j(v2-v1)/vn+v1
+%%
+%% The mappings specified by ``gl:mapGrid'' are used identically by {@link gl:evalMesh1/3}
+%% and {@link gl:evalPoint1/1} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMapGrid.xml">external</a> documentation.
+-spec mapGrid1d(Un, U1, U2) -> ok when Un :: integer(),U1 :: float(),U2 :: float().
+mapGrid1d(Un,U1,U2) ->
+ cast(5296, <<Un:?GLint,0:32,U1:?GLdouble,U2:?GLdouble>>).
-%% @spec (X::float(),Y::float(),Z::float(),W::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertex.xml">external</a> documentation.
--spec vertex4f(float(),float(),float(),float()) -> ok.
-vertex4f(X,Y,Z,W) ->
- cast(5309, <<X:?GLfloat,Y:?GLfloat,Z:?GLfloat,W:?GLfloat>>).
+%% @doc
+%% See {@link mapGrid1d/3}
+-spec mapGrid1f(Un, U1, U2) -> ok when Un :: integer(),U1 :: float(),U2 :: float().
+mapGrid1f(Un,U1,U2) ->
+ cast(5297, <<Un:?GLint,U1:?GLfloat,U2:?GLfloat>>).
-%% @spec ({X,Y,Z,W}) -> ok
-%% @equiv vertex4f(X,Y,Z,W)
--spec vertex4fv({float(),float(),float(),float()}) -> ok.
-vertex4fv({X,Y,Z,W}) -> vertex4f(X,Y,Z,W).
+%% @doc
+%% See {@link mapGrid1d/3}
+-spec mapGrid2d(Un, U1, U2, Vn, V1, V2) -> ok when Un :: integer(),U1 :: float(),U2 :: float(),Vn :: integer(),V1 :: float(),V2 :: float().
+mapGrid2d(Un,U1,U2,Vn,V1,V2) ->
+ cast(5298, <<Un:?GLint,0:32,U1:?GLdouble,U2:?GLdouble,Vn:?GLint,0:32,V1:?GLdouble,V2:?GLdouble>>).
-%% @spec (X::integer(),Y::integer(),Z::integer(),W::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertex.xml">external</a> documentation.
--spec vertex4i(integer(),integer(),integer(),integer()) -> ok.
-vertex4i(X,Y,Z,W) ->
- cast(5310, <<X:?GLint,Y:?GLint,Z:?GLint,W:?GLint>>).
+%% @doc
+%% See {@link mapGrid1d/3}
+-spec mapGrid2f(Un, U1, U2, Vn, V1, V2) -> ok when Un :: integer(),U1 :: float(),U2 :: float(),Vn :: integer(),V1 :: float(),V2 :: float().
+mapGrid2f(Un,U1,U2,Vn,V1,V2) ->
+ cast(5299, <<Un:?GLint,U1:?GLfloat,U2:?GLfloat,Vn:?GLint,V1:?GLfloat,V2:?GLfloat>>).
-%% @spec ({X,Y,Z,W}) -> ok
-%% @equiv vertex4i(X,Y,Z,W)
--spec vertex4iv({integer(),integer(),integer(),integer()}) -> ok.
-vertex4iv({X,Y,Z,W}) -> vertex4i(X,Y,Z,W).
+%% @doc Generate and evaluate a single point in a mesh
+%%
+%% {@link gl:mapGrid1d/3} and {@link gl:evalMesh1/3} are used in tandem to efficiently generate
+%% and evaluate a series of evenly spaced map domain values. ``gl:evalPoint'' can be used
+%% to evaluate a single grid point in the same gridspace that is traversed by {@link gl:evalMesh1/3}
+%% . Calling ``gl:evalPoint1'' is equivalent to calling glEvalCoord1( i.&amp;Delta; u+u
+%% 1 ); where &amp;Delta; u=(u 2-u 1)/n
+%%
+%% and n, u 1, and u 2 are the arguments to the most recent {@link gl:mapGrid1d/3} command.
+%% The one absolute numeric requirement is that if i= n, then the value computed from i.&amp;Delta;
+%% u+u 1 is exactly u 2.
+%%
+%% In the two-dimensional case, ``gl:evalPoint2'', let
+%%
+%% &amp;Delta; u=(u 2-u 1)/n
+%%
+%% &amp;Delta; v=(v 2-v 1)/m
+%%
+%% where n, u 1, u 2, m, v 1, and v 2 are the arguments to the most recent {@link gl:mapGrid1d/3}
+%% command. Then the ``gl:evalPoint2'' command is equivalent to calling glEvalCoord2( i.
+%% &amp;Delta; u+u 1, j.&amp;Delta; v+v 1 ); The only absolute numeric requirements are
+%% that if i= n, then the value computed from i.&amp;Delta; u+u 1 is exactly u 2, and
+%% if j= m, then the value computed from j.&amp;Delta; v+v 1 is exactly v 2.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEvalPoint.xml">external</a> documentation.
+-spec evalPoint1(I) -> ok when I :: integer().
+evalPoint1(I) ->
+ cast(5300, <<I:?GLint>>).
-%% @spec (X::integer(),Y::integer(),Z::integer(),W::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertex.xml">external</a> documentation.
--spec vertex4s(integer(),integer(),integer(),integer()) -> ok.
-vertex4s(X,Y,Z,W) ->
- cast(5311, <<X:?GLshort,Y:?GLshort,Z:?GLshort,W:?GLshort>>).
+%% @doc
+%% See {@link evalPoint1/1}
+-spec evalPoint2(I, J) -> ok when I :: integer(),J :: integer().
+evalPoint2(I,J) ->
+ cast(5301, <<I:?GLint,J:?GLint>>).
-%% @spec ({X,Y,Z,W}) -> ok
-%% @equiv vertex4s(X,Y,Z,W)
--spec vertex4sv({integer(),integer(),integer(),integer()}) -> ok.
-vertex4sv({X,Y,Z,W}) -> vertex4s(X,Y,Z,W).
+%% @doc Compute a one- or two-dimensional grid of points or lines
+%%
+%% {@link gl:mapGrid1d/3} and ``gl:evalMesh'' are used in tandem to efficiently generate and
+%% evaluate a series of evenly-spaced map domain values. ``gl:evalMesh'' steps through
+%% the integer domain of a one- or two-dimensional grid, whose range is the domain of the
+%% evaluation maps specified by {@link gl:map1d/6} and {@link gl:map1d/6} . `Mode' determines
+%% whether the resulting vertices are connected as points, lines, or filled polygons.
+%%
+%% In the one-dimensional case, ``gl:evalMesh1'', the mesh is generated as if the following
+%% code fragment were executed:
+%%
+%% glBegin( `Type' ); for ( i = `I1' ; i &lt;= `I2' ; i += 1 ) glEvalCoord1(
+%% i.&amp;Delta; u+u 1 ); glEnd(); where
+%%
+%% &amp;Delta; u=(u 2-u 1)/n
+%%
+%% and n, u 1, and u 2 are the arguments to the most recent {@link gl:mapGrid1d/3} command.
+%% `type' is `?GL_POINTS' if `Mode' is `?GL_POINT', or `?GL_LINES'
+%% if `Mode' is `?GL_LINE'.
+%%
+%% The one absolute numeric requirement is that if i= n, then the value computed from i.
+%% &amp;Delta; u+u 1 is exactly u 2.
+%%
+%% In the two-dimensional case, ``gl:evalMesh2'', let .cp &amp;Delta; u=(u 2-u 1)/n
+%%
+%% &amp;Delta; v=(v 2-v 1)/m
+%%
+%% where n, u 1, u 2, m, v 1, and v 2 are the arguments to the most recent {@link gl:mapGrid1d/3}
+%% command. Then, if `Mode' is `?GL_FILL', the ``gl:evalMesh2'' command is equivalent
+%% to:
+%%
+%% for ( j = `J1' ; j &lt; `J2' ; j += 1 ) { glBegin( GL_QUAD_STRIP ); for ( i = `I1'
+%% ; i &lt;= `I2' ; i += 1 ) { glEvalCoord2( i.&amp;Delta; u+u 1, j.&amp;Delta; v+v 1
+%% ); glEvalCoord2( i.&amp;Delta; u+u 1,(j+1).&amp;Delta; v+v 1 ); } glEnd(); }
+%%
+%% If `Mode' is `?GL_LINE', then a call to ``gl:evalMesh2'' is equivalent to:
+%%
+%% for ( j = `J1' ; j &lt;= `J2' ; j += 1 ) { glBegin( GL_LINE_STRIP ); for ( i = `I1'
+%% ; i &lt;= `I2' ; i += 1 ) glEvalCoord2( i.&amp;Delta; u+u 1, j.&amp;Delta; v+v 1
+%% ); glEnd(); } for ( i = `I1' ; i &lt;= `I2' ; i += 1 ) { glBegin( GL_LINE_STRIP
+%% ); for ( j = `J1' ; j &lt;= `J1' ; j += 1 ) glEvalCoord2( i.&amp;Delta; u+u 1, j.
+%% &amp;Delta; v+v 1 ); glEnd(); }
+%%
+%% And finally, if `Mode' is `?GL_POINT', then a call to ``gl:evalMesh2'' is
+%% equivalent to:
+%%
+%% glBegin( GL_POINTS ); for ( j = `J1' ; j &lt;= `J2' ; j += 1 ) for ( i = `I1'
+%% ; i &lt;= `I2' ; i += 1 ) glEvalCoord2( i.&amp;Delta; u+u 1, j.&amp;Delta; v+v 1
+%% ); glEnd();
+%%
+%% In all three cases, the only absolute numeric requirements are that if i= n, then the
+%% value computed from i.&amp;Delta; u+u 1 is exactly u 2, and if j= m, then the value
+%% computed from j.&amp;Delta; v+v 1 is exactly v 2.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEvalMesh.xml">external</a> documentation.
+-spec evalMesh1(Mode, I1, I2) -> ok when Mode :: enum(),I1 :: integer(),I2 :: integer().
+evalMesh1(Mode,I1,I2) ->
+ cast(5302, <<Mode:?GLenum,I1:?GLint,I2:?GLint>>).
-%% @spec (Size::integer(),Type::enum(),Stride::integer(),Pointer::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexPointer.xml">external</a> documentation.
--spec vertexPointer(integer(),enum(),integer(),offset()|mem()) -> ok.
-vertexPointer(Size,Type,Stride,Pointer) when is_integer(Pointer) ->
- cast(5312, <<Size:?GLint,Type:?GLenum,Stride:?GLsizei,Pointer:?GLuint>>);
-vertexPointer(Size,Type,Stride,Pointer) ->
- send_bin(Pointer),
- cast(5313, <<Size:?GLint,Type:?GLenum,Stride:?GLsizei>>).
+%% @doc
+%% See {@link evalMesh1/3}
+-spec evalMesh2(Mode, I1, I2, J1, J2) -> ok when Mode :: enum(),I1 :: integer(),I2 :: integer(),J1 :: integer(),J2 :: integer().
+evalMesh2(Mode,I1,I2,J1,J2) ->
+ cast(5303, <<Mode:?GLenum,I1:?GLint,I2:?GLint,J1:?GLint,J2:?GLint>>).
-%% @spec (X::integer(),Y::integer(),Width::integer(),Height::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glViewport.xml">external</a> documentation.
--spec viewport(integer(),integer(),integer(),integer()) -> ok.
-viewport(X,Y,Width,Height) ->
- cast(5314, <<X:?GLint,Y:?GLint,Width:?GLsizei,Height:?GLsizei>>).
+%% @doc Specify fog parameters
+%%
+%% Fog is initially disabled. While enabled, fog affects rasterized geometry, bitmaps, and
+%% pixel blocks, but not buffer clear operations. To enable and disable fog, call {@link gl:enable/1}
+%% and {@link gl:enable/1} with argument `?GL_FOG'.
+%%
+%% ``gl:fog'' assigns the value or values in `Params' to the fog parameter specified
+%% by `Pname' . The following values are accepted for `Pname' :
+%%
+%% `?GL_FOG_MODE': `Params' is a single integer or floating-point value that specifies
+%% the equation to be used to compute the fog blend factor, f. Three symbolic constants
+%% are accepted: `?GL_LINEAR', `?GL_EXP', and `?GL_EXP2'. The equations corresponding
+%% to these symbolic constants are defined below. The initial fog mode is `?GL_EXP'.
+%%
+%% `?GL_FOG_DENSITY': `Params' is a single integer or floating-point value that
+%% specifies density, the fog density used in both exponential fog equations. Only nonnegative
+%% densities are accepted. The initial fog density is 1.
+%%
+%% `?GL_FOG_START': `Params' is a single integer or floating-point value that specifies
+%% start, the near distance used in the linear fog equation. The initial near distance
+%% is 0.
+%%
+%% `?GL_FOG_END': `Params' is a single integer or floating-point value that specifies
+%% end, the far distance used in the linear fog equation. The initial far distance is 1.
+%%
+%% `?GL_FOG_INDEX': `Params' is a single integer or floating-point value that specifies
+%% i f, the fog color index. The initial fog index is 0.
+%%
+%% `?GL_FOG_COLOR': `Params' contains four integer or floating-point values that
+%% specify C f, the fog color. Integer values are mapped linearly such that the most positive
+%% representable value maps to 1.0, and the most negative representable value maps to -1.0.
+%% Floating-point values are mapped directly. After conversion, all color components are
+%% clamped to the range [0 1]. The initial fog color is (0, 0, 0, 0).
+%%
+%% `?GL_FOG_COORD_SRC': `Params' contains either of the following symbolic constants:
+%% `?GL_FOG_COORD' or `?GL_FRAGMENT_DEPTH'. `?GL_FOG_COORD' specifies that
+%% the current fog coordinate should be used as distance value in the fog color computation.
+%% `?GL_FRAGMENT_DEPTH' specifies that the current fragment depth should be used as
+%% distance value in the fog computation.
+%%
+%% Fog blends a fog color with each rasterized pixel fragment's post-texturing color using
+%% a blending factor f. Factor f is computed in one of three ways, depending on the fog
+%% mode. Let c be either the distance in eye coordinate from the origin (in the case that
+%% the `?GL_FOG_COORD_SRC' is `?GL_FRAGMENT_DEPTH') or the current fog coordinate
+%% (in the case that `?GL_FOG_COORD_SRC' is `?GL_FOG_COORD'). The equation for `?GL_LINEAR'
+%% fog is f=(end-c)/(end-start)
+%%
+%% The equation for `?GL_EXP' fog is f= e(-(density. c))
+%%
+%% The equation for `?GL_EXP2' fog is f= e(-(density. c)) 2
+%%
+%% Regardless of the fog mode, f is clamped to the range [0 1] after it is computed. Then,
+%% if the GL is in RGBA color mode, the fragment's red, green, and blue colors, represented
+%% by C r, are replaced by
+%%
+%% (C r)"= f*C r+(1-f)*C f
+%%
+%% Fog does not affect a fragment's alpha component.
+%%
+%% In color index mode, the fragment's color index i r is replaced by
+%%
+%% (i r)"= i r+(1-f)*i f
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFog.xml">external</a> documentation.
+-spec fogf(Pname, Param) -> ok when Pname :: enum(),Param :: float().
+fogf(Pname,Param) ->
+ cast(5304, <<Pname:?GLenum,Param:?GLfloat>>).
+
+%% @doc
+%% See {@link fogf/2}
+-spec fogi(Pname, Param) -> ok when Pname :: enum(),Param :: integer().
+fogi(Pname,Param) ->
+ cast(5305, <<Pname:?GLenum,Param:?GLint>>).
+
+%% @doc
+%% See {@link fogf/2}
+-spec fogfv(Pname, Params) -> ok when Pname :: enum(),Params :: {float()}.
+fogfv(Pname,Params) ->
+ cast(5306, <<Pname:?GLenum,(size(Params)):?GLuint,
+ (<< <<C:?GLfloat>> ||C <- tuple_to_list(Params)>>)/binary,0:(((0+size(Params)) rem 2)*32)>>).
+
+%% @doc
+%% See {@link fogf/2}
+-spec fogiv(Pname, Params) -> ok when Pname :: enum(),Params :: {integer()}.
+fogiv(Pname,Params) ->
+ cast(5307, <<Pname:?GLenum,(size(Params)):?GLuint,
+ (<< <<C:?GLint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((0+size(Params)) rem 2)*32)>>).
+
+%% @doc Controls feedback mode
+%%
+%% The ``gl:feedbackBuffer'' function controls feedback. Feedback, like selection, is
+%% a GL mode. The mode is selected by calling {@link gl:renderMode/1} with `?GL_FEEDBACK'.
+%% When the GL is in feedback mode, no pixels are produced by rasterization. Instead, information
+%% about primitives that would have been rasterized is fed back to the application using
+%% the GL.
+%%
+%% ``gl:feedbackBuffer'' has three arguments: `Buffer' is a pointer to an array of
+%% floating-point values into which feedback information is placed. `Size' indicates
+%% the size of the array. `Type' is a symbolic constant describing the information that
+%% is fed back for each vertex. ``gl:feedbackBuffer'' must be issued before feedback mode
+%% is enabled (by calling {@link gl:renderMode/1} with argument `?GL_FEEDBACK'). Setting
+%% `?GL_FEEDBACK' without establishing the feedback buffer, or calling ``gl:feedbackBuffer''
+%% while the GL is in feedback mode, is an error.
+%%
+%% When {@link gl:renderMode/1} is called while in feedback mode, it returns the number of
+%% entries placed in the feedback array and resets the feedback array pointer to the base
+%% of the feedback buffer. The returned value never exceeds `Size' . If the feedback
+%% data required more room than was available in `Buffer' , {@link gl:renderMode/1} returns
+%% a negative value. To take the GL out of feedback mode, call {@link gl:renderMode/1} with
+%% a parameter value other than `?GL_FEEDBACK'.
+%%
+%% While in feedback mode, each primitive, bitmap, or pixel rectangle that would be rasterized
+%% generates a block of values that are copied into the feedback array. If doing so would
+%% cause the number of entries to exceed the maximum, the block is partially written so as
+%% to fill the array (if there is any room left at all), and an overflow flag is set. Each
+%% block begins with a code indicating the primitive type, followed by values that describe
+%% the primitive's vertices and associated data. Entries are also written for bitmaps and
+%% pixel rectangles. Feedback occurs after polygon culling and {@link gl:polygonMode/2} interpretation
+%% of polygons has taken place, so polygons that are culled are not returned in the feedback
+%% buffer. It can also occur after polygons with more than three edges are broken up into
+%% triangles, if the GL implementation renders polygons by performing this decomposition.
+%%
+%% The {@link gl:passThrough/1} command can be used to insert a marker into the feedback
+%% buffer. See {@link gl:passThrough/1} .
+%%
+%% Following is the grammar for the blocks of values written into the feedback buffer. Each
+%% primitive is indicated with a unique identifying value followed by some number of vertices.
+%% Polygon entries include an integer value indicating how many vertices follow. A vertex
+%% is fed back as some number of floating-point values, as determined by `Type' . Colors
+%% are fed back as four values in RGBA mode and one value in color index mode.
+%%
+%% feedbackList feedbackItem feedbackList | feedbackItem
+%%
+%% feedbackItem point | lineSegment | polygon | bitmap | pixelRectangle | passThru
+%%
+%% point `?GL_POINT_TOKEN' vertex
+%%
+%% lineSegment `?GL_LINE_TOKEN' vertex vertex | `?GL_LINE_RESET_TOKEN' vertex
+%% vertex
+%%
+%% polygon `?GL_POLYGON_TOKEN' n polySpec
+%%
+%% polySpec polySpec vertex | vertex vertex vertex
+%%
+%% bitmap `?GL_BITMAP_TOKEN' vertex
+%%
+%% pixelRectangle `?GL_DRAW_PIXEL_TOKEN' vertex | `?GL_COPY_PIXEL_TOKEN' vertex
+%%
+%% passThru `?GL_PASS_THROUGH_TOKEN' value
+%%
+%% vertex 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture
+%%
+%% 2d value value
+%%
+%% 3d value value value
+%%
+%% 3dColor value value value color
+%%
+%% 3dColorTexture value value value color tex
+%%
+%% 4dColorTexture value value value value color tex
+%%
+%% color rgba | index
+%%
+%% rgba value value value value
+%%
+%% index value
+%%
+%% tex value value value value
+%%
+%% `value' is a floating-point number, and `n' is a floating-point integer giving
+%% the number of vertices in the polygon. `?GL_POINT_TOKEN', `?GL_LINE_TOKEN', `?GL_LINE_RESET_TOKEN'
+%% , `?GL_POLYGON_TOKEN', `?GL_BITMAP_TOKEN', `?GL_DRAW_PIXEL_TOKEN', `?GL_COPY_PIXEL_TOKEN'
+%% and `?GL_PASS_THROUGH_TOKEN' are symbolic floating-point constants. `?GL_LINE_RESET_TOKEN'
+%% is returned whenever the line stipple pattern is reset. The data returned as a vertex
+%% depends on the feedback `Type' .
+%%
+%% The following table gives the correspondence between `Type' and the number of values
+%% per vertex. `k' is 1 in color index mode and 4 in RGBA mode.
+%%
+%% <table><tbody><tr><td>` Type '</td><td>` Coordinates '</td><td>` Color '</td>
+%% <td>` Texture '</td><td>` Total Number of Values '</td></tr></tbody><tbody><tr><td>
+%% `?GL_2D'</td><td>`x', `y'</td><td></td><td></td><td> 2 </td></tr><tr><td>`?GL_3D'
+%% </td><td>`x', `y', `z'</td><td></td><td></td><td> 3 </td></tr><tr><td>`?GL_3D_COLOR'
+%% </td><td>`x', `y', `z'</td><td> k</td><td></td><td> 3+k</td></tr><tr><td>`?GL_3D_COLOR_TEXTURE'
+%% </td><td>`x', `y', `z'</td><td> k</td><td> 4 </td><td> 7+k</td></tr><tr><td>
+%% `?GL_4D_COLOR_TEXTURE'</td><td>`x', `y', `z', `w'</td><td> k</td>
+%% <td> 4 </td><td> 8+k</td></tr></tbody></table>
+%%
+%% Feedback vertex coordinates are in window coordinates, except `w', which is in clip
+%% coordinates. Feedback colors are lighted, if lighting is enabled. Feedback texture coordinates
+%% are generated, if texture coordinate generation is enabled. They are always transformed
+%% by the texture matrix.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFeedbackBuffer.xml">external</a> documentation.
+-spec feedbackBuffer(Size, Type, Buffer) -> ok when Size :: integer(),Type :: enum(),Buffer :: mem().
+feedbackBuffer(Size,Type,Buffer) ->
+ send_bin(Buffer),
+ call(5308, <<Size:?GLsizei,Type:?GLenum>>).
+
+%% @doc Place a marker in the feedback buffer
+%%
+%% Feedback is a GL render mode. The mode is selected by calling {@link gl:renderMode/1}
+%% with `?GL_FEEDBACK'. When the GL is in feedback mode, no pixels are produced by rasterization.
+%% Instead, information about primitives that would have been rasterized is fed back to the
+%% application using the GL. See the {@link gl:feedbackBuffer/3} reference page for a description
+%% of the feedback buffer and the values in it.
+%%
+%% ``gl:passThrough'' inserts a user-defined marker in the feedback buffer when it is executed
+%% in feedback mode. `Token' is returned as if it were a primitive; it is indicated
+%% with its own unique identifying value: `?GL_PASS_THROUGH_TOKEN'. The order of ``gl:passThrough''
+%% commands with respect to the specification of graphics primitives is maintained.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPassThrough.xml">external</a> documentation.
+-spec passThrough(Token) -> ok when Token :: float().
+passThrough(Token) ->
+ cast(5309, <<Token:?GLfloat>>).
-%% @spec (Red::clamp(),Green::clamp(),Blue::clamp(),Alpha::clamp()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlendColor.xml">external</a> documentation.
--spec blendColor(clamp(),clamp(),clamp(),clamp()) -> ok.
+%% @doc Establish a buffer for selection mode values
+%%
+%% ``gl:selectBuffer'' has two arguments: `Buffer' is a pointer to an array of unsigned
+%% integers, and `Size' indicates the size of the array. `Buffer' returns values
+%% from the name stack (see {@link gl:initNames/0} , {@link gl:loadName/1} , {@link gl:pushName/1} )
+%% when the rendering mode is `?GL_SELECT' (see {@link gl:renderMode/1} ). ``gl:selectBuffer''
+%% must be issued before selection mode is enabled, and it must not be issued while the
+%% rendering mode is `?GL_SELECT'.
+%%
+%% A programmer can use selection to determine which primitives are drawn into some region
+%% of a window. The region is defined by the current modelview and perspective matrices.
+%%
+%% In selection mode, no pixel fragments are produced from rasterization. Instead, if a
+%% primitive or a raster position intersects the clipping volume defined by the viewing frustum
+%% and the user-defined clipping planes, this primitive causes a selection hit. (With polygons,
+%% no hit occurs if the polygon is culled.) When a change is made to the name stack, or when
+%% {@link gl:renderMode/1} is called, a hit record is copied to `Buffer' if any hits
+%% have occurred since the last such event (name stack change or {@link gl:renderMode/1} call).
+%% The hit record consists of the number of names in the name stack at the time of the event,
+%% followed by the minimum and maximum depth values of all vertices that hit since the previous
+%% event, followed by the name stack contents, bottom name first.
+%%
+%% Depth values (which are in the range [0,1]) are multiplied by 2 32-1, before being
+%% placed in the hit record.
+%%
+%% An internal index into `Buffer' is reset to 0 whenever selection mode is entered.
+%% Each time a hit record is copied into `Buffer' , the index is incremented to point
+%% to the cell just past the end of the block of names(emthat is, to the next available cell
+%% If the hit record is larger than the number of remaining locations in `Buffer' , as
+%% much data as can fit is copied, and the overflow flag is set. If the name stack is empty
+%% when a hit record is copied, that record consists of 0 followed by the minimum and maximum
+%% depth values.
+%%
+%% To exit selection mode, call {@link gl:renderMode/1} with an argument other than `?GL_SELECT'
+%% . Whenever {@link gl:renderMode/1} is called while the render mode is `?GL_SELECT',
+%% it returns the number of hit records copied to `Buffer' , resets the overflow flag
+%% and the selection buffer pointer, and initializes the name stack to be empty. If the overflow
+%% bit was set when {@link gl:renderMode/1} was called, a negative hit record count is returned.
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSelectBuffer.xml">external</a> documentation.
+-spec selectBuffer(Size, Buffer) -> ok when Size :: integer(),Buffer :: mem().
+selectBuffer(Size,Buffer) ->
+ send_bin(Buffer),
+ call(5310, <<Size:?GLsizei>>).
+
+%% @doc Initialize the name stack
+%%
+%% The name stack is used during selection mode to allow sets of rendering commands to be
+%% uniquely identified. It consists of an ordered set of unsigned integers. ``gl:initNames''
+%% causes the name stack to be initialized to its default empty state.
+%%
+%% The name stack is always empty while the render mode is not `?GL_SELECT'. Calls to ``gl:initNames''
+%% while the render mode is not `?GL_SELECT' are ignored.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glInitNames.xml">external</a> documentation.
+-spec initNames() -> ok.
+initNames() ->
+ cast(5311, <<>>).
+
+%% @doc Load a name onto the name stack
+%%
+%% The name stack is used during selection mode to allow sets of rendering commands to be
+%% uniquely identified. It consists of an ordered set of unsigned integers and is initially
+%% empty.
+%%
+%% ``gl:loadName'' causes `Name' to replace the value on the top of the name stack.
+%%
+%% The name stack is always empty while the render mode is not `?GL_SELECT'. Calls to ``gl:loadName''
+%% while the render mode is not `?GL_SELECT' are ignored.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLoadName.xml">external</a> documentation.
+-spec loadName(Name) -> ok when Name :: integer().
+loadName(Name) ->
+ cast(5312, <<Name:?GLuint>>).
+
+%% @doc Push and pop the name stack
+%%
+%% The name stack is used during selection mode to allow sets of rendering commands to be
+%% uniquely identified. It consists of an ordered set of unsigned integers and is initially
+%% empty.
+%%
+%% ``gl:pushName'' causes `Name' to be pushed onto the name stack. {@link gl:pushName/1}
+%% pops one name off the top of the stack.
+%%
+%% The maximum name stack depth is implementation-dependent; call `?GL_MAX_NAME_STACK_DEPTH'
+%% to find out the value for a particular implementation. It is an error to push a name
+%% onto a full stack or to pop a name off an empty stack. It is also an error to manipulate
+%% the name stack between the execution of {@link gl:'begin'/1} and the corresponding execution
+%% of {@link gl:'begin'/1} . In any of these cases, the error flag is set and no other change is
+%% made to GL state.
+%%
+%% The name stack is always empty while the render mode is not `?GL_SELECT'. Calls to ``gl:pushName''
+%% or {@link gl:pushName/1} while the render mode is not `?GL_SELECT' are ignored.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPushName.xml">external</a> documentation.
+-spec pushName(Name) -> ok when Name :: integer().
+pushName(Name) ->
+ cast(5313, <<Name:?GLuint>>).
+
+%% @doc
+%% See {@link pushName/1}
+-spec popName() -> ok.
+popName() ->
+ cast(5314, <<>>).
+
+%% @doc Set the blend color
+%%
+%% The `?GL_BLEND_COLOR' may be used to calculate the source and destination blending
+%% factors. The color components are clamped to the range [0 1] before being stored. See {@link gl:blendFunc/2}
+%% for a complete description of the blending operations. Initially the `?GL_BLEND_COLOR'
+%% is set to (0, 0, 0, 0).
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlendColor.xml">external</a> documentation.
+-spec blendColor(Red, Green, Blue, Alpha) -> ok when Red :: clamp(),Green :: clamp(),Blue :: clamp(),Alpha :: clamp().
blendColor(Red,Green,Blue,Alpha) ->
cast(5315, <<Red:?GLclampf,Green:?GLclampf,Blue:?GLclampf,Alpha:?GLclampf>>).
-%% @spec (Mode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlendEquation.xml">external</a> documentation.
--spec blendEquation(enum()) -> ok.
+%% @doc Specify the equation used for both the RGB blend equation and the Alpha blend equation
+%%
+%% The blend equations determine how a new pixel (the ''source'' color) is combined with
+%% a pixel already in the framebuffer (the ''destination'' color). This function sets both
+%% the RGB blend equation and the alpha blend equation to a single equation. ``gl:blendEquationi''
+%% specifies the blend equation for a single draw buffer whereas ``gl:blendEquation''
+%% sets the blend equation for all draw buffers.
+%%
+%% These equations use the source and destination blend factors specified by either {@link gl:blendFunc/2}
+%% or {@link gl:blendFuncSeparate/4} . See {@link gl:blendFunc/2} or {@link gl:blendFuncSeparate/4}
+%% for a description of the various blend factors.
+%%
+%% In the equations that follow, source and destination color components are referred to
+%% as (R s G s B s A s) and (R d G d B d A d), respectively. The result color is referred to as (R r G r B r A r). The source and destination
+%% blend factors are denoted (s R s G s B s A) and (d R d G d B d A), respectively. For these equations all color components
+%% are understood to have values in the range [0 1]. <table><tbody><tr><td>` Mode '</td><td>
+%% ` RGB Components '</td><td>` Alpha Component '</td></tr></tbody><tbody><tr><td>`?GL_FUNC_ADD'
+%% </td><td> Rr= R s s R+R d d R Gr= G s s G+G d d G Br= B s s B+B d d B</td><td> Ar=
+%% A s s A+A d d A</td></tr><tr><td>`?GL_FUNC_SUBTRACT'</td><td> Rr= R s s R-R d d
+%% R Gr= G s s G-G d d G Br= B s s B-B d d B</td><td> Ar= A s s A-A d d A</td></tr><tr>
+%% <td>`?GL_FUNC_REVERSE_SUBTRACT'</td><td> Rr= R d d R-R s s R Gr= G d d G-G s s G
+%% Br= B d d B-B s s B</td><td> Ar= A d d A-A s s A</td></tr><tr><td>`?GL_MIN'</td><td>
+%% Rr= min(R s R d) Gr= min(G s G d) Br= min(B s B d)</td><td> Ar= min(A s A d)</td></tr><tr><td>`?GL_MAX'</td><td> Rr=
+%% max(R s R d) Gr= max(G s G d) Br= max(B s B d)</td><td> Ar= max(A s A d)</td></tr></tbody></table>
+%%
+%% The results of these equations are clamped to the range [0 1].
+%%
+%% The `?GL_MIN' and `?GL_MAX' equations are useful for applications that analyze
+%% image data (image thresholding against a constant color, for example). The `?GL_FUNC_ADD'
+%% equation is useful for antialiasing and transparency, among other things.
+%%
+%% Initially, both the RGB blend equation and the alpha blend equation are set to `?GL_FUNC_ADD'
+%% .
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlendEquation.xml">external</a> documentation.
+-spec blendEquation(Mode) -> ok when Mode :: enum().
blendEquation(Mode) ->
cast(5316, <<Mode:?GLenum>>).
-%% @spec (Mode::enum(),Start::integer(),End::integer(),Count::integer(),Type::enum(),Indices::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawRangeElements.xml">external</a> documentation.
--spec drawRangeElements(enum(),integer(),integer(),integer(),enum(),offset()|mem()) -> ok.
+%% @doc Render primitives from array data
+%%
+%% ``gl:drawRangeElements'' is a restricted form of {@link gl:drawElements/4} . `Mode' ,
+%% `Start' , `End' , and `Count' match the corresponding arguments to {@link gl:drawElements/4}
+%% , with the additional constraint that all values in the arrays `Count' must lie between
+%% `Start' and `End' , inclusive.
+%%
+%% Implementations denote recommended maximum amounts of vertex and index data, which may
+%% be queried by calling {@link gl:getBooleanv/1} with argument `?GL_MAX_ELEMENTS_VERTICES' and `?GL_MAX_ELEMENTS_INDICES'
+%% . If end-start+1 is greater than the value of `?GL_MAX_ELEMENTS_VERTICES', or if `Count'
+%% is greater than the value of `?GL_MAX_ELEMENTS_INDICES', then the call may operate
+%% at reduced performance. There is no requirement that all vertices in the range [start end] be referenced.
+%% However, the implementation may partially process unused vertices, reducing performance
+%% from what could be achieved with an optimal index set.
+%%
+%% When ``gl:drawRangeElements'' is called, it uses `Count' sequential elements from
+%% an enabled array, starting at `Start' to construct a sequence of geometric primitives.
+%% `Mode' specifies what kind of primitives are constructed, and how the array elements
+%% construct these primitives. If more than one array is enabled, each is used.
+%%
+%% Vertex attributes that are modified by ``gl:drawRangeElements'' have an unspecified
+%% value after ``gl:drawRangeElements'' returns. Attributes that aren't modified maintain
+%% their previous values.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawRangeElements.xml">external</a> documentation.
+-spec drawRangeElements(Mode, Start, End, Count, Type, Indices) -> ok when Mode :: enum(),Start :: integer(),End :: integer(),Count :: integer(),Type :: enum(),Indices :: offset()|mem().
drawRangeElements(Mode,Start,End,Count,Type,Indices) when is_integer(Indices) ->
cast(5317, <<Mode:?GLenum,Start:?GLuint,End:?GLuint,Count:?GLsizei,Type:?GLenum,Indices:?GLuint>>);
drawRangeElements(Mode,Start,End,Count,Type,Indices) ->
send_bin(Indices),
cast(5318, <<Mode:?GLenum,Start:?GLuint,End:?GLuint,Count:?GLsizei,Type:?GLenum>>).
-%% @spec (Target::enum(),Level::integer(),Internalformat::integer(),Width::integer(),Height::integer(),Depth::integer(),Border::integer(),Format::enum(),Type::enum(),Pixels::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexImage3D.xml">external</a> documentation.
--spec texImage3D(enum(),integer(),integer(),integer(),integer(),integer(),integer(),enum(),enum(),offset()|mem()) -> ok.
-texImage3D(Target,Level,Internalformat,Width,Height,Depth,Border,Format,Type,Pixels) when is_integer(Pixels) ->
- cast(5319, <<Target:?GLenum,Level:?GLint,Internalformat:?GLint,Width:?GLsizei,Height:?GLsizei,Depth:?GLsizei,Border:?GLint,Format:?GLenum,Type:?GLenum,Pixels:?GLuint>>);
-texImage3D(Target,Level,Internalformat,Width,Height,Depth,Border,Format,Type,Pixels) ->
+%% @doc Specify a three-dimensional texture image
+%%
+%% Texturing maps a portion of a specified texture image onto each graphical primitive for
+%% which texturing is enabled. To enable and disable three-dimensional texturing, call {@link gl:enable/1}
+%% and {@link gl:enable/1} with argument `?GL_TEXTURE_3D'.
+%%
+%% To define texture images, call ``gl:texImage3D''. The arguments describe the parameters
+%% of the texture image, such as height, width, depth, width of the border, level-of-detail
+%% number (see {@link gl:texParameterf/3} ), and number of color components provided. The last
+%% three arguments describe how the image is represented in memory.
+%%
+%% If `Target' is `?GL_PROXY_TEXTURE_3D', no data is read from `Data' , but
+%% all of the texture image state is recalculated, checked for consistency, and checked against
+%% the implementation's capabilities. If the implementation cannot handle a texture of the
+%% requested texture size, it sets all of the image state to 0, but does not generate an
+%% error (see {@link gl:getError/0} ). To query for an entire mipmap array, use an image array
+%% level greater than or equal to 1.
+%%
+%% If `Target' is `?GL_TEXTURE_3D', data is read from `Data' as a sequence
+%% of signed or unsigned bytes, shorts, or longs, or single-precision floating-point values,
+%% depending on `Type' . These values are grouped into sets of one, two, three, or four
+%% values, depending on `Format' , to form elements. Each data byte is treated as eight
+%% 1-bit elements, with bit ordering determined by `?GL_UNPACK_LSB_FIRST' (see {@link gl:pixelStoref/2}
+%% ).
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a texture image is specified, `Data' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% The first element corresponds to the lower left corner of the texture image. Subsequent
+%% elements progress left-to-right through the remaining texels in the lowest row of the
+%% texture image, and then in successively higher rows of the texture image. The final element
+%% corresponds to the upper right corner of the texture image.
+%%
+%% `Format' determines the composition of each element in `Data' . It can assume
+%% one of these symbolic values:
+%%
+%% `?GL_RED': Each element is a single red component. The GL converts it to floating
+%% point and assembles it into an RGBA element by attaching 0 for green and blue, and 1 for
+%% alpha. Each component is then multiplied by the signed scale factor `?GL_c_SCALE',
+%% added to the signed bias `?GL_c_BIAS', and clamped to the range [0,1].
+%%
+%% `?GL_RG': Each element is a red and green pair. The GL converts each to floating
+%% point and assembles it into an RGBA element by attaching 0 for blue, and 1 for alpha.
+%% Each component is then multiplied by the signed scale factor `?GL_c_SCALE', added
+%% to the signed bias `?GL_c_BIAS', and clamped to the range [0,1].
+%%
+%% `?GL_RGB'
+%%
+%% `?GL_BGR': Each element is an RGB triple. The GL converts it to floating point and
+%% assembles it into an RGBA element by attaching 1 for alpha. Each component is then multiplied
+%% by the signed scale factor `?GL_c_SCALE', added to the signed bias `?GL_c_BIAS',
+%% and clamped to the range [0,1].
+%%
+%% `?GL_RGBA'
+%%
+%% `?GL_BGRA': Each element contains all four components. Each component is multiplied
+%% by the signed scale factor `?GL_c_SCALE', added to the signed bias `?GL_c_BIAS',
+%% and clamped to the range [0,1].
+%%
+%% If an application wants to store the texture at a certain resolution or in a certain
+%% format, it can request the resolution and format with `InternalFormat' . The GL will
+%% choose an internal representation that closely approximates that requested by `InternalFormat'
+%% , but it may not match exactly. (The representations specified by `?GL_RED', `?GL_RG'
+%% , `?GL_RGB', and `?GL_RGBA' must match exactly.)
+%%
+%% `InternalFormat' may be one of the base internal formats shown in Table 1, below
+%%
+%% `InternalFormat' may also be one of the sized internal formats shown in Table 2,
+%% below
+%%
+%% Finally, `InternalFormat' may also be one of the generic or compressed compressed
+%% texture formats shown in Table 3 below
+%%
+%% If the `InternalFormat' parameter is one of the generic compressed formats, `?GL_COMPRESSED_RED'
+%% , `?GL_COMPRESSED_RG', `?GL_COMPRESSED_RGB', or `?GL_COMPRESSED_RGBA',
+%% the GL will replace the internal format with the symbolic constant for a specific internal
+%% format and compress the texture before storage. If no corresponding internal format is
+%% available, or the GL can not compress that image for any reason, the internal format is
+%% instead replaced with a corresponding base internal format.
+%%
+%% If the `InternalFormat' parameter is `?GL_SRGB', `?GL_SRGB8', `?GL_SRGB_ALPHA'
+%% , or `?GL_SRGB8_ALPHA8', the texture is treated as if the red, green, blue, or
+%% luminance components are encoded in the sRGB color space. Any alpha component is left
+%% unchanged. The conversion from the sRGB encoded component c s to a linear component
+%% c l is:
+%%
+%% c l={ c s/12.92if c s&amp;le; 0.04045( c s+0.055/1.055) 2.4if c s&gt; 0.04045
+%%
+%% Assume c s is the sRGB component in the range [0,1].
+%%
+%% Use the `?GL_PROXY_TEXTURE_3D' target to try out a resolution and format. The implementation
+%% will update and recompute its best match for the requested storage resolution and format.
+%% To then query this state, call {@link gl:getTexLevelParameterfv/3} . If the texture cannot
+%% be accommodated, texture state is set to 0.
+%%
+%% A one-component texture image uses only the red component of the RGBA color extracted
+%% from `Data' . A two-component image uses the R and A values. A three-component image
+%% uses the R, G, and B values. A four-component image uses all of the RGBA components.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexImage3D.xml">external</a> documentation.
+-spec texImage3D(Target, Level, InternalFormat, Width, Height, Depth, Border, Format, Type, Pixels) -> ok when Target :: enum(),Level :: integer(),InternalFormat :: integer(),Width :: integer(),Height :: integer(),Depth :: integer(),Border :: integer(),Format :: enum(),Type :: enum(),Pixels :: offset()|mem().
+texImage3D(Target,Level,InternalFormat,Width,Height,Depth,Border,Format,Type,Pixels) when is_integer(Pixels) ->
+ cast(5319, <<Target:?GLenum,Level:?GLint,InternalFormat:?GLint,Width:?GLsizei,Height:?GLsizei,Depth:?GLsizei,Border:?GLint,Format:?GLenum,Type:?GLenum,Pixels:?GLuint>>);
+texImage3D(Target,Level,InternalFormat,Width,Height,Depth,Border,Format,Type,Pixels) ->
send_bin(Pixels),
- cast(5320, <<Target:?GLenum,Level:?GLint,Internalformat:?GLint,Width:?GLsizei,Height:?GLsizei,Depth:?GLsizei,Border:?GLint,Format:?GLenum,Type:?GLenum>>).
+ cast(5320, <<Target:?GLenum,Level:?GLint,InternalFormat:?GLint,Width:?GLsizei,Height:?GLsizei,Depth:?GLsizei,Border:?GLint,Format:?GLenum,Type:?GLenum>>).
-%% @spec (Target::enum(),Level::integer(),Xoffset::integer(),Yoffset::integer(),Zoffset::integer(),Width::integer(),Height::integer(),Depth::integer(),Format::enum(),Type::enum(),Pixels::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexSubImage3D.xml">external</a> documentation.
--spec texSubImage3D(enum(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),enum(),enum(),offset()|mem()) -> ok.
+%% @doc glTexSubImage
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexSubImage.xml">external</a> documentation.
+-spec texSubImage3D(Target, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth, Format, Type, Pixels) -> ok when Target :: enum(),Level :: integer(),Xoffset :: integer(),Yoffset :: integer(),Zoffset :: integer(),Width :: integer(),Height :: integer(),Depth :: integer(),Format :: enum(),Type :: enum(),Pixels :: offset()|mem().
texSubImage3D(Target,Level,Xoffset,Yoffset,Zoffset,Width,Height,Depth,Format,Type,Pixels) when is_integer(Pixels) ->
cast(5321, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Yoffset:?GLint,Zoffset:?GLint,Width:?GLsizei,Height:?GLsizei,Depth:?GLsizei,Format:?GLenum,Type:?GLenum,Pixels:?GLuint>>);
texSubImage3D(Target,Level,Xoffset,Yoffset,Zoffset,Width,Height,Depth,Format,Type,Pixels) ->
send_bin(Pixels),
cast(5322, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Yoffset:?GLint,Zoffset:?GLint,Width:?GLsizei,Height:?GLsizei,Depth:?GLsizei,Format:?GLenum,Type:?GLenum>>).
-%% @spec (Target::enum(),Level::integer(),Xoffset::integer(),Yoffset::integer(),Zoffset::integer(),X::integer(),Y::integer(),Width::integer(),Height::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyTexSubImage3D.xml">external</a> documentation.
--spec copyTexSubImage3D(enum(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc Copy a three-dimensional texture subimage
+%%
+%% ``gl:copyTexSubImage3D'' replaces a rectangular portion of a three-dimensional texture
+%% image with pixels from the current `?GL_READ_BUFFER' (rather than from main memory,
+%% as is the case for {@link gl:texSubImage1D/7} ).
+%%
+%% The screen-aligned pixel rectangle with lower left corner at ( `X' , `Y' ) and
+%% with width `Width' and height `Height' replaces the portion of the texture array
+%% with x indices `Xoffset' through xoffset+width-1, inclusive, and y indices `Yoffset'
+%% through yoffset+height-1, inclusive, at z index `Zoffset' and at the mipmap level
+%% specified by `Level' .
+%%
+%% The pixels in the rectangle are processed exactly as if {@link gl:readPixels/7} had been
+%% called, but the process stops just before final conversion. At this point, all pixel component
+%% values are clamped to the range [0 1] and then converted to the texture's internal format
+%% for storage in the texel array.
+%%
+%% The destination rectangle in the texture array may not include any texels outside the
+%% texture array as it was originally specified. It is not an error to specify a subtexture
+%% with zero width or height, but such a specification has no effect.
+%%
+%% If any of the pixels within the specified rectangle of the current `?GL_READ_BUFFER'
+%% are outside the read window associated with the current rendering context, then the values
+%% obtained for those pixels are undefined.
+%%
+%% No change is made to the `internalformat', `width', `height', `depth',
+%% or `border' parameters of the specified texture array or to texel values outside
+%% the specified subregion.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyTexSubImage3D.xml">external</a> documentation.
+-spec copyTexSubImage3D(Target, Level, Xoffset, Yoffset, Zoffset, X, Y, Width, Height) -> ok when Target :: enum(),Level :: integer(),Xoffset :: integer(),Yoffset :: integer(),Zoffset :: integer(),X :: integer(),Y :: integer(),Width :: integer(),Height :: integer().
copyTexSubImage3D(Target,Level,Xoffset,Yoffset,Zoffset,X,Y,Width,Height) ->
cast(5323, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Yoffset:?GLint,Zoffset:?GLint,X:?GLint,Y:?GLint,Width:?GLsizei,Height:?GLsizei>>).
-%% @spec (Target::enum(),Internalformat::enum(),Width::integer(),Format::enum(),Type::enum(),Table::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColorTable.xml">external</a> documentation.
--spec colorTable(enum(),enum(),integer(),enum(),enum(),offset()|mem()) -> ok.
+%% @doc Define a color lookup table
+%%
+%% ``gl:colorTable'' may be used in two ways: to test the actual size and color resolution
+%% of a lookup table given a particular set of parameters, or to load the contents of a color
+%% lookup table. Use the targets `?GL_PROXY_*' for the first case and the other targets
+%% for the second case.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a color table is specified, `Data' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% If `Target' is `?GL_COLOR_TABLE', `?GL_POST_CONVOLUTION_COLOR_TABLE', or `?GL_POST_COLOR_MATRIX_COLOR_TABLE'
+%% , ``gl:colorTable'' builds a color lookup table from an array of pixels. The pixel array
+%% specified by `Width' , `Format' , `Type' , and `Data' is extracted from
+%% memory and processed just as if {@link gl:drawPixels/5} were called, but processing stops
+%% after the final expansion to RGBA is completed.
+%%
+%% The four scale parameters and the four bias parameters that are defined for the table
+%% are then used to scale and bias the R, G, B, and A components of each pixel. (Use ``gl:colorTableParameter''
+%% to set these scale and bias parameters.)
+%%
+%% Next, the R, G, B, and A values are clamped to the range [0 1]. Each pixel is then converted
+%% to the internal format specified by `Internalformat' . This conversion simply maps
+%% the component values of the pixel (R, G, B, and A) to the values included in the internal
+%% format (red, green, blue, alpha, luminance, and intensity). The mapping is as follows:
+%%
+%% <table><tbody><tr><td>` Internal Format '</td><td>` Red '</td><td>` Green '</td>
+%% <td>` Blue '</td><td>` Alpha '</td><td>` Luminance '</td><td>` Intensity '
+%% </td></tr></tbody><tbody><tr><td>`?GL_ALPHA'</td><td></td><td></td><td></td><td> A </td>
+%% <td></td><td></td></tr><tr><td>`?GL_LUMINANCE'</td><td></td><td></td><td></td><td></td>
+%% <td> R </td><td></td></tr><tr><td>`?GL_LUMINANCE_ALPHA'</td><td></td><td></td><td></td>
+%% <td> A </td><td> R </td><td></td></tr><tr><td>`?GL_INTENSITY'</td><td></td><td></td><td>
+%% </td><td></td><td></td><td> R </td></tr><tr><td>`?GL_RGB'</td><td> R </td><td> G </td>
+%% <td> B </td><td></td><td></td><td></td></tr><tr><td>`?GL_RGBA'</td><td> R </td><td>
+%% G </td><td> B </td><td> A </td><td></td><td></td></tr></tbody></table>
+%%
+%% Finally, the red, green, blue, alpha, luminance, and/or intensity components of the resulting
+%% pixels are stored in the color table. They form a one-dimensional table with indices in
+%% the range [0 width-1].
+%%
+%% If `Target' is `?GL_PROXY_*', ``gl:colorTable'' recomputes and stores the
+%% values of the proxy color table's state variables `?GL_COLOR_TABLE_FORMAT', `?GL_COLOR_TABLE_WIDTH'
+%% , `?GL_COLOR_TABLE_RED_SIZE', `?GL_COLOR_TABLE_GREEN_SIZE', `?GL_COLOR_TABLE_BLUE_SIZE'
+%% , `?GL_COLOR_TABLE_ALPHA_SIZE', `?GL_COLOR_TABLE_LUMINANCE_SIZE', and `?GL_COLOR_TABLE_INTENSITY_SIZE'
+%% . There is no effect on the image or state of any actual color table. If the specified
+%% color table is too large to be supported, then all the proxy state variables listed above
+%% are set to zero. Otherwise, the color table could be supported by ``gl:colorTable''
+%% using the corresponding non-proxy target, and the proxy state variables are set as if
+%% that target were being defined.
+%%
+%% The proxy state variables can be retrieved by calling {@link gl:getColorTableParameterfv/2}
+%% with a target of `?GL_PROXY_*'. This allows the application to decide if a particular
+%% ``gl:colorTable'' command would succeed, and to determine what the resulting color table
+%% attributes would be.
+%%
+%% If a color table is enabled, and its width is non-zero, then its contents are used to
+%% replace a subset of the components of each RGBA pixel group, based on the internal format
+%% of the table.
+%%
+%% Each pixel group has color components (R, G, B, A) that are in the range [0.0 1.0]. The color
+%% components are rescaled to the size of the color lookup table to form an index. Then a
+%% subset of the components based on the internal format of the table are replaced by the
+%% table entry selected by that index. If the color components and contents of the table
+%% are represented as follows:
+%%
+%% <table><tbody><tr><td>` Representation '</td><td>` Meaning '</td></tr></tbody><tbody>
+%% <tr><td>r</td><td> Table index computed from R</td></tr><tr><td>g</td><td> Table index
+%% computed from G</td></tr><tr><td>b</td><td> Table index computed from B</td></tr><tr><td>a
+%% </td><td> Table index computed from A</td></tr><tr><td>L[i]</td><td> Luminance value at
+%% table index i</td></tr><tr><td>I[i]</td><td> Intensity value at table index i</td></tr><tr>
+%% <td>R[i]</td><td> Red value at table index i</td></tr><tr><td>G[i]</td><td> Green value
+%% at table index i</td></tr><tr><td>B[i]</td><td> Blue value at table index i</td></tr><tr><td>
+%% A[i]</td><td> Alpha value at table index i</td></tr></tbody></table>
+%%
+%% then the result of color table lookup is as follows:
+%%
+%% <table><tbody><tr><td></td><td>` Resulting Texture Components '</td></tr><tr><td>` Table Internal Format '
+%% </td><td>` R '</td><td>` G '</td><td>` B '</td><td>` A '</td></tr></tbody>
+%% <tbody><tr><td>`?GL_ALPHA'</td><td>R</td><td>G</td><td>B</td><td>A[a]</td></tr><tr><td>
+%% `?GL_LUMINANCE'</td><td>L[r]</td><td>L[g]</td><td>L[b]</td><td>At</td></tr><tr><td>`?GL_LUMINANCE_ALPHA'
+%% </td><td>L[r]</td><td>L[g]</td><td>L[b]</td><td>A[a]</td></tr><tr><td>`?GL_INTENSITY'</td>
+%% <td>I[r]</td><td>I[g]</td><td>I[b]</td><td>I[a]</td></tr><tr><td>`?GL_RGB'</td><td>R[r]
+%% </td><td>G[g]</td><td>B[b]</td><td>A</td></tr><tr><td>`?GL_RGBA'</td><td>R[r]</td><td>
+%% G[g]</td><td>B[b]</td><td>A[a]</td></tr></tbody></table>
+%%
+%% When `?GL_COLOR_TABLE' is enabled, the colors resulting from the pixel map operation
+%% (if it is enabled) are mapped by the color lookup table before being passed to the convolution
+%% operation. The colors resulting from the convolution operation are modified by the post
+%% convolution color lookup table when `?GL_POST_CONVOLUTION_COLOR_TABLE' is enabled.
+%% These modified colors are then sent to the color matrix operation. Finally, if `?GL_POST_COLOR_MATRIX_COLOR_TABLE'
+%% is enabled, the colors resulting from the color matrix operation are mapped by the post
+%% color matrix color lookup table before being used by the histogram operation.
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColorTable.xml">external</a> documentation.
+-spec colorTable(Target, Internalformat, Width, Format, Type, Table) -> ok when Target :: enum(),Internalformat :: enum(),Width :: integer(),Format :: enum(),Type :: enum(),Table :: offset()|mem().
colorTable(Target,Internalformat,Width,Format,Type,Table) when is_integer(Table) ->
cast(5324, <<Target:?GLenum,Internalformat:?GLenum,Width:?GLsizei,Format:?GLenum,Type:?GLenum,Table:?GLuint>>);
colorTable(Target,Internalformat,Width,Format,Type,Table) ->
send_bin(Table),
cast(5325, <<Target:?GLenum,Internalformat:?GLenum,Width:?GLsizei,Format:?GLenum,Type:?GLenum>>).
-%% @spec (Target::enum(),Pname::enum(),Params::{float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColorTableParameter.xml">external</a> documentation.
--spec colorTableParameterfv(enum(),enum(),{float(),float(),float(),float()}) -> ok.
+%% @doc Set color lookup table parameters
+%%
+%% ``gl:colorTableParameter'' is used to specify the scale factors and bias terms applied
+%% to color components when they are loaded into a color table. `Target' indicates which
+%% color table the scale and bias terms apply to; it must be set to `?GL_COLOR_TABLE', `?GL_POST_CONVOLUTION_COLOR_TABLE'
+%% , or `?GL_POST_COLOR_MATRIX_COLOR_TABLE'.
+%%
+%% `Pname' must be `?GL_COLOR_TABLE_SCALE' to set the scale factors. In this case,
+%% `Params' points to an array of four values, which are the scale factors for red,
+%% green, blue, and alpha, in that order.
+%%
+%% `Pname' must be `?GL_COLOR_TABLE_BIAS' to set the bias terms. In this case, `Params'
+%% points to an array of four values, which are the bias terms for red, green, blue, and
+%% alpha, in that order.
+%%
+%% The color tables themselves are specified by calling {@link gl:colorTable/6} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColorTableParameter.xml">external</a> documentation.
+-spec colorTableParameterfv(Target, Pname, Params) -> ok when Target :: enum(),Pname :: enum(),Params :: {float(),float(),float(),float()}.
colorTableParameterfv(Target,Pname,{P1,P2,P3,P4}) ->
cast(5326, <<Target:?GLenum,Pname:?GLenum,P1:?GLfloat,P2:?GLfloat,P3:?GLfloat,P4:?GLfloat>>).
-%% @spec (Target::enum(),Pname::enum(),Params::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColorTableParameter.xml">external</a> documentation.
--spec colorTableParameteriv(enum(),enum(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc
+%% See {@link colorTableParameterfv/3}
+-spec colorTableParameteriv(Target, Pname, Params) -> ok when Target :: enum(),Pname :: enum(),Params :: {integer(),integer(),integer(),integer()}.
colorTableParameteriv(Target,Pname,{P1,P2,P3,P4}) ->
cast(5327, <<Target:?GLenum,Pname:?GLenum,P1:?GLint,P2:?GLint,P3:?GLint,P4:?GLint>>).
-%% @spec (Target::enum(),Internalformat::enum(),X::integer(),Y::integer(),Width::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyColorTable.xml">external</a> documentation.
--spec copyColorTable(enum(),enum(),integer(),integer(),integer()) -> ok.
+%% @doc Copy pixels into a color table
+%%
+%% ``gl:copyColorTable'' loads a color table with pixels from the current `?GL_READ_BUFFER'
+%% (rather than from main memory, as is the case for {@link gl:colorTable/6} ).
+%%
+%% The screen-aligned pixel rectangle with lower-left corner at ( `X' , `Y' ) having
+%% width `Width' and height 1 is loaded into the color table. If any pixels within this
+%% region are outside the window that is associated with the GL context, the values obtained
+%% for those pixels are undefined.
+%%
+%% The pixels in the rectangle are processed just as if {@link gl:readPixels/7} were called,
+%% with `Internalformat' set to RGBA, but processing stops after the final conversion
+%% to RGBA.
+%%
+%% The four scale parameters and the four bias parameters that are defined for the table
+%% are then used to scale and bias the R, G, B, and A components of each pixel. The scale
+%% and bias parameters are set by calling {@link gl:colorTableParameterfv/3} .
+%%
+%% Next, the R, G, B, and A values are clamped to the range [0 1]. Each pixel is then converted
+%% to the internal format specified by `Internalformat' . This conversion simply maps
+%% the component values of the pixel (R, G, B, and A) to the values included in the internal
+%% format (red, green, blue, alpha, luminance, and intensity). The mapping is as follows:
+%%
+%% <table><tbody><tr><td>` Internal Format '</td><td>` Red '</td><td>` Green '</td>
+%% <td>` Blue '</td><td>` Alpha '</td><td>` Luminance '</td><td>` Intensity '
+%% </td></tr></tbody><tbody><tr><td>`?GL_ALPHA'</td><td></td><td></td><td></td><td> A </td>
+%% <td></td><td></td></tr><tr><td>`?GL_LUMINANCE'</td><td></td><td></td><td></td><td></td>
+%% <td> R </td><td></td></tr><tr><td>`?GL_LUMINANCE_ALPHA'</td><td></td><td></td><td></td>
+%% <td> A </td><td> R </td><td></td></tr><tr><td>`?GL_INTENSITY'</td><td></td><td></td><td>
+%% </td><td></td><td></td><td> R </td></tr><tr><td>`?GL_RGB'</td><td> R </td><td> G </td>
+%% <td> B </td><td></td><td></td><td></td></tr><tr><td>`?GL_RGBA'</td><td> R </td><td>
+%% G </td><td> B </td><td> A </td><td></td><td></td></tr></tbody></table>
+%%
+%% Finally, the red, green, blue, alpha, luminance, and/or intensity components of the resulting
+%% pixels are stored in the color table. They form a one-dimensional table with indices in
+%% the range [0 width-1].
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyColorTable.xml">external</a> documentation.
+-spec copyColorTable(Target, Internalformat, X, Y, Width) -> ok when Target :: enum(),Internalformat :: enum(),X :: integer(),Y :: integer(),Width :: integer().
copyColorTable(Target,Internalformat,X,Y,Width) ->
cast(5328, <<Target:?GLenum,Internalformat:?GLenum,X:?GLint,Y:?GLint,Width:?GLsizei>>).
-%% @spec (Target::enum(),Format::enum(),Type::enum(),Table::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetColorTable.xml">external</a> documentation.
--spec getColorTable(enum(),enum(),enum(),mem()) -> ok.
+%% @doc Retrieve contents of a color lookup table
+%%
+%% ``gl:getColorTable'' returns in `Table' the contents of the color table specified
+%% by `Target' . No pixel transfer operations are performed, but pixel storage modes
+%% that are applicable to {@link gl:readPixels/7} are performed.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_PACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a histogram table is requested, `Table' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% Color components that are requested in the specified `Format' , but which are not
+%% included in the internal format of the color lookup table, are returned as zero. The assignments
+%% of internal color components to the components requested by `Format' are <table><tbody>
+%% <tr><td>` Internal Component '</td><td>` Resulting Component '</td></tr></tbody>
+%% <tbody><tr><td> Red </td><td> Red </td></tr><tr><td> Green </td><td> Green </td></tr><tr><td>
+%% Blue </td><td> Blue </td></tr><tr><td> Alpha </td><td> Alpha </td></tr><tr><td> Luminance
+%% </td><td> Red </td></tr><tr><td> Intensity </td><td> Red </td></tr></tbody></table>
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetColorTable.xml">external</a> documentation.
+-spec getColorTable(Target, Format, Type, Table) -> ok when Target :: enum(),Format :: enum(),Type :: enum(),Table :: mem().
getColorTable(Target,Format,Type,Table) ->
send_bin(Table),
call(5329, <<Target:?GLenum,Format:?GLenum,Type:?GLenum>>).
-%% @spec (Target::enum(),Pname::enum()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetColorTableParameter.xml">external</a> documentation.
--spec getColorTableParameterfv(enum(),enum()) -> {float(),float(),float(),float()}.
+%% @doc Get color lookup table parameters
+%%
+%% Returns parameters specific to color table `Target' .
+%%
+%% When `Pname' is set to `?GL_COLOR_TABLE_SCALE' or `?GL_COLOR_TABLE_BIAS',
+%% ``gl:getColorTableParameter'' returns the color table scale or bias parameters for the
+%% table specified by `Target' . For these queries, `Target' must be set to `?GL_COLOR_TABLE'
+%% , `?GL_POST_CONVOLUTION_COLOR_TABLE', or `?GL_POST_COLOR_MATRIX_COLOR_TABLE'
+%% and `Params' points to an array of four elements, which receive the scale or bias
+%% factors for red, green, blue, and alpha, in that order.
+%%
+%% ``gl:getColorTableParameter'' can also be used to retrieve the format and size parameters
+%% for a color table. For these queries, set `Target' to either the color table target
+%% or the proxy color table target. The format and size parameters are set by {@link gl:colorTable/6}
+%% .
+%%
+%% The following table lists the format and size parameters that may be queried. For each
+%% symbolic constant listed below for `Pname' , `Params' must point to an array
+%% of the given length and receive the values indicated.
+%%
+%% <table><tbody><tr><td>` Parameter '</td><td>` N '</td><td>` Meaning '</td></tr>
+%% </tbody><tbody><tr><td>`?GL_COLOR_TABLE_FORMAT'</td><td> 1 </td><td> Internal format
+%% (e.g., `?GL_RGBA') </td></tr><tr><td>`?GL_COLOR_TABLE_WIDTH'</td><td> 1 </td><td>
+%% Number of elements in table </td></tr><tr><td>`?GL_COLOR_TABLE_RED_SIZE'</td><td>
+%% 1 </td><td> Size of red component, in bits </td></tr><tr><td>`?GL_COLOR_TABLE_GREEN_SIZE'
+%% </td><td> 1 </td><td> Size of green component </td></tr><tr><td>`?GL_COLOR_TABLE_BLUE_SIZE'
+%% </td><td> 1 </td><td> Size of blue component </td></tr><tr><td>`?GL_COLOR_TABLE_ALPHA_SIZE'
+%% </td><td> 1 </td><td> Size of alpha component </td></tr><tr><td>`?GL_COLOR_TABLE_LUMINANCE_SIZE'
+%% </td><td> 1 </td><td> Size of luminance component </td></tr><tr><td>`?GL_COLOR_TABLE_INTENSITY_SIZE'
+%% </td><td> 1 </td><td> Size of intensity component </td></tr></tbody></table>
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetColorTableParameter.xml">external</a> documentation.
+-spec getColorTableParameterfv(Target, Pname) -> {float(),float(),float(),float()} when Target :: enum(),Pname :: enum().
getColorTableParameterfv(Target,Pname) ->
call(5330, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Target::enum(),Pname::enum()) -> {integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetColorTableParameter.xml">external</a> documentation.
--spec getColorTableParameteriv(enum(),enum()) -> {integer(),integer(),integer(),integer()}.
+%% @doc
+%% See {@link getColorTableParameterfv/2}
+-spec getColorTableParameteriv(Target, Pname) -> {integer(),integer(),integer(),integer()} when Target :: enum(),Pname :: enum().
getColorTableParameteriv(Target,Pname) ->
call(5331, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Target::enum(),Start::integer(),Count::integer(),Format::enum(),Type::enum(),Data::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColorSubTable.xml">external</a> documentation.
--spec colorSubTable(enum(),integer(),integer(),enum(),enum(),offset()|mem()) -> ok.
+%% @doc Respecify a portion of a color table
+%%
+%% ``gl:colorSubTable'' is used to respecify a contiguous portion of a color table previously
+%% defined using {@link gl:colorTable/6} . The pixels referenced by `Data' replace the
+%% portion of the existing table from indices `Start' to start+count-1, inclusive.
+%% This region may not include any entries outside the range of the color table as it was
+%% originally specified. It is not an error to specify a subtexture with width of 0, but
+%% such a specification has no effect.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a portion of a color table is respecified, `Data'
+%% is treated as a byte offset into the buffer object's data store.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColorSubTable.xml">external</a> documentation.
+-spec colorSubTable(Target, Start, Count, Format, Type, Data) -> ok when Target :: enum(),Start :: integer(),Count :: integer(),Format :: enum(),Type :: enum(),Data :: offset()|mem().
colorSubTable(Target,Start,Count,Format,Type,Data) when is_integer(Data) ->
cast(5332, <<Target:?GLenum,Start:?GLsizei,Count:?GLsizei,Format:?GLenum,Type:?GLenum,Data:?GLuint>>);
colorSubTable(Target,Start,Count,Format,Type,Data) ->
send_bin(Data),
cast(5333, <<Target:?GLenum,Start:?GLsizei,Count:?GLsizei,Format:?GLenum,Type:?GLenum>>).
-%% @spec (Target::enum(),Start::integer(),X::integer(),Y::integer(),Width::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyColorSubTable.xml">external</a> documentation.
--spec copyColorSubTable(enum(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc Respecify a portion of a color table
+%%
+%% ``gl:copyColorSubTable'' is used to respecify a contiguous portion of a color table
+%% previously defined using {@link gl:colorTable/6} . The pixels copied from the framebuffer
+%% replace the portion of the existing table from indices `Start' to start+x-1, inclusive.
+%% This region may not include any entries outside the range of the color table, as was originally
+%% specified. It is not an error to specify a subtexture with width of 0, but such a specification
+%% has no effect.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyColorSubTable.xml">external</a> documentation.
+-spec copyColorSubTable(Target, Start, X, Y, Width) -> ok when Target :: enum(),Start :: integer(),X :: integer(),Y :: integer(),Width :: integer().
copyColorSubTable(Target,Start,X,Y,Width) ->
cast(5334, <<Target:?GLenum,Start:?GLsizei,X:?GLint,Y:?GLint,Width:?GLsizei>>).
-%% @spec (Target::enum(),Internalformat::enum(),Width::integer(),Format::enum(),Type::enum(),Image::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glConvolutionFilter1D.xml">external</a> documentation.
--spec convolutionFilter1D(enum(),enum(),integer(),enum(),enum(),offset()|mem()) -> ok.
+%% @doc Define a one-dimensional convolution filter
+%%
+%% ``gl:convolutionFilter1D'' builds a one-dimensional convolution filter kernel from an
+%% array of pixels.
+%%
+%% The pixel array specified by `Width' , `Format' , `Type' , and `Data'
+%% is extracted from memory and processed just as if {@link gl:drawPixels/5} were called,
+%% but processing stops after the final expansion to RGBA is completed.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a convolution filter is specified, `Data' is
+%% treated as a byte offset into the buffer object's data store.
+%%
+%% The R, G, B, and A components of each pixel are next scaled by the four 1D `?GL_CONVOLUTION_FILTER_SCALE'
+%% parameters and biased by the four 1D `?GL_CONVOLUTION_FILTER_BIAS' parameters. (The
+%% scale and bias parameters are set by {@link gl:convolutionParameterf/3} using the `?GL_CONVOLUTION_1D'
+%% target and the names `?GL_CONVOLUTION_FILTER_SCALE' and `?GL_CONVOLUTION_FILTER_BIAS'
+%% . The parameters themselves are vectors of four values that are applied to red, green,
+%% blue, and alpha, in that order.) The R, G, B, and A values are not clamped to [0,1] at
+%% any time during this process.
+%%
+%% Each pixel is then converted to the internal format specified by `Internalformat' .
+%% This conversion simply maps the component values of the pixel (R, G, B, and A) to the
+%% values included in the internal format (red, green, blue, alpha, luminance, and intensity).
+%% The mapping is as follows:
+%%
+%% <table><tbody><tr><td>` Internal Format '</td><td>` Red '</td><td>` Green '</td>
+%% <td>` Blue '</td><td>` Alpha '</td><td>` Luminance '</td><td>` Intensity '
+%% </td></tr></tbody><tbody><tr><td>`?GL_ALPHA'</td><td></td><td></td><td></td><td> A </td>
+%% <td></td><td></td></tr><tr><td>`?GL_LUMINANCE'</td><td></td><td></td><td></td><td></td>
+%% <td> R </td><td></td></tr><tr><td>`?GL_LUMINANCE_ALPHA'</td><td></td><td></td><td></td>
+%% <td> A </td><td> R </td><td></td></tr><tr><td>`?GL_INTENSITY'</td><td></td><td></td><td>
+%% </td><td></td><td></td><td> R </td></tr><tr><td>`?GL_RGB'</td><td> R </td><td> G </td>
+%% <td> B </td><td></td><td></td><td></td></tr><tr><td>`?GL_RGBA'</td><td> R </td><td>
+%% G </td><td> B </td><td> A </td><td></td><td></td></tr></tbody></table>
+%%
+%% The red, green, blue, alpha, luminance, and/or intensity components of the resulting
+%% pixels are stored in floating-point rather than integer format. They form a one-dimensional
+%% filter kernel image indexed with coordinate `i' such that `i' starts at 0 and
+%% increases from left to right. Kernel location `i' is derived from the `i'th
+%% pixel, counting from 0.
+%%
+%% Note that after a convolution is performed, the resulting color components are also scaled
+%% by their corresponding `?GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
+%% corresponding `?GL_POST_CONVOLUTION_c_BIAS' parameters (where `c' takes on the
+%% values `RED', `GREEN', `BLUE', and `ALPHA'). These parameters are
+%% set by {@link gl:pixelTransferf/2} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glConvolutionFilter1D.xml">external</a> documentation.
+-spec convolutionFilter1D(Target, Internalformat, Width, Format, Type, Image) -> ok when Target :: enum(),Internalformat :: enum(),Width :: integer(),Format :: enum(),Type :: enum(),Image :: offset()|mem().
convolutionFilter1D(Target,Internalformat,Width,Format,Type,Image) when is_integer(Image) ->
cast(5335, <<Target:?GLenum,Internalformat:?GLenum,Width:?GLsizei,Format:?GLenum,Type:?GLenum,Image:?GLuint>>);
convolutionFilter1D(Target,Internalformat,Width,Format,Type,Image) ->
send_bin(Image),
cast(5336, <<Target:?GLenum,Internalformat:?GLenum,Width:?GLsizei,Format:?GLenum,Type:?GLenum>>).
-%% @spec (Target::enum(),Internalformat::enum(),Width::integer(),Height::integer(),Format::enum(),Type::enum(),Image::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glConvolutionFilter2D.xml">external</a> documentation.
--spec convolutionFilter2D(enum(),enum(),integer(),integer(),enum(),enum(),offset()|mem()) -> ok.
+%% @doc Define a two-dimensional convolution filter
+%%
+%% ``gl:convolutionFilter2D'' builds a two-dimensional convolution filter kernel from an
+%% array of pixels.
+%%
+%% The pixel array specified by `Width' , `Height' , `Format' , `Type' ,
+%% and `Data' is extracted from memory and processed just as if {@link gl:drawPixels/5}
+%% were called, but processing stops after the final expansion to RGBA is completed.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a convolution filter is specified, `Data' is
+%% treated as a byte offset into the buffer object's data store.
+%%
+%% The R, G, B, and A components of each pixel are next scaled by the four 2D `?GL_CONVOLUTION_FILTER_SCALE'
+%% parameters and biased by the four 2D `?GL_CONVOLUTION_FILTER_BIAS' parameters. (The
+%% scale and bias parameters are set by {@link gl:convolutionParameterf/3} using the `?GL_CONVOLUTION_2D'
+%% target and the names `?GL_CONVOLUTION_FILTER_SCALE' and `?GL_CONVOLUTION_FILTER_BIAS'
+%% . The parameters themselves are vectors of four values that are applied to red, green,
+%% blue, and alpha, in that order.) The R, G, B, and A values are not clamped to [0,1] at
+%% any time during this process.
+%%
+%% Each pixel is then converted to the internal format specified by `Internalformat' .
+%% This conversion simply maps the component values of the pixel (R, G, B, and A) to the
+%% values included in the internal format (red, green, blue, alpha, luminance, and intensity).
+%% The mapping is as follows:
+%%
+%% <table><tbody><tr><td>` Internal Format '</td><td>` Red '</td><td>` Green '</td>
+%% <td>` Blue '</td><td>` Alpha '</td><td>` Luminance '</td><td>` Intensity '
+%% </td></tr></tbody><tbody><tr><td>`?GL_ALPHA'</td><td></td><td></td><td></td><td> A </td>
+%% <td></td><td></td></tr><tr><td>`?GL_LUMINANCE'</td><td></td><td></td><td></td><td></td>
+%% <td> R </td><td></td></tr><tr><td>`?GL_LUMINANCE_ALPHA'</td><td></td><td></td><td></td>
+%% <td> A </td><td> R </td><td></td></tr><tr><td>`?GL_INTENSITY'</td><td></td><td></td><td>
+%% </td><td></td><td></td><td> R </td></tr><tr><td>`?GL_RGB'</td><td> R </td><td> G </td>
+%% <td> B </td><td></td><td></td><td></td></tr><tr><td>`?GL_RGBA'</td><td> R </td><td>
+%% G </td><td> B </td><td> A </td><td></td><td></td></tr></tbody></table>
+%%
+%% The red, green, blue, alpha, luminance, and/or intensity components of the resulting
+%% pixels are stored in floating-point rather than integer format. They form a two-dimensional
+%% filter kernel image indexed with coordinates `i' and `j' such that `i'
+%% starts at zero and increases from left to right, and `j' starts at zero and increases
+%% from bottom to top. Kernel location `i,j' is derived from the `N'th pixel, where
+%% `N' is `i'+`j'* `Width' .
+%%
+%% Note that after a convolution is performed, the resulting color components are also scaled
+%% by their corresponding `?GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
+%% corresponding `?GL_POST_CONVOLUTION_c_BIAS' parameters (where `c' takes on the
+%% values `RED', `GREEN', `BLUE', and `ALPHA'). These parameters are
+%% set by {@link gl:pixelTransferf/2} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glConvolutionFilter2D.xml">external</a> documentation.
+-spec convolutionFilter2D(Target, Internalformat, Width, Height, Format, Type, Image) -> ok when Target :: enum(),Internalformat :: enum(),Width :: integer(),Height :: integer(),Format :: enum(),Type :: enum(),Image :: offset()|mem().
convolutionFilter2D(Target,Internalformat,Width,Height,Format,Type,Image) when is_integer(Image) ->
cast(5337, <<Target:?GLenum,Internalformat:?GLenum,Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum,Image:?GLuint>>);
convolutionFilter2D(Target,Internalformat,Width,Height,Format,Type,Image) ->
send_bin(Image),
cast(5338, <<Target:?GLenum,Internalformat:?GLenum,Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum>>).
-%% @spec (Target::enum(),Pname::enum(),Params::{float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glConvolutionParameter.xml">external</a> documentation.
--spec convolutionParameterf(enum(),enum(),{float()}) -> ok.
+%% @doc Set convolution parameters
+%%
+%% ``gl:convolutionParameter'' sets the value of a convolution parameter.
+%%
+%% `Target' selects the convolution filter to be affected: `?GL_CONVOLUTION_1D', `?GL_CONVOLUTION_2D'
+%% , or `?GL_SEPARABLE_2D' for the 1D, 2D, or separable 2D filter, respectively.
+%%
+%% `Pname' selects the parameter to be changed. `?GL_CONVOLUTION_FILTER_SCALE'
+%% and `?GL_CONVOLUTION_FILTER_BIAS' affect the definition of the convolution filter
+%% kernel; see {@link gl:convolutionFilter1D/6} , {@link gl:convolutionFilter2D/7} , and {@link gl:separableFilter2D/8}
+%% for details. In these cases, `Params' v is an array of four values to be applied
+%% to red, green, blue, and alpha values, respectively. The initial value for `?GL_CONVOLUTION_FILTER_SCALE'
+%% is (1, 1, 1, 1), and the initial value for `?GL_CONVOLUTION_FILTER_BIAS' is (0,
+%% 0, 0, 0).
+%%
+%% A `Pname' value of `?GL_CONVOLUTION_BORDER_MODE' controls the convolution border
+%% mode. The accepted modes are:
+%%
+%% `?GL_REDUCE': The image resulting from convolution is smaller than the source image.
+%% If the filter width is Wf and height is Hf, and the source image width is Ws and
+%% height is Hs, then the convolved image width will be Ws-Wf+1 and height will be Hs-Hf
+%% +1. (If this reduction would generate an image with zero or negative width and/or height,
+%% the output is simply null, with no error generated.) The coordinates of the image resulting
+%% from convolution are zero through Ws-Wf in width and zero through Hs-Hf in height.
+%%
+%% `?GL_CONSTANT_BORDER': The image resulting from convolution is the same size as
+%% the source image, and processed as if the source image were surrounded by pixels with
+%% their color specified by the `?GL_CONVOLUTION_BORDER_COLOR'.
+%%
+%% `?GL_REPLICATE_BORDER': The image resulting from convolution is the same size as
+%% the source image, and processed as if the outermost pixel on the border of the source
+%% image were replicated.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glConvolutionParameter.xml">external</a> documentation.
+-spec convolutionParameterf(Target, Pname, Params) -> ok when Target :: enum(),Pname :: enum(),Params :: {float()}.
convolutionParameterf(Target,Pname,Params) ->
cast(5339, <<Target:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
(<< <<C:?GLfloat>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
-%% @spec (Target,Pname,{Params}) -> ok
%% @equiv convolutionParameterf(Target,Pname,Params)
--spec convolutionParameterfv(enum(),enum(),{{float()}}) -> ok.
+-spec convolutionParameterfv(Target :: enum(),Pname :: enum(),Params) -> ok when Params :: {Params :: {float()}}.
convolutionParameterfv(Target,Pname,{Params}) -> convolutionParameterf(Target,Pname,Params).
-%% @spec (Target::enum(),Pname::enum(),Params::{integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glConvolutionParameter.xml">external</a> documentation.
--spec convolutionParameteri(enum(),enum(),{integer()}) -> ok.
+%% @doc
+%% See {@link convolutionParameterf/3}
+-spec convolutionParameteri(Target, Pname, Params) -> ok when Target :: enum(),Pname :: enum(),Params :: {integer()}.
convolutionParameteri(Target,Pname,Params) ->
cast(5340, <<Target:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
(<< <<C:?GLint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
-%% @spec (Target,Pname,{Params}) -> ok
%% @equiv convolutionParameteri(Target,Pname,Params)
--spec convolutionParameteriv(enum(),enum(),{{integer()}}) -> ok.
+-spec convolutionParameteriv(Target :: enum(),Pname :: enum(),Params) -> ok when Params :: {Params :: {integer()}}.
convolutionParameteriv(Target,Pname,{Params}) -> convolutionParameteri(Target,Pname,Params).
-%% @spec (Target::enum(),Internalformat::enum(),X::integer(),Y::integer(),Width::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyConvolutionFilter1D.xml">external</a> documentation.
--spec copyConvolutionFilter1D(enum(),enum(),integer(),integer(),integer()) -> ok.
+%% @doc Copy pixels into a one-dimensional convolution filter
+%%
+%% ``gl:copyConvolutionFilter1D'' defines a one-dimensional convolution filter kernel with
+%% pixels from the current `?GL_READ_BUFFER' (rather than from main memory, as is the
+%% case for {@link gl:convolutionFilter1D/6} ).
+%%
+%% The screen-aligned pixel rectangle with lower-left corner at ( `X' , `Y' ), width
+%% `Width' and height 1 is used to define the convolution filter. If any pixels within
+%% this region are outside the window that is associated with the GL context, the values
+%% obtained for those pixels are undefined.
+%%
+%% The pixels in the rectangle are processed exactly as if {@link gl:readPixels/7} had been
+%% called with `format' set to RGBA, but the process stops just before final conversion.
+%% The R, G, B, and A components of each pixel are next scaled by the four 1D `?GL_CONVOLUTION_FILTER_SCALE'
+%% parameters and biased by the four 1D `?GL_CONVOLUTION_FILTER_BIAS' parameters. (The
+%% scale and bias parameters are set by {@link gl:convolutionParameterf/3} using the `?GL_CONVOLUTION_1D'
+%% target and the names `?GL_CONVOLUTION_FILTER_SCALE' and `?GL_CONVOLUTION_FILTER_BIAS'
+%% . The parameters themselves are vectors of four values that are applied to red, green,
+%% blue, and alpha, in that order.) The R, G, B, and A values are not clamped to [0,1] at
+%% any time during this process.
+%%
+%% Each pixel is then converted to the internal format specified by `Internalformat' .
+%% This conversion simply maps the component values of the pixel (R, G, B, and A) to the
+%% values included in the internal format (red, green, blue, alpha, luminance, and intensity).
+%% The mapping is as follows:
+%%
+%% <table><tbody><tr><td>` Internal Format '</td><td>` Red '</td><td>` Green '</td>
+%% <td>` Blue '</td><td>` Alpha '</td><td>` Luminance '</td><td>` Intensity '
+%% </td></tr></tbody><tbody><tr><td>`?GL_ALPHA'</td><td></td><td></td><td></td><td> A </td>
+%% <td></td><td></td></tr><tr><td>`?GL_LUMINANCE'</td><td></td><td></td><td></td><td></td>
+%% <td> R </td><td></td></tr><tr><td>`?GL_LUMINANCE_ALPHA'</td><td></td><td></td><td></td>
+%% <td> A </td><td> R </td><td></td></tr><tr><td>`?GL_INTENSITY'</td><td></td><td></td><td>
+%% </td><td></td><td></td><td> R </td></tr><tr><td>`?GL_RGB'</td><td> R </td><td> G </td>
+%% <td> B </td><td></td><td></td><td></td></tr><tr><td>`?GL_RGBA'</td><td> R </td><td>
+%% G </td><td> B </td><td> A </td><td></td><td></td></tr></tbody></table>
+%%
+%% The red, green, blue, alpha, luminance, and/or intensity components of the resulting
+%% pixels are stored in floating-point rather than integer format.
+%%
+%% Pixel ordering is such that lower x screen coordinates correspond to lower `i' filter
+%% image coordinates.
+%%
+%% Note that after a convolution is performed, the resulting color components are also scaled
+%% by their corresponding `?GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
+%% corresponding `?GL_POST_CONVOLUTION_c_BIAS' parameters (where `c' takes on the
+%% values `RED', `GREEN', `BLUE', and `ALPHA'). These parameters are
+%% set by {@link gl:pixelTransferf/2} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyConvolutionFilter1D.xml">external</a> documentation.
+-spec copyConvolutionFilter1D(Target, Internalformat, X, Y, Width) -> ok when Target :: enum(),Internalformat :: enum(),X :: integer(),Y :: integer(),Width :: integer().
copyConvolutionFilter1D(Target,Internalformat,X,Y,Width) ->
cast(5341, <<Target:?GLenum,Internalformat:?GLenum,X:?GLint,Y:?GLint,Width:?GLsizei>>).
-%% @spec (Target::enum(),Internalformat::enum(),X::integer(),Y::integer(),Width::integer(),Height::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyConvolutionFilter2D.xml">external</a> documentation.
--spec copyConvolutionFilter2D(enum(),enum(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc Copy pixels into a two-dimensional convolution filter
+%%
+%% ``gl:copyConvolutionFilter2D'' defines a two-dimensional convolution filter kernel with
+%% pixels from the current `?GL_READ_BUFFER' (rather than from main memory, as is the
+%% case for {@link gl:convolutionFilter2D/7} ).
+%%
+%% The screen-aligned pixel rectangle with lower-left corner at ( `X' , `Y' ), width
+%% `Width' and height `Height' is used to define the convolution filter. If any
+%% pixels within this region are outside the window that is associated with the GL context,
+%% the values obtained for those pixels are undefined.
+%%
+%% The pixels in the rectangle are processed exactly as if {@link gl:readPixels/7} had been
+%% called with `format' set to RGBA, but the process stops just before final conversion.
+%% The R, G, B, and A components of each pixel are next scaled by the four 2D `?GL_CONVOLUTION_FILTER_SCALE'
+%% parameters and biased by the four 2D `?GL_CONVOLUTION_FILTER_BIAS' parameters. (The
+%% scale and bias parameters are set by {@link gl:convolutionParameterf/3} using the `?GL_CONVOLUTION_2D'
+%% target and the names `?GL_CONVOLUTION_FILTER_SCALE' and `?GL_CONVOLUTION_FILTER_BIAS'
+%% . The parameters themselves are vectors of four values that are applied to red, green,
+%% blue, and alpha, in that order.) The R, G, B, and A values are not clamped to [0,1] at
+%% any time during this process.
+%%
+%% Each pixel is then converted to the internal format specified by `Internalformat' .
+%% This conversion simply maps the component values of the pixel (R, G, B, and A) to the
+%% values included in the internal format (red, green, blue, alpha, luminance, and intensity).
+%% The mapping is as follows:
+%%
+%% <table><tbody><tr><td>` Internal Format '</td><td>` Red '</td><td>` Green '</td>
+%% <td>` Blue '</td><td>` Alpha '</td><td>` Luminance '</td><td>` Intensity '
+%% </td></tr></tbody><tbody><tr><td>`?GL_ALPHA'</td><td></td><td></td><td></td><td> A </td>
+%% <td></td><td></td></tr><tr><td>`?GL_LUMINANCE'</td><td></td><td></td><td></td><td></td>
+%% <td> R </td><td></td></tr><tr><td>`?GL_LUMINANCE_ALPHA'</td><td></td><td></td><td></td>
+%% <td> A </td><td> R </td><td></td></tr><tr><td>`?GL_INTENSITY'</td><td></td><td></td><td>
+%% </td><td></td><td></td><td> R </td></tr><tr><td>`?GL_RGB'</td><td> R </td><td> G </td>
+%% <td> B </td><td></td><td></td><td></td></tr><tr><td>`?GL_RGBA'</td><td> R </td><td>
+%% G </td><td> B </td><td> A </td><td></td><td></td></tr></tbody></table>
+%%
+%% The red, green, blue, alpha, luminance, and/or intensity components of the resulting
+%% pixels are stored in floating-point rather than integer format.
+%%
+%% Pixel ordering is such that lower x screen coordinates correspond to lower `i' filter
+%% image coordinates, and lower y screen coordinates correspond to lower `j' filter
+%% image coordinates.
+%%
+%% Note that after a convolution is performed, the resulting color components are also scaled
+%% by their corresponding `?GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
+%% corresponding `?GL_POST_CONVOLUTION_c_BIAS' parameters (where `c' takes on the
+%% values `RED', `GREEN', `BLUE', and `ALPHA'). These parameters are
+%% set by {@link gl:pixelTransferf/2} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyConvolutionFilter2D.xml">external</a> documentation.
+-spec copyConvolutionFilter2D(Target, Internalformat, X, Y, Width, Height) -> ok when Target :: enum(),Internalformat :: enum(),X :: integer(),Y :: integer(),Width :: integer(),Height :: integer().
copyConvolutionFilter2D(Target,Internalformat,X,Y,Width,Height) ->
cast(5342, <<Target:?GLenum,Internalformat:?GLenum,X:?GLint,Y:?GLint,Width:?GLsizei,Height:?GLsizei>>).
-%% @spec (Target::enum(),Format::enum(),Type::enum(),Image::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetConvolutionFilter.xml">external</a> documentation.
--spec getConvolutionFilter(enum(),enum(),enum(),mem()) -> ok.
+%% @doc Get current 1D or 2D convolution filter kernel
+%%
+%% ``gl:getConvolutionFilter'' returns the current 1D or 2D convolution filter kernel as
+%% an image. The one- or two-dimensional image is placed in `Image' according to the
+%% specifications in `Format' and `Type' . No pixel transfer operations are performed
+%% on this image, but the relevant pixel storage modes are applied.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_PACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a convolution filter is requested, `Image' is
+%% treated as a byte offset into the buffer object's data store.
+%%
+%% Color components that are present in `Format' but not included in the internal format
+%% of the filter are returned as zero. The assignments of internal color components to the
+%% components of `Format' are as follows. <table><tbody><tr><td>` Internal Component '
+%% </td><td>` Resulting Component '</td></tr></tbody><tbody><tr><td> Red </td><td> Red </td>
+%% </tr><tr><td> Green </td><td> Green </td></tr><tr><td> Blue </td><td> Blue </td></tr><tr><td>
+%% Alpha </td><td> Alpha </td></tr><tr><td> Luminance </td><td> Red </td></tr><tr><td> Intensity
+%% </td><td> Red </td></tr></tbody></table>
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetConvolutionFilter.xml">external</a> documentation.
+-spec getConvolutionFilter(Target, Format, Type, Image) -> ok when Target :: enum(),Format :: enum(),Type :: enum(),Image :: mem().
getConvolutionFilter(Target,Format,Type,Image) ->
send_bin(Image),
call(5343, <<Target:?GLenum,Format:?GLenum,Type:?GLenum>>).
-%% @spec (Target::enum(),Pname::enum()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetConvolutionParameter.xml">external</a> documentation.
--spec getConvolutionParameterfv(enum(),enum()) -> {float(),float(),float(),float()}.
+%% @doc Get convolution parameters
+%%
+%% ``gl:getConvolutionParameter'' retrieves convolution parameters. `Target' determines
+%% which convolution filter is queried. `Pname' determines which parameter is returned:
+%%
+%%
+%% `?GL_CONVOLUTION_BORDER_MODE': The convolution border mode. See {@link gl:convolutionParameterf/3}
+%% for a list of border modes.
+%%
+%% `?GL_CONVOLUTION_BORDER_COLOR': The current convolution border color. `Params'
+%% must be a pointer to an array of four elements, which will receive the red, green, blue,
+%% and alpha border colors.
+%%
+%% `?GL_CONVOLUTION_FILTER_SCALE': The current filter scale factors. `Params'
+%% must be a pointer to an array of four elements, which will receive the red, green, blue,
+%% and alpha filter scale factors in that order.
+%%
+%% `?GL_CONVOLUTION_FILTER_BIAS': The current filter bias factors. `Params' must
+%% be a pointer to an array of four elements, which will receive the red, green, blue, and
+%% alpha filter bias terms in that order.
+%%
+%% `?GL_CONVOLUTION_FORMAT': The current internal format. See {@link gl:convolutionFilter1D/6}
+%% , {@link gl:convolutionFilter2D/7} , and {@link gl:separableFilter2D/8} for lists of allowable
+%% formats.
+%%
+%% `?GL_CONVOLUTION_WIDTH': The current filter image width.
+%%
+%% `?GL_CONVOLUTION_HEIGHT': The current filter image height.
+%%
+%% `?GL_MAX_CONVOLUTION_WIDTH': The maximum acceptable filter image width.
+%%
+%% `?GL_MAX_CONVOLUTION_HEIGHT': The maximum acceptable filter image height.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetConvolutionParameter.xml">external</a> documentation.
+-spec getConvolutionParameterfv(Target, Pname) -> {float(),float(),float(),float()} when Target :: enum(),Pname :: enum().
getConvolutionParameterfv(Target,Pname) ->
call(5344, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Target::enum(),Pname::enum()) -> {integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetConvolutionParameter.xml">external</a> documentation.
--spec getConvolutionParameteriv(enum(),enum()) -> {integer(),integer(),integer(),integer()}.
+%% @doc
+%% See {@link getConvolutionParameterfv/2}
+-spec getConvolutionParameteriv(Target, Pname) -> {integer(),integer(),integer(),integer()} when Target :: enum(),Pname :: enum().
getConvolutionParameteriv(Target,Pname) ->
call(5345, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Target::enum(),Internalformat::enum(),Width::integer(),Height::integer(),Format::enum(),Type::enum(),Row::offset()|mem(),Column::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSeparableFilter2D.xml">external</a> documentation.
--spec separableFilter2D(enum(),enum(),integer(),integer(),enum(),enum(),offset()|mem(),offset()|mem()) -> ok.
+%% @doc Define a separable two-dimensional convolution filter
+%%
+%% ``gl:separableFilter2D'' builds a two-dimensional separable convolution filter kernel
+%% from two arrays of pixels.
+%%
+%% The pixel arrays specified by ( `Width' , `Format' , `Type' , `Row' )
+%% and ( `Height' , `Format' , `Type' , `Column' ) are processed just as if
+%% they had been passed to {@link gl:drawPixels/5} , but processing stops after the final expansion
+%% to RGBA is completed.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a convolution filter is specified, `Row' and `Column'
+%% are treated as byte offsets into the buffer object's data store.
+%%
+%% Next, the R, G, B, and A components of all pixels in both arrays are scaled by the four
+%% separable 2D `?GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four separable
+%% 2D `?GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters are set
+%% by {@link gl:convolutionParameterf/3} using the `?GL_SEPARABLE_2D' target and the names
+%% `?GL_CONVOLUTION_FILTER_SCALE' and `?GL_CONVOLUTION_FILTER_BIAS'. The parameters
+%% themselves are vectors of four values that are applied to red, green, blue, and alpha,
+%% in that order.) The R, G, B, and A values are not clamped to [0,1] at any time during
+%% this process.
+%%
+%% Each pixel is then converted to the internal format specified by `Internalformat' .
+%% This conversion simply maps the component values of the pixel (R, G, B, and A) to the
+%% values included in the internal format (red, green, blue, alpha, luminance, and intensity).
+%% The mapping is as follows: <table><tbody><tr><td>` Internal Format '</td><td>` Red '
+%% </td><td>` Green '</td><td>` Blue '</td><td>` Alpha '</td><td>` Luminance '
+%% </td><td>` Intensity '</td></tr></tbody><tbody><tr><td>`?GL_LUMINANCE'</td><td></td>
+%% <td></td><td></td><td></td><td> R </td><td></td></tr><tr><td>`?GL_LUMINANCE_ALPHA'</td>
+%% <td></td><td></td><td></td><td> A </td><td> R </td><td></td></tr><tr><td>`?GL_INTENSITY'
+%% </td><td></td><td></td><td></td><td></td><td></td><td> R </td></tr><tr><td>`?GL_RGB'</td>
+%% <td> R </td><td> G </td><td> B </td><td></td><td></td><td></td></tr><tr><td>`?GL_RGBA'
+%% </td><td> R </td><td> G </td><td> B </td><td> A </td><td></td><td></td></tr></tbody></table>
+%%
+%%
+%% The red, green, blue, alpha, luminance, and/or intensity components of the resulting
+%% pixels are stored in floating-point rather than integer format. They form two one-dimensional
+%% filter kernel images. The row image is indexed by coordinate `i' starting at zero
+%% and increasing from left to right. Each location in the row image is derived from element
+%% `i' of `Row' . The column image is indexed by coordinate `j' starting at
+%% zero and increasing from bottom to top. Each location in the column image is derived from
+%% element `j' of `Column' .
+%%
+%% Note that after a convolution is performed, the resulting color components are also scaled
+%% by their corresponding `?GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
+%% corresponding `?GL_POST_CONVOLUTION_c_BIAS' parameters (where `c' takes on the
+%% values `RED', `GREEN', `BLUE', and `ALPHA'). These parameters are
+%% set by {@link gl:pixelTransferf/2} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSeparableFilter2D.xml">external</a> documentation.
+-spec separableFilter2D(Target, Internalformat, Width, Height, Format, Type, Row, Column) -> ok when Target :: enum(),Internalformat :: enum(),Width :: integer(),Height :: integer(),Format :: enum(),Type :: enum(),Row :: offset()|mem(),Column :: offset()|mem().
separableFilter2D(Target,Internalformat,Width,Height,Format,Type,Row,Column) when is_integer(Row), is_integer(Column) ->
cast(5346, <<Target:?GLenum,Internalformat:?GLenum,Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum,Row:?GLuint,Column:?GLuint>>);
separableFilter2D(Target,Internalformat,Width,Height,Format,Type,Row,Column) ->
@@ -2522,3497 +8778,7990 @@ separableFilter2D(Target,Internalformat,Width,Height,Format,Type,Row,Column) ->
send_bin(Column),
cast(5347, <<Target:?GLenum,Internalformat:?GLenum,Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum>>).
-%% @spec (Target::enum(),Reset::0|1,Format::enum(),Type::enum(),Values::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetHistogram.xml">external</a> documentation.
--spec getHistogram(enum(),0|1,enum(),enum(),mem()) -> ok.
+%% @doc Get histogram table
+%%
+%% ``gl:getHistogram'' returns the current histogram table as a one-dimensional image with
+%% the same width as the histogram. No pixel transfer operations are performed on this image,
+%% but pixel storage modes that are applicable to 1D images are honored.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_PACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a histogram table is requested, `Values' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% Color components that are requested in the specified `Format' , but which are not
+%% included in the internal format of the histogram, are returned as zero. The assignments
+%% of internal color components to the components requested by `Format' are: <table><tbody>
+%% <tr><td>` Internal Component '</td><td>` Resulting Component '</td></tr></tbody>
+%% <tbody><tr><td> Red </td><td> Red </td></tr><tr><td> Green </td><td> Green </td></tr><tr><td>
+%% Blue </td><td> Blue </td></tr><tr><td> Alpha </td><td> Alpha </td></tr><tr><td> Luminance
+%% </td><td> Red </td></tr></tbody></table>
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetHistogram.xml">external</a> documentation.
+-spec getHistogram(Target, Reset, Format, Type, Values) -> ok when Target :: enum(),Reset :: 0|1,Format :: enum(),Type :: enum(),Values :: mem().
getHistogram(Target,Reset,Format,Type,Values) ->
send_bin(Values),
call(5348, <<Target:?GLenum,Reset:?GLboolean,0:24,Format:?GLenum,Type:?GLenum>>).
-%% @spec (Target::enum(),Pname::enum()) -> {float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetHistogramParameter.xml">external</a> documentation.
--spec getHistogramParameterfv(enum(),enum()) -> {float()}.
+%% @doc Get histogram parameters
+%%
+%% ``gl:getHistogramParameter'' is used to query parameter values for the current histogram
+%% or for a proxy. The histogram state information may be queried by calling ``gl:getHistogramParameter''
+%% with a `Target' of `?GL_HISTOGRAM' (to obtain information for the current histogram
+%% table) or `?GL_PROXY_HISTOGRAM' (to obtain information from the most recent proxy
+%% request) and one of the following values for the `Pname' argument:
+%%
+%% <table><tbody><tr><td>` Parameter '</td><td>` Description '</td></tr></tbody><tbody>
+%% <tr><td>`?GL_HISTOGRAM_WIDTH'</td><td> Histogram table width </td></tr><tr><td>`?GL_HISTOGRAM_FORMAT'
+%% </td><td> Internal format </td></tr><tr><td>`?GL_HISTOGRAM_RED_SIZE'</td><td> Red
+%% component counter size, in bits </td></tr><tr><td>`?GL_HISTOGRAM_GREEN_SIZE'</td><td>
+%% Green component counter size, in bits </td></tr><tr><td>`?GL_HISTOGRAM_BLUE_SIZE'</td>
+%% <td> Blue component counter size, in bits </td></tr><tr><td>`?GL_HISTOGRAM_ALPHA_SIZE'
+%% </td><td> Alpha component counter size, in bits </td></tr><tr><td>`?GL_HISTOGRAM_LUMINANCE_SIZE'
+%% </td><td> Luminance component counter size, in bits </td></tr><tr><td>`?GL_HISTOGRAM_SINK'
+%% </td><td> Value of the `sink' parameter </td></tr></tbody></table>
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetHistogramParameter.xml">external</a> documentation.
+-spec getHistogramParameterfv(Target, Pname) -> {float()} when Target :: enum(),Pname :: enum().
getHistogramParameterfv(Target,Pname) ->
call(5349, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Target::enum(),Pname::enum()) -> {integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetHistogramParameter.xml">external</a> documentation.
--spec getHistogramParameteriv(enum(),enum()) -> {integer()}.
+%% @doc
+%% See {@link getHistogramParameterfv/2}
+-spec getHistogramParameteriv(Target, Pname) -> {integer()} when Target :: enum(),Pname :: enum().
getHistogramParameteriv(Target,Pname) ->
call(5350, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Target::enum(),Reset::0|1,Format::enum(),Type::enum(),Values::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetMinmax.xml">external</a> documentation.
--spec getMinmax(enum(),0|1,enum(),enum(),mem()) -> ok.
-getMinmax(Target,Reset,Format,Type,Values) ->
+%% @doc Get minimum and maximum pixel values
+%%
+%% ``gl:getMinmax'' returns the accumulated minimum and maximum pixel values (computed
+%% on a per-component basis) in a one-dimensional image of width 2. The first set of return
+%% values are the minima, and the second set of return values are the maxima. The format
+%% of the return values is determined by `Format' , and their type is determined by `Types'
+%% .
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_PACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while minimum and maximum pixel values are requested, `Values'
+%% is treated as a byte offset into the buffer object's data store.
+%%
+%% No pixel transfer operations are performed on the return values, but pixel storage modes
+%% that are applicable to one-dimensional images are performed. Color components that are
+%% requested in the specified `Format' , but that are not included in the internal format
+%% of the minmax table, are returned as zero. The assignment of internal color components
+%% to the components requested by `Format' are as follows:
+%%
+%% <table><tbody><tr><td>` Internal Component '</td><td>` Resulting Component '</td>
+%% </tr></tbody><tbody><tr><td> Red </td><td> Red </td></tr><tr><td> Green </td><td> Green </td>
+%% </tr><tr><td> Blue </td><td> Blue </td></tr><tr><td> Alpha </td><td> Alpha </td></tr><tr><td>
+%% Luminance </td><td> Red </td></tr></tbody></table>
+%%
+%% If `Reset' is `?GL_TRUE', the minmax table entries corresponding to the return
+%% values are reset to their initial values. Minimum and maximum values that are not returned
+%% are not modified, even if `Reset' is `?GL_TRUE'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetMinmax.xml">external</a> documentation.
+-spec getMinmax(Target, Reset, Format, Types, Values) -> ok when Target :: enum(),Reset :: 0|1,Format :: enum(),Types :: enum(),Values :: mem().
+getMinmax(Target,Reset,Format,Types,Values) ->
send_bin(Values),
- call(5351, <<Target:?GLenum,Reset:?GLboolean,0:24,Format:?GLenum,Type:?GLenum>>).
+ call(5351, <<Target:?GLenum,Reset:?GLboolean,0:24,Format:?GLenum,Types:?GLenum>>).
-%% @spec (Target::enum(),Pname::enum()) -> {float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetMinmaxParameter.xml">external</a> documentation.
--spec getMinmaxParameterfv(enum(),enum()) -> {float()}.
+%% @doc Get minmax parameters
+%%
+%% ``gl:getMinmaxParameter'' retrieves parameters for the current minmax table by setting `Pname'
+%% to one of the following values:
+%%
+%% <table><tbody><tr><td>` Parameter '</td><td>` Description '</td></tr></tbody><tbody>
+%% <tr><td>`?GL_MINMAX_FORMAT'</td><td> Internal format of minmax table </td></tr><tr><td>
+%% `?GL_MINMAX_SINK'</td><td> Value of the `sink' parameter </td></tr></tbody></table>
+%%
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetMinmaxParameter.xml">external</a> documentation.
+-spec getMinmaxParameterfv(Target, Pname) -> {float()} when Target :: enum(),Pname :: enum().
getMinmaxParameterfv(Target,Pname) ->
call(5352, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Target::enum(),Pname::enum()) -> {integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetMinmaxParameter.xml">external</a> documentation.
--spec getMinmaxParameteriv(enum(),enum()) -> {integer()}.
+%% @doc
+%% See {@link getMinmaxParameterfv/2}
+-spec getMinmaxParameteriv(Target, Pname) -> {integer()} when Target :: enum(),Pname :: enum().
getMinmaxParameteriv(Target,Pname) ->
call(5353, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Target::enum(),Width::integer(),Internalformat::enum(),Sink::0|1) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glHistogram.xml">external</a> documentation.
--spec histogram(enum(),integer(),enum(),0|1) -> ok.
+%% @doc Define histogram table
+%%
+%% When `?GL_HISTOGRAM' is enabled, RGBA color components are converted to histogram
+%% table indices by clamping to the range [0,1], multiplying by the width of the histogram
+%% table, and rounding to the nearest integer. The table entries selected by the RGBA indices
+%% are then incremented. (If the internal format of the histogram table includes luminance,
+%% then the index derived from the R color component determines the luminance table entry
+%% to be incremented.) If a histogram table entry is incremented beyond its maximum value,
+%% then its value becomes undefined. (This is not an error.)
+%%
+%% Histogramming is performed only for RGBA pixels (though these may be specified originally
+%% as color indices and converted to RGBA by index table lookup). Histogramming is enabled
+%% with {@link gl:enable/1} and disabled with {@link gl:enable/1} .
+%%
+%% When `Target' is `?GL_HISTOGRAM', ``gl:histogram'' redefines the current
+%% histogram table to have `Width' entries of the format specified by `Internalformat'
+%% . The entries are indexed 0 through width-1, and all entries are initialized to zero.
+%% The values in the previous histogram table, if any, are lost. If `Sink' is `?GL_TRUE'
+%% , then pixels are discarded after histogramming; no further processing of the pixels takes
+%% place, and no drawing, texture loading, or pixel readback will result.
+%%
+%% When `Target' is `?GL_PROXY_HISTOGRAM', ``gl:histogram'' computes all state
+%% information as if the histogram table were to be redefined, but does not actually define
+%% the new table. If the requested histogram table is too large to be supported, then the
+%% state information will be set to zero. This provides a way to determine if a histogram
+%% table with the given parameters can be supported.
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glHistogram.xml">external</a> documentation.
+-spec histogram(Target, Width, Internalformat, Sink) -> ok when Target :: enum(),Width :: integer(),Internalformat :: enum(),Sink :: 0|1.
histogram(Target,Width,Internalformat,Sink) ->
cast(5354, <<Target:?GLenum,Width:?GLsizei,Internalformat:?GLenum,Sink:?GLboolean>>).
-%% @spec (Target::enum(),Internalformat::enum(),Sink::0|1) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMinmax.xml">external</a> documentation.
--spec minmax(enum(),enum(),0|1) -> ok.
+%% @doc Define minmax table
+%%
+%% When `?GL_MINMAX' is enabled, the RGBA components of incoming pixels are compared
+%% to the minimum and maximum values for each component, which are stored in the two-element
+%% minmax table. (The first element stores the minima, and the second element stores the
+%% maxima.) If a pixel component is greater than the corresponding component in the maximum
+%% element, then the maximum element is updated with the pixel component value. If a pixel
+%% component is less than the corresponding component in the minimum element, then the minimum
+%% element is updated with the pixel component value. (In both cases, if the internal format
+%% of the minmax table includes luminance, then the R color component of incoming pixels
+%% is used for comparison.) The contents of the minmax table may be retrieved at a later
+%% time by calling {@link gl:getMinmax/5} . The minmax operation is enabled or disabled by
+%% calling {@link gl:enable/1} or {@link gl:enable/1} , respectively, with an argument of `?GL_MINMAX'
+%% .
+%%
+%% ``gl:minmax'' redefines the current minmax table to have entries of the format specified
+%% by `Internalformat' . The maximum element is initialized with the smallest possible
+%% component values, and the minimum element is initialized with the largest possible component
+%% values. The values in the previous minmax table, if any, are lost. If `Sink' is `?GL_TRUE'
+%% , then pixels are discarded after minmax; no further processing of the pixels takes place,
+%% and no drawing, texture loading, or pixel readback will result.
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMinmax.xml">external</a> documentation.
+-spec minmax(Target, Internalformat, Sink) -> ok when Target :: enum(),Internalformat :: enum(),Sink :: 0|1.
minmax(Target,Internalformat,Sink) ->
cast(5355, <<Target:?GLenum,Internalformat:?GLenum,Sink:?GLboolean>>).
-%% @spec (Target::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glResetHistogram.xml">external</a> documentation.
--spec resetHistogram(enum()) -> ok.
+%% @doc Reset histogram table entries to zero
+%%
+%% ``gl:resetHistogram'' resets all the elements of the current histogram table to zero.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glResetHistogram.xml">external</a> documentation.
+-spec resetHistogram(Target) -> ok when Target :: enum().
resetHistogram(Target) ->
cast(5356, <<Target:?GLenum>>).
-%% @spec (Target::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glResetMinmax.xml">external</a> documentation.
--spec resetMinmax(enum()) -> ok.
+%% @doc Reset minmax table entries to initial values
+%%
+%% ``gl:resetMinmax'' resets the elements of the current minmax table to their initial
+%% values: the ``maximum'' element receives the minimum possible component values, and the
+%% ``minimum'' element receives the maximum possible component values.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glResetMinmax.xml">external</a> documentation.
+-spec resetMinmax(Target) -> ok when Target :: enum().
resetMinmax(Target) ->
cast(5357, <<Target:?GLenum>>).
-%% @spec (Texture::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glActiveTexture.xml">external</a> documentation.
--spec activeTexture(enum()) -> ok.
+%% @doc Select active texture unit
+%%
+%% ``gl:activeTexture'' selects which texture unit subsequent texture state calls will
+%% affect. The number of texture units an implementation supports is implementation dependent,
+%% but must be at least 80.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glActiveTexture.xml">external</a> documentation.
+-spec activeTexture(Texture) -> ok when Texture :: enum().
activeTexture(Texture) ->
cast(5358, <<Texture:?GLenum>>).
-%% @spec (Value::clamp(),Invert::0|1) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSampleCoverage.xml">external</a> documentation.
--spec sampleCoverage(clamp(),0|1) -> ok.
+%% @doc Specify multisample coverage parameters
+%%
+%% Multisampling samples a pixel multiple times at various implementation-dependent subpixel
+%% locations to generate antialiasing effects. Multisampling transparently antialiases points,
+%% lines, polygons, and images if it is enabled.
+%%
+%% `Value' is used in constructing a temporary mask used in determining which samples
+%% will be used in resolving the final fragment color. This mask is bitwise-anded with the
+%% coverage mask generated from the multisampling computation. If the `Invert' flag
+%% is set, the temporary mask is inverted (all bits flipped) and then the bitwise-and is
+%% computed.
+%%
+%% If an implementation does not have any multisample buffers available, or multisampling
+%% is disabled, rasterization occurs with only a single sample computing a pixel's final
+%% RGB color.
+%%
+%% Provided an implementation supports multisample buffers, and multisampling is enabled,
+%% then a pixel's final color is generated by combining several samples per pixel. Each sample
+%% contains color, depth, and stencil information, allowing those operations to be performed
+%% on each sample.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSampleCoverage.xml">external</a> documentation.
+-spec sampleCoverage(Value, Invert) -> ok when Value :: clamp(),Invert :: 0|1.
sampleCoverage(Value,Invert) ->
cast(5359, <<Value:?GLclampf,Invert:?GLboolean>>).
-%% @spec (Target::enum(),Level::integer(),Internalformat::enum(),Width::integer(),Height::integer(),Depth::integer(),Border::integer(),ImageSize::integer(),Data::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompressedTexImage3D.xml">external</a> documentation.
--spec compressedTexImage3D(enum(),integer(),enum(),integer(),integer(),integer(),integer(),integer(),offset()|mem()) -> ok.
+%% @doc Specify a three-dimensional texture image in a compressed format
+%%
+%% Texturing allows elements of an image array to be read by shaders.
+%%
+%% ``gl:compressedTexImage3D'' loads a previously defined, and retrieved, compressed three-dimensional
+%% texture image if `Target' is `?GL_TEXTURE_3D' (see {@link gl:texImage3D/10} ).
+%%
+%% If `Target' is `?GL_TEXTURE_2D_ARRAY', `Data' is treated as an array of
+%% compressed 2D textures.
+%%
+%% If `Target' is `?GL_PROXY_TEXTURE_3D' or `?GL_PROXY_TEXTURE_2D_ARRAY',
+%% no data is read from `Data' , but all of the texture image state is recalculated,
+%% checked for consistency, and checked against the implementation's capabilities. If the
+%% implementation cannot handle a texture of the requested texture size, it sets all of the
+%% image state to 0, but does not generate an error (see {@link gl:getError/0} ). To query
+%% for an entire mipmap array, use an image array level greater than or equal to 1.
+%%
+%% `Internalformat' must be a known compressed image format (such as `?GL_RGTC')
+%% or an extension-specified compressed-texture format. When a texture is loaded with {@link gl:texImage2D/9}
+%% using a generic compressed texture format (e.g., `?GL_COMPRESSED_RGB'), the GL selects
+%% from one of its extensions supporting compressed textures. In order to load the compressed
+%% texture image using ``gl:compressedTexImage3D'', query the compressed texture image's
+%% size and format using {@link gl:getTexLevelParameterfv/3} .
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a texture image is specified, `Data' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% If the compressed data are arranged into fixed-size blocks of texels, the pixel storage
+%% modes can be used to select a sub-rectangle from a larger containing rectangle. These
+%% pixel storage modes operate in the same way as they do for {@link gl:texImage1D/8} . In
+%% the following description, denote by b s, b w, b h, and b d, the values of pixel storage
+%% modes `?GL_UNPACK_COMPRESSED_BLOCK_SIZE', `?GL_UNPACK_COMPRESSED_BLOCK_WIDTH', `?GL_UNPACK_COMPRESSED_BLOCK_HEIGHT'
+%% , and `?GL_UNPACK_COMPRESSED_BLOCK_DEPTH', respectively. b s is the compressed block
+%% size in bytes; b w, b h, and b d are the compressed block width, height, and depth
+%% in pixels.
+%%
+%% By default the pixel storage modes `?GL_UNPACK_ROW_LENGTH', `?GL_UNPACK_SKIP_ROWS'
+%% , `?GL_UNPACK_SKIP_PIXELS', `?GL_UNPACK_IMAGE_HEIGHT' and `?GL_UNPACK_SKIP_IMAGES'
+%% are ignored for compressed images. To enable `?GL_UNPACK_SKIP_PIXELS' and `?GL_UNPACK_ROW_LENGTH'
+%% , b s and b w must both be non-zero. To also enable `?GL_UNPACK_SKIP_ROWS' and `?GL_UNPACK_IMAGE_HEIGHT'
+%% , b h must be non-zero. To also enable `?GL_UNPACK_SKIP_IMAGES', b d must be non-zero.
+%% All parameters must be consistent with the compressed format to produce the desired results.
+%%
+%%
+%% When selecting a sub-rectangle from a compressed image: the value of `?GL_UNPACK_SKIP_PIXELS'
+%% must be a multiple of b w;the value of `?GL_UNPACK_SKIP_ROWS' must be a multiple
+%% of b w;the value of `?GL_UNPACK_SKIP_IMAGES' must be a multiple of b w.
+%%
+%% `ImageSize' must be equal to:
+%%
+%% b s*|width b/w|*|height b/h|*|depth b/d|
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompressedTexImage3D.xml">external</a> documentation.
+-spec compressedTexImage3D(Target, Level, Internalformat, Width, Height, Depth, Border, ImageSize, Data) -> ok when Target :: enum(),Level :: integer(),Internalformat :: enum(),Width :: integer(),Height :: integer(),Depth :: integer(),Border :: integer(),ImageSize :: integer(),Data :: offset()|mem().
compressedTexImage3D(Target,Level,Internalformat,Width,Height,Depth,Border,ImageSize,Data) when is_integer(Data) ->
cast(5360, <<Target:?GLenum,Level:?GLint,Internalformat:?GLenum,Width:?GLsizei,Height:?GLsizei,Depth:?GLsizei,Border:?GLint,ImageSize:?GLsizei,Data:?GLuint>>);
compressedTexImage3D(Target,Level,Internalformat,Width,Height,Depth,Border,ImageSize,Data) ->
send_bin(Data),
cast(5361, <<Target:?GLenum,Level:?GLint,Internalformat:?GLenum,Width:?GLsizei,Height:?GLsizei,Depth:?GLsizei,Border:?GLint,ImageSize:?GLsizei>>).
-%% @spec (Target::enum(),Level::integer(),Internalformat::enum(),Width::integer(),Height::integer(),Border::integer(),ImageSize::integer(),Data::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompressedTexImage2D.xml">external</a> documentation.
--spec compressedTexImage2D(enum(),integer(),enum(),integer(),integer(),integer(),integer(),offset()|mem()) -> ok.
+%% @doc Specify a two-dimensional texture image in a compressed format
+%%
+%% Texturing allows elements of an image array to be read by shaders.
+%%
+%% ``gl:compressedTexImage2D'' loads a previously defined, and retrieved, compressed two-dimensional
+%% texture image if `Target' is `?GL_TEXTURE_2D', or one of the cube map faces
+%% such as `?GL_TEXTURE_CUBE_MAP_POSITIVE_X'. (see {@link gl:texImage2D/9} ).
+%%
+%% If `Target' is `?GL_TEXTURE_1D_ARRAY', `Data' is treated as an array of
+%% compressed 1D textures.
+%%
+%% If `Target' is `?GL_PROXY_TEXTURE_2D', `?GL_PROXY_TEXTURE_1D_ARRAY' or `?GL_PROXY_CUBE_MAP'
+%% , no data is read from `Data' , but all of the texture image state is recalculated,
+%% checked for consistency, and checked against the implementation's capabilities. If the
+%% implementation cannot handle a texture of the requested texture size, it sets all of the
+%% image state to 0, but does not generate an error (see {@link gl:getError/0} ). To query
+%% for an entire mipmap array, use an image array level greater than or equal to 1.
+%%
+%% `Internalformat' must be a known compressed image format (such as `?GL_RGTC')
+%% or an extension-specified compressed-texture format. When a texture is loaded with {@link gl:texImage2D/9}
+%% using a generic compressed texture format (e.g., `?GL_COMPRESSED_RGB'), the GL selects
+%% from one of its extensions supporting compressed textures. In order to load the compressed
+%% texture image using ``gl:compressedTexImage2D'', query the compressed texture image's
+%% size and format using {@link gl:getTexLevelParameterfv/3} .
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a texture image is specified, `Data' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% If the compressed data are arranged into fixed-size blocks of texels, the pixel storage
+%% modes can be used to select a sub-rectangle from a larger containing rectangle. These
+%% pixel storage modes operate in the same way as they do for {@link gl:texImage2D/9} . In
+%% the following description, denote by b s, b w, b h, and b d, the values of pixel storage
+%% modes `?GL_UNPACK_COMPRESSED_BLOCK_SIZE', `?GL_UNPACK_COMPRESSED_BLOCK_WIDTH', `?GL_UNPACK_COMPRESSED_BLOCK_HEIGHT'
+%% , and `?GL_UNPACK_COMPRESSED_BLOCK_DEPTH', respectively. b s is the compressed block
+%% size in bytes; b w, b h, and b d are the compressed block width, height, and depth
+%% in pixels.
+%%
+%% By default the pixel storage modes `?GL_UNPACK_ROW_LENGTH', `?GL_UNPACK_SKIP_ROWS'
+%% , `?GL_UNPACK_SKIP_PIXELS', `?GL_UNPACK_IMAGE_HEIGHT' and `?GL_UNPACK_SKIP_IMAGES'
+%% are ignored for compressed images. To enable `?GL_UNPACK_SKIP_PIXELS' and `?GL_UNPACK_ROW_LENGTH'
+%% , b s and b w must both be non-zero. To also enable `?GL_UNPACK_SKIP_ROWS' and `?GL_UNPACK_IMAGE_HEIGHT'
+%% , b h must be non-zero. To also enable `?GL_UNPACK_SKIP_IMAGES', b d must be non-zero.
+%% All parameters must be consistent with the compressed format to produce the desired results.
+%%
+%%
+%% When selecting a sub-rectangle from a compressed image: the value of `?GL_UNPACK_SKIP_PIXELS'
+%% must be a multiple of b w;the value of `?GL_UNPACK_SKIP_ROWS' must be a multiple
+%% of b w.
+%%
+%% `ImageSize' must be equal to:
+%%
+%% b s*|width b/w|*|height b/h|
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompressedTexImage2D.xml">external</a> documentation.
+-spec compressedTexImage2D(Target, Level, Internalformat, Width, Height, Border, ImageSize, Data) -> ok when Target :: enum(),Level :: integer(),Internalformat :: enum(),Width :: integer(),Height :: integer(),Border :: integer(),ImageSize :: integer(),Data :: offset()|mem().
compressedTexImage2D(Target,Level,Internalformat,Width,Height,Border,ImageSize,Data) when is_integer(Data) ->
cast(5362, <<Target:?GLenum,Level:?GLint,Internalformat:?GLenum,Width:?GLsizei,Height:?GLsizei,Border:?GLint,ImageSize:?GLsizei,Data:?GLuint>>);
compressedTexImage2D(Target,Level,Internalformat,Width,Height,Border,ImageSize,Data) ->
send_bin(Data),
cast(5363, <<Target:?GLenum,Level:?GLint,Internalformat:?GLenum,Width:?GLsizei,Height:?GLsizei,Border:?GLint,ImageSize:?GLsizei>>).
-%% @spec (Target::enum(),Level::integer(),Internalformat::enum(),Width::integer(),Border::integer(),ImageSize::integer(),Data::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompressedTexImage1D.xml">external</a> documentation.
--spec compressedTexImage1D(enum(),integer(),enum(),integer(),integer(),integer(),offset()|mem()) -> ok.
+%% @doc Specify a one-dimensional texture image in a compressed format
+%%
+%% Texturing allows elements of an image array to be read by shaders.
+%%
+%% ``gl:compressedTexImage1D'' loads a previously defined, and retrieved, compressed one-dimensional
+%% texture image if `Target' is `?GL_TEXTURE_1D' (see {@link gl:texImage1D/8} ).
+%%
+%% If `Target' is `?GL_PROXY_TEXTURE_1D', no data is read from `Data' , but
+%% all of the texture image state is recalculated, checked for consistency, and checked against
+%% the implementation's capabilities. If the implementation cannot handle a texture of the
+%% requested texture size, it sets all of the image state to 0, but does not generate an
+%% error (see {@link gl:getError/0} ). To query for an entire mipmap array, use an image array
+%% level greater than or equal to 1.
+%%
+%% `Internalformat' must be an extension-specified compressed-texture format. When a
+%% texture is loaded with {@link gl:texImage1D/8} using a generic compressed texture format
+%% (e.g., `?GL_COMPRESSED_RGB') the GL selects from one of its extensions supporting
+%% compressed textures. In order to load the compressed texture image using ``gl:compressedTexImage1D''
+%% , query the compressed texture image's size and format using {@link gl:getTexLevelParameterfv/3}
+%% .
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a texture image is specified, `Data' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% If the compressed data are arranged into fixed-size blocks of texels, the pixel storage
+%% modes can be used to select a sub-rectangle from a larger containing rectangle. These
+%% pixel storage modes operate in the same way as they do for {@link gl:texImage1D/8} . In
+%% the following description, denote by b s, b w, b h, and b d, the values of pixel storage
+%% modes `?GL_UNPACK_COMPRESSED_BLOCK_SIZE', `?GL_UNPACK_COMPRESSED_BLOCK_WIDTH', `?GL_UNPACK_COMPRESSED_BLOCK_HEIGHT'
+%% , and `?GL_UNPACK_COMPRESSED_BLOCK_DEPTH', respectively. b s is the compressed block
+%% size in bytes; b w, b h, and b d are the compressed block width, height, and depth
+%% in pixels.
+%%
+%% By default the pixel storage modes `?GL_UNPACK_ROW_LENGTH', `?GL_UNPACK_SKIP_ROWS'
+%% , `?GL_UNPACK_SKIP_PIXELS', `?GL_UNPACK_IMAGE_HEIGHT' and `?GL_UNPACK_SKIP_IMAGES'
+%% are ignored for compressed images. To enable `?GL_UNPACK_SKIP_PIXELS' and `?GL_UNPACK_ROW_LENGTH'
+%% , b s and b w must both be non-zero. To also enable `?GL_UNPACK_SKIP_ROWS' and `?GL_UNPACK_IMAGE_HEIGHT'
+%% , b h must be non-zero. To also enable `?GL_UNPACK_SKIP_IMAGES', b d must be non-zero.
+%% All parameters must be consistent with the compressed format to produce the desired results.
+%%
+%%
+%% When selecting a sub-rectangle from a compressed image: the value of `?GL_UNPACK_SKIP_PIXELS'
+%% must be a multiple of b w;
+%%
+%% `ImageSize' must be equal to:
+%%
+%% b s*|width b/w|
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompressedTexImage1D.xml">external</a> documentation.
+-spec compressedTexImage1D(Target, Level, Internalformat, Width, Border, ImageSize, Data) -> ok when Target :: enum(),Level :: integer(),Internalformat :: enum(),Width :: integer(),Border :: integer(),ImageSize :: integer(),Data :: offset()|mem().
compressedTexImage1D(Target,Level,Internalformat,Width,Border,ImageSize,Data) when is_integer(Data) ->
cast(5364, <<Target:?GLenum,Level:?GLint,Internalformat:?GLenum,Width:?GLsizei,Border:?GLint,ImageSize:?GLsizei,Data:?GLuint>>);
compressedTexImage1D(Target,Level,Internalformat,Width,Border,ImageSize,Data) ->
send_bin(Data),
cast(5365, <<Target:?GLenum,Level:?GLint,Internalformat:?GLenum,Width:?GLsizei,Border:?GLint,ImageSize:?GLsizei>>).
-%% @spec (Target::enum(),Level::integer(),Xoffset::integer(),Yoffset::integer(),Zoffset::integer(),Width::integer(),Height::integer(),Depth::integer(),Format::enum(),ImageSize::integer(),Data::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompressedTexSubImage3D.xml">external</a> documentation.
--spec compressedTexSubImage3D(enum(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),enum(),integer(),offset()|mem()) -> ok.
+%% @doc Specify a three-dimensional texture subimage in a compressed format
+%%
+%% Texturing allows elements of an image array to be read by shaders.
+%%
+%% ``gl:compressedTexSubImage3D'' redefines a contiguous subregion of an existing three-dimensional
+%% texture image. The texels referenced by `Data' replace the portion of the existing
+%% texture array with x indices `Xoffset' and xoffset+width-1, and the y indices `Yoffset'
+%% and yoffset+height-1, and the z indices `Zoffset' and zoffset+depth-1, inclusive.
+%% This region may not include any texels outside the range of the texture array as it was
+%% originally specified. It is not an error to specify a subtexture with width of 0, but
+%% such a specification has no effect.
+%%
+%% `Internalformat' must be a known compressed image format (such as `?GL_RGTC')
+%% or an extension-specified compressed-texture format. The `Format' of the compressed
+%% texture image is selected by the GL implementation that compressed it (see {@link gl:texImage3D/10}
+%% ) and should be queried at the time the texture was compressed with {@link gl:getTexLevelParameterfv/3}
+%% .
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a texture image is specified, `Data' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompressedTexSubImage3D.xml">external</a> documentation.
+-spec compressedTexSubImage3D(Target, Level, Xoffset, Yoffset, Zoffset, Width, Height, Depth, Format, ImageSize, Data) -> ok when Target :: enum(),Level :: integer(),Xoffset :: integer(),Yoffset :: integer(),Zoffset :: integer(),Width :: integer(),Height :: integer(),Depth :: integer(),Format :: enum(),ImageSize :: integer(),Data :: offset()|mem().
compressedTexSubImage3D(Target,Level,Xoffset,Yoffset,Zoffset,Width,Height,Depth,Format,ImageSize,Data) when is_integer(Data) ->
cast(5366, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Yoffset:?GLint,Zoffset:?GLint,Width:?GLsizei,Height:?GLsizei,Depth:?GLsizei,Format:?GLenum,ImageSize:?GLsizei,Data:?GLuint>>);
compressedTexSubImage3D(Target,Level,Xoffset,Yoffset,Zoffset,Width,Height,Depth,Format,ImageSize,Data) ->
send_bin(Data),
cast(5367, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Yoffset:?GLint,Zoffset:?GLint,Width:?GLsizei,Height:?GLsizei,Depth:?GLsizei,Format:?GLenum,ImageSize:?GLsizei>>).
-%% @spec (Target::enum(),Level::integer(),Xoffset::integer(),Yoffset::integer(),Width::integer(),Height::integer(),Format::enum(),ImageSize::integer(),Data::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompressedTexSubImage2D.xml">external</a> documentation.
--spec compressedTexSubImage2D(enum(),integer(),integer(),integer(),integer(),integer(),enum(),integer(),offset()|mem()) -> ok.
+%% @doc Specify a two-dimensional texture subimage in a compressed format
+%%
+%% Texturing allows elements of an image array to be read by shaders.
+%%
+%% ``gl:compressedTexSubImage2D'' redefines a contiguous subregion of an existing two-dimensional
+%% texture image. The texels referenced by `Data' replace the portion of the existing
+%% texture array with x indices `Xoffset' and xoffset+width-1, and the y indices `Yoffset'
+%% and yoffset+height-1, inclusive. This region may not include any texels outside the
+%% range of the texture array as it was originally specified. It is not an error to specify
+%% a subtexture with width of 0, but such a specification has no effect.
+%%
+%% `Internalformat' must be a known compressed image format (such as `?GL_RGTC')
+%% or an extension-specified compressed-texture format. The `Format' of the compressed
+%% texture image is selected by the GL implementation that compressed it (see {@link gl:texImage2D/9}
+%% ) and should be queried at the time the texture was compressed with {@link gl:getTexLevelParameterfv/3}
+%% .
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a texture image is specified, `Data' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompressedTexSubImage2D.xml">external</a> documentation.
+-spec compressedTexSubImage2D(Target, Level, Xoffset, Yoffset, Width, Height, Format, ImageSize, Data) -> ok when Target :: enum(),Level :: integer(),Xoffset :: integer(),Yoffset :: integer(),Width :: integer(),Height :: integer(),Format :: enum(),ImageSize :: integer(),Data :: offset()|mem().
compressedTexSubImage2D(Target,Level,Xoffset,Yoffset,Width,Height,Format,ImageSize,Data) when is_integer(Data) ->
cast(5368, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Yoffset:?GLint,Width:?GLsizei,Height:?GLsizei,Format:?GLenum,ImageSize:?GLsizei,Data:?GLuint>>);
compressedTexSubImage2D(Target,Level,Xoffset,Yoffset,Width,Height,Format,ImageSize,Data) ->
send_bin(Data),
cast(5369, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Yoffset:?GLint,Width:?GLsizei,Height:?GLsizei,Format:?GLenum,ImageSize:?GLsizei>>).
-%% @spec (Target::enum(),Level::integer(),Xoffset::integer(),Width::integer(),Format::enum(),ImageSize::integer(),Data::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompressedTexSubImage1D.xml">external</a> documentation.
--spec compressedTexSubImage1D(enum(),integer(),integer(),integer(),enum(),integer(),offset()|mem()) -> ok.
+%% @doc Specify a one-dimensional texture subimage in a compressed format
+%%
+%% Texturing allows elements of an image array to be read by shaders.
+%%
+%% ``gl:compressedTexSubImage1D'' redefines a contiguous subregion of an existing one-dimensional
+%% texture image. The texels referenced by `Data' replace the portion of the existing
+%% texture array with x indices `Xoffset' and xoffset+width-1, inclusive. This region
+%% may not include any texels outside the range of the texture array as it was originally
+%% specified. It is not an error to specify a subtexture with width of 0, but such a specification
+%% has no effect.
+%%
+%% `Internalformat' must be a known compressed image format (such as `?GL_RGTC')
+%% or an extension-specified compressed-texture format. The `Format' of the compressed
+%% texture image is selected by the GL implementation that compressed it (see {@link gl:texImage1D/8}
+%% ), and should be queried at the time the texture was compressed with {@link gl:getTexLevelParameterfv/3}
+%% .
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a texture image is specified, `Data' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompressedTexSubImage1D.xml">external</a> documentation.
+-spec compressedTexSubImage1D(Target, Level, Xoffset, Width, Format, ImageSize, Data) -> ok when Target :: enum(),Level :: integer(),Xoffset :: integer(),Width :: integer(),Format :: enum(),ImageSize :: integer(),Data :: offset()|mem().
compressedTexSubImage1D(Target,Level,Xoffset,Width,Format,ImageSize,Data) when is_integer(Data) ->
cast(5370, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Width:?GLsizei,Format:?GLenum,ImageSize:?GLsizei,Data:?GLuint>>);
compressedTexSubImage1D(Target,Level,Xoffset,Width,Format,ImageSize,Data) ->
send_bin(Data),
cast(5371, <<Target:?GLenum,Level:?GLint,Xoffset:?GLint,Width:?GLsizei,Format:?GLenum,ImageSize:?GLsizei>>).
-%% @spec (Target::enum(),Level::integer(),Img::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetCompressedTexImage.xml">external</a> documentation.
--spec getCompressedTexImage(enum(),integer(),mem()) -> ok.
-getCompressedTexImage(Target,Level,Img) ->
+%% @doc Return a compressed texture image
+%%
+%% ``gl:getCompressedTexImage'' returns the compressed texture image associated with `Target'
+%% and `Lod' into `Img' . `Img' should be an array of `?GL_TEXTURE_COMPRESSED_IMAGE_SIZE'
+%% bytes. `Target' specifies whether the desired texture image was one specified by {@link gl:texImage1D/8}
+%% (`?GL_TEXTURE_1D'), {@link gl:texImage2D/9} (`?GL_TEXTURE_2D' or any of `?GL_TEXTURE_CUBE_MAP_*'
+%% ), or {@link gl:texImage3D/10} (`?GL_TEXTURE_3D'). `Lod' specifies the level-of-detail
+%% number of the desired image.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_PIXEL_PACK_BUFFER' target
+%% (see {@link gl:bindBuffer/2} ) while a texture image is requested, `Img' is treated
+%% as a byte offset into the buffer object's data store.
+%%
+%% To minimize errors, first verify that the texture is compressed by calling {@link gl:getTexLevelParameterfv/3}
+%% with argument `?GL_TEXTURE_COMPRESSED'. If the texture is compressed, then determine
+%% the amount of memory required to store the compressed texture by calling {@link gl:getTexLevelParameterfv/3}
+%% with argument `?GL_TEXTURE_COMPRESSED_IMAGE_SIZE'. Finally, retrieve the internal
+%% format of the texture by calling {@link gl:getTexLevelParameterfv/3} with argument `?GL_TEXTURE_INTERNAL_FORMAT'
+%% . To store the texture for later use, associate the internal format and size with the
+%% retrieved texture image. These data can be used by the respective texture or subtexture
+%% loading routine used for loading `Target' textures.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetCompressedTexImage.xml">external</a> documentation.
+-spec getCompressedTexImage(Target, Lod, Img) -> ok when Target :: enum(),Lod :: integer(),Img :: mem().
+getCompressedTexImage(Target,Lod,Img) ->
send_bin(Img),
- call(5372, <<Target:?GLenum,Level:?GLint>>).
+ call(5372, <<Target:?GLenum,Lod:?GLint>>).
-%% @spec (Texture::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClientActiveTexture.xml">external</a> documentation.
--spec clientActiveTexture(enum()) -> ok.
+%% @doc Select active texture unit
+%%
+%% ``gl:clientActiveTexture'' selects the vertex array client state parameters to be modified
+%% by {@link gl:texCoordPointer/4} , and enabled or disabled with {@link gl:enableClientState/1}
+%% or {@link gl:enableClientState/1} , respectively, when called with a parameter of `?GL_TEXTURE_COORD_ARRAY'
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClientActiveTexture.xml">external</a> documentation.
+-spec clientActiveTexture(Texture) -> ok when Texture :: enum().
clientActiveTexture(Texture) ->
cast(5373, <<Texture:?GLenum>>).
-%% @spec (Target::enum(),S::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord1d(enum(),float()) -> ok.
+%% @doc Set the current texture coordinates
+%%
+%% ``gl:multiTexCoord'' specifies texture coordinates in one, two, three, or four dimensions.
+%% ``gl:multiTexCoord1'' sets the current texture coordinates to (s 0 0 1); a call to ``gl:multiTexCoord2''
+%% sets them to (s t 0 1). Similarly, ``gl:multiTexCoord3'' specifies the texture coordinates as (s
+%% t r 1),
+%% and ``gl:multiTexCoord4'' defines all four components explicitly as (s t r q).
+%%
+%% The current texture coordinates are part of the data that is associated with each vertex
+%% and with the current raster position. Initially, the values for (s t r q) are (0 0 0 1).
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
+-spec multiTexCoord1d(Target, S) -> ok when Target :: enum(),S :: float().
multiTexCoord1d(Target,S) ->
cast(5374, <<Target:?GLenum,0:32,S:?GLdouble>>).
-%% @spec (Target,{S}) -> ok
%% @equiv multiTexCoord1d(Target,S)
--spec multiTexCoord1dv(enum(),{float()}) -> ok.
+-spec multiTexCoord1dv(Target :: enum(),V) -> ok when V :: {S :: float()}.
multiTexCoord1dv(Target,{S}) -> multiTexCoord1d(Target,S).
-%% @spec (Target::enum(),S::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord1f(enum(),float()) -> ok.
+%% @doc
+%% See {@link multiTexCoord1d/2}
+-spec multiTexCoord1f(Target, S) -> ok when Target :: enum(),S :: float().
multiTexCoord1f(Target,S) ->
cast(5375, <<Target:?GLenum,S:?GLfloat>>).
-%% @spec (Target,{S}) -> ok
%% @equiv multiTexCoord1f(Target,S)
--spec multiTexCoord1fv(enum(),{float()}) -> ok.
+-spec multiTexCoord1fv(Target :: enum(),V) -> ok when V :: {S :: float()}.
multiTexCoord1fv(Target,{S}) -> multiTexCoord1f(Target,S).
-%% @spec (Target::enum(),S::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord1i(enum(),integer()) -> ok.
+%% @doc
+%% See {@link multiTexCoord1d/2}
+-spec multiTexCoord1i(Target, S) -> ok when Target :: enum(),S :: integer().
multiTexCoord1i(Target,S) ->
cast(5376, <<Target:?GLenum,S:?GLint>>).
-%% @spec (Target,{S}) -> ok
%% @equiv multiTexCoord1i(Target,S)
--spec multiTexCoord1iv(enum(),{integer()}) -> ok.
+-spec multiTexCoord1iv(Target :: enum(),V) -> ok when V :: {S :: integer()}.
multiTexCoord1iv(Target,{S}) -> multiTexCoord1i(Target,S).
-%% @spec (Target::enum(),S::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord1s(enum(),integer()) -> ok.
+%% @doc
+%% See {@link multiTexCoord1d/2}
+-spec multiTexCoord1s(Target, S) -> ok when Target :: enum(),S :: integer().
multiTexCoord1s(Target,S) ->
cast(5377, <<Target:?GLenum,S:?GLshort>>).
-%% @spec (Target,{S}) -> ok
%% @equiv multiTexCoord1s(Target,S)
--spec multiTexCoord1sv(enum(),{integer()}) -> ok.
+-spec multiTexCoord1sv(Target :: enum(),V) -> ok when V :: {S :: integer()}.
multiTexCoord1sv(Target,{S}) -> multiTexCoord1s(Target,S).
-%% @spec (Target::enum(),S::float(),T::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord2d(enum(),float(),float()) -> ok.
+%% @doc
+%% See {@link multiTexCoord1d/2}
+-spec multiTexCoord2d(Target, S, T) -> ok when Target :: enum(),S :: float(),T :: float().
multiTexCoord2d(Target,S,T) ->
cast(5378, <<Target:?GLenum,0:32,S:?GLdouble,T:?GLdouble>>).
-%% @spec (Target,{S,T}) -> ok
%% @equiv multiTexCoord2d(Target,S,T)
--spec multiTexCoord2dv(enum(),{float(),float()}) -> ok.
+-spec multiTexCoord2dv(Target :: enum(),V) -> ok when V :: {S :: float(),T :: float()}.
multiTexCoord2dv(Target,{S,T}) -> multiTexCoord2d(Target,S,T).
-%% @spec (Target::enum(),S::float(),T::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord2f(enum(),float(),float()) -> ok.
+%% @doc
+%% See {@link multiTexCoord1d/2}
+-spec multiTexCoord2f(Target, S, T) -> ok when Target :: enum(),S :: float(),T :: float().
multiTexCoord2f(Target,S,T) ->
cast(5379, <<Target:?GLenum,S:?GLfloat,T:?GLfloat>>).
-%% @spec (Target,{S,T}) -> ok
%% @equiv multiTexCoord2f(Target,S,T)
--spec multiTexCoord2fv(enum(),{float(),float()}) -> ok.
+-spec multiTexCoord2fv(Target :: enum(),V) -> ok when V :: {S :: float(),T :: float()}.
multiTexCoord2fv(Target,{S,T}) -> multiTexCoord2f(Target,S,T).
-%% @spec (Target::enum(),S::integer(),T::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord2i(enum(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link multiTexCoord1d/2}
+-spec multiTexCoord2i(Target, S, T) -> ok when Target :: enum(),S :: integer(),T :: integer().
multiTexCoord2i(Target,S,T) ->
cast(5380, <<Target:?GLenum,S:?GLint,T:?GLint>>).
-%% @spec (Target,{S,T}) -> ok
%% @equiv multiTexCoord2i(Target,S,T)
--spec multiTexCoord2iv(enum(),{integer(),integer()}) -> ok.
+-spec multiTexCoord2iv(Target :: enum(),V) -> ok when V :: {S :: integer(),T :: integer()}.
multiTexCoord2iv(Target,{S,T}) -> multiTexCoord2i(Target,S,T).
-%% @spec (Target::enum(),S::integer(),T::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord2s(enum(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link multiTexCoord1d/2}
+-spec multiTexCoord2s(Target, S, T) -> ok when Target :: enum(),S :: integer(),T :: integer().
multiTexCoord2s(Target,S,T) ->
cast(5381, <<Target:?GLenum,S:?GLshort,T:?GLshort>>).
-%% @spec (Target,{S,T}) -> ok
%% @equiv multiTexCoord2s(Target,S,T)
--spec multiTexCoord2sv(enum(),{integer(),integer()}) -> ok.
+-spec multiTexCoord2sv(Target :: enum(),V) -> ok when V :: {S :: integer(),T :: integer()}.
multiTexCoord2sv(Target,{S,T}) -> multiTexCoord2s(Target,S,T).
-%% @spec (Target::enum(),S::float(),T::float(),R::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord3d(enum(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link multiTexCoord1d/2}
+-spec multiTexCoord3d(Target, S, T, R) -> ok when Target :: enum(),S :: float(),T :: float(),R :: float().
multiTexCoord3d(Target,S,T,R) ->
cast(5382, <<Target:?GLenum,0:32,S:?GLdouble,T:?GLdouble,R:?GLdouble>>).
-%% @spec (Target,{S,T,R}) -> ok
%% @equiv multiTexCoord3d(Target,S,T,R)
--spec multiTexCoord3dv(enum(),{float(),float(),float()}) -> ok.
+-spec multiTexCoord3dv(Target :: enum(),V) -> ok when V :: {S :: float(),T :: float(),R :: float()}.
multiTexCoord3dv(Target,{S,T,R}) -> multiTexCoord3d(Target,S,T,R).
-%% @spec (Target::enum(),S::float(),T::float(),R::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord3f(enum(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link multiTexCoord1d/2}
+-spec multiTexCoord3f(Target, S, T, R) -> ok when Target :: enum(),S :: float(),T :: float(),R :: float().
multiTexCoord3f(Target,S,T,R) ->
cast(5383, <<Target:?GLenum,S:?GLfloat,T:?GLfloat,R:?GLfloat>>).
-%% @spec (Target,{S,T,R}) -> ok
%% @equiv multiTexCoord3f(Target,S,T,R)
--spec multiTexCoord3fv(enum(),{float(),float(),float()}) -> ok.
+-spec multiTexCoord3fv(Target :: enum(),V) -> ok when V :: {S :: float(),T :: float(),R :: float()}.
multiTexCoord3fv(Target,{S,T,R}) -> multiTexCoord3f(Target,S,T,R).
-%% @spec (Target::enum(),S::integer(),T::integer(),R::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord3i(enum(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link multiTexCoord1d/2}
+-spec multiTexCoord3i(Target, S, T, R) -> ok when Target :: enum(),S :: integer(),T :: integer(),R :: integer().
multiTexCoord3i(Target,S,T,R) ->
cast(5384, <<Target:?GLenum,S:?GLint,T:?GLint,R:?GLint>>).
-%% @spec (Target,{S,T,R}) -> ok
%% @equiv multiTexCoord3i(Target,S,T,R)
--spec multiTexCoord3iv(enum(),{integer(),integer(),integer()}) -> ok.
+-spec multiTexCoord3iv(Target :: enum(),V) -> ok when V :: {S :: integer(),T :: integer(),R :: integer()}.
multiTexCoord3iv(Target,{S,T,R}) -> multiTexCoord3i(Target,S,T,R).
-%% @spec (Target::enum(),S::integer(),T::integer(),R::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord3s(enum(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link multiTexCoord1d/2}
+-spec multiTexCoord3s(Target, S, T, R) -> ok when Target :: enum(),S :: integer(),T :: integer(),R :: integer().
multiTexCoord3s(Target,S,T,R) ->
cast(5385, <<Target:?GLenum,S:?GLshort,T:?GLshort,R:?GLshort>>).
-%% @spec (Target,{S,T,R}) -> ok
%% @equiv multiTexCoord3s(Target,S,T,R)
--spec multiTexCoord3sv(enum(),{integer(),integer(),integer()}) -> ok.
+-spec multiTexCoord3sv(Target :: enum(),V) -> ok when V :: {S :: integer(),T :: integer(),R :: integer()}.
multiTexCoord3sv(Target,{S,T,R}) -> multiTexCoord3s(Target,S,T,R).
-%% @spec (Target::enum(),S::float(),T::float(),R::float(),Q::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord4d(enum(),float(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link multiTexCoord1d/2}
+-spec multiTexCoord4d(Target, S, T, R, Q) -> ok when Target :: enum(),S :: float(),T :: float(),R :: float(),Q :: float().
multiTexCoord4d(Target,S,T,R,Q) ->
cast(5386, <<Target:?GLenum,0:32,S:?GLdouble,T:?GLdouble,R:?GLdouble,Q:?GLdouble>>).
-%% @spec (Target,{S,T,R,Q}) -> ok
%% @equiv multiTexCoord4d(Target,S,T,R,Q)
--spec multiTexCoord4dv(enum(),{float(),float(),float(),float()}) -> ok.
+-spec multiTexCoord4dv(Target :: enum(),V) -> ok when V :: {S :: float(),T :: float(),R :: float(),Q :: float()}.
multiTexCoord4dv(Target,{S,T,R,Q}) -> multiTexCoord4d(Target,S,T,R,Q).
-%% @spec (Target::enum(),S::float(),T::float(),R::float(),Q::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord4f(enum(),float(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link multiTexCoord1d/2}
+-spec multiTexCoord4f(Target, S, T, R, Q) -> ok when Target :: enum(),S :: float(),T :: float(),R :: float(),Q :: float().
multiTexCoord4f(Target,S,T,R,Q) ->
cast(5387, <<Target:?GLenum,S:?GLfloat,T:?GLfloat,R:?GLfloat,Q:?GLfloat>>).
-%% @spec (Target,{S,T,R,Q}) -> ok
%% @equiv multiTexCoord4f(Target,S,T,R,Q)
--spec multiTexCoord4fv(enum(),{float(),float(),float(),float()}) -> ok.
+-spec multiTexCoord4fv(Target :: enum(),V) -> ok when V :: {S :: float(),T :: float(),R :: float(),Q :: float()}.
multiTexCoord4fv(Target,{S,T,R,Q}) -> multiTexCoord4f(Target,S,T,R,Q).
-%% @spec (Target::enum(),S::integer(),T::integer(),R::integer(),Q::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord4i(enum(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link multiTexCoord1d/2}
+-spec multiTexCoord4i(Target, S, T, R, Q) -> ok when Target :: enum(),S :: integer(),T :: integer(),R :: integer(),Q :: integer().
multiTexCoord4i(Target,S,T,R,Q) ->
cast(5388, <<Target:?GLenum,S:?GLint,T:?GLint,R:?GLint,Q:?GLint>>).
-%% @spec (Target,{S,T,R,Q}) -> ok
%% @equiv multiTexCoord4i(Target,S,T,R,Q)
--spec multiTexCoord4iv(enum(),{integer(),integer(),integer(),integer()}) -> ok.
+-spec multiTexCoord4iv(Target :: enum(),V) -> ok when V :: {S :: integer(),T :: integer(),R :: integer(),Q :: integer()}.
multiTexCoord4iv(Target,{S,T,R,Q}) -> multiTexCoord4i(Target,S,T,R,Q).
-%% @spec (Target::enum(),S::integer(),T::integer(),R::integer(),Q::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiTexCoord.xml">external</a> documentation.
--spec multiTexCoord4s(enum(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link multiTexCoord1d/2}
+-spec multiTexCoord4s(Target, S, T, R, Q) -> ok when Target :: enum(),S :: integer(),T :: integer(),R :: integer(),Q :: integer().
multiTexCoord4s(Target,S,T,R,Q) ->
cast(5389, <<Target:?GLenum,S:?GLshort,T:?GLshort,R:?GLshort,Q:?GLshort>>).
-%% @spec (Target,{S,T,R,Q}) -> ok
%% @equiv multiTexCoord4s(Target,S,T,R,Q)
--spec multiTexCoord4sv(enum(),{integer(),integer(),integer(),integer()}) -> ok.
+-spec multiTexCoord4sv(Target :: enum(),V) -> ok when V :: {S :: integer(),T :: integer(),R :: integer(),Q :: integer()}.
multiTexCoord4sv(Target,{S,T,R,Q}) -> multiTexCoord4s(Target,S,T,R,Q).
-%% @spec (M::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLoadTransposeMatrix.xml">external</a> documentation.
--spec loadTransposeMatrixf({float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok.
+%% @doc Replace the current matrix with the specified row-major ordered matrix
+%%
+%% ``gl:loadTransposeMatrix'' replaces the current matrix with the one whose elements are
+%% specified by `M' . The current matrix is the projection matrix, modelview matrix,
+%% or texture matrix, depending on the current matrix mode (see {@link gl:matrixMode/1} ).
+%%
+%% The current matrix, M, defines a transformation of coordinates. For instance, assume
+%% M refers to the modelview matrix. If v=(v[0] v[1] v[2] v[3]) is the set of object coordinates of a vertex,
+%% and `M' points to an array of 16 single- or double-precision floating-point values
+%% m={m[0] m[1] ... m[15]}, then the modelview transformation M(v) does the following:
+%%
+%% M(v)=(m[0] m[1] m[2] m[3] m[4] m[5] m[6] m[7] m[8] m[9] m[10] m[11] m[12] m[13] m[14] m[15])*(v[0] v[1] v[2] v[3])
+%%
+%% Projection and texture transformations are similarly defined.
+%%
+%% Calling ``gl:loadTransposeMatrix'' with matrix M is identical in operation to {@link gl:loadMatrixd/1}
+%% with M T, where T represents the transpose.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLoadTransposeMatrix.xml">external</a> documentation.
+-spec loadTransposeMatrixf(M) -> ok when M :: matrix().
loadTransposeMatrixf({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
cast(5390, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,M13:?GLfloat,M14:?GLfloat,M15:?GLfloat,M16:?GLfloat>>);
loadTransposeMatrixf({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
cast(5390, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,0:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,0:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,0:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,1:?GLfloat>>).
-%% @spec (M::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLoadTransposeMatrix.xml">external</a> documentation.
--spec loadTransposeMatrixd({float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok.
+%% @doc
+%% See {@link loadTransposeMatrixf/1}
+-spec loadTransposeMatrixd(M) -> ok when M :: matrix().
loadTransposeMatrixd({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
cast(5391, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,M13:?GLdouble,M14:?GLdouble,M15:?GLdouble,M16:?GLdouble>>);
loadTransposeMatrixd({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
cast(5391, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,0:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,0:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,0:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,1:?GLdouble>>).
-%% @spec (M::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultTransposeMatrix.xml">external</a> documentation.
--spec multTransposeMatrixf({float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok.
+%% @doc Multiply the current matrix with the specified row-major ordered matrix
+%%
+%% ``gl:multTransposeMatrix'' multiplies the current matrix with the one specified using `M'
+%% , and replaces the current matrix with the product.
+%%
+%% The current matrix is determined by the current matrix mode (see {@link gl:matrixMode/1} ).
+%% It is either the projection matrix, modelview matrix, or the texture matrix.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultTransposeMatrix.xml">external</a> documentation.
+-spec multTransposeMatrixf(M) -> ok when M :: matrix().
multTransposeMatrixf({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
cast(5392, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,M13:?GLfloat,M14:?GLfloat,M15:?GLfloat,M16:?GLfloat>>);
multTransposeMatrixf({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
cast(5392, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,0:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,0:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,0:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,1:?GLfloat>>).
-%% @spec (M::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultTransposeMatrix.xml">external</a> documentation.
--spec multTransposeMatrixd({float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok.
+%% @doc
+%% See {@link multTransposeMatrixf/1}
+-spec multTransposeMatrixd(M) -> ok when M :: matrix().
multTransposeMatrixd({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
cast(5393, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,M13:?GLdouble,M14:?GLdouble,M15:?GLdouble,M16:?GLdouble>>);
multTransposeMatrixd({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
cast(5393, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,0:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,0:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,0:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,1:?GLdouble>>).
-%% @spec (SfactorRGB::enum(),DfactorRGB::enum(),SfactorAlpha::enum(),DfactorAlpha::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlendFuncSeparate.xml">external</a> documentation.
--spec blendFuncSeparate(enum(),enum(),enum(),enum()) -> ok.
+%% @doc Specify pixel arithmetic for RGB and alpha components separately
+%%
+%% Pixels can be drawn using a function that blends the incoming (source) RGBA values with
+%% the RGBA values that are already in the frame buffer (the destination values). Blending
+%% is initially disabled. Use {@link gl:enable/1} and {@link gl:enable/1} with argument `?GL_BLEND'
+%% to enable and disable blending.
+%%
+%% ``gl:blendFuncSeparate'' defines the operation of blending for all draw buffers when
+%% it is enabled. ``gl:blendFuncSeparatei'' defines the operation of blending for a single
+%% draw buffer specified by `Buf' when enabled for that draw buffer. `SrcRGB' specifies
+%% which method is used to scale the source RGB-color components. `DstRGB' specifies
+%% which method is used to scale the destination RGB-color components. Likewise, `SrcAlpha'
+%% specifies which method is used to scale the source alpha color component, and `DstAlpha'
+%% specifies which method is used to scale the destination alpha component. The possible
+%% methods are described in the following table. Each method defines four scale factors,
+%% one each for red, green, blue, and alpha.
+%%
+%% In the table and in subsequent equations, first source, second source and destination
+%% color components are referred to as (R s0 G s0 B s0 A s0), (R s1 G s1 B s1 A s1), and (R d G d B d A d), respectively. The color specified by {@link gl:blendColor/4}
+%% is referred to as (R c G c B c A c). They are understood to have integer values between 0 and (k R k G k B
+%% k A), where
+%%
+%% k c= 2(m c)-1
+%%
+%% and (m R m G m B m A) is the number of red, green, blue, and alpha bitplanes.
+%%
+%% Source and destination scale factors are referred to as (s R s G s B s A) and (d R d G d B d A). All scale factors have
+%% range [0 1].
+%%
+%% <table><tbody><tr><td>` Parameter '</td><td>` RGB Factor '</td><td>` Alpha Factor '
+%% </td></tr></tbody><tbody><tr><td>`?GL_ZERO'</td><td>(0 0 0)</td><td> 0</td></tr><tr><td>`?GL_ONE'
+%% </td><td>(1 1 1)</td><td> 1</td></tr><tr><td>`?GL_SRC_COLOR'</td><td>(R s0 k/R G s0 k/G B s0
+%% k/B)</td><td> A s0 k/A</td>
+%% </tr><tr><td>`?GL_ONE_MINUS_SRC_COLOR'</td><td>(1 1 1 1)-(R s0 k/R G s0 k/G B s0 k/B)</td><td> 1-A s0 k/A</td></tr><tr><td>
+%% `?GL_DST_COLOR'</td><td>(R d k/R G d k/G B d k/B)</td><td> A d k/A</td></tr><tr><td>`?GL_ONE_MINUS_DST_COLOR'
+%% </td><td>(1 1 1)-(R d k/R G d k/G B d k/B)</td><td> 1-A d k/A</td></tr><tr><td>`?GL_SRC_ALPHA'</td><td>(A s0 k/A A s0
+%% k/A A s0 k/A)</td><td> A
+%% s0 k/A</td></tr><tr><td>`?GL_ONE_MINUS_SRC_ALPHA'</td><td>(1 1 1)-(A s0 k/A A s0 k/A A s0 k/A
+%% )</td><td> 1-A s0 k/A</td></tr>
+%% <tr><td>`?GL_DST_ALPHA'</td><td>(A d k/A A d k/A A d k/A)</td><td> A d k/A</td></tr><tr><td>`?GL_ONE_MINUS_DST_ALPHA'
+%% </td><td>(1 1 1)-(A d k/A A d k/A A d k/A)</td><td> 1-A d k/A</td></tr><tr><td>`?GL_CONSTANT_COLOR'</td><td>(R c G c
+%% B c)</td><td>
+%% A c</td></tr><tr><td>`?GL_ONE_MINUS_CONSTANT_COLOR'</td><td>(1 1 1)-(R c G c B c)</td><td> 1-A c</td></tr>
+%% <tr><td>`?GL_CONSTANT_ALPHA'</td><td>(A c A c A c)</td><td> A c</td></tr><tr><td>`?GL_ONE_MINUS_CONSTANT_ALPHA'
+%% </td><td>(1 1 1)-(A c A c A c)</td><td> 1-A c</td></tr><tr><td>`?GL_SRC_ALPHA_SATURATE'</td><td>(i i i)</td><td>
+%% 1</td></tr><tr><td>`?GL_SRC1_COLOR'</td><td>(R s1 k/R G s1 k/G B s1 k/B)</td><td> A s1 k/A</td></tr><tr><td>`?GL_ONE_MINUS_SRC_COLOR'
+%% </td><td>(1 1 1 1)-(R s1 k/R G s1 k/G B s1 k/B)</td><td> 1-A s1 k/A</td></tr><tr><td>`?GL_SRC1_ALPHA'</td><td>(A s1 k/A A
+%% s1 k/A A s1 k/A)</td><td> A
+%% s1 k/A</td></tr><tr><td>`?GL_ONE_MINUS_SRC_ALPHA'</td><td>(1 1 1)-(A s1 k/A A s1 k/A A s1 k/A
+%% )</td><td> 1-A s1 k/A</td></tr>
+%% </tbody></table>
+%%
+%% In the table,
+%%
+%% i= min(A s 1-(A d))
+%%
+%% To determine the blended RGBA values of a pixel, the system uses the following equations:
+%%
+%%
+%% R d= min(k R R s s R+R d d R) G d= min(k G G s s G+G d d G) B d= min(k B B s s B+B d d B) A d= min(k A A s s A+A d d A)
+%%
+%% Despite the apparent precision of the above equations, blending arithmetic is not exactly
+%% specified, because blending operates with imprecise integer color values. However, a blend
+%% factor that should be equal to 1 is guaranteed not to modify its multiplicand, and a blend
+%% factor equal to 0 reduces its multiplicand to 0. For example, when `SrcRGB' is `?GL_SRC_ALPHA'
+%% , `DstRGB' is `?GL_ONE_MINUS_SRC_ALPHA', and A s is equal to k A, the equations
+%% reduce to simple replacement:
+%%
+%% R d= R s G d= G s B d= B s A d= A s
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlendFuncSeparate.xml">external</a> documentation.
+-spec blendFuncSeparate(SfactorRGB, DfactorRGB, SfactorAlpha, DfactorAlpha) -> ok when SfactorRGB :: enum(),DfactorRGB :: enum(),SfactorAlpha :: enum(),DfactorAlpha :: enum().
blendFuncSeparate(SfactorRGB,DfactorRGB,SfactorAlpha,DfactorAlpha) ->
cast(5394, <<SfactorRGB:?GLenum,DfactorRGB:?GLenum,SfactorAlpha:?GLenum,DfactorAlpha:?GLenum>>).
-%% @spec (Mode::enum(),First::[integer()],Count::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiDrawArrays.xml">external</a> documentation.
--spec multiDrawArrays(enum(),[integer()],[integer()]) -> ok.
+%% @doc Render multiple sets of primitives from array data
+%%
+%% ``gl:multiDrawArrays'' specifies multiple sets of geometric primitives with very few
+%% subroutine calls. Instead of calling a GL procedure to pass each individual vertex, normal,
+%% texture coordinate, edge flag, or color, you can prespecify separate arrays of vertices,
+%% normals, and colors and use them to construct a sequence of primitives with a single call
+%% to ``gl:multiDrawArrays''.
+%%
+%% ``gl:multiDrawArrays'' behaves identically to {@link gl:drawArrays/3} except that `Primcount'
+%% separate ranges of elements are specified instead.
+%%
+%% When ``gl:multiDrawArrays'' is called, it uses `Count' sequential elements from
+%% each enabled array to construct a sequence of geometric primitives, beginning with element
+%% `First' . `Mode' specifies what kind of primitives are constructed, and how the
+%% array elements construct those primitives.
+%%
+%% Vertex attributes that are modified by ``gl:multiDrawArrays'' have an unspecified value
+%% after ``gl:multiDrawArrays'' returns. Attributes that aren't modified remain well defined.
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultiDrawArrays.xml">external</a> documentation.
+-spec multiDrawArrays(Mode, First, Count) -> ok when Mode :: enum(),First :: [integer()],Count :: [integer()].
multiDrawArrays(Mode,First,Count) ->
cast(5395, <<Mode:?GLenum,(length(First)):?GLuint,
(<< <<C:?GLint>> || C <- First>>)/binary,0:(((length(First)) rem 2)*32),(length(Count)):?GLuint,
(<< <<C:?GLsizei>> || C <- Count>>)/binary,0:(((1+length(Count)) rem 2)*32)>>).
-%% @spec (Pname::enum(),Param::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPointParameter.xml">external</a> documentation.
--spec pointParameterf(enum(),float()) -> ok.
+%% @doc Specify point parameters
+%%
+%% The following values are accepted for `Pname' :
+%%
+%% `?GL_POINT_FADE_THRESHOLD_SIZE': `Params' is a single floating-point value that
+%% specifies the threshold value to which point sizes are clamped if they exceed the specified
+%% value. The default value is 1.0.
+%%
+%% `?GL_POINT_SPRITE_COORD_ORIGIN': `Params' is a single enum specifying the point
+%% sprite texture coordinate origin, either `?GL_LOWER_LEFT' or `?GL_UPPER_LEFT'.
+%% The default value is `?GL_UPPER_LEFT'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPointParameter.xml">external</a> documentation.
+-spec pointParameterf(Pname, Param) -> ok when Pname :: enum(),Param :: float().
pointParameterf(Pname,Param) ->
cast(5396, <<Pname:?GLenum,Param:?GLfloat>>).
-%% @spec (Pname::enum(),Params::{float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPointParameter.xml">external</a> documentation.
--spec pointParameterfv(enum(),{float()}) -> ok.
+%% @doc
+%% See {@link pointParameterf/2}
+-spec pointParameterfv(Pname, Params) -> ok when Pname :: enum(),Params :: {float()}.
pointParameterfv(Pname,Params) ->
cast(5397, <<Pname:?GLenum,(size(Params)):?GLuint,
(<< <<C:?GLfloat>> ||C <- tuple_to_list(Params)>>)/binary,0:(((0+size(Params)) rem 2)*32)>>).
-%% @spec (Pname::enum(),Param::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPointParameter.xml">external</a> documentation.
--spec pointParameteri(enum(),integer()) -> ok.
+%% @doc
+%% See {@link pointParameterf/2}
+-spec pointParameteri(Pname, Param) -> ok when Pname :: enum(),Param :: integer().
pointParameteri(Pname,Param) ->
cast(5398, <<Pname:?GLenum,Param:?GLint>>).
-%% @spec (Pname::enum(),Params::{integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPointParameter.xml">external</a> documentation.
--spec pointParameteriv(enum(),{integer()}) -> ok.
+%% @doc
+%% See {@link pointParameterf/2}
+-spec pointParameteriv(Pname, Params) -> ok when Pname :: enum(),Params :: {integer()}.
pointParameteriv(Pname,Params) ->
cast(5399, <<Pname:?GLenum,(size(Params)):?GLuint,
(<< <<C:?GLint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((0+size(Params)) rem 2)*32)>>).
-%% @spec (Coord::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFogCoord.xml">external</a> documentation.
--spec fogCoordf(float()) -> ok.
+%% @doc Set the current fog coordinates
+%%
+%% ``gl:fogCoord'' specifies the fog coordinate that is associated with each vertex and
+%% the current raster position. The value specified is interpolated and used in computing
+%% the fog color (see {@link gl:fogf/2} ).
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFogCoord.xml">external</a> documentation.
+-spec fogCoordf(Coord) -> ok when Coord :: float().
fogCoordf(Coord) ->
cast(5400, <<Coord:?GLfloat>>).
-%% @spec ({Coord}) -> ok
%% @equiv fogCoordf(Coord)
--spec fogCoordfv({float()}) -> ok.
+-spec fogCoordfv(Coord) -> ok when Coord :: {Coord :: float()}.
fogCoordfv({Coord}) -> fogCoordf(Coord).
-%% @spec (Coord::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFogCoord.xml">external</a> documentation.
--spec fogCoordd(float()) -> ok.
+%% @doc
+%% See {@link fogCoordf/1}
+-spec fogCoordd(Coord) -> ok when Coord :: float().
fogCoordd(Coord) ->
cast(5401, <<Coord:?GLdouble>>).
-%% @spec ({Coord}) -> ok
%% @equiv fogCoordd(Coord)
--spec fogCoorddv({float()}) -> ok.
+-spec fogCoorddv(Coord) -> ok when Coord :: {Coord :: float()}.
fogCoorddv({Coord}) -> fogCoordd(Coord).
-%% @spec (Type::enum(),Stride::integer(),Pointer::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFogCoordPointer.xml">external</a> documentation.
--spec fogCoordPointer(enum(),integer(),offset()|mem()) -> ok.
+%% @doc Define an array of fog coordinates
+%%
+%% ``gl:fogCoordPointer'' specifies the location and data format of an array of fog coordinates
+%% to use when rendering. `Type' specifies the data type of each fog coordinate, and `Stride'
+%% specifies the byte stride from one fog coordinate to the next, allowing vertices and
+%% attributes to be packed into a single array or stored in separate arrays.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_ARRAY_BUFFER' target (see {@link gl:bindBuffer/2}
+%% ) while a fog coordinate array is specified, `Pointer' is treated as a byte offset
+%% into the buffer object's data store. Also, the buffer object binding (`?GL_ARRAY_BUFFER_BINDING'
+%% ) is saved as fog coordinate vertex array client-side state (`?GL_FOG_COORD_ARRAY_BUFFER_BINDING'
+%% ).
+%%
+%% When a fog coordinate array is specified, `Type' , `Stride' , and `Pointer'
+%% are saved as client-side state, in addition to the current vertex array buffer object
+%% binding.
+%%
+%% To enable and disable the fog coordinate array, call {@link gl:enableClientState/1} and {@link gl:enableClientState/1}
+%% with the argument `?GL_FOG_COORD_ARRAY'. If enabled, the fog coordinate array is
+%% used when {@link gl:drawArrays/3} , {@link gl:multiDrawArrays/3} , {@link gl:drawElements/4} , see `glMultiDrawElements'
+%% , {@link gl:drawRangeElements/6} , or {@link gl:arrayElement/1} is called.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFogCoordPointer.xml">external</a> documentation.
+-spec fogCoordPointer(Type, Stride, Pointer) -> ok when Type :: enum(),Stride :: integer(),Pointer :: offset()|mem().
fogCoordPointer(Type,Stride,Pointer) when is_integer(Pointer) ->
cast(5402, <<Type:?GLenum,Stride:?GLsizei,Pointer:?GLuint>>);
fogCoordPointer(Type,Stride,Pointer) ->
send_bin(Pointer),
cast(5403, <<Type:?GLenum,Stride:?GLsizei>>).
-%% @spec (Red::integer(),Green::integer(),Blue::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSecondaryColor.xml">external</a> documentation.
--spec secondaryColor3b(integer(),integer(),integer()) -> ok.
+%% @doc Set the current secondary color
+%%
+%% The GL stores both a primary four-valued RGBA color and a secondary four-valued RGBA
+%% color (where alpha is always set to 0.0) that is associated with every vertex.
+%%
+%% The secondary color is interpolated and applied to each fragment during rasterization
+%% when `?GL_COLOR_SUM' is enabled. When lighting is enabled, and `?GL_SEPARATE_SPECULAR_COLOR'
+%% is specified, the value of the secondary color is assigned the value computed from the
+%% specular term of the lighting computation. Both the primary and secondary current colors
+%% are applied to each fragment, regardless of the state of `?GL_COLOR_SUM', under such
+%% conditions. When `?GL_SEPARATE_SPECULAR_COLOR' is specified, the value returned from
+%% querying the current secondary color is undefined.
+%%
+%% ``gl:secondaryColor3b'', ``gl:secondaryColor3s'', and ``gl:secondaryColor3i'' take
+%% three signed byte, short, or long integers as arguments. When `v' is appended to
+%% the name, the color commands can take a pointer to an array of such values.
+%%
+%% Color values are stored in floating-point format, with unspecified mantissa and exponent
+%% sizes. Unsigned integer color components, when specified, are linearly mapped to floating-point
+%% values such that the largest representable value maps to 1.0 (full intensity), and 0 maps
+%% to 0.0 (zero intensity). Signed integer color components, when specified, are linearly
+%% mapped to floating-point values such that the most positive representable value maps to
+%% 1.0, and the most negative representable value maps to -1.0. (Note that this mapping
+%% does not convert 0 precisely to 0.0). Floating-point values are mapped directly.
+%%
+%% Neither floating-point nor signed integer values are clamped to the range [0 1] before the
+%% current color is updated. However, color components are clamped to this range before they
+%% are interpolated or written into a color buffer.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSecondaryColor.xml">external</a> documentation.
+-spec secondaryColor3b(Red, Green, Blue) -> ok when Red :: integer(),Green :: integer(),Blue :: integer().
secondaryColor3b(Red,Green,Blue) ->
cast(5404, <<Red:?GLbyte,Green:?GLbyte,Blue:?GLbyte>>).
-%% @spec ({Red,Green,Blue}) -> ok
%% @equiv secondaryColor3b(Red,Green,Blue)
--spec secondaryColor3bv({integer(),integer(),integer()}) -> ok.
+-spec secondaryColor3bv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer()}.
secondaryColor3bv({Red,Green,Blue}) -> secondaryColor3b(Red,Green,Blue).
-%% @spec (Red::float(),Green::float(),Blue::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSecondaryColor.xml">external</a> documentation.
--spec secondaryColor3d(float(),float(),float()) -> ok.
+%% @doc
+%% See {@link secondaryColor3b/3}
+-spec secondaryColor3d(Red, Green, Blue) -> ok when Red :: float(),Green :: float(),Blue :: float().
secondaryColor3d(Red,Green,Blue) ->
cast(5405, <<Red:?GLdouble,Green:?GLdouble,Blue:?GLdouble>>).
-%% @spec ({Red,Green,Blue}) -> ok
%% @equiv secondaryColor3d(Red,Green,Blue)
--spec secondaryColor3dv({float(),float(),float()}) -> ok.
+-spec secondaryColor3dv(V) -> ok when V :: {Red :: float(),Green :: float(),Blue :: float()}.
secondaryColor3dv({Red,Green,Blue}) -> secondaryColor3d(Red,Green,Blue).
-%% @spec (Red::float(),Green::float(),Blue::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSecondaryColor.xml">external</a> documentation.
--spec secondaryColor3f(float(),float(),float()) -> ok.
+%% @doc
+%% See {@link secondaryColor3b/3}
+-spec secondaryColor3f(Red, Green, Blue) -> ok when Red :: float(),Green :: float(),Blue :: float().
secondaryColor3f(Red,Green,Blue) ->
cast(5406, <<Red:?GLfloat,Green:?GLfloat,Blue:?GLfloat>>).
-%% @spec ({Red,Green,Blue}) -> ok
%% @equiv secondaryColor3f(Red,Green,Blue)
--spec secondaryColor3fv({float(),float(),float()}) -> ok.
+-spec secondaryColor3fv(V) -> ok when V :: {Red :: float(),Green :: float(),Blue :: float()}.
secondaryColor3fv({Red,Green,Blue}) -> secondaryColor3f(Red,Green,Blue).
-%% @spec (Red::integer(),Green::integer(),Blue::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSecondaryColor.xml">external</a> documentation.
--spec secondaryColor3i(integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link secondaryColor3b/3}
+-spec secondaryColor3i(Red, Green, Blue) -> ok when Red :: integer(),Green :: integer(),Blue :: integer().
secondaryColor3i(Red,Green,Blue) ->
cast(5407, <<Red:?GLint,Green:?GLint,Blue:?GLint>>).
-%% @spec ({Red,Green,Blue}) -> ok
%% @equiv secondaryColor3i(Red,Green,Blue)
--spec secondaryColor3iv({integer(),integer(),integer()}) -> ok.
+-spec secondaryColor3iv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer()}.
secondaryColor3iv({Red,Green,Blue}) -> secondaryColor3i(Red,Green,Blue).
-%% @spec (Red::integer(),Green::integer(),Blue::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSecondaryColor.xml">external</a> documentation.
--spec secondaryColor3s(integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link secondaryColor3b/3}
+-spec secondaryColor3s(Red, Green, Blue) -> ok when Red :: integer(),Green :: integer(),Blue :: integer().
secondaryColor3s(Red,Green,Blue) ->
cast(5408, <<Red:?GLshort,Green:?GLshort,Blue:?GLshort>>).
-%% @spec ({Red,Green,Blue}) -> ok
%% @equiv secondaryColor3s(Red,Green,Blue)
--spec secondaryColor3sv({integer(),integer(),integer()}) -> ok.
+-spec secondaryColor3sv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer()}.
secondaryColor3sv({Red,Green,Blue}) -> secondaryColor3s(Red,Green,Blue).
-%% @spec (Red::integer(),Green::integer(),Blue::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSecondaryColor.xml">external</a> documentation.
--spec secondaryColor3ub(integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link secondaryColor3b/3}
+-spec secondaryColor3ub(Red, Green, Blue) -> ok when Red :: integer(),Green :: integer(),Blue :: integer().
secondaryColor3ub(Red,Green,Blue) ->
cast(5409, <<Red:?GLubyte,Green:?GLubyte,Blue:?GLubyte>>).
-%% @spec ({Red,Green,Blue}) -> ok
%% @equiv secondaryColor3ub(Red,Green,Blue)
--spec secondaryColor3ubv({integer(),integer(),integer()}) -> ok.
+-spec secondaryColor3ubv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer()}.
secondaryColor3ubv({Red,Green,Blue}) -> secondaryColor3ub(Red,Green,Blue).
-%% @spec (Red::integer(),Green::integer(),Blue::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSecondaryColor.xml">external</a> documentation.
--spec secondaryColor3ui(integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link secondaryColor3b/3}
+-spec secondaryColor3ui(Red, Green, Blue) -> ok when Red :: integer(),Green :: integer(),Blue :: integer().
secondaryColor3ui(Red,Green,Blue) ->
cast(5410, <<Red:?GLuint,Green:?GLuint,Blue:?GLuint>>).
-%% @spec ({Red,Green,Blue}) -> ok
%% @equiv secondaryColor3ui(Red,Green,Blue)
--spec secondaryColor3uiv({integer(),integer(),integer()}) -> ok.
+-spec secondaryColor3uiv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer()}.
secondaryColor3uiv({Red,Green,Blue}) -> secondaryColor3ui(Red,Green,Blue).
-%% @spec (Red::integer(),Green::integer(),Blue::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSecondaryColor.xml">external</a> documentation.
--spec secondaryColor3us(integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link secondaryColor3b/3}
+-spec secondaryColor3us(Red, Green, Blue) -> ok when Red :: integer(),Green :: integer(),Blue :: integer().
secondaryColor3us(Red,Green,Blue) ->
cast(5411, <<Red:?GLushort,Green:?GLushort,Blue:?GLushort>>).
-%% @spec ({Red,Green,Blue}) -> ok
%% @equiv secondaryColor3us(Red,Green,Blue)
--spec secondaryColor3usv({integer(),integer(),integer()}) -> ok.
+-spec secondaryColor3usv(V) -> ok when V :: {Red :: integer(),Green :: integer(),Blue :: integer()}.
secondaryColor3usv({Red,Green,Blue}) -> secondaryColor3us(Red,Green,Blue).
-%% @spec (Size::integer(),Type::enum(),Stride::integer(),Pointer::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSecondaryColorPointer.xml">external</a> documentation.
--spec secondaryColorPointer(integer(),enum(),integer(),offset()|mem()) -> ok.
+%% @doc Define an array of secondary colors
+%%
+%% ``gl:secondaryColorPointer'' specifies the location and data format of an array of color
+%% components to use when rendering. `Size' specifies the number of components per color,
+%% and must be 3. `Type' specifies the data type of each color component, and `Stride'
+%% specifies the byte stride from one color to the next, allowing vertices and attributes
+%% to be packed into a single array or stored in separate arrays.
+%%
+%% If a non-zero named buffer object is bound to the `?GL_ARRAY_BUFFER' target (see {@link gl:bindBuffer/2}
+%% ) while a secondary color array is specified, `Pointer' is treated as a byte offset
+%% into the buffer object's data store. Also, the buffer object binding (`?GL_ARRAY_BUFFER_BINDING'
+%% ) is saved as secondary color vertex array client-side state (`?GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING'
+%% ).
+%%
+%% When a secondary color array is specified, `Size' , `Type' , `Stride' , and `Pointer'
+%% are saved as client-side state, in addition to the current vertex array buffer object
+%% binding.
+%%
+%% To enable and disable the secondary color array, call {@link gl:enableClientState/1} and {@link gl:enableClientState/1}
+%% with the argument `?GL_SECONDARY_COLOR_ARRAY'. If enabled, the secondary color array
+%% is used when {@link gl:arrayElement/1} , {@link gl:drawArrays/3} , {@link gl:multiDrawArrays/3} ,
+%% {@link gl:drawElements/4} , see `glMultiDrawElements', or {@link gl:drawRangeElements/6}
+%% is called.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSecondaryColorPointer.xml">external</a> documentation.
+-spec secondaryColorPointer(Size, Type, Stride, Pointer) -> ok when Size :: integer(),Type :: enum(),Stride :: integer(),Pointer :: offset()|mem().
secondaryColorPointer(Size,Type,Stride,Pointer) when is_integer(Pointer) ->
cast(5412, <<Size:?GLint,Type:?GLenum,Stride:?GLsizei,Pointer:?GLuint>>);
secondaryColorPointer(Size,Type,Stride,Pointer) ->
send_bin(Pointer),
cast(5413, <<Size:?GLint,Type:?GLenum,Stride:?GLsizei>>).
-%% @spec (X::float(),Y::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWindowPos.xml">external</a> documentation.
--spec windowPos2d(float(),float()) -> ok.
+%% @doc Specify the raster position in window coordinates for pixel operations
+%%
+%% The GL maintains a 3D position in window coordinates. This position, called the raster
+%% position, is used to position pixel and bitmap write operations. It is maintained with
+%% subpixel accuracy. See {@link gl:bitmap/7} , {@link gl:drawPixels/5} , and {@link gl:copyPixels/5}
+%% .
+%%
+%% ``gl:windowPos2'' specifies the x and y coordinates, while z is implicitly set
+%% to 0. ``gl:windowPos3'' specifies all three coordinates. The w coordinate of the current
+%% raster position is always set to 1.0.
+%%
+%% ``gl:windowPos'' directly updates the x and y coordinates of the current raster
+%% position with the values specified. That is, the values are neither transformed by the
+%% current modelview and projection matrices, nor by the viewport-to-window transform. The
+%% z coordinate of the current raster position is updated in the following manner:
+%%
+%% z={n f(n+z*(f-n)) if z&lt;= 0 if z&gt;= 1(otherwise))
+%%
+%% where n is `?GL_DEPTH_RANGE''s near value, and f is `?GL_DEPTH_RANGE''s
+%% far value. See {@link gl:depthRange/2} .
+%%
+%% The specified coordinates are not clip-tested, causing the raster position to always
+%% be valid.
+%%
+%% The current raster position also includes some associated color data and texture coordinates.
+%% If lighting is enabled, then `?GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `?GL_CURRENT_RASTER_INDEX'
+%% (in color index mode) is set to the color produced by the lighting calculation (see {@link gl:lightf/3}
+%% , {@link gl:lightModelf/2} , and {@link gl:shadeModel/1} ). If lighting is disabled, current
+%% color (in RGBA mode, state variable `?GL_CURRENT_COLOR') or color index (in color
+%% index mode, state variable `?GL_CURRENT_INDEX') is used to update the current raster
+%% color. `?GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
+%%
+%% Likewise, `?GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of `?GL_CURRENT_TEXTURE_COORDS'
+%% , based on the texture matrix and the texture generation functions (see {@link gl:texGend/3} ).
+%% The `?GL_CURRENT_RASTER_DISTANCE' is set to the `?GL_CURRENT_FOG_COORD'.
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWindowPos.xml">external</a> documentation.
+-spec windowPos2d(X, Y) -> ok when X :: float(),Y :: float().
windowPos2d(X,Y) ->
cast(5414, <<X:?GLdouble,Y:?GLdouble>>).
-%% @spec ({X,Y}) -> ok
%% @equiv windowPos2d(X,Y)
--spec windowPos2dv({float(),float()}) -> ok.
+-spec windowPos2dv(V) -> ok when V :: {X :: float(),Y :: float()}.
windowPos2dv({X,Y}) -> windowPos2d(X,Y).
-%% @spec (X::float(),Y::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWindowPos.xml">external</a> documentation.
--spec windowPos2f(float(),float()) -> ok.
+%% @doc
+%% See {@link windowPos2d/2}
+-spec windowPos2f(X, Y) -> ok when X :: float(),Y :: float().
windowPos2f(X,Y) ->
cast(5415, <<X:?GLfloat,Y:?GLfloat>>).
-%% @spec ({X,Y}) -> ok
%% @equiv windowPos2f(X,Y)
--spec windowPos2fv({float(),float()}) -> ok.
+-spec windowPos2fv(V) -> ok when V :: {X :: float(),Y :: float()}.
windowPos2fv({X,Y}) -> windowPos2f(X,Y).
-%% @spec (X::integer(),Y::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWindowPos.xml">external</a> documentation.
--spec windowPos2i(integer(),integer()) -> ok.
+%% @doc
+%% See {@link windowPos2d/2}
+-spec windowPos2i(X, Y) -> ok when X :: integer(),Y :: integer().
windowPos2i(X,Y) ->
cast(5416, <<X:?GLint,Y:?GLint>>).
-%% @spec ({X,Y}) -> ok
%% @equiv windowPos2i(X,Y)
--spec windowPos2iv({integer(),integer()}) -> ok.
+-spec windowPos2iv(V) -> ok when V :: {X :: integer(),Y :: integer()}.
windowPos2iv({X,Y}) -> windowPos2i(X,Y).
-%% @spec (X::integer(),Y::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWindowPos.xml">external</a> documentation.
--spec windowPos2s(integer(),integer()) -> ok.
+%% @doc
+%% See {@link windowPos2d/2}
+-spec windowPos2s(X, Y) -> ok when X :: integer(),Y :: integer().
windowPos2s(X,Y) ->
cast(5417, <<X:?GLshort,Y:?GLshort>>).
-%% @spec ({X,Y}) -> ok
%% @equiv windowPos2s(X,Y)
--spec windowPos2sv({integer(),integer()}) -> ok.
+-spec windowPos2sv(V) -> ok when V :: {X :: integer(),Y :: integer()}.
windowPos2sv({X,Y}) -> windowPos2s(X,Y).
-%% @spec (X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWindowPos.xml">external</a> documentation.
--spec windowPos3d(float(),float(),float()) -> ok.
+%% @doc
+%% See {@link windowPos2d/2}
+-spec windowPos3d(X, Y, Z) -> ok when X :: float(),Y :: float(),Z :: float().
windowPos3d(X,Y,Z) ->
cast(5418, <<X:?GLdouble,Y:?GLdouble,Z:?GLdouble>>).
-%% @spec ({X,Y,Z}) -> ok
%% @equiv windowPos3d(X,Y,Z)
--spec windowPos3dv({float(),float(),float()}) -> ok.
+-spec windowPos3dv(V) -> ok when V :: {X :: float(),Y :: float(),Z :: float()}.
windowPos3dv({X,Y,Z}) -> windowPos3d(X,Y,Z).
-%% @spec (X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWindowPos.xml">external</a> documentation.
--spec windowPos3f(float(),float(),float()) -> ok.
+%% @doc
+%% See {@link windowPos2d/2}
+-spec windowPos3f(X, Y, Z) -> ok when X :: float(),Y :: float(),Z :: float().
windowPos3f(X,Y,Z) ->
cast(5419, <<X:?GLfloat,Y:?GLfloat,Z:?GLfloat>>).
-%% @spec ({X,Y,Z}) -> ok
%% @equiv windowPos3f(X,Y,Z)
--spec windowPos3fv({float(),float(),float()}) -> ok.
+-spec windowPos3fv(V) -> ok when V :: {X :: float(),Y :: float(),Z :: float()}.
windowPos3fv({X,Y,Z}) -> windowPos3f(X,Y,Z).
-%% @spec (X::integer(),Y::integer(),Z::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWindowPos.xml">external</a> documentation.
--spec windowPos3i(integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link windowPos2d/2}
+-spec windowPos3i(X, Y, Z) -> ok when X :: integer(),Y :: integer(),Z :: integer().
windowPos3i(X,Y,Z) ->
cast(5420, <<X:?GLint,Y:?GLint,Z:?GLint>>).
-%% @spec ({X,Y,Z}) -> ok
%% @equiv windowPos3i(X,Y,Z)
--spec windowPos3iv({integer(),integer(),integer()}) -> ok.
+-spec windowPos3iv(V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer()}.
windowPos3iv({X,Y,Z}) -> windowPos3i(X,Y,Z).
-%% @spec (X::integer(),Y::integer(),Z::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWindowPos.xml">external</a> documentation.
--spec windowPos3s(integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link windowPos2d/2}
+-spec windowPos3s(X, Y, Z) -> ok when X :: integer(),Y :: integer(),Z :: integer().
windowPos3s(X,Y,Z) ->
cast(5421, <<X:?GLshort,Y:?GLshort,Z:?GLshort>>).
-%% @spec ({X,Y,Z}) -> ok
%% @equiv windowPos3s(X,Y,Z)
--spec windowPos3sv({integer(),integer(),integer()}) -> ok.
+-spec windowPos3sv(V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer()}.
windowPos3sv({X,Y,Z}) -> windowPos3s(X,Y,Z).
-%% @spec (N::integer()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenQueries.xml">external</a> documentation.
--spec genQueries(integer()) -> [integer()].
+%% @doc Generate query object names
+%%
+%% ``gl:genQueries'' returns `N' query object names in `Ids' . There is no guarantee
+%% that the names form a contiguous set of integers; however, it is guaranteed that none
+%% of the returned names was in use immediately before the call to ``gl:genQueries''.
+%%
+%% Query object names returned by a call to ``gl:genQueries'' are not returned by subsequent
+%% calls, unless they are first deleted with {@link gl:deleteQueries/1} .
+%%
+%% No query objects are associated with the returned query object names until they are first
+%% used by calling {@link gl:beginQuery/2} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenQueries.xml">external</a> documentation.
+-spec genQueries(N) -> [integer()] when N :: integer().
genQueries(N) ->
call(5422, <<N:?GLsizei>>).
-%% @spec (Ids::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteQueries.xml">external</a> documentation.
--spec deleteQueries([integer()]) -> ok.
+%% @doc Delete named query objects
+%%
+%% ``gl:deleteQueries'' deletes `N' query objects named by the elements of the array `Ids'
+%% . After a query object is deleted, it has no contents, and its name is free for reuse
+%% (for example by {@link gl:genQueries/1} ).
+%%
+%% ``gl:deleteQueries'' silently ignores 0's and names that do not correspond to existing
+%% query objects.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteQueries.xml">external</a> documentation.
+-spec deleteQueries(Ids) -> ok when Ids :: [integer()].
deleteQueries(Ids) ->
cast(5423, <<(length(Ids)):?GLuint,
(<< <<C:?GLuint>> || C <- Ids>>)/binary,0:(((1+length(Ids)) rem 2)*32)>>).
-%% @spec (Id::integer()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsQuery.xml">external</a> documentation.
--spec isQuery(integer()) -> 0|1.
+%% @doc Determine if a name corresponds to a query object
+%%
+%% ``gl:isQuery'' returns `?GL_TRUE' if `Id' is currently the name of a query
+%% object. If `Id' is zero, or is a non-zero value that is not currently the name of
+%% a query object, or if an error occurs, ``gl:isQuery'' returns `?GL_FALSE'.
+%%
+%% A name returned by {@link gl:genQueries/1} , but not yet associated with a query object
+%% by calling {@link gl:beginQuery/2} , is not the name of a query object.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsQuery.xml">external</a> documentation.
+-spec isQuery(Id) -> 0|1 when Id :: integer().
isQuery(Id) ->
call(5424, <<Id:?GLuint>>).
-%% @spec (Target::enum(),Id::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBeginQuery.xml">external</a> documentation.
--spec beginQuery(enum(),integer()) -> ok.
+%% @doc Delimit the boundaries of a query object
+%%
+%% ``gl:beginQuery'' and {@link gl:beginQuery/2} delimit the boundaries of a query object. `Query'
+%% must be a name previously returned from a call to {@link gl:genQueries/1} . If a query
+%% object with name `Id' does not yet exist it is created with the type determined by `Target'
+%% . `Target' must be one of `?GL_SAMPLES_PASSED', `?GL_ANY_SAMPLES_PASSED', `?GL_PRIMITIVES_GENERATED'
+%% , `?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN', or `?GL_TIME_ELAPSED'. The behavior
+%% of the query object depends on its type and is as follows.
+%%
+%% If `Target' is `?GL_SAMPLES_PASSED', `Id' must be an unused name, or the
+%% name of an existing occlusion query object. When ``gl:beginQuery'' is executed, the
+%% query object's samples-passed counter is reset to 0. Subsequent rendering will increment
+%% the counter for every sample that passes the depth test. If the value of `?GL_SAMPLE_BUFFERS'
+%% is 0, then the samples-passed count is incremented by 1 for each fragment. If the value
+%% of `?GL_SAMPLE_BUFFERS' is 1, then the samples-passed count is incremented by the
+%% number of samples whose coverage bit is set. However, implementations, at their discression
+%% may instead increase the samples-passed count by the value of `?GL_SAMPLES' if any
+%% sample in the fragment is covered. When ``gl:endQuery'' is executed, the samples-passed
+%% counter is assigned to the query object's result value. This value can be queried by calling
+%% {@link gl:getQueryObjectiv/2} with `Pname' `?GL_QUERY_RESULT'.
+%%
+%% If `Target' is `?GL_ANY_SAMPLES_PASSED', `Id' must be an unused name,
+%% or the name of an existing boolean occlusion query object. When ``gl:beginQuery'' is
+%% executed, the query object's samples-passed flag is reset to `?GL_FALSE'. Subsequent
+%% rendering causes the flag to be set to `?GL_TRUE' if any sample passes the depth
+%% test. When ``gl:endQuery'' is executed, the samples-passed flag is assigned to the query
+%% object's result value. This value can be queried by calling {@link gl:getQueryObjectiv/2}
+%% with `Pname' `?GL_QUERY_RESULT'.
+%%
+%% If `Target' is `?GL_PRIMITIVES_GENERATED', `Id' must be an unused name,
+%% or the name of an existing primitive query object previously bound to the `?GL_PRIMITIVES_GENERATED'
+%% query binding. When ``gl:beginQuery'' is executed, the query object's primitives-generated
+%% counter is reset to 0. Subsequent rendering will increment the counter once for every
+%% vertex that is emitted from the geometry shader, or from the vertex shader if no geometry
+%% shader is present. When ``gl:endQuery'' is executed, the primitives-generated counter
+%% is assigned to the query object's result value. This value can be queried by calling {@link gl:getQueryObjectiv/2}
+%% with `Pname' `?GL_QUERY_RESULT'.
+%%
+%% If `Target' is `?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN', `Id' must
+%% be an unused name, or the name of an existing primitive query object previously bound
+%% to the `?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN' query binding. When ``gl:beginQuery''
+%% is executed, the query object's primitives-written counter is reset to 0. Subsequent
+%% rendering will increment the counter once for every vertex that is written into the bound
+%% transform feedback buffer(s). If transform feedback mode is not activated between the
+%% call to ``gl:beginQuery'' and ``gl:endQuery'', the counter will not be incremented.
+%% When ``gl:endQuery'' is executed, the primitives-written counter is assigned to the
+%% query object's result value. This value can be queried by calling {@link gl:getQueryObjectiv/2}
+%% with `Pname' `?GL_QUERY_RESULT'.
+%%
+%% If `Target' is `?GL_TIME_ELAPSED', `Id' must be an unused name, or the
+%% name of an existing timer query object previously bound to the `?GL_TIME_ELAPSED'
+%% query binding. When ``gl:beginQuery'' is executed, the query object's time counter is
+%% reset to 0. When ``gl:endQuery'' is executed, the elapsed server time that has passed
+%% since the call to ``gl:beginQuery'' is written into the query object's time counter.
+%% This value can be queried by calling {@link gl:getQueryObjectiv/2} with `Pname' `?GL_QUERY_RESULT'
+%% .
+%%
+%% Querying the `?GL_QUERY_RESULT' implicitly flushes the GL pipeline until the rendering
+%% delimited by the query object has completed and the result is available. `?GL_QUERY_RESULT_AVAILABLE'
+%% can be queried to determine if the result is immediately available or if the rendering
+%% is not yet complete.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBeginQuery.xml">external</a> documentation.
+-spec beginQuery(Target, Id) -> ok when Target :: enum(),Id :: integer().
beginQuery(Target,Id) ->
cast(5425, <<Target:?GLenum,Id:?GLuint>>).
-%% @spec (Target::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEndQuery.xml">external</a> documentation.
--spec endQuery(enum()) -> ok.
+%% @doc
+%% See {@link beginQuery/2}
+-spec endQuery(Target) -> ok when Target :: enum().
endQuery(Target) ->
cast(5426, <<Target:?GLenum>>).
-%% @spec (Target::enum(),Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetQuery.xml">external</a> documentation.
--spec getQueryiv(enum(),enum()) -> integer().
+%% @doc glGetQuery
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetQuery.xml">external</a> documentation.
+-spec getQueryiv(Target, Pname) -> integer() when Target :: enum(),Pname :: enum().
getQueryiv(Target,Pname) ->
call(5427, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Id::integer(),Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetQueryObject.xml">external</a> documentation.
--spec getQueryObjectiv(integer(),enum()) -> integer().
+%% @doc Return parameters of a query object
+%%
+%% ``gl:getQueryObject'' returns in `Params' a selected parameter of the query object
+%% specified by `Id' .
+%%
+%% `Pname' names a specific query object parameter. `Pname' can be as follows:
+%%
+%% `?GL_QUERY_RESULT': `Params' returns the value of the query object's passed
+%% samples counter. The initial value is 0.
+%%
+%% `?GL_QUERY_RESULT_AVAILABLE': `Params' returns whether the passed samples counter
+%% is immediately available. If a delay would occur waiting for the query result, `?GL_FALSE'
+%% is returned. Otherwise, `?GL_TRUE' is returned, which also indicates that the results
+%% of all previous queries are available as well.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetQueryObject.xml">external</a> documentation.
+-spec getQueryObjectiv(Id, Pname) -> integer() when Id :: integer(),Pname :: enum().
getQueryObjectiv(Id,Pname) ->
call(5428, <<Id:?GLuint,Pname:?GLenum>>).
-%% @spec (Id::integer(),Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetQueryObject.xml">external</a> documentation.
--spec getQueryObjectuiv(integer(),enum()) -> integer().
+%% @doc
+%% See {@link getQueryObjectiv/2}
+-spec getQueryObjectuiv(Id, Pname) -> integer() when Id :: integer(),Pname :: enum().
getQueryObjectuiv(Id,Pname) ->
call(5429, <<Id:?GLuint,Pname:?GLenum>>).
-%% @spec (Target::enum(),Buffer::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindBuffer.xml">external</a> documentation.
--spec bindBuffer(enum(),integer()) -> ok.
+%% @doc Bind a named buffer object
+%%
+%% ``gl:bindBuffer'' binds a buffer object to the specified buffer binding point. Calling ``gl:bindBuffer''
+%% with `Target' set to one of the accepted symbolic constants and `Buffer' set
+%% to the name of a buffer object binds that buffer object name to the target. If no buffer
+%% object with name `Buffer' exists, one is created with that name. When a buffer object
+%% is bound to a target, the previous binding for that target is automatically broken.
+%%
+%% Buffer object names are unsigned integers. The value zero is reserved, but there is no
+%% default buffer object for each buffer object target. Instead, `Buffer' set to zero
+%% effectively unbinds any buffer object previously bound, and restores client memory usage
+%% for that buffer object target (if supported for that target). Buffer object names and
+%% the corresponding buffer object contents are local to the shared object space of the current
+%% GL rendering context; two rendering contexts share buffer object names only if they explicitly
+%% enable sharing between contexts through the appropriate GL windows interfaces functions.
+%%
+%% {@link gl:genBuffers/1} must be used to generate a set of unused buffer object names.
+%%
+%% The state of a buffer object immediately after it is first bound is an unmapped zero-sized
+%% memory buffer with `?GL_READ_WRITE' access and `?GL_STATIC_DRAW' usage.
+%%
+%% While a non-zero buffer object name is bound, GL operations on the target to which it
+%% is bound affect the bound buffer object, and queries of the target to which it is bound
+%% return state from the bound buffer object. While buffer object name zero is bound, as
+%% in the initial state, attempts to modify or query state on the target to which it is bound
+%% generates an `?GL_INVALID_OPERATION' error.
+%%
+%% When a non-zero buffer object is bound to the `?GL_ARRAY_BUFFER' target, the vertex
+%% array pointer parameter is interpreted as an offset within the buffer object measured
+%% in basic machine units.
+%%
+%% When a non-zero buffer object is bound to the `?GL_DRAW_INDIRECT_BUFFER' target,
+%% parameters for draws issued through {@link gl:drawArraysIndirect/2} and {@link gl:drawElementsIndirect/3}
+%% are sourced from that buffer object.
+%%
+%% While a non-zero buffer object is bound to the `?GL_ELEMENT_ARRAY_BUFFER' target,
+%% the indices parameter of {@link gl:drawElements/4} , {@link gl:drawElementsInstanced/5} , {@link gl:drawElementsBaseVertex/5}
+%% , {@link gl:drawRangeElements/6} , {@link gl:drawRangeElementsBaseVertex/7} , see `glMultiDrawElements'
+%% , or see `glMultiDrawElementsBaseVertex' is interpreted as an offset within the
+%% buffer object measured in basic machine units.
+%%
+%% While a non-zero buffer object is bound to the `?GL_PIXEL_PACK_BUFFER' target,
+%% the following commands are affected: {@link gl:getCompressedTexImage/3} , {@link gl:getTexImage/5}
+%% , and {@link gl:readPixels/7} . The pointer parameter is interpreted as an offset within
+%% the buffer object measured in basic machine units.
+%%
+%% While a non-zero buffer object is bound to the `?GL_PIXEL_UNPACK_BUFFER' target,
+%% the following commands are affected: {@link gl:compressedTexImage1D/7} , {@link gl:compressedTexImage2D/8}
+%% , {@link gl:compressedTexImage3D/9} , {@link gl:compressedTexSubImage1D/7} , {@link gl:compressedTexSubImage2D/9}
+%% , {@link gl:compressedTexSubImage3D/11} , {@link gl:texImage1D/8} , {@link gl:texImage2D/9} , {@link gl:texImage3D/10}
+%% , {@link gl:texSubImage1D/7} , {@link gl:texSubImage1D/7} , and {@link gl:texSubImage1D/7} .
+%% The pointer parameter is interpreted as an offset within the buffer object measured in
+%% basic machine units.
+%%
+%% The buffer targets `?GL_COPY_READ_BUFFER' and `?GL_COPY_WRITE_BUFFER' are provided
+%% to allow {@link gl:copyBufferSubData/5} to be used without disturbing the state of other
+%% bindings. However, {@link gl:copyBufferSubData/5} may be used with any pair of buffer binding
+%% points.
+%%
+%% The `?GL_TRANSFORM_FEEDBACK_BUFFER' buffer binding point may be passed to ``gl:bindBuffer''
+%% , but will not directly affect transform feedback state. Instead, the indexed `?GL_TRANSFORM_FEEDBACK_BUFFER'
+%% bindings must be used through a call to {@link gl:bindBufferBase/3} or {@link gl:bindBufferRange/5}
+%% . This will affect the generic `?GL_TRANSFORM_FEEDABCK_BUFFER' binding.
+%%
+%% Likewise, the `?GL_UNIFORM_BUFFER' and `?GL_ATOMIC_COUNTER_BUFFER' buffer binding
+%% points may be used, but do not directly affect uniform buffer or atomic counter buffer
+%% state, respectively. {@link gl:bindBufferBase/3} or {@link gl:bindBufferRange/5} must be
+%% used to bind a buffer to an indexed uniform buffer or atomic counter buffer binding point.
+%%
+%%
+%% A buffer object binding created with ``gl:bindBuffer'' remains active until a different
+%% buffer object name is bound to the same target, or until the bound buffer object is deleted
+%% with {@link gl:deleteBuffers/1} .
+%%
+%% Once created, a named buffer object may be re-bound to any target as often as needed.
+%% However, the GL implementation may make choices about how to optimize the storage of a
+%% buffer object based on its initial binding target.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindBuffer.xml">external</a> documentation.
+-spec bindBuffer(Target, Buffer) -> ok when Target :: enum(),Buffer :: integer().
bindBuffer(Target,Buffer) ->
cast(5430, <<Target:?GLenum,Buffer:?GLuint>>).
-%% @spec (Buffers::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteBuffers.xml">external</a> documentation.
--spec deleteBuffers([integer()]) -> ok.
+%% @doc Delete named buffer objects
+%%
+%% ``gl:deleteBuffers'' deletes `N' buffer objects named by the elements of the array
+%% `Buffers' . After a buffer object is deleted, it has no contents, and its name is
+%% free for reuse (for example by {@link gl:genBuffers/1} ). If a buffer object that is currently
+%% bound is deleted, the binding reverts to 0 (the absence of any buffer object).
+%%
+%% ``gl:deleteBuffers'' silently ignores 0's and names that do not correspond to existing
+%% buffer objects.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteBuffers.xml">external</a> documentation.
+-spec deleteBuffers(Buffers) -> ok when Buffers :: [integer()].
deleteBuffers(Buffers) ->
cast(5431, <<(length(Buffers)):?GLuint,
(<< <<C:?GLuint>> || C <- Buffers>>)/binary,0:(((1+length(Buffers)) rem 2)*32)>>).
-%% @spec (N::integer()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenBuffers.xml">external</a> documentation.
--spec genBuffers(integer()) -> [integer()].
+%% @doc Generate buffer object names
+%%
+%% ``gl:genBuffers'' returns `N' buffer object names in `Buffers' . There is no
+%% guarantee that the names form a contiguous set of integers; however, it is guaranteed
+%% that none of the returned names was in use immediately before the call to ``gl:genBuffers''
+%% .
+%%
+%% Buffer object names returned by a call to ``gl:genBuffers'' are not returned by subsequent
+%% calls, unless they are first deleted with {@link gl:deleteBuffers/1} .
+%%
+%% No buffer objects are associated with the returned buffer object names until they are
+%% first bound by calling {@link gl:bindBuffer/2} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenBuffers.xml">external</a> documentation.
+-spec genBuffers(N) -> [integer()] when N :: integer().
genBuffers(N) ->
call(5432, <<N:?GLsizei>>).
-%% @spec (Buffer::integer()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsBuffer.xml">external</a> documentation.
--spec isBuffer(integer()) -> 0|1.
+%% @doc Determine if a name corresponds to a buffer object
+%%
+%% ``gl:isBuffer'' returns `?GL_TRUE' if `Buffer' is currently the name of a
+%% buffer object. If `Buffer' is zero, or is a non-zero value that is not currently
+%% the name of a buffer object, or if an error occurs, ``gl:isBuffer'' returns `?GL_FALSE'
+%% .
+%%
+%% A name returned by {@link gl:genBuffers/1} , but not yet associated with a buffer object
+%% by calling {@link gl:bindBuffer/2} , is not the name of a buffer object.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsBuffer.xml">external</a> documentation.
+-spec isBuffer(Buffer) -> 0|1 when Buffer :: integer().
isBuffer(Buffer) ->
call(5433, <<Buffer:?GLuint>>).
-%% @spec (Target::enum(),Size::integer(),Data::offset()|mem(),Usage::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBufferData.xml">external</a> documentation.
--spec bufferData(enum(),integer(),offset()|mem(),enum()) -> ok.
+%% @doc Creates and initializes a buffer object's data store
+%%
+%% ``gl:bufferData'' creates a new data store for the buffer object currently bound to `Target'
+%% . Any pre-existing data store is deleted. The new data store is created with the specified
+%% `Size' in bytes and `Usage' . If `Data' is not `?NULL', the data store
+%% is initialized with data from this pointer. In its initial state, the new data store
+%% is not mapped, it has a `?NULL' mapped pointer, and its mapped access is `?GL_READ_WRITE'
+%% .
+%%
+%% `Usage' is a hint to the GL implementation as to how a buffer object's data store
+%% will be accessed. This enables the GL implementation to make more intelligent decisions
+%% that may significantly impact buffer object performance. It does not, however, constrain
+%% the actual usage of the data store. `Usage' can be broken down into two parts: first,
+%% the frequency of access (modification and usage), and second, the nature of that access.
+%% The frequency of access may be one of these:
+%%
+%% STREAM: The data store contents will be modified once and used at most a few times.
+%%
+%% STATIC: The data store contents will be modified once and used many times.
+%%
+%% DYNAMIC: The data store contents will be modified repeatedly and used many times.
+%%
+%% The nature of access may be one of these:
+%%
+%% DRAW: The data store contents are modified by the application, and used as the source
+%% for GL drawing and image specification commands.
+%%
+%% READ: The data store contents are modified by reading data from the GL, and used to return
+%% that data when queried by the application.
+%%
+%% COPY: The data store contents are modified by reading data from the GL, and used as the
+%% source for GL drawing and image specification commands.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBufferData.xml">external</a> documentation.
+-spec bufferData(Target, Size, Data, Usage) -> ok when Target :: enum(),Size :: integer(),Data :: offset()|mem(),Usage :: enum().
bufferData(Target,Size,Data,Usage) when is_integer(Data) ->
cast(5434, <<Target:?GLenum,0:32,Size:?GLsizeiptr,Data:?GLuint,Usage:?GLenum>>);
bufferData(Target,Size,Data,Usage) ->
send_bin(Data),
cast(5435, <<Target:?GLenum,0:32,Size:?GLsizeiptr,Usage:?GLenum>>).
-%% @spec (Target::enum(),Offset::integer(),Size::integer(),Data::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBufferSubData.xml">external</a> documentation.
--spec bufferSubData(enum(),integer(),integer(),offset()|mem()) -> ok.
+%% @doc Updates a subset of a buffer object's data store
+%%
+%% ``gl:bufferSubData'' redefines some or all of the data store for the buffer object currently
+%% bound to `Target' . Data starting at byte offset `Offset' and extending for `Size'
+%% bytes is copied to the data store from the memory pointed to by `Data' . An error
+%% is thrown if `Offset' and `Size' together define a range beyond the bounds of
+%% the buffer object's data store.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBufferSubData.xml">external</a> documentation.
+-spec bufferSubData(Target, Offset, Size, Data) -> ok when Target :: enum(),Offset :: integer(),Size :: integer(),Data :: offset()|mem().
bufferSubData(Target,Offset,Size,Data) when is_integer(Data) ->
cast(5436, <<Target:?GLenum,0:32,Offset:?GLintptr,Size:?GLsizeiptr,Data:?GLuint>>);
bufferSubData(Target,Offset,Size,Data) ->
send_bin(Data),
cast(5437, <<Target:?GLenum,0:32,Offset:?GLintptr,Size:?GLsizeiptr>>).
-%% @spec (Target::enum(),Offset::integer(),Size::integer(),Data::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetBufferSubData.xml">external</a> documentation.
--spec getBufferSubData(enum(),integer(),integer(),mem()) -> ok.
+%% @doc Returns a subset of a buffer object's data store
+%%
+%% ``gl:getBufferSubData'' returns some or all of the data from the buffer object currently
+%% bound to `Target' . Data starting at byte offset `Offset' and extending for `Size'
+%% bytes is copied from the data store to the memory pointed to by `Data' . An error
+%% is thrown if the buffer object is currently mapped, or if `Offset' and `Size'
+%% together define a range beyond the bounds of the buffer object's data store.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetBufferSubData.xml">external</a> documentation.
+-spec getBufferSubData(Target, Offset, Size, Data) -> ok when Target :: enum(),Offset :: integer(),Size :: integer(),Data :: mem().
getBufferSubData(Target,Offset,Size,Data) ->
send_bin(Data),
call(5438, <<Target:?GLenum,0:32,Offset:?GLintptr,Size:?GLsizeiptr>>).
-%% @spec (Target::enum(),Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetBufferParameteriv.xml">external</a> documentation.
--spec getBufferParameteriv(enum(),enum()) -> integer().
+%% @doc Return parameters of a buffer object
+%%
+%% ``gl:getBufferParameteriv'' returns in `Data' a selected parameter of the buffer
+%% object specified by `Target' .
+%%
+%% `Value' names a specific buffer object parameter, as follows:
+%%
+%% `?GL_BUFFER_ACCESS': `Params' returns the access policy set while mapping the
+%% buffer object. The initial value is `?GL_READ_WRITE'.
+%%
+%% `?GL_BUFFER_MAPPED': `Params' returns a flag indicating whether the buffer object
+%% is currently mapped. The initial value is `?GL_FALSE'.
+%%
+%% `?GL_BUFFER_SIZE': `Params' returns the size of the buffer object, measured
+%% in bytes. The initial value is 0.
+%%
+%% `?GL_BUFFER_USAGE': `Params' returns the buffer object's usage pattern. The
+%% initial value is `?GL_STATIC_DRAW'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetBufferParameteriv.xml">external</a> documentation.
+-spec getBufferParameteriv(Target, Pname) -> integer() when Target :: enum(),Pname :: enum().
getBufferParameteriv(Target,Pname) ->
call(5439, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (ModeRGB::enum(),ModeAlpha::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlendEquationSeparate.xml">external</a> documentation.
--spec blendEquationSeparate(enum(),enum()) -> ok.
+%% @doc Set the RGB blend equation and the alpha blend equation separately
+%%
+%% The blend equations determines how a new pixel (the ''source'' color) is combined with
+%% a pixel already in the framebuffer (the ''destination'' color). These functions specifie
+%% one blend equation for the RGB-color components and one blend equation for the alpha
+%% component. ``gl:blendEquationSeparatei'' specifies the blend equations for a single
+%% draw buffer whereas ``gl:blendEquationSeparate'' sets the blend equations for all draw
+%% buffers.
+%%
+%% The blend equations use the source and destination blend factors specified by either {@link gl:blendFunc/2}
+%% or {@link gl:blendFuncSeparate/4} . See {@link gl:blendFunc/2} or {@link gl:blendFuncSeparate/4}
+%% for a description of the various blend factors.
+%%
+%% In the equations that follow, source and destination color components are referred to
+%% as (R s G s B s A s) and (R d G d B d A d), respectively. The result color is referred to as (R r G r B r A r). The source and destination
+%% blend factors are denoted (s R s G s B s A) and (d R d G d B d A), respectively. For these equations all color components
+%% are understood to have values in the range [0 1]. <table><tbody><tr><td>` Mode '</td><td>
+%% ` RGB Components '</td><td>` Alpha Component '</td></tr></tbody><tbody><tr><td>`?GL_FUNC_ADD'
+%% </td><td> Rr= R s s R+R d d R Gr= G s s G+G d d G Br= B s s B+B d d B</td><td> Ar=
+%% A s s A+A d d A</td></tr><tr><td>`?GL_FUNC_SUBTRACT'</td><td> Rr= R s s R-R d d
+%% R Gr= G s s G-G d d G Br= B s s B-B d d B</td><td> Ar= A s s A-A d d A</td></tr><tr>
+%% <td>`?GL_FUNC_REVERSE_SUBTRACT'</td><td> Rr= R d d R-R s s R Gr= G d d G-G s s G
+%% Br= B d d B-B s s B</td><td> Ar= A d d A-A s s A</td></tr><tr><td>`?GL_MIN'</td><td>
+%% Rr= min(R s R d) Gr= min(G s G d) Br= min(B s B d)</td><td> Ar= min(A s A d)</td></tr><tr><td>`?GL_MAX'</td><td> Rr=
+%% max(R s R d) Gr= max(G s G d) Br= max(B s B d)</td><td> Ar= max(A s A d)</td></tr></tbody></table>
+%%
+%% The results of these equations are clamped to the range [0 1].
+%%
+%% The `?GL_MIN' and `?GL_MAX' equations are useful for applications that analyze
+%% image data (image thresholding against a constant color, for example). The `?GL_FUNC_ADD'
+%% equation is useful for antialiasing and transparency, among other things.
+%%
+%% Initially, both the RGB blend equation and the alpha blend equation are set to `?GL_FUNC_ADD'
+%% .
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlendEquationSeparate.xml">external</a> documentation.
+-spec blendEquationSeparate(ModeRGB, ModeAlpha) -> ok when ModeRGB :: enum(),ModeAlpha :: enum().
blendEquationSeparate(ModeRGB,ModeAlpha) ->
cast(5440, <<ModeRGB:?GLenum,ModeAlpha:?GLenum>>).
-%% @spec (Bufs::[enum()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawBuffers.xml">external</a> documentation.
--spec drawBuffers([enum()]) -> ok.
+%% @doc Specifies a list of color buffers to be drawn into
+%%
+%% ``gl:drawBuffers'' defines an array of buffers into which outputs from the fragment
+%% shader data will be written. If a fragment shader writes a value to one or more user defined
+%% output variables, then the value of each variable will be written into the buffer specified
+%% at a location within `Bufs' corresponding to the location assigned to that user defined
+%% output. The draw buffer used for user defined outputs assigned to locations greater than
+%% or equal to `N' is implicitly set to `?GL_NONE' and any data written to such
+%% an output is discarded.
+%%
+%% The symbolic constants contained in `Bufs' may be any of the following:
+%%
+%% `?GL_NONE': The fragment shader output value is not written into any color buffer.
+%%
+%% `?GL_FRONT_LEFT': The fragment shader output value is written into the front left
+%% color buffer.
+%%
+%% `?GL_FRONT_RIGHT': The fragment shader output value is written into the front right
+%% color buffer.
+%%
+%% `?GL_BACK_LEFT': The fragment shader output value is written into the back left color
+%% buffer.
+%%
+%% `?GL_BACK_RIGHT': The fragment shader output value is written into the back right
+%% color buffer.
+%%
+%% `?GL_COLOR_ATTACHMENT'`n': The fragment shader output value is written into
+%% the `n'th color attachment of the current framebuffer. `n' may range from 0
+%% to the value of `?GL_MAX_COLOR_ATTACHMENTS'.
+%%
+%% Except for `?GL_NONE', the preceding symbolic constants may not appear more than
+%% once in `Bufs' . The maximum number of draw buffers supported is implementation dependent
+%% and can be queried by calling {@link gl:getBooleanv/1} with the argument `?GL_MAX_DRAW_BUFFERS'
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawBuffers.xml">external</a> documentation.
+-spec drawBuffers(Bufs) -> ok when Bufs :: [enum()].
drawBuffers(Bufs) ->
cast(5441, <<(length(Bufs)):?GLuint,
(<< <<C:?GLenum>> || C <- Bufs>>)/binary,0:(((1+length(Bufs)) rem 2)*32)>>).
-%% @spec (Face::enum(),Sfail::enum(),Dpfail::enum(),Dppass::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glStencilOpSeparate.xml">external</a> documentation.
--spec stencilOpSeparate(enum(),enum(),enum(),enum()) -> ok.
+%% @doc Set front and/or back stencil test actions
+%%
+%% Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis.
+%% You draw into the stencil planes using GL drawing primitives, then render geometry and
+%% images, using the stencil planes to mask out portions of the screen. Stenciling is typically
+%% used in multipass rendering algorithms to achieve special effects, such as decals, outlining,
+%% and constructive solid geometry rendering.
+%%
+%% The stencil test conditionally eliminates a pixel based on the outcome of a comparison
+%% between the value in the stencil buffer and a reference value. To enable and disable the
+%% test, call {@link gl:enable/1} and {@link gl:enable/1} with argument `?GL_STENCIL_TEST'
+%% ; to control it, call {@link gl:stencilFunc/3} or {@link gl:stencilFuncSeparate/4} .
+%%
+%% There can be two separate sets of `Sfail' , `Dpfail' , and `Dppass' parameters;
+%% one affects back-facing polygons, and the other affects front-facing polygons as well
+%% as other non-polygon primitives. {@link gl:stencilOp/3} sets both front and back stencil
+%% state to the same values, as if {@link gl:stencilOpSeparate/4} were called with `Face'
+%% set to `?GL_FRONT_AND_BACK'.
+%%
+%% ``gl:stencilOpSeparate'' takes three arguments that indicate what happens to the stored
+%% stencil value while stenciling is enabled. If the stencil test fails, no change is made
+%% to the pixel's color or depth buffers, and `Sfail' specifies what happens to the
+%% stencil buffer contents. The following eight actions are possible.
+%%
+%% `?GL_KEEP': Keeps the current value.
+%%
+%% `?GL_ZERO': Sets the stencil buffer value to 0.
+%%
+%% `?GL_REPLACE': Sets the stencil buffer value to `ref', as specified by {@link gl:stencilFunc/3}
+%% .
+%%
+%% `?GL_INCR': Increments the current stencil buffer value. Clamps to the maximum representable
+%% unsigned value.
+%%
+%% `?GL_INCR_WRAP': Increments the current stencil buffer value. Wraps stencil buffer
+%% value to zero when incrementing the maximum representable unsigned value.
+%%
+%% `?GL_DECR': Decrements the current stencil buffer value. Clamps to 0.
+%%
+%% `?GL_DECR_WRAP': Decrements the current stencil buffer value. Wraps stencil buffer
+%% value to the maximum representable unsigned value when decrementing a stencil buffer value
+%% of zero.
+%%
+%% `?GL_INVERT': Bitwise inverts the current stencil buffer value.
+%%
+%% Stencil buffer values are treated as unsigned integers. When incremented and decremented,
+%% values are clamped to 0 and 2 n-1, where n is the value returned by querying `?GL_STENCIL_BITS'
+%% .
+%%
+%% The other two arguments to ``gl:stencilOpSeparate'' specify stencil buffer actions
+%% that depend on whether subsequent depth buffer tests succeed ( `Dppass' ) or fail ( `Dpfail'
+%% ) (see {@link gl:depthFunc/1} ). The actions are specified using the same eight symbolic
+%% constants as `Sfail' . Note that `Dpfail' is ignored when there is no depth buffer,
+%% or when the depth buffer is not enabled. In these cases, `Sfail' and `Dppass'
+%% specify stencil action when the stencil test fails and passes, respectively.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glStencilOpSeparate.xml">external</a> documentation.
+-spec stencilOpSeparate(Face, Sfail, Dpfail, Dppass) -> ok when Face :: enum(),Sfail :: enum(),Dpfail :: enum(),Dppass :: enum().
stencilOpSeparate(Face,Sfail,Dpfail,Dppass) ->
cast(5442, <<Face:?GLenum,Sfail:?GLenum,Dpfail:?GLenum,Dppass:?GLenum>>).
-%% @spec (Face::enum(),Func::enum(),Ref::integer(),Mask::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glStencilFuncSeparate.xml">external</a> documentation.
--spec stencilFuncSeparate(enum(),enum(),integer(),integer()) -> ok.
+%% @doc Set front and/or back function and reference value for stencil testing
+%%
+%% Stenciling, like depth-buffering, enables and disables drawing on a per-pixel basis.
+%% You draw into the stencil planes using GL drawing primitives, then render geometry and
+%% images, using the stencil planes to mask out portions of the screen. Stenciling is typically
+%% used in multipass rendering algorithms to achieve special effects, such as decals, outlining,
+%% and constructive solid geometry rendering.
+%%
+%% The stencil test conditionally eliminates a pixel based on the outcome of a comparison
+%% between the reference value and the value in the stencil buffer. To enable and disable
+%% the test, call {@link gl:enable/1} and {@link gl:enable/1} with argument `?GL_STENCIL_TEST'
+%% . To specify actions based on the outcome of the stencil test, call {@link gl:stencilOp/3}
+%% or {@link gl:stencilOpSeparate/4} .
+%%
+%% There can be two separate sets of `Func' , `Ref' , and `Mask' parameters;
+%% one affects back-facing polygons, and the other affects front-facing polygons as well
+%% as other non-polygon primitives. {@link gl:stencilFunc/3} sets both front and back stencil
+%% state to the same values, as if {@link gl:stencilFuncSeparate/4} were called with `Face'
+%% set to `?GL_FRONT_AND_BACK'.
+%%
+%% `Func' is a symbolic constant that determines the stencil comparison function. It
+%% accepts one of eight values, shown in the following list. `Ref' is an integer reference
+%% value that is used in the stencil comparison. It is clamped to the range [0 2 n-1], where n
+%% is the number of bitplanes in the stencil buffer. `Mask' is bitwise ANDed with both
+%% the reference value and the stored stencil value, with the ANDed values participating
+%% in the comparison.
+%%
+%% If `stencil' represents the value stored in the corresponding stencil buffer location,
+%% the following list shows the effect of each comparison function that can be specified by `Func'
+%% . Only if the comparison succeeds is the pixel passed through to the next stage in the
+%% rasterization process (see {@link gl:stencilOp/3} ). All tests treat `stencil' values
+%% as unsigned integers in the range [0 2 n-1], where n is the number of bitplanes in the stencil
+%% buffer.
+%%
+%% The following values are accepted by `Func' :
+%%
+%% `?GL_NEVER': Always fails.
+%%
+%% `?GL_LESS': Passes if ( `Ref' &amp; `Mask' ) &lt; ( `stencil' &amp; `Mask'
+%% ).
+%%
+%% `?GL_LEQUAL': Passes if ( `Ref' &amp; `Mask' ) &lt;= ( `stencil'
+%% &amp; `Mask' ).
+%%
+%% `?GL_GREATER': Passes if ( `Ref' &amp; `Mask' ) &gt; ( `stencil'
+%% &amp; `Mask' ).
+%%
+%% `?GL_GEQUAL': Passes if ( `Ref' &amp; `Mask' ) &gt;= ( `stencil'
+%% &amp; `Mask' ).
+%%
+%% `?GL_EQUAL': Passes if ( `Ref' &amp; `Mask' ) = ( `stencil' &amp; `Mask'
+%% ).
+%%
+%% `?GL_NOTEQUAL': Passes if ( `Ref' &amp; `Mask' ) != ( `stencil' &amp;
+%% `Mask' ).
+%%
+%% `?GL_ALWAYS': Always passes.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glStencilFuncSeparate.xml">external</a> documentation.
+-spec stencilFuncSeparate(Face, Func, Ref, Mask) -> ok when Face :: enum(),Func :: enum(),Ref :: integer(),Mask :: integer().
stencilFuncSeparate(Face,Func,Ref,Mask) ->
cast(5443, <<Face:?GLenum,Func:?GLenum,Ref:?GLint,Mask:?GLuint>>).
-%% @spec (Face::enum(),Mask::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glStencilMaskSeparate.xml">external</a> documentation.
--spec stencilMaskSeparate(enum(),integer()) -> ok.
+%% @doc Control the front and/or back writing of individual bits in the stencil planes
+%%
+%% ``gl:stencilMaskSeparate'' controls the writing of individual bits in the stencil planes.
+%% The least significant n bits of `Mask' , where n is the number of bits in the
+%% stencil buffer, specify a mask. Where a 1 appears in the mask, it's possible to write
+%% to the corresponding bit in the stencil buffer. Where a 0 appears, the corresponding bit
+%% is write-protected. Initially, all bits are enabled for writing.
+%%
+%% There can be two separate `Mask' writemasks; one affects back-facing polygons, and
+%% the other affects front-facing polygons as well as other non-polygon primitives. {@link gl:stencilMask/1}
+%% sets both front and back stencil writemasks to the same values, as if {@link gl:stencilMaskSeparate/2}
+%% were called with `Face' set to `?GL_FRONT_AND_BACK'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glStencilMaskSeparate.xml">external</a> documentation.
+-spec stencilMaskSeparate(Face, Mask) -> ok when Face :: enum(),Mask :: integer().
stencilMaskSeparate(Face,Mask) ->
cast(5444, <<Face:?GLenum,Mask:?GLuint>>).
-%% @spec (Program::integer(),Shader::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glAttachShader.xml">external</a> documentation.
--spec attachShader(integer(),integer()) -> ok.
+%% @doc Attaches a shader object to a program object
+%%
+%% In order to create a complete shader program, there must be a way to specify the list
+%% of things that will be linked together. Program objects provide this mechanism. Shaders
+%% that are to be linked together in a program object must first be attached to that program
+%% object. ``gl:attachShader'' attaches the shader object specified by `Shader' to
+%% the program object specified by `Program' . This indicates that `Shader' will
+%% be included in link operations that will be performed on `Program' .
+%%
+%% All operations that can be performed on a shader object are valid whether or not the
+%% shader object is attached to a program object. It is permissible to attach a shader object
+%% to a program object before source code has been loaded into the shader object or before
+%% the shader object has been compiled. It is permissible to attach multiple shader objects
+%% of the same type because each may contain a portion of the complete shader. It is also
+%% permissible to attach a shader object to more than one program object. If a shader object
+%% is deleted while it is attached to a program object, it will be flagged for deletion,
+%% and deletion will not occur until {@link gl:detachShader/2} is called to detach it from
+%% all program objects to which it is attached.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glAttachShader.xml">external</a> documentation.
+-spec attachShader(Program, Shader) -> ok when Program :: integer(),Shader :: integer().
attachShader(Program,Shader) ->
cast(5445, <<Program:?GLuint,Shader:?GLuint>>).
-%% @spec (Program::integer(),Index::integer(),Name::string()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindAttribLocation.xml">external</a> documentation.
--spec bindAttribLocation(integer(),integer(),string()) -> ok.
+%% @doc Associates a generic vertex attribute index with a named attribute variable
+%%
+%% ``gl:bindAttribLocation'' is used to associate a user-defined attribute variable in
+%% the program object specified by `Program' with a generic vertex attribute index.
+%% The name of the user-defined attribute variable is passed as a null terminated string in `Name'
+%% . The generic vertex attribute index to be bound to this variable is specified by `Index'
+%% . When `Program' is made part of current state, values provided via the generic vertex
+%% attribute `Index' will modify the value of the user-defined attribute variable specified
+%% by `Name' .
+%%
+%% If `Name' refers to a matrix attribute variable, `Index' refers to the first
+%% column of the matrix. Other matrix columns are then automatically bound to locations `Index+1'
+%% for a matrix of type `mat2'; `Index+1' and `Index+2' for a matrix of type
+%% `mat3'; and `Index+1' , `Index+2' , and `Index+3' for a matrix of type `mat4'
+%% .
+%%
+%% This command makes it possible for vertex shaders to use descriptive names for attribute
+%% variables rather than generic variables that are numbered from 0 to `?GL_MAX_VERTEX_ATTRIBS'
+%% -1. The values sent to each generic attribute index are part of current state. If a different
+%% program object is made current by calling {@link gl:useProgram/1} , the generic vertex attributes
+%% are tracked in such a way that the same values will be observed by attributes in the new
+%% program object that are also bound to `Index' .
+%%
+%% Attribute variable name-to-generic attribute index bindings for a program object can be
+%% explicitly assigned at any time by calling ``gl:bindAttribLocation''. Attribute bindings
+%% do not go into effect until {@link gl:linkProgram/1} is called. After a program object
+%% has been linked successfully, the index values for generic attributes remain fixed (and
+%% their values can be queried) until the next link command occurs.
+%%
+%% Any attribute binding that occurs after the program object has been linked will not take
+%% effect until the next time the program object is linked.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindAttribLocation.xml">external</a> documentation.
+-spec bindAttribLocation(Program, Index, Name) -> ok when Program :: integer(),Index :: integer(),Name :: string().
bindAttribLocation(Program,Index,Name) ->
cast(5446, <<Program:?GLuint,Index:?GLuint,(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 1) rem 8)) rem 8)>>).
-%% @spec (Shader::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompileShader.xml">external</a> documentation.
--spec compileShader(integer()) -> ok.
+%% @doc Compiles a shader object
+%%
+%% ``gl:compileShader'' compiles the source code strings that have been stored in the shader
+%% object specified by `Shader' .
+%%
+%% The compilation status will be stored as part of the shader object's state. This value
+%% will be set to `?GL_TRUE' if the shader was compiled without errors and is ready
+%% for use, and `?GL_FALSE' otherwise. It can be queried by calling {@link gl:getShaderiv/2}
+%% with arguments `Shader' and `?GL_COMPILE_STATUS'.
+%%
+%% Compilation of a shader can fail for a number of reasons as specified by the OpenGL Shading
+%% Language Specification. Whether or not the compilation was successful, information about
+%% the compilation can be obtained from the shader object's information log by calling {@link gl:getShaderInfoLog/2}
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompileShader.xml">external</a> documentation.
+-spec compileShader(Shader) -> ok when Shader :: integer().
compileShader(Shader) ->
cast(5447, <<Shader:?GLuint>>).
-%% @spec () -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCreateProgram.xml">external</a> documentation.
+%% @doc Creates a program object
+%%
+%% ``gl:createProgram'' creates an empty program object and returns a non-zero value by
+%% which it can be referenced. A program object is an object to which shader objects can
+%% be attached. This provides a mechanism to specify the shader objects that will be linked
+%% to create a program. It also provides a means for checking the compatibility of the
+%% shaders that will be used to create a program (for instance, checking the compatibility
+%% between a vertex shader and a fragment shader). When no longer needed as part of a program
+%% object, shader objects can be detached.
+%%
+%% One or more executables are created in a program object by successfully attaching shader
+%% objects to it with {@link gl:attachShader/2} , successfully compiling the shader objects
+%% with {@link gl:compileShader/1} , and successfully linking the program object with {@link gl:linkProgram/1}
+%% . These executables are made part of current state when {@link gl:useProgram/1} is called.
+%% Program objects can be deleted by calling {@link gl:deleteProgram/1} . The memory associated
+%% with the program object will be deleted when it is no longer part of current rendering
+%% state for any context.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCreateProgram.xml">external</a> documentation.
-spec createProgram() -> integer().
createProgram() ->
call(5448, <<>>).
-%% @spec (Type::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCreateShader.xml">external</a> documentation.
--spec createShader(enum()) -> integer().
+%% @doc Creates a shader object
+%%
+%% ``gl:createShader'' creates an empty shader object and returns a non-zero value by
+%% which it can be referenced. A shader object is used to maintain the source code strings
+%% that define a shader. `ShaderType' indicates the type of shader to be created. Five
+%% types of shader are supported. A shader of type `?GL_VERTEX_SHADER' is a shader
+%% that is intended to run on the programmable vertex processor. A shader of type `?GL_TESS_CONTROL_SHADER'
+%% is a shader that is intended to run on the programmable tessellation processor in the
+%% control stage. A shader of type `?GL_TESS_EVALUATION_SHADER' is a shader that is
+%% intended to run on the programmable tessellation processor in the evaluation stage. A
+%% shader of type `?GL_GEOMETRY_SHADER' is a shader that is intended to run on the
+%% programmable geometry processor. A shader of type `?GL_FRAGMENT_SHADER' is a shader
+%% that is intended to run on the programmable fragment processor.
+%%
+%% When created, a shader object's `?GL_SHADER_TYPE' parameter is set to either `?GL_VERTEX_SHADER'
+%% , `?GL_TESS_CONTROL_SHADER', `?GL_TESS_EVALUATION_SHADER', `?GL_GEOMETRY_SHADER'
+%% or `?GL_FRAGMENT_SHADER', depending on the value of `ShaderType' .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCreateShader.xml">external</a> documentation.
+-spec createShader(Type) -> integer() when Type :: enum().
createShader(Type) ->
call(5449, <<Type:?GLenum>>).
-%% @spec (Program::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteProgram.xml">external</a> documentation.
--spec deleteProgram(integer()) -> ok.
+%% @doc Deletes a program object
+%%
+%% ``gl:deleteProgram'' frees the memory and invalidates the name associated with the program
+%% object specified by `Program.' This command effectively undoes the effects of a call
+%% to {@link gl:createProgram/0} .
+%%
+%% If a program object is in use as part of current rendering state, it will be flagged for
+%% deletion, but it will not be deleted until it is no longer part of current state for any
+%% rendering context. If a program object to be deleted has shader objects attached to it,
+%% those shader objects will be automatically detached but not deleted unless they have already
+%% been flagged for deletion by a previous call to {@link gl:deleteShader/1} . A value of 0
+%% for `Program' will be silently ignored.
+%%
+%% To determine whether a program object has been flagged for deletion, call {@link gl:getProgramiv/2}
+%% with arguments `Program' and `?GL_DELETE_STATUS'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteProgram.xml">external</a> documentation.
+-spec deleteProgram(Program) -> ok when Program :: integer().
deleteProgram(Program) ->
cast(5450, <<Program:?GLuint>>).
-%% @spec (Shader::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteShader.xml">external</a> documentation.
--spec deleteShader(integer()) -> ok.
+%% @doc Deletes a shader object
+%%
+%% ``gl:deleteShader'' frees the memory and invalidates the name associated with the shader
+%% object specified by `Shader' . This command effectively undoes the effects of a call
+%% to {@link gl:createShader/1} .
+%%
+%% If a shader object to be deleted is attached to a program object, it will be flagged for
+%% deletion, but it will not be deleted until it is no longer attached to any program object,
+%% for any rendering context (i.e., it must be detached from wherever it was attached before
+%% it will be deleted). A value of 0 for `Shader' will be silently ignored.
+%%
+%% To determine whether an object has been flagged for deletion, call {@link gl:getShaderiv/2}
+%% with arguments `Shader' and `?GL_DELETE_STATUS'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteShader.xml">external</a> documentation.
+-spec deleteShader(Shader) -> ok when Shader :: integer().
deleteShader(Shader) ->
cast(5451, <<Shader:?GLuint>>).
-%% @spec (Program::integer(),Shader::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDetachShader.xml">external</a> documentation.
--spec detachShader(integer(),integer()) -> ok.
+%% @doc Detaches a shader object from a program object to which it is attached
+%%
+%% ``gl:detachShader'' detaches the shader object specified by `Shader' from the program
+%% object specified by `Program' . This command can be used to undo the effect of the
+%% command {@link gl:attachShader/2} .
+%%
+%% If `Shader' has already been flagged for deletion by a call to {@link gl:deleteShader/1}
+%% and it is not attached to any other program object, it will be deleted after it has been
+%% detached.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDetachShader.xml">external</a> documentation.
+-spec detachShader(Program, Shader) -> ok when Program :: integer(),Shader :: integer().
detachShader(Program,Shader) ->
cast(5452, <<Program:?GLuint,Shader:?GLuint>>).
-%% @spec (Index::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDisableVertexAttribArray.xml">external</a> documentation.
--spec disableVertexAttribArray(integer()) -> ok.
+%% @doc Enable or disable a generic vertex attribute array
+%%
+%% ``gl:enableVertexAttribArray'' enables the generic vertex attribute array specified by `Index'
+%% . ``gl:disableVertexAttribArray'' disables the generic vertex attribute array specified
+%% by `Index' . By default, all client-side capabilities are disabled, including all
+%% generic vertex attribute arrays. If enabled, the values in the generic vertex attribute
+%% array will be accessed and used for rendering when calls are made to vertex array commands
+%% such as {@link gl:drawArrays/3} , {@link gl:drawElements/4} , {@link gl:drawRangeElements/6} , see `glMultiDrawElements'
+%% , or {@link gl:multiDrawArrays/3} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEnableVertexAttribArray.xml">external</a> documentation.
+-spec disableVertexAttribArray(Index) -> ok when Index :: integer().
disableVertexAttribArray(Index) ->
cast(5453, <<Index:?GLuint>>).
-%% @spec (Index::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEnableVertexAttribArray.xml">external</a> documentation.
--spec enableVertexAttribArray(integer()) -> ok.
+%% @doc
+%% See {@link disableVertexAttribArray/1}
+-spec enableVertexAttribArray(Index) -> ok when Index :: integer().
enableVertexAttribArray(Index) ->
cast(5454, <<Index:?GLuint>>).
-%% @spec (Program::integer(),Index::integer(),BufSize::integer()) -> {Size::integer(),Type::enum(),Name::string()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveAttrib.xml">external</a> documentation.
--spec getActiveAttrib(integer(),integer(),integer()) -> {integer(),enum(),string()}.
+%% @doc Returns information about an active attribute variable for the specified program object
+%%
+%% ``gl:getActiveAttrib'' returns information about an active attribute variable in the
+%% program object specified by `Program' . The number of active attributes can be obtained
+%% by calling {@link gl:getProgramiv/2} with the value `?GL_ACTIVE_ATTRIBUTES'. A value
+%% of 0 for `Index' selects the first active attribute variable. Permissible values
+%% for `Index' range from 0 to the number of active attribute variables minus 1.
+%%
+%% A vertex shader may use either built-in attribute variables, user-defined attribute variables,
+%% or both. Built-in attribute variables have a prefix of "gl_" and reference conventional
+%% OpenGL vertex attribtes (e.g., `Gl_Vertex' , `Gl_Normal' , etc., see the OpenGL
+%% Shading Language specification for a complete list.) User-defined attribute variables
+%% have arbitrary names and obtain their values through numbered generic vertex attributes.
+%% An attribute variable (either built-in or user-defined) is considered active if it is
+%% determined during the link operation that it may be accessed during program execution.
+%% Therefore, `Program' should have previously been the target of a call to {@link gl:linkProgram/1}
+%% , but it is not necessary for it to have been linked successfully.
+%%
+%% The size of the character buffer required to store the longest attribute variable name
+%% in `Program' can be obtained by calling {@link gl:getProgramiv/2} with the value `?GL_ACTIVE_ATTRIBUTE_MAX_LENGTH'
+%% . This value should be used to allocate a buffer of sufficient size to store the returned
+%% attribute name. The size of this character buffer is passed in `BufSize' , and a pointer
+%% to this character buffer is passed in `Name' .
+%%
+%% ``gl:getActiveAttrib'' returns the name of the attribute variable indicated by `Index'
+%% , storing it in the character buffer specified by `Name' . The string returned will
+%% be null terminated. The actual number of characters written into this buffer is returned
+%% in `Length' , and this count does not include the null termination character. If the
+%% length of the returned string is not required, a value of `?NULL' can be passed in
+%% the `Length' argument.
+%%
+%% The `Type' argument specifies a pointer to a variable into which the attribute variable's
+%% data type will be written. The symbolic constants `?GL_FLOAT', `?GL_FLOAT_VEC2',
+%% `?GL_FLOAT_VEC3', `?GL_FLOAT_VEC4', `?GL_FLOAT_MAT2', `?GL_FLOAT_MAT3',
+%% `?GL_FLOAT_MAT4', `?GL_FLOAT_MAT2x3', `?GL_FLOAT_MAT2x4', `?GL_FLOAT_MAT3x2'
+%% , `?GL_FLOAT_MAT3x4', `?GL_FLOAT_MAT4x2', `?GL_FLOAT_MAT4x3', `?GL_INT'
+%% , `?GL_INT_VEC2', `?GL_INT_VEC3', `?GL_INT_VEC4', `?GL_UNSIGNED_INT_VEC'
+%% , `?GL_UNSIGNED_INT_VEC2', `?GL_UNSIGNED_INT_VEC3', `?GL_UNSIGNED_INT_VEC4',
+%% `?DOUBLE', `?DOUBLE_VEC2', `?DOUBLE_VEC3', `?DOUBLE_VEC4', `?DOUBLE_MAT2'
+%% , `?DOUBLE_MAT3', `?DOUBLE_MAT4', `?DOUBLE_MAT2x3', `?DOUBLE_MAT2x4',
+%% `?DOUBLE_MAT3x2', `?DOUBLE_MAT3x4', `?DOUBLE_MAT4x2', or `?DOUBLE_MAT4x3'
+%% may be returned. The `Size' argument will return the size of the attribute, in units
+%% of the type returned in `Type' .
+%%
+%% The list of active attribute variables may include both built-in attribute variables (which
+%% begin with the prefix "gl_") as well as user-defined attribute variable names.
+%%
+%% This function will return as much information as it can about the specified active attribute
+%% variable. If no information is available, `Length' will be 0, and `Name' will
+%% be an empty string. This situation could occur if this function is called after a link
+%% operation that failed. If an error occurs, the return values `Length' , `Size' , `Type'
+%% , and `Name' will be unmodified.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveAttrib.xml">external</a> documentation.
+-spec getActiveAttrib(Program, Index, BufSize) -> {Size :: integer(),Type :: enum(),Name :: string()} when Program :: integer(),Index :: integer(),BufSize :: integer().
getActiveAttrib(Program,Index,BufSize) ->
call(5455, <<Program:?GLuint,Index:?GLuint,BufSize:?GLsizei>>).
-%% @spec (Program::integer(),Index::integer(),BufSize::integer()) -> {Size::integer(),Type::enum(),Name::string()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveUniform.xml">external</a> documentation.
--spec getActiveUniform(integer(),integer(),integer()) -> {integer(),enum(),string()}.
+%% @doc Returns information about an active uniform variable for the specified program object
+%%
+%% ``gl:getActiveUniform'' returns information about an active uniform variable in the
+%% program object specified by `Program' . The number of active uniform variables can
+%% be obtained by calling {@link gl:getProgramiv/2} with the value `?GL_ACTIVE_UNIFORMS'.
+%% A value of 0 for `Index' selects the first active uniform variable. Permissible values
+%% for `Index' range from 0 to the number of active uniform variables minus 1.
+%%
+%% Shaders may use either built-in uniform variables, user-defined uniform variables, or
+%% both. Built-in uniform variables have a prefix of "gl_" and reference existing OpenGL
+%% state or values derived from such state (e.g., `Gl_DepthRangeParameters' , see the
+%% OpenGL Shading Language specification for a complete list.) User-defined uniform variables
+%% have arbitrary names and obtain their values from the application through calls to {@link gl:uniform1f/2}
+%% . A uniform variable (either built-in or user-defined) is considered active if it is determined
+%% during the link operation that it may be accessed during program execution. Therefore, `Program'
+%% should have previously been the target of a call to {@link gl:linkProgram/1} , but it is
+%% not necessary for it to have been linked successfully.
+%%
+%% The size of the character buffer required to store the longest uniform variable name in `Program'
+%% can be obtained by calling {@link gl:getProgramiv/2} with the value `?GL_ACTIVE_UNIFORM_MAX_LENGTH'
+%% . This value should be used to allocate a buffer of sufficient size to store the returned
+%% uniform variable name. The size of this character buffer is passed in `BufSize' ,
+%% and a pointer to this character buffer is passed in `Name.'
+%%
+%% ``gl:getActiveUniform'' returns the name of the uniform variable indicated by `Index'
+%% , storing it in the character buffer specified by `Name' . The string returned will
+%% be null terminated. The actual number of characters written into this buffer is returned
+%% in `Length' , and this count does not include the null termination character. If the
+%% length of the returned string is not required, a value of `?NULL' can be passed in
+%% the `Length' argument.
+%%
+%% The `Type' argument will return a pointer to the uniform variable's data type. The
+%% symbolic constants returned for uniform types are shown in the table below. <table><tbody>
+%% <tr><td>` Returned Symbolic Contant '</td><td>` Shader Uniform Type '</td></tr></tbody>
+%% <tbody><tr><td>`?GL_FLOAT'</td><td>`?float'</td></tr><tr><td>`?GL_FLOAT_VEC2'
+%% </td><td>`?vec2'</td></tr><tr><td>`?GL_FLOAT_VEC3'</td><td>`?vec3'</td></tr>
+%% <tr><td>`?GL_FLOAT_VEC4'</td><td>`?vec4'</td></tr><tr><td>`?GL_DOUBLE'</td>
+%% <td>`?double'</td></tr><tr><td>`?GL_DOUBLE_VEC2'</td><td>`?dvec2'</td></tr>
+%% <tr><td>`?GL_DOUBLE_VEC3'</td><td>`?dvec3'</td></tr><tr><td>`?GL_DOUBLE_VEC4'
+%% </td><td>`?dvec4'</td></tr><tr><td>`?GL_INT'</td><td>`?int'</td></tr><tr><td>
+%% `?GL_INT_VEC2'</td><td>`?ivec2'</td></tr><tr><td>`?GL_INT_VEC3'</td><td>`?ivec3'
+%% </td></tr><tr><td>`?GL_INT_VEC4'</td><td>`?ivec4'</td></tr><tr><td>`?GL_UNSIGNED_INT'
+%% </td><td>`?unsigned int'</td></tr><tr><td>`?GL_UNSIGNED_INT_VEC2'</td><td>`?uvec2'
+%% </td></tr><tr><td>`?GL_UNSIGNED_INT_VEC3'</td><td>`?uvec3'</td></tr><tr><td>`?GL_UNSIGNED_INT_VEC4'
+%% </td><td>`?uvec4'</td></tr><tr><td>`?GL_BOOL'</td><td>`?bool'</td></tr><tr>
+%% <td>`?GL_BOOL_VEC2'</td><td>`?bvec2'</td></tr><tr><td>`?GL_BOOL_VEC3'</td><td>
+%% `?bvec3'</td></tr><tr><td>`?GL_BOOL_VEC4'</td><td>`?bvec4'</td></tr><tr><td>
+%% `?GL_FLOAT_MAT2'</td><td>`?mat2'</td></tr><tr><td>`?GL_FLOAT_MAT3'</td><td>
+%% `?mat3'</td></tr><tr><td>`?GL_FLOAT_MAT4'</td><td>`?mat4'</td></tr><tr><td>
+%% `?GL_FLOAT_MAT2x3'</td><td>`?mat2x3'</td></tr><tr><td>`?GL_FLOAT_MAT2x4'</td>
+%% <td>`?mat2x4'</td></tr><tr><td>`?GL_FLOAT_MAT3x2'</td><td>`?mat3x2'</td></tr>
+%% <tr><td>`?GL_FLOAT_MAT3x4'</td><td>`?mat3x4'</td></tr><tr><td>`?GL_FLOAT_MAT4x2'
+%% </td><td>`?mat4x2'</td></tr><tr><td>`?GL_FLOAT_MAT4x3'</td><td>`?mat4x3'</td>
+%% </tr><tr><td>`?GL_DOUBLE_MAT2'</td><td>`?dmat2'</td></tr><tr><td>`?GL_DOUBLE_MAT3'
+%% </td><td>`?dmat3'</td></tr><tr><td>`?GL_DOUBLE_MAT4'</td><td>`?dmat4'</td></tr>
+%% <tr><td>`?GL_DOUBLE_MAT2x3'</td><td>`?dmat2x3'</td></tr><tr><td>`?GL_DOUBLE_MAT2x4'
+%% </td><td>`?dmat2x4'</td></tr><tr><td>`?GL_DOUBLE_MAT3x2'</td><td>`?dmat3x2'</td>
+%% </tr><tr><td>`?GL_DOUBLE_MAT3x4'</td><td>`?dmat3x4'</td></tr><tr><td>`?GL_DOUBLE_MAT4x2'
+%% </td><td>`?dmat4x2'</td></tr><tr><td>`?GL_DOUBLE_MAT4x3'</td><td>`?dmat4x3'</td>
+%% </tr><tr><td>`?GL_SAMPLER_1D'</td><td>`?sampler1D'</td></tr><tr><td>`?GL_SAMPLER_2D'
+%% </td><td>`?sampler2D'</td></tr><tr><td>`?GL_SAMPLER_3D'</td><td>`?sampler3D'
+%% </td></tr><tr><td>`?GL_SAMPLER_CUBE'</td><td>`?samplerCube'</td></tr><tr><td>`?GL_SAMPLER_1D_SHADOW'
+%% </td><td>`?sampler1DShadow'</td></tr><tr><td>`?GL_SAMPLER_2D_SHADOW'</td><td>`?sampler2DShadow'
+%% </td></tr><tr><td>`?GL_SAMPLER_1D_ARRAY'</td><td>`?sampler1DArray'</td></tr><tr>
+%% <td>`?GL_SAMPLER_2D_ARRAY'</td><td>`?sampler2DArray'</td></tr><tr><td>`?GL_SAMPLER_1D_ARRAY_SHADOW'
+%% </td><td>`?sampler1DArrayShadow'</td></tr><tr><td>`?GL_SAMPLER_2D_ARRAY_SHADOW'</td>
+%% <td>`?sampler2DArrayShadow'</td></tr><tr><td>`?GL_SAMPLER_2D_MULTISAMPLE'</td><td>
+%% `?sampler2DMS'</td></tr><tr><td>`?GL_SAMPLER_2D_MULTISAMPLE_ARRAY'</td><td>`?sampler2DMSArray'
+%% </td></tr><tr><td>`?GL_SAMPLER_CUBE_SHADOW'</td><td>`?samplerCubeShadow'</td></tr>
+%% <tr><td>`?GL_SAMPLER_BUFFER'</td><td>`?samplerBuffer'</td></tr><tr><td>`?GL_SAMPLER_2D_RECT'
+%% </td><td>`?sampler2DRect'</td></tr><tr><td>`?GL_SAMPLER_2D_RECT_SHADOW'</td><td>
+%% `?sampler2DRectShadow'</td></tr><tr><td>`?GL_INT_SAMPLER_1D'</td><td>`?isampler1D'
+%% </td></tr><tr><td>`?GL_INT_SAMPLER_2D'</td><td>`?isampler2D'</td></tr><tr><td>`?GL_INT_SAMPLER_3D'
+%% </td><td>`?isampler3D'</td></tr><tr><td>`?GL_INT_SAMPLER_CUBE'</td><td>`?isamplerCube'
+%% </td></tr><tr><td>`?GL_INT_SAMPLER_1D_ARRAY'</td><td>`?isampler1DArray'</td></tr>
+%% <tr><td>`?GL_INT_SAMPLER_2D_ARRAY'</td><td>`?isampler2DArray'</td></tr><tr><td>`?GL_INT_SAMPLER_2D_MULTISAMPLE'
+%% </td><td>`?isampler2DMS'</td></tr><tr><td>`?GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY'</td>
+%% <td>`?isampler2DMSArray'</td></tr><tr><td>`?GL_INT_SAMPLER_BUFFER'</td><td>`?isamplerBuffer'
+%% </td></tr><tr><td>`?GL_INT_SAMPLER_2D_RECT'</td><td>`?isampler2DRect'</td></tr><tr>
+%% <td>`?GL_UNSIGNED_INT_SAMPLER_1D'</td><td>`?usampler1D'</td></tr><tr><td>`?GL_UNSIGNED_INT_SAMPLER_2D'
+%% </td><td>`?usampler2D'</td></tr><tr><td>`?GL_UNSIGNED_INT_SAMPLER_3D'</td><td>`?usampler3D'
+%% </td></tr><tr><td>`?GL_UNSIGNED_INT_SAMPLER_CUBE'</td><td>`?usamplerCube'</td></tr>
+%% <tr><td>`?GL_UNSIGNED_INT_SAMPLER_1D_ARRAY'</td><td>`?usampler2DArray'</td></tr>
+%% <tr><td>`?GL_UNSIGNED_INT_SAMPLER_2D_ARRAY'</td><td>`?usampler2DArray'</td></tr>
+%% <tr><td>`?GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE'</td><td>`?usampler2DMS'</td></tr>
+%% <tr><td>`?GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY'</td><td>`?usampler2DMSArray'
+%% </td></tr><tr><td>`?GL_UNSIGNED_INT_SAMPLER_BUFFER'</td><td>`?usamplerBuffer'</td>
+%% </tr><tr><td>`?GL_UNSIGNED_INT_SAMPLER_2D_RECT'</td><td>`?usampler2DRect'</td></tr>
+%% <tr><td>`?GL_IMAGE_1D'</td><td>`?image1D'</td></tr><tr><td>`?GL_IMAGE_2D'</td>
+%% <td>`?image2D'</td></tr><tr><td>`?GL_IMAGE_3D'</td><td>`?image3D'</td></tr>
+%% <tr><td>`?GL_IMAGE_2D_RECT'</td><td>`?image2DRect'</td></tr><tr><td>`?GL_IMAGE_CUBE'
+%% </td><td>`?imageCube'</td></tr><tr><td>`?GL_IMAGE_BUFFER'</td><td>`?imageBuffer'
+%% </td></tr><tr><td>`?GL_IMAGE_1D_ARRAY'</td><td>`?image1DArray'</td></tr><tr><td>
+%% `?GL_IMAGE_2D_ARRAY'</td><td>`?image2DArray'</td></tr><tr><td>`?GL_IMAGE_2D_MULTISAMPLE'
+%% </td><td>`?image2DMS'</td></tr><tr><td>`?GL_IMAGE_2D_MULTISAMPLE_ARRAY'</td><td>
+%% `?image2DMSArray'</td></tr><tr><td>`?GL_INT_IMAGE_1D'</td><td>`?iimage1D'</td>
+%% </tr><tr><td>`?GL_INT_IMAGE_2D'</td><td>`?iimage2D'</td></tr><tr><td>`?GL_INT_IMAGE_3D'
+%% </td><td>`?iimage3D'</td></tr><tr><td>`?GL_INT_IMAGE_2D_RECT'</td><td>`?iimage2DRect'
+%% </td></tr><tr><td>`?GL_INT_IMAGE_CUBE'</td><td>`?iimageCube'</td></tr><tr><td>`?GL_INT_IMAGE_BUFFER'
+%% </td><td>`?iimageBuffer'</td></tr><tr><td>`?GL_INT_IMAGE_1D_ARRAY'</td><td>`?iimage1DArray'
+%% </td></tr><tr><td>`?GL_INT_IMAGE_2D_ARRAY'</td><td>`?iimage2DArray'</td></tr><tr>
+%% <td>`?GL_INT_IMAGE_2D_MULTISAMPLE'</td><td>`?iimage2DMS'</td></tr><tr><td>`?GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY'
+%% </td><td>`?iimage2DMSArray'</td></tr><tr><td>`?GL_UNSIGNED_INT_IMAGE_1D'</td><td>
+%% `?uimage1D'</td></tr><tr><td>`?GL_UNSIGNED_INT_IMAGE_2D'</td><td>`?uimage2D'
+%% </td></tr><tr><td>`?GL_UNSIGNED_INT_IMAGE_3D'</td><td>`?uimage3D'</td></tr><tr><td>
+%% `?GL_UNSIGNED_INT_IMAGE_2D_RECT'</td><td>`?uimage2DRect'</td></tr><tr><td>`?GL_UNSIGNED_INT_IMAGE_CUBE'
+%% </td><td>`?uimageCube'</td></tr><tr><td>`?GL_UNSIGNED_INT_IMAGE_BUFFER'</td><td>
+%% `?uimageBuffer'</td></tr><tr><td>`?GL_UNSIGNED_INT_IMAGE_1D_ARRAY'</td><td>`?uimage1DArray'
+%% </td></tr><tr><td>`?GL_UNSIGNED_INT_IMAGE_2D_ARRAY'</td><td>`?uimage2DArray'</td>
+%% </tr><tr><td>`?GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE'</td><td>`?uimage2DMS'</td></tr>
+%% <tr><td>`?GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY'</td><td>`?uimage2DMSArray'</td>
+%% </tr><tr><td>`?GL_UNSIGNED_INT_ATOMIC_COUNTER'</td><td>`?atomic_uint'</td></tr></tbody>
+%% </table>
+%%
+%% If one or more elements of an array are active, the name of the array is returned in `Name'
+%% , the type is returned in `Type' , and the `Size' parameter returns the highest
+%% array element index used, plus one, as determined by the compiler and/or linker. Only
+%% one active uniform variable will be reported for a uniform array.
+%%
+%% Uniform variables that are declared as structures or arrays of structures will not be
+%% returned directly by this function. Instead, each of these uniform variables will be reduced
+%% to its fundamental components containing the "." and "[]" operators such that each of
+%% the names is valid as an argument to {@link gl:getUniformLocation/2} . Each of these reduced
+%% uniform variables is counted as one active uniform variable and is assigned an index.
+%% A valid name cannot be a structure, an array of structures, or a subcomponent of a vector
+%% or matrix.
+%%
+%% The size of the uniform variable will be returned in `Size' . Uniform variables other
+%% than arrays will have a size of 1. Structures and arrays of structures will be reduced
+%% as described earlier, such that each of the names returned will be a data type in the
+%% earlier list. If this reduction results in an array, the size returned will be as described
+%% for uniform arrays; otherwise, the size returned will be 1.
+%%
+%% The list of active uniform variables may include both built-in uniform variables (which
+%% begin with the prefix "gl_") as well as user-defined uniform variable names.
+%%
+%% This function will return as much information as it can about the specified active uniform
+%% variable. If no information is available, `Length' will be 0, and `Name' will
+%% be an empty string. This situation could occur if this function is called after a link
+%% operation that failed. If an error occurs, the return values `Length' , `Size' , `Type'
+%% , and `Name' will be unmodified.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveUniform.xml">external</a> documentation.
+-spec getActiveUniform(Program, Index, BufSize) -> {Size :: integer(),Type :: enum(),Name :: string()} when Program :: integer(),Index :: integer(),BufSize :: integer().
getActiveUniform(Program,Index,BufSize) ->
call(5456, <<Program:?GLuint,Index:?GLuint,BufSize:?GLsizei>>).
-%% @spec (Program::integer(),MaxCount::integer()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetAttachedShaders.xml">external</a> documentation.
--spec getAttachedShaders(integer(),integer()) -> [integer()].
+%% @doc Returns the handles of the shader objects attached to a program object
+%%
+%% ``gl:getAttachedShaders'' returns the names of the shader objects attached to `Program'
+%% . The names of shader objects that are attached to `Program' will be returned in `Shaders.'
+%% The actual number of shader names written into `Shaders' is returned in `Count.'
+%% If no shader objects are attached to `Program' , `Count' is set to 0. The maximum
+%% number of shader names that may be returned in `Shaders' is specified by `MaxCount'
+%% .
+%%
+%% If the number of names actually returned is not required (for instance, if it has just
+%% been obtained by calling {@link gl:getProgramiv/2} ), a value of `?NULL' may be passed
+%% for count. If no shader objects are attached to `Program' , a value of 0 will be returned
+%% in `Count' . The actual number of attached shaders can be obtained by calling {@link gl:getProgramiv/2}
+%% with the value `?GL_ATTACHED_SHADERS'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetAttachedShaders.xml">external</a> documentation.
+-spec getAttachedShaders(Program, MaxCount) -> [integer()] when Program :: integer(),MaxCount :: integer().
getAttachedShaders(Program,MaxCount) ->
call(5457, <<Program:?GLuint,MaxCount:?GLsizei>>).
-%% @spec (Program::integer(),Name::string()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetAttribLocation.xml">external</a> documentation.
--spec getAttribLocation(integer(),string()) -> integer().
+%% @doc Returns the location of an attribute variable
+%%
+%% ``gl:getAttribLocation'' queries the previously linked program object specified by `Program'
+%% for the attribute variable specified by `Name' and returns the index of the generic
+%% vertex attribute that is bound to that attribute variable. If `Name' is a matrix
+%% attribute variable, the index of the first column of the matrix is returned. If the named
+%% attribute variable is not an active attribute in the specified program object or if `Name'
+%% starts with the reserved prefix "gl_", a value of -1 is returned.
+%%
+%% The association between an attribute variable name and a generic attribute index can be
+%% specified at any time by calling {@link gl:bindAttribLocation/3} . Attribute bindings do
+%% not go into effect until {@link gl:linkProgram/1} is called. After a program object has
+%% been linked successfully, the index values for attribute variables remain fixed until
+%% the next link command occurs. The attribute values can only be queried after a link if
+%% the link was successful. ``gl:getAttribLocation'' returns the binding that actually
+%% went into effect the last time {@link gl:linkProgram/1} was called for the specified program
+%% object. Attribute bindings that have been specified since the last link operation are
+%% not returned by ``gl:getAttribLocation''.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetAttribLocation.xml">external</a> documentation.
+-spec getAttribLocation(Program, Name) -> integer() when Program :: integer(),Name :: string().
getAttribLocation(Program,Name) ->
call(5458, <<Program:?GLuint,(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 5) rem 8)) rem 8)>>).
-%% @spec (Program::integer(),Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgram.xml">external</a> documentation.
--spec getProgramiv(integer(),enum()) -> integer().
+%% @doc Returns a parameter from a program object
+%%
+%% ``gl:getProgram'' returns in `Params' the value of a parameter for a specific program
+%% object. The following parameters are defined:
+%%
+%% `?GL_DELETE_STATUS': `Params' returns `?GL_TRUE' if `Program' is currently
+%% flagged for deletion, and `?GL_FALSE' otherwise.
+%%
+%% `?GL_LINK_STATUS': `Params' returns `?GL_TRUE' if the last link operation
+%% on `Program' was successful, and `?GL_FALSE' otherwise.
+%%
+%% `?GL_VALIDATE_STATUS': `Params' returns `?GL_TRUE' or if the last validation
+%% operation on `Program' was successful, and `?GL_FALSE' otherwise.
+%%
+%% `?GL_INFO_LOG_LENGTH': `Params' returns the number of characters in the information
+%% log for `Program' including the null termination character (i.e., the size of the
+%% character buffer required to store the information log). If `Program' has no information
+%% log, a value of 0 is returned.
+%%
+%% `?GL_ATTACHED_SHADERS': `Params' returns the number of shader objects attached
+%% to `Program' .
+%%
+%% `?GL_ACTIVE_ATOMIC_COUNTER_BUFFERS': `Params' returns the number of active attribute
+%% atomic counter buffers used by `Program' .
+%%
+%% `?GL_ACTIVE_ATTRIBUTES': `Params' returns the number of active attribute variables
+%% for `Program' .
+%%
+%% `?GL_ACTIVE_ATTRIBUTE_MAX_LENGTH': `Params' returns the length of the longest
+%% active attribute name for `Program' , including the null termination character (i.e.,
+%% the size of the character buffer required to store the longest attribute name). If no
+%% active attributes exist, 0 is returned.
+%%
+%% `?GL_ACTIVE_UNIFORMS': `Params' returns the number of active uniform variables
+%% for `Program' .
+%%
+%% `?GL_ACTIVE_UNIFORM_MAX_LENGTH': `Params' returns the length of the longest
+%% active uniform variable name for `Program' , including the null termination character
+%% (i.e., the size of the character buffer required to store the longest uniform variable
+%% name). If no active uniform variables exist, 0 is returned.
+%%
+%% `?GL_PROGRAM_BINARY_LENGTH': `Params' returns the length of the program binary,
+%% in bytes that will be returned by a call to {@link gl:getProgramBinary/2} . When a progam's
+%% `?GL_LINK_STATUS' is `?GL_FALSE', its program binary length is zero.
+%%
+%% `?GL_TRANSFORM_FEEDBACK_BUFFER_MODE': `Params' returns a symbolic constant indicating
+%% the buffer mode used when transform feedback is active. This may be `?GL_SEPARATE_ATTRIBS'
+%% or `?GL_INTERLEAVED_ATTRIBS'.
+%%
+%% `?GL_TRANSFORM_FEEDBACK_VARYINGS': `Params' returns the number of varying variables
+%% to capture in transform feedback mode for the program.
+%%
+%% `?GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH': `Params' returns the length of
+%% the longest variable name to be used for transform feedback, including the null-terminator.
+%%
+%%
+%% `?GL_GEOMETRY_VERTICES_OUT': `Params' returns the maximum number of vertices
+%% that the geometry shader in `Program' will output.
+%%
+%% `?GL_GEOMETRY_INPUT_TYPE': `Params' returns a symbolic constant indicating the
+%% primitive type accepted as input to the geometry shader contained in `Program' .
+%%
+%% `?GL_GEOMETRY_OUTPUT_TYPE': `Params' returns a symbolic constant indicating
+%% the primitive type that will be output by the geometry shader contained in `Program' .
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgram.xml">external</a> documentation.
+-spec getProgramiv(Program, Pname) -> integer() when Program :: integer(),Pname :: enum().
getProgramiv(Program,Pname) ->
call(5459, <<Program:?GLuint,Pname:?GLenum>>).
-%% @spec (Program::integer(),BufSize::integer()) -> string()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramInfoLog.xml">external</a> documentation.
--spec getProgramInfoLog(integer(),integer()) -> string().
+%% @doc Returns the information log for a program object
+%%
+%% ``gl:getProgramInfoLog'' returns the information log for the specified program object.
+%% The information log for a program object is modified when the program object is linked
+%% or validated. The string that is returned will be null terminated.
+%%
+%% ``gl:getProgramInfoLog'' returns in `InfoLog' as much of the information log as
+%% it can, up to a maximum of `MaxLength' characters. The number of characters actually
+%% returned, excluding the null termination character, is specified by `Length' . If
+%% the length of the returned string is not required, a value of `?NULL' can be passed
+%% in the `Length' argument. The size of the buffer required to store the returned
+%% information log can be obtained by calling {@link gl:getProgramiv/2} with the value `?GL_INFO_LOG_LENGTH'
+%% .
+%%
+%% The information log for a program object is either an empty string, or a string containing
+%% information about the last link operation, or a string containing information about the
+%% last validation operation. It may contain diagnostic messages, warning messages, and
+%% other information. When a program object is created, its information log will be a string
+%% of length 0.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramInfoLog.xml">external</a> documentation.
+-spec getProgramInfoLog(Program, BufSize) -> string() when Program :: integer(),BufSize :: integer().
getProgramInfoLog(Program,BufSize) ->
call(5460, <<Program:?GLuint,BufSize:?GLsizei>>).
-%% @spec (Shader::integer(),Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetShader.xml">external</a> documentation.
--spec getShaderiv(integer(),enum()) -> integer().
+%% @doc Returns a parameter from a shader object
+%%
+%% ``gl:getShader'' returns in `Params' the value of a parameter for a specific
+%% shader object. The following parameters are defined:
+%%
+%% `?GL_SHADER_TYPE': `Params' returns `?GL_VERTEX_SHADER' if `Shader'
+%% is a vertex shader object, `?GL_GEOMETRY_SHADER' if `Shader' is a geometry
+%% shader object, and `?GL_FRAGMENT_SHADER' if `Shader' is a fragment shader
+%% object.
+%%
+%% `?GL_DELETE_STATUS': `Params' returns `?GL_TRUE' if `Shader' is
+%% currently flagged for deletion, and `?GL_FALSE' otherwise.
+%%
+%% `?GL_COMPILE_STATUS': `Params' returns `?GL_TRUE' if the last compile
+%% operation on `Shader' was successful, and `?GL_FALSE' otherwise.
+%%
+%% `?GL_INFO_LOG_LENGTH': `Params' returns the number of characters in the information
+%% log for `Shader' including the null termination character (i.e., the size of
+%% the character buffer required to store the information log). If `Shader' has
+%% no information log, a value of 0 is returned.
+%%
+%% `?GL_SHADER_SOURCE_LENGTH': `Params' returns the length of the concatenation
+%% of the source strings that make up the shader source for the `Shader' , including
+%% the null termination character. (i.e., the size of the character buffer required to
+%% store the shader source). If no source code exists, 0 is returned.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetShader.xml">external</a> documentation.
+-spec getShaderiv(Shader, Pname) -> integer() when Shader :: integer(),Pname :: enum().
getShaderiv(Shader,Pname) ->
call(5461, <<Shader:?GLuint,Pname:?GLenum>>).
-%% @spec (Shader::integer(),BufSize::integer()) -> string()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetShaderInfoLog.xml">external</a> documentation.
--spec getShaderInfoLog(integer(),integer()) -> string().
+%% @doc Returns the information log for a shader object
+%%
+%% ``gl:getShaderInfoLog'' returns the information log for the specified shader object.
+%% The information log for a shader object is modified when the shader is compiled. The
+%% string that is returned will be null terminated.
+%%
+%% ``gl:getShaderInfoLog'' returns in `InfoLog' as much of the information log as
+%% it can, up to a maximum of `MaxLength' characters. The number of characters actually
+%% returned, excluding the null termination character, is specified by `Length' . If
+%% the length of the returned string is not required, a value of `?NULL' can be passed
+%% in the `Length' argument. The size of the buffer required to store the returned
+%% information log can be obtained by calling {@link gl:getShaderiv/2} with the value `?GL_INFO_LOG_LENGTH'
+%% .
+%%
+%% The information log for a shader object is a string that may contain diagnostic messages,
+%% warning messages, and other information about the last compile operation. When a shader
+%% object is created, its information log will be a string of length 0.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetShaderInfoLog.xml">external</a> documentation.
+-spec getShaderInfoLog(Shader, BufSize) -> string() when Shader :: integer(),BufSize :: integer().
getShaderInfoLog(Shader,BufSize) ->
call(5462, <<Shader:?GLuint,BufSize:?GLsizei>>).
-%% @spec (Shader::integer(),BufSize::integer()) -> string()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetShaderSource.xml">external</a> documentation.
--spec getShaderSource(integer(),integer()) -> string().
+%% @doc Returns the source code string from a shader object
+%%
+%% ``gl:getShaderSource'' returns the concatenation of the source code strings from the
+%% shader object specified by `Shader' . The source code strings for a shader object
+%% are the result of a previous call to {@link gl:shaderSource/2} . The string returned by
+%% the function will be null terminated.
+%%
+%% ``gl:getShaderSource'' returns in `Source' as much of the source code string as
+%% it can, up to a maximum of `BufSize' characters. The number of characters actually
+%% returned, excluding the null termination character, is specified by `Length' . If
+%% the length of the returned string is not required, a value of `?NULL' can be passed
+%% in the `Length' argument. The size of the buffer required to store the returned source
+%% code string can be obtained by calling {@link gl:getShaderiv/2} with the value `?GL_SHADER_SOURCE_LENGTH'
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetShaderSource.xml">external</a> documentation.
+-spec getShaderSource(Shader, BufSize) -> string() when Shader :: integer(),BufSize :: integer().
getShaderSource(Shader,BufSize) ->
call(5463, <<Shader:?GLuint,BufSize:?GLsizei>>).
-%% @spec (Program::integer(),Name::string()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformLocation.xml">external</a> documentation.
--spec getUniformLocation(integer(),string()) -> integer().
+%% @doc Returns the location of a uniform variable
+%%
+%% ``gl:getUniformLocation '' returns an integer that represents the location of a specific
+%% uniform variable within a program object. `Name' must be a null terminated string
+%% that contains no white space. `Name' must be an active uniform variable name in `Program'
+%% that is not a structure, an array of structures, or a subcomponent of a vector or a matrix.
+%% This function returns -1 if `Name' does not correspond to an active uniform variable
+%% in `Program' , if `Name' starts with the reserved prefix "gl_", or if `Name'
+%% is associated with an atomic counter or a named uniform block.
+%%
+%% Uniform variables that are structures or arrays of structures may be queried by calling ``gl:getUniformLocation''
+%% for each field within the structure. The array element operator "[]" and the structure
+%% field operator "." may be used in `Name' in order to select elements within an array
+%% or fields within a structure. The result of using these operators is not allowed to be
+%% another structure, an array of structures, or a subcomponent of a vector or a matrix.
+%% Except if the last part of `Name' indicates a uniform variable array, the location
+%% of the first element of an array can be retrieved by using the name of the array, or by
+%% using the name appended by "[0]".
+%%
+%% The actual locations assigned to uniform variables are not known until the program object
+%% is linked successfully. After linking has occurred, the command ``gl:getUniformLocation''
+%% can be used to obtain the location of a uniform variable. This location value can then
+%% be passed to {@link gl:uniform1f/2} to set the value of the uniform variable or to {@link gl:getUniformfv/2}
+%% in order to query the current value of the uniform variable. After a program object has
+%% been linked successfully, the index values for uniform variables remain fixed until the
+%% next link command occurs. Uniform variable locations and values can only be queried after
+%% a link if the link was successful.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformLocation.xml">external</a> documentation.
+-spec getUniformLocation(Program, Name) -> integer() when Program :: integer(),Name :: string().
getUniformLocation(Program,Name) ->
call(5464, <<Program:?GLuint,(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 5) rem 8)) rem 8)>>).
-%% @spec (Program::integer(),Location::integer()) -> {float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniform.xml">external</a> documentation.
--spec getUniformfv(integer(),integer()) -> {float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}.
+%% @doc Returns the value of a uniform variable
+%%
+%% ``gl:getUniform'' returns in `Params' the value(s) of the specified uniform variable.
+%% The type of the uniform variable specified by `Location' determines the number of
+%% values returned. If the uniform variable is defined in the shader as a boolean, int, or
+%% float, a single value will be returned. If it is defined as a vec2, ivec2, or bvec2, two
+%% values will be returned. If it is defined as a vec3, ivec3, or bvec3, three values will
+%% be returned, and so on. To query values stored in uniform variables declared as arrays,
+%% call ``gl:getUniform'' for each element of the array. To query values stored in uniform
+%% variables declared as structures, call ``gl:getUniform'' for each field in the structure.
+%% The values for uniform variables declared as a matrix will be returned in column major
+%% order.
+%%
+%% The locations assigned to uniform variables are not known until the program object is
+%% linked. After linking has occurred, the command {@link gl:getUniformLocation/2} can be
+%% used to obtain the location of a uniform variable. This location value can then be passed
+%% to ``gl:getUniform'' in order to query the current value of the uniform variable. After
+%% a program object has been linked successfully, the index values for uniform variables
+%% remain fixed until the next link command occurs. The uniform variable values can only
+%% be queried after a link if the link was successful.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniform.xml">external</a> documentation.
+-spec getUniformfv(Program, Location) -> matrix() when Program :: integer(),Location :: integer().
getUniformfv(Program,Location) ->
call(5465, <<Program:?GLuint,Location:?GLint>>).
-%% @spec (Program::integer(),Location::integer()) -> {integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniform.xml">external</a> documentation.
--spec getUniformiv(integer(),integer()) -> {integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer()}.
+%% @doc
+%% See {@link getUniformfv/2}
+-spec getUniformiv(Program, Location) -> {integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer()} when Program :: integer(),Location :: integer().
getUniformiv(Program,Location) ->
call(5466, <<Program:?GLuint,Location:?GLint>>).
-%% @spec (Index::integer(),Pname::enum()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetVertexAttrib.xml">external</a> documentation.
--spec getVertexAttribdv(integer(),enum()) -> {float(),float(),float(),float()}.
+%% @doc Return a generic vertex attribute parameter
+%%
+%% ``gl:getVertexAttrib'' returns in `Params' the value of a generic vertex attribute
+%% parameter. The generic vertex attribute to be queried is specified by `Index' , and
+%% the parameter to be queried is specified by `Pname' .
+%%
+%% The accepted parameter names are as follows:
+%%
+%% `?GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING': `Params' returns a single value, the
+%% name of the buffer object currently bound to the binding point corresponding to generic
+%% vertex attribute array `Index' . If no buffer object is bound, 0 is returned. The
+%% initial value is 0.
+%%
+%% `?GL_VERTEX_ATTRIB_ARRAY_ENABLED': `Params' returns a single value that is non-zero
+%% (true) if the vertex attribute array for `Index' is enabled and 0 (false) if it is
+%% disabled. The initial value is `?GL_FALSE'.
+%%
+%% `?GL_VERTEX_ATTRIB_ARRAY_SIZE': `Params' returns a single value, the size of
+%% the vertex attribute array for `Index' . The size is the number of values for each
+%% element of the vertex attribute array, and it will be 1, 2, 3, or 4. The initial value
+%% is 4.
+%%
+%% `?GL_VERTEX_ATTRIB_ARRAY_STRIDE': `Params' returns a single value, the array
+%% stride for (number of bytes between successive elements in) the vertex attribute array
+%% for `Index' . A value of 0 indicates that the array elements are stored sequentially
+%% in memory. The initial value is 0.
+%%
+%% `?GL_VERTEX_ATTRIB_ARRAY_TYPE': `Params' returns a single value, a symbolic
+%% constant indicating the array type for the vertex attribute array for `Index' . Possible
+%% values are `?GL_BYTE', `?GL_UNSIGNED_BYTE', `?GL_SHORT', `?GL_UNSIGNED_SHORT'
+%% , `?GL_INT', `?GL_UNSIGNED_INT', `?GL_FLOAT', and `?GL_DOUBLE'. The
+%% initial value is `?GL_FLOAT'.
+%%
+%% `?GL_VERTEX_ATTRIB_ARRAY_NORMALIZED': `Params' returns a single value that is
+%% non-zero (true) if fixed-point data types for the vertex attribute array indicated by `Index'
+%% are normalized when they are converted to floating point, and 0 (false) otherwise. The
+%% initial value is `?GL_FALSE'.
+%%
+%% `?GL_VERTEX_ATTRIB_ARRAY_INTEGER': `Params' returns a single value that is non-zero
+%% (true) if fixed-point data types for the vertex attribute array indicated by `Index'
+%% have integer data types, and 0 (false) otherwise. The initial value is 0 (`?GL_FALSE').
+%%
+%%
+%% `?GL_VERTEX_ATTRIB_ARRAY_DIVISOR': `Params' returns a single value that is the
+%% frequency divisor used for instanced rendering. See {@link gl:vertexAttribDivisor/2} . The
+%% initial value is 0.
+%%
+%% `?GL_CURRENT_VERTEX_ATTRIB': `Params' returns four values that represent the
+%% current value for the generic vertex attribute specified by index. Generic vertex attribute
+%% 0 is unique in that it has no current state, so an error will be generated if `Index'
+%% is 0. The initial value for all other generic vertex attributes is (0,0,0,1).
+%%
+%% ``gl:getVertexAttribdv'' and ``gl:getVertexAttribfv'' return the current attribute
+%% values as four single-precision floating-point values; ``gl:getVertexAttribiv'' reads
+%% them as floating-point values and converts them to four integer values; ``gl:getVertexAttribIiv''
+%% and ``gl:getVertexAttribIuiv'' read and return them as signed or unsigned integer values,
+%% respectively; ``gl:getVertexAttribLdv'' reads and returns them as four double-precision
+%% floating-point values.
+%%
+%% All of the parameters except `?GL_CURRENT_VERTEX_ATTRIB' represent state stored in
+%% the currently bound vertex array object.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetVertexAttrib.xml">external</a> documentation.
+-spec getVertexAttribdv(Index, Pname) -> {float(),float(),float(),float()} when Index :: integer(),Pname :: enum().
getVertexAttribdv(Index,Pname) ->
call(5467, <<Index:?GLuint,Pname:?GLenum>>).
-%% @spec (Index::integer(),Pname::enum()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetVertexAttrib.xml">external</a> documentation.
--spec getVertexAttribfv(integer(),enum()) -> {float(),float(),float(),float()}.
+%% @doc
+%% See {@link getVertexAttribdv/2}
+-spec getVertexAttribfv(Index, Pname) -> {float(),float(),float(),float()} when Index :: integer(),Pname :: enum().
getVertexAttribfv(Index,Pname) ->
call(5468, <<Index:?GLuint,Pname:?GLenum>>).
-%% @spec (Index::integer(),Pname::enum()) -> {integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetVertexAttrib.xml">external</a> documentation.
--spec getVertexAttribiv(integer(),enum()) -> {integer(),integer(),integer(),integer()}.
+%% @doc
+%% See {@link getVertexAttribdv/2}
+-spec getVertexAttribiv(Index, Pname) -> {integer(),integer(),integer(),integer()} when Index :: integer(),Pname :: enum().
getVertexAttribiv(Index,Pname) ->
call(5469, <<Index:?GLuint,Pname:?GLenum>>).
-%% @spec (Program::integer()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsProgram.xml">external</a> documentation.
--spec isProgram(integer()) -> 0|1.
+%% @doc Determines if a name corresponds to a program object
+%%
+%% ``gl:isProgram'' returns `?GL_TRUE' if `Program' is the name of a program
+%% object previously created with {@link gl:createProgram/0} and not yet deleted with {@link gl:deleteProgram/1}
+%% . If `Program' is zero or a non-zero value that is not the name of a program object,
+%% or if an error occurs, ``gl:isProgram'' returns `?GL_FALSE'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsProgram.xml">external</a> documentation.
+-spec isProgram(Program) -> 0|1 when Program :: integer().
isProgram(Program) ->
call(5470, <<Program:?GLuint>>).
-%% @spec (Shader::integer()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsShader.xml">external</a> documentation.
--spec isShader(integer()) -> 0|1.
+%% @doc Determines if a name corresponds to a shader object
+%%
+%% ``gl:isShader'' returns `?GL_TRUE' if `Shader' is the name of a shader object
+%% previously created with {@link gl:createShader/1} and not yet deleted with {@link gl:deleteShader/1}
+%% . If `Shader' is zero or a non-zero value that is not the name of a shader object,
+%% or if an error occurs, ``gl:isShader '' returns `?GL_FALSE'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsShader.xml">external</a> documentation.
+-spec isShader(Shader) -> 0|1 when Shader :: integer().
isShader(Shader) ->
call(5471, <<Shader:?GLuint>>).
-%% @spec (Program::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLinkProgram.xml">external</a> documentation.
--spec linkProgram(integer()) -> ok.
+%% @doc Links a program object
+%%
+%% ``gl:linkProgram'' links the program object specified by `Program' . If any shader
+%% objects of type `?GL_VERTEX_SHADER' are attached to `Program' , they will be
+%% used to create an executable that will run on the programmable vertex processor. If any
+%% shader objects of type `?GL_GEOMETRY_SHADER' are attached to `Program' , they
+%% will be used to create an executable that will run on the programmable geometry processor.
+%% If any shader objects of type `?GL_FRAGMENT_SHADER' are attached to `Program' ,
+%% they will be used to create an executable that will run on the programmable fragment processor.
+%%
+%%
+%% The status of the link operation will be stored as part of the program object's state.
+%% This value will be set to `?GL_TRUE' if the program object was linked without errors
+%% and is ready for use, and `?GL_FALSE' otherwise. It can be queried by calling {@link gl:getProgramiv/2}
+%% with arguments `Program' and `?GL_LINK_STATUS'.
+%%
+%% As a result of a successful link operation, all active user-defined uniform variables
+%% belonging to `Program' will be initialized to 0, and each of the program object's
+%% active uniform variables will be assigned a location that can be queried by calling {@link gl:getUniformLocation/2}
+%% . Also, any active user-defined attribute variables that have not been bound to a generic
+%% vertex attribute index will be bound to one at this time.
+%%
+%% Linking of a program object can fail for a number of reasons as specified in the `OpenGL Shading Language Specification'
+%% . The following lists some of the conditions that will cause a link error.
+%%
+%% The number of active attribute variables supported by the implementation has been exceeded.
+%%
+%%
+%% The storage limit for uniform variables has been exceeded.
+%%
+%% The number of active uniform variables supported by the implementation has been exceeded.
+%%
+%% The `main' function is missing for the vertex, geometry or fragment shader.
+%%
+%% A varying variable actually used in the fragment shader is not declared in the same way
+%% (or is not declared at all) in the vertex shader, or geometry shader shader if present.
+%%
+%% A reference to a function or variable name is unresolved.
+%%
+%% A shared global is declared with two different types or two different initial values.
+%%
+%% One or more of the attached shader objects has not been successfully compiled.
+%%
+%% Binding a generic attribute matrix caused some rows of the matrix to fall outside the
+%% allowed maximum of `?GL_MAX_VERTEX_ATTRIBS'.
+%%
+%% Not enough contiguous vertex attribute slots could be found to bind attribute matrices.
+%%
+%% The program object contains objects to form a fragment shader but does not contain objects
+%% to form a vertex shader.
+%%
+%% The program object contains objects to form a geometry shader but does not contain objects
+%% to form a vertex shader.
+%%
+%% The program object contains objects to form a geometry shader and the input primitive
+%% type, output primitive type, or maximum output vertex count is not specified in any compiled
+%% geometry shader object.
+%%
+%% The program object contains objects to form a geometry shader and the input primitive
+%% type, output primitive type, or maximum output vertex count is specified differently in
+%% multiple geometry shader objects.
+%%
+%% The number of active outputs in the fragment shader is greater than the value of `?GL_MAX_DRAW_BUFFERS'
+%% .
+%%
+%% The program has an active output assigned to a location greater than or equal to the value
+%% of `?GL_MAX_DUAL_SOURCE_DRAW_BUFFERS' and has an active output assigned an index
+%% greater than or equal to one.
+%%
+%% More than one varying out variable is bound to the same number and index.
+%%
+%% The explicit binding assigments do not leave enough space for the linker to automatically
+%% assign a location for a varying out array, which requires multiple contiguous locations.
+%%
+%% The `Count' specified by {@link gl:transformFeedbackVaryings/3} is non-zero, but the
+%% program object has no vertex or geometry shader.
+%%
+%% Any variable name specified to {@link gl:transformFeedbackVaryings/3} in the `Varyings'
+%% array is not declared as an output in the vertex shader (or the geometry shader, if active).
+%%
+%%
+%% Any two entries in the `Varyings' array given {@link gl:transformFeedbackVaryings/3}
+%% specify the same varying variable.
+%%
+%% The total number of components to capture in any transform feedback varying variable is
+%% greater than the constant `?GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS' and the
+%% buffer mode is `?SEPARATE_ATTRIBS'.
+%%
+%% When a program object has been successfully linked, the program object can be made part
+%% of current state by calling {@link gl:useProgram/1} . Whether or not the link operation
+%% was successful, the program object's information log will be overwritten. The information
+%% log can be retrieved by calling {@link gl:getProgramInfoLog/2} .
+%%
+%% ``gl:linkProgram'' will also install the generated executables as part of the current
+%% rendering state if the link operation was successful and the specified program object
+%% is already currently in use as a result of a previous call to {@link gl:useProgram/1} .
+%% If the program object currently in use is relinked unsuccessfully, its link status will
+%% be set to `?GL_FALSE' , but the executables and associated state will remain part
+%% of the current state until a subsequent call to ``gl:useProgram'' removes it from use.
+%% After it is removed from use, it cannot be made part of current state until it has been
+%% successfully relinked.
+%%
+%% If `Program' contains shader objects of type `?GL_VERTEX_SHADER', and optionally
+%% of type `?GL_GEOMETRY_SHADER', but does not contain shader objects of type `?GL_FRAGMENT_SHADER'
+%% , the vertex shader executable will be installed on the programmable vertex processor,
+%% the geometry shader executable, if present, will be installed on the programmable geometry
+%% processor, but no executable will be installed on the fragment processor. The results
+%% of rasterizing primitives with such a program will be undefined.
+%%
+%% The program object's information log is updated and the program is generated at the time
+%% of the link operation. After the link operation, applications are free to modify attached
+%% shader objects, compile attached shader objects, detach shader objects, delete shader
+%% objects, and attach additional shader objects. None of these operations affects the information
+%% log or the program that is part of the program object.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLinkProgram.xml">external</a> documentation.
+-spec linkProgram(Program) -> ok when Program :: integer().
linkProgram(Program) ->
cast(5472, <<Program:?GLuint>>).
-%% @spec (Shader::integer(),String::[string()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glShaderSource.xml">external</a> documentation.
--spec shaderSource(integer(),[string()]) -> ok.
+%% @doc Replaces the source code in a shader object
+%%
+%% ``gl:shaderSource'' sets the source code in `Shader' to the source code in the
+%% array of strings specified by `String' . Any source code previously stored in the
+%% shader object is completely replaced. The number of strings in the array is specified
+%% by `Count' . If `Length' is `?NULL', each string is assumed to be null
+%% terminated. If `Length' is a value other than `?NULL', it points to an array
+%% containing a string length for each of the corresponding elements of `String' .
+%% Each element in the `Length' array may contain the length of the corresponding
+%% string (the null character is not counted as part of the string length) or a value less
+%% than 0 to indicate that the string is null terminated. The source code strings are not
+%% scanned or parsed at this time; they are simply copied into the specified shader object.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glShaderSource.xml">external</a> documentation.
+-spec shaderSource(Shader, String) -> ok when Shader :: integer(),String :: [string()].
shaderSource(Shader,String) ->
StringTemp = list_to_binary([[Str|[0]] || Str <- String ]),
cast(5473, <<Shader:?GLuint,(length(String)):?GLuint,(size(StringTemp)):?GLuint,(StringTemp)/binary,0:((8-((size(StringTemp)+0) rem 8)) rem 8)>>).
-%% @spec (Program::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUseProgram.xml">external</a> documentation.
--spec useProgram(integer()) -> ok.
+%% @doc Installs a program object as part of current rendering state
+%%
+%% ``gl:useProgram'' installs the program object specified by `Program' as part of
+%% current rendering state. One or more executables are created in a program object by
+%% successfully attaching shader objects to it with {@link gl:attachShader/2} , successfully
+%% compiling the shader objects with {@link gl:compileShader/1} , and successfully linking
+%% the program object with {@link gl:linkProgram/1} .
+%%
+%% A program object will contain an executable that will run on the vertex processor if
+%% it contains one or more shader objects of type `?GL_VERTEX_SHADER' that have been
+%% successfully compiled and linked. A program object will contain an executable that will
+%% run on the geometry processor if it contains one or more shader objects of type `?GL_GEOMETRY_SHADER'
+%% that have been successfully compiled and linked. Similarly, a program object will contain
+%% an executable that will run on the fragment processor if it contains one or more shader
+%% objects of type `?GL_FRAGMENT_SHADER' that have been successfully compiled and
+%% linked.
+%%
+%% While a program object is in use, applications are free to modify attached shader objects,
+%% compile attached shader objects, attach additional shader objects, and detach or delete
+%% shader objects. None of these operations will affect the executables that are part of
+%% the current state. However, relinking the program object that is currently in use will
+%% install the program object as part of the current rendering state if the link operation
+%% was successful (see {@link gl:linkProgram/1} ). If the program object currently in use
+%% is relinked unsuccessfully, its link status will be set to `?GL_FALSE', but the
+%% executables and associated state will remain part of the current state until a subsequent
+%% call to ``gl:useProgram'' removes it from use. After it is removed from use, it cannot
+%% be made part of current state until it has been successfully relinked.
+%%
+%% If `Program' is zero, then the current rendering state refers to an `invalid'
+%% program object and the results of shader execution are undefined. However, this is not
+%% an error.
+%%
+%% If `Program' does not contain shader objects of type `?GL_FRAGMENT_SHADER',
+%% an executable will be installed on the vertex, and possibly geometry processors, but
+%% the results of fragment shader execution will be undefined.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUseProgram.xml">external</a> documentation.
+-spec useProgram(Program) -> ok when Program :: integer().
useProgram(Program) ->
cast(5474, <<Program:?GLuint>>).
-%% @spec (Location::integer(),V0::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform1f(integer(),float()) -> ok.
+%% @doc Specify the value of a uniform variable for the current program object
+%%
+%% ``gl:uniform'' modifies the value of a uniform variable or a uniform variable array.
+%% The location of the uniform variable to be modified is specified by `Location' , which
+%% should be a value returned by {@link gl:getUniformLocation/2} . ``gl:uniform'' operates
+%% on the program object that was made part of current state by calling {@link gl:useProgram/1}
+%% .
+%%
+%% The commands ``gl:uniform{1|2|3|4}{f|i|ui}'' are used to change the value of the uniform
+%% variable specified by `Location' using the values passed as arguments. The number
+%% specified in the command should match the number of components in the data type of the
+%% specified uniform variable (e.g., `1' for float, int, unsigned int, bool; `2'
+%% for vec2, ivec2, uvec2, bvec2, etc.). The suffix `f' indicates that floating-point
+%% values are being passed; the suffix `i' indicates that integer values are being passed;
+%% the suffix `ui' indicates that unsigned integer values are being passed, and this
+%% type should also match the data type of the specified uniform variable. The `i' variants
+%% of this function should be used to provide values for uniform variables defined as int, ivec2
+%% , ivec3, ivec4, or arrays of these. The `ui' variants of this function should be
+%% used to provide values for uniform variables defined as unsigned int, uvec2, uvec3, uvec4,
+%% or arrays of these. The `f' variants should be used to provide values for uniform
+%% variables of type float, vec2, vec3, vec4, or arrays of these. Either the `i', `ui'
+%% or `f' variants may be used to provide values for uniform variables of type bool, bvec2
+%% , bvec3, bvec4, or arrays of these. The uniform variable will be set to false if the input
+%% value is 0 or 0.0f, and it will be set to true otherwise.
+%%
+%% All active uniform variables defined in a program object are initialized to 0 when the
+%% program object is linked successfully. They retain the values assigned to them by a call
+%% to ``gl:uniform '' until the next successful link operation occurs on the program object,
+%% when they are once again initialized to 0.
+%%
+%% The commands ``gl:uniform{1|2|3|4}{f|i|ui}v'' can be used to modify a single uniform
+%% variable or a uniform variable array. These commands pass a count and a pointer to the
+%% values to be loaded into a uniform variable or a uniform variable array. A count of 1
+%% should be used if modifying the value of a single uniform variable, and a count of 1 or
+%% greater can be used to modify an entire array or part of an array. When loading `n'
+%% elements starting at an arbitrary position `m' in a uniform variable array, elements
+%% `m' + `n' - 1 in the array will be replaced with the new values. If `M' + `N'
+%% - 1 is larger than the size of the uniform variable array, values for all array elements
+%% beyond the end of the array will be ignored. The number specified in the name of the command
+%% indicates the number of components for each element in `Value' , and it should match
+%% the number of components in the data type of the specified uniform variable (e.g., `1'
+%% for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The data type specified
+%% in the name of the command must match the data type for the specified uniform variable
+%% as described previously for ``gl:uniform{1|2|3|4}{f|i|ui}''.
+%%
+%% For uniform variable arrays, each element of the array is considered to be of the type
+%% indicated in the name of the command (e.g., ``gl:uniform3f'' or ``gl:uniform3fv''
+%% can be used to load a uniform variable array of type vec3). The number of elements of
+%% the uniform variable array to be modified is specified by `Count'
+%%
+%% The commands ``gl:uniformMatrix{2|3|4|2x3|3x2|2x4|4x2|3x4|4x3}fv'' are used to modify
+%% a matrix or an array of matrices. The numbers in the command name are interpreted as the
+%% dimensionality of the matrix. The number `2' indicates a 2 � 2 matrix (i.e., 4 values),
+%% the number `3' indicates a 3 � 3 matrix (i.e., 9 values), and the number `4'
+%% indicates a 4 � 4 matrix (i.e., 16 values). Non-square matrix dimensionality is explicit,
+%% with the first number representing the number of columns and the second number representing
+%% the number of rows. For example, `2x4' indicates a 2 � 4 matrix with 2 columns and
+%% 4 rows (i.e., 8 values). If `Transpose' is `?GL_FALSE', each matrix is assumed
+%% to be supplied in column major order. If `Transpose' is `?GL_TRUE', each matrix
+%% is assumed to be supplied in row major order. The `Count' argument indicates the
+%% number of matrices to be passed. A count of 1 should be used if modifying the value of
+%% a single matrix, and a count greater than 1 can be used to modify an array of matrices.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
+-spec uniform1f(Location, V0) -> ok when Location :: integer(),V0 :: float().
uniform1f(Location,V0) ->
cast(5475, <<Location:?GLint,V0:?GLfloat>>).
-%% @spec (Location::integer(),V0::float(),V1::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform2f(integer(),float(),float()) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform2f(Location, V0, V1) -> ok when Location :: integer(),V0 :: float(),V1 :: float().
uniform2f(Location,V0,V1) ->
cast(5476, <<Location:?GLint,V0:?GLfloat,V1:?GLfloat>>).
-%% @spec (Location::integer(),V0::float(),V1::float(),V2::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform3f(integer(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform3f(Location, V0, V1, V2) -> ok when Location :: integer(),V0 :: float(),V1 :: float(),V2 :: float().
uniform3f(Location,V0,V1,V2) ->
cast(5477, <<Location:?GLint,V0:?GLfloat,V1:?GLfloat,V2:?GLfloat>>).
-%% @spec (Location::integer(),V0::float(),V1::float(),V2::float(),V3::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform4f(integer(),float(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform4f(Location, V0, V1, V2, V3) -> ok when Location :: integer(),V0 :: float(),V1 :: float(),V2 :: float(),V3 :: float().
uniform4f(Location,V0,V1,V2,V3) ->
cast(5478, <<Location:?GLint,V0:?GLfloat,V1:?GLfloat,V2:?GLfloat,V3:?GLfloat>>).
-%% @spec (Location::integer(),V0::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform1i(integer(),integer()) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform1i(Location, V0) -> ok when Location :: integer(),V0 :: integer().
uniform1i(Location,V0) ->
cast(5479, <<Location:?GLint,V0:?GLint>>).
-%% @spec (Location::integer(),V0::integer(),V1::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform2i(integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform2i(Location, V0, V1) -> ok when Location :: integer(),V0 :: integer(),V1 :: integer().
uniform2i(Location,V0,V1) ->
cast(5480, <<Location:?GLint,V0:?GLint,V1:?GLint>>).
-%% @spec (Location::integer(),V0::integer(),V1::integer(),V2::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform3i(integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform3i(Location, V0, V1, V2) -> ok when Location :: integer(),V0 :: integer(),V1 :: integer(),V2 :: integer().
uniform3i(Location,V0,V1,V2) ->
cast(5481, <<Location:?GLint,V0:?GLint,V1:?GLint,V2:?GLint>>).
-%% @spec (Location::integer(),V0::integer(),V1::integer(),V2::integer(),V3::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform4i(integer(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform4i(Location, V0, V1, V2, V3) -> ok when Location :: integer(),V0 :: integer(),V1 :: integer(),V2 :: integer(),V3 :: integer().
uniform4i(Location,V0,V1,V2,V3) ->
cast(5482, <<Location:?GLint,V0:?GLint,V1:?GLint,V2:?GLint,V3:?GLint>>).
-%% @spec (Location::integer(),Value::[float()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform1fv(integer(),[float()]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform1fv(Location, Value) -> ok when Location :: integer(),Value :: [float()].
uniform1fv(Location,Value) ->
cast(5483, <<Location:?GLint,(length(Value)):?GLuint,
(<< <<C:?GLfloat>> || C <- Value>>)/binary,0:(((length(Value)) rem 2)*32)>>).
-%% @spec (Location::integer(),Value::[{float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform2fv(integer(),[{float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform2fv(Location, Value) -> ok when Location :: integer(),Value :: [{float(),float()}].
uniform2fv(Location,Value) ->
cast(5484, <<Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat>> || {V1,V2} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Value::[{float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform3fv(integer(),[{float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform3fv(Location, Value) -> ok when Location :: integer(),Value :: [{float(),float(),float()}].
uniform3fv(Location,Value) ->
cast(5485, <<Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat>> || {V1,V2,V3} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Value::[{float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform4fv(integer(),[{float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform4fv(Location, Value) -> ok when Location :: integer(),Value :: [{float(),float(),float(),float()}].
uniform4fv(Location,Value) ->
cast(5486, <<Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat>> || {V1,V2,V3,V4} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Value::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform1iv(integer(),[integer()]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform1iv(Location, Value) -> ok when Location :: integer(),Value :: [integer()].
uniform1iv(Location,Value) ->
cast(5487, <<Location:?GLint,(length(Value)):?GLuint,
(<< <<C:?GLint>> || C <- Value>>)/binary,0:(((length(Value)) rem 2)*32)>>).
-%% @spec (Location::integer(),Value::[{integer(),integer()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform2iv(integer(),[{integer(),integer()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform2iv(Location, Value) -> ok when Location :: integer(),Value :: [{integer(),integer()}].
uniform2iv(Location,Value) ->
cast(5488, <<Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLint,V2:?GLint>> || {V1,V2} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Value::[{integer(),integer(),integer()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform3iv(integer(),[{integer(),integer(),integer()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform3iv(Location, Value) -> ok when Location :: integer(),Value :: [{integer(),integer(),integer()}].
uniform3iv(Location,Value) ->
cast(5489, <<Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLint,V2:?GLint,V3:?GLint>> || {V1,V2,V3} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Value::[{integer(),integer(),integer(),integer()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform4iv(integer(),[{integer(),integer(),integer(),integer()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform4iv(Location, Value) -> ok when Location :: integer(),Value :: [{integer(),integer(),integer(),integer()}].
uniform4iv(Location,Value) ->
cast(5490, <<Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLint,V2:?GLint,V3:?GLint,V4:?GLint>> || {V1,V2,V3,V4} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix.xml">external</a> documentation.
--spec uniformMatrix2fv(integer(),0|1,[{float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix2fv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float()}].
uniformMatrix2fv(Location,Transpose,Value) ->
cast(5491, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat>> || {V1,V2,V3,V4} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix.xml">external</a> documentation.
--spec uniformMatrix3fv(integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix3fv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float()}].
uniformMatrix3fv(Location,Transpose,Value) ->
cast(5492, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat,V7:?GLfloat,V8:?GLfloat,V9:?GLfloat>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix.xml">external</a> documentation.
--spec uniformMatrix4fv(integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix4fv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}].
uniformMatrix4fv(Location,Transpose,Value) ->
cast(5493, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat,V7:?GLfloat,V8:?GLfloat,V9:?GLfloat,V10:?GLfloat,V11:?GLfloat,V12:?GLfloat,V13:?GLfloat,V14:?GLfloat,V15:?GLfloat,V16:?GLfloat>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,V13,V14,V15,V16} <- Value>>)/binary>>).
-%% @spec (Program::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glValidateProgram.xml">external</a> documentation.
--spec validateProgram(integer()) -> ok.
+%% @doc Validates a program object
+%%
+%% ``gl:validateProgram'' checks to see whether the executables contained in `Program'
+%% can execute given the current OpenGL state. The information generated by the validation
+%% process will be stored in `Program' 's information log. The validation information
+%% may consist of an empty string, or it may be a string containing information about how
+%% the current program object interacts with the rest of current OpenGL state. This provides
+%% a way for OpenGL implementers to convey more information about why the current program
+%% is inefficient, suboptimal, failing to execute, and so on.
+%%
+%% The status of the validation operation will be stored as part of the program object's
+%% state. This value will be set to `?GL_TRUE' if the validation succeeded, and `?GL_FALSE'
+%% otherwise. It can be queried by calling {@link gl:getProgramiv/2} with arguments `Program'
+%% and `?GL_VALIDATE_STATUS'. If validation is successful, `Program' is guaranteed
+%% to execute given the current state. Otherwise, `Program' is guaranteed to not execute.
+%%
+%%
+%% This function is typically useful only during application development. The informational
+%% string stored in the information log is completely implementation dependent; therefore,
+%% an application should not expect different OpenGL implementations to produce identical
+%% information strings.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glValidateProgram.xml">external</a> documentation.
+-spec validateProgram(Program) -> ok when Program :: integer().
validateProgram(Program) ->
cast(5494, <<Program:?GLuint>>).
-%% @spec (Index::integer(),X::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib1d(integer(),float()) -> ok.
+%% @doc Specifies the value of a generic vertex attribute
+%%
+%% The ``gl:vertexAttrib'' family of entry points allows an application to pass generic
+%% vertex attributes in numbered locations.
+%%
+%% Generic attributes are defined as four-component values that are organized into an array.
+%% The first entry of this array is numbered 0, and the size of the array is specified by
+%% the implementation-dependent constant `?GL_MAX_VERTEX_ATTRIBS'. Individual elements
+%% of this array can be modified with a ``gl:vertexAttrib'' call that specifies the index
+%% of the element to be modified and a value for that element.
+%%
+%% These commands can be used to specify one, two, three, or all four components of the generic
+%% vertex attribute specified by `Index' . A `1' in the name of the command indicates
+%% that only one value is passed, and it will be used to modify the first component of the
+%% generic vertex attribute. The second and third components will be set to 0, and the fourth
+%% component will be set to 1. Similarly, a `2' in the name of the command indicates
+%% that values are provided for the first two components, the third component will be set
+%% to 0, and the fourth component will be set to 1. A `3' in the name of the command
+%% indicates that values are provided for the first three components and the fourth component
+%% will be set to 1, whereas a `4' in the name indicates that values are provided for
+%% all four components.
+%%
+%% The letters `s', `f', `i', `d', `ub', `us', and `ui'
+%% indicate whether the arguments are of type short, float, int, double, unsigned byte, unsigned
+%% short, or unsigned int. When `v' is appended to the name, the commands can take a
+%% pointer to an array of such values.
+%%
+%% Additional capitalized letters can indicate further alterations to the default behavior
+%% of the glVertexAttrib function:
+%%
+%% The commands containing `N' indicate that the arguments will be passed as fixed-point
+%% values that are scaled to a normalized range according to the component conversion rules
+%% defined by the OpenGL specification. Signed values are understood to represent fixed-point
+%% values in the range [-1,1], and unsigned values are understood to represent fixed-point
+%% values in the range [0,1].
+%%
+%% The commands containing `I' indicate that the arguments are extended to full signed
+%% or unsigned integers.
+%%
+%% The commands containing `P' indicate that the arguments are stored as packed components
+%% within a larger natural type.
+%%
+%% The commands containing `L' indicate that the arguments are full 64-bit quantities
+%% and should be passed directly to shader inputs declared as 64-bit double precision types.
+%%
+%%
+%% OpenGL Shading Language attribute variables are allowed to be of type mat2, mat3, or mat4.
+%% Attributes of these types may be loaded using the ``gl:vertexAttrib'' entry points.
+%% Matrices must be loaded into successive generic attribute slots in column major order,
+%% with one column of the matrix in each generic attribute slot.
+%%
+%% A user-defined attribute variable declared in a vertex shader can be bound to a generic
+%% attribute index by calling {@link gl:bindAttribLocation/3} . This allows an application
+%% to use more descriptive variable names in a vertex shader. A subsequent change to the
+%% specified generic vertex attribute will be immediately reflected as a change to the corresponding
+%% attribute variable in the vertex shader.
+%%
+%% The binding between a generic vertex attribute index and a user-defined attribute variable
+%% in a vertex shader is part of the state of a program object, but the current value of
+%% the generic vertex attribute is not. The value of each generic vertex attribute is part
+%% of current state, just like standard vertex attributes, and it is maintained even if a
+%% different program object is used.
+%%
+%% An application may freely modify generic vertex attributes that are not bound to a named
+%% vertex shader attribute variable. These values are simply maintained as part of current
+%% state and will not be accessed by the vertex shader. If a generic vertex attribute bound
+%% to an attribute variable in a vertex shader is not updated while the vertex shader is
+%% executing, the vertex shader will repeatedly use the current value for the generic vertex
+%% attribute.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
+-spec vertexAttrib1d(Index, X) -> ok when Index :: integer(),X :: float().
vertexAttrib1d(Index,X) ->
cast(5495, <<Index:?GLuint,0:32,X:?GLdouble>>).
-%% @spec (Index,{X}) -> ok
%% @equiv vertexAttrib1d(Index,X)
--spec vertexAttrib1dv(integer(),{float()}) -> ok.
+-spec vertexAttrib1dv(Index :: integer(),V) -> ok when V :: {X :: float()}.
vertexAttrib1dv(Index,{X}) -> vertexAttrib1d(Index,X).
-%% @spec (Index::integer(),X::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib1f(integer(),float()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib1f(Index, X) -> ok when Index :: integer(),X :: float().
vertexAttrib1f(Index,X) ->
cast(5496, <<Index:?GLuint,X:?GLfloat>>).
-%% @spec (Index,{X}) -> ok
%% @equiv vertexAttrib1f(Index,X)
--spec vertexAttrib1fv(integer(),{float()}) -> ok.
+-spec vertexAttrib1fv(Index :: integer(),V) -> ok when V :: {X :: float()}.
vertexAttrib1fv(Index,{X}) -> vertexAttrib1f(Index,X).
-%% @spec (Index::integer(),X::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib1s(integer(),integer()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib1s(Index, X) -> ok when Index :: integer(),X :: integer().
vertexAttrib1s(Index,X) ->
cast(5497, <<Index:?GLuint,X:?GLshort>>).
-%% @spec (Index,{X}) -> ok
%% @equiv vertexAttrib1s(Index,X)
--spec vertexAttrib1sv(integer(),{integer()}) -> ok.
+-spec vertexAttrib1sv(Index :: integer(),V) -> ok when V :: {X :: integer()}.
vertexAttrib1sv(Index,{X}) -> vertexAttrib1s(Index,X).
-%% @spec (Index::integer(),X::float(),Y::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib2d(integer(),float(),float()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib2d(Index, X, Y) -> ok when Index :: integer(),X :: float(),Y :: float().
vertexAttrib2d(Index,X,Y) ->
cast(5498, <<Index:?GLuint,0:32,X:?GLdouble,Y:?GLdouble>>).
-%% @spec (Index,{X,Y}) -> ok
%% @equiv vertexAttrib2d(Index,X,Y)
--spec vertexAttrib2dv(integer(),{float(),float()}) -> ok.
+-spec vertexAttrib2dv(Index :: integer(),V) -> ok when V :: {X :: float(),Y :: float()}.
vertexAttrib2dv(Index,{X,Y}) -> vertexAttrib2d(Index,X,Y).
-%% @spec (Index::integer(),X::float(),Y::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib2f(integer(),float(),float()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib2f(Index, X, Y) -> ok when Index :: integer(),X :: float(),Y :: float().
vertexAttrib2f(Index,X,Y) ->
cast(5499, <<Index:?GLuint,X:?GLfloat,Y:?GLfloat>>).
-%% @spec (Index,{X,Y}) -> ok
%% @equiv vertexAttrib2f(Index,X,Y)
--spec vertexAttrib2fv(integer(),{float(),float()}) -> ok.
+-spec vertexAttrib2fv(Index :: integer(),V) -> ok when V :: {X :: float(),Y :: float()}.
vertexAttrib2fv(Index,{X,Y}) -> vertexAttrib2f(Index,X,Y).
-%% @spec (Index::integer(),X::integer(),Y::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib2s(integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib2s(Index, X, Y) -> ok when Index :: integer(),X :: integer(),Y :: integer().
vertexAttrib2s(Index,X,Y) ->
cast(5500, <<Index:?GLuint,X:?GLshort,Y:?GLshort>>).
-%% @spec (Index,{X,Y}) -> ok
%% @equiv vertexAttrib2s(Index,X,Y)
--spec vertexAttrib2sv(integer(),{integer(),integer()}) -> ok.
+-spec vertexAttrib2sv(Index :: integer(),V) -> ok when V :: {X :: integer(),Y :: integer()}.
vertexAttrib2sv(Index,{X,Y}) -> vertexAttrib2s(Index,X,Y).
-%% @spec (Index::integer(),X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib3d(integer(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib3d(Index, X, Y, Z) -> ok when Index :: integer(),X :: float(),Y :: float(),Z :: float().
vertexAttrib3d(Index,X,Y,Z) ->
cast(5501, <<Index:?GLuint,0:32,X:?GLdouble,Y:?GLdouble,Z:?GLdouble>>).
-%% @spec (Index,{X,Y,Z}) -> ok
%% @equiv vertexAttrib3d(Index,X,Y,Z)
--spec vertexAttrib3dv(integer(),{float(),float(),float()}) -> ok.
+-spec vertexAttrib3dv(Index :: integer(),V) -> ok when V :: {X :: float(),Y :: float(),Z :: float()}.
vertexAttrib3dv(Index,{X,Y,Z}) -> vertexAttrib3d(Index,X,Y,Z).
-%% @spec (Index::integer(),X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib3f(integer(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib3f(Index, X, Y, Z) -> ok when Index :: integer(),X :: float(),Y :: float(),Z :: float().
vertexAttrib3f(Index,X,Y,Z) ->
cast(5502, <<Index:?GLuint,X:?GLfloat,Y:?GLfloat,Z:?GLfloat>>).
-%% @spec (Index,{X,Y,Z}) -> ok
%% @equiv vertexAttrib3f(Index,X,Y,Z)
--spec vertexAttrib3fv(integer(),{float(),float(),float()}) -> ok.
+-spec vertexAttrib3fv(Index :: integer(),V) -> ok when V :: {X :: float(),Y :: float(),Z :: float()}.
vertexAttrib3fv(Index,{X,Y,Z}) -> vertexAttrib3f(Index,X,Y,Z).
-%% @spec (Index::integer(),X::integer(),Y::integer(),Z::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib3s(integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib3s(Index, X, Y, Z) -> ok when Index :: integer(),X :: integer(),Y :: integer(),Z :: integer().
vertexAttrib3s(Index,X,Y,Z) ->
cast(5503, <<Index:?GLuint,X:?GLshort,Y:?GLshort,Z:?GLshort>>).
-%% @spec (Index,{X,Y,Z}) -> ok
%% @equiv vertexAttrib3s(Index,X,Y,Z)
--spec vertexAttrib3sv(integer(),{integer(),integer(),integer()}) -> ok.
+-spec vertexAttrib3sv(Index :: integer(),V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer()}.
vertexAttrib3sv(Index,{X,Y,Z}) -> vertexAttrib3s(Index,X,Y,Z).
-%% @spec (Index::integer(),V::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib4Nbv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib4Nbv(Index, V) -> ok when Index :: integer(),V :: {integer(),integer(),integer(),integer()}.
vertexAttrib4Nbv(Index,{V1,V2,V3,V4}) ->
cast(5504, <<Index:?GLuint,V1:?GLbyte,V2:?GLbyte,V3:?GLbyte,V4:?GLbyte>>).
-%% @spec (Index::integer(),V::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib4Niv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib4Niv(Index, V) -> ok when Index :: integer(),V :: {integer(),integer(),integer(),integer()}.
vertexAttrib4Niv(Index,{V1,V2,V3,V4}) ->
cast(5505, <<Index:?GLuint,V1:?GLint,V2:?GLint,V3:?GLint,V4:?GLint>>).
-%% @spec (Index::integer(),V::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib4Nsv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib4Nsv(Index, V) -> ok when Index :: integer(),V :: {integer(),integer(),integer(),integer()}.
vertexAttrib4Nsv(Index,{V1,V2,V3,V4}) ->
cast(5506, <<Index:?GLuint,V1:?GLshort,V2:?GLshort,V3:?GLshort,V4:?GLshort>>).
-%% @spec (Index::integer(),X::integer(),Y::integer(),Z::integer(),W::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib4Nub(integer(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib4Nub(Index, X, Y, Z, W) -> ok when Index :: integer(),X :: integer(),Y :: integer(),Z :: integer(),W :: integer().
vertexAttrib4Nub(Index,X,Y,Z,W) ->
cast(5507, <<Index:?GLuint,X:?GLubyte,Y:?GLubyte,Z:?GLubyte,W:?GLubyte>>).
-%% @spec (Index,{X,Y,Z,W}) -> ok
%% @equiv vertexAttrib4Nub(Index,X,Y,Z,W)
--spec vertexAttrib4Nubv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+-spec vertexAttrib4Nubv(Index :: integer(),V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer(),W :: integer()}.
vertexAttrib4Nubv(Index,{X,Y,Z,W}) -> vertexAttrib4Nub(Index,X,Y,Z,W).
-%% @spec (Index::integer(),V::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib4Nuiv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib4Nuiv(Index, V) -> ok when Index :: integer(),V :: {integer(),integer(),integer(),integer()}.
vertexAttrib4Nuiv(Index,{V1,V2,V3,V4}) ->
cast(5508, <<Index:?GLuint,V1:?GLuint,V2:?GLuint,V3:?GLuint,V4:?GLuint>>).
-%% @spec (Index::integer(),V::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib4Nusv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib4Nusv(Index, V) -> ok when Index :: integer(),V :: {integer(),integer(),integer(),integer()}.
vertexAttrib4Nusv(Index,{V1,V2,V3,V4}) ->
cast(5509, <<Index:?GLuint,V1:?GLushort,V2:?GLushort,V3:?GLushort,V4:?GLushort>>).
-%% @spec (Index::integer(),V::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib4bv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib4bv(Index, V) -> ok when Index :: integer(),V :: {integer(),integer(),integer(),integer()}.
vertexAttrib4bv(Index,{V1,V2,V3,V4}) ->
cast(5510, <<Index:?GLuint,V1:?GLbyte,V2:?GLbyte,V3:?GLbyte,V4:?GLbyte>>).
-%% @spec (Index::integer(),X::float(),Y::float(),Z::float(),W::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib4d(integer(),float(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib4d(Index, X, Y, Z, W) -> ok when Index :: integer(),X :: float(),Y :: float(),Z :: float(),W :: float().
vertexAttrib4d(Index,X,Y,Z,W) ->
cast(5511, <<Index:?GLuint,0:32,X:?GLdouble,Y:?GLdouble,Z:?GLdouble,W:?GLdouble>>).
-%% @spec (Index,{X,Y,Z,W}) -> ok
%% @equiv vertexAttrib4d(Index,X,Y,Z,W)
--spec vertexAttrib4dv(integer(),{float(),float(),float(),float()}) -> ok.
+-spec vertexAttrib4dv(Index :: integer(),V) -> ok when V :: {X :: float(),Y :: float(),Z :: float(),W :: float()}.
vertexAttrib4dv(Index,{X,Y,Z,W}) -> vertexAttrib4d(Index,X,Y,Z,W).
-%% @spec (Index::integer(),X::float(),Y::float(),Z::float(),W::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib4f(integer(),float(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib4f(Index, X, Y, Z, W) -> ok when Index :: integer(),X :: float(),Y :: float(),Z :: float(),W :: float().
vertexAttrib4f(Index,X,Y,Z,W) ->
cast(5512, <<Index:?GLuint,X:?GLfloat,Y:?GLfloat,Z:?GLfloat,W:?GLfloat>>).
-%% @spec (Index,{X,Y,Z,W}) -> ok
%% @equiv vertexAttrib4f(Index,X,Y,Z,W)
--spec vertexAttrib4fv(integer(),{float(),float(),float(),float()}) -> ok.
+-spec vertexAttrib4fv(Index :: integer(),V) -> ok when V :: {X :: float(),Y :: float(),Z :: float(),W :: float()}.
vertexAttrib4fv(Index,{X,Y,Z,W}) -> vertexAttrib4f(Index,X,Y,Z,W).
-%% @spec (Index::integer(),V::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib4iv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib4iv(Index, V) -> ok when Index :: integer(),V :: {integer(),integer(),integer(),integer()}.
vertexAttrib4iv(Index,{V1,V2,V3,V4}) ->
cast(5513, <<Index:?GLuint,V1:?GLint,V2:?GLint,V3:?GLint,V4:?GLint>>).
-%% @spec (Index::integer(),X::integer(),Y::integer(),Z::integer(),W::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib4s(integer(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib4s(Index, X, Y, Z, W) -> ok when Index :: integer(),X :: integer(),Y :: integer(),Z :: integer(),W :: integer().
vertexAttrib4s(Index,X,Y,Z,W) ->
cast(5514, <<Index:?GLuint,X:?GLshort,Y:?GLshort,Z:?GLshort,W:?GLshort>>).
-%% @spec (Index,{X,Y,Z,W}) -> ok
%% @equiv vertexAttrib4s(Index,X,Y,Z,W)
--spec vertexAttrib4sv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+-spec vertexAttrib4sv(Index :: integer(),V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer(),W :: integer()}.
vertexAttrib4sv(Index,{X,Y,Z,W}) -> vertexAttrib4s(Index,X,Y,Z,W).
-%% @spec (Index::integer(),V::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib4ubv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib4ubv(Index, V) -> ok when Index :: integer(),V :: {integer(),integer(),integer(),integer()}.
vertexAttrib4ubv(Index,{V1,V2,V3,V4}) ->
cast(5515, <<Index:?GLuint,V1:?GLubyte,V2:?GLubyte,V3:?GLubyte,V4:?GLubyte>>).
-%% @spec (Index::integer(),V::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib4uiv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib4uiv(Index, V) -> ok when Index :: integer(),V :: {integer(),integer(),integer(),integer()}.
vertexAttrib4uiv(Index,{V1,V2,V3,V4}) ->
cast(5516, <<Index:?GLuint,V1:?GLuint,V2:?GLuint,V3:?GLuint,V4:?GLuint>>).
-%% @spec (Index::integer(),V::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttrib.xml">external</a> documentation.
--spec vertexAttrib4usv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttrib4usv(Index, V) -> ok when Index :: integer(),V :: {integer(),integer(),integer(),integer()}.
vertexAttrib4usv(Index,{V1,V2,V3,V4}) ->
cast(5517, <<Index:?GLuint,V1:?GLushort,V2:?GLushort,V3:?GLushort,V4:?GLushort>>).
-%% @spec (Index::integer(),Size::integer(),Type::enum(),Normalized::0|1,Stride::integer(),Pointer::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribPointer.xml">external</a> documentation.
--spec vertexAttribPointer(integer(),integer(),enum(),0|1,integer(),offset()|mem()) -> ok.
+%% @doc Define an array of generic vertex attribute data
+%%
+%% ``gl:vertexAttribPointer'', ``gl:vertexAttribIPointer'' and ``gl:vertexAttribLPointer''
+%% specify the location and data format of the array of generic vertex attributes at index `Index'
+%% to use when rendering. `Size' specifies the number of components per attribute and
+%% must be 1, 2, 3, 4, or `?GL_BGRA'. `Type' specifies the data type of each component,
+%% and `Stride' specifies the byte stride from one attribute to the next, allowing vertices
+%% and attributes to be packed into a single array or stored in separate arrays.
+%%
+%% For ``gl:vertexAttribPointer'', if `Normalized' is set to `?GL_TRUE', it
+%% indicates that values stored in an integer format are to be mapped to the range [-1,1]
+%% (for signed values) or [0,1] (for unsigned values) when they are accessed and converted
+%% to floating point. Otherwise, values will be converted to floats directly without normalization.
+%%
+%%
+%% For ``gl:vertexAttribIPointer'', only the integer types `?GL_BYTE', `?GL_UNSIGNED_BYTE'
+%% , `?GL_SHORT', `?GL_UNSIGNED_SHORT', `?GL_INT', `?GL_UNSIGNED_INT'
+%% are accepted. Values are always left as integer values.
+%%
+%% ``gl:vertexAttribLPointer'' specifies state for a generic vertex attribute array associated
+%% with a shader attribute variable declared with 64-bit double precision components. `Type'
+%% must be `?GL_DOUBLE'. `Index' , `Size' , and `Stride' behave as described
+%% for ``gl:vertexAttribPointer'' and ``gl:vertexAttribIPointer''.
+%%
+%% If `Pointer' is not NULL, a non-zero named buffer object must be bound to the `?GL_ARRAY_BUFFER'
+%% target (see {@link gl:bindBuffer/2} ), otherwise an error is generated. `Pointer'
+%% is treated as a byte offset into the buffer object's data store. The buffer object binding
+%% (`?GL_ARRAY_BUFFER_BINDING') is saved as generic vertex attribute array state (`?GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING'
+%% ) for index `Index' .
+%%
+%% When a generic vertex attribute array is specified, `Size' , `Type' , `Normalized'
+%% , `Stride' , and `Pointer' are saved as vertex array state, in addition to the
+%% current vertex array buffer object binding.
+%%
+%% To enable and disable a generic vertex attribute array, call {@link gl:disableVertexAttribArray/1}
+%% and {@link gl:disableVertexAttribArray/1} with `Index' . If enabled, the generic vertex
+%% attribute array is used when {@link gl:drawArrays/3} , {@link gl:multiDrawArrays/3} , {@link gl:drawElements/4}
+%% , see `glMultiDrawElements', or {@link gl:drawRangeElements/6} is called.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribPointer.xml">external</a> documentation.
+-spec vertexAttribPointer(Index, Size, Type, Normalized, Stride, Pointer) -> ok when Index :: integer(),Size :: integer(),Type :: enum(),Normalized :: 0|1,Stride :: integer(),Pointer :: offset()|mem().
vertexAttribPointer(Index,Size,Type,Normalized,Stride,Pointer) when is_integer(Pointer) ->
cast(5518, <<Index:?GLuint,Size:?GLint,Type:?GLenum,Normalized:?GLboolean,0:24,Stride:?GLsizei,Pointer:?GLuint>>);
vertexAttribPointer(Index,Size,Type,Normalized,Stride,Pointer) ->
send_bin(Pointer),
cast(5519, <<Index:?GLuint,Size:?GLint,Type:?GLenum,Normalized:?GLboolean,0:24,Stride:?GLsizei>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix2x.xml">external</a> documentation.
--spec uniformMatrix2x3fv(integer(),0|1,[{float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix2x3fv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float()}].
uniformMatrix2x3fv(Location,Transpose,Value) ->
cast(5520, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat>> || {V1,V2,V3,V4,V5,V6} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix3x.xml">external</a> documentation.
--spec uniformMatrix3x2fv(integer(),0|1,[{float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix3x2fv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float()}].
uniformMatrix3x2fv(Location,Transpose,Value) ->
cast(5521, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat>> || {V1,V2,V3,V4,V5,V6} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix2x.xml">external</a> documentation.
--spec uniformMatrix2x4fv(integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix2x4fv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float()}].
uniformMatrix2x4fv(Location,Transpose,Value) ->
cast(5522, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat,V7:?GLfloat,V8:?GLfloat>> || {V1,V2,V3,V4,V5,V6,V7,V8} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix4x.xml">external</a> documentation.
--spec uniformMatrix4x2fv(integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix4x2fv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float()}].
uniformMatrix4x2fv(Location,Transpose,Value) ->
cast(5523, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat,V7:?GLfloat,V8:?GLfloat>> || {V1,V2,V3,V4,V5,V6,V7,V8} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix3x.xml">external</a> documentation.
--spec uniformMatrix3x4fv(integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix3x4fv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}].
uniformMatrix3x4fv(Location,Transpose,Value) ->
cast(5524, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat,V7:?GLfloat,V8:?GLfloat,V9:?GLfloat,V10:?GLfloat,V11:?GLfloat,V12:?GLfloat>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix4x.xml">external</a> documentation.
--spec uniformMatrix4x3fv(integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix4x3fv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}].
uniformMatrix4x3fv(Location,Transpose,Value) ->
cast(5525, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat,V7:?GLfloat,V8:?GLfloat,V9:?GLfloat,V10:?GLfloat,V11:?GLfloat,V12:?GLfloat>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12} <- Value>>)/binary>>).
-%% @spec (Index::integer(),R::0|1,G::0|1,B::0|1,A::0|1) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColorMaski.xml">external</a> documentation.
--spec colorMaski(integer(),0|1,0|1,0|1,0|1) -> ok.
+%% @doc glColorMaski
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glColorMaski.xml">external</a> documentation.
+-spec colorMaski(Index, R, G, B, A) -> ok when Index :: integer(),R :: 0|1,G :: 0|1,B :: 0|1,A :: 0|1.
colorMaski(Index,R,G,B,A) ->
cast(5526, <<Index:?GLuint,R:?GLboolean,G:?GLboolean,B:?GLboolean,A:?GLboolean>>).
-%% @spec (Target::enum(),Index::integer()) -> [0|1]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetBooleani_v.xml">external</a> documentation.
--spec getBooleani_v(enum(),integer()) -> [0|1].
+%% @doc
+%% See {@link getBooleanv/1}
+-spec getBooleani_v(Target, Index) -> [0|1] when Target :: enum(),Index :: integer().
getBooleani_v(Target,Index) ->
call(5527, <<Target:?GLenum,Index:?GLuint>>).
-%% @spec (Target::enum(),Index::integer()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetIntegeri_v.xml">external</a> documentation.
--spec getIntegeri_v(enum(),integer()) -> [integer()].
+%% @doc
+%% See {@link getBooleanv/1}
+-spec getIntegeri_v(Target, Index) -> [integer()] when Target :: enum(),Index :: integer().
getIntegeri_v(Target,Index) ->
call(5528, <<Target:?GLenum,Index:?GLuint>>).
-%% @spec (Target::enum(),Index::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEnable.xml">external</a> documentation.
--spec enablei(enum(),integer()) -> ok.
+%% @doc
+%% See {@link enable/1}
+-spec enablei(Target, Index) -> ok when Target :: enum(),Index :: integer().
enablei(Target,Index) ->
cast(5529, <<Target:?GLenum,Index:?GLuint>>).
-%% @spec (Target::enum(),Index::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDisable.xml">external</a> documentation.
--spec disablei(enum(),integer()) -> ok.
+%% @doc glEnablei
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEnablei.xml">external</a> documentation.
+-spec disablei(Target, Index) -> ok when Target :: enum(),Index :: integer().
disablei(Target,Index) ->
cast(5530, <<Target:?GLenum,Index:?GLuint>>).
-%% @spec (Target::enum(),Index::integer()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsEnabledi.xml">external</a> documentation.
--spec isEnabledi(enum(),integer()) -> 0|1.
+%% @doc glIsEnabledi
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsEnabledi.xml">external</a> documentation.
+-spec isEnabledi(Target, Index) -> 0|1 when Target :: enum(),Index :: integer().
isEnabledi(Target,Index) ->
call(5531, <<Target:?GLenum,Index:?GLuint>>).
-%% @spec (PrimitiveMode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBeginTransformFeedback.xml">external</a> documentation.
--spec beginTransformFeedback(enum()) -> ok.
+%% @doc Start transform feedback operation
+%%
+%% Transform feedback mode captures the values of varying variables written by the vertex
+%% shader (or, if active, the geometry shader). Transform feedback is said to be active after
+%% a call to ``gl:beginTransformFeedback'' until a subsequent call to {@link gl:beginTransformFeedback/1}
+%% . Transform feedback commands must be paired.
+%%
+%% If no geometry shader is present, while transform feedback is active the `Mode'
+%% parameter to {@link gl:drawArrays/3} must match those specified in the following table: <table>
+%% <tbody><tr><td>` Transform Feedback ' `PrimitiveMode' </td><td>` Allowed Render Primitive '
+%% `Modes' </td></tr></tbody><tbody><tr><td>`?GL_POINTS'</td><td>`?GL_POINTS'</td>
+%% </tr><tr><td>`?GL_LINES'</td><td>`?GL_LINES', `?GL_LINE_LOOP', `?GL_LINE_STRIP'
+%% , `?GL_LINES_ADJACENCY', `?GL_LINE_STRIP_ADJACENCY'</td></tr><tr><td>`?GL_TRIANGLES'
+%% </td><td>`?GL_TRIANGLES', `?GL_TRIANGLE_STRIP', `?GL_TRIANGLE_FAN', `?GL_TRIANGLES_ADJACENCY'
+%% , `?GL_TRIANGLE_STRIP_ADJACENCY'</td></tr></tbody></table>
+%%
+%% If a geometry shader is present, the output primitive type from the geometry shader must
+%% match those provided in the following table: <table><tbody><tr><td>` Transform Feedback '
+%% `PrimitiveMode' </td><td>` Allowed Geometry Shader Output Primitive Type '</td></tr>
+%% </tbody><tbody><tr><td>`?GL_POINTS'</td><td>`?points'</td></tr><tr><td>`?GL_LINES'
+%% </td><td>`?line_strip'</td></tr><tr><td>`?GL_TRIANGLES'</td><td>`?triangle_strip'
+%% </td></tr></tbody></table>
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBeginTransformFeedback.xml">external</a> documentation.
+-spec beginTransformFeedback(PrimitiveMode) -> ok when PrimitiveMode :: enum().
beginTransformFeedback(PrimitiveMode) ->
cast(5532, <<PrimitiveMode:?GLenum>>).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEndTransformFeedback.xml">external</a> documentation.
+%% @doc
+%% See {@link beginTransformFeedback/1}
-spec endTransformFeedback() -> ok.
endTransformFeedback() ->
cast(5533, <<>>).
-%% @spec (Target::enum(),Index::integer(),Buffer::integer(),Offset::integer(),Size::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindBufferRange.xml">external</a> documentation.
--spec bindBufferRange(enum(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc Bind a range within a buffer object to an indexed buffer target
+%%
+%% ``gl:bindBufferRange'' binds a range the buffer object `Buffer' represented by `Offset'
+%% and `Size' to the binding point at index `Index' of the array of targets specified
+%% by `Target' . Each `Target' represents an indexed array of buffer binding points,
+%% as well as a single general binding point that can be used by other buffer manipulation
+%% functions such as {@link gl:bindBuffer/2} or see `glMapBuffer'. In addition to binding
+%% a range of `Buffer' to the indexed buffer binding target, ``gl:bindBufferBase''
+%% also binds the range to the generic buffer binding point specified by `Target' .
+%%
+%% `Offset' specifies the offset in basic machine units into the buffer object `Buffer'
+%% and `Size' specifies the amount of data that can be read from the buffer object
+%% while used as an indexed target.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindBufferRange.xml">external</a> documentation.
+-spec bindBufferRange(Target, Index, Buffer, Offset, Size) -> ok when Target :: enum(),Index :: integer(),Buffer :: integer(),Offset :: integer(),Size :: integer().
bindBufferRange(Target,Index,Buffer,Offset,Size) ->
cast(5534, <<Target:?GLenum,Index:?GLuint,Buffer:?GLuint,0:32,Offset:?GLintptr,Size:?GLsizeiptr>>).
-%% @spec (Target::enum(),Index::integer(),Buffer::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindBufferBase.xml">external</a> documentation.
--spec bindBufferBase(enum(),integer(),integer()) -> ok.
+%% @doc Bind a buffer object to an indexed buffer target
+%%
+%% ``gl:bindBufferBase'' binds the buffer object `Buffer' to the binding point at
+%% index `Index' of the array of targets specified by `Target' . Each `Target'
+%% represents an indexed array of buffer binding points, as well as a single general binding
+%% point that can be used by other buffer manipulation functions such as {@link gl:bindBuffer/2}
+%% or see `glMapBuffer'. In addition to binding `Buffer' to the indexed buffer
+%% binding target, ``gl:bindBufferBase'' also binds `Buffer' to the generic buffer
+%% binding point specified by `Target' .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindBufferBase.xml">external</a> documentation.
+-spec bindBufferBase(Target, Index, Buffer) -> ok when Target :: enum(),Index :: integer(),Buffer :: integer().
bindBufferBase(Target,Index,Buffer) ->
cast(5535, <<Target:?GLenum,Index:?GLuint,Buffer:?GLuint>>).
-%% @spec (Program::integer(),Varyings::[string()],BufferMode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTransformFeedbackVaryings.xml">external</a> documentation.
--spec transformFeedbackVaryings(integer(),[string()],enum()) -> ok.
+%% @doc Specify values to record in transform feedback buffers
+%%
+%% The names of the vertex or geometry shader outputs to be recorded in transform feedback
+%% mode are specified using ``gl:transformFeedbackVaryings''. When a geometry shader is
+%% active, transform feedback records the values of selected geometry shader output variables
+%% from the emitted vertices. Otherwise, the values of the selected vertex shader outputs
+%% are recorded.
+%%
+%% The state set by ``gl:tranformFeedbackVaryings'' is stored and takes effect next time {@link gl:linkProgram/1}
+%% is called on `Program' . When {@link gl:linkProgram/1} is called, `Program' is
+%% linked so that the values of the specified varying variables for the vertices of each
+%% primitive generated by the GL are written to a single buffer object if `BufferMode'
+%% is `?GL_INTERLEAVED_ATTRIBS' or multiple buffer objects if `BufferMode' is `?GL_SEPARATE_ATTRIBS'
+%% .
+%%
+%% In addition to the errors generated by ``gl:transformFeedbackVaryings'', the program `Program'
+%% will fail to link if:
+%%
+%% The count specified by ``gl:transformFeedbackVaryings'' is non-zero, but the program
+%% object has no vertex or geometry shader.
+%%
+%% Any variable name specified in the `Varyings' array is not declared as an output
+%% in the vertex shader (or the geometry shader, if active).
+%%
+%% Any two entries in the `Varyings' array specify the same varying variable.
+%%
+%% The total number of components to capture in any varying variable in `Varyings'
+%% is greater than the constant `?GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS' and
+%% the buffer mode is `?GL_SEPARATE_ATTRIBS'.
+%%
+%% The total number of components to capture is greater than the constant `?GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS'
+%% and the buffer mode is `?GL_INTERLEAVED_ATTRIBS'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTransformFeedbackVaryings.xml">external</a> documentation.
+-spec transformFeedbackVaryings(Program, Varyings, BufferMode) -> ok when Program :: integer(),Varyings :: [string()],BufferMode :: enum().
transformFeedbackVaryings(Program,Varyings,BufferMode) ->
VaryingsTemp = list_to_binary([[Str|[0]] || Str <- Varyings ]),
cast(5536, <<Program:?GLuint,(length(Varyings)):?GLuint,(size(VaryingsTemp)):?GLuint,(VaryingsTemp)/binary,0:((8-((size(VaryingsTemp)+0) rem 8)) rem 8),BufferMode:?GLenum>>).
-%% @spec (Program::integer(),Index::integer(),BufSize::integer()) -> {Size::integer(),Type::enum(),Name::string()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTransformFeedbackVarying.xml">external</a> documentation.
--spec getTransformFeedbackVarying(integer(),integer(),integer()) -> {integer(),enum(),string()}.
+%% @doc Retrieve information about varying variables selected for transform feedback
+%%
+%% Information about the set of varying variables in a linked program that will be captured
+%% during transform feedback may be retrieved by calling ``gl:getTransformFeedbackVarying''.
+%% ``gl:getTransformFeedbackVarying'' provides information about the varying variable selected
+%% by `Index' . An `Index' of 0 selects the first varying variable specified in
+%% the `Varyings' array passed to {@link gl:transformFeedbackVaryings/3} , and an `Index'
+%% of `?GL_TRANSFORM_FEEDBACK_VARYINGS-1' selects the last such variable.
+%%
+%% The name of the selected varying is returned as a null-terminated string in `Name' .
+%% The actual number of characters written into `Name' , excluding the null terminator,
+%% is returned in `Length' . If `Length' is NULL, no length is returned. The maximum
+%% number of characters that may be written into `Name' , including the null terminator,
+%% is specified by `BufSize' .
+%%
+%% The length of the longest varying name in program is given by `?GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH'
+%% , which can be queried with {@link gl:getProgramiv/2} .
+%%
+%% For the selected varying variable, its type is returned into `Type' . The size of
+%% the varying is returned into `Size' . The value in `Size' is in units of the
+%% type returned in `Type' . The type returned can be any of the scalar, vector, or matrix
+%% attribute types returned by {@link gl:getActiveAttrib/3} . If an error occurred, the return
+%% parameters `Length' , `Size' , `Type' and `Name' will be unmodified.
+%% This command will return as much information about the varying variables as possible.
+%% If no information is available, `Length' will be set to zero and `Name' will
+%% be an empty string. This situation could arise if ``gl:getTransformFeedbackVarying''
+%% is called after a failed link.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTransformFeedbackVarying.xml">external</a> documentation.
+-spec getTransformFeedbackVarying(Program, Index, BufSize) -> {Size :: integer(),Type :: enum(),Name :: string()} when Program :: integer(),Index :: integer(),BufSize :: integer().
getTransformFeedbackVarying(Program,Index,BufSize) ->
call(5537, <<Program:?GLuint,Index:?GLuint,BufSize:?GLsizei>>).
-%% @spec (Target::enum(),Clamp::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClampColor.xml">external</a> documentation.
--spec clampColor(enum(),enum()) -> ok.
+%% @doc specify whether data read via
+%%
+%% {@link gl:readPixels/7} should be clamped
+%%
+%% ``gl:clampColor'' controls color clamping that is performed during {@link gl:readPixels/7}
+%% . `Target' must be `?GL_CLAMP_READ_COLOR'. If `Clamp' is `?GL_TRUE',
+%% read color clamping is enabled; if `Clamp' is `?GL_FALSE', read color clamping
+%% is disabled. If `Clamp' is `?GL_FIXED_ONLY', read color clamping is enabled
+%% only if the selected read buffer has fixed point components and disabled otherwise.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClampColor.xml">external</a> documentation.
+-spec clampColor(Target, Clamp) -> ok when Target :: enum(),Clamp :: enum().
clampColor(Target,Clamp) ->
cast(5538, <<Target:?GLenum,Clamp:?GLenum>>).
-%% @spec (Id::integer(),Mode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBeginConditionalRender.xml">external</a> documentation.
--spec beginConditionalRender(integer(),enum()) -> ok.
+%% @doc Start conditional rendering
+%%
+%% Conditional rendering is started using ``gl:beginConditionalRender'' and ended using ``gl:endConditionalRender''
+%% . During conditional rendering, all vertex array commands, as well as {@link gl:clear/1}
+%% and {@link gl:clearBufferiv/3} have no effect if the (`?GL_SAMPLES_PASSED') result of
+%% the query object `Id' is zero, or if the (`?GL_ANY_SAMPLES_PASSED') result is `?GL_FALSE'
+%% . The results of commands setting the current vertex state, such as {@link gl:vertexAttrib1d/2}
+%% are undefined. If the (`?GL_SAMPLES_PASSED') result is non-zero or if the (`?GL_ANY_SAMPLES_PASSED'
+%% ) result is `?GL_TRUE', such commands are not discarded. The `Id' parameter to ``gl:beginConditionalRender''
+%% must be the name of a query object previously returned from a call to {@link gl:genQueries/1}
+%% . `Mode' specifies how the results of the query object are to be interpreted. If `Mode'
+%% is `?GL_QUERY_WAIT', the GL waits for the results of the query to be available and
+%% then uses the results to determine if subsequent rendering commands are discarded. If `Mode'
+%% is `?GL_QUERY_NO_WAIT', the GL may choose to unconditionally execute the subsequent
+%% rendering commands without waiting for the query to complete.
+%%
+%% If `Mode' is `?GL_QUERY_BY_REGION_WAIT', the GL will also wait for occlusion
+%% query results and discard rendering commands if the result of the occlusion query is zero.
+%% If the query result is non-zero, subsequent rendering commands are executed, but the GL
+%% may discard the results of the commands for any region of the framebuffer that did not
+%% contribute to the sample count in the specified occlusion query. Any such discarding is
+%% done in an implementation-dependent manner, but the rendering command results may not
+%% be discarded for any samples that contributed to the occlusion query sample count. If `Mode'
+%% is `?GL_QUERY_BY_REGION_NO_WAIT', the GL operates as in `?GL_QUERY_BY_REGION_WAIT'
+%% , but may choose to unconditionally execute the subsequent rendering commands without
+%% waiting for the query to complete.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBeginConditionalRender.xml">external</a> documentation.
+-spec beginConditionalRender(Id, Mode) -> ok when Id :: integer(),Mode :: enum().
beginConditionalRender(Id,Mode) ->
cast(5539, <<Id:?GLuint,Mode:?GLenum>>).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEndConditionalRender.xml">external</a> documentation.
+%% @doc
+%% See {@link beginConditionalRender/2}
-spec endConditionalRender() -> ok.
endConditionalRender() ->
cast(5540, <<>>).
-%% @spec (Index::integer(),Size::integer(),Type::enum(),Stride::integer(),Pointer::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribIPointer.xml">external</a> documentation.
--spec vertexAttribIPointer(integer(),integer(),enum(),integer(),offset()|mem()) -> ok.
+%% @doc glVertexAttribIPointer
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribIPointer.xml">external</a> documentation.
+-spec vertexAttribIPointer(Index, Size, Type, Stride, Pointer) -> ok when Index :: integer(),Size :: integer(),Type :: enum(),Stride :: integer(),Pointer :: offset()|mem().
vertexAttribIPointer(Index,Size,Type,Stride,Pointer) when is_integer(Pointer) ->
cast(5541, <<Index:?GLuint,Size:?GLint,Type:?GLenum,Stride:?GLsizei,Pointer:?GLuint>>);
vertexAttribIPointer(Index,Size,Type,Stride,Pointer) ->
send_bin(Pointer),
cast(5542, <<Index:?GLuint,Size:?GLint,Type:?GLenum,Stride:?GLsizei>>).
-%% @spec (Index::integer(),Pname::enum()) -> {integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetVertexAttribI.xml">external</a> documentation.
--spec getVertexAttribIiv(integer(),enum()) -> {integer(),integer(),integer(),integer()}.
+%% @doc
+%% See {@link getVertexAttribdv/2}
+-spec getVertexAttribIiv(Index, Pname) -> {integer(),integer(),integer(),integer()} when Index :: integer(),Pname :: enum().
getVertexAttribIiv(Index,Pname) ->
call(5543, <<Index:?GLuint,Pname:?GLenum>>).
-%% @spec (Index::integer(),Pname::enum()) -> {integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetVertexAttribI.xml">external</a> documentation.
--spec getVertexAttribIuiv(integer(),enum()) -> {integer(),integer(),integer(),integer()}.
+%% @doc glGetVertexAttribI
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetVertexAttribI.xml">external</a> documentation.
+-spec getVertexAttribIuiv(Index, Pname) -> {integer(),integer(),integer(),integer()} when Index :: integer(),Pname :: enum().
getVertexAttribIuiv(Index,Pname) ->
call(5544, <<Index:?GLuint,Pname:?GLenum>>).
-%% @spec (Index::integer(),X::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribI.xml">external</a> documentation.
--spec vertexAttribI1i(integer(),integer()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttribI1i(Index, X) -> ok when Index :: integer(),X :: integer().
vertexAttribI1i(Index,X) ->
cast(5545, <<Index:?GLuint,X:?GLint>>).
-%% @spec (Index::integer(),X::integer(),Y::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribI.xml">external</a> documentation.
--spec vertexAttribI2i(integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttribI2i(Index, X, Y) -> ok when Index :: integer(),X :: integer(),Y :: integer().
vertexAttribI2i(Index,X,Y) ->
cast(5546, <<Index:?GLuint,X:?GLint,Y:?GLint>>).
-%% @spec (Index::integer(),X::integer(),Y::integer(),Z::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribI.xml">external</a> documentation.
--spec vertexAttribI3i(integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttribI3i(Index, X, Y, Z) -> ok when Index :: integer(),X :: integer(),Y :: integer(),Z :: integer().
vertexAttribI3i(Index,X,Y,Z) ->
cast(5547, <<Index:?GLuint,X:?GLint,Y:?GLint,Z:?GLint>>).
-%% @spec (Index::integer(),X::integer(),Y::integer(),Z::integer(),W::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribI.xml">external</a> documentation.
--spec vertexAttribI4i(integer(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttribI4i(Index, X, Y, Z, W) -> ok when Index :: integer(),X :: integer(),Y :: integer(),Z :: integer(),W :: integer().
vertexAttribI4i(Index,X,Y,Z,W) ->
cast(5548, <<Index:?GLuint,X:?GLint,Y:?GLint,Z:?GLint,W:?GLint>>).
-%% @spec (Index::integer(),X::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribI.xml">external</a> documentation.
--spec vertexAttribI1ui(integer(),integer()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttribI1ui(Index, X) -> ok when Index :: integer(),X :: integer().
vertexAttribI1ui(Index,X) ->
cast(5549, <<Index:?GLuint,X:?GLuint>>).
-%% @spec (Index::integer(),X::integer(),Y::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribI.xml">external</a> documentation.
--spec vertexAttribI2ui(integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttribI2ui(Index, X, Y) -> ok when Index :: integer(),X :: integer(),Y :: integer().
vertexAttribI2ui(Index,X,Y) ->
cast(5550, <<Index:?GLuint,X:?GLuint,Y:?GLuint>>).
-%% @spec (Index::integer(),X::integer(),Y::integer(),Z::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribI.xml">external</a> documentation.
--spec vertexAttribI3ui(integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttribI3ui(Index, X, Y, Z) -> ok when Index :: integer(),X :: integer(),Y :: integer(),Z :: integer().
vertexAttribI3ui(Index,X,Y,Z) ->
cast(5551, <<Index:?GLuint,X:?GLuint,Y:?GLuint,Z:?GLuint>>).
-%% @spec (Index::integer(),X::integer(),Y::integer(),Z::integer(),W::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribI.xml">external</a> documentation.
--spec vertexAttribI4ui(integer(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttribI4ui(Index, X, Y, Z, W) -> ok when Index :: integer(),X :: integer(),Y :: integer(),Z :: integer(),W :: integer().
vertexAttribI4ui(Index,X,Y,Z,W) ->
cast(5552, <<Index:?GLuint,X:?GLuint,Y:?GLuint,Z:?GLuint,W:?GLuint>>).
-%% @spec (Index,{X}) -> ok
%% @equiv vertexAttribI1i(Index,X)
--spec vertexAttribI1iv(integer(),{integer()}) -> ok.
+-spec vertexAttribI1iv(Index :: integer(),V) -> ok when V :: {X :: integer()}.
vertexAttribI1iv(Index,{X}) -> vertexAttribI1i(Index,X).
-%% @spec (Index,{X,Y}) -> ok
%% @equiv vertexAttribI2i(Index,X,Y)
--spec vertexAttribI2iv(integer(),{integer(),integer()}) -> ok.
+-spec vertexAttribI2iv(Index :: integer(),V) -> ok when V :: {X :: integer(),Y :: integer()}.
vertexAttribI2iv(Index,{X,Y}) -> vertexAttribI2i(Index,X,Y).
-%% @spec (Index,{X,Y,Z}) -> ok
%% @equiv vertexAttribI3i(Index,X,Y,Z)
--spec vertexAttribI3iv(integer(),{integer(),integer(),integer()}) -> ok.
+-spec vertexAttribI3iv(Index :: integer(),V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer()}.
vertexAttribI3iv(Index,{X,Y,Z}) -> vertexAttribI3i(Index,X,Y,Z).
-%% @spec (Index,{X,Y,Z,W}) -> ok
%% @equiv vertexAttribI4i(Index,X,Y,Z,W)
--spec vertexAttribI4iv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+-spec vertexAttribI4iv(Index :: integer(),V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer(),W :: integer()}.
vertexAttribI4iv(Index,{X,Y,Z,W}) -> vertexAttribI4i(Index,X,Y,Z,W).
-%% @spec (Index,{X}) -> ok
%% @equiv vertexAttribI1ui(Index,X)
--spec vertexAttribI1uiv(integer(),{integer()}) -> ok.
+-spec vertexAttribI1uiv(Index :: integer(),V) -> ok when V :: {X :: integer()}.
vertexAttribI1uiv(Index,{X}) -> vertexAttribI1ui(Index,X).
-%% @spec (Index,{X,Y}) -> ok
%% @equiv vertexAttribI2ui(Index,X,Y)
--spec vertexAttribI2uiv(integer(),{integer(),integer()}) -> ok.
+-spec vertexAttribI2uiv(Index :: integer(),V) -> ok when V :: {X :: integer(),Y :: integer()}.
vertexAttribI2uiv(Index,{X,Y}) -> vertexAttribI2ui(Index,X,Y).
-%% @spec (Index,{X,Y,Z}) -> ok
%% @equiv vertexAttribI3ui(Index,X,Y,Z)
--spec vertexAttribI3uiv(integer(),{integer(),integer(),integer()}) -> ok.
+-spec vertexAttribI3uiv(Index :: integer(),V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer()}.
vertexAttribI3uiv(Index,{X,Y,Z}) -> vertexAttribI3ui(Index,X,Y,Z).
-%% @spec (Index,{X,Y,Z,W}) -> ok
%% @equiv vertexAttribI4ui(Index,X,Y,Z,W)
--spec vertexAttribI4uiv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+-spec vertexAttribI4uiv(Index :: integer(),V) -> ok when V :: {X :: integer(),Y :: integer(),Z :: integer(),W :: integer()}.
vertexAttribI4uiv(Index,{X,Y,Z,W}) -> vertexAttribI4ui(Index,X,Y,Z,W).
-%% @spec (Index::integer(),V::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribI.xml">external</a> documentation.
--spec vertexAttribI4bv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttribI4bv(Index, V) -> ok when Index :: integer(),V :: {integer(),integer(),integer(),integer()}.
vertexAttribI4bv(Index,{V1,V2,V3,V4}) ->
cast(5553, <<Index:?GLuint,V1:?GLbyte,V2:?GLbyte,V3:?GLbyte,V4:?GLbyte>>).
-%% @spec (Index::integer(),V::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribI.xml">external</a> documentation.
--spec vertexAttribI4sv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttribI4sv(Index, V) -> ok when Index :: integer(),V :: {integer(),integer(),integer(),integer()}.
vertexAttribI4sv(Index,{V1,V2,V3,V4}) ->
cast(5554, <<Index:?GLuint,V1:?GLshort,V2:?GLshort,V3:?GLshort,V4:?GLshort>>).
-%% @spec (Index::integer(),V::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribI.xml">external</a> documentation.
--spec vertexAttribI4ubv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttribI4ubv(Index, V) -> ok when Index :: integer(),V :: {integer(),integer(),integer(),integer()}.
vertexAttribI4ubv(Index,{V1,V2,V3,V4}) ->
cast(5555, <<Index:?GLuint,V1:?GLubyte,V2:?GLubyte,V3:?GLubyte,V4:?GLubyte>>).
-%% @spec (Index::integer(),V::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribI.xml">external</a> documentation.
--spec vertexAttribI4usv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc
+%% See {@link vertexAttrib1d/2}
+-spec vertexAttribI4usv(Index, V) -> ok when Index :: integer(),V :: {integer(),integer(),integer(),integer()}.
vertexAttribI4usv(Index,{V1,V2,V3,V4}) ->
cast(5556, <<Index:?GLuint,V1:?GLushort,V2:?GLushort,V3:?GLushort,V4:?GLushort>>).
-%% @spec (Program::integer(),Location::integer()) -> {integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniform.xml">external</a> documentation.
--spec getUniformuiv(integer(),integer()) -> {integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer()}.
+%% @doc
+%% See {@link getUniformfv/2}
+-spec getUniformuiv(Program, Location) -> {integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer()} when Program :: integer(),Location :: integer().
getUniformuiv(Program,Location) ->
call(5557, <<Program:?GLuint,Location:?GLint>>).
-%% @spec (Program::integer(),Color::integer(),Name::string()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindFragDataLocation.xml">external</a> documentation.
--spec bindFragDataLocation(integer(),integer(),string()) -> ok.
+%% @doc Bind a user-defined varying out variable to a fragment shader color number
+%%
+%% ``gl:bindFragDataLocation'' explicitly specifies the binding of the user-defined varying
+%% out variable `Name' to fragment shader color number `ColorNumber' for program `Program'
+%% . If `Name' was bound previously, its assigned binding is replaced with `ColorNumber'
+%% . `Name' must be a null-terminated string. `ColorNumber' must be less than `?GL_MAX_DRAW_BUFFERS'
+%% .
+%%
+%% The bindings specified by ``gl:bindFragDataLocation'' have no effect until `Program'
+%% is next linked. Bindings may be specified at any time after `Program' has been created.
+%% Specifically, they may be specified before shader objects are attached to the program.
+%% Therefore, any name may be specified in `Name' , including a name that is never used
+%% as a varying out variable in any fragment shader object. Names beginning with `?gl_'
+%% are reserved by the GL.
+%%
+%% In addition to the errors generated by ``gl:bindFragDataLocation'', the program `Program'
+%% will fail to link if:
+%%
+%% The number of active outputs is greater than the value `?GL_MAX_DRAW_BUFFERS'.
+%%
+%% More than one varying out variable is bound to the same color number.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindFragDataLocation.xml">external</a> documentation.
+-spec bindFragDataLocation(Program, Color, Name) -> ok when Program :: integer(),Color :: integer(),Name :: string().
bindFragDataLocation(Program,Color,Name) ->
cast(5558, <<Program:?GLuint,Color:?GLuint,(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 1) rem 8)) rem 8)>>).
-%% @spec (Program::integer(),Name::string()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetFragDataLocation.xml">external</a> documentation.
--spec getFragDataLocation(integer(),string()) -> integer().
+%% @doc Query the bindings of color numbers to user-defined varying out variables
+%%
+%% ``gl:getFragDataLocation'' retrieves the assigned color number binding for the user-defined
+%% varying out variable `Name' for program `Program' . `Program' must have
+%% previously been linked. `Name' must be a null-terminated string. If `Name' is
+%% not the name of an active user-defined varying out fragment shader variable within `Program'
+%% , -1 will be returned.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetFragDataLocation.xml">external</a> documentation.
+-spec getFragDataLocation(Program, Name) -> integer() when Program :: integer(),Name :: string().
getFragDataLocation(Program,Name) ->
call(5559, <<Program:?GLuint,(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 5) rem 8)) rem 8)>>).
-%% @spec (Location::integer(),V0::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform1ui(integer(),integer()) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform1ui(Location, V0) -> ok when Location :: integer(),V0 :: integer().
uniform1ui(Location,V0) ->
cast(5560, <<Location:?GLint,V0:?GLuint>>).
-%% @spec (Location::integer(),V0::integer(),V1::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform2ui(integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform2ui(Location, V0, V1) -> ok when Location :: integer(),V0 :: integer(),V1 :: integer().
uniform2ui(Location,V0,V1) ->
cast(5561, <<Location:?GLint,V0:?GLuint,V1:?GLuint>>).
-%% @spec (Location::integer(),V0::integer(),V1::integer(),V2::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform3ui(integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform3ui(Location, V0, V1, V2) -> ok when Location :: integer(),V0 :: integer(),V1 :: integer(),V2 :: integer().
uniform3ui(Location,V0,V1,V2) ->
cast(5562, <<Location:?GLint,V0:?GLuint,V1:?GLuint,V2:?GLuint>>).
-%% @spec (Location::integer(),V0::integer(),V1::integer(),V2::integer(),V3::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform4ui(integer(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform4ui(Location, V0, V1, V2, V3) -> ok when Location :: integer(),V0 :: integer(),V1 :: integer(),V2 :: integer(),V3 :: integer().
uniform4ui(Location,V0,V1,V2,V3) ->
cast(5563, <<Location:?GLint,V0:?GLuint,V1:?GLuint,V2:?GLuint,V3:?GLuint>>).
-%% @spec (Location::integer(),Value::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform1uiv(integer(),[integer()]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform1uiv(Location, Value) -> ok when Location :: integer(),Value :: [integer()].
uniform1uiv(Location,Value) ->
cast(5564, <<Location:?GLint,(length(Value)):?GLuint,
(<< <<C:?GLuint>> || C <- Value>>)/binary,0:(((length(Value)) rem 2)*32)>>).
-%% @spec (Location::integer(),Value::[{integer(),integer()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform2uiv(integer(),[{integer(),integer()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform2uiv(Location, Value) -> ok when Location :: integer(),Value :: [{integer(),integer()}].
uniform2uiv(Location,Value) ->
cast(5565, <<Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLuint,V2:?GLuint>> || {V1,V2} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Value::[{integer(),integer(),integer()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform3uiv(integer(),[{integer(),integer(),integer()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform3uiv(Location, Value) -> ok when Location :: integer(),Value :: [{integer(),integer(),integer()}].
uniform3uiv(Location,Value) ->
cast(5566, <<Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLuint,V2:?GLuint,V3:?GLuint>> || {V1,V2,V3} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Value::[{integer(),integer(),integer(),integer()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform4uiv(integer(),[{integer(),integer(),integer(),integer()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform4uiv(Location, Value) -> ok when Location :: integer(),Value :: [{integer(),integer(),integer(),integer()}].
uniform4uiv(Location,Value) ->
cast(5567, <<Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLuint,V2:?GLuint,V3:?GLuint,V4:?GLuint>> || {V1,V2,V3,V4} <- Value>>)/binary>>).
-%% @spec (Target::enum(),Pname::enum(),Params::{integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexParameterI.xml">external</a> documentation.
--spec texParameterIiv(enum(),enum(),{integer()}) -> ok.
+%% @doc
+%% See {@link texParameterf/3}
+-spec texParameterIiv(Target, Pname, Params) -> ok when Target :: enum(),Pname :: enum(),Params :: {integer()}.
texParameterIiv(Target,Pname,Params) ->
cast(5568, <<Target:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
(<< <<C:?GLint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
-%% @spec (Target::enum(),Pname::enum(),Params::{integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexParameterI.xml">external</a> documentation.
--spec texParameterIuiv(enum(),enum(),{integer()}) -> ok.
+%% @doc glTexParameterI
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexParameterI.xml">external</a> documentation.
+-spec texParameterIuiv(Target, Pname, Params) -> ok when Target :: enum(),Pname :: enum(),Params :: {integer()}.
texParameterIuiv(Target,Pname,Params) ->
cast(5569, <<Target:?GLenum,Pname:?GLenum,(size(Params)):?GLuint,
(<< <<C:?GLuint>> ||C <- tuple_to_list(Params)>>)/binary,0:(((1+size(Params)) rem 2)*32)>>).
-%% @spec (Target::enum(),Pname::enum()) -> {integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexParameterI.xml">external</a> documentation.
--spec getTexParameterIiv(enum(),enum()) -> {integer(),integer(),integer(),integer()}.
+%% @doc
+%% See {@link getTexParameterfv/2}
+-spec getTexParameterIiv(Target, Pname) -> {integer(),integer(),integer(),integer()} when Target :: enum(),Pname :: enum().
getTexParameterIiv(Target,Pname) ->
call(5570, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Target::enum(),Pname::enum()) -> {integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexParameterI.xml">external</a> documentation.
--spec getTexParameterIuiv(enum(),enum()) -> {integer(),integer(),integer(),integer()}.
+%% @doc glGetTexParameterI
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetTexParameterI.xml">external</a> documentation.
+-spec getTexParameterIuiv(Target, Pname) -> {integer(),integer(),integer(),integer()} when Target :: enum(),Pname :: enum().
getTexParameterIuiv(Target,Pname) ->
call(5571, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Buffer::enum(),Drawbuffer::integer(),Value::{integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearBuffer.xml">external</a> documentation.
--spec clearBufferiv(enum(),integer(),{integer()}) -> ok.
+%% @doc Clear individual buffers of the currently bound draw framebuffer
+%%
+%% ``gl:clearBuffer*'' clears the specified buffer to the specified value(s). If `Buffer'
+%% is `?GL_COLOR', a particular draw buffer `?GL_DRAWBUFFER' `I' is specified
+%% by passing `I' as `DrawBuffer' . In this case, `Value' points to a four-element
+%% vector specifying the R, G, B and A color to clear that draw buffer to. If `Buffer'
+%% is one of `?GL_FRONT', `?GL_BACK', `?GL_LEFT', `?GL_RIGHT', or `?GL_FRONT_AND_BACK'
+%% , identifying multiple buffers, each selected buffer is cleared to the same value. Clamping
+%% and conversion for fixed-point color buffers are performed in the same fashion as {@link gl:clearColor/4}
+%% .
+%%
+%% If `Buffer' is `?GL_DEPTH', `DrawBuffer' must be zero, and `Value'
+%% points to a single value to clear the depth buffer to. Only ``gl:clearBufferfv'' should
+%% be used to clear depth buffers. Clamping and conversion for fixed-point depth buffers
+%% are performed in the same fashion as {@link gl:clearDepth/1} .
+%%
+%% If `Buffer' is `?GL_STENCIL', `DrawBuffer' must be zero, and `Value'
+%% points to a single value to clear the stencil buffer to. Only ``gl:clearBufferiv'' should
+%% be used to clear stencil buffers. Masing and type conversion are performed in the same
+%% fashion as {@link gl:clearStencil/1} .
+%%
+%% ``gl:clearBufferfi'' may be used to clear the depth and stencil buffers. `Buffer'
+%% must be `?GL_DEPTH_STENCIL' and `DrawBuffer' must be zero. `Depth' and `Stencil'
+%% are the depth and stencil values, respectively.
+%%
+%% The result of ``gl:clearBuffer'' is undefined if no conversion between the type of `Value'
+%% and the buffer being cleared is defined. However, this is not an error.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearBuffer.xml">external</a> documentation.
+-spec clearBufferiv(Buffer, Drawbuffer, Value) -> ok when Buffer :: enum(),Drawbuffer :: integer(),Value :: {integer()}.
clearBufferiv(Buffer,Drawbuffer,Value) ->
cast(5572, <<Buffer:?GLenum,Drawbuffer:?GLint,(size(Value)):?GLuint,
(<< <<C:?GLint>> ||C <- tuple_to_list(Value)>>)/binary,0:(((1+size(Value)) rem 2)*32)>>).
-%% @spec (Buffer::enum(),Drawbuffer::integer(),Value::{integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearBuffer.xml">external</a> documentation.
--spec clearBufferuiv(enum(),integer(),{integer()}) -> ok.
+%% @doc
+%% See {@link clearBufferiv/3}
+-spec clearBufferuiv(Buffer, Drawbuffer, Value) -> ok when Buffer :: enum(),Drawbuffer :: integer(),Value :: {integer()}.
clearBufferuiv(Buffer,Drawbuffer,Value) ->
cast(5573, <<Buffer:?GLenum,Drawbuffer:?GLint,(size(Value)):?GLuint,
(<< <<C:?GLuint>> ||C <- tuple_to_list(Value)>>)/binary,0:(((1+size(Value)) rem 2)*32)>>).
-%% @spec (Buffer::enum(),Drawbuffer::integer(),Value::{float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearBuffer.xml">external</a> documentation.
--spec clearBufferfv(enum(),integer(),{float()}) -> ok.
+%% @doc
+%% See {@link clearBufferiv/3}
+-spec clearBufferfv(Buffer, Drawbuffer, Value) -> ok when Buffer :: enum(),Drawbuffer :: integer(),Value :: {float()}.
clearBufferfv(Buffer,Drawbuffer,Value) ->
cast(5574, <<Buffer:?GLenum,Drawbuffer:?GLint,(size(Value)):?GLuint,
(<< <<C:?GLfloat>> ||C <- tuple_to_list(Value)>>)/binary,0:(((1+size(Value)) rem 2)*32)>>).
-%% @spec (Buffer::enum(),Drawbuffer::integer(),Depth::float(),Stencil::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearBufferfi.xml">external</a> documentation.
--spec clearBufferfi(enum(),integer(),float(),integer()) -> ok.
+%% @doc glClearBufferfi
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearBufferfi.xml">external</a> documentation.
+-spec clearBufferfi(Buffer, Drawbuffer, Depth, Stencil) -> ok when Buffer :: enum(),Drawbuffer :: integer(),Depth :: float(),Stencil :: integer().
clearBufferfi(Buffer,Drawbuffer,Depth,Stencil) ->
cast(5575, <<Buffer:?GLenum,Drawbuffer:?GLint,Depth:?GLfloat,Stencil:?GLint>>).
-%% @spec (Name::enum(),Index::integer()) -> string()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetString.xml">external</a> documentation.
--spec getStringi(enum(),integer()) -> string().
+%% @doc
+%% See {@link getString/1}
+-spec getStringi(Name, Index) -> string() when Name :: enum(),Index :: integer().
getStringi(Name,Index) ->
call(5576, <<Name:?GLenum,Index:?GLuint>>).
-%% @spec (Mode::enum(),First::integer(),Count::integer(),Primcount::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawArraysInstance.xml">external</a> documentation.
--spec drawArraysInstanced(enum(),integer(),integer(),integer()) -> ok.
+%% @doc glDrawArraysInstance
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawArraysInstance.xml">external</a> documentation.
+-spec drawArraysInstanced(Mode, First, Count, Primcount) -> ok when Mode :: enum(),First :: integer(),Count :: integer(),Primcount :: integer().
drawArraysInstanced(Mode,First,Count,Primcount) ->
cast(5577, <<Mode:?GLenum,First:?GLint,Count:?GLsizei,Primcount:?GLsizei>>).
-%% @spec (Mode::enum(),Count::integer(),Type::enum(),Indices::offset()|mem(),Primcount::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawElementsInstance.xml">external</a> documentation.
--spec drawElementsInstanced(enum(),integer(),enum(),offset()|mem(),integer()) -> ok.
+%% @doc glDrawElementsInstance
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawElementsInstance.xml">external</a> documentation.
+-spec drawElementsInstanced(Mode, Count, Type, Indices, Primcount) -> ok when Mode :: enum(),Count :: integer(),Type :: enum(),Indices :: offset()|mem(),Primcount :: integer().
drawElementsInstanced(Mode,Count,Type,Indices,Primcount) when is_integer(Indices) ->
cast(5578, <<Mode:?GLenum,Count:?GLsizei,Type:?GLenum,Indices:?GLuint,Primcount:?GLsizei>>);
drawElementsInstanced(Mode,Count,Type,Indices,Primcount) ->
send_bin(Indices),
cast(5579, <<Mode:?GLenum,Count:?GLsizei,Type:?GLenum,Primcount:?GLsizei>>).
-%% @spec (Target::enum(),Internalformat::enum(),Buffer::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexBuffer.xml">external</a> documentation.
--spec texBuffer(enum(),enum(),integer()) -> ok.
+%% @doc Attach the storage for a buffer object to the active buffer texture
+%%
+%% ``gl:texBuffer'' attaches the storage for the buffer object named `Buffer' to the
+%% active buffer texture, and specifies the internal format for the texel array found in
+%% the attached buffer object. If `Buffer' is zero, any buffer object attached to the
+%% buffer texture is detached and no new buffer object is attached. If `Buffer' is non-zero,
+%% it must be the name of an existing buffer object. `Target' must be `?GL_TEXTURE_BUFFER'
+%% . `Internalformat' specifies the storage format, and must be one of the following
+%% sized internal formats: <table><tbody><tr><td></td><td></td><td></td><td></td><td>` Component '
+%% </td></tr></tbody><tbody><tr><td>`Sized Internal Format'</td><td>`Base Type'</td>
+%% <td>`Components'</td><td>`Norm'</td><td>0</td><td>1</td><td>2</td><td>3</td></tr>
+%% <tr><td>`?GL_R8'</td><td>ubyte</td><td>1</td><td>YES</td><td>R</td><td>0</td><td>0</td>
+%% <td>1</td></tr><tr><td>`?GL_R16'</td><td>ushort</td><td>1</td><td>YES</td><td>R</td><td>
+%% 0</td><td>0</td><td>1</td></tr><tr><td>`?GL_R16F'</td><td>half</td><td>1</td><td>NO</td>
+%% <td>R</td><td>0</td><td>0</td><td>1</td></tr><tr><td>`?GL_R32F'</td><td>float</td><td>
+%% 1</td><td>NO</td><td>R</td><td>0</td><td>0</td><td>1</td></tr><tr><td>`?GL_R8I'</td><td>
+%% byte</td><td>1</td><td>NO</td><td>R</td><td>0</td><td>0</td><td>1</td></tr><tr><td>`?GL_R16I'
+%% </td><td>short</td><td>1</td><td>NO</td><td>R</td><td>0</td><td>0</td><td>1</td></tr><tr><td>
+%% `?GL_R32I'</td><td>int</td><td>1</td><td>NO</td><td>R</td><td>0</td><td>0</td><td>1</td>
+%% </tr><tr><td>`?GL_R8UI'</td><td>ubyte</td><td>1</td><td>NO</td><td>R</td><td>0</td><td>
+%% 0</td><td>1</td></tr><tr><td>`?GL_R16UI'</td><td>ushort</td><td>1</td><td>NO</td><td>
+%% R</td><td>0</td><td>0</td><td>1</td></tr><tr><td>`?GL_R32UI'</td><td>uint</td><td>1</td>
+%% <td>NO</td><td>R</td><td>0</td><td>0</td><td>1</td></tr><tr><td>`?GL_RG8'</td><td>ubyte
+%% </td><td>2</td><td>YES</td><td>R</td><td>G</td><td>0</td><td>1</td></tr><tr><td>`?GL_RG16'
+%% </td><td>ushort</td><td>2</td><td>YES</td><td>R</td><td>G</td><td>0</td><td>1</td></tr><tr>
+%% <td>`?GL_RG16F'</td><td>half</td><td>2</td><td>NO</td><td>R</td><td>G</td><td>0</td><td>
+%% 1</td></tr><tr><td>`?GL_RG32F'</td><td>float</td><td>2</td><td>NO</td><td>R</td><td>G
+%% </td><td>0</td><td>1</td></tr><tr><td>`?GL_RG8I'</td><td>byte</td><td>2</td><td>NO</td>
+%% <td>R</td><td>G</td><td>0</td><td>1</td></tr><tr><td>`?GL_RG16I'</td><td>short</td><td>
+%% 2</td><td>NO</td><td>R</td><td>G</td><td>0</td><td>1</td></tr><tr><td>`?GL_RG32I'</td>
+%% <td>int</td><td>2</td><td>NO</td><td>R</td><td>G</td><td>0</td><td>1</td></tr><tr><td>`?GL_RG8UI'
+%% </td><td>ubyte</td><td>2</td><td>NO</td><td>R</td><td>G</td><td>0</td><td>1</td></tr><tr><td>
+%% `?GL_RG16UI'</td><td>ushort</td><td>2</td><td>NO</td><td>R</td><td>G</td><td>0</td><td>
+%% 1</td></tr><tr><td>`?GL_RG32UI'</td><td>uint</td><td>2</td><td>NO</td><td>R</td><td>G
+%% </td><td>0</td><td>1</td></tr><tr><td>`?GL_RGB32F'</td><td>float</td><td>3</td><td>NO
+%% </td><td>R</td><td>G</td><td>B</td><td>1</td></tr><tr><td>`?GL_RGB32I'</td><td>int</td>
+%% <td>3</td><td>NO</td><td>R</td><td>G</td><td>B</td><td>1</td></tr><tr><td>`?GL_RGB32UI'
+%% </td><td>uint</td><td>3</td><td>NO</td><td>R</td><td>G</td><td>B</td><td>1</td></tr><tr><td>
+%% `?GL_RGBA8'</td><td>uint</td><td>4</td><td>YES</td><td>R</td><td>G</td><td>B</td><td>
+%% A</td></tr><tr><td>`?GL_RGBA16'</td><td>short</td><td>4</td><td>YES</td><td>R</td><td>
+%% G</td><td>B</td><td>A</td></tr><tr><td>`?GL_RGBA16F'</td><td>half</td><td>4</td><td>NO
+%% </td><td>R</td><td>G</td><td>B</td><td>A</td></tr><tr><td>`?GL_RGBA32F'</td><td>float
+%% </td><td>4</td><td>NO</td><td>R</td><td>G</td><td>B</td><td>A</td></tr><tr><td>`?GL_RGBA8I'
+%% </td><td>byte</td><td>4</td><td>NO</td><td>R</td><td>G</td><td>B</td><td>A</td></tr><tr><td>
+%% `?GL_RGBA16I'</td><td>short</td><td>4</td><td>NO</td><td>R</td><td>G</td><td>B</td><td>
+%% A</td></tr><tr><td>`?GL_RGBA32I'</td><td>int</td><td>4</td><td>NO</td><td>R</td><td>G
+%% </td><td>B</td><td>A</td></tr><tr><td>`?GL_RGBA8UI'</td><td>ubyte</td><td>4</td><td>NO
+%% </td><td>R</td><td>G</td><td>B</td><td>A</td></tr><tr><td>`?GL_RGBA16UI'</td><td>ushort
+%% </td><td>4</td><td>NO</td><td>R</td><td>G</td><td>B</td><td>A</td></tr><tr><td>`?GL_RGBA32UI'
+%% </td><td>uint</td><td>4</td><td>NO</td><td>R</td><td>G</td><td>B</td><td>A</td></tr></tbody>
+%% </table>
+%%
+%% When a buffer object is attached to a buffer texture, the buffer object's data store
+%% is taken as the texture's texel array. The number of texels in the buffer texture's texel
+%% array is given by buffer_size components� sizeof( base_type/)
+%%
+%% where `buffer_size' is the size of the buffer object, in basic machine units and
+%% components and base type are the element count and base data type for elements, as specified
+%% in the table above. The number of texels in the texel array is then clamped to the implementation-dependent
+%% limit `?GL_MAX_TEXTURE_BUFFER_SIZE'. When a buffer texture is accessed in a shader,
+%% the results of a texel fetch are undefined if the specified texel coordinate is negative,
+%% or greater than or equal to the clamped number of texels in the texel array.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexBuffer.xml">external</a> documentation.
+-spec texBuffer(Target, Internalformat, Buffer) -> ok when Target :: enum(),Internalformat :: enum(),Buffer :: integer().
texBuffer(Target,Internalformat,Buffer) ->
cast(5580, <<Target:?GLenum,Internalformat:?GLenum,Buffer:?GLuint>>).
-%% @spec (Index::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPrimitiveRestartIndex.xml">external</a> documentation.
--spec primitiveRestartIndex(integer()) -> ok.
+%% @doc Specify the primitive restart index
+%%
+%% ``gl:primitiveRestartIndex'' specifies a vertex array element that is treated specially
+%% when primitive restarting is enabled. This is known as the primitive restart index.
+%%
+%% When one of the `Draw*' commands transfers a set of generic attribute array elements
+%% to the GL, if the index within the vertex arrays corresponding to that set is equal to
+%% the primitive restart index, then the GL does not process those elements as a vertex.
+%% Instead, it is as if the drawing command ended with the immediately preceding transfer,
+%% and another drawing command is immediately started with the same parameters, but only
+%% transferring the immediately following element through the end of the originally specified
+%% elements.
+%%
+%% When either {@link gl:drawElementsBaseVertex/5} , {@link gl:drawElementsInstancedBaseVertex/6}
+%% or see `glMultiDrawElementsBaseVertex' is used, the primitive restart comparison
+%% occurs before the basevertex offset is added to the array index.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPrimitiveRestartIndex.xml">external</a> documentation.
+-spec primitiveRestartIndex(Index) -> ok when Index :: integer().
primitiveRestartIndex(Index) ->
cast(5581, <<Index:?GLuint>>).
-%% @spec (Target::enum(),Index::integer()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetInteger64i_v.xml">external</a> documentation.
--spec getInteger64i_v(enum(),integer()) -> [integer()].
+%% @doc
+%% See {@link getBooleanv/1}
+-spec getInteger64i_v(Target, Index) -> [integer()] when Target :: enum(),Index :: integer().
getInteger64i_v(Target,Index) ->
call(5582, <<Target:?GLenum,Index:?GLuint>>).
-%% @spec (Target::enum(),Pname::enum()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetBufferParameteri64v.xml">external</a> documentation.
--spec getBufferParameteri64v(enum(),enum()) -> [integer()].
+%% @doc glGetBufferParameteri64v
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetBufferParameteri64v.xml">external</a> documentation.
+-spec getBufferParameteri64v(Target, Pname) -> [integer()] when Target :: enum(),Pname :: enum().
getBufferParameteri64v(Target,Pname) ->
call(5583, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Target::enum(),Attachment::enum(),Texture::integer(),Level::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFramebufferTexture.xml">external</a> documentation.
--spec framebufferTexture(enum(),enum(),integer(),integer()) -> ok.
+%% @doc Attach a level of a texture object as a logical buffer to the currently bound framebuffer object
+%%
+%% ``gl:framebufferTexture'', ``gl:framebufferTexture1D'', ``gl:framebufferTexture2D'',
+%% and ``gl:framebufferTexture'' attach a selected mipmap level or image of a texture object
+%% as one of the logical buffers of the framebuffer object currently bound to `Target' .
+%% `Target' must be `?GL_DRAW_FRAMEBUFFER', `?GL_READ_FRAMEBUFFER', or `?GL_FRAMEBUFFER'
+%% . `?GL_FRAMEBUFFER' is equivalent to `?GL_DRAW_FRAMEBUFFER'.
+%%
+%% `Attachment' specifies the logical attachment of the framebuffer and must be `?GL_COLOR_ATTACHMENT'
+%% `i', `?GL_DEPTH_ATTACHMENT', `?GL_STENCIL_ATTACHMENT' or `?GL_DEPTH_STENCIL_ATTACHMMENT'
+%% . `i' in `?GL_COLOR_ATTACHMENT'`i' may range from zero to the value of `?GL_MAX_COLOR_ATTACHMENTS'
+%% - 1. Attaching a level of a texture to `?GL_DEPTH_STENCIL_ATTACHMENT' is equivalent
+%% to attaching that level to both the `?GL_DEPTH_ATTACHMENT'`and' the `?GL_STENCIL_ATTACHMENT'
+%% attachment points simultaneously.
+%%
+%% `Textarget' specifies what type of texture is named by `Texture' , and for cube
+%% map textures, specifies the face that is to be attached. If `Texture' is not zero,
+%% it must be the name of an existing texture with type `Textarget' , unless it is a
+%% cube map texture, in which case `Textarget' must be `?GL_TEXTURE_CUBE_MAP_POSITIVE_X'
+%% `?GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `?GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `?GL_TEXTURE_CUBE_MAP_NEGATIVE_Y'
+%% , `?GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `?GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
+%%
+%% If `Texture' is non-zero, the specified `Level' of the texture object named `Texture'
+%% is attached to the framebfufer attachment point named by `Attachment' . For ``gl:framebufferTexture1D''
+%% , ``gl:framebufferTexture2D'', and ``gl:framebufferTexture3D'', `Texture' must
+%% be zero or the name of an existing texture with a target of `Textarget' , or `Texture'
+%% must be the name of an existing cube-map texture and `Textarget' must be one of `?GL_TEXTURE_CUBE_MAP_POSITIVE_X'
+%% , `?GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `?GL_TEXTURE_CUBE_MAP_POSITIVE_Z', `?GL_TEXTURE_CUBE_MAP_NEGATIVE_X'
+%% , `?GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', or `?GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
+%%
+%% If `Textarget' is `?GL_TEXTURE_RECTANGLE', `?GL_TEXTURE_2D_MULTISAMPLE',
+%% or `?GL_TEXTURE_2D_MULTISAMPLE_ARRAY', then `Level' must be zero. If `Textarget'
+%% is `?GL_TEXTURE_3D', then level must be greater than or equal to zero and less than
+%% or equal to log2 of the value of `?GL_MAX_3D_TEXTURE_SIZE'. If `Textarget' is
+%% one of `?GL_TEXTURE_CUBE_MAP_POSITIVE_X', `?GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `?GL_TEXTURE_CUBE_MAP_POSITIVE_Z'
+%% , `?GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `?GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', or `?GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'
+%% , then `Level' must be greater than or equal to zero and less than or equal to log2
+%% of the value of `?GL_MAX_CUBE_MAP_TEXTURE_SIZE'. For all other values of `Textarget'
+%% , `Level' must be greater than or equal to zero and no larger than log2 of the value
+%% of `?GL_MAX_TEXTURE_SIZE'.
+%%
+%% `Layer' specifies the layer of a 2-dimensional image within a 3-dimensional texture.
+%%
+%%
+%% For ``gl:framebufferTexture1D'', if `Texture' is not zero, then `Textarget'
+%% must be `?GL_TEXTURE_1D'. For ``gl:framebufferTexture2D'', if `Texture' is
+%% not zero, `Textarget' must be one of `?GL_TEXTURE_2D', `?GL_TEXTURE_RECTANGLE'
+%% , `?GL_TEXTURE_CUBE_MAP_POSITIVE_X', `?GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `?GL_TEXTURE_CUBE_MAP_POSITIVE_Z'
+%% , `?GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `?GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `?GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'
+%% , or `?GL_TEXTURE_2D_MULTISAMPLE'. For ``gl:framebufferTexture3D'', if `Texture'
+%% is not zero, then `Textarget' must be `?GL_TEXTURE_3D'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFramebufferTexture.xml">external</a> documentation.
+-spec framebufferTexture(Target, Attachment, Texture, Level) -> ok when Target :: enum(),Attachment :: enum(),Texture :: integer(),Level :: integer().
framebufferTexture(Target,Attachment,Texture,Level) ->
cast(5584, <<Target:?GLenum,Attachment:?GLenum,Texture:?GLuint,Level:?GLint>>).
-%% @spec (Index::integer(),Divisor::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribDivisor.xml">external</a> documentation.
--spec vertexAttribDivisor(integer(),integer()) -> ok.
+%% @doc Modify the rate at which generic vertex attributes advance during instanced rendering
+%%
+%% ``gl:vertexAttribDivisor'' modifies the rate at which generic vertex attributes advance
+%% when rendering multiple instances of primitives in a single draw call. If `Divisor'
+%% is zero, the attribute at slot `Index' advances once per vertex. If `Divisor'
+%% is non-zero, the attribute advances once per `Divisor' instances of the set(s) of
+%% vertices being rendered. An attribute is referred to as instanced if its `?GL_VERTEX_ATTRIB_ARRAY_DIVISOR'
+%% value is non-zero.
+%%
+%% `Index' must be less than the value of `?GL_MAX_VERTEX_ATTRIBUTES'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribDivisor.xml">external</a> documentation.
+-spec vertexAttribDivisor(Index, Divisor) -> ok when Index :: integer(),Divisor :: integer().
vertexAttribDivisor(Index,Divisor) ->
cast(5585, <<Index:?GLuint,Divisor:?GLuint>>).
-%% @spec (Value::clamp()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMinSampleShading.xml">external</a> documentation.
--spec minSampleShading(clamp()) -> ok.
+%% @doc Specifies minimum rate at which sample shaing takes place
+%%
+%% ``gl:minSampleShading'' specifies the rate at which samples are shaded within a covered
+%% pixel. Sample-rate shading is enabled by calling {@link gl:enable/1} with the parameter `?GL_SAMPLE_SHADING'
+%% . If `?GL_MULTISAMPLE' or `?GL_SAMPLE_SHADING' is disabled, sample shading has
+%% no effect. Otherwise, an implementation must provide at least as many unique color values
+%% for each covered fragment as specified by `Value' times `Samples' where `Samples'
+%% is the value of `?GL_SAMPLES' for the current framebuffer. At least 1 sample for
+%% each covered fragment is generated.
+%%
+%% A `Value' of 1.0 indicates that each sample in the framebuffer should be indpendently
+%% shaded. A `Value' of 0.0 effectively allows the GL to ignore sample rate shading.
+%% Any value between 0.0 and 1.0 allows the GL to shade only a subset of the total samples
+%% within each covered fragment. Which samples are shaded and the algorithm used to select
+%% that subset of the fragment's samples is implementation dependent.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMinSampleShading.xml">external</a> documentation.
+-spec minSampleShading(Value) -> ok when Value :: clamp().
minSampleShading(Value) ->
cast(5586, <<Value:?GLclampf>>).
-%% @spec (Buf::integer(),Mode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlendEquation.xml">external</a> documentation.
--spec blendEquationi(integer(),enum()) -> ok.
+%% @doc
+%% See {@link blendEquation/1}
+-spec blendEquationi(Buf, Mode) -> ok when Buf :: integer(),Mode :: enum().
blendEquationi(Buf,Mode) ->
cast(5587, <<Buf:?GLuint,Mode:?GLenum>>).
-%% @spec (Buf::integer(),ModeRGB::enum(),ModeAlpha::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlendEquationSeparate.xml">external</a> documentation.
--spec blendEquationSeparatei(integer(),enum(),enum()) -> ok.
+%% @doc
+%% See {@link blendEquationSeparate/2}
+-spec blendEquationSeparatei(Buf, ModeRGB, ModeAlpha) -> ok when Buf :: integer(),ModeRGB :: enum(),ModeAlpha :: enum().
blendEquationSeparatei(Buf,ModeRGB,ModeAlpha) ->
cast(5588, <<Buf:?GLuint,ModeRGB:?GLenum,ModeAlpha:?GLenum>>).
-%% @spec (Buf::integer(),Src::enum(),Dst::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlendFunci.xml">external</a> documentation.
--spec blendFunci(integer(),enum(),enum()) -> ok.
+%% @doc glBlendFunci
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlendFunci.xml">external</a> documentation.
+-spec blendFunci(Buf, Src, Dst) -> ok when Buf :: integer(),Src :: enum(),Dst :: enum().
blendFunci(Buf,Src,Dst) ->
cast(5589, <<Buf:?GLuint,Src:?GLenum,Dst:?GLenum>>).
-%% @spec (Buf::integer(),SrcRGB::enum(),DstRGB::enum(),SrcAlpha::enum(),DstAlpha::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlendFuncSeparate.xml">external</a> documentation.
--spec blendFuncSeparatei(integer(),enum(),enum(),enum(),enum()) -> ok.
+%% @doc
+%% See {@link blendFuncSeparate/4}
+-spec blendFuncSeparatei(Buf, SrcRGB, DstRGB, SrcAlpha, DstAlpha) -> ok when Buf :: integer(),SrcRGB :: enum(),DstRGB :: enum(),SrcAlpha :: enum(),DstAlpha :: enum().
blendFuncSeparatei(Buf,SrcRGB,DstRGB,SrcAlpha,DstAlpha) ->
cast(5590, <<Buf:?GLuint,SrcRGB:?GLenum,DstRGB:?GLenum,SrcAlpha:?GLenum,DstAlpha:?GLenum>>).
-%% @spec (M::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLoadTransposeMatrixARB.xml">external</a> documentation.
--spec loadTransposeMatrixfARB({float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok.
+%% @doc glLoadTransposeMatrixARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLoadTransposeMatrixARB.xml">external</a> documentation.
+-spec loadTransposeMatrixfARB(M) -> ok when M :: matrix().
loadTransposeMatrixfARB({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
cast(5591, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,M13:?GLfloat,M14:?GLfloat,M15:?GLfloat,M16:?GLfloat>>);
loadTransposeMatrixfARB({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
cast(5591, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,0:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,0:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,0:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,1:?GLfloat>>).
-%% @spec (M::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLoadTransposeMatrixARB.xml">external</a> documentation.
--spec loadTransposeMatrixdARB({float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok.
+%% @doc glLoadTransposeMatrixARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLoadTransposeMatrixARB.xml">external</a> documentation.
+-spec loadTransposeMatrixdARB(M) -> ok when M :: matrix().
loadTransposeMatrixdARB({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
cast(5592, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,M13:?GLdouble,M14:?GLdouble,M15:?GLdouble,M16:?GLdouble>>);
loadTransposeMatrixdARB({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
cast(5592, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,0:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,0:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,0:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,1:?GLdouble>>).
-%% @spec (M::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultTransposeMatrixARB.xml">external</a> documentation.
--spec multTransposeMatrixfARB({float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok.
+%% @doc glMultTransposeMatrixARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultTransposeMatrixARB.xml">external</a> documentation.
+-spec multTransposeMatrixfARB(M) -> ok when M :: matrix().
multTransposeMatrixfARB({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
cast(5593, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,M13:?GLfloat,M14:?GLfloat,M15:?GLfloat,M16:?GLfloat>>);
multTransposeMatrixfARB({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
cast(5593, <<M1:?GLfloat,M2:?GLfloat,M3:?GLfloat,0:?GLfloat,M4:?GLfloat,M5:?GLfloat,M6:?GLfloat,0:?GLfloat,M7:?GLfloat,M8:?GLfloat,M9:?GLfloat,0:?GLfloat,M10:?GLfloat,M11:?GLfloat,M12:?GLfloat,1:?GLfloat>>).
-%% @spec (M::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultTransposeMatrixARB.xml">external</a> documentation.
--spec multTransposeMatrixdARB({float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}) -> ok.
+%% @doc glMultTransposeMatrixARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMultTransposeMatrixARB.xml">external</a> documentation.
+-spec multTransposeMatrixdARB(M) -> ok when M :: matrix().
multTransposeMatrixdARB({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16}) ->
cast(5594, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,M13:?GLdouble,M14:?GLdouble,M15:?GLdouble,M16:?GLdouble>>);
multTransposeMatrixdARB({M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12}) ->
cast(5594, <<M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,0:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,0:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,0:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,1:?GLdouble>>).
-%% @spec (Weights::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
--spec weightbvARB([integer()]) -> ok.
+%% @doc glWeightARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
+-spec weightbvARB(Weights) -> ok when Weights :: [integer()].
weightbvARB(Weights) ->
cast(5595, <<(length(Weights)):?GLuint,
(<< <<C:?GLbyte>> || C <- Weights>>)/binary,0:((8-((length(Weights)+ 4) rem 8)) rem 8)>>).
-%% @spec (Weights::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
--spec weightsvARB([integer()]) -> ok.
+%% @doc glWeightARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
+-spec weightsvARB(Weights) -> ok when Weights :: [integer()].
weightsvARB(Weights) ->
cast(5596, <<(length(Weights)):?GLuint,
(<< <<C:?GLshort>> || C <- Weights>>)/binary,0:((8-((length(Weights)*2+ 4) rem 8)) rem 8)>>).
-%% @spec (Weights::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
--spec weightivARB([integer()]) -> ok.
+%% @doc glWeightARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
+-spec weightivARB(Weights) -> ok when Weights :: [integer()].
weightivARB(Weights) ->
cast(5597, <<(length(Weights)):?GLuint,
(<< <<C:?GLint>> || C <- Weights>>)/binary,0:(((1+length(Weights)) rem 2)*32)>>).
-%% @spec (Weights::[float()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
--spec weightfvARB([float()]) -> ok.
+%% @doc glWeightARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
+-spec weightfvARB(Weights) -> ok when Weights :: [float()].
weightfvARB(Weights) ->
cast(5598, <<(length(Weights)):?GLuint,
(<< <<C:?GLfloat>> || C <- Weights>>)/binary,0:(((1+length(Weights)) rem 2)*32)>>).
-%% @spec (Weights::[float()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
--spec weightdvARB([float()]) -> ok.
+%% @doc glWeightARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
+-spec weightdvARB(Weights) -> ok when Weights :: [float()].
weightdvARB(Weights) ->
cast(5599, <<(length(Weights)):?GLuint,0:32,
(<< <<C:?GLdouble>> || C <- Weights>>)/binary>>).
-%% @spec (Weights::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
--spec weightubvARB([integer()]) -> ok.
+%% @doc glWeightARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
+-spec weightubvARB(Weights) -> ok when Weights :: [integer()].
weightubvARB(Weights) ->
cast(5600, <<(length(Weights)):?GLuint,
(<< <<C:?GLubyte>> || C <- Weights>>)/binary,0:((8-((length(Weights)+ 4) rem 8)) rem 8)>>).
-%% @spec (Weights::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
--spec weightusvARB([integer()]) -> ok.
+%% @doc glWeightARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
+-spec weightusvARB(Weights) -> ok when Weights :: [integer()].
weightusvARB(Weights) ->
cast(5601, <<(length(Weights)):?GLuint,
(<< <<C:?GLushort>> || C <- Weights>>)/binary,0:((8-((length(Weights)*2+ 4) rem 8)) rem 8)>>).
-%% @spec (Weights::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
--spec weightuivARB([integer()]) -> ok.
+%% @doc glWeightARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWeightARB.xml">external</a> documentation.
+-spec weightuivARB(Weights) -> ok when Weights :: [integer()].
weightuivARB(Weights) ->
cast(5602, <<(length(Weights)):?GLuint,
(<< <<C:?GLuint>> || C <- Weights>>)/binary,0:(((1+length(Weights)) rem 2)*32)>>).
-%% @spec (Count::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexBlenARB.xml">external</a> documentation.
--spec vertexBlendARB(integer()) -> ok.
+%% @doc glVertexBlenARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexBlenARB.xml">external</a> documentation.
+-spec vertexBlendARB(Count) -> ok when Count :: integer().
vertexBlendARB(Count) ->
cast(5603, <<Count:?GLint>>).
-%% @spec (Index::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCurrentPaletteMatrixARB.xml">external</a> documentation.
--spec currentPaletteMatrixARB(integer()) -> ok.
+%% @doc glCurrentPaletteMatrixARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCurrentPaletteMatrixARB.xml">external</a> documentation.
+-spec currentPaletteMatrixARB(Index) -> ok when Index :: integer().
currentPaletteMatrixARB(Index) ->
cast(5604, <<Index:?GLint>>).
-%% @spec (Indices::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMatrixIndexARB.xml">external</a> documentation.
--spec matrixIndexubvARB([integer()]) -> ok.
+%% @doc glMatrixIndexARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMatrixIndexARB.xml">external</a> documentation.
+-spec matrixIndexubvARB(Indices) -> ok when Indices :: [integer()].
matrixIndexubvARB(Indices) ->
cast(5605, <<(length(Indices)):?GLuint,
(<< <<C:?GLubyte>> || C <- Indices>>)/binary,0:((8-((length(Indices)+ 4) rem 8)) rem 8)>>).
-%% @spec (Indices::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMatrixIndexARB.xml">external</a> documentation.
--spec matrixIndexusvARB([integer()]) -> ok.
+%% @doc glMatrixIndexARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMatrixIndexARB.xml">external</a> documentation.
+-spec matrixIndexusvARB(Indices) -> ok when Indices :: [integer()].
matrixIndexusvARB(Indices) ->
cast(5606, <<(length(Indices)):?GLuint,
(<< <<C:?GLushort>> || C <- Indices>>)/binary,0:((8-((length(Indices)*2+ 4) rem 8)) rem 8)>>).
-%% @spec (Indices::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMatrixIndexARB.xml">external</a> documentation.
--spec matrixIndexuivARB([integer()]) -> ok.
+%% @doc glMatrixIndexARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMatrixIndexARB.xml">external</a> documentation.
+-spec matrixIndexuivARB(Indices) -> ok when Indices :: [integer()].
matrixIndexuivARB(Indices) ->
cast(5607, <<(length(Indices)):?GLuint,
(<< <<C:?GLuint>> || C <- Indices>>)/binary,0:(((1+length(Indices)) rem 2)*32)>>).
-%% @spec (Target::enum(),Format::enum(),String::string()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramStringARB.xml">external</a> documentation.
--spec programStringARB(enum(),enum(),string()) -> ok.
+%% @doc glProgramStringARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramStringARB.xml">external</a> documentation.
+-spec programStringARB(Target, Format, String) -> ok when Target :: enum(),Format :: enum(),String :: string().
programStringARB(Target,Format,String) ->
cast(5608, <<Target:?GLenum,Format:?GLenum,(list_to_binary([String|[0]]))/binary,0:((8-((length(String)+ 1) rem 8)) rem 8)>>).
-%% @spec (Target::enum(),Program::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindProgramARB.xml">external</a> documentation.
--spec bindProgramARB(enum(),integer()) -> ok.
+%% @doc glBindProgramARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindProgramARB.xml">external</a> documentation.
+-spec bindProgramARB(Target, Program) -> ok when Target :: enum(),Program :: integer().
bindProgramARB(Target,Program) ->
cast(5609, <<Target:?GLenum,Program:?GLuint>>).
-%% @spec (Programs::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteProgramsARB.xml">external</a> documentation.
--spec deleteProgramsARB([integer()]) -> ok.
+%% @doc glDeleteProgramsARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteProgramsARB.xml">external</a> documentation.
+-spec deleteProgramsARB(Programs) -> ok when Programs :: [integer()].
deleteProgramsARB(Programs) ->
cast(5610, <<(length(Programs)):?GLuint,
(<< <<C:?GLuint>> || C <- Programs>>)/binary,0:(((1+length(Programs)) rem 2)*32)>>).
-%% @spec (N::integer()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenProgramsARB.xml">external</a> documentation.
--spec genProgramsARB(integer()) -> [integer()].
+%% @doc glGenProgramsARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenProgramsARB.xml">external</a> documentation.
+-spec genProgramsARB(N) -> [integer()] when N :: integer().
genProgramsARB(N) ->
call(5611, <<N:?GLsizei>>).
-%% @spec (Target::enum(),Index::integer(),X::float(),Y::float(),Z::float(),W::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramEnvParameterARB.xml">external</a> documentation.
--spec programEnvParameter4dARB(enum(),integer(),float(),float(),float(),float()) -> ok.
+%% @doc glProgramEnvParameterARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramEnvParameterARB.xml">external</a> documentation.
+-spec programEnvParameter4dARB(Target, Index, X, Y, Z, W) -> ok when Target :: enum(),Index :: integer(),X :: float(),Y :: float(),Z :: float(),W :: float().
programEnvParameter4dARB(Target,Index,X,Y,Z,W) ->
cast(5612, <<Target:?GLenum,Index:?GLuint,X:?GLdouble,Y:?GLdouble,Z:?GLdouble,W:?GLdouble>>).
-%% @spec (Target::enum(),Index::integer(),Params::{float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramEnvParameterARB.xml">external</a> documentation.
--spec programEnvParameter4dvARB(enum(),integer(),{float(),float(),float(),float()}) -> ok.
+%% @doc glProgramEnvParameterARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramEnvParameterARB.xml">external</a> documentation.
+-spec programEnvParameter4dvARB(Target, Index, Params) -> ok when Target :: enum(),Index :: integer(),Params :: {float(),float(),float(),float()}.
programEnvParameter4dvARB(Target,Index,{P1,P2,P3,P4}) ->
cast(5613, <<Target:?GLenum,Index:?GLuint,P1:?GLdouble,P2:?GLdouble,P3:?GLdouble,P4:?GLdouble>>).
-%% @spec (Target::enum(),Index::integer(),X::float(),Y::float(),Z::float(),W::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramEnvParameterARB.xml">external</a> documentation.
--spec programEnvParameter4fARB(enum(),integer(),float(),float(),float(),float()) -> ok.
+%% @doc glProgramEnvParameterARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramEnvParameterARB.xml">external</a> documentation.
+-spec programEnvParameter4fARB(Target, Index, X, Y, Z, W) -> ok when Target :: enum(),Index :: integer(),X :: float(),Y :: float(),Z :: float(),W :: float().
programEnvParameter4fARB(Target,Index,X,Y,Z,W) ->
cast(5614, <<Target:?GLenum,Index:?GLuint,X:?GLfloat,Y:?GLfloat,Z:?GLfloat,W:?GLfloat>>).
-%% @spec (Target::enum(),Index::integer(),Params::{float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramEnvParameterARB.xml">external</a> documentation.
--spec programEnvParameter4fvARB(enum(),integer(),{float(),float(),float(),float()}) -> ok.
+%% @doc glProgramEnvParameterARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramEnvParameterARB.xml">external</a> documentation.
+-spec programEnvParameter4fvARB(Target, Index, Params) -> ok when Target :: enum(),Index :: integer(),Params :: {float(),float(),float(),float()}.
programEnvParameter4fvARB(Target,Index,{P1,P2,P3,P4}) ->
cast(5615, <<Target:?GLenum,Index:?GLuint,P1:?GLfloat,P2:?GLfloat,P3:?GLfloat,P4:?GLfloat>>).
-%% @spec (Target::enum(),Index::integer(),X::float(),Y::float(),Z::float(),W::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramLocalParameterARB.xml">external</a> documentation.
--spec programLocalParameter4dARB(enum(),integer(),float(),float(),float(),float()) -> ok.
+%% @doc glProgramLocalParameterARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramLocalParameterARB.xml">external</a> documentation.
+-spec programLocalParameter4dARB(Target, Index, X, Y, Z, W) -> ok when Target :: enum(),Index :: integer(),X :: float(),Y :: float(),Z :: float(),W :: float().
programLocalParameter4dARB(Target,Index,X,Y,Z,W) ->
cast(5616, <<Target:?GLenum,Index:?GLuint,X:?GLdouble,Y:?GLdouble,Z:?GLdouble,W:?GLdouble>>).
-%% @spec (Target::enum(),Index::integer(),Params::{float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramLocalParameterARB.xml">external</a> documentation.
--spec programLocalParameter4dvARB(enum(),integer(),{float(),float(),float(),float()}) -> ok.
+%% @doc glProgramLocalParameterARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramLocalParameterARB.xml">external</a> documentation.
+-spec programLocalParameter4dvARB(Target, Index, Params) -> ok when Target :: enum(),Index :: integer(),Params :: {float(),float(),float(),float()}.
programLocalParameter4dvARB(Target,Index,{P1,P2,P3,P4}) ->
cast(5617, <<Target:?GLenum,Index:?GLuint,P1:?GLdouble,P2:?GLdouble,P3:?GLdouble,P4:?GLdouble>>).
-%% @spec (Target::enum(),Index::integer(),X::float(),Y::float(),Z::float(),W::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramLocalParameterARB.xml">external</a> documentation.
--spec programLocalParameter4fARB(enum(),integer(),float(),float(),float(),float()) -> ok.
+%% @doc glProgramLocalParameterARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramLocalParameterARB.xml">external</a> documentation.
+-spec programLocalParameter4fARB(Target, Index, X, Y, Z, W) -> ok when Target :: enum(),Index :: integer(),X :: float(),Y :: float(),Z :: float(),W :: float().
programLocalParameter4fARB(Target,Index,X,Y,Z,W) ->
cast(5618, <<Target:?GLenum,Index:?GLuint,X:?GLfloat,Y:?GLfloat,Z:?GLfloat,W:?GLfloat>>).
-%% @spec (Target::enum(),Index::integer(),Params::{float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramLocalParameterARB.xml">external</a> documentation.
--spec programLocalParameter4fvARB(enum(),integer(),{float(),float(),float(),float()}) -> ok.
+%% @doc glProgramLocalParameterARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramLocalParameterARB.xml">external</a> documentation.
+-spec programLocalParameter4fvARB(Target, Index, Params) -> ok when Target :: enum(),Index :: integer(),Params :: {float(),float(),float(),float()}.
programLocalParameter4fvARB(Target,Index,{P1,P2,P3,P4}) ->
cast(5619, <<Target:?GLenum,Index:?GLuint,P1:?GLfloat,P2:?GLfloat,P3:?GLfloat,P4:?GLfloat>>).
-%% @spec (Target::enum(),Index::integer()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramEnvParameterARB.xml">external</a> documentation.
--spec getProgramEnvParameterdvARB(enum(),integer()) -> {float(),float(),float(),float()}.
+%% @doc glGetProgramEnvParameterARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramEnvParameterARB.xml">external</a> documentation.
+-spec getProgramEnvParameterdvARB(Target, Index) -> {float(),float(),float(),float()} when Target :: enum(),Index :: integer().
getProgramEnvParameterdvARB(Target,Index) ->
call(5620, <<Target:?GLenum,Index:?GLuint>>).
-%% @spec (Target::enum(),Index::integer()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramEnvParameterARB.xml">external</a> documentation.
--spec getProgramEnvParameterfvARB(enum(),integer()) -> {float(),float(),float(),float()}.
+%% @doc glGetProgramEnvParameterARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramEnvParameterARB.xml">external</a> documentation.
+-spec getProgramEnvParameterfvARB(Target, Index) -> {float(),float(),float(),float()} when Target :: enum(),Index :: integer().
getProgramEnvParameterfvARB(Target,Index) ->
call(5621, <<Target:?GLenum,Index:?GLuint>>).
-%% @spec (Target::enum(),Index::integer()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramLocalParameterARB.xml">external</a> documentation.
--spec getProgramLocalParameterdvARB(enum(),integer()) -> {float(),float(),float(),float()}.
+%% @doc glGetProgramLocalParameterARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramLocalParameterARB.xml">external</a> documentation.
+-spec getProgramLocalParameterdvARB(Target, Index) -> {float(),float(),float(),float()} when Target :: enum(),Index :: integer().
getProgramLocalParameterdvARB(Target,Index) ->
call(5622, <<Target:?GLenum,Index:?GLuint>>).
-%% @spec (Target::enum(),Index::integer()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramLocalParameterARB.xml">external</a> documentation.
--spec getProgramLocalParameterfvARB(enum(),integer()) -> {float(),float(),float(),float()}.
+%% @doc glGetProgramLocalParameterARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramLocalParameterARB.xml">external</a> documentation.
+-spec getProgramLocalParameterfvARB(Target, Index) -> {float(),float(),float(),float()} when Target :: enum(),Index :: integer().
getProgramLocalParameterfvARB(Target,Index) ->
call(5623, <<Target:?GLenum,Index:?GLuint>>).
-%% @spec (Target::enum(),Pname::enum(),String::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramStringARB.xml">external</a> documentation.
--spec getProgramStringARB(enum(),enum(),mem()) -> ok.
+%% @doc glGetProgramStringARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramStringARB.xml">external</a> documentation.
+-spec getProgramStringARB(Target, Pname, String) -> ok when Target :: enum(),Pname :: enum(),String :: mem().
getProgramStringARB(Target,Pname,String) ->
send_bin(String),
call(5624, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Target::enum(),Pname::enum()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetBufferParameterARB.xml">external</a> documentation.
--spec getBufferParameterivARB(enum(),enum()) -> [integer()].
+%% @doc glGetBufferParameterARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetBufferParameterARB.xml">external</a> documentation.
+-spec getBufferParameterivARB(Target, Pname) -> [integer()] when Target :: enum(),Pname :: enum().
getBufferParameterivARB(Target,Pname) ->
call(5625, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Obj::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteObjectARB.xml">external</a> documentation.
--spec deleteObjectARB(integer()) -> ok.
+%% @doc glDeleteObjectARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteObjectARB.xml">external</a> documentation.
+-spec deleteObjectARB(Obj) -> ok when Obj :: integer().
deleteObjectARB(Obj) ->
cast(5626, <<Obj:?GLhandleARB>>).
-%% @spec (Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetHandleARB.xml">external</a> documentation.
--spec getHandleARB(enum()) -> integer().
+%% @doc glGetHandleARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetHandleARB.xml">external</a> documentation.
+-spec getHandleARB(Pname) -> integer() when Pname :: enum().
getHandleARB(Pname) ->
call(5627, <<Pname:?GLenum>>).
-%% @spec (ContainerObj::integer(),AttachedObj::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDetachObjectARB.xml">external</a> documentation.
--spec detachObjectARB(integer(),integer()) -> ok.
+%% @doc glDetachObjectARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDetachObjectARB.xml">external</a> documentation.
+-spec detachObjectARB(ContainerObj, AttachedObj) -> ok when ContainerObj :: integer(),AttachedObj :: integer().
detachObjectARB(ContainerObj,AttachedObj) ->
cast(5628, <<ContainerObj:?GLhandleARB,AttachedObj:?GLhandleARB>>).
-%% @spec (ShaderType::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCreateShaderObjectARB.xml">external</a> documentation.
--spec createShaderObjectARB(enum()) -> integer().
+%% @doc glCreateShaderObjectARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCreateShaderObjectARB.xml">external</a> documentation.
+-spec createShaderObjectARB(ShaderType) -> integer() when ShaderType :: enum().
createShaderObjectARB(ShaderType) ->
call(5629, <<ShaderType:?GLenum>>).
-%% @spec (ShaderObj::integer(),String::[string()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glShaderSourceARB.xml">external</a> documentation.
--spec shaderSourceARB(integer(),[string()]) -> ok.
+%% @doc glShaderSourceARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glShaderSourceARB.xml">external</a> documentation.
+-spec shaderSourceARB(ShaderObj, String) -> ok when ShaderObj :: integer(),String :: [string()].
shaderSourceARB(ShaderObj,String) ->
StringTemp = list_to_binary([[Str|[0]] || Str <- String ]),
cast(5630, <<ShaderObj:?GLhandleARB,(length(String)):?GLuint,(size(StringTemp)):?GLuint,(StringTemp)/binary,0:((8-((size(StringTemp)+4) rem 8)) rem 8)>>).
-%% @spec (ShaderObj::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompileShaderARB.xml">external</a> documentation.
--spec compileShaderARB(integer()) -> ok.
+%% @doc glCompileShaderARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompileShaderARB.xml">external</a> documentation.
+-spec compileShaderARB(ShaderObj) -> ok when ShaderObj :: integer().
compileShaderARB(ShaderObj) ->
cast(5631, <<ShaderObj:?GLhandleARB>>).
-%% @spec () -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCreateProgramObjectARB.xml">external</a> documentation.
+%% @doc glCreateProgramObjectARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCreateProgramObjectARB.xml">external</a> documentation.
-spec createProgramObjectARB() -> integer().
createProgramObjectARB() ->
call(5632, <<>>).
-%% @spec (ContainerObj::integer(),Obj::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glAttachObjectARB.xml">external</a> documentation.
--spec attachObjectARB(integer(),integer()) -> ok.
+%% @doc glAttachObjectARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glAttachObjectARB.xml">external</a> documentation.
+-spec attachObjectARB(ContainerObj, Obj) -> ok when ContainerObj :: integer(),Obj :: integer().
attachObjectARB(ContainerObj,Obj) ->
cast(5633, <<ContainerObj:?GLhandleARB,Obj:?GLhandleARB>>).
-%% @spec (ProgramObj::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLinkProgramARB.xml">external</a> documentation.
--spec linkProgramARB(integer()) -> ok.
+%% @doc glLinkProgramARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glLinkProgramARB.xml">external</a> documentation.
+-spec linkProgramARB(ProgramObj) -> ok when ProgramObj :: integer().
linkProgramARB(ProgramObj) ->
cast(5634, <<ProgramObj:?GLhandleARB>>).
-%% @spec (ProgramObj::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUseProgramObjectARB.xml">external</a> documentation.
--spec useProgramObjectARB(integer()) -> ok.
+%% @doc glUseProgramObjectARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUseProgramObjectARB.xml">external</a> documentation.
+-spec useProgramObjectARB(ProgramObj) -> ok when ProgramObj :: integer().
useProgramObjectARB(ProgramObj) ->
cast(5635, <<ProgramObj:?GLhandleARB>>).
-%% @spec (ProgramObj::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glValidateProgramARB.xml">external</a> documentation.
--spec validateProgramARB(integer()) -> ok.
+%% @doc glValidateProgramARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glValidateProgramARB.xml">external</a> documentation.
+-spec validateProgramARB(ProgramObj) -> ok when ProgramObj :: integer().
validateProgramARB(ProgramObj) ->
cast(5636, <<ProgramObj:?GLhandleARB>>).
-%% @spec (Obj::integer(),Pname::enum()) -> float()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetObjectParameterARB.xml">external</a> documentation.
--spec getObjectParameterfvARB(integer(),enum()) -> float().
+%% @doc glGetObjectParameterARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetObjectParameterARB.xml">external</a> documentation.
+-spec getObjectParameterfvARB(Obj, Pname) -> float() when Obj :: integer(),Pname :: enum().
getObjectParameterfvARB(Obj,Pname) ->
call(5637, <<Obj:?GLhandleARB,Pname:?GLenum>>).
-%% @spec (Obj::integer(),Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetObjectParameterARB.xml">external</a> documentation.
--spec getObjectParameterivARB(integer(),enum()) -> integer().
+%% @doc glGetObjectParameterARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetObjectParameterARB.xml">external</a> documentation.
+-spec getObjectParameterivARB(Obj, Pname) -> integer() when Obj :: integer(),Pname :: enum().
getObjectParameterivARB(Obj,Pname) ->
call(5638, <<Obj:?GLhandleARB,Pname:?GLenum>>).
-%% @spec (Obj::integer(),MaxLength::integer()) -> string()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetInfoLogARB.xml">external</a> documentation.
--spec getInfoLogARB(integer(),integer()) -> string().
+%% @doc glGetInfoLogARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetInfoLogARB.xml">external</a> documentation.
+-spec getInfoLogARB(Obj, MaxLength) -> string() when Obj :: integer(),MaxLength :: integer().
getInfoLogARB(Obj,MaxLength) ->
call(5639, <<Obj:?GLhandleARB,MaxLength:?GLsizei>>).
-%% @spec (ContainerObj::integer(),MaxCount::integer()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetAttachedObjectsARB.xml">external</a> documentation.
--spec getAttachedObjectsARB(integer(),integer()) -> [integer()].
+%% @doc glGetAttachedObjectsARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetAttachedObjectsARB.xml">external</a> documentation.
+-spec getAttachedObjectsARB(ContainerObj, MaxCount) -> [integer()] when ContainerObj :: integer(),MaxCount :: integer().
getAttachedObjectsARB(ContainerObj,MaxCount) ->
call(5640, <<ContainerObj:?GLhandleARB,MaxCount:?GLsizei>>).
-%% @spec (ProgramObj::integer(),Name::string()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformLocationARB.xml">external</a> documentation.
--spec getUniformLocationARB(integer(),string()) -> integer().
+%% @doc glGetUniformLocationARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformLocationARB.xml">external</a> documentation.
+-spec getUniformLocationARB(ProgramObj, Name) -> integer() when ProgramObj :: integer(),Name :: string().
getUniformLocationARB(ProgramObj,Name) ->
call(5641, <<ProgramObj:?GLhandleARB,(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 1) rem 8)) rem 8)>>).
-%% @spec (ProgramObj::integer(),Index::integer(),MaxLength::integer()) -> {Size::integer(),Type::enum(),Name::string()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveUniformARB.xml">external</a> documentation.
--spec getActiveUniformARB(integer(),integer(),integer()) -> {integer(),enum(),string()}.
+%% @doc glGetActiveUniformARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveUniformARB.xml">external</a> documentation.
+-spec getActiveUniformARB(ProgramObj, Index, MaxLength) -> {Size :: integer(),Type :: enum(),Name :: string()} when ProgramObj :: integer(),Index :: integer(),MaxLength :: integer().
getActiveUniformARB(ProgramObj,Index,MaxLength) ->
call(5642, <<ProgramObj:?GLhandleARB,Index:?GLuint,MaxLength:?GLsizei>>).
-%% @spec (ProgramObj::integer(),Location::integer()) -> {float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformARB.xml">external</a> documentation.
--spec getUniformfvARB(integer(),integer()) -> {float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}.
+%% @doc glGetUniformARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformARB.xml">external</a> documentation.
+-spec getUniformfvARB(ProgramObj, Location) -> matrix() when ProgramObj :: integer(),Location :: integer().
getUniformfvARB(ProgramObj,Location) ->
call(5643, <<ProgramObj:?GLhandleARB,Location:?GLint>>).
-%% @spec (ProgramObj::integer(),Location::integer()) -> {integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformARB.xml">external</a> documentation.
--spec getUniformivARB(integer(),integer()) -> {integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer()}.
+%% @doc glGetUniformARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformARB.xml">external</a> documentation.
+-spec getUniformivARB(ProgramObj, Location) -> {integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer()} when ProgramObj :: integer(),Location :: integer().
getUniformivARB(ProgramObj,Location) ->
call(5644, <<ProgramObj:?GLhandleARB,Location:?GLint>>).
-%% @spec (Obj::integer(),MaxLength::integer()) -> string()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetShaderSourceARB.xml">external</a> documentation.
--spec getShaderSourceARB(integer(),integer()) -> string().
+%% @doc glGetShaderSourceARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetShaderSourceARB.xml">external</a> documentation.
+-spec getShaderSourceARB(Obj, MaxLength) -> string() when Obj :: integer(),MaxLength :: integer().
getShaderSourceARB(Obj,MaxLength) ->
call(5645, <<Obj:?GLhandleARB,MaxLength:?GLsizei>>).
-%% @spec (ProgramObj::integer(),Index::integer(),Name::string()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindAttribLocationARB.xml">external</a> documentation.
--spec bindAttribLocationARB(integer(),integer(),string()) -> ok.
+%% @doc glBindAttribLocationARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindAttribLocationARB.xml">external</a> documentation.
+-spec bindAttribLocationARB(ProgramObj, Index, Name) -> ok when ProgramObj :: integer(),Index :: integer(),Name :: string().
bindAttribLocationARB(ProgramObj,Index,Name) ->
cast(5646, <<ProgramObj:?GLhandleARB,Index:?GLuint,(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 5) rem 8)) rem 8)>>).
-%% @spec (ProgramObj::integer(),Index::integer(),MaxLength::integer()) -> {Size::integer(),Type::enum(),Name::string()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveAttribARB.xml">external</a> documentation.
--spec getActiveAttribARB(integer(),integer(),integer()) -> {integer(),enum(),string()}.
+%% @doc glGetActiveAttribARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveAttribARB.xml">external</a> documentation.
+-spec getActiveAttribARB(ProgramObj, Index, MaxLength) -> {Size :: integer(),Type :: enum(),Name :: string()} when ProgramObj :: integer(),Index :: integer(),MaxLength :: integer().
getActiveAttribARB(ProgramObj,Index,MaxLength) ->
call(5647, <<ProgramObj:?GLhandleARB,Index:?GLuint,MaxLength:?GLsizei>>).
-%% @spec (ProgramObj::integer(),Name::string()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetAttribLocationARB.xml">external</a> documentation.
--spec getAttribLocationARB(integer(),string()) -> integer().
+%% @doc glGetAttribLocationARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetAttribLocationARB.xml">external</a> documentation.
+-spec getAttribLocationARB(ProgramObj, Name) -> integer() when ProgramObj :: integer(),Name :: string().
getAttribLocationARB(ProgramObj,Name) ->
call(5648, <<ProgramObj:?GLhandleARB,(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 1) rem 8)) rem 8)>>).
-%% @spec (Renderbuffer::integer()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsRenderbuffer.xml">external</a> documentation.
--spec isRenderbuffer(integer()) -> 0|1.
+%% @doc Determine if a name corresponds to a renderbuffer object
+%%
+%% ``gl:isRenderbuffer'' returns `?GL_TRUE' if `Renderbuffer' is currently the
+%% name of a renderbuffer object. If `Renderbuffer' is zero, or if `Renderbuffer'
+%% is not the name of a renderbuffer object, or if an error occurs, ``gl:isRenderbuffer''
+%% returns `?GL_FALSE'. If `Renderbuffer' is a name returned by {@link gl:genRenderbuffers/1}
+%% , by that has not yet been bound through a call to {@link gl:bindRenderbuffer/2} or {@link gl:framebufferRenderbuffer/4}
+%% , then the name is not a renderbuffer object and ``gl:isRenderbuffer'' returns `?GL_FALSE'
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsRenderbuffer.xml">external</a> documentation.
+-spec isRenderbuffer(Renderbuffer) -> 0|1 when Renderbuffer :: integer().
isRenderbuffer(Renderbuffer) ->
call(5649, <<Renderbuffer:?GLuint>>).
-%% @spec (Target::enum(),Renderbuffer::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindRenderbuffer.xml">external</a> documentation.
--spec bindRenderbuffer(enum(),integer()) -> ok.
+%% @doc Bind a renderbuffer to a renderbuffer target
+%%
+%% ``gl:bindRenderbuffer'' binds the renderbuffer object with name `Renderbuffer'
+%% to the renderbuffer target specified by `Target' . `Target' must be `?GL_RENDERBUFFER'
+%% . `Renderbuffer' is the name of a renderbuffer object previously returned from a
+%% call to {@link gl:genRenderbuffers/1} , or zero to break the existing binding of a renderbuffer
+%% object to `Target' .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindRenderbuffer.xml">external</a> documentation.
+-spec bindRenderbuffer(Target, Renderbuffer) -> ok when Target :: enum(),Renderbuffer :: integer().
bindRenderbuffer(Target,Renderbuffer) ->
cast(5650, <<Target:?GLenum,Renderbuffer:?GLuint>>).
-%% @spec (Renderbuffers::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteRenderbuffers.xml">external</a> documentation.
--spec deleteRenderbuffers([integer()]) -> ok.
+%% @doc Delete renderbuffer objects
+%%
+%% ``gl:deleteRenderbuffers'' deletes the `N' renderbuffer objects whose names are
+%% stored in the array addressed by `Renderbuffers' . The name zero is reserved by the
+%% GL and is silently ignored, should it occur in `Renderbuffers' , as are other unused
+%% names. Once a renderbuffer object is deleted, its name is again unused and it has no contents.
+%% If a renderbuffer that is currently bound to the target `?GL_RENDERBUFFER' is deleted,
+%% it is as though {@link gl:bindRenderbuffer/2} had been executed with a `Target' of `?GL_RENDERBUFFER'
+%% and a `Name' of zero.
+%%
+%% If a renderbuffer object is attached to one or more attachment points in the currently
+%% bound framebuffer, then it as if {@link gl:framebufferRenderbuffer/4} had been called,
+%% with a `Renderbuffer' of zero for each attachment point to which this image was attached
+%% in the currently bound framebuffer. In other words, this renderbuffer object is first
+%% detached from all attachment ponits in the currently bound framebuffer. Note that the
+%% renderbuffer image is specifically `not' detached from any non-bound framebuffers.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteRenderbuffers.xml">external</a> documentation.
+-spec deleteRenderbuffers(Renderbuffers) -> ok when Renderbuffers :: [integer()].
deleteRenderbuffers(Renderbuffers) ->
cast(5651, <<(length(Renderbuffers)):?GLuint,
(<< <<C:?GLuint>> || C <- Renderbuffers>>)/binary,0:(((1+length(Renderbuffers)) rem 2)*32)>>).
-%% @spec (N::integer()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenRenderbuffers.xml">external</a> documentation.
--spec genRenderbuffers(integer()) -> [integer()].
+%% @doc Generate renderbuffer object names
+%%
+%% ``gl:genRenderbuffers'' returns `N' renderbuffer object names in `Renderbuffers'
+%% . There is no guarantee that the names form a contiguous set of integers; however, it
+%% is guaranteed that none of the returned names was in use immediately before the call to ``gl:genRenderbuffers''
+%% .
+%%
+%% Renderbuffer object names returned by a call to ``gl:genRenderbuffers'' are not returned
+%% by subsequent calls, unless they are first deleted with {@link gl:deleteRenderbuffers/1} .
+%%
+%% The names returned in `Renderbuffers' are marked as used, for the purposes of ``gl:genRenderbuffers''
+%% only, but they acquire state and type only when they are first bound.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenRenderbuffers.xml">external</a> documentation.
+-spec genRenderbuffers(N) -> [integer()] when N :: integer().
genRenderbuffers(N) ->
call(5652, <<N:?GLsizei>>).
-%% @spec (Target::enum(),Internalformat::enum(),Width::integer(),Height::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRenderbufferStorage.xml">external</a> documentation.
--spec renderbufferStorage(enum(),enum(),integer(),integer()) -> ok.
+%% @doc Establish data storage, format and dimensions of a renderbuffer object's image
+%%
+%% ``gl:renderbufferStorage'' is equivalent to calling {@link gl:renderbufferStorageMultisample/5}
+%% with the `Samples' set to zero.
+%%
+%% The target of the operation, specified by `Target' must be `?GL_RENDERBUFFER'.
+%% `Internalformat' specifies the internal format to be used for the renderbuffer object's
+%% storage and must be a color-renderable, depth-renderable, or stencil-renderable format. `Width'
+%% and `Height' are the dimensions, in pixels, of the renderbuffer. Both `Width'
+%% and `Height' must be less than or equal to the value of `?GL_MAX_RENDERBUFFER_SIZE'
+%% .
+%%
+%% Upon success, ``gl:renderbufferStorage'' deletes any existing data store for the renderbuffer
+%% image and the contents of the data store after calling ``gl:renderbufferStorage'' are
+%% undefined.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRenderbufferStorage.xml">external</a> documentation.
+-spec renderbufferStorage(Target, Internalformat, Width, Height) -> ok when Target :: enum(),Internalformat :: enum(),Width :: integer(),Height :: integer().
renderbufferStorage(Target,Internalformat,Width,Height) ->
cast(5653, <<Target:?GLenum,Internalformat:?GLenum,Width:?GLsizei,Height:?GLsizei>>).
-%% @spec (Target::enum(),Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetRenderbufferParameter.xml">external</a> documentation.
--spec getRenderbufferParameteriv(enum(),enum()) -> integer().
+%% @doc Retrieve information about a bound renderbuffer object
+%%
+%% ``gl:getRenderbufferParameteriv'' retrieves information about a bound renderbuffer object.
+%% `Target' specifies the target of the query operation and must be `?GL_RENDERBUFFER'
+%% . `Pname' specifies the parameter whose value to query and must be one of `?GL_RENDERBUFFER_WIDTH'
+%% , `?GL_RENDERBUFFER_HEIGHT', `?GL_RENDERBUFFER_INTERNAL_FORMAT', `?GL_RENDERBUFFER_RED_SIZE'
+%% , `?GL_RENDERBUFFER_GREEN_SIZE', `?GL_RENDERBUFFER_BLUE_SIZE', `?GL_RENDERBUFFER_ALPHA_SIZE'
+%% , `?GL_RENDERBUFFER_DEPTH_SIZE', `?GL_RENDERBUFFER_DEPTH_SIZE', `?GL_RENDERBUFFER_STENCIL_SIZE'
+%% , or `?GL_RENDERBUFFER_SAMPLES'.
+%%
+%% Upon a successful return from ``gl:getRenderbufferParameteriv'', if `Pname' is `?GL_RENDERBUFFER_WIDTH'
+%% , `?GL_RENDERBUFFER_HEIGHT', `?GL_RENDERBUFFER_INTERNAL_FORMAT', or `?GL_RENDERBUFFER_SAMPLES'
+%% , then `Params' will contain the width in pixels, the height in pixels, the internal
+%% format, or the number of samples, respectively, of the image of the renderbuffer currently
+%% bound to `Target' .
+%%
+%% If `Pname' is `?GL_RENDERBUFFER_RED_SIZE', `?GL_RENDERBUFFER_GREEN_SIZE',
+%% `?GL_RENDERBUFFER_BLUE_SIZE', `?GL_RENDERBUFFER_ALPHA_SIZE', `?GL_RENDERBUFFER_DEPTH_SIZE'
+%% , or `?GL_RENDERBUFFER_STENCIL_SIZE', then `Params' will contain the actual
+%% resolutions (not the resolutions specified when the image array was defined) for the red,
+%% green, blue, alpha depth, or stencil components, respectively, of the image of the renderbuffer
+%% currently bound to `Target' .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetRenderbufferParameter.xml">external</a> documentation.
+-spec getRenderbufferParameteriv(Target, Pname) -> integer() when Target :: enum(),Pname :: enum().
getRenderbufferParameteriv(Target,Pname) ->
call(5654, <<Target:?GLenum,Pname:?GLenum>>).
-%% @spec (Framebuffer::integer()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsFramebuffer.xml">external</a> documentation.
--spec isFramebuffer(integer()) -> 0|1.
+%% @doc Determine if a name corresponds to a framebuffer object
+%%
+%% ``gl:isFramebuffer'' returns `?GL_TRUE' if `Framebuffer' is currently the
+%% name of a framebuffer object. If `Framebuffer' is zero, or if `?framebuffer'
+%% is not the name of a framebuffer object, or if an error occurs, ``gl:isFramebuffer''
+%% returns `?GL_FALSE'. If `Framebuffer' is a name returned by {@link gl:genFramebuffers/1}
+%% , by that has not yet been bound through a call to {@link gl:bindFramebuffer/2} , then the
+%% name is not a framebuffer object and ``gl:isFramebuffer'' returns `?GL_FALSE'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsFramebuffer.xml">external</a> documentation.
+-spec isFramebuffer(Framebuffer) -> 0|1 when Framebuffer :: integer().
isFramebuffer(Framebuffer) ->
call(5655, <<Framebuffer:?GLuint>>).
-%% @spec (Target::enum(),Framebuffer::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindFramebuffer.xml">external</a> documentation.
--spec bindFramebuffer(enum(),integer()) -> ok.
+%% @doc Bind a framebuffer to a framebuffer target
+%%
+%% ``gl:bindFramebuffer'' binds the framebuffer object with name `Framebuffer' to
+%% the framebuffer target specified by `Target' . `Target' must be either `?GL_DRAW_FRAMEBUFFER'
+%% , `?GL_READ_FRAMEBUFFER' or `?GL_FRAMEBUFFER'. If a framebuffer object is bound
+%% to `?GL_DRAW_FRAMEBUFFER' or `?GL_READ_FRAMEBUFFER', it becomes the target for
+%% rendering or readback operations, respectively, until it is deleted or another framebuffer
+%% is bound to the corresponding bind point. Calling ``gl:bindFramebuffer'' with `Target'
+%% set to `?GL_FRAMEBUFFER' binds `Framebuffer' to both the read and draw framebuffer
+%% targets. `Framebuffer' is the name of a framebuffer object previously returned from
+%% a call to {@link gl:genFramebuffers/1} , or zero to break the existing binding of a framebuffer
+%% object to `Target' .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindFramebuffer.xml">external</a> documentation.
+-spec bindFramebuffer(Target, Framebuffer) -> ok when Target :: enum(),Framebuffer :: integer().
bindFramebuffer(Target,Framebuffer) ->
cast(5656, <<Target:?GLenum,Framebuffer:?GLuint>>).
-%% @spec (Framebuffers::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteFramebuffers.xml">external</a> documentation.
--spec deleteFramebuffers([integer()]) -> ok.
+%% @doc Delete framebuffer objects
+%%
+%% ``gl:deleteFramebuffers'' deletes the `N' framebuffer objects whose names are stored
+%% in the array addressed by `Framebuffers' . The name zero is reserved by the GL and
+%% is silently ignored, should it occur in `Framebuffers' , as are other unused names.
+%% Once a framebuffer object is deleted, its name is again unused and it has no attachments.
+%% If a framebuffer that is currently bound to one or more of the targets `?GL_DRAW_FRAMEBUFFER'
+%% or `?GL_READ_FRAMEBUFFER' is deleted, it is as though {@link gl:bindFramebuffer/2}
+%% had been executed with the corresponding `Target' and `Framebuffer' zero.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteFramebuffers.xml">external</a> documentation.
+-spec deleteFramebuffers(Framebuffers) -> ok when Framebuffers :: [integer()].
deleteFramebuffers(Framebuffers) ->
cast(5657, <<(length(Framebuffers)):?GLuint,
(<< <<C:?GLuint>> || C <- Framebuffers>>)/binary,0:(((1+length(Framebuffers)) rem 2)*32)>>).
-%% @spec (N::integer()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenFramebuffers.xml">external</a> documentation.
--spec genFramebuffers(integer()) -> [integer()].
+%% @doc Generate framebuffer object names
+%%
+%% ``gl:genFramebuffers'' returns `N' framebuffer object names in `Ids' . There
+%% is no guarantee that the names form a contiguous set of integers; however, it is guaranteed
+%% that none of the returned names was in use immediately before the call to ``gl:genFramebuffers''
+%% .
+%%
+%% Framebuffer object names returned by a call to ``gl:genFramebuffers'' are not returned
+%% by subsequent calls, unless they are first deleted with {@link gl:deleteFramebuffers/1} .
+%%
+%% The names returned in `Ids' are marked as used, for the purposes of ``gl:genFramebuffers''
+%% only, but they acquire state and type only when they are first bound.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenFramebuffers.xml">external</a> documentation.
+-spec genFramebuffers(N) -> [integer()] when N :: integer().
genFramebuffers(N) ->
call(5658, <<N:?GLsizei>>).
-%% @spec (Target::enum()) -> enum()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCheckFramebufferStatus.xml">external</a> documentation.
--spec checkFramebufferStatus(enum()) -> enum().
+%% @doc Check the completeness status of a framebuffer
+%%
+%% ``gl:checkFramebufferStatus'' queries the completeness status of the framebuffer object
+%% currently bound to `Target' . `Target' must be `?GL_DRAW_FRAMEBUFFER', `?GL_READ_FRAMEBUFFER'
+%% or `?GL_FRAMEBUFFER'. `?GL_FRAMEBUFFER' is equivalent to `?GL_DRAW_FRAMEBUFFER'
+%% .
+%%
+%% The return value is `?GL_FRAMEBUFFER_COMPLETE' if the framebuffer bound to `Target'
+%% is complete. Otherwise, the return value is determined as follows:
+%%
+%% `?GL_FRAMEBUFFER_UNDEFINED' is returned if `Target' is the default framebuffer,
+%% but the default framebuffer does not exist.
+%%
+%% `?GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT' is returned if any of the framebuffer attachment
+%% points are framebuffer incomplete.
+%%
+%% `?GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT' is returned if the framebuffer does
+%% not have at least one image attached to it.
+%%
+%% `?GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER' is returned if the value of `?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE'
+%% is `?GL_NONE' for any color attachment point(s) named by `?GL_DRAWBUFFERi'.
+%%
+%% `?GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER' is returned if `?GL_READ_BUFFER' is
+%% not `?GL_NONE' and the value of `?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE' is `?GL_NONE'
+%% for the color attachment point named by `?GL_READ_BUFFER'.
+%%
+%% `?GL_FRAMEBUFFER_UNSUPPORTED' is returned if the combination of internal formats
+%% of the attached images violates an implementation-dependent set of restrictions.
+%%
+%% `?GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE' is returned if the value of `?GL_RENDERBUFFER_SAMPLES'
+%% is not the same for all attached renderbuffers; if the value of `?GL_TEXTURE_SAMPLES'
+%% is the not same for all attached textures; or, if the attached images are a mix of renderbuffers
+%% and textures, the value of `?GL_RENDERBUFFER_SAMPLES' does not match the value of `?GL_TEXTURE_SAMPLES'
+%% .
+%%
+%% `?GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE' is also returned if the value of `?GL_TEXTURE_FIXED_SAMPLE_LOCATIONS'
+%% is not the same for all attached textures; or, if the attached images are a mix of renderbuffers
+%% and textures, the value of `?GL_TEXTURE_FIXED_SAMPLE_LOCATIONS' is not `?GL_TRUE'
+%% for all attached textures.
+%%
+%% `?GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS' is returned if any framebuffer attachment
+%% is layered, and any populated attachment is not layered, or if all populated color attachments
+%% are not from textures of the same target.
+%%
+%% Additionally, if an error occurs, zero is returned.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCheckFramebufferStatus.xml">external</a> documentation.
+-spec checkFramebufferStatus(Target) -> enum() when Target :: enum().
checkFramebufferStatus(Target) ->
call(5659, <<Target:?GLenum>>).
-%% @spec (Target::enum(),Attachment::enum(),Textarget::enum(),Texture::integer(),Level::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFramebufferTexture1D.xml">external</a> documentation.
--spec framebufferTexture1D(enum(),enum(),enum(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link framebufferTexture/4}
+-spec framebufferTexture1D(Target, Attachment, Textarget, Texture, Level) -> ok when Target :: enum(),Attachment :: enum(),Textarget :: enum(),Texture :: integer(),Level :: integer().
framebufferTexture1D(Target,Attachment,Textarget,Texture,Level) ->
cast(5660, <<Target:?GLenum,Attachment:?GLenum,Textarget:?GLenum,Texture:?GLuint,Level:?GLint>>).
-%% @spec (Target::enum(),Attachment::enum(),Textarget::enum(),Texture::integer(),Level::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFramebufferTexture2D.xml">external</a> documentation.
--spec framebufferTexture2D(enum(),enum(),enum(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link framebufferTexture/4}
+-spec framebufferTexture2D(Target, Attachment, Textarget, Texture, Level) -> ok when Target :: enum(),Attachment :: enum(),Textarget :: enum(),Texture :: integer(),Level :: integer().
framebufferTexture2D(Target,Attachment,Textarget,Texture,Level) ->
cast(5661, <<Target:?GLenum,Attachment:?GLenum,Textarget:?GLenum,Texture:?GLuint,Level:?GLint>>).
-%% @spec (Target::enum(),Attachment::enum(),Textarget::enum(),Texture::integer(),Level::integer(),Zoffset::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFramebufferTexture3D.xml">external</a> documentation.
--spec framebufferTexture3D(enum(),enum(),enum(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link framebufferTexture/4}
+-spec framebufferTexture3D(Target, Attachment, Textarget, Texture, Level, Zoffset) -> ok when Target :: enum(),Attachment :: enum(),Textarget :: enum(),Texture :: integer(),Level :: integer(),Zoffset :: integer().
framebufferTexture3D(Target,Attachment,Textarget,Texture,Level,Zoffset) ->
cast(5662, <<Target:?GLenum,Attachment:?GLenum,Textarget:?GLenum,Texture:?GLuint,Level:?GLint,Zoffset:?GLint>>).
-%% @spec (Target::enum(),Attachment::enum(),Renderbuffertarget::enum(),Renderbuffer::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFramebufferRenderbuffer.xml">external</a> documentation.
--spec framebufferRenderbuffer(enum(),enum(),enum(),integer()) -> ok.
+%% @doc Attach a renderbuffer as a logical buffer to the currently bound framebuffer object
+%%
+%% ``gl:framebufferRenderbuffer'' attaches a renderbuffer as one of the logical buffers
+%% of the currently bound framebuffer object. `Renderbuffer' is the name of the renderbuffer
+%% object to attach and must be either zero, or the name of an existing renderbuffer object
+%% of type `Renderbuffertarget' . If `Renderbuffer' is not zero and if ``gl:framebufferRenderbuffer''
+%% is successful, then the renderbuffer name `Renderbuffer' will be used as the logical
+%% buffer identified by `Attachment' of the framebuffer currently bound to `Target' .
+%%
+%%
+%% The value of `?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE' for the specified attachment
+%% point is set to `?GL_RENDERBUFFER' and the value of `?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME'
+%% is set to `Renderbuffer' . All other state values of the attachment point specified
+%% by `Attachment' are set to their default values. No change is made to the state of
+%% the renderbuuffer object and any previous attachment to the `Attachment' logical
+%% buffer of the framebuffer `Target' is broken.
+%%
+%% Calling ``gl:framebufferRenderbuffer'' with the renderbuffer name zero will detach
+%% the image, if any, identified by `Attachment' , in the framebuffer currently bound
+%% to `Target' . All state values of the attachment point specified by attachment in
+%% the object bound to target are set to their default values.
+%%
+%% Setting `Attachment' to the value `?GL_DEPTH_STENCIL_ATTACHMENT' is a special
+%% case causing both the depth and stencil attachments of the framebuffer object to be set
+%% to `Renderbuffer' , which should have the base internal format `?GL_DEPTH_STENCIL'
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFramebufferRenderbuffer.xml">external</a> documentation.
+-spec framebufferRenderbuffer(Target, Attachment, Renderbuffertarget, Renderbuffer) -> ok when Target :: enum(),Attachment :: enum(),Renderbuffertarget :: enum(),Renderbuffer :: integer().
framebufferRenderbuffer(Target,Attachment,Renderbuffertarget,Renderbuffer) ->
cast(5663, <<Target:?GLenum,Attachment:?GLenum,Renderbuffertarget:?GLenum,Renderbuffer:?GLuint>>).
-%% @spec (Target::enum(),Attachment::enum(),Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetFramebufferAttachmentParameter.xml">external</a> documentation.
--spec getFramebufferAttachmentParameteriv(enum(),enum(),enum()) -> integer().
+%% @doc Retrieve information about attachments of a bound framebuffer object
+%%
+%% ``gl:getFramebufferAttachmentParameter'' returns information about attachments of a
+%% bound framebuffer object. `Target' specifies the framebuffer binding point and must
+%% be `?GL_DRAW_FRAMEBUFFER', `?GL_READ_FRAMEBUFFER' or `?GL_FRAMEBUFFER'. `?GL_FRAMEBUFFER'
+%% is equivalent to `?GL_DRAW_FRAMEBUFFER'.
+%%
+%% If the default framebuffer is bound to `Target' then `Attachment' must be one
+%% of `?GL_FRONT_LEFT', `?GL_FRONT_RIGHT', `?GL_BACK_LEFT', or `?GL_BACK_RIGHT'
+%% , identifying a color buffer, `?GL_DEPTH', identifying the depth buffer, or `?GL_STENCIL'
+%% , identifying the stencil buffer.
+%%
+%% If a framebuffer object is bound, then `Attachment' must be one of `?GL_COLOR_ATTACHMENT'
+%% `i', `?GL_DEPTH_ATTACHMENT', `?GL_STENCIL_ATTACHMENT', or `?GL_DEPTH_STENCIL_ATTACHMENT'
+%% . `i' in `?GL_COLOR_ATTACHMENT'`i' must be in the range zero to the value
+%% of `?GL_MAX_COLOR_ATTACHMENTS' - 1.
+%%
+%% If `Attachment' is `?GL_DEPTH_STENCIL_ATTACHMENT' and different objects are
+%% bound to the depth and stencil attachment points of `Target' the query will fail.
+%% If the same object is bound to both attachment points, information about that object will
+%% be returned.
+%%
+%% Upon successful return from ``gl:getFramebufferAttachmentParameteriv'', if `Pname'
+%% is `?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE', then `Params' will contain one of `?GL_NONE'
+%% , `?GL_FRAMEBUFFER_DEFAULT', `?GL_TEXTURE', or `?GL_RENDERBUFFER', identifying
+%% the type of object which contains the attached image. Other values accepted for `Pname'
+%% depend on the type of object, as described below.
+%%
+%% If the value of `?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE' is `?GL_NONE', no
+%% framebuffer is bound to `Target' . In this case querying `Pname' `?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME'
+%% will return zero, and all other queries will generate an error.
+%%
+%% If the value of `?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE' is not `?GL_NONE',
+%% these queries apply to all other framebuffer types:
+%%
+%% If `Pname' is `?GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE', `?GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE'
+%% , `?GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE', `?GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE'
+%% , `?GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE', or `?GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE'
+%% , then `Params' will contain the number of bits in the corresponding red, green,
+%% blue, alpha, depth, or stencil component of the specified attachment. Zero is returned
+%% if the requested component is not present in `Attachment' .
+%%
+%% If `Pname' is `?GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE', `Params' will
+%% contain the format of components of the specified attachment, one of `?GL_FLOAT', `GL_INT'
+%% , `GL_UNSIGNED_INT' , `GL_SIGNED_NORMALIZED' , or `GL_UNSIGNED_NORMALIZED'
+%% for floating-point, signed integer, unsigned integer, signed normalized fixed-point, or
+%% unsigned normalized fixed-point components respectively. Only color buffers may have integer
+%% components.
+%%
+%% If `Pname' is `?GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING', `Param' will
+%% contain the encoding of components of the specified attachment, one of `?GL_LINEAR'
+%% or `?GL_SRGB' for linear or sRGB-encoded components, respectively. Only color buffer
+%% components may be sRGB-encoded; such components are treated as described in sections 4.1.7
+%% and 4.1.8. For the default framebuffer, color encoding is determined by the implementation.
+%% For framebuffer objects, components are sRGB-encoded if the internal format of a color
+%% attachment is one of the color-renderable SRGB formats.
+%%
+%% If the value of `?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE' is `?GL_RENDERBUFFER',
+%% then:
+%%
+%% If `Pname' is `?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME', `Params' will
+%% contain the name of the renderbuffer object which contains the attached image.
+%%
+%% If the value of `?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE' is `?GL_TEXTURE',
+%% then:
+%%
+%% If `Pname' is `?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME', then `Params'
+%% will contain the name of the texture object which contains the attached image.
+%%
+%% If `Pname' is `?GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL', then `Params'
+%% will contain the mipmap level of the texture object which contains the attached image.
+%%
+%% If `Pname' is `?GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE' and the texture
+%% object named `?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME' is a cube map texture, then `Params'
+%% will contain the cube map face of the cubemap texture object which contains the attached
+%% image. Otherwise `Params' will contain the value zero.
+%%
+%% If `Pname' is `?GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER' and the texture object
+%% named `?GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME' is a layer of a three-dimensional
+%% texture or a one-or two-dimensional array texture, then `Params' will contain the
+%% number of the texture layer which contains the attached image. Otherwise `Params'
+%% will contain the value zero.
+%%
+%% If `Pname' is `?GL_FRAMEBUFFER_ATTACHMENT_LAYERED', then `Params' will
+%% contain `?GL_TRUE' if an entire level of a three-dimesional texture, cube map texture,
+%% or one-or two-dimensional array texture is attached. Otherwise, `Params' will contain
+%% `?GL_FALSE'.
+%%
+%% Any combinations of framebuffer type and `Pname' not described above will generate
+%% an error.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetFramebufferAttachmentParameter.xml">external</a> documentation.
+-spec getFramebufferAttachmentParameteriv(Target, Attachment, Pname) -> integer() when Target :: enum(),Attachment :: enum(),Pname :: enum().
getFramebufferAttachmentParameteriv(Target,Attachment,Pname) ->
call(5664, <<Target:?GLenum,Attachment:?GLenum,Pname:?GLenum>>).
-%% @spec (Target::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenerateMipmap.xml">external</a> documentation.
--spec generateMipmap(enum()) -> ok.
+%% @doc Generate mipmaps for a specified texture target
+%%
+%% ``gl:generateMipmap'' generates mipmaps for the texture attached to `Target' of
+%% the active texture unit. For cube map textures, a `?GL_INVALID_OPERATION' error is
+%% generated if the texture attached to `Target' is not cube complete.
+%%
+%% Mipmap generation replaces texel array levels level base+1 through q with arrays derived
+%% from the level base array, regardless of their previous contents. All other mimap arrays,
+%% including the level base array, are left unchanged by this computation.
+%%
+%% The internal formats of the derived mipmap arrays all match those of the level base
+%% array. The contents of the derived arrays are computed by repeated, filtered reduction
+%% of the level base array. For one- and two-dimensional texture arrays, each layer is filtered
+%% independently.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenerateMipmap.xml">external</a> documentation.
+-spec generateMipmap(Target) -> ok when Target :: enum().
generateMipmap(Target) ->
cast(5665, <<Target:?GLenum>>).
-%% @spec (SrcX0::integer(),SrcY0::integer(),SrcX1::integer(),SrcY1::integer(),DstX0::integer(),DstY0::integer(),DstX1::integer(),DstY1::integer(),Mask::integer(),Filter::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlitFramebuffer.xml">external</a> documentation.
--spec blitFramebuffer(integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),enum()) -> ok.
+%% @doc Copy a block of pixels from the read framebuffer to the draw framebuffer
+%%
+%% ``gl:blitFramebuffer'' transfers a rectangle of pixel values from one region of the
+%% read framebuffer to another region in the draw framebuffer. `Mask' is the bitwise
+%% OR of a number of values indicating which buffers are to be copied. The values are `?GL_COLOR_BUFFER_BIT'
+%% , `?GL_DEPTH_BUFFER_BIT', and `?GL_STENCIL_BUFFER_BIT'. The pixels corresponding
+%% to these buffers are copied from the source rectangle bounded by the locations ( `SrcX0'
+%% ; `SrcY0' ) and ( `SrcX1' ; `SrcY1' ) to the destination rectangle bounded
+%% by the locations ( `DstX0' ; `DstY0' ) and ( `DstX1' ; `DstY1' ). The lower
+%% bounds of the rectangle are inclusive, while the upper bounds are exclusive.
+%%
+%% The actual region taken from the read framebuffer is limited to the intersection of the
+%% source buffers being transferred, which may include the color buffer selected by the read
+%% buffer, the depth buffer, and/or the stencil buffer depending on mask. The actual region
+%% written to the draw framebuffer is limited to the intersection of the destination buffers
+%% being written, which may include multiple draw buffers, the depth buffer, and/or the stencil
+%% buffer depending on mask. Whether or not the source or destination regions are altered
+%% due to these limits, the scaling and offset applied to pixels being transferred is performed
+%% as though no such limits were present.
+%%
+%% If the sizes of the source and destination rectangles are not equal, `Filter' specifies
+%% the interpolation method that will be applied to resize the source image , and must be `?GL_NEAREST'
+%% or `?GL_LINEAR'. `?GL_LINEAR' is only a valid interpolation method for the
+%% color buffer. If `Filter' is not `?GL_NEAREST' and `Mask' includes `?GL_DEPTH_BUFFER_BIT'
+%% or `?GL_STENCIL_BUFFER_BIT', no data is transferred and a `?GL_INVALID_OPERATION'
+%% error is generated.
+%%
+%% If `Filter' is `?GL_LINEAR' and the source rectangle would require sampling
+%% outside the bounds of the source framebuffer, values are read as if the `?GL_CLAMP_TO_EDGE'
+%% texture wrapping mode were applied.
+%%
+%% When the color buffer is transferred, values are taken from the read buffer of the read
+%% framebuffer and written to each of the draw buffers of the draw framebuffer.
+%%
+%% If the source and destination rectangles overlap or are the same, and the read and draw
+%% buffers are the same, the result of the operation is undefined.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBlitFramebuffer.xml">external</a> documentation.
+-spec blitFramebuffer(SrcX0, SrcY0, SrcX1, SrcY1, DstX0, DstY0, DstX1, DstY1, Mask, Filter) -> ok when SrcX0 :: integer(),SrcY0 :: integer(),SrcX1 :: integer(),SrcY1 :: integer(),DstX0 :: integer(),DstY0 :: integer(),DstX1 :: integer(),DstY1 :: integer(),Mask :: integer(),Filter :: enum().
blitFramebuffer(SrcX0,SrcY0,SrcX1,SrcY1,DstX0,DstY0,DstX1,DstY1,Mask,Filter) ->
cast(5666, <<SrcX0:?GLint,SrcY0:?GLint,SrcX1:?GLint,SrcY1:?GLint,DstX0:?GLint,DstY0:?GLint,DstX1:?GLint,DstY1:?GLint,Mask:?GLbitfield,Filter:?GLenum>>).
-%% @spec (Target::enum(),Samples::integer(),Internalformat::enum(),Width::integer(),Height::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRenderbufferStorageMultisample.xml">external</a> documentation.
--spec renderbufferStorageMultisample(enum(),integer(),enum(),integer(),integer()) -> ok.
+%% @doc Establish data storage, format, dimensions and sample count of a renderbuffer object's image
+%%
+%% ``gl:renderbufferStorageMultisample'' establishes the data storage, format, dimensions
+%% and number of samples of a renderbuffer object's image.
+%%
+%% The target of the operation, specified by `Target' must be `?GL_RENDERBUFFER'.
+%% `Internalformat' specifies the internal format to be used for the renderbuffer object's
+%% storage and must be a color-renderable, depth-renderable, or stencil-renderable format. `Width'
+%% and `Height' are the dimensions, in pixels, of the renderbuffer. Both `Width'
+%% and `Height' must be less than or equal to the value of `?GL_MAX_RENDERBUFFER_SIZE'
+%% . `Samples' specifies the number of samples to be used for the renderbuffer object's
+%% image, and must be less than or equal to the value of `?GL_MAX_SAMPLES'. If `Internalformat'
+%% is a signed or unsigned integer format then `Samples' must be less than or equal
+%% to the value of `?GL_MAX_INTEGER_SAMPLES'.
+%%
+%% Upon success, ``gl:renderbufferStorageMultisample'' deletes any existing data store
+%% for the renderbuffer image and the contents of the data store after calling ``gl:renderbufferStorageMultisample''
+%% are undefined.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glRenderbufferStorageMultisample.xml">external</a> documentation.
+-spec renderbufferStorageMultisample(Target, Samples, Internalformat, Width, Height) -> ok when Target :: enum(),Samples :: integer(),Internalformat :: enum(),Width :: integer(),Height :: integer().
renderbufferStorageMultisample(Target,Samples,Internalformat,Width,Height) ->
cast(5667, <<Target:?GLenum,Samples:?GLsizei,Internalformat:?GLenum,Width:?GLsizei,Height:?GLsizei>>).
-%% @spec (Target::enum(),Attachment::enum(),Texture::integer(),Level::integer(),Layer::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFramebufferTextureLayer.xml">external</a> documentation.
--spec framebufferTextureLayer(enum(),enum(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link framebufferTexture/4}
+-spec framebufferTextureLayer(Target, Attachment, Texture, Level, Layer) -> ok when Target :: enum(),Attachment :: enum(),Texture :: integer(),Level :: integer(),Layer :: integer().
framebufferTextureLayer(Target,Attachment,Texture,Level,Layer) ->
cast(5668, <<Target:?GLenum,Attachment:?GLenum,Texture:?GLuint,Level:?GLint,Layer:?GLint>>).
-%% @spec (Target::enum(),Attachment::enum(),Texture::integer(),Level::integer(),Face::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFramebufferTextureFaceARB.xml">external</a> documentation.
--spec framebufferTextureFaceARB(enum(),enum(),integer(),integer(),enum()) -> ok.
+%% @doc
+%% See {@link framebufferTexture/4}
+-spec framebufferTextureFaceARB(Target, Attachment, Texture, Level, Face) -> ok when Target :: enum(),Attachment :: enum(),Texture :: integer(),Level :: integer(),Face :: enum().
framebufferTextureFaceARB(Target,Attachment,Texture,Level,Face) ->
cast(5669, <<Target:?GLenum,Attachment:?GLenum,Texture:?GLuint,Level:?GLint,Face:?GLenum>>).
-%% @spec (Target::enum(),Offset::integer(),Length::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFlushMappedBufferRange.xml">external</a> documentation.
--spec flushMappedBufferRange(enum(),integer(),integer()) -> ok.
+%% @doc Indicate modifications to a range of a mapped buffer
+%%
+%% ``gl:flushMappedBufferRange'' indicates that modifications have been made to a range
+%% of a mapped buffer. The buffer must previously have been mapped with the `?GL_MAP_FLUSH_EXPLICIT'
+%% flag. `Offset' and `Length' indicate the modified subrange of the mapping,
+%% in basic units. The specified subrange to flush is relative to the start of the currently
+%% mapped range of the buffer. ``gl:flushMappedBufferRange'' may be called multiple times
+%% to indicate distinct subranges of the mapping which require flushing.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFlushMappedBufferRange.xml">external</a> documentation.
+-spec flushMappedBufferRange(Target, Offset, Length) -> ok when Target :: enum(),Offset :: integer(),Length :: integer().
flushMappedBufferRange(Target,Offset,Length) ->
cast(5670, <<Target:?GLenum,0:32,Offset:?GLintptr,Length:?GLsizeiptr>>).
-%% @spec (Array::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindVertexArray.xml">external</a> documentation.
--spec bindVertexArray(integer()) -> ok.
+%% @doc Bind a vertex array object
+%%
+%% ``gl:bindVertexArray'' binds the vertex array object with name `Array' . `Array'
+%% is the name of a vertex array object previously returned from a call to {@link gl:genVertexArrays/1}
+%% , or zero to break the existing vertex array object binding.
+%%
+%% If no vertex array object with name `Array' exists, one is created when `Array'
+%% is first bound. If the bind is successful no change is made to the state of the vertex
+%% array object, and any previous vertex array object binding is broken.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindVertexArray.xml">external</a> documentation.
+-spec bindVertexArray(Array) -> ok when Array :: integer().
bindVertexArray(Array) ->
cast(5671, <<Array:?GLuint>>).
-%% @spec (Arrays::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteVertexArrays.xml">external</a> documentation.
--spec deleteVertexArrays([integer()]) -> ok.
+%% @doc Delete vertex array objects
+%%
+%% ``gl:deleteVertexArrays'' deletes `N' vertex array objects whose names are stored
+%% in the array addressed by `Arrays' . Once a vertex array object is deleted it has
+%% no contents and its name is again unused. If a vertex array object that is currently bound
+%% is deleted, the binding for that object reverts to zero and the default vertex array becomes
+%% current. Unused names in `Arrays' are silently ignored, as is the value zero.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteVertexArrays.xml">external</a> documentation.
+-spec deleteVertexArrays(Arrays) -> ok when Arrays :: [integer()].
deleteVertexArrays(Arrays) ->
cast(5672, <<(length(Arrays)):?GLuint,
(<< <<C:?GLuint>> || C <- Arrays>>)/binary,0:(((1+length(Arrays)) rem 2)*32)>>).
-%% @spec (N::integer()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenVertexArrays.xml">external</a> documentation.
--spec genVertexArrays(integer()) -> [integer()].
+%% @doc Generate vertex array object names
+%%
+%% ``gl:genVertexArrays'' returns `N' vertex array object names in `Arrays' .
+%% There is no guarantee that the names form a contiguous set of integers; however, it is
+%% guaranteed that none of the returned names was in use immediately before the call to ``gl:genVertexArrays''
+%% .
+%%
+%% Vertex array object names returned by a call to ``gl:genVertexArrays'' are not returned
+%% by subsequent calls, unless they are first deleted with {@link gl:deleteVertexArrays/1} .
+%%
+%% The names returned in `Arrays' are marked as used, for the purposes of ``gl:genVertexArrays''
+%% only, but they acquire state and type only when they are first bound.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenVertexArrays.xml">external</a> documentation.
+-spec genVertexArrays(N) -> [integer()] when N :: integer().
genVertexArrays(N) ->
call(5673, <<N:?GLsizei>>).
-%% @spec (Array::integer()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsVertexArray.xml">external</a> documentation.
--spec isVertexArray(integer()) -> 0|1.
+%% @doc Determine if a name corresponds to a vertex array object
+%%
+%% ``gl:isVertexArray'' returns `?GL_TRUE' if `Array' is currently the name of
+%% a renderbuffer object. If `Renderbuffer' is zero, or if `Array' is not the name
+%% of a renderbuffer object, or if an error occurs, ``gl:isVertexArray'' returns `?GL_FALSE'
+%% . If `Array' is a name returned by {@link gl:genVertexArrays/1} , by that has not yet
+%% been bound through a call to {@link gl:bindVertexArray/1} , then the name is not a vertex
+%% array object and ``gl:isVertexArray'' returns `?GL_FALSE'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsVertexArray.xml">external</a> documentation.
+-spec isVertexArray(Array) -> 0|1 when Array :: integer().
isVertexArray(Array) ->
call(5674, <<Array:?GLuint>>).
-%% @spec (Program::integer(),UniformNames::[string()]) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformIndices.xml">external</a> documentation.
--spec getUniformIndices(integer(),[string()]) -> [integer()].
+%% @doc Retrieve the index of a named uniform block
+%%
+%% ``gl:getUniformIndices'' retrieves the indices of a number of uniforms within `Program'
+%% .
+%%
+%% `Program' must be the name of a program object for which the command {@link gl:linkProgram/1}
+%% must have been called in the past, although it is not required that {@link gl:linkProgram/1}
+%% must have succeeded. The link could have failed because the number of active uniforms
+%% exceeded the limit.
+%%
+%% `UniformCount' indicates both the number of elements in the array of names `UniformNames'
+%% and the number of indices that may be written to `UniformIndices' .
+%%
+%% `UniformNames' contains a list of `UniformCount' name strings identifying the
+%% uniform names to be queried for indices. For each name string in `UniformNames' ,
+%% the index assigned to the active uniform of that name will be written to the corresponding
+%% element of `UniformIndices' . If a string in `UniformNames' is not the name of
+%% an active uniform, the special value `?GL_INVALID_INDEX' will be written to the corresponding
+%% element of `UniformIndices' .
+%%
+%% If an error occurs, nothing is written to `UniformIndices' .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformIndices.xml">external</a> documentation.
+-spec getUniformIndices(Program, UniformNames) -> [integer()] when Program :: integer(),UniformNames :: [string()].
getUniformIndices(Program,UniformNames) ->
UniformNamesTemp = list_to_binary([[Str|[0]] || Str <- UniformNames ]),
call(5675, <<Program:?GLuint,(length(UniformNames)):?GLuint,(size(UniformNamesTemp)):?GLuint,(UniformNamesTemp)/binary,0:((8-((size(UniformNamesTemp)+0) rem 8)) rem 8)>>).
-%% @spec (Program::integer(),UniformIndices::[integer()],Pname::enum()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveUniforms.xml">external</a> documentation.
--spec getActiveUniformsiv(integer(),[integer()],enum()) -> [integer()].
+%% @doc glGetActiveUniforms
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveUniforms.xml">external</a> documentation.
+-spec getActiveUniformsiv(Program, UniformIndices, Pname) -> [integer()] when Program :: integer(),UniformIndices :: [integer()],Pname :: enum().
getActiveUniformsiv(Program,UniformIndices,Pname) ->
call(5676, <<Program:?GLuint,(length(UniformIndices)):?GLuint,
(<< <<C:?GLuint>> || C <- UniformIndices>>)/binary,0:(((length(UniformIndices)) rem 2)*32),Pname:?GLenum>>).
-%% @spec (Program::integer(),UniformIndex::integer(),BufSize::integer()) -> string()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveUniformName.xml">external</a> documentation.
--spec getActiveUniformName(integer(),integer(),integer()) -> string().
+%% @doc Query the name of an active uniform
+%%
+%% ``gl:getActiveUniformName'' returns the name of the active uniform at `UniformIndex'
+%% within `Program' . If `UniformName' is not NULL, up to `BufSize' characters
+%% (including a nul-terminator) will be written into the array whose address is specified
+%% by `UniformName' . If `Length' is not NULL, the number of characters that were
+%% (or would have been) written into `UniformName' (not including the nul-terminator)
+%% will be placed in the variable whose address is specified in `Length' . If `Length'
+%% is NULL, no length is returned. The length of the longest uniform name in `Program'
+%% is given by the value of `?GL_ACTIVE_UNIFORM_MAX_LENGTH', which can be queried with {@link gl:getProgramiv/2}
+%% .
+%%
+%% If ``gl:getActiveUniformName'' is not successful, nothing is written to `Length'
+%% or `UniformName' .
+%%
+%% `Program' must be the name of a program for which the command {@link gl:linkProgram/1}
+%% has been issued in the past. It is not necessary for `Program' to have been linked
+%% successfully. The link could have failed because the number of active uniforms exceeded
+%% the limit.
+%%
+%% `UniformIndex' must be an active uniform index of the program `Program' , in
+%% the range zero to `?GL_ACTIVE_UNIFORMS' - 1. The value of `?GL_ACTIVE_UNIFORMS'
+%% can be queried with {@link gl:getProgramiv/2} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveUniformName.xml">external</a> documentation.
+-spec getActiveUniformName(Program, UniformIndex, BufSize) -> string() when Program :: integer(),UniformIndex :: integer(),BufSize :: integer().
getActiveUniformName(Program,UniformIndex,BufSize) ->
call(5677, <<Program:?GLuint,UniformIndex:?GLuint,BufSize:?GLsizei>>).
-%% @spec (Program::integer(),UniformBlockName::string()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformBlockIndex.xml">external</a> documentation.
--spec getUniformBlockIndex(integer(),string()) -> integer().
+%% @doc Retrieve the index of a named uniform block
+%%
+%% ``gl:getUniformBlockIndex'' retrieves the index of a uniform block within `Program' .
+%%
+%%
+%% `Program' must be the name of a program object for which the command {@link gl:linkProgram/1}
+%% must have been called in the past, although it is not required that {@link gl:linkProgram/1}
+%% must have succeeded. The link could have failed because the number of active uniforms
+%% exceeded the limit.
+%%
+%% `UniformBlockName' must contain a nul-terminated string specifying the name of the
+%% uniform block.
+%%
+%% ``gl:getUniformBlockIndex'' returns the uniform block index for the uniform block named
+%% `UniformBlockName' of `Program' . If `UniformBlockName' does not identify
+%% an active uniform block of `Program' , ``gl:getUniformBlockIndex'' returns the special
+%% identifier, `?GL_INVALID_INDEX'. Indices of the active uniform blocks of a program
+%% are assigned in consecutive order, beginning with zero.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformBlockIndex.xml">external</a> documentation.
+-spec getUniformBlockIndex(Program, UniformBlockName) -> integer() when Program :: integer(),UniformBlockName :: string().
getUniformBlockIndex(Program,UniformBlockName) ->
call(5678, <<Program:?GLuint,(list_to_binary([UniformBlockName|[0]]))/binary,0:((8-((length(UniformBlockName)+ 5) rem 8)) rem 8)>>).
-%% @spec (Program::integer(),UniformBlockIndex::integer(),Pname::enum(),Params::mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveUniformBlock.xml">external</a> documentation.
--spec getActiveUniformBlockiv(integer(),integer(),enum(),mem()) -> ok.
+%% @doc Query information about an active uniform block
+%%
+%% ``gl:getActiveUniformBlockiv'' retrieves information about an active uniform block within
+%% `Program' .
+%%
+%% `Program' must be the name of a program object for which the command {@link gl:linkProgram/1}
+%% must have been called in the past, although it is not required that {@link gl:linkProgram/1}
+%% must have succeeded. The link could have failed because the number of active uniforms
+%% exceeded the limit.
+%%
+%% `UniformBlockIndex' is an active uniform block index of `Program' , and must
+%% be less than the value of `?GL_ACTIVE_UNIFORM_BLOCKS'.
+%%
+%% Upon success, the uniform block parameter(s) specified by `Pname' are returned in `Params'
+%% . If an error occurs, nothing will be written to `Params' .
+%%
+%% If `Pname' is `?GL_UNIFORM_BLOCK_BINDING', then the index of the uniform buffer
+%% binding point last selected by the uniform block specified by `UniformBlockIndex'
+%% for `Program' is returned. If no uniform block has been previously specified, zero
+%% is returned.
+%%
+%% If `Pname' is `?GL_UNIFORM_BLOCK_DATA_SIZE', then the implementation-dependent
+%% minimum total buffer object size, in basic machine units, required to hold all active
+%% uniforms in the uniform block identified by `UniformBlockIndex' is returned. It is
+%% neither guaranteed nor expected that a given implementation will arrange uniform values
+%% as tightly packed in a buffer object. The exception to this is the `std140 uniform block layout'
+%% , which guarantees specific packing behavior and does not require the application to query
+%% for offsets and strides. In this case the minimum size may still be queried, even though
+%% it is determined in advance based only on the uniform block declaration.
+%%
+%% If `Pname' is `?GL_UNIFORM_BLOCK_NAME_LENGTH', then the total length (including
+%% the nul terminator) of the name of the uniform block identified by `UniformBlockIndex'
+%% is returned.
+%%
+%% If `Pname' is `?GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS', then the number of active
+%% uniforms in the uniform block identified by `UniformBlockIndex' is returned.
+%%
+%% If `Pname' is `?GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES', then a list of the
+%% active uniform indices for the uniform block identified by `UniformBlockIndex' is
+%% returned. The number of elements that will be written to `Params' is the value of `?GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS'
+%% for `UniformBlockIndex' .
+%%
+%% If `Pname' is `?GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER', `?GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER'
+%% , or `?GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER', then a boolean value indicating
+%% whether the uniform block identified by `UniformBlockIndex' is referenced by the
+%% vertex, geometry, or fragment programming stages of program, respectively, is returned.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveUniformBlock.xml">external</a> documentation.
+-spec getActiveUniformBlockiv(Program, UniformBlockIndex, Pname, Params) -> ok when Program :: integer(),UniformBlockIndex :: integer(),Pname :: enum(),Params :: mem().
getActiveUniformBlockiv(Program,UniformBlockIndex,Pname,Params) ->
send_bin(Params),
call(5679, <<Program:?GLuint,UniformBlockIndex:?GLuint,Pname:?GLenum>>).
-%% @spec (Program::integer(),UniformBlockIndex::integer(),BufSize::integer()) -> string()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveUniformBlockName.xml">external</a> documentation.
--spec getActiveUniformBlockName(integer(),integer(),integer()) -> string().
+%% @doc Retrieve the name of an active uniform block
+%%
+%% ``gl:getActiveUniformBlockName'' retrieves the name of the active uniform block at `UniformBlockIndex'
+%% within `Program' .
+%%
+%% `Program' must be the name of a program object for which the command {@link gl:linkProgram/1}
+%% must have been called in the past, although it is not required that {@link gl:linkProgram/1}
+%% must have succeeded. The link could have failed because the number of active uniforms
+%% exceeded the limit.
+%%
+%% `UniformBlockIndex' is an active uniform block index of `Program' , and must
+%% be less than the value of `?GL_ACTIVE_UNIFORM_BLOCKS'.
+%%
+%% Upon success, the name of the uniform block identified by `UnifomBlockIndex' is
+%% returned into `UniformBlockName' . The name is nul-terminated. The actual number of
+%% characters written into `UniformBlockName' , excluding the nul terminator, is returned
+%% in `Length' . If `Length' is NULL, no length is returned.
+%%
+%% `BufSize' contains the maximum number of characters (including the nul terminator)
+%% that will be written into `UniformBlockName' .
+%%
+%% If an error occurs, nothing will be written to `UniformBlockName' or `Length' .
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveUniformBlockName.xml">external</a> documentation.
+-spec getActiveUniformBlockName(Program, UniformBlockIndex, BufSize) -> string() when Program :: integer(),UniformBlockIndex :: integer(),BufSize :: integer().
getActiveUniformBlockName(Program,UniformBlockIndex,BufSize) ->
call(5680, <<Program:?GLuint,UniformBlockIndex:?GLuint,BufSize:?GLsizei>>).
-%% @spec (Program::integer(),UniformBlockIndex::integer(),UniformBlockBinding::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformBlockBinding.xml">external</a> documentation.
--spec uniformBlockBinding(integer(),integer(),integer()) -> ok.
+%% @doc Assign a binding point to an active uniform block
+%%
+%% Binding points for active uniform blocks are assigned using ``gl:uniformBlockBinding''.
+%% Each of a program's active uniform blocks has a corresponding uniform buffer binding point.
+%% `Program' is the name of a program object for which the command {@link gl:linkProgram/1}
+%% has been issued in the past.
+%%
+%% If successful, ``gl:uniformBlockBinding'' specifies that `Program' will use the
+%% data store of the buffer object bound to the binding point `UniformBlockBinding'
+%% to extract the values of the uniforms in the uniform block identified by `UniformBlockIndex'
+%% .
+%%
+%% When a program object is linked or re-linked, the uniform buffer object binding point
+%% assigned to each of its active uniform blocks is reset to zero.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformBlockBinding.xml">external</a> documentation.
+-spec uniformBlockBinding(Program, UniformBlockIndex, UniformBlockBinding) -> ok when Program :: integer(),UniformBlockIndex :: integer(),UniformBlockBinding :: integer().
uniformBlockBinding(Program,UniformBlockIndex,UniformBlockBinding) ->
cast(5681, <<Program:?GLuint,UniformBlockIndex:?GLuint,UniformBlockBinding:?GLuint>>).
-%% @spec (ReadTarget::enum(),WriteTarget::enum(),ReadOffset::integer(),WriteOffset::integer(),Size::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyBufferSubData.xml">external</a> documentation.
--spec copyBufferSubData(enum(),enum(),integer(),integer(),integer()) -> ok.
+%% @doc Copy part of the data store of a buffer object to the data store of another buffer object
+%%
+%% ``gl:copyBufferSubData'' copies part of the data store attached to `Readtarget'
+%% to the data store attached to `Writetarget' . The number of basic machine units indicated
+%% by `Size' is copied from the source, at offset `Readoffset' to the destination
+%% at `Writeoffset' , also in basic machine units.
+%%
+%% `Readtarget' and `Writetarget' must be `?GL_ARRAY_BUFFER', `?GL_COPY_READ_BUFFER'
+%% , `?GL_COPY_WRITE_BUFFER', `?GL_ELEMENT_ARRAY_BUFFER', `?GL_PIXEL_PACK_BUFFER'
+%% , `?GL_PIXEL_UNPACK_BUFFER', `?GL_TEXTURE_BUFFER', `?GL_TRANSFORM_FEEDBACK_BUFFER'
+%% or `?GL_UNIFORM_BUFFER'. Any of these targets may be used, although the targets `?GL_COPY_READ_BUFFER'
+%% and `?GL_COPY_WRITE_BUFFER' are provided specifically to allow copies between buffers
+%% without disturbing other GL state.
+%%
+%% `Readoffset' , `Writeoffset' and `Size' must all be greater than or equal
+%% to zero. Furthermore, `Readoffset' + `Size' must not exceeed the size of the
+%% buffer object bound to `Readtarget' , and `Readoffset' + `Size' must not
+%% exceeed the size of the buffer bound to `Writetarget' . If the same buffer object
+%% is bound to both `Readtarget' and `Writetarget' , then the ranges specified by `Readoffset'
+%% , `Writeoffset' and `Size' must not overlap.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCopyBufferSubData.xml">external</a> documentation.
+-spec copyBufferSubData(ReadTarget, WriteTarget, ReadOffset, WriteOffset, Size) -> ok when ReadTarget :: enum(),WriteTarget :: enum(),ReadOffset :: integer(),WriteOffset :: integer(),Size :: integer().
copyBufferSubData(ReadTarget,WriteTarget,ReadOffset,WriteOffset,Size) ->
cast(5682, <<ReadTarget:?GLenum,WriteTarget:?GLenum,ReadOffset:?GLintptr,WriteOffset:?GLintptr,Size:?GLsizeiptr>>).
-%% @spec (Mode::enum(),Count::integer(),Type::enum(),Indices::offset()|mem(),Basevertex::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawElementsBaseVertex.xml">external</a> documentation.
--spec drawElementsBaseVertex(enum(),integer(),enum(),offset()|mem(),integer()) -> ok.
+%% @doc Render primitives from array data with a per-element offset
+%%
+%% ``gl:drawElementsBaseVertex'' behaves identically to {@link gl:drawElements/4} except
+%% that the `i'th element transferred by the corresponding draw call will be taken from
+%% element `Indices' [i] + `Basevertex' of each enabled array. If the resulting
+%% value is larger than the maximum value representable by `Type' , it is as if the calculation
+%% were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The
+%% operation is undefined if the sum would be negative.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawElementsBaseVertex.xml">external</a> documentation.
+-spec drawElementsBaseVertex(Mode, Count, Type, Indices, Basevertex) -> ok when Mode :: enum(),Count :: integer(),Type :: enum(),Indices :: offset()|mem(),Basevertex :: integer().
drawElementsBaseVertex(Mode,Count,Type,Indices,Basevertex) when is_integer(Indices) ->
cast(5683, <<Mode:?GLenum,Count:?GLsizei,Type:?GLenum,Indices:?GLuint,Basevertex:?GLint>>);
drawElementsBaseVertex(Mode,Count,Type,Indices,Basevertex) ->
send_bin(Indices),
cast(5684, <<Mode:?GLenum,Count:?GLsizei,Type:?GLenum,Basevertex:?GLint>>).
-%% @spec (Mode::enum(),Start::integer(),End::integer(),Count::integer(),Type::enum(),Indices::offset()|mem(),Basevertex::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawRangeElementsBaseVertex.xml">external</a> documentation.
--spec drawRangeElementsBaseVertex(enum(),integer(),integer(),integer(),enum(),offset()|mem(),integer()) -> ok.
+%% @doc Render primitives from array data with a per-element offset
+%%
+%% ``gl:drawRangeElementsBaseVertex'' is a restricted form of {@link gl:drawElementsBaseVertex/5}
+%% . `Mode' , `Start' , `End' , `Count' and `Basevertex' match the
+%% corresponding arguments to {@link gl:drawElementsBaseVertex/5} , with the additional constraint
+%% that all values in the array `Indices' must lie between `Start' and `End' ,
+%% inclusive, prior to adding `Basevertex' . Index values lying outside the range [ `Start'
+%% , `End' ] are treated in the same way as {@link gl:drawElementsBaseVertex/5} . The `i'
+%% th element transferred by the corresponding draw call will be taken from element `Indices'
+%% [i] + `Basevertex' of each enabled array. If the resulting value is larger than the
+%% maximum value representable by `Type' , it is as if the calculation were upconverted
+%% to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined
+%% if the sum would be negative.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawRangeElementsBaseVertex.xml">external</a> documentation.
+-spec drawRangeElementsBaseVertex(Mode, Start, End, Count, Type, Indices, Basevertex) -> ok when Mode :: enum(),Start :: integer(),End :: integer(),Count :: integer(),Type :: enum(),Indices :: offset()|mem(),Basevertex :: integer().
drawRangeElementsBaseVertex(Mode,Start,End,Count,Type,Indices,Basevertex) when is_integer(Indices) ->
cast(5685, <<Mode:?GLenum,Start:?GLuint,End:?GLuint,Count:?GLsizei,Type:?GLenum,Indices:?GLuint,Basevertex:?GLint>>);
drawRangeElementsBaseVertex(Mode,Start,End,Count,Type,Indices,Basevertex) ->
send_bin(Indices),
cast(5686, <<Mode:?GLenum,Start:?GLuint,End:?GLuint,Count:?GLsizei,Type:?GLenum,Basevertex:?GLint>>).
-%% @spec (Mode::enum(),Count::integer(),Type::enum(),Indices::offset()|mem(),Primcount::integer(),Basevertex::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawElementsInstancedBaseVertex.xml">external</a> documentation.
--spec drawElementsInstancedBaseVertex(enum(),integer(),enum(),offset()|mem(),integer(),integer()) -> ok.
+%% @doc Render multiple instances of a set of primitives from array data with a per-element offset
+%%
+%% ``gl:drawElementsInstancedBaseVertex'' behaves identically to {@link gl:drawElementsInstanced/5}
+%% except that the `i'th element transferred by the corresponding draw call will be
+%% taken from element `Indices' [i] + `Basevertex' of each enabled array. If the
+%% resulting value is larger than the maximum value representable by `Type' , it is as
+%% if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow
+%% conditions). The operation is undefined if the sum would be negative.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawElementsInstancedBaseVertex.xml">external</a> documentation.
+-spec drawElementsInstancedBaseVertex(Mode, Count, Type, Indices, Primcount, Basevertex) -> ok when Mode :: enum(),Count :: integer(),Type :: enum(),Indices :: offset()|mem(),Primcount :: integer(),Basevertex :: integer().
drawElementsInstancedBaseVertex(Mode,Count,Type,Indices,Primcount,Basevertex) when is_integer(Indices) ->
cast(5687, <<Mode:?GLenum,Count:?GLsizei,Type:?GLenum,Indices:?GLuint,Primcount:?GLsizei,Basevertex:?GLint>>);
drawElementsInstancedBaseVertex(Mode,Count,Type,Indices,Primcount,Basevertex) ->
send_bin(Indices),
cast(5688, <<Mode:?GLenum,Count:?GLsizei,Type:?GLenum,Primcount:?GLsizei,Basevertex:?GLint>>).
-%% @spec (Mode::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProvokingVertex.xml">external</a> documentation.
--spec provokingVertex(enum()) -> ok.
+%% @doc Specifiy the vertex to be used as the source of data for flat shaded varyings
+%%
+%% `Flatshading' a vertex shader varying output means to assign all vetices of the primitive
+%% the same value for that output. The vertex from which these values is derived is known
+%% as the `provoking vertex' and ``gl:provokingVertex'' specifies which vertex is
+%% to be used as the source of data for flat shaded varyings.
+%%
+%% `ProvokeMode' must be either `?GL_FIRST_VERTEX_CONVENTION' or `?GL_LAST_VERTEX_CONVENTION'
+%% , and controls the selection of the vertex whose values are assigned to flatshaded varying
+%% outputs. The interpretation of these values for the supported primitive types is: <table><tbody>
+%% <tr><td>` Primitive Type of Polygon '`i'</td><td>` First Vertex Convention '
+%% </td><td>` Last Vertex Convention '</td></tr><tr><td> point </td><td>`i'</td><td>
+%% `i'</td></tr><tr><td> independent line </td><td> 2`i' - 1 </td><td> 2`i'</td>
+%% </tr><tr><td> line loop </td><td>`i'</td><td>
+%%
+%% `i' + 1, if `i' &lt; `n'
+%%
+%% 1, if `i' = `n'</td></tr><tr><td> line strip </td><td>`i'</td><td>`i'
+%% + 1 </td></tr><tr><td> independent triangle </td><td> 3`i' - 2 </td><td> 3`i'</td>
+%% </tr><tr><td> triangle strip </td><td>`i'</td><td>`i' + 2 </td></tr><tr><td>
+%% triangle fan </td><td>`i' + 1 </td><td>`i' + 2 </td></tr><tr><td> line adjacency
+%% </td><td> 4`i' - 2 </td><td> 4`i' - 1 </td></tr><tr><td> line strip adjacency </td>
+%% <td>`i' + 1 </td><td>`i' + 2 </td></tr><tr><td> triangle adjacency </td><td> 6`i'
+%% - 5 </td><td> 6`i' - 1 </td></tr><tr><td> triangle strip adjacency </td><td> 2`i'
+%% - 1 </td><td> 2`i' + 3 </td></tr></tbody></table>
+%%
+%% If a vertex or geometry shader is active, user-defined varying outputs may be flatshaded
+%% by using the flat qualifier when declaring the output.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProvokingVertex.xml">external</a> documentation.
+-spec provokingVertex(Mode) -> ok when Mode :: enum().
provokingVertex(Mode) ->
cast(5689, <<Mode:?GLenum>>).
-%% @spec (Condition::enum(),Flags::integer()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFenceSync.xml">external</a> documentation.
--spec fenceSync(enum(),integer()) -> integer().
+%% @doc Create a new sync object and insert it into the GL command stream
+%%
+%% ``gl:fenceSync'' creates a new fence sync object, inserts a fence command into the GL
+%% command stream and associates it with that sync object, and returns a non-zero name corresponding
+%% to the sync object.
+%%
+%% When the specified `Condition' of the sync object is satisfied by the fence command,
+%% the sync object is signaled by the GL, causing any {@link gl:waitSync/3} , {@link gl:clientWaitSync/3}
+%% commands blocking in `Sync' to `unblock'. No other state is affected by ``gl:fenceSync''
+%% or by the execution of the associated fence command.
+%%
+%% `Condition' must be `?GL_SYNC_GPU_COMMANDS_COMPLETE'. This condition is satisfied
+%% by completion of the fence command corresponding to the sync object and all preceding
+%% commands in the same command stream. The sync object will not be signaled until all effects
+%% from these commands on GL client and server state and the framebuffer are fully realized.
+%% Note that completion of the fence command occurs once the state of the corresponding sync
+%% object has been changed, but commands waiting on that sync object may not be unblocked
+%% until after the fence command completes.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glFenceSync.xml">external</a> documentation.
+-spec fenceSync(Condition, Flags) -> integer() when Condition :: enum(),Flags :: integer().
fenceSync(Condition,Flags) ->
call(5690, <<Condition:?GLenum,Flags:?GLbitfield>>).
-%% @spec (Sync::integer()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsSync.xml">external</a> documentation.
--spec isSync(integer()) -> 0|1.
+%% @doc Determine if a name corresponds to a sync object
+%%
+%% ``gl:isSync'' returns `?GL_TRUE' if `Sync' is currently the name of a sync
+%% object. If `Sync' is not the name of a sync object, or if an error occurs, ``gl:isSync''
+%% returns `?GL_FALSE'. Note that zero is not the name of a sync object.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsSync.xml">external</a> documentation.
+-spec isSync(Sync) -> 0|1 when Sync :: integer().
isSync(Sync) ->
call(5691, <<Sync:?GLsync>>).
-%% @spec (Sync::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteSync.xml">external</a> documentation.
--spec deleteSync(integer()) -> ok.
+%% @doc Delete a sync object
+%%
+%% ``gl:deleteSync'' deletes the sync object specified by `Sync' . If the fence command
+%% corresponding to the specified sync object has completed, or if no {@link gl:waitSync/3}
+%% or {@link gl:clientWaitSync/3} commands are blocking on `Sync' , the object is deleted
+%% immediately. Otherwise, `Sync' is flagged for deletion and will be deleted when it
+%% is no longer associated with any fence command and is no longer blocking any {@link gl:waitSync/3}
+%% or {@link gl:clientWaitSync/3} command. In either case, after ``gl:deleteSync'' returns,
+%% the name `Sync' is invalid and can no longer be used to refer to the sync object.
+%%
+%% ``gl:deleteSync'' will silently ignore a `Sync' value of zero.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteSync.xml">external</a> documentation.
+-spec deleteSync(Sync) -> ok when Sync :: integer().
deleteSync(Sync) ->
cast(5692, <<Sync:?GLsync>>).
-%% @spec (Sync::integer(),Flags::integer(),Timeout::integer()) -> enum()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClientWaitSync.xml">external</a> documentation.
--spec clientWaitSync(integer(),integer(),integer()) -> enum().
+%% @doc Block and wait for a sync object to become signaled
+%%
+%% ``gl:clientWaitSync'' causes the client to block and wait for the sync object specified
+%% by `Sync' to become signaled. If `Sync' is signaled when ``gl:clientWaitSync''
+%% is called, ``gl:clientWaitSync'' returns immediately, otherwise it will block and wait
+%% for up to `Timeout' nanoseconds for `Sync' to become signaled.
+%%
+%% The return value is one of four status values:
+%%
+%% `?GL_ALREADY_SIGNALED' indicates that `Sync' was signaled at the time that ``gl:clientWaitSync''
+%% was called.
+%%
+%% `?GL_TIMEOUT_EXPIRED' indicates that at least `Timeout' nanoseconds passed and `Sync'
+%% did not become signaled.
+%%
+%% `?GL_CONDITION_SATISFIED' indicates that `Sync' was signaled before the timeout
+%% expired.
+%%
+%% `?GL_WAIT_FAILED' indicates that an error occurred. Additionally, an OpenGL error
+%% will be generated.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClientWaitSync.xml">external</a> documentation.
+-spec clientWaitSync(Sync, Flags, Timeout) -> enum() when Sync :: integer(),Flags :: integer(),Timeout :: integer().
clientWaitSync(Sync,Flags,Timeout) ->
call(5693, <<Sync:?GLsync,Flags:?GLbitfield,0:32,Timeout:?GLuint64>>).
-%% @spec (Sync::integer(),Flags::integer(),Timeout::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWaitSync.xml">external</a> documentation.
--spec waitSync(integer(),integer(),integer()) -> ok.
+%% @doc Instruct the GL server to block until the specified sync object becomes signaled
+%%
+%% ``gl:waitSync'' causes the GL server to block and wait until `Sync' becomes signaled.
+%% `Sync' is the name of an existing sync object upon which to wait. `Flags' and `Timeout'
+%% are currently not used and must be set to zero and the special value `?GL_TIMEOUT_IGNORED'
+%% , respectively
+%%
+%% `Flags' and `Timeout' are placeholders for anticipated future extensions of
+%% sync object capabilities. They must have these reserved values in order that existing
+%% code calling ``gl:waitSync'' operate properly in the presence of such extensions.. ``gl:waitSync''
+%% will always wait no longer than an implementation-dependent timeout. The duration of
+%% this timeout in nanoseconds may be queried by calling {@link gl:getBooleanv/1} with the parameter `?GL_MAX_SERVER_WAIT_TIMEOUT'
+%% . There is currently no way to determine whether ``gl:waitSync'' unblocked because the
+%% timeout expired or because the sync object being waited on was signaled.
+%%
+%% If an error occurs, ``gl:waitSync'' does not cause the GL server to block.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWaitSync.xml">external</a> documentation.
+-spec waitSync(Sync, Flags, Timeout) -> ok when Sync :: integer(),Flags :: integer(),Timeout :: integer().
waitSync(Sync,Flags,Timeout) ->
cast(5694, <<Sync:?GLsync,Flags:?GLbitfield,0:32,Timeout:?GLuint64>>).
-%% @spec (Pname::enum()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetInteger64v.xml">external</a> documentation.
--spec getInteger64v(enum()) -> [integer()].
+%% @doc
+%% See {@link getBooleanv/1}
+-spec getInteger64v(Pname) -> [integer()] when Pname :: enum().
getInteger64v(Pname) ->
call(5695, <<Pname:?GLenum>>).
-%% @spec (Sync::integer(),Pname::enum(),BufSize::integer()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetSync.xml">external</a> documentation.
--spec getSynciv(integer(),enum(),integer()) -> [integer()].
+%% @doc Query the properties of a sync object
+%%
+%% ``gl:getSynciv'' retrieves properties of a sync object. `Sync' specifies the name
+%% of the sync object whose properties to retrieve.
+%%
+%% On success, ``gl:getSynciv'' replaces up to `BufSize' integers in `Values'
+%% with the corresponding property values of the object being queried. The actual number
+%% of integers replaced is returned in the variable whose address is specified in `Length'
+%% . If `Length' is NULL, no length is returned.
+%%
+%% If `Pname' is `?GL_OBJECT_TYPE', a single value representing the specific type
+%% of the sync object is placed in `Values' . The only type supported is `?GL_SYNC_FENCE'
+%% .
+%%
+%% If `Pname' is `?GL_SYNC_STATUS', a single value representing the status of
+%% the sync object (`?GL_SIGNALED' or `?GL_UNSIGNALED') is placed in `Values' .
+%%
+%%
+%% If `Pname' is `?GL_SYNC_CONDITION', a single value representing the condition
+%% of the sync object is placed in `Values' . The only condition supported is `?GL_SYNC_GPU_COMMANDS_COMPLETE'
+%% .
+%%
+%% If `Pname' is `?GL_SYNC_FLAGS', a single value representing the flags with
+%% which the sync object was created is placed in `Values' . No flags are currently supported
+%%
+%%
+%% `Flags' is expected to be used in future extensions to the sync objects..
+%%
+%% If an error occurs, nothing will be written to `Values' or `Length' .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetSync.xml">external</a> documentation.
+-spec getSynciv(Sync, Pname, BufSize) -> [integer()] when Sync :: integer(),Pname :: enum(),BufSize :: integer().
getSynciv(Sync,Pname,BufSize) ->
call(5696, <<Sync:?GLsync,Pname:?GLenum,BufSize:?GLsizei>>).
-%% @spec (Target::enum(),Samples::integer(),Internalformat::integer(),Width::integer(),Height::integer(),Fixedsamplelocations::0|1) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexImage2DMultisample.xml">external</a> documentation.
--spec texImage2DMultisample(enum(),integer(),integer(),integer(),integer(),0|1) -> ok.
+%% @doc Establish the data storage, format, dimensions, and number of samples of a multisample texture's image
+%%
+%% ``gl:texImage2DMultisample'' establishes the data storage, format, dimensions and number
+%% of samples of a multisample texture's image.
+%%
+%% `Target' must be `?GL_TEXTURE_2D_MULTISAMPLE' or `?GL_PROXY_TEXTURE_2D_MULTISAMPLE'
+%% . `Width' and `Height' are the dimensions in texels of the texture, and must
+%% be in the range zero to `?GL_MAX_TEXTURE_SIZE' - 1. `Samples' specifies the
+%% number of samples in the image and must be in the range zero to `?GL_MAX_SAMPLES'
+%% - 1.
+%%
+%% `Internalformat' must be a color-renderable, depth-renderable, or stencil-renderable
+%% format.
+%%
+%% If `Fixedsamplelocations' is `?GL_TRUE', the image will use identical sample
+%% locations and the same number of samples for all texels in the image, and the sample locations
+%% will not depend on the internal format or size of the image.
+%%
+%% When a multisample texture is accessed in a shader, the access takes one vector of integers
+%% describing which texel to fetch and an integer corresponding to the sample numbers describing
+%% which sample within the texel to fetch. No standard sampling instructions are allowed
+%% on the multisample texture targets.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexImage2DMultisample.xml">external</a> documentation.
+-spec texImage2DMultisample(Target, Samples, Internalformat, Width, Height, Fixedsamplelocations) -> ok when Target :: enum(),Samples :: integer(),Internalformat :: integer(),Width :: integer(),Height :: integer(),Fixedsamplelocations :: 0|1.
texImage2DMultisample(Target,Samples,Internalformat,Width,Height,Fixedsamplelocations) ->
cast(5697, <<Target:?GLenum,Samples:?GLsizei,Internalformat:?GLint,Width:?GLsizei,Height:?GLsizei,Fixedsamplelocations:?GLboolean>>).
-%% @spec (Target::enum(),Samples::integer(),Internalformat::integer(),Width::integer(),Height::integer(),Depth::integer(),Fixedsamplelocations::0|1) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexImage3DMultisample.xml">external</a> documentation.
--spec texImage3DMultisample(enum(),integer(),integer(),integer(),integer(),integer(),0|1) -> ok.
+%% @doc Establish the data storage, format, dimensions, and number of samples of a multisample texture's image
+%%
+%% ``gl:texImage3DMultisample'' establishes the data storage, format, dimensions and number
+%% of samples of a multisample texture's image.
+%%
+%% `Target' must be `?GL_TEXTURE_2D_MULTISAMPLE_ARRAY' or `?GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY'
+%% . `Width' and `Height' are the dimensions in texels of the texture, and must
+%% be in the range zero to `?GL_MAX_TEXTURE_SIZE' - 1. `Depth' is the number of
+%% array slices in the array texture's image. `Samples' specifies the number of samples
+%% in the image and must be in the range zero to `?GL_MAX_SAMPLES' - 1.
+%%
+%% `Internalformat' must be a color-renderable, depth-renderable, or stencil-renderable
+%% format.
+%%
+%% If `Fixedsamplelocations' is `?GL_TRUE', the image will use identical sample
+%% locations and the same number of samples for all texels in the image, and the sample locations
+%% will not depend on the internal format or size of the image.
+%%
+%% When a multisample texture is accessed in a shader, the access takes one vector of integers
+%% describing which texel to fetch and an integer corresponding to the sample numbers describing
+%% which sample within the texel to fetch. No standard sampling instructions are allowed
+%% on the multisample texture targets.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexImage3DMultisample.xml">external</a> documentation.
+-spec texImage3DMultisample(Target, Samples, Internalformat, Width, Height, Depth, Fixedsamplelocations) -> ok when Target :: enum(),Samples :: integer(),Internalformat :: integer(),Width :: integer(),Height :: integer(),Depth :: integer(),Fixedsamplelocations :: 0|1.
texImage3DMultisample(Target,Samples,Internalformat,Width,Height,Depth,Fixedsamplelocations) ->
cast(5698, <<Target:?GLenum,Samples:?GLsizei,Internalformat:?GLint,Width:?GLsizei,Height:?GLsizei,Depth:?GLsizei,Fixedsamplelocations:?GLboolean>>).
-%% @spec (Pname::enum(),Index::integer()) -> {float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetMultisample.xml">external</a> documentation.
--spec getMultisamplefv(enum(),integer()) -> {float(),float()}.
+%% @doc Retrieve the location of a sample
+%%
+%% ``gl:getMultisamplefv'' queries the location of a given sample. `Pname' specifies
+%% the sample parameter to retrieve and must be `?GL_SAMPLE_POSITION'. `Index'
+%% corresponds to the sample for which the location should be returned. The sample location
+%% is returned as two floating-point values in `Val[0]' and `Val[1]' , each between
+%% 0 and 1, corresponding to the `X' and `Y' locations respectively in the GL pixel
+%% space of that sample. (0.5, 0.5) this corresponds to the pixel center. `Index' must
+%% be between zero and the value of `?GL_SAMPLES' - 1.
+%%
+%% If the multisample mode does not have fixed sample locations, the returned values may
+%% only reflect the locations of samples within some pixels.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetMultisample.xml">external</a> documentation.
+-spec getMultisamplefv(Pname, Index) -> {float(),float()} when Pname :: enum(),Index :: integer().
getMultisamplefv(Pname,Index) ->
call(5699, <<Pname:?GLenum,Index:?GLuint>>).
-%% @spec (Index::integer(),Mask::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSampleMaski.xml">external</a> documentation.
--spec sampleMaski(integer(),integer()) -> ok.
+%% @doc Set the value of a sub-word of the sample mask
+%%
+%% ``gl:sampleMaski'' sets one 32-bit sub-word of the multi-word sample mask, `?GL_SAMPLE_MASK_VALUE'
+%% .
+%%
+%% `MaskIndex' specifies which 32-bit sub-word of the sample mask to update, and `Mask'
+%% specifies the new value to use for that sub-word. `MaskIndex' must be less than
+%% the value of `?GL_MAX_SAMPLE_MASK_WORDS'. Bit `B' of mask word `M' corresponds
+%% to sample 32 x `M' + `B'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSampleMaski.xml">external</a> documentation.
+-spec sampleMaski(Index, Mask) -> ok when Index :: integer(),Mask :: integer().
sampleMaski(Index,Mask) ->
cast(5700, <<Index:?GLuint,Mask:?GLbitfield>>).
-%% @spec (Type::enum(),Name::string(),String::string()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glNamedStringARB.xml">external</a> documentation.
--spec namedStringARB(enum(),string(),string()) -> ok.
+%% @doc glNamedStringARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glNamedStringARB.xml">external</a> documentation.
+-spec namedStringARB(Type, Name, String) -> ok when Type :: enum(),Name :: string(),String :: string().
namedStringARB(Type,Name,String) ->
cast(5701, <<Type:?GLenum,(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 5) rem 8)) rem 8),(list_to_binary([String|[0]]))/binary,0:((8-((length(String)+ 1) rem 8)) rem 8)>>).
-%% @spec (Name::string()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteNamedStringARB.xml">external</a> documentation.
--spec deleteNamedStringARB(string()) -> ok.
+%% @doc glDeleteNamedStringARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteNamedStringARB.xml">external</a> documentation.
+-spec deleteNamedStringARB(Name) -> ok when Name :: string().
deleteNamedStringARB(Name) ->
cast(5702, <<(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 1) rem 8)) rem 8)>>).
-%% @spec (Shader::integer(),Path::[string()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompileShaderIncludeARB.xml">external</a> documentation.
--spec compileShaderIncludeARB(integer(),[string()]) -> ok.
+%% @doc glCompileShaderIncludeARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCompileShaderIncludeARB.xml">external</a> documentation.
+-spec compileShaderIncludeARB(Shader, Path) -> ok when Shader :: integer(),Path :: [string()].
compileShaderIncludeARB(Shader,Path) ->
PathTemp = list_to_binary([[Str|[0]] || Str <- Path ]),
cast(5703, <<Shader:?GLuint,(length(Path)):?GLuint,(size(PathTemp)):?GLuint,(PathTemp)/binary,0:((8-((size(PathTemp)+0) rem 8)) rem 8)>>).
-%% @spec (Name::string()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsNamedStringARB.xml">external</a> documentation.
--spec isNamedStringARB(string()) -> 0|1.
+%% @doc glIsNamedStringARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsNamedStringARB.xml">external</a> documentation.
+-spec isNamedStringARB(Name) -> 0|1 when Name :: string().
isNamedStringARB(Name) ->
call(5704, <<(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 1) rem 8)) rem 8)>>).
-%% @spec (Name::string(),BufSize::integer()) -> string()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetNamedStringARB.xml">external</a> documentation.
--spec getNamedStringARB(string(),integer()) -> string().
+%% @doc glGetNamedStringARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetNamedStringARB.xml">external</a> documentation.
+-spec getNamedStringARB(Name, BufSize) -> string() when Name :: string(),BufSize :: integer().
getNamedStringARB(Name,BufSize) ->
call(5705, <<(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 1) rem 8)) rem 8),BufSize:?GLsizei>>).
-%% @spec (Name::string(),Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetNamedStringARB.xml">external</a> documentation.
--spec getNamedStringivARB(string(),enum()) -> integer().
+%% @doc glGetNamedStringARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetNamedStringARB.xml">external</a> documentation.
+-spec getNamedStringivARB(Name, Pname) -> integer() when Name :: string(),Pname :: enum().
getNamedStringivARB(Name,Pname) ->
call(5706, <<(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 1) rem 8)) rem 8),Pname:?GLenum>>).
-%% @spec (Program::integer(),ColorNumber::integer(),Index::integer(),Name::string()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindFragDataLocationIndexe.xml">external</a> documentation.
--spec bindFragDataLocationIndexed(integer(),integer(),integer(),string()) -> ok.
+%% @doc glBindFragDataLocationIndexe
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindFragDataLocationIndexe.xml">external</a> documentation.
+-spec bindFragDataLocationIndexed(Program, ColorNumber, Index, Name) -> ok when Program :: integer(),ColorNumber :: integer(),Index :: integer(),Name :: string().
bindFragDataLocationIndexed(Program,ColorNumber,Index,Name) ->
cast(5707, <<Program:?GLuint,ColorNumber:?GLuint,Index:?GLuint,(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 5) rem 8)) rem 8)>>).
-%% @spec (Program::integer(),Name::string()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetFragDataIndex.xml">external</a> documentation.
--spec getFragDataIndex(integer(),string()) -> integer().
+%% @doc Query the bindings of color indices to user-defined varying out variables
+%%
+%% ``gl:getFragDataIndex'' returns the index of the fragment color to which the variable `Name'
+%% was bound when the program object `Program' was last linked. If `Name' is not
+%% a varying out variable of `Program' , or if an error occurs, -1 will be returned.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetFragDataIndex.xml">external</a> documentation.
+-spec getFragDataIndex(Program, Name) -> integer() when Program :: integer(),Name :: string().
getFragDataIndex(Program,Name) ->
call(5708, <<Program:?GLuint,(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 5) rem 8)) rem 8)>>).
-%% @spec (Count::integer()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenSamplers.xml">external</a> documentation.
--spec genSamplers(integer()) -> [integer()].
+%% @doc Generate sampler object names
+%%
+%% ``gl:genSamplers'' returns `N' sampler object names in `Samplers' . There is
+%% no guarantee that the names form a contiguous set of integers; however, it is guaranteed
+%% that none of the returned names was in use immediately before the call to ``gl:genSamplers''
+%% .
+%%
+%% Sampler object names returned by a call to ``gl:genSamplers'' are not returned by subsequent
+%% calls, unless they are first deleted with {@link gl:deleteSamplers/1} .
+%%
+%% The names returned in `Samplers' are marked as used, for the purposes of ``gl:genSamplers''
+%% only, but they acquire state and type only when they are first bound.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenSamplers.xml">external</a> documentation.
+-spec genSamplers(Count) -> [integer()] when Count :: integer().
genSamplers(Count) ->
call(5709, <<Count:?GLsizei>>).
-%% @spec (Samplers::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteSamplers.xml">external</a> documentation.
--spec deleteSamplers([integer()]) -> ok.
+%% @doc Delete named sampler objects
+%%
+%% ``gl:deleteSamplers'' deletes `N' sampler objects named by the elements of the
+%% array `Ids' . After a sampler object is deleted, its name is again unused. If a sampler
+%% object that is currently bound to a sampler unit is deleted, it is as though {@link gl:bindSampler/2}
+%% is called with unit set to the unit the sampler is bound to and sampler zero. Unused
+%% names in samplers are silently ignored, as is the reserved name zero.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteSamplers.xml">external</a> documentation.
+-spec deleteSamplers(Samplers) -> ok when Samplers :: [integer()].
deleteSamplers(Samplers) ->
cast(5710, <<(length(Samplers)):?GLuint,
(<< <<C:?GLuint>> || C <- Samplers>>)/binary,0:(((1+length(Samplers)) rem 2)*32)>>).
-%% @spec (Sampler::integer()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsSampler.xml">external</a> documentation.
--spec isSampler(integer()) -> 0|1.
+%% @doc Determine if a name corresponds to a sampler object
+%%
+%% ``gl:isSampler'' returns `?GL_TRUE' if `Id' is currently the name of a sampler
+%% object. If `Id' is zero, or is a non-zero value that is not currently the name of
+%% a sampler object, or if an error occurs, ``gl:isSampler'' returns `?GL_FALSE'.
+%%
+%% A name returned by {@link gl:genSamplers/1} , is the name of a sampler object.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsSampler.xml">external</a> documentation.
+-spec isSampler(Sampler) -> 0|1 when Sampler :: integer().
isSampler(Sampler) ->
call(5711, <<Sampler:?GLuint>>).
-%% @spec (Unit::integer(),Sampler::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindSampler.xml">external</a> documentation.
--spec bindSampler(integer(),integer()) -> ok.
+%% @doc Bind a named sampler to a texturing target
+%%
+%% ``gl:bindSampler'' binds `Sampler' to the texture unit at index `Unit' . `Sampler'
+%% must be zero or the name of a sampler object previously returned from a call to {@link gl:genSamplers/1}
+%% . `Unit' must be less than the value of `?GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS'.
+%%
+%%
+%% When a sampler object is bound to a texture unit, its state supersedes that of the texture
+%% object bound to that texture unit. If the sampler name zero is bound to a texture unit,
+%% the currently bound texture's sampler state becomes active. A single sampler object may
+%% be bound to multiple texture units simultaneously.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindSampler.xml">external</a> documentation.
+-spec bindSampler(Unit, Sampler) -> ok when Unit :: integer(),Sampler :: integer().
bindSampler(Unit,Sampler) ->
cast(5712, <<Unit:?GLuint,Sampler:?GLuint>>).
-%% @spec (Sampler::integer(),Pname::enum(),Param::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSamplerParameter.xml">external</a> documentation.
--spec samplerParameteri(integer(),enum(),integer()) -> ok.
+%% @doc Set sampler parameters
+%%
+%% ``gl:samplerParameter'' assigns the value or values in `Params' to the sampler
+%% parameter specified as `Pname' . `Sampler' specifies the sampler object to be
+%% modified, and must be the name of a sampler object previously returned from a call to {@link gl:genSamplers/1}
+%% . The following symbols are accepted in `Pname' :
+%%
+%% `?GL_TEXTURE_MIN_FILTER': The texture minifying function is used whenever the pixel
+%% being textured maps to an area greater than one texture element. There are six defined
+%% minifying functions. Two of them use the nearest one or nearest four texture elements
+%% to compute the texture value. The other four use mipmaps.
+%%
+%% A mipmap is an ordered set of arrays representing the same image at progressively lower
+%% resolutions. If the texture has dimensions 2 n*2 m, there are max(n m)+1 mipmaps. The first
+%% mipmap is the original texture, with dimensions 2 n*2 m. Each subsequent mipmap has
+%% dimensions 2(k-1)*2(l-1), where 2 k*2 l are the dimensions of the previous mipmap, until either
+%% k= 0 or l= 0. At that point, subsequent mipmaps have dimension 1*2(l-1) or 2(k-1)*1 until
+%% the final mipmap, which has dimension 1*1. To define the mipmaps, call {@link gl:texImage1D/8}
+%% , {@link gl:texImage2D/9} , {@link gl:texImage3D/10} , {@link gl:copyTexImage1D/7} , or {@link gl:copyTexImage2D/8}
+%% with the `level' argument indicating the order of the mipmaps. Level 0 is the original
+%% texture; level max(n m) is the final 1*1 mipmap.
+%%
+%% `Params' supplies a function for minifying the texture as one of the following:
+%%
+%% `?GL_NEAREST': Returns the value of the texture element that is nearest (in Manhattan
+%% distance) to the center of the pixel being textured.
+%%
+%% `?GL_LINEAR': Returns the weighted average of the four texture elements that are
+%% closest to the center of the pixel being textured. These can include border texture elements,
+%% depending on the values of `?GL_TEXTURE_WRAP_S' and `?GL_TEXTURE_WRAP_T', and
+%% on the exact mapping.
+%%
+%% `?GL_NEAREST_MIPMAP_NEAREST': Chooses the mipmap that most closely matches the size
+%% of the pixel being textured and uses the `?GL_NEAREST' criterion (the texture element
+%% nearest to the center of the pixel) to produce a texture value.
+%%
+%% `?GL_LINEAR_MIPMAP_NEAREST': Chooses the mipmap that most closely matches the size
+%% of the pixel being textured and uses the `?GL_LINEAR' criterion (a weighted average
+%% of the four texture elements that are closest to the center of the pixel) to produce a
+%% texture value.
+%%
+%% `?GL_NEAREST_MIPMAP_LINEAR': Chooses the two mipmaps that most closely match the
+%% size of the pixel being textured and uses the `?GL_NEAREST' criterion (the texture
+%% element nearest to the center of the pixel) to produce a texture value from each mipmap.
+%% The final texture value is a weighted average of those two values.
+%%
+%% `?GL_LINEAR_MIPMAP_LINEAR': Chooses the two mipmaps that most closely match the
+%% size of the pixel being textured and uses the `?GL_LINEAR' criterion (a weighted
+%% average of the four texture elements that are closest to the center of the pixel) to produce
+%% a texture value from each mipmap. The final texture value is a weighted average of those
+%% two values.
+%%
+%% As more texture elements are sampled in the minification process, fewer aliasing artifacts
+%% will be apparent. While the `?GL_NEAREST' and `?GL_LINEAR' minification functions
+%% can be faster than the other four, they sample only one or four texture elements to determine
+%% the texture value of the pixel being rendered and can produce moire patterns or ragged
+%% transitions. The initial value of `?GL_TEXTURE_MIN_FILTER' is `?GL_NEAREST_MIPMAP_LINEAR'
+%% .
+%%
+%% `?GL_TEXTURE_MAG_FILTER': The texture magnification function is used when the pixel
+%% being textured maps to an area less than or equal to one texture element. It sets the
+%% texture magnification function to either `?GL_NEAREST' or `?GL_LINEAR' (see
+%% below). `?GL_NEAREST' is generally faster than `?GL_LINEAR', but it can produce
+%% textured images with sharper edges because the transition between texture elements is
+%% not as smooth. The initial value of `?GL_TEXTURE_MAG_FILTER' is `?GL_LINEAR'.
+%%
+%% `?GL_NEAREST': Returns the value of the texture element that is nearest (in Manhattan
+%% distance) to the center of the pixel being textured.
+%%
+%% `?GL_LINEAR': Returns the weighted average of the four texture elements that are
+%% closest to the center of the pixel being textured. These can include border texture elements,
+%% depending on the values of `?GL_TEXTURE_WRAP_S' and `?GL_TEXTURE_WRAP_T', and
+%% on the exact mapping.
+%%
+%%
+%%
+%% `?GL_TEXTURE_MIN_LOD': Sets the minimum level-of-detail parameter. This floating-point
+%% value limits the selection of highest resolution mipmap (lowest mipmap level). The initial
+%% value is -1000.
+%%
+%%
+%%
+%% `?GL_TEXTURE_MAX_LOD': Sets the maximum level-of-detail parameter. This floating-point
+%% value limits the selection of the lowest resolution mipmap (highest mipmap level). The
+%% initial value is 1000.
+%%
+%%
+%%
+%% `?GL_TEXTURE_WRAP_S': Sets the wrap parameter for texture coordinate s to either `?GL_CLAMP_TO_EDGE'
+%% , `?GL_MIRRORED_REPEAT', or `?GL_REPEAT'. `?GL_CLAMP_TO_BORDER' causes
+%% the s coordinate to be clamped to the range [(-1 2/N) 1+(1 2/N)], where N is the size of the texture in
+%% the direction of clamping.`?GL_CLAMP_TO_EDGE' causes s coordinates to be clamped
+%% to the range [(1 2/N) 1-(1 2/N)], where N is the size of the texture in the direction of clamping. `?GL_REPEAT'
+%% causes the integer part of the s coordinate to be ignored; the GL uses only the fractional
+%% part, thereby creating a repeating pattern. `?GL_MIRRORED_REPEAT' causes the s
+%% coordinate to be set to the fractional part of the texture coordinate if the integer part
+%% of s is even; if the integer part of s is odd, then the s texture coordinate is
+%% set to 1-frac(s), where frac(s) represents the fractional part of s. Initially, `?GL_TEXTURE_WRAP_S'
+%% is set to `?GL_REPEAT'.
+%%
+%%
+%%
+%% `?GL_TEXTURE_WRAP_T': Sets the wrap parameter for texture coordinate t to either `?GL_CLAMP_TO_EDGE'
+%% , `?GL_MIRRORED_REPEAT', or `?GL_REPEAT'. See the discussion under `?GL_TEXTURE_WRAP_S'
+%% . Initially, `?GL_TEXTURE_WRAP_T' is set to `?GL_REPEAT'.
+%%
+%% `?GL_TEXTURE_WRAP_R': Sets the wrap parameter for texture coordinate r to either `?GL_CLAMP_TO_EDGE'
+%% , `?GL_MIRRORED_REPEAT', or `?GL_REPEAT'. See the discussion under `?GL_TEXTURE_WRAP_S'
+%% . Initially, `?GL_TEXTURE_WRAP_R' is set to `?GL_REPEAT'.
+%%
+%% `?GL_TEXTURE_BORDER_COLOR': The data in `Params' specifies four values that
+%% define the border values that should be used for border texels. If a texel is sampled
+%% from the border of the texture, the values of `?GL_TEXTURE_BORDER_COLOR' are interpreted
+%% as an RGBA color to match the texture's internal format and substituted for the non-existent
+%% texel data. If the texture contains depth components, the first component of `?GL_TEXTURE_BORDER_COLOR'
+%% is interpreted as a depth value. The initial value is (0.0, 0.0, 0.0, 0.0).
+%%
+%% `?GL_TEXTURE_COMPARE_MODE': Specifies the texture comparison mode for currently
+%% bound textures. That is, a texture whose internal format is `?GL_DEPTH_COMPONENT_*';
+%% see {@link gl:texImage2D/9} ) Permissible values are:
+%%
+%% `?GL_COMPARE_REF_TO_TEXTURE': Specifies that the interpolated and clamped r texture
+%% coordinate should be compared to the value in the currently bound texture. See the discussion
+%% of `?GL_TEXTURE_COMPARE_FUNC' for details of how the comparison is evaluated. The
+%% result of the comparison is assigned to the red channel.
+%%
+%% `?GL_NONE': Specifies that the red channel should be assigned the appropriate value
+%% from the currently bound texture.
+%%
+%% `?GL_TEXTURE_COMPARE_FUNC': Specifies the comparison operator used when `?GL_TEXTURE_COMPARE_MODE'
+%% is set to `?GL_COMPARE_REF_TO_TEXTURE'. Permissible values are: <table><tbody><tr><td>
+%% ` Texture Comparison Function '</td><td>` Computed result '</td></tr></tbody><tbody>
+%% <tr><td>`?GL_LEQUAL'</td><td> result={1.0 0.0 &amp;nbsp;&amp;nbsp; r&lt;=(D t) r&gt;(D t))</td></tr><tr><td>`?GL_GEQUAL'</td><td>
+%% result={1.0 0.0 &amp;nbsp;&amp;nbsp; r&gt;=(D t) r&lt;(D t))</td></tr><tr><td>`?GL_LESS'</td><td> result={1.0 0.0 &amp;nbsp;&amp;nbsp; r&lt;
+%% (D t) r&gt;=(D t))</td></tr><tr><td>`?GL_GREATER'
+%% </td><td> result={1.0 0.0 &amp;nbsp;&amp;nbsp; r&gt;(D t) r&lt;=(D t))</td></tr><tr><td>`?GL_EQUAL'</td><td> result={1.0 0.0 &amp;nbsp;&amp;nbsp;
+%% r=(D t) r&amp;ne;(D t))</td></tr><tr><td>`?GL_NOTEQUAL'
+%% </td><td> result={1.0 0.0 &amp;nbsp;&amp;nbsp; r&amp;ne;(D t) r=(D t))</td></tr><tr><td>`?GL_ALWAYS'</td><td> result= 1.0</td></tr><tr><td>
+%% `?GL_NEVER'</td><td> result= 0.0</td></tr></tbody></table> where r is the current
+%% interpolated texture coordinate, and D t is the texture value sampled from the currently
+%% bound texture. result is assigned to R t.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSamplerParameter.xml">external</a> documentation.
+-spec samplerParameteri(Sampler, Pname, Param) -> ok when Sampler :: integer(),Pname :: enum(),Param :: integer().
samplerParameteri(Sampler,Pname,Param) ->
cast(5713, <<Sampler:?GLuint,Pname:?GLenum,Param:?GLint>>).
-%% @spec (Sampler::integer(),Pname::enum(),Param::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSamplerParameter.xml">external</a> documentation.
--spec samplerParameteriv(integer(),enum(),[integer()]) -> ok.
+%% @doc
+%% See {@link samplerParameteri/3}
+-spec samplerParameteriv(Sampler, Pname, Param) -> ok when Sampler :: integer(),Pname :: enum(),Param :: [integer()].
samplerParameteriv(Sampler,Pname,Param) ->
cast(5714, <<Sampler:?GLuint,Pname:?GLenum,(length(Param)):?GLuint,
(<< <<C:?GLint>> || C <- Param>>)/binary,0:(((1+length(Param)) rem 2)*32)>>).
-%% @spec (Sampler::integer(),Pname::enum(),Param::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSamplerParameter.xml">external</a> documentation.
--spec samplerParameterf(integer(),enum(),float()) -> ok.
+%% @doc
+%% See {@link samplerParameteri/3}
+-spec samplerParameterf(Sampler, Pname, Param) -> ok when Sampler :: integer(),Pname :: enum(),Param :: float().
samplerParameterf(Sampler,Pname,Param) ->
cast(5715, <<Sampler:?GLuint,Pname:?GLenum,Param:?GLfloat>>).
-%% @spec (Sampler::integer(),Pname::enum(),Param::[float()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSamplerParameter.xml">external</a> documentation.
--spec samplerParameterfv(integer(),enum(),[float()]) -> ok.
+%% @doc
+%% See {@link samplerParameteri/3}
+-spec samplerParameterfv(Sampler, Pname, Param) -> ok when Sampler :: integer(),Pname :: enum(),Param :: [float()].
samplerParameterfv(Sampler,Pname,Param) ->
cast(5716, <<Sampler:?GLuint,Pname:?GLenum,(length(Param)):?GLuint,
(<< <<C:?GLfloat>> || C <- Param>>)/binary,0:(((1+length(Param)) rem 2)*32)>>).
-%% @spec (Sampler::integer(),Pname::enum(),Param::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSamplerParameterI.xml">external</a> documentation.
--spec samplerParameterIiv(integer(),enum(),[integer()]) -> ok.
+%% @doc
+%% See {@link samplerParameteri/3}
+-spec samplerParameterIiv(Sampler, Pname, Param) -> ok when Sampler :: integer(),Pname :: enum(),Param :: [integer()].
samplerParameterIiv(Sampler,Pname,Param) ->
cast(5717, <<Sampler:?GLuint,Pname:?GLenum,(length(Param)):?GLuint,
(<< <<C:?GLint>> || C <- Param>>)/binary,0:(((1+length(Param)) rem 2)*32)>>).
-%% @spec (Sampler::integer(),Pname::enum(),Param::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSamplerParameterI.xml">external</a> documentation.
--spec samplerParameterIuiv(integer(),enum(),[integer()]) -> ok.
+%% @doc glSamplerParameterI
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glSamplerParameterI.xml">external</a> documentation.
+-spec samplerParameterIuiv(Sampler, Pname, Param) -> ok when Sampler :: integer(),Pname :: enum(),Param :: [integer()].
samplerParameterIuiv(Sampler,Pname,Param) ->
cast(5718, <<Sampler:?GLuint,Pname:?GLenum,(length(Param)):?GLuint,
(<< <<C:?GLuint>> || C <- Param>>)/binary,0:(((1+length(Param)) rem 2)*32)>>).
-%% @spec (Sampler::integer(),Pname::enum()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetSamplerParameter.xml">external</a> documentation.
--spec getSamplerParameteriv(integer(),enum()) -> [integer()].
+%% @doc Return sampler parameter values
+%%
+%% ``gl:getSamplerParameter'' returns in `Params' the value or values of the sampler
+%% parameter specified as `Pname' . `Sampler' defines the target sampler, and must
+%% be the name of an existing sampler object, returned from a previous call to {@link gl:genSamplers/1}
+%% . `Pname' accepts the same symbols as {@link gl:samplerParameteri/3} , with the same
+%% interpretations:
+%%
+%% `?GL_TEXTURE_MAG_FILTER': Returns the single-valued texture magnification filter,
+%% a symbolic constant. The initial value is `?GL_LINEAR'.
+%%
+%% `?GL_TEXTURE_MIN_FILTER': Returns the single-valued texture minification filter,
+%% a symbolic constant. The initial value is `?GL_NEAREST_MIPMAP_LINEAR'.
+%%
+%% `?GL_TEXTURE_MIN_LOD': Returns the single-valued texture minimum level-of-detail
+%% value. The initial value is -1000.
+%%
+%% `?GL_TEXTURE_MAX_LOD': Returns the single-valued texture maximum level-of-detail
+%% value. The initial value is 1000.
+%%
+%% `?GL_TEXTURE_WRAP_S': Returns the single-valued wrapping function for texture coordinate
+%% s, a symbolic constant. The initial value is `?GL_REPEAT'.
+%%
+%% `?GL_TEXTURE_WRAP_T': Returns the single-valued wrapping function for texture coordinate
+%% t, a symbolic constant. The initial value is `?GL_REPEAT'.
+%%
+%% `?GL_TEXTURE_WRAP_R': Returns the single-valued wrapping function for texture coordinate
+%% r, a symbolic constant. The initial value is `?GL_REPEAT'.
+%%
+%% `?GL_TEXTURE_BORDER_COLOR': Returns four integer or floating-point numbers that
+%% comprise the RGBA color of the texture border. Floating-point values are returned in the
+%% range [0 1]. Integer values are returned as a linear mapping of the internal floating-point
+%% representation such that 1.0 maps to the most positive representable integer and -1.0
+%% maps to the most negative representable integer. The initial value is (0, 0, 0, 0).
+%%
+%% `?GL_TEXTURE_COMPARE_MODE': Returns a single-valued texture comparison mode, a symbolic
+%% constant. The initial value is `?GL_NONE'. See {@link gl:samplerParameteri/3} .
+%%
+%% `?GL_TEXTURE_COMPARE_FUNC': Returns a single-valued texture comparison function,
+%% a symbolic constant. The initial value is `?GL_LEQUAL'. See {@link gl:samplerParameteri/3}
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetSamplerParameter.xml">external</a> documentation.
+-spec getSamplerParameteriv(Sampler, Pname) -> [integer()] when Sampler :: integer(),Pname :: enum().
getSamplerParameteriv(Sampler,Pname) ->
call(5719, <<Sampler:?GLuint,Pname:?GLenum>>).
-%% @spec (Sampler::integer(),Pname::enum()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetSamplerParameterI.xml">external</a> documentation.
--spec getSamplerParameterIiv(integer(),enum()) -> [integer()].
+%% @doc
+%% See {@link getSamplerParameteriv/2}
+-spec getSamplerParameterIiv(Sampler, Pname) -> [integer()] when Sampler :: integer(),Pname :: enum().
getSamplerParameterIiv(Sampler,Pname) ->
call(5720, <<Sampler:?GLuint,Pname:?GLenum>>).
-%% @spec (Sampler::integer(),Pname::enum()) -> [float()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetSamplerParameter.xml">external</a> documentation.
--spec getSamplerParameterfv(integer(),enum()) -> [float()].
+%% @doc
+%% See {@link getSamplerParameteriv/2}
+-spec getSamplerParameterfv(Sampler, Pname) -> [float()] when Sampler :: integer(),Pname :: enum().
getSamplerParameterfv(Sampler,Pname) ->
call(5721, <<Sampler:?GLuint,Pname:?GLenum>>).
-%% @spec (Sampler::integer(),Pname::enum()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetSamplerParameterI.xml">external</a> documentation.
--spec getSamplerParameterIuiv(integer(),enum()) -> [integer()].
+%% @doc glGetSamplerParameterI
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetSamplerParameterI.xml">external</a> documentation.
+-spec getSamplerParameterIuiv(Sampler, Pname) -> [integer()] when Sampler :: integer(),Pname :: enum().
getSamplerParameterIuiv(Sampler,Pname) ->
call(5722, <<Sampler:?GLuint,Pname:?GLenum>>).
-%% @spec (Id::integer(),Target::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glQueryCounter.xml">external</a> documentation.
--spec queryCounter(integer(),enum()) -> ok.
+%% @doc Record the GL time into a query object after all previous commands have reached the GL server but have not yet necessarily executed.
+%%
+%% ``gl:queryCounter'' causes the GL to record the current time into the query object named
+%% `Id' . `Target' must be `?GL_TIMESTAMP'. The time is recorded after all
+%% previous commands on the GL client and server state and the framebuffer have been fully
+%% realized. When the time is recorded, the query result for that object is marked available.
+%% ``gl:queryCounter'' timer queries can be used within a {@link gl:beginQuery/2} / {@link gl:beginQuery/2}
+%% block where the target is `?GL_TIME_ELAPSED' and it does not affect the result of
+%% that query object.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glQueryCounter.xml">external</a> documentation.
+-spec queryCounter(Id, Target) -> ok when Id :: integer(),Target :: enum().
queryCounter(Id,Target) ->
cast(5723, <<Id:?GLuint,Target:?GLenum>>).
-%% @spec (Id::integer(),Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetQueryObjecti64v.xml">external</a> documentation.
--spec getQueryObjecti64v(integer(),enum()) -> integer().
+%% @doc glGetQueryObjecti64v
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetQueryObjecti64v.xml">external</a> documentation.
+-spec getQueryObjecti64v(Id, Pname) -> integer() when Id :: integer(),Pname :: enum().
getQueryObjecti64v(Id,Pname) ->
call(5724, <<Id:?GLuint,Pname:?GLenum>>).
-%% @spec (Id::integer(),Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetQueryObjectui64v.xml">external</a> documentation.
--spec getQueryObjectui64v(integer(),enum()) -> integer().
+%% @doc glGetQueryObjectui64v
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetQueryObjectui64v.xml">external</a> documentation.
+-spec getQueryObjectui64v(Id, Pname) -> integer() when Id :: integer(),Pname :: enum().
getQueryObjectui64v(Id,Pname) ->
call(5725, <<Id:?GLuint,Pname:?GLenum>>).
-%% @spec (Mode::enum(),Indirect::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawArraysIndirect.xml">external</a> documentation.
--spec drawArraysIndirect(enum(),offset()|mem()) -> ok.
+%% @doc Render primitives from array data, taking parameters from memory
+%%
+%% ``gl:drawArraysIndirect'' specifies multiple geometric primitives with very few subroutine
+%% calls. ``gl:drawArraysIndirect'' behaves similarly to {@link gl:drawArraysInstancedBaseInstance/5}
+%% , execept that the parameters to {@link gl:drawArraysInstancedBaseInstance/5} are stored
+%% in memory at the address given by `Indirect' .
+%%
+%% The parameters addressed by `Indirect' are packed into a structure that takes the
+%% form (in C): typedef struct { uint count; uint primCount; uint first; uint baseInstance;
+%% } DrawArraysIndirectCommand; const DrawArraysIndirectCommand *cmd = (const DrawArraysIndirectCommand
+%% *)indirect; glDrawArraysInstancedBaseInstance(mode, cmd-&gt;first, cmd-&gt;count, cmd-&gt;primCount,
+%% cmd-&gt;baseInstance);
+%%
+%% If a buffer is bound to the `?GL_DRAW_INDIRECT_BUFFER' binding at the time of a
+%% call to ``gl:drawArraysIndirect'', `Indirect' is interpreted as an offset, in basic
+%% machine units, into that buffer and the parameter data is read from the buffer rather
+%% than from client memory.
+%%
+%% In contrast to {@link gl:drawArraysInstancedBaseInstance/5} , the first member of the parameter
+%% structure is unsigned, and out-of-range indices do not generate an error.
+%%
+%% Vertex attributes that are modified by ``gl:drawArraysIndirect'' have an unspecified
+%% value after ``gl:drawArraysIndirect'' returns. Attributes that aren't modified remain
+%% well defined.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawArraysIndirect.xml">external</a> documentation.
+-spec drawArraysIndirect(Mode, Indirect) -> ok when Mode :: enum(),Indirect :: offset()|mem().
drawArraysIndirect(Mode,Indirect) when is_integer(Indirect) ->
cast(5726, <<Mode:?GLenum,Indirect:?GLuint>>);
drawArraysIndirect(Mode,Indirect) ->
send_bin(Indirect),
cast(5727, <<Mode:?GLenum>>).
-%% @spec (Mode::enum(),Type::enum(),Indirect::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawElementsIndirect.xml">external</a> documentation.
--spec drawElementsIndirect(enum(),enum(),offset()|mem()) -> ok.
+%% @doc Render indexed primitives from array data, taking parameters from memory
+%%
+%% ``gl:drawElementsIndirect'' specifies multiple indexed geometric primitives with very
+%% few subroutine calls. ``gl:drawElementsIndirect'' behaves similarly to {@link gl:drawElementsInstancedBaseVertexBaseInstance/7}
+%% , execpt that the parameters to {@link gl:drawElementsInstancedBaseVertexBaseInstance/7}
+%% are stored in memory at the address given by `Indirect' .
+%%
+%% The parameters addressed by `Indirect' are packed into a structure that takes the
+%% form (in C): typedef struct { uint count; uint primCount; uint firstIndex; uint baseVertex;
+%% uint baseInstance; } DrawElementsIndirectCommand;
+%%
+%% ``gl:drawElementsIndirect'' is equivalent to: void glDrawElementsIndirect(GLenum mode,
+%% GLenum type, const void * indirect) { const DrawElementsIndirectCommand *cmd = (const
+%% DrawElementsIndirectCommand *)indirect; glDrawElementsInstancedBaseVertexBaseInstance(mode,
+%% cmd-&gt;count, type, cmd-&gt;firstIndex + size-of-type, cmd-&gt;primCount, cmd-&gt;baseVertex,
+%% cmd-&gt;baseInstance); }
+%%
+%% If a buffer is bound to the `?GL_DRAW_INDIRECT_BUFFER' binding at the time of a
+%% call to ``gl:drawElementsIndirect'', `Indirect' is interpreted as an offset, in
+%% basic machine units, into that buffer and the parameter data is read from the buffer rather
+%% than from client memory.
+%%
+%% Note that indices stored in client memory are not supported. If no buffer is bound to
+%% the `?GL_ELEMENT_ARRAY_BUFFER' binding, an error will be generated.
+%%
+%% The results of the operation are undefined if the reservedMustBeZero member of the parameter
+%% structure is non-zero. However, no error is generated in this case.
+%%
+%% Vertex attributes that are modified by ``gl:drawElementsIndirect'' have an unspecified
+%% value after ``gl:drawElementsIndirect'' returns. Attributes that aren't modified remain
+%% well defined.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawElementsIndirect.xml">external</a> documentation.
+-spec drawElementsIndirect(Mode, Type, Indirect) -> ok when Mode :: enum(),Type :: enum(),Indirect :: offset()|mem().
drawElementsIndirect(Mode,Type,Indirect) when is_integer(Indirect) ->
cast(5728, <<Mode:?GLenum,Type:?GLenum,Indirect:?GLuint>>);
drawElementsIndirect(Mode,Type,Indirect) ->
send_bin(Indirect),
cast(5729, <<Mode:?GLenum,Type:?GLenum>>).
-%% @spec (Location::integer(),X::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform1d(integer(),float()) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform1d(Location, X) -> ok when Location :: integer(),X :: float().
uniform1d(Location,X) ->
cast(5730, <<Location:?GLint,0:32,X:?GLdouble>>).
-%% @spec (Location::integer(),X::float(),Y::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform2d(integer(),float(),float()) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform2d(Location, X, Y) -> ok when Location :: integer(),X :: float(),Y :: float().
uniform2d(Location,X,Y) ->
cast(5731, <<Location:?GLint,0:32,X:?GLdouble,Y:?GLdouble>>).
-%% @spec (Location::integer(),X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform3d(integer(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform3d(Location, X, Y, Z) -> ok when Location :: integer(),X :: float(),Y :: float(),Z :: float().
uniform3d(Location,X,Y,Z) ->
cast(5732, <<Location:?GLint,0:32,X:?GLdouble,Y:?GLdouble,Z:?GLdouble>>).
-%% @spec (Location::integer(),X::float(),Y::float(),Z::float(),W::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform4d(integer(),float(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform4d(Location, X, Y, Z, W) -> ok when Location :: integer(),X :: float(),Y :: float(),Z :: float(),W :: float().
uniform4d(Location,X,Y,Z,W) ->
cast(5733, <<Location:?GLint,0:32,X:?GLdouble,Y:?GLdouble,Z:?GLdouble,W:?GLdouble>>).
-%% @spec (Location::integer(),Value::[float()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform1dv(integer(),[float()]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform1dv(Location, Value) -> ok when Location :: integer(),Value :: [float()].
uniform1dv(Location,Value) ->
cast(5734, <<Location:?GLint,0:32,(length(Value)):?GLuint,0:32,
(<< <<C:?GLdouble>> || C <- Value>>)/binary>>).
-%% @spec (Location::integer(),Value::[{float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform2dv(integer(),[{float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform2dv(Location, Value) -> ok when Location :: integer(),Value :: [{float(),float()}].
uniform2dv(Location,Value) ->
cast(5735, <<Location:?GLint,0:32,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble>> || {V1,V2} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Value::[{float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform3dv(integer(),[{float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform3dv(Location, Value) -> ok when Location :: integer(),Value :: [{float(),float(),float()}].
uniform3dv(Location,Value) ->
cast(5736, <<Location:?GLint,0:32,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble>> || {V1,V2,V3} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Value::[{float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniform.xml">external</a> documentation.
--spec uniform4dv(integer(),[{float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniform4dv(Location, Value) -> ok when Location :: integer(),Value :: [{float(),float(),float(),float()}].
uniform4dv(Location,Value) ->
cast(5737, <<Location:?GLint,0:32,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble>> || {V1,V2,V3,V4} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix.xml">external</a> documentation.
--spec uniformMatrix2dv(integer(),0|1,[{float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix2dv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float()}].
uniformMatrix2dv(Location,Transpose,Value) ->
cast(5738, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble>> || {V1,V2,V3,V4} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix.xml">external</a> documentation.
--spec uniformMatrix3dv(integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix3dv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float()}].
uniformMatrix3dv(Location,Transpose,Value) ->
cast(5739, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble,V7:?GLdouble,V8:?GLdouble,V9:?GLdouble>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix.xml">external</a> documentation.
--spec uniformMatrix4dv(integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix4dv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}].
uniformMatrix4dv(Location,Transpose,Value) ->
cast(5740, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble,V7:?GLdouble,V8:?GLdouble,V9:?GLdouble,V10:?GLdouble,V11:?GLdouble,V12:?GLdouble,V13:?GLdouble,V14:?GLdouble,V15:?GLdouble,V16:?GLdouble>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,V13,V14,V15,V16} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix2x.xml">external</a> documentation.
--spec uniformMatrix2x3dv(integer(),0|1,[{float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix2x3dv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float()}].
uniformMatrix2x3dv(Location,Transpose,Value) ->
cast(5741, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble>> || {V1,V2,V3,V4,V5,V6} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix2x.xml">external</a> documentation.
--spec uniformMatrix2x4dv(integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix2x4dv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float()}].
uniformMatrix2x4dv(Location,Transpose,Value) ->
cast(5742, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble,V7:?GLdouble,V8:?GLdouble>> || {V1,V2,V3,V4,V5,V6,V7,V8} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix3x.xml">external</a> documentation.
--spec uniformMatrix3x2dv(integer(),0|1,[{float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix3x2dv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float()}].
uniformMatrix3x2dv(Location,Transpose,Value) ->
cast(5743, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble>> || {V1,V2,V3,V4,V5,V6} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix3x.xml">external</a> documentation.
--spec uniformMatrix3x4dv(integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix3x4dv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}].
uniformMatrix3x4dv(Location,Transpose,Value) ->
cast(5744, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble,V7:?GLdouble,V8:?GLdouble,V9:?GLdouble,V10:?GLdouble,V11:?GLdouble,V12:?GLdouble>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix4x.xml">external</a> documentation.
--spec uniformMatrix4x2dv(integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix4x2dv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float()}].
uniformMatrix4x2dv(Location,Transpose,Value) ->
cast(5745, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble,V7:?GLdouble,V8:?GLdouble>> || {V1,V2,V3,V4,V5,V6,V7,V8} <- Value>>)/binary>>).
-%% @spec (Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformMatrix4x.xml">external</a> documentation.
--spec uniformMatrix4x3dv(integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link uniform1f/2}
+-spec uniformMatrix4x3dv(Location, Transpose, Value) -> ok when Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}].
uniformMatrix4x3dv(Location,Transpose,Value) ->
cast(5746, <<Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble,V7:?GLdouble,V8:?GLdouble,V9:?GLdouble,V10:?GLdouble,V11:?GLdouble,V12:?GLdouble>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer()) -> {float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniform.xml">external</a> documentation.
--spec getUniformdv(integer(),integer()) -> {float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}.
+%% @doc
+%% See {@link getUniformfv/2}
+-spec getUniformdv(Program, Location) -> matrix() when Program :: integer(),Location :: integer().
getUniformdv(Program,Location) ->
call(5747, <<Program:?GLuint,Location:?GLint>>).
-%% @spec (Program::integer(),Shadertype::enum(),Name::string()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetSubroutineUniformLocation.xml">external</a> documentation.
--spec getSubroutineUniformLocation(integer(),enum(),string()) -> integer().
+%% @doc Retrieve the location of a subroutine uniform of a given shader stage within a program
+%%
+%% ``gl:getSubroutineUniformLocation'' returns the location of the subroutine uniform variable
+%% `Name' in the shader stage of type `Shadertype' attached to `Program' ,
+%% with behavior otherwise identical to {@link gl:getUniformLocation/2} .
+%%
+%% If `Name' is not the name of a subroutine uniform in the shader stage, -1 is returned,
+%% but no error is generated. If `Name' is the name of a subroutine uniform in the shader
+%% stage, a value between zero and the value of `?GL_ACTIVE_SUBROUTINE_LOCATIONS' minus
+%% one will be returned. Subroutine locations are assigned using consecutive integers in
+%% the range from zero to the value of `?GL_ACTIVE_SUBROUTINE_LOCATIONS' minus one for
+%% the shader stage. For active subroutine uniforms declared as arrays, the declared array
+%% elements are assigned consecutive locations.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetSubroutineUniformLocation.xml">external</a> documentation.
+-spec getSubroutineUniformLocation(Program, Shadertype, Name) -> integer() when Program :: integer(),Shadertype :: enum(),Name :: string().
getSubroutineUniformLocation(Program,Shadertype,Name) ->
call(5748, <<Program:?GLuint,Shadertype:?GLenum,(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 1) rem 8)) rem 8)>>).
-%% @spec (Program::integer(),Shadertype::enum(),Name::string()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetSubroutineIndex.xml">external</a> documentation.
--spec getSubroutineIndex(integer(),enum(),string()) -> integer().
+%% @doc Retrieve the index of a subroutine uniform of a given shader stage within a program
+%%
+%% ``gl:getSubroutineIndex'' returns the index of a subroutine uniform within a shader
+%% stage attached to a program object. `Program' contains the name of the program to
+%% which the shader is attached. `Shadertype' specifies the stage from which to query
+%% shader subroutine index. `Name' contains the null-terminated name of the subroutine
+%% uniform whose name to query.
+%%
+%% If `Name' is not the name of a subroutine uniform in the shader stage, `?GL_INVALID_INDEX'
+%% is returned, but no error is generated. If `Name' is the name of a subroutine uniform
+%% in the shader stage, a value between zero and the value of `?GL_ACTIVE_SUBROUTINES'
+%% minus one will be returned. Subroutine indices are assigned using consecutive integers
+%% in the range from zero to the value of `?GL_ACTIVE_SUBROUTINES' minus one for the
+%% shader stage.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetSubroutineIndex.xml">external</a> documentation.
+-spec getSubroutineIndex(Program, Shadertype, Name) -> integer() when Program :: integer(),Shadertype :: enum(),Name :: string().
getSubroutineIndex(Program,Shadertype,Name) ->
call(5749, <<Program:?GLuint,Shadertype:?GLenum,(list_to_binary([Name|[0]]))/binary,0:((8-((length(Name)+ 1) rem 8)) rem 8)>>).
-%% @spec (Program::integer(),Shadertype::enum(),Index::integer(),Bufsize::integer()) -> string()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveSubroutineUniformName.xml">external</a> documentation.
--spec getActiveSubroutineUniformName(integer(),enum(),integer(),integer()) -> string().
+%% @doc Query the name of an active shader subroutine uniform
+%%
+%% ``gl:getActiveSubroutineUniformName'' retrieves the name of an active shader subroutine
+%% uniform. `Program' contains the name of the program containing the uniform. `Shadertype'
+%% specifies the stage for which which the uniform location, given by `Index' , is valid.
+%% `Index' must be between zero and the value of `?GL_ACTIVE_SUBROUTINE_UNIFORMS'
+%% minus one for the shader stage.
+%%
+%% The uniform name is returned as a null-terminated string in `Name' . The actual number
+%% of characters written into `Name' , excluding the null terminator is returned in `Length'
+%% . If `Length' is `?NULL', no length is returned. The maximum number of characters
+%% that may be written into `Name' , including the null terminator, is specified by `Bufsize'
+%% . The length of the longest subroutine uniform name in `Program' and `Shadertype'
+%% is given by the value of `?GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH', which can be
+%% queried with {@link gl:getProgramStageiv/3} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveSubroutineUniformName.xml">external</a> documentation.
+-spec getActiveSubroutineUniformName(Program, Shadertype, Index, Bufsize) -> string() when Program :: integer(),Shadertype :: enum(),Index :: integer(),Bufsize :: integer().
getActiveSubroutineUniformName(Program,Shadertype,Index,Bufsize) ->
call(5750, <<Program:?GLuint,Shadertype:?GLenum,Index:?GLuint,Bufsize:?GLsizei>>).
-%% @spec (Program::integer(),Shadertype::enum(),Index::integer(),Bufsize::integer()) -> string()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveSubroutineName.xml">external</a> documentation.
--spec getActiveSubroutineName(integer(),enum(),integer(),integer()) -> string().
+%% @doc Query the name of an active shader subroutine
+%%
+%% ``gl:getActiveSubroutineName'' queries the name of an active shader subroutine uniform
+%% from the program object given in `Program' . `Index' specifies the index of the
+%% shader subroutine uniform within the shader stage given by `Stage' , and must between
+%% zero and the value of `?GL_ACTIVE_SUBROUTINES' minus one for the shader stage.
+%%
+%% The name of the selected subroutine is returned as a null-terminated string in `Name'
+%% . The actual number of characters written into `Name' , not including the null-terminator,
+%% is is returned in `Length' . If `Length' is `?NULL', no length is returned.
+%% The maximum number of characters that may be written into `Name' , including the null-terminator,
+%% is given in `Bufsize' .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetActiveSubroutineName.xml">external</a> documentation.
+-spec getActiveSubroutineName(Program, Shadertype, Index, Bufsize) -> string() when Program :: integer(),Shadertype :: enum(),Index :: integer(),Bufsize :: integer().
getActiveSubroutineName(Program,Shadertype,Index,Bufsize) ->
call(5751, <<Program:?GLuint,Shadertype:?GLenum,Index:?GLuint,Bufsize:?GLsizei>>).
-%% @spec (Shadertype::enum(),Indices::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformSubroutines.xml">external</a> documentation.
--spec uniformSubroutinesuiv(enum(),[integer()]) -> ok.
+%% @doc Load active subroutine uniforms
+%%
+%% ``gl:uniformSubroutines'' loads all active subroutine uniforms for shader stage `Shadertype'
+%% of the current program with subroutine indices from `Indices' , storing `Indices[i]'
+%% into the uniform at location `I' . `Count' must be equal to the value of `?GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS'
+%% for the program currently in use at shader stage `Shadertype' . Furthermore, all
+%% values in `Indices' must be less than the value of `?GL_ACTIVE_SUBROUTINES'
+%% for the shader stage.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUniformSubroutines.xml">external</a> documentation.
+-spec uniformSubroutinesuiv(Shadertype, Indices) -> ok when Shadertype :: enum(),Indices :: [integer()].
uniformSubroutinesuiv(Shadertype,Indices) ->
cast(5752, <<Shadertype:?GLenum,(length(Indices)):?GLuint,
(<< <<C:?GLuint>> || C <- Indices>>)/binary,0:(((length(Indices)) rem 2)*32)>>).
-%% @spec (Shadertype::enum(),Location::integer()) -> {integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformSubroutine.xml">external</a> documentation.
--spec getUniformSubroutineuiv(enum(),integer()) -> {integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer()}.
+%% @doc Retrieve the value of a subroutine uniform of a given shader stage of the current program
+%%
+%% ``gl:getUniformSubroutine'' retrieves the value of the subroutine uniform at location `Location'
+%% for shader stage `Shadertype' of the current program. `Location' must be less
+%% than the value of `?GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS' for the shader currently
+%% in use at shader stage `Shadertype' . The value of the subroutine uniform is returned
+%% in `Values' .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetUniformSubroutine.xml">external</a> documentation.
+-spec getUniformSubroutineuiv(Shadertype, Location) -> {integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer(),integer()} when Shadertype :: enum(),Location :: integer().
getUniformSubroutineuiv(Shadertype,Location) ->
call(5753, <<Shadertype:?GLenum,Location:?GLint>>).
-%% @spec (Program::integer(),Shadertype::enum(),Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramStage.xml">external</a> documentation.
--spec getProgramStageiv(integer(),enum(),enum()) -> integer().
+%% @doc Retrieve properties of a program object corresponding to a specified shader stage
+%%
+%% ``gl:getProgramStage'' queries a parameter of a shader stage attached to a program object.
+%% `Program' contains the name of the program to which the shader is attached. `Shadertype'
+%% specifies the stage from which to query the parameter. `Pname' specifies which parameter
+%% should be queried. The value or values of the parameter to be queried is returned in the
+%% variable whose address is given in `Values' .
+%%
+%% If `Pname' is `?GL_ACTIVE_SUBROUTINE_UNIFORMS', the number of active subroutine
+%% variables in the stage is returned in `Values' .
+%%
+%% If `Pname' is `?GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS', the number of active
+%% subroutine variable locations in the stage is returned in `Values' .
+%%
+%% If `Pname' is `?GL_ACTIVE_SUBROUTINES', the number of active subroutines in
+%% the stage is returned in `Values' .
+%%
+%% If `Pname' is `?GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH', the length of the
+%% longest subroutine uniform for the stage is returned in `Values' .
+%%
+%% If `Pname' is `?GL_ACTIVE_SUBROUTINE_MAX_LENGTH', the length of the longest
+%% subroutine name for the stage is returned in `Values' . The returned name length includes
+%% space for the null-terminator.
+%%
+%% If there is no shader present of type `Shadertype' , the returned value will be consistent
+%% with a shader containing no subroutines or subroutine uniforms.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramStage.xml">external</a> documentation.
+-spec getProgramStageiv(Program, Shadertype, Pname) -> integer() when Program :: integer(),Shadertype :: enum(),Pname :: enum().
getProgramStageiv(Program,Shadertype,Pname) ->
call(5754, <<Program:?GLuint,Shadertype:?GLenum,Pname:?GLenum>>).
-%% @spec (Pname::enum(),Value::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPatchParameter.xml">external</a> documentation.
--spec patchParameteri(enum(),integer()) -> ok.
+%% @doc Specifies the parameters for patch primitives
+%%
+%% ``gl:patchParameter'' specifies the parameters that will be used for patch primitives. `Pname'
+%% specifies the parameter to modify and must be either `?GL_PATCH_VERTICES', `?GL_PATCH_DEFAULT_OUTER_LEVEL'
+%% or `?GL_PATCH_DEFAULT_INNER_LEVEL'. For ``gl:patchParameteri'', `Value' specifies
+%% the new value for the parameter specified by `Pname' . For ``gl:patchParameterfv'',
+%% `Values' specifies the address of an array containing the new values for the parameter
+%% specified by `Pname' .
+%%
+%% When `Pname' is `?GL_PATCH_VERTICES', `Value' specifies the number of
+%% vertices that will be used to make up a single patch primitive. Patch primitives are consumed
+%% by the tessellation control shader (if present) and subsequently used for tessellation.
+%% When primitives are specified using {@link gl:drawArrays/3} or a similar function, each
+%% patch will be made from `Parameter' control points, each represented by a vertex
+%% taken from the enabeld vertex arrays. `Parameter' must be greater than zero, and
+%% less than or equal to the value of `?GL_MAX_PATCH_VERTICES'.
+%%
+%% When `Pname' is `?GL_PATCH_DEFAULT_OUTER_LEVEL' or `?GL_PATCH_DEFAULT_INNER_LEVEL'
+%% , `Values' contains the address of an array contiaining the default outer or inner
+%% tessellation levels, respectively, to be used when no tessellation control shader is present.
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPatchParameter.xml">external</a> documentation.
+-spec patchParameteri(Pname, Value) -> ok when Pname :: enum(),Value :: integer().
patchParameteri(Pname,Value) ->
cast(5755, <<Pname:?GLenum,Value:?GLint>>).
-%% @spec (Pname::enum(),Values::[float()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPatchParameter.xml">external</a> documentation.
--spec patchParameterfv(enum(),[float()]) -> ok.
+%% @doc
+%% See {@link patchParameteri/2}
+-spec patchParameterfv(Pname, Values) -> ok when Pname :: enum(),Values :: [float()].
patchParameterfv(Pname,Values) ->
cast(5756, <<Pname:?GLenum,(length(Values)):?GLuint,
(<< <<C:?GLfloat>> || C <- Values>>)/binary,0:(((length(Values)) rem 2)*32)>>).
-%% @spec (Target::enum(),Id::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindTransformFeedback.xml">external</a> documentation.
--spec bindTransformFeedback(enum(),integer()) -> ok.
+%% @doc Bind a transform feedback object
+%%
+%% ``gl:bindTransformFeedback'' binds the transform feedback object with name `Id'
+%% to the current GL state. `Id' must be a name previously returned from a call to {@link gl:genTransformFeedbacks/1}
+%% . If `Id' has not previously been bound, a new transform feedback object with name `Id'
+%% and initialized with with the default transform state vector is created.
+%%
+%% In the initial state, a default transform feedback object is bound and treated as a transform
+%% feedback object with a name of zero. If the name zero is subsequently bound, the default
+%% transform feedback object is again bound to the GL state.
+%%
+%% While a transform feedback buffer object is bound, GL operations on the target to which
+%% it is bound affect the bound transform feedback object, and queries of the target to which
+%% a transform feedback object is bound return state from the bound object. When buffer objects
+%% are bound for transform feedback, they are attached to the currently bound transform feedback
+%% object. Buffer objects are used for trans- form feedback only if they are attached to
+%% the currently bound transform feedback object.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindTransformFeedback.xml">external</a> documentation.
+-spec bindTransformFeedback(Target, Id) -> ok when Target :: enum(),Id :: integer().
bindTransformFeedback(Target,Id) ->
cast(5757, <<Target:?GLenum,Id:?GLuint>>).
-%% @spec (Ids::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteTransformFeedbacks.xml">external</a> documentation.
--spec deleteTransformFeedbacks([integer()]) -> ok.
+%% @doc Delete transform feedback objects
+%%
+%% ``gl:deleteTransformFeedbacks'' deletes the `N' transform feedback objects whose
+%% names are stored in the array `Ids' . Unused names in `Ids' are ignored, as is
+%% the name zero. After a transform feedback object is deleted, its name is again unused
+%% and it has no contents. If an active transform feedback object is deleted, its name immediately
+%% becomes unused, but the underlying object is not deleted until it is no longer active.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteTransformFeedbacks.xml">external</a> documentation.
+-spec deleteTransformFeedbacks(Ids) -> ok when Ids :: [integer()].
deleteTransformFeedbacks(Ids) ->
cast(5758, <<(length(Ids)):?GLuint,
(<< <<C:?GLuint>> || C <- Ids>>)/binary,0:(((1+length(Ids)) rem 2)*32)>>).
-%% @spec (N::integer()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenTransformFeedbacks.xml">external</a> documentation.
--spec genTransformFeedbacks(integer()) -> [integer()].
+%% @doc Reserve transform feedback object names
+%%
+%% ``gl:genTransformFeedbacks'' returns `N' previously unused transform feedback object
+%% names in `Ids' . These names are marked as used, for the purposes of ``gl:genTransformFeedbacks''
+%% only, but they acquire transform feedback state only when they are first bound.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenTransformFeedbacks.xml">external</a> documentation.
+-spec genTransformFeedbacks(N) -> [integer()] when N :: integer().
genTransformFeedbacks(N) ->
call(5759, <<N:?GLsizei>>).
-%% @spec (Id::integer()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsTransformFeedback.xml">external</a> documentation.
--spec isTransformFeedback(integer()) -> 0|1.
+%% @doc Determine if a name corresponds to a transform feedback object
+%%
+%% ``gl:isTransformFeedback'' returns `?GL_TRUE' if `Id' is currently the name
+%% of a transform feedback object. If `Id' is zero, or if `?id' is not the name
+%% of a transform feedback object, or if an error occurs, ``gl:isTransformFeedback'' returns
+%% `?GL_FALSE'. If `Id' is a name returned by {@link gl:genTransformFeedbacks/1} ,
+%% but that has not yet been bound through a call to {@link gl:bindTransformFeedback/2} , then
+%% the name is not a transform feedback object and ``gl:isTransformFeedback'' returns `?GL_FALSE'
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsTransformFeedback.xml">external</a> documentation.
+-spec isTransformFeedback(Id) -> 0|1 when Id :: integer().
isTransformFeedback(Id) ->
call(5760, <<Id:?GLuint>>).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPauseTransformFeedback.xml">external</a> documentation.
+%% @doc Pause transform feedback operations
+%%
+%% ``gl:pauseTransformFeedback'' pauses transform feedback operations on the currently
+%% active transform feedback object. When transform feedback operations are paused, transform
+%% feedback is still considered active and changing most transform feedback state related
+%% to the object results in an error. However, a new transform feedback object may be bound
+%% while transform feedback is paused.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glPauseTransformFeedback.xml">external</a> documentation.
-spec pauseTransformFeedback() -> ok.
pauseTransformFeedback() ->
cast(5761, <<>>).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glResumeTransformFeedback.xml">external</a> documentation.
+%% @doc Resume transform feedback operations
+%%
+%% ``gl:resumeTransformFeedback'' resumes transform feedback operations on the currently
+%% active transform feedback object. When transform feedback operations are paused, transform
+%% feedback is still considered active and changing most transform feedback state related
+%% to the object results in an error. However, a new transform feedback object may be bound
+%% while transform feedback is paused.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glResumeTransformFeedback.xml">external</a> documentation.
-spec resumeTransformFeedback() -> ok.
resumeTransformFeedback() ->
cast(5762, <<>>).
-%% @spec (Mode::enum(),Id::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawTransformFeedback.xml">external</a> documentation.
--spec drawTransformFeedback(enum(),integer()) -> ok.
+%% @doc Render primitives using a count derived from a transform feedback object
+%%
+%% ``gl:drawTransformFeedback'' draws primitives of a type specified by `Mode' using
+%% a count retrieved from the transform feedback specified by `Id' . Calling ``gl:drawTransformFeedback''
+%% is equivalent to calling {@link gl:drawArrays/3} with `Mode' as specified, `First'
+%% set to zero, and `Count' set to the number of vertices captured on vertex stream
+%% zero the last time transform feedback was active on the transform feedback object named
+%% by `Id' .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawTransformFeedback.xml">external</a> documentation.
+-spec drawTransformFeedback(Mode, Id) -> ok when Mode :: enum(),Id :: integer().
drawTransformFeedback(Mode,Id) ->
cast(5763, <<Mode:?GLenum,Id:?GLuint>>).
-%% @spec (Mode::enum(),Id::integer(),Stream::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawTransformFeedbackStream.xml">external</a> documentation.
--spec drawTransformFeedbackStream(enum(),integer(),integer()) -> ok.
+%% @doc Render primitives using a count derived from a specifed stream of a transform feedback object
+%%
+%% ``gl:drawTransformFeedbackStream'' draws primitives of a type specified by `Mode'
+%% using a count retrieved from the transform feedback stream specified by `Stream'
+%% of the transform feedback object specified by `Id' . Calling ``gl:drawTransformFeedbackStream''
+%% is equivalent to calling {@link gl:drawArrays/3} with `Mode' as specified, `First'
+%% set to zero, and `Count' set to the number of vertices captured on vertex stream `Stream'
+%% the last time transform feedback was active on the transform feedback object named by `Id'
+%% .
+%%
+%% Calling {@link gl:drawTransformFeedback/2} is equivalent to calling ``gl:drawTransformFeedbackStream''
+%% with `Stream' set to zero.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawTransformFeedbackStream.xml">external</a> documentation.
+-spec drawTransformFeedbackStream(Mode, Id, Stream) -> ok when Mode :: enum(),Id :: integer(),Stream :: integer().
drawTransformFeedbackStream(Mode,Id,Stream) ->
cast(5764, <<Mode:?GLenum,Id:?GLuint,Stream:?GLuint>>).
-%% @spec (Target::enum(),Index::integer(),Id::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBeginQueryIndexe.xml">external</a> documentation.
--spec beginQueryIndexed(enum(),integer(),integer()) -> ok.
+%% @doc glBeginQueryIndexe
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBeginQueryIndexe.xml">external</a> documentation.
+-spec beginQueryIndexed(Target, Index, Id) -> ok when Target :: enum(),Index :: integer(),Id :: integer().
beginQueryIndexed(Target,Index,Id) ->
cast(5765, <<Target:?GLenum,Index:?GLuint,Id:?GLuint>>).
-%% @spec (Target::enum(),Index::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glEndQueryIndexe.xml">external</a> documentation.
--spec endQueryIndexed(enum(),integer()) -> ok.
+%% @doc Delimit the boundaries of a query object on an indexed target
+%%
+%% ``gl:beginQueryIndexed'' and {@link gl:endQueryIndexed/2} delimit the boundaries of a
+%% query object. `Query' must be a name previously returned from a call to {@link gl:genQueries/1}
+%% . If a query object with name `Id' does not yet exist it is created with the type
+%% determined by `Target' . `Target' must be one of `?GL_SAMPLES_PASSED', `?GL_ANY_SAMPLES_PASSED'
+%% , `?GL_PRIMITIVES_GENERATED', `?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN', or `?GL_TIME_ELAPSED'
+%% . The behavior of the query object depends on its type and is as follows.
+%%
+%% `Index' specifies the index of the query target and must be between a `Target' -specific
+%% maximum.
+%%
+%% If `Target' is `?GL_SAMPLES_PASSED', `Id' must be an unused name, or the
+%% name of an existing occlusion query object. When ``gl:beginQueryIndexed'' is executed,
+%% the query object's samples-passed counter is reset to 0. Subsequent rendering will increment
+%% the counter for every sample that passes the depth test. If the value of `?GL_SAMPLE_BUFFERS'
+%% is 0, then the samples-passed count is incremented by 1 for each fragment. If the value
+%% of `?GL_SAMPLE_BUFFERS' is 1, then the samples-passed count is incremented by the
+%% number of samples whose coverage bit is set. However, implementations, at their discression
+%% may instead increase the samples-passed count by the value of `?GL_SAMPLES' if any
+%% sample in the fragment is covered. When ``gl:endQueryIndexed'' is executed, the samples-passed
+%% counter is assigned to the query object's result value. This value can be queried by calling
+%% {@link gl:getQueryObjectiv/2} with `Pname' `?GL_QUERY_RESULT'. When `Target'
+%% is `?GL_SAMPLES_PASSED', `Index' must be zero.
+%%
+%% If `Target' is `?GL_ANY_SAMPLES_PASSED', `Id' must be an unused name,
+%% or the name of an existing boolean occlusion query object. When ``gl:beginQueryIndexed''
+%% is executed, the query object's samples-passed flag is reset to `?GL_FALSE'. Subsequent
+%% rendering causes the flag to be set to `?GL_TRUE' if any sample passes the depth
+%% test. When ``gl:endQueryIndexed'' is executed, the samples-passed flag is assigned to
+%% the query object's result value. This value can be queried by calling {@link gl:getQueryObjectiv/2}
+%% with `Pname' `?GL_QUERY_RESULT'. When `Target' is `?GL_ANY_SAMPLES_PASSED'
+%% , `Index' must be zero.
+%%
+%% If `Target' is `?GL_PRIMITIVES_GENERATED', `Id' must be an unused name,
+%% or the name of an existing primitive query object previously bound to the `?GL_PRIMITIVES_GENERATED'
+%% query binding. When ``gl:beginQueryIndexed'' is executed, the query object's primitives-generated
+%% counter is reset to 0. Subsequent rendering will increment the counter once for every
+%% vertex that is emitted from the geometry shader to the stream given by `Index' , or
+%% from the vertex shader if `Index' is zero and no geometry shader is present. When ``gl:endQueryIndexed''
+%% is executed, the primitives-generated counter for stream `Index' is assigned to
+%% the query object's result value. This value can be queried by calling {@link gl:getQueryObjectiv/2}
+%% with `Pname' `?GL_QUERY_RESULT'. When `Target' is `?GL_PRIMITIVES_GENERATED'
+%% , `Index' must be less than the value of `?GL_MAX_VERTEX_STREAMS'.
+%%
+%% If `Target' is `?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN', `Id' must
+%% be an unused name, or the name of an existing primitive query object previously bound
+%% to the `?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN' query binding. When ``gl:beginQueryIndexed''
+%% is executed, the query object's primitives-written counter for the stream specified by `Index'
+%% is reset to 0. Subsequent rendering will increment the counter once for every vertex
+%% that is written into the bound transform feedback buffer(s) for stream `Index' . If
+%% transform feedback mode is not activated between the call to ``gl:beginQueryIndexed''
+%% and ``gl:endQueryIndexed'', the counter will not be incremented. When ``gl:endQueryIndexed''
+%% is executed, the primitives-written counter for stream `Index' is assigned to the
+%% query object's result value. This value can be queried by calling {@link gl:getQueryObjectiv/2}
+%% with `Pname' `?GL_QUERY_RESULT'. When `Target' is `?GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN'
+%% , `Index' must be less than the value of `?GL_MAX_VERTEX_STREAMS'.
+%%
+%% If `Target' is `?GL_TIME_ELAPSED', `Id' must be an unused name, or the
+%% name of an existing timer query object previously bound to the `?GL_TIME_ELAPSED'
+%% query binding. When ``gl:beginQueryIndexed'' is executed, the query object's time counter
+%% is reset to 0. When ``gl:endQueryIndexed'' is executed, the elapsed server time that
+%% has passed since the call to ``gl:beginQueryIndexed'' is written into the query object's
+%% time counter. This value can be queried by calling {@link gl:getQueryObjectiv/2} with `Pname'
+%% `?GL_QUERY_RESULT'. When `Target' is `?GL_TIME_ELAPSED', `Index' must
+%% be zero.
+%%
+%% Querying the `?GL_QUERY_RESULT' implicitly flushes the GL pipeline until the rendering
+%% delimited by the query object has completed and the result is available. `?GL_QUERY_RESULT_AVAILABLE'
+%% can be queried to determine if the result is immediately available or if the rendering
+%% is not yet complete.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBeginQueryIndexed.xml">external</a> documentation.
+-spec endQueryIndexed(Target, Index) -> ok when Target :: enum(),Index :: integer().
endQueryIndexed(Target,Index) ->
cast(5766, <<Target:?GLenum,Index:?GLuint>>).
-%% @spec (Target::enum(),Index::integer(),Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetQueryIndexed.xml">external</a> documentation.
--spec getQueryIndexediv(enum(),integer(),enum()) -> integer().
+%% @doc Return parameters of an indexed query object target
+%%
+%% ``gl:getQueryIndexediv'' returns in `Params' a selected parameter of the indexed
+%% query object target specified by `Target' and `Index' . `Index' specifies
+%% the index of the query object target and must be between zero and a target-specific maxiumum.
+%%
+%%
+%% `Pname' names a specific query object target parameter. When `Pname' is `?GL_CURRENT_QUERY'
+%% , the name of the currently active query for the specified `Index' of `Target' ,
+%% or zero if no query is active, will be placed in `Params' . If `Pname' is `?GL_QUERY_COUNTER_BITS'
+%% , the implementation-dependent number of bits used to hold the result of queries for `Target'
+%% is returned in `Params' .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetQueryIndexed.xml">external</a> documentation.
+-spec getQueryIndexediv(Target, Index, Pname) -> integer() when Target :: enum(),Index :: integer(),Pname :: enum().
getQueryIndexediv(Target,Index,Pname) ->
call(5767, <<Target:?GLenum,Index:?GLuint,Pname:?GLenum>>).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glReleaseShaderCompiler.xml">external</a> documentation.
+%% @doc Release resources consumed by the implementation's shader compiler
+%%
+%% ``gl:releaseShaderCompiler'' provides a hint to the implementation that it may free
+%% internal resources associated with its shader compiler. {@link gl:compileShader/1} may
+%% subsequently be called and the implementation may at that time reallocate resources previously
+%% freed by the call to ``gl:releaseShaderCompiler''.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glReleaseShaderCompiler.xml">external</a> documentation.
-spec releaseShaderCompiler() -> ok.
releaseShaderCompiler() ->
cast(5768, <<>>).
-%% @spec (Shaders::[integer()],Binaryformat::enum(),Binary::binary()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glShaderBinary.xml">external</a> documentation.
--spec shaderBinary([integer()],enum(),binary()) -> ok.
+%% @doc Load pre-compiled shader binaries
+%%
+%% ``gl:shaderBinary'' loads pre-compiled shader binary code into the `Count' shader
+%% objects whose handles are given in `Shaders' . `Binary' points to `Length'
+%% bytes of binary shader code stored in client memory. `BinaryFormat' specifies the
+%% format of the pre-compiled code.
+%%
+%% The binary image contained in `Binary' will be decoded according to the extension
+%% specification defining the specified `BinaryFormat' token. OpenGL does not define
+%% any specific binary formats, but it does provide a mechanism to obtain token vaues for
+%% such formats provided by such extensions.
+%%
+%% Depending on the types of the shader objects in `Shaders' , ``gl:shaderBinary''
+%% will individually load binary vertex or fragment shaders, or load an executable binary
+%% that contains an optimized pair of vertex and fragment shaders stored in the same binary.
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glShaderBinary.xml">external</a> documentation.
+-spec shaderBinary(Shaders, Binaryformat, Binary) -> ok when Shaders :: [integer()],Binaryformat :: enum(),Binary :: binary().
shaderBinary(Shaders,Binaryformat,Binary) ->
send_bin(Binary),
cast(5769, <<(length(Shaders)):?GLuint,
(<< <<C:?GLuint>> || C <- Shaders>>)/binary,0:(((1+length(Shaders)) rem 2)*32),Binaryformat:?GLenum>>).
-%% @spec (Shadertype::enum(),Precisiontype::enum()) -> {Range::{integer(),integer()},Precision::integer()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetShaderPrecisionFormat.xml">external</a> documentation.
--spec getShaderPrecisionFormat(enum(),enum()) -> {{integer(),integer()},integer()}.
+%% @doc Retrieve the range and precision for numeric formats supported by the shader compiler
+%%
+%% ``gl:getShaderPrecisionFormat'' retrieves the numeric range and precision for the implementation's
+%% representation of quantities in different numeric formats in specified shader type. `ShaderType'
+%% specifies the type of shader for which the numeric precision and range is to be retrieved
+%% and must be one of `?GL_VERTEX_SHADER' or `?GL_FRAGMENT_SHADER'. `PrecisionType'
+%% specifies the numeric format to query and must be one of `?GL_LOW_FLOAT', `?GL_MEDIUM_FLOAT'
+%% `?GL_HIGH_FLOAT', `?GL_LOW_INT', `?GL_MEDIUM_INT', or `?GL_HIGH_INT'.
+%%
+%%
+%% `Range' points to an array of two integers into which the format's numeric range
+%% will be returned. If min and max are the smallest values representable in the format,
+%% then the values returned are defined to be: `Range' [0] = floor(log2(|min|)) and `Range'
+%% [1] = floor(log2(|max|)).
+%%
+%% `Precision' specifies the address of an integer into which will be written the log2
+%% value of the number of bits of precision of the format. If the smallest representable
+%% value greater than 1 is 1 + `eps', then the integer addressed by `Precision'
+%% will contain floor(-log2(eps)).
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetShaderPrecisionFormat.xml">external</a> documentation.
+-spec getShaderPrecisionFormat(Shadertype, Precisiontype) -> {Range :: {integer(),integer()},Precision :: integer()} when Shadertype :: enum(),Precisiontype :: enum().
getShaderPrecisionFormat(Shadertype,Precisiontype) ->
call(5770, <<Shadertype:?GLenum,Precisiontype:?GLenum>>).
-%% @spec (N::clamp(),F::clamp()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDepthRange.xml">external</a> documentation.
--spec depthRangef(clamp(),clamp()) -> ok.
+%% @doc
+%% See {@link depthRange/2}
+-spec depthRangef(N, F) -> ok when N :: clamp(),F :: clamp().
depthRangef(N,F) ->
cast(5771, <<N:?GLclampf,F:?GLclampf>>).
-%% @spec (D::clamp()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearDepthf.xml">external</a> documentation.
--spec clearDepthf(clamp()) -> ok.
+%% @doc glClearDepthf
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glClearDepthf.xml">external</a> documentation.
+-spec clearDepthf(D) -> ok when D :: clamp().
clearDepthf(D) ->
cast(5772, <<D:?GLclampf>>).
-%% @spec (Program::integer(),BufSize::integer()) -> {BinaryFormat::enum(),Binary::binary()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramBinary.xml">external</a> documentation.
--spec getProgramBinary(integer(),integer()) -> {enum(),binary()}.
+%% @doc Return a binary representation of a program object's compiled and linked executable source
+%%
+%% ``gl:getProgramBinary'' returns a binary representation of the compiled and linked executable
+%% for `Program' into the array of bytes whose address is specified in `Binary' .
+%% The maximum number of bytes that may be written into `Binary' is specified by `BufSize'
+%% . If the program binary is greater in size than `BufSize' bytes, then an error is
+%% generated, otherwise the actual number of bytes written into `Binary' is returned
+%% in the variable whose address is given by `Length' . If `Length' is `?NULL',
+%% then no length is returned.
+%%
+%% The format of the program binary written into `Binary' is returned in the variable
+%% whose address is given by `BinaryFormat' , and may be implementation dependent. The
+%% binary produced by the GL may subsequently be returned to the GL by calling {@link gl:programBinary/3}
+%% , with `BinaryFormat' and `Length' set to the values returned by ``gl:getProgramBinary''
+%% , and passing the returned binary data in the `Binary' parameter.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramBinary.xml">external</a> documentation.
+-spec getProgramBinary(Program, BufSize) -> {BinaryFormat :: enum(),Binary :: binary()} when Program :: integer(),BufSize :: integer().
getProgramBinary(Program,BufSize) ->
call(5773, <<Program:?GLuint,BufSize:?GLsizei>>).
-%% @spec (Program::integer(),BinaryFormat::enum(),Binary::binary()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramBinary.xml">external</a> documentation.
--spec programBinary(integer(),enum(),binary()) -> ok.
+%% @doc Load a program object with a program binary
+%%
+%% ``gl:programBinary'' loads a program object with a program binary previously returned
+%% from {@link gl:getProgramBinary/2} . `BinaryFormat' and `Binary' must be those
+%% returned by a previous call to {@link gl:getProgramBinary/2} , and `Length' must be
+%% the length returned by {@link gl:getProgramBinary/2} , or by {@link gl:getProgramiv/2} when
+%% called with `Pname' set to `?GL_PROGRAM_BINARY_LENGTH'. If these conditions
+%% are not met, loading the program binary will fail and `Program' 's `?GL_LINK_STATUS'
+%% will be set to `?GL_FALSE'.
+%%
+%% A program object's program binary is replaced by calls to {@link gl:linkProgram/1} or ``gl:programBinary''
+%% . When linking success or failure is concerned, ``gl:programBinary'' can be considered
+%% to perform an implicit linking operation. {@link gl:linkProgram/1} and ``gl:programBinary''
+%% both set the program object's `?GL_LINK_STATUS' to `?GL_TRUE' or `?GL_FALSE'
+%% .
+%%
+%% A successful call to ``gl:programBinary'' will reset all uniform variables to their
+%% initial values. The initial value is either the value of the variable's initializer as
+%% specified in the original shader source, or zero if no initializer was present. Additionally,
+%% all vertex shader input and fragment shader output assignments that were in effect when
+%% the program was linked before saving are restored with ``gl:programBinary'' is called.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramBinary.xml">external</a> documentation.
+-spec programBinary(Program, BinaryFormat, Binary) -> ok when Program :: integer(),BinaryFormat :: enum(),Binary :: binary().
programBinary(Program,BinaryFormat,Binary) ->
send_bin(Binary),
cast(5774, <<Program:?GLuint,BinaryFormat:?GLenum>>).
-%% @spec (Program::integer(),Pname::enum(),Value::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramParameter.xml">external</a> documentation.
--spec programParameteri(integer(),enum(),integer()) -> ok.
+%% @doc Specify a parameter for a program object
+%%
+%% ``gl:programParameter'' specifies a new value for the parameter nameed by `Pname'
+%% for the program object `Program' .
+%%
+%% If `Pname' is `?GL_PROGRAM_BINARY_RETRIEVABLE_HINT', `Value' should be `?GL_FALSE'
+%% or `?GL_TRUE' to indicate to the implementation the intention of the application
+%% to retrieve the program's binary representation with {@link gl:getProgramBinary/2} . The
+%% implementation may use this information to store information that may be useful for a
+%% future query of the program's binary. It is recommended to set `?GL_PROGRAM_BINARY_RETRIEVABLE_HINT'
+%% for the program to `?GL_TRUE' before calling {@link gl:linkProgram/1} , and using
+%% the program at run-time if the binary is to be retrieved later.
+%%
+%% If `Pname' is `?GL_PROGRAM_SEPARABLE', `Value' must be `?GL_TRUE'
+%% or `?GL_FALSE' and indicates whether `Program' can be bound to individual pipeline
+%% stages via {@link gl:useProgramStages/3} . A program's `?GL_PROGRAM_SEPARABLE' parameter
+%% must be set to `?GL_TRUE'`before' {@link gl:linkProgram/1} is called in order
+%% for it to be usable with a program pipeline object. The initial state of `?GL_PROGRAM_SEPARABLE'
+%% is `?GL_FALSE'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramParameter.xml">external</a> documentation.
+-spec programParameteri(Program, Pname, Value) -> ok when Program :: integer(),Pname :: enum(),Value :: integer().
programParameteri(Program,Pname,Value) ->
cast(5775, <<Program:?GLuint,Pname:?GLenum,Value:?GLint>>).
-%% @spec (Pipeline::integer(),Stages::integer(),Program::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUseProgramStages.xml">external</a> documentation.
--spec useProgramStages(integer(),integer(),integer()) -> ok.
+%% @doc Bind stages of a program object to a program pipeline
+%%
+%% ``gl:useProgramStages'' binds executables from a program object associated with a specified
+%% set of shader stages to the program pipeline object given by `Pipeline' . `Pipeline'
+%% specifies the program pipeline object to which to bind the executables. `Stages'
+%% contains a logical combination of bits indicating the shader stages to use within `Program'
+%% with the program pipeline object `Pipeline' . `Stages' must be a logical combination
+%% of `?GL_VERTEX_SHADER_BIT', `?GL_TESS_CONTROL_SHADER_BIT', `?GL_TESS_EVALUATION_SHADER_BIT'
+%% , `?GL_GEOMETRY_SHADER_BIT', and `?GL_FRAGMENT_SHADER_BIT'. Additionally, the
+%% special value `?GL_ALL_SHADER_BITS' may be specified to indicate that all executables
+%% contained in `Program' should be installed in `Pipeline' .
+%%
+%% If `Program' refers to a program object with a valid shader attached for an indicated
+%% shader stage, ``gl:useProgramStages'' installs the executable code for that stage in
+%% the indicated program pipeline object `Pipeline' . If `Program' is zero, or refers
+%% to a program object with no valid shader executable for a given stage, it is as if the
+%% pipeline object has no programmable stage configured for the indicated shader stages. If `Stages'
+%% contains bits other than those listed above, and is not equal to `?GL_ALL_SHADER_BITS'
+%% , an error is generated.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glUseProgramStages.xml">external</a> documentation.
+-spec useProgramStages(Pipeline, Stages, Program) -> ok when Pipeline :: integer(),Stages :: integer(),Program :: integer().
useProgramStages(Pipeline,Stages,Program) ->
cast(5776, <<Pipeline:?GLuint,Stages:?GLbitfield,Program:?GLuint>>).
-%% @spec (Pipeline::integer(),Program::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glActiveShaderProgram.xml">external</a> documentation.
--spec activeShaderProgram(integer(),integer()) -> ok.
+%% @doc Set the active program object for a program pipeline object
+%%
+%% ``gl:activeShaderProgram'' sets the linked program named by `Program' to be the
+%% active program for the program pipeline object `Pipeline' . The active program in
+%% the active program pipeline object is the target of calls to {@link gl:uniform1f/2} when
+%% no program has been made current through a call to {@link gl:useProgram/1} .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glActiveShaderProgram.xml">external</a> documentation.
+-spec activeShaderProgram(Pipeline, Program) -> ok when Pipeline :: integer(),Program :: integer().
activeShaderProgram(Pipeline,Program) ->
cast(5777, <<Pipeline:?GLuint,Program:?GLuint>>).
-%% @spec (Type::enum(),Strings::[string()]) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCreateShaderProgramv.xml">external</a> documentation.
--spec createShaderProgramv(enum(),[string()]) -> integer().
+%% @doc glCreateShaderProgramv
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glCreateShaderProgramv.xml">external</a> documentation.
+-spec createShaderProgramv(Type, Strings) -> integer() when Type :: enum(),Strings :: [string()].
createShaderProgramv(Type,Strings) ->
StringsTemp = list_to_binary([[Str|[0]] || Str <- Strings ]),
call(5778, <<Type:?GLenum,(length(Strings)):?GLuint,(size(StringsTemp)):?GLuint,(StringsTemp)/binary,0:((8-((size(StringsTemp)+0) rem 8)) rem 8)>>).
-%% @spec (Pipeline::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindProgramPipeline.xml">external</a> documentation.
--spec bindProgramPipeline(integer()) -> ok.
+%% @doc Bind a program pipeline to the current context
+%%
+%% ``gl:bindProgramPipeline'' binds a program pipeline object to the current context. `Pipeline'
+%% must be a name previously returned from a call to {@link gl:genProgramPipelines/1} . If
+%% no program pipeline exists with name `Pipeline' then a new pipeline object is created
+%% with that name and initialized to the default state vector.
+%%
+%% When a program pipeline object is bound using ``gl:bindProgramPipeline'', any previous
+%% binding is broken and is replaced with a binding to the specified pipeline object. If `Pipeline'
+%% is zero, the previous binding is broken and is not replaced, leaving no pipeline object
+%% bound. If no current program object has been established by {@link gl:useProgram/1} , the
+%% program objects used for each stage and for uniform updates are taken from the bound program
+%% pipeline object, if any. If there is a current program object established by {@link gl:useProgram/1}
+%% , the bound program pipeline object has no effect on rendering or uniform updates. When
+%% a bound program pipeline object is used for rendering, individual shader executables are
+%% taken from its program objects.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindProgramPipeline.xml">external</a> documentation.
+-spec bindProgramPipeline(Pipeline) -> ok when Pipeline :: integer().
bindProgramPipeline(Pipeline) ->
cast(5779, <<Pipeline:?GLuint>>).
-%% @spec (Pipelines::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteProgramPipelines.xml">external</a> documentation.
--spec deleteProgramPipelines([integer()]) -> ok.
+%% @doc Delete program pipeline objects
+%%
+%% ``gl:deleteProgramPipelines'' deletes the `N' program pipeline objects whose names
+%% are stored in the array `Pipelines' . Unused names in `Pipelines' are ignored,
+%% as is the name zero. After a program pipeline object is deleted, its name is again unused
+%% and it has no contents. If program pipeline object that is currently bound is deleted,
+%% the binding for that object reverts to zero and no program pipeline object becomes current.
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDeleteProgramPipelines.xml">external</a> documentation.
+-spec deleteProgramPipelines(Pipelines) -> ok when Pipelines :: [integer()].
deleteProgramPipelines(Pipelines) ->
cast(5780, <<(length(Pipelines)):?GLuint,
(<< <<C:?GLuint>> || C <- Pipelines>>)/binary,0:(((1+length(Pipelines)) rem 2)*32)>>).
-%% @spec (N::integer()) -> [integer()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenProgramPipelines.xml">external</a> documentation.
--spec genProgramPipelines(integer()) -> [integer()].
+%% @doc Reserve program pipeline object names
+%%
+%% ``gl:genProgramPipelines'' returns `N' previously unused program pipeline object
+%% names in `Pipelines' . These names are marked as used, for the purposes of ``gl:genProgramPipelines''
+%% only, but they acquire program pipeline state only when they are first bound.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGenProgramPipelines.xml">external</a> documentation.
+-spec genProgramPipelines(N) -> [integer()] when N :: integer().
genProgramPipelines(N) ->
call(5781, <<N:?GLsizei>>).
-%% @spec (Pipeline::integer()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsProgramPipeline.xml">external</a> documentation.
--spec isProgramPipeline(integer()) -> 0|1.
+%% @doc Determine if a name corresponds to a program pipeline object
+%%
+%% ``gl:isProgramPipeline'' returns `?GL_TRUE' if `Pipeline' is currently the
+%% name of a program pipeline object. If `Pipeline' is zero, or if `?pipeline'
+%% is not the name of a program pipeline object, or if an error occurs, ``gl:isProgramPipeline''
+%% returns `?GL_FALSE'. If `Pipeline' is a name returned by {@link gl:genProgramPipelines/1}
+%% , but that has not yet been bound through a call to {@link gl:bindProgramPipeline/1} , then
+%% the name is not a program pipeline object and ``gl:isProgramPipeline'' returns `?GL_FALSE'
+%% .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glIsProgramPipeline.xml">external</a> documentation.
+-spec isProgramPipeline(Pipeline) -> 0|1 when Pipeline :: integer().
isProgramPipeline(Pipeline) ->
call(5782, <<Pipeline:?GLuint>>).
-%% @spec (Pipeline::integer(),Pname::enum()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramPipeline.xml">external</a> documentation.
--spec getProgramPipelineiv(integer(),enum()) -> integer().
+%% @doc Retrieve properties of a program pipeline object
+%%
+%% ``gl:getProgramPipelineiv'' retrieves the value of a property of the program pipeline
+%% object `Pipeline' . `Pname' specifies the name of the parameter whose value to
+%% retrieve. The value of the parameter is written to the variable whose address is given
+%% by `Params' .
+%%
+%% If `Pname' is `?GL_ACTIVE_PROGRAM', the name of the active program object of
+%% the program pipeline object is returned in `Params' .
+%%
+%% If `Pname' is `?GL_VERTEX_SHADER', the name of the current program object for
+%% the vertex shader type of the program pipeline object is returned in `Params' .
+%%
+%% If `Pname' is `?GL_TESS_CONTROL_SHADER', the name of the current program object
+%% for the tessellation control shader type of the program pipeline object is returned in `Params'
+%% .
+%%
+%% If `Pname' is `?GL_TESS_EVALUATION_SHADER', the name of the current program
+%% object for the tessellation evaluation shader type of the program pipeline object is returned
+%% in `Params' .
+%%
+%% If `Pname' is `?GL_GEOMETRY_SHADER', the name of the current program object
+%% for the geometry shader type of the program pipeline object is returned in `Params' .
+%%
+%%
+%% If `Pname' is `?GL_FRAGMENT_SHADER', the name of the current program object
+%% for the fragment shader type of the program pipeline object is returned in `Params' .
+%%
+%%
+%% If `Pname' is `?GL_INFO_LOG_LENGTH', the length of the info log, including
+%% the null terminator, is returned in `Params' . If there is no info log, zero is returned.
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramPipeline.xml">external</a> documentation.
+-spec getProgramPipelineiv(Pipeline, Pname) -> integer() when Pipeline :: integer(),Pname :: enum().
getProgramPipelineiv(Pipeline,Pname) ->
call(5783, <<Pipeline:?GLuint,Pname:?GLenum>>).
-%% @spec (Program::integer(),Location::integer(),V0::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform1i(integer(),integer(),integer()) -> ok.
+%% @doc Specify the value of a uniform variable for a specified program object
+%%
+%% ``gl:programUniform'' modifies the value of a uniform variable or a uniform variable
+%% array. The location of the uniform variable to be modified is specified by `Location' ,
+%% which should be a value returned by {@link gl:getUniformLocation/2} . ``gl:programUniform''
+%% operates on the program object specified by `Program' .
+%%
+%% The commands ``gl:programUniform{1|2|3|4}{f|i|ui}'' are used to change the value of
+%% the uniform variable specified by `Location' using the values passed as arguments.
+%% The number specified in the command should match the number of components in the data
+%% type of the specified uniform variable (e.g., `1' for float, int, unsigned int, bool;
+%% `2' for vec2, ivec2, uvec2, bvec2, etc.). The suffix `f' indicates that floating-point
+%% values are being passed; the suffix `i' indicates that integer values are being passed;
+%% the suffix `ui' indicates that unsigned integer values are being passed, and this
+%% type should also match the data type of the specified uniform variable. The `i' variants
+%% of this function should be used to provide values for uniform variables defined as int, ivec2
+%% , ivec3, ivec4, or arrays of these. The `ui' variants of this function should be
+%% used to provide values for uniform variables defined as unsigned int, uvec2, uvec3, uvec4,
+%% or arrays of these. The `f' variants should be used to provide values for uniform
+%% variables of type float, vec2, vec3, vec4, or arrays of these. Either the `i', `ui'
+%% or `f' variants may be used to provide values for uniform variables of type bool, bvec2
+%% , bvec3, bvec4, or arrays of these. The uniform variable will be set to false if the input
+%% value is 0 or 0.0f, and it will be set to true otherwise.
+%%
+%% All active uniform variables defined in a program object are initialized to 0 when the
+%% program object is linked successfully. They retain the values assigned to them by a call
+%% to ``gl:programUniform'' until the next successful link operation occurs on the program
+%% object, when they are once again initialized to 0.
+%%
+%% The commands ``gl:programUniform{1|2|3|4}{f|i|ui}v'' can be used to modify a single
+%% uniform variable or a uniform variable array. These commands pass a count and a pointer
+%% to the values to be loaded into a uniform variable or a uniform variable array. A count
+%% of 1 should be used if modifying the value of a single uniform variable, and a count of
+%% 1 or greater can be used to modify an entire array or part of an array. When loading `n'
+%% elements starting at an arbitrary position `m' in a uniform variable array, elements
+%% `m' + `n' - 1 in the array will be replaced with the new values. If `M' + `N'
+%% - 1 is larger than the size of the uniform variable array, values for all array elements
+%% beyond the end of the array will be ignored. The number specified in the name of the command
+%% indicates the number of components for each element in `Value' , and it should match
+%% the number of components in the data type of the specified uniform variable (e.g., `1'
+%% for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The data type specified
+%% in the name of the command must match the data type for the specified uniform variable
+%% as described previously for ``gl:programUniform{1|2|3|4}{f|i|ui}''.
+%%
+%% For uniform variable arrays, each element of the array is considered to be of the type
+%% indicated in the name of the command (e.g., ``gl:programUniform3f'' or ``gl:programUniform3fv''
+%% can be used to load a uniform variable array of type vec3). The number of elements of
+%% the uniform variable array to be modified is specified by `Count'
+%%
+%% The commands ``gl:programUniformMatrix{2|3|4|2x3|3x2|2x4|4x2|3x4|4x3}fv'' are used
+%% to modify a matrix or an array of matrices. The numbers in the command name are interpreted
+%% as the dimensionality of the matrix. The number `2' indicates a 2 � 2 matrix (i.e.,
+%% 4 values), the number `3' indicates a 3 � 3 matrix (i.e., 9 values), and the number `4'
+%% indicates a 4 � 4 matrix (i.e., 16 values). Non-square matrix dimensionality is explicit,
+%% with the first number representing the number of columns and the second number representing
+%% the number of rows. For example, `2x4' indicates a 2 � 4 matrix with 2 columns and
+%% 4 rows (i.e., 8 values). If `Transpose' is `?GL_FALSE', each matrix is assumed
+%% to be supplied in column major order. If `Transpose' is `?GL_TRUE', each matrix
+%% is assumed to be supplied in row major order. The `Count' argument indicates the
+%% number of matrices to be passed. A count of 1 should be used if modifying the value of
+%% a single matrix, and a count greater than 1 can be used to modify an array of matrices.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
+-spec programUniform1i(Program, Location, V0) -> ok when Program :: integer(),Location :: integer(),V0 :: integer().
programUniform1i(Program,Location,V0) ->
cast(5784, <<Program:?GLuint,Location:?GLint,V0:?GLint>>).
-%% @spec (Program::integer(),Location::integer(),Value::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform1iv(integer(),integer(),[integer()]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform1iv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [integer()].
programUniform1iv(Program,Location,Value) ->
cast(5785, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,
(<< <<C:?GLint>> || C <- Value>>)/binary,0:(((1+length(Value)) rem 2)*32)>>).
-%% @spec (Program::integer(),Location::integer(),V0::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform1f(integer(),integer(),float()) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform1f(Program, Location, V0) -> ok when Program :: integer(),Location :: integer(),V0 :: float().
programUniform1f(Program,Location,V0) ->
cast(5786, <<Program:?GLuint,Location:?GLint,V0:?GLfloat>>).
-%% @spec (Program::integer(),Location::integer(),Value::[float()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform1fv(integer(),integer(),[float()]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform1fv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [float()].
programUniform1fv(Program,Location,Value) ->
cast(5787, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,
(<< <<C:?GLfloat>> || C <- Value>>)/binary,0:(((1+length(Value)) rem 2)*32)>>).
-%% @spec (Program::integer(),Location::integer(),V0::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform1d(integer(),integer(),float()) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform1d(Program, Location, V0) -> ok when Program :: integer(),Location :: integer(),V0 :: float().
programUniform1d(Program,Location,V0) ->
cast(5788, <<Program:?GLuint,Location:?GLint,V0:?GLdouble>>).
-%% @spec (Program::integer(),Location::integer(),Value::[float()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform1dv(integer(),integer(),[float()]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform1dv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [float()].
programUniform1dv(Program,Location,Value) ->
cast(5789, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,0:32,
(<< <<C:?GLdouble>> || C <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),V0::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform1ui(integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform1ui(Program, Location, V0) -> ok when Program :: integer(),Location :: integer(),V0 :: integer().
programUniform1ui(Program,Location,V0) ->
cast(5790, <<Program:?GLuint,Location:?GLint,V0:?GLuint>>).
-%% @spec (Program::integer(),Location::integer(),Value::[integer()]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform1uiv(integer(),integer(),[integer()]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform1uiv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [integer()].
programUniform1uiv(Program,Location,Value) ->
cast(5791, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,
(<< <<C:?GLuint>> || C <- Value>>)/binary,0:(((1+length(Value)) rem 2)*32)>>).
-%% @spec (Program::integer(),Location::integer(),V0::integer(),V1::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform2i(integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform2i(Program, Location, V0, V1) -> ok when Program :: integer(),Location :: integer(),V0 :: integer(),V1 :: integer().
programUniform2i(Program,Location,V0,V1) ->
cast(5792, <<Program:?GLuint,Location:?GLint,V0:?GLint,V1:?GLint>>).
-%% @spec (Program::integer(),Location::integer(),Value::[{integer(),integer()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform2iv(integer(),integer(),[{integer(),integer()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform2iv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [{integer(),integer()}].
programUniform2iv(Program,Location,Value) ->
cast(5793, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLint,V2:?GLint>> || {V1,V2} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),V0::float(),V1::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform2f(integer(),integer(),float(),float()) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform2f(Program, Location, V0, V1) -> ok when Program :: integer(),Location :: integer(),V0 :: float(),V1 :: float().
programUniform2f(Program,Location,V0,V1) ->
cast(5794, <<Program:?GLuint,Location:?GLint,V0:?GLfloat,V1:?GLfloat>>).
-%% @spec (Program::integer(),Location::integer(),Value::[{float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform2fv(integer(),integer(),[{float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform2fv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [{float(),float()}].
programUniform2fv(Program,Location,Value) ->
cast(5795, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat>> || {V1,V2} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),V0::float(),V1::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform2d(integer(),integer(),float(),float()) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform2d(Program, Location, V0, V1) -> ok when Program :: integer(),Location :: integer(),V0 :: float(),V1 :: float().
programUniform2d(Program,Location,V0,V1) ->
cast(5796, <<Program:?GLuint,Location:?GLint,V0:?GLdouble,V1:?GLdouble>>).
-%% @spec (Program::integer(),Location::integer(),Value::[{float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform2dv(integer(),integer(),[{float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform2dv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [{float(),float()}].
programUniform2dv(Program,Location,Value) ->
cast(5797, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble>> || {V1,V2} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),V0::integer(),V1::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform2ui(integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform2ui(Program, Location, V0, V1) -> ok when Program :: integer(),Location :: integer(),V0 :: integer(),V1 :: integer().
programUniform2ui(Program,Location,V0,V1) ->
cast(5798, <<Program:?GLuint,Location:?GLint,V0:?GLuint,V1:?GLuint>>).
-%% @spec (Program::integer(),Location::integer(),Value::[{integer(),integer()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform2uiv(integer(),integer(),[{integer(),integer()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform2uiv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [{integer(),integer()}].
programUniform2uiv(Program,Location,Value) ->
cast(5799, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLuint,V2:?GLuint>> || {V1,V2} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),V0::integer(),V1::integer(),V2::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform3i(integer(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform3i(Program, Location, V0, V1, V2) -> ok when Program :: integer(),Location :: integer(),V0 :: integer(),V1 :: integer(),V2 :: integer().
programUniform3i(Program,Location,V0,V1,V2) ->
cast(5800, <<Program:?GLuint,Location:?GLint,V0:?GLint,V1:?GLint,V2:?GLint>>).
-%% @spec (Program::integer(),Location::integer(),Value::[{integer(),integer(),integer()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform3iv(integer(),integer(),[{integer(),integer(),integer()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform3iv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [{integer(),integer(),integer()}].
programUniform3iv(Program,Location,Value) ->
cast(5801, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLint,V2:?GLint,V3:?GLint>> || {V1,V2,V3} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),V0::float(),V1::float(),V2::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform3f(integer(),integer(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform3f(Program, Location, V0, V1, V2) -> ok when Program :: integer(),Location :: integer(),V0 :: float(),V1 :: float(),V2 :: float().
programUniform3f(Program,Location,V0,V1,V2) ->
cast(5802, <<Program:?GLuint,Location:?GLint,V0:?GLfloat,V1:?GLfloat,V2:?GLfloat>>).
-%% @spec (Program::integer(),Location::integer(),Value::[{float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform3fv(integer(),integer(),[{float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform3fv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [{float(),float(),float()}].
programUniform3fv(Program,Location,Value) ->
cast(5803, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat>> || {V1,V2,V3} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),V0::float(),V1::float(),V2::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform3d(integer(),integer(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform3d(Program, Location, V0, V1, V2) -> ok when Program :: integer(),Location :: integer(),V0 :: float(),V1 :: float(),V2 :: float().
programUniform3d(Program,Location,V0,V1,V2) ->
cast(5804, <<Program:?GLuint,Location:?GLint,V0:?GLdouble,V1:?GLdouble,V2:?GLdouble>>).
-%% @spec (Program::integer(),Location::integer(),Value::[{float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform3dv(integer(),integer(),[{float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform3dv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [{float(),float(),float()}].
programUniform3dv(Program,Location,Value) ->
cast(5805, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble>> || {V1,V2,V3} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),V0::integer(),V1::integer(),V2::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform3ui(integer(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform3ui(Program, Location, V0, V1, V2) -> ok when Program :: integer(),Location :: integer(),V0 :: integer(),V1 :: integer(),V2 :: integer().
programUniform3ui(Program,Location,V0,V1,V2) ->
cast(5806, <<Program:?GLuint,Location:?GLint,V0:?GLuint,V1:?GLuint,V2:?GLuint>>).
-%% @spec (Program::integer(),Location::integer(),Value::[{integer(),integer(),integer()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform3uiv(integer(),integer(),[{integer(),integer(),integer()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform3uiv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [{integer(),integer(),integer()}].
programUniform3uiv(Program,Location,Value) ->
cast(5807, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLuint,V2:?GLuint,V3:?GLuint>> || {V1,V2,V3} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),V0::integer(),V1::integer(),V2::integer(),V3::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform4i(integer(),integer(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform4i(Program, Location, V0, V1, V2, V3) -> ok when Program :: integer(),Location :: integer(),V0 :: integer(),V1 :: integer(),V2 :: integer(),V3 :: integer().
programUniform4i(Program,Location,V0,V1,V2,V3) ->
cast(5808, <<Program:?GLuint,Location:?GLint,V0:?GLint,V1:?GLint,V2:?GLint,V3:?GLint>>).
-%% @spec (Program::integer(),Location::integer(),Value::[{integer(),integer(),integer(),integer()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform4iv(integer(),integer(),[{integer(),integer(),integer(),integer()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform4iv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [{integer(),integer(),integer(),integer()}].
programUniform4iv(Program,Location,Value) ->
cast(5809, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLint,V2:?GLint,V3:?GLint,V4:?GLint>> || {V1,V2,V3,V4} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),V0::float(),V1::float(),V2::float(),V3::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform4f(integer(),integer(),float(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform4f(Program, Location, V0, V1, V2, V3) -> ok when Program :: integer(),Location :: integer(),V0 :: float(),V1 :: float(),V2 :: float(),V3 :: float().
programUniform4f(Program,Location,V0,V1,V2,V3) ->
cast(5810, <<Program:?GLuint,Location:?GLint,V0:?GLfloat,V1:?GLfloat,V2:?GLfloat,V3:?GLfloat>>).
-%% @spec (Program::integer(),Location::integer(),Value::[{float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform4fv(integer(),integer(),[{float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform4fv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [{float(),float(),float(),float()}].
programUniform4fv(Program,Location,Value) ->
cast(5811, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat>> || {V1,V2,V3,V4} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),V0::float(),V1::float(),V2::float(),V3::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform4d(integer(),integer(),float(),float(),float(),float()) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform4d(Program, Location, V0, V1, V2, V3) -> ok when Program :: integer(),Location :: integer(),V0 :: float(),V1 :: float(),V2 :: float(),V3 :: float().
programUniform4d(Program,Location,V0,V1,V2,V3) ->
cast(5812, <<Program:?GLuint,Location:?GLint,V0:?GLdouble,V1:?GLdouble,V2:?GLdouble,V3:?GLdouble>>).
-%% @spec (Program::integer(),Location::integer(),Value::[{float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform4dv(integer(),integer(),[{float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform4dv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [{float(),float(),float(),float()}].
programUniform4dv(Program,Location,Value) ->
cast(5813, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble>> || {V1,V2,V3,V4} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),V0::integer(),V1::integer(),V2::integer(),V3::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform4ui(integer(),integer(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform4ui(Program, Location, V0, V1, V2, V3) -> ok when Program :: integer(),Location :: integer(),V0 :: integer(),V1 :: integer(),V2 :: integer(),V3 :: integer().
programUniform4ui(Program,Location,V0,V1,V2,V3) ->
cast(5814, <<Program:?GLuint,Location:?GLint,V0:?GLuint,V1:?GLuint,V2:?GLuint,V3:?GLuint>>).
-%% @spec (Program::integer(),Location::integer(),Value::[{integer(),integer(),integer(),integer()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniform.xml">external</a> documentation.
--spec programUniform4uiv(integer(),integer(),[{integer(),integer(),integer(),integer()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniform4uiv(Program, Location, Value) -> ok when Program :: integer(),Location :: integer(),Value :: [{integer(),integer(),integer(),integer()}].
programUniform4uiv(Program,Location,Value) ->
cast(5815, <<Program:?GLuint,Location:?GLint,(length(Value)):?GLuint,
(<< <<V1:?GLuint,V2:?GLuint,V3:?GLuint,V4:?GLuint>> || {V1,V2,V3,V4} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix.xml">external</a> documentation.
--spec programUniformMatrix2fv(integer(),integer(),0|1,[{float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix2fv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float()}].
programUniformMatrix2fv(Program,Location,Transpose,Value) ->
cast(5816, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat>> || {V1,V2,V3,V4} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix.xml">external</a> documentation.
--spec programUniformMatrix3fv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix3fv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float()}].
programUniformMatrix3fv(Program,Location,Transpose,Value) ->
cast(5817, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat,V7:?GLfloat,V8:?GLfloat,V9:?GLfloat>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix.xml">external</a> documentation.
--spec programUniformMatrix4fv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix4fv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}].
programUniformMatrix4fv(Program,Location,Transpose,Value) ->
cast(5818, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat,V7:?GLfloat,V8:?GLfloat,V9:?GLfloat,V10:?GLfloat,V11:?GLfloat,V12:?GLfloat,V13:?GLfloat,V14:?GLfloat,V15:?GLfloat,V16:?GLfloat>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,V13,V14,V15,V16} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix.xml">external</a> documentation.
--spec programUniformMatrix2dv(integer(),integer(),0|1,[{float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix2dv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float()}].
programUniformMatrix2dv(Program,Location,Transpose,Value) ->
cast(5819, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:56,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble>> || {V1,V2,V3,V4} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix.xml">external</a> documentation.
--spec programUniformMatrix3dv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix3dv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float()}].
programUniformMatrix3dv(Program,Location,Transpose,Value) ->
cast(5820, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:56,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble,V7:?GLdouble,V8:?GLdouble,V9:?GLdouble>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix.xml">external</a> documentation.
--spec programUniformMatrix4dv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix4dv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}].
programUniformMatrix4dv(Program,Location,Transpose,Value) ->
cast(5821, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:56,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble,V7:?GLdouble,V8:?GLdouble,V9:?GLdouble,V10:?GLdouble,V11:?GLdouble,V12:?GLdouble,V13:?GLdouble,V14:?GLdouble,V15:?GLdouble,V16:?GLdouble>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12,V13,V14,V15,V16} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix2x.xml">external</a> documentation.
--spec programUniformMatrix2x3fv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix2x3fv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float()}].
programUniformMatrix2x3fv(Program,Location,Transpose,Value) ->
cast(5822, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat>> || {V1,V2,V3,V4,V5,V6} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix3x.xml">external</a> documentation.
--spec programUniformMatrix3x2fv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix3x2fv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float()}].
programUniformMatrix3x2fv(Program,Location,Transpose,Value) ->
cast(5823, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat>> || {V1,V2,V3,V4,V5,V6} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix2x.xml">external</a> documentation.
--spec programUniformMatrix2x4fv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix2x4fv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float()}].
programUniformMatrix2x4fv(Program,Location,Transpose,Value) ->
cast(5824, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat,V7:?GLfloat,V8:?GLfloat>> || {V1,V2,V3,V4,V5,V6,V7,V8} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix4x.xml">external</a> documentation.
--spec programUniformMatrix4x2fv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix4x2fv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float()}].
programUniformMatrix4x2fv(Program,Location,Transpose,Value) ->
cast(5825, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat,V7:?GLfloat,V8:?GLfloat>> || {V1,V2,V3,V4,V5,V6,V7,V8} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix3x.xml">external</a> documentation.
--spec programUniformMatrix3x4fv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix3x4fv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}].
programUniformMatrix3x4fv(Program,Location,Transpose,Value) ->
cast(5826, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat,V7:?GLfloat,V8:?GLfloat,V9:?GLfloat,V10:?GLfloat,V11:?GLfloat,V12:?GLfloat>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix4x.xml">external</a> documentation.
--spec programUniformMatrix4x3fv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix4x3fv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}].
programUniformMatrix4x3fv(Program,Location,Transpose,Value) ->
cast(5827, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:24,(length(Value)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat,V5:?GLfloat,V6:?GLfloat,V7:?GLfloat,V8:?GLfloat,V9:?GLfloat,V10:?GLfloat,V11:?GLfloat,V12:?GLfloat>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix2x.xml">external</a> documentation.
--spec programUniformMatrix2x3dv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix2x3dv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float()}].
programUniformMatrix2x3dv(Program,Location,Transpose,Value) ->
cast(5828, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:56,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble>> || {V1,V2,V3,V4,V5,V6} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix3x.xml">external</a> documentation.
--spec programUniformMatrix3x2dv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix3x2dv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float()}].
programUniformMatrix3x2dv(Program,Location,Transpose,Value) ->
cast(5829, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:56,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble>> || {V1,V2,V3,V4,V5,V6} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix2x.xml">external</a> documentation.
--spec programUniformMatrix2x4dv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix2x4dv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float()}].
programUniformMatrix2x4dv(Program,Location,Transpose,Value) ->
cast(5830, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:56,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble,V7:?GLdouble,V8:?GLdouble>> || {V1,V2,V3,V4,V5,V6,V7,V8} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix4x.xml">external</a> documentation.
--spec programUniformMatrix4x2dv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix4x2dv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float()}].
programUniformMatrix4x2dv(Program,Location,Transpose,Value) ->
cast(5831, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:56,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble,V7:?GLdouble,V8:?GLdouble>> || {V1,V2,V3,V4,V5,V6,V7,V8} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix3x.xml">external</a> documentation.
--spec programUniformMatrix3x4dv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix3x4dv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}].
programUniformMatrix3x4dv(Program,Location,Transpose,Value) ->
cast(5832, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:56,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble,V7:?GLdouble,V8:?GLdouble,V9:?GLdouble,V10:?GLdouble,V11:?GLdouble,V12:?GLdouble>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12} <- Value>>)/binary>>).
-%% @spec (Program::integer(),Location::integer(),Transpose::0|1,Value::[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glProgramUniformMatrix4x.xml">external</a> documentation.
--spec programUniformMatrix4x3dv(integer(),integer(),0|1,[{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}]) -> ok.
+%% @doc
+%% See {@link programUniform1i/3}
+-spec programUniformMatrix4x3dv(Program, Location, Transpose, Value) -> ok when Program :: integer(),Location :: integer(),Transpose :: 0|1,Value :: [{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()}].
programUniformMatrix4x3dv(Program,Location,Transpose,Value) ->
cast(5833, <<Program:?GLuint,Location:?GLint,Transpose:?GLboolean,0:56,(length(Value)):?GLuint,0:32,
(<< <<V1:?GLdouble,V2:?GLdouble,V3:?GLdouble,V4:?GLdouble,V5:?GLdouble,V6:?GLdouble,V7:?GLdouble,V8:?GLdouble,V9:?GLdouble,V10:?GLdouble,V11:?GLdouble,V12:?GLdouble>> || {V1,V2,V3,V4,V5,V6,V7,V8,V9,V10,V11,V12} <- Value>>)/binary>>).
-%% @spec (Pipeline::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glValidateProgramPipeline.xml">external</a> documentation.
--spec validateProgramPipeline(integer()) -> ok.
+%% @doc Validate a program pipeline object against current GL state
+%%
+%% ``gl:validateProgramPipeline'' instructs the implementation to validate the shader executables
+%% contained in `Pipeline' against the current GL state. The implementation may use
+%% this as an opportunity to perform any internal shader modifications that may be required
+%% to ensure correct operation of the installed shaders given the current GL state.
+%%
+%% After a program pipeline has been validated, its validation status is set to `?GL_TRUE'
+%% . The validation status of a program pipeline object may be queried by calling {@link gl:getProgramPipelineiv/2}
+%% with parameter `?GL_VALIDATE_STATUS'.
+%%
+%% If `Pipeline' is a name previously returned from a call to {@link gl:genProgramPipelines/1}
+%% but that has not yet been bound by a call to {@link gl:bindProgramPipeline/1} , a new program
+%% pipeline object is created with name `Pipeline' and the default state vector.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glValidateProgramPipeline.xml">external</a> documentation.
+-spec validateProgramPipeline(Pipeline) -> ok when Pipeline :: integer().
validateProgramPipeline(Pipeline) ->
cast(5834, <<Pipeline:?GLuint>>).
-%% @spec (Pipeline::integer(),BufSize::integer()) -> string()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramPipelineInfoLog.xml">external</a> documentation.
--spec getProgramPipelineInfoLog(integer(),integer()) -> string().
+%% @doc Retrieve the info log string from a program pipeline object
+%%
+%% ``gl:getProgramPipelineInfoLog'' retrieves the info log for the program pipeline object
+%% `Pipeline' . The info log, including its null terminator, is written into the array
+%% of characters whose address is given by `InfoLog' . The maximum number of characters
+%% that may be written into `InfoLog' is given by `BufSize' , and the actual number
+%% of characters written into `InfoLog' is returned in the integer whose address is
+%% given by `Length' . If `Length' is `?NULL', no length is returned.
+%%
+%% The actual length of the info log for the program pipeline may be determined by calling {@link gl:getProgramPipelineiv/2}
+%% with `Pname' set to `?GL_INFO_LOG_LENGTH'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramPipelineInfoLog.xml">external</a> documentation.
+-spec getProgramPipelineInfoLog(Pipeline, BufSize) -> string() when Pipeline :: integer(),BufSize :: integer().
getProgramPipelineInfoLog(Pipeline,BufSize) ->
call(5835, <<Pipeline:?GLuint,BufSize:?GLsizei>>).
-%% @spec (Index::integer(),X::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribL.xml">external</a> documentation.
--spec vertexAttribL1d(integer(),float()) -> ok.
+%% @doc glVertexAttribL
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribL.xml">external</a> documentation.
+-spec vertexAttribL1d(Index, X) -> ok when Index :: integer(),X :: float().
vertexAttribL1d(Index,X) ->
cast(5836, <<Index:?GLuint,0:32,X:?GLdouble>>).
-%% @spec (Index::integer(),X::float(),Y::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribL.xml">external</a> documentation.
--spec vertexAttribL2d(integer(),float(),float()) -> ok.
+%% @doc glVertexAttribL
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribL.xml">external</a> documentation.
+-spec vertexAttribL2d(Index, X, Y) -> ok when Index :: integer(),X :: float(),Y :: float().
vertexAttribL2d(Index,X,Y) ->
cast(5837, <<Index:?GLuint,0:32,X:?GLdouble,Y:?GLdouble>>).
-%% @spec (Index::integer(),X::float(),Y::float(),Z::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribL.xml">external</a> documentation.
--spec vertexAttribL3d(integer(),float(),float(),float()) -> ok.
+%% @doc glVertexAttribL
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribL.xml">external</a> documentation.
+-spec vertexAttribL3d(Index, X, Y, Z) -> ok when Index :: integer(),X :: float(),Y :: float(),Z :: float().
vertexAttribL3d(Index,X,Y,Z) ->
cast(5838, <<Index:?GLuint,0:32,X:?GLdouble,Y:?GLdouble,Z:?GLdouble>>).
-%% @spec (Index::integer(),X::float(),Y::float(),Z::float(),W::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribL.xml">external</a> documentation.
--spec vertexAttribL4d(integer(),float(),float(),float(),float()) -> ok.
+%% @doc glVertexAttribL
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribL.xml">external</a> documentation.
+-spec vertexAttribL4d(Index, X, Y, Z, W) -> ok when Index :: integer(),X :: float(),Y :: float(),Z :: float(),W :: float().
vertexAttribL4d(Index,X,Y,Z,W) ->
cast(5839, <<Index:?GLuint,0:32,X:?GLdouble,Y:?GLdouble,Z:?GLdouble,W:?GLdouble>>).
-%% @spec (Index,{X}) -> ok
%% @equiv vertexAttribL1d(Index,X)
--spec vertexAttribL1dv(integer(),{float()}) -> ok.
+-spec vertexAttribL1dv(Index :: integer(),V) -> ok when V :: {X :: float()}.
vertexAttribL1dv(Index,{X}) -> vertexAttribL1d(Index,X).
-%% @spec (Index,{X,Y}) -> ok
%% @equiv vertexAttribL2d(Index,X,Y)
--spec vertexAttribL2dv(integer(),{float(),float()}) -> ok.
+-spec vertexAttribL2dv(Index :: integer(),V) -> ok when V :: {X :: float(),Y :: float()}.
vertexAttribL2dv(Index,{X,Y}) -> vertexAttribL2d(Index,X,Y).
-%% @spec (Index,{X,Y,Z}) -> ok
%% @equiv vertexAttribL3d(Index,X,Y,Z)
--spec vertexAttribL3dv(integer(),{float(),float(),float()}) -> ok.
+-spec vertexAttribL3dv(Index :: integer(),V) -> ok when V :: {X :: float(),Y :: float(),Z :: float()}.
vertexAttribL3dv(Index,{X,Y,Z}) -> vertexAttribL3d(Index,X,Y,Z).
-%% @spec (Index,{X,Y,Z,W}) -> ok
%% @equiv vertexAttribL4d(Index,X,Y,Z,W)
--spec vertexAttribL4dv(integer(),{float(),float(),float(),float()}) -> ok.
+-spec vertexAttribL4dv(Index :: integer(),V) -> ok when V :: {X :: float(),Y :: float(),Z :: float(),W :: float()}.
vertexAttribL4dv(Index,{X,Y,Z,W}) -> vertexAttribL4d(Index,X,Y,Z,W).
-%% @spec (Index::integer(),Size::integer(),Type::enum(),Stride::integer(),Pointer::offset()|mem()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribLPointer.xml">external</a> documentation.
--spec vertexAttribLPointer(integer(),integer(),enum(),integer(),offset()|mem()) -> ok.
+%% @doc glVertexAttribLPointer
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glVertexAttribLPointer.xml">external</a> documentation.
+-spec vertexAttribLPointer(Index, Size, Type, Stride, Pointer) -> ok when Index :: integer(),Size :: integer(),Type :: enum(),Stride :: integer(),Pointer :: offset()|mem().
vertexAttribLPointer(Index,Size,Type,Stride,Pointer) when is_integer(Pointer) ->
cast(5840, <<Index:?GLuint,Size:?GLint,Type:?GLenum,Stride:?GLsizei,Pointer:?GLuint>>);
vertexAttribLPointer(Index,Size,Type,Stride,Pointer) ->
send_bin(Pointer),
cast(5841, <<Index:?GLuint,Size:?GLint,Type:?GLenum,Stride:?GLsizei>>).
-%% @spec (Index::integer(),Pname::enum()) -> {float(),float(),float(),float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetVertexAttribL.xml">external</a> documentation.
--spec getVertexAttribLdv(integer(),enum()) -> {float(),float(),float(),float()}.
+%% @doc glGetVertexAttribL
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetVertexAttribL.xml">external</a> documentation.
+-spec getVertexAttribLdv(Index, Pname) -> {float(),float(),float(),float()} when Index :: integer(),Pname :: enum().
getVertexAttribLdv(Index,Pname) ->
call(5842, <<Index:?GLuint,Pname:?GLenum>>).
-%% @spec (First::integer(),V::[{float(),float(),float(),float()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glViewportArrayv.xml">external</a> documentation.
--spec viewportArrayv(integer(),[{float(),float(),float(),float()}]) -> ok.
+%% @doc glViewportArrayv
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glViewportArrayv.xml">external</a> documentation.
+-spec viewportArrayv(First, V) -> ok when First :: integer(),V :: [{float(),float(),float(),float()}].
viewportArrayv(First,V) ->
cast(5843, <<First:?GLuint,(length(V)):?GLuint,
(<< <<V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat>> || {V1,V2,V3,V4} <- V>>)/binary>>).
-%% @spec (Index::integer(),X::float(),Y::float(),W::float(),H::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glViewportIndexed.xml">external</a> documentation.
--spec viewportIndexedf(integer(),float(),float(),float(),float()) -> ok.
+%% @doc Set a specified viewport
+%%
+%% ``gl:viewportIndexedf'' and ``gl:viewportIndexedfv'' specify the parameters for a
+%% single viewport. `Index' specifies the index of the viewport to modify. `Index'
+%% must be less than the value of `?GL_MAX_VIEWPORTS'. For ``gl:viewportIndexedf'', `X'
+%% , `Y' , `W' , and `H' specify the left, bottom, width and height of the viewport
+%% in pixels, respectively. For ``gl:viewportIndexedfv'', `V' contains the address
+%% of an array of floating point values specifying the left ( x), bottom ( y), width ( w),
+%% and height ( h) of each viewport, in that order. x and y give the location of the viewport's
+%% lower left corner, and w and h give the width and height of the viewport, respectively.
+%% The viewport specifies the affine transformation of x and y from normalized device
+%% coordinates to window coordinates. Let (x nd y nd) be normalized device coordinates. Then the window
+%% coordinates (x w y w) are computed as follows:
+%%
+%% x w=(x nd+1) (width/2)+x
+%%
+%% y w=(y nd+1) (height/2)+y
+%%
+%% The location of the viewport's bottom left corner, given by ( x, y) is clamped to be
+%% within the implementaiton-dependent viewport bounds range. The viewport bounds range [
+%% min, max] can be determined by calling {@link gl:getBooleanv/1} with argument `?GL_VIEWPORT_BOUNDS_RANGE'
+%% . Viewport width and height are silently clamped to a range that depends on the implementation.
+%% To query this range, call {@link gl:getBooleanv/1} with argument `?GL_MAX_VIEWPORT_DIMS'.
+%%
+%% The precision with which the GL interprets the floating point viewport bounds is implementation-dependent
+%% and may be determined by querying the impementation-defined constant `?GL_VIEWPORT_SUBPIXEL_BITS'
+%% .
+%%
+%% Calling ``gl:viewportIndexedfv'' is equivalent to calling see `glViewportArray'
+%% with `First' set to `Index' , `Count' set to 1 and `V' passsed directly.
+%% ``gl:viewportIndexedf'' is equivalent to: void glViewportIndexedf(GLuint index, GLfloat
+%% x, GLfloat y, GLfloat w, GLfloat h) { const float v[4] = { x, y, w, h }; glViewportArrayv(index,
+%% 1, v); }
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glViewportIndexed.xml">external</a> documentation.
+-spec viewportIndexedf(Index, X, Y, W, H) -> ok when Index :: integer(),X :: float(),Y :: float(),W :: float(),H :: float().
viewportIndexedf(Index,X,Y,W,H) ->
cast(5844, <<Index:?GLuint,X:?GLfloat,Y:?GLfloat,W:?GLfloat,H:?GLfloat>>).
-%% @spec (Index::integer(),V::{float(),float(),float(),float()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glViewportIndexed.xml">external</a> documentation.
--spec viewportIndexedfv(integer(),{float(),float(),float(),float()}) -> ok.
+%% @doc
+%% See {@link viewportIndexedf/5}
+-spec viewportIndexedfv(Index, V) -> ok when Index :: integer(),V :: {float(),float(),float(),float()}.
viewportIndexedfv(Index,{V1,V2,V3,V4}) ->
cast(5845, <<Index:?GLuint,V1:?GLfloat,V2:?GLfloat,V3:?GLfloat,V4:?GLfloat>>).
-%% @spec (First::integer(),V::[{integer(),integer(),integer(),integer()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glScissorArrayv.xml">external</a> documentation.
--spec scissorArrayv(integer(),[{integer(),integer(),integer(),integer()}]) -> ok.
+%% @doc glScissorArrayv
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glScissorArrayv.xml">external</a> documentation.
+-spec scissorArrayv(First, V) -> ok when First :: integer(),V :: [{integer(),integer(),integer(),integer()}].
scissorArrayv(First,V) ->
cast(5846, <<First:?GLuint,(length(V)):?GLuint,
(<< <<V1:?GLint,V2:?GLint,V3:?GLint,V4:?GLint>> || {V1,V2,V3,V4} <- V>>)/binary>>).
-%% @spec (Index::integer(),Left::integer(),Bottom::integer(),Width::integer(),Height::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glScissorIndexe.xml">external</a> documentation.
--spec scissorIndexed(integer(),integer(),integer(),integer(),integer()) -> ok.
+%% @doc glScissorIndexe
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glScissorIndexe.xml">external</a> documentation.
+-spec scissorIndexed(Index, Left, Bottom, Width, Height) -> ok when Index :: integer(),Left :: integer(),Bottom :: integer(),Width :: integer(),Height :: integer().
scissorIndexed(Index,Left,Bottom,Width,Height) ->
cast(5847, <<Index:?GLuint,Left:?GLint,Bottom:?GLint,Width:?GLsizei,Height:?GLsizei>>).
-%% @spec (Index::integer(),V::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glScissorIndexe.xml">external</a> documentation.
--spec scissorIndexedv(integer(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc glScissorIndexe
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glScissorIndexe.xml">external</a> documentation.
+-spec scissorIndexedv(Index, V) -> ok when Index :: integer(),V :: {integer(),integer(),integer(),integer()}.
scissorIndexedv(Index,{V1,V2,V3,V4}) ->
cast(5848, <<Index:?GLuint,V1:?GLint,V2:?GLint,V3:?GLint,V4:?GLint>>).
-%% @spec (First::integer(),V::[{clamp(),clamp()}]) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDepthRangeArrayv.xml">external</a> documentation.
--spec depthRangeArrayv(integer(),[{clamp(),clamp()}]) -> ok.
+%% @doc glDepthRangeArrayv
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDepthRangeArrayv.xml">external</a> documentation.
+-spec depthRangeArrayv(First, V) -> ok when First :: integer(),V :: [{clamp(),clamp()}].
depthRangeArrayv(First,V) ->
cast(5849, <<First:?GLuint,0:32,(length(V)):?GLuint,0:32,
(<< <<V1:?GLclampd,V2:?GLclampd>> || {V1,V2} <- V>>)/binary>>).
-%% @spec (Index::integer(),N::clamp(),F::clamp()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDepthRangeIndexe.xml">external</a> documentation.
--spec depthRangeIndexed(integer(),clamp(),clamp()) -> ok.
+%% @doc glDepthRangeIndexe
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDepthRangeIndexe.xml">external</a> documentation.
+-spec depthRangeIndexed(Index, N, F) -> ok when Index :: integer(),N :: clamp(),F :: clamp().
depthRangeIndexed(Index,N,F) ->
cast(5850, <<Index:?GLuint,0:32,N:?GLclampd,F:?GLclampd>>).
-%% @spec (Target::enum(),Index::integer()) -> [float()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetFloati_v.xml">external</a> documentation.
--spec getFloati_v(enum(),integer()) -> [float()].
+%% @doc
+%% See {@link getBooleanv/1}
+-spec getFloati_v(Target, Index) -> [float()] when Target :: enum(),Index :: integer().
getFloati_v(Target,Index) ->
call(5851, <<Target:?GLenum,Index:?GLuint>>).
-%% @spec (Target::enum(),Index::integer()) -> [float()]
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetDoublei_v.xml">external</a> documentation.
--spec getDoublei_v(enum(),integer()) -> [float()].
+%% @doc
+%% See {@link getBooleanv/1}
+-spec getDoublei_v(Target, Index) -> [float()] when Target :: enum(),Index :: integer().
getDoublei_v(Target,Index) ->
call(5852, <<Target:?GLenum,Index:?GLuint>>).
-%% @spec (Source::enum(),Type::enum(),Severity::enum(),Ids::[integer()],Enabled::0|1) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDebugMessageControlARB.xml">external</a> documentation.
--spec debugMessageControlARB(enum(),enum(),enum(),[integer()],0|1) -> ok.
+%% @doc glDebugMessageControlARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDebugMessageControlARB.xml">external</a> documentation.
+-spec debugMessageControlARB(Source, Type, Severity, Ids, Enabled) -> ok when Source :: enum(),Type :: enum(),Severity :: enum(),Ids :: [integer()],Enabled :: 0|1.
debugMessageControlARB(Source,Type,Severity,Ids,Enabled) ->
cast(5853, <<Source:?GLenum,Type:?GLenum,Severity:?GLenum,(length(Ids)):?GLuint,
(<< <<C:?GLuint>> || C <- Ids>>)/binary,0:(((length(Ids)) rem 2)*32),Enabled:?GLboolean>>).
-%% @spec (Source::enum(),Type::enum(),Id::integer(),Severity::enum(),Buf::string()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDebugMessageInsertARB.xml">external</a> documentation.
--spec debugMessageInsertARB(enum(),enum(),integer(),enum(),string()) -> ok.
+%% @doc glDebugMessageInsertARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDebugMessageInsertARB.xml">external</a> documentation.
+-spec debugMessageInsertARB(Source, Type, Id, Severity, Buf) -> ok when Source :: enum(),Type :: enum(),Id :: integer(),Severity :: enum(),Buf :: string().
debugMessageInsertARB(Source,Type,Id,Severity,Buf) ->
cast(5854, <<Source:?GLenum,Type:?GLenum,Id:?GLuint,Severity:?GLenum,(list_to_binary([Buf|[0]]))/binary,0:((8-((length(Buf)+ 1) rem 8)) rem 8)>>).
-%% @spec (Count::integer(),Bufsize::integer()) -> {integer(),Sources::[enum()],Types::[enum()],Ids::[integer()],Severities::[enum()],MessageLog::[string()]}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetDebugMessageLogARB.xml">external</a> documentation.
--spec getDebugMessageLogARB(integer(),integer()) -> {integer(),[enum()],[enum()],[integer()],[enum()],[string()]}.
+%% @doc glGetDebugMessageLogARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetDebugMessageLogARB.xml">external</a> documentation.
+-spec getDebugMessageLogARB(Count, Bufsize) -> {integer(),Sources :: [enum()],Types :: [enum()],Ids :: [integer()],Severities :: [enum()],MessageLog :: [string()]} when Count :: integer(),Bufsize :: integer().
getDebugMessageLogARB(Count,Bufsize) ->
call(5855, <<Count:?GLuint,Bufsize:?GLsizei>>).
-%% @spec () -> enum()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetGraphicsResetStatusARB.xml">external</a> documentation.
+%% @doc glGetGraphicsResetStatusARB
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetGraphicsResetStatusARB.xml">external</a> documentation.
-spec getGraphicsResetStatusARB() -> enum().
getGraphicsResetStatusARB() ->
call(5856, <<>>).
-%% @spec () -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glResizeBuffersMESA.xml">external</a> documentation.
--spec resizeBuffersMESA() -> ok.
-resizeBuffersMESA() ->
- cast(5857, <<>>).
-
-%% @spec (X::float(),Y::float(),Z::float(),W::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWindowPos4dMESA.xml">external</a> documentation.
--spec windowPos4dMESA(float(),float(),float(),float()) -> ok.
-windowPos4dMESA(X,Y,Z,W) ->
- cast(5858, <<X:?GLdouble,Y:?GLdouble,Z:?GLdouble,W:?GLdouble>>).
-
-%% @spec ({X,Y,Z,W}) -> ok
-%% @equiv windowPos4dMESA(X,Y,Z,W)
--spec windowPos4dvMESA({float(),float(),float(),float()}) -> ok.
-windowPos4dvMESA({X,Y,Z,W}) -> windowPos4dMESA(X,Y,Z,W).
-
-%% @spec (X::float(),Y::float(),Z::float(),W::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWindowPos4fMESA.xml">external</a> documentation.
--spec windowPos4fMESA(float(),float(),float(),float()) -> ok.
-windowPos4fMESA(X,Y,Z,W) ->
- cast(5859, <<X:?GLfloat,Y:?GLfloat,Z:?GLfloat,W:?GLfloat>>).
-
-%% @spec ({X,Y,Z,W}) -> ok
-%% @equiv windowPos4fMESA(X,Y,Z,W)
--spec windowPos4fvMESA({float(),float(),float(),float()}) -> ok.
-windowPos4fvMESA({X,Y,Z,W}) -> windowPos4fMESA(X,Y,Z,W).
-
-%% @spec (X::integer(),Y::integer(),Z::integer(),W::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWindowPos4iMESA.xml">external</a> documentation.
--spec windowPos4iMESA(integer(),integer(),integer(),integer()) -> ok.
-windowPos4iMESA(X,Y,Z,W) ->
- cast(5860, <<X:?GLint,Y:?GLint,Z:?GLint,W:?GLint>>).
-
-%% @spec ({X,Y,Z,W}) -> ok
-%% @equiv windowPos4iMESA(X,Y,Z,W)
--spec windowPos4ivMESA({integer(),integer(),integer(),integer()}) -> ok.
-windowPos4ivMESA({X,Y,Z,W}) -> windowPos4iMESA(X,Y,Z,W).
-
-%% @spec (X::integer(),Y::integer(),Z::integer(),W::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glWindowPos4sMESA.xml">external</a> documentation.
--spec windowPos4sMESA(integer(),integer(),integer(),integer()) -> ok.
-windowPos4sMESA(X,Y,Z,W) ->
- cast(5861, <<X:?GLshort,Y:?GLshort,Z:?GLshort,W:?GLshort>>).
-
-%% @spec ({X,Y,Z,W}) -> ok
-%% @equiv windowPos4sMESA(X,Y,Z,W)
--spec windowPos4svMESA({integer(),integer(),integer(),integer()}) -> ok.
-windowPos4svMESA({X,Y,Z,W}) -> windowPos4sMESA(X,Y,Z,W).
-
-%% @spec (Zmin::clamp(),Zmax::clamp()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDepthBoundsEXT.xml">external</a> documentation.
--spec depthBoundsEXT(clamp(),clamp()) -> ok.
+%% @doc Draw multiple instances of a range of elements with offset applied to instanced attributes
+%%
+%% ``gl:drawArraysInstancedBaseInstance'' behaves identically to {@link gl:drawArrays/3}
+%% except that `Primcount' instances of the range of elements are executed and the value
+%% of the internal counter `InstanceID' advances for each iteration. `InstanceID'
+%% is an internal 32-bit integer counter that may be read by a vertex shader as `?gl_InstanceID'
+%% .
+%%
+%% ``gl:drawArraysInstancedBaseInstance'' has the same effect as: if ( mode or count is
+%% invalid ) generate appropriate error else { for (int i = 0; i &lt; primcount ; i++) {
+%% instanceID = i; glDrawArrays(mode, first, count); } instanceID = 0; }
+%%
+%% Specific vertex attributes may be classified as `instanced' through the use of {@link gl:vertexAttribDivisor/2}
+%% . Instanced vertex attributes supply per-instance vertex data to the vertex shader. The
+%% index of the vertex fetched from the enabled instanced vertex attribute arrays is calculated
+%% as: |gl_ InstanceID/divisor|&amp;plus; baseInstance. Note that `Baseinstance' does not affect the shader-visible
+%% value of `?gl_InstanceID'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawArraysInstancedBaseInstance.xml">external</a> documentation.
+-spec drawArraysInstancedBaseInstance(Mode, First, Count, Primcount, Baseinstance) -> ok when Mode :: enum(),First :: integer(),Count :: integer(),Primcount :: integer(),Baseinstance :: integer().
+drawArraysInstancedBaseInstance(Mode,First,Count,Primcount,Baseinstance) ->
+ cast(5857, <<Mode:?GLenum,First:?GLint,Count:?GLsizei,Primcount:?GLsizei,Baseinstance:?GLuint>>).
+
+%% @doc Draw multiple instances of a set of elements with offset applied to instanced attributes
+%%
+%% ``gl:drawElementsInstancedBaseInstance'' behaves identically to {@link gl:drawElements/4}
+%% except that `Primcount' instances of the set of elements are executed and the value
+%% of the internal counter `InstanceID' advances for each iteration. `InstanceID'
+%% is an internal 32-bit integer counter that may be read by a vertex shader as `?gl_InstanceID'
+%% .
+%%
+%% ``gl:drawElementsInstancedBaseInstance'' has the same effect as: if (mode, count, or
+%% type is invalid ) generate appropriate error else { for (int i = 0; i &lt; primcount ;
+%% i++) { instanceID = i; glDrawElements(mode, count, type, indices); } instanceID = 0; }
+%%
+%% Specific vertex attributes may be classified as `instanced' through the use of {@link gl:vertexAttribDivisor/2}
+%% . Instanced vertex attributes supply per-instance vertex data to the vertex shader. The
+%% index of the vertex fetched from the enabled instanced vertex attribute arrays is calculated
+%% as |gl_ InstanceID/divisor|&amp;plus; baseInstance. Note that `Baseinstance' does not affect the shader-visible
+%% value of `?gl_InstanceID'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawElementsInstancedBaseInstance.xml">external</a> documentation.
+-spec drawElementsInstancedBaseInstance(Mode, Count, Type, Indices, Primcount, Baseinstance) -> ok when Mode :: enum(),Count :: integer(),Type :: enum(),Indices :: offset()|mem(),Primcount :: integer(),Baseinstance :: integer().
+drawElementsInstancedBaseInstance(Mode,Count,Type,Indices,Primcount,Baseinstance) when is_integer(Indices) ->
+ cast(5858, <<Mode:?GLenum,Count:?GLsizei,Type:?GLenum,Indices:?GLuint,Primcount:?GLsizei,Baseinstance:?GLuint>>);
+drawElementsInstancedBaseInstance(Mode,Count,Type,Indices,Primcount,Baseinstance) ->
+ send_bin(Indices),
+ cast(5859, <<Mode:?GLenum,Count:?GLsizei,Type:?GLenum,Primcount:?GLsizei,Baseinstance:?GLuint>>).
+
+%% @doc Render multiple instances of a set of primitives from array data with a per-element offset
+%%
+%% ``gl:drawElementsInstancedBaseVertexBaseInstance'' behaves identically to {@link gl:drawElementsInstanced/5}
+%% except that the `i'th element transferred by the corresponding draw call will be
+%% taken from element `Indices' [i] + `Basevertex' of each enabled array. If the
+%% resulting value is larger than the maximum value representable by `Type' , it is as
+%% if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow
+%% conditions). The operation is undefined if the sum would be negative. The `Basevertex'
+%% has no effect on the shader-visible value of `?gl_VertexID'.
+%%
+%% Specific vertex attributes may be classified as `instanced' through the use of {@link gl:vertexAttribDivisor/2}
+%% . Instanced vertex attributes supply per-instance vertex data to the vertex shader. The
+%% index of the vertex fetched from the enabled instanced vertex attribute arrays is calculated
+%% as |gl_ InstanceID/divisor|&amp;plus; baseInstance. Note that `Baseinstance' does not affect the shader-visible
+%% value of `?gl_InstanceID'.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawElementsInstancedBaseVertexBaseInstance.xml">external</a> documentation.
+-spec drawElementsInstancedBaseVertexBaseInstance(Mode, Count, Type, Indices, Primcount, Basevertex, Baseinstance) -> ok when Mode :: enum(),Count :: integer(),Type :: enum(),Indices :: offset()|mem(),Primcount :: integer(),Basevertex :: integer(),Baseinstance :: integer().
+drawElementsInstancedBaseVertexBaseInstance(Mode,Count,Type,Indices,Primcount,Basevertex,Baseinstance) when is_integer(Indices) ->
+ cast(5860, <<Mode:?GLenum,Count:?GLsizei,Type:?GLenum,Indices:?GLuint,Primcount:?GLsizei,Basevertex:?GLint,Baseinstance:?GLuint>>);
+drawElementsInstancedBaseVertexBaseInstance(Mode,Count,Type,Indices,Primcount,Basevertex,Baseinstance) ->
+ send_bin(Indices),
+ cast(5861, <<Mode:?GLenum,Count:?GLsizei,Type:?GLenum,Primcount:?GLsizei,Basevertex:?GLint,Baseinstance:?GLuint>>).
+
+%% @doc glDrawTransformFeedbackInstance
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawTransformFeedbackInstance.xml">external</a> documentation.
+-spec drawTransformFeedbackInstanced(Mode, Id, Primcount) -> ok when Mode :: enum(),Id :: integer(),Primcount :: integer().
+drawTransformFeedbackInstanced(Mode,Id,Primcount) ->
+ cast(5862, <<Mode:?GLenum,Id:?GLuint,Primcount:?GLsizei>>).
+
+%% @doc glDrawTransformFeedbackStreamInstance
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDrawTransformFeedbackStreamInstance.xml">external</a> documentation.
+-spec drawTransformFeedbackStreamInstanced(Mode, Id, Stream, Primcount) -> ok when Mode :: enum(),Id :: integer(),Stream :: integer(),Primcount :: integer().
+drawTransformFeedbackStreamInstanced(Mode,Id,Stream,Primcount) ->
+ cast(5863, <<Mode:?GLenum,Id:?GLuint,Stream:?GLuint,Primcount:?GLsizei>>).
+
+%% @doc glGetInternalformat
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glGetInternalformat.xml">external</a> documentation.
+-spec getInternalformativ(Target, Internalformat, Pname, BufSize) -> [integer()] when Target :: enum(),Internalformat :: enum(),Pname :: enum(),BufSize :: integer().
+getInternalformativ(Target,Internalformat,Pname,BufSize) ->
+ call(5864, <<Target:?GLenum,Internalformat:?GLenum,Pname:?GLenum,BufSize:?GLsizei>>).
+
+%% @doc Bind a level of a texture to an image unit
+%%
+%% ``gl:bindImageTexture'' binds a single level of a texture to an image unit for the purpose
+%% of reading and writing it from shaders. `Unit' specifies the zero-based index of
+%% the image unit to which to bind the texture level. `Texture' specifies the name of
+%% an existing texture object to bind to the image unit. If `Texture' is zero, then
+%% any existing binding to the image unit is broken. `Level' specifies the level of
+%% the texture to bind to the image unit.
+%%
+%% If `Texture' is the name of a one-, two-, or three-dimensional array texture, a
+%% cube map or cube map array texture, or a two-dimensional multisample array texture, then
+%% it is possible to bind either the entire array, or only a single layer of the array to
+%% the image unit. In such cases, if `Layered' is `?GL_TRUE', the entire array
+%% is attached to the image unit and `Layer' is ignored. However, if `Layered' is `?GL_FALSE'
+%% then `Layer' specifies the layer of the array to attach to the image unit.
+%%
+%% `Access' specifies the access types to be performed by shaders and may be set to `?GL_READ_ONLY'
+%% , `?GL_WRITE_ONLY', or `?GL_READ_WRITE' to indicate read-only, write-only or
+%% read-write access, respectively. Violation of the access type specified in `Access'
+%% (for example, if a shader writes to an image bound with `Access' set to `?GL_READ_ONLY'
+%% ) will lead to undefined results, possibly including program termination.
+%%
+%% `Format' specifies the format that is to be used when performing formatted stores
+%% into the image from shaders. `Format' must be compatible with the texture's internal
+%% format and must be one of the formats listed in the following table.
+%%
+%% <table><tbody><tr><td>` Image Unit Format '</td><td>` Format Qualifier '</td></tr>
+%% </tbody><tbody><tr><td>`?GL_RGBA32F'</td><td>rgba32f</td></tr><tr><td>`?GL_RGBA16F'
+%% </td><td>rgba16f</td></tr><tr><td>`?GL_RG32F'</td><td>rg32f</td></tr><tr><td>`?GL_RG16F'
+%% </td><td>rg16f</td></tr><tr><td>`?GL_R11F_G11F_B10F'</td><td>r11f_g11f_b10f</td></tr>
+%% <tr><td>`?GL_R32F'</td><td>r32f</td></tr><tr><td>`?GL_R16F'</td><td>r16f</td></tr>
+%% <tr><td>`?GL_RGBA32UI'</td><td>rgba32ui</td></tr><tr><td>`?GL_RGBA16UI'</td><td>
+%% rgba16ui</td></tr><tr><td>`?GL_RGB10_A2UI'</td><td>rgb10_a2ui</td></tr><tr><td>`?GL_RGBA8UI'
+%% </td><td>rgba8ui</td></tr><tr><td>`?GL_RG32UI'</td><td>rg32ui</td></tr><tr><td>`?GL_RG16UI'
+%% </td><td>rg16ui</td></tr><tr><td>`?GL_RG8UI'</td><td>rg8ui</td></tr><tr><td>`?GL_R32UI'
+%% </td><td>r32ui</td></tr><tr><td>`?GL_R16UI'</td><td>r16ui</td></tr><tr><td>`?GL_R8UI'
+%% </td><td>r8ui</td></tr><tr><td>`?GL_RGBA32I'</td><td>rgba32i</td></tr><tr><td>`?GL_RGBA16I'
+%% </td><td>rgba16i</td></tr><tr><td>`?GL_RGBA8I'</td><td>rgba8i</td></tr><tr><td>`?GL_RG32I'
+%% </td><td>rg32i</td></tr><tr><td>`?GL_RG16I'</td><td>rg16i</td></tr><tr><td>`?GL_RG8I'
+%% </td><td>rg8i</td></tr><tr><td>`?GL_R32I'</td><td>r32i</td></tr><tr><td>`?GL_R16I'
+%% </td><td>r16i</td></tr><tr><td>`?GL_R8I'</td><td>r8i</td></tr><tr><td>`?GL_RGBA16'
+%% </td><td>rgba16</td></tr><tr><td>`?GL_RGB10_A2'</td><td>rgb10_a2</td></tr><tr><td>`?GL_RGBA8'
+%% </td><td>rgba8</td></tr><tr><td>`?GL_RG16'</td><td>rg16</td></tr><tr><td>`?GL_RG8'
+%% </td><td>rg8</td></tr><tr><td>`?GL_R16'</td><td>r16</td></tr><tr><td>`?GL_R8'</td>
+%% <td>r8</td></tr><tr><td>`?GL_RGBA16_SNORM'</td><td>rgba16_snorm</td></tr><tr><td>`?GL_RGBA8_SNORM'
+%% </td><td>rgba8_snorm</td></tr><tr><td>`?GL_RG16_SNORM'</td><td>rg16_snorm</td></tr><tr>
+%% <td>`?GL_RG8_SNORM'</td><td>rg8_snorm</td></tr><tr><td>`?GL_R16_SNORM'</td><td>r16_snorm
+%% </td></tr><tr><td>`?GL_R8_SNORM'</td><td>r8_snorm</td></tr></tbody></table>
+%%
+%% When a texture is bound to an image unit, the `Format' parameter for the image unit
+%% need not exactly match the texture internal format as long as the formats are considered
+%% compatible as defined in the OpenGL Specification. The matching criterion used for a given
+%% texture may be determined by calling {@link gl:getTexParameterfv/2} with `Value' set
+%% to `?GL_IMAGE_FORMAT_COMPATIBILITY_TYPE', with return values of `?GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE'
+%% and `?GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS', specifying matches by size and class,
+%% respectively.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glBindImageTexture.xml">external</a> documentation.
+-spec bindImageTexture(Unit, Texture, Level, Layered, Layer, Access, Format) -> ok when Unit :: integer(),Texture :: integer(),Level :: integer(),Layered :: 0|1,Layer :: integer(),Access :: enum(),Format :: enum().
+bindImageTexture(Unit,Texture,Level,Layered,Layer,Access,Format) ->
+ cast(5865, <<Unit:?GLuint,Texture:?GLuint,Level:?GLint,Layered:?GLboolean,0:24,Layer:?GLint,Access:?GLenum,Format:?GLenum>>).
+
+%% @doc Defines a barrier ordering memory transactions
+%%
+%% ``gl:memoryBarrier'' defines a barrier ordering the memory transactions issued prior
+%% to the command relative to those issued after the barrier. For the purposes of this ordering,
+%% memory transactions performed by shaders are considered to be issued by the rendering
+%% command that triggered the execution of the shader. `Barriers' is a bitfield indicating
+%% the set of operations that are synchronized with shader stores; the bits used in `Barriers'
+%% are as follows:
+%%
+%%
+%%
+%% `?GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT': If set, vertex data sourced from buffer objects
+%% after the barrier will reflect data written by shaders prior to the barrier. The set of
+%% buffer objects affected by this bit is derived from the buffer object bindings used for
+%% generic vertex attributes derived from the `?GL_VERTEX_ATTRIB_ARRAY_BUFFER' bindings.
+%%
+%%
+%% `?GL_ELEMENT_ARRAY_BARRIER_BIT': If set, vertex array indices sourced from buffer
+%% objects after the barrier will reflect data written by shaders prior to the barrier. The
+%% buffer objects affected by this bit are derived from the `?GL_ELEMENT_ARRAY_BUFFER'
+%% binding.
+%%
+%% `?GL_UNIFORM_BARRIER_BIT': Shader uniforms sourced from buffer objects after the
+%% barrier will reflect data written by shaders prior to the barrier.
+%%
+%% `?GL_TEXTURE_FETCH_BARRIER_BIT': Texture fetches from shaders, including fetches
+%% from buffer object memory via buffer textures, after the barrier will reflect data written
+%% by shaders prior to the barrier.
+%%
+%% `?GL_SHADER_IMAGE_ACCESS_BARRIER_BIT': Memory accesses using shader image load,
+%% store, and atomic built-in functions issued after the barrier will reflect data written
+%% by shaders prior to the barrier. Additionally, image stores and atomics issued after the
+%% barrier will not execute until all memory accesses (e.g., loads, stores, texture fetches,
+%% vertex fetches) initiated prior to the barrier complete.
+%%
+%% `?GL_COMMAND_BARRIER_BIT': Command data sourced from buffer objects by Draw*Indirect
+%% commands after the barrier will reflect data written by shaders prior to the barrier.
+%% The buffer objects affected by this bit are derived from the `?GL_DRAW_INDIRECT_BUFFER'
+%% binding.
+%%
+%% `?GL_PIXEL_BUFFER_BARRIER_BIT': Reads and writes of buffer objects via the `?GL_PIXEL_PACK_BUFFER'
+%% and `?GL_PIXEL_UNPACK_BUFFER' bindings (via {@link gl:readPixels/7} , {@link gl:texSubImage1D/7}
+%% , etc.) after the barrier will reflect data written by shaders prior to the barrier. Additionally,
+%% buffer object writes issued after the barrier will wait on the completion of all shader
+%% writes initiated prior to the barrier.
+%%
+%% `?GL_TEXTURE_UPDATE_BARRIER_BIT': Writes to a texture via ``gl:tex(Sub)Image*'', ``gl:copyTex(Sub)Image*''
+%% , ``gl:compressedTex(Sub)Image*'', and reads via {@link gl:getTexImage/5} after the barrier
+%% will reflect data written by shaders prior to the barrier. Additionally, texture writes
+%% from these commands issued after the barrier will not execute until all shader writes
+%% initiated prior to the barrier complete.
+%%
+%% `?GL_BUFFER_UPDATE_BARRIER_BIT': Reads or writes via {@link gl:bufferSubData/4} , {@link gl:copyBufferSubData/5}
+%% , or {@link gl:getBufferSubData/4} , or to buffer object memory mapped by see `glMapBuffer'
+%% or see `glMapBufferRange' after the barrier will reflect data written by shaders
+%% prior to the barrier. Additionally, writes via these commands issued after the barrier
+%% will wait on the completion of any shader writes to the same memory initiated prior to
+%% the barrier.
+%%
+%% `?GL_FRAMEBUFFER_BARRIER_BIT': Reads and writes via framebuffer object attachments
+%% after the barrier will reflect data written by shaders prior to the barrier. Additionally,
+%% framebuffer writes issued after the barrier will wait on the completion of all shader
+%% writes issued prior to the barrier.
+%%
+%% `?GL_TRANSFORM_FEEDBACK_BARRIER_BIT': Writes via transform feedback bindings after
+%% the barrier will reflect data written by shaders prior to the barrier. Additionally, transform
+%% feedback writes issued after the barrier will wait on the completion of all shader writes
+%% issued prior to the barrier.
+%%
+%% `?GL_ATOMIC_COUNTER_BARRIER_BIT': Accesses to atomic counters after the barrier
+%% will reflect writes prior to the barrier.
+%%
+%% If `Barriers' is `?GL_ALL_BARRIER_BITS', shader memory accesses will be synchronized
+%% relative to all the operations described above.
+%%
+%% Implementations may cache buffer object and texture image memory that could be written
+%% by shaders in multiple caches; for example, there may be separate caches for texture,
+%% vertex fetching, and one or more caches for shader memory accesses. Implementations are
+%% not required to keep these caches coherent with shader memory writes. Stores issued by
+%% one invocation may not be immediately observable by other pipeline stages or other shader
+%% invocations because the value stored may remain in a cache local to the processor executing
+%% the store, or because data overwritten by the store is still in a cache elsewhere in the
+%% system. When ``gl:memoryBarrier'' is called, the GL flushes and/or invalidates any caches
+%% relevant to the operations specified by the `Barriers' parameter to ensure consistent
+%% ordering of operations across the barrier.
+%%
+%% To allow for independent shader invocations to communicate by reads and writes to a common
+%% memory address, image variables in the OpenGL Shading Language may be declared as "coherent".
+%% Buffer object or texture image memory accessed through such variables may be cached only
+%% if caches are automatically updated due to stores issued by any other shader invocation.
+%% If the same address is accessed using both coherent and non-coherent variables, the accesses
+%% using variables declared as coherent will observe the results stored using coherent variables
+%% in other invocations. Using variables declared as "coherent" guarantees only that the
+%% results of stores will be immediately visible to shader invocations using similarly-declared
+%% variables; calling ``gl:memoryBarrier'' is required to ensure that the stores are visible
+%% to other operations.
+%%
+%% The following guidelines may be helpful in choosing when to use coherent memory accesses
+%% and when to use barriers.
+%%
+%% Data that are read-only or constant may be accessed without using coherent variables or
+%% calling MemoryBarrier(). Updates to the read-only data via API calls such as BufferSubData
+%% will invalidate shader caches implicitly as required.
+%%
+%% Data that are shared between shader invocations at a fine granularity (e.g., written by
+%% one invocation, consumed by another invocation) should use coherent variables to read
+%% and write the shared data.
+%%
+%% Data written by one shader invocation and consumed by other shader invocations launched
+%% as a result of its execution ("dependent invocations") should use coherent variables in
+%% the producing shader invocation and call memoryBarrier() after the last write. The consuming
+%% shader invocation should also use coherent variables.
+%%
+%% Data written to image variables in one rendering pass and read by the shader in a later
+%% pass need not use coherent variables or memoryBarrier(). Calling MemoryBarrier() with
+%% the SHADER_IMAGE_ACCESS_BARRIER_BIT set in `Barriers' between passes is necessary.
+%%
+%% Data written by the shader in one rendering pass and read by another mechanism (e.g.,
+%% vertex or index buffer pulling) in a later pass need not use coherent variables or memoryBarrier().
+%% Calling ``gl:memoryBarrier'' with the appropriate bits set in `Barriers' between
+%% passes is necessary.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glMemoryBarrier.xml">external</a> documentation.
+-spec memoryBarrier(Barriers) -> ok when Barriers :: integer().
+memoryBarrier(Barriers) ->
+ cast(5866, <<Barriers:?GLbitfield>>).
+
+%% @doc Simultaneously specify storage for all levels of a one-dimensional texture
+%%
+%% ``gl:texStorage1D'' specifies the storage requirements for all levels of a one-dimensional
+%% texture simultaneously. Once a texture is specified with this command, the format and
+%% dimensions of all levels become immutable unless it is a proxy texture. The contents of
+%% the image may still be modified, however, its storage requirements may not change. Such
+%% a texture is referred to as an `immutable-format' texture.
+%%
+%% Calling ``gl:texStorage1D'' is equivalent, assuming no errors are generated, to executing
+%% the following pseudo-code: for (i = 0; i &lt; levels; i++) { glTexImage1D(target, i,
+%% internalformat, width, 0, format, type, NULL); width = max(1, (width / 2)); }
+%%
+%% Since no texture data is actually provided, the values used in the pseudo-code for `Format'
+%% and `Type' are irrelevant and may be considered to be any values that are legal
+%% for the chosen `Internalformat' enumerant. `Internalformat' must be one of the
+%% sized internal formats given in Table 1 below, one of the sized depth-component formats `?GL_DEPTH_COMPONENT32F'
+%% , `?GL_DEPTH_COMPONENT24', or `?GL_DEPTH_COMPONENT16', or one of the combined
+%% depth-stencil formats, `?GL_DEPTH32F_STENCIL8', or `?GL_DEPTH24_STENCIL8'. Upon
+%% success, the value of `?GL_TEXTURE_IMMUTABLE_FORMAT' becomes `?GL_TRUE'. The
+%% value of `?GL_TEXTURE_IMMUTABLE_FORMAT' may be discovered by calling {@link gl:getTexParameterfv/2}
+%% with `Pname' set to `?GL_TEXTURE_IMMUTABLE_FORMAT'. No further changes to the
+%% dimensions or format of the texture object may be made. Using any command that might alter
+%% the dimensions or format of the texture object (such as {@link gl:texImage1D/8} or another
+%% call to ``gl:texStorage1D'') will result in the generation of a `?GL_INVALID_OPERATION'
+%% error, even if it would not, in fact, alter the dimensions or format of the object.
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexStorage1D.xml">external</a> documentation.
+-spec texStorage1D(Target, Levels, Internalformat, Width) -> ok when Target :: enum(),Levels :: integer(),Internalformat :: enum(),Width :: integer().
+texStorage1D(Target,Levels,Internalformat,Width) ->
+ cast(5867, <<Target:?GLenum,Levels:?GLsizei,Internalformat:?GLenum,Width:?GLsizei>>).
+
+%% @doc Simultaneously specify storage for all levels of a two-dimensional or one-dimensional array texture
+%%
+%% ``gl:texStorage2D'' specifies the storage requirements for all levels of a two-dimensional
+%% texture or one-dimensional texture array simultaneously. Once a texture is specified with
+%% this command, the format and dimensions of all levels become immutable unless it is a
+%% proxy texture. The contents of the image may still be modified, however, its storage requirements
+%% may not change. Such a texture is referred to as an `immutable-format' texture.
+%%
+%% The behavior of ``gl:texStorage2D'' depends on the `Target' parameter. When `Target'
+%% is `?GL_TEXTURE_2D', `?GL_PROXY_TEXTURE_2D', `?GL_TEXTURE_RECTANGLE', `?GL_PROXY_TEXTURE_RECTANGLE'
+%% or `?GL_PROXY_TEXTURE_CUBE_MAP', calling ``gl:texStorage2D'' is equivalent, assuming
+%% no errors are generated, to executing the following pseudo-code: for (i = 0; i &lt; levels;
+%% i++) { glTexImage2D(target, i, internalformat, width, height, 0, format, type, NULL);
+%% width = max(1, (width / 2)); height = max(1, (height / 2)); }
+%%
+%% When `Target' is `?GL_TEXTURE_CUBE_MAP', ``gl:texStorage2D'' is equivalent
+%% to: for (i = 0; i &lt; levels; i++) { for (face in (+X, -X, +Y, -Y, +Z, -Z)) { glTexImage2D(face,
+%% i, internalformat, width, height, 0, format, type, NULL); } width = max(1, (width / 2));
+%% height = max(1, (height / 2)); }
+%%
+%% When `Target' is `?GL_TEXTURE_1D' or `?GL_TEXTURE_1D_ARRAY', ``gl:texStorage2D''
+%% is equivalent to: for (i = 0; i &lt; levels; i++) { glTexImage2D(target, i, internalformat,
+%% width, height, 0, format, type, NULL); width = max(1, (width / 2)); }
+%%
+%% Since no texture data is actually provided, the values used in the pseudo-code for `Format'
+%% and `Type' are irrelevant and may be considered to be any values that are legal
+%% for the chosen `Internalformat' enumerant. `Internalformat' must be one of the
+%% sized internal formats given in Table 1 below, one of the sized depth-component formats `?GL_DEPTH_COMPONENT32F'
+%% , `?GL_DEPTH_COMPONENT24', or `?GL_DEPTH_COMPONENT16', or one of the combined
+%% depth-stencil formats, `?GL_DEPTH32F_STENCIL8', or `?GL_DEPTH24_STENCIL8'. Upon
+%% success, the value of `?GL_TEXTURE_IMMUTABLE_FORMAT' becomes `?GL_TRUE'. The
+%% value of `?GL_TEXTURE_IMMUTABLE_FORMAT' may be discovered by calling {@link gl:getTexParameterfv/2}
+%% with `Pname' set to `?GL_TEXTURE_IMMUTABLE_FORMAT'. No further changes to the
+%% dimensions or format of the texture object may be made. Using any command that might alter
+%% the dimensions or format of the texture object (such as {@link gl:texImage2D/9} or another
+%% call to ``gl:texStorage2D'') will result in the generation of a `?GL_INVALID_OPERATION'
+%% error, even if it would not, in fact, alter the dimensions or format of the object.
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexStorage2D.xml">external</a> documentation.
+-spec texStorage2D(Target, Levels, Internalformat, Width, Height) -> ok when Target :: enum(),Levels :: integer(),Internalformat :: enum(),Width :: integer(),Height :: integer().
+texStorage2D(Target,Levels,Internalformat,Width,Height) ->
+ cast(5868, <<Target:?GLenum,Levels:?GLsizei,Internalformat:?GLenum,Width:?GLsizei,Height:?GLsizei>>).
+
+%% @doc Simultaneously specify storage for all levels of a three-dimensional, two-dimensional array or cube-map array texture
+%%
+%% ``gl:texStorage3D'' specifies the storage requirements for all levels of a three-dimensional,
+%% two-dimensional array or cube-map array texture simultaneously. Once a texture is specified
+%% with this command, the format and dimensions of all levels become immutable unless it
+%% is a proxy texture. The contents of the image may still be modified, however, its storage
+%% requirements may not change. Such a texture is referred to as an `immutable-format'
+%% texture.
+%%
+%% The behavior of ``gl:texStorage3D'' depends on the `Target' parameter. When `Target'
+%% is `?GL_TEXTURE_3D', or `?GL_PROXY_TEXTURE_3D', calling ``gl:texStorage3D''
+%% is equivalent, assuming no errors are generated, to executing the following pseudo-code:
+%% for (i = 0; i &lt; levels; i++) { glTexImage3D(target, i, internalformat, width, height,
+%% depth, 0, format, type, NULL); width = max(1, (width / 2)); height = max(1, (height /
+%% 2)); depth = max(1, (depth / 2)); }
+%%
+%% When `Target' is `?GL_TEXTURE_2D_ARRAY', `?GL_PROXY_TEXTURE_2D_ARRAY', `?GL_TEXTURE_CUBE_MAP_ARRAY'
+%% , or `?GL_PROXY_TEXTURE_CUBE_MAP_ARRAY', ``gl:texStorage3D'' is equivalent to:
+%% for (i = 0; i &lt; levels; i++) { glTexImage3D(target, i, internalformat, width, height,
+%% depth, 0, format, type, NULL); width = max(1, (width / 2)); height = max(1, (height /
+%% 2)); }
+%%
+%% Since no texture data is actually provided, the values used in the pseudo-code for `Format'
+%% and `Type' are irrelevant and may be considered to be any values that are legal
+%% for the chosen `Internalformat' enumerant. `Internalformat' must be one of the
+%% sized internal formats given in Table 1 below, one of the sized depth-component formats `?GL_DEPTH_COMPONENT32F'
+%% , `?GL_DEPTH_COMPONENT24', or `?GL_DEPTH_COMPONENT16', or one of the combined
+%% depth-stencil formats, `?GL_DEPTH32F_STENCIL8', or `?GL_DEPTH24_STENCIL8'. Upon
+%% success, the value of `?GL_TEXTURE_IMMUTABLE_FORMAT' becomes `?GL_TRUE'. The
+%% value of `?GL_TEXTURE_IMMUTABLE_FORMAT' may be discovered by calling {@link gl:getTexParameterfv/2}
+%% with `Pname' set to `?GL_TEXTURE_IMMUTABLE_FORMAT'. No further changes to the
+%% dimensions or format of the texture object may be made. Using any command that might alter
+%% the dimensions or format of the texture object (such as {@link gl:texImage3D/10} or another
+%% call to ``gl:texStorage3D'') will result in the generation of a `?GL_INVALID_OPERATION'
+%% error, even if it would not, in fact, alter the dimensions or format of the object.
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexStorage3D.xml">external</a> documentation.
+-spec texStorage3D(Target, Levels, Internalformat, Width, Height, Depth) -> ok when Target :: enum(),Levels :: integer(),Internalformat :: enum(),Width :: integer(),Height :: integer(),Depth :: integer().
+texStorage3D(Target,Levels,Internalformat,Width,Height,Depth) ->
+ cast(5869, <<Target:?GLenum,Levels:?GLsizei,Internalformat:?GLenum,Width:?GLsizei,Height:?GLsizei,Depth:?GLsizei>>).
+
+%% @doc glDepthBoundsEXT
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glDepthBoundsEXT.xml">external</a> documentation.
+-spec depthBoundsEXT(Zmin, Zmax) -> ok when Zmin :: clamp(),Zmax :: clamp().
depthBoundsEXT(Zmin,Zmax) ->
- cast(5862, <<Zmin:?GLclampd,Zmax:?GLclampd>>).
+ cast(5870, <<Zmin:?GLclampd,Zmax:?GLclampd>>).
-%% @spec (StencilTagBits::integer(),StencilClearTag::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glStencilClearTagEXT.xml">external</a> documentation.
--spec stencilClearTagEXT(integer(),integer()) -> ok.
+%% @doc glStencilClearTagEXT
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/glStencilClearTagEXT.xml">external</a> documentation.
+-spec stencilClearTagEXT(StencilTagBits, StencilClearTag) -> ok when StencilTagBits :: integer(),StencilClearTag :: integer().
stencilClearTagEXT(StencilTagBits,StencilClearTag) ->
- cast(5863, <<StencilTagBits:?GLsizei,StencilClearTag:?GLuint>>).
+ cast(5871, <<StencilTagBits:?GLsizei,StencilClearTag:?GLuint>>).
diff --git a/lib/wx/src/gen/glu.erl b/lib/wx/src/gen/glu.erl
index c16f0cf125..2c82c9792f 100644
--- a/lib/wx/src/gen/glu.erl
+++ b/lib/wx/src/gen/glu.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -25,11 +25,6 @@
%%
%% Booleans are represented by integers 0 and 1.
-%% @type mem(). memory block
-%% @type enum(). An integer defined in gl.hrl
-%% @type offset(). An integer which is an offset in an array
-%% @type clamp(). A float clamped between 0.0 - 1.0
-
-module(glu).
-compile(inline).
-define(GLenum,32/native-unsigned).
@@ -53,8 +48,13 @@
-define(GLsync,64/native-unsigned).
-define(GLuint64,64/native-unsigned).
-define(GLint64,64/native-signed).
--type enum() :: non_neg_integer().
--type mem() :: binary() | tuple().
+-type vertex() :: {float(), float(), float()}.
+-type enum() :: non_neg_integer(). %% See wx/include/gl.hrl or glu.hrl
+-type matrix() :: {float(),float(),float(),float(),
+ float(),float(),float(),float(),
+ float(),float(),float(),float(),
+ float(),float(),float(),float()}.
+-type mem() :: binary() | tuple(). %% Memory block
-export([tesselate/2,build1DMipmapLevels/9,build1DMipmaps/6,build2DMipmapLevels/10,
build2DMipmaps/7,build3DMipmapLevels/11,build3DMipmaps/8,checkExtension/2,
@@ -66,193 +66,676 @@
-import(gl, [call/2,cast/2,send_bin/1]).
%% API
-%% @spec (Vec3, [Vec3]) -> {Triangles, VertexPos}
-%% Vec3 = {float(),float(),float()}
-%% Triangles = [VertexIndex::integer()]
-%% VertexPos = binary()
%% @doc General purpose polygon triangulation.
%% The first argument is the normal and the second a list of
%% vertex positions. Returned is a list of indecies of the vertices
%% and a binary (64bit native float) containing an array of
%% vertex positions, it starts with the vertices in Vs and
%% may contain newly created vertices in the end.
+-spec tesselate(Normal, [Vs]) -> {Triangles, VertexPos}
+ when Normal :: vertex(), Vs :: vertex(),
+ Triangles :: [integer()], VertexPos :: binary().
tesselate({Nx,Ny,Nz}, Vs) ->
call(5000, <<(length(Vs)):32/native,0:32,
Nx:?GLdouble,Ny:?GLdouble,Nz:?GLdouble,
(<< <<Vx:?GLdouble,Vy:?GLdouble,Vz:?GLdouble >>
|| {Vx,Vy,Vz} <- Vs>>)/binary >>).
-%% @spec (Target::enum(),InternalFormat::integer(),Width::integer(),Format::enum(),Type::enum(),Level::integer(),Base::integer(),Max::integer(),Data::binary()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluBuild1DMipmapLevels.xml">external</a> documentation.
--spec build1DMipmapLevels(enum(),integer(),integer(),enum(),enum(),integer(),integer(),integer(),binary()) -> integer().
+%% @doc Builds a subset of one-dimensional mipmap levels
+%%
+%% ``glu:build1DMipmapLevels'' builds a subset of prefiltered one-dimensional texture maps
+%% of decreasing resolutions called a mipmap. This is used for the antialiasing of texture
+%% mapped primitives.
+%%
+%% A return value of zero indicates success, otherwise a GLU error code is returned (see {@link glu:errorString/1}
+%% ).
+%%
+%% A series of mipmap levels from `Base' to `Max' is built by decimating `Data'
+%% in half until size 1*1 is reached. At each level, each texel in the halved mipmap
+%% level is an average of the corresponding two texels in the larger mipmap level. {@link gl:texImage1D/8}
+%% is called to load these mipmap levels from `Base' to `Max' . If `Max' is
+%% larger than the highest mipmap level for the texture of the specified size, then a GLU
+%% error code is returned (see {@link glu:errorString/1} ) and nothing is loaded.
+%%
+%% For example, if `Level' is 2 and `Width' is 16, the following levels are possible:
+%% 16*1, 8*1, 4*1, 2*1, 1*1. These correspond to levels 2 through 6 respectively.
+%% If `Base' is 3 and `Max' is 5, then only mipmap levels 8*1, 4*1 and 2*1
+%% are loaded. However, if `Max' is 7, then an error is returned and nothing is loaded
+%% since `Max' is larger than the highest mipmap level which is, in this case, 6.
+%%
+%% The highest mipmap level can be derived from the formula log 2(width*2 level).
+%%
+%% See the {@link gl:texImage1D/8} reference page for a description of the acceptable values
+%% for `Type' parameter. See the {@link gl:drawPixels/5} reference page for a description
+%% of the acceptable values for `Level' parameter.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluBuild1DMipmapLevels.xml">external</a> documentation.
+-spec build1DMipmapLevels(Target, InternalFormat, Width, Format, Type, Level, Base, Max, Data) -> integer() when Target :: enum(),InternalFormat :: integer(),Width :: integer(),Format :: enum(),Type :: enum(),Level :: integer(),Base :: integer(),Max :: integer(),Data :: binary().
build1DMipmapLevels(Target,InternalFormat,Width,Format,Type,Level,Base,Max,Data) ->
send_bin(Data),
call(5010, <<Target:?GLenum,InternalFormat:?GLint,Width:?GLsizei,Format:?GLenum,Type:?GLenum,Level:?GLint,Base:?GLint,Max:?GLint>>).
-%% @spec (Target::enum(),InternalFormat::integer(),Width::integer(),Format::enum(),Type::enum(),Data::binary()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluBuild1DMipmaps.xml">external</a> documentation.
--spec build1DMipmaps(enum(),integer(),integer(),enum(),enum(),binary()) -> integer().
+%% @doc Builds a one-dimensional mipmap
+%%
+%% ``glu:build1DMipmaps'' builds a series of prefiltered one-dimensional texture maps of
+%% decreasing resolutions called a mipmap. This is used for the antialiasing of texture mapped
+%% primitives.
+%%
+%% A return value of zero indicates success, otherwise a GLU error code is returned (see {@link glu:errorString/1}
+%% ).
+%%
+%% Initially, the `Width' of `Data' is checked to see if it is a power of 2. If
+%% not, a copy of `Data' is scaled up or down to the nearest power of 2. (If `Width'
+%% is exactly between powers of 2, then the copy of `Data' will scale upwards.) This
+%% copy will be used for subsequent mipmapping operations described below. For example, if `Width'
+%% is 57, then a copy of `Data' will scale up to 64 before mipmapping takes place.
+%%
+%% Then, proxy textures (see {@link gl:texImage1D/8} ) are used to determine if the implementation
+%% can fit the requested texture. If not, `Width' is continually halved until it fits.
+%%
+%% Next, a series of mipmap levels is built by decimating a copy of `Data' in half
+%% until size 1*1 is reached. At each level, each texel in the halved mipmap level is an
+%% average of the corresponding two texels in the larger mipmap level.
+%%
+%% {@link gl:texImage1D/8} is called to load each of these mipmap levels. Level 0 is a copy
+%% of `Data' . The highest level is (log 2)(width). For example, if `Width' is 64 and the implementation
+%% can store a texture of this size, the following mipmap levels are built: 64*1, 32*1,
+%% 16*1, 8*1, 4*1, 2*1, and 1*1. These correspond to levels 0 through 6, respectively.
+%%
+%%
+%% See the {@link gl:texImage1D/8} reference page for a description of the acceptable values
+%% for the `Type' parameter. See the {@link gl:drawPixels/5} reference page for a description
+%% of the acceptable values for the `Data' parameter.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluBuild1DMipmaps.xml">external</a> documentation.
+-spec build1DMipmaps(Target, InternalFormat, Width, Format, Type, Data) -> integer() when Target :: enum(),InternalFormat :: integer(),Width :: integer(),Format :: enum(),Type :: enum(),Data :: binary().
build1DMipmaps(Target,InternalFormat,Width,Format,Type,Data) ->
send_bin(Data),
call(5011, <<Target:?GLenum,InternalFormat:?GLint,Width:?GLsizei,Format:?GLenum,Type:?GLenum>>).
-%% @spec (Target::enum(),InternalFormat::integer(),Width::integer(),Height::integer(),Format::enum(),Type::enum(),Level::integer(),Base::integer(),Max::integer(),Data::binary()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluBuild2DMipmapLevels.xml">external</a> documentation.
--spec build2DMipmapLevels(enum(),integer(),integer(),integer(),enum(),enum(),integer(),integer(),integer(),binary()) -> integer().
+%% @doc Builds a subset of two-dimensional mipmap levels
+%%
+%% ``glu:build2DMipmapLevels'' builds a subset of prefiltered two-dimensional texture maps
+%% of decreasing resolutions called a mipmap. This is used for the antialiasing of texture
+%% mapped primitives.
+%%
+%% A return value of zero indicates success, otherwise a GLU error code is returned (see {@link glu:errorString/1}
+%% ).
+%%
+%% A series of mipmap levels from `Base' to `Max' is built by decimating `Data'
+%% in half along both dimensions until size 1*1 is reached. At each level, each texel
+%% in the halved mipmap level is an average of the corresponding four texels in the larger
+%% mipmap level. (In the case of rectangular images, the decimation will ultimately reach
+%% an N*1 or 1*N configuration. Here, two texels are averaged instead.) {@link gl:texImage2D/9}
+%% is called to load these mipmap levels from `Base' to `Max' . If `Max' is
+%% larger than the highest mipmap level for the texture of the specified size, then a GLU
+%% error code is returned (see {@link glu:errorString/1} ) and nothing is loaded.
+%%
+%% For example, if `Level' is 2 and `Width' is 16 and `Height' is 8, the
+%% following levels are possible: 16*8, 8*4, 4*2, 2*1, 1*1. These correspond to
+%% levels 2 through 6 respectively. If `Base' is 3 and `Max' is 5, then only mipmap
+%% levels 8*4, 4*2, and 2*1 are loaded. However, if `Max' is 7, then an error is
+%% returned and nothing is loaded since `Max' is larger than the highest mipmap level
+%% which is, in this case, 6.
+%%
+%% The highest mipmap level can be derived from the formula log 2(max(width height)*2 level).
+%%
+%% See the {@link gl:texImage1D/8} reference page for a description of the acceptable values
+%% for `Format' parameter. See the {@link gl:drawPixels/5} reference page for a description
+%% of the acceptable values for `Type' parameter.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluBuild2DMipmapLevels.xml">external</a> documentation.
+-spec build2DMipmapLevels(Target, InternalFormat, Width, Height, Format, Type, Level, Base, Max, Data) -> integer() when Target :: enum(),InternalFormat :: integer(),Width :: integer(),Height :: integer(),Format :: enum(),Type :: enum(),Level :: integer(),Base :: integer(),Max :: integer(),Data :: binary().
build2DMipmapLevels(Target,InternalFormat,Width,Height,Format,Type,Level,Base,Max,Data) ->
send_bin(Data),
call(5012, <<Target:?GLenum,InternalFormat:?GLint,Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum,Level:?GLint,Base:?GLint,Max:?GLint>>).
-%% @spec (Target::enum(),InternalFormat::integer(),Width::integer(),Height::integer(),Format::enum(),Type::enum(),Data::binary()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluBuild2DMipmaps.xml">external</a> documentation.
--spec build2DMipmaps(enum(),integer(),integer(),integer(),enum(),enum(),binary()) -> integer().
+%% @doc Builds a two-dimensional mipmap
+%%
+%% ``glu:build2DMipmaps'' builds a series of prefiltered two-dimensional texture maps of
+%% decreasing resolutions called a mipmap. This is used for the antialiasing of texture-mapped
+%% primitives.
+%%
+%% A return value of zero indicates success, otherwise a GLU error code is returned (see {@link glu:errorString/1}
+%% ).
+%%
+%% Initially, the `Width' and `Height' of `Data' are checked to see if they
+%% are a power of 2. If not, a copy of `Data' (not `Data' ), is scaled up or down
+%% to the nearest power of 2. This copy will be used for subsequent mipmapping operations
+%% described below. (If `Width' or `Height' is exactly between powers of 2, then
+%% the copy of `Data' will scale upwards.) For example, if `Width' is 57 and `Height'
+%% is 23, then a copy of `Data' will scale up to 64 in `Width' and down to 16
+%% in depth, before mipmapping takes place.
+%%
+%% Then, proxy textures (see {@link gl:texImage2D/9} ) are used to determine if the implementation
+%% can fit the requested texture. If not, both dimensions are continually halved until it
+%% fits. (If the OpenGL version is (&lt;= 1.0, both maximum texture dimensions are clamped
+%% to the value returned by {@link gl:getBooleanv/1} with the argument `?GLU_MAX_TEXTURE_SIZE'
+%% .)
+%%
+%% Next, a series of mipmap levels is built by decimating a copy of `Data' in half
+%% along both dimensions until size 1*1 is reached. At each level, each texel in the halved
+%% mipmap level is an average of the corresponding four texels in the larger mipmap level.
+%% (In the case of rectangular images, the decimation will ultimately reach an N*1 or 1*N
+%% configuration. Here, two texels are averaged instead.)
+%%
+%% {@link gl:texImage2D/9} is called to load each of these mipmap levels. Level 0 is a copy
+%% of `Data' . The highest level is (log 2)(max(width height)). For example, if `Width' is 64 and `Height'
+%% is 16 and the implementation can store a texture of this size, the following mipmap levels
+%% are built: 64*16, 32*8, 16*4, 8*2, 4*1, 2*1, and 1*1 These correspond to
+%% levels 0 through 6, respectively.
+%%
+%% See the {@link gl:texImage1D/8} reference page for a description of the acceptable values
+%% for `Format' parameter. See the {@link gl:drawPixels/5} reference page for a description
+%% of the acceptable values for `Type' parameter.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluBuild2DMipmaps.xml">external</a> documentation.
+-spec build2DMipmaps(Target, InternalFormat, Width, Height, Format, Type, Data) -> integer() when Target :: enum(),InternalFormat :: integer(),Width :: integer(),Height :: integer(),Format :: enum(),Type :: enum(),Data :: binary().
build2DMipmaps(Target,InternalFormat,Width,Height,Format,Type,Data) ->
send_bin(Data),
call(5013, <<Target:?GLenum,InternalFormat:?GLint,Width:?GLsizei,Height:?GLsizei,Format:?GLenum,Type:?GLenum>>).
-%% @spec (Target::enum(),InternalFormat::integer(),Width::integer(),Height::integer(),Depth::integer(),Format::enum(),Type::enum(),Level::integer(),Base::integer(),Max::integer(),Data::binary()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluBuild3DMipmapLevels.xml">external</a> documentation.
--spec build3DMipmapLevels(enum(),integer(),integer(),integer(),integer(),enum(),enum(),integer(),integer(),integer(),binary()) -> integer().
+%% @doc Builds a subset of three-dimensional mipmap levels
+%%
+%% ``glu:build3DMipmapLevels'' builds a subset of prefiltered three-dimensional texture
+%% maps of decreasing resolutions called a mipmap. This is used for the antialiasing of texture
+%% mapped primitives.
+%%
+%% A return value of zero indicates success, otherwise a GLU error code is returned (see {@link glu:errorString/1}
+%% ).
+%%
+%% A series of mipmap levels from `Base' to `Max' is built by decimating `Data'
+%% in half along both dimensions until size 1*1*1 is reached. At each level, each texel
+%% in the halved mipmap level is an average of the corresponding eight texels in the larger
+%% mipmap level. (If exactly one of the dimensions is 1, four texels are averaged. If exactly
+%% two of the dimensions are 1, two texels are averaged.) {@link gl:texImage3D/10} is called
+%% to load these mipmap levels from `Base' to `Max' . If `Max' is larger than
+%% the highest mipmap level for the texture of the specified size, then a GLU error code
+%% is returned (see {@link glu:errorString/1} ) and nothing is loaded.
+%%
+%% For example, if `Level' is 2 and `Width' is 16, `Height' is 8 and `Depth'
+%% is 4, the following levels are possible: 16*8*4, 8*4*2, 4*2*1, 2*1*1, 1*1*1.
+%% These correspond to levels 2 through 6 respectively. If `Base' is 3 and `Max'
+%% is 5, then only mipmap levels 8*4*2, 4*2*1, and 2*1*1 are loaded. However, if `Max'
+%% is 7, then an error is returned and nothing is loaded, since `Max' is larger than
+%% the highest mipmap level which is, in this case, 6.
+%%
+%% The highest mipmap level can be derived from the formula log 2(max(width height depth)*2 level).
+%%
+%% See the {@link gl:texImage1D/8} reference page for a description of the acceptable values
+%% for `Format' parameter. See the {@link gl:drawPixels/5} reference page for a description
+%% of the acceptable values for `Type' parameter.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluBuild3DMipmapLevels.xml">external</a> documentation.
+-spec build3DMipmapLevels(Target, InternalFormat, Width, Height, Depth, Format, Type, Level, Base, Max, Data) -> integer() when Target :: enum(),InternalFormat :: integer(),Width :: integer(),Height :: integer(),Depth :: integer(),Format :: enum(),Type :: enum(),Level :: integer(),Base :: integer(),Max :: integer(),Data :: binary().
build3DMipmapLevels(Target,InternalFormat,Width,Height,Depth,Format,Type,Level,Base,Max,Data) ->
send_bin(Data),
call(5014, <<Target:?GLenum,InternalFormat:?GLint,Width:?GLsizei,Height:?GLsizei,Depth:?GLsizei,Format:?GLenum,Type:?GLenum,Level:?GLint,Base:?GLint,Max:?GLint>>).
-%% @spec (Target::enum(),InternalFormat::integer(),Width::integer(),Height::integer(),Depth::integer(),Format::enum(),Type::enum(),Data::binary()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluBuild3DMipmaps.xml">external</a> documentation.
--spec build3DMipmaps(enum(),integer(),integer(),integer(),integer(),enum(),enum(),binary()) -> integer().
+%% @doc Builds a three-dimensional mipmap
+%%
+%% ``glu:build3DMipmaps'' builds a series of prefiltered three-dimensional texture maps
+%% of decreasing resolutions called a mipmap. This is used for the antialiasing of texture-mapped
+%% primitives.
+%%
+%% A return value of zero indicates success, otherwise a GLU error code is returned (see {@link glu:errorString/1}
+%% ).
+%%
+%% Initially, the `Width' , `Height' and `Depth' of `Data' are checked
+%% to see if they are a power of 2. If not, a copy of `Data' is made and scaled up or
+%% down to the nearest power of 2. (If `Width' , `Height' , or `Depth' is exactly
+%% between powers of 2, then the copy of `Data' will scale upwards.) This copy will
+%% be used for subsequent mipmapping operations described below. For example, if `Width'
+%% is 57, `Height' is 23, and `Depth' is 24, then a copy of `Data' will scale
+%% up to 64 in width, down to 16 in height, and up to 32 in depth before mipmapping takes
+%% place.
+%%
+%% Then, proxy textures (see {@link gl:texImage3D/10} ) are used to determine if the implementation
+%% can fit the requested texture. If not, all three dimensions are continually halved until
+%% it fits.
+%%
+%% Next, a series of mipmap levels is built by decimating a copy of `Data' in half
+%% along all three dimensions until size 1*1*1 is reached. At each level, each texel in
+%% the halved mipmap level is an average of the corresponding eight texels in the larger
+%% mipmap level. (If exactly one of the dimensions is 1, four texels are averaged. If exactly
+%% two of the dimensions are 1, two texels are averaged.)
+%%
+%% {@link gl:texImage3D/10} is called to load each of these mipmap levels. Level 0 is a copy
+%% of `Data' . The highest level is (log 2)(max(width height depth)). For example, if `Width' is 64, `Height'
+%% is 16, and `Depth' is 32, and the implementation can store a texture of this size,
+%% the following mipmap levels are built: 64*16*32, 32*8*16, 16*4*8, 8*2*4, 4*1*2,
+%% 2*1*1, and 1*1*1. These correspond to levels 0 through 6, respectively.
+%%
+%% See the {@link gl:texImage1D/8} reference page for a description of the acceptable values
+%% for `Format' parameter. See the {@link gl:drawPixels/5} reference page for a description
+%% of the acceptable values for `Type' parameter.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluBuild3DMipmaps.xml">external</a> documentation.
+-spec build3DMipmaps(Target, InternalFormat, Width, Height, Depth, Format, Type, Data) -> integer() when Target :: enum(),InternalFormat :: integer(),Width :: integer(),Height :: integer(),Depth :: integer(),Format :: enum(),Type :: enum(),Data :: binary().
build3DMipmaps(Target,InternalFormat,Width,Height,Depth,Format,Type,Data) ->
send_bin(Data),
call(5015, <<Target:?GLenum,InternalFormat:?GLint,Width:?GLsizei,Height:?GLsizei,Depth:?GLsizei,Format:?GLenum,Type:?GLenum>>).
-%% @spec (ExtName::string(),ExtString::string()) -> 0|1
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluCheckExtension.xml">external</a> documentation.
--spec checkExtension(string(),string()) -> 0|1.
+%% @doc Determines if an extension name is supported
+%%
+%% ``glu:checkExtension'' returns `?GLU_TRUE' if `ExtName' is supported otherwise
+%% `?GLU_FALSE' is returned.
+%%
+%% This is used to check for the presence for OpenGL, GLU, or GLX extension names by passing
+%% the extension strings returned by {@link gl:getString/1} , {@link glu:getString/1} , see `glXGetClientString'
+%% , see `glXQueryExtensionsString', or see `glXQueryServerString', respectively,
+%% as `ExtString' .
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluCheckExtension.xml">external</a> documentation.
+-spec checkExtension(ExtName, ExtString) -> 0|1 when ExtName :: string(),ExtString :: string().
checkExtension(ExtName,ExtString) ->
call(5016, <<(list_to_binary([ExtName|[0]]))/binary,0:((8-((length(ExtName)+ 1) rem 8)) rem 8),(list_to_binary([ExtString|[0]]))/binary,0:((8-((length(ExtString)+ 1) rem 8)) rem 8)>>).
-%% @spec (Quad::integer(),Base::float(),Top::float(),Height::float(),Slices::integer(),Stacks::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluCylinder.xml">external</a> documentation.
--spec cylinder(integer(),float(),float(),float(),integer(),integer()) -> ok.
+%% @doc Draw a cylinder
+%%
+%% ``glu:cylinder'' draws a cylinder oriented along the `z' axis. The base of the
+%% cylinder is placed at `z' = 0 and the top at z= height. Like a sphere, a cylinder
+%% is subdivided around the `z' axis into slices and along the `z' axis into stacks.
+%%
+%%
+%% Note that if `Top' is set to 0.0, this routine generates a cone.
+%%
+%% If the orientation is set to `?GLU_OUTSIDE' (with {@link glu:quadricOrientation/2} ),
+%% then any generated normals point away from the `z' axis. Otherwise, they point toward
+%% the `z' axis.
+%%
+%% If texturing is turned on (with {@link glu:quadricTexture/2} ), then texture coordinates
+%% are generated so that `t' ranges linearly from 0.0 at `z' = 0 to 1.0 at `z'
+%% = `Height' , and `s' ranges from 0.0 at the +`y' axis, to 0.25 at the +`x'
+%% axis, to 0.5 at the -`y' axis, to 0.75 at the -`x' axis, and back to 1.0
+%% at the +`y' axis.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluCylinder.xml">external</a> documentation.
+-spec cylinder(Quad, Base, Top, Height, Slices, Stacks) -> ok when Quad :: integer(),Base :: float(),Top :: float(),Height :: float(),Slices :: integer(),Stacks :: integer().
cylinder(Quad,Base,Top,Height,Slices,Stacks) ->
cast(5017, <<Quad:?GLUquadric,Base:?GLdouble,Top:?GLdouble,Height:?GLdouble,Slices:?GLint,Stacks:?GLint>>).
-%% @spec (Quad::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluDeleteQuadric.xml">external</a> documentation.
--spec deleteQuadric(integer()) -> ok.
+%% @doc Destroy a quadrics object
+%%
+%% ``glu:deleteQuadric'' destroys the quadrics object (created with {@link glu:newQuadric/0} )
+%% and frees any memory it uses. Once ``glu:deleteQuadric'' has been called, `Quad'
+%% cannot be used again.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluDeleteQuadric.xml">external</a> documentation.
+-spec deleteQuadric(Quad) -> ok when Quad :: integer().
deleteQuadric(Quad) ->
cast(5018, <<Quad:?GLUquadric>>).
-%% @spec (Quad::integer(),Inner::float(),Outer::float(),Slices::integer(),Loops::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluDisk.xml">external</a> documentation.
--spec disk(integer(),float(),float(),integer(),integer()) -> ok.
+%% @doc Draw a disk
+%%
+%% ``glu:disk'' renders a disk on the `z' = 0 plane. The disk has a radius of `Outer'
+%% and contains a concentric circular hole with a radius of `Inner' . If `Inner'
+%% is 0, then no hole is generated. The disk is subdivided around the `z' axis into
+%% slices (like pizza slices) and also about the `z' axis into rings (as specified by `Slices'
+%% and `Loops' , respectively).
+%%
+%% With respect to orientation, the +`z' side of the disk is considered to be ``outside''
+%% (see {@link glu:quadricOrientation/2} ). This means that if the orientation is set to `?GLU_OUTSIDE'
+%% , then any normals generated point along the +`z' axis. Otherwise, they point along
+%% the -`z' axis.
+%%
+%% If texturing has been turned on (with {@link glu:quadricTexture/2} ), texture coordinates
+%% are generated linearly such that where r= outer, the value at (`r', 0, 0) is (1,
+%% 0.5), at (0, `r', 0) it is (0.5, 1), at (-`r', 0, 0) it is (0, 0.5), and at
+%% (0, -`r', 0) it is (0.5, 0).
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluDisk.xml">external</a> documentation.
+-spec disk(Quad, Inner, Outer, Slices, Loops) -> ok when Quad :: integer(),Inner :: float(),Outer :: float(),Slices :: integer(),Loops :: integer().
disk(Quad,Inner,Outer,Slices,Loops) ->
cast(5019, <<Quad:?GLUquadric,Inner:?GLdouble,Outer:?GLdouble,Slices:?GLint,Loops:?GLint>>).
-%% @spec (Error::enum()) -> string()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluErrorString.xml">external</a> documentation.
--spec errorString(enum()) -> string().
+%% @doc Produce an error string from a GL or GLU error code
+%%
+%% ``glu:errorString'' produces an error string from a GL or GLU error code. The string
+%% is in ISO Latin 1 format. For example, ``glu:errorString''(`?GLU_OUT_OF_MEMORY')
+%% returns the string `out of memory'.
+%%
+%% The standard GLU error codes are `?GLU_INVALID_ENUM', `?GLU_INVALID_VALUE',
+%% and `?GLU_OUT_OF_MEMORY'. Certain other GLU functions can return specialized error
+%% codes through callbacks. See the {@link gl:getError/0} reference page for the list of
+%% GL error codes.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluErrorString.xml">external</a> documentation.
+-spec errorString(Error) -> string() when Error :: enum().
errorString(Error) ->
call(5020, <<Error:?GLenum>>).
-%% @spec (Name::enum()) -> string()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluGetString.xml">external</a> documentation.
--spec getString(enum()) -> string().
+%% @doc Return a string describing the GLU version or GLU extensions
+%%
+%% ``glu:getString'' returns a pointer to a static string describing the GLU version or
+%% the GLU extensions that are supported.
+%%
+%% The version number is one of the following forms:
+%%
+%% `major_number.minor_number'`major_number.minor_number.release_number'.
+%%
+%% The version string is of the following form:
+%%
+%% `version number&lt;space&gt;vendor-specific information'
+%%
+%% Vendor-specific information is optional. Its format and contents depend on the implementation.
+%%
+%%
+%% The standard GLU contains a basic set of features and capabilities. If a company or group
+%% of companies wish to support other features, these may be included as extensions to the
+%% GLU. If `Name' is `?GLU_EXTENSIONS', then ``glu:getString'' returns a space-separated
+%% list of names of supported GLU extensions. (Extension names never contain spaces.)
+%%
+%% All strings are null-terminated.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluGetString.xml">external</a> documentation.
+-spec getString(Name) -> string() when Name :: enum().
getString(Name) ->
call(5021, <<Name:?GLenum>>).
-%% @spec (EyeX::float(),EyeY::float(),EyeZ::float(),CenterX::float(),CenterY::float(),CenterZ::float(),UpX::float(),UpY::float(),UpZ::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluLookAt.xml">external</a> documentation.
--spec lookAt(float(),float(),float(),float(),float(),float(),float(),float(),float()) -> ok.
+%% @doc Define a viewing transformation
+%%
+%% ``glu:lookAt'' creates a viewing matrix derived from an eye point, a reference point
+%% indicating the center of the scene, and an `UP' vector.
+%%
+%% The matrix maps the reference point to the negative `z' axis and the eye point to
+%% the origin. When a typical projection matrix is used, the center of the scene therefore
+%% maps to the center of the viewport. Similarly, the direction described by the `UP'
+%% vector projected onto the viewing plane is mapped to the positive `y' axis so that
+%% it points upward in the viewport. The `UP' vector must not be parallel to the line
+%% of sight from the eye point to the reference point.
+%%
+%% Let
+%%
+%% F=(centerX-eyeX centerY-eyeY centerZ-eyeZ)
+%%
+%% Let `UP' be the vector (upX upY upZ).
+%%
+%% Then normalize as follows: f= F/(||F||)
+%%
+%% UP"= UP/(||UP||)
+%%
+%% Finally, let s= f*UP", and u= s*f.
+%%
+%% M is then constructed as follows: M=(s[0] s[1] s[2] 0 u[0] u[1] u[2] 0-f[0]-f[1]-f[2] 0 0 0 0 1)
+%%
+%% and ``glu:lookAt'' is equivalent to glMultMatrixf(M); glTranslated(-eyex, -eyey,
+%% -eyez);
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluLookAt.xml">external</a> documentation.
+-spec lookAt(EyeX, EyeY, EyeZ, CenterX, CenterY, CenterZ, UpX, UpY, UpZ) -> ok when EyeX :: float(),EyeY :: float(),EyeZ :: float(),CenterX :: float(),CenterY :: float(),CenterZ :: float(),UpX :: float(),UpY :: float(),UpZ :: float().
lookAt(EyeX,EyeY,EyeZ,CenterX,CenterY,CenterZ,UpX,UpY,UpZ) ->
cast(5022, <<EyeX:?GLdouble,EyeY:?GLdouble,EyeZ:?GLdouble,CenterX:?GLdouble,CenterY:?GLdouble,CenterZ:?GLdouble,UpX:?GLdouble,UpY:?GLdouble,UpZ:?GLdouble>>).
-%% @spec () -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluNewQuadric.xml">external</a> documentation.
+%% @doc Create a quadrics object
+%%
+%% ``glu:newQuadric'' creates and returns a pointer to a new quadrics object. This object
+%% must be referred to when calling quadrics rendering and control functions. A return value
+%% of 0 means that there is not enough memory to allocate the object.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluNewQuadric.xml">external</a> documentation.
-spec newQuadric() -> integer().
newQuadric() ->
call(5023, <<>>).
-%% @spec (Left::float(),Right::float(),Bottom::float(),Top::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluOrtho2D.xml">external</a> documentation.
--spec ortho2D(float(),float(),float(),float()) -> ok.
+%% @doc Define a 2D orthographic projection matrix
+%%
+%% ``glu:ortho2D'' sets up a two-dimensional orthographic viewing region. This is equivalent
+%% to calling {@link gl:ortho/6} with near= -1 and far= 1.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluOrtho2D.xml">external</a> documentation.
+-spec ortho2D(Left, Right, Bottom, Top) -> ok when Left :: float(),Right :: float(),Bottom :: float(),Top :: float().
ortho2D(Left,Right,Bottom,Top) ->
cast(5024, <<Left:?GLdouble,Right:?GLdouble,Bottom:?GLdouble,Top:?GLdouble>>).
-%% @spec (Quad::integer(),Inner::float(),Outer::float(),Slices::integer(),Loops::integer(),Start::float(),Sweep::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluPartialDisk.xml">external</a> documentation.
--spec partialDisk(integer(),float(),float(),integer(),integer(),float(),float()) -> ok.
+%% @doc Draw an arc of a disk
+%%
+%% ``glu:partialDisk'' renders a partial disk on the z= 0 plane. A partial disk is similar
+%% to a full disk, except that only the subset of the disk from `Start' through `Start'
+%% + `Sweep' is included (where 0 degrees is along the +f2yf axis, 90 degrees along
+%% the +`x' axis, 180 degrees along the -`y' axis, and 270 degrees along the -`x'
+%% axis).
+%%
+%% The partial disk has a radius of `Outer' and contains a concentric circular hole
+%% with a radius of `Inner' . If `Inner' is 0, then no hole is generated. The partial
+%% disk is subdivided around the `z' axis into slices (like pizza slices) and also about
+%% the `z' axis into rings (as specified by `Slices' and `Loops' , respectively).
+%%
+%%
+%% With respect to orientation, the +`z' side of the partial disk is considered to
+%% be outside (see {@link glu:quadricOrientation/2} ). This means that if the orientation
+%% is set to `?GLU_OUTSIDE', then any normals generated point along the +`z' axis.
+%% Otherwise, they point along the -`z' axis.
+%%
+%% If texturing is turned on (with {@link glu:quadricTexture/2} ), texture coordinates are
+%% generated linearly such that where r= outer, the value at (`r', 0, 0) is (1.0,
+%% 0.5), at (0, `r', 0) it is (0.5, 1.0), at (-`r', 0, 0) it is (0.0, 0.5), and
+%% at (0, -`r', 0) it is (0.5, 0.0).
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluPartialDisk.xml">external</a> documentation.
+-spec partialDisk(Quad, Inner, Outer, Slices, Loops, Start, Sweep) -> ok when Quad :: integer(),Inner :: float(),Outer :: float(),Slices :: integer(),Loops :: integer(),Start :: float(),Sweep :: float().
partialDisk(Quad,Inner,Outer,Slices,Loops,Start,Sweep) ->
cast(5025, <<Quad:?GLUquadric,Inner:?GLdouble,Outer:?GLdouble,Slices:?GLint,Loops:?GLint,Start:?GLdouble,Sweep:?GLdouble>>).
-%% @spec (Fovy::float(),Aspect::float(),ZNear::float(),ZFar::float()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluPerspective.xml">external</a> documentation.
--spec perspective(float(),float(),float(),float()) -> ok.
+%% @doc Set up a perspective projection matrix
+%%
+%% ``glu:perspective'' specifies a viewing frustum into the world coordinate system. In
+%% general, the aspect ratio in ``glu:perspective'' should match the aspect ratio of the
+%% associated viewport. For example, aspect= 2.0 means the viewer's angle of view is twice
+%% as wide in `x' as it is in `y'. If the viewport is twice as wide as it is tall,
+%% it displays the image without distortion.
+%%
+%% The matrix generated by ``glu:perspective'' is multipled by the current matrix, just
+%% as if {@link gl:multMatrixd/1} were called with the generated matrix. To load the perspective
+%% matrix onto the current matrix stack instead, precede the call to ``glu:perspective''
+%% with a call to {@link gl:loadIdentity/0} .
+%%
+%% Given `f' defined as follows:
+%%
+%% f= cotangent(fovy/2) The generated matrix is
+%%
+%% (f/aspect 0 0 0 0 f 0 0 0 0(zFar+zNear)/(zNear-zFar)(2*zFar*zNear)/(zNear-zFar) 0 0 -1 0)
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluPerspective.xml">external</a> documentation.
+-spec perspective(Fovy, Aspect, ZNear, ZFar) -> ok when Fovy :: float(),Aspect :: float(),ZNear :: float(),ZFar :: float().
perspective(Fovy,Aspect,ZNear,ZFar) ->
cast(5026, <<Fovy:?GLdouble,Aspect:?GLdouble,ZNear:?GLdouble,ZFar:?GLdouble>>).
-%% @spec (X::float(),Y::float(),DelX::float(),DelY::float(),Viewport::{integer(),integer(),integer(),integer()}) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluPickMatrix.xml">external</a> documentation.
--spec pickMatrix(float(),float(),float(),float(),{integer(),integer(),integer(),integer()}) -> ok.
+%% @doc Define a picking region
+%%
+%% ``glu:pickMatrix'' creates a projection matrix that can be used to restrict drawing
+%% to a small region of the viewport. This is typically useful to determine what objects
+%% are being drawn near the cursor. Use ``glu:pickMatrix'' to restrict drawing to a small
+%% region around the cursor. Then, enter selection mode (with {@link gl:renderMode/1} ) and
+%% rerender the scene. All primitives that would have been drawn near the cursor are identified
+%% and stored in the selection buffer.
+%%
+%% The matrix created by ``glu:pickMatrix'' is multiplied by the current matrix just as
+%% if {@link gl:multMatrixd/1} is called with the generated matrix. To effectively use the
+%% generated pick matrix for picking, first call {@link gl:loadIdentity/0} to load an identity
+%% matrix onto the perspective matrix stack. Then call ``glu:pickMatrix'', and, finally,
+%% call a command (such as {@link glu:perspective/4} ) to multiply the perspective matrix by
+%% the pick matrix.
+%%
+%% When using ``glu:pickMatrix'' to pick NURBS, be careful to turn off the NURBS property
+%% `?GLU_AUTO_LOAD_MATRIX'. If `?GLU_AUTO_LOAD_MATRIX' is not turned off, then
+%% any NURBS surface rendered is subdivided differently with the pick matrix than the way
+%% it was subdivided without the pick matrix.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluPickMatrix.xml">external</a> documentation.
+-spec pickMatrix(X, Y, DelX, DelY, Viewport) -> ok when X :: float(),Y :: float(),DelX :: float(),DelY :: float(),Viewport :: {integer(),integer(),integer(),integer()}.
pickMatrix(X,Y,DelX,DelY,{V1,V2,V3,V4}) ->
cast(5027, <<X:?GLdouble,Y:?GLdouble,DelX:?GLdouble,DelY:?GLdouble,V1:?GLint,V2:?GLint,V3:?GLint,V4:?GLint>>).
-%% @spec (ObjX::float(),ObjY::float(),ObjZ::float(),Model::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()},Proj::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()},View::{integer(),integer(),integer(),integer()}) -> {integer(),WinX::float(),WinY::float(),WinZ::float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluProject.xml">external</a> documentation.
--spec project(float(),float(),float(),{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()},{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()},{integer(),integer(),integer(),integer()}) -> {integer(),float(),float(),float()}.
+%% @doc Map object coordinates to window coordinates
+%%
+%% ``glu:project'' transforms the specified object coordinates into window coordinates
+%% using `Model' , `Proj' , and `View' . The result is stored in `WinX' , `WinY'
+%% , and `WinZ' . A return value of `?GLU_TRUE' indicates success, a return value
+%% of `?GLU_FALSE' indicates failure.
+%%
+%% To compute the coordinates, let v=(objX objY objZ 1.0) represented as a matrix with 4 rows and 1 column.
+%% Then ``glu:project'' computes v" as follows:
+%%
+%% v"= P*M*v
+%%
+%% where P is the current projection matrix `Proj' and M is the current modelview
+%% matrix `Model' (both represented as 4*4 matrices in column-major order).
+%%
+%% The window coordinates are then computed as follows:
+%%
+%% winX= view(0)+view(2)*(v"(0)+1)/2
+%%
+%% winY= view(1)+view(3)*(v"(1)+1)/2
+%%
+%% winZ=(v"(2)+1)/2
+%%
+%%
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluProject.xml">external</a> documentation.
+-spec project(ObjX, ObjY, ObjZ, Model, Proj, View) -> {integer(),WinX :: float(),WinY :: float(),WinZ :: float()} when ObjX :: float(),ObjY :: float(),ObjZ :: float(),Model :: matrix(),Proj :: matrix(),View :: {integer(),integer(),integer(),integer()}.
project(ObjX,ObjY,ObjZ,{M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16},{P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16},{V1,V2,V3,V4}) ->
call(5028, <<ObjX:?GLdouble,ObjY:?GLdouble,ObjZ:?GLdouble,M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,M13:?GLdouble,M14:?GLdouble,M15:?GLdouble,M16:?GLdouble,P1:?GLdouble,P2:?GLdouble,P3:?GLdouble,P4:?GLdouble,P5:?GLdouble,P6:?GLdouble,P7:?GLdouble,P8:?GLdouble,P9:?GLdouble,P10:?GLdouble,P11:?GLdouble,P12:?GLdouble,P13:?GLdouble,P14:?GLdouble,P15:?GLdouble,P16:?GLdouble,V1:?GLint,V2:?GLint,V3:?GLint,V4:?GLint>>);
project(ObjX,ObjY,ObjZ,{M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12},{P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12},{V1,V2,V3,V4}) ->
call(5028, <<ObjX:?GLdouble,ObjY:?GLdouble,ObjZ:?GLdouble,M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,0:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,0:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,0:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,1:?GLdouble,P1:?GLdouble,P2:?GLdouble,P3:?GLdouble,0:?GLdouble,P4:?GLdouble,P5:?GLdouble,P6:?GLdouble,0:?GLdouble,P7:?GLdouble,P8:?GLdouble,P9:?GLdouble,0:?GLdouble,P10:?GLdouble,P11:?GLdouble,P12:?GLdouble,1:?GLdouble,V1:?GLint,V2:?GLint,V3:?GLint,V4:?GLint>>).
-%% @spec (Quad::integer(),Draw::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluQuadricDrawStyle.xml">external</a> documentation.
--spec quadricDrawStyle(integer(),enum()) -> ok.
+%% @doc Specify the draw style desired for quadrics
+%%
+%% ``glu:quadricDrawStyle'' specifies the draw style for quadrics rendered with `Quad' .
+%% The legal values are as follows:
+%%
+%% `?GLU_FILL': Quadrics are rendered with polygon primitives. The polygons are drawn
+%% in a counterclockwise fashion with respect to their normals (as defined with {@link glu:quadricOrientation/2}
+%% ).
+%%
+%% `?GLU_LINE': Quadrics are rendered as a set of lines.
+%%
+%% `?GLU_SILHOUETTE': Quadrics are rendered as a set of lines, except that edges separating
+%% coplanar faces will not be drawn.
+%%
+%% `?GLU_POINT': Quadrics are rendered as a set of points.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluQuadricDrawStyle.xml">external</a> documentation.
+-spec quadricDrawStyle(Quad, Draw) -> ok when Quad :: integer(),Draw :: enum().
quadricDrawStyle(Quad,Draw) ->
cast(5029, <<Quad:?GLUquadric,Draw:?GLenum>>).
-%% @spec (Quad::integer(),Normal::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluQuadricNormals.xml">external</a> documentation.
--spec quadricNormals(integer(),enum()) -> ok.
+%% @doc Specify what kind of normals are desired for quadrics
+%%
+%% ``glu:quadricNormals'' specifies what kind of normals are desired for quadrics rendered
+%% with `Quad' . The legal values are as follows:
+%%
+%% `?GLU_NONE': No normals are generated.
+%%
+%% `?GLU_FLAT': One normal is generated for every facet of a quadric.
+%%
+%% `?GLU_SMOOTH': One normal is generated for every vertex of a quadric. This is the
+%% initial value.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluQuadricNormals.xml">external</a> documentation.
+-spec quadricNormals(Quad, Normal) -> ok when Quad :: integer(),Normal :: enum().
quadricNormals(Quad,Normal) ->
cast(5030, <<Quad:?GLUquadric,Normal:?GLenum>>).
-%% @spec (Quad::integer(),Orientation::enum()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluQuadricOrientation.xml">external</a> documentation.
--spec quadricOrientation(integer(),enum()) -> ok.
+%% @doc Specify inside/outside orientation for quadrics
+%%
+%% ``glu:quadricOrientation'' specifies what kind of orientation is desired for quadrics
+%% rendered with `Quad' . The `Orientation' values are as follows:
+%%
+%% `?GLU_OUTSIDE': Quadrics are drawn with normals pointing outward (the initial value).
+%%
+%%
+%% `?GLU_INSIDE': Quadrics are drawn with normals pointing inward.
+%%
+%% Note that the interpretation of `outward' and `inward' depends on the quadric
+%% being drawn.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluQuadricOrientation.xml">external</a> documentation.
+-spec quadricOrientation(Quad, Orientation) -> ok when Quad :: integer(),Orientation :: enum().
quadricOrientation(Quad,Orientation) ->
cast(5031, <<Quad:?GLUquadric,Orientation:?GLenum>>).
-%% @spec (Quad::integer(),Texture::0|1) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluQuadricTexture.xml">external</a> documentation.
--spec quadricTexture(integer(),0|1) -> ok.
+%% @doc Specify if texturing is desired for quadrics
+%%
+%% ``glu:quadricTexture'' specifies if texture coordinates should be generated for quadrics
+%% rendered with `Quad' . If the value of `Texture' is `?GLU_TRUE', then texture
+%% coordinates are generated, and if `Texture' is `?GLU_FALSE', they are not.
+%% The initial value is `?GLU_FALSE'.
+%%
+%% The manner in which texture coordinates are generated depends upon the specific quadric
+%% rendered.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluQuadricTexture.xml">external</a> documentation.
+-spec quadricTexture(Quad, Texture) -> ok when Quad :: integer(),Texture :: 0|1.
quadricTexture(Quad,Texture) ->
cast(5032, <<Quad:?GLUquadric,Texture:?GLboolean>>).
-%% @spec (Format::enum(),WIn::integer(),HIn::integer(),TypeIn::enum(),DataIn::binary(),WOut::integer(),HOut::integer(),TypeOut::enum(),DataOut::mem()) -> integer()
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluScaleImage.xml">external</a> documentation.
--spec scaleImage(enum(),integer(),integer(),enum(),binary(),integer(),integer(),enum(),mem()) -> integer().
+%% @doc Scale an image to an arbitrary size
+%%
+%% ``glu:scaleImage'' scales a pixel image using the appropriate pixel store modes to
+%% unpack data from the source image and pack data into the destination image.
+%%
+%% When shrinking an image, ``glu:scaleImage'' uses a box filter to sample the source
+%% image and create pixels for the destination image. When magnifying an image, the pixels
+%% from the source image are linearly interpolated to create the destination image.
+%%
+%% A return value of zero indicates success, otherwise a GLU error code is returned (see {@link glu:errorString/1}
+%% ).
+%%
+%% See the {@link gl:readPixels/7} reference page for a description of the acceptable values
+%% for the `Format' , `TypeIn' , and `TypeOut' parameters.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluScaleImage.xml">external</a> documentation.
+-spec scaleImage(Format, WIn, HIn, TypeIn, DataIn, WOut, HOut, TypeOut, DataOut) -> integer() when Format :: enum(),WIn :: integer(),HIn :: integer(),TypeIn :: enum(),DataIn :: binary(),WOut :: integer(),HOut :: integer(),TypeOut :: enum(),DataOut :: mem().
scaleImage(Format,WIn,HIn,TypeIn,DataIn,WOut,HOut,TypeOut,DataOut) ->
send_bin(DataIn),
send_bin(DataOut),
call(5033, <<Format:?GLenum,WIn:?GLsizei,HIn:?GLsizei,TypeIn:?GLenum,WOut:?GLsizei,HOut:?GLsizei,TypeOut:?GLenum>>).
-%% @spec (Quad::integer(),Radius::float(),Slices::integer(),Stacks::integer()) -> ok
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluSphere.xml">external</a> documentation.
--spec sphere(integer(),float(),integer(),integer()) -> ok.
+%% @doc Draw a sphere
+%%
+%% ``glu:sphere'' draws a sphere of the given radius centered around the origin. The sphere
+%% is subdivided around the `z' axis into slices and along the `z' axis into
+%% stacks (similar to lines of longitude and latitude).
+%%
+%% If the orientation is set to `?GLU_OUTSIDE' (with {@link glu:quadricOrientation/2} ),
+%% then any normals generated point away from the center of the sphere. Otherwise, they
+%% point toward the center of the sphere.
+%%
+%% If texturing is turned on (with {@link glu:quadricTexture/2} ), then texture coordinates
+%% are generated so that `t' ranges from 0.0 at z=-radius to 1.0 at z= radius (`t'
+%% increases linearly along longitudinal lines), and `s' ranges from 0.0 at the +`y'
+%% axis, to 0.25 at the +`x' axis, to 0.5 at the -`y' axis, to 0.75 at the -`x'
+%% axis, and back to 1.0 at the +`y' axis.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluSphere.xml">external</a> documentation.
+-spec sphere(Quad, Radius, Slices, Stacks) -> ok when Quad :: integer(),Radius :: float(),Slices :: integer(),Stacks :: integer().
sphere(Quad,Radius,Slices,Stacks) ->
cast(5034, <<Quad:?GLUquadric,Radius:?GLdouble,Slices:?GLint,Stacks:?GLint>>).
-%% @spec (WinX::float(),WinY::float(),WinZ::float(),Model::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()},Proj::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()},View::{integer(),integer(),integer(),integer()}) -> {integer(),ObjX::float(),ObjY::float(),ObjZ::float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluUnProject.xml">external</a> documentation.
--spec unProject(float(),float(),float(),{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()},{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()},{integer(),integer(),integer(),integer()}) -> {integer(),float(),float(),float()}.
+%% @doc Map window coordinates to object coordinates
+%%
+%% ``glu:unProject'' maps the specified window coordinates into object coordinates using `Model'
+%% , `Proj' , and `View' . The result is stored in `ObjX' , `ObjY' , and `ObjZ'
+%% . A return value of `?GLU_TRUE' indicates success; a return value of `?GLU_FALSE'
+%% indicates failure.
+%%
+%% To compute the coordinates (objX objY objZ), ``glu:unProject'' multiplies the normalized device coordinates
+%% by the inverse of `Model' * `Proj' as follows:
+%%
+%% (objX objY objZ W)= INV(P M) ((2(winX-view[0]))/(view[2])-1(2(winY-view[1]))/(view[3])-1 2(winZ)-1 1) INV denotes matrix inversion. W is an unused variable, included for consistent
+%% matrix notation.
+%%
+%% See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluUnProject.xml">external</a> documentation.
+-spec unProject(WinX, WinY, WinZ, Model, Proj, View) -> {integer(),ObjX :: float(),ObjY :: float(),ObjZ :: float()} when WinX :: float(),WinY :: float(),WinZ :: float(),Model :: matrix(),Proj :: matrix(),View :: {integer(),integer(),integer(),integer()}.
unProject(WinX,WinY,WinZ,{M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16},{P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16},{V1,V2,V3,V4}) ->
call(5035, <<WinX:?GLdouble,WinY:?GLdouble,WinZ:?GLdouble,M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,M13:?GLdouble,M14:?GLdouble,M15:?GLdouble,M16:?GLdouble,P1:?GLdouble,P2:?GLdouble,P3:?GLdouble,P4:?GLdouble,P5:?GLdouble,P6:?GLdouble,P7:?GLdouble,P8:?GLdouble,P9:?GLdouble,P10:?GLdouble,P11:?GLdouble,P12:?GLdouble,P13:?GLdouble,P14:?GLdouble,P15:?GLdouble,P16:?GLdouble,V1:?GLint,V2:?GLint,V3:?GLint,V4:?GLint>>);
unProject(WinX,WinY,WinZ,{M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12},{P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12},{V1,V2,V3,V4}) ->
call(5035, <<WinX:?GLdouble,WinY:?GLdouble,WinZ:?GLdouble,M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,0:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,0:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,0:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,1:?GLdouble,P1:?GLdouble,P2:?GLdouble,P3:?GLdouble,0:?GLdouble,P4:?GLdouble,P5:?GLdouble,P6:?GLdouble,0:?GLdouble,P7:?GLdouble,P8:?GLdouble,P9:?GLdouble,0:?GLdouble,P10:?GLdouble,P11:?GLdouble,P12:?GLdouble,1:?GLdouble,V1:?GLint,V2:?GLint,V3:?GLint,V4:?GLint>>).
-%% @spec (WinX::float(),WinY::float(),WinZ::float(),ClipW::float(),Model::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()},Proj::{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()},View::{integer(),integer(),integer(),integer()},NearVal::float(),FarVal::float()) -> {integer(),ObjX::float(),ObjY::float(),ObjZ::float(),ObjW::float()}
-%% @doc See <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluUnProject.xml">external</a> documentation.
--spec unProject4(float(),float(),float(),float(),{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()},{float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float(),float()},{integer(),integer(),integer(),integer()},float(),float()) -> {integer(),float(),float(),float(),float()}.
+%% @doc
+%% See {@link unProject/6}
+-spec unProject4(WinX, WinY, WinZ, ClipW, Model, Proj, View, NearVal, FarVal) -> {integer(),ObjX :: float(),ObjY :: float(),ObjZ :: float(),ObjW :: float()} when WinX :: float(),WinY :: float(),WinZ :: float(),ClipW :: float(),Model :: matrix(),Proj :: matrix(),View :: {integer(),integer(),integer(),integer()},NearVal :: float(),FarVal :: float().
unProject4(WinX,WinY,WinZ,ClipW,{M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12,M13,M14,M15,M16},{P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16},{V1,V2,V3,V4},NearVal,FarVal) ->
call(5036, <<WinX:?GLdouble,WinY:?GLdouble,WinZ:?GLdouble,ClipW:?GLdouble,M1:?GLdouble,M2:?GLdouble,M3:?GLdouble,M4:?GLdouble,M5:?GLdouble,M6:?GLdouble,M7:?GLdouble,M8:?GLdouble,M9:?GLdouble,M10:?GLdouble,M11:?GLdouble,M12:?GLdouble,M13:?GLdouble,M14:?GLdouble,M15:?GLdouble,M16:?GLdouble,P1:?GLdouble,P2:?GLdouble,P3:?GLdouble,P4:?GLdouble,P5:?GLdouble,P6:?GLdouble,P7:?GLdouble,P8:?GLdouble,P9:?GLdouble,P10:?GLdouble,P11:?GLdouble,P12:?GLdouble,P13:?GLdouble,P14:?GLdouble,P15:?GLdouble,P16:?GLdouble,V1:?GLint,V2:?GLint,V3:?GLint,V4:?GLint,NearVal:?GLdouble,FarVal:?GLdouble>>);
unProject4(WinX,WinY,WinZ,ClipW,{M1,M2,M3,M4,M5,M6,M7,M8,M9,M10,M11,M12},{P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12},{V1,V2,V3,V4},NearVal,FarVal) ->
diff --git a/lib/wx/src/gen/wxAcceleratorEntry.erl b/lib/wx/src/gen/wxAcceleratorEntry.erl
index d76299b300..3cf50a2348 100644
--- a/lib/wx/src/gen/wxAcceleratorEntry.erl
+++ b/lib/wx/src/gen/wxAcceleratorEntry.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,24 +29,29 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxAcceleratorEntry/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxAcceleratorEntry()
+-type wxAcceleratorEntry() :: wx:wx_object().
%% @equiv new([])
+-spec new() -> wxAcceleratorEntry().
+
new() ->
new([]).
-%% @spec (X::term()|wxAcceleratorEntry()) -> wxAcceleratorEntry()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxacceleratorentry.html#wxacceleratorentrywxacceleratorentry">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new([Option]) -> wxAcceleratorEntry() </c>
-%%<br /> Option = {flags, integer()} | {keyCode, integer()} | {cmd, integer()} | {item, wxMenuItem:wxMenuItem()}
-%% </p>
-%% <p><c>
-%% new(Entry::wxAcceleratorEntry()) -> wxAcceleratorEntry() </c>
-%% </p>
+%% <br /> Also:<br />
+%% new(Entry) -> wxAcceleratorEntry() when<br />
+%% Entry::wxAcceleratorEntry().<br />
+%%
+-spec new([Option]) -> wxAcceleratorEntry() when
+ Option :: {flags, integer()}
+ | {keyCode, integer()}
+ | {cmd, integer()}
+ | {item, wxMenuItem:wxMenuItem()};
+ (Entry) -> wxAcceleratorEntry() when
+ Entry::wxAcceleratorEntry().
new(Options)
when is_list(Options) ->
MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc];
@@ -62,36 +67,42 @@ new(#wx_ref{type=EntryT,ref=EntryRef}) ->
wxe_util:construct(?wxAcceleratorEntry_new_1_1,
<<EntryRef:32/?UI>>).
-%% @spec (This::wxAcceleratorEntry()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxacceleratorentry.html#wxacceleratorentrygetcommand">external documentation</a>.
+-spec getCommand(This) -> integer() when
+ This::wxAcceleratorEntry().
getCommand(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAcceleratorEntry),
wxe_util:call(?wxAcceleratorEntry_GetCommand,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAcceleratorEntry()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxacceleratorentry.html#wxacceleratorentrygetflags">external documentation</a>.
+-spec getFlags(This) -> integer() when
+ This::wxAcceleratorEntry().
getFlags(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAcceleratorEntry),
wxe_util:call(?wxAcceleratorEntry_GetFlags,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAcceleratorEntry()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxacceleratorentry.html#wxacceleratorentrygetkeycode">external documentation</a>.
+-spec getKeyCode(This) -> integer() when
+ This::wxAcceleratorEntry().
getKeyCode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAcceleratorEntry),
wxe_util:call(?wxAcceleratorEntry_GetKeyCode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAcceleratorEntry(), Flags::integer(), KeyCode::integer(), Cmd::integer()) -> ok
%% @equiv set(This,Flags,KeyCode,Cmd, [])
+-spec set(This, Flags, KeyCode, Cmd) -> ok when
+ This::wxAcceleratorEntry(), Flags::integer(), KeyCode::integer(), Cmd::integer().
+
set(This,Flags,KeyCode,Cmd)
when is_record(This, wx_ref),is_integer(Flags),is_integer(KeyCode),is_integer(Cmd) ->
set(This,Flags,KeyCode,Cmd, []).
-%% @spec (This::wxAcceleratorEntry(), Flags::integer(), KeyCode::integer(), Cmd::integer(), [Option]) -> ok
-%% Option = {item, wxMenuItem:wxMenuItem()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxacceleratorentry.html#wxacceleratorentryset">external documentation</a>.
+-spec set(This, Flags, KeyCode, Cmd, [Option]) -> ok when
+ This::wxAcceleratorEntry(), Flags::integer(), KeyCode::integer(), Cmd::integer(),
+ Option :: {item, wxMenuItem:wxMenuItem()}.
set(#wx_ref{type=ThisT,ref=ThisRef},Flags,KeyCode,Cmd, Options)
when is_integer(Flags),is_integer(KeyCode),is_integer(Cmd),is_list(Options) ->
?CLASS(ThisT,wxAcceleratorEntry),
@@ -101,8 +112,8 @@ set(#wx_ref{type=ThisT,ref=ThisRef},Flags,KeyCode,Cmd, Options)
wxe_util:cast(?wxAcceleratorEntry_Set,
<<ThisRef:32/?UI,Flags:32/?UI,KeyCode:32/?UI,Cmd:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxAcceleratorEntry()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxAcceleratorEntry()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxAcceleratorEntry),
wxe_util:destroy(?wxAcceleratorEntry_destroy,Obj),
diff --git a/lib/wx/src/gen/wxAcceleratorTable.erl b/lib/wx/src/gen/wxAcceleratorTable.erl
index 5d070294e2..1b58cf3826 100644
--- a/lib/wx/src/gen/wxAcceleratorTable.erl
+++ b/lib/wx/src/gen/wxAcceleratorTable.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,17 +29,20 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxAcceleratorTable/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxAcceleratorTable()
+-type wxAcceleratorTable() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxacceleratortable.html#wxacceleratortablewxacceleratortable">external documentation</a>.
+-spec new() -> wxAcceleratorTable().
new() ->
wxe_util:construct(?wxAcceleratorTable_new_0,
<<>>).
-%% @spec (N::integer(), Entries::[wxAcceleratorEntry:wxAcceleratorEntry()]) -> wxAcceleratorTable()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxacceleratortable.html#wxacceleratortablewxacceleratortable">external documentation</a>.
+-spec new(N, Entries) -> wxAcceleratorTable() when
+ N::integer(), Entries::[wxAcceleratorEntry:wxAcceleratorEntry()].
new(N,Entries)
when is_integer(N),is_list(Entries) ->
[?CLASS(EntriesT,wxAcceleratorEntry) || #wx_ref{type=EntriesT} <- Entries],
@@ -47,15 +50,16 @@ new(N,Entries)
<<N:32/?UI,(length(Entries)):32/?UI,
(<< <<(C#wx_ref.ref):32/?UI>> || C <- Entries>>)/binary, 0:(((0+length(Entries)) rem 2)*32)>>).
-%% @spec (This::wxAcceleratorTable()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxacceleratortable.html#wxacceleratortableok">external documentation</a>.
+-spec ok(This) -> boolean() when
+ This::wxAcceleratorTable().
ok(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAcceleratorTable),
wxe_util:call(?wxAcceleratorTable_Ok,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAcceleratorTable()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxAcceleratorTable()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxAcceleratorTable),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxArtProvider.erl b/lib/wx/src/gen/wxArtProvider.erl
index 1955bd2e29..1515c46f9f 100644
--- a/lib/wx/src/gen/wxArtProvider.erl
+++ b/lib/wx/src/gen/wxArtProvider.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,18 +29,24 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxArtProvider/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Id::string()) -> wxBitmap:wxBitmap()
+-type wxArtProvider() :: wx:wx_object().
%% @equiv getBitmap(Id, [])
+-spec getBitmap(Id) -> wxBitmap:wxBitmap() when
+ Id::unicode:chardata().
+
getBitmap(Id)
when is_list(Id) ->
getBitmap(Id, []).
-%% @spec (Id::string(), [Option]) -> wxBitmap:wxBitmap()
-%% Option = {client, string()} | {size, {W::integer(), H::integer()}}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxartprovider.html#wxartprovidergetbitmap">external documentation</a>.
+-spec getBitmap(Id, [Option]) -> wxBitmap:wxBitmap() when
+ Id::unicode:chardata(),
+ Option :: {client, unicode:chardata()}
+ | {size, {W::integer(), H::integer()}}.
getBitmap(Id, Options)
when is_list(Id),is_list(Options) ->
Id_UC = unicode:characters_to_binary([Id,0]),
@@ -51,15 +57,19 @@ getBitmap(Id, Options)
wxe_util:call(?wxArtProvider_GetBitmap,
<<(byte_size(Id_UC)):32/?UI,(Id_UC)/binary, 0:(((8- ((4+byte_size(Id_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (Id::string()) -> wxIcon:wxIcon()
%% @equiv getIcon(Id, [])
+-spec getIcon(Id) -> wxIcon:wxIcon() when
+ Id::unicode:chardata().
+
getIcon(Id)
when is_list(Id) ->
getIcon(Id, []).
-%% @spec (Id::string(), [Option]) -> wxIcon:wxIcon()
-%% Option = {client, string()} | {size, {W::integer(), H::integer()}}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxartprovider.html#wxartprovidergeticon">external documentation</a>.
+-spec getIcon(Id, [Option]) -> wxIcon:wxIcon() when
+ Id::unicode:chardata(),
+ Option :: {client, unicode:chardata()}
+ | {size, {W::integer(), H::integer()}}.
getIcon(Id, Options)
when is_list(Id),is_list(Options) ->
Id_UC = unicode:characters_to_binary([Id,0]),
diff --git a/lib/wx/src/gen/wxAuiDockArt.erl b/lib/wx/src/gen/wxAuiDockArt.erl
index f2be643dd9..d3cf1ebd0d 100644
--- a/lib/wx/src/gen/wxAuiDockArt.erl
+++ b/lib/wx/src/gen/wxAuiDockArt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,6 +29,8 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxAuiDockArt/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxAuiDockArt() :: wx:wx_object().
diff --git a/lib/wx/src/gen/wxAuiManager.erl b/lib/wx/src/gen/wxAuiManager.erl
index 893867cec1..71e851f706 100644
--- a/lib/wx/src/gen/wxAuiManager.erl
+++ b/lib/wx/src/gen/wxAuiManager.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,18 +37,22 @@
%% inherited exports
-export([connect/2,connect/3,disconnect/1,disconnect/2,disconnect/3,parent_class/1]).
+-export_type([wxAuiManager/0]).
%% @hidden
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxAuiManager()
+-type wxAuiManager() :: wx:wx_object().
%% @equiv new([])
+-spec new() -> wxAuiManager().
+
new() ->
new([]).
-%% @spec ([Option]) -> wxAuiManager()
-%% Option = {managed_wnd, wxWindow:wxWindow()} | {flags, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagerwxauimanager">external documentation</a>.
+-spec new([Option]) -> wxAuiManager() when
+ Option :: {managed_wnd, wxWindow:wxWindow()}
+ | {flags, integer()}.
new(Options)
when is_list(Options) ->
MOpts = fun({managed_wnd, #wx_ref{type=Managed_wndT,ref=Managed_wndRef}}, Acc) -> ?CLASS(Managed_wndT,wxWindow),[<<1:32/?UI,Managed_wndRef:32/?UI>>|Acc];
@@ -58,22 +62,25 @@ new(Options)
wxe_util:construct(?wxAuiManager_new,
<<BinOpt/binary>>).
-%% @spec (This::wxAuiManager(), Window::wxWindow:wxWindow()) -> bool()
%% @equiv addPane(This,Window, [])
+-spec addPane(This, Window) -> boolean() when
+ This::wxAuiManager(), Window::wxWindow:wxWindow().
+
addPane(This,Window)
when is_record(This, wx_ref),is_record(Window, wx_ref) ->
addPane(This,Window, []).
-%% @spec (This::wxAuiManager(),Window::wxWindow:wxWindow(),X::term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanageraddpane">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% addPane(This::wxAuiManager(), Window::wxWindow:wxWindow(), [Option]) -> bool() </c>
-%%<br /> Option = {direction, integer()} | {caption, string()}
-%% </p>
-%% <p><c>
-%% addPane(This::wxAuiManager(), Window::wxWindow:wxWindow(), Pane_info::wxAuiPaneInfo:wxAuiPaneInfo()) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% addPane(This, Window, Pane_info) -> boolean() when<br />
+%% This::wxAuiManager(), Window::wxWindow:wxWindow(), Pane_info::wxAuiPaneInfo:wxAuiPaneInfo().<br />
+%%
+-spec addPane(This, Window, [Option]) -> boolean() when
+ This::wxAuiManager(), Window::wxWindow:wxWindow(),
+ Option :: {direction, integer()}
+ | {caption, unicode:chardata()};
+ (This, Window, Pane_info) -> boolean() when
+ This::wxAuiManager(), Window::wxWindow:wxWindow(), Pane_info::wxAuiPaneInfo:wxAuiPaneInfo().
addPane(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiManager),
@@ -91,8 +98,9 @@ addPane(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef},#wx_
wxe_util:call(?wxAuiManager_AddPane_2_1,
<<ThisRef:32/?UI,WindowRef:32/?UI,Pane_infoRef:32/?UI>>).
-%% @spec (This::wxAuiManager(), Window::wxWindow:wxWindow(), Pane_info::wxAuiPaneInfo:wxAuiPaneInfo(), Drop_pos::{X::integer(), Y::integer()}) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanageraddpane">external documentation</a>.
+-spec addPane(This, Window, Pane_info, Drop_pos) -> boolean() when
+ This::wxAuiManager(), Window::wxWindow:wxWindow(), Pane_info::wxAuiPaneInfo:wxAuiPaneInfo(), Drop_pos::{X::integer(), Y::integer()}.
addPane(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef},#wx_ref{type=Pane_infoT,ref=Pane_infoRef},{Drop_posX,Drop_posY})
when is_integer(Drop_posX),is_integer(Drop_posY) ->
?CLASS(ThisT,wxAuiManager),
@@ -101,65 +109,72 @@ addPane(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef},#wx_
wxe_util:call(?wxAuiManager_AddPane_3,
<<ThisRef:32/?UI,WindowRef:32/?UI,Pane_infoRef:32/?UI,Drop_posX:32/?UI,Drop_posY:32/?UI>>).
-%% @spec (This::wxAuiManager(), Window::wxWindow:wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagerdetachpane">external documentation</a>.
+-spec detachPane(This, Window) -> boolean() when
+ This::wxAuiManager(), Window::wxWindow:wxWindow().
detachPane(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}) ->
?CLASS(ThisT,wxAuiManager),
?CLASS(WindowT,wxWindow),
wxe_util:call(?wxAuiManager_DetachPane,
<<ThisRef:32/?UI,WindowRef:32/?UI>>).
-%% @spec (This::wxAuiManager()) -> wxAuiPaneInfoArray:wxAuiPaneInfoArray()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagergetallpanes">external documentation</a>.
+-spec getAllPanes(This) -> wx:wx_object() when
+ This::wxAuiManager().
getAllPanes(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:call(?wxAuiManager_GetAllPanes,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiManager()) -> wxAuiDockArt:wxAuiDockArt()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagergetartprovider">external documentation</a>.
+-spec getArtProvider(This) -> wxAuiDockArt:wxAuiDockArt() when
+ This::wxAuiManager().
getArtProvider(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:call(?wxAuiManager_GetArtProvider,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiManager()) -> {Width_pct::float(), Height_pct::float()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagergetdocksizeconstraint">external documentation</a>.
+-spec getDockSizeConstraint(This) -> {Width_pct::number(), Height_pct::number()} when
+ This::wxAuiManager().
getDockSizeConstraint(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:call(?wxAuiManager_GetDockSizeConstraint,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiManager()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagergetflags">external documentation</a>.
+-spec getFlags(This) -> integer() when
+ This::wxAuiManager().
getFlags(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:call(?wxAuiManager_GetFlags,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiManager()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagergetmanagedwindow">external documentation</a>.
+-spec getManagedWindow(This) -> wxWindow:wxWindow() when
+ This::wxAuiManager().
getManagedWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:call(?wxAuiManager_GetManagedWindow,
<<ThisRef:32/?UI>>).
-%% @spec (Window::wxWindow:wxWindow()) -> wxAuiManager()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagergetmanager">external documentation</a>.
+-spec getManager(Window) -> wxAuiManager() when
+ Window::wxWindow:wxWindow().
getManager(#wx_ref{type=WindowT,ref=WindowRef}) ->
?CLASS(WindowT,wxWindow),
wxe_util:call(?wxAuiManager_GetManager,
<<WindowRef:32/?UI>>).
-%% @spec (This::wxAuiManager(),X::string()|term()) -> wxAuiPaneInfo:wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagergetpane">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% getPane(This::wxAuiManager(), Name::string()) -> wxAuiPaneInfo:wxAuiPaneInfo() </c>
-%% </p>
-%% <p><c>
-%% getPane(This::wxAuiManager(), Window::wxWindow:wxWindow()) -> wxAuiPaneInfo:wxAuiPaneInfo() </c>
-%% </p>
+%% <br /> Also:<br />
+%% getPane(This, Window) -> wxAuiPaneInfo:wxAuiPaneInfo() when<br />
+%% This::wxAuiManager(), Window::wxWindow:wxWindow().<br />
+%%
+-spec getPane(This, Name) -> wxAuiPaneInfo:wxAuiPaneInfo() when
+ This::wxAuiManager(), Name::unicode:chardata();
+ (This, Window) -> wxAuiPaneInfo:wxAuiPaneInfo() when
+ This::wxAuiManager(), Window::wxWindow:wxWindow().
getPane(#wx_ref{type=ThisT,ref=ThisRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxAuiManager),
@@ -172,22 +187,26 @@ getPane(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}) ->
wxe_util:call(?wxAuiManager_GetPane_1_1,
<<ThisRef:32/?UI,WindowRef:32/?UI>>).
-%% @spec (This::wxAuiManager()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagerhidehint">external documentation</a>.
+-spec hideHint(This) -> ok when
+ This::wxAuiManager().
hideHint(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:cast(?wxAuiManager_HideHint,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiManager(), Window::wxWindow:wxWindow(), Insert_location::wxAuiPaneInfo:wxAuiPaneInfo()) -> bool()
%% @equiv insertPane(This,Window,Insert_location, [])
+-spec insertPane(This, Window, Insert_location) -> boolean() when
+ This::wxAuiManager(), Window::wxWindow:wxWindow(), Insert_location::wxAuiPaneInfo:wxAuiPaneInfo().
+
insertPane(This,Window,Insert_location)
when is_record(This, wx_ref),is_record(Window, wx_ref),is_record(Insert_location, wx_ref) ->
insertPane(This,Window,Insert_location, []).
-%% @spec (This::wxAuiManager(), Window::wxWindow:wxWindow(), Insert_location::wxAuiPaneInfo:wxAuiPaneInfo(), [Option]) -> bool()
-%% Option = {insert_level, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagerinsertpane">external documentation</a>.
+-spec insertPane(This, Window, Insert_location, [Option]) -> boolean() when
+ This::wxAuiManager(), Window::wxWindow:wxWindow(), Insert_location::wxAuiPaneInfo:wxAuiPaneInfo(),
+ Option :: {insert_level, integer()}.
insertPane(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef},#wx_ref{type=Insert_locationT,ref=Insert_locationRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiManager),
@@ -199,8 +218,9 @@ insertPane(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef},#
wxe_util:call(?wxAuiManager_InsertPane,
<<ThisRef:32/?UI,WindowRef:32/?UI,Insert_locationRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiManager(), Pane_part::string(), Pane::wxAuiPaneInfo:wxAuiPaneInfo()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagerloadpaneinfo">external documentation</a>.
+-spec loadPaneInfo(This, Pane_part, Pane) -> ok when
+ This::wxAuiManager(), Pane_part::unicode:chardata(), Pane::wxAuiPaneInfo:wxAuiPaneInfo().
loadPaneInfo(#wx_ref{type=ThisT,ref=ThisRef},Pane_part,#wx_ref{type=PaneT,ref=PaneRef})
when is_list(Pane_part) ->
?CLASS(ThisT,wxAuiManager),
@@ -209,15 +229,18 @@ loadPaneInfo(#wx_ref{type=ThisT,ref=ThisRef},Pane_part,#wx_ref{type=PaneT,ref=Pa
wxe_util:cast(?wxAuiManager_LoadPaneInfo,
<<ThisRef:32/?UI,(byte_size(Pane_part_UC)):32/?UI,(Pane_part_UC)/binary, 0:(((8- ((0+byte_size(Pane_part_UC)) band 16#7)) band 16#7))/unit:8,PaneRef:32/?UI>>).
-%% @spec (This::wxAuiManager(), Perspective::string()) -> bool()
%% @equiv loadPerspective(This,Perspective, [])
+-spec loadPerspective(This, Perspective) -> boolean() when
+ This::wxAuiManager(), Perspective::unicode:chardata().
+
loadPerspective(This,Perspective)
when is_record(This, wx_ref),is_list(Perspective) ->
loadPerspective(This,Perspective, []).
-%% @spec (This::wxAuiManager(), Perspective::string(), [Option]) -> bool()
-%% Option = {update, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagerloadperspective">external documentation</a>.
+-spec loadPerspective(This, Perspective, [Option]) -> boolean() when
+ This::wxAuiManager(), Perspective::unicode:chardata(),
+ Option :: {update, boolean()}.
loadPerspective(#wx_ref{type=ThisT,ref=ThisRef},Perspective, Options)
when is_list(Perspective),is_list(Options) ->
?CLASS(ThisT,wxAuiManager),
@@ -228,77 +251,86 @@ loadPerspective(#wx_ref{type=ThisT,ref=ThisRef},Perspective, Options)
wxe_util:call(?wxAuiManager_LoadPerspective,
<<ThisRef:32/?UI,(byte_size(Perspective_UC)):32/?UI,(Perspective_UC)/binary, 0:(((8- ((0+byte_size(Perspective_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxAuiManager(), Pane::wxAuiPaneInfo:wxAuiPaneInfo()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagersavepaneinfo">external documentation</a>.
+-spec savePaneInfo(This, Pane) -> unicode:charlist() when
+ This::wxAuiManager(), Pane::wxAuiPaneInfo:wxAuiPaneInfo().
savePaneInfo(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PaneT,ref=PaneRef}) ->
?CLASS(ThisT,wxAuiManager),
?CLASS(PaneT,wxAuiPaneInfo),
wxe_util:call(?wxAuiManager_SavePaneInfo,
<<ThisRef:32/?UI,PaneRef:32/?UI>>).
-%% @spec (This::wxAuiManager()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagersaveperspective">external documentation</a>.
+-spec savePerspective(This) -> unicode:charlist() when
+ This::wxAuiManager().
savePerspective(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:call(?wxAuiManager_SavePerspective,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiManager(), Art_provider::wxAuiDockArt:wxAuiDockArt()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagersetartprovider">external documentation</a>.
+-spec setArtProvider(This, Art_provider) -> ok when
+ This::wxAuiManager(), Art_provider::wxAuiDockArt:wxAuiDockArt().
setArtProvider(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=Art_providerT,ref=Art_providerRef}) ->
?CLASS(ThisT,wxAuiManager),
?CLASS(Art_providerT,wxAuiDockArt),
wxe_util:cast(?wxAuiManager_SetArtProvider,
<<ThisRef:32/?UI,Art_providerRef:32/?UI>>).
-%% @spec (This::wxAuiManager(), Width_pct::float(), Height_pct::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagersetdocksizeconstraint">external documentation</a>.
+-spec setDockSizeConstraint(This, Width_pct, Height_pct) -> ok when
+ This::wxAuiManager(), Width_pct::number(), Height_pct::number().
setDockSizeConstraint(#wx_ref{type=ThisT,ref=ThisRef},Width_pct,Height_pct)
- when is_float(Width_pct),is_float(Height_pct) ->
+ when is_number(Width_pct),is_number(Height_pct) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:cast(?wxAuiManager_SetDockSizeConstraint,
<<ThisRef:32/?UI,0:32,Width_pct:64/?F,Height_pct:64/?F>>).
-%% @spec (This::wxAuiManager(), Flags::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagersetflags">external documentation</a>.
+-spec setFlags(This, Flags) -> ok when
+ This::wxAuiManager(), Flags::integer().
setFlags(#wx_ref{type=ThisT,ref=ThisRef},Flags)
when is_integer(Flags) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:cast(?wxAuiManager_SetFlags,
<<ThisRef:32/?UI,Flags:32/?UI>>).
-%% @spec (This::wxAuiManager(), Managed_wnd::wxWindow:wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagersetmanagedwindow">external documentation</a>.
+-spec setManagedWindow(This, Managed_wnd) -> ok when
+ This::wxAuiManager(), Managed_wnd::wxWindow:wxWindow().
setManagedWindow(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=Managed_wndT,ref=Managed_wndRef}) ->
?CLASS(ThisT,wxAuiManager),
?CLASS(Managed_wndT,wxWindow),
wxe_util:cast(?wxAuiManager_SetManagedWindow,
<<ThisRef:32/?UI,Managed_wndRef:32/?UI>>).
-%% @spec (This::wxAuiManager(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagershowhint">external documentation</a>.
+-spec showHint(This, Rect) -> ok when
+ This::wxAuiManager(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
showHint(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:cast(?wxAuiManager_ShowHint,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxAuiManager()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanageruninit">external documentation</a>.
+-spec unInit(This) -> ok when
+ This::wxAuiManager().
unInit(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:cast(?wxAuiManager_UnInit,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiManager()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanager.html#wxauimanagerupdate">external documentation</a>.
+-spec update(This) -> ok when
+ This::wxAuiManager().
update(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManager),
wxe_util:cast(?wxAuiManager_Update,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiManager()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxAuiManager()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxAuiManager),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxAuiManagerEvent.erl b/lib/wx/src/gen/wxAuiManagerEvent.erl
index b5e45f1860..feb3931696 100644
--- a/lib/wx/src/gen/wxAuiManagerEvent.erl
+++ b/lib/wx/src/gen/wxAuiManagerEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -38,79 +38,92 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxAuiManagerEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxAuiManagerEvent(), Mgr::wxAuiManager:wxAuiManager()) -> ok
+-type wxAuiManagerEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanagerevent.html#wxauimanagereventsetmanager">external documentation</a>.
+-spec setManager(This, Mgr) -> ok when
+ This::wxAuiManagerEvent(), Mgr::wxAuiManager:wxAuiManager().
setManager(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MgrT,ref=MgrRef}) ->
?CLASS(ThisT,wxAuiManagerEvent),
?CLASS(MgrT,wxAuiManager),
wxe_util:cast(?wxAuiManagerEvent_SetManager,
<<ThisRef:32/?UI,MgrRef:32/?UI>>).
-%% @spec (This::wxAuiManagerEvent()) -> wxAuiManager:wxAuiManager()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanagerevent.html#wxauimanagereventgetmanager">external documentation</a>.
+-spec getManager(This) -> wxAuiManager:wxAuiManager() when
+ This::wxAuiManagerEvent().
getManager(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManagerEvent),
wxe_util:call(?wxAuiManagerEvent_GetManager,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiManagerEvent(), P::wxAuiPaneInfo:wxAuiPaneInfo()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanagerevent.html#wxauimanagereventsetpane">external documentation</a>.
+-spec setPane(This, P) -> ok when
+ This::wxAuiManagerEvent(), P::wxAuiPaneInfo:wxAuiPaneInfo().
setPane(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PT,ref=PRef}) ->
?CLASS(ThisT,wxAuiManagerEvent),
?CLASS(PT,wxAuiPaneInfo),
wxe_util:cast(?wxAuiManagerEvent_SetPane,
<<ThisRef:32/?UI,PRef:32/?UI>>).
-%% @spec (This::wxAuiManagerEvent()) -> wxAuiPaneInfo:wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanagerevent.html#wxauimanagereventgetpane">external documentation</a>.
+-spec getPane(This) -> wxAuiPaneInfo:wxAuiPaneInfo() when
+ This::wxAuiManagerEvent().
getPane(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManagerEvent),
wxe_util:call(?wxAuiManagerEvent_GetPane,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiManagerEvent(), B::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanagerevent.html#wxauimanagereventsetbutton">external documentation</a>.
+-spec setButton(This, B) -> ok when
+ This::wxAuiManagerEvent(), B::integer().
setButton(#wx_ref{type=ThisT,ref=ThisRef},B)
when is_integer(B) ->
?CLASS(ThisT,wxAuiManagerEvent),
wxe_util:cast(?wxAuiManagerEvent_SetButton,
<<ThisRef:32/?UI,B:32/?UI>>).
-%% @spec (This::wxAuiManagerEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanagerevent.html#wxauimanagereventgetbutton">external documentation</a>.
+-spec getButton(This) -> integer() when
+ This::wxAuiManagerEvent().
getButton(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManagerEvent),
wxe_util:call(?wxAuiManagerEvent_GetButton,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiManagerEvent(), Pdc::wxDC:wxDC()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanagerevent.html#wxauimanagereventsetdc">external documentation</a>.
+-spec setDC(This, Pdc) -> ok when
+ This::wxAuiManagerEvent(), Pdc::wxDC:wxDC().
setDC(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PdcT,ref=PdcRef}) ->
?CLASS(ThisT,wxAuiManagerEvent),
?CLASS(PdcT,wxDC),
wxe_util:cast(?wxAuiManagerEvent_SetDC,
<<ThisRef:32/?UI,PdcRef:32/?UI>>).
-%% @spec (This::wxAuiManagerEvent()) -> wxDC:wxDC()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanagerevent.html#wxauimanagereventgetdc">external documentation</a>.
+-spec getDC(This) -> wxDC:wxDC() when
+ This::wxAuiManagerEvent().
getDC(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManagerEvent),
wxe_util:call(?wxAuiManagerEvent_GetDC,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiManagerEvent()) -> ok
%% @equiv veto(This, [])
+-spec veto(This) -> ok when
+ This::wxAuiManagerEvent().
+
veto(This)
when is_record(This, wx_ref) ->
veto(This, []).
-%% @spec (This::wxAuiManagerEvent(), [Option]) -> ok
-%% Option = {veto, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanagerevent.html#wxauimanagereventveto">external documentation</a>.
+-spec veto(This, [Option]) -> ok when
+ This::wxAuiManagerEvent(),
+ Option :: {veto, boolean()}.
veto(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiManagerEvent),
@@ -120,23 +133,26 @@ veto(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxAuiManagerEvent_Veto,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiManagerEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanagerevent.html#wxauimanagereventgetveto">external documentation</a>.
+-spec getVeto(This) -> boolean() when
+ This::wxAuiManagerEvent().
getVeto(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManagerEvent),
wxe_util:call(?wxAuiManagerEvent_GetVeto,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiManagerEvent(), Can_veto::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanagerevent.html#wxauimanagereventsetcanveto">external documentation</a>.
+-spec setCanVeto(This, Can_veto) -> ok when
+ This::wxAuiManagerEvent(), Can_veto::boolean().
setCanVeto(#wx_ref{type=ThisT,ref=ThisRef},Can_veto)
when is_boolean(Can_veto) ->
?CLASS(ThisT,wxAuiManagerEvent),
wxe_util:cast(?wxAuiManagerEvent_SetCanVeto,
<<ThisRef:32/?UI,(wxe_util:from_bool(Can_veto)):32/?UI>>).
-%% @spec (This::wxAuiManagerEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauimanagerevent.html#wxauimanagereventcanveto">external documentation</a>.
+-spec canVeto(This) -> boolean() when
+ This::wxAuiManagerEvent().
canVeto(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiManagerEvent),
wxe_util:call(?wxAuiManagerEvent_CanVeto,
diff --git a/lib/wx/src/gen/wxAuiNotebook.erl b/lib/wx/src/gen/wxAuiNotebook.erl
index 5862bb26c7..afb599738f 100644
--- a/lib/wx/src/gen/wxAuiNotebook.erl
+++ b/lib/wx/src/gen/wxAuiNotebook.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -73,27 +73,35 @@
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
validate/1,warpPointer/3]).
+-export_type([wxAuiNotebook/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxAuiNotebook()
+-type wxAuiNotebook() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebookwxauinotebook">external documentation</a>.
+-spec new() -> wxAuiNotebook().
new() ->
wxe_util:construct(?wxAuiNotebook_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxAuiNotebook()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxAuiNotebook() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxAuiNotebook()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebookwxauinotebook">external documentation</a>.
+-spec new(Parent, [Option]) -> wxAuiNotebook() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -106,15 +114,19 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxAuiNotebook_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiNotebook(), Page::wxWindow:wxWindow(), Caption::string()) -> bool()
%% @equiv addPage(This,Page,Caption, [])
+-spec addPage(This, Page, Caption) -> boolean() when
+ This::wxAuiNotebook(), Page::wxWindow:wxWindow(), Caption::unicode:chardata().
+
addPage(This,Page,Caption)
when is_record(This, wx_ref),is_record(Page, wx_ref),is_list(Caption) ->
addPage(This,Page,Caption, []).
-%% @spec (This::wxAuiNotebook(), Page::wxWindow:wxWindow(), Caption::string(), [Option]) -> bool()
-%% Option = {select, bool()} | {bitmap, wxBitmap:wxBitmap()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebookaddpage">external documentation</a>.
+-spec addPage(This, Page, Caption, [Option]) -> boolean() when
+ This::wxAuiNotebook(), Page::wxWindow:wxWindow(), Caption::unicode:chardata(),
+ Option :: {select, boolean()}
+ | {bitmap, wxBitmap:wxBitmap()}.
addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Caption, Options)
when is_list(Caption),is_list(Options) ->
?CLASS(ThisT,wxAuiNotebook),
@@ -127,15 +139,21 @@ addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Caption,
wxe_util:call(?wxAuiNotebook_AddPage,
<<ThisRef:32/?UI,PageRef:32/?UI,(byte_size(Caption_UC)):32/?UI,(Caption_UC)/binary, 0:(((8- ((4+byte_size(Caption_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxAuiNotebook(), Parent::wxWindow:wxWindow()) -> bool()
%% @equiv create(This,Parent, [])
+-spec create(This, Parent) -> boolean() when
+ This::wxAuiNotebook(), Parent::wxWindow:wxWindow().
+
create(This,Parent)
when is_record(This, wx_ref),is_record(Parent, wx_ref) ->
create(This,Parent, []).
-%% @spec (This::wxAuiNotebook(), Parent::wxWindow:wxWindow(), [Option]) -> bool()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebookcreate">external documentation</a>.
+-spec create(This, Parent, [Option]) -> boolean() when
+ This::wxAuiNotebook(), Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiNotebook),
@@ -149,76 +167,88 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Opti
wxe_util:call(?wxAuiNotebook_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxAuiNotebook(), Page::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebookdeletepage">external documentation</a>.
+-spec deletePage(This, Page) -> boolean() when
+ This::wxAuiNotebook(), Page::integer().
deletePage(#wx_ref{type=ThisT,ref=ThisRef},Page)
when is_integer(Page) ->
?CLASS(ThisT,wxAuiNotebook),
wxe_util:call(?wxAuiNotebook_DeletePage,
<<ThisRef:32/?UI,Page:32/?UI>>).
-%% @spec (This::wxAuiNotebook()) -> wxAuiTabArt:wxAuiTabArt()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebookgetartprovider">external documentation</a>.
+-spec getArtProvider(This) -> wxAuiTabArt:wxAuiTabArt() when
+ This::wxAuiNotebook().
getArtProvider(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiNotebook),
wxe_util:call(?wxAuiNotebook_GetArtProvider,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiNotebook(), Page_idx::integer()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebookgetpage">external documentation</a>.
+-spec getPage(This, Page_idx) -> wxWindow:wxWindow() when
+ This::wxAuiNotebook(), Page_idx::integer().
getPage(#wx_ref{type=ThisT,ref=ThisRef},Page_idx)
when is_integer(Page_idx) ->
?CLASS(ThisT,wxAuiNotebook),
wxe_util:call(?wxAuiNotebook_GetPage,
<<ThisRef:32/?UI,Page_idx:32/?UI>>).
-%% @spec (This::wxAuiNotebook(), Page_idx::integer()) -> wxBitmap:wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebookgetpagebitmap">external documentation</a>.
+-spec getPageBitmap(This, Page_idx) -> wxBitmap:wxBitmap() when
+ This::wxAuiNotebook(), Page_idx::integer().
getPageBitmap(#wx_ref{type=ThisT,ref=ThisRef},Page_idx)
when is_integer(Page_idx) ->
?CLASS(ThisT,wxAuiNotebook),
wxe_util:call(?wxAuiNotebook_GetPageBitmap,
<<ThisRef:32/?UI,Page_idx:32/?UI>>).
-%% @spec (This::wxAuiNotebook()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebookgetpagecount">external documentation</a>.
+-spec getPageCount(This) -> integer() when
+ This::wxAuiNotebook().
getPageCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiNotebook),
wxe_util:call(?wxAuiNotebook_GetPageCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiNotebook(), Page_wnd::wxWindow:wxWindow()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebookgetpageindex">external documentation</a>.
+-spec getPageIndex(This, Page_wnd) -> integer() when
+ This::wxAuiNotebook(), Page_wnd::wxWindow:wxWindow().
getPageIndex(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=Page_wndT,ref=Page_wndRef}) ->
?CLASS(ThisT,wxAuiNotebook),
?CLASS(Page_wndT,wxWindow),
wxe_util:call(?wxAuiNotebook_GetPageIndex,
<<ThisRef:32/?UI,Page_wndRef:32/?UI>>).
-%% @spec (This::wxAuiNotebook(), Page_idx::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebookgetpagetext">external documentation</a>.
+-spec getPageText(This, Page_idx) -> unicode:charlist() when
+ This::wxAuiNotebook(), Page_idx::integer().
getPageText(#wx_ref{type=ThisT,ref=ThisRef},Page_idx)
when is_integer(Page_idx) ->
?CLASS(ThisT,wxAuiNotebook),
wxe_util:call(?wxAuiNotebook_GetPageText,
<<ThisRef:32/?UI,Page_idx:32/?UI>>).
-%% @spec (This::wxAuiNotebook()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebookgetselection">external documentation</a>.
+-spec getSelection(This) -> integer() when
+ This::wxAuiNotebook().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiNotebook),
wxe_util:call(?wxAuiNotebook_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiNotebook(), Page_idx::integer(), Page::wxWindow:wxWindow(), Caption::string()) -> bool()
%% @equiv insertPage(This,Page_idx,Page,Caption, [])
+-spec insertPage(This, Page_idx, Page, Caption) -> boolean() when
+ This::wxAuiNotebook(), Page_idx::integer(), Page::wxWindow:wxWindow(), Caption::unicode:chardata().
+
insertPage(This,Page_idx,Page,Caption)
when is_record(This, wx_ref),is_integer(Page_idx),is_record(Page, wx_ref),is_list(Caption) ->
insertPage(This,Page_idx,Page,Caption, []).
-%% @spec (This::wxAuiNotebook(), Page_idx::integer(), Page::wxWindow:wxWindow(), Caption::string(), [Option]) -> bool()
-%% Option = {select, bool()} | {bitmap, wxBitmap:wxBitmap()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebookinsertpage">external documentation</a>.
+-spec insertPage(This, Page_idx, Page, Caption, [Option]) -> boolean() when
+ This::wxAuiNotebook(), Page_idx::integer(), Page::wxWindow:wxWindow(), Caption::unicode:chardata(),
+ Option :: {select, boolean()}
+ | {bitmap, wxBitmap:wxBitmap()}.
insertPage(#wx_ref{type=ThisT,ref=ThisRef},Page_idx,#wx_ref{type=PageT,ref=PageRef},Caption, Options)
when is_integer(Page_idx),is_list(Caption),is_list(Options) ->
?CLASS(ThisT,wxAuiNotebook),
@@ -231,32 +261,36 @@ insertPage(#wx_ref{type=ThisT,ref=ThisRef},Page_idx,#wx_ref{type=PageT,ref=PageR
wxe_util:call(?wxAuiNotebook_InsertPage,
<<ThisRef:32/?UI,Page_idx:32/?UI,PageRef:32/?UI,(byte_size(Caption_UC)):32/?UI,(Caption_UC)/binary, 0:(((8- ((0+byte_size(Caption_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxAuiNotebook(), Page::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebookremovepage">external documentation</a>.
+-spec removePage(This, Page) -> boolean() when
+ This::wxAuiNotebook(), Page::integer().
removePage(#wx_ref{type=ThisT,ref=ThisRef},Page)
when is_integer(Page) ->
?CLASS(ThisT,wxAuiNotebook),
wxe_util:call(?wxAuiNotebook_RemovePage,
<<ThisRef:32/?UI,Page:32/?UI>>).
-%% @spec (This::wxAuiNotebook(), Art::wxAuiTabArt:wxAuiTabArt()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebooksetartprovider">external documentation</a>.
+-spec setArtProvider(This, Art) -> ok when
+ This::wxAuiNotebook(), Art::wxAuiTabArt:wxAuiTabArt().
setArtProvider(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ArtT,ref=ArtRef}) ->
?CLASS(ThisT,wxAuiNotebook),
?CLASS(ArtT,wxAuiTabArt),
wxe_util:cast(?wxAuiNotebook_SetArtProvider,
<<ThisRef:32/?UI,ArtRef:32/?UI>>).
-%% @spec (This::wxAuiNotebook(), Font::wxFont:wxFont()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebooksetfont">external documentation</a>.
+-spec setFont(This, Font) -> boolean() when
+ This::wxAuiNotebook(), Font::wxFont:wxFont().
setFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}) ->
?CLASS(ThisT,wxAuiNotebook),
?CLASS(FontT,wxFont),
wxe_util:call(?wxAuiNotebook_SetFont,
<<ThisRef:32/?UI,FontRef:32/?UI>>).
-%% @spec (This::wxAuiNotebook(), Page::integer(), Bitmap::wxBitmap:wxBitmap()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebooksetpagebitmap">external documentation</a>.
+-spec setPageBitmap(This, Page, Bitmap) -> boolean() when
+ This::wxAuiNotebook(), Page::integer(), Bitmap::wxBitmap:wxBitmap().
setPageBitmap(#wx_ref{type=ThisT,ref=ThisRef},Page,#wx_ref{type=BitmapT,ref=BitmapRef})
when is_integer(Page) ->
?CLASS(ThisT,wxAuiNotebook),
@@ -264,8 +298,9 @@ setPageBitmap(#wx_ref{type=ThisT,ref=ThisRef},Page,#wx_ref{type=BitmapT,ref=Bitm
wxe_util:call(?wxAuiNotebook_SetPageBitmap,
<<ThisRef:32/?UI,Page:32/?UI,BitmapRef:32/?UI>>).
-%% @spec (This::wxAuiNotebook(), Page::integer(), Text::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebooksetpagetext">external documentation</a>.
+-spec setPageText(This, Page, Text) -> boolean() when
+ This::wxAuiNotebook(), Page::integer(), Text::unicode:chardata().
setPageText(#wx_ref{type=ThisT,ref=ThisRef},Page,Text)
when is_integer(Page),is_list(Text) ->
?CLASS(ThisT,wxAuiNotebook),
@@ -273,32 +308,35 @@ setPageText(#wx_ref{type=ThisT,ref=ThisRef},Page,Text)
wxe_util:call(?wxAuiNotebook_SetPageText,
<<ThisRef:32/?UI,Page:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxAuiNotebook(), New_page::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebooksetselection">external documentation</a>.
+-spec setSelection(This, New_page) -> integer() when
+ This::wxAuiNotebook(), New_page::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},New_page)
when is_integer(New_page) ->
?CLASS(ThisT,wxAuiNotebook),
wxe_util:call(?wxAuiNotebook_SetSelection,
<<ThisRef:32/?UI,New_page:32/?UI>>).
-%% @spec (This::wxAuiNotebook(), Height::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebooksettabctrlheight">external documentation</a>.
+-spec setTabCtrlHeight(This, Height) -> ok when
+ This::wxAuiNotebook(), Height::integer().
setTabCtrlHeight(#wx_ref{type=ThisT,ref=ThisRef},Height)
when is_integer(Height) ->
?CLASS(ThisT,wxAuiNotebook),
wxe_util:cast(?wxAuiNotebook_SetTabCtrlHeight,
<<ThisRef:32/?UI,Height:32/?UI>>).
-%% @spec (This::wxAuiNotebook(), Size::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebook.html#wxauinotebooksetuniformbitmapsize">external documentation</a>.
+-spec setUniformBitmapSize(This, Size) -> ok when
+ This::wxAuiNotebook(), Size::{W::integer(), H::integer()}.
setUniformBitmapSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxAuiNotebook),
wxe_util:cast(?wxAuiNotebook_SetUniformBitmapSize,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxAuiNotebook()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxAuiNotebook()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxAuiNotebook),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxAuiNotebookEvent.erl b/lib/wx/src/gen/wxAuiNotebookEvent.erl
index 09a2abf214..6a86464369 100644
--- a/lib/wx/src/gen/wxAuiNotebookEvent.erl
+++ b/lib/wx/src/gen/wxAuiNotebookEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -42,52 +42,60 @@
isSelection/1,parent_class/1,resumePropagation/2,setInt/2,setString/2,
shouldPropagate/1,skip/1,skip/2,stopPropagation/1,veto/1]).
+-export_type([wxAuiNotebookEvent/0]).
%% @hidden
parent_class(wxNotifyEvent) -> true;
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxAuiNotebookEvent(), S::integer()) -> ok
+-type wxAuiNotebookEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebookevent.html#wxauinotebookeventsetselection">external documentation</a>.
+-spec setSelection(This, S) -> ok when
+ This::wxAuiNotebookEvent(), S::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},S)
when is_integer(S) ->
?CLASS(ThisT,wxAuiNotebookEvent),
wxe_util:cast(?wxAuiNotebookEvent_SetSelection,
<<ThisRef:32/?UI,S:32/?UI>>).
-%% @spec (This::wxAuiNotebookEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebookevent.html#wxauinotebookeventgetselection">external documentation</a>.
+-spec getSelection(This) -> integer() when
+ This::wxAuiNotebookEvent().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiNotebookEvent),
wxe_util:call(?wxAuiNotebookEvent_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiNotebookEvent(), S::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebookevent.html#wxauinotebookeventsetoldselection">external documentation</a>.
+-spec setOldSelection(This, S) -> ok when
+ This::wxAuiNotebookEvent(), S::integer().
setOldSelection(#wx_ref{type=ThisT,ref=ThisRef},S)
when is_integer(S) ->
?CLASS(ThisT,wxAuiNotebookEvent),
wxe_util:cast(?wxAuiNotebookEvent_SetOldSelection,
<<ThisRef:32/?UI,S:32/?UI>>).
-%% @spec (This::wxAuiNotebookEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebookevent.html#wxauinotebookeventgetoldselection">external documentation</a>.
+-spec getOldSelection(This) -> integer() when
+ This::wxAuiNotebookEvent().
getOldSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiNotebookEvent),
wxe_util:call(?wxAuiNotebookEvent_GetOldSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiNotebookEvent(), S::wxAuiNotebook:wxAuiNotebook()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebookevent.html#wxauinotebookeventsetdragsource">external documentation</a>.
+-spec setDragSource(This, S) -> ok when
+ This::wxAuiNotebookEvent(), S::wxAuiNotebook:wxAuiNotebook().
setDragSource(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ST,ref=SRef}) ->
?CLASS(ThisT,wxAuiNotebookEvent),
?CLASS(ST,wxAuiNotebook),
wxe_util:cast(?wxAuiNotebookEvent_SetDragSource,
<<ThisRef:32/?UI,SRef:32/?UI>>).
-%% @spec (This::wxAuiNotebookEvent()) -> wxAuiNotebook:wxAuiNotebook()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauinotebookevent.html#wxauinotebookeventgetdragsource">external documentation</a>.
+-spec getDragSource(This) -> wxAuiNotebook:wxAuiNotebook() when
+ This::wxAuiNotebookEvent().
getDragSource(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiNotebookEvent),
wxe_util:call(?wxAuiNotebookEvent_GetDragSource,
diff --git a/lib/wx/src/gen/wxAuiPaneInfo.erl b/lib/wx/src/gen/wxAuiPaneInfo.erl
index b15f91c675..d59a8e8676 100644
--- a/lib/wx/src/gen/wxAuiPaneInfo.erl
+++ b/lib/wx/src/gen/wxAuiPaneInfo.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -44,54 +44,63 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxAuiPaneInfo/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxAuiPaneInfo()
+-type wxAuiPaneInfo() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfowxauipaneinfo">external documentation</a>.
+-spec new() -> wxAuiPaneInfo().
new() ->
wxe_util:construct(?wxAuiPaneInfo_new_0,
<<>>).
-%% @spec (C::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfowxauipaneinfo">external documentation</a>.
+-spec new(C) -> wxAuiPaneInfo() when
+ C::wxAuiPaneInfo().
new(#wx_ref{type=CT,ref=CRef}) ->
?CLASS(CT,wxAuiPaneInfo),
wxe_util:construct(?wxAuiPaneInfo_new_1,
<<CRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo(), Size::{W::integer(), H::integer()}) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfobestsize">external documentation</a>.
+-spec bestSize(This, Size) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), Size::{W::integer(), H::integer()}.
bestSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_BestSize_1,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo(), X::integer(), Y::integer()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfobestsize">external documentation</a>.
+-spec bestSize(This, X, Y) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), X::integer(), Y::integer().
bestSize(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_BestSize_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfobottom">external documentation</a>.
+-spec bottom(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
bottom(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_Bottom,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv bottomDockable(This, [])
+-spec bottomDockable(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
bottomDockable(This)
when is_record(This, wx_ref) ->
bottomDockable(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {b, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfobottomdockable">external documentation</a>.
+-spec bottomDockable(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {b, boolean()}.
bottomDockable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -101,8 +110,9 @@ bottomDockable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_BottomDockable,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo(), C::string()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfocaption">external documentation</a>.
+-spec caption(This, C) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), C::unicode:chardata().
caption(#wx_ref{type=ThisT,ref=ThisRef},C)
when is_list(C) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -110,15 +120,18 @@ caption(#wx_ref{type=ThisT,ref=ThisRef},C)
wxe_util:call(?wxAuiPaneInfo_Caption,
<<ThisRef:32/?UI,(byte_size(C_UC)):32/?UI,(C_UC)/binary, 0:(((8- ((0+byte_size(C_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv captionVisible(This, [])
+-spec captionVisible(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
captionVisible(This)
when is_record(This, wx_ref) ->
captionVisible(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {visible, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfocaptionvisible">external documentation</a>.
+-spec captionVisible(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {visible, boolean()}.
captionVisible(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -128,29 +141,34 @@ captionVisible(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_CaptionVisible,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfocentre">external documentation</a>.
+-spec centre(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
centre(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_Centre,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfocentrepane">external documentation</a>.
+-spec centrePane(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
centrePane(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_CentrePane,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv closeButton(This, [])
+-spec closeButton(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
closeButton(This)
when is_record(This, wx_ref) ->
closeButton(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {visible, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoclosebutton">external documentation</a>.
+-spec closeButton(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {visible, boolean()}.
closeButton(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -160,22 +178,26 @@ closeButton(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_CloseButton,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfodefaultpane">external documentation</a>.
+-spec defaultPane(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
defaultPane(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_DefaultPane,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv destroyOnClose(This, [])
+-spec destroyOnClose(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
destroyOnClose(This)
when is_record(This, wx_ref) ->
destroyOnClose(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {b, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfodestroyonclose">external documentation</a>.
+-spec destroyOnClose(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {b, boolean()}.
destroyOnClose(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -185,30 +207,35 @@ destroyOnClose(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_DestroyOnClose,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo(), Direction::integer()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfodirection">external documentation</a>.
+-spec direction(This, Direction) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), Direction::integer().
direction(#wx_ref{type=ThisT,ref=ThisRef},Direction)
when is_integer(Direction) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_Direction,
<<ThisRef:32/?UI,Direction:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfodock">external documentation</a>.
+-spec dock(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
dock(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_Dock,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv dockable(This, [])
+-spec dockable(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
dockable(This)
when is_record(This, wx_ref) ->
dockable(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {b, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfodockable">external documentation</a>.
+-spec dockable(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {b, boolean()}.
dockable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -218,29 +245,34 @@ dockable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_Dockable,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfofixed">external documentation</a>.
+-spec fixed(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
fixed(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_Fixed,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfofloat">external documentation</a>.
+-spec float(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
float(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_Float,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv floatable(This, [])
+-spec floatable(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
floatable(This)
when is_record(This, wx_ref) ->
floatable(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {b, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfofloatable">external documentation</a>.
+-spec floatable(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {b, boolean()}.
floatable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -250,47 +282,54 @@ floatable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_Floatable,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo(), Pos::{X::integer(), Y::integer()}) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfofloatingposition">external documentation</a>.
+-spec floatingPosition(This, Pos) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), Pos::{X::integer(), Y::integer()}.
floatingPosition(#wx_ref{type=ThisT,ref=ThisRef},{PosX,PosY})
when is_integer(PosX),is_integer(PosY) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_FloatingPosition_1,
<<ThisRef:32/?UI,PosX:32/?UI,PosY:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo(), X::integer(), Y::integer()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfofloatingposition">external documentation</a>.
+-spec floatingPosition(This, X, Y) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), X::integer(), Y::integer().
floatingPosition(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_FloatingPosition_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo(), Size::{W::integer(), H::integer()}) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfofloatingsize">external documentation</a>.
+-spec floatingSize(This, Size) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), Size::{W::integer(), H::integer()}.
floatingSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_FloatingSize_1,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo(), X::integer(), Y::integer()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfofloatingsize">external documentation</a>.
+-spec floatingSize(This, X, Y) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), X::integer(), Y::integer().
floatingSize(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_FloatingSize_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv gripper(This, [])
+-spec gripper(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
gripper(This)
when is_record(This, wx_ref) ->
gripper(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {visible, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfogripper">external documentation</a>.
+-spec gripper(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {visible, boolean()}.
gripper(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -300,15 +339,18 @@ gripper(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_Gripper,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv gripperTop(This, [])
+-spec gripperTop(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
gripperTop(This)
when is_record(This, wx_ref) ->
gripperTop(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {attop, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfogrippertop">external documentation</a>.
+-spec gripperTop(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {attop, boolean()}.
gripperTop(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -318,192 +360,220 @@ gripperTop(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_GripperTop,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfohasborder">external documentation</a>.
+-spec hasBorder(This) -> boolean() when
+ This::wxAuiPaneInfo().
hasBorder(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_HasBorder,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfohascaption">external documentation</a>.
+-spec hasCaption(This) -> boolean() when
+ This::wxAuiPaneInfo().
hasCaption(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_HasCaption,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfohasclosebutton">external documentation</a>.
+-spec hasCloseButton(This) -> boolean() when
+ This::wxAuiPaneInfo().
hasCloseButton(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_HasCloseButton,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo(), Flag::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfohasflag">external documentation</a>.
+-spec hasFlag(This, Flag) -> boolean() when
+ This::wxAuiPaneInfo(), Flag::integer().
hasFlag(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_integer(Flag) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_HasFlag,
<<ThisRef:32/?UI,Flag:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfohasgripper">external documentation</a>.
+-spec hasGripper(This) -> boolean() when
+ This::wxAuiPaneInfo().
hasGripper(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_HasGripper,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfohasgrippertop">external documentation</a>.
+-spec hasGripperTop(This) -> boolean() when
+ This::wxAuiPaneInfo().
hasGripperTop(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_HasGripperTop,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfohasmaximizebutton">external documentation</a>.
+-spec hasMaximizeButton(This) -> boolean() when
+ This::wxAuiPaneInfo().
hasMaximizeButton(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_HasMaximizeButton,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfohasminimizebutton">external documentation</a>.
+-spec hasMinimizeButton(This) -> boolean() when
+ This::wxAuiPaneInfo().
hasMinimizeButton(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_HasMinimizeButton,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfohaspinbutton">external documentation</a>.
+-spec hasPinButton(This) -> boolean() when
+ This::wxAuiPaneInfo().
hasPinButton(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_HasPinButton,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfohide">external documentation</a>.
+-spec hide(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
hide(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_Hide,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoisbottomdockable">external documentation</a>.
+-spec isBottomDockable(This) -> boolean() when
+ This::wxAuiPaneInfo().
isBottomDockable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_IsBottomDockable,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoisdocked">external documentation</a>.
+-spec isDocked(This) -> boolean() when
+ This::wxAuiPaneInfo().
isDocked(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_IsDocked,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoisfixed">external documentation</a>.
+-spec isFixed(This) -> boolean() when
+ This::wxAuiPaneInfo().
isFixed(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_IsFixed,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoisfloatable">external documentation</a>.
+-spec isFloatable(This) -> boolean() when
+ This::wxAuiPaneInfo().
isFloatable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_IsFloatable,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoisfloating">external documentation</a>.
+-spec isFloating(This) -> boolean() when
+ This::wxAuiPaneInfo().
isFloating(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_IsFloating,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoisleftdockable">external documentation</a>.
+-spec isLeftDockable(This) -> boolean() when
+ This::wxAuiPaneInfo().
isLeftDockable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_IsLeftDockable,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoismovable">external documentation</a>.
+-spec isMovable(This) -> boolean() when
+ This::wxAuiPaneInfo().
isMovable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_IsMovable,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoisok">external documentation</a>.
+-spec isOk(This) -> boolean() when
+ This::wxAuiPaneInfo().
isOk(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_IsOk,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoisresizable">external documentation</a>.
+-spec isResizable(This) -> boolean() when
+ This::wxAuiPaneInfo().
isResizable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_IsResizable,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoisrightdockable">external documentation</a>.
+-spec isRightDockable(This) -> boolean() when
+ This::wxAuiPaneInfo().
isRightDockable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_IsRightDockable,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoisshown">external documentation</a>.
+-spec isShown(This) -> boolean() when
+ This::wxAuiPaneInfo().
isShown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_IsShown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoistoolbar">external documentation</a>.
+-spec isToolbar(This) -> boolean() when
+ This::wxAuiPaneInfo().
isToolbar(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_IsToolbar,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoistopdockable">external documentation</a>.
+-spec isTopDockable(This) -> boolean() when
+ This::wxAuiPaneInfo().
isTopDockable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_IsTopDockable,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo(), Layer::integer()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfolayer">external documentation</a>.
+-spec layer(This, Layer) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), Layer::integer().
layer(#wx_ref{type=ThisT,ref=ThisRef},Layer)
when is_integer(Layer) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_Layer,
<<ThisRef:32/?UI,Layer:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoleft">external documentation</a>.
+-spec left(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
left(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_Left,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv leftDockable(This, [])
+-spec leftDockable(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
leftDockable(This)
when is_record(This, wx_ref) ->
leftDockable(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {b, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoleftdockable">external documentation</a>.
+-spec leftDockable(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {b, boolean()}.
leftDockable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -513,31 +583,36 @@ leftDockable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_LeftDockable,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo(), Size::{W::integer(), H::integer()}) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfomaxsize">external documentation</a>.
+-spec maxSize(This, Size) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), Size::{W::integer(), H::integer()}.
maxSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_MaxSize_1,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo(), X::integer(), Y::integer()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfomaxsize">external documentation</a>.
+-spec maxSize(This, X, Y) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), X::integer(), Y::integer().
maxSize(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_MaxSize_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv maximizeButton(This, [])
+-spec maximizeButton(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
maximizeButton(This)
when is_record(This, wx_ref) ->
maximizeButton(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {visible, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfomaximizebutton">external documentation</a>.
+-spec maximizeButton(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {visible, boolean()}.
maximizeButton(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -547,31 +622,36 @@ maximizeButton(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_MaximizeButton,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo(), Size::{W::integer(), H::integer()}) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfominsize">external documentation</a>.
+-spec minSize(This, Size) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), Size::{W::integer(), H::integer()}.
minSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_MinSize_1,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo(), X::integer(), Y::integer()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfominsize">external documentation</a>.
+-spec minSize(This, X, Y) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), X::integer(), Y::integer().
minSize(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_MinSize_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv minimizeButton(This, [])
+-spec minimizeButton(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
minimizeButton(This)
when is_record(This, wx_ref) ->
minimizeButton(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {visible, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfominimizebutton">external documentation</a>.
+-spec minimizeButton(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {visible, boolean()}.
minimizeButton(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -581,15 +661,18 @@ minimizeButton(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_MinimizeButton,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv movable(This, [])
+-spec movable(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
movable(This)
when is_record(This, wx_ref) ->
movable(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {b, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfomovable">external documentation</a>.
+-spec movable(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {b, boolean()}.
movable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -599,8 +682,9 @@ movable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_Movable,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo(), N::string()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoname">external documentation</a>.
+-spec name(This, N) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), N::unicode:chardata().
name(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_list(N) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -608,15 +692,18 @@ name(#wx_ref{type=ThisT,ref=ThisRef},N)
wxe_util:call(?wxAuiPaneInfo_Name,
<<ThisRef:32/?UI,(byte_size(N_UC)):32/?UI,(N_UC)/binary, 0:(((8- ((0+byte_size(N_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv paneBorder(This, [])
+-spec paneBorder(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
paneBorder(This)
when is_record(This, wx_ref) ->
paneBorder(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {visible, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfopaneborder">external documentation</a>.
+-spec paneBorder(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {visible, boolean()}.
paneBorder(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -626,15 +713,18 @@ paneBorder(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_PaneBorder,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv pinButton(This, [])
+-spec pinButton(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
pinButton(This)
when is_record(This, wx_ref) ->
pinButton(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {visible, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfopinbutton">external documentation</a>.
+-spec pinButton(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {visible, boolean()}.
pinButton(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -644,23 +734,27 @@ pinButton(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_PinButton,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo(), Pos::integer()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoposition">external documentation</a>.
+-spec position(This, Pos) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), Pos::integer().
position(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_Position,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv resizable(This, [])
+-spec resizable(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
resizable(This)
when is_record(This, wx_ref) ->
resizable(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {resizable, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinforesizable">external documentation</a>.
+-spec resizable(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {resizable, boolean()}.
resizable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -670,22 +764,26 @@ resizable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_Resizable,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinforight">external documentation</a>.
+-spec right(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
right(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_Right,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv rightDockable(This, [])
+-spec rightDockable(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
rightDockable(This)
when is_record(This, wx_ref) ->
rightDockable(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {b, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinforightdockable">external documentation</a>.
+-spec rightDockable(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {b, boolean()}.
rightDockable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -695,39 +793,45 @@ rightDockable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_RightDockable,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo(), Row::integer()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinforow">external documentation</a>.
+-spec row(This, Row) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), Row::integer().
row(#wx_ref{type=ThisT,ref=ThisRef},Row)
when is_integer(Row) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_Row,
<<ThisRef:32/?UI,Row:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo(), Source::wxAuiPaneInfo()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfosafeset">external documentation</a>.
+-spec safeSet(This, Source) -> ok when
+ This::wxAuiPaneInfo(), Source::wxAuiPaneInfo().
safeSet(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=SourceT,ref=SourceRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
?CLASS(SourceT,wxAuiPaneInfo),
wxe_util:cast(?wxAuiPaneInfo_SafeSet,
<<ThisRef:32/?UI,SourceRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo(), Flag::integer(), Option_state::bool()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfosetflag">external documentation</a>.
+-spec setFlag(This, Flag, Option_state) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), Flag::integer(), Option_state::boolean().
setFlag(#wx_ref{type=ThisT,ref=ThisRef},Flag,Option_state)
when is_integer(Flag),is_boolean(Option_state) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_SetFlag,
<<ThisRef:32/?UI,Flag:32/?UI,(wxe_util:from_bool(Option_state)):32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv show(This, [])
+-spec show(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
show(This)
when is_record(This, wx_ref) ->
show(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {show, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfoshow">external documentation</a>.
+-spec show(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {show, boolean()}.
show(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -737,29 +841,34 @@ show(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_Show,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfotoolbarpane">external documentation</a>.
+-spec toolbarPane(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
toolbarPane(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_ToolbarPane,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfotop">external documentation</a>.
+-spec top(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
top(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
wxe_util:call(?wxAuiPaneInfo_Top,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> wxAuiPaneInfo()
%% @equiv topDockable(This, [])
+-spec topDockable(This) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo().
+
topDockable(This)
when is_record(This, wx_ref) ->
topDockable(This, []).
-%% @spec (This::wxAuiPaneInfo(), [Option]) -> wxAuiPaneInfo()
-%% Option = {b, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfotopdockable">external documentation</a>.
+-spec topDockable(This, [Option]) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(),
+ Option :: {b, boolean()}.
topDockable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxAuiPaneInfo),
@@ -769,16 +878,17 @@ topDockable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxAuiPaneInfo_TopDockable,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxAuiPaneInfo(), W::wxWindow:wxWindow()) -> wxAuiPaneInfo()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxauipaneinfo.html#wxauipaneinfowindow">external documentation</a>.
+-spec window(This, W) -> wxAuiPaneInfo() when
+ This::wxAuiPaneInfo(), W::wxWindow:wxWindow().
window(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WT,ref=WRef}) ->
?CLASS(ThisT,wxAuiPaneInfo),
?CLASS(WT,wxWindow),
wxe_util:call(?wxAuiPaneInfo_Window,
<<ThisRef:32/?UI,WRef:32/?UI>>).
-%% @spec (This::wxAuiPaneInfo()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxAuiPaneInfo()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxAuiPaneInfo),
wxe_util:destroy(?wxAuiPaneInfo_destruct,Obj),
diff --git a/lib/wx/src/gen/wxAuiTabArt.erl b/lib/wx/src/gen/wxAuiTabArt.erl
index 725bac9664..a65c6dc8cf 100644
--- a/lib/wx/src/gen/wxAuiTabArt.erl
+++ b/lib/wx/src/gen/wxAuiTabArt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,6 +29,8 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxAuiTabArt/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxAuiTabArt() :: wx:wx_object().
diff --git a/lib/wx/src/gen/wxBitmap.erl b/lib/wx/src/gen/wxBitmap.erl
index bd2f83c6eb..8816e27cdd 100644
--- a/lib/wx/src/gen/wxBitmap.erl
+++ b/lib/wx/src/gen/wxBitmap.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -32,22 +32,27 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxBitmap/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxBitmap()
+-type wxBitmap() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapwxbitmap">external documentation</a>.
+-spec new() -> wxBitmap().
new() ->
wxe_util:construct(?wxBitmap_new_0,
<<>>).
-%% @spec (X::string()|term()) -> wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapwxbitmap">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Filename::string()) -> new(Filename, []) </c></p>
-%% <p><c>
-%% new(Image::wxImage:wxImage()) -> new(Image, []) </c></p>
+%% <br /> Also:<br />
+%% new(Image) -> wxBitmap() when<br />
+%% Image::wxImage:wxImage().<br />
+%%
+%%<br /> Type = ?wxBITMAP_TYPE_INVALID | ?wxBITMAP_TYPE_BMP | ?wxBITMAP_TYPE_BMP_RESOURCE | ?wxBITMAP_TYPE_RESOURCE | ?wxBITMAP_TYPE_ICO | ?wxBITMAP_TYPE_ICO_RESOURCE | ?wxBITMAP_TYPE_CUR | ?wxBITMAP_TYPE_CUR_RESOURCE | ?wxBITMAP_TYPE_XBM | ?wxBITMAP_TYPE_XBM_DATA | ?wxBITMAP_TYPE_XPM | ?wxBITMAP_TYPE_XPM_DATA | ?wxBITMAP_TYPE_TIF | ?wxBITMAP_TYPE_TIF_RESOURCE | ?wxBITMAP_TYPE_GIF | ?wxBITMAP_TYPE_GIF_RESOURCE | ?wxBITMAP_TYPE_PNG | ?wxBITMAP_TYPE_PNG_RESOURCE | ?wxBITMAP_TYPE_JPEG | ?wxBITMAP_TYPE_JPEG_RESOURCE | ?wxBITMAP_TYPE_PNM | ?wxBITMAP_TYPE_PNM_RESOURCE | ?wxBITMAP_TYPE_PCX | ?wxBITMAP_TYPE_PCX_RESOURCE | ?wxBITMAP_TYPE_PICT | ?wxBITMAP_TYPE_PICT_RESOURCE | ?wxBITMAP_TYPE_ICON | ?wxBITMAP_TYPE_ICON_RESOURCE | ?wxBITMAP_TYPE_ANI | ?wxBITMAP_TYPE_IFF | ?wxBITMAP_TYPE_TGA | ?wxBITMAP_TYPE_MACCURSOR | ?wxBITMAP_TYPE_MACCURSOR_RESOURCE | ?wxBITMAP_TYPE_ANY
+-spec new(Filename) -> wxBitmap() when
+ Filename::unicode:chardata();
+ (Image) -> wxBitmap() when
+ Image::wxImage:wxImage().
new(Filename)
when is_list(Filename) ->
@@ -57,21 +62,24 @@ new(Image)
when is_record(Image, wx_ref) ->
new(Image, []).
-%% @spec (X::integer()|string()|term(),X::integer()|term()) -> wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapwxbitmap">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Width::integer(), Height::integer()) -> new(Width,Height, []) </c></p>
-%% <p><c>
-%% new(Filename::string(), [Option]) -> wxBitmap() </c>
-%%<br /> Option = {type, WxBitmapType}
-%%<br /> WxBitmapType = integer()
-%%<br /> WxBitmapType is one of ?wxBITMAP_TYPE_INVALID | ?wxBITMAP_TYPE_BMP | ?wxBITMAP_TYPE_BMP_RESOURCE | ?wxBITMAP_TYPE_RESOURCE | ?wxBITMAP_TYPE_ICO | ?wxBITMAP_TYPE_ICO_RESOURCE | ?wxBITMAP_TYPE_CUR | ?wxBITMAP_TYPE_CUR_RESOURCE | ?wxBITMAP_TYPE_XBM | ?wxBITMAP_TYPE_XBM_DATA | ?wxBITMAP_TYPE_XPM | ?wxBITMAP_TYPE_XPM_DATA | ?wxBITMAP_TYPE_TIF | ?wxBITMAP_TYPE_TIF_RESOURCE | ?wxBITMAP_TYPE_GIF | ?wxBITMAP_TYPE_GIF_RESOURCE | ?wxBITMAP_TYPE_PNG | ?wxBITMAP_TYPE_PNG_RESOURCE | ?wxBITMAP_TYPE_JPEG | ?wxBITMAP_TYPE_JPEG_RESOURCE | ?wxBITMAP_TYPE_PNM | ?wxBITMAP_TYPE_PNM_RESOURCE | ?wxBITMAP_TYPE_PCX | ?wxBITMAP_TYPE_PCX_RESOURCE | ?wxBITMAP_TYPE_PICT | ?wxBITMAP_TYPE_PICT_RESOURCE | ?wxBITMAP_TYPE_ICON | ?wxBITMAP_TYPE_ICON_RESOURCE | ?wxBITMAP_TYPE_ANI | ?wxBITMAP_TYPE_IFF | ?wxBITMAP_TYPE_TGA | ?wxBITMAP_TYPE_MACCURSOR | ?wxBITMAP_TYPE_MACCURSOR_RESOURCE | ?wxBITMAP_TYPE_ANY
-%% </p>
-%% <p><c>
-%% new(Image::wxImage:wxImage(), [Option]) -> wxBitmap() </c>
-%%<br /> Option = {depth, integer()}
-%% </p>
+%% <br /> Also:<br />
+%% new(Filename, [Option]) -> wxBitmap() when<br />
+%% Filename::unicode:chardata(),<br />
+%% Option :: {type, wx:wx_enum()};<br />
+%% (Image, [Option]) -> wxBitmap() when<br />
+%% Image::wxImage:wxImage(),<br />
+%% Option :: {depth, integer()}.<br />
+%%
+%%<br /> Type = ?wxBITMAP_TYPE_INVALID | ?wxBITMAP_TYPE_BMP | ?wxBITMAP_TYPE_BMP_RESOURCE | ?wxBITMAP_TYPE_RESOURCE | ?wxBITMAP_TYPE_ICO | ?wxBITMAP_TYPE_ICO_RESOURCE | ?wxBITMAP_TYPE_CUR | ?wxBITMAP_TYPE_CUR_RESOURCE | ?wxBITMAP_TYPE_XBM | ?wxBITMAP_TYPE_XBM_DATA | ?wxBITMAP_TYPE_XPM | ?wxBITMAP_TYPE_XPM_DATA | ?wxBITMAP_TYPE_TIF | ?wxBITMAP_TYPE_TIF_RESOURCE | ?wxBITMAP_TYPE_GIF | ?wxBITMAP_TYPE_GIF_RESOURCE | ?wxBITMAP_TYPE_PNG | ?wxBITMAP_TYPE_PNG_RESOURCE | ?wxBITMAP_TYPE_JPEG | ?wxBITMAP_TYPE_JPEG_RESOURCE | ?wxBITMAP_TYPE_PNM | ?wxBITMAP_TYPE_PNM_RESOURCE | ?wxBITMAP_TYPE_PCX | ?wxBITMAP_TYPE_PCX_RESOURCE | ?wxBITMAP_TYPE_PICT | ?wxBITMAP_TYPE_PICT_RESOURCE | ?wxBITMAP_TYPE_ICON | ?wxBITMAP_TYPE_ICON_RESOURCE | ?wxBITMAP_TYPE_ANI | ?wxBITMAP_TYPE_IFF | ?wxBITMAP_TYPE_TGA | ?wxBITMAP_TYPE_MACCURSOR | ?wxBITMAP_TYPE_MACCURSOR_RESOURCE | ?wxBITMAP_TYPE_ANY
+-spec new(Width, Height) -> wxBitmap() when
+ Width::integer(), Height::integer();
+ (Filename, [Option]) -> wxBitmap() when
+ Filename::unicode:chardata(),
+ Option :: {type, wx:wx_enum()};
+ (Image, [Option]) -> wxBitmap() when
+ Image::wxImage:wxImage(),
+ Option :: {depth, integer()}.
new(Width,Height)
when is_integer(Width),is_integer(Height) ->
@@ -93,15 +101,17 @@ new(#wx_ref{type=ImageT,ref=ImageRef}, Options)
wxe_util:construct(?wxBitmap_new_2_1,
<<ImageRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (X::binary()|integer(),X::integer(),X::integer()|term()) -> wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapwxbitmap">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Bits::binary(), Width::integer(), Height::integer()) -> new(Bits,Width,Height, []) </c></p>
-%% <p><c>
-%% new(Width::integer(), Height::integer(), [Option]) -> wxBitmap() </c>
-%%<br /> Option = {depth, integer()}
-%% </p>
+%% <br /> Also:<br />
+%% new(Width, Height, [Option]) -> wxBitmap() when<br />
+%% Width::integer(), Height::integer(),<br />
+%% Option :: {depth, integer()}.<br />
+%%
+-spec new(Bits, Width, Height) -> wxBitmap() when
+ Bits::binary(), Width::integer(), Height::integer();
+ (Width, Height, [Option]) -> wxBitmap() when
+ Width::integer(), Height::integer(),
+ Option :: {depth, integer()}.
new(Bits,Width,Height)
when is_binary(Bits),is_integer(Width),is_integer(Height) ->
@@ -114,9 +124,10 @@ new(Width,Height, Options)
wxe_util:construct(?wxBitmap_new_3,
<<Width:32/?UI,Height:32/?UI, BinOpt/binary>>).
-%% @spec (Bits::binary(), Width::integer(), Height::integer(), [Option]) -> wxBitmap()
-%% Option = {depth, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapwxbitmap">external documentation</a>.
+-spec new(Bits, Width, Height, [Option]) -> wxBitmap() when
+ Bits::binary(), Width::integer(), Height::integer(),
+ Option :: {depth, integer()}.
new(Bits,Width,Height, Options)
when is_binary(Bits),is_integer(Width),is_integer(Height),is_list(Options) ->
wxe_util:send_bin(Bits),
@@ -126,30 +137,35 @@ new(Bits,Width,Height, Options)
wxe_util:construct(?wxBitmap_new_4,
<<Width:32/?UI,Height:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxBitmap()) -> wxImage:wxImage()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapconverttoimage">external documentation</a>.
+-spec convertToImage(This) -> wxImage:wxImage() when
+ This::wxBitmap().
convertToImage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBitmap),
wxe_util:call(?wxBitmap_ConvertToImage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBitmap(), Icon::wxIcon:wxIcon()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapcopyfromicon">external documentation</a>.
+-spec copyFromIcon(This, Icon) -> boolean() when
+ This::wxBitmap(), Icon::wxIcon:wxIcon().
copyFromIcon(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=IconT,ref=IconRef}) ->
?CLASS(ThisT,wxBitmap),
?CLASS(IconT,wxIcon),
wxe_util:call(?wxBitmap_CopyFromIcon,
<<ThisRef:32/?UI,IconRef:32/?UI>>).
-%% @spec (This::wxBitmap(), Width::integer(), Height::integer()) -> bool()
%% @equiv create(This,Width,Height, [])
+-spec create(This, Width, Height) -> boolean() when
+ This::wxBitmap(), Width::integer(), Height::integer().
+
create(This,Width,Height)
when is_record(This, wx_ref),is_integer(Width),is_integer(Height) ->
create(This,Width,Height, []).
-%% @spec (This::wxBitmap(), Width::integer(), Height::integer(), [Option]) -> bool()
-%% Option = {depth, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapcreate">external documentation</a>.
+-spec create(This, Width, Height, [Option]) -> boolean() when
+ This::wxBitmap(), Width::integer(), Height::integer(),
+ Option :: {depth, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
when is_integer(Width),is_integer(Height),is_list(Options) ->
?CLASS(ThisT,wxBitmap),
@@ -159,60 +175,68 @@ create(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
wxe_util:call(?wxBitmap_Create,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxBitmap()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapgetdepth">external documentation</a>.
+-spec getDepth(This) -> integer() when
+ This::wxBitmap().
getDepth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBitmap),
wxe_util:call(?wxBitmap_GetDepth,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBitmap()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapgetheight">external documentation</a>.
+-spec getHeight(This) -> integer() when
+ This::wxBitmap().
getHeight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBitmap),
wxe_util:call(?wxBitmap_GetHeight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBitmap()) -> wxPalette:wxPalette()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapgetpalette">external documentation</a>.
+-spec getPalette(This) -> wxPalette:wxPalette() when
+ This::wxBitmap().
getPalette(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBitmap),
wxe_util:call(?wxBitmap_GetPalette,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBitmap()) -> wxMask:wxMask()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapgetmask">external documentation</a>.
+-spec getMask(This) -> wxMask:wxMask() when
+ This::wxBitmap().
getMask(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBitmap),
wxe_util:call(?wxBitmap_GetMask,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBitmap()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapgetwidth">external documentation</a>.
+-spec getWidth(This) -> integer() when
+ This::wxBitmap().
getWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBitmap),
wxe_util:call(?wxBitmap_GetWidth,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBitmap(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapgetsubbitmap">external documentation</a>.
+-spec getSubBitmap(This, Rect) -> wxBitmap() when
+ This::wxBitmap(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
getSubBitmap(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) ->
?CLASS(ThisT,wxBitmap),
wxe_util:call(?wxBitmap_GetSubBitmap,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxBitmap(), Name::string()) -> bool()
%% @equiv loadFile(This,Name, [])
+-spec loadFile(This, Name) -> boolean() when
+ This::wxBitmap(), Name::unicode:chardata().
+
loadFile(This,Name)
when is_record(This, wx_ref),is_list(Name) ->
loadFile(This,Name, []).
-%% @spec (This::wxBitmap(), Name::string(), [Option]) -> bool()
-%% Option = {type, WxBitmapType}
-%% WxBitmapType = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmaploadfile">external documentation</a>.
-%%<br /> WxBitmapType is one of ?wxBITMAP_TYPE_INVALID | ?wxBITMAP_TYPE_BMP | ?wxBITMAP_TYPE_BMP_RESOURCE | ?wxBITMAP_TYPE_RESOURCE | ?wxBITMAP_TYPE_ICO | ?wxBITMAP_TYPE_ICO_RESOURCE | ?wxBITMAP_TYPE_CUR | ?wxBITMAP_TYPE_CUR_RESOURCE | ?wxBITMAP_TYPE_XBM | ?wxBITMAP_TYPE_XBM_DATA | ?wxBITMAP_TYPE_XPM | ?wxBITMAP_TYPE_XPM_DATA | ?wxBITMAP_TYPE_TIF | ?wxBITMAP_TYPE_TIF_RESOURCE | ?wxBITMAP_TYPE_GIF | ?wxBITMAP_TYPE_GIF_RESOURCE | ?wxBITMAP_TYPE_PNG | ?wxBITMAP_TYPE_PNG_RESOURCE | ?wxBITMAP_TYPE_JPEG | ?wxBITMAP_TYPE_JPEG_RESOURCE | ?wxBITMAP_TYPE_PNM | ?wxBITMAP_TYPE_PNM_RESOURCE | ?wxBITMAP_TYPE_PCX | ?wxBITMAP_TYPE_PCX_RESOURCE | ?wxBITMAP_TYPE_PICT | ?wxBITMAP_TYPE_PICT_RESOURCE | ?wxBITMAP_TYPE_ICON | ?wxBITMAP_TYPE_ICON_RESOURCE | ?wxBITMAP_TYPE_ANI | ?wxBITMAP_TYPE_IFF | ?wxBITMAP_TYPE_TGA | ?wxBITMAP_TYPE_MACCURSOR | ?wxBITMAP_TYPE_MACCURSOR_RESOURCE | ?wxBITMAP_TYPE_ANY
+%%<br /> Type = ?wxBITMAP_TYPE_INVALID | ?wxBITMAP_TYPE_BMP | ?wxBITMAP_TYPE_BMP_RESOURCE | ?wxBITMAP_TYPE_RESOURCE | ?wxBITMAP_TYPE_ICO | ?wxBITMAP_TYPE_ICO_RESOURCE | ?wxBITMAP_TYPE_CUR | ?wxBITMAP_TYPE_CUR_RESOURCE | ?wxBITMAP_TYPE_XBM | ?wxBITMAP_TYPE_XBM_DATA | ?wxBITMAP_TYPE_XPM | ?wxBITMAP_TYPE_XPM_DATA | ?wxBITMAP_TYPE_TIF | ?wxBITMAP_TYPE_TIF_RESOURCE | ?wxBITMAP_TYPE_GIF | ?wxBITMAP_TYPE_GIF_RESOURCE | ?wxBITMAP_TYPE_PNG | ?wxBITMAP_TYPE_PNG_RESOURCE | ?wxBITMAP_TYPE_JPEG | ?wxBITMAP_TYPE_JPEG_RESOURCE | ?wxBITMAP_TYPE_PNM | ?wxBITMAP_TYPE_PNM_RESOURCE | ?wxBITMAP_TYPE_PCX | ?wxBITMAP_TYPE_PCX_RESOURCE | ?wxBITMAP_TYPE_PICT | ?wxBITMAP_TYPE_PICT_RESOURCE | ?wxBITMAP_TYPE_ICON | ?wxBITMAP_TYPE_ICON_RESOURCE | ?wxBITMAP_TYPE_ANI | ?wxBITMAP_TYPE_IFF | ?wxBITMAP_TYPE_TGA | ?wxBITMAP_TYPE_MACCURSOR | ?wxBITMAP_TYPE_MACCURSOR_RESOURCE | ?wxBITMAP_TYPE_ANY
+-spec loadFile(This, Name, [Option]) -> boolean() when
+ This::wxBitmap(), Name::unicode:chardata(),
+ Option :: {type, wx:wx_enum()}.
loadFile(#wx_ref{type=ThisT,ref=ThisRef},Name, Options)
when is_list(Name),is_list(Options) ->
?CLASS(ThisT,wxBitmap),
@@ -223,24 +247,27 @@ loadFile(#wx_ref{type=ThisT,ref=ThisRef},Name, Options)
wxe_util:call(?wxBitmap_LoadFile,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxBitmap()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapok">external documentation</a>.
+-spec ok(This) -> boolean() when
+ This::wxBitmap().
ok(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBitmap),
wxe_util:call(?wxBitmap_Ok,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBitmap(), Name::string(), Type::WxBitmapType) -> bool()
%% @equiv saveFile(This,Name,Type, [])
+-spec saveFile(This, Name, Type) -> boolean() when
+ This::wxBitmap(), Name::unicode:chardata(), Type::wx:wx_enum().
+
saveFile(This,Name,Type)
when is_record(This, wx_ref),is_list(Name),is_integer(Type) ->
saveFile(This,Name,Type, []).
-%% @spec (This::wxBitmap(), Name::string(), Type::WxBitmapType, [Option]) -> bool()
-%% Option = {palette, wxPalette:wxPalette()}
-%% WxBitmapType = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapsavefile">external documentation</a>.
-%%<br /> WxBitmapType is one of ?wxBITMAP_TYPE_INVALID | ?wxBITMAP_TYPE_BMP | ?wxBITMAP_TYPE_BMP_RESOURCE | ?wxBITMAP_TYPE_RESOURCE | ?wxBITMAP_TYPE_ICO | ?wxBITMAP_TYPE_ICO_RESOURCE | ?wxBITMAP_TYPE_CUR | ?wxBITMAP_TYPE_CUR_RESOURCE | ?wxBITMAP_TYPE_XBM | ?wxBITMAP_TYPE_XBM_DATA | ?wxBITMAP_TYPE_XPM | ?wxBITMAP_TYPE_XPM_DATA | ?wxBITMAP_TYPE_TIF | ?wxBITMAP_TYPE_TIF_RESOURCE | ?wxBITMAP_TYPE_GIF | ?wxBITMAP_TYPE_GIF_RESOURCE | ?wxBITMAP_TYPE_PNG | ?wxBITMAP_TYPE_PNG_RESOURCE | ?wxBITMAP_TYPE_JPEG | ?wxBITMAP_TYPE_JPEG_RESOURCE | ?wxBITMAP_TYPE_PNM | ?wxBITMAP_TYPE_PNM_RESOURCE | ?wxBITMAP_TYPE_PCX | ?wxBITMAP_TYPE_PCX_RESOURCE | ?wxBITMAP_TYPE_PICT | ?wxBITMAP_TYPE_PICT_RESOURCE | ?wxBITMAP_TYPE_ICON | ?wxBITMAP_TYPE_ICON_RESOURCE | ?wxBITMAP_TYPE_ANI | ?wxBITMAP_TYPE_IFF | ?wxBITMAP_TYPE_TGA | ?wxBITMAP_TYPE_MACCURSOR | ?wxBITMAP_TYPE_MACCURSOR_RESOURCE | ?wxBITMAP_TYPE_ANY
+%%<br /> Type = ?wxBITMAP_TYPE_INVALID | ?wxBITMAP_TYPE_BMP | ?wxBITMAP_TYPE_BMP_RESOURCE | ?wxBITMAP_TYPE_RESOURCE | ?wxBITMAP_TYPE_ICO | ?wxBITMAP_TYPE_ICO_RESOURCE | ?wxBITMAP_TYPE_CUR | ?wxBITMAP_TYPE_CUR_RESOURCE | ?wxBITMAP_TYPE_XBM | ?wxBITMAP_TYPE_XBM_DATA | ?wxBITMAP_TYPE_XPM | ?wxBITMAP_TYPE_XPM_DATA | ?wxBITMAP_TYPE_TIF | ?wxBITMAP_TYPE_TIF_RESOURCE | ?wxBITMAP_TYPE_GIF | ?wxBITMAP_TYPE_GIF_RESOURCE | ?wxBITMAP_TYPE_PNG | ?wxBITMAP_TYPE_PNG_RESOURCE | ?wxBITMAP_TYPE_JPEG | ?wxBITMAP_TYPE_JPEG_RESOURCE | ?wxBITMAP_TYPE_PNM | ?wxBITMAP_TYPE_PNM_RESOURCE | ?wxBITMAP_TYPE_PCX | ?wxBITMAP_TYPE_PCX_RESOURCE | ?wxBITMAP_TYPE_PICT | ?wxBITMAP_TYPE_PICT_RESOURCE | ?wxBITMAP_TYPE_ICON | ?wxBITMAP_TYPE_ICON_RESOURCE | ?wxBITMAP_TYPE_ANI | ?wxBITMAP_TYPE_IFF | ?wxBITMAP_TYPE_TGA | ?wxBITMAP_TYPE_MACCURSOR | ?wxBITMAP_TYPE_MACCURSOR_RESOURCE | ?wxBITMAP_TYPE_ANY
+-spec saveFile(This, Name, Type, [Option]) -> boolean() when
+ This::wxBitmap(), Name::unicode:chardata(), Type::wx:wx_enum(),
+ Option :: {palette, wxPalette:wxPalette()}.
saveFile(#wx_ref{type=ThisT,ref=ThisRef},Name,Type, Options)
when is_list(Name),is_integer(Type),is_list(Options) ->
?CLASS(ThisT,wxBitmap),
@@ -251,48 +278,53 @@ saveFile(#wx_ref{type=ThisT,ref=ThisRef},Name,Type, Options)
wxe_util:call(?wxBitmap_SaveFile,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,Type:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxBitmap(), Depth::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapsetdepth">external documentation</a>.
+-spec setDepth(This, Depth) -> ok when
+ This::wxBitmap(), Depth::integer().
setDepth(#wx_ref{type=ThisT,ref=ThisRef},Depth)
when is_integer(Depth) ->
?CLASS(ThisT,wxBitmap),
wxe_util:cast(?wxBitmap_SetDepth,
<<ThisRef:32/?UI,Depth:32/?UI>>).
-%% @spec (This::wxBitmap(), Height::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapsetheight">external documentation</a>.
+-spec setHeight(This, Height) -> ok when
+ This::wxBitmap(), Height::integer().
setHeight(#wx_ref{type=ThisT,ref=ThisRef},Height)
when is_integer(Height) ->
?CLASS(ThisT,wxBitmap),
wxe_util:cast(?wxBitmap_SetHeight,
<<ThisRef:32/?UI,Height:32/?UI>>).
-%% @spec (This::wxBitmap(), Mask::wxMask:wxMask()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapsetmask">external documentation</a>.
+-spec setMask(This, Mask) -> ok when
+ This::wxBitmap(), Mask::wxMask:wxMask().
setMask(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MaskT,ref=MaskRef}) ->
?CLASS(ThisT,wxBitmap),
?CLASS(MaskT,wxMask),
wxe_util:cast(?wxBitmap_SetMask,
<<ThisRef:32/?UI,MaskRef:32/?UI>>).
-%% @spec (This::wxBitmap(), Palette::wxPalette:wxPalette()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapsetpalette">external documentation</a>.
+-spec setPalette(This, Palette) -> ok when
+ This::wxBitmap(), Palette::wxPalette:wxPalette().
setPalette(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PaletteT,ref=PaletteRef}) ->
?CLASS(ThisT,wxBitmap),
?CLASS(PaletteT,wxPalette),
wxe_util:cast(?wxBitmap_SetPalette,
<<ThisRef:32/?UI,PaletteRef:32/?UI>>).
-%% @spec (This::wxBitmap(), Width::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmap.html#wxbitmapsetwidth">external documentation</a>.
+-spec setWidth(This, Width) -> ok when
+ This::wxBitmap(), Width::integer().
setWidth(#wx_ref{type=ThisT,ref=ThisRef},Width)
when is_integer(Width) ->
?CLASS(ThisT,wxBitmap),
wxe_util:cast(?wxBitmap_SetWidth,
<<ThisRef:32/?UI,Width:32/?UI>>).
-%% @spec (This::wxBitmap()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxBitmap()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxBitmap),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxBitmapButton.erl b/lib/wx/src/gen/wxBitmapButton.erl
index d2353466e7..ddddbbc1dd 100644
--- a/lib/wx/src/gen/wxBitmapButton.erl
+++ b/lib/wx/src/gen/wxBitmapButton.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -72,6 +72,7 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxBitmapButton/0]).
%% @hidden
parent_class(wxButton) -> true;
parent_class(wxControl) -> true;
@@ -79,21 +80,28 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxBitmapButton()
+-type wxBitmapButton() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmapbutton.html#wxbitmapbuttonwxbitmapbutton">external documentation</a>.
+-spec new() -> wxBitmapButton().
new() ->
wxe_util:construct(?wxBitmapButton_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Bitmap::wxBitmap:wxBitmap()) -> wxBitmapButton()
%% @equiv new(Parent,Id,Bitmap, [])
+-spec new(Parent, Id, Bitmap) -> wxBitmapButton() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Bitmap::wxBitmap:wxBitmap().
+
new(Parent,Id,Bitmap)
when is_record(Parent, wx_ref),is_integer(Id),is_record(Bitmap, wx_ref) ->
new(Parent,Id,Bitmap, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Bitmap::wxBitmap:wxBitmap(), [Option]) -> wxBitmapButton()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmapbutton.html#wxbitmapbuttonwxbitmapbutton">external documentation</a>.
+-spec new(Parent, Id, Bitmap, [Option]) -> wxBitmapButton() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Bitmap::wxBitmap:wxBitmap(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,#wx_ref{type=BitmapT,ref=BitmapRef}, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -107,15 +115,21 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,#wx_ref{type=BitmapT,ref=BitmapRef},
wxe_util:construct(?wxBitmapButton_new_4,
<<ParentRef:32/?UI,Id:32/?UI,BitmapRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxBitmapButton(), Parent::wxWindow:wxWindow(), Id::integer(), Bitmap::wxBitmap:wxBitmap()) -> bool()
%% @equiv create(This,Parent,Id,Bitmap, [])
+-spec create(This, Parent, Id, Bitmap) -> boolean() when
+ This::wxBitmapButton(), Parent::wxWindow:wxWindow(), Id::integer(), Bitmap::wxBitmap:wxBitmap().
+
create(This,Parent,Id,Bitmap)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_record(Bitmap, wx_ref) ->
create(This,Parent,Id,Bitmap, []).
-%% @spec (This::wxBitmapButton(), Parent::wxWindow:wxWindow(), Id::integer(), Bitmap::wxBitmap:wxBitmap(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmapbutton.html#wxbitmapbuttoncreate">external documentation</a>.
+-spec create(This, Parent, Id, Bitmap, [Option]) -> boolean() when
+ This::wxBitmapButton(), Parent::wxWindow:wxWindow(), Id::integer(), Bitmap::wxBitmap:wxBitmap(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,#wx_ref{type=BitmapT,ref=BitmapRef}, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ThisT,wxBitmapButton),
@@ -130,68 +144,76 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,#w
wxe_util:call(?wxBitmapButton_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,BitmapRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxBitmapButton()) -> wxBitmap:wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmapbutton.html#wxbitmapbuttongetbitmapdisabled">external documentation</a>.
+-spec getBitmapDisabled(This) -> wxBitmap:wxBitmap() when
+ This::wxBitmapButton().
getBitmapDisabled(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBitmapButton),
wxe_util:call(?wxBitmapButton_GetBitmapDisabled,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBitmapButton()) -> wxBitmap:wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmapbutton.html#wxbitmapbuttongetbitmapfocus">external documentation</a>.
+-spec getBitmapFocus(This) -> wxBitmap:wxBitmap() when
+ This::wxBitmapButton().
getBitmapFocus(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBitmapButton),
wxe_util:call(?wxBitmapButton_GetBitmapFocus,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBitmapButton()) -> wxBitmap:wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmapbutton.html#wxbitmapbuttongetbitmaplabel">external documentation</a>.
+-spec getBitmapLabel(This) -> wxBitmap:wxBitmap() when
+ This::wxBitmapButton().
getBitmapLabel(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBitmapButton),
wxe_util:call(?wxBitmapButton_GetBitmapLabel,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBitmapButton()) -> wxBitmap:wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmapbutton.html#wxbitmapbuttongetbitmapselected">external documentation</a>.
+-spec getBitmapSelected(This) -> wxBitmap:wxBitmap() when
+ This::wxBitmapButton().
getBitmapSelected(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBitmapButton),
wxe_util:call(?wxBitmapButton_GetBitmapSelected,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBitmapButton(), Disabled::wxBitmap:wxBitmap()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmapbutton.html#wxbitmapbuttonsetbitmapdisabled">external documentation</a>.
+-spec setBitmapDisabled(This, Disabled) -> ok when
+ This::wxBitmapButton(), Disabled::wxBitmap:wxBitmap().
setBitmapDisabled(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DisabledT,ref=DisabledRef}) ->
?CLASS(ThisT,wxBitmapButton),
?CLASS(DisabledT,wxBitmap),
wxe_util:cast(?wxBitmapButton_SetBitmapDisabled,
<<ThisRef:32/?UI,DisabledRef:32/?UI>>).
-%% @spec (This::wxBitmapButton(), Focus::wxBitmap:wxBitmap()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmapbutton.html#wxbitmapbuttonsetbitmapfocus">external documentation</a>.
+-spec setBitmapFocus(This, Focus) -> ok when
+ This::wxBitmapButton(), Focus::wxBitmap:wxBitmap().
setBitmapFocus(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FocusT,ref=FocusRef}) ->
?CLASS(ThisT,wxBitmapButton),
?CLASS(FocusT,wxBitmap),
wxe_util:cast(?wxBitmapButton_SetBitmapFocus,
<<ThisRef:32/?UI,FocusRef:32/?UI>>).
-%% @spec (This::wxBitmapButton(), Bitmap::wxBitmap:wxBitmap()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmapbutton.html#wxbitmapbuttonsetbitmaplabel">external documentation</a>.
+-spec setBitmapLabel(This, Bitmap) -> ok when
+ This::wxBitmapButton(), Bitmap::wxBitmap:wxBitmap().
setBitmapLabel(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BitmapT,ref=BitmapRef}) ->
?CLASS(ThisT,wxBitmapButton),
?CLASS(BitmapT,wxBitmap),
wxe_util:cast(?wxBitmapButton_SetBitmapLabel,
<<ThisRef:32/?UI,BitmapRef:32/?UI>>).
-%% @spec (This::wxBitmapButton(), Sel::wxBitmap:wxBitmap()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmapbutton.html#wxbitmapbuttonsetbitmapselected">external documentation</a>.
+-spec setBitmapSelected(This, Sel) -> ok when
+ This::wxBitmapButton(), Sel::wxBitmap:wxBitmap().
setBitmapSelected(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=SelT,ref=SelRef}) ->
?CLASS(ThisT,wxBitmapButton),
?CLASS(SelT,wxBitmap),
wxe_util:cast(?wxBitmapButton_SetBitmapSelected,
<<ThisRef:32/?UI,SelRef:32/?UI>>).
-%% @spec (This::wxBitmapButton()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxBitmapButton()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxBitmapButton),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxBitmapDataObject.erl b/lib/wx/src/gen/wxBitmapDataObject.erl
index b5207072e3..8f9701d3c2 100644
--- a/lib/wx/src/gen/wxBitmapDataObject.erl
+++ b/lib/wx/src/gen/wxBitmapDataObject.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -32,25 +32,27 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxBitmapDataObject/0]).
%% @hidden
parent_class(wxDataObject) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxBitmapDataObject()
+-type wxBitmapDataObject() :: wx:wx_object().
%% @equiv new([])
+-spec new() -> wxBitmapDataObject().
+
new() ->
new([]).
-%% @spec (X::term()) -> wxBitmapDataObject()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmapdataobject.html#wxbitmapdataobjectwxbitmapdataobject">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new([Option]) -> wxBitmapDataObject() </c>
-%%<br /> Option = {bitmap, wxBitmap:wxBitmap()}
-%% </p>
-%% <p><c>
-%% new(Bitmap::wxBitmap:wxBitmap()) -> wxBitmapDataObject() </c>
-%% </p>
+%% <br /> Also:<br />
+%% new(Bitmap) -> wxBitmapDataObject() when<br />
+%% Bitmap::wxBitmap:wxBitmap().<br />
+%%
+-spec new([Option]) -> wxBitmapDataObject() when
+ Option :: {bitmap, wxBitmap:wxBitmap()};
+ (Bitmap) -> wxBitmapDataObject() when
+ Bitmap::wxBitmap:wxBitmap().
new(Options)
when is_list(Options) ->
MOpts = fun({bitmap, #wx_ref{type=BitmapT,ref=BitmapRef}}, Acc) -> ?CLASS(BitmapT,wxBitmap),[<<1:32/?UI,BitmapRef:32/?UI>>|Acc];
@@ -63,23 +65,25 @@ new(#wx_ref{type=BitmapT,ref=BitmapRef}) ->
wxe_util:construct(?wxBitmapDataObject_new_1_1,
<<BitmapRef:32/?UI>>).
-%% @spec (This::wxBitmapDataObject()) -> wxBitmap:wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmapdataobject.html#wxbitmapdataobjectgetbitmap">external documentation</a>.
+-spec getBitmap(This) -> wxBitmap:wxBitmap() when
+ This::wxBitmapDataObject().
getBitmap(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBitmapDataObject),
wxe_util:call(?wxBitmapDataObject_GetBitmap,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBitmapDataObject(), Bitmap::wxBitmap:wxBitmap()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbitmapdataobject.html#wxbitmapdataobjectsetbitmap">external documentation</a>.
+-spec setBitmap(This, Bitmap) -> ok when
+ This::wxBitmapDataObject(), Bitmap::wxBitmap:wxBitmap().
setBitmap(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BitmapT,ref=BitmapRef}) ->
?CLASS(ThisT,wxBitmapDataObject),
?CLASS(BitmapT,wxBitmap),
wxe_util:cast(?wxBitmapDataObject_SetBitmap,
<<ThisRef:32/?UI,BitmapRef:32/?UI>>).
-%% @spec (This::wxBitmapDataObject()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxBitmapDataObject()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxBitmapDataObject),
wxe_util:destroy(?wxBitmapDataObject_destroy,Obj),
diff --git a/lib/wx/src/gen/wxBoxSizer.erl b/lib/wx/src/gen/wxBoxSizer.erl
index e6287945a9..fcf6b5fd65 100644
--- a/lib/wx/src/gen/wxBoxSizer.erl
+++ b/lib/wx/src/gen/wxBoxSizer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -40,26 +40,30 @@
setMinSize/2,setMinSize/3,setSizeHints/2,setVirtualSizeHints/2,show/2,
show/3]).
+-export_type([wxBoxSizer/0]).
%% @hidden
parent_class(wxSizer) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Orient::integer()) -> wxBoxSizer()
+-type wxBoxSizer() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxboxsizer.html#wxboxsizerwxboxsizer">external documentation</a>.
+-spec new(Orient) -> wxBoxSizer() when
+ Orient::integer().
new(Orient)
when is_integer(Orient) ->
wxe_util:construct(?wxBoxSizer_new,
<<Orient:32/?UI>>).
-%% @spec (This::wxBoxSizer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxboxsizer.html#wxboxsizergetorientation">external documentation</a>.
+-spec getOrientation(This) -> integer() when
+ This::wxBoxSizer().
getOrientation(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBoxSizer),
wxe_util:call(?wxBoxSizer_GetOrientation,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBoxSizer()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxBoxSizer()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxBoxSizer),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxBrush.erl b/lib/wx/src/gen/wxBrush.erl
index e42edd62e3..40aa62297e 100644
--- a/lib/wx/src/gen/wxBrush.erl
+++ b/lib/wx/src/gen/wxBrush.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -30,23 +30,26 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxBrush/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxBrush()
+-type wxBrush() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushwxbrush">external documentation</a>.
+-spec new() -> wxBrush().
new() ->
wxe_util:construct(?wxBrush_new_0,
<<>>).
-%% @spec (X::term()) -> wxBrush()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushwxbrush">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Colour::wx:colour()) -> new(Colour, []) </c></p>
-%% <p><c>
-%% new(StippleBitmap::wxBitmap:wxBitmap()) -> wxBrush() </c>
-%% </p>
+%% <br /> Also:<br />
+%% new(StippleBitmap) -> wxBrush() when<br />
+%% StippleBitmap::wxBitmap:wxBitmap().<br />
+%%
+-spec new(Colour) -> wxBrush() when
+ Colour::wx:wx_colour();
+ (StippleBitmap) -> wxBrush() when
+ StippleBitmap::wxBitmap:wxBitmap().
new(Colour)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
@@ -56,9 +59,10 @@ new(#wx_ref{type=StippleBitmapT,ref=StippleBitmapRef}) ->
wxe_util:construct(?wxBrush_new_1,
<<StippleBitmapRef:32/?UI>>).
-%% @spec (Colour::wx:colour(), [Option]) -> wxBrush()
-%% Option = {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushwxbrush">external documentation</a>.
+-spec new(Colour, [Option]) -> wxBrush() when
+ Colour::wx:wx_colour(),
+ Option :: {style, integer()}.
new(Colour, Options)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4,is_list(Options) ->
MOpts = fun({style, Style}, Acc) -> [<<1:32/?UI,Style:32/?UI>>|Acc];
@@ -67,75 +71,84 @@ new(Colour, Options)
wxe_util:construct(?wxBrush_new_2,
<<(wxe_util:colour_bin(Colour)):16/binary, BinOpt/binary>>).
-%% @spec (This::wxBrush()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushgetcolour">external documentation</a>.
+-spec getColour(This) -> wx:wx_colour4() when
+ This::wxBrush().
getColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBrush),
wxe_util:call(?wxBrush_GetColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBrush()) -> wxBitmap:wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushgetstipple">external documentation</a>.
+-spec getStipple(This) -> wxBitmap:wxBitmap() when
+ This::wxBrush().
getStipple(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBrush),
wxe_util:call(?wxBrush_GetStipple,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBrush()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushgetstyle">external documentation</a>.
+-spec getStyle(This) -> integer() when
+ This::wxBrush().
getStyle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBrush),
wxe_util:call(?wxBrush_GetStyle,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBrush()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushishatch">external documentation</a>.
+-spec isHatch(This) -> boolean() when
+ This::wxBrush().
isHatch(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBrush),
wxe_util:call(?wxBrush_IsHatch,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBrush()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushisok">external documentation</a>.
+-spec isOk(This) -> boolean() when
+ This::wxBrush().
isOk(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxBrush),
wxe_util:call(?wxBrush_IsOk,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxBrush(), Col::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushsetcolour">external documentation</a>.
+-spec setColour(This, Col) -> ok when
+ This::wxBrush(), Col::wx:wx_colour().
setColour(#wx_ref{type=ThisT,ref=ThisRef},Col)
when tuple_size(Col) =:= 3; tuple_size(Col) =:= 4 ->
?CLASS(ThisT,wxBrush),
wxe_util:cast(?wxBrush_SetColour_1,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Col)):16/binary>>).
-%% @spec (This::wxBrush(), R::integer(), G::integer(), B::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushsetcolour">external documentation</a>.
+-spec setColour(This, R, G, B) -> ok when
+ This::wxBrush(), R::integer(), G::integer(), B::integer().
setColour(#wx_ref{type=ThisT,ref=ThisRef},R,G,B)
when is_integer(R),is_integer(G),is_integer(B) ->
?CLASS(ThisT,wxBrush),
wxe_util:cast(?wxBrush_SetColour_3,
<<ThisRef:32/?UI,R:32/?UI,G:32/?UI,B:32/?UI>>).
-%% @spec (This::wxBrush(), Stipple::wxBitmap:wxBitmap()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushsetstipple">external documentation</a>.
+-spec setStipple(This, Stipple) -> ok when
+ This::wxBrush(), Stipple::wxBitmap:wxBitmap().
setStipple(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=StippleT,ref=StippleRef}) ->
?CLASS(ThisT,wxBrush),
?CLASS(StippleT,wxBitmap),
wxe_util:cast(?wxBrush_SetStipple,
<<ThisRef:32/?UI,StippleRef:32/?UI>>).
-%% @spec (This::wxBrush(), Style::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushsetstyle">external documentation</a>.
+-spec setStyle(This, Style) -> ok when
+ This::wxBrush(), Style::integer().
setStyle(#wx_ref{type=ThisT,ref=ThisRef},Style)
when is_integer(Style) ->
?CLASS(ThisT,wxBrush),
wxe_util:cast(?wxBrush_SetStyle,
<<ThisRef:32/?UI,Style:32/?UI>>).
-%% @spec (This::wxBrush()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxBrush()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxBrush),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxBufferedDC.erl b/lib/wx/src/gen/wxBufferedDC.erl
index 9096f95612..fd8955f4ed 100644
--- a/lib/wx/src/gen/wxBufferedDC.erl
+++ b/lib/wx/src/gen/wxBufferedDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -39,10 +39,10 @@
drawPoint/2,drawPolygon/2,drawPolygon/3,drawRectangle/2,drawRectangle/3,
drawRotatedText/4,drawRoundedRectangle/3,drawRoundedRectangle/4,
drawText/3,endDoc/1,endPage/1,floodFill/3,floodFill/4,getBackground/1,
- getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/2,
+ getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/1,
getFont/1,getLayoutDirection/1,getLogicalFunction/1,getMapMode/1,
- getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/3,
- getPen/1,getPixel/3,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
+ getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/2,
+ getPen/1,getPixel/2,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
getTextExtent/3,getTextForeground/1,getUserScale/1,gradientFillConcentric/4,
gradientFillConcentric/5,gradientFillLinear/4,gradientFillLinear/5,
isOk/1,logicalToDeviceX/2,logicalToDeviceXRel/2,logicalToDeviceY/2,
@@ -53,32 +53,40 @@
setMapMode/2,setPalette/2,setPen/2,setTextBackground/2,setTextForeground/2,
setUserScale/3,startDoc/2,startPage/1]).
+-export_type([wxBufferedDC/0]).
%% @hidden
parent_class(wxMemoryDC) -> true;
parent_class(wxDC) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxBufferedDC()
+-type wxBufferedDC() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbuffereddc.html#wxbuffereddcwxbuffereddc">external documentation</a>.
+-spec new() -> wxBufferedDC().
new() ->
wxe_util:construct(?wxBufferedDC_new_0,
<<>>).
-%% @spec (Dc::wxDC:wxDC()) -> wxBufferedDC()
%% @equiv new(Dc, [])
+-spec new(Dc) -> wxBufferedDC() when
+ Dc::wxDC:wxDC().
+
new(Dc)
when is_record(Dc, wx_ref) ->
new(Dc, []).
-%% @spec (Dc::wxDC:wxDC(),X::term()) -> wxBufferedDC()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbuffereddc.html#wxbuffereddcwxbuffereddc">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Dc::wxDC:wxDC(), Area::{W::integer(), H::integer()}) -> new(Dc,Area, []) </c></p>
-%% <p><c>
-%% new(Dc::wxDC:wxDC(), [Option]) -> wxBufferedDC() </c>
-%%<br /> Option = {buffer, wxBitmap:wxBitmap()} | {style, integer()}
-%% </p>
+%% <br /> Also:<br />
+%% new(Dc, [Option]) -> wxBufferedDC() when<br />
+%% Dc::wxDC:wxDC(),<br />
+%% Option :: {buffer, wxBitmap:wxBitmap()}<br />
+%% | {style, integer()}.<br />
+%%
+-spec new(Dc, Area) -> wxBufferedDC() when
+ Dc::wxDC:wxDC(), Area::{W::integer(), H::integer()};
+ (Dc, [Option]) -> wxBufferedDC() when
+ Dc::wxDC:wxDC(),
+ Option :: {buffer, wxBitmap:wxBitmap()}
+ | {style, integer()}.
new(Dc,Area={AreaW,AreaH})
when is_record(Dc, wx_ref),is_integer(AreaW),is_integer(AreaH) ->
@@ -93,9 +101,10 @@ new(#wx_ref{type=DcT,ref=DcRef}, Options)
wxe_util:construct(?wxBufferedDC_new_2,
<<DcRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (Dc::wxDC:wxDC(), Area::{W::integer(), H::integer()}, [Option]) -> wxBufferedDC()
-%% Option = {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbuffereddc.html#wxbuffereddcwxbuffereddc">external documentation</a>.
+-spec new(Dc, Area, [Option]) -> wxBufferedDC() when
+ Dc::wxDC:wxDC(), Area::{W::integer(), H::integer()},
+ Option :: {style, integer()}.
new(#wx_ref{type=DcT,ref=DcRef},{AreaW,AreaH}, Options)
when is_integer(AreaW),is_integer(AreaH),is_list(Options) ->
?CLASS(DcT,wxDC),
@@ -105,21 +114,27 @@ new(#wx_ref{type=DcT,ref=DcRef},{AreaW,AreaH}, Options)
wxe_util:construct(?wxBufferedDC_new_3,
<<DcRef:32/?UI,AreaW:32/?UI,AreaH:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxBufferedDC(), Dc::wxDC:wxDC()) -> ok
%% @equiv init(This,Dc, [])
+-spec init(This, Dc) -> ok when
+ This::wxBufferedDC(), Dc::wxDC:wxDC().
+
init(This,Dc)
when is_record(This, wx_ref),is_record(Dc, wx_ref) ->
init(This,Dc, []).
-%% @spec (This::wxBufferedDC(),Dc::wxDC:wxDC(),X::term()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbuffereddc.html#wxbuffereddcinit">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% init(This::wxBufferedDC(), Dc::wxDC:wxDC(), Area::{W::integer(), H::integer()}) -> init(This,Dc,Area, []) </c></p>
-%% <p><c>
-%% init(This::wxBufferedDC(), Dc::wxDC:wxDC(), [Option]) -> ok </c>
-%%<br /> Option = {buffer, wxBitmap:wxBitmap()} | {style, integer()}
-%% </p>
+%% <br /> Also:<br />
+%% init(This, Dc, [Option]) -> ok when<br />
+%% This::wxBufferedDC(), Dc::wxDC:wxDC(),<br />
+%% Option :: {buffer, wxBitmap:wxBitmap()}<br />
+%% | {style, integer()}.<br />
+%%
+-spec init(This, Dc, Area) -> ok when
+ This::wxBufferedDC(), Dc::wxDC:wxDC(), Area::{W::integer(), H::integer()};
+ (This, Dc, [Option]) -> ok when
+ This::wxBufferedDC(), Dc::wxDC:wxDC(),
+ Option :: {buffer, wxBitmap:wxBitmap()}
+ | {style, integer()}.
init(This,Dc,Area={AreaW,AreaH})
when is_record(This, wx_ref),is_record(Dc, wx_ref),is_integer(AreaW),is_integer(AreaH) ->
@@ -135,9 +150,10 @@ init(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DcT,ref=DcRef}, Options)
wxe_util:cast(?wxBufferedDC_Init_2,
<<ThisRef:32/?UI,DcRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxBufferedDC(), Dc::wxDC:wxDC(), Area::{W::integer(), H::integer()}, [Option]) -> ok
-%% Option = {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbuffereddc.html#wxbuffereddcinit">external documentation</a>.
+-spec init(This, Dc, Area, [Option]) -> ok when
+ This::wxBufferedDC(), Dc::wxDC:wxDC(), Area::{W::integer(), H::integer()},
+ Option :: {style, integer()}.
init(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DcT,ref=DcRef},{AreaW,AreaH}, Options)
when is_integer(AreaW),is_integer(AreaH),is_list(Options) ->
?CLASS(ThisT,wxBufferedDC),
@@ -148,8 +164,8 @@ init(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DcT,ref=DcRef},{AreaW,AreaH},
wxe_util:cast(?wxBufferedDC_Init_3,
<<ThisRef:32/?UI,DcRef:32/?UI,AreaW:32/?UI,AreaH:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxBufferedDC()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxBufferedDC()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxBufferedDC),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
@@ -241,11 +257,11 @@ getSize(This) -> wxDC:getSize(This).
%% @hidden
getPPI(This) -> wxDC:getPPI(This).
%% @hidden
-getPixel(This,Pt,Col) -> wxDC:getPixel(This,Pt,Col).
+getPixel(This,Pt) -> wxDC:getPixel(This,Pt).
%% @hidden
getPen(This) -> wxDC:getPen(This).
%% @hidden
-getPartialTextExtents(This,Text,Widths) -> wxDC:getPartialTextExtents(This,Text,Widths).
+getPartialTextExtents(This,Text) -> wxDC:getPartialTextExtents(This,Text).
%% @hidden
getMultiLineTextExtent(This,String, Options) -> wxDC:getMultiLineTextExtent(This,String, Options).
%% @hidden
@@ -259,7 +275,7 @@ getLayoutDirection(This) -> wxDC:getLayoutDirection(This).
%% @hidden
getFont(This) -> wxDC:getFont(This).
%% @hidden
-getClippingBox(This,Rect) -> wxDC:getClippingBox(This,Rect).
+getClippingBox(This) -> wxDC:getClippingBox(This).
%% @hidden
getCharWidth(This) -> wxDC:getCharWidth(This).
%% @hidden
diff --git a/lib/wx/src/gen/wxBufferedPaintDC.erl b/lib/wx/src/gen/wxBufferedPaintDC.erl
index 2712394dd8..bff61ca678 100644
--- a/lib/wx/src/gen/wxBufferedPaintDC.erl
+++ b/lib/wx/src/gen/wxBufferedPaintDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -40,10 +40,10 @@
drawPoint/2,drawPolygon/2,drawPolygon/3,drawRectangle/2,drawRectangle/3,
drawRotatedText/4,drawRoundedRectangle/3,drawRoundedRectangle/4,
drawText/3,endDoc/1,endPage/1,floodFill/3,floodFill/4,getBackground/1,
- getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/2,
+ getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/1,
getFont/1,getLayoutDirection/1,getLogicalFunction/1,getMapMode/1,
- getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/3,
- getPen/1,getPixel/3,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
+ getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/2,
+ getPen/1,getPixel/2,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
getTextExtent/3,getTextForeground/1,getUserScale/1,gradientFillConcentric/4,
gradientFillConcentric/5,gradientFillLinear/4,gradientFillLinear/5,
init/2,init/3,init/4,isOk/1,logicalToDeviceX/2,logicalToDeviceXRel/2,
@@ -55,27 +55,33 @@
setPen/2,setTextBackground/2,setTextForeground/2,setUserScale/3,startDoc/2,
startPage/1]).
+-export_type([wxBufferedPaintDC/0]).
%% @hidden
parent_class(wxBufferedDC) -> true;
parent_class(wxMemoryDC) -> true;
parent_class(wxDC) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Window::wxWindow:wxWindow()) -> wxBufferedPaintDC()
+-type wxBufferedPaintDC() :: wx:wx_object().
%% @equiv new(Window, [])
+-spec new(Window) -> wxBufferedPaintDC() when
+ Window::wxWindow:wxWindow().
+
new(Window)
when is_record(Window, wx_ref) ->
new(Window, []).
-%% @spec (Window::wxWindow:wxWindow(),X::term()) -> wxBufferedPaintDC()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbufferedpaintdc.html#wxbufferedpaintdcwxbufferedpaintdc">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Window::wxWindow:wxWindow(), Buffer::wxBitmap:wxBitmap()) -> new(Window,Buffer, []) </c></p>
-%% <p><c>
-%% new(Window::wxWindow:wxWindow(), [Option]) -> wxBufferedPaintDC() </c>
-%%<br /> Option = {style, integer()}
-%% </p>
+%% <br /> Also:<br />
+%% new(Window, [Option]) -> wxBufferedPaintDC() when<br />
+%% Window::wxWindow:wxWindow(),<br />
+%% Option :: {style, integer()}.<br />
+%%
+-spec new(Window, Buffer) -> wxBufferedPaintDC() when
+ Window::wxWindow:wxWindow(), Buffer::wxBitmap:wxBitmap();
+ (Window, [Option]) -> wxBufferedPaintDC() when
+ Window::wxWindow:wxWindow(),
+ Option :: {style, integer()}.
new(Window,Buffer)
when is_record(Window, wx_ref),is_record(Buffer, wx_ref) ->
@@ -89,9 +95,10 @@ new(#wx_ref{type=WindowT,ref=WindowRef}, Options)
wxe_util:construct(?wxBufferedPaintDC_new_2,
<<WindowRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (Window::wxWindow:wxWindow(), Buffer::wxBitmap:wxBitmap(), [Option]) -> wxBufferedPaintDC()
-%% Option = {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbufferedpaintdc.html#wxbufferedpaintdcwxbufferedpaintdc">external documentation</a>.
+-spec new(Window, Buffer, [Option]) -> wxBufferedPaintDC() when
+ Window::wxWindow:wxWindow(), Buffer::wxBitmap:wxBitmap(),
+ Option :: {style, integer()}.
new(#wx_ref{type=WindowT,ref=WindowRef},#wx_ref{type=BufferT,ref=BufferRef}, Options)
when is_list(Options) ->
?CLASS(WindowT,wxWindow),
@@ -102,8 +109,8 @@ new(#wx_ref{type=WindowT,ref=WindowRef},#wx_ref{type=BufferT,ref=BufferRef}, Opt
wxe_util:construct(?wxBufferedPaintDC_new_3,
<<WindowRef:32/?UI,BufferRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxBufferedPaintDC()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxBufferedPaintDC()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxBufferedPaintDC),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
@@ -202,11 +209,11 @@ getSize(This) -> wxDC:getSize(This).
%% @hidden
getPPI(This) -> wxDC:getPPI(This).
%% @hidden
-getPixel(This,Pt,Col) -> wxDC:getPixel(This,Pt,Col).
+getPixel(This,Pt) -> wxDC:getPixel(This,Pt).
%% @hidden
getPen(This) -> wxDC:getPen(This).
%% @hidden
-getPartialTextExtents(This,Text,Widths) -> wxDC:getPartialTextExtents(This,Text,Widths).
+getPartialTextExtents(This,Text) -> wxDC:getPartialTextExtents(This,Text).
%% @hidden
getMultiLineTextExtent(This,String, Options) -> wxDC:getMultiLineTextExtent(This,String, Options).
%% @hidden
@@ -220,7 +227,7 @@ getLayoutDirection(This) -> wxDC:getLayoutDirection(This).
%% @hidden
getFont(This) -> wxDC:getFont(This).
%% @hidden
-getClippingBox(This,Rect) -> wxDC:getClippingBox(This,Rect).
+getClippingBox(This) -> wxDC:getClippingBox(This).
%% @hidden
getCharWidth(This) -> wxDC:getCharWidth(This).
%% @hidden
diff --git a/lib/wx/src/gen/wxButton.erl b/lib/wx/src/gen/wxButton.erl
index a75c45c5a3..a27e5d91c2 100644
--- a/lib/wx/src/gen/wxButton.erl
+++ b/lib/wx/src/gen/wxButton.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -70,27 +70,36 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxButton/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxButton()
+-type wxButton() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbutton.html#wxbuttonwxbutton">external documentation</a>.
+-spec new() -> wxButton().
new() ->
wxe_util:construct(?wxButton_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxButton()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxButton() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxButton()
-%% Option = {label, string()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbutton.html#wxbuttonwxbutton">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxButton() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {label, unicode:chardata()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -104,15 +113,22 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxButton_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxButton(), Parent::wxWindow:wxWindow(), Id::integer()) -> bool()
%% @equiv create(This,Parent,Id, [])
+-spec create(This, Parent, Id) -> boolean() when
+ This::wxButton(), Parent::wxWindow:wxWindow(), Id::integer().
+
create(This,Parent,Id)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id) ->
create(This,Parent,Id, []).
-%% @spec (This::wxButton(), Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> bool()
-%% Option = {label, string()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbutton.html#wxbuttoncreate">external documentation</a>.
+-spec create(This, Parent, Id, [Option]) -> boolean() when
+ This::wxButton(), Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {label, unicode:chardata()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ThisT,wxButton),
@@ -127,21 +143,23 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, O
wxe_util:call(?wxButton_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec () -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbutton.html#wxbuttongetdefaultsize">external documentation</a>.
+-spec getDefaultSize() -> {W::integer(), H::integer()}.
getDefaultSize() ->
wxe_util:call(?wxButton_GetDefaultSize,
<<>>).
-%% @spec (This::wxButton()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbutton.html#wxbuttonsetdefault">external documentation</a>.
+-spec setDefault(This) -> ok when
+ This::wxButton().
setDefault(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxButton),
wxe_util:cast(?wxButton_SetDefault,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxButton(), Label::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbutton.html#wxbuttonsetlabel">external documentation</a>.
+-spec setLabel(This, Label) -> ok when
+ This::wxButton(), Label::unicode:chardata().
setLabel(#wx_ref{type=ThisT,ref=ThisRef},Label)
when is_list(Label) ->
?CLASS(ThisT,wxButton),
@@ -149,8 +167,8 @@ setLabel(#wx_ref{type=ThisT,ref=ThisRef},Label)
wxe_util:cast(?wxButton_SetLabel,
<<ThisRef:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((0+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxButton()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxButton()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxButton),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxCalendarCtrl.erl b/lib/wx/src/gen/wxCalendarCtrl.erl
index 1bb4ecb1fa..01d171800b 100644
--- a/lib/wx/src/gen/wxCalendarCtrl.erl
+++ b/lib/wx/src/gen/wxCalendarCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -74,27 +74,35 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxCalendarCtrl/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxCalendarCtrl()
+-type wxCalendarCtrl() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlwxcalendarctrl">external documentation</a>.
+-spec new() -> wxCalendarCtrl().
new() ->
wxe_util:construct(?wxCalendarCtrl_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxCalendarCtrl()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxCalendarCtrl() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxCalendarCtrl()
-%% Option = {date, wx:datetime()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlwxcalendarctrl">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxCalendarCtrl() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {date, wx:wx_datetime()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -107,15 +115,21 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxCalendarCtrl_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxCalendarCtrl(), Parent::wxWindow:wxWindow(), Id::integer()) -> bool()
%% @equiv create(This,Parent,Id, [])
+-spec create(This, Parent, Id) -> boolean() when
+ This::wxCalendarCtrl(), Parent::wxWindow:wxWindow(), Id::integer().
+
create(This,Parent,Id)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id) ->
create(This,Parent,Id, []).
-%% @spec (This::wxCalendarCtrl(), Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> bool()
-%% Option = {date, wx:datetime()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlcreate">external documentation</a>.
+-spec create(This, Parent, Id, [Option]) -> boolean() when
+ This::wxCalendarCtrl(), Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {date, wx:wx_datetime()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ThisT,wxCalendarCtrl),
@@ -129,30 +143,35 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, O
wxe_util:call(?wxCalendarCtrl_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxCalendarCtrl(), Date::wx:datetime()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlsetdate">external documentation</a>.
+-spec setDate(This, Date) -> boolean() when
+ This::wxCalendarCtrl(), Date::wx:wx_datetime().
setDate(#wx_ref{type=ThisT,ref=ThisRef},Date)
when tuple_size(Date) =:= 2 ->
?CLASS(ThisT,wxCalendarCtrl),
wxe_util:call(?wxCalendarCtrl_SetDate,
<<ThisRef:32/?UI,(wxe_util:datetime_bin(Date)):24/binary>>).
-%% @spec (This::wxCalendarCtrl()) -> wx:datetime()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlgetdate">external documentation</a>.
+-spec getDate(This) -> wx:wx_datetime() when
+ This::wxCalendarCtrl().
getDate(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarCtrl),
wxe_util:call(?wxCalendarCtrl_GetDate,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarCtrl()) -> ok
%% @equiv enableYearChange(This, [])
+-spec enableYearChange(This) -> ok when
+ This::wxCalendarCtrl().
+
enableYearChange(This)
when is_record(This, wx_ref) ->
enableYearChange(This, []).
-%% @spec (This::wxCalendarCtrl(), [Option]) -> ok
-%% Option = {enable, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlenableyearchange">external documentation</a>.
+-spec enableYearChange(This, [Option]) -> ok when
+ This::wxCalendarCtrl(),
+ Option :: {enable, boolean()}.
enableYearChange(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxCalendarCtrl),
@@ -162,15 +181,18 @@ enableYearChange(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxCalendarCtrl_EnableYearChange,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxCalendarCtrl()) -> ok
%% @equiv enableMonthChange(This, [])
+-spec enableMonthChange(This) -> ok when
+ This::wxCalendarCtrl().
+
enableMonthChange(This)
when is_record(This, wx_ref) ->
enableMonthChange(This, []).
-%% @spec (This::wxCalendarCtrl(), [Option]) -> ok
-%% Option = {enable, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlenablemonthchange">external documentation</a>.
+-spec enableMonthChange(This, [Option]) -> ok when
+ This::wxCalendarCtrl(),
+ Option :: {enable, boolean()}.
enableMonthChange(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxCalendarCtrl),
@@ -180,15 +202,18 @@ enableMonthChange(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxCalendarCtrl_EnableMonthChange,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxCalendarCtrl()) -> ok
%% @equiv enableHolidayDisplay(This, [])
+-spec enableHolidayDisplay(This) -> ok when
+ This::wxCalendarCtrl().
+
enableHolidayDisplay(This)
when is_record(This, wx_ref) ->
enableHolidayDisplay(This, []).
-%% @spec (This::wxCalendarCtrl(), [Option]) -> ok
-%% Option = {display, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlenableholidaydisplay">external documentation</a>.
+-spec enableHolidayDisplay(This, [Option]) -> ok when
+ This::wxCalendarCtrl(),
+ Option :: {display, boolean()}.
enableHolidayDisplay(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxCalendarCtrl),
@@ -198,82 +223,93 @@ enableHolidayDisplay(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxCalendarCtrl_EnableHolidayDisplay,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxCalendarCtrl(), ColFg::wx:colour(), ColBg::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlsetheadercolours">external documentation</a>.
+-spec setHeaderColours(This, ColFg, ColBg) -> ok when
+ This::wxCalendarCtrl(), ColFg::wx:wx_colour(), ColBg::wx:wx_colour().
setHeaderColours(#wx_ref{type=ThisT,ref=ThisRef},ColFg,ColBg)
when tuple_size(ColFg) =:= 3; tuple_size(ColFg) =:= 4,tuple_size(ColBg) =:= 3; tuple_size(ColBg) =:= 4 ->
?CLASS(ThisT,wxCalendarCtrl),
wxe_util:cast(?wxCalendarCtrl_SetHeaderColours,
<<ThisRef:32/?UI,(wxe_util:colour_bin(ColFg)):16/binary,(wxe_util:colour_bin(ColBg)):16/binary>>).
-%% @spec (This::wxCalendarCtrl()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlgetheadercolourfg">external documentation</a>.
+-spec getHeaderColourFg(This) -> wx:wx_colour4() when
+ This::wxCalendarCtrl().
getHeaderColourFg(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarCtrl),
wxe_util:call(?wxCalendarCtrl_GetHeaderColourFg,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarCtrl()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlgetheadercolourbg">external documentation</a>.
+-spec getHeaderColourBg(This) -> wx:wx_colour4() when
+ This::wxCalendarCtrl().
getHeaderColourBg(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarCtrl),
wxe_util:call(?wxCalendarCtrl_GetHeaderColourBg,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarCtrl(), ColFg::wx:colour(), ColBg::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlsethighlightcolours">external documentation</a>.
+-spec setHighlightColours(This, ColFg, ColBg) -> ok when
+ This::wxCalendarCtrl(), ColFg::wx:wx_colour(), ColBg::wx:wx_colour().
setHighlightColours(#wx_ref{type=ThisT,ref=ThisRef},ColFg,ColBg)
when tuple_size(ColFg) =:= 3; tuple_size(ColFg) =:= 4,tuple_size(ColBg) =:= 3; tuple_size(ColBg) =:= 4 ->
?CLASS(ThisT,wxCalendarCtrl),
wxe_util:cast(?wxCalendarCtrl_SetHighlightColours,
<<ThisRef:32/?UI,(wxe_util:colour_bin(ColFg)):16/binary,(wxe_util:colour_bin(ColBg)):16/binary>>).
-%% @spec (This::wxCalendarCtrl()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlgethighlightcolourfg">external documentation</a>.
+-spec getHighlightColourFg(This) -> wx:wx_colour4() when
+ This::wxCalendarCtrl().
getHighlightColourFg(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarCtrl),
wxe_util:call(?wxCalendarCtrl_GetHighlightColourFg,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarCtrl()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlgethighlightcolourbg">external documentation</a>.
+-spec getHighlightColourBg(This) -> wx:wx_colour4() when
+ This::wxCalendarCtrl().
getHighlightColourBg(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarCtrl),
wxe_util:call(?wxCalendarCtrl_GetHighlightColourBg,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarCtrl(), ColFg::wx:colour(), ColBg::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlsetholidaycolours">external documentation</a>.
+-spec setHolidayColours(This, ColFg, ColBg) -> ok when
+ This::wxCalendarCtrl(), ColFg::wx:wx_colour(), ColBg::wx:wx_colour().
setHolidayColours(#wx_ref{type=ThisT,ref=ThisRef},ColFg,ColBg)
when tuple_size(ColFg) =:= 3; tuple_size(ColFg) =:= 4,tuple_size(ColBg) =:= 3; tuple_size(ColBg) =:= 4 ->
?CLASS(ThisT,wxCalendarCtrl),
wxe_util:cast(?wxCalendarCtrl_SetHolidayColours,
<<ThisRef:32/?UI,(wxe_util:colour_bin(ColFg)):16/binary,(wxe_util:colour_bin(ColBg)):16/binary>>).
-%% @spec (This::wxCalendarCtrl()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlgetholidaycolourfg">external documentation</a>.
+-spec getHolidayColourFg(This) -> wx:wx_colour4() when
+ This::wxCalendarCtrl().
getHolidayColourFg(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarCtrl),
wxe_util:call(?wxCalendarCtrl_GetHolidayColourFg,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarCtrl()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlgetholidaycolourbg">external documentation</a>.
+-spec getHolidayColourBg(This) -> wx:wx_colour4() when
+ This::wxCalendarCtrl().
getHolidayColourBg(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarCtrl),
wxe_util:call(?wxCalendarCtrl_GetHolidayColourBg,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarCtrl(), Day::integer()) -> wxCalendarDateAttr:wxCalendarDateAttr()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlgetattr">external documentation</a>.
+-spec getAttr(This, Day) -> wxCalendarDateAttr:wxCalendarDateAttr() when
+ This::wxCalendarCtrl(), Day::integer().
getAttr(#wx_ref{type=ThisT,ref=ThisRef},Day)
when is_integer(Day) ->
?CLASS(ThisT,wxCalendarCtrl),
wxe_util:call(?wxCalendarCtrl_GetAttr,
<<ThisRef:32/?UI,Day:32/?UI>>).
-%% @spec (This::wxCalendarCtrl(), Day::integer(), Attr::wxCalendarDateAttr:wxCalendarDateAttr()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlsetattr">external documentation</a>.
+-spec setAttr(This, Day, Attr) -> ok when
+ This::wxCalendarCtrl(), Day::integer(), Attr::wxCalendarDateAttr:wxCalendarDateAttr().
setAttr(#wx_ref{type=ThisT,ref=ThisRef},Day,#wx_ref{type=AttrT,ref=AttrRef})
when is_integer(Day) ->
?CLASS(ThisT,wxCalendarCtrl),
@@ -281,36 +317,38 @@ setAttr(#wx_ref{type=ThisT,ref=ThisRef},Day,#wx_ref{type=AttrT,ref=AttrRef})
wxe_util:cast(?wxCalendarCtrl_SetAttr,
<<ThisRef:32/?UI,Day:32/?UI,AttrRef:32/?UI>>).
-%% @spec (This::wxCalendarCtrl(), Day::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlsetholiday">external documentation</a>.
+-spec setHoliday(This, Day) -> ok when
+ This::wxCalendarCtrl(), Day::integer().
setHoliday(#wx_ref{type=ThisT,ref=ThisRef},Day)
when is_integer(Day) ->
?CLASS(ThisT,wxCalendarCtrl),
wxe_util:cast(?wxCalendarCtrl_SetHoliday,
<<ThisRef:32/?UI,Day:32/?UI>>).
-%% @spec (This::wxCalendarCtrl(), Day::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlresetattr">external documentation</a>.
+-spec resetAttr(This, Day) -> ok when
+ This::wxCalendarCtrl(), Day::integer().
resetAttr(#wx_ref{type=ThisT,ref=ThisRef},Day)
when is_integer(Day) ->
?CLASS(ThisT,wxCalendarCtrl),
wxe_util:cast(?wxCalendarCtrl_ResetAttr,
<<ThisRef:32/?UI,Day:32/?UI>>).
-%% @spec (This::wxCalendarCtrl(), Pos::{X::integer(), Y::integer()}) -> {WxCalendarHitTestResult, Date::wx:datetime(), Wd::WeekDay}
-%% WxCalendarHitTestResult = integer()
-%% WeekDay = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarctrl.html#wxcalendarctrlhittest">external documentation</a>.
-%%<br /> WxCalendarHitTestResult is one of ?wxCAL_HITTEST_NOWHERE | ?wxCAL_HITTEST_HEADER | ?wxCAL_HITTEST_DAY | ?wxCAL_HITTEST_INCMONTH | ?wxCAL_HITTEST_DECMONTH | ?wxCAL_HITTEST_SURROUNDING_WEEK
-%%<br /> WeekDay is one of ?wxDateTime_Sun | ?wxDateTime_Mon | ?wxDateTime_Tue | ?wxDateTime_Wed | ?wxDateTime_Thu | ?wxDateTime_Fri | ?wxDateTime_Sat | ?wxDateTime_Inv_WeekDay
+%%<br /> Wd = ?wxDateTime_Sun | ?wxDateTime_Mon | ?wxDateTime_Tue | ?wxDateTime_Wed | ?wxDateTime_Thu | ?wxDateTime_Fri | ?wxDateTime_Sat | ?wxDateTime_Inv_WeekDay
+%%<br /> Res = ?wxCAL_HITTEST_NOWHERE | ?wxCAL_HITTEST_HEADER | ?wxCAL_HITTEST_DAY | ?wxCAL_HITTEST_INCMONTH | ?wxCAL_HITTEST_DECMONTH | ?wxCAL_HITTEST_SURROUNDING_WEEK
+-spec hitTest(This, Pos) -> Result when
+ Result ::{Res ::wx:wx_enum(), Date::wx:wx_datetime(), Wd::wx:wx_enum()},
+ This::wxCalendarCtrl(), Pos::{X::integer(), Y::integer()}.
hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PosX,PosY})
when is_integer(PosX),is_integer(PosY) ->
?CLASS(ThisT,wxCalendarCtrl),
wxe_util:call(?wxCalendarCtrl_HitTest,
<<ThisRef:32/?UI,PosX:32/?UI,PosY:32/?UI>>).
-%% @spec (This::wxCalendarCtrl()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxCalendarCtrl()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxCalendarCtrl),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxCalendarDateAttr.erl b/lib/wx/src/gen/wxCalendarDateAttr.erl
index aea8abbe54..a1891df18b 100644
--- a/lib/wx/src/gen/wxCalendarDateAttr.erl
+++ b/lib/wx/src/gen/wxCalendarDateAttr.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -32,22 +32,27 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxCalendarDateAttr/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxCalendarDateAttr()
+-type wxCalendarDateAttr() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrwxcalendardateattr">external documentation</a>.
+-spec new() -> wxCalendarDateAttr().
new() ->
wxe_util:construct(?wxCalendarDateAttr_new_0,
<<>>).
-%% @spec (X::WxCalendarDateBorder|term()) -> wxCalendarDateAttr()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrwxcalendardateattr">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Border::WxCalendarDateBorder) -> new(Border, []) </c></p>
-%% <p><c>
-%% new(ColText::wx:colour()) -> new(ColText, []) </c></p>
+%% <br /> Also:<br />
+%% new(ColText) -> wxCalendarDateAttr() when<br />
+%% ColText::wx:wx_colour().<br />
+%%
+%%<br /> Border = ?wxCAL_BORDER_NONE | ?wxCAL_BORDER_SQUARE | ?wxCAL_BORDER_ROUND
+-spec new(Border) -> wxCalendarDateAttr() when
+ Border::wx:wx_enum();
+ (ColText) -> wxCalendarDateAttr() when
+ ColText::wx:wx_colour().
new(Border)
when is_integer(Border) ->
@@ -57,21 +62,25 @@ new(ColText)
when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4 ->
new(ColText, []).
-%% @spec (X::WxCalendarDateBorder|term(),[Option]) -> wxCalendarDateAttr()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrwxcalendardateattr">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Border::WxCalendarDateBorder, [Option]) -> wxCalendarDateAttr() </c>
-%%<br /> Option = {colBorder, wx:colour()}
-%%<br /> WxCalendarDateBorder = integer()
-%%<br /> WxCalendarDateBorder is one of ?wxCAL_BORDER_NONE | ?wxCAL_BORDER_SQUARE | ?wxCAL_BORDER_ROUND
-%% </p>
-%% <p><c>
-%% new(ColText::wx:colour(), [Option]) -> wxCalendarDateAttr() </c>
-%%<br /> Option = {colBack, wx:colour()} | {colBorder, wx:colour()} | {font, wxFont:wxFont()} | {border, WxCalendarDateBorder}
-%%<br /> WxCalendarDateBorder = integer()
-%%<br /> WxCalendarDateBorder is one of ?wxCAL_BORDER_NONE | ?wxCAL_BORDER_SQUARE | ?wxCAL_BORDER_ROUND
-%% </p>
+%% <br /> Also:<br />
+%% new(ColText, [Option]) -> wxCalendarDateAttr() when<br />
+%% ColText::wx:wx_colour(),<br />
+%% Option :: {colBack, wx:wx_colour()}<br />
+%% | {colBorder, wx:wx_colour()}<br />
+%% | {font, wxFont:wxFont()}<br />
+%% | {border, wx:wx_enum()}.<br />
+%%
+%%<br /> Border = ?wxCAL_BORDER_NONE | ?wxCAL_BORDER_SQUARE | ?wxCAL_BORDER_ROUND
+-spec new(Border, [Option]) -> wxCalendarDateAttr() when
+ Border::wx:wx_enum(),
+ Option :: {colBorder, wx:wx_colour()};
+ (ColText, [Option]) -> wxCalendarDateAttr() when
+ ColText::wx:wx_colour(),
+ Option :: {colBack, wx:wx_colour()}
+ | {colBorder, wx:wx_colour()}
+ | {font, wxFont:wxFont()}
+ | {border, wx:wx_enum()}.
new(Border, Options)
when is_integer(Border),is_list(Options) ->
MOpts = fun({colBorder, ColBorder}, Acc) -> [<<1:32/?UI,(wxe_util:colour_bin(ColBorder)):16/binary,0:32>>|Acc];
@@ -90,137 +99,152 @@ new(ColText, Options)
wxe_util:construct(?wxCalendarDateAttr_new_2_1,
<<(wxe_util:colour_bin(ColText)):16/binary, BinOpt/binary>>).
-%% @spec (This::wxCalendarDateAttr(), ColText::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrsettextcolour">external documentation</a>.
+-spec setTextColour(This, ColText) -> ok when
+ This::wxCalendarDateAttr(), ColText::wx:wx_colour().
setTextColour(#wx_ref{type=ThisT,ref=ThisRef},ColText)
when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4 ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:cast(?wxCalendarDateAttr_SetTextColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(ColText)):16/binary>>).
-%% @spec (This::wxCalendarDateAttr(), ColBack::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrsetbackgroundcolour">external documentation</a>.
+-spec setBackgroundColour(This, ColBack) -> ok when
+ This::wxCalendarDateAttr(), ColBack::wx:wx_colour().
setBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},ColBack)
when tuple_size(ColBack) =:= 3; tuple_size(ColBack) =:= 4 ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:cast(?wxCalendarDateAttr_SetBackgroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(ColBack)):16/binary>>).
-%% @spec (This::wxCalendarDateAttr(), Col::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrsetbordercolour">external documentation</a>.
+-spec setBorderColour(This, Col) -> ok when
+ This::wxCalendarDateAttr(), Col::wx:wx_colour().
setBorderColour(#wx_ref{type=ThisT,ref=ThisRef},Col)
when tuple_size(Col) =:= 3; tuple_size(Col) =:= 4 ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:cast(?wxCalendarDateAttr_SetBorderColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Col)):16/binary>>).
-%% @spec (This::wxCalendarDateAttr(), Font::wxFont:wxFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrsetfont">external documentation</a>.
+-spec setFont(This, Font) -> ok when
+ This::wxCalendarDateAttr(), Font::wxFont:wxFont().
setFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}) ->
?CLASS(ThisT,wxCalendarDateAttr),
?CLASS(FontT,wxFont),
wxe_util:cast(?wxCalendarDateAttr_SetFont,
<<ThisRef:32/?UI,FontRef:32/?UI>>).
-%% @spec (This::wxCalendarDateAttr(), Border::WxCalendarDateBorder) -> ok
-%% WxCalendarDateBorder = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrsetborder">external documentation</a>.
-%%<br /> WxCalendarDateBorder is one of ?wxCAL_BORDER_NONE | ?wxCAL_BORDER_SQUARE | ?wxCAL_BORDER_ROUND
+%%<br /> Border = ?wxCAL_BORDER_NONE | ?wxCAL_BORDER_SQUARE | ?wxCAL_BORDER_ROUND
+-spec setBorder(This, Border) -> ok when
+ This::wxCalendarDateAttr(), Border::wx:wx_enum().
setBorder(#wx_ref{type=ThisT,ref=ThisRef},Border)
when is_integer(Border) ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:cast(?wxCalendarDateAttr_SetBorder,
<<ThisRef:32/?UI,Border:32/?UI>>).
-%% @spec (This::wxCalendarDateAttr(), Holiday::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrsetholiday">external documentation</a>.
+-spec setHoliday(This, Holiday) -> ok when
+ This::wxCalendarDateAttr(), Holiday::boolean().
setHoliday(#wx_ref{type=ThisT,ref=ThisRef},Holiday)
when is_boolean(Holiday) ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:cast(?wxCalendarDateAttr_SetHoliday,
<<ThisRef:32/?UI,(wxe_util:from_bool(Holiday)):32/?UI>>).
-%% @spec (This::wxCalendarDateAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrhastextcolour">external documentation</a>.
+-spec hasTextColour(This) -> boolean() when
+ This::wxCalendarDateAttr().
hasTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:call(?wxCalendarDateAttr_HasTextColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarDateAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrhasbackgroundcolour">external documentation</a>.
+-spec hasBackgroundColour(This) -> boolean() when
+ This::wxCalendarDateAttr().
hasBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:call(?wxCalendarDateAttr_HasBackgroundColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarDateAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrhasbordercolour">external documentation</a>.
+-spec hasBorderColour(This) -> boolean() when
+ This::wxCalendarDateAttr().
hasBorderColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:call(?wxCalendarDateAttr_HasBorderColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarDateAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrhasfont">external documentation</a>.
+-spec hasFont(This) -> boolean() when
+ This::wxCalendarDateAttr().
hasFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:call(?wxCalendarDateAttr_HasFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarDateAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrhasborder">external documentation</a>.
+-spec hasBorder(This) -> boolean() when
+ This::wxCalendarDateAttr().
hasBorder(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:call(?wxCalendarDateAttr_HasBorder,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarDateAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrisholiday">external documentation</a>.
+-spec isHoliday(This) -> boolean() when
+ This::wxCalendarDateAttr().
isHoliday(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:call(?wxCalendarDateAttr_IsHoliday,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarDateAttr()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrgettextcolour">external documentation</a>.
+-spec getTextColour(This) -> wx:wx_colour4() when
+ This::wxCalendarDateAttr().
getTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:call(?wxCalendarDateAttr_GetTextColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarDateAttr()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrgetbackgroundcolour">external documentation</a>.
+-spec getBackgroundColour(This) -> wx:wx_colour4() when
+ This::wxCalendarDateAttr().
getBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:call(?wxCalendarDateAttr_GetBackgroundColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarDateAttr()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrgetbordercolour">external documentation</a>.
+-spec getBorderColour(This) -> wx:wx_colour4() when
+ This::wxCalendarDateAttr().
getBorderColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:call(?wxCalendarDateAttr_GetBorderColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarDateAttr()) -> wxFont:wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrgetfont">external documentation</a>.
+-spec getFont(This) -> wxFont:wxFont() when
+ This::wxCalendarDateAttr().
getFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:call(?wxCalendarDateAttr_GetFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarDateAttr()) -> WxCalendarDateBorder
-%% WxCalendarDateBorder = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendardateattr.html#wxcalendardateattrgetborder">external documentation</a>.
-%%<br /> WxCalendarDateBorder is one of ?wxCAL_BORDER_NONE | ?wxCAL_BORDER_SQUARE | ?wxCAL_BORDER_ROUND
+%%<br /> Res = ?wxCAL_BORDER_NONE | ?wxCAL_BORDER_SQUARE | ?wxCAL_BORDER_ROUND
+-spec getBorder(This) -> wx:wx_enum() when
+ This::wxCalendarDateAttr().
getBorder(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarDateAttr),
wxe_util:call(?wxCalendarDateAttr_GetBorder,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCalendarDateAttr()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxCalendarDateAttr()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxCalendarDateAttr),
wxe_util:destroy(?wxCalendarDateAttr_destroy,Obj),
diff --git a/lib/wx/src/gen/wxCalendarEvent.erl b/lib/wx/src/gen/wxCalendarEvent.erl
index 40723711af..c062a7fa0d 100644
--- a/lib/wx/src/gen/wxCalendarEvent.erl
+++ b/lib/wx/src/gen/wxCalendarEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -41,16 +41,18 @@
isSelection/1,parent_class/1,resumePropagation/2,setInt/2,setString/2,
shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxCalendarEvent/0]).
%% @hidden
parent_class(wxDateEvent) -> true;
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxCalendarEvent()) -> WeekDay
-%% WeekDay = integer()
+-type wxCalendarEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcalendarevent.html#wxcalendareventgetweekday">external documentation</a>.
-%%<br /> WeekDay is one of ?wxDateTime_Sun | ?wxDateTime_Mon | ?wxDateTime_Tue | ?wxDateTime_Wed | ?wxDateTime_Thu | ?wxDateTime_Fri | ?wxDateTime_Sat | ?wxDateTime_Inv_WeekDay
+%%<br /> Res = ?wxDateTime_Sun | ?wxDateTime_Mon | ?wxDateTime_Tue | ?wxDateTime_Wed | ?wxDateTime_Thu | ?wxDateTime_Fri | ?wxDateTime_Sat | ?wxDateTime_Inv_WeekDay
+-spec getWeekDay(This) -> wx:wx_enum() when
+ This::wxCalendarEvent().
getWeekDay(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCalendarEvent),
wxe_util:call(?wxCalendarEvent_GetWeekDay,
diff --git a/lib/wx/src/gen/wxCaret.erl b/lib/wx/src/gen/wxCaret.erl
index cbd868f388..57db5906f3 100644
--- a/lib/wx/src/gen/wxCaret.erl
+++ b/lib/wx/src/gen/wxCaret.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -31,27 +31,32 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxCaret/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Window::wxWindow:wxWindow(), Size::{W::integer(), H::integer()}) -> wxCaret()
+-type wxCaret() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretwxcaret">external documentation</a>.
+-spec new(Window, Size) -> wxCaret() when
+ Window::wxWindow:wxWindow(), Size::{W::integer(), H::integer()}.
new(#wx_ref{type=WindowT,ref=WindowRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(WindowT,wxWindow),
wxe_util:construct(?wxCaret_new_2,
<<WindowRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (Window::wxWindow:wxWindow(), Width::integer(), Height::integer()) -> wxCaret()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretwxcaret">external documentation</a>.
+-spec new(Window, Width, Height) -> wxCaret() when
+ Window::wxWindow:wxWindow(), Width::integer(), Height::integer().
new(#wx_ref{type=WindowT,ref=WindowRef},Width,Height)
when is_integer(Width),is_integer(Height) ->
?CLASS(WindowT,wxWindow),
wxe_util:construct(?wxCaret_new_3,
<<WindowRef:32/?UI,Width:32/?UI,Height:32/?UI>>).
-%% @spec (This::wxCaret(), Window::wxWindow:wxWindow(), Size::{W::integer(), H::integer()}) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretcreate">external documentation</a>.
+-spec create(This, Window, Size) -> boolean() when
+ This::wxCaret(), Window::wxWindow:wxWindow(), Size::{W::integer(), H::integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxCaret),
@@ -59,8 +64,9 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef},{Size
wxe_util:call(?wxCaret_Create_2,
<<ThisRef:32/?UI,WindowRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxCaret(), Window::wxWindow:wxWindow(), Width::integer(), Height::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretcreate">external documentation</a>.
+-spec create(This, Window, Width, Height) -> boolean() when
+ This::wxCaret(), Window::wxWindow:wxWindow(), Width::integer(), Height::integer().
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef},Width,Height)
when is_integer(Width),is_integer(Height) ->
?CLASS(ThisT,wxCaret),
@@ -68,102 +74,116 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef},Width
wxe_util:call(?wxCaret_Create_3,
<<ThisRef:32/?UI,WindowRef:32/?UI,Width:32/?UI,Height:32/?UI>>).
-%% @spec () -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretgetblinktime">external documentation</a>.
+-spec getBlinkTime() -> integer().
getBlinkTime() ->
wxe_util:call(?wxCaret_GetBlinkTime,
<<>>).
-%% @spec (This::wxCaret()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretgetposition">external documentation</a>.
+-spec getPosition(This) -> {X::integer(), Y::integer()} when
+ This::wxCaret().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCaret),
wxe_util:call(?wxCaret_GetPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCaret()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretgetsize">external documentation</a>.
+-spec getSize(This) -> {W::integer(), H::integer()} when
+ This::wxCaret().
getSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCaret),
wxe_util:call(?wxCaret_GetSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCaret()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretgetwindow">external documentation</a>.
+-spec getWindow(This) -> wxWindow:wxWindow() when
+ This::wxCaret().
getWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCaret),
wxe_util:call(?wxCaret_GetWindow,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCaret()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcarethide">external documentation</a>.
+-spec hide(This) -> ok when
+ This::wxCaret().
hide(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCaret),
wxe_util:cast(?wxCaret_Hide,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCaret()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretisok">external documentation</a>.
+-spec isOk(This) -> boolean() when
+ This::wxCaret().
isOk(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCaret),
wxe_util:call(?wxCaret_IsOk,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCaret()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretisvisible">external documentation</a>.
+-spec isVisible(This) -> boolean() when
+ This::wxCaret().
isVisible(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCaret),
wxe_util:call(?wxCaret_IsVisible,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCaret(), Pt::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretmove">external documentation</a>.
+-spec move(This, Pt) -> ok when
+ This::wxCaret(), Pt::{X::integer(), Y::integer()}.
move(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxCaret),
wxe_util:cast(?wxCaret_Move_1,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxCaret(), X::integer(), Y::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretmove">external documentation</a>.
+-spec move(This, X, Y) -> ok when
+ This::wxCaret(), X::integer(), Y::integer().
move(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxCaret),
wxe_util:cast(?wxCaret_Move_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (Milliseconds::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretsetblinktime">external documentation</a>.
+-spec setBlinkTime(Milliseconds) -> ok when
+ Milliseconds::integer().
setBlinkTime(Milliseconds)
when is_integer(Milliseconds) ->
wxe_util:cast(?wxCaret_SetBlinkTime,
<<Milliseconds:32/?UI>>).
-%% @spec (This::wxCaret(), Size::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretsetsize">external documentation</a>.
+-spec setSize(This, Size) -> ok when
+ This::wxCaret(), Size::{W::integer(), H::integer()}.
setSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxCaret),
wxe_util:cast(?wxCaret_SetSize_1,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxCaret(), Width::integer(), Height::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretsetsize">external documentation</a>.
+-spec setSize(This, Width, Height) -> ok when
+ This::wxCaret(), Width::integer(), Height::integer().
setSize(#wx_ref{type=ThisT,ref=ThisRef},Width,Height)
when is_integer(Width),is_integer(Height) ->
?CLASS(ThisT,wxCaret),
wxe_util:cast(?wxCaret_SetSize_2,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI>>).
-%% @spec (This::wxCaret()) -> ok
%% @equiv show(This, [])
+-spec show(This) -> ok when
+ This::wxCaret().
+
show(This)
when is_record(This, wx_ref) ->
show(This, []).
-%% @spec (This::wxCaret(), [Option]) -> ok
-%% Option = {show, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcaret.html#wxcaretshow">external documentation</a>.
+-spec show(This, [Option]) -> ok when
+ This::wxCaret(),
+ Option :: {show, boolean()}.
show(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxCaret),
@@ -173,8 +193,8 @@ show(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxCaret_Show,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxCaret()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxCaret()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxCaret),
wxe_util:destroy(?wxCaret_destruct,Obj),
diff --git a/lib/wx/src/gen/wxCheckBox.erl b/lib/wx/src/gen/wxCheckBox.erl
index 19f01645c1..6e30f14207 100644
--- a/lib/wx/src/gen/wxCheckBox.erl
+++ b/lib/wx/src/gen/wxCheckBox.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -71,27 +71,35 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxCheckBox/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxCheckBox()
+-type wxCheckBox() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcheckbox.html#wxcheckboxwxcheckbox">external documentation</a>.
+-spec new() -> wxCheckBox().
new() ->
wxe_util:construct(?wxCheckBox_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Label::string()) -> wxCheckBox()
%% @equiv new(Parent,Id,Label, [])
+-spec new(Parent, Id, Label) -> wxCheckBox() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata().
+
new(Parent,Id,Label)
when is_record(Parent, wx_ref),is_integer(Id),is_list(Label) ->
new(Parent,Id,Label, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Label::string(), [Option]) -> wxCheckBox()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcheckbox.html#wxcheckboxwxcheckbox">external documentation</a>.
+-spec new(Parent, Id, Label, [Option]) -> wxCheckBox() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
when is_integer(Id),is_list(Label),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -105,15 +113,21 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
wxe_util:construct(?wxCheckBox_new_4,
<<ParentRef:32/?UI,Id:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxCheckBox(), Parent::wxWindow:wxWindow(), Id::integer(), Label::string()) -> bool()
%% @equiv create(This,Parent,Id,Label, [])
+-spec create(This, Parent, Id, Label) -> boolean() when
+ This::wxCheckBox(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata().
+
create(This,Parent,Id,Label)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Label) ->
create(This,Parent,Id,Label, []).
-%% @spec (This::wxCheckBox(), Parent::wxWindow:wxWindow(), Id::integer(), Label::string(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcheckbox.html#wxcheckboxcreate">external documentation</a>.
+-spec create(This, Parent, Id, Label, [Option]) -> boolean() when
+ This::wxCheckBox(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
when is_integer(Id),is_list(Label),is_list(Options) ->
?CLASS(ThisT,wxCheckBox),
@@ -128,63 +142,68 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,La
wxe_util:call(?wxCheckBox_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((0+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxCheckBox()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcheckbox.html#wxcheckboxgetvalue">external documentation</a>.
+-spec getValue(This) -> boolean() when
+ This::wxCheckBox().
getValue(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCheckBox),
wxe_util:call(?wxCheckBox_GetValue,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCheckBox()) -> WxCheckBoxState
-%% WxCheckBoxState = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcheckbox.html#wxcheckboxget3statevalue">external documentation</a>.
-%%<br /> WxCheckBoxState is one of ?wxCHK_UNCHECKED | ?wxCHK_CHECKED | ?wxCHK_UNDETERMINED
+%%<br /> Res = ?wxCHK_UNCHECKED | ?wxCHK_CHECKED | ?wxCHK_UNDETERMINED
+-spec get3StateValue(This) -> wx:wx_enum() when
+ This::wxCheckBox().
get3StateValue(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCheckBox),
wxe_util:call(?wxCheckBox_Get3StateValue,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCheckBox()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcheckbox.html#wxcheckboxis3rdstateallowedforuser">external documentation</a>.
+-spec is3rdStateAllowedForUser(This) -> boolean() when
+ This::wxCheckBox().
is3rdStateAllowedForUser(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCheckBox),
wxe_util:call(?wxCheckBox_Is3rdStateAllowedForUser,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCheckBox()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcheckbox.html#wxcheckboxis3state">external documentation</a>.
+-spec is3State(This) -> boolean() when
+ This::wxCheckBox().
is3State(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCheckBox),
wxe_util:call(?wxCheckBox_Is3State,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCheckBox()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcheckbox.html#wxcheckboxischecked">external documentation</a>.
+-spec isChecked(This) -> boolean() when
+ This::wxCheckBox().
isChecked(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCheckBox),
wxe_util:call(?wxCheckBox_IsChecked,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCheckBox(), State::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcheckbox.html#wxcheckboxsetvalue">external documentation</a>.
+-spec setValue(This, State) -> ok when
+ This::wxCheckBox(), State::boolean().
setValue(#wx_ref{type=ThisT,ref=ThisRef},State)
when is_boolean(State) ->
?CLASS(ThisT,wxCheckBox),
wxe_util:cast(?wxCheckBox_SetValue,
<<ThisRef:32/?UI,(wxe_util:from_bool(State)):32/?UI>>).
-%% @spec (This::wxCheckBox(), State::WxCheckBoxState) -> ok
-%% WxCheckBoxState = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcheckbox.html#wxcheckboxset3statevalue">external documentation</a>.
-%%<br /> WxCheckBoxState is one of ?wxCHK_UNCHECKED | ?wxCHK_CHECKED | ?wxCHK_UNDETERMINED
+%%<br /> State = ?wxCHK_UNCHECKED | ?wxCHK_CHECKED | ?wxCHK_UNDETERMINED
+-spec set3StateValue(This, State) -> ok when
+ This::wxCheckBox(), State::wx:wx_enum().
set3StateValue(#wx_ref{type=ThisT,ref=ThisRef},State)
when is_integer(State) ->
?CLASS(ThisT,wxCheckBox),
wxe_util:cast(?wxCheckBox_Set3StateValue,
<<ThisRef:32/?UI,State:32/?UI>>).
-%% @spec (This::wxCheckBox()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxCheckBox()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxCheckBox),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxCheckListBox.erl b/lib/wx/src/gen/wxCheckListBox.erl
index a1a07e1eec..382345abfa 100644
--- a/lib/wx/src/gen/wxCheckListBox.erl
+++ b/lib/wx/src/gen/wxCheckListBox.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -75,6 +75,7 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxCheckListBox/0]).
%% @hidden
parent_class(wxListBox) -> true;
parent_class(wxControlWithItems) -> true;
@@ -83,21 +84,29 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxCheckListBox()
+-type wxCheckListBox() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchecklistbox.html#wxchecklistboxwxchecklistbox">external documentation</a>.
+-spec new() -> wxCheckListBox().
new() ->
wxe_util:construct(?wxCheckListBox_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxCheckListBox()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxCheckListBox() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxCheckListBox()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {choices, [[string()]]} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchecklistbox.html#wxchecklistboxwxchecklistbox">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxCheckListBox() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {choices, [unicode:chardata()]}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -111,15 +120,18 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxCheckListBox_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxCheckListBox(), Index::integer()) -> ok
%% @equiv check(This,Index, [])
+-spec check(This, Index) -> ok when
+ This::wxCheckListBox(), Index::integer().
+
check(This,Index)
when is_record(This, wx_ref),is_integer(Index) ->
check(This,Index, []).
-%% @spec (This::wxCheckListBox(), Index::integer(), [Option]) -> ok
-%% Option = {check, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchecklistbox.html#wxchecklistboxcheck">external documentation</a>.
+-spec check(This, Index, [Option]) -> ok when
+ This::wxCheckListBox(), Index::integer(),
+ Option :: {check, boolean()}.
check(#wx_ref{type=ThisT,ref=ThisRef},Index, Options)
when is_integer(Index),is_list(Options) ->
?CLASS(ThisT,wxCheckListBox),
@@ -129,16 +141,17 @@ check(#wx_ref{type=ThisT,ref=ThisRef},Index, Options)
wxe_util:cast(?wxCheckListBox_Check,
<<ThisRef:32/?UI,Index:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxCheckListBox(), Index::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchecklistbox.html#wxchecklistboxischecked">external documentation</a>.
+-spec isChecked(This, Index) -> boolean() when
+ This::wxCheckListBox(), Index::integer().
isChecked(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxCheckListBox),
wxe_util:call(?wxCheckListBox_IsChecked,
<<ThisRef:32/?UI,Index:32/?UI>>).
-%% @spec (This::wxCheckListBox()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxCheckListBox()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxCheckListBox),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxChildFocusEvent.erl b/lib/wx/src/gen/wxChildFocusEvent.erl
index a20071cbf5..642db88c06 100644
--- a/lib/wx/src/gen/wxChildFocusEvent.erl
+++ b/lib/wx/src/gen/wxChildFocusEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -40,13 +40,16 @@
parent_class/1,resumePropagation/2,setInt/2,setString/2,shouldPropagate/1,
skip/1,skip/2,stopPropagation/1]).
+-export_type([wxChildFocusEvent/0]).
%% @hidden
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxChildFocusEvent()) -> wxWindow:wxWindow()
+-type wxChildFocusEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchildfocusevent.html#wxchildfocuseventgetwindow">external documentation</a>.
+-spec getWindow(This) -> wxWindow:wxWindow() when
+ This::wxChildFocusEvent().
getWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxChildFocusEvent),
wxe_util:call(?wxChildFocusEvent_GetWindow,
diff --git a/lib/wx/src/gen/wxChoice.erl b/lib/wx/src/gen/wxChoice.erl
index fa967d8487..92b094036e 100644
--- a/lib/wx/src/gen/wxChoice.erl
+++ b/lib/wx/src/gen/wxChoice.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -74,6 +74,7 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxChoice/0]).
%% @hidden
parent_class(wxControlWithItems) -> true;
parent_class(wxControl) -> true;
@@ -81,21 +82,29 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxChoice()
+-type wxChoice() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoice.html#wxchoicewxchoice">external documentation</a>.
+-spec new() -> wxChoice().
new() ->
wxe_util:construct(?wxChoice_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxChoice()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxChoice() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxChoice()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {choices, [[string()]]} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoice.html#wxchoicewxchoice">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxChoice() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {choices, [unicode:chardata()]}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -109,15 +118,19 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxChoice_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxChoice(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]]) -> bool()
%% @equiv create(This,Parent,Id,Pos,Size,Choices, [])
+-spec create(This, Parent, Id, Pos, Size, Choices) -> boolean() when
+ This::wxChoice(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[unicode:chardata()].
+
create(This,Parent,Id,Pos={PosX,PosY},Size={SizeW,SizeH},Choices)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices) ->
create(This,Parent,Id,Pos,Size,Choices, []).
-%% @spec (This::wxChoice(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]], [Option]) -> bool()
-%% Option = {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoice.html#wxchoicecreate">external documentation</a>.
+-spec create(This, Parent, Id, Pos, Size, Choices, [Option]) -> boolean() when
+ This::wxChoice(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[unicode:chardata()],
+ Option :: {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,{PosX,PosY},{SizeW,SizeH},Choices, Options)
when is_integer(Id),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices),is_list(Options) ->
?CLASS(ThisT,wxChoice),
@@ -131,30 +144,35 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,{P
wxe_util:call(?wxChoice_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,PosX:32/?UI,PosY:32/?UI,SizeW:32/?UI,SizeH:32/?UI,(length(Choices_UCA)):32/?UI, (<< <<(byte_size(UC_Str)):32/?UI, UC_Str/binary>>|| UC_Str <- Choices_UCA>>)/binary, 0:(((8- ((0 + lists:sum([byte_size(S)+4||S<-Choices_UCA])) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxChoice(), N::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoice.html#wxchoicedelete">external documentation</a>.
+-spec delete(This, N) -> ok when
+ This::wxChoice(), N::integer().
delete(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxChoice),
wxe_util:cast(?wxChoice_Delete,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxChoice()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoice.html#wxchoicegetcolumns">external documentation</a>.
+-spec getColumns(This) -> integer() when
+ This::wxChoice().
getColumns(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxChoice),
wxe_util:call(?wxChoice_GetColumns,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxChoice()) -> ok
%% @equiv setColumns(This, [])
+-spec setColumns(This) -> ok when
+ This::wxChoice().
+
setColumns(This)
when is_record(This, wx_ref) ->
setColumns(This, []).
-%% @spec (This::wxChoice(), [Option]) -> ok
-%% Option = {n, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoice.html#wxchoicesetcolumns">external documentation</a>.
+-spec setColumns(This, [Option]) -> ok when
+ This::wxChoice(),
+ Option :: {n, integer()}.
setColumns(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxChoice),
@@ -164,8 +182,8 @@ setColumns(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxChoice_SetColumns,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxChoice()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxChoice()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxChoice),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxChoicebook.erl b/lib/wx/src/gen/wxChoicebook.erl
index f37457f0ed..921e1e2882 100644
--- a/lib/wx/src/gen/wxChoicebook.erl
+++ b/lib/wx/src/gen/wxChoicebook.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -74,27 +74,34 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxChoicebook/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxChoicebook()
+-type wxChoicebook() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookwxchoicebook">external documentation</a>.
+-spec new() -> wxChoicebook().
new() ->
wxe_util:construct(?wxChoicebook_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxChoicebook()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxChoicebook() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxChoicebook()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookwxchoicebook">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxChoicebook() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -106,15 +113,19 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxChoicebook_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxChoicebook(), Page::wxWindow:wxWindow(), Text::string()) -> bool()
%% @equiv addPage(This,Page,Text, [])
+-spec addPage(This, Page, Text) -> boolean() when
+ This::wxChoicebook(), Page::wxWindow:wxWindow(), Text::unicode:chardata().
+
addPage(This,Page,Text)
when is_record(This, wx_ref),is_record(Page, wx_ref),is_list(Text) ->
addPage(This,Page,Text, []).
-%% @spec (This::wxChoicebook(), Page::wxWindow:wxWindow(), Text::string(), [Option]) -> bool()
-%% Option = {bSelect, bool()} | {imageId, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookaddpage">external documentation</a>.
+-spec addPage(This, Page, Text, [Option]) -> boolean() when
+ This::wxChoicebook(), Page::wxWindow:wxWindow(), Text::unicode:chardata(),
+ Option :: {bSelect, boolean()}
+ | {imageId, integer()}.
addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Text, Options)
when is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxChoicebook),
@@ -127,15 +138,18 @@ addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Text, Op
wxe_util:call(?wxChoicebook_AddPage,
<<ThisRef:32/?UI,PageRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxChoicebook()) -> ok
%% @equiv advanceSelection(This, [])
+-spec advanceSelection(This) -> ok when
+ This::wxChoicebook().
+
advanceSelection(This)
when is_record(This, wx_ref) ->
advanceSelection(This, []).
-%% @spec (This::wxChoicebook(), [Option]) -> ok
-%% Option = {forward, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookadvanceselection">external documentation</a>.
+-spec advanceSelection(This, [Option]) -> ok when
+ This::wxChoicebook(),
+ Option :: {forward, boolean()}.
advanceSelection(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxChoicebook),
@@ -145,23 +159,29 @@ advanceSelection(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxChoicebook_AdvanceSelection,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxChoicebook(), ImageList::wxImageList:wxImageList()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookassignimagelist">external documentation</a>.
+-spec assignImageList(This, ImageList) -> ok when
+ This::wxChoicebook(), ImageList::wxImageList:wxImageList().
assignImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef}) ->
?CLASS(ThisT,wxChoicebook),
?CLASS(ImageListT,wxImageList),
wxe_util:cast(?wxChoicebook_AssignImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI>>).
-%% @spec (This::wxChoicebook(), Parent::wxWindow:wxWindow(), Id::integer()) -> bool()
%% @equiv create(This,Parent,Id, [])
+-spec create(This, Parent, Id) -> boolean() when
+ This::wxChoicebook(), Parent::wxWindow:wxWindow(), Id::integer().
+
create(This,Parent,Id)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id) ->
create(This,Parent,Id, []).
-%% @spec (This::wxChoicebook(), Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookcreate">external documentation</a>.
+-spec create(This, Parent, Id, [Option]) -> boolean() when
+ This::wxChoicebook(), Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ThisT,wxChoicebook),
@@ -174,98 +194,114 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, O
wxe_util:call(?wxChoicebook_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxChoicebook()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookdeleteallpages">external documentation</a>.
+-spec deleteAllPages(This) -> boolean() when
+ This::wxChoicebook().
deleteAllPages(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxChoicebook),
wxe_util:call(?wxChoicebook_DeleteAllPages,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxChoicebook(), N::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookdeletepage">external documentation</a>.
+-spec deletePage(This, N) -> boolean() when
+ This::wxChoicebook(), N::integer().
deletePage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxChoicebook),
wxe_util:call(?wxChoicebook_DeletePage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxChoicebook(), N::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookremovepage">external documentation</a>.
+-spec removePage(This, N) -> boolean() when
+ This::wxChoicebook(), N::integer().
removePage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxChoicebook),
wxe_util:call(?wxChoicebook_RemovePage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxChoicebook()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookgetcurrentpage">external documentation</a>.
+-spec getCurrentPage(This) -> wxWindow:wxWindow() when
+ This::wxChoicebook().
getCurrentPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxChoicebook),
wxe_util:call(?wxChoicebook_GetCurrentPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxChoicebook()) -> wxImageList:wxImageList()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookgetimagelist">external documentation</a>.
+-spec getImageList(This) -> wxImageList:wxImageList() when
+ This::wxChoicebook().
getImageList(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxChoicebook),
wxe_util:call(?wxChoicebook_GetImageList,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxChoicebook(), N::integer()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookgetpage">external documentation</a>.
+-spec getPage(This, N) -> wxWindow:wxWindow() when
+ This::wxChoicebook(), N::integer().
getPage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxChoicebook),
wxe_util:call(?wxChoicebook_GetPage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxChoicebook()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookgetpagecount">external documentation</a>.
+-spec getPageCount(This) -> integer() when
+ This::wxChoicebook().
getPageCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxChoicebook),
wxe_util:call(?wxChoicebook_GetPageCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxChoicebook(), N::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookgetpageimage">external documentation</a>.
+-spec getPageImage(This, N) -> integer() when
+ This::wxChoicebook(), N::integer().
getPageImage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxChoicebook),
wxe_util:call(?wxChoicebook_GetPageImage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxChoicebook(), N::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookgetpagetext">external documentation</a>.
+-spec getPageText(This, N) -> unicode:charlist() when
+ This::wxChoicebook(), N::integer().
getPageText(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxChoicebook),
wxe_util:call(?wxChoicebook_GetPageText,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxChoicebook()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookgetselection">external documentation</a>.
+-spec getSelection(This) -> integer() when
+ This::wxChoicebook().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxChoicebook),
wxe_util:call(?wxChoicebook_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxChoicebook(), Pt::{X::integer(), Y::integer()}) -> {integer(), Flags::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookhittest">external documentation</a>.
+-spec hitTest(This, Pt) -> Result when
+ Result ::{Res ::integer(), Flags::integer()},
+ This::wxChoicebook(), Pt::{X::integer(), Y::integer()}.
hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxChoicebook),
wxe_util:call(?wxChoicebook_HitTest,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxChoicebook(), N::integer(), Page::wxWindow:wxWindow(), Text::string()) -> bool()
%% @equiv insertPage(This,N,Page,Text, [])
+-spec insertPage(This, N, Page, Text) -> boolean() when
+ This::wxChoicebook(), N::integer(), Page::wxWindow:wxWindow(), Text::unicode:chardata().
+
insertPage(This,N,Page,Text)
when is_record(This, wx_ref),is_integer(N),is_record(Page, wx_ref),is_list(Text) ->
insertPage(This,N,Page,Text, []).
-%% @spec (This::wxChoicebook(), N::integer(), Page::wxWindow:wxWindow(), Text::string(), [Option]) -> bool()
-%% Option = {bSelect, bool()} | {imageId, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookinsertpage">external documentation</a>.
+-spec insertPage(This, N, Page, Text, [Option]) -> boolean() when
+ This::wxChoicebook(), N::integer(), Page::wxWindow:wxWindow(), Text::unicode:chardata(),
+ Option :: {bSelect, boolean()}
+ | {imageId, integer()}.
insertPage(#wx_ref{type=ThisT,ref=ThisRef},N,#wx_ref{type=PageT,ref=PageRef},Text, Options)
when is_integer(N),is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxChoicebook),
@@ -278,32 +314,36 @@ insertPage(#wx_ref{type=ThisT,ref=ThisRef},N,#wx_ref{type=PageT,ref=PageRef},Tex
wxe_util:call(?wxChoicebook_InsertPage,
<<ThisRef:32/?UI,N:32/?UI,PageRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxChoicebook(), ImageList::wxImageList:wxImageList()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebooksetimagelist">external documentation</a>.
+-spec setImageList(This, ImageList) -> ok when
+ This::wxChoicebook(), ImageList::wxImageList:wxImageList().
setImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef}) ->
?CLASS(ThisT,wxChoicebook),
?CLASS(ImageListT,wxImageList),
wxe_util:cast(?wxChoicebook_SetImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI>>).
-%% @spec (This::wxChoicebook(), Size::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebooksetpagesize">external documentation</a>.
+-spec setPageSize(This, Size) -> ok when
+ This::wxChoicebook(), Size::{W::integer(), H::integer()}.
setPageSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxChoicebook),
wxe_util:cast(?wxChoicebook_SetPageSize,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxChoicebook(), N::integer(), ImageId::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebooksetpageimage">external documentation</a>.
+-spec setPageImage(This, N, ImageId) -> boolean() when
+ This::wxChoicebook(), N::integer(), ImageId::integer().
setPageImage(#wx_ref{type=ThisT,ref=ThisRef},N,ImageId)
when is_integer(N),is_integer(ImageId) ->
?CLASS(ThisT,wxChoicebook),
wxe_util:call(?wxChoicebook_SetPageImage,
<<ThisRef:32/?UI,N:32/?UI,ImageId:32/?UI>>).
-%% @spec (This::wxChoicebook(), N::integer(), StrText::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebooksetpagetext">external documentation</a>.
+-spec setPageText(This, N, StrText) -> boolean() when
+ This::wxChoicebook(), N::integer(), StrText::unicode:chardata().
setPageText(#wx_ref{type=ThisT,ref=ThisRef},N,StrText)
when is_integer(N),is_list(StrText) ->
?CLASS(ThisT,wxChoicebook),
@@ -311,24 +351,26 @@ setPageText(#wx_ref{type=ThisT,ref=ThisRef},N,StrText)
wxe_util:call(?wxChoicebook_SetPageText,
<<ThisRef:32/?UI,N:32/?UI,(byte_size(StrText_UC)):32/?UI,(StrText_UC)/binary, 0:(((8- ((4+byte_size(StrText_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxChoicebook(), N::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebooksetselection">external documentation</a>.
+-spec setSelection(This, N) -> integer() when
+ This::wxChoicebook(), N::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxChoicebook),
wxe_util:call(?wxChoicebook_SetSelection,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxChoicebook(), N::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxchoicebook.html#wxchoicebookchangeselection">external documentation</a>.
+-spec changeSelection(This, N) -> integer() when
+ This::wxChoicebook(), N::integer().
changeSelection(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxChoicebook),
wxe_util:call(?wxChoicebook_ChangeSelection,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxChoicebook()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxChoicebook()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxChoicebook),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxClientDC.erl b/lib/wx/src/gen/wxClientDC.erl
index c966fb50cc..7dfebe4068 100644
--- a/lib/wx/src/gen/wxClientDC.erl
+++ b/lib/wx/src/gen/wxClientDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -39,10 +39,10 @@
drawPoint/2,drawPolygon/2,drawPolygon/3,drawRectangle/2,drawRectangle/3,
drawRotatedText/4,drawRoundedRectangle/3,drawRoundedRectangle/4,
drawText/3,endDoc/1,endPage/1,floodFill/3,floodFill/4,getBackground/1,
- getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/2,
+ getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/1,
getFont/1,getLayoutDirection/1,getLogicalFunction/1,getMapMode/1,
- getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/3,
- getPen/1,getPixel/3,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
+ getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/2,
+ getPen/1,getPixel/2,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
getTextExtent/3,getTextForeground/1,getUserScale/1,gradientFillConcentric/4,
gradientFillConcentric/5,gradientFillLinear/4,gradientFillLinear/5,
isOk/1,logicalToDeviceX/2,logicalToDeviceXRel/2,logicalToDeviceY/2,
@@ -53,26 +53,29 @@
setPen/2,setTextBackground/2,setTextForeground/2,setUserScale/3,startDoc/2,
startPage/1]).
+-export_type([wxClientDC/0]).
%% @hidden
parent_class(wxWindowDC) -> true;
parent_class(wxDC) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxClientDC()
+-type wxClientDC() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxclientdc.html#wxclientdcwxclientdc">external documentation</a>.
+-spec new() -> wxClientDC().
new() ->
wxe_util:construct(?wxClientDC_new_0,
<<>>).
-%% @spec (Win::wxWindow:wxWindow()) -> wxClientDC()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxclientdc.html#wxclientdcwxclientdc">external documentation</a>.
+-spec new(Win) -> wxClientDC() when
+ Win::wxWindow:wxWindow().
new(#wx_ref{type=WinT,ref=WinRef}) ->
?CLASS(WinT,wxWindow),
wxe_util:construct(?wxClientDC_new_1,
<<WinRef:32/?UI>>).
-%% @spec (This::wxClientDC()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxClientDC()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxClientDC),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
@@ -160,11 +163,11 @@ getSize(This) -> wxDC:getSize(This).
%% @hidden
getPPI(This) -> wxDC:getPPI(This).
%% @hidden
-getPixel(This,Pt,Col) -> wxDC:getPixel(This,Pt,Col).
+getPixel(This,Pt) -> wxDC:getPixel(This,Pt).
%% @hidden
getPen(This) -> wxDC:getPen(This).
%% @hidden
-getPartialTextExtents(This,Text,Widths) -> wxDC:getPartialTextExtents(This,Text,Widths).
+getPartialTextExtents(This,Text) -> wxDC:getPartialTextExtents(This,Text).
%% @hidden
getMultiLineTextExtent(This,String, Options) -> wxDC:getMultiLineTextExtent(This,String, Options).
%% @hidden
@@ -178,7 +181,7 @@ getLayoutDirection(This) -> wxDC:getLayoutDirection(This).
%% @hidden
getFont(This) -> wxDC:getFont(This).
%% @hidden
-getClippingBox(This,Rect) -> wxDC:getClippingBox(This,Rect).
+getClippingBox(This) -> wxDC:getClippingBox(This).
%% @hidden
getCharWidth(This) -> wxDC:getCharWidth(This).
%% @hidden
diff --git a/lib/wx/src/gen/wxClipboard.erl b/lib/wx/src/gen/wxClipboard.erl
index 7ae27b3133..8f1d59f603 100644
--- a/lib/wx/src/gen/wxClipboard.erl
+++ b/lib/wx/src/gen/wxClipboard.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -30,83 +30,96 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxClipboard/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxClipboard()
+-type wxClipboard() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxclipboard.html#wxclipboardwxclipboard">external documentation</a>.
+-spec new() -> wxClipboard().
new() ->
wxe_util:construct(?wxClipboard_new,
<<>>).
-%% @spec (This::wxClipboard(), Data::wxDataObject:wxDataObject()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxclipboard.html#wxclipboardadddata">external documentation</a>.
+-spec addData(This, Data) -> boolean() when
+ This::wxClipboard(), Data::wxDataObject:wxDataObject().
addData(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DataT,ref=DataRef}) ->
?CLASS(ThisT,wxClipboard),
?CLASS(DataT,wxDataObject),
wxe_util:call(?wxClipboard_AddData,
<<ThisRef:32/?UI,DataRef:32/?UI>>).
-%% @spec (This::wxClipboard()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxclipboard.html#wxclipboardclear">external documentation</a>.
+-spec clear(This) -> ok when
+ This::wxClipboard().
clear(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxClipboard),
wxe_util:cast(?wxClipboard_Clear,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxClipboard()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxclipboard.html#wxclipboardclose">external documentation</a>.
+-spec close(This) -> ok when
+ This::wxClipboard().
close(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxClipboard),
wxe_util:cast(?wxClipboard_Close,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxClipboard()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxclipboard.html#wxclipboardflush">external documentation</a>.
+-spec flush(This) -> boolean() when
+ This::wxClipboard().
flush(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxClipboard),
wxe_util:call(?wxClipboard_Flush,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxClipboard(), Data::wxDataObject:wxDataObject()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxclipboard.html#wxclipboardgetdata">external documentation</a>.
+-spec getData(This, Data) -> boolean() when
+ This::wxClipboard(), Data::wxDataObject:wxDataObject().
getData(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DataT,ref=DataRef}) ->
?CLASS(ThisT,wxClipboard),
?CLASS(DataT,wxDataObject),
wxe_util:call(?wxClipboard_GetData,
<<ThisRef:32/?UI,DataRef:32/?UI>>).
-%% @spec (This::wxClipboard()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxclipboard.html#wxclipboardisopened">external documentation</a>.
+-spec isOpened(This) -> boolean() when
+ This::wxClipboard().
isOpened(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxClipboard),
wxe_util:call(?wxClipboard_IsOpened,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxClipboard()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxclipboard.html#wxclipboardopen">external documentation</a>.
+-spec open(This) -> boolean() when
+ This::wxClipboard().
open(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxClipboard),
wxe_util:call(?wxClipboard_Open,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxClipboard(), Data::wxDataObject:wxDataObject()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxclipboard.html#wxclipboardsetdata">external documentation</a>.
+-spec setData(This, Data) -> boolean() when
+ This::wxClipboard(), Data::wxDataObject:wxDataObject().
setData(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DataT,ref=DataRef}) ->
?CLASS(ThisT,wxClipboard),
?CLASS(DataT,wxDataObject),
wxe_util:call(?wxClipboard_SetData,
<<ThisRef:32/?UI,DataRef:32/?UI>>).
-%% @spec (This::wxClipboard()) -> ok
%% @equiv usePrimarySelection(This, [])
+-spec usePrimarySelection(This) -> ok when
+ This::wxClipboard().
+
usePrimarySelection(This)
when is_record(This, wx_ref) ->
usePrimarySelection(This, []).
-%% @spec (This::wxClipboard(), [Option]) -> ok
-%% Option = {primary, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxclipboard.html#wxclipboarduseprimaryselection">external documentation</a>.
+-spec usePrimarySelection(This, [Option]) -> ok when
+ This::wxClipboard(),
+ Option :: {primary, boolean()}.
usePrimarySelection(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxClipboard),
@@ -116,22 +129,23 @@ usePrimarySelection(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxClipboard_UsePrimarySelection,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxClipboard(), Format::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxclipboard.html#wxclipboardissupported">external documentation</a>.
+-spec isSupported(This, Format) -> boolean() when
+ This::wxClipboard(), Format::integer().
isSupported(#wx_ref{type=ThisT,ref=ThisRef},Format)
when is_integer(Format) ->
?CLASS(ThisT,wxClipboard),
wxe_util:call(?wxClipboard_IsSupported,
<<ThisRef:32/?UI,Format:32/?UI>>).
-%% @spec () -> wxClipboard()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxclipboard.html#wxclipboardget">external documentation</a>.
+-spec get() -> wxClipboard().
get() ->
wxe_util:call(?wxClipboard_Get,
<<>>).
-%% @spec (This::wxClipboard()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxClipboard()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxClipboard),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxCloseEvent.erl b/lib/wx/src/gen/wxCloseEvent.erl
index 706d7701de..4a682c906e 100644
--- a/lib/wx/src/gen/wxCloseEvent.erl
+++ b/lib/wx/src/gen/wxCloseEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,49 +37,58 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxCloseEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxCloseEvent()) -> bool()
+-type wxCloseEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcloseevent.html#wxcloseeventcanveto">external documentation</a>.
+-spec canVeto(This) -> boolean() when
+ This::wxCloseEvent().
canVeto(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCloseEvent),
wxe_util:call(?wxCloseEvent_CanVeto,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCloseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcloseevent.html#wxcloseeventgetloggingoff">external documentation</a>.
+-spec getLoggingOff(This) -> boolean() when
+ This::wxCloseEvent().
getLoggingOff(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCloseEvent),
wxe_util:call(?wxCloseEvent_GetLoggingOff,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCloseEvent(), CanVeto::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcloseevent.html#wxcloseeventsetcanveto">external documentation</a>.
+-spec setCanVeto(This, CanVeto) -> ok when
+ This::wxCloseEvent(), CanVeto::boolean().
setCanVeto(#wx_ref{type=ThisT,ref=ThisRef},CanVeto)
when is_boolean(CanVeto) ->
?CLASS(ThisT,wxCloseEvent),
wxe_util:cast(?wxCloseEvent_SetCanVeto,
<<ThisRef:32/?UI,(wxe_util:from_bool(CanVeto)):32/?UI>>).
-%% @spec (This::wxCloseEvent(), LogOff::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcloseevent.html#wxcloseeventsetloggingoff">external documentation</a>.
+-spec setLoggingOff(This, LogOff) -> ok when
+ This::wxCloseEvent(), LogOff::boolean().
setLoggingOff(#wx_ref{type=ThisT,ref=ThisRef},LogOff)
when is_boolean(LogOff) ->
?CLASS(ThisT,wxCloseEvent),
wxe_util:cast(?wxCloseEvent_SetLoggingOff,
<<ThisRef:32/?UI,(wxe_util:from_bool(LogOff)):32/?UI>>).
-%% @spec (This::wxCloseEvent()) -> ok
%% @equiv veto(This, [])
+-spec veto(This) -> ok when
+ This::wxCloseEvent().
+
veto(This)
when is_record(This, wx_ref) ->
veto(This, []).
-%% @spec (This::wxCloseEvent(), [Option]) -> ok
-%% Option = {veto, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcloseevent.html#wxcloseeventveto">external documentation</a>.
+-spec veto(This, [Option]) -> ok when
+ This::wxCloseEvent(),
+ Option :: {veto, boolean()}.
veto(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxCloseEvent),
diff --git a/lib/wx/src/gen/wxColourData.erl b/lib/wx/src/gen/wxColourData.erl
index dc77ea043c..289d423cb6 100644
--- a/lib/wx/src/gen/wxColourData.erl
+++ b/lib/wx/src/gen/wxColourData.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -30,70 +30,79 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxColourData/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxColourData()
+-type wxColourData() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourdata.html#wxcolourdatawxcolourdata">external documentation</a>.
+-spec new() -> wxColourData().
new() ->
wxe_util:construct(?wxColourData_new_0,
<<>>).
-%% @spec (Data::wxColourData()) -> wxColourData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourdata.html#wxcolourdatawxcolourdata">external documentation</a>.
+-spec new(Data) -> wxColourData() when
+ Data::wxColourData().
new(#wx_ref{type=DataT,ref=DataRef}) ->
?CLASS(DataT,wxColourData),
wxe_util:construct(?wxColourData_new_1,
<<DataRef:32/?UI>>).
-%% @spec (This::wxColourData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourdata.html#wxcolourdatagetchoosefull">external documentation</a>.
+-spec getChooseFull(This) -> boolean() when
+ This::wxColourData().
getChooseFull(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxColourData),
wxe_util:call(?wxColourData_GetChooseFull,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxColourData()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourdata.html#wxcolourdatagetcolour">external documentation</a>.
+-spec getColour(This) -> wx:wx_colour4() when
+ This::wxColourData().
getColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxColourData),
wxe_util:call(?wxColourData_GetColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxColourData(), I::integer()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourdata.html#wxcolourdatagetcustomcolour">external documentation</a>.
+-spec getCustomColour(This, I) -> wx:wx_colour4() when
+ This::wxColourData(), I::integer().
getCustomColour(#wx_ref{type=ThisT,ref=ThisRef},I)
when is_integer(I) ->
?CLASS(ThisT,wxColourData),
wxe_util:call(?wxColourData_GetCustomColour,
<<ThisRef:32/?UI,I:32/?UI>>).
-%% @spec (This::wxColourData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourdata.html#wxcolourdatasetchoosefull">external documentation</a>.
+-spec setChooseFull(This, Flag) -> ok when
+ This::wxColourData(), Flag::boolean().
setChooseFull(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxColourData),
wxe_util:cast(?wxColourData_SetChooseFull,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxColourData(), Colour::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourdata.html#wxcolourdatasetcolour">external documentation</a>.
+-spec setColour(This, Colour) -> ok when
+ This::wxColourData(), Colour::wx:wx_colour().
setColour(#wx_ref{type=ThisT,ref=ThisRef},Colour)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxColourData),
wxe_util:cast(?wxColourData_SetColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
-%% @spec (This::wxColourData(), I::integer(), Colour::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourdata.html#wxcolourdatasetcustomcolour">external documentation</a>.
+-spec setCustomColour(This, I, Colour) -> ok when
+ This::wxColourData(), I::integer(), Colour::wx:wx_colour().
setCustomColour(#wx_ref{type=ThisT,ref=ThisRef},I,Colour)
when is_integer(I),tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxColourData),
wxe_util:cast(?wxColourData_SetCustomColour,
<<ThisRef:32/?UI,I:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
-%% @spec (This::wxColourData()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxColourData()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxColourData),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxColourDialog.erl b/lib/wx/src/gen/wxColourDialog.erl
index f5677d00ff..8040112426 100644
--- a/lib/wx/src/gen/wxColourDialog.erl
+++ b/lib/wx/src/gen/wxColourDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -77,6 +77,7 @@
transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxColourDialog/0]).
%% @hidden
parent_class(wxDialog) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -84,21 +85,25 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxColourDialog()
+-type wxColourDialog() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourdialog.html#wxcolourdialogwxcolourdialog">external documentation</a>.
+-spec new() -> wxColourDialog().
new() ->
wxe_util:construct(?wxColourDialog_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxColourDialog()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxColourDialog() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxColourDialog()
-%% Option = {data, wxColourData:wxColourData()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourdialog.html#wxcolourdialogwxcolourdialog">external documentation</a>.
+-spec new(Parent, [Option]) -> wxColourDialog() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {data, wxColourData:wxColourData()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -108,15 +113,18 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxColourDialog_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxColourDialog(), Parent::wxWindow:wxWindow()) -> bool()
%% @equiv create(This,Parent, [])
+-spec create(This, Parent) -> boolean() when
+ This::wxColourDialog(), Parent::wxWindow:wxWindow().
+
create(This,Parent)
when is_record(This, wx_ref),is_record(Parent, wx_ref) ->
create(This,Parent, []).
-%% @spec (This::wxColourDialog(), Parent::wxWindow:wxWindow(), [Option]) -> bool()
-%% Option = {data, wxColourData:wxColourData()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourdialog.html#wxcolourdialogcreate">external documentation</a>.
+-spec create(This, Parent, [Option]) -> boolean() when
+ This::wxColourDialog(), Parent::wxWindow:wxWindow(),
+ Option :: {data, wxColourData:wxColourData()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxColourDialog),
@@ -127,15 +135,16 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Opti
wxe_util:call(?wxColourDialog_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxColourDialog()) -> wxColourData:wxColourData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourdialog.html#wxcolourdialoggetcolourdata">external documentation</a>.
+-spec getColourData(This) -> wxColourData:wxColourData() when
+ This::wxColourDialog().
getColourData(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxColourDialog),
wxe_util:call(?wxColourDialog_GetColourData,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxColourDialog()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxColourDialog()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxColourDialog),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxColourPickerCtrl.erl b/lib/wx/src/gen/wxColourPickerCtrl.erl
index 60776925b9..1ba771695f 100644
--- a/lib/wx/src/gen/wxColourPickerCtrl.erl
+++ b/lib/wx/src/gen/wxColourPickerCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -74,6 +74,7 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxColourPickerCtrl/0]).
%% @hidden
parent_class(wxPickerBase) -> true;
parent_class(wxControl) -> true;
@@ -81,21 +82,29 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxColourPickerCtrl()
+-type wxColourPickerCtrl() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourpickerctrl.html#wxcolourpickerctrlwxcolourpickerctrl">external documentation</a>.
+-spec new() -> wxColourPickerCtrl().
new() ->
wxe_util:construct(?wxColourPickerCtrl_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxColourPickerCtrl()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxColourPickerCtrl() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxColourPickerCtrl()
-%% Option = {col, wx:colour()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourpickerctrl.html#wxcolourpickerctrlwxcolourpickerctrl">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxColourPickerCtrl() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {col, wx:wx_colour()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -109,15 +118,22 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxColourPickerCtrl_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxColourPickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer()) -> bool()
%% @equiv create(This,Parent,Id, [])
+-spec create(This, Parent, Id) -> boolean() when
+ This::wxColourPickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer().
+
create(This,Parent,Id)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id) ->
create(This,Parent,Id, []).
-%% @spec (This::wxColourPickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> bool()
-%% Option = {col, wx:colour()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourpickerctrl.html#wxcolourpickerctrlcreate">external documentation</a>.
+-spec create(This, Parent, Id, [Option]) -> boolean() when
+ This::wxColourPickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {col, wx:wx_colour()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ThisT,wxColourPickerCtrl),
@@ -132,22 +148,23 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, O
wxe_util:call(?wxColourPickerCtrl_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxColourPickerCtrl()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourpickerctrl.html#wxcolourpickerctrlgetcolour">external documentation</a>.
+-spec getColour(This) -> wx:wx_colour4() when
+ This::wxColourPickerCtrl().
getColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxColourPickerCtrl),
wxe_util:call(?wxColourPickerCtrl_GetColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxColourPickerCtrl(),X::string()|term()) -> bool()|ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourpickerctrl.html#wxcolourpickerctrlsetcolour">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setColour(This::wxColourPickerCtrl(), Text::string()) -> bool() </c>
-%% </p>
-%% <p><c>
-%% setColour(This::wxColourPickerCtrl(), Col::wx:colour()) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% setColour(This, Col) -> ok when<br />
+%% This::wxColourPickerCtrl(), Col::wx:wx_colour().<br />
+%%
+-spec setColour(This, Text) -> boolean() when
+ This::wxColourPickerCtrl(), Text::unicode:chardata();
+ (This, Col) -> ok when
+ This::wxColourPickerCtrl(), Col::wx:wx_colour().
setColour(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_list(Text) ->
?CLASS(ThisT,wxColourPickerCtrl),
@@ -160,8 +177,8 @@ setColour(#wx_ref{type=ThisT,ref=ThisRef},Col)
wxe_util:cast(?wxColourPickerCtrl_SetColour_1_1,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Col)):16/binary>>).
-%% @spec (This::wxColourPickerCtrl()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxColourPickerCtrl()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxColourPickerCtrl),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxColourPickerEvent.erl b/lib/wx/src/gen/wxColourPickerEvent.erl
index 9ba431b841..71a3fd3e5b 100644
--- a/lib/wx/src/gen/wxColourPickerEvent.erl
+++ b/lib/wx/src/gen/wxColourPickerEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -40,13 +40,16 @@
parent_class/1,resumePropagation/2,setInt/2,setString/2,shouldPropagate/1,
skip/1,skip/2,stopPropagation/1]).
+-export_type([wxColourPickerEvent/0]).
%% @hidden
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxColourPickerEvent()) -> wx:colour()
+-type wxColourPickerEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcolourpickerevent.html#wxcolourpickereventgetcolour">external documentation</a>.
+-spec getColour(This) -> wx:wx_colour4() when
+ This::wxColourPickerEvent().
getColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxColourPickerEvent),
wxe_util:call(?wxColourPickerEvent_GetColour,
diff --git a/lib/wx/src/gen/wxComboBox.erl b/lib/wx/src/gen/wxComboBox.erl
index f743df4e93..4e6b247f67 100644
--- a/lib/wx/src/gen/wxComboBox.erl
+++ b/lib/wx/src/gen/wxComboBox.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -76,6 +76,7 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxComboBox/0]).
%% @hidden
parent_class(wxControlWithItems) -> true;
parent_class(wxControl) -> true;
@@ -83,21 +84,30 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxComboBox()
+-type wxComboBox() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxwxcombobox">external documentation</a>.
+-spec new() -> wxComboBox().
new() ->
wxe_util:construct(?wxComboBox_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxComboBox()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxComboBox() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxComboBox()
-%% Option = {value, string()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {choices, [[string()]]} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxwxcombobox">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxComboBox() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {value, unicode:chardata()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {choices, [unicode:chardata()]}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -112,15 +122,19 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxComboBox_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxComboBox(), Parent::wxWindow:wxWindow(), Id::integer(), Value::string(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]]) -> bool()
%% @equiv create(This,Parent,Id,Value,Pos,Size,Choices, [])
+-spec create(This, Parent, Id, Value, Pos, Size, Choices) -> boolean() when
+ This::wxComboBox(), Parent::wxWindow:wxWindow(), Id::integer(), Value::unicode:chardata(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[unicode:chardata()].
+
create(This,Parent,Id,Value,Pos={PosX,PosY},Size={SizeW,SizeH},Choices)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Value),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices) ->
create(This,Parent,Id,Value,Pos,Size,Choices, []).
-%% @spec (This::wxComboBox(), Parent::wxWindow:wxWindow(), Id::integer(), Value::string(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]], [Option]) -> bool()
-%% Option = {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxcreate">external documentation</a>.
+-spec create(This, Parent, Id, Value, Pos, Size, Choices, [Option]) -> boolean() when
+ This::wxComboBox(), Parent::wxWindow:wxWindow(), Id::integer(), Value::unicode:chardata(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[unicode:chardata()],
+ Option :: {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Value,{PosX,PosY},{SizeW,SizeH},Choices, Options)
when is_integer(Id),is_list(Value),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices),is_list(Options) ->
?CLASS(ThisT,wxComboBox),
@@ -135,92 +149,105 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Va
wxe_util:call(?wxComboBox_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,(byte_size(Value_UC)):32/?UI,(Value_UC)/binary, 0:(((8- ((0+byte_size(Value_UC)) band 16#7)) band 16#7))/unit:8,PosX:32/?UI,PosY:32/?UI,SizeW:32/?UI,SizeH:32/?UI,(length(Choices_UCA)):32/?UI, (<< <<(byte_size(UC_Str)):32/?UI, UC_Str/binary>>|| UC_Str <- Choices_UCA>>)/binary, 0:(((8- ((4 + lists:sum([byte_size(S)+4||S<-Choices_UCA])) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxComboBox()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxcancopy">external documentation</a>.
+-spec canCopy(This) -> boolean() when
+ This::wxComboBox().
canCopy(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxComboBox),
wxe_util:call(?wxComboBox_CanCopy,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxComboBox()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxcancut">external documentation</a>.
+-spec canCut(This) -> boolean() when
+ This::wxComboBox().
canCut(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxComboBox),
wxe_util:call(?wxComboBox_CanCut,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxComboBox()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxcanpaste">external documentation</a>.
+-spec canPaste(This) -> boolean() when
+ This::wxComboBox().
canPaste(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxComboBox),
wxe_util:call(?wxComboBox_CanPaste,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxComboBox()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxcanredo">external documentation</a>.
+-spec canRedo(This) -> boolean() when
+ This::wxComboBox().
canRedo(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxComboBox),
wxe_util:call(?wxComboBox_CanRedo,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxComboBox()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxcanundo">external documentation</a>.
+-spec canUndo(This) -> boolean() when
+ This::wxComboBox().
canUndo(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxComboBox),
wxe_util:call(?wxComboBox_CanUndo,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxComboBox()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxcopy">external documentation</a>.
+-spec copy(This) -> ok when
+ This::wxComboBox().
copy(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxComboBox),
wxe_util:cast(?wxComboBox_Copy,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxComboBox()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxcut">external documentation</a>.
+-spec cut(This) -> ok when
+ This::wxComboBox().
cut(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxComboBox),
wxe_util:cast(?wxComboBox_Cut,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxComboBox()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxgetinsertionpoint">external documentation</a>.
+-spec getInsertionPoint(This) -> integer() when
+ This::wxComboBox().
getInsertionPoint(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxComboBox),
wxe_util:call(?wxComboBox_GetInsertionPoint,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxComboBox()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxgetlastposition">external documentation</a>.
+-spec getLastPosition(This) -> integer() when
+ This::wxComboBox().
getLastPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxComboBox),
wxe_util:call(?wxComboBox_GetLastPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxComboBox()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxgetvalue">external documentation</a>.
+-spec getValue(This) -> unicode:charlist() when
+ This::wxComboBox().
getValue(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxComboBox),
wxe_util:call(?wxComboBox_GetValue,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxComboBox()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxpaste">external documentation</a>.
+-spec paste(This) -> ok when
+ This::wxComboBox().
paste(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxComboBox),
wxe_util:cast(?wxComboBox_Paste,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxComboBox()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxredo">external documentation</a>.
+-spec redo(This) -> ok when
+ This::wxComboBox().
redo(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxComboBox),
wxe_util:cast(?wxComboBox_Redo,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxComboBox(), From::integer(), To::integer(), Value::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxreplace">external documentation</a>.
+-spec replace(This, From, To, Value) -> ok when
+ This::wxComboBox(), From::integer(), To::integer(), Value::unicode:chardata().
replace(#wx_ref{type=ThisT,ref=ThisRef},From,To,Value)
when is_integer(From),is_integer(To),is_list(Value) ->
?CLASS(ThisT,wxComboBox),
@@ -228,47 +255,53 @@ replace(#wx_ref{type=ThisT,ref=ThisRef},From,To,Value)
wxe_util:cast(?wxComboBox_Replace,
<<ThisRef:32/?UI,From:32/?UI,To:32/?UI,(byte_size(Value_UC)):32/?UI,(Value_UC)/binary, 0:(((8- ((0+byte_size(Value_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxComboBox(), From::integer(), To::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxremove">external documentation</a>.
+-spec remove(This, From, To) -> ok when
+ This::wxComboBox(), From::integer(), To::integer().
remove(#wx_ref{type=ThisT,ref=ThisRef},From,To)
when is_integer(From),is_integer(To) ->
?CLASS(ThisT,wxComboBox),
wxe_util:cast(?wxComboBox_Remove,
<<ThisRef:32/?UI,From:32/?UI,To:32/?UI>>).
-%% @spec (This::wxComboBox(), Pos::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxsetinsertionpoint">external documentation</a>.
+-spec setInsertionPoint(This, Pos) -> ok when
+ This::wxComboBox(), Pos::integer().
setInsertionPoint(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxComboBox),
wxe_util:cast(?wxComboBox_SetInsertionPoint,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxComboBox()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxsetinsertionpointend">external documentation</a>.
+-spec setInsertionPointEnd(This) -> ok when
+ This::wxComboBox().
setInsertionPointEnd(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxComboBox),
wxe_util:cast(?wxComboBox_SetInsertionPointEnd,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxComboBox(), N::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxsetselection">external documentation</a>.
+-spec setSelection(This, N) -> ok when
+ This::wxComboBox(), N::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxComboBox),
wxe_util:cast(?wxComboBox_SetSelection_1,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxComboBox(), From::integer(), To::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxsetselection">external documentation</a>.
+-spec setSelection(This, From, To) -> ok when
+ This::wxComboBox(), From::integer(), To::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},From,To)
when is_integer(From),is_integer(To) ->
?CLASS(ThisT,wxComboBox),
wxe_util:cast(?wxComboBox_SetSelection_2,
<<ThisRef:32/?UI,From:32/?UI,To:32/?UI>>).
-%% @spec (This::wxComboBox(), Value::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxsetvalue">external documentation</a>.
+-spec setValue(This, Value) -> ok when
+ This::wxComboBox(), Value::unicode:chardata().
setValue(#wx_ref{type=ThisT,ref=ThisRef},Value)
when is_list(Value) ->
?CLASS(ThisT,wxComboBox),
@@ -276,15 +309,16 @@ setValue(#wx_ref{type=ThisT,ref=ThisRef},Value)
wxe_util:cast(?wxComboBox_SetValue,
<<ThisRef:32/?UI,(byte_size(Value_UC)):32/?UI,(Value_UC)/binary, 0:(((8- ((0+byte_size(Value_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxComboBox()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcombobox.html#wxcomboboxundo">external documentation</a>.
+-spec undo(This) -> ok when
+ This::wxComboBox().
undo(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxComboBox),
wxe_util:cast(?wxComboBox_Undo,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxComboBox()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxComboBox()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxComboBox),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxCommandEvent.erl b/lib/wx/src/gen/wxCommandEvent.erl
index 57fb9cecda..a7567163cf 100644
--- a/lib/wx/src/gen/wxCommandEvent.erl
+++ b/lib/wx/src/gen/wxCommandEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -38,69 +38,80 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxCommandEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxCommandEvent()) -> term()
+-type wxCommandEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcommandevent.html#wxcommandeventgetclientobject">external documentation</a>.
+-spec getClientData(This) -> term() when
+ This::wxCommandEvent().
getClientData(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCommandEvent),
wxe_util:call(?wxCommandEvent_getClientData,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCommandEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcommandevent.html#wxcommandeventgetextralong">external documentation</a>.
+-spec getExtraLong(This) -> integer() when
+ This::wxCommandEvent().
getExtraLong(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCommandEvent),
wxe_util:call(?wxCommandEvent_GetExtraLong,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCommandEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcommandevent.html#wxcommandeventgetint">external documentation</a>.
+-spec getInt(This) -> integer() when
+ This::wxCommandEvent().
getInt(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCommandEvent),
wxe_util:call(?wxCommandEvent_GetInt,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCommandEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcommandevent.html#wxcommandeventgetselection">external documentation</a>.
+-spec getSelection(This) -> integer() when
+ This::wxCommandEvent().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCommandEvent),
wxe_util:call(?wxCommandEvent_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCommandEvent()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcommandevent.html#wxcommandeventgetstring">external documentation</a>.
+-spec getString(This) -> unicode:charlist() when
+ This::wxCommandEvent().
getString(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCommandEvent),
wxe_util:call(?wxCommandEvent_GetString,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCommandEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcommandevent.html#wxcommandeventischecked">external documentation</a>.
+-spec isChecked(This) -> boolean() when
+ This::wxCommandEvent().
isChecked(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCommandEvent),
wxe_util:call(?wxCommandEvent_IsChecked,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCommandEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcommandevent.html#wxcommandeventisselection">external documentation</a>.
+-spec isSelection(This) -> boolean() when
+ This::wxCommandEvent().
isSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCommandEvent),
wxe_util:call(?wxCommandEvent_IsSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCommandEvent(), I::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcommandevent.html#wxcommandeventsetint">external documentation</a>.
+-spec setInt(This, I) -> ok when
+ This::wxCommandEvent(), I::integer().
setInt(#wx_ref{type=ThisT,ref=ThisRef},I)
when is_integer(I) ->
?CLASS(ThisT,wxCommandEvent),
wxe_util:cast(?wxCommandEvent_SetInt,
<<ThisRef:32/?UI,I:32/?UI>>).
-%% @spec (This::wxCommandEvent(), S::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcommandevent.html#wxcommandeventsetstring">external documentation</a>.
+-spec setString(This, S) -> ok when
+ This::wxCommandEvent(), S::unicode:chardata().
setString(#wx_ref{type=ThisT,ref=ThisRef},S)
when is_list(S) ->
?CLASS(ThisT,wxCommandEvent),
diff --git a/lib/wx/src/gen/wxContextMenuEvent.erl b/lib/wx/src/gen/wxContextMenuEvent.erl
index 0050b97b89..9312803e33 100644
--- a/lib/wx/src/gen/wxContextMenuEvent.erl
+++ b/lib/wx/src/gen/wxContextMenuEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -40,20 +40,24 @@
parent_class/1,resumePropagation/2,setInt/2,setString/2,shouldPropagate/1,
skip/1,skip/2,stopPropagation/1]).
+-export_type([wxContextMenuEvent/0]).
%% @hidden
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxContextMenuEvent()) -> {X::integer(), Y::integer()}
+-type wxContextMenuEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontextmenuevent.html#wxcontextmenueventgetposition">external documentation</a>.
+-spec getPosition(This) -> {X::integer(), Y::integer()} when
+ This::wxContextMenuEvent().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxContextMenuEvent),
wxe_util:call(?wxContextMenuEvent_GetPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxContextMenuEvent(), Pos::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontextmenuevent.html#wxcontextmenueventsetposition">external documentation</a>.
+-spec setPosition(This, Pos) -> ok when
+ This::wxContextMenuEvent(), Pos::{X::integer(), Y::integer()}.
setPosition(#wx_ref{type=ThisT,ref=ThisRef},{PosX,PosY})
when is_integer(PosX),is_integer(PosY) ->
?CLASS(ThisT,wxContextMenuEvent),
diff --git a/lib/wx/src/gen/wxControl.erl b/lib/wx/src/gen/wxControl.erl
index e3f602e65a..f840d0c6bc 100644
--- a/lib/wx/src/gen/wxControl.erl
+++ b/lib/wx/src/gen/wxControl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -68,20 +68,24 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxControl/0]).
%% @hidden
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxControl()) -> string()
+-type wxControl() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrol.html#wxcontrolgetlabel">external documentation</a>.
+-spec getLabel(This) -> unicode:charlist() when
+ This::wxControl().
getLabel(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxControl),
wxe_util:call(?wxControl_GetLabel,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxControl(), Label::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrol.html#wxcontrolsetlabel">external documentation</a>.
+-spec setLabel(This, Label) -> ok when
+ This::wxControl(), Label::unicode:chardata().
setLabel(#wx_ref{type=ThisT,ref=ThisRef},Label)
when is_list(Label) ->
?CLASS(ThisT,wxControl),
diff --git a/lib/wx/src/gen/wxControlWithItems.erl b/lib/wx/src/gen/wxControlWithItems.erl
index 0838b75bad..92632a1c31 100644
--- a/lib/wx/src/gen/wxControlWithItems.erl
+++ b/lib/wx/src/gen/wxControlWithItems.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -72,14 +72,17 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxControlWithItems/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxControlWithItems(), Item::string()) -> integer()
+-type wxControlWithItems() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemsappend">external documentation</a>.
+-spec append(This, Item) -> integer() when
+ This::wxControlWithItems(), Item::unicode:chardata().
append(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_list(Item) ->
?CLASS(ThisT,wxControlWithItems),
@@ -87,8 +90,9 @@ append(#wx_ref{type=ThisT,ref=ThisRef},Item)
wxe_util:call(?wxControlWithItems_Append_1,
<<ThisRef:32/?UI,(byte_size(Item_UC)):32/?UI,(Item_UC)/binary, 0:(((8- ((0+byte_size(Item_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxControlWithItems(), Item::string(), ClientData::term()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemsappend">external documentation</a>.
+-spec append(This, Item, ClientData) -> integer() when
+ This::wxControlWithItems(), Item::unicode:chardata(), ClientData::term().
append(#wx_ref{type=ThisT,ref=ThisRef},Item,ClientData)
when is_list(Item) ->
?CLASS(ThisT,wxControlWithItems),
@@ -97,8 +101,9 @@ append(#wx_ref{type=ThisT,ref=ThisRef},Item,ClientData)
wxe_util:call(?wxControlWithItems_Append_2,
<<ThisRef:32/?UI,(byte_size(Item_UC)):32/?UI,(Item_UC)/binary, 0:(((8- ((0+byte_size(Item_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxControlWithItems(), Strings::[[string()]]) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemsappend">external documentation</a>.
+-spec appendStrings(This, Strings) -> ok when
+ This::wxControlWithItems(), Strings::[unicode:chardata()].
appendStrings(#wx_ref{type=ThisT,ref=ThisRef},Strings)
when is_list(Strings) ->
?CLASS(ThisT,wxControlWithItems),
@@ -107,30 +112,35 @@ appendStrings(#wx_ref{type=ThisT,ref=ThisRef},Strings)
wxe_util:cast(?wxControlWithItems_appendStrings_1,
<<ThisRef:32/?UI,(length(Strings_UCA)):32/?UI, (<< <<(byte_size(UC_Str)):32/?UI, UC_Str/binary>>|| UC_Str <- Strings_UCA>>)/binary, 0:(((8- ((0 + lists:sum([byte_size(S)+4||S<-Strings_UCA])) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxControlWithItems()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemsclear">external documentation</a>.
+-spec clear(This) -> ok when
+ This::wxControlWithItems().
clear(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxControlWithItems),
wxe_util:cast(?wxControlWithItems_Clear,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxControlWithItems(), N::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemsdelete">external documentation</a>.
+-spec delete(This, N) -> ok when
+ This::wxControlWithItems(), N::integer().
delete(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxControlWithItems),
wxe_util:cast(?wxControlWithItems_Delete,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxControlWithItems(), S::string()) -> integer()
%% @equiv findString(This,S, [])
+-spec findString(This, S) -> integer() when
+ This::wxControlWithItems(), S::unicode:chardata().
+
findString(This,S)
when is_record(This, wx_ref),is_list(S) ->
findString(This,S, []).
-%% @spec (This::wxControlWithItems(), S::string(), [Option]) -> integer()
-%% Option = {bCase, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemsfindstring">external documentation</a>.
+-spec findString(This, S, [Option]) -> integer() when
+ This::wxControlWithItems(), S::unicode:chardata(),
+ Option :: {bCase, boolean()}.
findString(#wx_ref{type=ThisT,ref=ThisRef},S, Options)
when is_list(S),is_list(Options) ->
?CLASS(ThisT,wxControlWithItems),
@@ -141,16 +151,18 @@ findString(#wx_ref{type=ThisT,ref=ThisRef},S, Options)
wxe_util:call(?wxControlWithItems_FindString,
<<ThisRef:32/?UI,(byte_size(S_UC)):32/?UI,(S_UC)/binary, 0:(((8- ((0+byte_size(S_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxControlWithItems(), N::integer()) -> term()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemsgetclientobject">external documentation</a>.
+-spec getClientData(This, N) -> term() when
+ This::wxControlWithItems(), N::integer().
getClientData(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxControlWithItems),
wxe_util:call(?wxControlWithItems_getClientData,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxControlWithItems(), N::integer(), ClientData::term()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemssetclientobject">external documentation</a>.
+-spec setClientData(This, N, ClientData) -> ok when
+ This::wxControlWithItems(), N::integer(), ClientData::term().
setClientData(#wx_ref{type=ThisT,ref=ThisRef},N,ClientData)
when is_integer(N) ->
?CLASS(ThisT,wxControlWithItems),
@@ -158,37 +170,42 @@ setClientData(#wx_ref{type=ThisT,ref=ThisRef},N,ClientData)
wxe_util:cast(?wxControlWithItems_setClientData,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxControlWithItems()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemsgetcount">external documentation</a>.
+-spec getCount(This) -> integer() when
+ This::wxControlWithItems().
getCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxControlWithItems),
wxe_util:call(?wxControlWithItems_GetCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxControlWithItems()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemsgetselection">external documentation</a>.
+-spec getSelection(This) -> integer() when
+ This::wxControlWithItems().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxControlWithItems),
wxe_util:call(?wxControlWithItems_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxControlWithItems(), N::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemsgetstring">external documentation</a>.
+-spec getString(This, N) -> unicode:charlist() when
+ This::wxControlWithItems(), N::integer().
getString(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxControlWithItems),
wxe_util:call(?wxControlWithItems_GetString,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxControlWithItems()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemsgetstringselection">external documentation</a>.
+-spec getStringSelection(This) -> unicode:charlist() when
+ This::wxControlWithItems().
getStringSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxControlWithItems),
wxe_util:call(?wxControlWithItems_GetStringSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxControlWithItems(), Item::string(), Pos::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemsinsert">external documentation</a>.
+-spec insert(This, Item, Pos) -> integer() when
+ This::wxControlWithItems(), Item::unicode:chardata(), Pos::integer().
insert(#wx_ref{type=ThisT,ref=ThisRef},Item,Pos)
when is_list(Item),is_integer(Pos) ->
?CLASS(ThisT,wxControlWithItems),
@@ -196,8 +213,9 @@ insert(#wx_ref{type=ThisT,ref=ThisRef},Item,Pos)
wxe_util:call(?wxControlWithItems_Insert_2,
<<ThisRef:32/?UI,(byte_size(Item_UC)):32/?UI,(Item_UC)/binary, 0:(((8- ((0+byte_size(Item_UC)) band 16#7)) band 16#7))/unit:8,Pos:32/?UI>>).
-%% @spec (This::wxControlWithItems(), Item::string(), Pos::integer(), ClientData::term()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemsinsert">external documentation</a>.
+-spec insert(This, Item, Pos, ClientData) -> integer() when
+ This::wxControlWithItems(), Item::unicode:chardata(), Pos::integer(), ClientData::term().
insert(#wx_ref{type=ThisT,ref=ThisRef},Item,Pos,ClientData)
when is_list(Item),is_integer(Pos) ->
?CLASS(ThisT,wxControlWithItems),
@@ -206,31 +224,35 @@ insert(#wx_ref{type=ThisT,ref=ThisRef},Item,Pos,ClientData)
wxe_util:call(?wxControlWithItems_Insert_3,
<<ThisRef:32/?UI,(byte_size(Item_UC)):32/?UI,(Item_UC)/binary, 0:(((8- ((0+byte_size(Item_UC)) band 16#7)) band 16#7))/unit:8,Pos:32/?UI>>).
-%% @spec (This::wxControlWithItems()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemsisempty">external documentation</a>.
+-spec isEmpty(This) -> boolean() when
+ This::wxControlWithItems().
isEmpty(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxControlWithItems),
wxe_util:call(?wxControlWithItems_IsEmpty,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxControlWithItems(), N::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemsselect">external documentation</a>.
+-spec select(This, N) -> ok when
+ This::wxControlWithItems(), N::integer().
select(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxControlWithItems),
wxe_util:cast(?wxControlWithItems_Select,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxControlWithItems(), N::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemssetselection">external documentation</a>.
+-spec setSelection(This, N) -> ok when
+ This::wxControlWithItems(), N::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxControlWithItems),
wxe_util:cast(?wxControlWithItems_SetSelection,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxControlWithItems(), N::integer(), S::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemssetstring">external documentation</a>.
+-spec setString(This, N, S) -> ok when
+ This::wxControlWithItems(), N::integer(), S::unicode:chardata().
setString(#wx_ref{type=ThisT,ref=ThisRef},N,S)
when is_integer(N),is_list(S) ->
?CLASS(ThisT,wxControlWithItems),
@@ -238,8 +260,9 @@ setString(#wx_ref{type=ThisT,ref=ThisRef},N,S)
wxe_util:cast(?wxControlWithItems_SetString,
<<ThisRef:32/?UI,N:32/?UI,(byte_size(S_UC)):32/?UI,(S_UC)/binary, 0:(((8- ((4+byte_size(S_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxControlWithItems(), S::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcontrolwithitems.html#wxcontrolwithitemssetstringselection">external documentation</a>.
+-spec setStringSelection(This, S) -> boolean() when
+ This::wxControlWithItems(), S::unicode:chardata().
setStringSelection(#wx_ref{type=ThisT,ref=ThisRef},S)
when is_list(S) ->
?CLASS(ThisT,wxControlWithItems),
diff --git a/lib/wx/src/gen/wxCursor.erl b/lib/wx/src/gen/wxCursor.erl
index beb731fee3..b9e3a8e3f7 100644
--- a/lib/wx/src/gen/wxCursor.erl
+++ b/lib/wx/src/gen/wxCursor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -34,25 +34,27 @@
getSubBitmap/2,getWidth/1,loadFile/2,loadFile/3,parent_class/1,saveFile/3,
saveFile/4,setDepth/2,setHeight/2,setMask/2,setPalette/2,setWidth/2]).
+-export_type([wxCursor/0]).
%% @hidden
parent_class(wxBitmap) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxCursor()
+-type wxCursor() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcursor.html#wxcursorwxcursor">external documentation</a>.
+-spec new() -> wxCursor().
new() ->
wxe_util:construct(?wxCursor_new_0,
<<>>).
-%% @spec (X::integer()|term()) -> wxCursor()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcursor.html#wxcursorwxcursor">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(CursorId::integer()) -> wxCursor() </c>
-%% </p>
-%% <p><c>
-%% new(Image::wxImage:wxImage()) -> wxCursor() </c>
-%% </p>
+%% <br /> Also:<br />
+%% new(Image) -> wxCursor() when<br />
+%% Image::wxImage:wxImage().<br />
+%%
+-spec new(CursorId) -> wxCursor() when
+ CursorId::integer();
+ (Image) -> wxCursor() when
+ Image::wxImage:wxImage().
new(CursorId)
when is_integer(CursorId) ->
wxe_util:construct(?wxCursor_new_1_0,
@@ -62,15 +64,19 @@ new(#wx_ref{type=ImageT,ref=ImageRef}) ->
wxe_util:construct(?wxCursor_new_1_1,
<<ImageRef:32/?UI>>).
-%% @spec (Bits::binary(), Width::integer(), Height::integer()) -> wxCursor()
%% @equiv new(Bits,Width,Height, [])
+-spec new(Bits, Width, Height) -> wxCursor() when
+ Bits::binary(), Width::integer(), Height::integer().
+
new(Bits,Width,Height)
when is_binary(Bits),is_integer(Width),is_integer(Height) ->
new(Bits,Width,Height, []).
-%% @spec (Bits::binary(), Width::integer(), Height::integer(), [Option]) -> wxCursor()
-%% Option = {hotSpotX, integer()} | {hotSpotY, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcursor.html#wxcursorwxcursor">external documentation</a>.
+-spec new(Bits, Width, Height, [Option]) -> wxCursor() when
+ Bits::binary(), Width::integer(), Height::integer(),
+ Option :: {hotSpotX, integer()}
+ | {hotSpotY, integer()}.
new(Bits,Width,Height, Options)
when is_binary(Bits),is_integer(Width),is_integer(Height),is_list(Options) ->
wxe_util:send_bin(Bits),
@@ -81,15 +87,16 @@ new(Bits,Width,Height, Options)
wxe_util:construct(?wxCursor_new_4,
<<Width:32/?UI,Height:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxCursor()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxcursor.html#wxcursorok">external documentation</a>.
+-spec ok(This) -> boolean() when
+ This::wxCursor().
ok(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxCursor),
wxe_util:call(?wxCursor_Ok,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxCursor()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxCursor()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxCursor),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxDC.erl b/lib/wx/src/gen/wxDC.erl
index ba498c651a..9f57978849 100644
--- a/lib/wx/src/gen/wxDC.erl
+++ b/lib/wx/src/gen/wxDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -32,10 +32,10 @@
drawPoint/2,drawPolygon/2,drawPolygon/3,drawRectangle/2,drawRectangle/3,
drawRotatedText/4,drawRoundedRectangle/3,drawRoundedRectangle/4,
drawText/3,endDoc/1,endPage/1,floodFill/3,floodFill/4,getBackground/1,
- getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/2,
+ getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/1,
getFont/1,getLayoutDirection/1,getLogicalFunction/1,getMapMode/1,
- getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/3,
- getPen/1,getPixel/3,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
+ getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/2,
+ getPen/1,getPixel/2,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
getTextExtent/3,getTextForeground/1,getUserScale/1,gradientFillConcentric/4,
gradientFillConcentric/5,gradientFillLinear/4,gradientFillLinear/5,
isOk/1,logicalToDeviceX/2,logicalToDeviceXRel/2,logicalToDeviceY/2,
@@ -49,18 +49,25 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxDC/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxDC(), DestPt::{X::integer(), Y::integer()}, Sz::{W::integer(), H::integer()}, Source::wxDC(), SrcPt::{X::integer(), Y::integer()}) -> bool()
+-type wxDC() :: wx:wx_object().
%% @equiv blit(This,DestPt,Sz,Source,SrcPt, [])
+-spec blit(This, DestPt, Sz, Source, SrcPt) -> boolean() when
+ This::wxDC(), DestPt::{X::integer(), Y::integer()}, Sz::{W::integer(), H::integer()}, Source::wxDC(), SrcPt::{X::integer(), Y::integer()}.
+
blit(This,DestPt={DestPtX,DestPtY},Sz={SzW,SzH},Source,SrcPt={SrcPtX,SrcPtY})
when is_record(This, wx_ref),is_integer(DestPtX),is_integer(DestPtY),is_integer(SzW),is_integer(SzH),is_record(Source, wx_ref),is_integer(SrcPtX),is_integer(SrcPtY) ->
blit(This,DestPt,Sz,Source,SrcPt, []).
-%% @spec (This::wxDC(), DestPt::{X::integer(), Y::integer()}, Sz::{W::integer(), H::integer()}, Source::wxDC(), SrcPt::{X::integer(), Y::integer()}, [Option]) -> bool()
-%% Option = {rop, integer()} | {useMask, bool()} | {srcPtMask, {X::integer(), Y::integer()}}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcblit">external documentation</a>.
+-spec blit(This, DestPt, Sz, Source, SrcPt, [Option]) -> boolean() when
+ This::wxDC(), DestPt::{X::integer(), Y::integer()}, Sz::{W::integer(), H::integer()}, Source::wxDC(), SrcPt::{X::integer(), Y::integer()},
+ Option :: {rop, integer()}
+ | {useMask, boolean()}
+ | {srcPtMask, {X::integer(), Y::integer()}}.
blit(#wx_ref{type=ThisT,ref=ThisRef},{DestPtX,DestPtY},{SzW,SzH},#wx_ref{type=SourceT,ref=SourceRef},{SrcPtX,SrcPtY}, Options)
when is_integer(DestPtX),is_integer(DestPtY),is_integer(SzW),is_integer(SzH),is_integer(SrcPtX),is_integer(SrcPtY),is_list(Options) ->
?CLASS(ThisT,wxDC),
@@ -73,92 +80,105 @@ blit(#wx_ref{type=ThisT,ref=ThisRef},{DestPtX,DestPtY},{SzW,SzH},#wx_ref{type=So
wxe_util:call(?wxDC_Blit,
<<ThisRef:32/?UI,DestPtX:32/?UI,DestPtY:32/?UI,SzW:32/?UI,SzH:32/?UI,SourceRef:32/?UI,SrcPtX:32/?UI,SrcPtY:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxDC(), X::integer(), Y::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdccalcboundingbox">external documentation</a>.
+-spec calcBoundingBox(This, X, Y) -> ok when
+ This::wxDC(), X::integer(), Y::integer().
calcBoundingBox(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_CalcBoundingBox,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxDC()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcclear">external documentation</a>.
+-spec clear(This) -> ok when
+ This::wxDC().
clear(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_Clear,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdccomputescaleandorigin">external documentation</a>.
+-spec computeScaleAndOrigin(This) -> ok when
+ This::wxDC().
computeScaleAndOrigin(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_ComputeScaleAndOrigin,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC(), Pt::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdccrosshair">external documentation</a>.
+-spec crossHair(This, Pt) -> ok when
+ This::wxDC(), Pt::{X::integer(), Y::integer()}.
crossHair(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_CrossHair,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxDC()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdestroyclippingregion">external documentation</a>.
+-spec destroyClippingRegion(This) -> ok when
+ This::wxDC().
destroyClippingRegion(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_DestroyClippingRegion,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC(), X::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdevicetologicalx">external documentation</a>.
+-spec deviceToLogicalX(This, X) -> integer() when
+ This::wxDC(), X::integer().
deviceToLogicalX(#wx_ref{type=ThisT,ref=ThisRef},X)
when is_integer(X) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_DeviceToLogicalX,
<<ThisRef:32/?UI,X:32/?UI>>).
-%% @spec (This::wxDC(), X::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdevicetologicalxrel">external documentation</a>.
+-spec deviceToLogicalXRel(This, X) -> integer() when
+ This::wxDC(), X::integer().
deviceToLogicalXRel(#wx_ref{type=ThisT,ref=ThisRef},X)
when is_integer(X) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_DeviceToLogicalXRel,
<<ThisRef:32/?UI,X:32/?UI>>).
-%% @spec (This::wxDC(), Y::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdevicetologicaly">external documentation</a>.
+-spec deviceToLogicalY(This, Y) -> integer() when
+ This::wxDC(), Y::integer().
deviceToLogicalY(#wx_ref{type=ThisT,ref=ThisRef},Y)
when is_integer(Y) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_DeviceToLogicalY,
<<ThisRef:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxDC(), Y::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdevicetologicalyrel">external documentation</a>.
+-spec deviceToLogicalYRel(This, Y) -> integer() when
+ This::wxDC(), Y::integer().
deviceToLogicalYRel(#wx_ref{type=ThisT,ref=ThisRef},Y)
when is_integer(Y) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_DeviceToLogicalYRel,
<<ThisRef:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxDC(), Pt1::{X::integer(), Y::integer()}, Pt2::{X::integer(), Y::integer()}, Centre::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawarc">external documentation</a>.
+-spec drawArc(This, Pt1, Pt2, Centre) -> ok when
+ This::wxDC(), Pt1::{X::integer(), Y::integer()}, Pt2::{X::integer(), Y::integer()}, Centre::{X::integer(), Y::integer()}.
drawArc(#wx_ref{type=ThisT,ref=ThisRef},{Pt1X,Pt1Y},{Pt2X,Pt2Y},{CentreX,CentreY})
when is_integer(Pt1X),is_integer(Pt1Y),is_integer(Pt2X),is_integer(Pt2Y),is_integer(CentreX),is_integer(CentreY) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_DrawArc,
<<ThisRef:32/?UI,Pt1X:32/?UI,Pt1Y:32/?UI,Pt2X:32/?UI,Pt2Y:32/?UI,CentreX:32/?UI,CentreY:32/?UI>>).
-%% @spec (This::wxDC(), Bmp::wxBitmap:wxBitmap(), Pt::{X::integer(), Y::integer()}) -> ok
%% @equiv drawBitmap(This,Bmp,Pt, [])
+-spec drawBitmap(This, Bmp, Pt) -> ok when
+ This::wxDC(), Bmp::wxBitmap:wxBitmap(), Pt::{X::integer(), Y::integer()}.
+
drawBitmap(This,Bmp,Pt={PtX,PtY})
when is_record(This, wx_ref),is_record(Bmp, wx_ref),is_integer(PtX),is_integer(PtY) ->
drawBitmap(This,Bmp,Pt, []).
-%% @spec (This::wxDC(), Bmp::wxBitmap:wxBitmap(), Pt::{X::integer(), Y::integer()}, [Option]) -> ok
-%% Option = {useMask, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawbitmap">external documentation</a>.
+-spec drawBitmap(This, Bmp, Pt, [Option]) -> ok when
+ This::wxDC(), Bmp::wxBitmap:wxBitmap(), Pt::{X::integer(), Y::integer()},
+ Option :: {useMask, boolean()}.
drawBitmap(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BmpT,ref=BmpRef},{PtX,PtY}, Options)
when is_integer(PtX),is_integer(PtY),is_list(Options) ->
?CLASS(ThisT,wxDC),
@@ -169,48 +189,54 @@ drawBitmap(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BmpT,ref=BmpRef},{PtX,Pt
wxe_util:cast(?wxDC_DrawBitmap,
<<ThisRef:32/?UI,BmpRef:32/?UI,PtX:32/?UI,PtY:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawcheckmark">external documentation</a>.
+-spec drawCheckMark(This, Rect) -> ok when
+ This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
drawCheckMark(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_DrawCheckMark,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxDC(), Pt::{X::integer(), Y::integer()}, Radius::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawcircle">external documentation</a>.
+-spec drawCircle(This, Pt, Radius) -> ok when
+ This::wxDC(), Pt::{X::integer(), Y::integer()}, Radius::integer().
drawCircle(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY},Radius)
when is_integer(PtX),is_integer(PtY),is_integer(Radius) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_DrawCircle,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI,Radius:32/?UI>>).
-%% @spec (This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawellipse">external documentation</a>.
+-spec drawEllipse(This, Rect) -> ok when
+ This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
drawEllipse(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_DrawEllipse_1,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxDC(), Pt::{X::integer(), Y::integer()}, Sz::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawellipse">external documentation</a>.
+-spec drawEllipse(This, Pt, Sz) -> ok when
+ This::wxDC(), Pt::{X::integer(), Y::integer()}, Sz::{W::integer(), H::integer()}.
drawEllipse(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY},{SzW,SzH})
when is_integer(PtX),is_integer(PtY),is_integer(SzW),is_integer(SzH) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_DrawEllipse_2,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI,SzW:32/?UI,SzH:32/?UI>>).
-%% @spec (This::wxDC(), Pt::{X::integer(), Y::integer()}, Sz::{W::integer(), H::integer()}, Sa::float(), Ea::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawellipticarc">external documentation</a>.
+-spec drawEllipticArc(This, Pt, Sz, Sa, Ea) -> ok when
+ This::wxDC(), Pt::{X::integer(), Y::integer()}, Sz::{W::integer(), H::integer()}, Sa::number(), Ea::number().
drawEllipticArc(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY},{SzW,SzH},Sa,Ea)
- when is_integer(PtX),is_integer(PtY),is_integer(SzW),is_integer(SzH),is_float(Sa),is_float(Ea) ->
+ when is_integer(PtX),is_integer(PtY),is_integer(SzW),is_integer(SzH),is_number(Sa),is_number(Ea) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_DrawEllipticArc,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI,SzW:32/?UI,SzH:32/?UI,0:32,Sa:64/?F,Ea:64/?F>>).
-%% @spec (This::wxDC(), Icon::wxIcon:wxIcon(), Pt::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawicon">external documentation</a>.
+-spec drawIcon(This, Icon, Pt) -> ok when
+ This::wxDC(), Icon::wxIcon:wxIcon(), Pt::{X::integer(), Y::integer()}.
drawIcon(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=IconT,ref=IconRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxDC),
@@ -218,15 +244,19 @@ drawIcon(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=IconT,ref=IconRef},{PtX,Pt
wxe_util:cast(?wxDC_DrawIcon,
<<ThisRef:32/?UI,IconRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxDC(), Text::string(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> ok
%% @equiv drawLabel(This,Text,Rect, [])
+-spec drawLabel(This, Text, Rect) -> ok when
+ This::wxDC(), Text::unicode:chardata(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
+
drawLabel(This,Text,Rect={RectX,RectY,RectW,RectH})
when is_record(This, wx_ref),is_list(Text),is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) ->
drawLabel(This,Text,Rect, []).
-%% @spec (This::wxDC(), Text::string(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, [Option]) -> ok
-%% Option = {alignment, integer()} | {indexAccel, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawlabel">external documentation</a>.
+-spec drawLabel(This, Text, Rect, [Option]) -> ok when
+ This::wxDC(), Text::unicode:chardata(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()},
+ Option :: {alignment, integer()}
+ | {indexAccel, integer()}.
drawLabel(#wx_ref{type=ThisT,ref=ThisRef},Text,{RectX,RectY,RectW,RectH}, Options)
when is_list(Text),is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH),is_list(Options) ->
?CLASS(ThisT,wxDC),
@@ -238,23 +268,28 @@ drawLabel(#wx_ref{type=ThisT,ref=ThisRef},Text,{RectX,RectY,RectW,RectH}, Option
wxe_util:cast(?wxDC_DrawLabel,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxDC(), Pt1::{X::integer(), Y::integer()}, Pt2::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawline">external documentation</a>.
+-spec drawLine(This, Pt1, Pt2) -> ok when
+ This::wxDC(), Pt1::{X::integer(), Y::integer()}, Pt2::{X::integer(), Y::integer()}.
drawLine(#wx_ref{type=ThisT,ref=ThisRef},{Pt1X,Pt1Y},{Pt2X,Pt2Y})
when is_integer(Pt1X),is_integer(Pt1Y),is_integer(Pt2X),is_integer(Pt2Y) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_DrawLine,
<<ThisRef:32/?UI,Pt1X:32/?UI,Pt1Y:32/?UI,Pt2X:32/?UI,Pt2Y:32/?UI>>).
-%% @spec (This::wxDC(), Points::[{X::integer(), Y::integer()}]) -> ok
%% @equiv drawLines(This,Points, [])
+-spec drawLines(This, Points) -> ok when
+ This::wxDC(), Points::[{X::integer(), Y::integer()}].
+
drawLines(This,Points)
when is_record(This, wx_ref),is_list(Points) ->
drawLines(This,Points, []).
-%% @spec (This::wxDC(), Points::[{X::integer(), Y::integer()}], [Option]) -> ok
-%% Option = {xoffset, integer()} | {yoffset, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawlines">external documentation</a>.
+-spec drawLines(This, Points, [Option]) -> ok when
+ This::wxDC(), Points::[{X::integer(), Y::integer()}],
+ Option :: {xoffset, integer()}
+ | {yoffset, integer()}.
drawLines(#wx_ref{type=ThisT,ref=ThisRef},Points, Options)
when is_list(Points),is_list(Options) ->
?CLASS(ThisT,wxDC),
@@ -266,15 +301,20 @@ drawLines(#wx_ref{type=ThisT,ref=ThisRef},Points, Options)
<<ThisRef:32/?UI,(length(Points)):32/?UI,
(<< <<X:32/?I,Y:32/?I>> || {X,Y} <- Points>>)/binary, BinOpt/binary>>).
-%% @spec (This::wxDC(), Points::[{X::integer(), Y::integer()}]) -> ok
%% @equiv drawPolygon(This,Points, [])
+-spec drawPolygon(This, Points) -> ok when
+ This::wxDC(), Points::[{X::integer(), Y::integer()}].
+
drawPolygon(This,Points)
when is_record(This, wx_ref),is_list(Points) ->
drawPolygon(This,Points, []).
-%% @spec (This::wxDC(), Points::[{X::integer(), Y::integer()}], [Option]) -> ok
-%% Option = {xoffset, integer()} | {yoffset, integer()} | {fillStyle, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawpolygon">external documentation</a>.
+-spec drawPolygon(This, Points, [Option]) -> ok when
+ This::wxDC(), Points::[{X::integer(), Y::integer()}],
+ Option :: {xoffset, integer()}
+ | {yoffset, integer()}
+ | {fillStyle, integer()}.
drawPolygon(#wx_ref{type=ThisT,ref=ThisRef},Points, Options)
when is_list(Points),is_list(Options) ->
?CLASS(ThisT,wxDC),
@@ -287,57 +327,64 @@ drawPolygon(#wx_ref{type=ThisT,ref=ThisRef},Points, Options)
<<ThisRef:32/?UI,(length(Points)):32/?UI,
(<< <<X:32/?I,Y:32/?I>> || {X,Y} <- Points>>)/binary, BinOpt/binary>>).
-%% @spec (This::wxDC(), Pt::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawpoint">external documentation</a>.
+-spec drawPoint(This, Pt) -> ok when
+ This::wxDC(), Pt::{X::integer(), Y::integer()}.
drawPoint(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_DrawPoint,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawrectangle">external documentation</a>.
+-spec drawRectangle(This, Rect) -> ok when
+ This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
drawRectangle(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_DrawRectangle_1,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxDC(), Pt::{X::integer(), Y::integer()}, Sz::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawrectangle">external documentation</a>.
+-spec drawRectangle(This, Pt, Sz) -> ok when
+ This::wxDC(), Pt::{X::integer(), Y::integer()}, Sz::{W::integer(), H::integer()}.
drawRectangle(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY},{SzW,SzH})
when is_integer(PtX),is_integer(PtY),is_integer(SzW),is_integer(SzH) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_DrawRectangle_2,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI,SzW:32/?UI,SzH:32/?UI>>).
-%% @spec (This::wxDC(), Text::string(), Pt::{X::integer(), Y::integer()}, Angle::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawrotatedtext">external documentation</a>.
+-spec drawRotatedText(This, Text, Pt, Angle) -> ok when
+ This::wxDC(), Text::unicode:chardata(), Pt::{X::integer(), Y::integer()}, Angle::number().
drawRotatedText(#wx_ref{type=ThisT,ref=ThisRef},Text,{PtX,PtY},Angle)
- when is_list(Text),is_integer(PtX),is_integer(PtY),is_float(Angle) ->
+ when is_list(Text),is_integer(PtX),is_integer(PtY),is_number(Angle) ->
?CLASS(ThisT,wxDC),
Text_UC = unicode:characters_to_binary([Text,0]),
wxe_util:cast(?wxDC_DrawRotatedText,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,PtX:32/?UI,PtY:32/?UI,Angle:64/?F>>).
-%% @spec (This::wxDC(), R::{X::integer(), Y::integer(), W::integer(), H::integer()}, Radius::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawroundedrectangle">external documentation</a>.
+-spec drawRoundedRectangle(This, R, Radius) -> ok when
+ This::wxDC(), R::{X::integer(), Y::integer(), W::integer(), H::integer()}, Radius::number().
drawRoundedRectangle(#wx_ref{type=ThisT,ref=ThisRef},{RX,RY,RW,RH},Radius)
- when is_integer(RX),is_integer(RY),is_integer(RW),is_integer(RH),is_float(Radius) ->
+ when is_integer(RX),is_integer(RY),is_integer(RW),is_integer(RH),is_number(Radius) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_DrawRoundedRectangle_2,
<<ThisRef:32/?UI,RX:32/?UI,RY:32/?UI,RW:32/?UI,RH:32/?UI,0:32,Radius:64/?F>>).
-%% @spec (This::wxDC(), Pt::{X::integer(), Y::integer()}, Sz::{W::integer(), H::integer()}, Radius::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawroundedrectangle">external documentation</a>.
+-spec drawRoundedRectangle(This, Pt, Sz, Radius) -> ok when
+ This::wxDC(), Pt::{X::integer(), Y::integer()}, Sz::{W::integer(), H::integer()}, Radius::number().
drawRoundedRectangle(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY},{SzW,SzH},Radius)
- when is_integer(PtX),is_integer(PtY),is_integer(SzW),is_integer(SzH),is_float(Radius) ->
+ when is_integer(PtX),is_integer(PtY),is_integer(SzW),is_integer(SzH),is_number(Radius) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_DrawRoundedRectangle_3,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI,SzW:32/?UI,SzH:32/?UI,0:32,Radius:64/?F>>).
-%% @spec (This::wxDC(), Text::string(), Pt::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcdrawtext">external documentation</a>.
+-spec drawText(This, Text, Pt) -> ok when
+ This::wxDC(), Text::unicode:chardata(), Pt::{X::integer(), Y::integer()}.
drawText(#wx_ref{type=ThisT,ref=ThisRef},Text,{PtX,PtY})
when is_list(Text),is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxDC),
@@ -345,29 +392,34 @@ drawText(#wx_ref{type=ThisT,ref=ThisRef},Text,{PtX,PtY})
wxe_util:cast(?wxDC_DrawText,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxDC()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcenddoc">external documentation</a>.
+-spec endDoc(This) -> ok when
+ This::wxDC().
endDoc(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_EndDoc,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcendpage">external documentation</a>.
+-spec endPage(This) -> ok when
+ This::wxDC().
endPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_EndPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC(), Pt::{X::integer(), Y::integer()}, Col::wx:colour()) -> bool()
%% @equiv floodFill(This,Pt,Col, [])
+-spec floodFill(This, Pt, Col) -> boolean() when
+ This::wxDC(), Pt::{X::integer(), Y::integer()}, Col::wx:wx_colour().
+
floodFill(This,Pt={PtX,PtY},Col)
when is_record(This, wx_ref),is_integer(PtX),is_integer(PtY),tuple_size(Col) =:= 3; tuple_size(Col) =:= 4 ->
floodFill(This,Pt,Col, []).
-%% @spec (This::wxDC(), Pt::{X::integer(), Y::integer()}, Col::wx:colour(), [Option]) -> bool()
-%% Option = {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcfloodfill">external documentation</a>.
+-spec floodFill(This, Pt, Col, [Option]) -> boolean() when
+ This::wxDC(), Pt::{X::integer(), Y::integer()}, Col::wx:wx_colour(),
+ Option :: {style, integer()}.
floodFill(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY},Col, Options)
when is_integer(PtX),is_integer(PtY),tuple_size(Col) =:= 3; tuple_size(Col) =:= 4,is_list(Options) ->
?CLASS(ThisT,wxDC),
@@ -377,81 +429,91 @@ floodFill(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY},Col, Options)
wxe_util:call(?wxDC_FloodFill,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI,(wxe_util:colour_bin(Col)):16/binary, 0:32,BinOpt/binary>>).
-%% @spec (This::wxDC()) -> wxBrush:wxBrush()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetbackground">external documentation</a>.
+-spec getBackground(This) -> wxBrush:wxBrush() when
+ This::wxDC().
getBackground(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetBackground,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetbackgroundmode">external documentation</a>.
+-spec getBackgroundMode(This) -> integer() when
+ This::wxDC().
getBackgroundMode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetBackgroundMode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> wxBrush:wxBrush()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetbrush">external documentation</a>.
+-spec getBrush(This) -> wxBrush:wxBrush() when
+ This::wxDC().
getBrush(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetBrush,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetcharheight">external documentation</a>.
+-spec getCharHeight(This) -> integer() when
+ This::wxDC().
getCharHeight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetCharHeight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetcharwidth">external documentation</a>.
+-spec getCharWidth(This) -> integer() when
+ This::wxDC().
getCharWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetCharWidth,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetclippingbox">external documentation</a>.
-getClippingBox(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
- when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) ->
+-spec getClippingBox(This) -> Result when
+ Result ::{X::integer(), Y::integer(), W::integer(), H::integer()},
+ This::wxDC().
+getClippingBox(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
- wxe_util:cast(?wxDC_GetClippingBox,
- <<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
+ wxe_util:call(?wxDC_GetClippingBox,
+ <<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> wxFont:wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetfont">external documentation</a>.
+-spec getFont(This) -> wxFont:wxFont() when
+ This::wxDC().
getFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> WxLayoutDirection
-%% WxLayoutDirection = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetlayoutdirection">external documentation</a>.
-%%<br /> WxLayoutDirection is one of ?wxLayout_Default | ?wxLayout_LeftToRight | ?wxLayout_RightToLeft
+%%<br /> Res = ?wxLayout_Default | ?wxLayout_LeftToRight | ?wxLayout_RightToLeft
+-spec getLayoutDirection(This) -> wx:wx_enum() when
+ This::wxDC().
getLayoutDirection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetLayoutDirection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetlogicalfunction">external documentation</a>.
+-spec getLogicalFunction(This) -> integer() when
+ This::wxDC().
getLogicalFunction(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetLogicalFunction,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetmapmode">external documentation</a>.
+-spec getMapMode(This) -> integer() when
+ This::wxDC().
getMapMode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetMapMode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC(), String::string()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetmultilinetextextent">external documentation</a>.
+-spec getMultiLineTextExtent(This, String) -> {W::integer(), H::integer()} when
+ This::wxDC(), String::unicode:chardata().
getMultiLineTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String)
when is_list(String) ->
?CLASS(ThisT,wxDC),
@@ -459,9 +521,10 @@ getMultiLineTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String)
wxe_util:call(?wxDC_GetMultiLineTextExtent_1,
<<ThisRef:32/?UI,(byte_size(String_UC)):32/?UI,(String_UC)/binary, 0:(((8- ((0+byte_size(String_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxDC(), String::string(), [Option]) -> {Width::integer(), Height::integer(), HeightLine::integer()}
-%% Option = {font, wxFont:wxFont()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetmultilinetextextent">external documentation</a>.
+-spec getMultiLineTextExtent(This, String, [Option]) -> {Width::integer(), Height::integer(), HeightLine::integer()} when
+ This::wxDC(), String::unicode:chardata(),
+ Option :: {font, wxFont:wxFont()}.
getMultiLineTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String, Options)
when is_list(String),is_list(Options) ->
?CLASS(ThisT,wxDC),
@@ -472,61 +535,70 @@ getMultiLineTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String, Options)
wxe_util:call(?wxDC_GetMultiLineTextExtent_4,
<<ThisRef:32/?UI,(byte_size(String_UC)):32/?UI,(String_UC)/binary, 0:(((8- ((0+byte_size(String_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxDC(), Text::string(), Widths::[integer()]) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetpartialtextextents">external documentation</a>.
-getPartialTextExtents(#wx_ref{type=ThisT,ref=ThisRef},Text,Widths)
- when is_list(Text),is_list(Widths) ->
+-spec getPartialTextExtents(This, Text) -> Result when
+ Result ::{Res ::boolean(), Widths::[integer()]},
+ This::wxDC(), Text::unicode:chardata().
+getPartialTextExtents(#wx_ref{type=ThisT,ref=ThisRef},Text)
+ when is_list(Text) ->
?CLASS(ThisT,wxDC),
Text_UC = unicode:characters_to_binary([Text,0]),
wxe_util:call(?wxDC_GetPartialTextExtents,
- <<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,(length(Widths)):32/?UI,
- (<< <<C:32/?I>> || C <- Widths>>)/binary, 0:(((1+length(Widths)) rem 2)*32)>>).
+ <<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxDC()) -> wxPen:wxPen()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetpen">external documentation</a>.
+-spec getPen(This) -> wxPen:wxPen() when
+ This::wxDC().
getPen(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetPen,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC(), Pt::{X::integer(), Y::integer()}, Col::wx:colour()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetpixel">external documentation</a>.
-getPixel(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY},Col)
- when is_integer(PtX),is_integer(PtY),tuple_size(Col) =:= 3; tuple_size(Col) =:= 4 ->
+-spec getPixel(This, Pt) -> Result when
+ Result ::{Res ::boolean(), Col::wx:wx_colour4()},
+ This::wxDC(), Pt::{X::integer(), Y::integer()}.
+getPixel(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
+ when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetPixel,
- <<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI,(wxe_util:colour_bin(Col)):16/binary>>).
+ <<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxDC()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetppi">external documentation</a>.
+-spec getPPI(This) -> {W::integer(), H::integer()} when
+ This::wxDC().
getPPI(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetPPI,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetsize">external documentation</a>.
+-spec getSize(This) -> {W::integer(), H::integer()} when
+ This::wxDC().
getSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetsizemm">external documentation</a>.
+-spec getSizeMM(This) -> {W::integer(), H::integer()} when
+ This::wxDC().
getSizeMM(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetSizeMM,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgettextbackground">external documentation</a>.
+-spec getTextBackground(This) -> wx:wx_colour4() when
+ This::wxDC().
getTextBackground(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetTextBackground,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC(), String::string()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgettextextent">external documentation</a>.
+-spec getTextExtent(This, String) -> {W::integer(), H::integer()} when
+ This::wxDC(), String::unicode:chardata().
getTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String)
when is_list(String) ->
?CLASS(ThisT,wxDC),
@@ -534,9 +606,11 @@ getTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String)
wxe_util:call(?wxDC_GetTextExtent_1,
<<ThisRef:32/?UI,(byte_size(String_UC)):32/?UI,(String_UC)/binary, 0:(((8- ((0+byte_size(String_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxDC(), String::string(), [Option]) -> {X::integer(), Y::integer(), Descent::integer(), ExternalLeading::integer()}
-%% Option = {theFont, wxFont:wxFont()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgettextextent">external documentation</a>.
+-spec getTextExtent(This, String, [Option]) -> Result when
+ Result :: {X::integer(), Y::integer(), Descent::integer(), ExternalLeading::integer()},
+ This::wxDC(), String::unicode:chardata(),
+ Option :: {theFont, wxFont:wxFont()}.
getTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String, Options)
when is_list(String),is_list(Options) ->
?CLASS(ThisT,wxDC),
@@ -547,47 +621,53 @@ getTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String, Options)
wxe_util:call(?wxDC_GetTextExtent_4,
<<ThisRef:32/?UI,(byte_size(String_UC)):32/?UI,(String_UC)/binary, 0:(((8- ((0+byte_size(String_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxDC()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgettextforeground">external documentation</a>.
+-spec getTextForeground(This) -> wx:wx_colour4() when
+ This::wxDC().
getTextForeground(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetTextForeground,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> {X::float(), Y::float()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgetuserscale">external documentation</a>.
+-spec getUserScale(This) -> {X::number(), Y::number()} when
+ This::wxDC().
getUserScale(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_GetUserScale,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, InitialColour::wx:colour(), DestColour::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgradientfillconcentric">external documentation</a>.
+-spec gradientFillConcentric(This, Rect, InitialColour, DestColour) -> ok when
+ This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, InitialColour::wx:wx_colour(), DestColour::wx:wx_colour().
gradientFillConcentric(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH},InitialColour,DestColour)
when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH),tuple_size(InitialColour) =:= 3; tuple_size(InitialColour) =:= 4,tuple_size(DestColour) =:= 3; tuple_size(DestColour) =:= 4 ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_GradientFillConcentric_3,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI,(wxe_util:colour_bin(InitialColour)):16/binary,(wxe_util:colour_bin(DestColour)):16/binary>>).
-%% @spec (This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, InitialColour::wx:colour(), DestColour::wx:colour(), CircleCenter::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgradientfillconcentric">external documentation</a>.
+-spec gradientFillConcentric(This, Rect, InitialColour, DestColour, CircleCenter) -> ok when
+ This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, InitialColour::wx:wx_colour(), DestColour::wx:wx_colour(), CircleCenter::{X::integer(), Y::integer()}.
gradientFillConcentric(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH},InitialColour,DestColour,{CircleCenterX,CircleCenterY})
when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH),tuple_size(InitialColour) =:= 3; tuple_size(InitialColour) =:= 4,tuple_size(DestColour) =:= 3; tuple_size(DestColour) =:= 4,is_integer(CircleCenterX),is_integer(CircleCenterY) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_GradientFillConcentric_4,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI,(wxe_util:colour_bin(InitialColour)):16/binary,(wxe_util:colour_bin(DestColour)):16/binary,CircleCenterX:32/?UI,CircleCenterY:32/?UI>>).
-%% @spec (This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, InitialColour::wx:colour(), DestColour::wx:colour()) -> ok
%% @equiv gradientFillLinear(This,Rect,InitialColour,DestColour, [])
+-spec gradientFillLinear(This, Rect, InitialColour, DestColour) -> ok when
+ This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, InitialColour::wx:wx_colour(), DestColour::wx:wx_colour().
+
gradientFillLinear(This,Rect={RectX,RectY,RectW,RectH},InitialColour,DestColour)
when is_record(This, wx_ref),is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH),tuple_size(InitialColour) =:= 3; tuple_size(InitialColour) =:= 4,tuple_size(DestColour) =:= 3; tuple_size(DestColour) =:= 4 ->
gradientFillLinear(This,Rect,InitialColour,DestColour, []).
-%% @spec (This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, InitialColour::wx:colour(), DestColour::wx:colour(), [Option]) -> ok
-%% Option = {nDirection, WxDirection}
-%% WxDirection = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcgradientfilllinear">external documentation</a>.
-%%<br /> WxDirection is one of ?wxLEFT | ?wxRIGHT | ?wxUP | ?wxDOWN | ?wxTOP | ?wxBOTTOM | ?wxNORTH | ?wxSOUTH | ?wxWEST | ?wxEAST | ?wxALL
+%%<br /> NDirection = ?wxLEFT | ?wxRIGHT | ?wxUP | ?wxDOWN | ?wxTOP | ?wxBOTTOM | ?wxNORTH | ?wxSOUTH | ?wxWEST | ?wxEAST | ?wxALL
+-spec gradientFillLinear(This, Rect, InitialColour, DestColour, [Option]) -> ok when
+ This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, InitialColour::wx:wx_colour(), DestColour::wx:wx_colour(),
+ Option :: {nDirection, wx:wx_enum()}.
gradientFillLinear(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH},InitialColour,DestColour, Options)
when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH),tuple_size(InitialColour) =:= 3; tuple_size(InitialColour) =:= 4,tuple_size(DestColour) =:= 3; tuple_size(DestColour) =:= 4,is_list(Options) ->
?CLASS(ThisT,wxDC),
@@ -597,121 +677,135 @@ gradientFillLinear(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH},Ini
wxe_util:cast(?wxDC_GradientFillLinear,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI,(wxe_util:colour_bin(InitialColour)):16/binary,(wxe_util:colour_bin(DestColour)):16/binary, 0:32,BinOpt/binary>>).
-%% @spec (This::wxDC(), X::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdclogicaltodevicex">external documentation</a>.
+-spec logicalToDeviceX(This, X) -> integer() when
+ This::wxDC(), X::integer().
logicalToDeviceX(#wx_ref{type=ThisT,ref=ThisRef},X)
when is_integer(X) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_LogicalToDeviceX,
<<ThisRef:32/?UI,X:32/?UI>>).
-%% @spec (This::wxDC(), X::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdclogicaltodevicexrel">external documentation</a>.
+-spec logicalToDeviceXRel(This, X) -> integer() when
+ This::wxDC(), X::integer().
logicalToDeviceXRel(#wx_ref{type=ThisT,ref=ThisRef},X)
when is_integer(X) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_LogicalToDeviceXRel,
<<ThisRef:32/?UI,X:32/?UI>>).
-%% @spec (This::wxDC(), Y::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdclogicaltodevicey">external documentation</a>.
+-spec logicalToDeviceY(This, Y) -> integer() when
+ This::wxDC(), Y::integer().
logicalToDeviceY(#wx_ref{type=ThisT,ref=ThisRef},Y)
when is_integer(Y) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_LogicalToDeviceY,
<<ThisRef:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxDC(), Y::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdclogicaltodeviceyrel">external documentation</a>.
+-spec logicalToDeviceYRel(This, Y) -> integer() when
+ This::wxDC(), Y::integer().
logicalToDeviceYRel(#wx_ref{type=ThisT,ref=ThisRef},Y)
when is_integer(Y) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_LogicalToDeviceYRel,
<<ThisRef:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxDC()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcmaxx">external documentation</a>.
+-spec maxX(This) -> integer() when
+ This::wxDC().
maxX(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_MaxX,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcmaxy">external documentation</a>.
+-spec maxY(This) -> integer() when
+ This::wxDC().
maxY(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_MaxY,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcminx">external documentation</a>.
+-spec minX(This) -> integer() when
+ This::wxDC().
minX(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_MinX,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcminy">external documentation</a>.
+-spec minY(This) -> integer() when
+ This::wxDC().
minY(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_MinY,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcisok">external documentation</a>.
+-spec isOk(This) -> boolean() when
+ This::wxDC().
isOk(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:call(?wxDC_IsOk,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcresetboundingbox">external documentation</a>.
+-spec resetBoundingBox(This) -> ok when
+ This::wxDC().
resetBoundingBox(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_ResetBoundingBox,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDC(), XLeftRight::bool(), YBottomUp::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsetaxisorientation">external documentation</a>.
+-spec setAxisOrientation(This, XLeftRight, YBottomUp) -> ok when
+ This::wxDC(), XLeftRight::boolean(), YBottomUp::boolean().
setAxisOrientation(#wx_ref{type=ThisT,ref=ThisRef},XLeftRight,YBottomUp)
when is_boolean(XLeftRight),is_boolean(YBottomUp) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_SetAxisOrientation,
<<ThisRef:32/?UI,(wxe_util:from_bool(XLeftRight)):32/?UI,(wxe_util:from_bool(YBottomUp)):32/?UI>>).
-%% @spec (This::wxDC(), Brush::wxBrush:wxBrush()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsetbackground">external documentation</a>.
+-spec setBackground(This, Brush) -> ok when
+ This::wxDC(), Brush::wxBrush:wxBrush().
setBackground(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BrushT,ref=BrushRef}) ->
?CLASS(ThisT,wxDC),
?CLASS(BrushT,wxBrush),
wxe_util:cast(?wxDC_SetBackground,
<<ThisRef:32/?UI,BrushRef:32/?UI>>).
-%% @spec (This::wxDC(), Mode::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsetbackgroundmode">external documentation</a>.
+-spec setBackgroundMode(This, Mode) -> ok when
+ This::wxDC(), Mode::integer().
setBackgroundMode(#wx_ref{type=ThisT,ref=ThisRef},Mode)
when is_integer(Mode) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_SetBackgroundMode,
<<ThisRef:32/?UI,Mode:32/?UI>>).
-%% @spec (This::wxDC(), Brush::wxBrush:wxBrush()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsetbrush">external documentation</a>.
+-spec setBrush(This, Brush) -> ok when
+ This::wxDC(), Brush::wxBrush:wxBrush().
setBrush(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BrushT,ref=BrushRef}) ->
?CLASS(ThisT,wxDC),
?CLASS(BrushT,wxBrush),
wxe_util:cast(?wxDC_SetBrush,
<<ThisRef:32/?UI,BrushRef:32/?UI>>).
-%% @spec (This::wxDC(),X::term()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsetclippingregion">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setClippingRegion(This::wxDC(), Region::wxRegion:wxRegion()) -> ok </c>
-%% </p>
-%% <p><c>
-%% setClippingRegion(This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% setClippingRegion(This, Rect) -> ok when<br />
+%% This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.<br />
+%%
+-spec setClippingRegion(This, Region) -> ok when
+ This::wxDC(), Region::wxRegion:wxRegion();
+ (This, Rect) -> ok when
+ This::wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
setClippingRegion(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=RegionT,ref=RegionRef}) ->
?CLASS(ThisT,wxDC),
?CLASS(RegionT,wxRegion),
@@ -723,98 +817,109 @@ setClippingRegion(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
wxe_util:cast(?wxDC_SetClippingRegion_1_1,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxDC(), Pt::{X::integer(), Y::integer()}, Sz::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsetclippingregion">external documentation</a>.
+-spec setClippingRegion(This, Pt, Sz) -> ok when
+ This::wxDC(), Pt::{X::integer(), Y::integer()}, Sz::{W::integer(), H::integer()}.
setClippingRegion(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY},{SzW,SzH})
when is_integer(PtX),is_integer(PtY),is_integer(SzW),is_integer(SzH) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_SetClippingRegion_2,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI,SzW:32/?UI,SzH:32/?UI>>).
-%% @spec (This::wxDC(), X::integer(), Y::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsetdeviceorigin">external documentation</a>.
+-spec setDeviceOrigin(This, X, Y) -> ok when
+ This::wxDC(), X::integer(), Y::integer().
setDeviceOrigin(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_SetDeviceOrigin,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxDC(), Font::wxFont:wxFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsetfont">external documentation</a>.
+-spec setFont(This, Font) -> ok when
+ This::wxDC(), Font::wxFont:wxFont().
setFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}) ->
?CLASS(ThisT,wxDC),
?CLASS(FontT,wxFont),
wxe_util:cast(?wxDC_SetFont,
<<ThisRef:32/?UI,FontRef:32/?UI>>).
-%% @spec (This::wxDC(), Dir::WxLayoutDirection) -> ok
-%% WxLayoutDirection = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsetlayoutdirection">external documentation</a>.
-%%<br /> WxLayoutDirection is one of ?wxLayout_Default | ?wxLayout_LeftToRight | ?wxLayout_RightToLeft
+%%<br /> Dir = ?wxLayout_Default | ?wxLayout_LeftToRight | ?wxLayout_RightToLeft
+-spec setLayoutDirection(This, Dir) -> ok when
+ This::wxDC(), Dir::wx:wx_enum().
setLayoutDirection(#wx_ref{type=ThisT,ref=ThisRef},Dir)
when is_integer(Dir) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_SetLayoutDirection,
<<ThisRef:32/?UI,Dir:32/?UI>>).
-%% @spec (This::wxDC(), Function::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsetlogicalfunction">external documentation</a>.
+-spec setLogicalFunction(This, Function) -> ok when
+ This::wxDC(), Function::integer().
setLogicalFunction(#wx_ref{type=ThisT,ref=ThisRef},Function)
when is_integer(Function) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_SetLogicalFunction,
<<ThisRef:32/?UI,Function:32/?UI>>).
-%% @spec (This::wxDC(), Mode::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsetmapmode">external documentation</a>.
+-spec setMapMode(This, Mode) -> ok when
+ This::wxDC(), Mode::integer().
setMapMode(#wx_ref{type=ThisT,ref=ThisRef},Mode)
when is_integer(Mode) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_SetMapMode,
<<ThisRef:32/?UI,Mode:32/?UI>>).
-%% @spec (This::wxDC(), Palette::wxPalette:wxPalette()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsetpalette">external documentation</a>.
+-spec setPalette(This, Palette) -> ok when
+ This::wxDC(), Palette::wxPalette:wxPalette().
setPalette(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PaletteT,ref=PaletteRef}) ->
?CLASS(ThisT,wxDC),
?CLASS(PaletteT,wxPalette),
wxe_util:cast(?wxDC_SetPalette,
<<ThisRef:32/?UI,PaletteRef:32/?UI>>).
-%% @spec (This::wxDC(), Pen::wxPen:wxPen()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsetpen">external documentation</a>.
+-spec setPen(This, Pen) -> ok when
+ This::wxDC(), Pen::wxPen:wxPen().
setPen(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PenT,ref=PenRef}) ->
?CLASS(ThisT,wxDC),
?CLASS(PenT,wxPen),
wxe_util:cast(?wxDC_SetPen,
<<ThisRef:32/?UI,PenRef:32/?UI>>).
-%% @spec (This::wxDC(), Colour::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsettextbackground">external documentation</a>.
+-spec setTextBackground(This, Colour) -> ok when
+ This::wxDC(), Colour::wx:wx_colour().
setTextBackground(#wx_ref{type=ThisT,ref=ThisRef},Colour)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_SetTextBackground,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
-%% @spec (This::wxDC(), Colour::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsettextforeground">external documentation</a>.
+-spec setTextForeground(This, Colour) -> ok when
+ This::wxDC(), Colour::wx:wx_colour().
setTextForeground(#wx_ref{type=ThisT,ref=ThisRef},Colour)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_SetTextForeground,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
-%% @spec (This::wxDC(), X::float(), Y::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcsetuserscale">external documentation</a>.
+-spec setUserScale(This, X, Y) -> ok when
+ This::wxDC(), X::number(), Y::number().
setUserScale(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
- when is_float(X),is_float(Y) ->
+ when is_number(X),is_number(Y) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_SetUserScale,
<<ThisRef:32/?UI,0:32,X:64/?F,Y:64/?F>>).
-%% @spec (This::wxDC(), Message::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcstartdoc">external documentation</a>.
+-spec startDoc(This, Message) -> boolean() when
+ This::wxDC(), Message::unicode:chardata().
startDoc(#wx_ref{type=ThisT,ref=ThisRef},Message)
when is_list(Message) ->
?CLASS(ThisT,wxDC),
@@ -822,8 +927,9 @@ startDoc(#wx_ref{type=ThisT,ref=ThisRef},Message)
wxe_util:call(?wxDC_StartDoc,
<<ThisRef:32/?UI,(byte_size(Message_UC)):32/?UI,(Message_UC)/binary, 0:(((8- ((0+byte_size(Message_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxDC()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdc.html#wxdcstartpage">external documentation</a>.
+-spec startPage(This) -> ok when
+ This::wxDC().
startPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDC),
wxe_util:cast(?wxDC_StartPage,
diff --git a/lib/wx/src/gen/wxDataObject.erl b/lib/wx/src/gen/wxDataObject.erl
index bad6d96fb5..65b388aa48 100644
--- a/lib/wx/src/gen/wxDataObject.erl
+++ b/lib/wx/src/gen/wxDataObject.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,6 +29,8 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxDataObject/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxDataObject() :: wx:wx_object().
diff --git a/lib/wx/src/gen/wxDateEvent.erl b/lib/wx/src/gen/wxDateEvent.erl
index b4b010e122..417322097f 100644
--- a/lib/wx/src/gen/wxDateEvent.erl
+++ b/lib/wx/src/gen/wxDateEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -40,13 +40,16 @@
parent_class/1,resumePropagation/2,setInt/2,setString/2,shouldPropagate/1,
skip/1,skip/2,stopPropagation/1]).
+-export_type([wxDateEvent/0]).
%% @hidden
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxDateEvent()) -> wx:datetime()
+-type wxDateEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdateevent.html#wxdateeventgetdate">external documentation</a>.
+-spec getDate(This) -> wx:wx_datetime() when
+ This::wxDateEvent().
getDate(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDateEvent),
wxe_util:call(?wxDateEvent_GetDate,
diff --git a/lib/wx/src/gen/wxDatePickerCtrl.erl b/lib/wx/src/gen/wxDatePickerCtrl.erl
index 8a1700e9cd..6ffc2ca3f5 100644
--- a/lib/wx/src/gen/wxDatePickerCtrl.erl
+++ b/lib/wx/src/gen/wxDatePickerCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -74,6 +74,7 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxDatePickerCtrl/0]).
%% @hidden
parent_class(wxPickerBase) -> true;
parent_class(wxControl) -> true;
@@ -81,21 +82,29 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxDatePickerCtrl()
+-type wxDatePickerCtrl() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdatepickerctrl.html#wxdatepickerctrlwxdatepickerctrl">external documentation</a>.
+-spec new() -> wxDatePickerCtrl().
new() ->
wxe_util:construct(?wxDatePickerCtrl_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxDatePickerCtrl()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxDatePickerCtrl() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxDatePickerCtrl()
-%% Option = {date, wx:datetime()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdatepickerctrl.html#wxdatepickerctrlwxdatepickerctrl">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxDatePickerCtrl() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {date, wx:wx_datetime()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -109,39 +118,43 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxDatePickerCtrl_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxDatePickerCtrl(), Dt1::wx:datetime(), Dt2::wx:datetime()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdatepickerctrl.html#wxdatepickerctrlgetrange">external documentation</a>.
+-spec getRange(This, Dt1, Dt2) -> boolean() when
+ This::wxDatePickerCtrl(), Dt1::wx:wx_datetime(), Dt2::wx:wx_datetime().
getRange(#wx_ref{type=ThisT,ref=ThisRef},Dt1,Dt2)
when tuple_size(Dt1) =:= 2,tuple_size(Dt2) =:= 2 ->
?CLASS(ThisT,wxDatePickerCtrl),
wxe_util:call(?wxDatePickerCtrl_GetRange,
<<ThisRef:32/?UI,(wxe_util:datetime_bin(Dt1)):24/binary,(wxe_util:datetime_bin(Dt2)):24/binary>>).
-%% @spec (This::wxDatePickerCtrl()) -> wx:datetime()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdatepickerctrl.html#wxdatepickerctrlgetvalue">external documentation</a>.
+-spec getValue(This) -> wx:wx_datetime() when
+ This::wxDatePickerCtrl().
getValue(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDatePickerCtrl),
wxe_util:call(?wxDatePickerCtrl_GetValue,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDatePickerCtrl(), Dt1::wx:datetime(), Dt2::wx:datetime()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdatepickerctrl.html#wxdatepickerctrlsetrange">external documentation</a>.
+-spec setRange(This, Dt1, Dt2) -> ok when
+ This::wxDatePickerCtrl(), Dt1::wx:wx_datetime(), Dt2::wx:wx_datetime().
setRange(#wx_ref{type=ThisT,ref=ThisRef},Dt1,Dt2)
when tuple_size(Dt1) =:= 2,tuple_size(Dt2) =:= 2 ->
?CLASS(ThisT,wxDatePickerCtrl),
wxe_util:cast(?wxDatePickerCtrl_SetRange,
<<ThisRef:32/?UI,(wxe_util:datetime_bin(Dt1)):24/binary,(wxe_util:datetime_bin(Dt2)):24/binary>>).
-%% @spec (This::wxDatePickerCtrl(), Date::wx:datetime()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdatepickerctrl.html#wxdatepickerctrlsetvalue">external documentation</a>.
+-spec setValue(This, Date) -> ok when
+ This::wxDatePickerCtrl(), Date::wx:wx_datetime().
setValue(#wx_ref{type=ThisT,ref=ThisRef},Date)
when tuple_size(Date) =:= 2 ->
?CLASS(ThisT,wxDatePickerCtrl),
wxe_util:cast(?wxDatePickerCtrl_SetValue,
<<ThisRef:32/?UI,(wxe_util:datetime_bin(Date)):24/binary>>).
-%% @spec (This::wxDatePickerCtrl()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxDatePickerCtrl()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxDatePickerCtrl),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxDialog.erl b/lib/wx/src/gen/wxDialog.erl
index 514a62813e..55861b75d1 100644
--- a/lib/wx/src/gen/wxDialog.erl
+++ b/lib/wx/src/gen/wxDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -76,27 +76,34 @@
thaw/1,transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxDialog/0]).
%% @hidden
parent_class(wxTopLevelWindow) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxDialog()
+-type wxDialog() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdialog.html#wxdialogwxdialog">external documentation</a>.
+-spec new() -> wxDialog().
new() ->
wxe_util:construct(?wxDialog_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Title::string()) -> wxDialog()
%% @equiv new(Parent,Id,Title, [])
+-spec new(Parent, Id, Title) -> wxDialog() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata().
+
new(Parent,Id,Title)
when is_record(Parent, wx_ref),is_integer(Id),is_list(Title) ->
new(Parent,Id,Title, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Title::string(), [Option]) -> wxDialog()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdialog.html#wxdialogwxdialog">external documentation</a>.
+-spec new(Parent, Id, Title, [Option]) -> wxDialog() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options)
when is_integer(Id),is_list(Title),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -109,15 +116,20 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options)
wxe_util:construct(?wxDialog_new_4,
<<ParentRef:32/?UI,Id:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((4+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxDialog(), Parent::wxWindow:wxWindow(), Id::integer(), Title::string()) -> bool()
%% @equiv create(This,Parent,Id,Title, [])
+-spec create(This, Parent, Id, Title) -> boolean() when
+ This::wxDialog(), Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata().
+
create(This,Parent,Id,Title)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Title) ->
create(This,Parent,Id,Title, []).
-%% @spec (This::wxDialog(), Parent::wxWindow:wxWindow(), Id::integer(), Title::string(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdialog.html#wxdialogcreate">external documentation</a>.
+-spec create(This, Parent, Id, Title, [Option]) -> boolean() when
+ This::wxDialog(), Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options)
when is_integer(Id),is_list(Title),is_list(Options) ->
?CLASS(ThisT,wxDialog),
@@ -131,76 +143,87 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Ti
wxe_util:call(?wxDialog_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((0+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxDialog(), Flags::integer()) -> wxSizer:wxSizer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdialog.html#wxdialogcreatebuttonsizer">external documentation</a>.
+-spec createButtonSizer(This, Flags) -> wxSizer:wxSizer() when
+ This::wxDialog(), Flags::integer().
createButtonSizer(#wx_ref{type=ThisT,ref=ThisRef},Flags)
when is_integer(Flags) ->
?CLASS(ThisT,wxDialog),
wxe_util:call(?wxDialog_CreateButtonSizer,
<<ThisRef:32/?UI,Flags:32/?UI>>).
-%% @spec (This::wxDialog(), Flags::integer()) -> wxStdDialogButtonSizer:wxStdDialogButtonSizer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdialog.html#wxdialogcreatestddialogbuttonsizer">external documentation</a>.
+-spec createStdDialogButtonSizer(This, Flags) -> wxStdDialogButtonSizer:wxStdDialogButtonSizer() when
+ This::wxDialog(), Flags::integer().
createStdDialogButtonSizer(#wx_ref{type=ThisT,ref=ThisRef},Flags)
when is_integer(Flags) ->
?CLASS(ThisT,wxDialog),
wxe_util:call(?wxDialog_CreateStdDialogButtonSizer,
<<ThisRef:32/?UI,Flags:32/?UI>>).
-%% @spec (This::wxDialog(), RetCode::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdialog.html#wxdialogendmodal">external documentation</a>.
+-spec endModal(This, RetCode) -> ok when
+ This::wxDialog(), RetCode::integer().
endModal(#wx_ref{type=ThisT,ref=ThisRef},RetCode)
when is_integer(RetCode) ->
?CLASS(ThisT,wxDialog),
wxe_util:cast(?wxDialog_EndModal,
<<ThisRef:32/?UI,RetCode:32/?UI>>).
-%% @spec (This::wxDialog()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdialog.html#wxdialoggetaffirmativeid">external documentation</a>.
+-spec getAffirmativeId(This) -> integer() when
+ This::wxDialog().
getAffirmativeId(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDialog),
wxe_util:call(?wxDialog_GetAffirmativeId,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDialog()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdialog.html#wxdialoggetreturncode">external documentation</a>.
+-spec getReturnCode(This) -> integer() when
+ This::wxDialog().
getReturnCode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDialog),
wxe_util:call(?wxDialog_GetReturnCode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDialog()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdialog.html#wxdialogismodal">external documentation</a>.
+-spec isModal(This) -> boolean() when
+ This::wxDialog().
isModal(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDialog),
wxe_util:call(?wxDialog_IsModal,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDialog(), AffirmativeId::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdialog.html#wxdialogsetaffirmativeid">external documentation</a>.
+-spec setAffirmativeId(This, AffirmativeId) -> ok when
+ This::wxDialog(), AffirmativeId::integer().
setAffirmativeId(#wx_ref{type=ThisT,ref=ThisRef},AffirmativeId)
when is_integer(AffirmativeId) ->
?CLASS(ThisT,wxDialog),
wxe_util:cast(?wxDialog_SetAffirmativeId,
<<ThisRef:32/?UI,AffirmativeId:32/?UI>>).
-%% @spec (This::wxDialog(), ReturnCode::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdialog.html#wxdialogsetreturncode">external documentation</a>.
+-spec setReturnCode(This, ReturnCode) -> ok when
+ This::wxDialog(), ReturnCode::integer().
setReturnCode(#wx_ref{type=ThisT,ref=ThisRef},ReturnCode)
when is_integer(ReturnCode) ->
?CLASS(ThisT,wxDialog),
wxe_util:cast(?wxDialog_SetReturnCode,
<<ThisRef:32/?UI,ReturnCode:32/?UI>>).
-%% @spec (This::wxDialog()) -> bool()
%% @equiv show(This, [])
+-spec show(This) -> boolean() when
+ This::wxDialog().
+
show(This)
when is_record(This, wx_ref) ->
show(This, []).
-%% @spec (This::wxDialog(), [Option]) -> bool()
-%% Option = {show, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdialog.html#wxdialogshow">external documentation</a>.
+-spec show(This, [Option]) -> boolean() when
+ This::wxDialog(),
+ Option :: {show, boolean()}.
show(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxDialog),
@@ -210,15 +233,16 @@ show(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxDialog_Show,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxDialog()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdialog.html#wxdialogshowmodal">external documentation</a>.
+-spec showModal(This) -> integer() when
+ This::wxDialog().
showModal(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDialog),
wxe_util:call(?wxDialog_ShowModal,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDialog()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxDialog()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxDialog),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxDirDialog.erl b/lib/wx/src/gen/wxDirDialog.erl
index 28db3daf1d..d7dc735937 100644
--- a/lib/wx/src/gen/wxDirDialog.erl
+++ b/lib/wx/src/gen/wxDirDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -77,6 +77,7 @@
transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxDirDialog/0]).
%% @hidden
parent_class(wxDialog) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -84,15 +85,23 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxDirDialog()
+-type wxDirDialog() :: wx:wx_object().
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxDirDialog() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxDirDialog()
-%% Option = {title, string()} | {defaultPath, string()} | {style, integer()} | {pos, {X::integer(), Y::integer()}} | {sz, {W::integer(), H::integer()}}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdirdialog.html#wxdirdialogwxdirdialog">external documentation</a>.
+-spec new(Parent, [Option]) -> wxDirDialog() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {title, unicode:chardata()}
+ | {defaultPath, unicode:chardata()}
+ | {style, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {sz, {W::integer(), H::integer()}}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -106,22 +115,25 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxDirDialog_new,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxDirDialog()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdirdialog.html#wxdirdialoggetpath">external documentation</a>.
+-spec getPath(This) -> unicode:charlist() when
+ This::wxDirDialog().
getPath(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDirDialog),
wxe_util:call(?wxDirDialog_GetPath,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDirDialog()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdirdialog.html#wxdirdialoggetmessage">external documentation</a>.
+-spec getMessage(This) -> unicode:charlist() when
+ This::wxDirDialog().
getMessage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDirDialog),
wxe_util:call(?wxDirDialog_GetMessage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDirDialog(), Message::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdirdialog.html#wxdirdialogsetmessage">external documentation</a>.
+-spec setMessage(This, Message) -> ok when
+ This::wxDirDialog(), Message::unicode:chardata().
setMessage(#wx_ref{type=ThisT,ref=ThisRef},Message)
when is_list(Message) ->
?CLASS(ThisT,wxDirDialog),
@@ -129,8 +141,9 @@ setMessage(#wx_ref{type=ThisT,ref=ThisRef},Message)
wxe_util:cast(?wxDirDialog_SetMessage,
<<ThisRef:32/?UI,(byte_size(Message_UC)):32/?UI,(Message_UC)/binary, 0:(((8- ((0+byte_size(Message_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxDirDialog(), Path::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdirdialog.html#wxdirdialogsetpath">external documentation</a>.
+-spec setPath(This, Path) -> ok when
+ This::wxDirDialog(), Path::unicode:chardata().
setPath(#wx_ref{type=ThisT,ref=ThisRef},Path)
when is_list(Path) ->
?CLASS(ThisT,wxDirDialog),
@@ -138,8 +151,8 @@ setPath(#wx_ref{type=ThisT,ref=ThisRef},Path)
wxe_util:cast(?wxDirDialog_SetPath,
<<ThisRef:32/?UI,(byte_size(Path_UC)):32/?UI,(Path_UC)/binary, 0:(((8- ((0+byte_size(Path_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxDirDialog()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxDirDialog()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxDirDialog),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxDirPickerCtrl.erl b/lib/wx/src/gen/wxDirPickerCtrl.erl
index 2b24bc4bb0..bbc169ae03 100644
--- a/lib/wx/src/gen/wxDirPickerCtrl.erl
+++ b/lib/wx/src/gen/wxDirPickerCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -74,6 +74,7 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxDirPickerCtrl/0]).
%% @hidden
parent_class(wxPickerBase) -> true;
parent_class(wxControl) -> true;
@@ -81,21 +82,30 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxDirPickerCtrl()
+-type wxDirPickerCtrl() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdirpickerctrl.html#wxdirpickerctrlwxdirpickerctrl">external documentation</a>.
+-spec new() -> wxDirPickerCtrl().
new() ->
wxe_util:construct(?wxDirPickerCtrl_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxDirPickerCtrl()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxDirPickerCtrl() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxDirPickerCtrl()
-%% Option = {path, string()} | {message, string()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdirpickerctrl.html#wxdirpickerctrlwxdirpickerctrl">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxDirPickerCtrl() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {path, unicode:chardata()}
+ | {message, unicode:chardata()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -110,15 +120,23 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxDirPickerCtrl_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxDirPickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer()) -> bool()
%% @equiv create(This,Parent,Id, [])
+-spec create(This, Parent, Id) -> boolean() when
+ This::wxDirPickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer().
+
create(This,Parent,Id)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id) ->
create(This,Parent,Id, []).
-%% @spec (This::wxDirPickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> bool()
-%% Option = {path, string()} | {message, string()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdirpickerctrl.html#wxdirpickerctrlcreate">external documentation</a>.
+-spec create(This, Parent, Id, [Option]) -> boolean() when
+ This::wxDirPickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {path, unicode:chardata()}
+ | {message, unicode:chardata()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ThisT,wxDirPickerCtrl),
@@ -134,15 +152,17 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, O
wxe_util:call(?wxDirPickerCtrl_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxDirPickerCtrl()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdirpickerctrl.html#wxdirpickerctrlgetpath">external documentation</a>.
+-spec getPath(This) -> unicode:charlist() when
+ This::wxDirPickerCtrl().
getPath(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxDirPickerCtrl),
wxe_util:call(?wxDirPickerCtrl_GetPath,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxDirPickerCtrl(), Str::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxdirpickerctrl.html#wxdirpickerctrlsetpath">external documentation</a>.
+-spec setPath(This, Str) -> ok when
+ This::wxDirPickerCtrl(), Str::unicode:chardata().
setPath(#wx_ref{type=ThisT,ref=ThisRef},Str)
when is_list(Str) ->
?CLASS(ThisT,wxDirPickerCtrl),
@@ -150,8 +170,8 @@ setPath(#wx_ref{type=ThisT,ref=ThisRef},Str)
wxe_util:cast(?wxDirPickerCtrl_SetPath,
<<ThisRef:32/?UI,(byte_size(Str_UC)):32/?UI,(Str_UC)/binary, 0:(((8- ((0+byte_size(Str_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxDirPickerCtrl()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxDirPickerCtrl()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxDirPickerCtrl),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxDisplayChangedEvent.erl b/lib/wx/src/gen/wxDisplayChangedEvent.erl
index c86ef62462..0c0612564b 100644
--- a/lib/wx/src/gen/wxDisplayChangedEvent.erl
+++ b/lib/wx/src/gen/wxDisplayChangedEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,10 +37,12 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxDisplayChangedEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxDisplayChangedEvent() :: wx:wx_object().
%% From wxEvent
%% @hidden
stopPropagation(This) -> wxEvent:stopPropagation(This).
diff --git a/lib/wx/src/gen/wxEraseEvent.erl b/lib/wx/src/gen/wxEraseEvent.erl
index 77139b6790..03ce8862dc 100644
--- a/lib/wx/src/gen/wxEraseEvent.erl
+++ b/lib/wx/src/gen/wxEraseEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,12 +37,15 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxEraseEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxEraseEvent()) -> wxDC:wxDC()
+-type wxEraseEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxeraseevent.html#wxeraseeventgetdc">external documentation</a>.
+-spec getDC(This) -> wxDC:wxDC() when
+ This::wxEraseEvent().
getDC(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxEraseEvent),
wxe_util:call(?wxEraseEvent_GetDC,
diff --git a/lib/wx/src/gen/wxEvent.erl b/lib/wx/src/gen/wxEvent.erl
index 403fd89f1f..1b2147a326 100644
--- a/lib/wx/src/gen/wxEvent.erl
+++ b/lib/wx/src/gen/wxEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -30,61 +30,72 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxEvent/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxEvent()) -> integer()
+-type wxEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxevent.html#wxeventgetid">external documentation</a>.
+-spec getId(This) -> integer() when
+ This::wxEvent().
getId(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxEvent),
wxe_util:call(?wxEvent_GetId,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxevent.html#wxeventgetskipped">external documentation</a>.
+-spec getSkipped(This) -> boolean() when
+ This::wxEvent().
getSkipped(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxEvent),
wxe_util:call(?wxEvent_GetSkipped,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxevent.html#wxeventgettimestamp">external documentation</a>.
+-spec getTimestamp(This) -> integer() when
+ This::wxEvent().
getTimestamp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxEvent),
wxe_util:call(?wxEvent_GetTimestamp,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxevent.html#wxeventiscommandevent">external documentation</a>.
+-spec isCommandEvent(This) -> boolean() when
+ This::wxEvent().
isCommandEvent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxEvent),
wxe_util:call(?wxEvent_IsCommandEvent,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxEvent(), PropagationLevel::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxevent.html#wxeventresumepropagation">external documentation</a>.
+-spec resumePropagation(This, PropagationLevel) -> ok when
+ This::wxEvent(), PropagationLevel::integer().
resumePropagation(#wx_ref{type=ThisT,ref=ThisRef},PropagationLevel)
when is_integer(PropagationLevel) ->
?CLASS(ThisT,wxEvent),
wxe_util:cast(?wxEvent_ResumePropagation,
<<ThisRef:32/?UI,PropagationLevel:32/?UI>>).
-%% @spec (This::wxEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxevent.html#wxeventshouldpropagate">external documentation</a>.
+-spec shouldPropagate(This) -> boolean() when
+ This::wxEvent().
shouldPropagate(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxEvent),
wxe_util:call(?wxEvent_ShouldPropagate,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxEvent()) -> ok
%% @equiv skip(This, [])
+-spec skip(This) -> ok when
+ This::wxEvent().
+
skip(This)
when is_record(This, wx_ref) ->
skip(This, []).
-%% @spec (This::wxEvent(), [Option]) -> ok
-%% Option = {skip, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxevent.html#wxeventskip">external documentation</a>.
+-spec skip(This, [Option]) -> ok when
+ This::wxEvent(),
+ Option :: {skip, boolean()}.
skip(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxEvent),
@@ -94,8 +105,9 @@ skip(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxEvent_Skip,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxevent.html#wxeventstoppropagation">external documentation</a>.
+-spec stopPropagation(This) -> integer() when
+ This::wxEvent().
stopPropagation(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxEvent),
wxe_util:call(?wxEvent_StopPropagation,
diff --git a/lib/wx/src/gen/wxEvtHandler.erl b/lib/wx/src/gen/wxEvtHandler.erl
index 820c2b7a58..22c203392c 100644
--- a/lib/wx/src/gen/wxEvtHandler.erl
+++ b/lib/wx/src/gen/wxEvtHandler.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,10 +37,7 @@
%% <a href="http://www.wxwidgets.org/manuals/stable/wx_wxevthandler.html">
%% The orginal documentation</a>.
%%
-%% @headerfile "../../include/wx.hrl"
%%
-%%@type wxEvtHandler(). An object reference
-
-module(wxEvtHandler).
-include("wxe.hrl").
-include("../include/wx.hrl").
@@ -53,17 +50,16 @@
new_evt_listener/0, destroy_evt_listener/1,
get_callback/1, replace_fun_with_id/2]).
--record(evh, {et=null,id=?wxID_ANY,lastId=?wxID_ANY,skip=undefined,userdata=[],cb=0}).
-
+-export_type([wxEvtHandler/0, wx/0, event/0]).
+-type wxEvtHandler() :: wx:wx_object().
+-record(evh, {et=null,id=?wxID_ANY,lastId=?wxID_ANY,skip=undefined,userdata=[],cb=0}).
-%% @spec (This::wxEvtHandler(), EventType::wxEventType()) -> ok
%% @doc Equivalent to {@link connect/3. connect(This, EventType, [])}
-
+-spec connect(This::wxEvtHandler(), EventType::wxEventType()) -> ok.
connect(This, EventType) ->
connect(This, EventType, []).
-%% @spec (This::wxEvtHandler(), EventType::wxEventType(), [Options]) -> ok
%% @doc This function subscribes the to events of EventType,
%% in the range id, lastId. The events will be received as messages
%% if no callback is supplied.
@@ -82,6 +78,9 @@ connect(This, EventType) ->
%% to process the event. Default not specfied i.e. a message will
%% be delivered to the process calling this function.
%% {userData, term()} An erlang term that will be sent with the event. Default: [].
+-spec connect(This::wxEvtHandler(), EventType::wxEventType(), [Option]) -> ok when
+ Option :: {id, integer()} | {lastId, integer()} | {skip, boolean()} |
+ callback | {callback, function()} | {userData, term()}.
connect(This=#wx_ref{type=ThisT}, EventType, Options) ->
EvH = parse_opts(Options, #evh{et=EventType}),
?CLASS(ThisT,wxEvtHandler),
@@ -118,26 +117,27 @@ parse_opts([], Opts = #evh{id=Id,lastId=Lid,skip=Skip, cb=CB}) ->
Opts
end.
-%% @spec (This::wxEvtHandler()) -> true | false
+
%% @doc Equivalent to {@link disconnect/3. disconnect(This, null, [])}
%% Can also have an optional callback Fun() as an additional last argument.
-
+-spec disconnect(This::wxEvtHandler()) -> boolean().
disconnect(This=#wx_ref{type=ThisT,ref=_ThisRef}) ->
?CLASS(ThisT,wxEvtHandler),
disconnect(This, null, []).
-%% @spec (This::wxEvtHandler(), EventType::wxEventType()) -> true | false
%% @doc Equivalent to {@link disconnect/3. disconnect(This, EventType, [])}
+-spec disconnect(This::wxEvtHandler(), EventType::wxEventType()) -> boolean().
disconnect(This=#wx_ref{type=ThisT,ref=_ThisRef}, EventType) when is_atom(EventType) ->
?CLASS(ThisT,wxEvtHandler),
disconnect(This, EventType, []).
-%% @spec (This::wxEvtHandler(), EventType::wxEventType(), Opts) -> true | false
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxevthandler.html#wxevthandlerdisconnect">external documentation</a>
%% This function unsubscribes the process or callback fun from the event handler.
%% EventType may be the atom 'null' to match any eventtype.
%% Notice that the options skip and userdata is not used to match the eventhandler.
-disconnect(This=#wx_ref{type=ThisT,ref=_ThisRef}, EventType, Opts) ->
+-spec disconnect(This::wxEvtHandler(), EventType::wxEventType(), [Option]) -> boolean() when
+ Option :: {id, integer()} | {lastId, integer()} | {callback, function()}.
+disconnect(This=#wx_ref{type=ThisT,ref=_ThisRef}, EventType, Opts) ->
?CLASS(ThisT,wxEvtHandler),
EvH = parse_opts(Opts, #evh{et=EventType}),
case wxe_util:disconnect_cb(This, EvH) of
diff --git a/lib/wx/src/gen/wxFileDataObject.erl b/lib/wx/src/gen/wxFileDataObject.erl
index 2fcfbd5374..435c795cdc 100644
--- a/lib/wx/src/gen/wxFileDataObject.erl
+++ b/lib/wx/src/gen/wxFileDataObject.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -32,18 +32,21 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxFileDataObject/0]).
%% @hidden
parent_class(wxDataObject) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxFileDataObject()
+-type wxFileDataObject() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledataobject.html#wxfiledataobjectwxfiledataobject">external documentation</a>.
+-spec new() -> wxFileDataObject().
new() ->
wxe_util:construct(?wxFileDataObject_new,
<<>>).
-%% @spec (This::wxFileDataObject(), Filename::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledataobject.html#wxfiledataobjectaddfile">external documentation</a>.
+-spec addFile(This, Filename) -> ok when
+ This::wxFileDataObject(), Filename::unicode:chardata().
addFile(#wx_ref{type=ThisT,ref=ThisRef},Filename)
when is_list(Filename) ->
?CLASS(ThisT,wxFileDataObject),
@@ -51,15 +54,16 @@ addFile(#wx_ref{type=ThisT,ref=ThisRef},Filename)
wxe_util:cast(?wxFileDataObject_AddFile,
<<ThisRef:32/?UI,(byte_size(Filename_UC)):32/?UI,(Filename_UC)/binary, 0:(((8- ((0+byte_size(Filename_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxFileDataObject()) -> [[string()]]
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledataobject.html#wxfiledataobjectgetfilenames">external documentation</a>.
+-spec getFilenames(This) -> [unicode:charlist()] when
+ This::wxFileDataObject().
getFilenames(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFileDataObject),
wxe_util:call(?wxFileDataObject_GetFilenames,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFileDataObject()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxFileDataObject()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxFileDataObject),
wxe_util:destroy(?wxFileDataObject_destroy,Obj),
diff --git a/lib/wx/src/gen/wxFileDialog.erl b/lib/wx/src/gen/wxFileDialog.erl
index c6779927e9..a257905795 100644
--- a/lib/wx/src/gen/wxFileDialog.erl
+++ b/lib/wx/src/gen/wxFileDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -79,6 +79,7 @@
transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxFileDialog/0]).
%% @hidden
parent_class(wxDialog) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -86,15 +87,25 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxFileDialog()
+-type wxFileDialog() :: wx:wx_object().
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxFileDialog() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxFileDialog()
-%% Option = {message, string()} | {defaultDir, string()} | {defaultFile, string()} | {wildCard, string()} | {style, integer()} | {pos, {X::integer(), Y::integer()}} | {sz, {W::integer(), H::integer()}}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledialog.html#wxfiledialogwxfiledialog">external documentation</a>.
+-spec new(Parent, [Option]) -> wxFileDialog() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {message, unicode:chardata()}
+ | {defaultDir, unicode:chardata()}
+ | {defaultFile, unicode:chardata()}
+ | {wildCard, unicode:chardata()}
+ | {style, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {sz, {W::integer(), H::integer()}}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -110,64 +121,73 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxFileDialog_new,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxFileDialog()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledialog.html#wxfiledialoggetdirectory">external documentation</a>.
+-spec getDirectory(This) -> unicode:charlist() when
+ This::wxFileDialog().
getDirectory(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFileDialog),
wxe_util:call(?wxFileDialog_GetDirectory,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFileDialog()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledialog.html#wxfiledialoggetfilename">external documentation</a>.
+-spec getFilename(This) -> unicode:charlist() when
+ This::wxFileDialog().
getFilename(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFileDialog),
wxe_util:call(?wxFileDialog_GetFilename,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFileDialog()) -> [[string()]]
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledialog.html#wxfiledialoggetfilenames">external documentation</a>.
+-spec getFilenames(This) -> [unicode:charlist()] when
+ This::wxFileDialog().
getFilenames(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFileDialog),
wxe_util:call(?wxFileDialog_GetFilenames,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFileDialog()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledialog.html#wxfiledialoggetfilterindex">external documentation</a>.
+-spec getFilterIndex(This) -> integer() when
+ This::wxFileDialog().
getFilterIndex(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFileDialog),
wxe_util:call(?wxFileDialog_GetFilterIndex,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFileDialog()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledialog.html#wxfiledialoggetmessage">external documentation</a>.
+-spec getMessage(This) -> unicode:charlist() when
+ This::wxFileDialog().
getMessage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFileDialog),
wxe_util:call(?wxFileDialog_GetMessage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFileDialog()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledialog.html#wxfiledialoggetpath">external documentation</a>.
+-spec getPath(This) -> unicode:charlist() when
+ This::wxFileDialog().
getPath(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFileDialog),
wxe_util:call(?wxFileDialog_GetPath,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFileDialog()) -> [[string()]]
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledialog.html#wxfiledialoggetpaths">external documentation</a>.
+-spec getPaths(This) -> [unicode:charlist()] when
+ This::wxFileDialog().
getPaths(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFileDialog),
wxe_util:call(?wxFileDialog_GetPaths,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFileDialog()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledialog.html#wxfiledialoggetwildcard">external documentation</a>.
+-spec getWildcard(This) -> unicode:charlist() when
+ This::wxFileDialog().
getWildcard(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFileDialog),
wxe_util:call(?wxFileDialog_GetWildcard,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFileDialog(), Dir::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledialog.html#wxfiledialogsetdirectory">external documentation</a>.
+-spec setDirectory(This, Dir) -> ok when
+ This::wxFileDialog(), Dir::unicode:chardata().
setDirectory(#wx_ref{type=ThisT,ref=ThisRef},Dir)
when is_list(Dir) ->
?CLASS(ThisT,wxFileDialog),
@@ -175,8 +195,9 @@ setDirectory(#wx_ref{type=ThisT,ref=ThisRef},Dir)
wxe_util:cast(?wxFileDialog_SetDirectory,
<<ThisRef:32/?UI,(byte_size(Dir_UC)):32/?UI,(Dir_UC)/binary, 0:(((8- ((0+byte_size(Dir_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxFileDialog(), Name::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledialog.html#wxfiledialogsetfilename">external documentation</a>.
+-spec setFilename(This, Name) -> ok when
+ This::wxFileDialog(), Name::unicode:chardata().
setFilename(#wx_ref{type=ThisT,ref=ThisRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxFileDialog),
@@ -184,16 +205,18 @@ setFilename(#wx_ref{type=ThisT,ref=ThisRef},Name)
wxe_util:cast(?wxFileDialog_SetFilename,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxFileDialog(), FilterIndex::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledialog.html#wxfiledialogsetfilterindex">external documentation</a>.
+-spec setFilterIndex(This, FilterIndex) -> ok when
+ This::wxFileDialog(), FilterIndex::integer().
setFilterIndex(#wx_ref{type=ThisT,ref=ThisRef},FilterIndex)
when is_integer(FilterIndex) ->
?CLASS(ThisT,wxFileDialog),
wxe_util:cast(?wxFileDialog_SetFilterIndex,
<<ThisRef:32/?UI,FilterIndex:32/?UI>>).
-%% @spec (This::wxFileDialog(), Message::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledialog.html#wxfiledialogsetmessage">external documentation</a>.
+-spec setMessage(This, Message) -> ok when
+ This::wxFileDialog(), Message::unicode:chardata().
setMessage(#wx_ref{type=ThisT,ref=ThisRef},Message)
when is_list(Message) ->
?CLASS(ThisT,wxFileDialog),
@@ -201,8 +224,9 @@ setMessage(#wx_ref{type=ThisT,ref=ThisRef},Message)
wxe_util:cast(?wxFileDialog_SetMessage,
<<ThisRef:32/?UI,(byte_size(Message_UC)):32/?UI,(Message_UC)/binary, 0:(((8- ((0+byte_size(Message_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxFileDialog(), Path::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledialog.html#wxfiledialogsetpath">external documentation</a>.
+-spec setPath(This, Path) -> ok when
+ This::wxFileDialog(), Path::unicode:chardata().
setPath(#wx_ref{type=ThisT,ref=ThisRef},Path)
when is_list(Path) ->
?CLASS(ThisT,wxFileDialog),
@@ -210,8 +234,9 @@ setPath(#wx_ref{type=ThisT,ref=ThisRef},Path)
wxe_util:cast(?wxFileDialog_SetPath,
<<ThisRef:32/?UI,(byte_size(Path_UC)):32/?UI,(Path_UC)/binary, 0:(((8- ((0+byte_size(Path_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxFileDialog(), WildCard::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledialog.html#wxfiledialogsetwildcard">external documentation</a>.
+-spec setWildcard(This, WildCard) -> ok when
+ This::wxFileDialog(), WildCard::unicode:chardata().
setWildcard(#wx_ref{type=ThisT,ref=ThisRef},WildCard)
when is_list(WildCard) ->
?CLASS(ThisT,wxFileDialog),
@@ -219,8 +244,8 @@ setWildcard(#wx_ref{type=ThisT,ref=ThisRef},WildCard)
wxe_util:cast(?wxFileDialog_SetWildcard,
<<ThisRef:32/?UI,(byte_size(WildCard_UC)):32/?UI,(WildCard_UC)/binary, 0:(((8- ((0+byte_size(WildCard_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxFileDialog()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxFileDialog()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxFileDialog),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxFileDirPickerEvent.erl b/lib/wx/src/gen/wxFileDirPickerEvent.erl
index cc4880b88c..77b10a91ed 100644
--- a/lib/wx/src/gen/wxFileDirPickerEvent.erl
+++ b/lib/wx/src/gen/wxFileDirPickerEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -40,13 +40,16 @@
parent_class/1,resumePropagation/2,setInt/2,setString/2,shouldPropagate/1,
skip/1,skip/2,stopPropagation/1]).
+-export_type([wxFileDirPickerEvent/0]).
%% @hidden
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxFileDirPickerEvent()) -> string()
+-type wxFileDirPickerEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfiledirpickerevent.html#wxfiledirpickereventgetpath">external documentation</a>.
+-spec getPath(This) -> unicode:charlist() when
+ This::wxFileDirPickerEvent().
getPath(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFileDirPickerEvent),
wxe_util:call(?wxFileDirPickerEvent_GetPath,
diff --git a/lib/wx/src/gen/wxFilePickerCtrl.erl b/lib/wx/src/gen/wxFilePickerCtrl.erl
index 93bfa72380..d19c8c00cb 100644
--- a/lib/wx/src/gen/wxFilePickerCtrl.erl
+++ b/lib/wx/src/gen/wxFilePickerCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -74,6 +74,7 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxFilePickerCtrl/0]).
%% @hidden
parent_class(wxPickerBase) -> true;
parent_class(wxControl) -> true;
@@ -81,21 +82,31 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxFilePickerCtrl()
+-type wxFilePickerCtrl() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfilepickerctrl.html#wxfilepickerctrlwxfilepickerctrl">external documentation</a>.
+-spec new() -> wxFilePickerCtrl().
new() ->
wxe_util:construct(?wxFilePickerCtrl_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxFilePickerCtrl()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxFilePickerCtrl() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxFilePickerCtrl()
-%% Option = {path, string()} | {message, string()} | {wildcard, string()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfilepickerctrl.html#wxfilepickerctrlwxfilepickerctrl">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxFilePickerCtrl() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {path, unicode:chardata()}
+ | {message, unicode:chardata()}
+ | {wildcard, unicode:chardata()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -111,15 +122,24 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxFilePickerCtrl_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxFilePickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer()) -> bool()
%% @equiv create(This,Parent,Id, [])
+-spec create(This, Parent, Id) -> boolean() when
+ This::wxFilePickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer().
+
create(This,Parent,Id)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id) ->
create(This,Parent,Id, []).
-%% @spec (This::wxFilePickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> bool()
-%% Option = {path, string()} | {message, string()} | {wildcard, string()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfilepickerctrl.html#wxfilepickerctrlcreate">external documentation</a>.
+-spec create(This, Parent, Id, [Option]) -> boolean() when
+ This::wxFilePickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {path, unicode:chardata()}
+ | {message, unicode:chardata()}
+ | {wildcard, unicode:chardata()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ThisT,wxFilePickerCtrl),
@@ -136,15 +156,17 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, O
wxe_util:call(?wxFilePickerCtrl_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxFilePickerCtrl()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfilepickerctrl.html#wxfilepickerctrlgetpath">external documentation</a>.
+-spec getPath(This) -> unicode:charlist() when
+ This::wxFilePickerCtrl().
getPath(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFilePickerCtrl),
wxe_util:call(?wxFilePickerCtrl_GetPath,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFilePickerCtrl(), Str::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfilepickerctrl.html#wxfilepickerctrlsetpath">external documentation</a>.
+-spec setPath(This, Str) -> ok when
+ This::wxFilePickerCtrl(), Str::unicode:chardata().
setPath(#wx_ref{type=ThisT,ref=ThisRef},Str)
when is_list(Str) ->
?CLASS(ThisT,wxFilePickerCtrl),
@@ -152,8 +174,8 @@ setPath(#wx_ref{type=ThisT,ref=ThisRef},Str)
wxe_util:cast(?wxFilePickerCtrl_SetPath,
<<ThisRef:32/?UI,(byte_size(Str_UC)):32/?UI,(Str_UC)/binary, 0:(((8- ((0+byte_size(Str_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxFilePickerCtrl()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxFilePickerCtrl()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxFilePickerCtrl),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxFindReplaceData.erl b/lib/wx/src/gen/wxFindReplaceData.erl
index 52eafa8398..8dc6036da6 100644
--- a/lib/wx/src/gen/wxFindReplaceData.erl
+++ b/lib/wx/src/gen/wxFindReplaceData.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -30,53 +30,61 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxFindReplaceData/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxFindReplaceData()
+-type wxFindReplaceData() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfindreplacedata.html#wxfindreplacedatawxfindreplacedata">external documentation</a>.
+-spec new() -> wxFindReplaceData().
new() ->
wxe_util:construct(?wxFindReplaceData_new_0,
<<>>).
-%% @spec (Flags::integer()) -> wxFindReplaceData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfindreplacedata.html#wxfindreplacedatawxfindreplacedata">external documentation</a>.
+-spec new(Flags) -> wxFindReplaceData() when
+ Flags::integer().
new(Flags)
when is_integer(Flags) ->
wxe_util:construct(?wxFindReplaceData_new_1,
<<Flags:32/?UI>>).
-%% @spec (This::wxFindReplaceData()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfindreplacedata.html#wxfindreplacedatagetfindstring">external documentation</a>.
+-spec getFindString(This) -> unicode:charlist() when
+ This::wxFindReplaceData().
getFindString(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFindReplaceData),
wxe_util:call(?wxFindReplaceData_GetFindString,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFindReplaceData()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfindreplacedata.html#wxfindreplacedatagetreplacestring">external documentation</a>.
+-spec getReplaceString(This) -> unicode:charlist() when
+ This::wxFindReplaceData().
getReplaceString(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFindReplaceData),
wxe_util:call(?wxFindReplaceData_GetReplaceString,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFindReplaceData()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfindreplacedata.html#wxfindreplacedatagetflags">external documentation</a>.
+-spec getFlags(This) -> integer() when
+ This::wxFindReplaceData().
getFlags(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFindReplaceData),
wxe_util:call(?wxFindReplaceData_GetFlags,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFindReplaceData(), Flags::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfindreplacedata.html#wxfindreplacedatasetflags">external documentation</a>.
+-spec setFlags(This, Flags) -> ok when
+ This::wxFindReplaceData(), Flags::integer().
setFlags(#wx_ref{type=ThisT,ref=ThisRef},Flags)
when is_integer(Flags) ->
?CLASS(ThisT,wxFindReplaceData),
wxe_util:cast(?wxFindReplaceData_SetFlags,
<<ThisRef:32/?UI,Flags:32/?UI>>).
-%% @spec (This::wxFindReplaceData(), Str::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfindreplacedata.html#wxfindreplacedatasetfindstring">external documentation</a>.
+-spec setFindString(This, Str) -> ok when
+ This::wxFindReplaceData(), Str::unicode:chardata().
setFindString(#wx_ref{type=ThisT,ref=ThisRef},Str)
when is_list(Str) ->
?CLASS(ThisT,wxFindReplaceData),
@@ -84,8 +92,9 @@ setFindString(#wx_ref{type=ThisT,ref=ThisRef},Str)
wxe_util:cast(?wxFindReplaceData_SetFindString,
<<ThisRef:32/?UI,(byte_size(Str_UC)):32/?UI,(Str_UC)/binary, 0:(((8- ((0+byte_size(Str_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxFindReplaceData(), Str::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfindreplacedata.html#wxfindreplacedatasetreplacestring">external documentation</a>.
+-spec setReplaceString(This, Str) -> ok when
+ This::wxFindReplaceData(), Str::unicode:chardata().
setReplaceString(#wx_ref{type=ThisT,ref=ThisRef},Str)
when is_list(Str) ->
?CLASS(ThisT,wxFindReplaceData),
@@ -93,8 +102,8 @@ setReplaceString(#wx_ref{type=ThisT,ref=ThisRef},Str)
wxe_util:cast(?wxFindReplaceData_SetReplaceString,
<<ThisRef:32/?UI,(byte_size(Str_UC)):32/?UI,(Str_UC)/binary, 0:(((8- ((0+byte_size(Str_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxFindReplaceData()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxFindReplaceData()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxFindReplaceData),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxFindReplaceDialog.erl b/lib/wx/src/gen/wxFindReplaceDialog.erl
index b37fd41831..6db9b3ed53 100644
--- a/lib/wx/src/gen/wxFindReplaceDialog.erl
+++ b/lib/wx/src/gen/wxFindReplaceDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -77,6 +77,7 @@
transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxFindReplaceDialog/0]).
%% @hidden
parent_class(wxDialog) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -84,21 +85,25 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxFindReplaceDialog()
+-type wxFindReplaceDialog() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfindreplacedialog.html#wxfindreplacedialogwxfindreplacedialog">external documentation</a>.
+-spec new() -> wxFindReplaceDialog().
new() ->
wxe_util:construct(?wxFindReplaceDialog_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Data::wxFindReplaceData:wxFindReplaceData(), Title::string()) -> wxFindReplaceDialog()
%% @equiv new(Parent,Data,Title, [])
+-spec new(Parent, Data, Title) -> wxFindReplaceDialog() when
+ Parent::wxWindow:wxWindow(), Data::wxFindReplaceData:wxFindReplaceData(), Title::unicode:chardata().
+
new(Parent,Data,Title)
when is_record(Parent, wx_ref),is_record(Data, wx_ref),is_list(Title) ->
new(Parent,Data,Title, []).
-%% @spec (Parent::wxWindow:wxWindow(), Data::wxFindReplaceData:wxFindReplaceData(), Title::string(), [Option]) -> wxFindReplaceDialog()
-%% Option = {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfindreplacedialog.html#wxfindreplacedialogwxfindreplacedialog">external documentation</a>.
+-spec new(Parent, Data, Title, [Option]) -> wxFindReplaceDialog() when
+ Parent::wxWindow:wxWindow(), Data::wxFindReplaceData:wxFindReplaceData(), Title::unicode:chardata(),
+ Option :: {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=DataT,ref=DataRef},Title, Options)
when is_list(Title),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -110,15 +115,18 @@ new(#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=DataT,ref=DataRef},Title, O
wxe_util:construct(?wxFindReplaceDialog_new_4,
<<ParentRef:32/?UI,DataRef:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((4+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxFindReplaceDialog(), Parent::wxWindow:wxWindow(), Data::wxFindReplaceData:wxFindReplaceData(), Title::string()) -> bool()
%% @equiv create(This,Parent,Data,Title, [])
+-spec create(This, Parent, Data, Title) -> boolean() when
+ This::wxFindReplaceDialog(), Parent::wxWindow:wxWindow(), Data::wxFindReplaceData:wxFindReplaceData(), Title::unicode:chardata().
+
create(This,Parent,Data,Title)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_record(Data, wx_ref),is_list(Title) ->
create(This,Parent,Data,Title, []).
-%% @spec (This::wxFindReplaceDialog(), Parent::wxWindow:wxWindow(), Data::wxFindReplaceData:wxFindReplaceData(), Title::string(), [Option]) -> bool()
-%% Option = {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfindreplacedialog.html#wxfindreplacedialogcreate">external documentation</a>.
+-spec create(This, Parent, Data, Title, [Option]) -> boolean() when
+ This::wxFindReplaceDialog(), Parent::wxWindow:wxWindow(), Data::wxFindReplaceData:wxFindReplaceData(), Title::unicode:chardata(),
+ Option :: {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=DataT,ref=DataRef},Title, Options)
when is_list(Title),is_list(Options) ->
?CLASS(ThisT,wxFindReplaceDialog),
@@ -131,15 +139,16 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},#wx_r
wxe_util:call(?wxFindReplaceDialog_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,DataRef:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((0+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxFindReplaceDialog()) -> wxFindReplaceData:wxFindReplaceData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfindreplacedialog.html#wxfindreplacedialoggetdata">external documentation</a>.
+-spec getData(This) -> wxFindReplaceData:wxFindReplaceData() when
+ This::wxFindReplaceDialog().
getData(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFindReplaceDialog),
wxe_util:call(?wxFindReplaceDialog_GetData,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFindReplaceDialog()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxFindReplaceDialog()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxFindReplaceDialog),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxFlexGridSizer.erl b/lib/wx/src/gen/wxFlexGridSizer.erl
index 910cc78894..91dcf6a2e7 100644
--- a/lib/wx/src/gen/wxFlexGridSizer.erl
+++ b/lib/wx/src/gen/wxFlexGridSizer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -45,20 +45,26 @@
setMinSize/2,setMinSize/3,setRows/2,setSizeHints/2,setVGap/2,setVirtualSizeHints/2,
show/2,show/3]).
+-export_type([wxFlexGridSizer/0]).
%% @hidden
parent_class(wxGridSizer) -> true;
parent_class(wxSizer) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Cols::integer()) -> wxFlexGridSizer()
+-type wxFlexGridSizer() :: wx:wx_object().
%% @equiv new(Cols, [])
+-spec new(Cols) -> wxFlexGridSizer() when
+ Cols::integer().
+
new(Cols)
when is_integer(Cols) ->
new(Cols, []).
-%% @spec (Cols::integer(), [Option]) -> wxFlexGridSizer()
-%% Option = {vgap, integer()} | {hgap, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxflexgridsizer.html#wxflexgridsizerwxflexgridsizer">external documentation</a>.
+-spec new(Cols, [Option]) -> wxFlexGridSizer() when
+ Cols::integer(),
+ Option :: {vgap, integer()}
+ | {hgap, integer()}.
new(Cols, Options)
when is_integer(Cols),is_list(Options) ->
MOpts = fun({vgap, Vgap}, Acc) -> [<<1:32/?UI,Vgap:32/?UI>>|Acc];
@@ -68,22 +74,26 @@ new(Cols, Options)
wxe_util:construct(?wxFlexGridSizer_new_2,
<<Cols:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (Rows::integer(), Cols::integer(), Vgap::integer(), Hgap::integer()) -> wxFlexGridSizer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxflexgridsizer.html#wxflexgridsizerwxflexgridsizer">external documentation</a>.
+-spec new(Rows, Cols, Vgap, Hgap) -> wxFlexGridSizer() when
+ Rows::integer(), Cols::integer(), Vgap::integer(), Hgap::integer().
new(Rows,Cols,Vgap,Hgap)
when is_integer(Rows),is_integer(Cols),is_integer(Vgap),is_integer(Hgap) ->
wxe_util:construct(?wxFlexGridSizer_new_4,
<<Rows:32/?UI,Cols:32/?UI,Vgap:32/?UI,Hgap:32/?UI>>).
-%% @spec (This::wxFlexGridSizer(), Idx::integer()) -> ok
%% @equiv addGrowableCol(This,Idx, [])
+-spec addGrowableCol(This, Idx) -> ok when
+ This::wxFlexGridSizer(), Idx::integer().
+
addGrowableCol(This,Idx)
when is_record(This, wx_ref),is_integer(Idx) ->
addGrowableCol(This,Idx, []).
-%% @spec (This::wxFlexGridSizer(), Idx::integer(), [Option]) -> ok
-%% Option = {proportion, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxflexgridsizer.html#wxflexgridsizeraddgrowablecol">external documentation</a>.
+-spec addGrowableCol(This, Idx, [Option]) -> ok when
+ This::wxFlexGridSizer(), Idx::integer(),
+ Option :: {proportion, integer()}.
addGrowableCol(#wx_ref{type=ThisT,ref=ThisRef},Idx, Options)
when is_integer(Idx),is_list(Options) ->
?CLASS(ThisT,wxFlexGridSizer),
@@ -93,15 +103,18 @@ addGrowableCol(#wx_ref{type=ThisT,ref=ThisRef},Idx, Options)
wxe_util:cast(?wxFlexGridSizer_AddGrowableCol,
<<ThisRef:32/?UI,Idx:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxFlexGridSizer(), Idx::integer()) -> ok
%% @equiv addGrowableRow(This,Idx, [])
+-spec addGrowableRow(This, Idx) -> ok when
+ This::wxFlexGridSizer(), Idx::integer().
+
addGrowableRow(This,Idx)
when is_record(This, wx_ref),is_integer(Idx) ->
addGrowableRow(This,Idx, []).
-%% @spec (This::wxFlexGridSizer(), Idx::integer(), [Option]) -> ok
-%% Option = {proportion, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxflexgridsizer.html#wxflexgridsizeraddgrowablerow">external documentation</a>.
+-spec addGrowableRow(This, Idx, [Option]) -> ok when
+ This::wxFlexGridSizer(), Idx::integer(),
+ Option :: {proportion, integer()}.
addGrowableRow(#wx_ref{type=ThisT,ref=ThisRef},Idx, Options)
when is_integer(Idx),is_list(Options) ->
?CLASS(ThisT,wxFlexGridSizer),
@@ -111,58 +124,62 @@ addGrowableRow(#wx_ref{type=ThisT,ref=ThisRef},Idx, Options)
wxe_util:cast(?wxFlexGridSizer_AddGrowableRow,
<<ThisRef:32/?UI,Idx:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxFlexGridSizer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxflexgridsizer.html#wxflexgridsizergetflexibledirection">external documentation</a>.
+-spec getFlexibleDirection(This) -> integer() when
+ This::wxFlexGridSizer().
getFlexibleDirection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFlexGridSizer),
wxe_util:call(?wxFlexGridSizer_GetFlexibleDirection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFlexGridSizer()) -> WxFlexSizerGrowMode
-%% WxFlexSizerGrowMode = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxflexgridsizer.html#wxflexgridsizergetnonflexiblegrowmode">external documentation</a>.
-%%<br /> WxFlexSizerGrowMode is one of ?wxFLEX_GROWMODE_NONE | ?wxFLEX_GROWMODE_SPECIFIED | ?wxFLEX_GROWMODE_ALL
+%%<br /> Res = ?wxFLEX_GROWMODE_NONE | ?wxFLEX_GROWMODE_SPECIFIED | ?wxFLEX_GROWMODE_ALL
+-spec getNonFlexibleGrowMode(This) -> wx:wx_enum() when
+ This::wxFlexGridSizer().
getNonFlexibleGrowMode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFlexGridSizer),
wxe_util:call(?wxFlexGridSizer_GetNonFlexibleGrowMode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFlexGridSizer(), Idx::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxflexgridsizer.html#wxflexgridsizerremovegrowablecol">external documentation</a>.
+-spec removeGrowableCol(This, Idx) -> ok when
+ This::wxFlexGridSizer(), Idx::integer().
removeGrowableCol(#wx_ref{type=ThisT,ref=ThisRef},Idx)
when is_integer(Idx) ->
?CLASS(ThisT,wxFlexGridSizer),
wxe_util:cast(?wxFlexGridSizer_RemoveGrowableCol,
<<ThisRef:32/?UI,Idx:32/?UI>>).
-%% @spec (This::wxFlexGridSizer(), Idx::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxflexgridsizer.html#wxflexgridsizerremovegrowablerow">external documentation</a>.
+-spec removeGrowableRow(This, Idx) -> ok when
+ This::wxFlexGridSizer(), Idx::integer().
removeGrowableRow(#wx_ref{type=ThisT,ref=ThisRef},Idx)
when is_integer(Idx) ->
?CLASS(ThisT,wxFlexGridSizer),
wxe_util:cast(?wxFlexGridSizer_RemoveGrowableRow,
<<ThisRef:32/?UI,Idx:32/?UI>>).
-%% @spec (This::wxFlexGridSizer(), Direction::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxflexgridsizer.html#wxflexgridsizersetflexibledirection">external documentation</a>.
+-spec setFlexibleDirection(This, Direction) -> ok when
+ This::wxFlexGridSizer(), Direction::integer().
setFlexibleDirection(#wx_ref{type=ThisT,ref=ThisRef},Direction)
when is_integer(Direction) ->
?CLASS(ThisT,wxFlexGridSizer),
wxe_util:cast(?wxFlexGridSizer_SetFlexibleDirection,
<<ThisRef:32/?UI,Direction:32/?UI>>).
-%% @spec (This::wxFlexGridSizer(), Mode::WxFlexSizerGrowMode) -> ok
-%% WxFlexSizerGrowMode = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxflexgridsizer.html#wxflexgridsizersetnonflexiblegrowmode">external documentation</a>.
-%%<br /> WxFlexSizerGrowMode is one of ?wxFLEX_GROWMODE_NONE | ?wxFLEX_GROWMODE_SPECIFIED | ?wxFLEX_GROWMODE_ALL
+%%<br /> Mode = ?wxFLEX_GROWMODE_NONE | ?wxFLEX_GROWMODE_SPECIFIED | ?wxFLEX_GROWMODE_ALL
+-spec setNonFlexibleGrowMode(This, Mode) -> ok when
+ This::wxFlexGridSizer(), Mode::wx:wx_enum().
setNonFlexibleGrowMode(#wx_ref{type=ThisT,ref=ThisRef},Mode)
when is_integer(Mode) ->
?CLASS(ThisT,wxFlexGridSizer),
wxe_util:cast(?wxFlexGridSizer_SetNonFlexibleGrowMode,
<<ThisRef:32/?UI,Mode:32/?UI>>).
-%% @spec (This::wxFlexGridSizer()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxFlexGridSizer()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxFlexGridSizer),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxFocusEvent.erl b/lib/wx/src/gen/wxFocusEvent.erl
index 46f2e2a3df..d6478c1142 100644
--- a/lib/wx/src/gen/wxFocusEvent.erl
+++ b/lib/wx/src/gen/wxFocusEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,12 +37,15 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxFocusEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxFocusEvent()) -> wxWindow:wxWindow()
+-type wxFocusEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfocusevent.html#wxfocuseventgetwindow">external documentation</a>.
+-spec getWindow(This) -> wxWindow:wxWindow() when
+ This::wxFocusEvent().
getWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFocusEvent),
wxe_util:call(?wxFocusEvent_GetWindow,
diff --git a/lib/wx/src/gen/wxFont.erl b/lib/wx/src/gen/wxFont.erl
index 4afc53cfa8..a168e15180 100644
--- a/lib/wx/src/gen/wxFont.erl
+++ b/lib/wx/src/gen/wxFont.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -33,38 +33,43 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxFont/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxFont()
+-type wxFont() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontwxfont">external documentation</a>.
+-spec new() -> wxFont().
new() ->
wxe_util:construct(?wxFont_new_0,
<<>>).
-%% @spec (Fontname::string()) -> wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontwxfont">external documentation</a>.
+-spec new(Fontname) -> wxFont() when
+ Fontname::unicode:chardata().
new(Fontname)
when is_list(Fontname) ->
Fontname_UC = unicode:characters_to_binary([Fontname,0]),
wxe_util:construct(?wxFont_new_1,
<<(byte_size(Fontname_UC)):32/?UI,(Fontname_UC)/binary, 0:(((8- ((4+byte_size(Fontname_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (Size::integer(), Family::WxFontFamily, Style::WxFontStyle, Weight::integer()) -> wxFont()
%% @equiv new(Size,Family,Style,Weight, [])
+-spec new(Size, Family, Style, Weight) -> wxFont() when
+ Size::integer(), Family::wx:wx_enum(), Style::wx:wx_enum(), Weight::integer().
+
new(Size,Family,Style,Weight)
when is_integer(Size),is_integer(Family),is_integer(Style),is_integer(Weight) ->
new(Size,Family,Style,Weight, []).
-%% @spec (Size::integer(), Family::WxFontFamily, Style::WxFontStyle, Weight::integer(), [Option]) -> wxFont()
-%% Option = {underlined, bool()} | {face, string()} | {encoding, WxFontEncoding}
-%% WxFontFamily = integer()
-%% WxFontStyle = integer()
-%% WxFontEncoding = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontwxfont">external documentation</a>.
-%%<br /> WxFontFamily is one of ?wxFONTFAMILY_DEFAULT | ?wxFONTFAMILY_DECORATIVE | ?wxFONTFAMILY_ROMAN | ?wxFONTFAMILY_SCRIPT | ?wxFONTFAMILY_SWISS | ?wxFONTFAMILY_MODERN | ?wxFONTFAMILY_TELETYPE | ?wxFONTFAMILY_MAX | ?wxFONTFAMILY_UNKNOWN
-%%<br /> WxFontStyle is one of ?wxFONTSTYLE_NORMAL | ?wxFONTSTYLE_ITALIC | ?wxFONTSTYLE_SLANT | ?wxFONTSTYLE_MAX
-%%<br /> WxFontEncoding is one of ?wxFONTENCODING_SYSTEM | ?wxFONTENCODING_DEFAULT | ?wxFONTENCODING_ISO8859_1 | ?wxFONTENCODING_ISO8859_2 | ?wxFONTENCODING_ISO8859_3 | ?wxFONTENCODING_ISO8859_4 | ?wxFONTENCODING_ISO8859_5 | ?wxFONTENCODING_ISO8859_6 | ?wxFONTENCODING_ISO8859_7 | ?wxFONTENCODING_ISO8859_8 | ?wxFONTENCODING_ISO8859_9 | ?wxFONTENCODING_ISO8859_10 | ?wxFONTENCODING_ISO8859_11 | ?wxFONTENCODING_ISO8859_12 | ?wxFONTENCODING_ISO8859_13 | ?wxFONTENCODING_ISO8859_14 | ?wxFONTENCODING_ISO8859_15 | ?wxFONTENCODING_ISO8859_MAX | ?wxFONTENCODING_KOI8 | ?wxFONTENCODING_KOI8_U | ?wxFONTENCODING_ALTERNATIVE | ?wxFONTENCODING_BULGARIAN | ?wxFONTENCODING_CP437 | ?wxFONTENCODING_CP850 | ?wxFONTENCODING_CP852 | ?wxFONTENCODING_CP855 | ?wxFONTENCODING_CP866 | ?wxFONTENCODING_CP874 | ?wxFONTENCODING_CP932 | ?wxFONTENCODING_CP936 | ?wxFONTENCODING_CP949 | ?wxFONTENCODING_CP950 | ?wxFONTENCODING_CP1250 | ?wxFONTENCODING_CP1251 | ?wxFONTENCODING_CP1252 | ?wxFONTENCODING_CP1253 | ?wxFONTENCODING_CP1254 | ?wxFONTENCODING_CP1255 | ?wxFONTENCODING_CP1256 | ?wxFONTENCODING_CP1257 | ?wxFONTENCODING_CP12_MAX | ?wxFONTENCODING_UTF7 | ?wxFONTENCODING_UTF8 | ?wxFONTENCODING_EUC_JP | ?wxFONTENCODING_UTF16BE | ?wxFONTENCODING_UTF16LE | ?wxFONTENCODING_UTF32BE | ?wxFONTENCODING_UTF32LE | ?wxFONTENCODING_MACROMAN | ?wxFONTENCODING_MACJAPANESE | ?wxFONTENCODING_MACCHINESETRAD | ?wxFONTENCODING_MACKOREAN | ?wxFONTENCODING_MACARABIC | ?wxFONTENCODING_MACHEBREW | ?wxFONTENCODING_MACGREEK | ?wxFONTENCODING_MACCYRILLIC | ?wxFONTENCODING_MACDEVANAGARI | ?wxFONTENCODING_MACGURMUKHI | ?wxFONTENCODING_MACGUJARATI | ?wxFONTENCODING_MACORIYA | ?wxFONTENCODING_MACBENGALI | ?wxFONTENCODING_MACTAMIL | ?wxFONTENCODING_MACTELUGU | ?wxFONTENCODING_MACKANNADA | ?wxFONTENCODING_MACMALAJALAM | ?wxFONTENCODING_MACSINHALESE | ?wxFONTENCODING_MACBURMESE | ?wxFONTENCODING_MACKHMER | ?wxFONTENCODING_MACTHAI | ?wxFONTENCODING_MACLAOTIAN | ?wxFONTENCODING_MACGEORGIAN | ?wxFONTENCODING_MACARMENIAN | ?wxFONTENCODING_MACCHINESESIMP | ?wxFONTENCODING_MACTIBETAN | ?wxFONTENCODING_MACMONGOLIAN | ?wxFONTENCODING_MACETHIOPIC | ?wxFONTENCODING_MACCENTRALEUR | ?wxFONTENCODING_MACVIATNAMESE | ?wxFONTENCODING_MACARABICEXT | ?wxFONTENCODING_MACSYMBOL | ?wxFONTENCODING_MACDINGBATS | ?wxFONTENCODING_MACTURKISH | ?wxFONTENCODING_MACCROATIAN | ?wxFONTENCODING_MACICELANDIC | ?wxFONTENCODING_MACROMANIAN | ?wxFONTENCODING_MACCELTIC | ?wxFONTENCODING_MACGAELIC | ?wxFONTENCODING_MACKEYBOARD | ?wxFONTENCODING_MAX | ?wxFONTENCODING_MACMIN | ?wxFONTENCODING_MACMAX | ?wxFONTENCODING_UTF16 | ?wxFONTENCODING_UTF32 | ?wxFONTENCODING_UNICODE | ?wxFONTENCODING_GB2312 | ?wxFONTENCODING_BIG5 | ?wxFONTENCODING_SHIFT_JIS
+%%<br /> Encoding = ?wxFONTENCODING_SYSTEM | ?wxFONTENCODING_DEFAULT | ?wxFONTENCODING_ISO8859_1 | ?wxFONTENCODING_ISO8859_2 | ?wxFONTENCODING_ISO8859_3 | ?wxFONTENCODING_ISO8859_4 | ?wxFONTENCODING_ISO8859_5 | ?wxFONTENCODING_ISO8859_6 | ?wxFONTENCODING_ISO8859_7 | ?wxFONTENCODING_ISO8859_8 | ?wxFONTENCODING_ISO8859_9 | ?wxFONTENCODING_ISO8859_10 | ?wxFONTENCODING_ISO8859_11 | ?wxFONTENCODING_ISO8859_12 | ?wxFONTENCODING_ISO8859_13 | ?wxFONTENCODING_ISO8859_14 | ?wxFONTENCODING_ISO8859_15 | ?wxFONTENCODING_ISO8859_MAX | ?wxFONTENCODING_KOI8 | ?wxFONTENCODING_KOI8_U | ?wxFONTENCODING_ALTERNATIVE | ?wxFONTENCODING_BULGARIAN | ?wxFONTENCODING_CP437 | ?wxFONTENCODING_CP850 | ?wxFONTENCODING_CP852 | ?wxFONTENCODING_CP855 | ?wxFONTENCODING_CP866 | ?wxFONTENCODING_CP874 | ?wxFONTENCODING_CP932 | ?wxFONTENCODING_CP936 | ?wxFONTENCODING_CP949 | ?wxFONTENCODING_CP950 | ?wxFONTENCODING_CP1250 | ?wxFONTENCODING_CP1251 | ?wxFONTENCODING_CP1252 | ?wxFONTENCODING_CP1253 | ?wxFONTENCODING_CP1254 | ?wxFONTENCODING_CP1255 | ?wxFONTENCODING_CP1256 | ?wxFONTENCODING_CP1257 | ?wxFONTENCODING_CP12_MAX | ?wxFONTENCODING_UTF7 | ?wxFONTENCODING_UTF8 | ?wxFONTENCODING_EUC_JP | ?wxFONTENCODING_UTF16BE | ?wxFONTENCODING_UTF16LE | ?wxFONTENCODING_UTF32BE | ?wxFONTENCODING_UTF32LE | ?wxFONTENCODING_MACROMAN | ?wxFONTENCODING_MACJAPANESE | ?wxFONTENCODING_MACCHINESETRAD | ?wxFONTENCODING_MACKOREAN | ?wxFONTENCODING_MACARABIC | ?wxFONTENCODING_MACHEBREW | ?wxFONTENCODING_MACGREEK | ?wxFONTENCODING_MACCYRILLIC | ?wxFONTENCODING_MACDEVANAGARI | ?wxFONTENCODING_MACGURMUKHI | ?wxFONTENCODING_MACGUJARATI | ?wxFONTENCODING_MACORIYA | ?wxFONTENCODING_MACBENGALI | ?wxFONTENCODING_MACTAMIL | ?wxFONTENCODING_MACTELUGU | ?wxFONTENCODING_MACKANNADA | ?wxFONTENCODING_MACMALAJALAM | ?wxFONTENCODING_MACSINHALESE | ?wxFONTENCODING_MACBURMESE | ?wxFONTENCODING_MACKHMER | ?wxFONTENCODING_MACTHAI | ?wxFONTENCODING_MACLAOTIAN | ?wxFONTENCODING_MACGEORGIAN | ?wxFONTENCODING_MACARMENIAN | ?wxFONTENCODING_MACCHINESESIMP | ?wxFONTENCODING_MACTIBETAN | ?wxFONTENCODING_MACMONGOLIAN | ?wxFONTENCODING_MACETHIOPIC | ?wxFONTENCODING_MACCENTRALEUR | ?wxFONTENCODING_MACVIATNAMESE | ?wxFONTENCODING_MACARABICEXT | ?wxFONTENCODING_MACSYMBOL | ?wxFONTENCODING_MACDINGBATS | ?wxFONTENCODING_MACTURKISH | ?wxFONTENCODING_MACCROATIAN | ?wxFONTENCODING_MACICELANDIC | ?wxFONTENCODING_MACROMANIAN | ?wxFONTENCODING_MACCELTIC | ?wxFONTENCODING_MACGAELIC | ?wxFONTENCODING_MACKEYBOARD | ?wxFONTENCODING_MAX | ?wxFONTENCODING_MACMIN | ?wxFONTENCODING_MACMAX | ?wxFONTENCODING_UTF16 | ?wxFONTENCODING_UTF32 | ?wxFONTENCODING_UNICODE | ?wxFONTENCODING_GB2312 | ?wxFONTENCODING_BIG5 | ?wxFONTENCODING_SHIFT_JIS
+%%<br /> Family = ?wxFONTFAMILY_DEFAULT | ?wxFONTFAMILY_DECORATIVE | ?wxFONTFAMILY_ROMAN | ?wxFONTFAMILY_SCRIPT | ?wxFONTFAMILY_SWISS | ?wxFONTFAMILY_MODERN | ?wxFONTFAMILY_TELETYPE | ?wxFONTFAMILY_MAX | ?wxFONTFAMILY_UNKNOWN
+%%<br /> Style = ?wxFONTSTYLE_NORMAL | ?wxFONTSTYLE_ITALIC | ?wxFONTSTYLE_SLANT | ?wxFONTSTYLE_MAX
+-spec new(Size, Family, Style, Weight, [Option]) -> wxFont() when
+ Size::integer(), Family::wx:wx_enum(), Style::wx:wx_enum(), Weight::integer(),
+ Option :: {underlined, boolean()}
+ | {face, unicode:chardata()}
+ | {encoding, wx:wx_enum()}.
new(Size,Family,Style,Weight, Options)
when is_integer(Size),is_integer(Family),is_integer(Style),is_integer(Weight),is_list(Options) ->
MOpts = fun({underlined, Underlined}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Underlined)):32/?UI>>|Acc];
@@ -75,99 +80,107 @@ new(Size,Family,Style,Weight, Options)
wxe_util:construct(?wxFont_new_5,
<<Size:32/?UI,Family:32/?UI,Style:32/?UI,Weight:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxFont()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontisfixedwidth">external documentation</a>.
+-spec isFixedWidth(This) -> boolean() when
+ This::wxFont().
isFixedWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFont),
wxe_util:call(?wxFont_IsFixedWidth,
<<ThisRef:32/?UI>>).
-%% @spec () -> WxFontEncoding
-%% WxFontEncoding = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontgetdefaultencoding">external documentation</a>.
-%%<br /> WxFontEncoding is one of ?wxFONTENCODING_SYSTEM | ?wxFONTENCODING_DEFAULT | ?wxFONTENCODING_ISO8859_1 | ?wxFONTENCODING_ISO8859_2 | ?wxFONTENCODING_ISO8859_3 | ?wxFONTENCODING_ISO8859_4 | ?wxFONTENCODING_ISO8859_5 | ?wxFONTENCODING_ISO8859_6 | ?wxFONTENCODING_ISO8859_7 | ?wxFONTENCODING_ISO8859_8 | ?wxFONTENCODING_ISO8859_9 | ?wxFONTENCODING_ISO8859_10 | ?wxFONTENCODING_ISO8859_11 | ?wxFONTENCODING_ISO8859_12 | ?wxFONTENCODING_ISO8859_13 | ?wxFONTENCODING_ISO8859_14 | ?wxFONTENCODING_ISO8859_15 | ?wxFONTENCODING_ISO8859_MAX | ?wxFONTENCODING_KOI8 | ?wxFONTENCODING_KOI8_U | ?wxFONTENCODING_ALTERNATIVE | ?wxFONTENCODING_BULGARIAN | ?wxFONTENCODING_CP437 | ?wxFONTENCODING_CP850 | ?wxFONTENCODING_CP852 | ?wxFONTENCODING_CP855 | ?wxFONTENCODING_CP866 | ?wxFONTENCODING_CP874 | ?wxFONTENCODING_CP932 | ?wxFONTENCODING_CP936 | ?wxFONTENCODING_CP949 | ?wxFONTENCODING_CP950 | ?wxFONTENCODING_CP1250 | ?wxFONTENCODING_CP1251 | ?wxFONTENCODING_CP1252 | ?wxFONTENCODING_CP1253 | ?wxFONTENCODING_CP1254 | ?wxFONTENCODING_CP1255 | ?wxFONTENCODING_CP1256 | ?wxFONTENCODING_CP1257 | ?wxFONTENCODING_CP12_MAX | ?wxFONTENCODING_UTF7 | ?wxFONTENCODING_UTF8 | ?wxFONTENCODING_EUC_JP | ?wxFONTENCODING_UTF16BE | ?wxFONTENCODING_UTF16LE | ?wxFONTENCODING_UTF32BE | ?wxFONTENCODING_UTF32LE | ?wxFONTENCODING_MACROMAN | ?wxFONTENCODING_MACJAPANESE | ?wxFONTENCODING_MACCHINESETRAD | ?wxFONTENCODING_MACKOREAN | ?wxFONTENCODING_MACARABIC | ?wxFONTENCODING_MACHEBREW | ?wxFONTENCODING_MACGREEK | ?wxFONTENCODING_MACCYRILLIC | ?wxFONTENCODING_MACDEVANAGARI | ?wxFONTENCODING_MACGURMUKHI | ?wxFONTENCODING_MACGUJARATI | ?wxFONTENCODING_MACORIYA | ?wxFONTENCODING_MACBENGALI | ?wxFONTENCODING_MACTAMIL | ?wxFONTENCODING_MACTELUGU | ?wxFONTENCODING_MACKANNADA | ?wxFONTENCODING_MACMALAJALAM | ?wxFONTENCODING_MACSINHALESE | ?wxFONTENCODING_MACBURMESE | ?wxFONTENCODING_MACKHMER | ?wxFONTENCODING_MACTHAI | ?wxFONTENCODING_MACLAOTIAN | ?wxFONTENCODING_MACGEORGIAN | ?wxFONTENCODING_MACARMENIAN | ?wxFONTENCODING_MACCHINESESIMP | ?wxFONTENCODING_MACTIBETAN | ?wxFONTENCODING_MACMONGOLIAN | ?wxFONTENCODING_MACETHIOPIC | ?wxFONTENCODING_MACCENTRALEUR | ?wxFONTENCODING_MACVIATNAMESE | ?wxFONTENCODING_MACARABICEXT | ?wxFONTENCODING_MACSYMBOL | ?wxFONTENCODING_MACDINGBATS | ?wxFONTENCODING_MACTURKISH | ?wxFONTENCODING_MACCROATIAN | ?wxFONTENCODING_MACICELANDIC | ?wxFONTENCODING_MACROMANIAN | ?wxFONTENCODING_MACCELTIC | ?wxFONTENCODING_MACGAELIC | ?wxFONTENCODING_MACKEYBOARD | ?wxFONTENCODING_MAX | ?wxFONTENCODING_MACMIN | ?wxFONTENCODING_MACMAX | ?wxFONTENCODING_UTF16 | ?wxFONTENCODING_UTF32 | ?wxFONTENCODING_UNICODE | ?wxFONTENCODING_GB2312 | ?wxFONTENCODING_BIG5 | ?wxFONTENCODING_SHIFT_JIS
+%%<br /> Res = ?wxFONTENCODING_SYSTEM | ?wxFONTENCODING_DEFAULT | ?wxFONTENCODING_ISO8859_1 | ?wxFONTENCODING_ISO8859_2 | ?wxFONTENCODING_ISO8859_3 | ?wxFONTENCODING_ISO8859_4 | ?wxFONTENCODING_ISO8859_5 | ?wxFONTENCODING_ISO8859_6 | ?wxFONTENCODING_ISO8859_7 | ?wxFONTENCODING_ISO8859_8 | ?wxFONTENCODING_ISO8859_9 | ?wxFONTENCODING_ISO8859_10 | ?wxFONTENCODING_ISO8859_11 | ?wxFONTENCODING_ISO8859_12 | ?wxFONTENCODING_ISO8859_13 | ?wxFONTENCODING_ISO8859_14 | ?wxFONTENCODING_ISO8859_15 | ?wxFONTENCODING_ISO8859_MAX | ?wxFONTENCODING_KOI8 | ?wxFONTENCODING_KOI8_U | ?wxFONTENCODING_ALTERNATIVE | ?wxFONTENCODING_BULGARIAN | ?wxFONTENCODING_CP437 | ?wxFONTENCODING_CP850 | ?wxFONTENCODING_CP852 | ?wxFONTENCODING_CP855 | ?wxFONTENCODING_CP866 | ?wxFONTENCODING_CP874 | ?wxFONTENCODING_CP932 | ?wxFONTENCODING_CP936 | ?wxFONTENCODING_CP949 | ?wxFONTENCODING_CP950 | ?wxFONTENCODING_CP1250 | ?wxFONTENCODING_CP1251 | ?wxFONTENCODING_CP1252 | ?wxFONTENCODING_CP1253 | ?wxFONTENCODING_CP1254 | ?wxFONTENCODING_CP1255 | ?wxFONTENCODING_CP1256 | ?wxFONTENCODING_CP1257 | ?wxFONTENCODING_CP12_MAX | ?wxFONTENCODING_UTF7 | ?wxFONTENCODING_UTF8 | ?wxFONTENCODING_EUC_JP | ?wxFONTENCODING_UTF16BE | ?wxFONTENCODING_UTF16LE | ?wxFONTENCODING_UTF32BE | ?wxFONTENCODING_UTF32LE | ?wxFONTENCODING_MACROMAN | ?wxFONTENCODING_MACJAPANESE | ?wxFONTENCODING_MACCHINESETRAD | ?wxFONTENCODING_MACKOREAN | ?wxFONTENCODING_MACARABIC | ?wxFONTENCODING_MACHEBREW | ?wxFONTENCODING_MACGREEK | ?wxFONTENCODING_MACCYRILLIC | ?wxFONTENCODING_MACDEVANAGARI | ?wxFONTENCODING_MACGURMUKHI | ?wxFONTENCODING_MACGUJARATI | ?wxFONTENCODING_MACORIYA | ?wxFONTENCODING_MACBENGALI | ?wxFONTENCODING_MACTAMIL | ?wxFONTENCODING_MACTELUGU | ?wxFONTENCODING_MACKANNADA | ?wxFONTENCODING_MACMALAJALAM | ?wxFONTENCODING_MACSINHALESE | ?wxFONTENCODING_MACBURMESE | ?wxFONTENCODING_MACKHMER | ?wxFONTENCODING_MACTHAI | ?wxFONTENCODING_MACLAOTIAN | ?wxFONTENCODING_MACGEORGIAN | ?wxFONTENCODING_MACARMENIAN | ?wxFONTENCODING_MACCHINESESIMP | ?wxFONTENCODING_MACTIBETAN | ?wxFONTENCODING_MACMONGOLIAN | ?wxFONTENCODING_MACETHIOPIC | ?wxFONTENCODING_MACCENTRALEUR | ?wxFONTENCODING_MACVIATNAMESE | ?wxFONTENCODING_MACARABICEXT | ?wxFONTENCODING_MACSYMBOL | ?wxFONTENCODING_MACDINGBATS | ?wxFONTENCODING_MACTURKISH | ?wxFONTENCODING_MACCROATIAN | ?wxFONTENCODING_MACICELANDIC | ?wxFONTENCODING_MACROMANIAN | ?wxFONTENCODING_MACCELTIC | ?wxFONTENCODING_MACGAELIC | ?wxFONTENCODING_MACKEYBOARD | ?wxFONTENCODING_MAX | ?wxFONTENCODING_MACMIN | ?wxFONTENCODING_MACMAX | ?wxFONTENCODING_UTF16 | ?wxFONTENCODING_UTF32 | ?wxFONTENCODING_UNICODE | ?wxFONTENCODING_GB2312 | ?wxFONTENCODING_BIG5 | ?wxFONTENCODING_SHIFT_JIS
+-spec getDefaultEncoding() -> wx:wx_enum().
getDefaultEncoding() ->
wxe_util:call(?wxFont_GetDefaultEncoding,
<<>>).
-%% @spec (This::wxFont()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontgetfacename">external documentation</a>.
+-spec getFaceName(This) -> unicode:charlist() when
+ This::wxFont().
getFaceName(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFont),
wxe_util:call(?wxFont_GetFaceName,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFont()) -> WxFontFamily
-%% WxFontFamily = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontgetfamily">external documentation</a>.
-%%<br /> WxFontFamily is one of ?wxFONTFAMILY_DEFAULT | ?wxFONTFAMILY_DECORATIVE | ?wxFONTFAMILY_ROMAN | ?wxFONTFAMILY_SCRIPT | ?wxFONTFAMILY_SWISS | ?wxFONTFAMILY_MODERN | ?wxFONTFAMILY_TELETYPE | ?wxFONTFAMILY_MAX | ?wxFONTFAMILY_UNKNOWN
+%%<br /> Res = ?wxFONTFAMILY_DEFAULT | ?wxFONTFAMILY_DECORATIVE | ?wxFONTFAMILY_ROMAN | ?wxFONTFAMILY_SCRIPT | ?wxFONTFAMILY_SWISS | ?wxFONTFAMILY_MODERN | ?wxFONTFAMILY_TELETYPE | ?wxFONTFAMILY_MAX | ?wxFONTFAMILY_UNKNOWN
+-spec getFamily(This) -> wx:wx_enum() when
+ This::wxFont().
getFamily(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFont),
wxe_util:call(?wxFont_GetFamily,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFont()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontgetnativefontinfodesc">external documentation</a>.
+-spec getNativeFontInfoDesc(This) -> unicode:charlist() when
+ This::wxFont().
getNativeFontInfoDesc(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFont),
wxe_util:call(?wxFont_GetNativeFontInfoDesc,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFont()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontgetnativefontinfouserdesc">external documentation</a>.
+-spec getNativeFontInfoUserDesc(This) -> unicode:charlist() when
+ This::wxFont().
getNativeFontInfoUserDesc(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFont),
wxe_util:call(?wxFont_GetNativeFontInfoUserDesc,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFont()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontgetpointsize">external documentation</a>.
+-spec getPointSize(This) -> integer() when
+ This::wxFont().
getPointSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFont),
wxe_util:call(?wxFont_GetPointSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFont()) -> WxFontStyle
-%% WxFontStyle = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontgetstyle">external documentation</a>.
-%%<br /> WxFontStyle is one of ?wxFONTSTYLE_NORMAL | ?wxFONTSTYLE_ITALIC | ?wxFONTSTYLE_SLANT | ?wxFONTSTYLE_MAX
+%%<br /> Res = ?wxFONTSTYLE_NORMAL | ?wxFONTSTYLE_ITALIC | ?wxFONTSTYLE_SLANT | ?wxFONTSTYLE_MAX
+-spec getStyle(This) -> wx:wx_enum() when
+ This::wxFont().
getStyle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFont),
wxe_util:call(?wxFont_GetStyle,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFont()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontgetunderlined">external documentation</a>.
+-spec getUnderlined(This) -> boolean() when
+ This::wxFont().
getUnderlined(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFont),
wxe_util:call(?wxFont_GetUnderlined,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFont()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontgetweight">external documentation</a>.
+-spec getWeight(This) -> integer() when
+ This::wxFont().
getWeight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFont),
wxe_util:call(?wxFont_GetWeight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFont()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontok">external documentation</a>.
+-spec ok(This) -> boolean() when
+ This::wxFont().
ok(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFont),
wxe_util:call(?wxFont_Ok,
<<ThisRef:32/?UI>>).
-%% @spec (Encoding::WxFontEncoding) -> ok
-%% WxFontEncoding = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontsetdefaultencoding">external documentation</a>.
-%%<br /> WxFontEncoding is one of ?wxFONTENCODING_SYSTEM | ?wxFONTENCODING_DEFAULT | ?wxFONTENCODING_ISO8859_1 | ?wxFONTENCODING_ISO8859_2 | ?wxFONTENCODING_ISO8859_3 | ?wxFONTENCODING_ISO8859_4 | ?wxFONTENCODING_ISO8859_5 | ?wxFONTENCODING_ISO8859_6 | ?wxFONTENCODING_ISO8859_7 | ?wxFONTENCODING_ISO8859_8 | ?wxFONTENCODING_ISO8859_9 | ?wxFONTENCODING_ISO8859_10 | ?wxFONTENCODING_ISO8859_11 | ?wxFONTENCODING_ISO8859_12 | ?wxFONTENCODING_ISO8859_13 | ?wxFONTENCODING_ISO8859_14 | ?wxFONTENCODING_ISO8859_15 | ?wxFONTENCODING_ISO8859_MAX | ?wxFONTENCODING_KOI8 | ?wxFONTENCODING_KOI8_U | ?wxFONTENCODING_ALTERNATIVE | ?wxFONTENCODING_BULGARIAN | ?wxFONTENCODING_CP437 | ?wxFONTENCODING_CP850 | ?wxFONTENCODING_CP852 | ?wxFONTENCODING_CP855 | ?wxFONTENCODING_CP866 | ?wxFONTENCODING_CP874 | ?wxFONTENCODING_CP932 | ?wxFONTENCODING_CP936 | ?wxFONTENCODING_CP949 | ?wxFONTENCODING_CP950 | ?wxFONTENCODING_CP1250 | ?wxFONTENCODING_CP1251 | ?wxFONTENCODING_CP1252 | ?wxFONTENCODING_CP1253 | ?wxFONTENCODING_CP1254 | ?wxFONTENCODING_CP1255 | ?wxFONTENCODING_CP1256 | ?wxFONTENCODING_CP1257 | ?wxFONTENCODING_CP12_MAX | ?wxFONTENCODING_UTF7 | ?wxFONTENCODING_UTF8 | ?wxFONTENCODING_EUC_JP | ?wxFONTENCODING_UTF16BE | ?wxFONTENCODING_UTF16LE | ?wxFONTENCODING_UTF32BE | ?wxFONTENCODING_UTF32LE | ?wxFONTENCODING_MACROMAN | ?wxFONTENCODING_MACJAPANESE | ?wxFONTENCODING_MACCHINESETRAD | ?wxFONTENCODING_MACKOREAN | ?wxFONTENCODING_MACARABIC | ?wxFONTENCODING_MACHEBREW | ?wxFONTENCODING_MACGREEK | ?wxFONTENCODING_MACCYRILLIC | ?wxFONTENCODING_MACDEVANAGARI | ?wxFONTENCODING_MACGURMUKHI | ?wxFONTENCODING_MACGUJARATI | ?wxFONTENCODING_MACORIYA | ?wxFONTENCODING_MACBENGALI | ?wxFONTENCODING_MACTAMIL | ?wxFONTENCODING_MACTELUGU | ?wxFONTENCODING_MACKANNADA | ?wxFONTENCODING_MACMALAJALAM | ?wxFONTENCODING_MACSINHALESE | ?wxFONTENCODING_MACBURMESE | ?wxFONTENCODING_MACKHMER | ?wxFONTENCODING_MACTHAI | ?wxFONTENCODING_MACLAOTIAN | ?wxFONTENCODING_MACGEORGIAN | ?wxFONTENCODING_MACARMENIAN | ?wxFONTENCODING_MACCHINESESIMP | ?wxFONTENCODING_MACTIBETAN | ?wxFONTENCODING_MACMONGOLIAN | ?wxFONTENCODING_MACETHIOPIC | ?wxFONTENCODING_MACCENTRALEUR | ?wxFONTENCODING_MACVIATNAMESE | ?wxFONTENCODING_MACARABICEXT | ?wxFONTENCODING_MACSYMBOL | ?wxFONTENCODING_MACDINGBATS | ?wxFONTENCODING_MACTURKISH | ?wxFONTENCODING_MACCROATIAN | ?wxFONTENCODING_MACICELANDIC | ?wxFONTENCODING_MACROMANIAN | ?wxFONTENCODING_MACCELTIC | ?wxFONTENCODING_MACGAELIC | ?wxFONTENCODING_MACKEYBOARD | ?wxFONTENCODING_MAX | ?wxFONTENCODING_MACMIN | ?wxFONTENCODING_MACMAX | ?wxFONTENCODING_UTF16 | ?wxFONTENCODING_UTF32 | ?wxFONTENCODING_UNICODE | ?wxFONTENCODING_GB2312 | ?wxFONTENCODING_BIG5 | ?wxFONTENCODING_SHIFT_JIS
+%%<br /> Encoding = ?wxFONTENCODING_SYSTEM | ?wxFONTENCODING_DEFAULT | ?wxFONTENCODING_ISO8859_1 | ?wxFONTENCODING_ISO8859_2 | ?wxFONTENCODING_ISO8859_3 | ?wxFONTENCODING_ISO8859_4 | ?wxFONTENCODING_ISO8859_5 | ?wxFONTENCODING_ISO8859_6 | ?wxFONTENCODING_ISO8859_7 | ?wxFONTENCODING_ISO8859_8 | ?wxFONTENCODING_ISO8859_9 | ?wxFONTENCODING_ISO8859_10 | ?wxFONTENCODING_ISO8859_11 | ?wxFONTENCODING_ISO8859_12 | ?wxFONTENCODING_ISO8859_13 | ?wxFONTENCODING_ISO8859_14 | ?wxFONTENCODING_ISO8859_15 | ?wxFONTENCODING_ISO8859_MAX | ?wxFONTENCODING_KOI8 | ?wxFONTENCODING_KOI8_U | ?wxFONTENCODING_ALTERNATIVE | ?wxFONTENCODING_BULGARIAN | ?wxFONTENCODING_CP437 | ?wxFONTENCODING_CP850 | ?wxFONTENCODING_CP852 | ?wxFONTENCODING_CP855 | ?wxFONTENCODING_CP866 | ?wxFONTENCODING_CP874 | ?wxFONTENCODING_CP932 | ?wxFONTENCODING_CP936 | ?wxFONTENCODING_CP949 | ?wxFONTENCODING_CP950 | ?wxFONTENCODING_CP1250 | ?wxFONTENCODING_CP1251 | ?wxFONTENCODING_CP1252 | ?wxFONTENCODING_CP1253 | ?wxFONTENCODING_CP1254 | ?wxFONTENCODING_CP1255 | ?wxFONTENCODING_CP1256 | ?wxFONTENCODING_CP1257 | ?wxFONTENCODING_CP12_MAX | ?wxFONTENCODING_UTF7 | ?wxFONTENCODING_UTF8 | ?wxFONTENCODING_EUC_JP | ?wxFONTENCODING_UTF16BE | ?wxFONTENCODING_UTF16LE | ?wxFONTENCODING_UTF32BE | ?wxFONTENCODING_UTF32LE | ?wxFONTENCODING_MACROMAN | ?wxFONTENCODING_MACJAPANESE | ?wxFONTENCODING_MACCHINESETRAD | ?wxFONTENCODING_MACKOREAN | ?wxFONTENCODING_MACARABIC | ?wxFONTENCODING_MACHEBREW | ?wxFONTENCODING_MACGREEK | ?wxFONTENCODING_MACCYRILLIC | ?wxFONTENCODING_MACDEVANAGARI | ?wxFONTENCODING_MACGURMUKHI | ?wxFONTENCODING_MACGUJARATI | ?wxFONTENCODING_MACORIYA | ?wxFONTENCODING_MACBENGALI | ?wxFONTENCODING_MACTAMIL | ?wxFONTENCODING_MACTELUGU | ?wxFONTENCODING_MACKANNADA | ?wxFONTENCODING_MACMALAJALAM | ?wxFONTENCODING_MACSINHALESE | ?wxFONTENCODING_MACBURMESE | ?wxFONTENCODING_MACKHMER | ?wxFONTENCODING_MACTHAI | ?wxFONTENCODING_MACLAOTIAN | ?wxFONTENCODING_MACGEORGIAN | ?wxFONTENCODING_MACARMENIAN | ?wxFONTENCODING_MACCHINESESIMP | ?wxFONTENCODING_MACTIBETAN | ?wxFONTENCODING_MACMONGOLIAN | ?wxFONTENCODING_MACETHIOPIC | ?wxFONTENCODING_MACCENTRALEUR | ?wxFONTENCODING_MACVIATNAMESE | ?wxFONTENCODING_MACARABICEXT | ?wxFONTENCODING_MACSYMBOL | ?wxFONTENCODING_MACDINGBATS | ?wxFONTENCODING_MACTURKISH | ?wxFONTENCODING_MACCROATIAN | ?wxFONTENCODING_MACICELANDIC | ?wxFONTENCODING_MACROMANIAN | ?wxFONTENCODING_MACCELTIC | ?wxFONTENCODING_MACGAELIC | ?wxFONTENCODING_MACKEYBOARD | ?wxFONTENCODING_MAX | ?wxFONTENCODING_MACMIN | ?wxFONTENCODING_MACMAX | ?wxFONTENCODING_UTF16 | ?wxFONTENCODING_UTF32 | ?wxFONTENCODING_UNICODE | ?wxFONTENCODING_GB2312 | ?wxFONTENCODING_BIG5 | ?wxFONTENCODING_SHIFT_JIS
+-spec setDefaultEncoding(Encoding) -> ok when
+ Encoding::wx:wx_enum().
setDefaultEncoding(Encoding)
when is_integer(Encoding) ->
wxe_util:cast(?wxFont_SetDefaultEncoding,
<<Encoding:32/?UI>>).
-%% @spec (This::wxFont(), FaceName::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontsetfacename">external documentation</a>.
+-spec setFaceName(This, FaceName) -> boolean() when
+ This::wxFont(), FaceName::unicode:chardata().
setFaceName(#wx_ref{type=ThisT,ref=ThisRef},FaceName)
when is_list(FaceName) ->
?CLASS(ThisT,wxFont),
@@ -175,52 +188,55 @@ setFaceName(#wx_ref{type=ThisT,ref=ThisRef},FaceName)
wxe_util:call(?wxFont_SetFaceName,
<<ThisRef:32/?UI,(byte_size(FaceName_UC)):32/?UI,(FaceName_UC)/binary, 0:(((8- ((0+byte_size(FaceName_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxFont(), Family::WxFontFamily) -> ok
-%% WxFontFamily = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontsetfamily">external documentation</a>.
-%%<br /> WxFontFamily is one of ?wxFONTFAMILY_DEFAULT | ?wxFONTFAMILY_DECORATIVE | ?wxFONTFAMILY_ROMAN | ?wxFONTFAMILY_SCRIPT | ?wxFONTFAMILY_SWISS | ?wxFONTFAMILY_MODERN | ?wxFONTFAMILY_TELETYPE | ?wxFONTFAMILY_MAX | ?wxFONTFAMILY_UNKNOWN
+%%<br /> Family = ?wxFONTFAMILY_DEFAULT | ?wxFONTFAMILY_DECORATIVE | ?wxFONTFAMILY_ROMAN | ?wxFONTFAMILY_SCRIPT | ?wxFONTFAMILY_SWISS | ?wxFONTFAMILY_MODERN | ?wxFONTFAMILY_TELETYPE | ?wxFONTFAMILY_MAX | ?wxFONTFAMILY_UNKNOWN
+-spec setFamily(This, Family) -> ok when
+ This::wxFont(), Family::wx:wx_enum().
setFamily(#wx_ref{type=ThisT,ref=ThisRef},Family)
when is_integer(Family) ->
?CLASS(ThisT,wxFont),
wxe_util:cast(?wxFont_SetFamily,
<<ThisRef:32/?UI,Family:32/?UI>>).
-%% @spec (This::wxFont(), PointSize::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontsetpointsize">external documentation</a>.
+-spec setPointSize(This, PointSize) -> ok when
+ This::wxFont(), PointSize::integer().
setPointSize(#wx_ref{type=ThisT,ref=ThisRef},PointSize)
when is_integer(PointSize) ->
?CLASS(ThisT,wxFont),
wxe_util:cast(?wxFont_SetPointSize,
<<ThisRef:32/?UI,PointSize:32/?UI>>).
-%% @spec (This::wxFont(), Style::WxFontStyle) -> ok
-%% WxFontStyle = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontsetstyle">external documentation</a>.
-%%<br /> WxFontStyle is one of ?wxFONTSTYLE_NORMAL | ?wxFONTSTYLE_ITALIC | ?wxFONTSTYLE_SLANT | ?wxFONTSTYLE_MAX
+%%<br /> Style = ?wxFONTSTYLE_NORMAL | ?wxFONTSTYLE_ITALIC | ?wxFONTSTYLE_SLANT | ?wxFONTSTYLE_MAX
+-spec setStyle(This, Style) -> ok when
+ This::wxFont(), Style::wx:wx_enum().
setStyle(#wx_ref{type=ThisT,ref=ThisRef},Style)
when is_integer(Style) ->
?CLASS(ThisT,wxFont),
wxe_util:cast(?wxFont_SetStyle,
<<ThisRef:32/?UI,Style:32/?UI>>).
-%% @spec (This::wxFont(), Underlined::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontsetunderlined">external documentation</a>.
+-spec setUnderlined(This, Underlined) -> ok when
+ This::wxFont(), Underlined::boolean().
setUnderlined(#wx_ref{type=ThisT,ref=ThisRef},Underlined)
when is_boolean(Underlined) ->
?CLASS(ThisT,wxFont),
wxe_util:cast(?wxFont_SetUnderlined,
<<ThisRef:32/?UI,(wxe_util:from_bool(Underlined)):32/?UI>>).
-%% @spec (This::wxFont(), Weight::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfont.html#wxfontsetweight">external documentation</a>.
+-spec setWeight(This, Weight) -> ok when
+ This::wxFont(), Weight::integer().
setWeight(#wx_ref{type=ThisT,ref=ThisRef},Weight)
when is_integer(Weight) ->
?CLASS(ThisT,wxFont),
wxe_util:cast(?wxFont_SetWeight,
<<ThisRef:32/?UI,Weight:32/?UI>>).
-%% @spec (This::wxFont()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxFont()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxFont),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxFontData.erl b/lib/wx/src/gen/wxFontData.erl
index 33015b7ca9..978d27b391 100644
--- a/lib/wx/src/gen/wxFontData.erl
+++ b/lib/wx/src/gen/wxFontData.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -31,122 +31,138 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxFontData/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxFontData()
+-type wxFontData() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdata.html#wxfontdatawxfontdata">external documentation</a>.
+-spec new() -> wxFontData().
new() ->
wxe_util:construct(?wxFontData_new_0,
<<>>).
-%% @spec (Data::wxFontData()) -> wxFontData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdata.html#wxfontdatawxfontdata">external documentation</a>.
+-spec new(Data) -> wxFontData() when
+ Data::wxFontData().
new(#wx_ref{type=DataT,ref=DataRef}) ->
?CLASS(DataT,wxFontData),
wxe_util:construct(?wxFontData_new_1,
<<DataRef:32/?UI>>).
-%% @spec (This::wxFontData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdata.html#wxfontdataenableeffects">external documentation</a>.
+-spec enableEffects(This, Flag) -> ok when
+ This::wxFontData(), Flag::boolean().
enableEffects(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxFontData),
wxe_util:cast(?wxFontData_EnableEffects,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxFontData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdata.html#wxfontdatagetallowsymbols">external documentation</a>.
+-spec getAllowSymbols(This) -> boolean() when
+ This::wxFontData().
getAllowSymbols(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFontData),
wxe_util:call(?wxFontData_GetAllowSymbols,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFontData()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdata.html#wxfontdatagetcolour">external documentation</a>.
+-spec getColour(This) -> wx:wx_colour4() when
+ This::wxFontData().
getColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFontData),
wxe_util:call(?wxFontData_GetColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFontData()) -> wxFont:wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdata.html#wxfontdatagetchosenfont">external documentation</a>.
+-spec getChosenFont(This) -> wxFont:wxFont() when
+ This::wxFontData().
getChosenFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFontData),
wxe_util:call(?wxFontData_GetChosenFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFontData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdata.html#wxfontdatagetenableeffects">external documentation</a>.
+-spec getEnableEffects(This) -> boolean() when
+ This::wxFontData().
getEnableEffects(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFontData),
wxe_util:call(?wxFontData_GetEnableEffects,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFontData()) -> wxFont:wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdata.html#wxfontdatagetinitialfont">external documentation</a>.
+-spec getInitialFont(This) -> wxFont:wxFont() when
+ This::wxFontData().
getInitialFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFontData),
wxe_util:call(?wxFontData_GetInitialFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFontData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdata.html#wxfontdatagetshowhelp">external documentation</a>.
+-spec getShowHelp(This) -> boolean() when
+ This::wxFontData().
getShowHelp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFontData),
wxe_util:call(?wxFontData_GetShowHelp,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFontData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdata.html#wxfontdatasetallowsymbols">external documentation</a>.
+-spec setAllowSymbols(This, Flag) -> ok when
+ This::wxFontData(), Flag::boolean().
setAllowSymbols(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxFontData),
wxe_util:cast(?wxFontData_SetAllowSymbols,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxFontData(), Font::wxFont:wxFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdata.html#wxfontdatasetchosenfont">external documentation</a>.
+-spec setChosenFont(This, Font) -> ok when
+ This::wxFontData(), Font::wxFont:wxFont().
setChosenFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}) ->
?CLASS(ThisT,wxFontData),
?CLASS(FontT,wxFont),
wxe_util:cast(?wxFontData_SetChosenFont,
<<ThisRef:32/?UI,FontRef:32/?UI>>).
-%% @spec (This::wxFontData(), Colour::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdata.html#wxfontdatasetcolour">external documentation</a>.
+-spec setColour(This, Colour) -> ok when
+ This::wxFontData(), Colour::wx:wx_colour().
setColour(#wx_ref{type=ThisT,ref=ThisRef},Colour)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxFontData),
wxe_util:cast(?wxFontData_SetColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
-%% @spec (This::wxFontData(), Font::wxFont:wxFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdata.html#wxfontdatasetinitialfont">external documentation</a>.
+-spec setInitialFont(This, Font) -> ok when
+ This::wxFontData(), Font::wxFont:wxFont().
setInitialFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}) ->
?CLASS(ThisT,wxFontData),
?CLASS(FontT,wxFont),
wxe_util:cast(?wxFontData_SetInitialFont,
<<ThisRef:32/?UI,FontRef:32/?UI>>).
-%% @spec (This::wxFontData(), MinRange::integer(), MaxRange::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdata.html#wxfontdatasetrange">external documentation</a>.
+-spec setRange(This, MinRange, MaxRange) -> ok when
+ This::wxFontData(), MinRange::integer(), MaxRange::integer().
setRange(#wx_ref{type=ThisT,ref=ThisRef},MinRange,MaxRange)
when is_integer(MinRange),is_integer(MaxRange) ->
?CLASS(ThisT,wxFontData),
wxe_util:cast(?wxFontData_SetRange,
<<ThisRef:32/?UI,MinRange:32/?UI,MaxRange:32/?UI>>).
-%% @spec (This::wxFontData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdata.html#wxfontdatasetshowhelp">external documentation</a>.
+-spec setShowHelp(This, Flag) -> ok when
+ This::wxFontData(), Flag::boolean().
setShowHelp(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxFontData),
wxe_util:cast(?wxFontData_SetShowHelp,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxFontData()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxFontData()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxFontData),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxFontDialog.erl b/lib/wx/src/gen/wxFontDialog.erl
index 357bfe532d..6cc210a4aa 100644
--- a/lib/wx/src/gen/wxFontDialog.erl
+++ b/lib/wx/src/gen/wxFontDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -77,6 +77,7 @@
transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxFontDialog/0]).
%% @hidden
parent_class(wxDialog) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -84,22 +85,25 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxFontDialog()
+-type wxFontDialog() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdialog.html#wxfontdialogwxfontdialog">external documentation</a>.
+-spec new() -> wxFontDialog().
new() ->
wxe_util:construct(?wxFontDialog_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Data::wxFontData:wxFontData()) -> wxFontDialog()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdialog.html#wxfontdialogwxfontdialog">external documentation</a>.
+-spec new(Parent, Data) -> wxFontDialog() when
+ Parent::wxWindow:wxWindow(), Data::wxFontData:wxFontData().
new(#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=DataT,ref=DataRef}) ->
?CLASS(ParentT,wxWindow),
?CLASS(DataT,wxFontData),
wxe_util:construct(?wxFontDialog_new_2,
<<ParentRef:32/?UI,DataRef:32/?UI>>).
-%% @spec (This::wxFontDialog(), Parent::wxWindow:wxWindow(), Data::wxFontData:wxFontData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdialog.html#wxfontdialogcreate">external documentation</a>.
+-spec create(This, Parent, Data) -> boolean() when
+ This::wxFontDialog(), Parent::wxWindow:wxWindow(), Data::wxFontData:wxFontData().
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=DataT,ref=DataRef}) ->
?CLASS(ThisT,wxFontDialog),
?CLASS(ParentT,wxWindow),
@@ -107,15 +111,16 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},#wx_r
wxe_util:call(?wxFontDialog_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,DataRef:32/?UI>>).
-%% @spec (This::wxFontDialog()) -> wxFontData:wxFontData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontdialog.html#wxfontdialoggetfontdata">external documentation</a>.
+-spec getFontData(This) -> wxFontData:wxFontData() when
+ This::wxFontDialog().
getFontData(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFontDialog),
wxe_util:call(?wxFontDialog_GetFontData,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFontDialog()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxFontDialog()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxFontDialog),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxFontPickerCtrl.erl b/lib/wx/src/gen/wxFontPickerCtrl.erl
index 3050011b60..46c0dbab4d 100644
--- a/lib/wx/src/gen/wxFontPickerCtrl.erl
+++ b/lib/wx/src/gen/wxFontPickerCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -75,6 +75,7 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxFontPickerCtrl/0]).
%% @hidden
parent_class(wxPickerBase) -> true;
parent_class(wxControl) -> true;
@@ -82,21 +83,29 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxFontPickerCtrl()
+-type wxFontPickerCtrl() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontpickerctrl.html#wxfontpickerctrlwxfontpickerctrl">external documentation</a>.
+-spec new() -> wxFontPickerCtrl().
new() ->
wxe_util:construct(?wxFontPickerCtrl_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxFontPickerCtrl()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxFontPickerCtrl() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxFontPickerCtrl()
-%% Option = {initial, wxFont:wxFont()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontpickerctrl.html#wxfontpickerctrlwxfontpickerctrl">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxFontPickerCtrl() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {initial, wxFont:wxFont()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -110,15 +119,22 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxFontPickerCtrl_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxFontPickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer()) -> bool()
%% @equiv create(This,Parent,Id, [])
+-spec create(This, Parent, Id) -> boolean() when
+ This::wxFontPickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer().
+
create(This,Parent,Id)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id) ->
create(This,Parent,Id, []).
-%% @spec (This::wxFontPickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> bool()
-%% Option = {initial, wxFont:wxFont()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontpickerctrl.html#wxfontpickerctrlcreate">external documentation</a>.
+-spec create(This, Parent, Id, [Option]) -> boolean() when
+ This::wxFontPickerCtrl(), Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {initial, wxFont:wxFont()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ThisT,wxFontPickerCtrl),
@@ -133,38 +149,42 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, O
wxe_util:call(?wxFontPickerCtrl_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxFontPickerCtrl()) -> wxFont:wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontpickerctrl.html#wxfontpickerctrlgetselectedfont">external documentation</a>.
+-spec getSelectedFont(This) -> wxFont:wxFont() when
+ This::wxFontPickerCtrl().
getSelectedFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFontPickerCtrl),
wxe_util:call(?wxFontPickerCtrl_GetSelectedFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFontPickerCtrl(), F::wxFont:wxFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontpickerctrl.html#wxfontpickerctrlsetselectedfont">external documentation</a>.
+-spec setSelectedFont(This, F) -> ok when
+ This::wxFontPickerCtrl(), F::wxFont:wxFont().
setSelectedFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FT,ref=FRef}) ->
?CLASS(ThisT,wxFontPickerCtrl),
?CLASS(FT,wxFont),
wxe_util:cast(?wxFontPickerCtrl_SetSelectedFont,
<<ThisRef:32/?UI,FRef:32/?UI>>).
-%% @spec (This::wxFontPickerCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontpickerctrl.html#wxfontpickerctrlgetmaxpointsize">external documentation</a>.
+-spec getMaxPointSize(This) -> integer() when
+ This::wxFontPickerCtrl().
getMaxPointSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFontPickerCtrl),
wxe_util:call(?wxFontPickerCtrl_GetMaxPointSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFontPickerCtrl(), Max::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontpickerctrl.html#wxfontpickerctrlsetmaxpointsize">external documentation</a>.
+-spec setMaxPointSize(This, Max) -> ok when
+ This::wxFontPickerCtrl(), Max::integer().
setMaxPointSize(#wx_ref{type=ThisT,ref=ThisRef},Max)
when is_integer(Max) ->
?CLASS(ThisT,wxFontPickerCtrl),
wxe_util:cast(?wxFontPickerCtrl_SetMaxPointSize,
<<ThisRef:32/?UI,Max:32/?UI>>).
-%% @spec (This::wxFontPickerCtrl()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxFontPickerCtrl()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxFontPickerCtrl),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxFontPickerEvent.erl b/lib/wx/src/gen/wxFontPickerEvent.erl
index 6eb456767f..2dc3606409 100644
--- a/lib/wx/src/gen/wxFontPickerEvent.erl
+++ b/lib/wx/src/gen/wxFontPickerEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -40,13 +40,16 @@
parent_class/1,resumePropagation/2,setInt/2,setString/2,shouldPropagate/1,
skip/1,skip/2,stopPropagation/1]).
+-export_type([wxFontPickerEvent/0]).
%% @hidden
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxFontPickerEvent()) -> wxFont:wxFont()
+-type wxFontPickerEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxfontpickerevent.html#wxfontpickereventgetfont">external documentation</a>.
+-spec getFont(This) -> wxFont:wxFont() when
+ This::wxFontPickerEvent().
getFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFontPickerEvent),
wxe_util:call(?wxFontPickerEvent_GetFont,
diff --git a/lib/wx/src/gen/wxFrame.erl b/lib/wx/src/gen/wxFrame.erl
index 7e25bc8762..61f46f7a07 100644
--- a/lib/wx/src/gen/wxFrame.erl
+++ b/lib/wx/src/gen/wxFrame.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -78,27 +78,34 @@
showFullScreen/3,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxFrame/0]).
%% @hidden
parent_class(wxTopLevelWindow) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxFrame()
+-type wxFrame() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframewxframe">external documentation</a>.
+-spec new() -> wxFrame().
new() ->
wxe_util:construct(?wxFrame_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Title::string()) -> wxFrame()
%% @equiv new(Parent,Id,Title, [])
+-spec new(Parent, Id, Title) -> wxFrame() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata().
+
new(Parent,Id,Title)
when is_record(Parent, wx_ref),is_integer(Id),is_list(Title) ->
new(Parent,Id,Title, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Title::string(), [Option]) -> wxFrame()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframewxframe">external documentation</a>.
+-spec new(Parent, Id, Title, [Option]) -> wxFrame() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options)
when is_integer(Id),is_list(Title),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -111,15 +118,20 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options)
wxe_util:construct(?wxFrame_new_4,
<<ParentRef:32/?UI,Id:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((4+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxFrame(), Parent::wxWindow:wxWindow(), Id::integer(), Title::string()) -> bool()
%% @equiv create(This,Parent,Id,Title, [])
+-spec create(This, Parent, Id, Title) -> boolean() when
+ This::wxFrame(), Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata().
+
create(This,Parent,Id,Title)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Title) ->
create(This,Parent,Id,Title, []).
-%% @spec (This::wxFrame(), Parent::wxWindow:wxWindow(), Id::integer(), Title::string(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframecreate">external documentation</a>.
+-spec create(This, Parent, Id, Title, [Option]) -> boolean() when
+ This::wxFrame(), Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options)
when is_integer(Id),is_list(Title),is_list(Options) ->
?CLASS(ThisT,wxFrame),
@@ -133,15 +145,20 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Ti
wxe_util:call(?wxFrame_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((0+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxFrame()) -> wxStatusBar:wxStatusBar()
%% @equiv createStatusBar(This, [])
+-spec createStatusBar(This) -> wxStatusBar:wxStatusBar() when
+ This::wxFrame().
+
createStatusBar(This)
when is_record(This, wx_ref) ->
createStatusBar(This, []).
-%% @spec (This::wxFrame(), [Option]) -> wxStatusBar:wxStatusBar()
-%% Option = {number, integer()} | {style, integer()} | {id, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframecreatestatusbar">external documentation</a>.
+-spec createStatusBar(This, [Option]) -> wxStatusBar:wxStatusBar() when
+ This::wxFrame(),
+ Option :: {number, integer()}
+ | {style, integer()}
+ | {id, integer()}.
createStatusBar(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxFrame),
@@ -153,15 +170,19 @@ createStatusBar(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxFrame_CreateStatusBar,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxFrame()) -> wxToolBar:wxToolBar()
%% @equiv createToolBar(This, [])
+-spec createToolBar(This) -> wxToolBar:wxToolBar() when
+ This::wxFrame().
+
createToolBar(This)
when is_record(This, wx_ref) ->
createToolBar(This, []).
-%% @spec (This::wxFrame(), [Option]) -> wxToolBar:wxToolBar()
-%% Option = {style, integer()} | {id, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframecreatetoolbar">external documentation</a>.
+-spec createToolBar(This, [Option]) -> wxToolBar:wxToolBar() when
+ This::wxFrame(),
+ Option :: {style, integer()}
+ | {id, integer()}.
createToolBar(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxFrame),
@@ -172,89 +193,102 @@ createToolBar(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxFrame_CreateToolBar,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxFrame()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframegetclientareaorigin">external documentation</a>.
+-spec getClientAreaOrigin(This) -> {X::integer(), Y::integer()} when
+ This::wxFrame().
getClientAreaOrigin(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFrame),
wxe_util:call(?wxFrame_GetClientAreaOrigin,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFrame()) -> wxMenuBar:wxMenuBar()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframegetmenubar">external documentation</a>.
+-spec getMenuBar(This) -> wxMenuBar:wxMenuBar() when
+ This::wxFrame().
getMenuBar(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFrame),
wxe_util:call(?wxFrame_GetMenuBar,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFrame()) -> wxStatusBar:wxStatusBar()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframegetstatusbar">external documentation</a>.
+-spec getStatusBar(This) -> wxStatusBar:wxStatusBar() when
+ This::wxFrame().
getStatusBar(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFrame),
wxe_util:call(?wxFrame_GetStatusBar,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFrame()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframegetstatusbarpane">external documentation</a>.
+-spec getStatusBarPane(This) -> integer() when
+ This::wxFrame().
getStatusBarPane(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFrame),
wxe_util:call(?wxFrame_GetStatusBarPane,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFrame()) -> wxToolBar:wxToolBar()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframegettoolbar">external documentation</a>.
+-spec getToolBar(This) -> wxToolBar:wxToolBar() when
+ This::wxFrame().
getToolBar(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFrame),
wxe_util:call(?wxFrame_GetToolBar,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFrame(), Winid::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframeprocesscommand">external documentation</a>.
+-spec processCommand(This, Winid) -> boolean() when
+ This::wxFrame(), Winid::integer().
processCommand(#wx_ref{type=ThisT,ref=ThisRef},Winid)
when is_integer(Winid) ->
?CLASS(ThisT,wxFrame),
wxe_util:call(?wxFrame_ProcessCommand,
<<ThisRef:32/?UI,Winid:32/?UI>>).
-%% @spec (This::wxFrame()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframesendsizeevent">external documentation</a>.
+-spec sendSizeEvent(This) -> ok when
+ This::wxFrame().
sendSizeEvent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxFrame),
wxe_util:cast(?wxFrame_SendSizeEvent,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxFrame(), Menubar::wxMenuBar:wxMenuBar()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframesetmenubar">external documentation</a>.
+-spec setMenuBar(This, Menubar) -> ok when
+ This::wxFrame(), Menubar::wxMenuBar:wxMenuBar().
setMenuBar(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenubarT,ref=MenubarRef}) ->
?CLASS(ThisT,wxFrame),
?CLASS(MenubarT,wxMenuBar),
wxe_util:cast(?wxFrame_SetMenuBar,
<<ThisRef:32/?UI,MenubarRef:32/?UI>>).
-%% @spec (This::wxFrame(), Statbar::wxStatusBar:wxStatusBar()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframesetstatusbar">external documentation</a>.
+-spec setStatusBar(This, Statbar) -> ok when
+ This::wxFrame(), Statbar::wxStatusBar:wxStatusBar().
setStatusBar(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=StatbarT,ref=StatbarRef}) ->
?CLASS(ThisT,wxFrame),
?CLASS(StatbarT,wxStatusBar),
wxe_util:cast(?wxFrame_SetStatusBar,
<<ThisRef:32/?UI,StatbarRef:32/?UI>>).
-%% @spec (This::wxFrame(), N::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframesetstatusbarpane">external documentation</a>.
+-spec setStatusBarPane(This, N) -> ok when
+ This::wxFrame(), N::integer().
setStatusBarPane(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxFrame),
wxe_util:cast(?wxFrame_SetStatusBarPane,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxFrame(), Text::string()) -> ok
%% @equiv setStatusText(This,Text, [])
+-spec setStatusText(This, Text) -> ok when
+ This::wxFrame(), Text::unicode:chardata().
+
setStatusText(This,Text)
when is_record(This, wx_ref),is_list(Text) ->
setStatusText(This,Text, []).
-%% @spec (This::wxFrame(), Text::string(), [Option]) -> ok
-%% Option = {number, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframesetstatustext">external documentation</a>.
+-spec setStatusText(This, Text, [Option]) -> ok when
+ This::wxFrame(), Text::unicode:chardata(),
+ Option :: {number, integer()}.
setStatusText(#wx_ref{type=ThisT,ref=ThisRef},Text, Options)
when is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxFrame),
@@ -265,8 +299,9 @@ setStatusText(#wx_ref{type=ThisT,ref=ThisRef},Text, Options)
wxe_util:cast(?wxFrame_SetStatusText,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxFrame(), Widths_field::[integer()]) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframesetstatuswidths">external documentation</a>.
+-spec setStatusWidths(This, Widths_field) -> ok when
+ This::wxFrame(), Widths_field::[integer()].
setStatusWidths(#wx_ref{type=ThisT,ref=ThisRef},Widths_field)
when is_list(Widths_field) ->
?CLASS(ThisT,wxFrame),
@@ -274,16 +309,17 @@ setStatusWidths(#wx_ref{type=ThisT,ref=ThisRef},Widths_field)
<<ThisRef:32/?UI,(length(Widths_field)):32/?UI,
(<< <<C:32/?I>> || C <- Widths_field>>)/binary, 0:(((0+length(Widths_field)) rem 2)*32)>>).
-%% @spec (This::wxFrame(), Toolbar::wxToolBar:wxToolBar()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxframe.html#wxframesettoolbar">external documentation</a>.
+-spec setToolBar(This, Toolbar) -> ok when
+ This::wxFrame(), Toolbar::wxToolBar:wxToolBar().
setToolBar(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ToolbarT,ref=ToolbarRef}) ->
?CLASS(ThisT,wxFrame),
?CLASS(ToolbarT,wxToolBar),
wxe_util:cast(?wxFrame_SetToolBar,
<<ThisRef:32/?UI,ToolbarRef:32/?UI>>).
-%% @spec (This::wxFrame()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxFrame()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxFrame),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxGBSizerItem.erl b/lib/wx/src/gen/wxGBSizerItem.erl
index 90dd98fdf2..1860e5f808 100644
--- a/lib/wx/src/gen/wxGBSizerItem.erl
+++ b/lib/wx/src/gen/wxGBSizerItem.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,10 +37,12 @@
setMinSize/2,setMinSize/3,setProportion/2,setRatio/2,setRatio/3,setSizer/2,
setSpacer/2,setSpacer/3,setWindow/2,show/2]).
+-export_type([wxGBSizerItem/0]).
%% @hidden
parent_class(wxSizerItem) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxGBSizerItem() :: wx:wx_object().
%% From wxSizerItem
%% @hidden
show(This,Show) -> wxSizerItem:show(This,Show).
diff --git a/lib/wx/src/gen/wxGLCanvas.erl b/lib/wx/src/gen/wxGLCanvas.erl
index a30d8cefd9..46168374af 100644
--- a/lib/wx/src/gen/wxGLCanvas.erl
+++ b/lib/wx/src/gen/wxGLCanvas.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -68,26 +68,44 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxGLCanvas/0]).
%% @hidden
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxGLCanvas()
+-type wxGLCanvas() :: wx:wx_object().
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxGLCanvas() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(),X::term()) -> wxGLCanvas()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxglcanvas.html#wxglcanvaswxglcanvas">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Parent::wxWindow:wxWindow(), Shared::wxGLContext:wxGLContext() | wxGLCanvas()) -> new(Parent,Shared, []) </c></p>
-%% <p><c>
-%% new(Parent::wxWindow:wxWindow(), [Option]) -> wxGLCanvas() </c>
-%%<br /> Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {name, string()} | {attribList, [integer()]} | {palette, wxPalette:wxPalette()}
-%% </p>
+%% <br /> Also:<br />
+%% new(Parent, [Option]) -> wxGLCanvas() when<br />
+%% Parent::wxWindow:wxWindow(),<br />
+%% Option :: {id, integer()}<br />
+%% | {pos, {X::integer(), Y::integer()}}<br />
+%% | {size, {W::integer(), H::integer()}}<br />
+%% | {style, integer()}<br />
+%% | {name, unicode:chardata()}<br />
+%% | {attribList, [integer()]}<br />
+%% | {palette, wxPalette:wxPalette()}.<br />
+%%
+-spec new(Parent, Shared) -> wxGLCanvas() when
+ Parent::wxWindow:wxWindow(), Shared::wx:wx_object() | wxGLCanvas();
+ (Parent, [Option]) -> wxGLCanvas() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {name, unicode:chardata()}
+ | {attribList, [integer()]}
+ | {palette, wxPalette:wxPalette()}.
new(Parent,Shared)
when is_record(Parent, wx_ref),is_record(Shared, wx_ref) ->
@@ -108,9 +126,16 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxGLCanvas_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (Parent::wxWindow:wxWindow(), Shared::wxGLContext:wxGLContext() | wxGLCanvas(), [Option]) -> wxGLCanvas()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {name, string()} | {attribList, [integer()]} | {palette, wxPalette:wxPalette()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxglcanvas.html#wxglcanvaswxglcanvas">external documentation</a>.
+-spec new(Parent, Shared, [Option]) -> wxGLCanvas() when
+ Parent::wxWindow:wxWindow(), Shared::wx:wx_object() | wxGLCanvas(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {name, unicode:chardata()}
+ | {attribList, [integer()]}
+ | {palette, wxPalette:wxPalette()}.
new(#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=SharedT,ref=SharedRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -133,15 +158,17 @@ new(#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=SharedT,ref=SharedRef}, Opt
wxe_util:construct(SharedOP,
<<ParentRef:32/?UI,SharedRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGLCanvas()) -> wxGLContext:wxGLContext()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxglcanvas.html#wxglcanvasgetcontext">external documentation</a>.
+-spec getContext(This) -> wx:wx_object() when
+ This::wxGLCanvas().
getContext(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGLCanvas),
wxe_util:call(?wxGLCanvas_GetContext,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGLCanvas()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxglcanvas.html#wxglcanvassetcurrent">external documentation</a>.
+-spec setCurrent(This) -> ok when
+ This::wxGLCanvas().
setCurrent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGLCanvas),
_Result = wxe_util:cast(?wxGLCanvas_SetCurrent,
@@ -149,15 +176,16 @@ setCurrent(#wx_ref{type=ThisT,ref=ThisRef}) ->
{ok, _} = wxe_master:init_opengl(),
_Result.
-%% @spec (This::wxGLCanvas()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxglcanvas.html#wxglcanvasswapbuffers">external documentation</a>.
+-spec swapBuffers(This) -> ok when
+ This::wxGLCanvas().
swapBuffers(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGLCanvas),
wxe_util:cast(?wxGLCanvas_SwapBuffers,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGLCanvas()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGLCanvas()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxGLCanvas),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxGauge.erl b/lib/wx/src/gen/wxGauge.erl
index 484fd36936..7f892355c7 100644
--- a/lib/wx/src/gen/wxGauge.erl
+++ b/lib/wx/src/gen/wxGauge.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -71,27 +71,35 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxGauge/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxGauge()
+-type wxGauge() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgauge.html#wxgaugewxgauge">external documentation</a>.
+-spec new() -> wxGauge().
new() ->
wxe_util:construct(?wxGauge_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Range::integer()) -> wxGauge()
%% @equiv new(Parent,Id,Range, [])
+-spec new(Parent, Id, Range) -> wxGauge() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Range::integer().
+
new(Parent,Id,Range)
when is_record(Parent, wx_ref),is_integer(Id),is_integer(Range) ->
new(Parent,Id,Range, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Range::integer(), [Option]) -> wxGauge()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgauge.html#wxgaugewxgauge">external documentation</a>.
+-spec new(Parent, Id, Range, [Option]) -> wxGauge() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Range::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,Range, Options)
when is_integer(Id),is_integer(Range),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -104,15 +112,21 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Range, Options)
wxe_util:construct(?wxGauge_new_4,
<<ParentRef:32/?UI,Id:32/?UI,Range:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGauge(), Parent::wxWindow:wxWindow(), Id::integer(), Range::integer()) -> bool()
%% @equiv create(This,Parent,Id,Range, [])
+-spec create(This, Parent, Id, Range) -> boolean() when
+ This::wxGauge(), Parent::wxWindow:wxWindow(), Id::integer(), Range::integer().
+
create(This,Parent,Id,Range)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_integer(Range) ->
create(This,Parent,Id,Range, []).
-%% @spec (This::wxGauge(), Parent::wxWindow:wxWindow(), Id::integer(), Range::integer(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgauge.html#wxgaugecreate">external documentation</a>.
+-spec create(This, Parent, Id, Range, [Option]) -> boolean() when
+ This::wxGauge(), Parent::wxWindow:wxWindow(), Id::integer(), Range::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Range, Options)
when is_integer(Id),is_integer(Range),is_list(Options) ->
?CLASS(ThisT,wxGauge),
@@ -126,82 +140,92 @@ 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>>).
-%% @spec (This::wxGauge()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/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>>).
-%% @spec (This::wxGauge()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgauge.html#wxgaugegetrange">external documentation</a>.
+-spec getRange(This) -> integer() when
+ This::wxGauge().
getRange(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGauge),
wxe_util:call(?wxGauge_GetRange,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGauge()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/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>>).
-%% @spec (This::wxGauge()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgauge.html#wxgaugegetvalue">external documentation</a>.
+-spec getValue(This) -> integer() when
+ This::wxGauge().
getValue(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGauge),
wxe_util:call(?wxGauge_GetValue,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGauge()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgauge.html#wxgaugeisvertical">external documentation</a>.
+-spec isVertical(This) -> boolean() when
+ This::wxGauge().
isVertical(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGauge),
wxe_util:call(?wxGauge_IsVertical,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGauge(), W::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/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>>).
-%% @spec (This::wxGauge(), R::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgauge.html#wxgaugesetrange">external documentation</a>.
+-spec setRange(This, R) -> ok when
+ This::wxGauge(), R::integer().
setRange(#wx_ref{type=ThisT,ref=ThisRef},R)
when is_integer(R) ->
?CLASS(ThisT,wxGauge),
wxe_util:cast(?wxGauge_SetRange,
<<ThisRef:32/?UI,R:32/?UI>>).
-%% @spec (This::wxGauge(), W::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/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>>).
-%% @spec (This::wxGauge(), Pos::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgauge.html#wxgaugesetvalue">external documentation</a>.
+-spec setValue(This, Pos) -> ok when
+ This::wxGauge(), Pos::integer().
setValue(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxGauge),
wxe_util:cast(?wxGauge_SetValue,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxGauge()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgauge.html#wxgaugepulse">external documentation</a>.
+-spec pulse(This) -> ok when
+ This::wxGauge().
pulse(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGauge),
wxe_util:cast(?wxGauge_Pulse,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGauge()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGauge()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxGauge),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxGenericDirCtrl.erl b/lib/wx/src/gen/wxGenericDirCtrl.erl
index 626a454d2a..cb917e8fd1 100644
--- a/lib/wx/src/gen/wxGenericDirCtrl.erl
+++ b/lib/wx/src/gen/wxGenericDirCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -72,27 +72,38 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxGenericDirCtrl/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxGenericDirCtrl()
+-type wxGenericDirCtrl() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlwxgenericdirctrl">external documentation</a>.
+-spec new() -> wxGenericDirCtrl().
new() ->
wxe_util:construct(?wxGenericDirCtrl_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxGenericDirCtrl()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxGenericDirCtrl() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxGenericDirCtrl()
-%% Option = {id, integer()} | {dir, string()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {filter, string()} | {defaultFilter, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlwxgenericdirctrl">external documentation</a>.
+-spec new(Parent, [Option]) -> wxGenericDirCtrl() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {dir, unicode:chardata()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {filter, unicode:chardata()}
+ | {defaultFilter, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -108,15 +119,24 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxGenericDirCtrl_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGenericDirCtrl(), Parent::wxWindow:wxWindow()) -> bool()
%% @equiv create(This,Parent, [])
+-spec create(This, Parent) -> boolean() when
+ This::wxGenericDirCtrl(), Parent::wxWindow:wxWindow().
+
create(This,Parent)
when is_record(This, wx_ref),is_record(Parent, wx_ref) ->
create(This,Parent, []).
-%% @spec (This::wxGenericDirCtrl(), Parent::wxWindow:wxWindow(), [Option]) -> bool()
-%% Option = {id, integer()} | {dir, string()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {filter, string()} | {defaultFilter, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlcreate">external documentation</a>.
+-spec create(This, Parent, [Option]) -> boolean() when
+ This::wxGenericDirCtrl(), Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {dir, unicode:chardata()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {filter, unicode:chardata()}
+ | {defaultFilter, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGenericDirCtrl),
@@ -133,22 +153,25 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Opti
wxe_util:call(?wxGenericDirCtrl_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGenericDirCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlinit">external documentation</a>.
+-spec init(This) -> ok when
+ This::wxGenericDirCtrl().
init(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGenericDirCtrl),
wxe_util:cast(?wxGenericDirCtrl_Init,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGenericDirCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlcollapsetree">external documentation</a>.
+-spec collapseTree(This) -> ok when
+ This::wxGenericDirCtrl().
collapseTree(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGenericDirCtrl),
wxe_util:cast(?wxGenericDirCtrl_CollapseTree,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGenericDirCtrl(), Path::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlexpandpath">external documentation</a>.
+-spec expandPath(This, Path) -> boolean() when
+ This::wxGenericDirCtrl(), Path::unicode:chardata().
expandPath(#wx_ref{type=ThisT,ref=ThisRef},Path)
when is_list(Path) ->
?CLASS(ThisT,wxGenericDirCtrl),
@@ -156,64 +179,73 @@ expandPath(#wx_ref{type=ThisT,ref=ThisRef},Path)
wxe_util:call(?wxGenericDirCtrl_ExpandPath,
<<ThisRef:32/?UI,(byte_size(Path_UC)):32/?UI,(Path_UC)/binary, 0:(((8- ((0+byte_size(Path_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGenericDirCtrl()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlgetdefaultpath">external documentation</a>.
+-spec getDefaultPath(This) -> unicode:charlist() when
+ This::wxGenericDirCtrl().
getDefaultPath(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGenericDirCtrl),
wxe_util:call(?wxGenericDirCtrl_GetDefaultPath,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGenericDirCtrl()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlgetpath">external documentation</a>.
+-spec getPath(This) -> unicode:charlist() when
+ This::wxGenericDirCtrl().
getPath(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGenericDirCtrl),
wxe_util:call(?wxGenericDirCtrl_GetPath,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGenericDirCtrl()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlgetfilepath">external documentation</a>.
+-spec getFilePath(This) -> unicode:charlist() when
+ This::wxGenericDirCtrl().
getFilePath(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGenericDirCtrl),
wxe_util:call(?wxGenericDirCtrl_GetFilePath,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGenericDirCtrl()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlgetfilter">external documentation</a>.
+-spec getFilter(This) -> unicode:charlist() when
+ This::wxGenericDirCtrl().
getFilter(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGenericDirCtrl),
wxe_util:call(?wxGenericDirCtrl_GetFilter,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGenericDirCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlgetfilterindex">external documentation</a>.
+-spec getFilterIndex(This) -> integer() when
+ This::wxGenericDirCtrl().
getFilterIndex(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGenericDirCtrl),
wxe_util:call(?wxGenericDirCtrl_GetFilterIndex,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGenericDirCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlgetrootid">external documentation</a>.
+-spec getRootId(This) -> integer() when
+ This::wxGenericDirCtrl().
getRootId(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGenericDirCtrl),
wxe_util:call(?wxGenericDirCtrl_GetRootId,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGenericDirCtrl()) -> wxTreeCtrl:wxTreeCtrl()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlgettreectrl">external documentation</a>.
+-spec getTreeCtrl(This) -> wxTreeCtrl:wxTreeCtrl() when
+ This::wxGenericDirCtrl().
getTreeCtrl(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGenericDirCtrl),
wxe_util:call(?wxGenericDirCtrl_GetTreeCtrl,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGenericDirCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlrecreatetree">external documentation</a>.
+-spec reCreateTree(This) -> ok when
+ This::wxGenericDirCtrl().
reCreateTree(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGenericDirCtrl),
wxe_util:cast(?wxGenericDirCtrl_ReCreateTree,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGenericDirCtrl(), Path::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlsetdefaultpath">external documentation</a>.
+-spec setDefaultPath(This, Path) -> ok when
+ This::wxGenericDirCtrl(), Path::unicode:chardata().
setDefaultPath(#wx_ref{type=ThisT,ref=ThisRef},Path)
when is_list(Path) ->
?CLASS(ThisT,wxGenericDirCtrl),
@@ -221,8 +253,9 @@ setDefaultPath(#wx_ref{type=ThisT,ref=ThisRef},Path)
wxe_util:cast(?wxGenericDirCtrl_SetDefaultPath,
<<ThisRef:32/?UI,(byte_size(Path_UC)):32/?UI,(Path_UC)/binary, 0:(((8- ((0+byte_size(Path_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGenericDirCtrl(), Filter::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlsetfilter">external documentation</a>.
+-spec setFilter(This, Filter) -> ok when
+ This::wxGenericDirCtrl(), Filter::unicode:chardata().
setFilter(#wx_ref{type=ThisT,ref=ThisRef},Filter)
when is_list(Filter) ->
?CLASS(ThisT,wxGenericDirCtrl),
@@ -230,16 +263,18 @@ setFilter(#wx_ref{type=ThisT,ref=ThisRef},Filter)
wxe_util:cast(?wxGenericDirCtrl_SetFilter,
<<ThisRef:32/?UI,(byte_size(Filter_UC)):32/?UI,(Filter_UC)/binary, 0:(((8- ((0+byte_size(Filter_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGenericDirCtrl(), N::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlsetfilterindex">external documentation</a>.
+-spec setFilterIndex(This, N) -> ok when
+ This::wxGenericDirCtrl(), N::integer().
setFilterIndex(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxGenericDirCtrl),
wxe_util:cast(?wxGenericDirCtrl_SetFilterIndex,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxGenericDirCtrl(), Path::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgenericdirctrl.html#wxgenericdirctrlsetpath">external documentation</a>.
+-spec setPath(This, Path) -> ok when
+ This::wxGenericDirCtrl(), Path::unicode:chardata().
setPath(#wx_ref{type=ThisT,ref=ThisRef},Path)
when is_list(Path) ->
?CLASS(ThisT,wxGenericDirCtrl),
@@ -247,8 +282,8 @@ setPath(#wx_ref{type=ThisT,ref=ThisRef},Path)
wxe_util:cast(?wxGenericDirCtrl_SetPath,
<<ThisRef:32/?UI,(byte_size(Path_UC)):32/?UI,(Path_UC)/binary, 0:(((8- ((0+byte_size(Path_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGenericDirCtrl()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGenericDirCtrl()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxGenericDirCtrl),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxGraphicsBrush.erl b/lib/wx/src/gen/wxGraphicsBrush.erl
index e1ad01567d..bbc0c4b1a0 100644
--- a/lib/wx/src/gen/wxGraphicsBrush.erl
+++ b/lib/wx/src/gen/wxGraphicsBrush.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -32,10 +32,12 @@
%% inherited exports
-export([getRenderer/1,isNull/1,parent_class/1]).
+-export_type([wxGraphicsBrush/0]).
%% @hidden
parent_class(wxGraphicsObject) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxGraphicsBrush() :: wx:wx_object().
%% From wxGraphicsObject
%% @hidden
isNull(This) -> wxGraphicsObject:isNull(This).
diff --git a/lib/wx/src/gen/wxGraphicsContext.erl b/lib/wx/src/gen/wxGraphicsContext.erl
index 05c56dd4b2..1dfa0dd405 100644
--- a/lib/wx/src/gen/wxGraphicsContext.erl
+++ b/lib/wx/src/gen/wxGraphicsContext.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,29 +29,31 @@
-include("wxe.hrl").
-export([clip/2,clip/5,concatTransform/2,create/0,create/1,createBrush/2,createFont/2,
createFont/3,createLinearGradientBrush/7,createMatrix/1,createMatrix/2,
- createPath/1,createPen/2,createRadialGradientBrush/8,drawBitmap/6,
- drawEllipse/5,drawIcon/6,drawLines/3,drawLines/4,drawPath/2,drawPath/3,
+ createPath/1,createPen/2,createRadialGradientBrush/8,destroy/1,drawBitmap/6,
+ drawEllipse/5,drawIcon/6,drawLines/2,drawLines/3,drawPath/2,drawPath/3,
drawRectangle/5,drawRoundedRectangle/6,drawText/4,drawText/5,drawText/6,
- fillPath/2,fillPath/3,getNativeContext/1,getPartialTextExtents/3,
- getTextExtent/2,getTransform/1,resetClip/1,rotate/2,scale/3,setBrush/2,
- setFont/2,setFont/3,setPen/2,setTransform/2,strokeLine/5,strokeLines/3,
- strokeLines/4,strokePath/2,translate/3]).
+ fillPath/2,fillPath/3,getPartialTextExtents/2,getTextExtent/2,getTransform/1,
+ resetClip/1,rotate/2,scale/3,setBrush/2,setFont/2,setFont/3,setPen/2,
+ setTransform/2,strokeLine/5,strokeLines/2,strokePath/2,translate/3]).
%% inherited exports
-export([getRenderer/1,isNull/1,parent_class/1]).
+-export_type([wxGraphicsContext/0]).
%% @hidden
parent_class(wxGraphicsObject) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxGraphicsContext()
+-type wxGraphicsContext() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextcreate">external documentation</a>.
+-spec create() -> wxGraphicsContext().
create() ->
wxe_util:call(?wxGraphicsContext_Create_0,
<<>>).
-%% @spec (Dc::wxWindowDC:wxWindowDC() | wxWindow:wxWindow()) -> wxGraphicsContext()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextcreate">external documentation</a>.
+-spec create(Dc) -> wxGraphicsContext() when
+ Dc::wxWindowDC:wxWindowDC() | wxWindow:wxWindow().
create(#wx_ref{type=DcT,ref=DcRef}) ->
DcOP = case ?CLASS_T(DcT,wxWindowDC) of
true ->
@@ -62,47 +64,54 @@ create(#wx_ref{type=DcT,ref=DcRef}) ->
wxe_util:call(DcOP,
<<DcRef:32/?UI>>).
-%% @spec (This::wxGraphicsContext(), Pen::wxPen:wxPen()) -> wxGraphicsPen:wxGraphicsPen()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextcreatepen">external documentation</a>.
+-spec createPen(This, Pen) -> wxGraphicsPen:wxGraphicsPen() when
+ This::wxGraphicsContext(), Pen::wxPen:wxPen().
createPen(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PenT,ref=PenRef}) ->
?CLASS(ThisT,wxGraphicsContext),
?CLASS(PenT,wxPen),
wxe_util:call(?wxGraphicsContext_CreatePen,
<<ThisRef:32/?UI,PenRef:32/?UI>>).
-%% @spec (This::wxGraphicsContext(), Brush::wxBrush:wxBrush()) -> wxGraphicsBrush:wxGraphicsBrush()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextcreatebrush">external documentation</a>.
+-spec createBrush(This, Brush) -> wxGraphicsBrush:wxGraphicsBrush() when
+ This::wxGraphicsContext(), Brush::wxBrush:wxBrush().
createBrush(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BrushT,ref=BrushRef}) ->
?CLASS(ThisT,wxGraphicsContext),
?CLASS(BrushT,wxBrush),
wxe_util:call(?wxGraphicsContext_CreateBrush,
<<ThisRef:32/?UI,BrushRef:32/?UI>>).
-%% @spec (This::wxGraphicsContext(), Xo::float(), Yo::float(), Xc::float(), Yc::float(), Radius::float(), OColor::wx:colour(), CColor::wx:colour()) -> wxGraphicsBrush:wxGraphicsBrush()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextcreateradialgradientbrush">external documentation</a>.
+-spec createRadialGradientBrush(This, Xo, Yo, Xc, Yc, Radius, OColor, CColor) -> wxGraphicsBrush:wxGraphicsBrush() when
+ This::wxGraphicsContext(), Xo::number(), Yo::number(), Xc::number(), Yc::number(), Radius::number(), OColor::wx:wx_colour(), CColor::wx:wx_colour().
createRadialGradientBrush(#wx_ref{type=ThisT,ref=ThisRef},Xo,Yo,Xc,Yc,Radius,OColor,CColor)
- when is_float(Xo),is_float(Yo),is_float(Xc),is_float(Yc),is_float(Radius),tuple_size(OColor) =:= 3; tuple_size(OColor) =:= 4,tuple_size(CColor) =:= 3; tuple_size(CColor) =:= 4 ->
+ when is_number(Xo),is_number(Yo),is_number(Xc),is_number(Yc),is_number(Radius),tuple_size(OColor) =:= 3; tuple_size(OColor) =:= 4,tuple_size(CColor) =:= 3; tuple_size(CColor) =:= 4 ->
?CLASS(ThisT,wxGraphicsContext),
wxe_util:call(?wxGraphicsContext_CreateRadialGradientBrush,
<<ThisRef:32/?UI,0:32,Xo:64/?F,Yo:64/?F,Xc:64/?F,Yc:64/?F,Radius:64/?F,(wxe_util:colour_bin(OColor)):16/binary,(wxe_util:colour_bin(CColor)):16/binary>>).
-%% @spec (This::wxGraphicsContext(), X1::float(), Y1::float(), X2::float(), Y2::float(), C1::wx:colour(), C2::wx:colour()) -> wxGraphicsBrush:wxGraphicsBrush()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextcreatelineargradientbrush">external documentation</a>.
+-spec createLinearGradientBrush(This, X1, Y1, X2, Y2, C1, C2) -> wxGraphicsBrush:wxGraphicsBrush() when
+ This::wxGraphicsContext(), X1::number(), Y1::number(), X2::number(), Y2::number(), C1::wx:wx_colour(), C2::wx:wx_colour().
createLinearGradientBrush(#wx_ref{type=ThisT,ref=ThisRef},X1,Y1,X2,Y2,C1,C2)
- when is_float(X1),is_float(Y1),is_float(X2),is_float(Y2),tuple_size(C1) =:= 3; tuple_size(C1) =:= 4,tuple_size(C2) =:= 3; tuple_size(C2) =:= 4 ->
+ when is_number(X1),is_number(Y1),is_number(X2),is_number(Y2),tuple_size(C1) =:= 3; tuple_size(C1) =:= 4,tuple_size(C2) =:= 3; tuple_size(C2) =:= 4 ->
?CLASS(ThisT,wxGraphicsContext),
wxe_util:call(?wxGraphicsContext_CreateLinearGradientBrush,
<<ThisRef:32/?UI,0:32,X1:64/?F,Y1:64/?F,X2:64/?F,Y2:64/?F,(wxe_util:colour_bin(C1)):16/binary,(wxe_util:colour_bin(C2)):16/binary>>).
-%% @spec (This::wxGraphicsContext(), Font::wxFont:wxFont()) -> wxGraphicsFont:wxGraphicsFont()
%% @equiv createFont(This,Font, [])
+-spec createFont(This, Font) -> wxGraphicsFont:wxGraphicsFont() when
+ This::wxGraphicsContext(), Font::wxFont:wxFont().
+
createFont(This,Font)
when is_record(This, wx_ref),is_record(Font, wx_ref) ->
createFont(This,Font, []).
-%% @spec (This::wxGraphicsContext(), Font::wxFont:wxFont(), [Option]) -> wxGraphicsFont:wxGraphicsFont()
-%% Option = {col, wx:colour()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextcreatefont">external documentation</a>.
+-spec createFont(This, Font, [Option]) -> wxGraphicsFont:wxGraphicsFont() when
+ This::wxGraphicsContext(), Font::wxFont:wxFont(),
+ Option :: {col, wx:wx_colour()}.
createFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGraphicsContext),
@@ -113,15 +122,23 @@ createFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}, Opti
wxe_util:call(?wxGraphicsContext_CreateFont,
<<ThisRef:32/?UI,FontRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGraphicsContext()) -> wxGraphicsMatrix:wxGraphicsMatrix()
%% @equiv createMatrix(This, [])
+-spec createMatrix(This) -> wxGraphicsMatrix:wxGraphicsMatrix() when
+ This::wxGraphicsContext().
+
createMatrix(This)
when is_record(This, wx_ref) ->
createMatrix(This, []).
-%% @spec (This::wxGraphicsContext(), [Option]) -> wxGraphicsMatrix:wxGraphicsMatrix()
-%% Option = {a, float()} | {b, float()} | {c, float()} | {d, float()} | {tx, float()} | {ty, float()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextcreatematrix">external documentation</a>.
+-spec createMatrix(This, [Option]) -> wxGraphicsMatrix:wxGraphicsMatrix() when
+ This::wxGraphicsContext(),
+ Option :: {a, number()}
+ | {b, number()}
+ | {c, number()}
+ | {d, number()}
+ | {tx, number()}
+ | {ty, number()}.
createMatrix(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGraphicsContext),
@@ -136,89 +153,103 @@ createMatrix(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxGraphicsContext_CreateMatrix,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGraphicsContext()) -> wxGraphicsPath:wxGraphicsPath()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextcreatepath">external documentation</a>.
+-spec createPath(This) -> wxGraphicsPath:wxGraphicsPath() when
+ This::wxGraphicsContext().
createPath(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGraphicsContext),
wxe_util:call(?wxGraphicsContext_CreatePath,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGraphicsContext(), Region::wxRegion:wxRegion()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextclip">external documentation</a>.
+-spec clip(This, Region) -> ok when
+ This::wxGraphicsContext(), Region::wxRegion:wxRegion().
clip(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=RegionT,ref=RegionRef}) ->
?CLASS(ThisT,wxGraphicsContext),
?CLASS(RegionT,wxRegion),
wxe_util:cast(?wxGraphicsContext_Clip_1,
<<ThisRef:32/?UI,RegionRef:32/?UI>>).
-%% @spec (This::wxGraphicsContext(), X::float(), Y::float(), W::float(), H::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextclip">external documentation</a>.
+-spec clip(This, X, Y, W, H) -> ok when
+ This::wxGraphicsContext(), X::number(), Y::number(), W::number(), H::number().
clip(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H)
- when is_float(X),is_float(Y),is_float(W),is_float(H) ->
+ when is_number(X),is_number(Y),is_number(W),is_number(H) ->
?CLASS(ThisT,wxGraphicsContext),
wxe_util:cast(?wxGraphicsContext_Clip_4,
<<ThisRef:32/?UI,0:32,X:64/?F,Y:64/?F,W:64/?F,H:64/?F>>).
-%% @spec (This::wxGraphicsContext()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextresetclip">external documentation</a>.
+-spec resetClip(This) -> ok when
+ This::wxGraphicsContext().
resetClip(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGraphicsContext),
wxe_util:cast(?wxGraphicsContext_ResetClip,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGraphicsContext(), Bmp::wxBitmap:wxBitmap(), X::float(), Y::float(), W::float(), H::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextdrawbitmap">external documentation</a>.
+-spec drawBitmap(This, Bmp, X, Y, W, H) -> ok when
+ This::wxGraphicsContext(), Bmp::wxBitmap:wxBitmap(), X::number(), Y::number(), W::number(), H::number().
drawBitmap(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BmpT,ref=BmpRef},X,Y,W,H)
- when is_float(X),is_float(Y),is_float(W),is_float(H) ->
+ when is_number(X),is_number(Y),is_number(W),is_number(H) ->
?CLASS(ThisT,wxGraphicsContext),
?CLASS(BmpT,wxBitmap),
wxe_util:cast(?wxGraphicsContext_DrawBitmap,
<<ThisRef:32/?UI,BmpRef:32/?UI,X:64/?F,Y:64/?F,W:64/?F,H:64/?F>>).
-%% @spec (This::wxGraphicsContext(), X::float(), Y::float(), W::float(), H::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextdrawellipse">external documentation</a>.
+-spec drawEllipse(This, X, Y, W, H) -> ok when
+ This::wxGraphicsContext(), X::number(), Y::number(), W::number(), H::number().
drawEllipse(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H)
- when is_float(X),is_float(Y),is_float(W),is_float(H) ->
+ when is_number(X),is_number(Y),is_number(W),is_number(H) ->
?CLASS(ThisT,wxGraphicsContext),
wxe_util:cast(?wxGraphicsContext_DrawEllipse,
<<ThisRef:32/?UI,0:32,X:64/?F,Y:64/?F,W:64/?F,H:64/?F>>).
-%% @spec (This::wxGraphicsContext(), Icon::wxIcon:wxIcon(), X::float(), Y::float(), W::float(), H::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextdrawicon">external documentation</a>.
+-spec drawIcon(This, Icon, X, Y, W, H) -> ok when
+ This::wxGraphicsContext(), Icon::wxIcon:wxIcon(), X::number(), Y::number(), W::number(), H::number().
drawIcon(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=IconT,ref=IconRef},X,Y,W,H)
- when is_float(X),is_float(Y),is_float(W),is_float(H) ->
+ when is_number(X),is_number(Y),is_number(W),is_number(H) ->
?CLASS(ThisT,wxGraphicsContext),
?CLASS(IconT,wxIcon),
wxe_util:cast(?wxGraphicsContext_DrawIcon,
<<ThisRef:32/?UI,IconRef:32/?UI,X:64/?F,Y:64/?F,W:64/?F,H:64/?F>>).
-%% @spec (This::wxGraphicsContext(), N::integer(), Points::{X::float(), Y::float()}) -> ok
-%% @equiv drawLines(This,N,Points, [])
-drawLines(This,N,Points={PointsX,PointsY})
- when is_record(This, wx_ref),is_integer(N),is_number(PointsX),is_number(PointsY) ->
- drawLines(This,N,Points, []).
+%% @equiv drawLines(This,Points, [])
+-spec drawLines(This, Points) -> ok when
+ This::wxGraphicsContext(), Points::[{X::float(), Y::float()}].
+
+drawLines(This,Points)
+ when is_record(This, wx_ref),is_list(Points) ->
+ drawLines(This,Points, []).
-%% @spec (This::wxGraphicsContext(), N::integer(), Points::{X::float(), Y::float()}, [Option]) -> ok
-%% Option = {fillStyle, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextdrawlines">external documentation</a>.
-drawLines(#wx_ref{type=ThisT,ref=ThisRef},N,{PointsX,PointsY}, Options)
- when is_integer(N),is_number(PointsX),is_number(PointsY),is_list(Options) ->
+-spec drawLines(This, Points, [Option]) -> ok when
+ This::wxGraphicsContext(), Points::[{X::float(), Y::float()}],
+ Option :: {fillStyle, integer()}.
+drawLines(#wx_ref{type=ThisT,ref=ThisRef},Points, Options)
+ when is_list(Points),is_list(Options) ->
?CLASS(ThisT,wxGraphicsContext),
MOpts = fun({fillStyle, FillStyle}, Acc) -> [<<1:32/?UI,FillStyle:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxGraphicsContext_DrawLines,
- <<ThisRef:32/?UI,N:32/?UI,PointsX:64/float,PointsY:64/float, BinOpt/binary>>).
+ <<ThisRef:32/?UI,(length(Points)):32/?UI,
+ (<< <<X:64/?F,Y:64/?F>> || {X,Y} <- Points>>)/binary, BinOpt/binary>>).
-%% @spec (This::wxGraphicsContext(), Path::wxGraphicsPath:wxGraphicsPath()) -> ok
%% @equiv drawPath(This,Path, [])
+-spec drawPath(This, Path) -> ok when
+ This::wxGraphicsContext(), Path::wxGraphicsPath:wxGraphicsPath().
+
drawPath(This,Path)
when is_record(This, wx_ref),is_record(Path, wx_ref) ->
drawPath(This,Path, []).
-%% @spec (This::wxGraphicsContext(), Path::wxGraphicsPath:wxGraphicsPath(), [Option]) -> ok
-%% Option = {fillStyle, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextdrawpath">external documentation</a>.
+-spec drawPath(This, Path, [Option]) -> ok when
+ This::wxGraphicsContext(), Path::wxGraphicsPath:wxGraphicsPath(),
+ Option :: {fillStyle, integer()}.
drawPath(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PathT,ref=PathRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGraphicsContext),
@@ -229,73 +260,80 @@ drawPath(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PathT,ref=PathRef}, Option
wxe_util:cast(?wxGraphicsContext_DrawPath,
<<ThisRef:32/?UI,PathRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGraphicsContext(), X::float(), Y::float(), W::float(), H::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextdrawrectangle">external documentation</a>.
+-spec drawRectangle(This, X, Y, W, H) -> ok when
+ This::wxGraphicsContext(), X::number(), Y::number(), W::number(), H::number().
drawRectangle(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H)
- when is_float(X),is_float(Y),is_float(W),is_float(H) ->
+ when is_number(X),is_number(Y),is_number(W),is_number(H) ->
?CLASS(ThisT,wxGraphicsContext),
wxe_util:cast(?wxGraphicsContext_DrawRectangle,
<<ThisRef:32/?UI,0:32,X:64/?F,Y:64/?F,W:64/?F,H:64/?F>>).
-%% @spec (This::wxGraphicsContext(), X::float(), Y::float(), W::float(), H::float(), Radius::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextdrawroundedrectangle">external documentation</a>.
+-spec drawRoundedRectangle(This, X, Y, W, H, Radius) -> ok when
+ This::wxGraphicsContext(), X::number(), Y::number(), W::number(), H::number(), Radius::number().
drawRoundedRectangle(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H,Radius)
- when is_float(X),is_float(Y),is_float(W),is_float(H),is_float(Radius) ->
+ when is_number(X),is_number(Y),is_number(W),is_number(H),is_number(Radius) ->
?CLASS(ThisT,wxGraphicsContext),
wxe_util:cast(?wxGraphicsContext_DrawRoundedRectangle,
<<ThisRef:32/?UI,0:32,X:64/?F,Y:64/?F,W:64/?F,H:64/?F,Radius:64/?F>>).
-%% @spec (This::wxGraphicsContext(), Str::string(), X::float(), Y::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextdrawtext">external documentation</a>.
+-spec drawText(This, Str, X, Y) -> ok when
+ This::wxGraphicsContext(), Str::unicode:chardata(), X::number(), Y::number().
drawText(#wx_ref{type=ThisT,ref=ThisRef},Str,X,Y)
- when is_list(Str),is_float(X),is_float(Y) ->
+ when is_list(Str),is_number(X),is_number(Y) ->
?CLASS(ThisT,wxGraphicsContext),
Str_UC = unicode:characters_to_binary([Str,0]),
wxe_util:cast(?wxGraphicsContext_DrawText_3,
<<ThisRef:32/?UI,(byte_size(Str_UC)):32/?UI,(Str_UC)/binary, 0:(((8- ((0+byte_size(Str_UC)) band 16#7)) band 16#7))/unit:8,X:64/?F,Y:64/?F>>).
-%% @spec (This::wxGraphicsContext(),Str::string(),X::float(),Y::float(),X::float()|term()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextdrawtext">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% drawText(This::wxGraphicsContext(), Str::string(), X::float(), Y::float(), Angle::float()) -> ok </c>
-%% </p>
-%% <p><c>
-%% drawText(This::wxGraphicsContext(), Str::string(), X::float(), Y::float(), BackgroundBrush::wxGraphicsBrush:wxGraphicsBrush()) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% drawText(This, Str, X, Y, BackgroundBrush) -> ok when<br />
+%% This::wxGraphicsContext(), Str::unicode:chardata(), X::number(), Y::number(), BackgroundBrush::wxGraphicsBrush:wxGraphicsBrush().<br />
+%%
+-spec drawText(This, Str, X, Y, Angle) -> ok when
+ This::wxGraphicsContext(), Str::unicode:chardata(), X::number(), Y::number(), Angle::number();
+ (This, Str, X, Y, BackgroundBrush) -> ok when
+ This::wxGraphicsContext(), Str::unicode:chardata(), X::number(), Y::number(), BackgroundBrush::wxGraphicsBrush:wxGraphicsBrush().
drawText(#wx_ref{type=ThisT,ref=ThisRef},Str,X,Y,Angle)
- when is_list(Str),is_float(X),is_float(Y),is_float(Angle) ->
+ when is_list(Str),is_number(X),is_number(Y),is_number(Angle) ->
?CLASS(ThisT,wxGraphicsContext),
Str_UC = unicode:characters_to_binary([Str,0]),
wxe_util:cast(?wxGraphicsContext_DrawText_4_0,
<<ThisRef:32/?UI,(byte_size(Str_UC)):32/?UI,(Str_UC)/binary, 0:(((8- ((0+byte_size(Str_UC)) band 16#7)) band 16#7))/unit:8,X:64/?F,Y:64/?F,Angle:64/?F>>);
drawText(#wx_ref{type=ThisT,ref=ThisRef},Str,X,Y,#wx_ref{type=BackgroundBrushT,ref=BackgroundBrushRef})
- when is_list(Str),is_float(X),is_float(Y) ->
+ when is_list(Str),is_number(X),is_number(Y) ->
?CLASS(ThisT,wxGraphicsContext),
Str_UC = unicode:characters_to_binary([Str,0]),
?CLASS(BackgroundBrushT,wxGraphicsBrush),
wxe_util:cast(?wxGraphicsContext_DrawText_4_1,
<<ThisRef:32/?UI,(byte_size(Str_UC)):32/?UI,(Str_UC)/binary, 0:(((8- ((0+byte_size(Str_UC)) band 16#7)) band 16#7))/unit:8,X:64/?F,Y:64/?F,BackgroundBrushRef:32/?UI>>).
-%% @spec (This::wxGraphicsContext(), Str::string(), X::float(), Y::float(), Angle::float(), BackgroundBrush::wxGraphicsBrush:wxGraphicsBrush()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextdrawtext">external documentation</a>.
+-spec drawText(This, Str, X, Y, Angle, BackgroundBrush) -> ok when
+ This::wxGraphicsContext(), Str::unicode:chardata(), X::number(), Y::number(), Angle::number(), BackgroundBrush::wxGraphicsBrush:wxGraphicsBrush().
drawText(#wx_ref{type=ThisT,ref=ThisRef},Str,X,Y,Angle,#wx_ref{type=BackgroundBrushT,ref=BackgroundBrushRef})
- when is_list(Str),is_float(X),is_float(Y),is_float(Angle) ->
+ when is_list(Str),is_number(X),is_number(Y),is_number(Angle) ->
?CLASS(ThisT,wxGraphicsContext),
Str_UC = unicode:characters_to_binary([Str,0]),
?CLASS(BackgroundBrushT,wxGraphicsBrush),
wxe_util:cast(?wxGraphicsContext_DrawText_5,
<<ThisRef:32/?UI,(byte_size(Str_UC)):32/?UI,(Str_UC)/binary, 0:(((8- ((0+byte_size(Str_UC)) band 16#7)) band 16#7))/unit:8,X:64/?F,Y:64/?F,Angle:64/?F,BackgroundBrushRef:32/?UI>>).
-%% @spec (This::wxGraphicsContext(), Path::wxGraphicsPath:wxGraphicsPath()) -> ok
%% @equiv fillPath(This,Path, [])
+-spec fillPath(This, Path) -> ok when
+ This::wxGraphicsContext(), Path::wxGraphicsPath:wxGraphicsPath().
+
fillPath(This,Path)
when is_record(This, wx_ref),is_record(Path, wx_ref) ->
fillPath(This,Path, []).
-%% @spec (This::wxGraphicsContext(), Path::wxGraphicsPath:wxGraphicsPath(), [Option]) -> ok
-%% Option = {fillStyle, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextfillpath">external documentation</a>.
+-spec fillPath(This, Path, [Option]) -> ok when
+ This::wxGraphicsContext(), Path::wxGraphicsPath:wxGraphicsPath(),
+ Option :: {fillStyle, integer()}.
fillPath(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PathT,ref=PathRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGraphicsContext),
@@ -306,33 +344,29 @@ fillPath(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PathT,ref=PathRef}, Option
wxe_util:cast(?wxGraphicsContext_FillPath,
<<ThisRef:32/?UI,PathRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGraphicsContext(), Path::wxGraphicsPath:wxGraphicsPath()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextstrokepath">external documentation</a>.
+-spec strokePath(This, Path) -> ok when
+ This::wxGraphicsContext(), Path::wxGraphicsPath:wxGraphicsPath().
strokePath(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PathT,ref=PathRef}) ->
?CLASS(ThisT,wxGraphicsContext),
?CLASS(PathT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsContext_StrokePath,
<<ThisRef:32/?UI,PathRef:32/?UI>>).
-%% @spec (This::wxGraphicsContext()) -> ok
-%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextgetnativecontext">external documentation</a>.
-getNativeContext(#wx_ref{type=ThisT,ref=ThisRef}) ->
- ?CLASS(ThisT,wxGraphicsContext),
- wxe_util:cast(?wxGraphicsContext_GetNativeContext,
- <<ThisRef:32/?UI>>).
-
-%% @spec (This::wxGraphicsContext(), Text::string(), Widths::[float()]) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextgetpartialtextextents">external documentation</a>.
-getPartialTextExtents(#wx_ref{type=ThisT,ref=ThisRef},Text,Widths)
- when is_list(Text),is_list(Widths) ->
+-spec getPartialTextExtents(This, Text) -> [number()] when
+ This::wxGraphicsContext(), Text::unicode:chardata().
+getPartialTextExtents(#wx_ref{type=ThisT,ref=ThisRef},Text)
+ when is_list(Text) ->
?CLASS(ThisT,wxGraphicsContext),
Text_UC = unicode:characters_to_binary([Text,0]),
- wxe_util:cast(?wxGraphicsContext_GetPartialTextExtents,
- <<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,(length(Widths)):32/?UI,
-0:32, (<< <<C:64/float>> || C <- Widths>>)/binary>>).
+ wxe_util:call(?wxGraphicsContext_GetPartialTextExtents,
+ <<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGraphicsContext(), Text::string()) -> {Width::float(), Height::float(), Descent::float(), ExternalLeading::float()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextgettextextent">external documentation</a>.
+-spec getTextExtent(This, Text) -> Result when
+ Result ::{Width::number(), Height::number(), Descent::number(), ExternalLeading::number()},
+ This::wxGraphicsContext(), Text::unicode:chardata().
getTextExtent(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_list(Text) ->
?CLASS(ThisT,wxGraphicsContext),
@@ -340,55 +374,62 @@ getTextExtent(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:call(?wxGraphicsContext_GetTextExtent,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGraphicsContext(), Angle::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextrotate">external documentation</a>.
+-spec rotate(This, Angle) -> ok when
+ This::wxGraphicsContext(), Angle::number().
rotate(#wx_ref{type=ThisT,ref=ThisRef},Angle)
- when is_float(Angle) ->
+ when is_number(Angle) ->
?CLASS(ThisT,wxGraphicsContext),
wxe_util:cast(?wxGraphicsContext_Rotate,
<<ThisRef:32/?UI,0:32,Angle:64/?F>>).
-%% @spec (This::wxGraphicsContext(), XScale::float(), YScale::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextscale">external documentation</a>.
+-spec scale(This, XScale, YScale) -> ok when
+ This::wxGraphicsContext(), XScale::number(), YScale::number().
scale(#wx_ref{type=ThisT,ref=ThisRef},XScale,YScale)
- when is_float(XScale),is_float(YScale) ->
+ when is_number(XScale),is_number(YScale) ->
?CLASS(ThisT,wxGraphicsContext),
wxe_util:cast(?wxGraphicsContext_Scale,
<<ThisRef:32/?UI,0:32,XScale:64/?F,YScale:64/?F>>).
-%% @spec (This::wxGraphicsContext(), Dx::float(), Dy::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontexttranslate">external documentation</a>.
+-spec translate(This, Dx, Dy) -> ok when
+ This::wxGraphicsContext(), Dx::number(), Dy::number().
translate(#wx_ref{type=ThisT,ref=ThisRef},Dx,Dy)
- when is_float(Dx),is_float(Dy) ->
+ when is_number(Dx),is_number(Dy) ->
?CLASS(ThisT,wxGraphicsContext),
wxe_util:cast(?wxGraphicsContext_Translate,
<<ThisRef:32/?UI,0:32,Dx:64/?F,Dy:64/?F>>).
-%% @spec (This::wxGraphicsContext()) -> wxGraphicsMatrix:wxGraphicsMatrix()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextgettransform">external documentation</a>.
+-spec getTransform(This) -> wxGraphicsMatrix:wxGraphicsMatrix() when
+ This::wxGraphicsContext().
getTransform(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGraphicsContext),
wxe_util:call(?wxGraphicsContext_GetTransform,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGraphicsContext(), Matrix::wxGraphicsMatrix:wxGraphicsMatrix()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextsettransform">external documentation</a>.
+-spec setTransform(This, Matrix) -> ok when
+ This::wxGraphicsContext(), Matrix::wxGraphicsMatrix:wxGraphicsMatrix().
setTransform(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MatrixT,ref=MatrixRef}) ->
?CLASS(ThisT,wxGraphicsContext),
?CLASS(MatrixT,wxGraphicsMatrix),
wxe_util:cast(?wxGraphicsContext_SetTransform,
<<ThisRef:32/?UI,MatrixRef:32/?UI>>).
-%% @spec (This::wxGraphicsContext(), Matrix::wxGraphicsMatrix:wxGraphicsMatrix()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextconcattransform">external documentation</a>.
+-spec concatTransform(This, Matrix) -> ok when
+ This::wxGraphicsContext(), Matrix::wxGraphicsMatrix:wxGraphicsMatrix().
concatTransform(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MatrixT,ref=MatrixRef}) ->
?CLASS(ThisT,wxGraphicsContext),
?CLASS(MatrixT,wxGraphicsMatrix),
wxe_util:cast(?wxGraphicsContext_ConcatTransform,
<<ThisRef:32/?UI,MatrixRef:32/?UI>>).
-%% @spec (This::wxGraphicsContext(), Brush::wxGraphicsBrush:wxGraphicsBrush() | wxBrush:wxBrush()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextsetbrush">external documentation</a>.
+-spec setBrush(This, Brush) -> ok when
+ This::wxGraphicsContext(), Brush::wxGraphicsBrush:wxGraphicsBrush() | wxBrush:wxBrush().
setBrush(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BrushT,ref=BrushRef}) ->
?CLASS(ThisT,wxGraphicsContext),
BrushOP = case ?CLASS_T(BrushT,wxGraphicsBrush) of
@@ -400,16 +441,18 @@ setBrush(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BrushT,ref=BrushRef}) ->
wxe_util:cast(BrushOP,
<<ThisRef:32/?UI,BrushRef:32/?UI>>).
-%% @spec (This::wxGraphicsContext(), Font::wxGraphicsFont:wxGraphicsFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextsetfont">external documentation</a>.
+-spec setFont(This, Font) -> ok when
+ This::wxGraphicsContext(), Font::wxGraphicsFont:wxGraphicsFont().
setFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}) ->
?CLASS(ThisT,wxGraphicsContext),
?CLASS(FontT,wxGraphicsFont),
wxe_util:cast(?wxGraphicsContext_SetFont_1,
<<ThisRef:32/?UI,FontRef:32/?UI>>).
-%% @spec (This::wxGraphicsContext(), Font::wxFont:wxFont(), Colour::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextsetfont">external documentation</a>.
+-spec setFont(This, Font, Colour) -> ok when
+ This::wxGraphicsContext(), Font::wxFont:wxFont(), Colour::wx:wx_colour().
setFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef},Colour)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxGraphicsContext),
@@ -417,8 +460,9 @@ setFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef},Colour)
wxe_util:cast(?wxGraphicsContext_SetFont_2,
<<ThisRef:32/?UI,FontRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
-%% @spec (This::wxGraphicsContext(), Pen::wxPen:wxPen() | wxGraphicsPen:wxGraphicsPen()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextsetpen">external documentation</a>.
+-spec setPen(This, Pen) -> ok when
+ This::wxGraphicsContext(), Pen::wxPen:wxPen() | wxGraphicsPen:wxGraphicsPen().
setPen(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PenT,ref=PenRef}) ->
?CLASS(ThisT,wxGraphicsContext),
PenOP = case ?CLASS_T(PenT,wxPen) of
@@ -430,30 +474,31 @@ setPen(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PenT,ref=PenRef}) ->
wxe_util:cast(PenOP,
<<ThisRef:32/?UI,PenRef:32/?UI>>).
-%% @spec (This::wxGraphicsContext(), X1::float(), Y1::float(), X2::float(), Y2::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextstrokeline">external documentation</a>.
+-spec strokeLine(This, X1, Y1, X2, Y2) -> ok when
+ This::wxGraphicsContext(), X1::number(), Y1::number(), X2::number(), Y2::number().
strokeLine(#wx_ref{type=ThisT,ref=ThisRef},X1,Y1,X2,Y2)
- when is_float(X1),is_float(Y1),is_float(X2),is_float(Y2) ->
+ when is_number(X1),is_number(Y1),is_number(X2),is_number(Y2) ->
?CLASS(ThisT,wxGraphicsContext),
wxe_util:cast(?wxGraphicsContext_StrokeLine,
<<ThisRef:32/?UI,0:32,X1:64/?F,Y1:64/?F,X2:64/?F,Y2:64/?F>>).
-%% @spec (This::wxGraphicsContext(), N::integer(), Points::{X::float(), Y::float()}) -> ok
-%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextstrokelines">external documentation</a>.
-strokeLines(#wx_ref{type=ThisT,ref=ThisRef},N,{PointsX,PointsY})
- when is_integer(N),is_number(PointsX),is_number(PointsY) ->
- ?CLASS(ThisT,wxGraphicsContext),
- wxe_util:cast(?wxGraphicsContext_StrokeLines_2,
- <<ThisRef:32/?UI,N:32/?UI,PointsX:64/float,PointsY:64/float>>).
-
-%% @spec (This::wxGraphicsContext(), N::integer(), BeginPoints::{X::float(), Y::float()}, EndPoints::{X::float(), Y::float()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicscontext.html#wxgraphicscontextstrokelines">external documentation</a>.
-strokeLines(#wx_ref{type=ThisT,ref=ThisRef},N,{BeginPointsX,BeginPointsY},{EndPointsX,EndPointsY})
- when is_integer(N),is_number(BeginPointsX),is_number(BeginPointsY),is_number(EndPointsX),is_number(EndPointsY) ->
- ?CLASS(ThisT,wxGraphicsContext),
- wxe_util:cast(?wxGraphicsContext_StrokeLines_3,
- <<ThisRef:32/?UI,N:32/?UI,BeginPointsX:64/float,BeginPointsY:64/float,EndPointsX:64/float,EndPointsY:64/float>>).
-
+-spec strokeLines(This, Points) -> ok when
+ This::wxGraphicsContext(), Points::[{X::float(), Y::float()}].
+strokeLines(#wx_ref{type=ThisT,ref=ThisRef},Points)
+ when is_list(Points) ->
+ ?CLASS(ThisT,wxGraphicsContext),
+ wxe_util:cast(?wxGraphicsContext_StrokeLines,
+ <<ThisRef:32/?UI,(length(Points)):32/?UI,
+ (<< <<X:64/?F,Y:64/?F>> || {X,Y} <- Points>>)/binary>>).
+
+%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGraphicsContext()) -> ok.
+destroy(Obj=#wx_ref{type=Type}) ->
+ ?CLASS(Type,wxGraphicsContext),
+ wxe_util:destroy(?DESTROY_OBJECT,Obj),
+ ok.
%% From wxGraphicsObject
%% @hidden
isNull(This) -> wxGraphicsObject:isNull(This).
diff --git a/lib/wx/src/gen/wxGraphicsFont.erl b/lib/wx/src/gen/wxGraphicsFont.erl
index 19b2172176..03220599fb 100644
--- a/lib/wx/src/gen/wxGraphicsFont.erl
+++ b/lib/wx/src/gen/wxGraphicsFont.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -32,10 +32,12 @@
%% inherited exports
-export([getRenderer/1,isNull/1,parent_class/1]).
+-export_type([wxGraphicsFont/0]).
%% @hidden
parent_class(wxGraphicsObject) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxGraphicsFont() :: wx:wx_object().
%% From wxGraphicsObject
%% @hidden
isNull(This) -> wxGraphicsObject:isNull(This).
diff --git a/lib/wx/src/gen/wxGraphicsMatrix.erl b/lib/wx/src/gen/wxGraphicsMatrix.erl
index 635a2027b3..36c33069ad 100644
--- a/lib/wx/src/gen/wxGraphicsMatrix.erl
+++ b/lib/wx/src/gen/wxGraphicsMatrix.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -27,93 +27,105 @@
-module(wxGraphicsMatrix).
-include("wxe.hrl").
--export([concat/2,get/1,getNativeMatrix/1,invert/1,isEqual/2,isIdentity/1,rotate/2,
- scale/3,set/1,set/2,transformDistance/1,transformPoint/1,translate/3]).
+-export([concat/2,get/1,invert/1,isEqual/2,isIdentity/1,rotate/2,scale/3,set/1,
+ set/2,transformDistance/1,transformPoint/1,translate/3]).
%% inherited exports
-export([getRenderer/1,isNull/1,parent_class/1]).
+-export_type([wxGraphicsMatrix/0]).
%% @hidden
parent_class(wxGraphicsObject) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxGraphicsMatrix(), T::wxGraphicsMatrix()) -> ok
+-type wxGraphicsMatrix() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsmatrix.html#wxgraphicsmatrixconcat">external documentation</a>.
+-spec concat(This, T) -> ok when
+ This::wxGraphicsMatrix(), T::wxGraphicsMatrix().
concat(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=TT,ref=TRef}) ->
?CLASS(ThisT,wxGraphicsMatrix),
?CLASS(TT,wxGraphicsMatrix),
wxe_util:cast(?wxGraphicsMatrix_Concat,
<<ThisRef:32/?UI,TRef:32/?UI>>).
-%% @spec (This::wxGraphicsMatrix()) -> {A::float(), B::float(), C::float(), D::float(), Tx::float(), Ty::float()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsmatrix.html#wxgraphicsmatrixget">external documentation</a>.
+-spec get(This) -> Result when
+ Result ::{A::number(), B::number(), C::number(), D::number(), Tx::number(), Ty::number()},
+ This::wxGraphicsMatrix().
get(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGraphicsMatrix),
wxe_util:call(?wxGraphicsMatrix_Get,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGraphicsMatrix()) -> ok
-%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsmatrix.html#wxgraphicsmatrixgetnativematrix">external documentation</a>.
-getNativeMatrix(#wx_ref{type=ThisT,ref=ThisRef}) ->
- ?CLASS(ThisT,wxGraphicsMatrix),
- wxe_util:cast(?wxGraphicsMatrix_GetNativeMatrix,
- <<ThisRef:32/?UI>>).
-
-%% @spec (This::wxGraphicsMatrix()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsmatrix.html#wxgraphicsmatrixinvert">external documentation</a>.
+-spec invert(This) -> ok when
+ This::wxGraphicsMatrix().
invert(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGraphicsMatrix),
wxe_util:cast(?wxGraphicsMatrix_Invert,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGraphicsMatrix(), T::wxGraphicsMatrix()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsmatrix.html#wxgraphicsmatrixisequal">external documentation</a>.
+-spec isEqual(This, T) -> boolean() when
+ This::wxGraphicsMatrix(), T::wxGraphicsMatrix().
isEqual(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=TT,ref=TRef}) ->
?CLASS(ThisT,wxGraphicsMatrix),
?CLASS(TT,wxGraphicsMatrix),
wxe_util:call(?wxGraphicsMatrix_IsEqual,
<<ThisRef:32/?UI,TRef:32/?UI>>).
-%% @spec (This::wxGraphicsMatrix()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsmatrix.html#wxgraphicsmatrixisidentity">external documentation</a>.
+-spec isIdentity(This) -> boolean() when
+ This::wxGraphicsMatrix().
isIdentity(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGraphicsMatrix),
wxe_util:call(?wxGraphicsMatrix_IsIdentity,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGraphicsMatrix(), Angle::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsmatrix.html#wxgraphicsmatrixrotate">external documentation</a>.
+-spec rotate(This, Angle) -> ok when
+ This::wxGraphicsMatrix(), Angle::number().
rotate(#wx_ref{type=ThisT,ref=ThisRef},Angle)
- when is_float(Angle) ->
+ when is_number(Angle) ->
?CLASS(ThisT,wxGraphicsMatrix),
wxe_util:cast(?wxGraphicsMatrix_Rotate,
<<ThisRef:32/?UI,0:32,Angle:64/?F>>).
-%% @spec (This::wxGraphicsMatrix(), XScale::float(), YScale::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsmatrix.html#wxgraphicsmatrixscale">external documentation</a>.
+-spec scale(This, XScale, YScale) -> ok when
+ This::wxGraphicsMatrix(), XScale::number(), YScale::number().
scale(#wx_ref{type=ThisT,ref=ThisRef},XScale,YScale)
- when is_float(XScale),is_float(YScale) ->
+ when is_number(XScale),is_number(YScale) ->
?CLASS(ThisT,wxGraphicsMatrix),
wxe_util:cast(?wxGraphicsMatrix_Scale,
<<ThisRef:32/?UI,0:32,XScale:64/?F,YScale:64/?F>>).
-%% @spec (This::wxGraphicsMatrix(), Dx::float(), Dy::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsmatrix.html#wxgraphicsmatrixtranslate">external documentation</a>.
+-spec translate(This, Dx, Dy) -> ok when
+ This::wxGraphicsMatrix(), Dx::number(), Dy::number().
translate(#wx_ref{type=ThisT,ref=ThisRef},Dx,Dy)
- when is_float(Dx),is_float(Dy) ->
+ when is_number(Dx),is_number(Dy) ->
?CLASS(ThisT,wxGraphicsMatrix),
wxe_util:cast(?wxGraphicsMatrix_Translate,
<<ThisRef:32/?UI,0:32,Dx:64/?F,Dy:64/?F>>).
-%% @spec (This::wxGraphicsMatrix()) -> ok
%% @equiv set(This, [])
+-spec set(This) -> ok when
+ This::wxGraphicsMatrix().
+
set(This)
when is_record(This, wx_ref) ->
set(This, []).
-%% @spec (This::wxGraphicsMatrix(), [Option]) -> ok
-%% Option = {a, float()} | {b, float()} | {c, float()} | {d, float()} | {tx, float()} | {ty, float()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsmatrix.html#wxgraphicsmatrixset">external documentation</a>.
+-spec set(This, [Option]) -> ok when
+ This::wxGraphicsMatrix(),
+ Option :: {a, number()}
+ | {b, number()}
+ | {c, number()}
+ | {d, number()}
+ | {tx, number()}
+ | {ty, number()}.
set(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGraphicsMatrix),
@@ -128,15 +140,17 @@ set(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxGraphicsMatrix_Set,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGraphicsMatrix()) -> {X::float(), Y::float()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsmatrix.html#wxgraphicsmatrixtransformpoint">external documentation</a>.
+-spec transformPoint(This) -> {X::number(), Y::number()} when
+ This::wxGraphicsMatrix().
transformPoint(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGraphicsMatrix),
wxe_util:call(?wxGraphicsMatrix_TransformPoint,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGraphicsMatrix()) -> {Dx::float(), Dy::float()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsmatrix.html#wxgraphicsmatrixtransformdistance">external documentation</a>.
+-spec transformDistance(This) -> {Dx::number(), Dy::number()} when
+ This::wxGraphicsMatrix().
transformDistance(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGraphicsMatrix),
wxe_util:call(?wxGraphicsMatrix_TransformDistance,
diff --git a/lib/wx/src/gen/wxGraphicsObject.erl b/lib/wx/src/gen/wxGraphicsObject.erl
index 7e63285b7a..857a398e1f 100644
--- a/lib/wx/src/gen/wxGraphicsObject.erl
+++ b/lib/wx/src/gen/wxGraphicsObject.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -24,25 +24,35 @@
-module(wxGraphicsObject).
-include("wxe.hrl").
--export([getRenderer/1,isNull/1]).
+-export([destroy/1,getRenderer/1,isNull/1]).
%% inherited exports
-export([parent_class/1]).
+-export_type([wxGraphicsObject/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxGraphicsObject()) -> wxGraphicsRenderer:wxGraphicsRenderer()
+-type wxGraphicsObject() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsobject.html#wxgraphicsobjectgetrenderer">external documentation</a>.
+-spec getRenderer(This) -> wxGraphicsRenderer:wxGraphicsRenderer() when
+ This::wxGraphicsObject().
getRenderer(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGraphicsObject),
wxe_util:call(?wxGraphicsObject_GetRenderer,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGraphicsObject()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsobject.html#wxgraphicsobjectisnull">external documentation</a>.
+-spec isNull(This) -> boolean() when
+ This::wxGraphicsObject().
isNull(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGraphicsObject),
wxe_util:call(?wxGraphicsObject_IsNull,
<<ThisRef:32/?UI>>).
+%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGraphicsObject()) -> ok.
+destroy(Obj=#wx_ref{type=Type}) ->
+ ?CLASS(Type,wxGraphicsObject),
+ wxe_util:destroy(?DESTROY_OBJECT,Obj),
+ ok.
diff --git a/lib/wx/src/gen/wxGraphicsPath.erl b/lib/wx/src/gen/wxGraphicsPath.erl
index e41496c641..56b853899a 100644
--- a/lib/wx/src/gen/wxGraphicsPath.erl
+++ b/lib/wx/src/gen/wxGraphicsPath.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -36,155 +36,177 @@
%% inherited exports
-export([getRenderer/1,isNull/1,parent_class/1]).
+-export_type([wxGraphicsPath/0]).
%% @hidden
parent_class(wxGraphicsObject) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxGraphicsPath(), P::{X::float(), Y::float()}) -> ok
+-type wxGraphicsPath() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathmovetopoint">external documentation</a>.
+-spec moveToPoint(This, P) -> ok when
+ This::wxGraphicsPath(), P::{X::float(), Y::float()}.
moveToPoint(#wx_ref{type=ThisT,ref=ThisRef},{PX,PY})
when is_number(PX),is_number(PY) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_MoveToPoint_1,
- <<ThisRef:32/?UI,0:32,PX:64/float,PY:64/float>>).
+ <<ThisRef:32/?UI,0:32,PX:64/?F,PY:64/?F>>).
-%% @spec (This::wxGraphicsPath(), X::float(), Y::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathmovetopoint">external documentation</a>.
+-spec moveToPoint(This, X, Y) -> ok when
+ This::wxGraphicsPath(), X::number(), Y::number().
moveToPoint(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
- when is_float(X),is_float(Y) ->
+ when is_number(X),is_number(Y) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_MoveToPoint_2,
<<ThisRef:32/?UI,0:32,X:64/?F,Y:64/?F>>).
-%% @spec (This::wxGraphicsPath(), C::{X::float(), Y::float()}, R::float(), StartAngle::float(), EndAngle::float(), Clockwise::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathaddarc">external documentation</a>.
+-spec addArc(This, C, R, StartAngle, EndAngle, Clockwise) -> ok when
+ This::wxGraphicsPath(), C::{X::float(), Y::float()}, R::number(), StartAngle::number(), EndAngle::number(), Clockwise::boolean().
addArc(#wx_ref{type=ThisT,ref=ThisRef},{CX,CY},R,StartAngle,EndAngle,Clockwise)
- when is_number(CX),is_number(CY),is_float(R),is_float(StartAngle),is_float(EndAngle),is_boolean(Clockwise) ->
+ when is_number(CX),is_number(CY),is_number(R),is_number(StartAngle),is_number(EndAngle),is_boolean(Clockwise) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_AddArc_5,
- <<ThisRef:32/?UI,0:32,CX:64/float,CY:64/float,R:64/?F,StartAngle:64/?F,EndAngle:64/?F,(wxe_util:from_bool(Clockwise)):32/?UI>>).
+ <<ThisRef:32/?UI,0:32,CX:64/?F,CY:64/?F,R:64/?F,StartAngle:64/?F,EndAngle:64/?F,(wxe_util:from_bool(Clockwise)):32/?UI>>).
-%% @spec (This::wxGraphicsPath(), X::float(), Y::float(), R::float(), StartAngle::float(), EndAngle::float(), Clockwise::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathaddarc">external documentation</a>.
+-spec addArc(This, X, Y, R, StartAngle, EndAngle, Clockwise) -> ok when
+ This::wxGraphicsPath(), X::number(), Y::number(), R::number(), StartAngle::number(), EndAngle::number(), Clockwise::boolean().
addArc(#wx_ref{type=ThisT,ref=ThisRef},X,Y,R,StartAngle,EndAngle,Clockwise)
- when is_float(X),is_float(Y),is_float(R),is_float(StartAngle),is_float(EndAngle),is_boolean(Clockwise) ->
+ when is_number(X),is_number(Y),is_number(R),is_number(StartAngle),is_number(EndAngle),is_boolean(Clockwise) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_AddArc_6,
<<ThisRef:32/?UI,0:32,X:64/?F,Y:64/?F,R:64/?F,StartAngle:64/?F,EndAngle:64/?F,(wxe_util:from_bool(Clockwise)):32/?UI>>).
-%% @spec (This::wxGraphicsPath(), X1::float(), Y1::float(), X2::float(), Y2::float(), R::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathaddarctopoint">external documentation</a>.
+-spec addArcToPoint(This, X1, Y1, X2, Y2, R) -> ok when
+ This::wxGraphicsPath(), X1::number(), Y1::number(), X2::number(), Y2::number(), R::number().
addArcToPoint(#wx_ref{type=ThisT,ref=ThisRef},X1,Y1,X2,Y2,R)
- when is_float(X1),is_float(Y1),is_float(X2),is_float(Y2),is_float(R) ->
+ when is_number(X1),is_number(Y1),is_number(X2),is_number(Y2),is_number(R) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_AddArcToPoint,
<<ThisRef:32/?UI,0:32,X1:64/?F,Y1:64/?F,X2:64/?F,Y2:64/?F,R:64/?F>>).
-%% @spec (This::wxGraphicsPath(), X::float(), Y::float(), R::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathaddcircle">external documentation</a>.
+-spec addCircle(This, X, Y, R) -> ok when
+ This::wxGraphicsPath(), X::number(), Y::number(), R::number().
addCircle(#wx_ref{type=ThisT,ref=ThisRef},X,Y,R)
- when is_float(X),is_float(Y),is_float(R) ->
+ when is_number(X),is_number(Y),is_number(R) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_AddCircle,
<<ThisRef:32/?UI,0:32,X:64/?F,Y:64/?F,R:64/?F>>).
-%% @spec (This::wxGraphicsPath(), C1::{X::float(), Y::float()}, C2::{X::float(), Y::float()}, E::{X::float(), Y::float()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathaddcurvetopoint">external documentation</a>.
+-spec addCurveToPoint(This, C1, C2, E) -> ok when
+ This::wxGraphicsPath(), C1::{X::float(), Y::float()}, C2::{X::float(), Y::float()}, E::{X::float(), Y::float()}.
addCurveToPoint(#wx_ref{type=ThisT,ref=ThisRef},{C1X,C1Y},{C2X,C2Y},{EX,EY})
when is_number(C1X),is_number(C1Y),is_number(C2X),is_number(C2Y),is_number(EX),is_number(EY) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_AddCurveToPoint_3,
- <<ThisRef:32/?UI,0:32,C1X:64/float,C1Y:64/float,C2X:64/float,C2Y:64/float,EX:64/float,EY:64/float>>).
+ <<ThisRef:32/?UI,0:32,C1X:64/?F,C1Y:64/?F,C2X:64/?F,C2Y:64/?F,EX:64/?F,EY:64/?F>>).
-%% @spec (This::wxGraphicsPath(), Cx1::float(), Cy1::float(), Cx2::float(), Cy2::float(), X::float(), Y::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathaddcurvetopoint">external documentation</a>.
+-spec addCurveToPoint(This, Cx1, Cy1, Cx2, Cy2, X, Y) -> ok when
+ This::wxGraphicsPath(), Cx1::number(), Cy1::number(), Cx2::number(), Cy2::number(), X::number(), Y::number().
addCurveToPoint(#wx_ref{type=ThisT,ref=ThisRef},Cx1,Cy1,Cx2,Cy2,X,Y)
- when is_float(Cx1),is_float(Cy1),is_float(Cx2),is_float(Cy2),is_float(X),is_float(Y) ->
+ when is_number(Cx1),is_number(Cy1),is_number(Cx2),is_number(Cy2),is_number(X),is_number(Y) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_AddCurveToPoint_6,
<<ThisRef:32/?UI,0:32,Cx1:64/?F,Cy1:64/?F,Cx2:64/?F,Cy2:64/?F,X:64/?F,Y:64/?F>>).
-%% @spec (This::wxGraphicsPath(), X::float(), Y::float(), W::float(), H::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathaddellipse">external documentation</a>.
+-spec addEllipse(This, X, Y, W, H) -> ok when
+ This::wxGraphicsPath(), X::number(), Y::number(), W::number(), H::number().
addEllipse(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H)
- when is_float(X),is_float(Y),is_float(W),is_float(H) ->
+ when is_number(X),is_number(Y),is_number(W),is_number(H) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_AddEllipse,
<<ThisRef:32/?UI,0:32,X:64/?F,Y:64/?F,W:64/?F,H:64/?F>>).
-%% @spec (This::wxGraphicsPath(), P::{X::float(), Y::float()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathaddlinetopoint">external documentation</a>.
+-spec addLineToPoint(This, P) -> ok when
+ This::wxGraphicsPath(), P::{X::float(), Y::float()}.
addLineToPoint(#wx_ref{type=ThisT,ref=ThisRef},{PX,PY})
when is_number(PX),is_number(PY) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_AddLineToPoint_1,
- <<ThisRef:32/?UI,0:32,PX:64/float,PY:64/float>>).
+ <<ThisRef:32/?UI,0:32,PX:64/?F,PY:64/?F>>).
-%% @spec (This::wxGraphicsPath(), X::float(), Y::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathaddlinetopoint">external documentation</a>.
+-spec addLineToPoint(This, X, Y) -> ok when
+ This::wxGraphicsPath(), X::number(), Y::number().
addLineToPoint(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
- when is_float(X),is_float(Y) ->
+ when is_number(X),is_number(Y) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_AddLineToPoint_2,
<<ThisRef:32/?UI,0:32,X:64/?F,Y:64/?F>>).
-%% @spec (This::wxGraphicsPath(), Path::wxGraphicsPath()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathaddpath">external documentation</a>.
+-spec addPath(This, Path) -> ok when
+ This::wxGraphicsPath(), Path::wxGraphicsPath().
addPath(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PathT,ref=PathRef}) ->
?CLASS(ThisT,wxGraphicsPath),
?CLASS(PathT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_AddPath,
<<ThisRef:32/?UI,PathRef:32/?UI>>).
-%% @spec (This::wxGraphicsPath(), Cx::float(), Cy::float(), X::float(), Y::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathaddquadcurvetopoint">external documentation</a>.
+-spec addQuadCurveToPoint(This, Cx, Cy, X, Y) -> ok when
+ This::wxGraphicsPath(), Cx::number(), Cy::number(), X::number(), Y::number().
addQuadCurveToPoint(#wx_ref{type=ThisT,ref=ThisRef},Cx,Cy,X,Y)
- when is_float(Cx),is_float(Cy),is_float(X),is_float(Y) ->
+ when is_number(Cx),is_number(Cy),is_number(X),is_number(Y) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_AddQuadCurveToPoint,
<<ThisRef:32/?UI,0:32,Cx:64/?F,Cy:64/?F,X:64/?F,Y:64/?F>>).
-%% @spec (This::wxGraphicsPath(), X::float(), Y::float(), W::float(), H::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathaddrectangle">external documentation</a>.
+-spec addRectangle(This, X, Y, W, H) -> ok when
+ This::wxGraphicsPath(), X::number(), Y::number(), W::number(), H::number().
addRectangle(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H)
- when is_float(X),is_float(Y),is_float(W),is_float(H) ->
+ when is_number(X),is_number(Y),is_number(W),is_number(H) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_AddRectangle,
<<ThisRef:32/?UI,0:32,X:64/?F,Y:64/?F,W:64/?F,H:64/?F>>).
-%% @spec (This::wxGraphicsPath(), X::float(), Y::float(), W::float(), H::float(), Radius::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathaddroundedrectangle">external documentation</a>.
+-spec addRoundedRectangle(This, X, Y, W, H, Radius) -> ok when
+ This::wxGraphicsPath(), X::number(), Y::number(), W::number(), H::number(), Radius::number().
addRoundedRectangle(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H,Radius)
- when is_float(X),is_float(Y),is_float(W),is_float(H),is_float(Radius) ->
+ when is_number(X),is_number(Y),is_number(W),is_number(H),is_number(Radius) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_AddRoundedRectangle,
<<ThisRef:32/?UI,0:32,X:64/?F,Y:64/?F,W:64/?F,H:64/?F,Radius:64/?F>>).
-%% @spec (This::wxGraphicsPath()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathclosesubpath">external documentation</a>.
+-spec closeSubpath(This) -> ok when
+ This::wxGraphicsPath().
closeSubpath(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:cast(?wxGraphicsPath_CloseSubpath,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGraphicsPath(), C::{X::float(), Y::float()}) -> bool()
%% @equiv contains(This,C, [])
+-spec contains(This, C) -> boolean() when
+ This::wxGraphicsPath(), C::{X::float(), Y::float()}.
+
contains(This,C={CX,CY})
when is_record(This, wx_ref),is_number(CX),is_number(CY) ->
contains(This,C, []).
-%% @spec (This::wxGraphicsPath(),X::float()|term(),X::float()|term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathcontains">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% contains(This::wxGraphicsPath(), X::float(), Y::float()) -> contains(This,X,Y, []) </c></p>
-%% <p><c>
-%% contains(This::wxGraphicsPath(), C::{X::float(), Y::float()}, [Option]) -> bool() </c>
-%%<br /> Option = {fillStyle, integer()}
-%% </p>
+%% <br /> Also:<br />
+%% contains(This, C, [Option]) -> boolean() when<br />
+%% This::wxGraphicsPath(), C::{X::float(), Y::float()},<br />
+%% Option :: {fillStyle, integer()}.<br />
+%%
+-spec contains(This, X, Y) -> boolean() when
+ This::wxGraphicsPath(), X::number(), Y::number();
+ (This, C, [Option]) -> boolean() when
+ This::wxGraphicsPath(), C::{X::float(), Y::float()},
+ Option :: {fillStyle, integer()}.
contains(This,X,Y)
- when is_record(This, wx_ref),is_float(X),is_float(Y) ->
+ when is_record(This, wx_ref),is_number(X),is_number(Y) ->
contains(This,X,Y, []);
contains(#wx_ref{type=ThisT,ref=ThisRef},{CX,CY}, Options)
when is_number(CX),is_number(CY),is_list(Options) ->
@@ -193,13 +215,14 @@ contains(#wx_ref{type=ThisT,ref=ThisRef},{CX,CY}, Options)
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxGraphicsPath_Contains_2,
- <<ThisRef:32/?UI,0:32,CX:64/float,CY:64/float, BinOpt/binary>>).
+ <<ThisRef:32/?UI,0:32,CX:64/?F,CY:64/?F, BinOpt/binary>>).
-%% @spec (This::wxGraphicsPath(), X::float(), Y::float(), [Option]) -> bool()
-%% Option = {fillStyle, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathcontains">external documentation</a>.
+-spec contains(This, X, Y, [Option]) -> boolean() when
+ This::wxGraphicsPath(), X::number(), Y::number(),
+ Option :: {fillStyle, integer()}.
contains(#wx_ref{type=ThisT,ref=ThisRef},X,Y, Options)
- when is_float(X),is_float(Y),is_list(Options) ->
+ when is_number(X),is_number(Y),is_list(Options) ->
?CLASS(ThisT,wxGraphicsPath),
MOpts = fun({fillStyle, FillStyle}, Acc) -> [<<1:32/?UI,FillStyle:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
@@ -207,22 +230,25 @@ contains(#wx_ref{type=ThisT,ref=ThisRef},X,Y, Options)
wxe_util:call(?wxGraphicsPath_Contains_3,
<<ThisRef:32/?UI,0:32,X:64/?F,Y:64/?F, BinOpt/binary>>).
-%% @spec (This::wxGraphicsPath()) -> {X::float(), Y::float(), W::float(), H::float()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathgetbox">external documentation</a>.
+-spec getBox(This) -> {X::float(), Y::float(), W::float(), H::float()} when
+ This::wxGraphicsPath().
getBox(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:call(?wxGraphicsPath_GetBox,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGraphicsPath()) -> {X::float(), Y::float()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathgetcurrentpoint">external documentation</a>.
+-spec getCurrentPoint(This) -> {X::float(), Y::float()} when
+ This::wxGraphicsPath().
getCurrentPoint(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGraphicsPath),
wxe_util:call(?wxGraphicsPath_GetCurrentPoint,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGraphicsPath(), Matrix::wxGraphicsMatrix:wxGraphicsMatrix()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicspath.html#wxgraphicspathtransform">external documentation</a>.
+-spec transform(This, Matrix) -> ok when
+ This::wxGraphicsPath(), Matrix::wxGraphicsMatrix:wxGraphicsMatrix().
transform(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MatrixT,ref=MatrixRef}) ->
?CLASS(ThisT,wxGraphicsPath),
?CLASS(MatrixT,wxGraphicsMatrix),
diff --git a/lib/wx/src/gen/wxGraphicsPen.erl b/lib/wx/src/gen/wxGraphicsPen.erl
index 395b05f8af..76a59e6e2c 100644
--- a/lib/wx/src/gen/wxGraphicsPen.erl
+++ b/lib/wx/src/gen/wxGraphicsPen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -32,10 +32,12 @@
%% inherited exports
-export([getRenderer/1,isNull/1,parent_class/1]).
+-export_type([wxGraphicsPen/0]).
%% @hidden
parent_class(wxGraphicsObject) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxGraphicsPen() :: wx:wx_object().
%% From wxGraphicsObject
%% @hidden
isNull(This) -> wxGraphicsObject:isNull(This).
diff --git a/lib/wx/src/gen/wxGraphicsRenderer.erl b/lib/wx/src/gen/wxGraphicsRenderer.erl
index ed53ebf468..21082bde23 100644
--- a/lib/wx/src/gen/wxGraphicsRenderer.erl
+++ b/lib/wx/src/gen/wxGraphicsRenderer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -31,17 +31,20 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxGraphicsRenderer/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxGraphicsRenderer()
+-type wxGraphicsRenderer() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsrenderer.html#wxgraphicsrenderergetdefaultrenderer">external documentation</a>.
+-spec getDefaultRenderer() -> wxGraphicsRenderer().
getDefaultRenderer() ->
wxe_util:call(?wxGraphicsRenderer_GetDefaultRenderer,
<<>>).
-%% @spec (This::wxGraphicsRenderer(), Dc::wxWindowDC:wxWindowDC() | wxWindow:wxWindow()) -> wxGraphicsContext:wxGraphicsContext()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsrenderer.html#wxgraphicsrenderercreatecontext">external documentation</a>.
+-spec createContext(This, Dc) -> wxGraphicsContext:wxGraphicsContext() when
+ This::wxGraphicsRenderer(), Dc::wxWindowDC:wxWindowDC() | wxWindow:wxWindow().
createContext(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DcT,ref=DcRef}) ->
?CLASS(ThisT,wxGraphicsRenderer),
DcOP = case ?CLASS_T(DcT,wxWindowDC) of
@@ -53,47 +56,54 @@ createContext(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DcT,ref=DcRef}) ->
wxe_util:call(DcOP,
<<ThisRef:32/?UI,DcRef:32/?UI>>).
-%% @spec (This::wxGraphicsRenderer(), Pen::wxPen:wxPen()) -> wxGraphicsPen:wxGraphicsPen()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsrenderer.html#wxgraphicsrenderercreatepen">external documentation</a>.
+-spec createPen(This, Pen) -> wxGraphicsPen:wxGraphicsPen() when
+ This::wxGraphicsRenderer(), Pen::wxPen:wxPen().
createPen(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PenT,ref=PenRef}) ->
?CLASS(ThisT,wxGraphicsRenderer),
?CLASS(PenT,wxPen),
wxe_util:call(?wxGraphicsRenderer_CreatePen,
<<ThisRef:32/?UI,PenRef:32/?UI>>).
-%% @spec (This::wxGraphicsRenderer(), Brush::wxBrush:wxBrush()) -> wxGraphicsBrush:wxGraphicsBrush()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsrenderer.html#wxgraphicsrenderercreatebrush">external documentation</a>.
+-spec createBrush(This, Brush) -> wxGraphicsBrush:wxGraphicsBrush() when
+ This::wxGraphicsRenderer(), Brush::wxBrush:wxBrush().
createBrush(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BrushT,ref=BrushRef}) ->
?CLASS(ThisT,wxGraphicsRenderer),
?CLASS(BrushT,wxBrush),
wxe_util:call(?wxGraphicsRenderer_CreateBrush,
<<ThisRef:32/?UI,BrushRef:32/?UI>>).
-%% @spec (This::wxGraphicsRenderer(), X1::float(), Y1::float(), X2::float(), Y2::float(), C1::wx:colour(), C2::wx:colour()) -> wxGraphicsBrush:wxGraphicsBrush()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsrenderer.html#wxgraphicsrenderercreatelineargradientbrush">external documentation</a>.
+-spec createLinearGradientBrush(This, X1, Y1, X2, Y2, C1, C2) -> wxGraphicsBrush:wxGraphicsBrush() when
+ This::wxGraphicsRenderer(), X1::number(), Y1::number(), X2::number(), Y2::number(), C1::wx:wx_colour(), C2::wx:wx_colour().
createLinearGradientBrush(#wx_ref{type=ThisT,ref=ThisRef},X1,Y1,X2,Y2,C1,C2)
- when is_float(X1),is_float(Y1),is_float(X2),is_float(Y2),tuple_size(C1) =:= 3; tuple_size(C1) =:= 4,tuple_size(C2) =:= 3; tuple_size(C2) =:= 4 ->
+ when is_number(X1),is_number(Y1),is_number(X2),is_number(Y2),tuple_size(C1) =:= 3; tuple_size(C1) =:= 4,tuple_size(C2) =:= 3; tuple_size(C2) =:= 4 ->
?CLASS(ThisT,wxGraphicsRenderer),
wxe_util:call(?wxGraphicsRenderer_CreateLinearGradientBrush,
<<ThisRef:32/?UI,0:32,X1:64/?F,Y1:64/?F,X2:64/?F,Y2:64/?F,(wxe_util:colour_bin(C1)):16/binary,(wxe_util:colour_bin(C2)):16/binary>>).
-%% @spec (This::wxGraphicsRenderer(), Xo::float(), Yo::float(), Xc::float(), Yc::float(), Radius::float(), OColor::wx:colour(), CColor::wx:colour()) -> wxGraphicsBrush:wxGraphicsBrush()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsrenderer.html#wxgraphicsrenderercreateradialgradientbrush">external documentation</a>.
+-spec createRadialGradientBrush(This, Xo, Yo, Xc, Yc, Radius, OColor, CColor) -> wxGraphicsBrush:wxGraphicsBrush() when
+ This::wxGraphicsRenderer(), Xo::number(), Yo::number(), Xc::number(), Yc::number(), Radius::number(), OColor::wx:wx_colour(), CColor::wx:wx_colour().
createRadialGradientBrush(#wx_ref{type=ThisT,ref=ThisRef},Xo,Yo,Xc,Yc,Radius,OColor,CColor)
- when is_float(Xo),is_float(Yo),is_float(Xc),is_float(Yc),is_float(Radius),tuple_size(OColor) =:= 3; tuple_size(OColor) =:= 4,tuple_size(CColor) =:= 3; tuple_size(CColor) =:= 4 ->
+ when is_number(Xo),is_number(Yo),is_number(Xc),is_number(Yc),is_number(Radius),tuple_size(OColor) =:= 3; tuple_size(OColor) =:= 4,tuple_size(CColor) =:= 3; tuple_size(CColor) =:= 4 ->
?CLASS(ThisT,wxGraphicsRenderer),
wxe_util:call(?wxGraphicsRenderer_CreateRadialGradientBrush,
<<ThisRef:32/?UI,0:32,Xo:64/?F,Yo:64/?F,Xc:64/?F,Yc:64/?F,Radius:64/?F,(wxe_util:colour_bin(OColor)):16/binary,(wxe_util:colour_bin(CColor)):16/binary>>).
-%% @spec (This::wxGraphicsRenderer(), Font::wxFont:wxFont()) -> wxGraphicsFont:wxGraphicsFont()
%% @equiv createFont(This,Font, [])
+-spec createFont(This, Font) -> wxGraphicsFont:wxGraphicsFont() when
+ This::wxGraphicsRenderer(), Font::wxFont:wxFont().
+
createFont(This,Font)
when is_record(This, wx_ref),is_record(Font, wx_ref) ->
createFont(This,Font, []).
-%% @spec (This::wxGraphicsRenderer(), Font::wxFont:wxFont(), [Option]) -> wxGraphicsFont:wxGraphicsFont()
-%% Option = {col, wx:colour()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsrenderer.html#wxgraphicsrenderercreatefont">external documentation</a>.
+-spec createFont(This, Font, [Option]) -> wxGraphicsFont:wxGraphicsFont() when
+ This::wxGraphicsRenderer(), Font::wxFont:wxFont(),
+ Option :: {col, wx:wx_colour()}.
createFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGraphicsRenderer),
@@ -104,15 +114,23 @@ createFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}, Opti
wxe_util:call(?wxGraphicsRenderer_CreateFont,
<<ThisRef:32/?UI,FontRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGraphicsRenderer()) -> wxGraphicsMatrix:wxGraphicsMatrix()
%% @equiv createMatrix(This, [])
+-spec createMatrix(This) -> wxGraphicsMatrix:wxGraphicsMatrix() when
+ This::wxGraphicsRenderer().
+
createMatrix(This)
when is_record(This, wx_ref) ->
createMatrix(This, []).
-%% @spec (This::wxGraphicsRenderer(), [Option]) -> wxGraphicsMatrix:wxGraphicsMatrix()
-%% Option = {a, float()} | {b, float()} | {c, float()} | {d, float()} | {tx, float()} | {ty, float()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsrenderer.html#wxgraphicsrenderercreatematrix">external documentation</a>.
+-spec createMatrix(This, [Option]) -> wxGraphicsMatrix:wxGraphicsMatrix() when
+ This::wxGraphicsRenderer(),
+ Option :: {a, number()}
+ | {b, number()}
+ | {c, number()}
+ | {d, number()}
+ | {tx, number()}
+ | {ty, number()}.
createMatrix(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGraphicsRenderer),
@@ -127,8 +145,9 @@ createMatrix(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxGraphicsRenderer_CreateMatrix,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGraphicsRenderer()) -> wxGraphicsPath:wxGraphicsPath()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgraphicsrenderer.html#wxgraphicsrenderercreatepath">external documentation</a>.
+-spec createPath(This) -> wxGraphicsPath:wxGraphicsPath() when
+ This::wxGraphicsRenderer().
createPath(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGraphicsRenderer),
wxe_util:call(?wxGraphicsRenderer_CreatePath,
diff --git a/lib/wx/src/gen/wxGrid.erl b/lib/wx/src/gen/wxGrid.erl
index 531fed05c1..2f4b45b1bc 100644
--- a/lib/wx/src/gen/wxGrid.erl
+++ b/lib/wx/src/gen/wxGrid.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -125,6 +125,7 @@
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
validate/1,warpPointer/3]).
+-export_type([wxGrid/0]).
%% @hidden
parent_class(wxScrolledWindow) -> true;
parent_class(wxPanel) -> true;
@@ -132,27 +133,36 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxGrid()
+-type wxGrid() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridwxgrid">external documentation</a>.
+-spec new() -> wxGrid().
new() ->
wxe_util:construct(?wxGrid_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxGrid()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxGrid() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(),X::integer(),X::integer()|term()) -> wxGrid()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridwxgrid">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Parent::wxWindow:wxWindow(), X::integer(), Y::integer()) -> new(Parent,X,Y, []) </c></p>
-%% <p><c>
-%% new(Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxGrid() </c>
-%%<br /> Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
-%% </p>
+%% <br /> Also:<br />
+%% new(Parent, Id, [Option]) -> wxGrid() when<br />
+%% Parent::wxWindow:wxWindow(), Id::integer(),<br />
+%% Option :: {pos, {X::integer(), Y::integer()}}<br />
+%% | {size, {W::integer(), H::integer()}}<br />
+%% | {style, integer()}.<br />
+%%
+-spec new(Parent, X, Y) -> wxGrid() when
+ Parent::wxWindow:wxWindow(), X::integer(), Y::integer();
+ (Parent, Id, [Option]) -> wxGrid() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(Parent,X,Y)
when is_record(Parent, wx_ref),is_integer(X),is_integer(Y) ->
@@ -168,9 +178,12 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxGrid_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (Parent::wxWindow:wxWindow(), X::integer(), Y::integer(), [Option]) -> wxGrid()
-%% Option = {w, integer()} | {h, integer()} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridwxgrid">external documentation</a>.
+-spec new(Parent, X, Y, [Option]) -> wxGrid() when
+ Parent::wxWindow:wxWindow(), X::integer(), Y::integer(),
+ Option :: {w, integer()}
+ | {h, integer()}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},X,Y, Options)
when is_integer(X),is_integer(Y),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -182,15 +195,19 @@ new(#wx_ref{type=ParentT,ref=ParentRef},X,Y, Options)
wxe_util:construct(?wxGrid_new_4,
<<ParentRef:32/?UI,X:32/?UI,Y:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid()) -> bool()
%% @equiv appendCols(This, [])
+-spec appendCols(This) -> boolean() when
+ This::wxGrid().
+
appendCols(This)
when is_record(This, wx_ref) ->
appendCols(This, []).
-%% @spec (This::wxGrid(), [Option]) -> bool()
-%% Option = {numCols, integer()} | {updateLabels, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridappendcols">external documentation</a>.
+-spec appendCols(This, [Option]) -> boolean() when
+ This::wxGrid(),
+ Option :: {numCols, integer()}
+ | {updateLabels, boolean()}.
appendCols(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -201,15 +218,19 @@ appendCols(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxGrid_AppendCols,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid()) -> bool()
%% @equiv appendRows(This, [])
+-spec appendRows(This) -> boolean() when
+ This::wxGrid().
+
appendRows(This)
when is_record(This, wx_ref) ->
appendRows(This, []).
-%% @spec (This::wxGrid(), [Option]) -> bool()
-%% Option = {numRows, integer()} | {updateLabels, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridappendrows">external documentation</a>.
+-spec appendRows(This, [Option]) -> boolean() when
+ This::wxGrid(),
+ Option :: {numRows, integer()}
+ | {updateLabels, boolean()}.
appendRows(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -220,22 +241,26 @@ appendRows(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxGrid_AppendRows,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridautosize">external documentation</a>.
+-spec autoSize(This) -> ok when
+ This::wxGrid().
autoSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_AutoSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid(), Col::integer()) -> ok
%% @equiv autoSizeColumn(This,Col, [])
+-spec autoSizeColumn(This, Col) -> ok when
+ This::wxGrid(), Col::integer().
+
autoSizeColumn(This,Col)
when is_record(This, wx_ref),is_integer(Col) ->
autoSizeColumn(This,Col, []).
-%% @spec (This::wxGrid(), Col::integer(), [Option]) -> ok
-%% Option = {setAsMin, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridautosizecolumn">external documentation</a>.
+-spec autoSizeColumn(This, Col, [Option]) -> ok when
+ This::wxGrid(), Col::integer(),
+ Option :: {setAsMin, boolean()}.
autoSizeColumn(#wx_ref{type=ThisT,ref=ThisRef},Col, Options)
when is_integer(Col),is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -245,15 +270,18 @@ autoSizeColumn(#wx_ref{type=ThisT,ref=ThisRef},Col, Options)
wxe_util:cast(?wxGrid_AutoSizeColumn,
<<ThisRef:32/?UI,Col:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGrid()) -> ok
%% @equiv autoSizeColumns(This, [])
+-spec autoSizeColumns(This) -> ok when
+ This::wxGrid().
+
autoSizeColumns(This)
when is_record(This, wx_ref) ->
autoSizeColumns(This, []).
-%% @spec (This::wxGrid(), [Option]) -> ok
-%% Option = {setAsMin, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridautosizecolumns">external documentation</a>.
+-spec autoSizeColumns(This, [Option]) -> ok when
+ This::wxGrid(),
+ Option :: {setAsMin, boolean()}.
autoSizeColumns(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -263,15 +291,18 @@ autoSizeColumns(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxGrid_AutoSizeColumns,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid(), Row::integer()) -> ok
%% @equiv autoSizeRow(This,Row, [])
+-spec autoSizeRow(This, Row) -> ok when
+ This::wxGrid(), Row::integer().
+
autoSizeRow(This,Row)
when is_record(This, wx_ref),is_integer(Row) ->
autoSizeRow(This,Row, []).
-%% @spec (This::wxGrid(), Row::integer(), [Option]) -> ok
-%% Option = {setAsMin, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridautosizerow">external documentation</a>.
+-spec autoSizeRow(This, Row, [Option]) -> ok when
+ This::wxGrid(), Row::integer(),
+ Option :: {setAsMin, boolean()}.
autoSizeRow(#wx_ref{type=ThisT,ref=ThisRef},Row, Options)
when is_integer(Row),is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -281,15 +312,18 @@ autoSizeRow(#wx_ref{type=ThisT,ref=ThisRef},Row, Options)
wxe_util:cast(?wxGrid_AutoSizeRow,
<<ThisRef:32/?UI,Row:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGrid()) -> ok
%% @equiv autoSizeRows(This, [])
+-spec autoSizeRows(This) -> ok when
+ This::wxGrid().
+
autoSizeRows(This)
when is_record(This, wx_ref) ->
autoSizeRows(This, []).
-%% @spec (This::wxGrid(), [Option]) -> ok
-%% Option = {setAsMin, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridautosizerows">external documentation</a>.
+-spec autoSizeRows(This, [Option]) -> ok when
+ This::wxGrid(),
+ Option :: {setAsMin, boolean()}.
autoSizeRows(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -299,90 +333,102 @@ autoSizeRows(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxGrid_AutoSizeRows,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridbeginbatch">external documentation</a>.
+-spec beginBatch(This) -> ok when
+ This::wxGrid().
beginBatch(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_BeginBatch,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid(), TopLeft::{R::integer(), C::integer()}, BottomRight::{R::integer(), C::integer()}) -> {X::integer(), Y::integer(), W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridblocktodevicerect">external documentation</a>.
+-spec blockToDeviceRect(This, TopLeft, BottomRight) -> {X::integer(), Y::integer(), W::integer(), H::integer()} when
+ This::wxGrid(), TopLeft::{R::integer(), C::integer()}, BottomRight::{R::integer(), C::integer()}.
blockToDeviceRect(#wx_ref{type=ThisT,ref=ThisRef},{TopLeftR,TopLeftC},{BottomRightR,BottomRightC})
when is_integer(TopLeftR),is_integer(TopLeftC),is_integer(BottomRightR),is_integer(BottomRightC) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_BlockToDeviceRect,
<<ThisRef:32/?UI,TopLeftR:32/?UI,TopLeftC:32/?UI,BottomRightR:32/?UI,BottomRightC:32/?UI>>).
-%% @spec (This::wxGrid()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridcandragcolsize">external documentation</a>.
+-spec canDragColSize(This) -> boolean() when
+ This::wxGrid().
canDragColSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_CanDragColSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridcandragrowsize">external documentation</a>.
+-spec canDragRowSize(This) -> boolean() when
+ This::wxGrid().
canDragRowSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_CanDragRowSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridcandraggridsize">external documentation</a>.
+-spec canDragGridSize(This) -> boolean() when
+ This::wxGrid().
canDragGridSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_CanDragGridSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridcanenablecellcontrol">external documentation</a>.
+-spec canEnableCellControl(This) -> boolean() when
+ This::wxGrid().
canEnableCellControl(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_CanEnableCellControl,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid(), Coords::{R::integer(), C::integer()}) -> {X::integer(), Y::integer(), W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridcelltorect">external documentation</a>.
+-spec cellToRect(This, Coords) -> {X::integer(), Y::integer(), W::integer(), H::integer()} when
+ This::wxGrid(), Coords::{R::integer(), C::integer()}.
cellToRect(#wx_ref{type=ThisT,ref=ThisRef},{CoordsR,CoordsC})
when is_integer(CoordsR),is_integer(CoordsC) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_CellToRect_1,
<<ThisRef:32/?UI,CoordsR:32/?UI,CoordsC:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> {X::integer(), Y::integer(), W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridcelltorect">external documentation</a>.
+-spec cellToRect(This, Row, Col) -> {X::integer(), Y::integer(), W::integer(), H::integer()} when
+ This::wxGrid(), Row::integer(), Col::integer().
cellToRect(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_CellToRect_2,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridcleargrid">external documentation</a>.
+-spec clearGrid(This) -> ok when
+ This::wxGrid().
clearGrid(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_ClearGrid,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridclearselection">external documentation</a>.
+-spec clearSelection(This) -> ok when
+ This::wxGrid().
clearSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_ClearSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid(), NumRows::integer(), NumCols::integer()) -> bool()
%% @equiv createGrid(This,NumRows,NumCols, [])
+-spec createGrid(This, NumRows, NumCols) -> boolean() when
+ This::wxGrid(), NumRows::integer(), NumCols::integer().
+
createGrid(This,NumRows,NumCols)
when is_record(This, wx_ref),is_integer(NumRows),is_integer(NumCols) ->
createGrid(This,NumRows,NumCols, []).
-%% @spec (This::wxGrid(), NumRows::integer(), NumCols::integer(), [Option]) -> bool()
-%% Option = {selmode, WxGridSelectionModes}
-%% WxGridSelectionModes = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridcreategrid">external documentation</a>.
-%%<br /> WxGridSelectionModes is one of ?wxGrid_wxGridSelectCells | ?wxGrid_wxGridSelectRows | ?wxGrid_wxGridSelectColumns
+%%<br /> Selmode = ?wxGrid_wxGridSelectCells | ?wxGrid_wxGridSelectRows | ?wxGrid_wxGridSelectColumns
+-spec createGrid(This, NumRows, NumCols, [Option]) -> boolean() when
+ This::wxGrid(), NumRows::integer(), NumCols::integer(),
+ Option :: {selmode, wx:wx_enum()}.
createGrid(#wx_ref{type=ThisT,ref=ThisRef},NumRows,NumCols, Options)
when is_integer(NumRows),is_integer(NumCols),is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -392,15 +438,20 @@ createGrid(#wx_ref{type=ThisT,ref=ThisRef},NumRows,NumCols, Options)
wxe_util:call(?wxGrid_CreateGrid,
<<ThisRef:32/?UI,NumRows:32/?UI,NumCols:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid()) -> bool()
%% @equiv deleteCols(This, [])
+-spec deleteCols(This) -> boolean() when
+ This::wxGrid().
+
deleteCols(This)
when is_record(This, wx_ref) ->
deleteCols(This, []).
-%% @spec (This::wxGrid(), [Option]) -> bool()
-%% Option = {pos, integer()} | {numCols, integer()} | {updateLabels, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgriddeletecols">external documentation</a>.
+-spec deleteCols(This, [Option]) -> boolean() when
+ This::wxGrid(),
+ Option :: {pos, integer()}
+ | {numCols, integer()}
+ | {updateLabels, boolean()}.
deleteCols(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -412,15 +463,20 @@ deleteCols(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxGrid_DeleteCols,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid()) -> bool()
%% @equiv deleteRows(This, [])
+-spec deleteRows(This) -> boolean() when
+ This::wxGrid().
+
deleteRows(This)
when is_record(This, wx_ref) ->
deleteRows(This, []).
-%% @spec (This::wxGrid(), [Option]) -> bool()
-%% Option = {pos, integer()} | {numRows, integer()} | {updateLabels, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgriddeleterows">external documentation</a>.
+-spec deleteRows(This, [Option]) -> boolean() when
+ This::wxGrid(),
+ Option :: {pos, integer()}
+ | {numRows, integer()}
+ | {updateLabels, boolean()}.
deleteRows(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -432,43 +488,50 @@ deleteRows(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxGrid_DeleteRows,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgriddisablecelleditcontrol">external documentation</a>.
+-spec disableCellEditControl(This) -> ok when
+ This::wxGrid().
disableCellEditControl(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_DisableCellEditControl,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgriddisabledragcolsize">external documentation</a>.
+-spec disableDragColSize(This) -> ok when
+ This::wxGrid().
disableDragColSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_DisableDragColSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgriddisabledraggridsize">external documentation</a>.
+-spec disableDragGridSize(This) -> ok when
+ This::wxGrid().
disableDragGridSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_DisableDragGridSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgriddisabledragrowsize">external documentation</a>.
+-spec disableDragRowSize(This) -> ok when
+ This::wxGrid().
disableDragRowSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_DisableDragRowSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> ok
%% @equiv enableCellEditControl(This, [])
+-spec enableCellEditControl(This) -> ok when
+ This::wxGrid().
+
enableCellEditControl(This)
when is_record(This, wx_ref) ->
enableCellEditControl(This, []).
-%% @spec (This::wxGrid(), [Option]) -> ok
-%% Option = {enable, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridenablecelleditcontrol">external documentation</a>.
+-spec enableCellEditControl(This, [Option]) -> ok when
+ This::wxGrid(),
+ Option :: {enable, boolean()}.
enableCellEditControl(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -478,15 +541,18 @@ enableCellEditControl(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxGrid_EnableCellEditControl,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid()) -> ok
%% @equiv enableDragColSize(This, [])
+-spec enableDragColSize(This) -> ok when
+ This::wxGrid().
+
enableDragColSize(This)
when is_record(This, wx_ref) ->
enableDragColSize(This, []).
-%% @spec (This::wxGrid(), [Option]) -> ok
-%% Option = {enable, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridenabledragcolsize">external documentation</a>.
+-spec enableDragColSize(This, [Option]) -> ok when
+ This::wxGrid(),
+ Option :: {enable, boolean()}.
enableDragColSize(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -496,15 +562,18 @@ enableDragColSize(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxGrid_EnableDragColSize,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid()) -> ok
%% @equiv enableDragGridSize(This, [])
+-spec enableDragGridSize(This) -> ok when
+ This::wxGrid().
+
enableDragGridSize(This)
when is_record(This, wx_ref) ->
enableDragGridSize(This, []).
-%% @spec (This::wxGrid(), [Option]) -> ok
-%% Option = {enable, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridenabledraggridsize">external documentation</a>.
+-spec enableDragGridSize(This, [Option]) -> ok when
+ This::wxGrid(),
+ Option :: {enable, boolean()}.
enableDragGridSize(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -514,15 +583,18 @@ enableDragGridSize(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxGrid_EnableDragGridSize,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid()) -> ok
%% @equiv enableDragRowSize(This, [])
+-spec enableDragRowSize(This) -> ok when
+ This::wxGrid().
+
enableDragRowSize(This)
when is_record(This, wx_ref) ->
enableDragRowSize(This, []).
-%% @spec (This::wxGrid(), [Option]) -> ok
-%% Option = {enable, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridenabledragrowsize">external documentation</a>.
+-spec enableDragRowSize(This, [Option]) -> ok when
+ This::wxGrid(),
+ Option :: {enable, boolean()}.
enableDragRowSize(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -532,23 +604,27 @@ enableDragRowSize(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxGrid_EnableDragRowSize,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid(), Edit::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridenableediting">external documentation</a>.
+-spec enableEditing(This, Edit) -> ok when
+ This::wxGrid(), Edit::boolean().
enableEditing(#wx_ref{type=ThisT,ref=ThisRef},Edit)
when is_boolean(Edit) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_EnableEditing,
<<ThisRef:32/?UI,(wxe_util:from_bool(Edit)):32/?UI>>).
-%% @spec (This::wxGrid()) -> ok
%% @equiv enableGridLines(This, [])
+-spec enableGridLines(This) -> ok when
+ This::wxGrid().
+
enableGridLines(This)
when is_record(This, wx_ref) ->
enableGridLines(This, []).
-%% @spec (This::wxGrid(), [Option]) -> ok
-%% Option = {enable, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridenablegridlines">external documentation</a>.
+-spec enableGridLines(This, [Option]) -> ok when
+ This::wxGrid(),
+ Option :: {enable, boolean()}.
enableGridLines(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -558,194 +634,220 @@ enableGridLines(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxGrid_EnableGridLines,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridendbatch">external documentation</a>.
+-spec endBatch(This) -> ok when
+ This::wxGrid().
endBatch(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_EndBatch,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridfit">external documentation</a>.
+-spec fit(This) -> ok when
+ This::wxGrid().
fit(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_Fit,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridforcerefresh">external documentation</a>.
+-spec forceRefresh(This) -> ok when
+ This::wxGrid().
forceRefresh(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_ForceRefresh,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetbatchcount">external documentation</a>.
+-spec getBatchCount(This) -> integer() when
+ This::wxGrid().
getBatchCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetBatchCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> {Horiz::integer(), Vert::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetcellalignment">external documentation</a>.
+-spec getCellAlignment(This, Row, Col) -> {Horiz::integer(), Vert::integer()} when
+ This::wxGrid(), Row::integer(), Col::integer().
getCellAlignment(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetCellAlignment,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetcellbackgroundcolour">external documentation</a>.
+-spec getCellBackgroundColour(This, Row, Col) -> wx:wx_colour4() when
+ This::wxGrid(), Row::integer(), Col::integer().
getCellBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetCellBackgroundColour,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> wxGridCellEditor:wxGridCellEditor()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetcelleditor">external documentation</a>.
+-spec getCellEditor(This, Row, Col) -> wxGridCellEditor:wxGridCellEditor() when
+ This::wxGrid(), Row::integer(), Col::integer().
getCellEditor(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetCellEditor,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> wxFont:wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetcellfont">external documentation</a>.
+-spec getCellFont(This, Row, Col) -> wxFont:wxFont() when
+ This::wxGrid(), Row::integer(), Col::integer().
getCellFont(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetCellFont,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> wxGridCellRenderer:wxGridCellRenderer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetcellrenderer">external documentation</a>.
+-spec getCellRenderer(This, Row, Col) -> wxGridCellRenderer:wxGridCellRenderer() when
+ This::wxGrid(), Row::integer(), Col::integer().
getCellRenderer(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetCellRenderer,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetcelltextcolour">external documentation</a>.
+-spec getCellTextColour(This, Row, Col) -> wx:wx_colour4() when
+ This::wxGrid(), Row::integer(), Col::integer().
getCellTextColour(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetCellTextColour,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), Coords::{R::integer(), C::integer()}) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetcellvalue">external documentation</a>.
+-spec getCellValue(This, Coords) -> unicode:charlist() when
+ This::wxGrid(), Coords::{R::integer(), C::integer()}.
getCellValue(#wx_ref{type=ThisT,ref=ThisRef},{CoordsR,CoordsC})
when is_integer(CoordsR),is_integer(CoordsC) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetCellValue_1,
<<ThisRef:32/?UI,CoordsR:32/?UI,CoordsC:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetcellvalue">external documentation</a>.
+-spec getCellValue(This, Row, Col) -> unicode:charlist() when
+ This::wxGrid(), Row::integer(), Col::integer().
getCellValue(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetCellValue_2,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid()) -> {Horiz::integer(), Vert::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetcollabelalignment">external documentation</a>.
+-spec getColLabelAlignment(This) -> {Horiz::integer(), Vert::integer()} when
+ This::wxGrid().
getColLabelAlignment(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetColLabelAlignment,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetcollabelsize">external documentation</a>.
+-spec getColLabelSize(This) -> integer() when
+ This::wxGrid().
getColLabelSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetColLabelSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid(), Col::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetcollabelvalue">external documentation</a>.
+-spec getColLabelValue(This, Col) -> unicode:charlist() when
+ This::wxGrid(), Col::integer().
getColLabelValue(#wx_ref{type=ThisT,ref=ThisRef},Col)
when is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetColLabelValue,
<<ThisRef:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetcolminimalacceptablewidth">external documentation</a>.
+-spec getColMinimalAcceptableWidth(This) -> integer() when
+ This::wxGrid().
getColMinimalAcceptableWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetColMinimalAcceptableWidth,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> {Horiz::integer(), Vert::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetdefaultcellalignment">external documentation</a>.
+-spec getDefaultCellAlignment(This) -> {Horiz::integer(), Vert::integer()} when
+ This::wxGrid().
getDefaultCellAlignment(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetDefaultCellAlignment,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetdefaultcellbackgroundcolour">external documentation</a>.
+-spec getDefaultCellBackgroundColour(This) -> wx:wx_colour4() when
+ This::wxGrid().
getDefaultCellBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetDefaultCellBackgroundColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> wxFont:wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetdefaultcellfont">external documentation</a>.
+-spec getDefaultCellFont(This) -> wxFont:wxFont() when
+ This::wxGrid().
getDefaultCellFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetDefaultCellFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetdefaultcelltextcolour">external documentation</a>.
+-spec getDefaultCellTextColour(This) -> wx:wx_colour4() when
+ This::wxGrid().
getDefaultCellTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetDefaultCellTextColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetdefaultcollabelsize">external documentation</a>.
+-spec getDefaultColLabelSize(This) -> integer() when
+ This::wxGrid().
getDefaultColLabelSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetDefaultColLabelSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetdefaultcolsize">external documentation</a>.
+-spec getDefaultColSize(This) -> integer() when
+ This::wxGrid().
getDefaultColSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetDefaultColSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> wxGridCellEditor:wxGridCellEditor()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetdefaulteditor">external documentation</a>.
+-spec getDefaultEditor(This) -> wxGridCellEditor:wxGridCellEditor() when
+ This::wxGrid().
getDefaultEditor(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetDefaultEditor,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid(), C::{R::integer(), C::integer()}) -> wxGridCellEditor:wxGridCellEditor()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetdefaulteditorforcell">external documentation</a>.
+-spec getDefaultEditorForCell(This, C) -> wxGridCellEditor:wxGridCellEditor() when
+ This::wxGrid(), C::{R::integer(), C::integer()}.
getDefaultEditorForCell(#wx_ref{type=ThisT,ref=ThisRef},{CR,CC})
when is_integer(CR),is_integer(CC) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetDefaultEditorForCell_1,
<<ThisRef:32/?UI,CR:32/?UI,CC:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> wxGridCellEditor:wxGridCellEditor()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetdefaulteditorforcell">external documentation</a>.
+-spec getDefaultEditorForCell(This, Row, Col) -> wxGridCellEditor:wxGridCellEditor() when
+ This::wxGrid(), Row::integer(), Col::integer().
getDefaultEditorForCell(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetDefaultEditorForCell_2,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), TypeName::string()) -> wxGridCellEditor:wxGridCellEditor()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetdefaulteditorfortype">external documentation</a>.
+-spec getDefaultEditorForType(This, TypeName) -> wxGridCellEditor:wxGridCellEditor() when
+ This::wxGrid(), TypeName::unicode:chardata().
getDefaultEditorForType(#wx_ref{type=ThisT,ref=ThisRef},TypeName)
when is_list(TypeName) ->
?CLASS(ThisT,wxGrid),
@@ -753,23 +855,26 @@ getDefaultEditorForType(#wx_ref{type=ThisT,ref=ThisRef},TypeName)
wxe_util:call(?wxGrid_GetDefaultEditorForType,
<<ThisRef:32/?UI,(byte_size(TypeName_UC)):32/?UI,(TypeName_UC)/binary, 0:(((8- ((0+byte_size(TypeName_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGrid()) -> wxGridCellRenderer:wxGridCellRenderer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetdefaultrenderer">external documentation</a>.
+-spec getDefaultRenderer(This) -> wxGridCellRenderer:wxGridCellRenderer() when
+ This::wxGrid().
getDefaultRenderer(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetDefaultRenderer,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> wxGridCellRenderer:wxGridCellRenderer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetdefaultrendererforcell">external documentation</a>.
+-spec getDefaultRendererForCell(This, Row, Col) -> wxGridCellRenderer:wxGridCellRenderer() when
+ This::wxGrid(), Row::integer(), Col::integer().
getDefaultRendererForCell(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetDefaultRendererForCell,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), TypeName::string()) -> wxGridCellRenderer:wxGridCellRenderer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetdefaultrendererfortype">external documentation</a>.
+-spec getDefaultRendererForType(This, TypeName) -> wxGridCellRenderer:wxGridCellRenderer() when
+ This::wxGrid(), TypeName::unicode:chardata().
getDefaultRendererForType(#wx_ref{type=ThisT,ref=ThisRef},TypeName)
when is_list(TypeName) ->
?CLASS(ThisT,wxGrid),
@@ -777,242 +882,279 @@ getDefaultRendererForType(#wx_ref{type=ThisT,ref=ThisRef},TypeName)
wxe_util:call(?wxGrid_GetDefaultRendererForType,
<<ThisRef:32/?UI,(byte_size(TypeName_UC)):32/?UI,(TypeName_UC)/binary, 0:(((8- ((0+byte_size(TypeName_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetdefaultrowlabelsize">external documentation</a>.
+-spec getDefaultRowLabelSize(This) -> integer() when
+ This::wxGrid().
getDefaultRowLabelSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetDefaultRowLabelSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetdefaultrowsize">external documentation</a>.
+-spec getDefaultRowSize(This) -> integer() when
+ This::wxGrid().
getDefaultRowSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetDefaultRowSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetgridcursorcol">external documentation</a>.
+-spec getGridCursorCol(This) -> integer() when
+ This::wxGrid().
getGridCursorCol(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetGridCursorCol,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetgridcursorrow">external documentation</a>.
+-spec getGridCursorRow(This) -> integer() when
+ This::wxGrid().
getGridCursorRow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetGridCursorRow,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetgridlinecolour">external documentation</a>.
+-spec getGridLineColour(This) -> wx:wx_colour4() when
+ This::wxGrid().
getGridLineColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetGridLineColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgridlinesenabled">external documentation</a>.
+-spec gridLinesEnabled(This) -> boolean() when
+ This::wxGrid().
gridLinesEnabled(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GridLinesEnabled,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetlabelbackgroundcolour">external documentation</a>.
+-spec getLabelBackgroundColour(This) -> wx:wx_colour4() when
+ This::wxGrid().
getLabelBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetLabelBackgroundColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> wxFont:wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetlabelfont">external documentation</a>.
+-spec getLabelFont(This) -> wxFont:wxFont() when
+ This::wxGrid().
getLabelFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetLabelFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetlabeltextcolour">external documentation</a>.
+-spec getLabelTextColour(This) -> wx:wx_colour4() when
+ This::wxGrid().
getLabelTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetLabelTextColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetnumbercols">external documentation</a>.
+-spec getNumberCols(This) -> integer() when
+ This::wxGrid().
getNumberCols(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetNumberCols,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetnumberrows">external documentation</a>.
+-spec getNumberRows(This) -> integer() when
+ This::wxGrid().
getNumberRows(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetNumberRows,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> wxGridCellAttr:wxGridCellAttr()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetorcreatecellattr">external documentation</a>.
+-spec getOrCreateCellAttr(This, Row, Col) -> wxGridCellAttr:wxGridCellAttr() when
+ This::wxGrid(), Row::integer(), Col::integer().
getOrCreateCellAttr(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetOrCreateCellAttr,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetrowminimalacceptableheight">external documentation</a>.
+-spec getRowMinimalAcceptableHeight(This) -> integer() when
+ This::wxGrid().
getRowMinimalAcceptableHeight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetRowMinimalAcceptableHeight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> {Horiz::integer(), Vert::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetrowlabelalignment">external documentation</a>.
+-spec getRowLabelAlignment(This) -> {Horiz::integer(), Vert::integer()} when
+ This::wxGrid().
getRowLabelAlignment(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetRowLabelAlignment,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetrowlabelsize">external documentation</a>.
+-spec getRowLabelSize(This) -> integer() when
+ This::wxGrid().
getRowLabelSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetRowLabelSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetrowlabelvalue">external documentation</a>.
+-spec getRowLabelValue(This, Row) -> unicode:charlist() when
+ This::wxGrid(), Row::integer().
getRowLabelValue(#wx_ref{type=ThisT,ref=ThisRef},Row)
when is_integer(Row) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetRowLabelValue,
<<ThisRef:32/?UI,Row:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetrowsize">external documentation</a>.
+-spec getRowSize(This, Row) -> integer() when
+ This::wxGrid(), Row::integer().
getRowSize(#wx_ref{type=ThisT,ref=ThisRef},Row)
when is_integer(Row) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetRowSize,
<<ThisRef:32/?UI,Row:32/?UI>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetscrolllinex">external documentation</a>.
+-spec getScrollLineX(This) -> integer() when
+ This::wxGrid().
getScrollLineX(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetScrollLineX,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetscrollliney">external documentation</a>.
+-spec getScrollLineY(This) -> integer() when
+ This::wxGrid().
getScrollLineY(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetScrollLineY,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> [{R::integer(), C::integer()}]
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetselectedcells">external documentation</a>.
+-spec getSelectedCells(This) -> [{R::integer(), C::integer()}] when
+ This::wxGrid().
getSelectedCells(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetSelectedCells,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> [integer()]
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetselectedcols">external documentation</a>.
+-spec getSelectedCols(This) -> [integer()] when
+ This::wxGrid().
getSelectedCols(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetSelectedCols,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> [integer()]
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetselectedrows">external documentation</a>.
+-spec getSelectedRows(This) -> [integer()] when
+ This::wxGrid().
getSelectedRows(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetSelectedRows,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetselectionbackground">external documentation</a>.
+-spec getSelectionBackground(This) -> wx:wx_colour4() when
+ This::wxGrid().
getSelectionBackground(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetSelectionBackground,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> [{R::integer(), C::integer()}]
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetselectionblocktopleft">external documentation</a>.
+-spec getSelectionBlockTopLeft(This) -> [{R::integer(), C::integer()}] when
+ This::wxGrid().
getSelectionBlockTopLeft(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetSelectionBlockTopLeft,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> [{R::integer(), C::integer()}]
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetselectionblockbottomright">external documentation</a>.
+-spec getSelectionBlockBottomRight(This) -> [{R::integer(), C::integer()}] when
+ This::wxGrid().
getSelectionBlockBottomRight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetSelectionBlockBottomRight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetselectionforeground">external documentation</a>.
+-spec getSelectionForeground(This) -> wx:wx_colour4() when
+ This::wxGrid().
getSelectionForeground(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetSelectionForeground,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetviewwidth">external documentation</a>.
+-spec getViewWidth(This) -> integer() when
+ This::wxGrid().
getViewWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetViewWidth,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetgridwindow">external documentation</a>.
+-spec getGridWindow(This) -> wxWindow:wxWindow() when
+ This::wxGrid().
getGridWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetGridWindow,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetgridrowlabelwindow">external documentation</a>.
+-spec getGridRowLabelWindow(This) -> wxWindow:wxWindow() when
+ This::wxGrid().
getGridRowLabelWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetGridRowLabelWindow,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetgridcollabelwindow">external documentation</a>.
+-spec getGridColLabelWindow(This) -> wxWindow:wxWindow() when
+ This::wxGrid().
getGridColLabelWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetGridColLabelWindow,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridgetgridcornerlabelwindow">external documentation</a>.
+-spec getGridCornerLabelWindow(This) -> wxWindow:wxWindow() when
+ This::wxGrid().
getGridCornerLabelWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_GetGridCornerLabelWindow,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridhidecelleditcontrol">external documentation</a>.
+-spec hideCellEditControl(This) -> ok when
+ This::wxGrid().
hideCellEditControl(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_HideCellEditControl,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> bool()
%% @equiv insertCols(This, [])
+-spec insertCols(This) -> boolean() when
+ This::wxGrid().
+
insertCols(This)
when is_record(This, wx_ref) ->
insertCols(This, []).
-%% @spec (This::wxGrid(), [Option]) -> bool()
-%% Option = {pos, integer()} | {numCols, integer()} | {updateLabels, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridinsertcols">external documentation</a>.
+-spec insertCols(This, [Option]) -> boolean() when
+ This::wxGrid(),
+ Option :: {pos, integer()}
+ | {numCols, integer()}
+ | {updateLabels, boolean()}.
insertCols(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -1024,15 +1166,20 @@ insertCols(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxGrid_InsertCols,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid()) -> bool()
%% @equiv insertRows(This, [])
+-spec insertRows(This) -> boolean() when
+ This::wxGrid().
+
insertRows(This)
when is_record(This, wx_ref) ->
insertRows(This, []).
-%% @spec (This::wxGrid(), [Option]) -> bool()
-%% Option = {pos, integer()} | {numRows, integer()} | {updateLabels, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridinsertrows">external documentation</a>.
+-spec insertRows(This, [Option]) -> boolean() when
+ This::wxGrid(),
+ Option :: {pos, integer()}
+ | {numRows, integer()}
+ | {updateLabels, boolean()}.
insertRows(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -1044,73 +1191,84 @@ insertRows(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxGrid_InsertRows,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridiscelleditcontrolenabled">external documentation</a>.
+-spec isCellEditControlEnabled(This) -> boolean() when
+ This::wxGrid().
isCellEditControlEnabled(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_IsCellEditControlEnabled,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridiscurrentcellreadonly">external documentation</a>.
+-spec isCurrentCellReadOnly(This) -> boolean() when
+ This::wxGrid().
isCurrentCellReadOnly(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_IsCurrentCellReadOnly,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridiseditable">external documentation</a>.
+-spec isEditable(This) -> boolean() when
+ This::wxGrid().
isEditable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_IsEditable,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid(), Coords::{R::integer(), C::integer()}) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridisinselection">external documentation</a>.
+-spec isInSelection(This, Coords) -> boolean() when
+ This::wxGrid(), Coords::{R::integer(), C::integer()}.
isInSelection(#wx_ref{type=ThisT,ref=ThisRef},{CoordsR,CoordsC})
when is_integer(CoordsR),is_integer(CoordsC) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_IsInSelection_1,
<<ThisRef:32/?UI,CoordsR:32/?UI,CoordsC:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridisinselection">external documentation</a>.
+-spec isInSelection(This, Row, Col) -> boolean() when
+ This::wxGrid(), Row::integer(), Col::integer().
isInSelection(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_IsInSelection_2,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridisreadonly">external documentation</a>.
+-spec isReadOnly(This, Row, Col) -> boolean() when
+ This::wxGrid(), Row::integer(), Col::integer().
isReadOnly(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_IsReadOnly,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridisselection">external documentation</a>.
+-spec isSelection(This) -> boolean() when
+ This::wxGrid().
isSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_IsSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid(), Coords::{R::integer(), C::integer()}) -> bool()
%% @equiv isVisible(This,Coords, [])
+-spec isVisible(This, Coords) -> boolean() when
+ This::wxGrid(), Coords::{R::integer(), C::integer()}.
+
isVisible(This,Coords={CoordsR,CoordsC})
when is_record(This, wx_ref),is_integer(CoordsR),is_integer(CoordsC) ->
isVisible(This,Coords, []).
-%% @spec (This::wxGrid(),X::integer()|term(),X::integer()|term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridisvisible">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% isVisible(This::wxGrid(), Row::integer(), Col::integer()) -> isVisible(This,Row,Col, []) </c></p>
-%% <p><c>
-%% isVisible(This::wxGrid(), Coords::{R::integer(), C::integer()}, [Option]) -> bool() </c>
-%%<br /> Option = {wholeCellVisible, bool()}
-%% </p>
+%% <br /> Also:<br />
+%% isVisible(This, Coords, [Option]) -> boolean() when<br />
+%% This::wxGrid(), Coords::{R::integer(), C::integer()},<br />
+%% Option :: {wholeCellVisible, boolean()}.<br />
+%%
+-spec isVisible(This, Row, Col) -> boolean() when
+ This::wxGrid(), Row::integer(), Col::integer();
+ (This, Coords, [Option]) -> boolean() when
+ This::wxGrid(), Coords::{R::integer(), C::integer()},
+ Option :: {wholeCellVisible, boolean()}.
isVisible(This,Row,Col)
when is_record(This, wx_ref),is_integer(Row),is_integer(Col) ->
@@ -1124,9 +1282,10 @@ isVisible(#wx_ref{type=ThisT,ref=ThisRef},{CoordsR,CoordsC}, Options)
wxe_util:call(?wxGrid_IsVisible_2,
<<ThisRef:32/?UI,CoordsR:32/?UI,CoordsC:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer(), [Option]) -> bool()
-%% Option = {wholeCellVisible, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridisvisible">external documentation</a>.
+-spec isVisible(This, Row, Col, [Option]) -> boolean() when
+ This::wxGrid(), Row::integer(), Col::integer(),
+ Option :: {wholeCellVisible, boolean()}.
isVisible(#wx_ref{type=ThisT,ref=ThisRef},Row,Col, Options)
when is_integer(Row),is_integer(Col),is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -1136,102 +1295,115 @@ isVisible(#wx_ref{type=ThisT,ref=ThisRef},Row,Col, Options)
wxe_util:call(?wxGrid_IsVisible_3,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid(), Coords::{R::integer(), C::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridmakecellvisible">external documentation</a>.
+-spec makeCellVisible(This, Coords) -> ok when
+ This::wxGrid(), Coords::{R::integer(), C::integer()}.
makeCellVisible(#wx_ref{type=ThisT,ref=ThisRef},{CoordsR,CoordsC})
when is_integer(CoordsR),is_integer(CoordsC) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_MakeCellVisible_1,
<<ThisRef:32/?UI,CoordsR:32/?UI,CoordsC:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridmakecellvisible">external documentation</a>.
+-spec makeCellVisible(This, Row, Col) -> ok when
+ This::wxGrid(), Row::integer(), Col::integer().
makeCellVisible(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_MakeCellVisible_2,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), ExpandSelection::bool()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridmovecursordown">external documentation</a>.
+-spec moveCursorDown(This, ExpandSelection) -> boolean() when
+ This::wxGrid(), ExpandSelection::boolean().
moveCursorDown(#wx_ref{type=ThisT,ref=ThisRef},ExpandSelection)
when is_boolean(ExpandSelection) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_MoveCursorDown,
<<ThisRef:32/?UI,(wxe_util:from_bool(ExpandSelection)):32/?UI>>).
-%% @spec (This::wxGrid(), ExpandSelection::bool()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridmovecursorleft">external documentation</a>.
+-spec moveCursorLeft(This, ExpandSelection) -> boolean() when
+ This::wxGrid(), ExpandSelection::boolean().
moveCursorLeft(#wx_ref{type=ThisT,ref=ThisRef},ExpandSelection)
when is_boolean(ExpandSelection) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_MoveCursorLeft,
<<ThisRef:32/?UI,(wxe_util:from_bool(ExpandSelection)):32/?UI>>).
-%% @spec (This::wxGrid(), ExpandSelection::bool()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridmovecursorright">external documentation</a>.
+-spec moveCursorRight(This, ExpandSelection) -> boolean() when
+ This::wxGrid(), ExpandSelection::boolean().
moveCursorRight(#wx_ref{type=ThisT,ref=ThisRef},ExpandSelection)
when is_boolean(ExpandSelection) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_MoveCursorRight,
<<ThisRef:32/?UI,(wxe_util:from_bool(ExpandSelection)):32/?UI>>).
-%% @spec (This::wxGrid(), ExpandSelection::bool()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridmovecursorup">external documentation</a>.
+-spec moveCursorUp(This, ExpandSelection) -> boolean() when
+ This::wxGrid(), ExpandSelection::boolean().
moveCursorUp(#wx_ref{type=ThisT,ref=ThisRef},ExpandSelection)
when is_boolean(ExpandSelection) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_MoveCursorUp,
<<ThisRef:32/?UI,(wxe_util:from_bool(ExpandSelection)):32/?UI>>).
-%% @spec (This::wxGrid(), ExpandSelection::bool()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridmovecursordownblock">external documentation</a>.
+-spec moveCursorDownBlock(This, ExpandSelection) -> boolean() when
+ This::wxGrid(), ExpandSelection::boolean().
moveCursorDownBlock(#wx_ref{type=ThisT,ref=ThisRef},ExpandSelection)
when is_boolean(ExpandSelection) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_MoveCursorDownBlock,
<<ThisRef:32/?UI,(wxe_util:from_bool(ExpandSelection)):32/?UI>>).
-%% @spec (This::wxGrid(), ExpandSelection::bool()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridmovecursorleftblock">external documentation</a>.
+-spec moveCursorLeftBlock(This, ExpandSelection) -> boolean() when
+ This::wxGrid(), ExpandSelection::boolean().
moveCursorLeftBlock(#wx_ref{type=ThisT,ref=ThisRef},ExpandSelection)
when is_boolean(ExpandSelection) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_MoveCursorLeftBlock,
<<ThisRef:32/?UI,(wxe_util:from_bool(ExpandSelection)):32/?UI>>).
-%% @spec (This::wxGrid(), ExpandSelection::bool()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridmovecursorrightblock">external documentation</a>.
+-spec moveCursorRightBlock(This, ExpandSelection) -> boolean() when
+ This::wxGrid(), ExpandSelection::boolean().
moveCursorRightBlock(#wx_ref{type=ThisT,ref=ThisRef},ExpandSelection)
when is_boolean(ExpandSelection) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_MoveCursorRightBlock,
<<ThisRef:32/?UI,(wxe_util:from_bool(ExpandSelection)):32/?UI>>).
-%% @spec (This::wxGrid(), ExpandSelection::bool()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridmovecursorupblock">external documentation</a>.
+-spec moveCursorUpBlock(This, ExpandSelection) -> boolean() when
+ This::wxGrid(), ExpandSelection::boolean().
moveCursorUpBlock(#wx_ref{type=ThisT,ref=ThisRef},ExpandSelection)
when is_boolean(ExpandSelection) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_MoveCursorUpBlock,
<<ThisRef:32/?UI,(wxe_util:from_bool(ExpandSelection)):32/?UI>>).
-%% @spec (This::wxGrid()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridmovepagedown">external documentation</a>.
+-spec movePageDown(This) -> boolean() when
+ This::wxGrid().
movePageDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_MovePageDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridmovepageup">external documentation</a>.
+-spec movePageUp(This) -> boolean() when
+ This::wxGrid().
movePageUp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_MovePageUp,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid(), TypeName::string(), Renderer::wxGridCellRenderer:wxGridCellRenderer(), Editor::wxGridCellEditor:wxGridCellEditor()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridregisterdatatype">external documentation</a>.
+-spec registerDataType(This, TypeName, Renderer, Editor) -> ok when
+ This::wxGrid(), TypeName::unicode:chardata(), Renderer::wxGridCellRenderer:wxGridCellRenderer(), Editor::wxGridCellEditor:wxGridCellEditor().
registerDataType(#wx_ref{type=ThisT,ref=ThisRef},TypeName,#wx_ref{type=RendererT,ref=RendererRef},#wx_ref{type=EditorT,ref=EditorRef})
when is_list(TypeName) ->
?CLASS(ThisT,wxGrid),
@@ -1241,29 +1413,34 @@ registerDataType(#wx_ref{type=ThisT,ref=ThisRef},TypeName,#wx_ref{type=RendererT
wxe_util:cast(?wxGrid_RegisterDataType,
<<ThisRef:32/?UI,(byte_size(TypeName_UC)):32/?UI,(TypeName_UC)/binary, 0:(((8- ((0+byte_size(TypeName_UC)) band 16#7)) band 16#7))/unit:8,RendererRef:32/?UI,EditorRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsaveeditcontrolvalue">external documentation</a>.
+-spec saveEditControlValue(This) -> ok when
+ This::wxGrid().
saveEditControlValue(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SaveEditControlValue,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridselectall">external documentation</a>.
+-spec selectAll(This) -> ok when
+ This::wxGrid().
selectAll(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SelectAll,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid(), TopLeft::{R::integer(), C::integer()}, BottomRight::{R::integer(), C::integer()}) -> ok
%% @equiv selectBlock(This,TopLeft,BottomRight, [])
+-spec selectBlock(This, TopLeft, BottomRight) -> ok when
+ This::wxGrid(), TopLeft::{R::integer(), C::integer()}, BottomRight::{R::integer(), C::integer()}.
+
selectBlock(This,TopLeft={TopLeftR,TopLeftC},BottomRight={BottomRightR,BottomRightC})
when is_record(This, wx_ref),is_integer(TopLeftR),is_integer(TopLeftC),is_integer(BottomRightR),is_integer(BottomRightC) ->
selectBlock(This,TopLeft,BottomRight, []).
-%% @spec (This::wxGrid(), TopLeft::{R::integer(), C::integer()}, BottomRight::{R::integer(), C::integer()}, [Option]) -> ok
-%% Option = {addToSelected, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridselectblock">external documentation</a>.
+-spec selectBlock(This, TopLeft, BottomRight, [Option]) -> ok when
+ This::wxGrid(), TopLeft::{R::integer(), C::integer()}, BottomRight::{R::integer(), C::integer()},
+ Option :: {addToSelected, boolean()}.
selectBlock(#wx_ref{type=ThisT,ref=ThisRef},{TopLeftR,TopLeftC},{BottomRightR,BottomRightC}, Options)
when is_integer(TopLeftR),is_integer(TopLeftC),is_integer(BottomRightR),is_integer(BottomRightC),is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -1273,15 +1450,18 @@ selectBlock(#wx_ref{type=ThisT,ref=ThisRef},{TopLeftR,TopLeftC},{BottomRightR,Bo
wxe_util:cast(?wxGrid_SelectBlock_3,
<<ThisRef:32/?UI,TopLeftR:32/?UI,TopLeftC:32/?UI,BottomRightR:32/?UI,BottomRightC:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid(), TopRow::integer(), LeftCol::integer(), BottomRow::integer(), RightCol::integer()) -> ok
%% @equiv selectBlock(This,TopRow,LeftCol,BottomRow,RightCol, [])
+-spec selectBlock(This, TopRow, LeftCol, BottomRow, RightCol) -> ok when
+ This::wxGrid(), TopRow::integer(), LeftCol::integer(), BottomRow::integer(), RightCol::integer().
+
selectBlock(This,TopRow,LeftCol,BottomRow,RightCol)
when is_record(This, wx_ref),is_integer(TopRow),is_integer(LeftCol),is_integer(BottomRow),is_integer(RightCol) ->
selectBlock(This,TopRow,LeftCol,BottomRow,RightCol, []).
-%% @spec (This::wxGrid(), TopRow::integer(), LeftCol::integer(), BottomRow::integer(), RightCol::integer(), [Option]) -> ok
-%% Option = {addToSelected, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridselectblock">external documentation</a>.
+-spec selectBlock(This, TopRow, LeftCol, BottomRow, RightCol, [Option]) -> ok when
+ This::wxGrid(), TopRow::integer(), LeftCol::integer(), BottomRow::integer(), RightCol::integer(),
+ Option :: {addToSelected, boolean()}.
selectBlock(#wx_ref{type=ThisT,ref=ThisRef},TopRow,LeftCol,BottomRow,RightCol, Options)
when is_integer(TopRow),is_integer(LeftCol),is_integer(BottomRow),is_integer(RightCol),is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -1291,15 +1471,18 @@ selectBlock(#wx_ref{type=ThisT,ref=ThisRef},TopRow,LeftCol,BottomRow,RightCol, O
wxe_util:cast(?wxGrid_SelectBlock_5,
<<ThisRef:32/?UI,TopRow:32/?UI,LeftCol:32/?UI,BottomRow:32/?UI,RightCol:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid(), Col::integer()) -> ok
%% @equiv selectCol(This,Col, [])
+-spec selectCol(This, Col) -> ok when
+ This::wxGrid(), Col::integer().
+
selectCol(This,Col)
when is_record(This, wx_ref),is_integer(Col) ->
selectCol(This,Col, []).
-%% @spec (This::wxGrid(), Col::integer(), [Option]) -> ok
-%% Option = {addToSelected, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridselectcol">external documentation</a>.
+-spec selectCol(This, Col, [Option]) -> ok when
+ This::wxGrid(), Col::integer(),
+ Option :: {addToSelected, boolean()}.
selectCol(#wx_ref{type=ThisT,ref=ThisRef},Col, Options)
when is_integer(Col),is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -1309,15 +1492,18 @@ selectCol(#wx_ref{type=ThisT,ref=ThisRef},Col, Options)
wxe_util:cast(?wxGrid_SelectCol,
<<ThisRef:32/?UI,Col:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGrid(), Row::integer()) -> ok
%% @equiv selectRow(This,Row, [])
+-spec selectRow(This, Row) -> ok when
+ This::wxGrid(), Row::integer().
+
selectRow(This,Row)
when is_record(This, wx_ref),is_integer(Row) ->
selectRow(This,Row, []).
-%% @spec (This::wxGrid(), Row::integer(), [Option]) -> ok
-%% Option = {addToSelected, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridselectrow">external documentation</a>.
+-spec selectRow(This, Row, [Option]) -> ok when
+ This::wxGrid(), Row::integer(),
+ Option :: {addToSelected, boolean()}.
selectRow(#wx_ref{type=ThisT,ref=ThisRef},Row, Options)
when is_integer(Row),is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -1327,47 +1513,51 @@ selectRow(#wx_ref{type=ThisT,ref=ThisRef},Row, Options)
wxe_util:cast(?wxGrid_SelectRow,
<<ThisRef:32/?UI,Row:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGrid(), Align::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcellalignment">external documentation</a>.
+-spec setCellAlignment(This, Align) -> ok when
+ This::wxGrid(), Align::integer().
setCellAlignment(#wx_ref{type=ThisT,ref=ThisRef},Align)
when is_integer(Align) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetCellAlignment_1,
<<ThisRef:32/?UI,Align:32/?UI>>).
-%% @spec (This::wxGrid(), Align::integer(), Row::integer(), Col::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcellalignment">external documentation</a>.
+-spec setCellAlignment(This, Align, Row, Col) -> ok when
+ This::wxGrid(), Align::integer(), Row::integer(), Col::integer().
setCellAlignment(#wx_ref{type=ThisT,ref=ThisRef},Align,Row,Col)
when is_integer(Align),is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetCellAlignment_3,
<<ThisRef:32/?UI,Align:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer(), Horiz::integer(), Vert::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcellalignment">external documentation</a>.
+-spec setCellAlignment(This, Row, Col, Horiz, Vert) -> ok when
+ This::wxGrid(), Row::integer(), Col::integer(), Horiz::integer(), Vert::integer().
setCellAlignment(#wx_ref{type=ThisT,ref=ThisRef},Row,Col,Horiz,Vert)
when is_integer(Row),is_integer(Col),is_integer(Horiz),is_integer(Vert) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetCellAlignment_4,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI,Horiz:32/?UI,Vert:32/?UI>>).
-%% @spec (This::wxGrid(), Col::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcellbackgroundcolour">external documentation</a>.
+-spec setCellBackgroundColour(This, Col) -> ok when
+ This::wxGrid(), Col::wx:wx_colour().
setCellBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},Col)
when tuple_size(Col) =:= 3; tuple_size(Col) =:= 4 ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetCellBackgroundColour_1,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Col)):16/binary>>).
-%% @spec (This::wxGrid(),X::integer()|term(),X::integer(),X::term()|integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcellbackgroundcolour">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setCellBackgroundColour(This::wxGrid(), Row::integer(), Col::integer(), Val::wx:colour()) -> ok </c>
-%% </p>
-%% <p><c>
-%% setCellBackgroundColour(This::wxGrid(), Colour::wx:colour(), Row::integer(), Col::integer()) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% setCellBackgroundColour(This, Colour, Row, Col) -> ok when<br />
+%% This::wxGrid(), Colour::wx:wx_colour(), Row::integer(), Col::integer().<br />
+%%
+-spec setCellBackgroundColour(This, Row, Col, Val) -> ok when
+ This::wxGrid(), Row::integer(), Col::integer(), Val::wx:wx_colour();
+ (This, Colour, Row, Col) -> ok when
+ This::wxGrid(), Colour::wx:wx_colour(), Row::integer(), Col::integer().
setCellBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},Row,Col,Val)
when is_integer(Row),is_integer(Col),tuple_size(Val) =:= 3; tuple_size(Val) =:= 4 ->
?CLASS(ThisT,wxGrid),
@@ -1379,8 +1569,9 @@ setCellBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},Colour,Row,Col)
wxe_util:cast(?wxGrid_SetCellBackgroundColour_3_1,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer(), Editor::wxGridCellEditor:wxGridCellEditor()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcelleditor">external documentation</a>.
+-spec setCellEditor(This, Row, Col, Editor) -> ok when
+ This::wxGrid(), Row::integer(), Col::integer(), Editor::wxGridCellEditor:wxGridCellEditor().
setCellEditor(#wx_ref{type=ThisT,ref=ThisRef},Row,Col,#wx_ref{type=EditorT,ref=EditorRef})
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
@@ -1388,8 +1579,9 @@ setCellEditor(#wx_ref{type=ThisT,ref=ThisRef},Row,Col,#wx_ref{type=EditorT,ref=E
wxe_util:cast(?wxGrid_SetCellEditor,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI,EditorRef:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer(), Val::wxFont:wxFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcellfont">external documentation</a>.
+-spec setCellFont(This, Row, Col, Val) -> ok when
+ This::wxGrid(), Row::integer(), Col::integer(), Val::wxFont:wxFont().
setCellFont(#wx_ref{type=ThisT,ref=ThisRef},Row,Col,#wx_ref{type=ValT,ref=ValRef})
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
@@ -1397,8 +1589,9 @@ setCellFont(#wx_ref{type=ThisT,ref=ThisRef},Row,Col,#wx_ref{type=ValT,ref=ValRef
wxe_util:cast(?wxGrid_SetCellFont,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI,ValRef:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer(), Renderer::wxGridCellRenderer:wxGridCellRenderer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcellrenderer">external documentation</a>.
+-spec setCellRenderer(This, Row, Col, Renderer) -> ok when
+ This::wxGrid(), Row::integer(), Col::integer(), Renderer::wxGridCellRenderer:wxGridCellRenderer().
setCellRenderer(#wx_ref{type=ThisT,ref=ThisRef},Row,Col,#wx_ref{type=RendererT,ref=RendererRef})
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
@@ -1406,23 +1599,24 @@ setCellRenderer(#wx_ref{type=ThisT,ref=ThisRef},Row,Col,#wx_ref{type=RendererT,r
wxe_util:cast(?wxGrid_SetCellRenderer,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI,RendererRef:32/?UI>>).
-%% @spec (This::wxGrid(), Col::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcelltextcolour">external documentation</a>.
+-spec setCellTextColour(This, Col) -> ok when
+ This::wxGrid(), Col::wx:wx_colour().
setCellTextColour(#wx_ref{type=ThisT,ref=ThisRef},Col)
when tuple_size(Col) =:= 3; tuple_size(Col) =:= 4 ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetCellTextColour_1,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Col)):16/binary>>).
-%% @spec (This::wxGrid(),X::integer()|term(),X::integer(),X::term()|integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcelltextcolour">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setCellTextColour(This::wxGrid(), Row::integer(), Col::integer(), Val::wx:colour()) -> ok </c>
-%% </p>
-%% <p><c>
-%% setCellTextColour(This::wxGrid(), Val::wx:colour(), Row::integer(), Col::integer()) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% setCellTextColour(This, Val, Row, Col) -> ok when<br />
+%% This::wxGrid(), Val::wx:wx_colour(), Row::integer(), Col::integer().<br />
+%%
+-spec setCellTextColour(This, Row, Col, Val) -> ok when
+ This::wxGrid(), Row::integer(), Col::integer(), Val::wx:wx_colour();
+ (This, Val, Row, Col) -> ok when
+ This::wxGrid(), Val::wx:wx_colour(), Row::integer(), Col::integer().
setCellTextColour(#wx_ref{type=ThisT,ref=ThisRef},Row,Col,Val)
when is_integer(Row),is_integer(Col),tuple_size(Val) =:= 3; tuple_size(Val) =:= 4 ->
?CLASS(ThisT,wxGrid),
@@ -1434,8 +1628,9 @@ setCellTextColour(#wx_ref{type=ThisT,ref=ThisRef},Val,Row,Col)
wxe_util:cast(?wxGrid_SetCellTextColour_3_1,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Val)):16/binary,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), Coords::{R::integer(), C::integer()}, S::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcellvalue">external documentation</a>.
+-spec setCellValue(This, Coords, S) -> ok when
+ This::wxGrid(), Coords::{R::integer(), C::integer()}, S::unicode:chardata().
setCellValue(#wx_ref{type=ThisT,ref=ThisRef},{CoordsR,CoordsC},S)
when is_integer(CoordsR),is_integer(CoordsC),is_list(S) ->
?CLASS(ThisT,wxGrid),
@@ -1443,15 +1638,15 @@ setCellValue(#wx_ref{type=ThisT,ref=ThisRef},{CoordsR,CoordsC},S)
wxe_util:cast(?wxGrid_SetCellValue_2,
<<ThisRef:32/?UI,CoordsR:32/?UI,CoordsC:32/?UI,(byte_size(S_UC)):32/?UI,(S_UC)/binary, 0:(((8- ((0+byte_size(S_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGrid(),X::integer()|string(),X::integer(),X::string()|integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcellvalue">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setCellValue(This::wxGrid(), Row::integer(), Col::integer(), S::string()) -> ok </c>
-%% </p>
-%% <p><c>
-%% setCellValue(This::wxGrid(), Val::string(), Row::integer(), Col::integer()) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% setCellValue(This, Val, Row, Col) -> ok when<br />
+%% This::wxGrid(), Val::unicode:chardata(), Row::integer(), Col::integer().<br />
+%%
+-spec setCellValue(This, Row, Col, S) -> ok when
+ This::wxGrid(), Row::integer(), Col::integer(), S::unicode:chardata();
+ (This, Val, Row, Col) -> ok when
+ This::wxGrid(), Val::unicode:chardata(), Row::integer(), Col::integer().
setCellValue(#wx_ref{type=ThisT,ref=ThisRef},Row,Col,S)
when is_integer(Row),is_integer(Col),is_list(S) ->
?CLASS(ThisT,wxGrid),
@@ -1465,8 +1660,9 @@ setCellValue(#wx_ref{type=ThisT,ref=ThisRef},Val,Row,Col)
wxe_util:cast(?wxGrid_SetCellValue_3_1,
<<ThisRef:32/?UI,(byte_size(Val_UC)):32/?UI,(Val_UC)/binary, 0:(((8- ((0+byte_size(Val_UC)) band 16#7)) band 16#7))/unit:8,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), Col::integer(), Attr::wxGridCellAttr:wxGridCellAttr()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcolattr">external documentation</a>.
+-spec setColAttr(This, Col, Attr) -> ok when
+ This::wxGrid(), Col::integer(), Attr::wxGridCellAttr:wxGridCellAttr().
setColAttr(#wx_ref{type=ThisT,ref=ThisRef},Col,#wx_ref{type=AttrT,ref=AttrRef})
when is_integer(Col) ->
?CLASS(ThisT,wxGrid),
@@ -1474,31 +1670,37 @@ setColAttr(#wx_ref{type=ThisT,ref=ThisRef},Col,#wx_ref{type=AttrT,ref=AttrRef})
wxe_util:cast(?wxGrid_SetColAttr,
<<ThisRef:32/?UI,Col:32/?UI,AttrRef:32/?UI>>).
-%% @spec (This::wxGrid(), Col::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcolformatbool">external documentation</a>.
+-spec setColFormatBool(This, Col) -> ok when
+ This::wxGrid(), Col::integer().
setColFormatBool(#wx_ref{type=ThisT,ref=ThisRef},Col)
when is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetColFormatBool,
<<ThisRef:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), Col::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcolformatnumber">external documentation</a>.
+-spec setColFormatNumber(This, Col) -> ok when
+ This::wxGrid(), Col::integer().
setColFormatNumber(#wx_ref{type=ThisT,ref=ThisRef},Col)
when is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetColFormatNumber,
<<ThisRef:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), Col::integer()) -> ok
%% @equiv setColFormatFloat(This,Col, [])
+-spec setColFormatFloat(This, Col) -> ok when
+ This::wxGrid(), Col::integer().
+
setColFormatFloat(This,Col)
when is_record(This, wx_ref),is_integer(Col) ->
setColFormatFloat(This,Col, []).
-%% @spec (This::wxGrid(), Col::integer(), [Option]) -> ok
-%% Option = {width, integer()} | {precision, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcolformatfloat">external documentation</a>.
+-spec setColFormatFloat(This, Col, [Option]) -> ok when
+ This::wxGrid(), Col::integer(),
+ Option :: {width, integer()}
+ | {precision, integer()}.
setColFormatFloat(#wx_ref{type=ThisT,ref=ThisRef},Col, Options)
when is_integer(Col),is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -1509,8 +1711,9 @@ setColFormatFloat(#wx_ref{type=ThisT,ref=ThisRef},Col, Options)
wxe_util:cast(?wxGrid_SetColFormatFloat,
<<ThisRef:32/?UI,Col:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGrid(), Col::integer(), TypeName::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcolformatcustom">external documentation</a>.
+-spec setColFormatCustom(This, Col, TypeName) -> ok when
+ This::wxGrid(), Col::integer(), TypeName::unicode:chardata().
setColFormatCustom(#wx_ref{type=ThisT,ref=ThisRef},Col,TypeName)
when is_integer(Col),is_list(TypeName) ->
?CLASS(ThisT,wxGrid),
@@ -1518,24 +1721,27 @@ setColFormatCustom(#wx_ref{type=ThisT,ref=ThisRef},Col,TypeName)
wxe_util:cast(?wxGrid_SetColFormatCustom,
<<ThisRef:32/?UI,Col:32/?UI,(byte_size(TypeName_UC)):32/?UI,(TypeName_UC)/binary, 0:(((8- ((4+byte_size(TypeName_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGrid(), Horiz::integer(), Vert::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcollabelalignment">external documentation</a>.
+-spec setColLabelAlignment(This, Horiz, Vert) -> ok when
+ This::wxGrid(), Horiz::integer(), Vert::integer().
setColLabelAlignment(#wx_ref{type=ThisT,ref=ThisRef},Horiz,Vert)
when is_integer(Horiz),is_integer(Vert) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetColLabelAlignment,
<<ThisRef:32/?UI,Horiz:32/?UI,Vert:32/?UI>>).
-%% @spec (This::wxGrid(), Height::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcollabelsize">external documentation</a>.
+-spec setColLabelSize(This, Height) -> ok when
+ This::wxGrid(), Height::integer().
setColLabelSize(#wx_ref{type=ThisT,ref=ThisRef},Height)
when is_integer(Height) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetColLabelSize,
<<ThisRef:32/?UI,Height:32/?UI>>).
-%% @spec (This::wxGrid(), Col::integer(), Val::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcollabelvalue">external documentation</a>.
+-spec setColLabelValue(This, Col, Val) -> ok when
+ This::wxGrid(), Col::integer(), Val::unicode:chardata().
setColLabelValue(#wx_ref{type=ThisT,ref=ThisRef},Col,Val)
when is_integer(Col),is_list(Val) ->
?CLASS(ThisT,wxGrid),
@@ -1543,87 +1749,99 @@ setColLabelValue(#wx_ref{type=ThisT,ref=ThisRef},Col,Val)
wxe_util:cast(?wxGrid_SetColLabelValue,
<<ThisRef:32/?UI,Col:32/?UI,(byte_size(Val_UC)):32/?UI,(Val_UC)/binary, 0:(((8- ((4+byte_size(Val_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGrid(), Col::integer(), Width::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcolminimalwidth">external documentation</a>.
+-spec setColMinimalWidth(This, Col, Width) -> ok when
+ This::wxGrid(), Col::integer(), Width::integer().
setColMinimalWidth(#wx_ref{type=ThisT,ref=ThisRef},Col,Width)
when is_integer(Col),is_integer(Width) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetColMinimalWidth,
<<ThisRef:32/?UI,Col:32/?UI,Width:32/?UI>>).
-%% @spec (This::wxGrid(), Width::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcolminimalacceptablewidth">external documentation</a>.
+-spec setColMinimalAcceptableWidth(This, Width) -> ok when
+ This::wxGrid(), Width::integer().
setColMinimalAcceptableWidth(#wx_ref{type=ThisT,ref=ThisRef},Width)
when is_integer(Width) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetColMinimalAcceptableWidth,
<<ThisRef:32/?UI,Width:32/?UI>>).
-%% @spec (This::wxGrid(), Col::integer(), Width::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetcolsize">external documentation</a>.
+-spec setColSize(This, Col, Width) -> ok when
+ This::wxGrid(), Col::integer(), Width::integer().
setColSize(#wx_ref{type=ThisT,ref=ThisRef},Col,Width)
when is_integer(Col),is_integer(Width) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetColSize,
<<ThisRef:32/?UI,Col:32/?UI,Width:32/?UI>>).
-%% @spec (This::wxGrid(), Horiz::integer(), Vert::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetdefaultcellalignment">external documentation</a>.
+-spec setDefaultCellAlignment(This, Horiz, Vert) -> ok when
+ This::wxGrid(), Horiz::integer(), Vert::integer().
setDefaultCellAlignment(#wx_ref{type=ThisT,ref=ThisRef},Horiz,Vert)
when is_integer(Horiz),is_integer(Vert) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetDefaultCellAlignment,
<<ThisRef:32/?UI,Horiz:32/?UI,Vert:32/?UI>>).
-%% @spec (This::wxGrid(), Val::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetdefaultcellbackgroundcolour">external documentation</a>.
+-spec setDefaultCellBackgroundColour(This, Val) -> ok when
+ This::wxGrid(), Val::wx:wx_colour().
setDefaultCellBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},Val)
when tuple_size(Val) =:= 3; tuple_size(Val) =:= 4 ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetDefaultCellBackgroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Val)):16/binary>>).
-%% @spec (This::wxGrid(), Val::wxFont:wxFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetdefaultcellfont">external documentation</a>.
+-spec setDefaultCellFont(This, Val) -> ok when
+ This::wxGrid(), Val::wxFont:wxFont().
setDefaultCellFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ValT,ref=ValRef}) ->
?CLASS(ThisT,wxGrid),
?CLASS(ValT,wxFont),
wxe_util:cast(?wxGrid_SetDefaultCellFont,
<<ThisRef:32/?UI,ValRef:32/?UI>>).
-%% @spec (This::wxGrid(), Val::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetdefaultcelltextcolour">external documentation</a>.
+-spec setDefaultCellTextColour(This, Val) -> ok when
+ This::wxGrid(), Val::wx:wx_colour().
setDefaultCellTextColour(#wx_ref{type=ThisT,ref=ThisRef},Val)
when tuple_size(Val) =:= 3; tuple_size(Val) =:= 4 ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetDefaultCellTextColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Val)):16/binary>>).
-%% @spec (This::wxGrid(), Editor::wxGridCellEditor:wxGridCellEditor()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetdefaulteditor">external documentation</a>.
+-spec setDefaultEditor(This, Editor) -> ok when
+ This::wxGrid(), Editor::wxGridCellEditor:wxGridCellEditor().
setDefaultEditor(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=EditorT,ref=EditorRef}) ->
?CLASS(ThisT,wxGrid),
?CLASS(EditorT,wxGridCellEditor),
wxe_util:cast(?wxGrid_SetDefaultEditor,
<<ThisRef:32/?UI,EditorRef:32/?UI>>).
-%% @spec (This::wxGrid(), Renderer::wxGridCellRenderer:wxGridCellRenderer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetdefaultrenderer">external documentation</a>.
+-spec setDefaultRenderer(This, Renderer) -> ok when
+ This::wxGrid(), Renderer::wxGridCellRenderer:wxGridCellRenderer().
setDefaultRenderer(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=RendererT,ref=RendererRef}) ->
?CLASS(ThisT,wxGrid),
?CLASS(RendererT,wxGridCellRenderer),
wxe_util:cast(?wxGrid_SetDefaultRenderer,
<<ThisRef:32/?UI,RendererRef:32/?UI>>).
-%% @spec (This::wxGrid(), Width::integer()) -> ok
%% @equiv setDefaultColSize(This,Width, [])
+-spec setDefaultColSize(This, Width) -> ok when
+ This::wxGrid(), Width::integer().
+
setDefaultColSize(This,Width)
when is_record(This, wx_ref),is_integer(Width) ->
setDefaultColSize(This,Width, []).
-%% @spec (This::wxGrid(), Width::integer(), [Option]) -> ok
-%% Option = {resizeExistingCols, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetdefaultcolsize">external documentation</a>.
+-spec setDefaultColSize(This, Width, [Option]) -> ok when
+ This::wxGrid(), Width::integer(),
+ Option :: {resizeExistingCols, boolean()}.
setDefaultColSize(#wx_ref{type=ThisT,ref=ThisRef},Width, Options)
when is_integer(Width),is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -1633,15 +1851,18 @@ setDefaultColSize(#wx_ref{type=ThisT,ref=ThisRef},Width, Options)
wxe_util:cast(?wxGrid_SetDefaultColSize,
<<ThisRef:32/?UI,Width:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGrid(), Height::integer()) -> ok
%% @equiv setDefaultRowSize(This,Height, [])
+-spec setDefaultRowSize(This, Height) -> ok when
+ This::wxGrid(), Height::integer().
+
setDefaultRowSize(This,Height)
when is_record(This, wx_ref),is_integer(Height) ->
setDefaultRowSize(This,Height, []).
-%% @spec (This::wxGrid(), Height::integer(), [Option]) -> ok
-%% Option = {resizeExistingRows, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetdefaultrowsize">external documentation</a>.
+-spec setDefaultRowSize(This, Height, [Option]) -> ok when
+ This::wxGrid(), Height::integer(),
+ Option :: {resizeExistingRows, boolean()}.
setDefaultRowSize(#wx_ref{type=ThisT,ref=ThisRef},Height, Options)
when is_integer(Height),is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -1651,63 +1872,72 @@ setDefaultRowSize(#wx_ref{type=ThisT,ref=ThisRef},Height, Options)
wxe_util:cast(?wxGrid_SetDefaultRowSize,
<<ThisRef:32/?UI,Height:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetgridcursor">external documentation</a>.
+-spec setGridCursor(This, Row, Col) -> ok when
+ This::wxGrid(), Row::integer(), Col::integer().
setGridCursor(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetGridCursor,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGrid(), Val::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetgridlinecolour">external documentation</a>.
+-spec setGridLineColour(This, Val) -> ok when
+ This::wxGrid(), Val::wx:wx_colour().
setGridLineColour(#wx_ref{type=ThisT,ref=ThisRef},Val)
when tuple_size(Val) =:= 3; tuple_size(Val) =:= 4 ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetGridLineColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Val)):16/binary>>).
-%% @spec (This::wxGrid(), Val::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetlabelbackgroundcolour">external documentation</a>.
+-spec setLabelBackgroundColour(This, Val) -> ok when
+ This::wxGrid(), Val::wx:wx_colour().
setLabelBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},Val)
when tuple_size(Val) =:= 3; tuple_size(Val) =:= 4 ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetLabelBackgroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Val)):16/binary>>).
-%% @spec (This::wxGrid(), Val::wxFont:wxFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetlabelfont">external documentation</a>.
+-spec setLabelFont(This, Val) -> ok when
+ This::wxGrid(), Val::wxFont:wxFont().
setLabelFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ValT,ref=ValRef}) ->
?CLASS(ThisT,wxGrid),
?CLASS(ValT,wxFont),
wxe_util:cast(?wxGrid_SetLabelFont,
<<ThisRef:32/?UI,ValRef:32/?UI>>).
-%% @spec (This::wxGrid(), Val::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetlabeltextcolour">external documentation</a>.
+-spec setLabelTextColour(This, Val) -> ok when
+ This::wxGrid(), Val::wx:wx_colour().
setLabelTextColour(#wx_ref{type=ThisT,ref=ThisRef},Val)
when tuple_size(Val) =:= 3; tuple_size(Val) =:= 4 ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetLabelTextColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Val)):16/binary>>).
-%% @spec (This::wxGrid(), ExtraWidth::integer(), ExtraHeight::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetmargins">external documentation</a>.
+-spec setMargins(This, ExtraWidth, ExtraHeight) -> ok when
+ This::wxGrid(), ExtraWidth::integer(), ExtraHeight::integer().
setMargins(#wx_ref{type=ThisT,ref=ThisRef},ExtraWidth,ExtraHeight)
when is_integer(ExtraWidth),is_integer(ExtraHeight) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetMargins,
<<ThisRef:32/?UI,ExtraWidth:32/?UI,ExtraHeight:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer()) -> ok
%% @equiv setReadOnly(This,Row,Col, [])
+-spec setReadOnly(This, Row, Col) -> ok when
+ This::wxGrid(), Row::integer(), Col::integer().
+
setReadOnly(This,Row,Col)
when is_record(This, wx_ref),is_integer(Row),is_integer(Col) ->
setReadOnly(This,Row,Col, []).
-%% @spec (This::wxGrid(), Row::integer(), Col::integer(), [Option]) -> ok
-%% Option = {isReadOnly, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetreadonly">external documentation</a>.
+-spec setReadOnly(This, Row, Col, [Option]) -> ok when
+ This::wxGrid(), Row::integer(), Col::integer(),
+ Option :: {isReadOnly, boolean()}.
setReadOnly(#wx_ref{type=ThisT,ref=ThisRef},Row,Col, Options)
when is_integer(Row),is_integer(Col),is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -1717,8 +1947,9 @@ setReadOnly(#wx_ref{type=ThisT,ref=ThisRef},Row,Col, Options)
wxe_util:cast(?wxGrid_SetReadOnly,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGrid(), Row::integer(), Attr::wxGridCellAttr:wxGridCellAttr()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetrowattr">external documentation</a>.
+-spec setRowAttr(This, Row, Attr) -> ok when
+ This::wxGrid(), Row::integer(), Attr::wxGridCellAttr:wxGridCellAttr().
setRowAttr(#wx_ref{type=ThisT,ref=ThisRef},Row,#wx_ref{type=AttrT,ref=AttrRef})
when is_integer(Row) ->
?CLASS(ThisT,wxGrid),
@@ -1726,24 +1957,27 @@ setRowAttr(#wx_ref{type=ThisT,ref=ThisRef},Row,#wx_ref{type=AttrT,ref=AttrRef})
wxe_util:cast(?wxGrid_SetRowAttr,
<<ThisRef:32/?UI,Row:32/?UI,AttrRef:32/?UI>>).
-%% @spec (This::wxGrid(), Horiz::integer(), Vert::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetrowlabelalignment">external documentation</a>.
+-spec setRowLabelAlignment(This, Horiz, Vert) -> ok when
+ This::wxGrid(), Horiz::integer(), Vert::integer().
setRowLabelAlignment(#wx_ref{type=ThisT,ref=ThisRef},Horiz,Vert)
when is_integer(Horiz),is_integer(Vert) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetRowLabelAlignment,
<<ThisRef:32/?UI,Horiz:32/?UI,Vert:32/?UI>>).
-%% @spec (This::wxGrid(), Width::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetrowlabelsize">external documentation</a>.
+-spec setRowLabelSize(This, Width) -> ok when
+ This::wxGrid(), Width::integer().
setRowLabelSize(#wx_ref{type=ThisT,ref=ThisRef},Width)
when is_integer(Width) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetRowLabelSize,
<<ThisRef:32/?UI,Width:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Val::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetrowlabelvalue">external documentation</a>.
+-spec setRowLabelValue(This, Row, Val) -> ok when
+ This::wxGrid(), Row::integer(), Val::unicode:chardata().
setRowLabelValue(#wx_ref{type=ThisT,ref=ThisRef},Row,Val)
when is_integer(Row),is_list(Val) ->
?CLASS(ThisT,wxGrid),
@@ -1751,88 +1985,99 @@ setRowLabelValue(#wx_ref{type=ThisT,ref=ThisRef},Row,Val)
wxe_util:cast(?wxGrid_SetRowLabelValue,
<<ThisRef:32/?UI,Row:32/?UI,(byte_size(Val_UC)):32/?UI,(Val_UC)/binary, 0:(((8- ((4+byte_size(Val_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGrid(), Row::integer(), Width::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetrowminimalheight">external documentation</a>.
+-spec setRowMinimalHeight(This, Row, Width) -> ok when
+ This::wxGrid(), Row::integer(), Width::integer().
setRowMinimalHeight(#wx_ref{type=ThisT,ref=ThisRef},Row,Width)
when is_integer(Row),is_integer(Width) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetRowMinimalHeight,
<<ThisRef:32/?UI,Row:32/?UI,Width:32/?UI>>).
-%% @spec (This::wxGrid(), Width::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetrowminimalacceptableheight">external documentation</a>.
+-spec setRowMinimalAcceptableHeight(This, Width) -> ok when
+ This::wxGrid(), Width::integer().
setRowMinimalAcceptableHeight(#wx_ref{type=ThisT,ref=ThisRef},Width)
when is_integer(Width) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetRowMinimalAcceptableHeight,
<<ThisRef:32/?UI,Width:32/?UI>>).
-%% @spec (This::wxGrid(), Row::integer(), Height::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetrowsize">external documentation</a>.
+-spec setRowSize(This, Row, Height) -> ok when
+ This::wxGrid(), Row::integer(), Height::integer().
setRowSize(#wx_ref{type=ThisT,ref=ThisRef},Row,Height)
when is_integer(Row),is_integer(Height) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetRowSize,
<<ThisRef:32/?UI,Row:32/?UI,Height:32/?UI>>).
-%% @spec (This::wxGrid(), X::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetscrolllinex">external documentation</a>.
+-spec setScrollLineX(This, X) -> ok when
+ This::wxGrid(), X::integer().
setScrollLineX(#wx_ref{type=ThisT,ref=ThisRef},X)
when is_integer(X) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetScrollLineX,
<<ThisRef:32/?UI,X:32/?UI>>).
-%% @spec (This::wxGrid(), Y::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetscrollliney">external documentation</a>.
+-spec setScrollLineY(This, Y) -> ok when
+ This::wxGrid(), Y::integer().
setScrollLineY(#wx_ref{type=ThisT,ref=ThisRef},Y)
when is_integer(Y) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetScrollLineY,
<<ThisRef:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxGrid(), C::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetselectionbackground">external documentation</a>.
+-spec setSelectionBackground(This, C) -> ok when
+ This::wxGrid(), C::wx:wx_colour().
setSelectionBackground(#wx_ref{type=ThisT,ref=ThisRef},C)
when tuple_size(C) =:= 3; tuple_size(C) =:= 4 ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetSelectionBackground,
<<ThisRef:32/?UI,(wxe_util:colour_bin(C)):16/binary>>).
-%% @spec (This::wxGrid(), C::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetselectionforeground">external documentation</a>.
+-spec setSelectionForeground(This, C) -> ok when
+ This::wxGrid(), C::wx:wx_colour().
setSelectionForeground(#wx_ref{type=ThisT,ref=ThisRef},C)
when tuple_size(C) =:= 3; tuple_size(C) =:= 4 ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetSelectionForeground,
<<ThisRef:32/?UI,(wxe_util:colour_bin(C)):16/binary>>).
-%% @spec (This::wxGrid(), Selmode::WxGridSelectionModes) -> ok
-%% WxGridSelectionModes = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridsetselectionmode">external documentation</a>.
-%%<br /> WxGridSelectionModes is one of ?wxGrid_wxGridSelectCells | ?wxGrid_wxGridSelectRows | ?wxGrid_wxGridSelectColumns
+%%<br /> Selmode = ?wxGrid_wxGridSelectCells | ?wxGrid_wxGridSelectRows | ?wxGrid_wxGridSelectColumns
+-spec setSelectionMode(This, Selmode) -> ok when
+ This::wxGrid(), Selmode::wx:wx_enum().
setSelectionMode(#wx_ref{type=ThisT,ref=ThisRef},Selmode)
when is_integer(Selmode) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_SetSelectionMode,
<<ThisRef:32/?UI,Selmode:32/?UI>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridshowcelleditcontrol">external documentation</a>.
+-spec showCellEditControl(This) -> ok when
+ This::wxGrid().
showCellEditControl(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGrid),
wxe_util:cast(?wxGrid_ShowCellEditControl,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGrid(), X::integer()) -> integer()
%% @equiv xToCol(This,X, [])
+-spec xToCol(This, X) -> integer() when
+ This::wxGrid(), X::integer().
+
xToCol(This,X)
when is_record(This, wx_ref),is_integer(X) ->
xToCol(This,X, []).
-%% @spec (This::wxGrid(), X::integer(), [Option]) -> integer()
-%% Option = {clipToMinMax, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridxtocol">external documentation</a>.
+-spec xToCol(This, X, [Option]) -> integer() when
+ This::wxGrid(), X::integer(),
+ Option :: {clipToMinMax, boolean()}.
xToCol(#wx_ref{type=ThisT,ref=ThisRef},X, Options)
when is_integer(X),is_list(Options) ->
?CLASS(ThisT,wxGrid),
@@ -1842,32 +2087,35 @@ xToCol(#wx_ref{type=ThisT,ref=ThisRef},X, Options)
wxe_util:call(?wxGrid_XToCol,
<<ThisRef:32/?UI,X:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGrid(), X::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridxtoedgeofcol">external documentation</a>.
+-spec xToEdgeOfCol(This, X) -> integer() when
+ This::wxGrid(), X::integer().
xToEdgeOfCol(#wx_ref{type=ThisT,ref=ThisRef},X)
when is_integer(X) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_XToEdgeOfCol,
<<ThisRef:32/?UI,X:32/?UI>>).
-%% @spec (This::wxGrid(), Y::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridytoedgeofrow">external documentation</a>.
+-spec yToEdgeOfRow(This, Y) -> integer() when
+ This::wxGrid(), Y::integer().
yToEdgeOfRow(#wx_ref{type=ThisT,ref=ThisRef},Y)
when is_integer(Y) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_YToEdgeOfRow,
<<ThisRef:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxGrid(), Y::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgrid.html#wxgridytorow">external documentation</a>.
+-spec yToRow(This, Y) -> integer() when
+ This::wxGrid(), Y::integer().
yToRow(#wx_ref{type=ThisT,ref=ThisRef},Y)
when is_integer(Y) ->
?CLASS(ThisT,wxGrid),
wxe_util:call(?wxGrid_YToRow,
<<ThisRef:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxGrid()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGrid()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxGrid),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxGridBagSizer.erl b/lib/wx/src/gen/wxGridBagSizer.erl
index d2b8a2b045..e8a9ff6d76 100644
--- a/lib/wx/src/gen/wxGridBagSizer.erl
+++ b/lib/wx/src/gen/wxGridBagSizer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -48,20 +48,24 @@
setItemMinSize/4,setMinSize/2,setMinSize/3,setNonFlexibleGrowMode/2,
setRows/2,setSizeHints/2,setVGap/2,setVirtualSizeHints/2,show/2,show/3]).
+-export_type([wxGridBagSizer/0]).
%% @hidden
parent_class(wxFlexGridSizer) -> true;
parent_class(wxGridSizer) -> true;
parent_class(wxSizer) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxGridBagSizer()
+-type wxGridBagSizer() :: wx:wx_object().
%% @equiv new([])
+-spec new() -> wxGridBagSizer().
+
new() ->
new([]).
-%% @spec ([Option]) -> wxGridBagSizer()
-%% Option = {vgap, integer()} | {hgap, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizerwxgridbagsizer">external documentation</a>.
+-spec new([Option]) -> wxGridBagSizer() when
+ Option :: {vgap, integer()}
+ | {hgap, integer()}.
new(Options)
when is_list(Options) ->
MOpts = fun({vgap, Vgap}, Acc) -> [<<1:32/?UI,Vgap:32/?UI>>|Acc];
@@ -71,8 +75,9 @@ new(Options)
wxe_util:construct(?wxGridBagSizer_new,
<<BinOpt/binary>>).
-%% @spec (This::wxGridBagSizer(), Item::wxSizerItem:wxSizerItem() | wxGBSizerItem:wxGBSizerItem()) -> wxSizerItem:wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizeradd">external documentation</a>.
+-spec add(This, Item) -> wxSizerItem:wxSizerItem() when
+ This::wxGridBagSizer(), Item::wxSizerItem:wxSizerItem() | wxGBSizerItem:wxGBSizerItem().
add(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=ItemRef}) ->
?CLASS(ThisT,wxGridBagSizer),
ItemOP = case ?CLASS_T(ItemT,wxSizerItem) of
@@ -84,17 +89,27 @@ add(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=ItemRef}) ->
wxe_util:call(ItemOP,
<<ThisRef:32/?UI,ItemRef:32/?UI>>).
-%% @spec (This::wxGridBagSizer(),X::integer()|term(),X::integer()|term()) -> wxSizerItem:wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizeradd">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% add(This::wxGridBagSizer(), Width::integer(), Height::integer()) -> add(This,Width,Height, []) </c></p>
-%% <p><c>
-%% add(This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Pos::{R::integer(), C::integer()}) -> add(This,Window,Pos, []) </c></p>
-%% <p><c>
-%% add(This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer(), [Option]) -> wxSizerItem:wxSizerItem() </c>
-%%<br /> Option = {proportion, integer()} | {flag, integer()} | {border, integer()} | {userData, wx:wx()}
-%% </p>
+%% <br /> Also:<br />
+%% add(This, Window, Pos) -> wxSizerItem:wxSizerItem() when<br />
+%% This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Pos::{R::integer(), C::integer()};<br />
+%% (This, Window, [Option]) -> wxSizerItem:wxSizerItem() when<br />
+%% This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer(),<br />
+%% Option :: {proportion, integer()}<br />
+%% | {flag, integer()}<br />
+%% | {border, integer()}<br />
+%% | {userData, wx:wx_object()}.<br />
+%%
+-spec add(This, Width, Height) -> wxSizerItem:wxSizerItem() when
+ This::wxGridBagSizer(), Width::integer(), Height::integer();
+ (This, Window, Pos) -> wxSizerItem:wxSizerItem() when
+ This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Pos::{R::integer(), C::integer()};
+ (This, Window, [Option]) -> wxSizerItem:wxSizerItem() when
+ This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer(),
+ Option :: {proportion, integer()}
+ | {flag, integer()}
+ | {border, integer()}
+ | {userData, wx:wx_object()}.
add(This,Width,Height)
when is_record(This, wx_ref),is_integer(Width),is_integer(Height) ->
@@ -121,19 +136,35 @@ add(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}, Options
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,WindowRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGridBagSizer(),X::integer()|term(),X::integer()|term(),X::term()) -> wxSizerItem:wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizeradd">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% add(This::wxGridBagSizer(), Width::integer(), Height::integer(), Pos::{R::integer(), C::integer()}) -> add(This,Width,Height,Pos, []) </c></p>
-%% <p><c>
-%% add(This::wxGridBagSizer(), Width::integer(), Height::integer(), [Option]) -> wxSizerItem:wxSizerItem() </c>
-%%<br /> Option = {proportion, integer()} | {flag, integer()} | {border, integer()} | {userData, wx:wx()}
-%% </p>
-%% <p><c>
-%% add(This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Pos::{R::integer(), C::integer()}, [Option]) -> wxSizerItem:wxSizerItem() </c>
-%%<br /> Option = {span, {RS::integer(), CS::integer()}} | {flag, integer()} | {border, integer()} | {userData, wx:wx()}
-%% </p>
+%% <br /> Also:<br />
+%% add(This, Width, Height, [Option]) -> wxSizerItem:wxSizerItem() when<br />
+%% This::wxGridBagSizer(), Width::integer(), Height::integer(),<br />
+%% Option :: {proportion, integer()}<br />
+%% | {flag, integer()}<br />
+%% | {border, integer()}<br />
+%% | {userData, wx:wx_object()};<br />
+%% (This, Window, Pos, [Option]) -> wxSizerItem:wxSizerItem() when<br />
+%% This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Pos::{R::integer(), C::integer()},<br />
+%% Option :: {span, {RS::integer(), CS::integer()}}<br />
+%% | {flag, integer()}<br />
+%% | {border, integer()}<br />
+%% | {userData, wx:wx_object()}.<br />
+%%
+-spec add(This, Width, Height, Pos) -> wxSizerItem:wxSizerItem() when
+ This::wxGridBagSizer(), Width::integer(), Height::integer(), Pos::{R::integer(), C::integer()};
+ (This, Width, Height, [Option]) -> wxSizerItem:wxSizerItem() when
+ This::wxGridBagSizer(), Width::integer(), Height::integer(),
+ Option :: {proportion, integer()}
+ | {flag, integer()}
+ | {border, integer()}
+ | {userData, wx:wx_object()};
+ (This, Window, Pos, [Option]) -> wxSizerItem:wxSizerItem() when
+ This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Pos::{R::integer(), C::integer()},
+ Option :: {span, {RS::integer(), CS::integer()}}
+ | {flag, integer()}
+ | {border, integer()}
+ | {userData, wx:wx_object()}.
add(This,Width,Height,Pos={PosR,PosC})
when is_record(This, wx_ref),is_integer(Width),is_integer(Height),is_integer(PosR),is_integer(PosC) ->
@@ -167,9 +198,13 @@ add(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef},{PosR,Po
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,WindowRef:32/?UI,PosR:32/?UI,PosC:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGridBagSizer(), Width::integer(), Height::integer(), Pos::{R::integer(), C::integer()}, [Option]) -> wxSizerItem:wxSizerItem()
-%% Option = {span, {RS::integer(), CS::integer()}} | {flag, integer()} | {border, integer()} | {userData, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizeradd">external documentation</a>.
+-spec add(This, Width, Height, Pos, [Option]) -> wxSizerItem:wxSizerItem() when
+ This::wxGridBagSizer(), Width::integer(), Height::integer(), Pos::{R::integer(), C::integer()},
+ Option :: {span, {RS::integer(), CS::integer()}}
+ | {flag, integer()}
+ | {border, integer()}
+ | {userData, wx:wx_object()}.
add(#wx_ref{type=ThisT,ref=ThisRef},Width,Height,{PosR,PosC}, Options)
when is_integer(Width),is_integer(Height),is_integer(PosR),is_integer(PosC),is_list(Options) ->
?CLASS(ThisT,wxGridBagSizer),
@@ -182,28 +217,33 @@ add(#wx_ref{type=ThisT,ref=ThisRef},Width,Height,{PosR,PosC}, Options)
wxe_util:call(?wxGridBagSizer_Add_4,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI,PosR:32/?UI,PosC:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGridBagSizer()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizercalcmin">external documentation</a>.
+-spec calcMin(This) -> {W::integer(), H::integer()} when
+ This::wxGridBagSizer().
calcMin(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridBagSizer),
wxe_util:call(?wxGridBagSizer_CalcMin,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridBagSizer(), Item::wxGBSizerItem:wxGBSizerItem()) -> bool()
%% @equiv checkForIntersection(This,Item, [])
+-spec checkForIntersection(This, Item) -> boolean() when
+ This::wxGridBagSizer(), Item::wxGBSizerItem:wxGBSizerItem().
+
checkForIntersection(This,Item)
when is_record(This, wx_ref),is_record(Item, wx_ref) ->
checkForIntersection(This,Item, []).
-%% @spec (This::wxGridBagSizer(),X::term(),X::term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizercheckforintersection">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% checkForIntersection(This::wxGridBagSizer(), Pos::{R::integer(), C::integer()}, Span::{RS::integer(), CS::integer()}) -> checkForIntersection(This,Pos,Span, []) </c></p>
-%% <p><c>
-%% checkForIntersection(This::wxGridBagSizer(), Item::wxGBSizerItem:wxGBSizerItem(), [Option]) -> bool() </c>
-%%<br /> Option = {excludeItem, wxGBSizerItem:wxGBSizerItem()}
-%% </p>
+%% <br /> Also:<br />
+%% checkForIntersection(This, Item, [Option]) -> boolean() when<br />
+%% This::wxGridBagSizer(), Item::wxGBSizerItem:wxGBSizerItem(),<br />
+%% Option :: {excludeItem, wxGBSizerItem:wxGBSizerItem()}.<br />
+%%
+-spec checkForIntersection(This, Pos, Span) -> boolean() when
+ This::wxGridBagSizer(), Pos::{R::integer(), C::integer()}, Span::{RS::integer(), CS::integer()};
+ (This, Item, [Option]) -> boolean() when
+ This::wxGridBagSizer(), Item::wxGBSizerItem:wxGBSizerItem(),
+ Option :: {excludeItem, wxGBSizerItem:wxGBSizerItem()}.
checkForIntersection(This,Pos={PosR,PosC},Span={SpanRS,SpanCS})
when is_record(This, wx_ref),is_integer(PosR),is_integer(PosC),is_integer(SpanRS),is_integer(SpanCS) ->
@@ -218,9 +258,10 @@ checkForIntersection(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=Item
wxe_util:call(?wxGridBagSizer_CheckForIntersection_2,
<<ThisRef:32/?UI,ItemRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGridBagSizer(), Pos::{R::integer(), C::integer()}, Span::{RS::integer(), CS::integer()}, [Option]) -> bool()
-%% Option = {excludeItem, wxGBSizerItem:wxGBSizerItem()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizercheckforintersection">external documentation</a>.
+-spec checkForIntersection(This, Pos, Span, [Option]) -> boolean() when
+ This::wxGridBagSizer(), Pos::{R::integer(), C::integer()}, Span::{RS::integer(), CS::integer()},
+ Option :: {excludeItem, wxGBSizerItem:wxGBSizerItem()}.
checkForIntersection(#wx_ref{type=ThisT,ref=ThisRef},{PosR,PosC},{SpanRS,SpanCS}, Options)
when is_integer(PosR),is_integer(PosC),is_integer(SpanRS),is_integer(SpanCS),is_list(Options) ->
?CLASS(ThisT,wxGridBagSizer),
@@ -230,8 +271,9 @@ checkForIntersection(#wx_ref{type=ThisT,ref=ThisRef},{PosR,PosC},{SpanRS,SpanCS}
wxe_util:call(?wxGridBagSizer_CheckForIntersection_3,
<<ThisRef:32/?UI,PosR:32/?UI,PosC:32/?UI,SpanRS:32/?UI,SpanCS:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer()) -> wxGBSizerItem:wxGBSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizerfinditem">external documentation</a>.
+-spec findItem(This, Window) -> wxGBSizerItem:wxGBSizerItem() when
+ This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer().
findItem(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}) ->
?CLASS(ThisT,wxGridBagSizer),
WindowOP = case ?CLASS_T(WindowT,wxWindow) of
@@ -243,54 +285,59 @@ findItem(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}) ->
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,WindowRef:32/?UI>>).
-%% @spec (This::wxGridBagSizer(), Pt::{X::integer(), Y::integer()}) -> wxGBSizerItem:wxGBSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizerfinditematpoint">external documentation</a>.
+-spec findItemAtPoint(This, Pt) -> wxGBSizerItem:wxGBSizerItem() when
+ This::wxGridBagSizer(), Pt::{X::integer(), Y::integer()}.
findItemAtPoint(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxGridBagSizer),
wxe_util:call(?wxGridBagSizer_FindItemAtPoint,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxGridBagSizer(), Pos::{R::integer(), C::integer()}) -> wxGBSizerItem:wxGBSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizerfinditematposition">external documentation</a>.
+-spec findItemAtPosition(This, Pos) -> wxGBSizerItem:wxGBSizerItem() when
+ This::wxGridBagSizer(), Pos::{R::integer(), C::integer()}.
findItemAtPosition(#wx_ref{type=ThisT,ref=ThisRef},{PosR,PosC})
when is_integer(PosR),is_integer(PosC) ->
?CLASS(ThisT,wxGridBagSizer),
wxe_util:call(?wxGridBagSizer_FindItemAtPosition,
<<ThisRef:32/?UI,PosR:32/?UI,PosC:32/?UI>>).
-%% @spec (This::wxGridBagSizer(), UserData::wx:wx()) -> wxGBSizerItem:wxGBSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizerfinditemwithdata">external documentation</a>.
+-spec findItemWithData(This, UserData) -> wxGBSizerItem:wxGBSizerItem() when
+ This::wxGridBagSizer(), UserData::wx:wx_object().
findItemWithData(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=UserDataT,ref=UserDataRef}) ->
?CLASS(ThisT,wxGridBagSizer),
?CLASS(UserDataT,wx),
wxe_util:call(?wxGridBagSizer_FindItemWithData,
<<ThisRef:32/?UI,UserDataRef:32/?UI>>).
-%% @spec (This::wxGridBagSizer(), Row::integer(), Col::integer()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizergetcellsize">external documentation</a>.
+-spec getCellSize(This, Row, Col) -> {W::integer(), H::integer()} when
+ This::wxGridBagSizer(), Row::integer(), Col::integer().
getCellSize(#wx_ref{type=ThisT,ref=ThisRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGridBagSizer),
wxe_util:call(?wxGridBagSizer_GetCellSize,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGridBagSizer()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizergetemptycellsize">external documentation</a>.
+-spec getEmptyCellSize(This) -> {W::integer(), H::integer()} when
+ This::wxGridBagSizer().
getEmptyCellSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridBagSizer),
wxe_util:call(?wxGridBagSizer_GetEmptyCellSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridBagSizer(),X::integer()|term()) -> {R::integer(), C::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizergetitemposition">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% getItemPosition(This::wxGridBagSizer(), Index::integer()) -> {R::integer(), C::integer()} </c>
-%% </p>
-%% <p><c>
-%% getItemPosition(This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer()) -> {R::integer(), C::integer()} </c>
-%% </p>
+%% <br /> Also:<br />
+%% getItemPosition(This, Window) -> {R::integer(), C::integer()} when<br />
+%% This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer().<br />
+%%
+-spec getItemPosition(This, Index) -> {R::integer(), C::integer()} when
+ This::wxGridBagSizer(), Index::integer();
+ (This, Window) -> {R::integer(), C::integer()} when
+ This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer().
getItemPosition(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxGridBagSizer),
@@ -307,15 +354,15 @@ getItemPosition(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowR
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,WindowRef:32/?UI>>).
-%% @spec (This::wxGridBagSizer(),X::integer()|term()) -> {RS::integer(), CS::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizergetitemspan">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% getItemSpan(This::wxGridBagSizer(), Index::integer()) -> {RS::integer(), CS::integer()} </c>
-%% </p>
-%% <p><c>
-%% getItemSpan(This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer()) -> {RS::integer(), CS::integer()} </c>
-%% </p>
+%% <br /> Also:<br />
+%% getItemSpan(This, Window) -> {RS::integer(), CS::integer()} when<br />
+%% This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer().<br />
+%%
+-spec getItemSpan(This, Index) -> {RS::integer(), CS::integer()} when
+ This::wxGridBagSizer(), Index::integer();
+ (This, Window) -> {RS::integer(), CS::integer()} when
+ This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer().
getItemSpan(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxGridBagSizer),
@@ -332,23 +379,24 @@ getItemSpan(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef})
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,WindowRef:32/?UI>>).
-%% @spec (This::wxGridBagSizer(), Sz::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizersetemptycellsize">external documentation</a>.
+-spec setEmptyCellSize(This, Sz) -> ok when
+ This::wxGridBagSizer(), Sz::{W::integer(), H::integer()}.
setEmptyCellSize(#wx_ref{type=ThisT,ref=ThisRef},{SzW,SzH})
when is_integer(SzW),is_integer(SzH) ->
?CLASS(ThisT,wxGridBagSizer),
wxe_util:cast(?wxGridBagSizer_SetEmptyCellSize,
<<ThisRef:32/?UI,SzW:32/?UI,SzH:32/?UI>>).
-%% @spec (This::wxGridBagSizer(),X::integer()|term(),Pos::{R::integer(), C::integer()}) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizersetitemposition">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setItemPosition(This::wxGridBagSizer(), Index::integer(), Pos::{R::integer(), C::integer()}) -> bool() </c>
-%% </p>
-%% <p><c>
-%% setItemPosition(This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Pos::{R::integer(), C::integer()}) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% setItemPosition(This, Window, Pos) -> boolean() when<br />
+%% This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Pos::{R::integer(), C::integer()}.<br />
+%%
+-spec setItemPosition(This, Index, Pos) -> boolean() when
+ This::wxGridBagSizer(), Index::integer(), Pos::{R::integer(), C::integer()};
+ (This, Window, Pos) -> boolean() when
+ This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Pos::{R::integer(), C::integer()}.
setItemPosition(#wx_ref{type=ThisT,ref=ThisRef},Index,{PosR,PosC})
when is_integer(Index),is_integer(PosR),is_integer(PosC) ->
?CLASS(ThisT,wxGridBagSizer),
@@ -366,15 +414,15 @@ setItemPosition(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowR
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,WindowRef:32/?UI,PosR:32/?UI,PosC:32/?UI>>).
-%% @spec (This::wxGridBagSizer(),X::integer()|term(),Span::{RS::integer(), CS::integer()}) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridbagsizer.html#wxgridbagsizersetitemspan">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setItemSpan(This::wxGridBagSizer(), Index::integer(), Span::{RS::integer(), CS::integer()}) -> bool() </c>
-%% </p>
-%% <p><c>
-%% setItemSpan(This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Span::{RS::integer(), CS::integer()}) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% setItemSpan(This, Window, Span) -> boolean() when<br />
+%% This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Span::{RS::integer(), CS::integer()}.<br />
+%%
+-spec setItemSpan(This, Index, Span) -> boolean() when
+ This::wxGridBagSizer(), Index::integer(), Span::{RS::integer(), CS::integer()};
+ (This, Window, Span) -> boolean() when
+ This::wxGridBagSizer(), Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Span::{RS::integer(), CS::integer()}.
setItemSpan(#wx_ref{type=ThisT,ref=ThisRef},Index,{SpanRS,SpanCS})
when is_integer(Index),is_integer(SpanRS),is_integer(SpanCS) ->
?CLASS(ThisT,wxGridBagSizer),
@@ -392,8 +440,8 @@ setItemSpan(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef},
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,WindowRef:32/?UI,SpanRS:32/?UI,SpanCS:32/?UI>>).
-%% @spec (This::wxGridBagSizer()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGridBagSizer()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxGridBagSizer),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxGridCellAttr.erl b/lib/wx/src/gen/wxGridCellAttr.erl
index a9a0c1fb79..f03fd99d2a 100644
--- a/lib/wx/src/gen/wxGridCellAttr.erl
+++ b/lib/wx/src/gen/wxGridCellAttr.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -33,50 +33,59 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxGridCellAttr/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxGridCellAttr(), ColText::wx:colour()) -> ok
+-type wxGridCellAttr() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrsettextcolour">external documentation</a>.
+-spec setTextColour(This, ColText) -> ok when
+ This::wxGridCellAttr(), ColText::wx:wx_colour().
setTextColour(#wx_ref{type=ThisT,ref=ThisRef},ColText)
when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4 ->
?CLASS(ThisT,wxGridCellAttr),
wxe_util:cast(?wxGridCellAttr_SetTextColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(ColText)):16/binary>>).
-%% @spec (This::wxGridCellAttr(), ColBack::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrsetbackgroundcolour">external documentation</a>.
+-spec setBackgroundColour(This, ColBack) -> ok when
+ This::wxGridCellAttr(), ColBack::wx:wx_colour().
setBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},ColBack)
when tuple_size(ColBack) =:= 3; tuple_size(ColBack) =:= 4 ->
?CLASS(ThisT,wxGridCellAttr),
wxe_util:cast(?wxGridCellAttr_SetBackgroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(ColBack)):16/binary>>).
-%% @spec (This::wxGridCellAttr(), Font::wxFont:wxFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrsetfont">external documentation</a>.
+-spec setFont(This, Font) -> ok when
+ This::wxGridCellAttr(), Font::wxFont:wxFont().
setFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}) ->
?CLASS(ThisT,wxGridCellAttr),
?CLASS(FontT,wxFont),
wxe_util:cast(?wxGridCellAttr_SetFont,
<<ThisRef:32/?UI,FontRef:32/?UI>>).
-%% @spec (This::wxGridCellAttr(), HAlign::integer(), VAlign::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrsetalignment">external documentation</a>.
+-spec setAlignment(This, HAlign, VAlign) -> ok when
+ This::wxGridCellAttr(), HAlign::integer(), VAlign::integer().
setAlignment(#wx_ref{type=ThisT,ref=ThisRef},HAlign,VAlign)
when is_integer(HAlign),is_integer(VAlign) ->
?CLASS(ThisT,wxGridCellAttr),
wxe_util:cast(?wxGridCellAttr_SetAlignment,
<<ThisRef:32/?UI,HAlign:32/?UI,VAlign:32/?UI>>).
-%% @spec (This::wxGridCellAttr()) -> ok
%% @equiv setReadOnly(This, [])
+-spec setReadOnly(This) -> ok when
+ This::wxGridCellAttr().
+
setReadOnly(This)
when is_record(This, wx_ref) ->
setReadOnly(This, []).
-%% @spec (This::wxGridCellAttr(), [Option]) -> ok
-%% Option = {isReadOnly, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrsetreadonly">external documentation</a>.
+-spec setReadOnly(This, [Option]) -> ok when
+ This::wxGridCellAttr(),
+ Option :: {isReadOnly, boolean()}.
setReadOnly(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxGridCellAttr),
@@ -86,94 +95,107 @@ setReadOnly(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxGridCellAttr_SetReadOnly,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxGridCellAttr(), Renderer::wxGridCellRenderer:wxGridCellRenderer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrsetrenderer">external documentation</a>.
+-spec setRenderer(This, Renderer) -> ok when
+ This::wxGridCellAttr(), Renderer::wxGridCellRenderer:wxGridCellRenderer().
setRenderer(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=RendererT,ref=RendererRef}) ->
?CLASS(ThisT,wxGridCellAttr),
?CLASS(RendererT,wxGridCellRenderer),
wxe_util:cast(?wxGridCellAttr_SetRenderer,
<<ThisRef:32/?UI,RendererRef:32/?UI>>).
-%% @spec (This::wxGridCellAttr(), Editor::wxGridCellEditor:wxGridCellEditor()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrseteditor">external documentation</a>.
+-spec setEditor(This, Editor) -> ok when
+ This::wxGridCellAttr(), Editor::wxGridCellEditor:wxGridCellEditor().
setEditor(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=EditorT,ref=EditorRef}) ->
?CLASS(ThisT,wxGridCellAttr),
?CLASS(EditorT,wxGridCellEditor),
wxe_util:cast(?wxGridCellAttr_SetEditor,
<<ThisRef:32/?UI,EditorRef:32/?UI>>).
-%% @spec (This::wxGridCellAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrhastextcolour">external documentation</a>.
+-spec hasTextColour(This) -> boolean() when
+ This::wxGridCellAttr().
hasTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellAttr),
wxe_util:call(?wxGridCellAttr_HasTextColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrhasbackgroundcolour">external documentation</a>.
+-spec hasBackgroundColour(This) -> boolean() when
+ This::wxGridCellAttr().
hasBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellAttr),
wxe_util:call(?wxGridCellAttr_HasBackgroundColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrhasfont">external documentation</a>.
+-spec hasFont(This) -> boolean() when
+ This::wxGridCellAttr().
hasFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellAttr),
wxe_util:call(?wxGridCellAttr_HasFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrhasalignment">external documentation</a>.
+-spec hasAlignment(This) -> boolean() when
+ This::wxGridCellAttr().
hasAlignment(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellAttr),
wxe_util:call(?wxGridCellAttr_HasAlignment,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrhasrenderer">external documentation</a>.
+-spec hasRenderer(This) -> boolean() when
+ This::wxGridCellAttr().
hasRenderer(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellAttr),
wxe_util:call(?wxGridCellAttr_HasRenderer,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrhaseditor">external documentation</a>.
+-spec hasEditor(This) -> boolean() when
+ This::wxGridCellAttr().
hasEditor(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellAttr),
wxe_util:call(?wxGridCellAttr_HasEditor,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellAttr()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrgettextcolour">external documentation</a>.
+-spec getTextColour(This) -> wx:wx_colour4() when
+ This::wxGridCellAttr().
getTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellAttr),
wxe_util:call(?wxGridCellAttr_GetTextColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellAttr()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrgetbackgroundcolour">external documentation</a>.
+-spec getBackgroundColour(This) -> wx:wx_colour4() when
+ This::wxGridCellAttr().
getBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellAttr),
wxe_util:call(?wxGridCellAttr_GetBackgroundColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellAttr()) -> wxFont:wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrgetfont">external documentation</a>.
+-spec getFont(This) -> wxFont:wxFont() when
+ This::wxGridCellAttr().
getFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellAttr),
wxe_util:call(?wxGridCellAttr_GetFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellAttr()) -> {HAlign::integer(), VAlign::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrgetalignment">external documentation</a>.
+-spec getAlignment(This) -> {HAlign::integer(), VAlign::integer()} when
+ This::wxGridCellAttr().
getAlignment(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellAttr),
wxe_util:call(?wxGridCellAttr_GetAlignment,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellAttr(), Grid::wxGrid:wxGrid(), Row::integer(), Col::integer()) -> wxGridCellRenderer:wxGridCellRenderer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrgetrenderer">external documentation</a>.
+-spec getRenderer(This, Grid, Row, Col) -> wxGridCellRenderer:wxGridCellRenderer() when
+ This::wxGridCellAttr(), Grid::wxGrid:wxGrid(), Row::integer(), Col::integer().
getRenderer(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=GridT,ref=GridRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGridCellAttr),
@@ -181,8 +203,9 @@ getRenderer(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=GridT,ref=GridRef},Row,
wxe_util:call(?wxGridCellAttr_GetRenderer,
<<ThisRef:32/?UI,GridRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGridCellAttr(), Grid::wxGrid:wxGrid(), Row::integer(), Col::integer()) -> wxGridCellEditor:wxGridCellEditor()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrgeteditor">external documentation</a>.
+-spec getEditor(This, Grid, Row, Col) -> wxGridCellEditor:wxGridCellEditor() when
+ This::wxGridCellAttr(), Grid::wxGrid:wxGrid(), Row::integer(), Col::integer().
getEditor(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=GridT,ref=GridRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGridCellAttr),
@@ -190,15 +213,17 @@ getEditor(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=GridT,ref=GridRef},Row,Co
wxe_util:call(?wxGridCellAttr_GetEditor,
<<ThisRef:32/?UI,GridRef:32/?UI,Row:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxGridCellAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrisreadonly">external documentation</a>.
+-spec isReadOnly(This) -> boolean() when
+ This::wxGridCellAttr().
isReadOnly(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellAttr),
wxe_util:call(?wxGridCellAttr_IsReadOnly,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellAttr(), DefAttr::wxGridCellAttr()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellattr.html#wxgridcellattrsetdefattr">external documentation</a>.
+-spec setDefAttr(This, DefAttr) -> ok when
+ This::wxGridCellAttr(), DefAttr::wxGridCellAttr().
setDefAttr(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DefAttrT,ref=DefAttrRef}) ->
?CLASS(ThisT,wxGridCellAttr),
?CLASS(DefAttrT,wxGridCellAttr),
diff --git a/lib/wx/src/gen/wxGridCellBoolEditor.erl b/lib/wx/src/gen/wxGridCellBoolEditor.erl
index a54cfe5eab..533554cd54 100644
--- a/lib/wx/src/gen/wxGridCellBoolEditor.erl
+++ b/lib/wx/src/gen/wxGridCellBoolEditor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -33,32 +33,37 @@
-export([beginEdit/4,endEdit/4,handleReturn/2,isCreated/1,paintBackground/3,
parent_class/1,reset/1,setSize/2,show/2,show/3,startingClick/1,startingKey/2]).
+-export_type([wxGridCellBoolEditor/0]).
%% @hidden
parent_class(wxGridCellEditor) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxGridCellBoolEditor()
+-type wxGridCellBoolEditor() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellbooleditor.html#wxgridcellbooleditorwxgridcellbooleditor">external documentation</a>.
+-spec new() -> wxGridCellBoolEditor().
new() ->
wxe_util:construct(?wxGridCellBoolEditor_new,
<<>>).
-%% @spec (Value::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellbooleditor.html#wxgridcellbooleditoristruevalue">external documentation</a>.
+-spec isTrueValue(Value) -> boolean() when
+ Value::unicode:chardata().
isTrueValue(Value)
when is_list(Value) ->
Value_UC = unicode:characters_to_binary([Value,0]),
wxe_util:call(?wxGridCellBoolEditor_IsTrueValue,
<<(byte_size(Value_UC)):32/?UI,(Value_UC)/binary, 0:(((8- ((4+byte_size(Value_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec () -> ok
%% @equiv useStringValues([])
+-spec useStringValues() -> ok.
+
useStringValues() ->
useStringValues([]).
-%% @spec ([Option]) -> ok
-%% Option = {valueTrue, string()} | {valueFalse, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellbooleditor.html#wxgridcellbooleditorusestringvalues">external documentation</a>.
+-spec useStringValues([Option]) -> ok when
+ Option :: {valueTrue, unicode:chardata()}
+ | {valueFalse, unicode:chardata()}.
useStringValues(Options)
when is_list(Options) ->
MOpts = fun({valueTrue, ValueTrue}, Acc) -> ValueTrue_UC = unicode:characters_to_binary([ValueTrue,0]),[<<1:32/?UI,(byte_size(ValueTrue_UC)):32/?UI,(ValueTrue_UC)/binary, 0:(((8- ((0+byte_size(ValueTrue_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
@@ -68,8 +73,8 @@ useStringValues(Options)
wxe_util:cast(?wxGridCellBoolEditor_UseStringValues,
<<BinOpt/binary>>).
-%% @spec (This::wxGridCellBoolEditor()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGridCellBoolEditor()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxGridCellBoolEditor),
wxe_util:destroy(?wxGridCellBoolEditor_destroy,Obj),
diff --git a/lib/wx/src/gen/wxGridCellBoolRenderer.erl b/lib/wx/src/gen/wxGridCellBoolRenderer.erl
index a98091f62c..834f00a623 100644
--- a/lib/wx/src/gen/wxGridCellBoolRenderer.erl
+++ b/lib/wx/src/gen/wxGridCellBoolRenderer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -32,18 +32,20 @@
%% inherited exports
-export([draw/8,getBestSize/6,parent_class/1]).
+-export_type([wxGridCellBoolRenderer/0]).
%% @hidden
parent_class(wxGridCellRenderer) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxGridCellBoolRenderer()
+-type wxGridCellBoolRenderer() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellboolrenderer.html#wxgridcellboolrendererwxgridcellboolrenderer">external documentation</a>.
+-spec new() -> wxGridCellBoolRenderer().
new() ->
wxe_util:construct(?wxGridCellBoolRenderer_new,
<<>>).
-%% @spec (This::wxGridCellBoolRenderer()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGridCellBoolRenderer()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxGridCellBoolRenderer),
wxe_util:destroy(?wxGridCellBoolRenderer_destroy,Obj),
diff --git a/lib/wx/src/gen/wxGridCellChoiceEditor.erl b/lib/wx/src/gen/wxGridCellChoiceEditor.erl
index 1adee550f8..6b037e01b3 100644
--- a/lib/wx/src/gen/wxGridCellChoiceEditor.erl
+++ b/lib/wx/src/gen/wxGridCellChoiceEditor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -33,19 +33,24 @@
-export([beginEdit/4,endEdit/4,handleReturn/2,isCreated/1,paintBackground/3,
parent_class/1,reset/1,setSize/2,show/2,show/3,startingClick/1,startingKey/2]).
+-export_type([wxGridCellChoiceEditor/0]).
%% @hidden
parent_class(wxGridCellEditor) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Choices::[[string()]]) -> wxGridCellChoiceEditor()
+-type wxGridCellChoiceEditor() :: wx:wx_object().
%% @equiv new(Choices, [])
+-spec new(Choices) -> wxGridCellChoiceEditor() when
+ Choices::[unicode:chardata()].
+
new(Choices)
when is_list(Choices) ->
new(Choices, []).
-%% @spec (Choices::[[string()]], [Option]) -> wxGridCellChoiceEditor()
-%% Option = {allowOthers, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellchoiceeditor.html#wxgridcellchoiceeditorwxgridcellchoiceeditor">external documentation</a>.
+-spec new(Choices, [Option]) -> wxGridCellChoiceEditor() when
+ Choices::[unicode:chardata()],
+ Option :: {allowOthers, boolean()}.
new(Choices, Options)
when is_list(Choices),is_list(Options) ->
Choices_UCA = [unicode:characters_to_binary([ChoicesTemp,0]) ||
@@ -56,8 +61,9 @@ new(Choices, Options)
wxe_util:construct(?wxGridCellChoiceEditor_new,
<<(length(Choices_UCA)):32/?UI, (<< <<(byte_size(UC_Str)):32/?UI, UC_Str/binary>>|| UC_Str <- Choices_UCA>>)/binary, 0:(((8- ((4 + lists:sum([byte_size(S)+4||S<-Choices_UCA])) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxGridCellChoiceEditor(), Params::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellchoiceeditor.html#wxgridcellchoiceeditorsetparameters">external documentation</a>.
+-spec setParameters(This, Params) -> ok when
+ This::wxGridCellChoiceEditor(), Params::unicode:chardata().
setParameters(#wx_ref{type=ThisT,ref=ThisRef},Params)
when is_list(Params) ->
?CLASS(ThisT,wxGridCellChoiceEditor),
@@ -65,8 +71,8 @@ setParameters(#wx_ref{type=ThisT,ref=ThisRef},Params)
wxe_util:cast(?wxGridCellChoiceEditor_SetParameters,
<<ThisRef:32/?UI,(byte_size(Params_UC)):32/?UI,(Params_UC)/binary, 0:(((8- ((0+byte_size(Params_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGridCellChoiceEditor()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGridCellChoiceEditor()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxGridCellChoiceEditor),
wxe_util:destroy(?wxGridCellChoiceEditor_destroy,Obj),
diff --git a/lib/wx/src/gen/wxGridCellEditor.erl b/lib/wx/src/gen/wxGridCellEditor.erl
index de1ebc5a4c..e84cdeb49a 100644
--- a/lib/wx/src/gen/wxGridCellEditor.erl
+++ b/lib/wx/src/gen/wxGridCellEditor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -30,11 +30,14 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxGridCellEditor/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxGridCellEditor(), Parent::wxWindow:wxWindow(), Id::integer(), EvtHandler::wxEvtHandler:wxEvtHandler()) -> ok
+-type wxGridCellEditor() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcelleditor.html#wxgridcelleditorcreate">external documentation</a>.
+-spec create(This, Parent, Id, EvtHandler) -> ok when
+ This::wxGridCellEditor(), Parent::wxWindow:wxWindow(), Id::integer(), EvtHandler::wxEvtHandler:wxEvtHandler().
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,#wx_ref{type=EvtHandlerT,ref=EvtHandlerRef})
when is_integer(Id) ->
?CLASS(ThisT,wxGridCellEditor),
@@ -43,30 +46,35 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,#w
wxe_util:cast(?wxGridCellEditor_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,EvtHandlerRef:32/?UI>>).
-%% @spec (This::wxGridCellEditor()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcelleditor.html#wxgridcelleditoriscreated">external documentation</a>.
+-spec isCreated(This) -> boolean() when
+ This::wxGridCellEditor().
isCreated(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellEditor),
wxe_util:call(?wxGridCellEditor_IsCreated,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellEditor(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcelleditor.html#wxgridcelleditorsetsize">external documentation</a>.
+-spec setSize(This, Rect) -> ok when
+ This::wxGridCellEditor(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
setSize(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) ->
?CLASS(ThisT,wxGridCellEditor),
wxe_util:cast(?wxGridCellEditor_SetSize,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxGridCellEditor(), Show::bool()) -> ok
%% @equiv show(This,Show, [])
+-spec show(This, Show) -> ok when
+ This::wxGridCellEditor(), Show::boolean().
+
show(This,Show)
when is_record(This, wx_ref),is_boolean(Show) ->
show(This,Show, []).
-%% @spec (This::wxGridCellEditor(), Show::bool(), [Option]) -> ok
-%% Option = {attr, wxGridCellAttr:wxGridCellAttr()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcelleditor.html#wxgridcelleditorshow">external documentation</a>.
+-spec show(This, Show, [Option]) -> ok when
+ This::wxGridCellEditor(), Show::boolean(),
+ Option :: {attr, wxGridCellAttr:wxGridCellAttr()}.
show(#wx_ref{type=ThisT,ref=ThisRef},Show, Options)
when is_boolean(Show),is_list(Options) ->
?CLASS(ThisT,wxGridCellEditor),
@@ -76,8 +84,9 @@ show(#wx_ref{type=ThisT,ref=ThisRef},Show, Options)
wxe_util:cast(?wxGridCellEditor_Show,
<<ThisRef:32/?UI,(wxe_util:from_bool(Show)):32/?UI, BinOpt/binary>>).
-%% @spec (This::wxGridCellEditor(), RectCell::{X::integer(), Y::integer(), W::integer(), H::integer()}, Attr::wxGridCellAttr:wxGridCellAttr()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcelleditor.html#wxgridcelleditorpaintbackground">external documentation</a>.
+-spec paintBackground(This, RectCell, Attr) -> ok when
+ This::wxGridCellEditor(), RectCell::{X::integer(), Y::integer(), W::integer(), H::integer()}, Attr::wxGridCellAttr:wxGridCellAttr().
paintBackground(#wx_ref{type=ThisT,ref=ThisRef},{RectCellX,RectCellY,RectCellW,RectCellH},#wx_ref{type=AttrT,ref=AttrRef})
when is_integer(RectCellX),is_integer(RectCellY),is_integer(RectCellW),is_integer(RectCellH) ->
?CLASS(ThisT,wxGridCellEditor),
@@ -85,8 +94,9 @@ paintBackground(#wx_ref{type=ThisT,ref=ThisRef},{RectCellX,RectCellY,RectCellW,R
wxe_util:cast(?wxGridCellEditor_PaintBackground,
<<ThisRef:32/?UI,RectCellX:32/?UI,RectCellY:32/?UI,RectCellW:32/?UI,RectCellH:32/?UI,AttrRef:32/?UI>>).
-%% @spec (This::wxGridCellEditor(), Row::integer(), Col::integer(), Grid::wxGrid:wxGrid()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcelleditor.html#wxgridcelleditorbeginedit">external documentation</a>.
+-spec beginEdit(This, Row, Col, Grid) -> ok when
+ This::wxGridCellEditor(), Row::integer(), Col::integer(), Grid::wxGrid:wxGrid().
beginEdit(#wx_ref{type=ThisT,ref=ThisRef},Row,Col,#wx_ref{type=GridT,ref=GridRef})
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGridCellEditor),
@@ -94,8 +104,9 @@ beginEdit(#wx_ref{type=ThisT,ref=ThisRef},Row,Col,#wx_ref{type=GridT,ref=GridRef
wxe_util:cast(?wxGridCellEditor_BeginEdit,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI,GridRef:32/?UI>>).
-%% @spec (This::wxGridCellEditor(), Row::integer(), Col::integer(), Grid::wxGrid:wxGrid()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcelleditor.html#wxgridcelleditorendedit">external documentation</a>.
+-spec endEdit(This, Row, Col, Grid) -> boolean() when
+ This::wxGridCellEditor(), Row::integer(), Col::integer(), Grid::wxGrid:wxGrid().
endEdit(#wx_ref{type=ThisT,ref=ThisRef},Row,Col,#wx_ref{type=GridT,ref=GridRef})
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGridCellEditor),
@@ -103,30 +114,34 @@ endEdit(#wx_ref{type=ThisT,ref=ThisRef},Row,Col,#wx_ref{type=GridT,ref=GridRef})
wxe_util:call(?wxGridCellEditor_EndEdit,
<<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI,GridRef:32/?UI>>).
-%% @spec (This::wxGridCellEditor()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcelleditor.html#wxgridcelleditorreset">external documentation</a>.
+-spec reset(This) -> ok when
+ This::wxGridCellEditor().
reset(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellEditor),
wxe_util:cast(?wxGridCellEditor_Reset,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellEditor(), Event::wxKeyEvent:wxKeyEvent()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcelleditor.html#wxgridcelleditorstartingkey">external documentation</a>.
+-spec startingKey(This, Event) -> ok when
+ This::wxGridCellEditor(), Event::wxKeyEvent:wxKeyEvent().
startingKey(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=EventT,ref=EventRef}) ->
?CLASS(ThisT,wxGridCellEditor),
?CLASS(EventT,wxKeyEvent),
wxe_util:cast(?wxGridCellEditor_StartingKey,
<<ThisRef:32/?UI,EventRef:32/?UI>>).
-%% @spec (This::wxGridCellEditor()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcelleditor.html#wxgridcelleditorstartingclick">external documentation</a>.
+-spec startingClick(This) -> ok when
+ This::wxGridCellEditor().
startingClick(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellEditor),
wxe_util:cast(?wxGridCellEditor_StartingClick,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellEditor(), Event::wxKeyEvent:wxKeyEvent()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcelleditor.html#wxgridcelleditorhandlereturn">external documentation</a>.
+-spec handleReturn(This, Event) -> ok when
+ This::wxGridCellEditor(), Event::wxKeyEvent:wxKeyEvent().
handleReturn(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=EventT,ref=EventRef}) ->
?CLASS(ThisT,wxGridCellEditor),
?CLASS(EventT,wxKeyEvent),
diff --git a/lib/wx/src/gen/wxGridCellFloatEditor.erl b/lib/wx/src/gen/wxGridCellFloatEditor.erl
index 3caad74f0e..f6b7dce15e 100644
--- a/lib/wx/src/gen/wxGridCellFloatEditor.erl
+++ b/lib/wx/src/gen/wxGridCellFloatEditor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -33,18 +33,22 @@
-export([beginEdit/4,endEdit/4,handleReturn/2,isCreated/1,paintBackground/3,
parent_class/1,reset/1,setSize/2,show/2,show/3,startingClick/1,startingKey/2]).
+-export_type([wxGridCellFloatEditor/0]).
%% @hidden
parent_class(wxGridCellEditor) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxGridCellFloatEditor()
+-type wxGridCellFloatEditor() :: wx:wx_object().
%% @equiv new([])
+-spec new() -> wxGridCellFloatEditor().
+
new() ->
new([]).
-%% @spec ([Option]) -> wxGridCellFloatEditor()
-%% Option = {width, integer()} | {precision, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellfloateditor.html#wxgridcellfloateditorwxgridcellfloateditor">external documentation</a>.
+-spec new([Option]) -> wxGridCellFloatEditor() when
+ Option :: {width, integer()}
+ | {precision, integer()}.
new(Options)
when is_list(Options) ->
MOpts = fun({width, Width}, Acc) -> [<<1:32/?UI,Width:32/?UI>>|Acc];
@@ -54,8 +58,9 @@ new(Options)
wxe_util:construct(?wxGridCellFloatEditor_new,
<<BinOpt/binary>>).
-%% @spec (This::wxGridCellFloatEditor(), Params::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellfloateditor.html#wxgridcellfloateditorsetparameters">external documentation</a>.
+-spec setParameters(This, Params) -> ok when
+ This::wxGridCellFloatEditor(), Params::unicode:chardata().
setParameters(#wx_ref{type=ThisT,ref=ThisRef},Params)
when is_list(Params) ->
?CLASS(ThisT,wxGridCellFloatEditor),
@@ -63,8 +68,8 @@ setParameters(#wx_ref{type=ThisT,ref=ThisRef},Params)
wxe_util:cast(?wxGridCellFloatEditor_SetParameters,
<<ThisRef:32/?UI,(byte_size(Params_UC)):32/?UI,(Params_UC)/binary, 0:(((8- ((0+byte_size(Params_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGridCellFloatEditor()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGridCellFloatEditor()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxGridCellFloatEditor),
wxe_util:destroy(?wxGridCellFloatEditor_destroy,Obj),
diff --git a/lib/wx/src/gen/wxGridCellFloatRenderer.erl b/lib/wx/src/gen/wxGridCellFloatRenderer.erl
index 84ffd21b37..c090a60e74 100644
--- a/lib/wx/src/gen/wxGridCellFloatRenderer.erl
+++ b/lib/wx/src/gen/wxGridCellFloatRenderer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -34,19 +34,23 @@
%% inherited exports
-export([draw/8,getBestSize/6,parent_class/1]).
+-export_type([wxGridCellFloatRenderer/0]).
%% @hidden
parent_class(wxGridCellStringRenderer) -> true;
parent_class(wxGridCellRenderer) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxGridCellFloatRenderer()
+-type wxGridCellFloatRenderer() :: wx:wx_object().
%% @equiv new([])
+-spec new() -> wxGridCellFloatRenderer().
+
new() ->
new([]).
-%% @spec ([Option]) -> wxGridCellFloatRenderer()
-%% Option = {width, integer()} | {precision, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellfloatrenderer.html#wxgridcellfloatrendererwxgridcellfloatrenderer">external documentation</a>.
+-spec new([Option]) -> wxGridCellFloatRenderer() when
+ Option :: {width, integer()}
+ | {precision, integer()}.
new(Options)
when is_list(Options) ->
MOpts = fun({width, Width}, Acc) -> [<<1:32/?UI,Width:32/?UI>>|Acc];
@@ -56,22 +60,25 @@ new(Options)
wxe_util:construct(?wxGridCellFloatRenderer_new,
<<BinOpt/binary>>).
-%% @spec (This::wxGridCellFloatRenderer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellfloatrenderer.html#wxgridcellfloatrenderergetprecision">external documentation</a>.
+-spec getPrecision(This) -> integer() when
+ This::wxGridCellFloatRenderer().
getPrecision(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellFloatRenderer),
wxe_util:call(?wxGridCellFloatRenderer_GetPrecision,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellFloatRenderer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellfloatrenderer.html#wxgridcellfloatrenderergetwidth">external documentation</a>.
+-spec getWidth(This) -> integer() when
+ This::wxGridCellFloatRenderer().
getWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellFloatRenderer),
wxe_util:call(?wxGridCellFloatRenderer_GetWidth,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellFloatRenderer(), Params::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellfloatrenderer.html#wxgridcellfloatrenderersetparameters">external documentation</a>.
+-spec setParameters(This, Params) -> ok when
+ This::wxGridCellFloatRenderer(), Params::unicode:chardata().
setParameters(#wx_ref{type=ThisT,ref=ThisRef},Params)
when is_list(Params) ->
?CLASS(ThisT,wxGridCellFloatRenderer),
@@ -79,24 +86,26 @@ setParameters(#wx_ref{type=ThisT,ref=ThisRef},Params)
wxe_util:cast(?wxGridCellFloatRenderer_SetParameters,
<<ThisRef:32/?UI,(byte_size(Params_UC)):32/?UI,(Params_UC)/binary, 0:(((8- ((0+byte_size(Params_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGridCellFloatRenderer(), Precision::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellfloatrenderer.html#wxgridcellfloatrenderersetprecision">external documentation</a>.
+-spec setPrecision(This, Precision) -> ok when
+ This::wxGridCellFloatRenderer(), Precision::integer().
setPrecision(#wx_ref{type=ThisT,ref=ThisRef},Precision)
when is_integer(Precision) ->
?CLASS(ThisT,wxGridCellFloatRenderer),
wxe_util:cast(?wxGridCellFloatRenderer_SetPrecision,
<<ThisRef:32/?UI,Precision:32/?UI>>).
-%% @spec (This::wxGridCellFloatRenderer(), Width::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellfloatrenderer.html#wxgridcellfloatrenderersetwidth">external documentation</a>.
+-spec setWidth(This, Width) -> ok when
+ This::wxGridCellFloatRenderer(), Width::integer().
setWidth(#wx_ref{type=ThisT,ref=ThisRef},Width)
when is_integer(Width) ->
?CLASS(ThisT,wxGridCellFloatRenderer),
wxe_util:cast(?wxGridCellFloatRenderer_SetWidth,
<<ThisRef:32/?UI,Width:32/?UI>>).
-%% @spec (This::wxGridCellFloatRenderer()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGridCellFloatRenderer()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxGridCellFloatRenderer),
wxe_util:destroy(?wxGridCellFloatRenderer_destroy,Obj),
diff --git a/lib/wx/src/gen/wxGridCellNumberEditor.erl b/lib/wx/src/gen/wxGridCellNumberEditor.erl
index 4ebdbb14e9..68d5670367 100644
--- a/lib/wx/src/gen/wxGridCellNumberEditor.erl
+++ b/lib/wx/src/gen/wxGridCellNumberEditor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -34,19 +34,23 @@
-export([beginEdit/4,endEdit/4,handleReturn/2,isCreated/1,paintBackground/3,
parent_class/1,reset/1,setSize/2,show/2,show/3,startingClick/1,startingKey/2]).
+-export_type([wxGridCellNumberEditor/0]).
%% @hidden
parent_class(wxGridCellTextEditor) -> true;
parent_class(wxGridCellEditor) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxGridCellNumberEditor()
+-type wxGridCellNumberEditor() :: wx:wx_object().
%% @equiv new([])
+-spec new() -> wxGridCellNumberEditor().
+
new() ->
new([]).
-%% @spec ([Option]) -> wxGridCellNumberEditor()
-%% Option = {min, integer()} | {max, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellnumbereditor.html#wxgridcellnumbereditorwxgridcellnumbereditor">external documentation</a>.
+-spec new([Option]) -> wxGridCellNumberEditor() when
+ Option :: {min, integer()}
+ | {max, integer()}.
new(Options)
when is_list(Options) ->
MOpts = fun({min, Min}, Acc) -> [<<1:32/?UI,Min:32/?UI>>|Acc];
@@ -56,15 +60,17 @@ new(Options)
wxe_util:construct(?wxGridCellNumberEditor_new,
<<BinOpt/binary>>).
-%% @spec (This::wxGridCellNumberEditor()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellnumbereditor.html#wxgridcellnumbereditorgetvalue">external documentation</a>.
+-spec getValue(This) -> unicode:charlist() when
+ This::wxGridCellNumberEditor().
getValue(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridCellNumberEditor),
wxe_util:call(?wxGridCellNumberEditor_GetValue,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridCellNumberEditor(), Params::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellnumbereditor.html#wxgridcellnumbereditorsetparameters">external documentation</a>.
+-spec setParameters(This, Params) -> ok when
+ This::wxGridCellNumberEditor(), Params::unicode:chardata().
setParameters(#wx_ref{type=ThisT,ref=ThisRef},Params)
when is_list(Params) ->
?CLASS(ThisT,wxGridCellNumberEditor),
@@ -72,8 +78,8 @@ setParameters(#wx_ref{type=ThisT,ref=ThisRef},Params)
wxe_util:cast(?wxGridCellNumberEditor_SetParameters,
<<ThisRef:32/?UI,(byte_size(Params_UC)):32/?UI,(Params_UC)/binary, 0:(((8- ((0+byte_size(Params_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGridCellNumberEditor()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGridCellNumberEditor()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxGridCellNumberEditor),
wxe_util:destroy(?wxGridCellNumberEditor_destroy,Obj),
diff --git a/lib/wx/src/gen/wxGridCellNumberRenderer.erl b/lib/wx/src/gen/wxGridCellNumberRenderer.erl
index 651057bb4b..b02b6d48c9 100644
--- a/lib/wx/src/gen/wxGridCellNumberRenderer.erl
+++ b/lib/wx/src/gen/wxGridCellNumberRenderer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -33,19 +33,21 @@
%% inherited exports
-export([draw/8,getBestSize/6,parent_class/1]).
+-export_type([wxGridCellNumberRenderer/0]).
%% @hidden
parent_class(wxGridCellStringRenderer) -> true;
parent_class(wxGridCellRenderer) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxGridCellNumberRenderer()
+-type wxGridCellNumberRenderer() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellnumberrenderer.html#wxgridcellnumberrendererwxgridcellnumberrenderer">external documentation</a>.
+-spec new() -> wxGridCellNumberRenderer().
new() ->
wxe_util:construct(?wxGridCellNumberRenderer_new,
<<>>).
-%% @spec (This::wxGridCellNumberRenderer()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGridCellNumberRenderer()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxGridCellNumberRenderer),
wxe_util:destroy(?wxGridCellNumberRenderer_destroy,Obj),
diff --git a/lib/wx/src/gen/wxGridCellRenderer.erl b/lib/wx/src/gen/wxGridCellRenderer.erl
index 765c116a48..42d376a347 100644
--- a/lib/wx/src/gen/wxGridCellRenderer.erl
+++ b/lib/wx/src/gen/wxGridCellRenderer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,11 +29,14 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxGridCellRenderer/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxGridCellRenderer(), Grid::wxGrid:wxGrid(), Attr::wxGridCellAttr:wxGridCellAttr(), Dc::wxDC:wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, Row::integer(), Col::integer(), IsSelected::bool()) -> ok
+-type wxGridCellRenderer() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellrenderer.html#wxgridcellrendererdraw">external documentation</a>.
+-spec draw(This, Grid, Attr, Dc, Rect, Row, Col, IsSelected) -> ok when
+ This::wxGridCellRenderer(), Grid::wxGrid:wxGrid(), Attr::wxGridCellAttr:wxGridCellAttr(), Dc::wxDC:wxDC(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, Row::integer(), Col::integer(), IsSelected::boolean().
draw(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=GridT,ref=GridRef},#wx_ref{type=AttrT,ref=AttrRef},#wx_ref{type=DcT,ref=DcRef},{RectX,RectY,RectW,RectH},Row,Col,IsSelected)
when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH),is_integer(Row),is_integer(Col),is_boolean(IsSelected) ->
?CLASS(ThisT,wxGridCellRenderer),
@@ -43,8 +46,9 @@ draw(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=GridT,ref=GridRef},#wx_ref{typ
wxe_util:cast(?wxGridCellRenderer_Draw,
<<ThisRef:32/?UI,GridRef:32/?UI,AttrRef:32/?UI,DcRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI,Row:32/?UI,Col:32/?UI,(wxe_util:from_bool(IsSelected)):32/?UI>>).
-%% @spec (This::wxGridCellRenderer(), Grid::wxGrid:wxGrid(), Attr::wxGridCellAttr:wxGridCellAttr(), Dc::wxDC:wxDC(), Row::integer(), Col::integer()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellrenderer.html#wxgridcellrenderergetbestsize">external documentation</a>.
+-spec getBestSize(This, Grid, Attr, Dc, Row, Col) -> {W::integer(), H::integer()} when
+ This::wxGridCellRenderer(), Grid::wxGrid:wxGrid(), Attr::wxGridCellAttr:wxGridCellAttr(), Dc::wxDC:wxDC(), Row::integer(), Col::integer().
getBestSize(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=GridT,ref=GridRef},#wx_ref{type=AttrT,ref=AttrRef},#wx_ref{type=DcT,ref=DcRef},Row,Col)
when is_integer(Row),is_integer(Col) ->
?CLASS(ThisT,wxGridCellRenderer),
diff --git a/lib/wx/src/gen/wxGridCellStringRenderer.erl b/lib/wx/src/gen/wxGridCellStringRenderer.erl
index 28a79e0453..78fdf558a2 100644
--- a/lib/wx/src/gen/wxGridCellStringRenderer.erl
+++ b/lib/wx/src/gen/wxGridCellStringRenderer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -32,18 +32,20 @@
%% inherited exports
-export([draw/8,getBestSize/6,parent_class/1]).
+-export_type([wxGridCellStringRenderer/0]).
%% @hidden
parent_class(wxGridCellRenderer) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxGridCellStringRenderer()
+-type wxGridCellStringRenderer() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcellstringrenderer.html#wxgridcellstringrendererwxgridcellstringrenderer">external documentation</a>.
+-spec new() -> wxGridCellStringRenderer().
new() ->
wxe_util:construct(?wxGridCellStringRenderer_new,
<<>>).
-%% @spec (This::wxGridCellStringRenderer()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGridCellStringRenderer()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxGridCellStringRenderer),
wxe_util:destroy(?wxGridCellStringRenderer_destroy,Obj),
diff --git a/lib/wx/src/gen/wxGridCellTextEditor.erl b/lib/wx/src/gen/wxGridCellTextEditor.erl
index d9ab1dc107..44a324d5ea 100644
--- a/lib/wx/src/gen/wxGridCellTextEditor.erl
+++ b/lib/wx/src/gen/wxGridCellTextEditor.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -33,18 +33,21 @@
-export([beginEdit/4,endEdit/4,handleReturn/2,isCreated/1,paintBackground/3,
parent_class/1,reset/1,setSize/2,show/2,show/3,startingClick/1,startingKey/2]).
+-export_type([wxGridCellTextEditor/0]).
%% @hidden
parent_class(wxGridCellEditor) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxGridCellTextEditor()
+-type wxGridCellTextEditor() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcelltexteditor.html#wxgridcelltexteditorwxgridcelltexteditor">external documentation</a>.
+-spec new() -> wxGridCellTextEditor().
new() ->
wxe_util:construct(?wxGridCellTextEditor_new,
<<>>).
-%% @spec (This::wxGridCellTextEditor(), Params::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridcelltexteditor.html#wxgridcelltexteditorsetparameters">external documentation</a>.
+-spec setParameters(This, Params) -> ok when
+ This::wxGridCellTextEditor(), Params::unicode:chardata().
setParameters(#wx_ref{type=ThisT,ref=ThisRef},Params)
when is_list(Params) ->
?CLASS(ThisT,wxGridCellTextEditor),
@@ -52,8 +55,8 @@ setParameters(#wx_ref{type=ThisT,ref=ThisRef},Params)
wxe_util:cast(?wxGridCellTextEditor_SetParameters,
<<ThisRef:32/?UI,(byte_size(Params_UC)):32/?UI,(Params_UC)/binary, 0:(((8- ((0+byte_size(Params_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxGridCellTextEditor()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGridCellTextEditor()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxGridCellTextEditor),
wxe_util:destroy(?wxGridCellTextEditor_destroy,Obj),
diff --git a/lib/wx/src/gen/wxGridEvent.erl b/lib/wx/src/gen/wxGridEvent.erl
index 123088afb5..59c2ad53b5 100644
--- a/lib/wx/src/gen/wxGridEvent.erl
+++ b/lib/wx/src/gen/wxGridEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -42,63 +42,73 @@
isSelection/1,parent_class/1,resumePropagation/2,setInt/2,setString/2,
shouldPropagate/1,skip/1,skip/2,stopPropagation/1,veto/1]).
+-export_type([wxGridEvent/0]).
%% @hidden
parent_class(wxNotifyEvent) -> true;
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxGridEvent()) -> bool()
+-type wxGridEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridevent.html#wxgrideventaltdown">external documentation</a>.
+-spec altDown(This) -> boolean() when
+ This::wxGridEvent().
altDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridEvent),
wxe_util:call(?wxGridEvent_AltDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridevent.html#wxgrideventcontroldown">external documentation</a>.
+-spec controlDown(This) -> boolean() when
+ This::wxGridEvent().
controlDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridEvent),
wxe_util:call(?wxGridEvent_ControlDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridevent.html#wxgrideventgetcol">external documentation</a>.
+-spec getCol(This) -> integer() when
+ This::wxGridEvent().
getCol(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridEvent),
wxe_util:call(?wxGridEvent_GetCol,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridEvent()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridevent.html#wxgrideventgetposition">external documentation</a>.
+-spec getPosition(This) -> {X::integer(), Y::integer()} when
+ This::wxGridEvent().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridEvent),
wxe_util:call(?wxGridEvent_GetPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridevent.html#wxgrideventgetrow">external documentation</a>.
+-spec getRow(This) -> integer() when
+ This::wxGridEvent().
getRow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridEvent),
wxe_util:call(?wxGridEvent_GetRow,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridevent.html#wxgrideventmetadown">external documentation</a>.
+-spec metaDown(This) -> boolean() when
+ This::wxGridEvent().
metaDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridEvent),
wxe_util:call(?wxGridEvent_MetaDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridevent.html#wxgrideventselecting">external documentation</a>.
+-spec selecting(This) -> boolean() when
+ This::wxGridEvent().
selecting(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridEvent),
wxe_util:call(?wxGridEvent_Selecting,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridevent.html#wxgrideventshiftdown">external documentation</a>.
+-spec shiftDown(This) -> boolean() when
+ This::wxGridEvent().
shiftDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridEvent),
wxe_util:call(?wxGridEvent_ShiftDown,
diff --git a/lib/wx/src/gen/wxGridSizer.erl b/lib/wx/src/gen/wxGridSizer.erl
index fd8580c70d..10c905f041 100644
--- a/lib/wx/src/gen/wxGridSizer.erl
+++ b/lib/wx/src/gen/wxGridSizer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -41,19 +41,25 @@
setMinSize/2,setMinSize/3,setSizeHints/2,setVirtualSizeHints/2,show/2,
show/3]).
+-export_type([wxGridSizer/0]).
%% @hidden
parent_class(wxSizer) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Cols::integer()) -> wxGridSizer()
+-type wxGridSizer() :: wx:wx_object().
%% @equiv new(Cols, [])
+-spec new(Cols) -> wxGridSizer() when
+ Cols::integer().
+
new(Cols)
when is_integer(Cols) ->
new(Cols, []).
-%% @spec (Cols::integer(), [Option]) -> wxGridSizer()
-%% Option = {vgap, integer()} | {hgap, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridsizer.html#wxgridsizerwxgridsizer">external documentation</a>.
+-spec new(Cols, [Option]) -> wxGridSizer() when
+ Cols::integer(),
+ Option :: {vgap, integer()}
+ | {hgap, integer()}.
new(Cols, Options)
when is_integer(Cols),is_list(Options) ->
MOpts = fun({vgap, Vgap}, Acc) -> [<<1:32/?UI,Vgap:32/?UI>>|Acc];
@@ -63,75 +69,84 @@ new(Cols, Options)
wxe_util:construct(?wxGridSizer_new_2,
<<Cols:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (Rows::integer(), Cols::integer(), Vgap::integer(), Hgap::integer()) -> wxGridSizer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridsizer.html#wxgridsizerwxgridsizer">external documentation</a>.
+-spec new(Rows, Cols, Vgap, Hgap) -> wxGridSizer() when
+ Rows::integer(), Cols::integer(), Vgap::integer(), Hgap::integer().
new(Rows,Cols,Vgap,Hgap)
when is_integer(Rows),is_integer(Cols),is_integer(Vgap),is_integer(Hgap) ->
wxe_util:construct(?wxGridSizer_new_4,
<<Rows:32/?UI,Cols:32/?UI,Vgap:32/?UI,Hgap:32/?UI>>).
-%% @spec (This::wxGridSizer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridsizer.html#wxgridsizergetcols">external documentation</a>.
+-spec getCols(This) -> integer() when
+ This::wxGridSizer().
getCols(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridSizer),
wxe_util:call(?wxGridSizer_GetCols,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridSizer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridsizer.html#wxgridsizergethgap">external documentation</a>.
+-spec getHGap(This) -> integer() when
+ This::wxGridSizer().
getHGap(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridSizer),
wxe_util:call(?wxGridSizer_GetHGap,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridSizer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridsizer.html#wxgridsizergetrows">external documentation</a>.
+-spec getRows(This) -> integer() when
+ This::wxGridSizer().
getRows(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridSizer),
wxe_util:call(?wxGridSizer_GetRows,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridSizer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridsizer.html#wxgridsizergetvgap">external documentation</a>.
+-spec getVGap(This) -> integer() when
+ This::wxGridSizer().
getVGap(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxGridSizer),
wxe_util:call(?wxGridSizer_GetVGap,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxGridSizer(), Cols::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridsizer.html#wxgridsizersetcols">external documentation</a>.
+-spec setCols(This, Cols) -> ok when
+ This::wxGridSizer(), Cols::integer().
setCols(#wx_ref{type=ThisT,ref=ThisRef},Cols)
when is_integer(Cols) ->
?CLASS(ThisT,wxGridSizer),
wxe_util:cast(?wxGridSizer_SetCols,
<<ThisRef:32/?UI,Cols:32/?UI>>).
-%% @spec (This::wxGridSizer(), Gap::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridsizer.html#wxgridsizersethgap">external documentation</a>.
+-spec setHGap(This, Gap) -> ok when
+ This::wxGridSizer(), Gap::integer().
setHGap(#wx_ref{type=ThisT,ref=ThisRef},Gap)
when is_integer(Gap) ->
?CLASS(ThisT,wxGridSizer),
wxe_util:cast(?wxGridSizer_SetHGap,
<<ThisRef:32/?UI,Gap:32/?UI>>).
-%% @spec (This::wxGridSizer(), Rows::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridsizer.html#wxgridsizersetrows">external documentation</a>.
+-spec setRows(This, Rows) -> ok when
+ This::wxGridSizer(), Rows::integer().
setRows(#wx_ref{type=ThisT,ref=ThisRef},Rows)
when is_integer(Rows) ->
?CLASS(ThisT,wxGridSizer),
wxe_util:cast(?wxGridSizer_SetRows,
<<ThisRef:32/?UI,Rows:32/?UI>>).
-%% @spec (This::wxGridSizer(), Gap::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxgridsizer.html#wxgridsizersetvgap">external documentation</a>.
+-spec setVGap(This, Gap) -> ok when
+ This::wxGridSizer(), Gap::integer().
setVGap(#wx_ref{type=ThisT,ref=ThisRef},Gap)
when is_integer(Gap) ->
?CLASS(ThisT,wxGridSizer),
wxe_util:cast(?wxGridSizer_SetVGap,
<<ThisRef:32/?UI,Gap:32/?UI>>).
-%% @spec (This::wxGridSizer()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxGridSizer()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxGridSizer),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxHelpEvent.erl b/lib/wx/src/gen/wxHelpEvent.erl
index b80903c314..70da136be8 100644
--- a/lib/wx/src/gen/wxHelpEvent.erl
+++ b/lib/wx/src/gen/wxHelpEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,38 +37,42 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxHelpEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxHelpEvent()) -> Origin
-%% Origin = integer()
+-type wxHelpEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhelpevent.html#wxhelpeventgetorigin">external documentation</a>.
-%%<br /> Origin is one of ?wxHelpEvent_Origin_Unknown | ?wxHelpEvent_Origin_Keyboard | ?wxHelpEvent_Origin_HelpButton
+%%<br /> Res = ?wxHelpEvent_Origin_Unknown | ?wxHelpEvent_Origin_Keyboard | ?wxHelpEvent_Origin_HelpButton
+-spec getOrigin(This) -> wx:wx_enum() when
+ This::wxHelpEvent().
getOrigin(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHelpEvent),
wxe_util:call(?wxHelpEvent_GetOrigin,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHelpEvent()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhelpevent.html#wxhelpeventgetposition">external documentation</a>.
+-spec getPosition(This) -> {X::integer(), Y::integer()} when
+ This::wxHelpEvent().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHelpEvent),
wxe_util:call(?wxHelpEvent_GetPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHelpEvent(), Origin::Origin) -> ok
-%% Origin = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhelpevent.html#wxhelpeventsetorigin">external documentation</a>.
-%%<br /> Origin is one of ?wxHelpEvent_Origin_Unknown | ?wxHelpEvent_Origin_Keyboard | ?wxHelpEvent_Origin_HelpButton
+%%<br /> Origin = ?wxHelpEvent_Origin_Unknown | ?wxHelpEvent_Origin_Keyboard | ?wxHelpEvent_Origin_HelpButton
+-spec setOrigin(This, Origin) -> ok when
+ This::wxHelpEvent(), Origin::wx:wx_enum().
setOrigin(#wx_ref{type=ThisT,ref=ThisRef},Origin)
when is_integer(Origin) ->
?CLASS(ThisT,wxHelpEvent),
wxe_util:cast(?wxHelpEvent_SetOrigin,
<<ThisRef:32/?UI,Origin:32/?UI>>).
-%% @spec (This::wxHelpEvent(), Pos::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhelpevent.html#wxhelpeventsetposition">external documentation</a>.
+-spec setPosition(This, Pos) -> ok when
+ This::wxHelpEvent(), Pos::{X::integer(), Y::integer()}.
setPosition(#wx_ref{type=ThisT,ref=ThisRef},{PosX,PosY})
when is_integer(PosX),is_integer(PosY) ->
?CLASS(ThisT,wxHelpEvent),
diff --git a/lib/wx/src/gen/wxHtmlEasyPrinting.erl b/lib/wx/src/gen/wxHtmlEasyPrinting.erl
index 15d673169a..2a5506053b 100644
--- a/lib/wx/src/gen/wxHtmlEasyPrinting.erl
+++ b/lib/wx/src/gen/wxHtmlEasyPrinting.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -32,17 +32,21 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxHtmlEasyPrinting/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxHtmlEasyPrinting()
+-type wxHtmlEasyPrinting() :: wx:wx_object().
%% @equiv new([])
+-spec new() -> wxHtmlEasyPrinting().
+
new() ->
new([]).
-%% @spec ([Option]) -> wxHtmlEasyPrinting()
-%% Option = {name, string()} | {parentWindow, wxWindow:wxWindow()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingwxhtmleasyprinting">external documentation</a>.
+-spec new([Option]) -> wxHtmlEasyPrinting() when
+ Option :: {name, unicode:chardata()}
+ | {parentWindow, wxWindow:wxWindow()}.
new(Options)
when is_list(Options) ->
MOpts = fun({name, Name}, Acc) -> Name_UC = unicode:characters_to_binary([Name,0]),[<<1:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
@@ -52,22 +56,25 @@ new(Options)
wxe_util:construct(?wxHtmlEasyPrinting_new,
<<BinOpt/binary>>).
-%% @spec (This::wxHtmlEasyPrinting()) -> wxPrintData:wxPrintData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintinggetprintdata">external documentation</a>.
+-spec getPrintData(This) -> wxPrintData:wxPrintData() when
+ This::wxHtmlEasyPrinting().
getPrintData(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlEasyPrinting),
wxe_util:call(?wxHtmlEasyPrinting_GetPrintData,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHtmlEasyPrinting()) -> wxPageSetupDialogData:wxPageSetupDialogData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintinggetpagesetupdata">external documentation</a>.
+-spec getPageSetupData(This) -> wxPageSetupDialogData:wxPageSetupDialogData() when
+ This::wxHtmlEasyPrinting().
getPageSetupData(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlEasyPrinting),
wxe_util:call(?wxHtmlEasyPrinting_GetPageSetupData,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHtmlEasyPrinting(), Htmlfile::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingpreviewfile">external documentation</a>.
+-spec previewFile(This, Htmlfile) -> boolean() when
+ This::wxHtmlEasyPrinting(), Htmlfile::unicode:chardata().
previewFile(#wx_ref{type=ThisT,ref=ThisRef},Htmlfile)
when is_list(Htmlfile) ->
?CLASS(ThisT,wxHtmlEasyPrinting),
@@ -75,15 +82,18 @@ previewFile(#wx_ref{type=ThisT,ref=ThisRef},Htmlfile)
wxe_util:call(?wxHtmlEasyPrinting_PreviewFile,
<<ThisRef:32/?UI,(byte_size(Htmlfile_UC)):32/?UI,(Htmlfile_UC)/binary, 0:(((8- ((0+byte_size(Htmlfile_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxHtmlEasyPrinting(), Htmltext::string()) -> bool()
%% @equiv previewText(This,Htmltext, [])
+-spec previewText(This, Htmltext) -> boolean() when
+ This::wxHtmlEasyPrinting(), Htmltext::unicode:chardata().
+
previewText(This,Htmltext)
when is_record(This, wx_ref),is_list(Htmltext) ->
previewText(This,Htmltext, []).
-%% @spec (This::wxHtmlEasyPrinting(), Htmltext::string(), [Option]) -> bool()
-%% Option = {basepath, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingpreviewtext">external documentation</a>.
+-spec previewText(This, Htmltext, [Option]) -> boolean() when
+ This::wxHtmlEasyPrinting(), Htmltext::unicode:chardata(),
+ Option :: {basepath, unicode:chardata()}.
previewText(#wx_ref{type=ThisT,ref=ThisRef},Htmltext, Options)
when is_list(Htmltext),is_list(Options) ->
?CLASS(ThisT,wxHtmlEasyPrinting),
@@ -94,8 +104,9 @@ previewText(#wx_ref{type=ThisT,ref=ThisRef},Htmltext, Options)
wxe_util:call(?wxHtmlEasyPrinting_PreviewText,
<<ThisRef:32/?UI,(byte_size(Htmltext_UC)):32/?UI,(Htmltext_UC)/binary, 0:(((8- ((0+byte_size(Htmltext_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxHtmlEasyPrinting(), Htmlfile::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingprintfile">external documentation</a>.
+-spec printFile(This, Htmlfile) -> boolean() when
+ This::wxHtmlEasyPrinting(), Htmlfile::unicode:chardata().
printFile(#wx_ref{type=ThisT,ref=ThisRef},Htmlfile)
when is_list(Htmlfile) ->
?CLASS(ThisT,wxHtmlEasyPrinting),
@@ -103,15 +114,18 @@ printFile(#wx_ref{type=ThisT,ref=ThisRef},Htmlfile)
wxe_util:call(?wxHtmlEasyPrinting_PrintFile,
<<ThisRef:32/?UI,(byte_size(Htmlfile_UC)):32/?UI,(Htmlfile_UC)/binary, 0:(((8- ((0+byte_size(Htmlfile_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxHtmlEasyPrinting(), Htmltext::string()) -> bool()
%% @equiv printText(This,Htmltext, [])
+-spec printText(This, Htmltext) -> boolean() when
+ This::wxHtmlEasyPrinting(), Htmltext::unicode:chardata().
+
printText(This,Htmltext)
when is_record(This, wx_ref),is_list(Htmltext) ->
printText(This,Htmltext, []).
-%% @spec (This::wxHtmlEasyPrinting(), Htmltext::string(), [Option]) -> bool()
-%% Option = {basepath, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingprinttext">external documentation</a>.
+-spec printText(This, Htmltext, [Option]) -> boolean() when
+ This::wxHtmlEasyPrinting(), Htmltext::unicode:chardata(),
+ Option :: {basepath, unicode:chardata()}.
printText(#wx_ref{type=ThisT,ref=ThisRef},Htmltext, Options)
when is_list(Htmltext),is_list(Options) ->
?CLASS(ThisT,wxHtmlEasyPrinting),
@@ -122,22 +136,26 @@ printText(#wx_ref{type=ThisT,ref=ThisRef},Htmltext, Options)
wxe_util:call(?wxHtmlEasyPrinting_PrintText,
<<ThisRef:32/?UI,(byte_size(Htmltext_UC)):32/?UI,(Htmltext_UC)/binary, 0:(((8- ((0+byte_size(Htmltext_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxHtmlEasyPrinting()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingpagesetup">external documentation</a>.
+-spec pageSetup(This) -> ok when
+ This::wxHtmlEasyPrinting().
pageSetup(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlEasyPrinting),
wxe_util:cast(?wxHtmlEasyPrinting_PageSetup,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHtmlEasyPrinting(), Normal_face::string(), Fixed_face::string()) -> ok
%% @equiv setFonts(This,Normal_face,Fixed_face, [])
+-spec setFonts(This, Normal_face, Fixed_face) -> ok when
+ This::wxHtmlEasyPrinting(), Normal_face::unicode:chardata(), Fixed_face::unicode:chardata().
+
setFonts(This,Normal_face,Fixed_face)
when is_record(This, wx_ref),is_list(Normal_face),is_list(Fixed_face) ->
setFonts(This,Normal_face,Fixed_face, []).
-%% @spec (This::wxHtmlEasyPrinting(), Normal_face::string(), Fixed_face::string(), [Option]) -> ok
-%% Option = {sizes, [integer()]}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingsetfonts">external documentation</a>.
+-spec setFonts(This, Normal_face, Fixed_face, [Option]) -> ok when
+ This::wxHtmlEasyPrinting(), Normal_face::unicode:chardata(), Fixed_face::unicode:chardata(),
+ Option :: {sizes, [integer()]}.
setFonts(#wx_ref{type=ThisT,ref=ThisRef},Normal_face,Fixed_face, Options)
when is_list(Normal_face),is_list(Fixed_face),is_list(Options) ->
?CLASS(ThisT,wxHtmlEasyPrinting),
@@ -150,15 +168,18 @@ setFonts(#wx_ref{type=ThisT,ref=ThisRef},Normal_face,Fixed_face, Options)
wxe_util:cast(?wxHtmlEasyPrinting_SetFonts,
<<ThisRef:32/?UI,(byte_size(Normal_face_UC)):32/?UI,(Normal_face_UC)/binary, 0:(((8- ((0+byte_size(Normal_face_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Fixed_face_UC)):32/?UI,(Fixed_face_UC)/binary, 0:(((8- ((4+byte_size(Fixed_face_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxHtmlEasyPrinting(), Header::string()) -> ok
%% @equiv setHeader(This,Header, [])
+-spec setHeader(This, Header) -> ok when
+ This::wxHtmlEasyPrinting(), Header::unicode:chardata().
+
setHeader(This,Header)
when is_record(This, wx_ref),is_list(Header) ->
setHeader(This,Header, []).
-%% @spec (This::wxHtmlEasyPrinting(), Header::string(), [Option]) -> ok
-%% Option = {pg, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingsetheader">external documentation</a>.
+-spec setHeader(This, Header, [Option]) -> ok when
+ This::wxHtmlEasyPrinting(), Header::unicode:chardata(),
+ Option :: {pg, integer()}.
setHeader(#wx_ref{type=ThisT,ref=ThisRef},Header, Options)
when is_list(Header),is_list(Options) ->
?CLASS(ThisT,wxHtmlEasyPrinting),
@@ -169,15 +190,18 @@ setHeader(#wx_ref{type=ThisT,ref=ThisRef},Header, Options)
wxe_util:cast(?wxHtmlEasyPrinting_SetHeader,
<<ThisRef:32/?UI,(byte_size(Header_UC)):32/?UI,(Header_UC)/binary, 0:(((8- ((0+byte_size(Header_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxHtmlEasyPrinting(), Footer::string()) -> ok
%% @equiv setFooter(This,Footer, [])
+-spec setFooter(This, Footer) -> ok when
+ This::wxHtmlEasyPrinting(), Footer::unicode:chardata().
+
setFooter(This,Footer)
when is_record(This, wx_ref),is_list(Footer) ->
setFooter(This,Footer, []).
-%% @spec (This::wxHtmlEasyPrinting(), Footer::string(), [Option]) -> ok
-%% Option = {pg, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingsetfooter">external documentation</a>.
+-spec setFooter(This, Footer, [Option]) -> ok when
+ This::wxHtmlEasyPrinting(), Footer::unicode:chardata(),
+ Option :: {pg, integer()}.
setFooter(#wx_ref{type=ThisT,ref=ThisRef},Footer, Options)
when is_list(Footer),is_list(Options) ->
?CLASS(ThisT,wxHtmlEasyPrinting),
@@ -188,8 +212,8 @@ setFooter(#wx_ref{type=ThisT,ref=ThisRef},Footer, Options)
wxe_util:cast(?wxHtmlEasyPrinting_SetFooter,
<<ThisRef:32/?UI,(byte_size(Footer_UC)):32/?UI,(Footer_UC)/binary, 0:(((8- ((0+byte_size(Footer_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxHtmlEasyPrinting()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxHtmlEasyPrinting()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxHtmlEasyPrinting),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxHtmlLinkEvent.erl b/lib/wx/src/gen/wxHtmlLinkEvent.erl
index 166493ccbc..94fe670f35 100644
--- a/lib/wx/src/gen/wxHtmlLinkEvent.erl
+++ b/lib/wx/src/gen/wxHtmlLinkEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -40,13 +40,16 @@
parent_class/1,resumePropagation/2,setInt/2,setString/2,shouldPropagate/1,
skip/1,skip/2,stopPropagation/1]).
+-export_type([wxHtmlLinkEvent/0]).
%% @hidden
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxHtmlLinkEvent()) -> wx:wxHtmlLinkInfo()
+-type wxHtmlLinkEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmllinkevent.html#wxhtmllinkeventgetlinkinfo">external documentation</a>.
+-spec getLinkInfo(This) -> wx:wx_wxHtmlLinkInfo() when
+ This::wxHtmlLinkEvent().
getLinkInfo(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlLinkEvent),
wxe_util:call(?wxHtmlLinkEvent_GetLinkInfo,
diff --git a/lib/wx/src/gen/wxHtmlWindow.erl b/lib/wx/src/gen/wxHtmlWindow.erl
index 891e5481fb..4820f7d075 100644
--- a/lib/wx/src/gen/wxHtmlWindow.erl
+++ b/lib/wx/src/gen/wxHtmlWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -79,6 +79,7 @@
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
validate/1,warpPointer/3]).
+-export_type([wxHtmlWindow/0]).
%% @hidden
parent_class(wxScrolledWindow) -> true;
parent_class(wxPanel) -> true;
@@ -86,21 +87,28 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxHtmlWindow()
+-type wxHtmlWindow() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowwxhtmlwindow">external documentation</a>.
+-spec new() -> wxHtmlWindow().
new() ->
wxe_util:construct(?wxHtmlWindow_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxHtmlWindow()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxHtmlWindow() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxHtmlWindow()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowwxhtmlwindow">external documentation</a>.
+-spec new(Parent, [Option]) -> wxHtmlWindow() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -113,8 +121,9 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxHtmlWindow_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxHtmlWindow(), Source::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowappendtopage">external documentation</a>.
+-spec appendToPage(This, Source) -> boolean() when
+ This::wxHtmlWindow(), Source::unicode:chardata().
appendToPage(#wx_ref{type=ThisT,ref=ThisRef},Source)
when is_list(Source) ->
?CLASS(ThisT,wxHtmlWindow),
@@ -122,71 +131,81 @@ appendToPage(#wx_ref{type=ThisT,ref=ThisRef},Source)
wxe_util:call(?wxHtmlWindow_AppendToPage,
<<ThisRef:32/?UI,(byte_size(Source_UC)):32/?UI,(Source_UC)/binary, 0:(((8- ((0+byte_size(Source_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxHtmlWindow()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowgetopenedanchor">external documentation</a>.
+-spec getOpenedAnchor(This) -> unicode:charlist() when
+ This::wxHtmlWindow().
getOpenedAnchor(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:call(?wxHtmlWindow_GetOpenedAnchor,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHtmlWindow()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowgetopenedpage">external documentation</a>.
+-spec getOpenedPage(This) -> unicode:charlist() when
+ This::wxHtmlWindow().
getOpenedPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:call(?wxHtmlWindow_GetOpenedPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHtmlWindow()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowgetopenedpagetitle">external documentation</a>.
+-spec getOpenedPageTitle(This) -> unicode:charlist() when
+ This::wxHtmlWindow().
getOpenedPageTitle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:call(?wxHtmlWindow_GetOpenedPageTitle,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHtmlWindow()) -> wxFrame:wxFrame()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowgetrelatedframe">external documentation</a>.
+-spec getRelatedFrame(This) -> wxFrame:wxFrame() when
+ This::wxHtmlWindow().
getRelatedFrame(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:call(?wxHtmlWindow_GetRelatedFrame,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHtmlWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowhistoryback">external documentation</a>.
+-spec historyBack(This) -> boolean() when
+ This::wxHtmlWindow().
historyBack(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:call(?wxHtmlWindow_HistoryBack,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHtmlWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowhistorycanback">external documentation</a>.
+-spec historyCanBack(This) -> boolean() when
+ This::wxHtmlWindow().
historyCanBack(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:call(?wxHtmlWindow_HistoryCanBack,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHtmlWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowhistorycanforward">external documentation</a>.
+-spec historyCanForward(This) -> boolean() when
+ This::wxHtmlWindow().
historyCanForward(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:call(?wxHtmlWindow_HistoryCanForward,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHtmlWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowhistoryclear">external documentation</a>.
+-spec historyClear(This) -> ok when
+ This::wxHtmlWindow().
historyClear(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:cast(?wxHtmlWindow_HistoryClear,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHtmlWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowhistoryforward">external documentation</a>.
+-spec historyForward(This) -> boolean() when
+ This::wxHtmlWindow().
historyForward(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:call(?wxHtmlWindow_HistoryForward,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHtmlWindow(), Filename::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowloadfile">external documentation</a>.
+-spec loadFile(This, Filename) -> boolean() when
+ This::wxHtmlWindow(), Filename::unicode:chardata().
loadFile(#wx_ref{type=ThisT,ref=ThisRef},Filename)
when is_list(Filename) ->
?CLASS(ThisT,wxHtmlWindow),
@@ -194,8 +213,9 @@ loadFile(#wx_ref{type=ThisT,ref=ThisRef},Filename)
wxe_util:call(?wxHtmlWindow_LoadFile,
<<ThisRef:32/?UI,(byte_size(Filename_UC)):32/?UI,(Filename_UC)/binary, 0:(((8- ((0+byte_size(Filename_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxHtmlWindow(), Location::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowloadpage">external documentation</a>.
+-spec loadPage(This, Location) -> boolean() when
+ This::wxHtmlWindow(), Location::unicode:chardata().
loadPage(#wx_ref{type=ThisT,ref=ThisRef},Location)
when is_list(Location) ->
?CLASS(ThisT,wxHtmlWindow),
@@ -203,53 +223,61 @@ loadPage(#wx_ref{type=ThisT,ref=ThisRef},Location)
wxe_util:call(?wxHtmlWindow_LoadPage,
<<ThisRef:32/?UI,(byte_size(Location_UC)):32/?UI,(Location_UC)/binary, 0:(((8- ((0+byte_size(Location_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxHtmlWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowselectall">external documentation</a>.
+-spec selectAll(This) -> ok when
+ This::wxHtmlWindow().
selectAll(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:cast(?wxHtmlWindow_SelectAll,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHtmlWindow()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowselectiontotext">external documentation</a>.
+-spec selectionToText(This) -> unicode:charlist() when
+ This::wxHtmlWindow().
selectionToText(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:call(?wxHtmlWindow_SelectionToText,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHtmlWindow(), Pos::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowselectline">external documentation</a>.
+-spec selectLine(This, Pos) -> ok when
+ This::wxHtmlWindow(), Pos::{X::integer(), Y::integer()}.
selectLine(#wx_ref{type=ThisT,ref=ThisRef},{PosX,PosY})
when is_integer(PosX),is_integer(PosY) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:cast(?wxHtmlWindow_SelectLine,
<<ThisRef:32/?UI,PosX:32/?UI,PosY:32/?UI>>).
-%% @spec (This::wxHtmlWindow(), Pos::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowselectword">external documentation</a>.
+-spec selectWord(This, Pos) -> ok when
+ This::wxHtmlWindow(), Pos::{X::integer(), Y::integer()}.
selectWord(#wx_ref{type=ThisT,ref=ThisRef},{PosX,PosY})
when is_integer(PosX),is_integer(PosY) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:cast(?wxHtmlWindow_SelectWord,
<<ThisRef:32/?UI,PosX:32/?UI,PosY:32/?UI>>).
-%% @spec (This::wxHtmlWindow(), B::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowsetborders">external documentation</a>.
+-spec setBorders(This, B) -> ok when
+ This::wxHtmlWindow(), B::integer().
setBorders(#wx_ref{type=ThisT,ref=ThisRef},B)
when is_integer(B) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:cast(?wxHtmlWindow_SetBorders,
<<ThisRef:32/?UI,B:32/?UI>>).
-%% @spec (This::wxHtmlWindow(), Normal_face::string(), Fixed_face::string()) -> ok
%% @equiv setFonts(This,Normal_face,Fixed_face, [])
+-spec setFonts(This, Normal_face, Fixed_face) -> ok when
+ This::wxHtmlWindow(), Normal_face::unicode:chardata(), Fixed_face::unicode:chardata().
+
setFonts(This,Normal_face,Fixed_face)
when is_record(This, wx_ref),is_list(Normal_face),is_list(Fixed_face) ->
setFonts(This,Normal_face,Fixed_face, []).
-%% @spec (This::wxHtmlWindow(), Normal_face::string(), Fixed_face::string(), [Option]) -> ok
-%% Option = {sizes, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowsetfonts">external documentation</a>.
+-spec setFonts(This, Normal_face, Fixed_face, [Option]) -> ok when
+ This::wxHtmlWindow(), Normal_face::unicode:chardata(), Fixed_face::unicode:chardata(),
+ Option :: {sizes, integer()}.
setFonts(#wx_ref{type=ThisT,ref=ThisRef},Normal_face,Fixed_face, Options)
when is_list(Normal_face),is_list(Fixed_face),is_list(Options) ->
?CLASS(ThisT,wxHtmlWindow),
@@ -261,8 +289,9 @@ setFonts(#wx_ref{type=ThisT,ref=ThisRef},Normal_face,Fixed_face, Options)
wxe_util:cast(?wxHtmlWindow_SetFonts,
<<ThisRef:32/?UI,(byte_size(Normal_face_UC)):32/?UI,(Normal_face_UC)/binary, 0:(((8- ((0+byte_size(Normal_face_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Fixed_face_UC)):32/?UI,(Fixed_face_UC)/binary, 0:(((8- ((4+byte_size(Fixed_face_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxHtmlWindow(), Source::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowsetpage">external documentation</a>.
+-spec setPage(This, Source) -> boolean() when
+ This::wxHtmlWindow(), Source::unicode:chardata().
setPage(#wx_ref{type=ThisT,ref=ThisRef},Source)
when is_list(Source) ->
?CLASS(ThisT,wxHtmlWindow),
@@ -270,8 +299,9 @@ setPage(#wx_ref{type=ThisT,ref=ThisRef},Source)
wxe_util:call(?wxHtmlWindow_SetPage,
<<ThisRef:32/?UI,(byte_size(Source_UC)):32/?UI,(Source_UC)/binary, 0:(((8- ((0+byte_size(Source_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxHtmlWindow(), Frame::wxFrame:wxFrame(), Format::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowsetrelatedframe">external documentation</a>.
+-spec setRelatedFrame(This, Frame, Format) -> ok when
+ This::wxHtmlWindow(), Frame::wxFrame:wxFrame(), Format::unicode:chardata().
setRelatedFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef},Format)
when is_list(Format) ->
?CLASS(ThisT,wxHtmlWindow),
@@ -280,23 +310,25 @@ setRelatedFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef
wxe_util:cast(?wxHtmlWindow_SetRelatedFrame,
<<ThisRef:32/?UI,FrameRef:32/?UI,(byte_size(Format_UC)):32/?UI,(Format_UC)/binary, 0:(((8- ((4+byte_size(Format_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxHtmlWindow(), Bar::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowsetrelatedstatusbar">external documentation</a>.
+-spec setRelatedStatusBar(This, Bar) -> ok when
+ This::wxHtmlWindow(), Bar::integer().
setRelatedStatusBar(#wx_ref{type=ThisT,ref=ThisRef},Bar)
when is_integer(Bar) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:cast(?wxHtmlWindow_SetRelatedStatusBar,
<<ThisRef:32/?UI,Bar:32/?UI>>).
-%% @spec (This::wxHtmlWindow()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmlwindow.html#wxhtmlwindowtotext">external documentation</a>.
+-spec toText(This) -> unicode:charlist() when
+ This::wxHtmlWindow().
toText(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxHtmlWindow),
wxe_util:call(?wxHtmlWindow_ToText,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxHtmlWindow()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxHtmlWindow()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxHtmlWindow),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxIcon.erl b/lib/wx/src/gen/wxIcon.erl
index 5b224c00b6..0f31278732 100644
--- a/lib/wx/src/gen/wxIcon.erl
+++ b/lib/wx/src/gen/wxIcon.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -35,24 +35,28 @@
saveFile/3,saveFile/4,setDepth/2,setHeight/2,setMask/2,setPalette/2,
setWidth/2]).
+-export_type([wxIcon/0]).
%% @hidden
parent_class(wxBitmap) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxIcon()
+-type wxIcon() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxicon.html#wxiconwxicon">external documentation</a>.
+-spec new() -> wxIcon().
new() ->
wxe_util:construct(?wxIcon_new_0,
<<>>).
-%% @spec (X::string()|term()) -> wxIcon()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxicon.html#wxiconwxicon">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Filename::string()) -> new(Filename, []) </c></p>
-%% <p><c>
-%% new(Loc::wx:wx()) -> wxIcon() </c>
-%% </p>
+%% <br /> Also:<br />
+%% new(Loc) -> wxIcon() when<br />
+%% Loc::wx:wx_object().<br />
+%%
+%%<br /> Type = ?wxBITMAP_TYPE_INVALID | ?wxBITMAP_TYPE_BMP | ?wxBITMAP_TYPE_BMP_RESOURCE | ?wxBITMAP_TYPE_RESOURCE | ?wxBITMAP_TYPE_ICO | ?wxBITMAP_TYPE_ICO_RESOURCE | ?wxBITMAP_TYPE_CUR | ?wxBITMAP_TYPE_CUR_RESOURCE | ?wxBITMAP_TYPE_XBM | ?wxBITMAP_TYPE_XBM_DATA | ?wxBITMAP_TYPE_XPM | ?wxBITMAP_TYPE_XPM_DATA | ?wxBITMAP_TYPE_TIF | ?wxBITMAP_TYPE_TIF_RESOURCE | ?wxBITMAP_TYPE_GIF | ?wxBITMAP_TYPE_GIF_RESOURCE | ?wxBITMAP_TYPE_PNG | ?wxBITMAP_TYPE_PNG_RESOURCE | ?wxBITMAP_TYPE_JPEG | ?wxBITMAP_TYPE_JPEG_RESOURCE | ?wxBITMAP_TYPE_PNM | ?wxBITMAP_TYPE_PNM_RESOURCE | ?wxBITMAP_TYPE_PCX | ?wxBITMAP_TYPE_PCX_RESOURCE | ?wxBITMAP_TYPE_PICT | ?wxBITMAP_TYPE_PICT_RESOURCE | ?wxBITMAP_TYPE_ICON | ?wxBITMAP_TYPE_ICON_RESOURCE | ?wxBITMAP_TYPE_ANI | ?wxBITMAP_TYPE_IFF | ?wxBITMAP_TYPE_TGA | ?wxBITMAP_TYPE_MACCURSOR | ?wxBITMAP_TYPE_MACCURSOR_RESOURCE | ?wxBITMAP_TYPE_ANY
+-spec new(Filename) -> wxIcon() when
+ Filename::unicode:chardata();
+ (Loc) -> wxIcon() when
+ Loc::wx:wx_object().
new(Filename)
when is_list(Filename) ->
@@ -62,11 +66,13 @@ new(#wx_ref{type=LocT,ref=LocRef}) ->
wxe_util:construct(?wxIcon_new_1,
<<LocRef:32/?UI>>).
-%% @spec (Filename::string(), [Option]) -> wxIcon()
-%% Option = {type, WxBitmapType} | {desiredWidth, integer()} | {desiredHeight, integer()}
-%% WxBitmapType = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxicon.html#wxiconwxicon">external documentation</a>.
-%%<br /> WxBitmapType is one of ?wxBITMAP_TYPE_INVALID | ?wxBITMAP_TYPE_BMP | ?wxBITMAP_TYPE_BMP_RESOURCE | ?wxBITMAP_TYPE_RESOURCE | ?wxBITMAP_TYPE_ICO | ?wxBITMAP_TYPE_ICO_RESOURCE | ?wxBITMAP_TYPE_CUR | ?wxBITMAP_TYPE_CUR_RESOURCE | ?wxBITMAP_TYPE_XBM | ?wxBITMAP_TYPE_XBM_DATA | ?wxBITMAP_TYPE_XPM | ?wxBITMAP_TYPE_XPM_DATA | ?wxBITMAP_TYPE_TIF | ?wxBITMAP_TYPE_TIF_RESOURCE | ?wxBITMAP_TYPE_GIF | ?wxBITMAP_TYPE_GIF_RESOURCE | ?wxBITMAP_TYPE_PNG | ?wxBITMAP_TYPE_PNG_RESOURCE | ?wxBITMAP_TYPE_JPEG | ?wxBITMAP_TYPE_JPEG_RESOURCE | ?wxBITMAP_TYPE_PNM | ?wxBITMAP_TYPE_PNM_RESOURCE | ?wxBITMAP_TYPE_PCX | ?wxBITMAP_TYPE_PCX_RESOURCE | ?wxBITMAP_TYPE_PICT | ?wxBITMAP_TYPE_PICT_RESOURCE | ?wxBITMAP_TYPE_ICON | ?wxBITMAP_TYPE_ICON_RESOURCE | ?wxBITMAP_TYPE_ANI | ?wxBITMAP_TYPE_IFF | ?wxBITMAP_TYPE_TGA | ?wxBITMAP_TYPE_MACCURSOR | ?wxBITMAP_TYPE_MACCURSOR_RESOURCE | ?wxBITMAP_TYPE_ANY
+%%<br /> Type = ?wxBITMAP_TYPE_INVALID | ?wxBITMAP_TYPE_BMP | ?wxBITMAP_TYPE_BMP_RESOURCE | ?wxBITMAP_TYPE_RESOURCE | ?wxBITMAP_TYPE_ICO | ?wxBITMAP_TYPE_ICO_RESOURCE | ?wxBITMAP_TYPE_CUR | ?wxBITMAP_TYPE_CUR_RESOURCE | ?wxBITMAP_TYPE_XBM | ?wxBITMAP_TYPE_XBM_DATA | ?wxBITMAP_TYPE_XPM | ?wxBITMAP_TYPE_XPM_DATA | ?wxBITMAP_TYPE_TIF | ?wxBITMAP_TYPE_TIF_RESOURCE | ?wxBITMAP_TYPE_GIF | ?wxBITMAP_TYPE_GIF_RESOURCE | ?wxBITMAP_TYPE_PNG | ?wxBITMAP_TYPE_PNG_RESOURCE | ?wxBITMAP_TYPE_JPEG | ?wxBITMAP_TYPE_JPEG_RESOURCE | ?wxBITMAP_TYPE_PNM | ?wxBITMAP_TYPE_PNM_RESOURCE | ?wxBITMAP_TYPE_PCX | ?wxBITMAP_TYPE_PCX_RESOURCE | ?wxBITMAP_TYPE_PICT | ?wxBITMAP_TYPE_PICT_RESOURCE | ?wxBITMAP_TYPE_ICON | ?wxBITMAP_TYPE_ICON_RESOURCE | ?wxBITMAP_TYPE_ANI | ?wxBITMAP_TYPE_IFF | ?wxBITMAP_TYPE_TGA | ?wxBITMAP_TYPE_MACCURSOR | ?wxBITMAP_TYPE_MACCURSOR_RESOURCE | ?wxBITMAP_TYPE_ANY
+-spec new(Filename, [Option]) -> wxIcon() when
+ Filename::unicode:chardata(),
+ Option :: {type, wx:wx_enum()}
+ | {desiredWidth, integer()}
+ | {desiredHeight, integer()}.
new(Filename, Options)
when is_list(Filename),is_list(Options) ->
Filename_UC = unicode:characters_to_binary([Filename,0]),
@@ -78,16 +84,17 @@ new(Filename, Options)
wxe_util:construct(?wxIcon_new_2,
<<(byte_size(Filename_UC)):32/?UI,(Filename_UC)/binary, 0:(((8- ((4+byte_size(Filename_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxIcon(), Bmp::wxBitmap:wxBitmap()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxicon.html#wxiconcopyfrombitmap">external documentation</a>.
+-spec copyFromBitmap(This, Bmp) -> ok when
+ This::wxIcon(), Bmp::wxBitmap:wxBitmap().
copyFromBitmap(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BmpT,ref=BmpRef}) ->
?CLASS(ThisT,wxIcon),
?CLASS(BmpT,wxBitmap),
wxe_util:cast(?wxIcon_CopyFromBitmap,
<<ThisRef:32/?UI,BmpRef:32/?UI>>).
-%% @spec (This::wxIcon()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxIcon()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxIcon),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxIconBundle.erl b/lib/wx/src/gen/wxIconBundle.erl
index 011b2dd1ac..5e8bb7cc74 100644
--- a/lib/wx/src/gen/wxIconBundle.erl
+++ b/lib/wx/src/gen/wxIconBundle.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,17 +29,20 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxIconBundle/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxIconBundle()
+-type wxIconBundle() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxiconbundle.html#wxiconbundlewxiconbundle">external documentation</a>.
+-spec new() -> wxIconBundle().
new() ->
wxe_util:construct(?wxIconBundle_new_0,
<<>>).
-%% @spec (Ic::wxIconBundle() | wxIcon:wxIcon()) -> wxIconBundle()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxiconbundle.html#wxiconbundlewxiconbundle">external documentation</a>.
+-spec new(Ic) -> wxIconBundle() when
+ Ic::wxIconBundle() | wxIcon:wxIcon().
new(#wx_ref{type=IcT,ref=IcRef}) ->
IcOP = case ?CLASS_T(IcT,wxIconBundle) of
true ->
@@ -50,24 +53,27 @@ new(#wx_ref{type=IcT,ref=IcRef}) ->
wxe_util:construct(IcOP,
<<IcRef:32/?UI>>).
-%% @spec (File::string(), Type::integer()) -> wxIconBundle()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxiconbundle.html#wxiconbundlewxiconbundle">external documentation</a>.
+-spec new(File, Type) -> wxIconBundle() when
+ File::unicode:chardata(), Type::integer().
new(File,Type)
when is_list(File),is_integer(Type) ->
File_UC = unicode:characters_to_binary([File,0]),
wxe_util:construct(?wxIconBundle_new_2,
<<(byte_size(File_UC)):32/?UI,(File_UC)/binary, 0:(((8- ((4+byte_size(File_UC)) band 16#7)) band 16#7))/unit:8,Type:32/?UI>>).
-%% @spec (This::wxIconBundle(), Icon::wxIcon:wxIcon()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxiconbundle.html#wxiconbundleaddicon">external documentation</a>.
+-spec addIcon(This, Icon) -> ok when
+ This::wxIconBundle(), Icon::wxIcon:wxIcon().
addIcon(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=IconT,ref=IconRef}) ->
?CLASS(ThisT,wxIconBundle),
?CLASS(IconT,wxIcon),
wxe_util:cast(?wxIconBundle_AddIcon_1,
<<ThisRef:32/?UI,IconRef:32/?UI>>).
-%% @spec (This::wxIconBundle(), File::string(), Type::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxiconbundle.html#wxiconbundleaddicon">external documentation</a>.
+-spec addIcon(This, File, Type) -> ok when
+ This::wxIconBundle(), File::unicode:chardata(), Type::integer().
addIcon(#wx_ref{type=ThisT,ref=ThisRef},File,Type)
when is_list(File),is_integer(Type) ->
?CLASS(ThisT,wxIconBundle),
@@ -75,22 +81,24 @@ addIcon(#wx_ref{type=ThisT,ref=ThisRef},File,Type)
wxe_util:cast(?wxIconBundle_AddIcon_2,
<<ThisRef:32/?UI,(byte_size(File_UC)):32/?UI,(File_UC)/binary, 0:(((8- ((0+byte_size(File_UC)) band 16#7)) band 16#7))/unit:8,Type:32/?UI>>).
-%% @spec (This::wxIconBundle()) -> wxIcon:wxIcon()
%% @equiv getIcon(This, [])
+-spec getIcon(This) -> wxIcon:wxIcon() when
+ This::wxIconBundle().
+
getIcon(This)
when is_record(This, wx_ref) ->
getIcon(This, []).
-%% @spec (This::wxIconBundle(),X::term()) -> wxIcon:wxIcon()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxiconbundle.html#wxiconbundlegeticon">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% getIcon(This::wxIconBundle(), [Option]) -> wxIcon:wxIcon() </c>
-%%<br /> Option = {size, integer()}
-%% </p>
-%% <p><c>
-%% getIcon(This::wxIconBundle(), Size::{W::integer(), H::integer()}) -> wxIcon:wxIcon() </c>
-%% </p>
+%% <br /> Also:<br />
+%% getIcon(This, Size) -> wxIcon:wxIcon() when<br />
+%% This::wxIconBundle(), Size::{W::integer(), H::integer()}.<br />
+%%
+-spec getIcon(This, [Option]) -> wxIcon:wxIcon() when
+ This::wxIconBundle(),
+ Option :: {size, integer()};
+ (This, Size) -> wxIcon:wxIcon() when
+ This::wxIconBundle(), Size::{W::integer(), H::integer()}.
getIcon(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxIconBundle),
@@ -105,8 +113,8 @@ getIcon(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
wxe_util:call(?wxIconBundle_GetIcon_1_1,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxIconBundle()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxIconBundle()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxIconBundle),
wxe_util:destroy(?wxIconBundle_destruct,Obj),
diff --git a/lib/wx/src/gen/wxIconizeEvent.erl b/lib/wx/src/gen/wxIconizeEvent.erl
index 647d8019a1..f428ebf70f 100644
--- a/lib/wx/src/gen/wxIconizeEvent.erl
+++ b/lib/wx/src/gen/wxIconizeEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,12 +37,15 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxIconizeEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxIconizeEvent()) -> bool()
+-type wxIconizeEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxiconizeevent.html#wxiconizeeventiconized">external documentation</a>.
+-spec iconized(This) -> boolean() when
+ This::wxIconizeEvent().
iconized(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxIconizeEvent),
wxe_util:call(?wxIconizeEvent_Iconized,
diff --git a/lib/wx/src/gen/wxIdleEvent.erl b/lib/wx/src/gen/wxIdleEvent.erl
index 87ed7e0cd2..4749026446 100644
--- a/lib/wx/src/gen/wxIdleEvent.erl
+++ b/lib/wx/src/gen/wxIdleEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,34 +37,39 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxIdleEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Win::wxWindow:wxWindow()) -> bool()
+-type wxIdleEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxidleevent.html#wxidleeventcansend">external documentation</a>.
+-spec canSend(Win) -> boolean() when
+ Win::wxWindow:wxWindow().
canSend(#wx_ref{type=WinT,ref=WinRef}) ->
?CLASS(WinT,wxWindow),
wxe_util:call(?wxIdleEvent_CanSend,
<<WinRef:32/?UI>>).
-%% @spec () -> WxIdleMode
-%% WxIdleMode = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxidleevent.html#wxidleeventgetmode">external documentation</a>.
-%%<br /> WxIdleMode is one of ?wxIDLE_PROCESS_ALL | ?wxIDLE_PROCESS_SPECIFIED
+%%<br /> Res = ?wxIDLE_PROCESS_ALL | ?wxIDLE_PROCESS_SPECIFIED
+-spec getMode() -> wx:wx_enum().
getMode() ->
wxe_util:call(?wxIdleEvent_GetMode,
<<>>).
-%% @spec (This::wxIdleEvent()) -> ok
%% @equiv requestMore(This, [])
+-spec requestMore(This) -> ok when
+ This::wxIdleEvent().
+
requestMore(This)
when is_record(This, wx_ref) ->
requestMore(This, []).
-%% @spec (This::wxIdleEvent(), [Option]) -> ok
-%% Option = {needMore, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxidleevent.html#wxidleeventrequestmore">external documentation</a>.
+-spec requestMore(This, [Option]) -> ok when
+ This::wxIdleEvent(),
+ Option :: {needMore, boolean()}.
requestMore(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxIdleEvent),
@@ -74,17 +79,18 @@ requestMore(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxIdleEvent_RequestMore,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxIdleEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxidleevent.html#wxidleeventmorerequested">external documentation</a>.
+-spec moreRequested(This) -> boolean() when
+ This::wxIdleEvent().
moreRequested(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxIdleEvent),
wxe_util:call(?wxIdleEvent_MoreRequested,
<<ThisRef:32/?UI>>).
-%% @spec (Mode::WxIdleMode) -> ok
-%% WxIdleMode = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxidleevent.html#wxidleeventsetmode">external documentation</a>.
-%%<br /> WxIdleMode is one of ?wxIDLE_PROCESS_ALL | ?wxIDLE_PROCESS_SPECIFIED
+%%<br /> Mode = ?wxIDLE_PROCESS_ALL | ?wxIDLE_PROCESS_SPECIFIED
+-spec setMode(Mode) -> ok when
+ Mode::wx:wx_enum().
setMode(Mode)
when is_integer(Mode) ->
wxe_util:cast(?wxIdleEvent_SetMode,
diff --git a/lib/wx/src/gen/wxImage.erl b/lib/wx/src/gen/wxImage.erl
index ea41a78a40..c21b5d4789 100644
--- a/lib/wx/src/gen/wxImage.erl
+++ b/lib/wx/src/gen/wxImage.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -47,30 +47,38 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxImage/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxImage()
+-type wxImage() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagewximage">external documentation</a>.
+-spec new() -> wxImage().
new() ->
wxe_util:construct(?wxImage_new_0,
<<>>).
-%% @spec (Name::string()) -> wxImage()
%% @equiv new(Name, [])
+-spec new(Name) -> wxImage() when
+ Name::unicode:chardata().
+
new(Name)
when is_list(Name) ->
new(Name, []).
-%% @spec (X::integer()|string(),X::integer()|term()) -> wxImage()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagewximage">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Width::integer(), Height::integer()) -> new(Width,Height, []) </c></p>
-%% <p><c>
-%% new(Name::string(), [Option]) -> wxImage() </c>
-%%<br /> Option = {type, integer()} | {index, integer()}
-%% </p>
+%% <br /> Also:<br />
+%% new(Name, [Option]) -> wxImage() when<br />
+%% Name::unicode:chardata(),<br />
+%% Option :: {type, integer()}<br />
+%% | {index, integer()}.<br />
+%%
+-spec new(Width, Height) -> wxImage() when
+ Width::integer(), Height::integer();
+ (Name, [Option]) -> wxImage() when
+ Name::unicode:chardata(),
+ Option :: {type, integer()}
+ | {index, integer()}.
new(Width,Height)
when is_integer(Width),is_integer(Height) ->
@@ -85,19 +93,23 @@ new(Name, Options)
wxe_util:construct(?wxImage_new_2,
<<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (X::integer()|string(),X::integer()|string(),X::binary()|term()) -> wxImage()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagewximage">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Width::integer(), Height::integer(), Data::binary()) -> new(Width,Height,Data, []) </c></p>
-%% <p><c>
-%% new(Width::integer(), Height::integer(), [Option]) -> wxImage() </c>
-%%<br /> Option = {clear, bool()}
-%% </p>
-%% <p><c>
-%% new(Name::string(), Mimetype::string(), [Option]) -> wxImage() </c>
-%%<br /> Option = {index, integer()}
-%% </p>
+%% <br /> Also:<br />
+%% new(Width, Height, [Option]) -> wxImage() when<br />
+%% Width::integer(), Height::integer(),<br />
+%% Option :: {clear, boolean()};<br />
+%% (Name, Mimetype, [Option]) -> wxImage() when<br />
+%% Name::unicode:chardata(), Mimetype::unicode:chardata(),<br />
+%% Option :: {index, integer()}.<br />
+%%
+-spec new(Width, Height, Data) -> wxImage() when
+ Width::integer(), Height::integer(), Data::binary();
+ (Width, Height, [Option]) -> wxImage() when
+ Width::integer(), Height::integer(),
+ Option :: {clear, boolean()};
+ (Name, Mimetype, [Option]) -> wxImage() when
+ Name::unicode:chardata(), Mimetype::unicode:chardata(),
+ Option :: {index, integer()}.
new(Width,Height,Data)
when is_integer(Width),is_integer(Height),is_binary(Data) ->
@@ -119,15 +131,17 @@ new(Name,Mimetype, Options)
wxe_util:construct(?wxImage_new_3_1,
<<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Mimetype_UC)):32/?UI,(Mimetype_UC)/binary, 0:(((8- ((4+byte_size(Mimetype_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (Width::integer(),Height::integer(),Data::binary(),X::binary()|term()) -> wxImage()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagewximage">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Width::integer(), Height::integer(), Data::binary(), Alpha::binary()) -> new(Width,Height,Data,Alpha, []) </c></p>
-%% <p><c>
-%% new(Width::integer(), Height::integer(), Data::binary(), [Option]) -> wxImage() </c>
-%%<br /> Option = {static_data, bool()}
-%% </p>
+%% <br /> Also:<br />
+%% new(Width, Height, Data, [Option]) -> wxImage() when<br />
+%% Width::integer(), Height::integer(), Data::binary(),<br />
+%% Option :: {static_data, boolean()}.<br />
+%%
+-spec new(Width, Height, Data, Alpha) -> wxImage() when
+ Width::integer(), Height::integer(), Data::binary(), Alpha::binary();
+ (Width, Height, Data, [Option]) -> wxImage() when
+ Width::integer(), Height::integer(), Data::binary(),
+ Option :: {static_data, boolean()}.
new(Width,Height,Data,Alpha)
when is_integer(Width),is_integer(Height),is_binary(Data),is_binary(Alpha) ->
@@ -141,9 +155,10 @@ new(Width,Height,Data, Options)
wxe_util:construct(?wxImage_new_4,
<<Width:32/?UI,Height:32/?UI, BinOpt/binary>>).
-%% @spec (Width::integer(), Height::integer(), Data::binary(), Alpha::binary(), [Option]) -> wxImage()
-%% Option = {static_data, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagewximage">external documentation</a>.
+-spec new(Width, Height, Data, Alpha, [Option]) -> wxImage() when
+ Width::integer(), Height::integer(), Data::binary(), Alpha::binary(),
+ Option :: {static_data, boolean()}.
new(Width,Height,Data,Alpha, Options)
when is_integer(Width),is_integer(Height),is_binary(Data),is_binary(Alpha),is_list(Options) ->
wxe_util:send_bin(Data),
@@ -154,39 +169,45 @@ new(Width,Height,Data,Alpha, Options)
wxe_util:construct(?wxImage_new_5,
<<Width:32/?UI,Height:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxImage(), Radius::integer()) -> wxImage()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageblur">external documentation</a>.
+-spec blur(This, Radius) -> wxImage() when
+ This::wxImage(), Radius::integer().
blur(#wx_ref{type=ThisT,ref=ThisRef},Radius)
when is_integer(Radius) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_Blur,
<<ThisRef:32/?UI,Radius:32/?UI>>).
-%% @spec (This::wxImage(), Radius::integer()) -> wxImage()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageblurhorizontal">external documentation</a>.
+-spec blurHorizontal(This, Radius) -> wxImage() when
+ This::wxImage(), Radius::integer().
blurHorizontal(#wx_ref{type=ThisT,ref=ThisRef},Radius)
when is_integer(Radius) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_BlurHorizontal,
<<ThisRef:32/?UI,Radius:32/?UI>>).
-%% @spec (This::wxImage(), Radius::integer()) -> wxImage()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageblurvertical">external documentation</a>.
+-spec blurVertical(This, Radius) -> wxImage() when
+ This::wxImage(), Radius::integer().
blurVertical(#wx_ref{type=ThisT,ref=ThisRef},Radius)
when is_integer(Radius) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_BlurVertical,
<<ThisRef:32/?UI,Radius:32/?UI>>).
-%% @spec (This::wxImage()) -> bool()
%% @equiv convertAlphaToMask(This, [])
+-spec convertAlphaToMask(This) -> boolean() when
+ This::wxImage().
+
convertAlphaToMask(This)
when is_record(This, wx_ref) ->
convertAlphaToMask(This, []).
-%% @spec (This::wxImage(), [Option]) -> bool()
-%% Option = {threshold, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageconvertalphatomask">external documentation</a>.
+-spec convertAlphaToMask(This, [Option]) -> boolean() when
+ This::wxImage(),
+ Option :: {threshold, integer()}.
convertAlphaToMask(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -196,15 +217,20 @@ convertAlphaToMask(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxImage_ConvertAlphaToMask,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage()) -> wxImage()
%% @equiv convertToGreyscale(This, [])
+-spec convertToGreyscale(This) -> wxImage() when
+ This::wxImage().
+
convertToGreyscale(This)
when is_record(This, wx_ref) ->
convertToGreyscale(This, []).
-%% @spec (This::wxImage(), [Option]) -> wxImage()
-%% Option = {lr, float()} | {lg, float()} | {lb, float()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageconverttogreyscale">external documentation</a>.
+-spec convertToGreyscale(This, [Option]) -> wxImage() when
+ This::wxImage(),
+ Option :: {lr, number()}
+ | {lg, number()}
+ | {lb, number()}.
convertToGreyscale(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -216,36 +242,42 @@ convertToGreyscale(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxImage_ConvertToGreyscale,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage(), R::integer(), G::integer(), B::integer()) -> wxImage()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageconverttomono">external documentation</a>.
+-spec convertToMono(This, R, G, B) -> wxImage() when
+ This::wxImage(), R::integer(), G::integer(), B::integer().
convertToMono(#wx_ref{type=ThisT,ref=ThisRef},R,G,B)
when is_integer(R),is_integer(G),is_integer(B) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_ConvertToMono,
<<ThisRef:32/?UI,R:32/?UI,G:32/?UI,B:32/?UI>>).
-%% @spec (This::wxImage()) -> wxImage()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagecopy">external documentation</a>.
+-spec copy(This) -> wxImage() when
+ This::wxImage().
copy(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_Copy,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxImage(), Width::integer(), Height::integer()) -> bool()
%% @equiv create(This,Width,Height, [])
+-spec create(This, Width, Height) -> boolean() when
+ This::wxImage(), Width::integer(), Height::integer().
+
create(This,Width,Height)
when is_record(This, wx_ref),is_integer(Width),is_integer(Height) ->
create(This,Width,Height, []).
-%% @spec (This::wxImage(),Width::integer(),Height::integer(),X::binary()|term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagecreate">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% create(This::wxImage(), Width::integer(), Height::integer(), Data::binary()) -> create(This,Width,Height,Data, []) </c></p>
-%% <p><c>
-%% create(This::wxImage(), Width::integer(), Height::integer(), [Option]) -> bool() </c>
-%%<br /> Option = {clear, bool()}
-%% </p>
+%% <br /> Also:<br />
+%% create(This, Width, Height, [Option]) -> boolean() when<br />
+%% This::wxImage(), Width::integer(), Height::integer(),<br />
+%% Option :: {clear, boolean()}.<br />
+%%
+-spec create(This, Width, Height, Data) -> boolean() when
+ This::wxImage(), Width::integer(), Height::integer(), Data::binary();
+ (This, Width, Height, [Option]) -> boolean() when
+ This::wxImage(), Width::integer(), Height::integer(),
+ Option :: {clear, boolean()}.
create(This,Width,Height,Data)
when is_record(This, wx_ref),is_integer(Width),is_integer(Height),is_binary(Data) ->
@@ -259,15 +291,17 @@ create(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
wxe_util:call(?wxImage_Create_3,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage(),Width::integer(),Height::integer(),Data::binary(),X::binary()|term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagecreate">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% create(This::wxImage(), Width::integer(), Height::integer(), Data::binary(), Alpha::binary()) -> create(This,Width,Height,Data,Alpha, []) </c></p>
-%% <p><c>
-%% create(This::wxImage(), Width::integer(), Height::integer(), Data::binary(), [Option]) -> bool() </c>
-%%<br /> Option = {static_data, bool()}
-%% </p>
+%% <br /> Also:<br />
+%% create(This, Width, Height, Data, [Option]) -> boolean() when<br />
+%% This::wxImage(), Width::integer(), Height::integer(), Data::binary(),<br />
+%% Option :: {static_data, boolean()}.<br />
+%%
+-spec create(This, Width, Height, Data, Alpha) -> boolean() when
+ This::wxImage(), Width::integer(), Height::integer(), Data::binary(), Alpha::binary();
+ (This, Width, Height, Data, [Option]) -> boolean() when
+ This::wxImage(), Width::integer(), Height::integer(), Data::binary(),
+ Option :: {static_data, boolean()}.
create(This,Width,Height,Data,Alpha)
when is_record(This, wx_ref),is_integer(Width),is_integer(Height),is_binary(Data),is_binary(Alpha) ->
@@ -282,9 +316,10 @@ create(#wx_ref{type=ThisT,ref=ThisRef},Width,Height,Data, Options)
wxe_util:call(?wxImage_Create_4,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage(), Width::integer(), Height::integer(), Data::binary(), Alpha::binary(), [Option]) -> bool()
-%% Option = {static_data, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagecreate">external documentation</a>.
+-spec create(This, Width, Height, Data, Alpha, [Option]) -> boolean() when
+ This::wxImage(), Width::integer(), Height::integer(), Data::binary(), Alpha::binary(),
+ Option :: {static_data, boolean()}.
create(#wx_ref{type=ThisT,ref=ThisRef},Width,Height,Data,Alpha, Options)
when is_integer(Width),is_integer(Height),is_binary(Data),is_binary(Alpha),is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -296,22 +331,30 @@ create(#wx_ref{type=ThisT,ref=ThisRef},Width,Height,Data,Alpha, Options)
wxe_util:call(?wxImage_Create_5,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagedestroy">external documentation</a>.
+-spec 'Destroy'(This) -> ok when
+ This::wxImage().
'Destroy'(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImage),
wxe_util:cast(?wxImage_Destroy,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxImage()) -> {bool(), R::integer(), G::integer(), B::integer()}
%% @equiv findFirstUnusedColour(This, [])
+-spec findFirstUnusedColour(This) -> Result when
+ Result ::{Res ::boolean(), R::integer(), G::integer(), B::integer()},
+ This::wxImage().
+
findFirstUnusedColour(This)
when is_record(This, wx_ref) ->
findFirstUnusedColour(This, []).
-%% @spec (This::wxImage(), [Option]) -> {bool(), R::integer(), G::integer(), B::integer()}
-%% Option = {startR, integer()} | {startG, integer()} | {startB, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagefindfirstunusedcolour">external documentation</a>.
+-spec findFirstUnusedColour(This, [Option]) -> Result when
+ Result :: {Res ::boolean(), R::integer(), G::integer(), B::integer()},
+ This::wxImage(),
+ Option :: {startR, integer()}
+ | {startG, integer()}
+ | {startB, integer()}.
findFirstUnusedColour(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -323,59 +366,67 @@ findFirstUnusedColour(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxImage_FindFirstUnusedColour,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec () -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetimageextwildcard">external documentation</a>.
+-spec getImageExtWildcard() -> unicode:charlist().
getImageExtWildcard() ->
wxe_util:call(?wxImage_GetImageExtWildcard,
<<>>).
-%% @spec (This::wxImage()) -> binary()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetalpha">external documentation</a>.
+-spec getAlpha(This) -> binary() when
+ This::wxImage().
getAlpha(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_GetAlpha_0,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxImage(), X::integer(), Y::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetalpha">external documentation</a>.
+-spec getAlpha(This, X, Y) -> integer() when
+ This::wxImage(), X::integer(), Y::integer().
getAlpha(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_GetAlpha_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxImage(), X::integer(), Y::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetblue">external documentation</a>.
+-spec getBlue(This, X, Y) -> integer() when
+ This::wxImage(), X::integer(), Y::integer().
getBlue(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_GetBlue,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxImage()) -> binary()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetdata">external documentation</a>.
+-spec getData(This) -> binary() when
+ This::wxImage().
getData(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_GetData,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxImage(), X::integer(), Y::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetgreen">external documentation</a>.
+-spec getGreen(This, X, Y) -> integer() when
+ This::wxImage(), X::integer(), Y::integer().
getGreen(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_GetGreen,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (Name::string()) -> integer()
%% @equiv getImageCount(Name, [])
+-spec getImageCount(Name) -> integer() when
+ Name::unicode:chardata().
+
getImageCount(Name)
when is_list(Name) ->
getImageCount(Name, []).
-%% @spec (Name::string(), [Option]) -> integer()
-%% Option = {type, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetimagecount">external documentation</a>.
+-spec getImageCount(Name, [Option]) -> integer() when
+ Name::unicode:chardata(),
+ Option :: {type, integer()}.
getImageCount(Name, Options)
when is_list(Name),is_list(Options) ->
Name_UC = unicode:characters_to_binary([Name,0]),
@@ -385,87 +436,100 @@ getImageCount(Name, Options)
wxe_util:call(?wxImage_GetImageCount,
<<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxImage()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetheight">external documentation</a>.
+-spec getHeight(This) -> integer() when
+ This::wxImage().
getHeight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_GetHeight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxImage()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetmaskblue">external documentation</a>.
+-spec getMaskBlue(This) -> integer() when
+ This::wxImage().
getMaskBlue(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_GetMaskBlue,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxImage()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetmaskgreen">external documentation</a>.
+-spec getMaskGreen(This) -> integer() when
+ This::wxImage().
getMaskGreen(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_GetMaskGreen,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxImage()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetmaskred">external documentation</a>.
+-spec getMaskRed(This) -> integer() when
+ This::wxImage().
getMaskRed(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_GetMaskRed,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxImage()) -> {bool(), R::integer(), G::integer(), B::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetorfindmaskcolour">external documentation</a>.
+-spec getOrFindMaskColour(This) -> Result when
+ Result ::{Res ::boolean(), R::integer(), G::integer(), B::integer()},
+ This::wxImage().
getOrFindMaskColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_GetOrFindMaskColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxImage()) -> wxPalette:wxPalette()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetpalette">external documentation</a>.
+-spec getPalette(This) -> wxPalette:wxPalette() when
+ This::wxImage().
getPalette(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_GetPalette,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxImage(), X::integer(), Y::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetred">external documentation</a>.
+-spec getRed(This, X, Y) -> integer() when
+ This::wxImage(), X::integer(), Y::integer().
getRed(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_GetRed,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxImage(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> wxImage()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetsubimage">external documentation</a>.
+-spec getSubImage(This, Rect) -> wxImage() when
+ This::wxImage(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
getSubImage(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_GetSubImage,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxImage()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetwidth">external documentation</a>.
+-spec getWidth(This) -> integer() when
+ This::wxImage().
getWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_GetWidth,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxImage()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagehasalpha">external documentation</a>.
+-spec hasAlpha(This) -> boolean() when
+ This::wxImage().
hasAlpha(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_HasAlpha,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxImage()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagehasmask">external documentation</a>.
+-spec hasMask(This) -> boolean() when
+ This::wxImage().
hasMask(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_HasMask,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxImage(), Name::string()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetoption">external documentation</a>.
+-spec getOption(This, Name) -> unicode:charlist() when
+ This::wxImage(), Name::unicode:chardata().
getOption(#wx_ref{type=ThisT,ref=ThisRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxImage),
@@ -473,8 +537,9 @@ getOption(#wx_ref{type=ThisT,ref=ThisRef},Name)
wxe_util:call(?wxImage_GetOption,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxImage(), Name::string()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagegetoptionint">external documentation</a>.
+-spec getOptionInt(This, Name) -> integer() when
+ This::wxImage(), Name::unicode:chardata().
getOptionInt(#wx_ref{type=ThisT,ref=ThisRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxImage),
@@ -482,8 +547,9 @@ getOptionInt(#wx_ref{type=ThisT,ref=ThisRef},Name)
wxe_util:call(?wxImage_GetOptionInt,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxImage(), Name::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagehasoption">external documentation</a>.
+-spec hasOption(This, Name) -> boolean() when
+ This::wxImage(), Name::unicode:chardata().
hasOption(#wx_ref{type=ThisT,ref=ThisRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxImage),
@@ -491,28 +557,32 @@ hasOption(#wx_ref{type=ThisT,ref=ThisRef},Name)
wxe_util:call(?wxImage_HasOption,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxImage()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageinitalpha">external documentation</a>.
+-spec initAlpha(This) -> ok when
+ This::wxImage().
initAlpha(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImage),
wxe_util:cast(?wxImage_InitAlpha,
<<ThisRef:32/?UI>>).
-%% @spec () -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageinitstandardhandlers">external documentation</a>.
+-spec initStandardHandlers() -> ok.
initStandardHandlers() ->
wxe_util:cast(?wxImage_InitStandardHandlers,
<<>>).
-%% @spec (This::wxImage(), X::integer(), Y::integer()) -> bool()
%% @equiv isTransparent(This,X,Y, [])
+-spec isTransparent(This, X, Y) -> boolean() when
+ This::wxImage(), X::integer(), Y::integer().
+
isTransparent(This,X,Y)
when is_record(This, wx_ref),is_integer(X),is_integer(Y) ->
isTransparent(This,X,Y, []).
-%% @spec (This::wxImage(), X::integer(), Y::integer(), [Option]) -> bool()
-%% Option = {threshold, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageistransparent">external documentation</a>.
+-spec isTransparent(This, X, Y, [Option]) -> boolean() when
+ This::wxImage(), X::integer(), Y::integer(),
+ Option :: {threshold, integer()}.
isTransparent(#wx_ref{type=ThisT,ref=ThisRef},X,Y, Options)
when is_integer(X),is_integer(Y),is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -522,15 +592,19 @@ isTransparent(#wx_ref{type=ThisT,ref=ThisRef},X,Y, Options)
wxe_util:call(?wxImage_IsTransparent,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage(), Name::string()) -> bool()
%% @equiv loadFile(This,Name, [])
+-spec loadFile(This, Name) -> boolean() when
+ This::wxImage(), Name::unicode:chardata().
+
loadFile(This,Name)
when is_record(This, wx_ref),is_list(Name) ->
loadFile(This,Name, []).
-%% @spec (This::wxImage(), Name::string(), [Option]) -> bool()
-%% Option = {type, integer()} | {index, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageloadfile">external documentation</a>.
+-spec loadFile(This, Name, [Option]) -> boolean() when
+ This::wxImage(), Name::unicode:chardata(),
+ Option :: {type, integer()}
+ | {index, integer()}.
loadFile(#wx_ref{type=ThisT,ref=ThisRef},Name, Options)
when is_list(Name),is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -542,9 +616,10 @@ loadFile(#wx_ref{type=ThisT,ref=ThisRef},Name, Options)
wxe_util:call(?wxImage_LoadFile_2,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxImage(), Name::string(), Mimetype::string(), [Option]) -> bool()
-%% Option = {index, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageloadfile">external documentation</a>.
+-spec loadFile(This, Name, Mimetype, [Option]) -> boolean() when
+ This::wxImage(), Name::unicode:chardata(), Mimetype::unicode:chardata(),
+ Option :: {index, integer()}.
loadFile(#wx_ref{type=ThisT,ref=ThisRef},Name,Mimetype, Options)
when is_list(Name),is_list(Mimetype),is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -556,30 +631,35 @@ loadFile(#wx_ref{type=ThisT,ref=ThisRef},Name,Mimetype, Options)
wxe_util:call(?wxImage_LoadFile_3,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Mimetype_UC)):32/?UI,(Mimetype_UC)/binary, 0:(((8- ((4+byte_size(Mimetype_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxImage()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageok">external documentation</a>.
+-spec ok(This) -> boolean() when
+ This::wxImage().
ok(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImage),
wxe_util:call(?wxImage_Ok,
<<ThisRef:32/?UI>>).
-%% @spec (Name::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageremovehandler">external documentation</a>.
+-spec removeHandler(Name) -> boolean() when
+ Name::unicode:chardata().
removeHandler(Name)
when is_list(Name) ->
Name_UC = unicode:characters_to_binary([Name,0]),
wxe_util:call(?wxImage_RemoveHandler,
<<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxImage()) -> wxImage()
%% @equiv mirror(This, [])
+-spec mirror(This) -> wxImage() when
+ This::wxImage().
+
mirror(This)
when is_record(This, wx_ref) ->
mirror(This, []).
-%% @spec (This::wxImage(), [Option]) -> wxImage()
-%% Option = {horizontally, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagemirror">external documentation</a>.
+-spec mirror(This, [Option]) -> wxImage() when
+ This::wxImage(),
+ Option :: {horizontally, boolean()}.
mirror(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -589,23 +669,27 @@ mirror(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxImage_Mirror,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage(), R1::integer(), G1::integer(), B1::integer(), R2::integer(), G2::integer(), B2::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagereplace">external documentation</a>.
+-spec replace(This, R1, G1, B1, R2, G2, B2) -> ok when
+ This::wxImage(), R1::integer(), G1::integer(), B1::integer(), R2::integer(), G2::integer(), B2::integer().
replace(#wx_ref{type=ThisT,ref=ThisRef},R1,G1,B1,R2,G2,B2)
when is_integer(R1),is_integer(G1),is_integer(B1),is_integer(R2),is_integer(G2),is_integer(B2) ->
?CLASS(ThisT,wxImage),
wxe_util:cast(?wxImage_Replace,
<<ThisRef:32/?UI,R1:32/?UI,G1:32/?UI,B1:32/?UI,R2:32/?UI,G2:32/?UI,B2:32/?UI>>).
-%% @spec (This::wxImage(), Width::integer(), Height::integer()) -> wxImage()
%% @equiv rescale(This,Width,Height, [])
+-spec rescale(This, Width, Height) -> wxImage() when
+ This::wxImage(), Width::integer(), Height::integer().
+
rescale(This,Width,Height)
when is_record(This, wx_ref),is_integer(Width),is_integer(Height) ->
rescale(This,Width,Height, []).
-%% @spec (This::wxImage(), Width::integer(), Height::integer(), [Option]) -> wxImage()
-%% Option = {quality, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagerescale">external documentation</a>.
+-spec rescale(This, Width, Height, [Option]) -> wxImage() when
+ This::wxImage(), Width::integer(), Height::integer(),
+ Option :: {quality, integer()}.
rescale(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
when is_integer(Width),is_integer(Height),is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -615,15 +699,20 @@ rescale(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
wxe_util:call(?wxImage_Rescale,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage(), Size::{W::integer(), H::integer()}, Pos::{X::integer(), Y::integer()}) -> wxImage()
%% @equiv resize(This,Size,Pos, [])
+-spec resize(This, Size, Pos) -> wxImage() when
+ This::wxImage(), Size::{W::integer(), H::integer()}, Pos::{X::integer(), Y::integer()}.
+
resize(This,Size={SizeW,SizeH},Pos={PosX,PosY})
when is_record(This, wx_ref),is_integer(SizeW),is_integer(SizeH),is_integer(PosX),is_integer(PosY) ->
resize(This,Size,Pos, []).
-%% @spec (This::wxImage(), Size::{W::integer(), H::integer()}, Pos::{X::integer(), Y::integer()}, [Option]) -> wxImage()
-%% Option = {r, integer()} | {g, integer()} | {b, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximageresize">external documentation</a>.
+-spec resize(This, Size, Pos, [Option]) -> wxImage() when
+ This::wxImage(), Size::{W::integer(), H::integer()}, Pos::{X::integer(), Y::integer()},
+ Option :: {r, integer()}
+ | {g, integer()}
+ | {b, integer()}.
resize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH},{PosX,PosY}, Options)
when is_integer(SizeW),is_integer(SizeH),is_integer(PosX),is_integer(PosY),is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -635,17 +724,21 @@ resize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH},{PosX,PosY}, Options)
wxe_util:call(?wxImage_Resize,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI,PosX:32/?UI,PosY:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage(), Angle::float(), Centre_of_rotation::{X::integer(), Y::integer()}) -> wxImage()
%% @equiv rotate(This,Angle,Centre_of_rotation, [])
+-spec rotate(This, Angle, Centre_of_rotation) -> wxImage() when
+ This::wxImage(), Angle::number(), Centre_of_rotation::{X::integer(), Y::integer()}.
+
rotate(This,Angle,Centre_of_rotation={Centre_of_rotationX,Centre_of_rotationY})
- when is_record(This, wx_ref),is_float(Angle),is_integer(Centre_of_rotationX),is_integer(Centre_of_rotationY) ->
+ when is_record(This, wx_ref),is_number(Angle),is_integer(Centre_of_rotationX),is_integer(Centre_of_rotationY) ->
rotate(This,Angle,Centre_of_rotation, []).
-%% @spec (This::wxImage(), Angle::float(), Centre_of_rotation::{X::integer(), Y::integer()}, [Option]) -> wxImage()
-%% Option = {interpolating, bool()} | {offset_after_rotation, {X::integer(), Y::integer()}}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagerotate">external documentation</a>.
+-spec rotate(This, Angle, Centre_of_rotation, [Option]) -> wxImage() when
+ This::wxImage(), Angle::number(), Centre_of_rotation::{X::integer(), Y::integer()},
+ Option :: {interpolating, boolean()}
+ | {offset_after_rotation, {X::integer(), Y::integer()}}.
rotate(#wx_ref{type=ThisT,ref=ThisRef},Angle,{Centre_of_rotationX,Centre_of_rotationY}, Options)
- when is_float(Angle),is_integer(Centre_of_rotationX),is_integer(Centre_of_rotationY),is_list(Options) ->
+ when is_number(Angle),is_integer(Centre_of_rotationX),is_integer(Centre_of_rotationY),is_list(Options) ->
?CLASS(ThisT,wxImage),
MOpts = fun({interpolating, Interpolating}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Interpolating)):32/?UI>>|Acc];
({offset_after_rotation, {Offset_after_rotationX,Offset_after_rotationY}}, Acc) -> [<<2:32/?UI,Offset_after_rotationX:32/?UI,Offset_after_rotationY:32/?UI,0:32>>|Acc];
@@ -654,23 +747,27 @@ rotate(#wx_ref{type=ThisT,ref=ThisRef},Angle,{Centre_of_rotationX,Centre_of_rota
wxe_util:call(?wxImage_Rotate,
<<ThisRef:32/?UI,0:32,Angle:64/?F,Centre_of_rotationX:32/?UI,Centre_of_rotationY:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxImage(), Angle::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagerotatehue">external documentation</a>.
+-spec rotateHue(This, Angle) -> ok when
+ This::wxImage(), Angle::number().
rotateHue(#wx_ref{type=ThisT,ref=ThisRef},Angle)
- when is_float(Angle) ->
+ when is_number(Angle) ->
?CLASS(ThisT,wxImage),
wxe_util:cast(?wxImage_RotateHue,
<<ThisRef:32/?UI,0:32,Angle:64/?F>>).
-%% @spec (This::wxImage()) -> wxImage()
%% @equiv rotate90(This, [])
+-spec rotate90(This) -> wxImage() when
+ This::wxImage().
+
rotate90(This)
when is_record(This, wx_ref) ->
rotate90(This, []).
-%% @spec (This::wxImage(), [Option]) -> wxImage()
-%% Option = {clockwise, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagerotate90">external documentation</a>.
+-spec rotate90(This, [Option]) -> wxImage() when
+ This::wxImage(),
+ Option :: {clockwise, boolean()}.
rotate90(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -680,8 +777,9 @@ rotate90(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxImage_Rotate90,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage(), Name::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesavefile">external documentation</a>.
+-spec saveFile(This, Name) -> boolean() when
+ This::wxImage(), Name::unicode:chardata().
saveFile(#wx_ref{type=ThisT,ref=ThisRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxImage),
@@ -689,15 +787,15 @@ saveFile(#wx_ref{type=ThisT,ref=ThisRef},Name)
wxe_util:call(?wxImage_SaveFile_1,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxImage(),Name::string(),X::integer()|string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesavefile">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% saveFile(This::wxImage(), Name::string(), Type::integer()) -> bool() </c>
-%% </p>
-%% <p><c>
-%% saveFile(This::wxImage(), Name::string(), Mimetype::string()) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% saveFile(This, Name, Mimetype) -> boolean() when<br />
+%% This::wxImage(), Name::unicode:chardata(), Mimetype::unicode:chardata().<br />
+%%
+-spec saveFile(This, Name, Type) -> boolean() when
+ This::wxImage(), Name::unicode:chardata(), Type::integer();
+ (This, Name, Mimetype) -> boolean() when
+ This::wxImage(), Name::unicode:chardata(), Mimetype::unicode:chardata().
saveFile(#wx_ref{type=ThisT,ref=ThisRef},Name,Type)
when is_list(Name),is_integer(Type) ->
?CLASS(ThisT,wxImage),
@@ -712,15 +810,18 @@ saveFile(#wx_ref{type=ThisT,ref=ThisRef},Name,Mimetype)
wxe_util:call(?wxImage_SaveFile_2_1,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Mimetype_UC)):32/?UI,(Mimetype_UC)/binary, 0:(((8- ((4+byte_size(Mimetype_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxImage(), Width::integer(), Height::integer()) -> wxImage()
%% @equiv scale(This,Width,Height, [])
+-spec scale(This, Width, Height) -> wxImage() when
+ This::wxImage(), Width::integer(), Height::integer().
+
scale(This,Width,Height)
when is_record(This, wx_ref),is_integer(Width),is_integer(Height) ->
scale(This,Width,Height, []).
-%% @spec (This::wxImage(), Width::integer(), Height::integer(), [Option]) -> wxImage()
-%% Option = {quality, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagescale">external documentation</a>.
+-spec scale(This, Width, Height, [Option]) -> wxImage() when
+ This::wxImage(), Width::integer(), Height::integer(),
+ Option :: {quality, integer()}.
scale(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
when is_integer(Width),is_integer(Height),is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -730,15 +831,20 @@ scale(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
wxe_util:call(?wxImage_Scale,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage(), Size::{W::integer(), H::integer()}, Pos::{X::integer(), Y::integer()}) -> wxImage()
%% @equiv size(This,Size,Pos, [])
+-spec size(This, Size, Pos) -> wxImage() when
+ This::wxImage(), Size::{W::integer(), H::integer()}, Pos::{X::integer(), Y::integer()}.
+
size(This,Size={SizeW,SizeH},Pos={PosX,PosY})
when is_record(This, wx_ref),is_integer(SizeW),is_integer(SizeH),is_integer(PosX),is_integer(PosY) ->
size(This,Size,Pos, []).
-%% @spec (This::wxImage(), Size::{W::integer(), H::integer()}, Pos::{X::integer(), Y::integer()}, [Option]) -> wxImage()
-%% Option = {r, integer()} | {g, integer()} | {b, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesize">external documentation</a>.
+-spec size(This, Size, Pos, [Option]) -> wxImage() when
+ This::wxImage(), Size::{W::integer(), H::integer()}, Pos::{X::integer(), Y::integer()},
+ Option :: {r, integer()}
+ | {g, integer()}
+ | {b, integer()}.
size(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH},{PosX,PosY}, Options)
when is_integer(SizeW),is_integer(SizeH),is_integer(PosX),is_integer(PosY),is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -750,15 +856,18 @@ size(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH},{PosX,PosY}, Options)
wxe_util:call(?wxImage_Size,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI,PosX:32/?UI,PosY:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage(), Alpha::binary()) -> ok
%% @equiv setAlpha(This,Alpha, [])
+-spec setAlpha(This, Alpha) -> ok when
+ This::wxImage(), Alpha::binary().
+
setAlpha(This,Alpha)
when is_record(This, wx_ref),is_binary(Alpha) ->
setAlpha(This,Alpha, []).
-%% @spec (This::wxImage(), Alpha::binary(), [Option]) -> ok
-%% Option = {static_data, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetalpha">external documentation</a>.
+-spec setAlpha(This, Alpha, [Option]) -> ok when
+ This::wxImage(), Alpha::binary(),
+ Option :: {static_data, boolean()}.
setAlpha(#wx_ref{type=ThisT,ref=ThisRef},Alpha, Options)
when is_binary(Alpha),is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -769,23 +878,27 @@ setAlpha(#wx_ref{type=ThisT,ref=ThisRef},Alpha, Options)
wxe_util:cast(?wxImage_SetAlpha_2,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage(), X::integer(), Y::integer(), Alpha::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetalpha">external documentation</a>.
+-spec setAlpha(This, X, Y, Alpha) -> ok when
+ This::wxImage(), X::integer(), Y::integer(), Alpha::integer().
setAlpha(#wx_ref{type=ThisT,ref=ThisRef},X,Y,Alpha)
when is_integer(X),is_integer(Y),is_integer(Alpha) ->
?CLASS(ThisT,wxImage),
wxe_util:cast(?wxImage_SetAlpha_3,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,Alpha:32/?UI>>).
-%% @spec (This::wxImage(), Data::binary()) -> ok
%% @equiv setData(This,Data, [])
+-spec setData(This, Data) -> ok when
+ This::wxImage(), Data::binary().
+
setData(This,Data)
when is_record(This, wx_ref),is_binary(Data) ->
setData(This,Data, []).
-%% @spec (This::wxImage(), Data::binary(), [Option]) -> ok
-%% Option = {static_data, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetdata">external documentation</a>.
+-spec setData(This, Data, [Option]) -> ok when
+ This::wxImage(), Data::binary(),
+ Option :: {static_data, boolean()}.
setData(#wx_ref{type=ThisT,ref=ThisRef},Data, Options)
when is_binary(Data),is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -796,15 +909,18 @@ setData(#wx_ref{type=ThisT,ref=ThisRef},Data, Options)
wxe_util:cast(?wxImage_SetData_2,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage(), Data::binary(), New_width::integer(), New_height::integer()) -> ok
%% @equiv setData(This,Data,New_width,New_height, [])
+-spec setData(This, Data, New_width, New_height) -> ok when
+ This::wxImage(), Data::binary(), New_width::integer(), New_height::integer().
+
setData(This,Data,New_width,New_height)
when is_record(This, wx_ref),is_binary(Data),is_integer(New_width),is_integer(New_height) ->
setData(This,Data,New_width,New_height, []).
-%% @spec (This::wxImage(), Data::binary(), New_width::integer(), New_height::integer(), [Option]) -> ok
-%% Option = {static_data, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetdata">external documentation</a>.
+-spec setData(This, Data, New_width, New_height, [Option]) -> ok when
+ This::wxImage(), Data::binary(), New_width::integer(), New_height::integer(),
+ Option :: {static_data, boolean()}.
setData(#wx_ref{type=ThisT,ref=ThisRef},Data,New_width,New_height, Options)
when is_binary(Data),is_integer(New_width),is_integer(New_height),is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -815,15 +931,18 @@ setData(#wx_ref{type=ThisT,ref=ThisRef},Data,New_width,New_height, Options)
wxe_util:cast(?wxImage_SetData_4,
<<ThisRef:32/?UI,New_width:32/?UI,New_height:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage()) -> ok
%% @equiv setMask(This, [])
+-spec setMask(This) -> ok when
+ This::wxImage().
+
setMask(This)
when is_record(This, wx_ref) ->
setMask(This, []).
-%% @spec (This::wxImage(), [Option]) -> ok
-%% Option = {mask, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetmask">external documentation</a>.
+-spec setMask(This, [Option]) -> ok when
+ This::wxImage(),
+ Option :: {mask, boolean()}.
setMask(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxImage),
@@ -833,16 +952,18 @@ setMask(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxImage_SetMask,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImage(), R::integer(), G::integer(), B::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetmaskcolour">external documentation</a>.
+-spec setMaskColour(This, R, G, B) -> ok when
+ This::wxImage(), R::integer(), G::integer(), B::integer().
setMaskColour(#wx_ref{type=ThisT,ref=ThisRef},R,G,B)
when is_integer(R),is_integer(G),is_integer(B) ->
?CLASS(ThisT,wxImage),
wxe_util:cast(?wxImage_SetMaskColour,
<<ThisRef:32/?UI,R:32/?UI,G:32/?UI,B:32/?UI>>).
-%% @spec (This::wxImage(), Mask::wxImage(), Mr::integer(), Mg::integer(), Mb::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetmaskfromimage">external documentation</a>.
+-spec setMaskFromImage(This, Mask, Mr, Mg, Mb) -> boolean() when
+ This::wxImage(), Mask::wxImage(), Mr::integer(), Mg::integer(), Mb::integer().
setMaskFromImage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MaskT,ref=MaskRef},Mr,Mg,Mb)
when is_integer(Mr),is_integer(Mg),is_integer(Mb) ->
?CLASS(ThisT,wxImage),
@@ -850,15 +971,15 @@ setMaskFromImage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MaskT,ref=MaskRef}
wxe_util:call(?wxImage_SetMaskFromImage,
<<ThisRef:32/?UI,MaskRef:32/?UI,Mr:32/?UI,Mg:32/?UI,Mb:32/?UI>>).
-%% @spec (This::wxImage(),Name::string(),X::integer()|string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetoption">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setOption(This::wxImage(), Name::string(), Value::integer()) -> ok </c>
-%% </p>
-%% <p><c>
-%% setOption(This::wxImage(), Name::string(), Value::string()) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% setOption(This, Name, Value) -> ok when<br />
+%% This::wxImage(), Name::unicode:chardata(), Value::unicode:chardata().<br />
+%%
+-spec setOption(This, Name, Value) -> ok when
+ This::wxImage(), Name::unicode:chardata(), Value::integer();
+ (This, Name, Value) -> ok when
+ This::wxImage(), Name::unicode:chardata(), Value::unicode:chardata().
setOption(#wx_ref{type=ThisT,ref=ThisRef},Name,Value)
when is_list(Name),is_integer(Value) ->
?CLASS(ThisT,wxImage),
@@ -873,32 +994,35 @@ setOption(#wx_ref{type=ThisT,ref=ThisRef},Name,Value)
wxe_util:cast(?wxImage_SetOption_2_1,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Value_UC)):32/?UI,(Value_UC)/binary, 0:(((8- ((4+byte_size(Value_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxImage(), Palette::wxPalette:wxPalette()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetpalette">external documentation</a>.
+-spec setPalette(This, Palette) -> ok when
+ This::wxImage(), Palette::wxPalette:wxPalette().
setPalette(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PaletteT,ref=PaletteRef}) ->
?CLASS(ThisT,wxImage),
?CLASS(PaletteT,wxPalette),
wxe_util:cast(?wxImage_SetPalette,
<<ThisRef:32/?UI,PaletteRef:32/?UI>>).
-%% @spec (This::wxImage(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, R::integer(), G::integer(), B::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetrgb">external documentation</a>.
+-spec setRGB(This, Rect, R, G, B) -> ok when
+ This::wxImage(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, R::integer(), G::integer(), B::integer().
setRGB(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH},R,G,B)
when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH),is_integer(R),is_integer(G),is_integer(B) ->
?CLASS(ThisT,wxImage),
wxe_util:cast(?wxImage_SetRGB_4,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI,R:32/?UI,G:32/?UI,B:32/?UI>>).
-%% @spec (This::wxImage(), X::integer(), Y::integer(), R::integer(), G::integer(), B::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximage.html#wximagesetrgb">external documentation</a>.
+-spec setRGB(This, X, Y, R, G, B) -> ok when
+ This::wxImage(), X::integer(), Y::integer(), R::integer(), G::integer(), B::integer().
setRGB(#wx_ref{type=ThisT,ref=ThisRef},X,Y,R,G,B)
when is_integer(X),is_integer(Y),is_integer(R),is_integer(G),is_integer(B) ->
?CLASS(ThisT,wxImage),
wxe_util:cast(?wxImage_SetRGB_5,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,R:32/?UI,G:32/?UI,B:32/?UI>>).
-%% @spec (This::wxImage()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxImage()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxImage),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxImageList.erl b/lib/wx/src/gen/wxImageList.erl
index f805a234df..e9d936d129 100644
--- a/lib/wx/src/gen/wxImageList.erl
+++ b/lib/wx/src/gen/wxImageList.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -31,24 +31,30 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxImageList/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxImageList()
+-type wxImageList() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximagelist.html#wximagelistwximagelist">external documentation</a>.
+-spec new() -> wxImageList().
new() ->
wxe_util:construct(?wxImageList_new_0,
<<>>).
-%% @spec (Width::integer(), Height::integer()) -> wxImageList()
%% @equiv new(Width,Height, [])
+-spec new(Width, Height) -> wxImageList() when
+ Width::integer(), Height::integer().
+
new(Width,Height)
when is_integer(Width),is_integer(Height) ->
new(Width,Height, []).
-%% @spec (Width::integer(), Height::integer(), [Option]) -> wxImageList()
-%% Option = {mask, bool()} | {initialCount, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximagelist.html#wximagelistwximagelist">external documentation</a>.
+-spec new(Width, Height, [Option]) -> wxImageList() when
+ Width::integer(), Height::integer(),
+ Option :: {mask, boolean()}
+ | {initialCount, integer()}.
new(Width,Height, Options)
when is_integer(Width),is_integer(Height),is_list(Options) ->
MOpts = fun({mask, Mask}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Mask)):32/?UI>>|Acc];
@@ -58,23 +64,24 @@ new(Width,Height, Options)
wxe_util:construct(?wxImageList_new_3,
<<Width:32/?UI,Height:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxImageList(), Bitmap::wxBitmap:wxBitmap()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximagelist.html#wximagelistadd">external documentation</a>.
+-spec add(This, Bitmap) -> integer() when
+ This::wxImageList(), Bitmap::wxBitmap:wxBitmap().
add(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BitmapT,ref=BitmapRef}) ->
?CLASS(ThisT,wxImageList),
?CLASS(BitmapT,wxBitmap),
wxe_util:call(?wxImageList_Add_1,
<<ThisRef:32/?UI,BitmapRef:32/?UI>>).
-%% @spec (This::wxImageList(),Bitmap::wxBitmap:wxBitmap(),X::term()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximagelist.html#wximagelistadd">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% add(This::wxImageList(), Bitmap::wxBitmap:wxBitmap(), Mask::wxBitmap:wxBitmap()) -> integer() </c>
-%% </p>
-%% <p><c>
-%% add(This::wxImageList(), Bitmap::wxBitmap:wxBitmap(), MaskColour::wx:colour()) -> integer() </c>
-%% </p>
+%% <br /> Also:<br />
+%% add(This, Bitmap, MaskColour) -> integer() when<br />
+%% This::wxImageList(), Bitmap::wxBitmap:wxBitmap(), MaskColour::wx:wx_colour().<br />
+%%
+-spec add(This, Bitmap, Mask) -> integer() when
+ This::wxImageList(), Bitmap::wxBitmap:wxBitmap(), Mask::wxBitmap:wxBitmap();
+ (This, Bitmap, MaskColour) -> integer() when
+ This::wxImageList(), Bitmap::wxBitmap:wxBitmap(), MaskColour::wx:wx_colour().
add(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BitmapT,ref=BitmapRef},#wx_ref{type=MaskT,ref=MaskRef}) ->
?CLASS(ThisT,wxImageList),
?CLASS(BitmapT,wxBitmap),
@@ -88,15 +95,19 @@ add(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BitmapT,ref=BitmapRef},MaskColo
wxe_util:call(?wxImageList_Add_2_1,
<<ThisRef:32/?UI,BitmapRef:32/?UI,(wxe_util:colour_bin(MaskColour)):16/binary>>).
-%% @spec (This::wxImageList(), Width::integer(), Height::integer()) -> bool()
%% @equiv create(This,Width,Height, [])
+-spec create(This, Width, Height) -> boolean() when
+ This::wxImageList(), Width::integer(), Height::integer().
+
create(This,Width,Height)
when is_record(This, wx_ref),is_integer(Width),is_integer(Height) ->
create(This,Width,Height, []).
-%% @spec (This::wxImageList(), Width::integer(), Height::integer(), [Option]) -> bool()
-%% Option = {mask, bool()} | {initialCount, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximagelist.html#wximagelistcreate">external documentation</a>.
+-spec create(This, Width, Height, [Option]) -> boolean() when
+ This::wxImageList(), Width::integer(), Height::integer(),
+ Option :: {mask, boolean()}
+ | {initialCount, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
when is_integer(Width),is_integer(Height),is_list(Options) ->
?CLASS(ThisT,wxImageList),
@@ -107,15 +118,19 @@ create(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
wxe_util:call(?wxImageList_Create,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImageList(), Index::integer(), Dc::wxDC:wxDC(), X::integer(), Y::integer()) -> bool()
%% @equiv draw(This,Index,Dc,X,Y, [])
+-spec draw(This, Index, Dc, X, Y) -> boolean() when
+ This::wxImageList(), Index::integer(), Dc::wxDC:wxDC(), X::integer(), Y::integer().
+
draw(This,Index,Dc,X,Y)
when is_record(This, wx_ref),is_integer(Index),is_record(Dc, wx_ref),is_integer(X),is_integer(Y) ->
draw(This,Index,Dc,X,Y, []).
-%% @spec (This::wxImageList(), Index::integer(), Dc::wxDC:wxDC(), X::integer(), Y::integer(), [Option]) -> bool()
-%% Option = {flags, integer()} | {solidBackground, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximagelist.html#wximagelistdraw">external documentation</a>.
+-spec draw(This, Index, Dc, X, Y, [Option]) -> boolean() when
+ This::wxImageList(), Index::integer(), Dc::wxDC:wxDC(), X::integer(), Y::integer(),
+ Option :: {flags, integer()}
+ | {solidBackground, boolean()}.
draw(#wx_ref{type=ThisT,ref=ThisRef},Index,#wx_ref{type=DcT,ref=DcRef},X,Y, Options)
when is_integer(Index),is_integer(X),is_integer(Y),is_list(Options) ->
?CLASS(ThisT,wxImageList),
@@ -127,54 +142,62 @@ draw(#wx_ref{type=ThisT,ref=ThisRef},Index,#wx_ref{type=DcT,ref=DcRef},X,Y, Opti
wxe_util:call(?wxImageList_Draw,
<<ThisRef:32/?UI,Index:32/?UI,DcRef:32/?UI,X:32/?UI,Y:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxImageList(), Index::integer()) -> wxBitmap:wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximagelist.html#wximagelistgetbitmap">external documentation</a>.
+-spec getBitmap(This, Index) -> wxBitmap:wxBitmap() when
+ This::wxImageList(), Index::integer().
getBitmap(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxImageList),
wxe_util:call(?wxImageList_GetBitmap,
<<ThisRef:32/?UI,Index:32/?UI>>).
-%% @spec (This::wxImageList(), Index::integer()) -> wxIcon:wxIcon()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximagelist.html#wximagelistgeticon">external documentation</a>.
+-spec getIcon(This, Index) -> wxIcon:wxIcon() when
+ This::wxImageList(), Index::integer().
getIcon(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxImageList),
wxe_util:call(?wxImageList_GetIcon,
<<ThisRef:32/?UI,Index:32/?UI>>).
-%% @spec (This::wxImageList()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximagelist.html#wximagelistgetimagecount">external documentation</a>.
+-spec getImageCount(This) -> integer() when
+ This::wxImageList().
getImageCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImageList),
wxe_util:call(?wxImageList_GetImageCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxImageList(), Index::integer()) -> {bool(), Width::integer(), Height::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximagelist.html#wximagelistgetsize">external documentation</a>.
+-spec getSize(This, Index) -> Result when
+ Result ::{Res ::boolean(), Width::integer(), Height::integer()},
+ This::wxImageList(), Index::integer().
getSize(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxImageList),
wxe_util:call(?wxImageList_GetSize,
<<ThisRef:32/?UI,Index:32/?UI>>).
-%% @spec (This::wxImageList(), Index::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximagelist.html#wximagelistremove">external documentation</a>.
+-spec remove(This, Index) -> boolean() when
+ This::wxImageList(), Index::integer().
remove(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxImageList),
wxe_util:call(?wxImageList_Remove,
<<ThisRef:32/?UI,Index:32/?UI>>).
-%% @spec (This::wxImageList()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximagelist.html#wximagelistremoveall">external documentation</a>.
+-spec removeAll(This) -> boolean() when
+ This::wxImageList().
removeAll(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImageList),
wxe_util:call(?wxImageList_RemoveAll,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxImageList(), Index::integer(), Bitmap::wxBitmap:wxBitmap()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximagelist.html#wximagelistreplace">external documentation</a>.
+-spec replace(This, Index, Bitmap) -> boolean() when
+ This::wxImageList(), Index::integer(), Bitmap::wxBitmap:wxBitmap().
replace(#wx_ref{type=ThisT,ref=ThisRef},Index,#wx_ref{type=BitmapT,ref=BitmapRef})
when is_integer(Index) ->
?CLASS(ThisT,wxImageList),
@@ -182,8 +205,9 @@ replace(#wx_ref{type=ThisT,ref=ThisRef},Index,#wx_ref{type=BitmapT,ref=BitmapRef
wxe_util:call(?wxImageList_Replace_2,
<<ThisRef:32/?UI,Index:32/?UI,BitmapRef:32/?UI>>).
-%% @spec (This::wxImageList(), Index::integer(), Bitmap::wxBitmap:wxBitmap(), Mask::wxBitmap:wxBitmap()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wximagelist.html#wximagelistreplace">external documentation</a>.
+-spec replace(This, Index, Bitmap, Mask) -> boolean() when
+ This::wxImageList(), Index::integer(), Bitmap::wxBitmap:wxBitmap(), Mask::wxBitmap:wxBitmap().
replace(#wx_ref{type=ThisT,ref=ThisRef},Index,#wx_ref{type=BitmapT,ref=BitmapRef},#wx_ref{type=MaskT,ref=MaskRef})
when is_integer(Index) ->
?CLASS(ThisT,wxImageList),
@@ -192,8 +216,8 @@ replace(#wx_ref{type=ThisT,ref=ThisRef},Index,#wx_ref{type=BitmapT,ref=BitmapRef
wxe_util:call(?wxImageList_Replace_3,
<<ThisRef:32/?UI,Index:32/?UI,BitmapRef:32/?UI,MaskRef:32/?UI>>).
-%% @spec (This::wxImageList()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxImageList()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxImageList),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxJoystickEvent.erl b/lib/wx/src/gen/wxJoystickEvent.erl
index 2f149a50f8..979c36cd8c 100644
--- a/lib/wx/src/gen/wxJoystickEvent.erl
+++ b/lib/wx/src/gen/wxJoystickEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -39,19 +39,24 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxJoystickEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxJoystickEvent()) -> bool()
+-type wxJoystickEvent() :: wx:wx_object().
%% @equiv buttonDown(This, [])
+-spec buttonDown(This) -> boolean() when
+ This::wxJoystickEvent().
+
buttonDown(This)
when is_record(This, wx_ref) ->
buttonDown(This, []).
-%% @spec (This::wxJoystickEvent(), [Option]) -> bool()
-%% Option = {but, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxjoystickevent.html#wxjoystickeventbuttondown">external documentation</a>.
+-spec buttonDown(This, [Option]) -> boolean() when
+ This::wxJoystickEvent(),
+ Option :: {but, integer()}.
buttonDown(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxJoystickEvent),
@@ -61,15 +66,18 @@ buttonDown(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxJoystickEvent_ButtonDown,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxJoystickEvent()) -> bool()
%% @equiv buttonIsDown(This, [])
+-spec buttonIsDown(This) -> boolean() when
+ This::wxJoystickEvent().
+
buttonIsDown(This)
when is_record(This, wx_ref) ->
buttonIsDown(This, []).
-%% @spec (This::wxJoystickEvent(), [Option]) -> bool()
-%% Option = {but, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxjoystickevent.html#wxjoystickeventbuttonisdown">external documentation</a>.
+-spec buttonIsDown(This, [Option]) -> boolean() when
+ This::wxJoystickEvent(),
+ Option :: {but, integer()}.
buttonIsDown(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxJoystickEvent),
@@ -79,15 +87,18 @@ buttonIsDown(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxJoystickEvent_ButtonIsDown,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxJoystickEvent()) -> bool()
%% @equiv buttonUp(This, [])
+-spec buttonUp(This) -> boolean() when
+ This::wxJoystickEvent().
+
buttonUp(This)
when is_record(This, wx_ref) ->
buttonUp(This, []).
-%% @spec (This::wxJoystickEvent(), [Option]) -> bool()
-%% Option = {but, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxjoystickevent.html#wxjoystickeventbuttonup">external documentation</a>.
+-spec buttonUp(This, [Option]) -> boolean() when
+ This::wxJoystickEvent(),
+ Option :: {but, integer()}.
buttonUp(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxJoystickEvent),
@@ -97,57 +108,65 @@ buttonUp(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxJoystickEvent_ButtonUp,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxJoystickEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxjoystickevent.html#wxjoystickeventgetbuttonchange">external documentation</a>.
+-spec getButtonChange(This) -> integer() when
+ This::wxJoystickEvent().
getButtonChange(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxJoystickEvent),
wxe_util:call(?wxJoystickEvent_GetButtonChange,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxJoystickEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxjoystickevent.html#wxjoystickeventgetbuttonstate">external documentation</a>.
+-spec getButtonState(This) -> integer() when
+ This::wxJoystickEvent().
getButtonState(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxJoystickEvent),
wxe_util:call(?wxJoystickEvent_GetButtonState,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxJoystickEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxjoystickevent.html#wxjoystickeventgetjoystick">external documentation</a>.
+-spec getJoystick(This) -> integer() when
+ This::wxJoystickEvent().
getJoystick(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxJoystickEvent),
wxe_util:call(?wxJoystickEvent_GetJoystick,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxJoystickEvent()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxjoystickevent.html#wxjoystickeventgetposition">external documentation</a>.
+-spec getPosition(This) -> {X::integer(), Y::integer()} when
+ This::wxJoystickEvent().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxJoystickEvent),
wxe_util:call(?wxJoystickEvent_GetPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxJoystickEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxjoystickevent.html#wxjoystickeventgetzposition">external documentation</a>.
+-spec getZPosition(This) -> integer() when
+ This::wxJoystickEvent().
getZPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxJoystickEvent),
wxe_util:call(?wxJoystickEvent_GetZPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxJoystickEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxjoystickevent.html#wxjoystickeventisbutton">external documentation</a>.
+-spec isButton(This) -> boolean() when
+ This::wxJoystickEvent().
isButton(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxJoystickEvent),
wxe_util:call(?wxJoystickEvent_IsButton,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxJoystickEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxjoystickevent.html#wxjoystickeventismove">external documentation</a>.
+-spec isMove(This) -> boolean() when
+ This::wxJoystickEvent().
isMove(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxJoystickEvent),
wxe_util:call(?wxJoystickEvent_IsMove,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxJoystickEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxjoystickevent.html#wxjoystickeventiszmove">external documentation</a>.
+-spec isZMove(This) -> boolean() when
+ This::wxJoystickEvent().
isZMove(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxJoystickEvent),
wxe_util:call(?wxJoystickEvent_IsZMove,
diff --git a/lib/wx/src/gen/wxKeyEvent.erl b/lib/wx/src/gen/wxKeyEvent.erl
index edda5ee0a6..107d4be685 100644
--- a/lib/wx/src/gen/wxKeyEvent.erl
+++ b/lib/wx/src/gen/wxKeyEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -39,103 +39,119 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxKeyEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxKeyEvent()) -> bool()
+-type wxKeyEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxkeyevent.html#wxkeyeventaltdown">external documentation</a>.
+-spec altDown(This) -> boolean() when
+ This::wxKeyEvent().
altDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxKeyEvent),
wxe_util:call(?wxKeyEvent_AltDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxKeyEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxkeyevent.html#wxkeyeventcmddown">external documentation</a>.
+-spec cmdDown(This) -> boolean() when
+ This::wxKeyEvent().
cmdDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxKeyEvent),
wxe_util:call(?wxKeyEvent_CmdDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxKeyEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxkeyevent.html#wxkeyeventcontroldown">external documentation</a>.
+-spec controlDown(This) -> boolean() when
+ This::wxKeyEvent().
controlDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxKeyEvent),
wxe_util:call(?wxKeyEvent_ControlDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxKeyEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxkeyevent.html#wxkeyeventgetkeycode">external documentation</a>.
+-spec getKeyCode(This) -> integer() when
+ This::wxKeyEvent().
getKeyCode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxKeyEvent),
wxe_util:call(?wxKeyEvent_GetKeyCode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxKeyEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxkeyevent.html#wxkeyeventgetmodifiers">external documentation</a>.
+-spec getModifiers(This) -> integer() when
+ This::wxKeyEvent().
getModifiers(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxKeyEvent),
wxe_util:call(?wxKeyEvent_GetModifiers,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxKeyEvent()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxkeyevent.html#wxkeyeventgetposition">external documentation</a>.
+-spec getPosition(This) -> {X::integer(), Y::integer()} when
+ This::wxKeyEvent().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxKeyEvent),
wxe_util:call(?wxKeyEvent_GetPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxKeyEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxkeyevent.html#wxkeyeventgetrawkeycode">external documentation</a>.
+-spec getRawKeyCode(This) -> integer() when
+ This::wxKeyEvent().
getRawKeyCode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxKeyEvent),
wxe_util:call(?wxKeyEvent_GetRawKeyCode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxKeyEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxkeyevent.html#wxkeyeventgetrawkeyflags">external documentation</a>.
+-spec getRawKeyFlags(This) -> integer() when
+ This::wxKeyEvent().
getRawKeyFlags(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxKeyEvent),
wxe_util:call(?wxKeyEvent_GetRawKeyFlags,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxKeyEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxkeyevent.html#wxkeyeventgetunicodekey">external documentation</a>.
+-spec getUnicodeKey(This) -> integer() when
+ This::wxKeyEvent().
getUnicodeKey(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxKeyEvent),
wxe_util:call(?wxKeyEvent_GetUnicodeKey,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxKeyEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxkeyevent.html#wxkeyeventgetx">external documentation</a>.
+-spec getX(This) -> integer() when
+ This::wxKeyEvent().
getX(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxKeyEvent),
wxe_util:call(?wxKeyEvent_GetX,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxKeyEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxkeyevent.html#wxkeyeventgety">external documentation</a>.
+-spec getY(This) -> integer() when
+ This::wxKeyEvent().
getY(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxKeyEvent),
wxe_util:call(?wxKeyEvent_GetY,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxKeyEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxkeyevent.html#wxkeyeventhasmodifiers">external documentation</a>.
+-spec hasModifiers(This) -> boolean() when
+ This::wxKeyEvent().
hasModifiers(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxKeyEvent),
wxe_util:call(?wxKeyEvent_HasModifiers,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxKeyEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxkeyevent.html#wxkeyeventmetadown">external documentation</a>.
+-spec metaDown(This) -> boolean() when
+ This::wxKeyEvent().
metaDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxKeyEvent),
wxe_util:call(?wxKeyEvent_MetaDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxKeyEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxkeyevent.html#wxkeyeventshiftdown">external documentation</a>.
+-spec shiftDown(This) -> boolean() when
+ This::wxKeyEvent().
shiftDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxKeyEvent),
wxe_util:call(?wxKeyEvent_ShiftDown,
diff --git a/lib/wx/src/gen/wxLayoutAlgorithm.erl b/lib/wx/src/gen/wxLayoutAlgorithm.erl
index c17abeaed1..d0736e2379 100644
--- a/lib/wx/src/gen/wxLayoutAlgorithm.erl
+++ b/lib/wx/src/gen/wxLayoutAlgorithm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -30,24 +30,29 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxLayoutAlgorithm/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxLayoutAlgorithm()
+-type wxLayoutAlgorithm() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlayoutalgorithm.html#wxlayoutalgorithmwxlayoutalgorithm">external documentation</a>.
+-spec new() -> wxLayoutAlgorithm().
new() ->
wxe_util:construct(?wxLayoutAlgorithm_new,
<<>>).
-%% @spec (This::wxLayoutAlgorithm(), Frame::wxFrame:wxFrame()) -> bool()
%% @equiv layoutFrame(This,Frame, [])
+-spec layoutFrame(This, Frame) -> boolean() when
+ This::wxLayoutAlgorithm(), Frame::wxFrame:wxFrame().
+
layoutFrame(This,Frame)
when is_record(This, wx_ref),is_record(Frame, wx_ref) ->
layoutFrame(This,Frame, []).
-%% @spec (This::wxLayoutAlgorithm(), Frame::wxFrame:wxFrame(), [Option]) -> bool()
-%% Option = {mainWindow, wxWindow:wxWindow()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlayoutalgorithm.html#wxlayoutalgorithmlayoutframe">external documentation</a>.
+-spec layoutFrame(This, Frame, [Option]) -> boolean() when
+ This::wxLayoutAlgorithm(), Frame::wxFrame:wxFrame(),
+ Option :: {mainWindow, wxWindow:wxWindow()}.
layoutFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxLayoutAlgorithm),
@@ -58,15 +63,18 @@ layoutFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef}, O
wxe_util:call(?wxLayoutAlgorithm_LayoutFrame,
<<ThisRef:32/?UI,FrameRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxLayoutAlgorithm(), Frame::wxMDIParentFrame:wxMDIParentFrame()) -> bool()
%% @equiv layoutMDIFrame(This,Frame, [])
+-spec layoutMDIFrame(This, Frame) -> boolean() when
+ This::wxLayoutAlgorithm(), Frame::wxMDIParentFrame:wxMDIParentFrame().
+
layoutMDIFrame(This,Frame)
when is_record(This, wx_ref),is_record(Frame, wx_ref) ->
layoutMDIFrame(This,Frame, []).
-%% @spec (This::wxLayoutAlgorithm(), Frame::wxMDIParentFrame:wxMDIParentFrame(), [Option]) -> bool()
-%% Option = {rect, {X::integer(), Y::integer(), W::integer(), H::integer()}}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlayoutalgorithm.html#wxlayoutalgorithmlayoutmdiframe">external documentation</a>.
+-spec layoutMDIFrame(This, Frame, [Option]) -> boolean() when
+ This::wxLayoutAlgorithm(), Frame::wxMDIParentFrame:wxMDIParentFrame(),
+ Option :: {rect, {X::integer(), Y::integer(), W::integer(), H::integer()}}.
layoutMDIFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxLayoutAlgorithm),
@@ -77,15 +85,18 @@ layoutMDIFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef}
wxe_util:call(?wxLayoutAlgorithm_LayoutMDIFrame,
<<ThisRef:32/?UI,FrameRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxLayoutAlgorithm(), Frame::wxWindow:wxWindow()) -> bool()
%% @equiv layoutWindow(This,Frame, [])
+-spec layoutWindow(This, Frame) -> boolean() when
+ This::wxLayoutAlgorithm(), Frame::wxWindow:wxWindow().
+
layoutWindow(This,Frame)
when is_record(This, wx_ref),is_record(Frame, wx_ref) ->
layoutWindow(This,Frame, []).
-%% @spec (This::wxLayoutAlgorithm(), Frame::wxWindow:wxWindow(), [Option]) -> bool()
-%% Option = {mainWindow, wxWindow:wxWindow()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlayoutalgorithm.html#wxlayoutalgorithmlayoutwindow">external documentation</a>.
+-spec layoutWindow(This, Frame, [Option]) -> boolean() when
+ This::wxLayoutAlgorithm(), Frame::wxWindow:wxWindow(),
+ Option :: {mainWindow, wxWindow:wxWindow()}.
layoutWindow(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxLayoutAlgorithm),
@@ -96,8 +107,8 @@ layoutWindow(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef},
wxe_util:call(?wxLayoutAlgorithm_LayoutWindow,
<<ThisRef:32/?UI,FrameRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxLayoutAlgorithm()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxLayoutAlgorithm()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxLayoutAlgorithm),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxListBox.erl b/lib/wx/src/gen/wxListBox.erl
index cc30bf95e4..fa4cbd01d5 100644
--- a/lib/wx/src/gen/wxListBox.erl
+++ b/lib/wx/src/gen/wxListBox.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -74,6 +74,7 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxListBox/0]).
%% @hidden
parent_class(wxControlWithItems) -> true;
parent_class(wxControl) -> true;
@@ -81,21 +82,29 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxListBox()
+-type wxListBox() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbox.html#wxlistboxwxlistbox">external documentation</a>.
+-spec new() -> wxListBox().
new() ->
wxe_util:construct(?wxListBox_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxListBox()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxListBox() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxListBox()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {choices, [[string()]]} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbox.html#wxlistboxwxlistbox">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxListBox() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {choices, [unicode:chardata()]}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -109,15 +118,19 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxListBox_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxListBox(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]]) -> bool()
%% @equiv create(This,Parent,Id,Pos,Size,Choices, [])
+-spec create(This, Parent, Id, Pos, Size, Choices) -> boolean() when
+ This::wxListBox(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[unicode:chardata()].
+
create(This,Parent,Id,Pos={PosX,PosY},Size={SizeW,SizeH},Choices)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices) ->
create(This,Parent,Id,Pos,Size,Choices, []).
-%% @spec (This::wxListBox(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]], [Option]) -> bool()
-%% Option = {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbox.html#wxlistboxcreate">external documentation</a>.
+-spec create(This, Parent, Id, Pos, Size, Choices, [Option]) -> boolean() when
+ This::wxListBox(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[unicode:chardata()],
+ Option :: {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,{PosX,PosY},{SizeW,SizeH},Choices, Options)
when is_integer(Id),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices),is_list(Options) ->
?CLASS(ThisT,wxListBox),
@@ -131,23 +144,27 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,{P
wxe_util:call(?wxListBox_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,PosX:32/?UI,PosY:32/?UI,SizeW:32/?UI,SizeH:32/?UI,(length(Choices_UCA)):32/?UI, (<< <<(byte_size(UC_Str)):32/?UI, UC_Str/binary>>|| UC_Str <- Choices_UCA>>)/binary, 0:(((8- ((0 + lists:sum([byte_size(S)+4||S<-Choices_UCA])) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxListBox(), N::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbox.html#wxlistboxdeselect">external documentation</a>.
+-spec deselect(This, N) -> ok when
+ This::wxListBox(), N::integer().
deselect(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxListBox),
wxe_util:cast(?wxListBox_Deselect,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxListBox()) -> {integer(), ASelections::[integer()]}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbox.html#wxlistboxgetselections">external documentation</a>.
+-spec getSelections(This) -> Result when
+ Result ::{Res ::integer(), ASelections::[integer()]},
+ This::wxListBox().
getSelections(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListBox),
wxe_util:call(?wxListBox_GetSelections,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListBox(), Items::[[string()]], Pos::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbox.html#wxlistboxinsertitems">external documentation</a>.
+-spec insertItems(This, Items, Pos) -> ok when
+ This::wxListBox(), Items::[unicode:chardata()], Pos::integer().
insertItems(#wx_ref{type=ThisT,ref=ThisRef},Items,Pos)
when is_list(Items),is_integer(Pos) ->
?CLASS(ThisT,wxListBox),
@@ -156,16 +173,18 @@ insertItems(#wx_ref{type=ThisT,ref=ThisRef},Items,Pos)
wxe_util:cast(?wxListBox_InsertItems,
<<ThisRef:32/?UI,(length(Items_UCA)):32/?UI, (<< <<(byte_size(UC_Str)):32/?UI, UC_Str/binary>>|| UC_Str <- Items_UCA>>)/binary, 0:(((8- ((0 + lists:sum([byte_size(S)+4||S<-Items_UCA])) band 16#7)) band 16#7))/unit:8,Pos:32/?UI>>).
-%% @spec (This::wxListBox(), N::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbox.html#wxlistboxisselected">external documentation</a>.
+-spec isSelected(This, N) -> boolean() when
+ This::wxListBox(), N::integer().
isSelected(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxListBox),
wxe_util:call(?wxListBox_IsSelected,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxListBox(), Items::[[string()]]) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbox.html#wxlistboxset">external documentation</a>.
+-spec set(This, Items) -> ok when
+ This::wxListBox(), Items::[unicode:chardata()].
set(#wx_ref{type=ThisT,ref=ThisRef},Items)
when is_list(Items) ->
?CLASS(ThisT,wxListBox),
@@ -174,23 +193,24 @@ set(#wx_ref{type=ThisT,ref=ThisRef},Items)
wxe_util:cast(?wxListBox_Set,
<<ThisRef:32/?UI,(length(Items_UCA)):32/?UI, (<< <<(byte_size(UC_Str)):32/?UI, UC_Str/binary>>|| UC_Str <- Items_UCA>>)/binary, 0:(((8- ((0 + lists:sum([byte_size(S)+4||S<-Items_UCA])) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxListBox(), Point::{X::integer(), Y::integer()}) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbox.html#wxlistboxhittest">external documentation</a>.
+-spec hitTest(This, Point) -> integer() when
+ This::wxListBox(), Point::{X::integer(), Y::integer()}.
hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PointX,PointY})
when is_integer(PointX),is_integer(PointY) ->
?CLASS(ThisT,wxListBox),
wxe_util:call(?wxListBox_HitTest,
<<ThisRef:32/?UI,PointX:32/?UI,PointY:32/?UI>>).
-%% @spec (This::wxListBox(),X::integer()|string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbox.html#wxlistboxsetfirstitem">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setFirstItem(This::wxListBox(), N::integer()) -> ok </c>
-%% </p>
-%% <p><c>
-%% setFirstItem(This::wxListBox(), S::string()) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% setFirstItem(This, S) -> ok when<br />
+%% This::wxListBox(), S::unicode:chardata().<br />
+%%
+-spec setFirstItem(This, N) -> ok when
+ This::wxListBox(), N::integer();
+ (This, S) -> ok when
+ This::wxListBox(), S::unicode:chardata().
setFirstItem(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxListBox),
@@ -203,8 +223,8 @@ setFirstItem(#wx_ref{type=ThisT,ref=ThisRef},S)
wxe_util:cast(?wxListBox_SetFirstItem_1_1,
<<ThisRef:32/?UI,(byte_size(S_UC)):32/?UI,(S_UC)/binary, 0:(((8- ((0+byte_size(S_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxListBox()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxListBox()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxListBox),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxListCtrl.erl b/lib/wx/src/gen/wxListCtrl.erl
index fa99897171..a6288fc02a 100644
--- a/lib/wx/src/gen/wxListCtrl.erl
+++ b/lib/wx/src/gen/wxListCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -34,10 +34,10 @@
deleteItem/2,destroy/1,editLabel/2,ensureVisible/2,findItem/3,findItem/4,
getColumn/3,getColumnCount/1,getColumnWidth/2,getCountPerPage/1,getEditControl/1,
getImageList/2,getItem/2,getItemBackgroundColour/2,getItemCount/1,
- getItemData/2,getItemFont/2,getItemPosition/3,getItemRect/3,getItemRect/4,
+ 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/2,insertColumn/3,insertColumn/4,
+ getTopItem/1,getViewRect/1,hitTest/3,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,
@@ -83,12 +83,14 @@
show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,update/1,
updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxListCtrl/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxListCtrl() :: wx:wx_object().
%% @spec () -> wxListCtrl()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlwxlistctrl">external documentation</a>.
@@ -141,15 +143,18 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:construct(?wxListCtrl_new_2, <<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxListCtrl()) -> bool()
%% @equiv arrange(This, [])
+-spec arrange(This) -> boolean() when
+ This::wxListCtrl().
+
arrange(This)
when is_record(This, wx_ref) ->
arrange(This, []).
-%% @spec (This::wxListCtrl(), [Option]) -> bool()
-%% Option = {flag, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlarrange">external documentation</a>.
+-spec arrange(This, [Option]) -> boolean() when
+ This::wxListCtrl(),
+ Option :: {flag, integer()}.
arrange(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxListCtrl),
@@ -159,8 +164,9 @@ arrange(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxListCtrl_Arrange,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxListCtrl(), ImageList::wxImageList:wxImageList(), Which::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlassignimagelist">external documentation</a>.
+-spec assignImageList(This, ImageList, Which) -> ok when
+ This::wxListCtrl(), ImageList::wxImageList:wxImageList(), Which::integer().
assignImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef},Which)
when is_integer(Which) ->
?CLASS(ThisT,wxListCtrl),
@@ -168,8 +174,9 @@ assignImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=Imag
wxe_util:cast(?wxListCtrl_AssignImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI,Which:32/?UI>>).
-%% @spec (This::wxListCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlclearall">external documentation</a>.
+-spec clearAll(This) -> ok when
+ This::wxListCtrl().
clearAll(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:cast(?wxListCtrl_ClearAll,
@@ -210,61 +217,68 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Opti
wxe_util:call(?wxListCtrl_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxListCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrldeleteallitems">external documentation</a>.
+-spec deleteAllItems(This) -> boolean() when
+ This::wxListCtrl().
deleteAllItems(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_DeleteAllItems,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListCtrl(), Col::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrldeletecolumn">external documentation</a>.
+-spec deleteColumn(This, Col) -> boolean() when
+ This::wxListCtrl(), Col::integer().
deleteColumn(#wx_ref{type=ThisT,ref=ThisRef},Col)
when is_integer(Col) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_DeleteColumn,
<<ThisRef:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrldeleteitem">external documentation</a>.
+-spec deleteItem(This, Item) -> boolean() when
+ This::wxListCtrl(), Item::integer().
deleteItem(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_DeleteItem,
<<ThisRef:32/?UI,Item:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer()) -> wxTextCtrl:wxTextCtrl()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrleditlabel">external documentation</a>.
+-spec editLabel(This, Item) -> wxTextCtrl:wxTextCtrl() when
+ This::wxListCtrl(), Item::integer().
editLabel(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_EditLabel,
<<ThisRef:32/?UI,Item:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlensurevisible">external documentation</a>.
+-spec ensureVisible(This, Item) -> boolean() when
+ This::wxListCtrl(), Item::integer().
ensureVisible(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_EnsureVisible,
<<ThisRef:32/?UI,Item:32/?UI>>).
-%% @spec (This::wxListCtrl(), Start::integer(), Str::string()) -> integer()
%% @equiv findItem(This,Start,Str, [])
+-spec findItem(This, Start, Str) -> integer() when
+ This::wxListCtrl(), Start::integer(), Str::unicode:chardata().
+
findItem(This,Start,Str)
when is_record(This, wx_ref),is_integer(Start),is_list(Str) ->
findItem(This,Start,Str, []).
-%% @spec (This::wxListCtrl(),Start::integer(),X::string()|term(),X::term()|integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlfinditem">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% findItem(This::wxListCtrl(), Start::integer(), Str::string(), [Option]) -> integer() </c>
-%%<br /> Option = {partial, bool()}
-%% </p>
-%% <p><c>
-%% findItem(This::wxListCtrl(), Start::integer(), Pt::{X::integer(), Y::integer()}, Direction::integer()) -> integer() </c>
-%% </p>
+%% <br /> Also:<br />
+%% findItem(This, Start, Pt, Direction) -> integer() when<br />
+%% This::wxListCtrl(), Start::integer(), Pt::{X::integer(), Y::integer()}, Direction::integer().<br />
+%%
+-spec findItem(This, Start, Str, [Option]) -> integer() when
+ This::wxListCtrl(), Start::integer(), Str::unicode:chardata(),
+ Option :: {partial, boolean()};
+ (This, Start, Pt, Direction) -> integer() when
+ This::wxListCtrl(), Start::integer(), Pt::{X::integer(), Y::integer()}, Direction::integer().
findItem(#wx_ref{type=ThisT,ref=ThisRef},Start,Str, Options)
when is_integer(Start),is_list(Str),is_list(Options) ->
?CLASS(ThisT,wxListCtrl),
@@ -280,8 +294,9 @@ findItem(#wx_ref{type=ThisT,ref=ThisRef},Start,{PtX,PtY},Direction)
wxe_util:call(?wxListCtrl_FindItem_3_1,
<<ThisRef:32/?UI,Start:32/?UI,PtX:32/?UI,PtY:32/?UI,Direction:32/?UI>>).
-%% @spec (This::wxListCtrl(), Col::integer(), Item::wxListItem:wxListItem()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetcolumn">external documentation</a>.
+-spec getColumn(This, Col, Item) -> boolean() when
+ This::wxListCtrl(), Col::integer(), Item::wxListItem:wxListItem().
getColumn(#wx_ref{type=ThisT,ref=ThisRef},Col,#wx_ref{type=ItemT,ref=ItemRef})
when is_integer(Col) ->
?CLASS(ThisT,wxListCtrl),
@@ -289,148 +304,173 @@ getColumn(#wx_ref{type=ThisT,ref=ThisRef},Col,#wx_ref{type=ItemT,ref=ItemRef})
wxe_util:call(?wxListCtrl_GetColumn,
<<ThisRef:32/?UI,Col:32/?UI,ItemRef:32/?UI>>).
-%% @spec (This::wxListCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetcolumncount">external documentation</a>.
+-spec getColumnCount(This) -> integer() when
+ This::wxListCtrl().
getColumnCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetColumnCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListCtrl(), Col::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetcolumnwidth">external documentation</a>.
+-spec getColumnWidth(This, Col) -> integer() when
+ This::wxListCtrl(), Col::integer().
getColumnWidth(#wx_ref{type=ThisT,ref=ThisRef},Col)
when is_integer(Col) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetColumnWidth,
<<ThisRef:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxListCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetcountperpage">external documentation</a>.
+-spec getCountPerPage(This) -> integer() when
+ This::wxListCtrl().
getCountPerPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetCountPerPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListCtrl()) -> wxTextCtrl:wxTextCtrl()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgeteditcontrol">external documentation</a>.
+-spec getEditControl(This) -> wxTextCtrl:wxTextCtrl() when
+ This::wxListCtrl().
getEditControl(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetEditControl,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListCtrl(), Which::integer()) -> wxImageList:wxImageList()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetimagelist">external documentation</a>.
+-spec getImageList(This, Which) -> wxImageList:wxImageList() when
+ This::wxListCtrl(), Which::integer().
getImageList(#wx_ref{type=ThisT,ref=ThisRef},Which)
when is_integer(Which) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetImageList,
<<ThisRef:32/?UI,Which:32/?UI>>).
-%% @spec (This::wxListCtrl(), Info::wxListItem:wxListItem()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetitem">external documentation</a>.
+-spec getItem(This, Info) -> boolean() when
+ This::wxListCtrl(), Info::wxListItem:wxListItem().
getItem(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=InfoT,ref=InfoRef}) ->
?CLASS(ThisT,wxListCtrl),
?CLASS(InfoT,wxListItem),
wxe_util:call(?wxListCtrl_GetItem,
<<ThisRef:32/?UI,InfoRef:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetitembackgroundcolour">external documentation</a>.
+-spec getItemBackgroundColour(This, Item) -> wx:wx_colour4() when
+ This::wxListCtrl(), Item::integer().
getItemBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetItemBackgroundColour,
<<ThisRef:32/?UI,Item:32/?UI>>).
-%% @spec (This::wxListCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetitemcount">external documentation</a>.
+-spec getItemCount(This) -> integer() when
+ This::wxListCtrl().
getItemCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetItemCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetitemdata">external documentation</a>.
+-spec getItemData(This, Item) -> integer() when
+ This::wxListCtrl(), Item::integer().
getItemData(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetItemData,
<<ThisRef:32/?UI,Item:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer()) -> wxFont:wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetitemfont">external documentation</a>.
+-spec getItemFont(This, Item) -> wxFont:wxFont() when
+ This::wxListCtrl(), Item::integer().
getItemFont(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetItemFont,
<<ThisRef:32/?UI,Item:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer(), Pos::{X::integer(), Y::integer()}) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetitemposition">external documentation</a>.
-getItemPosition(#wx_ref{type=ThisT,ref=ThisRef},Item,{PosX,PosY})
- when is_integer(Item),is_integer(PosX),is_integer(PosY) ->
+-spec getItemPosition(This, Item) -> Result when
+ Result ::{Res ::boolean(), Pos::{X::integer(), Y::integer()}},
+ This::wxListCtrl(), Item::integer().
+getItemPosition(#wx_ref{type=ThisT,ref=ThisRef},Item)
+ when is_integer(Item) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetItemPosition,
- <<ThisRef:32/?UI,Item:32/?UI,PosX:32/?UI,PosY:32/?UI>>).
+ <<ThisRef:32/?UI,Item:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> bool()
-%% @equiv getItemRect(This,Item,Rect, [])
-getItemRect(This,Item,Rect={RectX,RectY,RectW,RectH})
- when is_record(This, wx_ref),is_integer(Item),is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) ->
- getItemRect(This,Item,Rect, []).
+%% @equiv getItemRect(This,Item, [])
+-spec getItemRect(This, Item) -> Result when
+ Result ::{Res ::boolean(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}},
+ This::wxListCtrl(), Item::integer().
+
+getItemRect(This,Item)
+ when is_record(This, wx_ref),is_integer(Item) ->
+ getItemRect(This,Item, []).
-%% @spec (This::wxListCtrl(), Item::integer(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, [Option]) -> bool()
-%% Option = {code, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetitemrect">external documentation</a>.
-getItemRect(#wx_ref{type=ThisT,ref=ThisRef},Item,{RectX,RectY,RectW,RectH}, Options)
- when is_integer(Item),is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH),is_list(Options) ->
+-spec getItemRect(This, Item, [Option]) -> Result when
+ Result :: {Res ::boolean(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}},
+ This::wxListCtrl(), Item::integer(),
+ Option :: {code, integer()}.
+getItemRect(#wx_ref{type=ThisT,ref=ThisRef},Item, Options)
+ when is_integer(Item),is_list(Options) ->
?CLASS(ThisT,wxListCtrl),
MOpts = fun({code, Code}, Acc) -> [<<1:32/?UI,Code:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxListCtrl_GetItemRect,
- <<ThisRef:32/?UI,Item:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI, BinOpt/binary>>).
+ <<ThisRef:32/?UI,Item:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxListCtrl()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetitemspacing">external documentation</a>.
+-spec getItemSpacing(This) -> {W::integer(), H::integer()} when
+ This::wxListCtrl().
getItemSpacing(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetItemSpacing,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer(), StateMask::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetitemstate">external documentation</a>.
+-spec getItemState(This, Item, StateMask) -> integer() when
+ This::wxListCtrl(), Item::integer(), StateMask::integer().
getItemState(#wx_ref{type=ThisT,ref=ThisRef},Item,StateMask)
when is_integer(Item),is_integer(StateMask) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetItemState,
<<ThisRef:32/?UI,Item:32/?UI,StateMask:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetitemtext">external documentation</a>.
+-spec getItemText(This, Item) -> unicode:charlist() when
+ This::wxListCtrl(), Item::integer().
getItemText(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetItemText,
<<ThisRef:32/?UI,Item:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetitemtextcolour">external documentation</a>.
+-spec getItemTextColour(This, Item) -> wx:wx_colour4() when
+ This::wxListCtrl(), Item::integer().
getItemTextColour(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetItemTextColour,
<<ThisRef:32/?UI,Item:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer()) -> integer()
%% @equiv getNextItem(This,Item, [])
+-spec getNextItem(This, Item) -> integer() when
+ This::wxListCtrl(), Item::integer().
+
getNextItem(This,Item)
when is_record(This, wx_ref),is_integer(Item) ->
getNextItem(This,Item, []).
-%% @spec (This::wxListCtrl(), Item::integer(), [Option]) -> integer()
-%% Option = {geometry, integer()} | {state, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetnextitem">external documentation</a>.
+-spec getNextItem(This, Item, [Option]) -> integer() when
+ This::wxListCtrl(), Item::integer(),
+ Option :: {geometry, integer()}
+ | {state, integer()}.
getNextItem(#wx_ref{type=ThisT,ref=ThisRef},Item, Options)
when is_integer(Item),is_list(Options) ->
?CLASS(ThisT,wxListCtrl),
@@ -441,50 +481,56 @@ getNextItem(#wx_ref{type=ThisT,ref=ThisRef},Item, Options)
wxe_util:call(?wxListCtrl_GetNextItem,
<<ThisRef:32/?UI,Item:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxListCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetselecteditemcount">external documentation</a>.
+-spec getSelectedItemCount(This) -> integer() when
+ This::wxListCtrl().
getSelectedItemCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetSelectedItemCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListCtrl()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgettextcolour">external documentation</a>.
+-spec getTextColour(This) -> wx:wx_colour4() when
+ This::wxListCtrl().
getTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetTextColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgettopitem">external documentation</a>.
+-spec getTopItem(This) -> integer() when
+ This::wxListCtrl().
getTopItem(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetTopItem,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListCtrl()) -> {X::integer(), Y::integer(), W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlgetviewrect">external documentation</a>.
+-spec getViewRect(This) -> {X::integer(), Y::integer(), W::integer(), H::integer()} when
+ This::wxListCtrl().
getViewRect(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_GetViewRect,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListCtrl(), Point::{X::integer(), Y::integer()}) -> {integer(), Flags::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlhittest">external documentation</a>.
-hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PointX,PointY})
- when is_integer(PointX),is_integer(PointY) ->
+-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) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_HitTest,
- <<ThisRef:32/?UI,PointX:32/?UI,PointY:32/?UI>>).
+ <<ThisRef:32/?UI,PointX:32/?UI,PointY:32/?UI,Flags:32/?UI>>).
-%% @spec (This::wxListCtrl(),Col::integer(),X::string()|term()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlinsertcolumn">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% insertColumn(This::wxListCtrl(), Col::integer(), Heading::string()) -> insertColumn(This,Col,Heading, []) </c></p>
-%% <p><c>
-%% insertColumn(This::wxListCtrl(), Col::integer(), Info::wxListItem:wxListItem()) -> integer() </c>
-%% </p>
+%% <br /> Also:<br />
+%% insertColumn(This, Col, Info) -> integer() when<br />
+%% This::wxListCtrl(), Col::integer(), Info::wxListItem:wxListItem().<br />
+%%
+-spec insertColumn(This, Col, Heading) -> integer() when
+ This::wxListCtrl(), Col::integer(), Heading::unicode:chardata();
+ (This, Col, Info) -> integer() when
+ This::wxListCtrl(), Col::integer(), Info::wxListItem:wxListItem().
insertColumn(This,Col,Heading)
when is_record(This, wx_ref),is_integer(Col),is_list(Heading) ->
@@ -496,9 +542,11 @@ insertColumn(#wx_ref{type=ThisT,ref=ThisRef},Col,#wx_ref{type=InfoT,ref=InfoRef}
wxe_util:call(?wxListCtrl_InsertColumn_2,
<<ThisRef:32/?UI,Col:32/?UI,InfoRef:32/?UI>>).
-%% @spec (This::wxListCtrl(), Col::integer(), Heading::string(), [Option]) -> integer()
-%% Option = {format, integer()} | {width, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlinsertcolumn">external documentation</a>.
+-spec insertColumn(This, Col, Heading, [Option]) -> integer() when
+ This::wxListCtrl(), Col::integer(), Heading::unicode:chardata(),
+ Option :: {format, integer()}
+ | {width, integer()}.
insertColumn(#wx_ref{type=ThisT,ref=ThisRef},Col,Heading, Options)
when is_integer(Col),is_list(Heading),is_list(Options) ->
?CLASS(ThisT,wxListCtrl),
@@ -510,23 +558,24 @@ insertColumn(#wx_ref{type=ThisT,ref=ThisRef},Col,Heading, Options)
wxe_util:call(?wxListCtrl_InsertColumn_3,
<<ThisRef:32/?UI,Col:32/?UI,(byte_size(Heading_UC)):32/?UI,(Heading_UC)/binary, 0:(((8- ((4+byte_size(Heading_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxListCtrl(), Info::wxListItem:wxListItem()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlinsertitem">external documentation</a>.
+-spec insertItem(This, Info) -> integer() when
+ This::wxListCtrl(), Info::wxListItem:wxListItem().
insertItem(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=InfoT,ref=InfoRef}) ->
?CLASS(ThisT,wxListCtrl),
?CLASS(InfoT,wxListItem),
wxe_util:call(?wxListCtrl_InsertItem_1,
<<ThisRef:32/?UI,InfoRef:32/?UI>>).
-%% @spec (This::wxListCtrl(),Index::integer(),X::integer()|string()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlinsertitem">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% insertItem(This::wxListCtrl(), Index::integer(), ImageIndex::integer()) -> integer() </c>
-%% </p>
-%% <p><c>
-%% insertItem(This::wxListCtrl(), Index::integer(), Label::string()) -> integer() </c>
-%% </p>
+%% <br /> Also:<br />
+%% insertItem(This, Index, Label) -> integer() when<br />
+%% This::wxListCtrl(), Index::integer(), Label::unicode:chardata().<br />
+%%
+-spec insertItem(This, Index, ImageIndex) -> integer() when
+ This::wxListCtrl(), Index::integer(), ImageIndex::integer();
+ (This, Index, Label) -> integer() when
+ This::wxListCtrl(), Index::integer(), Label::unicode:chardata().
insertItem(#wx_ref{type=ThisT,ref=ThisRef},Index,ImageIndex)
when is_integer(Index),is_integer(ImageIndex) ->
?CLASS(ThisT,wxListCtrl),
@@ -539,8 +588,9 @@ insertItem(#wx_ref{type=ThisT,ref=ThisRef},Index,Label)
wxe_util:call(?wxListCtrl_InsertItem_2_1,
<<ThisRef:32/?UI,Index:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxListCtrl(), Index::integer(), Label::string(), ImageIndex::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlinsertitem">external documentation</a>.
+-spec insertItem(This, Index, Label, ImageIndex) -> integer() when
+ This::wxListCtrl(), Index::integer(), Label::unicode:chardata(), ImageIndex::integer().
insertItem(#wx_ref{type=ThisT,ref=ThisRef},Index,Label,ImageIndex)
when is_integer(Index),is_list(Label),is_integer(ImageIndex) ->
?CLASS(ThisT,wxListCtrl),
@@ -548,40 +598,45 @@ insertItem(#wx_ref{type=ThisT,ref=ThisRef},Index,Label,ImageIndex)
wxe_util:call(?wxListCtrl_InsertItem_3,
<<ThisRef:32/?UI,Index:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8,ImageIndex:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlrefreshitem">external documentation</a>.
+-spec refreshItem(This, Item) -> ok when
+ This::wxListCtrl(), Item::integer().
refreshItem(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:cast(?wxListCtrl_RefreshItem,
<<ThisRef:32/?UI,Item:32/?UI>>).
-%% @spec (This::wxListCtrl(), ItemFrom::integer(), ItemTo::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlrefreshitems">external documentation</a>.
+-spec refreshItems(This, ItemFrom, ItemTo) -> ok when
+ This::wxListCtrl(), ItemFrom::integer(), ItemTo::integer().
refreshItems(#wx_ref{type=ThisT,ref=ThisRef},ItemFrom,ItemTo)
when is_integer(ItemFrom),is_integer(ItemTo) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:cast(?wxListCtrl_RefreshItems,
<<ThisRef:32/?UI,ItemFrom:32/?UI,ItemTo:32/?UI>>).
-%% @spec (This::wxListCtrl(), Dx::integer(), Dy::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlscrolllist">external documentation</a>.
+-spec scrollList(This, Dx, Dy) -> boolean() when
+ This::wxListCtrl(), Dx::integer(), Dy::integer().
scrollList(#wx_ref{type=ThisT,ref=ThisRef},Dx,Dy)
when is_integer(Dx),is_integer(Dy) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_ScrollList,
<<ThisRef:32/?UI,Dx:32/?UI,Dy:32/?UI>>).
-%% @spec (This::wxListCtrl(), Colour::wx:colour()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetbackgroundcolour">external documentation</a>.
+-spec setBackgroundColour(This, Colour) -> boolean() when
+ This::wxListCtrl(), Colour::wx:wx_colour().
setBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},Colour)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_SetBackgroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
-%% @spec (This::wxListCtrl(), Col::integer(), Item::wxListItem:wxListItem()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetcolumn">external documentation</a>.
+-spec setColumn(This, Col, Item) -> boolean() when
+ This::wxListCtrl(), Col::integer(), Item::wxListItem:wxListItem().
setColumn(#wx_ref{type=ThisT,ref=ThisRef},Col,#wx_ref{type=ItemT,ref=ItemRef})
when is_integer(Col) ->
?CLASS(ThisT,wxListCtrl),
@@ -589,16 +644,18 @@ setColumn(#wx_ref{type=ThisT,ref=ThisRef},Col,#wx_ref{type=ItemT,ref=ItemRef})
wxe_util:call(?wxListCtrl_SetColumn,
<<ThisRef:32/?UI,Col:32/?UI,ItemRef:32/?UI>>).
-%% @spec (This::wxListCtrl(), Col::integer(), Width::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetcolumnwidth">external documentation</a>.
+-spec setColumnWidth(This, Col, Width) -> boolean() when
+ This::wxListCtrl(), Col::integer(), Width::integer().
setColumnWidth(#wx_ref{type=ThisT,ref=ThisRef},Col,Width)
when is_integer(Col),is_integer(Width) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_SetColumnWidth,
<<ThisRef:32/?UI,Col:32/?UI,Width:32/?UI>>).
-%% @spec (This::wxListCtrl(), ImageList::wxImageList:wxImageList(), Which::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetimagelist">external documentation</a>.
+-spec setImageList(This, ImageList, Which) -> ok when
+ This::wxListCtrl(), ImageList::wxImageList:wxImageList(), Which::integer().
setImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef},Which)
when is_integer(Which) ->
?CLASS(ThisT,wxListCtrl),
@@ -606,23 +663,27 @@ setImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageLi
wxe_util:cast(?wxListCtrl_SetImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI,Which:32/?UI>>).
-%% @spec (This::wxListCtrl(), Info::wxListItem:wxListItem()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetitem">external documentation</a>.
+-spec setItem(This, Info) -> boolean() when
+ This::wxListCtrl(), Info::wxListItem:wxListItem().
setItem(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=InfoT,ref=InfoRef}) ->
?CLASS(ThisT,wxListCtrl),
?CLASS(InfoT,wxListItem),
wxe_util:call(?wxListCtrl_SetItem_1,
<<ThisRef:32/?UI,InfoRef:32/?UI>>).
-%% @spec (This::wxListCtrl(), Index::integer(), Col::integer(), Label::string()) -> integer()
%% @equiv setItem(This,Index,Col,Label, [])
+-spec setItem(This, Index, Col, Label) -> integer() when
+ This::wxListCtrl(), Index::integer(), Col::integer(), Label::unicode:chardata().
+
setItem(This,Index,Col,Label)
when is_record(This, wx_ref),is_integer(Index),is_integer(Col),is_list(Label) ->
setItem(This,Index,Col,Label, []).
-%% @spec (This::wxListCtrl(), Index::integer(), Col::integer(), Label::string(), [Option]) -> integer()
-%% Option = {imageId, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetitem">external documentation</a>.
+-spec setItem(This, Index, Col, Label, [Option]) -> integer() when
+ This::wxListCtrl(), Index::integer(), Col::integer(), Label::unicode:chardata(),
+ Option :: {imageId, integer()}.
setItem(#wx_ref{type=ThisT,ref=ThisRef},Index,Col,Label, Options)
when is_integer(Index),is_integer(Col),is_list(Label),is_list(Options) ->
?CLASS(ThisT,wxListCtrl),
@@ -633,32 +694,36 @@ setItem(#wx_ref{type=ThisT,ref=ThisRef},Index,Col,Label, Options)
wxe_util:call(?wxListCtrl_SetItem_4,
<<ThisRef:32/?UI,Index:32/?UI,Col:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((0+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxListCtrl(), Item::integer(), Col::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetitembackgroundcolour">external documentation</a>.
+-spec setItemBackgroundColour(This, Item, Col) -> ok when
+ This::wxListCtrl(), Item::integer(), Col::wx:wx_colour().
setItemBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},Item,Col)
when is_integer(Item),tuple_size(Col) =:= 3; tuple_size(Col) =:= 4 ->
?CLASS(ThisT,wxListCtrl),
wxe_util:cast(?wxListCtrl_SetItemBackgroundColour,
<<ThisRef:32/?UI,Item:32/?UI,(wxe_util:colour_bin(Col)):16/binary>>).
-%% @spec (This::wxListCtrl(), Count::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetitemcount">external documentation</a>.
+-spec setItemCount(This, Count) -> ok when
+ This::wxListCtrl(), Count::integer().
setItemCount(#wx_ref{type=ThisT,ref=ThisRef},Count)
when is_integer(Count) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:cast(?wxListCtrl_SetItemCount,
<<ThisRef:32/?UI,Count:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer(), Data::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetitemdata">external documentation</a>.
+-spec setItemData(This, Item, Data) -> boolean() when
+ This::wxListCtrl(), Item::integer(), Data::integer().
setItemData(#wx_ref{type=ThisT,ref=ThisRef},Item,Data)
when is_integer(Item),is_integer(Data) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_SetItemData,
<<ThisRef:32/?UI,Item:32/?UI,Data:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer(), F::wxFont:wxFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetitemfont">external documentation</a>.
+-spec setItemFont(This, Item, F) -> ok when
+ This::wxListCtrl(), Item::integer(), F::wxFont:wxFont().
setItemFont(#wx_ref{type=ThisT,ref=ThisRef},Item,#wx_ref{type=FT,ref=FRef})
when is_integer(Item) ->
?CLASS(ThisT,wxListCtrl),
@@ -666,15 +731,18 @@ setItemFont(#wx_ref{type=ThisT,ref=ThisRef},Item,#wx_ref{type=FT,ref=FRef})
wxe_util:cast(?wxListCtrl_SetItemFont,
<<ThisRef:32/?UI,Item:32/?UI,FRef:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer(), Image::integer()) -> bool()
%% @equiv setItemImage(This,Item,Image, [])
+-spec setItemImage(This, Item, Image) -> boolean() when
+ This::wxListCtrl(), Item::integer(), Image::integer().
+
setItemImage(This,Item,Image)
when is_record(This, wx_ref),is_integer(Item),is_integer(Image) ->
setItemImage(This,Item,Image, []).
-%% @spec (This::wxListCtrl(), Item::integer(), Image::integer(), [Option]) -> bool()
-%% Option = {selImage, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetitemimage">external documentation</a>.
+-spec setItemImage(This, Item, Image, [Option]) -> boolean() when
+ This::wxListCtrl(), Item::integer(), Image::integer(),
+ Option :: {selImage, integer()}.
setItemImage(#wx_ref{type=ThisT,ref=ThisRef},Item,Image, Options)
when is_integer(Item),is_integer(Image),is_list(Options) ->
?CLASS(ThisT,wxListCtrl),
@@ -684,32 +752,36 @@ setItemImage(#wx_ref{type=ThisT,ref=ThisRef},Item,Image, Options)
wxe_util:call(?wxListCtrl_SetItemImage,
<<ThisRef:32/?UI,Item:32/?UI,Image:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxListCtrl(), Item::integer(), Column::integer(), Image::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetitemcolumnimage">external documentation</a>.
+-spec setItemColumnImage(This, Item, Column, Image) -> boolean() when
+ This::wxListCtrl(), Item::integer(), Column::integer(), Image::integer().
setItemColumnImage(#wx_ref{type=ThisT,ref=ThisRef},Item,Column,Image)
when is_integer(Item),is_integer(Column),is_integer(Image) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_SetItemColumnImage,
<<ThisRef:32/?UI,Item:32/?UI,Column:32/?UI,Image:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer(), Pos::{X::integer(), Y::integer()}) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetitemposition">external documentation</a>.
+-spec setItemPosition(This, Item, Pos) -> boolean() when
+ This::wxListCtrl(), Item::integer(), Pos::{X::integer(), Y::integer()}.
setItemPosition(#wx_ref{type=ThisT,ref=ThisRef},Item,{PosX,PosY})
when is_integer(Item),is_integer(PosX),is_integer(PosY) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_SetItemPosition,
<<ThisRef:32/?UI,Item:32/?UI,PosX:32/?UI,PosY:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer(), State::integer(), StateMask::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetitemstate">external documentation</a>.
+-spec setItemState(This, Item, State, StateMask) -> boolean() when
+ This::wxListCtrl(), Item::integer(), State::integer(), StateMask::integer().
setItemState(#wx_ref{type=ThisT,ref=ThisRef},Item,State,StateMask)
when is_integer(Item),is_integer(State),is_integer(StateMask) ->
?CLASS(ThisT,wxListCtrl),
wxe_util:call(?wxListCtrl_SetItemState,
<<ThisRef:32/?UI,Item:32/?UI,State:32/?UI,StateMask:32/?UI>>).
-%% @spec (This::wxListCtrl(), Item::integer(), Str::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetitemtext">external documentation</a>.
+-spec setItemText(This, Item, Str) -> ok when
+ This::wxListCtrl(), Item::integer(), Str::unicode:chardata().
setItemText(#wx_ref{type=ThisT,ref=ThisRef},Item,Str)
when is_integer(Item),is_list(Str) ->
?CLASS(ThisT,wxListCtrl),
@@ -717,23 +789,27 @@ setItemText(#wx_ref{type=ThisT,ref=ThisRef},Item,Str)
wxe_util:cast(?wxListCtrl_SetItemText,
<<ThisRef:32/?UI,Item:32/?UI,(byte_size(Str_UC)):32/?UI,(Str_UC)/binary, 0:(((8- ((4+byte_size(Str_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxListCtrl(), Item::integer(), Col::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetitemtextcolour">external documentation</a>.
+-spec setItemTextColour(This, Item, Col) -> ok when
+ This::wxListCtrl(), Item::integer(), Col::wx:wx_colour().
setItemTextColour(#wx_ref{type=ThisT,ref=ThisRef},Item,Col)
when is_integer(Item),tuple_size(Col) =:= 3; tuple_size(Col) =:= 4 ->
?CLASS(ThisT,wxListCtrl),
wxe_util:cast(?wxListCtrl_SetItemTextColour,
<<ThisRef:32/?UI,Item:32/?UI,(wxe_util:colour_bin(Col)):16/binary>>).
-%% @spec (This::wxListCtrl(), Style::integer()) -> ok
%% @equiv setSingleStyle(This,Style, [])
+-spec setSingleStyle(This, Style) -> ok when
+ This::wxListCtrl(), Style::integer().
+
setSingleStyle(This,Style)
when is_record(This, wx_ref),is_integer(Style) ->
setSingleStyle(This,Style, []).
-%% @spec (This::wxListCtrl(), Style::integer(), [Option]) -> ok
-%% Option = {add, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetsinglestyle">external documentation</a>.
+-spec setSingleStyle(This, Style, [Option]) -> ok when
+ This::wxListCtrl(), Style::integer(),
+ Option :: {add, boolean()}.
setSingleStyle(#wx_ref{type=ThisT,ref=ThisRef},Style, Options)
when is_integer(Style),is_list(Options) ->
?CLASS(ThisT,wxListCtrl),
@@ -743,16 +819,18 @@ setSingleStyle(#wx_ref{type=ThisT,ref=ThisRef},Style, Options)
wxe_util:cast(?wxListCtrl_SetSingleStyle,
<<ThisRef:32/?UI,Style:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxListCtrl(), Col::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsettextcolour">external documentation</a>.
+-spec setTextColour(This, Col) -> ok when
+ This::wxListCtrl(), Col::wx:wx_colour().
setTextColour(#wx_ref{type=ThisT,ref=ThisRef},Col)
when tuple_size(Col) =:= 3; tuple_size(Col) =:= 4 ->
?CLASS(ThisT,wxListCtrl),
wxe_util:cast(?wxListCtrl_SetTextColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Col)):16/binary>>).
-%% @spec (This::wxListCtrl(), Style::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistctrl.html#wxlistctrlsetwindowstyleflag">external documentation</a>.
+-spec setWindowStyleFlag(This, Style) -> ok when
+ This::wxListCtrl(), Style::integer().
setWindowStyleFlag(#wx_ref{type=ThisT,ref=ThisRef},Style)
when is_integer(Style) ->
?CLASS(ThisT,wxListCtrl),
@@ -777,8 +855,8 @@ sortItems(#wx_ref{type=ThisT,ref=ThisRef}, SortCallBack)
end,
SortId = wxe_util:get_cbId(Sort),
wxe_util:call(?wxListCtrl_SortItems, <<ThisRef:32/?UI,SortId:32/?UI>>).
-%% @spec (This::wxListCtrl()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxListCtrl()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxListCtrl),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxListEvent.erl b/lib/wx/src/gen/wxListEvent.erl
index f7d8658acc..9cbb816096 100644
--- a/lib/wx/src/gen/wxListEvent.erl
+++ b/lib/wx/src/gen/wxListEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -42,98 +42,113 @@
isSelection/1,parent_class/1,resumePropagation/2,setInt/2,setString/2,
shouldPropagate/1,skip/1,skip/2,stopPropagation/1,veto/1]).
+-export_type([wxListEvent/0]).
%% @hidden
parent_class(wxNotifyEvent) -> true;
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxListEvent()) -> integer()
+-type wxListEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistevent.html#wxlisteventgetcachefrom">external documentation</a>.
+-spec getCacheFrom(This) -> integer() when
+ This::wxListEvent().
getCacheFrom(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListEvent),
wxe_util:call(?wxListEvent_GetCacheFrom,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistevent.html#wxlisteventgetcacheto">external documentation</a>.
+-spec getCacheTo(This) -> integer() when
+ This::wxListEvent().
getCacheTo(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListEvent),
wxe_util:call(?wxListEvent_GetCacheTo,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistevent.html#wxlisteventgetkeycode">external documentation</a>.
+-spec getKeyCode(This) -> integer() when
+ This::wxListEvent().
getKeyCode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListEvent),
wxe_util:call(?wxListEvent_GetKeyCode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistevent.html#wxlisteventgetindex">external documentation</a>.
+-spec getIndex(This) -> integer() when
+ This::wxListEvent().
getIndex(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListEvent),
wxe_util:call(?wxListEvent_GetIndex,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistevent.html#wxlisteventgetcolumn">external documentation</a>.
+-spec getColumn(This) -> integer() when
+ This::wxListEvent().
getColumn(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListEvent),
wxe_util:call(?wxListEvent_GetColumn,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListEvent()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistevent.html#wxlisteventgetpoint">external documentation</a>.
+-spec getPoint(This) -> {X::integer(), Y::integer()} when
+ This::wxListEvent().
getPoint(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListEvent),
wxe_util:call(?wxListEvent_GetPoint,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListEvent()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistevent.html#wxlisteventgetlabel">external documentation</a>.
+-spec getLabel(This) -> unicode:charlist() when
+ This::wxListEvent().
getLabel(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListEvent),
wxe_util:call(?wxListEvent_GetLabel,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListEvent()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistevent.html#wxlisteventgettext">external documentation</a>.
+-spec getText(This) -> unicode:charlist() when
+ This::wxListEvent().
getText(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListEvent),
wxe_util:call(?wxListEvent_GetText,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistevent.html#wxlisteventgetimage">external documentation</a>.
+-spec getImage(This) -> integer() when
+ This::wxListEvent().
getImage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListEvent),
wxe_util:call(?wxListEvent_GetImage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistevent.html#wxlisteventgetdata">external documentation</a>.
+-spec getData(This) -> integer() when
+ This::wxListEvent().
getData(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListEvent),
wxe_util:call(?wxListEvent_GetData,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistevent.html#wxlisteventgetmask">external documentation</a>.
+-spec getMask(This) -> integer() when
+ This::wxListEvent().
getMask(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListEvent),
wxe_util:call(?wxListEvent_GetMask,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListEvent()) -> wxListItem:wxListItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistevent.html#wxlisteventgetitem">external documentation</a>.
+-spec getItem(This) -> wxListItem:wxListItem() when
+ This::wxListEvent().
getItem(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListEvent),
wxe_util:call(?wxListEvent_GetItem,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistevent.html#wxlisteventiseditcancelled">external documentation</a>.
+-spec isEditCancelled(This) -> boolean() when
+ This::wxListEvent().
isEditCancelled(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListEvent),
wxe_util:call(?wxListEvent_IsEditCancelled,
diff --git a/lib/wx/src/gen/wxListItem.erl b/lib/wx/src/gen/wxListItem.erl
index 326f674b28..787d686135 100644
--- a/lib/wx/src/gen/wxListItem.erl
+++ b/lib/wx/src/gen/wxListItem.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -33,184 +33,207 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxListItem/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxListItem()
+-type wxListItem() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemwxlistitem">external documentation</a>.
+-spec new() -> wxListItem().
new() ->
wxe_util:construct(?wxListItem_new_0,
<<>>).
-%% @spec (Item::wxListItem()) -> wxListItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemwxlistitem">external documentation</a>.
+-spec new(Item) -> wxListItem() when
+ Item::wxListItem().
new(#wx_ref{type=ItemT,ref=ItemRef}) ->
?CLASS(ItemT,wxListItem),
wxe_util:construct(?wxListItem_new_1,
<<ItemRef:32/?UI>>).
-%% @spec (This::wxListItem()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemclear">external documentation</a>.
+-spec clear(This) -> ok when
+ This::wxListItem().
clear(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItem),
wxe_util:cast(?wxListItem_Clear,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItem()) -> WxListColumnFormat
-%% WxListColumnFormat = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemgetalign">external documentation</a>.
-%%<br /> WxListColumnFormat is one of ?wxLIST_FORMAT_LEFT | ?wxLIST_FORMAT_RIGHT | ?wxLIST_FORMAT_CENTRE | ?wxLIST_FORMAT_CENTER
+%%<br /> Res = ?wxLIST_FORMAT_LEFT | ?wxLIST_FORMAT_RIGHT | ?wxLIST_FORMAT_CENTRE | ?wxLIST_FORMAT_CENTER
+-spec getAlign(This) -> wx:wx_enum() when
+ This::wxListItem().
getAlign(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItem),
wxe_util:call(?wxListItem_GetAlign,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItem()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemgetbackgroundcolour">external documentation</a>.
+-spec getBackgroundColour(This) -> wx:wx_colour4() when
+ This::wxListItem().
getBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItem),
wxe_util:call(?wxListItem_GetBackgroundColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItem()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemgetcolumn">external documentation</a>.
+-spec getColumn(This) -> integer() when
+ This::wxListItem().
getColumn(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItem),
wxe_util:call(?wxListItem_GetColumn,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItem()) -> wxFont:wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemgetfont">external documentation</a>.
+-spec getFont(This) -> wxFont:wxFont() when
+ This::wxListItem().
getFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItem),
wxe_util:call(?wxListItem_GetFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItem()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemgetid">external documentation</a>.
+-spec getId(This) -> integer() when
+ This::wxListItem().
getId(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItem),
wxe_util:call(?wxListItem_GetId,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItem()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemgetimage">external documentation</a>.
+-spec getImage(This) -> integer() when
+ This::wxListItem().
getImage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItem),
wxe_util:call(?wxListItem_GetImage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItem()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemgetmask">external documentation</a>.
+-spec getMask(This) -> integer() when
+ This::wxListItem().
getMask(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItem),
wxe_util:call(?wxListItem_GetMask,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItem()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemgetstate">external documentation</a>.
+-spec getState(This) -> integer() when
+ This::wxListItem().
getState(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItem),
wxe_util:call(?wxListItem_GetState,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItem()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemgettext">external documentation</a>.
+-spec getText(This) -> unicode:charlist() when
+ This::wxListItem().
getText(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItem),
wxe_util:call(?wxListItem_GetText,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItem()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemgettextcolour">external documentation</a>.
+-spec getTextColour(This) -> wx:wx_colour4() when
+ This::wxListItem().
getTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItem),
wxe_util:call(?wxListItem_GetTextColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItem()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemgetwidth">external documentation</a>.
+-spec getWidth(This) -> integer() when
+ This::wxListItem().
getWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItem),
wxe_util:call(?wxListItem_GetWidth,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItem(), Align::WxListColumnFormat) -> ok
-%% WxListColumnFormat = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemsetalign">external documentation</a>.
-%%<br /> WxListColumnFormat is one of ?wxLIST_FORMAT_LEFT | ?wxLIST_FORMAT_RIGHT | ?wxLIST_FORMAT_CENTRE | ?wxLIST_FORMAT_CENTER
+%%<br /> Align = ?wxLIST_FORMAT_LEFT | ?wxLIST_FORMAT_RIGHT | ?wxLIST_FORMAT_CENTRE | ?wxLIST_FORMAT_CENTER
+-spec setAlign(This, Align) -> ok when
+ This::wxListItem(), Align::wx:wx_enum().
setAlign(#wx_ref{type=ThisT,ref=ThisRef},Align)
when is_integer(Align) ->
?CLASS(ThisT,wxListItem),
wxe_util:cast(?wxListItem_SetAlign,
<<ThisRef:32/?UI,Align:32/?UI>>).
-%% @spec (This::wxListItem(), ColBack::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemsetbackgroundcolour">external documentation</a>.
+-spec setBackgroundColour(This, ColBack) -> ok when
+ This::wxListItem(), ColBack::wx:wx_colour().
setBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},ColBack)
when tuple_size(ColBack) =:= 3; tuple_size(ColBack) =:= 4 ->
?CLASS(ThisT,wxListItem),
wxe_util:cast(?wxListItem_SetBackgroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(ColBack)):16/binary>>).
-%% @spec (This::wxListItem(), Col::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemsetcolumn">external documentation</a>.
+-spec setColumn(This, Col) -> ok when
+ This::wxListItem(), Col::integer().
setColumn(#wx_ref{type=ThisT,ref=ThisRef},Col)
when is_integer(Col) ->
?CLASS(ThisT,wxListItem),
wxe_util:cast(?wxListItem_SetColumn,
<<ThisRef:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxListItem(), Font::wxFont:wxFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemsetfont">external documentation</a>.
+-spec setFont(This, Font) -> ok when
+ This::wxListItem(), Font::wxFont:wxFont().
setFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}) ->
?CLASS(ThisT,wxListItem),
?CLASS(FontT,wxFont),
wxe_util:cast(?wxListItem_SetFont,
<<ThisRef:32/?UI,FontRef:32/?UI>>).
-%% @spec (This::wxListItem(), Id::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemsetid">external documentation</a>.
+-spec setId(This, Id) -> ok when
+ This::wxListItem(), Id::integer().
setId(#wx_ref{type=ThisT,ref=ThisRef},Id)
when is_integer(Id) ->
?CLASS(ThisT,wxListItem),
wxe_util:cast(?wxListItem_SetId,
<<ThisRef:32/?UI,Id:32/?UI>>).
-%% @spec (This::wxListItem(), Image::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemsetimage">external documentation</a>.
+-spec setImage(This, Image) -> ok when
+ This::wxListItem(), Image::integer().
setImage(#wx_ref{type=ThisT,ref=ThisRef},Image)
when is_integer(Image) ->
?CLASS(ThisT,wxListItem),
wxe_util:cast(?wxListItem_SetImage,
<<ThisRef:32/?UI,Image:32/?UI>>).
-%% @spec (This::wxListItem(), Mask::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemsetmask">external documentation</a>.
+-spec setMask(This, Mask) -> ok when
+ This::wxListItem(), Mask::integer().
setMask(#wx_ref{type=ThisT,ref=ThisRef},Mask)
when is_integer(Mask) ->
?CLASS(ThisT,wxListItem),
wxe_util:cast(?wxListItem_SetMask,
<<ThisRef:32/?UI,Mask:32/?UI>>).
-%% @spec (This::wxListItem(), State::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemsetstate">external documentation</a>.
+-spec setState(This, State) -> ok when
+ This::wxListItem(), State::integer().
setState(#wx_ref{type=ThisT,ref=ThisRef},State)
when is_integer(State) ->
?CLASS(ThisT,wxListItem),
wxe_util:cast(?wxListItem_SetState,
<<ThisRef:32/?UI,State:32/?UI>>).
-%% @spec (This::wxListItem(), StateMask::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemsetstatemask">external documentation</a>.
+-spec setStateMask(This, StateMask) -> ok when
+ This::wxListItem(), StateMask::integer().
setStateMask(#wx_ref{type=ThisT,ref=ThisRef},StateMask)
when is_integer(StateMask) ->
?CLASS(ThisT,wxListItem),
wxe_util:cast(?wxListItem_SetStateMask,
<<ThisRef:32/?UI,StateMask:32/?UI>>).
-%% @spec (This::wxListItem(), Text::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemsettext">external documentation</a>.
+-spec setText(This, Text) -> ok when
+ This::wxListItem(), Text::unicode:chardata().
setText(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_list(Text) ->
?CLASS(ThisT,wxListItem),
@@ -218,24 +241,26 @@ setText(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:cast(?wxListItem_SetText,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxListItem(), ColText::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemsettextcolour">external documentation</a>.
+-spec setTextColour(This, ColText) -> ok when
+ This::wxListItem(), ColText::wx:wx_colour().
setTextColour(#wx_ref{type=ThisT,ref=ThisRef},ColText)
when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4 ->
?CLASS(ThisT,wxListItem),
wxe_util:cast(?wxListItem_SetTextColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(ColText)):16/binary>>).
-%% @spec (This::wxListItem(), Width::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitem.html#wxlistitemsetwidth">external documentation</a>.
+-spec setWidth(This, Width) -> ok when
+ This::wxListItem(), Width::integer().
setWidth(#wx_ref{type=ThisT,ref=ThisRef},Width)
when is_integer(Width) ->
?CLASS(ThisT,wxListItem),
wxe_util:cast(?wxListItem_SetWidth,
<<ThisRef:32/?UI,Width:32/?UI>>).
-%% @spec (This::wxListItem()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxListItem()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxListItem),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxListItemAttr.erl b/lib/wx/src/gen/wxListItemAttr.erl
index 1a43c71854..daf5ebe96a 100644
--- a/lib/wx/src/gen/wxListItemAttr.erl
+++ b/lib/wx/src/gen/wxListItemAttr.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -31,91 +31,103 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxListItemAttr/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxListItemAttr()
+-type wxListItemAttr() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitemattr.html#wxlistitemattrwxlistitemattr">external documentation</a>.
+-spec new() -> wxListItemAttr().
new() ->
wxe_util:construct(?wxListItemAttr_new_0,
<<>>).
-%% @spec (ColText::wx:colour(), ColBack::wx:colour(), Font::wxFont:wxFont()) -> wxListItemAttr()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitemattr.html#wxlistitemattrwxlistitemattr">external documentation</a>.
+-spec new(ColText, ColBack, Font) -> wxListItemAttr() when
+ ColText::wx:wx_colour(), ColBack::wx:wx_colour(), Font::wxFont:wxFont().
new(ColText,ColBack,#wx_ref{type=FontT,ref=FontRef})
when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4,tuple_size(ColBack) =:= 3; tuple_size(ColBack) =:= 4 ->
?CLASS(FontT,wxFont),
wxe_util:construct(?wxListItemAttr_new_3,
<<(wxe_util:colour_bin(ColText)):16/binary,(wxe_util:colour_bin(ColBack)):16/binary,FontRef:32/?UI>>).
-%% @spec (This::wxListItemAttr()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitemattr.html#wxlistitemattrgetbackgroundcolour">external documentation</a>.
+-spec getBackgroundColour(This) -> wx:wx_colour4() when
+ This::wxListItemAttr().
getBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItemAttr),
wxe_util:call(?wxListItemAttr_GetBackgroundColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItemAttr()) -> wxFont:wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitemattr.html#wxlistitemattrgetfont">external documentation</a>.
+-spec getFont(This) -> wxFont:wxFont() when
+ This::wxListItemAttr().
getFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItemAttr),
wxe_util:call(?wxListItemAttr_GetFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItemAttr()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitemattr.html#wxlistitemattrgettextcolour">external documentation</a>.
+-spec getTextColour(This) -> wx:wx_colour4() when
+ This::wxListItemAttr().
getTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItemAttr),
wxe_util:call(?wxListItemAttr_GetTextColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItemAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitemattr.html#wxlistitemattrhasbackgroundcolour">external documentation</a>.
+-spec hasBackgroundColour(This) -> boolean() when
+ This::wxListItemAttr().
hasBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItemAttr),
wxe_util:call(?wxListItemAttr_HasBackgroundColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItemAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitemattr.html#wxlistitemattrhasfont">external documentation</a>.
+-spec hasFont(This) -> boolean() when
+ This::wxListItemAttr().
hasFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItemAttr),
wxe_util:call(?wxListItemAttr_HasFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItemAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitemattr.html#wxlistitemattrhastextcolour">external documentation</a>.
+-spec hasTextColour(This) -> boolean() when
+ This::wxListItemAttr().
hasTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListItemAttr),
wxe_util:call(?wxListItemAttr_HasTextColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListItemAttr(), ColBack::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitemattr.html#wxlistitemattrsetbackgroundcolour">external documentation</a>.
+-spec setBackgroundColour(This, ColBack) -> ok when
+ This::wxListItemAttr(), ColBack::wx:wx_colour().
setBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},ColBack)
when tuple_size(ColBack) =:= 3; tuple_size(ColBack) =:= 4 ->
?CLASS(ThisT,wxListItemAttr),
wxe_util:cast(?wxListItemAttr_SetBackgroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(ColBack)):16/binary>>).
-%% @spec (This::wxListItemAttr(), Font::wxFont:wxFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitemattr.html#wxlistitemattrsetfont">external documentation</a>.
+-spec setFont(This, Font) -> ok when
+ This::wxListItemAttr(), Font::wxFont:wxFont().
setFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}) ->
?CLASS(ThisT,wxListItemAttr),
?CLASS(FontT,wxFont),
wxe_util:cast(?wxListItemAttr_SetFont,
<<ThisRef:32/?UI,FontRef:32/?UI>>).
-%% @spec (This::wxListItemAttr(), ColText::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistitemattr.html#wxlistitemattrsettextcolour">external documentation</a>.
+-spec setTextColour(This, ColText) -> ok when
+ This::wxListItemAttr(), ColText::wx:wx_colour().
setTextColour(#wx_ref{type=ThisT,ref=ThisRef},ColText)
when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4 ->
?CLASS(ThisT,wxListItemAttr),
wxe_util:cast(?wxListItemAttr_SetTextColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(ColText)):16/binary>>).
-%% @spec (This::wxListItemAttr()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxListItemAttr()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxListItemAttr),
wxe_util:destroy(?wxListItemAttr_destroy,Obj),
diff --git a/lib/wx/src/gen/wxListView.erl b/lib/wx/src/gen/wxListView.erl
index 95a233a562..87cc28cd15 100644
--- a/lib/wx/src/gen/wxListView.erl
+++ b/lib/wx/src/gen/wxListView.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -70,67 +70,78 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxListView/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxListView(), Col::integer()) -> ok
+-type wxListView() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistview.html#wxlistviewclearcolumnimage">external documentation</a>.
+-spec clearColumnImage(This, Col) -> ok when
+ This::wxListView(), Col::integer().
clearColumnImage(#wx_ref{type=ThisT,ref=ThisRef},Col)
when is_integer(Col) ->
?CLASS(ThisT,wxListView),
wxe_util:cast(?wxListView_ClearColumnImage,
<<ThisRef:32/?UI,Col:32/?UI>>).
-%% @spec (This::wxListView(), Index::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistview.html#wxlistviewfocus">external documentation</a>.
+-spec focus(This, Index) -> ok when
+ This::wxListView(), Index::integer().
focus(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxListView),
wxe_util:cast(?wxListView_Focus,
<<ThisRef:32/?UI,Index:32/?UI>>).
-%% @spec (This::wxListView()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistview.html#wxlistviewgetfirstselected">external documentation</a>.
+-spec getFirstSelected(This) -> integer() when
+ This::wxListView().
getFirstSelected(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListView),
wxe_util:call(?wxListView_GetFirstSelected,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListView()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistview.html#wxlistviewgetfocuseditem">external documentation</a>.
+-spec getFocusedItem(This) -> integer() when
+ This::wxListView().
getFocusedItem(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListView),
wxe_util:call(?wxListView_GetFocusedItem,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListView(), Item::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistview.html#wxlistviewgetnextselected">external documentation</a>.
+-spec getNextSelected(This, Item) -> integer() when
+ This::wxListView(), Item::integer().
getNextSelected(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxListView),
wxe_util:call(?wxListView_GetNextSelected,
<<ThisRef:32/?UI,Item:32/?UI>>).
-%% @spec (This::wxListView(), Index::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistview.html#wxlistviewisselected">external documentation</a>.
+-spec isSelected(This, Index) -> boolean() when
+ This::wxListView(), Index::integer().
isSelected(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxListView),
wxe_util:call(?wxListView_IsSelected,
<<ThisRef:32/?UI,Index:32/?UI>>).
-%% @spec (This::wxListView(), N::integer()) -> ok
%% @equiv select(This,N, [])
+-spec select(This, N) -> ok when
+ This::wxListView(), N::integer().
+
select(This,N)
when is_record(This, wx_ref),is_integer(N) ->
select(This,N, []).
-%% @spec (This::wxListView(), N::integer(), [Option]) -> ok
-%% Option = {on, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistview.html#wxlistviewselect">external documentation</a>.
+-spec select(This, N, [Option]) -> ok when
+ This::wxListView(), N::integer(),
+ Option :: {on, boolean()}.
select(#wx_ref{type=ThisT,ref=ThisRef},N, Options)
when is_integer(N),is_list(Options) ->
?CLASS(ThisT,wxListView),
@@ -140,8 +151,9 @@ select(#wx_ref{type=ThisT,ref=ThisRef},N, Options)
wxe_util:cast(?wxListView_Select,
<<ThisRef:32/?UI,N:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxListView(), Col::integer(), Image::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistview.html#wxlistviewsetcolumnimage">external documentation</a>.
+-spec setColumnImage(This, Col, Image) -> ok when
+ This::wxListView(), Col::integer(), Image::integer().
setColumnImage(#wx_ref{type=ThisT,ref=ThisRef},Col,Image)
when is_integer(Col),is_integer(Image) ->
?CLASS(ThisT,wxListView),
diff --git a/lib/wx/src/gen/wxListbook.erl b/lib/wx/src/gen/wxListbook.erl
index c204dc87a1..0907d554f4 100644
--- a/lib/wx/src/gen/wxListbook.erl
+++ b/lib/wx/src/gen/wxListbook.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -74,27 +74,34 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxListbook/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxListbook()
+-type wxListbook() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookwxlistbook">external documentation</a>.
+-spec new() -> wxListbook().
new() ->
wxe_util:construct(?wxListbook_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxListbook()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxListbook() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxListbook()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookwxlistbook">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxListbook() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -106,15 +113,19 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxListbook_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxListbook(), Page::wxWindow:wxWindow(), Text::string()) -> bool()
%% @equiv addPage(This,Page,Text, [])
+-spec addPage(This, Page, Text) -> boolean() when
+ This::wxListbook(), Page::wxWindow:wxWindow(), Text::unicode:chardata().
+
addPage(This,Page,Text)
when is_record(This, wx_ref),is_record(Page, wx_ref),is_list(Text) ->
addPage(This,Page,Text, []).
-%% @spec (This::wxListbook(), Page::wxWindow:wxWindow(), Text::string(), [Option]) -> bool()
-%% Option = {bSelect, bool()} | {imageId, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookaddpage">external documentation</a>.
+-spec addPage(This, Page, Text, [Option]) -> boolean() when
+ This::wxListbook(), Page::wxWindow:wxWindow(), Text::unicode:chardata(),
+ Option :: {bSelect, boolean()}
+ | {imageId, integer()}.
addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Text, Options)
when is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxListbook),
@@ -127,15 +138,18 @@ addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Text, Op
wxe_util:call(?wxListbook_AddPage,
<<ThisRef:32/?UI,PageRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxListbook()) -> ok
%% @equiv advanceSelection(This, [])
+-spec advanceSelection(This) -> ok when
+ This::wxListbook().
+
advanceSelection(This)
when is_record(This, wx_ref) ->
advanceSelection(This, []).
-%% @spec (This::wxListbook(), [Option]) -> ok
-%% Option = {forward, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookadvanceselection">external documentation</a>.
+-spec advanceSelection(This, [Option]) -> ok when
+ This::wxListbook(),
+ Option :: {forward, boolean()}.
advanceSelection(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxListbook),
@@ -145,23 +159,29 @@ advanceSelection(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxListbook_AdvanceSelection,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxListbook(), ImageList::wxImageList:wxImageList()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookassignimagelist">external documentation</a>.
+-spec assignImageList(This, ImageList) -> ok when
+ This::wxListbook(), ImageList::wxImageList:wxImageList().
assignImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef}) ->
?CLASS(ThisT,wxListbook),
?CLASS(ImageListT,wxImageList),
wxe_util:cast(?wxListbook_AssignImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI>>).
-%% @spec (This::wxListbook(), Parent::wxWindow:wxWindow(), Id::integer()) -> bool()
%% @equiv create(This,Parent,Id, [])
+-spec create(This, Parent, Id) -> boolean() when
+ This::wxListbook(), Parent::wxWindow:wxWindow(), Id::integer().
+
create(This,Parent,Id)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id) ->
create(This,Parent,Id, []).
-%% @spec (This::wxListbook(), Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookcreate">external documentation</a>.
+-spec create(This, Parent, Id, [Option]) -> boolean() when
+ This::wxListbook(), Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ThisT,wxListbook),
@@ -174,98 +194,114 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, O
wxe_util:call(?wxListbook_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxListbook()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookdeleteallpages">external documentation</a>.
+-spec deleteAllPages(This) -> boolean() when
+ This::wxListbook().
deleteAllPages(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListbook),
wxe_util:call(?wxListbook_DeleteAllPages,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListbook(), N::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookdeletepage">external documentation</a>.
+-spec deletePage(This, N) -> boolean() when
+ This::wxListbook(), N::integer().
deletePage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxListbook),
wxe_util:call(?wxListbook_DeletePage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxListbook(), N::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookremovepage">external documentation</a>.
+-spec removePage(This, N) -> boolean() when
+ This::wxListbook(), N::integer().
removePage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxListbook),
wxe_util:call(?wxListbook_RemovePage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxListbook()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookgetcurrentpage">external documentation</a>.
+-spec getCurrentPage(This) -> wxWindow:wxWindow() when
+ This::wxListbook().
getCurrentPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListbook),
wxe_util:call(?wxListbook_GetCurrentPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListbook()) -> wxImageList:wxImageList()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookgetimagelist">external documentation</a>.
+-spec getImageList(This) -> wxImageList:wxImageList() when
+ This::wxListbook().
getImageList(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListbook),
wxe_util:call(?wxListbook_GetImageList,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListbook(), N::integer()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookgetpage">external documentation</a>.
+-spec getPage(This, N) -> wxWindow:wxWindow() when
+ This::wxListbook(), N::integer().
getPage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxListbook),
wxe_util:call(?wxListbook_GetPage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxListbook()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookgetpagecount">external documentation</a>.
+-spec getPageCount(This) -> integer() when
+ This::wxListbook().
getPageCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListbook),
wxe_util:call(?wxListbook_GetPageCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListbook(), N::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookgetpageimage">external documentation</a>.
+-spec getPageImage(This, N) -> integer() when
+ This::wxListbook(), N::integer().
getPageImage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxListbook),
wxe_util:call(?wxListbook_GetPageImage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxListbook(), N::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookgetpagetext">external documentation</a>.
+-spec getPageText(This, N) -> unicode:charlist() when
+ This::wxListbook(), N::integer().
getPageText(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxListbook),
wxe_util:call(?wxListbook_GetPageText,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxListbook()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookgetselection">external documentation</a>.
+-spec getSelection(This) -> integer() when
+ This::wxListbook().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxListbook),
wxe_util:call(?wxListbook_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxListbook(), Pt::{X::integer(), Y::integer()}) -> {integer(), Flags::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookhittest">external documentation</a>.
+-spec hitTest(This, Pt) -> Result when
+ Result ::{Res ::integer(), Flags::integer()},
+ This::wxListbook(), Pt::{X::integer(), Y::integer()}.
hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxListbook),
wxe_util:call(?wxListbook_HitTest,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxListbook(), N::integer(), Page::wxWindow:wxWindow(), Text::string()) -> bool()
%% @equiv insertPage(This,N,Page,Text, [])
+-spec insertPage(This, N, Page, Text) -> boolean() when
+ This::wxListbook(), N::integer(), Page::wxWindow:wxWindow(), Text::unicode:chardata().
+
insertPage(This,N,Page,Text)
when is_record(This, wx_ref),is_integer(N),is_record(Page, wx_ref),is_list(Text) ->
insertPage(This,N,Page,Text, []).
-%% @spec (This::wxListbook(), N::integer(), Page::wxWindow:wxWindow(), Text::string(), [Option]) -> bool()
-%% Option = {bSelect, bool()} | {imageId, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookinsertpage">external documentation</a>.
+-spec insertPage(This, N, Page, Text, [Option]) -> boolean() when
+ This::wxListbook(), N::integer(), Page::wxWindow:wxWindow(), Text::unicode:chardata(),
+ Option :: {bSelect, boolean()}
+ | {imageId, integer()}.
insertPage(#wx_ref{type=ThisT,ref=ThisRef},N,#wx_ref{type=PageT,ref=PageRef},Text, Options)
when is_integer(N),is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxListbook),
@@ -278,32 +314,36 @@ insertPage(#wx_ref{type=ThisT,ref=ThisRef},N,#wx_ref{type=PageT,ref=PageRef},Tex
wxe_util:call(?wxListbook_InsertPage,
<<ThisRef:32/?UI,N:32/?UI,PageRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxListbook(), ImageList::wxImageList:wxImageList()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbooksetimagelist">external documentation</a>.
+-spec setImageList(This, ImageList) -> ok when
+ This::wxListbook(), ImageList::wxImageList:wxImageList().
setImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef}) ->
?CLASS(ThisT,wxListbook),
?CLASS(ImageListT,wxImageList),
wxe_util:cast(?wxListbook_SetImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI>>).
-%% @spec (This::wxListbook(), Size::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbooksetpagesize">external documentation</a>.
+-spec setPageSize(This, Size) -> ok when
+ This::wxListbook(), Size::{W::integer(), H::integer()}.
setPageSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxListbook),
wxe_util:cast(?wxListbook_SetPageSize,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxListbook(), N::integer(), ImageId::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbooksetpageimage">external documentation</a>.
+-spec setPageImage(This, N, ImageId) -> boolean() when
+ This::wxListbook(), N::integer(), ImageId::integer().
setPageImage(#wx_ref{type=ThisT,ref=ThisRef},N,ImageId)
when is_integer(N),is_integer(ImageId) ->
?CLASS(ThisT,wxListbook),
wxe_util:call(?wxListbook_SetPageImage,
<<ThisRef:32/?UI,N:32/?UI,ImageId:32/?UI>>).
-%% @spec (This::wxListbook(), N::integer(), StrText::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbooksetpagetext">external documentation</a>.
+-spec setPageText(This, N, StrText) -> boolean() when
+ This::wxListbook(), N::integer(), StrText::unicode:chardata().
setPageText(#wx_ref{type=ThisT,ref=ThisRef},N,StrText)
when is_integer(N),is_list(StrText) ->
?CLASS(ThisT,wxListbook),
@@ -311,24 +351,26 @@ setPageText(#wx_ref{type=ThisT,ref=ThisRef},N,StrText)
wxe_util:call(?wxListbook_SetPageText,
<<ThisRef:32/?UI,N:32/?UI,(byte_size(StrText_UC)):32/?UI,(StrText_UC)/binary, 0:(((8- ((4+byte_size(StrText_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxListbook(), N::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbooksetselection">external documentation</a>.
+-spec setSelection(This, N) -> integer() when
+ This::wxListbook(), N::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxListbook),
wxe_util:call(?wxListbook_SetSelection,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxListbook(), N::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlistbook.html#wxlistbookchangeselection">external documentation</a>.
+-spec changeSelection(This, N) -> integer() when
+ This::wxListbook(), N::integer().
changeSelection(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxListbook),
wxe_util:call(?wxListbook_ChangeSelection,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxListbook()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxListbook()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxListbook),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxLogNull.erl b/lib/wx/src/gen/wxLogNull.erl
index 676fdf6d85..0ac4e8f9a3 100644
--- a/lib/wx/src/gen/wxLogNull.erl
+++ b/lib/wx/src/gen/wxLogNull.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -29,17 +29,19 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxLogNull/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxLogNull()
+-type wxLogNull() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxlognull.html#wxlognullwxlognull">external documentation</a>.
+-spec new() -> wxLogNull().
new() ->
wxe_util:construct(?wxLogNull_new,
<<>>).
-%% @spec (This::wxLogNull()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxLogNull()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxLogNull),
wxe_util:destroy(?wxLogNull_destroy,Obj),
diff --git a/lib/wx/src/gen/wxMDIChildFrame.erl b/lib/wx/src/gen/wxMDIChildFrame.erl
index d3e1edda55..861beba34f 100644
--- a/lib/wx/src/gen/wxMDIChildFrame.erl
+++ b/lib/wx/src/gen/wxMDIChildFrame.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -80,6 +80,7 @@
thaw/1,transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxMDIChildFrame/0]).
%% @hidden
parent_class(wxFrame) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -87,21 +88,27 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxMDIChildFrame()
+-type wxMDIChildFrame() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdichildframe.html#wxmdichildframewxmdichildframe">external documentation</a>.
+-spec new() -> wxMDIChildFrame().
new() ->
wxe_util:construct(?wxMDIChildFrame_new_0,
<<>>).
-%% @spec (Parent::wxMDIParentFrame:wxMDIParentFrame(), Id::integer(), Title::string()) -> wxMDIChildFrame()
%% @equiv new(Parent,Id,Title, [])
+-spec new(Parent, Id, Title) -> wxMDIChildFrame() when
+ Parent::wxMDIParentFrame:wxMDIParentFrame(), Id::integer(), Title::unicode:chardata().
+
new(Parent,Id,Title)
when is_record(Parent, wx_ref),is_integer(Id),is_list(Title) ->
new(Parent,Id,Title, []).
-%% @spec (Parent::wxMDIParentFrame:wxMDIParentFrame(), Id::integer(), Title::string(), [Option]) -> wxMDIChildFrame()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdichildframe.html#wxmdichildframewxmdichildframe">external documentation</a>.
+-spec new(Parent, Id, Title, [Option]) -> wxMDIChildFrame() when
+ Parent::wxMDIParentFrame:wxMDIParentFrame(), Id::integer(), Title::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options)
when is_integer(Id),is_list(Title),is_list(Options) ->
?CLASS(ParentT,wxMDIParentFrame),
@@ -114,22 +121,28 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options)
wxe_util:construct(?wxMDIChildFrame_new_4,
<<ParentRef:32/?UI,Id:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((4+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMDIChildFrame()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdichildframe.html#wxmdichildframeactivate">external documentation</a>.
+-spec activate(This) -> ok when
+ This::wxMDIChildFrame().
activate(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMDIChildFrame),
wxe_util:cast(?wxMDIChildFrame_Activate,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMDIChildFrame(), Parent::wxMDIParentFrame:wxMDIParentFrame(), Id::integer(), Title::string()) -> bool()
%% @equiv create(This,Parent,Id,Title, [])
+-spec create(This, Parent, Id, Title) -> boolean() when
+ This::wxMDIChildFrame(), Parent::wxMDIParentFrame:wxMDIParentFrame(), Id::integer(), Title::unicode:chardata().
+
create(This,Parent,Id,Title)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Title) ->
create(This,Parent,Id,Title, []).
-%% @spec (This::wxMDIChildFrame(), Parent::wxMDIParentFrame:wxMDIParentFrame(), Id::integer(), Title::string(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdichildframe.html#wxmdichildframecreate">external documentation</a>.
+-spec create(This, Parent, Id, Title, [Option]) -> boolean() when
+ This::wxMDIChildFrame(), Parent::wxMDIParentFrame:wxMDIParentFrame(), Id::integer(), Title::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options)
when is_integer(Id),is_list(Title),is_list(Options) ->
?CLASS(ThisT,wxMDIChildFrame),
@@ -143,15 +156,18 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Ti
wxe_util:call(?wxMDIChildFrame_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((0+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMDIChildFrame()) -> ok
%% @equiv maximize(This, [])
+-spec maximize(This) -> ok when
+ This::wxMDIChildFrame().
+
maximize(This)
when is_record(This, wx_ref) ->
maximize(This, []).
-%% @spec (This::wxMDIChildFrame(), [Option]) -> ok
-%% Option = {maximize, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdichildframe.html#wxmdichildframemaximize">external documentation</a>.
+-spec maximize(This, [Option]) -> ok when
+ This::wxMDIChildFrame(),
+ Option :: {maximize, boolean()}.
maximize(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxMDIChildFrame),
@@ -161,15 +177,16 @@ maximize(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxMDIChildFrame_Maximize,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxMDIChildFrame()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdichildframe.html#wxmdichildframerestore">external documentation</a>.
+-spec restore(This) -> ok when
+ This::wxMDIChildFrame().
restore(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMDIChildFrame),
wxe_util:cast(?wxMDIChildFrame_Restore,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMDIChildFrame()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxMDIChildFrame()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxMDIChildFrame),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxMDIClientWindow.erl b/lib/wx/src/gen/wxMDIClientWindow.erl
index 79a11b4eb7..344dcdbbaf 100644
--- a/lib/wx/src/gen/wxMDIClientWindow.erl
+++ b/lib/wx/src/gen/wxMDIClientWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -68,26 +68,31 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxMDIClientWindow/0]).
%% @hidden
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxMDIClientWindow()
+-type wxMDIClientWindow() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdiclientwindow.html#wxmdiclientwindowwxmdiclientwindow">external documentation</a>.
+-spec new() -> wxMDIClientWindow().
new() ->
wxe_util:construct(?wxMDIClientWindow_new_0,
<<>>).
-%% @spec (Parent::wxMDIParentFrame:wxMDIParentFrame()) -> wxMDIClientWindow()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxMDIClientWindow() when
+ Parent::wxMDIParentFrame:wxMDIParentFrame().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxMDIParentFrame:wxMDIParentFrame(), [Option]) -> wxMDIClientWindow()
-%% Option = {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdiclientwindow.html#wxmdiclientwindowwxmdiclientwindow">external documentation</a>.
+-spec new(Parent, [Option]) -> wxMDIClientWindow() when
+ Parent::wxMDIParentFrame:wxMDIParentFrame(),
+ Option :: {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxMDIParentFrame),
@@ -97,15 +102,18 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxMDIClientWindow_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxMDIClientWindow(), Parent::wxMDIParentFrame:wxMDIParentFrame()) -> bool()
%% @equiv createClient(This,Parent, [])
+-spec createClient(This, Parent) -> boolean() when
+ This::wxMDIClientWindow(), Parent::wxMDIParentFrame:wxMDIParentFrame().
+
createClient(This,Parent)
when is_record(This, wx_ref),is_record(Parent, wx_ref) ->
createClient(This,Parent, []).
-%% @spec (This::wxMDIClientWindow(), Parent::wxMDIParentFrame:wxMDIParentFrame(), [Option]) -> bool()
-%% Option = {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdiclientwindow.html#wxmdiclientwindowcreateclient">external documentation</a>.
+-spec createClient(This, Parent, [Option]) -> boolean() when
+ This::wxMDIClientWindow(), Parent::wxMDIParentFrame:wxMDIParentFrame(),
+ Option :: {style, integer()}.
createClient(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxMDIClientWindow),
@@ -116,8 +124,8 @@ createClient(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}
wxe_util:call(?wxMDIClientWindow_CreateClient,
<<ThisRef:32/?UI,ParentRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxMDIClientWindow()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxMDIClientWindow()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxMDIClientWindow),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxMDIParentFrame.erl b/lib/wx/src/gen/wxMDIParentFrame.erl
index 7f8a305876..1a7e7387b9 100644
--- a/lib/wx/src/gen/wxMDIParentFrame.erl
+++ b/lib/wx/src/gen/wxMDIParentFrame.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -82,6 +82,7 @@
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
validate/1,warpPointer/3]).
+-export_type([wxMDIParentFrame/0]).
%% @hidden
parent_class(wxFrame) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -89,21 +90,27 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxMDIParentFrame()
+-type wxMDIParentFrame() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdiparentframe.html#wxmdiparentframewxmdiparentframe">external documentation</a>.
+-spec new() -> wxMDIParentFrame().
new() ->
wxe_util:construct(?wxMDIParentFrame_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Title::string()) -> wxMDIParentFrame()
%% @equiv new(Parent,Id,Title, [])
+-spec new(Parent, Id, Title) -> wxMDIParentFrame() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata().
+
new(Parent,Id,Title)
when is_record(Parent, wx_ref),is_integer(Id),is_list(Title) ->
new(Parent,Id,Title, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Title::string(), [Option]) -> wxMDIParentFrame()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdiparentframe.html#wxmdiparentframewxmdiparentframe">external documentation</a>.
+-spec new(Parent, Id, Title, [Option]) -> wxMDIParentFrame() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options)
when is_integer(Id),is_list(Title),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -116,43 +123,52 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options)
wxe_util:construct(?wxMDIParentFrame_new_4,
<<ParentRef:32/?UI,Id:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((4+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMDIParentFrame()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdiparentframe.html#wxmdiparentframeactivatenext">external documentation</a>.
+-spec activateNext(This) -> ok when
+ This::wxMDIParentFrame().
activateNext(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMDIParentFrame),
wxe_util:cast(?wxMDIParentFrame_ActivateNext,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMDIParentFrame()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdiparentframe.html#wxmdiparentframeactivateprevious">external documentation</a>.
+-spec activatePrevious(This) -> ok when
+ This::wxMDIParentFrame().
activatePrevious(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMDIParentFrame),
wxe_util:cast(?wxMDIParentFrame_ActivatePrevious,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMDIParentFrame()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdiparentframe.html#wxmdiparentframearrangeicons">external documentation</a>.
+-spec arrangeIcons(This) -> ok when
+ This::wxMDIParentFrame().
arrangeIcons(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMDIParentFrame),
wxe_util:cast(?wxMDIParentFrame_ArrangeIcons,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMDIParentFrame()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdiparentframe.html#wxmdiparentframecascade">external documentation</a>.
+-spec cascade(This) -> ok when
+ This::wxMDIParentFrame().
cascade(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMDIParentFrame),
wxe_util:cast(?wxMDIParentFrame_Cascade,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMDIParentFrame(), Parent::wxWindow:wxWindow(), Id::integer(), Title::string()) -> bool()
%% @equiv create(This,Parent,Id,Title, [])
+-spec create(This, Parent, Id, Title) -> boolean() when
+ This::wxMDIParentFrame(), Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata().
+
create(This,Parent,Id,Title)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Title) ->
create(This,Parent,Id,Title, []).
-%% @spec (This::wxMDIParentFrame(), Parent::wxWindow:wxWindow(), Id::integer(), Title::string(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdiparentframe.html#wxmdiparentframecreate">external documentation</a>.
+-spec create(This, Parent, Id, Title, [Option]) -> boolean() when
+ This::wxMDIParentFrame(), Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options)
when is_integer(Id),is_list(Title),is_list(Options) ->
?CLASS(ThisT,wxMDIParentFrame),
@@ -166,31 +182,35 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Ti
wxe_util:call(?wxMDIParentFrame_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((0+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMDIParentFrame()) -> wxMDIChildFrame:wxMDIChildFrame()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdiparentframe.html#wxmdiparentframegetactivechild">external documentation</a>.
+-spec getActiveChild(This) -> wxMDIChildFrame:wxMDIChildFrame() when
+ This::wxMDIParentFrame().
getActiveChild(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMDIParentFrame),
wxe_util:call(?wxMDIParentFrame_GetActiveChild,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMDIParentFrame()) -> wxMDIClientWindow:wxMDIClientWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdiparentframe.html#wxmdiparentframegetclientwindow">external documentation</a>.
+-spec getClientWindow(This) -> wxMDIClientWindow:wxMDIClientWindow() when
+ This::wxMDIParentFrame().
getClientWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMDIParentFrame),
wxe_util:call(?wxMDIParentFrame_GetClientWindow,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMDIParentFrame()) -> ok
%% @equiv tile(This, [])
+-spec tile(This) -> ok when
+ This::wxMDIParentFrame().
+
tile(This)
when is_record(This, wx_ref) ->
tile(This, []).
-%% @spec (This::wxMDIParentFrame(), [Option]) -> ok
-%% Option = {orient, WxOrientation}
-%% WxOrientation = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmdiparentframe.html#wxmdiparentframetile">external documentation</a>.
-%%<br /> WxOrientation is one of ?wxHORIZONTAL | ?wxVERTICAL | ?wxBOTH
+%%<br /> Orient = ?wxHORIZONTAL | ?wxVERTICAL | ?wxBOTH
+-spec tile(This, [Option]) -> ok when
+ This::wxMDIParentFrame(),
+ Option :: {orient, wx:wx_enum()}.
tile(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxMDIParentFrame),
@@ -200,8 +220,8 @@ tile(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxMDIParentFrame_Tile,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxMDIParentFrame()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxMDIParentFrame()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxMDIParentFrame),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxMask.erl b/lib/wx/src/gen/wxMask.erl
index 3b5d3340ea..296c7cbc83 100644
--- a/lib/wx/src/gen/wxMask.erl
+++ b/lib/wx/src/gen/wxMask.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,31 +29,34 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxMask/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxMask()
+-type wxMask() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmask.html#wxmaskwxmask">external documentation</a>.
+-spec new() -> wxMask().
new() ->
wxe_util:construct(?wxMask_new_0,
<<>>).
-%% @spec (Bitmap::wxBitmap:wxBitmap()) -> wxMask()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmask.html#wxmaskwxmask">external documentation</a>.
+-spec new(Bitmap) -> wxMask() when
+ Bitmap::wxBitmap:wxBitmap().
new(#wx_ref{type=BitmapT,ref=BitmapRef}) ->
?CLASS(BitmapT,wxBitmap),
wxe_util:construct(?wxMask_new_1,
<<BitmapRef:32/?UI>>).
-%% @spec (Bitmap::wxBitmap:wxBitmap(),X::integer()|term()) -> wxMask()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmask.html#wxmaskwxmask">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Bitmap::wxBitmap:wxBitmap(), PaletteIndex::integer()) -> wxMask() </c>
-%% </p>
-%% <p><c>
-%% new(Bitmap::wxBitmap:wxBitmap(), Colour::wx:colour()) -> wxMask() </c>
-%% </p>
+%% <br /> Also:<br />
+%% new(Bitmap, Colour) -> wxMask() when<br />
+%% Bitmap::wxBitmap:wxBitmap(), Colour::wx:wx_colour().<br />
+%%
+-spec new(Bitmap, PaletteIndex) -> wxMask() when
+ Bitmap::wxBitmap:wxBitmap(), PaletteIndex::integer();
+ (Bitmap, Colour) -> wxMask() when
+ Bitmap::wxBitmap:wxBitmap(), Colour::wx:wx_colour().
new(#wx_ref{type=BitmapT,ref=BitmapRef},PaletteIndex)
when is_integer(PaletteIndex) ->
?CLASS(BitmapT,wxBitmap),
@@ -65,23 +68,24 @@ new(#wx_ref{type=BitmapT,ref=BitmapRef},Colour)
wxe_util:construct(?wxMask_new_2_1,
<<BitmapRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
-%% @spec (This::wxMask(), Bitmap::wxBitmap:wxBitmap()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmask.html#wxmaskcreate">external documentation</a>.
+-spec create(This, Bitmap) -> boolean() when
+ This::wxMask(), Bitmap::wxBitmap:wxBitmap().
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BitmapT,ref=BitmapRef}) ->
?CLASS(ThisT,wxMask),
?CLASS(BitmapT,wxBitmap),
wxe_util:call(?wxMask_Create_1,
<<ThisRef:32/?UI,BitmapRef:32/?UI>>).
-%% @spec (This::wxMask(),Bitmap::wxBitmap:wxBitmap(),X::integer()|term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmask.html#wxmaskcreate">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% create(This::wxMask(), Bitmap::wxBitmap:wxBitmap(), PaletteIndex::integer()) -> bool() </c>
-%% </p>
-%% <p><c>
-%% create(This::wxMask(), Bitmap::wxBitmap:wxBitmap(), Colour::wx:colour()) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% create(This, Bitmap, Colour) -> boolean() when<br />
+%% This::wxMask(), Bitmap::wxBitmap:wxBitmap(), Colour::wx:wx_colour().<br />
+%%
+-spec create(This, Bitmap, PaletteIndex) -> boolean() when
+ This::wxMask(), Bitmap::wxBitmap:wxBitmap(), PaletteIndex::integer();
+ (This, Bitmap, Colour) -> boolean() when
+ This::wxMask(), Bitmap::wxBitmap:wxBitmap(), Colour::wx:wx_colour().
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BitmapT,ref=BitmapRef},PaletteIndex)
when is_integer(PaletteIndex) ->
?CLASS(ThisT,wxMask),
@@ -95,8 +99,8 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BitmapT,ref=BitmapRef},Colou
wxe_util:call(?wxMask_Create_2_1,
<<ThisRef:32/?UI,BitmapRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
-%% @spec (This::wxMask()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxMask()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxMask),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxMaximizeEvent.erl b/lib/wx/src/gen/wxMaximizeEvent.erl
index 6dd371908b..5f7b7e890d 100644
--- a/lib/wx/src/gen/wxMaximizeEvent.erl
+++ b/lib/wx/src/gen/wxMaximizeEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,10 +37,12 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxMaximizeEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxMaximizeEvent() :: wx:wx_object().
%% From wxEvent
%% @hidden
stopPropagation(This) -> wxEvent:stopPropagation(This).
diff --git a/lib/wx/src/gen/wxMemoryDC.erl b/lib/wx/src/gen/wxMemoryDC.erl
index d17ebba4b7..cac20094a0 100644
--- a/lib/wx/src/gen/wxMemoryDC.erl
+++ b/lib/wx/src/gen/wxMemoryDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -38,10 +38,10 @@
drawPoint/2,drawPolygon/2,drawPolygon/3,drawRectangle/2,drawRectangle/3,
drawRotatedText/4,drawRoundedRectangle/3,drawRoundedRectangle/4,
drawText/3,endDoc/1,endPage/1,floodFill/3,floodFill/4,getBackground/1,
- getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/2,
+ getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/1,
getFont/1,getLayoutDirection/1,getLogicalFunction/1,getMapMode/1,
- getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/3,
- getPen/1,getPixel/3,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
+ getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/2,
+ getPen/1,getPixel/2,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
getTextExtent/3,getTextForeground/1,getUserScale/1,gradientFillConcentric/4,
gradientFillConcentric/5,gradientFillLinear/4,gradientFillLinear/5,
isOk/1,logicalToDeviceX/2,logicalToDeviceXRel/2,logicalToDeviceY/2,
@@ -52,18 +52,21 @@
setPen/2,setTextBackground/2,setTextForeground/2,setUserScale/3,startDoc/2,
startPage/1]).
+-export_type([wxMemoryDC/0]).
%% @hidden
parent_class(wxDC) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxMemoryDC()
+-type wxMemoryDC() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmemorydc.html#wxmemorydcwxmemorydc">external documentation</a>.
+-spec new() -> wxMemoryDC().
new() ->
wxe_util:construct(?wxMemoryDC_new_0,
<<>>).
-%% @spec (Dc::wxDC:wxDC() | wxBitmap:wxBitmap()) -> wxMemoryDC()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmemorydc.html#wxmemorydcwxmemorydc">external documentation</a>.
+-spec new(Dc) -> wxMemoryDC() when
+ Dc::wxDC:wxDC() | wxBitmap:wxBitmap().
new(#wx_ref{type=DcT,ref=DcRef}) ->
DcOP = case ?CLASS_T(DcT,wxDC) of
true ->
@@ -74,24 +77,26 @@ new(#wx_ref{type=DcT,ref=DcRef}) ->
wxe_util:construct(DcOP,
<<DcRef:32/?UI>>).
-%% @spec (This::wxMemoryDC(), Bmp::wxBitmap:wxBitmap()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmemorydc.html#wxmemorydcselectobject">external documentation</a>.
+-spec selectObject(This, Bmp) -> ok when
+ This::wxMemoryDC(), Bmp::wxBitmap:wxBitmap().
selectObject(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BmpT,ref=BmpRef}) ->
?CLASS(ThisT,wxMemoryDC),
?CLASS(BmpT,wxBitmap),
wxe_util:cast(?wxMemoryDC_SelectObject,
<<ThisRef:32/?UI,BmpRef:32/?UI>>).
-%% @spec (This::wxMemoryDC(), Bmp::wxBitmap:wxBitmap()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmemorydc.html#wxmemorydcselectobjectassource">external documentation</a>.
+-spec selectObjectAsSource(This, Bmp) -> ok when
+ This::wxMemoryDC(), Bmp::wxBitmap:wxBitmap().
selectObjectAsSource(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BmpT,ref=BmpRef}) ->
?CLASS(ThisT,wxMemoryDC),
?CLASS(BmpT,wxBitmap),
wxe_util:cast(?wxMemoryDC_SelectObjectAsSource,
<<ThisRef:32/?UI,BmpRef:32/?UI>>).
-%% @spec (This::wxMemoryDC()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxMemoryDC()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxMemoryDC),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
@@ -178,11 +183,11 @@ getSize(This) -> wxDC:getSize(This).
%% @hidden
getPPI(This) -> wxDC:getPPI(This).
%% @hidden
-getPixel(This,Pt,Col) -> wxDC:getPixel(This,Pt,Col).
+getPixel(This,Pt) -> wxDC:getPixel(This,Pt).
%% @hidden
getPen(This) -> wxDC:getPen(This).
%% @hidden
-getPartialTextExtents(This,Text,Widths) -> wxDC:getPartialTextExtents(This,Text,Widths).
+getPartialTextExtents(This,Text) -> wxDC:getPartialTextExtents(This,Text).
%% @hidden
getMultiLineTextExtent(This,String, Options) -> wxDC:getMultiLineTextExtent(This,String, Options).
%% @hidden
@@ -196,7 +201,7 @@ getLayoutDirection(This) -> wxDC:getLayoutDirection(This).
%% @hidden
getFont(This) -> wxDC:getFont(This).
%% @hidden
-getClippingBox(This,Rect) -> wxDC:getClippingBox(This,Rect).
+getClippingBox(This) -> wxDC:getClippingBox(This).
%% @hidden
getCharWidth(This) -> wxDC:getCharWidth(This).
%% @hidden
diff --git a/lib/wx/src/gen/wxMenu.erl b/lib/wx/src/gen/wxMenu.erl
index 615a845d11..d91863de82 100644
--- a/lib/wx/src/gen/wxMenu.erl
+++ b/lib/wx/src/gen/wxMenu.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -40,18 +40,21 @@
%% inherited exports
-export([connect/2,connect/3,disconnect/1,disconnect/2,disconnect/3,parent_class/1]).
+-export_type([wxMenu/0]).
%% @hidden
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxMenu()
+-type wxMenu() :: wx:wx_object().
%% @equiv new([])
+-spec new() -> wxMenu().
+
new() ->
new([]).
-%% @spec ([Option]) -> wxMenu()
-%% Option = {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuwxmenu">external documentation</a>.
+-spec new([Option]) -> wxMenu() when
+ Option :: {style, integer()}.
new(Options)
when is_list(Options) ->
MOpts = fun({style, Style}, Acc) -> [<<1:32/?UI,Style:32/?UI>>|Acc];
@@ -60,9 +63,10 @@ new(Options)
wxe_util:construct(?wxMenu_new_1,
<<BinOpt/binary>>).
-%% @spec (Title::string(), [Option]) -> wxMenu()
-%% Option = {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuwxmenu">external documentation</a>.
+-spec new(Title, [Option]) -> wxMenu() when
+ Title::unicode:chardata(),
+ Option :: {style, integer()}.
new(Title, Options)
when is_list(Title),is_list(Options) ->
Title_UC = unicode:characters_to_binary([Title,0]),
@@ -72,31 +76,37 @@ new(Title, Options)
wxe_util:construct(?wxMenu_new_2,
<<(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((4+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMenu(), Item::wxMenuItem:wxMenuItem()) -> wxMenuItem:wxMenuItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuappend">external documentation</a>.
+-spec append(This, Item) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Item::wxMenuItem:wxMenuItem().
append(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=ItemRef}) ->
?CLASS(ThisT,wxMenu),
?CLASS(ItemT,wxMenuItem),
wxe_util:call(?wxMenu_Append_1,
<<ThisRef:32/?UI,ItemRef:32/?UI>>).
-%% @spec (This::wxMenu(), Itemid::integer(), Text::string()) -> wxMenuItem:wxMenuItem()
%% @equiv append(This,Itemid,Text, [])
+-spec append(This, Itemid, Text) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata().
+
append(This,Itemid,Text)
when is_record(This, wx_ref),is_integer(Itemid),is_list(Text) ->
append(This,Itemid,Text, []).
-%% @spec (This::wxMenu(),Itemid::integer(),Text::string(),X::wxMenu()|term()) -> wxMenuItem:wxMenuItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuappend">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% append(This::wxMenu(), Itemid::integer(), Text::string(), Submenu::wxMenu()) -> append(This,Itemid,Text,Submenu, []) </c></p>
-%% <p><c>
-%% append(This::wxMenu(), Itemid::integer(), Text::string(), [Option]) -> wxMenuItem:wxMenuItem() </c>
-%%<br /> Option = {help, string()} | {kind, WxItemKind}
-%%<br /> WxItemKind = integer()
-%%<br /> WxItemKind is one of ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
-%% </p>
+%% <br /> Also:<br />
+%% append(This, Itemid, Text, [Option]) -> wxMenuItem:wxMenuItem() when<br />
+%% This::wxMenu(), Itemid::integer(), Text::unicode:chardata(),<br />
+%% Option :: {help, unicode:chardata()}<br />
+%% | {kind, wx:wx_enum()}.<br />
+%%
+%%<br /> Kind = ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+-spec append(This, Itemid, Text, Submenu) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata(), Submenu::wxMenu();
+ (This, Itemid, Text, [Option]) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata(),
+ Option :: {help, unicode:chardata()}
+ | {kind, wx:wx_enum()}.
append(This,Itemid,Text,Submenu)
when is_record(This, wx_ref),is_integer(Itemid),is_list(Text),is_record(Submenu, wx_ref) ->
@@ -112,16 +122,17 @@ append(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options)
wxe_util:call(?wxMenu_Append_3,
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMenu(),Itemid::integer(),Text::string(),X::string()|wxMenu(),X::bool()|term()) -> ok|wxMenuItem:wxMenuItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuappend">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% append(This::wxMenu(), Itemid::integer(), Text::string(), Help::string(), IsCheckable::bool()) -> ok </c>
-%% </p>
-%% <p><c>
-%% append(This::wxMenu(), Itemid::integer(), Text::string(), Submenu::wxMenu(), [Option]) -> wxMenuItem:wxMenuItem() </c>
-%%<br /> Option = {help, string()}
-%% </p>
+%% <br /> Also:<br />
+%% append(This, Itemid, Text, Submenu, [Option]) -> wxMenuItem:wxMenuItem() when<br />
+%% This::wxMenu(), Itemid::integer(), Text::unicode:chardata(), Submenu::wxMenu(),<br />
+%% Option :: {help, unicode:chardata()}.<br />
+%%
+-spec append(This, Itemid, Text, Help, IsCheckable) -> ok when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata(), Help::unicode:chardata(), IsCheckable::boolean();
+ (This, Itemid, Text, Submenu, [Option]) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata(), Submenu::wxMenu(),
+ Option :: {help, unicode:chardata()}.
append(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text,Help,IsCheckable)
when is_integer(Itemid),is_list(Text),is_list(Help),is_boolean(IsCheckable) ->
?CLASS(ThisT,wxMenu),
@@ -140,15 +151,18 @@ append(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text,#wx_ref{type=SubmenuT,ref=Sub
wxe_util:call(?wxMenu_Append_4_1,
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,SubmenuRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxMenu(), Itemid::integer(), Text::string()) -> wxMenuItem:wxMenuItem()
%% @equiv appendCheckItem(This,Itemid,Text, [])
+-spec appendCheckItem(This, Itemid, Text) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata().
+
appendCheckItem(This,Itemid,Text)
when is_record(This, wx_ref),is_integer(Itemid),is_list(Text) ->
appendCheckItem(This,Itemid,Text, []).
-%% @spec (This::wxMenu(), Itemid::integer(), Text::string(), [Option]) -> wxMenuItem:wxMenuItem()
-%% Option = {help, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuappendcheckitem">external documentation</a>.
+-spec appendCheckItem(This, Itemid, Text, [Option]) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata(),
+ Option :: {help, unicode:chardata()}.
appendCheckItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options)
when is_integer(Itemid),is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxMenu),
@@ -159,15 +173,18 @@ appendCheckItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options)
wxe_util:call(?wxMenu_AppendCheckItem,
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMenu(), Itemid::integer(), Text::string()) -> wxMenuItem:wxMenuItem()
%% @equiv appendRadioItem(This,Itemid,Text, [])
+-spec appendRadioItem(This, Itemid, Text) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata().
+
appendRadioItem(This,Itemid,Text)
when is_record(This, wx_ref),is_integer(Itemid),is_list(Text) ->
appendRadioItem(This,Itemid,Text, []).
-%% @spec (This::wxMenu(), Itemid::integer(), Text::string(), [Option]) -> wxMenuItem:wxMenuItem()
-%% Option = {help, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuappendradioitem">external documentation</a>.
+-spec appendRadioItem(This, Itemid, Text, [Option]) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata(),
+ Option :: {help, unicode:chardata()}.
appendRadioItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options)
when is_integer(Itemid),is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxMenu),
@@ -178,37 +195,40 @@ appendRadioItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options)
wxe_util:call(?wxMenu_AppendRadioItem,
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMenu()) -> wxMenuItem:wxMenuItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuappendseparator">external documentation</a>.
+-spec appendSeparator(This) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu().
appendSeparator(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenu),
wxe_util:call(?wxMenu_AppendSeparator,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenu()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenubreak">external documentation</a>.
+-spec break(This) -> ok when
+ This::wxMenu().
break(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenu),
wxe_util:cast(?wxMenu_Break,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenu(), Itemid::integer(), Check::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenucheck">external documentation</a>.
+-spec check(This, Itemid, Check) -> ok when
+ This::wxMenu(), Itemid::integer(), Check::boolean().
check(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Check)
when is_integer(Itemid),is_boolean(Check) ->
?CLASS(ThisT,wxMenu),
wxe_util:cast(?wxMenu_Check,
<<ThisRef:32/?UI,Itemid:32/?UI,(wxe_util:from_bool(Check)):32/?UI>>).
-%% @spec (This::wxMenu(),X::integer()|term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenudelete">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% delete(This::wxMenu(), Itemid::integer()) -> bool() </c>
-%% </p>
-%% <p><c>
-%% delete(This::wxMenu(), Item::wxMenuItem:wxMenuItem()) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% delete(This, Item) -> boolean() when<br />
+%% This::wxMenu(), Item::wxMenuItem:wxMenuItem().<br />
+%%
+-spec delete(This, Itemid) -> boolean() when
+ This::wxMenu(), Itemid::integer();
+ (This, Item) -> boolean() when
+ This::wxMenu(), Item::wxMenuItem:wxMenuItem().
delete(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
when is_integer(Itemid) ->
?CLASS(ThisT,wxMenu),
@@ -220,15 +240,15 @@ delete(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=ItemRef}) ->
wxe_util:call(?wxMenu_Delete_1_1,
<<ThisRef:32/?UI,ItemRef:32/?UI>>).
-%% @spec (This::wxMenu(),X::integer()|term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenudestroy">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% 'Destroy'(This::wxMenu(), Itemid::integer()) -> bool() </c>
-%% </p>
-%% <p><c>
-%% 'Destroy'(This::wxMenu(), Item::wxMenuItem:wxMenuItem()) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% 'Destroy'(This, Item) -> boolean() when<br />
+%% This::wxMenu(), Item::wxMenuItem:wxMenuItem().<br />
+%%
+-spec 'Destroy'(This, Itemid) -> boolean() when
+ This::wxMenu(), Itemid::integer();
+ (This, Item) -> boolean() when
+ This::wxMenu(), Item::wxMenuItem:wxMenuItem().
'Destroy'(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
when is_integer(Itemid) ->
?CLASS(ThisT,wxMenu),
@@ -240,23 +260,24 @@ delete(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=ItemRef}) ->
wxe_util:call(?wxMenu_Destroy_1_1,
<<ThisRef:32/?UI,ItemRef:32/?UI>>).
-%% @spec (This::wxMenu(), Itemid::integer(), Enable::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuenable">external documentation</a>.
+-spec enable(This, Itemid, Enable) -> ok when
+ This::wxMenu(), Itemid::integer(), Enable::boolean().
enable(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Enable)
when is_integer(Itemid),is_boolean(Enable) ->
?CLASS(ThisT,wxMenu),
wxe_util:cast(?wxMenu_Enable,
<<ThisRef:32/?UI,Itemid:32/?UI,(wxe_util:from_bool(Enable)):32/?UI>>).
-%% @spec (This::wxMenu(),X::integer()|string()) -> wxMenuItem:wxMenuItem()|integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenufinditem">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% findItem(This::wxMenu(), Itemid::integer()) -> wxMenuItem:wxMenuItem() </c>
-%% </p>
-%% <p><c>
-%% findItem(This::wxMenu(), Item::string()) -> integer() </c>
-%% </p>
+%% <br /> Also:<br />
+%% findItem(This, Item) -> integer() when<br />
+%% This::wxMenu(), Item::unicode:chardata().<br />
+%%
+-spec findItem(This, Itemid) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer();
+ (This, Item) -> integer() when
+ This::wxMenu(), Item::unicode:chardata().
findItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
when is_integer(Itemid) ->
?CLASS(ThisT,wxMenu),
@@ -269,59 +290,67 @@ findItem(#wx_ref{type=ThisT,ref=ThisRef},Item)
wxe_util:call(?wxMenu_FindItem_1,
<<ThisRef:32/?UI,(byte_size(Item_UC)):32/?UI,(Item_UC)/binary, 0:(((8- ((0+byte_size(Item_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenu(), Position::integer()) -> wxMenuItem:wxMenuItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenufinditembyposition">external documentation</a>.
+-spec findItemByPosition(This, Position) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Position::integer().
findItemByPosition(#wx_ref{type=ThisT,ref=ThisRef},Position)
when is_integer(Position) ->
?CLASS(ThisT,wxMenu),
wxe_util:call(?wxMenu_FindItemByPosition,
<<ThisRef:32/?UI,Position:32/?UI>>).
-%% @spec (This::wxMenu(), Itemid::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenugethelpstring">external documentation</a>.
+-spec getHelpString(This, Itemid) -> unicode:charlist() when
+ This::wxMenu(), Itemid::integer().
getHelpString(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
when is_integer(Itemid) ->
?CLASS(ThisT,wxMenu),
wxe_util:call(?wxMenu_GetHelpString,
<<ThisRef:32/?UI,Itemid:32/?UI>>).
-%% @spec (This::wxMenu(), Itemid::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenugetlabel">external documentation</a>.
+-spec getLabel(This, Itemid) -> unicode:charlist() when
+ This::wxMenu(), Itemid::integer().
getLabel(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
when is_integer(Itemid) ->
?CLASS(ThisT,wxMenu),
wxe_util:call(?wxMenu_GetLabel,
<<ThisRef:32/?UI,Itemid:32/?UI>>).
-%% @spec (This::wxMenu()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenugetmenuitemcount">external documentation</a>.
+-spec getMenuItemCount(This) -> integer() when
+ This::wxMenu().
getMenuItemCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenu),
wxe_util:call(?wxMenu_GetMenuItemCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenu()) -> [wxMenuItem:wxMenuItem()]
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenugetmenuitems">external documentation</a>.
+-spec getMenuItems(This) -> [wxMenuItem:wxMenuItem()] when
+ This::wxMenu().
getMenuItems(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenu),
wxe_util:call(?wxMenu_GetMenuItems,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenu()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenugettitle">external documentation</a>.
+-spec getTitle(This) -> unicode:charlist() when
+ This::wxMenu().
getTitle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenu),
wxe_util:call(?wxMenu_GetTitle,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenu(),Pos::integer(),X::integer()|term()) -> wxMenuItem:wxMenuItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuinsert">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% insert(This::wxMenu(), Pos::integer(), Itemid::integer()) -> insert(This,Pos,Itemid, []) </c></p>
-%% <p><c>
-%% insert(This::wxMenu(), Pos::integer(), Item::wxMenuItem:wxMenuItem()) -> wxMenuItem:wxMenuItem() </c>
-%% </p>
+%% <br /> Also:<br />
+%% insert(This, Pos, Item) -> wxMenuItem:wxMenuItem() when<br />
+%% This::wxMenu(), Pos::integer(), Item::wxMenuItem:wxMenuItem().<br />
+%%
+%%<br /> Kind = ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+-spec insert(This, Pos, Itemid) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Pos::integer(), Itemid::integer();
+ (This, Pos, Item) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Pos::integer(), Item::wxMenuItem:wxMenuItem().
insert(This,Pos,Itemid)
when is_record(This, wx_ref),is_integer(Pos),is_integer(Itemid) ->
@@ -333,11 +362,13 @@ insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=ItemT,ref=ItemRef})
wxe_util:call(?wxMenu_Insert_2,
<<ThisRef:32/?UI,Pos:32/?UI,ItemRef:32/?UI>>).
-%% @spec (This::wxMenu(), Pos::integer(), Itemid::integer(), [Option]) -> wxMenuItem:wxMenuItem()
-%% Option = {text, string()} | {help, string()} | {kind, WxItemKind}
-%% WxItemKind = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuinsert">external documentation</a>.
-%%<br /> WxItemKind is one of ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+%%<br /> Kind = ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+-spec insert(This, Pos, Itemid, [Option]) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Pos::integer(), Itemid::integer(),
+ Option :: {text, unicode:chardata()}
+ | {help, unicode:chardata()}
+ | {kind, wx:wx_enum()}.
insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid, Options)
when is_integer(Pos),is_integer(Itemid),is_list(Options) ->
?CLASS(ThisT,wxMenu),
@@ -349,22 +380,25 @@ insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid, Options)
wxe_util:call(?wxMenu_Insert_3,
<<ThisRef:32/?UI,Pos:32/?UI,Itemid:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string(), Submenu::wxMenu()) -> wxMenuItem:wxMenuItem()
%% @equiv insert(This,Pos,Itemid,Text,Submenu, [])
+-spec insert(This, Pos, Itemid, Text, Submenu) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Pos::integer(), Itemid::integer(), Text::unicode:chardata(), Submenu::wxMenu().
+
insert(This,Pos,Itemid,Text,Submenu)
when is_record(This, wx_ref),is_integer(Pos),is_integer(Itemid),is_list(Text),is_record(Submenu, wx_ref) ->
insert(This,Pos,Itemid,Text,Submenu, []).
-%% @spec (This::wxMenu(),Pos::integer(),Itemid::integer(),Text::string(),X::string()|wxMenu(),X::bool()|term()) -> ok|wxMenuItem:wxMenuItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuinsert">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% insert(This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string(), Help::string(), IsCheckable::bool()) -> ok </c>
-%% </p>
-%% <p><c>
-%% insert(This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string(), Submenu::wxMenu(), [Option]) -> wxMenuItem:wxMenuItem() </c>
-%%<br /> Option = {help, string()}
-%% </p>
+%% <br /> Also:<br />
+%% insert(This, Pos, Itemid, Text, Submenu, [Option]) -> wxMenuItem:wxMenuItem() when<br />
+%% This::wxMenu(), Pos::integer(), Itemid::integer(), Text::unicode:chardata(), Submenu::wxMenu(),<br />
+%% Option :: {help, unicode:chardata()}.<br />
+%%
+-spec insert(This, Pos, Itemid, Text, Help, IsCheckable) -> ok when
+ This::wxMenu(), Pos::integer(), Itemid::integer(), Text::unicode:chardata(), Help::unicode:chardata(), IsCheckable::boolean();
+ (This, Pos, Itemid, Text, Submenu, [Option]) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Pos::integer(), Itemid::integer(), Text::unicode:chardata(), Submenu::wxMenu(),
+ Option :: {help, unicode:chardata()}.
insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text,Help,IsCheckable)
when is_integer(Pos),is_integer(Itemid),is_list(Text),is_list(Help),is_boolean(IsCheckable) ->
?CLASS(ThisT,wxMenu),
@@ -383,15 +417,18 @@ insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text,#wx_ref{type=SubmenuT,ref
wxe_util:call(?wxMenu_Insert_5_1,
<<ThisRef:32/?UI,Pos:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,SubmenuRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string()) -> wxMenuItem:wxMenuItem()
%% @equiv insertCheckItem(This,Pos,Itemid,Text, [])
+-spec insertCheckItem(This, Pos, Itemid, Text) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Pos::integer(), Itemid::integer(), Text::unicode:chardata().
+
insertCheckItem(This,Pos,Itemid,Text)
when is_record(This, wx_ref),is_integer(Pos),is_integer(Itemid),is_list(Text) ->
insertCheckItem(This,Pos,Itemid,Text, []).
-%% @spec (This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string(), [Option]) -> wxMenuItem:wxMenuItem()
-%% Option = {help, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuinsertcheckitem">external documentation</a>.
+-spec insertCheckItem(This, Pos, Itemid, Text, [Option]) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Pos::integer(), Itemid::integer(), Text::unicode:chardata(),
+ Option :: {help, unicode:chardata()}.
insertCheckItem(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text, Options)
when is_integer(Pos),is_integer(Itemid),is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxMenu),
@@ -402,15 +439,18 @@ insertCheckItem(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text, Options)
wxe_util:call(?wxMenu_InsertCheckItem,
<<ThisRef:32/?UI,Pos:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string()) -> wxMenuItem:wxMenuItem()
%% @equiv insertRadioItem(This,Pos,Itemid,Text, [])
+-spec insertRadioItem(This, Pos, Itemid, Text) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Pos::integer(), Itemid::integer(), Text::unicode:chardata().
+
insertRadioItem(This,Pos,Itemid,Text)
when is_record(This, wx_ref),is_integer(Pos),is_integer(Itemid),is_list(Text) ->
insertRadioItem(This,Pos,Itemid,Text, []).
-%% @spec (This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string(), [Option]) -> wxMenuItem:wxMenuItem()
-%% Option = {help, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuinsertradioitem">external documentation</a>.
+-spec insertRadioItem(This, Pos, Itemid, Text, [Option]) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Pos::integer(), Itemid::integer(), Text::unicode:chardata(),
+ Option :: {help, unicode:chardata()}.
insertRadioItem(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text, Options)
when is_integer(Pos),is_integer(Itemid),is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxMenu),
@@ -421,38 +461,43 @@ insertRadioItem(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text, Options)
wxe_util:call(?wxMenu_InsertRadioItem,
<<ThisRef:32/?UI,Pos:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMenu(), Pos::integer()) -> wxMenuItem:wxMenuItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuinsertseparator">external documentation</a>.
+-spec insertSeparator(This, Pos) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Pos::integer().
insertSeparator(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxMenu),
wxe_util:call(?wxMenu_InsertSeparator,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxMenu(), Itemid::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuischecked">external documentation</a>.
+-spec isChecked(This, Itemid) -> boolean() when
+ This::wxMenu(), Itemid::integer().
isChecked(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
when is_integer(Itemid) ->
?CLASS(ThisT,wxMenu),
wxe_util:call(?wxMenu_IsChecked,
<<ThisRef:32/?UI,Itemid:32/?UI>>).
-%% @spec (This::wxMenu(), Itemid::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuisenabled">external documentation</a>.
+-spec isEnabled(This, Itemid) -> boolean() when
+ This::wxMenu(), Itemid::integer().
isEnabled(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
when is_integer(Itemid) ->
?CLASS(ThisT,wxMenu),
wxe_util:call(?wxMenu_IsEnabled,
<<ThisRef:32/?UI,Itemid:32/?UI>>).
-%% @spec (This::wxMenu(),X::integer()|term()) -> wxMenuItem:wxMenuItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuprepend">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% prepend(This::wxMenu(), Itemid::integer()) -> prepend(This,Itemid, []) </c></p>
-%% <p><c>
-%% prepend(This::wxMenu(), Item::wxMenuItem:wxMenuItem()) -> wxMenuItem:wxMenuItem() </c>
-%% </p>
+%% <br /> Also:<br />
+%% prepend(This, Item) -> wxMenuItem:wxMenuItem() when<br />
+%% This::wxMenu(), Item::wxMenuItem:wxMenuItem().<br />
+%%
+%%<br /> Kind = ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+-spec prepend(This, Itemid) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer();
+ (This, Item) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Item::wxMenuItem:wxMenuItem().
prepend(This,Itemid)
when is_record(This, wx_ref),is_integer(Itemid) ->
@@ -463,11 +508,13 @@ prepend(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=ItemRef}) ->
wxe_util:call(?wxMenu_Prepend_1,
<<ThisRef:32/?UI,ItemRef:32/?UI>>).
-%% @spec (This::wxMenu(), Itemid::integer(), [Option]) -> wxMenuItem:wxMenuItem()
-%% Option = {text, string()} | {help, string()} | {kind, WxItemKind}
-%% WxItemKind = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuprepend">external documentation</a>.
-%%<br /> WxItemKind is one of ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+%%<br /> Kind = ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+-spec prepend(This, Itemid, [Option]) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer(),
+ Option :: {text, unicode:chardata()}
+ | {help, unicode:chardata()}
+ | {kind, wx:wx_enum()}.
prepend(#wx_ref{type=ThisT,ref=ThisRef},Itemid, Options)
when is_integer(Itemid),is_list(Options) ->
?CLASS(ThisT,wxMenu),
@@ -479,22 +526,25 @@ prepend(#wx_ref{type=ThisT,ref=ThisRef},Itemid, Options)
wxe_util:call(?wxMenu_Prepend_2,
<<ThisRef:32/?UI,Itemid:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxMenu(), Itemid::integer(), Text::string(), Submenu::wxMenu()) -> wxMenuItem:wxMenuItem()
%% @equiv prepend(This,Itemid,Text,Submenu, [])
+-spec prepend(This, Itemid, Text, Submenu) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata(), Submenu::wxMenu().
+
prepend(This,Itemid,Text,Submenu)
when is_record(This, wx_ref),is_integer(Itemid),is_list(Text),is_record(Submenu, wx_ref) ->
prepend(This,Itemid,Text,Submenu, []).
-%% @spec (This::wxMenu(),Itemid::integer(),Text::string(),X::string()|wxMenu(),X::bool()|term()) -> ok|wxMenuItem:wxMenuItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuprepend">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% prepend(This::wxMenu(), Itemid::integer(), Text::string(), Help::string(), IsCheckable::bool()) -> ok </c>
-%% </p>
-%% <p><c>
-%% prepend(This::wxMenu(), Itemid::integer(), Text::string(), Submenu::wxMenu(), [Option]) -> wxMenuItem:wxMenuItem() </c>
-%%<br /> Option = {help, string()}
-%% </p>
+%% <br /> Also:<br />
+%% prepend(This, Itemid, Text, Submenu, [Option]) -> wxMenuItem:wxMenuItem() when<br />
+%% This::wxMenu(), Itemid::integer(), Text::unicode:chardata(), Submenu::wxMenu(),<br />
+%% Option :: {help, unicode:chardata()}.<br />
+%%
+-spec prepend(This, Itemid, Text, Help, IsCheckable) -> ok when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata(), Help::unicode:chardata(), IsCheckable::boolean();
+ (This, Itemid, Text, Submenu, [Option]) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata(), Submenu::wxMenu(),
+ Option :: {help, unicode:chardata()}.
prepend(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text,Help,IsCheckable)
when is_integer(Itemid),is_list(Text),is_list(Help),is_boolean(IsCheckable) ->
?CLASS(ThisT,wxMenu),
@@ -513,15 +563,18 @@ prepend(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text,#wx_ref{type=SubmenuT,ref=Su
wxe_util:call(?wxMenu_Prepend_4_1,
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,SubmenuRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxMenu(), Itemid::integer(), Text::string()) -> wxMenuItem:wxMenuItem()
%% @equiv prependCheckItem(This,Itemid,Text, [])
+-spec prependCheckItem(This, Itemid, Text) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata().
+
prependCheckItem(This,Itemid,Text)
when is_record(This, wx_ref),is_integer(Itemid),is_list(Text) ->
prependCheckItem(This,Itemid,Text, []).
-%% @spec (This::wxMenu(), Itemid::integer(), Text::string(), [Option]) -> wxMenuItem:wxMenuItem()
-%% Option = {help, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuprependcheckitem">external documentation</a>.
+-spec prependCheckItem(This, Itemid, Text, [Option]) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata(),
+ Option :: {help, unicode:chardata()}.
prependCheckItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options)
when is_integer(Itemid),is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxMenu),
@@ -532,15 +585,18 @@ prependCheckItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options)
wxe_util:call(?wxMenu_PrependCheckItem,
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMenu(), Itemid::integer(), Text::string()) -> wxMenuItem:wxMenuItem()
%% @equiv prependRadioItem(This,Itemid,Text, [])
+-spec prependRadioItem(This, Itemid, Text) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata().
+
prependRadioItem(This,Itemid,Text)
when is_record(This, wx_ref),is_integer(Itemid),is_list(Text) ->
prependRadioItem(This,Itemid,Text, []).
-%% @spec (This::wxMenu(), Itemid::integer(), Text::string(), [Option]) -> wxMenuItem:wxMenuItem()
-%% Option = {help, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuprependradioitem">external documentation</a>.
+-spec prependRadioItem(This, Itemid, Text, [Option]) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer(), Text::unicode:chardata(),
+ Option :: {help, unicode:chardata()}.
prependRadioItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options)
when is_integer(Itemid),is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxMenu),
@@ -551,22 +607,23 @@ prependRadioItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options)
wxe_util:call(?wxMenu_PrependRadioItem,
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMenu()) -> wxMenuItem:wxMenuItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuprependseparator">external documentation</a>.
+-spec prependSeparator(This) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu().
prependSeparator(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenu),
wxe_util:call(?wxMenu_PrependSeparator,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenu(),X::integer()|term()) -> wxMenuItem:wxMenuItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuremove">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% remove(This::wxMenu(), Itemid::integer()) -> wxMenuItem:wxMenuItem() </c>
-%% </p>
-%% <p><c>
-%% remove(This::wxMenu(), Item::wxMenuItem:wxMenuItem()) -> wxMenuItem:wxMenuItem() </c>
-%% </p>
+%% <br /> Also:<br />
+%% remove(This, Item) -> wxMenuItem:wxMenuItem() when<br />
+%% This::wxMenu(), Item::wxMenuItem:wxMenuItem().<br />
+%%
+-spec remove(This, Itemid) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Itemid::integer();
+ (This, Item) -> wxMenuItem:wxMenuItem() when
+ This::wxMenu(), Item::wxMenuItem:wxMenuItem().
remove(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
when is_integer(Itemid) ->
?CLASS(ThisT,wxMenu),
@@ -578,8 +635,9 @@ remove(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=ItemRef}) ->
wxe_util:call(?wxMenu_Remove_1_1,
<<ThisRef:32/?UI,ItemRef:32/?UI>>).
-%% @spec (This::wxMenu(), Itemid::integer(), HelpString::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenusethelpstring">external documentation</a>.
+-spec setHelpString(This, Itemid, HelpString) -> ok when
+ This::wxMenu(), Itemid::integer(), HelpString::unicode:chardata().
setHelpString(#wx_ref{type=ThisT,ref=ThisRef},Itemid,HelpString)
when is_integer(Itemid),is_list(HelpString) ->
?CLASS(ThisT,wxMenu),
@@ -587,8 +645,9 @@ setHelpString(#wx_ref{type=ThisT,ref=ThisRef},Itemid,HelpString)
wxe_util:cast(?wxMenu_SetHelpString,
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(HelpString_UC)):32/?UI,(HelpString_UC)/binary, 0:(((8- ((4+byte_size(HelpString_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenu(), Itemid::integer(), Label::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenusetlabel">external documentation</a>.
+-spec setLabel(This, Itemid, Label) -> ok when
+ This::wxMenu(), Itemid::integer(), Label::unicode:chardata().
setLabel(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Label)
when is_integer(Itemid),is_list(Label) ->
?CLASS(ThisT,wxMenu),
@@ -596,8 +655,9 @@ setLabel(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Label)
wxe_util:cast(?wxMenu_SetLabel,
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenu(), Title::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenusettitle">external documentation</a>.
+-spec setTitle(This, Title) -> ok when
+ This::wxMenu(), Title::unicode:chardata().
setTitle(#wx_ref{type=ThisT,ref=ThisRef},Title)
when is_list(Title) ->
?CLASS(ThisT,wxMenu),
@@ -605,8 +665,8 @@ setTitle(#wx_ref{type=ThisT,ref=ThisRef},Title)
wxe_util:cast(?wxMenu_SetTitle,
<<ThisRef:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((0+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenu()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxMenu()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxMenu),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxMenuBar.erl b/lib/wx/src/gen/wxMenuBar.erl
index 4ed1b2cbe6..b0253292bd 100644
--- a/lib/wx/src/gen/wxMenuBar.erl
+++ b/lib/wx/src/gen/wxMenuBar.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -72,26 +72,30 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxMenuBar/0]).
%% @hidden
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxMenuBar()
+-type wxMenuBar() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarwxmenubar">external documentation</a>.
+-spec new() -> wxMenuBar().
new() ->
wxe_util:construct(?wxMenuBar_new_0,
<<>>).
-%% @spec (Style::integer()) -> wxMenuBar()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarwxmenubar">external documentation</a>.
+-spec new(Style) -> wxMenuBar() when
+ Style::integer().
new(Style)
when is_integer(Style) ->
wxe_util:construct(?wxMenuBar_new_1,
<<Style:32/?UI>>).
-%% @spec (This::wxMenuBar(), Menu::wxMenu:wxMenu(), Title::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarappend">external documentation</a>.
+-spec append(This, Menu, Title) -> boolean() when
+ This::wxMenuBar(), Menu::wxMenu:wxMenu(), Title::unicode:chardata().
append(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef},Title)
when is_list(Title) ->
?CLASS(ThisT,wxMenuBar),
@@ -100,23 +104,27 @@ append(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef},Title)
wxe_util:call(?wxMenuBar_Append,
<<ThisRef:32/?UI,MenuRef:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((4+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenuBar(), Itemid::integer(), Check::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarcheck">external documentation</a>.
+-spec check(This, Itemid, Check) -> ok when
+ This::wxMenuBar(), Itemid::integer(), Check::boolean().
check(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Check)
when is_integer(Itemid),is_boolean(Check) ->
?CLASS(ThisT,wxMenuBar),
wxe_util:cast(?wxMenuBar_Check,
<<ThisRef:32/?UI,Itemid:32/?UI,(wxe_util:from_bool(Check)):32/?UI>>).
-%% @spec (This::wxMenuBar()) -> bool()
%% @equiv enable(This, [])
+-spec enable(This) -> boolean() when
+ This::wxMenuBar().
+
enable(This)
when is_record(This, wx_ref) ->
enable(This, []).
-%% @spec (This::wxMenuBar(), [Option]) -> bool()
-%% Option = {enable, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarenable">external documentation</a>.
+-spec enable(This, [Option]) -> boolean() when
+ This::wxMenuBar(),
+ Option :: {enable, boolean()}.
enable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxMenuBar),
@@ -126,24 +134,27 @@ enable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxMenuBar_Enable_1,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxMenuBar(), Itemid::integer(), Enable::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarenable">external documentation</a>.
+-spec enable(This, Itemid, Enable) -> ok when
+ This::wxMenuBar(), Itemid::integer(), Enable::boolean().
enable(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Enable)
when is_integer(Itemid),is_boolean(Enable) ->
?CLASS(ThisT,wxMenuBar),
wxe_util:cast(?wxMenuBar_Enable_2,
<<ThisRef:32/?UI,Itemid:32/?UI,(wxe_util:from_bool(Enable)):32/?UI>>).
-%% @spec (This::wxMenuBar(), Pos::integer(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarenabletop">external documentation</a>.
+-spec enableTop(This, Pos, Flag) -> ok when
+ This::wxMenuBar(), Pos::integer(), Flag::boolean().
enableTop(#wx_ref{type=ThisT,ref=ThisRef},Pos,Flag)
when is_integer(Pos),is_boolean(Flag) ->
?CLASS(ThisT,wxMenuBar),
wxe_util:cast(?wxMenuBar_EnableTop,
<<ThisRef:32/?UI,Pos:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxMenuBar(), Title::string()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarfindmenu">external documentation</a>.
+-spec findMenu(This, Title) -> integer() when
+ This::wxMenuBar(), Title::unicode:chardata().
findMenu(#wx_ref{type=ThisT,ref=ThisRef},Title)
when is_list(Title) ->
?CLASS(ThisT,wxMenuBar),
@@ -151,8 +162,9 @@ findMenu(#wx_ref{type=ThisT,ref=ThisRef},Title)
wxe_util:call(?wxMenuBar_FindMenu,
<<ThisRef:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((0+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenuBar(), MenuString::string(), ItemString::string()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarfindmenuitem">external documentation</a>.
+-spec findMenuItem(This, MenuString, ItemString) -> integer() when
+ This::wxMenuBar(), MenuString::unicode:chardata(), ItemString::unicode:chardata().
findMenuItem(#wx_ref{type=ThisT,ref=ThisRef},MenuString,ItemString)
when is_list(MenuString),is_list(ItemString) ->
?CLASS(ThisT,wxMenuBar),
@@ -161,62 +173,70 @@ findMenuItem(#wx_ref{type=ThisT,ref=ThisRef},MenuString,ItemString)
wxe_util:call(?wxMenuBar_FindMenuItem,
<<ThisRef:32/?UI,(byte_size(MenuString_UC)):32/?UI,(MenuString_UC)/binary, 0:(((8- ((0+byte_size(MenuString_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(ItemString_UC)):32/?UI,(ItemString_UC)/binary, 0:(((8- ((4+byte_size(ItemString_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenuBar(), Id::integer()) -> wxMenuItem:wxMenuItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarfinditem">external documentation</a>.
+-spec findItem(This, Id) -> wxMenuItem:wxMenuItem() when
+ This::wxMenuBar(), Id::integer().
findItem(#wx_ref{type=ThisT,ref=ThisRef},Id)
when is_integer(Id) ->
?CLASS(ThisT,wxMenuBar),
wxe_util:call(?wxMenuBar_FindItem,
<<ThisRef:32/?UI,Id:32/?UI>>).
-%% @spec (This::wxMenuBar(), Itemid::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubargethelpstring">external documentation</a>.
+-spec getHelpString(This, Itemid) -> unicode:charlist() when
+ This::wxMenuBar(), Itemid::integer().
getHelpString(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
when is_integer(Itemid) ->
?CLASS(ThisT,wxMenuBar),
wxe_util:call(?wxMenuBar_GetHelpString,
<<ThisRef:32/?UI,Itemid:32/?UI>>).
-%% @spec (This::wxMenuBar()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubargetlabel">external documentation</a>.
+-spec getLabel(This) -> unicode:charlist() when
+ This::wxMenuBar().
getLabel(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuBar),
wxe_util:call(?wxMenuBar_GetLabel_0,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuBar(), Itemid::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubargetlabel">external documentation</a>.
+-spec getLabel(This, Itemid) -> unicode:charlist() when
+ This::wxMenuBar(), Itemid::integer().
getLabel(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
when is_integer(Itemid) ->
?CLASS(ThisT,wxMenuBar),
wxe_util:call(?wxMenuBar_GetLabel_1,
<<ThisRef:32/?UI,Itemid:32/?UI>>).
-%% @spec (This::wxMenuBar(), Pos::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubargetlabeltop">external documentation</a>.
+-spec getLabelTop(This, Pos) -> unicode:charlist() when
+ This::wxMenuBar(), Pos::integer().
getLabelTop(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxMenuBar),
wxe_util:call(?wxMenuBar_GetLabelTop,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxMenuBar(), Pos::integer()) -> wxMenu:wxMenu()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubargetmenu">external documentation</a>.
+-spec getMenu(This, Pos) -> wxMenu:wxMenu() when
+ This::wxMenuBar(), Pos::integer().
getMenu(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxMenuBar),
wxe_util:call(?wxMenuBar_GetMenu,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxMenuBar()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubargetmenucount">external documentation</a>.
+-spec getMenuCount(This) -> integer() when
+ This::wxMenuBar().
getMenuCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuBar),
wxe_util:call(?wxMenuBar_GetMenuCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuBar(), Pos::integer(), Menu::wxMenu:wxMenu(), Title::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarinsert">external documentation</a>.
+-spec insert(This, Pos, Menu, Title) -> boolean() when
+ This::wxMenuBar(), Pos::integer(), Menu::wxMenu:wxMenu(), Title::unicode:chardata().
insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=MenuT,ref=MenuRef},Title)
when is_integer(Pos),is_list(Title) ->
?CLASS(ThisT,wxMenuBar),
@@ -225,39 +245,44 @@ insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=MenuT,ref=MenuRef},Title
wxe_util:call(?wxMenuBar_Insert,
<<ThisRef:32/?UI,Pos:32/?UI,MenuRef:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((0+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenuBar(), Itemid::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarischecked">external documentation</a>.
+-spec isChecked(This, Itemid) -> boolean() when
+ This::wxMenuBar(), Itemid::integer().
isChecked(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
when is_integer(Itemid) ->
?CLASS(ThisT,wxMenuBar),
wxe_util:call(?wxMenuBar_IsChecked,
<<ThisRef:32/?UI,Itemid:32/?UI>>).
-%% @spec (This::wxMenuBar()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarisenabled">external documentation</a>.
+-spec isEnabled(This) -> boolean() when
+ This::wxMenuBar().
isEnabled(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuBar),
wxe_util:call(?wxMenuBar_IsEnabled_0,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuBar(), Itemid::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarisenabled">external documentation</a>.
+-spec isEnabled(This, Itemid) -> boolean() when
+ This::wxMenuBar(), Itemid::integer().
isEnabled(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
when is_integer(Itemid) ->
?CLASS(ThisT,wxMenuBar),
wxe_util:call(?wxMenuBar_IsEnabled_1,
<<ThisRef:32/?UI,Itemid:32/?UI>>).
-%% @spec (This::wxMenuBar(), Pos::integer()) -> wxMenu:wxMenu()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarremove">external documentation</a>.
+-spec remove(This, Pos) -> wxMenu:wxMenu() when
+ This::wxMenuBar(), Pos::integer().
remove(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxMenuBar),
wxe_util:call(?wxMenuBar_Remove,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxMenuBar(), Pos::integer(), Menu::wxMenu:wxMenu(), Title::string()) -> wxMenu:wxMenu()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarreplace">external documentation</a>.
+-spec replace(This, Pos, Menu, Title) -> wxMenu:wxMenu() when
+ This::wxMenuBar(), Pos::integer(), Menu::wxMenu:wxMenu(), Title::unicode:chardata().
replace(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=MenuT,ref=MenuRef},Title)
when is_integer(Pos),is_list(Title) ->
?CLASS(ThisT,wxMenuBar),
@@ -266,8 +291,9 @@ replace(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=MenuT,ref=MenuRef},Titl
wxe_util:call(?wxMenuBar_Replace,
<<ThisRef:32/?UI,Pos:32/?UI,MenuRef:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((0+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenuBar(), Itemid::integer(), HelpString::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarsethelpstring">external documentation</a>.
+-spec setHelpString(This, Itemid, HelpString) -> ok when
+ This::wxMenuBar(), Itemid::integer(), HelpString::unicode:chardata().
setHelpString(#wx_ref{type=ThisT,ref=ThisRef},Itemid,HelpString)
when is_integer(Itemid),is_list(HelpString) ->
?CLASS(ThisT,wxMenuBar),
@@ -275,8 +301,9 @@ setHelpString(#wx_ref{type=ThisT,ref=ThisRef},Itemid,HelpString)
wxe_util:cast(?wxMenuBar_SetHelpString,
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(HelpString_UC)):32/?UI,(HelpString_UC)/binary, 0:(((8- ((4+byte_size(HelpString_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenuBar(), S::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarsetlabel">external documentation</a>.
+-spec setLabel(This, S) -> ok when
+ This::wxMenuBar(), S::unicode:chardata().
setLabel(#wx_ref{type=ThisT,ref=ThisRef},S)
when is_list(S) ->
?CLASS(ThisT,wxMenuBar),
@@ -284,8 +311,9 @@ setLabel(#wx_ref{type=ThisT,ref=ThisRef},S)
wxe_util:cast(?wxMenuBar_SetLabel_1,
<<ThisRef:32/?UI,(byte_size(S_UC)):32/?UI,(S_UC)/binary, 0:(((8- ((0+byte_size(S_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenuBar(), Itemid::integer(), Label::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarsetlabel">external documentation</a>.
+-spec setLabel(This, Itemid, Label) -> ok when
+ This::wxMenuBar(), Itemid::integer(), Label::unicode:chardata().
setLabel(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Label)
when is_integer(Itemid),is_list(Label) ->
?CLASS(ThisT,wxMenuBar),
@@ -293,8 +321,9 @@ setLabel(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Label)
wxe_util:cast(?wxMenuBar_SetLabel_2,
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenuBar(), Pos::integer(), Label::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenubar.html#wxmenubarsetlabeltop">external documentation</a>.
+-spec setLabelTop(This, Pos, Label) -> ok when
+ This::wxMenuBar(), Pos::integer(), Label::unicode:chardata().
setLabelTop(#wx_ref{type=ThisT,ref=ThisRef},Pos,Label)
when is_integer(Pos),is_list(Label) ->
?CLASS(ThisT,wxMenuBar),
@@ -302,8 +331,8 @@ setLabelTop(#wx_ref{type=ThisT,ref=ThisRef},Pos,Label)
wxe_util:cast(?wxMenuBar_SetLabelTop,
<<ThisRef:32/?UI,Pos:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenuBar()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxMenuBar()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxMenuBar),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxMenuEvent.erl b/lib/wx/src/gen/wxMenuEvent.erl
index fe368e679a..84c4760aa6 100644
--- a/lib/wx/src/gen/wxMenuEvent.erl
+++ b/lib/wx/src/gen/wxMenuEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,26 +37,31 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxMenuEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxMenuEvent()) -> wxMenu:wxMenu()
+-type wxMenuEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuevent.html#wxmenueventgetmenu">external documentation</a>.
+-spec getMenu(This) -> wxMenu:wxMenu() when
+ This::wxMenuEvent().
getMenu(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuEvent),
wxe_util:call(?wxMenuEvent_GetMenu,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuevent.html#wxmenueventgetmenuid">external documentation</a>.
+-spec getMenuId(This) -> integer() when
+ This::wxMenuEvent().
getMenuId(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuEvent),
wxe_util:call(?wxMenuEvent_GetMenuId,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuevent.html#wxmenueventispopup">external documentation</a>.
+-spec isPopup(This) -> boolean() when
+ This::wxMenuEvent().
isPopup(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuEvent),
wxe_util:call(?wxMenuEvent_IsPopup,
diff --git a/lib/wx/src/gen/wxMenuItem.erl b/lib/wx/src/gen/wxMenuItem.erl
index e2bbe681c5..7ad71a2858 100644
--- a/lib/wx/src/gen/wxMenuItem.erl
+++ b/lib/wx/src/gen/wxMenuItem.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -32,19 +32,26 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxMenuItem/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxMenuItem()
+-type wxMenuItem() :: wx:wx_object().
%% @equiv new([])
+-spec new() -> wxMenuItem().
+
new() ->
new([]).
-%% @spec ([Option]) -> wxMenuItem()
-%% Option = {parentMenu, wxMenu:wxMenu()} | {id, integer()} | {text, string()} | {help, string()} | {kind, WxItemKind} | {subMenu, wxMenu:wxMenu()}
-%% WxItemKind = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemwxmenuitem">external documentation</a>.
-%%<br /> WxItemKind is one of ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+%%<br /> Kind = ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+-spec new([Option]) -> wxMenuItem() when
+ Option :: {parentMenu, wxMenu:wxMenu()}
+ | {id, integer()}
+ | {text, unicode:chardata()}
+ | {help, unicode:chardata()}
+ | {kind, wx:wx_enum()}
+ | {subMenu, wxMenu:wxMenu()}.
new(Options)
when is_list(Options) ->
MOpts = fun({parentMenu, #wx_ref{type=ParentMenuT,ref=ParentMenuRef}}, Acc) -> ?CLASS(ParentMenuT,wxMenu),[<<1:32/?UI,ParentMenuRef:32/?UI>>|Acc];
@@ -58,15 +65,18 @@ new(Options)
wxe_util:construct(?wxMenuItem_new,
<<BinOpt/binary>>).
-%% @spec (This::wxMenuItem()) -> ok
%% @equiv check(This, [])
+-spec check(This) -> ok when
+ This::wxMenuItem().
+
check(This)
when is_record(This, wx_ref) ->
check(This, []).
-%% @spec (This::wxMenuItem(), [Option]) -> ok
-%% Option = {check, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemcheck">external documentation</a>.
+-spec check(This, [Option]) -> ok when
+ This::wxMenuItem(),
+ Option :: {check, boolean()}.
check(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxMenuItem),
@@ -76,15 +86,18 @@ check(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxMenuItem_Check,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxMenuItem()) -> ok
%% @equiv enable(This, [])
+-spec enable(This) -> ok when
+ This::wxMenuItem().
+
enable(This)
when is_record(This, wx_ref) ->
enable(This, []).
-%% @spec (This::wxMenuItem(), [Option]) -> ok
-%% Option = {enable, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemenable">external documentation</a>.
+-spec enable(This, [Option]) -> ok when
+ This::wxMenuItem(),
+ Option :: {enable, boolean()}.
enable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxMenuItem),
@@ -94,117 +107,132 @@ enable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxMenuItem_Enable,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxMenuItem()) -> wxBitmap:wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetbitmap">external documentation</a>.
+-spec getBitmap(This) -> wxBitmap:wxBitmap() when
+ This::wxMenuItem().
getBitmap(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuItem),
wxe_util:call(?wxMenuItem_GetBitmap,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuItem()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgethelp">external documentation</a>.
+-spec getHelp(This) -> unicode:charlist() when
+ This::wxMenuItem().
getHelp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuItem),
wxe_util:call(?wxMenuItem_GetHelp,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuItem()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetid">external documentation</a>.
+-spec getId(This) -> integer() when
+ This::wxMenuItem().
getId(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuItem),
wxe_util:call(?wxMenuItem_GetId,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuItem()) -> WxItemKind
-%% WxItemKind = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetkind">external documentation</a>.
-%%<br /> WxItemKind is one of ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+%%<br /> Res = ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+-spec getKind(This) -> wx:wx_enum() when
+ This::wxMenuItem().
getKind(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuItem),
wxe_util:call(?wxMenuItem_GetKind,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuItem()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetlabel">external documentation</a>.
+-spec getLabel(This) -> unicode:charlist() when
+ This::wxMenuItem().
getLabel(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuItem),
wxe_util:call(?wxMenuItem_GetLabel,
<<ThisRef:32/?UI>>).
-%% @spec (Text::string()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetlabelfromtext">external documentation</a>.
+-spec getLabelFromText(Text) -> unicode:charlist() when
+ Text::unicode:chardata().
getLabelFromText(Text)
when is_list(Text) ->
Text_UC = unicode:characters_to_binary([Text,0]),
wxe_util:call(?wxMenuItem_GetLabelFromText,
<<(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenuItem()) -> wxMenu:wxMenu()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetmenu">external documentation</a>.
+-spec getMenu(This) -> wxMenu:wxMenu() when
+ This::wxMenuItem().
getMenu(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuItem),
wxe_util:call(?wxMenuItem_GetMenu,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuItem()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgettext">external documentation</a>.
+-spec getText(This) -> unicode:charlist() when
+ This::wxMenuItem().
getText(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuItem),
wxe_util:call(?wxMenuItem_GetText,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuItem()) -> wxMenu:wxMenu()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetsubmenu">external documentation</a>.
+-spec getSubMenu(This) -> wxMenu:wxMenu() when
+ This::wxMenuItem().
getSubMenu(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuItem),
wxe_util:call(?wxMenuItem_GetSubMenu,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuItem()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemischeckable">external documentation</a>.
+-spec isCheckable(This) -> boolean() when
+ This::wxMenuItem().
isCheckable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuItem),
wxe_util:call(?wxMenuItem_IsCheckable,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuItem()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemischecked">external documentation</a>.
+-spec isChecked(This) -> boolean() when
+ This::wxMenuItem().
isChecked(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuItem),
wxe_util:call(?wxMenuItem_IsChecked,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuItem()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemisenabled">external documentation</a>.
+-spec isEnabled(This) -> boolean() when
+ This::wxMenuItem().
isEnabled(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuItem),
wxe_util:call(?wxMenuItem_IsEnabled,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuItem()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemisseparator">external documentation</a>.
+-spec isSeparator(This) -> boolean() when
+ This::wxMenuItem().
isSeparator(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuItem),
wxe_util:call(?wxMenuItem_IsSeparator,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuItem()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemissubmenu">external documentation</a>.
+-spec isSubMenu(This) -> boolean() when
+ This::wxMenuItem().
isSubMenu(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMenuItem),
wxe_util:call(?wxMenuItem_IsSubMenu,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMenuItem(), Bitmap::wxBitmap:wxBitmap()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemsetbitmap">external documentation</a>.
+-spec setBitmap(This, Bitmap) -> ok when
+ This::wxMenuItem(), Bitmap::wxBitmap:wxBitmap().
setBitmap(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BitmapT,ref=BitmapRef}) ->
?CLASS(ThisT,wxMenuItem),
?CLASS(BitmapT,wxBitmap),
wxe_util:cast(?wxMenuItem_SetBitmap,
<<ThisRef:32/?UI,BitmapRef:32/?UI>>).
-%% @spec (This::wxMenuItem(), Str::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemsethelp">external documentation</a>.
+-spec setHelp(This, Str) -> ok when
+ This::wxMenuItem(), Str::unicode:chardata().
setHelp(#wx_ref{type=ThisT,ref=ThisRef},Str)
when is_list(Str) ->
?CLASS(ThisT,wxMenuItem),
@@ -212,24 +240,27 @@ setHelp(#wx_ref{type=ThisT,ref=ThisRef},Str)
wxe_util:cast(?wxMenuItem_SetHelp,
<<ThisRef:32/?UI,(byte_size(Str_UC)):32/?UI,(Str_UC)/binary, 0:(((8- ((0+byte_size(Str_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenuItem(), Menu::wxMenu:wxMenu()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemsetmenu">external documentation</a>.
+-spec setMenu(This, Menu) -> ok when
+ This::wxMenuItem(), Menu::wxMenu:wxMenu().
setMenu(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef}) ->
?CLASS(ThisT,wxMenuItem),
?CLASS(MenuT,wxMenu),
wxe_util:cast(?wxMenuItem_SetMenu,
<<ThisRef:32/?UI,MenuRef:32/?UI>>).
-%% @spec (This::wxMenuItem(), Menu::wxMenu:wxMenu()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemsetsubmenu">external documentation</a>.
+-spec setSubMenu(This, Menu) -> ok when
+ This::wxMenuItem(), Menu::wxMenu:wxMenu().
setSubMenu(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef}) ->
?CLASS(ThisT,wxMenuItem),
?CLASS(MenuT,wxMenu),
wxe_util:cast(?wxMenuItem_SetSubMenu,
<<ThisRef:32/?UI,MenuRef:32/?UI>>).
-%% @spec (This::wxMenuItem(), Str::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemsettext">external documentation</a>.
+-spec setText(This, Str) -> ok when
+ This::wxMenuItem(), Str::unicode:chardata().
setText(#wx_ref{type=ThisT,ref=ThisRef},Str)
when is_list(Str) ->
?CLASS(ThisT,wxMenuItem),
@@ -237,8 +268,8 @@ setText(#wx_ref{type=ThisT,ref=ThisRef},Str)
wxe_util:cast(?wxMenuItem_SetText,
<<ThisRef:32/?UI,(byte_size(Str_UC)):32/?UI,(Str_UC)/binary, 0:(((8- ((0+byte_size(Str_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxMenuItem()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxMenuItem()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxMenuItem),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxMessageDialog.erl b/lib/wx/src/gen/wxMessageDialog.erl
index d13bb7cb6e..83c3e67d01 100644
--- a/lib/wx/src/gen/wxMessageDialog.erl
+++ b/lib/wx/src/gen/wxMessageDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -77,6 +77,7 @@
transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxMessageDialog/0]).
%% @hidden
parent_class(wxDialog) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -84,15 +85,21 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Parent::wxWindow:wxWindow(), Message::string()) -> wxMessageDialog()
+-type wxMessageDialog() :: wx:wx_object().
%% @equiv new(Parent,Message, [])
+-spec new(Parent, Message) -> wxMessageDialog() when
+ Parent::wxWindow:wxWindow(), Message::unicode:chardata().
+
new(Parent,Message)
when is_record(Parent, wx_ref),is_list(Message) ->
new(Parent,Message, []).
-%% @spec (Parent::wxWindow:wxWindow(), Message::string(), [Option]) -> wxMessageDialog()
-%% Option = {caption, string()} | {style, integer()} | {pos, {X::integer(), Y::integer()}}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmessagedialog.html#wxmessagedialogwxmessagedialog">external documentation</a>.
+-spec new(Parent, Message, [Option]) -> wxMessageDialog() when
+ Parent::wxWindow:wxWindow(), Message::unicode:chardata(),
+ Option :: {caption, unicode:chardata()}
+ | {style, integer()}
+ | {pos, {X::integer(), Y::integer()}}.
new(#wx_ref{type=ParentT,ref=ParentRef},Message, Options)
when is_list(Message),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -105,8 +112,8 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Message, Options)
wxe_util:construct(?wxMessageDialog_new,
<<ParentRef:32/?UI,(byte_size(Message_UC)):32/?UI,(Message_UC)/binary, 0:(((8- ((0+byte_size(Message_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMessageDialog()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxMessageDialog()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxMessageDialog),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxMiniFrame.erl b/lib/wx/src/gen/wxMiniFrame.erl
index 108ebcfb0e..3521c6458c 100644
--- a/lib/wx/src/gen/wxMiniFrame.erl
+++ b/lib/wx/src/gen/wxMiniFrame.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -80,6 +80,7 @@
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
validate/1,warpPointer/3]).
+-export_type([wxMiniFrame/0]).
%% @hidden
parent_class(wxFrame) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -87,21 +88,27 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxMiniFrame()
+-type wxMiniFrame() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxminiframe.html#wxminiframewxminiframe">external documentation</a>.
+-spec new() -> wxMiniFrame().
new() ->
wxe_util:construct(?wxMiniFrame_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Title::string()) -> wxMiniFrame()
%% @equiv new(Parent,Id,Title, [])
+-spec new(Parent, Id, Title) -> wxMiniFrame() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata().
+
new(Parent,Id,Title)
when is_record(Parent, wx_ref),is_integer(Id),is_list(Title) ->
new(Parent,Id,Title, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Title::string(), [Option]) -> wxMiniFrame()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxminiframe.html#wxminiframewxminiframe">external documentation</a>.
+-spec new(Parent, Id, Title, [Option]) -> wxMiniFrame() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options)
when is_integer(Id),is_list(Title),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -114,15 +121,20 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options)
wxe_util:construct(?wxMiniFrame_new_4,
<<ParentRef:32/?UI,Id:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((4+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMiniFrame(), Parent::wxWindow:wxWindow(), Id::integer(), Title::string()) -> bool()
%% @equiv create(This,Parent,Id,Title, [])
+-spec create(This, Parent, Id, Title) -> boolean() when
+ This::wxMiniFrame(), Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata().
+
create(This,Parent,Id,Title)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Title) ->
create(This,Parent,Id,Title, []).
-%% @spec (This::wxMiniFrame(), Parent::wxWindow:wxWindow(), Id::integer(), Title::string(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxminiframe.html#wxminiframecreate">external documentation</a>.
+-spec create(This, Parent, Id, Title, [Option]) -> boolean() when
+ This::wxMiniFrame(), Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options)
when is_integer(Id),is_list(Title),is_list(Options) ->
?CLASS(ThisT,wxMiniFrame),
@@ -136,8 +148,8 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Ti
wxe_util:call(?wxMiniFrame_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((0+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMiniFrame()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxMiniFrame()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxMiniFrame),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxMirrorDC.erl b/lib/wx/src/gen/wxMirrorDC.erl
index c218bd7e72..1fdb90e4eb 100644
--- a/lib/wx/src/gen/wxMirrorDC.erl
+++ b/lib/wx/src/gen/wxMirrorDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -38,10 +38,10 @@
drawPoint/2,drawPolygon/2,drawPolygon/3,drawRectangle/2,drawRectangle/3,
drawRotatedText/4,drawRoundedRectangle/3,drawRoundedRectangle/4,
drawText/3,endDoc/1,endPage/1,floodFill/3,floodFill/4,getBackground/1,
- getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/2,
+ getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/1,
getFont/1,getLayoutDirection/1,getLogicalFunction/1,getMapMode/1,
- getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/3,
- getPen/1,getPixel/3,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
+ getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/2,
+ getPen/1,getPixel/2,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
getTextExtent/3,getTextForeground/1,getUserScale/1,gradientFillConcentric/4,
gradientFillConcentric/5,gradientFillLinear/4,gradientFillLinear/5,
isOk/1,logicalToDeviceX/2,logicalToDeviceXRel/2,logicalToDeviceY/2,
@@ -52,20 +52,23 @@
setPen/2,setTextBackground/2,setTextForeground/2,setUserScale/3,startDoc/2,
startPage/1]).
+-export_type([wxMirrorDC/0]).
%% @hidden
parent_class(wxDC) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Dc::wxDC:wxDC(), Mirror::bool()) -> wxMirrorDC()
+-type wxMirrorDC() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmirrordc.html#wxmirrordcwxmirrordc">external documentation</a>.
+-spec new(Dc, Mirror) -> wxMirrorDC() when
+ Dc::wxDC:wxDC(), Mirror::boolean().
new(#wx_ref{type=DcT,ref=DcRef},Mirror)
when is_boolean(Mirror) ->
?CLASS(DcT,wxDC),
wxe_util:construct(?wxMirrorDC_new,
<<DcRef:32/?UI,(wxe_util:from_bool(Mirror)):32/?UI>>).
-%% @spec (This::wxMirrorDC()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxMirrorDC()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxMirrorDC),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
@@ -152,11 +155,11 @@ getSize(This) -> wxDC:getSize(This).
%% @hidden
getPPI(This) -> wxDC:getPPI(This).
%% @hidden
-getPixel(This,Pt,Col) -> wxDC:getPixel(This,Pt,Col).
+getPixel(This,Pt) -> wxDC:getPixel(This,Pt).
%% @hidden
getPen(This) -> wxDC:getPen(This).
%% @hidden
-getPartialTextExtents(This,Text,Widths) -> wxDC:getPartialTextExtents(This,Text,Widths).
+getPartialTextExtents(This,Text) -> wxDC:getPartialTextExtents(This,Text).
%% @hidden
getMultiLineTextExtent(This,String, Options) -> wxDC:getMultiLineTextExtent(This,String, Options).
%% @hidden
@@ -170,7 +173,7 @@ getLayoutDirection(This) -> wxDC:getLayoutDirection(This).
%% @hidden
getFont(This) -> wxDC:getFont(This).
%% @hidden
-getClippingBox(This,Rect) -> wxDC:getClippingBox(This,Rect).
+getClippingBox(This) -> wxDC:getClippingBox(This).
%% @hidden
getCharWidth(This) -> wxDC:getCharWidth(This).
%% @hidden
diff --git a/lib/wx/src/gen/wxMouseCaptureChangedEvent.erl b/lib/wx/src/gen/wxMouseCaptureChangedEvent.erl
index cb921bf2df..659582b611 100644
--- a/lib/wx/src/gen/wxMouseCaptureChangedEvent.erl
+++ b/lib/wx/src/gen/wxMouseCaptureChangedEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,12 +37,15 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxMouseCaptureChangedEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxMouseCaptureChangedEvent()) -> wxWindow:wxWindow()
+-type wxMouseCaptureChangedEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmousecapturechangedevent.html#wxmousecapturechangedeventgetcapturedwindow">external documentation</a>.
+-spec getCapturedWindow(This) -> wxWindow:wxWindow() when
+ This::wxMouseCaptureChangedEvent().
getCapturedWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseCaptureChangedEvent),
wxe_util:call(?wxMouseCaptureChangedEvent_GetCapturedWindow,
diff --git a/lib/wx/src/gen/wxMouseEvent.erl b/lib/wx/src/gen/wxMouseEvent.erl
index a91d2a2e99..97ea9e908f 100644
--- a/lib/wx/src/gen/wxMouseEvent.erl
+++ b/lib/wx/src/gen/wxMouseEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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,34 +43,41 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxMouseEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxMouseEvent()) -> bool()
+-type wxMouseEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventaltdown">external documentation</a>.
+-spec altDown(This) -> boolean() when
+ This::wxMouseEvent().
altDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_AltDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent(), But::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventbutton">external documentation</a>.
+-spec button(This, But) -> boolean() when
+ This::wxMouseEvent(), But::integer().
button(#wx_ref{type=ThisT,ref=ThisRef},But)
when is_integer(But) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_Button,
<<ThisRef:32/?UI,But:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @equiv buttonDClick(This, [])
+-spec buttonDClick(This) -> boolean() when
+ This::wxMouseEvent().
+
buttonDClick(This)
when is_record(This, wx_ref) ->
buttonDClick(This, []).
-%% @spec (This::wxMouseEvent(), [Option]) -> bool()
-%% Option = {but, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventbuttondclick">external documentation</a>.
+-spec buttonDClick(This, [Option]) -> boolean() when
+ This::wxMouseEvent(),
+ Option :: {but, integer()}.
buttonDClick(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxMouseEvent),
@@ -80,15 +87,18 @@ buttonDClick(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxMouseEvent_ButtonDClick,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @equiv buttonDown(This, [])
+-spec buttonDown(This) -> boolean() when
+ This::wxMouseEvent().
+
buttonDown(This)
when is_record(This, wx_ref) ->
buttonDown(This, []).
-%% @spec (This::wxMouseEvent(), [Option]) -> bool()
-%% Option = {but, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventbuttondown">external documentation</a>.
+-spec buttonDown(This, [Option]) -> boolean() when
+ This::wxMouseEvent(),
+ Option :: {but, integer()}.
buttonDown(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxMouseEvent),
@@ -98,15 +108,18 @@ buttonDown(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxMouseEvent_ButtonDown,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @equiv buttonUp(This, [])
+-spec buttonUp(This) -> boolean() when
+ This::wxMouseEvent().
+
buttonUp(This)
when is_record(This, wx_ref) ->
buttonUp(This, []).
-%% @spec (This::wxMouseEvent(), [Option]) -> bool()
-%% Option = {but, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventbuttonup">external documentation</a>.
+-spec buttonUp(This, [Option]) -> boolean() when
+ This::wxMouseEvent(),
+ Option :: {but, integer()}.
buttonUp(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxMouseEvent),
@@ -116,212 +129,242 @@ buttonUp(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxMouseEvent_ButtonUp,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventcmddown">external documentation</a>.
+-spec cmdDown(This) -> boolean() when
+ This::wxMouseEvent().
cmdDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_CmdDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventcontroldown">external documentation</a>.
+-spec controlDown(This) -> boolean() when
+ This::wxMouseEvent().
controlDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_ControlDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventdragging">external documentation</a>.
+-spec dragging(This) -> boolean() when
+ This::wxMouseEvent().
dragging(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_Dragging,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseevententering">external documentation</a>.
+-spec entering(This) -> boolean() when
+ This::wxMouseEvent().
entering(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_Entering,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventgetbutton">external documentation</a>.
+-spec getButton(This) -> integer() when
+ This::wxMouseEvent().
getButton(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_GetButton,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventgetposition">external documentation</a>.
+-spec getPosition(This) -> {X::integer(), Y::integer()} when
+ This::wxMouseEvent().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_GetPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent(), Dc::wxDC:wxDC()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventgetlogicalposition">external documentation</a>.
+-spec getLogicalPosition(This, Dc) -> {X::integer(), Y::integer()} when
+ This::wxMouseEvent(), Dc::wxDC:wxDC().
getLogicalPosition(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DcT,ref=DcRef}) ->
?CLASS(ThisT,wxMouseEvent),
?CLASS(DcT,wxDC),
wxe_util:call(?wxMouseEvent_GetLogicalPosition,
<<ThisRef:32/?UI,DcRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventgetlinesperaction">external documentation</a>.
+-spec getLinesPerAction(This) -> integer() when
+ This::wxMouseEvent().
getLinesPerAction(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_GetLinesPerAction,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventgetwheelrotation">external documentation</a>.
+-spec getWheelRotation(This) -> integer() when
+ This::wxMouseEvent().
getWheelRotation(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_GetWheelRotation,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventgetwheeldelta">external documentation</a>.
+-spec getWheelDelta(This) -> integer() when
+ This::wxMouseEvent().
getWheelDelta(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_GetWheelDelta,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventgetx">external documentation</a>.
+-spec getX(This) -> integer() when
+ This::wxMouseEvent().
getX(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_GetX,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventgety">external documentation</a>.
+-spec getY(This) -> integer() when
+ This::wxMouseEvent().
getY(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_GetY,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventisbutton">external documentation</a>.
+-spec isButton(This) -> boolean() when
+ This::wxMouseEvent().
isButton(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_IsButton,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventispagescroll">external documentation</a>.
+-spec isPageScroll(This) -> boolean() when
+ This::wxMouseEvent().
isPageScroll(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_IsPageScroll,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventleaving">external documentation</a>.
+-spec leaving(This) -> boolean() when
+ This::wxMouseEvent().
leaving(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_Leaving,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventleftdclick">external documentation</a>.
+-spec leftDClick(This) -> boolean() when
+ This::wxMouseEvent().
leftDClick(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_LeftDClick,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventleftdown">external documentation</a>.
+-spec leftDown(This) -> boolean() when
+ This::wxMouseEvent().
leftDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_LeftDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventleftisdown">external documentation</a>.
+-spec leftIsDown(This) -> boolean() when
+ This::wxMouseEvent().
leftIsDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_LeftIsDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventleftup">external documentation</a>.
+-spec leftUp(This) -> boolean() when
+ This::wxMouseEvent().
leftUp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_LeftUp,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventmetadown">external documentation</a>.
+-spec metaDown(This) -> boolean() when
+ This::wxMouseEvent().
metaDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_MetaDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventmiddledclick">external documentation</a>.
+-spec middleDClick(This) -> boolean() when
+ This::wxMouseEvent().
middleDClick(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_MiddleDClick,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventmiddledown">external documentation</a>.
+-spec middleDown(This) -> boolean() when
+ This::wxMouseEvent().
middleDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_MiddleDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventmiddleisdown">external documentation</a>.
+-spec middleIsDown(This) -> boolean() when
+ This::wxMouseEvent().
middleIsDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_MiddleIsDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventmiddleup">external documentation</a>.
+-spec middleUp(This) -> boolean() when
+ This::wxMouseEvent().
middleUp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_MiddleUp,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventmoving">external documentation</a>.
+-spec moving(This) -> boolean() when
+ This::wxMouseEvent().
moving(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_Moving,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventrightdclick">external documentation</a>.
+-spec rightDClick(This) -> boolean() when
+ This::wxMouseEvent().
rightDClick(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_RightDClick,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventrightdown">external documentation</a>.
+-spec rightDown(This) -> boolean() when
+ This::wxMouseEvent().
rightDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_RightDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventrightisdown">external documentation</a>.
+-spec rightIsDown(This) -> boolean() when
+ This::wxMouseEvent().
rightIsDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_RightIsDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventrightup">external documentation</a>.
+-spec rightUp(This) -> boolean() when
+ This::wxMouseEvent().
rightUp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_RightUp,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMouseEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmouseevent.html#wxmouseeventshiftdown">external documentation</a>.
+-spec shiftDown(This) -> boolean() when
+ This::wxMouseEvent().
shiftDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMouseEvent),
wxe_util:call(?wxMouseEvent_ShiftDown,
diff --git a/lib/wx/src/gen/wxMoveEvent.erl b/lib/wx/src/gen/wxMoveEvent.erl
index 97cf803310..b2f2fa74df 100644
--- a/lib/wx/src/gen/wxMoveEvent.erl
+++ b/lib/wx/src/gen/wxMoveEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,12 +37,15 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxMoveEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxMoveEvent()) -> {X::integer(), Y::integer()}
+-type wxMoveEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmoveevent.html#wxmoveeventgetposition">external documentation</a>.
+-spec getPosition(This) -> {X::integer(), Y::integer()} when
+ This::wxMoveEvent().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMoveEvent),
wxe_util:call(?wxMoveEvent_GetPosition,
diff --git a/lib/wx/src/gen/wxMultiChoiceDialog.erl b/lib/wx/src/gen/wxMultiChoiceDialog.erl
index 6fae0c4860..6a6a6b833a 100644
--- a/lib/wx/src/gen/wxMultiChoiceDialog.erl
+++ b/lib/wx/src/gen/wxMultiChoiceDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -77,6 +77,7 @@
transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxMultiChoiceDialog/0]).
%% @hidden
parent_class(wxDialog) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -84,21 +85,26 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxMultiChoiceDialog()
+-type wxMultiChoiceDialog() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmultichoicedialog.html#wxmultichoicedialogwxmultichoicedialog">external documentation</a>.
+-spec new() -> wxMultiChoiceDialog().
new() ->
wxe_util:construct(?wxMultiChoiceDialog_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Message::string(), Caption::string(), Choices::[[string()]]) -> wxMultiChoiceDialog()
%% @equiv new(Parent,Message,Caption,Choices, [])
+-spec new(Parent, Message, Caption, Choices) -> wxMultiChoiceDialog() when
+ Parent::wxWindow:wxWindow(), Message::unicode:chardata(), Caption::unicode:chardata(), Choices::[unicode:chardata()].
+
new(Parent,Message,Caption,Choices)
when is_record(Parent, wx_ref),is_list(Message),is_list(Caption),is_list(Choices) ->
new(Parent,Message,Caption,Choices, []).
-%% @spec (Parent::wxWindow:wxWindow(), Message::string(), Caption::string(), Choices::[[string()]], [Option]) -> wxMultiChoiceDialog()
-%% Option = {style, integer()} | {pos, {X::integer(), Y::integer()}}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmultichoicedialog.html#wxmultichoicedialogwxmultichoicedialog">external documentation</a>.
+-spec new(Parent, Message, Caption, Choices, [Option]) -> wxMultiChoiceDialog() when
+ Parent::wxWindow:wxWindow(), Message::unicode:chardata(), Caption::unicode:chardata(), Choices::[unicode:chardata()],
+ Option :: {style, integer()}
+ | {pos, {X::integer(), Y::integer()}}.
new(#wx_ref{type=ParentT,ref=ParentRef},Message,Caption,Choices, Options)
when is_list(Message),is_list(Caption),is_list(Choices),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -113,15 +119,17 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Message,Caption,Choices, Options)
wxe_util:construct(?wxMultiChoiceDialog_new_5,
<<ParentRef:32/?UI,(byte_size(Message_UC)):32/?UI,(Message_UC)/binary, 0:(((8- ((0+byte_size(Message_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Caption_UC)):32/?UI,(Caption_UC)/binary, 0:(((8- ((4+byte_size(Caption_UC)) band 16#7)) band 16#7))/unit:8,(length(Choices_UCA)):32/?UI, (<< <<(byte_size(UC_Str)):32/?UI, UC_Str/binary>>|| UC_Str <- Choices_UCA>>)/binary, 0:(((8- ((4 + lists:sum([byte_size(S)+4||S<-Choices_UCA])) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxMultiChoiceDialog()) -> [integer()]
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmultichoicedialog.html#wxmultichoicedialoggetselections">external documentation</a>.
+-spec getSelections(This) -> [integer()] when
+ This::wxMultiChoiceDialog().
getSelections(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxMultiChoiceDialog),
wxe_util:call(?wxMultiChoiceDialog_GetSelections,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxMultiChoiceDialog(), Selections::[integer()]) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmultichoicedialog.html#wxmultichoicedialogsetselections">external documentation</a>.
+-spec setSelections(This, Selections) -> ok when
+ This::wxMultiChoiceDialog(), Selections::[integer()].
setSelections(#wx_ref{type=ThisT,ref=ThisRef},Selections)
when is_list(Selections) ->
?CLASS(ThisT,wxMultiChoiceDialog),
@@ -129,8 +137,8 @@ setSelections(#wx_ref{type=ThisT,ref=ThisRef},Selections)
<<ThisRef:32/?UI,(length(Selections)):32/?UI,
(<< <<C:32/?I>> || C <- Selections>>)/binary, 0:(((0+length(Selections)) rem 2)*32)>>).
-%% @spec (This::wxMultiChoiceDialog()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxMultiChoiceDialog()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxMultiChoiceDialog),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxNavigationKeyEvent.erl b/lib/wx/src/gen/wxNavigationKeyEvent.erl
index 7cf7dff9aa..7559639fcd 100644
--- a/lib/wx/src/gen/wxNavigationKeyEvent.erl
+++ b/lib/wx/src/gen/wxNavigationKeyEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -38,64 +38,74 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxNavigationKeyEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxNavigationKeyEvent()) -> bool()
+-type wxNavigationKeyEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnavigationkeyevent.html#wxnavigationkeyeventgetdirection">external documentation</a>.
+-spec getDirection(This) -> boolean() when
+ This::wxNavigationKeyEvent().
getDirection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNavigationKeyEvent),
wxe_util:call(?wxNavigationKeyEvent_GetDirection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxNavigationKeyEvent(), BForward::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnavigationkeyevent.html#wxnavigationkeyeventsetdirection">external documentation</a>.
+-spec setDirection(This, BForward) -> ok when
+ This::wxNavigationKeyEvent(), BForward::boolean().
setDirection(#wx_ref{type=ThisT,ref=ThisRef},BForward)
when is_boolean(BForward) ->
?CLASS(ThisT,wxNavigationKeyEvent),
wxe_util:cast(?wxNavigationKeyEvent_SetDirection,
<<ThisRef:32/?UI,(wxe_util:from_bool(BForward)):32/?UI>>).
-%% @spec (This::wxNavigationKeyEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnavigationkeyevent.html#wxnavigationkeyeventiswindowchange">external documentation</a>.
+-spec isWindowChange(This) -> boolean() when
+ This::wxNavigationKeyEvent().
isWindowChange(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNavigationKeyEvent),
wxe_util:call(?wxNavigationKeyEvent_IsWindowChange,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxNavigationKeyEvent(), BIs::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnavigationkeyevent.html#wxnavigationkeyeventsetwindowchange">external documentation</a>.
+-spec setWindowChange(This, BIs) -> ok when
+ This::wxNavigationKeyEvent(), BIs::boolean().
setWindowChange(#wx_ref{type=ThisT,ref=ThisRef},BIs)
when is_boolean(BIs) ->
?CLASS(ThisT,wxNavigationKeyEvent),
wxe_util:cast(?wxNavigationKeyEvent_SetWindowChange,
<<ThisRef:32/?UI,(wxe_util:from_bool(BIs)):32/?UI>>).
-%% @spec (This::wxNavigationKeyEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnavigationkeyevent.html#wxnavigationkeyeventisfromtab">external documentation</a>.
+-spec isFromTab(This) -> boolean() when
+ This::wxNavigationKeyEvent().
isFromTab(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNavigationKeyEvent),
wxe_util:call(?wxNavigationKeyEvent_IsFromTab,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxNavigationKeyEvent(), BIs::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnavigationkeyevent.html#wxnavigationkeyeventsetfromtab">external documentation</a>.
+-spec setFromTab(This, BIs) -> ok when
+ This::wxNavigationKeyEvent(), BIs::boolean().
setFromTab(#wx_ref{type=ThisT,ref=ThisRef},BIs)
when is_boolean(BIs) ->
?CLASS(ThisT,wxNavigationKeyEvent),
wxe_util:cast(?wxNavigationKeyEvent_SetFromTab,
<<ThisRef:32/?UI,(wxe_util:from_bool(BIs)):32/?UI>>).
-%% @spec (This::wxNavigationKeyEvent()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnavigationkeyevent.html#wxnavigationkeyeventgetcurrentfocus">external documentation</a>.
+-spec getCurrentFocus(This) -> wxWindow:wxWindow() when
+ This::wxNavigationKeyEvent().
getCurrentFocus(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNavigationKeyEvent),
wxe_util:call(?wxNavigationKeyEvent_GetCurrentFocus,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxNavigationKeyEvent(), Win::wxWindow:wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnavigationkeyevent.html#wxnavigationkeyeventsetcurrentfocus">external documentation</a>.
+-spec setCurrentFocus(This, Win) -> ok when
+ This::wxNavigationKeyEvent(), Win::wxWindow:wxWindow().
setCurrentFocus(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WinT,ref=WinRef}) ->
?CLASS(ThisT,wxNavigationKeyEvent),
?CLASS(WinT,wxWindow),
diff --git a/lib/wx/src/gen/wxNcPaintEvent.erl b/lib/wx/src/gen/wxNcPaintEvent.erl
index b45420a2fc..4dd292a0be 100644
--- a/lib/wx/src/gen/wxNcPaintEvent.erl
+++ b/lib/wx/src/gen/wxNcPaintEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,10 +37,12 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxNcPaintEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxNcPaintEvent() :: wx:wx_object().
%% From wxEvent
%% @hidden
stopPropagation(This) -> wxEvent:stopPropagation(This).
diff --git a/lib/wx/src/gen/wxNotebook.erl b/lib/wx/src/gen/wxNotebook.erl
index b918de5bb4..04ab62b047 100644
--- a/lib/wx/src/gen/wxNotebook.erl
+++ b/lib/wx/src/gen/wxNotebook.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -74,27 +74,34 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxNotebook/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxNotebook()
+-type wxNotebook() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookwxnotebook">external documentation</a>.
+-spec new() -> wxNotebook().
new() ->
wxe_util:construct(?wxNotebook_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Winid::integer()) -> wxNotebook()
%% @equiv new(Parent,Winid, [])
+-spec new(Parent, Winid) -> wxNotebook() when
+ Parent::wxWindow:wxWindow(), Winid::integer().
+
new(Parent,Winid)
when is_record(Parent, wx_ref),is_integer(Winid) ->
new(Parent,Winid, []).
-%% @spec (Parent::wxWindow:wxWindow(), Winid::integer(), [Option]) -> wxNotebook()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookwxnotebook">external documentation</a>.
+-spec new(Parent, Winid, [Option]) -> wxNotebook() when
+ Parent::wxWindow:wxWindow(), Winid::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Winid, Options)
when is_integer(Winid),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -106,15 +113,19 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Winid, Options)
wxe_util:construct(?wxNotebook_new_3,
<<ParentRef:32/?UI,Winid:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxNotebook(), Page::wxWindow:wxWindow(), Text::string()) -> bool()
%% @equiv addPage(This,Page,Text, [])
+-spec addPage(This, Page, Text) -> boolean() when
+ This::wxNotebook(), Page::wxWindow:wxWindow(), Text::unicode:chardata().
+
addPage(This,Page,Text)
when is_record(This, wx_ref),is_record(Page, wx_ref),is_list(Text) ->
addPage(This,Page,Text, []).
-%% @spec (This::wxNotebook(), Page::wxWindow:wxWindow(), Text::string(), [Option]) -> bool()
-%% Option = {bSelect, bool()} | {imageId, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookaddpage">external documentation</a>.
+-spec addPage(This, Page, Text, [Option]) -> boolean() when
+ This::wxNotebook(), Page::wxWindow:wxWindow(), Text::unicode:chardata(),
+ Option :: {bSelect, boolean()}
+ | {imageId, integer()}.
addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Text, Options)
when is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxNotebook),
@@ -127,15 +138,18 @@ addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Text, Op
wxe_util:call(?wxNotebook_AddPage,
<<ThisRef:32/?UI,PageRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxNotebook()) -> ok
%% @equiv advanceSelection(This, [])
+-spec advanceSelection(This) -> ok when
+ This::wxNotebook().
+
advanceSelection(This)
when is_record(This, wx_ref) ->
advanceSelection(This, []).
-%% @spec (This::wxNotebook(), [Option]) -> ok
-%% Option = {forward, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookadvanceselection">external documentation</a>.
+-spec advanceSelection(This, [Option]) -> ok when
+ This::wxNotebook(),
+ Option :: {forward, boolean()}.
advanceSelection(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxNotebook),
@@ -145,23 +159,29 @@ advanceSelection(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxNotebook_AdvanceSelection,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxNotebook(), ImageList::wxImageList:wxImageList()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookassignimagelist">external documentation</a>.
+-spec assignImageList(This, ImageList) -> ok when
+ This::wxNotebook(), ImageList::wxImageList:wxImageList().
assignImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef}) ->
?CLASS(ThisT,wxNotebook),
?CLASS(ImageListT,wxImageList),
wxe_util:cast(?wxNotebook_AssignImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI>>).
-%% @spec (This::wxNotebook(), Parent::wxWindow:wxWindow(), Id::integer()) -> bool()
%% @equiv create(This,Parent,Id, [])
+-spec create(This, Parent, Id) -> boolean() when
+ This::wxNotebook(), Parent::wxWindow:wxWindow(), Id::integer().
+
create(This,Parent,Id)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id) ->
create(This,Parent,Id, []).
-%% @spec (This::wxNotebook(), Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookcreate">external documentation</a>.
+-spec create(This, Parent, Id, [Option]) -> boolean() when
+ This::wxNotebook(), Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ThisT,wxNotebook),
@@ -174,112 +194,130 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, O
wxe_util:call(?wxNotebook_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxNotebook()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookdeleteallpages">external documentation</a>.
+-spec deleteAllPages(This) -> boolean() when
+ This::wxNotebook().
deleteAllPages(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_DeleteAllPages,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxNotebook(), NPage::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookdeletepage">external documentation</a>.
+-spec deletePage(This, NPage) -> boolean() when
+ This::wxNotebook(), NPage::integer().
deletePage(#wx_ref{type=ThisT,ref=ThisRef},NPage)
when is_integer(NPage) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_DeletePage,
<<ThisRef:32/?UI,NPage:32/?UI>>).
-%% @spec (This::wxNotebook(), NPage::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookremovepage">external documentation</a>.
+-spec removePage(This, NPage) -> boolean() when
+ This::wxNotebook(), NPage::integer().
removePage(#wx_ref{type=ThisT,ref=ThisRef},NPage)
when is_integer(NPage) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_RemovePage,
<<ThisRef:32/?UI,NPage:32/?UI>>).
-%% @spec (This::wxNotebook()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookgetcurrentpage">external documentation</a>.
+-spec getCurrentPage(This) -> wxWindow:wxWindow() when
+ This::wxNotebook().
getCurrentPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_GetCurrentPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxNotebook()) -> wxImageList:wxImageList()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookgetimagelist">external documentation</a>.
+-spec getImageList(This) -> wxImageList:wxImageList() when
+ This::wxNotebook().
getImageList(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_GetImageList,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxNotebook(), N::integer()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookgetpage">external documentation</a>.
+-spec getPage(This, N) -> wxWindow:wxWindow() when
+ This::wxNotebook(), N::integer().
getPage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_GetPage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxNotebook()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookgetpagecount">external documentation</a>.
+-spec getPageCount(This) -> integer() when
+ This::wxNotebook().
getPageCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_GetPageCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxNotebook(), NPage::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookgetpageimage">external documentation</a>.
+-spec getPageImage(This, NPage) -> integer() when
+ This::wxNotebook(), NPage::integer().
getPageImage(#wx_ref{type=ThisT,ref=ThisRef},NPage)
when is_integer(NPage) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_GetPageImage,
<<ThisRef:32/?UI,NPage:32/?UI>>).
-%% @spec (This::wxNotebook(), NPage::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookgetpagetext">external documentation</a>.
+-spec getPageText(This, NPage) -> unicode:charlist() when
+ This::wxNotebook(), NPage::integer().
getPageText(#wx_ref{type=ThisT,ref=ThisRef},NPage)
when is_integer(NPage) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_GetPageText,
<<ThisRef:32/?UI,NPage:32/?UI>>).
-%% @spec (This::wxNotebook()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookgetrowcount">external documentation</a>.
+-spec getRowCount(This) -> integer() when
+ This::wxNotebook().
getRowCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_GetRowCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxNotebook()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookgetselection">external documentation</a>.
+-spec getSelection(This) -> integer() when
+ This::wxNotebook().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxNotebook()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookgetthemebackgroundcolour">external documentation</a>.
+-spec getThemeBackgroundColour(This) -> wx:wx_colour4() when
+ This::wxNotebook().
getThemeBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_GetThemeBackgroundColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxNotebook(), Pt::{X::integer(), Y::integer()}) -> {integer(), Flags::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookhittest">external documentation</a>.
+-spec hitTest(This, Pt) -> Result when
+ Result ::{Res ::integer(), Flags::integer()},
+ This::wxNotebook(), Pt::{X::integer(), Y::integer()}.
hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_HitTest,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxNotebook(), Position::integer(), Win::wxWindow:wxWindow(), StrText::string()) -> bool()
%% @equiv insertPage(This,Position,Win,StrText, [])
+-spec insertPage(This, Position, Win, StrText) -> boolean() when
+ This::wxNotebook(), Position::integer(), Win::wxWindow:wxWindow(), StrText::unicode:chardata().
+
insertPage(This,Position,Win,StrText)
when is_record(This, wx_ref),is_integer(Position),is_record(Win, wx_ref),is_list(StrText) ->
insertPage(This,Position,Win,StrText, []).
-%% @spec (This::wxNotebook(), Position::integer(), Win::wxWindow:wxWindow(), StrText::string(), [Option]) -> bool()
-%% Option = {bSelect, bool()} | {imageId, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookinsertpage">external documentation</a>.
+-spec insertPage(This, Position, Win, StrText, [Option]) -> boolean() when
+ This::wxNotebook(), Position::integer(), Win::wxWindow:wxWindow(), StrText::unicode:chardata(),
+ Option :: {bSelect, boolean()}
+ | {imageId, integer()}.
insertPage(#wx_ref{type=ThisT,ref=ThisRef},Position,#wx_ref{type=WinT,ref=WinRef},StrText, Options)
when is_integer(Position),is_list(StrText),is_list(Options) ->
?CLASS(ThisT,wxNotebook),
@@ -292,40 +330,45 @@ insertPage(#wx_ref{type=ThisT,ref=ThisRef},Position,#wx_ref{type=WinT,ref=WinRef
wxe_util:call(?wxNotebook_InsertPage,
<<ThisRef:32/?UI,Position:32/?UI,WinRef:32/?UI,(byte_size(StrText_UC)):32/?UI,(StrText_UC)/binary, 0:(((8- ((0+byte_size(StrText_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxNotebook(), ImageList::wxImageList:wxImageList()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebooksetimagelist">external documentation</a>.
+-spec setImageList(This, ImageList) -> ok when
+ This::wxNotebook(), ImageList::wxImageList:wxImageList().
setImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef}) ->
?CLASS(ThisT,wxNotebook),
?CLASS(ImageListT,wxImageList),
wxe_util:cast(?wxNotebook_SetImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI>>).
-%% @spec (This::wxNotebook(), Padding::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebooksetpadding">external documentation</a>.
+-spec setPadding(This, Padding) -> ok when
+ This::wxNotebook(), Padding::{W::integer(), H::integer()}.
setPadding(#wx_ref{type=ThisT,ref=ThisRef},{PaddingW,PaddingH})
when is_integer(PaddingW),is_integer(PaddingH) ->
?CLASS(ThisT,wxNotebook),
wxe_util:cast(?wxNotebook_SetPadding,
<<ThisRef:32/?UI,PaddingW:32/?UI,PaddingH:32/?UI>>).
-%% @spec (This::wxNotebook(), Size::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebooksetpagesize">external documentation</a>.
+-spec setPageSize(This, Size) -> ok when
+ This::wxNotebook(), Size::{W::integer(), H::integer()}.
setPageSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxNotebook),
wxe_util:cast(?wxNotebook_SetPageSize,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxNotebook(), NPage::integer(), NImage::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebooksetpageimage">external documentation</a>.
+-spec setPageImage(This, NPage, NImage) -> boolean() when
+ This::wxNotebook(), NPage::integer(), NImage::integer().
setPageImage(#wx_ref{type=ThisT,ref=ThisRef},NPage,NImage)
when is_integer(NPage),is_integer(NImage) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_SetPageImage,
<<ThisRef:32/?UI,NPage:32/?UI,NImage:32/?UI>>).
-%% @spec (This::wxNotebook(), NPage::integer(), StrText::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebooksetpagetext">external documentation</a>.
+-spec setPageText(This, NPage, StrText) -> boolean() when
+ This::wxNotebook(), NPage::integer(), StrText::unicode:chardata().
setPageText(#wx_ref{type=ThisT,ref=ThisRef},NPage,StrText)
when is_integer(NPage),is_list(StrText) ->
?CLASS(ThisT,wxNotebook),
@@ -333,24 +376,26 @@ setPageText(#wx_ref{type=ThisT,ref=ThisRef},NPage,StrText)
wxe_util:call(?wxNotebook_SetPageText,
<<ThisRef:32/?UI,NPage:32/?UI,(byte_size(StrText_UC)):32/?UI,(StrText_UC)/binary, 0:(((8- ((4+byte_size(StrText_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxNotebook(), NPage::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebooksetselection">external documentation</a>.
+-spec setSelection(This, NPage) -> integer() when
+ This::wxNotebook(), NPage::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},NPage)
when is_integer(NPage) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_SetSelection,
<<ThisRef:32/?UI,NPage:32/?UI>>).
-%% @spec (This::wxNotebook(), NPage::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebook.html#wxnotebookchangeselection">external documentation</a>.
+-spec changeSelection(This, NPage) -> integer() when
+ This::wxNotebook(), NPage::integer().
changeSelection(#wx_ref{type=ThisT,ref=ThisRef},NPage)
when is_integer(NPage) ->
?CLASS(ThisT,wxNotebook),
wxe_util:call(?wxNotebook_ChangeSelection,
<<ThisRef:32/?UI,NPage:32/?UI>>).
-%% @spec (This::wxNotebook()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxNotebook()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxNotebook),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxNotebookEvent.erl b/lib/wx/src/gen/wxNotebookEvent.erl
index 6be826bdd2..72c0bb9cf4 100644
--- a/lib/wx/src/gen/wxNotebookEvent.erl
+++ b/lib/wx/src/gen/wxNotebookEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -41,36 +41,42 @@
isSelection/1,parent_class/1,resumePropagation/2,setInt/2,setString/2,
shouldPropagate/1,skip/1,skip/2,stopPropagation/1,veto/1]).
+-export_type([wxNotebookEvent/0]).
%% @hidden
parent_class(wxNotifyEvent) -> true;
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxNotebookEvent()) -> integer()
+-type wxNotebookEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebookevent.html#wxnotebookeventgetoldselection">external documentation</a>.
+-spec getOldSelection(This) -> integer() when
+ This::wxNotebookEvent().
getOldSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNotebookEvent),
wxe_util:call(?wxNotebookEvent_GetOldSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxNotebookEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebookevent.html#wxnotebookeventgetselection">external documentation</a>.
+-spec getSelection(This) -> integer() when
+ This::wxNotebookEvent().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNotebookEvent),
wxe_util:call(?wxNotebookEvent_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxNotebookEvent(), NOldSel::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebookevent.html#wxnotebookeventsetoldselection">external documentation</a>.
+-spec setOldSelection(This, NOldSel) -> ok when
+ This::wxNotebookEvent(), NOldSel::integer().
setOldSelection(#wx_ref{type=ThisT,ref=ThisRef},NOldSel)
when is_integer(NOldSel) ->
?CLASS(ThisT,wxNotebookEvent),
wxe_util:cast(?wxNotebookEvent_SetOldSelection,
<<ThisRef:32/?UI,NOldSel:32/?UI>>).
-%% @spec (This::wxNotebookEvent(), NSel::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotebookevent.html#wxnotebookeventsetselection">external documentation</a>.
+-spec setSelection(This, NSel) -> ok when
+ This::wxNotebookEvent(), NSel::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},NSel)
when is_integer(NSel) ->
?CLASS(ThisT,wxNotebookEvent),
diff --git a/lib/wx/src/gen/wxNotifyEvent.erl b/lib/wx/src/gen/wxNotifyEvent.erl
index b2a6da16f0..7ba23469be 100644
--- a/lib/wx/src/gen/wxNotifyEvent.erl
+++ b/lib/wx/src/gen/wxNotifyEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -36,27 +36,32 @@
parent_class/1,resumePropagation/2,setInt/2,setString/2,shouldPropagate/1,
skip/1,skip/2,stopPropagation/1]).
+-export_type([wxNotifyEvent/0]).
%% @hidden
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxNotifyEvent()) -> ok
+-type wxNotifyEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotifyevent.html#wxnotifyeventallow">external documentation</a>.
+-spec allow(This) -> ok when
+ This::wxNotifyEvent().
allow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNotifyEvent),
wxe_util:cast(?wxNotifyEvent_Allow,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxNotifyEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotifyevent.html#wxnotifyeventisallowed">external documentation</a>.
+-spec isAllowed(This) -> boolean() when
+ This::wxNotifyEvent().
isAllowed(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNotifyEvent),
wxe_util:call(?wxNotifyEvent_IsAllowed,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxNotifyEvent()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxnotifyevent.html#wxnotifyeventveto">external documentation</a>.
+-spec veto(This) -> ok when
+ This::wxNotifyEvent().
veto(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxNotifyEvent),
wxe_util:cast(?wxNotifyEvent_Veto,
diff --git a/lib/wx/src/gen/wxPageSetupDialog.erl b/lib/wx/src/gen/wxPageSetupDialog.erl
index 2c11863a21..653ba5f015 100644
--- a/lib/wx/src/gen/wxPageSetupDialog.erl
+++ b/lib/wx/src/gen/wxPageSetupDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,18 +29,23 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxPageSetupDialog/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxPageSetupDialog()
+-type wxPageSetupDialog() :: wx:wx_object().
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxPageSetupDialog() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxPageSetupDialog()
-%% Option = {data, wxPageSetupDialogData:wxPageSetupDialogData()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialog.html#wxpagesetupdialogwxpagesetupdialog">external documentation</a>.
+-spec new(Parent, [Option]) -> wxPageSetupDialog() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {data, wxPageSetupDialogData:wxPageSetupDialogData()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -50,22 +55,24 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxPageSetupDialog_new,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxPageSetupDialog()) -> wxPageSetupDialogData:wxPageSetupDialogData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialog.html#wxpagesetupdialoggetpagesetupdata">external documentation</a>.
+-spec getPageSetupData(This) -> wxPageSetupDialogData:wxPageSetupDialogData() when
+ This::wxPageSetupDialog().
getPageSetupData(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialog),
wxe_util:call(?wxPageSetupDialog_GetPageSetupData,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialog()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialog.html#wxpagesetupdialogshowmodal">external documentation</a>.
+-spec showModal(This) -> integer() when
+ This::wxPageSetupDialog().
showModal(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialog),
wxe_util:call(?wxPageSetupDialog_ShowModal,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialog()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPageSetupDialog()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPageSetupDialog),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxPageSetupDialogData.erl b/lib/wx/src/gen/wxPageSetupDialogData.erl
index 00b4ca2a36..7c453a9872 100644
--- a/lib/wx/src/gen/wxPageSetupDialogData.erl
+++ b/lib/wx/src/gen/wxPageSetupDialogData.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -36,17 +36,20 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxPageSetupDialogData/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxPageSetupDialogData()
+-type wxPageSetupDialogData() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatawxpagesetupdialogdata">external documentation</a>.
+-spec new() -> wxPageSetupDialogData().
new() ->
wxe_util:construct(?wxPageSetupDialogData_new_0,
<<>>).
-%% @spec (PrintData::wxPrintData:wxPrintData() | wxPageSetupDialogData()) -> wxPageSetupDialogData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatawxpagesetupdialogdata">external documentation</a>.
+-spec new(PrintData) -> wxPageSetupDialogData() when
+ PrintData::wxPrintData:wxPrintData() | wxPageSetupDialogData().
new(#wx_ref{type=PrintDataT,ref=PrintDataRef}) ->
PrintDataOP = case ?CLASS_T(PrintDataT,wxPrintData) of
true ->
@@ -57,216 +60,243 @@ new(#wx_ref{type=PrintDataT,ref=PrintDataRef}) ->
wxe_util:construct(PrintDataOP,
<<PrintDataRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdataenablehelp">external documentation</a>.
+-spec enableHelp(This, Flag) -> ok when
+ This::wxPageSetupDialogData(), Flag::boolean().
enableHelp(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:cast(?wxPageSetupDialogData_EnableHelp,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxPageSetupDialogData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdataenablemargins">external documentation</a>.
+-spec enableMargins(This, Flag) -> ok when
+ This::wxPageSetupDialogData(), Flag::boolean().
enableMargins(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:cast(?wxPageSetupDialogData_EnableMargins,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxPageSetupDialogData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdataenableorientation">external documentation</a>.
+-spec enableOrientation(This, Flag) -> ok when
+ This::wxPageSetupDialogData(), Flag::boolean().
enableOrientation(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:cast(?wxPageSetupDialogData_EnableOrientation,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxPageSetupDialogData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdataenablepaper">external documentation</a>.
+-spec enablePaper(This, Flag) -> ok when
+ This::wxPageSetupDialogData(), Flag::boolean().
enablePaper(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:cast(?wxPageSetupDialogData_EnablePaper,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxPageSetupDialogData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdataenableprinter">external documentation</a>.
+-spec enablePrinter(This, Flag) -> ok when
+ This::wxPageSetupDialogData(), Flag::boolean().
enablePrinter(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:cast(?wxPageSetupDialogData_EnablePrinter,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatagetdefaultminmargins">external documentation</a>.
+-spec getDefaultMinMargins(This) -> boolean() when
+ This::wxPageSetupDialogData().
getDefaultMinMargins(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:call(?wxPageSetupDialogData_GetDefaultMinMargins,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatagetenablemargins">external documentation</a>.
+-spec getEnableMargins(This) -> boolean() when
+ This::wxPageSetupDialogData().
getEnableMargins(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:call(?wxPageSetupDialogData_GetEnableMargins,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatagetenableorientation">external documentation</a>.
+-spec getEnableOrientation(This) -> boolean() when
+ This::wxPageSetupDialogData().
getEnableOrientation(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:call(?wxPageSetupDialogData_GetEnableOrientation,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatagetenablepaper">external documentation</a>.
+-spec getEnablePaper(This) -> boolean() when
+ This::wxPageSetupDialogData().
getEnablePaper(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:call(?wxPageSetupDialogData_GetEnablePaper,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatagetenableprinter">external documentation</a>.
+-spec getEnablePrinter(This) -> boolean() when
+ This::wxPageSetupDialogData().
getEnablePrinter(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:call(?wxPageSetupDialogData_GetEnablePrinter,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatagetenablehelp">external documentation</a>.
+-spec getEnableHelp(This) -> boolean() when
+ This::wxPageSetupDialogData().
getEnableHelp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:call(?wxPageSetupDialogData_GetEnableHelp,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatagetdefaultinfo">external documentation</a>.
+-spec getDefaultInfo(This) -> boolean() when
+ This::wxPageSetupDialogData().
getDefaultInfo(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:call(?wxPageSetupDialogData_GetDefaultInfo,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatagetmargintopleft">external documentation</a>.
+-spec getMarginTopLeft(This) -> {X::integer(), Y::integer()} when
+ This::wxPageSetupDialogData().
getMarginTopLeft(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:call(?wxPageSetupDialogData_GetMarginTopLeft,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatagetmarginbottomright">external documentation</a>.
+-spec getMarginBottomRight(This) -> {X::integer(), Y::integer()} when
+ This::wxPageSetupDialogData().
getMarginBottomRight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:call(?wxPageSetupDialogData_GetMarginBottomRight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatagetminmargintopleft">external documentation</a>.
+-spec getMinMarginTopLeft(This) -> {X::integer(), Y::integer()} when
+ This::wxPageSetupDialogData().
getMinMarginTopLeft(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:call(?wxPageSetupDialogData_GetMinMarginTopLeft,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatagetminmarginbottomright">external documentation</a>.
+-spec getMinMarginBottomRight(This) -> {X::integer(), Y::integer()} when
+ This::wxPageSetupDialogData().
getMinMarginBottomRight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:call(?wxPageSetupDialogData_GetMinMarginBottomRight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatagetpaperid">external documentation</a>.
+-spec getPaperId(This) -> integer() when
+ This::wxPageSetupDialogData().
getPaperId(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:call(?wxPageSetupDialogData_GetPaperId,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatagetpapersize">external documentation</a>.
+-spec getPaperSize(This) -> {W::integer(), H::integer()} when
+ This::wxPageSetupDialogData().
getPaperSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:call(?wxPageSetupDialogData_GetPaperSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> wxPrintData:wxPrintData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatagetprintdata">external documentation</a>.
+-spec getPrintData(This) -> wxPrintData:wxPrintData() when
+ This::wxPageSetupDialogData().
getPrintData(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:call(?wxPageSetupDialogData_GetPrintData,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdataisok">external documentation</a>.
+-spec isOk(This) -> boolean() when
+ This::wxPageSetupDialogData().
isOk(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:call(?wxPageSetupDialogData_IsOk,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatasetdefaultinfo">external documentation</a>.
+-spec setDefaultInfo(This, Flag) -> ok when
+ This::wxPageSetupDialogData(), Flag::boolean().
setDefaultInfo(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:cast(?wxPageSetupDialogData_SetDefaultInfo,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxPageSetupDialogData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatasetdefaultminmargins">external documentation</a>.
+-spec setDefaultMinMargins(This, Flag) -> ok when
+ This::wxPageSetupDialogData(), Flag::boolean().
setDefaultMinMargins(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:cast(?wxPageSetupDialogData_SetDefaultMinMargins,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxPageSetupDialogData(), Pt::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatasetmargintopleft">external documentation</a>.
+-spec setMarginTopLeft(This, Pt) -> ok when
+ This::wxPageSetupDialogData(), Pt::{X::integer(), Y::integer()}.
setMarginTopLeft(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:cast(?wxPageSetupDialogData_SetMarginTopLeft,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData(), Pt::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatasetmarginbottomright">external documentation</a>.
+-spec setMarginBottomRight(This, Pt) -> ok when
+ This::wxPageSetupDialogData(), Pt::{X::integer(), Y::integer()}.
setMarginBottomRight(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:cast(?wxPageSetupDialogData_SetMarginBottomRight,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData(), Pt::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatasetminmargintopleft">external documentation</a>.
+-spec setMinMarginTopLeft(This, Pt) -> ok when
+ This::wxPageSetupDialogData(), Pt::{X::integer(), Y::integer()}.
setMinMarginTopLeft(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:cast(?wxPageSetupDialogData_SetMinMarginTopLeft,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData(), Pt::{X::integer(), Y::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatasetminmarginbottomright">external documentation</a>.
+-spec setMinMarginBottomRight(This, Pt) -> ok when
+ This::wxPageSetupDialogData(), Pt::{X::integer(), Y::integer()}.
setMinMarginBottomRight(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:cast(?wxPageSetupDialogData_SetMinMarginBottomRight,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData(), Id::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatasetpaperid">external documentation</a>.
+-spec setPaperId(This, Id) -> ok when
+ This::wxPageSetupDialogData(), Id::integer().
setPaperId(#wx_ref{type=ThisT,ref=ThisRef},Id)
when is_integer(Id) ->
?CLASS(ThisT,wxPageSetupDialogData),
wxe_util:cast(?wxPageSetupDialogData_SetPaperId,
<<ThisRef:32/?UI,Id:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData(),X::integer()|term()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatasetpapersize">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setPaperSize(This::wxPageSetupDialogData(), Id::integer()) -> ok </c>
-%% </p>
-%% <p><c>
-%% setPaperSize(This::wxPageSetupDialogData(), Sz::{W::integer(), H::integer()}) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% setPaperSize(This, Sz) -> ok when<br />
+%% This::wxPageSetupDialogData(), Sz::{W::integer(), H::integer()}.<br />
+%%
+-spec setPaperSize(This, Id) -> ok when
+ This::wxPageSetupDialogData(), Id::integer();
+ (This, Sz) -> ok when
+ This::wxPageSetupDialogData(), Sz::{W::integer(), H::integer()}.
setPaperSize(#wx_ref{type=ThisT,ref=ThisRef},Id)
when is_integer(Id) ->
?CLASS(ThisT,wxPageSetupDialogData),
@@ -278,16 +308,17 @@ setPaperSize(#wx_ref{type=ThisT,ref=ThisRef},{SzW,SzH})
wxe_util:cast(?wxPageSetupDialogData_SetPaperSize_1_1,
<<ThisRef:32/?UI,SzW:32/?UI,SzH:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData(), PrintData::wxPrintData:wxPrintData()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpagesetupdialogdata.html#wxpagesetupdialogdatasetprintdata">external documentation</a>.
+-spec setPrintData(This, PrintData) -> ok when
+ This::wxPageSetupDialogData(), PrintData::wxPrintData:wxPrintData().
setPrintData(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PrintDataT,ref=PrintDataRef}) ->
?CLASS(ThisT,wxPageSetupDialogData),
?CLASS(PrintDataT,wxPrintData),
wxe_util:cast(?wxPageSetupDialogData_SetPrintData,
<<ThisRef:32/?UI,PrintDataRef:32/?UI>>).
-%% @spec (This::wxPageSetupDialogData()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPageSetupDialogData()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPageSetupDialogData),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxPaintDC.erl b/lib/wx/src/gen/wxPaintDC.erl
index 47d5947097..9e81bc31af 100644
--- a/lib/wx/src/gen/wxPaintDC.erl
+++ b/lib/wx/src/gen/wxPaintDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -39,10 +39,10 @@
drawPoint/2,drawPolygon/2,drawPolygon/3,drawRectangle/2,drawRectangle/3,
drawRotatedText/4,drawRoundedRectangle/3,drawRoundedRectangle/4,
drawText/3,endDoc/1,endPage/1,floodFill/3,floodFill/4,getBackground/1,
- getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/2,
+ getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/1,
getFont/1,getLayoutDirection/1,getLogicalFunction/1,getMapMode/1,
- getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/3,
- getPen/1,getPixel/3,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
+ getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/2,
+ getPen/1,getPixel/2,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
getTextExtent/3,getTextForeground/1,getUserScale/1,gradientFillConcentric/4,
gradientFillConcentric/5,gradientFillLinear/4,gradientFillLinear/5,
isOk/1,logicalToDeviceX/2,logicalToDeviceXRel/2,logicalToDeviceY/2,
@@ -53,26 +53,29 @@
setPen/2,setTextBackground/2,setTextForeground/2,setUserScale/3,startDoc/2,
startPage/1]).
+-export_type([wxPaintDC/0]).
%% @hidden
parent_class(wxWindowDC) -> true;
parent_class(wxDC) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxPaintDC()
+-type wxPaintDC() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpaintdc.html#wxpaintdcwxpaintdc">external documentation</a>.
+-spec new() -> wxPaintDC().
new() ->
wxe_util:construct(?wxPaintDC_new_0,
<<>>).
-%% @spec (Win::wxWindow:wxWindow()) -> wxPaintDC()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpaintdc.html#wxpaintdcwxpaintdc">external documentation</a>.
+-spec new(Win) -> wxPaintDC() when
+ Win::wxWindow:wxWindow().
new(#wx_ref{type=WinT,ref=WinRef}) ->
?CLASS(WinT,wxWindow),
wxe_util:construct(?wxPaintDC_new_1,
<<WinRef:32/?UI>>).
-%% @spec (This::wxPaintDC()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPaintDC()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPaintDC),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
@@ -160,11 +163,11 @@ getSize(This) -> wxDC:getSize(This).
%% @hidden
getPPI(This) -> wxDC:getPPI(This).
%% @hidden
-getPixel(This,Pt,Col) -> wxDC:getPixel(This,Pt,Col).
+getPixel(This,Pt) -> wxDC:getPixel(This,Pt).
%% @hidden
getPen(This) -> wxDC:getPen(This).
%% @hidden
-getPartialTextExtents(This,Text,Widths) -> wxDC:getPartialTextExtents(This,Text,Widths).
+getPartialTextExtents(This,Text) -> wxDC:getPartialTextExtents(This,Text).
%% @hidden
getMultiLineTextExtent(This,String, Options) -> wxDC:getMultiLineTextExtent(This,String, Options).
%% @hidden
@@ -178,7 +181,7 @@ getLayoutDirection(This) -> wxDC:getLayoutDirection(This).
%% @hidden
getFont(This) -> wxDC:getFont(This).
%% @hidden
-getClippingBox(This,Rect) -> wxDC:getClippingBox(This,Rect).
+getClippingBox(This) -> wxDC:getClippingBox(This).
%% @hidden
getCharWidth(This) -> wxDC:getCharWidth(This).
%% @hidden
diff --git a/lib/wx/src/gen/wxPaintEvent.erl b/lib/wx/src/gen/wxPaintEvent.erl
index 2603e61623..a13db607a4 100644
--- a/lib/wx/src/gen/wxPaintEvent.erl
+++ b/lib/wx/src/gen/wxPaintEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,10 +37,12 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxPaintEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxPaintEvent() :: wx:wx_object().
%% From wxEvent
%% @hidden
stopPropagation(This) -> wxEvent:stopPropagation(This).
diff --git a/lib/wx/src/gen/wxPalette.erl b/lib/wx/src/gen/wxPalette.erl
index 3d8e811988..991f706acb 100644
--- a/lib/wx/src/gen/wxPalette.erl
+++ b/lib/wx/src/gen/wxPalette.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -30,17 +30,20 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxPalette/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxPalette()
+-type wxPalette() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpalette.html#wxpalettewxpalette">external documentation</a>.
+-spec new() -> wxPalette().
new() ->
wxe_util:construct(?wxPalette_new_0,
<<>>).
-%% @spec (Red::binary(), Green::binary(), Blue::binary()) -> wxPalette()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpalette.html#wxpalettewxpalette">external documentation</a>.
+-spec new(Red, Green, Blue) -> wxPalette() when
+ Red::binary(), Green::binary(), Blue::binary().
new(Red,Green,Blue)
when is_binary(Red),is_binary(Green),is_binary(Blue) ->
wxe_util:send_bin(Red),
@@ -49,8 +52,9 @@ new(Red,Green,Blue)
wxe_util:construct(?wxPalette_new_4,
<<>>).
-%% @spec (This::wxPalette(), Red::binary(), Green::binary(), Blue::binary()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpalette.html#wxpalettecreate">external documentation</a>.
+-spec create(This, Red, Green, Blue) -> boolean() when
+ This::wxPalette(), Red::binary(), Green::binary(), Blue::binary().
create(#wx_ref{type=ThisT,ref=ThisRef},Red,Green,Blue)
when is_binary(Red),is_binary(Green),is_binary(Blue) ->
?CLASS(ThisT,wxPalette),
@@ -60,38 +64,43 @@ create(#wx_ref{type=ThisT,ref=ThisRef},Red,Green,Blue)
wxe_util:call(?wxPalette_Create,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPalette()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpalette.html#wxpalettegetcolourscount">external documentation</a>.
+-spec getColoursCount(This) -> integer() when
+ This::wxPalette().
getColoursCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPalette),
wxe_util:call(?wxPalette_GetColoursCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPalette(), Red::integer(), Green::integer(), Blue::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpalette.html#wxpalettegetpixel">external documentation</a>.
+-spec getPixel(This, Red, Green, Blue) -> integer() when
+ This::wxPalette(), Red::integer(), Green::integer(), Blue::integer().
getPixel(#wx_ref{type=ThisT,ref=ThisRef},Red,Green,Blue)
when is_integer(Red),is_integer(Green),is_integer(Blue) ->
?CLASS(ThisT,wxPalette),
wxe_util:call(?wxPalette_GetPixel,
<<ThisRef:32/?UI,Red:32/?UI,Green:32/?UI,Blue:32/?UI>>).
-%% @spec (This::wxPalette(), Pixel::integer()) -> {bool(), Red::integer(), Green::integer(), Blue::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpalette.html#wxpalettegetrgb">external documentation</a>.
+-spec getRGB(This, Pixel) -> Result when
+ Result ::{Res ::boolean(), Red::integer(), Green::integer(), Blue::integer()},
+ This::wxPalette(), Pixel::integer().
getRGB(#wx_ref{type=ThisT,ref=ThisRef},Pixel)
when is_integer(Pixel) ->
?CLASS(ThisT,wxPalette),
wxe_util:call(?wxPalette_GetRGB,
<<ThisRef:32/?UI,Pixel:32/?UI>>).
-%% @spec (This::wxPalette()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpalette.html#wxpaletteisok">external documentation</a>.
+-spec isOk(This) -> boolean() when
+ This::wxPalette().
isOk(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPalette),
wxe_util:call(?wxPalette_IsOk,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPalette()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPalette()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPalette),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxPaletteChangedEvent.erl b/lib/wx/src/gen/wxPaletteChangedEvent.erl
index 1831bf1375..aa9ae68ec2 100644
--- a/lib/wx/src/gen/wxPaletteChangedEvent.erl
+++ b/lib/wx/src/gen/wxPaletteChangedEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,20 +37,24 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxPaletteChangedEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxPaletteChangedEvent(), Win::wxWindow:wxWindow()) -> ok
+-type wxPaletteChangedEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpalettechangedevent.html#wxpalettechangedeventsetchangedwindow">external documentation</a>.
+-spec setChangedWindow(This, Win) -> ok when
+ This::wxPaletteChangedEvent(), Win::wxWindow:wxWindow().
setChangedWindow(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WinT,ref=WinRef}) ->
?CLASS(ThisT,wxPaletteChangedEvent),
?CLASS(WinT,wxWindow),
wxe_util:cast(?wxPaletteChangedEvent_SetChangedWindow,
<<ThisRef:32/?UI,WinRef:32/?UI>>).
-%% @spec (This::wxPaletteChangedEvent()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpalettechangedevent.html#wxpalettechangedeventgetchangedwindow">external documentation</a>.
+-spec getChangedWindow(This) -> wxWindow:wxWindow() when
+ This::wxPaletteChangedEvent().
getChangedWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPaletteChangedEvent),
wxe_util:call(?wxPaletteChangedEvent_GetChangedWindow,
diff --git a/lib/wx/src/gen/wxPanel.erl b/lib/wx/src/gen/wxPanel.erl
index 59fba03102..88c1b119a8 100644
--- a/lib/wx/src/gen/wxPanel.erl
+++ b/lib/wx/src/gen/wxPanel.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -68,26 +68,34 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxPanel/0]).
%% @hidden
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxPanel()
+-type wxPanel() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpanel.html#wxpanelwxpanel">external documentation</a>.
+-spec new() -> wxPanel().
new() ->
wxe_util:construct(?wxPanel_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxPanel()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxPanel() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxPanel()
-%% Option = {winid, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpanel.html#wxpanelwxpanel">external documentation</a>.
+-spec new(Parent, [Option]) -> wxPanel() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {winid, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -100,15 +108,18 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxPanel_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (Parent::wxWindow:wxWindow(), X::integer(), Y::integer(), Width::integer(), Height::integer()) -> wxPanel()
%% @equiv new(Parent,X,Y,Width,Height, [])
+-spec new(Parent, X, Y, Width, Height) -> wxPanel() when
+ Parent::wxWindow:wxWindow(), X::integer(), Y::integer(), Width::integer(), Height::integer().
+
new(Parent,X,Y,Width,Height)
when is_record(Parent, wx_ref),is_integer(X),is_integer(Y),is_integer(Width),is_integer(Height) ->
new(Parent,X,Y,Width,Height, []).
-%% @spec (Parent::wxWindow:wxWindow(), X::integer(), Y::integer(), Width::integer(), Height::integer(), [Option]) -> wxPanel()
-%% Option = {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpanel.html#wxpanelwxpanel">external documentation</a>.
+-spec new(Parent, X, Y, Width, Height, [Option]) -> wxPanel() when
+ Parent::wxWindow:wxWindow(), X::integer(), Y::integer(), Width::integer(), Height::integer(),
+ Option :: {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},X,Y,Width,Height, Options)
when is_integer(X),is_integer(Y),is_integer(Width),is_integer(Height),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -118,15 +129,16 @@ new(#wx_ref{type=ParentT,ref=ParentRef},X,Y,Width,Height, Options)
wxe_util:construct(?wxPanel_new_6,
<<ParentRef:32/?UI,X:32/?UI,Y:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxPanel()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpanel.html#wxpanelinitdialog">external documentation</a>.
+-spec initDialog(This) -> ok when
+ This::wxPanel().
initDialog(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPanel),
wxe_util:cast(?wxPanel_InitDialog,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPanel()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPanel()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPanel),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxPasswordEntryDialog.erl b/lib/wx/src/gen/wxPasswordEntryDialog.erl
index 07a0bcef56..d5a9f6150a 100644
--- a/lib/wx/src/gen/wxPasswordEntryDialog.erl
+++ b/lib/wx/src/gen/wxPasswordEntryDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -79,6 +79,7 @@
transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxPasswordEntryDialog/0]).
%% @hidden
parent_class(wxTextEntryDialog) -> true;
parent_class(wxDialog) -> true;
@@ -87,15 +88,22 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Parent::wxWindow:wxWindow(), Message::string()) -> wxPasswordEntryDialog()
+-type wxPasswordEntryDialog() :: wx:wx_object().
%% @equiv new(Parent,Message, [])
+-spec new(Parent, Message) -> wxPasswordEntryDialog() when
+ Parent::wxWindow:wxWindow(), Message::unicode:chardata().
+
new(Parent,Message)
when is_record(Parent, wx_ref),is_list(Message) ->
new(Parent,Message, []).
-%% @spec (Parent::wxWindow:wxWindow(), Message::string(), [Option]) -> wxPasswordEntryDialog()
-%% Option = {caption, string()} | {value, string()} | {style, integer()} | {pos, {X::integer(), Y::integer()}}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpasswordentrydialog.html#wxpasswordentrydialogwxpasswordentrydialog">external documentation</a>.
+-spec new(Parent, Message, [Option]) -> wxPasswordEntryDialog() when
+ Parent::wxWindow:wxWindow(), Message::unicode:chardata(),
+ Option :: {caption, unicode:chardata()}
+ | {value, unicode:chardata()}
+ | {style, integer()}
+ | {pos, {X::integer(), Y::integer()}}.
new(#wx_ref{type=ParentT,ref=ParentRef},Message, Options)
when is_list(Message),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -109,8 +117,8 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Message, Options)
wxe_util:construct(?wxPasswordEntryDialog_new,
<<ParentRef:32/?UI,(byte_size(Message_UC)):32/?UI,(Message_UC)/binary, 0:(((8- ((0+byte_size(Message_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxPasswordEntryDialog()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPasswordEntryDialog()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPasswordEntryDialog),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxPen.erl b/lib/wx/src/gen/wxPen.erl
index ada95b0ee3..8b8aafddba 100644
--- a/lib/wx/src/gen/wxPen.erl
+++ b/lib/wx/src/gen/wxPen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -31,24 +31,30 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxPen/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxPen()
+-type wxPen() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpen.html#wxpenwxpen">external documentation</a>.
+-spec new() -> wxPen().
new() ->
wxe_util:construct(?wxPen_new_0,
<<>>).
-%% @spec (Colour::wx:colour()) -> wxPen()
%% @equiv new(Colour, [])
+-spec new(Colour) -> wxPen() when
+ Colour::wx:wx_colour().
+
new(Colour)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
new(Colour, []).
-%% @spec (Colour::wx:colour(), [Option]) -> wxPen()
-%% Option = {width, integer()} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpen.html#wxpenwxpen">external documentation</a>.
+-spec new(Colour, [Option]) -> wxPen() when
+ Colour::wx:wx_colour(),
+ Option :: {width, integer()}
+ | {style, integer()}.
new(Colour, Options)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4,is_list(Options) ->
MOpts = fun({width, Width}, Acc) -> [<<1:32/?UI,Width:32/?UI>>|Acc];
@@ -58,98 +64,110 @@ new(Colour, Options)
wxe_util:construct(?wxPen_new_2,
<<(wxe_util:colour_bin(Colour)):16/binary, BinOpt/binary>>).
-%% @spec (This::wxPen()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpen.html#wxpengetcap">external documentation</a>.
+-spec getCap(This) -> integer() when
+ This::wxPen().
getCap(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPen),
wxe_util:call(?wxPen_GetCap,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPen()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpen.html#wxpengetcolour">external documentation</a>.
+-spec getColour(This) -> wx:wx_colour4() when
+ This::wxPen().
getColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPen),
wxe_util:call(?wxPen_GetColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPen()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpen.html#wxpengetjoin">external documentation</a>.
+-spec getJoin(This) -> integer() when
+ This::wxPen().
getJoin(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPen),
wxe_util:call(?wxPen_GetJoin,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPen()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpen.html#wxpengetstyle">external documentation</a>.
+-spec getStyle(This) -> integer() when
+ This::wxPen().
getStyle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPen),
wxe_util:call(?wxPen_GetStyle,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPen()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpen.html#wxpengetwidth">external documentation</a>.
+-spec getWidth(This) -> integer() when
+ This::wxPen().
getWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPen),
wxe_util:call(?wxPen_GetWidth,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPen()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpen.html#wxpenisok">external documentation</a>.
+-spec isOk(This) -> boolean() when
+ This::wxPen().
isOk(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPen),
wxe_util:call(?wxPen_IsOk,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPen(), CapStyle::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpen.html#wxpensetcap">external documentation</a>.
+-spec setCap(This, CapStyle) -> ok when
+ This::wxPen(), CapStyle::integer().
setCap(#wx_ref{type=ThisT,ref=ThisRef},CapStyle)
when is_integer(CapStyle) ->
?CLASS(ThisT,wxPen),
wxe_util:cast(?wxPen_SetCap,
<<ThisRef:32/?UI,CapStyle:32/?UI>>).
-%% @spec (This::wxPen(), Colour::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpen.html#wxpensetcolour">external documentation</a>.
+-spec setColour(This, Colour) -> ok when
+ This::wxPen(), Colour::wx:wx_colour().
setColour(#wx_ref{type=ThisT,ref=ThisRef},Colour)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxPen),
wxe_util:cast(?wxPen_SetColour_1,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
-%% @spec (This::wxPen(), Red::integer(), Green::integer(), Blue::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpen.html#wxpensetcolour">external documentation</a>.
+-spec setColour(This, Red, Green, Blue) -> ok when
+ This::wxPen(), Red::integer(), Green::integer(), Blue::integer().
setColour(#wx_ref{type=ThisT,ref=ThisRef},Red,Green,Blue)
when is_integer(Red),is_integer(Green),is_integer(Blue) ->
?CLASS(ThisT,wxPen),
wxe_util:cast(?wxPen_SetColour_3,
<<ThisRef:32/?UI,Red:32/?UI,Green:32/?UI,Blue:32/?UI>>).
-%% @spec (This::wxPen(), JoinStyle::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpen.html#wxpensetjoin">external documentation</a>.
+-spec setJoin(This, JoinStyle) -> ok when
+ This::wxPen(), JoinStyle::integer().
setJoin(#wx_ref{type=ThisT,ref=ThisRef},JoinStyle)
when is_integer(JoinStyle) ->
?CLASS(ThisT,wxPen),
wxe_util:cast(?wxPen_SetJoin,
<<ThisRef:32/?UI,JoinStyle:32/?UI>>).
-%% @spec (This::wxPen(), Style::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpen.html#wxpensetstyle">external documentation</a>.
+-spec setStyle(This, Style) -> ok when
+ This::wxPen(), Style::integer().
setStyle(#wx_ref{type=ThisT,ref=ThisRef},Style)
when is_integer(Style) ->
?CLASS(ThisT,wxPen),
wxe_util:cast(?wxPen_SetStyle,
<<ThisRef:32/?UI,Style:32/?UI>>).
-%% @spec (This::wxPen(), Width::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpen.html#wxpensetwidth">external documentation</a>.
+-spec setWidth(This, Width) -> ok when
+ This::wxPen(), Width::integer().
setWidth(#wx_ref{type=ThisT,ref=ThisRef},Width)
when is_integer(Width) ->
?CLASS(ThisT,wxPen),
wxe_util:cast(?wxPen_SetWidth,
<<ThisRef:32/?UI,Width:32/?UI>>).
-%% @spec (This::wxPen()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPen()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPen),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxPickerBase.erl b/lib/wx/src/gen/wxPickerBase.erl
index e60ab4f9d8..2253127d84 100644
--- a/lib/wx/src/gen/wxPickerBase.erl
+++ b/lib/wx/src/gen/wxPickerBase.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -72,87 +72,101 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxPickerBase/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxPickerBase(), Newmargin::integer()) -> ok
+-type wxPickerBase() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpickerbase.html#wxpickerbasesetinternalmargin">external documentation</a>.
+-spec setInternalMargin(This, Newmargin) -> ok when
+ This::wxPickerBase(), Newmargin::integer().
setInternalMargin(#wx_ref{type=ThisT,ref=ThisRef},Newmargin)
when is_integer(Newmargin) ->
?CLASS(ThisT,wxPickerBase),
wxe_util:cast(?wxPickerBase_SetInternalMargin,
<<ThisRef:32/?UI,Newmargin:32/?UI>>).
-%% @spec (This::wxPickerBase()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpickerbase.html#wxpickerbasegetinternalmargin">external documentation</a>.
+-spec getInternalMargin(This) -> integer() when
+ This::wxPickerBase().
getInternalMargin(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPickerBase),
wxe_util:call(?wxPickerBase_GetInternalMargin,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPickerBase(), Prop::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpickerbase.html#wxpickerbasesettextctrlproportion">external documentation</a>.
+-spec setTextCtrlProportion(This, Prop) -> ok when
+ This::wxPickerBase(), Prop::integer().
setTextCtrlProportion(#wx_ref{type=ThisT,ref=ThisRef},Prop)
when is_integer(Prop) ->
?CLASS(ThisT,wxPickerBase),
wxe_util:cast(?wxPickerBase_SetTextCtrlProportion,
<<ThisRef:32/?UI,Prop:32/?UI>>).
-%% @spec (This::wxPickerBase(), Prop::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpickerbase.html#wxpickerbasesetpickerctrlproportion">external documentation</a>.
+-spec setPickerCtrlProportion(This, Prop) -> ok when
+ This::wxPickerBase(), Prop::integer().
setPickerCtrlProportion(#wx_ref{type=ThisT,ref=ThisRef},Prop)
when is_integer(Prop) ->
?CLASS(ThisT,wxPickerBase),
wxe_util:cast(?wxPickerBase_SetPickerCtrlProportion,
<<ThisRef:32/?UI,Prop:32/?UI>>).
-%% @spec (This::wxPickerBase()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpickerbase.html#wxpickerbasegettextctrlproportion">external documentation</a>.
+-spec getTextCtrlProportion(This) -> integer() when
+ This::wxPickerBase().
getTextCtrlProportion(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPickerBase),
wxe_util:call(?wxPickerBase_GetTextCtrlProportion,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPickerBase()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpickerbase.html#wxpickerbasegetpickerctrlproportion">external documentation</a>.
+-spec getPickerCtrlProportion(This) -> integer() when
+ This::wxPickerBase().
getPickerCtrlProportion(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPickerBase),
wxe_util:call(?wxPickerBase_GetPickerCtrlProportion,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPickerBase()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpickerbase.html#wxpickerbasehastextctrl">external documentation</a>.
+-spec hasTextCtrl(This) -> boolean() when
+ This::wxPickerBase().
hasTextCtrl(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPickerBase),
wxe_util:call(?wxPickerBase_HasTextCtrl,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPickerBase()) -> wxTextCtrl:wxTextCtrl()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpickerbase.html#wxpickerbasegettextctrl">external documentation</a>.
+-spec getTextCtrl(This) -> wxTextCtrl:wxTextCtrl() when
+ This::wxPickerBase().
getTextCtrl(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPickerBase),
wxe_util:call(?wxPickerBase_GetTextCtrl,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPickerBase()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpickerbase.html#wxpickerbaseistextctrlgrowable">external documentation</a>.
+-spec isTextCtrlGrowable(This) -> boolean() when
+ This::wxPickerBase().
isTextCtrlGrowable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPickerBase),
wxe_util:call(?wxPickerBase_IsTextCtrlGrowable,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPickerBase()) -> ok
%% @equiv setPickerCtrlGrowable(This, [])
+-spec setPickerCtrlGrowable(This) -> ok when
+ This::wxPickerBase().
+
setPickerCtrlGrowable(This)
when is_record(This, wx_ref) ->
setPickerCtrlGrowable(This, []).
-%% @spec (This::wxPickerBase(), [Option]) -> ok
-%% Option = {grow, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpickerbase.html#wxpickerbasesetpickerctrlgrowable">external documentation</a>.
+-spec setPickerCtrlGrowable(This, [Option]) -> ok when
+ This::wxPickerBase(),
+ Option :: {grow, boolean()}.
setPickerCtrlGrowable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxPickerBase),
@@ -162,15 +176,18 @@ setPickerCtrlGrowable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxPickerBase_SetPickerCtrlGrowable,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxPickerBase()) -> ok
%% @equiv setTextCtrlGrowable(This, [])
+-spec setTextCtrlGrowable(This) -> ok when
+ This::wxPickerBase().
+
setTextCtrlGrowable(This)
when is_record(This, wx_ref) ->
setTextCtrlGrowable(This, []).
-%% @spec (This::wxPickerBase(), [Option]) -> ok
-%% Option = {grow, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpickerbase.html#wxpickerbasesettextctrlgrowable">external documentation</a>.
+-spec setTextCtrlGrowable(This, [Option]) -> ok when
+ This::wxPickerBase(),
+ Option :: {grow, boolean()}.
setTextCtrlGrowable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxPickerBase),
@@ -180,8 +197,9 @@ setTextCtrlGrowable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxPickerBase_SetTextCtrlGrowable,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxPickerBase()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpickerbase.html#wxpickerbaseispickerctrlgrowable">external documentation</a>.
+-spec isPickerCtrlGrowable(This) -> boolean() when
+ This::wxPickerBase().
isPickerCtrlGrowable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPickerBase),
wxe_util:call(?wxPickerBase_IsPickerCtrlGrowable,
diff --git a/lib/wx/src/gen/wxPostScriptDC.erl b/lib/wx/src/gen/wxPostScriptDC.erl
index df3edfade9..2eb25b6a8e 100644
--- a/lib/wx/src/gen/wxPostScriptDC.erl
+++ b/lib/wx/src/gen/wxPostScriptDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -38,10 +38,10 @@
drawPoint/2,drawPolygon/2,drawPolygon/3,drawRectangle/2,drawRectangle/3,
drawRotatedText/4,drawRoundedRectangle/3,drawRoundedRectangle/4,
drawText/3,endDoc/1,endPage/1,floodFill/3,floodFill/4,getBackground/1,
- getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/2,
+ getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/1,
getFont/1,getLayoutDirection/1,getLogicalFunction/1,getMapMode/1,
- getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/3,
- getPen/1,getPixel/3,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
+ getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/2,
+ getPen/1,getPixel/2,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
getTextExtent/3,getTextForeground/1,getUserScale/1,gradientFillConcentric/4,
gradientFillConcentric/5,gradientFillLinear/4,gradientFillLinear/5,
isOk/1,logicalToDeviceX/2,logicalToDeviceXRel/2,logicalToDeviceY/2,
@@ -52,38 +52,42 @@
setPen/2,setTextBackground/2,setTextForeground/2,setUserScale/3,startDoc/2,
startPage/1]).
+-export_type([wxPostScriptDC/0]).
%% @hidden
parent_class(wxDC) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxPostScriptDC()
+-type wxPostScriptDC() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpostscriptdc.html#wxpostscriptdcwxpostscriptdc">external documentation</a>.
+-spec new() -> wxPostScriptDC().
new() ->
wxe_util:construct(?wxPostScriptDC_new_0,
<<>>).
-%% @spec (PrintData::wxPrintData:wxPrintData()) -> wxPostScriptDC()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpostscriptdc.html#wxpostscriptdcwxpostscriptdc">external documentation</a>.
+-spec new(PrintData) -> wxPostScriptDC() when
+ PrintData::wxPrintData:wxPrintData().
new(#wx_ref{type=PrintDataT,ref=PrintDataRef}) ->
?CLASS(PrintDataT,wxPrintData),
wxe_util:construct(?wxPostScriptDC_new_1,
<<PrintDataRef:32/?UI>>).
-%% @spec (Ppi::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpostscriptdc.html#wxpostscriptdcsetresolution">external documentation</a>.
+-spec setResolution(Ppi) -> ok when
+ Ppi::integer().
setResolution(Ppi)
when is_integer(Ppi) ->
wxe_util:cast(?wxPostScriptDC_SetResolution,
<<Ppi:32/?UI>>).
-%% @spec () -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpostscriptdc.html#wxpostscriptdcgetresolution">external documentation</a>.
+-spec getResolution() -> integer().
getResolution() ->
wxe_util:call(?wxPostScriptDC_GetResolution,
<<>>).
-%% @spec (This::wxPostScriptDC()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPostScriptDC()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPostScriptDC),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
@@ -170,11 +174,11 @@ getSize(This) -> wxDC:getSize(This).
%% @hidden
getPPI(This) -> wxDC:getPPI(This).
%% @hidden
-getPixel(This,Pt,Col) -> wxDC:getPixel(This,Pt,Col).
+getPixel(This,Pt) -> wxDC:getPixel(This,Pt).
%% @hidden
getPen(This) -> wxDC:getPen(This).
%% @hidden
-getPartialTextExtents(This,Text,Widths) -> wxDC:getPartialTextExtents(This,Text,Widths).
+getPartialTextExtents(This,Text) -> wxDC:getPartialTextExtents(This,Text).
%% @hidden
getMultiLineTextExtent(This,String, Options) -> wxDC:getMultiLineTextExtent(This,String, Options).
%% @hidden
@@ -188,7 +192,7 @@ getLayoutDirection(This) -> wxDC:getLayoutDirection(This).
%% @hidden
getFont(This) -> wxDC:getFont(This).
%% @hidden
-getClippingBox(This,Rect) -> wxDC:getClippingBox(This,Rect).
+getClippingBox(This) -> wxDC:getClippingBox(This).
%% @hidden
getCharWidth(This) -> wxDC:getCharWidth(This).
%% @hidden
diff --git a/lib/wx/src/gen/wxPreviewCanvas.erl b/lib/wx/src/gen/wxPreviewCanvas.erl
index d33aeedb70..cc9f43e5e4 100644
--- a/lib/wx/src/gen/wxPreviewCanvas.erl
+++ b/lib/wx/src/gen/wxPreviewCanvas.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -74,6 +74,7 @@
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
validate/1,warpPointer/3]).
+-export_type([wxPreviewCanvas/0]).
%% @hidden
parent_class(wxScrolledWindow) -> true;
parent_class(wxPanel) -> true;
@@ -81,6 +82,7 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxPreviewCanvas() :: wx:wx_object().
%% From wxScrolledWindow
%% @hidden
setTargetWindow(This,Target) -> wxScrolledWindow:setTargetWindow(This,Target).
diff --git a/lib/wx/src/gen/wxPreviewControlBar.erl b/lib/wx/src/gen/wxPreviewControlBar.erl
index e85af625e2..dce3feb9ea 100644
--- a/lib/wx/src/gen/wxPreviewControlBar.erl
+++ b/lib/wx/src/gen/wxPreviewControlBar.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -70,21 +70,28 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxPreviewControlBar/0]).
%% @hidden
parent_class(wxPanel) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Preview::wxPrintPreview:wxPrintPreview(), Buttons::integer(), Parent::wxWindow:wxWindow()) -> wxPreviewControlBar()
+-type wxPreviewControlBar() :: wx:wx_object().
%% @equiv new(Preview,Buttons,Parent, [])
+-spec new(Preview, Buttons, Parent) -> wxPreviewControlBar() when
+ Preview::wxPrintPreview:wxPrintPreview(), Buttons::integer(), Parent::wxWindow:wxWindow().
+
new(Preview,Buttons,Parent)
when is_record(Preview, wx_ref),is_integer(Buttons),is_record(Parent, wx_ref) ->
new(Preview,Buttons,Parent, []).
-%% @spec (Preview::wxPrintPreview:wxPrintPreview(), Buttons::integer(), Parent::wxWindow:wxWindow(), [Option]) -> wxPreviewControlBar()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpreviewcontrolbar.html#wxpreviewcontrolbarwxpreviewcontrolbar">external documentation</a>.
+-spec new(Preview, Buttons, Parent, [Option]) -> wxPreviewControlBar() when
+ Preview::wxPrintPreview:wxPrintPreview(), Buttons::integer(), Parent::wxWindow:wxWindow(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=PreviewT,ref=PreviewRef},Buttons,#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_integer(Buttons),is_list(Options) ->
?CLASS(PreviewT,wxPrintPreview),
@@ -97,37 +104,41 @@ new(#wx_ref{type=PreviewT,ref=PreviewRef},Buttons,#wx_ref{type=ParentT,ref=Paren
wxe_util:construct(?wxPreviewControlBar_new,
<<PreviewRef:32/?UI,Buttons:32/?UI,ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxPreviewControlBar()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpreviewcontrolbar.html#wxpreviewcontrolbarcreatebuttons">external documentation</a>.
+-spec createButtons(This) -> ok when
+ This::wxPreviewControlBar().
createButtons(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPreviewControlBar),
wxe_util:cast(?wxPreviewControlBar_CreateButtons,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPreviewControlBar()) -> wxPrintPreview:wxPrintPreview()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpreviewcontrolbar.html#wxpreviewcontrolbargetprintpreview">external documentation</a>.
+-spec getPrintPreview(This) -> wxPrintPreview:wxPrintPreview() when
+ This::wxPreviewControlBar().
getPrintPreview(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPreviewControlBar),
wxe_util:call(?wxPreviewControlBar_GetPrintPreview,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPreviewControlBar()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpreviewcontrolbar.html#wxpreviewcontrolbargetzoomcontrol">external documentation</a>.
+-spec getZoomControl(This) -> integer() when
+ This::wxPreviewControlBar().
getZoomControl(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPreviewControlBar),
wxe_util:call(?wxPreviewControlBar_GetZoomControl,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPreviewControlBar(), Zoom::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpreviewcontrolbar.html#wxpreviewcontrolbarsetzoomcontrol">external documentation</a>.
+-spec setZoomControl(This, Zoom) -> ok when
+ This::wxPreviewControlBar(), Zoom::integer().
setZoomControl(#wx_ref{type=ThisT,ref=ThisRef},Zoom)
when is_integer(Zoom) ->
?CLASS(ThisT,wxPreviewControlBar),
wxe_util:cast(?wxPreviewControlBar_SetZoomControl,
<<ThisRef:32/?UI,Zoom:32/?UI>>).
-%% @spec (This::wxPreviewControlBar()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPreviewControlBar()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPreviewControlBar),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxPreviewFrame.erl b/lib/wx/src/gen/wxPreviewFrame.erl
index da43f86030..41bb0bf2bb 100644
--- a/lib/wx/src/gen/wxPreviewFrame.erl
+++ b/lib/wx/src/gen/wxPreviewFrame.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -81,6 +81,7 @@
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
validate/1,warpPointer/3]).
+-export_type([wxPreviewFrame/0]).
%% @hidden
parent_class(wxFrame) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -88,15 +89,22 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Preview::wxPrintPreview:wxPrintPreview(), Parent::wxWindow:wxWindow()) -> wxPreviewFrame()
+-type wxPreviewFrame() :: wx:wx_object().
%% @equiv new(Preview,Parent, [])
+-spec new(Preview, Parent) -> wxPreviewFrame() when
+ Preview::wxPrintPreview:wxPrintPreview(), Parent::wxWindow:wxWindow().
+
new(Preview,Parent)
when is_record(Preview, wx_ref),is_record(Parent, wx_ref) ->
new(Preview,Parent, []).
-%% @spec (Preview::wxPrintPreview:wxPrintPreview(), Parent::wxWindow:wxWindow(), [Option]) -> wxPreviewFrame()
-%% Option = {title, string()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpreviewframe.html#wxpreviewframewxpreviewframe">external documentation</a>.
+-spec new(Preview, Parent, [Option]) -> wxPreviewFrame() when
+ Preview::wxPrintPreview:wxPrintPreview(), Parent::wxWindow:wxWindow(),
+ Option :: {title, unicode:chardata()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=PreviewT,ref=PreviewRef},#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(PreviewT,wxPrintPreview),
@@ -110,37 +118,41 @@ new(#wx_ref{type=PreviewT,ref=PreviewRef},#wx_ref{type=ParentT,ref=ParentRef}, O
wxe_util:construct(?wxPreviewFrame_new,
<<PreviewRef:32/?UI,ParentRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxPreviewFrame()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpreviewframe.html#wxpreviewframecreatecontrolbar">external documentation</a>.
+-spec createControlBar(This) -> ok when
+ This::wxPreviewFrame().
createControlBar(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPreviewFrame),
wxe_util:cast(?wxPreviewFrame_CreateControlBar,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPreviewFrame()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpreviewframe.html#wxpreviewframecreatecanvas">external documentation</a>.
+-spec createCanvas(This) -> ok when
+ This::wxPreviewFrame().
createCanvas(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPreviewFrame),
wxe_util:cast(?wxPreviewFrame_CreateCanvas,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPreviewFrame()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpreviewframe.html#wxpreviewframeinitialize">external documentation</a>.
+-spec initialize(This) -> ok when
+ This::wxPreviewFrame().
initialize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPreviewFrame),
wxe_util:cast(?wxPreviewFrame_Initialize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPreviewFrame(), Event::wxCloseEvent:wxCloseEvent()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxpreviewframe.html#wxpreviewframeonclosewindow">external documentation</a>.
+-spec onCloseWindow(This, Event) -> ok when
+ This::wxPreviewFrame(), Event::wxCloseEvent:wxCloseEvent().
onCloseWindow(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=EventT,ref=EventRef}) ->
?CLASS(ThisT,wxPreviewFrame),
?CLASS(EventT,wxCloseEvent),
wxe_util:cast(?wxPreviewFrame_OnCloseWindow,
<<ThisRef:32/?UI,EventRef:32/?UI>>).
-%% @spec (This::wxPreviewFrame()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPreviewFrame()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPreviewFrame),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxPrintData.erl b/lib/wx/src/gen/wxPrintData.erl
index f3e8ad3612..2cb8dd3c5f 100644
--- a/lib/wx/src/gen/wxPrintData.erl
+++ b/lib/wx/src/gen/wxPrintData.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -32,158 +32,175 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxPrintData/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxPrintData()
+-type wxPrintData() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatawxprintdata">external documentation</a>.
+-spec new() -> wxPrintData().
new() ->
wxe_util:construct(?wxPrintData_new_0,
<<>>).
-%% @spec (PrintData::wxPrintData()) -> wxPrintData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatawxprintdata">external documentation</a>.
+-spec new(PrintData) -> wxPrintData() when
+ PrintData::wxPrintData().
new(#wx_ref{type=PrintDataT,ref=PrintDataRef}) ->
?CLASS(PrintDataT,wxPrintData),
wxe_util:construct(?wxPrintData_new_1,
<<PrintDataRef:32/?UI>>).
-%% @spec (This::wxPrintData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatagetcollate">external documentation</a>.
+-spec getCollate(This) -> boolean() when
+ This::wxPrintData().
getCollate(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintData),
wxe_util:call(?wxPrintData_GetCollate,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintData()) -> WxPrintBin
-%% WxPrintBin = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatagetbin">external documentation</a>.
-%%<br /> WxPrintBin is one of ?wxPRINTBIN_DEFAULT | ?wxPRINTBIN_ONLYONE | ?wxPRINTBIN_LOWER | ?wxPRINTBIN_MIDDLE | ?wxPRINTBIN_MANUAL | ?wxPRINTBIN_ENVELOPE | ?wxPRINTBIN_ENVMANUAL | ?wxPRINTBIN_AUTO | ?wxPRINTBIN_TRACTOR | ?wxPRINTBIN_SMALLFMT | ?wxPRINTBIN_LARGEFMT | ?wxPRINTBIN_LARGECAPACITY | ?wxPRINTBIN_CASSETTE | ?wxPRINTBIN_FORMSOURCE | ?wxPRINTBIN_USER
+%%<br /> Res = ?wxPRINTBIN_DEFAULT | ?wxPRINTBIN_ONLYONE | ?wxPRINTBIN_LOWER | ?wxPRINTBIN_MIDDLE | ?wxPRINTBIN_MANUAL | ?wxPRINTBIN_ENVELOPE | ?wxPRINTBIN_ENVMANUAL | ?wxPRINTBIN_AUTO | ?wxPRINTBIN_TRACTOR | ?wxPRINTBIN_SMALLFMT | ?wxPRINTBIN_LARGEFMT | ?wxPRINTBIN_LARGECAPACITY | ?wxPRINTBIN_CASSETTE | ?wxPRINTBIN_FORMSOURCE | ?wxPRINTBIN_USER
+-spec getBin(This) -> wx:wx_enum() when
+ This::wxPrintData().
getBin(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintData),
wxe_util:call(?wxPrintData_GetBin,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatagetcolour">external documentation</a>.
+-spec getColour(This) -> boolean() when
+ This::wxPrintData().
getColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintData),
wxe_util:call(?wxPrintData_GetColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintData()) -> WxDuplexMode
-%% WxDuplexMode = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatagetduplex">external documentation</a>.
-%%<br /> WxDuplexMode is one of ?wxDUPLEX_SIMPLEX | ?wxDUPLEX_HORIZONTAL | ?wxDUPLEX_VERTICAL
+%%<br /> Res = ?wxDUPLEX_SIMPLEX | ?wxDUPLEX_HORIZONTAL | ?wxDUPLEX_VERTICAL
+-spec getDuplex(This) -> wx:wx_enum() when
+ This::wxPrintData().
getDuplex(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintData),
wxe_util:call(?wxPrintData_GetDuplex,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintData()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatagetnocopies">external documentation</a>.
+-spec getNoCopies(This) -> integer() when
+ This::wxPrintData().
getNoCopies(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintData),
wxe_util:call(?wxPrintData_GetNoCopies,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintData()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatagetorientation">external documentation</a>.
+-spec getOrientation(This) -> integer() when
+ This::wxPrintData().
getOrientation(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintData),
wxe_util:call(?wxPrintData_GetOrientation,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintData()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatagetpaperid">external documentation</a>.
+-spec getPaperId(This) -> integer() when
+ This::wxPrintData().
getPaperId(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintData),
wxe_util:call(?wxPrintData_GetPaperId,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintData()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatagetprintername">external documentation</a>.
+-spec getPrinterName(This) -> unicode:charlist() when
+ This::wxPrintData().
getPrinterName(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintData),
wxe_util:call(?wxPrintData_GetPrinterName,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintData()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatagetquality">external documentation</a>.
+-spec getQuality(This) -> integer() when
+ This::wxPrintData().
getQuality(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintData),
wxe_util:call(?wxPrintData_GetQuality,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdataisok">external documentation</a>.
+-spec isOk(This) -> boolean() when
+ This::wxPrintData().
isOk(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintData),
wxe_util:call(?wxPrintData_IsOk,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintData(), Bin::WxPrintBin) -> ok
-%% WxPrintBin = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatasetbin">external documentation</a>.
-%%<br /> WxPrintBin is one of ?wxPRINTBIN_DEFAULT | ?wxPRINTBIN_ONLYONE | ?wxPRINTBIN_LOWER | ?wxPRINTBIN_MIDDLE | ?wxPRINTBIN_MANUAL | ?wxPRINTBIN_ENVELOPE | ?wxPRINTBIN_ENVMANUAL | ?wxPRINTBIN_AUTO | ?wxPRINTBIN_TRACTOR | ?wxPRINTBIN_SMALLFMT | ?wxPRINTBIN_LARGEFMT | ?wxPRINTBIN_LARGECAPACITY | ?wxPRINTBIN_CASSETTE | ?wxPRINTBIN_FORMSOURCE | ?wxPRINTBIN_USER
+%%<br /> Bin = ?wxPRINTBIN_DEFAULT | ?wxPRINTBIN_ONLYONE | ?wxPRINTBIN_LOWER | ?wxPRINTBIN_MIDDLE | ?wxPRINTBIN_MANUAL | ?wxPRINTBIN_ENVELOPE | ?wxPRINTBIN_ENVMANUAL | ?wxPRINTBIN_AUTO | ?wxPRINTBIN_TRACTOR | ?wxPRINTBIN_SMALLFMT | ?wxPRINTBIN_LARGEFMT | ?wxPRINTBIN_LARGECAPACITY | ?wxPRINTBIN_CASSETTE | ?wxPRINTBIN_FORMSOURCE | ?wxPRINTBIN_USER
+-spec setBin(This, Bin) -> ok when
+ This::wxPrintData(), Bin::wx:wx_enum().
setBin(#wx_ref{type=ThisT,ref=ThisRef},Bin)
when is_integer(Bin) ->
?CLASS(ThisT,wxPrintData),
wxe_util:cast(?wxPrintData_SetBin,
<<ThisRef:32/?UI,Bin:32/?UI>>).
-%% @spec (This::wxPrintData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatasetcollate">external documentation</a>.
+-spec setCollate(This, Flag) -> ok when
+ This::wxPrintData(), Flag::boolean().
setCollate(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxPrintData),
wxe_util:cast(?wxPrintData_SetCollate,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxPrintData(), Colour::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatasetcolour">external documentation</a>.
+-spec setColour(This, Colour) -> ok when
+ This::wxPrintData(), Colour::boolean().
setColour(#wx_ref{type=ThisT,ref=ThisRef},Colour)
when is_boolean(Colour) ->
?CLASS(ThisT,wxPrintData),
wxe_util:cast(?wxPrintData_SetColour,
<<ThisRef:32/?UI,(wxe_util:from_bool(Colour)):32/?UI>>).
-%% @spec (This::wxPrintData(), Duplex::WxDuplexMode) -> ok
-%% WxDuplexMode = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatasetduplex">external documentation</a>.
-%%<br /> WxDuplexMode is one of ?wxDUPLEX_SIMPLEX | ?wxDUPLEX_HORIZONTAL | ?wxDUPLEX_VERTICAL
+%%<br /> Duplex = ?wxDUPLEX_SIMPLEX | ?wxDUPLEX_HORIZONTAL | ?wxDUPLEX_VERTICAL
+-spec setDuplex(This, Duplex) -> ok when
+ This::wxPrintData(), Duplex::wx:wx_enum().
setDuplex(#wx_ref{type=ThisT,ref=ThisRef},Duplex)
when is_integer(Duplex) ->
?CLASS(ThisT,wxPrintData),
wxe_util:cast(?wxPrintData_SetDuplex,
<<ThisRef:32/?UI,Duplex:32/?UI>>).
-%% @spec (This::wxPrintData(), V::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatasetnocopies">external documentation</a>.
+-spec setNoCopies(This, V) -> ok when
+ This::wxPrintData(), V::integer().
setNoCopies(#wx_ref{type=ThisT,ref=ThisRef},V)
when is_integer(V) ->
?CLASS(ThisT,wxPrintData),
wxe_util:cast(?wxPrintData_SetNoCopies,
<<ThisRef:32/?UI,V:32/?UI>>).
-%% @spec (This::wxPrintData(), Orient::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatasetorientation">external documentation</a>.
+-spec setOrientation(This, Orient) -> ok when
+ This::wxPrintData(), Orient::integer().
setOrientation(#wx_ref{type=ThisT,ref=ThisRef},Orient)
when is_integer(Orient) ->
?CLASS(ThisT,wxPrintData),
wxe_util:cast(?wxPrintData_SetOrientation,
<<ThisRef:32/?UI,Orient:32/?UI>>).
-%% @spec (This::wxPrintData(), SizeId::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatasetpaperid">external documentation</a>.
+-spec setPaperId(This, SizeId) -> ok when
+ This::wxPrintData(), SizeId::integer().
setPaperId(#wx_ref{type=ThisT,ref=ThisRef},SizeId)
when is_integer(SizeId) ->
?CLASS(ThisT,wxPrintData),
wxe_util:cast(?wxPrintData_SetPaperId,
<<ThisRef:32/?UI,SizeId:32/?UI>>).
-%% @spec (This::wxPrintData(), Name::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatasetprintername">external documentation</a>.
+-spec setPrinterName(This, Name) -> ok when
+ This::wxPrintData(), Name::unicode:chardata().
setPrinterName(#wx_ref{type=ThisT,ref=ThisRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxPrintData),
@@ -191,16 +208,17 @@ setPrinterName(#wx_ref{type=ThisT,ref=ThisRef},Name)
wxe_util:cast(?wxPrintData_SetPrinterName,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxPrintData(), Quality::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdata.html#wxprintdatasetquality">external documentation</a>.
+-spec setQuality(This, Quality) -> ok when
+ This::wxPrintData(), Quality::integer().
setQuality(#wx_ref{type=ThisT,ref=ThisRef},Quality)
when is_integer(Quality) ->
?CLASS(ThisT,wxPrintData),
wxe_util:cast(?wxPrintData_SetQuality,
<<ThisRef:32/?UI,Quality:32/?UI>>).
-%% @spec (This::wxPrintData()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPrintData()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPrintData),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxPrintDialog.erl b/lib/wx/src/gen/wxPrintDialog.erl
index a2f4bfa4eb..34c8310e12 100644
--- a/lib/wx/src/gen/wxPrintDialog.erl
+++ b/lib/wx/src/gen/wxPrintDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -77,6 +77,7 @@
transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxPrintDialog/0]).
%% @hidden
parent_class(wxDialog) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -84,22 +85,25 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxPrintDialog()
+-type wxPrintDialog() :: wx:wx_object().
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxPrintDialog() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(),X::term()) -> wxPrintDialog()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialog.html#wxprintdialogwxprintdialog">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Parent::wxWindow:wxWindow(), [Option]) -> wxPrintDialog() </c>
-%%<br /> Option = {data, wxPrintDialogData:wxPrintDialogData()}
-%% </p>
-%% <p><c>
-%% new(Parent::wxWindow:wxWindow(), Data::wxPrintData:wxPrintData()) -> wxPrintDialog() </c>
-%% </p>
+%% <br /> Also:<br />
+%% new(Parent, Data) -> wxPrintDialog() when<br />
+%% Parent::wxWindow:wxWindow(), Data::wxPrintData:wxPrintData().<br />
+%%
+-spec new(Parent, [Option]) -> wxPrintDialog() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {data, wxPrintDialogData:wxPrintDialogData()};
+ (Parent, Data) -> wxPrintDialog() when
+ Parent::wxWindow:wxWindow(), Data::wxPrintData:wxPrintData().
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -114,22 +118,24 @@ new(#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=DataT,ref=DataRef}) ->
wxe_util:construct(?wxPrintDialog_new_2_1,
<<ParentRef:32/?UI,DataRef:32/?UI>>).
-%% @spec (This::wxPrintDialog()) -> wxPrintDialogData:wxPrintDialogData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialog.html#wxprintdialoggetprintdialogdata">external documentation</a>.
+-spec getPrintDialogData(This) -> wxPrintDialogData:wxPrintDialogData() when
+ This::wxPrintDialog().
getPrintDialogData(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintDialog),
wxe_util:call(?wxPrintDialog_GetPrintDialogData,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintDialog()) -> wxDC:wxDC()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialog.html#wxprintdialoggetprintdc">external documentation</a>.
+-spec getPrintDC(This) -> wxDC:wxDC() when
+ This::wxPrintDialog().
getPrintDC(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintDialog),
wxe_util:call(?wxPrintDialog_GetPrintDC,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintDialog()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPrintDialog()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPrintDialog),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxPrintDialogData.erl b/lib/wx/src/gen/wxPrintDialogData.erl
index a7e8d41f2e..3368349164 100644
--- a/lib/wx/src/gen/wxPrintDialogData.erl
+++ b/lib/wx/src/gen/wxPrintDialogData.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -33,17 +33,20 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxPrintDialogData/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxPrintDialogData()
+-type wxPrintDialogData() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatawxprintdialogdata">external documentation</a>.
+-spec new() -> wxPrintDialogData().
new() ->
wxe_util:construct(?wxPrintDialogData_new_0,
<<>>).
-%% @spec (DialogData::wxPrintDialogData() | wxPrintData:wxPrintData()) -> wxPrintDialogData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatawxprintdialogdata">external documentation</a>.
+-spec new(DialogData) -> wxPrintDialogData() when
+ DialogData::wxPrintDialogData() | wxPrintData:wxPrintData().
new(#wx_ref{type=DialogDataT,ref=DialogDataRef}) ->
DialogDataOP = case ?CLASS_T(DialogDataT,wxPrintDialogData) of
true ->
@@ -54,189 +57,213 @@ new(#wx_ref{type=DialogDataT,ref=DialogDataRef}) ->
wxe_util:construct(DialogDataOP,
<<DialogDataRef:32/?UI>>).
-%% @spec (This::wxPrintDialogData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdataenablehelp">external documentation</a>.
+-spec enableHelp(This, Flag) -> ok when
+ This::wxPrintDialogData(), Flag::boolean().
enableHelp(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:cast(?wxPrintDialogData_EnableHelp,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxPrintDialogData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdataenablepagenumbers">external documentation</a>.
+-spec enablePageNumbers(This, Flag) -> ok when
+ This::wxPrintDialogData(), Flag::boolean().
enablePageNumbers(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:cast(?wxPrintDialogData_EnablePageNumbers,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxPrintDialogData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdataenableprinttofile">external documentation</a>.
+-spec enablePrintToFile(This, Flag) -> ok when
+ This::wxPrintDialogData(), Flag::boolean().
enablePrintToFile(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:cast(?wxPrintDialogData_EnablePrintToFile,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxPrintDialogData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdataenableselection">external documentation</a>.
+-spec enableSelection(This, Flag) -> ok when
+ This::wxPrintDialogData(), Flag::boolean().
enableSelection(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:cast(?wxPrintDialogData_EnableSelection,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxPrintDialogData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatagetallpages">external documentation</a>.
+-spec getAllPages(This) -> boolean() when
+ This::wxPrintDialogData().
getAllPages(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:call(?wxPrintDialogData_GetAllPages,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintDialogData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatagetcollate">external documentation</a>.
+-spec getCollate(This) -> boolean() when
+ This::wxPrintDialogData().
getCollate(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:call(?wxPrintDialogData_GetCollate,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintDialogData()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatagetfrompage">external documentation</a>.
+-spec getFromPage(This) -> integer() when
+ This::wxPrintDialogData().
getFromPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:call(?wxPrintDialogData_GetFromPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintDialogData()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatagetmaxpage">external documentation</a>.
+-spec getMaxPage(This) -> integer() when
+ This::wxPrintDialogData().
getMaxPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:call(?wxPrintDialogData_GetMaxPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintDialogData()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatagetminpage">external documentation</a>.
+-spec getMinPage(This) -> integer() when
+ This::wxPrintDialogData().
getMinPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:call(?wxPrintDialogData_GetMinPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintDialogData()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatagetnocopies">external documentation</a>.
+-spec getNoCopies(This) -> integer() when
+ This::wxPrintDialogData().
getNoCopies(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:call(?wxPrintDialogData_GetNoCopies,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintDialogData()) -> wxPrintData:wxPrintData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatagetprintdata">external documentation</a>.
+-spec getPrintData(This) -> wxPrintData:wxPrintData() when
+ This::wxPrintDialogData().
getPrintData(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:call(?wxPrintDialogData_GetPrintData,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintDialogData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatagetprinttofile">external documentation</a>.
+-spec getPrintToFile(This) -> boolean() when
+ This::wxPrintDialogData().
getPrintToFile(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:call(?wxPrintDialogData_GetPrintToFile,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintDialogData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatagetselection">external documentation</a>.
+-spec getSelection(This) -> boolean() when
+ This::wxPrintDialogData().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:call(?wxPrintDialogData_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintDialogData()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatagettopage">external documentation</a>.
+-spec getToPage(This) -> integer() when
+ This::wxPrintDialogData().
getToPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:call(?wxPrintDialogData_GetToPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintDialogData()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdataisok">external documentation</a>.
+-spec isOk(This) -> boolean() when
+ This::wxPrintDialogData().
isOk(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:call(?wxPrintDialogData_IsOk,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintDialogData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatasetcollate">external documentation</a>.
+-spec setCollate(This, Flag) -> ok when
+ This::wxPrintDialogData(), Flag::boolean().
setCollate(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:cast(?wxPrintDialogData_SetCollate,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxPrintDialogData(), V::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatasetfrompage">external documentation</a>.
+-spec setFromPage(This, V) -> ok when
+ This::wxPrintDialogData(), V::integer().
setFromPage(#wx_ref{type=ThisT,ref=ThisRef},V)
when is_integer(V) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:cast(?wxPrintDialogData_SetFromPage,
<<ThisRef:32/?UI,V:32/?UI>>).
-%% @spec (This::wxPrintDialogData(), V::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatasetmaxpage">external documentation</a>.
+-spec setMaxPage(This, V) -> ok when
+ This::wxPrintDialogData(), V::integer().
setMaxPage(#wx_ref{type=ThisT,ref=ThisRef},V)
when is_integer(V) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:cast(?wxPrintDialogData_SetMaxPage,
<<ThisRef:32/?UI,V:32/?UI>>).
-%% @spec (This::wxPrintDialogData(), V::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatasetminpage">external documentation</a>.
+-spec setMinPage(This, V) -> ok when
+ This::wxPrintDialogData(), V::integer().
setMinPage(#wx_ref{type=ThisT,ref=ThisRef},V)
when is_integer(V) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:cast(?wxPrintDialogData_SetMinPage,
<<ThisRef:32/?UI,V:32/?UI>>).
-%% @spec (This::wxPrintDialogData(), V::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatasetnocopies">external documentation</a>.
+-spec setNoCopies(This, V) -> ok when
+ This::wxPrintDialogData(), V::integer().
setNoCopies(#wx_ref{type=ThisT,ref=ThisRef},V)
when is_integer(V) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:cast(?wxPrintDialogData_SetNoCopies,
<<ThisRef:32/?UI,V:32/?UI>>).
-%% @spec (This::wxPrintDialogData(), PrintData::wxPrintData:wxPrintData()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatasetprintdata">external documentation</a>.
+-spec setPrintData(This, PrintData) -> ok when
+ This::wxPrintDialogData(), PrintData::wxPrintData:wxPrintData().
setPrintData(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PrintDataT,ref=PrintDataRef}) ->
?CLASS(ThisT,wxPrintDialogData),
?CLASS(PrintDataT,wxPrintData),
wxe_util:cast(?wxPrintDialogData_SetPrintData,
<<ThisRef:32/?UI,PrintDataRef:32/?UI>>).
-%% @spec (This::wxPrintDialogData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatasetprinttofile">external documentation</a>.
+-spec setPrintToFile(This, Flag) -> ok when
+ This::wxPrintDialogData(), Flag::boolean().
setPrintToFile(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:cast(?wxPrintDialogData_SetPrintToFile,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxPrintDialogData(), Flag::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatasetselection">external documentation</a>.
+-spec setSelection(This, Flag) -> ok when
+ This::wxPrintDialogData(), Flag::boolean().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_boolean(Flag) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:cast(?wxPrintDialogData_SetSelection,
<<ThisRef:32/?UI,(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (This::wxPrintDialogData(), V::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintdialogdata.html#wxprintdialogdatasettopage">external documentation</a>.
+-spec setToPage(This, V) -> ok when
+ This::wxPrintDialogData(), V::integer().
setToPage(#wx_ref{type=ThisT,ref=ThisRef},V)
when is_integer(V) ->
?CLASS(ThisT,wxPrintDialogData),
wxe_util:cast(?wxPrintDialogData_SetToPage,
<<ThisRef:32/?UI,V:32/?UI>>).
-%% @spec (This::wxPrintDialogData()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPrintDialogData()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPrintDialogData),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxPrintPreview.erl b/lib/wx/src/gen/wxPrintPreview.erl
index 6f9a0f653f..49ab506526 100644
--- a/lib/wx/src/gen/wxPrintPreview.erl
+++ b/lib/wx/src/gen/wxPrintPreview.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -32,18 +32,24 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxPrintPreview/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Printout::wxPrintout:wxPrintout()) -> wxPrintPreview()
+-type wxPrintPreview() :: wx:wx_object().
%% @equiv new(Printout, [])
+-spec new(Printout) -> wxPrintPreview() when
+ Printout::wxPrintout:wxPrintout().
+
new(Printout)
when is_record(Printout, wx_ref) ->
new(Printout, []).
-%% @spec (Printout::wxPrintout:wxPrintout(), [Option]) -> wxPrintPreview()
-%% Option = {printoutForPrinting, wxPrintout:wxPrintout()} | {data, wxPrintDialogData:wxPrintDialogData()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewwxprintpreview">external documentation</a>.
+-spec new(Printout, [Option]) -> wxPrintPreview() when
+ Printout::wxPrintout:wxPrintout(),
+ Option :: {printoutForPrinting, wxPrintout:wxPrintout()}
+ | {data, wxPrintDialogData:wxPrintDialogData()}.
new(#wx_ref{type=PrintoutT,ref=PrintoutRef}, Options)
when is_list(Options) ->
?CLASS(PrintoutT,wxPrintout),
@@ -54,8 +60,9 @@ new(#wx_ref{type=PrintoutT,ref=PrintoutRef}, Options)
wxe_util:construct(?wxPrintPreview_new_2,
<<PrintoutRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (Printout::wxPrintout:wxPrintout(), PrintoutForPrinting::wxPrintout:wxPrintout(), Data::wxPrintData:wxPrintData()) -> wxPrintPreview()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewwxprintpreview">external documentation</a>.
+-spec new(Printout, PrintoutForPrinting, Data) -> wxPrintPreview() when
+ Printout::wxPrintout:wxPrintout(), PrintoutForPrinting::wxPrintout:wxPrintout(), Data::wxPrintData:wxPrintData().
new(#wx_ref{type=PrintoutT,ref=PrintoutRef},#wx_ref{type=PrintoutForPrintingT,ref=PrintoutForPrintingRef},#wx_ref{type=DataT,ref=DataRef}) ->
?CLASS(PrintoutT,wxPrintout),
?CLASS(PrintoutForPrintingT,wxPrintout),
@@ -63,64 +70,73 @@ new(#wx_ref{type=PrintoutT,ref=PrintoutRef},#wx_ref{type=PrintoutForPrintingT,re
wxe_util:construct(?wxPrintPreview_new_3,
<<PrintoutRef:32/?UI,PrintoutForPrintingRef:32/?UI,DataRef:32/?UI>>).
-%% @spec (This::wxPrintPreview()) -> wxPreviewCanvas:wxPreviewCanvas()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewgetcanvas">external documentation</a>.
+-spec getCanvas(This) -> wxPreviewCanvas:wxPreviewCanvas() when
+ This::wxPrintPreview().
getCanvas(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintPreview),
wxe_util:call(?wxPrintPreview_GetCanvas,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintPreview()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewgetcurrentpage">external documentation</a>.
+-spec getCurrentPage(This) -> integer() when
+ This::wxPrintPreview().
getCurrentPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintPreview),
wxe_util:call(?wxPrintPreview_GetCurrentPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintPreview()) -> wxFrame:wxFrame()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewgetframe">external documentation</a>.
+-spec getFrame(This) -> wxFrame:wxFrame() when
+ This::wxPrintPreview().
getFrame(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintPreview),
wxe_util:call(?wxPrintPreview_GetFrame,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintPreview()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewgetmaxpage">external documentation</a>.
+-spec getMaxPage(This) -> integer() when
+ This::wxPrintPreview().
getMaxPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintPreview),
wxe_util:call(?wxPrintPreview_GetMaxPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintPreview()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewgetminpage">external documentation</a>.
+-spec getMinPage(This) -> integer() when
+ This::wxPrintPreview().
getMinPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintPreview),
wxe_util:call(?wxPrintPreview_GetMinPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintPreview()) -> wxPrintout:wxPrintout()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewgetprintout">external documentation</a>.
+-spec getPrintout(This) -> wxPrintout:wxPrintout() when
+ This::wxPrintPreview().
getPrintout(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintPreview),
wxe_util:call(?wxPrintPreview_GetPrintout,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintPreview()) -> wxPrintout:wxPrintout()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewgetprintoutforprinting">external documentation</a>.
+-spec getPrintoutForPrinting(This) -> wxPrintout:wxPrintout() when
+ This::wxPrintPreview().
getPrintoutForPrinting(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintPreview),
wxe_util:call(?wxPrintPreview_GetPrintoutForPrinting,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintPreview()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewisok">external documentation</a>.
+-spec isOk(This) -> boolean() when
+ This::wxPrintPreview().
isOk(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintPreview),
wxe_util:call(?wxPrintPreview_IsOk,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintPreview(), Canvas::wxPreviewCanvas:wxPreviewCanvas(), Dc::wxDC:wxDC()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewpaintpage">external documentation</a>.
+-spec paintPage(This, Canvas, Dc) -> boolean() when
+ This::wxPrintPreview(), Canvas::wxPreviewCanvas:wxPreviewCanvas(), Dc::wxDC:wxDC().
paintPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=CanvasT,ref=CanvasRef},#wx_ref{type=DcT,ref=DcRef}) ->
?CLASS(ThisT,wxPrintPreview),
?CLASS(CanvasT,wxPreviewCanvas),
@@ -128,64 +144,71 @@ paintPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=CanvasT,ref=CanvasRef},#w
wxe_util:call(?wxPrintPreview_PaintPage,
<<ThisRef:32/?UI,CanvasRef:32/?UI,DcRef:32/?UI>>).
-%% @spec (This::wxPrintPreview(), Interactive::bool()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewprint">external documentation</a>.
+-spec print(This, Interactive) -> boolean() when
+ This::wxPrintPreview(), Interactive::boolean().
print(#wx_ref{type=ThisT,ref=ThisRef},Interactive)
when is_boolean(Interactive) ->
?CLASS(ThisT,wxPrintPreview),
wxe_util:call(?wxPrintPreview_Print,
<<ThisRef:32/?UI,(wxe_util:from_bool(Interactive)):32/?UI>>).
-%% @spec (This::wxPrintPreview(), PageNum::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewrenderpage">external documentation</a>.
+-spec renderPage(This, PageNum) -> boolean() when
+ This::wxPrintPreview(), PageNum::integer().
renderPage(#wx_ref{type=ThisT,ref=ThisRef},PageNum)
when is_integer(PageNum) ->
?CLASS(ThisT,wxPrintPreview),
wxe_util:call(?wxPrintPreview_RenderPage,
<<ThisRef:32/?UI,PageNum:32/?UI>>).
-%% @spec (This::wxPrintPreview(), Canvas::wxPreviewCanvas:wxPreviewCanvas()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewsetcanvas">external documentation</a>.
+-spec setCanvas(This, Canvas) -> ok when
+ This::wxPrintPreview(), Canvas::wxPreviewCanvas:wxPreviewCanvas().
setCanvas(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=CanvasT,ref=CanvasRef}) ->
?CLASS(ThisT,wxPrintPreview),
?CLASS(CanvasT,wxPreviewCanvas),
wxe_util:cast(?wxPrintPreview_SetCanvas,
<<ThisRef:32/?UI,CanvasRef:32/?UI>>).
-%% @spec (This::wxPrintPreview(), PageNum::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewsetcurrentpage">external documentation</a>.
+-spec setCurrentPage(This, PageNum) -> boolean() when
+ This::wxPrintPreview(), PageNum::integer().
setCurrentPage(#wx_ref{type=ThisT,ref=ThisRef},PageNum)
when is_integer(PageNum) ->
?CLASS(ThisT,wxPrintPreview),
wxe_util:call(?wxPrintPreview_SetCurrentPage,
<<ThisRef:32/?UI,PageNum:32/?UI>>).
-%% @spec (This::wxPrintPreview(), Frame::wxFrame:wxFrame()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewsetframe">external documentation</a>.
+-spec setFrame(This, Frame) -> ok when
+ This::wxPrintPreview(), Frame::wxFrame:wxFrame().
setFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef}) ->
?CLASS(ThisT,wxPrintPreview),
?CLASS(FrameT,wxFrame),
wxe_util:cast(?wxPrintPreview_SetFrame,
<<ThisRef:32/?UI,FrameRef:32/?UI>>).
-%% @spec (This::wxPrintPreview(), Printout::wxPrintout:wxPrintout()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewsetprintout">external documentation</a>.
+-spec setPrintout(This, Printout) -> ok when
+ This::wxPrintPreview(), Printout::wxPrintout:wxPrintout().
setPrintout(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PrintoutT,ref=PrintoutRef}) ->
?CLASS(ThisT,wxPrintPreview),
?CLASS(PrintoutT,wxPrintout),
wxe_util:cast(?wxPrintPreview_SetPrintout,
<<ThisRef:32/?UI,PrintoutRef:32/?UI>>).
-%% @spec (This::wxPrintPreview(), Percent::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintpreview.html#wxprintpreviewsetzoom">external documentation</a>.
+-spec setZoom(This, Percent) -> ok when
+ This::wxPrintPreview(), Percent::integer().
setZoom(#wx_ref{type=ThisT,ref=ThisRef},Percent)
when is_integer(Percent) ->
?CLASS(ThisT,wxPrintPreview),
wxe_util:cast(?wxPrintPreview_SetZoom,
<<ThisRef:32/?UI,Percent:32/?UI>>).
-%% @spec (This::wxPrintPreview()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPrintPreview()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPrintPreview),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxPrinter.erl b/lib/wx/src/gen/wxPrinter.erl
index af9afe18af..031483da4d 100644
--- a/lib/wx/src/gen/wxPrinter.erl
+++ b/lib/wx/src/gen/wxPrinter.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -30,17 +30,20 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxPrinter/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxPrinter()
+-type wxPrinter() :: wx:wx_object().
%% @equiv new([])
+-spec new() -> wxPrinter().
+
new() ->
new([]).
-%% @spec ([Option]) -> wxPrinter()
-%% Option = {data, wxPrintDialogData:wxPrintDialogData()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprinter.html#wxprinterwxprinter">external documentation</a>.
+-spec new([Option]) -> wxPrinter() when
+ Option :: {data, wxPrintDialogData:wxPrintDialogData()}.
new(Options)
when is_list(Options) ->
MOpts = fun({data, #wx_ref{type=DataT,ref=DataRef}}, Acc) -> ?CLASS(DataT,wxPrintDialogData),[<<1:32/?UI,DataRef:32/?UI>>|Acc];
@@ -49,8 +52,9 @@ new(Options)
wxe_util:construct(?wxPrinter_new,
<<BinOpt/binary>>).
-%% @spec (This::wxPrinter(), Parent::wxWindow:wxWindow(), Printout::wxPrintout:wxPrintout()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprinter.html#wxprintercreateabortwindow">external documentation</a>.
+-spec createAbortWindow(This, Parent, Printout) -> wxWindow:wxWindow() when
+ This::wxPrinter(), Parent::wxWindow:wxWindow(), Printout::wxPrintout:wxPrintout().
createAbortWindow(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=PrintoutT,ref=PrintoutRef}) ->
?CLASS(ThisT,wxPrinter),
?CLASS(ParentT,wxWindow),
@@ -58,37 +62,41 @@ createAbortWindow(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=Paren
wxe_util:call(?wxPrinter_CreateAbortWindow,
<<ThisRef:32/?UI,ParentRef:32/?UI,PrintoutRef:32/?UI>>).
-%% @spec (This::wxPrinter()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprinter.html#wxprintergetabort">external documentation</a>.
+-spec getAbort(This) -> boolean() when
+ This::wxPrinter().
getAbort(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrinter),
wxe_util:call(?wxPrinter_GetAbort,
<<ThisRef:32/?UI>>).
-%% @spec () -> WxPrinterError
-%% WxPrinterError = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprinter.html#wxprintergetlasterror">external documentation</a>.
-%%<br /> WxPrinterError is one of ?wxPRINTER_NO_ERROR | ?wxPRINTER_CANCELLED | ?wxPRINTER_ERROR
+%%<br /> Res = ?wxPRINTER_NO_ERROR | ?wxPRINTER_CANCELLED | ?wxPRINTER_ERROR
+-spec getLastError() -> wx:wx_enum().
getLastError() ->
wxe_util:call(?wxPrinter_GetLastError,
<<>>).
-%% @spec (This::wxPrinter()) -> wxPrintDialogData:wxPrintDialogData()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprinter.html#wxprintergetprintdialogdata">external documentation</a>.
+-spec getPrintDialogData(This) -> wxPrintDialogData:wxPrintDialogData() when
+ This::wxPrinter().
getPrintDialogData(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrinter),
wxe_util:call(?wxPrinter_GetPrintDialogData,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrinter(), Parent::wxWindow:wxWindow(), Printout::wxPrintout:wxPrintout()) -> bool()
%% @equiv print(This,Parent,Printout, [])
+-spec print(This, Parent, Printout) -> boolean() when
+ This::wxPrinter(), Parent::wxWindow:wxWindow(), Printout::wxPrintout:wxPrintout().
+
print(This,Parent,Printout)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_record(Printout, wx_ref) ->
print(This,Parent,Printout, []).
-%% @spec (This::wxPrinter(), Parent::wxWindow:wxWindow(), Printout::wxPrintout:wxPrintout(), [Option]) -> bool()
-%% Option = {prompt, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprinter.html#wxprinterprint">external documentation</a>.
+-spec print(This, Parent, Printout, [Option]) -> boolean() when
+ This::wxPrinter(), Parent::wxWindow:wxWindow(), Printout::wxPrintout:wxPrintout(),
+ Option :: {prompt, boolean()}.
print(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=PrintoutT,ref=PrintoutRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxPrinter),
@@ -100,16 +108,18 @@ print(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},#wx_re
wxe_util:call(?wxPrinter_Print,
<<ThisRef:32/?UI,ParentRef:32/?UI,PrintoutRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxPrinter(), Parent::wxWindow:wxWindow()) -> wxDC:wxDC()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprinter.html#wxprinterprintdialog">external documentation</a>.
+-spec printDialog(This, Parent) -> wxDC:wxDC() when
+ This::wxPrinter(), Parent::wxWindow:wxWindow().
printDialog(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}) ->
?CLASS(ThisT,wxPrinter),
?CLASS(ParentT,wxWindow),
wxe_util:call(?wxPrinter_PrintDialog,
<<ThisRef:32/?UI,ParentRef:32/?UI>>).
-%% @spec (This::wxPrinter(), Parent::wxWindow:wxWindow(), Printout::wxPrintout:wxPrintout(), Message::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprinter.html#wxprinterreporterror">external documentation</a>.
+-spec reportError(This, Parent, Printout, Message) -> ok when
+ This::wxPrinter(), Parent::wxWindow:wxWindow(), Printout::wxPrintout:wxPrintout(), Message::unicode:chardata().
reportError(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=PrintoutT,ref=PrintoutRef},Message)
when is_list(Message) ->
?CLASS(ThisT,wxPrinter),
@@ -119,16 +129,17 @@ reportError(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},
wxe_util:cast(?wxPrinter_ReportError,
<<ThisRef:32/?UI,ParentRef:32/?UI,PrintoutRef:32/?UI,(byte_size(Message_UC)):32/?UI,(Message_UC)/binary, 0:(((8- ((0+byte_size(Message_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxPrinter(), Parent::wxWindow:wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprinter.html#wxprintersetup">external documentation</a>.
+-spec setup(This, Parent) -> boolean() when
+ This::wxPrinter(), Parent::wxWindow:wxWindow().
setup(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}) ->
?CLASS(ThisT,wxPrinter),
?CLASS(ParentT,wxWindow),
wxe_util:call(?wxPrinter_Setup,
<<ThisRef:32/?UI,ParentRef:32/?UI>>).
-%% @spec (This::wxPrinter()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPrinter()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPrinter),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxPrintout.erl b/lib/wx/src/gen/wxPrintout.erl
index a34c030275..ab96a09c09 100644
--- a/lib/wx/src/gen/wxPrintout.erl
+++ b/lib/wx/src/gen/wxPrintout.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -34,9 +34,11 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxPrintout/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxPrintout() :: wx:wx_object().
%% @spec (Title::string(), OnPrintPage::function()) -> wxPrintout:wxPrintout()
%% @doc @equiv new(Title, OnPrintPage, [])
@@ -118,80 +120,91 @@ new(Title, OnPrintPage, Opts) when is_list(Title), is_function(OnPrintPage), is_
OnPrintPageId:32/?UI,
BinOpt/binary>>).
-%% @spec (This::wxPrintout()) -> wxDC:wxDC()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutgetdc">external documentation</a>.
+-spec getDC(This) -> wxDC:wxDC() when
+ This::wxPrintout().
getDC(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintout),
wxe_util:call(?wxPrintout_GetDC,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintout()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutgetpagesizemm">external documentation</a>.
+-spec getPageSizeMM(This) -> {W::integer(), H::integer()} when
+ This::wxPrintout().
getPageSizeMM(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintout),
wxe_util:call(?wxPrintout_GetPageSizeMM,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintout()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutgetpagesizepixels">external documentation</a>.
+-spec getPageSizePixels(This) -> {W::integer(), H::integer()} when
+ This::wxPrintout().
getPageSizePixels(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintout),
wxe_util:call(?wxPrintout_GetPageSizePixels,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintout()) -> {X::integer(), Y::integer(), W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutgetpaperrectpixels">external documentation</a>.
+-spec getPaperRectPixels(This) -> {X::integer(), Y::integer(), W::integer(), H::integer()} when
+ This::wxPrintout().
getPaperRectPixels(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintout),
wxe_util:call(?wxPrintout_GetPaperRectPixels,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintout()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutgetppiprinter">external documentation</a>.
+-spec getPPIPrinter(This) -> {X::integer(), Y::integer()} when
+ This::wxPrintout().
getPPIPrinter(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintout),
wxe_util:call(?wxPrintout_GetPPIPrinter,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintout()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutgetppiscreen">external documentation</a>.
+-spec getPPIScreen(This) -> {X::integer(), Y::integer()} when
+ This::wxPrintout().
getPPIScreen(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintout),
wxe_util:call(?wxPrintout_GetPPIScreen,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintout()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutgettitle">external documentation</a>.
+-spec getTitle(This) -> unicode:charlist() when
+ This::wxPrintout().
getTitle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintout),
wxe_util:call(?wxPrintout_GetTitle,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintout()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutispreview">external documentation</a>.
+-spec isPreview(This) -> boolean() when
+ This::wxPrintout().
isPreview(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintout),
wxe_util:call(?wxPrintout_IsPreview,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintout(), ImageSize::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutfitthissizetopaper">external documentation</a>.
+-spec fitThisSizeToPaper(This, ImageSize) -> ok when
+ This::wxPrintout(), ImageSize::{W::integer(), H::integer()}.
fitThisSizeToPaper(#wx_ref{type=ThisT,ref=ThisRef},{ImageSizeW,ImageSizeH})
when is_integer(ImageSizeW),is_integer(ImageSizeH) ->
?CLASS(ThisT,wxPrintout),
wxe_util:cast(?wxPrintout_FitThisSizeToPaper,
<<ThisRef:32/?UI,ImageSizeW:32/?UI,ImageSizeH:32/?UI>>).
-%% @spec (This::wxPrintout(), ImageSize::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutfitthissizetopage">external documentation</a>.
+-spec fitThisSizeToPage(This, ImageSize) -> ok when
+ This::wxPrintout(), ImageSize::{W::integer(), H::integer()}.
fitThisSizeToPage(#wx_ref{type=ThisT,ref=ThisRef},{ImageSizeW,ImageSizeH})
when is_integer(ImageSizeW),is_integer(ImageSizeH) ->
?CLASS(ThisT,wxPrintout),
wxe_util:cast(?wxPrintout_FitThisSizeToPage,
<<ThisRef:32/?UI,ImageSizeW:32/?UI,ImageSizeH:32/?UI>>).
-%% @spec (This::wxPrintout(), ImageSize::{W::integer(), H::integer()}, PageSetupData::wxPageSetupDialogData:wxPageSetupDialogData()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutfitthissizetopagemargins">external documentation</a>.
+-spec fitThisSizeToPageMargins(This, ImageSize, PageSetupData) -> ok when
+ This::wxPrintout(), ImageSize::{W::integer(), H::integer()}, PageSetupData::wxPageSetupDialogData:wxPageSetupDialogData().
fitThisSizeToPageMargins(#wx_ref{type=ThisT,ref=ThisRef},{ImageSizeW,ImageSizeH},#wx_ref{type=PageSetupDataT,ref=PageSetupDataRef})
when is_integer(ImageSizeW),is_integer(ImageSizeH) ->
?CLASS(ThisT,wxPrintout),
@@ -199,75 +212,84 @@ fitThisSizeToPageMargins(#wx_ref{type=ThisT,ref=ThisRef},{ImageSizeW,ImageSizeH}
wxe_util:cast(?wxPrintout_FitThisSizeToPageMargins,
<<ThisRef:32/?UI,ImageSizeW:32/?UI,ImageSizeH:32/?UI,PageSetupDataRef:32/?UI>>).
-%% @spec (This::wxPrintout()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutmapscreensizetopaper">external documentation</a>.
+-spec mapScreenSizeToPaper(This) -> ok when
+ This::wxPrintout().
mapScreenSizeToPaper(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintout),
wxe_util:cast(?wxPrintout_MapScreenSizeToPaper,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintout()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutmapscreensizetopage">external documentation</a>.
+-spec mapScreenSizeToPage(This) -> ok when
+ This::wxPrintout().
mapScreenSizeToPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintout),
wxe_util:cast(?wxPrintout_MapScreenSizeToPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintout(), PageSetupData::wxPageSetupDialogData:wxPageSetupDialogData()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutmapscreensizetopagemargins">external documentation</a>.
+-spec mapScreenSizeToPageMargins(This, PageSetupData) -> ok when
+ This::wxPrintout(), PageSetupData::wxPageSetupDialogData:wxPageSetupDialogData().
mapScreenSizeToPageMargins(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageSetupDataT,ref=PageSetupDataRef}) ->
?CLASS(ThisT,wxPrintout),
?CLASS(PageSetupDataT,wxPageSetupDialogData),
wxe_util:cast(?wxPrintout_MapScreenSizeToPageMargins,
<<ThisRef:32/?UI,PageSetupDataRef:32/?UI>>).
-%% @spec (This::wxPrintout()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutmapscreensizetodevice">external documentation</a>.
+-spec mapScreenSizeToDevice(This) -> ok when
+ This::wxPrintout().
mapScreenSizeToDevice(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintout),
wxe_util:cast(?wxPrintout_MapScreenSizeToDevice,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintout()) -> {X::integer(), Y::integer(), W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutgetlogicalpaperrect">external documentation</a>.
+-spec getLogicalPaperRect(This) -> {X::integer(), Y::integer(), W::integer(), H::integer()} when
+ This::wxPrintout().
getLogicalPaperRect(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintout),
wxe_util:call(?wxPrintout_GetLogicalPaperRect,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintout()) -> {X::integer(), Y::integer(), W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutgetlogicalpagerect">external documentation</a>.
+-spec getLogicalPageRect(This) -> {X::integer(), Y::integer(), W::integer(), H::integer()} when
+ This::wxPrintout().
getLogicalPageRect(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxPrintout),
wxe_util:call(?wxPrintout_GetLogicalPageRect,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxPrintout(), PageSetupData::wxPageSetupDialogData:wxPageSetupDialogData()) -> {X::integer(), Y::integer(), W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutgetlogicalpagemarginsrect">external documentation</a>.
+-spec getLogicalPageMarginsRect(This, PageSetupData) -> {X::integer(), Y::integer(), W::integer(), H::integer()} when
+ This::wxPrintout(), PageSetupData::wxPageSetupDialogData:wxPageSetupDialogData().
getLogicalPageMarginsRect(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageSetupDataT,ref=PageSetupDataRef}) ->
?CLASS(ThisT,wxPrintout),
?CLASS(PageSetupDataT,wxPageSetupDialogData),
wxe_util:call(?wxPrintout_GetLogicalPageMarginsRect,
<<ThisRef:32/?UI,PageSetupDataRef:32/?UI>>).
-%% @spec (This::wxPrintout(), X::integer(), Y::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutsetlogicalorigin">external documentation</a>.
+-spec setLogicalOrigin(This, X, Y) -> ok when
+ This::wxPrintout(), X::integer(), Y::integer().
setLogicalOrigin(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxPrintout),
wxe_util:cast(?wxPrintout_SetLogicalOrigin,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxPrintout(), Xoff::integer(), Yoff::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprintout.html#wxprintoutoffsetlogicalorigin">external documentation</a>.
+-spec offsetLogicalOrigin(This, Xoff, Yoff) -> ok when
+ This::wxPrintout(), Xoff::integer(), Yoff::integer().
offsetLogicalOrigin(#wx_ref{type=ThisT,ref=ThisRef},Xoff,Yoff)
when is_integer(Xoff),is_integer(Yoff) ->
?CLASS(ThisT,wxPrintout),
wxe_util:cast(?wxPrintout_OffsetLogicalOrigin,
<<ThisRef:32/?UI,Xoff:32/?UI,Yoff:32/?UI>>).
-%% @spec (This::wxPrintout()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxPrintout()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxPrintout),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxProgressDialog.erl b/lib/wx/src/gen/wxProgressDialog.erl
index 69e73454b5..0f42c1d68f 100644
--- a/lib/wx/src/gen/wxProgressDialog.erl
+++ b/lib/wx/src/gen/wxProgressDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -77,6 +77,7 @@
transferDataFromWindow/1,transferDataToWindow/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxProgressDialog/0]).
%% @hidden
parent_class(wxDialog) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -84,15 +85,21 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Title::string(), Message::string()) -> wxProgressDialog()
+-type wxProgressDialog() :: wx:wx_object().
%% @equiv new(Title,Message, [])
+-spec new(Title, Message) -> wxProgressDialog() when
+ Title::unicode:chardata(), Message::unicode:chardata().
+
new(Title,Message)
when is_list(Title),is_list(Message) ->
new(Title,Message, []).
-%% @spec (Title::string(), Message::string(), [Option]) -> wxProgressDialog()
-%% Option = {maximum, integer()} | {parent, wxWindow:wxWindow()} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprogressdialog.html#wxprogressdialogwxprogressdialog">external documentation</a>.
+-spec new(Title, Message, [Option]) -> wxProgressDialog() when
+ Title::unicode:chardata(), Message::unicode:chardata(),
+ Option :: {maximum, integer()}
+ | {parent, wxWindow:wxWindow()}
+ | {style, integer()}.
new(Title,Message, Options)
when is_list(Title),is_list(Message),is_list(Options) ->
Title_UC = unicode:characters_to_binary([Title,0]),
@@ -105,29 +112,34 @@ new(Title,Message, Options)
wxe_util:construct(?wxProgressDialog_new,
<<(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((4+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Message_UC)):32/?UI,(Message_UC)/binary, 0:(((8- ((4+byte_size(Message_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxProgressDialog()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprogressdialog.html#wxprogressdialogresume">external documentation</a>.
+-spec resume(This) -> ok when
+ This::wxProgressDialog().
resume(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxProgressDialog),
wxe_util:cast(?wxProgressDialog_Resume,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxProgressDialog()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprogressdialog.html#wxprogressdialogupdate">external documentation</a>.
+-spec update(This) -> ok when
+ This::wxProgressDialog().
update(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxProgressDialog),
wxe_util:cast(?wxProgressDialog_Update_0,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxProgressDialog(), Value::integer()) -> bool()
%% @equiv update(This,Value, [])
+-spec update(This, Value) -> boolean() when
+ This::wxProgressDialog(), Value::integer().
+
update(This,Value)
when is_record(This, wx_ref),is_integer(Value) ->
update(This,Value, []).
-%% @spec (This::wxProgressDialog(), Value::integer(), [Option]) -> bool()
-%% Option = {newmsg, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxprogressdialog.html#wxprogressdialogupdate">external documentation</a>.
+-spec update(This, Value, [Option]) -> boolean() when
+ This::wxProgressDialog(), Value::integer(),
+ Option :: {newmsg, unicode:chardata()}.
update(#wx_ref{type=ThisT,ref=ThisRef},Value, Options)
when is_integer(Value),is_list(Options) ->
?CLASS(ThisT,wxProgressDialog),
@@ -137,8 +149,8 @@ update(#wx_ref{type=ThisT,ref=ThisRef},Value, Options)
wxe_util:call(?wxProgressDialog_Update_2,
<<ThisRef:32/?UI,Value:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxProgressDialog()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxProgressDialog()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxProgressDialog),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxQueryNewPaletteEvent.erl b/lib/wx/src/gen/wxQueryNewPaletteEvent.erl
index 96c493e4a6..8123d62fe1 100644
--- a/lib/wx/src/gen/wxQueryNewPaletteEvent.erl
+++ b/lib/wx/src/gen/wxQueryNewPaletteEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,20 +37,24 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxQueryNewPaletteEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxQueryNewPaletteEvent(), Realized::bool()) -> ok
+-type wxQueryNewPaletteEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxquerynewpaletteevent.html#wxquerynewpaletteeventsetpaletterealized">external documentation</a>.
+-spec setPaletteRealized(This, Realized) -> ok when
+ This::wxQueryNewPaletteEvent(), Realized::boolean().
setPaletteRealized(#wx_ref{type=ThisT,ref=ThisRef},Realized)
when is_boolean(Realized) ->
?CLASS(ThisT,wxQueryNewPaletteEvent),
wxe_util:cast(?wxQueryNewPaletteEvent_SetPaletteRealized,
<<ThisRef:32/?UI,(wxe_util:from_bool(Realized)):32/?UI>>).
-%% @spec (This::wxQueryNewPaletteEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxquerynewpaletteevent.html#wxquerynewpaletteeventgetpaletterealized">external documentation</a>.
+-spec getPaletteRealized(This) -> boolean() when
+ This::wxQueryNewPaletteEvent().
getPaletteRealized(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxQueryNewPaletteEvent),
wxe_util:call(?wxQueryNewPaletteEvent_GetPaletteRealized,
diff --git a/lib/wx/src/gen/wxRadioBox.erl b/lib/wx/src/gen/wxRadioBox.erl
index 766a691108..b7f52d7d9c 100644
--- a/lib/wx/src/gen/wxRadioBox.erl
+++ b/lib/wx/src/gen/wxRadioBox.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -72,21 +72,28 @@
thaw/1,transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxRadioBox/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Title::string(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]]) -> wxRadioBox()
+-type wxRadioBox() :: wx:wx_object().
%% @equiv new(Parent,Id,Title,Pos,Size,Choices, [])
+-spec new(Parent, Id, Title, Pos, Size, Choices) -> wxRadioBox() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[unicode:chardata()].
+
new(Parent,Id,Title,Pos={PosX,PosY},Size={SizeW,SizeH},Choices)
when is_record(Parent, wx_ref),is_integer(Id),is_list(Title),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices) ->
new(Parent,Id,Title,Pos,Size,Choices, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Title::string(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]], [Option]) -> wxRadioBox()
-%% Option = {majorDim, integer()} | {style, integer()} | {val, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxwxradiobox">external documentation</a>.
+-spec new(Parent, Id, Title, Pos, Size, Choices, [Option]) -> wxRadioBox() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[unicode:chardata()],
+ Option :: {majorDim, integer()}
+ | {style, integer()}
+ | {val, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title,{PosX,PosY},{SizeW,SizeH},Choices, Options)
when is_integer(Id),is_list(Title),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -101,15 +108,20 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title,{PosX,PosY},{SizeW,SizeH},Choic
wxe_util:construct(?wxRadioBox_new,
<<ParentRef:32/?UI,Id:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((4+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8,PosX:32/?UI,PosY:32/?UI,SizeW:32/?UI,SizeH:32/?UI,(length(Choices_UCA)):32/?UI, (<< <<(byte_size(UC_Str)):32/?UI, UC_Str/binary>>|| UC_Str <- Choices_UCA>>)/binary, 0:(((8- ((4 + lists:sum([byte_size(S)+4||S<-Choices_UCA])) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxRadioBox(), Parent::wxWindow:wxWindow(), Id::integer(), Title::string(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]]) -> bool()
%% @equiv create(This,Parent,Id,Title,Pos,Size,Choices, [])
+-spec create(This, Parent, Id, Title, Pos, Size, Choices) -> boolean() when
+ This::wxRadioBox(), Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[unicode:chardata()].
+
create(This,Parent,Id,Title,Pos={PosX,PosY},Size={SizeW,SizeH},Choices)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Title),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices) ->
create(This,Parent,Id,Title,Pos,Size,Choices, []).
-%% @spec (This::wxRadioBox(), Parent::wxWindow:wxWindow(), Id::integer(), Title::string(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]], [Option]) -> bool()
-%% Option = {majorDim, integer()} | {style, integer()} | {val, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxcreate">external documentation</a>.
+-spec create(This, Parent, Id, Title, Pos, Size, Choices, [Option]) -> boolean() when
+ This::wxRadioBox(), Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[unicode:chardata()],
+ Option :: {majorDim, integer()}
+ | {style, integer()}
+ | {val, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Title,{PosX,PosY},{SizeW,SizeH},Choices, Options)
when is_integer(Id),is_list(Title),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices),is_list(Options) ->
?CLASS(ThisT,wxRadioBox),
@@ -125,21 +137,25 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Ti
wxe_util:call(?wxRadioBox_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((0+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8,PosX:32/?UI,PosY:32/?UI,SizeW:32/?UI,SizeH:32/?UI,(length(Choices_UCA)):32/?UI, (<< <<(byte_size(UC_Str)):32/?UI, UC_Str/binary>>|| UC_Str <- Choices_UCA>>)/binary, 0:(((8- ((4 + lists:sum([byte_size(S)+4||S<-Choices_UCA])) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxRadioBox()) -> bool()
%% @equiv enable(This, [])
+-spec enable(This) -> boolean() when
+ This::wxRadioBox().
+
enable(This)
when is_record(This, wx_ref) ->
enable(This, []).
-%% @spec (This::wxRadioBox(),X::integer()|term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxenable">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% enable(This::wxRadioBox(), N::integer()) -> enable(This,N, []) </c></p>
-%% <p><c>
-%% enable(This::wxRadioBox(), [Option]) -> bool() </c>
-%%<br /> Option = {enable, bool()}
-%% </p>
+%% <br /> Also:<br />
+%% enable(This, [Option]) -> boolean() when<br />
+%% This::wxRadioBox(),<br />
+%% Option :: {enable, boolean()}.<br />
+%%
+-spec enable(This, N) -> boolean() when
+ This::wxRadioBox(), N::integer();
+ (This, [Option]) -> boolean() when
+ This::wxRadioBox(),
+ Option :: {enable, boolean()}.
enable(This,N)
when is_record(This, wx_ref),is_integer(N) ->
@@ -153,9 +169,10 @@ enable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxRadioBox_Enable_1,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxRadioBox(), N::integer(), [Option]) -> bool()
-%% Option = {enable, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxenable">external documentation</a>.
+-spec enable(This, N, [Option]) -> boolean() when
+ This::wxRadioBox(), N::integer(),
+ Option :: {enable, boolean()}.
enable(#wx_ref{type=ThisT,ref=ThisRef},N, Options)
when is_integer(N),is_list(Options) ->
?CLASS(ThisT,wxRadioBox),
@@ -165,44 +182,51 @@ enable(#wx_ref{type=ThisT,ref=ThisRef},N, Options)
wxe_util:call(?wxRadioBox_Enable_2,
<<ThisRef:32/?UI,N:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxRadioBox()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxgetselection">external documentation</a>.
+-spec getSelection(This) -> integer() when
+ This::wxRadioBox().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxRadioBox),
wxe_util:call(?wxRadioBox_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxRadioBox(), N::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxgetstring">external documentation</a>.
+-spec getString(This, N) -> unicode:charlist() when
+ This::wxRadioBox(), N::integer().
getString(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxRadioBox),
wxe_util:call(?wxRadioBox_GetString,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxRadioBox(), N::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxsetselection">external documentation</a>.
+-spec setSelection(This, N) -> ok when
+ This::wxRadioBox(), N::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxRadioBox),
wxe_util:cast(?wxRadioBox_SetSelection,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxRadioBox()) -> bool()
%% @equiv show(This, [])
+-spec show(This) -> boolean() when
+ This::wxRadioBox().
+
show(This)
when is_record(This, wx_ref) ->
show(This, []).
-%% @spec (This::wxRadioBox(),X::integer()|term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxshow">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% show(This::wxRadioBox(), N::integer()) -> show(This,N, []) </c></p>
-%% <p><c>
-%% show(This::wxRadioBox(), [Option]) -> bool() </c>
-%%<br /> Option = {show, bool()}
-%% </p>
+%% <br /> Also:<br />
+%% show(This, [Option]) -> boolean() when<br />
+%% This::wxRadioBox(),<br />
+%% Option :: {show, boolean()}.<br />
+%%
+-spec show(This, N) -> boolean() when
+ This::wxRadioBox(), N::integer();
+ (This, [Option]) -> boolean() when
+ This::wxRadioBox(),
+ Option :: {show, boolean()}.
show(This,N)
when is_record(This, wx_ref),is_integer(N) ->
@@ -216,9 +240,10 @@ show(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxRadioBox_Show_1,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxRadioBox(), N::integer(), [Option]) -> bool()
-%% Option = {show, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxshow">external documentation</a>.
+-spec show(This, N, [Option]) -> boolean() when
+ This::wxRadioBox(), N::integer(),
+ Option :: {show, boolean()}.
show(#wx_ref{type=ThisT,ref=ThisRef},N, Options)
when is_integer(N),is_list(Options) ->
?CLASS(ThisT,wxRadioBox),
@@ -228,62 +253,70 @@ show(#wx_ref{type=ThisT,ref=ThisRef},N, Options)
wxe_util:call(?wxRadioBox_Show_2,
<<ThisRef:32/?UI,N:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxRadioBox()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxgetcolumncount">external documentation</a>.
+-spec getColumnCount(This) -> integer() when
+ This::wxRadioBox().
getColumnCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxRadioBox),
wxe_util:call(?wxRadioBox_GetColumnCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxRadioBox(), N::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxgetitemhelptext">external documentation</a>.
+-spec getItemHelpText(This, N) -> unicode:charlist() when
+ This::wxRadioBox(), N::integer().
getItemHelpText(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxRadioBox),
wxe_util:call(?wxRadioBox_GetItemHelpText,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxRadioBox(), Item::integer()) -> wxToolTip:wxToolTip()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxgetitemtooltip">external documentation</a>.
+-spec getItemToolTip(This, Item) -> wxToolTip:wxToolTip() when
+ This::wxRadioBox(), Item::integer().
getItemToolTip(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxRadioBox),
wxe_util:call(?wxRadioBox_GetItemToolTip,
<<ThisRef:32/?UI,Item:32/?UI>>).
-%% @spec (This::wxRadioBox(), Pt::{X::integer(), Y::integer()}) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxgetitemfrompoint">external documentation</a>.
+-spec getItemFromPoint(This, Pt) -> integer() when
+ This::wxRadioBox(), Pt::{X::integer(), Y::integer()}.
getItemFromPoint(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxRadioBox),
wxe_util:call(?wxRadioBox_GetItemFromPoint,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxRadioBox()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxgetrowcount">external documentation</a>.
+-spec getRowCount(This) -> integer() when
+ This::wxRadioBox().
getRowCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxRadioBox),
wxe_util:call(?wxRadioBox_GetRowCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxRadioBox(), N::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxisitemenabled">external documentation</a>.
+-spec isItemEnabled(This, N) -> boolean() when
+ This::wxRadioBox(), N::integer().
isItemEnabled(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxRadioBox),
wxe_util:call(?wxRadioBox_IsItemEnabled,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxRadioBox(), N::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxisitemshown">external documentation</a>.
+-spec isItemShown(This, N) -> boolean() when
+ This::wxRadioBox(), N::integer().
isItemShown(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxRadioBox),
wxe_util:call(?wxRadioBox_IsItemShown,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxRadioBox(), N::integer(), HelpText::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxsetitemhelptext">external documentation</a>.
+-spec setItemHelpText(This, N, HelpText) -> ok when
+ This::wxRadioBox(), N::integer(), HelpText::unicode:chardata().
setItemHelpText(#wx_ref{type=ThisT,ref=ThisRef},N,HelpText)
when is_integer(N),is_list(HelpText) ->
?CLASS(ThisT,wxRadioBox),
@@ -291,8 +324,9 @@ setItemHelpText(#wx_ref{type=ThisT,ref=ThisRef},N,HelpText)
wxe_util:cast(?wxRadioBox_SetItemHelpText,
<<ThisRef:32/?UI,N:32/?UI,(byte_size(HelpText_UC)):32/?UI,(HelpText_UC)/binary, 0:(((8- ((4+byte_size(HelpText_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxRadioBox(), Item::integer(), Text::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobox.html#wxradioboxsetitemtooltip">external documentation</a>.
+-spec setItemToolTip(This, Item, Text) -> ok when
+ This::wxRadioBox(), Item::integer(), Text::unicode:chardata().
setItemToolTip(#wx_ref{type=ThisT,ref=ThisRef},Item,Text)
when is_integer(Item),is_list(Text) ->
?CLASS(ThisT,wxRadioBox),
@@ -300,8 +334,8 @@ setItemToolTip(#wx_ref{type=ThisT,ref=ThisRef},Item,Text)
wxe_util:cast(?wxRadioBox_SetItemToolTip,
<<ThisRef:32/?UI,Item:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxRadioBox()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxRadioBox()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxRadioBox),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxRadioButton.erl b/lib/wx/src/gen/wxRadioButton.erl
index c4665837b5..beb052b873 100644
--- a/lib/wx/src/gen/wxRadioButton.erl
+++ b/lib/wx/src/gen/wxRadioButton.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -69,27 +69,35 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxRadioButton/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxRadioButton()
+-type wxRadioButton() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobutton.html#wxradiobuttonwxradiobutton">external documentation</a>.
+-spec new() -> wxRadioButton().
new() ->
wxe_util:construct(?wxRadioButton_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Label::string()) -> wxRadioButton()
%% @equiv new(Parent,Id,Label, [])
+-spec new(Parent, Id, Label) -> wxRadioButton() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata().
+
new(Parent,Id,Label)
when is_record(Parent, wx_ref),is_integer(Id),is_list(Label) ->
new(Parent,Id,Label, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Label::string(), [Option]) -> wxRadioButton()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobutton.html#wxradiobuttonwxradiobutton">external documentation</a>.
+-spec new(Parent, Id, Label, [Option]) -> wxRadioButton() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
when is_integer(Id),is_list(Label),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -103,15 +111,21 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
wxe_util:construct(?wxRadioButton_new_4,
<<ParentRef:32/?UI,Id:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxRadioButton(), Parent::wxWindow:wxWindow(), Id::integer(), Label::string()) -> bool()
%% @equiv create(This,Parent,Id,Label, [])
+-spec create(This, Parent, Id, Label) -> boolean() when
+ This::wxRadioButton(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata().
+
create(This,Parent,Id,Label)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Label) ->
create(This,Parent,Id,Label, []).
-%% @spec (This::wxRadioButton(), Parent::wxWindow:wxWindow(), Id::integer(), Label::string(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobutton.html#wxradiobuttoncreate">external documentation</a>.
+-spec create(This, Parent, Id, Label, [Option]) -> boolean() when
+ This::wxRadioButton(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
when is_integer(Id),is_list(Label),is_list(Options) ->
?CLASS(ThisT,wxRadioButton),
@@ -126,23 +140,25 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,La
wxe_util:call(?wxRadioButton_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((0+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxRadioButton()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobutton.html#wxradiobuttongetvalue">external documentation</a>.
+-spec getValue(This) -> boolean() when
+ This::wxRadioButton().
getValue(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxRadioButton),
wxe_util:call(?wxRadioButton_GetValue,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxRadioButton(), Val::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxradiobutton.html#wxradiobuttonsetvalue">external documentation</a>.
+-spec setValue(This, Val) -> ok when
+ This::wxRadioButton(), Val::boolean().
setValue(#wx_ref{type=ThisT,ref=ThisRef},Val)
when is_boolean(Val) ->
?CLASS(ThisT,wxRadioButton),
wxe_util:cast(?wxRadioButton_SetValue,
<<ThisRef:32/?UI,(wxe_util:from_bool(Val)):32/?UI>>).
-%% @spec (This::wxRadioButton()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxRadioButton()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxRadioButton),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxRegion.erl b/lib/wx/src/gen/wxRegion.erl
index 9107a4d6b1..3e23623741 100644
--- a/lib/wx/src/gen/wxRegion.erl
+++ b/lib/wx/src/gen/wxRegion.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -32,24 +32,26 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxRegion/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxRegion()
+-type wxRegion() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionwxregion">external documentation</a>.
+-spec new() -> wxRegion().
new() ->
wxe_util:construct(?wxRegion_new_0,
<<>>).
-%% @spec (X::term()) -> wxRegion()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionwxregion">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Bmp::wxBitmap:wxBitmap()) -> wxRegion() </c>
-%% </p>
-%% <p><c>
-%% new(Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> wxRegion() </c>
-%% </p>
+%% <br /> Also:<br />
+%% new(Rect) -> wxRegion() when<br />
+%% Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.<br />
+%%
+-spec new(Bmp) -> wxRegion() when
+ Bmp::wxBitmap:wxBitmap();
+ (Rect) -> wxRegion() when
+ Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
new(#wx_ref{type=BmpT,ref=BmpRef}) ->
?CLASS(BmpT,wxBitmap),
wxe_util:construct(?wxRegion_new_1_0,
@@ -59,40 +61,40 @@ new({RectX,RectY,RectW,RectH})
wxe_util:construct(?wxRegion_new_1_1,
<<RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (TopLeft::{X::integer(), Y::integer()}, BottomRight::{X::integer(), Y::integer()}) -> wxRegion()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionwxregion">external documentation</a>.
+-spec new(TopLeft, BottomRight) -> wxRegion() when
+ TopLeft::{X::integer(), Y::integer()}, BottomRight::{X::integer(), Y::integer()}.
new({TopLeftX,TopLeftY},{BottomRightX,BottomRightY})
when is_integer(TopLeftX),is_integer(TopLeftY),is_integer(BottomRightX),is_integer(BottomRightY) ->
wxe_util:construct(?wxRegion_new_2,
<<TopLeftX:32/?UI,TopLeftY:32/?UI,BottomRightX:32/?UI,BottomRightY:32/?UI>>).
-%% @spec (X::integer(), Y::integer(), W::integer(), H::integer()) -> wxRegion()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionwxregion">external documentation</a>.
+-spec new(X, Y, W, H) -> wxRegion() when
+ X::integer(), Y::integer(), W::integer(), H::integer().
new(X,Y,W,H)
when is_integer(X),is_integer(Y),is_integer(W),is_integer(H) ->
wxe_util:construct(?wxRegion_new_4,
<<X:32/?UI,Y:32/?UI,W:32/?UI,H:32/?UI>>).
-%% @spec (This::wxRegion()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionclear">external documentation</a>.
+-spec clear(This) -> ok when
+ This::wxRegion().
clear(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxRegion),
wxe_util:cast(?wxRegion_Clear,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxRegion(),X::term()) -> WxRegionContain
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregioncontains">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% contains(This::wxRegion(), Pt::{X::integer(), Y::integer()}) -> WxRegionContain </c>
-%%<br /> WxRegionContain = integer()
-%%<br /> WxRegionContain is one of ?wxOutRegion | ?wxPartRegion | ?wxInRegion
-%% </p>
-%% <p><c>
-%% contains(This::wxRegion(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> WxRegionContain </c>
-%%<br /> WxRegionContain = integer()
-%%<br /> WxRegionContain is one of ?wxOutRegion | ?wxPartRegion | ?wxInRegion
-%% </p>
+%% <br /> Also:<br />
+%% contains(This, Rect) -> wx:wx_enum() when<br />
+%% This::wxRegion(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.<br />
+%%
+%%<br /> Res = ?wxOutRegion | ?wxPartRegion | ?wxInRegion
+-spec contains(This, Pt) -> wx:wx_enum() when
+ This::wxRegion(), Pt::{X::integer(), Y::integer()};
+ (This, Rect) -> wx:wx_enum() when
+ This::wxRegion(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
contains(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxRegion),
@@ -104,49 +106,51 @@ contains(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
wxe_util:call(?wxRegion_Contains_1_1,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxRegion(), X::integer(), Y::integer()) -> WxRegionContain
-%% WxRegionContain = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregioncontains">external documentation</a>.
-%%<br /> WxRegionContain is one of ?wxOutRegion | ?wxPartRegion | ?wxInRegion
+%%<br /> Res = ?wxOutRegion | ?wxPartRegion | ?wxInRegion
+-spec contains(This, X, Y) -> wx:wx_enum() when
+ This::wxRegion(), X::integer(), Y::integer().
contains(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxRegion),
wxe_util:call(?wxRegion_Contains_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxRegion(), X::integer(), Y::integer(), W::integer(), H::integer()) -> WxRegionContain
-%% WxRegionContain = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregioncontains">external documentation</a>.
-%%<br /> WxRegionContain is one of ?wxOutRegion | ?wxPartRegion | ?wxInRegion
+%%<br /> Res = ?wxOutRegion | ?wxPartRegion | ?wxInRegion
+-spec contains(This, X, Y, W, H) -> wx:wx_enum() when
+ This::wxRegion(), X::integer(), Y::integer(), W::integer(), H::integer().
contains(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H)
when is_integer(X),is_integer(Y),is_integer(W),is_integer(H) ->
?CLASS(ThisT,wxRegion),
wxe_util:call(?wxRegion_Contains_4,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,W:32/?UI,H:32/?UI>>).
-%% @spec (This::wxRegion()) -> wxBitmap:wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionconverttobitmap">external documentation</a>.
+-spec convertToBitmap(This) -> wxBitmap:wxBitmap() when
+ This::wxRegion().
convertToBitmap(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxRegion),
wxe_util:call(?wxRegion_ConvertToBitmap,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxRegion()) -> {X::integer(), Y::integer(), W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregiongetbox">external documentation</a>.
+-spec getBox(This) -> {X::integer(), Y::integer(), W::integer(), H::integer()} when
+ This::wxRegion().
getBox(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxRegion),
wxe_util:call(?wxRegion_GetBox,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxRegion(),X::wxRegion()|term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionintersect">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% intersect(This::wxRegion(), Region::wxRegion()) -> bool() </c>
-%% </p>
-%% <p><c>
-%% intersect(This::wxRegion(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% intersect(This, Rect) -> boolean() when<br />
+%% This::wxRegion(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.<br />
+%%
+-spec intersect(This, Region) -> boolean() when
+ This::wxRegion(), Region::wxRegion();
+ (This, Rect) -> boolean() when
+ This::wxRegion(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
intersect(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=RegionT,ref=RegionRef}) ->
?CLASS(ThisT,wxRegion),
?CLASS(RegionT,wxRegion),
@@ -158,30 +162,32 @@ intersect(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
wxe_util:call(?wxRegion_Intersect_1_1,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxRegion(), X::integer(), Y::integer(), W::integer(), H::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionintersect">external documentation</a>.
+-spec intersect(This, X, Y, W, H) -> boolean() when
+ This::wxRegion(), X::integer(), Y::integer(), W::integer(), H::integer().
intersect(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H)
when is_integer(X),is_integer(Y),is_integer(W),is_integer(H) ->
?CLASS(ThisT,wxRegion),
wxe_util:call(?wxRegion_Intersect_4,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,W:32/?UI,H:32/?UI>>).
-%% @spec (This::wxRegion()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionisempty">external documentation</a>.
+-spec isEmpty(This) -> boolean() when
+ This::wxRegion().
isEmpty(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxRegion),
wxe_util:call(?wxRegion_IsEmpty,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxRegion(),X::wxRegion()|term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionsubtract">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% subtract(This::wxRegion(), Region::wxRegion()) -> bool() </c>
-%% </p>
-%% <p><c>
-%% subtract(This::wxRegion(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% subtract(This, Rect) -> boolean() when<br />
+%% This::wxRegion(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.<br />
+%%
+-spec subtract(This, Region) -> boolean() when
+ This::wxRegion(), Region::wxRegion();
+ (This, Rect) -> boolean() when
+ This::wxRegion(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
subtract(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=RegionT,ref=RegionRef}) ->
?CLASS(ThisT,wxRegion),
?CLASS(RegionT,wxRegion),
@@ -193,39 +199,42 @@ subtract(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
wxe_util:call(?wxRegion_Subtract_1_1,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxRegion(), X::integer(), Y::integer(), W::integer(), H::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionsubtract">external documentation</a>.
+-spec subtract(This, X, Y, W, H) -> boolean() when
+ This::wxRegion(), X::integer(), Y::integer(), W::integer(), H::integer().
subtract(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H)
when is_integer(X),is_integer(Y),is_integer(W),is_integer(H) ->
?CLASS(ThisT,wxRegion),
wxe_util:call(?wxRegion_Subtract_4,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,W:32/?UI,H:32/?UI>>).
-%% @spec (This::wxRegion(), Pt::{X::integer(), Y::integer()}) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionoffset">external documentation</a>.
+-spec offset(This, Pt) -> boolean() when
+ This::wxRegion(), Pt::{X::integer(), Y::integer()}.
offset(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxRegion),
wxe_util:call(?wxRegion_Offset_1,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxRegion(), X::integer(), Y::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionoffset">external documentation</a>.
+-spec offset(This, X, Y) -> boolean() when
+ This::wxRegion(), X::integer(), Y::integer().
offset(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxRegion),
wxe_util:call(?wxRegion_Offset_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxRegion(),X::term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionunion">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% union(This::wxRegion(), Region::wxRegion() | wxBitmap:wxBitmap()) -> bool() </c>
-%% </p>
-%% <p><c>
-%% union(This::wxRegion(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% union(This, Rect) -> boolean() when<br />
+%% This::wxRegion(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.<br />
+%%
+-spec union(This, Region) -> boolean() when
+ This::wxRegion(), Region::wxRegion() | wxBitmap:wxBitmap();
+ (This, Rect) -> boolean() when
+ This::wxRegion(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
union(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=RegionT,ref=RegionRef}) ->
?CLASS(ThisT,wxRegion),
RegionOP = case ?CLASS_T(RegionT,wxRegion) of
@@ -242,15 +251,18 @@ union(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
wxe_util:call(?wxRegion_Union_1_2,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxRegion(), Bmp::wxBitmap:wxBitmap(), Transp::wx:colour()) -> bool()
%% @equiv union(This,Bmp,Transp, [])
+-spec union(This, Bmp, Transp) -> boolean() when
+ This::wxRegion(), Bmp::wxBitmap:wxBitmap(), Transp::wx:wx_colour().
+
union(This,Bmp,Transp)
when is_record(This, wx_ref),is_record(Bmp, wx_ref),tuple_size(Transp) =:= 3; tuple_size(Transp) =:= 4 ->
union(This,Bmp,Transp, []).
-%% @spec (This::wxRegion(), Bmp::wxBitmap:wxBitmap(), Transp::wx:colour(), [Option]) -> bool()
-%% Option = {tolerance, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionunion">external documentation</a>.
+-spec union(This, Bmp, Transp, [Option]) -> boolean() when
+ This::wxRegion(), Bmp::wxBitmap:wxBitmap(), Transp::wx:wx_colour(),
+ Option :: {tolerance, integer()}.
union(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BmpT,ref=BmpRef},Transp, Options)
when tuple_size(Transp) =:= 3; tuple_size(Transp) =:= 4,is_list(Options) ->
?CLASS(ThisT,wxRegion),
@@ -261,23 +273,24 @@ union(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BmpT,ref=BmpRef},Transp, Opti
wxe_util:call(?wxRegion_Union_3,
<<ThisRef:32/?UI,BmpRef:32/?UI,(wxe_util:colour_bin(Transp)):16/binary, BinOpt/binary>>).
-%% @spec (This::wxRegion(), X::integer(), Y::integer(), W::integer(), H::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionunion">external documentation</a>.
+-spec union(This, X, Y, W, H) -> boolean() when
+ This::wxRegion(), X::integer(), Y::integer(), W::integer(), H::integer().
union(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H)
when is_integer(X),is_integer(Y),is_integer(W),is_integer(H) ->
?CLASS(ThisT,wxRegion),
wxe_util:call(?wxRegion_Union_4,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,W:32/?UI,H:32/?UI>>).
-%% @spec (This::wxRegion(),X::wxRegion()|term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionxor">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% 'Xor'(This::wxRegion(), Region::wxRegion()) -> bool() </c>
-%% </p>
-%% <p><c>
-%% 'Xor'(This::wxRegion(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% 'Xor'(This, Rect) -> boolean() when<br />
+%% This::wxRegion(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.<br />
+%%
+-spec 'Xor'(This, Region) -> boolean() when
+ This::wxRegion(), Region::wxRegion();
+ (This, Rect) -> boolean() when
+ This::wxRegion(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
'Xor'(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=RegionT,ref=RegionRef}) ->
?CLASS(ThisT,wxRegion),
?CLASS(RegionT,wxRegion),
@@ -289,16 +302,17 @@ union(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H)
wxe_util:call(?wxRegion_Xor_1_1,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxRegion(), X::integer(), Y::integer(), W::integer(), H::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxregion.html#wxregionxor">external documentation</a>.
+-spec 'Xor'(This, X, Y, W, H) -> boolean() when
+ This::wxRegion(), X::integer(), Y::integer(), W::integer(), H::integer().
'Xor'(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H)
when is_integer(X),is_integer(Y),is_integer(W),is_integer(H) ->
?CLASS(ThisT,wxRegion),
wxe_util:call(?wxRegion_Xor_4,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,W:32/?UI,H:32/?UI>>).
-%% @spec (This::wxRegion()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxRegion()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxRegion),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxSashEvent.erl b/lib/wx/src/gen/wxSashEvent.erl
index f9c58a04b1..6ca4bf73ea 100644
--- a/lib/wx/src/gen/wxSashEvent.erl
+++ b/lib/wx/src/gen/wxSashEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -40,31 +40,34 @@
parent_class/1,resumePropagation/2,setInt/2,setString/2,shouldPropagate/1,
skip/1,skip/2,stopPropagation/1]).
+-export_type([wxSashEvent/0]).
%% @hidden
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxSashEvent()) -> WxSashEdgePosition
-%% WxSashEdgePosition = integer()
+-type wxSashEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashevent.html#wxsasheventgetedge">external documentation</a>.
-%%<br /> WxSashEdgePosition is one of ?wxSASH_TOP | ?wxSASH_RIGHT | ?wxSASH_BOTTOM | ?wxSASH_LEFT | ?wxSASH_NONE
+%%<br /> Res = ?wxSASH_TOP | ?wxSASH_RIGHT | ?wxSASH_BOTTOM | ?wxSASH_LEFT | ?wxSASH_NONE
+-spec getEdge(This) -> wx:wx_enum() when
+ This::wxSashEvent().
getEdge(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSashEvent),
wxe_util:call(?wxSashEvent_GetEdge,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSashEvent()) -> {X::integer(), Y::integer(), W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashevent.html#wxsasheventgetdragrect">external documentation</a>.
+-spec getDragRect(This) -> {X::integer(), Y::integer(), W::integer(), H::integer()} when
+ This::wxSashEvent().
getDragRect(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSashEvent),
wxe_util:call(?wxSashEvent_GetDragRect,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSashEvent()) -> WxSashDragStatus
-%% WxSashDragStatus = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashevent.html#wxsasheventgetdragstatus">external documentation</a>.
-%%<br /> WxSashDragStatus is one of ?wxSASH_STATUS_OK | ?wxSASH_STATUS_OUT_OF_RANGE
+%%<br /> Res = ?wxSASH_STATUS_OK | ?wxSASH_STATUS_OUT_OF_RANGE
+-spec getDragStatus(This) -> wx:wx_enum() when
+ This::wxSashEvent().
getDragStatus(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSashEvent),
wxe_util:call(?wxSashEvent_GetDragStatus,
diff --git a/lib/wx/src/gen/wxSashLayoutWindow.erl b/lib/wx/src/gen/wxSashLayoutWindow.erl
index eb8eb38011..f833f59479 100644
--- a/lib/wx/src/gen/wxSashLayoutWindow.erl
+++ b/lib/wx/src/gen/wxSashLayoutWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -74,27 +74,35 @@
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
validate/1,warpPointer/3]).
+-export_type([wxSashLayoutWindow/0]).
%% @hidden
parent_class(wxSashWindow) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxSashLayoutWindow()
+-type wxSashLayoutWindow() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashlayoutwindow.html#wxsashlayoutwindowwxsashlayoutwindow">external documentation</a>.
+-spec new() -> wxSashLayoutWindow().
new() ->
wxe_util:construct(?wxSashLayoutWindow_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxSashLayoutWindow()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxSashLayoutWindow() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxSashLayoutWindow()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashlayoutwindow.html#wxsashlayoutwindowwxsashlayoutwindow">external documentation</a>.
+-spec new(Parent, [Option]) -> wxSashLayoutWindow() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -107,15 +115,21 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxSashLayoutWindow_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSashLayoutWindow(), Parent::wxWindow:wxWindow()) -> bool()
%% @equiv create(This,Parent, [])
+-spec create(This, Parent) -> boolean() when
+ This::wxSashLayoutWindow(), Parent::wxWindow:wxWindow().
+
create(This,Parent)
when is_record(This, wx_ref),is_record(Parent, wx_ref) ->
create(This,Parent, []).
-%% @spec (This::wxSashLayoutWindow(), Parent::wxWindow:wxWindow(), [Option]) -> bool()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashlayoutwindow.html#wxsashlayoutwindowcreate">external documentation</a>.
+-spec create(This, Parent, [Option]) -> boolean() when
+ This::wxSashLayoutWindow(), Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxSashLayoutWindow),
@@ -129,54 +143,55 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Opti
wxe_util:call(?wxSashLayoutWindow_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxSashLayoutWindow()) -> WxLayoutAlignment
-%% WxLayoutAlignment = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashlayoutwindow.html#wxsashlayoutwindowgetalignment">external documentation</a>.
-%%<br /> WxLayoutAlignment is one of ?wxLAYOUT_NONE | ?wxLAYOUT_TOP | ?wxLAYOUT_LEFT | ?wxLAYOUT_RIGHT | ?wxLAYOUT_BOTTOM
+%%<br /> Res = ?wxLAYOUT_NONE | ?wxLAYOUT_TOP | ?wxLAYOUT_LEFT | ?wxLAYOUT_RIGHT | ?wxLAYOUT_BOTTOM
+-spec getAlignment(This) -> wx:wx_enum() when
+ This::wxSashLayoutWindow().
getAlignment(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSashLayoutWindow),
wxe_util:call(?wxSashLayoutWindow_GetAlignment,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSashLayoutWindow()) -> WxLayoutOrientation
-%% WxLayoutOrientation = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashlayoutwindow.html#wxsashlayoutwindowgetorientation">external documentation</a>.
-%%<br /> WxLayoutOrientation is one of ?wxLAYOUT_HORIZONTAL | ?wxLAYOUT_VERTICAL
+%%<br /> Res = ?wxLAYOUT_HORIZONTAL | ?wxLAYOUT_VERTICAL
+-spec getOrientation(This) -> wx:wx_enum() when
+ This::wxSashLayoutWindow().
getOrientation(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSashLayoutWindow),
wxe_util:call(?wxSashLayoutWindow_GetOrientation,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSashLayoutWindow(), Align::WxLayoutAlignment) -> ok
-%% WxLayoutAlignment = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashlayoutwindow.html#wxsashlayoutwindowsetalignment">external documentation</a>.
-%%<br /> WxLayoutAlignment is one of ?wxLAYOUT_NONE | ?wxLAYOUT_TOP | ?wxLAYOUT_LEFT | ?wxLAYOUT_RIGHT | ?wxLAYOUT_BOTTOM
+%%<br /> Align = ?wxLAYOUT_NONE | ?wxLAYOUT_TOP | ?wxLAYOUT_LEFT | ?wxLAYOUT_RIGHT | ?wxLAYOUT_BOTTOM
+-spec setAlignment(This, Align) -> ok when
+ This::wxSashLayoutWindow(), Align::wx:wx_enum().
setAlignment(#wx_ref{type=ThisT,ref=ThisRef},Align)
when is_integer(Align) ->
?CLASS(ThisT,wxSashLayoutWindow),
wxe_util:cast(?wxSashLayoutWindow_SetAlignment,
<<ThisRef:32/?UI,Align:32/?UI>>).
-%% @spec (This::wxSashLayoutWindow(), Size::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashlayoutwindow.html#wxsashlayoutwindowsetdefaultsize">external documentation</a>.
+-spec setDefaultSize(This, Size) -> ok when
+ This::wxSashLayoutWindow(), Size::{W::integer(), H::integer()}.
setDefaultSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxSashLayoutWindow),
wxe_util:cast(?wxSashLayoutWindow_SetDefaultSize,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxSashLayoutWindow(), Orient::WxLayoutOrientation) -> ok
-%% WxLayoutOrientation = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashlayoutwindow.html#wxsashlayoutwindowsetorientation">external documentation</a>.
-%%<br /> WxLayoutOrientation is one of ?wxLAYOUT_HORIZONTAL | ?wxLAYOUT_VERTICAL
+%%<br /> Orient = ?wxLAYOUT_HORIZONTAL | ?wxLAYOUT_VERTICAL
+-spec setOrientation(This, Orient) -> ok when
+ This::wxSashLayoutWindow(), Orient::wx:wx_enum().
setOrientation(#wx_ref{type=ThisT,ref=ThisRef},Orient)
when is_integer(Orient) ->
?CLASS(ThisT,wxSashLayoutWindow),
wxe_util:cast(?wxSashLayoutWindow_SetOrientation,
<<ThisRef:32/?UI,Orient:32/?UI>>).
-%% @spec (This::wxSashLayoutWindow()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxSashLayoutWindow()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxSashLayoutWindow),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxSashWindow.erl b/lib/wx/src/gen/wxSashWindow.erl
index 698cfb8fb6..7d85e05af8 100644
--- a/lib/wx/src/gen/wxSashWindow.erl
+++ b/lib/wx/src/gen/wxSashWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -70,26 +70,34 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxSashWindow/0]).
%% @hidden
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxSashWindow()
+-type wxSashWindow() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashwindow.html#wxsashwindowwxsashwindow">external documentation</a>.
+-spec new() -> wxSashWindow().
new() ->
wxe_util:construct(?wxSashWindow_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxSashWindow()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxSashWindow() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxSashWindow()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashwindow.html#wxsashwindowwxsashwindow">external documentation</a>.
+-spec new(Parent, [Option]) -> wxSashWindow() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -102,88 +110,96 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxSashWindow_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSashWindow(), Edge::WxSashEdgePosition) -> bool()
-%% WxSashEdgePosition = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashwindow.html#wxsashwindowgetsashvisible">external documentation</a>.
-%%<br /> WxSashEdgePosition is one of ?wxSASH_TOP | ?wxSASH_RIGHT | ?wxSASH_BOTTOM | ?wxSASH_LEFT | ?wxSASH_NONE
+%%<br /> Edge = ?wxSASH_TOP | ?wxSASH_RIGHT | ?wxSASH_BOTTOM | ?wxSASH_LEFT | ?wxSASH_NONE
+-spec getSashVisible(This, Edge) -> boolean() when
+ This::wxSashWindow(), Edge::wx:wx_enum().
getSashVisible(#wx_ref{type=ThisT,ref=ThisRef},Edge)
when is_integer(Edge) ->
?CLASS(ThisT,wxSashWindow),
wxe_util:call(?wxSashWindow_GetSashVisible,
<<ThisRef:32/?UI,Edge:32/?UI>>).
-%% @spec (This::wxSashWindow()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashwindow.html#wxsashwindowgetmaximumsizex">external documentation</a>.
+-spec getMaximumSizeX(This) -> integer() when
+ This::wxSashWindow().
getMaximumSizeX(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSashWindow),
wxe_util:call(?wxSashWindow_GetMaximumSizeX,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSashWindow()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashwindow.html#wxsashwindowgetmaximumsizey">external documentation</a>.
+-spec getMaximumSizeY(This) -> integer() when
+ This::wxSashWindow().
getMaximumSizeY(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSashWindow),
wxe_util:call(?wxSashWindow_GetMaximumSizeY,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSashWindow()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashwindow.html#wxsashwindowgetminimumsizex">external documentation</a>.
+-spec getMinimumSizeX(This) -> integer() when
+ This::wxSashWindow().
getMinimumSizeX(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSashWindow),
wxe_util:call(?wxSashWindow_GetMinimumSizeX,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSashWindow()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashwindow.html#wxsashwindowgetminimumsizey">external documentation</a>.
+-spec getMinimumSizeY(This) -> integer() when
+ This::wxSashWindow().
getMinimumSizeY(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSashWindow),
wxe_util:call(?wxSashWindow_GetMinimumSizeY,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSashWindow(), Max::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashwindow.html#wxsashwindowsetmaximumsizex">external documentation</a>.
+-spec setMaximumSizeX(This, Max) -> ok when
+ This::wxSashWindow(), Max::integer().
setMaximumSizeX(#wx_ref{type=ThisT,ref=ThisRef},Max)
when is_integer(Max) ->
?CLASS(ThisT,wxSashWindow),
wxe_util:cast(?wxSashWindow_SetMaximumSizeX,
<<ThisRef:32/?UI,Max:32/?UI>>).
-%% @spec (This::wxSashWindow(), Max::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashwindow.html#wxsashwindowsetmaximumsizey">external documentation</a>.
+-spec setMaximumSizeY(This, Max) -> ok when
+ This::wxSashWindow(), Max::integer().
setMaximumSizeY(#wx_ref{type=ThisT,ref=ThisRef},Max)
when is_integer(Max) ->
?CLASS(ThisT,wxSashWindow),
wxe_util:cast(?wxSashWindow_SetMaximumSizeY,
<<ThisRef:32/?UI,Max:32/?UI>>).
-%% @spec (This::wxSashWindow(), Min::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashwindow.html#wxsashwindowsetminimumsizex">external documentation</a>.
+-spec setMinimumSizeX(This, Min) -> ok when
+ This::wxSashWindow(), Min::integer().
setMinimumSizeX(#wx_ref{type=ThisT,ref=ThisRef},Min)
when is_integer(Min) ->
?CLASS(ThisT,wxSashWindow),
wxe_util:cast(?wxSashWindow_SetMinimumSizeX,
<<ThisRef:32/?UI,Min:32/?UI>>).
-%% @spec (This::wxSashWindow(), Min::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashwindow.html#wxsashwindowsetminimumsizey">external documentation</a>.
+-spec setMinimumSizeY(This, Min) -> ok when
+ This::wxSashWindow(), Min::integer().
setMinimumSizeY(#wx_ref{type=ThisT,ref=ThisRef},Min)
when is_integer(Min) ->
?CLASS(ThisT,wxSashWindow),
wxe_util:cast(?wxSashWindow_SetMinimumSizeY,
<<ThisRef:32/?UI,Min:32/?UI>>).
-%% @spec (This::wxSashWindow(), Edge::WxSashEdgePosition, Sash::bool()) -> ok
-%% WxSashEdgePosition = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsashwindow.html#wxsashwindowsetsashvisible">external documentation</a>.
-%%<br /> WxSashEdgePosition is one of ?wxSASH_TOP | ?wxSASH_RIGHT | ?wxSASH_BOTTOM | ?wxSASH_LEFT | ?wxSASH_NONE
+%%<br /> Edge = ?wxSASH_TOP | ?wxSASH_RIGHT | ?wxSASH_BOTTOM | ?wxSASH_LEFT | ?wxSASH_NONE
+-spec setSashVisible(This, Edge, Sash) -> ok when
+ This::wxSashWindow(), Edge::wx:wx_enum(), Sash::boolean().
setSashVisible(#wx_ref{type=ThisT,ref=ThisRef},Edge,Sash)
when is_integer(Edge),is_boolean(Sash) ->
?CLASS(ThisT,wxSashWindow),
wxe_util:cast(?wxSashWindow_SetSashVisible,
<<ThisRef:32/?UI,Edge:32/?UI,(wxe_util:from_bool(Sash)):32/?UI>>).
-%% @spec (This::wxSashWindow()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxSashWindow()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxSashWindow),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxScreenDC.erl b/lib/wx/src/gen/wxScreenDC.erl
index 4d7466f4f1..f9ab60d389 100644
--- a/lib/wx/src/gen/wxScreenDC.erl
+++ b/lib/wx/src/gen/wxScreenDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -38,10 +38,10 @@
drawPoint/2,drawPolygon/2,drawPolygon/3,drawRectangle/2,drawRectangle/3,
drawRotatedText/4,drawRoundedRectangle/3,drawRoundedRectangle/4,
drawText/3,endDoc/1,endPage/1,floodFill/3,floodFill/4,getBackground/1,
- getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/2,
+ getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/1,
getFont/1,getLayoutDirection/1,getLogicalFunction/1,getMapMode/1,
- getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/3,
- getPen/1,getPixel/3,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
+ getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/2,
+ getPen/1,getPixel/2,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
getTextExtent/3,getTextForeground/1,getUserScale/1,gradientFillConcentric/4,
gradientFillConcentric/5,gradientFillLinear/4,gradientFillLinear/5,
isOk/1,logicalToDeviceX/2,logicalToDeviceXRel/2,logicalToDeviceY/2,
@@ -52,18 +52,20 @@
setPen/2,setTextBackground/2,setTextForeground/2,setUserScale/3,startDoc/2,
startPage/1]).
+-export_type([wxScreenDC/0]).
%% @hidden
parent_class(wxDC) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxScreenDC()
+-type wxScreenDC() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscreendc.html#wxscreendcwxscreendc">external documentation</a>.
+-spec new() -> wxScreenDC().
new() ->
wxe_util:construct(?wxScreenDC_new,
<<>>).
-%% @spec (This::wxScreenDC()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxScreenDC()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxScreenDC),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
@@ -150,11 +152,11 @@ getSize(This) -> wxDC:getSize(This).
%% @hidden
getPPI(This) -> wxDC:getPPI(This).
%% @hidden
-getPixel(This,Pt,Col) -> wxDC:getPixel(This,Pt,Col).
+getPixel(This,Pt) -> wxDC:getPixel(This,Pt).
%% @hidden
getPen(This) -> wxDC:getPen(This).
%% @hidden
-getPartialTextExtents(This,Text,Widths) -> wxDC:getPartialTextExtents(This,Text,Widths).
+getPartialTextExtents(This,Text) -> wxDC:getPartialTextExtents(This,Text).
%% @hidden
getMultiLineTextExtent(This,String, Options) -> wxDC:getMultiLineTextExtent(This,String, Options).
%% @hidden
@@ -168,7 +170,7 @@ getLayoutDirection(This) -> wxDC:getLayoutDirection(This).
%% @hidden
getFont(This) -> wxDC:getFont(This).
%% @hidden
-getClippingBox(This,Rect) -> wxDC:getClippingBox(This,Rect).
+getClippingBox(This) -> wxDC:getClippingBox(This).
%% @hidden
getCharWidth(This) -> wxDC:getCharWidth(This).
%% @hidden
diff --git a/lib/wx/src/gen/wxScrollBar.erl b/lib/wx/src/gen/wxScrollBar.erl
index 5c7890009f..4370bd1635 100644
--- a/lib/wx/src/gen/wxScrollBar.erl
+++ b/lib/wx/src/gen/wxScrollBar.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -70,27 +70,35 @@
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
validate/1,warpPointer/3]).
+-export_type([wxScrollBar/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxScrollBar()
+-type wxScrollBar() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrollbar.html#wxscrollbarwxscrollbar">external documentation</a>.
+-spec new() -> wxScrollBar().
new() ->
wxe_util:construct(?wxScrollBar_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxScrollBar()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxScrollBar() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxScrollBar()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrollbar.html#wxscrollbarwxscrollbar">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxScrollBar() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -103,15 +111,21 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxScrollBar_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxScrollBar(), Parent::wxWindow:wxWindow(), Id::integer()) -> bool()
%% @equiv create(This,Parent,Id, [])
+-spec create(This, Parent, Id) -> boolean() when
+ This::wxScrollBar(), Parent::wxWindow:wxWindow(), Id::integer().
+
create(This,Parent,Id)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id) ->
create(This,Parent,Id, []).
-%% @spec (This::wxScrollBar(), Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrollbar.html#wxscrollbarcreate">external documentation</a>.
+-spec create(This, Parent, Id, [Option]) -> boolean() when
+ This::wxScrollBar(), Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ThisT,wxScrollBar),
@@ -125,51 +139,59 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, O
wxe_util:call(?wxScrollBar_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxScrollBar()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrollbar.html#wxscrollbargetrange">external documentation</a>.
+-spec getRange(This) -> integer() when
+ This::wxScrollBar().
getRange(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxScrollBar),
wxe_util:call(?wxScrollBar_GetRange,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxScrollBar()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrollbar.html#wxscrollbargetpagesize">external documentation</a>.
+-spec getPageSize(This) -> integer() when
+ This::wxScrollBar().
getPageSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxScrollBar),
wxe_util:call(?wxScrollBar_GetPageSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxScrollBar()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrollbar.html#wxscrollbargetthumbposition">external documentation</a>.
+-spec getThumbPosition(This) -> integer() when
+ This::wxScrollBar().
getThumbPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxScrollBar),
wxe_util:call(?wxScrollBar_GetThumbPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxScrollBar()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrollbar.html#wxscrollbargetthumbsize">external documentation</a>.
+-spec getThumbSize(This) -> integer() when
+ This::wxScrollBar().
getThumbSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxScrollBar),
wxe_util:call(?wxScrollBar_GetThumbSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxScrollBar(), ViewStart::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrollbar.html#wxscrollbarsetthumbposition">external documentation</a>.
+-spec setThumbPosition(This, ViewStart) -> ok when
+ This::wxScrollBar(), ViewStart::integer().
setThumbPosition(#wx_ref{type=ThisT,ref=ThisRef},ViewStart)
when is_integer(ViewStart) ->
?CLASS(ThisT,wxScrollBar),
wxe_util:cast(?wxScrollBar_SetThumbPosition,
<<ThisRef:32/?UI,ViewStart:32/?UI>>).
-%% @spec (This::wxScrollBar(), Position::integer(), ThumbSize::integer(), Range::integer(), PageSize::integer()) -> ok
%% @equiv setScrollbar(This,Position,ThumbSize,Range,PageSize, [])
+-spec setScrollbar(This, Position, ThumbSize, Range, PageSize) -> ok when
+ This::wxScrollBar(), Position::integer(), ThumbSize::integer(), Range::integer(), PageSize::integer().
+
setScrollbar(This,Position,ThumbSize,Range,PageSize)
when is_record(This, wx_ref),is_integer(Position),is_integer(ThumbSize),is_integer(Range),is_integer(PageSize) ->
setScrollbar(This,Position,ThumbSize,Range,PageSize, []).
-%% @spec (This::wxScrollBar(), Position::integer(), ThumbSize::integer(), Range::integer(), PageSize::integer(), [Option]) -> ok
-%% Option = {refresh, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrollbar.html#wxscrollbarsetscrollbar">external documentation</a>.
+-spec setScrollbar(This, Position, ThumbSize, Range, PageSize, [Option]) -> ok when
+ This::wxScrollBar(), Position::integer(), ThumbSize::integer(), Range::integer(), PageSize::integer(),
+ Option :: {refresh, boolean()}.
setScrollbar(#wx_ref{type=ThisT,ref=ThisRef},Position,ThumbSize,Range,PageSize, Options)
when is_integer(Position),is_integer(ThumbSize),is_integer(Range),is_integer(PageSize),is_list(Options) ->
?CLASS(ThisT,wxScrollBar),
@@ -179,8 +201,8 @@ setScrollbar(#wx_ref{type=ThisT,ref=ThisRef},Position,ThumbSize,Range,PageSize,
wxe_util:cast(?wxScrollBar_SetScrollbar,
<<ThisRef:32/?UI,Position:32/?UI,ThumbSize:32/?UI,Range:32/?UI,PageSize:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxScrollBar()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxScrollBar()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxScrollBar),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxScrollEvent.erl b/lib/wx/src/gen/wxScrollEvent.erl
index 61b99fa360..6939859d92 100644
--- a/lib/wx/src/gen/wxScrollEvent.erl
+++ b/lib/wx/src/gen/wxScrollEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -40,20 +40,24 @@
parent_class/1,resumePropagation/2,setInt/2,setString/2,shouldPropagate/1,
skip/1,skip/2,stopPropagation/1]).
+-export_type([wxScrollEvent/0]).
%% @hidden
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxScrollEvent()) -> integer()
+-type wxScrollEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrollevent.html#wxscrolleventgetorientation">external documentation</a>.
+-spec getOrientation(This) -> integer() when
+ This::wxScrollEvent().
getOrientation(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxScrollEvent),
wxe_util:call(?wxScrollEvent_GetOrientation,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxScrollEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrollevent.html#wxscrolleventgetposition">external documentation</a>.
+-spec getPosition(This) -> integer() when
+ This::wxScrollEvent().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxScrollEvent),
wxe_util:call(?wxScrollEvent_GetPosition,
diff --git a/lib/wx/src/gen/wxScrollWinEvent.erl b/lib/wx/src/gen/wxScrollWinEvent.erl
index 6b33b6b564..c899d37dff 100644
--- a/lib/wx/src/gen/wxScrollWinEvent.erl
+++ b/lib/wx/src/gen/wxScrollWinEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,19 +37,23 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxScrollWinEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxScrollWinEvent()) -> integer()
+-type wxScrollWinEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrollwinevent.html#wxscrollwineventgetorientation">external documentation</a>.
+-spec getOrientation(This) -> integer() when
+ This::wxScrollWinEvent().
getOrientation(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxScrollWinEvent),
wxe_util:call(?wxScrollWinEvent_GetOrientation,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxScrollWinEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrollwinevent.html#wxscrollwineventgetposition">external documentation</a>.
+-spec getPosition(This) -> integer() when
+ This::wxScrollWinEvent().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxScrollWinEvent),
wxe_util:call(?wxScrollWinEvent_GetPosition,
diff --git a/lib/wx/src/gen/wxScrolledWindow.erl b/lib/wx/src/gen/wxScrolledWindow.erl
index 0693a79760..9141487a8c 100644
--- a/lib/wx/src/gen/wxScrolledWindow.erl
+++ b/lib/wx/src/gen/wxScrolledWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -72,27 +72,35 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxScrolledWindow/0]).
%% @hidden
parent_class(wxPanel) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxScrolledWindow()
+-type wxScrolledWindow() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrolledwindow.html#wxscrolledwindowwxscrolledwindow">external documentation</a>.
+-spec new() -> wxScrolledWindow().
new() ->
wxe_util:construct(?wxScrolledWindow_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxScrolledWindow()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxScrolledWindow() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxScrolledWindow()
-%% Option = {winid, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrolledwindow.html#wxscrolledwindowwxscrolledwindow">external documentation</a>.
+-spec new(Parent, [Option]) -> wxScrolledWindow() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {winid, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -105,93 +113,108 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxScrolledWindow_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxScrolledWindow(), Pt::{X::integer(), Y::integer()}) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrolledwindow.html#wxscrolledwindowcalcscrolledposition">external documentation</a>.
+-spec calcScrolledPosition(This, Pt) -> {X::integer(), Y::integer()} when
+ This::wxScrolledWindow(), Pt::{X::integer(), Y::integer()}.
calcScrolledPosition(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxScrolledWindow),
wxe_util:call(?wxScrolledWindow_CalcScrolledPosition_1,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxScrolledWindow(), X::integer(), Y::integer()) -> {Xx::integer(), Yy::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrolledwindow.html#wxscrolledwindowcalcscrolledposition">external documentation</a>.
+-spec calcScrolledPosition(This, X, Y) -> {Xx::integer(), Yy::integer()} when
+ This::wxScrolledWindow(), X::integer(), Y::integer().
calcScrolledPosition(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxScrolledWindow),
wxe_util:call(?wxScrolledWindow_CalcScrolledPosition_4,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxScrolledWindow(), Pt::{X::integer(), Y::integer()}) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrolledwindow.html#wxscrolledwindowcalcunscrolledposition">external documentation</a>.
+-spec calcUnscrolledPosition(This, Pt) -> {X::integer(), Y::integer()} when
+ This::wxScrolledWindow(), Pt::{X::integer(), Y::integer()}.
calcUnscrolledPosition(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxScrolledWindow),
wxe_util:call(?wxScrolledWindow_CalcUnscrolledPosition_1,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxScrolledWindow(), X::integer(), Y::integer()) -> {Xx::integer(), Yy::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrolledwindow.html#wxscrolledwindowcalcunscrolledposition">external documentation</a>.
+-spec calcUnscrolledPosition(This, X, Y) -> {Xx::integer(), Yy::integer()} when
+ This::wxScrolledWindow(), X::integer(), Y::integer().
calcUnscrolledPosition(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxScrolledWindow),
wxe_util:call(?wxScrolledWindow_CalcUnscrolledPosition_4,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxScrolledWindow(), X_scrolling::bool(), Y_scrolling::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrolledwindow.html#wxscrolledwindowenablescrolling">external documentation</a>.
+-spec enableScrolling(This, X_scrolling, Y_scrolling) -> ok when
+ This::wxScrolledWindow(), X_scrolling::boolean(), Y_scrolling::boolean().
enableScrolling(#wx_ref{type=ThisT,ref=ThisRef},X_scrolling,Y_scrolling)
when is_boolean(X_scrolling),is_boolean(Y_scrolling) ->
?CLASS(ThisT,wxScrolledWindow),
wxe_util:cast(?wxScrolledWindow_EnableScrolling,
<<ThisRef:32/?UI,(wxe_util:from_bool(X_scrolling)):32/?UI,(wxe_util:from_bool(Y_scrolling)):32/?UI>>).
-%% @spec (This::wxScrolledWindow()) -> {PixelsPerUnitX::integer(), PixelsPerUnitY::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrolledwindow.html#wxscrolledwindowgetscrollpixelsperunit">external documentation</a>.
+-spec getScrollPixelsPerUnit(This) -> {PixelsPerUnitX::integer(), PixelsPerUnitY::integer()} when
+ This::wxScrolledWindow().
getScrollPixelsPerUnit(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxScrolledWindow),
wxe_util:call(?wxScrolledWindow_GetScrollPixelsPerUnit,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxScrolledWindow()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrolledwindow.html#wxscrolledwindowgetviewstart">external documentation</a>.
+-spec getViewStart(This) -> {X::integer(), Y::integer()} when
+ This::wxScrolledWindow().
getViewStart(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxScrolledWindow),
wxe_util:call(?wxScrolledWindow_GetViewStart,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxScrolledWindow(), Dc::wxDC:wxDC()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrolledwindow.html#wxscrolledwindowdopreparedc">external documentation</a>.
+-spec doPrepareDC(This, Dc) -> ok when
+ This::wxScrolledWindow(), Dc::wxDC:wxDC().
doPrepareDC(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DcT,ref=DcRef}) ->
?CLASS(ThisT,wxScrolledWindow),
?CLASS(DcT,wxDC),
wxe_util:cast(?wxScrolledWindow_DoPrepareDC,
<<ThisRef:32/?UI,DcRef:32/?UI>>).
-%% @spec (This::wxScrolledWindow(), Dc::wxDC:wxDC()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrolledwindow.html#wxscrolledwindowpreparedc">external documentation</a>.
+-spec prepareDC(This, Dc) -> ok when
+ This::wxScrolledWindow(), Dc::wxDC:wxDC().
prepareDC(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DcT,ref=DcRef}) ->
?CLASS(ThisT,wxScrolledWindow),
?CLASS(DcT,wxDC),
wxe_util:cast(?wxScrolledWindow_PrepareDC,
<<ThisRef:32/?UI,DcRef:32/?UI>>).
-%% @spec (This::wxScrolledWindow(), X::integer(), Y::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrolledwindow.html#wxscrolledwindowscroll">external documentation</a>.
+-spec scroll(This, X, Y) -> ok when
+ This::wxScrolledWindow(), X::integer(), Y::integer().
scroll(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxScrolledWindow),
wxe_util:cast(?wxScrolledWindow_Scroll,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxScrolledWindow(), PixelsPerUnitX::integer(), PixelsPerUnitY::integer(), NoUnitsX::integer(), NoUnitsY::integer()) -> ok
%% @equiv setScrollbars(This,PixelsPerUnitX,PixelsPerUnitY,NoUnitsX,NoUnitsY, [])
+-spec setScrollbars(This, PixelsPerUnitX, PixelsPerUnitY, NoUnitsX, NoUnitsY) -> ok when
+ This::wxScrolledWindow(), PixelsPerUnitX::integer(), PixelsPerUnitY::integer(), NoUnitsX::integer(), NoUnitsY::integer().
+
setScrollbars(This,PixelsPerUnitX,PixelsPerUnitY,NoUnitsX,NoUnitsY)
when is_record(This, wx_ref),is_integer(PixelsPerUnitX),is_integer(PixelsPerUnitY),is_integer(NoUnitsX),is_integer(NoUnitsY) ->
setScrollbars(This,PixelsPerUnitX,PixelsPerUnitY,NoUnitsX,NoUnitsY, []).
-%% @spec (This::wxScrolledWindow(), PixelsPerUnitX::integer(), PixelsPerUnitY::integer(), NoUnitsX::integer(), NoUnitsY::integer(), [Option]) -> ok
-%% Option = {xPos, integer()} | {yPos, integer()} | {noRefresh, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrolledwindow.html#wxscrolledwindowsetscrollbars">external documentation</a>.
+-spec setScrollbars(This, PixelsPerUnitX, PixelsPerUnitY, NoUnitsX, NoUnitsY, [Option]) -> ok when
+ This::wxScrolledWindow(), PixelsPerUnitX::integer(), PixelsPerUnitY::integer(), NoUnitsX::integer(), NoUnitsY::integer(),
+ Option :: {xPos, integer()}
+ | {yPos, integer()}
+ | {noRefresh, boolean()}.
setScrollbars(#wx_ref{type=ThisT,ref=ThisRef},PixelsPerUnitX,PixelsPerUnitY,NoUnitsX,NoUnitsY, Options)
when is_integer(PixelsPerUnitX),is_integer(PixelsPerUnitY),is_integer(NoUnitsX),is_integer(NoUnitsY),is_list(Options) ->
?CLASS(ThisT,wxScrolledWindow),
@@ -203,24 +226,26 @@ setScrollbars(#wx_ref{type=ThisT,ref=ThisRef},PixelsPerUnitX,PixelsPerUnitY,NoUn
wxe_util:cast(?wxScrolledWindow_SetScrollbars,
<<ThisRef:32/?UI,PixelsPerUnitX:32/?UI,PixelsPerUnitY:32/?UI,NoUnitsX:32/?UI,NoUnitsY:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxScrolledWindow(), Xstep::integer(), Ystep::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrolledwindow.html#wxscrolledwindowsetscrollrate">external documentation</a>.
+-spec setScrollRate(This, Xstep, Ystep) -> ok when
+ This::wxScrolledWindow(), Xstep::integer(), Ystep::integer().
setScrollRate(#wx_ref{type=ThisT,ref=ThisRef},Xstep,Ystep)
when is_integer(Xstep),is_integer(Ystep) ->
?CLASS(ThisT,wxScrolledWindow),
wxe_util:cast(?wxScrolledWindow_SetScrollRate,
<<ThisRef:32/?UI,Xstep:32/?UI,Ystep:32/?UI>>).
-%% @spec (This::wxScrolledWindow(), Target::wxWindow:wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxscrolledwindow.html#wxscrolledwindowsettargetwindow">external documentation</a>.
+-spec setTargetWindow(This, Target) -> ok when
+ This::wxScrolledWindow(), Target::wxWindow:wxWindow().
setTargetWindow(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=TargetT,ref=TargetRef}) ->
?CLASS(ThisT,wxScrolledWindow),
?CLASS(TargetT,wxWindow),
wxe_util:cast(?wxScrolledWindow_SetTargetWindow,
<<ThisRef:32/?UI,TargetRef:32/?UI>>).
-%% @spec (This::wxScrolledWindow()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxScrolledWindow()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxScrolledWindow),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxSetCursorEvent.erl b/lib/wx/src/gen/wxSetCursorEvent.erl
index 75a41eb6ad..23ff963001 100644
--- a/lib/wx/src/gen/wxSetCursorEvent.erl
+++ b/lib/wx/src/gen/wxSetCursorEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,40 +37,47 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxSetCursorEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxSetCursorEvent()) -> wxCursor:wxCursor()
+-type wxSetCursorEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsetcursorevent.html#wxsetcursoreventgetcursor">external documentation</a>.
+-spec getCursor(This) -> wxCursor:wxCursor() when
+ This::wxSetCursorEvent().
getCursor(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSetCursorEvent),
wxe_util:call(?wxSetCursorEvent_GetCursor,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSetCursorEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsetcursorevent.html#wxsetcursoreventgetx">external documentation</a>.
+-spec getX(This) -> integer() when
+ This::wxSetCursorEvent().
getX(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSetCursorEvent),
wxe_util:call(?wxSetCursorEvent_GetX,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSetCursorEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsetcursorevent.html#wxsetcursoreventgety">external documentation</a>.
+-spec getY(This) -> integer() when
+ This::wxSetCursorEvent().
getY(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSetCursorEvent),
wxe_util:call(?wxSetCursorEvent_GetY,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSetCursorEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsetcursorevent.html#wxsetcursoreventhascursor">external documentation</a>.
+-spec hasCursor(This) -> boolean() when
+ This::wxSetCursorEvent().
hasCursor(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSetCursorEvent),
wxe_util:call(?wxSetCursorEvent_HasCursor,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSetCursorEvent(), Cursor::wxCursor:wxCursor()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsetcursorevent.html#wxsetcursoreventsetcursor">external documentation</a>.
+-spec setCursor(This, Cursor) -> ok when
+ This::wxSetCursorEvent(), Cursor::wxCursor:wxCursor().
setCursor(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=CursorT,ref=CursorRef}) ->
?CLASS(ThisT,wxSetCursorEvent),
?CLASS(CursorT,wxCursor),
diff --git a/lib/wx/src/gen/wxShowEvent.erl b/lib/wx/src/gen/wxShowEvent.erl
index 7d5c8300d3..ffafa0978f 100644
--- a/lib/wx/src/gen/wxShowEvent.erl
+++ b/lib/wx/src/gen/wxShowEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,20 +37,24 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxShowEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxShowEvent(), Show::bool()) -> ok
+-type wxShowEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxshowevent.html#wxshoweventsetshow">external documentation</a>.
+-spec setShow(This, Show) -> ok when
+ This::wxShowEvent(), Show::boolean().
setShow(#wx_ref{type=ThisT,ref=ThisRef},Show)
when is_boolean(Show) ->
?CLASS(ThisT,wxShowEvent),
wxe_util:cast(?wxShowEvent_SetShow,
<<ThisRef:32/?UI,(wxe_util:from_bool(Show)):32/?UI>>).
-%% @spec (This::wxShowEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxshowevent.html#wxshoweventgetshow">external documentation</a>.
+-spec getShow(This) -> boolean() when
+ This::wxShowEvent().
getShow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxShowEvent),
wxe_util:call(?wxShowEvent_GetShow,
diff --git a/lib/wx/src/gen/wxSingleChoiceDialog.erl b/lib/wx/src/gen/wxSingleChoiceDialog.erl
index e2b835917e..db6b41ae75 100644
--- a/lib/wx/src/gen/wxSingleChoiceDialog.erl
+++ b/lib/wx/src/gen/wxSingleChoiceDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -77,6 +77,7 @@
transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxSingleChoiceDialog/0]).
%% @hidden
parent_class(wxDialog) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -84,21 +85,26 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxSingleChoiceDialog()
+-type wxSingleChoiceDialog() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsinglechoicedialog.html#wxsinglechoicedialogwxsinglechoicedialog">external documentation</a>.
+-spec new() -> wxSingleChoiceDialog().
new() ->
wxe_util:construct(?wxSingleChoiceDialog_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Message::string(), Caption::string(), Choices::[[string()]]) -> wxSingleChoiceDialog()
%% @equiv new(Parent,Message,Caption,Choices, [])
+-spec new(Parent, Message, Caption, Choices) -> wxSingleChoiceDialog() when
+ Parent::wxWindow:wxWindow(), Message::unicode:chardata(), Caption::unicode:chardata(), Choices::[unicode:chardata()].
+
new(Parent,Message,Caption,Choices)
when is_record(Parent, wx_ref),is_list(Message),is_list(Caption),is_list(Choices) ->
new(Parent,Message,Caption,Choices, []).
-%% @spec (Parent::wxWindow:wxWindow(), Message::string(), Caption::string(), Choices::[[string()]], [Option]) -> wxSingleChoiceDialog()
-%% Option = {style, integer()} | {pos, {X::integer(), Y::integer()}}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsinglechoicedialog.html#wxsinglechoicedialogwxsinglechoicedialog">external documentation</a>.
+-spec new(Parent, Message, Caption, Choices, [Option]) -> wxSingleChoiceDialog() when
+ Parent::wxWindow:wxWindow(), Message::unicode:chardata(), Caption::unicode:chardata(), Choices::[unicode:chardata()],
+ Option :: {style, integer()}
+ | {pos, {X::integer(), Y::integer()}}.
new(#wx_ref{type=ParentT,ref=ParentRef},Message,Caption,Choices, Options)
when is_list(Message),is_list(Caption),is_list(Choices),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -113,30 +119,33 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Message,Caption,Choices, Options)
wxe_util:construct(?wxSingleChoiceDialog_new_5,
<<ParentRef:32/?UI,(byte_size(Message_UC)):32/?UI,(Message_UC)/binary, 0:(((8- ((0+byte_size(Message_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Caption_UC)):32/?UI,(Caption_UC)/binary, 0:(((8- ((4+byte_size(Caption_UC)) band 16#7)) band 16#7))/unit:8,(length(Choices_UCA)):32/?UI, (<< <<(byte_size(UC_Str)):32/?UI, UC_Str/binary>>|| UC_Str <- Choices_UCA>>)/binary, 0:(((8- ((4 + lists:sum([byte_size(S)+4||S<-Choices_UCA])) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxSingleChoiceDialog()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsinglechoicedialog.html#wxsinglechoicedialoggetselection">external documentation</a>.
+-spec getSelection(This) -> integer() when
+ This::wxSingleChoiceDialog().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSingleChoiceDialog),
wxe_util:call(?wxSingleChoiceDialog_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSingleChoiceDialog()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsinglechoicedialog.html#wxsinglechoicedialoggetstringselection">external documentation</a>.
+-spec getStringSelection(This) -> unicode:charlist() when
+ This::wxSingleChoiceDialog().
getStringSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSingleChoiceDialog),
wxe_util:call(?wxSingleChoiceDialog_GetStringSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSingleChoiceDialog(), Sel::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsinglechoicedialog.html#wxsinglechoicedialogsetselection">external documentation</a>.
+-spec setSelection(This, Sel) -> ok when
+ This::wxSingleChoiceDialog(), Sel::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},Sel)
when is_integer(Sel) ->
?CLASS(ThisT,wxSingleChoiceDialog),
wxe_util:cast(?wxSingleChoiceDialog_SetSelection,
<<ThisRef:32/?UI,Sel:32/?UI>>).
-%% @spec (This::wxSingleChoiceDialog()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxSingleChoiceDialog()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxSingleChoiceDialog),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxSizeEvent.erl b/lib/wx/src/gen/wxSizeEvent.erl
index 0898f4aed9..c51e48bc59 100644
--- a/lib/wx/src/gen/wxSizeEvent.erl
+++ b/lib/wx/src/gen/wxSizeEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,12 +37,15 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxSizeEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxSizeEvent()) -> {W::integer(), H::integer()}
+-type wxSizeEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeevent.html#wxsizeeventgetsize">external documentation</a>.
+-spec getSize(This) -> {W::integer(), H::integer()} when
+ This::wxSizeEvent().
getSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizeEvent),
wxe_util:call(?wxSizeEvent_GetSize,
diff --git a/lib/wx/src/gen/wxSizer.erl b/lib/wx/src/gen/wxSizer.erl
index 0f1a92f379..7edc01aa2a 100644
--- a/lib/wx/src/gen/wxSizer.erl
+++ b/lib/wx/src/gen/wxSizer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -36,27 +36,40 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxSizer/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer()) -> wxSizerItem:wxSizerItem()
+-type wxSizer() :: wx:wx_object().
%% @equiv add(This,Window, [])
+-spec add(This, Window) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer().
+
add(This,Window)
when is_record(This, wx_ref),is_record(Window, wx_ref) ->
add(This,Window, []).
-%% @spec (This::wxSizer(),X::integer()|term(),X::integer()|term()) -> wxSizerItem:wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizeradd">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% add(This::wxSizer(), Width::integer(), Height::integer()) -> add(This,Width,Height, []) </c></p>
-%% <p><c>
-%% add(This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), [Option]) -> wxSizerItem:wxSizerItem() </c>
-%%<br /> Option = {proportion, integer()} | {flag, integer()} | {border, integer()} | {userData, wx:wx()}
-%% </p>
-%% <p><c>
-%% add(This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), Flags::wxSizerFlags:wxSizerFlags()) -> wxSizerItem:wxSizerItem() </c>
-%% </p>
+%% <br /> Also:<br />
+%% add(This, Window, [Option]) -> wxSizerItem:wxSizerItem() when<br />
+%% This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(),<br />
+%% Option :: {proportion, integer()}<br />
+%% | {flag, integer()}<br />
+%% | {border, integer()}<br />
+%% | {userData, wx:wx_object()};<br />
+%% (This, Window, Flags) -> wxSizerItem:wxSizerItem() when<br />
+%% This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), Flags::wxSizerFlags:wxSizerFlags().<br />
+%%
+-spec add(This, Width, Height) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Width::integer(), Height::integer();
+ (This, Window, [Option]) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(),
+ Option :: {proportion, integer()}
+ | {flag, integer()}
+ | {border, integer()}
+ | {userData, wx:wx_object()};
+ (This, Window, Flags) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), Flags::wxSizerFlags:wxSizerFlags().
add(This,Width,Height)
when is_record(This, wx_ref),is_integer(Width),is_integer(Height) ->
@@ -91,9 +104,13 @@ add(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef},#wx_ref{
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,WindowRef:32/?UI,FlagsRef:32/?UI>>).
-%% @spec (This::wxSizer(), Width::integer(), Height::integer(), [Option]) -> wxSizerItem:wxSizerItem()
-%% Option = {proportion, integer()} | {flag, integer()} | {border, integer()} | {userData, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizeradd">external documentation</a>.
+-spec add(This, Width, Height, [Option]) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Width::integer(), Height::integer(),
+ Option :: {proportion, integer()}
+ | {flag, integer()}
+ | {border, integer()}
+ | {userData, wx:wx_object()}.
add(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
when is_integer(Width),is_integer(Height),is_list(Options) ->
?CLASS(ThisT,wxSizer),
@@ -106,23 +123,27 @@ add(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
wxe_util:call(?wxSizer_Add_3,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSizer(), Size::integer()) -> wxSizerItem:wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizeraddspacer">external documentation</a>.
+-spec addSpacer(This, Size) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Size::integer().
addSpacer(#wx_ref{type=ThisT,ref=ThisRef},Size)
when is_integer(Size) ->
?CLASS(ThisT,wxSizer),
wxe_util:call(?wxSizer_AddSpacer,
<<ThisRef:32/?UI,Size:32/?UI>>).
-%% @spec (This::wxSizer()) -> wxSizerItem:wxSizerItem()
%% @equiv addStretchSpacer(This, [])
+-spec addStretchSpacer(This) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer().
+
addStretchSpacer(This)
when is_record(This, wx_ref) ->
addStretchSpacer(This, []).
-%% @spec (This::wxSizer(), [Option]) -> wxSizerItem:wxSizerItem()
-%% Option = {prop, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizeraddstretchspacer">external documentation</a>.
+-spec addStretchSpacer(This, [Option]) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(),
+ Option :: {prop, integer()}.
addStretchSpacer(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxSizer),
@@ -132,22 +153,26 @@ addStretchSpacer(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxSizer_AddStretchSpacer,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSizer()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizercalcmin">external documentation</a>.
+-spec calcMin(This) -> {W::integer(), H::integer()} when
+ This::wxSizer().
calcMin(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizer),
wxe_util:call(?wxSizer_CalcMin,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizer()) -> ok
%% @equiv clear(This, [])
+-spec clear(This) -> ok when
+ This::wxSizer().
+
clear(This)
when is_record(This, wx_ref) ->
clear(This, []).
-%% @spec (This::wxSizer(), [Option]) -> ok
-%% Option = {delete_windows, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerclear">external documentation</a>.
+-spec clear(This, [Option]) -> ok when
+ This::wxSizer(),
+ Option :: {delete_windows, boolean()}.
clear(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxSizer),
@@ -157,15 +182,15 @@ clear(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxSizer_Clear,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSizer(),X::integer()|term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerdetach">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% detach(This::wxSizer(), Index::integer()) -> bool() </c>
-%% </p>
-%% <p><c>
-%% detach(This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer()) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% detach(This, Window) -> boolean() when<br />
+%% This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer().<br />
+%%
+-spec detach(This, Index) -> boolean() when
+ This::wxSizer(), Index::integer();
+ (This, Window) -> boolean() when
+ This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer().
detach(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxSizer),
@@ -182,37 +207,41 @@ detach(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}) ->
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,WindowRef:32/?UI>>).
-%% @spec (This::wxSizer(), Window::wxWindow:wxWindow()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerfit">external documentation</a>.
+-spec fit(This, Window) -> {W::integer(), H::integer()} when
+ This::wxSizer(), Window::wxWindow:wxWindow().
fit(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}) ->
?CLASS(ThisT,wxSizer),
?CLASS(WindowT,wxWindow),
wxe_util:call(?wxSizer_Fit,
<<ThisRef:32/?UI,WindowRef:32/?UI>>).
-%% @spec (This::wxSizer(), Window::wxWindow:wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerfitinside">external documentation</a>.
+-spec fitInside(This, Window) -> ok when
+ This::wxSizer(), Window::wxWindow:wxWindow().
fitInside(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}) ->
?CLASS(ThisT,wxSizer),
?CLASS(WindowT,wxWindow),
wxe_util:cast(?wxSizer_FitInside,
<<ThisRef:32/?UI,WindowRef:32/?UI>>).
-%% @spec (This::wxSizer()) -> [wxSizerItem:wxSizerItem()]
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizergetchildren">external documentation</a>.
+-spec getChildren(This) -> [wxSizerItem:wxSizerItem()] when
+ This::wxSizer().
getChildren(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizer),
wxe_util:call(?wxSizer_GetChildren,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizer(),X::term()|integer()) -> wxSizerItem:wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizergetitem">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% getItem(This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer()) -> getItem(This,Window, []) </c></p>
-%% <p><c>
-%% getItem(This::wxSizer(), Index::integer()) -> wxSizerItem:wxSizerItem() </c>
-%% </p>
+%% <br /> Also:<br />
+%% getItem(This, Index) -> wxSizerItem:wxSizerItem() when<br />
+%% This::wxSizer(), Index::integer().<br />
+%%
+-spec getItem(This, Window) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer();
+ (This, Index) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Index::integer().
getItem(This,Window)
when is_record(This, wx_ref),is_record(Window, wx_ref) ->
@@ -223,9 +252,10 @@ getItem(#wx_ref{type=ThisT,ref=ThisRef},Index)
wxe_util:call(?wxSizer_GetItem_1,
<<ThisRef:32/?UI,Index:32/?UI>>).
-%% @spec (This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), [Option]) -> wxSizerItem:wxSizerItem()
-%% Option = {recursive, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizergetitem">external documentation</a>.
+-spec getItem(This, Window, [Option]) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(),
+ Option :: {recursive, boolean()}.
getItem(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxSizer),
@@ -241,35 +271,39 @@ getItem(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}, Opt
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,WindowRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxSizer()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizergetsize">external documentation</a>.
+-spec getSize(This) -> {W::integer(), H::integer()} when
+ This::wxSizer().
getSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizer),
wxe_util:call(?wxSizer_GetSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizer()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizergetposition">external documentation</a>.
+-spec getPosition(This) -> {X::integer(), Y::integer()} when
+ This::wxSizer().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizer),
wxe_util:call(?wxSizer_GetPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizer()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizergetminsize">external documentation</a>.
+-spec getMinSize(This) -> {W::integer(), H::integer()} when
+ This::wxSizer().
getMinSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizer),
wxe_util:call(?wxSizer_GetMinSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizer(),X::term()|integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerhide">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% hide(This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer()) -> hide(This,Window, []) </c></p>
-%% <p><c>
-%% hide(This::wxSizer(), Index::integer()) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% hide(This, Index) -> boolean() when<br />
+%% This::wxSizer(), Index::integer().<br />
+%%
+-spec hide(This, Window) -> boolean() when
+ This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer();
+ (This, Index) -> boolean() when
+ This::wxSizer(), Index::integer().
hide(This,Window)
when is_record(This, wx_ref),is_record(Window, wx_ref) ->
@@ -280,9 +314,10 @@ hide(#wx_ref{type=ThisT,ref=ThisRef},Index)
wxe_util:call(?wxSizer_Hide_1,
<<ThisRef:32/?UI,Index:32/?UI>>).
-%% @spec (This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), [Option]) -> bool()
-%% Option = {recursive, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerhide">external documentation</a>.
+-spec hide(This, Window, [Option]) -> boolean() when
+ This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(),
+ Option :: {recursive, boolean()}.
hide(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxSizer),
@@ -298,8 +333,9 @@ hide(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}, Option
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,WindowRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxSizer(), Index::integer(), Item::wxSizerItem:wxSizerItem()) -> wxSizerItem:wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerinsert">external documentation</a>.
+-spec insert(This, Index, Item) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Index::integer(), Item::wxSizerItem:wxSizerItem().
insert(#wx_ref{type=ThisT,ref=ThisRef},Index,#wx_ref{type=ItemT,ref=ItemRef})
when is_integer(Index) ->
?CLASS(ThisT,wxSizer),
@@ -307,18 +343,27 @@ insert(#wx_ref{type=ThisT,ref=ThisRef},Index,#wx_ref{type=ItemT,ref=ItemRef})
wxe_util:call(?wxSizer_Insert_2,
<<ThisRef:32/?UI,Index:32/?UI,ItemRef:32/?UI>>).
-%% @spec (This::wxSizer(),Index::integer(),X::integer()|term(),X::integer()|term()) -> wxSizerItem:wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerinsert">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% insert(This::wxSizer(), Index::integer(), Width::integer(), Height::integer()) -> insert(This,Index,Width,Height, []) </c></p>
-%% <p><c>
-%% insert(This::wxSizer(), Index::integer(), Window::wxWindow:wxWindow() | wxSizer(), [Option]) -> wxSizerItem:wxSizerItem() </c>
-%%<br /> Option = {proportion, integer()} | {flag, integer()} | {border, integer()} | {userData, wx:wx()}
-%% </p>
-%% <p><c>
-%% insert(This::wxSizer(), Index::integer(), Window::wxWindow:wxWindow() | wxSizer(), Flags::wxSizerFlags:wxSizerFlags()) -> wxSizerItem:wxSizerItem() </c>
-%% </p>
+%% <br /> Also:<br />
+%% insert(This, Index, Window, [Option]) -> wxSizerItem:wxSizerItem() when<br />
+%% This::wxSizer(), Index::integer(), Window::wxWindow:wxWindow() | wxSizer(),<br />
+%% Option :: {proportion, integer()}<br />
+%% | {flag, integer()}<br />
+%% | {border, integer()}<br />
+%% | {userData, wx:wx_object()};<br />
+%% (This, Index, Window, Flags) -> wxSizerItem:wxSizerItem() when<br />
+%% This::wxSizer(), Index::integer(), Window::wxWindow:wxWindow() | wxSizer(), Flags::wxSizerFlags:wxSizerFlags().<br />
+%%
+-spec insert(This, Index, Width, Height) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Index::integer(), Width::integer(), Height::integer();
+ (This, Index, Window, [Option]) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Index::integer(), Window::wxWindow:wxWindow() | wxSizer(),
+ Option :: {proportion, integer()}
+ | {flag, integer()}
+ | {border, integer()}
+ | {userData, wx:wx_object()};
+ (This, Index, Window, Flags) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Index::integer(), Window::wxWindow:wxWindow() | wxSizer(), Flags::wxSizerFlags:wxSizerFlags().
insert(This,Index,Width,Height)
when is_record(This, wx_ref),is_integer(Index),is_integer(Width),is_integer(Height) ->
@@ -354,9 +399,13 @@ insert(#wx_ref{type=ThisT,ref=ThisRef},Index,#wx_ref{type=WindowT,ref=WindowRef}
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,Index:32/?UI,WindowRef:32/?UI,FlagsRef:32/?UI>>).
-%% @spec (This::wxSizer(), Index::integer(), Width::integer(), Height::integer(), [Option]) -> wxSizerItem:wxSizerItem()
-%% Option = {proportion, integer()} | {flag, integer()} | {border, integer()} | {userData, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerinsert">external documentation</a>.
+-spec insert(This, Index, Width, Height, [Option]) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Index::integer(), Width::integer(), Height::integer(),
+ Option :: {proportion, integer()}
+ | {flag, integer()}
+ | {border, integer()}
+ | {userData, wx:wx_object()}.
insert(#wx_ref{type=ThisT,ref=ThisRef},Index,Width,Height, Options)
when is_integer(Index),is_integer(Width),is_integer(Height),is_list(Options) ->
?CLASS(ThisT,wxSizer),
@@ -369,23 +418,27 @@ insert(#wx_ref{type=ThisT,ref=ThisRef},Index,Width,Height, Options)
wxe_util:call(?wxSizer_Insert_4,
<<ThisRef:32/?UI,Index:32/?UI,Width:32/?UI,Height:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxSizer(), Index::integer(), Size::integer()) -> wxSizerItem:wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerinsertspacer">external documentation</a>.
+-spec insertSpacer(This, Index, Size) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Index::integer(), Size::integer().
insertSpacer(#wx_ref{type=ThisT,ref=ThisRef},Index,Size)
when is_integer(Index),is_integer(Size) ->
?CLASS(ThisT,wxSizer),
wxe_util:call(?wxSizer_InsertSpacer,
<<ThisRef:32/?UI,Index:32/?UI,Size:32/?UI>>).
-%% @spec (This::wxSizer(), Index::integer()) -> wxSizerItem:wxSizerItem()
%% @equiv insertStretchSpacer(This,Index, [])
+-spec insertStretchSpacer(This, Index) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Index::integer().
+
insertStretchSpacer(This,Index)
when is_record(This, wx_ref),is_integer(Index) ->
insertStretchSpacer(This,Index, []).
-%% @spec (This::wxSizer(), Index::integer(), [Option]) -> wxSizerItem:wxSizerItem()
-%% Option = {prop, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerinsertstretchspacer">external documentation</a>.
+-spec insertStretchSpacer(This, Index, [Option]) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Index::integer(),
+ Option :: {prop, integer()}.
insertStretchSpacer(#wx_ref{type=ThisT,ref=ThisRef},Index, Options)
when is_integer(Index),is_list(Options) ->
?CLASS(ThisT,wxSizer),
@@ -395,15 +448,15 @@ insertStretchSpacer(#wx_ref{type=ThisT,ref=ThisRef},Index, Options)
wxe_util:call(?wxSizer_InsertStretchSpacer,
<<ThisRef:32/?UI,Index:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxSizer(),X::integer()|term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerisshown">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% isShown(This::wxSizer(), Index::integer()) -> bool() </c>
-%% </p>
-%% <p><c>
-%% isShown(This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer()) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% isShown(This, Window) -> boolean() when<br />
+%% This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer().<br />
+%%
+-spec isShown(This, Index) -> boolean() when
+ This::wxSizer(), Index::integer();
+ (This, Window) -> boolean() when
+ This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer().
isShown(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxSizer),
@@ -420,33 +473,44 @@ isShown(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}) ->
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,WindowRef:32/?UI>>).
-%% @spec (This::wxSizer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerlayout">external documentation</a>.
+-spec layout(This) -> ok when
+ This::wxSizer().
layout(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizer),
wxe_util:cast(?wxSizer_Layout,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizer(), Item::wxSizerItem:wxSizerItem()) -> wxSizerItem:wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerprepend">external documentation</a>.
+-spec prepend(This, Item) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Item::wxSizerItem:wxSizerItem().
prepend(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=ItemRef}) ->
?CLASS(ThisT,wxSizer),
?CLASS(ItemT,wxSizerItem),
wxe_util:call(?wxSizer_Prepend_1,
<<ThisRef:32/?UI,ItemRef:32/?UI>>).
-%% @spec (This::wxSizer(),X::integer()|term(),X::integer()|term()) -> wxSizerItem:wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerprepend">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% prepend(This::wxSizer(), Width::integer(), Height::integer()) -> prepend(This,Width,Height, []) </c></p>
-%% <p><c>
-%% prepend(This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), [Option]) -> wxSizerItem:wxSizerItem() </c>
-%%<br /> Option = {proportion, integer()} | {flag, integer()} | {border, integer()} | {userData, wx:wx()}
-%% </p>
-%% <p><c>
-%% prepend(This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), Flags::wxSizerFlags:wxSizerFlags()) -> wxSizerItem:wxSizerItem() </c>
-%% </p>
+%% <br /> Also:<br />
+%% prepend(This, Window, [Option]) -> wxSizerItem:wxSizerItem() when<br />
+%% This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(),<br />
+%% Option :: {proportion, integer()}<br />
+%% | {flag, integer()}<br />
+%% | {border, integer()}<br />
+%% | {userData, wx:wx_object()};<br />
+%% (This, Window, Flags) -> wxSizerItem:wxSizerItem() when<br />
+%% This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), Flags::wxSizerFlags:wxSizerFlags().<br />
+%%
+-spec prepend(This, Width, Height) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Width::integer(), Height::integer();
+ (This, Window, [Option]) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(),
+ Option :: {proportion, integer()}
+ | {flag, integer()}
+ | {border, integer()}
+ | {userData, wx:wx_object()};
+ (This, Window, Flags) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), Flags::wxSizerFlags:wxSizerFlags().
prepend(This,Width,Height)
when is_record(This, wx_ref),is_integer(Width),is_integer(Height) ->
@@ -481,9 +545,13 @@ prepend(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef},#wx_
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,WindowRef:32/?UI,FlagsRef:32/?UI>>).
-%% @spec (This::wxSizer(), Width::integer(), Height::integer(), [Option]) -> wxSizerItem:wxSizerItem()
-%% Option = {proportion, integer()} | {flag, integer()} | {border, integer()} | {userData, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerprepend">external documentation</a>.
+-spec prepend(This, Width, Height, [Option]) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Width::integer(), Height::integer(),
+ Option :: {proportion, integer()}
+ | {flag, integer()}
+ | {border, integer()}
+ | {userData, wx:wx_object()}.
prepend(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
when is_integer(Width),is_integer(Height),is_list(Options) ->
?CLASS(ThisT,wxSizer),
@@ -496,23 +564,27 @@ prepend(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
wxe_util:call(?wxSizer_Prepend_3,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSizer(), Size::integer()) -> wxSizerItem:wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerprependspacer">external documentation</a>.
+-spec prependSpacer(This, Size) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(), Size::integer().
prependSpacer(#wx_ref{type=ThisT,ref=ThisRef},Size)
when is_integer(Size) ->
?CLASS(ThisT,wxSizer),
wxe_util:call(?wxSizer_PrependSpacer,
<<ThisRef:32/?UI,Size:32/?UI>>).
-%% @spec (This::wxSizer()) -> wxSizerItem:wxSizerItem()
%% @equiv prependStretchSpacer(This, [])
+-spec prependStretchSpacer(This) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer().
+
prependStretchSpacer(This)
when is_record(This, wx_ref) ->
prependStretchSpacer(This, []).
-%% @spec (This::wxSizer(), [Option]) -> wxSizerItem:wxSizerItem()
-%% Option = {prop, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerprependstretchspacer">external documentation</a>.
+-spec prependStretchSpacer(This, [Option]) -> wxSizerItem:wxSizerItem() when
+ This::wxSizer(),
+ Option :: {prop, integer()}.
prependStretchSpacer(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxSizer),
@@ -522,22 +594,23 @@ prependStretchSpacer(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxSizer_PrependStretchSpacer,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSizer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerrecalcsizes">external documentation</a>.
+-spec recalcSizes(This) -> ok when
+ This::wxSizer().
recalcSizes(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizer),
wxe_util:cast(?wxSizer_RecalcSizes,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizer(),X::integer()|wxSizer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerremove">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% remove(This::wxSizer(), Index::integer()) -> bool() </c>
-%% </p>
-%% <p><c>
-%% remove(This::wxSizer(), Sizer::wxSizer()) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% remove(This, Sizer) -> boolean() when<br />
+%% This::wxSizer(), Sizer::wxSizer().<br />
+%%
+-spec remove(This, Index) -> boolean() when
+ This::wxSizer(), Index::integer();
+ (This, Sizer) -> boolean() when
+ This::wxSizer(), Sizer::wxSizer().
remove(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxSizer),
@@ -549,14 +622,15 @@ remove(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=SizerT,ref=SizerRef}) ->
wxe_util:call(?wxSizer_Remove_1_1,
<<ThisRef:32/?UI,SizerRef:32/?UI>>).
-%% @spec (This::wxSizer(),X::term()|integer(),X::term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerreplace">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% replace(This::wxSizer(), Oldwin::wxWindow:wxWindow() | wxSizer(), Newwin::wxWindow:wxWindow() | wxSizer()) -> replace(This,Oldwin,Newwin, []) </c></p>
-%% <p><c>
-%% replace(This::wxSizer(), Index::integer(), Newitem::wxSizerItem:wxSizerItem()) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% replace(This, Index, Newitem) -> boolean() when<br />
+%% This::wxSizer(), Index::integer(), Newitem::wxSizerItem:wxSizerItem().<br />
+%%
+-spec replace(This, Oldwin, Newwin) -> boolean() when
+ This::wxSizer(), Oldwin::wxWindow:wxWindow() | wxSizer(), Newwin::wxWindow:wxWindow() | wxSizer();
+ (This, Index, Newitem) -> boolean() when
+ This::wxSizer(), Index::integer(), Newitem::wxSizerItem:wxSizerItem().
replace(This,Oldwin,Newwin)
when is_record(This, wx_ref),is_record(Oldwin, wx_ref),is_record(Newwin, wx_ref) ->
@@ -568,9 +642,10 @@ replace(#wx_ref{type=ThisT,ref=ThisRef},Index,#wx_ref{type=NewitemT,ref=NewitemR
wxe_util:call(?wxSizer_Replace_2,
<<ThisRef:32/?UI,Index:32/?UI,NewitemRef:32/?UI>>).
-%% @spec (This::wxSizer(), Oldwin::wxWindow:wxWindow() | wxSizer(), Newwin::wxWindow:wxWindow() | wxSizer(), [Option]) -> bool()
-%% Option = {recursive, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizerreplace">external documentation</a>.
+-spec replace(This, Oldwin, Newwin, [Option]) -> boolean() when
+ This::wxSizer(), Oldwin::wxWindow:wxWindow() | wxSizer(), Newwin::wxWindow:wxWindow() | wxSizer(),
+ Option :: {recursive, boolean()}.
replace(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=OldwinT,ref=OldwinRef},#wx_ref{type=NewwinT,ref=NewwinRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxSizer),
@@ -588,39 +663,42 @@ replace(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=OldwinT,ref=OldwinRef},#wx_
wxe_util:call(OldwinOP,
<<ThisRef:32/?UI,OldwinRef:32/?UI,NewwinRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSizer(), X::integer(), Y::integer(), Width::integer(), Height::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizersetdimension">external documentation</a>.
+-spec setDimension(This, X, Y, Width, Height) -> ok when
+ This::wxSizer(), X::integer(), Y::integer(), Width::integer(), Height::integer().
setDimension(#wx_ref{type=ThisT,ref=ThisRef},X,Y,Width,Height)
when is_integer(X),is_integer(Y),is_integer(Width),is_integer(Height) ->
?CLASS(ThisT,wxSizer),
wxe_util:cast(?wxSizer_SetDimension,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,Width:32/?UI,Height:32/?UI>>).
-%% @spec (This::wxSizer(), Size::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizersetminsize">external documentation</a>.
+-spec setMinSize(This, Size) -> ok when
+ This::wxSizer(), Size::{W::integer(), H::integer()}.
setMinSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxSizer),
wxe_util:cast(?wxSizer_SetMinSize_1,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxSizer(), Width::integer(), Height::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizersetminsize">external documentation</a>.
+-spec setMinSize(This, Width, Height) -> ok when
+ This::wxSizer(), Width::integer(), Height::integer().
setMinSize(#wx_ref{type=ThisT,ref=ThisRef},Width,Height)
when is_integer(Width),is_integer(Height) ->
?CLASS(ThisT,wxSizer),
wxe_util:cast(?wxSizer_SetMinSize_2,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI>>).
-%% @spec (This::wxSizer(),X::integer()|term(),Size::{W::integer(), H::integer()}) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizersetitemminsize">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setItemMinSize(This::wxSizer(), Index::integer(), Size::{W::integer(), H::integer()}) -> bool() </c>
-%% </p>
-%% <p><c>
-%% setItemMinSize(This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), Size::{W::integer(), H::integer()}) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% setItemMinSize(This, Window, Size) -> boolean() when<br />
+%% This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), Size::{W::integer(), H::integer()}.<br />
+%%
+-spec setItemMinSize(This, Index, Size) -> boolean() when
+ This::wxSizer(), Index::integer(), Size::{W::integer(), H::integer()};
+ (This, Window, Size) -> boolean() when
+ This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), Size::{W::integer(), H::integer()}.
setItemMinSize(#wx_ref{type=ThisT,ref=ThisRef},Index,{SizeW,SizeH})
when is_integer(Index),is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxSizer),
@@ -638,15 +716,15 @@ setItemMinSize(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRe
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,WindowRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxSizer(),X::integer()|term(),Width::integer(),Height::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizersetitemminsize">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setItemMinSize(This::wxSizer(), Index::integer(), Width::integer(), Height::integer()) -> bool() </c>
-%% </p>
-%% <p><c>
-%% setItemMinSize(This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), Width::integer(), Height::integer()) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% setItemMinSize(This, Window, Width, Height) -> boolean() when<br />
+%% This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), Width::integer(), Height::integer().<br />
+%%
+-spec setItemMinSize(This, Index, Width, Height) -> boolean() when
+ This::wxSizer(), Index::integer(), Width::integer(), Height::integer();
+ (This, Window, Width, Height) -> boolean() when
+ This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), Width::integer(), Height::integer().
setItemMinSize(#wx_ref{type=ThisT,ref=ThisRef},Index,Width,Height)
when is_integer(Index),is_integer(Width),is_integer(Height) ->
?CLASS(ThisT,wxSizer),
@@ -664,32 +742,37 @@ setItemMinSize(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRe
wxe_util:call(WindowOP,
<<ThisRef:32/?UI,WindowRef:32/?UI,Width:32/?UI,Height:32/?UI>>).
-%% @spec (This::wxSizer(), Window::wxWindow:wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizersetsizehints">external documentation</a>.
+-spec setSizeHints(This, Window) -> ok when
+ This::wxSizer(), Window::wxWindow:wxWindow().
setSizeHints(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}) ->
?CLASS(ThisT,wxSizer),
?CLASS(WindowT,wxWindow),
wxe_util:cast(?wxSizer_SetSizeHints,
<<ThisRef:32/?UI,WindowRef:32/?UI>>).
-%% @spec (This::wxSizer(), Window::wxWindow:wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizersetvirtualsizehints">external documentation</a>.
+-spec setVirtualSizeHints(This, Window) -> ok when
+ This::wxSizer(), Window::wxWindow:wxWindow().
setVirtualSizeHints(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}) ->
?CLASS(ThisT,wxSizer),
?CLASS(WindowT,wxWindow),
wxe_util:cast(?wxSizer_SetVirtualSizeHints,
<<ThisRef:32/?UI,WindowRef:32/?UI>>).
-%% @spec (This::wxSizer(),X::integer()|term()|bool()) -> bool()|bool()|ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizershow">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% show(This::wxSizer(), Index::integer()) -> show(This,Index, []) </c></p>
-%% <p><c>
-%% show(This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer()) -> show(This,Window, []) </c></p>
-%% <p><c>
-%% show(This::wxSizer(), Show::bool()) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% show(This, Window) -> boolean() when<br />
+%% This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer();<br />
+%% (This, Show) -> ok when<br />
+%% This::wxSizer(), Show::boolean().<br />
+%%
+-spec show(This, Index) -> boolean() when
+ This::wxSizer(), Index::integer();
+ (This, Window) -> boolean() when
+ This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer();
+ (This, Show) -> ok when
+ This::wxSizer(), Show::boolean().
show(This,Index)
when is_record(This, wx_ref),is_integer(Index) ->
@@ -704,17 +787,20 @@ show(#wx_ref{type=ThisT,ref=ThisRef},Show)
wxe_util:cast(?wxSizer_Show_1,
<<ThisRef:32/?UI,(wxe_util:from_bool(Show)):32/?UI>>).
-%% @spec (This::wxSizer(),X::integer()|term(),[Option]) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizershow">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% show(This::wxSizer(), Index::integer(), [Option]) -> bool() </c>
-%%<br /> Option = {show, bool()}
-%% </p>
-%% <p><c>
-%% show(This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(), [Option]) -> bool() </c>
-%%<br /> Option = {show, bool()} | {recursive, bool()}
-%% </p>
+%% <br /> Also:<br />
+%% show(This, Window, [Option]) -> boolean() when<br />
+%% This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(),<br />
+%% Option :: {show, boolean()}<br />
+%% | {recursive, boolean()}.<br />
+%%
+-spec show(This, Index, [Option]) -> boolean() when
+ This::wxSizer(), Index::integer(),
+ Option :: {show, boolean()};
+ (This, Window, [Option]) -> boolean() when
+ This::wxSizer(), Window::wxWindow:wxWindow() | wxSizer(),
+ Option :: {show, boolean()}
+ | {recursive, boolean()}.
show(#wx_ref{type=ThisT,ref=ThisRef},Index, Options)
when is_integer(Index),is_list(Options) ->
?CLASS(ThisT,wxSizer),
diff --git a/lib/wx/src/gen/wxSizerFlags.erl b/lib/wx/src/gen/wxSizerFlags.erl
index 2a25fd2c1a..08d36d1a80 100644
--- a/lib/wx/src/gen/wxSizerFlags.erl
+++ b/lib/wx/src/gen/wxSizerFlags.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -30,17 +30,20 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxSizerFlags/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxSizerFlags()
+-type wxSizerFlags() :: wx:wx_object().
%% @equiv new([])
+-spec new() -> wxSizerFlags().
+
new() ->
new([]).
-%% @spec ([Option]) -> wxSizerFlags()
-%% Option = {proportion, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizerflags.html#wxsizerflagswxsizerflags">external documentation</a>.
+-spec new([Option]) -> wxSizerFlags() when
+ Option :: {proportion, integer()}.
new(Options)
when is_list(Options) ->
MOpts = fun({proportion, Proportion}, Acc) -> [<<1:32/?UI,Proportion:32/?UI>>|Acc];
@@ -49,23 +52,27 @@ new(Options)
wxe_util:construct(?wxSizerFlags_new,
<<BinOpt/binary>>).
-%% @spec (This::wxSizerFlags(), Alignment::integer()) -> wxSizerFlags()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizerflags.html#wxsizerflagsalign">external documentation</a>.
+-spec align(This, Alignment) -> wxSizerFlags() when
+ This::wxSizerFlags(), Alignment::integer().
align(#wx_ref{type=ThisT,ref=ThisRef},Alignment)
when is_integer(Alignment) ->
?CLASS(ThisT,wxSizerFlags),
wxe_util:call(?wxSizerFlags_Align,
<<ThisRef:32/?UI,Alignment:32/?UI>>).
-%% @spec (This::wxSizerFlags()) -> wxSizerFlags()
%% @equiv border(This, [])
+-spec border(This) -> wxSizerFlags() when
+ This::wxSizerFlags().
+
border(This)
when is_record(This, wx_ref) ->
border(This, []).
-%% @spec (This::wxSizerFlags(), [Option]) -> wxSizerFlags()
-%% Option = {direction, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizerflags.html#wxsizerflagsborder">external documentation</a>.
+-spec border(This, [Option]) -> wxSizerFlags() when
+ This::wxSizerFlags(),
+ Option :: {direction, integer()}.
border(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxSizerFlags),
@@ -75,59 +82,66 @@ border(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxSizerFlags_Border_1,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSizerFlags(), Direction::integer(), BorderInPixels::integer()) -> wxSizerFlags()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizerflags.html#wxsizerflagsborder">external documentation</a>.
+-spec border(This, Direction, BorderInPixels) -> wxSizerFlags() when
+ This::wxSizerFlags(), Direction::integer(), BorderInPixels::integer().
border(#wx_ref{type=ThisT,ref=ThisRef},Direction,BorderInPixels)
when is_integer(Direction),is_integer(BorderInPixels) ->
?CLASS(ThisT,wxSizerFlags),
wxe_util:call(?wxSizerFlags_Border_2,
<<ThisRef:32/?UI,Direction:32/?UI,BorderInPixels:32/?UI>>).
-%% @spec (This::wxSizerFlags()) -> wxSizerFlags()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizerflags.html#wxsizerflagscenter">external documentation</a>.
+-spec center(This) -> wxSizerFlags() when
+ This::wxSizerFlags().
center(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerFlags),
wxe_util:call(?wxSizerFlags_Center,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerFlags()) -> wxSizerFlags()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizerflags.html#wxsizerflagscentre">external documentation</a>.
+-spec centre(This) -> wxSizerFlags() when
+ This::wxSizerFlags().
centre(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerFlags),
wxe_util:call(?wxSizerFlags_Centre,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerFlags()) -> wxSizerFlags()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizerflags.html#wxsizerflagsexpand">external documentation</a>.
+-spec expand(This) -> wxSizerFlags() when
+ This::wxSizerFlags().
expand(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerFlags),
wxe_util:call(?wxSizerFlags_Expand,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerFlags()) -> wxSizerFlags()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizerflags.html#wxsizerflagsleft">external documentation</a>.
+-spec left(This) -> wxSizerFlags() when
+ This::wxSizerFlags().
left(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerFlags),
wxe_util:call(?wxSizerFlags_Left,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerFlags(), Proportion::integer()) -> wxSizerFlags()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizerflags.html#wxsizerflagsproportion">external documentation</a>.
+-spec proportion(This, Proportion) -> wxSizerFlags() when
+ This::wxSizerFlags(), Proportion::integer().
proportion(#wx_ref{type=ThisT,ref=ThisRef},Proportion)
when is_integer(Proportion) ->
?CLASS(ThisT,wxSizerFlags),
wxe_util:call(?wxSizerFlags_Proportion,
<<ThisRef:32/?UI,Proportion:32/?UI>>).
-%% @spec (This::wxSizerFlags()) -> wxSizerFlags()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizerflags.html#wxsizerflagsright">external documentation</a>.
+-spec right(This) -> wxSizerFlags() when
+ This::wxSizerFlags().
right(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerFlags),
wxe_util:call(?wxSizerFlags_Right,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerFlags()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxSizerFlags()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxSizerFlags),
wxe_util:destroy(?wxSizerFlags_destroy,Obj),
diff --git a/lib/wx/src/gen/wxSizerItem.erl b/lib/wx/src/gen/wxSizerItem.erl
index 41cb86eae2..62655864d1 100644
--- a/lib/wx/src/gen/wxSizerItem.erl
+++ b/lib/wx/src/gen/wxSizerItem.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -35,17 +35,20 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxSizerItem/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxSizerItem()
+-type wxSizerItem() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemwxsizeritem">external documentation</a>.
+-spec new() -> wxSizerItem().
new() ->
wxe_util:construct(?wxSizerItem_new_0,
<<>>).
-%% @spec (Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Flags::wxSizerFlags:wxSizerFlags()) -> wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemwxsizeritem">external documentation</a>.
+-spec new(Window, Flags) -> wxSizerItem() when
+ Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Flags::wxSizerFlags:wxSizerFlags().
new(#wx_ref{type=WindowT,ref=WindowRef},#wx_ref{type=FlagsT,ref=FlagsRef}) ->
WindowOP = case ?CLASS_T(WindowT,wxWindow) of
true ->
@@ -58,16 +61,18 @@ new(#wx_ref{type=WindowT,ref=WindowRef},#wx_ref{type=FlagsT,ref=FlagsRef}) ->
wxe_util:construct(WindowOP,
<<WindowRef:32/?UI,FlagsRef:32/?UI>>).
-%% @spec (Width::integer(), Height::integer(), Flags::wxSizerFlags:wxSizerFlags()) -> wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemwxsizeritem">external documentation</a>.
+-spec new(Width, Height, Flags) -> wxSizerItem() when
+ Width::integer(), Height::integer(), Flags::wxSizerFlags:wxSizerFlags().
new(Width,Height,#wx_ref{type=FlagsT,ref=FlagsRef})
when is_integer(Width),is_integer(Height) ->
?CLASS(FlagsT,wxSizerFlags),
wxe_util:construct(?wxSizerItem_new_3,
<<Width:32/?UI,Height:32/?UI,FlagsRef:32/?UI>>).
-%% @spec (Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Proportion::integer(), Flag::integer(), Border::integer(), UserData::wx:wx()) -> wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemwxsizeritem">external documentation</a>.
+-spec new(Window, Proportion, Flag, Border, UserData) -> wxSizerItem() when
+ Window::wxWindow:wxWindow() | wxSizer:wxSizer(), Proportion::integer(), Flag::integer(), Border::integer(), UserData::wx:wx_object().
new(#wx_ref{type=WindowT,ref=WindowRef},Proportion,Flag,Border,#wx_ref{type=UserDataT,ref=UserDataRef})
when is_integer(Proportion),is_integer(Flag),is_integer(Border) ->
WindowOP = case ?CLASS_T(WindowT,wxWindow) of
@@ -81,214 +86,241 @@ new(#wx_ref{type=WindowT,ref=WindowRef},Proportion,Flag,Border,#wx_ref{type=User
wxe_util:construct(WindowOP,
<<WindowRef:32/?UI,Proportion:32/?UI,Flag:32/?UI,Border:32/?UI,UserDataRef:32/?UI>>).
-%% @spec (Width::integer(), Height::integer(), Proportion::integer(), Flag::integer(), Border::integer(), UserData::wx:wx()) -> wxSizerItem()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemwxsizeritem">external documentation</a>.
+-spec new(Width, Height, Proportion, Flag, Border, UserData) -> wxSizerItem() when
+ Width::integer(), Height::integer(), Proportion::integer(), Flag::integer(), Border::integer(), UserData::wx:wx_object().
new(Width,Height,Proportion,Flag,Border,#wx_ref{type=UserDataT,ref=UserDataRef})
when is_integer(Width),is_integer(Height),is_integer(Proportion),is_integer(Flag),is_integer(Border) ->
?CLASS(UserDataT,wx),
wxe_util:construct(?wxSizerItem_new_6,
<<Width:32/?UI,Height:32/?UI,Proportion:32/?UI,Flag:32/?UI,Border:32/?UI,UserDataRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemcalcmin">external documentation</a>.
+-spec calcMin(This) -> {W::integer(), H::integer()} when
+ This::wxSizerItem().
calcMin(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_CalcMin,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemdeletewindows">external documentation</a>.
+-spec deleteWindows(This) -> ok when
+ This::wxSizerItem().
deleteWindows(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:cast(?wxSizerItem_DeleteWindows,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemdetachsizer">external documentation</a>.
+-spec detachSizer(This) -> ok when
+ This::wxSizerItem().
detachSizer(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:cast(?wxSizerItem_DetachSizer,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemgetborder">external documentation</a>.
+-spec getBorder(This) -> integer() when
+ This::wxSizerItem().
getBorder(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_GetBorder,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemgetflag">external documentation</a>.
+-spec getFlag(This) -> integer() when
+ This::wxSizerItem().
getFlag(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_GetFlag,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemgetminsize">external documentation</a>.
+-spec getMinSize(This) -> {W::integer(), H::integer()} when
+ This::wxSizerItem().
getMinSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_GetMinSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemgetposition">external documentation</a>.
+-spec getPosition(This) -> {X::integer(), Y::integer()} when
+ This::wxSizerItem().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_GetPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemgetproportion">external documentation</a>.
+-spec getProportion(This) -> integer() when
+ This::wxSizerItem().
getProportion(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_GetProportion,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> float()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemgetratio">external documentation</a>.
+-spec getRatio(This) -> number() when
+ This::wxSizerItem().
getRatio(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_GetRatio,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> {X::integer(), Y::integer(), W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemgetrect">external documentation</a>.
+-spec getRect(This) -> {X::integer(), Y::integer(), W::integer(), H::integer()} when
+ This::wxSizerItem().
getRect(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_GetRect,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemgetsize">external documentation</a>.
+-spec getSize(This) -> {W::integer(), H::integer()} when
+ This::wxSizerItem().
getSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_GetSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> wxSizer:wxSizer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemgetsizer">external documentation</a>.
+-spec getSizer(This) -> wxSizer:wxSizer() when
+ This::wxSizerItem().
getSizer(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_GetSizer,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemgetspacer">external documentation</a>.
+-spec getSpacer(This) -> {W::integer(), H::integer()} when
+ This::wxSizerItem().
getSpacer(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_GetSpacer,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> wx:wx()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemgetuserdata">external documentation</a>.
+-spec getUserData(This) -> wx:wx_object() when
+ This::wxSizerItem().
getUserData(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_GetUserData,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemgetwindow">external documentation</a>.
+-spec getWindow(This) -> wxWindow:wxWindow() when
+ This::wxSizerItem().
getWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_GetWindow,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemissizer">external documentation</a>.
+-spec isSizer(This) -> boolean() when
+ This::wxSizerItem().
isSizer(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_IsSizer,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemisshown">external documentation</a>.
+-spec isShown(This) -> boolean() when
+ This::wxSizerItem().
isShown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_IsShown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemisspacer">external documentation</a>.
+-spec isSpacer(This) -> boolean() when
+ This::wxSizerItem().
isSpacer(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_IsSpacer,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemiswindow">external documentation</a>.
+-spec isWindow(This) -> boolean() when
+ This::wxSizerItem().
isWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:call(?wxSizerItem_IsWindow,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSizerItem(), Border::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemsetborder">external documentation</a>.
+-spec setBorder(This, Border) -> ok when
+ This::wxSizerItem(), Border::integer().
setBorder(#wx_ref{type=ThisT,ref=ThisRef},Border)
when is_integer(Border) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:cast(?wxSizerItem_SetBorder,
<<ThisRef:32/?UI,Border:32/?UI>>).
-%% @spec (This::wxSizerItem(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemsetdimension">external documentation</a>.
+-spec setDimension(This, Pos, Size) -> ok when
+ This::wxSizerItem(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}.
setDimension(#wx_ref{type=ThisT,ref=ThisRef},{PosX,PosY},{SizeW,SizeH})
when is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:cast(?wxSizerItem_SetDimension,
<<ThisRef:32/?UI,PosX:32/?UI,PosY:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxSizerItem(), Flag::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemsetflag">external documentation</a>.
+-spec setFlag(This, Flag) -> ok when
+ This::wxSizerItem(), Flag::integer().
setFlag(#wx_ref{type=ThisT,ref=ThisRef},Flag)
when is_integer(Flag) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:cast(?wxSizerItem_SetFlag,
<<ThisRef:32/?UI,Flag:32/?UI>>).
-%% @spec (This::wxSizerItem(), X::integer(), Y::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemsetinitsize">external documentation</a>.
+-spec setInitSize(This, X, Y) -> ok when
+ This::wxSizerItem(), X::integer(), Y::integer().
setInitSize(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:cast(?wxSizerItem_SetInitSize,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxSizerItem(), Size::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemsetminsize">external documentation</a>.
+-spec setMinSize(This, Size) -> ok when
+ This::wxSizerItem(), Size::{W::integer(), H::integer()}.
setMinSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:cast(?wxSizerItem_SetMinSize_1,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxSizerItem(), X::integer(), Y::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemsetminsize">external documentation</a>.
+-spec setMinSize(This, X, Y) -> ok when
+ This::wxSizerItem(), X::integer(), Y::integer().
setMinSize(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:cast(?wxSizerItem_SetMinSize_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxSizerItem(), Proportion::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemsetproportion">external documentation</a>.
+-spec setProportion(This, Proportion) -> ok when
+ This::wxSizerItem(), Proportion::integer().
setProportion(#wx_ref{type=ThisT,ref=ThisRef},Proportion)
when is_integer(Proportion) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:cast(?wxSizerItem_SetProportion,
<<ThisRef:32/?UI,Proportion:32/?UI>>).
-%% @spec (This::wxSizerItem(),X::float()|term()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemsetratio">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setRatio(This::wxSizerItem(), Ratio::float()) -> ok </c>
-%% </p>
-%% <p><c>
-%% setRatio(This::wxSizerItem(), Size::{W::integer(), H::integer()}) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% setRatio(This, Size) -> ok when<br />
+%% This::wxSizerItem(), Size::{W::integer(), H::integer()}.<br />
+%%
+-spec setRatio(This, Ratio) -> ok when
+ This::wxSizerItem(), Ratio::number();
+ (This, Size) -> ok when
+ This::wxSizerItem(), Size::{W::integer(), H::integer()}.
setRatio(#wx_ref{type=ThisT,ref=ThisRef},Ratio)
- when is_float(Ratio) ->
+ when is_number(Ratio) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:cast(?wxSizerItem_SetRatio_1_0,
<<ThisRef:32/?UI,Ratio:32/?F>>);
@@ -298,56 +330,62 @@ setRatio(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
wxe_util:cast(?wxSizerItem_SetRatio_1_1,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxSizerItem(), Width::integer(), Height::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemsetratio">external documentation</a>.
+-spec setRatio(This, Width, Height) -> ok when
+ This::wxSizerItem(), Width::integer(), Height::integer().
setRatio(#wx_ref{type=ThisT,ref=ThisRef},Width,Height)
when is_integer(Width),is_integer(Height) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:cast(?wxSizerItem_SetRatio_2,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI>>).
-%% @spec (This::wxSizerItem(), Sizer::wxSizer:wxSizer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemsetsizer">external documentation</a>.
+-spec setSizer(This, Sizer) -> ok when
+ This::wxSizerItem(), Sizer::wxSizer:wxSizer().
setSizer(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=SizerT,ref=SizerRef}) ->
?CLASS(ThisT,wxSizerItem),
?CLASS(SizerT,wxSizer),
wxe_util:cast(?wxSizerItem_SetSizer,
<<ThisRef:32/?UI,SizerRef:32/?UI>>).
-%% @spec (This::wxSizerItem(), Size::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemsetspacer">external documentation</a>.
+-spec setSpacer(This, Size) -> ok when
+ This::wxSizerItem(), Size::{W::integer(), H::integer()}.
setSpacer(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:cast(?wxSizerItem_SetSpacer_1,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxSizerItem(), Width::integer(), Height::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemsetspacer">external documentation</a>.
+-spec setSpacer(This, Width, Height) -> ok when
+ This::wxSizerItem(), Width::integer(), Height::integer().
setSpacer(#wx_ref{type=ThisT,ref=ThisRef},Width,Height)
when is_integer(Width),is_integer(Height) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:cast(?wxSizerItem_SetSpacer_2,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI>>).
-%% @spec (This::wxSizerItem(), Window::wxWindow:wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemsetwindow">external documentation</a>.
+-spec setWindow(This, Window) -> ok when
+ This::wxSizerItem(), Window::wxWindow:wxWindow().
setWindow(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}) ->
?CLASS(ThisT,wxSizerItem),
?CLASS(WindowT,wxWindow),
wxe_util:cast(?wxSizerItem_SetWindow,
<<ThisRef:32/?UI,WindowRef:32/?UI>>).
-%% @spec (This::wxSizerItem(), Show::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsizeritem.html#wxsizeritemshow">external documentation</a>.
+-spec show(This, Show) -> ok when
+ This::wxSizerItem(), Show::boolean().
show(#wx_ref{type=ThisT,ref=ThisRef},Show)
when is_boolean(Show) ->
?CLASS(ThisT,wxSizerItem),
wxe_util:cast(?wxSizerItem_Show,
<<ThisRef:32/?UI,(wxe_util:from_bool(Show)):32/?UI>>).
-%% @spec (This::wxSizerItem()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxSizerItem()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxSizerItem),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxSlider.erl b/lib/wx/src/gen/wxSlider.erl
index c7a3d6f5c0..459e9b9c35 100644
--- a/lib/wx/src/gen/wxSlider.erl
+++ b/lib/wx/src/gen/wxSlider.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -71,27 +71,35 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxSlider/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxSlider()
+-type wxSlider() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxslider.html#wxsliderwxslider">external documentation</a>.
+-spec new() -> wxSlider().
new() ->
wxe_util:construct(?wxSlider_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Value::integer(), MinValue::integer(), MaxValue::integer()) -> wxSlider()
%% @equiv new(Parent,Id,Value,MinValue,MaxValue, [])
+-spec new(Parent, Id, Value, MinValue, MaxValue) -> wxSlider() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Value::integer(), MinValue::integer(), MaxValue::integer().
+
new(Parent,Id,Value,MinValue,MaxValue)
when is_record(Parent, wx_ref),is_integer(Id),is_integer(Value),is_integer(MinValue),is_integer(MaxValue) ->
new(Parent,Id,Value,MinValue,MaxValue, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Value::integer(), MinValue::integer(), MaxValue::integer(), [Option]) -> wxSlider()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxslider.html#wxsliderwxslider">external documentation</a>.
+-spec new(Parent, Id, Value, MinValue, MaxValue, [Option]) -> wxSlider() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Value::integer(), MinValue::integer(), MaxValue::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,Value,MinValue,MaxValue, Options)
when is_integer(Id),is_integer(Value),is_integer(MinValue),is_integer(MaxValue),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -104,15 +112,21 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Value,MinValue,MaxValue, Options)
wxe_util:construct(?wxSlider_new_6,
<<ParentRef:32/?UI,Id:32/?UI,Value:32/?UI,MinValue:32/?UI,MaxValue:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSlider(), Parent::wxWindow:wxWindow(), Id::integer(), Value::integer(), MinValue::integer(), MaxValue::integer()) -> bool()
%% @equiv create(This,Parent,Id,Value,MinValue,MaxValue, [])
+-spec create(This, Parent, Id, Value, MinValue, MaxValue) -> boolean() when
+ This::wxSlider(), Parent::wxWindow:wxWindow(), Id::integer(), Value::integer(), MinValue::integer(), MaxValue::integer().
+
create(This,Parent,Id,Value,MinValue,MaxValue)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_integer(Value),is_integer(MinValue),is_integer(MaxValue) ->
create(This,Parent,Id,Value,MinValue,MaxValue, []).
-%% @spec (This::wxSlider(), Parent::wxWindow:wxWindow(), Id::integer(), Value::integer(), MinValue::integer(), MaxValue::integer(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxslider.html#wxslidercreate">external documentation</a>.
+-spec create(This, Parent, Id, Value, MinValue, MaxValue, [Option]) -> boolean() when
+ This::wxSlider(), Parent::wxWindow:wxWindow(), Id::integer(), Value::integer(), MinValue::integer(), MaxValue::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Value,MinValue,MaxValue, Options)
when is_integer(Id),is_integer(Value),is_integer(MinValue),is_integer(MaxValue),is_list(Options) ->
?CLASS(ThisT,wxSlider),
@@ -126,90 +140,101 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Va
wxe_util:call(?wxSlider_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,Value:32/?UI,MinValue:32/?UI,MaxValue:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxSlider()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxslider.html#wxslidergetlinesize">external documentation</a>.
+-spec getLineSize(This) -> integer() when
+ This::wxSlider().
getLineSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSlider),
wxe_util:call(?wxSlider_GetLineSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSlider()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxslider.html#wxslidergetmax">external documentation</a>.
+-spec getMax(This) -> integer() when
+ This::wxSlider().
getMax(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSlider),
wxe_util:call(?wxSlider_GetMax,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSlider()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxslider.html#wxslidergetmin">external documentation</a>.
+-spec getMin(This) -> integer() when
+ This::wxSlider().
getMin(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSlider),
wxe_util:call(?wxSlider_GetMin,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSlider()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxslider.html#wxslidergetpagesize">external documentation</a>.
+-spec getPageSize(This) -> integer() when
+ This::wxSlider().
getPageSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSlider),
wxe_util:call(?wxSlider_GetPageSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSlider()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxslider.html#wxslidergetthumblength">external documentation</a>.
+-spec getThumbLength(This) -> integer() when
+ This::wxSlider().
getThumbLength(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSlider),
wxe_util:call(?wxSlider_GetThumbLength,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSlider()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxslider.html#wxslidergetvalue">external documentation</a>.
+-spec getValue(This) -> integer() when
+ This::wxSlider().
getValue(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSlider),
wxe_util:call(?wxSlider_GetValue,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSlider(), LineSize::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxslider.html#wxslidersetlinesize">external documentation</a>.
+-spec setLineSize(This, LineSize) -> ok when
+ This::wxSlider(), LineSize::integer().
setLineSize(#wx_ref{type=ThisT,ref=ThisRef},LineSize)
when is_integer(LineSize) ->
?CLASS(ThisT,wxSlider),
wxe_util:cast(?wxSlider_SetLineSize,
<<ThisRef:32/?UI,LineSize:32/?UI>>).
-%% @spec (This::wxSlider(), PageSize::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxslider.html#wxslidersetpagesize">external documentation</a>.
+-spec setPageSize(This, PageSize) -> ok when
+ This::wxSlider(), PageSize::integer().
setPageSize(#wx_ref{type=ThisT,ref=ThisRef},PageSize)
when is_integer(PageSize) ->
?CLASS(ThisT,wxSlider),
wxe_util:cast(?wxSlider_SetPageSize,
<<ThisRef:32/?UI,PageSize:32/?UI>>).
-%% @spec (This::wxSlider(), MinValue::integer(), MaxValue::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxslider.html#wxslidersetrange">external documentation</a>.
+-spec setRange(This, MinValue, MaxValue) -> ok when
+ This::wxSlider(), MinValue::integer(), MaxValue::integer().
setRange(#wx_ref{type=ThisT,ref=ThisRef},MinValue,MaxValue)
when is_integer(MinValue),is_integer(MaxValue) ->
?CLASS(ThisT,wxSlider),
wxe_util:cast(?wxSlider_SetRange,
<<ThisRef:32/?UI,MinValue:32/?UI,MaxValue:32/?UI>>).
-%% @spec (This::wxSlider(), LenPixels::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxslider.html#wxslidersetthumblength">external documentation</a>.
+-spec setThumbLength(This, LenPixels) -> ok when
+ This::wxSlider(), LenPixels::integer().
setThumbLength(#wx_ref{type=ThisT,ref=ThisRef},LenPixels)
when is_integer(LenPixels) ->
?CLASS(ThisT,wxSlider),
wxe_util:cast(?wxSlider_SetThumbLength,
<<ThisRef:32/?UI,LenPixels:32/?UI>>).
-%% @spec (This::wxSlider(), Value::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxslider.html#wxslidersetvalue">external documentation</a>.
+-spec setValue(This, Value) -> ok when
+ This::wxSlider(), Value::integer().
setValue(#wx_ref{type=ThisT,ref=ThisRef},Value)
when is_integer(Value) ->
?CLASS(ThisT,wxSlider),
wxe_util:cast(?wxSlider_SetValue,
<<ThisRef:32/?UI,Value:32/?UI>>).
-%% @spec (This::wxSlider()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxSlider()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxSlider),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxSpinButton.erl b/lib/wx/src/gen/wxSpinButton.erl
index e269dbe329..0f1dea75b6 100644
--- a/lib/wx/src/gen/wxSpinButton.erl
+++ b/lib/wx/src/gen/wxSpinButton.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -70,27 +70,35 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxSpinButton/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxSpinButton()
+-type wxSpinButton() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinbutton.html#wxspinbuttonwxspinbutton">external documentation</a>.
+-spec new() -> wxSpinButton().
new() ->
wxe_util:construct(?wxSpinButton_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxSpinButton()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxSpinButton() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxSpinButton()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinbutton.html#wxspinbuttonwxspinbutton">external documentation</a>.
+-spec new(Parent, [Option]) -> wxSpinButton() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -103,15 +111,21 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxSpinButton_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSpinButton(), Parent::wxWindow:wxWindow()) -> bool()
%% @equiv create(This,Parent, [])
+-spec create(This, Parent) -> boolean() when
+ This::wxSpinButton(), Parent::wxWindow:wxWindow().
+
create(This,Parent)
when is_record(This, wx_ref),is_record(Parent, wx_ref) ->
create(This,Parent, []).
-%% @spec (This::wxSpinButton(), Parent::wxWindow:wxWindow(), [Option]) -> bool()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinbutton.html#wxspinbuttoncreate">external documentation</a>.
+-spec create(This, Parent, [Option]) -> boolean() when
+ This::wxSpinButton(), Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxSpinButton),
@@ -125,45 +139,50 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Opti
wxe_util:call(?wxSpinButton_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxSpinButton()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinbutton.html#wxspinbuttongetmax">external documentation</a>.
+-spec getMax(This) -> integer() when
+ This::wxSpinButton().
getMax(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSpinButton),
wxe_util:call(?wxSpinButton_GetMax,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSpinButton()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinbutton.html#wxspinbuttongetmin">external documentation</a>.
+-spec getMin(This) -> integer() when
+ This::wxSpinButton().
getMin(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSpinButton),
wxe_util:call(?wxSpinButton_GetMin,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSpinButton()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinbutton.html#wxspinbuttongetvalue">external documentation</a>.
+-spec getValue(This) -> integer() when
+ This::wxSpinButton().
getValue(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSpinButton),
wxe_util:call(?wxSpinButton_GetValue,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSpinButton(), MinVal::integer(), MaxVal::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinbutton.html#wxspinbuttonsetrange">external documentation</a>.
+-spec setRange(This, MinVal, MaxVal) -> ok when
+ This::wxSpinButton(), MinVal::integer(), MaxVal::integer().
setRange(#wx_ref{type=ThisT,ref=ThisRef},MinVal,MaxVal)
when is_integer(MinVal),is_integer(MaxVal) ->
?CLASS(ThisT,wxSpinButton),
wxe_util:cast(?wxSpinButton_SetRange,
<<ThisRef:32/?UI,MinVal:32/?UI,MaxVal:32/?UI>>).
-%% @spec (This::wxSpinButton(), Value::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinbutton.html#wxspinbuttonsetvalue">external documentation</a>.
+-spec setValue(This, Value) -> ok when
+ This::wxSpinButton(), Value::integer().
setValue(#wx_ref{type=ThisT,ref=ThisRef},Value)
when is_integer(Value) ->
?CLASS(ThisT,wxSpinButton),
wxe_util:cast(?wxSpinButton_SetValue,
<<ThisRef:32/?UI,Value:32/?UI>>).
-%% @spec (This::wxSpinButton()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxSpinButton()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxSpinButton),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxSpinCtrl.erl b/lib/wx/src/gen/wxSpinCtrl.erl
index c6e8ad2238..82e49da46d 100644
--- a/lib/wx/src/gen/wxSpinCtrl.erl
+++ b/lib/wx/src/gen/wxSpinCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -70,27 +70,39 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxSpinCtrl/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxSpinCtrl()
+-type wxSpinCtrl() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinctrl.html#wxspinctrlwxspinctrl">external documentation</a>.
+-spec new() -> wxSpinCtrl().
new() ->
wxe_util:construct(?wxSpinCtrl_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxSpinCtrl()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxSpinCtrl() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxSpinCtrl()
-%% Option = {id, integer()} | {value, string()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {min, integer()} | {max, integer()} | {initial, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinctrl.html#wxspinctrlwxspinctrl">external documentation</a>.
+-spec new(Parent, [Option]) -> wxSpinCtrl() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {value, unicode:chardata()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {min, integer()}
+ | {max, integer()}
+ | {initial, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -107,15 +119,25 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxSpinCtrl_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSpinCtrl(), Parent::wxWindow:wxWindow()) -> bool()
%% @equiv create(This,Parent, [])
+-spec create(This, Parent) -> boolean() when
+ This::wxSpinCtrl(), Parent::wxWindow:wxWindow().
+
create(This,Parent)
when is_record(This, wx_ref),is_record(Parent, wx_ref) ->
create(This,Parent, []).
-%% @spec (This::wxSpinCtrl(), Parent::wxWindow:wxWindow(), [Option]) -> bool()
-%% Option = {id, integer()} | {value, string()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {min, integer()} | {max, integer()} | {initial, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinctrl.html#wxspinctrlcreate">external documentation</a>.
+-spec create(This, Parent, [Option]) -> boolean() when
+ This::wxSpinCtrl(), Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {value, unicode:chardata()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {min, integer()}
+ | {max, integer()}
+ | {initial, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxSpinCtrl),
@@ -133,15 +155,15 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Opti
wxe_util:call(?wxSpinCtrl_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxSpinCtrl(),X::integer()|string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinctrl.html#wxspinctrlsetvalue">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setValue(This::wxSpinCtrl(), Value::integer()) -> ok </c>
-%% </p>
-%% <p><c>
-%% setValue(This::wxSpinCtrl(), Text::string()) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% setValue(This, Text) -> ok when<br />
+%% This::wxSpinCtrl(), Text::unicode:chardata().<br />
+%%
+-spec setValue(This, Value) -> ok when
+ This::wxSpinCtrl(), Value::integer();
+ (This, Text) -> ok when
+ This::wxSpinCtrl(), Text::unicode:chardata().
setValue(#wx_ref{type=ThisT,ref=ThisRef},Value)
when is_integer(Value) ->
?CLASS(ThisT,wxSpinCtrl),
@@ -154,45 +176,50 @@ setValue(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:cast(?wxSpinCtrl_SetValue_1_1,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxSpinCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinctrl.html#wxspinctrlgetvalue">external documentation</a>.
+-spec getValue(This) -> integer() when
+ This::wxSpinCtrl().
getValue(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSpinCtrl),
wxe_util:call(?wxSpinCtrl_GetValue,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSpinCtrl(), MinVal::integer(), MaxVal::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinctrl.html#wxspinctrlsetrange">external documentation</a>.
+-spec setRange(This, MinVal, MaxVal) -> ok when
+ This::wxSpinCtrl(), MinVal::integer(), MaxVal::integer().
setRange(#wx_ref{type=ThisT,ref=ThisRef},MinVal,MaxVal)
when is_integer(MinVal),is_integer(MaxVal) ->
?CLASS(ThisT,wxSpinCtrl),
wxe_util:cast(?wxSpinCtrl_SetRange,
<<ThisRef:32/?UI,MinVal:32/?UI,MaxVal:32/?UI>>).
-%% @spec (This::wxSpinCtrl(), From::integer(), To::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinctrl.html#wxspinctrlsetselection">external documentation</a>.
+-spec setSelection(This, From, To) -> ok when
+ This::wxSpinCtrl(), From::integer(), To::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},From,To)
when is_integer(From),is_integer(To) ->
?CLASS(ThisT,wxSpinCtrl),
wxe_util:cast(?wxSpinCtrl_SetSelection,
<<ThisRef:32/?UI,From:32/?UI,To:32/?UI>>).
-%% @spec (This::wxSpinCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinctrl.html#wxspinctrlgetmin">external documentation</a>.
+-spec getMin(This) -> integer() when
+ This::wxSpinCtrl().
getMin(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSpinCtrl),
wxe_util:call(?wxSpinCtrl_GetMin,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSpinCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinctrl.html#wxspinctrlgetmax">external documentation</a>.
+-spec getMax(This) -> integer() when
+ This::wxSpinCtrl().
getMax(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSpinCtrl),
wxe_util:call(?wxSpinCtrl_GetMax,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSpinCtrl()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxSpinCtrl()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxSpinCtrl),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxSpinEvent.erl b/lib/wx/src/gen/wxSpinEvent.erl
index 82edc70983..ecbe557c7b 100644
--- a/lib/wx/src/gen/wxSpinEvent.erl
+++ b/lib/wx/src/gen/wxSpinEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -41,21 +41,25 @@
isSelection/1,parent_class/1,resumePropagation/2,setInt/2,setString/2,
shouldPropagate/1,skip/1,skip/2,stopPropagation/1,veto/1]).
+-export_type([wxSpinEvent/0]).
%% @hidden
parent_class(wxNotifyEvent) -> true;
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxSpinEvent()) -> integer()
+-type wxSpinEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinevent.html#wxspineventgetposition">external documentation</a>.
+-spec getPosition(This) -> integer() when
+ This::wxSpinEvent().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSpinEvent),
wxe_util:call(?wxSpinEvent_GetPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSpinEvent(), Pos::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxspinevent.html#wxspineventsetposition">external documentation</a>.
+-spec setPosition(This, Pos) -> ok when
+ This::wxSpinEvent(), Pos::integer().
setPosition(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxSpinEvent),
diff --git a/lib/wx/src/gen/wxSplashScreen.erl b/lib/wx/src/gen/wxSplashScreen.erl
index 79ef8e413a..2222f5e64e 100644
--- a/lib/wx/src/gen/wxSplashScreen.erl
+++ b/lib/wx/src/gen/wxSplashScreen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -80,6 +80,7 @@
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
validate/1,warpPointer/3]).
+-export_type([wxSplashScreen/0]).
%% @hidden
parent_class(wxFrame) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -87,21 +88,27 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxSplashScreen()
+-type wxSplashScreen() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplashscreen.html#wxsplashscreenwxsplashscreen">external documentation</a>.
+-spec new() -> wxSplashScreen().
new() ->
wxe_util:construct(?wxSplashScreen_new_0,
<<>>).
-%% @spec (Bitmap::wxBitmap:wxBitmap(), SplashStyle::integer(), Milliseconds::integer(), Parent::wxWindow:wxWindow(), Id::integer()) -> wxSplashScreen()
%% @equiv new(Bitmap,SplashStyle,Milliseconds,Parent,Id, [])
+-spec new(Bitmap, SplashStyle, Milliseconds, Parent, Id) -> wxSplashScreen() when
+ Bitmap::wxBitmap:wxBitmap(), SplashStyle::integer(), Milliseconds::integer(), Parent::wxWindow:wxWindow(), Id::integer().
+
new(Bitmap,SplashStyle,Milliseconds,Parent,Id)
when is_record(Bitmap, wx_ref),is_integer(SplashStyle),is_integer(Milliseconds),is_record(Parent, wx_ref),is_integer(Id) ->
new(Bitmap,SplashStyle,Milliseconds,Parent,Id, []).
-%% @spec (Bitmap::wxBitmap:wxBitmap(), SplashStyle::integer(), Milliseconds::integer(), Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxSplashScreen()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplashscreen.html#wxsplashscreenwxsplashscreen">external documentation</a>.
+-spec new(Bitmap, SplashStyle, Milliseconds, Parent, Id, [Option]) -> wxSplashScreen() when
+ Bitmap::wxBitmap:wxBitmap(), SplashStyle::integer(), Milliseconds::integer(), Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=BitmapT,ref=BitmapRef},SplashStyle,Milliseconds,#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(SplashStyle),is_integer(Milliseconds),is_integer(Id),is_list(Options) ->
?CLASS(BitmapT,wxBitmap),
@@ -114,22 +121,24 @@ new(#wx_ref{type=BitmapT,ref=BitmapRef},SplashStyle,Milliseconds,#wx_ref{type=Pa
wxe_util:construct(?wxSplashScreen_new_6,
<<BitmapRef:32/?UI,SplashStyle:32/?UI,Milliseconds:32/?UI,ParentRef:32/?UI,Id:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSplashScreen()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplashscreen.html#wxsplashscreengetsplashstyle">external documentation</a>.
+-spec getSplashStyle(This) -> integer() when
+ This::wxSplashScreen().
getSplashStyle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSplashScreen),
wxe_util:call(?wxSplashScreen_GetSplashStyle,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSplashScreen()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplashscreen.html#wxsplashscreengettimeout">external documentation</a>.
+-spec getTimeout(This) -> integer() when
+ This::wxSplashScreen().
getTimeout(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSplashScreen),
wxe_util:call(?wxSplashScreen_GetTimeout,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSplashScreen()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxSplashScreen()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxSplashScreen),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxSplitterEvent.erl b/lib/wx/src/gen/wxSplitterEvent.erl
index 512f858284..bba9b13abd 100644
--- a/lib/wx/src/gen/wxSplitterEvent.erl
+++ b/lib/wx/src/gen/wxSplitterEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -41,42 +41,49 @@
isSelection/1,parent_class/1,resumePropagation/2,setInt/2,setString/2,
shouldPropagate/1,skip/1,skip/2,stopPropagation/1,veto/1]).
+-export_type([wxSplitterEvent/0]).
%% @hidden
parent_class(wxNotifyEvent) -> true;
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxSplitterEvent()) -> integer()
+-type wxSplitterEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterevent.html#wxsplittereventgetsashposition">external documentation</a>.
+-spec getSashPosition(This) -> integer() when
+ This::wxSplitterEvent().
getSashPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSplitterEvent),
wxe_util:call(?wxSplitterEvent_GetSashPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSplitterEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterevent.html#wxsplittereventgetx">external documentation</a>.
+-spec getX(This) -> integer() when
+ This::wxSplitterEvent().
getX(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSplitterEvent),
wxe_util:call(?wxSplitterEvent_GetX,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSplitterEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterevent.html#wxsplittereventgety">external documentation</a>.
+-spec getY(This) -> integer() when
+ This::wxSplitterEvent().
getY(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSplitterEvent),
wxe_util:call(?wxSplitterEvent_GetY,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSplitterEvent()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterevent.html#wxsplittereventgetwindowbeingremoved">external documentation</a>.
+-spec getWindowBeingRemoved(This) -> wxWindow:wxWindow() when
+ This::wxSplitterEvent().
getWindowBeingRemoved(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSplitterEvent),
wxe_util:call(?wxSplitterEvent_GetWindowBeingRemoved,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSplitterEvent(), Pos::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterevent.html#wxsplittereventsetsashposition">external documentation</a>.
+-spec setSashPosition(This, Pos) -> ok when
+ This::wxSplitterEvent(), Pos::integer().
setSashPosition(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxSplitterEvent),
diff --git a/lib/wx/src/gen/wxSplitterWindow.erl b/lib/wx/src/gen/wxSplitterWindow.erl
index b17fed3151..231f93911f 100644
--- a/lib/wx/src/gen/wxSplitterWindow.erl
+++ b/lib/wx/src/gen/wxSplitterWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -73,26 +73,34 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxSplitterWindow/0]).
%% @hidden
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxSplitterWindow()
+-type wxSplitterWindow() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowwxsplitterwindow">external documentation</a>.
+-spec new() -> wxSplitterWindow().
new() ->
wxe_util:construct(?wxSplitterWindow_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxSplitterWindow()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxSplitterWindow() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxSplitterWindow()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowwxsplitterwindow">external documentation</a>.
+-spec new(Parent, [Option]) -> wxSplitterWindow() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -105,15 +113,21 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxSplitterWindow_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSplitterWindow(), Parent::wxWindow:wxWindow()) -> bool()
%% @equiv create(This,Parent, [])
+-spec create(This, Parent) -> boolean() when
+ This::wxSplitterWindow(), Parent::wxWindow:wxWindow().
+
create(This,Parent)
when is_record(This, wx_ref),is_record(Parent, wx_ref) ->
create(This,Parent, []).
-%% @spec (This::wxSplitterWindow(), Parent::wxWindow:wxWindow(), [Option]) -> bool()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowcreate">external documentation</a>.
+-spec create(This, Parent, [Option]) -> boolean() when
+ This::wxSplitterWindow(), Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxSplitterWindow),
@@ -127,67 +141,75 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Opti
wxe_util:call(?wxSplitterWindow_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxSplitterWindow()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowgetminimumpanesize">external documentation</a>.
+-spec getMinimumPaneSize(This) -> integer() when
+ This::wxSplitterWindow().
getMinimumPaneSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSplitterWindow),
wxe_util:call(?wxSplitterWindow_GetMinimumPaneSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSplitterWindow()) -> float()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowgetsashgravity">external documentation</a>.
+-spec getSashGravity(This) -> number() when
+ This::wxSplitterWindow().
getSashGravity(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSplitterWindow),
wxe_util:call(?wxSplitterWindow_GetSashGravity,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSplitterWindow()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowgetsashposition">external documentation</a>.
+-spec getSashPosition(This) -> integer() when
+ This::wxSplitterWindow().
getSashPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSplitterWindow),
wxe_util:call(?wxSplitterWindow_GetSashPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSplitterWindow()) -> WxSplitMode
-%% WxSplitMode = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowgetsplitmode">external documentation</a>.
-%%<br /> WxSplitMode is one of ?wxSPLIT_HORIZONTAL | ?wxSPLIT_VERTICAL
+%%<br /> Res = ?wxSPLIT_HORIZONTAL | ?wxSPLIT_VERTICAL
+-spec getSplitMode(This) -> wx:wx_enum() when
+ This::wxSplitterWindow().
getSplitMode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSplitterWindow),
wxe_util:call(?wxSplitterWindow_GetSplitMode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSplitterWindow()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowgetwindow1">external documentation</a>.
+-spec getWindow1(This) -> wxWindow:wxWindow() when
+ This::wxSplitterWindow().
getWindow1(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSplitterWindow),
wxe_util:call(?wxSplitterWindow_GetWindow1,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSplitterWindow()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowgetwindow2">external documentation</a>.
+-spec getWindow2(This) -> wxWindow:wxWindow() when
+ This::wxSplitterWindow().
getWindow2(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSplitterWindow),
wxe_util:call(?wxSplitterWindow_GetWindow2,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSplitterWindow(), Window::wxWindow:wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowinitialize">external documentation</a>.
+-spec initialize(This, Window) -> ok when
+ This::wxSplitterWindow(), Window::wxWindow:wxWindow().
initialize(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef}) ->
?CLASS(ThisT,wxSplitterWindow),
?CLASS(WindowT,wxWindow),
wxe_util:cast(?wxSplitterWindow_Initialize,
<<ThisRef:32/?UI,WindowRef:32/?UI>>).
-%% @spec (This::wxSplitterWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowissplit">external documentation</a>.
+-spec isSplit(This) -> boolean() when
+ This::wxSplitterWindow().
isSplit(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSplitterWindow),
wxe_util:call(?wxSplitterWindow_IsSplit,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSplitterWindow(), WinOld::wxWindow:wxWindow(), WinNew::wxWindow:wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowreplacewindow">external documentation</a>.
+-spec replaceWindow(This, WinOld, WinNew) -> boolean() when
+ This::wxSplitterWindow(), WinOld::wxWindow:wxWindow(), WinNew::wxWindow:wxWindow().
replaceWindow(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WinOldT,ref=WinOldRef},#wx_ref{type=WinNewT,ref=WinNewRef}) ->
?CLASS(ThisT,wxSplitterWindow),
?CLASS(WinOldT,wxWindow),
@@ -195,23 +217,27 @@ replaceWindow(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WinOldT,ref=WinOldRef
wxe_util:call(?wxSplitterWindow_ReplaceWindow,
<<ThisRef:32/?UI,WinOldRef:32/?UI,WinNewRef:32/?UI>>).
-%% @spec (This::wxSplitterWindow(), Gravity::float()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowsetsashgravity">external documentation</a>.
+-spec setSashGravity(This, Gravity) -> ok when
+ This::wxSplitterWindow(), Gravity::number().
setSashGravity(#wx_ref{type=ThisT,ref=ThisRef},Gravity)
- when is_float(Gravity) ->
+ when is_number(Gravity) ->
?CLASS(ThisT,wxSplitterWindow),
wxe_util:cast(?wxSplitterWindow_SetSashGravity,
<<ThisRef:32/?UI,0:32,Gravity:64/?F>>).
-%% @spec (This::wxSplitterWindow(), Position::integer()) -> ok
%% @equiv setSashPosition(This,Position, [])
+-spec setSashPosition(This, Position) -> ok when
+ This::wxSplitterWindow(), Position::integer().
+
setSashPosition(This,Position)
when is_record(This, wx_ref),is_integer(Position) ->
setSashPosition(This,Position, []).
-%% @spec (This::wxSplitterWindow(), Position::integer(), [Option]) -> ok
-%% Option = {redraw, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowsetsashposition">external documentation</a>.
+-spec setSashPosition(This, Position, [Option]) -> ok when
+ This::wxSplitterWindow(), Position::integer(),
+ Option :: {redraw, boolean()}.
setSashPosition(#wx_ref{type=ThisT,ref=ThisRef},Position, Options)
when is_integer(Position),is_list(Options) ->
?CLASS(ThisT,wxSplitterWindow),
@@ -221,39 +247,45 @@ setSashPosition(#wx_ref{type=ThisT,ref=ThisRef},Position, Options)
wxe_util:cast(?wxSplitterWindow_SetSashPosition,
<<ThisRef:32/?UI,Position:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxSplitterWindow(), Width::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowsetsashsize">external documentation</a>.
+-spec setSashSize(This, Width) -> ok when
+ This::wxSplitterWindow(), Width::integer().
setSashSize(#wx_ref{type=ThisT,ref=ThisRef},Width)
when is_integer(Width) ->
?CLASS(ThisT,wxSplitterWindow),
wxe_util:cast(?wxSplitterWindow_SetSashSize,
<<ThisRef:32/?UI,Width:32/?UI>>).
-%% @spec (This::wxSplitterWindow(), Min::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowsetminimumpanesize">external documentation</a>.
+-spec setMinimumPaneSize(This, Min) -> ok when
+ This::wxSplitterWindow(), Min::integer().
setMinimumPaneSize(#wx_ref{type=ThisT,ref=ThisRef},Min)
when is_integer(Min) ->
?CLASS(ThisT,wxSplitterWindow),
wxe_util:cast(?wxSplitterWindow_SetMinimumPaneSize,
<<ThisRef:32/?UI,Min:32/?UI>>).
-%% @spec (This::wxSplitterWindow(), Mode::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowsetsplitmode">external documentation</a>.
+-spec setSplitMode(This, Mode) -> ok when
+ This::wxSplitterWindow(), Mode::integer().
setSplitMode(#wx_ref{type=ThisT,ref=ThisRef},Mode)
when is_integer(Mode) ->
?CLASS(ThisT,wxSplitterWindow),
wxe_util:cast(?wxSplitterWindow_SetSplitMode,
<<ThisRef:32/?UI,Mode:32/?UI>>).
-%% @spec (This::wxSplitterWindow(), Window1::wxWindow:wxWindow(), Window2::wxWindow:wxWindow()) -> bool()
%% @equiv splitHorizontally(This,Window1,Window2, [])
+-spec splitHorizontally(This, Window1, Window2) -> boolean() when
+ This::wxSplitterWindow(), Window1::wxWindow:wxWindow(), Window2::wxWindow:wxWindow().
+
splitHorizontally(This,Window1,Window2)
when is_record(This, wx_ref),is_record(Window1, wx_ref),is_record(Window2, wx_ref) ->
splitHorizontally(This,Window1,Window2, []).
-%% @spec (This::wxSplitterWindow(), Window1::wxWindow:wxWindow(), Window2::wxWindow:wxWindow(), [Option]) -> bool()
-%% Option = {sashPosition, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowsplithorizontally">external documentation</a>.
+-spec splitHorizontally(This, Window1, Window2, [Option]) -> boolean() when
+ This::wxSplitterWindow(), Window1::wxWindow:wxWindow(), Window2::wxWindow:wxWindow(),
+ Option :: {sashPosition, integer()}.
splitHorizontally(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=Window1T,ref=Window1Ref},#wx_ref{type=Window2T,ref=Window2Ref}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxSplitterWindow),
@@ -265,15 +297,18 @@ splitHorizontally(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=Window1T,ref=Wind
wxe_util:call(?wxSplitterWindow_SplitHorizontally,
<<ThisRef:32/?UI,Window1Ref:32/?UI,Window2Ref:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSplitterWindow(), Window1::wxWindow:wxWindow(), Window2::wxWindow:wxWindow()) -> bool()
%% @equiv splitVertically(This,Window1,Window2, [])
+-spec splitVertically(This, Window1, Window2) -> boolean() when
+ This::wxSplitterWindow(), Window1::wxWindow:wxWindow(), Window2::wxWindow:wxWindow().
+
splitVertically(This,Window1,Window2)
when is_record(This, wx_ref),is_record(Window1, wx_ref),is_record(Window2, wx_ref) ->
splitVertically(This,Window1,Window2, []).
-%% @spec (This::wxSplitterWindow(), Window1::wxWindow:wxWindow(), Window2::wxWindow:wxWindow(), [Option]) -> bool()
-%% Option = {sashPosition, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowsplitvertically">external documentation</a>.
+-spec splitVertically(This, Window1, Window2, [Option]) -> boolean() when
+ This::wxSplitterWindow(), Window1::wxWindow:wxWindow(), Window2::wxWindow:wxWindow(),
+ Option :: {sashPosition, integer()}.
splitVertically(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=Window1T,ref=Window1Ref},#wx_ref{type=Window2T,ref=Window2Ref}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxSplitterWindow),
@@ -285,15 +320,18 @@ splitVertically(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=Window1T,ref=Window
wxe_util:call(?wxSplitterWindow_SplitVertically,
<<ThisRef:32/?UI,Window1Ref:32/?UI,Window2Ref:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSplitterWindow()) -> bool()
%% @equiv unsplit(This, [])
+-spec unsplit(This) -> boolean() when
+ This::wxSplitterWindow().
+
unsplit(This)
when is_record(This, wx_ref) ->
unsplit(This, []).
-%% @spec (This::wxSplitterWindow(), [Option]) -> bool()
-%% Option = {toRemove, wxWindow:wxWindow()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowunsplit">external documentation</a>.
+-spec unsplit(This, [Option]) -> boolean() when
+ This::wxSplitterWindow(),
+ Option :: {toRemove, wxWindow:wxWindow()}.
unsplit(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxSplitterWindow),
@@ -303,15 +341,16 @@ unsplit(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxSplitterWindow_Unsplit,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxSplitterWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsplitterwindow.html#wxsplitterwindowupdatesize">external documentation</a>.
+-spec updateSize(This) -> ok when
+ This::wxSplitterWindow().
updateSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxSplitterWindow),
wxe_util:cast(?wxSplitterWindow_UpdateSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxSplitterWindow()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxSplitterWindow()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxSplitterWindow),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxStaticBitmap.erl b/lib/wx/src/gen/wxStaticBitmap.erl
index 31e39b3a6c..02272c8107 100644
--- a/lib/wx/src/gen/wxStaticBitmap.erl
+++ b/lib/wx/src/gen/wxStaticBitmap.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -69,27 +69,34 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxStaticBitmap/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxStaticBitmap()
+-type wxStaticBitmap() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticbitmap.html#wxstaticbitmapwxstaticbitmap">external documentation</a>.
+-spec new() -> wxStaticBitmap().
new() ->
wxe_util:construct(?wxStaticBitmap_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Label::wxBitmap:wxBitmap()) -> wxStaticBitmap()
%% @equiv new(Parent,Id,Label, [])
+-spec new(Parent, Id, Label) -> wxStaticBitmap() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Label::wxBitmap:wxBitmap().
+
new(Parent,Id,Label)
when is_record(Parent, wx_ref),is_integer(Id),is_record(Label, wx_ref) ->
new(Parent,Id,Label, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Label::wxBitmap:wxBitmap(), [Option]) -> wxStaticBitmap()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticbitmap.html#wxstaticbitmapwxstaticbitmap">external documentation</a>.
+-spec new(Parent, Id, Label, [Option]) -> wxStaticBitmap() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Label::wxBitmap:wxBitmap(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,#wx_ref{type=LabelT,ref=LabelRef}, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -102,15 +109,20 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,#wx_ref{type=LabelT,ref=LabelRef}, Op
wxe_util:construct(?wxStaticBitmap_new_4,
<<ParentRef:32/?UI,Id:32/?UI,LabelRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxStaticBitmap(), Parent::wxWindow:wxWindow(), Id::integer(), Label::wxBitmap:wxBitmap()) -> bool()
%% @equiv create(This,Parent,Id,Label, [])
+-spec create(This, Parent, Id, Label) -> boolean() when
+ This::wxStaticBitmap(), Parent::wxWindow:wxWindow(), Id::integer(), Label::wxBitmap:wxBitmap().
+
create(This,Parent,Id,Label)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_record(Label, wx_ref) ->
create(This,Parent,Id,Label, []).
-%% @spec (This::wxStaticBitmap(), Parent::wxWindow:wxWindow(), Id::integer(), Label::wxBitmap:wxBitmap(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticbitmap.html#wxstaticbitmapcreate">external documentation</a>.
+-spec create(This, Parent, Id, Label, [Option]) -> boolean() when
+ This::wxStaticBitmap(), Parent::wxWindow:wxWindow(), Id::integer(), Label::wxBitmap:wxBitmap(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,#wx_ref{type=LabelT,ref=LabelRef}, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ThisT,wxStaticBitmap),
@@ -124,23 +136,25 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,#w
wxe_util:call(?wxStaticBitmap_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,LabelRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxStaticBitmap()) -> wxBitmap:wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticbitmap.html#wxstaticbitmapgetbitmap">external documentation</a>.
+-spec getBitmap(This) -> wxBitmap:wxBitmap() when
+ This::wxStaticBitmap().
getBitmap(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStaticBitmap),
wxe_util:call(?wxStaticBitmap_GetBitmap,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStaticBitmap(), Bitmap::wxBitmap:wxBitmap()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticbitmap.html#wxstaticbitmapsetbitmap">external documentation</a>.
+-spec setBitmap(This, Bitmap) -> ok when
+ This::wxStaticBitmap(), Bitmap::wxBitmap:wxBitmap().
setBitmap(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BitmapT,ref=BitmapRef}) ->
?CLASS(ThisT,wxStaticBitmap),
?CLASS(BitmapT,wxBitmap),
wxe_util:cast(?wxStaticBitmap_SetBitmap,
<<ThisRef:32/?UI,BitmapRef:32/?UI>>).
-%% @spec (This::wxStaticBitmap()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxStaticBitmap()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxStaticBitmap),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxStaticBox.erl b/lib/wx/src/gen/wxStaticBox.erl
index ec83ff5fd9..e4e390610a 100644
--- a/lib/wx/src/gen/wxStaticBox.erl
+++ b/lib/wx/src/gen/wxStaticBox.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -69,27 +69,34 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxStaticBox/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxStaticBox()
+-type wxStaticBox() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticbox.html#wxstaticboxwxstaticbox">external documentation</a>.
+-spec new() -> wxStaticBox().
new() ->
wxe_util:construct(?wxStaticBox_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Label::string()) -> wxStaticBox()
%% @equiv new(Parent,Id,Label, [])
+-spec new(Parent, Id, Label) -> wxStaticBox() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata().
+
new(Parent,Id,Label)
when is_record(Parent, wx_ref),is_integer(Id),is_list(Label) ->
new(Parent,Id,Label, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Label::string(), [Option]) -> wxStaticBox()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticbox.html#wxstaticboxwxstaticbox">external documentation</a>.
+-spec new(Parent, Id, Label, [Option]) -> wxStaticBox() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
when is_integer(Id),is_list(Label),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -102,15 +109,20 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
wxe_util:construct(?wxStaticBox_new_4,
<<ParentRef:32/?UI,Id:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxStaticBox(), Parent::wxWindow:wxWindow(), Id::integer(), Label::string()) -> bool()
%% @equiv create(This,Parent,Id,Label, [])
+-spec create(This, Parent, Id, Label) -> boolean() when
+ This::wxStaticBox(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata().
+
create(This,Parent,Id,Label)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Label) ->
create(This,Parent,Id,Label, []).
-%% @spec (This::wxStaticBox(), Parent::wxWindow:wxWindow(), Id::integer(), Label::string(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticbox.html#wxstaticboxcreate">external documentation</a>.
+-spec create(This, Parent, Id, Label, [Option]) -> boolean() when
+ This::wxStaticBox(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
when is_integer(Id),is_list(Label),is_list(Options) ->
?CLASS(ThisT,wxStaticBox),
@@ -124,8 +136,8 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,La
wxe_util:call(?wxStaticBox_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((0+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxStaticBox()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxStaticBox()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxStaticBox),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxStaticBoxSizer.erl b/lib/wx/src/gen/wxStaticBoxSizer.erl
index 2cf9f64325..fc8afc1146 100644
--- a/lib/wx/src/gen/wxStaticBoxSizer.erl
+++ b/lib/wx/src/gen/wxStaticBoxSizer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -41,19 +41,22 @@
setItemMinSize/4,setMinSize/2,setMinSize/3,setSizeHints/2,setVirtualSizeHints/2,
show/2,show/3]).
+-export_type([wxStaticBoxSizer/0]).
%% @hidden
parent_class(wxBoxSizer) -> true;
parent_class(wxSizer) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (X::integer()|term(),X::term()|integer()) -> wxStaticBoxSizer()
+-type wxStaticBoxSizer() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticboxsizer.html#wxstaticboxsizerwxstaticboxsizer">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% new(Orient::integer(), Win::wxWindow:wxWindow()) -> new(Orient,Win, []) </c></p>
-%% <p><c>
-%% new(Box::wxStaticBox:wxStaticBox(), Orient::integer()) -> wxStaticBoxSizer() </c>
-%% </p>
+%% <br /> Also:<br />
+%% new(Box, Orient) -> wxStaticBoxSizer() when<br />
+%% Box::wxStaticBox:wxStaticBox(), Orient::integer().<br />
+%%
+-spec new(Orient, Win) -> wxStaticBoxSizer() when
+ Orient::integer(), Win::wxWindow:wxWindow();
+ (Box, Orient) -> wxStaticBoxSizer() when
+ Box::wxStaticBox:wxStaticBox(), Orient::integer().
new(Orient,Win)
when is_integer(Orient),is_record(Win, wx_ref) ->
@@ -64,9 +67,10 @@ new(#wx_ref{type=BoxT,ref=BoxRef},Orient)
wxe_util:construct(?wxStaticBoxSizer_new_2,
<<BoxRef:32/?UI,Orient:32/?UI>>).
-%% @spec (Orient::integer(), Win::wxWindow:wxWindow(), [Option]) -> wxStaticBoxSizer()
-%% Option = {label, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticboxsizer.html#wxstaticboxsizerwxstaticboxsizer">external documentation</a>.
+-spec new(Orient, Win, [Option]) -> wxStaticBoxSizer() when
+ Orient::integer(), Win::wxWindow:wxWindow(),
+ Option :: {label, unicode:chardata()}.
new(Orient,#wx_ref{type=WinT,ref=WinRef}, Options)
when is_integer(Orient),is_list(Options) ->
?CLASS(WinT,wxWindow),
@@ -76,15 +80,16 @@ new(Orient,#wx_ref{type=WinT,ref=WinRef}, Options)
wxe_util:construct(?wxStaticBoxSizer_new_3,
<<Orient:32/?UI,WinRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxStaticBoxSizer()) -> wxStaticBox:wxStaticBox()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticboxsizer.html#wxstaticboxsizergetstaticbox">external documentation</a>.
+-spec getStaticBox(This) -> wxStaticBox:wxStaticBox() when
+ This::wxStaticBoxSizer().
getStaticBox(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStaticBoxSizer),
wxe_util:call(?wxStaticBoxSizer_GetStaticBox,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStaticBoxSizer()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxStaticBoxSizer()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxStaticBoxSizer),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxStaticLine.erl b/lib/wx/src/gen/wxStaticLine.erl
index a850065ba0..86a9975312 100644
--- a/lib/wx/src/gen/wxStaticLine.erl
+++ b/lib/wx/src/gen/wxStaticLine.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -70,27 +70,35 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxStaticLine/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxStaticLine()
+-type wxStaticLine() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticline.html#wxstaticlinewxstaticline">external documentation</a>.
+-spec new() -> wxStaticLine().
new() ->
wxe_util:construct(?wxStaticLine_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxStaticLine()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxStaticLine() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxStaticLine()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticline.html#wxstaticlinewxstaticline">external documentation</a>.
+-spec new(Parent, [Option]) -> wxStaticLine() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -103,15 +111,21 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxStaticLine_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxStaticLine(), Parent::wxWindow:wxWindow()) -> bool()
%% @equiv create(This,Parent, [])
+-spec create(This, Parent) -> boolean() when
+ This::wxStaticLine(), Parent::wxWindow:wxWindow().
+
create(This,Parent)
when is_record(This, wx_ref),is_record(Parent, wx_ref) ->
create(This,Parent, []).
-%% @spec (This::wxStaticLine(), Parent::wxWindow:wxWindow(), [Option]) -> bool()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticline.html#wxstaticlinecreate">external documentation</a>.
+-spec create(This, Parent, [Option]) -> boolean() when
+ This::wxStaticLine(), Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxStaticLine),
@@ -125,21 +139,22 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Opti
wxe_util:call(?wxStaticLine_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxStaticLine()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticline.html#wxstaticlineisvertical">external documentation</a>.
+-spec isVertical(This) -> boolean() when
+ This::wxStaticLine().
isVertical(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStaticLine),
wxe_util:call(?wxStaticLine_IsVertical,
<<ThisRef:32/?UI>>).
-%% @spec () -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstaticline.html#wxstaticlinegetdefaultsize">external documentation</a>.
+-spec getDefaultSize() -> integer().
getDefaultSize() ->
wxe_util:call(?wxStaticLine_GetDefaultSize,
<<>>).
-%% @spec (This::wxStaticLine()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxStaticLine()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxStaticLine),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxStaticText.erl b/lib/wx/src/gen/wxStaticText.erl
index 301999d49a..de779f66fc 100644
--- a/lib/wx/src/gen/wxStaticText.erl
+++ b/lib/wx/src/gen/wxStaticText.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -69,27 +69,34 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxStaticText/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxStaticText()
+-type wxStaticText() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatictext.html#wxstatictextwxstatictext">external documentation</a>.
+-spec new() -> wxStaticText().
new() ->
wxe_util:construct(?wxStaticText_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Label::string()) -> wxStaticText()
%% @equiv new(Parent,Id,Label, [])
+-spec new(Parent, Id, Label) -> wxStaticText() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata().
+
new(Parent,Id,Label)
when is_record(Parent, wx_ref),is_integer(Id),is_list(Label) ->
new(Parent,Id,Label, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Label::string(), [Option]) -> wxStaticText()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatictext.html#wxstatictextwxstatictext">external documentation</a>.
+-spec new(Parent, Id, Label, [Option]) -> wxStaticText() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
when is_integer(Id),is_list(Label),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -102,15 +109,20 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
wxe_util:construct(?wxStaticText_new_4,
<<ParentRef:32/?UI,Id:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxStaticText(), Parent::wxWindow:wxWindow(), Id::integer(), Label::string()) -> bool()
%% @equiv create(This,Parent,Id,Label, [])
+-spec create(This, Parent, Id, Label) -> boolean() when
+ This::wxStaticText(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata().
+
create(This,Parent,Id,Label)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Label) ->
create(This,Parent,Id,Label, []).
-%% @spec (This::wxStaticText(), Parent::wxWindow:wxWindow(), Id::integer(), Label::string(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatictext.html#wxstatictextcreate">external documentation</a>.
+-spec create(This, Parent, Id, Label, [Option]) -> boolean() when
+ This::wxStaticText(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
when is_integer(Id),is_list(Label),is_list(Options) ->
?CLASS(ThisT,wxStaticText),
@@ -124,15 +136,17 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,La
wxe_util:call(?wxStaticText_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((0+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxStaticText()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatictext.html#wxstatictextgetlabel">external documentation</a>.
+-spec getLabel(This) -> unicode:charlist() when
+ This::wxStaticText().
getLabel(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStaticText),
wxe_util:call(?wxStaticText_GetLabel,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStaticText(), Label::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatictext.html#wxstatictextsetlabel">external documentation</a>.
+-spec setLabel(This, Label) -> ok when
+ This::wxStaticText(), Label::unicode:chardata().
setLabel(#wx_ref{type=ThisT,ref=ThisRef},Label)
when is_list(Label) ->
?CLASS(ThisT,wxStaticText),
@@ -140,16 +154,17 @@ setLabel(#wx_ref{type=ThisT,ref=ThisRef},Label)
wxe_util:cast(?wxStaticText_SetLabel,
<<ThisRef:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((0+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStaticText(), Width::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatictext.html#wxstatictextwrap">external documentation</a>.
+-spec wrap(This, Width) -> ok when
+ This::wxStaticText(), Width::integer().
wrap(#wx_ref{type=ThisT,ref=ThisRef},Width)
when is_integer(Width) ->
?CLASS(ThisT,wxStaticText),
wxe_util:cast(?wxStaticText_Wrap,
<<ThisRef:32/?UI,Width:32/?UI>>).
-%% @spec (This::wxStaticText()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxStaticText()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxStaticText),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxStatusBar.erl b/lib/wx/src/gen/wxStatusBar.erl
index 6e77761f1d..31dab03b56 100644
--- a/lib/wx/src/gen/wxStatusBar.erl
+++ b/lib/wx/src/gen/wxStatusBar.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -71,26 +71,32 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxStatusBar/0]).
%% @hidden
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxStatusBar()
+-type wxStatusBar() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatusbar.html#wxstatusbarwxstatusbar">external documentation</a>.
+-spec new() -> wxStatusBar().
new() ->
wxe_util:construct(?wxStatusBar_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxStatusBar()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxStatusBar() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxStatusBar()
-%% Option = {winid, integer()} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatusbar.html#wxstatusbarwxstatusbar">external documentation</a>.
+-spec new(Parent, [Option]) -> wxStatusBar() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {winid, integer()}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -101,15 +107,19 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxStatusBar_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxStatusBar(), Parent::wxWindow:wxWindow()) -> bool()
%% @equiv create(This,Parent, [])
+-spec create(This, Parent) -> boolean() when
+ This::wxStatusBar(), Parent::wxWindow:wxWindow().
+
create(This,Parent)
when is_record(This, wx_ref),is_record(Parent, wx_ref) ->
create(This,Parent, []).
-%% @spec (This::wxStatusBar(), Parent::wxWindow:wxWindow(), [Option]) -> bool()
-%% Option = {winid, integer()} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatusbar.html#wxstatusbarcreate">external documentation</a>.
+-spec create(This, Parent, [Option]) -> boolean() when
+ This::wxStatusBar(), Parent::wxWindow:wxWindow(),
+ Option :: {winid, integer()}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxStatusBar),
@@ -121,30 +131,35 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Opti
wxe_util:call(?wxStatusBar_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxStatusBar(), I::integer(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatusbar.html#wxstatusbargetfieldrect">external documentation</a>.
+-spec getFieldRect(This, I, Rect) -> boolean() when
+ This::wxStatusBar(), I::integer(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
getFieldRect(#wx_ref{type=ThisT,ref=ThisRef},I,{RectX,RectY,RectW,RectH})
when is_integer(I),is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) ->
?CLASS(ThisT,wxStatusBar),
wxe_util:call(?wxStatusBar_GetFieldRect,
<<ThisRef:32/?UI,I:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxStatusBar()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatusbar.html#wxstatusbargetfieldscount">external documentation</a>.
+-spec getFieldsCount(This) -> integer() when
+ This::wxStatusBar().
getFieldsCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStatusBar),
wxe_util:call(?wxStatusBar_GetFieldsCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStatusBar()) -> string()
%% @equiv getStatusText(This, [])
+-spec getStatusText(This) -> unicode:charlist() when
+ This::wxStatusBar().
+
getStatusText(This)
when is_record(This, wx_ref) ->
getStatusText(This, []).
-%% @spec (This::wxStatusBar(), [Option]) -> string()
-%% Option = {number, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatusbar.html#wxstatusbargetstatustext">external documentation</a>.
+-spec getStatusText(This, [Option]) -> unicode:charlist() when
+ This::wxStatusBar(),
+ Option :: {number, integer()}.
getStatusText(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxStatusBar),
@@ -154,15 +169,18 @@ getStatusText(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxStatusBar_GetStatusText,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxStatusBar()) -> ok
%% @equiv popStatusText(This, [])
+-spec popStatusText(This) -> ok when
+ This::wxStatusBar().
+
popStatusText(This)
when is_record(This, wx_ref) ->
popStatusText(This, []).
-%% @spec (This::wxStatusBar(), [Option]) -> ok
-%% Option = {number, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatusbar.html#wxstatusbarpopstatustext">external documentation</a>.
+-spec popStatusText(This, [Option]) -> ok when
+ This::wxStatusBar(),
+ Option :: {number, integer()}.
popStatusText(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxStatusBar),
@@ -172,15 +190,18 @@ popStatusText(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxStatusBar_PopStatusText,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxStatusBar(), Text::string()) -> ok
%% @equiv pushStatusText(This,Text, [])
+-spec pushStatusText(This, Text) -> ok when
+ This::wxStatusBar(), Text::unicode:chardata().
+
pushStatusText(This,Text)
when is_record(This, wx_ref),is_list(Text) ->
pushStatusText(This,Text, []).
-%% @spec (This::wxStatusBar(), Text::string(), [Option]) -> ok
-%% Option = {number, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatusbar.html#wxstatusbarpushstatustext">external documentation</a>.
+-spec pushStatusText(This, Text, [Option]) -> ok when
+ This::wxStatusBar(), Text::unicode:chardata(),
+ Option :: {number, integer()}.
pushStatusText(#wx_ref{type=ThisT,ref=ThisRef},Text, Options)
when is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxStatusBar),
@@ -191,15 +212,18 @@ pushStatusText(#wx_ref{type=ThisT,ref=ThisRef},Text, Options)
wxe_util:cast(?wxStatusBar_PushStatusText,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxStatusBar(), Number::integer()) -> ok
%% @equiv setFieldsCount(This,Number, [])
+-spec setFieldsCount(This, Number) -> ok when
+ This::wxStatusBar(), Number::integer().
+
setFieldsCount(This,Number)
when is_record(This, wx_ref),is_integer(Number) ->
setFieldsCount(This,Number, []).
-%% @spec (This::wxStatusBar(), Number::integer(), [Option]) -> ok
-%% Option = {widths, [integer()]}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatusbar.html#wxstatusbarsetfieldscount">external documentation</a>.
+-spec setFieldsCount(This, Number, [Option]) -> ok when
+ This::wxStatusBar(), Number::integer(),
+ Option :: {widths, [integer()]}.
setFieldsCount(#wx_ref{type=ThisT,ref=ThisRef},Number, Options)
when is_integer(Number),is_list(Options) ->
?CLASS(ThisT,wxStatusBar),
@@ -210,23 +234,27 @@ setFieldsCount(#wx_ref{type=ThisT,ref=ThisRef},Number, Options)
wxe_util:cast(?wxStatusBar_SetFieldsCount,
<<ThisRef:32/?UI,Number:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxStatusBar(), Height::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatusbar.html#wxstatusbarsetminheight">external documentation</a>.
+-spec setMinHeight(This, Height) -> ok when
+ This::wxStatusBar(), Height::integer().
setMinHeight(#wx_ref{type=ThisT,ref=ThisRef},Height)
when is_integer(Height) ->
?CLASS(ThisT,wxStatusBar),
wxe_util:cast(?wxStatusBar_SetMinHeight,
<<ThisRef:32/?UI,Height:32/?UI>>).
-%% @spec (This::wxStatusBar(), Text::string()) -> ok
%% @equiv setStatusText(This,Text, [])
+-spec setStatusText(This, Text) -> ok when
+ This::wxStatusBar(), Text::unicode:chardata().
+
setStatusText(This,Text)
when is_record(This, wx_ref),is_list(Text) ->
setStatusText(This,Text, []).
-%% @spec (This::wxStatusBar(), Text::string(), [Option]) -> ok
-%% Option = {number, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatusbar.html#wxstatusbarsetstatustext">external documentation</a>.
+-spec setStatusText(This, Text, [Option]) -> ok when
+ This::wxStatusBar(), Text::unicode:chardata(),
+ Option :: {number, integer()}.
setStatusText(#wx_ref{type=ThisT,ref=ThisRef},Text, Options)
when is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxStatusBar),
@@ -237,8 +265,9 @@ setStatusText(#wx_ref{type=ThisT,ref=ThisRef},Text, Options)
wxe_util:cast(?wxStatusBar_SetStatusText,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxStatusBar(), Widths_field::[integer()]) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatusbar.html#wxstatusbarsetstatuswidths">external documentation</a>.
+-spec setStatusWidths(This, Widths_field) -> ok when
+ This::wxStatusBar(), Widths_field::[integer()].
setStatusWidths(#wx_ref{type=ThisT,ref=ThisRef},Widths_field)
when is_list(Widths_field) ->
?CLASS(ThisT,wxStatusBar),
@@ -246,8 +275,9 @@ setStatusWidths(#wx_ref{type=ThisT,ref=ThisRef},Widths_field)
<<ThisRef:32/?UI,(length(Widths_field)):32/?UI,
(<< <<C:32/?I>> || C <- Widths_field>>)/binary, 0:(((0+length(Widths_field)) rem 2)*32)>>).
-%% @spec (This::wxStatusBar(), Styles::[integer()]) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstatusbar.html#wxstatusbarsetstatusstyles">external documentation</a>.
+-spec setStatusStyles(This, Styles) -> ok when
+ This::wxStatusBar(), Styles::[integer()].
setStatusStyles(#wx_ref{type=ThisT,ref=ThisRef},Styles)
when is_list(Styles) ->
?CLASS(ThisT,wxStatusBar),
@@ -255,8 +285,8 @@ setStatusStyles(#wx_ref{type=ThisT,ref=ThisRef},Styles)
<<ThisRef:32/?UI,(length(Styles)):32/?UI,
(<< <<C:32/?I>> || C <- Styles>>)/binary, 0:(((0+length(Styles)) rem 2)*32)>>).
-%% @spec (This::wxStatusBar()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxStatusBar()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxStatusBar),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxStdDialogButtonSizer.erl b/lib/wx/src/gen/wxStdDialogButtonSizer.erl
index 3d31907275..078763e7cb 100644
--- a/lib/wx/src/gen/wxStdDialogButtonSizer.erl
+++ b/lib/wx/src/gen/wxStdDialogButtonSizer.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -42,58 +42,65 @@
setItemMinSize/4,setMinSize/2,setMinSize/3,setSizeHints/2,setVirtualSizeHints/2,
show/2,show/3]).
+-export_type([wxStdDialogButtonSizer/0]).
%% @hidden
parent_class(wxBoxSizer) -> true;
parent_class(wxSizer) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxStdDialogButtonSizer()
+-type wxStdDialogButtonSizer() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstddialogbuttonsizer.html#wxstddialogbuttonsizerwxstddialogbuttonsizer">external documentation</a>.
+-spec new() -> wxStdDialogButtonSizer().
new() ->
wxe_util:construct(?wxStdDialogButtonSizer_new,
<<>>).
-%% @spec (This::wxStdDialogButtonSizer(), Button::wxButton:wxButton()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstddialogbuttonsizer.html#wxstddialogbuttonsizeraddbutton">external documentation</a>.
+-spec addButton(This, Button) -> ok when
+ This::wxStdDialogButtonSizer(), Button::wxButton:wxButton().
addButton(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ButtonT,ref=ButtonRef}) ->
?CLASS(ThisT,wxStdDialogButtonSizer),
?CLASS(ButtonT,wxButton),
wxe_util:cast(?wxStdDialogButtonSizer_AddButton,
<<ThisRef:32/?UI,ButtonRef:32/?UI>>).
-%% @spec (This::wxStdDialogButtonSizer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstddialogbuttonsizer.html#wxstddialogbuttonsizerrealize">external documentation</a>.
+-spec realize(This) -> ok when
+ This::wxStdDialogButtonSizer().
realize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStdDialogButtonSizer),
wxe_util:cast(?wxStdDialogButtonSizer_Realize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStdDialogButtonSizer(), Button::wxButton:wxButton()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstddialogbuttonsizer.html#wxstddialogbuttonsizersetaffirmativebutton">external documentation</a>.
+-spec setAffirmativeButton(This, Button) -> ok when
+ This::wxStdDialogButtonSizer(), Button::wxButton:wxButton().
setAffirmativeButton(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ButtonT,ref=ButtonRef}) ->
?CLASS(ThisT,wxStdDialogButtonSizer),
?CLASS(ButtonT,wxButton),
wxe_util:cast(?wxStdDialogButtonSizer_SetAffirmativeButton,
<<ThisRef:32/?UI,ButtonRef:32/?UI>>).
-%% @spec (This::wxStdDialogButtonSizer(), Button::wxButton:wxButton()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstddialogbuttonsizer.html#wxstddialogbuttonsizersetcancelbutton">external documentation</a>.
+-spec setCancelButton(This, Button) -> ok when
+ This::wxStdDialogButtonSizer(), Button::wxButton:wxButton().
setCancelButton(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ButtonT,ref=ButtonRef}) ->
?CLASS(ThisT,wxStdDialogButtonSizer),
?CLASS(ButtonT,wxButton),
wxe_util:cast(?wxStdDialogButtonSizer_SetCancelButton,
<<ThisRef:32/?UI,ButtonRef:32/?UI>>).
-%% @spec (This::wxStdDialogButtonSizer(), Button::wxButton:wxButton()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstddialogbuttonsizer.html#wxstddialogbuttonsizersetnegativebutton">external documentation</a>.
+-spec setNegativeButton(This, Button) -> ok when
+ This::wxStdDialogButtonSizer(), Button::wxButton:wxButton().
setNegativeButton(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ButtonT,ref=ButtonRef}) ->
?CLASS(ThisT,wxStdDialogButtonSizer),
?CLASS(ButtonT,wxButton),
wxe_util:cast(?wxStdDialogButtonSizer_SetNegativeButton,
<<ThisRef:32/?UI,ButtonRef:32/?UI>>).
-%% @spec (This::wxStdDialogButtonSizer()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxStdDialogButtonSizer()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxStdDialogButtonSizer),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxStyledTextCtrl.erl b/lib/wx/src/gen/wxStyledTextCtrl.erl
index 61f0e5afef..f6dc2176b7 100644
--- a/lib/wx/src/gen/wxStyledTextCtrl.erl
+++ b/lib/wx/src/gen/wxStyledTextCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -99,14 +99,14 @@
setCaretForeground/2,setCaretLineBackAlpha/2,setCaretLineBackground/2,
setCaretLineVisible/2,setCaretPeriod/2,setCaretSticky/2,setCaretWidth/2,
setCharsDefault/1,setCodePage/2,setControlCharSymbol/2,setCurrentPos/2,
- setEOLMode/2,setEdgeColour/2,setEdgeColumn/2,setFoldExpanded/3,setFoldFlags/2,
- setFoldLevel/3,setFoldMarginColour/3,setFoldMarginHiColour/3,setHScrollBar/2,
- setHighlightGuide/2,setHotspotActiveBackground/3,setHotspotActiveForeground/3,
- setHotspotActiveUnderline/2,setHotspotSingleLine/2,setIndent/2,setIndentationGuides/2,
- setKeyWords/3,setLastKeydownProcessed/2,setLayoutCache/2,setLexer/2,
- setLexerLanguage/2,setLineIndentation/3,setLineState/3,setMarginLeft/2,
- setMarginMask/3,setMarginRight/2,setMarginSensitive/3,setMarginType/3,
- setMarginWidth/3,setMargins/3,setModEventMask/2,setMouseDownCaptures/2,
+ setEOLMode/2,setEdgeColour/2,setEdgeColumn/2,setEdgeMode/2,setFoldExpanded/3,
+ setFoldFlags/2,setFoldLevel/3,setFoldMarginColour/3,setFoldMarginHiColour/3,
+ setHScrollBar/2,setHighlightGuide/2,setHotspotActiveBackground/3,
+ setHotspotActiveForeground/3,setHotspotActiveUnderline/2,setHotspotSingleLine/2,
+ setIndent/2,setIndentationGuides/2,setKeyWords/3,setLastKeydownProcessed/2,
+ setLayoutCache/2,setLexer/2,setLexerLanguage/2,setLineIndentation/3,
+ setLineState/3,setMarginLeft/2,setMarginMask/3,setMarginRight/2,setMarginSensitive/3,
+ setMarginType/3,setMarginWidth/3,setMargins/3,setModEventMask/2,setMouseDownCaptures/2,
setMouseDwellTime/2,setPasteConvertEndings/2,setPrintColourMode/2,
setPrintMagnification/2,setProperty/3,setReadOnly/2,setSTCCursor/2,
setSTCFocus/2,setSavePoint/1,setScrollWidth/2,setSearchFlags/2,setSelAlpha/2,
@@ -171,27 +171,35 @@
transferDataToWindow/1,update/1,updateWindowUI/1,updateWindowUI/2,
validate/1,warpPointer/3]).
+-export_type([wxStyledTextCtrl/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxStyledTextCtrl()
+-type wxStyledTextCtrl() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwxstyledtextctrl">external documentation</a>.
+-spec new() -> wxStyledTextCtrl().
new() ->
wxe_util:construct(?wxStyledTextCtrl_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxStyledTextCtrl()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxStyledTextCtrl() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxStyledTextCtrl()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwxstyledtextctrl">external documentation</a>.
+-spec new(Parent, [Option]) -> wxStyledTextCtrl() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -204,15 +212,21 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxStyledTextCtrl_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxStyledTextCtrl(), Parent::wxWindow:wxWindow()) -> bool()
%% @equiv create(This,Parent, [])
+-spec create(This, Parent) -> boolean() when
+ This::wxStyledTextCtrl(), Parent::wxWindow:wxWindow().
+
create(This,Parent)
when is_record(This, wx_ref),is_record(Parent, wx_ref) ->
create(This,Parent, []).
-%% @spec (This::wxStyledTextCtrl(), Parent::wxWindow:wxWindow(), [Option]) -> bool()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcreate">external documentation</a>.
+-spec create(This, Parent, [Option]) -> boolean() when
+ This::wxStyledTextCtrl(), Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -226,8 +240,9 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Opti
wxe_util:call(?wxStyledTextCtrl_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxStyledTextCtrl(), Text::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrladdtext">external documentation</a>.
+-spec addText(This, Text) -> ok when
+ This::wxStyledTextCtrl(), Text::unicode:chardata().
addText(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_list(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -235,16 +250,18 @@ addText(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:cast(?wxStyledTextCtrl_AddText,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), Data::wxMemoryBuffer:wxMemoryBuffer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrladdstyledtext">external documentation</a>.
+-spec addStyledText(This, Data) -> ok when
+ This::wxStyledTextCtrl(), Data::wx:wx_object().
addStyledText(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DataT,ref=DataRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
?CLASS(DataT,wxMemoryBuffer),
wxe_util:cast(?wxStyledTextCtrl_AddStyledText,
<<ThisRef:32/?UI,DataRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer(), Text::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlinserttext">external documentation</a>.
+-spec insertText(This, Pos, Text) -> ok when
+ This::wxStyledTextCtrl(), Pos::integer(), Text::unicode:chardata().
insertText(#wx_ref{type=ThisT,ref=ThisRef},Pos,Text)
when is_integer(Pos),is_list(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -252,279 +269,319 @@ insertText(#wx_ref{type=ThisT,ref=ThisRef},Pos,Text)
wxe_util:cast(?wxStyledTextCtrl_InsertText,
<<ThisRef:32/?UI,Pos:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlclearall">external documentation</a>.
+-spec clearAll(This) -> ok when
+ This::wxStyledTextCtrl().
clearAll(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_ClearAll,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcleardocumentstyle">external documentation</a>.
+-spec clearDocumentStyle(This) -> ok when
+ This::wxStyledTextCtrl().
clearDocumentStyle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_ClearDocumentStyle,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetlength">external documentation</a>.
+-spec getLength(This) -> integer() when
+ This::wxStyledTextCtrl().
getLength(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetLength,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetcharat">external documentation</a>.
+-spec getCharAt(This, Pos) -> integer() when
+ This::wxStyledTextCtrl(), Pos::integer().
getCharAt(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetCharAt,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetcurrentpos">external documentation</a>.
+-spec getCurrentPos(This) -> integer() when
+ This::wxStyledTextCtrl().
getCurrentPos(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetCurrentPos,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetanchor">external documentation</a>.
+-spec getAnchor(This) -> integer() when
+ This::wxStyledTextCtrl().
getAnchor(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetAnchor,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetstyleat">external documentation</a>.
+-spec getStyleAt(This, Pos) -> integer() when
+ This::wxStyledTextCtrl(), Pos::integer().
getStyleAt(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetStyleAt,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlredo">external documentation</a>.
+-spec redo(This) -> ok when
+ This::wxStyledTextCtrl().
redo(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_Redo,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), CollectUndo::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetundocollection">external documentation</a>.
+-spec setUndoCollection(This, CollectUndo) -> ok when
+ This::wxStyledTextCtrl(), CollectUndo::boolean().
setUndoCollection(#wx_ref{type=ThisT,ref=ThisRef},CollectUndo)
when is_boolean(CollectUndo) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetUndoCollection,
<<ThisRef:32/?UI,(wxe_util:from_bool(CollectUndo)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlselectall">external documentation</a>.
+-spec selectAll(This) -> ok when
+ This::wxStyledTextCtrl().
selectAll(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SelectAll,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetsavepoint">external documentation</a>.
+-spec setSavePoint(This) -> ok when
+ This::wxStyledTextCtrl().
setSavePoint(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetSavePoint,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), StartPos::integer(), EndPos::integer()) -> wxMemoryBuffer:wxMemoryBuffer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetstyledtext">external documentation</a>.
+-spec getStyledText(This, StartPos, EndPos) -> wx:wx_object() when
+ This::wxStyledTextCtrl(), StartPos::integer(), EndPos::integer().
getStyledText(#wx_ref{type=ThisT,ref=ThisRef},StartPos,EndPos)
when is_integer(StartPos),is_integer(EndPos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetStyledText,
<<ThisRef:32/?UI,StartPos:32/?UI,EndPos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcanredo">external documentation</a>.
+-spec canRedo(This) -> boolean() when
+ This::wxStyledTextCtrl().
canRedo(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_CanRedo,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Handle::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlmarkerlinefromhandle">external documentation</a>.
+-spec markerLineFromHandle(This, Handle) -> integer() when
+ This::wxStyledTextCtrl(), Handle::integer().
markerLineFromHandle(#wx_ref{type=ThisT,ref=ThisRef},Handle)
when is_integer(Handle) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_MarkerLineFromHandle,
<<ThisRef:32/?UI,Handle:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Handle::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlmarkerdeletehandle">external documentation</a>.
+-spec markerDeleteHandle(This, Handle) -> ok when
+ This::wxStyledTextCtrl(), Handle::integer().
markerDeleteHandle(#wx_ref{type=ThisT,ref=ThisRef},Handle)
when is_integer(Handle) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_MarkerDeleteHandle,
<<ThisRef:32/?UI,Handle:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetundocollection">external documentation</a>.
+-spec getUndoCollection(This) -> boolean() when
+ This::wxStyledTextCtrl().
getUndoCollection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetUndoCollection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetviewwhitespace">external documentation</a>.
+-spec getViewWhiteSpace(This) -> integer() when
+ This::wxStyledTextCtrl().
getViewWhiteSpace(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetViewWhiteSpace,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), ViewWS::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetviewwhitespace">external documentation</a>.
+-spec setViewWhiteSpace(This, ViewWS) -> ok when
+ This::wxStyledTextCtrl(), ViewWS::integer().
setViewWhiteSpace(#wx_ref{type=ThisT,ref=ThisRef},ViewWS)
when is_integer(ViewWS) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetViewWhiteSpace,
<<ThisRef:32/?UI,ViewWS:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pt::{X::integer(), Y::integer()}) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlpositionfrompoint">external documentation</a>.
+-spec positionFromPoint(This, Pt) -> integer() when
+ This::wxStyledTextCtrl(), Pt::{X::integer(), Y::integer()}.
positionFromPoint(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_PositionFromPoint,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), X::integer(), Y::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlpositionfrompointclose">external documentation</a>.
+-spec positionFromPointClose(This, X, Y) -> integer() when
+ This::wxStyledTextCtrl(), X::integer(), Y::integer().
positionFromPointClose(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_PositionFromPointClose,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgotoline">external documentation</a>.
+-spec gotoLine(This, Line) -> ok when
+ This::wxStyledTextCtrl(), Line::integer().
gotoLine(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_GotoLine,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgotopos">external documentation</a>.
+-spec gotoPos(This, Pos) -> ok when
+ This::wxStyledTextCtrl(), Pos::integer().
gotoPos(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_GotoPos,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), PosAnchor::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetanchor">external documentation</a>.
+-spec setAnchor(This, PosAnchor) -> ok when
+ This::wxStyledTextCtrl(), PosAnchor::integer().
setAnchor(#wx_ref{type=ThisT,ref=ThisRef},PosAnchor)
when is_integer(PosAnchor) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetAnchor,
<<ThisRef:32/?UI,PosAnchor:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> {string(), LinePos::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetcurline">external documentation</a>.
+-spec getCurLine(This) -> Result when
+ Result ::{Res ::unicode:charlist(), LinePos::integer()},
+ This::wxStyledTextCtrl().
getCurLine(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetCurLine,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetendstyled">external documentation</a>.
+-spec getEndStyled(This) -> integer() when
+ This::wxStyledTextCtrl().
getEndStyled(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetEndStyled,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), EolMode::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlconverteols">external documentation</a>.
+-spec convertEOLs(This, EolMode) -> ok when
+ This::wxStyledTextCtrl(), EolMode::integer().
convertEOLs(#wx_ref{type=ThisT,ref=ThisRef},EolMode)
when is_integer(EolMode) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_ConvertEOLs,
<<ThisRef:32/?UI,EolMode:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgeteolmode">external documentation</a>.
+-spec getEOLMode(This) -> integer() when
+ This::wxStyledTextCtrl().
getEOLMode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetEOLMode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), EolMode::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlseteolmode">external documentation</a>.
+-spec setEOLMode(This, EolMode) -> ok when
+ This::wxStyledTextCtrl(), EolMode::integer().
setEOLMode(#wx_ref{type=ThisT,ref=ThisRef},EolMode)
when is_integer(EolMode) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetEOLMode,
<<ThisRef:32/?UI,EolMode:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer(), Mask::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstartstyling">external documentation</a>.
+-spec startStyling(This, Pos, Mask) -> ok when
+ This::wxStyledTextCtrl(), Pos::integer(), Mask::integer().
startStyling(#wx_ref{type=ThisT,ref=ThisRef},Pos,Mask)
when is_integer(Pos),is_integer(Mask) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StartStyling,
<<ThisRef:32/?UI,Pos:32/?UI,Mask:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Length::integer(), Style::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetstyling">external documentation</a>.
+-spec setStyling(This, Length, Style) -> ok when
+ This::wxStyledTextCtrl(), Length::integer(), Style::integer().
setStyling(#wx_ref{type=ThisT,ref=ThisRef},Length,Style)
when is_integer(Length),is_integer(Style) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetStyling,
<<ThisRef:32/?UI,Length:32/?UI,Style:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetbuffereddraw">external documentation</a>.
+-spec getBufferedDraw(This) -> boolean() when
+ This::wxStyledTextCtrl().
getBufferedDraw(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetBufferedDraw,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Buffered::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetbuffereddraw">external documentation</a>.
+-spec setBufferedDraw(This, Buffered) -> ok when
+ This::wxStyledTextCtrl(), Buffered::boolean().
setBufferedDraw(#wx_ref{type=ThisT,ref=ThisRef},Buffered)
when is_boolean(Buffered) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetBufferedDraw,
<<ThisRef:32/?UI,(wxe_util:from_bool(Buffered)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), TabWidth::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsettabwidth">external documentation</a>.
+-spec setTabWidth(This, TabWidth) -> ok when
+ This::wxStyledTextCtrl(), TabWidth::integer().
setTabWidth(#wx_ref{type=ThisT,ref=ThisRef},TabWidth)
when is_integer(TabWidth) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetTabWidth,
<<ThisRef:32/?UI,TabWidth:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgettabwidth">external documentation</a>.
+-spec getTabWidth(This) -> integer() when
+ This::wxStyledTextCtrl().
getTabWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetTabWidth,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), CodePage::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetcodepage">external documentation</a>.
+-spec setCodePage(This, CodePage) -> ok when
+ This::wxStyledTextCtrl(), CodePage::integer().
setCodePage(#wx_ref{type=ThisT,ref=ThisRef},CodePage)
when is_integer(CodePage) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetCodePage,
<<ThisRef:32/?UI,CodePage:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), MarkerNumber::integer(), MarkerSymbol::integer()) -> ok
%% @equiv markerDefine(This,MarkerNumber,MarkerSymbol, [])
+-spec markerDefine(This, MarkerNumber, MarkerSymbol) -> ok when
+ This::wxStyledTextCtrl(), MarkerNumber::integer(), MarkerSymbol::integer().
+
markerDefine(This,MarkerNumber,MarkerSymbol)
when is_record(This, wx_ref),is_integer(MarkerNumber),is_integer(MarkerSymbol) ->
markerDefine(This,MarkerNumber,MarkerSymbol, []).
-%% @spec (This::wxStyledTextCtrl(), MarkerNumber::integer(), MarkerSymbol::integer(), [Option]) -> ok
-%% Option = {foreground, wx:colour()} | {background, wx:colour()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlmarkerdefine">external documentation</a>.
+-spec markerDefine(This, MarkerNumber, MarkerSymbol, [Option]) -> ok when
+ This::wxStyledTextCtrl(), MarkerNumber::integer(), MarkerSymbol::integer(),
+ Option :: {foreground, wx:wx_colour()}
+ | {background, wx:wx_colour()}.
markerDefine(#wx_ref{type=ThisT,ref=ThisRef},MarkerNumber,MarkerSymbol, Options)
when is_integer(MarkerNumber),is_integer(MarkerSymbol),is_list(Options) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -535,72 +592,81 @@ markerDefine(#wx_ref{type=ThisT,ref=ThisRef},MarkerNumber,MarkerSymbol, Options)
wxe_util:cast(?wxStyledTextCtrl_MarkerDefine,
<<ThisRef:32/?UI,MarkerNumber:32/?UI,MarkerSymbol:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxStyledTextCtrl(), MarkerNumber::integer(), Fore::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlmarkersetforeground">external documentation</a>.
+-spec markerSetForeground(This, MarkerNumber, Fore) -> ok when
+ This::wxStyledTextCtrl(), MarkerNumber::integer(), Fore::wx:wx_colour().
markerSetForeground(#wx_ref{type=ThisT,ref=ThisRef},MarkerNumber,Fore)
when is_integer(MarkerNumber),tuple_size(Fore) =:= 3; tuple_size(Fore) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_MarkerSetForeground,
<<ThisRef:32/?UI,MarkerNumber:32/?UI,(wxe_util:colour_bin(Fore)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl(), MarkerNumber::integer(), Back::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlmarkersetbackground">external documentation</a>.
+-spec markerSetBackground(This, MarkerNumber, Back) -> ok when
+ This::wxStyledTextCtrl(), MarkerNumber::integer(), Back::wx:wx_colour().
markerSetBackground(#wx_ref{type=ThisT,ref=ThisRef},MarkerNumber,Back)
when is_integer(MarkerNumber),tuple_size(Back) =:= 3; tuple_size(Back) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_MarkerSetBackground,
<<ThisRef:32/?UI,MarkerNumber:32/?UI,(wxe_util:colour_bin(Back)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer(), MarkerNumber::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlmarkeradd">external documentation</a>.
+-spec markerAdd(This, Line, MarkerNumber) -> integer() when
+ This::wxStyledTextCtrl(), Line::integer(), MarkerNumber::integer().
markerAdd(#wx_ref{type=ThisT,ref=ThisRef},Line,MarkerNumber)
when is_integer(Line),is_integer(MarkerNumber) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_MarkerAdd,
<<ThisRef:32/?UI,Line:32/?UI,MarkerNumber:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer(), MarkerNumber::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlmarkerdelete">external documentation</a>.
+-spec markerDelete(This, Line, MarkerNumber) -> ok when
+ This::wxStyledTextCtrl(), Line::integer(), MarkerNumber::integer().
markerDelete(#wx_ref{type=ThisT,ref=ThisRef},Line,MarkerNumber)
when is_integer(Line),is_integer(MarkerNumber) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_MarkerDelete,
<<ThisRef:32/?UI,Line:32/?UI,MarkerNumber:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), MarkerNumber::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlmarkerdeleteall">external documentation</a>.
+-spec markerDeleteAll(This, MarkerNumber) -> ok when
+ This::wxStyledTextCtrl(), MarkerNumber::integer().
markerDeleteAll(#wx_ref{type=ThisT,ref=ThisRef},MarkerNumber)
when is_integer(MarkerNumber) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_MarkerDeleteAll,
<<ThisRef:32/?UI,MarkerNumber:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlmarkerget">external documentation</a>.
+-spec markerGet(This, Line) -> integer() when
+ This::wxStyledTextCtrl(), Line::integer().
markerGet(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_MarkerGet,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), LineStart::integer(), MarkerMask::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlmarkernext">external documentation</a>.
+-spec markerNext(This, LineStart, MarkerMask) -> integer() when
+ This::wxStyledTextCtrl(), LineStart::integer(), MarkerMask::integer().
markerNext(#wx_ref{type=ThisT,ref=ThisRef},LineStart,MarkerMask)
when is_integer(LineStart),is_integer(MarkerMask) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_MarkerNext,
<<ThisRef:32/?UI,LineStart:32/?UI,MarkerMask:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), LineStart::integer(), MarkerMask::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlmarkerprevious">external documentation</a>.
+-spec markerPrevious(This, LineStart, MarkerMask) -> integer() when
+ This::wxStyledTextCtrl(), LineStart::integer(), MarkerMask::integer().
markerPrevious(#wx_ref{type=ThisT,ref=ThisRef},LineStart,MarkerMask)
when is_integer(LineStart),is_integer(MarkerMask) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_MarkerPrevious,
<<ThisRef:32/?UI,LineStart:32/?UI,MarkerMask:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), MarkerNumber::integer(), Bmp::wxBitmap:wxBitmap()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlmarkerdefinebitmap">external documentation</a>.
+-spec markerDefineBitmap(This, MarkerNumber, Bmp) -> ok when
+ This::wxStyledTextCtrl(), MarkerNumber::integer(), Bmp::wxBitmap:wxBitmap().
markerDefineBitmap(#wx_ref{type=ThisT,ref=ThisRef},MarkerNumber,#wx_ref{type=BmpT,ref=BmpRef})
when is_integer(MarkerNumber) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -608,135 +674,152 @@ markerDefineBitmap(#wx_ref{type=ThisT,ref=ThisRef},MarkerNumber,#wx_ref{type=Bmp
wxe_util:cast(?wxStyledTextCtrl_MarkerDefineBitmap,
<<ThisRef:32/?UI,MarkerNumber:32/?UI,BmpRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer(), Set::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlmarkeraddset">external documentation</a>.
+-spec markerAddSet(This, Line, Set) -> ok when
+ This::wxStyledTextCtrl(), Line::integer(), Set::integer().
markerAddSet(#wx_ref{type=ThisT,ref=ThisRef},Line,Set)
when is_integer(Line),is_integer(Set) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_MarkerAddSet,
<<ThisRef:32/?UI,Line:32/?UI,Set:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), MarkerNumber::integer(), Alpha::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlmarkersetalpha">external documentation</a>.
+-spec markerSetAlpha(This, MarkerNumber, Alpha) -> ok when
+ This::wxStyledTextCtrl(), MarkerNumber::integer(), Alpha::integer().
markerSetAlpha(#wx_ref{type=ThisT,ref=ThisRef},MarkerNumber,Alpha)
when is_integer(MarkerNumber),is_integer(Alpha) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_MarkerSetAlpha,
<<ThisRef:32/?UI,MarkerNumber:32/?UI,Alpha:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Margin::integer(), MarginType::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetmargintype">external documentation</a>.
+-spec setMarginType(This, Margin, MarginType) -> ok when
+ This::wxStyledTextCtrl(), Margin::integer(), MarginType::integer().
setMarginType(#wx_ref{type=ThisT,ref=ThisRef},Margin,MarginType)
when is_integer(Margin),is_integer(MarginType) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetMarginType,
<<ThisRef:32/?UI,Margin:32/?UI,MarginType:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Margin::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetmargintype">external documentation</a>.
+-spec getMarginType(This, Margin) -> integer() when
+ This::wxStyledTextCtrl(), Margin::integer().
getMarginType(#wx_ref{type=ThisT,ref=ThisRef},Margin)
when is_integer(Margin) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetMarginType,
<<ThisRef:32/?UI,Margin:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Margin::integer(), PixelWidth::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetmarginwidth">external documentation</a>.
+-spec setMarginWidth(This, Margin, PixelWidth) -> ok when
+ This::wxStyledTextCtrl(), Margin::integer(), PixelWidth::integer().
setMarginWidth(#wx_ref{type=ThisT,ref=ThisRef},Margin,PixelWidth)
when is_integer(Margin),is_integer(PixelWidth) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetMarginWidth,
<<ThisRef:32/?UI,Margin:32/?UI,PixelWidth:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Margin::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetmarginwidth">external documentation</a>.
+-spec getMarginWidth(This, Margin) -> integer() when
+ This::wxStyledTextCtrl(), Margin::integer().
getMarginWidth(#wx_ref{type=ThisT,ref=ThisRef},Margin)
when is_integer(Margin) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetMarginWidth,
<<ThisRef:32/?UI,Margin:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Margin::integer(), Mask::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetmarginmask">external documentation</a>.
+-spec setMarginMask(This, Margin, Mask) -> ok when
+ This::wxStyledTextCtrl(), Margin::integer(), Mask::integer().
setMarginMask(#wx_ref{type=ThisT,ref=ThisRef},Margin,Mask)
when is_integer(Margin),is_integer(Mask) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetMarginMask,
<<ThisRef:32/?UI,Margin:32/?UI,Mask:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Margin::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetmarginmask">external documentation</a>.
+-spec getMarginMask(This, Margin) -> integer() when
+ This::wxStyledTextCtrl(), Margin::integer().
getMarginMask(#wx_ref{type=ThisT,ref=ThisRef},Margin)
when is_integer(Margin) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetMarginMask,
<<ThisRef:32/?UI,Margin:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Margin::integer(), Sensitive::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetmarginsensitive">external documentation</a>.
+-spec setMarginSensitive(This, Margin, Sensitive) -> ok when
+ This::wxStyledTextCtrl(), Margin::integer(), Sensitive::boolean().
setMarginSensitive(#wx_ref{type=ThisT,ref=ThisRef},Margin,Sensitive)
when is_integer(Margin),is_boolean(Sensitive) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetMarginSensitive,
<<ThisRef:32/?UI,Margin:32/?UI,(wxe_util:from_bool(Sensitive)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Margin::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetmarginsensitive">external documentation</a>.
+-spec getMarginSensitive(This, Margin) -> boolean() when
+ This::wxStyledTextCtrl(), Margin::integer().
getMarginSensitive(#wx_ref{type=ThisT,ref=ThisRef},Margin)
when is_integer(Margin) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetMarginSensitive,
<<ThisRef:32/?UI,Margin:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstyleclearall">external documentation</a>.
+-spec styleClearAll(This) -> ok when
+ This::wxStyledTextCtrl().
styleClearAll(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StyleClearAll,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Style::integer(), Fore::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesetforeground">external documentation</a>.
+-spec styleSetForeground(This, Style, Fore) -> ok when
+ This::wxStyledTextCtrl(), Style::integer(), Fore::wx:wx_colour().
styleSetForeground(#wx_ref{type=ThisT,ref=ThisRef},Style,Fore)
when is_integer(Style),tuple_size(Fore) =:= 3; tuple_size(Fore) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StyleSetForeground,
<<ThisRef:32/?UI,Style:32/?UI,(wxe_util:colour_bin(Fore)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl(), Style::integer(), Back::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesetbackground">external documentation</a>.
+-spec styleSetBackground(This, Style, Back) -> ok when
+ This::wxStyledTextCtrl(), Style::integer(), Back::wx:wx_colour().
styleSetBackground(#wx_ref{type=ThisT,ref=ThisRef},Style,Back)
when is_integer(Style),tuple_size(Back) =:= 3; tuple_size(Back) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StyleSetBackground,
<<ThisRef:32/?UI,Style:32/?UI,(wxe_util:colour_bin(Back)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl(), Style::integer(), Bold::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesetbold">external documentation</a>.
+-spec styleSetBold(This, Style, Bold) -> ok when
+ This::wxStyledTextCtrl(), Style::integer(), Bold::boolean().
styleSetBold(#wx_ref{type=ThisT,ref=ThisRef},Style,Bold)
when is_integer(Style),is_boolean(Bold) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StyleSetBold,
<<ThisRef:32/?UI,Style:32/?UI,(wxe_util:from_bool(Bold)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Style::integer(), Italic::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesetitalic">external documentation</a>.
+-spec styleSetItalic(This, Style, Italic) -> ok when
+ This::wxStyledTextCtrl(), Style::integer(), Italic::boolean().
styleSetItalic(#wx_ref{type=ThisT,ref=ThisRef},Style,Italic)
when is_integer(Style),is_boolean(Italic) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StyleSetItalic,
<<ThisRef:32/?UI,Style:32/?UI,(wxe_util:from_bool(Italic)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Style::integer(), SizePoints::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesetsize">external documentation</a>.
+-spec styleSetSize(This, Style, SizePoints) -> ok when
+ This::wxStyledTextCtrl(), Style::integer(), SizePoints::integer().
styleSetSize(#wx_ref{type=ThisT,ref=ThisRef},Style,SizePoints)
when is_integer(Style),is_integer(SizePoints) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StyleSetSize,
<<ThisRef:32/?UI,Style:32/?UI,SizePoints:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Style::integer(), FontName::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesetfacename">external documentation</a>.
+-spec styleSetFaceName(This, Style, FontName) -> ok when
+ This::wxStyledTextCtrl(), Style::integer(), FontName::unicode:chardata().
styleSetFaceName(#wx_ref{type=ThisT,ref=ThisRef},Style,FontName)
when is_integer(Style),is_list(FontName) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -744,140 +827,158 @@ styleSetFaceName(#wx_ref{type=ThisT,ref=ThisRef},Style,FontName)
wxe_util:cast(?wxStyledTextCtrl_StyleSetFaceName,
<<ThisRef:32/?UI,Style:32/?UI,(byte_size(FontName_UC)):32/?UI,(FontName_UC)/binary, 0:(((8- ((4+byte_size(FontName_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), Style::integer(), Filled::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstyleseteolfilled">external documentation</a>.
+-spec styleSetEOLFilled(This, Style, Filled) -> ok when
+ This::wxStyledTextCtrl(), Style::integer(), Filled::boolean().
styleSetEOLFilled(#wx_ref{type=ThisT,ref=ThisRef},Style,Filled)
when is_integer(Style),is_boolean(Filled) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StyleSetEOLFilled,
<<ThisRef:32/?UI,Style:32/?UI,(wxe_util:from_bool(Filled)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstyleresetdefault">external documentation</a>.
+-spec styleResetDefault(This) -> ok when
+ This::wxStyledTextCtrl().
styleResetDefault(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StyleResetDefault,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Style::integer(), Underline::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesetunderline">external documentation</a>.
+-spec styleSetUnderline(This, Style, Underline) -> ok when
+ This::wxStyledTextCtrl(), Style::integer(), Underline::boolean().
styleSetUnderline(#wx_ref{type=ThisT,ref=ThisRef},Style,Underline)
when is_integer(Style),is_boolean(Underline) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StyleSetUnderline,
<<ThisRef:32/?UI,Style:32/?UI,(wxe_util:from_bool(Underline)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Style::integer(), CaseForce::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesetcase">external documentation</a>.
+-spec styleSetCase(This, Style, CaseForce) -> ok when
+ This::wxStyledTextCtrl(), Style::integer(), CaseForce::integer().
styleSetCase(#wx_ref{type=ThisT,ref=ThisRef},Style,CaseForce)
when is_integer(Style),is_integer(CaseForce) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StyleSetCase,
<<ThisRef:32/?UI,Style:32/?UI,CaseForce:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Style::integer(), Hotspot::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesethotspot">external documentation</a>.
+-spec styleSetHotSpot(This, Style, Hotspot) -> ok when
+ This::wxStyledTextCtrl(), Style::integer(), Hotspot::boolean().
styleSetHotSpot(#wx_ref{type=ThisT,ref=ThisRef},Style,Hotspot)
when is_integer(Style),is_boolean(Hotspot) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StyleSetHotSpot,
<<ThisRef:32/?UI,Style:32/?UI,(wxe_util:from_bool(Hotspot)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), UseSetting::bool(), Fore::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetselforeground">external documentation</a>.
+-spec setSelForeground(This, UseSetting, Fore) -> ok when
+ This::wxStyledTextCtrl(), UseSetting::boolean(), Fore::wx:wx_colour().
setSelForeground(#wx_ref{type=ThisT,ref=ThisRef},UseSetting,Fore)
when is_boolean(UseSetting),tuple_size(Fore) =:= 3; tuple_size(Fore) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetSelForeground,
<<ThisRef:32/?UI,(wxe_util:from_bool(UseSetting)):32/?UI,(wxe_util:colour_bin(Fore)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl(), UseSetting::bool(), Back::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetselbackground">external documentation</a>.
+-spec setSelBackground(This, UseSetting, Back) -> ok when
+ This::wxStyledTextCtrl(), UseSetting::boolean(), Back::wx:wx_colour().
setSelBackground(#wx_ref{type=ThisT,ref=ThisRef},UseSetting,Back)
when is_boolean(UseSetting),tuple_size(Back) =:= 3; tuple_size(Back) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetSelBackground,
<<ThisRef:32/?UI,(wxe_util:from_bool(UseSetting)):32/?UI,(wxe_util:colour_bin(Back)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetselalpha">external documentation</a>.
+-spec getSelAlpha(This) -> integer() when
+ This::wxStyledTextCtrl().
getSelAlpha(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetSelAlpha,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Alpha::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetselalpha">external documentation</a>.
+-spec setSelAlpha(This, Alpha) -> ok when
+ This::wxStyledTextCtrl(), Alpha::integer().
setSelAlpha(#wx_ref{type=ThisT,ref=ThisRef},Alpha)
when is_integer(Alpha) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetSelAlpha,
<<ThisRef:32/?UI,Alpha:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Fore::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetcaretforeground">external documentation</a>.
+-spec setCaretForeground(This, Fore) -> ok when
+ This::wxStyledTextCtrl(), Fore::wx:wx_colour().
setCaretForeground(#wx_ref{type=ThisT,ref=ThisRef},Fore)
when tuple_size(Fore) =:= 3; tuple_size(Fore) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetCaretForeground,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Fore)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl(), Key::integer(), Modifiers::integer(), Cmd::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcmdkeyassign">external documentation</a>.
+-spec cmdKeyAssign(This, Key, Modifiers, Cmd) -> ok when
+ This::wxStyledTextCtrl(), Key::integer(), Modifiers::integer(), Cmd::integer().
cmdKeyAssign(#wx_ref{type=ThisT,ref=ThisRef},Key,Modifiers,Cmd)
when is_integer(Key),is_integer(Modifiers),is_integer(Cmd) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CmdKeyAssign,
<<ThisRef:32/?UI,Key:32/?UI,Modifiers:32/?UI,Cmd:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Key::integer(), Modifiers::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcmdkeyclear">external documentation</a>.
+-spec cmdKeyClear(This, Key, Modifiers) -> ok when
+ This::wxStyledTextCtrl(), Key::integer(), Modifiers::integer().
cmdKeyClear(#wx_ref{type=ThisT,ref=ThisRef},Key,Modifiers)
when is_integer(Key),is_integer(Modifiers) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CmdKeyClear,
<<ThisRef:32/?UI,Key:32/?UI,Modifiers:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcmdkeyclearall">external documentation</a>.
+-spec cmdKeyClearAll(This) -> ok when
+ This::wxStyledTextCtrl().
cmdKeyClearAll(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CmdKeyClearAll,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Length::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetstylebytes">external documentation</a>.
+-spec setStyleBytes(This, Length) -> integer() when
+ This::wxStyledTextCtrl(), Length::integer().
setStyleBytes(#wx_ref{type=ThisT,ref=ThisRef},Length)
when is_integer(Length) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_SetStyleBytes,
<<ThisRef:32/?UI,Length:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Style::integer(), Visible::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesetvisible">external documentation</a>.
+-spec styleSetVisible(This, Style, Visible) -> ok when
+ This::wxStyledTextCtrl(), Style::integer(), Visible::boolean().
styleSetVisible(#wx_ref{type=ThisT,ref=ThisRef},Style,Visible)
when is_integer(Style),is_boolean(Visible) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StyleSetVisible,
<<ThisRef:32/?UI,Style:32/?UI,(wxe_util:from_bool(Visible)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetcaretperiod">external documentation</a>.
+-spec getCaretPeriod(This) -> integer() when
+ This::wxStyledTextCtrl().
getCaretPeriod(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetCaretPeriod,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), PeriodMilliseconds::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetcaretperiod">external documentation</a>.
+-spec setCaretPeriod(This, PeriodMilliseconds) -> ok when
+ This::wxStyledTextCtrl(), PeriodMilliseconds::integer().
setCaretPeriod(#wx_ref{type=ThisT,ref=ThisRef},PeriodMilliseconds)
when is_integer(PeriodMilliseconds) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetCaretPeriod,
<<ThisRef:32/?UI,PeriodMilliseconds:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Characters::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetwordchars">external documentation</a>.
+-spec setWordChars(This, Characters) -> ok when
+ This::wxStyledTextCtrl(), Characters::unicode:chardata().
setWordChars(#wx_ref{type=ThisT,ref=ThisRef},Characters)
when is_list(Characters) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -885,130 +986,147 @@ setWordChars(#wx_ref{type=ThisT,ref=ThisRef},Characters)
wxe_util:cast(?wxStyledTextCtrl_SetWordChars,
<<ThisRef:32/?UI,(byte_size(Characters_UC)):32/?UI,(Characters_UC)/binary, 0:(((8- ((0+byte_size(Characters_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlbeginundoaction">external documentation</a>.
+-spec beginUndoAction(This) -> ok when
+ This::wxStyledTextCtrl().
beginUndoAction(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_BeginUndoAction,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlendundoaction">external documentation</a>.
+-spec endUndoAction(This) -> ok when
+ This::wxStyledTextCtrl().
endUndoAction(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_EndUndoAction,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Indic::integer(), Style::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlindicatorsetstyle">external documentation</a>.
+-spec indicatorSetStyle(This, Indic, Style) -> ok when
+ This::wxStyledTextCtrl(), Indic::integer(), Style::integer().
indicatorSetStyle(#wx_ref{type=ThisT,ref=ThisRef},Indic,Style)
when is_integer(Indic),is_integer(Style) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_IndicatorSetStyle,
<<ThisRef:32/?UI,Indic:32/?UI,Style:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Indic::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlindicatorgetstyle">external documentation</a>.
+-spec indicatorGetStyle(This, Indic) -> integer() when
+ This::wxStyledTextCtrl(), Indic::integer().
indicatorGetStyle(#wx_ref{type=ThisT,ref=ThisRef},Indic)
when is_integer(Indic) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_IndicatorGetStyle,
<<ThisRef:32/?UI,Indic:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Indic::integer(), Fore::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlindicatorsetforeground">external documentation</a>.
+-spec indicatorSetForeground(This, Indic, Fore) -> ok when
+ This::wxStyledTextCtrl(), Indic::integer(), Fore::wx:wx_colour().
indicatorSetForeground(#wx_ref{type=ThisT,ref=ThisRef},Indic,Fore)
when is_integer(Indic),tuple_size(Fore) =:= 3; tuple_size(Fore) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_IndicatorSetForeground,
<<ThisRef:32/?UI,Indic:32/?UI,(wxe_util:colour_bin(Fore)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl(), Indic::integer()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlindicatorgetforeground">external documentation</a>.
+-spec indicatorGetForeground(This, Indic) -> wx:wx_colour4() when
+ This::wxStyledTextCtrl(), Indic::integer().
indicatorGetForeground(#wx_ref{type=ThisT,ref=ThisRef},Indic)
when is_integer(Indic) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_IndicatorGetForeground,
<<ThisRef:32/?UI,Indic:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), UseSetting::bool(), Fore::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetwhitespaceforeground">external documentation</a>.
+-spec setWhitespaceForeground(This, UseSetting, Fore) -> ok when
+ This::wxStyledTextCtrl(), UseSetting::boolean(), Fore::wx:wx_colour().
setWhitespaceForeground(#wx_ref{type=ThisT,ref=ThisRef},UseSetting,Fore)
when is_boolean(UseSetting),tuple_size(Fore) =:= 3; tuple_size(Fore) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetWhitespaceForeground,
<<ThisRef:32/?UI,(wxe_util:from_bool(UseSetting)):32/?UI,(wxe_util:colour_bin(Fore)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl(), UseSetting::bool(), Back::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetwhitespacebackground">external documentation</a>.
+-spec setWhitespaceBackground(This, UseSetting, Back) -> ok when
+ This::wxStyledTextCtrl(), UseSetting::boolean(), Back::wx:wx_colour().
setWhitespaceBackground(#wx_ref{type=ThisT,ref=ThisRef},UseSetting,Back)
when is_boolean(UseSetting),tuple_size(Back) =:= 3; tuple_size(Back) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetWhitespaceBackground,
<<ThisRef:32/?UI,(wxe_util:from_bool(UseSetting)):32/?UI,(wxe_util:colour_bin(Back)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetstylebits">external documentation</a>.
+-spec getStyleBits(This) -> integer() when
+ This::wxStyledTextCtrl().
getStyleBits(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetStyleBits,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer(), State::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetlinestate">external documentation</a>.
+-spec setLineState(This, Line, State) -> ok when
+ This::wxStyledTextCtrl(), Line::integer(), State::integer().
setLineState(#wx_ref{type=ThisT,ref=ThisRef},Line,State)
when is_integer(Line),is_integer(State) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetLineState,
<<ThisRef:32/?UI,Line:32/?UI,State:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetlinestate">external documentation</a>.
+-spec getLineState(This, Line) -> integer() when
+ This::wxStyledTextCtrl(), Line::integer().
getLineState(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetLineState,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetmaxlinestate">external documentation</a>.
+-spec getMaxLineState(This) -> integer() when
+ This::wxStyledTextCtrl().
getMaxLineState(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetMaxLineState,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetcaretlinevisible">external documentation</a>.
+-spec getCaretLineVisible(This) -> boolean() when
+ This::wxStyledTextCtrl().
getCaretLineVisible(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetCaretLineVisible,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Show::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetcaretlinevisible">external documentation</a>.
+-spec setCaretLineVisible(This, Show) -> ok when
+ This::wxStyledTextCtrl(), Show::boolean().
setCaretLineVisible(#wx_ref{type=ThisT,ref=ThisRef},Show)
when is_boolean(Show) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetCaretLineVisible,
<<ThisRef:32/?UI,(wxe_util:from_bool(Show)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetcaretlinebackground">external documentation</a>.
+-spec getCaretLineBackground(This) -> wx:wx_colour4() when
+ This::wxStyledTextCtrl().
getCaretLineBackground(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetCaretLineBackground,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Back::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetcaretlinebackground">external documentation</a>.
+-spec setCaretLineBackground(This, Back) -> ok when
+ This::wxStyledTextCtrl(), Back::wx:wx_colour().
setCaretLineBackground(#wx_ref{type=ThisT,ref=ThisRef},Back)
when tuple_size(Back) =:= 3; tuple_size(Back) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetCaretLineBackground,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Back)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl(), LenEntered::integer(), ItemList::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompshow">external documentation</a>.
+-spec autoCompShow(This, LenEntered, ItemList) -> ok when
+ This::wxStyledTextCtrl(), LenEntered::integer(), ItemList::unicode:chardata().
autoCompShow(#wx_ref{type=ThisT,ref=ThisRef},LenEntered,ItemList)
when is_integer(LenEntered),is_list(ItemList) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -1016,36 +1134,41 @@ autoCompShow(#wx_ref{type=ThisT,ref=ThisRef},LenEntered,ItemList)
wxe_util:cast(?wxStyledTextCtrl_AutoCompShow,
<<ThisRef:32/?UI,LenEntered:32/?UI,(byte_size(ItemList_UC)):32/?UI,(ItemList_UC)/binary, 0:(((8- ((4+byte_size(ItemList_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompcancel">external documentation</a>.
+-spec autoCompCancel(This) -> ok when
+ This::wxStyledTextCtrl().
autoCompCancel(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_AutoCompCancel,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompactive">external documentation</a>.
+-spec autoCompActive(This) -> boolean() when
+ This::wxStyledTextCtrl().
autoCompActive(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_AutoCompActive,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompposstart">external documentation</a>.
+-spec autoCompPosStart(This) -> integer() when
+ This::wxStyledTextCtrl().
autoCompPosStart(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_AutoCompPosStart,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompcomplete">external documentation</a>.
+-spec autoCompComplete(This) -> ok when
+ This::wxStyledTextCtrl().
autoCompComplete(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_AutoCompComplete,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), CharacterSet::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompstops">external documentation</a>.
+-spec autoCompStops(This, CharacterSet) -> ok when
+ This::wxStyledTextCtrl(), CharacterSet::unicode:chardata().
autoCompStops(#wx_ref{type=ThisT,ref=ThisRef},CharacterSet)
when is_list(CharacterSet) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -1053,23 +1176,26 @@ autoCompStops(#wx_ref{type=ThisT,ref=ThisRef},CharacterSet)
wxe_util:cast(?wxStyledTextCtrl_AutoCompStops,
<<ThisRef:32/?UI,(byte_size(CharacterSet_UC)):32/?UI,(CharacterSet_UC)/binary, 0:(((8- ((0+byte_size(CharacterSet_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), SeparatorCharacter::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompsetseparator">external documentation</a>.
+-spec autoCompSetSeparator(This, SeparatorCharacter) -> ok when
+ This::wxStyledTextCtrl(), SeparatorCharacter::integer().
autoCompSetSeparator(#wx_ref{type=ThisT,ref=ThisRef},SeparatorCharacter)
when is_integer(SeparatorCharacter) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_AutoCompSetSeparator,
<<ThisRef:32/?UI,SeparatorCharacter:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompgetseparator">external documentation</a>.
+-spec autoCompGetSeparator(This) -> integer() when
+ This::wxStyledTextCtrl().
autoCompGetSeparator(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_AutoCompGetSeparator,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Text::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompselect">external documentation</a>.
+-spec autoCompSelect(This, Text) -> ok when
+ This::wxStyledTextCtrl(), Text::unicode:chardata().
autoCompSelect(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_list(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -1077,23 +1203,26 @@ autoCompSelect(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:cast(?wxStyledTextCtrl_AutoCompSelect,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), Cancel::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompsetcancelatstart">external documentation</a>.
+-spec autoCompSetCancelAtStart(This, Cancel) -> ok when
+ This::wxStyledTextCtrl(), Cancel::boolean().
autoCompSetCancelAtStart(#wx_ref{type=ThisT,ref=ThisRef},Cancel)
when is_boolean(Cancel) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_AutoCompSetCancelAtStart,
<<ThisRef:32/?UI,(wxe_util:from_bool(Cancel)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompgetcancelatstart">external documentation</a>.
+-spec autoCompGetCancelAtStart(This) -> boolean() when
+ This::wxStyledTextCtrl().
autoCompGetCancelAtStart(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_AutoCompGetCancelAtStart,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), CharacterSet::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompsetfillups">external documentation</a>.
+-spec autoCompSetFillUps(This, CharacterSet) -> ok when
+ This::wxStyledTextCtrl(), CharacterSet::unicode:chardata().
autoCompSetFillUps(#wx_ref{type=ThisT,ref=ThisRef},CharacterSet)
when is_list(CharacterSet) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -1101,38 +1230,43 @@ autoCompSetFillUps(#wx_ref{type=ThisT,ref=ThisRef},CharacterSet)
wxe_util:cast(?wxStyledTextCtrl_AutoCompSetFillUps,
<<ThisRef:32/?UI,(byte_size(CharacterSet_UC)):32/?UI,(CharacterSet_UC)/binary, 0:(((8- ((0+byte_size(CharacterSet_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), ChooseSingle::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompsetchoosesingle">external documentation</a>.
+-spec autoCompSetChooseSingle(This, ChooseSingle) -> ok when
+ This::wxStyledTextCtrl(), ChooseSingle::boolean().
autoCompSetChooseSingle(#wx_ref{type=ThisT,ref=ThisRef},ChooseSingle)
when is_boolean(ChooseSingle) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_AutoCompSetChooseSingle,
<<ThisRef:32/?UI,(wxe_util:from_bool(ChooseSingle)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompgetchoosesingle">external documentation</a>.
+-spec autoCompGetChooseSingle(This) -> boolean() when
+ This::wxStyledTextCtrl().
autoCompGetChooseSingle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_AutoCompGetChooseSingle,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), IgnoreCase::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompsetignorecase">external documentation</a>.
+-spec autoCompSetIgnoreCase(This, IgnoreCase) -> ok when
+ This::wxStyledTextCtrl(), IgnoreCase::boolean().
autoCompSetIgnoreCase(#wx_ref{type=ThisT,ref=ThisRef},IgnoreCase)
when is_boolean(IgnoreCase) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_AutoCompSetIgnoreCase,
<<ThisRef:32/?UI,(wxe_util:from_bool(IgnoreCase)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompgetignorecase">external documentation</a>.
+-spec autoCompGetIgnoreCase(This) -> boolean() when
+ This::wxStyledTextCtrl().
autoCompGetIgnoreCase(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_AutoCompGetIgnoreCase,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), ListType::integer(), ItemList::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrluserlistshow">external documentation</a>.
+-spec userListShow(This, ListType, ItemList) -> ok when
+ This::wxStyledTextCtrl(), ListType::integer(), ItemList::unicode:chardata().
userListShow(#wx_ref{type=ThisT,ref=ThisRef},ListType,ItemList)
when is_integer(ListType),is_list(ItemList) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -1140,38 +1274,43 @@ userListShow(#wx_ref{type=ThisT,ref=ThisRef},ListType,ItemList)
wxe_util:cast(?wxStyledTextCtrl_UserListShow,
<<ThisRef:32/?UI,ListType:32/?UI,(byte_size(ItemList_UC)):32/?UI,(ItemList_UC)/binary, 0:(((8- ((4+byte_size(ItemList_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), AutoHide::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompsetautohide">external documentation</a>.
+-spec autoCompSetAutoHide(This, AutoHide) -> ok when
+ This::wxStyledTextCtrl(), AutoHide::boolean().
autoCompSetAutoHide(#wx_ref{type=ThisT,ref=ThisRef},AutoHide)
when is_boolean(AutoHide) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_AutoCompSetAutoHide,
<<ThisRef:32/?UI,(wxe_util:from_bool(AutoHide)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompgetautohide">external documentation</a>.
+-spec autoCompGetAutoHide(This) -> boolean() when
+ This::wxStyledTextCtrl().
autoCompGetAutoHide(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_AutoCompGetAutoHide,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), DropRestOfWord::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompsetdroprestofword">external documentation</a>.
+-spec autoCompSetDropRestOfWord(This, DropRestOfWord) -> ok when
+ This::wxStyledTextCtrl(), DropRestOfWord::boolean().
autoCompSetDropRestOfWord(#wx_ref{type=ThisT,ref=ThisRef},DropRestOfWord)
when is_boolean(DropRestOfWord) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_AutoCompSetDropRestOfWord,
<<ThisRef:32/?UI,(wxe_util:from_bool(DropRestOfWord)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompgetdroprestofword">external documentation</a>.
+-spec autoCompGetDropRestOfWord(This) -> boolean() when
+ This::wxStyledTextCtrl().
autoCompGetDropRestOfWord(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_AutoCompGetDropRestOfWord,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Type::integer(), Bmp::wxBitmap:wxBitmap()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlregisterimage">external documentation</a>.
+-spec registerImage(This, Type, Bmp) -> ok when
+ This::wxStyledTextCtrl(), Type::integer(), Bmp::wxBitmap:wxBitmap().
registerImage(#wx_ref{type=ThisT,ref=ThisRef},Type,#wx_ref{type=BmpT,ref=BmpRef})
when is_integer(Type) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -1179,271 +1318,308 @@ registerImage(#wx_ref{type=ThisT,ref=ThisRef},Type,#wx_ref{type=BmpT,ref=BmpRef}
wxe_util:cast(?wxStyledTextCtrl_RegisterImage,
<<ThisRef:32/?UI,Type:32/?UI,BmpRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlclearregisteredimages">external documentation</a>.
+-spec clearRegisteredImages(This) -> ok when
+ This::wxStyledTextCtrl().
clearRegisteredImages(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_ClearRegisteredImages,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompgettypeseparator">external documentation</a>.
+-spec autoCompGetTypeSeparator(This) -> integer() when
+ This::wxStyledTextCtrl().
autoCompGetTypeSeparator(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_AutoCompGetTypeSeparator,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), SeparatorCharacter::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompsettypeseparator">external documentation</a>.
+-spec autoCompSetTypeSeparator(This, SeparatorCharacter) -> ok when
+ This::wxStyledTextCtrl(), SeparatorCharacter::integer().
autoCompSetTypeSeparator(#wx_ref{type=ThisT,ref=ThisRef},SeparatorCharacter)
when is_integer(SeparatorCharacter) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_AutoCompSetTypeSeparator,
<<ThisRef:32/?UI,SeparatorCharacter:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), CharacterCount::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompsetmaxwidth">external documentation</a>.
+-spec autoCompSetMaxWidth(This, CharacterCount) -> ok when
+ This::wxStyledTextCtrl(), CharacterCount::integer().
autoCompSetMaxWidth(#wx_ref{type=ThisT,ref=ThisRef},CharacterCount)
when is_integer(CharacterCount) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_AutoCompSetMaxWidth,
<<ThisRef:32/?UI,CharacterCount:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompgetmaxwidth">external documentation</a>.
+-spec autoCompGetMaxWidth(This) -> integer() when
+ This::wxStyledTextCtrl().
autoCompGetMaxWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_AutoCompGetMaxWidth,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), RowCount::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompsetmaxheight">external documentation</a>.
+-spec autoCompSetMaxHeight(This, RowCount) -> ok when
+ This::wxStyledTextCtrl(), RowCount::integer().
autoCompSetMaxHeight(#wx_ref{type=ThisT,ref=ThisRef},RowCount)
when is_integer(RowCount) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_AutoCompSetMaxHeight,
<<ThisRef:32/?UI,RowCount:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompgetmaxheight">external documentation</a>.
+-spec autoCompGetMaxHeight(This) -> integer() when
+ This::wxStyledTextCtrl().
autoCompGetMaxHeight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_AutoCompGetMaxHeight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), IndentSize::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetindent">external documentation</a>.
+-spec setIndent(This, IndentSize) -> ok when
+ This::wxStyledTextCtrl(), IndentSize::integer().
setIndent(#wx_ref{type=ThisT,ref=ThisRef},IndentSize)
when is_integer(IndentSize) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetIndent,
<<ThisRef:32/?UI,IndentSize:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetindent">external documentation</a>.
+-spec getIndent(This) -> integer() when
+ This::wxStyledTextCtrl().
getIndent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetIndent,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), UseTabs::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetusetabs">external documentation</a>.
+-spec setUseTabs(This, UseTabs) -> ok when
+ This::wxStyledTextCtrl(), UseTabs::boolean().
setUseTabs(#wx_ref{type=ThisT,ref=ThisRef},UseTabs)
when is_boolean(UseTabs) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetUseTabs,
<<ThisRef:32/?UI,(wxe_util:from_bool(UseTabs)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetusetabs">external documentation</a>.
+-spec getUseTabs(This) -> boolean() when
+ This::wxStyledTextCtrl().
getUseTabs(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetUseTabs,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer(), IndentSize::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetlineindentation">external documentation</a>.
+-spec setLineIndentation(This, Line, IndentSize) -> ok when
+ This::wxStyledTextCtrl(), Line::integer(), IndentSize::integer().
setLineIndentation(#wx_ref{type=ThisT,ref=ThisRef},Line,IndentSize)
when is_integer(Line),is_integer(IndentSize) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetLineIndentation,
<<ThisRef:32/?UI,Line:32/?UI,IndentSize:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetlineindentation">external documentation</a>.
+-spec getLineIndentation(This, Line) -> integer() when
+ This::wxStyledTextCtrl(), Line::integer().
getLineIndentation(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetLineIndentation,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetlineindentposition">external documentation</a>.
+-spec getLineIndentPosition(This, Line) -> integer() when
+ This::wxStyledTextCtrl(), Line::integer().
getLineIndentPosition(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetLineIndentPosition,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetcolumn">external documentation</a>.
+-spec getColumn(This, Pos) -> integer() when
+ This::wxStyledTextCtrl(), Pos::integer().
getColumn(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetColumn,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Show::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetusehorizontalscrollbar">external documentation</a>.
+-spec setUseHorizontalScrollBar(This, Show) -> ok when
+ This::wxStyledTextCtrl(), Show::boolean().
setUseHorizontalScrollBar(#wx_ref{type=ThisT,ref=ThisRef},Show)
when is_boolean(Show) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetUseHorizontalScrollBar,
<<ThisRef:32/?UI,(wxe_util:from_bool(Show)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetusehorizontalscrollbar">external documentation</a>.
+-spec getUseHorizontalScrollBar(This) -> boolean() when
+ This::wxStyledTextCtrl().
getUseHorizontalScrollBar(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetUseHorizontalScrollBar,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Show::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetindentationguides">external documentation</a>.
+-spec setIndentationGuides(This, Show) -> ok when
+ This::wxStyledTextCtrl(), Show::boolean().
setIndentationGuides(#wx_ref{type=ThisT,ref=ThisRef},Show)
when is_boolean(Show) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetIndentationGuides,
<<ThisRef:32/?UI,(wxe_util:from_bool(Show)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetindentationguides">external documentation</a>.
+-spec getIndentationGuides(This) -> boolean() when
+ This::wxStyledTextCtrl().
getIndentationGuides(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetIndentationGuides,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Column::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsethighlightguide">external documentation</a>.
+-spec setHighlightGuide(This, Column) -> ok when
+ This::wxStyledTextCtrl(), Column::integer().
setHighlightGuide(#wx_ref{type=ThisT,ref=ThisRef},Column)
when is_integer(Column) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetHighlightGuide,
<<ThisRef:32/?UI,Column:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgethighlightguide">external documentation</a>.
+-spec getHighlightGuide(This) -> integer() when
+ This::wxStyledTextCtrl().
getHighlightGuide(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetHighlightGuide,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetlineendposition">external documentation</a>.
+-spec getLineEndPosition(This, Line) -> integer() when
+ This::wxStyledTextCtrl(), Line::integer().
getLineEndPosition(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetLineEndPosition,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetcodepage">external documentation</a>.
+-spec getCodePage(This) -> integer() when
+ This::wxStyledTextCtrl().
getCodePage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetCodePage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetcaretforeground">external documentation</a>.
+-spec getCaretForeground(This) -> wx:wx_colour4() when
+ This::wxStyledTextCtrl().
getCaretForeground(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetCaretForeground,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetreadonly">external documentation</a>.
+-spec getReadOnly(This) -> boolean() when
+ This::wxStyledTextCtrl().
getReadOnly(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetReadOnly,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetcurrentpos">external documentation</a>.
+-spec setCurrentPos(This, Pos) -> ok when
+ This::wxStyledTextCtrl(), Pos::integer().
setCurrentPos(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetCurrentPos,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetselectionstart">external documentation</a>.
+-spec setSelectionStart(This, Pos) -> ok when
+ This::wxStyledTextCtrl(), Pos::integer().
setSelectionStart(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetSelectionStart,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetselectionstart">external documentation</a>.
+-spec getSelectionStart(This) -> integer() when
+ This::wxStyledTextCtrl().
getSelectionStart(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetSelectionStart,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetselectionend">external documentation</a>.
+-spec setSelectionEnd(This, Pos) -> ok when
+ This::wxStyledTextCtrl(), Pos::integer().
setSelectionEnd(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetSelectionEnd,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetselectionend">external documentation</a>.
+-spec getSelectionEnd(This) -> integer() when
+ This::wxStyledTextCtrl().
getSelectionEnd(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetSelectionEnd,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Magnification::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetprintmagnification">external documentation</a>.
+-spec setPrintMagnification(This, Magnification) -> ok when
+ This::wxStyledTextCtrl(), Magnification::integer().
setPrintMagnification(#wx_ref{type=ThisT,ref=ThisRef},Magnification)
when is_integer(Magnification) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetPrintMagnification,
<<ThisRef:32/?UI,Magnification:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetprintmagnification">external documentation</a>.
+-spec getPrintMagnification(This) -> integer() when
+ This::wxStyledTextCtrl().
getPrintMagnification(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetPrintMagnification,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Mode::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetprintcolourmode">external documentation</a>.
+-spec setPrintColourMode(This, Mode) -> ok when
+ This::wxStyledTextCtrl(), Mode::integer().
setPrintColourMode(#wx_ref{type=ThisT,ref=ThisRef},Mode)
when is_integer(Mode) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetPrintColourMode,
<<ThisRef:32/?UI,Mode:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetprintcolourmode">external documentation</a>.
+-spec getPrintColourMode(This) -> integer() when
+ This::wxStyledTextCtrl().
getPrintColourMode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetPrintColourMode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), MinPos::integer(), MaxPos::integer(), Text::string()) -> integer()
%% @equiv findText(This,MinPos,MaxPos,Text, [])
+-spec findText(This, MinPos, MaxPos, Text) -> integer() when
+ This::wxStyledTextCtrl(), MinPos::integer(), MaxPos::integer(), Text::unicode:chardata().
+
findText(This,MinPos,MaxPos,Text)
when is_record(This, wx_ref),is_integer(MinPos),is_integer(MaxPos),is_list(Text) ->
findText(This,MinPos,MaxPos,Text, []).
-%% @spec (This::wxStyledTextCtrl(), MinPos::integer(), MaxPos::integer(), Text::string(), [Option]) -> integer()
-%% Option = {flags, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlfindtext">external documentation</a>.
+-spec findText(This, MinPos, MaxPos, Text, [Option]) -> integer() when
+ This::wxStyledTextCtrl(), MinPos::integer(), MaxPos::integer(), Text::unicode:chardata(),
+ Option :: {flags, integer()}.
findText(#wx_ref{type=ThisT,ref=ThisRef},MinPos,MaxPos,Text, Options)
when is_integer(MinPos),is_integer(MaxPos),is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -1454,8 +1630,9 @@ findText(#wx_ref{type=ThisT,ref=ThisRef},MinPos,MaxPos,Text, Options)
wxe_util:call(?wxStyledTextCtrl_FindText,
<<ThisRef:32/?UI,MinPos:32/?UI,MaxPos:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxStyledTextCtrl(), DoDraw::bool(), StartPos::integer(), EndPos::integer(), Draw::wxDC:wxDC(), Target::wxDC:wxDC(), RenderRect::{X::integer(), Y::integer(), W::integer(), H::integer()}, PageRect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlformatrange">external documentation</a>.
+-spec formatRange(This, DoDraw, StartPos, EndPos, Draw, Target, RenderRect, PageRect) -> integer() when
+ This::wxStyledTextCtrl(), DoDraw::boolean(), StartPos::integer(), EndPos::integer(), Draw::wxDC:wxDC(), Target::wxDC:wxDC(), RenderRect::{X::integer(), Y::integer(), W::integer(), H::integer()}, PageRect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
formatRange(#wx_ref{type=ThisT,ref=ThisRef},DoDraw,StartPos,EndPos,#wx_ref{type=DrawT,ref=DrawRef},#wx_ref{type=TargetT,ref=TargetRef},{RenderRectX,RenderRectY,RenderRectW,RenderRectH},{PageRectX,PageRectY,PageRectW,PageRectH})
when is_boolean(DoDraw),is_integer(StartPos),is_integer(EndPos),is_integer(RenderRectX),is_integer(RenderRectY),is_integer(RenderRectW),is_integer(RenderRectH),is_integer(PageRectX),is_integer(PageRectY),is_integer(PageRectW),is_integer(PageRectH) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -1464,129 +1641,146 @@ formatRange(#wx_ref{type=ThisT,ref=ThisRef},DoDraw,StartPos,EndPos,#wx_ref{type=
wxe_util:call(?wxStyledTextCtrl_FormatRange,
<<ThisRef:32/?UI,(wxe_util:from_bool(DoDraw)):32/?UI,StartPos:32/?UI,EndPos:32/?UI,DrawRef:32/?UI,TargetRef:32/?UI,RenderRectX:32/?UI,RenderRectY:32/?UI,RenderRectW:32/?UI,RenderRectH:32/?UI,PageRectX:32/?UI,PageRectY:32/?UI,PageRectW:32/?UI,PageRectH:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetfirstvisibleline">external documentation</a>.
+-spec getFirstVisibleLine(This) -> integer() when
+ This::wxStyledTextCtrl().
getFirstVisibleLine(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetFirstVisibleLine,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetline">external documentation</a>.
+-spec getLine(This, Line) -> unicode:charlist() when
+ This::wxStyledTextCtrl(), Line::integer().
getLine(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetLine,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetlinecount">external documentation</a>.
+-spec getLineCount(This) -> integer() when
+ This::wxStyledTextCtrl().
getLineCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetLineCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), PixelWidth::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetmarginleft">external documentation</a>.
+-spec setMarginLeft(This, PixelWidth) -> ok when
+ This::wxStyledTextCtrl(), PixelWidth::integer().
setMarginLeft(#wx_ref{type=ThisT,ref=ThisRef},PixelWidth)
when is_integer(PixelWidth) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetMarginLeft,
<<ThisRef:32/?UI,PixelWidth:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetmarginleft">external documentation</a>.
+-spec getMarginLeft(This) -> integer() when
+ This::wxStyledTextCtrl().
getMarginLeft(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetMarginLeft,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), PixelWidth::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetmarginright">external documentation</a>.
+-spec setMarginRight(This, PixelWidth) -> ok when
+ This::wxStyledTextCtrl(), PixelWidth::integer().
setMarginRight(#wx_ref{type=ThisT,ref=ThisRef},PixelWidth)
when is_integer(PixelWidth) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetMarginRight,
<<ThisRef:32/?UI,PixelWidth:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetmarginright">external documentation</a>.
+-spec getMarginRight(This) -> integer() when
+ This::wxStyledTextCtrl().
getMarginRight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetMarginRight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetmodify">external documentation</a>.
+-spec getModify(This) -> boolean() when
+ This::wxStyledTextCtrl().
getModify(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetModify,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Start::integer(), End::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetselection">external documentation</a>.
+-spec setSelection(This, Start, End) -> ok when
+ This::wxStyledTextCtrl(), Start::integer(), End::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},Start,End)
when is_integer(Start),is_integer(End) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetSelection,
<<ThisRef:32/?UI,Start:32/?UI,End:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetselectedtext">external documentation</a>.
+-spec getSelectedText(This) -> unicode:charlist() when
+ This::wxStyledTextCtrl().
getSelectedText(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetSelectedText,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), StartPos::integer(), EndPos::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgettextrange">external documentation</a>.
+-spec getTextRange(This, StartPos, EndPos) -> unicode:charlist() when
+ This::wxStyledTextCtrl(), StartPos::integer(), EndPos::integer().
getTextRange(#wx_ref{type=ThisT,ref=ThisRef},StartPos,EndPos)
when is_integer(StartPos),is_integer(EndPos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetTextRange,
<<ThisRef:32/?UI,StartPos:32/?UI,EndPos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Normal::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlhideselection">external documentation</a>.
+-spec hideSelection(This, Normal) -> ok when
+ This::wxStyledTextCtrl(), Normal::boolean().
hideSelection(#wx_ref{type=ThisT,ref=ThisRef},Normal)
when is_boolean(Normal) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_HideSelection,
<<ThisRef:32/?UI,(wxe_util:from_bool(Normal)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllinefromposition">external documentation</a>.
+-spec lineFromPosition(This, Pos) -> integer() when
+ This::wxStyledTextCtrl(), Pos::integer().
lineFromPosition(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_LineFromPosition,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlpositionfromline">external documentation</a>.
+-spec positionFromLine(This, Line) -> integer() when
+ This::wxStyledTextCtrl(), Line::integer().
positionFromLine(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_PositionFromLine,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Columns::integer(), Lines::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllinescroll">external documentation</a>.
+-spec lineScroll(This, Columns, Lines) -> ok when
+ This::wxStyledTextCtrl(), Columns::integer(), Lines::integer().
lineScroll(#wx_ref{type=ThisT,ref=ThisRef},Columns,Lines)
when is_integer(Columns),is_integer(Lines) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineScroll,
<<ThisRef:32/?UI,Columns:32/?UI,Lines:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlensurecaretvisible">external documentation</a>.
+-spec ensureCaretVisible(This) -> ok when
+ This::wxStyledTextCtrl().
ensureCaretVisible(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_EnsureCaretVisible,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Text::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlreplaceselection">external documentation</a>.
+-spec replaceSelection(This, Text) -> ok when
+ This::wxStyledTextCtrl(), Text::unicode:chardata().
replaceSelection(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_list(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -1594,72 +1788,82 @@ replaceSelection(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:cast(?wxStyledTextCtrl_ReplaceSelection,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), ReadOnly::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetreadonly">external documentation</a>.
+-spec setReadOnly(This, ReadOnly) -> ok when
+ This::wxStyledTextCtrl(), ReadOnly::boolean().
setReadOnly(#wx_ref{type=ThisT,ref=ThisRef},ReadOnly)
when is_boolean(ReadOnly) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetReadOnly,
<<ThisRef:32/?UI,(wxe_util:from_bool(ReadOnly)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcanpaste">external documentation</a>.
+-spec canPaste(This) -> boolean() when
+ This::wxStyledTextCtrl().
canPaste(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_CanPaste,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcanundo">external documentation</a>.
+-spec canUndo(This) -> boolean() when
+ This::wxStyledTextCtrl().
canUndo(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_CanUndo,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlemptyundobuffer">external documentation</a>.
+-spec emptyUndoBuffer(This) -> ok when
+ This::wxStyledTextCtrl().
emptyUndoBuffer(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_EmptyUndoBuffer,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlundo">external documentation</a>.
+-spec undo(This) -> ok when
+ This::wxStyledTextCtrl().
undo(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_Undo,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcut">external documentation</a>.
+-spec cut(This) -> ok when
+ This::wxStyledTextCtrl().
cut(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_Cut,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcopy">external documentation</a>.
+-spec copy(This) -> ok when
+ This::wxStyledTextCtrl().
copy(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_Copy,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlpaste">external documentation</a>.
+-spec paste(This) -> ok when
+ This::wxStyledTextCtrl().
paste(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_Paste,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlclear">external documentation</a>.
+-spec clear(This) -> ok when
+ This::wxStyledTextCtrl().
clear(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_Clear,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Text::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsettext">external documentation</a>.
+-spec setText(This, Text) -> ok when
+ This::wxStyledTextCtrl(), Text::unicode:chardata().
setText(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_list(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -1667,74 +1871,84 @@ setText(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:cast(?wxStyledTextCtrl_SetText,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgettext">external documentation</a>.
+-spec getText(This) -> unicode:charlist() when
+ This::wxStyledTextCtrl().
getText(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetText,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgettextlength">external documentation</a>.
+-spec getTextLength(This) -> integer() when
+ This::wxStyledTextCtrl().
getTextLength(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetTextLength,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetovertype">external documentation</a>.
+-spec getOvertype(This) -> boolean() when
+ This::wxStyledTextCtrl().
getOvertype(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetOvertype,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), PixelWidth::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetcaretwidth">external documentation</a>.
+-spec setCaretWidth(This, PixelWidth) -> ok when
+ This::wxStyledTextCtrl(), PixelWidth::integer().
setCaretWidth(#wx_ref{type=ThisT,ref=ThisRef},PixelWidth)
when is_integer(PixelWidth) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetCaretWidth,
<<ThisRef:32/?UI,PixelWidth:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetcaretwidth">external documentation</a>.
+-spec getCaretWidth(This) -> integer() when
+ This::wxStyledTextCtrl().
getCaretWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetCaretWidth,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsettargetstart">external documentation</a>.
+-spec setTargetStart(This, Pos) -> ok when
+ This::wxStyledTextCtrl(), Pos::integer().
setTargetStart(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetTargetStart,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgettargetstart">external documentation</a>.
+-spec getTargetStart(This) -> integer() when
+ This::wxStyledTextCtrl().
getTargetStart(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetTargetStart,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsettargetend">external documentation</a>.
+-spec setTargetEnd(This, Pos) -> ok when
+ This::wxStyledTextCtrl(), Pos::integer().
setTargetEnd(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetTargetEnd,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgettargetend">external documentation</a>.
+-spec getTargetEnd(This) -> integer() when
+ This::wxStyledTextCtrl().
getTargetEnd(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetTargetEnd,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Text::string()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlreplacetarget">external documentation</a>.
+-spec replaceTarget(This, Text) -> integer() when
+ This::wxStyledTextCtrl(), Text::unicode:chardata().
replaceTarget(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_list(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -1742,8 +1956,9 @@ replaceTarget(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:call(?wxStyledTextCtrl_ReplaceTarget,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), Text::string()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsearchintarget">external documentation</a>.
+-spec searchInTarget(This, Text) -> integer() when
+ This::wxStyledTextCtrl(), Text::unicode:chardata().
searchInTarget(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_list(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -1751,23 +1966,26 @@ searchInTarget(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:call(?wxStyledTextCtrl_SearchInTarget,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), Flags::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetsearchflags">external documentation</a>.
+-spec setSearchFlags(This, Flags) -> ok when
+ This::wxStyledTextCtrl(), Flags::integer().
setSearchFlags(#wx_ref{type=ThisT,ref=ThisRef},Flags)
when is_integer(Flags) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetSearchFlags,
<<ThisRef:32/?UI,Flags:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetsearchflags">external documentation</a>.
+-spec getSearchFlags(This) -> integer() when
+ This::wxStyledTextCtrl().
getSearchFlags(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetSearchFlags,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer(), Definition::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcalltipshow">external documentation</a>.
+-spec callTipShow(This, Pos, Definition) -> ok when
+ This::wxStyledTextCtrl(), Pos::integer(), Definition::unicode:chardata().
callTipShow(#wx_ref{type=ThisT,ref=ThisRef},Pos,Definition)
when is_integer(Pos),is_list(Definition) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -1775,348 +1993,393 @@ callTipShow(#wx_ref{type=ThisT,ref=ThisRef},Pos,Definition)
wxe_util:cast(?wxStyledTextCtrl_CallTipShow,
<<ThisRef:32/?UI,Pos:32/?UI,(byte_size(Definition_UC)):32/?UI,(Definition_UC)/binary, 0:(((8- ((4+byte_size(Definition_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcalltipcancel">external documentation</a>.
+-spec callTipCancel(This) -> ok when
+ This::wxStyledTextCtrl().
callTipCancel(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CallTipCancel,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcalltipactive">external documentation</a>.
+-spec callTipActive(This) -> boolean() when
+ This::wxStyledTextCtrl().
callTipActive(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_CallTipActive,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcalltipposatstart">external documentation</a>.
+-spec callTipPosAtStart(This) -> integer() when
+ This::wxStyledTextCtrl().
callTipPosAtStart(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_CallTipPosAtStart,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Start::integer(), End::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcalltipsethighlight">external documentation</a>.
+-spec callTipSetHighlight(This, Start, End) -> ok when
+ This::wxStyledTextCtrl(), Start::integer(), End::integer().
callTipSetHighlight(#wx_ref{type=ThisT,ref=ThisRef},Start,End)
when is_integer(Start),is_integer(End) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CallTipSetHighlight,
<<ThisRef:32/?UI,Start:32/?UI,End:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Back::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcalltipsetbackground">external documentation</a>.
+-spec callTipSetBackground(This, Back) -> ok when
+ This::wxStyledTextCtrl(), Back::wx:wx_colour().
callTipSetBackground(#wx_ref{type=ThisT,ref=ThisRef},Back)
when tuple_size(Back) =:= 3; tuple_size(Back) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CallTipSetBackground,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Back)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl(), Fore::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcalltipsetforeground">external documentation</a>.
+-spec callTipSetForeground(This, Fore) -> ok when
+ This::wxStyledTextCtrl(), Fore::wx:wx_colour().
callTipSetForeground(#wx_ref{type=ThisT,ref=ThisRef},Fore)
when tuple_size(Fore) =:= 3; tuple_size(Fore) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CallTipSetForeground,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Fore)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl(), Fore::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcalltipsetforegroundhighlight">external documentation</a>.
+-spec callTipSetForegroundHighlight(This, Fore) -> ok when
+ This::wxStyledTextCtrl(), Fore::wx:wx_colour().
callTipSetForegroundHighlight(#wx_ref{type=ThisT,ref=ThisRef},Fore)
when tuple_size(Fore) =:= 3; tuple_size(Fore) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CallTipSetForegroundHighlight,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Fore)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl(), TabSize::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcalltipusestyle">external documentation</a>.
+-spec callTipUseStyle(This, TabSize) -> ok when
+ This::wxStyledTextCtrl(), TabSize::integer().
callTipUseStyle(#wx_ref{type=ThisT,ref=ThisRef},TabSize)
when is_integer(TabSize) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CallTipUseStyle,
<<ThisRef:32/?UI,TabSize:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlvisiblefromdocline">external documentation</a>.
+-spec visibleFromDocLine(This, Line) -> integer() when
+ This::wxStyledTextCtrl(), Line::integer().
visibleFromDocLine(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_VisibleFromDocLine,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), LineDisplay::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrldoclinefromvisible">external documentation</a>.
+-spec docLineFromVisible(This, LineDisplay) -> integer() when
+ This::wxStyledTextCtrl(), LineDisplay::integer().
docLineFromVisible(#wx_ref{type=ThisT,ref=ThisRef},LineDisplay)
when is_integer(LineDisplay) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_DocLineFromVisible,
<<ThisRef:32/?UI,LineDisplay:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwrapcount">external documentation</a>.
+-spec wrapCount(This, Line) -> integer() when
+ This::wxStyledTextCtrl(), Line::integer().
wrapCount(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_WrapCount,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer(), Level::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetfoldlevel">external documentation</a>.
+-spec setFoldLevel(This, Line, Level) -> ok when
+ This::wxStyledTextCtrl(), Line::integer(), Level::integer().
setFoldLevel(#wx_ref{type=ThisT,ref=ThisRef},Line,Level)
when is_integer(Line),is_integer(Level) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetFoldLevel,
<<ThisRef:32/?UI,Line:32/?UI,Level:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetfoldlevel">external documentation</a>.
+-spec getFoldLevel(This, Line) -> integer() when
+ This::wxStyledTextCtrl(), Line::integer().
getFoldLevel(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetFoldLevel,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer(), Level::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetlastchild">external documentation</a>.
+-spec getLastChild(This, Line, Level) -> integer() when
+ This::wxStyledTextCtrl(), Line::integer(), Level::integer().
getLastChild(#wx_ref{type=ThisT,ref=ThisRef},Line,Level)
when is_integer(Line),is_integer(Level) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetLastChild,
<<ThisRef:32/?UI,Line:32/?UI,Level:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetfoldparent">external documentation</a>.
+-spec getFoldParent(This, Line) -> integer() when
+ This::wxStyledTextCtrl(), Line::integer().
getFoldParent(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetFoldParent,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), LineStart::integer(), LineEnd::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlshowlines">external documentation</a>.
+-spec showLines(This, LineStart, LineEnd) -> ok when
+ This::wxStyledTextCtrl(), LineStart::integer(), LineEnd::integer().
showLines(#wx_ref{type=ThisT,ref=ThisRef},LineStart,LineEnd)
when is_integer(LineStart),is_integer(LineEnd) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_ShowLines,
<<ThisRef:32/?UI,LineStart:32/?UI,LineEnd:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), LineStart::integer(), LineEnd::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlhidelines">external documentation</a>.
+-spec hideLines(This, LineStart, LineEnd) -> ok when
+ This::wxStyledTextCtrl(), LineStart::integer(), LineEnd::integer().
hideLines(#wx_ref{type=ThisT,ref=ThisRef},LineStart,LineEnd)
when is_integer(LineStart),is_integer(LineEnd) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_HideLines,
<<ThisRef:32/?UI,LineStart:32/?UI,LineEnd:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetlinevisible">external documentation</a>.
+-spec getLineVisible(This, Line) -> boolean() when
+ This::wxStyledTextCtrl(), Line::integer().
getLineVisible(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetLineVisible,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer(), Expanded::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetfoldexpanded">external documentation</a>.
+-spec setFoldExpanded(This, Line, Expanded) -> ok when
+ This::wxStyledTextCtrl(), Line::integer(), Expanded::boolean().
setFoldExpanded(#wx_ref{type=ThisT,ref=ThisRef},Line,Expanded)
when is_integer(Line),is_boolean(Expanded) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetFoldExpanded,
<<ThisRef:32/?UI,Line:32/?UI,(wxe_util:from_bool(Expanded)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetfoldexpanded">external documentation</a>.
+-spec getFoldExpanded(This, Line) -> boolean() when
+ This::wxStyledTextCtrl(), Line::integer().
getFoldExpanded(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetFoldExpanded,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrltogglefold">external documentation</a>.
+-spec toggleFold(This, Line) -> ok when
+ This::wxStyledTextCtrl(), Line::integer().
toggleFold(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_ToggleFold,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlensurevisible">external documentation</a>.
+-spec ensureVisible(This, Line) -> ok when
+ This::wxStyledTextCtrl(), Line::integer().
ensureVisible(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_EnsureVisible,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Flags::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetfoldflags">external documentation</a>.
+-spec setFoldFlags(This, Flags) -> ok when
+ This::wxStyledTextCtrl(), Flags::integer().
setFoldFlags(#wx_ref{type=ThisT,ref=ThisRef},Flags)
when is_integer(Flags) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetFoldFlags,
<<ThisRef:32/?UI,Flags:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlensurevisibleenforcepolicy">external documentation</a>.
+-spec ensureVisibleEnforcePolicy(This, Line) -> ok when
+ This::wxStyledTextCtrl(), Line::integer().
ensureVisibleEnforcePolicy(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_EnsureVisibleEnforcePolicy,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), TabIndents::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsettabindents">external documentation</a>.
+-spec setTabIndents(This, TabIndents) -> ok when
+ This::wxStyledTextCtrl(), TabIndents::boolean().
setTabIndents(#wx_ref{type=ThisT,ref=ThisRef},TabIndents)
when is_boolean(TabIndents) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetTabIndents,
<<ThisRef:32/?UI,(wxe_util:from_bool(TabIndents)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgettabindents">external documentation</a>.
+-spec getTabIndents(This) -> boolean() when
+ This::wxStyledTextCtrl().
getTabIndents(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetTabIndents,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), BsUnIndents::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetbackspaceunindents">external documentation</a>.
+-spec setBackSpaceUnIndents(This, BsUnIndents) -> ok when
+ This::wxStyledTextCtrl(), BsUnIndents::boolean().
setBackSpaceUnIndents(#wx_ref{type=ThisT,ref=ThisRef},BsUnIndents)
when is_boolean(BsUnIndents) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetBackSpaceUnIndents,
<<ThisRef:32/?UI,(wxe_util:from_bool(BsUnIndents)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetbackspaceunindents">external documentation</a>.
+-spec getBackSpaceUnIndents(This) -> boolean() when
+ This::wxStyledTextCtrl().
getBackSpaceUnIndents(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetBackSpaceUnIndents,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), PeriodMilliseconds::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetmousedwelltime">external documentation</a>.
+-spec setMouseDwellTime(This, PeriodMilliseconds) -> ok when
+ This::wxStyledTextCtrl(), PeriodMilliseconds::integer().
setMouseDwellTime(#wx_ref{type=ThisT,ref=ThisRef},PeriodMilliseconds)
when is_integer(PeriodMilliseconds) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetMouseDwellTime,
<<ThisRef:32/?UI,PeriodMilliseconds:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetmousedwelltime">external documentation</a>.
+-spec getMouseDwellTime(This) -> integer() when
+ This::wxStyledTextCtrl().
getMouseDwellTime(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetMouseDwellTime,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer(), OnlyWordCharacters::bool()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwordstartposition">external documentation</a>.
+-spec wordStartPosition(This, Pos, OnlyWordCharacters) -> integer() when
+ This::wxStyledTextCtrl(), Pos::integer(), OnlyWordCharacters::boolean().
wordStartPosition(#wx_ref{type=ThisT,ref=ThisRef},Pos,OnlyWordCharacters)
when is_integer(Pos),is_boolean(OnlyWordCharacters) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_WordStartPosition,
<<ThisRef:32/?UI,Pos:32/?UI,(wxe_util:from_bool(OnlyWordCharacters)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer(), OnlyWordCharacters::bool()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwordendposition">external documentation</a>.
+-spec wordEndPosition(This, Pos, OnlyWordCharacters) -> integer() when
+ This::wxStyledTextCtrl(), Pos::integer(), OnlyWordCharacters::boolean().
wordEndPosition(#wx_ref{type=ThisT,ref=ThisRef},Pos,OnlyWordCharacters)
when is_integer(Pos),is_boolean(OnlyWordCharacters) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_WordEndPosition,
<<ThisRef:32/?UI,Pos:32/?UI,(wxe_util:from_bool(OnlyWordCharacters)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Mode::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetwrapmode">external documentation</a>.
+-spec setWrapMode(This, Mode) -> ok when
+ This::wxStyledTextCtrl(), Mode::integer().
setWrapMode(#wx_ref{type=ThisT,ref=ThisRef},Mode)
when is_integer(Mode) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetWrapMode,
<<ThisRef:32/?UI,Mode:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetwrapmode">external documentation</a>.
+-spec getWrapMode(This) -> integer() when
+ This::wxStyledTextCtrl().
getWrapMode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetWrapMode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), WrapVisualFlags::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetwrapvisualflags">external documentation</a>.
+-spec setWrapVisualFlags(This, WrapVisualFlags) -> ok when
+ This::wxStyledTextCtrl(), WrapVisualFlags::integer().
setWrapVisualFlags(#wx_ref{type=ThisT,ref=ThisRef},WrapVisualFlags)
when is_integer(WrapVisualFlags) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetWrapVisualFlags,
<<ThisRef:32/?UI,WrapVisualFlags:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetwrapvisualflags">external documentation</a>.
+-spec getWrapVisualFlags(This) -> integer() when
+ This::wxStyledTextCtrl().
getWrapVisualFlags(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetWrapVisualFlags,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), WrapVisualFlagsLocation::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetwrapvisualflagslocation">external documentation</a>.
+-spec setWrapVisualFlagsLocation(This, WrapVisualFlagsLocation) -> ok when
+ This::wxStyledTextCtrl(), WrapVisualFlagsLocation::integer().
setWrapVisualFlagsLocation(#wx_ref{type=ThisT,ref=ThisRef},WrapVisualFlagsLocation)
when is_integer(WrapVisualFlagsLocation) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetWrapVisualFlagsLocation,
<<ThisRef:32/?UI,WrapVisualFlagsLocation:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetwrapvisualflagslocation">external documentation</a>.
+-spec getWrapVisualFlagsLocation(This) -> integer() when
+ This::wxStyledTextCtrl().
getWrapVisualFlagsLocation(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetWrapVisualFlagsLocation,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Indent::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetwrapstartindent">external documentation</a>.
+-spec setWrapStartIndent(This, Indent) -> ok when
+ This::wxStyledTextCtrl(), Indent::integer().
setWrapStartIndent(#wx_ref{type=ThisT,ref=ThisRef},Indent)
when is_integer(Indent) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetWrapStartIndent,
<<ThisRef:32/?UI,Indent:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetwrapstartindent">external documentation</a>.
+-spec getWrapStartIndent(This) -> integer() when
+ This::wxStyledTextCtrl().
getWrapStartIndent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetWrapStartIndent,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Mode::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetlayoutcache">external documentation</a>.
+-spec setLayoutCache(This, Mode) -> ok when
+ This::wxStyledTextCtrl(), Mode::integer().
setLayoutCache(#wx_ref{type=ThisT,ref=ThisRef},Mode)
when is_integer(Mode) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetLayoutCache,
<<ThisRef:32/?UI,Mode:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetlayoutcache">external documentation</a>.
+-spec getLayoutCache(This) -> integer() when
+ This::wxStyledTextCtrl().
getLayoutCache(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetLayoutCache,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), PixelWidth::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetscrollwidth">external documentation</a>.
+-spec setScrollWidth(This, PixelWidth) -> ok when
+ This::wxStyledTextCtrl(), PixelWidth::integer().
setScrollWidth(#wx_ref{type=ThisT,ref=ThisRef},PixelWidth)
when is_integer(PixelWidth) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetScrollWidth,
<<ThisRef:32/?UI,PixelWidth:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetscrollwidth">external documentation</a>.
+-spec getScrollWidth(This) -> integer() when
+ This::wxStyledTextCtrl().
getScrollWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetScrollWidth,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Style::integer(), Text::string()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrltextwidth">external documentation</a>.
+-spec textWidth(This, Style, Text) -> integer() when
+ This::wxStyledTextCtrl(), Style::integer(), Text::unicode:chardata().
textWidth(#wx_ref{type=ThisT,ref=ThisRef},Style,Text)
when is_integer(Style),is_list(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -2124,38 +2387,43 @@ textWidth(#wx_ref{type=ThisT,ref=ThisRef},Style,Text)
wxe_util:call(?wxStyledTextCtrl_TextWidth,
<<ThisRef:32/?UI,Style:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetendatlastline">external documentation</a>.
+-spec getEndAtLastLine(This) -> boolean() when
+ This::wxStyledTextCtrl().
getEndAtLastLine(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetEndAtLastLine,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrltextheight">external documentation</a>.
+-spec textHeight(This, Line) -> integer() when
+ This::wxStyledTextCtrl(), Line::integer().
textHeight(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_TextHeight,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Show::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetuseverticalscrollbar">external documentation</a>.
+-spec setUseVerticalScrollBar(This, Show) -> ok when
+ This::wxStyledTextCtrl(), Show::boolean().
setUseVerticalScrollBar(#wx_ref{type=ThisT,ref=ThisRef},Show)
when is_boolean(Show) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetUseVerticalScrollBar,
<<ThisRef:32/?UI,(wxe_util:from_bool(Show)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetuseverticalscrollbar">external documentation</a>.
+-spec getUseVerticalScrollBar(This) -> boolean() when
+ This::wxStyledTextCtrl().
getUseVerticalScrollBar(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetUseVerticalScrollBar,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Text::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlappendtext">external documentation</a>.
+-spec appendText(This, Text) -> ok when
+ This::wxStyledTextCtrl(), Text::unicode:chardata().
appendText(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_list(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -2163,559 +2431,646 @@ appendText(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:cast(?wxStyledTextCtrl_AppendText,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgettwophasedraw">external documentation</a>.
+-spec getTwoPhaseDraw(This) -> boolean() when
+ This::wxStyledTextCtrl().
getTwoPhaseDraw(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetTwoPhaseDraw,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), TwoPhase::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsettwophasedraw">external documentation</a>.
+-spec setTwoPhaseDraw(This, TwoPhase) -> ok when
+ This::wxStyledTextCtrl(), TwoPhase::boolean().
setTwoPhaseDraw(#wx_ref{type=ThisT,ref=ThisRef},TwoPhase)
when is_boolean(TwoPhase) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetTwoPhaseDraw,
<<ThisRef:32/?UI,(wxe_util:from_bool(TwoPhase)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrltargetfromselection">external documentation</a>.
+-spec targetFromSelection(This) -> ok when
+ This::wxStyledTextCtrl().
targetFromSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_TargetFromSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllinesjoin">external documentation</a>.
+-spec linesJoin(This) -> ok when
+ This::wxStyledTextCtrl().
linesJoin(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LinesJoin,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), PixelWidth::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllinessplit">external documentation</a>.
+-spec linesSplit(This, PixelWidth) -> ok when
+ This::wxStyledTextCtrl(), PixelWidth::integer().
linesSplit(#wx_ref{type=ThisT,ref=ThisRef},PixelWidth)
when is_integer(PixelWidth) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LinesSplit,
<<ThisRef:32/?UI,PixelWidth:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), UseSetting::bool(), Back::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetfoldmargincolour">external documentation</a>.
+-spec setFoldMarginColour(This, UseSetting, Back) -> ok when
+ This::wxStyledTextCtrl(), UseSetting::boolean(), Back::wx:wx_colour().
setFoldMarginColour(#wx_ref{type=ThisT,ref=ThisRef},UseSetting,Back)
when is_boolean(UseSetting),tuple_size(Back) =:= 3; tuple_size(Back) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetFoldMarginColour,
<<ThisRef:32/?UI,(wxe_util:from_bool(UseSetting)):32/?UI,(wxe_util:colour_bin(Back)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl(), UseSetting::bool(), Fore::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetfoldmarginhicolour">external documentation</a>.
+-spec setFoldMarginHiColour(This, UseSetting, Fore) -> ok when
+ This::wxStyledTextCtrl(), UseSetting::boolean(), Fore::wx:wx_colour().
setFoldMarginHiColour(#wx_ref{type=ThisT,ref=ThisRef},UseSetting,Fore)
when is_boolean(UseSetting),tuple_size(Fore) =:= 3; tuple_size(Fore) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetFoldMarginHiColour,
<<ThisRef:32/?UI,(wxe_util:from_bool(UseSetting)):32/?UI,(wxe_util:colour_bin(Fore)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllinedown">external documentation</a>.
+-spec lineDown(This) -> ok when
+ This::wxStyledTextCtrl().
lineDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllinedownextend">external documentation</a>.
+-spec lineDownExtend(This) -> ok when
+ This::wxStyledTextCtrl().
lineDownExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineDownExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllineup">external documentation</a>.
+-spec lineUp(This) -> ok when
+ This::wxStyledTextCtrl().
lineUp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineUp,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllineupextend">external documentation</a>.
+-spec lineUpExtend(This) -> ok when
+ This::wxStyledTextCtrl().
lineUpExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineUpExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcharleft">external documentation</a>.
+-spec charLeft(This) -> ok when
+ This::wxStyledTextCtrl().
charLeft(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CharLeft,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcharleftextend">external documentation</a>.
+-spec charLeftExtend(This) -> ok when
+ This::wxStyledTextCtrl().
charLeftExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CharLeftExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcharright">external documentation</a>.
+-spec charRight(This) -> ok when
+ This::wxStyledTextCtrl().
charRight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CharRight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcharrightextend">external documentation</a>.
+-spec charRightExtend(This) -> ok when
+ This::wxStyledTextCtrl().
charRightExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CharRightExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwordleft">external documentation</a>.
+-spec wordLeft(This) -> ok when
+ This::wxStyledTextCtrl().
wordLeft(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_WordLeft,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwordleftextend">external documentation</a>.
+-spec wordLeftExtend(This) -> ok when
+ This::wxStyledTextCtrl().
wordLeftExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_WordLeftExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwordright">external documentation</a>.
+-spec wordRight(This) -> ok when
+ This::wxStyledTextCtrl().
wordRight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_WordRight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwordrightextend">external documentation</a>.
+-spec wordRightExtend(This) -> ok when
+ This::wxStyledTextCtrl().
wordRightExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_WordRightExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlhome">external documentation</a>.
+-spec home(This) -> ok when
+ This::wxStyledTextCtrl().
home(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_Home,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlhomeextend">external documentation</a>.
+-spec homeExtend(This) -> ok when
+ This::wxStyledTextCtrl().
homeExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_HomeExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllineend">external documentation</a>.
+-spec lineEnd(This) -> ok when
+ This::wxStyledTextCtrl().
lineEnd(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineEnd,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllineendextend">external documentation</a>.
+-spec lineEndExtend(This) -> ok when
+ This::wxStyledTextCtrl().
lineEndExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineEndExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrldocumentstart">external documentation</a>.
+-spec documentStart(This) -> ok when
+ This::wxStyledTextCtrl().
documentStart(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_DocumentStart,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrldocumentstartextend">external documentation</a>.
+-spec documentStartExtend(This) -> ok when
+ This::wxStyledTextCtrl().
documentStartExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_DocumentStartExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrldocumentend">external documentation</a>.
+-spec documentEnd(This) -> ok when
+ This::wxStyledTextCtrl().
documentEnd(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_DocumentEnd,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrldocumentendextend">external documentation</a>.
+-spec documentEndExtend(This) -> ok when
+ This::wxStyledTextCtrl().
documentEndExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_DocumentEndExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlpageup">external documentation</a>.
+-spec pageUp(This) -> ok when
+ This::wxStyledTextCtrl().
pageUp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_PageUp,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlpageupextend">external documentation</a>.
+-spec pageUpExtend(This) -> ok when
+ This::wxStyledTextCtrl().
pageUpExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_PageUpExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlpagedown">external documentation</a>.
+-spec pageDown(This) -> ok when
+ This::wxStyledTextCtrl().
pageDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_PageDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlpagedownextend">external documentation</a>.
+-spec pageDownExtend(This) -> ok when
+ This::wxStyledTextCtrl().
pageDownExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_PageDownExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrledittoggleovertype">external documentation</a>.
+-spec editToggleOvertype(This) -> ok when
+ This::wxStyledTextCtrl().
editToggleOvertype(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_EditToggleOvertype,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcancel">external documentation</a>.
+-spec cancel(This) -> ok when
+ This::wxStyledTextCtrl().
cancel(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_Cancel,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrldeleteback">external documentation</a>.
+-spec deleteBack(This) -> ok when
+ This::wxStyledTextCtrl().
deleteBack(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_DeleteBack,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrltab">external documentation</a>.
+-spec tab(This) -> ok when
+ This::wxStyledTextCtrl().
tab(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_Tab,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlbacktab">external documentation</a>.
+-spec backTab(This) -> ok when
+ This::wxStyledTextCtrl().
backTab(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_BackTab,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlnewline">external documentation</a>.
+-spec newLine(This) -> ok when
+ This::wxStyledTextCtrl().
newLine(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_NewLine,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlformfeed">external documentation</a>.
+-spec formFeed(This) -> ok when
+ This::wxStyledTextCtrl().
formFeed(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_FormFeed,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlvchome">external documentation</a>.
+-spec vCHome(This) -> ok when
+ This::wxStyledTextCtrl().
vCHome(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_VCHome,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlvchomeextend">external documentation</a>.
+-spec vCHomeExtend(This) -> ok when
+ This::wxStyledTextCtrl().
vCHomeExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_VCHomeExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlzoomin">external documentation</a>.
+-spec zoomIn(This) -> ok when
+ This::wxStyledTextCtrl().
zoomIn(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_ZoomIn,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlzoomout">external documentation</a>.
+-spec zoomOut(This) -> ok when
+ This::wxStyledTextCtrl().
zoomOut(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_ZoomOut,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrldelwordleft">external documentation</a>.
+-spec delWordLeft(This) -> ok when
+ This::wxStyledTextCtrl().
delWordLeft(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_DelWordLeft,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrldelwordright">external documentation</a>.
+-spec delWordRight(This) -> ok when
+ This::wxStyledTextCtrl().
delWordRight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_DelWordRight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllinecut">external documentation</a>.
+-spec lineCut(This) -> ok when
+ This::wxStyledTextCtrl().
lineCut(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineCut,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllinedelete">external documentation</a>.
+-spec lineDelete(This) -> ok when
+ This::wxStyledTextCtrl().
lineDelete(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineDelete,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllinetranspose">external documentation</a>.
+-spec lineTranspose(This) -> ok when
+ This::wxStyledTextCtrl().
lineTranspose(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineTranspose,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllineduplicate">external documentation</a>.
+-spec lineDuplicate(This) -> ok when
+ This::wxStyledTextCtrl().
lineDuplicate(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineDuplicate,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllowercase">external documentation</a>.
+-spec lowerCase(This) -> ok when
+ This::wxStyledTextCtrl().
lowerCase(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LowerCase,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrluppercase">external documentation</a>.
+-spec upperCase(This) -> ok when
+ This::wxStyledTextCtrl().
upperCase(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_UpperCase,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllinescrolldown">external documentation</a>.
+-spec lineScrollDown(This) -> ok when
+ This::wxStyledTextCtrl().
lineScrollDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineScrollDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllinescrollup">external documentation</a>.
+-spec lineScrollUp(This) -> ok when
+ This::wxStyledTextCtrl().
lineScrollUp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineScrollUp,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrldeletebacknotline">external documentation</a>.
+-spec deleteBackNotLine(This) -> ok when
+ This::wxStyledTextCtrl().
deleteBackNotLine(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_DeleteBackNotLine,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlhomedisplay">external documentation</a>.
+-spec homeDisplay(This) -> ok when
+ This::wxStyledTextCtrl().
homeDisplay(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_HomeDisplay,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlhomedisplayextend">external documentation</a>.
+-spec homeDisplayExtend(This) -> ok when
+ This::wxStyledTextCtrl().
homeDisplayExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_HomeDisplayExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllineenddisplay">external documentation</a>.
+-spec lineEndDisplay(This) -> ok when
+ This::wxStyledTextCtrl().
lineEndDisplay(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineEndDisplay,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllineenddisplayextend">external documentation</a>.
+-spec lineEndDisplayExtend(This) -> ok when
+ This::wxStyledTextCtrl().
lineEndDisplayExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineEndDisplayExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlhomewrapextend">external documentation</a>.
+-spec homeWrapExtend(This) -> ok when
+ This::wxStyledTextCtrl().
homeWrapExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_HomeWrapExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllineendwrap">external documentation</a>.
+-spec lineEndWrap(This) -> ok when
+ This::wxStyledTextCtrl().
lineEndWrap(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineEndWrap,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllineendwrapextend">external documentation</a>.
+-spec lineEndWrapExtend(This) -> ok when
+ This::wxStyledTextCtrl().
lineEndWrapExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineEndWrapExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlvchomewrap">external documentation</a>.
+-spec vCHomeWrap(This) -> ok when
+ This::wxStyledTextCtrl().
vCHomeWrap(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_VCHomeWrap,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlvchomewrapextend">external documentation</a>.
+-spec vCHomeWrapExtend(This) -> ok when
+ This::wxStyledTextCtrl().
vCHomeWrapExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_VCHomeWrapExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllinecopy">external documentation</a>.
+-spec lineCopy(This) -> ok when
+ This::wxStyledTextCtrl().
lineCopy(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineCopy,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlmovecaretinsideview">external documentation</a>.
+-spec moveCaretInsideView(This) -> ok when
+ This::wxStyledTextCtrl().
moveCaretInsideView(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_MoveCaretInsideView,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllinelength">external documentation</a>.
+-spec lineLength(This, Line) -> integer() when
+ This::wxStyledTextCtrl(), Line::integer().
lineLength(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_LineLength,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos1::integer(), Pos2::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlbracehighlight">external documentation</a>.
+-spec braceHighlight(This, Pos1, Pos2) -> ok when
+ This::wxStyledTextCtrl(), Pos1::integer(), Pos2::integer().
braceHighlight(#wx_ref{type=ThisT,ref=ThisRef},Pos1,Pos2)
when is_integer(Pos1),is_integer(Pos2) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_BraceHighlight,
<<ThisRef:32/?UI,Pos1:32/?UI,Pos2:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlbracebadlight">external documentation</a>.
+-spec braceBadLight(This, Pos) -> ok when
+ This::wxStyledTextCtrl(), Pos::integer().
braceBadLight(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_BraceBadLight,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlbracematch">external documentation</a>.
+-spec braceMatch(This, Pos) -> integer() when
+ This::wxStyledTextCtrl(), Pos::integer().
braceMatch(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_BraceMatch,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetvieweol">external documentation</a>.
+-spec getViewEOL(This) -> boolean() when
+ This::wxStyledTextCtrl().
getViewEOL(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetViewEOL,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Visible::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetvieweol">external documentation</a>.
+-spec setViewEOL(This, Visible) -> ok when
+ This::wxStyledTextCtrl(), Visible::boolean().
setViewEOL(#wx_ref{type=ThisT,ref=ThisRef},Visible)
when is_boolean(Visible) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetViewEOL,
<<ThisRef:32/?UI,(wxe_util:from_bool(Visible)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Mask::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetmodeventmask">external documentation</a>.
+-spec setModEventMask(This, Mask) -> ok when
+ This::wxStyledTextCtrl(), Mask::integer().
setModEventMask(#wx_ref{type=ThisT,ref=ThisRef},Mask)
when is_integer(Mask) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetModEventMask,
<<ThisRef:32/?UI,Mask:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetedgecolumn">external documentation</a>.
+-spec getEdgeColumn(This) -> integer() when
+ This::wxStyledTextCtrl().
getEdgeColumn(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetEdgeColumn,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Column::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetedgecolumn">external documentation</a>.
+-spec setEdgeColumn(This, Column) -> ok when
+ This::wxStyledTextCtrl(), Column::integer().
setEdgeColumn(#wx_ref{type=ThisT,ref=ThisRef},Column)
when is_integer(Column) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetEdgeColumn,
<<ThisRef:32/?UI,Column:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
+%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetedgemode">external documentation</a>.
+-spec setEdgeMode(This, Mode) -> ok when
+ This::wxStyledTextCtrl(), Mode::integer().
+setEdgeMode(#wx_ref{type=ThisT,ref=ThisRef},Mode)
+ when is_integer(Mode) ->
+ ?CLASS(ThisT,wxStyledTextCtrl),
+ wxe_util:cast(?wxStyledTextCtrl_SetEdgeMode,
+ <<ThisRef:32/?UI,Mode:32/?UI>>).
+
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetedgemode">external documentation</a>.
+-spec getEdgeMode(This) -> integer() when
+ This::wxStyledTextCtrl().
getEdgeMode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetEdgeMode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetedgecolour">external documentation</a>.
+-spec getEdgeColour(This) -> wx:wx_colour4() when
+ This::wxStyledTextCtrl().
getEdgeColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetEdgeColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), EdgeColour::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetedgecolour">external documentation</a>.
+-spec setEdgeColour(This, EdgeColour) -> ok when
+ This::wxStyledTextCtrl(), EdgeColour::wx:wx_colour().
setEdgeColour(#wx_ref{type=ThisT,ref=ThisRef},EdgeColour)
when tuple_size(EdgeColour) =:= 3; tuple_size(EdgeColour) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetEdgeColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(EdgeColour)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsearchanchor">external documentation</a>.
+-spec searchAnchor(This) -> ok when
+ This::wxStyledTextCtrl().
searchAnchor(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SearchAnchor,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Flags::integer(), Text::string()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsearchnext">external documentation</a>.
+-spec searchNext(This, Flags, Text) -> integer() when
+ This::wxStyledTextCtrl(), Flags::integer(), Text::unicode:chardata().
searchNext(#wx_ref{type=ThisT,ref=ThisRef},Flags,Text)
when is_integer(Flags),is_list(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -2723,8 +3078,9 @@ searchNext(#wx_ref{type=ThisT,ref=ThisRef},Flags,Text)
wxe_util:call(?wxStyledTextCtrl_SearchNext,
<<ThisRef:32/?UI,Flags:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), Flags::integer(), Text::string()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsearchprev">external documentation</a>.
+-spec searchPrev(This, Flags, Text) -> integer() when
+ This::wxStyledTextCtrl(), Flags::integer(), Text::unicode:chardata().
searchPrev(#wx_ref{type=ThisT,ref=ThisRef},Flags,Text)
when is_integer(Flags),is_list(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -2732,291 +3088,330 @@ searchPrev(#wx_ref{type=ThisT,ref=ThisRef},Flags,Text)
wxe_util:call(?wxStyledTextCtrl_SearchPrev,
<<ThisRef:32/?UI,Flags:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllinesonscreen">external documentation</a>.
+-spec linesOnScreen(This) -> integer() when
+ This::wxStyledTextCtrl().
linesOnScreen(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_LinesOnScreen,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), AllowPopUp::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlusepopup">external documentation</a>.
+-spec usePopUp(This, AllowPopUp) -> ok when
+ This::wxStyledTextCtrl(), AllowPopUp::boolean().
usePopUp(#wx_ref{type=ThisT,ref=ThisRef},AllowPopUp)
when is_boolean(AllowPopUp) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_UsePopUp,
<<ThisRef:32/?UI,(wxe_util:from_bool(AllowPopUp)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlselectionisrectangle">external documentation</a>.
+-spec selectionIsRectangle(This) -> boolean() when
+ This::wxStyledTextCtrl().
selectionIsRectangle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_SelectionIsRectangle,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Zoom::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetzoom">external documentation</a>.
+-spec setZoom(This, Zoom) -> ok when
+ This::wxStyledTextCtrl(), Zoom::integer().
setZoom(#wx_ref{type=ThisT,ref=ThisRef},Zoom)
when is_integer(Zoom) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetZoom,
<<ThisRef:32/?UI,Zoom:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetzoom">external documentation</a>.
+-spec getZoom(This) -> integer() when
+ This::wxStyledTextCtrl().
getZoom(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetZoom,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetmodeventmask">external documentation</a>.
+-spec getModEventMask(This) -> integer() when
+ This::wxStyledTextCtrl().
getModEventMask(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetModEventMask,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Focus::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetstcfocus">external documentation</a>.
+-spec setSTCFocus(This, Focus) -> ok when
+ This::wxStyledTextCtrl(), Focus::boolean().
setSTCFocus(#wx_ref{type=ThisT,ref=ThisRef},Focus)
when is_boolean(Focus) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetSTCFocus,
<<ThisRef:32/?UI,(wxe_util:from_bool(Focus)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetstcfocus">external documentation</a>.
+-spec getSTCFocus(This) -> boolean() when
+ This::wxStyledTextCtrl().
getSTCFocus(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetSTCFocus,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), StatusCode::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetstatus">external documentation</a>.
+-spec setStatus(This, StatusCode) -> ok when
+ This::wxStyledTextCtrl(), StatusCode::integer().
setStatus(#wx_ref{type=ThisT,ref=ThisRef},StatusCode)
when is_integer(StatusCode) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetStatus,
<<ThisRef:32/?UI,StatusCode:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetstatus">external documentation</a>.
+-spec getStatus(This) -> integer() when
+ This::wxStyledTextCtrl().
getStatus(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetStatus,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Captures::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetmousedowncaptures">external documentation</a>.
+-spec setMouseDownCaptures(This, Captures) -> ok when
+ This::wxStyledTextCtrl(), Captures::boolean().
setMouseDownCaptures(#wx_ref{type=ThisT,ref=ThisRef},Captures)
when is_boolean(Captures) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetMouseDownCaptures,
<<ThisRef:32/?UI,(wxe_util:from_bool(Captures)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetmousedowncaptures">external documentation</a>.
+-spec getMouseDownCaptures(This) -> boolean() when
+ This::wxStyledTextCtrl().
getMouseDownCaptures(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetMouseDownCaptures,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), CursorType::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetstccursor">external documentation</a>.
+-spec setSTCCursor(This, CursorType) -> ok when
+ This::wxStyledTextCtrl(), CursorType::integer().
setSTCCursor(#wx_ref{type=ThisT,ref=ThisRef},CursorType)
when is_integer(CursorType) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetSTCCursor,
<<ThisRef:32/?UI,CursorType:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetstccursor">external documentation</a>.
+-spec getSTCCursor(This) -> integer() when
+ This::wxStyledTextCtrl().
getSTCCursor(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetSTCCursor,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Symbol::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetcontrolcharsymbol">external documentation</a>.
+-spec setControlCharSymbol(This, Symbol) -> ok when
+ This::wxStyledTextCtrl(), Symbol::integer().
setControlCharSymbol(#wx_ref{type=ThisT,ref=ThisRef},Symbol)
when is_integer(Symbol) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetControlCharSymbol,
<<ThisRef:32/?UI,Symbol:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetcontrolcharsymbol">external documentation</a>.
+-spec getControlCharSymbol(This) -> integer() when
+ This::wxStyledTextCtrl().
getControlCharSymbol(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetControlCharSymbol,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwordpartleft">external documentation</a>.
+-spec wordPartLeft(This) -> ok when
+ This::wxStyledTextCtrl().
wordPartLeft(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_WordPartLeft,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwordpartleftextend">external documentation</a>.
+-spec wordPartLeftExtend(This) -> ok when
+ This::wxStyledTextCtrl().
wordPartLeftExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_WordPartLeftExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwordpartright">external documentation</a>.
+-spec wordPartRight(This) -> ok when
+ This::wxStyledTextCtrl().
wordPartRight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_WordPartRight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwordpartrightextend">external documentation</a>.
+-spec wordPartRightExtend(This) -> ok when
+ This::wxStyledTextCtrl().
wordPartRightExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_WordPartRightExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), VisiblePolicy::integer(), VisibleSlop::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetvisiblepolicy">external documentation</a>.
+-spec setVisiblePolicy(This, VisiblePolicy, VisibleSlop) -> ok when
+ This::wxStyledTextCtrl(), VisiblePolicy::integer(), VisibleSlop::integer().
setVisiblePolicy(#wx_ref{type=ThisT,ref=ThisRef},VisiblePolicy,VisibleSlop)
when is_integer(VisiblePolicy),is_integer(VisibleSlop) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetVisiblePolicy,
<<ThisRef:32/?UI,VisiblePolicy:32/?UI,VisibleSlop:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrldellineleft">external documentation</a>.
+-spec delLineLeft(This) -> ok when
+ This::wxStyledTextCtrl().
delLineLeft(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_DelLineLeft,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrldellineright">external documentation</a>.
+-spec delLineRight(This) -> ok when
+ This::wxStyledTextCtrl().
delLineRight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_DelLineRight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetxoffset">external documentation</a>.
+-spec getXOffset(This) -> integer() when
+ This::wxStyledTextCtrl().
getXOffset(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetXOffset,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlchoosecaretx">external documentation</a>.
+-spec chooseCaretX(This) -> ok when
+ This::wxStyledTextCtrl().
chooseCaretX(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_ChooseCaretX,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), CaretPolicy::integer(), CaretSlop::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetxcaretpolicy">external documentation</a>.
+-spec setXCaretPolicy(This, CaretPolicy, CaretSlop) -> ok when
+ This::wxStyledTextCtrl(), CaretPolicy::integer(), CaretSlop::integer().
setXCaretPolicy(#wx_ref{type=ThisT,ref=ThisRef},CaretPolicy,CaretSlop)
when is_integer(CaretPolicy),is_integer(CaretSlop) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetXCaretPolicy,
<<ThisRef:32/?UI,CaretPolicy:32/?UI,CaretSlop:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), CaretPolicy::integer(), CaretSlop::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetycaretpolicy">external documentation</a>.
+-spec setYCaretPolicy(This, CaretPolicy, CaretSlop) -> ok when
+ This::wxStyledTextCtrl(), CaretPolicy::integer(), CaretSlop::integer().
setYCaretPolicy(#wx_ref{type=ThisT,ref=ThisRef},CaretPolicy,CaretSlop)
when is_integer(CaretPolicy),is_integer(CaretSlop) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetYCaretPolicy,
<<ThisRef:32/?UI,CaretPolicy:32/?UI,CaretSlop:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetprintwrapmode">external documentation</a>.
+-spec getPrintWrapMode(This) -> integer() when
+ This::wxStyledTextCtrl().
getPrintWrapMode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetPrintWrapMode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), UseSetting::bool(), Fore::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsethotspotactiveforeground">external documentation</a>.
+-spec setHotspotActiveForeground(This, UseSetting, Fore) -> ok when
+ This::wxStyledTextCtrl(), UseSetting::boolean(), Fore::wx:wx_colour().
setHotspotActiveForeground(#wx_ref{type=ThisT,ref=ThisRef},UseSetting,Fore)
when is_boolean(UseSetting),tuple_size(Fore) =:= 3; tuple_size(Fore) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetHotspotActiveForeground,
<<ThisRef:32/?UI,(wxe_util:from_bool(UseSetting)):32/?UI,(wxe_util:colour_bin(Fore)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl(), UseSetting::bool(), Back::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsethotspotactivebackground">external documentation</a>.
+-spec setHotspotActiveBackground(This, UseSetting, Back) -> ok when
+ This::wxStyledTextCtrl(), UseSetting::boolean(), Back::wx:wx_colour().
setHotspotActiveBackground(#wx_ref{type=ThisT,ref=ThisRef},UseSetting,Back)
when is_boolean(UseSetting),tuple_size(Back) =:= 3; tuple_size(Back) =:= 4 ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetHotspotActiveBackground,
<<ThisRef:32/?UI,(wxe_util:from_bool(UseSetting)):32/?UI,(wxe_util:colour_bin(Back)):16/binary>>).
-%% @spec (This::wxStyledTextCtrl(), Underline::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsethotspotactiveunderline">external documentation</a>.
+-spec setHotspotActiveUnderline(This, Underline) -> ok when
+ This::wxStyledTextCtrl(), Underline::boolean().
setHotspotActiveUnderline(#wx_ref{type=ThisT,ref=ThisRef},Underline)
when is_boolean(Underline) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetHotspotActiveUnderline,
<<ThisRef:32/?UI,(wxe_util:from_bool(Underline)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), SingleLine::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsethotspotsingleline">external documentation</a>.
+-spec setHotspotSingleLine(This, SingleLine) -> ok when
+ This::wxStyledTextCtrl(), SingleLine::boolean().
setHotspotSingleLine(#wx_ref{type=ThisT,ref=ThisRef},SingleLine)
when is_boolean(SingleLine) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetHotspotSingleLine,
<<ThisRef:32/?UI,(wxe_util:from_bool(SingleLine)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlparadownextend">external documentation</a>.
+-spec paraDownExtend(This) -> ok when
+ This::wxStyledTextCtrl().
paraDownExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_ParaDownExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlparaup">external documentation</a>.
+-spec paraUp(This) -> ok when
+ This::wxStyledTextCtrl().
paraUp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_ParaUp,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlparaupextend">external documentation</a>.
+-spec paraUpExtend(This) -> ok when
+ This::wxStyledTextCtrl().
paraUpExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_ParaUpExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlpositionbefore">external documentation</a>.
+-spec positionBefore(This, Pos) -> integer() when
+ This::wxStyledTextCtrl(), Pos::integer().
positionBefore(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_PositionBefore,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlpositionafter">external documentation</a>.
+-spec positionAfter(This, Pos) -> integer() when
+ This::wxStyledTextCtrl(), Pos::integer().
positionAfter(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_PositionAfter,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Start::integer(), End::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcopyrange">external documentation</a>.
+-spec copyRange(This, Start, End) -> ok when
+ This::wxStyledTextCtrl(), Start::integer(), End::integer().
copyRange(#wx_ref{type=ThisT,ref=ThisRef},Start,End)
when is_integer(Start),is_integer(End) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CopyRange,
<<ThisRef:32/?UI,Start:32/?UI,End:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Length::integer(), Text::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcopytext">external documentation</a>.
+-spec copyText(This, Length, Text) -> ok when
+ This::wxStyledTextCtrl(), Length::integer(), Text::unicode:chardata().
copyText(#wx_ref{type=ThisT,ref=ThisRef},Length,Text)
when is_integer(Length),is_list(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3024,142 +3419,162 @@ copyText(#wx_ref{type=ThisT,ref=ThisRef},Length,Text)
wxe_util:cast(?wxStyledTextCtrl_CopyText,
<<ThisRef:32/?UI,Length:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), Mode::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetselectionmode">external documentation</a>.
+-spec setSelectionMode(This, Mode) -> ok when
+ This::wxStyledTextCtrl(), Mode::integer().
setSelectionMode(#wx_ref{type=ThisT,ref=ThisRef},Mode)
when is_integer(Mode) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetSelectionMode,
<<ThisRef:32/?UI,Mode:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetselectionmode">external documentation</a>.
+-spec getSelectionMode(This) -> integer() when
+ This::wxStyledTextCtrl().
getSelectionMode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetSelectionMode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllinedownrectextend">external documentation</a>.
+-spec lineDownRectExtend(This) -> ok when
+ This::wxStyledTextCtrl().
lineDownRectExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineDownRectExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllineuprectextend">external documentation</a>.
+-spec lineUpRectExtend(This) -> ok when
+ This::wxStyledTextCtrl().
lineUpRectExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineUpRectExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcharleftrectextend">external documentation</a>.
+-spec charLeftRectExtend(This) -> ok when
+ This::wxStyledTextCtrl().
charLeftRectExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CharLeftRectExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcharrightrectextend">external documentation</a>.
+-spec charRightRectExtend(This) -> ok when
+ This::wxStyledTextCtrl().
charRightRectExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CharRightRectExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlhomerectextend">external documentation</a>.
+-spec homeRectExtend(This) -> ok when
+ This::wxStyledTextCtrl().
homeRectExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_HomeRectExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlvchomerectextend">external documentation</a>.
+-spec vCHomeRectExtend(This) -> ok when
+ This::wxStyledTextCtrl().
vCHomeRectExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_VCHomeRectExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrllineendrectextend">external documentation</a>.
+-spec lineEndRectExtend(This) -> ok when
+ This::wxStyledTextCtrl().
lineEndRectExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_LineEndRectExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlpageuprectextend">external documentation</a>.
+-spec pageUpRectExtend(This) -> ok when
+ This::wxStyledTextCtrl().
pageUpRectExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_PageUpRectExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlpagedownrectextend">external documentation</a>.
+-spec pageDownRectExtend(This) -> ok when
+ This::wxStyledTextCtrl().
pageDownRectExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_PageDownRectExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstutteredpageup">external documentation</a>.
+-spec stutteredPageUp(This) -> ok when
+ This::wxStyledTextCtrl().
stutteredPageUp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StutteredPageUp,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstutteredpageupextend">external documentation</a>.
+-spec stutteredPageUpExtend(This) -> ok when
+ This::wxStyledTextCtrl().
stutteredPageUpExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StutteredPageUpExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstutteredpagedown">external documentation</a>.
+-spec stutteredPageDown(This) -> ok when
+ This::wxStyledTextCtrl().
stutteredPageDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StutteredPageDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstutteredpagedownextend">external documentation</a>.
+-spec stutteredPageDownExtend(This) -> ok when
+ This::wxStyledTextCtrl().
stutteredPageDownExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StutteredPageDownExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwordleftend">external documentation</a>.
+-spec wordLeftEnd(This) -> ok when
+ This::wxStyledTextCtrl().
wordLeftEnd(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_WordLeftEnd,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwordleftendextend">external documentation</a>.
+-spec wordLeftEndExtend(This) -> ok when
+ This::wxStyledTextCtrl().
wordLeftEndExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_WordLeftEndExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwordrightend">external documentation</a>.
+-spec wordRightEnd(This) -> ok when
+ This::wxStyledTextCtrl().
wordRightEnd(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_WordRightEnd,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlwordrightendextend">external documentation</a>.
+-spec wordRightEndExtend(This) -> ok when
+ This::wxStyledTextCtrl().
wordRightEndExtend(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_WordRightEndExtend,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Characters::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetwhitespacechars">external documentation</a>.
+-spec setWhitespaceChars(This, Characters) -> ok when
+ This::wxStyledTextCtrl(), Characters::unicode:chardata().
setWhitespaceChars(#wx_ref{type=ThisT,ref=ThisRef},Characters)
when is_list(Characters) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3167,134 +3582,152 @@ setWhitespaceChars(#wx_ref{type=ThisT,ref=ThisRef},Characters)
wxe_util:cast(?wxStyledTextCtrl_SetWhitespaceChars,
<<ThisRef:32/?UI,(byte_size(Characters_UC)):32/?UI,(Characters_UC)/binary, 0:(((8- ((0+byte_size(Characters_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetcharsdefault">external documentation</a>.
+-spec setCharsDefault(This) -> ok when
+ This::wxStyledTextCtrl().
setCharsDefault(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetCharsDefault,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlautocompgetcurrent">external documentation</a>.
+-spec autoCompGetCurrent(This) -> integer() when
+ This::wxStyledTextCtrl().
autoCompGetCurrent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_AutoCompGetCurrent,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Bytes::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlallocate">external documentation</a>.
+-spec allocate(This, Bytes) -> ok when
+ This::wxStyledTextCtrl(), Bytes::integer().
allocate(#wx_ref{type=ThisT,ref=ThisRef},Bytes)
when is_integer(Bytes) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_Allocate,
<<ThisRef:32/?UI,Bytes:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer(), Column::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlfindcolumn">external documentation</a>.
+-spec findColumn(This, Line, Column) -> integer() when
+ This::wxStyledTextCtrl(), Line::integer(), Column::integer().
findColumn(#wx_ref{type=ThisT,ref=ThisRef},Line,Column)
when is_integer(Line),is_integer(Column) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_FindColumn,
<<ThisRef:32/?UI,Line:32/?UI,Column:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetcaretsticky">external documentation</a>.
+-spec getCaretSticky(This) -> boolean() when
+ This::wxStyledTextCtrl().
getCaretSticky(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetCaretSticky,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), UseCaretStickyBehaviour::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetcaretsticky">external documentation</a>.
+-spec setCaretSticky(This, UseCaretStickyBehaviour) -> ok when
+ This::wxStyledTextCtrl(), UseCaretStickyBehaviour::boolean().
setCaretSticky(#wx_ref{type=ThisT,ref=ThisRef},UseCaretStickyBehaviour)
when is_boolean(UseCaretStickyBehaviour) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetCaretSticky,
<<ThisRef:32/?UI,(wxe_util:from_bool(UseCaretStickyBehaviour)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrltogglecaretsticky">external documentation</a>.
+-spec toggleCaretSticky(This) -> ok when
+ This::wxStyledTextCtrl().
toggleCaretSticky(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_ToggleCaretSticky,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Convert::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetpasteconvertendings">external documentation</a>.
+-spec setPasteConvertEndings(This, Convert) -> ok when
+ This::wxStyledTextCtrl(), Convert::boolean().
setPasteConvertEndings(#wx_ref{type=ThisT,ref=ThisRef},Convert)
when is_boolean(Convert) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetPasteConvertEndings,
<<ThisRef:32/?UI,(wxe_util:from_bool(Convert)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetpasteconvertendings">external documentation</a>.
+-spec getPasteConvertEndings(This) -> boolean() when
+ This::wxStyledTextCtrl().
getPasteConvertEndings(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetPasteConvertEndings,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlselectionduplicate">external documentation</a>.
+-spec selectionDuplicate(This) -> ok when
+ This::wxStyledTextCtrl().
selectionDuplicate(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SelectionDuplicate,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Alpha::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetcaretlinebackalpha">external documentation</a>.
+-spec setCaretLineBackAlpha(This, Alpha) -> ok when
+ This::wxStyledTextCtrl(), Alpha::integer().
setCaretLineBackAlpha(#wx_ref{type=ThisT,ref=ThisRef},Alpha)
when is_integer(Alpha) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetCaretLineBackAlpha,
<<ThisRef:32/?UI,Alpha:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetcaretlinebackalpha">external documentation</a>.
+-spec getCaretLineBackAlpha(This) -> integer() when
+ This::wxStyledTextCtrl().
getCaretLineBackAlpha(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetCaretLineBackAlpha,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstartrecord">external documentation</a>.
+-spec startRecord(This) -> ok when
+ This::wxStyledTextCtrl().
startRecord(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StartRecord,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstoprecord">external documentation</a>.
+-spec stopRecord(This) -> ok when
+ This::wxStyledTextCtrl().
stopRecord(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StopRecord,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Lexer::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetlexer">external documentation</a>.
+-spec setLexer(This, Lexer) -> ok when
+ This::wxStyledTextCtrl(), Lexer::integer().
setLexer(#wx_ref{type=ThisT,ref=ThisRef},Lexer)
when is_integer(Lexer) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetLexer,
<<ThisRef:32/?UI,Lexer:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetlexer">external documentation</a>.
+-spec getLexer(This) -> integer() when
+ This::wxStyledTextCtrl().
getLexer(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetLexer,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Start::integer(), End::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcolourise">external documentation</a>.
+-spec colourise(This, Start, End) -> ok when
+ This::wxStyledTextCtrl(), Start::integer(), End::integer().
colourise(#wx_ref{type=ThisT,ref=ThisRef},Start,End)
when is_integer(Start),is_integer(End) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_Colourise,
<<ThisRef:32/?UI,Start:32/?UI,End:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Key::string(), Value::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetproperty">external documentation</a>.
+-spec setProperty(This, Key, Value) -> ok when
+ This::wxStyledTextCtrl(), Key::unicode:chardata(), Value::unicode:chardata().
setProperty(#wx_ref{type=ThisT,ref=ThisRef},Key,Value)
when is_list(Key),is_list(Value) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3303,8 +3736,9 @@ setProperty(#wx_ref{type=ThisT,ref=ThisRef},Key,Value)
wxe_util:cast(?wxStyledTextCtrl_SetProperty,
<<ThisRef:32/?UI,(byte_size(Key_UC)):32/?UI,(Key_UC)/binary, 0:(((8- ((0+byte_size(Key_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Value_UC)):32/?UI,(Value_UC)/binary, 0:(((8- ((4+byte_size(Value_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), KeywordSet::integer(), KeyWords::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetkeywords">external documentation</a>.
+-spec setKeyWords(This, KeywordSet, KeyWords) -> ok when
+ This::wxStyledTextCtrl(), KeywordSet::integer(), KeyWords::unicode:chardata().
setKeyWords(#wx_ref{type=ThisT,ref=ThisRef},KeywordSet,KeyWords)
when is_integer(KeywordSet),is_list(KeyWords) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3312,8 +3746,9 @@ setKeyWords(#wx_ref{type=ThisT,ref=ThisRef},KeywordSet,KeyWords)
wxe_util:cast(?wxStyledTextCtrl_SetKeyWords,
<<ThisRef:32/?UI,KeywordSet:32/?UI,(byte_size(KeyWords_UC)):32/?UI,(KeyWords_UC)/binary, 0:(((8- ((4+byte_size(KeyWords_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), Language::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetlexerlanguage">external documentation</a>.
+-spec setLexerLanguage(This, Language) -> ok when
+ This::wxStyledTextCtrl(), Language::unicode:chardata().
setLexerLanguage(#wx_ref{type=ThisT,ref=ThisRef},Language)
when is_list(Language) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3321,8 +3756,9 @@ setLexerLanguage(#wx_ref{type=ThisT,ref=ThisRef},Language)
wxe_util:cast(?wxStyledTextCtrl_SetLexerLanguage,
<<ThisRef:32/?UI,(byte_size(Language_UC)):32/?UI,(Language_UC)/binary, 0:(((8- ((0+byte_size(Language_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), Key::string()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetproperty">external documentation</a>.
+-spec getProperty(This, Key) -> unicode:charlist() when
+ This::wxStyledTextCtrl(), Key::unicode:chardata().
getProperty(#wx_ref{type=ThisT,ref=ThisRef},Key)
when is_list(Key) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3330,22 +3766,25 @@ getProperty(#wx_ref{type=ThisT,ref=ThisRef},Key)
wxe_util:call(?wxStyledTextCtrl_GetProperty,
<<ThisRef:32/?UI,(byte_size(Key_UC)):32/?UI,(Key_UC)/binary, 0:(((8- ((0+byte_size(Key_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetstylebitsneeded">external documentation</a>.
+-spec getStyleBitsNeeded(This) -> integer() when
+ This::wxStyledTextCtrl().
getStyleBitsNeeded(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetStyleBitsNeeded,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetcurrentline">external documentation</a>.
+-spec getCurrentLine(This) -> integer() when
+ This::wxStyledTextCtrl().
getCurrentLine(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetCurrentLine,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), StyleNum::integer(), Spec::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesetspec">external documentation</a>.
+-spec styleSetSpec(This, StyleNum, Spec) -> ok when
+ This::wxStyledTextCtrl(), StyleNum::integer(), Spec::unicode:chardata().
styleSetSpec(#wx_ref{type=ThisT,ref=ThisRef},StyleNum,Spec)
when is_integer(StyleNum),is_list(Spec) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3353,8 +3792,9 @@ styleSetSpec(#wx_ref{type=ThisT,ref=ThisRef},StyleNum,Spec)
wxe_util:cast(?wxStyledTextCtrl_StyleSetSpec,
<<ThisRef:32/?UI,StyleNum:32/?UI,(byte_size(Spec_UC)):32/?UI,(Spec_UC)/binary, 0:(((8- ((4+byte_size(Spec_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), StyleNum::integer(), Font::wxFont:wxFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesetfont">external documentation</a>.
+-spec styleSetFont(This, StyleNum, Font) -> ok when
+ This::wxStyledTextCtrl(), StyleNum::integer(), Font::wxFont:wxFont().
styleSetFont(#wx_ref{type=ThisT,ref=ThisRef},StyleNum,#wx_ref{type=FontT,ref=FontRef})
when is_integer(StyleNum) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3362,17 +3802,19 @@ styleSetFont(#wx_ref{type=ThisT,ref=ThisRef},StyleNum,#wx_ref{type=FontT,ref=Fon
wxe_util:cast(?wxStyledTextCtrl_StyleSetFont,
<<ThisRef:32/?UI,StyleNum:32/?UI,FontRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), StyleNum::integer(), Size::integer(), FaceName::string(), Bold::bool(), Italic::bool(), Underline::bool()) -> ok
%% @equiv styleSetFontAttr(This,StyleNum,Size,FaceName,Bold,Italic,Underline, [])
+-spec styleSetFontAttr(This, StyleNum, Size, FaceName, Bold, Italic, Underline) -> ok when
+ This::wxStyledTextCtrl(), StyleNum::integer(), Size::integer(), FaceName::unicode:chardata(), Bold::boolean(), Italic::boolean(), Underline::boolean().
+
styleSetFontAttr(This,StyleNum,Size,FaceName,Bold,Italic,Underline)
when is_record(This, wx_ref),is_integer(StyleNum),is_integer(Size),is_list(FaceName),is_boolean(Bold),is_boolean(Italic),is_boolean(Underline) ->
styleSetFontAttr(This,StyleNum,Size,FaceName,Bold,Italic,Underline, []).
-%% @spec (This::wxStyledTextCtrl(), StyleNum::integer(), Size::integer(), FaceName::string(), Bold::bool(), Italic::bool(), Underline::bool(), [Option]) -> ok
-%% Option = {encoding, WxFontEncoding}
-%% WxFontEncoding = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesetfontattr">external documentation</a>.
-%%<br /> WxFontEncoding is one of ?wxFONTENCODING_SYSTEM | ?wxFONTENCODING_DEFAULT | ?wxFONTENCODING_ISO8859_1 | ?wxFONTENCODING_ISO8859_2 | ?wxFONTENCODING_ISO8859_3 | ?wxFONTENCODING_ISO8859_4 | ?wxFONTENCODING_ISO8859_5 | ?wxFONTENCODING_ISO8859_6 | ?wxFONTENCODING_ISO8859_7 | ?wxFONTENCODING_ISO8859_8 | ?wxFONTENCODING_ISO8859_9 | ?wxFONTENCODING_ISO8859_10 | ?wxFONTENCODING_ISO8859_11 | ?wxFONTENCODING_ISO8859_12 | ?wxFONTENCODING_ISO8859_13 | ?wxFONTENCODING_ISO8859_14 | ?wxFONTENCODING_ISO8859_15 | ?wxFONTENCODING_ISO8859_MAX | ?wxFONTENCODING_KOI8 | ?wxFONTENCODING_KOI8_U | ?wxFONTENCODING_ALTERNATIVE | ?wxFONTENCODING_BULGARIAN | ?wxFONTENCODING_CP437 | ?wxFONTENCODING_CP850 | ?wxFONTENCODING_CP852 | ?wxFONTENCODING_CP855 | ?wxFONTENCODING_CP866 | ?wxFONTENCODING_CP874 | ?wxFONTENCODING_CP932 | ?wxFONTENCODING_CP936 | ?wxFONTENCODING_CP949 | ?wxFONTENCODING_CP950 | ?wxFONTENCODING_CP1250 | ?wxFONTENCODING_CP1251 | ?wxFONTENCODING_CP1252 | ?wxFONTENCODING_CP1253 | ?wxFONTENCODING_CP1254 | ?wxFONTENCODING_CP1255 | ?wxFONTENCODING_CP1256 | ?wxFONTENCODING_CP1257 | ?wxFONTENCODING_CP12_MAX | ?wxFONTENCODING_UTF7 | ?wxFONTENCODING_UTF8 | ?wxFONTENCODING_EUC_JP | ?wxFONTENCODING_UTF16BE | ?wxFONTENCODING_UTF16LE | ?wxFONTENCODING_UTF32BE | ?wxFONTENCODING_UTF32LE | ?wxFONTENCODING_MACROMAN | ?wxFONTENCODING_MACJAPANESE | ?wxFONTENCODING_MACCHINESETRAD | ?wxFONTENCODING_MACKOREAN | ?wxFONTENCODING_MACARABIC | ?wxFONTENCODING_MACHEBREW | ?wxFONTENCODING_MACGREEK | ?wxFONTENCODING_MACCYRILLIC | ?wxFONTENCODING_MACDEVANAGARI | ?wxFONTENCODING_MACGURMUKHI | ?wxFONTENCODING_MACGUJARATI | ?wxFONTENCODING_MACORIYA | ?wxFONTENCODING_MACBENGALI | ?wxFONTENCODING_MACTAMIL | ?wxFONTENCODING_MACTELUGU | ?wxFONTENCODING_MACKANNADA | ?wxFONTENCODING_MACMALAJALAM | ?wxFONTENCODING_MACSINHALESE | ?wxFONTENCODING_MACBURMESE | ?wxFONTENCODING_MACKHMER | ?wxFONTENCODING_MACTHAI | ?wxFONTENCODING_MACLAOTIAN | ?wxFONTENCODING_MACGEORGIAN | ?wxFONTENCODING_MACARMENIAN | ?wxFONTENCODING_MACCHINESESIMP | ?wxFONTENCODING_MACTIBETAN | ?wxFONTENCODING_MACMONGOLIAN | ?wxFONTENCODING_MACETHIOPIC | ?wxFONTENCODING_MACCENTRALEUR | ?wxFONTENCODING_MACVIATNAMESE | ?wxFONTENCODING_MACARABICEXT | ?wxFONTENCODING_MACSYMBOL | ?wxFONTENCODING_MACDINGBATS | ?wxFONTENCODING_MACTURKISH | ?wxFONTENCODING_MACCROATIAN | ?wxFONTENCODING_MACICELANDIC | ?wxFONTENCODING_MACROMANIAN | ?wxFONTENCODING_MACCELTIC | ?wxFONTENCODING_MACGAELIC | ?wxFONTENCODING_MACKEYBOARD | ?wxFONTENCODING_MAX | ?wxFONTENCODING_MACMIN | ?wxFONTENCODING_MACMAX | ?wxFONTENCODING_UTF16 | ?wxFONTENCODING_UTF32 | ?wxFONTENCODING_UNICODE | ?wxFONTENCODING_GB2312 | ?wxFONTENCODING_BIG5 | ?wxFONTENCODING_SHIFT_JIS
+%%<br /> Encoding = ?wxFONTENCODING_SYSTEM | ?wxFONTENCODING_DEFAULT | ?wxFONTENCODING_ISO8859_1 | ?wxFONTENCODING_ISO8859_2 | ?wxFONTENCODING_ISO8859_3 | ?wxFONTENCODING_ISO8859_4 | ?wxFONTENCODING_ISO8859_5 | ?wxFONTENCODING_ISO8859_6 | ?wxFONTENCODING_ISO8859_7 | ?wxFONTENCODING_ISO8859_8 | ?wxFONTENCODING_ISO8859_9 | ?wxFONTENCODING_ISO8859_10 | ?wxFONTENCODING_ISO8859_11 | ?wxFONTENCODING_ISO8859_12 | ?wxFONTENCODING_ISO8859_13 | ?wxFONTENCODING_ISO8859_14 | ?wxFONTENCODING_ISO8859_15 | ?wxFONTENCODING_ISO8859_MAX | ?wxFONTENCODING_KOI8 | ?wxFONTENCODING_KOI8_U | ?wxFONTENCODING_ALTERNATIVE | ?wxFONTENCODING_BULGARIAN | ?wxFONTENCODING_CP437 | ?wxFONTENCODING_CP850 | ?wxFONTENCODING_CP852 | ?wxFONTENCODING_CP855 | ?wxFONTENCODING_CP866 | ?wxFONTENCODING_CP874 | ?wxFONTENCODING_CP932 | ?wxFONTENCODING_CP936 | ?wxFONTENCODING_CP949 | ?wxFONTENCODING_CP950 | ?wxFONTENCODING_CP1250 | ?wxFONTENCODING_CP1251 | ?wxFONTENCODING_CP1252 | ?wxFONTENCODING_CP1253 | ?wxFONTENCODING_CP1254 | ?wxFONTENCODING_CP1255 | ?wxFONTENCODING_CP1256 | ?wxFONTENCODING_CP1257 | ?wxFONTENCODING_CP12_MAX | ?wxFONTENCODING_UTF7 | ?wxFONTENCODING_UTF8 | ?wxFONTENCODING_EUC_JP | ?wxFONTENCODING_UTF16BE | ?wxFONTENCODING_UTF16LE | ?wxFONTENCODING_UTF32BE | ?wxFONTENCODING_UTF32LE | ?wxFONTENCODING_MACROMAN | ?wxFONTENCODING_MACJAPANESE | ?wxFONTENCODING_MACCHINESETRAD | ?wxFONTENCODING_MACKOREAN | ?wxFONTENCODING_MACARABIC | ?wxFONTENCODING_MACHEBREW | ?wxFONTENCODING_MACGREEK | ?wxFONTENCODING_MACCYRILLIC | ?wxFONTENCODING_MACDEVANAGARI | ?wxFONTENCODING_MACGURMUKHI | ?wxFONTENCODING_MACGUJARATI | ?wxFONTENCODING_MACORIYA | ?wxFONTENCODING_MACBENGALI | ?wxFONTENCODING_MACTAMIL | ?wxFONTENCODING_MACTELUGU | ?wxFONTENCODING_MACKANNADA | ?wxFONTENCODING_MACMALAJALAM | ?wxFONTENCODING_MACSINHALESE | ?wxFONTENCODING_MACBURMESE | ?wxFONTENCODING_MACKHMER | ?wxFONTENCODING_MACTHAI | ?wxFONTENCODING_MACLAOTIAN | ?wxFONTENCODING_MACGEORGIAN | ?wxFONTENCODING_MACARMENIAN | ?wxFONTENCODING_MACCHINESESIMP | ?wxFONTENCODING_MACTIBETAN | ?wxFONTENCODING_MACMONGOLIAN | ?wxFONTENCODING_MACETHIOPIC | ?wxFONTENCODING_MACCENTRALEUR | ?wxFONTENCODING_MACVIATNAMESE | ?wxFONTENCODING_MACARABICEXT | ?wxFONTENCODING_MACSYMBOL | ?wxFONTENCODING_MACDINGBATS | ?wxFONTENCODING_MACTURKISH | ?wxFONTENCODING_MACCROATIAN | ?wxFONTENCODING_MACICELANDIC | ?wxFONTENCODING_MACROMANIAN | ?wxFONTENCODING_MACCELTIC | ?wxFONTENCODING_MACGAELIC | ?wxFONTENCODING_MACKEYBOARD | ?wxFONTENCODING_MAX | ?wxFONTENCODING_MACMIN | ?wxFONTENCODING_MACMAX | ?wxFONTENCODING_UTF16 | ?wxFONTENCODING_UTF32 | ?wxFONTENCODING_UNICODE | ?wxFONTENCODING_GB2312 | ?wxFONTENCODING_BIG5 | ?wxFONTENCODING_SHIFT_JIS
+-spec styleSetFontAttr(This, StyleNum, Size, FaceName, Bold, Italic, Underline, [Option]) -> ok when
+ This::wxStyledTextCtrl(), StyleNum::integer(), Size::integer(), FaceName::unicode:chardata(), Bold::boolean(), Italic::boolean(), Underline::boolean(),
+ Option :: {encoding, wx:wx_enum()}.
styleSetFontAttr(#wx_ref{type=ThisT,ref=ThisRef},StyleNum,Size,FaceName,Bold,Italic,Underline, Options)
when is_integer(StyleNum),is_integer(Size),is_list(FaceName),is_boolean(Bold),is_boolean(Italic),is_boolean(Underline),is_list(Options) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3383,80 +3825,91 @@ styleSetFontAttr(#wx_ref{type=ThisT,ref=ThisRef},StyleNum,Size,FaceName,Bold,Ita
wxe_util:cast(?wxStyledTextCtrl_StyleSetFontAttr,
<<ThisRef:32/?UI,StyleNum:32/?UI,Size:32/?UI,(byte_size(FaceName_UC)):32/?UI,(FaceName_UC)/binary, 0:(((8- ((0+byte_size(FaceName_UC)) band 16#7)) band 16#7))/unit:8,(wxe_util:from_bool(Bold)):32/?UI,(wxe_util:from_bool(Italic)):32/?UI,(wxe_util:from_bool(Underline)):32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxStyledTextCtrl(), Style::integer(), CharacterSet::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesetcharacterset">external documentation</a>.
+-spec styleSetCharacterSet(This, Style, CharacterSet) -> ok when
+ This::wxStyledTextCtrl(), Style::integer(), CharacterSet::integer().
styleSetCharacterSet(#wx_ref{type=ThisT,ref=ThisRef},Style,CharacterSet)
when is_integer(Style),is_integer(CharacterSet) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StyleSetCharacterSet,
<<ThisRef:32/?UI,Style:32/?UI,CharacterSet:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Style::integer(), Encoding::WxFontEncoding) -> ok
-%% WxFontEncoding = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesetfontencoding">external documentation</a>.
-%%<br /> WxFontEncoding is one of ?wxFONTENCODING_SYSTEM | ?wxFONTENCODING_DEFAULT | ?wxFONTENCODING_ISO8859_1 | ?wxFONTENCODING_ISO8859_2 | ?wxFONTENCODING_ISO8859_3 | ?wxFONTENCODING_ISO8859_4 | ?wxFONTENCODING_ISO8859_5 | ?wxFONTENCODING_ISO8859_6 | ?wxFONTENCODING_ISO8859_7 | ?wxFONTENCODING_ISO8859_8 | ?wxFONTENCODING_ISO8859_9 | ?wxFONTENCODING_ISO8859_10 | ?wxFONTENCODING_ISO8859_11 | ?wxFONTENCODING_ISO8859_12 | ?wxFONTENCODING_ISO8859_13 | ?wxFONTENCODING_ISO8859_14 | ?wxFONTENCODING_ISO8859_15 | ?wxFONTENCODING_ISO8859_MAX | ?wxFONTENCODING_KOI8 | ?wxFONTENCODING_KOI8_U | ?wxFONTENCODING_ALTERNATIVE | ?wxFONTENCODING_BULGARIAN | ?wxFONTENCODING_CP437 | ?wxFONTENCODING_CP850 | ?wxFONTENCODING_CP852 | ?wxFONTENCODING_CP855 | ?wxFONTENCODING_CP866 | ?wxFONTENCODING_CP874 | ?wxFONTENCODING_CP932 | ?wxFONTENCODING_CP936 | ?wxFONTENCODING_CP949 | ?wxFONTENCODING_CP950 | ?wxFONTENCODING_CP1250 | ?wxFONTENCODING_CP1251 | ?wxFONTENCODING_CP1252 | ?wxFONTENCODING_CP1253 | ?wxFONTENCODING_CP1254 | ?wxFONTENCODING_CP1255 | ?wxFONTENCODING_CP1256 | ?wxFONTENCODING_CP1257 | ?wxFONTENCODING_CP12_MAX | ?wxFONTENCODING_UTF7 | ?wxFONTENCODING_UTF8 | ?wxFONTENCODING_EUC_JP | ?wxFONTENCODING_UTF16BE | ?wxFONTENCODING_UTF16LE | ?wxFONTENCODING_UTF32BE | ?wxFONTENCODING_UTF32LE | ?wxFONTENCODING_MACROMAN | ?wxFONTENCODING_MACJAPANESE | ?wxFONTENCODING_MACCHINESETRAD | ?wxFONTENCODING_MACKOREAN | ?wxFONTENCODING_MACARABIC | ?wxFONTENCODING_MACHEBREW | ?wxFONTENCODING_MACGREEK | ?wxFONTENCODING_MACCYRILLIC | ?wxFONTENCODING_MACDEVANAGARI | ?wxFONTENCODING_MACGURMUKHI | ?wxFONTENCODING_MACGUJARATI | ?wxFONTENCODING_MACORIYA | ?wxFONTENCODING_MACBENGALI | ?wxFONTENCODING_MACTAMIL | ?wxFONTENCODING_MACTELUGU | ?wxFONTENCODING_MACKANNADA | ?wxFONTENCODING_MACMALAJALAM | ?wxFONTENCODING_MACSINHALESE | ?wxFONTENCODING_MACBURMESE | ?wxFONTENCODING_MACKHMER | ?wxFONTENCODING_MACTHAI | ?wxFONTENCODING_MACLAOTIAN | ?wxFONTENCODING_MACGEORGIAN | ?wxFONTENCODING_MACARMENIAN | ?wxFONTENCODING_MACCHINESESIMP | ?wxFONTENCODING_MACTIBETAN | ?wxFONTENCODING_MACMONGOLIAN | ?wxFONTENCODING_MACETHIOPIC | ?wxFONTENCODING_MACCENTRALEUR | ?wxFONTENCODING_MACVIATNAMESE | ?wxFONTENCODING_MACARABICEXT | ?wxFONTENCODING_MACSYMBOL | ?wxFONTENCODING_MACDINGBATS | ?wxFONTENCODING_MACTURKISH | ?wxFONTENCODING_MACCROATIAN | ?wxFONTENCODING_MACICELANDIC | ?wxFONTENCODING_MACROMANIAN | ?wxFONTENCODING_MACCELTIC | ?wxFONTENCODING_MACGAELIC | ?wxFONTENCODING_MACKEYBOARD | ?wxFONTENCODING_MAX | ?wxFONTENCODING_MACMIN | ?wxFONTENCODING_MACMAX | ?wxFONTENCODING_UTF16 | ?wxFONTENCODING_UTF32 | ?wxFONTENCODING_UNICODE | ?wxFONTENCODING_GB2312 | ?wxFONTENCODING_BIG5 | ?wxFONTENCODING_SHIFT_JIS
+%%<br /> Encoding = ?wxFONTENCODING_SYSTEM | ?wxFONTENCODING_DEFAULT | ?wxFONTENCODING_ISO8859_1 | ?wxFONTENCODING_ISO8859_2 | ?wxFONTENCODING_ISO8859_3 | ?wxFONTENCODING_ISO8859_4 | ?wxFONTENCODING_ISO8859_5 | ?wxFONTENCODING_ISO8859_6 | ?wxFONTENCODING_ISO8859_7 | ?wxFONTENCODING_ISO8859_8 | ?wxFONTENCODING_ISO8859_9 | ?wxFONTENCODING_ISO8859_10 | ?wxFONTENCODING_ISO8859_11 | ?wxFONTENCODING_ISO8859_12 | ?wxFONTENCODING_ISO8859_13 | ?wxFONTENCODING_ISO8859_14 | ?wxFONTENCODING_ISO8859_15 | ?wxFONTENCODING_ISO8859_MAX | ?wxFONTENCODING_KOI8 | ?wxFONTENCODING_KOI8_U | ?wxFONTENCODING_ALTERNATIVE | ?wxFONTENCODING_BULGARIAN | ?wxFONTENCODING_CP437 | ?wxFONTENCODING_CP850 | ?wxFONTENCODING_CP852 | ?wxFONTENCODING_CP855 | ?wxFONTENCODING_CP866 | ?wxFONTENCODING_CP874 | ?wxFONTENCODING_CP932 | ?wxFONTENCODING_CP936 | ?wxFONTENCODING_CP949 | ?wxFONTENCODING_CP950 | ?wxFONTENCODING_CP1250 | ?wxFONTENCODING_CP1251 | ?wxFONTENCODING_CP1252 | ?wxFONTENCODING_CP1253 | ?wxFONTENCODING_CP1254 | ?wxFONTENCODING_CP1255 | ?wxFONTENCODING_CP1256 | ?wxFONTENCODING_CP1257 | ?wxFONTENCODING_CP12_MAX | ?wxFONTENCODING_UTF7 | ?wxFONTENCODING_UTF8 | ?wxFONTENCODING_EUC_JP | ?wxFONTENCODING_UTF16BE | ?wxFONTENCODING_UTF16LE | ?wxFONTENCODING_UTF32BE | ?wxFONTENCODING_UTF32LE | ?wxFONTENCODING_MACROMAN | ?wxFONTENCODING_MACJAPANESE | ?wxFONTENCODING_MACCHINESETRAD | ?wxFONTENCODING_MACKOREAN | ?wxFONTENCODING_MACARABIC | ?wxFONTENCODING_MACHEBREW | ?wxFONTENCODING_MACGREEK | ?wxFONTENCODING_MACCYRILLIC | ?wxFONTENCODING_MACDEVANAGARI | ?wxFONTENCODING_MACGURMUKHI | ?wxFONTENCODING_MACGUJARATI | ?wxFONTENCODING_MACORIYA | ?wxFONTENCODING_MACBENGALI | ?wxFONTENCODING_MACTAMIL | ?wxFONTENCODING_MACTELUGU | ?wxFONTENCODING_MACKANNADA | ?wxFONTENCODING_MACMALAJALAM | ?wxFONTENCODING_MACSINHALESE | ?wxFONTENCODING_MACBURMESE | ?wxFONTENCODING_MACKHMER | ?wxFONTENCODING_MACTHAI | ?wxFONTENCODING_MACLAOTIAN | ?wxFONTENCODING_MACGEORGIAN | ?wxFONTENCODING_MACARMENIAN | ?wxFONTENCODING_MACCHINESESIMP | ?wxFONTENCODING_MACTIBETAN | ?wxFONTENCODING_MACMONGOLIAN | ?wxFONTENCODING_MACETHIOPIC | ?wxFONTENCODING_MACCENTRALEUR | ?wxFONTENCODING_MACVIATNAMESE | ?wxFONTENCODING_MACARABICEXT | ?wxFONTENCODING_MACSYMBOL | ?wxFONTENCODING_MACDINGBATS | ?wxFONTENCODING_MACTURKISH | ?wxFONTENCODING_MACCROATIAN | ?wxFONTENCODING_MACICELANDIC | ?wxFONTENCODING_MACROMANIAN | ?wxFONTENCODING_MACCELTIC | ?wxFONTENCODING_MACGAELIC | ?wxFONTENCODING_MACKEYBOARD | ?wxFONTENCODING_MAX | ?wxFONTENCODING_MACMIN | ?wxFONTENCODING_MACMAX | ?wxFONTENCODING_UTF16 | ?wxFONTENCODING_UTF32 | ?wxFONTENCODING_UNICODE | ?wxFONTENCODING_GB2312 | ?wxFONTENCODING_BIG5 | ?wxFONTENCODING_SHIFT_JIS
+-spec styleSetFontEncoding(This, Style, Encoding) -> ok when
+ This::wxStyledTextCtrl(), Style::integer(), Encoding::wx:wx_enum().
styleSetFontEncoding(#wx_ref{type=ThisT,ref=ThisRef},Style,Encoding)
when is_integer(Style),is_integer(Encoding) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_StyleSetFontEncoding,
<<ThisRef:32/?UI,Style:32/?UI,Encoding:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Cmd::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlcmdkeyexecute">external documentation</a>.
+-spec cmdKeyExecute(This, Cmd) -> ok when
+ This::wxStyledTextCtrl(), Cmd::integer().
cmdKeyExecute(#wx_ref{type=ThisT,ref=ThisRef},Cmd)
when is_integer(Cmd) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_CmdKeyExecute,
<<ThisRef:32/?UI,Cmd:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Left::integer(), Right::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetmargins">external documentation</a>.
+-spec setMargins(This, Left, Right) -> ok when
+ This::wxStyledTextCtrl(), Left::integer(), Right::integer().
setMargins(#wx_ref{type=ThisT,ref=ThisRef},Left,Right)
when is_integer(Left),is_integer(Right) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetMargins,
<<ThisRef:32/?UI,Left:32/?UI,Right:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> {StartPos::integer(), EndPos::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetselection">external documentation</a>.
+-spec getSelection(This) -> {StartPos::integer(), EndPos::integer()} when
+ This::wxStyledTextCtrl().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlpointfromposition">external documentation</a>.
+-spec pointFromPosition(This, Pos) -> {X::integer(), Y::integer()} when
+ This::wxStyledTextCtrl(), Pos::integer().
pointFromPosition(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_PointFromPosition,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlscrolltoline">external documentation</a>.
+-spec scrollToLine(This, Line) -> ok when
+ This::wxStyledTextCtrl(), Line::integer().
scrollToLine(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_ScrollToLine,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Column::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlscrolltocolumn">external documentation</a>.
+-spec scrollToColumn(This, Column) -> ok when
+ This::wxStyledTextCtrl(), Column::integer().
scrollToColumn(#wx_ref{type=ThisT,ref=ThisRef},Column)
when is_integer(Column) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_ScrollToColumn,
<<ThisRef:32/?UI,Column:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Msg::integer()) -> integer()
%% @equiv sendMsg(This,Msg, [])
+-spec sendMsg(This, Msg) -> integer() when
+ This::wxStyledTextCtrl(), Msg::integer().
+
sendMsg(This,Msg)
when is_record(This, wx_ref),is_integer(Msg) ->
sendMsg(This,Msg, []).
-%% @spec (This::wxStyledTextCtrl(), Msg::integer(), [Option]) -> integer()
-%% Option = {wp, integer()} | {lp, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsendmsg">external documentation</a>.
+-spec sendMsg(This, Msg, [Option]) -> integer() when
+ This::wxStyledTextCtrl(), Msg::integer(),
+ Option :: {wp, integer()}
+ | {lp, integer()}.
sendMsg(#wx_ref{type=ThisT,ref=ThisRef},Msg, Options)
when is_integer(Msg),is_list(Options) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3467,39 +3920,44 @@ sendMsg(#wx_ref{type=ThisT,ref=ThisRef},Msg, Options)
wxe_util:call(?wxStyledTextCtrl_SendMsg,
<<ThisRef:32/?UI,Msg:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxStyledTextCtrl(), Bar::wxScrollBar:wxScrollBar()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetvscrollbar">external documentation</a>.
+-spec setVScrollBar(This, Bar) -> ok when
+ This::wxStyledTextCtrl(), Bar::wxScrollBar:wxScrollBar().
setVScrollBar(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BarT,ref=BarRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
?CLASS(BarT,wxScrollBar),
wxe_util:cast(?wxStyledTextCtrl_SetVScrollBar,
<<ThisRef:32/?UI,BarRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Bar::wxScrollBar:wxScrollBar()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsethscrollbar">external documentation</a>.
+-spec setHScrollBar(This, Bar) -> ok when
+ This::wxStyledTextCtrl(), Bar::wxScrollBar:wxScrollBar().
setHScrollBar(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BarT,ref=BarRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
?CLASS(BarT,wxScrollBar),
wxe_util:cast(?wxStyledTextCtrl_SetHScrollBar,
<<ThisRef:32/?UI,BarRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetlastkeydownprocessed">external documentation</a>.
+-spec getLastKeydownProcessed(This) -> boolean() when
+ This::wxStyledTextCtrl().
getLastKeydownProcessed(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetLastKeydownProcessed,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Val::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsetlastkeydownprocessed">external documentation</a>.
+-spec setLastKeydownProcessed(This, Val) -> ok when
+ This::wxStyledTextCtrl(), Val::boolean().
setLastKeydownProcessed(#wx_ref{type=ThisT,ref=ThisRef},Val)
when is_boolean(Val) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:cast(?wxStyledTextCtrl_SetLastKeydownProcessed,
<<ThisRef:32/?UI,(wxe_util:from_bool(Val)):32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Filename::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsavefile">external documentation</a>.
+-spec saveFile(This, Filename) -> boolean() when
+ This::wxStyledTextCtrl(), Filename::unicode:chardata().
saveFile(#wx_ref{type=ThisT,ref=ThisRef},Filename)
when is_list(Filename) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3507,8 +3965,9 @@ saveFile(#wx_ref{type=ThisT,ref=ThisRef},Filename)
wxe_util:call(?wxStyledTextCtrl_SaveFile,
<<ThisRef:32/?UI,(byte_size(Filename_UC)):32/?UI,(Filename_UC)/binary, 0:(((8- ((0+byte_size(Filename_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), Filename::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlloadfile">external documentation</a>.
+-spec loadFile(This, Filename) -> boolean() when
+ This::wxStyledTextCtrl(), Filename::unicode:chardata().
loadFile(#wx_ref{type=ThisT,ref=ThisRef},Filename)
when is_list(Filename) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3516,20 +3975,20 @@ loadFile(#wx_ref{type=ThisT,ref=ThisRef},Filename)
wxe_util:call(?wxStyledTextCtrl_LoadFile,
<<ThisRef:32/?UI,(byte_size(Filename_UC)):32/?UI,(Filename_UC)/binary, 0:(((8- ((0+byte_size(Filename_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl(), X::integer(), Y::integer(), Def::WxDragResult) -> WxDragResult
-%% WxDragResult = integer()
-%% WxDragResult = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrldodragover">external documentation</a>.
-%%<br /> WxDragResult is one of ?wxDragError | ?wxDragNone | ?wxDragCopy | ?wxDragMove | ?wxDragLink | ?wxDragCancel
-%%<br /> WxDragResult is one of ?wxDragError | ?wxDragNone | ?wxDragCopy | ?wxDragMove | ?wxDragLink | ?wxDragCancel
+%%<br /> Def = ?wxDragError | ?wxDragNone | ?wxDragCopy | ?wxDragMove | ?wxDragLink | ?wxDragCancel
+%%<br /> Res = ?wxDragError | ?wxDragNone | ?wxDragCopy | ?wxDragMove | ?wxDragLink | ?wxDragCancel
+-spec doDragOver(This, X, Y, Def) -> wx:wx_enum() when
+ This::wxStyledTextCtrl(), X::integer(), Y::integer(), Def::wx:wx_enum().
doDragOver(#wx_ref{type=ThisT,ref=ThisRef},X,Y,Def)
when is_integer(X),is_integer(Y),is_integer(Def) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_DoDragOver,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,Def:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), X::integer(), Y::integer(), Data::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrldodroptext">external documentation</a>.
+-spec doDropText(This, X, Y, Data) -> boolean() when
+ This::wxStyledTextCtrl(), X::integer(), Y::integer(), Data::unicode:chardata().
doDropText(#wx_ref{type=ThisT,ref=ThisRef},X,Y,Data)
when is_integer(X),is_integer(Y),is_list(Data) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3537,15 +3996,17 @@ doDropText(#wx_ref{type=ThisT,ref=ThisRef},X,Y,Data)
wxe_util:call(?wxStyledTextCtrl_DoDropText,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,(byte_size(Data_UC)):32/?UI,(Data_UC)/binary, 0:(((8- ((0+byte_size(Data_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxStyledTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetuseantialiasing">external documentation</a>.
+-spec getUseAntiAliasing(This) -> boolean() when
+ This::wxStyledTextCtrl().
getUseAntiAliasing(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetUseAntiAliasing,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Text::binary()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrladdtextraw">external documentation</a>.
+-spec addTextRaw(This, Text) -> ok when
+ This::wxStyledTextCtrl(), Text::binary().
addTextRaw(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_binary(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3553,8 +4014,9 @@ addTextRaw(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:cast(?wxStyledTextCtrl_AddTextRaw,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Pos::integer(), Text::binary()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlinserttextraw">external documentation</a>.
+-spec insertTextRaw(This, Pos, Text) -> ok when
+ This::wxStyledTextCtrl(), Pos::integer(), Text::binary().
insertTextRaw(#wx_ref{type=ThisT,ref=ThisRef},Pos,Text)
when is_integer(Pos),is_binary(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3562,38 +4024,44 @@ insertTextRaw(#wx_ref{type=ThisT,ref=ThisRef},Pos,Text)
wxe_util:cast(?wxStyledTextCtrl_InsertTextRaw,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> {binary(), LinePos::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetcurlineraw">external documentation</a>.
+-spec getCurLineRaw(This) -> Result when
+ Result ::{Res ::binary(), LinePos::integer()},
+ This::wxStyledTextCtrl().
getCurLineRaw(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetCurLineRaw,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Line::integer()) -> binary()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetlineraw">external documentation</a>.
+-spec getLineRaw(This, Line) -> binary() when
+ This::wxStyledTextCtrl(), Line::integer().
getLineRaw(#wx_ref{type=ThisT,ref=ThisRef},Line)
when is_integer(Line) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetLineRaw,
<<ThisRef:32/?UI,Line:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> binary()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgetselectedtextraw">external documentation</a>.
+-spec getSelectedTextRaw(This) -> binary() when
+ This::wxStyledTextCtrl().
getSelectedTextRaw(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetSelectedTextRaw,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), StartPos::integer(), EndPos::integer()) -> binary()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgettextrangeraw">external documentation</a>.
+-spec getTextRangeRaw(This, StartPos, EndPos) -> binary() when
+ This::wxStyledTextCtrl(), StartPos::integer(), EndPos::integer().
getTextRangeRaw(#wx_ref{type=ThisT,ref=ThisRef},StartPos,EndPos)
when is_integer(StartPos),is_integer(EndPos) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetTextRangeRaw,
<<ThisRef:32/?UI,StartPos:32/?UI,EndPos:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Text::binary()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlsettextraw">external documentation</a>.
+-spec setTextRaw(This, Text) -> ok when
+ This::wxStyledTextCtrl(), Text::binary().
setTextRaw(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_binary(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3601,15 +4069,17 @@ setTextRaw(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:cast(?wxStyledTextCtrl_SetTextRaw,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> binary()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlgettextraw">external documentation</a>.
+-spec getTextRaw(This) -> binary() when
+ This::wxStyledTextCtrl().
getTextRaw(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextCtrl),
wxe_util:call(?wxStyledTextCtrl_GetTextRaw,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl(), Text::binary()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextctrl.html#wxstyledtextctrlappendtextraw">external documentation</a>.
+-spec appendTextRaw(This, Text) -> ok when
+ This::wxStyledTextCtrl(), Text::binary().
appendTextRaw(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_binary(Text) ->
?CLASS(ThisT,wxStyledTextCtrl),
@@ -3617,8 +4087,8 @@ appendTextRaw(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:cast(?wxStyledTextCtrl_AppendTextRaw,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextCtrl()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxStyledTextCtrl()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxStyledTextCtrl),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxStyledTextEvent.erl b/lib/wx/src/gen/wxStyledTextEvent.erl
index 5d98ae585d..1c2c79fe5d 100644
--- a/lib/wx/src/gen/wxStyledTextEvent.erl
+++ b/lib/wx/src/gen/wxStyledTextEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -44,169 +44,193 @@
parent_class/1,resumePropagation/2,setInt/2,setString/2,shouldPropagate/1,
skip/1,skip/2,stopPropagation/1]).
+-export_type([wxStyledTextEvent/0]).
%% @hidden
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxStyledTextEvent()) -> integer()
+-type wxStyledTextEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetposition">external documentation</a>.
+-spec getPosition(This) -> integer() when
+ This::wxStyledTextEvent().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetkey">external documentation</a>.
+-spec getKey(This) -> integer() when
+ This::wxStyledTextEvent().
getKey(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetKey,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetmodifiers">external documentation</a>.
+-spec getModifiers(This) -> integer() when
+ This::wxStyledTextEvent().
getModifiers(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetModifiers,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetmodificationtype">external documentation</a>.
+-spec getModificationType(This) -> integer() when
+ This::wxStyledTextEvent().
getModificationType(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetModificationType,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgettext">external documentation</a>.
+-spec getText(This) -> unicode:charlist() when
+ This::wxStyledTextEvent().
getText(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetText,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetlength">external documentation</a>.
+-spec getLength(This) -> integer() when
+ This::wxStyledTextEvent().
getLength(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetLength,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetlinesadded">external documentation</a>.
+-spec getLinesAdded(This) -> integer() when
+ This::wxStyledTextEvent().
getLinesAdded(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetLinesAdded,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetline">external documentation</a>.
+-spec getLine(This) -> integer() when
+ This::wxStyledTextEvent().
getLine(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetLine,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetfoldlevelnow">external documentation</a>.
+-spec getFoldLevelNow(This) -> integer() when
+ This::wxStyledTextEvent().
getFoldLevelNow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetFoldLevelNow,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetfoldlevelprev">external documentation</a>.
+-spec getFoldLevelPrev(This) -> integer() when
+ This::wxStyledTextEvent().
getFoldLevelPrev(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetFoldLevelPrev,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetmargin">external documentation</a>.
+-spec getMargin(This) -> integer() when
+ This::wxStyledTextEvent().
getMargin(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetMargin,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetmessage">external documentation</a>.
+-spec getMessage(This) -> integer() when
+ This::wxStyledTextEvent().
getMessage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetMessage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetwparam">external documentation</a>.
+-spec getWParam(This) -> integer() when
+ This::wxStyledTextEvent().
getWParam(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetWParam,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetlparam">external documentation</a>.
+-spec getLParam(This) -> integer() when
+ This::wxStyledTextEvent().
getLParam(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetLParam,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetlisttype">external documentation</a>.
+-spec getListType(This) -> integer() when
+ This::wxStyledTextEvent().
getListType(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetListType,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetx">external documentation</a>.
+-spec getX(This) -> integer() when
+ This::wxStyledTextEvent().
getX(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetX,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgety">external documentation</a>.
+-spec getY(This) -> integer() when
+ This::wxStyledTextEvent().
getY(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetY,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetdragtext">external documentation</a>.
+-spec getDragText(This) -> unicode:charlist() when
+ This::wxStyledTextEvent().
getDragText(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetDragText,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetdragallowmove">external documentation</a>.
+-spec getDragAllowMove(This) -> boolean() when
+ This::wxStyledTextEvent().
getDragAllowMove(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetDragAllowMove,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> WxDragResult
-%% WxDragResult = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetdragresult">external documentation</a>.
-%%<br /> WxDragResult is one of ?wxDragError | ?wxDragNone | ?wxDragCopy | ?wxDragMove | ?wxDragLink | ?wxDragCancel
+%%<br /> Res = ?wxDragError | ?wxDragNone | ?wxDragCopy | ?wxDragMove | ?wxDragLink | ?wxDragCancel
+-spec getDragResult(This) -> wx:wx_enum() when
+ This::wxStyledTextEvent().
getDragResult(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetDragResult,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetshift">external documentation</a>.
+-spec getShift(This) -> boolean() when
+ This::wxStyledTextEvent().
getShift(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetShift,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetcontrol">external documentation</a>.
+-spec getControl(This) -> boolean() when
+ This::wxStyledTextEvent().
getControl(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetControl,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxStyledTextEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxstyledtextevent.html#wxstyledtexteventgetalt">external documentation</a>.
+-spec getAlt(This) -> boolean() when
+ This::wxStyledTextEvent().
getAlt(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxStyledTextEvent),
wxe_util:call(?wxStyledTextEvent_GetAlt,
diff --git a/lib/wx/src/gen/wxSysColourChangedEvent.erl b/lib/wx/src/gen/wxSysColourChangedEvent.erl
index 0d86edcf5b..94777748d2 100644
--- a/lib/wx/src/gen/wxSysColourChangedEvent.erl
+++ b/lib/wx/src/gen/wxSysColourChangedEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -37,10 +37,12 @@
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+-export_type([wxSysColourChangedEvent/0]).
%% @hidden
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxSysColourChangedEvent() :: wx:wx_object().
%% From wxEvent
%% @hidden
stopPropagation(This) -> wxEvent:stopPropagation(This).
diff --git a/lib/wx/src/gen/wxSystemOptions.erl b/lib/wx/src/gen/wxSystemOptions.erl
index d5e504632b..757eb698a2 100644
--- a/lib/wx/src/gen/wxSystemOptions.erl
+++ b/lib/wx/src/gen/wxSystemOptions.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,50 +29,56 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxSystemOptions/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Name::string()) -> string()
+-type wxSystemOptions() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsystemoptions.html#wxsystemoptionsgetoption">external documentation</a>.
+-spec getOption(Name) -> unicode:charlist() when
+ Name::unicode:chardata().
getOption(Name)
when is_list(Name) ->
Name_UC = unicode:characters_to_binary([Name,0]),
wxe_util:call(?wxSystemOptions_GetOption,
<<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (Name::string()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsystemoptions.html#wxsystemoptionsgetoptionint">external documentation</a>.
+-spec getOptionInt(Name) -> integer() when
+ Name::unicode:chardata().
getOptionInt(Name)
when is_list(Name) ->
Name_UC = unicode:characters_to_binary([Name,0]),
wxe_util:call(?wxSystemOptions_GetOptionInt,
<<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (Name::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsystemoptions.html#wxsystemoptionshasoption">external documentation</a>.
+-spec hasOption(Name) -> boolean() when
+ Name::unicode:chardata().
hasOption(Name)
when is_list(Name) ->
Name_UC = unicode:characters_to_binary([Name,0]),
wxe_util:call(?wxSystemOptions_HasOption,
<<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (Name::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsystemoptions.html#wxsystemoptionsisfalse">external documentation</a>.
+-spec isFalse(Name) -> boolean() when
+ Name::unicode:chardata().
isFalse(Name)
when is_list(Name) ->
Name_UC = unicode:characters_to_binary([Name,0]),
wxe_util:call(?wxSystemOptions_IsFalse,
<<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (Name::string(),X::integer()|string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsystemoptions.html#wxsystemoptionssetoption">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setOption(Name::string(), Value::integer()) -> ok </c>
-%% </p>
-%% <p><c>
-%% setOption(Name::string(), Value::string()) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% setOption(Name, Value) -> ok when<br />
+%% Name::unicode:chardata(), Value::unicode:chardata().<br />
+%%
+-spec setOption(Name, Value) -> ok when
+ Name::unicode:chardata(), Value::integer();
+ (Name, Value) -> ok when
+ Name::unicode:chardata(), Value::unicode:chardata().
setOption(Name,Value)
when is_list(Name),is_integer(Value) ->
Name_UC = unicode:characters_to_binary([Name,0]),
diff --git a/lib/wx/src/gen/wxSystemSettings.erl b/lib/wx/src/gen/wxSystemSettings.erl
index 3f7e0a1ad6..a3bae5c85f 100644
--- a/lib/wx/src/gen/wxSystemSettings.erl
+++ b/lib/wx/src/gen/wxSystemSettings.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,38 +29,42 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxSystemSettings/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Index::WxSystemColour) -> wx:colour()
-%% WxSystemColour = integer()
+-type wxSystemSettings() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsystemsettings.html#wxsystemsettingsgetcolour">external documentation</a>.
-%%<br /> WxSystemColour is one of ?wxSYS_COLOUR_SCROLLBAR | ?wxSYS_COLOUR_BACKGROUND | ?wxSYS_COLOUR_DESKTOP | ?wxSYS_COLOUR_ACTIVECAPTION | ?wxSYS_COLOUR_INACTIVECAPTION | ?wxSYS_COLOUR_MENU | ?wxSYS_COLOUR_WINDOW | ?wxSYS_COLOUR_WINDOWFRAME | ?wxSYS_COLOUR_MENUTEXT | ?wxSYS_COLOUR_WINDOWTEXT | ?wxSYS_COLOUR_CAPTIONTEXT | ?wxSYS_COLOUR_ACTIVEBORDER | ?wxSYS_COLOUR_INACTIVEBORDER | ?wxSYS_COLOUR_APPWORKSPACE | ?wxSYS_COLOUR_HIGHLIGHT | ?wxSYS_COLOUR_HIGHLIGHTTEXT | ?wxSYS_COLOUR_BTNFACE | ?wxSYS_COLOUR_3DFACE | ?wxSYS_COLOUR_BTNSHADOW | ?wxSYS_COLOUR_3DSHADOW | ?wxSYS_COLOUR_GRAYTEXT | ?wxSYS_COLOUR_BTNTEXT | ?wxSYS_COLOUR_INACTIVECAPTIONTEXT | ?wxSYS_COLOUR_BTNHIGHLIGHT | ?wxSYS_COLOUR_BTNHILIGHT | ?wxSYS_COLOUR_3DHIGHLIGHT | ?wxSYS_COLOUR_3DHILIGHT | ?wxSYS_COLOUR_3DDKSHADOW | ?wxSYS_COLOUR_3DLIGHT | ?wxSYS_COLOUR_INFOTEXT | ?wxSYS_COLOUR_INFOBK | ?wxSYS_COLOUR_LISTBOX | ?wxSYS_COLOUR_HOTLIGHT | ?wxSYS_COLOUR_GRADIENTACTIVECAPTION | ?wxSYS_COLOUR_GRADIENTINACTIVECAPTION | ?wxSYS_COLOUR_MENUHILIGHT | ?wxSYS_COLOUR_MENUBAR | ?wxSYS_COLOUR_LISTBOXTEXT | ?wxSYS_COLOUR_MAX
+%%<br /> Index = ?wxSYS_COLOUR_SCROLLBAR | ?wxSYS_COLOUR_BACKGROUND | ?wxSYS_COLOUR_DESKTOP | ?wxSYS_COLOUR_ACTIVECAPTION | ?wxSYS_COLOUR_INACTIVECAPTION | ?wxSYS_COLOUR_MENU | ?wxSYS_COLOUR_WINDOW | ?wxSYS_COLOUR_WINDOWFRAME | ?wxSYS_COLOUR_MENUTEXT | ?wxSYS_COLOUR_WINDOWTEXT | ?wxSYS_COLOUR_CAPTIONTEXT | ?wxSYS_COLOUR_ACTIVEBORDER | ?wxSYS_COLOUR_INACTIVEBORDER | ?wxSYS_COLOUR_APPWORKSPACE | ?wxSYS_COLOUR_HIGHLIGHT | ?wxSYS_COLOUR_HIGHLIGHTTEXT | ?wxSYS_COLOUR_BTNFACE | ?wxSYS_COLOUR_3DFACE | ?wxSYS_COLOUR_BTNSHADOW | ?wxSYS_COLOUR_3DSHADOW | ?wxSYS_COLOUR_GRAYTEXT | ?wxSYS_COLOUR_BTNTEXT | ?wxSYS_COLOUR_INACTIVECAPTIONTEXT | ?wxSYS_COLOUR_BTNHIGHLIGHT | ?wxSYS_COLOUR_BTNHILIGHT | ?wxSYS_COLOUR_3DHIGHLIGHT | ?wxSYS_COLOUR_3DHILIGHT | ?wxSYS_COLOUR_3DDKSHADOW | ?wxSYS_COLOUR_3DLIGHT | ?wxSYS_COLOUR_INFOTEXT | ?wxSYS_COLOUR_INFOBK | ?wxSYS_COLOUR_LISTBOX | ?wxSYS_COLOUR_HOTLIGHT | ?wxSYS_COLOUR_GRADIENTACTIVECAPTION | ?wxSYS_COLOUR_GRADIENTINACTIVECAPTION | ?wxSYS_COLOUR_MENUHILIGHT | ?wxSYS_COLOUR_MENUBAR | ?wxSYS_COLOUR_LISTBOXTEXT | ?wxSYS_COLOUR_MAX
+-spec getColour(Index) -> wx:wx_colour4() when
+ Index::wx:wx_enum().
getColour(Index)
when is_integer(Index) ->
wxe_util:call(?wxSystemSettings_GetColour,
<<Index:32/?UI>>).
-%% @spec (Index::WxSystemFont) -> wxFont:wxFont()
-%% WxSystemFont = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsystemsettings.html#wxsystemsettingsgetfont">external documentation</a>.
-%%<br /> WxSystemFont is one of ?wxSYS_OEM_FIXED_FONT | ?wxSYS_ANSI_FIXED_FONT | ?wxSYS_ANSI_VAR_FONT | ?wxSYS_SYSTEM_FONT | ?wxSYS_DEVICE_DEFAULT_FONT | ?wxSYS_DEFAULT_PALETTE | ?wxSYS_SYSTEM_FIXED_FONT | ?wxSYS_DEFAULT_GUI_FONT | ?wxSYS_ICONTITLE_FONT
+%%<br /> Index = ?wxSYS_OEM_FIXED_FONT | ?wxSYS_ANSI_FIXED_FONT | ?wxSYS_ANSI_VAR_FONT | ?wxSYS_SYSTEM_FONT | ?wxSYS_DEVICE_DEFAULT_FONT | ?wxSYS_DEFAULT_PALETTE | ?wxSYS_SYSTEM_FIXED_FONT | ?wxSYS_DEFAULT_GUI_FONT | ?wxSYS_ICONTITLE_FONT
+-spec getFont(Index) -> wxFont:wxFont() when
+ Index::wx:wx_enum().
getFont(Index)
when is_integer(Index) ->
wxe_util:call(?wxSystemSettings_GetFont,
<<Index:32/?UI>>).
-%% @spec (Index::WxSystemMetric) -> integer()
%% @equiv getMetric(Index, [])
+-spec getMetric(Index) -> integer() when
+ Index::wx:wx_enum().
+
getMetric(Index)
when is_integer(Index) ->
getMetric(Index, []).
-%% @spec (Index::WxSystemMetric, [Option]) -> integer()
-%% Option = {win, wxWindow:wxWindow()}
-%% WxSystemMetric = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsystemsettings.html#wxsystemsettingsgetmetric">external documentation</a>.
-%%<br /> WxSystemMetric is one of ?wxSYS_MOUSE_BUTTONS | ?wxSYS_BORDER_X | ?wxSYS_BORDER_Y | ?wxSYS_CURSOR_X | ?wxSYS_CURSOR_Y | ?wxSYS_DCLICK_X | ?wxSYS_DCLICK_Y | ?wxSYS_DRAG_X | ?wxSYS_DRAG_Y | ?wxSYS_EDGE_X | ?wxSYS_EDGE_Y | ?wxSYS_HSCROLL_ARROW_X | ?wxSYS_HSCROLL_ARROW_Y | ?wxSYS_HTHUMB_X | ?wxSYS_ICON_X | ?wxSYS_ICON_Y | ?wxSYS_ICONSPACING_X | ?wxSYS_ICONSPACING_Y | ?wxSYS_WINDOWMIN_X | ?wxSYS_WINDOWMIN_Y | ?wxSYS_SCREEN_X | ?wxSYS_SCREEN_Y | ?wxSYS_FRAMESIZE_X | ?wxSYS_FRAMESIZE_Y | ?wxSYS_SMALLICON_X | ?wxSYS_SMALLICON_Y | ?wxSYS_HSCROLL_Y | ?wxSYS_VSCROLL_X | ?wxSYS_VSCROLL_ARROW_X | ?wxSYS_VSCROLL_ARROW_Y | ?wxSYS_VTHUMB_Y | ?wxSYS_CAPTION_Y | ?wxSYS_MENU_Y | ?wxSYS_NETWORK_PRESENT | ?wxSYS_PENWINDOWS_PRESENT | ?wxSYS_SHOW_SOUNDS | ?wxSYS_SWAP_BUTTONS
+%%<br /> Index = ?wxSYS_MOUSE_BUTTONS | ?wxSYS_BORDER_X | ?wxSYS_BORDER_Y | ?wxSYS_CURSOR_X | ?wxSYS_CURSOR_Y | ?wxSYS_DCLICK_X | ?wxSYS_DCLICK_Y | ?wxSYS_DRAG_X | ?wxSYS_DRAG_Y | ?wxSYS_EDGE_X | ?wxSYS_EDGE_Y | ?wxSYS_HSCROLL_ARROW_X | ?wxSYS_HSCROLL_ARROW_Y | ?wxSYS_HTHUMB_X | ?wxSYS_ICON_X | ?wxSYS_ICON_Y | ?wxSYS_ICONSPACING_X | ?wxSYS_ICONSPACING_Y | ?wxSYS_WINDOWMIN_X | ?wxSYS_WINDOWMIN_Y | ?wxSYS_SCREEN_X | ?wxSYS_SCREEN_Y | ?wxSYS_FRAMESIZE_X | ?wxSYS_FRAMESIZE_Y | ?wxSYS_SMALLICON_X | ?wxSYS_SMALLICON_Y | ?wxSYS_HSCROLL_Y | ?wxSYS_VSCROLL_X | ?wxSYS_VSCROLL_ARROW_X | ?wxSYS_VSCROLL_ARROW_Y | ?wxSYS_VTHUMB_Y | ?wxSYS_CAPTION_Y | ?wxSYS_MENU_Y | ?wxSYS_NETWORK_PRESENT | ?wxSYS_PENWINDOWS_PRESENT | ?wxSYS_SHOW_SOUNDS | ?wxSYS_SWAP_BUTTONS
+-spec getMetric(Index, [Option]) -> integer() when
+ Index::wx:wx_enum(),
+ Option :: {win, wxWindow:wxWindow()}.
getMetric(Index, Options)
when is_integer(Index),is_list(Options) ->
MOpts = fun({win, #wx_ref{type=WinT,ref=WinRef}}, Acc) -> ?CLASS(WinT,wxWindow),[<<1:32/?UI,WinRef:32/?UI>>|Acc];
@@ -69,10 +73,9 @@ getMetric(Index, Options)
wxe_util:call(?wxSystemSettings_GetMetric,
<<Index:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec () -> WxSystemScreenType
-%% WxSystemScreenType = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxsystemsettings.html#wxsystemsettingsgetscreentype">external documentation</a>.
-%%<br /> WxSystemScreenType is one of ?wxSYS_SCREEN_NONE | ?wxSYS_SCREEN_TINY | ?wxSYS_SCREEN_PDA | ?wxSYS_SCREEN_SMALL | ?wxSYS_SCREEN_DESKTOP
+%%<br /> Res = ?wxSYS_SCREEN_NONE | ?wxSYS_SCREEN_TINY | ?wxSYS_SCREEN_PDA | ?wxSYS_SCREEN_SMALL | ?wxSYS_SCREEN_DESKTOP
+-spec getScreenType() -> wx:wx_enum().
getScreenType() ->
wxe_util:call(?wxSystemSettings_GetScreenType,
<<>>).
diff --git a/lib/wx/src/gen/wxTaskBarIcon.erl b/lib/wx/src/gen/wxTaskBarIcon.erl
new file mode 100644
index 0000000000..5ca2c91b16
--- /dev/null
+++ b/lib/wx/src/gen/wxTaskBarIcon.erl
@@ -0,0 +1,102 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%% This file is generated DO NOT EDIT
+
+%% @doc See external documentation: <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtaskbaricon.html">wxTaskBarIcon</a>.
+%% <p>This class is derived (and can use functions) from:
+%% <br />{@link wxEvtHandler}
+%% </p>
+%% @type wxTaskBarIcon(). An object reference, The representation is internal
+%% and can be changed without notice. It can't be used for comparsion
+%% stored on disc or distributed for use on other nodes.
+
+-module(wxTaskBarIcon).
+-include("wxe.hrl").
+-export([destroy/1,new/0,popupMenu/2,removeIcon/1,setIcon/2,setIcon/3]).
+
+%% inherited exports
+-export([connect/2,connect/3,disconnect/1,disconnect/2,disconnect/3,parent_class/1]).
+
+-export_type([wxTaskBarIcon/0]).
+%% @hidden
+parent_class(wxEvtHandler) -> true;
+parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+
+-type wxTaskBarIcon() :: wx:wx_object().
+%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtaskbaricon.html#wxtaskbariconwxtaskbaricon">external documentation</a>.
+-spec new() -> wxTaskBarIcon().
+new() ->
+ wxe_util:construct(?wxTaskBarIcon_new,
+ <<>>).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtaskbaricon.html#wxtaskbariconpopupmenu">external documentation</a>.
+-spec popupMenu(This, Menu) -> boolean() when
+ This::wxTaskBarIcon(), Menu::wxMenu:wxMenu().
+popupMenu(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef}) ->
+ ?CLASS(ThisT,wxTaskBarIcon),
+ ?CLASS(MenuT,wxMenu),
+ wxe_util:call(?wxTaskBarIcon_PopupMenu,
+ <<ThisRef:32/?UI,MenuRef:32/?UI>>).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtaskbaricon.html#wxtaskbariconremoveicon">external documentation</a>.
+-spec removeIcon(This) -> boolean() when
+ This::wxTaskBarIcon().
+removeIcon(#wx_ref{type=ThisT,ref=ThisRef}) ->
+ ?CLASS(ThisT,wxTaskBarIcon),
+ wxe_util:call(?wxTaskBarIcon_RemoveIcon,
+ <<ThisRef:32/?UI>>).
+
+%% @equiv setIcon(This,Icon, [])
+-spec setIcon(This, Icon) -> boolean() when
+ This::wxTaskBarIcon(), Icon::wxIcon:wxIcon().
+
+setIcon(This,Icon)
+ when is_record(This, wx_ref),is_record(Icon, wx_ref) ->
+ setIcon(This,Icon, []).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtaskbaricon.html#wxtaskbariconseticon">external documentation</a>.
+-spec setIcon(This, Icon, [Option]) -> boolean() when
+ This::wxTaskBarIcon(), Icon::wxIcon:wxIcon(),
+ Option :: {tooltip, unicode:chardata()}.
+setIcon(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=IconT,ref=IconRef}, Options)
+ when is_list(Options) ->
+ ?CLASS(ThisT,wxTaskBarIcon),
+ ?CLASS(IconT,wxIcon),
+ MOpts = fun({tooltip, Tooltip}, Acc) -> Tooltip_UC = unicode:characters_to_binary([Tooltip,0]),[<<1:32/?UI,(byte_size(Tooltip_UC)):32/?UI,(Tooltip_UC)/binary, 0:(((8- ((0+byte_size(Tooltip_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
+ (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
+ BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
+ wxe_util:call(?wxTaskBarIcon_SetIcon,
+ <<ThisRef:32/?UI,IconRef:32/?UI, BinOpt/binary>>).
+
+%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxTaskBarIcon()) -> ok.
+destroy(Obj=#wx_ref{type=Type}) ->
+ ?CLASS(Type,wxTaskBarIcon),
+ wxe_util:destroy(?DESTROY_OBJECT,Obj),
+ ok.
+ %% From wxEvtHandler
+%% @hidden
+disconnect(This,EventType, Options) -> wxEvtHandler:disconnect(This,EventType, Options).
+%% @hidden
+disconnect(This,EventType) -> wxEvtHandler:disconnect(This,EventType).
+%% @hidden
+disconnect(This) -> wxEvtHandler:disconnect(This).
+%% @hidden
+connect(This,EventType, Options) -> wxEvtHandler:connect(This,EventType, Options).
+%% @hidden
+connect(This,EventType) -> wxEvtHandler:connect(This,EventType).
diff --git a/lib/wx/src/gen/wxTaskBarIconEvent.erl b/lib/wx/src/gen/wxTaskBarIconEvent.erl
new file mode 100644
index 0000000000..9f2af608c5
--- /dev/null
+++ b/lib/wx/src/gen/wxTaskBarIconEvent.erl
@@ -0,0 +1,64 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%% This file is generated DO NOT EDIT
+
+%% @doc See external documentation: <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtaskbariconevent.html">wxTaskBarIconEvent</a>.
+%% <dl><dt>Use {@link wxEvtHandler:connect/3.} with EventType:</dt>
+%% <dd><em>taskbar_move</em>, <em>taskbar_left_down</em>, <em>taskbar_left_up</em>, <em>taskbar_right_down</em>, <em>taskbar_right_up</em>, <em>taskbar_left_dclick</em>, <em>taskbar_right_dclick</em></dd></dl>
+%% See also the message variant {@link wxEvtHandler:wxTaskBarIcon(). #wxTaskBarIcon{}} event record type.
+%%
+%% <p>This class is derived (and can use functions) from:
+%% <br />{@link wxEvent}
+%% </p>
+%% @type wxTaskBarIconEvent(). An object reference, The representation is internal
+%% and can be changed without notice. It can't be used for comparsion
+%% stored on disc or distributed for use on other nodes.
+
+-module(wxTaskBarIconEvent).
+-include("wxe.hrl").
+-export([]).
+
+%% inherited exports
+-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEvent/1,parent_class/1,
+ resumePropagation/2,shouldPropagate/1,skip/1,skip/2,stopPropagation/1]).
+
+-export_type([wxTaskBarIconEvent/0]).
+%% @hidden
+parent_class(wxEvent) -> true;
+parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+
+-type wxTaskBarIconEvent() :: wx:wx_object().
+ %% From wxEvent
+%% @hidden
+stopPropagation(This) -> wxEvent:stopPropagation(This).
+%% @hidden
+skip(This, Options) -> wxEvent:skip(This, Options).
+%% @hidden
+skip(This) -> wxEvent:skip(This).
+%% @hidden
+shouldPropagate(This) -> wxEvent:shouldPropagate(This).
+%% @hidden
+resumePropagation(This,PropagationLevel) -> wxEvent:resumePropagation(This,PropagationLevel).
+%% @hidden
+isCommandEvent(This) -> wxEvent:isCommandEvent(This).
+%% @hidden
+getTimestamp(This) -> wxEvent:getTimestamp(This).
+%% @hidden
+getSkipped(This) -> wxEvent:getSkipped(This).
+%% @hidden
+getId(This) -> wxEvent:getId(This).
diff --git a/lib/wx/src/gen/wxTextAttr.erl b/lib/wx/src/gen/wxTextAttr.erl
index 056dc59161..16bb943359 100644
--- a/lib/wx/src/gen/wxTextAttr.erl
+++ b/lib/wx/src/gen/wxTextAttr.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -34,26 +34,32 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxTextAttr/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxTextAttr()
+-type wxTextAttr() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrwxtextattr">external documentation</a>.
+-spec new() -> wxTextAttr().
new() ->
wxe_util:construct(?wxTextAttr_new_0,
<<>>).
-%% @spec (ColText::wx:colour()) -> wxTextAttr()
%% @equiv new(ColText, [])
+-spec new(ColText) -> wxTextAttr() when
+ ColText::wx:wx_colour().
+
new(ColText)
when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4 ->
new(ColText, []).
-%% @spec (ColText::wx:colour(), [Option]) -> wxTextAttr()
-%% Option = {colBack, wx:colour()} | {font, wxFont:wxFont()} | {alignment, WxTextAttrAlignment}
-%% WxTextAttrAlignment = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrwxtextattr">external documentation</a>.
-%%<br /> WxTextAttrAlignment is one of ?wxTEXT_ALIGNMENT_DEFAULT | ?wxTEXT_ALIGNMENT_LEFT | ?wxTEXT_ALIGNMENT_CENTRE | ?wxTEXT_ALIGNMENT_CENTER | ?wxTEXT_ALIGNMENT_RIGHT | ?wxTEXT_ALIGNMENT_JUSTIFIED
+%%<br /> Alignment = ?wxTEXT_ALIGNMENT_DEFAULT | ?wxTEXT_ALIGNMENT_LEFT | ?wxTEXT_ALIGNMENT_CENTRE | ?wxTEXT_ALIGNMENT_CENTER | ?wxTEXT_ALIGNMENT_RIGHT | ?wxTEXT_ALIGNMENT_JUSTIFIED
+-spec new(ColText, [Option]) -> wxTextAttr() when
+ ColText::wx:wx_colour(),
+ Option :: {colBack, wx:wx_colour()}
+ | {font, wxFont:wxFont()}
+ | {alignment, wx:wx_enum()}.
new(ColText, Options)
when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4,is_list(Options) ->
MOpts = fun({colBack, ColBack}, Acc) -> [<<1:32/?UI,(wxe_util:colour_bin(ColBack)):16/binary,0:32>>|Acc];
@@ -64,134 +70,151 @@ new(ColText, Options)
wxe_util:construct(?wxTextAttr_new_2,
<<(wxe_util:colour_bin(ColText)):16/binary, BinOpt/binary>>).
-%% @spec (This::wxTextAttr()) -> WxTextAttrAlignment
-%% WxTextAttrAlignment = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetalignment">external documentation</a>.
-%%<br /> WxTextAttrAlignment is one of ?wxTEXT_ALIGNMENT_DEFAULT | ?wxTEXT_ALIGNMENT_LEFT | ?wxTEXT_ALIGNMENT_CENTRE | ?wxTEXT_ALIGNMENT_CENTER | ?wxTEXT_ALIGNMENT_RIGHT | ?wxTEXT_ALIGNMENT_JUSTIFIED
+%%<br /> Res = ?wxTEXT_ALIGNMENT_DEFAULT | ?wxTEXT_ALIGNMENT_LEFT | ?wxTEXT_ALIGNMENT_CENTRE | ?wxTEXT_ALIGNMENT_CENTER | ?wxTEXT_ALIGNMENT_RIGHT | ?wxTEXT_ALIGNMENT_JUSTIFIED
+-spec getAlignment(This) -> wx:wx_enum() when
+ This::wxTextAttr().
getAlignment(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetAlignment,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextAttr()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetbackgroundcolour">external documentation</a>.
+-spec getBackgroundColour(This) -> wx:wx_colour4() when
+ This::wxTextAttr().
getBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetBackgroundColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextAttr()) -> wxFont:wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetfont">external documentation</a>.
+-spec getFont(This) -> wxFont:wxFont() when
+ This::wxTextAttr().
getFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextAttr()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetleftindent">external documentation</a>.
+-spec getLeftIndent(This) -> integer() when
+ This::wxTextAttr().
getLeftIndent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetLeftIndent,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextAttr()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetleftsubindent">external documentation</a>.
+-spec getLeftSubIndent(This) -> integer() when
+ This::wxTextAttr().
getLeftSubIndent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetLeftSubIndent,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextAttr()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetrightindent">external documentation</a>.
+-spec getRightIndent(This) -> integer() when
+ This::wxTextAttr().
getRightIndent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetRightIndent,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextAttr()) -> [integer()]
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgettabs">external documentation</a>.
+-spec getTabs(This) -> [integer()] when
+ This::wxTextAttr().
getTabs(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetTabs,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextAttr()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgettextcolour">external documentation</a>.
+-spec getTextColour(This) -> wx:wx_colour4() when
+ This::wxTextAttr().
getTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetTextColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrhasbackgroundcolour">external documentation</a>.
+-spec hasBackgroundColour(This) -> boolean() when
+ This::wxTextAttr().
hasBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_HasBackgroundColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrhasfont">external documentation</a>.
+-spec hasFont(This) -> boolean() when
+ This::wxTextAttr().
hasFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_HasFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrhastextcolour">external documentation</a>.
+-spec hasTextColour(This) -> boolean() when
+ This::wxTextAttr().
hasTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_HasTextColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextAttr()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetflags">external documentation</a>.
+-spec getFlags(This) -> integer() when
+ This::wxTextAttr().
getFlags(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetFlags,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrisdefault">external documentation</a>.
+-spec isDefault(This) -> boolean() when
+ This::wxTextAttr().
isDefault(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_IsDefault,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextAttr(), Alignment::WxTextAttrAlignment) -> ok
-%% WxTextAttrAlignment = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetalignment">external documentation</a>.
-%%<br /> WxTextAttrAlignment is one of ?wxTEXT_ALIGNMENT_DEFAULT | ?wxTEXT_ALIGNMENT_LEFT | ?wxTEXT_ALIGNMENT_CENTRE | ?wxTEXT_ALIGNMENT_CENTER | ?wxTEXT_ALIGNMENT_RIGHT | ?wxTEXT_ALIGNMENT_JUSTIFIED
+%%<br /> Alignment = ?wxTEXT_ALIGNMENT_DEFAULT | ?wxTEXT_ALIGNMENT_LEFT | ?wxTEXT_ALIGNMENT_CENTRE | ?wxTEXT_ALIGNMENT_CENTER | ?wxTEXT_ALIGNMENT_RIGHT | ?wxTEXT_ALIGNMENT_JUSTIFIED
+-spec setAlignment(This, Alignment) -> ok when
+ This::wxTextAttr(), Alignment::wx:wx_enum().
setAlignment(#wx_ref{type=ThisT,ref=ThisRef},Alignment)
when is_integer(Alignment) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:cast(?wxTextAttr_SetAlignment,
<<ThisRef:32/?UI,Alignment:32/?UI>>).
-%% @spec (This::wxTextAttr(), ColBack::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetbackgroundcolour">external documentation</a>.
+-spec setBackgroundColour(This, ColBack) -> ok when
+ This::wxTextAttr(), ColBack::wx:wx_colour().
setBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},ColBack)
when tuple_size(ColBack) =:= 3; tuple_size(ColBack) =:= 4 ->
?CLASS(ThisT,wxTextAttr),
wxe_util:cast(?wxTextAttr_SetBackgroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(ColBack)):16/binary>>).
-%% @spec (This::wxTextAttr(), Flags::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetflags">external documentation</a>.
+-spec setFlags(This, Flags) -> ok when
+ This::wxTextAttr(), Flags::integer().
setFlags(#wx_ref{type=ThisT,ref=ThisRef},Flags)
when is_integer(Flags) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:cast(?wxTextAttr_SetFlags,
<<ThisRef:32/?UI,Flags:32/?UI>>).
-%% @spec (This::wxTextAttr(), Font::wxFont:wxFont()) -> ok
%% @equiv setFont(This,Font, [])
+-spec setFont(This, Font) -> ok when
+ This::wxTextAttr(), Font::wxFont:wxFont().
+
setFont(This,Font)
when is_record(This, wx_ref),is_record(Font, wx_ref) ->
setFont(This,Font, []).
-%% @spec (This::wxTextAttr(), Font::wxFont:wxFont(), [Option]) -> ok
-%% Option = {flags, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetfont">external documentation</a>.
+-spec setFont(This, Font, [Option]) -> ok when
+ This::wxTextAttr(), Font::wxFont:wxFont(),
+ Option :: {flags, integer()}.
setFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxTextAttr),
@@ -202,15 +225,18 @@ setFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}, Options
wxe_util:cast(?wxTextAttr_SetFont,
<<ThisRef:32/?UI,FontRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxTextAttr(), Indent::integer()) -> ok
%% @equiv setLeftIndent(This,Indent, [])
+-spec setLeftIndent(This, Indent) -> ok when
+ This::wxTextAttr(), Indent::integer().
+
setLeftIndent(This,Indent)
when is_record(This, wx_ref),is_integer(Indent) ->
setLeftIndent(This,Indent, []).
-%% @spec (This::wxTextAttr(), Indent::integer(), [Option]) -> ok
-%% Option = {subIndent, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetleftindent">external documentation</a>.
+-spec setLeftIndent(This, Indent, [Option]) -> ok when
+ This::wxTextAttr(), Indent::integer(),
+ Option :: {subIndent, integer()}.
setLeftIndent(#wx_ref{type=ThisT,ref=ThisRef},Indent, Options)
when is_integer(Indent),is_list(Options) ->
?CLASS(ThisT,wxTextAttr),
@@ -220,16 +246,18 @@ setLeftIndent(#wx_ref{type=ThisT,ref=ThisRef},Indent, Options)
wxe_util:cast(?wxTextAttr_SetLeftIndent,
<<ThisRef:32/?UI,Indent:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxTextAttr(), Indent::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetrightindent">external documentation</a>.
+-spec setRightIndent(This, Indent) -> ok when
+ This::wxTextAttr(), Indent::integer().
setRightIndent(#wx_ref{type=ThisT,ref=ThisRef},Indent)
when is_integer(Indent) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:cast(?wxTextAttr_SetRightIndent,
<<ThisRef:32/?UI,Indent:32/?UI>>).
-%% @spec (This::wxTextAttr(), Tabs::[integer()]) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsettabs">external documentation</a>.
+-spec setTabs(This, Tabs) -> ok when
+ This::wxTextAttr(), Tabs::[integer()].
setTabs(#wx_ref{type=ThisT,ref=ThisRef},Tabs)
when is_list(Tabs) ->
?CLASS(ThisT,wxTextAttr),
@@ -237,16 +265,17 @@ setTabs(#wx_ref{type=ThisT,ref=ThisRef},Tabs)
<<ThisRef:32/?UI,(length(Tabs)):32/?UI,
(<< <<C:32/?I>> || C <- Tabs>>)/binary, 0:(((0+length(Tabs)) rem 2)*32)>>).
-%% @spec (This::wxTextAttr(), ColText::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsettextcolour">external documentation</a>.
+-spec setTextColour(This, ColText) -> ok when
+ This::wxTextAttr(), ColText::wx:wx_colour().
setTextColour(#wx_ref{type=ThisT,ref=ThisRef},ColText)
when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4 ->
?CLASS(ThisT,wxTextAttr),
wxe_util:cast(?wxTextAttr_SetTextColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(ColText)):16/binary>>).
-%% @spec (This::wxTextAttr()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxTextAttr()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxTextAttr),
wxe_util:destroy(?wxTextAttr_destroy,Obj),
diff --git a/lib/wx/src/gen/wxTextCtrl.erl b/lib/wx/src/gen/wxTextCtrl.erl
index b32f45b83b..e1f82c40c3 100644
--- a/lib/wx/src/gen/wxTextCtrl.erl
+++ b/lib/wx/src/gen/wxTextCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -77,27 +77,36 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxTextCtrl/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxTextCtrl()
+-type wxTextCtrl() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlwxtextctrl">external documentation</a>.
+-spec new() -> wxTextCtrl().
new() ->
wxe_util:construct(?wxTextCtrl_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxTextCtrl()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxTextCtrl() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxTextCtrl()
-%% Option = {value, string()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlwxtextctrl">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxTextCtrl() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {value, unicode:chardata()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -111,8 +120,9 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxTextCtrl_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxTextCtrl(), Text::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlappendtext">external documentation</a>.
+-spec appendText(This, Text) -> ok when
+ This::wxTextCtrl(), Text::unicode:chardata().
appendText(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_list(Text) ->
?CLASS(ThisT,wxTextCtrl),
@@ -120,64 +130,78 @@ appendText(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:cast(?wxTextCtrl_AppendText,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlcancopy">external documentation</a>.
+-spec canCopy(This) -> boolean() when
+ This::wxTextCtrl().
canCopy(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_CanCopy,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlcancut">external documentation</a>.
+-spec canCut(This) -> boolean() when
+ This::wxTextCtrl().
canCut(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_CanCut,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlcanpaste">external documentation</a>.
+-spec canPaste(This) -> boolean() when
+ This::wxTextCtrl().
canPaste(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_CanPaste,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlcanredo">external documentation</a>.
+-spec canRedo(This) -> boolean() when
+ This::wxTextCtrl().
canRedo(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_CanRedo,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlcanundo">external documentation</a>.
+-spec canUndo(This) -> boolean() when
+ This::wxTextCtrl().
canUndo(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_CanUndo,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlclear">external documentation</a>.
+-spec clear(This) -> ok when
+ This::wxTextCtrl().
clear(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:cast(?wxTextCtrl_Clear,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlcopy">external documentation</a>.
+-spec copy(This) -> ok when
+ This::wxTextCtrl().
copy(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:cast(?wxTextCtrl_Copy,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl(), Parent::wxWindow:wxWindow(), Id::integer()) -> bool()
%% @equiv create(This,Parent,Id, [])
+-spec create(This, Parent, Id) -> boolean() when
+ This::wxTextCtrl(), Parent::wxWindow:wxWindow(), Id::integer().
+
create(This,Parent,Id)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id) ->
create(This,Parent,Id, []).
-%% @spec (This::wxTextCtrl(), Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> bool()
-%% Option = {value, string()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlcreate">external documentation</a>.
+-spec create(This, Parent, Id, [Option]) -> boolean() when
+ This::wxTextCtrl(), Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {value, unicode:chardata()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ThisT,wxTextCtrl),
@@ -192,96 +216,109 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, O
wxe_util:call(?wxTextCtrl_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlcut">external documentation</a>.
+-spec cut(This) -> ok when
+ This::wxTextCtrl().
cut(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:cast(?wxTextCtrl_Cut,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrldiscardedits">external documentation</a>.
+-spec discardEdits(This) -> ok when
+ This::wxTextCtrl().
discardEdits(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:cast(?wxTextCtrl_DiscardEdits,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl(), Event::wxKeyEvent:wxKeyEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlemulatekeypress">external documentation</a>.
+-spec emulateKeyPress(This, Event) -> boolean() when
+ This::wxTextCtrl(), Event::wxKeyEvent:wxKeyEvent().
emulateKeyPress(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=EventT,ref=EventRef}) ->
?CLASS(ThisT,wxTextCtrl),
?CLASS(EventT,wxKeyEvent),
wxe_util:call(?wxTextCtrl_EmulateKeyPress,
<<ThisRef:32/?UI,EventRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> wxTextAttr:wxTextAttr()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlgetdefaultstyle">external documentation</a>.
+-spec getDefaultStyle(This) -> wxTextAttr:wxTextAttr() when
+ This::wxTextCtrl().
getDefaultStyle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_GetDefaultStyle,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlgetinsertionpoint">external documentation</a>.
+-spec getInsertionPoint(This) -> integer() when
+ This::wxTextCtrl().
getInsertionPoint(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_GetInsertionPoint,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlgetlastposition">external documentation</a>.
+-spec getLastPosition(This) -> integer() when
+ This::wxTextCtrl().
getLastPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_GetLastPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl(), LineNo::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlgetlinelength">external documentation</a>.
+-spec getLineLength(This, LineNo) -> integer() when
+ This::wxTextCtrl(), LineNo::integer().
getLineLength(#wx_ref{type=ThisT,ref=ThisRef},LineNo)
when is_integer(LineNo) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_GetLineLength,
<<ThisRef:32/?UI,LineNo:32/?UI>>).
-%% @spec (This::wxTextCtrl(), LineNo::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlgetlinetext">external documentation</a>.
+-spec getLineText(This, LineNo) -> unicode:charlist() when
+ This::wxTextCtrl(), LineNo::integer().
getLineText(#wx_ref{type=ThisT,ref=ThisRef},LineNo)
when is_integer(LineNo) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_GetLineText,
<<ThisRef:32/?UI,LineNo:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlgetnumberoflines">external documentation</a>.
+-spec getNumberOfLines(This) -> integer() when
+ This::wxTextCtrl().
getNumberOfLines(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_GetNumberOfLines,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl(), From::integer(), To::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlgetrange">external documentation</a>.
+-spec getRange(This, From, To) -> unicode:charlist() when
+ This::wxTextCtrl(), From::integer(), To::integer().
getRange(#wx_ref{type=ThisT,ref=ThisRef},From,To)
when is_integer(From),is_integer(To) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_GetRange,
<<ThisRef:32/?UI,From:32/?UI,To:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> {From::integer(), To::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlgetselection">external documentation</a>.
+-spec getSelection(This) -> {From::integer(), To::integer()} when
+ This::wxTextCtrl().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlgetstringselection">external documentation</a>.
+-spec getStringSelection(This) -> unicode:charlist() when
+ This::wxTextCtrl().
getStringSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_GetStringSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl(), Position::integer(), Style::wxTextAttr:wxTextAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlgetstyle">external documentation</a>.
+-spec getStyle(This, Position, Style) -> boolean() when
+ This::wxTextCtrl(), Position::integer(), Style::wxTextAttr:wxTextAttr().
getStyle(#wx_ref{type=ThisT,ref=ThisRef},Position,#wx_ref{type=StyleT,ref=StyleRef})
when is_integer(Position) ->
?CLASS(ThisT,wxTextCtrl),
@@ -289,50 +326,58 @@ getStyle(#wx_ref{type=ThisT,ref=ThisRef},Position,#wx_ref{type=StyleT,ref=StyleR
wxe_util:call(?wxTextCtrl_GetStyle,
<<ThisRef:32/?UI,Position:32/?UI,StyleRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlgetvalue">external documentation</a>.
+-spec getValue(This) -> unicode:charlist() when
+ This::wxTextCtrl().
getValue(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_GetValue,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrliseditable">external documentation</a>.
+-spec isEditable(This) -> boolean() when
+ This::wxTextCtrl().
isEditable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_IsEditable,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlismodified">external documentation</a>.
+-spec isModified(This) -> boolean() when
+ This::wxTextCtrl().
isModified(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_IsModified,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlismultiline">external documentation</a>.
+-spec isMultiLine(This) -> boolean() when
+ This::wxTextCtrl().
isMultiLine(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_IsMultiLine,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlissingleline">external documentation</a>.
+-spec isSingleLine(This) -> boolean() when
+ This::wxTextCtrl().
isSingleLine(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_IsSingleLine,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl(), File::string()) -> bool()
%% @equiv loadFile(This,File, [])
+-spec loadFile(This, File) -> boolean() when
+ This::wxTextCtrl(), File::unicode:chardata().
+
loadFile(This,File)
when is_record(This, wx_ref),is_list(File) ->
loadFile(This,File, []).
-%% @spec (This::wxTextCtrl(), File::string(), [Option]) -> bool()
-%% Option = {fileType, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlloadfile">external documentation</a>.
+-spec loadFile(This, File, [Option]) -> boolean() when
+ This::wxTextCtrl(), File::unicode:chardata(),
+ Option :: {fileType, integer()}.
loadFile(#wx_ref{type=ThisT,ref=ThisRef},File, Options)
when is_list(File),is_list(Options) ->
?CLASS(ThisT,wxTextCtrl),
@@ -343,45 +388,52 @@ loadFile(#wx_ref{type=ThisT,ref=ThisRef},File, Options)
wxe_util:call(?wxTextCtrl_LoadFile,
<<ThisRef:32/?UI,(byte_size(File_UC)):32/?UI,(File_UC)/binary, 0:(((8- ((0+byte_size(File_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlmarkdirty">external documentation</a>.
+-spec markDirty(This) -> ok when
+ This::wxTextCtrl().
markDirty(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:cast(?wxTextCtrl_MarkDirty,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlpaste">external documentation</a>.
+-spec paste(This) -> ok when
+ This::wxTextCtrl().
paste(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:cast(?wxTextCtrl_Paste,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl(), Pos::integer()) -> {bool(), X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlpositiontoxy">external documentation</a>.
+-spec positionToXY(This, Pos) -> Result when
+ Result ::{Res ::boolean(), X::integer(), Y::integer()},
+ This::wxTextCtrl(), Pos::integer().
positionToXY(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_PositionToXY,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlredo">external documentation</a>.
+-spec redo(This) -> ok when
+ This::wxTextCtrl().
redo(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:cast(?wxTextCtrl_Redo,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl(), From::integer(), To::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlremove">external documentation</a>.
+-spec remove(This, From, To) -> ok when
+ This::wxTextCtrl(), From::integer(), To::integer().
remove(#wx_ref{type=ThisT,ref=ThisRef},From,To)
when is_integer(From),is_integer(To) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:cast(?wxTextCtrl_Remove,
<<ThisRef:32/?UI,From:32/?UI,To:32/?UI>>).
-%% @spec (This::wxTextCtrl(), From::integer(), To::integer(), Value::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlreplace">external documentation</a>.
+-spec replace(This, From, To, Value) -> ok when
+ This::wxTextCtrl(), From::integer(), To::integer(), Value::unicode:chardata().
replace(#wx_ref{type=ThisT,ref=ThisRef},From,To,Value)
when is_integer(From),is_integer(To),is_list(Value) ->
?CLASS(ThisT,wxTextCtrl),
@@ -389,15 +441,19 @@ replace(#wx_ref{type=ThisT,ref=ThisRef},From,To,Value)
wxe_util:cast(?wxTextCtrl_Replace,
<<ThisRef:32/?UI,From:32/?UI,To:32/?UI,(byte_size(Value_UC)):32/?UI,(Value_UC)/binary, 0:(((8- ((0+byte_size(Value_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxTextCtrl()) -> bool()
%% @equiv saveFile(This, [])
+-spec saveFile(This) -> boolean() when
+ This::wxTextCtrl().
+
saveFile(This)
when is_record(This, wx_ref) ->
saveFile(This, []).
-%% @spec (This::wxTextCtrl(), [Option]) -> bool()
-%% Option = {file, string()} | {fileType, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlsavefile">external documentation</a>.
+-spec saveFile(This, [Option]) -> boolean() when
+ This::wxTextCtrl(),
+ Option :: {file, unicode:chardata()}
+ | {fileType, integer()}.
saveFile(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxTextCtrl),
@@ -408,55 +464,62 @@ saveFile(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxTextCtrl_SaveFile,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxTextCtrl(), Style::wxTextAttr:wxTextAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlsetdefaultstyle">external documentation</a>.
+-spec setDefaultStyle(This, Style) -> boolean() when
+ This::wxTextCtrl(), Style::wxTextAttr:wxTextAttr().
setDefaultStyle(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=StyleT,ref=StyleRef}) ->
?CLASS(ThisT,wxTextCtrl),
?CLASS(StyleT,wxTextAttr),
wxe_util:call(?wxTextCtrl_SetDefaultStyle,
<<ThisRef:32/?UI,StyleRef:32/?UI>>).
-%% @spec (This::wxTextCtrl(), Editable::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlseteditable">external documentation</a>.
+-spec setEditable(This, Editable) -> ok when
+ This::wxTextCtrl(), Editable::boolean().
setEditable(#wx_ref{type=ThisT,ref=ThisRef},Editable)
when is_boolean(Editable) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:cast(?wxTextCtrl_SetEditable,
<<ThisRef:32/?UI,(wxe_util:from_bool(Editable)):32/?UI>>).
-%% @spec (This::wxTextCtrl(), Pos::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlsetinsertionpoint">external documentation</a>.
+-spec setInsertionPoint(This, Pos) -> ok when
+ This::wxTextCtrl(), Pos::integer().
setInsertionPoint(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:cast(?wxTextCtrl_SetInsertionPoint,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlsetinsertionpointend">external documentation</a>.
+-spec setInsertionPointEnd(This) -> ok when
+ This::wxTextCtrl().
setInsertionPointEnd(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:cast(?wxTextCtrl_SetInsertionPointEnd,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl(), Len::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlsetmaxlength">external documentation</a>.
+-spec setMaxLength(This, Len) -> ok when
+ This::wxTextCtrl(), Len::integer().
setMaxLength(#wx_ref{type=ThisT,ref=ThisRef},Len)
when is_integer(Len) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:cast(?wxTextCtrl_SetMaxLength,
<<ThisRef:32/?UI,Len:32/?UI>>).
-%% @spec (This::wxTextCtrl(), From::integer(), To::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlsetselection">external documentation</a>.
+-spec setSelection(This, From, To) -> ok when
+ This::wxTextCtrl(), From::integer(), To::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},From,To)
when is_integer(From),is_integer(To) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:cast(?wxTextCtrl_SetSelection,
<<ThisRef:32/?UI,From:32/?UI,To:32/?UI>>).
-%% @spec (This::wxTextCtrl(), Start::integer(), End::integer(), Style::wxTextAttr:wxTextAttr()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlsetstyle">external documentation</a>.
+-spec setStyle(This, Start, End, Style) -> boolean() when
+ This::wxTextCtrl(), Start::integer(), End::integer(), Style::wxTextAttr:wxTextAttr().
setStyle(#wx_ref{type=ThisT,ref=ThisRef},Start,End,#wx_ref{type=StyleT,ref=StyleRef})
when is_integer(Start),is_integer(End) ->
?CLASS(ThisT,wxTextCtrl),
@@ -464,8 +527,9 @@ setStyle(#wx_ref{type=ThisT,ref=ThisRef},Start,End,#wx_ref{type=StyleT,ref=Style
wxe_util:call(?wxTextCtrl_SetStyle,
<<ThisRef:32/?UI,Start:32/?UI,End:32/?UI,StyleRef:32/?UI>>).
-%% @spec (This::wxTextCtrl(), Value::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlsetvalue">external documentation</a>.
+-spec setValue(This, Value) -> ok when
+ This::wxTextCtrl(), Value::unicode:chardata().
setValue(#wx_ref{type=ThisT,ref=ThisRef},Value)
when is_list(Value) ->
?CLASS(ThisT,wxTextCtrl),
@@ -473,23 +537,26 @@ setValue(#wx_ref{type=ThisT,ref=ThisRef},Value)
wxe_util:cast(?wxTextCtrl_SetValue,
<<ThisRef:32/?UI,(byte_size(Value_UC)):32/?UI,(Value_UC)/binary, 0:(((8- ((0+byte_size(Value_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxTextCtrl(), Pos::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlshowposition">external documentation</a>.
+-spec showPosition(This, Pos) -> ok when
+ This::wxTextCtrl(), Pos::integer().
showPosition(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:cast(?wxTextCtrl_ShowPosition,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlundo">external documentation</a>.
+-spec undo(This) -> ok when
+ This::wxTextCtrl().
undo(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:cast(?wxTextCtrl_Undo,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextCtrl(), Text::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlwritetext">external documentation</a>.
+-spec writeText(This, Text) -> ok when
+ This::wxTextCtrl(), Text::unicode:chardata().
writeText(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_list(Text) ->
?CLASS(ThisT,wxTextCtrl),
@@ -497,16 +564,17 @@ writeText(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:cast(?wxTextCtrl_WriteText,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxTextCtrl(), X::integer(), Y::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextctrl.html#wxtextctrlxytoposition">external documentation</a>.
+-spec xYToPosition(This, X, Y) -> integer() when
+ This::wxTextCtrl(), X::integer(), Y::integer().
xYToPosition(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxTextCtrl),
wxe_util:call(?wxTextCtrl_XYToPosition,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxTextCtrl()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxTextCtrl()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxTextCtrl),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxTextDataObject.erl b/lib/wx/src/gen/wxTextDataObject.erl
index f4fe3b5e0c..4ffa2de4a7 100644
--- a/lib/wx/src/gen/wxTextDataObject.erl
+++ b/lib/wx/src/gen/wxTextDataObject.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -32,18 +32,21 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxTextDataObject/0]).
%% @hidden
parent_class(wxDataObject) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxTextDataObject()
+-type wxTextDataObject() :: wx:wx_object().
%% @equiv new([])
+-spec new() -> wxTextDataObject().
+
new() ->
new([]).
-%% @spec ([Option]) -> wxTextDataObject()
-%% Option = {text, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextdataobject.html#wxtextdataobjectwxtextdataobject">external documentation</a>.
+-spec new([Option]) -> wxTextDataObject() when
+ Option :: {text, unicode:chardata()}.
new(Options)
when is_list(Options) ->
MOpts = fun({text, Text}, Acc) -> Text_UC = unicode:characters_to_binary([Text,0]),[<<1:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
@@ -52,22 +55,25 @@ new(Options)
wxe_util:construct(?wxTextDataObject_new,
<<BinOpt/binary>>).
-%% @spec (This::wxTextDataObject()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextdataobject.html#wxtextdataobjectgettextlength">external documentation</a>.
+-spec getTextLength(This) -> integer() when
+ This::wxTextDataObject().
getTextLength(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextDataObject),
wxe_util:call(?wxTextDataObject_GetTextLength,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextDataObject()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextdataobject.html#wxtextdataobjectgettext">external documentation</a>.
+-spec getText(This) -> unicode:charlist() when
+ This::wxTextDataObject().
getText(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextDataObject),
wxe_util:call(?wxTextDataObject_GetText,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextDataObject(), Text::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextdataobject.html#wxtextdataobjectsettext">external documentation</a>.
+-spec setText(This, Text) -> ok when
+ This::wxTextDataObject(), Text::unicode:chardata().
setText(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_list(Text) ->
?CLASS(ThisT,wxTextDataObject),
@@ -75,8 +81,8 @@ setText(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:cast(?wxTextDataObject_SetText,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxTextDataObject()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxTextDataObject()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxTextDataObject),
wxe_util:destroy(?wxTextDataObject_destroy,Obj),
diff --git a/lib/wx/src/gen/wxTextEntryDialog.erl b/lib/wx/src/gen/wxTextEntryDialog.erl
index 53694a47e6..78e6e32b98 100644
--- a/lib/wx/src/gen/wxTextEntryDialog.erl
+++ b/lib/wx/src/gen/wxTextEntryDialog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -77,6 +77,7 @@
transferDataFromWindow/1,transferDataToWindow/1,update/1,updateWindowUI/1,
updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxTextEntryDialog/0]).
%% @hidden
parent_class(wxDialog) -> true;
parent_class(wxTopLevelWindow) -> true;
@@ -84,15 +85,22 @@ parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Parent::wxWindow:wxWindow(), Message::string()) -> wxTextEntryDialog()
+-type wxTextEntryDialog() :: wx:wx_object().
%% @equiv new(Parent,Message, [])
+-spec new(Parent, Message) -> wxTextEntryDialog() when
+ Parent::wxWindow:wxWindow(), Message::unicode:chardata().
+
new(Parent,Message)
when is_record(Parent, wx_ref),is_list(Message) ->
new(Parent,Message, []).
-%% @spec (Parent::wxWindow:wxWindow(), Message::string(), [Option]) -> wxTextEntryDialog()
-%% Option = {caption, string()} | {value, string()} | {style, integer()} | {pos, {X::integer(), Y::integer()}}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextentrydialog.html#wxtextentrydialogwxtextentrydialog">external documentation</a>.
+-spec new(Parent, Message, [Option]) -> wxTextEntryDialog() when
+ Parent::wxWindow:wxWindow(), Message::unicode:chardata(),
+ Option :: {caption, unicode:chardata()}
+ | {value, unicode:chardata()}
+ | {style, integer()}
+ | {pos, {X::integer(), Y::integer()}}.
new(#wx_ref{type=ParentT,ref=ParentRef},Message, Options)
when is_list(Message),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -106,15 +114,17 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Message, Options)
wxe_util:construct(?wxTextEntryDialog_new,
<<ParentRef:32/?UI,(byte_size(Message_UC)):32/?UI,(Message_UC)/binary, 0:(((8- ((0+byte_size(Message_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxTextEntryDialog()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextentrydialog.html#wxtextentrydialoggetvalue">external documentation</a>.
+-spec getValue(This) -> unicode:charlist() when
+ This::wxTextEntryDialog().
getValue(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextEntryDialog),
wxe_util:call(?wxTextEntryDialog_GetValue,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTextEntryDialog(), Val::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextentrydialog.html#wxtextentrydialogsetvalue">external documentation</a>.
+-spec setValue(This, Val) -> ok when
+ This::wxTextEntryDialog(), Val::unicode:chardata().
setValue(#wx_ref{type=ThisT,ref=ThisRef},Val)
when is_list(Val) ->
?CLASS(ThisT,wxTextEntryDialog),
@@ -122,8 +132,8 @@ setValue(#wx_ref{type=ThisT,ref=ThisRef},Val)
wxe_util:cast(?wxTextEntryDialog_SetValue,
<<ThisRef:32/?UI,(byte_size(Val_UC)):32/?UI,(Val_UC)/binary, 0:(((8- ((0+byte_size(Val_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxTextEntryDialog()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxTextEntryDialog()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxTextEntryDialog),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxToggleButton.erl b/lib/wx/src/gen/wxToggleButton.erl
index d7755cc50b..ed2f564952 100644
--- a/lib/wx/src/gen/wxToggleButton.erl
+++ b/lib/wx/src/gen/wxToggleButton.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -69,27 +69,35 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxToggleButton/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxToggleButton()
+-type wxToggleButton() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtogglebutton.html#wxtogglebuttonwxtogglebutton">external documentation</a>.
+-spec new() -> wxToggleButton().
new() ->
wxe_util:construct(?wxToggleButton_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Label::string()) -> wxToggleButton()
%% @equiv new(Parent,Id,Label, [])
+-spec new(Parent, Id, Label) -> wxToggleButton() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata().
+
new(Parent,Id,Label)
when is_record(Parent, wx_ref),is_integer(Id),is_list(Label) ->
new(Parent,Id,Label, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), Label::string(), [Option]) -> wxToggleButton()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtogglebutton.html#wxtogglebuttonwxtogglebutton">external documentation</a>.
+-spec new(Parent, Id, Label, [Option]) -> wxToggleButton() when
+ Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
when is_integer(Id),is_list(Label),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -103,15 +111,21 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
wxe_util:construct(?wxToggleButton_new_4,
<<ParentRef:32/?UI,Id:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxToggleButton(), Parent::wxWindow:wxWindow(), Id::integer(), Label::string()) -> bool()
%% @equiv create(This,Parent,Id,Label, [])
+-spec create(This, Parent, Id, Label) -> boolean() when
+ This::wxToggleButton(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata().
+
create(This,Parent,Id,Label)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Label) ->
create(This,Parent,Id,Label, []).
-%% @spec (This::wxToggleButton(), Parent::wxWindow:wxWindow(), Id::integer(), Label::string(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtogglebutton.html#wxtogglebuttoncreate">external documentation</a>.
+-spec create(This, Parent, Id, Label, [Option]) -> boolean() when
+ This::wxToggleButton(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options)
when is_integer(Id),is_list(Label),is_list(Options) ->
?CLASS(ThisT,wxToggleButton),
@@ -126,23 +140,25 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,La
wxe_util:call(?wxToggleButton_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((0+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxToggleButton()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtogglebutton.html#wxtogglebuttongetvalue">external documentation</a>.
+-spec getValue(This) -> boolean() when
+ This::wxToggleButton().
getValue(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxToggleButton),
wxe_util:call(?wxToggleButton_GetValue,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxToggleButton(), State::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtogglebutton.html#wxtogglebuttonsetvalue">external documentation</a>.
+-spec setValue(This, State) -> ok when
+ This::wxToggleButton(), State::boolean().
setValue(#wx_ref{type=ThisT,ref=ThisRef},State)
when is_boolean(State) ->
?CLASS(ThisT,wxToggleButton),
wxe_util:cast(?wxToggleButton_SetValue,
<<ThisRef:32/?UI,(wxe_util:from_bool(State)):32/?UI>>).
-%% @spec (This::wxToggleButton()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxToggleButton()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxToggleButton),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxToolBar.erl b/lib/wx/src/gen/wxToolBar.erl
index 59369368f0..9401e30e20 100644
--- a/lib/wx/src/gen/wxToolBar.erl
+++ b/lib/wx/src/gen/wxToolBar.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -77,52 +77,66 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxToolBar/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxToolBar(), Control::wxControl:wxControl()) -> wx:wx()
+-type wxToolBar() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbaraddcontrol">external documentation</a>.
+-spec addControl(This, Control) -> wx:wx_object() when
+ This::wxToolBar(), Control::wxControl:wxControl().
addControl(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ControlT,ref=ControlRef}) ->
?CLASS(ThisT,wxToolBar),
?CLASS(ControlT,wxControl),
wxe_util:call(?wxToolBar_AddControl,
<<ThisRef:32/?UI,ControlRef:32/?UI>>).
-%% @spec (This::wxToolBar()) -> wx:wx()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbaraddseparator">external documentation</a>.
+-spec addSeparator(This) -> wx:wx_object() when
+ This::wxToolBar().
addSeparator(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_AddSeparator,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxToolBar(), Tool::wx:wx()) -> wx:wx()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbaraddtool">external documentation</a>.
+-spec addTool(This, Tool) -> wx:wx_object() when
+ This::wxToolBar(), Tool::wx:wx_object().
addTool(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ToolT,ref=ToolRef}) ->
?CLASS(ThisT,wxToolBar),
?CLASS(ToolT,wx),
wxe_util:call(?wxToolBar_AddTool_1,
<<ThisRef:32/?UI,ToolRef:32/?UI>>).
-%% @spec (This::wxToolBar(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap()) -> wx:wx()
%% @equiv addTool(This,Toolid,Bitmap, [])
+-spec addTool(This, Toolid, Bitmap) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap().
+
addTool(This,Toolid,Bitmap)
when is_record(This, wx_ref),is_integer(Toolid),is_record(Bitmap, wx_ref) ->
addTool(This,Toolid,Bitmap, []).
-%% @spec (This::wxToolBar(),Toolid::integer(),X::string()|term(),X::term()) -> wx:wx()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbaraddtool">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% addTool(This::wxToolBar(), Toolid::integer(), Label::string(), Bitmap::wxBitmap:wxBitmap()) -> addTool(This,Toolid,Label,Bitmap, []) </c></p>
-%% <p><c>
-%% addTool(This::wxToolBar(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(), BmpDisabled::wxBitmap:wxBitmap()) -> addTool(This,Toolid,Bitmap,BmpDisabled, []) </c></p>
-%% <p><c>
-%% addTool(This::wxToolBar(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(), [Option]) -> wx:wx() </c>
-%%<br /> Option = {shortHelpString, string()} | {longHelpString, string()}
-%% </p>
+%% <br /> Also:<br />
+%% addTool(This, Toolid, Bitmap, BmpDisabled) -> wx:wx_object() when<br />
+%% This::wxToolBar(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(), BmpDisabled::wxBitmap:wxBitmap();<br />
+%% (This, Toolid, Bitmap, [Option]) -> wx:wx_object() when<br />
+%% This::wxToolBar(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(),<br />
+%% Option :: {shortHelpString, unicode:chardata()}<br />
+%% | {longHelpString, unicode:chardata()}.<br />
+%%
+%%<br /> Kind = ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+-spec addTool(This, Toolid, Label, Bitmap) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer(), Label::unicode:chardata(), Bitmap::wxBitmap:wxBitmap();
+ (This, Toolid, Bitmap, BmpDisabled) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(), BmpDisabled::wxBitmap:wxBitmap();
+ (This, Toolid, Bitmap, [Option]) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(),
+ Option :: {shortHelpString, unicode:chardata()}
+ | {longHelpString, unicode:chardata()}.
addTool(This,Toolid,Label,Bitmap)
when is_record(This, wx_ref),is_integer(Toolid),is_list(Label),is_record(Bitmap, wx_ref) ->
@@ -142,21 +156,32 @@ addTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,#wx_ref{type=BitmapT,ref=BitmapRe
wxe_util:call(?wxToolBar_AddTool_3,
<<ThisRef:32/?UI,Toolid:32/?UI,BitmapRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxToolBar(),Toolid::integer(),X::string()|term(),X::term(),X::term()) -> wx:wx()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbaraddtool">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% addTool(This::wxToolBar(), Toolid::integer(), Label::string(), Bitmap::wxBitmap:wxBitmap(), BmpDisabled::wxBitmap:wxBitmap()) -> addTool(This,Toolid,Label,Bitmap,BmpDisabled, []) </c></p>
-%% <p><c>
-%% addTool(This::wxToolBar(), Toolid::integer(), Label::string(), Bitmap::wxBitmap:wxBitmap(), [Option]) -> wx:wx() </c>
-%%<br /> Option = {shortHelp, string()} | {kind, WxItemKind}
-%%<br /> WxItemKind = integer()
-%%<br /> WxItemKind is one of ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
-%% </p>
-%% <p><c>
-%% addTool(This::wxToolBar(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(), BmpDisabled::wxBitmap:wxBitmap(), [Option]) -> wx:wx() </c>
-%%<br /> Option = {toggle, bool()} | {clientData, wx:wx()} | {shortHelpString, string()} | {longHelpString, string()}
-%% </p>
+%% <br /> Also:<br />
+%% addTool(This, Toolid, Label, Bitmap, [Option]) -> wx:wx_object() when<br />
+%% This::wxToolBar(), Toolid::integer(), Label::unicode:chardata(), Bitmap::wxBitmap:wxBitmap(),<br />
+%% Option :: {shortHelp, unicode:chardata()}<br />
+%% | {kind, wx:wx_enum()};<br />
+%% (This, Toolid, Bitmap, BmpDisabled, [Option]) -> wx:wx_object() when<br />
+%% This::wxToolBar(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(), BmpDisabled::wxBitmap:wxBitmap(),<br />
+%% Option :: {toggle, boolean()}<br />
+%% | {clientData, wx:wx_object()}<br />
+%% | {shortHelpString, unicode:chardata()}<br />
+%% | {longHelpString, unicode:chardata()}.<br />
+%%
+%%<br /> Kind = ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+-spec addTool(This, Toolid, Label, Bitmap, BmpDisabled) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer(), Label::unicode:chardata(), Bitmap::wxBitmap:wxBitmap(), BmpDisabled::wxBitmap:wxBitmap();
+ (This, Toolid, Label, Bitmap, [Option]) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer(), Label::unicode:chardata(), Bitmap::wxBitmap:wxBitmap(),
+ Option :: {shortHelp, unicode:chardata()}
+ | {kind, wx:wx_enum()};
+ (This, Toolid, Bitmap, BmpDisabled, [Option]) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(), BmpDisabled::wxBitmap:wxBitmap(),
+ Option :: {toggle, boolean()}
+ | {clientData, wx:wx_object()}
+ | {shortHelpString, unicode:chardata()}
+ | {longHelpString, unicode:chardata()}.
addTool(This,Toolid,Label,Bitmap,BmpDisabled)
when is_record(This, wx_ref),is_integer(Toolid),is_list(Label),is_record(Bitmap, wx_ref),is_record(BmpDisabled, wx_ref) ->
@@ -186,17 +211,24 @@ addTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,#wx_ref{type=BitmapT,ref=BitmapRe
wxe_util:call(?wxToolBar_AddTool_4_1,
<<ThisRef:32/?UI,Toolid:32/?UI,BitmapRef:32/?UI,BmpDisabledRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxToolBar(),Toolid::integer(),X::term()|string(),X::term(),X::bool()|term(),X::integer()|term()) -> wx:wx()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbaraddtool">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% addTool(This::wxToolBar(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(), BmpDisabled::wxBitmap:wxBitmap(), Toggle::bool(), XPos::integer()) -> addTool(This,Toolid,Bitmap,BmpDisabled,Toggle,XPos, []) </c></p>
-%% <p><c>
-%% addTool(This::wxToolBar(), Toolid::integer(), Label::string(), Bitmap::wxBitmap:wxBitmap(), BmpDisabled::wxBitmap:wxBitmap(), [Option]) -> wx:wx() </c>
-%%<br /> Option = {kind, WxItemKind} | {shortHelp, string()} | {longHelp, string()} | {data, wx:wx()}
-%%<br /> WxItemKind = integer()
-%%<br /> WxItemKind is one of ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
-%% </p>
+%% <br /> Also:<br />
+%% addTool(This, Toolid, Label, Bitmap, BmpDisabled, [Option]) -> wx:wx_object() when<br />
+%% This::wxToolBar(), Toolid::integer(), Label::unicode:chardata(), Bitmap::wxBitmap:wxBitmap(), BmpDisabled::wxBitmap:wxBitmap(),<br />
+%% Option :: {kind, wx:wx_enum()}<br />
+%% | {shortHelp, unicode:chardata()}<br />
+%% | {longHelp, unicode:chardata()}<br />
+%% | {data, wx:wx_object()}.<br />
+%%
+%%<br /> Kind = ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+-spec addTool(This, Toolid, Bitmap, BmpDisabled, Toggle, XPos) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(), BmpDisabled::wxBitmap:wxBitmap(), Toggle::boolean(), XPos::integer();
+ (This, Toolid, Label, Bitmap, BmpDisabled, [Option]) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer(), Label::unicode:chardata(), Bitmap::wxBitmap:wxBitmap(), BmpDisabled::wxBitmap:wxBitmap(),
+ Option :: {kind, wx:wx_enum()}
+ | {shortHelp, unicode:chardata()}
+ | {longHelp, unicode:chardata()}
+ | {data, wx:wx_object()}.
addTool(This,Toolid,Bitmap,BmpDisabled,Toggle,XPos)
when is_record(This, wx_ref),is_integer(Toolid),is_record(Bitmap, wx_ref),is_record(BmpDisabled, wx_ref),is_boolean(Toggle),is_integer(XPos) ->
@@ -216,9 +248,13 @@ addTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,Label,#wx_ref{type=BitmapT,ref=Bi
wxe_util:call(?wxToolBar_AddTool_5,
<<ThisRef:32/?UI,Toolid:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8,BitmapRef:32/?UI,BmpDisabledRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxToolBar(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(), BmpDisabled::wxBitmap:wxBitmap(), Toggle::bool(), XPos::integer(), [Option]) -> wx:wx()
-%% Option = {yPos, integer()} | {clientData, wx:wx()} | {shortHelp, string()} | {longHelp, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbaraddtool">external documentation</a>.
+-spec addTool(This, Toolid, Bitmap, BmpDisabled, Toggle, XPos, [Option]) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(), BmpDisabled::wxBitmap:wxBitmap(), Toggle::boolean(), XPos::integer(),
+ Option :: {yPos, integer()}
+ | {clientData, wx:wx_object()}
+ | {shortHelp, unicode:chardata()}
+ | {longHelp, unicode:chardata()}.
addTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,#wx_ref{type=BitmapT,ref=BitmapRef},#wx_ref{type=BmpDisabledT,ref=BmpDisabledRef},Toggle,XPos, Options)
when is_integer(Toolid),is_boolean(Toggle),is_integer(XPos),is_list(Options) ->
?CLASS(ThisT,wxToolBar),
@@ -233,15 +269,21 @@ addTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,#wx_ref{type=BitmapT,ref=BitmapRe
wxe_util:call(?wxToolBar_AddTool_6,
<<ThisRef:32/?UI,Toolid:32/?UI,BitmapRef:32/?UI,BmpDisabledRef:32/?UI,(wxe_util:from_bool(Toggle)):32/?UI,XPos:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxToolBar(), Toolid::integer(), Label::string(), Bitmap::wxBitmap:wxBitmap()) -> wx:wx()
%% @equiv addCheckTool(This,Toolid,Label,Bitmap, [])
+-spec addCheckTool(This, Toolid, Label, Bitmap) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer(), Label::unicode:chardata(), Bitmap::wxBitmap:wxBitmap().
+
addCheckTool(This,Toolid,Label,Bitmap)
when is_record(This, wx_ref),is_integer(Toolid),is_list(Label),is_record(Bitmap, wx_ref) ->
addCheckTool(This,Toolid,Label,Bitmap, []).
-%% @spec (This::wxToolBar(), Toolid::integer(), Label::string(), Bitmap::wxBitmap:wxBitmap(), [Option]) -> wx:wx()
-%% Option = {bmpDisabled, wxBitmap:wxBitmap()} | {shortHelp, string()} | {longHelp, string()} | {data, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbaraddchecktool">external documentation</a>.
+-spec addCheckTool(This, Toolid, Label, Bitmap, [Option]) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer(), Label::unicode:chardata(), Bitmap::wxBitmap:wxBitmap(),
+ Option :: {bmpDisabled, wxBitmap:wxBitmap()}
+ | {shortHelp, unicode:chardata()}
+ | {longHelp, unicode:chardata()}
+ | {data, wx:wx_object()}.
addCheckTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,Label,#wx_ref{type=BitmapT,ref=BitmapRef}, Options)
when is_integer(Toolid),is_list(Label),is_list(Options) ->
?CLASS(ThisT,wxToolBar),
@@ -256,15 +298,21 @@ addCheckTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,Label,#wx_ref{type=BitmapT,r
wxe_util:call(?wxToolBar_AddCheckTool,
<<ThisRef:32/?UI,Toolid:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8,BitmapRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxToolBar(), Toolid::integer(), Label::string(), Bitmap::wxBitmap:wxBitmap()) -> wx:wx()
%% @equiv addRadioTool(This,Toolid,Label,Bitmap, [])
+-spec addRadioTool(This, Toolid, Label, Bitmap) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer(), Label::unicode:chardata(), Bitmap::wxBitmap:wxBitmap().
+
addRadioTool(This,Toolid,Label,Bitmap)
when is_record(This, wx_ref),is_integer(Toolid),is_list(Label),is_record(Bitmap, wx_ref) ->
addRadioTool(This,Toolid,Label,Bitmap, []).
-%% @spec (This::wxToolBar(), Toolid::integer(), Label::string(), Bitmap::wxBitmap:wxBitmap(), [Option]) -> wx:wx()
-%% Option = {bmpDisabled, wxBitmap:wxBitmap()} | {shortHelp, string()} | {longHelp, string()} | {data, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbaraddradiotool">external documentation</a>.
+-spec addRadioTool(This, Toolid, Label, Bitmap, [Option]) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer(), Label::unicode:chardata(), Bitmap::wxBitmap:wxBitmap(),
+ Option :: {bmpDisabled, wxBitmap:wxBitmap()}
+ | {shortHelp, unicode:chardata()}
+ | {longHelp, unicode:chardata()}
+ | {data, wx:wx_object()}.
addRadioTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,Label,#wx_ref{type=BitmapT,ref=BitmapRef}, Options)
when is_integer(Toolid),is_list(Label),is_list(Options) ->
?CLASS(ThisT,wxToolBar),
@@ -279,131 +327,148 @@ addRadioTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,Label,#wx_ref{type=BitmapT,r
wxe_util:call(?wxToolBar_AddRadioTool,
<<ThisRef:32/?UI,Toolid:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8,BitmapRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxToolBar(), Toolid::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbardeletetool">external documentation</a>.
+-spec deleteTool(This, Toolid) -> boolean() when
+ This::wxToolBar(), Toolid::integer().
deleteTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid)
when is_integer(Toolid) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_DeleteTool,
<<ThisRef:32/?UI,Toolid:32/?UI>>).
-%% @spec (This::wxToolBar(), Pos::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbardeletetoolbypos">external documentation</a>.
+-spec deleteToolByPos(This, Pos) -> boolean() when
+ This::wxToolBar(), Pos::integer().
deleteToolByPos(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_DeleteToolByPos,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxToolBar(), Toolid::integer(), Enable::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarenabletool">external documentation</a>.
+-spec enableTool(This, Toolid, Enable) -> ok when
+ This::wxToolBar(), Toolid::integer(), Enable::boolean().
enableTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,Enable)
when is_integer(Toolid),is_boolean(Enable) ->
?CLASS(ThisT,wxToolBar),
wxe_util:cast(?wxToolBar_EnableTool,
<<ThisRef:32/?UI,Toolid:32/?UI,(wxe_util:from_bool(Enable)):32/?UI>>).
-%% @spec (This::wxToolBar(), Toolid::integer()) -> wx:wx()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarfindbyid">external documentation</a>.
+-spec findById(This, Toolid) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer().
findById(#wx_ref{type=ThisT,ref=ThisRef},Toolid)
when is_integer(Toolid) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_FindById,
<<ThisRef:32/?UI,Toolid:32/?UI>>).
-%% @spec (This::wxToolBar(), Toolid::integer()) -> wxControl:wxControl()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarfindcontrol">external documentation</a>.
+-spec findControl(This, Toolid) -> wxControl:wxControl() when
+ This::wxToolBar(), Toolid::integer().
findControl(#wx_ref{type=ThisT,ref=ThisRef},Toolid)
when is_integer(Toolid) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_FindControl,
<<ThisRef:32/?UI,Toolid:32/?UI>>).
-%% @spec (This::wxToolBar(), X::integer(), Y::integer()) -> wx:wx()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarfindtoolforposition">external documentation</a>.
+-spec findToolForPosition(This, X, Y) -> wx:wx_object() when
+ This::wxToolBar(), X::integer(), Y::integer().
findToolForPosition(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_FindToolForPosition,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxToolBar()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbargettoolsize">external documentation</a>.
+-spec getToolSize(This) -> {W::integer(), H::integer()} when
+ This::wxToolBar().
getToolSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_GetToolSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxToolBar()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbargettoolbitmapsize">external documentation</a>.
+-spec getToolBitmapSize(This) -> {W::integer(), H::integer()} when
+ This::wxToolBar().
getToolBitmapSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_GetToolBitmapSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxToolBar()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbargetmargins">external documentation</a>.
+-spec getMargins(This) -> {W::integer(), H::integer()} when
+ This::wxToolBar().
getMargins(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_GetMargins,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxToolBar(), Toolid::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbargettoolenabled">external documentation</a>.
+-spec getToolEnabled(This, Toolid) -> boolean() when
+ This::wxToolBar(), Toolid::integer().
getToolEnabled(#wx_ref{type=ThisT,ref=ThisRef},Toolid)
when is_integer(Toolid) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_GetToolEnabled,
<<ThisRef:32/?UI,Toolid:32/?UI>>).
-%% @spec (This::wxToolBar(), Toolid::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbargettoollonghelp">external documentation</a>.
+-spec getToolLongHelp(This, Toolid) -> unicode:charlist() when
+ This::wxToolBar(), Toolid::integer().
getToolLongHelp(#wx_ref{type=ThisT,ref=ThisRef},Toolid)
when is_integer(Toolid) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_GetToolLongHelp,
<<ThisRef:32/?UI,Toolid:32/?UI>>).
-%% @spec (This::wxToolBar()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbargettoolpacking">external documentation</a>.
+-spec getToolPacking(This) -> integer() when
+ This::wxToolBar().
getToolPacking(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_GetToolPacking,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxToolBar(), Id::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbargettoolpos">external documentation</a>.
+-spec getToolPos(This, Id) -> integer() when
+ This::wxToolBar(), Id::integer().
getToolPos(#wx_ref{type=ThisT,ref=ThisRef},Id)
when is_integer(Id) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_GetToolPos,
<<ThisRef:32/?UI,Id:32/?UI>>).
-%% @spec (This::wxToolBar()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbargettoolseparation">external documentation</a>.
+-spec getToolSeparation(This) -> integer() when
+ This::wxToolBar().
getToolSeparation(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_GetToolSeparation,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxToolBar(), Toolid::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbargettoolshorthelp">external documentation</a>.
+-spec getToolShortHelp(This, Toolid) -> unicode:charlist() when
+ This::wxToolBar(), Toolid::integer().
getToolShortHelp(#wx_ref{type=ThisT,ref=ThisRef},Toolid)
when is_integer(Toolid) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_GetToolShortHelp,
<<ThisRef:32/?UI,Toolid:32/?UI>>).
-%% @spec (This::wxToolBar(), Toolid::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbargettoolstate">external documentation</a>.
+-spec getToolState(This, Toolid) -> boolean() when
+ This::wxToolBar(), Toolid::integer().
getToolState(#wx_ref{type=ThisT,ref=ThisRef},Toolid)
when is_integer(Toolid) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_GetToolState,
<<ThisRef:32/?UI,Toolid:32/?UI>>).
-%% @spec (This::wxToolBar(), Pos::integer(), Control::wxControl:wxControl()) -> wx:wx()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarinsertcontrol">external documentation</a>.
+-spec insertControl(This, Pos, Control) -> wx:wx_object() when
+ This::wxToolBar(), Pos::integer(), Control::wxControl:wxControl().
insertControl(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=ControlT,ref=ControlRef})
when is_integer(Pos) ->
?CLASS(ThisT,wxToolBar),
@@ -411,16 +476,18 @@ insertControl(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=ControlT,ref=Cont
wxe_util:call(?wxToolBar_InsertControl,
<<ThisRef:32/?UI,Pos:32/?UI,ControlRef:32/?UI>>).
-%% @spec (This::wxToolBar(), Pos::integer()) -> wx:wx()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarinsertseparator">external documentation</a>.
+-spec insertSeparator(This, Pos) -> wx:wx_object() when
+ This::wxToolBar(), Pos::integer().
insertSeparator(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_InsertSeparator,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxToolBar(), Pos::integer(), Tool::wx:wx()) -> wx:wx()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarinserttool">external documentation</a>.
+-spec insertTool(This, Pos, Tool) -> wx:wx_object() when
+ This::wxToolBar(), Pos::integer(), Tool::wx:wx_object().
insertTool(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=ToolT,ref=ToolRef})
when is_integer(Pos) ->
?CLASS(ThisT,wxToolBar),
@@ -428,21 +495,34 @@ insertTool(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=ToolT,ref=ToolRef})
wxe_util:call(?wxToolBar_InsertTool_2,
<<ThisRef:32/?UI,Pos:32/?UI,ToolRef:32/?UI>>).
-%% @spec (This::wxToolBar(), Pos::integer(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap()) -> wx:wx()
%% @equiv insertTool(This,Pos,Toolid,Bitmap, [])
+-spec insertTool(This, Pos, Toolid, Bitmap) -> wx:wx_object() when
+ This::wxToolBar(), Pos::integer(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap().
+
insertTool(This,Pos,Toolid,Bitmap)
when is_record(This, wx_ref),is_integer(Pos),is_integer(Toolid),is_record(Bitmap, wx_ref) ->
insertTool(This,Pos,Toolid,Bitmap, []).
-%% @spec (This::wxToolBar(),Pos::integer(),Toolid::integer(),X::string()|term(),X::term()) -> wx:wx()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarinserttool">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% insertTool(This::wxToolBar(), Pos::integer(), Toolid::integer(), Label::string(), Bitmap::wxBitmap:wxBitmap()) -> insertTool(This,Pos,Toolid,Label,Bitmap, []) </c></p>
-%% <p><c>
-%% insertTool(This::wxToolBar(), Pos::integer(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(), [Option]) -> wx:wx() </c>
-%%<br /> Option = {bmpDisabled, wxBitmap:wxBitmap()} | {toggle, bool()} | {clientData, wx:wx()} | {shortHelp, string()} | {longHelp, string()}
-%% </p>
+%% <br /> Also:<br />
+%% insertTool(This, Pos, Toolid, Bitmap, [Option]) -> wx:wx_object() when<br />
+%% This::wxToolBar(), Pos::integer(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(),<br />
+%% Option :: {bmpDisabled, wxBitmap:wxBitmap()}<br />
+%% | {toggle, boolean()}<br />
+%% | {clientData, wx:wx_object()}<br />
+%% | {shortHelp, unicode:chardata()}<br />
+%% | {longHelp, unicode:chardata()}.<br />
+%%
+%%<br /> Kind = ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+-spec insertTool(This, Pos, Toolid, Label, Bitmap) -> wx:wx_object() when
+ This::wxToolBar(), Pos::integer(), Toolid::integer(), Label::unicode:chardata(), Bitmap::wxBitmap:wxBitmap();
+ (This, Pos, Toolid, Bitmap, [Option]) -> wx:wx_object() when
+ This::wxToolBar(), Pos::integer(), Toolid::integer(), Bitmap::wxBitmap:wxBitmap(),
+ Option :: {bmpDisabled, wxBitmap:wxBitmap()}
+ | {toggle, boolean()}
+ | {clientData, wx:wx_object()}
+ | {shortHelp, unicode:chardata()}
+ | {longHelp, unicode:chardata()}.
insertTool(This,Pos,Toolid,Label,Bitmap)
when is_record(This, wx_ref),is_integer(Pos),is_integer(Toolid),is_list(Label),is_record(Bitmap, wx_ref) ->
@@ -461,11 +541,15 @@ insertTool(#wx_ref{type=ThisT,ref=ThisRef},Pos,Toolid,#wx_ref{type=BitmapT,ref=B
wxe_util:call(?wxToolBar_InsertTool_4,
<<ThisRef:32/?UI,Pos:32/?UI,Toolid:32/?UI,BitmapRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxToolBar(), Pos::integer(), Toolid::integer(), Label::string(), Bitmap::wxBitmap:wxBitmap(), [Option]) -> wx:wx()
-%% Option = {bmpDisabled, wxBitmap:wxBitmap()} | {kind, WxItemKind} | {shortHelp, string()} | {longHelp, string()} | {clientData, wx:wx()}
-%% WxItemKind = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarinserttool">external documentation</a>.
-%%<br /> WxItemKind is one of ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+%%<br /> Kind = ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
+-spec insertTool(This, Pos, Toolid, Label, Bitmap, [Option]) -> wx:wx_object() when
+ This::wxToolBar(), Pos::integer(), Toolid::integer(), Label::unicode:chardata(), Bitmap::wxBitmap:wxBitmap(),
+ Option :: {bmpDisabled, wxBitmap:wxBitmap()}
+ | {kind, wx:wx_enum()}
+ | {shortHelp, unicode:chardata()}
+ | {longHelp, unicode:chardata()}
+ | {clientData, wx:wx_object()}.
insertTool(#wx_ref{type=ThisT,ref=ThisRef},Pos,Toolid,Label,#wx_ref{type=BitmapT,ref=BitmapRef}, Options)
when is_integer(Pos),is_integer(Toolid),is_list(Label),is_list(Options) ->
?CLASS(ThisT,wxToolBar),
@@ -481,39 +565,44 @@ insertTool(#wx_ref{type=ThisT,ref=ThisRef},Pos,Toolid,Label,#wx_ref{type=BitmapT
wxe_util:call(?wxToolBar_InsertTool_5,
<<ThisRef:32/?UI,Pos:32/?UI,Toolid:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((0+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8,BitmapRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxToolBar()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarrealize">external documentation</a>.
+-spec realize(This) -> boolean() when
+ This::wxToolBar().
realize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_Realize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxToolBar(), Toolid::integer()) -> wx:wx()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarremovetool">external documentation</a>.
+-spec removeTool(This, Toolid) -> wx:wx_object() when
+ This::wxToolBar(), Toolid::integer().
removeTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid)
when is_integer(Toolid) ->
?CLASS(ThisT,wxToolBar),
wxe_util:call(?wxToolBar_RemoveTool,
<<ThisRef:32/?UI,Toolid:32/?UI>>).
-%% @spec (This::wxToolBar(), X::integer(), Y::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarsetmargins">external documentation</a>.
+-spec setMargins(This, X, Y) -> ok when
+ This::wxToolBar(), X::integer(), Y::integer().
setMargins(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxToolBar),
wxe_util:cast(?wxToolBar_SetMargins,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxToolBar(), Size::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarsettoolbitmapsize">external documentation</a>.
+-spec setToolBitmapSize(This, Size) -> ok when
+ This::wxToolBar(), Size::{W::integer(), H::integer()}.
setToolBitmapSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxToolBar),
wxe_util:cast(?wxToolBar_SetToolBitmapSize,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxToolBar(), Toolid::integer(), HelpString::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarsettoollonghelp">external documentation</a>.
+-spec setToolLongHelp(This, Toolid, HelpString) -> ok when
+ This::wxToolBar(), Toolid::integer(), HelpString::unicode:chardata().
setToolLongHelp(#wx_ref{type=ThisT,ref=ThisRef},Toolid,HelpString)
when is_integer(Toolid),is_list(HelpString) ->
?CLASS(ThisT,wxToolBar),
@@ -521,16 +610,18 @@ setToolLongHelp(#wx_ref{type=ThisT,ref=ThisRef},Toolid,HelpString)
wxe_util:cast(?wxToolBar_SetToolLongHelp,
<<ThisRef:32/?UI,Toolid:32/?UI,(byte_size(HelpString_UC)):32/?UI,(HelpString_UC)/binary, 0:(((8- ((4+byte_size(HelpString_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxToolBar(), Packing::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarsettoolpacking">external documentation</a>.
+-spec setToolPacking(This, Packing) -> ok when
+ This::wxToolBar(), Packing::integer().
setToolPacking(#wx_ref{type=ThisT,ref=ThisRef},Packing)
when is_integer(Packing) ->
?CLASS(ThisT,wxToolBar),
wxe_util:cast(?wxToolBar_SetToolPacking,
<<ThisRef:32/?UI,Packing:32/?UI>>).
-%% @spec (This::wxToolBar(), Id::integer(), HelpString::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarsettoolshorthelp">external documentation</a>.
+-spec setToolShortHelp(This, Id, HelpString) -> ok when
+ This::wxToolBar(), Id::integer(), HelpString::unicode:chardata().
setToolShortHelp(#wx_ref{type=ThisT,ref=ThisRef},Id,HelpString)
when is_integer(Id),is_list(HelpString) ->
?CLASS(ThisT,wxToolBar),
@@ -538,16 +629,18 @@ setToolShortHelp(#wx_ref{type=ThisT,ref=ThisRef},Id,HelpString)
wxe_util:cast(?wxToolBar_SetToolShortHelp,
<<ThisRef:32/?UI,Id:32/?UI,(byte_size(HelpString_UC)):32/?UI,(HelpString_UC)/binary, 0:(((8- ((4+byte_size(HelpString_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxToolBar(), Separation::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbarsettoolseparation">external documentation</a>.
+-spec setToolSeparation(This, Separation) -> ok when
+ This::wxToolBar(), Separation::integer().
setToolSeparation(#wx_ref{type=ThisT,ref=ThisRef},Separation)
when is_integer(Separation) ->
?CLASS(ThisT,wxToolBar),
wxe_util:cast(?wxToolBar_SetToolSeparation,
<<ThisRef:32/?UI,Separation:32/?UI>>).
-%% @spec (This::wxToolBar(), Toolid::integer(), Toggle::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbar.html#wxtoolbartoggletool">external documentation</a>.
+-spec toggleTool(This, Toolid, Toggle) -> ok when
+ This::wxToolBar(), Toolid::integer(), Toggle::boolean().
toggleTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,Toggle)
when is_integer(Toolid),is_boolean(Toggle) ->
?CLASS(ThisT,wxToolBar),
diff --git a/lib/wx/src/gen/wxToolTip.erl b/lib/wx/src/gen/wxToolTip.erl
index b0749c851a..e9b5510357 100644
--- a/lib/wx/src/gen/wxToolTip.erl
+++ b/lib/wx/src/gen/wxToolTip.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -29,33 +29,39 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxToolTip/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Flag::bool()) -> ok
+-type wxToolTip() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtooltip.html#wxtooltipenable">external documentation</a>.
+-spec enable(Flag) -> ok when
+ Flag::boolean().
enable(Flag)
when is_boolean(Flag) ->
wxe_util:cast(?wxToolTip_Enable,
<<(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec (Msecs::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtooltip.html#wxtooltipsetdelay">external documentation</a>.
+-spec setDelay(Msecs) -> ok when
+ Msecs::integer().
setDelay(Msecs)
when is_integer(Msecs) ->
wxe_util:cast(?wxToolTip_SetDelay,
<<Msecs:32/?UI>>).
-%% @spec (Tip::string()) -> wxToolTip()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtooltip.html#wxtooltipwxtooltip">external documentation</a>.
+-spec new(Tip) -> wxToolTip() when
+ Tip::unicode:chardata().
new(Tip)
when is_list(Tip) ->
Tip_UC = unicode:characters_to_binary([Tip,0]),
wxe_util:construct(?wxToolTip_new,
<<(byte_size(Tip_UC)):32/?UI,(Tip_UC)/binary, 0:(((8- ((4+byte_size(Tip_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxToolTip(), Tip::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtooltip.html#wxtooltipsettip">external documentation</a>.
+-spec setTip(This, Tip) -> ok when
+ This::wxToolTip(), Tip::unicode:chardata().
setTip(#wx_ref{type=ThisT,ref=ThisRef},Tip)
when is_list(Tip) ->
?CLASS(ThisT,wxToolTip),
@@ -63,22 +69,24 @@ setTip(#wx_ref{type=ThisT,ref=ThisRef},Tip)
wxe_util:cast(?wxToolTip_SetTip,
<<ThisRef:32/?UI,(byte_size(Tip_UC)):32/?UI,(Tip_UC)/binary, 0:(((8- ((0+byte_size(Tip_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxToolTip()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtooltip.html#wxtooltipgettip">external documentation</a>.
+-spec getTip(This) -> unicode:charlist() when
+ This::wxToolTip().
getTip(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxToolTip),
wxe_util:call(?wxToolTip_GetTip,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxToolTip()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtooltip.html#wxtooltipgetwindow">external documentation</a>.
+-spec getWindow(This) -> wxWindow:wxWindow() when
+ This::wxToolTip().
getWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxToolTip),
wxe_util:call(?wxToolTip_GetWindow,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxToolTip()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxToolTip()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxToolTip),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxToolbook.erl b/lib/wx/src/gen/wxToolbook.erl
index 764f66c2e5..9172f7a2d9 100644
--- a/lib/wx/src/gen/wxToolbook.erl
+++ b/lib/wx/src/gen/wxToolbook.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -74,27 +74,34 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxToolbook/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxToolbook()
+-type wxToolbook() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookwxtoolbook">external documentation</a>.
+-spec new() -> wxToolbook().
new() ->
wxe_util:construct(?wxToolbook_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxToolbook()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxToolbook() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxToolbook()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookwxtoolbook">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxToolbook() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -106,15 +113,19 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxToolbook_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxToolbook(), Page::wxWindow:wxWindow(), Text::string()) -> bool()
%% @equiv addPage(This,Page,Text, [])
+-spec addPage(This, Page, Text) -> boolean() when
+ This::wxToolbook(), Page::wxWindow:wxWindow(), Text::unicode:chardata().
+
addPage(This,Page,Text)
when is_record(This, wx_ref),is_record(Page, wx_ref),is_list(Text) ->
addPage(This,Page,Text, []).
-%% @spec (This::wxToolbook(), Page::wxWindow:wxWindow(), Text::string(), [Option]) -> bool()
-%% Option = {bSelect, bool()} | {imageId, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookaddpage">external documentation</a>.
+-spec addPage(This, Page, Text, [Option]) -> boolean() when
+ This::wxToolbook(), Page::wxWindow:wxWindow(), Text::unicode:chardata(),
+ Option :: {bSelect, boolean()}
+ | {imageId, integer()}.
addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Text, Options)
when is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxToolbook),
@@ -127,15 +138,18 @@ addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Text, Op
wxe_util:call(?wxToolbook_AddPage,
<<ThisRef:32/?UI,PageRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxToolbook()) -> ok
%% @equiv advanceSelection(This, [])
+-spec advanceSelection(This) -> ok when
+ This::wxToolbook().
+
advanceSelection(This)
when is_record(This, wx_ref) ->
advanceSelection(This, []).
-%% @spec (This::wxToolbook(), [Option]) -> ok
-%% Option = {forward, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookadvanceselection">external documentation</a>.
+-spec advanceSelection(This, [Option]) -> ok when
+ This::wxToolbook(),
+ Option :: {forward, boolean()}.
advanceSelection(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxToolbook),
@@ -145,23 +159,29 @@ advanceSelection(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxToolbook_AdvanceSelection,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxToolbook(), ImageList::wxImageList:wxImageList()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookassignimagelist">external documentation</a>.
+-spec assignImageList(This, ImageList) -> ok when
+ This::wxToolbook(), ImageList::wxImageList:wxImageList().
assignImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef}) ->
?CLASS(ThisT,wxToolbook),
?CLASS(ImageListT,wxImageList),
wxe_util:cast(?wxToolbook_AssignImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI>>).
-%% @spec (This::wxToolbook(), Parent::wxWindow:wxWindow(), Id::integer()) -> bool()
%% @equiv create(This,Parent,Id, [])
+-spec create(This, Parent, Id) -> boolean() when
+ This::wxToolbook(), Parent::wxWindow:wxWindow(), Id::integer().
+
create(This,Parent,Id)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id) ->
create(This,Parent,Id, []).
-%% @spec (This::wxToolbook(), Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookcreate">external documentation</a>.
+-spec create(This, Parent, Id, [Option]) -> boolean() when
+ This::wxToolbook(), Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ThisT,wxToolbook),
@@ -174,98 +194,114 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, O
wxe_util:call(?wxToolbook_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxToolbook()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookdeleteallpages">external documentation</a>.
+-spec deleteAllPages(This) -> boolean() when
+ This::wxToolbook().
deleteAllPages(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxToolbook),
wxe_util:call(?wxToolbook_DeleteAllPages,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxToolbook(), N::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookdeletepage">external documentation</a>.
+-spec deletePage(This, N) -> boolean() when
+ This::wxToolbook(), N::integer().
deletePage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxToolbook),
wxe_util:call(?wxToolbook_DeletePage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxToolbook(), N::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookremovepage">external documentation</a>.
+-spec removePage(This, N) -> boolean() when
+ This::wxToolbook(), N::integer().
removePage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxToolbook),
wxe_util:call(?wxToolbook_RemovePage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxToolbook()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookgetcurrentpage">external documentation</a>.
+-spec getCurrentPage(This) -> wxWindow:wxWindow() when
+ This::wxToolbook().
getCurrentPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxToolbook),
wxe_util:call(?wxToolbook_GetCurrentPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxToolbook()) -> wxImageList:wxImageList()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookgetimagelist">external documentation</a>.
+-spec getImageList(This) -> wxImageList:wxImageList() when
+ This::wxToolbook().
getImageList(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxToolbook),
wxe_util:call(?wxToolbook_GetImageList,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxToolbook(), N::integer()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookgetpage">external documentation</a>.
+-spec getPage(This, N) -> wxWindow:wxWindow() when
+ This::wxToolbook(), N::integer().
getPage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxToolbook),
wxe_util:call(?wxToolbook_GetPage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxToolbook()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookgetpagecount">external documentation</a>.
+-spec getPageCount(This) -> integer() when
+ This::wxToolbook().
getPageCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxToolbook),
wxe_util:call(?wxToolbook_GetPageCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxToolbook(), N::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookgetpageimage">external documentation</a>.
+-spec getPageImage(This, N) -> integer() when
+ This::wxToolbook(), N::integer().
getPageImage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxToolbook),
wxe_util:call(?wxToolbook_GetPageImage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxToolbook(), N::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookgetpagetext">external documentation</a>.
+-spec getPageText(This, N) -> unicode:charlist() when
+ This::wxToolbook(), N::integer().
getPageText(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxToolbook),
wxe_util:call(?wxToolbook_GetPageText,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxToolbook()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookgetselection">external documentation</a>.
+-spec getSelection(This) -> integer() when
+ This::wxToolbook().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxToolbook),
wxe_util:call(?wxToolbook_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxToolbook(), Pt::{X::integer(), Y::integer()}) -> {integer(), Flags::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookhittest">external documentation</a>.
+-spec hitTest(This, Pt) -> Result when
+ Result ::{Res ::integer(), Flags::integer()},
+ This::wxToolbook(), Pt::{X::integer(), Y::integer()}.
hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxToolbook),
wxe_util:call(?wxToolbook_HitTest,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxToolbook(), N::integer(), Page::wxWindow:wxWindow(), Text::string()) -> bool()
%% @equiv insertPage(This,N,Page,Text, [])
+-spec insertPage(This, N, Page, Text) -> boolean() when
+ This::wxToolbook(), N::integer(), Page::wxWindow:wxWindow(), Text::unicode:chardata().
+
insertPage(This,N,Page,Text)
when is_record(This, wx_ref),is_integer(N),is_record(Page, wx_ref),is_list(Text) ->
insertPage(This,N,Page,Text, []).
-%% @spec (This::wxToolbook(), N::integer(), Page::wxWindow:wxWindow(), Text::string(), [Option]) -> bool()
-%% Option = {bSelect, bool()} | {imageId, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookinsertpage">external documentation</a>.
+-spec insertPage(This, N, Page, Text, [Option]) -> boolean() when
+ This::wxToolbook(), N::integer(), Page::wxWindow:wxWindow(), Text::unicode:chardata(),
+ Option :: {bSelect, boolean()}
+ | {imageId, integer()}.
insertPage(#wx_ref{type=ThisT,ref=ThisRef},N,#wx_ref{type=PageT,ref=PageRef},Text, Options)
when is_integer(N),is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxToolbook),
@@ -278,32 +314,36 @@ insertPage(#wx_ref{type=ThisT,ref=ThisRef},N,#wx_ref{type=PageT,ref=PageRef},Tex
wxe_util:call(?wxToolbook_InsertPage,
<<ThisRef:32/?UI,N:32/?UI,PageRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxToolbook(), ImageList::wxImageList:wxImageList()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbooksetimagelist">external documentation</a>.
+-spec setImageList(This, ImageList) -> ok when
+ This::wxToolbook(), ImageList::wxImageList:wxImageList().
setImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef}) ->
?CLASS(ThisT,wxToolbook),
?CLASS(ImageListT,wxImageList),
wxe_util:cast(?wxToolbook_SetImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI>>).
-%% @spec (This::wxToolbook(), Size::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbooksetpagesize">external documentation</a>.
+-spec setPageSize(This, Size) -> ok when
+ This::wxToolbook(), Size::{W::integer(), H::integer()}.
setPageSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxToolbook),
wxe_util:cast(?wxToolbook_SetPageSize,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxToolbook(), N::integer(), ImageId::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbooksetpageimage">external documentation</a>.
+-spec setPageImage(This, N, ImageId) -> boolean() when
+ This::wxToolbook(), N::integer(), ImageId::integer().
setPageImage(#wx_ref{type=ThisT,ref=ThisRef},N,ImageId)
when is_integer(N),is_integer(ImageId) ->
?CLASS(ThisT,wxToolbook),
wxe_util:call(?wxToolbook_SetPageImage,
<<ThisRef:32/?UI,N:32/?UI,ImageId:32/?UI>>).
-%% @spec (This::wxToolbook(), N::integer(), StrText::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbooksetpagetext">external documentation</a>.
+-spec setPageText(This, N, StrText) -> boolean() when
+ This::wxToolbook(), N::integer(), StrText::unicode:chardata().
setPageText(#wx_ref{type=ThisT,ref=ThisRef},N,StrText)
when is_integer(N),is_list(StrText) ->
?CLASS(ThisT,wxToolbook),
@@ -311,24 +351,26 @@ setPageText(#wx_ref{type=ThisT,ref=ThisRef},N,StrText)
wxe_util:call(?wxToolbook_SetPageText,
<<ThisRef:32/?UI,N:32/?UI,(byte_size(StrText_UC)):32/?UI,(StrText_UC)/binary, 0:(((8- ((4+byte_size(StrText_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxToolbook(), N::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbooksetselection">external documentation</a>.
+-spec setSelection(This, N) -> integer() when
+ This::wxToolbook(), N::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxToolbook),
wxe_util:call(?wxToolbook_SetSelection,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxToolbook(), N::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoolbook.html#wxtoolbookchangeselection">external documentation</a>.
+-spec changeSelection(This, N) -> integer() when
+ This::wxToolbook(), N::integer().
changeSelection(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxToolbook),
wxe_util:call(?wxToolbook_ChangeSelection,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxToolbook()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxToolbook()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxToolbook),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxTopLevelWindow.erl b/lib/wx/src/gen/wxTopLevelWindow.erl
index e0551b480f..5659c0927f 100644
--- a/lib/wx/src/gen/wxTopLevelWindow.erl
+++ b/lib/wx/src/gen/wxTopLevelWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -72,48 +72,57 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxTopLevelWindow/0]).
%% @hidden
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxTopLevelWindow()) -> wxIcon:wxIcon()
+-type wxTopLevelWindow() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowgeticon">external documentation</a>.
+-spec getIcon(This) -> wxIcon:wxIcon() when
+ This::wxTopLevelWindow().
getIcon(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTopLevelWindow),
wxe_util:call(?wxTopLevelWindow_GetIcon,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTopLevelWindow()) -> wxIconBundle:wxIconBundle()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowgeticons">external documentation</a>.
+-spec getIcons(This) -> wxIconBundle:wxIconBundle() when
+ This::wxTopLevelWindow().
getIcons(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTopLevelWindow),
wxe_util:call(?wxTopLevelWindow_GetIcons,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTopLevelWindow()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowgettitle">external documentation</a>.
+-spec getTitle(This) -> unicode:charlist() when
+ This::wxTopLevelWindow().
getTitle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTopLevelWindow),
wxe_util:call(?wxTopLevelWindow_GetTitle,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTopLevelWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowisactive">external documentation</a>.
+-spec isActive(This) -> boolean() when
+ This::wxTopLevelWindow().
isActive(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTopLevelWindow),
wxe_util:call(?wxTopLevelWindow_IsActive,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTopLevelWindow()) -> ok
%% @equiv iconize(This, [])
+-spec iconize(This) -> ok when
+ This::wxTopLevelWindow().
+
iconize(This)
when is_record(This, wx_ref) ->
iconize(This, []).
-%% @spec (This::wxTopLevelWindow(), [Option]) -> ok
-%% Option = {iconize, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowiconize">external documentation</a>.
+-spec iconize(This, [Option]) -> ok when
+ This::wxTopLevelWindow(),
+ Option :: {iconize, boolean()}.
iconize(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxTopLevelWindow),
@@ -123,36 +132,42 @@ iconize(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxTopLevelWindow_Iconize,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxTopLevelWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowisfullscreen">external documentation</a>.
+-spec isFullScreen(This) -> boolean() when
+ This::wxTopLevelWindow().
isFullScreen(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTopLevelWindow),
wxe_util:call(?wxTopLevelWindow_IsFullScreen,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTopLevelWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowisiconized">external documentation</a>.
+-spec isIconized(This) -> boolean() when
+ This::wxTopLevelWindow().
isIconized(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTopLevelWindow),
wxe_util:call(?wxTopLevelWindow_IsIconized,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTopLevelWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowismaximized">external documentation</a>.
+-spec isMaximized(This) -> boolean() when
+ This::wxTopLevelWindow().
isMaximized(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTopLevelWindow),
wxe_util:call(?wxTopLevelWindow_IsMaximized,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTopLevelWindow()) -> ok
%% @equiv maximize(This, [])
+-spec maximize(This) -> ok when
+ This::wxTopLevelWindow().
+
maximize(This)
when is_record(This, wx_ref) ->
maximize(This, []).
-%% @spec (This::wxTopLevelWindow(), [Option]) -> ok
-%% Option = {maximize, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowmaximize">external documentation</a>.
+-spec maximize(This, [Option]) -> ok when
+ This::wxTopLevelWindow(),
+ Option :: {maximize, boolean()}.
maximize(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxTopLevelWindow),
@@ -162,15 +177,18 @@ maximize(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxTopLevelWindow_Maximize,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxTopLevelWindow()) -> ok
%% @equiv requestUserAttention(This, [])
+-spec requestUserAttention(This) -> ok when
+ This::wxTopLevelWindow().
+
requestUserAttention(This)
when is_record(This, wx_ref) ->
requestUserAttention(This, []).
-%% @spec (This::wxTopLevelWindow(), [Option]) -> ok
-%% Option = {flags, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowrequestuserattention">external documentation</a>.
+-spec requestUserAttention(This, [Option]) -> ok when
+ This::wxTopLevelWindow(),
+ Option :: {flags, integer()}.
requestUserAttention(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxTopLevelWindow),
@@ -180,31 +198,36 @@ requestUserAttention(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxTopLevelWindow_RequestUserAttention,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxTopLevelWindow(), Icon::wxIcon:wxIcon()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowseticon">external documentation</a>.
+-spec setIcon(This, Icon) -> ok when
+ This::wxTopLevelWindow(), Icon::wxIcon:wxIcon().
setIcon(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=IconT,ref=IconRef}) ->
?CLASS(ThisT,wxTopLevelWindow),
?CLASS(IconT,wxIcon),
wxe_util:cast(?wxTopLevelWindow_SetIcon,
<<ThisRef:32/?UI,IconRef:32/?UI>>).
-%% @spec (This::wxTopLevelWindow(), Icons::wxIconBundle:wxIconBundle()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowseticons">external documentation</a>.
+-spec setIcons(This, Icons) -> ok when
+ This::wxTopLevelWindow(), Icons::wxIconBundle:wxIconBundle().
setIcons(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=IconsT,ref=IconsRef}) ->
?CLASS(ThisT,wxTopLevelWindow),
?CLASS(IconsT,wxIconBundle),
wxe_util:cast(?wxTopLevelWindow_SetIcons,
<<ThisRef:32/?UI,IconsRef:32/?UI>>).
-%% @spec (This::wxTopLevelWindow()) -> ok
%% @equiv centerOnScreen(This, [])
+-spec centerOnScreen(This) -> ok when
+ This::wxTopLevelWindow().
+
centerOnScreen(This)
when is_record(This, wx_ref) ->
centerOnScreen(This, []).
-%% @spec (This::wxTopLevelWindow(), [Option]) -> ok
-%% Option = {dir, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowcenteronscreen">external documentation</a>.
+-spec centerOnScreen(This, [Option]) -> ok when
+ This::wxTopLevelWindow(),
+ Option :: {dir, integer()}.
centerOnScreen(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxTopLevelWindow),
@@ -214,15 +237,18 @@ centerOnScreen(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxTopLevelWindow_CenterOnScreen,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxTopLevelWindow()) -> ok
%% @equiv centreOnScreen(This, [])
+-spec centreOnScreen(This) -> ok when
+ This::wxTopLevelWindow().
+
centreOnScreen(This)
when is_record(This, wx_ref) ->
centreOnScreen(This, []).
-%% @spec (This::wxTopLevelWindow(), [Option]) -> ok
-%% Option = {dir, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowcentreonscreen">external documentation</a>.
+-spec centreOnScreen(This, [Option]) -> ok when
+ This::wxTopLevelWindow(),
+ Option :: {dir, integer()}.
centreOnScreen(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxTopLevelWindow),
@@ -232,16 +258,18 @@ centreOnScreen(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxTopLevelWindow_CentreOnScreen,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxTopLevelWindow(), Region::wxRegion:wxRegion()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowsetshape">external documentation</a>.
+-spec setShape(This, Region) -> boolean() when
+ This::wxTopLevelWindow(), Region::wxRegion:wxRegion().
setShape(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=RegionT,ref=RegionRef}) ->
?CLASS(ThisT,wxTopLevelWindow),
?CLASS(RegionT,wxRegion),
wxe_util:call(?wxTopLevelWindow_SetShape,
<<ThisRef:32/?UI,RegionRef:32/?UI>>).
-%% @spec (This::wxTopLevelWindow(), Title::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowsettitle">external documentation</a>.
+-spec setTitle(This, Title) -> ok when
+ This::wxTopLevelWindow(), Title::unicode:chardata().
setTitle(#wx_ref{type=ThisT,ref=ThisRef},Title)
when is_list(Title) ->
?CLASS(ThisT,wxTopLevelWindow),
@@ -249,15 +277,18 @@ setTitle(#wx_ref{type=ThisT,ref=ThisRef},Title)
wxe_util:cast(?wxTopLevelWindow_SetTitle,
<<ThisRef:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((0+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxTopLevelWindow(), Show::bool()) -> bool()
%% @equiv showFullScreen(This,Show, [])
+-spec showFullScreen(This, Show) -> boolean() when
+ This::wxTopLevelWindow(), Show::boolean().
+
showFullScreen(This,Show)
when is_record(This, wx_ref),is_boolean(Show) ->
showFullScreen(This,Show, []).
-%% @spec (This::wxTopLevelWindow(), Show::bool(), [Option]) -> bool()
-%% Option = {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowshowfullscreen">external documentation</a>.
+-spec showFullScreen(This, Show, [Option]) -> boolean() when
+ This::wxTopLevelWindow(), Show::boolean(),
+ Option :: {style, integer()}.
showFullScreen(#wx_ref{type=ThisT,ref=ThisRef},Show, Options)
when is_boolean(Show),is_list(Options) ->
?CLASS(ThisT,wxTopLevelWindow),
diff --git a/lib/wx/src/gen/wxTreeCtrl.erl b/lib/wx/src/gen/wxTreeCtrl.erl
index 77705ec76e..dfa9e691ce 100644
--- a/lib/wx/src/gen/wxTreeCtrl.erl
+++ b/lib/wx/src/gen/wxTreeCtrl.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -89,27 +89,36 @@
show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,update/1,
updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxTreeCtrl/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxTreeCtrl()
+-type wxTreeCtrl() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlwxtreectrl">external documentation</a>.
+-spec new() -> wxTreeCtrl().
new() ->
wxe_util:construct(?wxTreeCtrl_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow()) -> wxTreeCtrl()
%% @equiv new(Parent, [])
+-spec new(Parent) -> wxTreeCtrl() when
+ Parent::wxWindow:wxWindow().
+
new(Parent)
when is_record(Parent, wx_ref) ->
new(Parent, []).
-%% @spec (Parent::wxWindow:wxWindow(), [Option]) -> wxTreeCtrl()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlwxtreectrl">external documentation</a>.
+-spec new(Parent, [Option]) -> wxTreeCtrl() when
+ Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -123,15 +132,20 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options)
wxe_util:construct(?wxTreeCtrl_new_2,
<<ParentRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxTreeCtrl(), Text::string()) -> integer()
%% @equiv addRoot(This,Text, [])
+-spec addRoot(This, Text) -> integer() when
+ This::wxTreeCtrl(), Text::unicode:chardata().
+
addRoot(This,Text)
when is_record(This, wx_ref),is_list(Text) ->
addRoot(This,Text, []).
-%% @spec (This::wxTreeCtrl(), Text::string(), [Option]) -> integer()
-%% Option = {image, integer()} | {selectedImage, integer()} | {data, term()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrladdroot">external documentation</a>.
+-spec addRoot(This, Text, [Option]) -> integer() when
+ This::wxTreeCtrl(), Text::unicode:chardata(),
+ Option :: {image, integer()}
+ | {selectedImage, integer()}
+ | {data, term()}.
addRoot(#wx_ref{type=ThisT,ref=ThisRef},Text, Options)
when is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -144,15 +158,20 @@ addRoot(#wx_ref{type=ThisT,ref=ThisRef},Text, Options)
wxe_util:call(?wxTreeCtrl_AddRoot,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxTreeCtrl(), Parent::integer(), Text::string()) -> integer()
%% @equiv appendItem(This,Parent,Text, [])
+-spec appendItem(This, Parent, Text) -> integer() when
+ This::wxTreeCtrl(), Parent::integer(), Text::unicode:chardata().
+
appendItem(This,Parent,Text)
when is_record(This, wx_ref),is_integer(Parent),is_list(Text) ->
appendItem(This,Parent,Text, []).
-%% @spec (This::wxTreeCtrl(), Parent::integer(), Text::string(), [Option]) -> integer()
-%% Option = {image, integer()} | {selectedImage, integer()} | {data, term()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlappenditem">external documentation</a>.
+-spec appendItem(This, Parent, Text, [Option]) -> integer() when
+ This::wxTreeCtrl(), Parent::integer(), Text::unicode:chardata(),
+ Option :: {image, integer()}
+ | {selectedImage, integer()}
+ | {data, term()}.
appendItem(#wx_ref{type=ThisT,ref=ThisRef},Parent,Text, Options)
when is_integer(Parent),is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -165,47 +184,58 @@ appendItem(#wx_ref{type=ThisT,ref=ThisRef},Parent,Text, Options)
wxe_util:call(?wxTreeCtrl_AppendItem,
<<ThisRef:32/?UI,0:32,Parent:64/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxTreeCtrl(), ImageList::wxImageList:wxImageList()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlassignimagelist">external documentation</a>.
+-spec assignImageList(This, ImageList) -> ok when
+ This::wxTreeCtrl(), ImageList::wxImageList:wxImageList().
assignImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef}) ->
?CLASS(ThisT,wxTreeCtrl),
?CLASS(ImageListT,wxImageList),
wxe_util:cast(?wxTreeCtrl_AssignImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl(), ImageList::wxImageList:wxImageList()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlassignstateimagelist">external documentation</a>.
+-spec assignStateImageList(This, ImageList) -> ok when
+ This::wxTreeCtrl(), ImageList::wxImageList:wxImageList().
assignStateImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef}) ->
?CLASS(ThisT,wxTreeCtrl),
?CLASS(ImageListT,wxImageList),
wxe_util:cast(?wxTreeCtrl_AssignStateImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlcollapse">external documentation</a>.
+-spec collapse(This, Item) -> ok when
+ This::wxTreeCtrl(), Item::integer().
collapse(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_Collapse,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlcollapseandreset">external documentation</a>.
+-spec collapseAndReset(This, Item) -> ok when
+ This::wxTreeCtrl(), Item::integer().
collapseAndReset(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_CollapseAndReset,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Parent::wxWindow:wxWindow()) -> bool()
%% @equiv create(This,Parent, [])
+-spec create(This, Parent) -> boolean() when
+ This::wxTreeCtrl(), Parent::wxWindow:wxWindow().
+
create(This,Parent)
when is_record(This, wx_ref),is_record(Parent, wx_ref) ->
create(This,Parent, []).
-%% @spec (This::wxTreeCtrl(), Parent::wxWindow:wxWindow(), [Option]) -> bool()
-%% Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} | {validator, wx:wx()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlcreate">external documentation</a>.
+-spec create(This, Parent, [Option]) -> boolean() when
+ This::wxTreeCtrl(), Parent::wxWindow:wxWindow(),
+ Option :: {id, integer()}
+ | {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}
+ | {validator, wx:wx_object()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -220,62 +250,71 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Opti
wxe_util:call(?wxTreeCtrl_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrldelete">external documentation</a>.
+-spec delete(This, Item) -> ok when
+ This::wxTreeCtrl(), Item::integer().
delete(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_Delete,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrldeleteallitems">external documentation</a>.
+-spec deleteAllItems(This) -> ok when
+ This::wxTreeCtrl().
deleteAllItems(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_DeleteAllItems,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrldeletechildren">external documentation</a>.
+-spec deleteChildren(This, Item) -> ok when
+ This::wxTreeCtrl(), Item::integer().
deleteChildren(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_DeleteChildren,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> wxTextCtrl:wxTextCtrl()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrleditlabel">external documentation</a>.
+-spec editLabel(This, Item) -> wxTextCtrl:wxTextCtrl() when
+ This::wxTreeCtrl(), Item::integer().
editLabel(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_EditLabel,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlensurevisible">external documentation</a>.
+-spec ensureVisible(This, Item) -> ok when
+ This::wxTreeCtrl(), Item::integer().
ensureVisible(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_EnsureVisible,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlexpand">external documentation</a>.
+-spec expand(This, Item) -> ok when
+ This::wxTreeCtrl(), Item::integer().
expand(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_Expand,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> bool()
%% @equiv getBoundingRect(This,Item,Rect, [])
+-spec getBoundingRect(This, Item, Rect) -> boolean() when
+ This::wxTreeCtrl(), Item::integer(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
+
getBoundingRect(This,Item,Rect={RectX,RectY,RectW,RectH})
when is_record(This, wx_ref),is_integer(Item),is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) ->
getBoundingRect(This,Item,Rect, []).
-%% @spec (This::wxTreeCtrl(), Item::integer(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, [Option]) -> bool()
-%% Option = {textOnly, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetboundingrect">external documentation</a>.
+-spec getBoundingRect(This, Item, Rect, [Option]) -> boolean() when
+ This::wxTreeCtrl(), Item::integer(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()},
+ Option :: {textOnly, boolean()}.
getBoundingRect(#wx_ref{type=ThisT,ref=ThisRef},Item,{RectX,RectY,RectW,RectH}, Options)
when is_integer(Item),is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH),is_list(Options) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -285,15 +324,18 @@ getBoundingRect(#wx_ref{type=ThisT,ref=ThisRef},Item,{RectX,RectY,RectW,RectH},
wxe_util:call(?wxTreeCtrl_GetBoundingRect,
<<ThisRef:32/?UI,0:32,Item:64/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> integer()
%% @equiv getChildrenCount(This,Item, [])
+-spec getChildrenCount(This, Item) -> integer() when
+ This::wxTreeCtrl(), Item::integer().
+
getChildrenCount(This,Item)
when is_record(This, wx_ref),is_integer(Item) ->
getChildrenCount(This,Item, []).
-%% @spec (This::wxTreeCtrl(), Item::integer(), [Option]) -> integer()
-%% Option = {recursively, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetchildrencount">external documentation</a>.
+-spec getChildrenCount(This, Item, [Option]) -> integer() when
+ This::wxTreeCtrl(), Item::integer(),
+ Option :: {recursively, boolean()}.
getChildrenCount(#wx_ref{type=ThisT,ref=ThisRef},Item, Options)
when is_integer(Item),is_list(Options) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -303,94 +345,107 @@ getChildrenCount(#wx_ref{type=ThisT,ref=ThisRef},Item, Options)
wxe_util:call(?wxTreeCtrl_GetChildrenCount,
<<ThisRef:32/?UI,0:32,Item:64/?UI, BinOpt/binary>>).
-%% @spec (This::wxTreeCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetcount">external documentation</a>.
+-spec getCount(This) -> integer() when
+ This::wxTreeCtrl().
getCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl()) -> wxTextCtrl:wxTextCtrl()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgeteditcontrol">external documentation</a>.
+-spec getEditControl(This) -> wxTextCtrl:wxTextCtrl() when
+ This::wxTreeCtrl().
getEditControl(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetEditControl,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> {integer(), Cookie::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetfirstchild">external documentation</a>.
+-spec getFirstChild(This, Item) -> Result when
+ Result ::{Res ::integer(), Cookie::integer()},
+ This::wxTreeCtrl(), Item::integer().
getFirstChild(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetFirstChild,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer(), Cookie::integer()) -> {integer(), Cookie::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetnextchild">external documentation</a>.
+-spec getNextChild(This, Item, Cookie) -> Result when
+ Result ::{Res ::integer(), Cookie::integer()},
+ This::wxTreeCtrl(), Item::integer(), Cookie::integer().
getNextChild(#wx_ref{type=ThisT,ref=ThisRef},Item,Cookie)
when is_integer(Item),is_integer(Cookie) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetNextChild,
<<ThisRef:32/?UI,0:32,Item:64/?UI,Cookie:64/?UI>>).
-%% @spec (This::wxTreeCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetfirstvisibleitem">external documentation</a>.
+-spec getFirstVisibleItem(This) -> integer() when
+ This::wxTreeCtrl().
getFirstVisibleItem(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetFirstVisibleItem,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl()) -> wxImageList:wxImageList()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetimagelist">external documentation</a>.
+-spec getImageList(This) -> wxImageList:wxImageList() when
+ This::wxTreeCtrl().
getImageList(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetImageList,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetindent">external documentation</a>.
+-spec getIndent(This) -> integer() when
+ This::wxTreeCtrl().
getIndent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetIndent,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetitembackgroundcolour">external documentation</a>.
+-spec getItemBackgroundColour(This, Item) -> wx:wx_colour4() when
+ This::wxTreeCtrl(), Item::integer().
getItemBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetItemBackgroundColour,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> term()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetitemdata">external documentation</a>.
+-spec getItemData(This, Item) -> term() when
+ This::wxTreeCtrl(), Item::integer().
getItemData(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetItemData,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> wxFont:wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetitemfont">external documentation</a>.
+-spec getItemFont(This, Item) -> wxFont:wxFont() when
+ This::wxTreeCtrl(), Item::integer().
getItemFont(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetItemFont,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetitemimage">external documentation</a>.
+-spec getItemImage(This, Item) -> integer() when
+ This::wxTreeCtrl(), Item::integer().
getItemImage(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetItemImage_1,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer(), [Option]) -> integer()
-%% Option = {which, WxTreeItemIcon}
-%% WxTreeItemIcon = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetitemimage">external documentation</a>.
-%%<br /> WxTreeItemIcon is one of ?wxTreeItemIcon_Normal | ?wxTreeItemIcon_Selected | ?wxTreeItemIcon_Expanded | ?wxTreeItemIcon_SelectedExpanded | ?wxTreeItemIcon_Max
+%%<br /> Which = ?wxTreeItemIcon_Normal | ?wxTreeItemIcon_Selected | ?wxTreeItemIcon_Expanded | ?wxTreeItemIcon_SelectedExpanded | ?wxTreeItemIcon_Max
+-spec getItemImage(This, Item, [Option]) -> integer() when
+ This::wxTreeCtrl(), Item::integer(),
+ Option :: {which, wx:wx_enum()}.
getItemImage(#wx_ref{type=ThisT,ref=ThisRef},Item, Options)
when is_integer(Item),is_list(Options) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -400,115 +455,134 @@ getItemImage(#wx_ref{type=ThisT,ref=ThisRef},Item, Options)
wxe_util:call(?wxTreeCtrl_GetItemImage_2,
<<ThisRef:32/?UI,0:32,Item:64/?UI, BinOpt/binary>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetitemtext">external documentation</a>.
+-spec getItemText(This, Item) -> unicode:charlist() when
+ This::wxTreeCtrl(), Item::integer().
getItemText(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetItemText,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetitemtextcolour">external documentation</a>.
+-spec getItemTextColour(This, Item) -> wx:wx_colour4() when
+ This::wxTreeCtrl(), Item::integer().
getItemTextColour(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetItemTextColour,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetlastchild">external documentation</a>.
+-spec getLastChild(This, Item) -> integer() when
+ This::wxTreeCtrl(), Item::integer().
getLastChild(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetLastChild,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetnextsibling">external documentation</a>.
+-spec getNextSibling(This, Item) -> integer() when
+ This::wxTreeCtrl(), Item::integer().
getNextSibling(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetNextSibling,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetnextvisible">external documentation</a>.
+-spec getNextVisible(This, Item) -> integer() when
+ This::wxTreeCtrl(), Item::integer().
getNextVisible(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetNextVisible,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetitemparent">external documentation</a>.
+-spec getItemParent(This, Item) -> integer() when
+ This::wxTreeCtrl(), Item::integer().
getItemParent(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetItemParent,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetprevsibling">external documentation</a>.
+-spec getPrevSibling(This, Item) -> integer() when
+ This::wxTreeCtrl(), Item::integer().
getPrevSibling(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetPrevSibling,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetprevvisible">external documentation</a>.
+-spec getPrevVisible(This, Item) -> integer() when
+ This::wxTreeCtrl(), Item::integer().
getPrevVisible(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetPrevVisible,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetrootitem">external documentation</a>.
+-spec getRootItem(This) -> integer() when
+ This::wxTreeCtrl().
getRootItem(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetRootItem,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetselection">external documentation</a>.
+-spec getSelection(This) -> integer() when
+ This::wxTreeCtrl().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl()) -> {integer(), Val::[integer()]}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetselections">external documentation</a>.
+-spec getSelections(This) -> Result when
+ Result ::{Res ::integer(), Val::[integer()]},
+ This::wxTreeCtrl().
getSelections(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetSelections,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl()) -> wxImageList:wxImageList()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlgetstateimagelist">external documentation</a>.
+-spec getStateImageList(This) -> wxImageList:wxImageList() when
+ This::wxTreeCtrl().
getStateImageList(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_GetStateImageList,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl(), Point::{X::integer(), Y::integer()}) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlhittest">external documentation</a>.
+-spec hitTest(This, Point) -> integer() when
+ This::wxTreeCtrl(), Point::{X::integer(), Y::integer()}.
hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PointX,PointY})
when is_integer(PointX),is_integer(PointY) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_HitTest,
<<ThisRef:32/?UI,PointX:32/?UI,PointY:32/?UI>>).
-%% @spec (This::wxTreeCtrl(), Parent::integer(), Pos::integer(), Text::string()) -> integer()
%% @equiv insertItem(This,Parent,Pos,Text, [])
+-spec insertItem(This, Parent, Pos, Text) -> integer() when
+ This::wxTreeCtrl(), Parent::integer(), Pos::integer(), Text::unicode:chardata().
+
insertItem(This,Parent,Pos,Text)
when is_record(This, wx_ref),is_integer(Parent),is_integer(Pos),is_list(Text) ->
insertItem(This,Parent,Pos,Text, []).
-%% @spec (This::wxTreeCtrl(), Parent::integer(), Pos::integer(), Text::string(), [Option]) -> integer()
-%% Option = {image, integer()} | {selImage, integer()} | {data, term()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlinsertitem">external documentation</a>.
+-spec insertItem(This, Parent, Pos, Text, [Option]) -> integer() when
+ This::wxTreeCtrl(), Parent::integer(), Pos::integer(), Text::unicode:chardata(),
+ Option :: {image, integer()}
+ | {selImage, integer()}
+ | {data, term()}.
insertItem(#wx_ref{type=ThisT,ref=ThisRef},Parent,Pos,Text, Options)
when is_integer(Parent),is_integer(Pos),is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -521,55 +595,65 @@ insertItem(#wx_ref{type=ThisT,ref=ThisRef},Parent,Pos,Text, Options)
wxe_util:call(?wxTreeCtrl_InsertItem,
<<ThisRef:32/?UI,0:32,Parent:64/?UI,Pos:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlisbold">external documentation</a>.
+-spec isBold(This, Item) -> boolean() when
+ This::wxTreeCtrl(), Item::integer().
isBold(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_IsBold,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlisexpanded">external documentation</a>.
+-spec isExpanded(This, Item) -> boolean() when
+ This::wxTreeCtrl(), Item::integer().
isExpanded(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_IsExpanded,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlisselected">external documentation</a>.
+-spec isSelected(This, Item) -> boolean() when
+ This::wxTreeCtrl(), Item::integer().
isSelected(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_IsSelected,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlisvisible">external documentation</a>.
+-spec isVisible(This, Item) -> boolean() when
+ This::wxTreeCtrl(), Item::integer().
isVisible(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_IsVisible,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlitemhaschildren">external documentation</a>.
+-spec itemHasChildren(This, Item) -> boolean() when
+ This::wxTreeCtrl(), Item::integer().
itemHasChildren(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:call(?wxTreeCtrl_ItemHasChildren,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Parent::integer(), Text::string()) -> integer()
%% @equiv prependItem(This,Parent,Text, [])
+-spec prependItem(This, Parent, Text) -> integer() when
+ This::wxTreeCtrl(), Parent::integer(), Text::unicode:chardata().
+
prependItem(This,Parent,Text)
when is_record(This, wx_ref),is_integer(Parent),is_list(Text) ->
prependItem(This,Parent,Text, []).
-%% @spec (This::wxTreeCtrl(), Parent::integer(), Text::string(), [Option]) -> integer()
-%% Option = {image, integer()} | {selectedImage, integer()} | {data, term()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlprependitem">external documentation</a>.
+-spec prependItem(This, Parent, Text, [Option]) -> integer() when
+ This::wxTreeCtrl(), Parent::integer(), Text::unicode:chardata(),
+ Option :: {image, integer()}
+ | {selectedImage, integer()}
+ | {data, term()}.
prependItem(#wx_ref{type=ThisT,ref=ThisRef},Parent,Text, Options)
when is_integer(Parent),is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -582,25 +666,28 @@ prependItem(#wx_ref{type=ThisT,ref=ThisRef},Parent,Text, Options)
wxe_util:call(?wxTreeCtrl_PrependItem,
<<ThisRef:32/?UI,0:32,Parent:64/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlscrollto">external documentation</a>.
+-spec scrollTo(This, Item) -> ok when
+ This::wxTreeCtrl(), Item::integer().
scrollTo(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_ScrollTo,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlselectitem">external documentation</a>.
+-spec selectItem(This, Item) -> ok when
+ This::wxTreeCtrl(), Item::integer().
selectItem(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_SelectItem_1,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer(), [Option]) -> ok
-%% Option = {select, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlselectitem">external documentation</a>.
+-spec selectItem(This, Item, [Option]) -> ok when
+ This::wxTreeCtrl(), Item::integer(),
+ Option :: {select, boolean()}.
selectItem(#wx_ref{type=ThisT,ref=ThisRef},Item, Options)
when is_integer(Item),is_list(Options) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -610,39 +697,45 @@ selectItem(#wx_ref{type=ThisT,ref=ThisRef},Item, Options)
wxe_util:cast(?wxTreeCtrl_SelectItem_2,
<<ThisRef:32/?UI,0:32,Item:64/?UI, BinOpt/binary>>).
-%% @spec (This::wxTreeCtrl(), Indent::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlsetindent">external documentation</a>.
+-spec setIndent(This, Indent) -> ok when
+ This::wxTreeCtrl(), Indent::integer().
setIndent(#wx_ref{type=ThisT,ref=ThisRef},Indent)
when is_integer(Indent) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_SetIndent,
<<ThisRef:32/?UI,Indent:32/?UI>>).
-%% @spec (This::wxTreeCtrl(), ImageList::wxImageList:wxImageList()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlsetimagelist">external documentation</a>.
+-spec setImageList(This, ImageList) -> ok when
+ This::wxTreeCtrl(), ImageList::wxImageList:wxImageList().
setImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef}) ->
?CLASS(ThisT,wxTreeCtrl),
?CLASS(ImageListT,wxImageList),
wxe_util:cast(?wxTreeCtrl_SetImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer(), Col::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlsetitembackgroundcolour">external documentation</a>.
+-spec setItemBackgroundColour(This, Item, Col) -> ok when
+ This::wxTreeCtrl(), Item::integer(), Col::wx:wx_colour().
setItemBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},Item,Col)
when is_integer(Item),tuple_size(Col) =:= 3; tuple_size(Col) =:= 4 ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_SetItemBackgroundColour,
<<ThisRef:32/?UI,0:32,Item:64/?UI,(wxe_util:colour_bin(Col)):16/binary>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> ok
%% @equiv setItemBold(This,Item, [])
+-spec setItemBold(This, Item) -> ok when
+ This::wxTreeCtrl(), Item::integer().
+
setItemBold(This,Item)
when is_record(This, wx_ref),is_integer(Item) ->
setItemBold(This,Item, []).
-%% @spec (This::wxTreeCtrl(), Item::integer(), [Option]) -> ok
-%% Option = {bold, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlsetitembold">external documentation</a>.
+-spec setItemBold(This, Item, [Option]) -> ok when
+ This::wxTreeCtrl(), Item::integer(),
+ Option :: {bold, boolean()}.
setItemBold(#wx_ref{type=ThisT,ref=ThisRef},Item, Options)
when is_integer(Item),is_list(Options) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -652,8 +745,9 @@ setItemBold(#wx_ref{type=ThisT,ref=ThisRef},Item, Options)
wxe_util:cast(?wxTreeCtrl_SetItemBold,
<<ThisRef:32/?UI,0:32,Item:64/?UI, BinOpt/binary>>).
-%% @spec (This::wxTreeCtrl(), Item::integer(), Data::term()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlsetitemdata">external documentation</a>.
+-spec setItemData(This, Item, Data) -> ok when
+ This::wxTreeCtrl(), Item::integer(), Data::term().
setItemData(#wx_ref{type=ThisT,ref=ThisRef},Item,Data)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -661,15 +755,18 @@ setItemData(#wx_ref{type=ThisT,ref=ThisRef},Item,Data)
wxe_util:cast(?wxTreeCtrl_SetItemData,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> ok
%% @equiv setItemDropHighlight(This,Item, [])
+-spec setItemDropHighlight(This, Item) -> ok when
+ This::wxTreeCtrl(), Item::integer().
+
setItemDropHighlight(This,Item)
when is_record(This, wx_ref),is_integer(Item) ->
setItemDropHighlight(This,Item, []).
-%% @spec (This::wxTreeCtrl(), Item::integer(), [Option]) -> ok
-%% Option = {highlight, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlsetitemdrophighlight">external documentation</a>.
+-spec setItemDropHighlight(This, Item, [Option]) -> ok when
+ This::wxTreeCtrl(), Item::integer(),
+ Option :: {highlight, boolean()}.
setItemDropHighlight(#wx_ref{type=ThisT,ref=ThisRef},Item, Options)
when is_integer(Item),is_list(Options) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -679,8 +776,9 @@ setItemDropHighlight(#wx_ref{type=ThisT,ref=ThisRef},Item, Options)
wxe_util:cast(?wxTreeCtrl_SetItemDropHighlight,
<<ThisRef:32/?UI,0:32,Item:64/?UI, BinOpt/binary>>).
-%% @spec (This::wxTreeCtrl(), Item::integer(), Font::wxFont:wxFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlsetitemfont">external documentation</a>.
+-spec setItemFont(This, Item, Font) -> ok when
+ This::wxTreeCtrl(), Item::integer(), Font::wxFont:wxFont().
setItemFont(#wx_ref{type=ThisT,ref=ThisRef},Item,#wx_ref{type=FontT,ref=FontRef})
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -688,15 +786,18 @@ setItemFont(#wx_ref{type=ThisT,ref=ThisRef},Item,#wx_ref{type=FontT,ref=FontRef}
wxe_util:cast(?wxTreeCtrl_SetItemFont,
<<ThisRef:32/?UI,0:32,Item:64/?UI,FontRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> ok
%% @equiv setItemHasChildren(This,Item, [])
+-spec setItemHasChildren(This, Item) -> ok when
+ This::wxTreeCtrl(), Item::integer().
+
setItemHasChildren(This,Item)
when is_record(This, wx_ref),is_integer(Item) ->
setItemHasChildren(This,Item, []).
-%% @spec (This::wxTreeCtrl(), Item::integer(), [Option]) -> ok
-%% Option = {has, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlsetitemhaschildren">external documentation</a>.
+-spec setItemHasChildren(This, Item, [Option]) -> ok when
+ This::wxTreeCtrl(), Item::integer(),
+ Option :: {has, boolean()}.
setItemHasChildren(#wx_ref{type=ThisT,ref=ThisRef},Item, Options)
when is_integer(Item),is_list(Options) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -706,19 +807,20 @@ setItemHasChildren(#wx_ref{type=ThisT,ref=ThisRef},Item, Options)
wxe_util:cast(?wxTreeCtrl_SetItemHasChildren,
<<ThisRef:32/?UI,0:32,Item:64/?UI, BinOpt/binary>>).
-%% @spec (This::wxTreeCtrl(), Item::integer(), Image::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlsetitemimage">external documentation</a>.
+-spec setItemImage(This, Item, Image) -> ok when
+ This::wxTreeCtrl(), Item::integer(), Image::integer().
setItemImage(#wx_ref{type=ThisT,ref=ThisRef},Item,Image)
when is_integer(Item),is_integer(Image) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_SetItemImage_2,
<<ThisRef:32/?UI,0:32,Item:64/?UI,Image:32/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer(), Image::integer(), [Option]) -> ok
-%% Option = {which, WxTreeItemIcon}
-%% WxTreeItemIcon = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlsetitemimage">external documentation</a>.
-%%<br /> WxTreeItemIcon is one of ?wxTreeItemIcon_Normal | ?wxTreeItemIcon_Selected | ?wxTreeItemIcon_Expanded | ?wxTreeItemIcon_SelectedExpanded | ?wxTreeItemIcon_Max
+%%<br /> Which = ?wxTreeItemIcon_Normal | ?wxTreeItemIcon_Selected | ?wxTreeItemIcon_Expanded | ?wxTreeItemIcon_SelectedExpanded | ?wxTreeItemIcon_Max
+-spec setItemImage(This, Item, Image, [Option]) -> ok when
+ This::wxTreeCtrl(), Item::integer(), Image::integer(),
+ Option :: {which, wx:wx_enum()}.
setItemImage(#wx_ref{type=ThisT,ref=ThisRef},Item,Image, Options)
when is_integer(Item),is_integer(Image),is_list(Options) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -728,8 +830,9 @@ setItemImage(#wx_ref{type=ThisT,ref=ThisRef},Item,Image, Options)
wxe_util:cast(?wxTreeCtrl_SetItemImage_3,
<<ThisRef:32/?UI,0:32,Item:64/?UI,Image:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxTreeCtrl(), Item::integer(), Text::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlsetitemtext">external documentation</a>.
+-spec setItemText(This, Item, Text) -> ok when
+ This::wxTreeCtrl(), Item::integer(), Text::unicode:chardata().
setItemText(#wx_ref{type=ThisT,ref=ThisRef},Item,Text)
when is_integer(Item),is_list(Text) ->
?CLASS(ThisT,wxTreeCtrl),
@@ -737,78 +840,87 @@ setItemText(#wx_ref{type=ThisT,ref=ThisRef},Item,Text)
wxe_util:cast(?wxTreeCtrl_SetItemText,
<<ThisRef:32/?UI,0:32,Item:64/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxTreeCtrl(), Item::integer(), Col::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlsetitemtextcolour">external documentation</a>.
+-spec setItemTextColour(This, Item, Col) -> ok when
+ This::wxTreeCtrl(), Item::integer(), Col::wx:wx_colour().
setItemTextColour(#wx_ref{type=ThisT,ref=ThisRef},Item,Col)
when is_integer(Item),tuple_size(Col) =:= 3; tuple_size(Col) =:= 4 ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_SetItemTextColour,
<<ThisRef:32/?UI,0:32,Item:64/?UI,(wxe_util:colour_bin(Col)):16/binary>>).
-%% @spec (This::wxTreeCtrl(), ImageList::wxImageList:wxImageList()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlsetstateimagelist">external documentation</a>.
+-spec setStateImageList(This, ImageList) -> ok when
+ This::wxTreeCtrl(), ImageList::wxImageList:wxImageList().
setStateImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef}) ->
?CLASS(ThisT,wxTreeCtrl),
?CLASS(ImageListT,wxImageList),
wxe_util:cast(?wxTreeCtrl_SetStateImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl(), Styles::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlsetwindowstyle">external documentation</a>.
+-spec setWindowStyle(This, Styles) -> ok when
+ This::wxTreeCtrl(), Styles::integer().
setWindowStyle(#wx_ref{type=ThisT,ref=ThisRef},Styles)
when is_integer(Styles) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_SetWindowStyle,
<<ThisRef:32/?UI,Styles:32/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlsortchildren">external documentation</a>.
+-spec sortChildren(This, Item) -> ok when
+ This::wxTreeCtrl(), Item::integer().
sortChildren(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_SortChildren,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrltoggle">external documentation</a>.
+-spec toggle(This, Item) -> ok when
+ This::wxTreeCtrl(), Item::integer().
toggle(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_Toggle,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrltoggleitemselection">external documentation</a>.
+-spec toggleItemSelection(This, Item) -> ok when
+ This::wxTreeCtrl(), Item::integer().
toggleItemSelection(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_ToggleItemSelection,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlunselect">external documentation</a>.
+-spec unselect(This) -> ok when
+ This::wxTreeCtrl().
unselect(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_Unselect,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlunselectall">external documentation</a>.
+-spec unselectAll(This) -> ok when
+ This::wxTreeCtrl().
unselectAll(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_UnselectAll,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeCtrl(), Item::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreectrl.html#wxtreectrlunselectitem">external documentation</a>.
+-spec unselectItem(This, Item) -> ok when
+ This::wxTreeCtrl(), Item::integer().
unselectItem(#wx_ref{type=ThisT,ref=ThisRef},Item)
when is_integer(Item) ->
?CLASS(ThisT,wxTreeCtrl),
wxe_util:cast(?wxTreeCtrl_UnselectItem,
<<ThisRef:32/?UI,0:32,Item:64/?UI>>).
-%% @spec (This::wxTreeCtrl()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxTreeCtrl()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxTreeCtrl),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxTreeEvent.erl b/lib/wx/src/gen/wxTreeEvent.erl
index 0264d43568..d042fb93e5 100644
--- a/lib/wx/src/gen/wxTreeEvent.erl
+++ b/lib/wx/src/gen/wxTreeEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -42,63 +42,73 @@
isSelection/1,parent_class/1,resumePropagation/2,setInt/2,setString/2,
shouldPropagate/1,skip/1,skip/2,stopPropagation/1,veto/1]).
+-export_type([wxTreeEvent/0]).
%% @hidden
parent_class(wxNotifyEvent) -> true;
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (This::wxTreeEvent()) -> integer()
+-type wxTreeEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreeevent.html#wxtreeeventgetkeycode">external documentation</a>.
+-spec getKeyCode(This) -> integer() when
+ This::wxTreeEvent().
getKeyCode(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeEvent),
wxe_util:call(?wxTreeEvent_GetKeyCode,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreeevent.html#wxtreeeventgetitem">external documentation</a>.
+-spec getItem(This) -> integer() when
+ This::wxTreeEvent().
getItem(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeEvent),
wxe_util:call(?wxTreeEvent_GetItem,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeEvent()) -> wxKeyEvent:wxKeyEvent()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreeevent.html#wxtreeeventgetkeyevent">external documentation</a>.
+-spec getKeyEvent(This) -> wxKeyEvent:wxKeyEvent() when
+ This::wxTreeEvent().
getKeyEvent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeEvent),
wxe_util:call(?wxTreeEvent_GetKeyEvent,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeEvent()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreeevent.html#wxtreeeventgetlabel">external documentation</a>.
+-spec getLabel(This) -> unicode:charlist() when
+ This::wxTreeEvent().
getLabel(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeEvent),
wxe_util:call(?wxTreeEvent_GetLabel,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeEvent()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreeevent.html#wxtreeeventgetolditem">external documentation</a>.
+-spec getOldItem(This) -> integer() when
+ This::wxTreeEvent().
getOldItem(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeEvent),
wxe_util:call(?wxTreeEvent_GetOldItem,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeEvent()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreeevent.html#wxtreeeventgetpoint">external documentation</a>.
+-spec getPoint(This) -> {X::integer(), Y::integer()} when
+ This::wxTreeEvent().
getPoint(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeEvent),
wxe_util:call(?wxTreeEvent_GetPoint,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreeevent.html#wxtreeeventiseditcancelled">external documentation</a>.
+-spec isEditCancelled(This) -> boolean() when
+ This::wxTreeEvent().
isEditCancelled(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreeEvent),
wxe_util:call(?wxTreeEvent_IsEditCancelled,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreeEvent(), ToolTip::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreeevent.html#wxtreeeventsettooltip">external documentation</a>.
+-spec setToolTip(This, ToolTip) -> ok when
+ This::wxTreeEvent(), ToolTip::unicode:chardata().
setToolTip(#wx_ref{type=ThisT,ref=ThisRef},ToolTip)
when is_list(ToolTip) ->
?CLASS(ThisT,wxTreeEvent),
diff --git a/lib/wx/src/gen/wxTreebook.erl b/lib/wx/src/gen/wxTreebook.erl
index 24f5d72c43..5d08c12cce 100644
--- a/lib/wx/src/gen/wxTreebook.erl
+++ b/lib/wx/src/gen/wxTreebook.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2012. 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
@@ -75,27 +75,34 @@
show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1,
update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]).
+-export_type([wxTreebook/0]).
%% @hidden
parent_class(wxControl) -> true;
parent_class(wxWindow) -> true;
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxTreebook()
+-type wxTreebook() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookwxtreebook">external documentation</a>.
+-spec new() -> wxTreebook().
new() ->
wxe_util:construct(?wxTreebook_new_0,
<<>>).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxTreebook()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxTreebook() when
+ Parent::wxWindow:wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxTreebook()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookwxtreebook">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxTreebook() when
+ Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -107,15 +114,19 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxTreebook_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxTreebook(), Page::wxWindow:wxWindow(), Text::string()) -> bool()
%% @equiv addPage(This,Page,Text, [])
+-spec addPage(This, Page, Text) -> boolean() when
+ This::wxTreebook(), Page::wxWindow:wxWindow(), Text::unicode:chardata().
+
addPage(This,Page,Text)
when is_record(This, wx_ref),is_record(Page, wx_ref),is_list(Text) ->
addPage(This,Page,Text, []).
-%% @spec (This::wxTreebook(), Page::wxWindow:wxWindow(), Text::string(), [Option]) -> bool()
-%% Option = {bSelect, bool()} | {imageId, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookaddpage">external documentation</a>.
+-spec addPage(This, Page, Text, [Option]) -> boolean() when
+ This::wxTreebook(), Page::wxWindow:wxWindow(), Text::unicode:chardata(),
+ Option :: {bSelect, boolean()}
+ | {imageId, integer()}.
addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Text, Options)
when is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxTreebook),
@@ -128,15 +139,18 @@ addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Text, Op
wxe_util:call(?wxTreebook_AddPage,
<<ThisRef:32/?UI,PageRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxTreebook()) -> ok
%% @equiv advanceSelection(This, [])
+-spec advanceSelection(This) -> ok when
+ This::wxTreebook().
+
advanceSelection(This)
when is_record(This, wx_ref) ->
advanceSelection(This, []).
-%% @spec (This::wxTreebook(), [Option]) -> ok
-%% Option = {forward, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookadvanceselection">external documentation</a>.
+-spec advanceSelection(This, [Option]) -> ok when
+ This::wxTreebook(),
+ Option :: {forward, boolean()}.
advanceSelection(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxTreebook),
@@ -146,23 +160,29 @@ advanceSelection(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxTreebook_AdvanceSelection,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxTreebook(), ImageList::wxImageList:wxImageList()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookassignimagelist">external documentation</a>.
+-spec assignImageList(This, ImageList) -> ok when
+ This::wxTreebook(), ImageList::wxImageList:wxImageList().
assignImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef}) ->
?CLASS(ThisT,wxTreebook),
?CLASS(ImageListT,wxImageList),
wxe_util:cast(?wxTreebook_AssignImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI>>).
-%% @spec (This::wxTreebook(), Parent::wxWindow:wxWindow(), Id::integer()) -> bool()
%% @equiv create(This,Parent,Id, [])
+-spec create(This, Parent, Id) -> boolean() when
+ This::wxTreebook(), Parent::wxWindow:wxWindow(), Id::integer().
+
create(This,Parent,Id)
when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id) ->
create(This,Parent,Id, []).
-%% @spec (This::wxTreebook(), Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookcreate">external documentation</a>.
+-spec create(This, Parent, Id, [Option]) -> boolean() when
+ This::wxTreebook(), Parent::wxWindow:wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ThisT,wxTreebook),
@@ -175,90 +195,103 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id, O
wxe_util:call(?wxTreebook_Create,
<<ThisRef:32/?UI,ParentRef:32/?UI,Id:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxTreebook()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookdeleteallpages">external documentation</a>.
+-spec deleteAllPages(This) -> boolean() when
+ This::wxTreebook().
deleteAllPages(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreebook),
wxe_util:call(?wxTreebook_DeleteAllPages,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreebook(), Pos::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookdeletepage">external documentation</a>.
+-spec deletePage(This, Pos) -> boolean() when
+ This::wxTreebook(), Pos::integer().
deletePage(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxTreebook),
wxe_util:call(?wxTreebook_DeletePage,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxTreebook(), N::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookremovepage">external documentation</a>.
+-spec removePage(This, N) -> boolean() when
+ This::wxTreebook(), N::integer().
removePage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxTreebook),
wxe_util:call(?wxTreebook_RemovePage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxTreebook()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookgetcurrentpage">external documentation</a>.
+-spec getCurrentPage(This) -> wxWindow:wxWindow() when
+ This::wxTreebook().
getCurrentPage(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreebook),
wxe_util:call(?wxTreebook_GetCurrentPage,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreebook()) -> wxImageList:wxImageList()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookgetimagelist">external documentation</a>.
+-spec getImageList(This) -> wxImageList:wxImageList() when
+ This::wxTreebook().
getImageList(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreebook),
wxe_util:call(?wxTreebook_GetImageList,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreebook(), N::integer()) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookgetpage">external documentation</a>.
+-spec getPage(This, N) -> wxWindow:wxWindow() when
+ This::wxTreebook(), N::integer().
getPage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxTreebook),
wxe_util:call(?wxTreebook_GetPage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxTreebook()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookgetpagecount">external documentation</a>.
+-spec getPageCount(This) -> integer() when
+ This::wxTreebook().
getPageCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreebook),
wxe_util:call(?wxTreebook_GetPageCount,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreebook(), N::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookgetpageimage">external documentation</a>.
+-spec getPageImage(This, N) -> integer() when
+ This::wxTreebook(), N::integer().
getPageImage(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxTreebook),
wxe_util:call(?wxTreebook_GetPageImage,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxTreebook(), N::integer()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookgetpagetext">external documentation</a>.
+-spec getPageText(This, N) -> unicode:charlist() when
+ This::wxTreebook(), N::integer().
getPageText(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxTreebook),
wxe_util:call(?wxTreebook_GetPageText,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxTreebook()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookgetselection">external documentation</a>.
+-spec getSelection(This) -> integer() when
+ This::wxTreebook().
getSelection(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTreebook),
wxe_util:call(?wxTreebook_GetSelection,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxTreebook(), Pos::integer()) -> bool()
%% @equiv expandNode(This,Pos, [])
+-spec expandNode(This, Pos) -> boolean() when
+ This::wxTreebook(), Pos::integer().
+
expandNode(This,Pos)
when is_record(This, wx_ref),is_integer(Pos) ->
expandNode(This,Pos, []).
-%% @spec (This::wxTreebook(), Pos::integer(), [Option]) -> bool()
-%% Option = {expand, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookexpandnode">external documentation</a>.
+-spec expandNode(This, Pos, [Option]) -> boolean() when
+ This::wxTreebook(), Pos::integer(),
+ Option :: {expand, boolean()}.
expandNode(#wx_ref{type=ThisT,ref=ThisRef},Pos, Options)
when is_integer(Pos),is_list(Options) ->
?CLASS(ThisT,wxTreebook),
@@ -268,31 +301,38 @@ expandNode(#wx_ref{type=ThisT,ref=ThisRef},Pos, Options)
wxe_util:call(?wxTreebook_ExpandNode,
<<ThisRef:32/?UI,Pos:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxTreebook(), Pos::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookisnodeexpanded">external documentation</a>.
+-spec isNodeExpanded(This, Pos) -> boolean() when
+ This::wxTreebook(), Pos::integer().
isNodeExpanded(#wx_ref{type=ThisT,ref=ThisRef},Pos)
when is_integer(Pos) ->
?CLASS(ThisT,wxTreebook),
wxe_util:call(?wxTreebook_IsNodeExpanded,
<<ThisRef:32/?UI,Pos:32/?UI>>).
-%% @spec (This::wxTreebook(), Pt::{X::integer(), Y::integer()}) -> {integer(), Flags::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookhittest">external documentation</a>.
+-spec hitTest(This, Pt) -> Result when
+ Result ::{Res ::integer(), Flags::integer()},
+ This::wxTreebook(), Pt::{X::integer(), Y::integer()}.
hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxTreebook),
wxe_util:call(?wxTreebook_HitTest,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxTreebook(), Pos::integer(), Page::wxWindow:wxWindow(), Text::string()) -> bool()
%% @equiv insertPage(This,Pos,Page,Text, [])
+-spec insertPage(This, Pos, Page, Text) -> boolean() when
+ This::wxTreebook(), Pos::integer(), Page::wxWindow:wxWindow(), Text::unicode:chardata().
+
insertPage(This,Pos,Page,Text)
when is_record(This, wx_ref),is_integer(Pos),is_record(Page, wx_ref),is_list(Text) ->
insertPage(This,Pos,Page,Text, []).
-%% @spec (This::wxTreebook(), Pos::integer(), Page::wxWindow:wxWindow(), Text::string(), [Option]) -> bool()
-%% Option = {bSelect, bool()} | {imageId, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookinsertpage">external documentation</a>.
+-spec insertPage(This, Pos, Page, Text, [Option]) -> boolean() when
+ This::wxTreebook(), Pos::integer(), Page::wxWindow:wxWindow(), Text::unicode:chardata(),
+ Option :: {bSelect, boolean()}
+ | {imageId, integer()}.
insertPage(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=PageT,ref=PageRef},Text, Options)
when is_integer(Pos),is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxTreebook),
@@ -305,15 +345,19 @@ insertPage(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=PageT,ref=PageRef},T
wxe_util:call(?wxTreebook_InsertPage,
<<ThisRef:32/?UI,Pos:32/?UI,PageRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxTreebook(), Pos::integer(), Page::wxWindow:wxWindow(), Text::string()) -> bool()
%% @equiv insertSubPage(This,Pos,Page,Text, [])
+-spec insertSubPage(This, Pos, Page, Text) -> boolean() when
+ This::wxTreebook(), Pos::integer(), Page::wxWindow:wxWindow(), Text::unicode:chardata().
+
insertSubPage(This,Pos,Page,Text)
when is_record(This, wx_ref),is_integer(Pos),is_record(Page, wx_ref),is_list(Text) ->
insertSubPage(This,Pos,Page,Text, []).
-%% @spec (This::wxTreebook(), Pos::integer(), Page::wxWindow:wxWindow(), Text::string(), [Option]) -> bool()
-%% Option = {bSelect, bool()} | {imageId, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookinsertsubpage">external documentation</a>.
+-spec insertSubPage(This, Pos, Page, Text, [Option]) -> boolean() when
+ This::wxTreebook(), Pos::integer(), Page::wxWindow:wxWindow(), Text::unicode:chardata(),
+ Option :: {bSelect, boolean()}
+ | {imageId, integer()}.
insertSubPage(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=PageT,ref=PageRef},Text, Options)
when is_integer(Pos),is_list(Text),is_list(Options) ->
?CLASS(ThisT,wxTreebook),
@@ -326,32 +370,36 @@ insertSubPage(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=PageT,ref=PageRef
wxe_util:call(?wxTreebook_InsertSubPage,
<<ThisRef:32/?UI,Pos:32/?UI,PageRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxTreebook(), ImageList::wxImageList:wxImageList()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebooksetimagelist">external documentation</a>.
+-spec setImageList(This, ImageList) -> ok when
+ This::wxTreebook(), ImageList::wxImageList:wxImageList().
setImageList(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ImageListT,ref=ImageListRef}) ->
?CLASS(ThisT,wxTreebook),
?CLASS(ImageListT,wxImageList),
wxe_util:cast(?wxTreebook_SetImageList,
<<ThisRef:32/?UI,ImageListRef:32/?UI>>).
-%% @spec (This::wxTreebook(), Size::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebooksetpagesize">external documentation</a>.
+-spec setPageSize(This, Size) -> ok when
+ This::wxTreebook(), Size::{W::integer(), H::integer()}.
setPageSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxTreebook),
wxe_util:cast(?wxTreebook_SetPageSize,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxTreebook(), N::integer(), ImageId::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebooksetpageimage">external documentation</a>.
+-spec setPageImage(This, N, ImageId) -> boolean() when
+ This::wxTreebook(), N::integer(), ImageId::integer().
setPageImage(#wx_ref{type=ThisT,ref=ThisRef},N,ImageId)
when is_integer(N),is_integer(ImageId) ->
?CLASS(ThisT,wxTreebook),
wxe_util:call(?wxTreebook_SetPageImage,
<<ThisRef:32/?UI,N:32/?UI,ImageId:32/?UI>>).
-%% @spec (This::wxTreebook(), N::integer(), StrText::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebooksetpagetext">external documentation</a>.
+-spec setPageText(This, N, StrText) -> boolean() when
+ This::wxTreebook(), N::integer(), StrText::unicode:chardata().
setPageText(#wx_ref{type=ThisT,ref=ThisRef},N,StrText)
when is_integer(N),is_list(StrText) ->
?CLASS(ThisT,wxTreebook),
@@ -359,24 +407,26 @@ setPageText(#wx_ref{type=ThisT,ref=ThisRef},N,StrText)
wxe_util:call(?wxTreebook_SetPageText,
<<ThisRef:32/?UI,N:32/?UI,(byte_size(StrText_UC)):32/?UI,(StrText_UC)/binary, 0:(((8- ((4+byte_size(StrText_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxTreebook(), N::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebooksetselection">external documentation</a>.
+-spec setSelection(This, N) -> integer() when
+ This::wxTreebook(), N::integer().
setSelection(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxTreebook),
wxe_util:call(?wxTreebook_SetSelection,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxTreebook(), N::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtreebook.html#wxtreebookchangeselection">external documentation</a>.
+-spec changeSelection(This, N) -> integer() when
+ This::wxTreebook(), N::integer().
changeSelection(#wx_ref{type=ThisT,ref=ThisRef},N)
when is_integer(N) ->
?CLASS(ThisT,wxTreebook),
wxe_util:call(?wxTreebook_ChangeSelection,
<<ThisRef:32/?UI,N:32/?UI>>).
-%% @spec (This::wxTreebook()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxTreebook()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxTreebook),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxUpdateUIEvent.erl b/lib/wx/src/gen/wxUpdateUIEvent.erl
index baf9fc8b52..f6d46611ab 100644
--- a/lib/wx/src/gen/wxUpdateUIEvent.erl
+++ b/lib/wx/src/gen/wxUpdateUIEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -42,129 +42,143 @@
parent_class/1,resumePropagation/2,setInt/2,setString/2,shouldPropagate/1,
skip/1,skip/2,stopPropagation/1]).
+-export_type([wxUpdateUIEvent/0]).
%% @hidden
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec (Win::wxWindow:wxWindow()) -> bool()
+-type wxUpdateUIEvent() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventcanupdate">external documentation</a>.
+-spec canUpdate(Win) -> boolean() when
+ Win::wxWindow:wxWindow().
canUpdate(#wx_ref{type=WinT,ref=WinRef}) ->
?CLASS(WinT,wxWindow),
wxe_util:call(?wxUpdateUIEvent_CanUpdate,
<<WinRef:32/?UI>>).
-%% @spec (This::wxUpdateUIEvent(), Check::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventcheck">external documentation</a>.
+-spec check(This, Check) -> ok when
+ This::wxUpdateUIEvent(), Check::boolean().
check(#wx_ref{type=ThisT,ref=ThisRef},Check)
when is_boolean(Check) ->
?CLASS(ThisT,wxUpdateUIEvent),
wxe_util:cast(?wxUpdateUIEvent_Check,
<<ThisRef:32/?UI,(wxe_util:from_bool(Check)):32/?UI>>).
-%% @spec (This::wxUpdateUIEvent(), Enable::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventenable">external documentation</a>.
+-spec enable(This, Enable) -> ok when
+ This::wxUpdateUIEvent(), Enable::boolean().
enable(#wx_ref{type=ThisT,ref=ThisRef},Enable)
when is_boolean(Enable) ->
?CLASS(ThisT,wxUpdateUIEvent),
wxe_util:cast(?wxUpdateUIEvent_Enable,
<<ThisRef:32/?UI,(wxe_util:from_bool(Enable)):32/?UI>>).
-%% @spec (This::wxUpdateUIEvent(), Show::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventshow">external documentation</a>.
+-spec show(This, Show) -> ok when
+ This::wxUpdateUIEvent(), Show::boolean().
show(#wx_ref{type=ThisT,ref=ThisRef},Show)
when is_boolean(Show) ->
?CLASS(ThisT,wxUpdateUIEvent),
wxe_util:cast(?wxUpdateUIEvent_Show,
<<ThisRef:32/?UI,(wxe_util:from_bool(Show)):32/?UI>>).
-%% @spec (This::wxUpdateUIEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventgetchecked">external documentation</a>.
+-spec getChecked(This) -> boolean() when
+ This::wxUpdateUIEvent().
getChecked(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxUpdateUIEvent),
wxe_util:call(?wxUpdateUIEvent_GetChecked,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxUpdateUIEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventgetenabled">external documentation</a>.
+-spec getEnabled(This) -> boolean() when
+ This::wxUpdateUIEvent().
getEnabled(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxUpdateUIEvent),
wxe_util:call(?wxUpdateUIEvent_GetEnabled,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxUpdateUIEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventgetshown">external documentation</a>.
+-spec getShown(This) -> boolean() when
+ This::wxUpdateUIEvent().
getShown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxUpdateUIEvent),
wxe_util:call(?wxUpdateUIEvent_GetShown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxUpdateUIEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventgetsetchecked">external documentation</a>.
+-spec getSetChecked(This) -> boolean() when
+ This::wxUpdateUIEvent().
getSetChecked(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxUpdateUIEvent),
wxe_util:call(?wxUpdateUIEvent_GetSetChecked,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxUpdateUIEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventgetsetenabled">external documentation</a>.
+-spec getSetEnabled(This) -> boolean() when
+ This::wxUpdateUIEvent().
getSetEnabled(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxUpdateUIEvent),
wxe_util:call(?wxUpdateUIEvent_GetSetEnabled,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxUpdateUIEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventgetsetshown">external documentation</a>.
+-spec getSetShown(This) -> boolean() when
+ This::wxUpdateUIEvent().
getSetShown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxUpdateUIEvent),
wxe_util:call(?wxUpdateUIEvent_GetSetShown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxUpdateUIEvent()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventgetsettext">external documentation</a>.
+-spec getSetText(This) -> boolean() when
+ This::wxUpdateUIEvent().
getSetText(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxUpdateUIEvent),
wxe_util:call(?wxUpdateUIEvent_GetSetText,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxUpdateUIEvent()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventgettext">external documentation</a>.
+-spec getText(This) -> unicode:charlist() when
+ This::wxUpdateUIEvent().
getText(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxUpdateUIEvent),
wxe_util:call(?wxUpdateUIEvent_GetText,
<<ThisRef:32/?UI>>).
-%% @spec () -> WxUpdateUIMode
-%% WxUpdateUIMode = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventgetmode">external documentation</a>.
-%%<br /> WxUpdateUIMode is one of ?wxUPDATE_UI_PROCESS_ALL | ?wxUPDATE_UI_PROCESS_SPECIFIED
+%%<br /> Res = ?wxUPDATE_UI_PROCESS_ALL | ?wxUPDATE_UI_PROCESS_SPECIFIED
+-spec getMode() -> wx:wx_enum().
getMode() ->
wxe_util:call(?wxUpdateUIEvent_GetMode,
<<>>).
-%% @spec () -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventgetupdateinterval">external documentation</a>.
+-spec getUpdateInterval() -> integer().
getUpdateInterval() ->
wxe_util:call(?wxUpdateUIEvent_GetUpdateInterval,
<<>>).
-%% @spec () -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventresetupdatetime">external documentation</a>.
+-spec resetUpdateTime() -> ok.
resetUpdateTime() ->
wxe_util:cast(?wxUpdateUIEvent_ResetUpdateTime,
<<>>).
-%% @spec (Mode::WxUpdateUIMode) -> ok
-%% WxUpdateUIMode = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventsetmode">external documentation</a>.
-%%<br /> WxUpdateUIMode is one of ?wxUPDATE_UI_PROCESS_ALL | ?wxUPDATE_UI_PROCESS_SPECIFIED
+%%<br /> Mode = ?wxUPDATE_UI_PROCESS_ALL | ?wxUPDATE_UI_PROCESS_SPECIFIED
+-spec setMode(Mode) -> ok when
+ Mode::wx:wx_enum().
setMode(Mode)
when is_integer(Mode) ->
wxe_util:cast(?wxUpdateUIEvent_SetMode,
<<Mode:32/?UI>>).
-%% @spec (This::wxUpdateUIEvent(), Text::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventsettext">external documentation</a>.
+-spec setText(This, Text) -> ok when
+ This::wxUpdateUIEvent(), Text::unicode:chardata().
setText(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_list(Text) ->
?CLASS(ThisT,wxUpdateUIEvent),
@@ -172,8 +186,9 @@ setText(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:cast(?wxUpdateUIEvent_SetText,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (UpdateInterval::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxupdateuievent.html#wxupdateuieventsetupdateinterval">external documentation</a>.
+-spec setUpdateInterval(UpdateInterval) -> ok when
+ UpdateInterval::integer().
setUpdateInterval(UpdateInterval)
when is_integer(UpdateInterval) ->
wxe_util:cast(?wxUpdateUIEvent_SetUpdateInterval,
diff --git a/lib/wx/src/gen/wxWindow.erl b/lib/wx/src/gen/wxWindow.erl
index 6b57cf508e..229633a106 100644
--- a/lib/wx/src/gen/wxWindow.erl
+++ b/lib/wx/src/gen/wxWindow.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -69,25 +69,32 @@
%% inherited exports
-export([connect/2,connect/3,disconnect/1,disconnect/2,disconnect/3,parent_class/1]).
+-export_type([wxWindow/0]).
%% @hidden
parent_class(wxEvtHandler) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxWindow()
+-type wxWindow() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowwxwindow">external documentation</a>.
+-spec new() -> wxWindow().
new() ->
wxe_util:construct(?wxWindow_new_0,
<<>>).
-%% @spec (Parent::wxWindow(), Id::integer()) -> wxWindow()
%% @equiv new(Parent,Id, [])
+-spec new(Parent, Id) -> wxWindow() when
+ Parent::wxWindow(), Id::integer().
+
new(Parent,Id)
when is_record(Parent, wx_ref),is_integer(Id) ->
new(Parent,Id, []).
-%% @spec (Parent::wxWindow(), Id::integer(), [Option]) -> wxWindow()
-%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowwxwindow">external documentation</a>.
+-spec new(Parent, Id, [Option]) -> wxWindow() when
+ Parent::wxWindow(), Id::integer(),
+ Option :: {pos, {X::integer(), Y::integer()}}
+ | {size, {W::integer(), H::integer()}}
+ | {style, integer()}.
new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
when is_integer(Id),is_list(Options) ->
?CLASS(ParentT,wxWindow),
@@ -99,30 +106,35 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options)
wxe_util:construct(?wxWindow_new_3,
<<ParentRef:32/?UI,Id:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxWindow(), Size::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowcachebestsize">external documentation</a>.
+-spec cacheBestSize(This, Size) -> ok when
+ This::wxWindow(), Size::{W::integer(), H::integer()}.
cacheBestSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_CacheBestSize,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowcapturemouse">external documentation</a>.
+-spec captureMouse(This) -> ok when
+ This::wxWindow().
captureMouse(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_CaptureMouse,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @equiv center(This, [])
+-spec center(This) -> ok when
+ This::wxWindow().
+
center(This)
when is_record(This, wx_ref) ->
center(This, []).
-%% @spec (This::wxWindow(), [Option]) -> ok
-%% Option = {dir, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowcenter">external documentation</a>.
+-spec center(This, [Option]) -> ok when
+ This::wxWindow(),
+ Option :: {dir, integer()}.
center(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -132,15 +144,18 @@ center(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxWindow_Center,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow()) -> ok
%% @equiv centerOnParent(This, [])
+-spec centerOnParent(This) -> ok when
+ This::wxWindow().
+
centerOnParent(This)
when is_record(This, wx_ref) ->
centerOnParent(This, []).
-%% @spec (This::wxWindow(), [Option]) -> ok
-%% Option = {dir, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowcenteronparent">external documentation</a>.
+-spec centerOnParent(This, [Option]) -> ok when
+ This::wxWindow(),
+ Option :: {dir, integer()}.
centerOnParent(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -150,15 +165,18 @@ centerOnParent(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxWindow_CenterOnParent,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow()) -> ok
%% @equiv centre(This, [])
+-spec centre(This) -> ok when
+ This::wxWindow().
+
centre(This)
when is_record(This, wx_ref) ->
centre(This, []).
-%% @spec (This::wxWindow(), [Option]) -> ok
-%% Option = {dir, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowcentre">external documentation</a>.
+-spec centre(This, [Option]) -> ok when
+ This::wxWindow(),
+ Option :: {dir, integer()}.
centre(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -168,15 +186,18 @@ centre(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxWindow_Centre,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow()) -> ok
%% @equiv centreOnParent(This, [])
+-spec centreOnParent(This) -> ok when
+ This::wxWindow().
+
centreOnParent(This)
when is_record(This, wx_ref) ->
centreOnParent(This, []).
-%% @spec (This::wxWindow(), [Option]) -> ok
-%% Option = {dir, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowcentreonparent">external documentation</a>.
+-spec centreOnParent(This, [Option]) -> ok when
+ This::wxWindow(),
+ Option :: {dir, integer()}.
centreOnParent(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -186,38 +207,44 @@ centreOnParent(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxWindow_CentreOnParent,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowclearbackground">external documentation</a>.
+-spec clearBackground(This) -> ok when
+ This::wxWindow().
clearBackground(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_ClearBackground,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow(), Pt::{X::integer(), Y::integer()}) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowclienttoscreen">external documentation</a>.
+-spec clientToScreen(This, Pt) -> {X::integer(), Y::integer()} when
+ This::wxWindow(), Pt::{X::integer(), Y::integer()}.
clientToScreen(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ClientToScreen_1,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxWindow(), X::integer(), Y::integer()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowclienttoscreen">external documentation</a>.
+-spec clientToScreen(This, X, Y) -> {X::integer(), Y::integer()} when
+ This::wxWindow(), X::integer(), Y::integer().
clientToScreen(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ClientToScreen_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @equiv close(This, [])
+-spec close(This) -> boolean() when
+ This::wxWindow().
+
close(This)
when is_record(This, wx_ref) ->
close(This, []).
-%% @spec (This::wxWindow(), [Option]) -> bool()
-%% Option = {force, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowclose">external documentation</a>.
+-spec close(This, [Option]) -> boolean() when
+ This::wxWindow(),
+ Option :: {force, boolean()}.
close(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -227,52 +254,60 @@ close(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxWindow_Close,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow(), Sz::{W::integer(), H::integer()}) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowconvertdialogtopixels">external documentation</a>.
+-spec convertDialogToPixels(This, Sz) -> {W::integer(), H::integer()} when
+ This::wxWindow(), Sz::{W::integer(), H::integer()}.
convertDialogToPixels(#wx_ref{type=ThisT,ref=ThisRef},{SzW,SzH})
when is_integer(SzW),is_integer(SzH) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ConvertDialogToPixels,
<<ThisRef:32/?UI,SzW:32/?UI,SzH:32/?UI>>).
-%% @spec (This::wxWindow(), Sz::{W::integer(), H::integer()}) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowconvertpixelstodialog">external documentation</a>.
+-spec convertPixelsToDialog(This, Sz) -> {W::integer(), H::integer()} when
+ This::wxWindow(), Sz::{W::integer(), H::integer()}.
convertPixelsToDialog(#wx_ref{type=ThisT,ref=ThisRef},{SzW,SzH})
when is_integer(SzW),is_integer(SzH) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ConvertPixelsToDialog,
<<ThisRef:32/?UI,SzW:32/?UI,SzH:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowdestroy">external documentation</a>.
+-spec 'Destroy'(This) -> boolean() when
+ This::wxWindow().
'Destroy'(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_Destroy,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowdestroychildren">external documentation</a>.
+-spec destroyChildren(This) -> boolean() when
+ This::wxWindow().
destroyChildren(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_DestroyChildren,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowdisable">external documentation</a>.
+-spec disable(This) -> boolean() when
+ This::wxWindow().
disable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_Disable,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @equiv enable(This, [])
+-spec enable(This) -> boolean() when
+ This::wxWindow().
+
enable(This)
when is_record(This, wx_ref) ->
enable(This, []).
-%% @spec (This::wxWindow(), [Option]) -> bool()
-%% Option = {enable, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowenable">external documentation</a>.
+-spec enable(This, [Option]) -> boolean() when
+ This::wxWindow(),
+ Option :: {enable, boolean()}.
enable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -282,21 +317,21 @@ enable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxWindow_Enable,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec () -> wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowfindfocus">external documentation</a>.
+-spec findFocus() -> wxWindow().
findFocus() ->
wxe_util:call(?wxWindow_FindFocus,
<<>>).
-%% @spec (This::wxWindow(),X::integer()|string()) -> wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowfindwindow">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% findWindow(This::wxWindow(), Winid::integer()) -> wxWindow() </c>
-%% </p>
-%% <p><c>
-%% findWindow(This::wxWindow(), Name::string()) -> wxWindow() </c>
-%% </p>
+%% <br /> Also:<br />
+%% findWindow(This, Name) -> wxWindow() when<br />
+%% This::wxWindow(), Name::unicode:chardata().<br />
+%%
+-spec findWindow(This, Winid) -> wxWindow() when
+ This::wxWindow(), Winid::integer();
+ (This, Name) -> wxWindow() when
+ This::wxWindow(), Name::unicode:chardata().
findWindow(#wx_ref{type=ThisT,ref=ThisRef},Winid)
when is_integer(Winid) ->
?CLASS(ThisT,wxWindow),
@@ -309,15 +344,18 @@ findWindow(#wx_ref{type=ThisT,ref=ThisRef},Name)
wxe_util:call(?wxWindow_FindWindow_1_1,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (Winid::integer()) -> wxWindow()
%% @equiv findWindowById(Winid, [])
+-spec findWindowById(Winid) -> wxWindow() when
+ Winid::integer().
+
findWindowById(Winid)
when is_integer(Winid) ->
findWindowById(Winid, []).
-%% @spec (Winid::integer(), [Option]) -> wxWindow()
-%% Option = {parent, wxWindow()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowfindwindowbyid">external documentation</a>.
+-spec findWindowById(Winid, [Option]) -> wxWindow() when
+ Winid::integer(),
+ Option :: {parent, wxWindow()}.
findWindowById(Winid, Options)
when is_integer(Winid),is_list(Options) ->
MOpts = fun({parent, #wx_ref{type=ParentT,ref=ParentRef}}, Acc) -> ?CLASS(ParentT,wxWindow),[<<1:32/?UI,ParentRef:32/?UI>>|Acc];
@@ -326,15 +364,18 @@ findWindowById(Winid, Options)
wxe_util:call(?wxWindow_FindWindowById,
<<Winid:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (Name::string()) -> wxWindow()
%% @equiv findWindowByName(Name, [])
+-spec findWindowByName(Name) -> wxWindow() when
+ Name::unicode:chardata().
+
findWindowByName(Name)
when is_list(Name) ->
findWindowByName(Name, []).
-%% @spec (Name::string(), [Option]) -> wxWindow()
-%% Option = {parent, wxWindow()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowfindwindowbyname">external documentation</a>.
+-spec findWindowByName(Name, [Option]) -> wxWindow() when
+ Name::unicode:chardata(),
+ Option :: {parent, wxWindow()}.
findWindowByName(Name, Options)
when is_list(Name),is_list(Options) ->
Name_UC = unicode:characters_to_binary([Name,0]),
@@ -344,15 +385,18 @@ findWindowByName(Name, Options)
wxe_util:call(?wxWindow_FindWindowByName,
<<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (Label::string()) -> wxWindow()
%% @equiv findWindowByLabel(Label, [])
+-spec findWindowByLabel(Label) -> wxWindow() when
+ Label::unicode:chardata().
+
findWindowByLabel(Label)
when is_list(Label) ->
findWindowByLabel(Label, []).
-%% @spec (Label::string(), [Option]) -> wxWindow()
-%% Option = {parent, wxWindow()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowfindwindowbylabel">external documentation</a>.
+-spec findWindowByLabel(Label, [Option]) -> wxWindow() when
+ Label::unicode:chardata(),
+ Option :: {parent, wxWindow()}.
findWindowByLabel(Label, Options)
when is_list(Label),is_list(Options) ->
Label_UC = unicode:characters_to_binary([Label,0]),
@@ -362,285 +406,326 @@ findWindowByLabel(Label, Options)
wxe_util:call(?wxWindow_FindWindowByLabel,
<<(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowfit">external documentation</a>.
+-spec fit(This) -> ok when
+ This::wxWindow().
fit(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_Fit,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowfitinside">external documentation</a>.
+-spec fitInside(This) -> ok when
+ This::wxWindow().
fitInside(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_FitInside,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowfreeze">external documentation</a>.
+-spec freeze(This) -> ok when
+ This::wxWindow().
freeze(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_Freeze,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> wxAcceleratorTable:wxAcceleratorTable()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetacceleratortable">external documentation</a>.
+-spec getAcceleratorTable(This) -> wxAcceleratorTable:wxAcceleratorTable() when
+ This::wxWindow().
getAcceleratorTable(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetAcceleratorTable,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetbackgroundcolour">external documentation</a>.
+-spec getBackgroundColour(This) -> wx:wx_colour4() when
+ This::wxWindow().
getBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetBackgroundColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> WxBackgroundStyle
-%% WxBackgroundStyle = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetbackgroundstyle">external documentation</a>.
-%%<br /> WxBackgroundStyle is one of ?wxBG_STYLE_SYSTEM | ?wxBG_STYLE_COLOUR | ?wxBG_STYLE_CUSTOM
+%%<br /> Res = ?wxBG_STYLE_SYSTEM | ?wxBG_STYLE_COLOUR | ?wxBG_STYLE_CUSTOM
+-spec getBackgroundStyle(This) -> wx:wx_enum() when
+ This::wxWindow().
getBackgroundStyle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetBackgroundStyle,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetbestsize">external documentation</a>.
+-spec getBestSize(This) -> {W::integer(), H::integer()} when
+ This::wxWindow().
getBestSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetBestSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> wxCaret:wxCaret()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetcaret">external documentation</a>.
+-spec getCaret(This) -> wxCaret:wxCaret() when
+ This::wxWindow().
getCaret(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetCaret,
<<ThisRef:32/?UI>>).
-%% @spec () -> wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetcapture">external documentation</a>.
+-spec getCapture() -> wxWindow().
getCapture() ->
wxe_util:call(?wxWindow_GetCapture,
<<>>).
-%% @spec (This::wxWindow()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetcharheight">external documentation</a>.
+-spec getCharHeight(This) -> integer() when
+ This::wxWindow().
getCharHeight(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetCharHeight,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetcharwidth">external documentation</a>.
+-spec getCharWidth(This) -> integer() when
+ This::wxWindow().
getCharWidth(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetCharWidth,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> [wxWindow()]
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetchildren">external documentation</a>.
+-spec getChildren(This) -> [wxWindow()] when
+ This::wxWindow().
getChildren(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetChildren,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetclientsize">external documentation</a>.
+-spec getClientSize(This) -> {W::integer(), H::integer()} when
+ This::wxWindow().
getClientSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetClientSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> wxSizer:wxSizer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetcontainingsizer">external documentation</a>.
+-spec getContainingSizer(This) -> wxSizer:wxSizer() when
+ This::wxWindow().
getContainingSizer(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetContainingSizer,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> wxCursor:wxCursor()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetcursor">external documentation</a>.
+-spec getCursor(This) -> wxCursor:wxCursor() when
+ This::wxWindow().
getCursor(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetCursor,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> wxDropTarget:wxDropTarget()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetdroptarget">external documentation</a>.
+-spec getDropTarget(This) -> wx:wx_object() when
+ This::wxWindow().
getDropTarget(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetDropTarget,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> wxEvtHandler:wxEvtHandler()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgeteventhandler">external documentation</a>.
+-spec getEventHandler(This) -> wxEvtHandler:wxEvtHandler() when
+ This::wxWindow().
getEventHandler(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetEventHandler,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetextrastyle">external documentation</a>.
+-spec getExtraStyle(This) -> integer() when
+ This::wxWindow().
getExtraStyle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetExtraStyle,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> wxFont:wxFont()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetfont">external documentation</a>.
+-spec getFont(This) -> wxFont:wxFont() when
+ This::wxWindow().
getFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetFont,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> wx:colour()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetforegroundcolour">external documentation</a>.
+-spec getForegroundColour(This) -> wx:wx_colour4() when
+ This::wxWindow().
getForegroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetForegroundColour,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetgrandparent">external documentation</a>.
+-spec getGrandParent(This) -> wxWindow() when
+ This::wxWindow().
getGrandParent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetGrandParent,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgethandle">external documentation</a>.
+-spec getHandle(This) -> integer() when
+ This::wxWindow().
getHandle(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetHandle,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgethelptext">external documentation</a>.
+-spec getHelpText(This) -> unicode:charlist() when
+ This::wxWindow().
getHelpText(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetHelpText,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetid">external documentation</a>.
+-spec getId(This) -> integer() when
+ This::wxWindow().
getId(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetId,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetlabel">external documentation</a>.
+-spec getLabel(This) -> unicode:charlist() when
+ This::wxWindow().
getLabel(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetLabel,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetmaxsize">external documentation</a>.
+-spec getMaxSize(This) -> {W::integer(), H::integer()} when
+ This::wxWindow().
getMaxSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetMaxSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetminsize">external documentation</a>.
+-spec getMinSize(This) -> {W::integer(), H::integer()} when
+ This::wxWindow().
getMinSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetMinSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetname">external documentation</a>.
+-spec getName(This) -> unicode:charlist() when
+ This::wxWindow().
getName(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetName,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetparent">external documentation</a>.
+-spec getParent(This) -> wxWindow() when
+ This::wxWindow().
getParent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetParent,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetposition">external documentation</a>.
+-spec getPosition(This) -> {X::integer(), Y::integer()} when
+ This::wxWindow().
getPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> {X::integer(), Y::integer(), W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetrect">external documentation</a>.
+-spec getRect(This) -> {X::integer(), Y::integer(), W::integer(), H::integer()} when
+ This::wxWindow().
getRect(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetRect,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetscreenposition">external documentation</a>.
+-spec getScreenPosition(This) -> {X::integer(), Y::integer()} when
+ This::wxWindow().
getScreenPosition(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetScreenPosition,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> {X::integer(), Y::integer(), W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetscreenrect">external documentation</a>.
+-spec getScreenRect(This) -> {X::integer(), Y::integer(), W::integer(), H::integer()} when
+ This::wxWindow().
getScreenRect(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetScreenRect,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow(), Orient::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetscrollpos">external documentation</a>.
+-spec getScrollPos(This, Orient) -> integer() when
+ This::wxWindow(), Orient::integer().
getScrollPos(#wx_ref{type=ThisT,ref=ThisRef},Orient)
when is_integer(Orient) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetScrollPos,
<<ThisRef:32/?UI,Orient:32/?UI>>).
-%% @spec (This::wxWindow(), Orient::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetscrollrange">external documentation</a>.
+-spec getScrollRange(This, Orient) -> integer() when
+ This::wxWindow(), Orient::integer().
getScrollRange(#wx_ref{type=ThisT,ref=ThisRef},Orient)
when is_integer(Orient) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetScrollRange,
<<ThisRef:32/?UI,Orient:32/?UI>>).
-%% @spec (This::wxWindow(), Orient::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetscrollthumb">external documentation</a>.
+-spec getScrollThumb(This, Orient) -> integer() when
+ This::wxWindow(), Orient::integer().
getScrollThumb(#wx_ref{type=ThisT,ref=ThisRef},Orient)
when is_integer(Orient) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetScrollThumb,
<<ThisRef:32/?UI,Orient:32/?UI>>).
-%% @spec (This::wxWindow()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetsize">external documentation</a>.
+-spec getSize(This) -> {W::integer(), H::integer()} when
+ This::wxWindow().
getSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> wxSizer:wxSizer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetsizer">external documentation</a>.
+-spec getSizer(This) -> wxSizer:wxSizer() when
+ This::wxWindow().
getSizer(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetSizer,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow(), String::string()) -> {X::integer(), Y::integer(), Descent::integer(), ExternalLeading::integer()}
%% @equiv getTextExtent(This,String, [])
+-spec getTextExtent(This, String) -> Result when
+ Result ::{X::integer(), Y::integer(), Descent::integer(), ExternalLeading::integer()},
+ This::wxWindow(), String::unicode:chardata().
+
getTextExtent(This,String)
when is_record(This, wx_ref),is_list(String) ->
getTextExtent(This,String, []).
-%% @spec (This::wxWindow(), String::string(), [Option]) -> {X::integer(), Y::integer(), Descent::integer(), ExternalLeading::integer()}
-%% Option = {theFont, wxFont:wxFont()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgettextextent">external documentation</a>.
+-spec getTextExtent(This, String, [Option]) -> Result when
+ Result :: {X::integer(), Y::integer(), Descent::integer(), ExternalLeading::integer()},
+ This::wxWindow(), String::unicode:chardata(),
+ Option :: {theFont, wxFont:wxFont()}.
getTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String, Options)
when is_list(String),is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -651,109 +736,121 @@ getTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String, Options)
wxe_util:call(?wxWindow_GetTextExtent,
<<ThisRef:32/?UI,(byte_size(String_UC)):32/?UI,(String_UC)/binary, 0:(((8- ((0+byte_size(String_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxWindow()) -> wxToolTip:wxToolTip()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgettooltip">external documentation</a>.
+-spec getToolTip(This) -> wxToolTip:wxToolTip() when
+ This::wxWindow().
getToolTip(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetToolTip,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> wxRegion:wxRegion()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetupdateregion">external documentation</a>.
+-spec getUpdateRegion(This) -> wxRegion:wxRegion() when
+ This::wxWindow().
getUpdateRegion(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetUpdateRegion,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> {W::integer(), H::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetvirtualsize">external documentation</a>.
+-spec getVirtualSize(This) -> {W::integer(), H::integer()} when
+ This::wxWindow().
getVirtualSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetVirtualSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetwindowstyleflag">external documentation</a>.
+-spec getWindowStyleFlag(This) -> integer() when
+ This::wxWindow().
getWindowStyleFlag(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetWindowStyleFlag,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> WxWindowVariant
-%% WxWindowVariant = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowgetwindowvariant">external documentation</a>.
-%%<br /> WxWindowVariant is one of ?wxWINDOW_VARIANT_NORMAL | ?wxWINDOW_VARIANT_SMALL | ?wxWINDOW_VARIANT_MINI | ?wxWINDOW_VARIANT_LARGE | ?wxWINDOW_VARIANT_MAX
+%%<br /> Res = ?wxWINDOW_VARIANT_NORMAL | ?wxWINDOW_VARIANT_SMALL | ?wxWINDOW_VARIANT_MINI | ?wxWINDOW_VARIANT_LARGE | ?wxWINDOW_VARIANT_MAX
+-spec getWindowVariant(This) -> wx:wx_enum() when
+ This::wxWindow().
getWindowVariant(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_GetWindowVariant,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowhascapture">external documentation</a>.
+-spec hasCapture(This) -> boolean() when
+ This::wxWindow().
hasCapture(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_HasCapture,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow(), Orient::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowhasscrollbar">external documentation</a>.
+-spec hasScrollbar(This, Orient) -> boolean() when
+ This::wxWindow(), Orient::integer().
hasScrollbar(#wx_ref{type=ThisT,ref=ThisRef},Orient)
when is_integer(Orient) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_HasScrollbar,
<<ThisRef:32/?UI,Orient:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowhastransparentbackground">external documentation</a>.
+-spec hasTransparentBackground(This) -> boolean() when
+ This::wxWindow().
hasTransparentBackground(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_HasTransparentBackground,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowhide">external documentation</a>.
+-spec hide(This) -> boolean() when
+ This::wxWindow().
hide(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_Hide,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowinheritattributes">external documentation</a>.
+-spec inheritAttributes(This) -> ok when
+ This::wxWindow().
inheritAttributes(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_InheritAttributes,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowinitdialog">external documentation</a>.
+-spec initDialog(This) -> ok when
+ This::wxWindow().
initDialog(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_InitDialog,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowinvalidatebestsize">external documentation</a>.
+-spec invalidateBestSize(This) -> ok when
+ This::wxWindow().
invalidateBestSize(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_InvalidateBestSize,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowisenabled">external documentation</a>.
+-spec isEnabled(This) -> boolean() when
+ This::wxWindow().
isEnabled(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_IsEnabled,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow(),X::term()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowisexposed">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% isExposed(This::wxWindow(), Pt::{X::integer(), Y::integer()}) -> bool() </c>
-%% </p>
-%% <p><c>
-%% isExposed(This::wxWindow(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> bool() </c>
-%% </p>
+%% <br /> Also:<br />
+%% isExposed(This, Rect) -> boolean() when<br />
+%% This::wxWindow(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.<br />
+%%
+-spec isExposed(This, Pt) -> boolean() when
+ This::wxWindow(), Pt::{X::integer(), Y::integer()};
+ (This, Rect) -> boolean() when
+ This::wxWindow(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
isExposed(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxWindow),
@@ -765,80 +862,92 @@ isExposed(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
wxe_util:call(?wxWindow_IsExposed_1_1,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxWindow(), X::integer(), Y::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowisexposed">external documentation</a>.
+-spec isExposed(This, X, Y) -> boolean() when
+ This::wxWindow(), X::integer(), Y::integer().
isExposed(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_IsExposed_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxWindow(), X::integer(), Y::integer(), W::integer(), H::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowisexposed">external documentation</a>.
+-spec isExposed(This, X, Y, W, H) -> boolean() when
+ This::wxWindow(), X::integer(), Y::integer(), W::integer(), H::integer().
isExposed(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H)
when is_integer(X),is_integer(Y),is_integer(W),is_integer(H) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_IsExposed_4,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,W:32/?UI,H:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowisretained">external documentation</a>.
+-spec isRetained(This) -> boolean() when
+ This::wxWindow().
isRetained(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_IsRetained,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowisshown">external documentation</a>.
+-spec isShown(This) -> boolean() when
+ This::wxWindow().
isShown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_IsShown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowistoplevel">external documentation</a>.
+-spec isTopLevel(This) -> boolean() when
+ This::wxWindow().
isTopLevel(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_IsTopLevel,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowlayout">external documentation</a>.
+-spec layout(This) -> boolean() when
+ This::wxWindow().
layout(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_Layout,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowlinedown">external documentation</a>.
+-spec lineDown(This) -> boolean() when
+ This::wxWindow().
lineDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_LineDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowlineup">external documentation</a>.
+-spec lineUp(This) -> boolean() when
+ This::wxWindow().
lineUp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_LineUp,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowlower">external documentation</a>.
+-spec lower(This) -> ok when
+ This::wxWindow().
lower(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_Lower,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @equiv makeModal(This, [])
+-spec makeModal(This) -> ok when
+ This::wxWindow().
+
makeModal(This)
when is_record(This, wx_ref) ->
makeModal(This, []).
-%% @spec (This::wxWindow(), [Option]) -> ok
-%% Option = {modal, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowmakemodal">external documentation</a>.
+-spec makeModal(This, [Option]) -> ok when
+ This::wxWindow(),
+ Option :: {modal, boolean()}.
makeModal(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -848,21 +957,25 @@ makeModal(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxWindow_MakeModal,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow(), Pt::{X::integer(), Y::integer()}) -> ok
%% @equiv move(This,Pt, [])
+-spec move(This, Pt) -> ok when
+ This::wxWindow(), Pt::{X::integer(), Y::integer()}.
+
move(This,Pt={PtX,PtY})
when is_record(This, wx_ref),is_integer(PtX),is_integer(PtY) ->
move(This,Pt, []).
-%% @spec (This::wxWindow(),X::integer()|term(),X::integer()|term()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowmove">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% move(This::wxWindow(), X::integer(), Y::integer()) -> move(This,X,Y, []) </c></p>
-%% <p><c>
-%% move(This::wxWindow(), Pt::{X::integer(), Y::integer()}, [Option]) -> ok </c>
-%%<br /> Option = {flags, integer()}
-%% </p>
+%% <br /> Also:<br />
+%% move(This, Pt, [Option]) -> ok when<br />
+%% This::wxWindow(), Pt::{X::integer(), Y::integer()},<br />
+%% Option :: {flags, integer()}.<br />
+%%
+-spec move(This, X, Y) -> ok when
+ This::wxWindow(), X::integer(), Y::integer();
+ (This, Pt, [Option]) -> ok when
+ This::wxWindow(), Pt::{X::integer(), Y::integer()},
+ Option :: {flags, integer()}.
move(This,X,Y)
when is_record(This, wx_ref),is_integer(X),is_integer(Y) ->
@@ -876,9 +989,10 @@ move(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY}, Options)
wxe_util:cast(?wxWindow_Move_2,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow(), X::integer(), Y::integer(), [Option]) -> ok
-%% Option = {flags, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowmove">external documentation</a>.
+-spec move(This, X, Y, [Option]) -> ok when
+ This::wxWindow(), X::integer(), Y::integer(),
+ Option :: {flags, integer()}.
move(#wx_ref{type=ThisT,ref=ThisRef},X,Y, Options)
when is_integer(X),is_integer(Y),is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -888,31 +1002,36 @@ move(#wx_ref{type=ThisT,ref=ThisRef},X,Y, Options)
wxe_util:cast(?wxWindow_Move_3,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow(), Win::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowmoveafterintaborder">external documentation</a>.
+-spec moveAfterInTabOrder(This, Win) -> ok when
+ This::wxWindow(), Win::wxWindow().
moveAfterInTabOrder(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WinT,ref=WinRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(WinT,wxWindow),
wxe_util:cast(?wxWindow_MoveAfterInTabOrder,
<<ThisRef:32/?UI,WinRef:32/?UI>>).
-%% @spec (This::wxWindow(), Win::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowmovebeforeintaborder">external documentation</a>.
+-spec moveBeforeInTabOrder(This, Win) -> ok when
+ This::wxWindow(), Win::wxWindow().
moveBeforeInTabOrder(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WinT,ref=WinRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(WinT,wxWindow),
wxe_util:cast(?wxWindow_MoveBeforeInTabOrder,
<<ThisRef:32/?UI,WinRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @equiv navigate(This, [])
+-spec navigate(This) -> boolean() when
+ This::wxWindow().
+
navigate(This)
when is_record(This, wx_ref) ->
navigate(This, []).
-%% @spec (This::wxWindow(), [Option]) -> bool()
-%% Option = {flags, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindownavigate">external documentation</a>.
+-spec navigate(This, [Option]) -> boolean() when
+ This::wxWindow(),
+ Option :: {flags, integer()}.
navigate(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -922,29 +1041,34 @@ navigate(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxWindow_Navigate,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowpagedown">external documentation</a>.
+-spec pageDown(This) -> boolean() when
+ This::wxWindow().
pageDown(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_PageDown,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowpageup">external documentation</a>.
+-spec pageUp(This) -> boolean() when
+ This::wxWindow().
pageUp(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_PageUp,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> wxEvtHandler:wxEvtHandler()
%% @equiv popEventHandler(This, [])
+-spec popEventHandler(This) -> wxEvtHandler:wxEvtHandler() when
+ This::wxWindow().
+
popEventHandler(This)
when is_record(This, wx_ref) ->
popEventHandler(This, []).
-%% @spec (This::wxWindow(), [Option]) -> wxEvtHandler:wxEvtHandler()
-%% Option = {deleteHandler, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowpopeventhandler">external documentation</a>.
+-spec popEventHandler(This, [Option]) -> wxEvtHandler:wxEvtHandler() when
+ This::wxWindow(),
+ Option :: {deleteHandler, boolean()}.
popEventHandler(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -954,15 +1078,18 @@ popEventHandler(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxWindow_PopEventHandler,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow(), Menu::wxMenu:wxMenu()) -> bool()
%% @equiv popupMenu(This,Menu, [])
+-spec popupMenu(This, Menu) -> boolean() when
+ This::wxWindow(), Menu::wxMenu:wxMenu().
+
popupMenu(This,Menu)
when is_record(This, wx_ref),is_record(Menu, wx_ref) ->
popupMenu(This,Menu, []).
-%% @spec (This::wxWindow(), Menu::wxMenu:wxMenu(), [Option]) -> bool()
-%% Option = {pos, {X::integer(), Y::integer()}}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowpopupmenu">external documentation</a>.
+-spec popupMenu(This, Menu, [Option]) -> boolean() when
+ This::wxWindow(), Menu::wxMenu:wxMenu(),
+ Option :: {pos, {X::integer(), Y::integer()}}.
popupMenu(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -973,8 +1100,9 @@ popupMenu(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef}, Optio
wxe_util:call(?wxWindow_PopupMenu_2,
<<ThisRef:32/?UI,MenuRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxWindow(), Menu::wxMenu:wxMenu(), X::integer(), Y::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowpopupmenu">external documentation</a>.
+-spec popupMenu(This, Menu, X, Y) -> boolean() when
+ This::wxWindow(), Menu::wxMenu:wxMenu(), X::integer(), Y::integer().
popupMenu(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxWindow),
@@ -982,22 +1110,27 @@ popupMenu(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef},X,Y)
wxe_util:call(?wxWindow_PopupMenu_3,
<<ThisRef:32/?UI,MenuRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowraise">external documentation</a>.
+-spec raise(This) -> ok when
+ This::wxWindow().
raise(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_Raise,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @equiv refresh(This, [])
+-spec refresh(This) -> ok when
+ This::wxWindow().
+
refresh(This)
when is_record(This, wx_ref) ->
refresh(This, []).
-%% @spec (This::wxWindow(), [Option]) -> ok
-%% Option = {eraseBackground, bool()} | {rect, {X::integer(), Y::integer(), W::integer(), H::integer()}}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowrefresh">external documentation</a>.
+-spec refresh(This, [Option]) -> ok when
+ This::wxWindow(),
+ Option :: {eraseBackground, boolean()}
+ | {rect, {X::integer(), Y::integer(), W::integer(), H::integer()}}.
refresh(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -1008,15 +1141,18 @@ refresh(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxWindow_Refresh,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> ok
%% @equiv refreshRect(This,Rect, [])
+-spec refreshRect(This, Rect) -> ok when
+ This::wxWindow(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
+
refreshRect(This,Rect={RectX,RectY,RectW,RectH})
when is_record(This, wx_ref),is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) ->
refreshRect(This,Rect, []).
-%% @spec (This::wxWindow(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, [Option]) -> ok
-%% Option = {eraseBackground, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowrefreshrect">external documentation</a>.
+-spec refreshRect(This, Rect, [Option]) -> ok when
+ This::wxWindow(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()},
+ Option :: {eraseBackground, boolean()}.
refreshRect(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH}, Options)
when is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH),is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -1026,69 +1162,79 @@ refreshRect(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH}, Options)
wxe_util:cast(?wxWindow_RefreshRect,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowreleasemouse">external documentation</a>.
+-spec releaseMouse(This) -> ok when
+ This::wxWindow().
releaseMouse(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_ReleaseMouse,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow(), Child::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowremovechild">external documentation</a>.
+-spec removeChild(This, Child) -> ok when
+ This::wxWindow(), Child::wxWindow().
removeChild(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ChildT,ref=ChildRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(ChildT,wxWindow),
wxe_util:cast(?wxWindow_RemoveChild,
<<ThisRef:32/?UI,ChildRef:32/?UI>>).
-%% @spec (This::wxWindow(), NewParent::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowreparent">external documentation</a>.
+-spec reparent(This, NewParent) -> boolean() when
+ This::wxWindow(), NewParent::wxWindow().
reparent(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=NewParentT,ref=NewParentRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(NewParentT,wxWindow),
wxe_util:call(?wxWindow_Reparent,
<<ThisRef:32/?UI,NewParentRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowscreentoclient">external documentation</a>.
+-spec screenToClient(This) -> {X::integer(), Y::integer()} when
+ This::wxWindow().
screenToClient(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ScreenToClient_2,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow(), Pt::{X::integer(), Y::integer()}) -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowscreentoclient">external documentation</a>.
+-spec screenToClient(This, Pt) -> {X::integer(), Y::integer()} when
+ This::wxWindow(), Pt::{X::integer(), Y::integer()}.
screenToClient(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ScreenToClient_1,
<<ThisRef:32/?UI,PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (This::wxWindow(), Lines::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowscrolllines">external documentation</a>.
+-spec scrollLines(This, Lines) -> boolean() when
+ This::wxWindow(), Lines::integer().
scrollLines(#wx_ref{type=ThisT,ref=ThisRef},Lines)
when is_integer(Lines) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ScrollLines,
<<ThisRef:32/?UI,Lines:32/?UI>>).
-%% @spec (This::wxWindow(), Pages::integer()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowscrollpages">external documentation</a>.
+-spec scrollPages(This, Pages) -> boolean() when
+ This::wxWindow(), Pages::integer().
scrollPages(#wx_ref{type=ThisT,ref=ThisRef},Pages)
when is_integer(Pages) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ScrollPages,
<<ThisRef:32/?UI,Pages:32/?UI>>).
-%% @spec (This::wxWindow(), Dx::integer(), Dy::integer()) -> ok
%% @equiv scrollWindow(This,Dx,Dy, [])
+-spec scrollWindow(This, Dx, Dy) -> ok when
+ This::wxWindow(), Dx::integer(), Dy::integer().
+
scrollWindow(This,Dx,Dy)
when is_record(This, wx_ref),is_integer(Dx),is_integer(Dy) ->
scrollWindow(This,Dx,Dy, []).
-%% @spec (This::wxWindow(), Dx::integer(), Dy::integer(), [Option]) -> ok
-%% Option = {rect, {X::integer(), Y::integer(), W::integer(), H::integer()}}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowscrollwindow">external documentation</a>.
+-spec scrollWindow(This, Dx, Dy, [Option]) -> ok when
+ This::wxWindow(), Dx::integer(), Dy::integer(),
+ Option :: {rect, {X::integer(), Y::integer(), W::integer(), H::integer()}}.
scrollWindow(#wx_ref{type=ThisT,ref=ThisRef},Dx,Dy, Options)
when is_integer(Dx),is_integer(Dy),is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -1098,57 +1244,61 @@ scrollWindow(#wx_ref{type=ThisT,ref=ThisRef},Dx,Dy, Options)
wxe_util:cast(?wxWindow_ScrollWindow,
<<ThisRef:32/?UI,Dx:32/?UI,Dy:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow(), Accel::wxAcceleratorTable:wxAcceleratorTable()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetacceleratortable">external documentation</a>.
+-spec setAcceleratorTable(This, Accel) -> ok when
+ This::wxWindow(), Accel::wxAcceleratorTable:wxAcceleratorTable().
setAcceleratorTable(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=AccelT,ref=AccelRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(AccelT,wxAcceleratorTable),
wxe_util:cast(?wxWindow_SetAcceleratorTable,
<<ThisRef:32/?UI,AccelRef:32/?UI>>).
-%% @spec (This::wxWindow(), AutoLayout::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetautolayout">external documentation</a>.
+-spec setAutoLayout(This, AutoLayout) -> ok when
+ This::wxWindow(), AutoLayout::boolean().
setAutoLayout(#wx_ref{type=ThisT,ref=ThisRef},AutoLayout)
when is_boolean(AutoLayout) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetAutoLayout,
<<ThisRef:32/?UI,(wxe_util:from_bool(AutoLayout)):32/?UI>>).
-%% @spec (This::wxWindow(), Colour::wx:colour()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetbackgroundcolour">external documentation</a>.
+-spec setBackgroundColour(This, Colour) -> boolean() when
+ This::wxWindow(), Colour::wx:wx_colour().
setBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},Colour)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_SetBackgroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
-%% @spec (This::wxWindow(), Style::WxBackgroundStyle) -> bool()
-%% WxBackgroundStyle = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetbackgroundstyle">external documentation</a>.
-%%<br /> WxBackgroundStyle is one of ?wxBG_STYLE_SYSTEM | ?wxBG_STYLE_COLOUR | ?wxBG_STYLE_CUSTOM
+%%<br /> Style = ?wxBG_STYLE_SYSTEM | ?wxBG_STYLE_COLOUR | ?wxBG_STYLE_CUSTOM
+-spec setBackgroundStyle(This, Style) -> boolean() when
+ This::wxWindow(), Style::wx:wx_enum().
setBackgroundStyle(#wx_ref{type=ThisT,ref=ThisRef},Style)
when is_integer(Style) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_SetBackgroundStyle,
<<ThisRef:32/?UI,Style:32/?UI>>).
-%% @spec (This::wxWindow(), Caret::wxCaret:wxCaret()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetcaret">external documentation</a>.
+-spec setCaret(This, Caret) -> ok when
+ This::wxWindow(), Caret::wxCaret:wxCaret().
setCaret(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=CaretT,ref=CaretRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(CaretT,wxCaret),
wxe_util:cast(?wxWindow_SetCaret,
<<ThisRef:32/?UI,CaretRef:32/?UI>>).
-%% @spec (This::wxWindow(),X::term()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetclientsize">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setClientSize(This::wxWindow(), Size::{W::integer(), H::integer()}) -> ok </c>
-%% </p>
-%% <p><c>
-%% setClientSize(This::wxWindow(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% setClientSize(This, Rect) -> ok when<br />
+%% This::wxWindow(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.<br />
+%%
+-spec setClientSize(This, Size) -> ok when
+ This::wxWindow(), Size::{W::integer(), H::integer()};
+ (This, Rect) -> ok when
+ This::wxWindow(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}.
setClientSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxWindow),
@@ -1160,118 +1310,133 @@ setClientSize(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH})
wxe_util:cast(?wxWindow_SetClientSize_1_1,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI>>).
-%% @spec (This::wxWindow(), Width::integer(), Height::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetclientsize">external documentation</a>.
+-spec setClientSize(This, Width, Height) -> ok when
+ This::wxWindow(), Width::integer(), Height::integer().
setClientSize(#wx_ref{type=ThisT,ref=ThisRef},Width,Height)
when is_integer(Width),is_integer(Height) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetClientSize_2,
<<ThisRef:32/?UI,Width:32/?UI,Height:32/?UI>>).
-%% @spec (This::wxWindow(), Sizer::wxSizer:wxSizer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetcontainingsizer">external documentation</a>.
+-spec setContainingSizer(This, Sizer) -> ok when
+ This::wxWindow(), Sizer::wxSizer:wxSizer().
setContainingSizer(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=SizerT,ref=SizerRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(SizerT,wxSizer),
wxe_util:cast(?wxWindow_SetContainingSizer,
<<ThisRef:32/?UI,SizerRef:32/?UI>>).
-%% @spec (This::wxWindow(), Cursor::wxCursor:wxCursor()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetcursor">external documentation</a>.
+-spec setCursor(This, Cursor) -> boolean() when
+ This::wxWindow(), Cursor::wxCursor:wxCursor().
setCursor(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=CursorT,ref=CursorRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(CursorT,wxCursor),
wxe_util:call(?wxWindow_SetCursor,
<<ThisRef:32/?UI,CursorRef:32/?UI>>).
-%% @spec (This::wxWindow(), MaxSize::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetmaxsize">external documentation</a>.
+-spec setMaxSize(This, MaxSize) -> ok when
+ This::wxWindow(), MaxSize::{W::integer(), H::integer()}.
setMaxSize(#wx_ref{type=ThisT,ref=ThisRef},{MaxSizeW,MaxSizeH})
when is_integer(MaxSizeW),is_integer(MaxSizeH) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetMaxSize,
<<ThisRef:32/?UI,MaxSizeW:32/?UI,MaxSizeH:32/?UI>>).
-%% @spec (This::wxWindow(), MinSize::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetminsize">external documentation</a>.
+-spec setMinSize(This, MinSize) -> ok when
+ This::wxWindow(), MinSize::{W::integer(), H::integer()}.
setMinSize(#wx_ref{type=ThisT,ref=ThisRef},{MinSizeW,MinSizeH})
when is_integer(MinSizeW),is_integer(MinSizeH) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetMinSize,
<<ThisRef:32/?UI,MinSizeW:32/?UI,MinSizeH:32/?UI>>).
-%% @spec (This::wxWindow(), Colour::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetownbackgroundcolour">external documentation</a>.
+-spec setOwnBackgroundColour(This, Colour) -> ok when
+ This::wxWindow(), Colour::wx:wx_colour().
setOwnBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},Colour)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetOwnBackgroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
-%% @spec (This::wxWindow(), Font::wxFont:wxFont()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetownfont">external documentation</a>.
+-spec setOwnFont(This, Font) -> ok when
+ This::wxWindow(), Font::wxFont:wxFont().
setOwnFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(FontT,wxFont),
wxe_util:cast(?wxWindow_SetOwnFont,
<<ThisRef:32/?UI,FontRef:32/?UI>>).
-%% @spec (This::wxWindow(), Colour::wx:colour()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetownforegroundcolour">external documentation</a>.
+-spec setOwnForegroundColour(This, Colour) -> ok when
+ This::wxWindow(), Colour::wx:wx_colour().
setOwnForegroundColour(#wx_ref{type=ThisT,ref=ThisRef},Colour)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetOwnForegroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
-%% @spec (This::wxWindow(), DropTarget::wxDropTarget:wxDropTarget()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetdroptarget">external documentation</a>.
+-spec setDropTarget(This, DropTarget) -> ok when
+ This::wxWindow(), DropTarget::wx:wx_object().
setDropTarget(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DropTargetT,ref=DropTargetRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(DropTargetT,wxDropTarget),
wxe_util:cast(?wxWindow_SetDropTarget,
<<ThisRef:32/?UI,DropTargetRef:32/?UI>>).
-%% @spec (This::wxWindow(), ExStyle::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetextrastyle">external documentation</a>.
+-spec setExtraStyle(This, ExStyle) -> ok when
+ This::wxWindow(), ExStyle::integer().
setExtraStyle(#wx_ref{type=ThisT,ref=ThisRef},ExStyle)
when is_integer(ExStyle) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetExtraStyle,
<<ThisRef:32/?UI,ExStyle:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetfocus">external documentation</a>.
+-spec setFocus(This) -> ok when
+ This::wxWindow().
setFocus(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetFocus,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetfocusfromkbd">external documentation</a>.
+-spec setFocusFromKbd(This) -> ok when
+ This::wxWindow().
setFocusFromKbd(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetFocusFromKbd,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow(), Font::wxFont:wxFont()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetfont">external documentation</a>.
+-spec setFont(This, Font) -> boolean() when
+ This::wxWindow(), Font::wxFont:wxFont().
setFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(FontT,wxFont),
wxe_util:call(?wxWindow_SetFont,
<<ThisRef:32/?UI,FontRef:32/?UI>>).
-%% @spec (This::wxWindow(), Colour::wx:colour()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetforegroundcolour">external documentation</a>.
+-spec setForegroundColour(This, Colour) -> boolean() when
+ This::wxWindow(), Colour::wx:wx_colour().
setForegroundColour(#wx_ref{type=ThisT,ref=ThisRef},Colour)
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_SetForegroundColour,
<<ThisRef:32/?UI,(wxe_util:colour_bin(Colour)):16/binary>>).
-%% @spec (This::wxWindow(), Text::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsethelptext">external documentation</a>.
+-spec setHelpText(This, Text) -> ok when
+ This::wxWindow(), Text::unicode:chardata().
setHelpText(#wx_ref{type=ThisT,ref=ThisRef},Text)
when is_list(Text) ->
?CLASS(ThisT,wxWindow),
@@ -1279,16 +1444,18 @@ setHelpText(#wx_ref{type=ThisT,ref=ThisRef},Text)
wxe_util:cast(?wxWindow_SetHelpText,
<<ThisRef:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxWindow(), Winid::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetid">external documentation</a>.
+-spec setId(This, Winid) -> ok when
+ This::wxWindow(), Winid::integer().
setId(#wx_ref{type=ThisT,ref=ThisRef},Winid)
when is_integer(Winid) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetId,
<<ThisRef:32/?UI,Winid:32/?UI>>).
-%% @spec (This::wxWindow(), Label::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetlabel">external documentation</a>.
+-spec setLabel(This, Label) -> ok when
+ This::wxWindow(), Label::unicode:chardata().
setLabel(#wx_ref{type=ThisT,ref=ThisRef},Label)
when is_list(Label) ->
?CLASS(ThisT,wxWindow),
@@ -1296,8 +1463,9 @@ setLabel(#wx_ref{type=ThisT,ref=ThisRef},Label)
wxe_util:cast(?wxWindow_SetLabel,
<<ThisRef:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((0+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxWindow(), Name::string()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetname">external documentation</a>.
+-spec setName(This, Name) -> ok when
+ This::wxWindow(), Name::unicode:chardata().
setName(#wx_ref{type=ThisT,ref=ThisRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxWindow),
@@ -1305,23 +1473,27 @@ setName(#wx_ref{type=ThisT,ref=ThisRef},Name)
wxe_util:cast(?wxWindow_SetName,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxWindow(), Pal::wxPalette:wxPalette()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetpalette">external documentation</a>.
+-spec setPalette(This, Pal) -> ok when
+ This::wxWindow(), Pal::wxPalette:wxPalette().
setPalette(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PalT,ref=PalRef}) ->
?CLASS(ThisT,wxWindow),
?CLASS(PalT,wxPalette),
wxe_util:cast(?wxWindow_SetPalette,
<<ThisRef:32/?UI,PalRef:32/?UI>>).
-%% @spec (This::wxWindow(), Orient::integer(), Pos::integer(), ThumbVisible::integer(), Range::integer()) -> ok
%% @equiv setScrollbar(This,Orient,Pos,ThumbVisible,Range, [])
+-spec setScrollbar(This, Orient, Pos, ThumbVisible, Range) -> ok when
+ This::wxWindow(), Orient::integer(), Pos::integer(), ThumbVisible::integer(), Range::integer().
+
setScrollbar(This,Orient,Pos,ThumbVisible,Range)
when is_record(This, wx_ref),is_integer(Orient),is_integer(Pos),is_integer(ThumbVisible),is_integer(Range) ->
setScrollbar(This,Orient,Pos,ThumbVisible,Range, []).
-%% @spec (This::wxWindow(), Orient::integer(), Pos::integer(), ThumbVisible::integer(), Range::integer(), [Option]) -> ok
-%% Option = {refresh, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetscrollbar">external documentation</a>.
+-spec setScrollbar(This, Orient, Pos, ThumbVisible, Range, [Option]) -> ok when
+ This::wxWindow(), Orient::integer(), Pos::integer(), ThumbVisible::integer(), Range::integer(),
+ Option :: {refresh, boolean()}.
setScrollbar(#wx_ref{type=ThisT,ref=ThisRef},Orient,Pos,ThumbVisible,Range, Options)
when is_integer(Orient),is_integer(Pos),is_integer(ThumbVisible),is_integer(Range),is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -1331,15 +1503,18 @@ setScrollbar(#wx_ref{type=ThisT,ref=ThisRef},Orient,Pos,ThumbVisible,Range, Opti
wxe_util:cast(?wxWindow_SetScrollbar,
<<ThisRef:32/?UI,Orient:32/?UI,Pos:32/?UI,ThumbVisible:32/?UI,Range:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow(), Orient::integer(), Pos::integer()) -> ok
%% @equiv setScrollPos(This,Orient,Pos, [])
+-spec setScrollPos(This, Orient, Pos) -> ok when
+ This::wxWindow(), Orient::integer(), Pos::integer().
+
setScrollPos(This,Orient,Pos)
when is_record(This, wx_ref),is_integer(Orient),is_integer(Pos) ->
setScrollPos(This,Orient,Pos, []).
-%% @spec (This::wxWindow(), Orient::integer(), Pos::integer(), [Option]) -> ok
-%% Option = {refresh, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetscrollpos">external documentation</a>.
+-spec setScrollPos(This, Orient, Pos, [Option]) -> ok when
+ This::wxWindow(), Orient::integer(), Pos::integer(),
+ Option :: {refresh, boolean()}.
setScrollPos(#wx_ref{type=ThisT,ref=ThisRef},Orient,Pos, Options)
when is_integer(Orient),is_integer(Pos),is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -1349,14 +1524,15 @@ setScrollPos(#wx_ref{type=ThisT,ref=ThisRef},Orient,Pos, Options)
wxe_util:cast(?wxWindow_SetScrollPos,
<<ThisRef:32/?UI,Orient:32/?UI,Pos:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow(),X::term()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetsize">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setSize(This::wxWindow(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}) -> setSize(This,Rect, []) </c></p>
-%% <p><c>
-%% setSize(This::wxWindow(), Size::{W::integer(), H::integer()}) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% setSize(This, Size) -> ok when<br />
+%% This::wxWindow(), Size::{W::integer(), H::integer()}.<br />
+%%
+-spec setSize(This, Rect) -> ok when
+ This::wxWindow(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()};
+ (This, Size) -> ok when
+ This::wxWindow(), Size::{W::integer(), H::integer()}.
setSize(This,Rect={RectX,RectY,RectW,RectH})
when is_record(This, wx_ref),is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) ->
@@ -1367,16 +1543,17 @@ setSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
wxe_util:cast(?wxWindow_SetSize_1,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxWindow(),X::integer()|term(),X::integer()|term()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetsize">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setSize(This::wxWindow(), Width::integer(), Height::integer()) -> ok </c>
-%% </p>
-%% <p><c>
-%% setSize(This::wxWindow(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}, [Option]) -> ok </c>
-%%<br /> Option = {sizeFlags, integer()}
-%% </p>
+%% <br /> Also:<br />
+%% setSize(This, Rect, [Option]) -> ok when<br />
+%% This::wxWindow(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()},<br />
+%% Option :: {sizeFlags, integer()}.<br />
+%%
+-spec setSize(This, Width, Height) -> ok when
+ This::wxWindow(), Width::integer(), Height::integer();
+ (This, Rect, [Option]) -> ok when
+ This::wxWindow(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()},
+ Option :: {sizeFlags, integer()}.
setSize(#wx_ref{type=ThisT,ref=ThisRef},Width,Height)
when is_integer(Width),is_integer(Height) ->
?CLASS(ThisT,wxWindow),
@@ -1391,15 +1568,18 @@ setSize(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH}, Options)
wxe_util:cast(?wxWindow_SetSize_2_1,
<<ThisRef:32/?UI,RectX:32/?UI,RectY:32/?UI,RectW:32/?UI,RectH:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow(), X::integer(), Y::integer(), Width::integer(), Height::integer()) -> ok
%% @equiv setSize(This,X,Y,Width,Height, [])
+-spec setSize(This, X, Y, Width, Height) -> ok when
+ This::wxWindow(), X::integer(), Y::integer(), Width::integer(), Height::integer().
+
setSize(This,X,Y,Width,Height)
when is_record(This, wx_ref),is_integer(X),is_integer(Y),is_integer(Width),is_integer(Height) ->
setSize(This,X,Y,Width,Height, []).
-%% @spec (This::wxWindow(), X::integer(), Y::integer(), Width::integer(), Height::integer(), [Option]) -> ok
-%% Option = {sizeFlags, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetsize">external documentation</a>.
+-spec setSize(This, X, Y, Width, Height, [Option]) -> ok when
+ This::wxWindow(), X::integer(), Y::integer(), Width::integer(), Height::integer(),
+ Option :: {sizeFlags, integer()}.
setSize(#wx_ref{type=ThisT,ref=ThisRef},X,Y,Width,Height, Options)
when is_integer(X),is_integer(Y),is_integer(Width),is_integer(Height),is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -1409,21 +1589,27 @@ setSize(#wx_ref{type=ThisT,ref=ThisRef},X,Y,Width,Height, Options)
wxe_util:cast(?wxWindow_SetSize_5,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI,Width:32/?UI,Height:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow(), MinSize::{W::integer(), H::integer()}) -> ok
%% @equiv setSizeHints(This,MinSize, [])
+-spec setSizeHints(This, MinSize) -> ok when
+ This::wxWindow(), MinSize::{W::integer(), H::integer()}.
+
setSizeHints(This,MinSize={MinSizeW,MinSizeH})
when is_record(This, wx_ref),is_integer(MinSizeW),is_integer(MinSizeH) ->
setSizeHints(This,MinSize, []).
-%% @spec (This::wxWindow(),X::integer()|term(),X::integer()|term()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetsizehints">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setSizeHints(This::wxWindow(), MinW::integer(), MinH::integer()) -> setSizeHints(This,MinW,MinH, []) </c></p>
-%% <p><c>
-%% setSizeHints(This::wxWindow(), MinSize::{W::integer(), H::integer()}, [Option]) -> ok </c>
-%%<br /> Option = {maxSize, {W::integer(), H::integer()}} | {incSize, {W::integer(), H::integer()}}
-%% </p>
+%% <br /> Also:<br />
+%% setSizeHints(This, MinSize, [Option]) -> ok when<br />
+%% This::wxWindow(), MinSize::{W::integer(), H::integer()},<br />
+%% Option :: {maxSize, {W::integer(), H::integer()}}<br />
+%% | {incSize, {W::integer(), H::integer()}}.<br />
+%%
+-spec setSizeHints(This, MinW, MinH) -> ok when
+ This::wxWindow(), MinW::integer(), MinH::integer();
+ (This, MinSize, [Option]) -> ok when
+ This::wxWindow(), MinSize::{W::integer(), H::integer()},
+ Option :: {maxSize, {W::integer(), H::integer()}}
+ | {incSize, {W::integer(), H::integer()}}.
setSizeHints(This,MinW,MinH)
when is_record(This, wx_ref),is_integer(MinW),is_integer(MinH) ->
@@ -1438,9 +1624,13 @@ setSizeHints(#wx_ref{type=ThisT,ref=ThisRef},{MinSizeW,MinSizeH}, Options)
wxe_util:cast(?wxWindow_SetSizeHints_2,
<<ThisRef:32/?UI,MinSizeW:32/?UI,MinSizeH:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow(), MinW::integer(), MinH::integer(), [Option]) -> ok
-%% Option = {maxW, integer()} | {maxH, integer()} | {incW, integer()} | {incH, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetsizehints">external documentation</a>.
+-spec setSizeHints(This, MinW, MinH, [Option]) -> ok when
+ This::wxWindow(), MinW::integer(), MinH::integer(),
+ Option :: {maxW, integer()}
+ | {maxH, integer()}
+ | {incW, integer()}
+ | {incH, integer()}.
setSizeHints(#wx_ref{type=ThisT,ref=ThisRef},MinW,MinH, Options)
when is_integer(MinW),is_integer(MinH),is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -1453,15 +1643,18 @@ setSizeHints(#wx_ref{type=ThisT,ref=ThisRef},MinW,MinH, Options)
wxe_util:cast(?wxWindow_SetSizeHints_3,
<<ThisRef:32/?UI,MinW:32/?UI,MinH:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow(), Sizer::wxSizer:wxSizer()) -> ok
%% @equiv setSizer(This,Sizer, [])
+-spec setSizer(This, Sizer) -> ok when
+ This::wxWindow(), Sizer::wxSizer:wxSizer().
+
setSizer(This,Sizer)
when is_record(This, wx_ref),is_record(Sizer, wx_ref) ->
setSizer(This,Sizer, []).
-%% @spec (This::wxWindow(), Sizer::wxSizer:wxSizer(), [Option]) -> ok
-%% Option = {deleteOld, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetsizer">external documentation</a>.
+-spec setSizer(This, Sizer, [Option]) -> ok when
+ This::wxWindow(), Sizer::wxSizer:wxSizer(),
+ Option :: {deleteOld, boolean()}.
setSizer(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=SizerT,ref=SizerRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -1472,15 +1665,18 @@ setSizer(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=SizerT,ref=SizerRef}, Opti
wxe_util:cast(?wxWindow_SetSizer,
<<ThisRef:32/?UI,SizerRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxWindow(), Sizer::wxSizer:wxSizer()) -> ok
%% @equiv setSizerAndFit(This,Sizer, [])
+-spec setSizerAndFit(This, Sizer) -> ok when
+ This::wxWindow(), Sizer::wxSizer:wxSizer().
+
setSizerAndFit(This,Sizer)
when is_record(This, wx_ref),is_record(Sizer, wx_ref) ->
setSizerAndFit(This,Sizer, []).
-%% @spec (This::wxWindow(), Sizer::wxSizer:wxSizer(), [Option]) -> ok
-%% Option = {deleteOld, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetsizerandfit">external documentation</a>.
+-spec setSizerAndFit(This, Sizer, [Option]) -> ok when
+ This::wxWindow(), Sizer::wxSizer:wxSizer(),
+ Option :: {deleteOld, boolean()}.
setSizerAndFit(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=SizerT,ref=SizerRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -1491,23 +1687,24 @@ setSizerAndFit(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=SizerT,ref=SizerRef}
wxe_util:cast(?wxWindow_SetSizerAndFit,
<<ThisRef:32/?UI,SizerRef:32/?UI, BinOpt/binary>>).
-%% @spec (This::wxWindow(), EnableTheme::bool()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetthemeenabled">external documentation</a>.
+-spec setThemeEnabled(This, EnableTheme) -> ok when
+ This::wxWindow(), EnableTheme::boolean().
setThemeEnabled(#wx_ref{type=ThisT,ref=ThisRef},EnableTheme)
when is_boolean(EnableTheme) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetThemeEnabled,
<<ThisRef:32/?UI,(wxe_util:from_bool(EnableTheme)):32/?UI>>).
-%% @spec (This::wxWindow(),X::string()|term()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsettooltip">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setToolTip(This::wxWindow(), Tip::string()) -> ok </c>
-%% </p>
-%% <p><c>
-%% setToolTip(This::wxWindow(), Tip::wxToolTip:wxToolTip()) -> ok </c>
-%% </p>
+%% <br /> Also:<br />
+%% setToolTip(This, Tip) -> ok when<br />
+%% This::wxWindow(), Tip::wxToolTip:wxToolTip().<br />
+%%
+-spec setToolTip(This, Tip) -> ok when
+ This::wxWindow(), Tip::unicode:chardata();
+ (This, Tip) -> ok when
+ This::wxWindow(), Tip::wxToolTip:wxToolTip().
setToolTip(#wx_ref{type=ThisT,ref=ThisRef},Tip)
when is_list(Tip) ->
?CLASS(ThisT,wxWindow),
@@ -1520,37 +1717,43 @@ setToolTip(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=TipT,ref=TipRef}) ->
wxe_util:cast(?wxWindow_SetToolTip_1_1,
<<ThisRef:32/?UI,TipRef:32/?UI>>).
-%% @spec (This::wxWindow(), Size::{W::integer(), H::integer()}) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetvirtualsize">external documentation</a>.
+-spec setVirtualSize(This, Size) -> ok when
+ This::wxWindow(), Size::{W::integer(), H::integer()}.
setVirtualSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH})
when is_integer(SizeW),is_integer(SizeH) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetVirtualSize_1,
<<ThisRef:32/?UI,SizeW:32/?UI,SizeH:32/?UI>>).
-%% @spec (This::wxWindow(), X::integer(), Y::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetvirtualsize">external documentation</a>.
+-spec setVirtualSize(This, X, Y) -> ok when
+ This::wxWindow(), X::integer(), Y::integer().
setVirtualSize(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetVirtualSize_2,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxWindow(), MinSize::{W::integer(), H::integer()}) -> ok
%% @equiv setVirtualSizeHints(This,MinSize, [])
+-spec setVirtualSizeHints(This, MinSize) -> ok when
+ This::wxWindow(), MinSize::{W::integer(), H::integer()}.
+
setVirtualSizeHints(This,MinSize={MinSizeW,MinSizeH})
when is_record(This, wx_ref),is_integer(MinSizeW),is_integer(MinSizeH) ->
setVirtualSizeHints(This,MinSize, []).
-%% @spec (This::wxWindow(),X::integer()|term(),X::integer()|term()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetvirtualsizehints">external documentation</a>.
-%% <br /> Alternatives:
-%% <p><c>
-%% setVirtualSizeHints(This::wxWindow(), MinW::integer(), MinH::integer()) -> setVirtualSizeHints(This,MinW,MinH, []) </c></p>
-%% <p><c>
-%% setVirtualSizeHints(This::wxWindow(), MinSize::{W::integer(), H::integer()}, [Option]) -> ok </c>
-%%<br /> Option = {maxSize, {W::integer(), H::integer()}}
-%% </p>
+%% <br /> Also:<br />
+%% setVirtualSizeHints(This, MinSize, [Option]) -> ok when<br />
+%% This::wxWindow(), MinSize::{W::integer(), H::integer()},<br />
+%% Option :: {maxSize, {W::integer(), H::integer()}}.<br />
+%%
+-spec setVirtualSizeHints(This, MinW, MinH) -> ok when
+ This::wxWindow(), MinW::integer(), MinH::integer();
+ (This, MinSize, [Option]) -> ok when
+ This::wxWindow(), MinSize::{W::integer(), H::integer()},
+ Option :: {maxSize, {W::integer(), H::integer()}}.
setVirtualSizeHints(This,MinW,MinH)
when is_record(This, wx_ref),is_integer(MinW),is_integer(MinH) ->
@@ -1564,9 +1767,11 @@ setVirtualSizeHints(#wx_ref{type=ThisT,ref=ThisRef},{MinSizeW,MinSizeH}, Options
wxe_util:cast(?wxWindow_SetVirtualSizeHints_2,
<<ThisRef:32/?UI,MinSizeW:32/?UI,MinSizeH:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow(), MinW::integer(), MinH::integer(), [Option]) -> ok
-%% Option = {maxW, integer()} | {maxH, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetvirtualsizehints">external documentation</a>.
+-spec setVirtualSizeHints(This, MinW, MinH, [Option]) -> ok when
+ This::wxWindow(), MinW::integer(), MinH::integer(),
+ Option :: {maxW, integer()}
+ | {maxH, integer()}.
setVirtualSizeHints(#wx_ref{type=ThisT,ref=ThisRef},MinW,MinH, Options)
when is_integer(MinW),is_integer(MinH),is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -1577,48 +1782,54 @@ setVirtualSizeHints(#wx_ref{type=ThisT,ref=ThisRef},MinW,MinH, Options)
wxe_util:cast(?wxWindow_SetVirtualSizeHints_3,
<<ThisRef:32/?UI,MinW:32/?UI,MinH:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow(), Style::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetwindowstyle">external documentation</a>.
+-spec setWindowStyle(This, Style) -> ok when
+ This::wxWindow(), Style::integer().
setWindowStyle(#wx_ref{type=ThisT,ref=ThisRef},Style)
when is_integer(Style) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetWindowStyle,
<<ThisRef:32/?UI,Style:32/?UI>>).
-%% @spec (This::wxWindow(), Style::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetwindowstyleflag">external documentation</a>.
+-spec setWindowStyleFlag(This, Style) -> ok when
+ This::wxWindow(), Style::integer().
setWindowStyleFlag(#wx_ref{type=ThisT,ref=ThisRef},Style)
when is_integer(Style) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetWindowStyleFlag,
<<ThisRef:32/?UI,Style:32/?UI>>).
-%% @spec (This::wxWindow(), Variant::WxWindowVariant) -> ok
-%% WxWindowVariant = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowsetwindowvariant">external documentation</a>.
-%%<br /> WxWindowVariant is one of ?wxWINDOW_VARIANT_NORMAL | ?wxWINDOW_VARIANT_SMALL | ?wxWINDOW_VARIANT_MINI | ?wxWINDOW_VARIANT_LARGE | ?wxWINDOW_VARIANT_MAX
+%%<br /> Variant = ?wxWINDOW_VARIANT_NORMAL | ?wxWINDOW_VARIANT_SMALL | ?wxWINDOW_VARIANT_MINI | ?wxWINDOW_VARIANT_LARGE | ?wxWINDOW_VARIANT_MAX
+-spec setWindowVariant(This, Variant) -> ok when
+ This::wxWindow(), Variant::wx:wx_enum().
setWindowVariant(#wx_ref{type=ThisT,ref=ThisRef},Variant)
when is_integer(Variant) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_SetWindowVariant,
<<ThisRef:32/?UI,Variant:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowshouldinheritcolours">external documentation</a>.
+-spec shouldInheritColours(This) -> boolean() when
+ This::wxWindow().
shouldInheritColours(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_ShouldInheritColours,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @equiv show(This, [])
+-spec show(This) -> boolean() when
+ This::wxWindow().
+
show(This)
when is_record(This, wx_ref) ->
show(This, []).
-%% @spec (This::wxWindow(), [Option]) -> bool()
-%% Option = {show, bool()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowshow">external documentation</a>.
+-spec show(This, [Option]) -> boolean() when
+ This::wxWindow(),
+ Option :: {show, boolean()}.
show(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -1628,43 +1839,50 @@ show(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:call(?wxWindow_Show,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowthaw">external documentation</a>.
+-spec thaw(This) -> ok when
+ This::wxWindow().
thaw(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_Thaw,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowtransferdatafromwindow">external documentation</a>.
+-spec transferDataFromWindow(This) -> boolean() when
+ This::wxWindow().
transferDataFromWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_TransferDataFromWindow,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowtransferdatatowindow">external documentation</a>.
+-spec transferDataToWindow(This) -> boolean() when
+ This::wxWindow().
transferDataToWindow(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_TransferDataToWindow,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowupdate">external documentation</a>.
+-spec update(This) -> ok when
+ This::wxWindow().
update(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_Update,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @equiv updateWindowUI(This, [])
+-spec updateWindowUI(This) -> ok when
+ This::wxWindow().
+
updateWindowUI(This)
when is_record(This, wx_ref) ->
updateWindowUI(This, []).
-%% @spec (This::wxWindow(), [Option]) -> ok
-%% Option = {flags, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowupdatewindowui">external documentation</a>.
+-spec updateWindowUI(This, [Option]) -> ok when
+ This::wxWindow(),
+ Option :: {flags, integer()}.
updateWindowUI(#wx_ref{type=ThisT,ref=ThisRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxWindow),
@@ -1674,23 +1892,25 @@ updateWindowUI(#wx_ref{type=ThisT,ref=ThisRef}, Options)
wxe_util:cast(?wxWindow_UpdateWindowUI,
<<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxWindow()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowvalidate">external documentation</a>.
+-spec validate(This) -> boolean() when
+ This::wxWindow().
validate(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxWindow),
wxe_util:call(?wxWindow_Validate,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxWindow(), X::integer(), Y::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindow.html#wxwindowwarppointer">external documentation</a>.
+-spec warpPointer(This, X, Y) -> ok when
+ This::wxWindow(), X::integer(), Y::integer().
warpPointer(#wx_ref{type=ThisT,ref=ThisRef},X,Y)
when is_integer(X),is_integer(Y) ->
?CLASS(ThisT,wxWindow),
wxe_util:cast(?wxWindow_WarpPointer,
<<ThisRef:32/?UI,X:32/?UI,Y:32/?UI>>).
-%% @spec (This::wxWindow()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxWindow()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxWindow),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wxWindowCreateEvent.erl b/lib/wx/src/gen/wxWindowCreateEvent.erl
index c8b3c74f81..f17d6011d9 100644
--- a/lib/wx/src/gen/wxWindowCreateEvent.erl
+++ b/lib/wx/src/gen/wxWindowCreateEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -40,11 +40,13 @@
parent_class/1,resumePropagation/2,setInt/2,setString/2,shouldPropagate/1,
skip/1,skip/2,stopPropagation/1]).
+-export_type([wxWindowCreateEvent/0]).
%% @hidden
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxWindowCreateEvent() :: wx:wx_object().
%% From wxCommandEvent
%% @hidden
setString(This,S) -> wxCommandEvent:setString(This,S).
diff --git a/lib/wx/src/gen/wxWindowDC.erl b/lib/wx/src/gen/wxWindowDC.erl
index 17cbd3d378..babb3c0e90 100644
--- a/lib/wx/src/gen/wxWindowDC.erl
+++ b/lib/wx/src/gen/wxWindowDC.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -38,10 +38,10 @@
drawPoint/2,drawPolygon/2,drawPolygon/3,drawRectangle/2,drawRectangle/3,
drawRotatedText/4,drawRoundedRectangle/3,drawRoundedRectangle/4,
drawText/3,endDoc/1,endPage/1,floodFill/3,floodFill/4,getBackground/1,
- getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/2,
+ getBackgroundMode/1,getBrush/1,getCharHeight/1,getCharWidth/1,getClippingBox/1,
getFont/1,getLayoutDirection/1,getLogicalFunction/1,getMapMode/1,
- getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/3,
- getPen/1,getPixel/3,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
+ getMultiLineTextExtent/2,getMultiLineTextExtent/3,getPPI/1,getPartialTextExtents/2,
+ getPen/1,getPixel/2,getSize/1,getSizeMM/1,getTextBackground/1,getTextExtent/2,
getTextExtent/3,getTextForeground/1,getUserScale/1,gradientFillConcentric/4,
gradientFillConcentric/5,gradientFillLinear/4,gradientFillLinear/5,
isOk/1,logicalToDeviceX/2,logicalToDeviceXRel/2,logicalToDeviceY/2,
@@ -52,25 +52,28 @@
setPen/2,setTextBackground/2,setTextForeground/2,setUserScale/3,startDoc/2,
startPage/1]).
+-export_type([wxWindowDC/0]).
%% @hidden
parent_class(wxDC) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxWindowDC()
+-type wxWindowDC() :: wx:wx_object().
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindowdc.html#wxwindowdcwxwindowdc">external documentation</a>.
+-spec new() -> wxWindowDC().
new() ->
wxe_util:construct(?wxWindowDC_new_0,
<<>>).
-%% @spec (Win::wxWindow:wxWindow()) -> wxWindowDC()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxwindowdc.html#wxwindowdcwxwindowdc">external documentation</a>.
+-spec new(Win) -> wxWindowDC() when
+ Win::wxWindow:wxWindow().
new(#wx_ref{type=WinT,ref=WinRef}) ->
?CLASS(WinT,wxWindow),
wxe_util:construct(?wxWindowDC_new_1,
<<WinRef:32/?UI>>).
-%% @spec (This::wxWindowDC()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxWindowDC()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxWindowDC),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
@@ -157,11 +160,11 @@ getSize(This) -> wxDC:getSize(This).
%% @hidden
getPPI(This) -> wxDC:getPPI(This).
%% @hidden
-getPixel(This,Pt,Col) -> wxDC:getPixel(This,Pt,Col).
+getPixel(This,Pt) -> wxDC:getPixel(This,Pt).
%% @hidden
getPen(This) -> wxDC:getPen(This).
%% @hidden
-getPartialTextExtents(This,Text,Widths) -> wxDC:getPartialTextExtents(This,Text,Widths).
+getPartialTextExtents(This,Text) -> wxDC:getPartialTextExtents(This,Text).
%% @hidden
getMultiLineTextExtent(This,String, Options) -> wxDC:getMultiLineTextExtent(This,String, Options).
%% @hidden
@@ -175,7 +178,7 @@ getLayoutDirection(This) -> wxDC:getLayoutDirection(This).
%% @hidden
getFont(This) -> wxDC:getFont(This).
%% @hidden
-getClippingBox(This,Rect) -> wxDC:getClippingBox(This,Rect).
+getClippingBox(This) -> wxDC:getClippingBox(This).
%% @hidden
getCharWidth(This) -> wxDC:getCharWidth(This).
%% @hidden
diff --git a/lib/wx/src/gen/wxWindowDestroyEvent.erl b/lib/wx/src/gen/wxWindowDestroyEvent.erl
index e62700da4a..909f521d82 100644
--- a/lib/wx/src/gen/wxWindowDestroyEvent.erl
+++ b/lib/wx/src/gen/wxWindowDestroyEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -40,11 +40,13 @@
parent_class/1,resumePropagation/2,setInt/2,setString/2,shouldPropagate/1,
skip/1,skip/2,stopPropagation/1]).
+-export_type([wxWindowDestroyEvent/0]).
%% @hidden
parent_class(wxCommandEvent) -> true;
parent_class(wxEvent) -> true;
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+-type wxWindowDestroyEvent() :: wx:wx_object().
%% From wxCommandEvent
%% @hidden
setString(This,S) -> wxCommandEvent:setString(This,S).
diff --git a/lib/wx/src/gen/wxXmlResource.erl b/lib/wx/src/gen/wxXmlResource.erl
index 2b69a49bd7..aa0cffb5a8 100644
--- a/lib/wx/src/gen/wxXmlResource.erl
+++ b/lib/wx/src/gen/wxXmlResource.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -34,17 +34,21 @@
%% inherited exports
-export([parent_class/1]).
+-export_type([wxXmlResource/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-%% @spec () -> wxXmlResource()
+-type wxXmlResource() :: wx:wx_object().
%% @equiv new([])
+-spec new() -> wxXmlResource().
+
new() ->
new([]).
-%% @spec ([Option]) -> wxXmlResource()
-%% Option = {flags, integer()} | {domain, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourcewxxmlresource">external documentation</a>.
+-spec new([Option]) -> wxXmlResource() when
+ Option :: {flags, integer()}
+ | {domain, unicode:chardata()}.
new(Options)
when is_list(Options) ->
MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc];
@@ -54,9 +58,11 @@ new(Options)
wxe_util:construct(?wxXmlResource_new_1,
<<BinOpt/binary>>).
-%% @spec (Filemask::string(), [Option]) -> wxXmlResource()
-%% Option = {flags, integer()} | {domain, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourcewxxmlresource">external documentation</a>.
+-spec new(Filemask, [Option]) -> wxXmlResource() when
+ Filemask::unicode:chardata(),
+ Option :: {flags, integer()}
+ | {domain, unicode:chardata()}.
new(Filemask, Options)
when is_list(Filemask),is_list(Options) ->
Filemask_UC = unicode:characters_to_binary([Filemask,0]),
@@ -67,15 +73,18 @@ new(Filemask, Options)
wxe_util:construct(?wxXmlResource_new_2,
<<(byte_size(Filemask_UC)):32/?UI,(Filemask_UC)/binary, 0:(((8- ((4+byte_size(Filemask_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxXmlResource(), Name::string(), Control::wxWindow:wxWindow()) -> bool()
%% @equiv attachUnknownControl(This,Name,Control, [])
+-spec attachUnknownControl(This, Name, Control) -> boolean() when
+ This::wxXmlResource(), Name::unicode:chardata(), Control::wxWindow:wxWindow().
+
attachUnknownControl(This,Name,Control)
when is_record(This, wx_ref),is_list(Name),is_record(Control, wx_ref) ->
attachUnknownControl(This,Name,Control, []).
-%% @spec (This::wxXmlResource(), Name::string(), Control::wxWindow:wxWindow(), [Option]) -> bool()
-%% Option = {parent, wxWindow:wxWindow()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceattachunknowncontrol">external documentation</a>.
+-spec attachUnknownControl(This, Name, Control, [Option]) -> boolean() when
+ This::wxXmlResource(), Name::unicode:chardata(), Control::wxWindow:wxWindow(),
+ Option :: {parent, wxWindow:wxWindow()}.
attachUnknownControl(#wx_ref{type=ThisT,ref=ThisRef},Name,#wx_ref{type=ControlT,ref=ControlRef}, Options)
when is_list(Name),is_list(Options) ->
?CLASS(ThisT,wxXmlResource),
@@ -87,50 +96,57 @@ attachUnknownControl(#wx_ref{type=ThisT,ref=ThisRef},Name,#wx_ref{type=ControlT,
wxe_util:call(?wxXmlResource_AttachUnknownControl,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,ControlRef:32/?UI, 0:32,BinOpt/binary>>).
-%% @spec (This::wxXmlResource()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceclearhandlers">external documentation</a>.
+-spec clearHandlers(This) -> ok when
+ This::wxXmlResource().
clearHandlers(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxXmlResource),
wxe_util:cast(?wxXmlResource_ClearHandlers,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxXmlResource(), Major::integer(), Minor::integer(), Release::integer(), Revision::integer()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourcecompareversion">external documentation</a>.
+-spec compareVersion(This, Major, Minor, Release, Revision) -> integer() when
+ This::wxXmlResource(), Major::integer(), Minor::integer(), Release::integer(), Revision::integer().
compareVersion(#wx_ref{type=ThisT,ref=ThisRef},Major,Minor,Release,Revision)
when is_integer(Major),is_integer(Minor),is_integer(Release),is_integer(Revision) ->
?CLASS(ThisT,wxXmlResource),
wxe_util:call(?wxXmlResource_CompareVersion,
<<ThisRef:32/?UI,Major:32/?UI,Minor:32/?UI,Release:32/?UI,Revision:32/?UI>>).
-%% @spec () -> wxXmlResource()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceget">external documentation</a>.
+-spec get() -> wxXmlResource().
get() ->
wxe_util:call(?wxXmlResource_Get,
<<>>).
-%% @spec (This::wxXmlResource()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourcegetflags">external documentation</a>.
+-spec getFlags(This) -> integer() when
+ This::wxXmlResource().
getFlags(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxXmlResource),
wxe_util:call(?wxXmlResource_GetFlags,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxXmlResource()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourcegetversion">external documentation</a>.
+-spec getVersion(This) -> integer() when
+ This::wxXmlResource().
getVersion(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxXmlResource),
wxe_util:call(?wxXmlResource_GetVersion,
<<ThisRef:32/?UI>>).
-%% @spec (Str_id::[string()]) -> integer()
%% @equiv getXRCID(Str_id, [])
+-spec getXRCID(Str_id) -> integer() when
+ Str_id::[unicode:chardata()].
+
getXRCID(Str_id)
when is_list(Str_id) ->
getXRCID(Str_id, []).
-%% @spec (Str_id::[string()], [Option]) -> integer()
-%% Option = {value_if_not_found, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourcegetxrcid">external documentation</a>.
+-spec getXRCID(Str_id, [Option]) -> integer() when
+ Str_id::[unicode:chardata()],
+ Option :: {value_if_not_found, integer()}.
getXRCID(Str_id, Options)
when is_list(Str_id),is_list(Options) ->
Str_id_UC = unicode:characters_to_binary([Str_id,0]),
@@ -140,15 +156,17 @@ getXRCID(Str_id, Options)
wxe_util:call(?wxXmlResource_GetXRCID,
<<(byte_size(Str_id_UC)):32/?UI,(Str_id_UC)/binary, 0:(((8- ((4+byte_size(Str_id_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec (This::wxXmlResource()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceinitallhandlers">external documentation</a>.
+-spec initAllHandlers(This) -> ok when
+ This::wxXmlResource().
initAllHandlers(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxXmlResource),
wxe_util:cast(?wxXmlResource_InitAllHandlers,
<<ThisRef:32/?UI>>).
-%% @spec (This::wxXmlResource(), Filemask::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceload">external documentation</a>.
+-spec load(This, Filemask) -> boolean() when
+ This::wxXmlResource(), Filemask::unicode:chardata().
load(#wx_ref{type=ThisT,ref=ThisRef},Filemask)
when is_list(Filemask) ->
?CLASS(ThisT,wxXmlResource),
@@ -156,8 +174,9 @@ load(#wx_ref{type=ThisT,ref=ThisRef},Filemask)
wxe_util:call(?wxXmlResource_Load,
<<ThisRef:32/?UI,(byte_size(Filemask_UC)):32/?UI,(Filemask_UC)/binary, 0:(((8- ((0+byte_size(Filemask_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxXmlResource(), Name::string()) -> wxBitmap:wxBitmap()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceloadbitmap">external documentation</a>.
+-spec loadBitmap(This, Name) -> wxBitmap:wxBitmap() when
+ This::wxXmlResource(), Name::unicode:chardata().
loadBitmap(#wx_ref{type=ThisT,ref=ThisRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxXmlResource),
@@ -165,8 +184,9 @@ loadBitmap(#wx_ref{type=ThisT,ref=ThisRef},Name)
wxe_util:call(?wxXmlResource_LoadBitmap,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::string()) -> wxDialog:wxDialog()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceloaddialog">external documentation</a>.
+-spec loadDialog(This, Parent, Name) -> wxDialog:wxDialog() when
+ This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::unicode:chardata().
loadDialog(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxXmlResource),
@@ -175,8 +195,9 @@ loadDialog(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},N
wxe_util:call(?wxXmlResource_LoadDialog_2,
<<ThisRef:32/?UI,ParentRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxXmlResource(), Dlg::wxDialog:wxDialog(), Parent::wxWindow:wxWindow(), Name::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceloaddialog">external documentation</a>.
+-spec loadDialog(This, Dlg, Parent, Name) -> boolean() when
+ This::wxXmlResource(), Dlg::wxDialog:wxDialog(), Parent::wxWindow:wxWindow(), Name::unicode:chardata().
loadDialog(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DlgT,ref=DlgRef},#wx_ref{type=ParentT,ref=ParentRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxXmlResource),
@@ -186,8 +207,9 @@ loadDialog(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DlgT,ref=DlgRef},#wx_ref
wxe_util:call(?wxXmlResource_LoadDialog_3,
<<ThisRef:32/?UI,DlgRef:32/?UI,ParentRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::string()) -> wxFrame:wxFrame()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceloadframe">external documentation</a>.
+-spec loadFrame(This, Parent, Name) -> wxFrame:wxFrame() when
+ This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::unicode:chardata().
loadFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxXmlResource),
@@ -196,8 +218,9 @@ loadFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Na
wxe_util:call(?wxXmlResource_LoadFrame_2,
<<ThisRef:32/?UI,ParentRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxXmlResource(), Frame::wxFrame:wxFrame(), Parent::wxWindow:wxWindow(), Name::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceloadframe">external documentation</a>.
+-spec loadFrame(This, Frame, Parent, Name) -> boolean() when
+ This::wxXmlResource(), Frame::wxFrame:wxFrame(), Parent::wxWindow:wxWindow(), Name::unicode:chardata().
loadFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef},#wx_ref{type=ParentT,ref=ParentRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxXmlResource),
@@ -207,8 +230,9 @@ loadFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef},#wx_
wxe_util:call(?wxXmlResource_LoadFrame_3,
<<ThisRef:32/?UI,FrameRef:32/?UI,ParentRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxXmlResource(), Name::string()) -> wxIcon:wxIcon()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceloadicon">external documentation</a>.
+-spec loadIcon(This, Name) -> wxIcon:wxIcon() when
+ This::wxXmlResource(), Name::unicode:chardata().
loadIcon(#wx_ref{type=ThisT,ref=ThisRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxXmlResource),
@@ -216,8 +240,9 @@ loadIcon(#wx_ref{type=ThisT,ref=ThisRef},Name)
wxe_util:call(?wxXmlResource_LoadIcon,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxXmlResource(), Name::string()) -> wxMenu:wxMenu()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceloadmenu">external documentation</a>.
+-spec loadMenu(This, Name) -> wxMenu:wxMenu() when
+ This::wxXmlResource(), Name::unicode:chardata().
loadMenu(#wx_ref{type=ThisT,ref=ThisRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxXmlResource),
@@ -225,8 +250,9 @@ loadMenu(#wx_ref{type=ThisT,ref=ThisRef},Name)
wxe_util:call(?wxXmlResource_LoadMenu,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxXmlResource(), Name::string()) -> wxMenuBar:wxMenuBar()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceloadmenubar">external documentation</a>.
+-spec loadMenuBar(This, Name) -> wxMenuBar:wxMenuBar() when
+ This::wxXmlResource(), Name::unicode:chardata().
loadMenuBar(#wx_ref{type=ThisT,ref=ThisRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxXmlResource),
@@ -234,8 +260,9 @@ loadMenuBar(#wx_ref{type=ThisT,ref=ThisRef},Name)
wxe_util:call(?wxXmlResource_LoadMenuBar_1,
<<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::string()) -> wxMenuBar:wxMenuBar()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceloadmenubar">external documentation</a>.
+-spec loadMenuBar(This, Parent, Name) -> wxMenuBar:wxMenuBar() when
+ This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::unicode:chardata().
loadMenuBar(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxXmlResource),
@@ -244,8 +271,9 @@ loadMenuBar(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},
wxe_util:call(?wxXmlResource_LoadMenuBar_2,
<<ThisRef:32/?UI,ParentRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::string()) -> wxPanel:wxPanel()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceloadpanel">external documentation</a>.
+-spec loadPanel(This, Parent, Name) -> wxPanel:wxPanel() when
+ This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::unicode:chardata().
loadPanel(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxXmlResource),
@@ -254,8 +282,9 @@ loadPanel(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Na
wxe_util:call(?wxXmlResource_LoadPanel_2,
<<ThisRef:32/?UI,ParentRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxXmlResource(), Panel::wxPanel:wxPanel(), Parent::wxWindow:wxWindow(), Name::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceloadpanel">external documentation</a>.
+-spec loadPanel(This, Panel, Parent, Name) -> boolean() when
+ This::wxXmlResource(), Panel::wxPanel:wxPanel(), Parent::wxWindow:wxWindow(), Name::unicode:chardata().
loadPanel(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PanelT,ref=PanelRef},#wx_ref{type=ParentT,ref=ParentRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxXmlResource),
@@ -265,8 +294,9 @@ loadPanel(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PanelT,ref=PanelRef},#wx_
wxe_util:call(?wxXmlResource_LoadPanel_3,
<<ThisRef:32/?UI,PanelRef:32/?UI,ParentRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::string()) -> wxToolBar:wxToolBar()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceloadtoolbar">external documentation</a>.
+-spec loadToolBar(This, Parent, Name) -> wxToolBar:wxToolBar() when
+ This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::unicode:chardata().
loadToolBar(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Name)
when is_list(Name) ->
?CLASS(ThisT,wxXmlResource),
@@ -275,23 +305,26 @@ loadToolBar(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},
wxe_util:call(?wxXmlResource_LoadToolBar,
<<ThisRef:32/?UI,ParentRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (Res::wxXmlResource()) -> wxXmlResource()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceset">external documentation</a>.
+-spec set(Res) -> wxXmlResource() when
+ Res::wxXmlResource().
set(#wx_ref{type=ResT,ref=ResRef}) ->
?CLASS(ResT,wxXmlResource),
wxe_util:call(?wxXmlResource_Set,
<<ResRef:32/?UI>>).
-%% @spec (This::wxXmlResource(), Flags::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourcesetflags">external documentation</a>.
+-spec setFlags(This, Flags) -> ok when
+ This::wxXmlResource(), Flags::integer().
setFlags(#wx_ref{type=ThisT,ref=ThisRef},Flags)
when is_integer(Flags) ->
?CLASS(ThisT,wxXmlResource),
wxe_util:cast(?wxXmlResource_SetFlags,
<<ThisRef:32/?UI,Flags:32/?UI>>).
-%% @spec (This::wxXmlResource(), Filename::string()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxxmlresource.html#wxxmlresourceunload">external documentation</a>.
+-spec unload(This, Filename) -> boolean() when
+ This::wxXmlResource(), Filename::unicode:chardata().
unload(#wx_ref{type=ThisT,ref=ThisRef},Filename)
when is_list(Filename) ->
?CLASS(ThisT,wxXmlResource),
@@ -318,8 +351,8 @@ xrcctrl(Window = #wx_ref{}, Name, Type) when is_list(Name), is_atom(Type) ->
Res = wxWindow:findWindow(Window,ID),
wx:typeCast(Res, Type).
-%% @spec (This::wxXmlResource()) -> ok
%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxXmlResource()) -> ok.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxXmlResource),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
diff --git a/lib/wx/src/gen/wx_misc.erl b/lib/wx/src/gen/wx_misc.erl
index 3382d898e4..a2a39bdae7 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -30,42 +30,44 @@
launchDefaultBrowser/2,newId/0,registerId/1,setDetectableAutoRepeat/1,
shell/0,shell/1,shutdown/1]).
-%% @spec (Key::WxKeyCode) -> bool()
-%% WxKeyCode = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxgetkeystate">external documentation</a>.
-%%<br /> WxKeyCode is one of ?WXK_BACK | ?WXK_TAB | ?WXK_RETURN | ?WXK_ESCAPE | ?WXK_SPACE | ?WXK_DELETE | ?WXK_START | ?WXK_LBUTTON | ?WXK_RBUTTON | ?WXK_CANCEL | ?WXK_MBUTTON | ?WXK_CLEAR | ?WXK_SHIFT | ?WXK_ALT | ?WXK_CONTROL | ?WXK_MENU | ?WXK_PAUSE | ?WXK_CAPITAL | ?WXK_END | ?WXK_HOME | ?WXK_LEFT | ?WXK_UP | ?WXK_RIGHT | ?WXK_DOWN | ?WXK_SELECT | ?WXK_PRINT | ?WXK_EXECUTE | ?WXK_SNAPSHOT | ?WXK_INSERT | ?WXK_HELP | ?WXK_NUMPAD0 | ?WXK_NUMPAD1 | ?WXK_NUMPAD2 | ?WXK_NUMPAD3 | ?WXK_NUMPAD4 | ?WXK_NUMPAD5 | ?WXK_NUMPAD6 | ?WXK_NUMPAD7 | ?WXK_NUMPAD8 | ?WXK_NUMPAD9 | ?WXK_MULTIPLY | ?WXK_ADD | ?WXK_SEPARATOR | ?WXK_SUBTRACT | ?WXK_DECIMAL | ?WXK_DIVIDE | ?WXK_F1 | ?WXK_F2 | ?WXK_F3 | ?WXK_F4 | ?WXK_F5 | ?WXK_F6 | ?WXK_F7 | ?WXK_F8 | ?WXK_F9 | ?WXK_F10 | ?WXK_F11 | ?WXK_F12 | ?WXK_F13 | ?WXK_F14 | ?WXK_F15 | ?WXK_F16 | ?WXK_F17 | ?WXK_F18 | ?WXK_F19 | ?WXK_F20 | ?WXK_F21 | ?WXK_F22 | ?WXK_F23 | ?WXK_F24 | ?WXK_NUMLOCK | ?WXK_SCROLL | ?WXK_PAGEUP | ?WXK_PAGEDOWN | ?WXK_NUMPAD_SPACE | ?WXK_NUMPAD_TAB | ?WXK_NUMPAD_ENTER | ?WXK_NUMPAD_F1 | ?WXK_NUMPAD_F2 | ?WXK_NUMPAD_F3 | ?WXK_NUMPAD_F4 | ?WXK_NUMPAD_HOME | ?WXK_NUMPAD_LEFT | ?WXK_NUMPAD_UP | ?WXK_NUMPAD_RIGHT | ?WXK_NUMPAD_DOWN | ?WXK_NUMPAD_PAGEUP | ?WXK_NUMPAD_PAGEDOWN | ?WXK_NUMPAD_END | ?WXK_NUMPAD_BEGIN | ?WXK_NUMPAD_INSERT | ?WXK_NUMPAD_DELETE | ?WXK_NUMPAD_EQUAL | ?WXK_NUMPAD_MULTIPLY | ?WXK_NUMPAD_ADD | ?WXK_NUMPAD_SEPARATOR | ?WXK_NUMPAD_SUBTRACT | ?WXK_NUMPAD_DECIMAL | ?WXK_NUMPAD_DIVIDE | ?WXK_WINDOWS_LEFT | ?WXK_WINDOWS_RIGHT | ?WXK_WINDOWS_MENU | ?WXK_COMMAND | ?WXK_SPECIAL1 | ?WXK_SPECIAL2 | ?WXK_SPECIAL3 | ?WXK_SPECIAL4 | ?WXK_SPECIAL5 | ?WXK_SPECIAL6 | ?WXK_SPECIAL7 | ?WXK_SPECIAL8 | ?WXK_SPECIAL9 | ?WXK_SPECIAL10 | ?WXK_SPECIAL11 | ?WXK_SPECIAL12 | ?WXK_SPECIAL13 | ?WXK_SPECIAL14 | ?WXK_SPECIAL15 | ?WXK_SPECIAL16 | ?WXK_SPECIAL17 | ?WXK_SPECIAL18 | ?WXK_SPECIAL19 | ?WXK_SPECIAL20
+%%<br /> Key = ?WXK_BACK | ?WXK_TAB | ?WXK_RETURN | ?WXK_ESCAPE | ?WXK_SPACE | ?WXK_DELETE | ?WXK_START | ?WXK_LBUTTON | ?WXK_RBUTTON | ?WXK_CANCEL | ?WXK_MBUTTON | ?WXK_CLEAR | ?WXK_SHIFT | ?WXK_ALT | ?WXK_CONTROL | ?WXK_MENU | ?WXK_PAUSE | ?WXK_CAPITAL | ?WXK_END | ?WXK_HOME | ?WXK_LEFT | ?WXK_UP | ?WXK_RIGHT | ?WXK_DOWN | ?WXK_SELECT | ?WXK_PRINT | ?WXK_EXECUTE | ?WXK_SNAPSHOT | ?WXK_INSERT | ?WXK_HELP | ?WXK_NUMPAD0 | ?WXK_NUMPAD1 | ?WXK_NUMPAD2 | ?WXK_NUMPAD3 | ?WXK_NUMPAD4 | ?WXK_NUMPAD5 | ?WXK_NUMPAD6 | ?WXK_NUMPAD7 | ?WXK_NUMPAD8 | ?WXK_NUMPAD9 | ?WXK_MULTIPLY | ?WXK_ADD | ?WXK_SEPARATOR | ?WXK_SUBTRACT | ?WXK_DECIMAL | ?WXK_DIVIDE | ?WXK_F1 | ?WXK_F2 | ?WXK_F3 | ?WXK_F4 | ?WXK_F5 | ?WXK_F6 | ?WXK_F7 | ?WXK_F8 | ?WXK_F9 | ?WXK_F10 | ?WXK_F11 | ?WXK_F12 | ?WXK_F13 | ?WXK_F14 | ?WXK_F15 | ?WXK_F16 | ?WXK_F17 | ?WXK_F18 | ?WXK_F19 | ?WXK_F20 | ?WXK_F21 | ?WXK_F22 | ?WXK_F23 | ?WXK_F24 | ?WXK_NUMLOCK | ?WXK_SCROLL | ?WXK_PAGEUP | ?WXK_PAGEDOWN | ?WXK_NUMPAD_SPACE | ?WXK_NUMPAD_TAB | ?WXK_NUMPAD_ENTER | ?WXK_NUMPAD_F1 | ?WXK_NUMPAD_F2 | ?WXK_NUMPAD_F3 | ?WXK_NUMPAD_F4 | ?WXK_NUMPAD_HOME | ?WXK_NUMPAD_LEFT | ?WXK_NUMPAD_UP | ?WXK_NUMPAD_RIGHT | ?WXK_NUMPAD_DOWN | ?WXK_NUMPAD_PAGEUP | ?WXK_NUMPAD_PAGEDOWN | ?WXK_NUMPAD_END | ?WXK_NUMPAD_BEGIN | ?WXK_NUMPAD_INSERT | ?WXK_NUMPAD_DELETE | ?WXK_NUMPAD_EQUAL | ?WXK_NUMPAD_MULTIPLY | ?WXK_NUMPAD_ADD | ?WXK_NUMPAD_SEPARATOR | ?WXK_NUMPAD_SUBTRACT | ?WXK_NUMPAD_DECIMAL | ?WXK_NUMPAD_DIVIDE | ?WXK_WINDOWS_LEFT | ?WXK_WINDOWS_RIGHT | ?WXK_WINDOWS_MENU | ?WXK_COMMAND | ?WXK_SPECIAL1 | ?WXK_SPECIAL2 | ?WXK_SPECIAL3 | ?WXK_SPECIAL4 | ?WXK_SPECIAL5 | ?WXK_SPECIAL6 | ?WXK_SPECIAL7 | ?WXK_SPECIAL8 | ?WXK_SPECIAL9 | ?WXK_SPECIAL10 | ?WXK_SPECIAL11 | ?WXK_SPECIAL12 | ?WXK_SPECIAL13 | ?WXK_SPECIAL14 | ?WXK_SPECIAL15 | ?WXK_SPECIAL16 | ?WXK_SPECIAL17 | ?WXK_SPECIAL18 | ?WXK_SPECIAL19 | ?WXK_SPECIAL20
+-spec getKeyState(Key) -> boolean() when
+ Key::wx:wx_enum().
getKeyState(Key)
when is_integer(Key) ->
wxe_util:call(?utils_wxGetKeyState,
<<Key:32/?UI>>).
-%% @spec () -> {X::integer(), Y::integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxgetmouseposition">external documentation</a>.
+-spec getMousePosition() -> {X::integer(), Y::integer()}.
getMousePosition() ->
wxe_util:call(?utils_wxGetMousePosition,
<<>>).
-%% @spec () -> wx:wxMouseState()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxgetmousestate">external documentation</a>.
+-spec getMouseState() -> wx:wx_wxMouseState().
getMouseState() ->
wxe_util:call(?utils_wxGetMouseState,
<<>>).
-%% @spec (Flag::bool()) -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxsetdetectableautorepeat">external documentation</a>.
+-spec setDetectableAutoRepeat(Flag) -> boolean() when
+ Flag::boolean().
setDetectableAutoRepeat(Flag)
when is_boolean(Flag) ->
wxe_util:call(?utils_wxSetDetectableAutoRepeat,
<<(wxe_util:from_bool(Flag)):32/?UI>>).
-%% @spec () -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxbell">external documentation</a>.
+-spec bell() -> ok.
bell() ->
wxe_util:cast(?utils_wxBell,
<<>>).
-%% @spec (Frame::wxFrame:wxFrame(), MenuString::string(), ItemString::string()) -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxfindmenuitemid">external documentation</a>.
+-spec findMenuItemId(Frame, MenuString, ItemString) -> integer() when
+ Frame::wxFrame:wxFrame(), MenuString::unicode:chardata(), ItemString::unicode:chardata().
findMenuItemId(#wx_ref{type=FrameT,ref=FrameRef},MenuString,ItemString)
when is_list(MenuString),is_list(ItemString) ->
?CLASS(FrameT,wxFrame),
@@ -74,28 +76,31 @@ findMenuItemId(#wx_ref{type=FrameT,ref=FrameRef},MenuString,ItemString)
wxe_util:call(?utils_wxFindMenuItemId,
<<FrameRef:32/?UI,(byte_size(MenuString_UC)):32/?UI,(MenuString_UC)/binary, 0:(((8- ((0+byte_size(MenuString_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(ItemString_UC)):32/?UI,(ItemString_UC)/binary, 0:(((8- ((4+byte_size(ItemString_UC)) band 16#7)) band 16#7))/unit:8>>).
-%% @spec (Pt::{X::integer(), Y::integer()}) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxgenericfindwindowatpoint">external documentation</a>.
+-spec genericFindWindowAtPoint(Pt) -> wxWindow:wxWindow() when
+ Pt::{X::integer(), Y::integer()}.
genericFindWindowAtPoint({PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
wxe_util:call(?utils_wxGenericFindWindowAtPoint,
<<PtX:32/?UI,PtY:32/?UI>>).
-%% @spec (Pt::{X::integer(), Y::integer()}) -> wxWindow:wxWindow()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxfindwindowatpoint">external documentation</a>.
+-spec findWindowAtPoint(Pt) -> wxWindow:wxWindow() when
+ Pt::{X::integer(), Y::integer()}.
findWindowAtPoint({PtX,PtY})
when is_integer(PtX),is_integer(PtY) ->
wxe_util:call(?utils_wxFindWindowAtPoint,
<<PtX:32/?UI,PtY:32/?UI>>).
-%% @spec () -> ok
%% @equiv beginBusyCursor([])
+-spec beginBusyCursor() -> ok.
+
beginBusyCursor() ->
beginBusyCursor([]).
-%% @spec ([Option]) -> ok
-%% Option = {cursor, wxCursor:wxCursor()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxbeginbusycursor">external documentation</a>.
+-spec beginBusyCursor([Option]) -> ok when
+ Option :: {cursor, wxCursor:wxCursor()}.
beginBusyCursor(Options)
when is_list(Options) ->
MOpts = fun({cursor, #wx_ref{type=CursorT,ref=CursorRef}}, Acc) -> ?CLASS(CursorT,wxCursor),[<<1:32/?UI,CursorRef:32/?UI>>|Acc];
@@ -104,35 +109,36 @@ beginBusyCursor(Options)
wxe_util:cast(?utils_wxBeginBusyCursor,
<<BinOpt/binary>>).
-%% @spec () -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxendbusycursor">external documentation</a>.
+-spec endBusyCursor() -> ok.
endBusyCursor() ->
wxe_util:cast(?utils_wxEndBusyCursor,
<<>>).
-%% @spec () -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxisbusy">external documentation</a>.
+-spec isBusy() -> boolean().
isBusy() ->
wxe_util:call(?utils_wxIsBusy,
<<>>).
-%% @spec (WFlags::WxShutdownFlags) -> bool()
-%% WxShutdownFlags = integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxshutdown">external documentation</a>.
-%%<br /> WxShutdownFlags is one of ?wxSHUTDOWN_POWEROFF | ?wxSHUTDOWN_REBOOT
+%%<br /> WFlags = ?wxSHUTDOWN_POWEROFF | ?wxSHUTDOWN_REBOOT
+-spec shutdown(WFlags) -> boolean() when
+ WFlags::wx:wx_enum().
shutdown(WFlags)
when is_integer(WFlags) ->
wxe_util:call(?utils_wxShutdown,
<<WFlags:32/?UI>>).
-%% @spec () -> bool()
%% @equiv shell([])
+-spec shell() -> boolean().
+
shell() ->
shell([]).
-%% @spec ([Option]) -> bool()
-%% Option = {command, string()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxshell">external documentation</a>.
+-spec shell([Option]) -> boolean() when
+ Option :: {command, unicode:chardata()}.
shell(Options)
when is_list(Options) ->
MOpts = fun({command, Command}, Acc) -> Command_UC = unicode:characters_to_binary([Command,0]),[<<1:32/?UI,(byte_size(Command_UC)):32/?UI,(Command_UC)/binary, 0:(((8- ((0+byte_size(Command_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
@@ -141,15 +147,18 @@ shell(Options)
wxe_util:call(?utils_wxShell,
<<BinOpt/binary>>).
-%% @spec (Url::string()) -> bool()
%% @equiv launchDefaultBrowser(Url, [])
+-spec launchDefaultBrowser(Url) -> boolean() when
+ Url::unicode:chardata().
+
launchDefaultBrowser(Url)
when is_list(Url) ->
launchDefaultBrowser(Url, []).
-%% @spec (Url::string(), [Option]) -> bool()
-%% Option = {flags, integer()}
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxlaunchdefaultbrowser">external documentation</a>.
+-spec launchDefaultBrowser(Url, [Option]) -> boolean() when
+ Url::unicode:chardata(),
+ Option :: {flags, integer()}.
launchDefaultBrowser(Url, Options)
when is_list(Url),is_list(Options) ->
Url_UC = unicode:characters_to_binary([Url,0]),
@@ -159,57 +168,58 @@ launchDefaultBrowser(Url, Options)
wxe_util:call(?utils_wxLaunchDefaultBrowser,
<<(byte_size(Url_UC)):32/?UI,(Url_UC)/binary, 0:(((8- ((4+byte_size(Url_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
-%% @spec () -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxgetemailaddress">external documentation</a>.
+-spec getEmailAddress() -> unicode:charlist().
getEmailAddress() ->
wxe_util:call(?utils_wxGetEmailAddress,
<<>>).
-%% @spec () -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxgetuserid">external documentation</a>.
+-spec getUserId() -> unicode:charlist().
getUserId() ->
wxe_util:call(?utils_wxGetUserId,
<<>>).
-%% @spec () -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxgethomedir">external documentation</a>.
+-spec getHomeDir() -> unicode:charlist().
getHomeDir() ->
wxe_util:call(?utils_wxGetHomeDir,
<<>>).
-%% @spec () -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxnewid">external documentation</a>.
+-spec newId() -> integer().
newId() ->
wxe_util:call(?utils_wxNewId,
<<>>).
-%% @spec (Id::integer()) -> ok
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxregisterid">external documentation</a>.
+-spec registerId(Id) -> ok when
+ Id::integer().
registerId(Id)
when is_integer(Id) ->
wxe_util:cast(?utils_wxRegisterId,
<<Id:32/?UI>>).
-%% @spec () -> integer()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxgetcurrentid">external documentation</a>.
+-spec getCurrentId() -> integer().
getCurrentId() ->
wxe_util:call(?utils_wxGetCurrentId,
<<>>).
-%% @spec () -> string()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxgetosdescription">external documentation</a>.
+-spec getOsDescription() -> unicode:charlist().
getOsDescription() ->
wxe_util:call(?utils_wxGetOsDescription,
<<>>).
-%% @spec () -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxisplatformlittleendian">external documentation</a>.
+-spec isPlatformLittleEndian() -> boolean().
isPlatformLittleEndian() ->
wxe_util:call(?utils_wxIsPlatformLittleEndian,
<<>>).
-%% @spec () -> bool()
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_miscellany.html#wxisplatform64bit">external documentation</a>.
+-spec isPlatform64Bit() -> boolean().
isPlatform64Bit() ->
wxe_util:call(?utils_wxIsPlatform64Bit,
<<>>).
diff --git a/lib/wx/src/gen/wxe_debug.hrl b/lib/wx/src/gen/wxe_debug.hrl
index 4224c54200..297d99324a 100644
--- a/lib/wx/src/gen/wxe_debug.hrl
+++ b/lib/wx/src/gen/wxe_debug.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -563,2742 +563,2747 @@ wxdebug_table() ->
{662, {wxDC, getBrush, 0}},
{663, {wxDC, getCharHeight, 0}},
{664, {wxDC, getCharWidth, 0}},
- {665, {wxDC, getClippingBox, 1}},
- {666, {wxDC, getFont, 0}},
- {667, {wxDC, getLayoutDirection, 0}},
- {668, {wxDC, getLogicalFunction, 0}},
- {669, {wxDC, getMapMode, 0}},
- {670, {wxDC, getMultiLineTextExtent_4, 4}},
- {671, {wxDC, getMultiLineTextExtent_1, 1}},
- {672, {wxDC, getPartialTextExtents, 2}},
- {673, {wxDC, getPen, 0}},
- {674, {wxDC, getPixel, 2}},
- {675, {wxDC, getPPI, 0}},
- {677, {wxDC, getSize, 0}},
- {679, {wxDC, getSizeMM, 0}},
- {680, {wxDC, getTextBackground, 0}},
- {681, {wxDC, getTextExtent_4, 4}},
- {682, {wxDC, getTextExtent_1, 1}},
- {684, {wxDC, getTextForeground, 0}},
- {685, {wxDC, getUserScale, 2}},
- {686, {wxDC, gradientFillConcentric_3, 3}},
- {687, {wxDC, gradientFillConcentric_4, 4}},
- {688, {wxDC, gradientFillLinear, 4}},
- {689, {wxDC, logicalToDeviceX, 1}},
- {690, {wxDC, logicalToDeviceXRel, 1}},
- {691, {wxDC, logicalToDeviceY, 1}},
- {692, {wxDC, logicalToDeviceYRel, 1}},
- {693, {wxDC, maxX, 0}},
- {694, {wxDC, maxY, 0}},
- {695, {wxDC, minX, 0}},
- {696, {wxDC, minY, 0}},
- {697, {wxDC, isOk, 0}},
- {698, {wxDC, resetBoundingBox, 0}},
- {699, {wxDC, setAxisOrientation, 2}},
- {700, {wxDC, setBackground, 1}},
- {701, {wxDC, setBackgroundMode, 1}},
- {702, {wxDC, setBrush, 1}},
- {704, {wxDC, setClippingRegion_2, 2}},
- {705, {wxDC, setClippingRegion_1_1, 1}},
- {706, {wxDC, setClippingRegion_1_0, 1}},
- {707, {wxDC, setDeviceOrigin, 2}},
- {708, {wxDC, setFont, 1}},
- {709, {wxDC, setLayoutDirection, 1}},
- {710, {wxDC, setLogicalFunction, 1}},
- {711, {wxDC, setMapMode, 1}},
- {712, {wxDC, setPalette, 1}},
- {713, {wxDC, setPen, 1}},
- {714, {wxDC, setTextBackground, 1}},
- {715, {wxDC, setTextForeground, 1}},
- {716, {wxDC, setUserScale, 2}},
- {717, {wxDC, startDoc, 1}},
- {718, {wxDC, startPage, 0}},
- {719, {wxMirrorDC, new, 2}},
- {720, {wxMirrorDC, 'Destroy', undefined}},
- {721, {wxScreenDC, new, 0}},
- {722, {wxScreenDC, destruct, 0}},
- {723, {wxPostScriptDC, new_0, 0}},
- {724, {wxPostScriptDC, new_1, 1}},
- {725, {wxPostScriptDC, destruct, 0}},
- {726, {wxPostScriptDC, setResolution, 1}},
- {727, {wxPostScriptDC, getResolution, 0}},
- {728, {wxWindowDC, new_0, 0}},
- {729, {wxWindowDC, new_1, 1}},
- {730, {wxWindowDC, destruct, 0}},
- {731, {wxClientDC, new_0, 0}},
- {732, {wxClientDC, new_1, 1}},
- {733, {wxClientDC, 'Destroy', undefined}},
- {734, {wxPaintDC, new_0, 0}},
- {735, {wxPaintDC, new_1, 1}},
- {736, {wxPaintDC, 'Destroy', undefined}},
- {738, {wxMemoryDC, new_1_0, 1}},
- {739, {wxMemoryDC, new_1_1, 1}},
- {740, {wxMemoryDC, new_0, 0}},
- {742, {wxMemoryDC, destruct, 0}},
- {743, {wxMemoryDC, selectObject, 1}},
- {744, {wxMemoryDC, selectObjectAsSource, 1}},
- {745, {wxBufferedDC, new_0, 0}},
- {746, {wxBufferedDC, new_2, 2}},
- {747, {wxBufferedDC, new_3, 3}},
- {748, {wxBufferedDC, destruct, 0}},
- {749, {wxBufferedDC, init_2, 2}},
- {750, {wxBufferedDC, init_3, 3}},
- {751, {wxBufferedPaintDC, new_3, 3}},
- {752, {wxBufferedPaintDC, new_2, 2}},
- {753, {wxBufferedPaintDC, destruct, 0}},
- {754, {wxGraphicsObject, getRenderer, 0}},
- {755, {wxGraphicsObject, isNull, 0}},
- {756, {wxGraphicsContext, create_1_1, 1}},
- {757, {wxGraphicsContext, create_1_0, 1}},
- {758, {wxGraphicsContext, create_0, 0}},
- {759, {wxGraphicsContext, createPen, 1}},
- {760, {wxGraphicsContext, createBrush, 1}},
- {761, {wxGraphicsContext, createRadialGradientBrush, 7}},
- {762, {wxGraphicsContext, createLinearGradientBrush, 6}},
- {763, {wxGraphicsContext, createFont, 2}},
- {764, {wxGraphicsContext, createMatrix, 1}},
- {765, {wxGraphicsContext, createPath, 0}},
- {766, {wxGraphicsContext, clip_1, 1}},
- {767, {wxGraphicsContext, clip_4, 4}},
- {768, {wxGraphicsContext, resetClip, 0}},
- {769, {wxGraphicsContext, drawBitmap, 5}},
- {770, {wxGraphicsContext, drawEllipse, 4}},
- {771, {wxGraphicsContext, drawIcon, 5}},
- {772, {wxGraphicsContext, drawLines, 3}},
- {773, {wxGraphicsContext, drawPath, 2}},
- {774, {wxGraphicsContext, drawRectangle, 4}},
- {775, {wxGraphicsContext, drawRoundedRectangle, 5}},
- {776, {wxGraphicsContext, drawText_3, 3}},
- {777, {wxGraphicsContext, drawText_4_0, 4}},
- {778, {wxGraphicsContext, drawText_4_1, 4}},
- {779, {wxGraphicsContext, drawText_5, 5}},
- {780, {wxGraphicsContext, fillPath, 2}},
- {781, {wxGraphicsContext, strokePath, 1}},
- {782, {wxGraphicsContext, getNativeContext, 0}},
- {783, {wxGraphicsContext, getPartialTextExtents, 2}},
- {784, {wxGraphicsContext, getTextExtent, 5}},
- {785, {wxGraphicsContext, rotate, 1}},
- {786, {wxGraphicsContext, scale, 2}},
- {787, {wxGraphicsContext, translate, 2}},
- {788, {wxGraphicsContext, getTransform, 0}},
- {789, {wxGraphicsContext, setTransform, 1}},
- {790, {wxGraphicsContext, concatTransform, 1}},
- {791, {wxGraphicsContext, setBrush_1_1, 1}},
- {792, {wxGraphicsContext, setBrush_1_0, 1}},
- {793, {wxGraphicsContext, setFont_1, 1}},
- {794, {wxGraphicsContext, setFont_2, 2}},
- {795, {wxGraphicsContext, setPen_1_0, 1}},
- {796, {wxGraphicsContext, setPen_1_1, 1}},
- {797, {wxGraphicsContext, strokeLine, 4}},
- {798, {wxGraphicsContext, strokeLines_2, 2}},
- {799, {wxGraphicsContext, strokeLines_3, 3}},
- {800, {wxGraphicsMatrix, concat, 1}},
- {802, {wxGraphicsMatrix, get, 1}},
- {803, {wxGraphicsMatrix, getNativeMatrix, 0}},
- {804, {wxGraphicsMatrix, invert, 0}},
- {805, {wxGraphicsMatrix, isEqual, 1}},
- {807, {wxGraphicsMatrix, isIdentity, 0}},
- {808, {wxGraphicsMatrix, rotate, 1}},
- {809, {wxGraphicsMatrix, scale, 2}},
- {810, {wxGraphicsMatrix, translate, 2}},
- {811, {wxGraphicsMatrix, set, 1}},
- {812, {wxGraphicsMatrix, transformPoint, 2}},
- {813, {wxGraphicsMatrix, transformDistance, 2}},
- {814, {wxGraphicsPath, moveToPoint_2, 2}},
- {815, {wxGraphicsPath, moveToPoint_1, 1}},
- {816, {wxGraphicsPath, addArc_6, 6}},
- {817, {wxGraphicsPath, addArc_5, 5}},
- {818, {wxGraphicsPath, addArcToPoint, 5}},
- {819, {wxGraphicsPath, addCircle, 3}},
- {820, {wxGraphicsPath, addCurveToPoint_6, 6}},
- {821, {wxGraphicsPath, addCurveToPoint_3, 3}},
- {822, {wxGraphicsPath, addEllipse, 4}},
- {823, {wxGraphicsPath, addLineToPoint_2, 2}},
- {824, {wxGraphicsPath, addLineToPoint_1, 1}},
- {825, {wxGraphicsPath, addPath, 1}},
- {826, {wxGraphicsPath, addQuadCurveToPoint, 4}},
- {827, {wxGraphicsPath, addRectangle, 4}},
- {828, {wxGraphicsPath, addRoundedRectangle, 5}},
- {829, {wxGraphicsPath, closeSubpath, 0}},
- {830, {wxGraphicsPath, contains_3, 3}},
- {831, {wxGraphicsPath, contains_2, 2}},
- {833, {wxGraphicsPath, getBox, 0}},
- {835, {wxGraphicsPath, getCurrentPoint, 0}},
- {836, {wxGraphicsPath, transform, 1}},
- {837, {wxGraphicsRenderer, getDefaultRenderer, 0}},
- {838, {wxGraphicsRenderer, createContext_1_1, 1}},
- {839, {wxGraphicsRenderer, createContext_1_0, 1}},
- {840, {wxGraphicsRenderer, createPen, 1}},
- {841, {wxGraphicsRenderer, createBrush, 1}},
- {842, {wxGraphicsRenderer, createLinearGradientBrush, 6}},
- {843, {wxGraphicsRenderer, createRadialGradientBrush, 7}},
- {844, {wxGraphicsRenderer, createFont, 2}},
- {845, {wxGraphicsRenderer, createMatrix, 1}},
- {846, {wxGraphicsRenderer, createPath, 0}},
- {848, {wxMenuBar, new_1, 1}},
- {850, {wxMenuBar, new_0, 0}},
- {852, {wxMenuBar, destruct, 0}},
- {853, {wxMenuBar, append, 2}},
- {854, {wxMenuBar, check, 2}},
- {855, {wxMenuBar, enable_2, 2}},
- {856, {wxMenuBar, enable_1, 1}},
- {857, {wxMenuBar, enableTop, 2}},
- {858, {wxMenuBar, findMenu, 1}},
- {859, {wxMenuBar, findMenuItem, 2}},
- {860, {wxMenuBar, findItem, 2}},
- {861, {wxMenuBar, getHelpString, 1}},
- {862, {wxMenuBar, getLabel_1, 1}},
- {863, {wxMenuBar, getLabel_0, 0}},
- {864, {wxMenuBar, getLabelTop, 1}},
- {865, {wxMenuBar, getMenu, 1}},
- {866, {wxMenuBar, getMenuCount, 0}},
- {867, {wxMenuBar, insert, 3}},
- {868, {wxMenuBar, isChecked, 1}},
- {869, {wxMenuBar, isEnabled_1, 1}},
- {870, {wxMenuBar, isEnabled_0, 0}},
- {871, {wxMenuBar, remove, 1}},
- {872, {wxMenuBar, replace, 3}},
- {873, {wxMenuBar, setHelpString, 2}},
- {874, {wxMenuBar, setLabel_2, 2}},
- {875, {wxMenuBar, setLabel_1, 1}},
- {876, {wxMenuBar, setLabelTop, 2}},
- {877, {wxControl, getLabel, 0}},
- {878, {wxControl, setLabel, 1}},
- {879, {wxControlWithItems, append_1, 1}},
- {880, {wxControlWithItems, append_2, 2}},
- {881, {wxControlWithItems, appendStrings_1, 1}},
- {882, {wxControlWithItems, clear, 0}},
- {883, {wxControlWithItems, delete, 1}},
- {884, {wxControlWithItems, findString, 2}},
- {885, {wxControlWithItems, getClientData, 1}},
- {886, {wxControlWithItems, setClientData, 2}},
- {887, {wxControlWithItems, getCount, 0}},
- {888, {wxControlWithItems, getSelection, 0}},
- {889, {wxControlWithItems, getString, 1}},
- {890, {wxControlWithItems, getStringSelection, 0}},
- {891, {wxControlWithItems, insert_2, 2}},
- {892, {wxControlWithItems, insert_3, 3}},
- {893, {wxControlWithItems, isEmpty, 0}},
- {894, {wxControlWithItems, select, 1}},
- {895, {wxControlWithItems, setSelection, 1}},
- {896, {wxControlWithItems, setString, 2}},
- {897, {wxControlWithItems, setStringSelection, 1}},
- {900, {wxMenu, new_2, 2}},
- {901, {wxMenu, new_1, 1}},
- {903, {wxMenu, destruct, 0}},
- {904, {wxMenu, append_3, 3}},
- {905, {wxMenu, append_1, 1}},
- {906, {wxMenu, append_4_0, 4}},
- {907, {wxMenu, append_4_1, 4}},
- {908, {wxMenu, appendCheckItem, 3}},
- {909, {wxMenu, appendRadioItem, 3}},
- {910, {wxMenu, appendSeparator, 0}},
- {911, {wxMenu, break, 0}},
- {912, {wxMenu, check, 2}},
- {913, {wxMenu, delete_1_0, 1}},
- {914, {wxMenu, delete_1_1, 1}},
- {915, {wxMenu, destroy_1_0, 1}},
- {916, {wxMenu, destroy_1_1, 1}},
- {917, {wxMenu, enable, 2}},
- {918, {wxMenu, findItem_1, 1}},
- {919, {wxMenu, findItem_2, 2}},
- {920, {wxMenu, findItemByPosition, 1}},
- {921, {wxMenu, getHelpString, 1}},
- {922, {wxMenu, getLabel, 1}},
- {923, {wxMenu, getMenuItemCount, 0}},
- {924, {wxMenu, getMenuItems, 0}},
- {926, {wxMenu, getTitle, 0}},
- {927, {wxMenu, insert_2, 2}},
- {928, {wxMenu, insert_3, 3}},
- {929, {wxMenu, insert_5_1, 5}},
- {930, {wxMenu, insert_5_0, 5}},
- {931, {wxMenu, insertCheckItem, 4}},
- {932, {wxMenu, insertRadioItem, 4}},
- {933, {wxMenu, insertSeparator, 1}},
- {934, {wxMenu, isChecked, 1}},
- {935, {wxMenu, isEnabled, 1}},
- {936, {wxMenu, prepend_1, 1}},
- {937, {wxMenu, prepend_2, 2}},
- {938, {wxMenu, prepend_4_1, 4}},
- {939, {wxMenu, prepend_4_0, 4}},
- {940, {wxMenu, prependCheckItem, 3}},
- {941, {wxMenu, prependRadioItem, 3}},
- {942, {wxMenu, prependSeparator, 0}},
- {943, {wxMenu, remove_1_0, 1}},
- {944, {wxMenu, remove_1_1, 1}},
- {945, {wxMenu, setHelpString, 2}},
- {946, {wxMenu, setLabel, 2}},
- {947, {wxMenu, setTitle, 1}},
- {948, {wxMenuItem, new, 1}},
- {950, {wxMenuItem, destruct, 0}},
- {951, {wxMenuItem, check, 1}},
- {952, {wxMenuItem, enable, 1}},
- {953, {wxMenuItem, getBitmap, 0}},
- {954, {wxMenuItem, getHelp, 0}},
- {955, {wxMenuItem, getId, 0}},
- {956, {wxMenuItem, getKind, 0}},
- {957, {wxMenuItem, getLabel, 0}},
- {958, {wxMenuItem, getLabelFromText, 1}},
- {959, {wxMenuItem, getMenu, 0}},
- {960, {wxMenuItem, getText, 0}},
- {961, {wxMenuItem, getSubMenu, 0}},
- {962, {wxMenuItem, isCheckable, 0}},
- {963, {wxMenuItem, isChecked, 0}},
- {964, {wxMenuItem, isEnabled, 0}},
- {965, {wxMenuItem, isSeparator, 0}},
- {966, {wxMenuItem, isSubMenu, 0}},
- {967, {wxMenuItem, setBitmap, 1}},
- {968, {wxMenuItem, setHelp, 1}},
- {969, {wxMenuItem, setMenu, 1}},
- {970, {wxMenuItem, setSubMenu, 1}},
- {971, {wxMenuItem, setText, 1}},
- {972, {wxToolBar, addControl, 1}},
- {973, {wxToolBar, addSeparator, 0}},
- {974, {wxToolBar, addTool_5, 5}},
- {975, {wxToolBar, addTool_4_0, 4}},
- {976, {wxToolBar, addTool_1, 1}},
- {977, {wxToolBar, addTool_4_1, 4}},
- {978, {wxToolBar, addTool_3, 3}},
- {979, {wxToolBar, addTool_6, 6}},
- {980, {wxToolBar, addCheckTool, 4}},
- {981, {wxToolBar, addRadioTool, 4}},
- {982, {wxToolBar, deleteTool, 1}},
- {983, {wxToolBar, deleteToolByPos, 1}},
- {984, {wxToolBar, enableTool, 2}},
- {985, {wxToolBar, findById, 1}},
- {986, {wxToolBar, findControl, 1}},
- {987, {wxToolBar, findToolForPosition, 2}},
- {988, {wxToolBar, getToolSize, 0}},
- {989, {wxToolBar, getToolBitmapSize, 0}},
- {990, {wxToolBar, getMargins, 0}},
- {991, {wxToolBar, getToolEnabled, 1}},
- {992, {wxToolBar, getToolLongHelp, 1}},
- {993, {wxToolBar, getToolPacking, 0}},
- {994, {wxToolBar, getToolPos, 1}},
- {995, {wxToolBar, getToolSeparation, 0}},
- {996, {wxToolBar, getToolShortHelp, 1}},
- {997, {wxToolBar, getToolState, 1}},
- {998, {wxToolBar, insertControl, 2}},
- {999, {wxToolBar, insertSeparator, 1}},
- {1000, {wxToolBar, insertTool_5, 5}},
- {1001, {wxToolBar, insertTool_2, 2}},
- {1002, {wxToolBar, insertTool_4, 4}},
- {1003, {wxToolBar, realize, 0}},
- {1004, {wxToolBar, removeTool, 1}},
- {1005, {wxToolBar, setMargins, 2}},
- {1006, {wxToolBar, setToolBitmapSize, 1}},
- {1007, {wxToolBar, setToolLongHelp, 2}},
- {1008, {wxToolBar, setToolPacking, 1}},
- {1009, {wxToolBar, setToolShortHelp, 2}},
- {1010, {wxToolBar, setToolSeparation, 1}},
- {1011, {wxToolBar, toggleTool, 2}},
- {1013, {wxStatusBar, new_0, 0}},
- {1014, {wxStatusBar, new_2, 2}},
- {1016, {wxStatusBar, destruct, 0}},
- {1017, {wxStatusBar, create, 2}},
- {1018, {wxStatusBar, getFieldRect, 2}},
- {1019, {wxStatusBar, getFieldsCount, 0}},
- {1020, {wxStatusBar, getStatusText, 1}},
- {1021, {wxStatusBar, popStatusText, 1}},
- {1022, {wxStatusBar, pushStatusText, 2}},
- {1023, {wxStatusBar, setFieldsCount, 2}},
- {1024, {wxStatusBar, setMinHeight, 1}},
- {1025, {wxStatusBar, setStatusText, 2}},
- {1026, {wxStatusBar, setStatusWidths, 2}},
- {1027, {wxStatusBar, setStatusStyles, 2}},
- {1028, {wxBitmap, new_0, 0}},
- {1029, {wxBitmap, new_3, 3}},
- {1030, {wxBitmap, new_4, 4}},
- {1031, {wxBitmap, new_2_0, 2}},
- {1032, {wxBitmap, new_2_1, 2}},
- {1033, {wxBitmap, destruct, 0}},
- {1034, {wxBitmap, convertToImage, 0}},
- {1035, {wxBitmap, copyFromIcon, 1}},
- {1036, {wxBitmap, create, 3}},
- {1037, {wxBitmap, getDepth, 0}},
- {1038, {wxBitmap, getHeight, 0}},
- {1039, {wxBitmap, getPalette, 0}},
- {1040, {wxBitmap, getMask, 0}},
- {1041, {wxBitmap, getWidth, 0}},
- {1042, {wxBitmap, getSubBitmap, 1}},
- {1043, {wxBitmap, loadFile, 2}},
- {1044, {wxBitmap, ok, 0}},
- {1045, {wxBitmap, saveFile, 3}},
- {1046, {wxBitmap, setDepth, 1}},
- {1047, {wxBitmap, setHeight, 1}},
- {1048, {wxBitmap, setMask, 1}},
- {1049, {wxBitmap, setPalette, 1}},
- {1050, {wxBitmap, setWidth, 1}},
- {1051, {wxIcon, new_0, 0}},
- {1052, {wxIcon, new_2, 2}},
- {1053, {wxIcon, new_1, 1}},
- {1054, {wxIcon, copyFromBitmap, 1}},
- {1055, {wxIcon, 'Destroy', undefined}},
- {1056, {wxIconBundle, new_0, 0}},
- {1057, {wxIconBundle, new_2, 2}},
- {1058, {wxIconBundle, new_1_0, 1}},
- {1059, {wxIconBundle, new_1_1, 1}},
- {1060, {wxIconBundle, destruct, 0}},
- {1061, {wxIconBundle, addIcon_2, 2}},
- {1062, {wxIconBundle, addIcon_1, 1}},
- {1063, {wxIconBundle, getIcon_1_1, 1}},
- {1064, {wxIconBundle, getIcon_1_0, 1}},
- {1065, {wxCursor, new_0, 0}},
- {1066, {wxCursor, new_1_0, 1}},
- {1067, {wxCursor, new_1_1, 1}},
- {1068, {wxCursor, new_4, 4}},
- {1069, {wxCursor, destruct, 0}},
- {1070, {wxCursor, ok, 0}},
- {1071, {wxMask, new_0, 0}},
- {1072, {wxMask, new_2_1, 2}},
- {1073, {wxMask, new_2_0, 2}},
- {1074, {wxMask, new_1, 1}},
- {1075, {wxMask, destruct, 0}},
- {1076, {wxMask, create_2_1, 2}},
- {1077, {wxMask, create_2_0, 2}},
- {1078, {wxMask, create_1, 1}},
- {1079, {wxImage, new_0, 0}},
- {1080, {wxImage, new_3_0, 3}},
- {1081, {wxImage, new_4, 4}},
- {1082, {wxImage, new_5, 5}},
- {1083, {wxImage, new_2, 2}},
- {1084, {wxImage, new_3_1, 3}},
- {1085, {wxImage, blur, 1}},
- {1086, {wxImage, blurHorizontal, 1}},
- {1087, {wxImage, blurVertical, 1}},
- {1088, {wxImage, convertAlphaToMask, 1}},
- {1089, {wxImage, convertToGreyscale, 1}},
- {1090, {wxImage, convertToMono, 3}},
- {1091, {wxImage, copy, 0}},
- {1092, {wxImage, create_3, 3}},
- {1093, {wxImage, create_4, 4}},
- {1094, {wxImage, create_5, 5}},
- {1095, {wxImage, 'Destroy', 0}},
- {1096, {wxImage, findFirstUnusedColour, 4}},
- {1097, {wxImage, getImageExtWildcard, 0}},
- {1098, {wxImage, getAlpha_2, 2}},
- {1099, {wxImage, getAlpha_0, 0}},
- {1100, {wxImage, getBlue, 2}},
- {1101, {wxImage, getData, 0}},
- {1102, {wxImage, getGreen, 2}},
- {1103, {wxImage, getImageCount, 2}},
- {1104, {wxImage, getHeight, 0}},
- {1105, {wxImage, getMaskBlue, 0}},
- {1106, {wxImage, getMaskGreen, 0}},
- {1107, {wxImage, getMaskRed, 0}},
- {1108, {wxImage, getOrFindMaskColour, 3}},
- {1109, {wxImage, getPalette, 0}},
- {1110, {wxImage, getRed, 2}},
- {1111, {wxImage, getSubImage, 1}},
- {1112, {wxImage, getWidth, 0}},
- {1113, {wxImage, hasAlpha, 0}},
- {1114, {wxImage, hasMask, 0}},
- {1115, {wxImage, getOption, 1}},
- {1116, {wxImage, getOptionInt, 1}},
- {1117, {wxImage, hasOption, 1}},
- {1118, {wxImage, initAlpha, 0}},
- {1119, {wxImage, initStandardHandlers, 0}},
- {1120, {wxImage, isTransparent, 3}},
- {1121, {wxImage, loadFile_2, 2}},
- {1122, {wxImage, loadFile_3, 3}},
- {1123, {wxImage, ok, 0}},
- {1124, {wxImage, removeHandler, 1}},
- {1125, {wxImage, mirror, 1}},
- {1126, {wxImage, replace, 6}},
- {1127, {wxImage, rescale, 3}},
- {1128, {wxImage, resize, 3}},
- {1129, {wxImage, rotate, 3}},
- {1130, {wxImage, rotateHue, 1}},
- {1131, {wxImage, rotate90, 1}},
- {1132, {wxImage, saveFile_1, 1}},
- {1133, {wxImage, saveFile_2_0, 2}},
- {1134, {wxImage, saveFile_2_1, 2}},
- {1135, {wxImage, scale, 3}},
- {1136, {wxImage, size, 3}},
- {1137, {wxImage, setAlpha_3, 3}},
- {1138, {wxImage, setAlpha_2, 2}},
- {1139, {wxImage, setData_2, 2}},
- {1140, {wxImage, setData_4, 4}},
- {1141, {wxImage, setMask, 1}},
- {1142, {wxImage, setMaskColour, 3}},
- {1143, {wxImage, setMaskFromImage, 4}},
- {1144, {wxImage, setOption_2_1, 2}},
- {1145, {wxImage, setOption_2_0, 2}},
- {1146, {wxImage, setPalette, 1}},
- {1147, {wxImage, setRGB_5, 5}},
- {1148, {wxImage, setRGB_4, 4}},
- {1149, {wxImage, 'Destroy', undefined}},
- {1150, {wxBrush, new_0, 0}},
- {1151, {wxBrush, new_2, 2}},
- {1152, {wxBrush, new_1, 1}},
- {1154, {wxBrush, destruct, 0}},
- {1155, {wxBrush, getColour, 0}},
- {1156, {wxBrush, getStipple, 0}},
- {1157, {wxBrush, getStyle, 0}},
- {1158, {wxBrush, isHatch, 0}},
- {1159, {wxBrush, isOk, 0}},
- {1160, {wxBrush, setColour_1, 1}},
- {1161, {wxBrush, setColour_3, 3}},
- {1162, {wxBrush, setStipple, 1}},
- {1163, {wxBrush, setStyle, 1}},
- {1164, {wxPen, new_0, 0}},
- {1165, {wxPen, new_2, 2}},
- {1166, {wxPen, destruct, 0}},
- {1167, {wxPen, getCap, 0}},
- {1168, {wxPen, getColour, 0}},
- {1169, {wxPen, getJoin, 0}},
- {1170, {wxPen, getStyle, 0}},
- {1171, {wxPen, getWidth, 0}},
- {1172, {wxPen, isOk, 0}},
- {1173, {wxPen, setCap, 1}},
- {1174, {wxPen, setColour_1, 1}},
- {1175, {wxPen, setColour_3, 3}},
- {1176, {wxPen, setJoin, 1}},
- {1177, {wxPen, setStyle, 1}},
- {1178, {wxPen, setWidth, 1}},
- {1179, {wxRegion, new_0, 0}},
- {1180, {wxRegion, new_4, 4}},
- {1181, {wxRegion, new_2, 2}},
- {1182, {wxRegion, new_1_1, 1}},
- {1184, {wxRegion, new_1_0, 1}},
- {1186, {wxRegion, destruct, 0}},
- {1187, {wxRegion, clear, 0}},
- {1188, {wxRegion, contains_2, 2}},
- {1189, {wxRegion, contains_1_0, 1}},
- {1190, {wxRegion, contains_4, 4}},
- {1191, {wxRegion, contains_1_1, 1}},
- {1192, {wxRegion, convertToBitmap, 0}},
- {1193, {wxRegion, getBox, 0}},
- {1194, {wxRegion, intersect_4, 4}},
- {1195, {wxRegion, intersect_1_1, 1}},
- {1196, {wxRegion, intersect_1_0, 1}},
- {1197, {wxRegion, isEmpty, 0}},
- {1198, {wxRegion, subtract_4, 4}},
- {1199, {wxRegion, subtract_1_1, 1}},
- {1200, {wxRegion, subtract_1_0, 1}},
- {1201, {wxRegion, offset_2, 2}},
- {1202, {wxRegion, offset_1, 1}},
- {1203, {wxRegion, union_4, 4}},
- {1204, {wxRegion, union_1_2, 1}},
- {1205, {wxRegion, union_1_1, 1}},
- {1206, {wxRegion, union_1_0, 1}},
- {1207, {wxRegion, union_3, 3}},
- {1208, {wxRegion, xor_4, 4}},
- {1209, {wxRegion, xor_1_1, 1}},
- {1210, {wxRegion, xor_1_0, 1}},
- {1211, {wxAcceleratorTable, new_0, 0}},
- {1212, {wxAcceleratorTable, new_2, 2}},
- {1213, {wxAcceleratorTable, destruct, 0}},
- {1214, {wxAcceleratorTable, ok, 0}},
- {1215, {wxAcceleratorEntry, new_1_0, 1}},
- {1216, {wxAcceleratorEntry, new_1_1, 1}},
- {1217, {wxAcceleratorEntry, getCommand, 0}},
- {1218, {wxAcceleratorEntry, getFlags, 0}},
- {1219, {wxAcceleratorEntry, getKeyCode, 0}},
- {1220, {wxAcceleratorEntry, set, 4}},
- {1221, {wxAcceleratorEntry, 'Destroy', undefined}},
- {1226, {wxCaret, new_3, 3}},
- {1227, {wxCaret, new_2, 2}},
- {1229, {wxCaret, destruct, 0}},
- {1230, {wxCaret, create_3, 3}},
- {1231, {wxCaret, create_2, 2}},
- {1232, {wxCaret, getBlinkTime, 0}},
- {1234, {wxCaret, getPosition, 0}},
- {1236, {wxCaret, getSize, 0}},
- {1237, {wxCaret, getWindow, 0}},
- {1238, {wxCaret, hide, 0}},
- {1239, {wxCaret, isOk, 0}},
- {1240, {wxCaret, isVisible, 0}},
- {1241, {wxCaret, move_2, 2}},
- {1242, {wxCaret, move_1, 1}},
- {1243, {wxCaret, setBlinkTime, 1}},
- {1244, {wxCaret, setSize_2, 2}},
- {1245, {wxCaret, setSize_1, 1}},
- {1246, {wxCaret, show, 1}},
- {1247, {wxSizer, add_2_1, 2}},
- {1248, {wxSizer, add_2_0, 2}},
- {1249, {wxSizer, add_3, 3}},
- {1250, {wxSizer, add_2_3, 2}},
- {1251, {wxSizer, add_2_2, 2}},
- {1252, {wxSizer, addSpacer, 1}},
- {1253, {wxSizer, addStretchSpacer, 1}},
- {1254, {wxSizer, calcMin, 0}},
- {1255, {wxSizer, clear, 1}},
- {1256, {wxSizer, detach_1_2, 1}},
- {1257, {wxSizer, detach_1_1, 1}},
- {1258, {wxSizer, detach_1_0, 1}},
- {1259, {wxSizer, fit, 1}},
- {1260, {wxSizer, fitInside, 1}},
- {1261, {wxSizer, getChildren, 0}},
- {1262, {wxSizer, getItem_2_1, 2}},
- {1263, {wxSizer, getItem_2_0, 2}},
- {1264, {wxSizer, getItem_1, 1}},
- {1265, {wxSizer, getSize, 0}},
- {1266, {wxSizer, getPosition, 0}},
- {1267, {wxSizer, getMinSize, 0}},
- {1268, {wxSizer, hide_2_0, 2}},
- {1269, {wxSizer, hide_2_1, 2}},
- {1270, {wxSizer, hide_1, 1}},
- {1271, {wxSizer, insert_3_1, 3}},
- {1272, {wxSizer, insert_3_0, 3}},
- {1273, {wxSizer, insert_4, 4}},
- {1274, {wxSizer, insert_3_3, 3}},
- {1275, {wxSizer, insert_3_2, 3}},
- {1276, {wxSizer, insert_2, 2}},
- {1277, {wxSizer, insertSpacer, 2}},
- {1278, {wxSizer, insertStretchSpacer, 2}},
- {1279, {wxSizer, isShown_1_2, 1}},
- {1280, {wxSizer, isShown_1_1, 1}},
- {1281, {wxSizer, isShown_1_0, 1}},
- {1282, {wxSizer, layout, 0}},
- {1283, {wxSizer, prepend_2_1, 2}},
- {1284, {wxSizer, prepend_2_0, 2}},
- {1285, {wxSizer, prepend_3, 3}},
- {1286, {wxSizer, prepend_2_3, 2}},
- {1287, {wxSizer, prepend_2_2, 2}},
- {1288, {wxSizer, prepend_1, 1}},
- {1289, {wxSizer, prependSpacer, 1}},
- {1290, {wxSizer, prependStretchSpacer, 1}},
- {1291, {wxSizer, recalcSizes, 0}},
- {1292, {wxSizer, remove_1_1, 1}},
- {1293, {wxSizer, remove_1_0, 1}},
- {1294, {wxSizer, replace_3_1, 3}},
- {1295, {wxSizer, replace_3_0, 3}},
- {1296, {wxSizer, replace_2, 2}},
- {1297, {wxSizer, setDimension, 4}},
- {1298, {wxSizer, setMinSize_2, 2}},
- {1299, {wxSizer, setMinSize_1, 1}},
- {1300, {wxSizer, setItemMinSize_3_2, 3}},
- {1301, {wxSizer, setItemMinSize_2_2, 2}},
- {1302, {wxSizer, setItemMinSize_3_1, 3}},
- {1303, {wxSizer, setItemMinSize_2_1, 2}},
- {1304, {wxSizer, setItemMinSize_3_0, 3}},
- {1305, {wxSizer, setItemMinSize_2_0, 2}},
- {1306, {wxSizer, setSizeHints, 1}},
- {1307, {wxSizer, setVirtualSizeHints, 1}},
- {1308, {wxSizer, show_2_2, 2}},
- {1309, {wxSizer, show_2_1, 2}},
- {1310, {wxSizer, show_2_0, 2}},
- {1311, {wxSizer, show_1, 1}},
- {1312, {wxSizerFlags, new, 1}},
- {1313, {wxSizerFlags, align, 1}},
- {1314, {wxSizerFlags, border_2, 2}},
- {1315, {wxSizerFlags, border_1, 1}},
- {1316, {wxSizerFlags, center, 0}},
- {1317, {wxSizerFlags, centre, 0}},
- {1318, {wxSizerFlags, expand, 0}},
- {1319, {wxSizerFlags, left, 0}},
- {1320, {wxSizerFlags, proportion, 1}},
- {1321, {wxSizerFlags, right, 0}},
- {1322, {wxSizerFlags, 'Destroy', undefined}},
- {1323, {wxSizerItem, new_5_1, 5}},
- {1324, {wxSizerItem, new_2_1, 2}},
- {1325, {wxSizerItem, new_5_0, 5}},
- {1326, {wxSizerItem, new_2_0, 2}},
- {1327, {wxSizerItem, new_6, 6}},
- {1328, {wxSizerItem, new_3, 3}},
- {1329, {wxSizerItem, new_0, 0}},
- {1330, {wxSizerItem, destruct, 0}},
- {1331, {wxSizerItem, calcMin, 0}},
- {1332, {wxSizerItem, deleteWindows, 0}},
- {1333, {wxSizerItem, detachSizer, 0}},
- {1334, {wxSizerItem, getBorder, 0}},
- {1335, {wxSizerItem, getFlag, 0}},
- {1336, {wxSizerItem, getMinSize, 0}},
- {1337, {wxSizerItem, getPosition, 0}},
- {1338, {wxSizerItem, getProportion, 0}},
- {1339, {wxSizerItem, getRatio, 0}},
- {1340, {wxSizerItem, getRect, 0}},
- {1341, {wxSizerItem, getSize, 0}},
- {1342, {wxSizerItem, getSizer, 0}},
- {1343, {wxSizerItem, getSpacer, 0}},
- {1344, {wxSizerItem, getUserData, 0}},
- {1345, {wxSizerItem, getWindow, 0}},
- {1346, {wxSizerItem, isSizer, 0}},
- {1347, {wxSizerItem, isShown, 0}},
- {1348, {wxSizerItem, isSpacer, 0}},
- {1349, {wxSizerItem, isWindow, 0}},
- {1350, {wxSizerItem, setBorder, 1}},
- {1351, {wxSizerItem, setDimension, 2}},
- {1352, {wxSizerItem, setFlag, 1}},
- {1353, {wxSizerItem, setInitSize, 2}},
- {1354, {wxSizerItem, setMinSize_1, 1}},
- {1355, {wxSizerItem, setMinSize_2, 2}},
- {1356, {wxSizerItem, setProportion, 1}},
- {1357, {wxSizerItem, setRatio_2, 2}},
- {1358, {wxSizerItem, setRatio_1_1, 1}},
- {1359, {wxSizerItem, setRatio_1_0, 1}},
- {1360, {wxSizerItem, setSizer, 1}},
- {1361, {wxSizerItem, setSpacer_1, 1}},
- {1362, {wxSizerItem, setSpacer_2, 2}},
- {1363, {wxSizerItem, setWindow, 1}},
- {1364, {wxSizerItem, show, 1}},
- {1365, {wxBoxSizer, new, 1}},
- {1366, {wxBoxSizer, getOrientation, 0}},
- {1367, {wxBoxSizer, 'Destroy', undefined}},
- {1368, {wxStaticBoxSizer, new_2, 2}},
- {1369, {wxStaticBoxSizer, new_3, 3}},
- {1370, {wxStaticBoxSizer, getStaticBox, 0}},
- {1371, {wxStaticBoxSizer, 'Destroy', undefined}},
- {1372, {wxGridSizer, new_4, 4}},
- {1373, {wxGridSizer, new_2, 2}},
- {1374, {wxGridSizer, getCols, 0}},
- {1375, {wxGridSizer, getHGap, 0}},
- {1376, {wxGridSizer, getRows, 0}},
- {1377, {wxGridSizer, getVGap, 0}},
- {1378, {wxGridSizer, setCols, 1}},
- {1379, {wxGridSizer, setHGap, 1}},
- {1380, {wxGridSizer, setRows, 1}},
- {1381, {wxGridSizer, setVGap, 1}},
- {1382, {wxGridSizer, 'Destroy', undefined}},
- {1383, {wxFlexGridSizer, new_4, 4}},
- {1384, {wxFlexGridSizer, new_2, 2}},
- {1385, {wxFlexGridSizer, addGrowableCol, 2}},
- {1386, {wxFlexGridSizer, addGrowableRow, 2}},
- {1387, {wxFlexGridSizer, getFlexibleDirection, 0}},
- {1388, {wxFlexGridSizer, getNonFlexibleGrowMode, 0}},
- {1389, {wxFlexGridSizer, removeGrowableCol, 1}},
- {1390, {wxFlexGridSizer, removeGrowableRow, 1}},
- {1391, {wxFlexGridSizer, setFlexibleDirection, 1}},
- {1392, {wxFlexGridSizer, setNonFlexibleGrowMode, 1}},
- {1393, {wxFlexGridSizer, 'Destroy', undefined}},
- {1394, {wxGridBagSizer, new, 1}},
- {1395, {wxGridBagSizer, add_3_2, 3}},
- {1396, {wxGridBagSizer, add_3_1, 3}},
- {1397, {wxGridBagSizer, add_4, 4}},
- {1398, {wxGridBagSizer, add_1_0, 1}},
- {1399, {wxGridBagSizer, add_2_1, 2}},
- {1400, {wxGridBagSizer, add_2_0, 2}},
- {1401, {wxGridBagSizer, add_3_0, 3}},
- {1402, {wxGridBagSizer, add_1_1, 1}},
- {1403, {wxGridBagSizer, calcMin, 0}},
- {1404, {wxGridBagSizer, checkForIntersection_2, 2}},
- {1405, {wxGridBagSizer, checkForIntersection_3, 3}},
- {1406, {wxGridBagSizer, findItem_1_1, 1}},
- {1407, {wxGridBagSizer, findItem_1_0, 1}},
- {1408, {wxGridBagSizer, findItemAtPoint, 1}},
- {1409, {wxGridBagSizer, findItemAtPosition, 1}},
- {1410, {wxGridBagSizer, findItemWithData, 1}},
- {1411, {wxGridBagSizer, getCellSize, 2}},
- {1412, {wxGridBagSizer, getEmptyCellSize, 0}},
- {1413, {wxGridBagSizer, getItemPosition_1_2, 1}},
- {1414, {wxGridBagSizer, getItemPosition_1_1, 1}},
- {1415, {wxGridBagSizer, getItemPosition_1_0, 1}},
- {1416, {wxGridBagSizer, getItemSpan_1_2, 1}},
- {1417, {wxGridBagSizer, getItemSpan_1_1, 1}},
- {1418, {wxGridBagSizer, getItemSpan_1_0, 1}},
- {1419, {wxGridBagSizer, setEmptyCellSize, 1}},
- {1420, {wxGridBagSizer, setItemPosition_2_2, 2}},
- {1421, {wxGridBagSizer, setItemPosition_2_1, 2}},
- {1422, {wxGridBagSizer, setItemPosition_2_0, 2}},
- {1423, {wxGridBagSizer, setItemSpan_2_2, 2}},
- {1424, {wxGridBagSizer, setItemSpan_2_1, 2}},
- {1425, {wxGridBagSizer, setItemSpan_2_0, 2}},
- {1426, {wxGridBagSizer, 'Destroy', undefined}},
- {1427, {wxStdDialogButtonSizer, new, 0}},
- {1428, {wxStdDialogButtonSizer, addButton, 1}},
- {1429, {wxStdDialogButtonSizer, realize, 0}},
- {1430, {wxStdDialogButtonSizer, setAffirmativeButton, 1}},
- {1431, {wxStdDialogButtonSizer, setCancelButton, 1}},
- {1432, {wxStdDialogButtonSizer, setNegativeButton, 1}},
- {1433, {wxStdDialogButtonSizer, 'Destroy', undefined}},
- {1434, {wxFont, new_0, 0}},
- {1435, {wxFont, new_1, 1}},
- {1436, {wxFont, new_5, 5}},
- {1438, {wxFont, destruct, 0}},
- {1439, {wxFont, isFixedWidth, 0}},
- {1440, {wxFont, getDefaultEncoding, 0}},
- {1441, {wxFont, getFaceName, 0}},
- {1442, {wxFont, getFamily, 0}},
- {1443, {wxFont, getNativeFontInfoDesc, 0}},
- {1444, {wxFont, getNativeFontInfoUserDesc, 0}},
- {1445, {wxFont, getPointSize, 0}},
- {1446, {wxFont, getStyle, 0}},
- {1447, {wxFont, getUnderlined, 0}},
- {1448, {wxFont, getWeight, 0}},
- {1449, {wxFont, ok, 0}},
- {1450, {wxFont, setDefaultEncoding, 1}},
- {1451, {wxFont, setFaceName, 1}},
- {1452, {wxFont, setFamily, 1}},
- {1453, {wxFont, setPointSize, 1}},
- {1454, {wxFont, setStyle, 1}},
- {1455, {wxFont, setUnderlined, 1}},
- {1456, {wxFont, setWeight, 1}},
- {1457, {wxToolTip, enable, 1}},
- {1458, {wxToolTip, setDelay, 1}},
- {1459, {wxToolTip, new, 1}},
- {1460, {wxToolTip, setTip, 1}},
- {1461, {wxToolTip, getTip, 0}},
- {1462, {wxToolTip, getWindow, 0}},
- {1463, {wxToolTip, 'Destroy', undefined}},
- {1465, {wxButton, new_3, 3}},
- {1466, {wxButton, new_0, 0}},
- {1467, {wxButton, destruct, 0}},
- {1468, {wxButton, create, 3}},
- {1469, {wxButton, getDefaultSize, 0}},
- {1470, {wxButton, setDefault, 0}},
- {1471, {wxButton, setLabel, 1}},
- {1473, {wxBitmapButton, new_4, 4}},
- {1474, {wxBitmapButton, new_0, 0}},
- {1475, {wxBitmapButton, create, 4}},
- {1476, {wxBitmapButton, getBitmapDisabled, 0}},
- {1478, {wxBitmapButton, getBitmapFocus, 0}},
- {1480, {wxBitmapButton, getBitmapLabel, 0}},
- {1482, {wxBitmapButton, getBitmapSelected, 0}},
- {1484, {wxBitmapButton, setBitmapDisabled, 1}},
- {1485, {wxBitmapButton, setBitmapFocus, 1}},
- {1486, {wxBitmapButton, setBitmapLabel, 1}},
- {1487, {wxBitmapButton, setBitmapSelected, 1}},
- {1488, {wxBitmapButton, 'Destroy', undefined}},
- {1489, {wxToggleButton, new_0, 0}},
- {1490, {wxToggleButton, new_4, 4}},
- {1491, {wxToggleButton, create, 4}},
- {1492, {wxToggleButton, getValue, 0}},
- {1493, {wxToggleButton, setValue, 1}},
- {1494, {wxToggleButton, 'Destroy', undefined}},
- {1495, {wxCalendarCtrl, new_0, 0}},
- {1496, {wxCalendarCtrl, new_3, 3}},
- {1497, {wxCalendarCtrl, create, 3}},
- {1498, {wxCalendarCtrl, destruct, 0}},
- {1499, {wxCalendarCtrl, setDate, 1}},
- {1500, {wxCalendarCtrl, getDate, 0}},
- {1501, {wxCalendarCtrl, enableYearChange, 1}},
- {1502, {wxCalendarCtrl, enableMonthChange, 1}},
- {1503, {wxCalendarCtrl, enableHolidayDisplay, 1}},
- {1504, {wxCalendarCtrl, setHeaderColours, 2}},
- {1505, {wxCalendarCtrl, getHeaderColourFg, 0}},
- {1506, {wxCalendarCtrl, getHeaderColourBg, 0}},
- {1507, {wxCalendarCtrl, setHighlightColours, 2}},
- {1508, {wxCalendarCtrl, getHighlightColourFg, 0}},
- {1509, {wxCalendarCtrl, getHighlightColourBg, 0}},
- {1510, {wxCalendarCtrl, setHolidayColours, 2}},
- {1511, {wxCalendarCtrl, getHolidayColourFg, 0}},
- {1512, {wxCalendarCtrl, getHolidayColourBg, 0}},
- {1513, {wxCalendarCtrl, getAttr, 1}},
- {1514, {wxCalendarCtrl, setAttr, 2}},
- {1515, {wxCalendarCtrl, setHoliday, 1}},
- {1516, {wxCalendarCtrl, resetAttr, 1}},
- {1517, {wxCalendarCtrl, hitTest, 2}},
- {1518, {wxCalendarDateAttr, new_0, 0}},
- {1519, {wxCalendarDateAttr, new_2_1, 2}},
- {1520, {wxCalendarDateAttr, new_2_0, 2}},
- {1521, {wxCalendarDateAttr, setTextColour, 1}},
- {1522, {wxCalendarDateAttr, setBackgroundColour, 1}},
- {1523, {wxCalendarDateAttr, setBorderColour, 1}},
- {1524, {wxCalendarDateAttr, setFont, 1}},
- {1525, {wxCalendarDateAttr, setBorder, 1}},
- {1526, {wxCalendarDateAttr, setHoliday, 1}},
- {1527, {wxCalendarDateAttr, hasTextColour, 0}},
- {1528, {wxCalendarDateAttr, hasBackgroundColour, 0}},
- {1529, {wxCalendarDateAttr, hasBorderColour, 0}},
- {1530, {wxCalendarDateAttr, hasFont, 0}},
- {1531, {wxCalendarDateAttr, hasBorder, 0}},
- {1532, {wxCalendarDateAttr, isHoliday, 0}},
- {1533, {wxCalendarDateAttr, getTextColour, 0}},
- {1534, {wxCalendarDateAttr, getBackgroundColour, 0}},
- {1535, {wxCalendarDateAttr, getBorderColour, 0}},
- {1536, {wxCalendarDateAttr, getFont, 0}},
- {1537, {wxCalendarDateAttr, getBorder, 0}},
- {1538, {wxCalendarDateAttr, 'Destroy', undefined}},
- {1540, {wxCheckBox, new_4, 4}},
- {1541, {wxCheckBox, new_0, 0}},
- {1542, {wxCheckBox, create, 4}},
- {1543, {wxCheckBox, getValue, 0}},
- {1544, {wxCheckBox, get3StateValue, 0}},
- {1545, {wxCheckBox, is3rdStateAllowedForUser, 0}},
- {1546, {wxCheckBox, is3State, 0}},
- {1547, {wxCheckBox, isChecked, 0}},
- {1548, {wxCheckBox, setValue, 1}},
- {1549, {wxCheckBox, set3StateValue, 1}},
- {1550, {wxCheckBox, 'Destroy', undefined}},
- {1551, {wxCheckListBox, new_0, 0}},
- {1553, {wxCheckListBox, new_3, 3}},
- {1554, {wxCheckListBox, check, 2}},
- {1555, {wxCheckListBox, isChecked, 1}},
- {1556, {wxCheckListBox, 'Destroy', undefined}},
- {1559, {wxChoice, new_3, 3}},
- {1560, {wxChoice, new_0, 0}},
- {1562, {wxChoice, destruct, 0}},
- {1564, {wxChoice, create, 6}},
- {1565, {wxChoice, delete, 1}},
- {1566, {wxChoice, getColumns, 0}},
- {1567, {wxChoice, setColumns, 1}},
- {1568, {wxComboBox, new_0, 0}},
- {1570, {wxComboBox, new_3, 3}},
- {1571, {wxComboBox, destruct, 0}},
- {1573, {wxComboBox, create, 7}},
- {1574, {wxComboBox, canCopy, 0}},
- {1575, {wxComboBox, canCut, 0}},
- {1576, {wxComboBox, canPaste, 0}},
- {1577, {wxComboBox, canRedo, 0}},
- {1578, {wxComboBox, canUndo, 0}},
- {1579, {wxComboBox, copy, 0}},
- {1580, {wxComboBox, cut, 0}},
- {1581, {wxComboBox, getInsertionPoint, 0}},
- {1582, {wxComboBox, getLastPosition, 0}},
- {1583, {wxComboBox, getValue, 0}},
- {1584, {wxComboBox, paste, 0}},
- {1585, {wxComboBox, redo, 0}},
- {1586, {wxComboBox, replace, 3}},
- {1587, {wxComboBox, remove, 2}},
- {1588, {wxComboBox, setInsertionPoint, 1}},
- {1589, {wxComboBox, setInsertionPointEnd, 0}},
- {1590, {wxComboBox, setSelection_1, 1}},
- {1591, {wxComboBox, setSelection_2, 2}},
- {1592, {wxComboBox, setValue, 1}},
- {1593, {wxComboBox, undo, 0}},
- {1594, {wxGauge, new_0, 0}},
- {1595, {wxGauge, new_4, 4}},
- {1596, {wxGauge, create, 4}},
- {1597, {wxGauge, getBezelFace, 0}},
- {1598, {wxGauge, getRange, 0}},
- {1599, {wxGauge, getShadowWidth, 0}},
- {1600, {wxGauge, getValue, 0}},
- {1601, {wxGauge, isVertical, 0}},
- {1602, {wxGauge, setBezelFace, 1}},
- {1603, {wxGauge, setRange, 1}},
- {1604, {wxGauge, setShadowWidth, 1}},
- {1605, {wxGauge, setValue, 1}},
- {1606, {wxGauge, pulse, 0}},
- {1607, {wxGauge, 'Destroy', undefined}},
- {1608, {wxGenericDirCtrl, new_0, 0}},
- {1609, {wxGenericDirCtrl, new_2, 2}},
- {1610, {wxGenericDirCtrl, destruct, 0}},
- {1611, {wxGenericDirCtrl, create, 2}},
- {1612, {wxGenericDirCtrl, init, 0}},
- {1613, {wxGenericDirCtrl, collapseTree, 0}},
- {1614, {wxGenericDirCtrl, expandPath, 1}},
- {1615, {wxGenericDirCtrl, getDefaultPath, 0}},
- {1616, {wxGenericDirCtrl, getPath, 0}},
- {1617, {wxGenericDirCtrl, getFilePath, 0}},
- {1618, {wxGenericDirCtrl, getFilter, 0}},
- {1619, {wxGenericDirCtrl, getFilterIndex, 0}},
- {1620, {wxGenericDirCtrl, getRootId, 0}},
- {1621, {wxGenericDirCtrl, getTreeCtrl, 0}},
- {1622, {wxGenericDirCtrl, reCreateTree, 0}},
- {1623, {wxGenericDirCtrl, setDefaultPath, 1}},
- {1624, {wxGenericDirCtrl, setFilter, 1}},
- {1625, {wxGenericDirCtrl, setFilterIndex, 1}},
- {1626, {wxGenericDirCtrl, setPath, 1}},
- {1628, {wxStaticBox, new_4, 4}},
- {1629, {wxStaticBox, new_0, 0}},
- {1630, {wxStaticBox, create, 4}},
- {1631, {wxStaticBox, 'Destroy', undefined}},
- {1633, {wxStaticLine, new_2, 2}},
- {1634, {wxStaticLine, new_0, 0}},
- {1635, {wxStaticLine, create, 2}},
- {1636, {wxStaticLine, isVertical, 0}},
- {1637, {wxStaticLine, getDefaultSize, 0}},
- {1638, {wxStaticLine, 'Destroy', undefined}},
- {1641, {wxListBox, new_3, 3}},
- {1642, {wxListBox, new_0, 0}},
- {1644, {wxListBox, destruct, 0}},
- {1646, {wxListBox, create, 6}},
- {1647, {wxListBox, deselect, 1}},
- {1648, {wxListBox, getSelections, 1}},
- {1649, {wxListBox, insertItems, 2}},
- {1650, {wxListBox, isSelected, 1}},
- {1652, {wxListBox, set, 2}},
- {1653, {wxListBox, hitTest, 1}},
- {1654, {wxListBox, setFirstItem_1_0, 1}},
- {1655, {wxListBox, setFirstItem_1_1, 1}},
- {1656, {wxListCtrl, new_0, 0}},
- {1657, {wxListCtrl, new_2, 2}},
- {1658, {wxListCtrl, arrange, 1}},
- {1659, {wxListCtrl, assignImageList, 2}},
- {1660, {wxListCtrl, clearAll, 0}},
- {1661, {wxListCtrl, create, 2}},
- {1662, {wxListCtrl, deleteAllItems, 0}},
- {1663, {wxListCtrl, deleteColumn, 1}},
- {1664, {wxListCtrl, deleteItem, 1}},
- {1665, {wxListCtrl, editLabel, 1}},
- {1666, {wxListCtrl, ensureVisible, 1}},
- {1667, {wxListCtrl, findItem_3_0, 3}},
- {1668, {wxListCtrl, findItem_3_1, 3}},
- {1669, {wxListCtrl, getColumn, 2}},
- {1670, {wxListCtrl, getColumnCount, 0}},
- {1671, {wxListCtrl, getColumnWidth, 1}},
- {1672, {wxListCtrl, getCountPerPage, 0}},
- {1673, {wxListCtrl, getEditControl, 0}},
- {1674, {wxListCtrl, getImageList, 1}},
- {1675, {wxListCtrl, getItem, 1}},
- {1676, {wxListCtrl, getItemBackgroundColour, 1}},
- {1677, {wxListCtrl, getItemCount, 0}},
- {1678, {wxListCtrl, getItemData, 1}},
- {1679, {wxListCtrl, getItemFont, 1}},
- {1680, {wxListCtrl, getItemPosition, 2}},
- {1681, {wxListCtrl, getItemRect, 3}},
- {1682, {wxListCtrl, getItemSpacing, 0}},
- {1683, {wxListCtrl, getItemState, 2}},
- {1684, {wxListCtrl, getItemText, 1}},
- {1685, {wxListCtrl, getItemTextColour, 1}},
- {1686, {wxListCtrl, getNextItem, 2}},
- {1687, {wxListCtrl, getSelectedItemCount, 0}},
- {1688, {wxListCtrl, getTextColour, 0}},
- {1689, {wxListCtrl, getTopItem, 0}},
- {1690, {wxListCtrl, getViewRect, 0}},
- {1691, {wxListCtrl, hitTest, 2}},
- {1692, {wxListCtrl, insertColumn_2, 2}},
- {1693, {wxListCtrl, insertColumn_3, 3}},
- {1694, {wxListCtrl, insertItem_1, 1}},
- {1695, {wxListCtrl, insertItem_2_1, 2}},
- {1696, {wxListCtrl, insertItem_2_0, 2}},
- {1697, {wxListCtrl, insertItem_3, 3}},
- {1698, {wxListCtrl, refreshItem, 1}},
- {1699, {wxListCtrl, refreshItems, 2}},
- {1700, {wxListCtrl, scrollList, 2}},
- {1701, {wxListCtrl, setBackgroundColour, 1}},
- {1702, {wxListCtrl, setColumn, 2}},
- {1703, {wxListCtrl, setColumnWidth, 2}},
- {1704, {wxListCtrl, setImageList, 2}},
- {1705, {wxListCtrl, setItem_1, 1}},
- {1706, {wxListCtrl, setItem_4, 4}},
- {1707, {wxListCtrl, setItemBackgroundColour, 2}},
- {1708, {wxListCtrl, setItemCount, 1}},
- {1709, {wxListCtrl, setItemData, 2}},
- {1710, {wxListCtrl, setItemFont, 2}},
- {1711, {wxListCtrl, setItemImage, 3}},
- {1712, {wxListCtrl, setItemColumnImage, 3}},
- {1713, {wxListCtrl, setItemPosition, 2}},
- {1714, {wxListCtrl, setItemState, 3}},
- {1715, {wxListCtrl, setItemText, 2}},
- {1716, {wxListCtrl, setItemTextColour, 2}},
- {1717, {wxListCtrl, setSingleStyle, 2}},
- {1718, {wxListCtrl, setTextColour, 1}},
- {1719, {wxListCtrl, setWindowStyleFlag, 1}},
- {1720, {wxListCtrl, sortItems, 2}},
- {1721, {wxListCtrl, 'Destroy', undefined}},
- {1722, {wxListView, clearColumnImage, 1}},
- {1723, {wxListView, focus, 1}},
- {1724, {wxListView, getFirstSelected, 0}},
- {1725, {wxListView, getFocusedItem, 0}},
- {1726, {wxListView, getNextSelected, 1}},
- {1727, {wxListView, isSelected, 1}},
- {1728, {wxListView, select, 2}},
- {1729, {wxListView, setColumnImage, 2}},
- {1730, {wxListItem, new_0, 0}},
- {1731, {wxListItem, new_1, 1}},
- {1732, {wxListItem, destruct, 0}},
- {1733, {wxListItem, clear, 0}},
- {1734, {wxListItem, getAlign, 0}},
- {1735, {wxListItem, getBackgroundColour, 0}},
- {1736, {wxListItem, getColumn, 0}},
- {1737, {wxListItem, getFont, 0}},
- {1738, {wxListItem, getId, 0}},
- {1739, {wxListItem, getImage, 0}},
- {1740, {wxListItem, getMask, 0}},
- {1741, {wxListItem, getState, 0}},
- {1742, {wxListItem, getText, 0}},
- {1743, {wxListItem, getTextColour, 0}},
- {1744, {wxListItem, getWidth, 0}},
- {1745, {wxListItem, setAlign, 1}},
- {1746, {wxListItem, setBackgroundColour, 1}},
- {1747, {wxListItem, setColumn, 1}},
- {1748, {wxListItem, setFont, 1}},
- {1749, {wxListItem, setId, 1}},
- {1750, {wxListItem, setImage, 1}},
- {1751, {wxListItem, setMask, 1}},
- {1752, {wxListItem, setState, 1}},
- {1753, {wxListItem, setStateMask, 1}},
- {1754, {wxListItem, setText, 1}},
- {1755, {wxListItem, setTextColour, 1}},
- {1756, {wxListItem, setWidth, 1}},
- {1757, {wxListItemAttr, new_0, 0}},
- {1758, {wxListItemAttr, new_3, 3}},
- {1759, {wxListItemAttr, getBackgroundColour, 0}},
- {1760, {wxListItemAttr, getFont, 0}},
- {1761, {wxListItemAttr, getTextColour, 0}},
- {1762, {wxListItemAttr, hasBackgroundColour, 0}},
- {1763, {wxListItemAttr, hasFont, 0}},
- {1764, {wxListItemAttr, hasTextColour, 0}},
- {1765, {wxListItemAttr, setBackgroundColour, 1}},
- {1766, {wxListItemAttr, setFont, 1}},
- {1767, {wxListItemAttr, setTextColour, 1}},
- {1768, {wxListItemAttr, 'Destroy', undefined}},
- {1769, {wxImageList, new_0, 0}},
- {1770, {wxImageList, new_3, 3}},
- {1771, {wxImageList, add_1, 1}},
- {1772, {wxImageList, add_2_0, 2}},
- {1773, {wxImageList, add_2_1, 2}},
- {1774, {wxImageList, create, 3}},
- {1776, {wxImageList, draw, 5}},
- {1777, {wxImageList, getBitmap, 1}},
- {1778, {wxImageList, getIcon, 1}},
- {1779, {wxImageList, getImageCount, 0}},
- {1780, {wxImageList, getSize, 3}},
- {1781, {wxImageList, remove, 1}},
- {1782, {wxImageList, removeAll, 0}},
- {1783, {wxImageList, replace_2, 2}},
- {1784, {wxImageList, replace_3, 3}},
- {1785, {wxImageList, 'Destroy', undefined}},
- {1786, {wxTextAttr, new_0, 0}},
- {1787, {wxTextAttr, new_2, 2}},
- {1788, {wxTextAttr, getAlignment, 0}},
- {1789, {wxTextAttr, getBackgroundColour, 0}},
- {1790, {wxTextAttr, getFont, 0}},
- {1791, {wxTextAttr, getLeftIndent, 0}},
- {1792, {wxTextAttr, getLeftSubIndent, 0}},
- {1793, {wxTextAttr, getRightIndent, 0}},
- {1794, {wxTextAttr, getTabs, 0}},
- {1795, {wxTextAttr, getTextColour, 0}},
- {1796, {wxTextAttr, hasBackgroundColour, 0}},
- {1797, {wxTextAttr, hasFont, 0}},
- {1798, {wxTextAttr, hasTextColour, 0}},
- {1799, {wxTextAttr, getFlags, 0}},
- {1800, {wxTextAttr, isDefault, 0}},
- {1801, {wxTextAttr, setAlignment, 1}},
- {1802, {wxTextAttr, setBackgroundColour, 1}},
- {1803, {wxTextAttr, setFlags, 1}},
- {1804, {wxTextAttr, setFont, 2}},
- {1805, {wxTextAttr, setLeftIndent, 2}},
- {1806, {wxTextAttr, setRightIndent, 1}},
- {1807, {wxTextAttr, setTabs, 1}},
- {1808, {wxTextAttr, setTextColour, 1}},
- {1809, {wxTextAttr, 'Destroy', undefined}},
- {1811, {wxTextCtrl, new_3, 3}},
- {1812, {wxTextCtrl, new_0, 0}},
- {1814, {wxTextCtrl, destruct, 0}},
- {1815, {wxTextCtrl, appendText, 1}},
- {1816, {wxTextCtrl, canCopy, 0}},
- {1817, {wxTextCtrl, canCut, 0}},
- {1818, {wxTextCtrl, canPaste, 0}},
- {1819, {wxTextCtrl, canRedo, 0}},
- {1820, {wxTextCtrl, canUndo, 0}},
- {1821, {wxTextCtrl, clear, 0}},
- {1822, {wxTextCtrl, copy, 0}},
- {1823, {wxTextCtrl, create, 3}},
- {1824, {wxTextCtrl, cut, 0}},
- {1825, {wxTextCtrl, discardEdits, 0}},
- {1826, {wxTextCtrl, emulateKeyPress, 1}},
- {1827, {wxTextCtrl, getDefaultStyle, 0}},
- {1828, {wxTextCtrl, getInsertionPoint, 0}},
- {1829, {wxTextCtrl, getLastPosition, 0}},
- {1830, {wxTextCtrl, getLineLength, 1}},
- {1831, {wxTextCtrl, getLineText, 1}},
- {1832, {wxTextCtrl, getNumberOfLines, 0}},
- {1833, {wxTextCtrl, getRange, 2}},
- {1834, {wxTextCtrl, getSelection, 2}},
- {1835, {wxTextCtrl, getStringSelection, 0}},
- {1836, {wxTextCtrl, getStyle, 2}},
- {1837, {wxTextCtrl, getValue, 0}},
- {1838, {wxTextCtrl, isEditable, 0}},
- {1839, {wxTextCtrl, isModified, 0}},
- {1840, {wxTextCtrl, isMultiLine, 0}},
- {1841, {wxTextCtrl, isSingleLine, 0}},
- {1842, {wxTextCtrl, loadFile, 2}},
- {1843, {wxTextCtrl, markDirty, 0}},
- {1844, {wxTextCtrl, paste, 0}},
- {1845, {wxTextCtrl, positionToXY, 3}},
- {1846, {wxTextCtrl, redo, 0}},
- {1847, {wxTextCtrl, remove, 2}},
- {1848, {wxTextCtrl, replace, 3}},
- {1849, {wxTextCtrl, saveFile, 1}},
- {1850, {wxTextCtrl, setDefaultStyle, 1}},
- {1851, {wxTextCtrl, setEditable, 1}},
- {1852, {wxTextCtrl, setInsertionPoint, 1}},
- {1853, {wxTextCtrl, setInsertionPointEnd, 0}},
- {1855, {wxTextCtrl, setMaxLength, 1}},
- {1856, {wxTextCtrl, setSelection, 2}},
- {1857, {wxTextCtrl, setStyle, 3}},
- {1858, {wxTextCtrl, setValue, 1}},
- {1859, {wxTextCtrl, showPosition, 1}},
- {1860, {wxTextCtrl, undo, 0}},
- {1861, {wxTextCtrl, writeText, 1}},
- {1862, {wxTextCtrl, xYToPosition, 2}},
- {1865, {wxNotebook, new_0, 0}},
- {1866, {wxNotebook, new_3, 3}},
- {1867, {wxNotebook, destruct, 0}},
- {1868, {wxNotebook, addPage, 3}},
- {1869, {wxNotebook, advanceSelection, 1}},
- {1870, {wxNotebook, assignImageList, 1}},
- {1871, {wxNotebook, create, 3}},
- {1872, {wxNotebook, deleteAllPages, 0}},
- {1873, {wxNotebook, deletePage, 1}},
- {1874, {wxNotebook, removePage, 1}},
- {1875, {wxNotebook, getCurrentPage, 0}},
- {1876, {wxNotebook, getImageList, 0}},
- {1878, {wxNotebook, getPage, 1}},
- {1879, {wxNotebook, getPageCount, 0}},
- {1880, {wxNotebook, getPageImage, 1}},
- {1881, {wxNotebook, getPageText, 1}},
- {1882, {wxNotebook, getRowCount, 0}},
- {1883, {wxNotebook, getSelection, 0}},
- {1884, {wxNotebook, getThemeBackgroundColour, 0}},
- {1886, {wxNotebook, hitTest, 2}},
- {1888, {wxNotebook, insertPage, 4}},
- {1889, {wxNotebook, setImageList, 1}},
- {1890, {wxNotebook, setPadding, 1}},
- {1891, {wxNotebook, setPageSize, 1}},
- {1892, {wxNotebook, setPageImage, 2}},
- {1893, {wxNotebook, setPageText, 2}},
- {1894, {wxNotebook, setSelection, 1}},
- {1895, {wxNotebook, changeSelection, 1}},
- {1896, {wxChoicebook, new_0, 0}},
- {1897, {wxChoicebook, new_3, 3}},
- {1898, {wxChoicebook, addPage, 3}},
- {1899, {wxChoicebook, advanceSelection, 1}},
- {1900, {wxChoicebook, assignImageList, 1}},
- {1901, {wxChoicebook, create, 3}},
- {1902, {wxChoicebook, deleteAllPages, 0}},
- {1903, {wxChoicebook, deletePage, 1}},
- {1904, {wxChoicebook, removePage, 1}},
- {1905, {wxChoicebook, getCurrentPage, 0}},
- {1906, {wxChoicebook, getImageList, 0}},
- {1908, {wxChoicebook, getPage, 1}},
- {1909, {wxChoicebook, getPageCount, 0}},
- {1910, {wxChoicebook, getPageImage, 1}},
- {1911, {wxChoicebook, getPageText, 1}},
- {1912, {wxChoicebook, getSelection, 0}},
- {1913, {wxChoicebook, hitTest, 2}},
- {1914, {wxChoicebook, insertPage, 4}},
- {1915, {wxChoicebook, setImageList, 1}},
- {1916, {wxChoicebook, setPageSize, 1}},
- {1917, {wxChoicebook, setPageImage, 2}},
- {1918, {wxChoicebook, setPageText, 2}},
- {1919, {wxChoicebook, setSelection, 1}},
- {1920, {wxChoicebook, changeSelection, 1}},
- {1921, {wxChoicebook, 'Destroy', undefined}},
- {1922, {wxToolbook, new_0, 0}},
- {1923, {wxToolbook, new_3, 3}},
- {1924, {wxToolbook, addPage, 3}},
- {1925, {wxToolbook, advanceSelection, 1}},
- {1926, {wxToolbook, assignImageList, 1}},
- {1927, {wxToolbook, create, 3}},
- {1928, {wxToolbook, deleteAllPages, 0}},
- {1929, {wxToolbook, deletePage, 1}},
- {1930, {wxToolbook, removePage, 1}},
- {1931, {wxToolbook, getCurrentPage, 0}},
- {1932, {wxToolbook, getImageList, 0}},
- {1934, {wxToolbook, getPage, 1}},
- {1935, {wxToolbook, getPageCount, 0}},
- {1936, {wxToolbook, getPageImage, 1}},
- {1937, {wxToolbook, getPageText, 1}},
- {1938, {wxToolbook, getSelection, 0}},
- {1940, {wxToolbook, hitTest, 2}},
- {1941, {wxToolbook, insertPage, 4}},
- {1942, {wxToolbook, setImageList, 1}},
- {1943, {wxToolbook, setPageSize, 1}},
- {1944, {wxToolbook, setPageImage, 2}},
- {1945, {wxToolbook, setPageText, 2}},
- {1946, {wxToolbook, setSelection, 1}},
- {1947, {wxToolbook, changeSelection, 1}},
- {1948, {wxToolbook, 'Destroy', undefined}},
- {1949, {wxListbook, new_0, 0}},
- {1950, {wxListbook, new_3, 3}},
- {1951, {wxListbook, addPage, 3}},
- {1952, {wxListbook, advanceSelection, 1}},
- {1953, {wxListbook, assignImageList, 1}},
- {1954, {wxListbook, create, 3}},
- {1955, {wxListbook, deleteAllPages, 0}},
- {1956, {wxListbook, deletePage, 1}},
- {1957, {wxListbook, removePage, 1}},
- {1958, {wxListbook, getCurrentPage, 0}},
- {1959, {wxListbook, getImageList, 0}},
- {1961, {wxListbook, getPage, 1}},
- {1962, {wxListbook, getPageCount, 0}},
- {1963, {wxListbook, getPageImage, 1}},
- {1964, {wxListbook, getPageText, 1}},
- {1965, {wxListbook, getSelection, 0}},
- {1967, {wxListbook, hitTest, 2}},
- {1968, {wxListbook, insertPage, 4}},
- {1969, {wxListbook, setImageList, 1}},
- {1970, {wxListbook, setPageSize, 1}},
- {1971, {wxListbook, setPageImage, 2}},
- {1972, {wxListbook, setPageText, 2}},
- {1973, {wxListbook, setSelection, 1}},
- {1974, {wxListbook, changeSelection, 1}},
- {1975, {wxListbook, 'Destroy', undefined}},
- {1976, {wxTreebook, new_0, 0}},
- {1977, {wxTreebook, new_3, 3}},
- {1978, {wxTreebook, addPage, 3}},
- {1979, {wxTreebook, advanceSelection, 1}},
- {1980, {wxTreebook, assignImageList, 1}},
- {1981, {wxTreebook, create, 3}},
- {1982, {wxTreebook, deleteAllPages, 0}},
- {1983, {wxTreebook, deletePage, 1}},
- {1984, {wxTreebook, removePage, 1}},
- {1985, {wxTreebook, getCurrentPage, 0}},
- {1986, {wxTreebook, getImageList, 0}},
- {1988, {wxTreebook, getPage, 1}},
- {1989, {wxTreebook, getPageCount, 0}},
- {1990, {wxTreebook, getPageImage, 1}},
- {1991, {wxTreebook, getPageText, 1}},
- {1992, {wxTreebook, getSelection, 0}},
- {1993, {wxTreebook, expandNode, 2}},
- {1994, {wxTreebook, isNodeExpanded, 1}},
- {1996, {wxTreebook, hitTest, 2}},
- {1997, {wxTreebook, insertPage, 4}},
- {1998, {wxTreebook, insertSubPage, 4}},
- {1999, {wxTreebook, setImageList, 1}},
- {2000, {wxTreebook, setPageSize, 1}},
- {2001, {wxTreebook, setPageImage, 2}},
- {2002, {wxTreebook, setPageText, 2}},
- {2003, {wxTreebook, setSelection, 1}},
- {2004, {wxTreebook, changeSelection, 1}},
- {2005, {wxTreebook, 'Destroy', undefined}},
- {2008, {wxTreeCtrl, new_2, 2}},
- {2009, {wxTreeCtrl, new_0, 0}},
- {2011, {wxTreeCtrl, destruct, 0}},
- {2012, {wxTreeCtrl, addRoot, 2}},
- {2013, {wxTreeCtrl, appendItem, 3}},
- {2014, {wxTreeCtrl, assignImageList, 1}},
- {2015, {wxTreeCtrl, assignStateImageList, 1}},
- {2016, {wxTreeCtrl, collapse, 1}},
- {2017, {wxTreeCtrl, collapseAndReset, 1}},
- {2018, {wxTreeCtrl, create, 2}},
- {2019, {wxTreeCtrl, delete, 1}},
- {2020, {wxTreeCtrl, deleteAllItems, 0}},
- {2021, {wxTreeCtrl, deleteChildren, 1}},
- {2022, {wxTreeCtrl, editLabel, 1}},
- {2023, {wxTreeCtrl, ensureVisible, 1}},
- {2024, {wxTreeCtrl, expand, 1}},
- {2025, {wxTreeCtrl, getBoundingRect, 3}},
- {2027, {wxTreeCtrl, getChildrenCount, 2}},
- {2028, {wxTreeCtrl, getCount, 0}},
- {2029, {wxTreeCtrl, getEditControl, 0}},
- {2030, {wxTreeCtrl, getFirstChild, 2}},
- {2031, {wxTreeCtrl, getNextChild, 2}},
- {2032, {wxTreeCtrl, getFirstVisibleItem, 0}},
- {2033, {wxTreeCtrl, getImageList, 0}},
- {2034, {wxTreeCtrl, getIndent, 0}},
- {2035, {wxTreeCtrl, getItemBackgroundColour, 1}},
- {2036, {wxTreeCtrl, getItemData, 1}},
- {2037, {wxTreeCtrl, getItemFont, 1}},
- {2038, {wxTreeCtrl, getItemImage_1, 1}},
- {2039, {wxTreeCtrl, getItemImage_2, 2}},
- {2040, {wxTreeCtrl, getItemText, 1}},
- {2041, {wxTreeCtrl, getItemTextColour, 1}},
- {2042, {wxTreeCtrl, getLastChild, 1}},
- {2043, {wxTreeCtrl, getNextSibling, 1}},
- {2044, {wxTreeCtrl, getNextVisible, 1}},
- {2045, {wxTreeCtrl, getItemParent, 1}},
- {2046, {wxTreeCtrl, getPrevSibling, 1}},
- {2047, {wxTreeCtrl, getPrevVisible, 1}},
- {2048, {wxTreeCtrl, getRootItem, 0}},
- {2049, {wxTreeCtrl, getSelection, 0}},
- {2050, {wxTreeCtrl, getSelections, 1}},
- {2051, {wxTreeCtrl, getStateImageList, 0}},
- {2052, {wxTreeCtrl, hitTest, 1}},
- {2054, {wxTreeCtrl, insertItem, 4}},
- {2055, {wxTreeCtrl, isBold, 1}},
- {2056, {wxTreeCtrl, isExpanded, 1}},
- {2057, {wxTreeCtrl, isSelected, 1}},
- {2058, {wxTreeCtrl, isVisible, 1}},
- {2059, {wxTreeCtrl, itemHasChildren, 1}},
- {2060, {wxTreeCtrl, prependItem, 3}},
- {2061, {wxTreeCtrl, scrollTo, 1}},
- {2062, {wxTreeCtrl, selectItem_1, 1}},
- {2063, {wxTreeCtrl, selectItem_2, 2}},
- {2064, {wxTreeCtrl, setIndent, 1}},
- {2065, {wxTreeCtrl, setImageList, 1}},
- {2066, {wxTreeCtrl, setItemBackgroundColour, 2}},
- {2067, {wxTreeCtrl, setItemBold, 2}},
- {2068, {wxTreeCtrl, setItemData, 2}},
- {2069, {wxTreeCtrl, setItemDropHighlight, 2}},
- {2070, {wxTreeCtrl, setItemFont, 2}},
- {2071, {wxTreeCtrl, setItemHasChildren, 2}},
- {2072, {wxTreeCtrl, setItemImage_2, 2}},
- {2073, {wxTreeCtrl, setItemImage_3, 3}},
- {2074, {wxTreeCtrl, setItemText, 2}},
- {2075, {wxTreeCtrl, setItemTextColour, 2}},
- {2076, {wxTreeCtrl, setStateImageList, 1}},
- {2077, {wxTreeCtrl, setWindowStyle, 1}},
- {2078, {wxTreeCtrl, sortChildren, 1}},
- {2079, {wxTreeCtrl, toggle, 1}},
- {2080, {wxTreeCtrl, toggleItemSelection, 1}},
- {2081, {wxTreeCtrl, unselect, 0}},
- {2082, {wxTreeCtrl, unselectAll, 0}},
- {2083, {wxTreeCtrl, unselectItem, 1}},
- {2084, {wxScrollBar, new_0, 0}},
- {2085, {wxScrollBar, new_3, 3}},
- {2086, {wxScrollBar, destruct, 0}},
- {2087, {wxScrollBar, create, 3}},
- {2088, {wxScrollBar, getRange, 0}},
- {2089, {wxScrollBar, getPageSize, 0}},
- {2090, {wxScrollBar, getThumbPosition, 0}},
- {2091, {wxScrollBar, getThumbSize, 0}},
- {2092, {wxScrollBar, setThumbPosition, 1}},
- {2093, {wxScrollBar, setScrollbar, 5}},
- {2095, {wxSpinButton, new_2, 2}},
- {2096, {wxSpinButton, new_0, 0}},
- {2097, {wxSpinButton, create, 2}},
- {2098, {wxSpinButton, getMax, 0}},
- {2099, {wxSpinButton, getMin, 0}},
- {2100, {wxSpinButton, getValue, 0}},
- {2101, {wxSpinButton, setRange, 2}},
- {2102, {wxSpinButton, setValue, 1}},
- {2103, {wxSpinButton, 'Destroy', undefined}},
- {2104, {wxSpinCtrl, new_0, 0}},
- {2105, {wxSpinCtrl, new_2, 2}},
- {2107, {wxSpinCtrl, create, 2}},
- {2110, {wxSpinCtrl, setValue_1_1, 1}},
- {2111, {wxSpinCtrl, setValue_1_0, 1}},
- {2113, {wxSpinCtrl, getValue, 0}},
- {2115, {wxSpinCtrl, setRange, 2}},
- {2116, {wxSpinCtrl, setSelection, 2}},
- {2118, {wxSpinCtrl, getMin, 0}},
- {2120, {wxSpinCtrl, getMax, 0}},
- {2121, {wxSpinCtrl, 'Destroy', undefined}},
- {2122, {wxStaticText, new_0, 0}},
- {2123, {wxStaticText, new_4, 4}},
- {2124, {wxStaticText, create, 4}},
- {2125, {wxStaticText, getLabel, 0}},
- {2126, {wxStaticText, setLabel, 1}},
- {2127, {wxStaticText, wrap, 1}},
- {2128, {wxStaticText, 'Destroy', undefined}},
- {2129, {wxStaticBitmap, new_0, 0}},
- {2130, {wxStaticBitmap, new_4, 4}},
- {2131, {wxStaticBitmap, create, 4}},
- {2132, {wxStaticBitmap, getBitmap, 0}},
- {2133, {wxStaticBitmap, setBitmap, 1}},
- {2134, {wxStaticBitmap, 'Destroy', undefined}},
- {2135, {wxRadioBox, new, 7}},
- {2137, {wxRadioBox, destruct, 0}},
- {2138, {wxRadioBox, create, 7}},
- {2139, {wxRadioBox, enable_2, 2}},
- {2140, {wxRadioBox, enable_1, 1}},
- {2141, {wxRadioBox, getSelection, 0}},
- {2142, {wxRadioBox, getString, 1}},
- {2143, {wxRadioBox, setSelection, 1}},
- {2144, {wxRadioBox, show_2, 2}},
- {2145, {wxRadioBox, show_1, 1}},
- {2146, {wxRadioBox, getColumnCount, 0}},
- {2147, {wxRadioBox, getItemHelpText, 1}},
- {2148, {wxRadioBox, getItemToolTip, 1}},
- {2150, {wxRadioBox, getItemFromPoint, 1}},
- {2151, {wxRadioBox, getRowCount, 0}},
- {2152, {wxRadioBox, isItemEnabled, 1}},
- {2153, {wxRadioBox, isItemShown, 1}},
- {2154, {wxRadioBox, setItemHelpText, 2}},
- {2155, {wxRadioBox, setItemToolTip, 2}},
- {2156, {wxRadioButton, new_0, 0}},
- {2157, {wxRadioButton, new_4, 4}},
- {2158, {wxRadioButton, create, 4}},
- {2159, {wxRadioButton, getValue, 0}},
- {2160, {wxRadioButton, setValue, 1}},
- {2161, {wxRadioButton, 'Destroy', undefined}},
- {2163, {wxSlider, new_6, 6}},
- {2164, {wxSlider, new_0, 0}},
- {2165, {wxSlider, create, 6}},
- {2166, {wxSlider, getLineSize, 0}},
- {2167, {wxSlider, getMax, 0}},
- {2168, {wxSlider, getMin, 0}},
- {2169, {wxSlider, getPageSize, 0}},
- {2170, {wxSlider, getThumbLength, 0}},
- {2171, {wxSlider, getValue, 0}},
- {2172, {wxSlider, setLineSize, 1}},
- {2173, {wxSlider, setPageSize, 1}},
- {2174, {wxSlider, setRange, 2}},
- {2175, {wxSlider, setThumbLength, 1}},
- {2176, {wxSlider, setValue, 1}},
- {2177, {wxSlider, 'Destroy', undefined}},
- {2179, {wxDialog, new_4, 4}},
- {2180, {wxDialog, new_0, 0}},
- {2182, {wxDialog, destruct, 0}},
- {2183, {wxDialog, create, 4}},
- {2184, {wxDialog, createButtonSizer, 1}},
- {2185, {wxDialog, createStdDialogButtonSizer, 1}},
- {2186, {wxDialog, endModal, 1}},
- {2187, {wxDialog, getAffirmativeId, 0}},
- {2188, {wxDialog, getReturnCode, 0}},
- {2189, {wxDialog, isModal, 0}},
- {2190, {wxDialog, setAffirmativeId, 1}},
- {2191, {wxDialog, setReturnCode, 1}},
- {2192, {wxDialog, show, 1}},
- {2193, {wxDialog, showModal, 0}},
- {2194, {wxColourDialog, new_0, 0}},
- {2195, {wxColourDialog, new_2, 2}},
- {2196, {wxColourDialog, destruct, 0}},
- {2197, {wxColourDialog, create, 2}},
- {2198, {wxColourDialog, getColourData, 0}},
- {2199, {wxColourData, new_0, 0}},
- {2200, {wxColourData, new_1, 1}},
- {2201, {wxColourData, destruct, 0}},
- {2202, {wxColourData, getChooseFull, 0}},
- {2203, {wxColourData, getColour, 0}},
- {2205, {wxColourData, getCustomColour, 1}},
- {2206, {wxColourData, setChooseFull, 1}},
- {2207, {wxColourData, setColour, 1}},
- {2208, {wxColourData, setCustomColour, 2}},
- {2209, {wxPalette, new_0, 0}},
- {2210, {wxPalette, new_4, 4}},
- {2212, {wxPalette, destruct, 0}},
- {2213, {wxPalette, create, 4}},
- {2214, {wxPalette, getColoursCount, 0}},
- {2215, {wxPalette, getPixel, 3}},
- {2216, {wxPalette, getRGB, 4}},
- {2217, {wxPalette, isOk, 0}},
- {2221, {wxDirDialog, new, 2}},
- {2222, {wxDirDialog, destruct, 0}},
- {2223, {wxDirDialog, getPath, 0}},
- {2224, {wxDirDialog, getMessage, 0}},
- {2225, {wxDirDialog, setMessage, 1}},
- {2226, {wxDirDialog, setPath, 1}},
- {2230, {wxFileDialog, new, 2}},
- {2231, {wxFileDialog, destruct, 0}},
- {2232, {wxFileDialog, getDirectory, 0}},
- {2233, {wxFileDialog, getFilename, 0}},
- {2234, {wxFileDialog, getFilenames, 1}},
- {2235, {wxFileDialog, getFilterIndex, 0}},
- {2236, {wxFileDialog, getMessage, 0}},
- {2237, {wxFileDialog, getPath, 0}},
- {2238, {wxFileDialog, getPaths, 1}},
- {2239, {wxFileDialog, getWildcard, 0}},
- {2240, {wxFileDialog, setDirectory, 1}},
- {2241, {wxFileDialog, setFilename, 1}},
- {2242, {wxFileDialog, setFilterIndex, 1}},
- {2243, {wxFileDialog, setMessage, 1}},
- {2244, {wxFileDialog, setPath, 1}},
- {2245, {wxFileDialog, setWildcard, 1}},
- {2246, {wxPickerBase, setInternalMargin, 1}},
- {2247, {wxPickerBase, getInternalMargin, 0}},
- {2248, {wxPickerBase, setTextCtrlProportion, 1}},
- {2249, {wxPickerBase, setPickerCtrlProportion, 1}},
- {2250, {wxPickerBase, getTextCtrlProportion, 0}},
- {2251, {wxPickerBase, getPickerCtrlProportion, 0}},
- {2252, {wxPickerBase, hasTextCtrl, 0}},
- {2253, {wxPickerBase, getTextCtrl, 0}},
- {2254, {wxPickerBase, isTextCtrlGrowable, 0}},
- {2255, {wxPickerBase, setPickerCtrlGrowable, 1}},
- {2256, {wxPickerBase, setTextCtrlGrowable, 1}},
- {2257, {wxPickerBase, isPickerCtrlGrowable, 0}},
- {2258, {wxFilePickerCtrl, new_0, 0}},
- {2259, {wxFilePickerCtrl, new_3, 3}},
- {2260, {wxFilePickerCtrl, create, 3}},
- {2261, {wxFilePickerCtrl, getPath, 0}},
- {2262, {wxFilePickerCtrl, setPath, 1}},
- {2263, {wxFilePickerCtrl, 'Destroy', undefined}},
- {2264, {wxDirPickerCtrl, new_0, 0}},
- {2265, {wxDirPickerCtrl, new_3, 3}},
- {2266, {wxDirPickerCtrl, create, 3}},
- {2267, {wxDirPickerCtrl, getPath, 0}},
- {2268, {wxDirPickerCtrl, setPath, 1}},
- {2269, {wxDirPickerCtrl, 'Destroy', undefined}},
- {2270, {wxColourPickerCtrl, new_0, 0}},
- {2271, {wxColourPickerCtrl, new_3, 3}},
- {2272, {wxColourPickerCtrl, create, 3}},
- {2273, {wxColourPickerCtrl, getColour, 0}},
- {2274, {wxColourPickerCtrl, setColour_1_1, 1}},
- {2275, {wxColourPickerCtrl, setColour_1_0, 1}},
- {2276, {wxColourPickerCtrl, 'Destroy', undefined}},
- {2277, {wxDatePickerCtrl, new_0, 0}},
- {2278, {wxDatePickerCtrl, new_3, 3}},
- {2279, {wxDatePickerCtrl, getRange, 2}},
- {2280, {wxDatePickerCtrl, getValue, 0}},
- {2281, {wxDatePickerCtrl, setRange, 2}},
- {2282, {wxDatePickerCtrl, setValue, 1}},
- {2283, {wxDatePickerCtrl, 'Destroy', undefined}},
- {2284, {wxFontPickerCtrl, new_0, 0}},
- {2285, {wxFontPickerCtrl, new_3, 3}},
- {2286, {wxFontPickerCtrl, create, 3}},
- {2287, {wxFontPickerCtrl, getSelectedFont, 0}},
- {2288, {wxFontPickerCtrl, setSelectedFont, 1}},
- {2289, {wxFontPickerCtrl, getMaxPointSize, 0}},
- {2290, {wxFontPickerCtrl, setMaxPointSize, 1}},
- {2291, {wxFontPickerCtrl, 'Destroy', undefined}},
- {2294, {wxFindReplaceDialog, new_0, 0}},
- {2295, {wxFindReplaceDialog, new_4, 4}},
- {2296, {wxFindReplaceDialog, destruct, 0}},
- {2297, {wxFindReplaceDialog, create, 4}},
- {2298, {wxFindReplaceDialog, getData, 0}},
- {2299, {wxFindReplaceData, new_0, 0}},
- {2300, {wxFindReplaceData, new_1, 1}},
- {2301, {wxFindReplaceData, getFindString, 0}},
- {2302, {wxFindReplaceData, getReplaceString, 0}},
- {2303, {wxFindReplaceData, getFlags, 0}},
- {2304, {wxFindReplaceData, setFlags, 1}},
- {2305, {wxFindReplaceData, setFindString, 1}},
- {2306, {wxFindReplaceData, setReplaceString, 1}},
- {2307, {wxFindReplaceData, 'Destroy', undefined}},
- {2308, {wxMultiChoiceDialog, new_0, 0}},
- {2310, {wxMultiChoiceDialog, new_5, 5}},
- {2311, {wxMultiChoiceDialog, getSelections, 0}},
- {2312, {wxMultiChoiceDialog, setSelections, 1}},
- {2313, {wxMultiChoiceDialog, 'Destroy', undefined}},
- {2314, {wxSingleChoiceDialog, new_0, 0}},
- {2316, {wxSingleChoiceDialog, new_5, 5}},
- {2317, {wxSingleChoiceDialog, getSelection, 0}},
- {2318, {wxSingleChoiceDialog, getStringSelection, 0}},
- {2319, {wxSingleChoiceDialog, setSelection, 1}},
- {2320, {wxSingleChoiceDialog, 'Destroy', undefined}},
- {2321, {wxTextEntryDialog, new, 3}},
- {2322, {wxTextEntryDialog, getValue, 0}},
- {2323, {wxTextEntryDialog, setValue, 1}},
- {2324, {wxTextEntryDialog, 'Destroy', undefined}},
- {2325, {wxPasswordEntryDialog, new, 3}},
- {2326, {wxPasswordEntryDialog, 'Destroy', undefined}},
- {2327, {wxFontData, new_0, 0}},
- {2328, {wxFontData, new_1, 1}},
- {2329, {wxFontData, destruct, 0}},
- {2330, {wxFontData, enableEffects, 1}},
- {2331, {wxFontData, getAllowSymbols, 0}},
- {2332, {wxFontData, getColour, 0}},
- {2333, {wxFontData, getChosenFont, 0}},
- {2334, {wxFontData, getEnableEffects, 0}},
- {2335, {wxFontData, getInitialFont, 0}},
- {2336, {wxFontData, getShowHelp, 0}},
- {2337, {wxFontData, setAllowSymbols, 1}},
- {2338, {wxFontData, setChosenFont, 1}},
- {2339, {wxFontData, setColour, 1}},
- {2340, {wxFontData, setInitialFont, 1}},
- {2341, {wxFontData, setRange, 2}},
- {2342, {wxFontData, setShowHelp, 1}},
- {2346, {wxFontDialog, new_0, 0}},
- {2348, {wxFontDialog, new_2, 2}},
- {2350, {wxFontDialog, create, 2}},
- {2351, {wxFontDialog, getFontData, 0}},
- {2353, {wxFontDialog, 'Destroy', undefined}},
- {2354, {wxProgressDialog, new, 3}},
- {2355, {wxProgressDialog, destruct, 0}},
- {2356, {wxProgressDialog, resume, 0}},
- {2357, {wxProgressDialog, update_2, 2}},
- {2358, {wxProgressDialog, update_0, 0}},
- {2359, {wxMessageDialog, new, 3}},
- {2360, {wxMessageDialog, destruct, 0}},
- {2361, {wxPageSetupDialog, new, 2}},
- {2362, {wxPageSetupDialog, destruct, 0}},
- {2363, {wxPageSetupDialog, getPageSetupData, 0}},
- {2364, {wxPageSetupDialog, showModal, 0}},
- {2365, {wxPageSetupDialogData, new_0, 0}},
- {2366, {wxPageSetupDialogData, new_1_0, 1}},
- {2367, {wxPageSetupDialogData, new_1_1, 1}},
- {2368, {wxPageSetupDialogData, destruct, 0}},
- {2369, {wxPageSetupDialogData, enableHelp, 1}},
- {2370, {wxPageSetupDialogData, enableMargins, 1}},
- {2371, {wxPageSetupDialogData, enableOrientation, 1}},
- {2372, {wxPageSetupDialogData, enablePaper, 1}},
- {2373, {wxPageSetupDialogData, enablePrinter, 1}},
- {2374, {wxPageSetupDialogData, getDefaultMinMargins, 0}},
- {2375, {wxPageSetupDialogData, getEnableMargins, 0}},
- {2376, {wxPageSetupDialogData, getEnableOrientation, 0}},
- {2377, {wxPageSetupDialogData, getEnablePaper, 0}},
- {2378, {wxPageSetupDialogData, getEnablePrinter, 0}},
- {2379, {wxPageSetupDialogData, getEnableHelp, 0}},
- {2380, {wxPageSetupDialogData, getDefaultInfo, 0}},
- {2381, {wxPageSetupDialogData, getMarginTopLeft, 0}},
- {2382, {wxPageSetupDialogData, getMarginBottomRight, 0}},
- {2383, {wxPageSetupDialogData, getMinMarginTopLeft, 0}},
- {2384, {wxPageSetupDialogData, getMinMarginBottomRight, 0}},
- {2385, {wxPageSetupDialogData, getPaperId, 0}},
- {2386, {wxPageSetupDialogData, getPaperSize, 0}},
- {2388, {wxPageSetupDialogData, getPrintData, 0}},
- {2389, {wxPageSetupDialogData, isOk, 0}},
- {2390, {wxPageSetupDialogData, setDefaultInfo, 1}},
- {2391, {wxPageSetupDialogData, setDefaultMinMargins, 1}},
- {2392, {wxPageSetupDialogData, setMarginTopLeft, 1}},
- {2393, {wxPageSetupDialogData, setMarginBottomRight, 1}},
- {2394, {wxPageSetupDialogData, setMinMarginTopLeft, 1}},
- {2395, {wxPageSetupDialogData, setMinMarginBottomRight, 1}},
- {2396, {wxPageSetupDialogData, setPaperId, 1}},
- {2397, {wxPageSetupDialogData, setPaperSize_1_1, 1}},
- {2398, {wxPageSetupDialogData, setPaperSize_1_0, 1}},
- {2399, {wxPageSetupDialogData, setPrintData, 1}},
- {2400, {wxPrintDialog, new_2_0, 2}},
- {2401, {wxPrintDialog, new_2_1, 2}},
- {2402, {wxPrintDialog, destruct, 0}},
- {2403, {wxPrintDialog, getPrintDialogData, 0}},
- {2404, {wxPrintDialog, getPrintDC, 0}},
- {2405, {wxPrintDialogData, new_0, 0}},
- {2406, {wxPrintDialogData, new_1_1, 1}},
- {2407, {wxPrintDialogData, new_1_0, 1}},
- {2408, {wxPrintDialogData, destruct, 0}},
- {2409, {wxPrintDialogData, enableHelp, 1}},
- {2410, {wxPrintDialogData, enablePageNumbers, 1}},
- {2411, {wxPrintDialogData, enablePrintToFile, 1}},
- {2412, {wxPrintDialogData, enableSelection, 1}},
- {2413, {wxPrintDialogData, getAllPages, 0}},
- {2414, {wxPrintDialogData, getCollate, 0}},
- {2415, {wxPrintDialogData, getFromPage, 0}},
- {2416, {wxPrintDialogData, getMaxPage, 0}},
- {2417, {wxPrintDialogData, getMinPage, 0}},
- {2418, {wxPrintDialogData, getNoCopies, 0}},
- {2419, {wxPrintDialogData, getPrintData, 0}},
- {2420, {wxPrintDialogData, getPrintToFile, 0}},
- {2421, {wxPrintDialogData, getSelection, 0}},
- {2422, {wxPrintDialogData, getToPage, 0}},
- {2423, {wxPrintDialogData, isOk, 0}},
- {2424, {wxPrintDialogData, setCollate, 1}},
- {2425, {wxPrintDialogData, setFromPage, 1}},
- {2426, {wxPrintDialogData, setMaxPage, 1}},
- {2427, {wxPrintDialogData, setMinPage, 1}},
- {2428, {wxPrintDialogData, setNoCopies, 1}},
- {2429, {wxPrintDialogData, setPrintData, 1}},
- {2430, {wxPrintDialogData, setPrintToFile, 1}},
- {2431, {wxPrintDialogData, setSelection, 1}},
- {2432, {wxPrintDialogData, setToPage, 1}},
- {2433, {wxPrintData, new_0, 0}},
- {2434, {wxPrintData, new_1, 1}},
- {2435, {wxPrintData, destruct, 0}},
- {2436, {wxPrintData, getCollate, 0}},
- {2437, {wxPrintData, getBin, 0}},
- {2438, {wxPrintData, getColour, 0}},
- {2439, {wxPrintData, getDuplex, 0}},
- {2440, {wxPrintData, getNoCopies, 0}},
- {2441, {wxPrintData, getOrientation, 0}},
- {2442, {wxPrintData, getPaperId, 0}},
- {2443, {wxPrintData, getPrinterName, 0}},
- {2444, {wxPrintData, getQuality, 0}},
- {2445, {wxPrintData, isOk, 0}},
- {2446, {wxPrintData, setBin, 1}},
- {2447, {wxPrintData, setCollate, 1}},
- {2448, {wxPrintData, setColour, 1}},
- {2449, {wxPrintData, setDuplex, 1}},
- {2450, {wxPrintData, setNoCopies, 1}},
- {2451, {wxPrintData, setOrientation, 1}},
- {2452, {wxPrintData, setPaperId, 1}},
- {2453, {wxPrintData, setPrinterName, 1}},
- {2454, {wxPrintData, setQuality, 1}},
- {2457, {wxPrintPreview, new_2, 2}},
- {2458, {wxPrintPreview, new_3, 3}},
- {2460, {wxPrintPreview, destruct, 0}},
- {2461, {wxPrintPreview, getCanvas, 0}},
- {2462, {wxPrintPreview, getCurrentPage, 0}},
- {2463, {wxPrintPreview, getFrame, 0}},
- {2464, {wxPrintPreview, getMaxPage, 0}},
- {2465, {wxPrintPreview, getMinPage, 0}},
- {2466, {wxPrintPreview, getPrintout, 0}},
- {2467, {wxPrintPreview, getPrintoutForPrinting, 0}},
- {2468, {wxPrintPreview, isOk, 0}},
- {2469, {wxPrintPreview, paintPage, 2}},
- {2470, {wxPrintPreview, print, 1}},
- {2471, {wxPrintPreview, renderPage, 1}},
- {2472, {wxPrintPreview, setCanvas, 1}},
- {2473, {wxPrintPreview, setCurrentPage, 1}},
- {2474, {wxPrintPreview, setFrame, 1}},
- {2475, {wxPrintPreview, setPrintout, 1}},
- {2476, {wxPrintPreview, setZoom, 1}},
- {2477, {wxPreviewFrame, new, 3}},
- {2478, {wxPreviewFrame, destruct, 0}},
- {2479, {wxPreviewFrame, createControlBar, 0}},
- {2480, {wxPreviewFrame, createCanvas, 0}},
- {2481, {wxPreviewFrame, initialize, 0}},
- {2482, {wxPreviewFrame, onCloseWindow, 1}},
- {2483, {wxPreviewControlBar, new, 4}},
- {2484, {wxPreviewControlBar, destruct, 0}},
- {2485, {wxPreviewControlBar, createButtons, 0}},
- {2486, {wxPreviewControlBar, getPrintPreview, 0}},
- {2487, {wxPreviewControlBar, getZoomControl, 0}},
- {2488, {wxPreviewControlBar, setZoomControl, 1}},
- {2490, {wxPrinter, new, 1}},
- {2491, {wxPrinter, createAbortWindow, 2}},
- {2492, {wxPrinter, getAbort, 0}},
- {2493, {wxPrinter, getLastError, 0}},
- {2494, {wxPrinter, getPrintDialogData, 0}},
- {2495, {wxPrinter, print, 3}},
- {2496, {wxPrinter, printDialog, 1}},
- {2497, {wxPrinter, reportError, 3}},
- {2498, {wxPrinter, setup, 1}},
- {2499, {wxPrinter, 'Destroy', undefined}},
- {2500, {wxXmlResource, new_1, 1}},
- {2501, {wxXmlResource, new_2, 2}},
- {2502, {wxXmlResource, destruct, 0}},
- {2503, {wxXmlResource, attachUnknownControl, 3}},
- {2504, {wxXmlResource, clearHandlers, 0}},
- {2505, {wxXmlResource, compareVersion, 4}},
- {2506, {wxXmlResource, get, 0}},
- {2507, {wxXmlResource, getFlags, 0}},
- {2508, {wxXmlResource, getVersion, 0}},
- {2509, {wxXmlResource, getXRCID, 2}},
- {2510, {wxXmlResource, initAllHandlers, 0}},
- {2511, {wxXmlResource, load, 1}},
- {2512, {wxXmlResource, loadBitmap, 1}},
- {2513, {wxXmlResource, loadDialog_2, 2}},
- {2514, {wxXmlResource, loadDialog_3, 3}},
- {2515, {wxXmlResource, loadFrame_2, 2}},
- {2516, {wxXmlResource, loadFrame_3, 3}},
- {2517, {wxXmlResource, loadIcon, 1}},
- {2518, {wxXmlResource, loadMenu, 1}},
- {2519, {wxXmlResource, loadMenuBar_2, 2}},
- {2520, {wxXmlResource, loadMenuBar_1, 1}},
- {2521, {wxXmlResource, loadPanel_2, 2}},
- {2522, {wxXmlResource, loadPanel_3, 3}},
- {2523, {wxXmlResource, loadToolBar, 2}},
- {2524, {wxXmlResource, set, 1}},
- {2525, {wxXmlResource, setFlags, 1}},
- {2526, {wxXmlResource, unload, 1}},
- {2527, {wxXmlResource, xrcctrl, 3}},
- {2528, {wxHtmlEasyPrinting, new, 1}},
- {2529, {wxHtmlEasyPrinting, destruct, 0}},
- {2530, {wxHtmlEasyPrinting, getPrintData, 0}},
- {2531, {wxHtmlEasyPrinting, getPageSetupData, 0}},
- {2532, {wxHtmlEasyPrinting, previewFile, 1}},
- {2533, {wxHtmlEasyPrinting, previewText, 2}},
- {2534, {wxHtmlEasyPrinting, printFile, 1}},
- {2535, {wxHtmlEasyPrinting, printText, 2}},
- {2536, {wxHtmlEasyPrinting, pageSetup, 0}},
- {2537, {wxHtmlEasyPrinting, setFonts, 3}},
- {2538, {wxHtmlEasyPrinting, setHeader, 2}},
- {2539, {wxHtmlEasyPrinting, setFooter, 2}},
- {2541, {wxGLCanvas, new_2, 2}},
- {2542, {wxGLCanvas, new_3_1, 3}},
- {2543, {wxGLCanvas, new_3_0, 3}},
- {2544, {wxGLCanvas, getContext, 0}},
- {2546, {wxGLCanvas, setCurrent, 0}},
- {2547, {wxGLCanvas, swapBuffers, 0}},
- {2548, {wxGLCanvas, 'Destroy', undefined}},
- {2549, {wxAuiManager, new, 1}},
- {2550, {wxAuiManager, destruct, 0}},
- {2551, {wxAuiManager, addPane_2_1, 2}},
- {2552, {wxAuiManager, addPane_3, 3}},
- {2553, {wxAuiManager, addPane_2_0, 2}},
- {2554, {wxAuiManager, detachPane, 1}},
- {2555, {wxAuiManager, getAllPanes, 0}},
- {2556, {wxAuiManager, getArtProvider, 0}},
- {2557, {wxAuiManager, getDockSizeConstraint, 2}},
- {2558, {wxAuiManager, getFlags, 0}},
- {2559, {wxAuiManager, getManagedWindow, 0}},
- {2560, {wxAuiManager, getManager, 1}},
- {2561, {wxAuiManager, getPane_1_1, 1}},
- {2562, {wxAuiManager, getPane_1_0, 1}},
- {2563, {wxAuiManager, hideHint, 0}},
- {2564, {wxAuiManager, insertPane, 3}},
- {2565, {wxAuiManager, loadPaneInfo, 2}},
- {2566, {wxAuiManager, loadPerspective, 2}},
- {2567, {wxAuiManager, savePaneInfo, 1}},
- {2568, {wxAuiManager, savePerspective, 0}},
- {2569, {wxAuiManager, setArtProvider, 1}},
- {2570, {wxAuiManager, setDockSizeConstraint, 2}},
- {2571, {wxAuiManager, setFlags, 1}},
- {2572, {wxAuiManager, setManagedWindow, 1}},
- {2573, {wxAuiManager, showHint, 1}},
- {2574, {wxAuiManager, unInit, 0}},
- {2575, {wxAuiManager, update, 0}},
- {2576, {wxAuiPaneInfo, new_0, 0}},
- {2577, {wxAuiPaneInfo, new_1, 1}},
- {2578, {wxAuiPaneInfo, destruct, 0}},
- {2579, {wxAuiPaneInfo, bestSize_1, 1}},
- {2580, {wxAuiPaneInfo, bestSize_2, 2}},
- {2581, {wxAuiPaneInfo, bottom, 0}},
- {2582, {wxAuiPaneInfo, bottomDockable, 1}},
- {2583, {wxAuiPaneInfo, caption, 1}},
- {2584, {wxAuiPaneInfo, captionVisible, 1}},
- {2585, {wxAuiPaneInfo, centre, 0}},
- {2586, {wxAuiPaneInfo, centrePane, 0}},
- {2587, {wxAuiPaneInfo, closeButton, 1}},
- {2588, {wxAuiPaneInfo, defaultPane, 0}},
- {2589, {wxAuiPaneInfo, destroyOnClose, 1}},
- {2590, {wxAuiPaneInfo, direction, 1}},
- {2591, {wxAuiPaneInfo, dock, 0}},
- {2592, {wxAuiPaneInfo, dockable, 1}},
- {2593, {wxAuiPaneInfo, fixed, 0}},
- {2594, {wxAuiPaneInfo, float, 0}},
- {2595, {wxAuiPaneInfo, floatable, 1}},
- {2596, {wxAuiPaneInfo, floatingPosition_1, 1}},
- {2597, {wxAuiPaneInfo, floatingPosition_2, 2}},
- {2598, {wxAuiPaneInfo, floatingSize_1, 1}},
- {2599, {wxAuiPaneInfo, floatingSize_2, 2}},
- {2600, {wxAuiPaneInfo, gripper, 1}},
- {2601, {wxAuiPaneInfo, gripperTop, 1}},
- {2602, {wxAuiPaneInfo, hasBorder, 0}},
- {2603, {wxAuiPaneInfo, hasCaption, 0}},
- {2604, {wxAuiPaneInfo, hasCloseButton, 0}},
- {2605, {wxAuiPaneInfo, hasFlag, 1}},
- {2606, {wxAuiPaneInfo, hasGripper, 0}},
- {2607, {wxAuiPaneInfo, hasGripperTop, 0}},
- {2608, {wxAuiPaneInfo, hasMaximizeButton, 0}},
- {2609, {wxAuiPaneInfo, hasMinimizeButton, 0}},
- {2610, {wxAuiPaneInfo, hasPinButton, 0}},
- {2611, {wxAuiPaneInfo, hide, 0}},
- {2612, {wxAuiPaneInfo, isBottomDockable, 0}},
- {2613, {wxAuiPaneInfo, isDocked, 0}},
- {2614, {wxAuiPaneInfo, isFixed, 0}},
- {2615, {wxAuiPaneInfo, isFloatable, 0}},
- {2616, {wxAuiPaneInfo, isFloating, 0}},
- {2617, {wxAuiPaneInfo, isLeftDockable, 0}},
- {2618, {wxAuiPaneInfo, isMovable, 0}},
- {2619, {wxAuiPaneInfo, isOk, 0}},
- {2620, {wxAuiPaneInfo, isResizable, 0}},
- {2621, {wxAuiPaneInfo, isRightDockable, 0}},
- {2622, {wxAuiPaneInfo, isShown, 0}},
- {2623, {wxAuiPaneInfo, isToolbar, 0}},
- {2624, {wxAuiPaneInfo, isTopDockable, 0}},
- {2625, {wxAuiPaneInfo, layer, 1}},
- {2626, {wxAuiPaneInfo, left, 0}},
- {2627, {wxAuiPaneInfo, leftDockable, 1}},
- {2628, {wxAuiPaneInfo, maxSize_1, 1}},
- {2629, {wxAuiPaneInfo, maxSize_2, 2}},
- {2630, {wxAuiPaneInfo, maximizeButton, 1}},
- {2631, {wxAuiPaneInfo, minSize_1, 1}},
- {2632, {wxAuiPaneInfo, minSize_2, 2}},
- {2633, {wxAuiPaneInfo, minimizeButton, 1}},
- {2634, {wxAuiPaneInfo, movable, 1}},
- {2635, {wxAuiPaneInfo, name, 1}},
- {2636, {wxAuiPaneInfo, paneBorder, 1}},
- {2637, {wxAuiPaneInfo, pinButton, 1}},
- {2638, {wxAuiPaneInfo, position, 1}},
- {2639, {wxAuiPaneInfo, resizable, 1}},
- {2640, {wxAuiPaneInfo, right, 0}},
- {2641, {wxAuiPaneInfo, rightDockable, 1}},
- {2642, {wxAuiPaneInfo, row, 1}},
- {2643, {wxAuiPaneInfo, safeSet, 1}},
- {2644, {wxAuiPaneInfo, setFlag, 2}},
- {2645, {wxAuiPaneInfo, show, 1}},
- {2646, {wxAuiPaneInfo, toolbarPane, 0}},
- {2647, {wxAuiPaneInfo, top, 0}},
- {2648, {wxAuiPaneInfo, topDockable, 1}},
- {2649, {wxAuiPaneInfo, window, 1}},
- {2650, {wxAuiNotebook, new_0, 0}},
- {2651, {wxAuiNotebook, new_2, 2}},
- {2652, {wxAuiNotebook, addPage, 3}},
- {2653, {wxAuiNotebook, create, 2}},
- {2654, {wxAuiNotebook, deletePage, 1}},
- {2655, {wxAuiNotebook, getArtProvider, 0}},
- {2656, {wxAuiNotebook, getPage, 1}},
- {2657, {wxAuiNotebook, getPageBitmap, 1}},
- {2658, {wxAuiNotebook, getPageCount, 0}},
- {2659, {wxAuiNotebook, getPageIndex, 1}},
- {2660, {wxAuiNotebook, getPageText, 1}},
- {2661, {wxAuiNotebook, getSelection, 0}},
- {2662, {wxAuiNotebook, insertPage, 4}},
- {2663, {wxAuiNotebook, removePage, 1}},
- {2664, {wxAuiNotebook, setArtProvider, 1}},
- {2665, {wxAuiNotebook, setFont, 1}},
- {2666, {wxAuiNotebook, setPageBitmap, 2}},
- {2667, {wxAuiNotebook, setPageText, 2}},
- {2668, {wxAuiNotebook, setSelection, 1}},
- {2669, {wxAuiNotebook, setTabCtrlHeight, 1}},
- {2670, {wxAuiNotebook, setUniformBitmapSize, 1}},
- {2671, {wxAuiNotebook, 'Destroy', undefined}},
- {2672, {wxMDIParentFrame, new_0, 0}},
- {2673, {wxMDIParentFrame, new_4, 4}},
- {2674, {wxMDIParentFrame, destruct, 0}},
- {2675, {wxMDIParentFrame, activateNext, 0}},
- {2676, {wxMDIParentFrame, activatePrevious, 0}},
- {2677, {wxMDIParentFrame, arrangeIcons, 0}},
- {2678, {wxMDIParentFrame, cascade, 0}},
- {2679, {wxMDIParentFrame, create, 4}},
- {2680, {wxMDIParentFrame, getActiveChild, 0}},
- {2681, {wxMDIParentFrame, getClientWindow, 0}},
- {2682, {wxMDIParentFrame, tile, 1}},
- {2683, {wxMDIChildFrame, new_0, 0}},
- {2684, {wxMDIChildFrame, new_4, 4}},
- {2685, {wxMDIChildFrame, destruct, 0}},
- {2686, {wxMDIChildFrame, activate, 0}},
- {2687, {wxMDIChildFrame, create, 4}},
- {2688, {wxMDIChildFrame, maximize, 1}},
- {2689, {wxMDIChildFrame, restore, 0}},
- {2690, {wxMDIClientWindow, new_0, 0}},
- {2691, {wxMDIClientWindow, new_2, 2}},
- {2692, {wxMDIClientWindow, destruct, 0}},
- {2693, {wxMDIClientWindow, createClient, 2}},
- {2694, {wxLayoutAlgorithm, new, 0}},
- {2695, {wxLayoutAlgorithm, layoutFrame, 2}},
- {2696, {wxLayoutAlgorithm, layoutMDIFrame, 2}},
- {2697, {wxLayoutAlgorithm, layoutWindow, 2}},
- {2698, {wxLayoutAlgorithm, 'Destroy', undefined}},
- {2699, {wxEvent, getId, 0}},
- {2700, {wxEvent, getSkipped, 0}},
- {2701, {wxEvent, getTimestamp, 0}},
- {2702, {wxEvent, isCommandEvent, 0}},
- {2703, {wxEvent, resumePropagation, 1}},
- {2704, {wxEvent, shouldPropagate, 0}},
- {2705, {wxEvent, skip, 1}},
- {2706, {wxEvent, stopPropagation, 0}},
- {2707, {wxCommandEvent, getClientData, 0}},
- {2708, {wxCommandEvent, getExtraLong, 0}},
- {2709, {wxCommandEvent, getInt, 0}},
- {2710, {wxCommandEvent, getSelection, 0}},
- {2711, {wxCommandEvent, getString, 0}},
- {2712, {wxCommandEvent, isChecked, 0}},
- {2713, {wxCommandEvent, isSelection, 0}},
- {2714, {wxCommandEvent, setInt, 1}},
- {2715, {wxCommandEvent, setString, 1}},
- {2716, {wxScrollEvent, getOrientation, 0}},
- {2717, {wxScrollEvent, getPosition, 0}},
- {2718, {wxScrollWinEvent, getOrientation, 0}},
- {2719, {wxScrollWinEvent, getPosition, 0}},
- {2720, {wxMouseEvent, altDown, 0}},
- {2721, {wxMouseEvent, button, 1}},
- {2722, {wxMouseEvent, buttonDClick, 1}},
- {2723, {wxMouseEvent, buttonDown, 1}},
- {2724, {wxMouseEvent, buttonUp, 1}},
- {2725, {wxMouseEvent, cmdDown, 0}},
- {2726, {wxMouseEvent, controlDown, 0}},
- {2727, {wxMouseEvent, dragging, 0}},
- {2728, {wxMouseEvent, entering, 0}},
- {2729, {wxMouseEvent, getButton, 0}},
- {2732, {wxMouseEvent, getPosition, 0}},
- {2733, {wxMouseEvent, getLogicalPosition, 1}},
- {2734, {wxMouseEvent, getLinesPerAction, 0}},
- {2735, {wxMouseEvent, getWheelRotation, 0}},
- {2736, {wxMouseEvent, getWheelDelta, 0}},
- {2737, {wxMouseEvent, getX, 0}},
- {2738, {wxMouseEvent, getY, 0}},
- {2739, {wxMouseEvent, isButton, 0}},
- {2740, {wxMouseEvent, isPageScroll, 0}},
- {2741, {wxMouseEvent, leaving, 0}},
- {2742, {wxMouseEvent, leftDClick, 0}},
- {2743, {wxMouseEvent, leftDown, 0}},
- {2744, {wxMouseEvent, leftIsDown, 0}},
- {2745, {wxMouseEvent, leftUp, 0}},
- {2746, {wxMouseEvent, metaDown, 0}},
- {2747, {wxMouseEvent, middleDClick, 0}},
- {2748, {wxMouseEvent, middleDown, 0}},
- {2749, {wxMouseEvent, middleIsDown, 0}},
- {2750, {wxMouseEvent, middleUp, 0}},
- {2751, {wxMouseEvent, moving, 0}},
- {2752, {wxMouseEvent, rightDClick, 0}},
- {2753, {wxMouseEvent, rightDown, 0}},
- {2754, {wxMouseEvent, rightIsDown, 0}},
- {2755, {wxMouseEvent, rightUp, 0}},
- {2756, {wxMouseEvent, shiftDown, 0}},
- {2757, {wxSetCursorEvent, getCursor, 0}},
- {2758, {wxSetCursorEvent, getX, 0}},
- {2759, {wxSetCursorEvent, getY, 0}},
- {2760, {wxSetCursorEvent, hasCursor, 0}},
- {2761, {wxSetCursorEvent, setCursor, 1}},
- {2762, {wxKeyEvent, altDown, 0}},
- {2763, {wxKeyEvent, cmdDown, 0}},
- {2764, {wxKeyEvent, controlDown, 0}},
- {2765, {wxKeyEvent, getKeyCode, 0}},
- {2766, {wxKeyEvent, getModifiers, 0}},
- {2769, {wxKeyEvent, getPosition, 0}},
- {2770, {wxKeyEvent, getRawKeyCode, 0}},
- {2771, {wxKeyEvent, getRawKeyFlags, 0}},
- {2772, {wxKeyEvent, getUnicodeKey, 0}},
- {2773, {wxKeyEvent, getX, 0}},
- {2774, {wxKeyEvent, getY, 0}},
- {2775, {wxKeyEvent, hasModifiers, 0}},
- {2776, {wxKeyEvent, metaDown, 0}},
- {2777, {wxKeyEvent, shiftDown, 0}},
- {2778, {wxSizeEvent, getSize, 0}},
- {2779, {wxMoveEvent, getPosition, 0}},
- {2780, {wxEraseEvent, getDC, 0}},
- {2781, {wxFocusEvent, getWindow, 0}},
- {2782, {wxChildFocusEvent, getWindow, 0}},
- {2783, {wxMenuEvent, getMenu, 0}},
- {2784, {wxMenuEvent, getMenuId, 0}},
- {2785, {wxMenuEvent, isPopup, 0}},
- {2786, {wxCloseEvent, canVeto, 0}},
- {2787, {wxCloseEvent, getLoggingOff, 0}},
- {2788, {wxCloseEvent, setCanVeto, 1}},
- {2789, {wxCloseEvent, setLoggingOff, 1}},
- {2790, {wxCloseEvent, veto, 1}},
- {2791, {wxShowEvent, setShow, 1}},
- {2792, {wxShowEvent, getShow, 0}},
- {2793, {wxIconizeEvent, iconized, 0}},
- {2794, {wxJoystickEvent, buttonDown, 1}},
- {2795, {wxJoystickEvent, buttonIsDown, 1}},
- {2796, {wxJoystickEvent, buttonUp, 1}},
- {2797, {wxJoystickEvent, getButtonChange, 0}},
- {2798, {wxJoystickEvent, getButtonState, 0}},
- {2799, {wxJoystickEvent, getJoystick, 0}},
- {2800, {wxJoystickEvent, getPosition, 0}},
- {2801, {wxJoystickEvent, getZPosition, 0}},
- {2802, {wxJoystickEvent, isButton, 0}},
- {2803, {wxJoystickEvent, isMove, 0}},
- {2804, {wxJoystickEvent, isZMove, 0}},
- {2805, {wxUpdateUIEvent, canUpdate, 1}},
- {2806, {wxUpdateUIEvent, check, 1}},
- {2807, {wxUpdateUIEvent, enable, 1}},
- {2808, {wxUpdateUIEvent, show, 1}},
- {2809, {wxUpdateUIEvent, getChecked, 0}},
- {2810, {wxUpdateUIEvent, getEnabled, 0}},
- {2811, {wxUpdateUIEvent, getShown, 0}},
- {2812, {wxUpdateUIEvent, getSetChecked, 0}},
- {2813, {wxUpdateUIEvent, getSetEnabled, 0}},
- {2814, {wxUpdateUIEvent, getSetShown, 0}},
- {2815, {wxUpdateUIEvent, getSetText, 0}},
- {2816, {wxUpdateUIEvent, getText, 0}},
- {2817, {wxUpdateUIEvent, getMode, 0}},
- {2818, {wxUpdateUIEvent, getUpdateInterval, 0}},
- {2819, {wxUpdateUIEvent, resetUpdateTime, 0}},
- {2820, {wxUpdateUIEvent, setMode, 1}},
- {2821, {wxUpdateUIEvent, setText, 1}},
- {2822, {wxUpdateUIEvent, setUpdateInterval, 1}},
- {2823, {wxMouseCaptureChangedEvent, getCapturedWindow, 0}},
- {2824, {wxPaletteChangedEvent, setChangedWindow, 1}},
- {2825, {wxPaletteChangedEvent, getChangedWindow, 0}},
- {2826, {wxQueryNewPaletteEvent, setPaletteRealized, 1}},
- {2827, {wxQueryNewPaletteEvent, getPaletteRealized, 0}},
- {2828, {wxNavigationKeyEvent, getDirection, 0}},
- {2829, {wxNavigationKeyEvent, setDirection, 1}},
- {2830, {wxNavigationKeyEvent, isWindowChange, 0}},
- {2831, {wxNavigationKeyEvent, setWindowChange, 1}},
- {2832, {wxNavigationKeyEvent, isFromTab, 0}},
- {2833, {wxNavigationKeyEvent, setFromTab, 1}},
- {2834, {wxNavigationKeyEvent, getCurrentFocus, 0}},
- {2835, {wxNavigationKeyEvent, setCurrentFocus, 1}},
- {2836, {wxHelpEvent, getOrigin, 0}},
- {2837, {wxHelpEvent, getPosition, 0}},
- {2838, {wxHelpEvent, setOrigin, 1}},
- {2839, {wxHelpEvent, setPosition, 1}},
- {2840, {wxContextMenuEvent, getPosition, 0}},
- {2841, {wxContextMenuEvent, setPosition, 1}},
- {2842, {wxIdleEvent, canSend, 1}},
- {2843, {wxIdleEvent, getMode, 0}},
- {2844, {wxIdleEvent, requestMore, 1}},
- {2845, {wxIdleEvent, moreRequested, 0}},
- {2846, {wxIdleEvent, setMode, 1}},
- {2847, {wxGridEvent, altDown, 0}},
- {2848, {wxGridEvent, controlDown, 0}},
- {2849, {wxGridEvent, getCol, 0}},
- {2850, {wxGridEvent, getPosition, 0}},
- {2851, {wxGridEvent, getRow, 0}},
- {2852, {wxGridEvent, metaDown, 0}},
- {2853, {wxGridEvent, selecting, 0}},
- {2854, {wxGridEvent, shiftDown, 0}},
- {2855, {wxNotifyEvent, allow, 0}},
- {2856, {wxNotifyEvent, isAllowed, 0}},
- {2857, {wxNotifyEvent, veto, 0}},
- {2858, {wxSashEvent, getEdge, 0}},
- {2859, {wxSashEvent, getDragRect, 0}},
- {2860, {wxSashEvent, getDragStatus, 0}},
- {2861, {wxListEvent, getCacheFrom, 0}},
- {2862, {wxListEvent, getCacheTo, 0}},
- {2863, {wxListEvent, getKeyCode, 0}},
- {2864, {wxListEvent, getIndex, 0}},
- {2865, {wxListEvent, getColumn, 0}},
- {2866, {wxListEvent, getPoint, 0}},
- {2867, {wxListEvent, getLabel, 0}},
- {2868, {wxListEvent, getText, 0}},
- {2869, {wxListEvent, getImage, 0}},
- {2870, {wxListEvent, getData, 0}},
- {2871, {wxListEvent, getMask, 0}},
- {2872, {wxListEvent, getItem, 0}},
- {2873, {wxListEvent, isEditCancelled, 0}},
- {2874, {wxDateEvent, getDate, 0}},
- {2875, {wxCalendarEvent, getWeekDay, 0}},
- {2876, {wxFileDirPickerEvent, getPath, 0}},
- {2877, {wxColourPickerEvent, getColour, 0}},
- {2878, {wxFontPickerEvent, getFont, 0}},
- {2879, {wxStyledTextEvent, getPosition, 0}},
- {2880, {wxStyledTextEvent, getKey, 0}},
- {2881, {wxStyledTextEvent, getModifiers, 0}},
- {2882, {wxStyledTextEvent, getModificationType, 0}},
- {2883, {wxStyledTextEvent, getText, 0}},
- {2884, {wxStyledTextEvent, getLength, 0}},
- {2885, {wxStyledTextEvent, getLinesAdded, 0}},
- {2886, {wxStyledTextEvent, getLine, 0}},
- {2887, {wxStyledTextEvent, getFoldLevelNow, 0}},
- {2888, {wxStyledTextEvent, getFoldLevelPrev, 0}},
- {2889, {wxStyledTextEvent, getMargin, 0}},
- {2890, {wxStyledTextEvent, getMessage, 0}},
- {2891, {wxStyledTextEvent, getWParam, 0}},
- {2892, {wxStyledTextEvent, getLParam, 0}},
- {2893, {wxStyledTextEvent, getListType, 0}},
- {2894, {wxStyledTextEvent, getX, 0}},
- {2895, {wxStyledTextEvent, getY, 0}},
- {2896, {wxStyledTextEvent, getDragText, 0}},
- {2897, {wxStyledTextEvent, getDragAllowMove, 0}},
- {2898, {wxStyledTextEvent, getDragResult, 0}},
- {2899, {wxStyledTextEvent, getShift, 0}},
- {2900, {wxStyledTextEvent, getControl, 0}},
- {2901, {wxStyledTextEvent, getAlt, 0}},
- {2902, {utils, getKeyState, 1}},
- {2903, {utils, getMousePosition, 2}},
- {2904, {utils, getMouseState, 0}},
- {2905, {utils, setDetectableAutoRepeat, 1}},
- {2906, {utils, bell, 0}},
- {2907, {utils, findMenuItemId, 3}},
- {2908, {utils, genericFindWindowAtPoint, 1}},
- {2909, {utils, findWindowAtPoint, 1}},
- {2910, {utils, beginBusyCursor, 1}},
- {2911, {utils, endBusyCursor, 0}},
- {2912, {utils, isBusy, 0}},
- {2913, {utils, shutdown, 1}},
- {2914, {utils, shell, 1}},
- {2915, {utils, launchDefaultBrowser, 2}},
- {2916, {utils, getEmailAddress, 0}},
- {2917, {utils, getUserId, 0}},
- {2918, {utils, getHomeDir, 0}},
- {2919, {utils, newId, 0}},
- {2920, {utils, registerId, 1}},
- {2921, {utils, getCurrentId, 0}},
- {2922, {utils, getOsDescription, 0}},
- {2923, {utils, isPlatformLittleEndian, 0}},
- {2924, {utils, isPlatform64Bit, 0}},
- {2925, {wxPrintout, new, 1}},
- {2926, {wxPrintout, destruct, 0}},
- {2927, {wxPrintout, getDC, 0}},
- {2928, {wxPrintout, getPageSizeMM, 2}},
- {2929, {wxPrintout, getPageSizePixels, 2}},
- {2930, {wxPrintout, getPaperRectPixels, 0}},
- {2931, {wxPrintout, getPPIPrinter, 2}},
- {2932, {wxPrintout, getPPIScreen, 2}},
- {2933, {wxPrintout, getTitle, 0}},
- {2934, {wxPrintout, isPreview, 0}},
- {2935, {wxPrintout, fitThisSizeToPaper, 1}},
- {2936, {wxPrintout, fitThisSizeToPage, 1}},
- {2937, {wxPrintout, fitThisSizeToPageMargins, 2}},
- {2938, {wxPrintout, mapScreenSizeToPaper, 0}},
- {2939, {wxPrintout, mapScreenSizeToPage, 0}},
- {2940, {wxPrintout, mapScreenSizeToPageMargins, 1}},
- {2941, {wxPrintout, mapScreenSizeToDevice, 0}},
- {2942, {wxPrintout, getLogicalPaperRect, 0}},
- {2943, {wxPrintout, getLogicalPageRect, 0}},
- {2944, {wxPrintout, getLogicalPageMarginsRect, 1}},
- {2945, {wxPrintout, setLogicalOrigin, 2}},
- {2946, {wxPrintout, offsetLogicalOrigin, 2}},
- {2947, {wxStyledTextCtrl, new_2, 2}},
- {2948, {wxStyledTextCtrl, new_0, 0}},
- {2949, {wxStyledTextCtrl, destruct, 0}},
- {2950, {wxStyledTextCtrl, create, 2}},
- {2951, {wxStyledTextCtrl, addText, 1}},
- {2952, {wxStyledTextCtrl, addStyledText, 1}},
- {2953, {wxStyledTextCtrl, insertText, 2}},
- {2954, {wxStyledTextCtrl, clearAll, 0}},
- {2955, {wxStyledTextCtrl, clearDocumentStyle, 0}},
- {2956, {wxStyledTextCtrl, getLength, 0}},
- {2957, {wxStyledTextCtrl, getCharAt, 1}},
- {2958, {wxStyledTextCtrl, getCurrentPos, 0}},
- {2959, {wxStyledTextCtrl, getAnchor, 0}},
- {2960, {wxStyledTextCtrl, getStyleAt, 1}},
- {2961, {wxStyledTextCtrl, redo, 0}},
- {2962, {wxStyledTextCtrl, setUndoCollection, 1}},
- {2963, {wxStyledTextCtrl, selectAll, 0}},
- {2964, {wxStyledTextCtrl, setSavePoint, 0}},
- {2965, {wxStyledTextCtrl, getStyledText, 2}},
- {2966, {wxStyledTextCtrl, canRedo, 0}},
- {2967, {wxStyledTextCtrl, markerLineFromHandle, 1}},
- {2968, {wxStyledTextCtrl, markerDeleteHandle, 1}},
- {2969, {wxStyledTextCtrl, getUndoCollection, 0}},
- {2970, {wxStyledTextCtrl, getViewWhiteSpace, 0}},
- {2971, {wxStyledTextCtrl, setViewWhiteSpace, 1}},
- {2972, {wxStyledTextCtrl, positionFromPoint, 1}},
- {2973, {wxStyledTextCtrl, positionFromPointClose, 2}},
- {2974, {wxStyledTextCtrl, gotoLine, 1}},
- {2975, {wxStyledTextCtrl, gotoPos, 1}},
- {2976, {wxStyledTextCtrl, setAnchor, 1}},
- {2977, {wxStyledTextCtrl, getCurLine, 1}},
- {2978, {wxStyledTextCtrl, getEndStyled, 0}},
- {2979, {wxStyledTextCtrl, convertEOLs, 1}},
- {2980, {wxStyledTextCtrl, getEOLMode, 0}},
- {2981, {wxStyledTextCtrl, setEOLMode, 1}},
- {2982, {wxStyledTextCtrl, startStyling, 2}},
- {2983, {wxStyledTextCtrl, setStyling, 2}},
- {2984, {wxStyledTextCtrl, getBufferedDraw, 0}},
- {2985, {wxStyledTextCtrl, setBufferedDraw, 1}},
- {2986, {wxStyledTextCtrl, setTabWidth, 1}},
- {2987, {wxStyledTextCtrl, getTabWidth, 0}},
- {2988, {wxStyledTextCtrl, setCodePage, 1}},
- {2989, {wxStyledTextCtrl, markerDefine, 3}},
- {2990, {wxStyledTextCtrl, markerSetForeground, 2}},
- {2991, {wxStyledTextCtrl, markerSetBackground, 2}},
- {2992, {wxStyledTextCtrl, markerAdd, 2}},
- {2993, {wxStyledTextCtrl, markerDelete, 2}},
- {2994, {wxStyledTextCtrl, markerDeleteAll, 1}},
- {2995, {wxStyledTextCtrl, markerGet, 1}},
- {2996, {wxStyledTextCtrl, markerNext, 2}},
- {2997, {wxStyledTextCtrl, markerPrevious, 2}},
- {2998, {wxStyledTextCtrl, markerDefineBitmap, 2}},
- {2999, {wxStyledTextCtrl, markerAddSet, 2}},
- {3000, {wxStyledTextCtrl, markerSetAlpha, 2}},
- {3001, {wxStyledTextCtrl, setMarginType, 2}},
- {3002, {wxStyledTextCtrl, getMarginType, 1}},
- {3003, {wxStyledTextCtrl, setMarginWidth, 2}},
- {3004, {wxStyledTextCtrl, getMarginWidth, 1}},
- {3005, {wxStyledTextCtrl, setMarginMask, 2}},
- {3006, {wxStyledTextCtrl, getMarginMask, 1}},
- {3007, {wxStyledTextCtrl, setMarginSensitive, 2}},
- {3008, {wxStyledTextCtrl, getMarginSensitive, 1}},
- {3009, {wxStyledTextCtrl, styleClearAll, 0}},
- {3010, {wxStyledTextCtrl, styleSetForeground, 2}},
- {3011, {wxStyledTextCtrl, styleSetBackground, 2}},
- {3012, {wxStyledTextCtrl, styleSetBold, 2}},
- {3013, {wxStyledTextCtrl, styleSetItalic, 2}},
- {3014, {wxStyledTextCtrl, styleSetSize, 2}},
- {3015, {wxStyledTextCtrl, styleSetFaceName, 2}},
- {3016, {wxStyledTextCtrl, styleSetEOLFilled, 2}},
- {3017, {wxStyledTextCtrl, styleResetDefault, 0}},
- {3018, {wxStyledTextCtrl, styleSetUnderline, 2}},
- {3019, {wxStyledTextCtrl, styleSetCase, 2}},
- {3020, {wxStyledTextCtrl, styleSetHotSpot, 2}},
- {3021, {wxStyledTextCtrl, setSelForeground, 2}},
- {3022, {wxStyledTextCtrl, setSelBackground, 2}},
- {3023, {wxStyledTextCtrl, getSelAlpha, 0}},
- {3024, {wxStyledTextCtrl, setSelAlpha, 1}},
- {3025, {wxStyledTextCtrl, setCaretForeground, 1}},
- {3026, {wxStyledTextCtrl, cmdKeyAssign, 3}},
- {3027, {wxStyledTextCtrl, cmdKeyClear, 2}},
- {3028, {wxStyledTextCtrl, cmdKeyClearAll, 0}},
- {3029, {wxStyledTextCtrl, setStyleBytes, 2}},
- {3030, {wxStyledTextCtrl, styleSetVisible, 2}},
- {3031, {wxStyledTextCtrl, getCaretPeriod, 0}},
- {3032, {wxStyledTextCtrl, setCaretPeriod, 1}},
- {3033, {wxStyledTextCtrl, setWordChars, 1}},
- {3034, {wxStyledTextCtrl, beginUndoAction, 0}},
- {3035, {wxStyledTextCtrl, endUndoAction, 0}},
- {3036, {wxStyledTextCtrl, indicatorSetStyle, 2}},
- {3037, {wxStyledTextCtrl, indicatorGetStyle, 1}},
- {3038, {wxStyledTextCtrl, indicatorSetForeground, 2}},
- {3039, {wxStyledTextCtrl, indicatorGetForeground, 1}},
- {3040, {wxStyledTextCtrl, setWhitespaceForeground, 2}},
- {3041, {wxStyledTextCtrl, setWhitespaceBackground, 2}},
- {3042, {wxStyledTextCtrl, getStyleBits, 0}},
- {3043, {wxStyledTextCtrl, setLineState, 2}},
- {3044, {wxStyledTextCtrl, getLineState, 1}},
- {3045, {wxStyledTextCtrl, getMaxLineState, 0}},
- {3046, {wxStyledTextCtrl, getCaretLineVisible, 0}},
- {3047, {wxStyledTextCtrl, setCaretLineVisible, 1}},
- {3048, {wxStyledTextCtrl, getCaretLineBackground, 0}},
- {3049, {wxStyledTextCtrl, setCaretLineBackground, 1}},
- {3050, {wxStyledTextCtrl, autoCompShow, 2}},
- {3051, {wxStyledTextCtrl, autoCompCancel, 0}},
- {3052, {wxStyledTextCtrl, autoCompActive, 0}},
- {3053, {wxStyledTextCtrl, autoCompPosStart, 0}},
- {3054, {wxStyledTextCtrl, autoCompComplete, 0}},
- {3055, {wxStyledTextCtrl, autoCompStops, 1}},
- {3056, {wxStyledTextCtrl, autoCompSetSeparator, 1}},
- {3057, {wxStyledTextCtrl, autoCompGetSeparator, 0}},
- {3058, {wxStyledTextCtrl, autoCompSelect, 1}},
- {3059, {wxStyledTextCtrl, autoCompSetCancelAtStart, 1}},
- {3060, {wxStyledTextCtrl, autoCompGetCancelAtStart, 0}},
- {3061, {wxStyledTextCtrl, autoCompSetFillUps, 1}},
- {3062, {wxStyledTextCtrl, autoCompSetChooseSingle, 1}},
- {3063, {wxStyledTextCtrl, autoCompGetChooseSingle, 0}},
- {3064, {wxStyledTextCtrl, autoCompSetIgnoreCase, 1}},
- {3065, {wxStyledTextCtrl, autoCompGetIgnoreCase, 0}},
- {3066, {wxStyledTextCtrl, userListShow, 2}},
- {3067, {wxStyledTextCtrl, autoCompSetAutoHide, 1}},
- {3068, {wxStyledTextCtrl, autoCompGetAutoHide, 0}},
- {3069, {wxStyledTextCtrl, autoCompSetDropRestOfWord, 1}},
- {3070, {wxStyledTextCtrl, autoCompGetDropRestOfWord, 0}},
- {3071, {wxStyledTextCtrl, registerImage, 2}},
- {3072, {wxStyledTextCtrl, clearRegisteredImages, 0}},
- {3073, {wxStyledTextCtrl, autoCompGetTypeSeparator, 0}},
- {3074, {wxStyledTextCtrl, autoCompSetTypeSeparator, 1}},
- {3075, {wxStyledTextCtrl, autoCompSetMaxWidth, 1}},
- {3076, {wxStyledTextCtrl, autoCompGetMaxWidth, 0}},
- {3077, {wxStyledTextCtrl, autoCompSetMaxHeight, 1}},
- {3078, {wxStyledTextCtrl, autoCompGetMaxHeight, 0}},
- {3079, {wxStyledTextCtrl, setIndent, 1}},
- {3080, {wxStyledTextCtrl, getIndent, 0}},
- {3081, {wxStyledTextCtrl, setUseTabs, 1}},
- {3082, {wxStyledTextCtrl, getUseTabs, 0}},
- {3083, {wxStyledTextCtrl, setLineIndentation, 2}},
- {3084, {wxStyledTextCtrl, getLineIndentation, 1}},
- {3085, {wxStyledTextCtrl, getLineIndentPosition, 1}},
- {3086, {wxStyledTextCtrl, getColumn, 1}},
- {3087, {wxStyledTextCtrl, setUseHorizontalScrollBar, 1}},
- {3088, {wxStyledTextCtrl, getUseHorizontalScrollBar, 0}},
- {3089, {wxStyledTextCtrl, setIndentationGuides, 1}},
- {3090, {wxStyledTextCtrl, getIndentationGuides, 0}},
- {3091, {wxStyledTextCtrl, setHighlightGuide, 1}},
- {3092, {wxStyledTextCtrl, getHighlightGuide, 0}},
- {3093, {wxStyledTextCtrl, getLineEndPosition, 1}},
- {3094, {wxStyledTextCtrl, getCodePage, 0}},
- {3095, {wxStyledTextCtrl, getCaretForeground, 0}},
- {3096, {wxStyledTextCtrl, getReadOnly, 0}},
- {3097, {wxStyledTextCtrl, setCurrentPos, 1}},
- {3098, {wxStyledTextCtrl, setSelectionStart, 1}},
- {3099, {wxStyledTextCtrl, getSelectionStart, 0}},
- {3100, {wxStyledTextCtrl, setSelectionEnd, 1}},
- {3101, {wxStyledTextCtrl, getSelectionEnd, 0}},
- {3102, {wxStyledTextCtrl, setPrintMagnification, 1}},
- {3103, {wxStyledTextCtrl, getPrintMagnification, 0}},
- {3104, {wxStyledTextCtrl, setPrintColourMode, 1}},
- {3105, {wxStyledTextCtrl, getPrintColourMode, 0}},
- {3106, {wxStyledTextCtrl, findText, 4}},
- {3107, {wxStyledTextCtrl, formatRange, 7}},
- {3108, {wxStyledTextCtrl, getFirstVisibleLine, 0}},
- {3109, {wxStyledTextCtrl, getLine, 1}},
- {3110, {wxStyledTextCtrl, getLineCount, 0}},
- {3111, {wxStyledTextCtrl, setMarginLeft, 1}},
- {3112, {wxStyledTextCtrl, getMarginLeft, 0}},
- {3113, {wxStyledTextCtrl, setMarginRight, 1}},
- {3114, {wxStyledTextCtrl, getMarginRight, 0}},
- {3115, {wxStyledTextCtrl, getModify, 0}},
- {3116, {wxStyledTextCtrl, setSelection, 2}},
- {3117, {wxStyledTextCtrl, getSelectedText, 0}},
- {3118, {wxStyledTextCtrl, getTextRange, 2}},
- {3119, {wxStyledTextCtrl, hideSelection, 1}},
- {3120, {wxStyledTextCtrl, lineFromPosition, 1}},
- {3121, {wxStyledTextCtrl, positionFromLine, 1}},
- {3122, {wxStyledTextCtrl, lineScroll, 2}},
- {3123, {wxStyledTextCtrl, ensureCaretVisible, 0}},
- {3124, {wxStyledTextCtrl, replaceSelection, 1}},
- {3125, {wxStyledTextCtrl, setReadOnly, 1}},
- {3126, {wxStyledTextCtrl, canPaste, 0}},
- {3127, {wxStyledTextCtrl, canUndo, 0}},
- {3128, {wxStyledTextCtrl, emptyUndoBuffer, 0}},
- {3129, {wxStyledTextCtrl, undo, 0}},
- {3130, {wxStyledTextCtrl, cut, 0}},
- {3131, {wxStyledTextCtrl, copy, 0}},
- {3132, {wxStyledTextCtrl, paste, 0}},
- {3133, {wxStyledTextCtrl, clear, 0}},
- {3134, {wxStyledTextCtrl, setText, 1}},
- {3135, {wxStyledTextCtrl, getText, 0}},
- {3136, {wxStyledTextCtrl, getTextLength, 0}},
- {3137, {wxStyledTextCtrl, getOvertype, 0}},
- {3138, {wxStyledTextCtrl, setCaretWidth, 1}},
- {3139, {wxStyledTextCtrl, getCaretWidth, 0}},
- {3140, {wxStyledTextCtrl, setTargetStart, 1}},
- {3141, {wxStyledTextCtrl, getTargetStart, 0}},
- {3142, {wxStyledTextCtrl, setTargetEnd, 1}},
- {3143, {wxStyledTextCtrl, getTargetEnd, 0}},
- {3144, {wxStyledTextCtrl, replaceTarget, 1}},
- {3145, {wxStyledTextCtrl, searchInTarget, 1}},
- {3146, {wxStyledTextCtrl, setSearchFlags, 1}},
- {3147, {wxStyledTextCtrl, getSearchFlags, 0}},
- {3148, {wxStyledTextCtrl, callTipShow, 2}},
- {3149, {wxStyledTextCtrl, callTipCancel, 0}},
- {3150, {wxStyledTextCtrl, callTipActive, 0}},
- {3151, {wxStyledTextCtrl, callTipPosAtStart, 0}},
- {3152, {wxStyledTextCtrl, callTipSetHighlight, 2}},
- {3153, {wxStyledTextCtrl, callTipSetBackground, 1}},
- {3154, {wxStyledTextCtrl, callTipSetForeground, 1}},
- {3155, {wxStyledTextCtrl, callTipSetForegroundHighlight, 1}},
- {3156, {wxStyledTextCtrl, callTipUseStyle, 1}},
- {3157, {wxStyledTextCtrl, visibleFromDocLine, 1}},
- {3158, {wxStyledTextCtrl, docLineFromVisible, 1}},
- {3159, {wxStyledTextCtrl, wrapCount, 1}},
- {3160, {wxStyledTextCtrl, setFoldLevel, 2}},
- {3161, {wxStyledTextCtrl, getFoldLevel, 1}},
- {3162, {wxStyledTextCtrl, getLastChild, 2}},
- {3163, {wxStyledTextCtrl, getFoldParent, 1}},
- {3164, {wxStyledTextCtrl, showLines, 2}},
- {3165, {wxStyledTextCtrl, hideLines, 2}},
- {3166, {wxStyledTextCtrl, getLineVisible, 1}},
- {3167, {wxStyledTextCtrl, setFoldExpanded, 2}},
- {3168, {wxStyledTextCtrl, getFoldExpanded, 1}},
- {3169, {wxStyledTextCtrl, toggleFold, 1}},
- {3170, {wxStyledTextCtrl, ensureVisible, 1}},
- {3171, {wxStyledTextCtrl, setFoldFlags, 1}},
- {3172, {wxStyledTextCtrl, ensureVisibleEnforcePolicy, 1}},
- {3173, {wxStyledTextCtrl, setTabIndents, 1}},
- {3174, {wxStyledTextCtrl, getTabIndents, 0}},
- {3175, {wxStyledTextCtrl, setBackSpaceUnIndents, 1}},
- {3176, {wxStyledTextCtrl, getBackSpaceUnIndents, 0}},
- {3177, {wxStyledTextCtrl, setMouseDwellTime, 1}},
- {3178, {wxStyledTextCtrl, getMouseDwellTime, 0}},
- {3179, {wxStyledTextCtrl, wordStartPosition, 2}},
- {3180, {wxStyledTextCtrl, wordEndPosition, 2}},
- {3181, {wxStyledTextCtrl, setWrapMode, 1}},
- {3182, {wxStyledTextCtrl, getWrapMode, 0}},
- {3183, {wxStyledTextCtrl, setWrapVisualFlags, 1}},
- {3184, {wxStyledTextCtrl, getWrapVisualFlags, 0}},
- {3185, {wxStyledTextCtrl, setWrapVisualFlagsLocation, 1}},
- {3186, {wxStyledTextCtrl, getWrapVisualFlagsLocation, 0}},
- {3187, {wxStyledTextCtrl, setWrapStartIndent, 1}},
- {3188, {wxStyledTextCtrl, getWrapStartIndent, 0}},
- {3189, {wxStyledTextCtrl, setLayoutCache, 1}},
- {3190, {wxStyledTextCtrl, getLayoutCache, 0}},
- {3191, {wxStyledTextCtrl, setScrollWidth, 1}},
- {3192, {wxStyledTextCtrl, getScrollWidth, 0}},
- {3193, {wxStyledTextCtrl, textWidth, 2}},
- {3194, {wxStyledTextCtrl, getEndAtLastLine, 0}},
- {3195, {wxStyledTextCtrl, textHeight, 1}},
- {3196, {wxStyledTextCtrl, setUseVerticalScrollBar, 1}},
- {3197, {wxStyledTextCtrl, getUseVerticalScrollBar, 0}},
- {3198, {wxStyledTextCtrl, appendText, 1}},
- {3199, {wxStyledTextCtrl, getTwoPhaseDraw, 0}},
- {3200, {wxStyledTextCtrl, setTwoPhaseDraw, 1}},
- {3201, {wxStyledTextCtrl, targetFromSelection, 0}},
- {3202, {wxStyledTextCtrl, linesJoin, 0}},
- {3203, {wxStyledTextCtrl, linesSplit, 1}},
- {3204, {wxStyledTextCtrl, setFoldMarginColour, 2}},
- {3205, {wxStyledTextCtrl, setFoldMarginHiColour, 2}},
- {3206, {wxStyledTextCtrl, lineDown, 0}},
- {3207, {wxStyledTextCtrl, lineDownExtend, 0}},
- {3208, {wxStyledTextCtrl, lineUp, 0}},
- {3209, {wxStyledTextCtrl, lineUpExtend, 0}},
- {3210, {wxStyledTextCtrl, charLeft, 0}},
- {3211, {wxStyledTextCtrl, charLeftExtend, 0}},
- {3212, {wxStyledTextCtrl, charRight, 0}},
- {3213, {wxStyledTextCtrl, charRightExtend, 0}},
- {3214, {wxStyledTextCtrl, wordLeft, 0}},
- {3215, {wxStyledTextCtrl, wordLeftExtend, 0}},
- {3216, {wxStyledTextCtrl, wordRight, 0}},
- {3217, {wxStyledTextCtrl, wordRightExtend, 0}},
- {3218, {wxStyledTextCtrl, home, 0}},
- {3219, {wxStyledTextCtrl, homeExtend, 0}},
- {3220, {wxStyledTextCtrl, lineEnd, 0}},
- {3221, {wxStyledTextCtrl, lineEndExtend, 0}},
- {3222, {wxStyledTextCtrl, documentStart, 0}},
- {3223, {wxStyledTextCtrl, documentStartExtend, 0}},
- {3224, {wxStyledTextCtrl, documentEnd, 0}},
- {3225, {wxStyledTextCtrl, documentEndExtend, 0}},
- {3226, {wxStyledTextCtrl, pageUp, 0}},
- {3227, {wxStyledTextCtrl, pageUpExtend, 0}},
- {3228, {wxStyledTextCtrl, pageDown, 0}},
- {3229, {wxStyledTextCtrl, pageDownExtend, 0}},
- {3230, {wxStyledTextCtrl, editToggleOvertype, 0}},
- {3231, {wxStyledTextCtrl, cancel, 0}},
- {3232, {wxStyledTextCtrl, deleteBack, 0}},
- {3233, {wxStyledTextCtrl, tab, 0}},
- {3234, {wxStyledTextCtrl, backTab, 0}},
- {3235, {wxStyledTextCtrl, newLine, 0}},
- {3236, {wxStyledTextCtrl, formFeed, 0}},
- {3237, {wxStyledTextCtrl, vCHome, 0}},
- {3238, {wxStyledTextCtrl, vCHomeExtend, 0}},
- {3239, {wxStyledTextCtrl, zoomIn, 0}},
- {3240, {wxStyledTextCtrl, zoomOut, 0}},
- {3241, {wxStyledTextCtrl, delWordLeft, 0}},
- {3242, {wxStyledTextCtrl, delWordRight, 0}},
- {3243, {wxStyledTextCtrl, lineCut, 0}},
- {3244, {wxStyledTextCtrl, lineDelete, 0}},
- {3245, {wxStyledTextCtrl, lineTranspose, 0}},
- {3246, {wxStyledTextCtrl, lineDuplicate, 0}},
- {3247, {wxStyledTextCtrl, lowerCase, 0}},
- {3248, {wxStyledTextCtrl, upperCase, 0}},
- {3249, {wxStyledTextCtrl, lineScrollDown, 0}},
- {3250, {wxStyledTextCtrl, lineScrollUp, 0}},
- {3251, {wxStyledTextCtrl, deleteBackNotLine, 0}},
- {3252, {wxStyledTextCtrl, homeDisplay, 0}},
- {3253, {wxStyledTextCtrl, homeDisplayExtend, 0}},
- {3254, {wxStyledTextCtrl, lineEndDisplay, 0}},
- {3255, {wxStyledTextCtrl, lineEndDisplayExtend, 0}},
- {3256, {wxStyledTextCtrl, homeWrapExtend, 0}},
- {3257, {wxStyledTextCtrl, lineEndWrap, 0}},
- {3258, {wxStyledTextCtrl, lineEndWrapExtend, 0}},
- {3259, {wxStyledTextCtrl, vCHomeWrap, 0}},
- {3260, {wxStyledTextCtrl, vCHomeWrapExtend, 0}},
- {3261, {wxStyledTextCtrl, lineCopy, 0}},
- {3262, {wxStyledTextCtrl, moveCaretInsideView, 0}},
- {3263, {wxStyledTextCtrl, lineLength, 1}},
- {3264, {wxStyledTextCtrl, braceHighlight, 2}},
- {3265, {wxStyledTextCtrl, braceBadLight, 1}},
- {3266, {wxStyledTextCtrl, braceMatch, 1}},
- {3267, {wxStyledTextCtrl, getViewEOL, 0}},
- {3268, {wxStyledTextCtrl, setViewEOL, 1}},
- {3269, {wxStyledTextCtrl, setModEventMask, 1}},
- {3270, {wxStyledTextCtrl, getEdgeColumn, 0}},
- {3271, {wxStyledTextCtrl, setEdgeColumn, 1}},
- {3272, {wxStyledTextCtrl, getEdgeMode, 0}},
- {3273, {wxStyledTextCtrl, getEdgeColour, 0}},
- {3274, {wxStyledTextCtrl, setEdgeColour, 1}},
- {3275, {wxStyledTextCtrl, searchAnchor, 0}},
- {3276, {wxStyledTextCtrl, searchNext, 2}},
- {3277, {wxStyledTextCtrl, searchPrev, 2}},
- {3278, {wxStyledTextCtrl, linesOnScreen, 0}},
- {3279, {wxStyledTextCtrl, usePopUp, 1}},
- {3280, {wxStyledTextCtrl, selectionIsRectangle, 0}},
- {3281, {wxStyledTextCtrl, setZoom, 1}},
- {3282, {wxStyledTextCtrl, getZoom, 0}},
- {3283, {wxStyledTextCtrl, getModEventMask, 0}},
- {3284, {wxStyledTextCtrl, setSTCFocus, 1}},
- {3285, {wxStyledTextCtrl, getSTCFocus, 0}},
- {3286, {wxStyledTextCtrl, setStatus, 1}},
- {3287, {wxStyledTextCtrl, getStatus, 0}},
- {3288, {wxStyledTextCtrl, setMouseDownCaptures, 1}},
- {3289, {wxStyledTextCtrl, getMouseDownCaptures, 0}},
- {3290, {wxStyledTextCtrl, setSTCCursor, 1}},
- {3291, {wxStyledTextCtrl, getSTCCursor, 0}},
- {3292, {wxStyledTextCtrl, setControlCharSymbol, 1}},
- {3293, {wxStyledTextCtrl, getControlCharSymbol, 0}},
- {3294, {wxStyledTextCtrl, wordPartLeft, 0}},
- {3295, {wxStyledTextCtrl, wordPartLeftExtend, 0}},
- {3296, {wxStyledTextCtrl, wordPartRight, 0}},
- {3297, {wxStyledTextCtrl, wordPartRightExtend, 0}},
- {3298, {wxStyledTextCtrl, setVisiblePolicy, 2}},
- {3299, {wxStyledTextCtrl, delLineLeft, 0}},
- {3300, {wxStyledTextCtrl, delLineRight, 0}},
- {3301, {wxStyledTextCtrl, getXOffset, 0}},
- {3302, {wxStyledTextCtrl, chooseCaretX, 0}},
- {3303, {wxStyledTextCtrl, setXCaretPolicy, 2}},
- {3304, {wxStyledTextCtrl, setYCaretPolicy, 2}},
- {3305, {wxStyledTextCtrl, getPrintWrapMode, 0}},
- {3306, {wxStyledTextCtrl, setHotspotActiveForeground, 2}},
- {3307, {wxStyledTextCtrl, setHotspotActiveBackground, 2}},
- {3308, {wxStyledTextCtrl, setHotspotActiveUnderline, 1}},
- {3309, {wxStyledTextCtrl, setHotspotSingleLine, 1}},
- {3310, {wxStyledTextCtrl, paraDownExtend, 0}},
- {3311, {wxStyledTextCtrl, paraUp, 0}},
- {3312, {wxStyledTextCtrl, paraUpExtend, 0}},
- {3313, {wxStyledTextCtrl, positionBefore, 1}},
- {3314, {wxStyledTextCtrl, positionAfter, 1}},
- {3315, {wxStyledTextCtrl, copyRange, 2}},
- {3316, {wxStyledTextCtrl, copyText, 2}},
- {3317, {wxStyledTextCtrl, setSelectionMode, 1}},
- {3318, {wxStyledTextCtrl, getSelectionMode, 0}},
- {3319, {wxStyledTextCtrl, lineDownRectExtend, 0}},
- {3320, {wxStyledTextCtrl, lineUpRectExtend, 0}},
- {3321, {wxStyledTextCtrl, charLeftRectExtend, 0}},
- {3322, {wxStyledTextCtrl, charRightRectExtend, 0}},
- {3323, {wxStyledTextCtrl, homeRectExtend, 0}},
- {3324, {wxStyledTextCtrl, vCHomeRectExtend, 0}},
- {3325, {wxStyledTextCtrl, lineEndRectExtend, 0}},
- {3326, {wxStyledTextCtrl, pageUpRectExtend, 0}},
- {3327, {wxStyledTextCtrl, pageDownRectExtend, 0}},
- {3328, {wxStyledTextCtrl, stutteredPageUp, 0}},
- {3329, {wxStyledTextCtrl, stutteredPageUpExtend, 0}},
- {3330, {wxStyledTextCtrl, stutteredPageDown, 0}},
- {3331, {wxStyledTextCtrl, stutteredPageDownExtend, 0}},
- {3332, {wxStyledTextCtrl, wordLeftEnd, 0}},
- {3333, {wxStyledTextCtrl, wordLeftEndExtend, 0}},
- {3334, {wxStyledTextCtrl, wordRightEnd, 0}},
- {3335, {wxStyledTextCtrl, wordRightEndExtend, 0}},
- {3336, {wxStyledTextCtrl, setWhitespaceChars, 1}},
- {3337, {wxStyledTextCtrl, setCharsDefault, 0}},
- {3338, {wxStyledTextCtrl, autoCompGetCurrent, 0}},
- {3339, {wxStyledTextCtrl, allocate, 1}},
- {3340, {wxStyledTextCtrl, findColumn, 2}},
- {3341, {wxStyledTextCtrl, getCaretSticky, 0}},
- {3342, {wxStyledTextCtrl, setCaretSticky, 1}},
- {3343, {wxStyledTextCtrl, toggleCaretSticky, 0}},
- {3344, {wxStyledTextCtrl, setPasteConvertEndings, 1}},
- {3345, {wxStyledTextCtrl, getPasteConvertEndings, 0}},
- {3346, {wxStyledTextCtrl, selectionDuplicate, 0}},
- {3347, {wxStyledTextCtrl, setCaretLineBackAlpha, 1}},
- {3348, {wxStyledTextCtrl, getCaretLineBackAlpha, 0}},
- {3349, {wxStyledTextCtrl, startRecord, 0}},
- {3350, {wxStyledTextCtrl, stopRecord, 0}},
- {3351, {wxStyledTextCtrl, setLexer, 1}},
- {3352, {wxStyledTextCtrl, getLexer, 0}},
- {3353, {wxStyledTextCtrl, colourise, 2}},
- {3354, {wxStyledTextCtrl, setProperty, 2}},
- {3355, {wxStyledTextCtrl, setKeyWords, 2}},
- {3356, {wxStyledTextCtrl, setLexerLanguage, 1}},
- {3357, {wxStyledTextCtrl, getProperty, 1}},
- {3358, {wxStyledTextCtrl, getStyleBitsNeeded, 0}},
- {3359, {wxStyledTextCtrl, getCurrentLine, 0}},
- {3360, {wxStyledTextCtrl, styleSetSpec, 2}},
- {3361, {wxStyledTextCtrl, styleSetFont, 2}},
- {3362, {wxStyledTextCtrl, styleSetFontAttr, 7}},
- {3363, {wxStyledTextCtrl, styleSetCharacterSet, 2}},
- {3364, {wxStyledTextCtrl, styleSetFontEncoding, 2}},
- {3365, {wxStyledTextCtrl, cmdKeyExecute, 1}},
- {3366, {wxStyledTextCtrl, setMargins, 2}},
- {3367, {wxStyledTextCtrl, getSelection, 2}},
- {3368, {wxStyledTextCtrl, pointFromPosition, 1}},
- {3369, {wxStyledTextCtrl, scrollToLine, 1}},
- {3370, {wxStyledTextCtrl, scrollToColumn, 1}},
- {3371, {wxStyledTextCtrl, sendMsg, 2}},
- {3372, {wxStyledTextCtrl, setVScrollBar, 1}},
- {3373, {wxStyledTextCtrl, setHScrollBar, 1}},
- {3374, {wxStyledTextCtrl, getLastKeydownProcessed, 0}},
- {3375, {wxStyledTextCtrl, setLastKeydownProcessed, 1}},
- {3376, {wxStyledTextCtrl, saveFile, 1}},
- {3377, {wxStyledTextCtrl, loadFile, 1}},
- {3378, {wxStyledTextCtrl, doDragOver, 3}},
- {3379, {wxStyledTextCtrl, doDropText, 3}},
- {3380, {wxStyledTextCtrl, getUseAntiAliasing, 0}},
- {3381, {wxStyledTextCtrl, addTextRaw, 1}},
- {3382, {wxStyledTextCtrl, insertTextRaw, 2}},
- {3383, {wxStyledTextCtrl, getCurLineRaw, 1}},
- {3384, {wxStyledTextCtrl, getLineRaw, 1}},
- {3385, {wxStyledTextCtrl, getSelectedTextRaw, 0}},
- {3386, {wxStyledTextCtrl, getTextRangeRaw, 2}},
- {3387, {wxStyledTextCtrl, setTextRaw, 1}},
- {3388, {wxStyledTextCtrl, getTextRaw, 0}},
- {3389, {wxStyledTextCtrl, appendTextRaw, 1}},
- {3390, {wxArtProvider, getBitmap, 2}},
- {3391, {wxArtProvider, getIcon, 2}},
- {3392, {wxTreeEvent, getKeyCode, 0}},
- {3393, {wxTreeEvent, getItem, 0}},
- {3394, {wxTreeEvent, getKeyEvent, 0}},
- {3395, {wxTreeEvent, getLabel, 0}},
- {3396, {wxTreeEvent, getOldItem, 0}},
- {3397, {wxTreeEvent, getPoint, 0}},
- {3398, {wxTreeEvent, isEditCancelled, 0}},
- {3399, {wxTreeEvent, setToolTip, 1}},
- {3400, {wxNotebookEvent, getOldSelection, 0}},
- {3401, {wxNotebookEvent, getSelection, 0}},
- {3402, {wxNotebookEvent, setOldSelection, 1}},
- {3403, {wxNotebookEvent, setSelection, 1}},
- {3404, {wxFileDataObject, new, 0}},
- {3405, {wxFileDataObject, addFile, 1}},
- {3406, {wxFileDataObject, getFilenames, 0}},
- {3407, {wxFileDataObject, 'Destroy', undefined}},
- {3408, {wxTextDataObject, new, 1}},
- {3409, {wxTextDataObject, getTextLength, 0}},
- {3410, {wxTextDataObject, getText, 0}},
- {3411, {wxTextDataObject, setText, 1}},
- {3412, {wxTextDataObject, 'Destroy', undefined}},
- {3413, {wxBitmapDataObject, new_1_1, 1}},
- {3414, {wxBitmapDataObject, new_1_0, 1}},
- {3415, {wxBitmapDataObject, getBitmap, 0}},
- {3416, {wxBitmapDataObject, setBitmap, 1}},
- {3417, {wxBitmapDataObject, 'Destroy', undefined}},
- {3419, {wxClipboard, new, 0}},
- {3420, {wxClipboard, destruct, 0}},
- {3421, {wxClipboard, addData, 1}},
- {3422, {wxClipboard, clear, 0}},
- {3423, {wxClipboard, close, 0}},
- {3424, {wxClipboard, flush, 0}},
- {3425, {wxClipboard, getData, 1}},
- {3426, {wxClipboard, isOpened, 0}},
- {3427, {wxClipboard, open, 0}},
- {3428, {wxClipboard, setData, 1}},
- {3430, {wxClipboard, usePrimarySelection, 1}},
- {3431, {wxClipboard, isSupported, 1}},
- {3432, {wxClipboard, get, 0}},
- {3433, {wxSpinEvent, getPosition, 0}},
- {3434, {wxSpinEvent, setPosition, 1}},
- {3435, {wxSplitterWindow, new_0, 0}},
- {3436, {wxSplitterWindow, new_2, 2}},
- {3437, {wxSplitterWindow, destruct, 0}},
- {3438, {wxSplitterWindow, create, 2}},
- {3439, {wxSplitterWindow, getMinimumPaneSize, 0}},
- {3440, {wxSplitterWindow, getSashGravity, 0}},
- {3441, {wxSplitterWindow, getSashPosition, 0}},
- {3442, {wxSplitterWindow, getSplitMode, 0}},
- {3443, {wxSplitterWindow, getWindow1, 0}},
- {3444, {wxSplitterWindow, getWindow2, 0}},
- {3445, {wxSplitterWindow, initialize, 1}},
- {3446, {wxSplitterWindow, isSplit, 0}},
- {3447, {wxSplitterWindow, replaceWindow, 2}},
- {3448, {wxSplitterWindow, setSashGravity, 1}},
- {3449, {wxSplitterWindow, setSashPosition, 2}},
- {3450, {wxSplitterWindow, setSashSize, 1}},
- {3451, {wxSplitterWindow, setMinimumPaneSize, 1}},
- {3452, {wxSplitterWindow, setSplitMode, 1}},
- {3453, {wxSplitterWindow, splitHorizontally, 3}},
- {3454, {wxSplitterWindow, splitVertically, 3}},
- {3455, {wxSplitterWindow, unsplit, 1}},
- {3456, {wxSplitterWindow, updateSize, 0}},
- {3457, {wxSplitterEvent, getSashPosition, 0}},
- {3458, {wxSplitterEvent, getX, 0}},
- {3459, {wxSplitterEvent, getY, 0}},
- {3460, {wxSplitterEvent, getWindowBeingRemoved, 0}},
- {3461, {wxSplitterEvent, setSashPosition, 1}},
- {3462, {wxHtmlWindow, new_0, 0}},
- {3463, {wxHtmlWindow, new_2, 2}},
- {3464, {wxHtmlWindow, appendToPage, 1}},
- {3465, {wxHtmlWindow, getOpenedAnchor, 0}},
- {3466, {wxHtmlWindow, getOpenedPage, 0}},
- {3467, {wxHtmlWindow, getOpenedPageTitle, 0}},
- {3468, {wxHtmlWindow, getRelatedFrame, 0}},
- {3469, {wxHtmlWindow, historyBack, 0}},
- {3470, {wxHtmlWindow, historyCanBack, 0}},
- {3471, {wxHtmlWindow, historyCanForward, 0}},
- {3472, {wxHtmlWindow, historyClear, 0}},
- {3473, {wxHtmlWindow, historyForward, 0}},
- {3474, {wxHtmlWindow, loadFile, 1}},
- {3475, {wxHtmlWindow, loadPage, 1}},
- {3476, {wxHtmlWindow, selectAll, 0}},
- {3477, {wxHtmlWindow, selectionToText, 0}},
- {3478, {wxHtmlWindow, selectLine, 1}},
- {3479, {wxHtmlWindow, selectWord, 1}},
- {3480, {wxHtmlWindow, setBorders, 1}},
- {3481, {wxHtmlWindow, setFonts, 3}},
- {3482, {wxHtmlWindow, setPage, 1}},
- {3483, {wxHtmlWindow, setRelatedFrame, 2}},
- {3484, {wxHtmlWindow, setRelatedStatusBar, 1}},
- {3485, {wxHtmlWindow, toText, 0}},
- {3486, {wxHtmlWindow, 'Destroy', undefined}},
- {3487, {wxHtmlLinkEvent, getLinkInfo, 0}},
- {3488, {wxSystemSettings, getColour, 1}},
- {3489, {wxSystemSettings, getFont, 1}},
- {3490, {wxSystemSettings, getMetric, 2}},
- {3491, {wxSystemSettings, getScreenType, 0}},
- {3492, {wxSystemOptions, getOption, 1}},
- {3493, {wxSystemOptions, getOptionInt, 1}},
- {3494, {wxSystemOptions, hasOption, 1}},
- {3495, {wxSystemOptions, isFalse, 1}},
- {3496, {wxSystemOptions, setOption_2_1, 2}},
- {3497, {wxSystemOptions, setOption_2_0, 2}},
- {3498, {wxAuiNotebookEvent, setSelection, 1}},
- {3499, {wxAuiNotebookEvent, getSelection, 0}},
- {3500, {wxAuiNotebookEvent, setOldSelection, 1}},
- {3501, {wxAuiNotebookEvent, getOldSelection, 0}},
- {3502, {wxAuiNotebookEvent, setDragSource, 1}},
- {3503, {wxAuiNotebookEvent, getDragSource, 0}},
- {3504, {wxAuiManagerEvent, setManager, 1}},
- {3505, {wxAuiManagerEvent, getManager, 0}},
- {3506, {wxAuiManagerEvent, setPane, 1}},
- {3507, {wxAuiManagerEvent, getPane, 0}},
- {3508, {wxAuiManagerEvent, setButton, 1}},
- {3509, {wxAuiManagerEvent, getButton, 0}},
- {3510, {wxAuiManagerEvent, setDC, 1}},
- {3511, {wxAuiManagerEvent, getDC, 0}},
- {3512, {wxAuiManagerEvent, veto, 1}},
- {3513, {wxAuiManagerEvent, getVeto, 0}},
- {3514, {wxAuiManagerEvent, setCanVeto, 1}},
- {3515, {wxAuiManagerEvent, canVeto, 0}},
- {3516, {wxLogNull, new, 0}},
- {3517, {wxLogNull, 'Destroy', undefined}},
+ {665, {wxDC, getClippingBox, 4}},
+ {667, {wxDC, getFont, 0}},
+ {668, {wxDC, getLayoutDirection, 0}},
+ {669, {wxDC, getLogicalFunction, 0}},
+ {670, {wxDC, getMapMode, 0}},
+ {671, {wxDC, getMultiLineTextExtent_4, 4}},
+ {672, {wxDC, getMultiLineTextExtent_1, 1}},
+ {673, {wxDC, getPartialTextExtents, 2}},
+ {674, {wxDC, getPen, 0}},
+ {675, {wxDC, getPixel, 2}},
+ {676, {wxDC, getPPI, 0}},
+ {678, {wxDC, getSize, 0}},
+ {680, {wxDC, getSizeMM, 0}},
+ {681, {wxDC, getTextBackground, 0}},
+ {682, {wxDC, getTextExtent_4, 4}},
+ {683, {wxDC, getTextExtent_1, 1}},
+ {685, {wxDC, getTextForeground, 0}},
+ {686, {wxDC, getUserScale, 2}},
+ {687, {wxDC, gradientFillConcentric_3, 3}},
+ {688, {wxDC, gradientFillConcentric_4, 4}},
+ {689, {wxDC, gradientFillLinear, 4}},
+ {690, {wxDC, logicalToDeviceX, 1}},
+ {691, {wxDC, logicalToDeviceXRel, 1}},
+ {692, {wxDC, logicalToDeviceY, 1}},
+ {693, {wxDC, logicalToDeviceYRel, 1}},
+ {694, {wxDC, maxX, 0}},
+ {695, {wxDC, maxY, 0}},
+ {696, {wxDC, minX, 0}},
+ {697, {wxDC, minY, 0}},
+ {698, {wxDC, isOk, 0}},
+ {699, {wxDC, resetBoundingBox, 0}},
+ {700, {wxDC, setAxisOrientation, 2}},
+ {701, {wxDC, setBackground, 1}},
+ {702, {wxDC, setBackgroundMode, 1}},
+ {703, {wxDC, setBrush, 1}},
+ {705, {wxDC, setClippingRegion_2, 2}},
+ {706, {wxDC, setClippingRegion_1_1, 1}},
+ {707, {wxDC, setClippingRegion_1_0, 1}},
+ {708, {wxDC, setDeviceOrigin, 2}},
+ {709, {wxDC, setFont, 1}},
+ {710, {wxDC, setLayoutDirection, 1}},
+ {711, {wxDC, setLogicalFunction, 1}},
+ {712, {wxDC, setMapMode, 1}},
+ {713, {wxDC, setPalette, 1}},
+ {714, {wxDC, setPen, 1}},
+ {715, {wxDC, setTextBackground, 1}},
+ {716, {wxDC, setTextForeground, 1}},
+ {717, {wxDC, setUserScale, 2}},
+ {718, {wxDC, startDoc, 1}},
+ {719, {wxDC, startPage, 0}},
+ {720, {wxMirrorDC, new, 2}},
+ {721, {wxMirrorDC, 'Destroy', undefined}},
+ {722, {wxScreenDC, new, 0}},
+ {723, {wxScreenDC, destruct, 0}},
+ {724, {wxPostScriptDC, new_0, 0}},
+ {725, {wxPostScriptDC, new_1, 1}},
+ {726, {wxPostScriptDC, destruct, 0}},
+ {727, {wxPostScriptDC, setResolution, 1}},
+ {728, {wxPostScriptDC, getResolution, 0}},
+ {729, {wxWindowDC, new_0, 0}},
+ {730, {wxWindowDC, new_1, 1}},
+ {731, {wxWindowDC, destruct, 0}},
+ {732, {wxClientDC, new_0, 0}},
+ {733, {wxClientDC, new_1, 1}},
+ {734, {wxClientDC, 'Destroy', undefined}},
+ {735, {wxPaintDC, new_0, 0}},
+ {736, {wxPaintDC, new_1, 1}},
+ {737, {wxPaintDC, 'Destroy', undefined}},
+ {739, {wxMemoryDC, new_1_0, 1}},
+ {740, {wxMemoryDC, new_1_1, 1}},
+ {741, {wxMemoryDC, new_0, 0}},
+ {743, {wxMemoryDC, destruct, 0}},
+ {744, {wxMemoryDC, selectObject, 1}},
+ {745, {wxMemoryDC, selectObjectAsSource, 1}},
+ {746, {wxBufferedDC, new_0, 0}},
+ {747, {wxBufferedDC, new_2, 2}},
+ {748, {wxBufferedDC, new_3, 3}},
+ {749, {wxBufferedDC, destruct, 0}},
+ {750, {wxBufferedDC, init_2, 2}},
+ {751, {wxBufferedDC, init_3, 3}},
+ {752, {wxBufferedPaintDC, new_3, 3}},
+ {753, {wxBufferedPaintDC, new_2, 2}},
+ {754, {wxBufferedPaintDC, destruct, 0}},
+ {755, {wxGraphicsObject, destruct, 0}},
+ {756, {wxGraphicsObject, getRenderer, 0}},
+ {757, {wxGraphicsObject, isNull, 0}},
+ {758, {wxGraphicsContext, destruct, 0}},
+ {759, {wxGraphicsContext, create_1_1, 1}},
+ {760, {wxGraphicsContext, create_1_0, 1}},
+ {761, {wxGraphicsContext, create_0, 0}},
+ {762, {wxGraphicsContext, createPen, 1}},
+ {763, {wxGraphicsContext, createBrush, 1}},
+ {764, {wxGraphicsContext, createRadialGradientBrush, 7}},
+ {765, {wxGraphicsContext, createLinearGradientBrush, 6}},
+ {766, {wxGraphicsContext, createFont, 2}},
+ {767, {wxGraphicsContext, createMatrix, 1}},
+ {768, {wxGraphicsContext, createPath, 0}},
+ {769, {wxGraphicsContext, clip_1, 1}},
+ {770, {wxGraphicsContext, clip_4, 4}},
+ {771, {wxGraphicsContext, resetClip, 0}},
+ {772, {wxGraphicsContext, drawBitmap, 5}},
+ {773, {wxGraphicsContext, drawEllipse, 4}},
+ {774, {wxGraphicsContext, drawIcon, 5}},
+ {775, {wxGraphicsContext, drawLines, 3}},
+ {776, {wxGraphicsContext, drawPath, 2}},
+ {777, {wxGraphicsContext, drawRectangle, 4}},
+ {778, {wxGraphicsContext, drawRoundedRectangle, 5}},
+ {779, {wxGraphicsContext, drawText_3, 3}},
+ {780, {wxGraphicsContext, drawText_4_0, 4}},
+ {781, {wxGraphicsContext, drawText_4_1, 4}},
+ {782, {wxGraphicsContext, drawText_5, 5}},
+ {783, {wxGraphicsContext, fillPath, 2}},
+ {784, {wxGraphicsContext, strokePath, 1}},
+ {785, {wxGraphicsContext, getPartialTextExtents, 2}},
+ {786, {wxGraphicsContext, getTextExtent, 5}},
+ {787, {wxGraphicsContext, rotate, 1}},
+ {788, {wxGraphicsContext, scale, 2}},
+ {789, {wxGraphicsContext, translate, 2}},
+ {790, {wxGraphicsContext, getTransform, 0}},
+ {791, {wxGraphicsContext, setTransform, 1}},
+ {792, {wxGraphicsContext, concatTransform, 1}},
+ {793, {wxGraphicsContext, setBrush_1_1, 1}},
+ {794, {wxGraphicsContext, setBrush_1_0, 1}},
+ {795, {wxGraphicsContext, setFont_1, 1}},
+ {796, {wxGraphicsContext, setFont_2, 2}},
+ {797, {wxGraphicsContext, setPen_1_0, 1}},
+ {798, {wxGraphicsContext, setPen_1_1, 1}},
+ {799, {wxGraphicsContext, strokeLine, 4}},
+ {800, {wxGraphicsContext, strokeLines, 2}},
+ {802, {wxGraphicsMatrix, concat, 1}},
+ {804, {wxGraphicsMatrix, get, 1}},
+ {805, {wxGraphicsMatrix, invert, 0}},
+ {806, {wxGraphicsMatrix, isEqual, 1}},
+ {808, {wxGraphicsMatrix, isIdentity, 0}},
+ {809, {wxGraphicsMatrix, rotate, 1}},
+ {810, {wxGraphicsMatrix, scale, 2}},
+ {811, {wxGraphicsMatrix, translate, 2}},
+ {812, {wxGraphicsMatrix, set, 1}},
+ {813, {wxGraphicsMatrix, transformPoint, 2}},
+ {814, {wxGraphicsMatrix, transformDistance, 2}},
+ {815, {wxGraphicsPath, moveToPoint_2, 2}},
+ {816, {wxGraphicsPath, moveToPoint_1, 1}},
+ {817, {wxGraphicsPath, addArc_6, 6}},
+ {818, {wxGraphicsPath, addArc_5, 5}},
+ {819, {wxGraphicsPath, addArcToPoint, 5}},
+ {820, {wxGraphicsPath, addCircle, 3}},
+ {821, {wxGraphicsPath, addCurveToPoint_6, 6}},
+ {822, {wxGraphicsPath, addCurveToPoint_3, 3}},
+ {823, {wxGraphicsPath, addEllipse, 4}},
+ {824, {wxGraphicsPath, addLineToPoint_2, 2}},
+ {825, {wxGraphicsPath, addLineToPoint_1, 1}},
+ {826, {wxGraphicsPath, addPath, 1}},
+ {827, {wxGraphicsPath, addQuadCurveToPoint, 4}},
+ {828, {wxGraphicsPath, addRectangle, 4}},
+ {829, {wxGraphicsPath, addRoundedRectangle, 5}},
+ {830, {wxGraphicsPath, closeSubpath, 0}},
+ {831, {wxGraphicsPath, contains_3, 3}},
+ {832, {wxGraphicsPath, contains_2, 2}},
+ {834, {wxGraphicsPath, getBox, 0}},
+ {836, {wxGraphicsPath, getCurrentPoint, 0}},
+ {837, {wxGraphicsPath, transform, 1}},
+ {838, {wxGraphicsRenderer, getDefaultRenderer, 0}},
+ {839, {wxGraphicsRenderer, createContext_1_1, 1}},
+ {840, {wxGraphicsRenderer, createContext_1_0, 1}},
+ {841, {wxGraphicsRenderer, createPen, 1}},
+ {842, {wxGraphicsRenderer, createBrush, 1}},
+ {843, {wxGraphicsRenderer, createLinearGradientBrush, 6}},
+ {844, {wxGraphicsRenderer, createRadialGradientBrush, 7}},
+ {845, {wxGraphicsRenderer, createFont, 2}},
+ {846, {wxGraphicsRenderer, createMatrix, 1}},
+ {847, {wxGraphicsRenderer, createPath, 0}},
+ {849, {wxMenuBar, new_1, 1}},
+ {851, {wxMenuBar, new_0, 0}},
+ {853, {wxMenuBar, destruct, 0}},
+ {854, {wxMenuBar, append, 2}},
+ {855, {wxMenuBar, check, 2}},
+ {856, {wxMenuBar, enable_2, 2}},
+ {857, {wxMenuBar, enable_1, 1}},
+ {858, {wxMenuBar, enableTop, 2}},
+ {859, {wxMenuBar, findMenu, 1}},
+ {860, {wxMenuBar, findMenuItem, 2}},
+ {861, {wxMenuBar, findItem, 2}},
+ {862, {wxMenuBar, getHelpString, 1}},
+ {863, {wxMenuBar, getLabel_1, 1}},
+ {864, {wxMenuBar, getLabel_0, 0}},
+ {865, {wxMenuBar, getLabelTop, 1}},
+ {866, {wxMenuBar, getMenu, 1}},
+ {867, {wxMenuBar, getMenuCount, 0}},
+ {868, {wxMenuBar, insert, 3}},
+ {869, {wxMenuBar, isChecked, 1}},
+ {870, {wxMenuBar, isEnabled_1, 1}},
+ {871, {wxMenuBar, isEnabled_0, 0}},
+ {872, {wxMenuBar, remove, 1}},
+ {873, {wxMenuBar, replace, 3}},
+ {874, {wxMenuBar, setHelpString, 2}},
+ {875, {wxMenuBar, setLabel_2, 2}},
+ {876, {wxMenuBar, setLabel_1, 1}},
+ {877, {wxMenuBar, setLabelTop, 2}},
+ {878, {wxControl, getLabel, 0}},
+ {879, {wxControl, setLabel, 1}},
+ {880, {wxControlWithItems, append_1, 1}},
+ {881, {wxControlWithItems, append_2, 2}},
+ {882, {wxControlWithItems, appendStrings_1, 1}},
+ {883, {wxControlWithItems, clear, 0}},
+ {884, {wxControlWithItems, delete, 1}},
+ {885, {wxControlWithItems, findString, 2}},
+ {886, {wxControlWithItems, getClientData, 1}},
+ {887, {wxControlWithItems, setClientData, 2}},
+ {888, {wxControlWithItems, getCount, 0}},
+ {889, {wxControlWithItems, getSelection, 0}},
+ {890, {wxControlWithItems, getString, 1}},
+ {891, {wxControlWithItems, getStringSelection, 0}},
+ {892, {wxControlWithItems, insert_2, 2}},
+ {893, {wxControlWithItems, insert_3, 3}},
+ {894, {wxControlWithItems, isEmpty, 0}},
+ {895, {wxControlWithItems, select, 1}},
+ {896, {wxControlWithItems, setSelection, 1}},
+ {897, {wxControlWithItems, setString, 2}},
+ {898, {wxControlWithItems, setStringSelection, 1}},
+ {901, {wxMenu, new_2, 2}},
+ {902, {wxMenu, new_1, 1}},
+ {904, {wxMenu, destruct, 0}},
+ {905, {wxMenu, append_3, 3}},
+ {906, {wxMenu, append_1, 1}},
+ {907, {wxMenu, append_4_0, 4}},
+ {908, {wxMenu, append_4_1, 4}},
+ {909, {wxMenu, appendCheckItem, 3}},
+ {910, {wxMenu, appendRadioItem, 3}},
+ {911, {wxMenu, appendSeparator, 0}},
+ {912, {wxMenu, break, 0}},
+ {913, {wxMenu, check, 2}},
+ {914, {wxMenu, delete_1_0, 1}},
+ {915, {wxMenu, delete_1_1, 1}},
+ {916, {wxMenu, destroy_1_0, 1}},
+ {917, {wxMenu, destroy_1_1, 1}},
+ {918, {wxMenu, enable, 2}},
+ {919, {wxMenu, findItem_1, 1}},
+ {920, {wxMenu, findItem_2, 2}},
+ {921, {wxMenu, findItemByPosition, 1}},
+ {922, {wxMenu, getHelpString, 1}},
+ {923, {wxMenu, getLabel, 1}},
+ {924, {wxMenu, getMenuItemCount, 0}},
+ {925, {wxMenu, getMenuItems, 0}},
+ {927, {wxMenu, getTitle, 0}},
+ {928, {wxMenu, insert_2, 2}},
+ {929, {wxMenu, insert_3, 3}},
+ {930, {wxMenu, insert_5_1, 5}},
+ {931, {wxMenu, insert_5_0, 5}},
+ {932, {wxMenu, insertCheckItem, 4}},
+ {933, {wxMenu, insertRadioItem, 4}},
+ {934, {wxMenu, insertSeparator, 1}},
+ {935, {wxMenu, isChecked, 1}},
+ {936, {wxMenu, isEnabled, 1}},
+ {937, {wxMenu, prepend_1, 1}},
+ {938, {wxMenu, prepend_2, 2}},
+ {939, {wxMenu, prepend_4_1, 4}},
+ {940, {wxMenu, prepend_4_0, 4}},
+ {941, {wxMenu, prependCheckItem, 3}},
+ {942, {wxMenu, prependRadioItem, 3}},
+ {943, {wxMenu, prependSeparator, 0}},
+ {944, {wxMenu, remove_1_0, 1}},
+ {945, {wxMenu, remove_1_1, 1}},
+ {946, {wxMenu, setHelpString, 2}},
+ {947, {wxMenu, setLabel, 2}},
+ {948, {wxMenu, setTitle, 1}},
+ {949, {wxMenuItem, new, 1}},
+ {951, {wxMenuItem, destruct, 0}},
+ {952, {wxMenuItem, check, 1}},
+ {953, {wxMenuItem, enable, 1}},
+ {954, {wxMenuItem, getBitmap, 0}},
+ {955, {wxMenuItem, getHelp, 0}},
+ {956, {wxMenuItem, getId, 0}},
+ {957, {wxMenuItem, getKind, 0}},
+ {958, {wxMenuItem, getLabel, 0}},
+ {959, {wxMenuItem, getLabelFromText, 1}},
+ {960, {wxMenuItem, getMenu, 0}},
+ {961, {wxMenuItem, getText, 0}},
+ {962, {wxMenuItem, getSubMenu, 0}},
+ {963, {wxMenuItem, isCheckable, 0}},
+ {964, {wxMenuItem, isChecked, 0}},
+ {965, {wxMenuItem, isEnabled, 0}},
+ {966, {wxMenuItem, isSeparator, 0}},
+ {967, {wxMenuItem, isSubMenu, 0}},
+ {968, {wxMenuItem, setBitmap, 1}},
+ {969, {wxMenuItem, setHelp, 1}},
+ {970, {wxMenuItem, setMenu, 1}},
+ {971, {wxMenuItem, setSubMenu, 1}},
+ {972, {wxMenuItem, setText, 1}},
+ {973, {wxToolBar, addControl, 1}},
+ {974, {wxToolBar, addSeparator, 0}},
+ {975, {wxToolBar, addTool_5, 5}},
+ {976, {wxToolBar, addTool_4_0, 4}},
+ {977, {wxToolBar, addTool_1, 1}},
+ {978, {wxToolBar, addTool_4_1, 4}},
+ {979, {wxToolBar, addTool_3, 3}},
+ {980, {wxToolBar, addTool_6, 6}},
+ {981, {wxToolBar, addCheckTool, 4}},
+ {982, {wxToolBar, addRadioTool, 4}},
+ {983, {wxToolBar, deleteTool, 1}},
+ {984, {wxToolBar, deleteToolByPos, 1}},
+ {985, {wxToolBar, enableTool, 2}},
+ {986, {wxToolBar, findById, 1}},
+ {987, {wxToolBar, findControl, 1}},
+ {988, {wxToolBar, findToolForPosition, 2}},
+ {989, {wxToolBar, getToolSize, 0}},
+ {990, {wxToolBar, getToolBitmapSize, 0}},
+ {991, {wxToolBar, getMargins, 0}},
+ {992, {wxToolBar, getToolEnabled, 1}},
+ {993, {wxToolBar, getToolLongHelp, 1}},
+ {994, {wxToolBar, getToolPacking, 0}},
+ {995, {wxToolBar, getToolPos, 1}},
+ {996, {wxToolBar, getToolSeparation, 0}},
+ {997, {wxToolBar, getToolShortHelp, 1}},
+ {998, {wxToolBar, getToolState, 1}},
+ {999, {wxToolBar, insertControl, 2}},
+ {1000, {wxToolBar, insertSeparator, 1}},
+ {1001, {wxToolBar, insertTool_5, 5}},
+ {1002, {wxToolBar, insertTool_2, 2}},
+ {1003, {wxToolBar, insertTool_4, 4}},
+ {1004, {wxToolBar, realize, 0}},
+ {1005, {wxToolBar, removeTool, 1}},
+ {1006, {wxToolBar, setMargins, 2}},
+ {1007, {wxToolBar, setToolBitmapSize, 1}},
+ {1008, {wxToolBar, setToolLongHelp, 2}},
+ {1009, {wxToolBar, setToolPacking, 1}},
+ {1010, {wxToolBar, setToolShortHelp, 2}},
+ {1011, {wxToolBar, setToolSeparation, 1}},
+ {1012, {wxToolBar, toggleTool, 2}},
+ {1014, {wxStatusBar, new_0, 0}},
+ {1015, {wxStatusBar, new_2, 2}},
+ {1017, {wxStatusBar, destruct, 0}},
+ {1018, {wxStatusBar, create, 2}},
+ {1019, {wxStatusBar, getFieldRect, 2}},
+ {1020, {wxStatusBar, getFieldsCount, 0}},
+ {1021, {wxStatusBar, getStatusText, 1}},
+ {1022, {wxStatusBar, popStatusText, 1}},
+ {1023, {wxStatusBar, pushStatusText, 2}},
+ {1024, {wxStatusBar, setFieldsCount, 2}},
+ {1025, {wxStatusBar, setMinHeight, 1}},
+ {1026, {wxStatusBar, setStatusText, 2}},
+ {1027, {wxStatusBar, setStatusWidths, 2}},
+ {1028, {wxStatusBar, setStatusStyles, 2}},
+ {1029, {wxBitmap, new_0, 0}},
+ {1030, {wxBitmap, new_3, 3}},
+ {1031, {wxBitmap, new_4, 4}},
+ {1032, {wxBitmap, new_2_0, 2}},
+ {1033, {wxBitmap, new_2_1, 2}},
+ {1034, {wxBitmap, destruct, 0}},
+ {1035, {wxBitmap, convertToImage, 0}},
+ {1036, {wxBitmap, copyFromIcon, 1}},
+ {1037, {wxBitmap, create, 3}},
+ {1038, {wxBitmap, getDepth, 0}},
+ {1039, {wxBitmap, getHeight, 0}},
+ {1040, {wxBitmap, getPalette, 0}},
+ {1041, {wxBitmap, getMask, 0}},
+ {1042, {wxBitmap, getWidth, 0}},
+ {1043, {wxBitmap, getSubBitmap, 1}},
+ {1044, {wxBitmap, loadFile, 2}},
+ {1045, {wxBitmap, ok, 0}},
+ {1046, {wxBitmap, saveFile, 3}},
+ {1047, {wxBitmap, setDepth, 1}},
+ {1048, {wxBitmap, setHeight, 1}},
+ {1049, {wxBitmap, setMask, 1}},
+ {1050, {wxBitmap, setPalette, 1}},
+ {1051, {wxBitmap, setWidth, 1}},
+ {1052, {wxIcon, new_0, 0}},
+ {1053, {wxIcon, new_2, 2}},
+ {1054, {wxIcon, new_1, 1}},
+ {1055, {wxIcon, copyFromBitmap, 1}},
+ {1056, {wxIcon, 'Destroy', undefined}},
+ {1057, {wxIconBundle, new_0, 0}},
+ {1058, {wxIconBundle, new_2, 2}},
+ {1059, {wxIconBundle, new_1_0, 1}},
+ {1060, {wxIconBundle, new_1_1, 1}},
+ {1061, {wxIconBundle, destruct, 0}},
+ {1062, {wxIconBundle, addIcon_2, 2}},
+ {1063, {wxIconBundle, addIcon_1, 1}},
+ {1064, {wxIconBundle, getIcon_1_1, 1}},
+ {1065, {wxIconBundle, getIcon_1_0, 1}},
+ {1066, {wxCursor, new_0, 0}},
+ {1067, {wxCursor, new_1_0, 1}},
+ {1068, {wxCursor, new_1_1, 1}},
+ {1069, {wxCursor, new_4, 4}},
+ {1070, {wxCursor, destruct, 0}},
+ {1071, {wxCursor, ok, 0}},
+ {1072, {wxMask, new_0, 0}},
+ {1073, {wxMask, new_2_1, 2}},
+ {1074, {wxMask, new_2_0, 2}},
+ {1075, {wxMask, new_1, 1}},
+ {1076, {wxMask, destruct, 0}},
+ {1077, {wxMask, create_2_1, 2}},
+ {1078, {wxMask, create_2_0, 2}},
+ {1079, {wxMask, create_1, 1}},
+ {1080, {wxImage, new_0, 0}},
+ {1081, {wxImage, new_3_0, 3}},
+ {1082, {wxImage, new_4, 4}},
+ {1083, {wxImage, new_5, 5}},
+ {1084, {wxImage, new_2, 2}},
+ {1085, {wxImage, new_3_1, 3}},
+ {1086, {wxImage, blur, 1}},
+ {1087, {wxImage, blurHorizontal, 1}},
+ {1088, {wxImage, blurVertical, 1}},
+ {1089, {wxImage, convertAlphaToMask, 1}},
+ {1090, {wxImage, convertToGreyscale, 1}},
+ {1091, {wxImage, convertToMono, 3}},
+ {1092, {wxImage, copy, 0}},
+ {1093, {wxImage, create_3, 3}},
+ {1094, {wxImage, create_4, 4}},
+ {1095, {wxImage, create_5, 5}},
+ {1096, {wxImage, 'Destroy', 0}},
+ {1097, {wxImage, findFirstUnusedColour, 4}},
+ {1098, {wxImage, getImageExtWildcard, 0}},
+ {1099, {wxImage, getAlpha_2, 2}},
+ {1100, {wxImage, getAlpha_0, 0}},
+ {1101, {wxImage, getBlue, 2}},
+ {1102, {wxImage, getData, 0}},
+ {1103, {wxImage, getGreen, 2}},
+ {1104, {wxImage, getImageCount, 2}},
+ {1105, {wxImage, getHeight, 0}},
+ {1106, {wxImage, getMaskBlue, 0}},
+ {1107, {wxImage, getMaskGreen, 0}},
+ {1108, {wxImage, getMaskRed, 0}},
+ {1109, {wxImage, getOrFindMaskColour, 3}},
+ {1110, {wxImage, getPalette, 0}},
+ {1111, {wxImage, getRed, 2}},
+ {1112, {wxImage, getSubImage, 1}},
+ {1113, {wxImage, getWidth, 0}},
+ {1114, {wxImage, hasAlpha, 0}},
+ {1115, {wxImage, hasMask, 0}},
+ {1116, {wxImage, getOption, 1}},
+ {1117, {wxImage, getOptionInt, 1}},
+ {1118, {wxImage, hasOption, 1}},
+ {1119, {wxImage, initAlpha, 0}},
+ {1120, {wxImage, initStandardHandlers, 0}},
+ {1121, {wxImage, isTransparent, 3}},
+ {1122, {wxImage, loadFile_2, 2}},
+ {1123, {wxImage, loadFile_3, 3}},
+ {1124, {wxImage, ok, 0}},
+ {1125, {wxImage, removeHandler, 1}},
+ {1126, {wxImage, mirror, 1}},
+ {1127, {wxImage, replace, 6}},
+ {1128, {wxImage, rescale, 3}},
+ {1129, {wxImage, resize, 3}},
+ {1130, {wxImage, rotate, 3}},
+ {1131, {wxImage, rotateHue, 1}},
+ {1132, {wxImage, rotate90, 1}},
+ {1133, {wxImage, saveFile_1, 1}},
+ {1134, {wxImage, saveFile_2_0, 2}},
+ {1135, {wxImage, saveFile_2_1, 2}},
+ {1136, {wxImage, scale, 3}},
+ {1137, {wxImage, size, 3}},
+ {1138, {wxImage, setAlpha_3, 3}},
+ {1139, {wxImage, setAlpha_2, 2}},
+ {1140, {wxImage, setData_2, 2}},
+ {1141, {wxImage, setData_4, 4}},
+ {1142, {wxImage, setMask, 1}},
+ {1143, {wxImage, setMaskColour, 3}},
+ {1144, {wxImage, setMaskFromImage, 4}},
+ {1145, {wxImage, setOption_2_1, 2}},
+ {1146, {wxImage, setOption_2_0, 2}},
+ {1147, {wxImage, setPalette, 1}},
+ {1148, {wxImage, setRGB_5, 5}},
+ {1149, {wxImage, setRGB_4, 4}},
+ {1150, {wxImage, 'Destroy', undefined}},
+ {1151, {wxBrush, new_0, 0}},
+ {1152, {wxBrush, new_2, 2}},
+ {1153, {wxBrush, new_1, 1}},
+ {1155, {wxBrush, destruct, 0}},
+ {1156, {wxBrush, getColour, 0}},
+ {1157, {wxBrush, getStipple, 0}},
+ {1158, {wxBrush, getStyle, 0}},
+ {1159, {wxBrush, isHatch, 0}},
+ {1160, {wxBrush, isOk, 0}},
+ {1161, {wxBrush, setColour_1, 1}},
+ {1162, {wxBrush, setColour_3, 3}},
+ {1163, {wxBrush, setStipple, 1}},
+ {1164, {wxBrush, setStyle, 1}},
+ {1165, {wxPen, new_0, 0}},
+ {1166, {wxPen, new_2, 2}},
+ {1167, {wxPen, destruct, 0}},
+ {1168, {wxPen, getCap, 0}},
+ {1169, {wxPen, getColour, 0}},
+ {1170, {wxPen, getJoin, 0}},
+ {1171, {wxPen, getStyle, 0}},
+ {1172, {wxPen, getWidth, 0}},
+ {1173, {wxPen, isOk, 0}},
+ {1174, {wxPen, setCap, 1}},
+ {1175, {wxPen, setColour_1, 1}},
+ {1176, {wxPen, setColour_3, 3}},
+ {1177, {wxPen, setJoin, 1}},
+ {1178, {wxPen, setStyle, 1}},
+ {1179, {wxPen, setWidth, 1}},
+ {1180, {wxRegion, new_0, 0}},
+ {1181, {wxRegion, new_4, 4}},
+ {1182, {wxRegion, new_2, 2}},
+ {1183, {wxRegion, new_1_1, 1}},
+ {1185, {wxRegion, new_1_0, 1}},
+ {1187, {wxRegion, destruct, 0}},
+ {1188, {wxRegion, clear, 0}},
+ {1189, {wxRegion, contains_2, 2}},
+ {1190, {wxRegion, contains_1_0, 1}},
+ {1191, {wxRegion, contains_4, 4}},
+ {1192, {wxRegion, contains_1_1, 1}},
+ {1193, {wxRegion, convertToBitmap, 0}},
+ {1194, {wxRegion, getBox, 0}},
+ {1195, {wxRegion, intersect_4, 4}},
+ {1196, {wxRegion, intersect_1_1, 1}},
+ {1197, {wxRegion, intersect_1_0, 1}},
+ {1198, {wxRegion, isEmpty, 0}},
+ {1199, {wxRegion, subtract_4, 4}},
+ {1200, {wxRegion, subtract_1_1, 1}},
+ {1201, {wxRegion, subtract_1_0, 1}},
+ {1202, {wxRegion, offset_2, 2}},
+ {1203, {wxRegion, offset_1, 1}},
+ {1204, {wxRegion, union_4, 4}},
+ {1205, {wxRegion, union_1_2, 1}},
+ {1206, {wxRegion, union_1_1, 1}},
+ {1207, {wxRegion, union_1_0, 1}},
+ {1208, {wxRegion, union_3, 3}},
+ {1209, {wxRegion, xor_4, 4}},
+ {1210, {wxRegion, xor_1_1, 1}},
+ {1211, {wxRegion, xor_1_0, 1}},
+ {1212, {wxAcceleratorTable, new_0, 0}},
+ {1213, {wxAcceleratorTable, new_2, 2}},
+ {1214, {wxAcceleratorTable, destruct, 0}},
+ {1215, {wxAcceleratorTable, ok, 0}},
+ {1216, {wxAcceleratorEntry, new_1_0, 1}},
+ {1217, {wxAcceleratorEntry, new_1_1, 1}},
+ {1218, {wxAcceleratorEntry, getCommand, 0}},
+ {1219, {wxAcceleratorEntry, getFlags, 0}},
+ {1220, {wxAcceleratorEntry, getKeyCode, 0}},
+ {1221, {wxAcceleratorEntry, set, 4}},
+ {1222, {wxAcceleratorEntry, 'Destroy', undefined}},
+ {1227, {wxCaret, new_3, 3}},
+ {1228, {wxCaret, new_2, 2}},
+ {1230, {wxCaret, destruct, 0}},
+ {1231, {wxCaret, create_3, 3}},
+ {1232, {wxCaret, create_2, 2}},
+ {1233, {wxCaret, getBlinkTime, 0}},
+ {1235, {wxCaret, getPosition, 0}},
+ {1237, {wxCaret, getSize, 0}},
+ {1238, {wxCaret, getWindow, 0}},
+ {1239, {wxCaret, hide, 0}},
+ {1240, {wxCaret, isOk, 0}},
+ {1241, {wxCaret, isVisible, 0}},
+ {1242, {wxCaret, move_2, 2}},
+ {1243, {wxCaret, move_1, 1}},
+ {1244, {wxCaret, setBlinkTime, 1}},
+ {1245, {wxCaret, setSize_2, 2}},
+ {1246, {wxCaret, setSize_1, 1}},
+ {1247, {wxCaret, show, 1}},
+ {1248, {wxSizer, add_2_1, 2}},
+ {1249, {wxSizer, add_2_0, 2}},
+ {1250, {wxSizer, add_3, 3}},
+ {1251, {wxSizer, add_2_3, 2}},
+ {1252, {wxSizer, add_2_2, 2}},
+ {1253, {wxSizer, addSpacer, 1}},
+ {1254, {wxSizer, addStretchSpacer, 1}},
+ {1255, {wxSizer, calcMin, 0}},
+ {1256, {wxSizer, clear, 1}},
+ {1257, {wxSizer, detach_1_2, 1}},
+ {1258, {wxSizer, detach_1_1, 1}},
+ {1259, {wxSizer, detach_1_0, 1}},
+ {1260, {wxSizer, fit, 1}},
+ {1261, {wxSizer, fitInside, 1}},
+ {1262, {wxSizer, getChildren, 0}},
+ {1263, {wxSizer, getItem_2_1, 2}},
+ {1264, {wxSizer, getItem_2_0, 2}},
+ {1265, {wxSizer, getItem_1, 1}},
+ {1266, {wxSizer, getSize, 0}},
+ {1267, {wxSizer, getPosition, 0}},
+ {1268, {wxSizer, getMinSize, 0}},
+ {1269, {wxSizer, hide_2_0, 2}},
+ {1270, {wxSizer, hide_2_1, 2}},
+ {1271, {wxSizer, hide_1, 1}},
+ {1272, {wxSizer, insert_3_1, 3}},
+ {1273, {wxSizer, insert_3_0, 3}},
+ {1274, {wxSizer, insert_4, 4}},
+ {1275, {wxSizer, insert_3_3, 3}},
+ {1276, {wxSizer, insert_3_2, 3}},
+ {1277, {wxSizer, insert_2, 2}},
+ {1278, {wxSizer, insertSpacer, 2}},
+ {1279, {wxSizer, insertStretchSpacer, 2}},
+ {1280, {wxSizer, isShown_1_2, 1}},
+ {1281, {wxSizer, isShown_1_1, 1}},
+ {1282, {wxSizer, isShown_1_0, 1}},
+ {1283, {wxSizer, layout, 0}},
+ {1284, {wxSizer, prepend_2_1, 2}},
+ {1285, {wxSizer, prepend_2_0, 2}},
+ {1286, {wxSizer, prepend_3, 3}},
+ {1287, {wxSizer, prepend_2_3, 2}},
+ {1288, {wxSizer, prepend_2_2, 2}},
+ {1289, {wxSizer, prepend_1, 1}},
+ {1290, {wxSizer, prependSpacer, 1}},
+ {1291, {wxSizer, prependStretchSpacer, 1}},
+ {1292, {wxSizer, recalcSizes, 0}},
+ {1293, {wxSizer, remove_1_1, 1}},
+ {1294, {wxSizer, remove_1_0, 1}},
+ {1295, {wxSizer, replace_3_1, 3}},
+ {1296, {wxSizer, replace_3_0, 3}},
+ {1297, {wxSizer, replace_2, 2}},
+ {1298, {wxSizer, setDimension, 4}},
+ {1299, {wxSizer, setMinSize_2, 2}},
+ {1300, {wxSizer, setMinSize_1, 1}},
+ {1301, {wxSizer, setItemMinSize_3_2, 3}},
+ {1302, {wxSizer, setItemMinSize_2_2, 2}},
+ {1303, {wxSizer, setItemMinSize_3_1, 3}},
+ {1304, {wxSizer, setItemMinSize_2_1, 2}},
+ {1305, {wxSizer, setItemMinSize_3_0, 3}},
+ {1306, {wxSizer, setItemMinSize_2_0, 2}},
+ {1307, {wxSizer, setSizeHints, 1}},
+ {1308, {wxSizer, setVirtualSizeHints, 1}},
+ {1309, {wxSizer, show_2_2, 2}},
+ {1310, {wxSizer, show_2_1, 2}},
+ {1311, {wxSizer, show_2_0, 2}},
+ {1312, {wxSizer, show_1, 1}},
+ {1313, {wxSizerFlags, new, 1}},
+ {1314, {wxSizerFlags, align, 1}},
+ {1315, {wxSizerFlags, border_2, 2}},
+ {1316, {wxSizerFlags, border_1, 1}},
+ {1317, {wxSizerFlags, center, 0}},
+ {1318, {wxSizerFlags, centre, 0}},
+ {1319, {wxSizerFlags, expand, 0}},
+ {1320, {wxSizerFlags, left, 0}},
+ {1321, {wxSizerFlags, proportion, 1}},
+ {1322, {wxSizerFlags, right, 0}},
+ {1323, {wxSizerFlags, 'Destroy', undefined}},
+ {1324, {wxSizerItem, new_5_1, 5}},
+ {1325, {wxSizerItem, new_2_1, 2}},
+ {1326, {wxSizerItem, new_5_0, 5}},
+ {1327, {wxSizerItem, new_2_0, 2}},
+ {1328, {wxSizerItem, new_6, 6}},
+ {1329, {wxSizerItem, new_3, 3}},
+ {1330, {wxSizerItem, new_0, 0}},
+ {1331, {wxSizerItem, destruct, 0}},
+ {1332, {wxSizerItem, calcMin, 0}},
+ {1333, {wxSizerItem, deleteWindows, 0}},
+ {1334, {wxSizerItem, detachSizer, 0}},
+ {1335, {wxSizerItem, getBorder, 0}},
+ {1336, {wxSizerItem, getFlag, 0}},
+ {1337, {wxSizerItem, getMinSize, 0}},
+ {1338, {wxSizerItem, getPosition, 0}},
+ {1339, {wxSizerItem, getProportion, 0}},
+ {1340, {wxSizerItem, getRatio, 0}},
+ {1341, {wxSizerItem, getRect, 0}},
+ {1342, {wxSizerItem, getSize, 0}},
+ {1343, {wxSizerItem, getSizer, 0}},
+ {1344, {wxSizerItem, getSpacer, 0}},
+ {1345, {wxSizerItem, getUserData, 0}},
+ {1346, {wxSizerItem, getWindow, 0}},
+ {1347, {wxSizerItem, isSizer, 0}},
+ {1348, {wxSizerItem, isShown, 0}},
+ {1349, {wxSizerItem, isSpacer, 0}},
+ {1350, {wxSizerItem, isWindow, 0}},
+ {1351, {wxSizerItem, setBorder, 1}},
+ {1352, {wxSizerItem, setDimension, 2}},
+ {1353, {wxSizerItem, setFlag, 1}},
+ {1354, {wxSizerItem, setInitSize, 2}},
+ {1355, {wxSizerItem, setMinSize_1, 1}},
+ {1356, {wxSizerItem, setMinSize_2, 2}},
+ {1357, {wxSizerItem, setProportion, 1}},
+ {1358, {wxSizerItem, setRatio_2, 2}},
+ {1359, {wxSizerItem, setRatio_1_1, 1}},
+ {1360, {wxSizerItem, setRatio_1_0, 1}},
+ {1361, {wxSizerItem, setSizer, 1}},
+ {1362, {wxSizerItem, setSpacer_1, 1}},
+ {1363, {wxSizerItem, setSpacer_2, 2}},
+ {1364, {wxSizerItem, setWindow, 1}},
+ {1365, {wxSizerItem, show, 1}},
+ {1366, {wxBoxSizer, new, 1}},
+ {1367, {wxBoxSizer, getOrientation, 0}},
+ {1368, {wxBoxSizer, 'Destroy', undefined}},
+ {1369, {wxStaticBoxSizer, new_2, 2}},
+ {1370, {wxStaticBoxSizer, new_3, 3}},
+ {1371, {wxStaticBoxSizer, getStaticBox, 0}},
+ {1372, {wxStaticBoxSizer, 'Destroy', undefined}},
+ {1373, {wxGridSizer, new_4, 4}},
+ {1374, {wxGridSizer, new_2, 2}},
+ {1375, {wxGridSizer, getCols, 0}},
+ {1376, {wxGridSizer, getHGap, 0}},
+ {1377, {wxGridSizer, getRows, 0}},
+ {1378, {wxGridSizer, getVGap, 0}},
+ {1379, {wxGridSizer, setCols, 1}},
+ {1380, {wxGridSizer, setHGap, 1}},
+ {1381, {wxGridSizer, setRows, 1}},
+ {1382, {wxGridSizer, setVGap, 1}},
+ {1383, {wxGridSizer, 'Destroy', undefined}},
+ {1384, {wxFlexGridSizer, new_4, 4}},
+ {1385, {wxFlexGridSizer, new_2, 2}},
+ {1386, {wxFlexGridSizer, addGrowableCol, 2}},
+ {1387, {wxFlexGridSizer, addGrowableRow, 2}},
+ {1388, {wxFlexGridSizer, getFlexibleDirection, 0}},
+ {1389, {wxFlexGridSizer, getNonFlexibleGrowMode, 0}},
+ {1390, {wxFlexGridSizer, removeGrowableCol, 1}},
+ {1391, {wxFlexGridSizer, removeGrowableRow, 1}},
+ {1392, {wxFlexGridSizer, setFlexibleDirection, 1}},
+ {1393, {wxFlexGridSizer, setNonFlexibleGrowMode, 1}},
+ {1394, {wxFlexGridSizer, 'Destroy', undefined}},
+ {1395, {wxGridBagSizer, new, 1}},
+ {1396, {wxGridBagSizer, add_3_2, 3}},
+ {1397, {wxGridBagSizer, add_3_1, 3}},
+ {1398, {wxGridBagSizer, add_4, 4}},
+ {1399, {wxGridBagSizer, add_1_0, 1}},
+ {1400, {wxGridBagSizer, add_2_1, 2}},
+ {1401, {wxGridBagSizer, add_2_0, 2}},
+ {1402, {wxGridBagSizer, add_3_0, 3}},
+ {1403, {wxGridBagSizer, add_1_1, 1}},
+ {1404, {wxGridBagSizer, calcMin, 0}},
+ {1405, {wxGridBagSizer, checkForIntersection_2, 2}},
+ {1406, {wxGridBagSizer, checkForIntersection_3, 3}},
+ {1407, {wxGridBagSizer, findItem_1_1, 1}},
+ {1408, {wxGridBagSizer, findItem_1_0, 1}},
+ {1409, {wxGridBagSizer, findItemAtPoint, 1}},
+ {1410, {wxGridBagSizer, findItemAtPosition, 1}},
+ {1411, {wxGridBagSizer, findItemWithData, 1}},
+ {1412, {wxGridBagSizer, getCellSize, 2}},
+ {1413, {wxGridBagSizer, getEmptyCellSize, 0}},
+ {1414, {wxGridBagSizer, getItemPosition_1_2, 1}},
+ {1415, {wxGridBagSizer, getItemPosition_1_1, 1}},
+ {1416, {wxGridBagSizer, getItemPosition_1_0, 1}},
+ {1417, {wxGridBagSizer, getItemSpan_1_2, 1}},
+ {1418, {wxGridBagSizer, getItemSpan_1_1, 1}},
+ {1419, {wxGridBagSizer, getItemSpan_1_0, 1}},
+ {1420, {wxGridBagSizer, setEmptyCellSize, 1}},
+ {1421, {wxGridBagSizer, setItemPosition_2_2, 2}},
+ {1422, {wxGridBagSizer, setItemPosition_2_1, 2}},
+ {1423, {wxGridBagSizer, setItemPosition_2_0, 2}},
+ {1424, {wxGridBagSizer, setItemSpan_2_2, 2}},
+ {1425, {wxGridBagSizer, setItemSpan_2_1, 2}},
+ {1426, {wxGridBagSizer, setItemSpan_2_0, 2}},
+ {1427, {wxGridBagSizer, 'Destroy', undefined}},
+ {1428, {wxStdDialogButtonSizer, new, 0}},
+ {1429, {wxStdDialogButtonSizer, addButton, 1}},
+ {1430, {wxStdDialogButtonSizer, realize, 0}},
+ {1431, {wxStdDialogButtonSizer, setAffirmativeButton, 1}},
+ {1432, {wxStdDialogButtonSizer, setCancelButton, 1}},
+ {1433, {wxStdDialogButtonSizer, setNegativeButton, 1}},
+ {1434, {wxStdDialogButtonSizer, 'Destroy', undefined}},
+ {1435, {wxFont, new_0, 0}},
+ {1436, {wxFont, new_1, 1}},
+ {1437, {wxFont, new_5, 5}},
+ {1439, {wxFont, destruct, 0}},
+ {1440, {wxFont, isFixedWidth, 0}},
+ {1441, {wxFont, getDefaultEncoding, 0}},
+ {1442, {wxFont, getFaceName, 0}},
+ {1443, {wxFont, getFamily, 0}},
+ {1444, {wxFont, getNativeFontInfoDesc, 0}},
+ {1445, {wxFont, getNativeFontInfoUserDesc, 0}},
+ {1446, {wxFont, getPointSize, 0}},
+ {1447, {wxFont, getStyle, 0}},
+ {1448, {wxFont, getUnderlined, 0}},
+ {1449, {wxFont, getWeight, 0}},
+ {1450, {wxFont, ok, 0}},
+ {1451, {wxFont, setDefaultEncoding, 1}},
+ {1452, {wxFont, setFaceName, 1}},
+ {1453, {wxFont, setFamily, 1}},
+ {1454, {wxFont, setPointSize, 1}},
+ {1455, {wxFont, setStyle, 1}},
+ {1456, {wxFont, setUnderlined, 1}},
+ {1457, {wxFont, setWeight, 1}},
+ {1458, {wxToolTip, enable, 1}},
+ {1459, {wxToolTip, setDelay, 1}},
+ {1460, {wxToolTip, new, 1}},
+ {1461, {wxToolTip, setTip, 1}},
+ {1462, {wxToolTip, getTip, 0}},
+ {1463, {wxToolTip, getWindow, 0}},
+ {1464, {wxToolTip, 'Destroy', undefined}},
+ {1466, {wxButton, new_3, 3}},
+ {1467, {wxButton, new_0, 0}},
+ {1468, {wxButton, destruct, 0}},
+ {1469, {wxButton, create, 3}},
+ {1470, {wxButton, getDefaultSize, 0}},
+ {1471, {wxButton, setDefault, 0}},
+ {1472, {wxButton, setLabel, 1}},
+ {1474, {wxBitmapButton, new_4, 4}},
+ {1475, {wxBitmapButton, new_0, 0}},
+ {1476, {wxBitmapButton, create, 4}},
+ {1477, {wxBitmapButton, getBitmapDisabled, 0}},
+ {1479, {wxBitmapButton, getBitmapFocus, 0}},
+ {1481, {wxBitmapButton, getBitmapLabel, 0}},
+ {1483, {wxBitmapButton, getBitmapSelected, 0}},
+ {1485, {wxBitmapButton, setBitmapDisabled, 1}},
+ {1486, {wxBitmapButton, setBitmapFocus, 1}},
+ {1487, {wxBitmapButton, setBitmapLabel, 1}},
+ {1488, {wxBitmapButton, setBitmapSelected, 1}},
+ {1489, {wxBitmapButton, 'Destroy', undefined}},
+ {1490, {wxToggleButton, new_0, 0}},
+ {1491, {wxToggleButton, new_4, 4}},
+ {1492, {wxToggleButton, create, 4}},
+ {1493, {wxToggleButton, getValue, 0}},
+ {1494, {wxToggleButton, setValue, 1}},
+ {1495, {wxToggleButton, 'Destroy', undefined}},
+ {1496, {wxCalendarCtrl, new_0, 0}},
+ {1497, {wxCalendarCtrl, new_3, 3}},
+ {1498, {wxCalendarCtrl, create, 3}},
+ {1499, {wxCalendarCtrl, destruct, 0}},
+ {1500, {wxCalendarCtrl, setDate, 1}},
+ {1501, {wxCalendarCtrl, getDate, 0}},
+ {1502, {wxCalendarCtrl, enableYearChange, 1}},
+ {1503, {wxCalendarCtrl, enableMonthChange, 1}},
+ {1504, {wxCalendarCtrl, enableHolidayDisplay, 1}},
+ {1505, {wxCalendarCtrl, setHeaderColours, 2}},
+ {1506, {wxCalendarCtrl, getHeaderColourFg, 0}},
+ {1507, {wxCalendarCtrl, getHeaderColourBg, 0}},
+ {1508, {wxCalendarCtrl, setHighlightColours, 2}},
+ {1509, {wxCalendarCtrl, getHighlightColourFg, 0}},
+ {1510, {wxCalendarCtrl, getHighlightColourBg, 0}},
+ {1511, {wxCalendarCtrl, setHolidayColours, 2}},
+ {1512, {wxCalendarCtrl, getHolidayColourFg, 0}},
+ {1513, {wxCalendarCtrl, getHolidayColourBg, 0}},
+ {1514, {wxCalendarCtrl, getAttr, 1}},
+ {1515, {wxCalendarCtrl, setAttr, 2}},
+ {1516, {wxCalendarCtrl, setHoliday, 1}},
+ {1517, {wxCalendarCtrl, resetAttr, 1}},
+ {1518, {wxCalendarCtrl, hitTest, 2}},
+ {1519, {wxCalendarDateAttr, new_0, 0}},
+ {1520, {wxCalendarDateAttr, new_2_1, 2}},
+ {1521, {wxCalendarDateAttr, new_2_0, 2}},
+ {1522, {wxCalendarDateAttr, setTextColour, 1}},
+ {1523, {wxCalendarDateAttr, setBackgroundColour, 1}},
+ {1524, {wxCalendarDateAttr, setBorderColour, 1}},
+ {1525, {wxCalendarDateAttr, setFont, 1}},
+ {1526, {wxCalendarDateAttr, setBorder, 1}},
+ {1527, {wxCalendarDateAttr, setHoliday, 1}},
+ {1528, {wxCalendarDateAttr, hasTextColour, 0}},
+ {1529, {wxCalendarDateAttr, hasBackgroundColour, 0}},
+ {1530, {wxCalendarDateAttr, hasBorderColour, 0}},
+ {1531, {wxCalendarDateAttr, hasFont, 0}},
+ {1532, {wxCalendarDateAttr, hasBorder, 0}},
+ {1533, {wxCalendarDateAttr, isHoliday, 0}},
+ {1534, {wxCalendarDateAttr, getTextColour, 0}},
+ {1535, {wxCalendarDateAttr, getBackgroundColour, 0}},
+ {1536, {wxCalendarDateAttr, getBorderColour, 0}},
+ {1537, {wxCalendarDateAttr, getFont, 0}},
+ {1538, {wxCalendarDateAttr, getBorder, 0}},
+ {1539, {wxCalendarDateAttr, 'Destroy', undefined}},
+ {1541, {wxCheckBox, new_4, 4}},
+ {1542, {wxCheckBox, new_0, 0}},
+ {1543, {wxCheckBox, create, 4}},
+ {1544, {wxCheckBox, getValue, 0}},
+ {1545, {wxCheckBox, get3StateValue, 0}},
+ {1546, {wxCheckBox, is3rdStateAllowedForUser, 0}},
+ {1547, {wxCheckBox, is3State, 0}},
+ {1548, {wxCheckBox, isChecked, 0}},
+ {1549, {wxCheckBox, setValue, 1}},
+ {1550, {wxCheckBox, set3StateValue, 1}},
+ {1551, {wxCheckBox, 'Destroy', undefined}},
+ {1552, {wxCheckListBox, new_0, 0}},
+ {1554, {wxCheckListBox, new_3, 3}},
+ {1555, {wxCheckListBox, check, 2}},
+ {1556, {wxCheckListBox, isChecked, 1}},
+ {1557, {wxCheckListBox, 'Destroy', undefined}},
+ {1560, {wxChoice, new_3, 3}},
+ {1561, {wxChoice, new_0, 0}},
+ {1563, {wxChoice, destruct, 0}},
+ {1565, {wxChoice, create, 6}},
+ {1566, {wxChoice, delete, 1}},
+ {1567, {wxChoice, getColumns, 0}},
+ {1568, {wxChoice, setColumns, 1}},
+ {1569, {wxComboBox, new_0, 0}},
+ {1571, {wxComboBox, new_3, 3}},
+ {1572, {wxComboBox, destruct, 0}},
+ {1574, {wxComboBox, create, 7}},
+ {1575, {wxComboBox, canCopy, 0}},
+ {1576, {wxComboBox, canCut, 0}},
+ {1577, {wxComboBox, canPaste, 0}},
+ {1578, {wxComboBox, canRedo, 0}},
+ {1579, {wxComboBox, canUndo, 0}},
+ {1580, {wxComboBox, copy, 0}},
+ {1581, {wxComboBox, cut, 0}},
+ {1582, {wxComboBox, getInsertionPoint, 0}},
+ {1583, {wxComboBox, getLastPosition, 0}},
+ {1584, {wxComboBox, getValue, 0}},
+ {1585, {wxComboBox, paste, 0}},
+ {1586, {wxComboBox, redo, 0}},
+ {1587, {wxComboBox, replace, 3}},
+ {1588, {wxComboBox, remove, 2}},
+ {1589, {wxComboBox, setInsertionPoint, 1}},
+ {1590, {wxComboBox, setInsertionPointEnd, 0}},
+ {1591, {wxComboBox, setSelection_1, 1}},
+ {1592, {wxComboBox, setSelection_2, 2}},
+ {1593, {wxComboBox, setValue, 1}},
+ {1594, {wxComboBox, undo, 0}},
+ {1595, {wxGauge, new_0, 0}},
+ {1596, {wxGauge, new_4, 4}},
+ {1597, {wxGauge, create, 4}},
+ {1598, {wxGauge, getBezelFace, 0}},
+ {1599, {wxGauge, getRange, 0}},
+ {1600, {wxGauge, getShadowWidth, 0}},
+ {1601, {wxGauge, getValue, 0}},
+ {1602, {wxGauge, isVertical, 0}},
+ {1603, {wxGauge, setBezelFace, 1}},
+ {1604, {wxGauge, setRange, 1}},
+ {1605, {wxGauge, setShadowWidth, 1}},
+ {1606, {wxGauge, setValue, 1}},
+ {1607, {wxGauge, pulse, 0}},
+ {1608, {wxGauge, 'Destroy', undefined}},
+ {1609, {wxGenericDirCtrl, new_0, 0}},
+ {1610, {wxGenericDirCtrl, new_2, 2}},
+ {1611, {wxGenericDirCtrl, destruct, 0}},
+ {1612, {wxGenericDirCtrl, create, 2}},
+ {1613, {wxGenericDirCtrl, init, 0}},
+ {1614, {wxGenericDirCtrl, collapseTree, 0}},
+ {1615, {wxGenericDirCtrl, expandPath, 1}},
+ {1616, {wxGenericDirCtrl, getDefaultPath, 0}},
+ {1617, {wxGenericDirCtrl, getPath, 0}},
+ {1618, {wxGenericDirCtrl, getFilePath, 0}},
+ {1619, {wxGenericDirCtrl, getFilter, 0}},
+ {1620, {wxGenericDirCtrl, getFilterIndex, 0}},
+ {1621, {wxGenericDirCtrl, getRootId, 0}},
+ {1622, {wxGenericDirCtrl, getTreeCtrl, 0}},
+ {1623, {wxGenericDirCtrl, reCreateTree, 0}},
+ {1624, {wxGenericDirCtrl, setDefaultPath, 1}},
+ {1625, {wxGenericDirCtrl, setFilter, 1}},
+ {1626, {wxGenericDirCtrl, setFilterIndex, 1}},
+ {1627, {wxGenericDirCtrl, setPath, 1}},
+ {1629, {wxStaticBox, new_4, 4}},
+ {1630, {wxStaticBox, new_0, 0}},
+ {1631, {wxStaticBox, create, 4}},
+ {1632, {wxStaticBox, 'Destroy', undefined}},
+ {1634, {wxStaticLine, new_2, 2}},
+ {1635, {wxStaticLine, new_0, 0}},
+ {1636, {wxStaticLine, create, 2}},
+ {1637, {wxStaticLine, isVertical, 0}},
+ {1638, {wxStaticLine, getDefaultSize, 0}},
+ {1639, {wxStaticLine, 'Destroy', undefined}},
+ {1642, {wxListBox, new_3, 3}},
+ {1643, {wxListBox, new_0, 0}},
+ {1645, {wxListBox, destruct, 0}},
+ {1647, {wxListBox, create, 6}},
+ {1648, {wxListBox, deselect, 1}},
+ {1649, {wxListBox, getSelections, 1}},
+ {1650, {wxListBox, insertItems, 2}},
+ {1651, {wxListBox, isSelected, 1}},
+ {1653, {wxListBox, set, 2}},
+ {1654, {wxListBox, hitTest, 1}},
+ {1655, {wxListBox, setFirstItem_1_0, 1}},
+ {1656, {wxListBox, setFirstItem_1_1, 1}},
+ {1657, {wxListCtrl, new_0, 0}},
+ {1658, {wxListCtrl, new_2, 2}},
+ {1659, {wxListCtrl, arrange, 1}},
+ {1660, {wxListCtrl, assignImageList, 2}},
+ {1661, {wxListCtrl, clearAll, 0}},
+ {1662, {wxListCtrl, create, 2}},
+ {1663, {wxListCtrl, deleteAllItems, 0}},
+ {1664, {wxListCtrl, deleteColumn, 1}},
+ {1665, {wxListCtrl, deleteItem, 1}},
+ {1666, {wxListCtrl, editLabel, 1}},
+ {1667, {wxListCtrl, ensureVisible, 1}},
+ {1668, {wxListCtrl, findItem_3_0, 3}},
+ {1669, {wxListCtrl, findItem_3_1, 3}},
+ {1670, {wxListCtrl, getColumn, 2}},
+ {1671, {wxListCtrl, getColumnCount, 0}},
+ {1672, {wxListCtrl, getColumnWidth, 1}},
+ {1673, {wxListCtrl, getCountPerPage, 0}},
+ {1674, {wxListCtrl, getEditControl, 0}},
+ {1675, {wxListCtrl, getImageList, 1}},
+ {1676, {wxListCtrl, getItem, 1}},
+ {1677, {wxListCtrl, getItemBackgroundColour, 1}},
+ {1678, {wxListCtrl, getItemCount, 0}},
+ {1679, {wxListCtrl, getItemData, 1}},
+ {1680, {wxListCtrl, getItemFont, 1}},
+ {1681, {wxListCtrl, getItemPosition, 2}},
+ {1682, {wxListCtrl, getItemRect, 3}},
+ {1683, {wxListCtrl, getItemSpacing, 0}},
+ {1684, {wxListCtrl, getItemState, 2}},
+ {1685, {wxListCtrl, getItemText, 1}},
+ {1686, {wxListCtrl, getItemTextColour, 1}},
+ {1687, {wxListCtrl, getNextItem, 2}},
+ {1688, {wxListCtrl, getSelectedItemCount, 0}},
+ {1689, {wxListCtrl, getTextColour, 0}},
+ {1690, {wxListCtrl, getTopItem, 0}},
+ {1691, {wxListCtrl, getViewRect, 0}},
+ {1692, {wxListCtrl, hitTest, 2}},
+ {1693, {wxListCtrl, insertColumn_2, 2}},
+ {1694, {wxListCtrl, insertColumn_3, 3}},
+ {1695, {wxListCtrl, insertItem_1, 1}},
+ {1696, {wxListCtrl, insertItem_2_1, 2}},
+ {1697, {wxListCtrl, insertItem_2_0, 2}},
+ {1698, {wxListCtrl, insertItem_3, 3}},
+ {1699, {wxListCtrl, refreshItem, 1}},
+ {1700, {wxListCtrl, refreshItems, 2}},
+ {1701, {wxListCtrl, scrollList, 2}},
+ {1702, {wxListCtrl, setBackgroundColour, 1}},
+ {1703, {wxListCtrl, setColumn, 2}},
+ {1704, {wxListCtrl, setColumnWidth, 2}},
+ {1705, {wxListCtrl, setImageList, 2}},
+ {1706, {wxListCtrl, setItem_1, 1}},
+ {1707, {wxListCtrl, setItem_4, 4}},
+ {1708, {wxListCtrl, setItemBackgroundColour, 2}},
+ {1709, {wxListCtrl, setItemCount, 1}},
+ {1710, {wxListCtrl, setItemData, 2}},
+ {1711, {wxListCtrl, setItemFont, 2}},
+ {1712, {wxListCtrl, setItemImage, 3}},
+ {1713, {wxListCtrl, setItemColumnImage, 3}},
+ {1714, {wxListCtrl, setItemPosition, 2}},
+ {1715, {wxListCtrl, setItemState, 3}},
+ {1716, {wxListCtrl, setItemText, 2}},
+ {1717, {wxListCtrl, setItemTextColour, 2}},
+ {1718, {wxListCtrl, setSingleStyle, 2}},
+ {1719, {wxListCtrl, setTextColour, 1}},
+ {1720, {wxListCtrl, setWindowStyleFlag, 1}},
+ {1721, {wxListCtrl, sortItems, 2}},
+ {1722, {wxListCtrl, 'Destroy', undefined}},
+ {1723, {wxListView, clearColumnImage, 1}},
+ {1724, {wxListView, focus, 1}},
+ {1725, {wxListView, getFirstSelected, 0}},
+ {1726, {wxListView, getFocusedItem, 0}},
+ {1727, {wxListView, getNextSelected, 1}},
+ {1728, {wxListView, isSelected, 1}},
+ {1729, {wxListView, select, 2}},
+ {1730, {wxListView, setColumnImage, 2}},
+ {1731, {wxListItem, new_0, 0}},
+ {1732, {wxListItem, new_1, 1}},
+ {1733, {wxListItem, destruct, 0}},
+ {1734, {wxListItem, clear, 0}},
+ {1735, {wxListItem, getAlign, 0}},
+ {1736, {wxListItem, getBackgroundColour, 0}},
+ {1737, {wxListItem, getColumn, 0}},
+ {1738, {wxListItem, getFont, 0}},
+ {1739, {wxListItem, getId, 0}},
+ {1740, {wxListItem, getImage, 0}},
+ {1741, {wxListItem, getMask, 0}},
+ {1742, {wxListItem, getState, 0}},
+ {1743, {wxListItem, getText, 0}},
+ {1744, {wxListItem, getTextColour, 0}},
+ {1745, {wxListItem, getWidth, 0}},
+ {1746, {wxListItem, setAlign, 1}},
+ {1747, {wxListItem, setBackgroundColour, 1}},
+ {1748, {wxListItem, setColumn, 1}},
+ {1749, {wxListItem, setFont, 1}},
+ {1750, {wxListItem, setId, 1}},
+ {1751, {wxListItem, setImage, 1}},
+ {1752, {wxListItem, setMask, 1}},
+ {1753, {wxListItem, setState, 1}},
+ {1754, {wxListItem, setStateMask, 1}},
+ {1755, {wxListItem, setText, 1}},
+ {1756, {wxListItem, setTextColour, 1}},
+ {1757, {wxListItem, setWidth, 1}},
+ {1758, {wxListItemAttr, new_0, 0}},
+ {1759, {wxListItemAttr, new_3, 3}},
+ {1760, {wxListItemAttr, getBackgroundColour, 0}},
+ {1761, {wxListItemAttr, getFont, 0}},
+ {1762, {wxListItemAttr, getTextColour, 0}},
+ {1763, {wxListItemAttr, hasBackgroundColour, 0}},
+ {1764, {wxListItemAttr, hasFont, 0}},
+ {1765, {wxListItemAttr, hasTextColour, 0}},
+ {1766, {wxListItemAttr, setBackgroundColour, 1}},
+ {1767, {wxListItemAttr, setFont, 1}},
+ {1768, {wxListItemAttr, setTextColour, 1}},
+ {1769, {wxListItemAttr, 'Destroy', undefined}},
+ {1770, {wxImageList, new_0, 0}},
+ {1771, {wxImageList, new_3, 3}},
+ {1772, {wxImageList, add_1, 1}},
+ {1773, {wxImageList, add_2_0, 2}},
+ {1774, {wxImageList, add_2_1, 2}},
+ {1775, {wxImageList, create, 3}},
+ {1777, {wxImageList, draw, 5}},
+ {1778, {wxImageList, getBitmap, 1}},
+ {1779, {wxImageList, getIcon, 1}},
+ {1780, {wxImageList, getImageCount, 0}},
+ {1781, {wxImageList, getSize, 3}},
+ {1782, {wxImageList, remove, 1}},
+ {1783, {wxImageList, removeAll, 0}},
+ {1784, {wxImageList, replace_2, 2}},
+ {1785, {wxImageList, replace_3, 3}},
+ {1786, {wxImageList, 'Destroy', undefined}},
+ {1787, {wxTextAttr, new_0, 0}},
+ {1788, {wxTextAttr, new_2, 2}},
+ {1789, {wxTextAttr, getAlignment, 0}},
+ {1790, {wxTextAttr, getBackgroundColour, 0}},
+ {1791, {wxTextAttr, getFont, 0}},
+ {1792, {wxTextAttr, getLeftIndent, 0}},
+ {1793, {wxTextAttr, getLeftSubIndent, 0}},
+ {1794, {wxTextAttr, getRightIndent, 0}},
+ {1795, {wxTextAttr, getTabs, 0}},
+ {1796, {wxTextAttr, getTextColour, 0}},
+ {1797, {wxTextAttr, hasBackgroundColour, 0}},
+ {1798, {wxTextAttr, hasFont, 0}},
+ {1799, {wxTextAttr, hasTextColour, 0}},
+ {1800, {wxTextAttr, getFlags, 0}},
+ {1801, {wxTextAttr, isDefault, 0}},
+ {1802, {wxTextAttr, setAlignment, 1}},
+ {1803, {wxTextAttr, setBackgroundColour, 1}},
+ {1804, {wxTextAttr, setFlags, 1}},
+ {1805, {wxTextAttr, setFont, 2}},
+ {1806, {wxTextAttr, setLeftIndent, 2}},
+ {1807, {wxTextAttr, setRightIndent, 1}},
+ {1808, {wxTextAttr, setTabs, 1}},
+ {1809, {wxTextAttr, setTextColour, 1}},
+ {1810, {wxTextAttr, 'Destroy', undefined}},
+ {1812, {wxTextCtrl, new_3, 3}},
+ {1813, {wxTextCtrl, new_0, 0}},
+ {1815, {wxTextCtrl, destruct, 0}},
+ {1816, {wxTextCtrl, appendText, 1}},
+ {1817, {wxTextCtrl, canCopy, 0}},
+ {1818, {wxTextCtrl, canCut, 0}},
+ {1819, {wxTextCtrl, canPaste, 0}},
+ {1820, {wxTextCtrl, canRedo, 0}},
+ {1821, {wxTextCtrl, canUndo, 0}},
+ {1822, {wxTextCtrl, clear, 0}},
+ {1823, {wxTextCtrl, copy, 0}},
+ {1824, {wxTextCtrl, create, 3}},
+ {1825, {wxTextCtrl, cut, 0}},
+ {1826, {wxTextCtrl, discardEdits, 0}},
+ {1827, {wxTextCtrl, emulateKeyPress, 1}},
+ {1828, {wxTextCtrl, getDefaultStyle, 0}},
+ {1829, {wxTextCtrl, getInsertionPoint, 0}},
+ {1830, {wxTextCtrl, getLastPosition, 0}},
+ {1831, {wxTextCtrl, getLineLength, 1}},
+ {1832, {wxTextCtrl, getLineText, 1}},
+ {1833, {wxTextCtrl, getNumberOfLines, 0}},
+ {1834, {wxTextCtrl, getRange, 2}},
+ {1835, {wxTextCtrl, getSelection, 2}},
+ {1836, {wxTextCtrl, getStringSelection, 0}},
+ {1837, {wxTextCtrl, getStyle, 2}},
+ {1838, {wxTextCtrl, getValue, 0}},
+ {1839, {wxTextCtrl, isEditable, 0}},
+ {1840, {wxTextCtrl, isModified, 0}},
+ {1841, {wxTextCtrl, isMultiLine, 0}},
+ {1842, {wxTextCtrl, isSingleLine, 0}},
+ {1843, {wxTextCtrl, loadFile, 2}},
+ {1844, {wxTextCtrl, markDirty, 0}},
+ {1845, {wxTextCtrl, paste, 0}},
+ {1846, {wxTextCtrl, positionToXY, 3}},
+ {1847, {wxTextCtrl, redo, 0}},
+ {1848, {wxTextCtrl, remove, 2}},
+ {1849, {wxTextCtrl, replace, 3}},
+ {1850, {wxTextCtrl, saveFile, 1}},
+ {1851, {wxTextCtrl, setDefaultStyle, 1}},
+ {1852, {wxTextCtrl, setEditable, 1}},
+ {1853, {wxTextCtrl, setInsertionPoint, 1}},
+ {1854, {wxTextCtrl, setInsertionPointEnd, 0}},
+ {1856, {wxTextCtrl, setMaxLength, 1}},
+ {1857, {wxTextCtrl, setSelection, 2}},
+ {1858, {wxTextCtrl, setStyle, 3}},
+ {1859, {wxTextCtrl, setValue, 1}},
+ {1860, {wxTextCtrl, showPosition, 1}},
+ {1861, {wxTextCtrl, undo, 0}},
+ {1862, {wxTextCtrl, writeText, 1}},
+ {1863, {wxTextCtrl, xYToPosition, 2}},
+ {1866, {wxNotebook, new_0, 0}},
+ {1867, {wxNotebook, new_3, 3}},
+ {1868, {wxNotebook, destruct, 0}},
+ {1869, {wxNotebook, addPage, 3}},
+ {1870, {wxNotebook, advanceSelection, 1}},
+ {1871, {wxNotebook, assignImageList, 1}},
+ {1872, {wxNotebook, create, 3}},
+ {1873, {wxNotebook, deleteAllPages, 0}},
+ {1874, {wxNotebook, deletePage, 1}},
+ {1875, {wxNotebook, removePage, 1}},
+ {1876, {wxNotebook, getCurrentPage, 0}},
+ {1877, {wxNotebook, getImageList, 0}},
+ {1879, {wxNotebook, getPage, 1}},
+ {1880, {wxNotebook, getPageCount, 0}},
+ {1881, {wxNotebook, getPageImage, 1}},
+ {1882, {wxNotebook, getPageText, 1}},
+ {1883, {wxNotebook, getRowCount, 0}},
+ {1884, {wxNotebook, getSelection, 0}},
+ {1885, {wxNotebook, getThemeBackgroundColour, 0}},
+ {1887, {wxNotebook, hitTest, 2}},
+ {1889, {wxNotebook, insertPage, 4}},
+ {1890, {wxNotebook, setImageList, 1}},
+ {1891, {wxNotebook, setPadding, 1}},
+ {1892, {wxNotebook, setPageSize, 1}},
+ {1893, {wxNotebook, setPageImage, 2}},
+ {1894, {wxNotebook, setPageText, 2}},
+ {1895, {wxNotebook, setSelection, 1}},
+ {1896, {wxNotebook, changeSelection, 1}},
+ {1897, {wxChoicebook, new_0, 0}},
+ {1898, {wxChoicebook, new_3, 3}},
+ {1899, {wxChoicebook, addPage, 3}},
+ {1900, {wxChoicebook, advanceSelection, 1}},
+ {1901, {wxChoicebook, assignImageList, 1}},
+ {1902, {wxChoicebook, create, 3}},
+ {1903, {wxChoicebook, deleteAllPages, 0}},
+ {1904, {wxChoicebook, deletePage, 1}},
+ {1905, {wxChoicebook, removePage, 1}},
+ {1906, {wxChoicebook, getCurrentPage, 0}},
+ {1907, {wxChoicebook, getImageList, 0}},
+ {1909, {wxChoicebook, getPage, 1}},
+ {1910, {wxChoicebook, getPageCount, 0}},
+ {1911, {wxChoicebook, getPageImage, 1}},
+ {1912, {wxChoicebook, getPageText, 1}},
+ {1913, {wxChoicebook, getSelection, 0}},
+ {1914, {wxChoicebook, hitTest, 2}},
+ {1915, {wxChoicebook, insertPage, 4}},
+ {1916, {wxChoicebook, setImageList, 1}},
+ {1917, {wxChoicebook, setPageSize, 1}},
+ {1918, {wxChoicebook, setPageImage, 2}},
+ {1919, {wxChoicebook, setPageText, 2}},
+ {1920, {wxChoicebook, setSelection, 1}},
+ {1921, {wxChoicebook, changeSelection, 1}},
+ {1922, {wxChoicebook, 'Destroy', undefined}},
+ {1923, {wxToolbook, new_0, 0}},
+ {1924, {wxToolbook, new_3, 3}},
+ {1925, {wxToolbook, addPage, 3}},
+ {1926, {wxToolbook, advanceSelection, 1}},
+ {1927, {wxToolbook, assignImageList, 1}},
+ {1928, {wxToolbook, create, 3}},
+ {1929, {wxToolbook, deleteAllPages, 0}},
+ {1930, {wxToolbook, deletePage, 1}},
+ {1931, {wxToolbook, removePage, 1}},
+ {1932, {wxToolbook, getCurrentPage, 0}},
+ {1933, {wxToolbook, getImageList, 0}},
+ {1935, {wxToolbook, getPage, 1}},
+ {1936, {wxToolbook, getPageCount, 0}},
+ {1937, {wxToolbook, getPageImage, 1}},
+ {1938, {wxToolbook, getPageText, 1}},
+ {1939, {wxToolbook, getSelection, 0}},
+ {1941, {wxToolbook, hitTest, 2}},
+ {1942, {wxToolbook, insertPage, 4}},
+ {1943, {wxToolbook, setImageList, 1}},
+ {1944, {wxToolbook, setPageSize, 1}},
+ {1945, {wxToolbook, setPageImage, 2}},
+ {1946, {wxToolbook, setPageText, 2}},
+ {1947, {wxToolbook, setSelection, 1}},
+ {1948, {wxToolbook, changeSelection, 1}},
+ {1949, {wxToolbook, 'Destroy', undefined}},
+ {1950, {wxListbook, new_0, 0}},
+ {1951, {wxListbook, new_3, 3}},
+ {1952, {wxListbook, addPage, 3}},
+ {1953, {wxListbook, advanceSelection, 1}},
+ {1954, {wxListbook, assignImageList, 1}},
+ {1955, {wxListbook, create, 3}},
+ {1956, {wxListbook, deleteAllPages, 0}},
+ {1957, {wxListbook, deletePage, 1}},
+ {1958, {wxListbook, removePage, 1}},
+ {1959, {wxListbook, getCurrentPage, 0}},
+ {1960, {wxListbook, getImageList, 0}},
+ {1962, {wxListbook, getPage, 1}},
+ {1963, {wxListbook, getPageCount, 0}},
+ {1964, {wxListbook, getPageImage, 1}},
+ {1965, {wxListbook, getPageText, 1}},
+ {1966, {wxListbook, getSelection, 0}},
+ {1968, {wxListbook, hitTest, 2}},
+ {1969, {wxListbook, insertPage, 4}},
+ {1970, {wxListbook, setImageList, 1}},
+ {1971, {wxListbook, setPageSize, 1}},
+ {1972, {wxListbook, setPageImage, 2}},
+ {1973, {wxListbook, setPageText, 2}},
+ {1974, {wxListbook, setSelection, 1}},
+ {1975, {wxListbook, changeSelection, 1}},
+ {1976, {wxListbook, 'Destroy', undefined}},
+ {1977, {wxTreebook, new_0, 0}},
+ {1978, {wxTreebook, new_3, 3}},
+ {1979, {wxTreebook, addPage, 3}},
+ {1980, {wxTreebook, advanceSelection, 1}},
+ {1981, {wxTreebook, assignImageList, 1}},
+ {1982, {wxTreebook, create, 3}},
+ {1983, {wxTreebook, deleteAllPages, 0}},
+ {1984, {wxTreebook, deletePage, 1}},
+ {1985, {wxTreebook, removePage, 1}},
+ {1986, {wxTreebook, getCurrentPage, 0}},
+ {1987, {wxTreebook, getImageList, 0}},
+ {1989, {wxTreebook, getPage, 1}},
+ {1990, {wxTreebook, getPageCount, 0}},
+ {1991, {wxTreebook, getPageImage, 1}},
+ {1992, {wxTreebook, getPageText, 1}},
+ {1993, {wxTreebook, getSelection, 0}},
+ {1994, {wxTreebook, expandNode, 2}},
+ {1995, {wxTreebook, isNodeExpanded, 1}},
+ {1997, {wxTreebook, hitTest, 2}},
+ {1998, {wxTreebook, insertPage, 4}},
+ {1999, {wxTreebook, insertSubPage, 4}},
+ {2000, {wxTreebook, setImageList, 1}},
+ {2001, {wxTreebook, setPageSize, 1}},
+ {2002, {wxTreebook, setPageImage, 2}},
+ {2003, {wxTreebook, setPageText, 2}},
+ {2004, {wxTreebook, setSelection, 1}},
+ {2005, {wxTreebook, changeSelection, 1}},
+ {2006, {wxTreebook, 'Destroy', undefined}},
+ {2009, {wxTreeCtrl, new_2, 2}},
+ {2010, {wxTreeCtrl, new_0, 0}},
+ {2012, {wxTreeCtrl, destruct, 0}},
+ {2013, {wxTreeCtrl, addRoot, 2}},
+ {2014, {wxTreeCtrl, appendItem, 3}},
+ {2015, {wxTreeCtrl, assignImageList, 1}},
+ {2016, {wxTreeCtrl, assignStateImageList, 1}},
+ {2017, {wxTreeCtrl, collapse, 1}},
+ {2018, {wxTreeCtrl, collapseAndReset, 1}},
+ {2019, {wxTreeCtrl, create, 2}},
+ {2020, {wxTreeCtrl, delete, 1}},
+ {2021, {wxTreeCtrl, deleteAllItems, 0}},
+ {2022, {wxTreeCtrl, deleteChildren, 1}},
+ {2023, {wxTreeCtrl, editLabel, 1}},
+ {2024, {wxTreeCtrl, ensureVisible, 1}},
+ {2025, {wxTreeCtrl, expand, 1}},
+ {2026, {wxTreeCtrl, getBoundingRect, 3}},
+ {2028, {wxTreeCtrl, getChildrenCount, 2}},
+ {2029, {wxTreeCtrl, getCount, 0}},
+ {2030, {wxTreeCtrl, getEditControl, 0}},
+ {2031, {wxTreeCtrl, getFirstChild, 2}},
+ {2032, {wxTreeCtrl, getNextChild, 2}},
+ {2033, {wxTreeCtrl, getFirstVisibleItem, 0}},
+ {2034, {wxTreeCtrl, getImageList, 0}},
+ {2035, {wxTreeCtrl, getIndent, 0}},
+ {2036, {wxTreeCtrl, getItemBackgroundColour, 1}},
+ {2037, {wxTreeCtrl, getItemData, 1}},
+ {2038, {wxTreeCtrl, getItemFont, 1}},
+ {2039, {wxTreeCtrl, getItemImage_1, 1}},
+ {2040, {wxTreeCtrl, getItemImage_2, 2}},
+ {2041, {wxTreeCtrl, getItemText, 1}},
+ {2042, {wxTreeCtrl, getItemTextColour, 1}},
+ {2043, {wxTreeCtrl, getLastChild, 1}},
+ {2044, {wxTreeCtrl, getNextSibling, 1}},
+ {2045, {wxTreeCtrl, getNextVisible, 1}},
+ {2046, {wxTreeCtrl, getItemParent, 1}},
+ {2047, {wxTreeCtrl, getPrevSibling, 1}},
+ {2048, {wxTreeCtrl, getPrevVisible, 1}},
+ {2049, {wxTreeCtrl, getRootItem, 0}},
+ {2050, {wxTreeCtrl, getSelection, 0}},
+ {2051, {wxTreeCtrl, getSelections, 1}},
+ {2052, {wxTreeCtrl, getStateImageList, 0}},
+ {2053, {wxTreeCtrl, hitTest, 1}},
+ {2055, {wxTreeCtrl, insertItem, 4}},
+ {2056, {wxTreeCtrl, isBold, 1}},
+ {2057, {wxTreeCtrl, isExpanded, 1}},
+ {2058, {wxTreeCtrl, isSelected, 1}},
+ {2059, {wxTreeCtrl, isVisible, 1}},
+ {2060, {wxTreeCtrl, itemHasChildren, 1}},
+ {2061, {wxTreeCtrl, prependItem, 3}},
+ {2062, {wxTreeCtrl, scrollTo, 1}},
+ {2063, {wxTreeCtrl, selectItem_1, 1}},
+ {2064, {wxTreeCtrl, selectItem_2, 2}},
+ {2065, {wxTreeCtrl, setIndent, 1}},
+ {2066, {wxTreeCtrl, setImageList, 1}},
+ {2067, {wxTreeCtrl, setItemBackgroundColour, 2}},
+ {2068, {wxTreeCtrl, setItemBold, 2}},
+ {2069, {wxTreeCtrl, setItemData, 2}},
+ {2070, {wxTreeCtrl, setItemDropHighlight, 2}},
+ {2071, {wxTreeCtrl, setItemFont, 2}},
+ {2072, {wxTreeCtrl, setItemHasChildren, 2}},
+ {2073, {wxTreeCtrl, setItemImage_2, 2}},
+ {2074, {wxTreeCtrl, setItemImage_3, 3}},
+ {2075, {wxTreeCtrl, setItemText, 2}},
+ {2076, {wxTreeCtrl, setItemTextColour, 2}},
+ {2077, {wxTreeCtrl, setStateImageList, 1}},
+ {2078, {wxTreeCtrl, setWindowStyle, 1}},
+ {2079, {wxTreeCtrl, sortChildren, 1}},
+ {2080, {wxTreeCtrl, toggle, 1}},
+ {2081, {wxTreeCtrl, toggleItemSelection, 1}},
+ {2082, {wxTreeCtrl, unselect, 0}},
+ {2083, {wxTreeCtrl, unselectAll, 0}},
+ {2084, {wxTreeCtrl, unselectItem, 1}},
+ {2085, {wxScrollBar, new_0, 0}},
+ {2086, {wxScrollBar, new_3, 3}},
+ {2087, {wxScrollBar, destruct, 0}},
+ {2088, {wxScrollBar, create, 3}},
+ {2089, {wxScrollBar, getRange, 0}},
+ {2090, {wxScrollBar, getPageSize, 0}},
+ {2091, {wxScrollBar, getThumbPosition, 0}},
+ {2092, {wxScrollBar, getThumbSize, 0}},
+ {2093, {wxScrollBar, setThumbPosition, 1}},
+ {2094, {wxScrollBar, setScrollbar, 5}},
+ {2096, {wxSpinButton, new_2, 2}},
+ {2097, {wxSpinButton, new_0, 0}},
+ {2098, {wxSpinButton, create, 2}},
+ {2099, {wxSpinButton, getMax, 0}},
+ {2100, {wxSpinButton, getMin, 0}},
+ {2101, {wxSpinButton, getValue, 0}},
+ {2102, {wxSpinButton, setRange, 2}},
+ {2103, {wxSpinButton, setValue, 1}},
+ {2104, {wxSpinButton, 'Destroy', undefined}},
+ {2105, {wxSpinCtrl, new_0, 0}},
+ {2106, {wxSpinCtrl, new_2, 2}},
+ {2108, {wxSpinCtrl, create, 2}},
+ {2111, {wxSpinCtrl, setValue_1_1, 1}},
+ {2112, {wxSpinCtrl, setValue_1_0, 1}},
+ {2114, {wxSpinCtrl, getValue, 0}},
+ {2116, {wxSpinCtrl, setRange, 2}},
+ {2117, {wxSpinCtrl, setSelection, 2}},
+ {2119, {wxSpinCtrl, getMin, 0}},
+ {2121, {wxSpinCtrl, getMax, 0}},
+ {2122, {wxSpinCtrl, 'Destroy', undefined}},
+ {2123, {wxStaticText, new_0, 0}},
+ {2124, {wxStaticText, new_4, 4}},
+ {2125, {wxStaticText, create, 4}},
+ {2126, {wxStaticText, getLabel, 0}},
+ {2127, {wxStaticText, setLabel, 1}},
+ {2128, {wxStaticText, wrap, 1}},
+ {2129, {wxStaticText, 'Destroy', undefined}},
+ {2130, {wxStaticBitmap, new_0, 0}},
+ {2131, {wxStaticBitmap, new_4, 4}},
+ {2132, {wxStaticBitmap, create, 4}},
+ {2133, {wxStaticBitmap, getBitmap, 0}},
+ {2134, {wxStaticBitmap, setBitmap, 1}},
+ {2135, {wxStaticBitmap, 'Destroy', undefined}},
+ {2136, {wxRadioBox, new, 7}},
+ {2138, {wxRadioBox, destruct, 0}},
+ {2139, {wxRadioBox, create, 7}},
+ {2140, {wxRadioBox, enable_2, 2}},
+ {2141, {wxRadioBox, enable_1, 1}},
+ {2142, {wxRadioBox, getSelection, 0}},
+ {2143, {wxRadioBox, getString, 1}},
+ {2144, {wxRadioBox, setSelection, 1}},
+ {2145, {wxRadioBox, show_2, 2}},
+ {2146, {wxRadioBox, show_1, 1}},
+ {2147, {wxRadioBox, getColumnCount, 0}},
+ {2148, {wxRadioBox, getItemHelpText, 1}},
+ {2149, {wxRadioBox, getItemToolTip, 1}},
+ {2151, {wxRadioBox, getItemFromPoint, 1}},
+ {2152, {wxRadioBox, getRowCount, 0}},
+ {2153, {wxRadioBox, isItemEnabled, 1}},
+ {2154, {wxRadioBox, isItemShown, 1}},
+ {2155, {wxRadioBox, setItemHelpText, 2}},
+ {2156, {wxRadioBox, setItemToolTip, 2}},
+ {2157, {wxRadioButton, new_0, 0}},
+ {2158, {wxRadioButton, new_4, 4}},
+ {2159, {wxRadioButton, create, 4}},
+ {2160, {wxRadioButton, getValue, 0}},
+ {2161, {wxRadioButton, setValue, 1}},
+ {2162, {wxRadioButton, 'Destroy', undefined}},
+ {2164, {wxSlider, new_6, 6}},
+ {2165, {wxSlider, new_0, 0}},
+ {2166, {wxSlider, create, 6}},
+ {2167, {wxSlider, getLineSize, 0}},
+ {2168, {wxSlider, getMax, 0}},
+ {2169, {wxSlider, getMin, 0}},
+ {2170, {wxSlider, getPageSize, 0}},
+ {2171, {wxSlider, getThumbLength, 0}},
+ {2172, {wxSlider, getValue, 0}},
+ {2173, {wxSlider, setLineSize, 1}},
+ {2174, {wxSlider, setPageSize, 1}},
+ {2175, {wxSlider, setRange, 2}},
+ {2176, {wxSlider, setThumbLength, 1}},
+ {2177, {wxSlider, setValue, 1}},
+ {2178, {wxSlider, 'Destroy', undefined}},
+ {2180, {wxDialog, new_4, 4}},
+ {2181, {wxDialog, new_0, 0}},
+ {2183, {wxDialog, destruct, 0}},
+ {2184, {wxDialog, create, 4}},
+ {2185, {wxDialog, createButtonSizer, 1}},
+ {2186, {wxDialog, createStdDialogButtonSizer, 1}},
+ {2187, {wxDialog, endModal, 1}},
+ {2188, {wxDialog, getAffirmativeId, 0}},
+ {2189, {wxDialog, getReturnCode, 0}},
+ {2190, {wxDialog, isModal, 0}},
+ {2191, {wxDialog, setAffirmativeId, 1}},
+ {2192, {wxDialog, setReturnCode, 1}},
+ {2193, {wxDialog, show, 1}},
+ {2194, {wxDialog, showModal, 0}},
+ {2195, {wxColourDialog, new_0, 0}},
+ {2196, {wxColourDialog, new_2, 2}},
+ {2197, {wxColourDialog, destruct, 0}},
+ {2198, {wxColourDialog, create, 2}},
+ {2199, {wxColourDialog, getColourData, 0}},
+ {2200, {wxColourData, new_0, 0}},
+ {2201, {wxColourData, new_1, 1}},
+ {2202, {wxColourData, destruct, 0}},
+ {2203, {wxColourData, getChooseFull, 0}},
+ {2204, {wxColourData, getColour, 0}},
+ {2206, {wxColourData, getCustomColour, 1}},
+ {2207, {wxColourData, setChooseFull, 1}},
+ {2208, {wxColourData, setColour, 1}},
+ {2209, {wxColourData, setCustomColour, 2}},
+ {2210, {wxPalette, new_0, 0}},
+ {2211, {wxPalette, new_4, 4}},
+ {2213, {wxPalette, destruct, 0}},
+ {2214, {wxPalette, create, 4}},
+ {2215, {wxPalette, getColoursCount, 0}},
+ {2216, {wxPalette, getPixel, 3}},
+ {2217, {wxPalette, getRGB, 4}},
+ {2218, {wxPalette, isOk, 0}},
+ {2222, {wxDirDialog, new, 2}},
+ {2223, {wxDirDialog, destruct, 0}},
+ {2224, {wxDirDialog, getPath, 0}},
+ {2225, {wxDirDialog, getMessage, 0}},
+ {2226, {wxDirDialog, setMessage, 1}},
+ {2227, {wxDirDialog, setPath, 1}},
+ {2231, {wxFileDialog, new, 2}},
+ {2232, {wxFileDialog, destruct, 0}},
+ {2233, {wxFileDialog, getDirectory, 0}},
+ {2234, {wxFileDialog, getFilename, 0}},
+ {2235, {wxFileDialog, getFilenames, 1}},
+ {2236, {wxFileDialog, getFilterIndex, 0}},
+ {2237, {wxFileDialog, getMessage, 0}},
+ {2238, {wxFileDialog, getPath, 0}},
+ {2239, {wxFileDialog, getPaths, 1}},
+ {2240, {wxFileDialog, getWildcard, 0}},
+ {2241, {wxFileDialog, setDirectory, 1}},
+ {2242, {wxFileDialog, setFilename, 1}},
+ {2243, {wxFileDialog, setFilterIndex, 1}},
+ {2244, {wxFileDialog, setMessage, 1}},
+ {2245, {wxFileDialog, setPath, 1}},
+ {2246, {wxFileDialog, setWildcard, 1}},
+ {2247, {wxPickerBase, setInternalMargin, 1}},
+ {2248, {wxPickerBase, getInternalMargin, 0}},
+ {2249, {wxPickerBase, setTextCtrlProportion, 1}},
+ {2250, {wxPickerBase, setPickerCtrlProportion, 1}},
+ {2251, {wxPickerBase, getTextCtrlProportion, 0}},
+ {2252, {wxPickerBase, getPickerCtrlProportion, 0}},
+ {2253, {wxPickerBase, hasTextCtrl, 0}},
+ {2254, {wxPickerBase, getTextCtrl, 0}},
+ {2255, {wxPickerBase, isTextCtrlGrowable, 0}},
+ {2256, {wxPickerBase, setPickerCtrlGrowable, 1}},
+ {2257, {wxPickerBase, setTextCtrlGrowable, 1}},
+ {2258, {wxPickerBase, isPickerCtrlGrowable, 0}},
+ {2259, {wxFilePickerCtrl, new_0, 0}},
+ {2260, {wxFilePickerCtrl, new_3, 3}},
+ {2261, {wxFilePickerCtrl, create, 3}},
+ {2262, {wxFilePickerCtrl, getPath, 0}},
+ {2263, {wxFilePickerCtrl, setPath, 1}},
+ {2264, {wxFilePickerCtrl, 'Destroy', undefined}},
+ {2265, {wxDirPickerCtrl, new_0, 0}},
+ {2266, {wxDirPickerCtrl, new_3, 3}},
+ {2267, {wxDirPickerCtrl, create, 3}},
+ {2268, {wxDirPickerCtrl, getPath, 0}},
+ {2269, {wxDirPickerCtrl, setPath, 1}},
+ {2270, {wxDirPickerCtrl, 'Destroy', undefined}},
+ {2271, {wxColourPickerCtrl, new_0, 0}},
+ {2272, {wxColourPickerCtrl, new_3, 3}},
+ {2273, {wxColourPickerCtrl, create, 3}},
+ {2274, {wxColourPickerCtrl, getColour, 0}},
+ {2275, {wxColourPickerCtrl, setColour_1_1, 1}},
+ {2276, {wxColourPickerCtrl, setColour_1_0, 1}},
+ {2277, {wxColourPickerCtrl, 'Destroy', undefined}},
+ {2278, {wxDatePickerCtrl, new_0, 0}},
+ {2279, {wxDatePickerCtrl, new_3, 3}},
+ {2280, {wxDatePickerCtrl, getRange, 2}},
+ {2281, {wxDatePickerCtrl, getValue, 0}},
+ {2282, {wxDatePickerCtrl, setRange, 2}},
+ {2283, {wxDatePickerCtrl, setValue, 1}},
+ {2284, {wxDatePickerCtrl, 'Destroy', undefined}},
+ {2285, {wxFontPickerCtrl, new_0, 0}},
+ {2286, {wxFontPickerCtrl, new_3, 3}},
+ {2287, {wxFontPickerCtrl, create, 3}},
+ {2288, {wxFontPickerCtrl, getSelectedFont, 0}},
+ {2289, {wxFontPickerCtrl, setSelectedFont, 1}},
+ {2290, {wxFontPickerCtrl, getMaxPointSize, 0}},
+ {2291, {wxFontPickerCtrl, setMaxPointSize, 1}},
+ {2292, {wxFontPickerCtrl, 'Destroy', undefined}},
+ {2295, {wxFindReplaceDialog, new_0, 0}},
+ {2296, {wxFindReplaceDialog, new_4, 4}},
+ {2297, {wxFindReplaceDialog, destruct, 0}},
+ {2298, {wxFindReplaceDialog, create, 4}},
+ {2299, {wxFindReplaceDialog, getData, 0}},
+ {2300, {wxFindReplaceData, new_0, 0}},
+ {2301, {wxFindReplaceData, new_1, 1}},
+ {2302, {wxFindReplaceData, getFindString, 0}},
+ {2303, {wxFindReplaceData, getReplaceString, 0}},
+ {2304, {wxFindReplaceData, getFlags, 0}},
+ {2305, {wxFindReplaceData, setFlags, 1}},
+ {2306, {wxFindReplaceData, setFindString, 1}},
+ {2307, {wxFindReplaceData, setReplaceString, 1}},
+ {2308, {wxFindReplaceData, 'Destroy', undefined}},
+ {2309, {wxMultiChoiceDialog, new_0, 0}},
+ {2311, {wxMultiChoiceDialog, new_5, 5}},
+ {2312, {wxMultiChoiceDialog, getSelections, 0}},
+ {2313, {wxMultiChoiceDialog, setSelections, 1}},
+ {2314, {wxMultiChoiceDialog, 'Destroy', undefined}},
+ {2315, {wxSingleChoiceDialog, new_0, 0}},
+ {2317, {wxSingleChoiceDialog, new_5, 5}},
+ {2318, {wxSingleChoiceDialog, getSelection, 0}},
+ {2319, {wxSingleChoiceDialog, getStringSelection, 0}},
+ {2320, {wxSingleChoiceDialog, setSelection, 1}},
+ {2321, {wxSingleChoiceDialog, 'Destroy', undefined}},
+ {2322, {wxTextEntryDialog, new, 3}},
+ {2323, {wxTextEntryDialog, getValue, 0}},
+ {2324, {wxTextEntryDialog, setValue, 1}},
+ {2325, {wxTextEntryDialog, 'Destroy', undefined}},
+ {2326, {wxPasswordEntryDialog, new, 3}},
+ {2327, {wxPasswordEntryDialog, 'Destroy', undefined}},
+ {2328, {wxFontData, new_0, 0}},
+ {2329, {wxFontData, new_1, 1}},
+ {2330, {wxFontData, destruct, 0}},
+ {2331, {wxFontData, enableEffects, 1}},
+ {2332, {wxFontData, getAllowSymbols, 0}},
+ {2333, {wxFontData, getColour, 0}},
+ {2334, {wxFontData, getChosenFont, 0}},
+ {2335, {wxFontData, getEnableEffects, 0}},
+ {2336, {wxFontData, getInitialFont, 0}},
+ {2337, {wxFontData, getShowHelp, 0}},
+ {2338, {wxFontData, setAllowSymbols, 1}},
+ {2339, {wxFontData, setChosenFont, 1}},
+ {2340, {wxFontData, setColour, 1}},
+ {2341, {wxFontData, setInitialFont, 1}},
+ {2342, {wxFontData, setRange, 2}},
+ {2343, {wxFontData, setShowHelp, 1}},
+ {2347, {wxFontDialog, new_0, 0}},
+ {2349, {wxFontDialog, new_2, 2}},
+ {2351, {wxFontDialog, create, 2}},
+ {2352, {wxFontDialog, getFontData, 0}},
+ {2354, {wxFontDialog, 'Destroy', undefined}},
+ {2355, {wxProgressDialog, new, 3}},
+ {2356, {wxProgressDialog, destruct, 0}},
+ {2357, {wxProgressDialog, resume, 0}},
+ {2358, {wxProgressDialog, update_2, 2}},
+ {2359, {wxProgressDialog, update_0, 0}},
+ {2360, {wxMessageDialog, new, 3}},
+ {2361, {wxMessageDialog, destruct, 0}},
+ {2362, {wxPageSetupDialog, new, 2}},
+ {2363, {wxPageSetupDialog, destruct, 0}},
+ {2364, {wxPageSetupDialog, getPageSetupData, 0}},
+ {2365, {wxPageSetupDialog, showModal, 0}},
+ {2366, {wxPageSetupDialogData, new_0, 0}},
+ {2367, {wxPageSetupDialogData, new_1_0, 1}},
+ {2368, {wxPageSetupDialogData, new_1_1, 1}},
+ {2369, {wxPageSetupDialogData, destruct, 0}},
+ {2370, {wxPageSetupDialogData, enableHelp, 1}},
+ {2371, {wxPageSetupDialogData, enableMargins, 1}},
+ {2372, {wxPageSetupDialogData, enableOrientation, 1}},
+ {2373, {wxPageSetupDialogData, enablePaper, 1}},
+ {2374, {wxPageSetupDialogData, enablePrinter, 1}},
+ {2375, {wxPageSetupDialogData, getDefaultMinMargins, 0}},
+ {2376, {wxPageSetupDialogData, getEnableMargins, 0}},
+ {2377, {wxPageSetupDialogData, getEnableOrientation, 0}},
+ {2378, {wxPageSetupDialogData, getEnablePaper, 0}},
+ {2379, {wxPageSetupDialogData, getEnablePrinter, 0}},
+ {2380, {wxPageSetupDialogData, getEnableHelp, 0}},
+ {2381, {wxPageSetupDialogData, getDefaultInfo, 0}},
+ {2382, {wxPageSetupDialogData, getMarginTopLeft, 0}},
+ {2383, {wxPageSetupDialogData, getMarginBottomRight, 0}},
+ {2384, {wxPageSetupDialogData, getMinMarginTopLeft, 0}},
+ {2385, {wxPageSetupDialogData, getMinMarginBottomRight, 0}},
+ {2386, {wxPageSetupDialogData, getPaperId, 0}},
+ {2387, {wxPageSetupDialogData, getPaperSize, 0}},
+ {2389, {wxPageSetupDialogData, getPrintData, 0}},
+ {2390, {wxPageSetupDialogData, isOk, 0}},
+ {2391, {wxPageSetupDialogData, setDefaultInfo, 1}},
+ {2392, {wxPageSetupDialogData, setDefaultMinMargins, 1}},
+ {2393, {wxPageSetupDialogData, setMarginTopLeft, 1}},
+ {2394, {wxPageSetupDialogData, setMarginBottomRight, 1}},
+ {2395, {wxPageSetupDialogData, setMinMarginTopLeft, 1}},
+ {2396, {wxPageSetupDialogData, setMinMarginBottomRight, 1}},
+ {2397, {wxPageSetupDialogData, setPaperId, 1}},
+ {2398, {wxPageSetupDialogData, setPaperSize_1_1, 1}},
+ {2399, {wxPageSetupDialogData, setPaperSize_1_0, 1}},
+ {2400, {wxPageSetupDialogData, setPrintData, 1}},
+ {2401, {wxPrintDialog, new_2_0, 2}},
+ {2402, {wxPrintDialog, new_2_1, 2}},
+ {2403, {wxPrintDialog, destruct, 0}},
+ {2404, {wxPrintDialog, getPrintDialogData, 0}},
+ {2405, {wxPrintDialog, getPrintDC, 0}},
+ {2406, {wxPrintDialogData, new_0, 0}},
+ {2407, {wxPrintDialogData, new_1_1, 1}},
+ {2408, {wxPrintDialogData, new_1_0, 1}},
+ {2409, {wxPrintDialogData, destruct, 0}},
+ {2410, {wxPrintDialogData, enableHelp, 1}},
+ {2411, {wxPrintDialogData, enablePageNumbers, 1}},
+ {2412, {wxPrintDialogData, enablePrintToFile, 1}},
+ {2413, {wxPrintDialogData, enableSelection, 1}},
+ {2414, {wxPrintDialogData, getAllPages, 0}},
+ {2415, {wxPrintDialogData, getCollate, 0}},
+ {2416, {wxPrintDialogData, getFromPage, 0}},
+ {2417, {wxPrintDialogData, getMaxPage, 0}},
+ {2418, {wxPrintDialogData, getMinPage, 0}},
+ {2419, {wxPrintDialogData, getNoCopies, 0}},
+ {2420, {wxPrintDialogData, getPrintData, 0}},
+ {2421, {wxPrintDialogData, getPrintToFile, 0}},
+ {2422, {wxPrintDialogData, getSelection, 0}},
+ {2423, {wxPrintDialogData, getToPage, 0}},
+ {2424, {wxPrintDialogData, isOk, 0}},
+ {2425, {wxPrintDialogData, setCollate, 1}},
+ {2426, {wxPrintDialogData, setFromPage, 1}},
+ {2427, {wxPrintDialogData, setMaxPage, 1}},
+ {2428, {wxPrintDialogData, setMinPage, 1}},
+ {2429, {wxPrintDialogData, setNoCopies, 1}},
+ {2430, {wxPrintDialogData, setPrintData, 1}},
+ {2431, {wxPrintDialogData, setPrintToFile, 1}},
+ {2432, {wxPrintDialogData, setSelection, 1}},
+ {2433, {wxPrintDialogData, setToPage, 1}},
+ {2434, {wxPrintData, new_0, 0}},
+ {2435, {wxPrintData, new_1, 1}},
+ {2436, {wxPrintData, destruct, 0}},
+ {2437, {wxPrintData, getCollate, 0}},
+ {2438, {wxPrintData, getBin, 0}},
+ {2439, {wxPrintData, getColour, 0}},
+ {2440, {wxPrintData, getDuplex, 0}},
+ {2441, {wxPrintData, getNoCopies, 0}},
+ {2442, {wxPrintData, getOrientation, 0}},
+ {2443, {wxPrintData, getPaperId, 0}},
+ {2444, {wxPrintData, getPrinterName, 0}},
+ {2445, {wxPrintData, getQuality, 0}},
+ {2446, {wxPrintData, isOk, 0}},
+ {2447, {wxPrintData, setBin, 1}},
+ {2448, {wxPrintData, setCollate, 1}},
+ {2449, {wxPrintData, setColour, 1}},
+ {2450, {wxPrintData, setDuplex, 1}},
+ {2451, {wxPrintData, setNoCopies, 1}},
+ {2452, {wxPrintData, setOrientation, 1}},
+ {2453, {wxPrintData, setPaperId, 1}},
+ {2454, {wxPrintData, setPrinterName, 1}},
+ {2455, {wxPrintData, setQuality, 1}},
+ {2458, {wxPrintPreview, new_2, 2}},
+ {2459, {wxPrintPreview, new_3, 3}},
+ {2461, {wxPrintPreview, destruct, 0}},
+ {2462, {wxPrintPreview, getCanvas, 0}},
+ {2463, {wxPrintPreview, getCurrentPage, 0}},
+ {2464, {wxPrintPreview, getFrame, 0}},
+ {2465, {wxPrintPreview, getMaxPage, 0}},
+ {2466, {wxPrintPreview, getMinPage, 0}},
+ {2467, {wxPrintPreview, getPrintout, 0}},
+ {2468, {wxPrintPreview, getPrintoutForPrinting, 0}},
+ {2469, {wxPrintPreview, isOk, 0}},
+ {2470, {wxPrintPreview, paintPage, 2}},
+ {2471, {wxPrintPreview, print, 1}},
+ {2472, {wxPrintPreview, renderPage, 1}},
+ {2473, {wxPrintPreview, setCanvas, 1}},
+ {2474, {wxPrintPreview, setCurrentPage, 1}},
+ {2475, {wxPrintPreview, setFrame, 1}},
+ {2476, {wxPrintPreview, setPrintout, 1}},
+ {2477, {wxPrintPreview, setZoom, 1}},
+ {2478, {wxPreviewFrame, new, 3}},
+ {2479, {wxPreviewFrame, destruct, 0}},
+ {2480, {wxPreviewFrame, createControlBar, 0}},
+ {2481, {wxPreviewFrame, createCanvas, 0}},
+ {2482, {wxPreviewFrame, initialize, 0}},
+ {2483, {wxPreviewFrame, onCloseWindow, 1}},
+ {2484, {wxPreviewControlBar, new, 4}},
+ {2485, {wxPreviewControlBar, destruct, 0}},
+ {2486, {wxPreviewControlBar, createButtons, 0}},
+ {2487, {wxPreviewControlBar, getPrintPreview, 0}},
+ {2488, {wxPreviewControlBar, getZoomControl, 0}},
+ {2489, {wxPreviewControlBar, setZoomControl, 1}},
+ {2491, {wxPrinter, new, 1}},
+ {2492, {wxPrinter, createAbortWindow, 2}},
+ {2493, {wxPrinter, getAbort, 0}},
+ {2494, {wxPrinter, getLastError, 0}},
+ {2495, {wxPrinter, getPrintDialogData, 0}},
+ {2496, {wxPrinter, print, 3}},
+ {2497, {wxPrinter, printDialog, 1}},
+ {2498, {wxPrinter, reportError, 3}},
+ {2499, {wxPrinter, setup, 1}},
+ {2500, {wxPrinter, 'Destroy', undefined}},
+ {2501, {wxXmlResource, new_1, 1}},
+ {2502, {wxXmlResource, new_2, 2}},
+ {2503, {wxXmlResource, destruct, 0}},
+ {2504, {wxXmlResource, attachUnknownControl, 3}},
+ {2505, {wxXmlResource, clearHandlers, 0}},
+ {2506, {wxXmlResource, compareVersion, 4}},
+ {2507, {wxXmlResource, get, 0}},
+ {2508, {wxXmlResource, getFlags, 0}},
+ {2509, {wxXmlResource, getVersion, 0}},
+ {2510, {wxXmlResource, getXRCID, 2}},
+ {2511, {wxXmlResource, initAllHandlers, 0}},
+ {2512, {wxXmlResource, load, 1}},
+ {2513, {wxXmlResource, loadBitmap, 1}},
+ {2514, {wxXmlResource, loadDialog_2, 2}},
+ {2515, {wxXmlResource, loadDialog_3, 3}},
+ {2516, {wxXmlResource, loadFrame_2, 2}},
+ {2517, {wxXmlResource, loadFrame_3, 3}},
+ {2518, {wxXmlResource, loadIcon, 1}},
+ {2519, {wxXmlResource, loadMenu, 1}},
+ {2520, {wxXmlResource, loadMenuBar_2, 2}},
+ {2521, {wxXmlResource, loadMenuBar_1, 1}},
+ {2522, {wxXmlResource, loadPanel_2, 2}},
+ {2523, {wxXmlResource, loadPanel_3, 3}},
+ {2524, {wxXmlResource, loadToolBar, 2}},
+ {2525, {wxXmlResource, set, 1}},
+ {2526, {wxXmlResource, setFlags, 1}},
+ {2527, {wxXmlResource, unload, 1}},
+ {2528, {wxXmlResource, xrcctrl, 3}},
+ {2529, {wxHtmlEasyPrinting, new, 1}},
+ {2530, {wxHtmlEasyPrinting, destruct, 0}},
+ {2531, {wxHtmlEasyPrinting, getPrintData, 0}},
+ {2532, {wxHtmlEasyPrinting, getPageSetupData, 0}},
+ {2533, {wxHtmlEasyPrinting, previewFile, 1}},
+ {2534, {wxHtmlEasyPrinting, previewText, 2}},
+ {2535, {wxHtmlEasyPrinting, printFile, 1}},
+ {2536, {wxHtmlEasyPrinting, printText, 2}},
+ {2537, {wxHtmlEasyPrinting, pageSetup, 0}},
+ {2538, {wxHtmlEasyPrinting, setFonts, 3}},
+ {2539, {wxHtmlEasyPrinting, setHeader, 2}},
+ {2540, {wxHtmlEasyPrinting, setFooter, 2}},
+ {2542, {wxGLCanvas, new_2, 2}},
+ {2543, {wxGLCanvas, new_3_1, 3}},
+ {2544, {wxGLCanvas, new_3_0, 3}},
+ {2545, {wxGLCanvas, getContext, 0}},
+ {2547, {wxGLCanvas, setCurrent, 0}},
+ {2548, {wxGLCanvas, swapBuffers, 0}},
+ {2549, {wxGLCanvas, 'Destroy', undefined}},
+ {2550, {wxAuiManager, new, 1}},
+ {2551, {wxAuiManager, destruct, 0}},
+ {2552, {wxAuiManager, addPane_2_1, 2}},
+ {2553, {wxAuiManager, addPane_3, 3}},
+ {2554, {wxAuiManager, addPane_2_0, 2}},
+ {2555, {wxAuiManager, detachPane, 1}},
+ {2556, {wxAuiManager, getAllPanes, 0}},
+ {2557, {wxAuiManager, getArtProvider, 0}},
+ {2558, {wxAuiManager, getDockSizeConstraint, 2}},
+ {2559, {wxAuiManager, getFlags, 0}},
+ {2560, {wxAuiManager, getManagedWindow, 0}},
+ {2561, {wxAuiManager, getManager, 1}},
+ {2562, {wxAuiManager, getPane_1_1, 1}},
+ {2563, {wxAuiManager, getPane_1_0, 1}},
+ {2564, {wxAuiManager, hideHint, 0}},
+ {2565, {wxAuiManager, insertPane, 3}},
+ {2566, {wxAuiManager, loadPaneInfo, 2}},
+ {2567, {wxAuiManager, loadPerspective, 2}},
+ {2568, {wxAuiManager, savePaneInfo, 1}},
+ {2569, {wxAuiManager, savePerspective, 0}},
+ {2570, {wxAuiManager, setArtProvider, 1}},
+ {2571, {wxAuiManager, setDockSizeConstraint, 2}},
+ {2572, {wxAuiManager, setFlags, 1}},
+ {2573, {wxAuiManager, setManagedWindow, 1}},
+ {2574, {wxAuiManager, showHint, 1}},
+ {2575, {wxAuiManager, unInit, 0}},
+ {2576, {wxAuiManager, update, 0}},
+ {2577, {wxAuiPaneInfo, new_0, 0}},
+ {2578, {wxAuiPaneInfo, new_1, 1}},
+ {2579, {wxAuiPaneInfo, destruct, 0}},
+ {2580, {wxAuiPaneInfo, bestSize_1, 1}},
+ {2581, {wxAuiPaneInfo, bestSize_2, 2}},
+ {2582, {wxAuiPaneInfo, bottom, 0}},
+ {2583, {wxAuiPaneInfo, bottomDockable, 1}},
+ {2584, {wxAuiPaneInfo, caption, 1}},
+ {2585, {wxAuiPaneInfo, captionVisible, 1}},
+ {2586, {wxAuiPaneInfo, centre, 0}},
+ {2587, {wxAuiPaneInfo, centrePane, 0}},
+ {2588, {wxAuiPaneInfo, closeButton, 1}},
+ {2589, {wxAuiPaneInfo, defaultPane, 0}},
+ {2590, {wxAuiPaneInfo, destroyOnClose, 1}},
+ {2591, {wxAuiPaneInfo, direction, 1}},
+ {2592, {wxAuiPaneInfo, dock, 0}},
+ {2593, {wxAuiPaneInfo, dockable, 1}},
+ {2594, {wxAuiPaneInfo, fixed, 0}},
+ {2595, {wxAuiPaneInfo, float, 0}},
+ {2596, {wxAuiPaneInfo, floatable, 1}},
+ {2597, {wxAuiPaneInfo, floatingPosition_1, 1}},
+ {2598, {wxAuiPaneInfo, floatingPosition_2, 2}},
+ {2599, {wxAuiPaneInfo, floatingSize_1, 1}},
+ {2600, {wxAuiPaneInfo, floatingSize_2, 2}},
+ {2601, {wxAuiPaneInfo, gripper, 1}},
+ {2602, {wxAuiPaneInfo, gripperTop, 1}},
+ {2603, {wxAuiPaneInfo, hasBorder, 0}},
+ {2604, {wxAuiPaneInfo, hasCaption, 0}},
+ {2605, {wxAuiPaneInfo, hasCloseButton, 0}},
+ {2606, {wxAuiPaneInfo, hasFlag, 1}},
+ {2607, {wxAuiPaneInfo, hasGripper, 0}},
+ {2608, {wxAuiPaneInfo, hasGripperTop, 0}},
+ {2609, {wxAuiPaneInfo, hasMaximizeButton, 0}},
+ {2610, {wxAuiPaneInfo, hasMinimizeButton, 0}},
+ {2611, {wxAuiPaneInfo, hasPinButton, 0}},
+ {2612, {wxAuiPaneInfo, hide, 0}},
+ {2613, {wxAuiPaneInfo, isBottomDockable, 0}},
+ {2614, {wxAuiPaneInfo, isDocked, 0}},
+ {2615, {wxAuiPaneInfo, isFixed, 0}},
+ {2616, {wxAuiPaneInfo, isFloatable, 0}},
+ {2617, {wxAuiPaneInfo, isFloating, 0}},
+ {2618, {wxAuiPaneInfo, isLeftDockable, 0}},
+ {2619, {wxAuiPaneInfo, isMovable, 0}},
+ {2620, {wxAuiPaneInfo, isOk, 0}},
+ {2621, {wxAuiPaneInfo, isResizable, 0}},
+ {2622, {wxAuiPaneInfo, isRightDockable, 0}},
+ {2623, {wxAuiPaneInfo, isShown, 0}},
+ {2624, {wxAuiPaneInfo, isToolbar, 0}},
+ {2625, {wxAuiPaneInfo, isTopDockable, 0}},
+ {2626, {wxAuiPaneInfo, layer, 1}},
+ {2627, {wxAuiPaneInfo, left, 0}},
+ {2628, {wxAuiPaneInfo, leftDockable, 1}},
+ {2629, {wxAuiPaneInfo, maxSize_1, 1}},
+ {2630, {wxAuiPaneInfo, maxSize_2, 2}},
+ {2631, {wxAuiPaneInfo, maximizeButton, 1}},
+ {2632, {wxAuiPaneInfo, minSize_1, 1}},
+ {2633, {wxAuiPaneInfo, minSize_2, 2}},
+ {2634, {wxAuiPaneInfo, minimizeButton, 1}},
+ {2635, {wxAuiPaneInfo, movable, 1}},
+ {2636, {wxAuiPaneInfo, name, 1}},
+ {2637, {wxAuiPaneInfo, paneBorder, 1}},
+ {2638, {wxAuiPaneInfo, pinButton, 1}},
+ {2639, {wxAuiPaneInfo, position, 1}},
+ {2640, {wxAuiPaneInfo, resizable, 1}},
+ {2641, {wxAuiPaneInfo, right, 0}},
+ {2642, {wxAuiPaneInfo, rightDockable, 1}},
+ {2643, {wxAuiPaneInfo, row, 1}},
+ {2644, {wxAuiPaneInfo, safeSet, 1}},
+ {2645, {wxAuiPaneInfo, setFlag, 2}},
+ {2646, {wxAuiPaneInfo, show, 1}},
+ {2647, {wxAuiPaneInfo, toolbarPane, 0}},
+ {2648, {wxAuiPaneInfo, top, 0}},
+ {2649, {wxAuiPaneInfo, topDockable, 1}},
+ {2650, {wxAuiPaneInfo, window, 1}},
+ {2651, {wxAuiNotebook, new_0, 0}},
+ {2652, {wxAuiNotebook, new_2, 2}},
+ {2653, {wxAuiNotebook, addPage, 3}},
+ {2654, {wxAuiNotebook, create, 2}},
+ {2655, {wxAuiNotebook, deletePage, 1}},
+ {2656, {wxAuiNotebook, getArtProvider, 0}},
+ {2657, {wxAuiNotebook, getPage, 1}},
+ {2658, {wxAuiNotebook, getPageBitmap, 1}},
+ {2659, {wxAuiNotebook, getPageCount, 0}},
+ {2660, {wxAuiNotebook, getPageIndex, 1}},
+ {2661, {wxAuiNotebook, getPageText, 1}},
+ {2662, {wxAuiNotebook, getSelection, 0}},
+ {2663, {wxAuiNotebook, insertPage, 4}},
+ {2664, {wxAuiNotebook, removePage, 1}},
+ {2665, {wxAuiNotebook, setArtProvider, 1}},
+ {2666, {wxAuiNotebook, setFont, 1}},
+ {2667, {wxAuiNotebook, setPageBitmap, 2}},
+ {2668, {wxAuiNotebook, setPageText, 2}},
+ {2669, {wxAuiNotebook, setSelection, 1}},
+ {2670, {wxAuiNotebook, setTabCtrlHeight, 1}},
+ {2671, {wxAuiNotebook, setUniformBitmapSize, 1}},
+ {2672, {wxAuiNotebook, 'Destroy', undefined}},
+ {2673, {wxMDIParentFrame, new_0, 0}},
+ {2674, {wxMDIParentFrame, new_4, 4}},
+ {2675, {wxMDIParentFrame, destruct, 0}},
+ {2676, {wxMDIParentFrame, activateNext, 0}},
+ {2677, {wxMDIParentFrame, activatePrevious, 0}},
+ {2678, {wxMDIParentFrame, arrangeIcons, 0}},
+ {2679, {wxMDIParentFrame, cascade, 0}},
+ {2680, {wxMDIParentFrame, create, 4}},
+ {2681, {wxMDIParentFrame, getActiveChild, 0}},
+ {2682, {wxMDIParentFrame, getClientWindow, 0}},
+ {2683, {wxMDIParentFrame, tile, 1}},
+ {2684, {wxMDIChildFrame, new_0, 0}},
+ {2685, {wxMDIChildFrame, new_4, 4}},
+ {2686, {wxMDIChildFrame, destruct, 0}},
+ {2687, {wxMDIChildFrame, activate, 0}},
+ {2688, {wxMDIChildFrame, create, 4}},
+ {2689, {wxMDIChildFrame, maximize, 1}},
+ {2690, {wxMDIChildFrame, restore, 0}},
+ {2691, {wxMDIClientWindow, new_0, 0}},
+ {2692, {wxMDIClientWindow, new_2, 2}},
+ {2693, {wxMDIClientWindow, destruct, 0}},
+ {2694, {wxMDIClientWindow, createClient, 2}},
+ {2695, {wxLayoutAlgorithm, new, 0}},
+ {2696, {wxLayoutAlgorithm, layoutFrame, 2}},
+ {2697, {wxLayoutAlgorithm, layoutMDIFrame, 2}},
+ {2698, {wxLayoutAlgorithm, layoutWindow, 2}},
+ {2699, {wxLayoutAlgorithm, 'Destroy', undefined}},
+ {2700, {wxEvent, getId, 0}},
+ {2701, {wxEvent, getSkipped, 0}},
+ {2702, {wxEvent, getTimestamp, 0}},
+ {2703, {wxEvent, isCommandEvent, 0}},
+ {2704, {wxEvent, resumePropagation, 1}},
+ {2705, {wxEvent, shouldPropagate, 0}},
+ {2706, {wxEvent, skip, 1}},
+ {2707, {wxEvent, stopPropagation, 0}},
+ {2708, {wxCommandEvent, getClientData, 0}},
+ {2709, {wxCommandEvent, getExtraLong, 0}},
+ {2710, {wxCommandEvent, getInt, 0}},
+ {2711, {wxCommandEvent, getSelection, 0}},
+ {2712, {wxCommandEvent, getString, 0}},
+ {2713, {wxCommandEvent, isChecked, 0}},
+ {2714, {wxCommandEvent, isSelection, 0}},
+ {2715, {wxCommandEvent, setInt, 1}},
+ {2716, {wxCommandEvent, setString, 1}},
+ {2717, {wxScrollEvent, getOrientation, 0}},
+ {2718, {wxScrollEvent, getPosition, 0}},
+ {2719, {wxScrollWinEvent, getOrientation, 0}},
+ {2720, {wxScrollWinEvent, getPosition, 0}},
+ {2721, {wxMouseEvent, altDown, 0}},
+ {2722, {wxMouseEvent, button, 1}},
+ {2723, {wxMouseEvent, buttonDClick, 1}},
+ {2724, {wxMouseEvent, buttonDown, 1}},
+ {2725, {wxMouseEvent, buttonUp, 1}},
+ {2726, {wxMouseEvent, cmdDown, 0}},
+ {2727, {wxMouseEvent, controlDown, 0}},
+ {2728, {wxMouseEvent, dragging, 0}},
+ {2729, {wxMouseEvent, entering, 0}},
+ {2730, {wxMouseEvent, getButton, 0}},
+ {2733, {wxMouseEvent, getPosition, 0}},
+ {2734, {wxMouseEvent, getLogicalPosition, 1}},
+ {2735, {wxMouseEvent, getLinesPerAction, 0}},
+ {2736, {wxMouseEvent, getWheelRotation, 0}},
+ {2737, {wxMouseEvent, getWheelDelta, 0}},
+ {2738, {wxMouseEvent, getX, 0}},
+ {2739, {wxMouseEvent, getY, 0}},
+ {2740, {wxMouseEvent, isButton, 0}},
+ {2741, {wxMouseEvent, isPageScroll, 0}},
+ {2742, {wxMouseEvent, leaving, 0}},
+ {2743, {wxMouseEvent, leftDClick, 0}},
+ {2744, {wxMouseEvent, leftDown, 0}},
+ {2745, {wxMouseEvent, leftIsDown, 0}},
+ {2746, {wxMouseEvent, leftUp, 0}},
+ {2747, {wxMouseEvent, metaDown, 0}},
+ {2748, {wxMouseEvent, middleDClick, 0}},
+ {2749, {wxMouseEvent, middleDown, 0}},
+ {2750, {wxMouseEvent, middleIsDown, 0}},
+ {2751, {wxMouseEvent, middleUp, 0}},
+ {2752, {wxMouseEvent, moving, 0}},
+ {2753, {wxMouseEvent, rightDClick, 0}},
+ {2754, {wxMouseEvent, rightDown, 0}},
+ {2755, {wxMouseEvent, rightIsDown, 0}},
+ {2756, {wxMouseEvent, rightUp, 0}},
+ {2757, {wxMouseEvent, shiftDown, 0}},
+ {2758, {wxSetCursorEvent, getCursor, 0}},
+ {2759, {wxSetCursorEvent, getX, 0}},
+ {2760, {wxSetCursorEvent, getY, 0}},
+ {2761, {wxSetCursorEvent, hasCursor, 0}},
+ {2762, {wxSetCursorEvent, setCursor, 1}},
+ {2763, {wxKeyEvent, altDown, 0}},
+ {2764, {wxKeyEvent, cmdDown, 0}},
+ {2765, {wxKeyEvent, controlDown, 0}},
+ {2766, {wxKeyEvent, getKeyCode, 0}},
+ {2767, {wxKeyEvent, getModifiers, 0}},
+ {2770, {wxKeyEvent, getPosition, 0}},
+ {2771, {wxKeyEvent, getRawKeyCode, 0}},
+ {2772, {wxKeyEvent, getRawKeyFlags, 0}},
+ {2773, {wxKeyEvent, getUnicodeKey, 0}},
+ {2774, {wxKeyEvent, getX, 0}},
+ {2775, {wxKeyEvent, getY, 0}},
+ {2776, {wxKeyEvent, hasModifiers, 0}},
+ {2777, {wxKeyEvent, metaDown, 0}},
+ {2778, {wxKeyEvent, shiftDown, 0}},
+ {2779, {wxSizeEvent, getSize, 0}},
+ {2780, {wxMoveEvent, getPosition, 0}},
+ {2781, {wxEraseEvent, getDC, 0}},
+ {2782, {wxFocusEvent, getWindow, 0}},
+ {2783, {wxChildFocusEvent, getWindow, 0}},
+ {2784, {wxMenuEvent, getMenu, 0}},
+ {2785, {wxMenuEvent, getMenuId, 0}},
+ {2786, {wxMenuEvent, isPopup, 0}},
+ {2787, {wxCloseEvent, canVeto, 0}},
+ {2788, {wxCloseEvent, getLoggingOff, 0}},
+ {2789, {wxCloseEvent, setCanVeto, 1}},
+ {2790, {wxCloseEvent, setLoggingOff, 1}},
+ {2791, {wxCloseEvent, veto, 1}},
+ {2792, {wxShowEvent, setShow, 1}},
+ {2793, {wxShowEvent, getShow, 0}},
+ {2794, {wxIconizeEvent, iconized, 0}},
+ {2795, {wxJoystickEvent, buttonDown, 1}},
+ {2796, {wxJoystickEvent, buttonIsDown, 1}},
+ {2797, {wxJoystickEvent, buttonUp, 1}},
+ {2798, {wxJoystickEvent, getButtonChange, 0}},
+ {2799, {wxJoystickEvent, getButtonState, 0}},
+ {2800, {wxJoystickEvent, getJoystick, 0}},
+ {2801, {wxJoystickEvent, getPosition, 0}},
+ {2802, {wxJoystickEvent, getZPosition, 0}},
+ {2803, {wxJoystickEvent, isButton, 0}},
+ {2804, {wxJoystickEvent, isMove, 0}},
+ {2805, {wxJoystickEvent, isZMove, 0}},
+ {2806, {wxUpdateUIEvent, canUpdate, 1}},
+ {2807, {wxUpdateUIEvent, check, 1}},
+ {2808, {wxUpdateUIEvent, enable, 1}},
+ {2809, {wxUpdateUIEvent, show, 1}},
+ {2810, {wxUpdateUIEvent, getChecked, 0}},
+ {2811, {wxUpdateUIEvent, getEnabled, 0}},
+ {2812, {wxUpdateUIEvent, getShown, 0}},
+ {2813, {wxUpdateUIEvent, getSetChecked, 0}},
+ {2814, {wxUpdateUIEvent, getSetEnabled, 0}},
+ {2815, {wxUpdateUIEvent, getSetShown, 0}},
+ {2816, {wxUpdateUIEvent, getSetText, 0}},
+ {2817, {wxUpdateUIEvent, getText, 0}},
+ {2818, {wxUpdateUIEvent, getMode, 0}},
+ {2819, {wxUpdateUIEvent, getUpdateInterval, 0}},
+ {2820, {wxUpdateUIEvent, resetUpdateTime, 0}},
+ {2821, {wxUpdateUIEvent, setMode, 1}},
+ {2822, {wxUpdateUIEvent, setText, 1}},
+ {2823, {wxUpdateUIEvent, setUpdateInterval, 1}},
+ {2824, {wxMouseCaptureChangedEvent, getCapturedWindow, 0}},
+ {2825, {wxPaletteChangedEvent, setChangedWindow, 1}},
+ {2826, {wxPaletteChangedEvent, getChangedWindow, 0}},
+ {2827, {wxQueryNewPaletteEvent, setPaletteRealized, 1}},
+ {2828, {wxQueryNewPaletteEvent, getPaletteRealized, 0}},
+ {2829, {wxNavigationKeyEvent, getDirection, 0}},
+ {2830, {wxNavigationKeyEvent, setDirection, 1}},
+ {2831, {wxNavigationKeyEvent, isWindowChange, 0}},
+ {2832, {wxNavigationKeyEvent, setWindowChange, 1}},
+ {2833, {wxNavigationKeyEvent, isFromTab, 0}},
+ {2834, {wxNavigationKeyEvent, setFromTab, 1}},
+ {2835, {wxNavigationKeyEvent, getCurrentFocus, 0}},
+ {2836, {wxNavigationKeyEvent, setCurrentFocus, 1}},
+ {2837, {wxHelpEvent, getOrigin, 0}},
+ {2838, {wxHelpEvent, getPosition, 0}},
+ {2839, {wxHelpEvent, setOrigin, 1}},
+ {2840, {wxHelpEvent, setPosition, 1}},
+ {2841, {wxContextMenuEvent, getPosition, 0}},
+ {2842, {wxContextMenuEvent, setPosition, 1}},
+ {2843, {wxIdleEvent, canSend, 1}},
+ {2844, {wxIdleEvent, getMode, 0}},
+ {2845, {wxIdleEvent, requestMore, 1}},
+ {2846, {wxIdleEvent, moreRequested, 0}},
+ {2847, {wxIdleEvent, setMode, 1}},
+ {2848, {wxGridEvent, altDown, 0}},
+ {2849, {wxGridEvent, controlDown, 0}},
+ {2850, {wxGridEvent, getCol, 0}},
+ {2851, {wxGridEvent, getPosition, 0}},
+ {2852, {wxGridEvent, getRow, 0}},
+ {2853, {wxGridEvent, metaDown, 0}},
+ {2854, {wxGridEvent, selecting, 0}},
+ {2855, {wxGridEvent, shiftDown, 0}},
+ {2856, {wxNotifyEvent, allow, 0}},
+ {2857, {wxNotifyEvent, isAllowed, 0}},
+ {2858, {wxNotifyEvent, veto, 0}},
+ {2859, {wxSashEvent, getEdge, 0}},
+ {2860, {wxSashEvent, getDragRect, 0}},
+ {2861, {wxSashEvent, getDragStatus, 0}},
+ {2862, {wxListEvent, getCacheFrom, 0}},
+ {2863, {wxListEvent, getCacheTo, 0}},
+ {2864, {wxListEvent, getKeyCode, 0}},
+ {2865, {wxListEvent, getIndex, 0}},
+ {2866, {wxListEvent, getColumn, 0}},
+ {2867, {wxListEvent, getPoint, 0}},
+ {2868, {wxListEvent, getLabel, 0}},
+ {2869, {wxListEvent, getText, 0}},
+ {2870, {wxListEvent, getImage, 0}},
+ {2871, {wxListEvent, getData, 0}},
+ {2872, {wxListEvent, getMask, 0}},
+ {2873, {wxListEvent, getItem, 0}},
+ {2874, {wxListEvent, isEditCancelled, 0}},
+ {2875, {wxDateEvent, getDate, 0}},
+ {2876, {wxCalendarEvent, getWeekDay, 0}},
+ {2877, {wxFileDirPickerEvent, getPath, 0}},
+ {2878, {wxColourPickerEvent, getColour, 0}},
+ {2879, {wxFontPickerEvent, getFont, 0}},
+ {2880, {wxStyledTextEvent, getPosition, 0}},
+ {2881, {wxStyledTextEvent, getKey, 0}},
+ {2882, {wxStyledTextEvent, getModifiers, 0}},
+ {2883, {wxStyledTextEvent, getModificationType, 0}},
+ {2884, {wxStyledTextEvent, getText, 0}},
+ {2885, {wxStyledTextEvent, getLength, 0}},
+ {2886, {wxStyledTextEvent, getLinesAdded, 0}},
+ {2887, {wxStyledTextEvent, getLine, 0}},
+ {2888, {wxStyledTextEvent, getFoldLevelNow, 0}},
+ {2889, {wxStyledTextEvent, getFoldLevelPrev, 0}},
+ {2890, {wxStyledTextEvent, getMargin, 0}},
+ {2891, {wxStyledTextEvent, getMessage, 0}},
+ {2892, {wxStyledTextEvent, getWParam, 0}},
+ {2893, {wxStyledTextEvent, getLParam, 0}},
+ {2894, {wxStyledTextEvent, getListType, 0}},
+ {2895, {wxStyledTextEvent, getX, 0}},
+ {2896, {wxStyledTextEvent, getY, 0}},
+ {2897, {wxStyledTextEvent, getDragText, 0}},
+ {2898, {wxStyledTextEvent, getDragAllowMove, 0}},
+ {2899, {wxStyledTextEvent, getDragResult, 0}},
+ {2900, {wxStyledTextEvent, getShift, 0}},
+ {2901, {wxStyledTextEvent, getControl, 0}},
+ {2902, {wxStyledTextEvent, getAlt, 0}},
+ {2903, {utils, getKeyState, 1}},
+ {2904, {utils, getMousePosition, 2}},
+ {2905, {utils, getMouseState, 0}},
+ {2906, {utils, setDetectableAutoRepeat, 1}},
+ {2907, {utils, bell, 0}},
+ {2908, {utils, findMenuItemId, 3}},
+ {2909, {utils, genericFindWindowAtPoint, 1}},
+ {2910, {utils, findWindowAtPoint, 1}},
+ {2911, {utils, beginBusyCursor, 1}},
+ {2912, {utils, endBusyCursor, 0}},
+ {2913, {utils, isBusy, 0}},
+ {2914, {utils, shutdown, 1}},
+ {2915, {utils, shell, 1}},
+ {2916, {utils, launchDefaultBrowser, 2}},
+ {2917, {utils, getEmailAddress, 0}},
+ {2918, {utils, getUserId, 0}},
+ {2919, {utils, getHomeDir, 0}},
+ {2920, {utils, newId, 0}},
+ {2921, {utils, registerId, 1}},
+ {2922, {utils, getCurrentId, 0}},
+ {2923, {utils, getOsDescription, 0}},
+ {2924, {utils, isPlatformLittleEndian, 0}},
+ {2925, {utils, isPlatform64Bit, 0}},
+ {2926, {wxPrintout, new, 1}},
+ {2927, {wxPrintout, destruct, 0}},
+ {2928, {wxPrintout, getDC, 0}},
+ {2929, {wxPrintout, getPageSizeMM, 2}},
+ {2930, {wxPrintout, getPageSizePixels, 2}},
+ {2931, {wxPrintout, getPaperRectPixels, 0}},
+ {2932, {wxPrintout, getPPIPrinter, 2}},
+ {2933, {wxPrintout, getPPIScreen, 2}},
+ {2934, {wxPrintout, getTitle, 0}},
+ {2935, {wxPrintout, isPreview, 0}},
+ {2936, {wxPrintout, fitThisSizeToPaper, 1}},
+ {2937, {wxPrintout, fitThisSizeToPage, 1}},
+ {2938, {wxPrintout, fitThisSizeToPageMargins, 2}},
+ {2939, {wxPrintout, mapScreenSizeToPaper, 0}},
+ {2940, {wxPrintout, mapScreenSizeToPage, 0}},
+ {2941, {wxPrintout, mapScreenSizeToPageMargins, 1}},
+ {2942, {wxPrintout, mapScreenSizeToDevice, 0}},
+ {2943, {wxPrintout, getLogicalPaperRect, 0}},
+ {2944, {wxPrintout, getLogicalPageRect, 0}},
+ {2945, {wxPrintout, getLogicalPageMarginsRect, 1}},
+ {2946, {wxPrintout, setLogicalOrigin, 2}},
+ {2947, {wxPrintout, offsetLogicalOrigin, 2}},
+ {2948, {wxStyledTextCtrl, new_2, 2}},
+ {2949, {wxStyledTextCtrl, new_0, 0}},
+ {2950, {wxStyledTextCtrl, destruct, 0}},
+ {2951, {wxStyledTextCtrl, create, 2}},
+ {2952, {wxStyledTextCtrl, addText, 1}},
+ {2953, {wxStyledTextCtrl, addStyledText, 1}},
+ {2954, {wxStyledTextCtrl, insertText, 2}},
+ {2955, {wxStyledTextCtrl, clearAll, 0}},
+ {2956, {wxStyledTextCtrl, clearDocumentStyle, 0}},
+ {2957, {wxStyledTextCtrl, getLength, 0}},
+ {2958, {wxStyledTextCtrl, getCharAt, 1}},
+ {2959, {wxStyledTextCtrl, getCurrentPos, 0}},
+ {2960, {wxStyledTextCtrl, getAnchor, 0}},
+ {2961, {wxStyledTextCtrl, getStyleAt, 1}},
+ {2962, {wxStyledTextCtrl, redo, 0}},
+ {2963, {wxStyledTextCtrl, setUndoCollection, 1}},
+ {2964, {wxStyledTextCtrl, selectAll, 0}},
+ {2965, {wxStyledTextCtrl, setSavePoint, 0}},
+ {2966, {wxStyledTextCtrl, getStyledText, 2}},
+ {2967, {wxStyledTextCtrl, canRedo, 0}},
+ {2968, {wxStyledTextCtrl, markerLineFromHandle, 1}},
+ {2969, {wxStyledTextCtrl, markerDeleteHandle, 1}},
+ {2970, {wxStyledTextCtrl, getUndoCollection, 0}},
+ {2971, {wxStyledTextCtrl, getViewWhiteSpace, 0}},
+ {2972, {wxStyledTextCtrl, setViewWhiteSpace, 1}},
+ {2973, {wxStyledTextCtrl, positionFromPoint, 1}},
+ {2974, {wxStyledTextCtrl, positionFromPointClose, 2}},
+ {2975, {wxStyledTextCtrl, gotoLine, 1}},
+ {2976, {wxStyledTextCtrl, gotoPos, 1}},
+ {2977, {wxStyledTextCtrl, setAnchor, 1}},
+ {2978, {wxStyledTextCtrl, getCurLine, 1}},
+ {2979, {wxStyledTextCtrl, getEndStyled, 0}},
+ {2980, {wxStyledTextCtrl, convertEOLs, 1}},
+ {2981, {wxStyledTextCtrl, getEOLMode, 0}},
+ {2982, {wxStyledTextCtrl, setEOLMode, 1}},
+ {2983, {wxStyledTextCtrl, startStyling, 2}},
+ {2984, {wxStyledTextCtrl, setStyling, 2}},
+ {2985, {wxStyledTextCtrl, getBufferedDraw, 0}},
+ {2986, {wxStyledTextCtrl, setBufferedDraw, 1}},
+ {2987, {wxStyledTextCtrl, setTabWidth, 1}},
+ {2988, {wxStyledTextCtrl, getTabWidth, 0}},
+ {2989, {wxStyledTextCtrl, setCodePage, 1}},
+ {2990, {wxStyledTextCtrl, markerDefine, 3}},
+ {2991, {wxStyledTextCtrl, markerSetForeground, 2}},
+ {2992, {wxStyledTextCtrl, markerSetBackground, 2}},
+ {2993, {wxStyledTextCtrl, markerAdd, 2}},
+ {2994, {wxStyledTextCtrl, markerDelete, 2}},
+ {2995, {wxStyledTextCtrl, markerDeleteAll, 1}},
+ {2996, {wxStyledTextCtrl, markerGet, 1}},
+ {2997, {wxStyledTextCtrl, markerNext, 2}},
+ {2998, {wxStyledTextCtrl, markerPrevious, 2}},
+ {2999, {wxStyledTextCtrl, markerDefineBitmap, 2}},
+ {3000, {wxStyledTextCtrl, markerAddSet, 2}},
+ {3001, {wxStyledTextCtrl, markerSetAlpha, 2}},
+ {3002, {wxStyledTextCtrl, setMarginType, 2}},
+ {3003, {wxStyledTextCtrl, getMarginType, 1}},
+ {3004, {wxStyledTextCtrl, setMarginWidth, 2}},
+ {3005, {wxStyledTextCtrl, getMarginWidth, 1}},
+ {3006, {wxStyledTextCtrl, setMarginMask, 2}},
+ {3007, {wxStyledTextCtrl, getMarginMask, 1}},
+ {3008, {wxStyledTextCtrl, setMarginSensitive, 2}},
+ {3009, {wxStyledTextCtrl, getMarginSensitive, 1}},
+ {3010, {wxStyledTextCtrl, styleClearAll, 0}},
+ {3011, {wxStyledTextCtrl, styleSetForeground, 2}},
+ {3012, {wxStyledTextCtrl, styleSetBackground, 2}},
+ {3013, {wxStyledTextCtrl, styleSetBold, 2}},
+ {3014, {wxStyledTextCtrl, styleSetItalic, 2}},
+ {3015, {wxStyledTextCtrl, styleSetSize, 2}},
+ {3016, {wxStyledTextCtrl, styleSetFaceName, 2}},
+ {3017, {wxStyledTextCtrl, styleSetEOLFilled, 2}},
+ {3018, {wxStyledTextCtrl, styleResetDefault, 0}},
+ {3019, {wxStyledTextCtrl, styleSetUnderline, 2}},
+ {3020, {wxStyledTextCtrl, styleSetCase, 2}},
+ {3021, {wxStyledTextCtrl, styleSetHotSpot, 2}},
+ {3022, {wxStyledTextCtrl, setSelForeground, 2}},
+ {3023, {wxStyledTextCtrl, setSelBackground, 2}},
+ {3024, {wxStyledTextCtrl, getSelAlpha, 0}},
+ {3025, {wxStyledTextCtrl, setSelAlpha, 1}},
+ {3026, {wxStyledTextCtrl, setCaretForeground, 1}},
+ {3027, {wxStyledTextCtrl, cmdKeyAssign, 3}},
+ {3028, {wxStyledTextCtrl, cmdKeyClear, 2}},
+ {3029, {wxStyledTextCtrl, cmdKeyClearAll, 0}},
+ {3030, {wxStyledTextCtrl, setStyleBytes, 2}},
+ {3031, {wxStyledTextCtrl, styleSetVisible, 2}},
+ {3032, {wxStyledTextCtrl, getCaretPeriod, 0}},
+ {3033, {wxStyledTextCtrl, setCaretPeriod, 1}},
+ {3034, {wxStyledTextCtrl, setWordChars, 1}},
+ {3035, {wxStyledTextCtrl, beginUndoAction, 0}},
+ {3036, {wxStyledTextCtrl, endUndoAction, 0}},
+ {3037, {wxStyledTextCtrl, indicatorSetStyle, 2}},
+ {3038, {wxStyledTextCtrl, indicatorGetStyle, 1}},
+ {3039, {wxStyledTextCtrl, indicatorSetForeground, 2}},
+ {3040, {wxStyledTextCtrl, indicatorGetForeground, 1}},
+ {3041, {wxStyledTextCtrl, setWhitespaceForeground, 2}},
+ {3042, {wxStyledTextCtrl, setWhitespaceBackground, 2}},
+ {3043, {wxStyledTextCtrl, getStyleBits, 0}},
+ {3044, {wxStyledTextCtrl, setLineState, 2}},
+ {3045, {wxStyledTextCtrl, getLineState, 1}},
+ {3046, {wxStyledTextCtrl, getMaxLineState, 0}},
+ {3047, {wxStyledTextCtrl, getCaretLineVisible, 0}},
+ {3048, {wxStyledTextCtrl, setCaretLineVisible, 1}},
+ {3049, {wxStyledTextCtrl, getCaretLineBackground, 0}},
+ {3050, {wxStyledTextCtrl, setCaretLineBackground, 1}},
+ {3051, {wxStyledTextCtrl, autoCompShow, 2}},
+ {3052, {wxStyledTextCtrl, autoCompCancel, 0}},
+ {3053, {wxStyledTextCtrl, autoCompActive, 0}},
+ {3054, {wxStyledTextCtrl, autoCompPosStart, 0}},
+ {3055, {wxStyledTextCtrl, autoCompComplete, 0}},
+ {3056, {wxStyledTextCtrl, autoCompStops, 1}},
+ {3057, {wxStyledTextCtrl, autoCompSetSeparator, 1}},
+ {3058, {wxStyledTextCtrl, autoCompGetSeparator, 0}},
+ {3059, {wxStyledTextCtrl, autoCompSelect, 1}},
+ {3060, {wxStyledTextCtrl, autoCompSetCancelAtStart, 1}},
+ {3061, {wxStyledTextCtrl, autoCompGetCancelAtStart, 0}},
+ {3062, {wxStyledTextCtrl, autoCompSetFillUps, 1}},
+ {3063, {wxStyledTextCtrl, autoCompSetChooseSingle, 1}},
+ {3064, {wxStyledTextCtrl, autoCompGetChooseSingle, 0}},
+ {3065, {wxStyledTextCtrl, autoCompSetIgnoreCase, 1}},
+ {3066, {wxStyledTextCtrl, autoCompGetIgnoreCase, 0}},
+ {3067, {wxStyledTextCtrl, userListShow, 2}},
+ {3068, {wxStyledTextCtrl, autoCompSetAutoHide, 1}},
+ {3069, {wxStyledTextCtrl, autoCompGetAutoHide, 0}},
+ {3070, {wxStyledTextCtrl, autoCompSetDropRestOfWord, 1}},
+ {3071, {wxStyledTextCtrl, autoCompGetDropRestOfWord, 0}},
+ {3072, {wxStyledTextCtrl, registerImage, 2}},
+ {3073, {wxStyledTextCtrl, clearRegisteredImages, 0}},
+ {3074, {wxStyledTextCtrl, autoCompGetTypeSeparator, 0}},
+ {3075, {wxStyledTextCtrl, autoCompSetTypeSeparator, 1}},
+ {3076, {wxStyledTextCtrl, autoCompSetMaxWidth, 1}},
+ {3077, {wxStyledTextCtrl, autoCompGetMaxWidth, 0}},
+ {3078, {wxStyledTextCtrl, autoCompSetMaxHeight, 1}},
+ {3079, {wxStyledTextCtrl, autoCompGetMaxHeight, 0}},
+ {3080, {wxStyledTextCtrl, setIndent, 1}},
+ {3081, {wxStyledTextCtrl, getIndent, 0}},
+ {3082, {wxStyledTextCtrl, setUseTabs, 1}},
+ {3083, {wxStyledTextCtrl, getUseTabs, 0}},
+ {3084, {wxStyledTextCtrl, setLineIndentation, 2}},
+ {3085, {wxStyledTextCtrl, getLineIndentation, 1}},
+ {3086, {wxStyledTextCtrl, getLineIndentPosition, 1}},
+ {3087, {wxStyledTextCtrl, getColumn, 1}},
+ {3088, {wxStyledTextCtrl, setUseHorizontalScrollBar, 1}},
+ {3089, {wxStyledTextCtrl, getUseHorizontalScrollBar, 0}},
+ {3090, {wxStyledTextCtrl, setIndentationGuides, 1}},
+ {3091, {wxStyledTextCtrl, getIndentationGuides, 0}},
+ {3092, {wxStyledTextCtrl, setHighlightGuide, 1}},
+ {3093, {wxStyledTextCtrl, getHighlightGuide, 0}},
+ {3094, {wxStyledTextCtrl, getLineEndPosition, 1}},
+ {3095, {wxStyledTextCtrl, getCodePage, 0}},
+ {3096, {wxStyledTextCtrl, getCaretForeground, 0}},
+ {3097, {wxStyledTextCtrl, getReadOnly, 0}},
+ {3098, {wxStyledTextCtrl, setCurrentPos, 1}},
+ {3099, {wxStyledTextCtrl, setSelectionStart, 1}},
+ {3100, {wxStyledTextCtrl, getSelectionStart, 0}},
+ {3101, {wxStyledTextCtrl, setSelectionEnd, 1}},
+ {3102, {wxStyledTextCtrl, getSelectionEnd, 0}},
+ {3103, {wxStyledTextCtrl, setPrintMagnification, 1}},
+ {3104, {wxStyledTextCtrl, getPrintMagnification, 0}},
+ {3105, {wxStyledTextCtrl, setPrintColourMode, 1}},
+ {3106, {wxStyledTextCtrl, getPrintColourMode, 0}},
+ {3107, {wxStyledTextCtrl, findText, 4}},
+ {3108, {wxStyledTextCtrl, formatRange, 7}},
+ {3109, {wxStyledTextCtrl, getFirstVisibleLine, 0}},
+ {3110, {wxStyledTextCtrl, getLine, 1}},
+ {3111, {wxStyledTextCtrl, getLineCount, 0}},
+ {3112, {wxStyledTextCtrl, setMarginLeft, 1}},
+ {3113, {wxStyledTextCtrl, getMarginLeft, 0}},
+ {3114, {wxStyledTextCtrl, setMarginRight, 1}},
+ {3115, {wxStyledTextCtrl, getMarginRight, 0}},
+ {3116, {wxStyledTextCtrl, getModify, 0}},
+ {3117, {wxStyledTextCtrl, setSelection, 2}},
+ {3118, {wxStyledTextCtrl, getSelectedText, 0}},
+ {3119, {wxStyledTextCtrl, getTextRange, 2}},
+ {3120, {wxStyledTextCtrl, hideSelection, 1}},
+ {3121, {wxStyledTextCtrl, lineFromPosition, 1}},
+ {3122, {wxStyledTextCtrl, positionFromLine, 1}},
+ {3123, {wxStyledTextCtrl, lineScroll, 2}},
+ {3124, {wxStyledTextCtrl, ensureCaretVisible, 0}},
+ {3125, {wxStyledTextCtrl, replaceSelection, 1}},
+ {3126, {wxStyledTextCtrl, setReadOnly, 1}},
+ {3127, {wxStyledTextCtrl, canPaste, 0}},
+ {3128, {wxStyledTextCtrl, canUndo, 0}},
+ {3129, {wxStyledTextCtrl, emptyUndoBuffer, 0}},
+ {3130, {wxStyledTextCtrl, undo, 0}},
+ {3131, {wxStyledTextCtrl, cut, 0}},
+ {3132, {wxStyledTextCtrl, copy, 0}},
+ {3133, {wxStyledTextCtrl, paste, 0}},
+ {3134, {wxStyledTextCtrl, clear, 0}},
+ {3135, {wxStyledTextCtrl, setText, 1}},
+ {3136, {wxStyledTextCtrl, getText, 0}},
+ {3137, {wxStyledTextCtrl, getTextLength, 0}},
+ {3138, {wxStyledTextCtrl, getOvertype, 0}},
+ {3139, {wxStyledTextCtrl, setCaretWidth, 1}},
+ {3140, {wxStyledTextCtrl, getCaretWidth, 0}},
+ {3141, {wxStyledTextCtrl, setTargetStart, 1}},
+ {3142, {wxStyledTextCtrl, getTargetStart, 0}},
+ {3143, {wxStyledTextCtrl, setTargetEnd, 1}},
+ {3144, {wxStyledTextCtrl, getTargetEnd, 0}},
+ {3145, {wxStyledTextCtrl, replaceTarget, 1}},
+ {3146, {wxStyledTextCtrl, searchInTarget, 1}},
+ {3147, {wxStyledTextCtrl, setSearchFlags, 1}},
+ {3148, {wxStyledTextCtrl, getSearchFlags, 0}},
+ {3149, {wxStyledTextCtrl, callTipShow, 2}},
+ {3150, {wxStyledTextCtrl, callTipCancel, 0}},
+ {3151, {wxStyledTextCtrl, callTipActive, 0}},
+ {3152, {wxStyledTextCtrl, callTipPosAtStart, 0}},
+ {3153, {wxStyledTextCtrl, callTipSetHighlight, 2}},
+ {3154, {wxStyledTextCtrl, callTipSetBackground, 1}},
+ {3155, {wxStyledTextCtrl, callTipSetForeground, 1}},
+ {3156, {wxStyledTextCtrl, callTipSetForegroundHighlight, 1}},
+ {3157, {wxStyledTextCtrl, callTipUseStyle, 1}},
+ {3158, {wxStyledTextCtrl, visibleFromDocLine, 1}},
+ {3159, {wxStyledTextCtrl, docLineFromVisible, 1}},
+ {3160, {wxStyledTextCtrl, wrapCount, 1}},
+ {3161, {wxStyledTextCtrl, setFoldLevel, 2}},
+ {3162, {wxStyledTextCtrl, getFoldLevel, 1}},
+ {3163, {wxStyledTextCtrl, getLastChild, 2}},
+ {3164, {wxStyledTextCtrl, getFoldParent, 1}},
+ {3165, {wxStyledTextCtrl, showLines, 2}},
+ {3166, {wxStyledTextCtrl, hideLines, 2}},
+ {3167, {wxStyledTextCtrl, getLineVisible, 1}},
+ {3168, {wxStyledTextCtrl, setFoldExpanded, 2}},
+ {3169, {wxStyledTextCtrl, getFoldExpanded, 1}},
+ {3170, {wxStyledTextCtrl, toggleFold, 1}},
+ {3171, {wxStyledTextCtrl, ensureVisible, 1}},
+ {3172, {wxStyledTextCtrl, setFoldFlags, 1}},
+ {3173, {wxStyledTextCtrl, ensureVisibleEnforcePolicy, 1}},
+ {3174, {wxStyledTextCtrl, setTabIndents, 1}},
+ {3175, {wxStyledTextCtrl, getTabIndents, 0}},
+ {3176, {wxStyledTextCtrl, setBackSpaceUnIndents, 1}},
+ {3177, {wxStyledTextCtrl, getBackSpaceUnIndents, 0}},
+ {3178, {wxStyledTextCtrl, setMouseDwellTime, 1}},
+ {3179, {wxStyledTextCtrl, getMouseDwellTime, 0}},
+ {3180, {wxStyledTextCtrl, wordStartPosition, 2}},
+ {3181, {wxStyledTextCtrl, wordEndPosition, 2}},
+ {3182, {wxStyledTextCtrl, setWrapMode, 1}},
+ {3183, {wxStyledTextCtrl, getWrapMode, 0}},
+ {3184, {wxStyledTextCtrl, setWrapVisualFlags, 1}},
+ {3185, {wxStyledTextCtrl, getWrapVisualFlags, 0}},
+ {3186, {wxStyledTextCtrl, setWrapVisualFlagsLocation, 1}},
+ {3187, {wxStyledTextCtrl, getWrapVisualFlagsLocation, 0}},
+ {3188, {wxStyledTextCtrl, setWrapStartIndent, 1}},
+ {3189, {wxStyledTextCtrl, getWrapStartIndent, 0}},
+ {3190, {wxStyledTextCtrl, setLayoutCache, 1}},
+ {3191, {wxStyledTextCtrl, getLayoutCache, 0}},
+ {3192, {wxStyledTextCtrl, setScrollWidth, 1}},
+ {3193, {wxStyledTextCtrl, getScrollWidth, 0}},
+ {3194, {wxStyledTextCtrl, textWidth, 2}},
+ {3195, {wxStyledTextCtrl, getEndAtLastLine, 0}},
+ {3196, {wxStyledTextCtrl, textHeight, 1}},
+ {3197, {wxStyledTextCtrl, setUseVerticalScrollBar, 1}},
+ {3198, {wxStyledTextCtrl, getUseVerticalScrollBar, 0}},
+ {3199, {wxStyledTextCtrl, appendText, 1}},
+ {3200, {wxStyledTextCtrl, getTwoPhaseDraw, 0}},
+ {3201, {wxStyledTextCtrl, setTwoPhaseDraw, 1}},
+ {3202, {wxStyledTextCtrl, targetFromSelection, 0}},
+ {3203, {wxStyledTextCtrl, linesJoin, 0}},
+ {3204, {wxStyledTextCtrl, linesSplit, 1}},
+ {3205, {wxStyledTextCtrl, setFoldMarginColour, 2}},
+ {3206, {wxStyledTextCtrl, setFoldMarginHiColour, 2}},
+ {3207, {wxStyledTextCtrl, lineDown, 0}},
+ {3208, {wxStyledTextCtrl, lineDownExtend, 0}},
+ {3209, {wxStyledTextCtrl, lineUp, 0}},
+ {3210, {wxStyledTextCtrl, lineUpExtend, 0}},
+ {3211, {wxStyledTextCtrl, charLeft, 0}},
+ {3212, {wxStyledTextCtrl, charLeftExtend, 0}},
+ {3213, {wxStyledTextCtrl, charRight, 0}},
+ {3214, {wxStyledTextCtrl, charRightExtend, 0}},
+ {3215, {wxStyledTextCtrl, wordLeft, 0}},
+ {3216, {wxStyledTextCtrl, wordLeftExtend, 0}},
+ {3217, {wxStyledTextCtrl, wordRight, 0}},
+ {3218, {wxStyledTextCtrl, wordRightExtend, 0}},
+ {3219, {wxStyledTextCtrl, home, 0}},
+ {3220, {wxStyledTextCtrl, homeExtend, 0}},
+ {3221, {wxStyledTextCtrl, lineEnd, 0}},
+ {3222, {wxStyledTextCtrl, lineEndExtend, 0}},
+ {3223, {wxStyledTextCtrl, documentStart, 0}},
+ {3224, {wxStyledTextCtrl, documentStartExtend, 0}},
+ {3225, {wxStyledTextCtrl, documentEnd, 0}},
+ {3226, {wxStyledTextCtrl, documentEndExtend, 0}},
+ {3227, {wxStyledTextCtrl, pageUp, 0}},
+ {3228, {wxStyledTextCtrl, pageUpExtend, 0}},
+ {3229, {wxStyledTextCtrl, pageDown, 0}},
+ {3230, {wxStyledTextCtrl, pageDownExtend, 0}},
+ {3231, {wxStyledTextCtrl, editToggleOvertype, 0}},
+ {3232, {wxStyledTextCtrl, cancel, 0}},
+ {3233, {wxStyledTextCtrl, deleteBack, 0}},
+ {3234, {wxStyledTextCtrl, tab, 0}},
+ {3235, {wxStyledTextCtrl, backTab, 0}},
+ {3236, {wxStyledTextCtrl, newLine, 0}},
+ {3237, {wxStyledTextCtrl, formFeed, 0}},
+ {3238, {wxStyledTextCtrl, vCHome, 0}},
+ {3239, {wxStyledTextCtrl, vCHomeExtend, 0}},
+ {3240, {wxStyledTextCtrl, zoomIn, 0}},
+ {3241, {wxStyledTextCtrl, zoomOut, 0}},
+ {3242, {wxStyledTextCtrl, delWordLeft, 0}},
+ {3243, {wxStyledTextCtrl, delWordRight, 0}},
+ {3244, {wxStyledTextCtrl, lineCut, 0}},
+ {3245, {wxStyledTextCtrl, lineDelete, 0}},
+ {3246, {wxStyledTextCtrl, lineTranspose, 0}},
+ {3247, {wxStyledTextCtrl, lineDuplicate, 0}},
+ {3248, {wxStyledTextCtrl, lowerCase, 0}},
+ {3249, {wxStyledTextCtrl, upperCase, 0}},
+ {3250, {wxStyledTextCtrl, lineScrollDown, 0}},
+ {3251, {wxStyledTextCtrl, lineScrollUp, 0}},
+ {3252, {wxStyledTextCtrl, deleteBackNotLine, 0}},
+ {3253, {wxStyledTextCtrl, homeDisplay, 0}},
+ {3254, {wxStyledTextCtrl, homeDisplayExtend, 0}},
+ {3255, {wxStyledTextCtrl, lineEndDisplay, 0}},
+ {3256, {wxStyledTextCtrl, lineEndDisplayExtend, 0}},
+ {3257, {wxStyledTextCtrl, homeWrapExtend, 0}},
+ {3258, {wxStyledTextCtrl, lineEndWrap, 0}},
+ {3259, {wxStyledTextCtrl, lineEndWrapExtend, 0}},
+ {3260, {wxStyledTextCtrl, vCHomeWrap, 0}},
+ {3261, {wxStyledTextCtrl, vCHomeWrapExtend, 0}},
+ {3262, {wxStyledTextCtrl, lineCopy, 0}},
+ {3263, {wxStyledTextCtrl, moveCaretInsideView, 0}},
+ {3264, {wxStyledTextCtrl, lineLength, 1}},
+ {3265, {wxStyledTextCtrl, braceHighlight, 2}},
+ {3266, {wxStyledTextCtrl, braceBadLight, 1}},
+ {3267, {wxStyledTextCtrl, braceMatch, 1}},
+ {3268, {wxStyledTextCtrl, getViewEOL, 0}},
+ {3269, {wxStyledTextCtrl, setViewEOL, 1}},
+ {3270, {wxStyledTextCtrl, setModEventMask, 1}},
+ {3271, {wxStyledTextCtrl, getEdgeColumn, 0}},
+ {3272, {wxStyledTextCtrl, setEdgeColumn, 1}},
+ {3273, {wxStyledTextCtrl, setEdgeMode, 1}},
+ {3274, {wxStyledTextCtrl, getEdgeMode, 0}},
+ {3275, {wxStyledTextCtrl, getEdgeColour, 0}},
+ {3276, {wxStyledTextCtrl, setEdgeColour, 1}},
+ {3277, {wxStyledTextCtrl, searchAnchor, 0}},
+ {3278, {wxStyledTextCtrl, searchNext, 2}},
+ {3279, {wxStyledTextCtrl, searchPrev, 2}},
+ {3280, {wxStyledTextCtrl, linesOnScreen, 0}},
+ {3281, {wxStyledTextCtrl, usePopUp, 1}},
+ {3282, {wxStyledTextCtrl, selectionIsRectangle, 0}},
+ {3283, {wxStyledTextCtrl, setZoom, 1}},
+ {3284, {wxStyledTextCtrl, getZoom, 0}},
+ {3285, {wxStyledTextCtrl, getModEventMask, 0}},
+ {3286, {wxStyledTextCtrl, setSTCFocus, 1}},
+ {3287, {wxStyledTextCtrl, getSTCFocus, 0}},
+ {3288, {wxStyledTextCtrl, setStatus, 1}},
+ {3289, {wxStyledTextCtrl, getStatus, 0}},
+ {3290, {wxStyledTextCtrl, setMouseDownCaptures, 1}},
+ {3291, {wxStyledTextCtrl, getMouseDownCaptures, 0}},
+ {3292, {wxStyledTextCtrl, setSTCCursor, 1}},
+ {3293, {wxStyledTextCtrl, getSTCCursor, 0}},
+ {3294, {wxStyledTextCtrl, setControlCharSymbol, 1}},
+ {3295, {wxStyledTextCtrl, getControlCharSymbol, 0}},
+ {3296, {wxStyledTextCtrl, wordPartLeft, 0}},
+ {3297, {wxStyledTextCtrl, wordPartLeftExtend, 0}},
+ {3298, {wxStyledTextCtrl, wordPartRight, 0}},
+ {3299, {wxStyledTextCtrl, wordPartRightExtend, 0}},
+ {3300, {wxStyledTextCtrl, setVisiblePolicy, 2}},
+ {3301, {wxStyledTextCtrl, delLineLeft, 0}},
+ {3302, {wxStyledTextCtrl, delLineRight, 0}},
+ {3303, {wxStyledTextCtrl, getXOffset, 0}},
+ {3304, {wxStyledTextCtrl, chooseCaretX, 0}},
+ {3305, {wxStyledTextCtrl, setXCaretPolicy, 2}},
+ {3306, {wxStyledTextCtrl, setYCaretPolicy, 2}},
+ {3307, {wxStyledTextCtrl, getPrintWrapMode, 0}},
+ {3308, {wxStyledTextCtrl, setHotspotActiveForeground, 2}},
+ {3309, {wxStyledTextCtrl, setHotspotActiveBackground, 2}},
+ {3310, {wxStyledTextCtrl, setHotspotActiveUnderline, 1}},
+ {3311, {wxStyledTextCtrl, setHotspotSingleLine, 1}},
+ {3312, {wxStyledTextCtrl, paraDownExtend, 0}},
+ {3313, {wxStyledTextCtrl, paraUp, 0}},
+ {3314, {wxStyledTextCtrl, paraUpExtend, 0}},
+ {3315, {wxStyledTextCtrl, positionBefore, 1}},
+ {3316, {wxStyledTextCtrl, positionAfter, 1}},
+ {3317, {wxStyledTextCtrl, copyRange, 2}},
+ {3318, {wxStyledTextCtrl, copyText, 2}},
+ {3319, {wxStyledTextCtrl, setSelectionMode, 1}},
+ {3320, {wxStyledTextCtrl, getSelectionMode, 0}},
+ {3321, {wxStyledTextCtrl, lineDownRectExtend, 0}},
+ {3322, {wxStyledTextCtrl, lineUpRectExtend, 0}},
+ {3323, {wxStyledTextCtrl, charLeftRectExtend, 0}},
+ {3324, {wxStyledTextCtrl, charRightRectExtend, 0}},
+ {3325, {wxStyledTextCtrl, homeRectExtend, 0}},
+ {3326, {wxStyledTextCtrl, vCHomeRectExtend, 0}},
+ {3327, {wxStyledTextCtrl, lineEndRectExtend, 0}},
+ {3328, {wxStyledTextCtrl, pageUpRectExtend, 0}},
+ {3329, {wxStyledTextCtrl, pageDownRectExtend, 0}},
+ {3330, {wxStyledTextCtrl, stutteredPageUp, 0}},
+ {3331, {wxStyledTextCtrl, stutteredPageUpExtend, 0}},
+ {3332, {wxStyledTextCtrl, stutteredPageDown, 0}},
+ {3333, {wxStyledTextCtrl, stutteredPageDownExtend, 0}},
+ {3334, {wxStyledTextCtrl, wordLeftEnd, 0}},
+ {3335, {wxStyledTextCtrl, wordLeftEndExtend, 0}},
+ {3336, {wxStyledTextCtrl, wordRightEnd, 0}},
+ {3337, {wxStyledTextCtrl, wordRightEndExtend, 0}},
+ {3338, {wxStyledTextCtrl, setWhitespaceChars, 1}},
+ {3339, {wxStyledTextCtrl, setCharsDefault, 0}},
+ {3340, {wxStyledTextCtrl, autoCompGetCurrent, 0}},
+ {3341, {wxStyledTextCtrl, allocate, 1}},
+ {3342, {wxStyledTextCtrl, findColumn, 2}},
+ {3343, {wxStyledTextCtrl, getCaretSticky, 0}},
+ {3344, {wxStyledTextCtrl, setCaretSticky, 1}},
+ {3345, {wxStyledTextCtrl, toggleCaretSticky, 0}},
+ {3346, {wxStyledTextCtrl, setPasteConvertEndings, 1}},
+ {3347, {wxStyledTextCtrl, getPasteConvertEndings, 0}},
+ {3348, {wxStyledTextCtrl, selectionDuplicate, 0}},
+ {3349, {wxStyledTextCtrl, setCaretLineBackAlpha, 1}},
+ {3350, {wxStyledTextCtrl, getCaretLineBackAlpha, 0}},
+ {3351, {wxStyledTextCtrl, startRecord, 0}},
+ {3352, {wxStyledTextCtrl, stopRecord, 0}},
+ {3353, {wxStyledTextCtrl, setLexer, 1}},
+ {3354, {wxStyledTextCtrl, getLexer, 0}},
+ {3355, {wxStyledTextCtrl, colourise, 2}},
+ {3356, {wxStyledTextCtrl, setProperty, 2}},
+ {3357, {wxStyledTextCtrl, setKeyWords, 2}},
+ {3358, {wxStyledTextCtrl, setLexerLanguage, 1}},
+ {3359, {wxStyledTextCtrl, getProperty, 1}},
+ {3360, {wxStyledTextCtrl, getStyleBitsNeeded, 0}},
+ {3361, {wxStyledTextCtrl, getCurrentLine, 0}},
+ {3362, {wxStyledTextCtrl, styleSetSpec, 2}},
+ {3363, {wxStyledTextCtrl, styleSetFont, 2}},
+ {3364, {wxStyledTextCtrl, styleSetFontAttr, 7}},
+ {3365, {wxStyledTextCtrl, styleSetCharacterSet, 2}},
+ {3366, {wxStyledTextCtrl, styleSetFontEncoding, 2}},
+ {3367, {wxStyledTextCtrl, cmdKeyExecute, 1}},
+ {3368, {wxStyledTextCtrl, setMargins, 2}},
+ {3369, {wxStyledTextCtrl, getSelection, 2}},
+ {3370, {wxStyledTextCtrl, pointFromPosition, 1}},
+ {3371, {wxStyledTextCtrl, scrollToLine, 1}},
+ {3372, {wxStyledTextCtrl, scrollToColumn, 1}},
+ {3373, {wxStyledTextCtrl, sendMsg, 2}},
+ {3374, {wxStyledTextCtrl, setVScrollBar, 1}},
+ {3375, {wxStyledTextCtrl, setHScrollBar, 1}},
+ {3376, {wxStyledTextCtrl, getLastKeydownProcessed, 0}},
+ {3377, {wxStyledTextCtrl, setLastKeydownProcessed, 1}},
+ {3378, {wxStyledTextCtrl, saveFile, 1}},
+ {3379, {wxStyledTextCtrl, loadFile, 1}},
+ {3380, {wxStyledTextCtrl, doDragOver, 3}},
+ {3381, {wxStyledTextCtrl, doDropText, 3}},
+ {3382, {wxStyledTextCtrl, getUseAntiAliasing, 0}},
+ {3383, {wxStyledTextCtrl, addTextRaw, 1}},
+ {3384, {wxStyledTextCtrl, insertTextRaw, 2}},
+ {3385, {wxStyledTextCtrl, getCurLineRaw, 1}},
+ {3386, {wxStyledTextCtrl, getLineRaw, 1}},
+ {3387, {wxStyledTextCtrl, getSelectedTextRaw, 0}},
+ {3388, {wxStyledTextCtrl, getTextRangeRaw, 2}},
+ {3389, {wxStyledTextCtrl, setTextRaw, 1}},
+ {3390, {wxStyledTextCtrl, getTextRaw, 0}},
+ {3391, {wxStyledTextCtrl, appendTextRaw, 1}},
+ {3392, {wxArtProvider, getBitmap, 2}},
+ {3393, {wxArtProvider, getIcon, 2}},
+ {3394, {wxTreeEvent, getKeyCode, 0}},
+ {3395, {wxTreeEvent, getItem, 0}},
+ {3396, {wxTreeEvent, getKeyEvent, 0}},
+ {3397, {wxTreeEvent, getLabel, 0}},
+ {3398, {wxTreeEvent, getOldItem, 0}},
+ {3399, {wxTreeEvent, getPoint, 0}},
+ {3400, {wxTreeEvent, isEditCancelled, 0}},
+ {3401, {wxTreeEvent, setToolTip, 1}},
+ {3402, {wxNotebookEvent, getOldSelection, 0}},
+ {3403, {wxNotebookEvent, getSelection, 0}},
+ {3404, {wxNotebookEvent, setOldSelection, 1}},
+ {3405, {wxNotebookEvent, setSelection, 1}},
+ {3406, {wxFileDataObject, new, 0}},
+ {3407, {wxFileDataObject, addFile, 1}},
+ {3408, {wxFileDataObject, getFilenames, 0}},
+ {3409, {wxFileDataObject, 'Destroy', undefined}},
+ {3410, {wxTextDataObject, new, 1}},
+ {3411, {wxTextDataObject, getTextLength, 0}},
+ {3412, {wxTextDataObject, getText, 0}},
+ {3413, {wxTextDataObject, setText, 1}},
+ {3414, {wxTextDataObject, 'Destroy', undefined}},
+ {3415, {wxBitmapDataObject, new_1_1, 1}},
+ {3416, {wxBitmapDataObject, new_1_0, 1}},
+ {3417, {wxBitmapDataObject, getBitmap, 0}},
+ {3418, {wxBitmapDataObject, setBitmap, 1}},
+ {3419, {wxBitmapDataObject, 'Destroy', undefined}},
+ {3421, {wxClipboard, new, 0}},
+ {3422, {wxClipboard, destruct, 0}},
+ {3423, {wxClipboard, addData, 1}},
+ {3424, {wxClipboard, clear, 0}},
+ {3425, {wxClipboard, close, 0}},
+ {3426, {wxClipboard, flush, 0}},
+ {3427, {wxClipboard, getData, 1}},
+ {3428, {wxClipboard, isOpened, 0}},
+ {3429, {wxClipboard, open, 0}},
+ {3430, {wxClipboard, setData, 1}},
+ {3432, {wxClipboard, usePrimarySelection, 1}},
+ {3433, {wxClipboard, isSupported, 1}},
+ {3434, {wxClipboard, get, 0}},
+ {3435, {wxSpinEvent, getPosition, 0}},
+ {3436, {wxSpinEvent, setPosition, 1}},
+ {3437, {wxSplitterWindow, new_0, 0}},
+ {3438, {wxSplitterWindow, new_2, 2}},
+ {3439, {wxSplitterWindow, destruct, 0}},
+ {3440, {wxSplitterWindow, create, 2}},
+ {3441, {wxSplitterWindow, getMinimumPaneSize, 0}},
+ {3442, {wxSplitterWindow, getSashGravity, 0}},
+ {3443, {wxSplitterWindow, getSashPosition, 0}},
+ {3444, {wxSplitterWindow, getSplitMode, 0}},
+ {3445, {wxSplitterWindow, getWindow1, 0}},
+ {3446, {wxSplitterWindow, getWindow2, 0}},
+ {3447, {wxSplitterWindow, initialize, 1}},
+ {3448, {wxSplitterWindow, isSplit, 0}},
+ {3449, {wxSplitterWindow, replaceWindow, 2}},
+ {3450, {wxSplitterWindow, setSashGravity, 1}},
+ {3451, {wxSplitterWindow, setSashPosition, 2}},
+ {3452, {wxSplitterWindow, setSashSize, 1}},
+ {3453, {wxSplitterWindow, setMinimumPaneSize, 1}},
+ {3454, {wxSplitterWindow, setSplitMode, 1}},
+ {3455, {wxSplitterWindow, splitHorizontally, 3}},
+ {3456, {wxSplitterWindow, splitVertically, 3}},
+ {3457, {wxSplitterWindow, unsplit, 1}},
+ {3458, {wxSplitterWindow, updateSize, 0}},
+ {3459, {wxSplitterEvent, getSashPosition, 0}},
+ {3460, {wxSplitterEvent, getX, 0}},
+ {3461, {wxSplitterEvent, getY, 0}},
+ {3462, {wxSplitterEvent, getWindowBeingRemoved, 0}},
+ {3463, {wxSplitterEvent, setSashPosition, 1}},
+ {3464, {wxHtmlWindow, new_0, 0}},
+ {3465, {wxHtmlWindow, new_2, 2}},
+ {3466, {wxHtmlWindow, appendToPage, 1}},
+ {3467, {wxHtmlWindow, getOpenedAnchor, 0}},
+ {3468, {wxHtmlWindow, getOpenedPage, 0}},
+ {3469, {wxHtmlWindow, getOpenedPageTitle, 0}},
+ {3470, {wxHtmlWindow, getRelatedFrame, 0}},
+ {3471, {wxHtmlWindow, historyBack, 0}},
+ {3472, {wxHtmlWindow, historyCanBack, 0}},
+ {3473, {wxHtmlWindow, historyCanForward, 0}},
+ {3474, {wxHtmlWindow, historyClear, 0}},
+ {3475, {wxHtmlWindow, historyForward, 0}},
+ {3476, {wxHtmlWindow, loadFile, 1}},
+ {3477, {wxHtmlWindow, loadPage, 1}},
+ {3478, {wxHtmlWindow, selectAll, 0}},
+ {3479, {wxHtmlWindow, selectionToText, 0}},
+ {3480, {wxHtmlWindow, selectLine, 1}},
+ {3481, {wxHtmlWindow, selectWord, 1}},
+ {3482, {wxHtmlWindow, setBorders, 1}},
+ {3483, {wxHtmlWindow, setFonts, 3}},
+ {3484, {wxHtmlWindow, setPage, 1}},
+ {3485, {wxHtmlWindow, setRelatedFrame, 2}},
+ {3486, {wxHtmlWindow, setRelatedStatusBar, 1}},
+ {3487, {wxHtmlWindow, toText, 0}},
+ {3488, {wxHtmlWindow, 'Destroy', undefined}},
+ {3489, {wxHtmlLinkEvent, getLinkInfo, 0}},
+ {3490, {wxSystemSettings, getColour, 1}},
+ {3491, {wxSystemSettings, getFont, 1}},
+ {3492, {wxSystemSettings, getMetric, 2}},
+ {3493, {wxSystemSettings, getScreenType, 0}},
+ {3494, {wxSystemOptions, getOption, 1}},
+ {3495, {wxSystemOptions, getOptionInt, 1}},
+ {3496, {wxSystemOptions, hasOption, 1}},
+ {3497, {wxSystemOptions, isFalse, 1}},
+ {3498, {wxSystemOptions, setOption_2_1, 2}},
+ {3499, {wxSystemOptions, setOption_2_0, 2}},
+ {3500, {wxAuiNotebookEvent, setSelection, 1}},
+ {3501, {wxAuiNotebookEvent, getSelection, 0}},
+ {3502, {wxAuiNotebookEvent, setOldSelection, 1}},
+ {3503, {wxAuiNotebookEvent, getOldSelection, 0}},
+ {3504, {wxAuiNotebookEvent, setDragSource, 1}},
+ {3505, {wxAuiNotebookEvent, getDragSource, 0}},
+ {3506, {wxAuiManagerEvent, setManager, 1}},
+ {3507, {wxAuiManagerEvent, getManager, 0}},
+ {3508, {wxAuiManagerEvent, setPane, 1}},
+ {3509, {wxAuiManagerEvent, getPane, 0}},
+ {3510, {wxAuiManagerEvent, setButton, 1}},
+ {3511, {wxAuiManagerEvent, getButton, 0}},
+ {3512, {wxAuiManagerEvent, setDC, 1}},
+ {3513, {wxAuiManagerEvent, getDC, 0}},
+ {3514, {wxAuiManagerEvent, veto, 1}},
+ {3515, {wxAuiManagerEvent, getVeto, 0}},
+ {3516, {wxAuiManagerEvent, setCanVeto, 1}},
+ {3517, {wxAuiManagerEvent, canVeto, 0}},
+ {3518, {wxLogNull, new, 0}},
+ {3519, {wxLogNull, 'Destroy', undefined}},
+ {3520, {wxTaskBarIcon, new, 0}},
+ {3521, {wxTaskBarIcon, destruct, 0}},
+ {3522, {wxTaskBarIcon, popupMenu, 1}},
+ {3523, {wxTaskBarIcon, removeIcon, 0}},
+ {3524, {wxTaskBarIcon, setIcon, 2}},
{-1, {mod, func, -1}}
].
diff --git a/lib/wx/src/gen/wxe_funcs.hrl b/lib/wx/src/gen/wxe_funcs.hrl
index 55cbee5572..fe35cb1374 100644
--- a/lib/wx/src/gen/wxe_funcs.hrl
+++ b/lib/wx/src/gen/wxe_funcs.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -561,2738 +561,2743 @@
-define(wxDC_GetCharHeight, 663).
-define(wxDC_GetCharWidth, 664).
-define(wxDC_GetClippingBox, 665).
--define(wxDC_GetFont, 666).
--define(wxDC_GetLayoutDirection, 667).
--define(wxDC_GetLogicalFunction, 668).
--define(wxDC_GetMapMode, 669).
--define(wxDC_GetMultiLineTextExtent_4, 670).
--define(wxDC_GetMultiLineTextExtent_1, 671).
--define(wxDC_GetPartialTextExtents, 672).
--define(wxDC_GetPen, 673).
--define(wxDC_GetPixel, 674).
--define(wxDC_GetPPI, 675).
--define(wxDC_GetSize, 677).
--define(wxDC_GetSizeMM, 679).
--define(wxDC_GetTextBackground, 680).
--define(wxDC_GetTextExtent_4, 681).
--define(wxDC_GetTextExtent_1, 682).
--define(wxDC_GetTextForeground, 684).
--define(wxDC_GetUserScale, 685).
--define(wxDC_GradientFillConcentric_3, 686).
--define(wxDC_GradientFillConcentric_4, 687).
--define(wxDC_GradientFillLinear, 688).
--define(wxDC_LogicalToDeviceX, 689).
--define(wxDC_LogicalToDeviceXRel, 690).
--define(wxDC_LogicalToDeviceY, 691).
--define(wxDC_LogicalToDeviceYRel, 692).
--define(wxDC_MaxX, 693).
--define(wxDC_MaxY, 694).
--define(wxDC_MinX, 695).
--define(wxDC_MinY, 696).
--define(wxDC_IsOk, 697).
--define(wxDC_ResetBoundingBox, 698).
--define(wxDC_SetAxisOrientation, 699).
--define(wxDC_SetBackground, 700).
--define(wxDC_SetBackgroundMode, 701).
--define(wxDC_SetBrush, 702).
--define(wxDC_SetClippingRegion_2, 704).
--define(wxDC_SetClippingRegion_1_1, 705).
--define(wxDC_SetClippingRegion_1_0, 706).
--define(wxDC_SetDeviceOrigin, 707).
--define(wxDC_SetFont, 708).
--define(wxDC_SetLayoutDirection, 709).
--define(wxDC_SetLogicalFunction, 710).
--define(wxDC_SetMapMode, 711).
--define(wxDC_SetPalette, 712).
--define(wxDC_SetPen, 713).
--define(wxDC_SetTextBackground, 714).
--define(wxDC_SetTextForeground, 715).
--define(wxDC_SetUserScale, 716).
--define(wxDC_StartDoc, 717).
--define(wxDC_StartPage, 718).
--define(wxMirrorDC_new, 719).
--define(wxMirrorDC_destroy, 720).
--define(wxScreenDC_new, 721).
--define(wxScreenDC_destruct, 722).
--define(wxPostScriptDC_new_0, 723).
--define(wxPostScriptDC_new_1, 724).
--define(wxPostScriptDC_destruct, 725).
--define(wxPostScriptDC_SetResolution, 726).
--define(wxPostScriptDC_GetResolution, 727).
--define(wxWindowDC_new_0, 728).
--define(wxWindowDC_new_1, 729).
--define(wxWindowDC_destruct, 730).
--define(wxClientDC_new_0, 731).
--define(wxClientDC_new_1, 732).
--define(wxClientDC_destroy, 733).
--define(wxPaintDC_new_0, 734).
--define(wxPaintDC_new_1, 735).
--define(wxPaintDC_destroy, 736).
--define(wxMemoryDC_new_1_0, 738).
--define(wxMemoryDC_new_1_1, 739).
--define(wxMemoryDC_new_0, 740).
--define(wxMemoryDC_destruct, 742).
--define(wxMemoryDC_SelectObject, 743).
--define(wxMemoryDC_SelectObjectAsSource, 744).
--define(wxBufferedDC_new_0, 745).
--define(wxBufferedDC_new_2, 746).
--define(wxBufferedDC_new_3, 747).
--define(wxBufferedDC_destruct, 748).
--define(wxBufferedDC_Init_2, 749).
--define(wxBufferedDC_Init_3, 750).
--define(wxBufferedPaintDC_new_3, 751).
--define(wxBufferedPaintDC_new_2, 752).
--define(wxBufferedPaintDC_destruct, 753).
--define(wxGraphicsObject_GetRenderer, 754).
--define(wxGraphicsObject_IsNull, 755).
--define(wxGraphicsContext_Create_1_1, 756).
--define(wxGraphicsContext_Create_1_0, 757).
--define(wxGraphicsContext_Create_0, 758).
--define(wxGraphicsContext_CreatePen, 759).
--define(wxGraphicsContext_CreateBrush, 760).
--define(wxGraphicsContext_CreateRadialGradientBrush, 761).
--define(wxGraphicsContext_CreateLinearGradientBrush, 762).
--define(wxGraphicsContext_CreateFont, 763).
--define(wxGraphicsContext_CreateMatrix, 764).
--define(wxGraphicsContext_CreatePath, 765).
--define(wxGraphicsContext_Clip_1, 766).
--define(wxGraphicsContext_Clip_4, 767).
--define(wxGraphicsContext_ResetClip, 768).
--define(wxGraphicsContext_DrawBitmap, 769).
--define(wxGraphicsContext_DrawEllipse, 770).
--define(wxGraphicsContext_DrawIcon, 771).
--define(wxGraphicsContext_DrawLines, 772).
--define(wxGraphicsContext_DrawPath, 773).
--define(wxGraphicsContext_DrawRectangle, 774).
--define(wxGraphicsContext_DrawRoundedRectangle, 775).
--define(wxGraphicsContext_DrawText_3, 776).
--define(wxGraphicsContext_DrawText_4_0, 777).
--define(wxGraphicsContext_DrawText_4_1, 778).
--define(wxGraphicsContext_DrawText_5, 779).
--define(wxGraphicsContext_FillPath, 780).
--define(wxGraphicsContext_StrokePath, 781).
--define(wxGraphicsContext_GetNativeContext, 782).
--define(wxGraphicsContext_GetPartialTextExtents, 783).
--define(wxGraphicsContext_GetTextExtent, 784).
--define(wxGraphicsContext_Rotate, 785).
--define(wxGraphicsContext_Scale, 786).
--define(wxGraphicsContext_Translate, 787).
--define(wxGraphicsContext_GetTransform, 788).
--define(wxGraphicsContext_SetTransform, 789).
--define(wxGraphicsContext_ConcatTransform, 790).
--define(wxGraphicsContext_SetBrush_1_1, 791).
--define(wxGraphicsContext_SetBrush_1_0, 792).
--define(wxGraphicsContext_SetFont_1, 793).
--define(wxGraphicsContext_SetFont_2, 794).
--define(wxGraphicsContext_SetPen_1_0, 795).
--define(wxGraphicsContext_SetPen_1_1, 796).
--define(wxGraphicsContext_StrokeLine, 797).
--define(wxGraphicsContext_StrokeLines_2, 798).
--define(wxGraphicsContext_StrokeLines_3, 799).
--define(wxGraphicsMatrix_Concat, 800).
--define(wxGraphicsMatrix_Get, 802).
--define(wxGraphicsMatrix_GetNativeMatrix, 803).
--define(wxGraphicsMatrix_Invert, 804).
--define(wxGraphicsMatrix_IsEqual, 805).
--define(wxGraphicsMatrix_IsIdentity, 807).
--define(wxGraphicsMatrix_Rotate, 808).
--define(wxGraphicsMatrix_Scale, 809).
--define(wxGraphicsMatrix_Translate, 810).
--define(wxGraphicsMatrix_Set, 811).
--define(wxGraphicsMatrix_TransformPoint, 812).
--define(wxGraphicsMatrix_TransformDistance, 813).
--define(wxGraphicsPath_MoveToPoint_2, 814).
--define(wxGraphicsPath_MoveToPoint_1, 815).
--define(wxGraphicsPath_AddArc_6, 816).
--define(wxGraphicsPath_AddArc_5, 817).
--define(wxGraphicsPath_AddArcToPoint, 818).
--define(wxGraphicsPath_AddCircle, 819).
--define(wxGraphicsPath_AddCurveToPoint_6, 820).
--define(wxGraphicsPath_AddCurveToPoint_3, 821).
--define(wxGraphicsPath_AddEllipse, 822).
--define(wxGraphicsPath_AddLineToPoint_2, 823).
--define(wxGraphicsPath_AddLineToPoint_1, 824).
--define(wxGraphicsPath_AddPath, 825).
--define(wxGraphicsPath_AddQuadCurveToPoint, 826).
--define(wxGraphicsPath_AddRectangle, 827).
--define(wxGraphicsPath_AddRoundedRectangle, 828).
--define(wxGraphicsPath_CloseSubpath, 829).
--define(wxGraphicsPath_Contains_3, 830).
--define(wxGraphicsPath_Contains_2, 831).
--define(wxGraphicsPath_GetBox, 833).
--define(wxGraphicsPath_GetCurrentPoint, 835).
--define(wxGraphicsPath_Transform, 836).
--define(wxGraphicsRenderer_GetDefaultRenderer, 837).
--define(wxGraphicsRenderer_CreateContext_1_1, 838).
--define(wxGraphicsRenderer_CreateContext_1_0, 839).
--define(wxGraphicsRenderer_CreatePen, 840).
--define(wxGraphicsRenderer_CreateBrush, 841).
--define(wxGraphicsRenderer_CreateLinearGradientBrush, 842).
--define(wxGraphicsRenderer_CreateRadialGradientBrush, 843).
--define(wxGraphicsRenderer_CreateFont, 844).
--define(wxGraphicsRenderer_CreateMatrix, 845).
--define(wxGraphicsRenderer_CreatePath, 846).
--define(wxMenuBar_new_1, 848).
--define(wxMenuBar_new_0, 850).
--define(wxMenuBar_destruct, 852).
--define(wxMenuBar_Append, 853).
--define(wxMenuBar_Check, 854).
--define(wxMenuBar_Enable_2, 855).
--define(wxMenuBar_Enable_1, 856).
--define(wxMenuBar_EnableTop, 857).
--define(wxMenuBar_FindMenu, 858).
--define(wxMenuBar_FindMenuItem, 859).
--define(wxMenuBar_FindItem, 860).
--define(wxMenuBar_GetHelpString, 861).
--define(wxMenuBar_GetLabel_1, 862).
--define(wxMenuBar_GetLabel_0, 863).
--define(wxMenuBar_GetLabelTop, 864).
--define(wxMenuBar_GetMenu, 865).
--define(wxMenuBar_GetMenuCount, 866).
--define(wxMenuBar_Insert, 867).
--define(wxMenuBar_IsChecked, 868).
--define(wxMenuBar_IsEnabled_1, 869).
--define(wxMenuBar_IsEnabled_0, 870).
--define(wxMenuBar_Remove, 871).
--define(wxMenuBar_Replace, 872).
--define(wxMenuBar_SetHelpString, 873).
--define(wxMenuBar_SetLabel_2, 874).
--define(wxMenuBar_SetLabel_1, 875).
--define(wxMenuBar_SetLabelTop, 876).
--define(wxControl_GetLabel, 877).
--define(wxControl_SetLabel, 878).
--define(wxControlWithItems_Append_1, 879).
--define(wxControlWithItems_Append_2, 880).
--define(wxControlWithItems_appendStrings_1, 881).
--define(wxControlWithItems_Clear, 882).
--define(wxControlWithItems_Delete, 883).
--define(wxControlWithItems_FindString, 884).
--define(wxControlWithItems_getClientData, 885).
--define(wxControlWithItems_setClientData, 886).
--define(wxControlWithItems_GetCount, 887).
--define(wxControlWithItems_GetSelection, 888).
--define(wxControlWithItems_GetString, 889).
--define(wxControlWithItems_GetStringSelection, 890).
--define(wxControlWithItems_Insert_2, 891).
--define(wxControlWithItems_Insert_3, 892).
--define(wxControlWithItems_IsEmpty, 893).
--define(wxControlWithItems_Select, 894).
--define(wxControlWithItems_SetSelection, 895).
--define(wxControlWithItems_SetString, 896).
--define(wxControlWithItems_SetStringSelection, 897).
--define(wxMenu_new_2, 900).
--define(wxMenu_new_1, 901).
--define(wxMenu_destruct, 903).
--define(wxMenu_Append_3, 904).
--define(wxMenu_Append_1, 905).
--define(wxMenu_Append_4_0, 906).
--define(wxMenu_Append_4_1, 907).
--define(wxMenu_AppendCheckItem, 908).
--define(wxMenu_AppendRadioItem, 909).
--define(wxMenu_AppendSeparator, 910).
--define(wxMenu_Break, 911).
--define(wxMenu_Check, 912).
--define(wxMenu_Delete_1_0, 913).
--define(wxMenu_Delete_1_1, 914).
--define(wxMenu_Destroy_1_0, 915).
--define(wxMenu_Destroy_1_1, 916).
--define(wxMenu_Enable, 917).
--define(wxMenu_FindItem_1, 918).
--define(wxMenu_FindItem_2, 919).
--define(wxMenu_FindItemByPosition, 920).
--define(wxMenu_GetHelpString, 921).
--define(wxMenu_GetLabel, 922).
--define(wxMenu_GetMenuItemCount, 923).
--define(wxMenu_GetMenuItems, 924).
--define(wxMenu_GetTitle, 926).
--define(wxMenu_Insert_2, 927).
--define(wxMenu_Insert_3, 928).
--define(wxMenu_Insert_5_1, 929).
--define(wxMenu_Insert_5_0, 930).
--define(wxMenu_InsertCheckItem, 931).
--define(wxMenu_InsertRadioItem, 932).
--define(wxMenu_InsertSeparator, 933).
--define(wxMenu_IsChecked, 934).
--define(wxMenu_IsEnabled, 935).
--define(wxMenu_Prepend_1, 936).
--define(wxMenu_Prepend_2, 937).
--define(wxMenu_Prepend_4_1, 938).
--define(wxMenu_Prepend_4_0, 939).
--define(wxMenu_PrependCheckItem, 940).
--define(wxMenu_PrependRadioItem, 941).
--define(wxMenu_PrependSeparator, 942).
--define(wxMenu_Remove_1_0, 943).
--define(wxMenu_Remove_1_1, 944).
--define(wxMenu_SetHelpString, 945).
--define(wxMenu_SetLabel, 946).
--define(wxMenu_SetTitle, 947).
--define(wxMenuItem_new, 948).
--define(wxMenuItem_destruct, 950).
--define(wxMenuItem_Check, 951).
--define(wxMenuItem_Enable, 952).
--define(wxMenuItem_GetBitmap, 953).
--define(wxMenuItem_GetHelp, 954).
--define(wxMenuItem_GetId, 955).
--define(wxMenuItem_GetKind, 956).
--define(wxMenuItem_GetLabel, 957).
--define(wxMenuItem_GetLabelFromText, 958).
--define(wxMenuItem_GetMenu, 959).
--define(wxMenuItem_GetText, 960).
--define(wxMenuItem_GetSubMenu, 961).
--define(wxMenuItem_IsCheckable, 962).
--define(wxMenuItem_IsChecked, 963).
--define(wxMenuItem_IsEnabled, 964).
--define(wxMenuItem_IsSeparator, 965).
--define(wxMenuItem_IsSubMenu, 966).
--define(wxMenuItem_SetBitmap, 967).
--define(wxMenuItem_SetHelp, 968).
--define(wxMenuItem_SetMenu, 969).
--define(wxMenuItem_SetSubMenu, 970).
--define(wxMenuItem_SetText, 971).
--define(wxToolBar_AddControl, 972).
--define(wxToolBar_AddSeparator, 973).
--define(wxToolBar_AddTool_5, 974).
--define(wxToolBar_AddTool_4_0, 975).
--define(wxToolBar_AddTool_1, 976).
--define(wxToolBar_AddTool_4_1, 977).
--define(wxToolBar_AddTool_3, 978).
--define(wxToolBar_AddTool_6, 979).
--define(wxToolBar_AddCheckTool, 980).
--define(wxToolBar_AddRadioTool, 981).
--define(wxToolBar_DeleteTool, 982).
--define(wxToolBar_DeleteToolByPos, 983).
--define(wxToolBar_EnableTool, 984).
--define(wxToolBar_FindById, 985).
--define(wxToolBar_FindControl, 986).
--define(wxToolBar_FindToolForPosition, 987).
--define(wxToolBar_GetToolSize, 988).
--define(wxToolBar_GetToolBitmapSize, 989).
--define(wxToolBar_GetMargins, 990).
--define(wxToolBar_GetToolEnabled, 991).
--define(wxToolBar_GetToolLongHelp, 992).
--define(wxToolBar_GetToolPacking, 993).
--define(wxToolBar_GetToolPos, 994).
--define(wxToolBar_GetToolSeparation, 995).
--define(wxToolBar_GetToolShortHelp, 996).
--define(wxToolBar_GetToolState, 997).
--define(wxToolBar_InsertControl, 998).
--define(wxToolBar_InsertSeparator, 999).
--define(wxToolBar_InsertTool_5, 1000).
--define(wxToolBar_InsertTool_2, 1001).
--define(wxToolBar_InsertTool_4, 1002).
--define(wxToolBar_Realize, 1003).
--define(wxToolBar_RemoveTool, 1004).
--define(wxToolBar_SetMargins, 1005).
--define(wxToolBar_SetToolBitmapSize, 1006).
--define(wxToolBar_SetToolLongHelp, 1007).
--define(wxToolBar_SetToolPacking, 1008).
--define(wxToolBar_SetToolShortHelp, 1009).
--define(wxToolBar_SetToolSeparation, 1010).
--define(wxToolBar_ToggleTool, 1011).
--define(wxStatusBar_new_0, 1013).
--define(wxStatusBar_new_2, 1014).
--define(wxStatusBar_destruct, 1016).
--define(wxStatusBar_Create, 1017).
--define(wxStatusBar_GetFieldRect, 1018).
--define(wxStatusBar_GetFieldsCount, 1019).
--define(wxStatusBar_GetStatusText, 1020).
--define(wxStatusBar_PopStatusText, 1021).
--define(wxStatusBar_PushStatusText, 1022).
--define(wxStatusBar_SetFieldsCount, 1023).
--define(wxStatusBar_SetMinHeight, 1024).
--define(wxStatusBar_SetStatusText, 1025).
--define(wxStatusBar_SetStatusWidths, 1026).
--define(wxStatusBar_SetStatusStyles, 1027).
--define(wxBitmap_new_0, 1028).
--define(wxBitmap_new_3, 1029).
--define(wxBitmap_new_4, 1030).
--define(wxBitmap_new_2_0, 1031).
--define(wxBitmap_new_2_1, 1032).
--define(wxBitmap_destruct, 1033).
--define(wxBitmap_ConvertToImage, 1034).
--define(wxBitmap_CopyFromIcon, 1035).
--define(wxBitmap_Create, 1036).
--define(wxBitmap_GetDepth, 1037).
--define(wxBitmap_GetHeight, 1038).
--define(wxBitmap_GetPalette, 1039).
--define(wxBitmap_GetMask, 1040).
--define(wxBitmap_GetWidth, 1041).
--define(wxBitmap_GetSubBitmap, 1042).
--define(wxBitmap_LoadFile, 1043).
--define(wxBitmap_Ok, 1044).
--define(wxBitmap_SaveFile, 1045).
--define(wxBitmap_SetDepth, 1046).
--define(wxBitmap_SetHeight, 1047).
--define(wxBitmap_SetMask, 1048).
--define(wxBitmap_SetPalette, 1049).
--define(wxBitmap_SetWidth, 1050).
--define(wxIcon_new_0, 1051).
--define(wxIcon_new_2, 1052).
--define(wxIcon_new_1, 1053).
--define(wxIcon_CopyFromBitmap, 1054).
--define(wxIcon_destroy, 1055).
--define(wxIconBundle_new_0, 1056).
--define(wxIconBundle_new_2, 1057).
--define(wxIconBundle_new_1_0, 1058).
--define(wxIconBundle_new_1_1, 1059).
--define(wxIconBundle_destruct, 1060).
--define(wxIconBundle_AddIcon_2, 1061).
--define(wxIconBundle_AddIcon_1, 1062).
--define(wxIconBundle_GetIcon_1_1, 1063).
--define(wxIconBundle_GetIcon_1_0, 1064).
--define(wxCursor_new_0, 1065).
--define(wxCursor_new_1_0, 1066).
--define(wxCursor_new_1_1, 1067).
--define(wxCursor_new_4, 1068).
--define(wxCursor_destruct, 1069).
--define(wxCursor_Ok, 1070).
--define(wxMask_new_0, 1071).
--define(wxMask_new_2_1, 1072).
--define(wxMask_new_2_0, 1073).
--define(wxMask_new_1, 1074).
--define(wxMask_destruct, 1075).
--define(wxMask_Create_2_1, 1076).
--define(wxMask_Create_2_0, 1077).
--define(wxMask_Create_1, 1078).
--define(wxImage_new_0, 1079).
--define(wxImage_new_3_0, 1080).
--define(wxImage_new_4, 1081).
--define(wxImage_new_5, 1082).
--define(wxImage_new_2, 1083).
--define(wxImage_new_3_1, 1084).
--define(wxImage_Blur, 1085).
--define(wxImage_BlurHorizontal, 1086).
--define(wxImage_BlurVertical, 1087).
--define(wxImage_ConvertAlphaToMask, 1088).
--define(wxImage_ConvertToGreyscale, 1089).
--define(wxImage_ConvertToMono, 1090).
--define(wxImage_Copy, 1091).
--define(wxImage_Create_3, 1092).
--define(wxImage_Create_4, 1093).
--define(wxImage_Create_5, 1094).
--define(wxImage_Destroy, 1095).
--define(wxImage_FindFirstUnusedColour, 1096).
--define(wxImage_GetImageExtWildcard, 1097).
--define(wxImage_GetAlpha_2, 1098).
--define(wxImage_GetAlpha_0, 1099).
--define(wxImage_GetBlue, 1100).
--define(wxImage_GetData, 1101).
--define(wxImage_GetGreen, 1102).
--define(wxImage_GetImageCount, 1103).
--define(wxImage_GetHeight, 1104).
--define(wxImage_GetMaskBlue, 1105).
--define(wxImage_GetMaskGreen, 1106).
--define(wxImage_GetMaskRed, 1107).
--define(wxImage_GetOrFindMaskColour, 1108).
--define(wxImage_GetPalette, 1109).
--define(wxImage_GetRed, 1110).
--define(wxImage_GetSubImage, 1111).
--define(wxImage_GetWidth, 1112).
--define(wxImage_HasAlpha, 1113).
--define(wxImage_HasMask, 1114).
--define(wxImage_GetOption, 1115).
--define(wxImage_GetOptionInt, 1116).
--define(wxImage_HasOption, 1117).
--define(wxImage_InitAlpha, 1118).
--define(wxImage_InitStandardHandlers, 1119).
--define(wxImage_IsTransparent, 1120).
--define(wxImage_LoadFile_2, 1121).
--define(wxImage_LoadFile_3, 1122).
--define(wxImage_Ok, 1123).
--define(wxImage_RemoveHandler, 1124).
--define(wxImage_Mirror, 1125).
--define(wxImage_Replace, 1126).
--define(wxImage_Rescale, 1127).
--define(wxImage_Resize, 1128).
--define(wxImage_Rotate, 1129).
--define(wxImage_RotateHue, 1130).
--define(wxImage_Rotate90, 1131).
--define(wxImage_SaveFile_1, 1132).
--define(wxImage_SaveFile_2_0, 1133).
--define(wxImage_SaveFile_2_1, 1134).
--define(wxImage_Scale, 1135).
--define(wxImage_Size, 1136).
--define(wxImage_SetAlpha_3, 1137).
--define(wxImage_SetAlpha_2, 1138).
--define(wxImage_SetData_2, 1139).
--define(wxImage_SetData_4, 1140).
--define(wxImage_SetMask, 1141).
--define(wxImage_SetMaskColour, 1142).
--define(wxImage_SetMaskFromImage, 1143).
--define(wxImage_SetOption_2_1, 1144).
--define(wxImage_SetOption_2_0, 1145).
--define(wxImage_SetPalette, 1146).
--define(wxImage_SetRGB_5, 1147).
--define(wxImage_SetRGB_4, 1148).
--define(wxImage_destroy, 1149).
--define(wxBrush_new_0, 1150).
--define(wxBrush_new_2, 1151).
--define(wxBrush_new_1, 1152).
--define(wxBrush_destruct, 1154).
--define(wxBrush_GetColour, 1155).
--define(wxBrush_GetStipple, 1156).
--define(wxBrush_GetStyle, 1157).
--define(wxBrush_IsHatch, 1158).
--define(wxBrush_IsOk, 1159).
--define(wxBrush_SetColour_1, 1160).
--define(wxBrush_SetColour_3, 1161).
--define(wxBrush_SetStipple, 1162).
--define(wxBrush_SetStyle, 1163).
--define(wxPen_new_0, 1164).
--define(wxPen_new_2, 1165).
--define(wxPen_destruct, 1166).
--define(wxPen_GetCap, 1167).
--define(wxPen_GetColour, 1168).
--define(wxPen_GetJoin, 1169).
--define(wxPen_GetStyle, 1170).
--define(wxPen_GetWidth, 1171).
--define(wxPen_IsOk, 1172).
--define(wxPen_SetCap, 1173).
--define(wxPen_SetColour_1, 1174).
--define(wxPen_SetColour_3, 1175).
--define(wxPen_SetJoin, 1176).
--define(wxPen_SetStyle, 1177).
--define(wxPen_SetWidth, 1178).
--define(wxRegion_new_0, 1179).
--define(wxRegion_new_4, 1180).
--define(wxRegion_new_2, 1181).
--define(wxRegion_new_1_1, 1182).
--define(wxRegion_new_1_0, 1184).
--define(wxRegion_destruct, 1186).
--define(wxRegion_Clear, 1187).
--define(wxRegion_Contains_2, 1188).
--define(wxRegion_Contains_1_0, 1189).
--define(wxRegion_Contains_4, 1190).
--define(wxRegion_Contains_1_1, 1191).
--define(wxRegion_ConvertToBitmap, 1192).
--define(wxRegion_GetBox, 1193).
--define(wxRegion_Intersect_4, 1194).
--define(wxRegion_Intersect_1_1, 1195).
--define(wxRegion_Intersect_1_0, 1196).
--define(wxRegion_IsEmpty, 1197).
--define(wxRegion_Subtract_4, 1198).
--define(wxRegion_Subtract_1_1, 1199).
--define(wxRegion_Subtract_1_0, 1200).
--define(wxRegion_Offset_2, 1201).
--define(wxRegion_Offset_1, 1202).
--define(wxRegion_Union_4, 1203).
--define(wxRegion_Union_1_2, 1204).
--define(wxRegion_Union_1_1, 1205).
--define(wxRegion_Union_1_0, 1206).
--define(wxRegion_Union_3, 1207).
--define(wxRegion_Xor_4, 1208).
--define(wxRegion_Xor_1_1, 1209).
--define(wxRegion_Xor_1_0, 1210).
--define(wxAcceleratorTable_new_0, 1211).
--define(wxAcceleratorTable_new_2, 1212).
--define(wxAcceleratorTable_destruct, 1213).
--define(wxAcceleratorTable_Ok, 1214).
--define(wxAcceleratorEntry_new_1_0, 1215).
--define(wxAcceleratorEntry_new_1_1, 1216).
--define(wxAcceleratorEntry_GetCommand, 1217).
--define(wxAcceleratorEntry_GetFlags, 1218).
--define(wxAcceleratorEntry_GetKeyCode, 1219).
--define(wxAcceleratorEntry_Set, 1220).
--define(wxAcceleratorEntry_destroy, 1221).
--define(wxCaret_new_3, 1226).
--define(wxCaret_new_2, 1227).
--define(wxCaret_destruct, 1229).
--define(wxCaret_Create_3, 1230).
--define(wxCaret_Create_2, 1231).
--define(wxCaret_GetBlinkTime, 1232).
--define(wxCaret_GetPosition, 1234).
--define(wxCaret_GetSize, 1236).
--define(wxCaret_GetWindow, 1237).
--define(wxCaret_Hide, 1238).
--define(wxCaret_IsOk, 1239).
--define(wxCaret_IsVisible, 1240).
--define(wxCaret_Move_2, 1241).
--define(wxCaret_Move_1, 1242).
--define(wxCaret_SetBlinkTime, 1243).
--define(wxCaret_SetSize_2, 1244).
--define(wxCaret_SetSize_1, 1245).
--define(wxCaret_Show, 1246).
--define(wxSizer_Add_2_1, 1247).
--define(wxSizer_Add_2_0, 1248).
--define(wxSizer_Add_3, 1249).
--define(wxSizer_Add_2_3, 1250).
--define(wxSizer_Add_2_2, 1251).
--define(wxSizer_AddSpacer, 1252).
--define(wxSizer_AddStretchSpacer, 1253).
--define(wxSizer_CalcMin, 1254).
--define(wxSizer_Clear, 1255).
--define(wxSizer_Detach_1_2, 1256).
--define(wxSizer_Detach_1_1, 1257).
--define(wxSizer_Detach_1_0, 1258).
--define(wxSizer_Fit, 1259).
--define(wxSizer_FitInside, 1260).
--define(wxSizer_GetChildren, 1261).
--define(wxSizer_GetItem_2_1, 1262).
--define(wxSizer_GetItem_2_0, 1263).
--define(wxSizer_GetItem_1, 1264).
--define(wxSizer_GetSize, 1265).
--define(wxSizer_GetPosition, 1266).
--define(wxSizer_GetMinSize, 1267).
--define(wxSizer_Hide_2_0, 1268).
--define(wxSizer_Hide_2_1, 1269).
--define(wxSizer_Hide_1, 1270).
--define(wxSizer_Insert_3_1, 1271).
--define(wxSizer_Insert_3_0, 1272).
--define(wxSizer_Insert_4, 1273).
--define(wxSizer_Insert_3_3, 1274).
--define(wxSizer_Insert_3_2, 1275).
--define(wxSizer_Insert_2, 1276).
--define(wxSizer_InsertSpacer, 1277).
--define(wxSizer_InsertStretchSpacer, 1278).
--define(wxSizer_IsShown_1_2, 1279).
--define(wxSizer_IsShown_1_1, 1280).
--define(wxSizer_IsShown_1_0, 1281).
--define(wxSizer_Layout, 1282).
--define(wxSizer_Prepend_2_1, 1283).
--define(wxSizer_Prepend_2_0, 1284).
--define(wxSizer_Prepend_3, 1285).
--define(wxSizer_Prepend_2_3, 1286).
--define(wxSizer_Prepend_2_2, 1287).
--define(wxSizer_Prepend_1, 1288).
--define(wxSizer_PrependSpacer, 1289).
--define(wxSizer_PrependStretchSpacer, 1290).
--define(wxSizer_RecalcSizes, 1291).
--define(wxSizer_Remove_1_1, 1292).
--define(wxSizer_Remove_1_0, 1293).
--define(wxSizer_Replace_3_1, 1294).
--define(wxSizer_Replace_3_0, 1295).
--define(wxSizer_Replace_2, 1296).
--define(wxSizer_SetDimension, 1297).
--define(wxSizer_SetMinSize_2, 1298).
--define(wxSizer_SetMinSize_1, 1299).
--define(wxSizer_SetItemMinSize_3_2, 1300).
--define(wxSizer_SetItemMinSize_2_2, 1301).
--define(wxSizer_SetItemMinSize_3_1, 1302).
--define(wxSizer_SetItemMinSize_2_1, 1303).
--define(wxSizer_SetItemMinSize_3_0, 1304).
--define(wxSizer_SetItemMinSize_2_0, 1305).
--define(wxSizer_SetSizeHints, 1306).
--define(wxSizer_SetVirtualSizeHints, 1307).
--define(wxSizer_Show_2_2, 1308).
--define(wxSizer_Show_2_1, 1309).
--define(wxSizer_Show_2_0, 1310).
--define(wxSizer_Show_1, 1311).
--define(wxSizerFlags_new, 1312).
--define(wxSizerFlags_Align, 1313).
--define(wxSizerFlags_Border_2, 1314).
--define(wxSizerFlags_Border_1, 1315).
--define(wxSizerFlags_Center, 1316).
--define(wxSizerFlags_Centre, 1317).
--define(wxSizerFlags_Expand, 1318).
--define(wxSizerFlags_Left, 1319).
--define(wxSizerFlags_Proportion, 1320).
--define(wxSizerFlags_Right, 1321).
--define(wxSizerFlags_destroy, 1322).
--define(wxSizerItem_new_5_1, 1323).
--define(wxSizerItem_new_2_1, 1324).
--define(wxSizerItem_new_5_0, 1325).
--define(wxSizerItem_new_2_0, 1326).
--define(wxSizerItem_new_6, 1327).
--define(wxSizerItem_new_3, 1328).
--define(wxSizerItem_new_0, 1329).
--define(wxSizerItem_destruct, 1330).
--define(wxSizerItem_CalcMin, 1331).
--define(wxSizerItem_DeleteWindows, 1332).
--define(wxSizerItem_DetachSizer, 1333).
--define(wxSizerItem_GetBorder, 1334).
--define(wxSizerItem_GetFlag, 1335).
--define(wxSizerItem_GetMinSize, 1336).
--define(wxSizerItem_GetPosition, 1337).
--define(wxSizerItem_GetProportion, 1338).
--define(wxSizerItem_GetRatio, 1339).
--define(wxSizerItem_GetRect, 1340).
--define(wxSizerItem_GetSize, 1341).
--define(wxSizerItem_GetSizer, 1342).
--define(wxSizerItem_GetSpacer, 1343).
--define(wxSizerItem_GetUserData, 1344).
--define(wxSizerItem_GetWindow, 1345).
--define(wxSizerItem_IsSizer, 1346).
--define(wxSizerItem_IsShown, 1347).
--define(wxSizerItem_IsSpacer, 1348).
--define(wxSizerItem_IsWindow, 1349).
--define(wxSizerItem_SetBorder, 1350).
--define(wxSizerItem_SetDimension, 1351).
--define(wxSizerItem_SetFlag, 1352).
--define(wxSizerItem_SetInitSize, 1353).
--define(wxSizerItem_SetMinSize_1, 1354).
--define(wxSizerItem_SetMinSize_2, 1355).
--define(wxSizerItem_SetProportion, 1356).
--define(wxSizerItem_SetRatio_2, 1357).
--define(wxSizerItem_SetRatio_1_1, 1358).
--define(wxSizerItem_SetRatio_1_0, 1359).
--define(wxSizerItem_SetSizer, 1360).
--define(wxSizerItem_SetSpacer_1, 1361).
--define(wxSizerItem_SetSpacer_2, 1362).
--define(wxSizerItem_SetWindow, 1363).
--define(wxSizerItem_Show, 1364).
--define(wxBoxSizer_new, 1365).
--define(wxBoxSizer_GetOrientation, 1366).
--define(wxBoxSizer_destroy, 1367).
--define(wxStaticBoxSizer_new_2, 1368).
--define(wxStaticBoxSizer_new_3, 1369).
--define(wxStaticBoxSizer_GetStaticBox, 1370).
--define(wxStaticBoxSizer_destroy, 1371).
--define(wxGridSizer_new_4, 1372).
--define(wxGridSizer_new_2, 1373).
--define(wxGridSizer_GetCols, 1374).
--define(wxGridSizer_GetHGap, 1375).
--define(wxGridSizer_GetRows, 1376).
--define(wxGridSizer_GetVGap, 1377).
--define(wxGridSizer_SetCols, 1378).
--define(wxGridSizer_SetHGap, 1379).
--define(wxGridSizer_SetRows, 1380).
--define(wxGridSizer_SetVGap, 1381).
--define(wxGridSizer_destroy, 1382).
--define(wxFlexGridSizer_new_4, 1383).
--define(wxFlexGridSizer_new_2, 1384).
--define(wxFlexGridSizer_AddGrowableCol, 1385).
--define(wxFlexGridSizer_AddGrowableRow, 1386).
--define(wxFlexGridSizer_GetFlexibleDirection, 1387).
--define(wxFlexGridSizer_GetNonFlexibleGrowMode, 1388).
--define(wxFlexGridSizer_RemoveGrowableCol, 1389).
--define(wxFlexGridSizer_RemoveGrowableRow, 1390).
--define(wxFlexGridSizer_SetFlexibleDirection, 1391).
--define(wxFlexGridSizer_SetNonFlexibleGrowMode, 1392).
--define(wxFlexGridSizer_destroy, 1393).
--define(wxGridBagSizer_new, 1394).
--define(wxGridBagSizer_Add_3_2, 1395).
--define(wxGridBagSizer_Add_3_1, 1396).
--define(wxGridBagSizer_Add_4, 1397).
--define(wxGridBagSizer_Add_1_0, 1398).
--define(wxGridBagSizer_Add_2_1, 1399).
--define(wxGridBagSizer_Add_2_0, 1400).
--define(wxGridBagSizer_Add_3_0, 1401).
--define(wxGridBagSizer_Add_1_1, 1402).
--define(wxGridBagSizer_CalcMin, 1403).
--define(wxGridBagSizer_CheckForIntersection_2, 1404).
--define(wxGridBagSizer_CheckForIntersection_3, 1405).
--define(wxGridBagSizer_FindItem_1_1, 1406).
--define(wxGridBagSizer_FindItem_1_0, 1407).
--define(wxGridBagSizer_FindItemAtPoint, 1408).
--define(wxGridBagSizer_FindItemAtPosition, 1409).
--define(wxGridBagSizer_FindItemWithData, 1410).
--define(wxGridBagSizer_GetCellSize, 1411).
--define(wxGridBagSizer_GetEmptyCellSize, 1412).
--define(wxGridBagSizer_GetItemPosition_1_2, 1413).
--define(wxGridBagSizer_GetItemPosition_1_1, 1414).
--define(wxGridBagSizer_GetItemPosition_1_0, 1415).
--define(wxGridBagSizer_GetItemSpan_1_2, 1416).
--define(wxGridBagSizer_GetItemSpan_1_1, 1417).
--define(wxGridBagSizer_GetItemSpan_1_0, 1418).
--define(wxGridBagSizer_SetEmptyCellSize, 1419).
--define(wxGridBagSizer_SetItemPosition_2_2, 1420).
--define(wxGridBagSizer_SetItemPosition_2_1, 1421).
--define(wxGridBagSizer_SetItemPosition_2_0, 1422).
--define(wxGridBagSizer_SetItemSpan_2_2, 1423).
--define(wxGridBagSizer_SetItemSpan_2_1, 1424).
--define(wxGridBagSizer_SetItemSpan_2_0, 1425).
--define(wxGridBagSizer_destroy, 1426).
--define(wxStdDialogButtonSizer_new, 1427).
--define(wxStdDialogButtonSizer_AddButton, 1428).
--define(wxStdDialogButtonSizer_Realize, 1429).
--define(wxStdDialogButtonSizer_SetAffirmativeButton, 1430).
--define(wxStdDialogButtonSizer_SetCancelButton, 1431).
--define(wxStdDialogButtonSizer_SetNegativeButton, 1432).
--define(wxStdDialogButtonSizer_destroy, 1433).
--define(wxFont_new_0, 1434).
--define(wxFont_new_1, 1435).
--define(wxFont_new_5, 1436).
--define(wxFont_destruct, 1438).
--define(wxFont_IsFixedWidth, 1439).
--define(wxFont_GetDefaultEncoding, 1440).
--define(wxFont_GetFaceName, 1441).
--define(wxFont_GetFamily, 1442).
--define(wxFont_GetNativeFontInfoDesc, 1443).
--define(wxFont_GetNativeFontInfoUserDesc, 1444).
--define(wxFont_GetPointSize, 1445).
--define(wxFont_GetStyle, 1446).
--define(wxFont_GetUnderlined, 1447).
--define(wxFont_GetWeight, 1448).
--define(wxFont_Ok, 1449).
--define(wxFont_SetDefaultEncoding, 1450).
--define(wxFont_SetFaceName, 1451).
--define(wxFont_SetFamily, 1452).
--define(wxFont_SetPointSize, 1453).
--define(wxFont_SetStyle, 1454).
--define(wxFont_SetUnderlined, 1455).
--define(wxFont_SetWeight, 1456).
--define(wxToolTip_Enable, 1457).
--define(wxToolTip_SetDelay, 1458).
--define(wxToolTip_new, 1459).
--define(wxToolTip_SetTip, 1460).
--define(wxToolTip_GetTip, 1461).
--define(wxToolTip_GetWindow, 1462).
--define(wxToolTip_destroy, 1463).
--define(wxButton_new_3, 1465).
--define(wxButton_new_0, 1466).
--define(wxButton_destruct, 1467).
--define(wxButton_Create, 1468).
--define(wxButton_GetDefaultSize, 1469).
--define(wxButton_SetDefault, 1470).
--define(wxButton_SetLabel, 1471).
--define(wxBitmapButton_new_4, 1473).
--define(wxBitmapButton_new_0, 1474).
--define(wxBitmapButton_Create, 1475).
--define(wxBitmapButton_GetBitmapDisabled, 1476).
--define(wxBitmapButton_GetBitmapFocus, 1478).
--define(wxBitmapButton_GetBitmapLabel, 1480).
--define(wxBitmapButton_GetBitmapSelected, 1482).
--define(wxBitmapButton_SetBitmapDisabled, 1484).
--define(wxBitmapButton_SetBitmapFocus, 1485).
--define(wxBitmapButton_SetBitmapLabel, 1486).
--define(wxBitmapButton_SetBitmapSelected, 1487).
--define(wxBitmapButton_destroy, 1488).
--define(wxToggleButton_new_0, 1489).
--define(wxToggleButton_new_4, 1490).
--define(wxToggleButton_Create, 1491).
--define(wxToggleButton_GetValue, 1492).
--define(wxToggleButton_SetValue, 1493).
--define(wxToggleButton_destroy, 1494).
--define(wxCalendarCtrl_new_0, 1495).
--define(wxCalendarCtrl_new_3, 1496).
--define(wxCalendarCtrl_Create, 1497).
--define(wxCalendarCtrl_destruct, 1498).
--define(wxCalendarCtrl_SetDate, 1499).
--define(wxCalendarCtrl_GetDate, 1500).
--define(wxCalendarCtrl_EnableYearChange, 1501).
--define(wxCalendarCtrl_EnableMonthChange, 1502).
--define(wxCalendarCtrl_EnableHolidayDisplay, 1503).
--define(wxCalendarCtrl_SetHeaderColours, 1504).
--define(wxCalendarCtrl_GetHeaderColourFg, 1505).
--define(wxCalendarCtrl_GetHeaderColourBg, 1506).
--define(wxCalendarCtrl_SetHighlightColours, 1507).
--define(wxCalendarCtrl_GetHighlightColourFg, 1508).
--define(wxCalendarCtrl_GetHighlightColourBg, 1509).
--define(wxCalendarCtrl_SetHolidayColours, 1510).
--define(wxCalendarCtrl_GetHolidayColourFg, 1511).
--define(wxCalendarCtrl_GetHolidayColourBg, 1512).
--define(wxCalendarCtrl_GetAttr, 1513).
--define(wxCalendarCtrl_SetAttr, 1514).
--define(wxCalendarCtrl_SetHoliday, 1515).
--define(wxCalendarCtrl_ResetAttr, 1516).
--define(wxCalendarCtrl_HitTest, 1517).
--define(wxCalendarDateAttr_new_0, 1518).
--define(wxCalendarDateAttr_new_2_1, 1519).
--define(wxCalendarDateAttr_new_2_0, 1520).
--define(wxCalendarDateAttr_SetTextColour, 1521).
--define(wxCalendarDateAttr_SetBackgroundColour, 1522).
--define(wxCalendarDateAttr_SetBorderColour, 1523).
--define(wxCalendarDateAttr_SetFont, 1524).
--define(wxCalendarDateAttr_SetBorder, 1525).
--define(wxCalendarDateAttr_SetHoliday, 1526).
--define(wxCalendarDateAttr_HasTextColour, 1527).
--define(wxCalendarDateAttr_HasBackgroundColour, 1528).
--define(wxCalendarDateAttr_HasBorderColour, 1529).
--define(wxCalendarDateAttr_HasFont, 1530).
--define(wxCalendarDateAttr_HasBorder, 1531).
--define(wxCalendarDateAttr_IsHoliday, 1532).
--define(wxCalendarDateAttr_GetTextColour, 1533).
--define(wxCalendarDateAttr_GetBackgroundColour, 1534).
--define(wxCalendarDateAttr_GetBorderColour, 1535).
--define(wxCalendarDateAttr_GetFont, 1536).
--define(wxCalendarDateAttr_GetBorder, 1537).
--define(wxCalendarDateAttr_destroy, 1538).
--define(wxCheckBox_new_4, 1540).
--define(wxCheckBox_new_0, 1541).
--define(wxCheckBox_Create, 1542).
--define(wxCheckBox_GetValue, 1543).
--define(wxCheckBox_Get3StateValue, 1544).
--define(wxCheckBox_Is3rdStateAllowedForUser, 1545).
--define(wxCheckBox_Is3State, 1546).
--define(wxCheckBox_IsChecked, 1547).
--define(wxCheckBox_SetValue, 1548).
--define(wxCheckBox_Set3StateValue, 1549).
--define(wxCheckBox_destroy, 1550).
--define(wxCheckListBox_new_0, 1551).
--define(wxCheckListBox_new_3, 1553).
--define(wxCheckListBox_Check, 1554).
--define(wxCheckListBox_IsChecked, 1555).
--define(wxCheckListBox_destroy, 1556).
--define(wxChoice_new_3, 1559).
--define(wxChoice_new_0, 1560).
--define(wxChoice_destruct, 1562).
--define(wxChoice_Create, 1564).
--define(wxChoice_Delete, 1565).
--define(wxChoice_GetColumns, 1566).
--define(wxChoice_SetColumns, 1567).
--define(wxComboBox_new_0, 1568).
--define(wxComboBox_new_3, 1570).
--define(wxComboBox_destruct, 1571).
--define(wxComboBox_Create, 1573).
--define(wxComboBox_CanCopy, 1574).
--define(wxComboBox_CanCut, 1575).
--define(wxComboBox_CanPaste, 1576).
--define(wxComboBox_CanRedo, 1577).
--define(wxComboBox_CanUndo, 1578).
--define(wxComboBox_Copy, 1579).
--define(wxComboBox_Cut, 1580).
--define(wxComboBox_GetInsertionPoint, 1581).
--define(wxComboBox_GetLastPosition, 1582).
--define(wxComboBox_GetValue, 1583).
--define(wxComboBox_Paste, 1584).
--define(wxComboBox_Redo, 1585).
--define(wxComboBox_Replace, 1586).
--define(wxComboBox_Remove, 1587).
--define(wxComboBox_SetInsertionPoint, 1588).
--define(wxComboBox_SetInsertionPointEnd, 1589).
--define(wxComboBox_SetSelection_1, 1590).
--define(wxComboBox_SetSelection_2, 1591).
--define(wxComboBox_SetValue, 1592).
--define(wxComboBox_Undo, 1593).
--define(wxGauge_new_0, 1594).
--define(wxGauge_new_4, 1595).
--define(wxGauge_Create, 1596).
--define(wxGauge_GetBezelFace, 1597).
--define(wxGauge_GetRange, 1598).
--define(wxGauge_GetShadowWidth, 1599).
--define(wxGauge_GetValue, 1600).
--define(wxGauge_IsVertical, 1601).
--define(wxGauge_SetBezelFace, 1602).
--define(wxGauge_SetRange, 1603).
--define(wxGauge_SetShadowWidth, 1604).
--define(wxGauge_SetValue, 1605).
--define(wxGauge_Pulse, 1606).
--define(wxGauge_destroy, 1607).
--define(wxGenericDirCtrl_new_0, 1608).
--define(wxGenericDirCtrl_new_2, 1609).
--define(wxGenericDirCtrl_destruct, 1610).
--define(wxGenericDirCtrl_Create, 1611).
--define(wxGenericDirCtrl_Init, 1612).
--define(wxGenericDirCtrl_CollapseTree, 1613).
--define(wxGenericDirCtrl_ExpandPath, 1614).
--define(wxGenericDirCtrl_GetDefaultPath, 1615).
--define(wxGenericDirCtrl_GetPath, 1616).
--define(wxGenericDirCtrl_GetFilePath, 1617).
--define(wxGenericDirCtrl_GetFilter, 1618).
--define(wxGenericDirCtrl_GetFilterIndex, 1619).
--define(wxGenericDirCtrl_GetRootId, 1620).
--define(wxGenericDirCtrl_GetTreeCtrl, 1621).
--define(wxGenericDirCtrl_ReCreateTree, 1622).
--define(wxGenericDirCtrl_SetDefaultPath, 1623).
--define(wxGenericDirCtrl_SetFilter, 1624).
--define(wxGenericDirCtrl_SetFilterIndex, 1625).
--define(wxGenericDirCtrl_SetPath, 1626).
--define(wxStaticBox_new_4, 1628).
--define(wxStaticBox_new_0, 1629).
--define(wxStaticBox_Create, 1630).
--define(wxStaticBox_destroy, 1631).
--define(wxStaticLine_new_2, 1633).
--define(wxStaticLine_new_0, 1634).
--define(wxStaticLine_Create, 1635).
--define(wxStaticLine_IsVertical, 1636).
--define(wxStaticLine_GetDefaultSize, 1637).
--define(wxStaticLine_destroy, 1638).
--define(wxListBox_new_3, 1641).
--define(wxListBox_new_0, 1642).
--define(wxListBox_destruct, 1644).
--define(wxListBox_Create, 1646).
--define(wxListBox_Deselect, 1647).
--define(wxListBox_GetSelections, 1648).
--define(wxListBox_InsertItems, 1649).
--define(wxListBox_IsSelected, 1650).
--define(wxListBox_Set, 1652).
--define(wxListBox_HitTest, 1653).
--define(wxListBox_SetFirstItem_1_0, 1654).
--define(wxListBox_SetFirstItem_1_1, 1655).
--define(wxListCtrl_new_0, 1656).
--define(wxListCtrl_new_2, 1657).
--define(wxListCtrl_Arrange, 1658).
--define(wxListCtrl_AssignImageList, 1659).
--define(wxListCtrl_ClearAll, 1660).
--define(wxListCtrl_Create, 1661).
--define(wxListCtrl_DeleteAllItems, 1662).
--define(wxListCtrl_DeleteColumn, 1663).
--define(wxListCtrl_DeleteItem, 1664).
--define(wxListCtrl_EditLabel, 1665).
--define(wxListCtrl_EnsureVisible, 1666).
--define(wxListCtrl_FindItem_3_0, 1667).
--define(wxListCtrl_FindItem_3_1, 1668).
--define(wxListCtrl_GetColumn, 1669).
--define(wxListCtrl_GetColumnCount, 1670).
--define(wxListCtrl_GetColumnWidth, 1671).
--define(wxListCtrl_GetCountPerPage, 1672).
--define(wxListCtrl_GetEditControl, 1673).
--define(wxListCtrl_GetImageList, 1674).
--define(wxListCtrl_GetItem, 1675).
--define(wxListCtrl_GetItemBackgroundColour, 1676).
--define(wxListCtrl_GetItemCount, 1677).
--define(wxListCtrl_GetItemData, 1678).
--define(wxListCtrl_GetItemFont, 1679).
--define(wxListCtrl_GetItemPosition, 1680).
--define(wxListCtrl_GetItemRect, 1681).
--define(wxListCtrl_GetItemSpacing, 1682).
--define(wxListCtrl_GetItemState, 1683).
--define(wxListCtrl_GetItemText, 1684).
--define(wxListCtrl_GetItemTextColour, 1685).
--define(wxListCtrl_GetNextItem, 1686).
--define(wxListCtrl_GetSelectedItemCount, 1687).
--define(wxListCtrl_GetTextColour, 1688).
--define(wxListCtrl_GetTopItem, 1689).
--define(wxListCtrl_GetViewRect, 1690).
--define(wxListCtrl_HitTest, 1691).
--define(wxListCtrl_InsertColumn_2, 1692).
--define(wxListCtrl_InsertColumn_3, 1693).
--define(wxListCtrl_InsertItem_1, 1694).
--define(wxListCtrl_InsertItem_2_1, 1695).
--define(wxListCtrl_InsertItem_2_0, 1696).
--define(wxListCtrl_InsertItem_3, 1697).
--define(wxListCtrl_RefreshItem, 1698).
--define(wxListCtrl_RefreshItems, 1699).
--define(wxListCtrl_ScrollList, 1700).
--define(wxListCtrl_SetBackgroundColour, 1701).
--define(wxListCtrl_SetColumn, 1702).
--define(wxListCtrl_SetColumnWidth, 1703).
--define(wxListCtrl_SetImageList, 1704).
--define(wxListCtrl_SetItem_1, 1705).
--define(wxListCtrl_SetItem_4, 1706).
--define(wxListCtrl_SetItemBackgroundColour, 1707).
--define(wxListCtrl_SetItemCount, 1708).
--define(wxListCtrl_SetItemData, 1709).
--define(wxListCtrl_SetItemFont, 1710).
--define(wxListCtrl_SetItemImage, 1711).
--define(wxListCtrl_SetItemColumnImage, 1712).
--define(wxListCtrl_SetItemPosition, 1713).
--define(wxListCtrl_SetItemState, 1714).
--define(wxListCtrl_SetItemText, 1715).
--define(wxListCtrl_SetItemTextColour, 1716).
--define(wxListCtrl_SetSingleStyle, 1717).
--define(wxListCtrl_SetTextColour, 1718).
--define(wxListCtrl_SetWindowStyleFlag, 1719).
--define(wxListCtrl_SortItems, 1720).
--define(wxListCtrl_destroy, 1721).
--define(wxListView_ClearColumnImage, 1722).
--define(wxListView_Focus, 1723).
--define(wxListView_GetFirstSelected, 1724).
--define(wxListView_GetFocusedItem, 1725).
--define(wxListView_GetNextSelected, 1726).
--define(wxListView_IsSelected, 1727).
--define(wxListView_Select, 1728).
--define(wxListView_SetColumnImage, 1729).
--define(wxListItem_new_0, 1730).
--define(wxListItem_new_1, 1731).
--define(wxListItem_destruct, 1732).
--define(wxListItem_Clear, 1733).
--define(wxListItem_GetAlign, 1734).
--define(wxListItem_GetBackgroundColour, 1735).
--define(wxListItem_GetColumn, 1736).
--define(wxListItem_GetFont, 1737).
--define(wxListItem_GetId, 1738).
--define(wxListItem_GetImage, 1739).
--define(wxListItem_GetMask, 1740).
--define(wxListItem_GetState, 1741).
--define(wxListItem_GetText, 1742).
--define(wxListItem_GetTextColour, 1743).
--define(wxListItem_GetWidth, 1744).
--define(wxListItem_SetAlign, 1745).
--define(wxListItem_SetBackgroundColour, 1746).
--define(wxListItem_SetColumn, 1747).
--define(wxListItem_SetFont, 1748).
--define(wxListItem_SetId, 1749).
--define(wxListItem_SetImage, 1750).
--define(wxListItem_SetMask, 1751).
--define(wxListItem_SetState, 1752).
--define(wxListItem_SetStateMask, 1753).
--define(wxListItem_SetText, 1754).
--define(wxListItem_SetTextColour, 1755).
--define(wxListItem_SetWidth, 1756).
--define(wxListItemAttr_new_0, 1757).
--define(wxListItemAttr_new_3, 1758).
--define(wxListItemAttr_GetBackgroundColour, 1759).
--define(wxListItemAttr_GetFont, 1760).
--define(wxListItemAttr_GetTextColour, 1761).
--define(wxListItemAttr_HasBackgroundColour, 1762).
--define(wxListItemAttr_HasFont, 1763).
--define(wxListItemAttr_HasTextColour, 1764).
--define(wxListItemAttr_SetBackgroundColour, 1765).
--define(wxListItemAttr_SetFont, 1766).
--define(wxListItemAttr_SetTextColour, 1767).
--define(wxListItemAttr_destroy, 1768).
--define(wxImageList_new_0, 1769).
--define(wxImageList_new_3, 1770).
--define(wxImageList_Add_1, 1771).
--define(wxImageList_Add_2_0, 1772).
--define(wxImageList_Add_2_1, 1773).
--define(wxImageList_Create, 1774).
--define(wxImageList_Draw, 1776).
--define(wxImageList_GetBitmap, 1777).
--define(wxImageList_GetIcon, 1778).
--define(wxImageList_GetImageCount, 1779).
--define(wxImageList_GetSize, 1780).
--define(wxImageList_Remove, 1781).
--define(wxImageList_RemoveAll, 1782).
--define(wxImageList_Replace_2, 1783).
--define(wxImageList_Replace_3, 1784).
--define(wxImageList_destroy, 1785).
--define(wxTextAttr_new_0, 1786).
--define(wxTextAttr_new_2, 1787).
--define(wxTextAttr_GetAlignment, 1788).
--define(wxTextAttr_GetBackgroundColour, 1789).
--define(wxTextAttr_GetFont, 1790).
--define(wxTextAttr_GetLeftIndent, 1791).
--define(wxTextAttr_GetLeftSubIndent, 1792).
--define(wxTextAttr_GetRightIndent, 1793).
--define(wxTextAttr_GetTabs, 1794).
--define(wxTextAttr_GetTextColour, 1795).
--define(wxTextAttr_HasBackgroundColour, 1796).
--define(wxTextAttr_HasFont, 1797).
--define(wxTextAttr_HasTextColour, 1798).
--define(wxTextAttr_GetFlags, 1799).
--define(wxTextAttr_IsDefault, 1800).
--define(wxTextAttr_SetAlignment, 1801).
--define(wxTextAttr_SetBackgroundColour, 1802).
--define(wxTextAttr_SetFlags, 1803).
--define(wxTextAttr_SetFont, 1804).
--define(wxTextAttr_SetLeftIndent, 1805).
--define(wxTextAttr_SetRightIndent, 1806).
--define(wxTextAttr_SetTabs, 1807).
--define(wxTextAttr_SetTextColour, 1808).
--define(wxTextAttr_destroy, 1809).
--define(wxTextCtrl_new_3, 1811).
--define(wxTextCtrl_new_0, 1812).
--define(wxTextCtrl_destruct, 1814).
--define(wxTextCtrl_AppendText, 1815).
--define(wxTextCtrl_CanCopy, 1816).
--define(wxTextCtrl_CanCut, 1817).
--define(wxTextCtrl_CanPaste, 1818).
--define(wxTextCtrl_CanRedo, 1819).
--define(wxTextCtrl_CanUndo, 1820).
--define(wxTextCtrl_Clear, 1821).
--define(wxTextCtrl_Copy, 1822).
--define(wxTextCtrl_Create, 1823).
--define(wxTextCtrl_Cut, 1824).
--define(wxTextCtrl_DiscardEdits, 1825).
--define(wxTextCtrl_EmulateKeyPress, 1826).
--define(wxTextCtrl_GetDefaultStyle, 1827).
--define(wxTextCtrl_GetInsertionPoint, 1828).
--define(wxTextCtrl_GetLastPosition, 1829).
--define(wxTextCtrl_GetLineLength, 1830).
--define(wxTextCtrl_GetLineText, 1831).
--define(wxTextCtrl_GetNumberOfLines, 1832).
--define(wxTextCtrl_GetRange, 1833).
--define(wxTextCtrl_GetSelection, 1834).
--define(wxTextCtrl_GetStringSelection, 1835).
--define(wxTextCtrl_GetStyle, 1836).
--define(wxTextCtrl_GetValue, 1837).
--define(wxTextCtrl_IsEditable, 1838).
--define(wxTextCtrl_IsModified, 1839).
--define(wxTextCtrl_IsMultiLine, 1840).
--define(wxTextCtrl_IsSingleLine, 1841).
--define(wxTextCtrl_LoadFile, 1842).
--define(wxTextCtrl_MarkDirty, 1843).
--define(wxTextCtrl_Paste, 1844).
--define(wxTextCtrl_PositionToXY, 1845).
--define(wxTextCtrl_Redo, 1846).
--define(wxTextCtrl_Remove, 1847).
--define(wxTextCtrl_Replace, 1848).
--define(wxTextCtrl_SaveFile, 1849).
--define(wxTextCtrl_SetDefaultStyle, 1850).
--define(wxTextCtrl_SetEditable, 1851).
--define(wxTextCtrl_SetInsertionPoint, 1852).
--define(wxTextCtrl_SetInsertionPointEnd, 1853).
--define(wxTextCtrl_SetMaxLength, 1855).
--define(wxTextCtrl_SetSelection, 1856).
--define(wxTextCtrl_SetStyle, 1857).
--define(wxTextCtrl_SetValue, 1858).
--define(wxTextCtrl_ShowPosition, 1859).
--define(wxTextCtrl_Undo, 1860).
--define(wxTextCtrl_WriteText, 1861).
--define(wxTextCtrl_XYToPosition, 1862).
--define(wxNotebook_new_0, 1865).
--define(wxNotebook_new_3, 1866).
--define(wxNotebook_destruct, 1867).
--define(wxNotebook_AddPage, 1868).
--define(wxNotebook_AdvanceSelection, 1869).
--define(wxNotebook_AssignImageList, 1870).
--define(wxNotebook_Create, 1871).
--define(wxNotebook_DeleteAllPages, 1872).
--define(wxNotebook_DeletePage, 1873).
--define(wxNotebook_RemovePage, 1874).
--define(wxNotebook_GetCurrentPage, 1875).
--define(wxNotebook_GetImageList, 1876).
--define(wxNotebook_GetPage, 1878).
--define(wxNotebook_GetPageCount, 1879).
--define(wxNotebook_GetPageImage, 1880).
--define(wxNotebook_GetPageText, 1881).
--define(wxNotebook_GetRowCount, 1882).
--define(wxNotebook_GetSelection, 1883).
--define(wxNotebook_GetThemeBackgroundColour, 1884).
--define(wxNotebook_HitTest, 1886).
--define(wxNotebook_InsertPage, 1888).
--define(wxNotebook_SetImageList, 1889).
--define(wxNotebook_SetPadding, 1890).
--define(wxNotebook_SetPageSize, 1891).
--define(wxNotebook_SetPageImage, 1892).
--define(wxNotebook_SetPageText, 1893).
--define(wxNotebook_SetSelection, 1894).
--define(wxNotebook_ChangeSelection, 1895).
--define(wxChoicebook_new_0, 1896).
--define(wxChoicebook_new_3, 1897).
--define(wxChoicebook_AddPage, 1898).
--define(wxChoicebook_AdvanceSelection, 1899).
--define(wxChoicebook_AssignImageList, 1900).
--define(wxChoicebook_Create, 1901).
--define(wxChoicebook_DeleteAllPages, 1902).
--define(wxChoicebook_DeletePage, 1903).
--define(wxChoicebook_RemovePage, 1904).
--define(wxChoicebook_GetCurrentPage, 1905).
--define(wxChoicebook_GetImageList, 1906).
--define(wxChoicebook_GetPage, 1908).
--define(wxChoicebook_GetPageCount, 1909).
--define(wxChoicebook_GetPageImage, 1910).
--define(wxChoicebook_GetPageText, 1911).
--define(wxChoicebook_GetSelection, 1912).
--define(wxChoicebook_HitTest, 1913).
--define(wxChoicebook_InsertPage, 1914).
--define(wxChoicebook_SetImageList, 1915).
--define(wxChoicebook_SetPageSize, 1916).
--define(wxChoicebook_SetPageImage, 1917).
--define(wxChoicebook_SetPageText, 1918).
--define(wxChoicebook_SetSelection, 1919).
--define(wxChoicebook_ChangeSelection, 1920).
--define(wxChoicebook_destroy, 1921).
--define(wxToolbook_new_0, 1922).
--define(wxToolbook_new_3, 1923).
--define(wxToolbook_AddPage, 1924).
--define(wxToolbook_AdvanceSelection, 1925).
--define(wxToolbook_AssignImageList, 1926).
--define(wxToolbook_Create, 1927).
--define(wxToolbook_DeleteAllPages, 1928).
--define(wxToolbook_DeletePage, 1929).
--define(wxToolbook_RemovePage, 1930).
--define(wxToolbook_GetCurrentPage, 1931).
--define(wxToolbook_GetImageList, 1932).
--define(wxToolbook_GetPage, 1934).
--define(wxToolbook_GetPageCount, 1935).
--define(wxToolbook_GetPageImage, 1936).
--define(wxToolbook_GetPageText, 1937).
--define(wxToolbook_GetSelection, 1938).
--define(wxToolbook_HitTest, 1940).
--define(wxToolbook_InsertPage, 1941).
--define(wxToolbook_SetImageList, 1942).
--define(wxToolbook_SetPageSize, 1943).
--define(wxToolbook_SetPageImage, 1944).
--define(wxToolbook_SetPageText, 1945).
--define(wxToolbook_SetSelection, 1946).
--define(wxToolbook_ChangeSelection, 1947).
--define(wxToolbook_destroy, 1948).
--define(wxListbook_new_0, 1949).
--define(wxListbook_new_3, 1950).
--define(wxListbook_AddPage, 1951).
--define(wxListbook_AdvanceSelection, 1952).
--define(wxListbook_AssignImageList, 1953).
--define(wxListbook_Create, 1954).
--define(wxListbook_DeleteAllPages, 1955).
--define(wxListbook_DeletePage, 1956).
--define(wxListbook_RemovePage, 1957).
--define(wxListbook_GetCurrentPage, 1958).
--define(wxListbook_GetImageList, 1959).
--define(wxListbook_GetPage, 1961).
--define(wxListbook_GetPageCount, 1962).
--define(wxListbook_GetPageImage, 1963).
--define(wxListbook_GetPageText, 1964).
--define(wxListbook_GetSelection, 1965).
--define(wxListbook_HitTest, 1967).
--define(wxListbook_InsertPage, 1968).
--define(wxListbook_SetImageList, 1969).
--define(wxListbook_SetPageSize, 1970).
--define(wxListbook_SetPageImage, 1971).
--define(wxListbook_SetPageText, 1972).
--define(wxListbook_SetSelection, 1973).
--define(wxListbook_ChangeSelection, 1974).
--define(wxListbook_destroy, 1975).
--define(wxTreebook_new_0, 1976).
--define(wxTreebook_new_3, 1977).
--define(wxTreebook_AddPage, 1978).
--define(wxTreebook_AdvanceSelection, 1979).
--define(wxTreebook_AssignImageList, 1980).
--define(wxTreebook_Create, 1981).
--define(wxTreebook_DeleteAllPages, 1982).
--define(wxTreebook_DeletePage, 1983).
--define(wxTreebook_RemovePage, 1984).
--define(wxTreebook_GetCurrentPage, 1985).
--define(wxTreebook_GetImageList, 1986).
--define(wxTreebook_GetPage, 1988).
--define(wxTreebook_GetPageCount, 1989).
--define(wxTreebook_GetPageImage, 1990).
--define(wxTreebook_GetPageText, 1991).
--define(wxTreebook_GetSelection, 1992).
--define(wxTreebook_ExpandNode, 1993).
--define(wxTreebook_IsNodeExpanded, 1994).
--define(wxTreebook_HitTest, 1996).
--define(wxTreebook_InsertPage, 1997).
--define(wxTreebook_InsertSubPage, 1998).
--define(wxTreebook_SetImageList, 1999).
--define(wxTreebook_SetPageSize, 2000).
--define(wxTreebook_SetPageImage, 2001).
--define(wxTreebook_SetPageText, 2002).
--define(wxTreebook_SetSelection, 2003).
--define(wxTreebook_ChangeSelection, 2004).
--define(wxTreebook_destroy, 2005).
--define(wxTreeCtrl_new_2, 2008).
--define(wxTreeCtrl_new_0, 2009).
--define(wxTreeCtrl_destruct, 2011).
--define(wxTreeCtrl_AddRoot, 2012).
--define(wxTreeCtrl_AppendItem, 2013).
--define(wxTreeCtrl_AssignImageList, 2014).
--define(wxTreeCtrl_AssignStateImageList, 2015).
--define(wxTreeCtrl_Collapse, 2016).
--define(wxTreeCtrl_CollapseAndReset, 2017).
--define(wxTreeCtrl_Create, 2018).
--define(wxTreeCtrl_Delete, 2019).
--define(wxTreeCtrl_DeleteAllItems, 2020).
--define(wxTreeCtrl_DeleteChildren, 2021).
--define(wxTreeCtrl_EditLabel, 2022).
--define(wxTreeCtrl_EnsureVisible, 2023).
--define(wxTreeCtrl_Expand, 2024).
--define(wxTreeCtrl_GetBoundingRect, 2025).
--define(wxTreeCtrl_GetChildrenCount, 2027).
--define(wxTreeCtrl_GetCount, 2028).
--define(wxTreeCtrl_GetEditControl, 2029).
--define(wxTreeCtrl_GetFirstChild, 2030).
--define(wxTreeCtrl_GetNextChild, 2031).
--define(wxTreeCtrl_GetFirstVisibleItem, 2032).
--define(wxTreeCtrl_GetImageList, 2033).
--define(wxTreeCtrl_GetIndent, 2034).
--define(wxTreeCtrl_GetItemBackgroundColour, 2035).
--define(wxTreeCtrl_GetItemData, 2036).
--define(wxTreeCtrl_GetItemFont, 2037).
--define(wxTreeCtrl_GetItemImage_1, 2038).
--define(wxTreeCtrl_GetItemImage_2, 2039).
--define(wxTreeCtrl_GetItemText, 2040).
--define(wxTreeCtrl_GetItemTextColour, 2041).
--define(wxTreeCtrl_GetLastChild, 2042).
--define(wxTreeCtrl_GetNextSibling, 2043).
--define(wxTreeCtrl_GetNextVisible, 2044).
--define(wxTreeCtrl_GetItemParent, 2045).
--define(wxTreeCtrl_GetPrevSibling, 2046).
--define(wxTreeCtrl_GetPrevVisible, 2047).
--define(wxTreeCtrl_GetRootItem, 2048).
--define(wxTreeCtrl_GetSelection, 2049).
--define(wxTreeCtrl_GetSelections, 2050).
--define(wxTreeCtrl_GetStateImageList, 2051).
--define(wxTreeCtrl_HitTest, 2052).
--define(wxTreeCtrl_InsertItem, 2054).
--define(wxTreeCtrl_IsBold, 2055).
--define(wxTreeCtrl_IsExpanded, 2056).
--define(wxTreeCtrl_IsSelected, 2057).
--define(wxTreeCtrl_IsVisible, 2058).
--define(wxTreeCtrl_ItemHasChildren, 2059).
--define(wxTreeCtrl_PrependItem, 2060).
--define(wxTreeCtrl_ScrollTo, 2061).
--define(wxTreeCtrl_SelectItem_1, 2062).
--define(wxTreeCtrl_SelectItem_2, 2063).
--define(wxTreeCtrl_SetIndent, 2064).
--define(wxTreeCtrl_SetImageList, 2065).
--define(wxTreeCtrl_SetItemBackgroundColour, 2066).
--define(wxTreeCtrl_SetItemBold, 2067).
--define(wxTreeCtrl_SetItemData, 2068).
--define(wxTreeCtrl_SetItemDropHighlight, 2069).
--define(wxTreeCtrl_SetItemFont, 2070).
--define(wxTreeCtrl_SetItemHasChildren, 2071).
--define(wxTreeCtrl_SetItemImage_2, 2072).
--define(wxTreeCtrl_SetItemImage_3, 2073).
--define(wxTreeCtrl_SetItemText, 2074).
--define(wxTreeCtrl_SetItemTextColour, 2075).
--define(wxTreeCtrl_SetStateImageList, 2076).
--define(wxTreeCtrl_SetWindowStyle, 2077).
--define(wxTreeCtrl_SortChildren, 2078).
--define(wxTreeCtrl_Toggle, 2079).
--define(wxTreeCtrl_ToggleItemSelection, 2080).
--define(wxTreeCtrl_Unselect, 2081).
--define(wxTreeCtrl_UnselectAll, 2082).
--define(wxTreeCtrl_UnselectItem, 2083).
--define(wxScrollBar_new_0, 2084).
--define(wxScrollBar_new_3, 2085).
--define(wxScrollBar_destruct, 2086).
--define(wxScrollBar_Create, 2087).
--define(wxScrollBar_GetRange, 2088).
--define(wxScrollBar_GetPageSize, 2089).
--define(wxScrollBar_GetThumbPosition, 2090).
--define(wxScrollBar_GetThumbSize, 2091).
--define(wxScrollBar_SetThumbPosition, 2092).
--define(wxScrollBar_SetScrollbar, 2093).
--define(wxSpinButton_new_2, 2095).
--define(wxSpinButton_new_0, 2096).
--define(wxSpinButton_Create, 2097).
--define(wxSpinButton_GetMax, 2098).
--define(wxSpinButton_GetMin, 2099).
--define(wxSpinButton_GetValue, 2100).
--define(wxSpinButton_SetRange, 2101).
--define(wxSpinButton_SetValue, 2102).
--define(wxSpinButton_destroy, 2103).
--define(wxSpinCtrl_new_0, 2104).
--define(wxSpinCtrl_new_2, 2105).
--define(wxSpinCtrl_Create, 2107).
--define(wxSpinCtrl_SetValue_1_1, 2110).
--define(wxSpinCtrl_SetValue_1_0, 2111).
--define(wxSpinCtrl_GetValue, 2113).
--define(wxSpinCtrl_SetRange, 2115).
--define(wxSpinCtrl_SetSelection, 2116).
--define(wxSpinCtrl_GetMin, 2118).
--define(wxSpinCtrl_GetMax, 2120).
--define(wxSpinCtrl_destroy, 2121).
--define(wxStaticText_new_0, 2122).
--define(wxStaticText_new_4, 2123).
--define(wxStaticText_Create, 2124).
--define(wxStaticText_GetLabel, 2125).
--define(wxStaticText_SetLabel, 2126).
--define(wxStaticText_Wrap, 2127).
--define(wxStaticText_destroy, 2128).
--define(wxStaticBitmap_new_0, 2129).
--define(wxStaticBitmap_new_4, 2130).
--define(wxStaticBitmap_Create, 2131).
--define(wxStaticBitmap_GetBitmap, 2132).
--define(wxStaticBitmap_SetBitmap, 2133).
--define(wxStaticBitmap_destroy, 2134).
--define(wxRadioBox_new, 2135).
--define(wxRadioBox_destruct, 2137).
--define(wxRadioBox_Create, 2138).
--define(wxRadioBox_Enable_2, 2139).
--define(wxRadioBox_Enable_1, 2140).
--define(wxRadioBox_GetSelection, 2141).
--define(wxRadioBox_GetString, 2142).
--define(wxRadioBox_SetSelection, 2143).
--define(wxRadioBox_Show_2, 2144).
--define(wxRadioBox_Show_1, 2145).
--define(wxRadioBox_GetColumnCount, 2146).
--define(wxRadioBox_GetItemHelpText, 2147).
--define(wxRadioBox_GetItemToolTip, 2148).
--define(wxRadioBox_GetItemFromPoint, 2150).
--define(wxRadioBox_GetRowCount, 2151).
--define(wxRadioBox_IsItemEnabled, 2152).
--define(wxRadioBox_IsItemShown, 2153).
--define(wxRadioBox_SetItemHelpText, 2154).
--define(wxRadioBox_SetItemToolTip, 2155).
--define(wxRadioButton_new_0, 2156).
--define(wxRadioButton_new_4, 2157).
--define(wxRadioButton_Create, 2158).
--define(wxRadioButton_GetValue, 2159).
--define(wxRadioButton_SetValue, 2160).
--define(wxRadioButton_destroy, 2161).
--define(wxSlider_new_6, 2163).
--define(wxSlider_new_0, 2164).
--define(wxSlider_Create, 2165).
--define(wxSlider_GetLineSize, 2166).
--define(wxSlider_GetMax, 2167).
--define(wxSlider_GetMin, 2168).
--define(wxSlider_GetPageSize, 2169).
--define(wxSlider_GetThumbLength, 2170).
--define(wxSlider_GetValue, 2171).
--define(wxSlider_SetLineSize, 2172).
--define(wxSlider_SetPageSize, 2173).
--define(wxSlider_SetRange, 2174).
--define(wxSlider_SetThumbLength, 2175).
--define(wxSlider_SetValue, 2176).
--define(wxSlider_destroy, 2177).
--define(wxDialog_new_4, 2179).
--define(wxDialog_new_0, 2180).
--define(wxDialog_destruct, 2182).
--define(wxDialog_Create, 2183).
--define(wxDialog_CreateButtonSizer, 2184).
--define(wxDialog_CreateStdDialogButtonSizer, 2185).
--define(wxDialog_EndModal, 2186).
--define(wxDialog_GetAffirmativeId, 2187).
--define(wxDialog_GetReturnCode, 2188).
--define(wxDialog_IsModal, 2189).
--define(wxDialog_SetAffirmativeId, 2190).
--define(wxDialog_SetReturnCode, 2191).
--define(wxDialog_Show, 2192).
--define(wxDialog_ShowModal, 2193).
--define(wxColourDialog_new_0, 2194).
--define(wxColourDialog_new_2, 2195).
--define(wxColourDialog_destruct, 2196).
--define(wxColourDialog_Create, 2197).
--define(wxColourDialog_GetColourData, 2198).
--define(wxColourData_new_0, 2199).
--define(wxColourData_new_1, 2200).
--define(wxColourData_destruct, 2201).
--define(wxColourData_GetChooseFull, 2202).
--define(wxColourData_GetColour, 2203).
--define(wxColourData_GetCustomColour, 2205).
--define(wxColourData_SetChooseFull, 2206).
--define(wxColourData_SetColour, 2207).
--define(wxColourData_SetCustomColour, 2208).
--define(wxPalette_new_0, 2209).
--define(wxPalette_new_4, 2210).
--define(wxPalette_destruct, 2212).
--define(wxPalette_Create, 2213).
--define(wxPalette_GetColoursCount, 2214).
--define(wxPalette_GetPixel, 2215).
--define(wxPalette_GetRGB, 2216).
--define(wxPalette_IsOk, 2217).
--define(wxDirDialog_new, 2221).
--define(wxDirDialog_destruct, 2222).
--define(wxDirDialog_GetPath, 2223).
--define(wxDirDialog_GetMessage, 2224).
--define(wxDirDialog_SetMessage, 2225).
--define(wxDirDialog_SetPath, 2226).
--define(wxFileDialog_new, 2230).
--define(wxFileDialog_destruct, 2231).
--define(wxFileDialog_GetDirectory, 2232).
--define(wxFileDialog_GetFilename, 2233).
--define(wxFileDialog_GetFilenames, 2234).
--define(wxFileDialog_GetFilterIndex, 2235).
--define(wxFileDialog_GetMessage, 2236).
--define(wxFileDialog_GetPath, 2237).
--define(wxFileDialog_GetPaths, 2238).
--define(wxFileDialog_GetWildcard, 2239).
--define(wxFileDialog_SetDirectory, 2240).
--define(wxFileDialog_SetFilename, 2241).
--define(wxFileDialog_SetFilterIndex, 2242).
--define(wxFileDialog_SetMessage, 2243).
--define(wxFileDialog_SetPath, 2244).
--define(wxFileDialog_SetWildcard, 2245).
--define(wxPickerBase_SetInternalMargin, 2246).
--define(wxPickerBase_GetInternalMargin, 2247).
--define(wxPickerBase_SetTextCtrlProportion, 2248).
--define(wxPickerBase_SetPickerCtrlProportion, 2249).
--define(wxPickerBase_GetTextCtrlProportion, 2250).
--define(wxPickerBase_GetPickerCtrlProportion, 2251).
--define(wxPickerBase_HasTextCtrl, 2252).
--define(wxPickerBase_GetTextCtrl, 2253).
--define(wxPickerBase_IsTextCtrlGrowable, 2254).
--define(wxPickerBase_SetPickerCtrlGrowable, 2255).
--define(wxPickerBase_SetTextCtrlGrowable, 2256).
--define(wxPickerBase_IsPickerCtrlGrowable, 2257).
--define(wxFilePickerCtrl_new_0, 2258).
--define(wxFilePickerCtrl_new_3, 2259).
--define(wxFilePickerCtrl_Create, 2260).
--define(wxFilePickerCtrl_GetPath, 2261).
--define(wxFilePickerCtrl_SetPath, 2262).
--define(wxFilePickerCtrl_destroy, 2263).
--define(wxDirPickerCtrl_new_0, 2264).
--define(wxDirPickerCtrl_new_3, 2265).
--define(wxDirPickerCtrl_Create, 2266).
--define(wxDirPickerCtrl_GetPath, 2267).
--define(wxDirPickerCtrl_SetPath, 2268).
--define(wxDirPickerCtrl_destroy, 2269).
--define(wxColourPickerCtrl_new_0, 2270).
--define(wxColourPickerCtrl_new_3, 2271).
--define(wxColourPickerCtrl_Create, 2272).
--define(wxColourPickerCtrl_GetColour, 2273).
--define(wxColourPickerCtrl_SetColour_1_1, 2274).
--define(wxColourPickerCtrl_SetColour_1_0, 2275).
--define(wxColourPickerCtrl_destroy, 2276).
--define(wxDatePickerCtrl_new_0, 2277).
--define(wxDatePickerCtrl_new_3, 2278).
--define(wxDatePickerCtrl_GetRange, 2279).
--define(wxDatePickerCtrl_GetValue, 2280).
--define(wxDatePickerCtrl_SetRange, 2281).
--define(wxDatePickerCtrl_SetValue, 2282).
--define(wxDatePickerCtrl_destroy, 2283).
--define(wxFontPickerCtrl_new_0, 2284).
--define(wxFontPickerCtrl_new_3, 2285).
--define(wxFontPickerCtrl_Create, 2286).
--define(wxFontPickerCtrl_GetSelectedFont, 2287).
--define(wxFontPickerCtrl_SetSelectedFont, 2288).
--define(wxFontPickerCtrl_GetMaxPointSize, 2289).
--define(wxFontPickerCtrl_SetMaxPointSize, 2290).
--define(wxFontPickerCtrl_destroy, 2291).
--define(wxFindReplaceDialog_new_0, 2294).
--define(wxFindReplaceDialog_new_4, 2295).
--define(wxFindReplaceDialog_destruct, 2296).
--define(wxFindReplaceDialog_Create, 2297).
--define(wxFindReplaceDialog_GetData, 2298).
--define(wxFindReplaceData_new_0, 2299).
--define(wxFindReplaceData_new_1, 2300).
--define(wxFindReplaceData_GetFindString, 2301).
--define(wxFindReplaceData_GetReplaceString, 2302).
--define(wxFindReplaceData_GetFlags, 2303).
--define(wxFindReplaceData_SetFlags, 2304).
--define(wxFindReplaceData_SetFindString, 2305).
--define(wxFindReplaceData_SetReplaceString, 2306).
--define(wxFindReplaceData_destroy, 2307).
--define(wxMultiChoiceDialog_new_0, 2308).
--define(wxMultiChoiceDialog_new_5, 2310).
--define(wxMultiChoiceDialog_GetSelections, 2311).
--define(wxMultiChoiceDialog_SetSelections, 2312).
--define(wxMultiChoiceDialog_destroy, 2313).
--define(wxSingleChoiceDialog_new_0, 2314).
--define(wxSingleChoiceDialog_new_5, 2316).
--define(wxSingleChoiceDialog_GetSelection, 2317).
--define(wxSingleChoiceDialog_GetStringSelection, 2318).
--define(wxSingleChoiceDialog_SetSelection, 2319).
--define(wxSingleChoiceDialog_destroy, 2320).
--define(wxTextEntryDialog_new, 2321).
--define(wxTextEntryDialog_GetValue, 2322).
--define(wxTextEntryDialog_SetValue, 2323).
--define(wxTextEntryDialog_destroy, 2324).
--define(wxPasswordEntryDialog_new, 2325).
--define(wxPasswordEntryDialog_destroy, 2326).
--define(wxFontData_new_0, 2327).
--define(wxFontData_new_1, 2328).
--define(wxFontData_destruct, 2329).
--define(wxFontData_EnableEffects, 2330).
--define(wxFontData_GetAllowSymbols, 2331).
--define(wxFontData_GetColour, 2332).
--define(wxFontData_GetChosenFont, 2333).
--define(wxFontData_GetEnableEffects, 2334).
--define(wxFontData_GetInitialFont, 2335).
--define(wxFontData_GetShowHelp, 2336).
--define(wxFontData_SetAllowSymbols, 2337).
--define(wxFontData_SetChosenFont, 2338).
--define(wxFontData_SetColour, 2339).
--define(wxFontData_SetInitialFont, 2340).
--define(wxFontData_SetRange, 2341).
--define(wxFontData_SetShowHelp, 2342).
--define(wxFontDialog_new_0, 2346).
--define(wxFontDialog_new_2, 2348).
--define(wxFontDialog_Create, 2350).
--define(wxFontDialog_GetFontData, 2351).
--define(wxFontDialog_destroy, 2353).
--define(wxProgressDialog_new, 2354).
--define(wxProgressDialog_destruct, 2355).
--define(wxProgressDialog_Resume, 2356).
--define(wxProgressDialog_Update_2, 2357).
--define(wxProgressDialog_Update_0, 2358).
--define(wxMessageDialog_new, 2359).
--define(wxMessageDialog_destruct, 2360).
--define(wxPageSetupDialog_new, 2361).
--define(wxPageSetupDialog_destruct, 2362).
--define(wxPageSetupDialog_GetPageSetupData, 2363).
--define(wxPageSetupDialog_ShowModal, 2364).
--define(wxPageSetupDialogData_new_0, 2365).
--define(wxPageSetupDialogData_new_1_0, 2366).
--define(wxPageSetupDialogData_new_1_1, 2367).
--define(wxPageSetupDialogData_destruct, 2368).
--define(wxPageSetupDialogData_EnableHelp, 2369).
--define(wxPageSetupDialogData_EnableMargins, 2370).
--define(wxPageSetupDialogData_EnableOrientation, 2371).
--define(wxPageSetupDialogData_EnablePaper, 2372).
--define(wxPageSetupDialogData_EnablePrinter, 2373).
--define(wxPageSetupDialogData_GetDefaultMinMargins, 2374).
--define(wxPageSetupDialogData_GetEnableMargins, 2375).
--define(wxPageSetupDialogData_GetEnableOrientation, 2376).
--define(wxPageSetupDialogData_GetEnablePaper, 2377).
--define(wxPageSetupDialogData_GetEnablePrinter, 2378).
--define(wxPageSetupDialogData_GetEnableHelp, 2379).
--define(wxPageSetupDialogData_GetDefaultInfo, 2380).
--define(wxPageSetupDialogData_GetMarginTopLeft, 2381).
--define(wxPageSetupDialogData_GetMarginBottomRight, 2382).
--define(wxPageSetupDialogData_GetMinMarginTopLeft, 2383).
--define(wxPageSetupDialogData_GetMinMarginBottomRight, 2384).
--define(wxPageSetupDialogData_GetPaperId, 2385).
--define(wxPageSetupDialogData_GetPaperSize, 2386).
--define(wxPageSetupDialogData_GetPrintData, 2388).
--define(wxPageSetupDialogData_IsOk, 2389).
--define(wxPageSetupDialogData_SetDefaultInfo, 2390).
--define(wxPageSetupDialogData_SetDefaultMinMargins, 2391).
--define(wxPageSetupDialogData_SetMarginTopLeft, 2392).
--define(wxPageSetupDialogData_SetMarginBottomRight, 2393).
--define(wxPageSetupDialogData_SetMinMarginTopLeft, 2394).
--define(wxPageSetupDialogData_SetMinMarginBottomRight, 2395).
--define(wxPageSetupDialogData_SetPaperId, 2396).
--define(wxPageSetupDialogData_SetPaperSize_1_1, 2397).
--define(wxPageSetupDialogData_SetPaperSize_1_0, 2398).
--define(wxPageSetupDialogData_SetPrintData, 2399).
--define(wxPrintDialog_new_2_0, 2400).
--define(wxPrintDialog_new_2_1, 2401).
--define(wxPrintDialog_destruct, 2402).
--define(wxPrintDialog_GetPrintDialogData, 2403).
--define(wxPrintDialog_GetPrintDC, 2404).
--define(wxPrintDialogData_new_0, 2405).
--define(wxPrintDialogData_new_1_1, 2406).
--define(wxPrintDialogData_new_1_0, 2407).
--define(wxPrintDialogData_destruct, 2408).
--define(wxPrintDialogData_EnableHelp, 2409).
--define(wxPrintDialogData_EnablePageNumbers, 2410).
--define(wxPrintDialogData_EnablePrintToFile, 2411).
--define(wxPrintDialogData_EnableSelection, 2412).
--define(wxPrintDialogData_GetAllPages, 2413).
--define(wxPrintDialogData_GetCollate, 2414).
--define(wxPrintDialogData_GetFromPage, 2415).
--define(wxPrintDialogData_GetMaxPage, 2416).
--define(wxPrintDialogData_GetMinPage, 2417).
--define(wxPrintDialogData_GetNoCopies, 2418).
--define(wxPrintDialogData_GetPrintData, 2419).
--define(wxPrintDialogData_GetPrintToFile, 2420).
--define(wxPrintDialogData_GetSelection, 2421).
--define(wxPrintDialogData_GetToPage, 2422).
--define(wxPrintDialogData_IsOk, 2423).
--define(wxPrintDialogData_SetCollate, 2424).
--define(wxPrintDialogData_SetFromPage, 2425).
--define(wxPrintDialogData_SetMaxPage, 2426).
--define(wxPrintDialogData_SetMinPage, 2427).
--define(wxPrintDialogData_SetNoCopies, 2428).
--define(wxPrintDialogData_SetPrintData, 2429).
--define(wxPrintDialogData_SetPrintToFile, 2430).
--define(wxPrintDialogData_SetSelection, 2431).
--define(wxPrintDialogData_SetToPage, 2432).
--define(wxPrintData_new_0, 2433).
--define(wxPrintData_new_1, 2434).
--define(wxPrintData_destruct, 2435).
--define(wxPrintData_GetCollate, 2436).
--define(wxPrintData_GetBin, 2437).
--define(wxPrintData_GetColour, 2438).
--define(wxPrintData_GetDuplex, 2439).
--define(wxPrintData_GetNoCopies, 2440).
--define(wxPrintData_GetOrientation, 2441).
--define(wxPrintData_GetPaperId, 2442).
--define(wxPrintData_GetPrinterName, 2443).
--define(wxPrintData_GetQuality, 2444).
--define(wxPrintData_IsOk, 2445).
--define(wxPrintData_SetBin, 2446).
--define(wxPrintData_SetCollate, 2447).
--define(wxPrintData_SetColour, 2448).
--define(wxPrintData_SetDuplex, 2449).
--define(wxPrintData_SetNoCopies, 2450).
--define(wxPrintData_SetOrientation, 2451).
--define(wxPrintData_SetPaperId, 2452).
--define(wxPrintData_SetPrinterName, 2453).
--define(wxPrintData_SetQuality, 2454).
--define(wxPrintPreview_new_2, 2457).
--define(wxPrintPreview_new_3, 2458).
--define(wxPrintPreview_destruct, 2460).
--define(wxPrintPreview_GetCanvas, 2461).
--define(wxPrintPreview_GetCurrentPage, 2462).
--define(wxPrintPreview_GetFrame, 2463).
--define(wxPrintPreview_GetMaxPage, 2464).
--define(wxPrintPreview_GetMinPage, 2465).
--define(wxPrintPreview_GetPrintout, 2466).
--define(wxPrintPreview_GetPrintoutForPrinting, 2467).
--define(wxPrintPreview_IsOk, 2468).
--define(wxPrintPreview_PaintPage, 2469).
--define(wxPrintPreview_Print, 2470).
--define(wxPrintPreview_RenderPage, 2471).
--define(wxPrintPreview_SetCanvas, 2472).
--define(wxPrintPreview_SetCurrentPage, 2473).
--define(wxPrintPreview_SetFrame, 2474).
--define(wxPrintPreview_SetPrintout, 2475).
--define(wxPrintPreview_SetZoom, 2476).
--define(wxPreviewFrame_new, 2477).
--define(wxPreviewFrame_destruct, 2478).
--define(wxPreviewFrame_CreateControlBar, 2479).
--define(wxPreviewFrame_CreateCanvas, 2480).
--define(wxPreviewFrame_Initialize, 2481).
--define(wxPreviewFrame_OnCloseWindow, 2482).
--define(wxPreviewControlBar_new, 2483).
--define(wxPreviewControlBar_destruct, 2484).
--define(wxPreviewControlBar_CreateButtons, 2485).
--define(wxPreviewControlBar_GetPrintPreview, 2486).
--define(wxPreviewControlBar_GetZoomControl, 2487).
--define(wxPreviewControlBar_SetZoomControl, 2488).
--define(wxPrinter_new, 2490).
--define(wxPrinter_CreateAbortWindow, 2491).
--define(wxPrinter_GetAbort, 2492).
--define(wxPrinter_GetLastError, 2493).
--define(wxPrinter_GetPrintDialogData, 2494).
--define(wxPrinter_Print, 2495).
--define(wxPrinter_PrintDialog, 2496).
--define(wxPrinter_ReportError, 2497).
--define(wxPrinter_Setup, 2498).
--define(wxPrinter_destroy, 2499).
--define(wxXmlResource_new_1, 2500).
--define(wxXmlResource_new_2, 2501).
--define(wxXmlResource_destruct, 2502).
--define(wxXmlResource_AttachUnknownControl, 2503).
--define(wxXmlResource_ClearHandlers, 2504).
--define(wxXmlResource_CompareVersion, 2505).
--define(wxXmlResource_Get, 2506).
--define(wxXmlResource_GetFlags, 2507).
--define(wxXmlResource_GetVersion, 2508).
--define(wxXmlResource_GetXRCID, 2509).
--define(wxXmlResource_InitAllHandlers, 2510).
--define(wxXmlResource_Load, 2511).
--define(wxXmlResource_LoadBitmap, 2512).
--define(wxXmlResource_LoadDialog_2, 2513).
--define(wxXmlResource_LoadDialog_3, 2514).
--define(wxXmlResource_LoadFrame_2, 2515).
--define(wxXmlResource_LoadFrame_3, 2516).
--define(wxXmlResource_LoadIcon, 2517).
--define(wxXmlResource_LoadMenu, 2518).
--define(wxXmlResource_LoadMenuBar_2, 2519).
--define(wxXmlResource_LoadMenuBar_1, 2520).
--define(wxXmlResource_LoadPanel_2, 2521).
--define(wxXmlResource_LoadPanel_3, 2522).
--define(wxXmlResource_LoadToolBar, 2523).
--define(wxXmlResource_Set, 2524).
--define(wxXmlResource_SetFlags, 2525).
--define(wxXmlResource_Unload, 2526).
--define(wxXmlResource_xrcctrl, 2527).
--define(wxHtmlEasyPrinting_new, 2528).
--define(wxHtmlEasyPrinting_destruct, 2529).
--define(wxHtmlEasyPrinting_GetPrintData, 2530).
--define(wxHtmlEasyPrinting_GetPageSetupData, 2531).
--define(wxHtmlEasyPrinting_PreviewFile, 2532).
--define(wxHtmlEasyPrinting_PreviewText, 2533).
--define(wxHtmlEasyPrinting_PrintFile, 2534).
--define(wxHtmlEasyPrinting_PrintText, 2535).
--define(wxHtmlEasyPrinting_PageSetup, 2536).
--define(wxHtmlEasyPrinting_SetFonts, 2537).
--define(wxHtmlEasyPrinting_SetHeader, 2538).
--define(wxHtmlEasyPrinting_SetFooter, 2539).
--define(wxGLCanvas_new_2, 2541).
--define(wxGLCanvas_new_3_1, 2542).
--define(wxGLCanvas_new_3_0, 2543).
--define(wxGLCanvas_GetContext, 2544).
--define(wxGLCanvas_SetCurrent, 2546).
--define(wxGLCanvas_SwapBuffers, 2547).
--define(wxGLCanvas_destroy, 2548).
--define(wxAuiManager_new, 2549).
--define(wxAuiManager_destruct, 2550).
--define(wxAuiManager_AddPane_2_1, 2551).
--define(wxAuiManager_AddPane_3, 2552).
--define(wxAuiManager_AddPane_2_0, 2553).
--define(wxAuiManager_DetachPane, 2554).
--define(wxAuiManager_GetAllPanes, 2555).
--define(wxAuiManager_GetArtProvider, 2556).
--define(wxAuiManager_GetDockSizeConstraint, 2557).
--define(wxAuiManager_GetFlags, 2558).
--define(wxAuiManager_GetManagedWindow, 2559).
--define(wxAuiManager_GetManager, 2560).
--define(wxAuiManager_GetPane_1_1, 2561).
--define(wxAuiManager_GetPane_1_0, 2562).
--define(wxAuiManager_HideHint, 2563).
--define(wxAuiManager_InsertPane, 2564).
--define(wxAuiManager_LoadPaneInfo, 2565).
--define(wxAuiManager_LoadPerspective, 2566).
--define(wxAuiManager_SavePaneInfo, 2567).
--define(wxAuiManager_SavePerspective, 2568).
--define(wxAuiManager_SetArtProvider, 2569).
--define(wxAuiManager_SetDockSizeConstraint, 2570).
--define(wxAuiManager_SetFlags, 2571).
--define(wxAuiManager_SetManagedWindow, 2572).
--define(wxAuiManager_ShowHint, 2573).
--define(wxAuiManager_UnInit, 2574).
--define(wxAuiManager_Update, 2575).
--define(wxAuiPaneInfo_new_0, 2576).
--define(wxAuiPaneInfo_new_1, 2577).
--define(wxAuiPaneInfo_destruct, 2578).
--define(wxAuiPaneInfo_BestSize_1, 2579).
--define(wxAuiPaneInfo_BestSize_2, 2580).
--define(wxAuiPaneInfo_Bottom, 2581).
--define(wxAuiPaneInfo_BottomDockable, 2582).
--define(wxAuiPaneInfo_Caption, 2583).
--define(wxAuiPaneInfo_CaptionVisible, 2584).
--define(wxAuiPaneInfo_Centre, 2585).
--define(wxAuiPaneInfo_CentrePane, 2586).
--define(wxAuiPaneInfo_CloseButton, 2587).
--define(wxAuiPaneInfo_DefaultPane, 2588).
--define(wxAuiPaneInfo_DestroyOnClose, 2589).
--define(wxAuiPaneInfo_Direction, 2590).
--define(wxAuiPaneInfo_Dock, 2591).
--define(wxAuiPaneInfo_Dockable, 2592).
--define(wxAuiPaneInfo_Fixed, 2593).
--define(wxAuiPaneInfo_Float, 2594).
--define(wxAuiPaneInfo_Floatable, 2595).
--define(wxAuiPaneInfo_FloatingPosition_1, 2596).
--define(wxAuiPaneInfo_FloatingPosition_2, 2597).
--define(wxAuiPaneInfo_FloatingSize_1, 2598).
--define(wxAuiPaneInfo_FloatingSize_2, 2599).
--define(wxAuiPaneInfo_Gripper, 2600).
--define(wxAuiPaneInfo_GripperTop, 2601).
--define(wxAuiPaneInfo_HasBorder, 2602).
--define(wxAuiPaneInfo_HasCaption, 2603).
--define(wxAuiPaneInfo_HasCloseButton, 2604).
--define(wxAuiPaneInfo_HasFlag, 2605).
--define(wxAuiPaneInfo_HasGripper, 2606).
--define(wxAuiPaneInfo_HasGripperTop, 2607).
--define(wxAuiPaneInfo_HasMaximizeButton, 2608).
--define(wxAuiPaneInfo_HasMinimizeButton, 2609).
--define(wxAuiPaneInfo_HasPinButton, 2610).
--define(wxAuiPaneInfo_Hide, 2611).
--define(wxAuiPaneInfo_IsBottomDockable, 2612).
--define(wxAuiPaneInfo_IsDocked, 2613).
--define(wxAuiPaneInfo_IsFixed, 2614).
--define(wxAuiPaneInfo_IsFloatable, 2615).
--define(wxAuiPaneInfo_IsFloating, 2616).
--define(wxAuiPaneInfo_IsLeftDockable, 2617).
--define(wxAuiPaneInfo_IsMovable, 2618).
--define(wxAuiPaneInfo_IsOk, 2619).
--define(wxAuiPaneInfo_IsResizable, 2620).
--define(wxAuiPaneInfo_IsRightDockable, 2621).
--define(wxAuiPaneInfo_IsShown, 2622).
--define(wxAuiPaneInfo_IsToolbar, 2623).
--define(wxAuiPaneInfo_IsTopDockable, 2624).
--define(wxAuiPaneInfo_Layer, 2625).
--define(wxAuiPaneInfo_Left, 2626).
--define(wxAuiPaneInfo_LeftDockable, 2627).
--define(wxAuiPaneInfo_MaxSize_1, 2628).
--define(wxAuiPaneInfo_MaxSize_2, 2629).
--define(wxAuiPaneInfo_MaximizeButton, 2630).
--define(wxAuiPaneInfo_MinSize_1, 2631).
--define(wxAuiPaneInfo_MinSize_2, 2632).
--define(wxAuiPaneInfo_MinimizeButton, 2633).
--define(wxAuiPaneInfo_Movable, 2634).
--define(wxAuiPaneInfo_Name, 2635).
--define(wxAuiPaneInfo_PaneBorder, 2636).
--define(wxAuiPaneInfo_PinButton, 2637).
--define(wxAuiPaneInfo_Position, 2638).
--define(wxAuiPaneInfo_Resizable, 2639).
--define(wxAuiPaneInfo_Right, 2640).
--define(wxAuiPaneInfo_RightDockable, 2641).
--define(wxAuiPaneInfo_Row, 2642).
--define(wxAuiPaneInfo_SafeSet, 2643).
--define(wxAuiPaneInfo_SetFlag, 2644).
--define(wxAuiPaneInfo_Show, 2645).
--define(wxAuiPaneInfo_ToolbarPane, 2646).
--define(wxAuiPaneInfo_Top, 2647).
--define(wxAuiPaneInfo_TopDockable, 2648).
--define(wxAuiPaneInfo_Window, 2649).
--define(wxAuiNotebook_new_0, 2650).
--define(wxAuiNotebook_new_2, 2651).
--define(wxAuiNotebook_AddPage, 2652).
--define(wxAuiNotebook_Create, 2653).
--define(wxAuiNotebook_DeletePage, 2654).
--define(wxAuiNotebook_GetArtProvider, 2655).
--define(wxAuiNotebook_GetPage, 2656).
--define(wxAuiNotebook_GetPageBitmap, 2657).
--define(wxAuiNotebook_GetPageCount, 2658).
--define(wxAuiNotebook_GetPageIndex, 2659).
--define(wxAuiNotebook_GetPageText, 2660).
--define(wxAuiNotebook_GetSelection, 2661).
--define(wxAuiNotebook_InsertPage, 2662).
--define(wxAuiNotebook_RemovePage, 2663).
--define(wxAuiNotebook_SetArtProvider, 2664).
--define(wxAuiNotebook_SetFont, 2665).
--define(wxAuiNotebook_SetPageBitmap, 2666).
--define(wxAuiNotebook_SetPageText, 2667).
--define(wxAuiNotebook_SetSelection, 2668).
--define(wxAuiNotebook_SetTabCtrlHeight, 2669).
--define(wxAuiNotebook_SetUniformBitmapSize, 2670).
--define(wxAuiNotebook_destroy, 2671).
--define(wxMDIParentFrame_new_0, 2672).
--define(wxMDIParentFrame_new_4, 2673).
--define(wxMDIParentFrame_destruct, 2674).
--define(wxMDIParentFrame_ActivateNext, 2675).
--define(wxMDIParentFrame_ActivatePrevious, 2676).
--define(wxMDIParentFrame_ArrangeIcons, 2677).
--define(wxMDIParentFrame_Cascade, 2678).
--define(wxMDIParentFrame_Create, 2679).
--define(wxMDIParentFrame_GetActiveChild, 2680).
--define(wxMDIParentFrame_GetClientWindow, 2681).
--define(wxMDIParentFrame_Tile, 2682).
--define(wxMDIChildFrame_new_0, 2683).
--define(wxMDIChildFrame_new_4, 2684).
--define(wxMDIChildFrame_destruct, 2685).
--define(wxMDIChildFrame_Activate, 2686).
--define(wxMDIChildFrame_Create, 2687).
--define(wxMDIChildFrame_Maximize, 2688).
--define(wxMDIChildFrame_Restore, 2689).
--define(wxMDIClientWindow_new_0, 2690).
--define(wxMDIClientWindow_new_2, 2691).
--define(wxMDIClientWindow_destruct, 2692).
--define(wxMDIClientWindow_CreateClient, 2693).
--define(wxLayoutAlgorithm_new, 2694).
--define(wxLayoutAlgorithm_LayoutFrame, 2695).
--define(wxLayoutAlgorithm_LayoutMDIFrame, 2696).
--define(wxLayoutAlgorithm_LayoutWindow, 2697).
--define(wxLayoutAlgorithm_destroy, 2698).
--define(wxEvent_GetId, 2699).
--define(wxEvent_GetSkipped, 2700).
--define(wxEvent_GetTimestamp, 2701).
--define(wxEvent_IsCommandEvent, 2702).
--define(wxEvent_ResumePropagation, 2703).
--define(wxEvent_ShouldPropagate, 2704).
--define(wxEvent_Skip, 2705).
--define(wxEvent_StopPropagation, 2706).
--define(wxCommandEvent_getClientData, 2707).
--define(wxCommandEvent_GetExtraLong, 2708).
--define(wxCommandEvent_GetInt, 2709).
--define(wxCommandEvent_GetSelection, 2710).
--define(wxCommandEvent_GetString, 2711).
--define(wxCommandEvent_IsChecked, 2712).
--define(wxCommandEvent_IsSelection, 2713).
--define(wxCommandEvent_SetInt, 2714).
--define(wxCommandEvent_SetString, 2715).
--define(wxScrollEvent_GetOrientation, 2716).
--define(wxScrollEvent_GetPosition, 2717).
--define(wxScrollWinEvent_GetOrientation, 2718).
--define(wxScrollWinEvent_GetPosition, 2719).
--define(wxMouseEvent_AltDown, 2720).
--define(wxMouseEvent_Button, 2721).
--define(wxMouseEvent_ButtonDClick, 2722).
--define(wxMouseEvent_ButtonDown, 2723).
--define(wxMouseEvent_ButtonUp, 2724).
--define(wxMouseEvent_CmdDown, 2725).
--define(wxMouseEvent_ControlDown, 2726).
--define(wxMouseEvent_Dragging, 2727).
--define(wxMouseEvent_Entering, 2728).
--define(wxMouseEvent_GetButton, 2729).
--define(wxMouseEvent_GetPosition, 2732).
--define(wxMouseEvent_GetLogicalPosition, 2733).
--define(wxMouseEvent_GetLinesPerAction, 2734).
--define(wxMouseEvent_GetWheelRotation, 2735).
--define(wxMouseEvent_GetWheelDelta, 2736).
--define(wxMouseEvent_GetX, 2737).
--define(wxMouseEvent_GetY, 2738).
--define(wxMouseEvent_IsButton, 2739).
--define(wxMouseEvent_IsPageScroll, 2740).
--define(wxMouseEvent_Leaving, 2741).
--define(wxMouseEvent_LeftDClick, 2742).
--define(wxMouseEvent_LeftDown, 2743).
--define(wxMouseEvent_LeftIsDown, 2744).
--define(wxMouseEvent_LeftUp, 2745).
--define(wxMouseEvent_MetaDown, 2746).
--define(wxMouseEvent_MiddleDClick, 2747).
--define(wxMouseEvent_MiddleDown, 2748).
--define(wxMouseEvent_MiddleIsDown, 2749).
--define(wxMouseEvent_MiddleUp, 2750).
--define(wxMouseEvent_Moving, 2751).
--define(wxMouseEvent_RightDClick, 2752).
--define(wxMouseEvent_RightDown, 2753).
--define(wxMouseEvent_RightIsDown, 2754).
--define(wxMouseEvent_RightUp, 2755).
--define(wxMouseEvent_ShiftDown, 2756).
--define(wxSetCursorEvent_GetCursor, 2757).
--define(wxSetCursorEvent_GetX, 2758).
--define(wxSetCursorEvent_GetY, 2759).
--define(wxSetCursorEvent_HasCursor, 2760).
--define(wxSetCursorEvent_SetCursor, 2761).
--define(wxKeyEvent_AltDown, 2762).
--define(wxKeyEvent_CmdDown, 2763).
--define(wxKeyEvent_ControlDown, 2764).
--define(wxKeyEvent_GetKeyCode, 2765).
--define(wxKeyEvent_GetModifiers, 2766).
--define(wxKeyEvent_GetPosition, 2769).
--define(wxKeyEvent_GetRawKeyCode, 2770).
--define(wxKeyEvent_GetRawKeyFlags, 2771).
--define(wxKeyEvent_GetUnicodeKey, 2772).
--define(wxKeyEvent_GetX, 2773).
--define(wxKeyEvent_GetY, 2774).
--define(wxKeyEvent_HasModifiers, 2775).
--define(wxKeyEvent_MetaDown, 2776).
--define(wxKeyEvent_ShiftDown, 2777).
--define(wxSizeEvent_GetSize, 2778).
--define(wxMoveEvent_GetPosition, 2779).
--define(wxEraseEvent_GetDC, 2780).
--define(wxFocusEvent_GetWindow, 2781).
--define(wxChildFocusEvent_GetWindow, 2782).
--define(wxMenuEvent_GetMenu, 2783).
--define(wxMenuEvent_GetMenuId, 2784).
--define(wxMenuEvent_IsPopup, 2785).
--define(wxCloseEvent_CanVeto, 2786).
--define(wxCloseEvent_GetLoggingOff, 2787).
--define(wxCloseEvent_SetCanVeto, 2788).
--define(wxCloseEvent_SetLoggingOff, 2789).
--define(wxCloseEvent_Veto, 2790).
--define(wxShowEvent_SetShow, 2791).
--define(wxShowEvent_GetShow, 2792).
--define(wxIconizeEvent_Iconized, 2793).
--define(wxJoystickEvent_ButtonDown, 2794).
--define(wxJoystickEvent_ButtonIsDown, 2795).
--define(wxJoystickEvent_ButtonUp, 2796).
--define(wxJoystickEvent_GetButtonChange, 2797).
--define(wxJoystickEvent_GetButtonState, 2798).
--define(wxJoystickEvent_GetJoystick, 2799).
--define(wxJoystickEvent_GetPosition, 2800).
--define(wxJoystickEvent_GetZPosition, 2801).
--define(wxJoystickEvent_IsButton, 2802).
--define(wxJoystickEvent_IsMove, 2803).
--define(wxJoystickEvent_IsZMove, 2804).
--define(wxUpdateUIEvent_CanUpdate, 2805).
--define(wxUpdateUIEvent_Check, 2806).
--define(wxUpdateUIEvent_Enable, 2807).
--define(wxUpdateUIEvent_Show, 2808).
--define(wxUpdateUIEvent_GetChecked, 2809).
--define(wxUpdateUIEvent_GetEnabled, 2810).
--define(wxUpdateUIEvent_GetShown, 2811).
--define(wxUpdateUIEvent_GetSetChecked, 2812).
--define(wxUpdateUIEvent_GetSetEnabled, 2813).
--define(wxUpdateUIEvent_GetSetShown, 2814).
--define(wxUpdateUIEvent_GetSetText, 2815).
--define(wxUpdateUIEvent_GetText, 2816).
--define(wxUpdateUIEvent_GetMode, 2817).
--define(wxUpdateUIEvent_GetUpdateInterval, 2818).
--define(wxUpdateUIEvent_ResetUpdateTime, 2819).
--define(wxUpdateUIEvent_SetMode, 2820).
--define(wxUpdateUIEvent_SetText, 2821).
--define(wxUpdateUIEvent_SetUpdateInterval, 2822).
--define(wxMouseCaptureChangedEvent_GetCapturedWindow, 2823).
--define(wxPaletteChangedEvent_SetChangedWindow, 2824).
--define(wxPaletteChangedEvent_GetChangedWindow, 2825).
--define(wxQueryNewPaletteEvent_SetPaletteRealized, 2826).
--define(wxQueryNewPaletteEvent_GetPaletteRealized, 2827).
--define(wxNavigationKeyEvent_GetDirection, 2828).
--define(wxNavigationKeyEvent_SetDirection, 2829).
--define(wxNavigationKeyEvent_IsWindowChange, 2830).
--define(wxNavigationKeyEvent_SetWindowChange, 2831).
--define(wxNavigationKeyEvent_IsFromTab, 2832).
--define(wxNavigationKeyEvent_SetFromTab, 2833).
--define(wxNavigationKeyEvent_GetCurrentFocus, 2834).
--define(wxNavigationKeyEvent_SetCurrentFocus, 2835).
--define(wxHelpEvent_GetOrigin, 2836).
--define(wxHelpEvent_GetPosition, 2837).
--define(wxHelpEvent_SetOrigin, 2838).
--define(wxHelpEvent_SetPosition, 2839).
--define(wxContextMenuEvent_GetPosition, 2840).
--define(wxContextMenuEvent_SetPosition, 2841).
--define(wxIdleEvent_CanSend, 2842).
--define(wxIdleEvent_GetMode, 2843).
--define(wxIdleEvent_RequestMore, 2844).
--define(wxIdleEvent_MoreRequested, 2845).
--define(wxIdleEvent_SetMode, 2846).
--define(wxGridEvent_AltDown, 2847).
--define(wxGridEvent_ControlDown, 2848).
--define(wxGridEvent_GetCol, 2849).
--define(wxGridEvent_GetPosition, 2850).
--define(wxGridEvent_GetRow, 2851).
--define(wxGridEvent_MetaDown, 2852).
--define(wxGridEvent_Selecting, 2853).
--define(wxGridEvent_ShiftDown, 2854).
--define(wxNotifyEvent_Allow, 2855).
--define(wxNotifyEvent_IsAllowed, 2856).
--define(wxNotifyEvent_Veto, 2857).
--define(wxSashEvent_GetEdge, 2858).
--define(wxSashEvent_GetDragRect, 2859).
--define(wxSashEvent_GetDragStatus, 2860).
--define(wxListEvent_GetCacheFrom, 2861).
--define(wxListEvent_GetCacheTo, 2862).
--define(wxListEvent_GetKeyCode, 2863).
--define(wxListEvent_GetIndex, 2864).
--define(wxListEvent_GetColumn, 2865).
--define(wxListEvent_GetPoint, 2866).
--define(wxListEvent_GetLabel, 2867).
--define(wxListEvent_GetText, 2868).
--define(wxListEvent_GetImage, 2869).
--define(wxListEvent_GetData, 2870).
--define(wxListEvent_GetMask, 2871).
--define(wxListEvent_GetItem, 2872).
--define(wxListEvent_IsEditCancelled, 2873).
--define(wxDateEvent_GetDate, 2874).
--define(wxCalendarEvent_GetWeekDay, 2875).
--define(wxFileDirPickerEvent_GetPath, 2876).
--define(wxColourPickerEvent_GetColour, 2877).
--define(wxFontPickerEvent_GetFont, 2878).
--define(wxStyledTextEvent_GetPosition, 2879).
--define(wxStyledTextEvent_GetKey, 2880).
--define(wxStyledTextEvent_GetModifiers, 2881).
--define(wxStyledTextEvent_GetModificationType, 2882).
--define(wxStyledTextEvent_GetText, 2883).
--define(wxStyledTextEvent_GetLength, 2884).
--define(wxStyledTextEvent_GetLinesAdded, 2885).
--define(wxStyledTextEvent_GetLine, 2886).
--define(wxStyledTextEvent_GetFoldLevelNow, 2887).
--define(wxStyledTextEvent_GetFoldLevelPrev, 2888).
--define(wxStyledTextEvent_GetMargin, 2889).
--define(wxStyledTextEvent_GetMessage, 2890).
--define(wxStyledTextEvent_GetWParam, 2891).
--define(wxStyledTextEvent_GetLParam, 2892).
--define(wxStyledTextEvent_GetListType, 2893).
--define(wxStyledTextEvent_GetX, 2894).
--define(wxStyledTextEvent_GetY, 2895).
--define(wxStyledTextEvent_GetDragText, 2896).
--define(wxStyledTextEvent_GetDragAllowMove, 2897).
--define(wxStyledTextEvent_GetDragResult, 2898).
--define(wxStyledTextEvent_GetShift, 2899).
--define(wxStyledTextEvent_GetControl, 2900).
--define(wxStyledTextEvent_GetAlt, 2901).
--define(utils_wxGetKeyState, 2902).
--define(utils_wxGetMousePosition, 2903).
--define(utils_wxGetMouseState, 2904).
--define(utils_wxSetDetectableAutoRepeat, 2905).
--define(utils_wxBell, 2906).
--define(utils_wxFindMenuItemId, 2907).
--define(utils_wxGenericFindWindowAtPoint, 2908).
--define(utils_wxFindWindowAtPoint, 2909).
--define(utils_wxBeginBusyCursor, 2910).
--define(utils_wxEndBusyCursor, 2911).
--define(utils_wxIsBusy, 2912).
--define(utils_wxShutdown, 2913).
--define(utils_wxShell, 2914).
--define(utils_wxLaunchDefaultBrowser, 2915).
--define(utils_wxGetEmailAddress, 2916).
--define(utils_wxGetUserId, 2917).
--define(utils_wxGetHomeDir, 2918).
--define(utils_wxNewId, 2919).
--define(utils_wxRegisterId, 2920).
--define(utils_wxGetCurrentId, 2921).
--define(utils_wxGetOsDescription, 2922).
--define(utils_wxIsPlatformLittleEndian, 2923).
--define(utils_wxIsPlatform64Bit, 2924).
--define(wxPrintout_new, 2925).
--define(wxPrintout_destruct, 2926).
--define(wxPrintout_GetDC, 2927).
--define(wxPrintout_GetPageSizeMM, 2928).
--define(wxPrintout_GetPageSizePixels, 2929).
--define(wxPrintout_GetPaperRectPixels, 2930).
--define(wxPrintout_GetPPIPrinter, 2931).
--define(wxPrintout_GetPPIScreen, 2932).
--define(wxPrintout_GetTitle, 2933).
--define(wxPrintout_IsPreview, 2934).
--define(wxPrintout_FitThisSizeToPaper, 2935).
--define(wxPrintout_FitThisSizeToPage, 2936).
--define(wxPrintout_FitThisSizeToPageMargins, 2937).
--define(wxPrintout_MapScreenSizeToPaper, 2938).
--define(wxPrintout_MapScreenSizeToPage, 2939).
--define(wxPrintout_MapScreenSizeToPageMargins, 2940).
--define(wxPrintout_MapScreenSizeToDevice, 2941).
--define(wxPrintout_GetLogicalPaperRect, 2942).
--define(wxPrintout_GetLogicalPageRect, 2943).
--define(wxPrintout_GetLogicalPageMarginsRect, 2944).
--define(wxPrintout_SetLogicalOrigin, 2945).
--define(wxPrintout_OffsetLogicalOrigin, 2946).
--define(wxStyledTextCtrl_new_2, 2947).
--define(wxStyledTextCtrl_new_0, 2948).
--define(wxStyledTextCtrl_destruct, 2949).
--define(wxStyledTextCtrl_Create, 2950).
--define(wxStyledTextCtrl_AddText, 2951).
--define(wxStyledTextCtrl_AddStyledText, 2952).
--define(wxStyledTextCtrl_InsertText, 2953).
--define(wxStyledTextCtrl_ClearAll, 2954).
--define(wxStyledTextCtrl_ClearDocumentStyle, 2955).
--define(wxStyledTextCtrl_GetLength, 2956).
--define(wxStyledTextCtrl_GetCharAt, 2957).
--define(wxStyledTextCtrl_GetCurrentPos, 2958).
--define(wxStyledTextCtrl_GetAnchor, 2959).
--define(wxStyledTextCtrl_GetStyleAt, 2960).
--define(wxStyledTextCtrl_Redo, 2961).
--define(wxStyledTextCtrl_SetUndoCollection, 2962).
--define(wxStyledTextCtrl_SelectAll, 2963).
--define(wxStyledTextCtrl_SetSavePoint, 2964).
--define(wxStyledTextCtrl_GetStyledText, 2965).
--define(wxStyledTextCtrl_CanRedo, 2966).
--define(wxStyledTextCtrl_MarkerLineFromHandle, 2967).
--define(wxStyledTextCtrl_MarkerDeleteHandle, 2968).
--define(wxStyledTextCtrl_GetUndoCollection, 2969).
--define(wxStyledTextCtrl_GetViewWhiteSpace, 2970).
--define(wxStyledTextCtrl_SetViewWhiteSpace, 2971).
--define(wxStyledTextCtrl_PositionFromPoint, 2972).
--define(wxStyledTextCtrl_PositionFromPointClose, 2973).
--define(wxStyledTextCtrl_GotoLine, 2974).
--define(wxStyledTextCtrl_GotoPos, 2975).
--define(wxStyledTextCtrl_SetAnchor, 2976).
--define(wxStyledTextCtrl_GetCurLine, 2977).
--define(wxStyledTextCtrl_GetEndStyled, 2978).
--define(wxStyledTextCtrl_ConvertEOLs, 2979).
--define(wxStyledTextCtrl_GetEOLMode, 2980).
--define(wxStyledTextCtrl_SetEOLMode, 2981).
--define(wxStyledTextCtrl_StartStyling, 2982).
--define(wxStyledTextCtrl_SetStyling, 2983).
--define(wxStyledTextCtrl_GetBufferedDraw, 2984).
--define(wxStyledTextCtrl_SetBufferedDraw, 2985).
--define(wxStyledTextCtrl_SetTabWidth, 2986).
--define(wxStyledTextCtrl_GetTabWidth, 2987).
--define(wxStyledTextCtrl_SetCodePage, 2988).
--define(wxStyledTextCtrl_MarkerDefine, 2989).
--define(wxStyledTextCtrl_MarkerSetForeground, 2990).
--define(wxStyledTextCtrl_MarkerSetBackground, 2991).
--define(wxStyledTextCtrl_MarkerAdd, 2992).
--define(wxStyledTextCtrl_MarkerDelete, 2993).
--define(wxStyledTextCtrl_MarkerDeleteAll, 2994).
--define(wxStyledTextCtrl_MarkerGet, 2995).
--define(wxStyledTextCtrl_MarkerNext, 2996).
--define(wxStyledTextCtrl_MarkerPrevious, 2997).
--define(wxStyledTextCtrl_MarkerDefineBitmap, 2998).
--define(wxStyledTextCtrl_MarkerAddSet, 2999).
--define(wxStyledTextCtrl_MarkerSetAlpha, 3000).
--define(wxStyledTextCtrl_SetMarginType, 3001).
--define(wxStyledTextCtrl_GetMarginType, 3002).
--define(wxStyledTextCtrl_SetMarginWidth, 3003).
--define(wxStyledTextCtrl_GetMarginWidth, 3004).
--define(wxStyledTextCtrl_SetMarginMask, 3005).
--define(wxStyledTextCtrl_GetMarginMask, 3006).
--define(wxStyledTextCtrl_SetMarginSensitive, 3007).
--define(wxStyledTextCtrl_GetMarginSensitive, 3008).
--define(wxStyledTextCtrl_StyleClearAll, 3009).
--define(wxStyledTextCtrl_StyleSetForeground, 3010).
--define(wxStyledTextCtrl_StyleSetBackground, 3011).
--define(wxStyledTextCtrl_StyleSetBold, 3012).
--define(wxStyledTextCtrl_StyleSetItalic, 3013).
--define(wxStyledTextCtrl_StyleSetSize, 3014).
--define(wxStyledTextCtrl_StyleSetFaceName, 3015).
--define(wxStyledTextCtrl_StyleSetEOLFilled, 3016).
--define(wxStyledTextCtrl_StyleResetDefault, 3017).
--define(wxStyledTextCtrl_StyleSetUnderline, 3018).
--define(wxStyledTextCtrl_StyleSetCase, 3019).
--define(wxStyledTextCtrl_StyleSetHotSpot, 3020).
--define(wxStyledTextCtrl_SetSelForeground, 3021).
--define(wxStyledTextCtrl_SetSelBackground, 3022).
--define(wxStyledTextCtrl_GetSelAlpha, 3023).
--define(wxStyledTextCtrl_SetSelAlpha, 3024).
--define(wxStyledTextCtrl_SetCaretForeground, 3025).
--define(wxStyledTextCtrl_CmdKeyAssign, 3026).
--define(wxStyledTextCtrl_CmdKeyClear, 3027).
--define(wxStyledTextCtrl_CmdKeyClearAll, 3028).
--define(wxStyledTextCtrl_SetStyleBytes, 3029).
--define(wxStyledTextCtrl_StyleSetVisible, 3030).
--define(wxStyledTextCtrl_GetCaretPeriod, 3031).
--define(wxStyledTextCtrl_SetCaretPeriod, 3032).
--define(wxStyledTextCtrl_SetWordChars, 3033).
--define(wxStyledTextCtrl_BeginUndoAction, 3034).
--define(wxStyledTextCtrl_EndUndoAction, 3035).
--define(wxStyledTextCtrl_IndicatorSetStyle, 3036).
--define(wxStyledTextCtrl_IndicatorGetStyle, 3037).
--define(wxStyledTextCtrl_IndicatorSetForeground, 3038).
--define(wxStyledTextCtrl_IndicatorGetForeground, 3039).
--define(wxStyledTextCtrl_SetWhitespaceForeground, 3040).
--define(wxStyledTextCtrl_SetWhitespaceBackground, 3041).
--define(wxStyledTextCtrl_GetStyleBits, 3042).
--define(wxStyledTextCtrl_SetLineState, 3043).
--define(wxStyledTextCtrl_GetLineState, 3044).
--define(wxStyledTextCtrl_GetMaxLineState, 3045).
--define(wxStyledTextCtrl_GetCaretLineVisible, 3046).
--define(wxStyledTextCtrl_SetCaretLineVisible, 3047).
--define(wxStyledTextCtrl_GetCaretLineBackground, 3048).
--define(wxStyledTextCtrl_SetCaretLineBackground, 3049).
--define(wxStyledTextCtrl_AutoCompShow, 3050).
--define(wxStyledTextCtrl_AutoCompCancel, 3051).
--define(wxStyledTextCtrl_AutoCompActive, 3052).
--define(wxStyledTextCtrl_AutoCompPosStart, 3053).
--define(wxStyledTextCtrl_AutoCompComplete, 3054).
--define(wxStyledTextCtrl_AutoCompStops, 3055).
--define(wxStyledTextCtrl_AutoCompSetSeparator, 3056).
--define(wxStyledTextCtrl_AutoCompGetSeparator, 3057).
--define(wxStyledTextCtrl_AutoCompSelect, 3058).
--define(wxStyledTextCtrl_AutoCompSetCancelAtStart, 3059).
--define(wxStyledTextCtrl_AutoCompGetCancelAtStart, 3060).
--define(wxStyledTextCtrl_AutoCompSetFillUps, 3061).
--define(wxStyledTextCtrl_AutoCompSetChooseSingle, 3062).
--define(wxStyledTextCtrl_AutoCompGetChooseSingle, 3063).
--define(wxStyledTextCtrl_AutoCompSetIgnoreCase, 3064).
--define(wxStyledTextCtrl_AutoCompGetIgnoreCase, 3065).
--define(wxStyledTextCtrl_UserListShow, 3066).
--define(wxStyledTextCtrl_AutoCompSetAutoHide, 3067).
--define(wxStyledTextCtrl_AutoCompGetAutoHide, 3068).
--define(wxStyledTextCtrl_AutoCompSetDropRestOfWord, 3069).
--define(wxStyledTextCtrl_AutoCompGetDropRestOfWord, 3070).
--define(wxStyledTextCtrl_RegisterImage, 3071).
--define(wxStyledTextCtrl_ClearRegisteredImages, 3072).
--define(wxStyledTextCtrl_AutoCompGetTypeSeparator, 3073).
--define(wxStyledTextCtrl_AutoCompSetTypeSeparator, 3074).
--define(wxStyledTextCtrl_AutoCompSetMaxWidth, 3075).
--define(wxStyledTextCtrl_AutoCompGetMaxWidth, 3076).
--define(wxStyledTextCtrl_AutoCompSetMaxHeight, 3077).
--define(wxStyledTextCtrl_AutoCompGetMaxHeight, 3078).
--define(wxStyledTextCtrl_SetIndent, 3079).
--define(wxStyledTextCtrl_GetIndent, 3080).
--define(wxStyledTextCtrl_SetUseTabs, 3081).
--define(wxStyledTextCtrl_GetUseTabs, 3082).
--define(wxStyledTextCtrl_SetLineIndentation, 3083).
--define(wxStyledTextCtrl_GetLineIndentation, 3084).
--define(wxStyledTextCtrl_GetLineIndentPosition, 3085).
--define(wxStyledTextCtrl_GetColumn, 3086).
--define(wxStyledTextCtrl_SetUseHorizontalScrollBar, 3087).
--define(wxStyledTextCtrl_GetUseHorizontalScrollBar, 3088).
--define(wxStyledTextCtrl_SetIndentationGuides, 3089).
--define(wxStyledTextCtrl_GetIndentationGuides, 3090).
--define(wxStyledTextCtrl_SetHighlightGuide, 3091).
--define(wxStyledTextCtrl_GetHighlightGuide, 3092).
--define(wxStyledTextCtrl_GetLineEndPosition, 3093).
--define(wxStyledTextCtrl_GetCodePage, 3094).
--define(wxStyledTextCtrl_GetCaretForeground, 3095).
--define(wxStyledTextCtrl_GetReadOnly, 3096).
--define(wxStyledTextCtrl_SetCurrentPos, 3097).
--define(wxStyledTextCtrl_SetSelectionStart, 3098).
--define(wxStyledTextCtrl_GetSelectionStart, 3099).
--define(wxStyledTextCtrl_SetSelectionEnd, 3100).
--define(wxStyledTextCtrl_GetSelectionEnd, 3101).
--define(wxStyledTextCtrl_SetPrintMagnification, 3102).
--define(wxStyledTextCtrl_GetPrintMagnification, 3103).
--define(wxStyledTextCtrl_SetPrintColourMode, 3104).
--define(wxStyledTextCtrl_GetPrintColourMode, 3105).
--define(wxStyledTextCtrl_FindText, 3106).
--define(wxStyledTextCtrl_FormatRange, 3107).
--define(wxStyledTextCtrl_GetFirstVisibleLine, 3108).
--define(wxStyledTextCtrl_GetLine, 3109).
--define(wxStyledTextCtrl_GetLineCount, 3110).
--define(wxStyledTextCtrl_SetMarginLeft, 3111).
--define(wxStyledTextCtrl_GetMarginLeft, 3112).
--define(wxStyledTextCtrl_SetMarginRight, 3113).
--define(wxStyledTextCtrl_GetMarginRight, 3114).
--define(wxStyledTextCtrl_GetModify, 3115).
--define(wxStyledTextCtrl_SetSelection, 3116).
--define(wxStyledTextCtrl_GetSelectedText, 3117).
--define(wxStyledTextCtrl_GetTextRange, 3118).
--define(wxStyledTextCtrl_HideSelection, 3119).
--define(wxStyledTextCtrl_LineFromPosition, 3120).
--define(wxStyledTextCtrl_PositionFromLine, 3121).
--define(wxStyledTextCtrl_LineScroll, 3122).
--define(wxStyledTextCtrl_EnsureCaretVisible, 3123).
--define(wxStyledTextCtrl_ReplaceSelection, 3124).
--define(wxStyledTextCtrl_SetReadOnly, 3125).
--define(wxStyledTextCtrl_CanPaste, 3126).
--define(wxStyledTextCtrl_CanUndo, 3127).
--define(wxStyledTextCtrl_EmptyUndoBuffer, 3128).
--define(wxStyledTextCtrl_Undo, 3129).
--define(wxStyledTextCtrl_Cut, 3130).
--define(wxStyledTextCtrl_Copy, 3131).
--define(wxStyledTextCtrl_Paste, 3132).
--define(wxStyledTextCtrl_Clear, 3133).
--define(wxStyledTextCtrl_SetText, 3134).
--define(wxStyledTextCtrl_GetText, 3135).
--define(wxStyledTextCtrl_GetTextLength, 3136).
--define(wxStyledTextCtrl_GetOvertype, 3137).
--define(wxStyledTextCtrl_SetCaretWidth, 3138).
--define(wxStyledTextCtrl_GetCaretWidth, 3139).
--define(wxStyledTextCtrl_SetTargetStart, 3140).
--define(wxStyledTextCtrl_GetTargetStart, 3141).
--define(wxStyledTextCtrl_SetTargetEnd, 3142).
--define(wxStyledTextCtrl_GetTargetEnd, 3143).
--define(wxStyledTextCtrl_ReplaceTarget, 3144).
--define(wxStyledTextCtrl_SearchInTarget, 3145).
--define(wxStyledTextCtrl_SetSearchFlags, 3146).
--define(wxStyledTextCtrl_GetSearchFlags, 3147).
--define(wxStyledTextCtrl_CallTipShow, 3148).
--define(wxStyledTextCtrl_CallTipCancel, 3149).
--define(wxStyledTextCtrl_CallTipActive, 3150).
--define(wxStyledTextCtrl_CallTipPosAtStart, 3151).
--define(wxStyledTextCtrl_CallTipSetHighlight, 3152).
--define(wxStyledTextCtrl_CallTipSetBackground, 3153).
--define(wxStyledTextCtrl_CallTipSetForeground, 3154).
--define(wxStyledTextCtrl_CallTipSetForegroundHighlight, 3155).
--define(wxStyledTextCtrl_CallTipUseStyle, 3156).
--define(wxStyledTextCtrl_VisibleFromDocLine, 3157).
--define(wxStyledTextCtrl_DocLineFromVisible, 3158).
--define(wxStyledTextCtrl_WrapCount, 3159).
--define(wxStyledTextCtrl_SetFoldLevel, 3160).
--define(wxStyledTextCtrl_GetFoldLevel, 3161).
--define(wxStyledTextCtrl_GetLastChild, 3162).
--define(wxStyledTextCtrl_GetFoldParent, 3163).
--define(wxStyledTextCtrl_ShowLines, 3164).
--define(wxStyledTextCtrl_HideLines, 3165).
--define(wxStyledTextCtrl_GetLineVisible, 3166).
--define(wxStyledTextCtrl_SetFoldExpanded, 3167).
--define(wxStyledTextCtrl_GetFoldExpanded, 3168).
--define(wxStyledTextCtrl_ToggleFold, 3169).
--define(wxStyledTextCtrl_EnsureVisible, 3170).
--define(wxStyledTextCtrl_SetFoldFlags, 3171).
--define(wxStyledTextCtrl_EnsureVisibleEnforcePolicy, 3172).
--define(wxStyledTextCtrl_SetTabIndents, 3173).
--define(wxStyledTextCtrl_GetTabIndents, 3174).
--define(wxStyledTextCtrl_SetBackSpaceUnIndents, 3175).
--define(wxStyledTextCtrl_GetBackSpaceUnIndents, 3176).
--define(wxStyledTextCtrl_SetMouseDwellTime, 3177).
--define(wxStyledTextCtrl_GetMouseDwellTime, 3178).
--define(wxStyledTextCtrl_WordStartPosition, 3179).
--define(wxStyledTextCtrl_WordEndPosition, 3180).
--define(wxStyledTextCtrl_SetWrapMode, 3181).
--define(wxStyledTextCtrl_GetWrapMode, 3182).
--define(wxStyledTextCtrl_SetWrapVisualFlags, 3183).
--define(wxStyledTextCtrl_GetWrapVisualFlags, 3184).
--define(wxStyledTextCtrl_SetWrapVisualFlagsLocation, 3185).
--define(wxStyledTextCtrl_GetWrapVisualFlagsLocation, 3186).
--define(wxStyledTextCtrl_SetWrapStartIndent, 3187).
--define(wxStyledTextCtrl_GetWrapStartIndent, 3188).
--define(wxStyledTextCtrl_SetLayoutCache, 3189).
--define(wxStyledTextCtrl_GetLayoutCache, 3190).
--define(wxStyledTextCtrl_SetScrollWidth, 3191).
--define(wxStyledTextCtrl_GetScrollWidth, 3192).
--define(wxStyledTextCtrl_TextWidth, 3193).
--define(wxStyledTextCtrl_GetEndAtLastLine, 3194).
--define(wxStyledTextCtrl_TextHeight, 3195).
--define(wxStyledTextCtrl_SetUseVerticalScrollBar, 3196).
--define(wxStyledTextCtrl_GetUseVerticalScrollBar, 3197).
--define(wxStyledTextCtrl_AppendText, 3198).
--define(wxStyledTextCtrl_GetTwoPhaseDraw, 3199).
--define(wxStyledTextCtrl_SetTwoPhaseDraw, 3200).
--define(wxStyledTextCtrl_TargetFromSelection, 3201).
--define(wxStyledTextCtrl_LinesJoin, 3202).
--define(wxStyledTextCtrl_LinesSplit, 3203).
--define(wxStyledTextCtrl_SetFoldMarginColour, 3204).
--define(wxStyledTextCtrl_SetFoldMarginHiColour, 3205).
--define(wxStyledTextCtrl_LineDown, 3206).
--define(wxStyledTextCtrl_LineDownExtend, 3207).
--define(wxStyledTextCtrl_LineUp, 3208).
--define(wxStyledTextCtrl_LineUpExtend, 3209).
--define(wxStyledTextCtrl_CharLeft, 3210).
--define(wxStyledTextCtrl_CharLeftExtend, 3211).
--define(wxStyledTextCtrl_CharRight, 3212).
--define(wxStyledTextCtrl_CharRightExtend, 3213).
--define(wxStyledTextCtrl_WordLeft, 3214).
--define(wxStyledTextCtrl_WordLeftExtend, 3215).
--define(wxStyledTextCtrl_WordRight, 3216).
--define(wxStyledTextCtrl_WordRightExtend, 3217).
--define(wxStyledTextCtrl_Home, 3218).
--define(wxStyledTextCtrl_HomeExtend, 3219).
--define(wxStyledTextCtrl_LineEnd, 3220).
--define(wxStyledTextCtrl_LineEndExtend, 3221).
--define(wxStyledTextCtrl_DocumentStart, 3222).
--define(wxStyledTextCtrl_DocumentStartExtend, 3223).
--define(wxStyledTextCtrl_DocumentEnd, 3224).
--define(wxStyledTextCtrl_DocumentEndExtend, 3225).
--define(wxStyledTextCtrl_PageUp, 3226).
--define(wxStyledTextCtrl_PageUpExtend, 3227).
--define(wxStyledTextCtrl_PageDown, 3228).
--define(wxStyledTextCtrl_PageDownExtend, 3229).
--define(wxStyledTextCtrl_EditToggleOvertype, 3230).
--define(wxStyledTextCtrl_Cancel, 3231).
--define(wxStyledTextCtrl_DeleteBack, 3232).
--define(wxStyledTextCtrl_Tab, 3233).
--define(wxStyledTextCtrl_BackTab, 3234).
--define(wxStyledTextCtrl_NewLine, 3235).
--define(wxStyledTextCtrl_FormFeed, 3236).
--define(wxStyledTextCtrl_VCHome, 3237).
--define(wxStyledTextCtrl_VCHomeExtend, 3238).
--define(wxStyledTextCtrl_ZoomIn, 3239).
--define(wxStyledTextCtrl_ZoomOut, 3240).
--define(wxStyledTextCtrl_DelWordLeft, 3241).
--define(wxStyledTextCtrl_DelWordRight, 3242).
--define(wxStyledTextCtrl_LineCut, 3243).
--define(wxStyledTextCtrl_LineDelete, 3244).
--define(wxStyledTextCtrl_LineTranspose, 3245).
--define(wxStyledTextCtrl_LineDuplicate, 3246).
--define(wxStyledTextCtrl_LowerCase, 3247).
--define(wxStyledTextCtrl_UpperCase, 3248).
--define(wxStyledTextCtrl_LineScrollDown, 3249).
--define(wxStyledTextCtrl_LineScrollUp, 3250).
--define(wxStyledTextCtrl_DeleteBackNotLine, 3251).
--define(wxStyledTextCtrl_HomeDisplay, 3252).
--define(wxStyledTextCtrl_HomeDisplayExtend, 3253).
--define(wxStyledTextCtrl_LineEndDisplay, 3254).
--define(wxStyledTextCtrl_LineEndDisplayExtend, 3255).
--define(wxStyledTextCtrl_HomeWrapExtend, 3256).
--define(wxStyledTextCtrl_LineEndWrap, 3257).
--define(wxStyledTextCtrl_LineEndWrapExtend, 3258).
--define(wxStyledTextCtrl_VCHomeWrap, 3259).
--define(wxStyledTextCtrl_VCHomeWrapExtend, 3260).
--define(wxStyledTextCtrl_LineCopy, 3261).
--define(wxStyledTextCtrl_MoveCaretInsideView, 3262).
--define(wxStyledTextCtrl_LineLength, 3263).
--define(wxStyledTextCtrl_BraceHighlight, 3264).
--define(wxStyledTextCtrl_BraceBadLight, 3265).
--define(wxStyledTextCtrl_BraceMatch, 3266).
--define(wxStyledTextCtrl_GetViewEOL, 3267).
--define(wxStyledTextCtrl_SetViewEOL, 3268).
--define(wxStyledTextCtrl_SetModEventMask, 3269).
--define(wxStyledTextCtrl_GetEdgeColumn, 3270).
--define(wxStyledTextCtrl_SetEdgeColumn, 3271).
--define(wxStyledTextCtrl_GetEdgeMode, 3272).
--define(wxStyledTextCtrl_GetEdgeColour, 3273).
--define(wxStyledTextCtrl_SetEdgeColour, 3274).
--define(wxStyledTextCtrl_SearchAnchor, 3275).
--define(wxStyledTextCtrl_SearchNext, 3276).
--define(wxStyledTextCtrl_SearchPrev, 3277).
--define(wxStyledTextCtrl_LinesOnScreen, 3278).
--define(wxStyledTextCtrl_UsePopUp, 3279).
--define(wxStyledTextCtrl_SelectionIsRectangle, 3280).
--define(wxStyledTextCtrl_SetZoom, 3281).
--define(wxStyledTextCtrl_GetZoom, 3282).
--define(wxStyledTextCtrl_GetModEventMask, 3283).
--define(wxStyledTextCtrl_SetSTCFocus, 3284).
--define(wxStyledTextCtrl_GetSTCFocus, 3285).
--define(wxStyledTextCtrl_SetStatus, 3286).
--define(wxStyledTextCtrl_GetStatus, 3287).
--define(wxStyledTextCtrl_SetMouseDownCaptures, 3288).
--define(wxStyledTextCtrl_GetMouseDownCaptures, 3289).
--define(wxStyledTextCtrl_SetSTCCursor, 3290).
--define(wxStyledTextCtrl_GetSTCCursor, 3291).
--define(wxStyledTextCtrl_SetControlCharSymbol, 3292).
--define(wxStyledTextCtrl_GetControlCharSymbol, 3293).
--define(wxStyledTextCtrl_WordPartLeft, 3294).
--define(wxStyledTextCtrl_WordPartLeftExtend, 3295).
--define(wxStyledTextCtrl_WordPartRight, 3296).
--define(wxStyledTextCtrl_WordPartRightExtend, 3297).
--define(wxStyledTextCtrl_SetVisiblePolicy, 3298).
--define(wxStyledTextCtrl_DelLineLeft, 3299).
--define(wxStyledTextCtrl_DelLineRight, 3300).
--define(wxStyledTextCtrl_GetXOffset, 3301).
--define(wxStyledTextCtrl_ChooseCaretX, 3302).
--define(wxStyledTextCtrl_SetXCaretPolicy, 3303).
--define(wxStyledTextCtrl_SetYCaretPolicy, 3304).
--define(wxStyledTextCtrl_GetPrintWrapMode, 3305).
--define(wxStyledTextCtrl_SetHotspotActiveForeground, 3306).
--define(wxStyledTextCtrl_SetHotspotActiveBackground, 3307).
--define(wxStyledTextCtrl_SetHotspotActiveUnderline, 3308).
--define(wxStyledTextCtrl_SetHotspotSingleLine, 3309).
--define(wxStyledTextCtrl_ParaDownExtend, 3310).
--define(wxStyledTextCtrl_ParaUp, 3311).
--define(wxStyledTextCtrl_ParaUpExtend, 3312).
--define(wxStyledTextCtrl_PositionBefore, 3313).
--define(wxStyledTextCtrl_PositionAfter, 3314).
--define(wxStyledTextCtrl_CopyRange, 3315).
--define(wxStyledTextCtrl_CopyText, 3316).
--define(wxStyledTextCtrl_SetSelectionMode, 3317).
--define(wxStyledTextCtrl_GetSelectionMode, 3318).
--define(wxStyledTextCtrl_LineDownRectExtend, 3319).
--define(wxStyledTextCtrl_LineUpRectExtend, 3320).
--define(wxStyledTextCtrl_CharLeftRectExtend, 3321).
--define(wxStyledTextCtrl_CharRightRectExtend, 3322).
--define(wxStyledTextCtrl_HomeRectExtend, 3323).
--define(wxStyledTextCtrl_VCHomeRectExtend, 3324).
--define(wxStyledTextCtrl_LineEndRectExtend, 3325).
--define(wxStyledTextCtrl_PageUpRectExtend, 3326).
--define(wxStyledTextCtrl_PageDownRectExtend, 3327).
--define(wxStyledTextCtrl_StutteredPageUp, 3328).
--define(wxStyledTextCtrl_StutteredPageUpExtend, 3329).
--define(wxStyledTextCtrl_StutteredPageDown, 3330).
--define(wxStyledTextCtrl_StutteredPageDownExtend, 3331).
--define(wxStyledTextCtrl_WordLeftEnd, 3332).
--define(wxStyledTextCtrl_WordLeftEndExtend, 3333).
--define(wxStyledTextCtrl_WordRightEnd, 3334).
--define(wxStyledTextCtrl_WordRightEndExtend, 3335).
--define(wxStyledTextCtrl_SetWhitespaceChars, 3336).
--define(wxStyledTextCtrl_SetCharsDefault, 3337).
--define(wxStyledTextCtrl_AutoCompGetCurrent, 3338).
--define(wxStyledTextCtrl_Allocate, 3339).
--define(wxStyledTextCtrl_FindColumn, 3340).
--define(wxStyledTextCtrl_GetCaretSticky, 3341).
--define(wxStyledTextCtrl_SetCaretSticky, 3342).
--define(wxStyledTextCtrl_ToggleCaretSticky, 3343).
--define(wxStyledTextCtrl_SetPasteConvertEndings, 3344).
--define(wxStyledTextCtrl_GetPasteConvertEndings, 3345).
--define(wxStyledTextCtrl_SelectionDuplicate, 3346).
--define(wxStyledTextCtrl_SetCaretLineBackAlpha, 3347).
--define(wxStyledTextCtrl_GetCaretLineBackAlpha, 3348).
--define(wxStyledTextCtrl_StartRecord, 3349).
--define(wxStyledTextCtrl_StopRecord, 3350).
--define(wxStyledTextCtrl_SetLexer, 3351).
--define(wxStyledTextCtrl_GetLexer, 3352).
--define(wxStyledTextCtrl_Colourise, 3353).
--define(wxStyledTextCtrl_SetProperty, 3354).
--define(wxStyledTextCtrl_SetKeyWords, 3355).
--define(wxStyledTextCtrl_SetLexerLanguage, 3356).
--define(wxStyledTextCtrl_GetProperty, 3357).
--define(wxStyledTextCtrl_GetStyleBitsNeeded, 3358).
--define(wxStyledTextCtrl_GetCurrentLine, 3359).
--define(wxStyledTextCtrl_StyleSetSpec, 3360).
--define(wxStyledTextCtrl_StyleSetFont, 3361).
--define(wxStyledTextCtrl_StyleSetFontAttr, 3362).
--define(wxStyledTextCtrl_StyleSetCharacterSet, 3363).
--define(wxStyledTextCtrl_StyleSetFontEncoding, 3364).
--define(wxStyledTextCtrl_CmdKeyExecute, 3365).
--define(wxStyledTextCtrl_SetMargins, 3366).
--define(wxStyledTextCtrl_GetSelection, 3367).
--define(wxStyledTextCtrl_PointFromPosition, 3368).
--define(wxStyledTextCtrl_ScrollToLine, 3369).
--define(wxStyledTextCtrl_ScrollToColumn, 3370).
--define(wxStyledTextCtrl_SendMsg, 3371).
--define(wxStyledTextCtrl_SetVScrollBar, 3372).
--define(wxStyledTextCtrl_SetHScrollBar, 3373).
--define(wxStyledTextCtrl_GetLastKeydownProcessed, 3374).
--define(wxStyledTextCtrl_SetLastKeydownProcessed, 3375).
--define(wxStyledTextCtrl_SaveFile, 3376).
--define(wxStyledTextCtrl_LoadFile, 3377).
--define(wxStyledTextCtrl_DoDragOver, 3378).
--define(wxStyledTextCtrl_DoDropText, 3379).
--define(wxStyledTextCtrl_GetUseAntiAliasing, 3380).
--define(wxStyledTextCtrl_AddTextRaw, 3381).
--define(wxStyledTextCtrl_InsertTextRaw, 3382).
--define(wxStyledTextCtrl_GetCurLineRaw, 3383).
--define(wxStyledTextCtrl_GetLineRaw, 3384).
--define(wxStyledTextCtrl_GetSelectedTextRaw, 3385).
--define(wxStyledTextCtrl_GetTextRangeRaw, 3386).
--define(wxStyledTextCtrl_SetTextRaw, 3387).
--define(wxStyledTextCtrl_GetTextRaw, 3388).
--define(wxStyledTextCtrl_AppendTextRaw, 3389).
--define(wxArtProvider_GetBitmap, 3390).
--define(wxArtProvider_GetIcon, 3391).
--define(wxTreeEvent_GetKeyCode, 3392).
--define(wxTreeEvent_GetItem, 3393).
--define(wxTreeEvent_GetKeyEvent, 3394).
--define(wxTreeEvent_GetLabel, 3395).
--define(wxTreeEvent_GetOldItem, 3396).
--define(wxTreeEvent_GetPoint, 3397).
--define(wxTreeEvent_IsEditCancelled, 3398).
--define(wxTreeEvent_SetToolTip, 3399).
--define(wxNotebookEvent_GetOldSelection, 3400).
--define(wxNotebookEvent_GetSelection, 3401).
--define(wxNotebookEvent_SetOldSelection, 3402).
--define(wxNotebookEvent_SetSelection, 3403).
--define(wxFileDataObject_new, 3404).
--define(wxFileDataObject_AddFile, 3405).
--define(wxFileDataObject_GetFilenames, 3406).
--define(wxFileDataObject_destroy, 3407).
--define(wxTextDataObject_new, 3408).
--define(wxTextDataObject_GetTextLength, 3409).
--define(wxTextDataObject_GetText, 3410).
--define(wxTextDataObject_SetText, 3411).
--define(wxTextDataObject_destroy, 3412).
--define(wxBitmapDataObject_new_1_1, 3413).
--define(wxBitmapDataObject_new_1_0, 3414).
--define(wxBitmapDataObject_GetBitmap, 3415).
--define(wxBitmapDataObject_SetBitmap, 3416).
--define(wxBitmapDataObject_destroy, 3417).
--define(wxClipboard_new, 3419).
--define(wxClipboard_destruct, 3420).
--define(wxClipboard_AddData, 3421).
--define(wxClipboard_Clear, 3422).
--define(wxClipboard_Close, 3423).
--define(wxClipboard_Flush, 3424).
--define(wxClipboard_GetData, 3425).
--define(wxClipboard_IsOpened, 3426).
--define(wxClipboard_Open, 3427).
--define(wxClipboard_SetData, 3428).
--define(wxClipboard_UsePrimarySelection, 3430).
--define(wxClipboard_IsSupported, 3431).
--define(wxClipboard_Get, 3432).
--define(wxSpinEvent_GetPosition, 3433).
--define(wxSpinEvent_SetPosition, 3434).
--define(wxSplitterWindow_new_0, 3435).
--define(wxSplitterWindow_new_2, 3436).
--define(wxSplitterWindow_destruct, 3437).
--define(wxSplitterWindow_Create, 3438).
--define(wxSplitterWindow_GetMinimumPaneSize, 3439).
--define(wxSplitterWindow_GetSashGravity, 3440).
--define(wxSplitterWindow_GetSashPosition, 3441).
--define(wxSplitterWindow_GetSplitMode, 3442).
--define(wxSplitterWindow_GetWindow1, 3443).
--define(wxSplitterWindow_GetWindow2, 3444).
--define(wxSplitterWindow_Initialize, 3445).
--define(wxSplitterWindow_IsSplit, 3446).
--define(wxSplitterWindow_ReplaceWindow, 3447).
--define(wxSplitterWindow_SetSashGravity, 3448).
--define(wxSplitterWindow_SetSashPosition, 3449).
--define(wxSplitterWindow_SetSashSize, 3450).
--define(wxSplitterWindow_SetMinimumPaneSize, 3451).
--define(wxSplitterWindow_SetSplitMode, 3452).
--define(wxSplitterWindow_SplitHorizontally, 3453).
--define(wxSplitterWindow_SplitVertically, 3454).
--define(wxSplitterWindow_Unsplit, 3455).
--define(wxSplitterWindow_UpdateSize, 3456).
--define(wxSplitterEvent_GetSashPosition, 3457).
--define(wxSplitterEvent_GetX, 3458).
--define(wxSplitterEvent_GetY, 3459).
--define(wxSplitterEvent_GetWindowBeingRemoved, 3460).
--define(wxSplitterEvent_SetSashPosition, 3461).
--define(wxHtmlWindow_new_0, 3462).
--define(wxHtmlWindow_new_2, 3463).
--define(wxHtmlWindow_AppendToPage, 3464).
--define(wxHtmlWindow_GetOpenedAnchor, 3465).
--define(wxHtmlWindow_GetOpenedPage, 3466).
--define(wxHtmlWindow_GetOpenedPageTitle, 3467).
--define(wxHtmlWindow_GetRelatedFrame, 3468).
--define(wxHtmlWindow_HistoryBack, 3469).
--define(wxHtmlWindow_HistoryCanBack, 3470).
--define(wxHtmlWindow_HistoryCanForward, 3471).
--define(wxHtmlWindow_HistoryClear, 3472).
--define(wxHtmlWindow_HistoryForward, 3473).
--define(wxHtmlWindow_LoadFile, 3474).
--define(wxHtmlWindow_LoadPage, 3475).
--define(wxHtmlWindow_SelectAll, 3476).
--define(wxHtmlWindow_SelectionToText, 3477).
--define(wxHtmlWindow_SelectLine, 3478).
--define(wxHtmlWindow_SelectWord, 3479).
--define(wxHtmlWindow_SetBorders, 3480).
--define(wxHtmlWindow_SetFonts, 3481).
--define(wxHtmlWindow_SetPage, 3482).
--define(wxHtmlWindow_SetRelatedFrame, 3483).
--define(wxHtmlWindow_SetRelatedStatusBar, 3484).
--define(wxHtmlWindow_ToText, 3485).
--define(wxHtmlWindow_destroy, 3486).
--define(wxHtmlLinkEvent_GetLinkInfo, 3487).
--define(wxSystemSettings_GetColour, 3488).
--define(wxSystemSettings_GetFont, 3489).
--define(wxSystemSettings_GetMetric, 3490).
--define(wxSystemSettings_GetScreenType, 3491).
--define(wxSystemOptions_GetOption, 3492).
--define(wxSystemOptions_GetOptionInt, 3493).
--define(wxSystemOptions_HasOption, 3494).
--define(wxSystemOptions_IsFalse, 3495).
--define(wxSystemOptions_SetOption_2_1, 3496).
--define(wxSystemOptions_SetOption_2_0, 3497).
--define(wxAuiNotebookEvent_SetSelection, 3498).
--define(wxAuiNotebookEvent_GetSelection, 3499).
--define(wxAuiNotebookEvent_SetOldSelection, 3500).
--define(wxAuiNotebookEvent_GetOldSelection, 3501).
--define(wxAuiNotebookEvent_SetDragSource, 3502).
--define(wxAuiNotebookEvent_GetDragSource, 3503).
--define(wxAuiManagerEvent_SetManager, 3504).
--define(wxAuiManagerEvent_GetManager, 3505).
--define(wxAuiManagerEvent_SetPane, 3506).
--define(wxAuiManagerEvent_GetPane, 3507).
--define(wxAuiManagerEvent_SetButton, 3508).
--define(wxAuiManagerEvent_GetButton, 3509).
--define(wxAuiManagerEvent_SetDC, 3510).
--define(wxAuiManagerEvent_GetDC, 3511).
--define(wxAuiManagerEvent_Veto, 3512).
--define(wxAuiManagerEvent_GetVeto, 3513).
--define(wxAuiManagerEvent_SetCanVeto, 3514).
--define(wxAuiManagerEvent_CanVeto, 3515).
--define(wxLogNull_new, 3516).
--define(wxLogNull_destroy, 3517).
+-define(wxDC_GetFont, 667).
+-define(wxDC_GetLayoutDirection, 668).
+-define(wxDC_GetLogicalFunction, 669).
+-define(wxDC_GetMapMode, 670).
+-define(wxDC_GetMultiLineTextExtent_4, 671).
+-define(wxDC_GetMultiLineTextExtent_1, 672).
+-define(wxDC_GetPartialTextExtents, 673).
+-define(wxDC_GetPen, 674).
+-define(wxDC_GetPixel, 675).
+-define(wxDC_GetPPI, 676).
+-define(wxDC_GetSize, 678).
+-define(wxDC_GetSizeMM, 680).
+-define(wxDC_GetTextBackground, 681).
+-define(wxDC_GetTextExtent_4, 682).
+-define(wxDC_GetTextExtent_1, 683).
+-define(wxDC_GetTextForeground, 685).
+-define(wxDC_GetUserScale, 686).
+-define(wxDC_GradientFillConcentric_3, 687).
+-define(wxDC_GradientFillConcentric_4, 688).
+-define(wxDC_GradientFillLinear, 689).
+-define(wxDC_LogicalToDeviceX, 690).
+-define(wxDC_LogicalToDeviceXRel, 691).
+-define(wxDC_LogicalToDeviceY, 692).
+-define(wxDC_LogicalToDeviceYRel, 693).
+-define(wxDC_MaxX, 694).
+-define(wxDC_MaxY, 695).
+-define(wxDC_MinX, 696).
+-define(wxDC_MinY, 697).
+-define(wxDC_IsOk, 698).
+-define(wxDC_ResetBoundingBox, 699).
+-define(wxDC_SetAxisOrientation, 700).
+-define(wxDC_SetBackground, 701).
+-define(wxDC_SetBackgroundMode, 702).
+-define(wxDC_SetBrush, 703).
+-define(wxDC_SetClippingRegion_2, 705).
+-define(wxDC_SetClippingRegion_1_1, 706).
+-define(wxDC_SetClippingRegion_1_0, 707).
+-define(wxDC_SetDeviceOrigin, 708).
+-define(wxDC_SetFont, 709).
+-define(wxDC_SetLayoutDirection, 710).
+-define(wxDC_SetLogicalFunction, 711).
+-define(wxDC_SetMapMode, 712).
+-define(wxDC_SetPalette, 713).
+-define(wxDC_SetPen, 714).
+-define(wxDC_SetTextBackground, 715).
+-define(wxDC_SetTextForeground, 716).
+-define(wxDC_SetUserScale, 717).
+-define(wxDC_StartDoc, 718).
+-define(wxDC_StartPage, 719).
+-define(wxMirrorDC_new, 720).
+-define(wxMirrorDC_destroy, 721).
+-define(wxScreenDC_new, 722).
+-define(wxScreenDC_destruct, 723).
+-define(wxPostScriptDC_new_0, 724).
+-define(wxPostScriptDC_new_1, 725).
+-define(wxPostScriptDC_destruct, 726).
+-define(wxPostScriptDC_SetResolution, 727).
+-define(wxPostScriptDC_GetResolution, 728).
+-define(wxWindowDC_new_0, 729).
+-define(wxWindowDC_new_1, 730).
+-define(wxWindowDC_destruct, 731).
+-define(wxClientDC_new_0, 732).
+-define(wxClientDC_new_1, 733).
+-define(wxClientDC_destroy, 734).
+-define(wxPaintDC_new_0, 735).
+-define(wxPaintDC_new_1, 736).
+-define(wxPaintDC_destroy, 737).
+-define(wxMemoryDC_new_1_0, 739).
+-define(wxMemoryDC_new_1_1, 740).
+-define(wxMemoryDC_new_0, 741).
+-define(wxMemoryDC_destruct, 743).
+-define(wxMemoryDC_SelectObject, 744).
+-define(wxMemoryDC_SelectObjectAsSource, 745).
+-define(wxBufferedDC_new_0, 746).
+-define(wxBufferedDC_new_2, 747).
+-define(wxBufferedDC_new_3, 748).
+-define(wxBufferedDC_destruct, 749).
+-define(wxBufferedDC_Init_2, 750).
+-define(wxBufferedDC_Init_3, 751).
+-define(wxBufferedPaintDC_new_3, 752).
+-define(wxBufferedPaintDC_new_2, 753).
+-define(wxBufferedPaintDC_destruct, 754).
+-define(wxGraphicsObject_destruct, 755).
+-define(wxGraphicsObject_GetRenderer, 756).
+-define(wxGraphicsObject_IsNull, 757).
+-define(wxGraphicsContext_destruct, 758).
+-define(wxGraphicsContext_Create_1_1, 759).
+-define(wxGraphicsContext_Create_1_0, 760).
+-define(wxGraphicsContext_Create_0, 761).
+-define(wxGraphicsContext_CreatePen, 762).
+-define(wxGraphicsContext_CreateBrush, 763).
+-define(wxGraphicsContext_CreateRadialGradientBrush, 764).
+-define(wxGraphicsContext_CreateLinearGradientBrush, 765).
+-define(wxGraphicsContext_CreateFont, 766).
+-define(wxGraphicsContext_CreateMatrix, 767).
+-define(wxGraphicsContext_CreatePath, 768).
+-define(wxGraphicsContext_Clip_1, 769).
+-define(wxGraphicsContext_Clip_4, 770).
+-define(wxGraphicsContext_ResetClip, 771).
+-define(wxGraphicsContext_DrawBitmap, 772).
+-define(wxGraphicsContext_DrawEllipse, 773).
+-define(wxGraphicsContext_DrawIcon, 774).
+-define(wxGraphicsContext_DrawLines, 775).
+-define(wxGraphicsContext_DrawPath, 776).
+-define(wxGraphicsContext_DrawRectangle, 777).
+-define(wxGraphicsContext_DrawRoundedRectangle, 778).
+-define(wxGraphicsContext_DrawText_3, 779).
+-define(wxGraphicsContext_DrawText_4_0, 780).
+-define(wxGraphicsContext_DrawText_4_1, 781).
+-define(wxGraphicsContext_DrawText_5, 782).
+-define(wxGraphicsContext_FillPath, 783).
+-define(wxGraphicsContext_StrokePath, 784).
+-define(wxGraphicsContext_GetPartialTextExtents, 785).
+-define(wxGraphicsContext_GetTextExtent, 786).
+-define(wxGraphicsContext_Rotate, 787).
+-define(wxGraphicsContext_Scale, 788).
+-define(wxGraphicsContext_Translate, 789).
+-define(wxGraphicsContext_GetTransform, 790).
+-define(wxGraphicsContext_SetTransform, 791).
+-define(wxGraphicsContext_ConcatTransform, 792).
+-define(wxGraphicsContext_SetBrush_1_1, 793).
+-define(wxGraphicsContext_SetBrush_1_0, 794).
+-define(wxGraphicsContext_SetFont_1, 795).
+-define(wxGraphicsContext_SetFont_2, 796).
+-define(wxGraphicsContext_SetPen_1_0, 797).
+-define(wxGraphicsContext_SetPen_1_1, 798).
+-define(wxGraphicsContext_StrokeLine, 799).
+-define(wxGraphicsContext_StrokeLines, 800).
+-define(wxGraphicsMatrix_Concat, 802).
+-define(wxGraphicsMatrix_Get, 804).
+-define(wxGraphicsMatrix_Invert, 805).
+-define(wxGraphicsMatrix_IsEqual, 806).
+-define(wxGraphicsMatrix_IsIdentity, 808).
+-define(wxGraphicsMatrix_Rotate, 809).
+-define(wxGraphicsMatrix_Scale, 810).
+-define(wxGraphicsMatrix_Translate, 811).
+-define(wxGraphicsMatrix_Set, 812).
+-define(wxGraphicsMatrix_TransformPoint, 813).
+-define(wxGraphicsMatrix_TransformDistance, 814).
+-define(wxGraphicsPath_MoveToPoint_2, 815).
+-define(wxGraphicsPath_MoveToPoint_1, 816).
+-define(wxGraphicsPath_AddArc_6, 817).
+-define(wxGraphicsPath_AddArc_5, 818).
+-define(wxGraphicsPath_AddArcToPoint, 819).
+-define(wxGraphicsPath_AddCircle, 820).
+-define(wxGraphicsPath_AddCurveToPoint_6, 821).
+-define(wxGraphicsPath_AddCurveToPoint_3, 822).
+-define(wxGraphicsPath_AddEllipse, 823).
+-define(wxGraphicsPath_AddLineToPoint_2, 824).
+-define(wxGraphicsPath_AddLineToPoint_1, 825).
+-define(wxGraphicsPath_AddPath, 826).
+-define(wxGraphicsPath_AddQuadCurveToPoint, 827).
+-define(wxGraphicsPath_AddRectangle, 828).
+-define(wxGraphicsPath_AddRoundedRectangle, 829).
+-define(wxGraphicsPath_CloseSubpath, 830).
+-define(wxGraphicsPath_Contains_3, 831).
+-define(wxGraphicsPath_Contains_2, 832).
+-define(wxGraphicsPath_GetBox, 834).
+-define(wxGraphicsPath_GetCurrentPoint, 836).
+-define(wxGraphicsPath_Transform, 837).
+-define(wxGraphicsRenderer_GetDefaultRenderer, 838).
+-define(wxGraphicsRenderer_CreateContext_1_1, 839).
+-define(wxGraphicsRenderer_CreateContext_1_0, 840).
+-define(wxGraphicsRenderer_CreatePen, 841).
+-define(wxGraphicsRenderer_CreateBrush, 842).
+-define(wxGraphicsRenderer_CreateLinearGradientBrush, 843).
+-define(wxGraphicsRenderer_CreateRadialGradientBrush, 844).
+-define(wxGraphicsRenderer_CreateFont, 845).
+-define(wxGraphicsRenderer_CreateMatrix, 846).
+-define(wxGraphicsRenderer_CreatePath, 847).
+-define(wxMenuBar_new_1, 849).
+-define(wxMenuBar_new_0, 851).
+-define(wxMenuBar_destruct, 853).
+-define(wxMenuBar_Append, 854).
+-define(wxMenuBar_Check, 855).
+-define(wxMenuBar_Enable_2, 856).
+-define(wxMenuBar_Enable_1, 857).
+-define(wxMenuBar_EnableTop, 858).
+-define(wxMenuBar_FindMenu, 859).
+-define(wxMenuBar_FindMenuItem, 860).
+-define(wxMenuBar_FindItem, 861).
+-define(wxMenuBar_GetHelpString, 862).
+-define(wxMenuBar_GetLabel_1, 863).
+-define(wxMenuBar_GetLabel_0, 864).
+-define(wxMenuBar_GetLabelTop, 865).
+-define(wxMenuBar_GetMenu, 866).
+-define(wxMenuBar_GetMenuCount, 867).
+-define(wxMenuBar_Insert, 868).
+-define(wxMenuBar_IsChecked, 869).
+-define(wxMenuBar_IsEnabled_1, 870).
+-define(wxMenuBar_IsEnabled_0, 871).
+-define(wxMenuBar_Remove, 872).
+-define(wxMenuBar_Replace, 873).
+-define(wxMenuBar_SetHelpString, 874).
+-define(wxMenuBar_SetLabel_2, 875).
+-define(wxMenuBar_SetLabel_1, 876).
+-define(wxMenuBar_SetLabelTop, 877).
+-define(wxControl_GetLabel, 878).
+-define(wxControl_SetLabel, 879).
+-define(wxControlWithItems_Append_1, 880).
+-define(wxControlWithItems_Append_2, 881).
+-define(wxControlWithItems_appendStrings_1, 882).
+-define(wxControlWithItems_Clear, 883).
+-define(wxControlWithItems_Delete, 884).
+-define(wxControlWithItems_FindString, 885).
+-define(wxControlWithItems_getClientData, 886).
+-define(wxControlWithItems_setClientData, 887).
+-define(wxControlWithItems_GetCount, 888).
+-define(wxControlWithItems_GetSelection, 889).
+-define(wxControlWithItems_GetString, 890).
+-define(wxControlWithItems_GetStringSelection, 891).
+-define(wxControlWithItems_Insert_2, 892).
+-define(wxControlWithItems_Insert_3, 893).
+-define(wxControlWithItems_IsEmpty, 894).
+-define(wxControlWithItems_Select, 895).
+-define(wxControlWithItems_SetSelection, 896).
+-define(wxControlWithItems_SetString, 897).
+-define(wxControlWithItems_SetStringSelection, 898).
+-define(wxMenu_new_2, 901).
+-define(wxMenu_new_1, 902).
+-define(wxMenu_destruct, 904).
+-define(wxMenu_Append_3, 905).
+-define(wxMenu_Append_1, 906).
+-define(wxMenu_Append_4_0, 907).
+-define(wxMenu_Append_4_1, 908).
+-define(wxMenu_AppendCheckItem, 909).
+-define(wxMenu_AppendRadioItem, 910).
+-define(wxMenu_AppendSeparator, 911).
+-define(wxMenu_Break, 912).
+-define(wxMenu_Check, 913).
+-define(wxMenu_Delete_1_0, 914).
+-define(wxMenu_Delete_1_1, 915).
+-define(wxMenu_Destroy_1_0, 916).
+-define(wxMenu_Destroy_1_1, 917).
+-define(wxMenu_Enable, 918).
+-define(wxMenu_FindItem_1, 919).
+-define(wxMenu_FindItem_2, 920).
+-define(wxMenu_FindItemByPosition, 921).
+-define(wxMenu_GetHelpString, 922).
+-define(wxMenu_GetLabel, 923).
+-define(wxMenu_GetMenuItemCount, 924).
+-define(wxMenu_GetMenuItems, 925).
+-define(wxMenu_GetTitle, 927).
+-define(wxMenu_Insert_2, 928).
+-define(wxMenu_Insert_3, 929).
+-define(wxMenu_Insert_5_1, 930).
+-define(wxMenu_Insert_5_0, 931).
+-define(wxMenu_InsertCheckItem, 932).
+-define(wxMenu_InsertRadioItem, 933).
+-define(wxMenu_InsertSeparator, 934).
+-define(wxMenu_IsChecked, 935).
+-define(wxMenu_IsEnabled, 936).
+-define(wxMenu_Prepend_1, 937).
+-define(wxMenu_Prepend_2, 938).
+-define(wxMenu_Prepend_4_1, 939).
+-define(wxMenu_Prepend_4_0, 940).
+-define(wxMenu_PrependCheckItem, 941).
+-define(wxMenu_PrependRadioItem, 942).
+-define(wxMenu_PrependSeparator, 943).
+-define(wxMenu_Remove_1_0, 944).
+-define(wxMenu_Remove_1_1, 945).
+-define(wxMenu_SetHelpString, 946).
+-define(wxMenu_SetLabel, 947).
+-define(wxMenu_SetTitle, 948).
+-define(wxMenuItem_new, 949).
+-define(wxMenuItem_destruct, 951).
+-define(wxMenuItem_Check, 952).
+-define(wxMenuItem_Enable, 953).
+-define(wxMenuItem_GetBitmap, 954).
+-define(wxMenuItem_GetHelp, 955).
+-define(wxMenuItem_GetId, 956).
+-define(wxMenuItem_GetKind, 957).
+-define(wxMenuItem_GetLabel, 958).
+-define(wxMenuItem_GetLabelFromText, 959).
+-define(wxMenuItem_GetMenu, 960).
+-define(wxMenuItem_GetText, 961).
+-define(wxMenuItem_GetSubMenu, 962).
+-define(wxMenuItem_IsCheckable, 963).
+-define(wxMenuItem_IsChecked, 964).
+-define(wxMenuItem_IsEnabled, 965).
+-define(wxMenuItem_IsSeparator, 966).
+-define(wxMenuItem_IsSubMenu, 967).
+-define(wxMenuItem_SetBitmap, 968).
+-define(wxMenuItem_SetHelp, 969).
+-define(wxMenuItem_SetMenu, 970).
+-define(wxMenuItem_SetSubMenu, 971).
+-define(wxMenuItem_SetText, 972).
+-define(wxToolBar_AddControl, 973).
+-define(wxToolBar_AddSeparator, 974).
+-define(wxToolBar_AddTool_5, 975).
+-define(wxToolBar_AddTool_4_0, 976).
+-define(wxToolBar_AddTool_1, 977).
+-define(wxToolBar_AddTool_4_1, 978).
+-define(wxToolBar_AddTool_3, 979).
+-define(wxToolBar_AddTool_6, 980).
+-define(wxToolBar_AddCheckTool, 981).
+-define(wxToolBar_AddRadioTool, 982).
+-define(wxToolBar_DeleteTool, 983).
+-define(wxToolBar_DeleteToolByPos, 984).
+-define(wxToolBar_EnableTool, 985).
+-define(wxToolBar_FindById, 986).
+-define(wxToolBar_FindControl, 987).
+-define(wxToolBar_FindToolForPosition, 988).
+-define(wxToolBar_GetToolSize, 989).
+-define(wxToolBar_GetToolBitmapSize, 990).
+-define(wxToolBar_GetMargins, 991).
+-define(wxToolBar_GetToolEnabled, 992).
+-define(wxToolBar_GetToolLongHelp, 993).
+-define(wxToolBar_GetToolPacking, 994).
+-define(wxToolBar_GetToolPos, 995).
+-define(wxToolBar_GetToolSeparation, 996).
+-define(wxToolBar_GetToolShortHelp, 997).
+-define(wxToolBar_GetToolState, 998).
+-define(wxToolBar_InsertControl, 999).
+-define(wxToolBar_InsertSeparator, 1000).
+-define(wxToolBar_InsertTool_5, 1001).
+-define(wxToolBar_InsertTool_2, 1002).
+-define(wxToolBar_InsertTool_4, 1003).
+-define(wxToolBar_Realize, 1004).
+-define(wxToolBar_RemoveTool, 1005).
+-define(wxToolBar_SetMargins, 1006).
+-define(wxToolBar_SetToolBitmapSize, 1007).
+-define(wxToolBar_SetToolLongHelp, 1008).
+-define(wxToolBar_SetToolPacking, 1009).
+-define(wxToolBar_SetToolShortHelp, 1010).
+-define(wxToolBar_SetToolSeparation, 1011).
+-define(wxToolBar_ToggleTool, 1012).
+-define(wxStatusBar_new_0, 1014).
+-define(wxStatusBar_new_2, 1015).
+-define(wxStatusBar_destruct, 1017).
+-define(wxStatusBar_Create, 1018).
+-define(wxStatusBar_GetFieldRect, 1019).
+-define(wxStatusBar_GetFieldsCount, 1020).
+-define(wxStatusBar_GetStatusText, 1021).
+-define(wxStatusBar_PopStatusText, 1022).
+-define(wxStatusBar_PushStatusText, 1023).
+-define(wxStatusBar_SetFieldsCount, 1024).
+-define(wxStatusBar_SetMinHeight, 1025).
+-define(wxStatusBar_SetStatusText, 1026).
+-define(wxStatusBar_SetStatusWidths, 1027).
+-define(wxStatusBar_SetStatusStyles, 1028).
+-define(wxBitmap_new_0, 1029).
+-define(wxBitmap_new_3, 1030).
+-define(wxBitmap_new_4, 1031).
+-define(wxBitmap_new_2_0, 1032).
+-define(wxBitmap_new_2_1, 1033).
+-define(wxBitmap_destruct, 1034).
+-define(wxBitmap_ConvertToImage, 1035).
+-define(wxBitmap_CopyFromIcon, 1036).
+-define(wxBitmap_Create, 1037).
+-define(wxBitmap_GetDepth, 1038).
+-define(wxBitmap_GetHeight, 1039).
+-define(wxBitmap_GetPalette, 1040).
+-define(wxBitmap_GetMask, 1041).
+-define(wxBitmap_GetWidth, 1042).
+-define(wxBitmap_GetSubBitmap, 1043).
+-define(wxBitmap_LoadFile, 1044).
+-define(wxBitmap_Ok, 1045).
+-define(wxBitmap_SaveFile, 1046).
+-define(wxBitmap_SetDepth, 1047).
+-define(wxBitmap_SetHeight, 1048).
+-define(wxBitmap_SetMask, 1049).
+-define(wxBitmap_SetPalette, 1050).
+-define(wxBitmap_SetWidth, 1051).
+-define(wxIcon_new_0, 1052).
+-define(wxIcon_new_2, 1053).
+-define(wxIcon_new_1, 1054).
+-define(wxIcon_CopyFromBitmap, 1055).
+-define(wxIcon_destroy, 1056).
+-define(wxIconBundle_new_0, 1057).
+-define(wxIconBundle_new_2, 1058).
+-define(wxIconBundle_new_1_0, 1059).
+-define(wxIconBundle_new_1_1, 1060).
+-define(wxIconBundle_destruct, 1061).
+-define(wxIconBundle_AddIcon_2, 1062).
+-define(wxIconBundle_AddIcon_1, 1063).
+-define(wxIconBundle_GetIcon_1_1, 1064).
+-define(wxIconBundle_GetIcon_1_0, 1065).
+-define(wxCursor_new_0, 1066).
+-define(wxCursor_new_1_0, 1067).
+-define(wxCursor_new_1_1, 1068).
+-define(wxCursor_new_4, 1069).
+-define(wxCursor_destruct, 1070).
+-define(wxCursor_Ok, 1071).
+-define(wxMask_new_0, 1072).
+-define(wxMask_new_2_1, 1073).
+-define(wxMask_new_2_0, 1074).
+-define(wxMask_new_1, 1075).
+-define(wxMask_destruct, 1076).
+-define(wxMask_Create_2_1, 1077).
+-define(wxMask_Create_2_0, 1078).
+-define(wxMask_Create_1, 1079).
+-define(wxImage_new_0, 1080).
+-define(wxImage_new_3_0, 1081).
+-define(wxImage_new_4, 1082).
+-define(wxImage_new_5, 1083).
+-define(wxImage_new_2, 1084).
+-define(wxImage_new_3_1, 1085).
+-define(wxImage_Blur, 1086).
+-define(wxImage_BlurHorizontal, 1087).
+-define(wxImage_BlurVertical, 1088).
+-define(wxImage_ConvertAlphaToMask, 1089).
+-define(wxImage_ConvertToGreyscale, 1090).
+-define(wxImage_ConvertToMono, 1091).
+-define(wxImage_Copy, 1092).
+-define(wxImage_Create_3, 1093).
+-define(wxImage_Create_4, 1094).
+-define(wxImage_Create_5, 1095).
+-define(wxImage_Destroy, 1096).
+-define(wxImage_FindFirstUnusedColour, 1097).
+-define(wxImage_GetImageExtWildcard, 1098).
+-define(wxImage_GetAlpha_2, 1099).
+-define(wxImage_GetAlpha_0, 1100).
+-define(wxImage_GetBlue, 1101).
+-define(wxImage_GetData, 1102).
+-define(wxImage_GetGreen, 1103).
+-define(wxImage_GetImageCount, 1104).
+-define(wxImage_GetHeight, 1105).
+-define(wxImage_GetMaskBlue, 1106).
+-define(wxImage_GetMaskGreen, 1107).
+-define(wxImage_GetMaskRed, 1108).
+-define(wxImage_GetOrFindMaskColour, 1109).
+-define(wxImage_GetPalette, 1110).
+-define(wxImage_GetRed, 1111).
+-define(wxImage_GetSubImage, 1112).
+-define(wxImage_GetWidth, 1113).
+-define(wxImage_HasAlpha, 1114).
+-define(wxImage_HasMask, 1115).
+-define(wxImage_GetOption, 1116).
+-define(wxImage_GetOptionInt, 1117).
+-define(wxImage_HasOption, 1118).
+-define(wxImage_InitAlpha, 1119).
+-define(wxImage_InitStandardHandlers, 1120).
+-define(wxImage_IsTransparent, 1121).
+-define(wxImage_LoadFile_2, 1122).
+-define(wxImage_LoadFile_3, 1123).
+-define(wxImage_Ok, 1124).
+-define(wxImage_RemoveHandler, 1125).
+-define(wxImage_Mirror, 1126).
+-define(wxImage_Replace, 1127).
+-define(wxImage_Rescale, 1128).
+-define(wxImage_Resize, 1129).
+-define(wxImage_Rotate, 1130).
+-define(wxImage_RotateHue, 1131).
+-define(wxImage_Rotate90, 1132).
+-define(wxImage_SaveFile_1, 1133).
+-define(wxImage_SaveFile_2_0, 1134).
+-define(wxImage_SaveFile_2_1, 1135).
+-define(wxImage_Scale, 1136).
+-define(wxImage_Size, 1137).
+-define(wxImage_SetAlpha_3, 1138).
+-define(wxImage_SetAlpha_2, 1139).
+-define(wxImage_SetData_2, 1140).
+-define(wxImage_SetData_4, 1141).
+-define(wxImage_SetMask, 1142).
+-define(wxImage_SetMaskColour, 1143).
+-define(wxImage_SetMaskFromImage, 1144).
+-define(wxImage_SetOption_2_1, 1145).
+-define(wxImage_SetOption_2_0, 1146).
+-define(wxImage_SetPalette, 1147).
+-define(wxImage_SetRGB_5, 1148).
+-define(wxImage_SetRGB_4, 1149).
+-define(wxImage_destroy, 1150).
+-define(wxBrush_new_0, 1151).
+-define(wxBrush_new_2, 1152).
+-define(wxBrush_new_1, 1153).
+-define(wxBrush_destruct, 1155).
+-define(wxBrush_GetColour, 1156).
+-define(wxBrush_GetStipple, 1157).
+-define(wxBrush_GetStyle, 1158).
+-define(wxBrush_IsHatch, 1159).
+-define(wxBrush_IsOk, 1160).
+-define(wxBrush_SetColour_1, 1161).
+-define(wxBrush_SetColour_3, 1162).
+-define(wxBrush_SetStipple, 1163).
+-define(wxBrush_SetStyle, 1164).
+-define(wxPen_new_0, 1165).
+-define(wxPen_new_2, 1166).
+-define(wxPen_destruct, 1167).
+-define(wxPen_GetCap, 1168).
+-define(wxPen_GetColour, 1169).
+-define(wxPen_GetJoin, 1170).
+-define(wxPen_GetStyle, 1171).
+-define(wxPen_GetWidth, 1172).
+-define(wxPen_IsOk, 1173).
+-define(wxPen_SetCap, 1174).
+-define(wxPen_SetColour_1, 1175).
+-define(wxPen_SetColour_3, 1176).
+-define(wxPen_SetJoin, 1177).
+-define(wxPen_SetStyle, 1178).
+-define(wxPen_SetWidth, 1179).
+-define(wxRegion_new_0, 1180).
+-define(wxRegion_new_4, 1181).
+-define(wxRegion_new_2, 1182).
+-define(wxRegion_new_1_1, 1183).
+-define(wxRegion_new_1_0, 1185).
+-define(wxRegion_destruct, 1187).
+-define(wxRegion_Clear, 1188).
+-define(wxRegion_Contains_2, 1189).
+-define(wxRegion_Contains_1_0, 1190).
+-define(wxRegion_Contains_4, 1191).
+-define(wxRegion_Contains_1_1, 1192).
+-define(wxRegion_ConvertToBitmap, 1193).
+-define(wxRegion_GetBox, 1194).
+-define(wxRegion_Intersect_4, 1195).
+-define(wxRegion_Intersect_1_1, 1196).
+-define(wxRegion_Intersect_1_0, 1197).
+-define(wxRegion_IsEmpty, 1198).
+-define(wxRegion_Subtract_4, 1199).
+-define(wxRegion_Subtract_1_1, 1200).
+-define(wxRegion_Subtract_1_0, 1201).
+-define(wxRegion_Offset_2, 1202).
+-define(wxRegion_Offset_1, 1203).
+-define(wxRegion_Union_4, 1204).
+-define(wxRegion_Union_1_2, 1205).
+-define(wxRegion_Union_1_1, 1206).
+-define(wxRegion_Union_1_0, 1207).
+-define(wxRegion_Union_3, 1208).
+-define(wxRegion_Xor_4, 1209).
+-define(wxRegion_Xor_1_1, 1210).
+-define(wxRegion_Xor_1_0, 1211).
+-define(wxAcceleratorTable_new_0, 1212).
+-define(wxAcceleratorTable_new_2, 1213).
+-define(wxAcceleratorTable_destruct, 1214).
+-define(wxAcceleratorTable_Ok, 1215).
+-define(wxAcceleratorEntry_new_1_0, 1216).
+-define(wxAcceleratorEntry_new_1_1, 1217).
+-define(wxAcceleratorEntry_GetCommand, 1218).
+-define(wxAcceleratorEntry_GetFlags, 1219).
+-define(wxAcceleratorEntry_GetKeyCode, 1220).
+-define(wxAcceleratorEntry_Set, 1221).
+-define(wxAcceleratorEntry_destroy, 1222).
+-define(wxCaret_new_3, 1227).
+-define(wxCaret_new_2, 1228).
+-define(wxCaret_destruct, 1230).
+-define(wxCaret_Create_3, 1231).
+-define(wxCaret_Create_2, 1232).
+-define(wxCaret_GetBlinkTime, 1233).
+-define(wxCaret_GetPosition, 1235).
+-define(wxCaret_GetSize, 1237).
+-define(wxCaret_GetWindow, 1238).
+-define(wxCaret_Hide, 1239).
+-define(wxCaret_IsOk, 1240).
+-define(wxCaret_IsVisible, 1241).
+-define(wxCaret_Move_2, 1242).
+-define(wxCaret_Move_1, 1243).
+-define(wxCaret_SetBlinkTime, 1244).
+-define(wxCaret_SetSize_2, 1245).
+-define(wxCaret_SetSize_1, 1246).
+-define(wxCaret_Show, 1247).
+-define(wxSizer_Add_2_1, 1248).
+-define(wxSizer_Add_2_0, 1249).
+-define(wxSizer_Add_3, 1250).
+-define(wxSizer_Add_2_3, 1251).
+-define(wxSizer_Add_2_2, 1252).
+-define(wxSizer_AddSpacer, 1253).
+-define(wxSizer_AddStretchSpacer, 1254).
+-define(wxSizer_CalcMin, 1255).
+-define(wxSizer_Clear, 1256).
+-define(wxSizer_Detach_1_2, 1257).
+-define(wxSizer_Detach_1_1, 1258).
+-define(wxSizer_Detach_1_0, 1259).
+-define(wxSizer_Fit, 1260).
+-define(wxSizer_FitInside, 1261).
+-define(wxSizer_GetChildren, 1262).
+-define(wxSizer_GetItem_2_1, 1263).
+-define(wxSizer_GetItem_2_0, 1264).
+-define(wxSizer_GetItem_1, 1265).
+-define(wxSizer_GetSize, 1266).
+-define(wxSizer_GetPosition, 1267).
+-define(wxSizer_GetMinSize, 1268).
+-define(wxSizer_Hide_2_0, 1269).
+-define(wxSizer_Hide_2_1, 1270).
+-define(wxSizer_Hide_1, 1271).
+-define(wxSizer_Insert_3_1, 1272).
+-define(wxSizer_Insert_3_0, 1273).
+-define(wxSizer_Insert_4, 1274).
+-define(wxSizer_Insert_3_3, 1275).
+-define(wxSizer_Insert_3_2, 1276).
+-define(wxSizer_Insert_2, 1277).
+-define(wxSizer_InsertSpacer, 1278).
+-define(wxSizer_InsertStretchSpacer, 1279).
+-define(wxSizer_IsShown_1_2, 1280).
+-define(wxSizer_IsShown_1_1, 1281).
+-define(wxSizer_IsShown_1_0, 1282).
+-define(wxSizer_Layout, 1283).
+-define(wxSizer_Prepend_2_1, 1284).
+-define(wxSizer_Prepend_2_0, 1285).
+-define(wxSizer_Prepend_3, 1286).
+-define(wxSizer_Prepend_2_3, 1287).
+-define(wxSizer_Prepend_2_2, 1288).
+-define(wxSizer_Prepend_1, 1289).
+-define(wxSizer_PrependSpacer, 1290).
+-define(wxSizer_PrependStretchSpacer, 1291).
+-define(wxSizer_RecalcSizes, 1292).
+-define(wxSizer_Remove_1_1, 1293).
+-define(wxSizer_Remove_1_0, 1294).
+-define(wxSizer_Replace_3_1, 1295).
+-define(wxSizer_Replace_3_0, 1296).
+-define(wxSizer_Replace_2, 1297).
+-define(wxSizer_SetDimension, 1298).
+-define(wxSizer_SetMinSize_2, 1299).
+-define(wxSizer_SetMinSize_1, 1300).
+-define(wxSizer_SetItemMinSize_3_2, 1301).
+-define(wxSizer_SetItemMinSize_2_2, 1302).
+-define(wxSizer_SetItemMinSize_3_1, 1303).
+-define(wxSizer_SetItemMinSize_2_1, 1304).
+-define(wxSizer_SetItemMinSize_3_0, 1305).
+-define(wxSizer_SetItemMinSize_2_0, 1306).
+-define(wxSizer_SetSizeHints, 1307).
+-define(wxSizer_SetVirtualSizeHints, 1308).
+-define(wxSizer_Show_2_2, 1309).
+-define(wxSizer_Show_2_1, 1310).
+-define(wxSizer_Show_2_0, 1311).
+-define(wxSizer_Show_1, 1312).
+-define(wxSizerFlags_new, 1313).
+-define(wxSizerFlags_Align, 1314).
+-define(wxSizerFlags_Border_2, 1315).
+-define(wxSizerFlags_Border_1, 1316).
+-define(wxSizerFlags_Center, 1317).
+-define(wxSizerFlags_Centre, 1318).
+-define(wxSizerFlags_Expand, 1319).
+-define(wxSizerFlags_Left, 1320).
+-define(wxSizerFlags_Proportion, 1321).
+-define(wxSizerFlags_Right, 1322).
+-define(wxSizerFlags_destroy, 1323).
+-define(wxSizerItem_new_5_1, 1324).
+-define(wxSizerItem_new_2_1, 1325).
+-define(wxSizerItem_new_5_0, 1326).
+-define(wxSizerItem_new_2_0, 1327).
+-define(wxSizerItem_new_6, 1328).
+-define(wxSizerItem_new_3, 1329).
+-define(wxSizerItem_new_0, 1330).
+-define(wxSizerItem_destruct, 1331).
+-define(wxSizerItem_CalcMin, 1332).
+-define(wxSizerItem_DeleteWindows, 1333).
+-define(wxSizerItem_DetachSizer, 1334).
+-define(wxSizerItem_GetBorder, 1335).
+-define(wxSizerItem_GetFlag, 1336).
+-define(wxSizerItem_GetMinSize, 1337).
+-define(wxSizerItem_GetPosition, 1338).
+-define(wxSizerItem_GetProportion, 1339).
+-define(wxSizerItem_GetRatio, 1340).
+-define(wxSizerItem_GetRect, 1341).
+-define(wxSizerItem_GetSize, 1342).
+-define(wxSizerItem_GetSizer, 1343).
+-define(wxSizerItem_GetSpacer, 1344).
+-define(wxSizerItem_GetUserData, 1345).
+-define(wxSizerItem_GetWindow, 1346).
+-define(wxSizerItem_IsSizer, 1347).
+-define(wxSizerItem_IsShown, 1348).
+-define(wxSizerItem_IsSpacer, 1349).
+-define(wxSizerItem_IsWindow, 1350).
+-define(wxSizerItem_SetBorder, 1351).
+-define(wxSizerItem_SetDimension, 1352).
+-define(wxSizerItem_SetFlag, 1353).
+-define(wxSizerItem_SetInitSize, 1354).
+-define(wxSizerItem_SetMinSize_1, 1355).
+-define(wxSizerItem_SetMinSize_2, 1356).
+-define(wxSizerItem_SetProportion, 1357).
+-define(wxSizerItem_SetRatio_2, 1358).
+-define(wxSizerItem_SetRatio_1_1, 1359).
+-define(wxSizerItem_SetRatio_1_0, 1360).
+-define(wxSizerItem_SetSizer, 1361).
+-define(wxSizerItem_SetSpacer_1, 1362).
+-define(wxSizerItem_SetSpacer_2, 1363).
+-define(wxSizerItem_SetWindow, 1364).
+-define(wxSizerItem_Show, 1365).
+-define(wxBoxSizer_new, 1366).
+-define(wxBoxSizer_GetOrientation, 1367).
+-define(wxBoxSizer_destroy, 1368).
+-define(wxStaticBoxSizer_new_2, 1369).
+-define(wxStaticBoxSizer_new_3, 1370).
+-define(wxStaticBoxSizer_GetStaticBox, 1371).
+-define(wxStaticBoxSizer_destroy, 1372).
+-define(wxGridSizer_new_4, 1373).
+-define(wxGridSizer_new_2, 1374).
+-define(wxGridSizer_GetCols, 1375).
+-define(wxGridSizer_GetHGap, 1376).
+-define(wxGridSizer_GetRows, 1377).
+-define(wxGridSizer_GetVGap, 1378).
+-define(wxGridSizer_SetCols, 1379).
+-define(wxGridSizer_SetHGap, 1380).
+-define(wxGridSizer_SetRows, 1381).
+-define(wxGridSizer_SetVGap, 1382).
+-define(wxGridSizer_destroy, 1383).
+-define(wxFlexGridSizer_new_4, 1384).
+-define(wxFlexGridSizer_new_2, 1385).
+-define(wxFlexGridSizer_AddGrowableCol, 1386).
+-define(wxFlexGridSizer_AddGrowableRow, 1387).
+-define(wxFlexGridSizer_GetFlexibleDirection, 1388).
+-define(wxFlexGridSizer_GetNonFlexibleGrowMode, 1389).
+-define(wxFlexGridSizer_RemoveGrowableCol, 1390).
+-define(wxFlexGridSizer_RemoveGrowableRow, 1391).
+-define(wxFlexGridSizer_SetFlexibleDirection, 1392).
+-define(wxFlexGridSizer_SetNonFlexibleGrowMode, 1393).
+-define(wxFlexGridSizer_destroy, 1394).
+-define(wxGridBagSizer_new, 1395).
+-define(wxGridBagSizer_Add_3_2, 1396).
+-define(wxGridBagSizer_Add_3_1, 1397).
+-define(wxGridBagSizer_Add_4, 1398).
+-define(wxGridBagSizer_Add_1_0, 1399).
+-define(wxGridBagSizer_Add_2_1, 1400).
+-define(wxGridBagSizer_Add_2_0, 1401).
+-define(wxGridBagSizer_Add_3_0, 1402).
+-define(wxGridBagSizer_Add_1_1, 1403).
+-define(wxGridBagSizer_CalcMin, 1404).
+-define(wxGridBagSizer_CheckForIntersection_2, 1405).
+-define(wxGridBagSizer_CheckForIntersection_3, 1406).
+-define(wxGridBagSizer_FindItem_1_1, 1407).
+-define(wxGridBagSizer_FindItem_1_0, 1408).
+-define(wxGridBagSizer_FindItemAtPoint, 1409).
+-define(wxGridBagSizer_FindItemAtPosition, 1410).
+-define(wxGridBagSizer_FindItemWithData, 1411).
+-define(wxGridBagSizer_GetCellSize, 1412).
+-define(wxGridBagSizer_GetEmptyCellSize, 1413).
+-define(wxGridBagSizer_GetItemPosition_1_2, 1414).
+-define(wxGridBagSizer_GetItemPosition_1_1, 1415).
+-define(wxGridBagSizer_GetItemPosition_1_0, 1416).
+-define(wxGridBagSizer_GetItemSpan_1_2, 1417).
+-define(wxGridBagSizer_GetItemSpan_1_1, 1418).
+-define(wxGridBagSizer_GetItemSpan_1_0, 1419).
+-define(wxGridBagSizer_SetEmptyCellSize, 1420).
+-define(wxGridBagSizer_SetItemPosition_2_2, 1421).
+-define(wxGridBagSizer_SetItemPosition_2_1, 1422).
+-define(wxGridBagSizer_SetItemPosition_2_0, 1423).
+-define(wxGridBagSizer_SetItemSpan_2_2, 1424).
+-define(wxGridBagSizer_SetItemSpan_2_1, 1425).
+-define(wxGridBagSizer_SetItemSpan_2_0, 1426).
+-define(wxGridBagSizer_destroy, 1427).
+-define(wxStdDialogButtonSizer_new, 1428).
+-define(wxStdDialogButtonSizer_AddButton, 1429).
+-define(wxStdDialogButtonSizer_Realize, 1430).
+-define(wxStdDialogButtonSizer_SetAffirmativeButton, 1431).
+-define(wxStdDialogButtonSizer_SetCancelButton, 1432).
+-define(wxStdDialogButtonSizer_SetNegativeButton, 1433).
+-define(wxStdDialogButtonSizer_destroy, 1434).
+-define(wxFont_new_0, 1435).
+-define(wxFont_new_1, 1436).
+-define(wxFont_new_5, 1437).
+-define(wxFont_destruct, 1439).
+-define(wxFont_IsFixedWidth, 1440).
+-define(wxFont_GetDefaultEncoding, 1441).
+-define(wxFont_GetFaceName, 1442).
+-define(wxFont_GetFamily, 1443).
+-define(wxFont_GetNativeFontInfoDesc, 1444).
+-define(wxFont_GetNativeFontInfoUserDesc, 1445).
+-define(wxFont_GetPointSize, 1446).
+-define(wxFont_GetStyle, 1447).
+-define(wxFont_GetUnderlined, 1448).
+-define(wxFont_GetWeight, 1449).
+-define(wxFont_Ok, 1450).
+-define(wxFont_SetDefaultEncoding, 1451).
+-define(wxFont_SetFaceName, 1452).
+-define(wxFont_SetFamily, 1453).
+-define(wxFont_SetPointSize, 1454).
+-define(wxFont_SetStyle, 1455).
+-define(wxFont_SetUnderlined, 1456).
+-define(wxFont_SetWeight, 1457).
+-define(wxToolTip_Enable, 1458).
+-define(wxToolTip_SetDelay, 1459).
+-define(wxToolTip_new, 1460).
+-define(wxToolTip_SetTip, 1461).
+-define(wxToolTip_GetTip, 1462).
+-define(wxToolTip_GetWindow, 1463).
+-define(wxToolTip_destroy, 1464).
+-define(wxButton_new_3, 1466).
+-define(wxButton_new_0, 1467).
+-define(wxButton_destruct, 1468).
+-define(wxButton_Create, 1469).
+-define(wxButton_GetDefaultSize, 1470).
+-define(wxButton_SetDefault, 1471).
+-define(wxButton_SetLabel, 1472).
+-define(wxBitmapButton_new_4, 1474).
+-define(wxBitmapButton_new_0, 1475).
+-define(wxBitmapButton_Create, 1476).
+-define(wxBitmapButton_GetBitmapDisabled, 1477).
+-define(wxBitmapButton_GetBitmapFocus, 1479).
+-define(wxBitmapButton_GetBitmapLabel, 1481).
+-define(wxBitmapButton_GetBitmapSelected, 1483).
+-define(wxBitmapButton_SetBitmapDisabled, 1485).
+-define(wxBitmapButton_SetBitmapFocus, 1486).
+-define(wxBitmapButton_SetBitmapLabel, 1487).
+-define(wxBitmapButton_SetBitmapSelected, 1488).
+-define(wxBitmapButton_destroy, 1489).
+-define(wxToggleButton_new_0, 1490).
+-define(wxToggleButton_new_4, 1491).
+-define(wxToggleButton_Create, 1492).
+-define(wxToggleButton_GetValue, 1493).
+-define(wxToggleButton_SetValue, 1494).
+-define(wxToggleButton_destroy, 1495).
+-define(wxCalendarCtrl_new_0, 1496).
+-define(wxCalendarCtrl_new_3, 1497).
+-define(wxCalendarCtrl_Create, 1498).
+-define(wxCalendarCtrl_destruct, 1499).
+-define(wxCalendarCtrl_SetDate, 1500).
+-define(wxCalendarCtrl_GetDate, 1501).
+-define(wxCalendarCtrl_EnableYearChange, 1502).
+-define(wxCalendarCtrl_EnableMonthChange, 1503).
+-define(wxCalendarCtrl_EnableHolidayDisplay, 1504).
+-define(wxCalendarCtrl_SetHeaderColours, 1505).
+-define(wxCalendarCtrl_GetHeaderColourFg, 1506).
+-define(wxCalendarCtrl_GetHeaderColourBg, 1507).
+-define(wxCalendarCtrl_SetHighlightColours, 1508).
+-define(wxCalendarCtrl_GetHighlightColourFg, 1509).
+-define(wxCalendarCtrl_GetHighlightColourBg, 1510).
+-define(wxCalendarCtrl_SetHolidayColours, 1511).
+-define(wxCalendarCtrl_GetHolidayColourFg, 1512).
+-define(wxCalendarCtrl_GetHolidayColourBg, 1513).
+-define(wxCalendarCtrl_GetAttr, 1514).
+-define(wxCalendarCtrl_SetAttr, 1515).
+-define(wxCalendarCtrl_SetHoliday, 1516).
+-define(wxCalendarCtrl_ResetAttr, 1517).
+-define(wxCalendarCtrl_HitTest, 1518).
+-define(wxCalendarDateAttr_new_0, 1519).
+-define(wxCalendarDateAttr_new_2_1, 1520).
+-define(wxCalendarDateAttr_new_2_0, 1521).
+-define(wxCalendarDateAttr_SetTextColour, 1522).
+-define(wxCalendarDateAttr_SetBackgroundColour, 1523).
+-define(wxCalendarDateAttr_SetBorderColour, 1524).
+-define(wxCalendarDateAttr_SetFont, 1525).
+-define(wxCalendarDateAttr_SetBorder, 1526).
+-define(wxCalendarDateAttr_SetHoliday, 1527).
+-define(wxCalendarDateAttr_HasTextColour, 1528).
+-define(wxCalendarDateAttr_HasBackgroundColour, 1529).
+-define(wxCalendarDateAttr_HasBorderColour, 1530).
+-define(wxCalendarDateAttr_HasFont, 1531).
+-define(wxCalendarDateAttr_HasBorder, 1532).
+-define(wxCalendarDateAttr_IsHoliday, 1533).
+-define(wxCalendarDateAttr_GetTextColour, 1534).
+-define(wxCalendarDateAttr_GetBackgroundColour, 1535).
+-define(wxCalendarDateAttr_GetBorderColour, 1536).
+-define(wxCalendarDateAttr_GetFont, 1537).
+-define(wxCalendarDateAttr_GetBorder, 1538).
+-define(wxCalendarDateAttr_destroy, 1539).
+-define(wxCheckBox_new_4, 1541).
+-define(wxCheckBox_new_0, 1542).
+-define(wxCheckBox_Create, 1543).
+-define(wxCheckBox_GetValue, 1544).
+-define(wxCheckBox_Get3StateValue, 1545).
+-define(wxCheckBox_Is3rdStateAllowedForUser, 1546).
+-define(wxCheckBox_Is3State, 1547).
+-define(wxCheckBox_IsChecked, 1548).
+-define(wxCheckBox_SetValue, 1549).
+-define(wxCheckBox_Set3StateValue, 1550).
+-define(wxCheckBox_destroy, 1551).
+-define(wxCheckListBox_new_0, 1552).
+-define(wxCheckListBox_new_3, 1554).
+-define(wxCheckListBox_Check, 1555).
+-define(wxCheckListBox_IsChecked, 1556).
+-define(wxCheckListBox_destroy, 1557).
+-define(wxChoice_new_3, 1560).
+-define(wxChoice_new_0, 1561).
+-define(wxChoice_destruct, 1563).
+-define(wxChoice_Create, 1565).
+-define(wxChoice_Delete, 1566).
+-define(wxChoice_GetColumns, 1567).
+-define(wxChoice_SetColumns, 1568).
+-define(wxComboBox_new_0, 1569).
+-define(wxComboBox_new_3, 1571).
+-define(wxComboBox_destruct, 1572).
+-define(wxComboBox_Create, 1574).
+-define(wxComboBox_CanCopy, 1575).
+-define(wxComboBox_CanCut, 1576).
+-define(wxComboBox_CanPaste, 1577).
+-define(wxComboBox_CanRedo, 1578).
+-define(wxComboBox_CanUndo, 1579).
+-define(wxComboBox_Copy, 1580).
+-define(wxComboBox_Cut, 1581).
+-define(wxComboBox_GetInsertionPoint, 1582).
+-define(wxComboBox_GetLastPosition, 1583).
+-define(wxComboBox_GetValue, 1584).
+-define(wxComboBox_Paste, 1585).
+-define(wxComboBox_Redo, 1586).
+-define(wxComboBox_Replace, 1587).
+-define(wxComboBox_Remove, 1588).
+-define(wxComboBox_SetInsertionPoint, 1589).
+-define(wxComboBox_SetInsertionPointEnd, 1590).
+-define(wxComboBox_SetSelection_1, 1591).
+-define(wxComboBox_SetSelection_2, 1592).
+-define(wxComboBox_SetValue, 1593).
+-define(wxComboBox_Undo, 1594).
+-define(wxGauge_new_0, 1595).
+-define(wxGauge_new_4, 1596).
+-define(wxGauge_Create, 1597).
+-define(wxGauge_GetBezelFace, 1598).
+-define(wxGauge_GetRange, 1599).
+-define(wxGauge_GetShadowWidth, 1600).
+-define(wxGauge_GetValue, 1601).
+-define(wxGauge_IsVertical, 1602).
+-define(wxGauge_SetBezelFace, 1603).
+-define(wxGauge_SetRange, 1604).
+-define(wxGauge_SetShadowWidth, 1605).
+-define(wxGauge_SetValue, 1606).
+-define(wxGauge_Pulse, 1607).
+-define(wxGauge_destroy, 1608).
+-define(wxGenericDirCtrl_new_0, 1609).
+-define(wxGenericDirCtrl_new_2, 1610).
+-define(wxGenericDirCtrl_destruct, 1611).
+-define(wxGenericDirCtrl_Create, 1612).
+-define(wxGenericDirCtrl_Init, 1613).
+-define(wxGenericDirCtrl_CollapseTree, 1614).
+-define(wxGenericDirCtrl_ExpandPath, 1615).
+-define(wxGenericDirCtrl_GetDefaultPath, 1616).
+-define(wxGenericDirCtrl_GetPath, 1617).
+-define(wxGenericDirCtrl_GetFilePath, 1618).
+-define(wxGenericDirCtrl_GetFilter, 1619).
+-define(wxGenericDirCtrl_GetFilterIndex, 1620).
+-define(wxGenericDirCtrl_GetRootId, 1621).
+-define(wxGenericDirCtrl_GetTreeCtrl, 1622).
+-define(wxGenericDirCtrl_ReCreateTree, 1623).
+-define(wxGenericDirCtrl_SetDefaultPath, 1624).
+-define(wxGenericDirCtrl_SetFilter, 1625).
+-define(wxGenericDirCtrl_SetFilterIndex, 1626).
+-define(wxGenericDirCtrl_SetPath, 1627).
+-define(wxStaticBox_new_4, 1629).
+-define(wxStaticBox_new_0, 1630).
+-define(wxStaticBox_Create, 1631).
+-define(wxStaticBox_destroy, 1632).
+-define(wxStaticLine_new_2, 1634).
+-define(wxStaticLine_new_0, 1635).
+-define(wxStaticLine_Create, 1636).
+-define(wxStaticLine_IsVertical, 1637).
+-define(wxStaticLine_GetDefaultSize, 1638).
+-define(wxStaticLine_destroy, 1639).
+-define(wxListBox_new_3, 1642).
+-define(wxListBox_new_0, 1643).
+-define(wxListBox_destruct, 1645).
+-define(wxListBox_Create, 1647).
+-define(wxListBox_Deselect, 1648).
+-define(wxListBox_GetSelections, 1649).
+-define(wxListBox_InsertItems, 1650).
+-define(wxListBox_IsSelected, 1651).
+-define(wxListBox_Set, 1653).
+-define(wxListBox_HitTest, 1654).
+-define(wxListBox_SetFirstItem_1_0, 1655).
+-define(wxListBox_SetFirstItem_1_1, 1656).
+-define(wxListCtrl_new_0, 1657).
+-define(wxListCtrl_new_2, 1658).
+-define(wxListCtrl_Arrange, 1659).
+-define(wxListCtrl_AssignImageList, 1660).
+-define(wxListCtrl_ClearAll, 1661).
+-define(wxListCtrl_Create, 1662).
+-define(wxListCtrl_DeleteAllItems, 1663).
+-define(wxListCtrl_DeleteColumn, 1664).
+-define(wxListCtrl_DeleteItem, 1665).
+-define(wxListCtrl_EditLabel, 1666).
+-define(wxListCtrl_EnsureVisible, 1667).
+-define(wxListCtrl_FindItem_3_0, 1668).
+-define(wxListCtrl_FindItem_3_1, 1669).
+-define(wxListCtrl_GetColumn, 1670).
+-define(wxListCtrl_GetColumnCount, 1671).
+-define(wxListCtrl_GetColumnWidth, 1672).
+-define(wxListCtrl_GetCountPerPage, 1673).
+-define(wxListCtrl_GetEditControl, 1674).
+-define(wxListCtrl_GetImageList, 1675).
+-define(wxListCtrl_GetItem, 1676).
+-define(wxListCtrl_GetItemBackgroundColour, 1677).
+-define(wxListCtrl_GetItemCount, 1678).
+-define(wxListCtrl_GetItemData, 1679).
+-define(wxListCtrl_GetItemFont, 1680).
+-define(wxListCtrl_GetItemPosition, 1681).
+-define(wxListCtrl_GetItemRect, 1682).
+-define(wxListCtrl_GetItemSpacing, 1683).
+-define(wxListCtrl_GetItemState, 1684).
+-define(wxListCtrl_GetItemText, 1685).
+-define(wxListCtrl_GetItemTextColour, 1686).
+-define(wxListCtrl_GetNextItem, 1687).
+-define(wxListCtrl_GetSelectedItemCount, 1688).
+-define(wxListCtrl_GetTextColour, 1689).
+-define(wxListCtrl_GetTopItem, 1690).
+-define(wxListCtrl_GetViewRect, 1691).
+-define(wxListCtrl_HitTest, 1692).
+-define(wxListCtrl_InsertColumn_2, 1693).
+-define(wxListCtrl_InsertColumn_3, 1694).
+-define(wxListCtrl_InsertItem_1, 1695).
+-define(wxListCtrl_InsertItem_2_1, 1696).
+-define(wxListCtrl_InsertItem_2_0, 1697).
+-define(wxListCtrl_InsertItem_3, 1698).
+-define(wxListCtrl_RefreshItem, 1699).
+-define(wxListCtrl_RefreshItems, 1700).
+-define(wxListCtrl_ScrollList, 1701).
+-define(wxListCtrl_SetBackgroundColour, 1702).
+-define(wxListCtrl_SetColumn, 1703).
+-define(wxListCtrl_SetColumnWidth, 1704).
+-define(wxListCtrl_SetImageList, 1705).
+-define(wxListCtrl_SetItem_1, 1706).
+-define(wxListCtrl_SetItem_4, 1707).
+-define(wxListCtrl_SetItemBackgroundColour, 1708).
+-define(wxListCtrl_SetItemCount, 1709).
+-define(wxListCtrl_SetItemData, 1710).
+-define(wxListCtrl_SetItemFont, 1711).
+-define(wxListCtrl_SetItemImage, 1712).
+-define(wxListCtrl_SetItemColumnImage, 1713).
+-define(wxListCtrl_SetItemPosition, 1714).
+-define(wxListCtrl_SetItemState, 1715).
+-define(wxListCtrl_SetItemText, 1716).
+-define(wxListCtrl_SetItemTextColour, 1717).
+-define(wxListCtrl_SetSingleStyle, 1718).
+-define(wxListCtrl_SetTextColour, 1719).
+-define(wxListCtrl_SetWindowStyleFlag, 1720).
+-define(wxListCtrl_SortItems, 1721).
+-define(wxListCtrl_destroy, 1722).
+-define(wxListView_ClearColumnImage, 1723).
+-define(wxListView_Focus, 1724).
+-define(wxListView_GetFirstSelected, 1725).
+-define(wxListView_GetFocusedItem, 1726).
+-define(wxListView_GetNextSelected, 1727).
+-define(wxListView_IsSelected, 1728).
+-define(wxListView_Select, 1729).
+-define(wxListView_SetColumnImage, 1730).
+-define(wxListItem_new_0, 1731).
+-define(wxListItem_new_1, 1732).
+-define(wxListItem_destruct, 1733).
+-define(wxListItem_Clear, 1734).
+-define(wxListItem_GetAlign, 1735).
+-define(wxListItem_GetBackgroundColour, 1736).
+-define(wxListItem_GetColumn, 1737).
+-define(wxListItem_GetFont, 1738).
+-define(wxListItem_GetId, 1739).
+-define(wxListItem_GetImage, 1740).
+-define(wxListItem_GetMask, 1741).
+-define(wxListItem_GetState, 1742).
+-define(wxListItem_GetText, 1743).
+-define(wxListItem_GetTextColour, 1744).
+-define(wxListItem_GetWidth, 1745).
+-define(wxListItem_SetAlign, 1746).
+-define(wxListItem_SetBackgroundColour, 1747).
+-define(wxListItem_SetColumn, 1748).
+-define(wxListItem_SetFont, 1749).
+-define(wxListItem_SetId, 1750).
+-define(wxListItem_SetImage, 1751).
+-define(wxListItem_SetMask, 1752).
+-define(wxListItem_SetState, 1753).
+-define(wxListItem_SetStateMask, 1754).
+-define(wxListItem_SetText, 1755).
+-define(wxListItem_SetTextColour, 1756).
+-define(wxListItem_SetWidth, 1757).
+-define(wxListItemAttr_new_0, 1758).
+-define(wxListItemAttr_new_3, 1759).
+-define(wxListItemAttr_GetBackgroundColour, 1760).
+-define(wxListItemAttr_GetFont, 1761).
+-define(wxListItemAttr_GetTextColour, 1762).
+-define(wxListItemAttr_HasBackgroundColour, 1763).
+-define(wxListItemAttr_HasFont, 1764).
+-define(wxListItemAttr_HasTextColour, 1765).
+-define(wxListItemAttr_SetBackgroundColour, 1766).
+-define(wxListItemAttr_SetFont, 1767).
+-define(wxListItemAttr_SetTextColour, 1768).
+-define(wxListItemAttr_destroy, 1769).
+-define(wxImageList_new_0, 1770).
+-define(wxImageList_new_3, 1771).
+-define(wxImageList_Add_1, 1772).
+-define(wxImageList_Add_2_0, 1773).
+-define(wxImageList_Add_2_1, 1774).
+-define(wxImageList_Create, 1775).
+-define(wxImageList_Draw, 1777).
+-define(wxImageList_GetBitmap, 1778).
+-define(wxImageList_GetIcon, 1779).
+-define(wxImageList_GetImageCount, 1780).
+-define(wxImageList_GetSize, 1781).
+-define(wxImageList_Remove, 1782).
+-define(wxImageList_RemoveAll, 1783).
+-define(wxImageList_Replace_2, 1784).
+-define(wxImageList_Replace_3, 1785).
+-define(wxImageList_destroy, 1786).
+-define(wxTextAttr_new_0, 1787).
+-define(wxTextAttr_new_2, 1788).
+-define(wxTextAttr_GetAlignment, 1789).
+-define(wxTextAttr_GetBackgroundColour, 1790).
+-define(wxTextAttr_GetFont, 1791).
+-define(wxTextAttr_GetLeftIndent, 1792).
+-define(wxTextAttr_GetLeftSubIndent, 1793).
+-define(wxTextAttr_GetRightIndent, 1794).
+-define(wxTextAttr_GetTabs, 1795).
+-define(wxTextAttr_GetTextColour, 1796).
+-define(wxTextAttr_HasBackgroundColour, 1797).
+-define(wxTextAttr_HasFont, 1798).
+-define(wxTextAttr_HasTextColour, 1799).
+-define(wxTextAttr_GetFlags, 1800).
+-define(wxTextAttr_IsDefault, 1801).
+-define(wxTextAttr_SetAlignment, 1802).
+-define(wxTextAttr_SetBackgroundColour, 1803).
+-define(wxTextAttr_SetFlags, 1804).
+-define(wxTextAttr_SetFont, 1805).
+-define(wxTextAttr_SetLeftIndent, 1806).
+-define(wxTextAttr_SetRightIndent, 1807).
+-define(wxTextAttr_SetTabs, 1808).
+-define(wxTextAttr_SetTextColour, 1809).
+-define(wxTextAttr_destroy, 1810).
+-define(wxTextCtrl_new_3, 1812).
+-define(wxTextCtrl_new_0, 1813).
+-define(wxTextCtrl_destruct, 1815).
+-define(wxTextCtrl_AppendText, 1816).
+-define(wxTextCtrl_CanCopy, 1817).
+-define(wxTextCtrl_CanCut, 1818).
+-define(wxTextCtrl_CanPaste, 1819).
+-define(wxTextCtrl_CanRedo, 1820).
+-define(wxTextCtrl_CanUndo, 1821).
+-define(wxTextCtrl_Clear, 1822).
+-define(wxTextCtrl_Copy, 1823).
+-define(wxTextCtrl_Create, 1824).
+-define(wxTextCtrl_Cut, 1825).
+-define(wxTextCtrl_DiscardEdits, 1826).
+-define(wxTextCtrl_EmulateKeyPress, 1827).
+-define(wxTextCtrl_GetDefaultStyle, 1828).
+-define(wxTextCtrl_GetInsertionPoint, 1829).
+-define(wxTextCtrl_GetLastPosition, 1830).
+-define(wxTextCtrl_GetLineLength, 1831).
+-define(wxTextCtrl_GetLineText, 1832).
+-define(wxTextCtrl_GetNumberOfLines, 1833).
+-define(wxTextCtrl_GetRange, 1834).
+-define(wxTextCtrl_GetSelection, 1835).
+-define(wxTextCtrl_GetStringSelection, 1836).
+-define(wxTextCtrl_GetStyle, 1837).
+-define(wxTextCtrl_GetValue, 1838).
+-define(wxTextCtrl_IsEditable, 1839).
+-define(wxTextCtrl_IsModified, 1840).
+-define(wxTextCtrl_IsMultiLine, 1841).
+-define(wxTextCtrl_IsSingleLine, 1842).
+-define(wxTextCtrl_LoadFile, 1843).
+-define(wxTextCtrl_MarkDirty, 1844).
+-define(wxTextCtrl_Paste, 1845).
+-define(wxTextCtrl_PositionToXY, 1846).
+-define(wxTextCtrl_Redo, 1847).
+-define(wxTextCtrl_Remove, 1848).
+-define(wxTextCtrl_Replace, 1849).
+-define(wxTextCtrl_SaveFile, 1850).
+-define(wxTextCtrl_SetDefaultStyle, 1851).
+-define(wxTextCtrl_SetEditable, 1852).
+-define(wxTextCtrl_SetInsertionPoint, 1853).
+-define(wxTextCtrl_SetInsertionPointEnd, 1854).
+-define(wxTextCtrl_SetMaxLength, 1856).
+-define(wxTextCtrl_SetSelection, 1857).
+-define(wxTextCtrl_SetStyle, 1858).
+-define(wxTextCtrl_SetValue, 1859).
+-define(wxTextCtrl_ShowPosition, 1860).
+-define(wxTextCtrl_Undo, 1861).
+-define(wxTextCtrl_WriteText, 1862).
+-define(wxTextCtrl_XYToPosition, 1863).
+-define(wxNotebook_new_0, 1866).
+-define(wxNotebook_new_3, 1867).
+-define(wxNotebook_destruct, 1868).
+-define(wxNotebook_AddPage, 1869).
+-define(wxNotebook_AdvanceSelection, 1870).
+-define(wxNotebook_AssignImageList, 1871).
+-define(wxNotebook_Create, 1872).
+-define(wxNotebook_DeleteAllPages, 1873).
+-define(wxNotebook_DeletePage, 1874).
+-define(wxNotebook_RemovePage, 1875).
+-define(wxNotebook_GetCurrentPage, 1876).
+-define(wxNotebook_GetImageList, 1877).
+-define(wxNotebook_GetPage, 1879).
+-define(wxNotebook_GetPageCount, 1880).
+-define(wxNotebook_GetPageImage, 1881).
+-define(wxNotebook_GetPageText, 1882).
+-define(wxNotebook_GetRowCount, 1883).
+-define(wxNotebook_GetSelection, 1884).
+-define(wxNotebook_GetThemeBackgroundColour, 1885).
+-define(wxNotebook_HitTest, 1887).
+-define(wxNotebook_InsertPage, 1889).
+-define(wxNotebook_SetImageList, 1890).
+-define(wxNotebook_SetPadding, 1891).
+-define(wxNotebook_SetPageSize, 1892).
+-define(wxNotebook_SetPageImage, 1893).
+-define(wxNotebook_SetPageText, 1894).
+-define(wxNotebook_SetSelection, 1895).
+-define(wxNotebook_ChangeSelection, 1896).
+-define(wxChoicebook_new_0, 1897).
+-define(wxChoicebook_new_3, 1898).
+-define(wxChoicebook_AddPage, 1899).
+-define(wxChoicebook_AdvanceSelection, 1900).
+-define(wxChoicebook_AssignImageList, 1901).
+-define(wxChoicebook_Create, 1902).
+-define(wxChoicebook_DeleteAllPages, 1903).
+-define(wxChoicebook_DeletePage, 1904).
+-define(wxChoicebook_RemovePage, 1905).
+-define(wxChoicebook_GetCurrentPage, 1906).
+-define(wxChoicebook_GetImageList, 1907).
+-define(wxChoicebook_GetPage, 1909).
+-define(wxChoicebook_GetPageCount, 1910).
+-define(wxChoicebook_GetPageImage, 1911).
+-define(wxChoicebook_GetPageText, 1912).
+-define(wxChoicebook_GetSelection, 1913).
+-define(wxChoicebook_HitTest, 1914).
+-define(wxChoicebook_InsertPage, 1915).
+-define(wxChoicebook_SetImageList, 1916).
+-define(wxChoicebook_SetPageSize, 1917).
+-define(wxChoicebook_SetPageImage, 1918).
+-define(wxChoicebook_SetPageText, 1919).
+-define(wxChoicebook_SetSelection, 1920).
+-define(wxChoicebook_ChangeSelection, 1921).
+-define(wxChoicebook_destroy, 1922).
+-define(wxToolbook_new_0, 1923).
+-define(wxToolbook_new_3, 1924).
+-define(wxToolbook_AddPage, 1925).
+-define(wxToolbook_AdvanceSelection, 1926).
+-define(wxToolbook_AssignImageList, 1927).
+-define(wxToolbook_Create, 1928).
+-define(wxToolbook_DeleteAllPages, 1929).
+-define(wxToolbook_DeletePage, 1930).
+-define(wxToolbook_RemovePage, 1931).
+-define(wxToolbook_GetCurrentPage, 1932).
+-define(wxToolbook_GetImageList, 1933).
+-define(wxToolbook_GetPage, 1935).
+-define(wxToolbook_GetPageCount, 1936).
+-define(wxToolbook_GetPageImage, 1937).
+-define(wxToolbook_GetPageText, 1938).
+-define(wxToolbook_GetSelection, 1939).
+-define(wxToolbook_HitTest, 1941).
+-define(wxToolbook_InsertPage, 1942).
+-define(wxToolbook_SetImageList, 1943).
+-define(wxToolbook_SetPageSize, 1944).
+-define(wxToolbook_SetPageImage, 1945).
+-define(wxToolbook_SetPageText, 1946).
+-define(wxToolbook_SetSelection, 1947).
+-define(wxToolbook_ChangeSelection, 1948).
+-define(wxToolbook_destroy, 1949).
+-define(wxListbook_new_0, 1950).
+-define(wxListbook_new_3, 1951).
+-define(wxListbook_AddPage, 1952).
+-define(wxListbook_AdvanceSelection, 1953).
+-define(wxListbook_AssignImageList, 1954).
+-define(wxListbook_Create, 1955).
+-define(wxListbook_DeleteAllPages, 1956).
+-define(wxListbook_DeletePage, 1957).
+-define(wxListbook_RemovePage, 1958).
+-define(wxListbook_GetCurrentPage, 1959).
+-define(wxListbook_GetImageList, 1960).
+-define(wxListbook_GetPage, 1962).
+-define(wxListbook_GetPageCount, 1963).
+-define(wxListbook_GetPageImage, 1964).
+-define(wxListbook_GetPageText, 1965).
+-define(wxListbook_GetSelection, 1966).
+-define(wxListbook_HitTest, 1968).
+-define(wxListbook_InsertPage, 1969).
+-define(wxListbook_SetImageList, 1970).
+-define(wxListbook_SetPageSize, 1971).
+-define(wxListbook_SetPageImage, 1972).
+-define(wxListbook_SetPageText, 1973).
+-define(wxListbook_SetSelection, 1974).
+-define(wxListbook_ChangeSelection, 1975).
+-define(wxListbook_destroy, 1976).
+-define(wxTreebook_new_0, 1977).
+-define(wxTreebook_new_3, 1978).
+-define(wxTreebook_AddPage, 1979).
+-define(wxTreebook_AdvanceSelection, 1980).
+-define(wxTreebook_AssignImageList, 1981).
+-define(wxTreebook_Create, 1982).
+-define(wxTreebook_DeleteAllPages, 1983).
+-define(wxTreebook_DeletePage, 1984).
+-define(wxTreebook_RemovePage, 1985).
+-define(wxTreebook_GetCurrentPage, 1986).
+-define(wxTreebook_GetImageList, 1987).
+-define(wxTreebook_GetPage, 1989).
+-define(wxTreebook_GetPageCount, 1990).
+-define(wxTreebook_GetPageImage, 1991).
+-define(wxTreebook_GetPageText, 1992).
+-define(wxTreebook_GetSelection, 1993).
+-define(wxTreebook_ExpandNode, 1994).
+-define(wxTreebook_IsNodeExpanded, 1995).
+-define(wxTreebook_HitTest, 1997).
+-define(wxTreebook_InsertPage, 1998).
+-define(wxTreebook_InsertSubPage, 1999).
+-define(wxTreebook_SetImageList, 2000).
+-define(wxTreebook_SetPageSize, 2001).
+-define(wxTreebook_SetPageImage, 2002).
+-define(wxTreebook_SetPageText, 2003).
+-define(wxTreebook_SetSelection, 2004).
+-define(wxTreebook_ChangeSelection, 2005).
+-define(wxTreebook_destroy, 2006).
+-define(wxTreeCtrl_new_2, 2009).
+-define(wxTreeCtrl_new_0, 2010).
+-define(wxTreeCtrl_destruct, 2012).
+-define(wxTreeCtrl_AddRoot, 2013).
+-define(wxTreeCtrl_AppendItem, 2014).
+-define(wxTreeCtrl_AssignImageList, 2015).
+-define(wxTreeCtrl_AssignStateImageList, 2016).
+-define(wxTreeCtrl_Collapse, 2017).
+-define(wxTreeCtrl_CollapseAndReset, 2018).
+-define(wxTreeCtrl_Create, 2019).
+-define(wxTreeCtrl_Delete, 2020).
+-define(wxTreeCtrl_DeleteAllItems, 2021).
+-define(wxTreeCtrl_DeleteChildren, 2022).
+-define(wxTreeCtrl_EditLabel, 2023).
+-define(wxTreeCtrl_EnsureVisible, 2024).
+-define(wxTreeCtrl_Expand, 2025).
+-define(wxTreeCtrl_GetBoundingRect, 2026).
+-define(wxTreeCtrl_GetChildrenCount, 2028).
+-define(wxTreeCtrl_GetCount, 2029).
+-define(wxTreeCtrl_GetEditControl, 2030).
+-define(wxTreeCtrl_GetFirstChild, 2031).
+-define(wxTreeCtrl_GetNextChild, 2032).
+-define(wxTreeCtrl_GetFirstVisibleItem, 2033).
+-define(wxTreeCtrl_GetImageList, 2034).
+-define(wxTreeCtrl_GetIndent, 2035).
+-define(wxTreeCtrl_GetItemBackgroundColour, 2036).
+-define(wxTreeCtrl_GetItemData, 2037).
+-define(wxTreeCtrl_GetItemFont, 2038).
+-define(wxTreeCtrl_GetItemImage_1, 2039).
+-define(wxTreeCtrl_GetItemImage_2, 2040).
+-define(wxTreeCtrl_GetItemText, 2041).
+-define(wxTreeCtrl_GetItemTextColour, 2042).
+-define(wxTreeCtrl_GetLastChild, 2043).
+-define(wxTreeCtrl_GetNextSibling, 2044).
+-define(wxTreeCtrl_GetNextVisible, 2045).
+-define(wxTreeCtrl_GetItemParent, 2046).
+-define(wxTreeCtrl_GetPrevSibling, 2047).
+-define(wxTreeCtrl_GetPrevVisible, 2048).
+-define(wxTreeCtrl_GetRootItem, 2049).
+-define(wxTreeCtrl_GetSelection, 2050).
+-define(wxTreeCtrl_GetSelections, 2051).
+-define(wxTreeCtrl_GetStateImageList, 2052).
+-define(wxTreeCtrl_HitTest, 2053).
+-define(wxTreeCtrl_InsertItem, 2055).
+-define(wxTreeCtrl_IsBold, 2056).
+-define(wxTreeCtrl_IsExpanded, 2057).
+-define(wxTreeCtrl_IsSelected, 2058).
+-define(wxTreeCtrl_IsVisible, 2059).
+-define(wxTreeCtrl_ItemHasChildren, 2060).
+-define(wxTreeCtrl_PrependItem, 2061).
+-define(wxTreeCtrl_ScrollTo, 2062).
+-define(wxTreeCtrl_SelectItem_1, 2063).
+-define(wxTreeCtrl_SelectItem_2, 2064).
+-define(wxTreeCtrl_SetIndent, 2065).
+-define(wxTreeCtrl_SetImageList, 2066).
+-define(wxTreeCtrl_SetItemBackgroundColour, 2067).
+-define(wxTreeCtrl_SetItemBold, 2068).
+-define(wxTreeCtrl_SetItemData, 2069).
+-define(wxTreeCtrl_SetItemDropHighlight, 2070).
+-define(wxTreeCtrl_SetItemFont, 2071).
+-define(wxTreeCtrl_SetItemHasChildren, 2072).
+-define(wxTreeCtrl_SetItemImage_2, 2073).
+-define(wxTreeCtrl_SetItemImage_3, 2074).
+-define(wxTreeCtrl_SetItemText, 2075).
+-define(wxTreeCtrl_SetItemTextColour, 2076).
+-define(wxTreeCtrl_SetStateImageList, 2077).
+-define(wxTreeCtrl_SetWindowStyle, 2078).
+-define(wxTreeCtrl_SortChildren, 2079).
+-define(wxTreeCtrl_Toggle, 2080).
+-define(wxTreeCtrl_ToggleItemSelection, 2081).
+-define(wxTreeCtrl_Unselect, 2082).
+-define(wxTreeCtrl_UnselectAll, 2083).
+-define(wxTreeCtrl_UnselectItem, 2084).
+-define(wxScrollBar_new_0, 2085).
+-define(wxScrollBar_new_3, 2086).
+-define(wxScrollBar_destruct, 2087).
+-define(wxScrollBar_Create, 2088).
+-define(wxScrollBar_GetRange, 2089).
+-define(wxScrollBar_GetPageSize, 2090).
+-define(wxScrollBar_GetThumbPosition, 2091).
+-define(wxScrollBar_GetThumbSize, 2092).
+-define(wxScrollBar_SetThumbPosition, 2093).
+-define(wxScrollBar_SetScrollbar, 2094).
+-define(wxSpinButton_new_2, 2096).
+-define(wxSpinButton_new_0, 2097).
+-define(wxSpinButton_Create, 2098).
+-define(wxSpinButton_GetMax, 2099).
+-define(wxSpinButton_GetMin, 2100).
+-define(wxSpinButton_GetValue, 2101).
+-define(wxSpinButton_SetRange, 2102).
+-define(wxSpinButton_SetValue, 2103).
+-define(wxSpinButton_destroy, 2104).
+-define(wxSpinCtrl_new_0, 2105).
+-define(wxSpinCtrl_new_2, 2106).
+-define(wxSpinCtrl_Create, 2108).
+-define(wxSpinCtrl_SetValue_1_1, 2111).
+-define(wxSpinCtrl_SetValue_1_0, 2112).
+-define(wxSpinCtrl_GetValue, 2114).
+-define(wxSpinCtrl_SetRange, 2116).
+-define(wxSpinCtrl_SetSelection, 2117).
+-define(wxSpinCtrl_GetMin, 2119).
+-define(wxSpinCtrl_GetMax, 2121).
+-define(wxSpinCtrl_destroy, 2122).
+-define(wxStaticText_new_0, 2123).
+-define(wxStaticText_new_4, 2124).
+-define(wxStaticText_Create, 2125).
+-define(wxStaticText_GetLabel, 2126).
+-define(wxStaticText_SetLabel, 2127).
+-define(wxStaticText_Wrap, 2128).
+-define(wxStaticText_destroy, 2129).
+-define(wxStaticBitmap_new_0, 2130).
+-define(wxStaticBitmap_new_4, 2131).
+-define(wxStaticBitmap_Create, 2132).
+-define(wxStaticBitmap_GetBitmap, 2133).
+-define(wxStaticBitmap_SetBitmap, 2134).
+-define(wxStaticBitmap_destroy, 2135).
+-define(wxRadioBox_new, 2136).
+-define(wxRadioBox_destruct, 2138).
+-define(wxRadioBox_Create, 2139).
+-define(wxRadioBox_Enable_2, 2140).
+-define(wxRadioBox_Enable_1, 2141).
+-define(wxRadioBox_GetSelection, 2142).
+-define(wxRadioBox_GetString, 2143).
+-define(wxRadioBox_SetSelection, 2144).
+-define(wxRadioBox_Show_2, 2145).
+-define(wxRadioBox_Show_1, 2146).
+-define(wxRadioBox_GetColumnCount, 2147).
+-define(wxRadioBox_GetItemHelpText, 2148).
+-define(wxRadioBox_GetItemToolTip, 2149).
+-define(wxRadioBox_GetItemFromPoint, 2151).
+-define(wxRadioBox_GetRowCount, 2152).
+-define(wxRadioBox_IsItemEnabled, 2153).
+-define(wxRadioBox_IsItemShown, 2154).
+-define(wxRadioBox_SetItemHelpText, 2155).
+-define(wxRadioBox_SetItemToolTip, 2156).
+-define(wxRadioButton_new_0, 2157).
+-define(wxRadioButton_new_4, 2158).
+-define(wxRadioButton_Create, 2159).
+-define(wxRadioButton_GetValue, 2160).
+-define(wxRadioButton_SetValue, 2161).
+-define(wxRadioButton_destroy, 2162).
+-define(wxSlider_new_6, 2164).
+-define(wxSlider_new_0, 2165).
+-define(wxSlider_Create, 2166).
+-define(wxSlider_GetLineSize, 2167).
+-define(wxSlider_GetMax, 2168).
+-define(wxSlider_GetMin, 2169).
+-define(wxSlider_GetPageSize, 2170).
+-define(wxSlider_GetThumbLength, 2171).
+-define(wxSlider_GetValue, 2172).
+-define(wxSlider_SetLineSize, 2173).
+-define(wxSlider_SetPageSize, 2174).
+-define(wxSlider_SetRange, 2175).
+-define(wxSlider_SetThumbLength, 2176).
+-define(wxSlider_SetValue, 2177).
+-define(wxSlider_destroy, 2178).
+-define(wxDialog_new_4, 2180).
+-define(wxDialog_new_0, 2181).
+-define(wxDialog_destruct, 2183).
+-define(wxDialog_Create, 2184).
+-define(wxDialog_CreateButtonSizer, 2185).
+-define(wxDialog_CreateStdDialogButtonSizer, 2186).
+-define(wxDialog_EndModal, 2187).
+-define(wxDialog_GetAffirmativeId, 2188).
+-define(wxDialog_GetReturnCode, 2189).
+-define(wxDialog_IsModal, 2190).
+-define(wxDialog_SetAffirmativeId, 2191).
+-define(wxDialog_SetReturnCode, 2192).
+-define(wxDialog_Show, 2193).
+-define(wxDialog_ShowModal, 2194).
+-define(wxColourDialog_new_0, 2195).
+-define(wxColourDialog_new_2, 2196).
+-define(wxColourDialog_destruct, 2197).
+-define(wxColourDialog_Create, 2198).
+-define(wxColourDialog_GetColourData, 2199).
+-define(wxColourData_new_0, 2200).
+-define(wxColourData_new_1, 2201).
+-define(wxColourData_destruct, 2202).
+-define(wxColourData_GetChooseFull, 2203).
+-define(wxColourData_GetColour, 2204).
+-define(wxColourData_GetCustomColour, 2206).
+-define(wxColourData_SetChooseFull, 2207).
+-define(wxColourData_SetColour, 2208).
+-define(wxColourData_SetCustomColour, 2209).
+-define(wxPalette_new_0, 2210).
+-define(wxPalette_new_4, 2211).
+-define(wxPalette_destruct, 2213).
+-define(wxPalette_Create, 2214).
+-define(wxPalette_GetColoursCount, 2215).
+-define(wxPalette_GetPixel, 2216).
+-define(wxPalette_GetRGB, 2217).
+-define(wxPalette_IsOk, 2218).
+-define(wxDirDialog_new, 2222).
+-define(wxDirDialog_destruct, 2223).
+-define(wxDirDialog_GetPath, 2224).
+-define(wxDirDialog_GetMessage, 2225).
+-define(wxDirDialog_SetMessage, 2226).
+-define(wxDirDialog_SetPath, 2227).
+-define(wxFileDialog_new, 2231).
+-define(wxFileDialog_destruct, 2232).
+-define(wxFileDialog_GetDirectory, 2233).
+-define(wxFileDialog_GetFilename, 2234).
+-define(wxFileDialog_GetFilenames, 2235).
+-define(wxFileDialog_GetFilterIndex, 2236).
+-define(wxFileDialog_GetMessage, 2237).
+-define(wxFileDialog_GetPath, 2238).
+-define(wxFileDialog_GetPaths, 2239).
+-define(wxFileDialog_GetWildcard, 2240).
+-define(wxFileDialog_SetDirectory, 2241).
+-define(wxFileDialog_SetFilename, 2242).
+-define(wxFileDialog_SetFilterIndex, 2243).
+-define(wxFileDialog_SetMessage, 2244).
+-define(wxFileDialog_SetPath, 2245).
+-define(wxFileDialog_SetWildcard, 2246).
+-define(wxPickerBase_SetInternalMargin, 2247).
+-define(wxPickerBase_GetInternalMargin, 2248).
+-define(wxPickerBase_SetTextCtrlProportion, 2249).
+-define(wxPickerBase_SetPickerCtrlProportion, 2250).
+-define(wxPickerBase_GetTextCtrlProportion, 2251).
+-define(wxPickerBase_GetPickerCtrlProportion, 2252).
+-define(wxPickerBase_HasTextCtrl, 2253).
+-define(wxPickerBase_GetTextCtrl, 2254).
+-define(wxPickerBase_IsTextCtrlGrowable, 2255).
+-define(wxPickerBase_SetPickerCtrlGrowable, 2256).
+-define(wxPickerBase_SetTextCtrlGrowable, 2257).
+-define(wxPickerBase_IsPickerCtrlGrowable, 2258).
+-define(wxFilePickerCtrl_new_0, 2259).
+-define(wxFilePickerCtrl_new_3, 2260).
+-define(wxFilePickerCtrl_Create, 2261).
+-define(wxFilePickerCtrl_GetPath, 2262).
+-define(wxFilePickerCtrl_SetPath, 2263).
+-define(wxFilePickerCtrl_destroy, 2264).
+-define(wxDirPickerCtrl_new_0, 2265).
+-define(wxDirPickerCtrl_new_3, 2266).
+-define(wxDirPickerCtrl_Create, 2267).
+-define(wxDirPickerCtrl_GetPath, 2268).
+-define(wxDirPickerCtrl_SetPath, 2269).
+-define(wxDirPickerCtrl_destroy, 2270).
+-define(wxColourPickerCtrl_new_0, 2271).
+-define(wxColourPickerCtrl_new_3, 2272).
+-define(wxColourPickerCtrl_Create, 2273).
+-define(wxColourPickerCtrl_GetColour, 2274).
+-define(wxColourPickerCtrl_SetColour_1_1, 2275).
+-define(wxColourPickerCtrl_SetColour_1_0, 2276).
+-define(wxColourPickerCtrl_destroy, 2277).
+-define(wxDatePickerCtrl_new_0, 2278).
+-define(wxDatePickerCtrl_new_3, 2279).
+-define(wxDatePickerCtrl_GetRange, 2280).
+-define(wxDatePickerCtrl_GetValue, 2281).
+-define(wxDatePickerCtrl_SetRange, 2282).
+-define(wxDatePickerCtrl_SetValue, 2283).
+-define(wxDatePickerCtrl_destroy, 2284).
+-define(wxFontPickerCtrl_new_0, 2285).
+-define(wxFontPickerCtrl_new_3, 2286).
+-define(wxFontPickerCtrl_Create, 2287).
+-define(wxFontPickerCtrl_GetSelectedFont, 2288).
+-define(wxFontPickerCtrl_SetSelectedFont, 2289).
+-define(wxFontPickerCtrl_GetMaxPointSize, 2290).
+-define(wxFontPickerCtrl_SetMaxPointSize, 2291).
+-define(wxFontPickerCtrl_destroy, 2292).
+-define(wxFindReplaceDialog_new_0, 2295).
+-define(wxFindReplaceDialog_new_4, 2296).
+-define(wxFindReplaceDialog_destruct, 2297).
+-define(wxFindReplaceDialog_Create, 2298).
+-define(wxFindReplaceDialog_GetData, 2299).
+-define(wxFindReplaceData_new_0, 2300).
+-define(wxFindReplaceData_new_1, 2301).
+-define(wxFindReplaceData_GetFindString, 2302).
+-define(wxFindReplaceData_GetReplaceString, 2303).
+-define(wxFindReplaceData_GetFlags, 2304).
+-define(wxFindReplaceData_SetFlags, 2305).
+-define(wxFindReplaceData_SetFindString, 2306).
+-define(wxFindReplaceData_SetReplaceString, 2307).
+-define(wxFindReplaceData_destroy, 2308).
+-define(wxMultiChoiceDialog_new_0, 2309).
+-define(wxMultiChoiceDialog_new_5, 2311).
+-define(wxMultiChoiceDialog_GetSelections, 2312).
+-define(wxMultiChoiceDialog_SetSelections, 2313).
+-define(wxMultiChoiceDialog_destroy, 2314).
+-define(wxSingleChoiceDialog_new_0, 2315).
+-define(wxSingleChoiceDialog_new_5, 2317).
+-define(wxSingleChoiceDialog_GetSelection, 2318).
+-define(wxSingleChoiceDialog_GetStringSelection, 2319).
+-define(wxSingleChoiceDialog_SetSelection, 2320).
+-define(wxSingleChoiceDialog_destroy, 2321).
+-define(wxTextEntryDialog_new, 2322).
+-define(wxTextEntryDialog_GetValue, 2323).
+-define(wxTextEntryDialog_SetValue, 2324).
+-define(wxTextEntryDialog_destroy, 2325).
+-define(wxPasswordEntryDialog_new, 2326).
+-define(wxPasswordEntryDialog_destroy, 2327).
+-define(wxFontData_new_0, 2328).
+-define(wxFontData_new_1, 2329).
+-define(wxFontData_destruct, 2330).
+-define(wxFontData_EnableEffects, 2331).
+-define(wxFontData_GetAllowSymbols, 2332).
+-define(wxFontData_GetColour, 2333).
+-define(wxFontData_GetChosenFont, 2334).
+-define(wxFontData_GetEnableEffects, 2335).
+-define(wxFontData_GetInitialFont, 2336).
+-define(wxFontData_GetShowHelp, 2337).
+-define(wxFontData_SetAllowSymbols, 2338).
+-define(wxFontData_SetChosenFont, 2339).
+-define(wxFontData_SetColour, 2340).
+-define(wxFontData_SetInitialFont, 2341).
+-define(wxFontData_SetRange, 2342).
+-define(wxFontData_SetShowHelp, 2343).
+-define(wxFontDialog_new_0, 2347).
+-define(wxFontDialog_new_2, 2349).
+-define(wxFontDialog_Create, 2351).
+-define(wxFontDialog_GetFontData, 2352).
+-define(wxFontDialog_destroy, 2354).
+-define(wxProgressDialog_new, 2355).
+-define(wxProgressDialog_destruct, 2356).
+-define(wxProgressDialog_Resume, 2357).
+-define(wxProgressDialog_Update_2, 2358).
+-define(wxProgressDialog_Update_0, 2359).
+-define(wxMessageDialog_new, 2360).
+-define(wxMessageDialog_destruct, 2361).
+-define(wxPageSetupDialog_new, 2362).
+-define(wxPageSetupDialog_destruct, 2363).
+-define(wxPageSetupDialog_GetPageSetupData, 2364).
+-define(wxPageSetupDialog_ShowModal, 2365).
+-define(wxPageSetupDialogData_new_0, 2366).
+-define(wxPageSetupDialogData_new_1_0, 2367).
+-define(wxPageSetupDialogData_new_1_1, 2368).
+-define(wxPageSetupDialogData_destruct, 2369).
+-define(wxPageSetupDialogData_EnableHelp, 2370).
+-define(wxPageSetupDialogData_EnableMargins, 2371).
+-define(wxPageSetupDialogData_EnableOrientation, 2372).
+-define(wxPageSetupDialogData_EnablePaper, 2373).
+-define(wxPageSetupDialogData_EnablePrinter, 2374).
+-define(wxPageSetupDialogData_GetDefaultMinMargins, 2375).
+-define(wxPageSetupDialogData_GetEnableMargins, 2376).
+-define(wxPageSetupDialogData_GetEnableOrientation, 2377).
+-define(wxPageSetupDialogData_GetEnablePaper, 2378).
+-define(wxPageSetupDialogData_GetEnablePrinter, 2379).
+-define(wxPageSetupDialogData_GetEnableHelp, 2380).
+-define(wxPageSetupDialogData_GetDefaultInfo, 2381).
+-define(wxPageSetupDialogData_GetMarginTopLeft, 2382).
+-define(wxPageSetupDialogData_GetMarginBottomRight, 2383).
+-define(wxPageSetupDialogData_GetMinMarginTopLeft, 2384).
+-define(wxPageSetupDialogData_GetMinMarginBottomRight, 2385).
+-define(wxPageSetupDialogData_GetPaperId, 2386).
+-define(wxPageSetupDialogData_GetPaperSize, 2387).
+-define(wxPageSetupDialogData_GetPrintData, 2389).
+-define(wxPageSetupDialogData_IsOk, 2390).
+-define(wxPageSetupDialogData_SetDefaultInfo, 2391).
+-define(wxPageSetupDialogData_SetDefaultMinMargins, 2392).
+-define(wxPageSetupDialogData_SetMarginTopLeft, 2393).
+-define(wxPageSetupDialogData_SetMarginBottomRight, 2394).
+-define(wxPageSetupDialogData_SetMinMarginTopLeft, 2395).
+-define(wxPageSetupDialogData_SetMinMarginBottomRight, 2396).
+-define(wxPageSetupDialogData_SetPaperId, 2397).
+-define(wxPageSetupDialogData_SetPaperSize_1_1, 2398).
+-define(wxPageSetupDialogData_SetPaperSize_1_0, 2399).
+-define(wxPageSetupDialogData_SetPrintData, 2400).
+-define(wxPrintDialog_new_2_0, 2401).
+-define(wxPrintDialog_new_2_1, 2402).
+-define(wxPrintDialog_destruct, 2403).
+-define(wxPrintDialog_GetPrintDialogData, 2404).
+-define(wxPrintDialog_GetPrintDC, 2405).
+-define(wxPrintDialogData_new_0, 2406).
+-define(wxPrintDialogData_new_1_1, 2407).
+-define(wxPrintDialogData_new_1_0, 2408).
+-define(wxPrintDialogData_destruct, 2409).
+-define(wxPrintDialogData_EnableHelp, 2410).
+-define(wxPrintDialogData_EnablePageNumbers, 2411).
+-define(wxPrintDialogData_EnablePrintToFile, 2412).
+-define(wxPrintDialogData_EnableSelection, 2413).
+-define(wxPrintDialogData_GetAllPages, 2414).
+-define(wxPrintDialogData_GetCollate, 2415).
+-define(wxPrintDialogData_GetFromPage, 2416).
+-define(wxPrintDialogData_GetMaxPage, 2417).
+-define(wxPrintDialogData_GetMinPage, 2418).
+-define(wxPrintDialogData_GetNoCopies, 2419).
+-define(wxPrintDialogData_GetPrintData, 2420).
+-define(wxPrintDialogData_GetPrintToFile, 2421).
+-define(wxPrintDialogData_GetSelection, 2422).
+-define(wxPrintDialogData_GetToPage, 2423).
+-define(wxPrintDialogData_IsOk, 2424).
+-define(wxPrintDialogData_SetCollate, 2425).
+-define(wxPrintDialogData_SetFromPage, 2426).
+-define(wxPrintDialogData_SetMaxPage, 2427).
+-define(wxPrintDialogData_SetMinPage, 2428).
+-define(wxPrintDialogData_SetNoCopies, 2429).
+-define(wxPrintDialogData_SetPrintData, 2430).
+-define(wxPrintDialogData_SetPrintToFile, 2431).
+-define(wxPrintDialogData_SetSelection, 2432).
+-define(wxPrintDialogData_SetToPage, 2433).
+-define(wxPrintData_new_0, 2434).
+-define(wxPrintData_new_1, 2435).
+-define(wxPrintData_destruct, 2436).
+-define(wxPrintData_GetCollate, 2437).
+-define(wxPrintData_GetBin, 2438).
+-define(wxPrintData_GetColour, 2439).
+-define(wxPrintData_GetDuplex, 2440).
+-define(wxPrintData_GetNoCopies, 2441).
+-define(wxPrintData_GetOrientation, 2442).
+-define(wxPrintData_GetPaperId, 2443).
+-define(wxPrintData_GetPrinterName, 2444).
+-define(wxPrintData_GetQuality, 2445).
+-define(wxPrintData_IsOk, 2446).
+-define(wxPrintData_SetBin, 2447).
+-define(wxPrintData_SetCollate, 2448).
+-define(wxPrintData_SetColour, 2449).
+-define(wxPrintData_SetDuplex, 2450).
+-define(wxPrintData_SetNoCopies, 2451).
+-define(wxPrintData_SetOrientation, 2452).
+-define(wxPrintData_SetPaperId, 2453).
+-define(wxPrintData_SetPrinterName, 2454).
+-define(wxPrintData_SetQuality, 2455).
+-define(wxPrintPreview_new_2, 2458).
+-define(wxPrintPreview_new_3, 2459).
+-define(wxPrintPreview_destruct, 2461).
+-define(wxPrintPreview_GetCanvas, 2462).
+-define(wxPrintPreview_GetCurrentPage, 2463).
+-define(wxPrintPreview_GetFrame, 2464).
+-define(wxPrintPreview_GetMaxPage, 2465).
+-define(wxPrintPreview_GetMinPage, 2466).
+-define(wxPrintPreview_GetPrintout, 2467).
+-define(wxPrintPreview_GetPrintoutForPrinting, 2468).
+-define(wxPrintPreview_IsOk, 2469).
+-define(wxPrintPreview_PaintPage, 2470).
+-define(wxPrintPreview_Print, 2471).
+-define(wxPrintPreview_RenderPage, 2472).
+-define(wxPrintPreview_SetCanvas, 2473).
+-define(wxPrintPreview_SetCurrentPage, 2474).
+-define(wxPrintPreview_SetFrame, 2475).
+-define(wxPrintPreview_SetPrintout, 2476).
+-define(wxPrintPreview_SetZoom, 2477).
+-define(wxPreviewFrame_new, 2478).
+-define(wxPreviewFrame_destruct, 2479).
+-define(wxPreviewFrame_CreateControlBar, 2480).
+-define(wxPreviewFrame_CreateCanvas, 2481).
+-define(wxPreviewFrame_Initialize, 2482).
+-define(wxPreviewFrame_OnCloseWindow, 2483).
+-define(wxPreviewControlBar_new, 2484).
+-define(wxPreviewControlBar_destruct, 2485).
+-define(wxPreviewControlBar_CreateButtons, 2486).
+-define(wxPreviewControlBar_GetPrintPreview, 2487).
+-define(wxPreviewControlBar_GetZoomControl, 2488).
+-define(wxPreviewControlBar_SetZoomControl, 2489).
+-define(wxPrinter_new, 2491).
+-define(wxPrinter_CreateAbortWindow, 2492).
+-define(wxPrinter_GetAbort, 2493).
+-define(wxPrinter_GetLastError, 2494).
+-define(wxPrinter_GetPrintDialogData, 2495).
+-define(wxPrinter_Print, 2496).
+-define(wxPrinter_PrintDialog, 2497).
+-define(wxPrinter_ReportError, 2498).
+-define(wxPrinter_Setup, 2499).
+-define(wxPrinter_destroy, 2500).
+-define(wxXmlResource_new_1, 2501).
+-define(wxXmlResource_new_2, 2502).
+-define(wxXmlResource_destruct, 2503).
+-define(wxXmlResource_AttachUnknownControl, 2504).
+-define(wxXmlResource_ClearHandlers, 2505).
+-define(wxXmlResource_CompareVersion, 2506).
+-define(wxXmlResource_Get, 2507).
+-define(wxXmlResource_GetFlags, 2508).
+-define(wxXmlResource_GetVersion, 2509).
+-define(wxXmlResource_GetXRCID, 2510).
+-define(wxXmlResource_InitAllHandlers, 2511).
+-define(wxXmlResource_Load, 2512).
+-define(wxXmlResource_LoadBitmap, 2513).
+-define(wxXmlResource_LoadDialog_2, 2514).
+-define(wxXmlResource_LoadDialog_3, 2515).
+-define(wxXmlResource_LoadFrame_2, 2516).
+-define(wxXmlResource_LoadFrame_3, 2517).
+-define(wxXmlResource_LoadIcon, 2518).
+-define(wxXmlResource_LoadMenu, 2519).
+-define(wxXmlResource_LoadMenuBar_2, 2520).
+-define(wxXmlResource_LoadMenuBar_1, 2521).
+-define(wxXmlResource_LoadPanel_2, 2522).
+-define(wxXmlResource_LoadPanel_3, 2523).
+-define(wxXmlResource_LoadToolBar, 2524).
+-define(wxXmlResource_Set, 2525).
+-define(wxXmlResource_SetFlags, 2526).
+-define(wxXmlResource_Unload, 2527).
+-define(wxXmlResource_xrcctrl, 2528).
+-define(wxHtmlEasyPrinting_new, 2529).
+-define(wxHtmlEasyPrinting_destruct, 2530).
+-define(wxHtmlEasyPrinting_GetPrintData, 2531).
+-define(wxHtmlEasyPrinting_GetPageSetupData, 2532).
+-define(wxHtmlEasyPrinting_PreviewFile, 2533).
+-define(wxHtmlEasyPrinting_PreviewText, 2534).
+-define(wxHtmlEasyPrinting_PrintFile, 2535).
+-define(wxHtmlEasyPrinting_PrintText, 2536).
+-define(wxHtmlEasyPrinting_PageSetup, 2537).
+-define(wxHtmlEasyPrinting_SetFonts, 2538).
+-define(wxHtmlEasyPrinting_SetHeader, 2539).
+-define(wxHtmlEasyPrinting_SetFooter, 2540).
+-define(wxGLCanvas_new_2, 2542).
+-define(wxGLCanvas_new_3_1, 2543).
+-define(wxGLCanvas_new_3_0, 2544).
+-define(wxGLCanvas_GetContext, 2545).
+-define(wxGLCanvas_SetCurrent, 2547).
+-define(wxGLCanvas_SwapBuffers, 2548).
+-define(wxGLCanvas_destroy, 2549).
+-define(wxAuiManager_new, 2550).
+-define(wxAuiManager_destruct, 2551).
+-define(wxAuiManager_AddPane_2_1, 2552).
+-define(wxAuiManager_AddPane_3, 2553).
+-define(wxAuiManager_AddPane_2_0, 2554).
+-define(wxAuiManager_DetachPane, 2555).
+-define(wxAuiManager_GetAllPanes, 2556).
+-define(wxAuiManager_GetArtProvider, 2557).
+-define(wxAuiManager_GetDockSizeConstraint, 2558).
+-define(wxAuiManager_GetFlags, 2559).
+-define(wxAuiManager_GetManagedWindow, 2560).
+-define(wxAuiManager_GetManager, 2561).
+-define(wxAuiManager_GetPane_1_1, 2562).
+-define(wxAuiManager_GetPane_1_0, 2563).
+-define(wxAuiManager_HideHint, 2564).
+-define(wxAuiManager_InsertPane, 2565).
+-define(wxAuiManager_LoadPaneInfo, 2566).
+-define(wxAuiManager_LoadPerspective, 2567).
+-define(wxAuiManager_SavePaneInfo, 2568).
+-define(wxAuiManager_SavePerspective, 2569).
+-define(wxAuiManager_SetArtProvider, 2570).
+-define(wxAuiManager_SetDockSizeConstraint, 2571).
+-define(wxAuiManager_SetFlags, 2572).
+-define(wxAuiManager_SetManagedWindow, 2573).
+-define(wxAuiManager_ShowHint, 2574).
+-define(wxAuiManager_UnInit, 2575).
+-define(wxAuiManager_Update, 2576).
+-define(wxAuiPaneInfo_new_0, 2577).
+-define(wxAuiPaneInfo_new_1, 2578).
+-define(wxAuiPaneInfo_destruct, 2579).
+-define(wxAuiPaneInfo_BestSize_1, 2580).
+-define(wxAuiPaneInfo_BestSize_2, 2581).
+-define(wxAuiPaneInfo_Bottom, 2582).
+-define(wxAuiPaneInfo_BottomDockable, 2583).
+-define(wxAuiPaneInfo_Caption, 2584).
+-define(wxAuiPaneInfo_CaptionVisible, 2585).
+-define(wxAuiPaneInfo_Centre, 2586).
+-define(wxAuiPaneInfo_CentrePane, 2587).
+-define(wxAuiPaneInfo_CloseButton, 2588).
+-define(wxAuiPaneInfo_DefaultPane, 2589).
+-define(wxAuiPaneInfo_DestroyOnClose, 2590).
+-define(wxAuiPaneInfo_Direction, 2591).
+-define(wxAuiPaneInfo_Dock, 2592).
+-define(wxAuiPaneInfo_Dockable, 2593).
+-define(wxAuiPaneInfo_Fixed, 2594).
+-define(wxAuiPaneInfo_Float, 2595).
+-define(wxAuiPaneInfo_Floatable, 2596).
+-define(wxAuiPaneInfo_FloatingPosition_1, 2597).
+-define(wxAuiPaneInfo_FloatingPosition_2, 2598).
+-define(wxAuiPaneInfo_FloatingSize_1, 2599).
+-define(wxAuiPaneInfo_FloatingSize_2, 2600).
+-define(wxAuiPaneInfo_Gripper, 2601).
+-define(wxAuiPaneInfo_GripperTop, 2602).
+-define(wxAuiPaneInfo_HasBorder, 2603).
+-define(wxAuiPaneInfo_HasCaption, 2604).
+-define(wxAuiPaneInfo_HasCloseButton, 2605).
+-define(wxAuiPaneInfo_HasFlag, 2606).
+-define(wxAuiPaneInfo_HasGripper, 2607).
+-define(wxAuiPaneInfo_HasGripperTop, 2608).
+-define(wxAuiPaneInfo_HasMaximizeButton, 2609).
+-define(wxAuiPaneInfo_HasMinimizeButton, 2610).
+-define(wxAuiPaneInfo_HasPinButton, 2611).
+-define(wxAuiPaneInfo_Hide, 2612).
+-define(wxAuiPaneInfo_IsBottomDockable, 2613).
+-define(wxAuiPaneInfo_IsDocked, 2614).
+-define(wxAuiPaneInfo_IsFixed, 2615).
+-define(wxAuiPaneInfo_IsFloatable, 2616).
+-define(wxAuiPaneInfo_IsFloating, 2617).
+-define(wxAuiPaneInfo_IsLeftDockable, 2618).
+-define(wxAuiPaneInfo_IsMovable, 2619).
+-define(wxAuiPaneInfo_IsOk, 2620).
+-define(wxAuiPaneInfo_IsResizable, 2621).
+-define(wxAuiPaneInfo_IsRightDockable, 2622).
+-define(wxAuiPaneInfo_IsShown, 2623).
+-define(wxAuiPaneInfo_IsToolbar, 2624).
+-define(wxAuiPaneInfo_IsTopDockable, 2625).
+-define(wxAuiPaneInfo_Layer, 2626).
+-define(wxAuiPaneInfo_Left, 2627).
+-define(wxAuiPaneInfo_LeftDockable, 2628).
+-define(wxAuiPaneInfo_MaxSize_1, 2629).
+-define(wxAuiPaneInfo_MaxSize_2, 2630).
+-define(wxAuiPaneInfo_MaximizeButton, 2631).
+-define(wxAuiPaneInfo_MinSize_1, 2632).
+-define(wxAuiPaneInfo_MinSize_2, 2633).
+-define(wxAuiPaneInfo_MinimizeButton, 2634).
+-define(wxAuiPaneInfo_Movable, 2635).
+-define(wxAuiPaneInfo_Name, 2636).
+-define(wxAuiPaneInfo_PaneBorder, 2637).
+-define(wxAuiPaneInfo_PinButton, 2638).
+-define(wxAuiPaneInfo_Position, 2639).
+-define(wxAuiPaneInfo_Resizable, 2640).
+-define(wxAuiPaneInfo_Right, 2641).
+-define(wxAuiPaneInfo_RightDockable, 2642).
+-define(wxAuiPaneInfo_Row, 2643).
+-define(wxAuiPaneInfo_SafeSet, 2644).
+-define(wxAuiPaneInfo_SetFlag, 2645).
+-define(wxAuiPaneInfo_Show, 2646).
+-define(wxAuiPaneInfo_ToolbarPane, 2647).
+-define(wxAuiPaneInfo_Top, 2648).
+-define(wxAuiPaneInfo_TopDockable, 2649).
+-define(wxAuiPaneInfo_Window, 2650).
+-define(wxAuiNotebook_new_0, 2651).
+-define(wxAuiNotebook_new_2, 2652).
+-define(wxAuiNotebook_AddPage, 2653).
+-define(wxAuiNotebook_Create, 2654).
+-define(wxAuiNotebook_DeletePage, 2655).
+-define(wxAuiNotebook_GetArtProvider, 2656).
+-define(wxAuiNotebook_GetPage, 2657).
+-define(wxAuiNotebook_GetPageBitmap, 2658).
+-define(wxAuiNotebook_GetPageCount, 2659).
+-define(wxAuiNotebook_GetPageIndex, 2660).
+-define(wxAuiNotebook_GetPageText, 2661).
+-define(wxAuiNotebook_GetSelection, 2662).
+-define(wxAuiNotebook_InsertPage, 2663).
+-define(wxAuiNotebook_RemovePage, 2664).
+-define(wxAuiNotebook_SetArtProvider, 2665).
+-define(wxAuiNotebook_SetFont, 2666).
+-define(wxAuiNotebook_SetPageBitmap, 2667).
+-define(wxAuiNotebook_SetPageText, 2668).
+-define(wxAuiNotebook_SetSelection, 2669).
+-define(wxAuiNotebook_SetTabCtrlHeight, 2670).
+-define(wxAuiNotebook_SetUniformBitmapSize, 2671).
+-define(wxAuiNotebook_destroy, 2672).
+-define(wxMDIParentFrame_new_0, 2673).
+-define(wxMDIParentFrame_new_4, 2674).
+-define(wxMDIParentFrame_destruct, 2675).
+-define(wxMDIParentFrame_ActivateNext, 2676).
+-define(wxMDIParentFrame_ActivatePrevious, 2677).
+-define(wxMDIParentFrame_ArrangeIcons, 2678).
+-define(wxMDIParentFrame_Cascade, 2679).
+-define(wxMDIParentFrame_Create, 2680).
+-define(wxMDIParentFrame_GetActiveChild, 2681).
+-define(wxMDIParentFrame_GetClientWindow, 2682).
+-define(wxMDIParentFrame_Tile, 2683).
+-define(wxMDIChildFrame_new_0, 2684).
+-define(wxMDIChildFrame_new_4, 2685).
+-define(wxMDIChildFrame_destruct, 2686).
+-define(wxMDIChildFrame_Activate, 2687).
+-define(wxMDIChildFrame_Create, 2688).
+-define(wxMDIChildFrame_Maximize, 2689).
+-define(wxMDIChildFrame_Restore, 2690).
+-define(wxMDIClientWindow_new_0, 2691).
+-define(wxMDIClientWindow_new_2, 2692).
+-define(wxMDIClientWindow_destruct, 2693).
+-define(wxMDIClientWindow_CreateClient, 2694).
+-define(wxLayoutAlgorithm_new, 2695).
+-define(wxLayoutAlgorithm_LayoutFrame, 2696).
+-define(wxLayoutAlgorithm_LayoutMDIFrame, 2697).
+-define(wxLayoutAlgorithm_LayoutWindow, 2698).
+-define(wxLayoutAlgorithm_destroy, 2699).
+-define(wxEvent_GetId, 2700).
+-define(wxEvent_GetSkipped, 2701).
+-define(wxEvent_GetTimestamp, 2702).
+-define(wxEvent_IsCommandEvent, 2703).
+-define(wxEvent_ResumePropagation, 2704).
+-define(wxEvent_ShouldPropagate, 2705).
+-define(wxEvent_Skip, 2706).
+-define(wxEvent_StopPropagation, 2707).
+-define(wxCommandEvent_getClientData, 2708).
+-define(wxCommandEvent_GetExtraLong, 2709).
+-define(wxCommandEvent_GetInt, 2710).
+-define(wxCommandEvent_GetSelection, 2711).
+-define(wxCommandEvent_GetString, 2712).
+-define(wxCommandEvent_IsChecked, 2713).
+-define(wxCommandEvent_IsSelection, 2714).
+-define(wxCommandEvent_SetInt, 2715).
+-define(wxCommandEvent_SetString, 2716).
+-define(wxScrollEvent_GetOrientation, 2717).
+-define(wxScrollEvent_GetPosition, 2718).
+-define(wxScrollWinEvent_GetOrientation, 2719).
+-define(wxScrollWinEvent_GetPosition, 2720).
+-define(wxMouseEvent_AltDown, 2721).
+-define(wxMouseEvent_Button, 2722).
+-define(wxMouseEvent_ButtonDClick, 2723).
+-define(wxMouseEvent_ButtonDown, 2724).
+-define(wxMouseEvent_ButtonUp, 2725).
+-define(wxMouseEvent_CmdDown, 2726).
+-define(wxMouseEvent_ControlDown, 2727).
+-define(wxMouseEvent_Dragging, 2728).
+-define(wxMouseEvent_Entering, 2729).
+-define(wxMouseEvent_GetButton, 2730).
+-define(wxMouseEvent_GetPosition, 2733).
+-define(wxMouseEvent_GetLogicalPosition, 2734).
+-define(wxMouseEvent_GetLinesPerAction, 2735).
+-define(wxMouseEvent_GetWheelRotation, 2736).
+-define(wxMouseEvent_GetWheelDelta, 2737).
+-define(wxMouseEvent_GetX, 2738).
+-define(wxMouseEvent_GetY, 2739).
+-define(wxMouseEvent_IsButton, 2740).
+-define(wxMouseEvent_IsPageScroll, 2741).
+-define(wxMouseEvent_Leaving, 2742).
+-define(wxMouseEvent_LeftDClick, 2743).
+-define(wxMouseEvent_LeftDown, 2744).
+-define(wxMouseEvent_LeftIsDown, 2745).
+-define(wxMouseEvent_LeftUp, 2746).
+-define(wxMouseEvent_MetaDown, 2747).
+-define(wxMouseEvent_MiddleDClick, 2748).
+-define(wxMouseEvent_MiddleDown, 2749).
+-define(wxMouseEvent_MiddleIsDown, 2750).
+-define(wxMouseEvent_MiddleUp, 2751).
+-define(wxMouseEvent_Moving, 2752).
+-define(wxMouseEvent_RightDClick, 2753).
+-define(wxMouseEvent_RightDown, 2754).
+-define(wxMouseEvent_RightIsDown, 2755).
+-define(wxMouseEvent_RightUp, 2756).
+-define(wxMouseEvent_ShiftDown, 2757).
+-define(wxSetCursorEvent_GetCursor, 2758).
+-define(wxSetCursorEvent_GetX, 2759).
+-define(wxSetCursorEvent_GetY, 2760).
+-define(wxSetCursorEvent_HasCursor, 2761).
+-define(wxSetCursorEvent_SetCursor, 2762).
+-define(wxKeyEvent_AltDown, 2763).
+-define(wxKeyEvent_CmdDown, 2764).
+-define(wxKeyEvent_ControlDown, 2765).
+-define(wxKeyEvent_GetKeyCode, 2766).
+-define(wxKeyEvent_GetModifiers, 2767).
+-define(wxKeyEvent_GetPosition, 2770).
+-define(wxKeyEvent_GetRawKeyCode, 2771).
+-define(wxKeyEvent_GetRawKeyFlags, 2772).
+-define(wxKeyEvent_GetUnicodeKey, 2773).
+-define(wxKeyEvent_GetX, 2774).
+-define(wxKeyEvent_GetY, 2775).
+-define(wxKeyEvent_HasModifiers, 2776).
+-define(wxKeyEvent_MetaDown, 2777).
+-define(wxKeyEvent_ShiftDown, 2778).
+-define(wxSizeEvent_GetSize, 2779).
+-define(wxMoveEvent_GetPosition, 2780).
+-define(wxEraseEvent_GetDC, 2781).
+-define(wxFocusEvent_GetWindow, 2782).
+-define(wxChildFocusEvent_GetWindow, 2783).
+-define(wxMenuEvent_GetMenu, 2784).
+-define(wxMenuEvent_GetMenuId, 2785).
+-define(wxMenuEvent_IsPopup, 2786).
+-define(wxCloseEvent_CanVeto, 2787).
+-define(wxCloseEvent_GetLoggingOff, 2788).
+-define(wxCloseEvent_SetCanVeto, 2789).
+-define(wxCloseEvent_SetLoggingOff, 2790).
+-define(wxCloseEvent_Veto, 2791).
+-define(wxShowEvent_SetShow, 2792).
+-define(wxShowEvent_GetShow, 2793).
+-define(wxIconizeEvent_Iconized, 2794).
+-define(wxJoystickEvent_ButtonDown, 2795).
+-define(wxJoystickEvent_ButtonIsDown, 2796).
+-define(wxJoystickEvent_ButtonUp, 2797).
+-define(wxJoystickEvent_GetButtonChange, 2798).
+-define(wxJoystickEvent_GetButtonState, 2799).
+-define(wxJoystickEvent_GetJoystick, 2800).
+-define(wxJoystickEvent_GetPosition, 2801).
+-define(wxJoystickEvent_GetZPosition, 2802).
+-define(wxJoystickEvent_IsButton, 2803).
+-define(wxJoystickEvent_IsMove, 2804).
+-define(wxJoystickEvent_IsZMove, 2805).
+-define(wxUpdateUIEvent_CanUpdate, 2806).
+-define(wxUpdateUIEvent_Check, 2807).
+-define(wxUpdateUIEvent_Enable, 2808).
+-define(wxUpdateUIEvent_Show, 2809).
+-define(wxUpdateUIEvent_GetChecked, 2810).
+-define(wxUpdateUIEvent_GetEnabled, 2811).
+-define(wxUpdateUIEvent_GetShown, 2812).
+-define(wxUpdateUIEvent_GetSetChecked, 2813).
+-define(wxUpdateUIEvent_GetSetEnabled, 2814).
+-define(wxUpdateUIEvent_GetSetShown, 2815).
+-define(wxUpdateUIEvent_GetSetText, 2816).
+-define(wxUpdateUIEvent_GetText, 2817).
+-define(wxUpdateUIEvent_GetMode, 2818).
+-define(wxUpdateUIEvent_GetUpdateInterval, 2819).
+-define(wxUpdateUIEvent_ResetUpdateTime, 2820).
+-define(wxUpdateUIEvent_SetMode, 2821).
+-define(wxUpdateUIEvent_SetText, 2822).
+-define(wxUpdateUIEvent_SetUpdateInterval, 2823).
+-define(wxMouseCaptureChangedEvent_GetCapturedWindow, 2824).
+-define(wxPaletteChangedEvent_SetChangedWindow, 2825).
+-define(wxPaletteChangedEvent_GetChangedWindow, 2826).
+-define(wxQueryNewPaletteEvent_SetPaletteRealized, 2827).
+-define(wxQueryNewPaletteEvent_GetPaletteRealized, 2828).
+-define(wxNavigationKeyEvent_GetDirection, 2829).
+-define(wxNavigationKeyEvent_SetDirection, 2830).
+-define(wxNavigationKeyEvent_IsWindowChange, 2831).
+-define(wxNavigationKeyEvent_SetWindowChange, 2832).
+-define(wxNavigationKeyEvent_IsFromTab, 2833).
+-define(wxNavigationKeyEvent_SetFromTab, 2834).
+-define(wxNavigationKeyEvent_GetCurrentFocus, 2835).
+-define(wxNavigationKeyEvent_SetCurrentFocus, 2836).
+-define(wxHelpEvent_GetOrigin, 2837).
+-define(wxHelpEvent_GetPosition, 2838).
+-define(wxHelpEvent_SetOrigin, 2839).
+-define(wxHelpEvent_SetPosition, 2840).
+-define(wxContextMenuEvent_GetPosition, 2841).
+-define(wxContextMenuEvent_SetPosition, 2842).
+-define(wxIdleEvent_CanSend, 2843).
+-define(wxIdleEvent_GetMode, 2844).
+-define(wxIdleEvent_RequestMore, 2845).
+-define(wxIdleEvent_MoreRequested, 2846).
+-define(wxIdleEvent_SetMode, 2847).
+-define(wxGridEvent_AltDown, 2848).
+-define(wxGridEvent_ControlDown, 2849).
+-define(wxGridEvent_GetCol, 2850).
+-define(wxGridEvent_GetPosition, 2851).
+-define(wxGridEvent_GetRow, 2852).
+-define(wxGridEvent_MetaDown, 2853).
+-define(wxGridEvent_Selecting, 2854).
+-define(wxGridEvent_ShiftDown, 2855).
+-define(wxNotifyEvent_Allow, 2856).
+-define(wxNotifyEvent_IsAllowed, 2857).
+-define(wxNotifyEvent_Veto, 2858).
+-define(wxSashEvent_GetEdge, 2859).
+-define(wxSashEvent_GetDragRect, 2860).
+-define(wxSashEvent_GetDragStatus, 2861).
+-define(wxListEvent_GetCacheFrom, 2862).
+-define(wxListEvent_GetCacheTo, 2863).
+-define(wxListEvent_GetKeyCode, 2864).
+-define(wxListEvent_GetIndex, 2865).
+-define(wxListEvent_GetColumn, 2866).
+-define(wxListEvent_GetPoint, 2867).
+-define(wxListEvent_GetLabel, 2868).
+-define(wxListEvent_GetText, 2869).
+-define(wxListEvent_GetImage, 2870).
+-define(wxListEvent_GetData, 2871).
+-define(wxListEvent_GetMask, 2872).
+-define(wxListEvent_GetItem, 2873).
+-define(wxListEvent_IsEditCancelled, 2874).
+-define(wxDateEvent_GetDate, 2875).
+-define(wxCalendarEvent_GetWeekDay, 2876).
+-define(wxFileDirPickerEvent_GetPath, 2877).
+-define(wxColourPickerEvent_GetColour, 2878).
+-define(wxFontPickerEvent_GetFont, 2879).
+-define(wxStyledTextEvent_GetPosition, 2880).
+-define(wxStyledTextEvent_GetKey, 2881).
+-define(wxStyledTextEvent_GetModifiers, 2882).
+-define(wxStyledTextEvent_GetModificationType, 2883).
+-define(wxStyledTextEvent_GetText, 2884).
+-define(wxStyledTextEvent_GetLength, 2885).
+-define(wxStyledTextEvent_GetLinesAdded, 2886).
+-define(wxStyledTextEvent_GetLine, 2887).
+-define(wxStyledTextEvent_GetFoldLevelNow, 2888).
+-define(wxStyledTextEvent_GetFoldLevelPrev, 2889).
+-define(wxStyledTextEvent_GetMargin, 2890).
+-define(wxStyledTextEvent_GetMessage, 2891).
+-define(wxStyledTextEvent_GetWParam, 2892).
+-define(wxStyledTextEvent_GetLParam, 2893).
+-define(wxStyledTextEvent_GetListType, 2894).
+-define(wxStyledTextEvent_GetX, 2895).
+-define(wxStyledTextEvent_GetY, 2896).
+-define(wxStyledTextEvent_GetDragText, 2897).
+-define(wxStyledTextEvent_GetDragAllowMove, 2898).
+-define(wxStyledTextEvent_GetDragResult, 2899).
+-define(wxStyledTextEvent_GetShift, 2900).
+-define(wxStyledTextEvent_GetControl, 2901).
+-define(wxStyledTextEvent_GetAlt, 2902).
+-define(utils_wxGetKeyState, 2903).
+-define(utils_wxGetMousePosition, 2904).
+-define(utils_wxGetMouseState, 2905).
+-define(utils_wxSetDetectableAutoRepeat, 2906).
+-define(utils_wxBell, 2907).
+-define(utils_wxFindMenuItemId, 2908).
+-define(utils_wxGenericFindWindowAtPoint, 2909).
+-define(utils_wxFindWindowAtPoint, 2910).
+-define(utils_wxBeginBusyCursor, 2911).
+-define(utils_wxEndBusyCursor, 2912).
+-define(utils_wxIsBusy, 2913).
+-define(utils_wxShutdown, 2914).
+-define(utils_wxShell, 2915).
+-define(utils_wxLaunchDefaultBrowser, 2916).
+-define(utils_wxGetEmailAddress, 2917).
+-define(utils_wxGetUserId, 2918).
+-define(utils_wxGetHomeDir, 2919).
+-define(utils_wxNewId, 2920).
+-define(utils_wxRegisterId, 2921).
+-define(utils_wxGetCurrentId, 2922).
+-define(utils_wxGetOsDescription, 2923).
+-define(utils_wxIsPlatformLittleEndian, 2924).
+-define(utils_wxIsPlatform64Bit, 2925).
+-define(wxPrintout_new, 2926).
+-define(wxPrintout_destruct, 2927).
+-define(wxPrintout_GetDC, 2928).
+-define(wxPrintout_GetPageSizeMM, 2929).
+-define(wxPrintout_GetPageSizePixels, 2930).
+-define(wxPrintout_GetPaperRectPixels, 2931).
+-define(wxPrintout_GetPPIPrinter, 2932).
+-define(wxPrintout_GetPPIScreen, 2933).
+-define(wxPrintout_GetTitle, 2934).
+-define(wxPrintout_IsPreview, 2935).
+-define(wxPrintout_FitThisSizeToPaper, 2936).
+-define(wxPrintout_FitThisSizeToPage, 2937).
+-define(wxPrintout_FitThisSizeToPageMargins, 2938).
+-define(wxPrintout_MapScreenSizeToPaper, 2939).
+-define(wxPrintout_MapScreenSizeToPage, 2940).
+-define(wxPrintout_MapScreenSizeToPageMargins, 2941).
+-define(wxPrintout_MapScreenSizeToDevice, 2942).
+-define(wxPrintout_GetLogicalPaperRect, 2943).
+-define(wxPrintout_GetLogicalPageRect, 2944).
+-define(wxPrintout_GetLogicalPageMarginsRect, 2945).
+-define(wxPrintout_SetLogicalOrigin, 2946).
+-define(wxPrintout_OffsetLogicalOrigin, 2947).
+-define(wxStyledTextCtrl_new_2, 2948).
+-define(wxStyledTextCtrl_new_0, 2949).
+-define(wxStyledTextCtrl_destruct, 2950).
+-define(wxStyledTextCtrl_Create, 2951).
+-define(wxStyledTextCtrl_AddText, 2952).
+-define(wxStyledTextCtrl_AddStyledText, 2953).
+-define(wxStyledTextCtrl_InsertText, 2954).
+-define(wxStyledTextCtrl_ClearAll, 2955).
+-define(wxStyledTextCtrl_ClearDocumentStyle, 2956).
+-define(wxStyledTextCtrl_GetLength, 2957).
+-define(wxStyledTextCtrl_GetCharAt, 2958).
+-define(wxStyledTextCtrl_GetCurrentPos, 2959).
+-define(wxStyledTextCtrl_GetAnchor, 2960).
+-define(wxStyledTextCtrl_GetStyleAt, 2961).
+-define(wxStyledTextCtrl_Redo, 2962).
+-define(wxStyledTextCtrl_SetUndoCollection, 2963).
+-define(wxStyledTextCtrl_SelectAll, 2964).
+-define(wxStyledTextCtrl_SetSavePoint, 2965).
+-define(wxStyledTextCtrl_GetStyledText, 2966).
+-define(wxStyledTextCtrl_CanRedo, 2967).
+-define(wxStyledTextCtrl_MarkerLineFromHandle, 2968).
+-define(wxStyledTextCtrl_MarkerDeleteHandle, 2969).
+-define(wxStyledTextCtrl_GetUndoCollection, 2970).
+-define(wxStyledTextCtrl_GetViewWhiteSpace, 2971).
+-define(wxStyledTextCtrl_SetViewWhiteSpace, 2972).
+-define(wxStyledTextCtrl_PositionFromPoint, 2973).
+-define(wxStyledTextCtrl_PositionFromPointClose, 2974).
+-define(wxStyledTextCtrl_GotoLine, 2975).
+-define(wxStyledTextCtrl_GotoPos, 2976).
+-define(wxStyledTextCtrl_SetAnchor, 2977).
+-define(wxStyledTextCtrl_GetCurLine, 2978).
+-define(wxStyledTextCtrl_GetEndStyled, 2979).
+-define(wxStyledTextCtrl_ConvertEOLs, 2980).
+-define(wxStyledTextCtrl_GetEOLMode, 2981).
+-define(wxStyledTextCtrl_SetEOLMode, 2982).
+-define(wxStyledTextCtrl_StartStyling, 2983).
+-define(wxStyledTextCtrl_SetStyling, 2984).
+-define(wxStyledTextCtrl_GetBufferedDraw, 2985).
+-define(wxStyledTextCtrl_SetBufferedDraw, 2986).
+-define(wxStyledTextCtrl_SetTabWidth, 2987).
+-define(wxStyledTextCtrl_GetTabWidth, 2988).
+-define(wxStyledTextCtrl_SetCodePage, 2989).
+-define(wxStyledTextCtrl_MarkerDefine, 2990).
+-define(wxStyledTextCtrl_MarkerSetForeground, 2991).
+-define(wxStyledTextCtrl_MarkerSetBackground, 2992).
+-define(wxStyledTextCtrl_MarkerAdd, 2993).
+-define(wxStyledTextCtrl_MarkerDelete, 2994).
+-define(wxStyledTextCtrl_MarkerDeleteAll, 2995).
+-define(wxStyledTextCtrl_MarkerGet, 2996).
+-define(wxStyledTextCtrl_MarkerNext, 2997).
+-define(wxStyledTextCtrl_MarkerPrevious, 2998).
+-define(wxStyledTextCtrl_MarkerDefineBitmap, 2999).
+-define(wxStyledTextCtrl_MarkerAddSet, 3000).
+-define(wxStyledTextCtrl_MarkerSetAlpha, 3001).
+-define(wxStyledTextCtrl_SetMarginType, 3002).
+-define(wxStyledTextCtrl_GetMarginType, 3003).
+-define(wxStyledTextCtrl_SetMarginWidth, 3004).
+-define(wxStyledTextCtrl_GetMarginWidth, 3005).
+-define(wxStyledTextCtrl_SetMarginMask, 3006).
+-define(wxStyledTextCtrl_GetMarginMask, 3007).
+-define(wxStyledTextCtrl_SetMarginSensitive, 3008).
+-define(wxStyledTextCtrl_GetMarginSensitive, 3009).
+-define(wxStyledTextCtrl_StyleClearAll, 3010).
+-define(wxStyledTextCtrl_StyleSetForeground, 3011).
+-define(wxStyledTextCtrl_StyleSetBackground, 3012).
+-define(wxStyledTextCtrl_StyleSetBold, 3013).
+-define(wxStyledTextCtrl_StyleSetItalic, 3014).
+-define(wxStyledTextCtrl_StyleSetSize, 3015).
+-define(wxStyledTextCtrl_StyleSetFaceName, 3016).
+-define(wxStyledTextCtrl_StyleSetEOLFilled, 3017).
+-define(wxStyledTextCtrl_StyleResetDefault, 3018).
+-define(wxStyledTextCtrl_StyleSetUnderline, 3019).
+-define(wxStyledTextCtrl_StyleSetCase, 3020).
+-define(wxStyledTextCtrl_StyleSetHotSpot, 3021).
+-define(wxStyledTextCtrl_SetSelForeground, 3022).
+-define(wxStyledTextCtrl_SetSelBackground, 3023).
+-define(wxStyledTextCtrl_GetSelAlpha, 3024).
+-define(wxStyledTextCtrl_SetSelAlpha, 3025).
+-define(wxStyledTextCtrl_SetCaretForeground, 3026).
+-define(wxStyledTextCtrl_CmdKeyAssign, 3027).
+-define(wxStyledTextCtrl_CmdKeyClear, 3028).
+-define(wxStyledTextCtrl_CmdKeyClearAll, 3029).
+-define(wxStyledTextCtrl_SetStyleBytes, 3030).
+-define(wxStyledTextCtrl_StyleSetVisible, 3031).
+-define(wxStyledTextCtrl_GetCaretPeriod, 3032).
+-define(wxStyledTextCtrl_SetCaretPeriod, 3033).
+-define(wxStyledTextCtrl_SetWordChars, 3034).
+-define(wxStyledTextCtrl_BeginUndoAction, 3035).
+-define(wxStyledTextCtrl_EndUndoAction, 3036).
+-define(wxStyledTextCtrl_IndicatorSetStyle, 3037).
+-define(wxStyledTextCtrl_IndicatorGetStyle, 3038).
+-define(wxStyledTextCtrl_IndicatorSetForeground, 3039).
+-define(wxStyledTextCtrl_IndicatorGetForeground, 3040).
+-define(wxStyledTextCtrl_SetWhitespaceForeground, 3041).
+-define(wxStyledTextCtrl_SetWhitespaceBackground, 3042).
+-define(wxStyledTextCtrl_GetStyleBits, 3043).
+-define(wxStyledTextCtrl_SetLineState, 3044).
+-define(wxStyledTextCtrl_GetLineState, 3045).
+-define(wxStyledTextCtrl_GetMaxLineState, 3046).
+-define(wxStyledTextCtrl_GetCaretLineVisible, 3047).
+-define(wxStyledTextCtrl_SetCaretLineVisible, 3048).
+-define(wxStyledTextCtrl_GetCaretLineBackground, 3049).
+-define(wxStyledTextCtrl_SetCaretLineBackground, 3050).
+-define(wxStyledTextCtrl_AutoCompShow, 3051).
+-define(wxStyledTextCtrl_AutoCompCancel, 3052).
+-define(wxStyledTextCtrl_AutoCompActive, 3053).
+-define(wxStyledTextCtrl_AutoCompPosStart, 3054).
+-define(wxStyledTextCtrl_AutoCompComplete, 3055).
+-define(wxStyledTextCtrl_AutoCompStops, 3056).
+-define(wxStyledTextCtrl_AutoCompSetSeparator, 3057).
+-define(wxStyledTextCtrl_AutoCompGetSeparator, 3058).
+-define(wxStyledTextCtrl_AutoCompSelect, 3059).
+-define(wxStyledTextCtrl_AutoCompSetCancelAtStart, 3060).
+-define(wxStyledTextCtrl_AutoCompGetCancelAtStart, 3061).
+-define(wxStyledTextCtrl_AutoCompSetFillUps, 3062).
+-define(wxStyledTextCtrl_AutoCompSetChooseSingle, 3063).
+-define(wxStyledTextCtrl_AutoCompGetChooseSingle, 3064).
+-define(wxStyledTextCtrl_AutoCompSetIgnoreCase, 3065).
+-define(wxStyledTextCtrl_AutoCompGetIgnoreCase, 3066).
+-define(wxStyledTextCtrl_UserListShow, 3067).
+-define(wxStyledTextCtrl_AutoCompSetAutoHide, 3068).
+-define(wxStyledTextCtrl_AutoCompGetAutoHide, 3069).
+-define(wxStyledTextCtrl_AutoCompSetDropRestOfWord, 3070).
+-define(wxStyledTextCtrl_AutoCompGetDropRestOfWord, 3071).
+-define(wxStyledTextCtrl_RegisterImage, 3072).
+-define(wxStyledTextCtrl_ClearRegisteredImages, 3073).
+-define(wxStyledTextCtrl_AutoCompGetTypeSeparator, 3074).
+-define(wxStyledTextCtrl_AutoCompSetTypeSeparator, 3075).
+-define(wxStyledTextCtrl_AutoCompSetMaxWidth, 3076).
+-define(wxStyledTextCtrl_AutoCompGetMaxWidth, 3077).
+-define(wxStyledTextCtrl_AutoCompSetMaxHeight, 3078).
+-define(wxStyledTextCtrl_AutoCompGetMaxHeight, 3079).
+-define(wxStyledTextCtrl_SetIndent, 3080).
+-define(wxStyledTextCtrl_GetIndent, 3081).
+-define(wxStyledTextCtrl_SetUseTabs, 3082).
+-define(wxStyledTextCtrl_GetUseTabs, 3083).
+-define(wxStyledTextCtrl_SetLineIndentation, 3084).
+-define(wxStyledTextCtrl_GetLineIndentation, 3085).
+-define(wxStyledTextCtrl_GetLineIndentPosition, 3086).
+-define(wxStyledTextCtrl_GetColumn, 3087).
+-define(wxStyledTextCtrl_SetUseHorizontalScrollBar, 3088).
+-define(wxStyledTextCtrl_GetUseHorizontalScrollBar, 3089).
+-define(wxStyledTextCtrl_SetIndentationGuides, 3090).
+-define(wxStyledTextCtrl_GetIndentationGuides, 3091).
+-define(wxStyledTextCtrl_SetHighlightGuide, 3092).
+-define(wxStyledTextCtrl_GetHighlightGuide, 3093).
+-define(wxStyledTextCtrl_GetLineEndPosition, 3094).
+-define(wxStyledTextCtrl_GetCodePage, 3095).
+-define(wxStyledTextCtrl_GetCaretForeground, 3096).
+-define(wxStyledTextCtrl_GetReadOnly, 3097).
+-define(wxStyledTextCtrl_SetCurrentPos, 3098).
+-define(wxStyledTextCtrl_SetSelectionStart, 3099).
+-define(wxStyledTextCtrl_GetSelectionStart, 3100).
+-define(wxStyledTextCtrl_SetSelectionEnd, 3101).
+-define(wxStyledTextCtrl_GetSelectionEnd, 3102).
+-define(wxStyledTextCtrl_SetPrintMagnification, 3103).
+-define(wxStyledTextCtrl_GetPrintMagnification, 3104).
+-define(wxStyledTextCtrl_SetPrintColourMode, 3105).
+-define(wxStyledTextCtrl_GetPrintColourMode, 3106).
+-define(wxStyledTextCtrl_FindText, 3107).
+-define(wxStyledTextCtrl_FormatRange, 3108).
+-define(wxStyledTextCtrl_GetFirstVisibleLine, 3109).
+-define(wxStyledTextCtrl_GetLine, 3110).
+-define(wxStyledTextCtrl_GetLineCount, 3111).
+-define(wxStyledTextCtrl_SetMarginLeft, 3112).
+-define(wxStyledTextCtrl_GetMarginLeft, 3113).
+-define(wxStyledTextCtrl_SetMarginRight, 3114).
+-define(wxStyledTextCtrl_GetMarginRight, 3115).
+-define(wxStyledTextCtrl_GetModify, 3116).
+-define(wxStyledTextCtrl_SetSelection, 3117).
+-define(wxStyledTextCtrl_GetSelectedText, 3118).
+-define(wxStyledTextCtrl_GetTextRange, 3119).
+-define(wxStyledTextCtrl_HideSelection, 3120).
+-define(wxStyledTextCtrl_LineFromPosition, 3121).
+-define(wxStyledTextCtrl_PositionFromLine, 3122).
+-define(wxStyledTextCtrl_LineScroll, 3123).
+-define(wxStyledTextCtrl_EnsureCaretVisible, 3124).
+-define(wxStyledTextCtrl_ReplaceSelection, 3125).
+-define(wxStyledTextCtrl_SetReadOnly, 3126).
+-define(wxStyledTextCtrl_CanPaste, 3127).
+-define(wxStyledTextCtrl_CanUndo, 3128).
+-define(wxStyledTextCtrl_EmptyUndoBuffer, 3129).
+-define(wxStyledTextCtrl_Undo, 3130).
+-define(wxStyledTextCtrl_Cut, 3131).
+-define(wxStyledTextCtrl_Copy, 3132).
+-define(wxStyledTextCtrl_Paste, 3133).
+-define(wxStyledTextCtrl_Clear, 3134).
+-define(wxStyledTextCtrl_SetText, 3135).
+-define(wxStyledTextCtrl_GetText, 3136).
+-define(wxStyledTextCtrl_GetTextLength, 3137).
+-define(wxStyledTextCtrl_GetOvertype, 3138).
+-define(wxStyledTextCtrl_SetCaretWidth, 3139).
+-define(wxStyledTextCtrl_GetCaretWidth, 3140).
+-define(wxStyledTextCtrl_SetTargetStart, 3141).
+-define(wxStyledTextCtrl_GetTargetStart, 3142).
+-define(wxStyledTextCtrl_SetTargetEnd, 3143).
+-define(wxStyledTextCtrl_GetTargetEnd, 3144).
+-define(wxStyledTextCtrl_ReplaceTarget, 3145).
+-define(wxStyledTextCtrl_SearchInTarget, 3146).
+-define(wxStyledTextCtrl_SetSearchFlags, 3147).
+-define(wxStyledTextCtrl_GetSearchFlags, 3148).
+-define(wxStyledTextCtrl_CallTipShow, 3149).
+-define(wxStyledTextCtrl_CallTipCancel, 3150).
+-define(wxStyledTextCtrl_CallTipActive, 3151).
+-define(wxStyledTextCtrl_CallTipPosAtStart, 3152).
+-define(wxStyledTextCtrl_CallTipSetHighlight, 3153).
+-define(wxStyledTextCtrl_CallTipSetBackground, 3154).
+-define(wxStyledTextCtrl_CallTipSetForeground, 3155).
+-define(wxStyledTextCtrl_CallTipSetForegroundHighlight, 3156).
+-define(wxStyledTextCtrl_CallTipUseStyle, 3157).
+-define(wxStyledTextCtrl_VisibleFromDocLine, 3158).
+-define(wxStyledTextCtrl_DocLineFromVisible, 3159).
+-define(wxStyledTextCtrl_WrapCount, 3160).
+-define(wxStyledTextCtrl_SetFoldLevel, 3161).
+-define(wxStyledTextCtrl_GetFoldLevel, 3162).
+-define(wxStyledTextCtrl_GetLastChild, 3163).
+-define(wxStyledTextCtrl_GetFoldParent, 3164).
+-define(wxStyledTextCtrl_ShowLines, 3165).
+-define(wxStyledTextCtrl_HideLines, 3166).
+-define(wxStyledTextCtrl_GetLineVisible, 3167).
+-define(wxStyledTextCtrl_SetFoldExpanded, 3168).
+-define(wxStyledTextCtrl_GetFoldExpanded, 3169).
+-define(wxStyledTextCtrl_ToggleFold, 3170).
+-define(wxStyledTextCtrl_EnsureVisible, 3171).
+-define(wxStyledTextCtrl_SetFoldFlags, 3172).
+-define(wxStyledTextCtrl_EnsureVisibleEnforcePolicy, 3173).
+-define(wxStyledTextCtrl_SetTabIndents, 3174).
+-define(wxStyledTextCtrl_GetTabIndents, 3175).
+-define(wxStyledTextCtrl_SetBackSpaceUnIndents, 3176).
+-define(wxStyledTextCtrl_GetBackSpaceUnIndents, 3177).
+-define(wxStyledTextCtrl_SetMouseDwellTime, 3178).
+-define(wxStyledTextCtrl_GetMouseDwellTime, 3179).
+-define(wxStyledTextCtrl_WordStartPosition, 3180).
+-define(wxStyledTextCtrl_WordEndPosition, 3181).
+-define(wxStyledTextCtrl_SetWrapMode, 3182).
+-define(wxStyledTextCtrl_GetWrapMode, 3183).
+-define(wxStyledTextCtrl_SetWrapVisualFlags, 3184).
+-define(wxStyledTextCtrl_GetWrapVisualFlags, 3185).
+-define(wxStyledTextCtrl_SetWrapVisualFlagsLocation, 3186).
+-define(wxStyledTextCtrl_GetWrapVisualFlagsLocation, 3187).
+-define(wxStyledTextCtrl_SetWrapStartIndent, 3188).
+-define(wxStyledTextCtrl_GetWrapStartIndent, 3189).
+-define(wxStyledTextCtrl_SetLayoutCache, 3190).
+-define(wxStyledTextCtrl_GetLayoutCache, 3191).
+-define(wxStyledTextCtrl_SetScrollWidth, 3192).
+-define(wxStyledTextCtrl_GetScrollWidth, 3193).
+-define(wxStyledTextCtrl_TextWidth, 3194).
+-define(wxStyledTextCtrl_GetEndAtLastLine, 3195).
+-define(wxStyledTextCtrl_TextHeight, 3196).
+-define(wxStyledTextCtrl_SetUseVerticalScrollBar, 3197).
+-define(wxStyledTextCtrl_GetUseVerticalScrollBar, 3198).
+-define(wxStyledTextCtrl_AppendText, 3199).
+-define(wxStyledTextCtrl_GetTwoPhaseDraw, 3200).
+-define(wxStyledTextCtrl_SetTwoPhaseDraw, 3201).
+-define(wxStyledTextCtrl_TargetFromSelection, 3202).
+-define(wxStyledTextCtrl_LinesJoin, 3203).
+-define(wxStyledTextCtrl_LinesSplit, 3204).
+-define(wxStyledTextCtrl_SetFoldMarginColour, 3205).
+-define(wxStyledTextCtrl_SetFoldMarginHiColour, 3206).
+-define(wxStyledTextCtrl_LineDown, 3207).
+-define(wxStyledTextCtrl_LineDownExtend, 3208).
+-define(wxStyledTextCtrl_LineUp, 3209).
+-define(wxStyledTextCtrl_LineUpExtend, 3210).
+-define(wxStyledTextCtrl_CharLeft, 3211).
+-define(wxStyledTextCtrl_CharLeftExtend, 3212).
+-define(wxStyledTextCtrl_CharRight, 3213).
+-define(wxStyledTextCtrl_CharRightExtend, 3214).
+-define(wxStyledTextCtrl_WordLeft, 3215).
+-define(wxStyledTextCtrl_WordLeftExtend, 3216).
+-define(wxStyledTextCtrl_WordRight, 3217).
+-define(wxStyledTextCtrl_WordRightExtend, 3218).
+-define(wxStyledTextCtrl_Home, 3219).
+-define(wxStyledTextCtrl_HomeExtend, 3220).
+-define(wxStyledTextCtrl_LineEnd, 3221).
+-define(wxStyledTextCtrl_LineEndExtend, 3222).
+-define(wxStyledTextCtrl_DocumentStart, 3223).
+-define(wxStyledTextCtrl_DocumentStartExtend, 3224).
+-define(wxStyledTextCtrl_DocumentEnd, 3225).
+-define(wxStyledTextCtrl_DocumentEndExtend, 3226).
+-define(wxStyledTextCtrl_PageUp, 3227).
+-define(wxStyledTextCtrl_PageUpExtend, 3228).
+-define(wxStyledTextCtrl_PageDown, 3229).
+-define(wxStyledTextCtrl_PageDownExtend, 3230).
+-define(wxStyledTextCtrl_EditToggleOvertype, 3231).
+-define(wxStyledTextCtrl_Cancel, 3232).
+-define(wxStyledTextCtrl_DeleteBack, 3233).
+-define(wxStyledTextCtrl_Tab, 3234).
+-define(wxStyledTextCtrl_BackTab, 3235).
+-define(wxStyledTextCtrl_NewLine, 3236).
+-define(wxStyledTextCtrl_FormFeed, 3237).
+-define(wxStyledTextCtrl_VCHome, 3238).
+-define(wxStyledTextCtrl_VCHomeExtend, 3239).
+-define(wxStyledTextCtrl_ZoomIn, 3240).
+-define(wxStyledTextCtrl_ZoomOut, 3241).
+-define(wxStyledTextCtrl_DelWordLeft, 3242).
+-define(wxStyledTextCtrl_DelWordRight, 3243).
+-define(wxStyledTextCtrl_LineCut, 3244).
+-define(wxStyledTextCtrl_LineDelete, 3245).
+-define(wxStyledTextCtrl_LineTranspose, 3246).
+-define(wxStyledTextCtrl_LineDuplicate, 3247).
+-define(wxStyledTextCtrl_LowerCase, 3248).
+-define(wxStyledTextCtrl_UpperCase, 3249).
+-define(wxStyledTextCtrl_LineScrollDown, 3250).
+-define(wxStyledTextCtrl_LineScrollUp, 3251).
+-define(wxStyledTextCtrl_DeleteBackNotLine, 3252).
+-define(wxStyledTextCtrl_HomeDisplay, 3253).
+-define(wxStyledTextCtrl_HomeDisplayExtend, 3254).
+-define(wxStyledTextCtrl_LineEndDisplay, 3255).
+-define(wxStyledTextCtrl_LineEndDisplayExtend, 3256).
+-define(wxStyledTextCtrl_HomeWrapExtend, 3257).
+-define(wxStyledTextCtrl_LineEndWrap, 3258).
+-define(wxStyledTextCtrl_LineEndWrapExtend, 3259).
+-define(wxStyledTextCtrl_VCHomeWrap, 3260).
+-define(wxStyledTextCtrl_VCHomeWrapExtend, 3261).
+-define(wxStyledTextCtrl_LineCopy, 3262).
+-define(wxStyledTextCtrl_MoveCaretInsideView, 3263).
+-define(wxStyledTextCtrl_LineLength, 3264).
+-define(wxStyledTextCtrl_BraceHighlight, 3265).
+-define(wxStyledTextCtrl_BraceBadLight, 3266).
+-define(wxStyledTextCtrl_BraceMatch, 3267).
+-define(wxStyledTextCtrl_GetViewEOL, 3268).
+-define(wxStyledTextCtrl_SetViewEOL, 3269).
+-define(wxStyledTextCtrl_SetModEventMask, 3270).
+-define(wxStyledTextCtrl_GetEdgeColumn, 3271).
+-define(wxStyledTextCtrl_SetEdgeColumn, 3272).
+-define(wxStyledTextCtrl_SetEdgeMode, 3273).
+-define(wxStyledTextCtrl_GetEdgeMode, 3274).
+-define(wxStyledTextCtrl_GetEdgeColour, 3275).
+-define(wxStyledTextCtrl_SetEdgeColour, 3276).
+-define(wxStyledTextCtrl_SearchAnchor, 3277).
+-define(wxStyledTextCtrl_SearchNext, 3278).
+-define(wxStyledTextCtrl_SearchPrev, 3279).
+-define(wxStyledTextCtrl_LinesOnScreen, 3280).
+-define(wxStyledTextCtrl_UsePopUp, 3281).
+-define(wxStyledTextCtrl_SelectionIsRectangle, 3282).
+-define(wxStyledTextCtrl_SetZoom, 3283).
+-define(wxStyledTextCtrl_GetZoom, 3284).
+-define(wxStyledTextCtrl_GetModEventMask, 3285).
+-define(wxStyledTextCtrl_SetSTCFocus, 3286).
+-define(wxStyledTextCtrl_GetSTCFocus, 3287).
+-define(wxStyledTextCtrl_SetStatus, 3288).
+-define(wxStyledTextCtrl_GetStatus, 3289).
+-define(wxStyledTextCtrl_SetMouseDownCaptures, 3290).
+-define(wxStyledTextCtrl_GetMouseDownCaptures, 3291).
+-define(wxStyledTextCtrl_SetSTCCursor, 3292).
+-define(wxStyledTextCtrl_GetSTCCursor, 3293).
+-define(wxStyledTextCtrl_SetControlCharSymbol, 3294).
+-define(wxStyledTextCtrl_GetControlCharSymbol, 3295).
+-define(wxStyledTextCtrl_WordPartLeft, 3296).
+-define(wxStyledTextCtrl_WordPartLeftExtend, 3297).
+-define(wxStyledTextCtrl_WordPartRight, 3298).
+-define(wxStyledTextCtrl_WordPartRightExtend, 3299).
+-define(wxStyledTextCtrl_SetVisiblePolicy, 3300).
+-define(wxStyledTextCtrl_DelLineLeft, 3301).
+-define(wxStyledTextCtrl_DelLineRight, 3302).
+-define(wxStyledTextCtrl_GetXOffset, 3303).
+-define(wxStyledTextCtrl_ChooseCaretX, 3304).
+-define(wxStyledTextCtrl_SetXCaretPolicy, 3305).
+-define(wxStyledTextCtrl_SetYCaretPolicy, 3306).
+-define(wxStyledTextCtrl_GetPrintWrapMode, 3307).
+-define(wxStyledTextCtrl_SetHotspotActiveForeground, 3308).
+-define(wxStyledTextCtrl_SetHotspotActiveBackground, 3309).
+-define(wxStyledTextCtrl_SetHotspotActiveUnderline, 3310).
+-define(wxStyledTextCtrl_SetHotspotSingleLine, 3311).
+-define(wxStyledTextCtrl_ParaDownExtend, 3312).
+-define(wxStyledTextCtrl_ParaUp, 3313).
+-define(wxStyledTextCtrl_ParaUpExtend, 3314).
+-define(wxStyledTextCtrl_PositionBefore, 3315).
+-define(wxStyledTextCtrl_PositionAfter, 3316).
+-define(wxStyledTextCtrl_CopyRange, 3317).
+-define(wxStyledTextCtrl_CopyText, 3318).
+-define(wxStyledTextCtrl_SetSelectionMode, 3319).
+-define(wxStyledTextCtrl_GetSelectionMode, 3320).
+-define(wxStyledTextCtrl_LineDownRectExtend, 3321).
+-define(wxStyledTextCtrl_LineUpRectExtend, 3322).
+-define(wxStyledTextCtrl_CharLeftRectExtend, 3323).
+-define(wxStyledTextCtrl_CharRightRectExtend, 3324).
+-define(wxStyledTextCtrl_HomeRectExtend, 3325).
+-define(wxStyledTextCtrl_VCHomeRectExtend, 3326).
+-define(wxStyledTextCtrl_LineEndRectExtend, 3327).
+-define(wxStyledTextCtrl_PageUpRectExtend, 3328).
+-define(wxStyledTextCtrl_PageDownRectExtend, 3329).
+-define(wxStyledTextCtrl_StutteredPageUp, 3330).
+-define(wxStyledTextCtrl_StutteredPageUpExtend, 3331).
+-define(wxStyledTextCtrl_StutteredPageDown, 3332).
+-define(wxStyledTextCtrl_StutteredPageDownExtend, 3333).
+-define(wxStyledTextCtrl_WordLeftEnd, 3334).
+-define(wxStyledTextCtrl_WordLeftEndExtend, 3335).
+-define(wxStyledTextCtrl_WordRightEnd, 3336).
+-define(wxStyledTextCtrl_WordRightEndExtend, 3337).
+-define(wxStyledTextCtrl_SetWhitespaceChars, 3338).
+-define(wxStyledTextCtrl_SetCharsDefault, 3339).
+-define(wxStyledTextCtrl_AutoCompGetCurrent, 3340).
+-define(wxStyledTextCtrl_Allocate, 3341).
+-define(wxStyledTextCtrl_FindColumn, 3342).
+-define(wxStyledTextCtrl_GetCaretSticky, 3343).
+-define(wxStyledTextCtrl_SetCaretSticky, 3344).
+-define(wxStyledTextCtrl_ToggleCaretSticky, 3345).
+-define(wxStyledTextCtrl_SetPasteConvertEndings, 3346).
+-define(wxStyledTextCtrl_GetPasteConvertEndings, 3347).
+-define(wxStyledTextCtrl_SelectionDuplicate, 3348).
+-define(wxStyledTextCtrl_SetCaretLineBackAlpha, 3349).
+-define(wxStyledTextCtrl_GetCaretLineBackAlpha, 3350).
+-define(wxStyledTextCtrl_StartRecord, 3351).
+-define(wxStyledTextCtrl_StopRecord, 3352).
+-define(wxStyledTextCtrl_SetLexer, 3353).
+-define(wxStyledTextCtrl_GetLexer, 3354).
+-define(wxStyledTextCtrl_Colourise, 3355).
+-define(wxStyledTextCtrl_SetProperty, 3356).
+-define(wxStyledTextCtrl_SetKeyWords, 3357).
+-define(wxStyledTextCtrl_SetLexerLanguage, 3358).
+-define(wxStyledTextCtrl_GetProperty, 3359).
+-define(wxStyledTextCtrl_GetStyleBitsNeeded, 3360).
+-define(wxStyledTextCtrl_GetCurrentLine, 3361).
+-define(wxStyledTextCtrl_StyleSetSpec, 3362).
+-define(wxStyledTextCtrl_StyleSetFont, 3363).
+-define(wxStyledTextCtrl_StyleSetFontAttr, 3364).
+-define(wxStyledTextCtrl_StyleSetCharacterSet, 3365).
+-define(wxStyledTextCtrl_StyleSetFontEncoding, 3366).
+-define(wxStyledTextCtrl_CmdKeyExecute, 3367).
+-define(wxStyledTextCtrl_SetMargins, 3368).
+-define(wxStyledTextCtrl_GetSelection, 3369).
+-define(wxStyledTextCtrl_PointFromPosition, 3370).
+-define(wxStyledTextCtrl_ScrollToLine, 3371).
+-define(wxStyledTextCtrl_ScrollToColumn, 3372).
+-define(wxStyledTextCtrl_SendMsg, 3373).
+-define(wxStyledTextCtrl_SetVScrollBar, 3374).
+-define(wxStyledTextCtrl_SetHScrollBar, 3375).
+-define(wxStyledTextCtrl_GetLastKeydownProcessed, 3376).
+-define(wxStyledTextCtrl_SetLastKeydownProcessed, 3377).
+-define(wxStyledTextCtrl_SaveFile, 3378).
+-define(wxStyledTextCtrl_LoadFile, 3379).
+-define(wxStyledTextCtrl_DoDragOver, 3380).
+-define(wxStyledTextCtrl_DoDropText, 3381).
+-define(wxStyledTextCtrl_GetUseAntiAliasing, 3382).
+-define(wxStyledTextCtrl_AddTextRaw, 3383).
+-define(wxStyledTextCtrl_InsertTextRaw, 3384).
+-define(wxStyledTextCtrl_GetCurLineRaw, 3385).
+-define(wxStyledTextCtrl_GetLineRaw, 3386).
+-define(wxStyledTextCtrl_GetSelectedTextRaw, 3387).
+-define(wxStyledTextCtrl_GetTextRangeRaw, 3388).
+-define(wxStyledTextCtrl_SetTextRaw, 3389).
+-define(wxStyledTextCtrl_GetTextRaw, 3390).
+-define(wxStyledTextCtrl_AppendTextRaw, 3391).
+-define(wxArtProvider_GetBitmap, 3392).
+-define(wxArtProvider_GetIcon, 3393).
+-define(wxTreeEvent_GetKeyCode, 3394).
+-define(wxTreeEvent_GetItem, 3395).
+-define(wxTreeEvent_GetKeyEvent, 3396).
+-define(wxTreeEvent_GetLabel, 3397).
+-define(wxTreeEvent_GetOldItem, 3398).
+-define(wxTreeEvent_GetPoint, 3399).
+-define(wxTreeEvent_IsEditCancelled, 3400).
+-define(wxTreeEvent_SetToolTip, 3401).
+-define(wxNotebookEvent_GetOldSelection, 3402).
+-define(wxNotebookEvent_GetSelection, 3403).
+-define(wxNotebookEvent_SetOldSelection, 3404).
+-define(wxNotebookEvent_SetSelection, 3405).
+-define(wxFileDataObject_new, 3406).
+-define(wxFileDataObject_AddFile, 3407).
+-define(wxFileDataObject_GetFilenames, 3408).
+-define(wxFileDataObject_destroy, 3409).
+-define(wxTextDataObject_new, 3410).
+-define(wxTextDataObject_GetTextLength, 3411).
+-define(wxTextDataObject_GetText, 3412).
+-define(wxTextDataObject_SetText, 3413).
+-define(wxTextDataObject_destroy, 3414).
+-define(wxBitmapDataObject_new_1_1, 3415).
+-define(wxBitmapDataObject_new_1_0, 3416).
+-define(wxBitmapDataObject_GetBitmap, 3417).
+-define(wxBitmapDataObject_SetBitmap, 3418).
+-define(wxBitmapDataObject_destroy, 3419).
+-define(wxClipboard_new, 3421).
+-define(wxClipboard_destruct, 3422).
+-define(wxClipboard_AddData, 3423).
+-define(wxClipboard_Clear, 3424).
+-define(wxClipboard_Close, 3425).
+-define(wxClipboard_Flush, 3426).
+-define(wxClipboard_GetData, 3427).
+-define(wxClipboard_IsOpened, 3428).
+-define(wxClipboard_Open, 3429).
+-define(wxClipboard_SetData, 3430).
+-define(wxClipboard_UsePrimarySelection, 3432).
+-define(wxClipboard_IsSupported, 3433).
+-define(wxClipboard_Get, 3434).
+-define(wxSpinEvent_GetPosition, 3435).
+-define(wxSpinEvent_SetPosition, 3436).
+-define(wxSplitterWindow_new_0, 3437).
+-define(wxSplitterWindow_new_2, 3438).
+-define(wxSplitterWindow_destruct, 3439).
+-define(wxSplitterWindow_Create, 3440).
+-define(wxSplitterWindow_GetMinimumPaneSize, 3441).
+-define(wxSplitterWindow_GetSashGravity, 3442).
+-define(wxSplitterWindow_GetSashPosition, 3443).
+-define(wxSplitterWindow_GetSplitMode, 3444).
+-define(wxSplitterWindow_GetWindow1, 3445).
+-define(wxSplitterWindow_GetWindow2, 3446).
+-define(wxSplitterWindow_Initialize, 3447).
+-define(wxSplitterWindow_IsSplit, 3448).
+-define(wxSplitterWindow_ReplaceWindow, 3449).
+-define(wxSplitterWindow_SetSashGravity, 3450).
+-define(wxSplitterWindow_SetSashPosition, 3451).
+-define(wxSplitterWindow_SetSashSize, 3452).
+-define(wxSplitterWindow_SetMinimumPaneSize, 3453).
+-define(wxSplitterWindow_SetSplitMode, 3454).
+-define(wxSplitterWindow_SplitHorizontally, 3455).
+-define(wxSplitterWindow_SplitVertically, 3456).
+-define(wxSplitterWindow_Unsplit, 3457).
+-define(wxSplitterWindow_UpdateSize, 3458).
+-define(wxSplitterEvent_GetSashPosition, 3459).
+-define(wxSplitterEvent_GetX, 3460).
+-define(wxSplitterEvent_GetY, 3461).
+-define(wxSplitterEvent_GetWindowBeingRemoved, 3462).
+-define(wxSplitterEvent_SetSashPosition, 3463).
+-define(wxHtmlWindow_new_0, 3464).
+-define(wxHtmlWindow_new_2, 3465).
+-define(wxHtmlWindow_AppendToPage, 3466).
+-define(wxHtmlWindow_GetOpenedAnchor, 3467).
+-define(wxHtmlWindow_GetOpenedPage, 3468).
+-define(wxHtmlWindow_GetOpenedPageTitle, 3469).
+-define(wxHtmlWindow_GetRelatedFrame, 3470).
+-define(wxHtmlWindow_HistoryBack, 3471).
+-define(wxHtmlWindow_HistoryCanBack, 3472).
+-define(wxHtmlWindow_HistoryCanForward, 3473).
+-define(wxHtmlWindow_HistoryClear, 3474).
+-define(wxHtmlWindow_HistoryForward, 3475).
+-define(wxHtmlWindow_LoadFile, 3476).
+-define(wxHtmlWindow_LoadPage, 3477).
+-define(wxHtmlWindow_SelectAll, 3478).
+-define(wxHtmlWindow_SelectionToText, 3479).
+-define(wxHtmlWindow_SelectLine, 3480).
+-define(wxHtmlWindow_SelectWord, 3481).
+-define(wxHtmlWindow_SetBorders, 3482).
+-define(wxHtmlWindow_SetFonts, 3483).
+-define(wxHtmlWindow_SetPage, 3484).
+-define(wxHtmlWindow_SetRelatedFrame, 3485).
+-define(wxHtmlWindow_SetRelatedStatusBar, 3486).
+-define(wxHtmlWindow_ToText, 3487).
+-define(wxHtmlWindow_destroy, 3488).
+-define(wxHtmlLinkEvent_GetLinkInfo, 3489).
+-define(wxSystemSettings_GetColour, 3490).
+-define(wxSystemSettings_GetFont, 3491).
+-define(wxSystemSettings_GetMetric, 3492).
+-define(wxSystemSettings_GetScreenType, 3493).
+-define(wxSystemOptions_GetOption, 3494).
+-define(wxSystemOptions_GetOptionInt, 3495).
+-define(wxSystemOptions_HasOption, 3496).
+-define(wxSystemOptions_IsFalse, 3497).
+-define(wxSystemOptions_SetOption_2_1, 3498).
+-define(wxSystemOptions_SetOption_2_0, 3499).
+-define(wxAuiNotebookEvent_SetSelection, 3500).
+-define(wxAuiNotebookEvent_GetSelection, 3501).
+-define(wxAuiNotebookEvent_SetOldSelection, 3502).
+-define(wxAuiNotebookEvent_GetOldSelection, 3503).
+-define(wxAuiNotebookEvent_SetDragSource, 3504).
+-define(wxAuiNotebookEvent_GetDragSource, 3505).
+-define(wxAuiManagerEvent_SetManager, 3506).
+-define(wxAuiManagerEvent_GetManager, 3507).
+-define(wxAuiManagerEvent_SetPane, 3508).
+-define(wxAuiManagerEvent_GetPane, 3509).
+-define(wxAuiManagerEvent_SetButton, 3510).
+-define(wxAuiManagerEvent_GetButton, 3511).
+-define(wxAuiManagerEvent_SetDC, 3512).
+-define(wxAuiManagerEvent_GetDC, 3513).
+-define(wxAuiManagerEvent_Veto, 3514).
+-define(wxAuiManagerEvent_GetVeto, 3515).
+-define(wxAuiManagerEvent_SetCanVeto, 3516).
+-define(wxAuiManagerEvent_CanVeto, 3517).
+-define(wxLogNull_new, 3518).
+-define(wxLogNull_destroy, 3519).
+-define(wxTaskBarIcon_new, 3520).
+-define(wxTaskBarIcon_destruct, 3521).
+-define(wxTaskBarIcon_PopupMenu, 3522).
+-define(wxTaskBarIcon_RemoveIcon, 3523).
+-define(wxTaskBarIcon_SetIcon, 3524).
diff --git a/lib/wx/src/wx.erl b/lib/wx/src/wx.erl
index 9d76f3bc42..7d62305048 100644
--- a/lib/wx/src/wx.erl
+++ b/lib/wx/src/wx.erl
@@ -1,46 +1,46 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2008-2012. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%%-------------------------------------------------------------------
%%% File : wx.erl
%%% Author : Dan Gudmundsson <[email protected]>
-%%% Description :
+%%% Description :
%%%
%%% Created : 22 Feb 2007 by Dan Gudmundsson <[email protected]>
%%%-------------------------------------------------------------------
%% @doc A port of <a href="http://www.wxwidgets.org/">wxWidgets</a>.
-%%
+%%
%% This is the base api of <a href="http://www.wxwidgets.org/">wxWidgets</a>.
-%% This module contains functions for
+%% This module contains functions for
%% starting and stopping the wx-server, as well as other utility functions.
%%
%% wxWidgets is object oriented, and not functional. Thus, in wxErlang a
%% module represents a class, and the object created by this class
%% has an own type, wxCLASS(). This module represents the base
%% class, and all other wxMODULE's are sub-classes of this class.
-%%
-%% Objects of a class are created with wxCLASS:new(...) and destroyed with
+%%
+%% Objects of a class are created with wxCLASS:new(...) and destroyed with
%% wxCLASS:destroy(). Member functions are called with wxCLASS:member(Object, ...)
%% instead of as in C++ Object.member(...).
-%%
+%%
%% Sub class modules inherit (non static) functions from their parents.
%% The inherited functions are not documented in the sub-classes.
-%%
+%%
%% This erlang port of wxWidgets tries to be a one-to-one mapping with
%% the original wxWidgets library. Some things are different though,
%% as the optional arguments use property lists and can be in any
@@ -49,7 +49,7 @@
%%
%% The following classes are implemented directly as erlang types: <br />
%% wxPoint={x,y},wxSize={w,h},wxRect={x,y,w,h},wxColour={r,g,b [,a]},
-%% wxString={@link //stdlib/unicode:charlist()},
+%% wxString={@link //stdlib/unicode:chardata()},
%% wxGBPosition={r,c},wxGBSpan={rs,cs},wxGridCellCoords={r,c}.
%%
%% wxWidgets uses a process specific environment, which is created by
@@ -59,42 +59,50 @@
%%
%% Global (classless) functions are located in the wx_misc module.
-%% @type wxObject(). Opaque object
-%% @type wx_env(). Wx process environment
-%% @type wx_mem(). Wx memory area
-%% @type colour(). A 3 or 4 tuple: {R,G,B,A} or as argument {R,G,B} is also accepted
-%% where each colour channel is a an integer between 0-255.
-%% @type datetime(). {{Year,Month,Day}, {Hour,Minute,Second}} in local timezone.
-%% @type mouseState(). See #wxMouseState{} defined in wx.hrl
-
-
-module(wx).
-export([parent_class/1, new/0, new/1, destroy/0,
get_env/0,set_env/1, debug/1,
batch/1,foreach/2,map/2,foldl/3,foldr/3,
- getObjectType/1, typeCast/2,
+ getObjectType/1, typeCast/2,
null/0, is_null/1]).
-export([create_memory/1, get_memory_bin/1,
retain_memory/1, release_memory/1]).
-
-export([demo/0]).
+-export_type([wx_object/0, wx_env/0, wx_memory/0]).
+-export_type([wx_colour/0, wx_colour4/0, wx_datetime/0,
+ wx_enum/0, wx_wxMouseState/0, wx_wxHtmlLinkInfo/0]).
+
-include("wxe.hrl").
+-include("../include/wx.hrl").
+
+-type wx_object() :: #wx_ref{}. %% Opaque object reference
+-type wx_env() :: #wx_env{}. %% Opaque process environment
+-type wx_memory() :: binary() | #wx_mem{}. %% Opaque memory reference
+
+-type wx_colour4() :: {R::byte(),G::byte(),B::byte(), A::byte()}.
+-type wx_colour() :: {R::byte(),G::byte(),B::byte()} | wx_colour4().
+
+-type wx_datetime() :: {{Year::integer(),Month::integer(),Day::integer()},
+ {Hour::integer(),Minute::integer(),Second::integer()}}. %% In Local Timezone
+
+-type wx_wxMouseState() :: #wxMouseState{}. %% See #wxMouseState{} defined in wx.hrl
+-type wx_enum() :: integer(). %% Constant defined in wx.hrl
+-type wx_wxHtmlLinkInfo() :: #wxHtmlLinkInfo{}.
-%% @hidden
parent_class(_) -> true. %% Let the null pointers be sent down.
-%% @spec () -> wxObject()
%% @doc Starts a wx server.
+-spec new() -> wx_object().
new() ->
new([]).
-%% @spec ([Option]) -> wxObject()
-%% @doc Starts a wx server.
+%% @doc Starts a wx server.
%% Option may be {debug, Level}, see debug/1.
+-spec new([Option]) -> wx_object() when Option :: {debug, list() | atom()}.
new(Options) when is_list(Options) ->
#wx_env{port=Port} = wxe_server:start(),
put(opengl_port, Port),
@@ -102,130 +110,129 @@ new(Options) when is_list(Options) ->
debug(Debug),
null().
-%% @spec () -> ok
%% @doc Stops a wx server.
+-spec destroy() -> ok.
destroy() ->
wxe_server:stop(),
erase(?WXE_IDENTIFIER),
ok.
-%% @spec () -> wx_env()
%% @doc Gets this process's current wx environment.
%% Can be sent to other processes to allow them use this process wx environment.
%% @see set_env/1
+-spec get_env() -> wx_env().
get_env() ->
case get(?WXE_IDENTIFIER) of
undefined -> erlang:error({wxe,unknown_port});
Env = #wx_env{} -> Env
end.
-%% @spec (wx_env()) -> ok
%% @doc Sets the process wx environment, allows this process to use
%% another process wx environment.
+-spec set_env(wx_env()) -> ok.
set_env(#wx_env{sv=Pid, port=Port} = Env) ->
- put(?WXE_IDENTIFIER, Env),
+ put(?WXE_IDENTIFIER, Env),
put(opengl_port, Port),
%% wxe_util:cast(?REGISTER_PID, <<>>),
wxe_server:register_me(Pid),
ok.
-%% @spec () -> wxObject()
%% @doc Returns the null object
+-spec null() -> wx_object().
null() ->
#wx_ref{ref=0, type=wx}.
-%% @spec (wxObject()) -> boolean()
%% @doc Returns true if object is null, false otherwise
+-spec is_null(wx_object()) -> boolean().
is_null(#wx_ref{ref=NULL}) -> NULL =:= 0.
-%% @spec (wxObject()) -> atom()
%% @doc Returns the object type
+-spec getObjectType(wx_object()) -> atom().
getObjectType(#wx_ref{type=Type}) ->
Type.
-%% @spec (wxObject(), atom()) -> wxObject()
%% @doc Casts the object to class NewType.
-%% It is needed when using functions like wxWindow:findWindow/2, which
+%% It is needed when using functions like wxWindow:findWindow/2, which
%% returns a generic wxObject type.
+-spec typeCast(wx_object(), atom()) -> wx_object().
typeCast(Old=#wx_ref{}, NewType) when is_atom(NewType) ->
Old#wx_ref{type=NewType}.
-%% @spec (function()) -> term()
%% @doc Batches all <c>wx</c> commands
%% used in the fun. Improves performance of the command processing by
%% grabbing the wxWidgets thread so that no event processing will be
%% done before the complete batch of commands is invoked.
-%%
+%%
%% @see map/2
%% @see foreach/2
%% @see foldl/3
%% @see foldr/3
+-spec batch(function()) -> term().
batch(Fun) ->
ok = wxe_util:cast(?BATCH_BEGIN, <<>>),
try Fun()
- catch
+ catch
error:W -> erlang:exit({W, erlang:get_stacktrace()});
throw:W -> erlang:throw(W);
exit:W -> erlang:exit(W)
- after
+ after
ok = wxe_util:cast(?BATCH_END, <<>>)
end.
-%% @spec (function(), list()) -> ok
-%% @doc Behaves like {@link //stdlib/lists:foreach/2} but batches wx commands. See {@link batch/1}.
+%% @doc Behaves like {@link //stdlib/lists:foreach/2} but batches wx commands. See {@link batch/1}.
+-spec foreach(function(), list()) -> ok.
foreach(Fun, List) ->
ok = wxe_util:cast(?BATCH_BEGIN, <<>>),
try lists:foreach(Fun, List)
- catch
+ catch
error:W -> erlang:exit({W, erlang:get_stacktrace()});
throw:W -> erlang:throw(W);
exit:W -> erlang:exit(W)
- after
+ after
ok = wxe_util:cast(?BATCH_END, <<>>)
end.
-%% @spec (function(), list()) -> list()
-%% @doc Behaves like {@link //stdlib/lists:map/2} but batches wx commands. See {@link batch/1}.
+%% @doc Behaves like {@link //stdlib/lists:map/2} but batches wx commands. See {@link batch/1}.
+-spec map(function(), list()) -> list().
map(Fun, List) ->
ok = wxe_util:cast(?BATCH_BEGIN, <<>>),
try lists:map(Fun, List)
- catch
+ catch
error:W -> erlang:exit({W, erlang:get_stacktrace()});
throw:W -> erlang:throw(W);
exit:W -> erlang:exit(W)
- after
+ after
ok = wxe_util:cast(?BATCH_END, <<>>)
end.
-%% @spec (function(), term(), list()) -> term()
-%% @doc Behaves like {@link //stdlib/lists:foldl/3} but batches wx commands. See {@link batch/1}.
+%% @doc Behaves like {@link //stdlib/lists:foldl/3} but batches wx commands. See {@link batch/1}.
+-spec foldl(function(), term(), list()) -> term().
foldl(Fun, Acc, List) ->
ok = wxe_util:cast(?BATCH_BEGIN, <<>>),
try lists:foldl(Fun, Acc, List)
- catch
+ catch
error:W -> erlang:exit({W, erlang:get_stacktrace()});
throw:W -> erlang:throw(W);
exit:W -> erlang:exit(W)
- after
+ after
ok = wxe_util:cast(?BATCH_END, <<>>)
end.
-%% @spec (function(), term(), list()) -> term()
-%% @doc Behaves like {@link //stdlib/lists:foldr/3} but batches wx commands. See {@link batch/1}.
+%% @doc Behaves like {@link //stdlib/lists:foldr/3} but batches wx commands. See {@link batch/1}.
+-spec foldr(function(), term(), list()) -> term().
foldr(Fun, Acc, List) ->
ok = wxe_util:cast(?BATCH_BEGIN, <<>>),
try lists:foldr(Fun, Acc, List)
- catch
+ catch
error:W -> erlang:exit({W, erlang:get_stacktrace()});
throw:W -> erlang:throw(W);
exit:W -> erlang:exit(W)
- after
+ after
ok = wxe_util:cast(?BATCH_END, <<>>)
end.
-define(MIN_BIN_SIZE, 64). %% Current emulator min off heap size
-%% @spec (integer()) -> wx_memory()
%% @doc Creates a memory area (of Size in bytes) which can be used by an external library (i.e. opengl).
%% It is up to the client to keep a reference to this object so it does
%% not get garbage collected by erlang while still in use by the external
@@ -233,22 +240,23 @@ foldr(Fun, Acc, List) ->
%%
%% This is far from erlang's intentional usage and can crash the erlang emulator.
%% Use it carefully.
+-spec create_memory(integer()) -> wx_memory().
create_memory(Size) when Size > ?MIN_BIN_SIZE ->
#wx_mem{bin = <<0:(Size*8)>>, size = Size};
create_memory(Size) ->
#wx_mem{bin = <<0:((?MIN_BIN_SIZE+1)*8)>>, size = Size}.
-%% @spec (wx_memory()) -> binary()
%% @doc Returns the memory area as a binary.
+-spec get_memory_bin(wx_memory()) -> binary().
get_memory_bin(#wx_mem{bin=Bin, size=Size}) when Size > ?MIN_BIN_SIZE ->
Bin;
get_memory_bin(#wx_mem{bin=Bin, size=Size}) ->
<<WithCorrectSize:Size/binary, _/binary>> = Bin,
WithCorrectSize.
-%% @spec (wx_memory()) -> ok
%% @doc Saves the memory from deletion until release_memory/1 is called.
%% If release_memory/1 is not called the memory will not be garbage collected.
+-spec retain_memory(wx_memory()) -> ok.
retain_memory(#wx_mem{bin=Bin}) ->
wxe_util:send_bin(Bin),
ok = wxe_util:cast(?WXE_BIN_INCR, <<>>);
@@ -260,30 +268,29 @@ retain_memory(Bin) when is_binary(Bin) ->
wxe_util:send_bin(Bin),
ok = wxe_util:cast(?WXE_BIN_INCR, <<>>).
+-spec release_memory(wx_memory()) -> ok.
release_memory(#wx_mem{bin=Bin}) ->
wxe_util:send_bin(Bin),
ok = wxe_util:cast(?WXE_BIN_DECR, <<>>);
release_memory(Bin) when is_binary(Bin) ->
wxe_util:send_bin(Bin),
ok = wxe_util:cast(?WXE_BIN_DECR, <<>>).
-
-
-
-%% @spec (Level::term()) -> ok
-%% Level = none | verbose | trace | driver | [Level]
-%% @doc Sets debug level. If debug level is verbose or trace
-%% each call is printed on console. If Level is driver each allocated
+%% @doc Sets debug level. If debug level is 'verbose' or 'trace'
+%% each call is printed on console. If Level is 'driver' each allocated
%% object and deletion is printed on the console.
+-spec debug(Level | [Level]) -> ok
+ when Level :: none | verbose | trace | driver | integer().
+
debug(none) -> debug(0);
debug(verbose) -> debug(1);
debug(trace) -> debug(2);
debug(driver) -> debug(16);
debug([]) -> debug(0);
-debug(List) when is_list(List) ->
- {Drv,Erl} =
- lists:foldl(fun(verbose, {Drv,_Erl}) ->
+debug(List) when is_list(List) ->
+ {Drv,Erl} =
+ lists:foldl(fun(verbose, {Drv,_Erl}) ->
{Drv,1};
(trace, {Drv,_Erl}) ->
{Drv,2};
@@ -295,28 +302,29 @@ debug(Level) when is_integer(Level) ->
case get(?WXE_IDENTIFIER) of
undefined -> erlang:error({wxe,unknown_port});
#wx_env{debug=Old} when Old =:= Level -> ok;
- Env = #wx_env{sv=Server, port=Port, debug=Old} ->
- if
+ Env = #wx_env{sv=Server, port=Port, debug=Old} ->
+ if
Old > 16, Level > 16 -> ok;
Old < 16, Level < 16 -> ok;
true ->
erlang:port_call(Port,?WXE_DEBUG_DRIVER, [Level bsr 4])
- end,
+ end,
put(?WXE_IDENTIFIER, Env#wx_env{debug=Level}),
wxe_server:set_debug(Server,Level),
ok
end.
-%% @spec () -> ok
%% @doc Starts a wxErlang demo if examples directory exists and is compiled
+-spec demo() -> ok | {error, atom()}.
demo() ->
Priv = code:priv_dir(wx),
Demo = filename:join([filename:dirname(Priv),examples,demo]),
Mod = list_to_atom("demo"), %% Fool xref tests
case file:set_cwd(Demo) of
- ok ->
- apply(Mod, start, []);
+ ok ->
+ apply(Mod, start, []),
+ ok;
_ ->
{error, no_demo_dir}
end.
-
+
diff --git a/lib/wx/src/wxe_master.erl b/lib/wx/src/wxe_master.erl
index 9efe59054c..ac6e4a56e6 100644
--- a/lib/wx/src/wxe_master.erl
+++ b/lib/wx/src/wxe_master.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -100,17 +100,10 @@ init([]) ->
case catch erlang:system_info(smp_support) of
true -> ok;
_ ->
- error_logger:format("WX ERROR: SMP emulator required", []),
+ error_logger:format("WX ERROR: SMP emulator required (start with erl -smp)", []),
erlang:error(not_smp)
end,
- case catch (erlang:system_info(version) >= "5.6.2") of
- true -> ok;
- _ -> %% Needs to be able to disable FPU exceptions.
- error_logger:format("WX ERROR: OTP R12B-2 or Emulator >= 5.6.2 required", []),
- erlang:error(wrong_version)
- end,
- %% io:format("Loading ~p @ ~p ~n", [DriverName,PrivDir]),
case os:type() of
{win32,_} -> %% Needed for mingwm10.dll
Path = os:getenv("PATH"),
diff --git a/lib/wx/test/Makefile b/lib/wx/test/Makefile
index 333711789f..836885a308 100644
--- a/lib/wx/test/Makefile
+++ b/lib/wx/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2008-2011. All Rights Reserved.
+# Copyright Ericsson AB 2008-2012. 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
@@ -48,23 +48,13 @@ clean:
docs:
-
-# Rules
-ifneq ($(INSIDE_ERLSRC),true)
-
-$(EBIN)/%.beam: $(ESRC)/%.erl
- $(ERLC) -W -bbeam $(ERL_FLAGS) $(ERL_COMPILE_FLAGS) -o$(EBIN) $<
-
-else
RELSYSDIR = $(RELEASE_PATH)/wx_test
include $(ERL_TOP)/make/otp_release_targets.mk
release_spec:
release_tests_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) wx.spec wx.cover wx_test_lib.hrl $(ErlSrc) $(ErlTargets) $(RELSYSDIR)
- $(INSTALL_SCRIPT) wxt $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) wx.spec wx.cover wx_test_lib.hrl $(ErlSrc) $(ErlTargets) "$(RELSYSDIR)"
+ $(INSTALL_SCRIPT) wxt "$(RELSYSDIR)"
release_docs_spec:
-
-endif
diff --git a/lib/wx/test/wx_class_SUITE.erl b/lib/wx/test/wx_class_SUITE.erl
index b75b0cc74e..6ed7243c5b 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -50,7 +50,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[calendarCtrl, treeCtrl, notebook, staticBoxSizer,
clipboard, helpFrame, htmlWindow, listCtrlSort, listCtrlVirtual,
- radioBox, systemSettings].
+ radioBox, systemSettings, taskBarIcon].
groups() ->
[].
@@ -470,3 +470,15 @@ textCtrl(Config) ->
wxTextAttr:destroy(Attr),
wxWindow:show(Frame),
wx_test_lib:wx_destroy(Frame,Config).
+
+taskBarIcon(TestInfo) when is_atom(TestInfo) -> wx_test_lib:tc_info(TestInfo);
+taskBarIcon(Config) ->
+ Wx = wx:new(),
+ Frame = wxFrame:new(Wx, ?wxID_ANY, "Frame"),
+ TBI = wxTaskBarIcon:new(),
+ Icon = wxIcon:new(filename:join(code:priv_dir(debugger), "erlang_bug.png")),
+ wxTaskBarIcon:setIcon(TBI, Icon, [{tooltip, "Testing wxTaskBarIcon"}]),
+ wxWindow:show(Frame),
+ wxTaskBarIcon:connect(TBI, taskbar_left_down, [{callback, fun(Ev,_) -> io:format("Left clicked: ~p~n",[Ev]) end}]),
+ wxTaskBarIcon:connect(TBI, taskbar_right_down, [{callback,fun(Ev,_) -> io:format("Right clicked: ~p~n",[Ev]) end}]),
+ wx_test_lib:wx_destroy(Frame,Config).
diff --git a/lib/wx/vsn.mk b/lib/wx/vsn.mk
index 3f3e9422a8..719eb0daf0 100644
--- a/lib/wx/vsn.mk
+++ b/lib/wx/vsn.mk
@@ -1 +1 @@
-WX_VSN = 0.99.1
+WX_VSN = 0.99.2
diff --git a/lib/xmerl/doc/src/Makefile b/lib/xmerl/doc/src/Makefile
index 100a2feb0a..6f95e30a28 100644
--- a/lib/xmerl/doc/src/Makefile
+++ b/lib/xmerl/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2010. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -161,15 +161,15 @@ info:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
- $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
+ $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
$(INSTALL_DATA) $(HTMLDIR)/* \
- $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(EXAMPLE_FILES) $(HTML_EXAMPLE_FILES) $(HTML_STYLESHEET_FILES) $(RELSYSDIR)/doc/html
- $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
- $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
- $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(EXAMPLE_FILES) $(HTML_EXAMPLE_FILES) $(HTML_STYLESHEET_FILES) "$(RELSYSDIR)/doc/html"
+ $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
+ $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
+ $(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
release_spec:
diff --git a/lib/xmerl/doc/src/notes.xml b/lib/xmerl/doc/src/notes.xml
index 8734bd8771..056097ab2b 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>2011</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -31,6 +31,64 @@
<p>This document describes the changes made to the Xmerl application.</p>
+<section><title>Xmerl 1.3.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p> Fix a continuation bug when a new block of bytes is
+ to be read during parsing of a default declaration. </p>
+ <p>
+ Own Id: OTP-10063 Aux Id: seq12049 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Xmerl 1.3.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Add missing spaces in xmerl doc (Thanks to Ricardo
+ Catalinas Jim�nez)</p>
+ <p>
+ Own Id: OTP-9873</p>
+ </item>
+ <item>
+ <p> Fixed a continuation error in the sax parser and
+ added latin1 as recognized encoding (not only the
+ iso-8859 variants). </p>
+ <p>
+ Own Id: OTP-9961</p>
+ </item>
+ <item>
+ <p> Removed the unused file xmerl_xlink.hrl. Thanks to
+ Vlad Dumitrescu for informing us about it. </p>
+ <p>
+ Own Id: OTP-9965</p>
+ </item>
+ <item>
+ <p> xmerl couldn't handle comments inside a type
+ specification. </p>
+ <p>
+ Own Id: OTP-10023</p>
+ </item>
+ <item>
+ <p> Fix some small errors in the sax parser: error
+ message bug, removal of trailing blanks in DTD element
+ definitions and an documentation error of the startDTD
+ event in xmerl_sax_parser module. </p>
+ <p>
+ Own Id: OTP-10026</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Xmerl 1.3</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/xmerl/doc/src/xmerl_sax_parser.xml b/lib/xmerl/doc/src/xmerl_sax_parser.xml
index 972023622e..eb22711a75 100644
--- a/lib/xmerl/doc/src/xmerl_sax_parser.xml
+++ b/lib/xmerl/doc/src/xmerl_sax_parser.xml
@@ -206,10 +206,15 @@
Report the end of a CDATA section.
</item>
- <tag><c>startDTD</c></tag>
+ <tag><c>{startDTD, Name, PublicId, SystemId}</c></tag>
<item>
Report the start of DTD declarations, it's reporting the start of the DOCTYPE declaration.
If the document has no DOCTYPE declaration, this event will not be sent.
+ <list>
+ <item><c>Name = string()</c></item>
+ <item><c>PublicId = string()</c></item>
+ <item><c>SystemId = string()</c></item>
+ </list>
</item>
<tag><c>endDTD</c></tag>
diff --git a/lib/xmerl/doc/src/xmerl_ug.xmlsrc b/lib/xmerl/doc/src/xmerl_ug.xmlsrc
index 9ef8fbb0b9..8a0805020e 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>2009</year>
+ <year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
diff --git a/lib/xmerl/include/xmerl_xlink.hrl b/lib/xmerl/include/xmerl_xlink.hrl
deleted file mode 100644
index 375e244c23..0000000000
--- a/lib/xmerl/include/xmerl_xlink.hrl
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-%% The following is a brief summary of the element types (columns) on
-%% which the global attributes are allowed:
-%%
-%% simple extended locator arc resource title
-%% type X X X X X X
-%% href X X
-%% role X X X X
-%% title X X X X
-%% show X X X
-%% actuate X X X
-%% from X
-%% to X
-%%
--record(xlink, {
- type, % simple | extended | locator | arc | resource | title
- href,
- role
- title,
- show,
- actuate,
- from,
- to
- }).
diff --git a/lib/xmerl/src/Makefile b/lib/xmerl/src/Makefile
index 7009b50f6c..ce1aa11fba 100644
--- a/lib/xmerl/src/Makefile
+++ b/lib/xmerl/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2009. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -94,7 +94,6 @@ MODULES = $(EDOC_MODULES) \
HRL_FILES = \
../include/xmerl.hrl \
- ../include/xmerl_xlink.hrl \
../include/xmerl_xpath.hrl \
../include/xmerl_xsd.hrl
@@ -215,14 +214,14 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)/ebin
- $(INSTALL_DATA) $(TARGET_FILES) $(RELSYSDIR)/ebin
- $(INSTALL_DIR) $(RELSYSDIR)/src
- $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) $(APP_SRC) $(APPUP_SRC) $(RELSYSDIR)/src
- $(INSTALL_DATA) xmerl_xpath_parse.yrl $(RELSYSDIR)/src
- $(INSTALL_DATA) xmerl_b64Bin.yrl $(RELSYSDIR)/src
- $(INSTALL_DIR) $(RELSYSDIR)/include
- $(INSTALL_DATA) $(HRL_FILES) $(RELSYSDIR)/include
+ $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DATA) $(TARGET_FILES) "$(RELSYSDIR)/ebin"
+ $(INSTALL_DIR) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) $(ERL_FILES) $(INTERNAL_HRL_FILES) $(APP_SRC) $(APPUP_SRC) "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) xmerl_xpath_parse.yrl "$(RELSYSDIR)/src"
+ $(INSTALL_DATA) xmerl_b64Bin.yrl "$(RELSYSDIR)/src"
+ $(INSTALL_DIR) "$(RELSYSDIR)/include"
+ $(INSTALL_DATA) $(HRL_FILES) "$(RELSYSDIR)/include"
release_docs_spec:
diff --git a/lib/xmerl/src/xmerl_sax_parser.erl b/lib/xmerl/src/xmerl_sax_parser.erl
index 45e2a928ac..5c006aada2 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -217,7 +217,7 @@ check_encoding_option(E) when E==utf8; E=={utf16,little}; E=={utf16,big};
check_encoding_option(utf16) ->
{utf16,big};
check_encoding_option(E) ->
- {error, io_lib:format("Charcter set ~p not supported", [E])}.
+ {error, io_lib:format("Character set ~p not supported", [E])}.
%%----------------------------------------------------------------------
%% Function: detect_charset(Xml, State)
@@ -279,6 +279,7 @@ convert_encoding(Enc) -> %% Just for 7,8 bit + utf8
case string:to_lower(Enc) of
"utf-8" -> utf8;
"us-ascii" -> utf8;
+ "latin1" -> latin1;
"iso-8859-1" -> latin1; % Handle all iso-8859 as latin1
"iso-8859-2" -> latin1;
"iso-8859-3" -> latin1;
diff --git a/lib/xmerl/src/xmerl_sax_parser_base.erlsrc b/lib/xmerl/src/xmerl_sax_parser_base.erlsrc
index c25cde0472..7b64d7c302 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-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2012. 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
@@ -39,6 +39,9 @@
%% Internal exports
%%----------------------------------------------------------------------
-export([
+ cf/3,
+ cf/4,
+ cf/5
]).
%%----------------------------------------------------------------------
@@ -152,16 +155,16 @@ parse_xml_decl(?BYTE_ORDER_MARK_2, State) ->
cf(?BYTE_ORDER_MARK_2, State, fun parse_xml_decl/2);
parse_xml_decl(?BYTE_ORDER_MARK_REST(Rest), State) ->
cf(Rest, State, fun parse_xml_decl/2);
-parse_xml_decl(?STRING("<"), State) ->
- cf(?STRING("<"), State, fun parse_xml_decl/2);
-parse_xml_decl(?STRING("<?"), State) ->
- cf(?STRING("<?"), State, fun parse_xml_decl/2);
-parse_xml_decl(?STRING("<?x"), State) ->
- cf(?STRING("<?x"), State, fun parse_xml_decl/2);
-parse_xml_decl(?STRING("<?xm"), State) ->
- cf(?STRING("<?xm"), State, fun parse_xml_decl/2);
-parse_xml_decl(?STRING("<?xml"), State) ->
- cf(?STRING("<?xml"), State, fun parse_xml_decl/2);
+parse_xml_decl(?STRING("<") = Bytes, State) ->
+ cf(Bytes, State, fun parse_xml_decl/2);
+parse_xml_decl(?STRING("<?") = Bytes, State) ->
+ cf(Bytes, State, fun parse_xml_decl/2);
+parse_xml_decl(?STRING("<?x") = Bytes, State) ->
+ cf(Bytes, State, fun parse_xml_decl/2);
+parse_xml_decl(?STRING("<?xm") = Bytes, State) ->
+ cf(Bytes, State, fun parse_xml_decl/2);
+parse_xml_decl(?STRING("<?xml") = Bytes, State) ->
+ cf(Bytes, State, fun parse_xml_decl/2);
parse_xml_decl(?STRING_REST("<?xml", Rest1), State) ->
parse_xml_decl_1(Rest1, State);
parse_xml_decl(Bytes, #xmerl_sax_parser_state{encoding=Enc} = State) when is_binary(Bytes) ->
@@ -201,8 +204,8 @@ parse_xml_decl_1(Bytes, State) ->
%%----------------------------------------------------------------------
parse_prolog(?STRING_EMPTY, State) ->
cf(?STRING_EMPTY, State, fun parse_prolog/2);
-parse_prolog(?STRING("<"), State) ->
- cf(?STRING("<"), State, fun parse_prolog/2);
+parse_prolog(?STRING("<") = Bytes, State) ->
+ cf(Bytes, State, fun parse_prolog/2);
parse_prolog(?STRING_REST("<?", Rest), State) ->
{Rest1, State1} = parse_pi(Rest, State),
parse_prolog(Rest1, State1);
@@ -220,18 +223,18 @@ parse_prolog(Bytes, State) ->
parse_prolog_1(?STRING_EMPTY, State) ->
cf(?STRING_EMPTY, State, fun parse_prolog_1/2);
-parse_prolog_1(?STRING("D"), State) ->
- cf(?STRING("D"), State, fun parse_prolog_1/2);
-parse_prolog_1(?STRING("DO"), State) ->
- cf(?STRING("DO"), State, fun parse_prolog_1/2);
-parse_prolog_1(?STRING("DOC"), State) ->
- cf(?STRING("DOC"), State, fun parse_prolog_1/2);
-parse_prolog_1(?STRING("DOCT"), State) ->
- cf(?STRING("DOCT"), State, fun parse_prolog_1/2);
-parse_prolog_1(?STRING("DOCTY"), State) ->
- cf(?STRING("DOCTY"), State, fun parse_prolog_1/2);
-parse_prolog_1(?STRING("DOCTYP"), State) ->
- cf(?STRING("DOCTYP"), State, fun parse_prolog_1/2);
+parse_prolog_1(?STRING("D") = Bytes, State) ->
+ cf(Bytes, State, fun parse_prolog_1/2);
+parse_prolog_1(?STRING("DO") = Bytes, State) ->
+ cf(Bytes, State, fun parse_prolog_1/2);
+parse_prolog_1(?STRING("DOC") = Bytes, State) ->
+ cf(Bytes, State, fun parse_prolog_1/2);
+parse_prolog_1(?STRING("DOCT") = Bytes, State) ->
+ cf(Bytes, State, fun parse_prolog_1/2);
+parse_prolog_1(?STRING("DOCTY") = Bytes, State) ->
+ cf(Bytes, State, fun parse_prolog_1/2);
+parse_prolog_1(?STRING("DOCTYP") = Bytes, State) ->
+ cf(Bytes, State, fun parse_prolog_1/2);
parse_prolog_1(?STRING_REST("DOCTYPE", Rest), State) ->
{Rest1, State1} = parse_doctype(Rest, State),
State2 = event_callback(endDTD, State1),
@@ -509,10 +512,10 @@ parse_ns_name(Bytes, State, Prefix, Name) ->
%%----------------------------------------------------------------------
parse_pi_data(?STRING_EMPTY, State, Acc) ->
cf(?STRING_EMPTY, State, Acc, fun parse_pi_data/3);
-parse_pi_data(?STRING("?"), State, Acc) ->
- cf(?STRING("?"), State, Acc, fun parse_pi_data/3);
-parse_pi_data(?STRING("\r"), State, Acc) ->
- cf(?STRING("\r"), State, Acc, fun parse_pi_data/3);
+parse_pi_data(?STRING("?") = Bytes, State, Acc) ->
+ cf(Bytes, State, Acc, fun parse_pi_data/3);
+parse_pi_data(?STRING("\r") = Bytes, State, Acc) ->
+ cf(Bytes, State, Acc, fun parse_pi_data/3);
parse_pi_data(?STRING_REST("?>", Rest), State, Acc) ->
{lists:reverse(Acc), Rest, State};
parse_pi_data(?STRING_REST("\n", Rest), #xmerl_sax_parser_state{line_no=N} = State, Acc) ->
@@ -541,23 +544,23 @@ parse_pi_data(Bytes, State, Acc) ->
%%----------------------------------------------------------------------
parse_cdata(?STRING_EMPTY, State) ->
cf(?STRING_EMPTY, State, fun parse_cdata/2);
-parse_cdata(?STRING("["), State) ->
- cf(?STRING("["), State, fun parse_cdata/2);
-parse_cdata(?STRING("[C"), State) ->
- cf(?STRING("[C"), State, fun parse_cdata/2);
-parse_cdata(?STRING("[CD"), State) ->
- cf(?STRING("[CD"), State, fun parse_cdata/2);
-parse_cdata(?STRING("[CDA"), State) ->
- cf(?STRING("[CDA"), State, fun parse_cdata/2);
-parse_cdata(?STRING("[CDAT"), State) ->
- cf(?STRING("[CDAT"), State, fun parse_cdata/2);
-parse_cdata(?STRING("[CDATA"), State) ->
- cf(?STRING("[CDATA"), State, fun parse_cdata/2);
-parse_cdata(?STRING_REST("[CDATA[", Rest), State) ->
- State1 = event_callback(startCDATA, State),
+parse_cdata(?STRING("[") = Bytes, State) ->
+ cf(Bytes, State, fun parse_cdata/2);
+parse_cdata(?STRING("[C") = Bytes, State) ->
+ cf(Bytes, State, fun parse_cdata/2);
+parse_cdata(?STRING("[CD") = Bytes, State) ->
+ cf(Bytes, State, fun parse_cdata/2);
+parse_cdata(?STRING("[CDA") = Bytes, State) ->
+ cf(Bytes, State, fun parse_cdata/2);
+parse_cdata(?STRING("[CDAT") = Bytes, State) ->
+ cf(Bytes, State, fun parse_cdata/2);
+parse_cdata(?STRING("[CDATA") = Bytes, State) ->
+ cf(Bytes, State, fun parse_cdata/2);
+parse_cdata(?STRING_REST("[CDATA[", Rest), State) ->
+ State1 = event_callback(startCDATA, State),
parse_cdata(Rest, State1, []);
-parse_cdata(Bytes, State) ->
- unicode_incomplete_check([Bytes, State, fun parse_cdata/2],
+parse_cdata(Bytes, State) ->
+ unicode_incomplete_check([Bytes, State, fun parse_cdata/2],
"expecting comment or CDATA").
@@ -571,12 +574,12 @@ parse_cdata(Bytes, State) ->
%%----------------------------------------------------------------------
parse_cdata(?STRING_EMPTY, State, Acc) ->
cf(?STRING_EMPTY, State, Acc, fun parse_cdata/3);
-parse_cdata(?STRING("\r"), State, Acc) ->
- cf(?STRING("\r"), State, Acc, fun parse_cdata/3);
-parse_cdata(?STRING("]"), State, Acc) ->
- cf(?STRING("]"), State, Acc, fun parse_cdata/3);
-parse_cdata(?STRING("]]"), State, Acc) ->
- cf(?STRING("]]"), State, Acc, fun parse_cdata/3);
+parse_cdata(?STRING("\r") = Bytes, State, Acc) ->
+ cf(Bytes, State, Acc, fun parse_cdata/3);
+parse_cdata(?STRING("]") = Bytes, State, Acc) ->
+ cf(Bytes, State, Acc, fun parse_cdata/3);
+parse_cdata(?STRING("]]") = Bytes, State, Acc) ->
+ cf(Bytes, State, Acc, fun parse_cdata/3);
parse_cdata(?STRING_REST("]]>", Rest), State, Acc) ->
State1 = event_callback({characters, lists:reverse(Acc)}, State),
State2 = event_callback(endCDATA, State1),
@@ -607,12 +610,12 @@ parse_cdata(Bytes, State, Acc) ->
%%----------------------------------------------------------------------
parse_comment(?STRING_EMPTY, State, Acc) ->
cf(?STRING_EMPTY, State, Acc, fun parse_comment/3);
-parse_comment(?STRING("\r"), State, Acc) ->
- cf(?STRING("\r"), State, Acc, fun parse_comment/3);
-parse_comment(?STRING("-"), State, Acc) ->
- cf(?STRING("-"), State, Acc, fun parse_comment/3);
-parse_comment(?STRING("--"), State, Acc) ->
- cf(?STRING("--"), State, Acc, fun parse_comment/3);
+parse_comment(?STRING("\r") = Bytes, State, Acc) ->
+ cf(Bytes, State, Acc, fun parse_comment/3);
+parse_comment(?STRING("-") = Bytes, State, Acc) ->
+ cf(Bytes, State, Acc, fun parse_comment/3);
+parse_comment(?STRING("--") = Bytes, State, Acc) ->
+ cf(Bytes, State, Acc, fun parse_comment/3);
parse_comment(?STRING_REST("-->", Rest), State, Acc) ->
State1 = event_callback({comment, lists:reverse(Acc)}, State),
{Rest, State1};
@@ -710,8 +713,8 @@ parse_stag(Bytes, State) ->
%%----------------------------------------------------------------------
parse_attributes(?STRING_EMPTY, State, CurrentTag) ->
cf(?STRING_EMPTY, State, CurrentTag, fun parse_attributes/3);
-parse_attributes(?STRING("/"), State, CurrentTag) ->
- cf(?STRING("/"), State, CurrentTag, fun parse_attributes/3);
+parse_attributes(?STRING("/") = Bytes, State, CurrentTag) ->
+ cf(Bytes, State, CurrentTag, fun parse_attributes/3);
parse_attributes(?STRING_REST("/>", Rest), State, {Tag, AttList, NewNsList}) ->
CompleteNsList = NewNsList ++ State#xmerl_sax_parser_state.ns,
{Uri, LocalName, QName, Attributes} = fix_ns(Tag, AttList, CompleteNsList),
@@ -759,7 +762,7 @@ parse_attributes(?STRING_UNBOUND_REST(C, Rest), State, {Tag, AttList, NsList}) -
end
end;
false ->
- ?fatal_error(State, "Invalid start character in attribute name: " ++ C)
+ ?fatal_error(State, "Invalid start character in attribute name: " ++ [C])
end;
parse_attributes(Bytes, State, CurrentTag) ->
unicode_incomplete_check([Bytes, State, CurrentTag, fun parse_attributes/3],
@@ -908,20 +911,20 @@ parse_att_value(?STRING_EMPTY, State, undefined, Acc) ->
{Acc, [], State}; %% stop clause when parsing references
parse_att_value(?STRING_EMPTY, State, Stop, Acc) ->
cf(?STRING_EMPTY, State, Stop, Acc, fun parse_att_value/4);
-parse_att_value(?STRING("\r"), State, Stop, Acc) ->
- cf(?STRING("\r"), State, Stop, Acc, fun parse_att_value/4);
+parse_att_value(?STRING("\r") = Bytes, State, Stop, Acc) ->
+ cf(Bytes, State, Stop, Acc, fun parse_att_value/4);
parse_att_value(?STRING_REST("\n", Rest), #xmerl_sax_parser_state{line_no=N} = State, Stop, Acc) ->
parse_att_value(Rest,
- State#xmerl_sax_parser_state{line_no=N+1}, Stop, [?space |Acc]);
+ State#xmerl_sax_parser_state{line_no=N+1}, Stop, [?space |Acc]);
parse_att_value(?STRING_REST("\r\n", Rest), #xmerl_sax_parser_state{line_no=N} = State, Stop, Acc) ->
parse_att_value(Rest,
- State#xmerl_sax_parser_state{line_no=N+1}, Stop, [?space |Acc]);
+ State#xmerl_sax_parser_state{line_no=N+1}, Stop, [?space |Acc]);
parse_att_value(?STRING_REST("\r", Rest), #xmerl_sax_parser_state{line_no=N} = State, Stop, Acc) ->
parse_att_value(Rest,
- State#xmerl_sax_parser_state{line_no=N+1}, Stop, [?space |Acc]);
+ State#xmerl_sax_parser_state{line_no=N+1}, Stop, [?space |Acc]);
parse_att_value(?STRING_REST("\t", Rest), #xmerl_sax_parser_state{line_no=N} = State, Stop, Acc) ->
parse_att_value(Rest,
- State#xmerl_sax_parser_state{line_no=N+1}, Stop, [?space |Acc]);
+ State#xmerl_sax_parser_state{line_no=N+1}, Stop, [?space |Acc]);
parse_att_value(?STRING_REST("&", Rest), State, Stop, Acc) ->
{Ref, Rest1, State1} = parse_reference(Rest, State, true),
case Ref of
@@ -1043,17 +1046,17 @@ parse_content(?STRING_EMPTY, State, Acc, IgnorableWS) ->
Other ->
throw(Other)
end;
-parse_content(?STRING("\r"), State, Acc, IgnorableWS) ->
- cf(?STRING("\r"), State, Acc, IgnorableWS, fun parse_content/4);
-parse_content(?STRING("<"), State, Acc, IgnorableWS) ->
- cf(?STRING("<"), State, Acc, IgnorableWS, fun parse_content/4);
+parse_content(?STRING("\r") = Bytes, State, Acc, IgnorableWS) ->
+ cf(Bytes, State, Acc, IgnorableWS, fun parse_content/4);
+parse_content(?STRING("<") = Bytes, State, Acc, IgnorableWS) ->
+ cf(Bytes, State, Acc, IgnorableWS, fun parse_content/4);
parse_content(?STRING_REST("</", Rest), State, Acc, IgnorableWS) ->
State1 = send_character_event(length(Acc), IgnorableWS, lists:reverse(Acc), State),
parse_etag(Rest, State1);
-parse_content(?STRING("<!"), State, _Acc, IgnorableWS) ->
- cf(?STRING("<!"), State, [], IgnorableWS, fun parse_content/4);
-parse_content(?STRING("<!-"), State, _Acc, IgnorableWS) ->
- cf(?STRING("<!-"), State, [], IgnorableWS, fun parse_content/4);
+parse_content(?STRING("<!") = Bytes, State, _Acc, IgnorableWS) ->
+ cf(Bytes, State, [], IgnorableWS, fun parse_content/4);
+parse_content(?STRING("<!-") = Bytes, State, _Acc, IgnorableWS) ->
+ cf(Bytes, State, [], IgnorableWS, fun parse_content/4);
parse_content(?STRING_REST("<!--", Rest), State, Acc, IgnorableWS) ->
State1 = send_character_event(length(Acc), IgnorableWS, lists:reverse(Acc), State),
{Rest1, State2} = parse_comment(Rest, State1, []),
@@ -1224,8 +1227,8 @@ whitespace(Bytes, #xmerl_sax_parser_state{encoding=Enc} = State, Acc) when is_bi
%%----------------------------------------------------------------------
parse_reference(?STRING_EMPTY, State, HaveToExist) ->
cf(?STRING_EMPTY, State, HaveToExist, fun parse_reference/3);
-parse_reference(?STRING("#"), State, HaveToExist) ->
- cf(?STRING("#"), State, HaveToExist, fun parse_reference/3);
+parse_reference(?STRING("#") = Bytes, State, HaveToExist) ->
+ cf(Bytes, State, HaveToExist, fun parse_reference/3);
parse_reference(?STRING_REST("#x", Rest), State, _HaveToExist) ->
{CharValue, RefString, Rest1, State1} = parse_hex(Rest, State, []),
if
@@ -1699,16 +1702,16 @@ parse_external_entity_1(?BYTE_ORDER_MARK_2, State) ->
cf(?BYTE_ORDER_MARK_2, State, fun parse_external_entity_1/2);
parse_external_entity_1(?BYTE_ORDER_MARK_REST(Rest), State) ->
parse_external_entity_1(Rest, State);
-parse_external_entity_1(?STRING("<"), State) ->
- cf(?STRING("<"), State, fun parse_external_entity_1/2);
-parse_external_entity_1(?STRING("<?"), State) ->
- cf(?STRING("<?"), State, fun parse_external_entity_1/2);
-parse_external_entity_1(?STRING("<?x"), State) ->
- cf(?STRING("<?x"), State, fun parse_external_entity_1/2);
-parse_external_entity_1(?STRING("<?xm"), State) ->
- cf(?STRING("<?xm"), State, fun parse_external_entity_1/2);
-parse_external_entity_1(?STRING("<?xml"), State) ->
- cf(?STRING("<?xml"), State, fun parse_external_entity_1/2);
+parse_external_entity_1(?STRING("<") = Bytes, State) ->
+ cf(Bytes, State, fun parse_external_entity_1/2);
+parse_external_entity_1(?STRING("<?") = Bytes, State) ->
+ cf(Bytes, State, fun parse_external_entity_1/2);
+parse_external_entity_1(?STRING("<?x") = Bytes, State) ->
+ cf(Bytes, State, fun parse_external_entity_1/2);
+parse_external_entity_1(?STRING("<?xm") = Bytes, State) ->
+ cf(Bytes, State, fun parse_external_entity_1/2);
+parse_external_entity_1(?STRING("<?xml") = Bytes, State) ->
+ cf(Bytes, State, fun parse_external_entity_1/2);
parse_external_entity_1(?STRING_REST("<?xml", Rest) = Bytes,
#xmerl_sax_parser_state{file_type=Type} = State) ->
{Rest1, State1} =
@@ -1778,29 +1781,29 @@ is_next_char_whitespace(Bytes, State) ->
%%----------------------------------------------------------------------
parse_external_id(?STRING_EMPTY, State, OptionalSystemId) ->
cf(?STRING_EMPTY, State, OptionalSystemId, fun parse_external_id/3);
-parse_external_id(?STRING("S"), State,OptionalSystemId) ->
- cf(?STRING("S"), State, OptionalSystemId, fun parse_external_id/3);
-parse_external_id(?STRING("SY"), State, OptionalSystemId) ->
- cf(?STRING("SY"), State, OptionalSystemId, fun parse_external_id/3);
-parse_external_id(?STRING("SYS"), State, OptionalSystemId) ->
- cf(?STRING("SYS"), State, OptionalSystemId, fun parse_external_id/3);
-parse_external_id(?STRING("SYST"), State, OptionalSystemId) ->
- cf(?STRING("SYST"), State, OptionalSystemId, fun parse_external_id/3);
-parse_external_id(?STRING("SYSTE"), State, OptionalSystemId) ->
- cf(?STRING("SYSTE"), State, OptionalSystemId, fun parse_external_id/3);
+parse_external_id(?STRING("S") = Bytes, State,OptionalSystemId) ->
+ cf(Bytes, State, OptionalSystemId, fun parse_external_id/3);
+parse_external_id(?STRING("SY") = Bytes, State, OptionalSystemId) ->
+ cf(Bytes, State, OptionalSystemId, fun parse_external_id/3);
+parse_external_id(?STRING("SYS") = Bytes, State, OptionalSystemId) ->
+ cf(Bytes, State, OptionalSystemId, fun parse_external_id/3);
+parse_external_id(?STRING("SYST") = Bytes, State, OptionalSystemId) ->
+ cf(Bytes, State, OptionalSystemId, fun parse_external_id/3);
+parse_external_id(?STRING("SYSTE") = Bytes, State, OptionalSystemId) ->
+ cf(Bytes, State, OptionalSystemId, fun parse_external_id/3);
parse_external_id(?STRING_REST("SYSTEM", Rest), State, _) ->
{SysId, Rest1, State1} = parse_system_id(Rest, State, false),
{"", SysId, Rest1, State1};
-parse_external_id(?STRING("P"), State, OptionalSystemId) ->
- cf(?STRING("P"), State, OptionalSystemId, fun parse_external_id/3);
-parse_external_id(?STRING("PU"), State, OptionalSystemId) ->
- cf(?STRING("PU"), State, OptionalSystemId, fun parse_external_id/3);
-parse_external_id(?STRING("PUB"), State, OptionalSystemId) ->
- cf(?STRING("PUB"), State, OptionalSystemId, fun parse_external_id/3);
-parse_external_id(?STRING("PUBL"), State, OptionalSystemId) ->
- cf(?STRING("PUBL"), State, OptionalSystemId, fun parse_external_id/3);
-parse_external_id(?STRING("PUBLI"), State, OptionalSystemId) ->
- cf(?STRING("PUBLI"), State, OptionalSystemId, fun parse_external_id/3);
+parse_external_id(?STRING("P") = Bytes, State, OptionalSystemId) ->
+ cf(Bytes, State, OptionalSystemId, fun parse_external_id/3);
+parse_external_id(?STRING("PU") = Bytes, State, OptionalSystemId) ->
+ cf(Bytes, State, OptionalSystemId, fun parse_external_id/3);
+parse_external_id(?STRING("PUB") = Bytes, State, OptionalSystemId) ->
+ cf(Bytes, State, OptionalSystemId, fun parse_external_id/3);
+parse_external_id(?STRING("PUBL") = Bytes, State, OptionalSystemId) ->
+ cf(Bytes, State, OptionalSystemId, fun parse_external_id/3);
+parse_external_id(?STRING("PUBLI") = Bytes, State, OptionalSystemId) ->
+ cf(Bytes, State, OptionalSystemId, fun parse_external_id/3);
parse_external_id(?STRING_REST("PUBLIC", Rest), State, OptionalSystemId) ->
parse_public_id(Rest, State, OptionalSystemId);
parse_external_id(Bytes, State, OptionalSystemId) ->
@@ -1920,70 +1923,70 @@ parse_doctype_decl(Bytes, State) ->
parse_doctype_decl_1(?STRING_EMPTY, State) ->
cf(?STRING_EMPTY, State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("E"), State) ->
- cf(?STRING("E"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("EL"), State) ->
- cf(?STRING("EL"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("ELE"), State) ->
- cf(?STRING("ELE"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("ELEM"), State) ->
- cf(?STRING("ELEM"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("ELEME"), State) ->
- cf(?STRING("ELEME"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("ELEMEN"), State) ->
- cf(?STRING("ELEMEN"), State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("E") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("EL") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("ELE") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("ELEM") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("ELEME") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("ELEMEN") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
parse_doctype_decl_1(?STRING_REST("ELEMENT", Rest), State) ->
{Rest1, State1} = parse_element_decl(Rest, State),
parse_doctype_decl(Rest1, State1);
-parse_doctype_decl_1(?STRING("A"), State) ->
- cf(?STRING("A"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("AT"), State) ->
- cf(?STRING("AT"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("ATT"), State) ->
- cf(?STRING("ATT"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("ATTL"), State) ->
- cf(?STRING("ATTL"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("ATTLI"), State) ->
- cf(?STRING("ATTLI"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("ATTLIS"), State) ->
- cf(?STRING("ATTLIS"), State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("A") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("AT") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("ATT") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("ATTL") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("ATTLI") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("ATTLIS") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
parse_doctype_decl_1(?STRING_REST("ATTLIST", Rest), State) ->
{Rest1, State1} = parse_att_list_decl(Rest, State),
parse_doctype_decl(Rest1, State1);
%% E clause not needed here because already taken care of above.
-parse_doctype_decl_1(?STRING("EN"), State) ->
- cf(?STRING("EN"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("ENT"), State) ->
- cf(?STRING("ENT"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("ENTI"), State) ->
- cf(?STRING("ENTI"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("ENTIT"), State) ->
- cf(?STRING("ENTIT"), State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("EN") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("ENT") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("ENTI") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("ENTIT") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
parse_doctype_decl_1(?STRING_REST("ENTITY", Rest), State) ->
{Rest1, State1} = parse_entity_decl(Rest, State),
parse_doctype_decl(Rest1, State1);
-parse_doctype_decl_1(?STRING("N"), State) ->
- cf(?STRING("N"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("NO"), State) ->
- cf(?STRING("NO"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("NOT"), State) ->
- cf(?STRING("NOT"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("NOTA"), State) ->
- cf(?STRING("NOTA"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("NOTAT"), State) ->
- cf(?STRING("NOTAT"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("NOTATI"), State) ->
- cf(?STRING("NOTATI"), State, fun parse_doctype_decl_1/2);
-parse_doctype_decl_1(?STRING("NOTATIO"), State) ->
- cf(?STRING("NOTATIO"), State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("N") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("NO") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("NOT") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("NOTA") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("NOTAT") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("NOTATI") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("NOTATIO") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
parse_doctype_decl_1(?STRING_REST("NOTATION", Rest), State) ->
{Rest1, State1} = parse_notation_decl(Rest, State),
parse_doctype_decl(Rest1, State1);
-parse_doctype_decl_1(?STRING("-"), State) ->
- cf(?STRING("-"), State, fun parse_doctype_decl_1/2);
+parse_doctype_decl_1(?STRING("-") = Bytes, State) ->
+ cf(Bytes, State, fun parse_doctype_decl_1/2);
parse_doctype_decl_1(?STRING_REST("--", Rest), State) ->
{Rest1, State1} = parse_comment(Rest, State, []),
parse_doctype_decl(Rest1, State1);
@@ -2054,14 +2057,18 @@ parse_element_content(Bytes, State) ->
parse_element_content_1(?STRING_EMPTY, State, Acc) ->
cf(?STRING_EMPTY, State, Acc, fun parse_element_content_1/3);
parse_element_content_1(?STRING_REST(">", Rest), State, Acc) ->
- {lists:reverse(Acc), Rest, State};
+ {lists:reverse(delete_leading_whitespace(Acc)), Rest, State};
parse_element_content_1(?STRING_UNBOUND_REST(C, Rest), State, Acc) ->
parse_element_content_1(Rest, State, [C|Acc]);
parse_element_content_1(Bytes, State, Acc) ->
unicode_incomplete_check([Bytes, State, Acc, fun parse_element_content_1/3],
undefined).
-
+delete_leading_whitespace([C |Acc]) when ?is_whitespace(C)->
+ delete_leading_whitespace(Acc);
+delete_leading_whitespace(Acc) ->
+ Acc.
+
%%----------------------------------------------------------------------
%% Function : parse_att_list_decl(Rest, State) -> Result
%% Parameters: Rest = string() | binary()
@@ -2257,52 +2264,52 @@ parse_default_decl(Bytes, State) ->
%%----------------------------------------------------------------------
parse_default_decl_1(?STRING_EMPTY, State) ->
cf(?STRING_EMPTY, State, fun parse_default_decl_1/2);
-parse_default_decl_1(?STRING_REST("#", Rest), State) ->
- case Rest of
- ?STRING("R") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING("RE") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING("REQ") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING("REQU") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING("REQUI") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING("REQUIR") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING("REQUIRE") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING_REST("REQUIRED", Rest1) ->
+parse_default_decl_1(?STRING_REST("#", _Rest) = Bytes, State) ->
+ case Bytes of
+ ?STRING("#R") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING("#RE") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING("#REQ") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING("#REQU") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING("#REQUI") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING("#REQUIR") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING("#REQUIRE") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING_REST("#REQUIRED", Rest1) ->
{"#REQUIRED", undefined, Rest1, State};
- ?STRING("I") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING("IM") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING("IMP") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING("IMPL") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING("IMPLI") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING("IMPLIE") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING_REST("IMPLIED", Rest1) ->
+ ?STRING("#I") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING("#IM") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING("#IMP") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING("#IMPL") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING("#IMPLI") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING("#IMPLIE") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING_REST("#IMPLIED", Rest1) ->
{"#IMPLIED", undefined, Rest1, State};
- ?STRING("F") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING("FI") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING("FIX") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING("FIXE") ->
- cf(Rest, State, fun parse_default_decl_1/2);
- ?STRING_REST("FIXED", Rest1) ->
+ ?STRING("#F") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING("#FI") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING("#FIX") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING("#FIXE") ->
+ cf(Bytes, State, fun parse_default_decl_1/2);
+ ?STRING_REST("#FIXED", Rest1) ->
parse_fixed(Rest1, State);
_ ->
- ?fatal_error(State, "REQUIRED, IMPLIED or FIXED expected")
+ ?fatal_error(State, "REQUIRED, IMPLIED or FIXED expected after #")
end;
parse_default_decl_1(?STRING_UNBOUND_REST(C, Rest), State) when C == $'; C == $" ->
{DefaultValue, Rest1, State1} = parse_att_value(Rest, State, C, []),
@@ -2553,14 +2560,14 @@ parse_ndata_decl(?STRING_EMPTY, State) ->
cf(?STRING_EMPTY, State, fun parse_ndata_decl/2);
parse_ndata_decl(?STRING_REST(">", Rest), State) ->
{undefined, Rest, State};
-parse_ndata_decl(?STRING("N") = Rest, State) ->
- cf(Rest, State, fun parse_ndata_decl/2);
-parse_ndata_decl(?STRING("ND") = Rest, State) ->
- cf(Rest, State, fun parse_ndata_decl/2);
-parse_ndata_decl(?STRING("NDA") = Rest, State) ->
- cf(Rest, State, fun parse_ndata_decl/2);
-parse_ndata_decl(?STRING("NDAT") = Rest, State) ->
- cf(Rest, State, fun parse_ndata_decl/2);
+parse_ndata_decl(?STRING("N") = Bytes, State) ->
+ cf(Bytes, State, fun parse_ndata_decl/2);
+parse_ndata_decl(?STRING("ND") = Bytes, State) ->
+ cf(Bytes, State, fun parse_ndata_decl/2);
+parse_ndata_decl(?STRING("NDA") = Bytes, State) ->
+ cf(Bytes, State, fun parse_ndata_decl/2);
+parse_ndata_decl(?STRING("NDAT") = Bytes, State) ->
+ cf(Bytes, State, fun parse_ndata_decl/2);
parse_ndata_decl(?STRING_REST("NDATA", Rest), State) ->
parse_ndata_decl_1(Rest, State);
parse_ndata_decl(Bytes, State) ->
diff --git a/lib/xmerl/src/xmerl_uri.erl b/lib/xmerl/src/xmerl_uri.erl
index 1864651491..ed66dd78d4 100644
--- a/lib/xmerl/src/xmerl_uri.erl
+++ b/lib/xmerl/src/xmerl_uri.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2012. 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/lib/xmerl/src/xmerl_xsd.erl b/lib/xmerl/src/xmerl_xsd.erl
index ed0890f0d0..78d84d23a4 100644
--- a/lib/xmerl/src/xmerl_xsd.erl
+++ b/lib/xmerl/src/xmerl_xsd.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2012. 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
@@ -2338,6 +2338,8 @@ complexity([]) ->
undefined;
complexity([#xmlText{}|T]) ->
complexity(T);
+complexity([#xmlComment{}|T]) ->
+ complexity(T);
complexity([H|T]) ->
case kind(H) of
simpleContent ->
diff --git a/lib/xmerl/test/Makefile b/lib/xmerl/test/Makefile
index 5a2a585841..ac3370dbda 100644
--- a/lib/xmerl/test/Makefile
+++ b/lib/xmerl/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2004-2011. All Rights Reserved.
+# Copyright Ericsson AB 2004-2012. 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
@@ -113,15 +113,15 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_spec: opt
release_tests_spec: opt
- $(INSTALL_DIR) $(RELSYSDIR)
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) $(SUITE_FILES) $(RELSYSDIR)
- $(INSTALL_DATA) xmerl.spec xmerl.cover $(RELSYSDIR)
- cp $(XML_FILES) $(RELSYSDIR)
- @tar cfh - xmerl_SUITE_data | (cd $(RELSYSDIR); tar xf -)
- @tar cfh - xmerl_std_SUITE_data | (cd $(RELSYSDIR); tar xf -)
- @tar cfh - xmerl_xsd_SUITE_data | (cd $(RELSYSDIR); tar xf -)
- @tar cfh - xmerl_xsd_MS2002-01-16_SUITE_data | (cd $(RELSYSDIR); tar xf -)
- @tar cfh - xmerl_xsd_NIST2002-01-16_SUITE_data | (cd $(RELSYSDIR); tar xf -)
- @tar cfh - xmerl_xsd_Sun2002-01-16_SUITE_data | (cd $(RELSYSDIR); tar xf -)
- chmod -R u+w $(RELSYSDIR)
+ $(INSTALL_DIR) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) $(SUITE_FILES) "$(RELSYSDIR)"
+ $(INSTALL_DATA) xmerl.spec xmerl.cover "$(RELSYSDIR)"
+ cp $(XML_FILES) "$(RELSYSDIR)"
+ @tar cfh - xmerl_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
+ @tar cfh - xmerl_std_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
+ @tar cfh - xmerl_xsd_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
+ @tar cfh - xmerl_xsd_MS2002-01-16_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
+ @tar cfh - xmerl_xsd_NIST2002-01-16_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
+ @tar cfh - xmerl_xsd_Sun2002-01-16_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
+ chmod -R u+w "$(RELSYSDIR)"
diff --git a/lib/xmerl/vsn.mk b/lib/xmerl/vsn.mk
index de47e3418b..599bc0b9d3 100644
--- a/lib/xmerl/vsn.mk
+++ b/lib/xmerl/vsn.mk
@@ -1 +1 @@
-XMERL_VSN = 1.3
+XMERL_VSN = 1.3.2
diff --git a/make/emd2exml.in b/make/emd2exml.in
index 16c38379d9..b677ef8ed4 100644
--- a/make/emd2exml.in
+++ b/make/emd2exml.in
@@ -266,8 +266,11 @@ parse(#state{code = true, type = blank, line = CB, code_blank = CBs} = S) ->
parse(#state{code = true,
code_blank = CB,
list_lvl = Lvl,
- type = {text, TxtLvl},
- line = Line} = S) when TxtLvl > Lvl ->
+ type = {Type, TxtLvl},
+ line = Line} = S) when TxtLvl > Lvl,
+ (Type == text orelse
+ Type == uolist orelse
+ Type == olist) ->
Data = code(strip_lvls(Lvl+1, Line)),
parse(get_line(put_chars(S#state{code_blank = []},
[strip_code_blank(Lvl+1, CB), Data])));
@@ -994,7 +997,7 @@ resolve_link([_|Cs], start, "", "", "") ->
resolve_link(Cs, start, "", "", "");
resolve_link("]:" ++ Rest, key, Yek, "", "") ->
resolve_link(Rest, url, Yek, "", "");
-resolve_link([C|Cs], url, Yek, Lru, "") when C == $"; C == $' ->
+resolve_link([C|Cs], url, Yek, Lru, "") when C == $"; C == $' -> %"
resolve_link(Cs, {title, C}, Yek, Lru, "");
resolve_link([$(|Cs], url, Yek, Lru, "") ->
resolve_link(Cs, {title, $)}, Yek, Lru, "");
@@ -1010,9 +1013,21 @@ resolve_link([_|Cs], drop, Yek, Lru, Eltit) ->
resolve_link(Cs, drop, Yek, Lru, Eltit);
resolve_link([], _, Yek, Lru, Eltit) ->
{ws_strip(lists:reverse(Yek)),
- ws_strip(lists:reverse(Lru)),
+ ws_strip(md_strip_n_reverse(Lru)),
ws_strip(lists:reverse(Eltit))}.
+%% Remove .md at end of references.
+md_strip_n_reverse(Lru) ->
+ md_strip_n_reverse(Lru,[]).
+md_strip_n_reverse("\ndm."++Lru,Acc) ->
+ md_strip_n_reverse(Lru,Acc);
+md_strip_n_reverse("#dm."++Lru,Acc) ->
+ md_strip_n_reverse(Lru,[$#|Acc]);
+md_strip_n_reverse([C|T],Acc) ->
+ md_strip_n_reverse(T,[C|Acc]);
+md_strip_n_reverse([], Acc) ->
+ Acc.
+
%%
%% Misc
%%
diff --git a/make/otp.mk.in b/make/otp.mk.in
index 507f040729..ed2fd8a70b 100644
--- a/make/otp.mk.in
+++ b/make/otp.mk.in
@@ -4,7 +4,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -77,19 +77,13 @@ OTP_RELEASE = @OTP_RELEASE@
# Erlang language section
# ----------------------------------------------------
EMULATOR = beam
-ifeq ($(findstring vxworks,$(TARGET)),vxworks)
-# VxWorks object files should be compressed.
-# Other object files should have debug_info.
- ERL_COMPILE_FLAGS += +compressed
+ifeq ($(findstring ose_ppc750,$(TARGET)),ose_ppc750)
+ERL_COMPILE_FLAGS += +compressed
else
- ifeq ($(findstring ose_ppc750,$(TARGET)),ose_ppc750)
- ERL_COMPILE_FLAGS += +compressed
+ ifdef BOOTSTRAP
+ ERL_COMPILE_FLAGS += +slim
else
- ifdef BOOTSTRAP
- ERL_COMPILE_FLAGS += +slim
- else
- ERL_COMPILE_FLAGS += +debug_info
- endif
+ ERL_COMPILE_FLAGS += +debug_info
endif
endif
ERLC_WFLAGS = -W
@@ -115,6 +109,12 @@ $(EBIN)/%.beam: $(EGEN)/%.erl
$(EBIN)/%.beam: $(ESRC)/%.erl
$(ERLC) $(ERL_COMPILE_FLAGS) -o$(EBIN) $<
+ifeq ($(NATIVE_LIBS_ENABLED),yes)
+# Special rule for the HIPE bootstrap w/ native libs
+../boot_ebin/%.beam: $(ESRC)/%.erl
+ $(ERLC) $(ERL_COMPILE_FLAGS) -o../boot_ebin $<
+endif
+
.erl.beam:
$(ERLC) $(ERL_COMPILE_FLAGS) -o$(dir $@) $<
diff --git a/make/otp_release_targets.mk b/make/otp_release_targets.mk
index f2387e4b74..67243b5ffd 100644
--- a/make/otp_release_targets.mk
+++ b/make/otp_release_targets.mk
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -110,12 +110,12 @@ endif
ifeq ($(TESTROOT),)
release release_docs release_tests release_html:
- $(MAKE) $(MFLAGS) RELEASE_PATH=$(ERL_TOP)/release/$(TARGET) \
+ $(MAKE) $(MFLAGS) RELEASE_PATH="$(ERL_TOP)/release/$(TARGET)" \
$(TARGET_MAKEFILE) $@_spec
else
release release_docs release_tests release_html:
- $(MAKE) $(MFLAGS) RELEASE_PATH=$(TESTROOT) $(TARGET_MAKEFILE) $@_spec
+ $(MAKE) $(MFLAGS) RELEASE_PATH="$(TESTROOT)" $(TARGET_MAKEFILE) $@_spec
endif
diff --git a/make/run_make.mk b/make/run_make.mk
index 39c3668e50..b7a5a64847 100644
--- a/make/run_make.mk
+++ b/make/run_make.mk
@@ -32,7 +32,7 @@ include $(ERL_TOP)/make/target.mk
opt debug purify quantify purecov valgrind gcov gprof lcnt:
$(MAKE) -f $(TARGET)/Makefile TYPE=$@
-plain smp hybrid frag smp_frag:
+plain smp frag smp_frag:
$(MAKE) -f $(TARGET)/Makefile FLAVOR=$@
clean generate depend docs release release_spec release_docs release_docs_spec \
diff --git a/otp_build b/otp_build
index a4e25510c1..85be25a8a1 100755
--- a/otp_build
+++ b/otp_build
@@ -2,7 +2,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2002-2011. All Rights Reserved.
+# Copyright Ericsson AB 2002-2012. 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
@@ -51,7 +51,6 @@ usage ()
echo " release <target_dir> - creates a small release to <target_dir>"
echo " release [-a] <target_dir> - creates full release to <target_dir>"
echo " smp [-a] - build an Erlang system, smp flavor only"
- echo " hybrid [-a] - build an Erlang system, hybrid flavor only"
echo " tests <dir> - Build testsuites to <dir>"
echo ""
echo "These are for cleaning up an open source distribution"
@@ -84,7 +83,7 @@ usage ()
;;
git)
echo ""
- echo "update_primary - build and commit a new primary bootstrap"
+ echo "update_primary [--no-commit] - build and maybe commit a new primary bootstrap"
;;
esac
@@ -93,7 +92,7 @@ usage ()
;;
git)
echo ""
- echo "update_preloaded - build and commit the preloaded modules"
+ echo "update_preloaded [--no-commit] - build and maybe commit the preloaded modules"
;;
esac
}
@@ -1094,33 +1093,61 @@ setup_make ()
fi
export MAKE
}
-
+
+get_do_commit ()
+{
+ if [ "x$1" = "x" ]; then
+ do_commit=true
+ elif [ "$1" = "--no-commit" ]; then
+ do_commit=false
+ else
+ echo "Unknown option '$1'" 1>&2
+ exit 1
+ fi
+}
+
do_primary_git ()
{
+ get_do_commit $1
setup_make
if [ "x$OVERRIDE_TARGET" != "x" -a "x$OVERRIDE_TARGET" != "xwin32" ]; then
do_primary_cross
else
$MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET primary_bootstrap || exit 1;
fi
- git add -A bootstrap/lib/kernel \
- bootstrap/lib/stdlib \
- bootstrap/lib/compiler \
- bootstrap/bin
- find bootstrap -name egen -o -name '*.script' -o \
- -name '*.app' -o -name '*.appup' |
+ if [ $do_commit = true ]; then
+ git add -A bootstrap/lib/kernel \
+ bootstrap/lib/stdlib \
+ bootstrap/lib/compiler \
+ bootstrap/bin
+ find bootstrap -name egen -o -name '*.script' -o \
+ -name '*.app' -o -name '*.appup' |
xargs git reset HEAD
- git commit --no-verify -m 'Update primary bootstrap'
+ git commit --no-verify -m 'Update primary bootstrap'
+ echo "Primary bootstrap updated and commited."
+ else
+ echo ""
+ echo "Primary bootstrap rebuilt. Use \"git add bootstrap/...\" to stage changed files."
+ echo ""
+ fi
}
do_update_prel_git ()
{
+ get_do_commit $1
setup_make
(cd $ERL_TOP/erts/preloaded/src && $MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET clean)
$MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET preloaded || exit 1
(cd $ERL_TOP/erts/preloaded/src && $MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET copy)
- git add -A $ERL_TOP/erts/preloaded/ebin/*.beam
- git commit -m 'Update preloaded modules'
+ if [ $do_commit = true ]; then
+ git add -A $ERL_TOP/erts/preloaded/ebin/*.beam
+ git commit -m 'Update preloaded modules'
+ echo "Preloaded updated and commited."
+ else
+ echo ""
+ echo "Preloaded rebuilt. Use \"git add erts/preloaded/ebin/...\" to stage changed beam files."
+ echo ""
+ fi
}
do_boot ()
@@ -1281,8 +1308,8 @@ cd $ERL_TOP
determine_version_controller
-# Unset ERL_FLAGS and ERL_<Release>_FLAGS to prevent, for instance,
-# a value of "-hybrid" to run the hybrid emulator during bootstrap.
+# Unset ERL_FLAGS and ERL_<Release>_FLAGS during bootstrap to
+# prevent potential problems
sys_vsn=`awk '/SYSTEM_VSN = / {print $3}' < erts/vsn.mk`
sys_erl_flags="ERL_${sys_vsn}_FLAGS"
unset ERL_FLAGS
@@ -1311,7 +1338,9 @@ case $TARGET in
if [ X"$OVERRIDE_TARGET" = X"" -a X"$1" != X"env_win32" -a X"$1" != X"env_msys32" -a X"$1" != X"env_msys64" ];then
echo "Building for windows, you should do the " \
"following first:" >&2
- echo 'eval `./otp_build env_msys64`' >&2
+ echo 'eval `./otp_build env_win32`' >&2
+ echo 'or' >&2
+ echo 'eval `./otp_build env_win32 x64`' >&2
echo 'please note that there are backticks (``) in' \
'the command'
exit 1
@@ -1390,7 +1419,7 @@ case "$1" in
do_lazy_configure_target_clean;;
opt)
do_boot;;
- plain|smp|hybrid)
+ plain|smp)
if [ $minus_a_flag = false ]; then
TYPE=opt
fi;
@@ -1401,12 +1430,12 @@ case "$1" in
do_boot;;
update_primary)
case $version_controller in
- git) do_primary_git ;;
+ git) do_primary_git "$2";;
none) git_required ;;
esac ;;
update_preloaded)
case $version_controller in
- git) do_update_prel_git ;;
+ git) do_update_prel_git "$2";;
none) git_required ;;
esac ;;
primary)
diff --git a/system/COPYRIGHT b/system/COPYRIGHT
index 94e9795b16..7014f080d5 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-2011. All Rights Reserved.
+Copyright Ericsson AB 1997-2012. 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
@@ -245,3 +245,26 @@ terms specified in this license.
%% POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
+[eldap]
+
+Copyright (c) 2010, Torbjorn Tornkvist
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+---------------------------------------------------------------------------
diff --git a/system/README b/system/README
index b8ff18119d..b1e18ef55c 100644
--- a/system/README
+++ b/system/README
@@ -51,10 +51,9 @@ Release of Erlang 5.9/OTP R15B
-------------------------------
3.1 The platform VxWorks is discontinued in the sense that only the
- libraries (erl_interface and ic's libraries) are supported. Running
- the Erlang emulator on VxWorks might still possible but it's no longer
- maintained. The VxWorks release is still packaged as a full release,
- but no support will be available for anything but the communication libraries.
+ libraries (erl_interface and ic's libraries) are supported. The VxWorks
+ release is still packaged as a full release, but no support will be
+ available for anything but the communication libraries.
4 NOTES ABOUT THE LINUX VERSIONS
-----------------------------
diff --git a/system/doc/design_principles/Makefile b/system/doc/design_principles/Makefile
index bffff75be2..73e1e2c6f7 100644
--- a/system/doc/design_principles/Makefile
+++ b/system/doc/design_principles/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -29,7 +29,7 @@ APPLICATION=otp-system-documentation
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/doc/design_principles
+RELSYSDIR = "$(RELEASE_PATH)/doc/design_principles"
# ----------------------------------------------------
# Target Specs
@@ -105,8 +105,8 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
-# $(INSTALL_DIR) $(RELEASE_PATH)/pdf
-# $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELEASE_PATH)/pdf
+# $(INSTALL_DIR) "$(RELEASE_PATH)/pdf"
+# $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELEASE_PATH)/pdf"
$(INSTALL_DIR) $(RELSYSDIR)
$(INSTALL_DATA) $(GIF_FILES) $(HTMLDIR)/*.html \
$(RELSYSDIR)
diff --git a/system/doc/design_principles/spec_proc.xml b/system/doc/design_principles/spec_proc.xml
index 1bc2d32461..f00de71a4c 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>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -108,7 +108,7 @@ ok
<list type="bulleted">
<item>be started in a way that makes the process fit into a
supervision tree,</item>
- <item>support the <c>sys</c><seealso marker="#debug">debug facilities</seealso>, and</item>
+ <item>support the <c>sys</c> <seealso marker="#debug">debug facilities</seealso>, and</item>
<item>take care of <seealso marker="#msg">system messages</seealso>.</item>
</list>
<p>System messages are messages with special meaning, used in
diff --git a/system/doc/design_principles/sup_princ.xml b/system/doc/design_principles/sup_princ.xml
index 5b8fd604c8..7ad007d3fd 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>2011</year>
+ <year>1997</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -136,7 +136,7 @@ init(...) ->
M = F = atom()
A = [term()]
Restart = permanent | transient | temporary
- Shutdown = brutal_kill | integer() &gt;=0 | infinity
+ Shutdown = brutal_kill | integer()>0 | infinity
Type = worker | supervisor
Modules = [Module] | dynamic
Module = atom()]]></code>
diff --git a/system/doc/efficiency_guide/Makefile b/system/doc/efficiency_guide/Makefile
index c08a9d2f69..655531f42b 100644
--- a/system/doc/efficiency_guide/Makefile
+++ b/system/doc/efficiency_guide/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2001-2011. All Rights Reserved.
+# Copyright Ericsson AB 2001-2012. 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
@@ -30,7 +30,7 @@ APPLICATION=otp-system-documentation
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/doc/efficiency_guide
+RELSYSDIR = "$(RELEASE_PATH)/doc/efficiency_guide"
# ----------------------------------------------------
# Target Specs
@@ -106,8 +106,8 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
-# $(INSTALL_DIR) $(RELEASE_PATH)/pdf
-# $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELEASE_PATH)/pdf
+# $(INSTALL_DIR) "$(RELEASE_PATH)/pdf"
+# $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELEASE_PATH)/pdf"
$(INSTALL_DIR) $(RELSYSDIR)
$(INSTALL_DATA) $(GIF_FILES) $(EXTRA_FILES) $(HTMLDIR)/*.html \
$(RELSYSDIR)
diff --git a/system/doc/efficiency_guide/profiling.xml b/system/doc/efficiency_guide/profiling.xml
index 65ba4b3369..cbb53c825e 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>2011</year>
+ <year>2001</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -116,7 +116,7 @@
minimize runtime performance impact. Using fprof is just a
matter of calling a few library functions, see
<seealso marker="tools:fprof">fprof</seealso>
- manual page under the application tools.<c>fprof</c> was introduced in
+ manual page under the application tools.<c> fprof</c> was introduced in
version R8 of Erlang/OTP.
</p>
</section>
diff --git a/system/doc/embedded/Makefile b/system/doc/embedded/Makefile
index 7dda0eaaa7..2f78d7ddcd 100644
--- a/system/doc/embedded/Makefile
+++ b/system/doc/embedded/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -30,7 +30,7 @@ APPLICATION=otp-system-documentation
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/doc/embedded
+RELSYSDIR = "$(RELEASE_PATH)/doc/embedded"
# ----------------------------------------------------
# Target Specs
@@ -94,8 +94,8 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
-# $(INSTALL_DIR) $(RELEASE_PATH)/pdf
-# $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELEASE_PATH)/pdf
+# $(INSTALL_DIR) "$(RELEASE_PATH)/pdf"
+# $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELEASE_PATH)/pdf"
$(INSTALL_DIR) $(RELSYSDIR)
$(INSTALL_DATA) $(GIF_FILES) $(HTMLDIR)/*.html \
$(RELSYSDIR)
diff --git a/system/doc/embedded/part.xml b/system/doc/embedded/part.xml
index abedce46d6..d96a94a1a0 100644
--- a/system/doc/embedded/part.xml
+++ b/system/doc/embedded/part.xml
@@ -45,6 +45,5 @@
</description>
<xi:include href="embedded_solaris.xml"/>
<xi:include href="embedded_nt.xml"/>
- <xi:include href="vxworks.xml"/>
</part>
diff --git a/system/doc/embedded/vxworks.xml b/system/doc/embedded/vxworks.xml
deleted file mode 100644
index 52143a42e3..0000000000
--- a/system/doc/embedded/vxworks.xml
+++ /dev/null
@@ -1,193 +0,0 @@
-<?xml version="1.0" encoding="latin1" ?>
-<!DOCTYPE chapter SYSTEM "chapter.dtd">
-
-<chapter>
- <header>
- <copyright>
- <year>1997</year><year>2009</year>
- <holder>Ericsson AB. All Rights Reserved.</holder>
- </copyright>
- <legalnotice>
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
-
- </legalnotice>
-
- <title>VxWorks</title>
- <prepared>Patrik Winroth</prepared>
- <responsible></responsible>
- <docno></docno>
- <approved></approved>
- <checked></checked>
- <date>2000-10-17</date>
- <rev></rev>
- <file>vxworks.xml</file>
- </header>
- <p>This chapter describes the OS specific parts of OTP which relate
- to VxWorks.
- </p>
-
- <section>
- <title>Introduction</title>
- <p>The Erlang/OTP distribution for VxWorks is limited to what
- Switchboard requires (Switchboard is a general purpose
- switching hardware developed by Ericsson).
- </p>
- <p>Please consult the README file, included at root level in the
- installation, for latest information on the distribution.
- </p>
- </section>
-
- <section>
- <title>Memory Usage</title>
- <p>Memory required is 32 Mbyte.
- </p>
- </section>
-
- <section>
- <title>Disk Usage</title>
- <p>The disk space required is 22 Mbyte, the documentation included.
- </p>
- </section>
-
- <section>
- <title>Installation</title>
- <p>OTP/VxWorks is supplied in a distribution file named
- <c><![CDATA[<PREFIX>.tar.gz]]></c>; i.e. a tar archive that is
- compressed with gzip. <c><![CDATA[<PREFIX>]]></c> represents the
- name of the release,
- e.g. <c>otp_LXA12345_vxworks_cpu32_R42A</c>. Assuming you are
- installing to a Solaris file system, the installation is
- performed by following these steps: &lt;
- </p>
- <p></p>
- <list type="bulleted">
- <item>Change to the directory where you want to install
- OTP/VxWorks (<c><![CDATA[<ROOTDIR>]]></c>): <c><![CDATA[cd <ROOTDIR>]]></c></item>
- <item>Make a directory to put OTP/VxWorks in: <c>mkdir otp_vxworks_cpu32</c> (or whatever you want to call it)</item>
- <item>Change directory to the newly created one: <c>cd otp_vxworks_cpu32</c></item>
- <item>Copy the distribution file there from where it is located
- (<c><![CDATA[<RELDIR>]]></c>): <c><![CDATA[cp <RELDIR>/<PREFIX>.tar.gz .]]></c></item>
- <item>Unzip the distribution file: <c><![CDATA[gunzip <PREFIX>.tar.gz]]></c></item>
- <item>Untar <c><![CDATA[<PREFIX>.tar]]></c>: <c><![CDATA[tar xvf <PREFIX>.tar]]></c></item>
- <item>Create a bin directory: <c>mkdir bin</c></item>
- <item>Copy the VxWorks Erlang/OTP start-up script to the bin directory:
- <c>cp erts-Vsn/bin/erl bin/.</c></item>
- <item>Copy the example start scripts to the bin directory:
- <c>cp releases/R42A/*.boot bin/.</c></item>
- </list>
- <p>If you use VxWorks nfs mounting facility to mount the Solaris
- file system, this installation may be directly used. An other
- possibility is to copy the installation to a local VxWorks DOS
- file system, from where it is used.
- </p>
- </section>
-
- <section>
- <title>OS Specific Functionality/Information</title>
- <p>There are a couple of files that are unique to the VxWorks
- distribution of Erlang/OTP, these files are described here.
- </p>
- <list type="bulleted">
- <item>README - this files has some information on VxWorks
- specifics that you are advised to consult. This includes the
- latest information on what parts of OTP are included in the
- VxWorks distribution of Erlang/OTP. If you want us to
- include more parts, please contact us to discuss
- this.</item>
- <item>erts-Vsn/bin/resolv.conf - A resolver configuration EXAMPLE file.
- You have to edit this file.</item>
- <item>erts-Vsn/bin/erl - This is an EXAMPLE start script for VxWorks.
- You have to edit this file to suit your needs.</item>
- <item>erts-Vsn/bin/erl_io - One possible solution to the problem
- of competing Erlang and VxWorks shell. Contains the function
- 'start_erl' called by the erl script. Also contains the
- function 'to_erl' to be used when connecting to the Erlang
- shell from VxWorks' shell.</item>
- <item>erts-Vsn/bin/erl_exec - Rearranges command line arguments
- and starts Erlang.</item>
- <item>erts-Vsn/bin/vxcall - Allows spawning of standard VxWorks
- shell functions (which is just about any function in the
- system...) from open_port/2. E.g. open_port({spawn, 'vxcall
- func arg1 arg2'}, []) will cause the output that 'func arg1,
- arg2' would have given in the shell to be received from the
- port.</item>
- <item>erts-Vsn/bin/rdate - Set the time from a networked host,
- like the SunOS command. Nothing Erlang-specific, but nice
- if you want date/0 and time/0 to give meaningful values (you
- also need a TIMEZONE environment setting if GMT isn't
- acceptable). For example: <c>putenv "TIMEZONE=CET::-60:033002:102603"</c> sets central european
- time.</item>
- <item>erts-Vsn/src - Contains source for the above files, and
- additionally config.c, driver.h, preload.c and
- reclaim.h. Reclaim.h defines the interface to a simple
- mechanism for "resource reclamation" that is part of the
- Erlang runtime system - may be useful to "port program" writers (and
- possibly others). Take careful note of the caveats listed in
- the file!</item>
- </list>
- </section>
-
- <section>
- <title>Starting Erlang</title>
- <p>Start (and restart) of the system depends on what file system
- is used. To be able to start the system from a nfs mounted
- file system you can use VxWorks start script facility to run a
- start script similar to the example below. Note that the
- Erlang/OTP start-up script is run at the end of this script.
- </p>
- <code type="none"><![CDATA[
-# start.script v1.0 1997/09/08 patrik
-#
-# File name: start.script
-# Purpose: Starting the VxWorks/cpu32 erlang/OTP
-# Resides in: ~tornado/wind/target/config/ads360/
-
-#
-# Set shell prompt
-#
-shellPromptSet("sauron-> ")
-
-#
-# Set default gateway
-#
-hostAdd "router-20","150.236.20.251"
-routeAdd "0","router-20"
-
-#
-# Mount /home from gandalf
-#
-hostAdd "gandalf","150.236.20.16"
-usergroup=10
-nfsAuthUnixSet("gandalf", 452, 10, 1, &usergroup)
-nfsMount("gandalf", "/export/home", "/home")
-
-#
-# Load and run rdate.o to set correct date on the target
-#
-ld < /home/gandalf/tornado/wind/target/config/ads360/rdate.o
-rdate("gandalf")
-
-#
-# Setup timezone information (Central European time)
-#
-putenv "TIMEZONE=CET::-60:033002:102603"
-
-#
-# Run the Erlang/OTP start script
-#
-cd "/home/gandalf/tornado/wind/target/erlang_cpu32_R42A/bin"
-<erl
- ]]></code>
- </section>
-</chapter>
-
diff --git a/system/doc/embedded/xmlfiles.mk b/system/doc/embedded/xmlfiles.mk
index 2bdc34ae28..0001a55b9a 100644
--- a/system/doc/embedded/xmlfiles.mk
+++ b/system/doc/embedded/xmlfiles.mk
@@ -18,5 +18,4 @@
#
EMBEDDED_CHAPTER_FILES = \
embedded_solaris.xml \
- embedded_nt.xml \
- vxworks.xml
+ embedded_nt.xml
diff --git a/system/doc/getting_started/Makefile b/system/doc/getting_started/Makefile
index 62b92613e5..ce53256b16 100644
--- a/system/doc/getting_started/Makefile
+++ b/system/doc/getting_started/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -30,7 +30,7 @@ APPLICATION=otp-system-documentation
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/doc/getting_started
+RELSYSDIR = "$(RELEASE_PATH)/doc/getting_started"
# ----------------------------------------------------
# Target Specs
@@ -93,8 +93,8 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
-# $(INSTALL_DIR) $(RELEASE_PATH)/pdf
-# $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELEASE_PATH)/pdf
+# $(INSTALL_DIR) "$(RELEASE_PATH)/pdf"
+# $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELEASE_PATH)/pdf"
$(INSTALL_DIR) $(RELSYSDIR)
$(INSTALL_DATA) $(GIF_FILES) $(HTMLDIR)/*.html \
$(RELSYSDIR)
diff --git a/system/doc/installation_guide/Makefile b/system/doc/installation_guide/Makefile
index a47d77604d..6923f52d8a 100644
--- a/system/doc/installation_guide/Makefile
+++ b/system/doc/installation_guide/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2010. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -30,7 +30,7 @@ APPLICATION=otp-system-documentation
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/doc/installation_guide
+RELSYSDIR = "$(RELEASE_PATH)/doc/installation_guide"
REDIRECT_HTML_RELSYSDIR = $(RELSYSDIR)/source
# ----------------------------------------------------
@@ -58,7 +58,8 @@ XML_FILES = \
GENERATED_XML_FILES = \
INSTALL.xml \
INSTALL-CROSS.xml \
- INSTALL-WIN32.xml
+ INSTALL-WIN32.xml \
+ MARKDOWN.xml
# ----------------------------------------------------
@@ -73,7 +74,8 @@ REDIRECT_HTML_DIR = $(HTMLDIR)/source
REDIRECT_HTML_FILES = \
$(REDIRECT_HTML_DIR)/INSTALL.html \
$(REDIRECT_HTML_DIR)/INSTALL-CROSS.html \
- $(REDIRECT_HTML_DIR)/INSTALL-WIN32.html
+ $(REDIRECT_HTML_DIR)/INSTALL-WIN32.html \
+ $(REDIRECT_HTML_DIR)/MARKDOWN.html
# ----------------------------------------------------
# FLAGS
@@ -85,7 +87,7 @@ DVIPS_FLAGS +=
# Targets
# ----------------------------------------------------
-%.xml: $(ERL_TOP)/%.md $(ERL_TOP)/make/emd2exml
+%.xml: $(ERL_TOP)/HOWTO/%.md $(ERL_TOP)/make/emd2exml
$(ERL_TOP)/make/emd2exml $< $@
$(REDIRECT_HTML_DIR)/%.html: Makefile
diff --git a/system/doc/installation_guide/part.xml b/system/doc/installation_guide/part.xml
index fceacdd8f6..648beb0afd 100644
--- a/system/doc/installation_guide/part.xml
+++ b/system/doc/installation_guide/part.xml
@@ -36,5 +36,5 @@
<xi:include href="INSTALL.xml"/>
<xi:include href="INSTALL-CROSS.xml"/>
<xi:include href="INSTALL-WIN32.xml"/>
-</part>
-
+ <xi:include href="MARKDOWN.xml"/>
+</part> \ No newline at end of file
diff --git a/system/doc/installation_guide/xmlfiles.mk b/system/doc/installation_guide/xmlfiles.mk
index dee67b3c70..8ea2b296aa 100644
--- a/system/doc/installation_guide/xmlfiles.mk
+++ b/system/doc/installation_guide/xmlfiles.mk
@@ -21,4 +21,5 @@ INST_GUIDE_CHAPTER_FILES = \
verification.xml \
INSTALL.xml \
INSTALL-CROSS.xml \
- INSTALL-WIN32.xml
+ INSTALL-WIN32.xml \
+ MARKDOWN.xml
diff --git a/system/doc/oam/Makefile b/system/doc/oam/Makefile
index 510877b189..ca07d82f75 100644
--- a/system/doc/oam/Makefile
+++ b/system/doc/oam/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -29,7 +29,7 @@ APPLICATION=otp-system-documentation
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/doc/oam
+RELSYSDIR = "$(RELEASE_PATH)/doc/oam"
# ----------------------------------------------------
# Target Specs
diff --git a/system/doc/programming_examples/Makefile b/system/doc/programming_examples/Makefile
index 41a65273db..41c27ed0dd 100644
--- a/system/doc/programming_examples/Makefile
+++ b/system/doc/programming_examples/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2011. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -30,7 +30,7 @@ APPLICATION=otp-system-documentation
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/doc/programming_examples
+RELSYSDIR = "$(RELEASE_PATH)/doc/programming_examples"
# ----------------------------------------------------
# Target Specs
diff --git a/system/doc/reference_manual/Makefile b/system/doc/reference_manual/Makefile
index 8de9c39d03..dbdfea2162 100644
--- a/system/doc/reference_manual/Makefile
+++ b/system/doc/reference_manual/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2003-2011. All Rights Reserved.
+# Copyright Ericsson AB 2003-2012. 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
@@ -30,7 +30,7 @@ APPLICATION=otp-system-documentation
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/doc/reference_manual
+RELSYSDIR = "$(RELEASE_PATH)/doc/reference_manual"
# ----------------------------------------------------
# Target Specs
@@ -103,8 +103,8 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
-# $(INSTALL_DIR) $(RELEASE_PATH)/pdf
-# $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELEASE_PATH)/pdf
+# $(INSTALL_DIR) "$(RELEASE_PATH)/pdf"
+# $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELEASE_PATH)/pdf"
$(INSTALL_DIR) $(RELSYSDIR)
$(INSTALL_DATA) $(GIF_FILES) $(HTMLDIR)/*.html \
$(RELSYSDIR)
diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml
index 5fca7225bb..357f89f731 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>2011</year>
+ <year>2003</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -236,10 +236,6 @@ Fun1 = fun(X) -> X+1 end
Fun1(3)
=> 4
-Fun2 = {lists,append}
-Fun2([1,2], [3,4])
-=> [1,2,3,4]
-
fun lists:append/2([1,2], [3,4])
=> [1,2,3,4]</code>
@@ -685,7 +681,7 @@ Expr1 <input>op</input> Expr2</pre>
8> <input>2#10 bor 2#01.</input>
3
9> <input>a + 10.</input>
-** exception error: bad argument in an arithmetic expression
+** exception error: an error occurred when evaluating an arithmetic expression
in operator +/2
called as a + 10
10> <input>1 bsl (1 bsl 64).</input>
@@ -1000,13 +996,6 @@ fun (Arg1,...,ArgN) -> Name(Arg1,...,ArgN) end</pre>
<c>Module</c>. A fun defined in this way will not be dependent on
the code for module in which it is defined.
</p>
- <p>When applied to a number N of arguments, a tuple
- <c>{Module,FunctionName}</c> is interpreted as a fun, referring
- to the function <c>FunctionName</c> with arity N in the module
- <c>Module</c>. The function must be exported.
- <em>This usage is deprecated.</em> Use <c>fun Module:Name/Arity</c>
- instead.
- See <seealso marker="#calls">Function Calls</seealso> for an example.</p>
<p>More examples can be found in <em>Programming Examples</em>.</p>
</section>
diff --git a/system/doc/reference_manual/modules.xml b/system/doc/reference_manual/modules.xml
index 0dbc0ab56b..51c8157764 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>2010</year>
+ <year>2003</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -114,6 +114,12 @@ fact(0) -> % |
<p>If this attribute is not specified, the version defaults
to the MD5 checksum of the module.</p>
</item>
+ <tag><c>-on_load(Function).</c></tag>
+ <item>
+ <p>Names a function that should be run automatically when a
+ module a loaded. See <seealso marker="code_loading#on_load">
+ code loading</seealso> for more information.</p>
+ </item>
</taglist>
</section>
@@ -180,7 +186,7 @@ fact(0) -> % |
<p>Read more in <seealso marker="typespec">Types and Function specifications</seealso>.
</p>
<p>
- The desciption is based on
+ The description is based on
<url href="http://www.erlang.org/eeps/eep-0008.html">EEP8 -
Types and function specifications</url>
which will not be further updated.
diff --git a/system/doc/system_architecture_intro/Makefile b/system/doc/system_architecture_intro/Makefile
index 9cf135a6f9..0b5322de4f 100644
--- a/system/doc/system_architecture_intro/Makefile
+++ b/system/doc/system_architecture_intro/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2011. All Rights Reserved.
+# Copyright Ericsson AB 1997-2012. 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
@@ -30,7 +30,7 @@ APPLICATION=otp-system-documentation
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/doc/system_architecture_intro
+RELSYSDIR = "$(RELEASE_PATH)/doc/system_architecture_intro"
# ----------------------------------------------------
# Target Specs
@@ -88,8 +88,8 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
-# $(INSTALL_DIR) $(RELEASE_PATH)/pdf
-# $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELEASE_PATH)/pdf
+# $(INSTALL_DIR) "$(RELEASE_PATH)/pdf"
+# $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELEASE_PATH)/pdf"
$(INSTALL_DIR) $(RELSYSDIR)
$(INSTALL_DATA) $(GIF_FILES) $(HTMLDIR)/*.html \
$(RELSYSDIR)
diff --git a/system/doc/system_principles/Makefile b/system/doc/system_principles/Makefile
index da37bd53cf..b1c0fc3ddd 100644
--- a/system/doc/system_principles/Makefile
+++ b/system/doc/system_principles/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2011. All Rights Reserved.
+# Copyright Ericsson AB 1996-2012. 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
@@ -30,7 +30,7 @@ APPLICATION=otp-system-documentation
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/doc/system_principles
+RELSYSDIR = "$(RELEASE_PATH)/doc/system_principles"
# ----------------------------------------------------
# Target Specs
@@ -87,8 +87,8 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
-# $(INSTALL_DIR) $(RELEASE_PATH)/pdf
-# $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELEASE_PATH)/pdf
+# $(INSTALL_DIR) "$(RELEASE_PATH)/pdf"
+# $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELEASE_PATH)/pdf"
$(INSTALL_DIR) $(RELSYSDIR)
$(INSTALL_DATA) $(GIF_FILES) $(HTMLDIR)/*.html \
$(RELSYSDIR)
diff --git a/system/doc/top/Makefile b/system/doc/top/Makefile
index 9f69a7210b..9b305eb13b 100644
--- a/system/doc/top/Makefile
+++ b/system/doc/top/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1999-2011. All Rights Reserved.
+# Copyright Ericsson AB 1999-2012. 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
@@ -30,7 +30,7 @@ APPLICATION=otp-system-documentation
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/doc
+RELSYSDIR = "$(RELEASE_PATH)/doc"
GIF_FILES =
@@ -233,8 +233,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
- $(INSTALL_DIR) $(RELEASE_PATH)
- $(INSTALL_DATA) $(INFO_FILES) $(RELEASE_PATH)
+ $(INSTALL_DIR) "$(RELEASE_PATH)"
+ $(INSTALL_DATA) $(INFO_FILES) "$(RELEASE_PATH)"
$(INSTALL_DIR) $(RELSYSDIR)
$(INSTALL_DIR) $(RELSYSDIR)/pdf
$(INSTALL_DATA) \
diff --git a/system/doc/top/templates/index.html.src b/system/doc/top/templates/index.html.src
index 655f532a5d..de87600ebd 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-2010. All Rights Reserved.
+Copyright Ericsson AB 2009-2012. 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
@@ -94,7 +94,7 @@ Some hints that may get you started faster
<ul>
<li>
-The complete Erlang language is described in the
+The Erlang language is described in the
<a href="reference_manual/users_guide.html">Erlang Reference Manual</a>.
An Erlang tutorial can be found in
<a href="getting_started/users_guide.html">
@@ -109,6 +109,9 @@ In addition to the documentation here Erlang is described in several recent book
<li>
<a href="http://www.pragprog.com/titles/jaerlang">"Programming Erlang"</a> from Pragmatic.
</li>
+<li>
+<a href="http://www.manning.com/logan">"Erlang and OTP in Action"</a> from Manning.
+</li>
</ul>
<p>
These books are highly recommended as a start for learning Erlang.
@@ -136,23 +139,21 @@ 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.sourceforge.net">
+<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.
<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
functions. There is also a number of tools available, such as the graphical <a
-href="#debugger#/index.html" >Debugger</a>, the process
-manager <a href="#pman#/index.html" >Pman</a> and table
-viewer <a href="#tv#/index.html">TV</a>.
+href="#debugger#/index.html" >Debugger</a> and the <a href="#observer#/index.html" >Observer tool</a> for inspection of system information, ets and mnesia tables etc.
<p> Also note that there are some shell features like history list
(control-p and control-n), in line editing (Emacs key bindings) and
module and function name completion (tab) if the module is loaded.
<p>
<li>OpenSource users can ask questions
-and share experiences on the <a href="http://www.erlang.org/faq.html">
+and share experiences on the <a href="http://www.erlang.org/static/doc/mailinglist.html">
Erlang questions mailing list</a>. <p>
<li>Before asking a question you can browse the <a
diff --git a/system/doc/tutorial/Makefile b/system/doc/tutorial/Makefile
index d91d98481d..682a8df4d5 100644
--- a/system/doc/tutorial/Makefile
+++ b/system/doc/tutorial/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2011. All Rights Reserved.
+# Copyright Ericsson AB 2000-2012. 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
@@ -30,7 +30,7 @@ APPLICATION=otp-system-documentation
# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/doc/tutorial
+RELSYSDIR = "$(RELEASE_PATH)/doc/tutorial"
# ----------------------------------------------------
# Target Specs
@@ -114,8 +114,8 @@ clean clean_docs:
include $(ERL_TOP)/make/otp_release_targets.mk
release_docs_spec: docs
-# $(INSTALL_DIR) $(RELEASE_PATH)/pdf
-# $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELEASE_PATH)/pdf
+# $(INSTALL_DIR) "$(RELEASE_PATH)/pdf"
+# $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELEASE_PATH)/pdf"
$(INSTALL_DIR) $(RELSYSDIR)
$(INSTALL_DATA) $(GIF_FILES) $(EXTRA_FILES) $(HTMLDIR)/*.html \
$(RELSYSDIR)
diff --git a/system/doc/tutorial/c_portdriver.xmlsrc b/system/doc/tutorial/c_portdriver.xmlsrc
index f875fa80d2..09a89f792a 100644
--- a/system/doc/tutorial/c_portdriver.xmlsrc
+++ b/system/doc/tutorial/c_portdriver.xmlsrc
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2000</year><year>2009</year>
+ <year>2000</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -68,8 +68,8 @@
start(SharedLib) ->
case erl_ddll:load_driver(".", SharedLib) of
ok -> ok;
-\011{error, already_loaded} -> ok;
-\011_ -> exit({error, could_not_load_driver})
+ {error, already_loaded} -> ok;
+ _ -> exit({error, could_not_load_driver})
end,
spawn(?MODULE, init, [SharedLib]).
@@ -102,7 +102,7 @@ loop(Port) ->
{call, Caller, Msg} ->
Port ! {self(), {command, encode(Msg)}},
receive
-\011 {Port, {data, Data}} ->
+ {Port, {data, Data}} ->
Caller ! {complex, decode(Data)}
end,
loop(Port)
diff --git a/xcomp/README.md b/xcomp/README.md
index 2d79107283..768efc9c7d 100644
--- a/xcomp/README.md
+++ b/xcomp/README.md
@@ -291,6 +291,38 @@ and then do the cross build of the system.
`otp_build release -a` will do the same as (5), and you will after this have
to do a manual install either by doing (6), or (7).
+Testing the cross compiled system
+--------------------------------------
+Some of the tests that come with erlang use native code to test. This means
+that when cross compiling erlang you also have to cross compile test suites
+in order to run tests on the target host. To do this you first have to release
+the tests as usual.
+
+ $ make release_tests
+
+or
+
+ $ ./otp_build tests
+
+The tests will be released into `$ERL_TOP/release/tests`. After releasing the
+tests you have to install the tests on the build machine. You supply the same
+xcomp file as to `./otp_build` in (9).
+
+ $ cd $ERL_TOP/release/tests/test_server/
+ $ $ERL_TOP/bootstrap/bin/erl -eval 'ts:install([{xcomp,"<FILE>"}])' -s ts compile_testcases -s init stop
+
+You should get a lot of printouts as the testcases are compiled. Once done you
+should copy the entire `$ERL_TOP/release/tests` folder to the cross host system.
+
+Then go to the cross host system and setup the erlang installed in (4) or (5)
+to be in your `$PATH`. Then go to what previously was
+`$ERL_TOP/release/tests/test_server` and issue the following command.
+
+ $ erl -s ts install -s ts run all_tests -s init stop
+
+The configure should be skipped and all tests should hopefully pass. For more
+details about how to use ts run `erl -s ts help -s init stop`
+
Currently Used Configuration Variables
--------------------------------------
@@ -430,6 +462,10 @@ When a variable has been set, no warning will be issued.
`configure` will fail unless this variable is set. Since no default
value is used, `configure` will try to figure this out automatically.
+* `erl_xcomp_double_middle` - `yes|no`. Defaults to `no`.
+ If `yes`, the target system must have doubles in "middle-endian" format. If
+ `no`, it has "regular" endianness.
+
* `erl_xcomp_clock_gettime_cpu_time` - `yes|no`. Defaults to `no`. If `yes`,
the target system must have a working `clock_gettime()` implementation
that can be used for retrieving process CPU time.
@@ -491,7 +527,7 @@ Copyright and License
%CopyrightBegin%
-Copyright Ericsson AB 2009-2010. All Rights Reserved.
+Copyright Ericsson AB 2009-2012. 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/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf b/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf
index f9fff0fa8e..84bf735ff2 100644
--- a/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf
+++ b/xcomp/erl-xcomp-TileraMDE2.0-tilepro.conf
@@ -2,7 +2,7 @@
##
## %CopyrightBegin%
##
-## Copyright Ericsson AB 2009-2010. All Rights Reserved.
+## Copyright Ericsson AB 2009-2012. All Rights Reserved.
##
## The contents of this file are subject to the Erlang Public License,
## Version 1.1, (the "License"); you may not use this file except in
@@ -187,6 +187,15 @@ erl_xcomp_sysroot="$TILERA_ROOT/tile"
# value is used, `configure' will try to figure this out automatically.
#erl_xcomp_bigendian=
+# * `erl_xcomp_double_middle_endian` - `yes|no`. No default. If `yes`, the
+# target system must have doubles in "middle-endian" format. If
+# `no`, it has "regular" endianness. This can often be automatically
+# detected, but not always. If not automatically detected,
+# `configure` will fail unless this variable is set. Since no
+# default value is used, `configure` will try to figure this out
+# automatically.
+#erl_xcomp_double_middle_endian
+
# * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes',
# the target system must have a working `clock_gettime()' implementation
# that can be used for retrieving process CPU time.
diff --git a/xcomp/erl-xcomp-avr32-atmel-linux-gnu.conf b/xcomp/erl-xcomp-avr32-atmel-linux-gnu.conf
index f691c6cfd1..e86043f5c8 100644
--- a/xcomp/erl-xcomp-avr32-atmel-linux-gnu.conf
+++ b/xcomp/erl-xcomp-avr32-atmel-linux-gnu.conf
@@ -2,7 +2,7 @@
##
## %CopyrightBegin%
##
-## Copyright Ericsson AB 2010. All Rights Reserved.
+## Copyright Ericsson AB 2010-2012. 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
@@ -59,7 +59,7 @@ erl_xcomp_host=avr32-atmel-linux-gnu
# * `erl_xcomp_configure_flags' - Extra configure flags to pass to the
# `configure' script.
-#erl_xcomp_configure_flags=
+erl_xcomp_configure_flags="--disable-hipe --disable-threads --disable-smp"
## -- Cross Compiler and Other Tools -------------------------------------------
@@ -73,7 +73,7 @@ erl_xcomp_host=avr32-atmel-linux-gnu
CC=avr32-linux-gcc
# * `CFLAGS' - C compiler flags.
-#CFLAGS=
+CFLAGS="-O -Dfinite=__finite"
# * `STATIC_CFLAGS' - Static C compiler flags.
#STATIC_CFLAGS=
@@ -190,6 +190,15 @@ erl_xcomp_sysroot="$ATMEL_SYSROOT_AVR32"
# value is used, `configure' will try to figure this out automatically.
#erl_xcomp_bigendian=
+# * `erl_xcomp_double_middle_endian` - `yes|no`. No default. If `yes`, the
+# target system must have doubles in "middle-endian" format. If
+# `no`, it has "regular" endianness. This can often be automatically
+# detected, but not always. If not automatically detected,
+# `configure` will fail unless this variable is set. Since no
+# default value is used, `configure` will try to figure this out
+# automatically.
+#erl_xcomp_double_middle_endian
+
# * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes',
# the target system must have a working `clock_gettime()' implementation
# that can be used for retrieving process CPU time.
diff --git a/xcomp/erl-xcomp-mips-linux.conf b/xcomp/erl-xcomp-mips-linux.conf
index 3ac057bb4c..e031bdcd26 100644
--- a/xcomp/erl-xcomp-mips-linux.conf
+++ b/xcomp/erl-xcomp-mips-linux.conf
@@ -2,7 +2,7 @@
##
## %CopyrightBegin%
##
-## Copyright Ericsson AB 2010. All Rights Reserved.
+## Copyright Ericsson AB 2010-2012. All Rights Reserved.
##
## The contents of this file are subject to the Erlang Public License,
## Version 1.1, (the "License"); you may not use this file except in
@@ -187,6 +187,15 @@ CFLAGS=-Os
# value is used, `configure' will try to figure this out automatically.
#erl_xcomp_bigendian=
+# * `erl_xcomp_double_middle_endian` - `yes|no`. No default. If `yes`, the
+# target system must have doubles in "middle-endian" format. If
+# `no`, it has "regular" endianness. This can often be automatically
+# detected, but not always. If not automatically detected,
+# `configure` will fail unless this variable is set. Since no
+# default value is used, `configure` will try to figure this out
+# automatically.
+#erl_xcomp_double_middle_endian
+
# * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes',
# the target system must have a working `clock_gettime()' implementation
# that can be used for retrieving process CPU time.
diff --git a/xcomp/erl-xcomp-powerpc-dso-linux-gnu.conf b/xcomp/erl-xcomp-powerpc-dso-linux-gnu.conf
new file mode 100644
index 0000000000..0e0c2f2337
--- /dev/null
+++ b/xcomp/erl-xcomp-powerpc-dso-linux-gnu.conf
@@ -0,0 +1,258 @@
+## -*-shell-script-*-
+##
+## %CopyrightBegin%
+##
+## Copyright Ericsson AB 2009-2012. All Rights Reserved.
+##
+## The contents of this file are subject to the Erlang Public License,
+## Version 1.1, (the "License"); you may not use this file except in
+## compliance with the License. You should have received a copy of the
+## Erlang Public License along with this software. If not, it can be
+## retrieved online at http://www.erlang.org/.
+##
+## Software distributed under the License is distributed on an "AS IS"
+## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+## the License for the specific language governing rights and limitations
+## under the License.
+##
+## %CopyrightEnd%
+##
+## File: erl-xcomp.conf.template
+## Author: Rickard Green
+##
+## -----------------------------------------------------------------------------
+## When cross compiling Erlang/OTP using `otp_build', copy this file and set
+## the variables needed below. Then pass the path to the copy of this file as
+## an argument to `otp_build' in the configure stage:
+## `otp_build configure --xcomp-conf=<FILE>'
+## -----------------------------------------------------------------------------
+
+## Note that you cannot define arbitrary variables in a cross compilation
+## configuration file. Only the ones listed below will be guaranteed to be
+## visible throughout the whole execution of all `configure' scripts. Other
+## variables needs to be defined as arguments to `configure' or exported in
+## the environment.
+
+## -- Variables for `otp_build' Only -------------------------------------------
+
+## Variables in this section are only used, when configuring Erlang/OTP for
+## cross compilation using `$ERL_TOP/otp_build configure'.
+
+## *NOTE*! These variables currently have *no* effect if you configure using
+## the `configure' script directly.
+
+# * `erl_xcomp_build' - The build system used. This value will be passed as
+# `--build=$erl_xcomp_build' argument to the `configure' script. It does
+# not have to be a full `CPU-VENDOR-OS' triplet, but can be. The full
+# `CPU-VENDOR-OS' triplet will be created by
+# `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_build'. If set to `guess',
+# the build system will be guessed using
+# `$ERL_TOP/erts/autoconf/config.guess'.
+erl_xcomp_build=guess
+
+# * `erl_xcomp_host' - Cross host/target system to build for. This value will
+# be passed as `--host=$erl_xcomp_host' argument to the `configure' script.
+# It does not have to be a full `CPU-VENDOR-OS' triplet, but can be. The
+# full `CPU-VENDOR-OS' triplet will be created by
+# `$ERL_TOP/erts/autoconf/config.sub $erl_xcomp_host'.
+erl_xcomp_host=powerpc-dso-linux-gnu
+
+# * `erl_xcomp_configure_flags' - Extra configure flags to pass to the
+# `configure' script.
+erl_xcomp_configure_flags=--without-termcap
+
+## -- Cross Compiler and Other Tools -------------------------------------------
+
+## If the cross compilation tools are prefixed by `<HOST>-' you probably do
+## not need to set these variables (where `<HOST>' is what has been passed as
+## `--host=<HOST>' argument to `configure').
+
+## All variables in this section can also be used when native compiling.
+
+# * `CC' - C compiler.
+CC=powerpc-dso-linux-gnu-gcc
+
+# * `CFLAGS' - C compiler flags.
+#CFLAGS=
+
+# * `STATIC_CFLAGS' - Static C compiler flags.
+#STATIC_CFLAGS=
+
+# * `CFLAG_RUNTIME_LIBRARY_PATH' - This flag should set runtime library
+# search path for the shared libraries. Note that this actually is a
+# linker flag, but it needs to be passed via the compiler.
+#CFLAG_RUNTIME_LIBRARY_PATH=
+
+# * `CPP' - C pre-processor.
+#CPP=
+
+# * `CPPFLAGS' - C pre-processor flags.
+#CPPFLAGS=
+
+# * `CXX' - C++ compiler.
+CXX=powerpc-dso-linux-gnu-g++
+
+# * `CXXFLAGS' - C++ compiler flags.
+#CXXFLAGS=
+
+# * `LD' - Linker.
+LD=powerpc-dso-linux-gnu-ld
+
+# * `LDFLAGS' - Linker flags.
+#LDFLAGS=
+
+# * `LIBS' - Libraries.
+#LIBS=
+
+## -- *D*ynamic *E*rlang *D*river Linking --
+
+## *NOTE*! Either set all or none of the `DED_LD*' variables.
+
+# * `DED_LD' - Linker for Dynamically loaded Erlang Drivers.
+#DED_LD=
+
+# * `DED_LDFLAGS' - Linker flags to use with `DED_LD'.
+#DED_LDFLAGS=
+
+# * `DED_LD_FLAG_RUNTIME_LIBRARY_PATH' - This flag should set runtime library
+# search path for shared libraries when linking with `DED_LD'.
+#DED_LD_FLAG_RUNTIME_LIBRARY_PATH=
+
+## -- Large File Support --
+
+## *NOTE*! Either set all or none of the `LFS_*' variables.
+
+# * `LFS_CFLAGS' - Large file support C compiler flags.
+#LFS_CFLAGS=
+
+# * `LFS_LDFLAGS' - Large file support linker flags.
+#LFS_LDFLAGS=
+
+# * `LFS_LIBS' - Large file support libraries.
+#LFS_LIBS=
+
+## -- Other Tools --
+
+# * `RANLIB' - `ranlib' archive index tool.
+RANLIB=powerpc-dso-linux-gnu-ranlib
+
+# * `AR' - `ar' archiving tool.
+AR=powerpc-dso-linux-gnu-ar
+
+# * `GETCONF' - `getconf' system configuration inspection tool. `getconf' is
+# currently used for finding out large file support flags to use, and
+# on Linux systems for finding out if we have an NPTL thread library or
+# not.
+#GETCONF=
+
+## -- Cross System Root Locations ----------------------------------------------
+
+# * `erl_xcomp_sysroot' - The absolute path to the system root of the cross
+# compilation environment. Currently, the `crypto', `odbc', `ssh' and
+# `ssl' applications need the system root. These applications will be
+# skipped if the system root has not been set. The system root might be
+# needed for other things too. If this is the case and the system root
+# has not been set, `configure' will fail and request you to set it.
+erl_xcomp_sysroot="$DSO_SYSROOT_POWERPC"
+
+# * `erl_xcomp_isysroot' - The absolute path to the system root for includes
+# of the cross compilation environment. If not set, this value defaults
+# to `$erl_xcomp_sysroot', i.e., only set this value if the include system
+# root path is not the same as the system root path.
+#erl_xcomp_isysroot=
+
+## -- Optional Feature, and Bug Tests ------------------------------------------
+
+## These tests cannot (always) be done automatically when cross compiling. You
+## usually do not need to set these variables. Only set these if you really
+## know what you are doing.
+
+## Note that some of these values will override results of tests performed
+## by `configure', and some will not be used until `configure' is sure that
+## it cannot figure the result out.
+
+## The `configure' script will issue a warning when a default value is used.
+## When a variable has been set, no warning will be issued.
+
+# * `erl_xcomp_after_morecore_hook' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `__after_morecore_hook' that can be
+# used for tracking used `malloc()' implementations core memory usage.
+# This is currently only used by unsupported features.
+erl_xcomp_after_morecore_hook=yes
+
+# * `erl_xcomp_bigendian' - `yes|no'. No default. If `yes', the target system
+# must be big endian. If `no', little endian. This can often be
+# automatically detected, but not always. If not automatically detected,
+# `configure' will fail unless this variable is set. Since no default
+# value is used, `configure' will try to figure this out automatically.
+#erl_xcomp_bigendian=
+
+# * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `clock_gettime()' implementation
+# that can be used for retrieving process CPU time.
+#erl_xcomp_clock_gettime_cpu_time=
+
+# * `erl_xcomp_getaddrinfo' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a working `getaddrinfo()' implementation that can
+# handle both IPv4 and IPv6.
+erl_xcomp_getaddrinfo=yes
+
+# * `erl_xcomp_gethrvtime_procfs_ioctl' - `yes|no'. Defaults to `no'. If `yes',
+# the target system must have a working `gethrvtime()' implementation and
+# is used with procfs `ioctl()'.
+#erl_xcomp_gethrvtime_procfs_ioctl=
+
+# * `erl_xcomp_dlsym_brk_wrappers' - `yes|no'. Defaults to `no'. If `yes', the
+# target system must have a working `dlsym(RTLD_NEXT, <S>)' implementation
+# that can be used on `brk' and `sbrk' symbols used by the `malloc()'
+# implementation in use, and by this track the `malloc()' implementations
+# core memory usage. This is currently only used by unsupported features.
+#erl_xcomp_dlsym_brk_wrappers=
+
+# * `erl_xcomp_kqueue' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a working `kqueue()' implementation that returns a file
+# descriptor which can be used by `poll()' and/or `select()'. If `no' and
+# the target system has not got `epoll()' or `/dev/poll', the kernel-poll
+# feature will be disabled.
+#erl_xcomp_kqueue=
+
+# * `erl_xcomp_linux_clock_gettime_correction' - `yes|no'. Defaults to `yes' on
+# Linux; otherwise, `no'. If `yes', `clock_gettime(CLOCK_MONOTONIC, _)' on
+# the target system must work. This variable is recommended to be set to
+# `no' on Linux systems with kernel versions less than 2.6.
+#erl_xcomp_linux_clock_gettime_correction=
+
+# * `erl_xcomp_linux_nptl' - `yes|no'. Defaults to `yes' on Linux; otherwise,
+# `no'. If `yes', the target system must have NPTL (Native POSIX Thread
+# Library). Older Linux systems have LinuxThreads instead of NPTL (Linux
+# kernel versions typically less than 2.6).
+#erl_xcomp_linux_nptl=
+
+# * `erl_xcomp_linux_usable_sigaltstack' - `yes|no'. Defaults to `yes' on Linux;
+# otherwise, `no'. If `yes', `sigaltstack()' must be usable on the target
+# system. `sigaltstack()' on Linux kernel versions less than 2.4 are
+# broken.
+#erl_xcomp_linux_usable_sigaltstack=
+
+# * `erl_xcomp_linux_usable_sigusrx' - `yes|no'. Defaults to `yes'. If `yes',
+# the `SIGUSR1' and `SIGUSR2' signals must be usable by the ERTS. Old
+# LinuxThreads thread libraries (Linux kernel versions typically less than
+# 2.2) used these signals and made them unusable by the ERTS.
+#erl_xcomp_linux_usable_sigusrx=
+
+# * `erl_xcomp_poll' - `yes|no'. Defaults to `no' on Darwin/MacOSX; otherwise,
+# `yes'. If `yes', the target system must have a working `poll()'
+# implementation that also can handle devices. If `no', `select()' will be
+# used instead of `poll()'.
+#erl_xcomp_poll=
+
+# * `erl_xcomp_putenv_copy' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have a `putenv()' implementation that stores a copy of the
+# key/value pair.
+#erl_xcomp_putenv_copy=
+
+# * `erl_xcomp_reliable_fpe' - `yes|no'. Defaults to `no'. If `yes', the target
+# system must have reliable floating point exceptions.
+#erl_xcomp_reliable_fpe=
+
+## -----------------------------------------------------------------------------
diff --git a/xcomp/erl-xcomp-vars.sh b/xcomp/erl-xcomp-vars.sh
index d9972eb3db..eccdff47e3 100644
--- a/xcomp/erl-xcomp-vars.sh
+++ b/xcomp/erl-xcomp-vars.sh
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010. All Rights Reserved.
+# Copyright Ericsson AB 2010-2012. 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
@@ -26,4 +26,4 @@
# and precious variables in $ERL_TOP/erts/aclocal.m4.
#
-erl_xcomp_vars="erl_xcomp_sysroot erl_xcomp_isysroot erl_xcomp_bigendian erl_xcomp_linux_clock_gettime_correction erl_xcomp_linux_nptl erl_xcomp_linux_usable_sigusrx erl_xcomp_linux_usable_sigaltstack erl_xcomp_poll erl_xcomp_kqueue erl_xcomp_putenv_copy erl_xcomp_reliable_fpe erl_xcomp_getaddrinfo erl_xcomp_gethrvtime_procfs_ioctl erl_xcomp_clock_gettime_cpu_time erl_xcomp_after_morecore_hook erl_xcomp_dlsym_brk_wrappers"
+erl_xcomp_vars="erl_xcomp_sysroot erl_xcomp_isysroot erl_xcomp_bigendian erl_xcomp_double_middle_endian erl_xcomp_linux_clock_gettime_correction erl_xcomp_linux_nptl erl_xcomp_linux_usable_sigusrx erl_xcomp_linux_usable_sigaltstack erl_xcomp_poll erl_xcomp_kqueue erl_xcomp_putenv_copy erl_xcomp_reliable_fpe erl_xcomp_getaddrinfo erl_xcomp_gethrvtime_procfs_ioctl erl_xcomp_clock_gettime_cpu_time erl_xcomp_after_morecore_hook erl_xcomp_dlsym_brk_wrappers"
diff --git a/xcomp/erl-xcomp-vxworks_ppc32.conf b/xcomp/erl-xcomp-vxworks_ppc32.conf
index ed8305ea93..7424cee496 100644
--- a/xcomp/erl-xcomp-vxworks_ppc32.conf
+++ b/xcomp/erl-xcomp-vxworks_ppc32.conf
@@ -2,7 +2,7 @@
##
## %CopyrightBegin%
##
-## Copyright Ericsson AB 2009-2010. All Rights Reserved.
+## Copyright Ericsson AB 2009-2012. All Rights Reserved.
##
## The contents of this file are subject to the Erlang Public License,
## Version 1.1, (the "License"); you may not use this file except in
@@ -187,6 +187,15 @@ AR="$WIND_BASE/gnu/3.4.4-vxworks-6.3/$WIND_HOST_TYPE/bin/arppc"
# value is used, `configure' will try to figure this out automatically.
erl_xcomp_bigendian=yes
+# * `erl_xcomp_double_middle_endian` - `yes|no`. No default. If `yes`, the
+# target system must have doubles in "middle-endian" format. If
+# `no`, it has "regular" endianness. This can often be automatically
+# detected, but not always. If not automatically detected,
+# `configure` will fail unless this variable is set. Since no
+# default value is used, `configure` will try to figure this out
+# automatically.
+#erl_xcomp_double_middle_endian
+
# * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes',
# the target system must have a working `clock_gettime()' implementation
# that can be used for retrieving process CPU time.
diff --git a/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf b/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf
index f645ddbd96..d5b9d8c469 100644
--- a/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf
+++ b/xcomp/erl-xcomp-x86_64-saf-linux-gnu.conf
@@ -2,7 +2,7 @@
##
## %CopyrightBegin%
##
-## Copyright Ericsson AB 2010. All Rights Reserved.
+## Copyright Ericsson AB 2010-2012. All Rights Reserved.
##
## The contents of this file are subject to the Erlang Public License,
## Version 1.1, (the "License"); you may not use this file except in
@@ -187,6 +187,15 @@ erl_xcomp_after_morecore_hook=yes
# value is used, `configure' will try to figure this out automatically.
#erl_xcomp_bigendian=
+# * `erl_xcomp_double_middle_endian` - `yes|no`. No default. If `yes`, the
+# target system must have doubles in "middle-endian" format. If
+# `no`, it has "regular" endianness. This can often be automatically
+# detected, but not always. If not automatically detected,
+# `configure` will fail unless this variable is set. Since no
+# default value is used, `configure` will try to figure this out
+# automatically.
+#erl_xcomp_double_middle_endian
+
# * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes',
# the target system must have a working `clock_gettime()' implementation
# that can be used for retrieving process CPU time.
diff --git a/xcomp/erl-xcomp.conf.template b/xcomp/erl-xcomp.conf.template
index eb331ffe92..7d70332cef 100644
--- a/xcomp/erl-xcomp.conf.template
+++ b/xcomp/erl-xcomp.conf.template
@@ -2,7 +2,7 @@
##
## %CopyrightBegin%
##
-## Copyright Ericsson AB 2009-2010. All Rights Reserved.
+## Copyright Ericsson AB 2009-2012. All Rights Reserved.
##
## The contents of this file are subject to the Erlang Public License,
## Version 1.1, (the "License"); you may not use this file except in
@@ -187,6 +187,15 @@
# value is used, `configure' will try to figure this out automatically.
#erl_xcomp_bigendian=
+# * `erl_xcomp_double_middle` - `yes|no`. No default. If `yes`, the
+# target system must have doubles in "middle-endian" format. If
+# `no`, it has "regular" endianness. This can often be automatically
+# detected, but not always. If not automatically detected,
+# `configure` will fail unless this variable is set. Since no
+# default value is used, `configure` will try to figure this out
+# automatically.
+#erl_xcomp_double_middle_endian
+
# * `erl_xcomp_clock_gettime_cpu_time' - `yes|no'. Defaults to `no'. If `yes',
# the target system must have a working `clock_gettime()' implementation
# that can be used for retrieving process CPU time.